From b93d328cac31c17fc135e3d468dc7ecdd108460f Mon Sep 17 00:00:00 2001 From: Andrea Bianco Date: Tue, 10 Mar 2020 20:23:04 +0100 Subject: [PATCH] Built motion from commit (unavailable).|2.4.10 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- public/app/main/apps/chat/i18n/ar.json | 4 +++- public/app/main/apps/chat/i18n/da.json | 4 +++- public/app/main/apps/chat/i18n/de.json | 4 +++- public/app/main/apps/chat/i18n/en.json | 4 +++- public/app/main/apps/chat/i18n/es.json | 4 +++- public/app/main/apps/chat/i18n/fa.json | 4 +++- public/app/main/apps/chat/i18n/fi.json | 4 +++- public/app/main/apps/chat/i18n/fr.json | 4 +++- public/app/main/apps/chat/i18n/he.json | 4 +++- public/app/main/apps/chat/i18n/hi.json | 4 +++- public/app/main/apps/chat/i18n/id.json | 4 +++- public/app/main/apps/chat/i18n/it.json | 4 +++- public/app/main/apps/chat/i18n/ja.json | 4 +++- public/app/main/apps/chat/i18n/ko.json | 4 +++- public/app/main/apps/chat/i18n/lv.json | 4 +++- public/app/main/apps/chat/i18n/nl.json | 4 +++- public/app/main/apps/chat/i18n/no.json | 4 +++- public/app/main/apps/chat/i18n/pl.json | 4 +++- public/app/main/apps/chat/i18n/pt-BR.json | 4 +++- public/app/main/apps/chat/i18n/pt-PT.json | 4 +++- public/app/main/apps/chat/i18n/ru.json | 4 +++- public/app/main/apps/chat/i18n/sv.json | 4 +++- public/app/main/apps/chat/i18n/tr.json | 4 +++- public/app/main/apps/chat/i18n/zh-CN.json | 4 +++- public/app/main/apps/chat/i18n/zh-TW.json | 4 +++- public/app/main/apps/fax/i18n/ar.json | 4 +++- public/app/main/apps/fax/i18n/da.json | 4 +++- public/app/main/apps/fax/i18n/de.json | 4 +++- public/app/main/apps/fax/i18n/en.json | 4 +++- public/app/main/apps/fax/i18n/es.json | 4 +++- public/app/main/apps/fax/i18n/fa.json | 4 +++- public/app/main/apps/fax/i18n/fi.json | 4 +++- public/app/main/apps/fax/i18n/fr.json | 4 +++- public/app/main/apps/fax/i18n/he.json | 4 +++- public/app/main/apps/fax/i18n/hi.json | 4 +++- public/app/main/apps/fax/i18n/id.json | 4 +++- public/app/main/apps/fax/i18n/it.json | 4 +++- public/app/main/apps/fax/i18n/ja.json | 4 +++- public/app/main/apps/fax/i18n/ko.json | 4 +++- public/app/main/apps/fax/i18n/lv.json | 4 +++- public/app/main/apps/fax/i18n/nl.json | 4 +++- public/app/main/apps/fax/i18n/no.json | 4 +++- public/app/main/apps/fax/i18n/pl.json | 4 +++- public/app/main/apps/fax/i18n/pt-BR.json | 4 +++- public/app/main/apps/fax/i18n/pt-PT.json | 4 +++- public/app/main/apps/fax/i18n/ru.json | 4 +++- public/app/main/apps/fax/i18n/sv.json | 4 +++- public/app/main/apps/fax/i18n/tr.json | 4 +++- public/app/main/apps/fax/i18n/zh-CN.json | 4 +++- public/app/main/apps/fax/i18n/zh-TW.json | 4 +++- public/app/main/apps/mail/i18n/ar.json | 4 +++- public/app/main/apps/mail/i18n/da.json | 4 +++- public/app/main/apps/mail/i18n/de.json | 4 +++- public/app/main/apps/mail/i18n/en.json | 4 +++- public/app/main/apps/mail/i18n/es.json | 4 +++- public/app/main/apps/mail/i18n/fa.json | 4 +++- public/app/main/apps/mail/i18n/fi.json | 4 +++- public/app/main/apps/mail/i18n/fr.json | 4 +++- public/app/main/apps/mail/i18n/he.json | 4 +++- public/app/main/apps/mail/i18n/hi.json | 4 +++- public/app/main/apps/mail/i18n/id.json | 4 +++- public/app/main/apps/mail/i18n/it.json | 4 +++- public/app/main/apps/mail/i18n/ja.json | 4 +++- public/app/main/apps/mail/i18n/ko.json | 4 +++- public/app/main/apps/mail/i18n/lv.json | 4 +++- public/app/main/apps/mail/i18n/nl.json | 4 +++- public/app/main/apps/mail/i18n/no.json | 4 +++- public/app/main/apps/mail/i18n/pl.json | 4 +++- public/app/main/apps/mail/i18n/pt-BR.json | 4 +++- public/app/main/apps/mail/i18n/pt-PT.json | 4 +++- public/app/main/apps/mail/i18n/ru.json | 4 +++- public/app/main/apps/mail/i18n/sv.json | 4 +++- public/app/main/apps/mail/i18n/tr.json | 4 +++- public/app/main/apps/mail/i18n/zh-CN.json | 4 +++- public/app/main/apps/mail/i18n/zh-TW.json | 4 +++- public/app/main/apps/motiondialer/i18n/ar.json | 4 +++- public/app/main/apps/motiondialer/i18n/da.json | 4 +++- public/app/main/apps/motiondialer/i18n/de.json | 4 +++- public/app/main/apps/motiondialer/i18n/en.json | 4 +++- public/app/main/apps/motiondialer/i18n/es.json | 4 +++- public/app/main/apps/motiondialer/i18n/fa.json | 4 +++- public/app/main/apps/motiondialer/i18n/fi.json | 4 +++- public/app/main/apps/motiondialer/i18n/fr.json | 4 +++- public/app/main/apps/motiondialer/i18n/he.json | 4 +++- public/app/main/apps/motiondialer/i18n/hi.json | 4 +++- public/app/main/apps/motiondialer/i18n/id.json | 4 +++- public/app/main/apps/motiondialer/i18n/it.json | 4 +++- public/app/main/apps/motiondialer/i18n/ja.json | 4 +++- public/app/main/apps/motiondialer/i18n/ko.json | 4 +++- public/app/main/apps/motiondialer/i18n/lv.json | 4 +++- public/app/main/apps/motiondialer/i18n/nl.json | 4 +++- public/app/main/apps/motiondialer/i18n/no.json | 4 +++- public/app/main/apps/motiondialer/i18n/pl.json | 4 +++- public/app/main/apps/motiondialer/i18n/pt-BR.json | 4 +++- public/app/main/apps/motiondialer/i18n/pt-PT.json | 4 +++- public/app/main/apps/motiondialer/i18n/ru.json | 4 +++- public/app/main/apps/motiondialer/i18n/sv.json | 4 +++- public/app/main/apps/motiondialer/i18n/tr.json | 4 +++- public/app/main/apps/motiondialer/i18n/zh-CN.json | 4 +++- public/app/main/apps/motiondialer/i18n/zh-TW.json | 4 +++- public/app/main/apps/openchannel/i18n/ar.json | 4 +++- public/app/main/apps/openchannel/i18n/da.json | 4 +++- public/app/main/apps/openchannel/i18n/de.json | 4 +++- public/app/main/apps/openchannel/i18n/en.json | 4 +++- public/app/main/apps/openchannel/i18n/es.json | 4 +++- public/app/main/apps/openchannel/i18n/fa.json | 4 +++- public/app/main/apps/openchannel/i18n/fi.json | 4 +++- public/app/main/apps/openchannel/i18n/fr.json | 4 +++- public/app/main/apps/openchannel/i18n/he.json | 4 +++- public/app/main/apps/openchannel/i18n/hi.json | 4 +++- public/app/main/apps/openchannel/i18n/id.json | 4 +++- public/app/main/apps/openchannel/i18n/it.json | 4 +++- public/app/main/apps/openchannel/i18n/ja.json | 4 +++- public/app/main/apps/openchannel/i18n/ko.json | 4 +++- public/app/main/apps/openchannel/i18n/lv.json | 4 +++- public/app/main/apps/openchannel/i18n/nl.json | 4 +++- public/app/main/apps/openchannel/i18n/no.json | 4 +++- public/app/main/apps/openchannel/i18n/pl.json | 4 +++- public/app/main/apps/openchannel/i18n/pt-BR.json | 4 +++- public/app/main/apps/openchannel/i18n/pt-PT.json | 4 +++- public/app/main/apps/openchannel/i18n/ru.json | 4 +++- public/app/main/apps/openchannel/i18n/sv.json | 4 +++- public/app/main/apps/openchannel/i18n/tr.json | 4 +++- public/app/main/apps/openchannel/i18n/zh-CN.json | 4 +++- public/app/main/apps/openchannel/i18n/zh-TW.json | 4 +++- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/index.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- 1176 files changed, 1426 insertions(+), 1176 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 50e2650..2ff3b57 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.4.10", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-03-09T19:05:43.196Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); +define({ "name": "xCALLY Motion API", "version": "2.4.10", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-03-10T19:14:20.142Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index b9ec696..bc0c6da 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.4.10", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-03-09T19:05:43.196Z", "url": "http://apidocjs.com", "version": "0.17.7" } } +{ "name": "xCALLY Motion API", "version": "2.4.10", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-03-10T19:14:20.142Z", "url": "http://apidocjs.com", "version": "0.17.7" } } diff --git a/public/app/main/apps/chat/i18n/ar.json b/public/app/main/apps/chat/i18n/ar.json index ca8723c..59596a9 100644 --- a/public/app/main/apps/chat/i18n/ar.json +++ b/public/app/main/apps/chat/i18n/ar.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "التصرف الإلزامي", "MANDATORYDISPOSITIONPAUSEID": "توقف مؤقتًا للاستخدام إذا تم تمكين التخلص الإلزامي", "ENABLESENDBUTTON": "تمكين زر الإرسال", - "FEEDBACKTITLE": "عنوان التعليق" + "FEEDBACKTITLE": "عنوان التعليق", + "TOOLTIP_SCREENRECORDING_OFF": "تسجيل الشاشة المتاحة", + "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/da.json b/public/app/main/apps/chat/i18n/da.json index 66426ed..f25e897 100644 --- a/public/app/main/apps/chat/i18n/da.json +++ b/public/app/main/apps/chat/i18n/da.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Obligatorisk disposition", "MANDATORYDISPOSITIONPAUSEID": "Brug pause, hvis obligatorisk disposition er aktiveret", "ENABLESENDBUTTON": "Aktivér Send-knap", - "FEEDBACKTITLE": "Feedbacktitel" + "FEEDBACKTITLE": "Feedbacktitel", + "TOOLTIP_SCREENRECORDING_OFF": "Screen optagelse tilgængelig", + "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/de.json b/public/app/main/apps/chat/i18n/de.json index 4e6ed81..767f445 100644 --- a/public/app/main/apps/chat/i18n/de.json +++ b/public/app/main/apps/chat/i18n/de.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Zwingende Disposition", "MANDATORYDISPOSITIONPAUSEID": "Pause zur Verwendung, wenn die obligatorische Disposition aktiviert ist", "ENABLESENDBUTTON": "Schaltfläche \"Senden\" aktivieren", - "FEEDBACKTITLE": "Feedback-Titel" + "FEEDBACKTITLE": "Feedback-Titel", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/en.json b/public/app/main/apps/chat/i18n/en.json index 0c2eddf..3f12031 100644 --- a/public/app/main/apps/chat/i18n/en.json +++ b/public/app/main/apps/chat/i18n/en.json @@ -439,6 +439,8 @@ "REFRESH_INTERACTIONS": "Refresh Interactions", "DELETE_INTERACTION": "Delete Interaction", "AGENTADD_CHATWEBSITE": "Add Agent to Chat Website", - "TEAMS_ASSOCIATION": "Teams Association" + "TEAMS_ASSOCIATION": "Teams Association", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/es.json b/public/app/main/apps/chat/i18n/es.json index e95f37e..b0e008e 100644 --- a/public/app/main/apps/chat/i18n/es.json +++ b/public/app/main/apps/chat/i18n/es.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Cierre obligatorio", "MANDATORYDISPOSITIONPAUSEID": "Pausa a usar si el cierre obligatorio está habilitado", "ENABLESENDBUTTON": "Habilitar botón Enviar", - "FEEDBACKTITLE": "Título de comentarios" + "FEEDBACKTITLE": "Título de comentarios", + "TOOLTIP_SCREENRECORDING_OFF": "Grabación de pantalla disponible", + "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/fa.json b/public/app/main/apps/chat/i18n/fa.json index 7a2355b..8d78e63 100644 --- a/public/app/main/apps/chat/i18n/fa.json +++ b/public/app/main/apps/chat/i18n/fa.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "وضع اجباری", "MANDATORYDISPOSITIONPAUSEID": "در صورت فعال بودن وضع اجباری ، مکث کنید", "ENABLESENDBUTTON": "دکمه ارسال را فعال کنید", - "FEEDBACKTITLE": "عنوان بازخورد" + "FEEDBACKTITLE": "عنوان بازخورد", + "TOOLTIP_SCREENRECORDING_OFF": "ضبط صفحه در دسترس است", + "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/fi.json b/public/app/main/apps/chat/i18n/fi.json index c329d90..f36cc2c 100644 --- a/public/app/main/apps/chat/i18n/fi.json +++ b/public/app/main/apps/chat/i18n/fi.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Pakollinen sijoittaminen", "MANDATORYDISPOSITIONPAUSEID": "Tauko käyttöön, jos pakollinen sijoittaminen on käytössä", "ENABLESENDBUTTON": "Ota Lähetä-painike käyttöön", - "FEEDBACKTITLE": "Palautteen otsikko" + "FEEDBACKTITLE": "Palautteen otsikko", + "TOOLTIP_SCREENRECORDING_OFF": "Näytön tallennus saatavilla", + "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/fr.json b/public/app/main/apps/chat/i18n/fr.json index a2bdaac..6956a5c 100644 --- a/public/app/main/apps/chat/i18n/fr.json +++ b/public/app/main/apps/chat/i18n/fr.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Disposition obligatoire", "MANDATORYDISPOSITIONPAUSEID": "Pause à utiliser si la disposition obligatoire est activée", "ENABLESENDBUTTON": "Activer le bouton d'envoi", - "FEEDBACKTITLE": "Titre de la rétroaction" + "FEEDBACKTITLE": "Titre de la rétroaction", + "TOOLTIP_SCREENRECORDING_OFF": "Enregistrement d'écran disponible", + "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/he.json b/public/app/main/apps/chat/i18n/he.json index 5a87f26..f900e97 100644 --- a/public/app/main/apps/chat/i18n/he.json +++ b/public/app/main/apps/chat/i18n/he.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "סיכום", "MANDATORYDISPOSITIONPAUSEID": "השהה לשימוש אם הסיכום מופעל", "ENABLESENDBUTTON": "אפשר לחצן שלח", - "FEEDBACKTITLE": "כותרת משוב" + "FEEDBACKTITLE": "כותרת משוב", + "TOOLTIP_SCREENRECORDING_OFF": "הקלטת מסך זמינה", + "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/hi.json b/public/app/main/apps/chat/i18n/hi.json index c851174..ce5403f 100644 --- a/public/app/main/apps/chat/i18n/hi.json +++ b/public/app/main/apps/chat/i18n/hi.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "अनिवार्य स्वभाव", "MANDATORYDISPOSITIONPAUSEID": "यदि अनिवार्य स्वभाव सक्षम है, तो उपयोग करने के लिए रुकें", "ENABLESENDBUTTON": "सक्षम करें बटन भेजें", - "FEEDBACKTITLE": "प्रतिक्रिया शीर्षक" + "FEEDBACKTITLE": "प्रतिक्रिया शीर्षक", + "TOOLTIP_SCREENRECORDING_OFF": "स्क्रीन रिकॉर्डिंग उपलब्ध है", + "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/id.json b/public/app/main/apps/chat/i18n/id.json index 0d73bb0..2adcfab 100644 --- a/public/app/main/apps/chat/i18n/id.json +++ b/public/app/main/apps/chat/i18n/id.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Disposisi wajib", "MANDATORYDISPOSITIONPAUSEID": "Jeda untuk digunakan jika disposisi wajib diaktifkan", "ENABLESENDBUTTON": "Aktifkan Tombol Kirim", - "FEEDBACKTITLE": "Judul Umpan Balik" + "FEEDBACKTITLE": "Judul Umpan Balik", + "TOOLTIP_SCREENRECORDING_OFF": "Rekaman Layar tersedia", + "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/it.json b/public/app/main/apps/chat/i18n/it.json index acd9fb9..288818a 100644 --- a/public/app/main/apps/chat/i18n/it.json +++ b/public/app/main/apps/chat/i18n/it.json @@ -439,6 +439,8 @@ "TEAMS_ASSOCIATION": "Associazione Teams", "MANDATORYDISPOSITION": "Disposizione obbligatoria", "MANDATORYDISPOSITIONPAUSEID": "Pausa da utilizzare se è abilitata la disposizione obbligatoria", - "ENABLESENDBUTTON": "Abilita pulsante Invia" + "ENABLESENDBUTTON": "Abilita pulsante Invia", + "TOOLTIP_SCREENRECORDING_OFF": "Registrazione dello schermo disponibile", + "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/ja.json b/public/app/main/apps/chat/i18n/ja.json index 9575353..cd09e2c 100644 --- a/public/app/main/apps/chat/i18n/ja.json +++ b/public/app/main/apps/chat/i18n/ja.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "強制処分", "MANDATORYDISPOSITIONPAUSEID": "強制処分が有効になっている場合に使用する一時停止", "ENABLESENDBUTTON": "送信ボタンを有効にする", - "FEEDBACKTITLE": "フィードバックのタイトル" + "FEEDBACKTITLE": "フィードバックのタイトル", + "TOOLTIP_SCREENRECORDING_OFF": "利用可能なスクリーン録画", + "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/ko.json b/public/app/main/apps/chat/i18n/ko.json index accd6cf..6b1e5e1 100644 --- a/public/app/main/apps/chat/i18n/ko.json +++ b/public/app/main/apps/chat/i18n/ko.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "의무 처분", "MANDATORYDISPOSITIONPAUSEID": "강제 처분이 활성화 된 경우 사용 중지", "ENABLESENDBUTTON": "보내기 버튼 사용", - "FEEDBACKTITLE": "피드백 제목" + "FEEDBACKTITLE": "피드백 제목", + "TOOLTIP_SCREENRECORDING_OFF": "스크린 녹화 가능", + "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/lv.json b/public/app/main/apps/chat/i18n/lv.json index 738e837..15b4097 100644 --- a/public/app/main/apps/chat/i18n/lv.json +++ b/public/app/main/apps/chat/i18n/lv.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Obligāta rīcība", "MANDATORYDISPOSITIONPAUSEID": "Lietošanas pārtraukšana, ja ir iespējota obligātā izvietošana", "ENABLESENDBUTTON": "Iespējot pogu Sūtīt", - "FEEDBACKTITLE": "Atsauksmju nosaukums" + "FEEDBACKTITLE": "Atsauksmju nosaukums", + "TOOLTIP_SCREENRECORDING_OFF": "Ekrāna ieraksts ir pieejams", + "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/nl.json b/public/app/main/apps/chat/i18n/nl.json index 3e4e796..e413b96 100644 --- a/public/app/main/apps/chat/i18n/nl.json +++ b/public/app/main/apps/chat/i18n/nl.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Verplichte regeling", "MANDATORYDISPOSITIONPAUSEID": "Pauze om te gebruiken als verplichte dispositie is ingeschakeld", "ENABLESENDBUTTON": "Schakel de verzendknop in", - "FEEDBACKTITLE": "Feedbacktitel" + "FEEDBACKTITLE": "Feedbacktitel", + "TOOLTIP_SCREENRECORDING_OFF": "Schermopname beschikbaar", + "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/no.json b/public/app/main/apps/chat/i18n/no.json index 333f7b5..eac1809 100644 --- a/public/app/main/apps/chat/i18n/no.json +++ b/public/app/main/apps/chat/i18n/no.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Obligatorisk disposisjon", "MANDATORYDISPOSITIONPAUSEID": "Bruk pause hvis obligatorisk disposisjon er aktivert", "ENABLESENDBUTTON": "Aktiver sendeknapp", - "FEEDBACKTITLE": "Tilbakemeldingstittel" + "FEEDBACKTITLE": "Tilbakemeldingstittel", + "TOOLTIP_SCREENRECORDING_OFF": "Skjermopptak tilgjengelig", + "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/pl.json b/public/app/main/apps/chat/i18n/pl.json index a6cc732..7c2b602 100644 --- a/public/app/main/apps/chat/i18n/pl.json +++ b/public/app/main/apps/chat/i18n/pl.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Dyspozycja obowiązkowa", "MANDATORYDISPOSITIONPAUSEID": "Wstrzymaj korzystanie, jeśli włączona jest obowiązkowa dyspozycja", "ENABLESENDBUTTON": "Włącz przycisk wysyłania", - "FEEDBACKTITLE": "Tytuł opinii" + "FEEDBACKTITLE": "Tytuł opinii", + "TOOLTIP_SCREENRECORDING_OFF": "Dostępne nagrywanie ekranu", + "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/pt-BR.json b/public/app/main/apps/chat/i18n/pt-BR.json index 16db379..9c1e267 100644 --- a/public/app/main/apps/chat/i18n/pt-BR.json +++ b/public/app/main/apps/chat/i18n/pt-BR.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Disposição obrigatória", "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada", "ENABLESENDBUTTON": "Ativar botão Enviar", - "FEEDBACKTITLE": "Título do Feedback" + "FEEDBACKTITLE": "Título do Feedback", + "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/pt-PT.json b/public/app/main/apps/chat/i18n/pt-PT.json index af52fd5..6d3de90 100644 --- a/public/app/main/apps/chat/i18n/pt-PT.json +++ b/public/app/main/apps/chat/i18n/pt-PT.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Disposição obrigatória", "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada", "ENABLESENDBUTTON": "Ativar botão Enviar", - "FEEDBACKTITLE": "Título do Feedback" + "FEEDBACKTITLE": "Título do Feedback", + "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/ru.json b/public/app/main/apps/chat/i18n/ru.json index 73a8a84..812a8ef 100644 --- a/public/app/main/apps/chat/i18n/ru.json +++ b/public/app/main/apps/chat/i18n/ru.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Обязательное распоряжение", "MANDATORYDISPOSITIONPAUSEID": "Пауза для использования, если включена обязательная утилизация", "ENABLESENDBUTTON": "Включить кнопку отправки", - "FEEDBACKTITLE": "Название отзыва" + "FEEDBACKTITLE": "Название отзыва", + "TOOLTIP_SCREENRECORDING_OFF": "Запись экрана доступна", + "TOOLTIP_SCREENRECORDING_ON": "Идет запись экрана" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/sv.json b/public/app/main/apps/chat/i18n/sv.json index a18e805..47d84e8 100644 --- a/public/app/main/apps/chat/i18n/sv.json +++ b/public/app/main/apps/chat/i18n/sv.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Obligatorisk kategorisering", "MANDATORYDISPOSITIONPAUSEID": "Pausa för atta nvända om obligatorisk kategorisering är aktiverad", "ENABLESENDBUTTON": "Aktivera skicka-knappen", - "FEEDBACKTITLE": "Feedbacktitel" + "FEEDBACKTITLE": "Feedbacktitel", + "TOOLTIP_SCREENRECORDING_OFF": "Skärminspelning tillgänglig", + "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/tr.json b/public/app/main/apps/chat/i18n/tr.json index 9fe0cd3..3fb4781 100644 --- a/public/app/main/apps/chat/i18n/tr.json +++ b/public/app/main/apps/chat/i18n/tr.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "Zorunlu düzenleme", "MANDATORYDISPOSITIONPAUSEID": "Zorunlu bırakma etkinse, kullanımı duraklat", "ENABLESENDBUTTON": "Gönder Düğmesini Etkinleştir", - "FEEDBACKTITLE": "Geribildirim Başlığı" + "FEEDBACKTITLE": "Geribildirim Başlığı", + "TOOLTIP_SCREENRECORDING_OFF": "Ekran Kaydı mevcut", + "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/zh-CN.json b/public/app/main/apps/chat/i18n/zh-CN.json index f705830..d2b33c9 100644 --- a/public/app/main/apps/chat/i18n/zh-CN.json +++ b/public/app/main/apps/chat/i18n/zh-CN.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "强制性处分", "MANDATORYDISPOSITIONPAUSEID": "如果启用了强制性处置,则暂停使用", "ENABLESENDBUTTON": "启用发送按钮", - "FEEDBACKTITLE": "反馈标题" + "FEEDBACKTITLE": "反馈标题", + "TOOLTIP_SCREENRECORDING_OFF": "屏幕录像可用", + "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/zh-TW.json b/public/app/main/apps/chat/i18n/zh-TW.json index 279c023..766a025 100644 --- a/public/app/main/apps/chat/i18n/zh-TW.json +++ b/public/app/main/apps/chat/i18n/zh-TW.json @@ -439,6 +439,8 @@ "MANDATORYDISPOSITION": "強制性處分", "MANDATORYDISPOSITIONPAUSEID": "如果啟用了強制性處置,則暫停使用", "ENABLESENDBUTTON": "啟用發送按鈕", - "FEEDBACKTITLE": "反饋標題" + "FEEDBACKTITLE": "反饋標題", + "TOOLTIP_SCREENRECORDING_OFF": "屏幕錄像可用", + "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/ar.json b/public/app/main/apps/fax/i18n/ar.json index f25fb3c..80be4d9 100644 --- a/public/app/main/apps/fax/i18n/ar.json +++ b/public/app/main/apps/fax/i18n/ar.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "وقفة الوقت", "TEAMS_ASSOCIATION": "رابطة الفرق", "MANDATORYDISPOSITION": "التصرف الإلزامي", - "MANDATORYDISPOSITIONPAUSEID": "وقفة الوضع عندما تكون في تصرف إلزامي" + "MANDATORYDISPOSITIONPAUSEID": "وقفة الوضع عندما تكون في تصرف إلزامي", + "TOOLTIP_SCREENRECORDING_OFF": "تسجيل الشاشة المتاحة", + "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/da.json b/public/app/main/apps/fax/i18n/da.json index 896ae5e..fa865f4 100644 --- a/public/app/main/apps/fax/i18n/da.json +++ b/public/app/main/apps/fax/i18n/da.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Pause tid", "TEAMS_ASSOCIATION": "Holdforening", "MANDATORYDISPOSITION": "Obligatorisk disposition", - "MANDATORYDISPOSITIONPAUSEID": "Stop status, når du er i obligatorisk disposition" + "MANDATORYDISPOSITIONPAUSEID": "Stop status, når du er i obligatorisk disposition", + "TOOLTIP_SCREENRECORDING_OFF": "Screen optagelse tilgængelig", + "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/de.json b/public/app/main/apps/fax/i18n/de.json index 7643dca..d582aaf 100644 --- a/public/app/main/apps/fax/i18n/de.json +++ b/public/app/main/apps/fax/i18n/de.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Pausenzeit", "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", "MANDATORYDISPOSITION": "Zwingende Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Status pausieren, wenn die Disposition obligatorisch ist" + "MANDATORYDISPOSITIONPAUSEID": "Status pausieren, wenn die Disposition obligatorisch ist", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/en.json b/public/app/main/apps/fax/i18n/en.json index 7d6da03..10e8e95 100644 --- a/public/app/main/apps/fax/i18n/en.json +++ b/public/app/main/apps/fax/i18n/en.json @@ -251,6 +251,8 @@ "REFRESH_INTERACTIONS": "Refresh Interactions", "DELETE_INTERACTION": "Delete Interaction", "AGENTADD_FAXACCOUNT": "Add Agent to Fax Account", - "TEAMS_ASSOCIATION": "Teams Association" + "TEAMS_ASSOCIATION": "Teams Association", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/es.json b/public/app/main/apps/fax/i18n/es.json index 130d506..a0b4988 100644 --- a/public/app/main/apps/fax/i18n/es.json +++ b/public/app/main/apps/fax/i18n/es.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Tiempo de pausa", "TEAMS_ASSOCIATION": "Asociación de equipos", "MANDATORYDISPOSITION": "Cierre obligatorio", - "MANDATORYDISPOSITIONPAUSEID": "Estado de pausa cuando está un cierre obligatorio" + "MANDATORYDISPOSITIONPAUSEID": "Estado de pausa cuando está un cierre obligatorio", + "TOOLTIP_SCREENRECORDING_OFF": "Grabación de pantalla disponible", + "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/fa.json b/public/app/main/apps/fax/i18n/fa.json index b8f2022..ecfc98d 100644 --- a/public/app/main/apps/fax/i18n/fa.json +++ b/public/app/main/apps/fax/i18n/fa.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "مکث زمان", "TEAMS_ASSOCIATION": "انجمن تیم", "MANDATORYDISPOSITION": "وضع اجباری", - "MANDATORYDISPOSITIONPAUSEID": "وضعیت مکث در حالت اجباری" + "MANDATORYDISPOSITIONPAUSEID": "وضعیت مکث در حالت اجباری", + "TOOLTIP_SCREENRECORDING_OFF": "ضبط صفحه در دسترس است", + "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/fi.json b/public/app/main/apps/fax/i18n/fi.json index d7f75f5..7726adc 100644 --- a/public/app/main/apps/fax/i18n/fi.json +++ b/public/app/main/apps/fax/i18n/fi.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Keskeytä aika", "TEAMS_ASSOCIATION": "Joukkueiden yhdistys", "MANDATORYDISPOSITION": "Pakollinen sijoittaminen", - "MANDATORYDISPOSITIONPAUSEID": "Keskeytä tila pakollisessa asennuksessa" + "MANDATORYDISPOSITIONPAUSEID": "Keskeytä tila pakollisessa asennuksessa", + "TOOLTIP_SCREENRECORDING_OFF": "Näytön tallennus saatavilla", + "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/fr.json b/public/app/main/apps/fax/i18n/fr.json index 6e22a62..d0ee194 100644 --- a/public/app/main/apps/fax/i18n/fr.json +++ b/public/app/main/apps/fax/i18n/fr.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Temps de pause", "TEAMS_ASSOCIATION": "Association des équipes", "MANDATORYDISPOSITION": "Disposition obligatoire", - "MANDATORYDISPOSITIONPAUSEID": "Statut de pause en cas de disposition obligatoire" + "MANDATORYDISPOSITIONPAUSEID": "Statut de pause en cas de disposition obligatoire", + "TOOLTIP_SCREENRECORDING_OFF": "Enregistrement d'écran disponible", + "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/he.json b/public/app/main/apps/fax/i18n/he.json index 79c12d3..00999bd 100644 --- a/public/app/main/apps/fax/i18n/he.json +++ b/public/app/main/apps/fax/i18n/he.json @@ -251,6 +251,8 @@ "AGENTADD_FAXACCOUNT": "הוסף נציג לחשבון הפקס", "TEAMS_ASSOCIATION": "איגוד הצוותים", "MANDATORYDISPOSITION": "סיכום", - "MANDATORYDISPOSITIONPAUSEID": "השהה סטטוס לסיכום" + "MANDATORYDISPOSITIONPAUSEID": "השהה סטטוס לסיכום", + "TOOLTIP_SCREENRECORDING_OFF": "הקלטת מסך זמינה", + "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/hi.json b/public/app/main/apps/fax/i18n/hi.json index f6b7061..cb5adbf 100644 --- a/public/app/main/apps/fax/i18n/hi.json +++ b/public/app/main/apps/fax/i18n/hi.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "विराम का वक्त", "TEAMS_ASSOCIATION": "टीमों एसोसिएशन", "MANDATORYDISPOSITION": "अनिवार्य स्वभाव", - "MANDATORYDISPOSITIONPAUSEID": "अनिवार्य स्थिति में स्थिति को रोकें" + "MANDATORYDISPOSITIONPAUSEID": "अनिवार्य स्थिति में स्थिति को रोकें", + "TOOLTIP_SCREENRECORDING_OFF": "स्क्रीन रिकॉर्डिंग उपलब्ध है", + "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/id.json b/public/app/main/apps/fax/i18n/id.json index cbd39b2..3b30df8 100644 --- a/public/app/main/apps/fax/i18n/id.json +++ b/public/app/main/apps/fax/i18n/id.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Jeda waktu", "TEAMS_ASSOCIATION": "Asosiasi Tim", "MANDATORYDISPOSITION": "Disposisi wajib", - "MANDATORYDISPOSITIONPAUSEID": "Jeda status saat dalam disposisi wajib" + "MANDATORYDISPOSITIONPAUSEID": "Jeda status saat dalam disposisi wajib", + "TOOLTIP_SCREENRECORDING_OFF": "Rekaman Layar tersedia", + "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/it.json b/public/app/main/apps/fax/i18n/it.json index 1f029da..ed4fdb8 100644 --- a/public/app/main/apps/fax/i18n/it.json +++ b/public/app/main/apps/fax/i18n/it.json @@ -251,6 +251,8 @@ "AGENTADD_FAXACCOUNT": "Aggiungi Agente ad account Fax", "TEAMS_ASSOCIATION": "Associazione Teams", "MANDATORYDISPOSITION": "Disposizione obbligatoria", - "MANDATORYDISPOSITIONPAUSEID": "Metti in pausa lo stato quando è nella disposizione obbligatoria" + "MANDATORYDISPOSITIONPAUSEID": "Metti in pausa lo stato quando è nella disposizione obbligatoria", + "TOOLTIP_SCREENRECORDING_OFF": "Registrazione dello schermo disponibile", + "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/ja.json b/public/app/main/apps/fax/i18n/ja.json index 7f332a7..95d1ace 100644 --- a/public/app/main/apps/fax/i18n/ja.json +++ b/public/app/main/apps/fax/i18n/ja.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "時間を一時停止", "TEAMS_ASSOCIATION": "チーム協会", "MANDATORYDISPOSITION": "強制処分", - "MANDATORYDISPOSITIONPAUSEID": "強制処分の場合の一時停止ステータス" + "MANDATORYDISPOSITIONPAUSEID": "強制処分の場合の一時停止ステータス", + "TOOLTIP_SCREENRECORDING_OFF": "利用可能なスクリーン録画", + "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/ko.json b/public/app/main/apps/fax/i18n/ko.json index 84a455d..bd72ac5 100644 --- a/public/app/main/apps/fax/i18n/ko.json +++ b/public/app/main/apps/fax/i18n/ko.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "일시 중지 시간", "TEAMS_ASSOCIATION": "팀 협회", "MANDATORYDISPOSITION": "의무 처분", - "MANDATORYDISPOSITIONPAUSEID": "강제 처분시 일시 중지 상태" + "MANDATORYDISPOSITIONPAUSEID": "강제 처분시 일시 중지 상태", + "TOOLTIP_SCREENRECORDING_OFF": "스크린 녹화 가능", + "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/lv.json b/public/app/main/apps/fax/i18n/lv.json index 1cb5e79..6c42c1c 100644 --- a/public/app/main/apps/fax/i18n/lv.json +++ b/public/app/main/apps/fax/i18n/lv.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Pārtraukuma ilgums", "TEAMS_ASSOCIATION": "Komandu asociācija", "MANDATORYDISPOSITION": "Obligāta rīcība", - "MANDATORYDISPOSITIONPAUSEID": "Pauzēt statusu, kad ir obligāta rīcība" + "MANDATORYDISPOSITIONPAUSEID": "Pauzēt statusu, kad ir obligāta rīcība", + "TOOLTIP_SCREENRECORDING_OFF": "Ekrāna ieraksts ir pieejams", + "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/nl.json b/public/app/main/apps/fax/i18n/nl.json index e8f6905..25a0392 100644 --- a/public/app/main/apps/fax/i18n/nl.json +++ b/public/app/main/apps/fax/i18n/nl.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Pauzetijd", "TEAMS_ASSOCIATION": "Teams Association", "MANDATORYDISPOSITION": "Verplichte regeling", - "MANDATORYDISPOSITIONPAUSEID": "Pauzestatus wanneer in verplichte opstelling" + "MANDATORYDISPOSITIONPAUSEID": "Pauzestatus wanneer in verplichte opstelling", + "TOOLTIP_SCREENRECORDING_OFF": "Schermopname beschikbaar", + "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/no.json b/public/app/main/apps/fax/i18n/no.json index 22360c0..586d6ae 100644 --- a/public/app/main/apps/fax/i18n/no.json +++ b/public/app/main/apps/fax/i18n/no.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Pause tid", "TEAMS_ASSOCIATION": "Lagforening", "MANDATORYDISPOSITION": "Obligatorisk disposisjon", - "MANDATORYDISPOSITIONPAUSEID": "Pausestatus når du er i obligatorisk disposisjon" + "MANDATORYDISPOSITIONPAUSEID": "Pausestatus når du er i obligatorisk disposisjon", + "TOOLTIP_SCREENRECORDING_OFF": "Skjermopptak tilgjengelig", + "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/pl.json b/public/app/main/apps/fax/i18n/pl.json index e9e017c..8a3d1c8 100644 --- a/public/app/main/apps/fax/i18n/pl.json +++ b/public/app/main/apps/fax/i18n/pl.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Czas przerwy", "TEAMS_ASSOCIATION": "Stowarzyszenie zespołów", "MANDATORYDISPOSITION": "Dyspozycja obowiązkowa", - "MANDATORYDISPOSITIONPAUSEID": "Zatrzymaj status, gdy jesteś w obowiązkowej dyspozycji" + "MANDATORYDISPOSITIONPAUSEID": "Zatrzymaj status, gdy jesteś w obowiązkowej dyspozycji", + "TOOLTIP_SCREENRECORDING_OFF": "Dostępne nagrywanie ekranu", + "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/pt-BR.json b/public/app/main/apps/fax/i18n/pt-BR.json index 8d652f8..5cb002c 100644 --- a/public/app/main/apps/fax/i18n/pt-BR.json +++ b/public/app/main/apps/fax/i18n/pt-BR.json @@ -251,6 +251,8 @@ "AGENTADD_FAXACCOUNT": "Adicionar agente à conta de fax", "TEAMS_ASSOCIATION": "Associação de equipes", "MANDATORYDISPOSITION": "Disposição obrigatória", - "MANDATORYDISPOSITIONPAUSEID": "Status de pausa quando em disposição obrigatória" + "MANDATORYDISPOSITIONPAUSEID": "Status de pausa quando em disposição obrigatória", + "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/pt-PT.json b/public/app/main/apps/fax/i18n/pt-PT.json index c2dac1e..524865a 100644 --- a/public/app/main/apps/fax/i18n/pt-PT.json +++ b/public/app/main/apps/fax/i18n/pt-PT.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Tempo de pausa", "TEAMS_ASSOCIATION": "Associação de equipes", "MANDATORYDISPOSITION": "Disposição obrigatória", - "MANDATORYDISPOSITIONPAUSEID": "Status de pausa quando em disposição obrigatória" + "MANDATORYDISPOSITIONPAUSEID": "Status de pausa quando em disposição obrigatória", + "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/ru.json b/public/app/main/apps/fax/i18n/ru.json index b0f0b73..687f844 100644 --- a/public/app/main/apps/fax/i18n/ru.json +++ b/public/app/main/apps/fax/i18n/ru.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Время паузы", "TEAMS_ASSOCIATION": "Ассоциация команд", "MANDATORYDISPOSITION": "Обязательное распоряжение", - "MANDATORYDISPOSITIONPAUSEID": "Состояние паузы, когда в обязательном порядке" + "MANDATORYDISPOSITIONPAUSEID": "Состояние паузы, когда в обязательном порядке", + "TOOLTIP_SCREENRECORDING_OFF": "Запись экрана доступна", + "TOOLTIP_SCREENRECORDING_ON": "Идет запись экрана" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/sv.json b/public/app/main/apps/fax/i18n/sv.json index b774c6b..52f2d92 100644 --- a/public/app/main/apps/fax/i18n/sv.json +++ b/public/app/main/apps/fax/i18n/sv.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Paus tid", "TEAMS_ASSOCIATION": "Teamassociation", "MANDATORYDISPOSITION": "Obligatorisk kategorisering", - "MANDATORYDISPOSITIONPAUSEID": "Pausstatus när du är i obligatorisk kategorisering" + "MANDATORYDISPOSITIONPAUSEID": "Pausstatus när du är i obligatorisk kategorisering", + "TOOLTIP_SCREENRECORDING_OFF": "Skärminspelning tillgänglig", + "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/tr.json b/public/app/main/apps/fax/i18n/tr.json index 04b6b2e..aa14efd 100644 --- a/public/app/main/apps/fax/i18n/tr.json +++ b/public/app/main/apps/fax/i18n/tr.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "Durma zamanı", "TEAMS_ASSOCIATION": "Takımlar Birliği", "MANDATORYDISPOSITION": "Zorunlu düzenleme", - "MANDATORYDISPOSITIONPAUSEID": "Zorunlu görevde iken durumu duraklat" + "MANDATORYDISPOSITIONPAUSEID": "Zorunlu görevde iken durumu duraklat", + "TOOLTIP_SCREENRECORDING_OFF": "Ekran Kaydı mevcut", + "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/zh-CN.json b/public/app/main/apps/fax/i18n/zh-CN.json index 8f6f8f6..9b3333b 100644 --- a/public/app/main/apps/fax/i18n/zh-CN.json +++ b/public/app/main/apps/fax/i18n/zh-CN.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "暂停时间", "TEAMS_ASSOCIATION": "团队协会", "MANDATORYDISPOSITION": "强制性处分", - "MANDATORYDISPOSITIONPAUSEID": "在强制处置时暂停状态" + "MANDATORYDISPOSITIONPAUSEID": "在强制处置时暂停状态", + "TOOLTIP_SCREENRECORDING_OFF": "屏幕录像可用", + "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/zh-TW.json b/public/app/main/apps/fax/i18n/zh-TW.json index ecc41e8..b334f29 100644 --- a/public/app/main/apps/fax/i18n/zh-TW.json +++ b/public/app/main/apps/fax/i18n/zh-TW.json @@ -251,6 +251,8 @@ "PAUSE_TIME": "暫停時間", "TEAMS_ASSOCIATION": "團隊協會", "MANDATORYDISPOSITION": "強制性處分", - "MANDATORYDISPOSITIONPAUSEID": "在強制處置時暫停狀態" + "MANDATORYDISPOSITIONPAUSEID": "在強制處置時暫停狀態", + "TOOLTIP_SCREENRECORDING_OFF": "屏幕錄像可用", + "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/ar.json b/public/app/main/apps/mail/i18n/ar.json index 0a5cba6..eb90abd 100644 --- a/public/app/main/apps/mail/i18n/ar.json +++ b/public/app/main/apps/mail/i18n/ar.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "رابطة الفرق", "MANDATORYDISPOSITION": "التصرف الإلزامي", "MANDATORYDISPOSITIONPAUSEID": "توقف مؤقتًا للاستخدام إذا تم تمكين التخلص الإلزامي", - "ADVANCED": "المتقدمة" + "ADVANCED": "المتقدمة", + "TOOLTIP_SCREENRECORDING_OFF": "تسجيل الشاشة المتاحة", + "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/da.json b/public/app/main/apps/mail/i18n/da.json index c22b4c1..b7706b6 100644 --- a/public/app/main/apps/mail/i18n/da.json +++ b/public/app/main/apps/mail/i18n/da.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Holdforening", "MANDATORYDISPOSITION": "Obligatorisk disposition", "MANDATORYDISPOSITIONPAUSEID": "Brug pause, hvis obligatorisk disposition er aktiveret", - "ADVANCED": "Fremskreden" + "ADVANCED": "Fremskreden", + "TOOLTIP_SCREENRECORDING_OFF": "Screen optagelse tilgængelig", + "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/de.json b/public/app/main/apps/mail/i18n/de.json index f17597a..9fc23a5 100644 --- a/public/app/main/apps/mail/i18n/de.json +++ b/public/app/main/apps/mail/i18n/de.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", "MANDATORYDISPOSITION": "Zwingende Disposition", "MANDATORYDISPOSITIONPAUSEID": "Pause zur Verwendung, wenn die obligatorische Disposition aktiviert ist", - "ADVANCED": "Fortgeschritten" + "ADVANCED": "Fortgeschritten", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/en.json b/public/app/main/apps/mail/i18n/en.json index 3dfb743..d7f2618 100644 --- a/public/app/main/apps/mail/i18n/en.json +++ b/public/app/main/apps/mail/i18n/en.json @@ -314,6 +314,8 @@ "REFRESH_INTERACTIONS": "Refresh Interactions", "DELETE_INTERACTION": "Delete Interaction", "AGENTADD_MAILACCOUNT": "Add Agent to Email Account", - "TEAMS_ASSOCIATION": "Teams Association" + "TEAMS_ASSOCIATION": "Teams Association", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/es.json b/public/app/main/apps/mail/i18n/es.json index 8459f90..14ab061 100644 --- a/public/app/main/apps/mail/i18n/es.json +++ b/public/app/main/apps/mail/i18n/es.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Asociación de equipos", "MANDATORYDISPOSITION": "Cierre obligatorio", "MANDATORYDISPOSITIONPAUSEID": "Pausa a usar si el cierre obligatorio está habilitado", - "ADVANCED": "Avanzado" + "ADVANCED": "Avanzado", + "TOOLTIP_SCREENRECORDING_OFF": "Grabación de pantalla disponible", + "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/fa.json b/public/app/main/apps/mail/i18n/fa.json index cfd196b..2bb8280 100644 --- a/public/app/main/apps/mail/i18n/fa.json +++ b/public/app/main/apps/mail/i18n/fa.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "انجمن تیم", "MANDATORYDISPOSITION": "وضع اجباری", "MANDATORYDISPOSITIONPAUSEID": "در صورت فعال بودن وضع اجباری ، مکث کنید", - "ADVANCED": "پیشرفته" + "ADVANCED": "پیشرفته", + "TOOLTIP_SCREENRECORDING_OFF": "ضبط صفحه در دسترس است", + "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/fi.json b/public/app/main/apps/mail/i18n/fi.json index 76a17ea..c6cb245 100644 --- a/public/app/main/apps/mail/i18n/fi.json +++ b/public/app/main/apps/mail/i18n/fi.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Joukkueiden yhdistys", "MANDATORYDISPOSITION": "Pakollinen sijoittaminen", "MANDATORYDISPOSITIONPAUSEID": "Tauko käyttöön, jos pakollinen sijoittaminen on käytössä", - "ADVANCED": "Pitkälle kehittynyt" + "ADVANCED": "Pitkälle kehittynyt", + "TOOLTIP_SCREENRECORDING_OFF": "Näytön tallennus saatavilla", + "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/fr.json b/public/app/main/apps/mail/i18n/fr.json index 153ec8d..d14fd82 100644 --- a/public/app/main/apps/mail/i18n/fr.json +++ b/public/app/main/apps/mail/i18n/fr.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Association des équipes", "MANDATORYDISPOSITION": "Disposition obligatoire", "MANDATORYDISPOSITIONPAUSEID": "Pause à utiliser si la disposition obligatoire est activée", - "ADVANCED": "Avancée" + "ADVANCED": "Avancée", + "TOOLTIP_SCREENRECORDING_OFF": "Enregistrement d'écran disponible", + "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/he.json b/public/app/main/apps/mail/i18n/he.json index edf8e62..a183cd5 100644 --- a/public/app/main/apps/mail/i18n/he.json +++ b/public/app/main/apps/mail/i18n/he.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "איגוד הצוותים", "MANDATORYDISPOSITION": "סיכום", "MANDATORYDISPOSITIONPAUSEID": "השהה שימוש כשהסיכום מופעל", - "ADVANCED": "מתקדם" + "ADVANCED": "מתקדם", + "TOOLTIP_SCREENRECORDING_OFF": "הקלטת מסך זמינה", + "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/hi.json b/public/app/main/apps/mail/i18n/hi.json index 42ea8ae..7f74189 100644 --- a/public/app/main/apps/mail/i18n/hi.json +++ b/public/app/main/apps/mail/i18n/hi.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "टीमों एसोसिएशन", "MANDATORYDISPOSITION": "अनिवार्य स्वभाव", "MANDATORYDISPOSITIONPAUSEID": "यदि अनिवार्य स्वभाव सक्षम है, तो उपयोग करने के लिए रुकें", - "ADVANCED": "उन्नत" + "ADVANCED": "उन्नत", + "TOOLTIP_SCREENRECORDING_OFF": "स्क्रीन रिकॉर्डिंग उपलब्ध है", + "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/id.json b/public/app/main/apps/mail/i18n/id.json index 9b0fd29..c582c43 100644 --- a/public/app/main/apps/mail/i18n/id.json +++ b/public/app/main/apps/mail/i18n/id.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Asosiasi Tim", "MANDATORYDISPOSITION": "Disposisi wajib", "MANDATORYDISPOSITIONPAUSEID": "Jeda untuk digunakan jika disposisi wajib diaktifkan", - "ADVANCED": "Maju" + "ADVANCED": "Maju", + "TOOLTIP_SCREENRECORDING_OFF": "Rekaman Layar tersedia", + "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/it.json b/public/app/main/apps/mail/i18n/it.json index 7804495..7fdeeb5 100644 --- a/public/app/main/apps/mail/i18n/it.json +++ b/public/app/main/apps/mail/i18n/it.json @@ -314,6 +314,8 @@ "AGENTADD_MAILACCOUNT": "Aggiungi Agente ad account Email", "TEAMS_ASSOCIATION": "Associazione Teams", "MANDATORYDISPOSITION": "Disposizione obbligatoria", - "MANDATORYDISPOSITIONPAUSEID": "Pausa da utilizzare se è abilitata la disposizione obbligatoria" + "MANDATORYDISPOSITIONPAUSEID": "Pausa da utilizzare se è abilitata la disposizione obbligatoria", + "TOOLTIP_SCREENRECORDING_OFF": "Registrazione dello schermo disponibile", + "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/ja.json b/public/app/main/apps/mail/i18n/ja.json index 1b0f29e..0c87adc 100644 --- a/public/app/main/apps/mail/i18n/ja.json +++ b/public/app/main/apps/mail/i18n/ja.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "チーム協会", "MANDATORYDISPOSITION": "強制処分", "MANDATORYDISPOSITIONPAUSEID": "強制処分が有効になっている場合に使用する一時停止", - "ADVANCED": "高度な" + "ADVANCED": "高度な", + "TOOLTIP_SCREENRECORDING_OFF": "利用可能なスクリーン録画", + "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/ko.json b/public/app/main/apps/mail/i18n/ko.json index 06d5826..50da433 100644 --- a/public/app/main/apps/mail/i18n/ko.json +++ b/public/app/main/apps/mail/i18n/ko.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "팀 협회", "MANDATORYDISPOSITION": "의무 처분", "MANDATORYDISPOSITIONPAUSEID": "강제 처분이 활성화 된 경우 사용 중지", - "ADVANCED": "많은" + "ADVANCED": "많은", + "TOOLTIP_SCREENRECORDING_OFF": "스크린 녹화 가능", + "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/lv.json b/public/app/main/apps/mail/i18n/lv.json index 863be9d..5a49482 100644 --- a/public/app/main/apps/mail/i18n/lv.json +++ b/public/app/main/apps/mail/i18n/lv.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Komandu asociācija", "MANDATORYDISPOSITION": "Obligāta rīcība", "MANDATORYDISPOSITIONPAUSEID": "Lietošanas pārtraukšana, ja ir iespējota obligātā izvietošana", - "ADVANCED": "Advanced" + "ADVANCED": "Advanced", + "TOOLTIP_SCREENRECORDING_OFF": "Ekrāna ieraksts ir pieejams", + "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/nl.json b/public/app/main/apps/mail/i18n/nl.json index cf9ccec..3b7c29f 100644 --- a/public/app/main/apps/mail/i18n/nl.json +++ b/public/app/main/apps/mail/i18n/nl.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Teams Association", "MANDATORYDISPOSITION": "Verplichte regeling", "MANDATORYDISPOSITIONPAUSEID": "Pauze om te gebruiken als verplichte dispositie is ingeschakeld", - "ADVANCED": "gevorderd" + "ADVANCED": "gevorderd", + "TOOLTIP_SCREENRECORDING_OFF": "Schermopname beschikbaar", + "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/no.json b/public/app/main/apps/mail/i18n/no.json index 120278a..174d1dc 100644 --- a/public/app/main/apps/mail/i18n/no.json +++ b/public/app/main/apps/mail/i18n/no.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Lagforening", "MANDATORYDISPOSITION": "Obligatorisk disposisjon", "MANDATORYDISPOSITIONPAUSEID": "Bruk pause hvis obligatorisk disposisjon er aktivert", - "ADVANCED": "Avansert" + "ADVANCED": "Avansert", + "TOOLTIP_SCREENRECORDING_OFF": "Skjermopptak tilgjengelig", + "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/pl.json b/public/app/main/apps/mail/i18n/pl.json index 0ca64c1..349c154 100644 --- a/public/app/main/apps/mail/i18n/pl.json +++ b/public/app/main/apps/mail/i18n/pl.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Stowarzyszenie zespołów", "MANDATORYDISPOSITION": "Dyspozycja obowiązkowa", "MANDATORYDISPOSITIONPAUSEID": "Wstrzymaj korzystanie, jeśli włączona jest obowiązkowa dyspozycja", - "ADVANCED": "zaawansowane" + "ADVANCED": "zaawansowane", + "TOOLTIP_SCREENRECORDING_OFF": "Dostępne nagrywanie ekranu", + "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/pt-BR.json b/public/app/main/apps/mail/i18n/pt-BR.json index c285b55..ddb9e61 100644 --- a/public/app/main/apps/mail/i18n/pt-BR.json +++ b/public/app/main/apps/mail/i18n/pt-BR.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Associação de equipes", "MANDATORYDISPOSITION": "Disposição obrigatória", "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada", - "ADVANCED": "Avançado" + "ADVANCED": "Avançado", + "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/pt-PT.json b/public/app/main/apps/mail/i18n/pt-PT.json index b2b4593..c75be4c 100644 --- a/public/app/main/apps/mail/i18n/pt-PT.json +++ b/public/app/main/apps/mail/i18n/pt-PT.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Associação de equipes", "MANDATORYDISPOSITION": "Disposição obrigatória", "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada", - "ADVANCED": "Avançado" + "ADVANCED": "Avançado", + "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/ru.json b/public/app/main/apps/mail/i18n/ru.json index 02098d0..926f49a 100644 --- a/public/app/main/apps/mail/i18n/ru.json +++ b/public/app/main/apps/mail/i18n/ru.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Ассоциация команд", "MANDATORYDISPOSITION": "Обязательное распоряжение", "MANDATORYDISPOSITIONPAUSEID": "Пауза для использования, если включена обязательная утилизация", - "ADVANCED": "продвинутый" + "ADVANCED": "продвинутый", + "TOOLTIP_SCREENRECORDING_OFF": "Запись экрана доступна", + "TOOLTIP_SCREENRECORDING_ON": "Идет запись экрана" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/sv.json b/public/app/main/apps/mail/i18n/sv.json index 06527fa..4f1baaf 100644 --- a/public/app/main/apps/mail/i18n/sv.json +++ b/public/app/main/apps/mail/i18n/sv.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Team Association", "MANDATORYDISPOSITION": "Obligatorisk disposition", "MANDATORYDISPOSITIONPAUSEID": "Pausa för att använda om obligatorisk disposition är aktiverad", - "ADVANCED": "Avancerad" + "ADVANCED": "Avancerad", + "TOOLTIP_SCREENRECORDING_OFF": "Skärminspelning tillgänglig", + "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/tr.json b/public/app/main/apps/mail/i18n/tr.json index 27e9808..8411104 100644 --- a/public/app/main/apps/mail/i18n/tr.json +++ b/public/app/main/apps/mail/i18n/tr.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "Takımlar Birliği", "MANDATORYDISPOSITION": "Zorunlu düzenleme", "MANDATORYDISPOSITIONPAUSEID": "Zorunlu bırakma etkinse, kullanımı duraklat", - "ADVANCED": "ileri" + "ADVANCED": "ileri", + "TOOLTIP_SCREENRECORDING_OFF": "Ekran Kaydı mevcut", + "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/zh-CN.json b/public/app/main/apps/mail/i18n/zh-CN.json index ec86b0d..325f5c3 100644 --- a/public/app/main/apps/mail/i18n/zh-CN.json +++ b/public/app/main/apps/mail/i18n/zh-CN.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "团队协会", "MANDATORYDISPOSITION": "强制性处分", "MANDATORYDISPOSITIONPAUSEID": "如果启用了强制性处置,则暂停使用", - "ADVANCED": "高级" + "ADVANCED": "高级", + "TOOLTIP_SCREENRECORDING_OFF": "屏幕录像可用", + "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/zh-TW.json b/public/app/main/apps/mail/i18n/zh-TW.json index 6a6a76a..aa75bc3 100644 --- a/public/app/main/apps/mail/i18n/zh-TW.json +++ b/public/app/main/apps/mail/i18n/zh-TW.json @@ -314,6 +314,8 @@ "TEAMS_ASSOCIATION": "團隊協會", "MANDATORYDISPOSITION": "強制性處分", "MANDATORYDISPOSITIONPAUSEID": "如果啟用了強制性處置,則暫停使用", - "ADVANCED": "高級" + "ADVANCED": "高級", + "TOOLTIP_SCREENRECORDING_OFF": "屏幕錄像可用", + "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/ar.json b/public/app/main/apps/motiondialer/i18n/ar.json index 31c90b0..6efb7e2 100644 --- a/public/app/main/apps/motiondialer/i18n/ar.json +++ b/public/app/main/apps/motiondialer/i18n/ar.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "الفاصل السابق", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "إظهار المعلومات التنبؤية", "THRESHOLDS": "الحدود القصوى", - "TOTAL_CALLS": "إجمالي المكالمات" + "TOTAL_CALLS": "إجمالي المكالمات", + "TOOLTIP_SCREENRECORDING_OFF": "تسجيل الشاشة المتاحة", + "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/da.json b/public/app/main/apps/motiondialer/i18n/da.json index 9e2e4f2..fd851cd 100644 --- a/public/app/main/apps/motiondialer/i18n/da.json +++ b/public/app/main/apps/motiondialer/i18n/da.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Forrige interval", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Vis forudsigelig info", "THRESHOLDS": "tærskler", - "TOTAL_CALLS": "Samlede opkald" + "TOTAL_CALLS": "Samlede opkald", + "TOOLTIP_SCREENRECORDING_OFF": "Screen optagelse tilgængelig", + "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/de.json b/public/app/main/apps/motiondialer/i18n/de.json index 66863bc..ef0bbc9 100644 --- a/public/app/main/apps/motiondialer/i18n/de.json +++ b/public/app/main/apps/motiondialer/i18n/de.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Vorheriges Intervall", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Vorhersage-Info anzeigen", "THRESHOLDS": "Schwellenwerte", - "TOTAL_CALLS": "Anrufe insgesamt" + "TOTAL_CALLS": "Anrufe insgesamt", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/en.json b/public/app/main/apps/motiondialer/i18n/en.json index a70b110..07d2044 100644 --- a/public/app/main/apps/motiondialer/i18n/en.json +++ b/public/app/main/apps/motiondialer/i18n/en.json @@ -636,6 +636,8 @@ "FAX": "Fax", "TEAMS_ASSOCIATION": "Teams Association", "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Mandatory disposition pause status" + "MANDATORYDISPOSITIONPAUSEID": "Mandatory disposition pause status", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/es.json b/public/app/main/apps/motiondialer/i18n/es.json index acd8464..e0ee953 100644 --- a/public/app/main/apps/motiondialer/i18n/es.json +++ b/public/app/main/apps/motiondialer/i18n/es.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Intervalo anterior", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Mostrar información predictiva", "THRESHOLDS": "Umbrales", - "TOTAL_CALLS": "Llamadas totales" + "TOTAL_CALLS": "Llamadas totales", + "TOOLTIP_SCREENRECORDING_OFF": "Grabación de pantalla disponible", + "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/fa.json b/public/app/main/apps/motiondialer/i18n/fa.json index 7f1c93c..1db521d 100644 --- a/public/app/main/apps/motiondialer/i18n/fa.json +++ b/public/app/main/apps/motiondialer/i18n/fa.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "فاصله قبلی", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "نمایش اطلاعات پیش بینی شده", "THRESHOLDS": "آستانه ها", - "TOTAL_CALLS": "کل تماسها" + "TOTAL_CALLS": "کل تماسها", + "TOOLTIP_SCREENRECORDING_OFF": "ضبط صفحه در دسترس است", + "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/fi.json b/public/app/main/apps/motiondialer/i18n/fi.json index 2434c96..c0f5d59 100644 --- a/public/app/main/apps/motiondialer/i18n/fi.json +++ b/public/app/main/apps/motiondialer/i18n/fi.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Edellinen aika", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Näytä ennakoiva tieto", "THRESHOLDS": "kynnysarvot", - "TOTAL_CALLS": "Puhelut yhteensä" + "TOTAL_CALLS": "Puhelut yhteensä", + "TOOLTIP_SCREENRECORDING_OFF": "Näytön tallennus saatavilla", + "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/fr.json b/public/app/main/apps/motiondialer/i18n/fr.json index 0d3c88f..0958f45 100644 --- a/public/app/main/apps/motiondialer/i18n/fr.json +++ b/public/app/main/apps/motiondialer/i18n/fr.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Intervalle précédent", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Afficher les informations prédictives", "THRESHOLDS": "Seuils", - "TOTAL_CALLS": "Total d'appels" + "TOTAL_CALLS": "Total d'appels", + "TOOLTIP_SCREENRECORDING_OFF": "Enregistrement d'écran disponible", + "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/he.json b/public/app/main/apps/motiondialer/i18n/he.json index 6782858..a534e7f 100644 --- a/public/app/main/apps/motiondialer/i18n/he.json +++ b/public/app/main/apps/motiondialer/i18n/he.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "מרווח קודם", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "הצג מידע חזוי", "THRESHOLDS": "סף", - "TOTAL_CALLS": "סה\"כ שיחות" + "TOTAL_CALLS": "סה\"כ שיחות", + "TOOLTIP_SCREENRECORDING_OFF": "הקלטת מסך זמינה", + "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/hi.json b/public/app/main/apps/motiondialer/i18n/hi.json index f979487..8acfb46 100644 --- a/public/app/main/apps/motiondialer/i18n/hi.json +++ b/public/app/main/apps/motiondialer/i18n/hi.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "पिछला अंतराल", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "भविष्य कहनेवाला जानकारी दिखाएँ", "THRESHOLDS": "सीमारेखा", - "TOTAL_CALLS": "कुल कॉल" + "TOTAL_CALLS": "कुल कॉल", + "TOOLTIP_SCREENRECORDING_OFF": "स्क्रीन रिकॉर्डिंग उपलब्ध है", + "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/id.json b/public/app/main/apps/motiondialer/i18n/id.json index 40311bb..6293e5e 100644 --- a/public/app/main/apps/motiondialer/i18n/id.json +++ b/public/app/main/apps/motiondialer/i18n/id.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Interval sebelumnya", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Tampilkan Info Prediktif", "THRESHOLDS": "Ambang batas", - "TOTAL_CALLS": "Total Panggilan" + "TOTAL_CALLS": "Total Panggilan", + "TOOLTIP_SCREENRECORDING_OFF": "Rekaman Layar tersedia", + "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/it.json b/public/app/main/apps/motiondialer/i18n/it.json index 8d78ab0..f2ff182 100644 --- a/public/app/main/apps/motiondialer/i18n/it.json +++ b/public/app/main/apps/motiondialer/i18n/it.json @@ -636,6 +636,8 @@ "TEAMS_ASSOCIATION": "Associazione Teams", "ANSWERING_MACHINE": "Segreteria telefonica", "MANDATORYDISPOSITION": "Disposizione obbligatoria", - "MANDATORYDISPOSITIONPAUSEID": "Stato di pausa disposizione obbligatoria" + "MANDATORYDISPOSITIONPAUSEID": "Stato di pausa disposizione obbligatoria", + "TOOLTIP_SCREENRECORDING_OFF": "Registrazione dello schermo disponibile", + "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/ja.json b/public/app/main/apps/motiondialer/i18n/ja.json index 570a53f..ebcd68f 100644 --- a/public/app/main/apps/motiondialer/i18n/ja.json +++ b/public/app/main/apps/motiondialer/i18n/ja.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "前の間隔", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "予測情報を表示", "THRESHOLDS": "しきい値", - "TOTAL_CALLS": "総コール数" + "TOTAL_CALLS": "総コール数", + "TOOLTIP_SCREENRECORDING_OFF": "利用可能なスクリーン録画", + "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/ko.json b/public/app/main/apps/motiondialer/i18n/ko.json index 17006c4..c2ed2f2 100644 --- a/public/app/main/apps/motiondialer/i18n/ko.json +++ b/public/app/main/apps/motiondialer/i18n/ko.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "이전 간격", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "예측 정보 표시", "THRESHOLDS": "임계 값", - "TOTAL_CALLS": "총 통화" + "TOTAL_CALLS": "총 통화", + "TOOLTIP_SCREENRECORDING_OFF": "스크린 녹화 가능", + "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/lv.json b/public/app/main/apps/motiondialer/i18n/lv.json index 321b899..c7f1088 100644 --- a/public/app/main/apps/motiondialer/i18n/lv.json +++ b/public/app/main/apps/motiondialer/i18n/lv.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Iepriekšējais intervāls", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Rādīt paredzamo informāciju", "THRESHOLDS": "Sliekšņi", - "TOTAL_CALLS": "Kopējais zvanu skaits" + "TOTAL_CALLS": "Kopējais zvanu skaits", + "TOOLTIP_SCREENRECORDING_OFF": "Ekrāna ieraksts ir pieejams", + "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/nl.json b/public/app/main/apps/motiondialer/i18n/nl.json index de9f99c..157ed52 100644 --- a/public/app/main/apps/motiondialer/i18n/nl.json +++ b/public/app/main/apps/motiondialer/i18n/nl.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Vorige interval", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Toon voorspellende informatie", "THRESHOLDS": "drempels", - "TOTAL_CALLS": "Totaal aantal oproepen" + "TOTAL_CALLS": "Totaal aantal oproepen", + "TOOLTIP_SCREENRECORDING_OFF": "Schermopname beschikbaar", + "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/no.json b/public/app/main/apps/motiondialer/i18n/no.json index 3a57973..122a1b4 100644 --- a/public/app/main/apps/motiondialer/i18n/no.json +++ b/public/app/main/apps/motiondialer/i18n/no.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Forrige intervall", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Vis prediktiv info", "THRESHOLDS": "terskler", - "TOTAL_CALLS": "Totalt antall samtaler" + "TOTAL_CALLS": "Totalt antall samtaler", + "TOOLTIP_SCREENRECORDING_OFF": "Skjermopptak tilgjengelig", + "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/pl.json b/public/app/main/apps/motiondialer/i18n/pl.json index 55d5e0e..156cab9 100644 --- a/public/app/main/apps/motiondialer/i18n/pl.json +++ b/public/app/main/apps/motiondialer/i18n/pl.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Poprzedni interwał", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Pokaż prognostyczne informacje", "THRESHOLDS": "Progi", - "TOTAL_CALLS": "Wszystkich połączeń" + "TOTAL_CALLS": "Wszystkich połączeń", + "TOOLTIP_SCREENRECORDING_OFF": "Dostępne nagrywanie ekranu", + "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/pt-BR.json b/public/app/main/apps/motiondialer/i18n/pt-BR.json index 04b1b2d..2ec08d2 100644 --- a/public/app/main/apps/motiondialer/i18n/pt-BR.json +++ b/public/app/main/apps/motiondialer/i18n/pt-BR.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Intervalo anterior", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Mostrar informações preditivas", "THRESHOLDS": "Limiares", - "TOTAL_CALLS": "Total de chamadas" + "TOTAL_CALLS": "Total de chamadas", + "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/pt-PT.json b/public/app/main/apps/motiondialer/i18n/pt-PT.json index 7d31399..ed3553a 100644 --- a/public/app/main/apps/motiondialer/i18n/pt-PT.json +++ b/public/app/main/apps/motiondialer/i18n/pt-PT.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Intervalo anterior", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Mostrar informações preditivas", "THRESHOLDS": "Limiares", - "TOTAL_CALLS": "Total de chamadas" + "TOTAL_CALLS": "Total de chamadas", + "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/ru.json b/public/app/main/apps/motiondialer/i18n/ru.json index 793c0c7..6194e8b 100644 --- a/public/app/main/apps/motiondialer/i18n/ru.json +++ b/public/app/main/apps/motiondialer/i18n/ru.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Предыдущий интервал", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Показать прогнозирующую информацию", "THRESHOLDS": "Пороги", - "TOTAL_CALLS": "Всего звонков" + "TOTAL_CALLS": "Всего звонков", + "TOOLTIP_SCREENRECORDING_OFF": "Запись экрана доступна", + "TOOLTIP_SCREENRECORDING_ON": "Идет запись экрана" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/sv.json b/public/app/main/apps/motiondialer/i18n/sv.json index 0674924..d3c6bf3 100644 --- a/public/app/main/apps/motiondialer/i18n/sv.json +++ b/public/app/main/apps/motiondialer/i18n/sv.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Föregående intervall", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Visa prediktiv information", "THRESHOLDS": "trösklar", - "TOTAL_CALLS": "Totala samtal" + "TOTAL_CALLS": "Totala samtal", + "TOOLTIP_SCREENRECORDING_OFF": "Skärminspelning tillgänglig", + "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/tr.json b/public/app/main/apps/motiondialer/i18n/tr.json index 90c5068..4f01289 100644 --- a/public/app/main/apps/motiondialer/i18n/tr.json +++ b/public/app/main/apps/motiondialer/i18n/tr.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "Önceki Aralık", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Tahmini Bilgi Göster", "THRESHOLDS": "Eşik", - "TOTAL_CALLS": "Toplam aramalar" + "TOTAL_CALLS": "Toplam aramalar", + "TOOLTIP_SCREENRECORDING_OFF": "Ekran Kaydı mevcut", + "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/zh-CN.json b/public/app/main/apps/motiondialer/i18n/zh-CN.json index 53c42c5..8f016cd 100644 --- a/public/app/main/apps/motiondialer/i18n/zh-CN.json +++ b/public/app/main/apps/motiondialer/i18n/zh-CN.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "上一个间隔", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "显示预测性信息", "THRESHOLDS": "门槛", - "TOTAL_CALLS": "总通话" + "TOTAL_CALLS": "总通话", + "TOOLTIP_SCREENRECORDING_OFF": "屏幕录像可用", + "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中" } } \ No newline at end of file diff --git a/public/app/main/apps/motiondialer/i18n/zh-TW.json b/public/app/main/apps/motiondialer/i18n/zh-TW.json index b09c4f0..bc94cb5 100644 --- a/public/app/main/apps/motiondialer/i18n/zh-TW.json +++ b/public/app/main/apps/motiondialer/i18n/zh-TW.json @@ -636,6 +636,8 @@ "PREVIOUS_INTERVAL": "上一個間隔", "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "顯示預測性信息", "THRESHOLDS": "門檻", - "TOTAL_CALLS": "總通話" + "TOTAL_CALLS": "總通話", + "TOOLTIP_SCREENRECORDING_OFF": "屏幕錄像可用", + "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/ar.json b/public/app/main/apps/openchannel/i18n/ar.json index e49492d..7909b32 100644 --- a/public/app/main/apps/openchannel/i18n/ar.json +++ b/public/app/main/apps/openchannel/i18n/ar.json @@ -251,6 +251,8 @@ "BOTNAME": "اسم بوت", "EDIT_AMAZONLEX": "تحرير التكوين ليكس", "LEXREGION": "منطقة", - "SECRETACCESSKEY": "سر مفتاح الوصول" + "SECRETACCESSKEY": "سر مفتاح الوصول", + "TOOLTIP_SCREENRECORDING_OFF": "تسجيل الشاشة المتاحة", + "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/da.json b/public/app/main/apps/openchannel/i18n/da.json index 05c13a9..cf5d6ec 100644 --- a/public/app/main/apps/openchannel/i18n/da.json +++ b/public/app/main/apps/openchannel/i18n/da.json @@ -251,6 +251,8 @@ "BOTNAME": "Bot navn", "EDIT_AMAZONLEX": "Rediger Lex-konfiguration", "LEXREGION": "Område", - "SECRETACCESSKEY": "Adgangsnøglehemmelighed" + "SECRETACCESSKEY": "Adgangsnøglehemmelighed", + "TOOLTIP_SCREENRECORDING_OFF": "Screen optagelse tilgængelig", + "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/de.json b/public/app/main/apps/openchannel/i18n/de.json index f3210ec..58eeb2d 100644 --- a/public/app/main/apps/openchannel/i18n/de.json +++ b/public/app/main/apps/openchannel/i18n/de.json @@ -251,6 +251,8 @@ "BOTNAME": "Bot-Name", "EDIT_AMAZONLEX": "Bearbeiten Sie die Lex-Konfiguration", "LEXREGION": "Region", - "SECRETACCESSKEY": "Zugangsschlüssel geheim" + "SECRETACCESSKEY": "Zugangsschlüssel geheim", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/en.json b/public/app/main/apps/openchannel/i18n/en.json index 764563e..0d523f3 100644 --- a/public/app/main/apps/openchannel/i18n/en.json +++ b/public/app/main/apps/openchannel/i18n/en.json @@ -251,6 +251,8 @@ "SEND": "Send", "TO": "To", "MAPKEY": "Map Key", - "TEAMS_ASSOCIATION": "Teams Association" + "TEAMS_ASSOCIATION": "Teams Association", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/es.json b/public/app/main/apps/openchannel/i18n/es.json index dc22529..176012c 100644 --- a/public/app/main/apps/openchannel/i18n/es.json +++ b/public/app/main/apps/openchannel/i18n/es.json @@ -251,6 +251,8 @@ "BOTNAME": "Nombre del bot", "EDIT_AMAZONLEX": "Editar configuración de Lex", "LEXREGION": "Región", - "SECRETACCESSKEY": "Clave de acceso secreto" + "SECRETACCESSKEY": "Clave de acceso secreto", + "TOOLTIP_SCREENRECORDING_OFF": "Grabación de pantalla disponible", + "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/fa.json b/public/app/main/apps/openchannel/i18n/fa.json index 36c6952..9de6d76 100644 --- a/public/app/main/apps/openchannel/i18n/fa.json +++ b/public/app/main/apps/openchannel/i18n/fa.json @@ -251,6 +251,8 @@ "BOTNAME": "نام بوت", "EDIT_AMAZONLEX": "پیکربندی Lex را ویرایش کنید", "LEXREGION": "منطقه", - "SECRETACCESSKEY": "راز دسترسی به کلید" + "SECRETACCESSKEY": "راز دسترسی به کلید", + "TOOLTIP_SCREENRECORDING_OFF": "ضبط صفحه در دسترس است", + "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/fi.json b/public/app/main/apps/openchannel/i18n/fi.json index c28ef51..8afc35a 100644 --- a/public/app/main/apps/openchannel/i18n/fi.json +++ b/public/app/main/apps/openchannel/i18n/fi.json @@ -251,6 +251,8 @@ "BOTNAME": "Botin nimi", "EDIT_AMAZONLEX": "Muokkaa Lex-kokoonpanoa", "LEXREGION": "alue", - "SECRETACCESSKEY": "Pääsysalaisuus" + "SECRETACCESSKEY": "Pääsysalaisuus", + "TOOLTIP_SCREENRECORDING_OFF": "Näytön tallennus saatavilla", + "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/fr.json b/public/app/main/apps/openchannel/i18n/fr.json index 59e106a..88fb123 100644 --- a/public/app/main/apps/openchannel/i18n/fr.json +++ b/public/app/main/apps/openchannel/i18n/fr.json @@ -251,6 +251,8 @@ "BOTNAME": "Nom de bot", "EDIT_AMAZONLEX": "Modifier la configuration Lex", "LEXREGION": "Région", - "SECRETACCESSKEY": "Clé d'accès secret" + "SECRETACCESSKEY": "Clé d'accès secret", + "TOOLTIP_SCREENRECORDING_OFF": "Enregistrement d'écran disponible", + "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/he.json b/public/app/main/apps/openchannel/i18n/he.json index 5d8a279..7363ca1 100644 --- a/public/app/main/apps/openchannel/i18n/he.json +++ b/public/app/main/apps/openchannel/i18n/he.json @@ -251,6 +251,8 @@ "BOTNAME": "שם בוט", "EDIT_AMAZONLEX": "ערוך את תצורת Lex", "LEXREGION": "אזור", - "SECRETACCESSKEY": "גישה לסוד מפתח" + "SECRETACCESSKEY": "גישה לסוד מפתח", + "TOOLTIP_SCREENRECORDING_OFF": "הקלטת מסך זמינה", + "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/hi.json b/public/app/main/apps/openchannel/i18n/hi.json index 37c8d25..308b8e0 100644 --- a/public/app/main/apps/openchannel/i18n/hi.json +++ b/public/app/main/apps/openchannel/i18n/hi.json @@ -251,6 +251,8 @@ "BOTNAME": "बॉट नाम", "EDIT_AMAZONLEX": "लेक्स कॉन्फ़िगरेशन संपादित करें", "LEXREGION": "क्षेत्र", - "SECRETACCESSKEY": "पहुंच कुंजी रहस्य" + "SECRETACCESSKEY": "पहुंच कुंजी रहस्य", + "TOOLTIP_SCREENRECORDING_OFF": "स्क्रीन रिकॉर्डिंग उपलब्ध है", + "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/id.json b/public/app/main/apps/openchannel/i18n/id.json index 8602da4..48765c5 100644 --- a/public/app/main/apps/openchannel/i18n/id.json +++ b/public/app/main/apps/openchannel/i18n/id.json @@ -251,6 +251,8 @@ "BOTNAME": "Nama bot", "EDIT_AMAZONLEX": "Edit konfigurasi Lex", "LEXREGION": "Wilayah", - "SECRETACCESSKEY": "Rahasia kunci akses" + "SECRETACCESSKEY": "Rahasia kunci akses", + "TOOLTIP_SCREENRECORDING_OFF": "Rekaman Layar tersedia", + "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/it.json b/public/app/main/apps/openchannel/i18n/it.json index f1b4fec..e493630 100644 --- a/public/app/main/apps/openchannel/i18n/it.json +++ b/public/app/main/apps/openchannel/i18n/it.json @@ -251,6 +251,8 @@ "BOTNAME": "Nome del bot", "EDIT_AMAZONLEX": "Modifica la configurazione Lex", "LEXREGION": "Regione", - "SECRETACCESSKEY": "Accesso chiave segreta" + "SECRETACCESSKEY": "Accesso chiave segreta", + "TOOLTIP_SCREENRECORDING_OFF": "Registrazione dello schermo disponibile", + "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/ja.json b/public/app/main/apps/openchannel/i18n/ja.json index 439b7fa..c73fd04 100644 --- a/public/app/main/apps/openchannel/i18n/ja.json +++ b/public/app/main/apps/openchannel/i18n/ja.json @@ -251,6 +251,8 @@ "BOTNAME": "ボット名", "EDIT_AMAZONLEX": "Lex構成の編集", "LEXREGION": "領域", - "SECRETACCESSKEY": "アクセスキーシークレット" + "SECRETACCESSKEY": "アクセスキーシークレット", + "TOOLTIP_SCREENRECORDING_OFF": "利用可能なスクリーン録画", + "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/ko.json b/public/app/main/apps/openchannel/i18n/ko.json index 0b37373..5a38c80 100644 --- a/public/app/main/apps/openchannel/i18n/ko.json +++ b/public/app/main/apps/openchannel/i18n/ko.json @@ -251,6 +251,8 @@ "BOTNAME": "봇 이름", "EDIT_AMAZONLEX": "Lex 구성 편집", "LEXREGION": "부위", - "SECRETACCESSKEY": "액세스 키 비밀" + "SECRETACCESSKEY": "액세스 키 비밀", + "TOOLTIP_SCREENRECORDING_OFF": "스크린 녹화 가능", + "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/lv.json b/public/app/main/apps/openchannel/i18n/lv.json index d9154ad..9da22ce 100644 --- a/public/app/main/apps/openchannel/i18n/lv.json +++ b/public/app/main/apps/openchannel/i18n/lv.json @@ -251,6 +251,8 @@ "BOTNAME": "Bot vārds", "EDIT_AMAZONLEX": "Rediģēt Lex konfigurāciju", "LEXREGION": "Novads", - "SECRETACCESSKEY": "Piekļuves atslēgas noslēpums" + "SECRETACCESSKEY": "Piekļuves atslēgas noslēpums", + "TOOLTIP_SCREENRECORDING_OFF": "Ekrāna ieraksts ir pieejams", + "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/nl.json b/public/app/main/apps/openchannel/i18n/nl.json index 8f60409..1c5ee4b 100644 --- a/public/app/main/apps/openchannel/i18n/nl.json +++ b/public/app/main/apps/openchannel/i18n/nl.json @@ -251,6 +251,8 @@ "BOTNAME": "Bot naam", "EDIT_AMAZONLEX": "Lex-configuratie bewerken", "LEXREGION": "Regio", - "SECRETACCESSKEY": "Toegangssleutel geheim" + "SECRETACCESSKEY": "Toegangssleutel geheim", + "TOOLTIP_SCREENRECORDING_OFF": "Schermopname beschikbaar", + "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/no.json b/public/app/main/apps/openchannel/i18n/no.json index 34c2eb0..0a6e382 100644 --- a/public/app/main/apps/openchannel/i18n/no.json +++ b/public/app/main/apps/openchannel/i18n/no.json @@ -251,6 +251,8 @@ "BOTNAME": "Bot navn", "EDIT_AMAZONLEX": "Rediger Lex-konfigurasjonen", "LEXREGION": "Region", - "SECRETACCESSKEY": "Tilgang nøkkelhemmelighet" + "SECRETACCESSKEY": "Tilgang nøkkelhemmelighet", + "TOOLTIP_SCREENRECORDING_OFF": "Skjermopptak tilgjengelig", + "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/pl.json b/public/app/main/apps/openchannel/i18n/pl.json index 0bd3593..d30837b 100644 --- a/public/app/main/apps/openchannel/i18n/pl.json +++ b/public/app/main/apps/openchannel/i18n/pl.json @@ -251,6 +251,8 @@ "BOTNAME": "Nazwa bota", "EDIT_AMAZONLEX": "Edytuj konfigurację Lex", "LEXREGION": "Region", - "SECRETACCESSKEY": "Tajny klucz dostępu" + "SECRETACCESSKEY": "Tajny klucz dostępu", + "TOOLTIP_SCREENRECORDING_OFF": "Dostępne nagrywanie ekranu", + "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/pt-BR.json b/public/app/main/apps/openchannel/i18n/pt-BR.json index 3ab3b49..1c2bf75 100644 --- a/public/app/main/apps/openchannel/i18n/pt-BR.json +++ b/public/app/main/apps/openchannel/i18n/pt-BR.json @@ -251,6 +251,8 @@ "BOTNAME": "Nome do bot", "EDIT_AMAZONLEX": "Editar configuração de Lex", "LEXREGION": "Região", - "SECRETACCESSKEY": "Segredo da chave de acesso" + "SECRETACCESSKEY": "Segredo da chave de acesso", + "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/pt-PT.json b/public/app/main/apps/openchannel/i18n/pt-PT.json index 3bbc0bd..31f5ce5 100644 --- a/public/app/main/apps/openchannel/i18n/pt-PT.json +++ b/public/app/main/apps/openchannel/i18n/pt-PT.json @@ -251,6 +251,8 @@ "BOTNAME": "Nome do bot", "EDIT_AMAZONLEX": "Editar configuração de Lex", "LEXREGION": "Região", - "SECRETACCESSKEY": "Segredo da chave de acesso" + "SECRETACCESSKEY": "Segredo da chave de acesso", + "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/ru.json b/public/app/main/apps/openchannel/i18n/ru.json index 7769318..aacbfc1 100644 --- a/public/app/main/apps/openchannel/i18n/ru.json +++ b/public/app/main/apps/openchannel/i18n/ru.json @@ -251,6 +251,8 @@ "BOTNAME": "Имя бота", "EDIT_AMAZONLEX": "Изменить конфигурацию Lex", "LEXREGION": "Область", - "SECRETACCESSKEY": "Секрет ключа доступа" + "SECRETACCESSKEY": "Секрет ключа доступа", + "TOOLTIP_SCREENRECORDING_OFF": "Запись экрана доступна", + "TOOLTIP_SCREENRECORDING_ON": "Идет запись экрана" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/sv.json b/public/app/main/apps/openchannel/i18n/sv.json index 17c90c1..da373c3 100644 --- a/public/app/main/apps/openchannel/i18n/sv.json +++ b/public/app/main/apps/openchannel/i18n/sv.json @@ -251,6 +251,8 @@ "BOTNAME": "Bot namn", "EDIT_AMAZONLEX": "Redigera Lex-konfiguration", "LEXREGION": "Område", - "SECRETACCESSKEY": "Åtkomstnyckelhemlighet" + "SECRETACCESSKEY": "Åtkomstnyckelhemlighet", + "TOOLTIP_SCREENRECORDING_OFF": "Skärminspelning tillgänglig", + "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/tr.json b/public/app/main/apps/openchannel/i18n/tr.json index f2b4cd2..f09dd59 100644 --- a/public/app/main/apps/openchannel/i18n/tr.json +++ b/public/app/main/apps/openchannel/i18n/tr.json @@ -251,6 +251,8 @@ "BOTNAME": "Bot adı", "EDIT_AMAZONLEX": "Lex yapılandırmasını düzenle", "LEXREGION": "bölge", - "SECRETACCESSKEY": "Erişim anahtarı sırrı" + "SECRETACCESSKEY": "Erişim anahtarı sırrı", + "TOOLTIP_SCREENRECORDING_OFF": "Ekran Kaydı mevcut", + "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/zh-CN.json b/public/app/main/apps/openchannel/i18n/zh-CN.json index 67cb106..1a40e84 100644 --- a/public/app/main/apps/openchannel/i18n/zh-CN.json +++ b/public/app/main/apps/openchannel/i18n/zh-CN.json @@ -251,6 +251,8 @@ "BOTNAME": "机器人名称", "EDIT_AMAZONLEX": "编辑Lex配置", "LEXREGION": "区域", - "SECRETACCESSKEY": "访问密钥机密" + "SECRETACCESSKEY": "访问密钥机密", + "TOOLTIP_SCREENRECORDING_OFF": "屏幕录像可用", + "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/zh-TW.json b/public/app/main/apps/openchannel/i18n/zh-TW.json index 9b895b2..42378f0 100644 --- a/public/app/main/apps/openchannel/i18n/zh-TW.json +++ b/public/app/main/apps/openchannel/i18n/zh-TW.json @@ -251,6 +251,8 @@ "BOTNAME": "機器人名稱", "EDIT_AMAZONLEX": "編輯Lex配置", "LEXREGION": "區域", - "SECRETACCESSKEY": "訪問密鑰機密" + "SECRETACCESSKEY": "訪問密鑰機密", + "TOOLTIP_SCREENRECORDING_OFF": "屏幕錄像可用", + "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中" } } \ No newline at end of file diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index e399dd5..653cbc5 100644 --- a/server/api/action/action.attributes.js +++ b/server/api/action/action.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48c1=['contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','exports','VIRTUAL','getDataValue','STRING','integration','motionbar','jscripty','urlForward','bot','script'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x48c1,0x82));var _0x148c=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x48c1[_0x1da527];return _0x40fc7c;};'use strict';var Sequelize=require('sequelize');module[_0x148c('0x0')]={'name':{'type':Sequelize[_0x148c('0x1')],'get':function(_0x3839c4){return this[_0x148c('0x2')]('action');}},'action':{'type':Sequelize[_0x148c('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x148c('0x4'),_0x148c('0x5'),_0x148c('0x6'),_0x148c('0x7'),'browser',_0x148c('0x8'),_0x148c('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x148c('0x3')](0x1000),'comment':_0x148c('0xa')},'data2':{'type':Sequelize[_0x148c('0x3')](0x1000),'comment':_0x148c('0xb')},'data3':{'type':Sequelize[_0x148c('0x3')](0x1000),'comment':_0x148c('0xc')},'data4':{'type':Sequelize[_0x148c('0x3')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x148c('0x3')]},'data7':{'type':Sequelize[_0x148c('0xd')]}}; \ No newline at end of file +var _0x2f74=['VIRTUAL','action','STRING','integration','motionbar','jscripty','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','sequelize','exports'];(function(_0x173c1e,_0x5e1bcc){var _0x52ce1c=function(_0x5219cf){while(--_0x5219cf){_0x173c1e['push'](_0x173c1e['shift']());}};_0x52ce1c(++_0x5e1bcc);}(_0x2f74,0x1ab));var _0x42f7=function(_0x2f4d5f,_0xda7f63){_0x2f4d5f=_0x2f4d5f-0x0;var _0x13dfeb=_0x2f74[_0x2f4d5f];return _0x13dfeb;};'use strict';var Sequelize=require(_0x42f7('0x0'));module[_0x42f7('0x1')]={'name':{'type':Sequelize[_0x42f7('0x2')],'get':function(_0x5eee11){return this['getDataValue'](_0x42f7('0x3'));}},'action':{'type':Sequelize[_0x42f7('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x42f7('0x5'),_0x42f7('0x6'),_0x42f7('0x7'),'urlForward','browser','bot',_0x42f7('0x8')]],'msg':_0x42f7('0x9')}},'comment':_0x42f7('0x9')},'data1':{'type':Sequelize[_0x42f7('0x4')](0x1000),'comment':_0x42f7('0xa')},'data2':{'type':Sequelize[_0x42f7('0x4')](0x1000),'comment':_0x42f7('0xb')},'data3':{'type':Sequelize[_0x42f7('0x4')](0x1000),'comment':_0x42f7('0xc')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x42f7('0x4')](0x1000)},'data6':{'type':Sequelize[_0x42f7('0x4')]},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 06557d2..489a250 100644 --- a/server/api/action/action.controller.js +++ b/server/api/action/action.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa456=['Content-Range','reject','save','then','error','stack','name','update','body','find','params','catch','destroy','Action','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0x412ae1,_0x20a4c4){var _0x50bea0=function(_0x2e0f62){while(--_0x2e0f62){_0x412ae1['push'](_0x412ae1['shift']());}};_0x50bea0(++_0x20a4c4);}(_0xa456,0x142));var _0x6a45=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xa456[_0x1beef3];return _0x5af964;};'use strict';var pdf=require(_0x6a45('0x0'));var emlformat=require(_0x6a45('0x1'));var rimraf=require(_0x6a45('0x2'));var zipdir=require(_0x6a45('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a45('0x4'));var moment=require(_0x6a45('0x5'));var BPromise=require(_0x6a45('0x6'));var Mustache=require('mustache');var util=require(_0x6a45('0x7'));var path=require(_0x6a45('0x8'));var sox=require(_0x6a45('0x9'));var csv=require(_0x6a45('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6a45('0xb'));var squel=require(_0x6a45('0xc'));var crypto=require(_0x6a45('0xd'));var jsforce=require(_0x6a45('0xe'));var deskjs=require(_0x6a45('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6a45('0x10'));var Papa=require('papaparse');var Redis=require(_0x6a45('0x11'));var authService=require(_0x6a45('0x12'));var qs=require(_0x6a45('0x13'));var hardwareService=require(_0x6a45('0x14'));var logger=require(_0x6a45('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6a45('0x16'));var db=require(_0x6a45('0x17'))['db'];function respondWithStatusCode(_0x4b7f6d,_0x5a39f6){_0x5a39f6=_0x5a39f6||0xcc;return function(_0x511b92){if(_0x511b92){return _0x4b7f6d[_0x6a45('0x18')](_0x5a39f6);}return _0x4b7f6d[_0x6a45('0x19')](_0x5a39f6)[_0x6a45('0x1a')]();};}function respondWithResult(_0x3f01f6,_0xd43eb0){_0xd43eb0=_0xd43eb0||0xc8;return function(_0x5a9f29){if(_0x5a9f29){return _0x3f01f6['status'](_0xd43eb0)[_0x6a45('0x1b')](_0x5a9f29);}};}function respondWithFilteredResult(_0xd09baf,_0x48fe0c){return function(_0x2c20db){if(_0x2c20db){var _0x171176=_0x2c20db['count'],_0x3fab82=_0x48fe0c['offset'],_0x13adc0=_0x48fe0c[_0x6a45('0x1c')]+_0x48fe0c[_0x6a45('0x1d')],_0x548634;if(_0x13adc0>=_0x171176){_0x13adc0=_0x171176;_0x548634=0xc8;}else{_0x548634=0xce;}_0xd09baf[_0x6a45('0x19')](_0x548634);return _0xd09baf['set'](_0x6a45('0x1e'),_0x3fab82+'-'+_0x13adc0+'/'+_0x171176)[_0x6a45('0x1b')](_0x2c20db);}return null;};}function patchUpdates(_0x3439c8){return function(_0x49fc10){try{jsonpatch['apply'](_0x49fc10,_0x3439c8,!![]);}catch(_0x573453){return BPromise[_0x6a45('0x1f')](_0x573453);}return _0x49fc10[_0x6a45('0x20')]();};}function saveUpdates(_0x5bdaef,_0x450dfe){return function(_0x1be485){if(_0x1be485){return _0x1be485['update'](_0x5bdaef)[_0x6a45('0x21')](function(_0xdf10c6){return _0xdf10c6;});}return null;};}function removeEntity(_0x46a13a,_0x458b99){return function(_0x15ad0e){if(_0x15ad0e){return _0x15ad0e['destroy']()['then'](function(){_0x46a13a[_0x6a45('0x19')](0xcc)[_0x6a45('0x1a')]();});}};}function handleEntityNotFound(_0x11290c,_0x22373c){return function(_0x25a380){if(!_0x25a380){_0x11290c[_0x6a45('0x18')](0x194);}return _0x25a380;};}function handleError(_0x170623,_0x4692f5){_0x4692f5=_0x4692f5||0x1f4;return function(_0x316f6b){logger[_0x6a45('0x22')](_0x316f6b[_0x6a45('0x23')]);if(_0x316f6b[_0x6a45('0x24')]){delete _0x316f6b['name'];}_0x170623[_0x6a45('0x19')](_0x4692f5)['send'](_0x316f6b);};}exports[_0x6a45('0x25')]=function(_0x25467d,_0x28bdf0){if(_0x25467d[_0x6a45('0x26')]['id']){delete _0x25467d[_0x6a45('0x26')]['id'];}return db['Action'][_0x6a45('0x27')]({'where':{'id':_0x25467d[_0x6a45('0x28')]['id']}})[_0x6a45('0x21')](handleEntityNotFound(_0x28bdf0,null))[_0x6a45('0x21')](saveUpdates(_0x25467d[_0x6a45('0x26')],null))[_0x6a45('0x21')](respondWithResult(_0x28bdf0,null))[_0x6a45('0x29')](handleError(_0x28bdf0,null));};exports[_0x6a45('0x2a')]=function(_0x54286d,_0x14adb5){return db[_0x6a45('0x2b')][_0x6a45('0x27')]({'where':{'id':_0x54286d[_0x6a45('0x28')]['id']}})[_0x6a45('0x21')](handleEntityNotFound(_0x14adb5,null))['then'](removeEntity(_0x14adb5,null))[_0x6a45('0x29')](handleError(_0x14adb5,null));}; \ No newline at end of file +var _0xed0b=['html-pdf','rimraf','zip-dir','fast-json-patch','mustache','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','Content-Range','reject','save','update','then','stack','name','send','body','Action','find','catch','destroy','params'];(function(_0x532207,_0xd1322e){var _0x118242=function(_0x358cf7){while(--_0x358cf7){_0x532207['push'](_0x532207['shift']());}};_0x118242(++_0xd1322e);}(_0xed0b,0x15f));var _0xbed0=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xed0b[_0xdea41a];return _0x15d0d8;};'use strict';var pdf=require(_0xbed0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbed0('0x1'));var zipdir=require(_0xbed0('0x2'));var jsonpatch=require(_0xbed0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbed0('0x4'));var util=require('util');var path=require(_0xbed0('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbed0('0x6'));var fs=require('fs');var _=require(_0xbed0('0x7'));var squel=require(_0xbed0('0x8'));var crypto=require(_0xbed0('0x9'));var jsforce=require(_0xbed0('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xbed0('0xb'));var querystring=require(_0xbed0('0xc'));var Papa=require(_0xbed0('0xd'));var Redis=require(_0xbed0('0xe'));var authService=require(_0xbed0('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xbed0('0x10'));var logger=require(_0xbed0('0x11'))(_0xbed0('0x12'));var utils=require('../../config/utils');var config=require(_0xbed0('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17483e,_0x385072){_0x385072=_0x385072||0xcc;return function(_0x46fa91){if(_0x46fa91){return _0x17483e[_0xbed0('0x14')](_0x385072);}return _0x17483e[_0xbed0('0x15')](_0x385072)[_0xbed0('0x16')]();};}function respondWithResult(_0x5bffd1,_0x36d0e8){_0x36d0e8=_0x36d0e8||0xc8;return function(_0x36933f){if(_0x36933f){return _0x5bffd1['status'](_0x36d0e8)[_0xbed0('0x17')](_0x36933f);}};}function respondWithFilteredResult(_0xa5cf7e,_0x59422a){return function(_0x4bbd1a){if(_0x4bbd1a){var _0x54c57c=_0x4bbd1a['count'],_0x2001b3=_0x59422a[_0xbed0('0x18')],_0x5c974b=_0x59422a[_0xbed0('0x18')]+_0x59422a['limit'],_0x59deeb;if(_0x5c974b>=_0x54c57c){_0x5c974b=_0x54c57c;_0x59deeb=0xc8;}else{_0x59deeb=0xce;}_0xa5cf7e[_0xbed0('0x15')](_0x59deeb);return _0xa5cf7e['set'](_0xbed0('0x19'),_0x2001b3+'-'+_0x5c974b+'/'+_0x54c57c)[_0xbed0('0x17')](_0x4bbd1a);}return null;};}function patchUpdates(_0x576689){return function(_0x26b852){try{jsonpatch['apply'](_0x26b852,_0x576689,!![]);}catch(_0x38949e){return BPromise[_0xbed0('0x1a')](_0x38949e);}return _0x26b852[_0xbed0('0x1b')]();};}function saveUpdates(_0x1b4a83,_0x2751a1){return function(_0x39a4fa){if(_0x39a4fa){return _0x39a4fa[_0xbed0('0x1c')](_0x1b4a83)[_0xbed0('0x1d')](function(_0x4d5e41){return _0x4d5e41;});}return null;};}function removeEntity(_0x526f1f,_0x2460ee){return function(_0x1511a4){if(_0x1511a4){return _0x1511a4['destroy']()[_0xbed0('0x1d')](function(){_0x526f1f['status'](0xcc)[_0xbed0('0x16')]();});}};}function handleEntityNotFound(_0x16b760,_0x23e365){return function(_0x5c709b){if(!_0x5c709b){_0x16b760[_0xbed0('0x14')](0x194);}return _0x5c709b;};}function handleError(_0x5ca9f0,_0x2b03f2){_0x2b03f2=_0x2b03f2||0x1f4;return function(_0x3e7234){logger['error'](_0x3e7234[_0xbed0('0x1e')]);if(_0x3e7234[_0xbed0('0x1f')]){delete _0x3e7234[_0xbed0('0x1f')];}_0x5ca9f0[_0xbed0('0x15')](_0x2b03f2)[_0xbed0('0x20')](_0x3e7234);};}exports[_0xbed0('0x1c')]=function(_0x220c0c,_0x37ff27){if(_0x220c0c['body']['id']){delete _0x220c0c[_0xbed0('0x21')]['id'];}return db[_0xbed0('0x22')][_0xbed0('0x23')]({'where':{'id':_0x220c0c['params']['id']}})[_0xbed0('0x1d')](handleEntityNotFound(_0x37ff27,null))[_0xbed0('0x1d')](saveUpdates(_0x220c0c[_0xbed0('0x21')],null))[_0xbed0('0x1d')](respondWithResult(_0x37ff27,null))[_0xbed0('0x24')](handleError(_0x37ff27,null));};exports[_0xbed0('0x25')]=function(_0x35f7c5,_0x44a11b){return db[_0xbed0('0x22')]['find']({'where':{'id':_0x35f7c5[_0xbed0('0x26')]['id']}})[_0xbed0('0x1d')](handleEntityNotFound(_0x44a11b,null))[_0xbed0('0x1d')](removeEntity(_0x44a11b,null))['catch'](handleError(_0x44a11b,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 13bb6ad..db4bffa 100644 --- a/server/api/action/action.model.js +++ b/server/api/action/action.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8042=['../../config/environment','./action.attributes','exports','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3155cf,_0x3a0a52){var _0x14686e=function(_0x37350a){while(--_0x37350a){_0x3155cf['push'](_0x3155cf['shift']());}};_0x14686e(++_0x3a0a52);}(_0x8042,0x13c));var _0x2804=function(_0x1891df,_0x13f014){_0x1891df=_0x1891df-0x0;var _0x4547d6=_0x8042[_0x1891df];return _0x4547d6;};'use strict';var _=require(_0x2804('0x0'));var util=require(_0x2804('0x1'));var logger=require(_0x2804('0x2'))(_0x2804('0x3'));var moment=require(_0x2804('0x4'));var BPromise=require(_0x2804('0x5'));var rp=require(_0x2804('0x6'));var fs=require('fs');var path=require(_0x2804('0x7'));var rimraf=require(_0x2804('0x8'));var config=require(_0x2804('0x9'));var attributes=require(_0x2804('0xa'));module[_0x2804('0xb')]=function(_0x19809a,_0x2a5627){return _0x19809a['define']('Action',attributes,{'tableName':_0x2804('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26f8=['path','rimraf','./action.attributes','define','Action','tools_actions','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2ba973,_0x1a4cb2){var _0x3166dd=function(_0x57be0c){while(--_0x57be0c){_0x2ba973['push'](_0x2ba973['shift']());}};_0x3166dd(++_0x1a4cb2);}(_0x26f8,0xa2));var _0x826f=function(_0x3d6eb1,_0x1f99b1){_0x3d6eb1=_0x3d6eb1-0x0;var _0x4e5356=_0x26f8[_0x3d6eb1];return _0x4e5356;};'use strict';var _=require('lodash');var util=require(_0x826f('0x0'));var logger=require(_0x826f('0x1'))(_0x826f('0x2'));var moment=require(_0x826f('0x3'));var BPromise=require(_0x826f('0x4'));var rp=require(_0x826f('0x5'));var fs=require('fs');var path=require(_0x826f('0x6'));var rimraf=require(_0x826f('0x7'));var config=require('../../config/environment');var attributes=require(_0x826f('0x8'));module['exports']=function(_0x1b8e2d,_0x1db7ed){return _0x1b8e2d[_0x826f('0x9')](_0x826f('0xa'),attributes,{'tableName':_0x826f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index c2a628d..2f802f2 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['client','http','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1e17eb,_0x2e15c5){var _0x4de4c7=function(_0x52d003){while(--_0x52d003){_0x1e17eb['push'](_0x1e17eb['shift']());}};_0x4de4c7(++_0x2e15c5);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('Action,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xa01121,_0x1a4506){var _0x1fc839=function(_0x2c5bb2){while(--_0x2c5bb2){_0xa01121['push'](_0xa01121['shift']());}};_0x1fc839(++_0x1a4506);}(_0xe706,0xa3));var _0x6e70=function(_0x1c0f8d,_0x1adacb){_0x1c0f8d=_0x1c0f8d-0x0;var _0x108dd2=_0xe706[_0x1c0f8d];return _0x108dd2;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('Action,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('Action,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index c292124..d1d18ed 100644 --- a/server/api/action/index.js +++ b/server/api/action/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xece6=['delete','isAuthenticated','destroy','multer','path','express','../../config/environment','./action.controller','put','/:id'];(function(_0x495ebf,_0x27df21){var _0x5841ef=function(_0x35bdfd){while(--_0x35bdfd){_0x495ebf['push'](_0x495ebf['shift']());}};_0x5841ef(++_0x27df21);}(_0xece6,0x14d));var _0x6ece=function(_0x4f8d4b,_0x1b739d){_0x4f8d4b=_0x4f8d4b-0x0;var _0x19c786=_0xece6[_0x4f8d4b];return _0x19c786;};'use strict';var multer=require(_0x6ece('0x0'));var util=require('util');var path=require(_0x6ece('0x1'));var timeout=require('connect-timeout');var express=require(_0x6ece('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6ece('0x3'));var controller=require(_0x6ece('0x4'));router[_0x6ece('0x5')](_0x6ece('0x6'),auth['isAuthenticated'](),controller['update']);router[_0x6ece('0x7')](_0x6ece('0x6'),auth[_0x6ece('0x8')](),controller[_0x6ece('0x9')]);module['exports']=router; \ No newline at end of file +var _0xa8a8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports'];(function(_0x507d8a,_0x811295){var _0x1589fb=function(_0x478bf1){while(--_0x478bf1){_0x507d8a['push'](_0x507d8a['shift']());}};_0x1589fb(++_0x811295);}(_0xa8a8,0x10e));var _0x8a8a=function(_0xbbf544,_0x3ba193){_0xbbf544=_0xbbf544-0x0;var _0x5e9607=_0xa8a8[_0xbbf544];return _0x5e9607;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var auth=require(_0x8a8a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8a8a('0x6'));var controller=require(_0x8a8a('0x7'));router[_0x8a8a('0x8')](_0x8a8a('0x9'),auth['isAuthenticated'](),controller[_0x8a8a('0xa')]);router[_0x8a8a('0xb')](_0x8a8a('0x9'),auth[_0x8a8a('0xc')](),controller[_0x8a8a('0xd')]);module[_0x8a8a('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index a7bae11..56c1d28 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x67bc=['sequelize','STRING','TEXT'];(function(_0x1b77cc,_0x3995d8){var _0x3acab3=function(_0x2e21d4){while(--_0x2e21d4){_0x1b77cc['push'](_0x1b77cc['shift']());}};_0x3acab3(++_0x3995d8);}(_0x67bc,0x1e3));var _0xc67b=function(_0x450076,_0x10983b){_0x450076=_0x450076-0x0;var _0x2029cc=_0x67bc[_0x450076];return _0x2029cc;};'use strict';var Sequelize=require(_0xc67b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xc67b('0x1')]},'parent':{'type':Sequelize[_0xc67b('0x1')]},'table':{'type':Sequelize[_0xc67b('0x1')]},'conditions':{'type':Sequelize[_0xc67b('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xe115=['sequelize','exports','STRING','TEXT'];(function(_0x57fe48,_0x249284){var _0x859015=function(_0x42dab7){while(--_0x42dab7){_0x57fe48['push'](_0x57fe48['shift']());}};_0x859015(++_0x249284);}(_0xe115,0x190));var _0x5e11=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xe115[_0x16d10f];return _0x50c823;};'use strict';var Sequelize=require(_0x5e11('0x0'));module[_0x5e11('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5e11('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x5e11('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5e11('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 6b6914c..1797580 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.controller.js +++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd89b=['count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','error','name','send','index','AnalyticCustomReport','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','MAX(%s)','AVG(%s)','IS\x20NOT\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','DESC','QueryTypes','ValidationErrorItem','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','COUNT(*)','run','runReport','replace','%s.%s\x20=\x20%s.%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x131232,_0x1ec36c){var _0x50110e=function(_0x29a56b){while(--_0x29a56b){_0x131232['push'](_0x131232['shift']());}};_0x50110e(++_0x1ec36c);}(_0xd89b,0x86));var _0xbd89=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xd89b[_0x334841];return _0x5beb4b;};'use strict';var pdf=require(_0xbd89('0x0'));var emlformat=require(_0xbd89('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbd89('0x2'));var jsonpatch=require(_0xbd89('0x3'));var rp=require(_0xbd89('0x4'));var moment=require(_0xbd89('0x5'));var BPromise=require(_0xbd89('0x6'));var Mustache=require(_0xbd89('0x7'));var util=require(_0xbd89('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xbd89('0x9'));var ejs=require(_0xbd89('0xa'));var fs=require('fs');var _=require(_0xbd89('0xb'));var squel=require(_0xbd89('0xc'));var crypto=require(_0xbd89('0xd'));var jsforce=require(_0xbd89('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd89('0xf'));var Redis=require(_0xbd89('0x10'));var authService=require(_0xbd89('0x11'));var qs=require(_0xbd89('0x12'));var hardwareService=require(_0xbd89('0x13'));var logger=require(_0xbd89('0x14'))(_0xbd89('0x15'));var utils=require('../../config/utils');var config=require(_0xbd89('0x16'));var db=require(_0xbd89('0x17'))['db'];function respondWithStatusCode(_0x48be82,_0x544dee){_0x544dee=_0x544dee||0xcc;return function(_0x218528){if(_0x218528){return _0x48be82[_0xbd89('0x18')](_0x544dee);}return _0x48be82[_0xbd89('0x19')](_0x544dee)[_0xbd89('0x1a')]();};}function respondWithResult(_0x142aa1,_0x43f046){_0x43f046=_0x43f046||0xc8;return function(_0x3196f8){if(_0x3196f8){return _0x142aa1[_0xbd89('0x19')](_0x43f046)[_0xbd89('0x1b')](_0x3196f8);}};}function respondWithFilteredResult(_0x24acbe,_0x2e5332){return function(_0xd4eada){if(_0xd4eada){var _0x15d37b=_0xd4eada[_0xbd89('0x1c')],_0x11734f=_0x2e5332[_0xbd89('0x1d')],_0x32086b=_0x2e5332['offset']+_0x2e5332[_0xbd89('0x1e')],_0x3d509d;if(_0x32086b>=_0x15d37b){_0x32086b=_0x15d37b;_0x3d509d=0xc8;}else{_0x3d509d=0xce;}_0x24acbe[_0xbd89('0x19')](_0x3d509d);return _0x24acbe[_0xbd89('0x1f')](_0xbd89('0x20'),_0x11734f+'-'+_0x32086b+'/'+_0x15d37b)[_0xbd89('0x1b')](_0xd4eada);}return null;};}function patchUpdates(_0x21cee4){return function(_0x2051ac){try{jsonpatch[_0xbd89('0x21')](_0x2051ac,_0x21cee4,!![]);}catch(_0x3fe87d){return BPromise[_0xbd89('0x22')](_0x3fe87d);}return _0x2051ac[_0xbd89('0x23')]();};}function saveUpdates(_0x32cef8,_0x49b784){return function(_0x2a5563){if(_0x2a5563){return _0x2a5563[_0xbd89('0x24')](_0x32cef8)['then'](function(_0xf0b039){return _0xf0b039;});}return null;};}function removeEntity(_0x461064,_0x488940){return function(_0x1d0f4f){if(_0x1d0f4f){return _0x1d0f4f['destroy']()[_0xbd89('0x25')](function(){var _0x354050=_0x1d0f4f[_0xbd89('0x26')]({'plain':!![]});var _0x45ee61=_0xbd89('0x27');return db[_0xbd89('0x28')][_0xbd89('0x29')]({'where':{'type':_0x45ee61,'resourceId':_0x354050['id']}})[_0xbd89('0x25')](function(){return _0x1d0f4f;});})[_0xbd89('0x25')](function(){_0x461064[_0xbd89('0x19')](0xcc)[_0xbd89('0x1a')]();});}};}function handleEntityNotFound(_0x53f0b8,_0x14e3c8){return function(_0x113537){if(!_0x113537){_0x53f0b8[_0xbd89('0x18')](0x194);}return _0x113537;};}function handleError(_0x3a9108,_0x14eadb){_0x14eadb=_0x14eadb||0x1f4;return function(_0x411889){logger[_0xbd89('0x2a')](_0x411889['stack']);if(_0x411889[_0xbd89('0x2b')]){delete _0x411889[_0xbd89('0x2b')];}_0x3a9108['status'](_0x14eadb)[_0xbd89('0x2c')](_0x411889);};}exports[_0xbd89('0x2d')]=function(_0x42c53d,_0x21c3e0){var _0x56357e={},_0x50822b={},_0x18d70c={'count':0x0,'rows':[]};var _0x320b73=db[_0xbd89('0x2e')]['rawAttributes'];_0x50822b[_0xbd89('0x2f')]=_['keys'](_0x320b73);_0x50822b['query']=_[_0xbd89('0x30')](_0x42c53d[_0xbd89('0x31')]);_0x50822b[_0xbd89('0x32')]=_[_0xbd89('0x33')](_0x50822b['model'],_0x50822b[_0xbd89('0x31')]);_0x56357e[_0xbd89('0x34')]=_[_0xbd89('0x33')](_0x50822b[_0xbd89('0x2f')],qs[_0xbd89('0x35')](_0x42c53d['query'][_0xbd89('0x35')]));_0x56357e['attributes']=_0x56357e['attributes']['length']?_0x56357e[_0xbd89('0x34')]:_0x50822b[_0xbd89('0x2f')];if(!_0x42c53d[_0xbd89('0x31')][_0xbd89('0x36')]('nolimit')){_0x56357e[_0xbd89('0x1e')]=qs[_0xbd89('0x1e')](_0x42c53d[_0xbd89('0x31')][_0xbd89('0x1e')]);_0x56357e['offset']=qs['offset'](_0x42c53d['query']['offset']);}_0x56357e[_0xbd89('0x37')]=qs[_0xbd89('0x38')](_0x42c53d[_0xbd89('0x31')][_0xbd89('0x38')]);_0x56357e['where']=qs[_0xbd89('0x32')](_[_0xbd89('0x39')](_0x42c53d[_0xbd89('0x31')],_0x50822b[_0xbd89('0x32')]));if(_0x42c53d['query'][_0xbd89('0x3a')]){_0x56357e[_0xbd89('0x3b')]=_[_0xbd89('0x3c')](_0x56357e['where'],{'$or':_['map'](_0x320b73,function(_0x5dfa02){if(_0x5dfa02[_0xbd89('0x3d')]['key']!==_0xbd89('0x3e')){var _0x4780aa={};_0x4780aa[_0x5dfa02[_0xbd89('0x3f')]]={'$like':'%'+_0x42c53d[_0xbd89('0x31')][_0xbd89('0x3a')]+'%'};return _0x4780aa;}})});}_0x56357e=_[_0xbd89('0x3c')]({},_0x56357e,_0x42c53d[_0xbd89('0x40')]);var _0x43d9e7={'where':_0x56357e[_0xbd89('0x3b')]};return db[_0xbd89('0x2e')]['count'](_0x43d9e7)['then'](function(_0x4d2ee7){_0x18d70c[_0xbd89('0x1c')]=_0x4d2ee7;if(_0x42c53d[_0xbd89('0x31')][_0xbd89('0x41')]){_0x56357e[_0xbd89('0x42')]=[{'all':!![]}];}return db[_0xbd89('0x2e')][_0xbd89('0x43')](_0x56357e);})[_0xbd89('0x25')](function(_0x2698d7){_0x18d70c[_0xbd89('0x44')]=_0x2698d7;return _0x18d70c;})['then'](respondWithFilteredResult(_0x21c3e0,_0x56357e))[_0xbd89('0x45')](handleError(_0x21c3e0,null));};exports['show']=function(_0x1b10ad,_0x30c8fb){var _0x7b1604={'raw':![],'where':{'id':_0x1b10ad[_0xbd89('0x46')]['id']}},_0x57e9de={};_0x57e9de['model']=_[_0xbd89('0x30')](db['AnalyticCustomReport'][_0xbd89('0x47')]);_0x57e9de[_0xbd89('0x31')]=_['keys'](_0x1b10ad['query']);_0x57e9de[_0xbd89('0x32')]=_[_0xbd89('0x33')](_0x57e9de['model'],_0x57e9de[_0xbd89('0x31')]);_0x7b1604[_0xbd89('0x34')]=_[_0xbd89('0x33')](_0x57e9de['model'],qs['fields'](_0x1b10ad[_0xbd89('0x31')][_0xbd89('0x35')]));_0x7b1604['attributes']=_0x7b1604[_0xbd89('0x34')][_0xbd89('0x48')]?_0x7b1604[_0xbd89('0x34')]:_0x57e9de[_0xbd89('0x2f')];if(_0x1b10ad[_0xbd89('0x31')][_0xbd89('0x41')]){_0x7b1604['include']=[{'all':!![]}];}_0x7b1604=_['merge']({},_0x7b1604,_0x1b10ad[_0xbd89('0x40')]);return db[_0xbd89('0x2e')][_0xbd89('0x49')](_0x7b1604)[_0xbd89('0x25')](handleEntityNotFound(_0x30c8fb,null))['then'](respondWithResult(_0x30c8fb,null))[_0xbd89('0x45')](handleError(_0x30c8fb,null));};exports[_0xbd89('0x4a')]=function(_0x8233c8,_0x4369e3){return db[_0xbd89('0x2e')][_0xbd89('0x4a')](_0x8233c8[_0xbd89('0x4b')],{})['then'](function(_0x11a6eb){var _0x2a8b15=_0x8233c8[_0xbd89('0x4c')][_0xbd89('0x26')]({'plain':!![]});if(!_0x2a8b15)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a8b15[_0xbd89('0x4d')]===_0xbd89('0x4c')){var _0x576c7c=_0x11a6eb['get']({'plain':!![]});var _0x596332='Reports';return db[_0xbd89('0x4e')][_0xbd89('0x49')]({'where':{'name':_0x596332,'userProfileId':_0x2a8b15[_0xbd89('0x4f')]},'raw':!![]})['then'](function(_0x175579){if(_0x175579&&_0x175579[_0xbd89('0x50')]===0x0){return db[_0xbd89('0x28')][_0xbd89('0x4a')]({'name':_0x576c7c[_0xbd89('0x2b')],'resourceId':_0x576c7c['id'],'type':_0xbd89('0x27'),'sectionId':_0x175579['id']},{})[_0xbd89('0x25')](function(){return _0x11a6eb;});}else{return _0x11a6eb;}})[_0xbd89('0x45')](function(_0x5942f1){logger[_0xbd89('0x2a')](_0xbd89('0x51'),_0x5942f1);throw _0x5942f1;});}return _0x11a6eb;})[_0xbd89('0x25')](respondWithResult(_0x4369e3,0xc9))[_0xbd89('0x45')](handleError(_0x4369e3,null));};exports['update']=function(_0x4d627e,_0x23c3de){if(_0x4d627e[_0xbd89('0x4b')]['id']){delete _0x4d627e[_0xbd89('0x4b')]['id'];}return db[_0xbd89('0x2e')][_0xbd89('0x49')]({'where':{'id':_0x4d627e[_0xbd89('0x46')]['id']}})[_0xbd89('0x25')](handleEntityNotFound(_0x23c3de,null))['then'](saveUpdates(_0x4d627e[_0xbd89('0x4b')],null))[_0xbd89('0x25')](respondWithResult(_0x23c3de,null))[_0xbd89('0x45')](handleError(_0x23c3de,null));};exports[_0xbd89('0x29')]=function(_0x22963c,_0x3d198c){return db[_0xbd89('0x2e')][_0xbd89('0x49')]({'where':{'id':_0x22963c[_0xbd89('0x46')]['id']}})[_0xbd89('0x25')](handleEntityNotFound(_0x3d198c,null))[_0xbd89('0x25')](removeEntity(_0x3d198c,null))['catch'](handleError(_0x3d198c,null));};exports['preview']=function(_0x55f1ae,_0x449647){var _0x5e5614=0xa;var _0x181582=[_0xbd89('0x52'),_0xbd89('0x53'),_0xbd89('0x54'),_0xbd89('0x55')];var _0xc7871e={'SUM':'SUM(%s)','COUNT':_0xbd89('0x56'),'COUNT DISTINCT':_0xbd89('0x57'),'MAX':'MAX(%s)','MIN':_0xbd89('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xbd89('0x59'),'GROUP_CONCAT ASC':_0xbd89('0x5a'),'GROUP_CONCAT DESC':_0xbd89('0x5b')};var _0x5597c7={'SEC_TO_TIME':_0xbd89('0x5c'),'DATE':_0xbd89('0x5d'),'HOUR':_0xbd89('0x5e'),'ROUND':_0xbd89('0x5f'),'UNIX_TIMESTAMP':_0xbd89('0x60')};var _0x17a8ce=function(_0x37ea5c){return!_[_0xbd89('0x61')]([_0xbd89('0x62'),'IS\x20NOT\x20NULL',_0xbd89('0x63'),_0xbd89('0x64')],_0x37ea5c);};var _0x3fdc5b=function(_0x51ef20){if(!_0x51ef20||!_0x51ef20['rules'][_0xbd89('0x48')]){return'';}for(var _0x429142='(',_0xe62c6b=0x0;_0xe62c6b<_0x51ef20[_0xbd89('0x65')]['length'];_0xe62c6b+=0x1){_0xe62c6b>0x0&&(_0x429142+='\x20'+_0x51ef20[_0xbd89('0x66')]+'\x20');_0x429142+=_0x51ef20[_0xbd89('0x65')][_0xe62c6b][_0xbd89('0x67')]?_0x3fdc5b(_0x51ef20['rules'][_0xe62c6b]['group']):_0x51ef20[_0xbd89('0x65')][_0xe62c6b]['field']+'\x20'+_0x51ef20[_0xbd89('0x65')][_0xe62c6b][_0xbd89('0x68')]+(_0x17a8ce(_0x51ef20['rules'][_0xe62c6b]['condition'])?'\x20'+_0x51ef20[_0xbd89('0x65')][_0xe62c6b][_0xbd89('0x69')]:'');}return _0x429142+')';};var _0x1a7470={'where':{'id':_0x55f1ae[_0xbd89('0x46')]['id']}},_0x290f10,_0x7a4130,_0x472530,_0x38c456,_0x31dcfa;_0x1a7470=_[_0xbd89('0x3c')]({},_0x1a7470,_0x55f1ae['options']);return db['AnalyticCustomReport'][_0xbd89('0x49')](_0x1a7470)[_0xbd89('0x25')](function(_0x425f6f){if(_0x425f6f){_0x290f10=_0x425f6f;return _0x425f6f[_0xbd89('0x6a')]();}return null;})[_0xbd89('0x25')](function(_0xf8f9e9){if(_0xf8f9e9){if(!_0xf8f9e9[_0xbd89('0x48')]){throw new db[(_0xbd89('0x6b'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x7a4130=_0xf8f9e9;return db['AnalyticMetric'][_0xbd89('0x43')]({'raw':!![]});}return null;})[_0xbd89('0x25')](function(_0x5ac56b){if(_0x5ac56b){_0x472530=_[_0xbd89('0x6c')](_0x5ac56b,'id');var _0x2b54c9;var _0x51e90e=squel[_0xbd89('0x6d')]();_0x51e90e[_0xbd89('0x6e')](_0x290f10[_0xbd89('0x6f')]);for(var _0x319064=0x0;_0x319064<_0x7a4130['length'];_0x319064+=0x1){_0x2b54c9=_0x7a4130[_0x319064][_0xbd89('0x70')]?_0x472530[_0x7a4130[_0x319064][_0xbd89('0x70')]][_0xbd89('0x71')]:_0x7a4130[_0x319064]['field'];_0x2b54c9=_0x7a4130[_0x319064][_0xbd89('0x72')]?_['replace'](_0xc7871e[_0x7a4130[_0x319064][_0xbd89('0x72')]],'%s',_0x2b54c9):_0x2b54c9;_0x2b54c9=_0x7a4130[_0x319064][_0xbd89('0x73')]?_['replace'](_0x5597c7[_0x7a4130[_0x319064][_0xbd89('0x73')]],'%s',_0x2b54c9):_0x2b54c9;if(_0x7a4130[_0x319064][_0xbd89('0x74')]){_0x51e90e['group'](_0x2b54c9);}_0x7a4130[_0x319064][_0xbd89('0x75')]&&_0x51e90e['order'](_0x2b54c9,_0x7a4130[_0x319064][_0xbd89('0x75')]==='DESC'?![]:!![]);_0x51e90e[_0xbd89('0x3f')](_0x2b54c9,_0x7a4130[_0x319064][_0xbd89('0x76')]||_0x2b54c9);}if(_0x290f10[_0xbd89('0x77')]){_0x290f10[_0xbd89('0x77')]=JSON[_0xbd89('0x78')](_0x290f10[_0xbd89('0x77')]);for(var _0x510d83=0x0;_0x510d83<_0x290f10['joins'][_0xbd89('0x48')];_0x510d83+=0x1){if(_0x290f10[_0xbd89('0x77')][_0x510d83][_0xbd89('0x3d')]&&_[_0xbd89('0x61')](_0x181582,_0x290f10[_0xbd89('0x77')][_0x510d83][_0xbd89('0x3d')])&&_0x290f10['joins'][_0x510d83][_0xbd89('0x79')]&&_0x290f10[_0xbd89('0x77')][_0x510d83]['foreignTable']&&_0x290f10['joins'][_0x510d83]['foreignKey']){_0x51e90e[_0x290f10['joins'][_0x510d83]['type']](_0x290f10[_0xbd89('0x77')][_0x510d83][_0xbd89('0x7a')],null,util[_0xbd89('0x73')]('%s.%s\x20=\x20%s.%s',_0x290f10[_0xbd89('0x6f')],_0x290f10[_0xbd89('0x77')][_0x510d83][_0xbd89('0x79')],_0x290f10['joins'][_0x510d83]['foreignTable'],_0x290f10['joins'][_0x510d83][_0xbd89('0x7b')]));}}}if(_0x290f10[_0xbd89('0x7c')]){_0x290f10[_0xbd89('0x7c')]=JSON[_0xbd89('0x78')](_0x290f10[_0xbd89('0x7c')]);_0x51e90e['where'](_0x3fdc5b(_0x290f10[_0xbd89('0x7c')]['group']));}_0x31dcfa=_0x51e90e[_0xbd89('0x7d')]();_0x51e90e[_0xbd89('0x1e')](_0x5e5614);_0x51e90e[_0xbd89('0x1d')](0x0);logger[_0xbd89('0x7e')](_0xbd89('0x7f'),_0x51e90e[_0xbd89('0x80')]());return db[_0xbd89('0x81')]['query'](_0x51e90e['toString'](),{'type':db['sequelize']['QueryTypes'][_0xbd89('0x82')]});}})['then'](respondWithResult(_0x449647,null))[_0xbd89('0x45')](handleError(_0x449647,null));};function runReport(_0x7d103f,_0x142031,_0x21c4c1){var _0x5c508c=_0x142031['name'];var _0x317dd5=0xa;var _0x3e951b=['join',_0xbd89('0x53'),'right_join',_0xbd89('0x55')];var _0x3f9947={'SUM':_0xbd89('0x83'),'COUNT':_0xbd89('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xbd89('0x84'),'MIN':_0xbd89('0x58'),'AVG':_0xbd89('0x85'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbd89('0x5a'),'GROUP_CONCAT DESC':_0xbd89('0x5b')};var _0x149ba2={'SEC_TO_TIME':_0xbd89('0x5c'),'DATE':'DATE(%s)','HOUR':_0xbd89('0x5e'),'ROUND':_0xbd89('0x5f'),'UNIX_TIMESTAMP':_0xbd89('0x60')};var _0x18ccd4=function(_0x4bf9c1){return!_['includes'](['IS\x20NULL',_0xbd89('0x86'),_0xbd89('0x63'),'IS\x20NOT\x20EMPTY'],_0x4bf9c1);};var _0x42b257=function(_0x5f4b80){if(!_0x5f4b80||!_0x5f4b80[_0xbd89('0x65')]['length']){return'';}for(var _0x48afd9='(',_0x2994dd=0x0;_0x2994dd<_0x5f4b80[_0xbd89('0x65')][_0xbd89('0x48')];_0x2994dd+=0x1){_0x2994dd>0x0&&(_0x48afd9+='\x20'+_0x5f4b80[_0xbd89('0x66')]+'\x20');_0x48afd9+=_0x5f4b80[_0xbd89('0x65')][_0x2994dd]['group']?_0x42b257(_0x5f4b80[_0xbd89('0x65')][_0x2994dd][_0xbd89('0x67')]):_0x5f4b80[_0xbd89('0x65')][_0x2994dd][_0xbd89('0x3f')]+'\x20'+_0x5f4b80[_0xbd89('0x65')][_0x2994dd][_0xbd89('0x68')]+(_0x18ccd4(_0x5f4b80[_0xbd89('0x65')][_0x2994dd][_0xbd89('0x68')])?'\x20'+_0x5f4b80['rules'][_0x2994dd]['value']:'');}return _0x48afd9+')';};var _0x1e2a0b={'where':{'id':_0x7d103f['id']}},_0x21aaba,_0x3f6129,_0x59883f,_0x380a41,_0x3a8613;_0x1e2a0b=_['merge']({},_0x1e2a0b,_0x21c4c1);return db[_0xbd89('0x2e')][_0xbd89('0x49')](_0x1e2a0b)['then'](function(_0x134620){if(_0x134620){_0x21aaba=_0x134620;return _0x134620[_0xbd89('0x6a')]();}return null;})[_0xbd89('0x25')](function(_0x2fbfd6){if(_0x2fbfd6){if(!_0x2fbfd6[_0xbd89('0x48')]){throw new db[(_0xbd89('0x6b'))]['ValidationErrorItem'](_0xbd89('0x87'),0x193);}_0x3f6129=_0x2fbfd6;return db[_0xbd89('0x88')]['findAll']({'raw':!![]});}return null;})[_0xbd89('0x25')](function(_0xd6e936){if(_0xd6e936){_0x59883f=_[_0xbd89('0x6c')](_0xd6e936,'id');var _0x3f2978;var _0x1ec1cd=squel[_0xbd89('0x6d')]();_0x1ec1cd[_0xbd89('0x6e')](_0x21aaba[_0xbd89('0x6f')]);for(var _0x33f11b=0x0;_0x33f11b<_0x3f6129[_0xbd89('0x48')];_0x33f11b+=0x1){_0x3f2978=_0x3f6129[_0x33f11b][_0xbd89('0x70')]?_0x59883f[_0x3f6129[_0x33f11b][_0xbd89('0x70')]][_0xbd89('0x71')]:_0x3f6129[_0x33f11b]['field'];_0x3f2978=_0x3f6129[_0x33f11b]['function']?_['replace'](_0x3f9947[_0x3f6129[_0x33f11b][_0xbd89('0x72')]],'%s',_0x3f2978):_0x3f2978;_0x3f2978=_0x3f6129[_0x33f11b][_0xbd89('0x73')]?_['replace'](_0x149ba2[_0x3f6129[_0x33f11b][_0xbd89('0x73')]],'%s',_0x3f2978):_0x3f2978;if(_0x3f6129[_0x33f11b][_0xbd89('0x74')]){_0x1ec1cd[_0xbd89('0x67')](_0x3f2978);}_0x3f6129[_0x33f11b][_0xbd89('0x75')]&&_0x1ec1cd['order'](_0x3f2978,_0x3f6129[_0x33f11b]['orderBy']===_0xbd89('0x89')?![]:!![]);_0x1ec1cd[_0xbd89('0x3f')](_0x3f2978,_0x3f6129[_0x33f11b]['alias']||_0x3f2978);}if(_0x21aaba[_0xbd89('0x77')]){_0x21aaba[_0xbd89('0x77')]=JSON['parse'](_0x21aaba['joins']);for(var _0x55b8ae=0x0;_0x55b8ae<_0x21aaba[_0xbd89('0x77')][_0xbd89('0x48')];_0x55b8ae+=0x1){if(_0x21aaba[_0xbd89('0x77')][_0x55b8ae][_0xbd89('0x3d')]&&_['includes'](_0x3e951b,_0x21aaba[_0xbd89('0x77')][_0x55b8ae][_0xbd89('0x3d')])&&_0x21aaba[_0xbd89('0x77')][_0x55b8ae]['parentKey']&&_0x21aaba[_0xbd89('0x77')][_0x55b8ae][_0xbd89('0x7a')]&&_0x21aaba['joins'][_0x55b8ae][_0xbd89('0x7b')]){_0x1ec1cd[_0x21aaba[_0xbd89('0x77')][_0x55b8ae][_0xbd89('0x3d')]](_0x21aaba[_0xbd89('0x77')][_0x55b8ae][_0xbd89('0x7a')],null,util[_0xbd89('0x73')]('%s.%s\x20=\x20%s.%s',_0x21aaba[_0xbd89('0x6f')],_0x21aaba['joins'][_0x55b8ae][_0xbd89('0x79')],_0x21aaba[_0xbd89('0x77')][_0x55b8ae][_0xbd89('0x7a')],_0x21aaba['joins'][_0x55b8ae][_0xbd89('0x7b')]));}}}if(_0x21aaba['conditions']){_0x21aaba[_0xbd89('0x7c')]=JSON[_0xbd89('0x78')](_0x21aaba[_0xbd89('0x7c')]);_0x1ec1cd['where'](_0x42b257(_0x21aaba[_0xbd89('0x7c')][_0xbd89('0x67')]));}_0x3a8613=_0x1ec1cd[_0xbd89('0x7d')]();_0x1ec1cd['limit'](_0x317dd5);_0x1ec1cd[_0xbd89('0x1d')](0x0);logger[_0xbd89('0x7e')](_0xbd89('0x7f'),_0x1ec1cd[_0xbd89('0x80')]());return db[_0xbd89('0x81')][_0xbd89('0x31')](_0x1ec1cd[_0xbd89('0x80')](),{'type':db[_0xbd89('0x81')][_0xbd89('0x8a')]['SELECT']});}})['then'](function(_0x10b1fa){if(!_0x10b1fa['length']){throw new db[(_0xbd89('0x6b'))][(_0xbd89('0x8b'))](_0xbd89('0x8c'),0xcc);}if(_0x142031[_0xbd89('0x8d')]===_0xbd89('0x8e')){return null;}var _0x4b4415=_[_0xbd89('0x3c')](_0x142031,{'name':_0x142031[_0xbd89('0x8f')]||_0x142031[_0xbd89('0x2b')]||_0x21aaba[_0xbd89('0x2b')],'basename':_0x5c508c,'savename':util['format'](_0xbd89('0x90'),_0x142031[_0xbd89('0x2b')]||_0x21aaba['name'],require(_0xbd89('0x91'))['generate'](0x4),_0x142031[_0xbd89('0x8d')]||_0xbd89('0x92')),'reportId':_0x21aaba['id'],'reportType':_0xbd89('0x93')});return db[_0xbd89('0x94')][_0xbd89('0x4a')](_0x4b4415,{'raw':!![]});})['then'](function(_0x5ebe3c){if(_0x21aaba['table']===_0xbd89('0x95')){_0x3a8613[_0xbd89('0x3b')](_0x21aaba[_0xbd89('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x142031[_0xbd89('0x96')],_0x142031[_0xbd89('0x97')]);}else{_0x3a8613[_0xbd89('0x3b')](_0x21aaba[_0xbd89('0x6f')]+_0xbd89('0x98'),_0x142031[_0xbd89('0x96')],_0x142031[_0xbd89('0x97')]);}if(_0x5ebe3c){logger[_0xbd89('0x99')]('Run\x20Query:',_0x3a8613[_0xbd89('0x80')]());require(_0xbd89('0x9a'))[_0xbd89('0x9b')](path[_0xbd89('0x52')](__dirname,_0xbd89('0x9c'),_0x5ebe3c[_0xbd89('0x8d')]),[_0x5ebe3c['id'],_0x3a8613['toString'](),path[_0xbd89('0x52')](__dirname,'../../files/reports',_0x5ebe3c['savename']),_0x5c508c]);return _0x5ebe3c;}else{var _0x2a93f3=squel[_0xbd89('0x6d')]();_0x2a93f3[_0xbd89('0x6e')]('('+_0x3a8613[_0xbd89('0x80')]()+')','countTable');_0x2a93f3[_0xbd89('0x3f')](_0xbd89('0x9d'),_0xbd89('0x1c'));_0x3a8613[_0xbd89('0x1e')](_0x142031[_0xbd89('0x1e')]||_0x317dd5);_0x3a8613[_0xbd89('0x1d')](_0x142031[_0xbd89('0x1d')]||0x0);return db[_0xbd89('0x81')]['query'](_0x2a93f3[_0xbd89('0x80')](),{'type':db[_0xbd89('0x81')][_0xbd89('0x8a')][_0xbd89('0x82')]})[_0xbd89('0x25')](function(_0x7cb80f){if(!_0x7cb80f[_0xbd89('0x48')]){_0x380a41=0x0;}else{_0x380a41=_0x7cb80f[0x0][_0xbd89('0x1c')]||0x0;}return db[_0xbd89('0x81')]['query'](_0x3a8613[_0xbd89('0x80')](),{'type':db['sequelize'][_0xbd89('0x8a')]['SELECT']});})[_0xbd89('0x25')](function(_0x3a4c77){return{'rows':_0x3a4c77||[],'count':_0x380a41};});}});}exports[_0xbd89('0x9e')]=function(_0x2026a1,_0x531502){return runReport(_0x2026a1[_0xbd89('0x46')],_0x2026a1[_0xbd89('0x31')],_0x2026a1[_0xbd89('0x40')])['then'](respondWithResult(_0x531502,null))[_0xbd89('0x45')](handleError(_0x531502,null));};exports[_0xbd89('0x9f')]=runReport;exports[_0xbd89('0x31')]=function(_0x2c108a,_0x40b786){var _0x27cde9=0xa;var _0x465a1f=['join',_0xbd89('0x53'),'right_join',_0xbd89('0x55')];var _0x52cfd2={'SUM':'SUM(%s)','COUNT':_0xbd89('0x56'),'COUNT DISTINCT':_0xbd89('0x57'),'MAX':_0xbd89('0x84'),'MIN':_0xbd89('0x58'),'AVG':_0xbd89('0x85'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xbd89('0x5b')};var _0x54d411={'SEC_TO_TIME':_0xbd89('0x5c'),'DATE':_0xbd89('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0xbd89('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x32464c=function(_0x5cd963){return!_[_0xbd89('0x61')]([_0xbd89('0x62'),_0xbd89('0x86'),_0xbd89('0x63'),_0xbd89('0x64')],_0x5cd963);};var _0x1dad19=function(_0x3c0e67){if(!_0x3c0e67||!_0x3c0e67[_0xbd89('0x65')][_0xbd89('0x48')]){return'';}for(var _0x4c2d41='(',_0x56098a=0x0;_0x56098a<_0x3c0e67['rules'][_0xbd89('0x48')];_0x56098a+=0x1){_0x56098a>0x0&&(_0x4c2d41+='\x20'+_0x3c0e67['operator']+'\x20');_0x4c2d41+=_0x3c0e67[_0xbd89('0x65')][_0x56098a]['group']?_0x1dad19(_0x3c0e67[_0xbd89('0x65')][_0x56098a][_0xbd89('0x67')]):_0x3c0e67['rules'][_0x56098a][_0xbd89('0x3f')]+'\x20'+_0x3c0e67[_0xbd89('0x65')][_0x56098a][_0xbd89('0x68')]+(_0x32464c(_0x3c0e67['rules'][_0x56098a][_0xbd89('0x68')])?'\x20'+_0x3c0e67['rules'][_0x56098a]['value']:'');}return _0x4c2d41+')';};var _0x38737f={'where':{'id':_0x2c108a[_0xbd89('0x46')]['id']}},_0x2ad3d9,_0x521b85,_0x37958c,_0x10dde3,_0x598a1c;_0x38737f=_['merge']({},_0x38737f,_0x2c108a['options']);return db['AnalyticCustomReport'][_0xbd89('0x49')](_0x38737f)['then'](function(_0x4d8325){if(_0x4d8325){_0x2ad3d9=_0x4d8325;return _0x4d8325[_0xbd89('0x6a')]();}return null;})[_0xbd89('0x25')](function(_0x145c9e){if(_0x145c9e){if(!_0x145c9e[_0xbd89('0x48')]){throw new db[(_0xbd89('0x6b'))][(_0xbd89('0x8b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x521b85=_0x145c9e;return db['AnalyticMetric'][_0xbd89('0x43')]({'raw':!![]});}return null;})[_0xbd89('0x25')](function(_0x362923){if(_0x362923){_0x37958c=_[_0xbd89('0x6c')](_0x362923,'id');var _0x1cbd5f;var _0x2784e1=squel[_0xbd89('0x6d')]();_0x2784e1[_0xbd89('0x6e')](_0x2ad3d9[_0xbd89('0x6f')]);for(var _0xa59e=0x0;_0xa59e<_0x521b85[_0xbd89('0x48')];_0xa59e+=0x1){_0x1cbd5f=_0x521b85[_0xa59e][_0xbd89('0x70')]?_0x37958c[_0x521b85[_0xa59e][_0xbd89('0x70')]][_0xbd89('0x71')]:_0x521b85[_0xa59e][_0xbd89('0x3f')];_0x1cbd5f=_0x521b85[_0xa59e][_0xbd89('0x72')]?_[_0xbd89('0xa0')](_0x52cfd2[_0x521b85[_0xa59e]['function']],'%s',_0x1cbd5f):_0x1cbd5f;_0x1cbd5f=_0x521b85[_0xa59e][_0xbd89('0x73')]?_[_0xbd89('0xa0')](_0x54d411[_0x521b85[_0xa59e]['format']],'%s',_0x1cbd5f):_0x1cbd5f;if(_0x521b85[_0xa59e][_0xbd89('0x74')]){_0x2784e1[_0xbd89('0x67')](_0x1cbd5f);}_0x521b85[_0xa59e][_0xbd89('0x75')]&&_0x2784e1['order'](_0x1cbd5f,_0x521b85[_0xa59e]['orderBy']===_0xbd89('0x89')?![]:!![]);_0x2784e1['field'](_0x1cbd5f,_0x521b85[_0xa59e][_0xbd89('0x76')]||_0x1cbd5f);}if(_0x2ad3d9[_0xbd89('0x77')]){_0x2ad3d9['joins']=JSON[_0xbd89('0x78')](_0x2ad3d9[_0xbd89('0x77')]);for(var _0x1364a6=0x0;_0x1364a6<_0x2ad3d9[_0xbd89('0x77')][_0xbd89('0x48')];_0x1364a6+=0x1){if(_0x2ad3d9[_0xbd89('0x77')][_0x1364a6][_0xbd89('0x3d')]&&_[_0xbd89('0x61')](_0x465a1f,_0x2ad3d9[_0xbd89('0x77')][_0x1364a6][_0xbd89('0x3d')])&&_0x2ad3d9[_0xbd89('0x77')][_0x1364a6]['parentKey']&&_0x2ad3d9[_0xbd89('0x77')][_0x1364a6][_0xbd89('0x7a')]&&_0x2ad3d9[_0xbd89('0x77')][_0x1364a6][_0xbd89('0x7b')]){_0x2784e1[_0x2ad3d9[_0xbd89('0x77')][_0x1364a6][_0xbd89('0x3d')]](_0x2ad3d9[_0xbd89('0x77')][_0x1364a6]['foreignTable'],null,util[_0xbd89('0x73')](_0xbd89('0xa1'),_0x2ad3d9[_0xbd89('0x6f')],_0x2ad3d9[_0xbd89('0x77')][_0x1364a6][_0xbd89('0x79')],_0x2ad3d9['joins'][_0x1364a6][_0xbd89('0x7a')],_0x2ad3d9[_0xbd89('0x77')][_0x1364a6][_0xbd89('0x7b')]));}}}if(_0x2ad3d9[_0xbd89('0x7c')]){_0x2ad3d9[_0xbd89('0x7c')]=JSON['parse'](_0x2ad3d9[_0xbd89('0x7c')]);_0x2784e1[_0xbd89('0x3b')](_0x1dad19(_0x2ad3d9[_0xbd89('0x7c')][_0xbd89('0x67')]));}_0x598a1c=_0x2784e1[_0xbd89('0x7d')]();_0x2784e1[_0xbd89('0x1e')](_0x27cde9);_0x2784e1[_0xbd89('0x1d')](0x0);logger[_0xbd89('0x7e')](_0xbd89('0x7f'),_0x2784e1[_0xbd89('0x80')]());return db[_0xbd89('0x81')]['query'](_0x2784e1['toString'](),{'type':db[_0xbd89('0x81')]['QueryTypes'][_0xbd89('0x82')]});}})[_0xbd89('0x25')](function(){return{'sql':_0x598a1c[_0xbd89('0x80')]()};})[_0xbd89('0x25')](respondWithResult(_0x40b786,null))[_0xbd89('0x45')](handleError(_0x40b786,null));}; \ No newline at end of file +var _0x3ac3=['child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','groupBy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','set','Content-Range','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','offset','sort','where','filters','pick','filter','map','type','key','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','field','function','replace','format','orderBy','order','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','SEC_TO_TIME(%s)','select','alias','sequelize','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3ac3,0x155));var _0x33ac=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0x3ac3[_0x57975f];return _0x4793b8;};'use strict';var pdf=require(_0x33ac('0x0'));var emlformat=require(_0x33ac('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x33ac('0x2'));var jsonpatch=require(_0x33ac('0x3'));var rp=require(_0x33ac('0x4'));var moment=require(_0x33ac('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x33ac('0x6'));var util=require(_0x33ac('0x7'));var path=require('path');var sox=require(_0x33ac('0x8'));var csv=require(_0x33ac('0x9'));var ejs=require(_0x33ac('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x33ac('0xb'));var crypto=require('crypto');var jsforce=require(_0x33ac('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x33ac('0x9'));var querystring=require(_0x33ac('0xd'));var Papa=require(_0x33ac('0xe'));var Redis=require(_0x33ac('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x33ac('0x10'));var hardwareService=require(_0x33ac('0x11'));var logger=require(_0x33ac('0x12'))(_0x33ac('0x13'));var utils=require(_0x33ac('0x14'));var config=require(_0x33ac('0x15'));var db=require(_0x33ac('0x16'))['db'];function respondWithStatusCode(_0x10b953,_0x47123c){_0x47123c=_0x47123c||0xcc;return function(_0x2976fb){if(_0x2976fb){return _0x10b953[_0x33ac('0x17')](_0x47123c);}return _0x10b953[_0x33ac('0x18')](_0x47123c)[_0x33ac('0x19')]();};}function respondWithResult(_0x3ed9b7,_0x52d549){_0x52d549=_0x52d549||0xc8;return function(_0x53a94f){if(_0x53a94f){return _0x3ed9b7[_0x33ac('0x18')](_0x52d549)[_0x33ac('0x1a')](_0x53a94f);}};}function respondWithFilteredResult(_0x469205,_0x47a8b7){return function(_0x3a31ef){if(_0x3a31ef){var _0x1b58b3=_0x3a31ef['count'],_0x462a8=_0x47a8b7['offset'],_0x1ea475=_0x47a8b7['offset']+_0x47a8b7[_0x33ac('0x1b')],_0x4189ad;if(_0x1ea475>=_0x1b58b3){_0x1ea475=_0x1b58b3;_0x4189ad=0xc8;}else{_0x4189ad=0xce;}_0x469205[_0x33ac('0x18')](_0x4189ad);return _0x469205[_0x33ac('0x1c')](_0x33ac('0x1d'),_0x462a8+'-'+_0x1ea475+'/'+_0x1b58b3)[_0x33ac('0x1a')](_0x3a31ef);}return null;};}function patchUpdates(_0x310593){return function(_0x2c124c){try{jsonpatch['apply'](_0x2c124c,_0x310593,!![]);}catch(_0x2e4b29){return BPromise[_0x33ac('0x1e')](_0x2e4b29);}return _0x2c124c[_0x33ac('0x1f')]();};}function saveUpdates(_0x4fde13,_0xcb1e11){return function(_0x533519){if(_0x533519){return _0x533519[_0x33ac('0x20')](_0x4fde13)[_0x33ac('0x21')](function(_0x16c3a2){return _0x16c3a2;});}return null;};}function removeEntity(_0x1ffb5a,_0x377627){return function(_0x303568){if(_0x303568){return _0x303568[_0x33ac('0x22')]()[_0x33ac('0x21')](function(){var _0x2710dd=_0x303568[_0x33ac('0x23')]({'plain':!![]});var _0x2e7da9=_0x33ac('0x24');return db[_0x33ac('0x25')][_0x33ac('0x22')]({'where':{'type':_0x2e7da9,'resourceId':_0x2710dd['id']}})['then'](function(){return _0x303568;});})[_0x33ac('0x21')](function(){_0x1ffb5a['status'](0xcc)[_0x33ac('0x19')]();});}};}function handleEntityNotFound(_0x29aad1,_0x24855f){return function(_0x4ed4fd){if(!_0x4ed4fd){_0x29aad1[_0x33ac('0x17')](0x194);}return _0x4ed4fd;};}function handleError(_0x5d4c0a,_0x34114a){_0x34114a=_0x34114a||0x1f4;return function(_0x16087d){logger[_0x33ac('0x26')](_0x16087d[_0x33ac('0x27')]);if(_0x16087d[_0x33ac('0x28')]){delete _0x16087d['name'];}_0x5d4c0a[_0x33ac('0x18')](_0x34114a)[_0x33ac('0x29')](_0x16087d);};}exports[_0x33ac('0x2a')]=function(_0x204684,_0x1fe80d){var _0x179649={},_0xd45e6b={},_0x552a1d={'count':0x0,'rows':[]};var _0x42e971=db[_0x33ac('0x2b')][_0x33ac('0x2c')];_0xd45e6b[_0x33ac('0x2d')]=_[_0x33ac('0x2e')](_0x42e971);_0xd45e6b[_0x33ac('0x2f')]=_['keys'](_0x204684[_0x33ac('0x2f')]);_0xd45e6b['filters']=_[_0x33ac('0x30')](_0xd45e6b['model'],_0xd45e6b[_0x33ac('0x2f')]);_0x179649[_0x33ac('0x31')]=_['intersection'](_0xd45e6b['model'],qs[_0x33ac('0x32')](_0x204684[_0x33ac('0x2f')]['fields']));_0x179649[_0x33ac('0x31')]=_0x179649[_0x33ac('0x31')][_0x33ac('0x33')]?_0x179649[_0x33ac('0x31')]:_0xd45e6b['model'];if(!_0x204684[_0x33ac('0x2f')]['hasOwnProperty'](_0x33ac('0x34'))){_0x179649[_0x33ac('0x1b')]=qs[_0x33ac('0x1b')](_0x204684[_0x33ac('0x2f')]['limit']);_0x179649[_0x33ac('0x35')]=qs['offset'](_0x204684[_0x33ac('0x2f')][_0x33ac('0x35')]);}_0x179649['order']=qs[_0x33ac('0x36')](_0x204684[_0x33ac('0x2f')][_0x33ac('0x36')]);_0x179649[_0x33ac('0x37')]=qs[_0x33ac('0x38')](_[_0x33ac('0x39')](_0x204684[_0x33ac('0x2f')],_0xd45e6b['filters']));if(_0x204684[_0x33ac('0x2f')][_0x33ac('0x3a')]){_0x179649[_0x33ac('0x37')]=_['merge'](_0x179649['where'],{'$or':_[_0x33ac('0x3b')](_0x42e971,function(_0x48e7aa){if(_0x48e7aa[_0x33ac('0x3c')][_0x33ac('0x3d')]!==_0x33ac('0x3e')){var _0x4acd99={};_0x4acd99[_0x48e7aa['field']]={'$like':'%'+_0x204684[_0x33ac('0x2f')][_0x33ac('0x3a')]+'%'};return _0x4acd99;}})});}_0x179649=_[_0x33ac('0x3f')]({},_0x179649,_0x204684[_0x33ac('0x40')]);var _0x5ac1e1={'where':_0x179649['where']};return db['AnalyticCustomReport'][_0x33ac('0x41')](_0x5ac1e1)['then'](function(_0x219385){_0x552a1d[_0x33ac('0x41')]=_0x219385;if(_0x204684['query'][_0x33ac('0x42')]){_0x179649[_0x33ac('0x43')]=[{'all':!![]}];}return db[_0x33ac('0x2b')][_0x33ac('0x44')](_0x179649);})[_0x33ac('0x21')](function(_0x50a335){_0x552a1d['rows']=_0x50a335;return _0x552a1d;})[_0x33ac('0x21')](respondWithFilteredResult(_0x1fe80d,_0x179649))[_0x33ac('0x45')](handleError(_0x1fe80d,null));};exports[_0x33ac('0x46')]=function(_0x3cb77e,_0x5daf56){var _0x5ab51b={'raw':![],'where':{'id':_0x3cb77e[_0x33ac('0x47')]['id']}},_0x5e7e79={};_0x5e7e79['model']=_[_0x33ac('0x2e')](db[_0x33ac('0x2b')][_0x33ac('0x2c')]);_0x5e7e79[_0x33ac('0x2f')]=_['keys'](_0x3cb77e[_0x33ac('0x2f')]);_0x5e7e79['filters']=_[_0x33ac('0x30')](_0x5e7e79[_0x33ac('0x2d')],_0x5e7e79[_0x33ac('0x2f')]);_0x5ab51b['attributes']=_[_0x33ac('0x30')](_0x5e7e79['model'],qs[_0x33ac('0x32')](_0x3cb77e[_0x33ac('0x2f')][_0x33ac('0x32')]));_0x5ab51b[_0x33ac('0x31')]=_0x5ab51b['attributes'][_0x33ac('0x33')]?_0x5ab51b[_0x33ac('0x31')]:_0x5e7e79[_0x33ac('0x2d')];if(_0x3cb77e['query'][_0x33ac('0x42')]){_0x5ab51b[_0x33ac('0x43')]=[{'all':!![]}];}_0x5ab51b=_[_0x33ac('0x3f')]({},_0x5ab51b,_0x3cb77e[_0x33ac('0x40')]);return db['AnalyticCustomReport'][_0x33ac('0x48')](_0x5ab51b)['then'](handleEntityNotFound(_0x5daf56,null))[_0x33ac('0x21')](respondWithResult(_0x5daf56,null))[_0x33ac('0x45')](handleError(_0x5daf56,null));};exports[_0x33ac('0x49')]=function(_0x2a3608,_0x1ca2f7){return db['AnalyticCustomReport'][_0x33ac('0x49')](_0x2a3608[_0x33ac('0x4a')],{})[_0x33ac('0x21')](function(_0x555130){var _0x526da1=_0x2a3608[_0x33ac('0x4b')][_0x33ac('0x23')]({'plain':!![]});if(!_0x526da1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x526da1[_0x33ac('0x4c')]===_0x33ac('0x4b')){var _0xc0b6a2=_0x555130[_0x33ac('0x23')]({'plain':!![]});var _0x278fa0='Reports';return db[_0x33ac('0x4d')][_0x33ac('0x48')]({'where':{'name':_0x278fa0,'userProfileId':_0x526da1[_0x33ac('0x4e')]},'raw':!![]})[_0x33ac('0x21')](function(_0x4879b3){if(_0x4879b3&&_0x4879b3[_0x33ac('0x4f')]===0x0){return db[_0x33ac('0x25')]['create']({'name':_0xc0b6a2[_0x33ac('0x28')],'resourceId':_0xc0b6a2['id'],'type':'CustomReports','sectionId':_0x4879b3['id']},{})[_0x33ac('0x21')](function(){return _0x555130;});}else{return _0x555130;}})['catch'](function(_0x39b615){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39b615);throw _0x39b615;});}return _0x555130;})['then'](respondWithResult(_0x1ca2f7,0xc9))[_0x33ac('0x45')](handleError(_0x1ca2f7,null));};exports[_0x33ac('0x20')]=function(_0x106f09,_0x5600f8){if(_0x106f09['body']['id']){delete _0x106f09['body']['id'];}return db[_0x33ac('0x2b')][_0x33ac('0x48')]({'where':{'id':_0x106f09[_0x33ac('0x47')]['id']}})['then'](handleEntityNotFound(_0x5600f8,null))['then'](saveUpdates(_0x106f09[_0x33ac('0x4a')],null))[_0x33ac('0x21')](respondWithResult(_0x5600f8,null))[_0x33ac('0x45')](handleError(_0x5600f8,null));};exports[_0x33ac('0x22')]=function(_0x5f5c6c,_0x25d6dd){return db[_0x33ac('0x2b')][_0x33ac('0x48')]({'where':{'id':_0x5f5c6c[_0x33ac('0x47')]['id']}})[_0x33ac('0x21')](handleEntityNotFound(_0x25d6dd,null))['then'](removeEntity(_0x25d6dd,null))['catch'](handleError(_0x25d6dd,null));};exports[_0x33ac('0x50')]=function(_0x736f58,_0x1afbb9){var _0x1bf78d=0xa;var _0x51a95e=[_0x33ac('0x51'),_0x33ac('0x52'),_0x33ac('0x53'),_0x33ac('0x54')];var _0x262472={'SUM':_0x33ac('0x55'),'COUNT':_0x33ac('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x33ac('0x57'),'MIN':_0x33ac('0x58'),'AVG':_0x33ac('0x59'),'GROUP_CONCAT':_0x33ac('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x33ac('0x5b')};var _0x2d6928={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x33ac('0x5c'),'HOUR':_0x33ac('0x5d'),'ROUND':_0x33ac('0x5e'),'UNIX_TIMESTAMP':_0x33ac('0x5f')};var _0x5ea879=function(_0x3a6dff){return!_[_0x33ac('0x60')]([_0x33ac('0x61'),_0x33ac('0x62'),_0x33ac('0x63'),_0x33ac('0x64')],_0x3a6dff);};var _0x4071a4=function(_0x102340){if(!_0x102340||!_0x102340['rules'][_0x33ac('0x33')]){return'';}for(var _0x127754='(',_0x34b9df=0x0;_0x34b9df<_0x102340[_0x33ac('0x65')][_0x33ac('0x33')];_0x34b9df+=0x1){_0x34b9df>0x0&&(_0x127754+='\x20'+_0x102340[_0x33ac('0x66')]+'\x20');_0x127754+=_0x102340['rules'][_0x34b9df][_0x33ac('0x67')]?_0x4071a4(_0x102340['rules'][_0x34b9df][_0x33ac('0x67')]):_0x102340[_0x33ac('0x65')][_0x34b9df]['field']+'\x20'+_0x102340[_0x33ac('0x65')][_0x34b9df][_0x33ac('0x68')]+(_0x5ea879(_0x102340[_0x33ac('0x65')][_0x34b9df][_0x33ac('0x68')])?'\x20'+_0x102340['rules'][_0x34b9df][_0x33ac('0x69')]:'');}return _0x127754+')';};var _0x1c98ec={'where':{'id':_0x736f58[_0x33ac('0x47')]['id']}},_0x545458,_0x15275d,_0x37fded,_0x4ff9ef,_0xfdc06c;_0x1c98ec=_[_0x33ac('0x3f')]({},_0x1c98ec,_0x736f58[_0x33ac('0x40')]);return db[_0x33ac('0x2b')]['find'](_0x1c98ec)[_0x33ac('0x21')](function(_0x46bcb9){if(_0x46bcb9){_0x545458=_0x46bcb9;return _0x46bcb9[_0x33ac('0x6a')]();}return null;})[_0x33ac('0x21')](function(_0x139a47){if(_0x139a47){if(!_0x139a47[_0x33ac('0x33')]){throw new db[(_0x33ac('0x6b'))][(_0x33ac('0x6c'))](_0x33ac('0x6d'),0x193);}_0x15275d=_0x139a47;return db[_0x33ac('0x6e')][_0x33ac('0x44')]({'raw':!![]});}return null;})[_0x33ac('0x21')](function(_0x1e162c){if(_0x1e162c){_0x37fded=_[_0x33ac('0x6f')](_0x1e162c,'id');var _0x3744cb;var _0x3c2b29=squel['select']();_0x3c2b29[_0x33ac('0x70')](_0x545458['table']);for(var _0x338bfd=0x0;_0x338bfd<_0x15275d[_0x33ac('0x33')];_0x338bfd+=0x1){_0x3744cb=_0x15275d[_0x338bfd]['MetricId']?_0x37fded[_0x15275d[_0x338bfd][_0x33ac('0x71')]][_0x33ac('0x72')]:_0x15275d[_0x338bfd][_0x33ac('0x73')];_0x3744cb=_0x15275d[_0x338bfd][_0x33ac('0x74')]?_[_0x33ac('0x75')](_0x262472[_0x15275d[_0x338bfd][_0x33ac('0x74')]],'%s',_0x3744cb):_0x3744cb;_0x3744cb=_0x15275d[_0x338bfd][_0x33ac('0x76')]?_['replace'](_0x2d6928[_0x15275d[_0x338bfd][_0x33ac('0x76')]],'%s',_0x3744cb):_0x3744cb;if(_0x15275d[_0x338bfd]['groupBy']){_0x3c2b29[_0x33ac('0x67')](_0x3744cb);}_0x15275d[_0x338bfd][_0x33ac('0x77')]&&_0x3c2b29[_0x33ac('0x78')](_0x3744cb,_0x15275d[_0x338bfd][_0x33ac('0x77')]===_0x33ac('0x79')?![]:!![]);_0x3c2b29[_0x33ac('0x73')](_0x3744cb,_0x15275d[_0x338bfd]['alias']||_0x3744cb);}if(_0x545458['joins']){_0x545458[_0x33ac('0x7a')]=JSON[_0x33ac('0x7b')](_0x545458[_0x33ac('0x7a')]);for(var _0x3c78e9=0x0;_0x3c78e9<_0x545458[_0x33ac('0x7a')]['length'];_0x3c78e9+=0x1){if(_0x545458[_0x33ac('0x7a')][_0x3c78e9][_0x33ac('0x3c')]&&_[_0x33ac('0x60')](_0x51a95e,_0x545458[_0x33ac('0x7a')][_0x3c78e9][_0x33ac('0x3c')])&&_0x545458[_0x33ac('0x7a')][_0x3c78e9][_0x33ac('0x7c')]&&_0x545458[_0x33ac('0x7a')][_0x3c78e9][_0x33ac('0x7d')]&&_0x545458['joins'][_0x3c78e9][_0x33ac('0x7e')]){_0x3c2b29[_0x545458[_0x33ac('0x7a')][_0x3c78e9][_0x33ac('0x3c')]](_0x545458[_0x33ac('0x7a')][_0x3c78e9][_0x33ac('0x7d')],null,util[_0x33ac('0x76')](_0x33ac('0x7f'),_0x545458[_0x33ac('0x80')],_0x545458['joins'][_0x3c78e9]['parentKey'],_0x545458[_0x33ac('0x7a')][_0x3c78e9][_0x33ac('0x7d')],_0x545458['joins'][_0x3c78e9][_0x33ac('0x7e')]));}}}if(_0x545458[_0x33ac('0x81')]){_0x545458['conditions']=JSON[_0x33ac('0x7b')](_0x545458[_0x33ac('0x81')]);_0x3c2b29['where'](_0x4071a4(_0x545458[_0x33ac('0x81')][_0x33ac('0x67')]));}_0xfdc06c=_0x3c2b29[_0x33ac('0x82')]();_0x3c2b29['limit'](_0x1bf78d);_0x3c2b29[_0x33ac('0x35')](0x0);logger[_0x33ac('0x83')](_0x33ac('0x84'),_0x3c2b29[_0x33ac('0x85')]());return db['sequelize'][_0x33ac('0x2f')](_0x3c2b29[_0x33ac('0x85')](),{'type':db['sequelize'][_0x33ac('0x86')][_0x33ac('0x87')]});}})[_0x33ac('0x21')](respondWithResult(_0x1afbb9,null))[_0x33ac('0x45')](handleError(_0x1afbb9,null));};function runReport(_0x2a54a1,_0x5ce865,_0x57afeb){var _0x465a99=_0x5ce865[_0x33ac('0x28')];var _0x28a774=0xa;var _0x535395=[_0x33ac('0x51'),'left_join',_0x33ac('0x53'),_0x33ac('0x54')];var _0xa049b6={'SUM':_0x33ac('0x55'),'COUNT':_0x33ac('0x56'),'COUNT DISTINCT':_0x33ac('0x88'),'MAX':_0x33ac('0x57'),'MIN':_0x33ac('0x58'),'AVG':_0x33ac('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x33ac('0x5b')};var _0xd39841={'SEC_TO_TIME':_0x33ac('0x89'),'DATE':_0x33ac('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x33ac('0x5e'),'UNIX_TIMESTAMP':_0x33ac('0x5f')};var _0xefe023=function(_0x34bd84){return!_[_0x33ac('0x60')](['IS\x20NULL',_0x33ac('0x62'),'IS\x20EMPTY',_0x33ac('0x64')],_0x34bd84);};var _0x4f8008=function(_0x5b8556){if(!_0x5b8556||!_0x5b8556[_0x33ac('0x65')][_0x33ac('0x33')]){return'';}for(var _0x448d4f='(',_0x187ac1=0x0;_0x187ac1<_0x5b8556[_0x33ac('0x65')]['length'];_0x187ac1+=0x1){_0x187ac1>0x0&&(_0x448d4f+='\x20'+_0x5b8556[_0x33ac('0x66')]+'\x20');_0x448d4f+=_0x5b8556[_0x33ac('0x65')][_0x187ac1]['group']?_0x4f8008(_0x5b8556[_0x33ac('0x65')][_0x187ac1][_0x33ac('0x67')]):_0x5b8556[_0x33ac('0x65')][_0x187ac1]['field']+'\x20'+_0x5b8556[_0x33ac('0x65')][_0x187ac1][_0x33ac('0x68')]+(_0xefe023(_0x5b8556[_0x33ac('0x65')][_0x187ac1][_0x33ac('0x68')])?'\x20'+_0x5b8556[_0x33ac('0x65')][_0x187ac1][_0x33ac('0x69')]:'');}return _0x448d4f+')';};var _0x1508f0={'where':{'id':_0x2a54a1['id']}},_0x5d31df,_0x57a425,_0x332c3c,_0x46fd50,_0x3c176a;_0x1508f0=_[_0x33ac('0x3f')]({},_0x1508f0,_0x57afeb);return db[_0x33ac('0x2b')][_0x33ac('0x48')](_0x1508f0)[_0x33ac('0x21')](function(_0x3fd446){if(_0x3fd446){_0x5d31df=_0x3fd446;return _0x3fd446[_0x33ac('0x6a')]();}return null;})[_0x33ac('0x21')](function(_0x445fb4){if(_0x445fb4){if(!_0x445fb4[_0x33ac('0x33')]){throw new db[(_0x33ac('0x6b'))]['ValidationErrorItem'](_0x33ac('0x6d'),0x193);}_0x57a425=_0x445fb4;return db[_0x33ac('0x6e')][_0x33ac('0x44')]({'raw':!![]});}return null;})[_0x33ac('0x21')](function(_0x1f4f16){if(_0x1f4f16){_0x332c3c=_['keyBy'](_0x1f4f16,'id');var _0x52a4ff;var _0x5612b1=squel[_0x33ac('0x8a')]();_0x5612b1[_0x33ac('0x70')](_0x5d31df[_0x33ac('0x80')]);for(var _0x4fdf86=0x0;_0x4fdf86<_0x57a425['length'];_0x4fdf86+=0x1){_0x52a4ff=_0x57a425[_0x4fdf86][_0x33ac('0x71')]?_0x332c3c[_0x57a425[_0x4fdf86][_0x33ac('0x71')]][_0x33ac('0x72')]:_0x57a425[_0x4fdf86][_0x33ac('0x73')];_0x52a4ff=_0x57a425[_0x4fdf86]['function']?_[_0x33ac('0x75')](_0xa049b6[_0x57a425[_0x4fdf86][_0x33ac('0x74')]],'%s',_0x52a4ff):_0x52a4ff;_0x52a4ff=_0x57a425[_0x4fdf86][_0x33ac('0x76')]?_[_0x33ac('0x75')](_0xd39841[_0x57a425[_0x4fdf86][_0x33ac('0x76')]],'%s',_0x52a4ff):_0x52a4ff;if(_0x57a425[_0x4fdf86]['groupBy']){_0x5612b1[_0x33ac('0x67')](_0x52a4ff);}_0x57a425[_0x4fdf86][_0x33ac('0x77')]&&_0x5612b1[_0x33ac('0x78')](_0x52a4ff,_0x57a425[_0x4fdf86][_0x33ac('0x77')]===_0x33ac('0x79')?![]:!![]);_0x5612b1['field'](_0x52a4ff,_0x57a425[_0x4fdf86][_0x33ac('0x8b')]||_0x52a4ff);}if(_0x5d31df[_0x33ac('0x7a')]){_0x5d31df[_0x33ac('0x7a')]=JSON[_0x33ac('0x7b')](_0x5d31df[_0x33ac('0x7a')]);for(var _0x436166=0x0;_0x436166<_0x5d31df['joins'][_0x33ac('0x33')];_0x436166+=0x1){if(_0x5d31df[_0x33ac('0x7a')][_0x436166]['type']&&_[_0x33ac('0x60')](_0x535395,_0x5d31df[_0x33ac('0x7a')][_0x436166][_0x33ac('0x3c')])&&_0x5d31df[_0x33ac('0x7a')][_0x436166][_0x33ac('0x7c')]&&_0x5d31df[_0x33ac('0x7a')][_0x436166][_0x33ac('0x7d')]&&_0x5d31df[_0x33ac('0x7a')][_0x436166][_0x33ac('0x7e')]){_0x5612b1[_0x5d31df[_0x33ac('0x7a')][_0x436166][_0x33ac('0x3c')]](_0x5d31df[_0x33ac('0x7a')][_0x436166][_0x33ac('0x7d')],null,util[_0x33ac('0x76')](_0x33ac('0x7f'),_0x5d31df[_0x33ac('0x80')],_0x5d31df[_0x33ac('0x7a')][_0x436166][_0x33ac('0x7c')],_0x5d31df['joins'][_0x436166][_0x33ac('0x7d')],_0x5d31df[_0x33ac('0x7a')][_0x436166][_0x33ac('0x7e')]));}}}if(_0x5d31df['conditions']){_0x5d31df['conditions']=JSON[_0x33ac('0x7b')](_0x5d31df[_0x33ac('0x81')]);_0x5612b1[_0x33ac('0x37')](_0x4f8008(_0x5d31df[_0x33ac('0x81')][_0x33ac('0x67')]));}_0x3c176a=_0x5612b1['clone']();_0x5612b1[_0x33ac('0x1b')](_0x28a774);_0x5612b1[_0x33ac('0x35')](0x0);logger['debug'](_0x33ac('0x84'),_0x5612b1[_0x33ac('0x85')]());return db[_0x33ac('0x8c')][_0x33ac('0x2f')](_0x5612b1[_0x33ac('0x85')](),{'type':db[_0x33ac('0x8c')][_0x33ac('0x86')][_0x33ac('0x87')]});}})[_0x33ac('0x21')](function(_0x5885b0){if(!_0x5885b0['length']){throw new db[(_0x33ac('0x6b'))][(_0x33ac('0x6c'))](_0x33ac('0x8d'),0xcc);}if(_0x5ce865[_0x33ac('0x8e')]===_0x33ac('0x8f')){return null;}var _0x4981e3=_[_0x33ac('0x3f')](_0x5ce865,{'name':_0x5ce865[_0x33ac('0x90')]||_0x5ce865[_0x33ac('0x28')]||_0x5d31df[_0x33ac('0x28')],'basename':_0x465a99,'savename':util[_0x33ac('0x76')](_0x33ac('0x91'),_0x5ce865['name']||_0x5d31df['name'],require(_0x33ac('0x92'))[_0x33ac('0x93')](0x4),_0x5ce865['output']||_0x33ac('0x94')),'reportId':_0x5d31df['id'],'reportType':_0x33ac('0x95')});return db[_0x33ac('0x96')][_0x33ac('0x49')](_0x4981e3,{'raw':!![]});})['then'](function(_0x2cbb0b){if(_0x5d31df[_0x33ac('0x80')]===_0x33ac('0x97')){_0x3c176a[_0x33ac('0x37')](_0x5d31df[_0x33ac('0x80')]+_0x33ac('0x98'),_0x5ce865['startDate'],_0x5ce865[_0x33ac('0x99')]);}else{_0x3c176a['where'](_0x5d31df[_0x33ac('0x80')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5ce865[_0x33ac('0x9a')],_0x5ce865[_0x33ac('0x99')]);}if(_0x2cbb0b){logger[_0x33ac('0x9b')](_0x33ac('0x9c'),_0x3c176a[_0x33ac('0x85')]());require(_0x33ac('0x9d'))[_0x33ac('0x9e')](path[_0x33ac('0x51')](__dirname,_0x33ac('0x9f'),_0x2cbb0b['output']),[_0x2cbb0b['id'],_0x3c176a[_0x33ac('0x85')](),path[_0x33ac('0x51')](__dirname,_0x33ac('0xa0'),_0x2cbb0b['savename']),_0x465a99]);return _0x2cbb0b;}else{var _0x370c95=squel[_0x33ac('0x8a')]();_0x370c95[_0x33ac('0x70')]('('+_0x3c176a[_0x33ac('0x85')]()+')',_0x33ac('0xa1'));_0x370c95['field'](_0x33ac('0xa2'),'count');_0x3c176a[_0x33ac('0x1b')](_0x5ce865[_0x33ac('0x1b')]||_0x28a774);_0x3c176a[_0x33ac('0x35')](_0x5ce865[_0x33ac('0x35')]||0x0);return db[_0x33ac('0x8c')]['query'](_0x370c95['toString'](),{'type':db[_0x33ac('0x8c')][_0x33ac('0x86')][_0x33ac('0x87')]})[_0x33ac('0x21')](function(_0x311218){if(!_0x311218[_0x33ac('0x33')]){_0x46fd50=0x0;}else{_0x46fd50=_0x311218[0x0][_0x33ac('0x41')]||0x0;}return db[_0x33ac('0x8c')][_0x33ac('0x2f')](_0x3c176a[_0x33ac('0x85')](),{'type':db[_0x33ac('0x8c')][_0x33ac('0x86')]['SELECT']});})[_0x33ac('0x21')](function(_0xcaa7d0){return{'rows':_0xcaa7d0||[],'count':_0x46fd50};});}});}exports['run']=function(_0x38f551,_0x4eb786){return runReport(_0x38f551[_0x33ac('0x47')],_0x38f551[_0x33ac('0x2f')],_0x38f551[_0x33ac('0x40')])[_0x33ac('0x21')](respondWithResult(_0x4eb786,null))[_0x33ac('0x45')](handleError(_0x4eb786,null));};exports[_0x33ac('0xa3')]=runReport;exports[_0x33ac('0x2f')]=function(_0x31a8fc,_0x40dac6){var _0x4cb8c9=0xa;var _0xffcb05=['join',_0x33ac('0x52'),_0x33ac('0x53'),_0x33ac('0x54')];var _0x916094={'SUM':_0x33ac('0x55'),'COUNT':_0x33ac('0x56'),'COUNT DISTINCT':_0x33ac('0x88'),'MAX':_0x33ac('0x57'),'MIN':'MIN(%s)','AVG':_0x33ac('0x59'),'GROUP_CONCAT':_0x33ac('0x5a'),'GROUP_CONCAT ASC':_0x33ac('0xa4'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xa5a6af={'SEC_TO_TIME':_0x33ac('0x89'),'DATE':'DATE(%s)','HOUR':_0x33ac('0x5d'),'ROUND':_0x33ac('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x49ef37=function(_0x27fe00){return!_[_0x33ac('0x60')]([_0x33ac('0x61'),_0x33ac('0x62'),'IS\x20EMPTY',_0x33ac('0x64')],_0x27fe00);};var _0x4ff85a=function(_0x34d783){if(!_0x34d783||!_0x34d783['rules'][_0x33ac('0x33')]){return'';}for(var _0x1d960a='(',_0x25ad71=0x0;_0x25ad71<_0x34d783[_0x33ac('0x65')][_0x33ac('0x33')];_0x25ad71+=0x1){_0x25ad71>0x0&&(_0x1d960a+='\x20'+_0x34d783[_0x33ac('0x66')]+'\x20');_0x1d960a+=_0x34d783['rules'][_0x25ad71]['group']?_0x4ff85a(_0x34d783[_0x33ac('0x65')][_0x25ad71]['group']):_0x34d783[_0x33ac('0x65')][_0x25ad71][_0x33ac('0x73')]+'\x20'+_0x34d783[_0x33ac('0x65')][_0x25ad71][_0x33ac('0x68')]+(_0x49ef37(_0x34d783['rules'][_0x25ad71][_0x33ac('0x68')])?'\x20'+_0x34d783[_0x33ac('0x65')][_0x25ad71]['value']:'');}return _0x1d960a+')';};var _0x5ab4a0={'where':{'id':_0x31a8fc[_0x33ac('0x47')]['id']}},_0x54d59b,_0x455280,_0x256a6e,_0x1ea9c0,_0x2cb49e;_0x5ab4a0=_['merge']({},_0x5ab4a0,_0x31a8fc[_0x33ac('0x40')]);return db['AnalyticCustomReport'][_0x33ac('0x48')](_0x5ab4a0)[_0x33ac('0x21')](function(_0x43c61c){if(_0x43c61c){_0x54d59b=_0x43c61c;return _0x43c61c[_0x33ac('0x6a')]();}return null;})[_0x33ac('0x21')](function(_0xd6903d){if(_0xd6903d){if(!_0xd6903d['length']){throw new db['Sequelize'][(_0x33ac('0x6c'))](_0x33ac('0x6d'),0x193);}_0x455280=_0xd6903d;return db[_0x33ac('0x6e')][_0x33ac('0x44')]({'raw':!![]});}return null;})[_0x33ac('0x21')](function(_0x22eda1){if(_0x22eda1){_0x256a6e=_[_0x33ac('0x6f')](_0x22eda1,'id');var _0x2169d6;var _0x4251dd=squel[_0x33ac('0x8a')]();_0x4251dd[_0x33ac('0x70')](_0x54d59b['table']);for(var _0x5b7217=0x0;_0x5b7217<_0x455280[_0x33ac('0x33')];_0x5b7217+=0x1){_0x2169d6=_0x455280[_0x5b7217][_0x33ac('0x71')]?_0x256a6e[_0x455280[_0x5b7217][_0x33ac('0x71')]]['metric']:_0x455280[_0x5b7217][_0x33ac('0x73')];_0x2169d6=_0x455280[_0x5b7217][_0x33ac('0x74')]?_[_0x33ac('0x75')](_0x916094[_0x455280[_0x5b7217][_0x33ac('0x74')]],'%s',_0x2169d6):_0x2169d6;_0x2169d6=_0x455280[_0x5b7217][_0x33ac('0x76')]?_[_0x33ac('0x75')](_0xa5a6af[_0x455280[_0x5b7217][_0x33ac('0x76')]],'%s',_0x2169d6):_0x2169d6;if(_0x455280[_0x5b7217][_0x33ac('0xa5')]){_0x4251dd['group'](_0x2169d6);}_0x455280[_0x5b7217][_0x33ac('0x77')]&&_0x4251dd['order'](_0x2169d6,_0x455280[_0x5b7217]['orderBy']===_0x33ac('0x79')?![]:!![]);_0x4251dd[_0x33ac('0x73')](_0x2169d6,_0x455280[_0x5b7217][_0x33ac('0x8b')]||_0x2169d6);}if(_0x54d59b['joins']){_0x54d59b[_0x33ac('0x7a')]=JSON[_0x33ac('0x7b')](_0x54d59b['joins']);for(var _0x3d3edc=0x0;_0x3d3edc<_0x54d59b[_0x33ac('0x7a')][_0x33ac('0x33')];_0x3d3edc+=0x1){if(_0x54d59b[_0x33ac('0x7a')][_0x3d3edc][_0x33ac('0x3c')]&&_['includes'](_0xffcb05,_0x54d59b[_0x33ac('0x7a')][_0x3d3edc][_0x33ac('0x3c')])&&_0x54d59b[_0x33ac('0x7a')][_0x3d3edc]['parentKey']&&_0x54d59b[_0x33ac('0x7a')][_0x3d3edc][_0x33ac('0x7d')]&&_0x54d59b[_0x33ac('0x7a')][_0x3d3edc][_0x33ac('0x7e')]){_0x4251dd[_0x54d59b[_0x33ac('0x7a')][_0x3d3edc][_0x33ac('0x3c')]](_0x54d59b[_0x33ac('0x7a')][_0x3d3edc]['foreignTable'],null,util[_0x33ac('0x76')](_0x33ac('0x7f'),_0x54d59b['table'],_0x54d59b[_0x33ac('0x7a')][_0x3d3edc][_0x33ac('0x7c')],_0x54d59b[_0x33ac('0x7a')][_0x3d3edc][_0x33ac('0x7d')],_0x54d59b['joins'][_0x3d3edc][_0x33ac('0x7e')]));}}}if(_0x54d59b['conditions']){_0x54d59b[_0x33ac('0x81')]=JSON[_0x33ac('0x7b')](_0x54d59b[_0x33ac('0x81')]);_0x4251dd[_0x33ac('0x37')](_0x4ff85a(_0x54d59b[_0x33ac('0x81')][_0x33ac('0x67')]));}_0x2cb49e=_0x4251dd[_0x33ac('0x82')]();_0x4251dd[_0x33ac('0x1b')](_0x4cb8c9);_0x4251dd[_0x33ac('0x35')](0x0);logger[_0x33ac('0x83')]('Limited\x20Query:',_0x4251dd[_0x33ac('0x85')]());return db[_0x33ac('0x8c')]['query'](_0x4251dd['toString'](),{'type':db[_0x33ac('0x8c')][_0x33ac('0x86')][_0x33ac('0x87')]});}})['then'](function(){return{'sql':_0x2cb49e[_0x33ac('0x85')]()};})[_0x33ac('0x21')](respondWithResult(_0x40dac6,null))[_0x33ac('0x45')](handleError(_0x40dac6,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 5cbed44..078840e 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.model.js +++ b/server/api/analyticCustomReport/analyticCustomReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f36=['bluebird','request-promise','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api'];(function(_0xa938a9,_0x304f89){var _0x4fc663=function(_0x418095){while(--_0x418095){_0xa938a9['push'](_0xa938a9['shift']());}};_0x4fc663(++_0x304f89);}(_0x0f36,0xed));var _0x60f3=function(_0x1b2781,_0x50b74d){_0x1b2781=_0x1b2781-0x0;var _0x226750=_0x0f36[_0x1b2781];return _0x226750;};'use strict';var _=require(_0x60f3('0x0'));var util=require(_0x60f3('0x1'));var logger=require('../../config/logger')(_0x60f3('0x2'));var moment=require('moment');var BPromise=require(_0x60f3('0x3'));var rp=require(_0x60f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x60f3('0x5'));module[_0x60f3('0x6')]=function(_0x49b4af,_0x424ae1){return _0x49b4af[_0x60f3('0x7')](_0x60f3('0x8'),attributes,{'tableName':_0x60f3('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b2a=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','bluebird'];(function(_0xfb0281,_0x3ff38b){var _0x408dd3=function(_0x5d8017){while(--_0x5d8017){_0xfb0281['push'](_0xfb0281['shift']());}};_0x408dd3(++_0x3ff38b);}(_0x0b2a,0x88));var _0xa0b2=function(_0x3bc75d,_0x4ed6dc){_0x3bc75d=_0x3bc75d-0x0;var _0x3d86f2=_0x0b2a[_0x3bc75d];return _0x3d86f2;};'use strict';var _=require(_0xa0b2('0x0'));var util=require('util');var logger=require(_0xa0b2('0x1'))('api');var moment=require(_0xa0b2('0x2'));var BPromise=require(_0xa0b2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0b2('0x4'));var rimraf=require(_0xa0b2('0x5'));var config=require(_0xa0b2('0x6'));var attributes=require(_0xa0b2('0x7'));module['exports']=function(_0x139e15,_0x2a87fe){return _0x139e15['define'](_0xa0b2('0x8'),attributes,{'tableName':_0xa0b2('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 3944aff..d530b88 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js +++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1c5=['AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0xc03282,_0x11f013){var _0x5ca2c0=function(_0x282a6d){while(--_0x282a6d){_0xc03282['push'](_0xc03282['shift']());}};_0x5ca2c0(++_0x11f013);}(_0xc1c5,0x1d7));var _0x5c1c=function(_0x57a789,_0x1e8329){_0x57a789=_0x57a789-0x0;var _0x29ed3f=_0xc1c5[_0x57a789];return _0x29ed3f;};'use strict';var _=require('lodash');var util=require(_0x5c1c('0x0'));var moment=require(_0x5c1c('0x1'));var BPromise=require(_0x5c1c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c1c('0x3'));var db=require(_0x5c1c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c1c('0x5'))(_0x5c1c('0x6'));var config=require(_0x5c1c('0x7'));var jayson=require(_0x5c1c('0x8'));var client=jayson['client'][_0x5c1c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x623b1a,_0x4ee2db,_0x3fa4e3){return new BPromise(function(_0x5f2586,_0x5e3983){return client['request'](_0x623b1a,_0x3fa4e3)[_0x5c1c('0xa')](function(_0x5685f5){logger[_0x5c1c('0xb')](_0x5c1c('0xc'),_0x4ee2db,'request\x20sent');logger[_0x5c1c('0xd')](_0x5c1c('0xe'),_0x4ee2db,_0x5c1c('0xf'),JSON[_0x5c1c('0x10')](_0x5685f5));if(_0x5685f5[_0x5c1c('0x11')]){if(_0x5685f5['error'][_0x5c1c('0x12')]===0x1f4){logger[_0x5c1c('0x11')](_0x5c1c('0xc'),_0x4ee2db,_0x5685f5[_0x5c1c('0x11')][_0x5c1c('0x13')]);return _0x5e3983(_0x5685f5[_0x5c1c('0x11')][_0x5c1c('0x13')]);}logger[_0x5c1c('0x11')](_0x5c1c('0xc'),_0x4ee2db,_0x5685f5['error'][_0x5c1c('0x13')]);return _0x5f2586(_0x5685f5[_0x5c1c('0x11')]['message']);}else{logger[_0x5c1c('0xb')](_0x5c1c('0xc'),_0x4ee2db,_0x5c1c('0xf'));_0x5f2586(_0x5685f5['result'][_0x5c1c('0x13')]);}})[_0x5c1c('0x14')](function(_0x2e5d50){logger[_0x5c1c('0x11')](_0x5c1c('0xc'),_0x4ee2db,_0x2e5d50);_0x5e3983(_0x2e5d50);});});} \ No newline at end of file +var _0x807b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x117ee0,_0x186bc5){var _0x24188a=function(_0x19ba56){while(--_0x19ba56){_0x117ee0['push'](_0x117ee0['shift']());}};_0x24188a(++_0x186bc5);}(_0x807b,0x6d));var _0xb807=function(_0x55c23c,_0x3458ac){_0x55c23c=_0x55c23c-0x0;var _0x6e1b34=_0x807b[_0x55c23c];return _0x6e1b34;};'use strict';var _=require(_0xb807('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb807('0x1'));var fs=require('fs');var Redis=require(_0xb807('0x2'));var db=require(_0xb807('0x3'))['db'];var utils=require(_0xb807('0x4'));var logger=require(_0xb807('0x5'))(_0xb807('0x6'));var config=require(_0xb807('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb807('0x8')][_0xb807('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b65e1,_0x3d1ba7,_0x411bad){return new BPromise(function(_0x3dfd77,_0x172a92){return client[_0xb807('0xa')](_0x3b65e1,_0x411bad)[_0xb807('0xb')](function(_0x6fc022){logger[_0xb807('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3d1ba7,_0xb807('0xd'));logger[_0xb807('0xe')](_0xb807('0xf'),_0x3d1ba7,_0xb807('0xd'),JSON['stringify'](_0x6fc022));if(_0x6fc022[_0xb807('0x10')]){if(_0x6fc022[_0xb807('0x10')][_0xb807('0x11')]===0x1f4){logger[_0xb807('0x10')](_0xb807('0x12'),_0x3d1ba7,_0x6fc022[_0xb807('0x10')][_0xb807('0x13')]);return _0x172a92(_0x6fc022[_0xb807('0x10')][_0xb807('0x13')]);}logger[_0xb807('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3d1ba7,_0x6fc022[_0xb807('0x10')]['message']);return _0x3dfd77(_0x6fc022[_0xb807('0x10')][_0xb807('0x13')]);}else{logger['info'](_0xb807('0x12'),_0x3d1ba7,'request\x20sent');_0x3dfd77(_0x6fc022[_0xb807('0x14')][_0xb807('0x13')]);}})[_0xb807('0x15')](function(_0x26a335){logger[_0xb807('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3d1ba7,_0x26a335);_0x172a92(_0x26a335);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index af4a832..8f8e8bf 100644 --- a/server/api/analyticCustomReport/index.js +++ b/server/api/analyticCustomReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21ce=['/:id/run','run','/:id/query','post','create','update','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','preview'];(function(_0xa04d82,_0x4195ff){var _0x2441c4=function(_0x51a01e){while(--_0x51a01e){_0xa04d82['push'](_0xa04d82['shift']());}};_0x2441c4(++_0x4195ff);}(_0x21ce,0x1aa));var _0xe21c=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x21ce[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0xe21c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe21c('0x1'));var express=require(_0xe21c('0x2'));var router=express[_0xe21c('0x3')]();var auth=require(_0xe21c('0x4'));var interaction=require(_0xe21c('0x5'));var config=require(_0xe21c('0x6'));var controller=require(_0xe21c('0x7'));router[_0xe21c('0x8')]('/',auth[_0xe21c('0x9')](),controller[_0xe21c('0xa')]);router[_0xe21c('0x8')](_0xe21c('0xb'),auth['isAuthenticated'](),controller[_0xe21c('0xc')]);router[_0xe21c('0x8')]('/:id/preview',auth[_0xe21c('0x9')](),controller[_0xe21c('0xd')]);router['get'](_0xe21c('0xe'),auth[_0xe21c('0x9')](),controller[_0xe21c('0xf')]);router[_0xe21c('0x8')](_0xe21c('0x10'),auth[_0xe21c('0x9')](),controller['query']);router[_0xe21c('0x11')]('/',auth[_0xe21c('0x9')](),controller[_0xe21c('0x12')]);router['put'](_0xe21c('0xb'),auth[_0xe21c('0x9')](),controller[_0xe21c('0x13')]);router['delete']('/:id',auth[_0xe21c('0x9')](),controller[_0xe21c('0x14')]);module[_0xe21c('0x15')]=router; \ No newline at end of file +var _0x5506=['destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/run','/:id/query','query','post','create','update'];(function(_0x175174,_0x504200){var _0x16b98e=function(_0x2c55d0){while(--_0x2c55d0){_0x175174['push'](_0x175174['shift']());}};_0x16b98e(++_0x504200);}(_0x5506,0xde));var _0x6550=function(_0x22f8d5,_0x2c6723){_0x22f8d5=_0x22f8d5-0x0;var _0x42d556=_0x5506[_0x22f8d5];return _0x42d556;};'use strict';var multer=require(_0x6550('0x0'));var util=require(_0x6550('0x1'));var path=require('path');var timeout=require(_0x6550('0x2'));var express=require(_0x6550('0x3'));var router=express['Router']();var auth=require(_0x6550('0x4'));var interaction=require(_0x6550('0x5'));var config=require(_0x6550('0x6'));var controller=require('./analyticCustomReport.controller');router[_0x6550('0x7')]('/',auth[_0x6550('0x8')](),controller[_0x6550('0x9')]);router[_0x6550('0x7')](_0x6550('0xa'),auth['isAuthenticated'](),controller[_0x6550('0xb')]);router[_0x6550('0x7')]('/:id/preview',auth[_0x6550('0x8')](),controller['preview']);router[_0x6550('0x7')](_0x6550('0xc'),auth[_0x6550('0x8')](),controller['run']);router['get'](_0x6550('0xd'),auth[_0x6550('0x8')](),controller[_0x6550('0xe')]);router[_0x6550('0xf')]('/',auth[_0x6550('0x8')](),controller[_0x6550('0x10')]);router['put'](_0x6550('0xa'),auth[_0x6550('0x8')](),controller[_0x6550('0x11')]);router['delete'](_0x6550('0xa'),auth['isAuthenticated'](),controller[_0x6550('0x12')]);module[_0x6550('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 064cf1d..226cce3 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x110e=['sequelize','exports','STRING','TEXT'];(function(_0x3a621a,_0x4323da){var _0xd5e40f=function(_0xf62285){while(--_0xf62285){_0x3a621a['push'](_0x3a621a['shift']());}};_0xd5e40f(++_0x4323da);}(_0x110e,0xa0));var _0xe110=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x110e[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require(_0xe110('0x0'));module[_0xe110('0x1')]={'name':{'type':Sequelize[_0xe110('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe110('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xe110('0x2')]},'conditions':{'type':Sequelize[_0xe110('0x3')]},'joins':{'type':Sequelize[_0xe110('0x3')]}}; \ No newline at end of file +var _0x981e=['exports','STRING','sequelize'];(function(_0x6bb1ac,_0x53d84d){var _0xc35c19=function(_0x1ddd2d){while(--_0x1ddd2d){_0x6bb1ac['push'](_0x6bb1ac['shift']());}};_0xc35c19(++_0x53d84d);}(_0x981e,0x18b));var _0xe981=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x981e[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xe981('0x0'));module[_0xe981('0x1')]={'name':{'type':Sequelize[_0xe981('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe981('0x2')]},'parent':{'type':Sequelize[_0xe981('0x2')]},'table':{'type':Sequelize[_0xe981('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index d931226..6a95c4c 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['field','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','order','orderBy','DESC','alias','joins','parse','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','condition','getFields','No\x20available\x20data','web','fullPath','%s-%s.%s','output','csv','AnalyticExtractedReport','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','run','runReport','AVG(%s)','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','then','get','DefaultReports','UserProfileResource','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','offset','where','pick','filter','merge','map','type','key'];(function(_0x5c26b2,_0x4ae298){var _0x6d759e=function(_0x14dad3){while(--_0x14dad3){_0x5c26b2['push'](_0x5c26b2['shift']());}};_0x6d759e(++_0x4ae298);}(_0x7a54,0x106));var _0x47a5=function(_0x2dda9b,_0x4a042d){_0x2dda9b=_0x2dda9b-0x0;var _0x2cc8e6=_0x7a54[_0x2dda9b];return _0x2cc8e6;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];function respondWithStatusCode(_0x250fad,_0xd612dd){_0xd612dd=_0xd612dd||0xcc;return function(_0xd308b8){if(_0xd308b8){return _0x250fad[_0x47a5('0x14')](_0xd612dd);}return _0x250fad['status'](_0xd612dd)[_0x47a5('0x15')]();};}function respondWithResult(_0x221b54,_0x1cf309){_0x1cf309=_0x1cf309||0xc8;return function(_0x711793){if(_0x711793){return _0x221b54[_0x47a5('0x16')](_0x1cf309)[_0x47a5('0x17')](_0x711793);}};}function respondWithFilteredResult(_0x3c6c46,_0x190faa){return function(_0x4e99a8){if(_0x4e99a8){var _0x362359=_0x4e99a8[_0x47a5('0x18')],_0x11faf5=_0x190faa['offset'],_0x3b001e=_0x190faa['offset']+_0x190faa[_0x47a5('0x19')],_0x2a2cbb;if(_0x3b001e>=_0x362359){_0x3b001e=_0x362359;_0x2a2cbb=0xc8;}else{_0x2a2cbb=0xce;}_0x3c6c46['status'](_0x2a2cbb);return _0x3c6c46['set'](_0x47a5('0x1a'),_0x11faf5+'-'+_0x3b001e+'/'+_0x362359)[_0x47a5('0x17')](_0x4e99a8);}return null;};}function patchUpdates(_0x2ce454){return function(_0x1ef371){try{jsonpatch[_0x47a5('0x1b')](_0x1ef371,_0x2ce454,!![]);}catch(_0x12b98e){return BPromise[_0x47a5('0x1c')](_0x12b98e);}return _0x1ef371[_0x47a5('0x1d')]();};}function saveUpdates(_0x3aed38,_0x4a9fcb){return function(_0x1570bc){if(_0x1570bc){return _0x1570bc[_0x47a5('0x1e')](_0x3aed38)['then'](function(_0x2b0360){return _0x2b0360;});}return null;};}function removeEntity(_0x1f03f7,_0x36874d){return function(_0x4c5910){if(_0x4c5910){return _0x4c5910[_0x47a5('0x1f')]()[_0x47a5('0x20')](function(){var _0x23db32=_0x4c5910[_0x47a5('0x21')]({'plain':!![]});var _0x5ef1b1=_0x47a5('0x22');return db[_0x47a5('0x23')]['destroy']({'where':{'type':_0x5ef1b1,'resourceId':_0x23db32['id']}})[_0x47a5('0x20')](function(){return _0x4c5910;});})[_0x47a5('0x20')](function(){_0x1f03f7[_0x47a5('0x16')](0xcc)[_0x47a5('0x15')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x14')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x24')](_0x5b6c4e[_0x47a5('0x25')]);if(_0x5b6c4e[_0x47a5('0x26')]){delete _0x5b6c4e[_0x47a5('0x26')];}_0x5686db[_0x47a5('0x16')](_0x1ea9c8)[_0x47a5('0x27')](_0x5b6c4e);};}exports[_0x47a5('0x28')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=db['AnalyticDefaultReport'][_0x47a5('0x29')];_0x1127f8['model']=_[_0x47a5('0x2a')](_0x3ad507);_0x1127f8[_0x47a5('0x2b')]=_[_0x47a5('0x2a')](_0x136b14['query']);_0x1127f8[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x1127f8[_0x47a5('0x2e')],_0x1127f8[_0x47a5('0x2b')]);_0x361bfa['attributes']=_['intersection'](_0x1127f8[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x136b14['query']['fields']));_0x361bfa[_0x47a5('0x30')]=_0x361bfa[_0x47a5('0x30')]['length']?_0x361bfa[_0x47a5('0x30')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2b')][_0x47a5('0x31')]('nolimit')){_0x361bfa['limit']=qs[_0x47a5('0x19')](_0x136b14['query'][_0x47a5('0x19')]);_0x361bfa[_0x47a5('0x32')]=qs[_0x47a5('0x32')](_0x136b14['query'][_0x47a5('0x32')]);}_0x361bfa['order']=qs['sort'](_0x136b14[_0x47a5('0x2b')]['sort']);_0x361bfa[_0x47a5('0x33')]=qs['filters'](_[_0x47a5('0x34')](_0x136b14[_0x47a5('0x2b')],_0x1127f8[_0x47a5('0x2c')]));if(_0x136b14[_0x47a5('0x2b')][_0x47a5('0x35')]){_0x361bfa[_0x47a5('0x33')]=_[_0x47a5('0x36')](_0x361bfa[_0x47a5('0x33')],{'$or':_[_0x47a5('0x37')](_0x3ad507,function(_0x4caed5){if(_0x4caed5[_0x47a5('0x38')][_0x47a5('0x39')]!=='VIRTUAL'){var _0x2c50d6={};_0x2c50d6[_0x4caed5[_0x47a5('0x3a')]]={'$like':'%'+_0x136b14[_0x47a5('0x2b')]['filter']+'%'};return _0x2c50d6;}})});}_0x361bfa=_[_0x47a5('0x36')]({},_0x361bfa,_0x136b14[_0x47a5('0x3b')]);var _0x596097={'where':_0x361bfa[_0x47a5('0x33')]};return db[_0x47a5('0x3c')]['count'](_0x596097)['then'](function(_0x5ebd8c){_0x11a4fa[_0x47a5('0x18')]=_0x5ebd8c;if(_0x136b14['query'][_0x47a5('0x3d')]){_0x361bfa[_0x47a5('0x3e')]=[{'all':!![]}];}return db[_0x47a5('0x3c')][_0x47a5('0x3f')](_0x361bfa);})[_0x47a5('0x20')](function(_0xcb5243){_0x11a4fa[_0x47a5('0x40')]=_0xcb5243;return _0x11a4fa;})[_0x47a5('0x20')](respondWithFilteredResult(_0x16631f,_0x361bfa))[_0x47a5('0x41')](handleError(_0x16631f,null));};exports[_0x47a5('0x42')]=function(_0x280500,_0x1658e8){var _0x23d6d8={'raw':!![],'where':{'id':_0x280500[_0x47a5('0x43')]['id']}},_0x56dbbd={};_0x56dbbd[_0x47a5('0x2e')]=_[_0x47a5('0x2a')](db[_0x47a5('0x3c')]['rawAttributes']);_0x56dbbd[_0x47a5('0x2b')]=_['keys'](_0x280500['query']);_0x56dbbd['filters']=_['intersection'](_0x56dbbd[_0x47a5('0x2e')],_0x56dbbd['query']);_0x23d6d8[_0x47a5('0x30')]=_[_0x47a5('0x2d')](_0x56dbbd[_0x47a5('0x2e')],qs['fields'](_0x280500[_0x47a5('0x2b')][_0x47a5('0x2f')]));_0x23d6d8['attributes']=_0x23d6d8['attributes'][_0x47a5('0x44')]?_0x23d6d8['attributes']:_0x56dbbd[_0x47a5('0x2e')];if(_0x280500[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x23d6d8[_0x47a5('0x3e')]=[{'all':!![]}];}_0x23d6d8=_[_0x47a5('0x36')]({},_0x23d6d8,_0x280500[_0x47a5('0x3b')]);return db[_0x47a5('0x3c')][_0x47a5('0x45')](_0x23d6d8)[_0x47a5('0x20')](handleEntityNotFound(_0x1658e8,null))[_0x47a5('0x20')](respondWithResult(_0x1658e8,null))[_0x47a5('0x41')](handleError(_0x1658e8,null));};exports[_0x47a5('0x46')]=function(_0xe28d76,_0x3574d4){return db[_0x47a5('0x3c')][_0x47a5('0x46')](_0xe28d76['body'],{})[_0x47a5('0x20')](function(_0x23bb04){var _0x49eab1=_0xe28d76['user'][_0x47a5('0x21')]({'plain':!![]});if(!_0x49eab1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49eab1[_0x47a5('0x47')]===_0x47a5('0x48')){var _0x54c35f=_0x23bb04['get']({'plain':!![]});var _0x3d85cc='Reports';return db[_0x47a5('0x49')][_0x47a5('0x45')]({'where':{'name':_0x3d85cc,'userProfileId':_0x49eab1[_0x47a5('0x4a')]},'raw':!![]})[_0x47a5('0x20')](function(_0x44fe8a){if(_0x44fe8a&&_0x44fe8a[_0x47a5('0x4b')]===0x0){return db[_0x47a5('0x23')]['create']({'name':_0x54c35f['name'],'resourceId':_0x54c35f['id'],'type':_0x47a5('0x22'),'sectionId':_0x44fe8a['id']},{})[_0x47a5('0x20')](function(){return _0x23bb04;});}else{return _0x23bb04;}})[_0x47a5('0x41')](function(_0x9ea93e){logger[_0x47a5('0x24')](_0x47a5('0x4c'),_0x9ea93e);throw _0x9ea93e;});}return _0x23bb04;})[_0x47a5('0x20')](respondWithResult(_0x3574d4,0xc9))['catch'](handleError(_0x3574d4,null));};exports[_0x47a5('0x1e')]=function(_0x1c9a62,_0x5f6a){if(_0x1c9a62['body']['id']){delete _0x1c9a62[_0x47a5('0x4d')]['id'];}return db['AnalyticDefaultReport'][_0x47a5('0x45')]({'where':{'id':_0x1c9a62[_0x47a5('0x43')]['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x5f6a,null))[_0x47a5('0x20')](saveUpdates(_0x1c9a62['body'],null))[_0x47a5('0x20')](respondWithResult(_0x5f6a,null))[_0x47a5('0x41')](handleError(_0x5f6a,null));};exports[_0x47a5('0x1f')]=function(_0x3a2de4,_0x1b2335){return db[_0x47a5('0x3c')][_0x47a5('0x45')]({'where':{'id':_0x3a2de4['params']['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x1b2335,null))[_0x47a5('0x20')](removeEntity(_0x1b2335,null))[_0x47a5('0x41')](handleError(_0x1b2335,null));};exports[_0x47a5('0x4e')]=function(_0x3329aa,_0x1ab0bf){var _0x572233=0xa;var _0x1ad6a9=[_0x47a5('0x4f'),_0x47a5('0x50'),'right_join',_0x47a5('0x51')];var _0x3c78b7={'SUM':_0x47a5('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x47a5('0x53'),'MIN':_0x47a5('0x54'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x55'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x16bb8a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x47a5('0x56'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b958b=function(_0x72fe){return!_['includes'](['IS\x20NULL',_0x47a5('0x58'),_0x47a5('0x59'),_0x47a5('0x5a')],_0x72fe);};var _0x2931e4=function(_0x5996c4){if(!_0x5996c4||!_0x5996c4[_0x47a5('0x5b')][_0x47a5('0x44')]){return'';}for(var _0x1af800='(',_0x5a33b8=0x0;_0x5a33b8<_0x5996c4[_0x47a5('0x5b')]['length'];_0x5a33b8+=0x1){_0x5a33b8>0x0&&(_0x1af800+='\x20'+_0x5996c4[_0x47a5('0x5c')]+'\x20');_0x1af800+=_0x5996c4[_0x47a5('0x5b')][_0x5a33b8][_0x47a5('0x5d')]?_0x2931e4(_0x5996c4[_0x47a5('0x5b')][_0x5a33b8][_0x47a5('0x5d')]):_0x5996c4['rules'][_0x5a33b8][_0x47a5('0x3a')]+'\x20'+_0x5996c4['rules'][_0x5a33b8]['condition']+(_0x1b958b(_0x5996c4['rules'][_0x5a33b8]['condition'])?'\x20'+_0x5996c4[_0x47a5('0x5b')][_0x5a33b8][_0x47a5('0x5e')]:'');}return _0x1af800+')';};var _0x1e2bb4={'where':{'id':_0x3329aa[_0x47a5('0x43')]['id']}},_0x52e3ee,_0x4d3db1,_0x139229,_0x23020b,_0x45d4b6;_0x1e2bb4=_[_0x47a5('0x36')]({},_0x1e2bb4,_0x3329aa['options']);return db[_0x47a5('0x3c')]['find'](_0x1e2bb4)[_0x47a5('0x20')](function(_0x274d31){if(_0x274d31){_0x52e3ee=_0x274d31;return _0x274d31['getFields']();}return null;})[_0x47a5('0x20')](function(_0x345104){if(_0x345104){if(!_0x345104[_0x47a5('0x44')]){throw new db[(_0x47a5('0x5f'))][(_0x47a5('0x60'))](_0x47a5('0x61'),0x193);}_0x4d3db1=_0x345104;return db[_0x47a5('0x62')][_0x47a5('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x2dcc3b){if(_0x2dcc3b){_0x139229=_[_0x47a5('0x63')](_0x2dcc3b,'id');var _0x3c75c6;var _0x26e7fc=squel[_0x47a5('0x64')]();_0x26e7fc['from'](_0x52e3ee[_0x47a5('0x65')]);for(var _0xdfcecc=0x0;_0xdfcecc<_0x4d3db1[_0x47a5('0x44')];_0xdfcecc+=0x1){_0x3c75c6=_0x4d3db1[_0xdfcecc][_0x47a5('0x66')]?_0x139229[_0x4d3db1[_0xdfcecc][_0x47a5('0x66')]][_0x47a5('0x67')]:_0x4d3db1[_0xdfcecc][_0x47a5('0x3a')];_0x3c75c6=_0x4d3db1[_0xdfcecc][_0x47a5('0x68')]?_[_0x47a5('0x69')](_0x3c78b7[_0x4d3db1[_0xdfcecc][_0x47a5('0x68')]],'%s',_0x3c75c6):_0x3c75c6;_0x3c75c6=_0x4d3db1[_0xdfcecc][_0x47a5('0x6a')]?_[_0x47a5('0x69')](_0x16bb8a[_0x4d3db1[_0xdfcecc][_0x47a5('0x6a')]],'%s',_0x3c75c6):_0x3c75c6;if(_0x4d3db1[_0xdfcecc][_0x47a5('0x6b')]){_0x26e7fc[_0x47a5('0x5d')](_0x3c75c6);}_0x4d3db1[_0xdfcecc]['orderBy']&&_0x26e7fc[_0x47a5('0x6c')](_0x3c75c6,_0x4d3db1[_0xdfcecc][_0x47a5('0x6d')]===_0x47a5('0x6e')?![]:!![]);_0x26e7fc['field'](_0x3c75c6,_0x4d3db1[_0xdfcecc][_0x47a5('0x6f')]||_0x3c75c6);}if(_0x52e3ee[_0x47a5('0x70')]){_0x52e3ee[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x52e3ee['joins']);for(var _0x3ac402=0x0;_0x3ac402<_0x52e3ee['joins'][_0x47a5('0x44')];_0x3ac402+=0x1){if(_0x52e3ee['joins'][_0x3ac402][_0x47a5('0x38')]&&_['includes'](_0x1ad6a9,_0x52e3ee[_0x47a5('0x70')][_0x3ac402][_0x47a5('0x38')])&&_0x52e3ee[_0x47a5('0x70')][_0x3ac402]['parentKey']&&_0x52e3ee['joins'][_0x3ac402]['foreignTable']&&_0x52e3ee[_0x47a5('0x70')][_0x3ac402][_0x47a5('0x72')]){_0x26e7fc[_0x52e3ee[_0x47a5('0x70')][_0x3ac402][_0x47a5('0x38')]](_0x52e3ee['joins'][_0x3ac402][_0x47a5('0x73')],null,util[_0x47a5('0x6a')](_0x47a5('0x74'),_0x52e3ee[_0x47a5('0x65')],_0x52e3ee[_0x47a5('0x70')][_0x3ac402][_0x47a5('0x75')],_0x52e3ee[_0x47a5('0x70')][_0x3ac402][_0x47a5('0x73')],_0x52e3ee[_0x47a5('0x70')][_0x3ac402][_0x47a5('0x72')]));}}}if(_0x52e3ee[_0x47a5('0x76')]){_0x52e3ee[_0x47a5('0x76')]=JSON['parse'](_0x52e3ee[_0x47a5('0x76')]);_0x26e7fc['where'](_0x2931e4(_0x52e3ee[_0x47a5('0x76')][_0x47a5('0x5d')]));}_0x45d4b6=_0x26e7fc[_0x47a5('0x77')]();_0x26e7fc[_0x47a5('0x19')](_0x572233);_0x26e7fc[_0x47a5('0x32')](0x0);logger[_0x47a5('0x78')](_0x47a5('0x79'),_0x26e7fc[_0x47a5('0x7a')]());return db[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x26e7fc[_0x47a5('0x7a')](),{'type':db[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x20')](respondWithResult(_0x1ab0bf,null))['catch'](handleError(_0x1ab0bf,null));};function runReport(_0x48eb77,_0x5ccc89,_0x4d09a4){var _0x490e28=_0x5ccc89[_0x47a5('0x26')];var _0x5d6916=0xa;var _0x732e00=[_0x47a5('0x4f'),_0x47a5('0x50'),_0x47a5('0x7e'),_0x47a5('0x51')];var _0x930d25={'SUM':_0x47a5('0x52'),'COUNT':_0x47a5('0x7f'),'COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x53'),'MIN':_0x47a5('0x54'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x47a5('0x81'),'GROUP_CONCAT ASC':_0x47a5('0x55'),'GROUP_CONCAT DESC':_0x47a5('0x82')};var _0x4f35ff={'SEC_TO_TIME':_0x47a5('0x83'),'DATE':_0x47a5('0x84'),'HOUR':_0x47a5('0x56'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x47a5('0x85')};var _0x5205ba=function(_0x49d93d){return!_[_0x47a5('0x86')]([_0x47a5('0x87'),_0x47a5('0x58'),_0x47a5('0x59'),_0x47a5('0x5a')],_0x49d93d);};var _0xea50f3=function(_0x479a82){if(!_0x479a82||!_0x479a82['rules'][_0x47a5('0x44')]){return'';}for(var _0x4f2361='(',_0x24dbee=0x0;_0x24dbee<_0x479a82[_0x47a5('0x5b')][_0x47a5('0x44')];_0x24dbee+=0x1){_0x24dbee>0x0&&(_0x4f2361+='\x20'+_0x479a82[_0x47a5('0x5c')]+'\x20');_0x4f2361+=_0x479a82['rules'][_0x24dbee][_0x47a5('0x5d')]?_0xea50f3(_0x479a82['rules'][_0x24dbee]['group']):_0x479a82[_0x47a5('0x5b')][_0x24dbee][_0x47a5('0x3a')]+'\x20'+_0x479a82['rules'][_0x24dbee][_0x47a5('0x88')]+(_0x5205ba(_0x479a82[_0x47a5('0x5b')][_0x24dbee][_0x47a5('0x88')])?'\x20'+_0x479a82['rules'][_0x24dbee][_0x47a5('0x5e')]:'');}return _0x4f2361+')';};var _0x578e27={'where':{'id':_0x48eb77['id']}},_0x2307da,_0x219beb,_0x63e2e5,_0x4a5ca1,_0x2e0af1;_0x578e27=_[_0x47a5('0x36')]({},_0x578e27,_0x4d09a4);return db[_0x47a5('0x3c')]['find'](_0x578e27)[_0x47a5('0x20')](function(_0x4f2fbb){if(_0x4f2fbb){_0x2307da=_0x4f2fbb;return _0x4f2fbb[_0x47a5('0x89')]();}return null;})['then'](function(_0x135d2e){if(_0x135d2e){if(!_0x135d2e[_0x47a5('0x44')]){throw new db[(_0x47a5('0x5f'))][(_0x47a5('0x60'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x219beb=_0x135d2e;return db[_0x47a5('0x62')][_0x47a5('0x3f')]({'raw':!![]});}return null;})[_0x47a5('0x20')](function(_0x1bbfba){if(_0x1bbfba){_0x63e2e5=_[_0x47a5('0x63')](_0x1bbfba,'id');var _0x57ac25;var _0x56c35e=squel[_0x47a5('0x64')]();_0x56c35e['from'](_0x2307da[_0x47a5('0x65')]);for(var _0xa8809a=0x0;_0xa8809a<_0x219beb[_0x47a5('0x44')];_0xa8809a+=0x1){_0x57ac25=_0x219beb[_0xa8809a]['MetricId']?_0x63e2e5[_0x219beb[_0xa8809a][_0x47a5('0x66')]][_0x47a5('0x67')]:_0x219beb[_0xa8809a]['field'];_0x57ac25=_0x219beb[_0xa8809a][_0x47a5('0x68')]?_[_0x47a5('0x69')](_0x930d25[_0x219beb[_0xa8809a][_0x47a5('0x68')]],'%s',_0x57ac25):_0x57ac25;_0x57ac25=_0x219beb[_0xa8809a][_0x47a5('0x6a')]?_['replace'](_0x4f35ff[_0x219beb[_0xa8809a]['format']],'%s',_0x57ac25):_0x57ac25;if(_0x219beb[_0xa8809a][_0x47a5('0x6b')]){_0x56c35e[_0x47a5('0x5d')](_0x57ac25);}_0x219beb[_0xa8809a]['orderBy']&&_0x56c35e[_0x47a5('0x6c')](_0x57ac25,_0x219beb[_0xa8809a][_0x47a5('0x6d')]==='DESC'?![]:!![]);_0x56c35e[_0x47a5('0x3a')](_0x57ac25,_0x219beb[_0xa8809a][_0x47a5('0x6f')]||_0x57ac25);}if(_0x2307da[_0x47a5('0x70')]){_0x2307da['joins']=JSON[_0x47a5('0x71')](_0x2307da['joins']);for(var _0x663778=0x0;_0x663778<_0x2307da['joins'][_0x47a5('0x44')];_0x663778+=0x1){if(_0x2307da[_0x47a5('0x70')][_0x663778]['type']&&_[_0x47a5('0x86')](_0x732e00,_0x2307da['joins'][_0x663778][_0x47a5('0x38')])&&_0x2307da[_0x47a5('0x70')][_0x663778][_0x47a5('0x75')]&&_0x2307da[_0x47a5('0x70')][_0x663778]['foreignTable']&&_0x2307da[_0x47a5('0x70')][_0x663778]['foreignKey']){_0x56c35e[_0x2307da['joins'][_0x663778][_0x47a5('0x38')]](_0x2307da[_0x47a5('0x70')][_0x663778][_0x47a5('0x73')],null,util[_0x47a5('0x6a')](_0x47a5('0x74'),_0x2307da['table'],_0x2307da[_0x47a5('0x70')][_0x663778][_0x47a5('0x75')],_0x2307da[_0x47a5('0x70')][_0x663778][_0x47a5('0x73')],_0x2307da['joins'][_0x663778][_0x47a5('0x72')]));}}}if(_0x2307da['conditions']){_0x2307da[_0x47a5('0x76')]=JSON[_0x47a5('0x71')](_0x2307da[_0x47a5('0x76')]);_0x56c35e[_0x47a5('0x33')](_0xea50f3(_0x2307da[_0x47a5('0x76')][_0x47a5('0x5d')]));}_0x2e0af1=_0x56c35e[_0x47a5('0x77')]();_0x56c35e[_0x47a5('0x19')](_0x5d6916);_0x56c35e[_0x47a5('0x32')](0x0);logger['debug'](_0x47a5('0x79'),_0x56c35e[_0x47a5('0x7a')]());return db['sequelize'][_0x47a5('0x2b')](_0x56c35e[_0x47a5('0x7a')](),{'type':db[_0x47a5('0x7b')]['QueryTypes']['SELECT']});}})[_0x47a5('0x20')](function(_0x3d7371){if(!_0x3d7371['length']){throw new db['Sequelize'][(_0x47a5('0x60'))](_0x47a5('0x8a'),0xcc);}if(_0x5ccc89['output']===_0x47a5('0x8b')){return null;}var _0x269ff6=_['merge'](_0x5ccc89,{'name':_0x5ccc89[_0x47a5('0x8c')]||_0x5ccc89[_0x47a5('0x26')]||_0x2307da[_0x47a5('0x26')],'basename':_0x490e28,'savename':util[_0x47a5('0x6a')](_0x47a5('0x8d'),_0x5ccc89[_0x47a5('0x26')]||_0x2307da['name'],require('randomstring')['generate'](0x4),_0x5ccc89[_0x47a5('0x8e')]||_0x47a5('0x8f')),'reportId':_0x2307da['id'],'reportType':'default'});return db[_0x47a5('0x90')][_0x47a5('0x46')](_0x269ff6,{'raw':!![]});})[_0x47a5('0x20')](function(_0x1752ce){if(_0x2307da[_0x47a5('0x65')]==='cdr'){_0x2e0af1[_0x47a5('0x33')](_0x2307da['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5ccc89['startDate'],_0x5ccc89[_0x47a5('0x91')]);}else{_0x2e0af1['where'](_0x2307da[_0x47a5('0x65')]+_0x47a5('0x92'),_0x5ccc89[_0x47a5('0x93')],_0x5ccc89['endDate']);}if(_0x1752ce){logger[_0x47a5('0x94')](_0x47a5('0x95'),_0x2e0af1[_0x47a5('0x7a')]());require(_0x47a5('0x96'))[_0x47a5('0x97')](path['join'](__dirname,_0x47a5('0x98'),_0x1752ce[_0x47a5('0x8e')]),[_0x1752ce['id'],_0x2e0af1['toString'](),path[_0x47a5('0x4f')](__dirname,_0x47a5('0x99'),_0x1752ce[_0x47a5('0x9a')]),_0x490e28]);return _0x1752ce;}else{var _0x1f937a=squel[_0x47a5('0x64')]();_0x1f937a[_0x47a5('0x9b')]('('+_0x2e0af1['toString']()+')',_0x47a5('0x9c'));_0x1f937a[_0x47a5('0x3a')]('COUNT(*)',_0x47a5('0x18'));_0x2e0af1[_0x47a5('0x19')](_0x5ccc89[_0x47a5('0x19')]||_0x5d6916);_0x2e0af1[_0x47a5('0x32')](_0x5ccc89['offset']||0x0);return db['sequelize']['query'](_0x1f937a['toString'](),{'type':db[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x20')](function(_0x31f896){if(!_0x31f896[_0x47a5('0x44')]){_0x4a5ca1=0x0;}else{_0x4a5ca1=_0x31f896[0x0][_0x47a5('0x18')]||0x0;}return db[_0x47a5('0x7b')]['query'](_0x2e0af1[_0x47a5('0x7a')](),{'type':db[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});})['then'](function(_0x5ef411){return{'rows':_0x5ef411||[],'count':_0x4a5ca1};});}});}exports[_0x47a5('0x9d')]=function(_0x54ae9a,_0x4cb8e4){return runReport(_0x54ae9a[_0x47a5('0x43')],_0x54ae9a[_0x47a5('0x2b')],_0x54ae9a['options'])[_0x47a5('0x20')](respondWithResult(_0x4cb8e4,null))[_0x47a5('0x41')](handleError(_0x4cb8e4,null));};exports[_0x47a5('0x9e')]=runReport;exports['query']=function(_0x740bdf,_0xee23c7){var _0x48a491=0xa;var _0x1172fd=[_0x47a5('0x4f'),_0x47a5('0x50'),_0x47a5('0x7e'),_0x47a5('0x51')];var _0x475114={'SUM':'SUM(%s)','COUNT':_0x47a5('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x47a5('0x53'),'MIN':_0x47a5('0x54'),'AVG':_0x47a5('0x9f'),'GROUP_CONCAT':_0x47a5('0x81'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x47a5('0x82')};var _0x281674={'SEC_TO_TIME':_0x47a5('0x83'),'DATE':_0x47a5('0x84'),'HOUR':_0x47a5('0x56'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x85')};var _0x359fd8=function(_0x1b3e82){return!_[_0x47a5('0x86')]([_0x47a5('0x87'),_0x47a5('0x58'),'IS\x20EMPTY',_0x47a5('0x5a')],_0x1b3e82);};var _0x3ec683=function(_0x591bde){if(!_0x591bde||!_0x591bde[_0x47a5('0x5b')][_0x47a5('0x44')]){return'';}for(var _0x390123='(',_0x2ccf21=0x0;_0x2ccf21<_0x591bde[_0x47a5('0x5b')]['length'];_0x2ccf21+=0x1){_0x2ccf21>0x0&&(_0x390123+='\x20'+_0x591bde[_0x47a5('0x5c')]+'\x20');_0x390123+=_0x591bde[_0x47a5('0x5b')][_0x2ccf21][_0x47a5('0x5d')]?_0x3ec683(_0x591bde[_0x47a5('0x5b')][_0x2ccf21][_0x47a5('0x5d')]):_0x591bde[_0x47a5('0x5b')][_0x2ccf21][_0x47a5('0x3a')]+'\x20'+_0x591bde['rules'][_0x2ccf21]['condition']+(_0x359fd8(_0x591bde[_0x47a5('0x5b')][_0x2ccf21]['condition'])?'\x20'+_0x591bde[_0x47a5('0x5b')][_0x2ccf21]['value']:'');}return _0x390123+')';};var _0x12572f={'where':{'id':_0x740bdf[_0x47a5('0x43')]['id']}},_0x8b4354,_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557;_0x12572f=_[_0x47a5('0x36')]({},_0x12572f,_0x740bdf['options']);return db['AnalyticDefaultReport'][_0x47a5('0x45')](_0x12572f)[_0x47a5('0x20')](function(_0x987752){if(_0x987752){_0x8b4354=_0x987752;return _0x987752[_0x47a5('0x89')]();}return null;})[_0x47a5('0x20')](function(_0x402bba){if(_0x402bba){if(!_0x402bba[_0x47a5('0x44')]){throw new db[(_0x47a5('0x5f'))]['ValidationErrorItem'](_0x47a5('0x61'),0x193);}_0x134c1a=_0x402bba;return db['AnalyticMetric'][_0x47a5('0x3f')]({'raw':!![]});}return null;})[_0x47a5('0x20')](function(_0x5b0b0b){if(_0x5b0b0b){_0x2bc7ae=_['keyBy'](_0x5b0b0b,'id');var _0x229280;var _0x41d2da=squel['select']();_0x41d2da[_0x47a5('0x9b')](_0x8b4354[_0x47a5('0x65')]);for(var _0x29e3ee=0x0;_0x29e3ee<_0x134c1a[_0x47a5('0x44')];_0x29e3ee+=0x1){_0x229280=_0x134c1a[_0x29e3ee]['MetricId']?_0x2bc7ae[_0x134c1a[_0x29e3ee][_0x47a5('0x66')]]['metric']:_0x134c1a[_0x29e3ee]['field'];_0x229280=_0x134c1a[_0x29e3ee]['function']?_[_0x47a5('0x69')](_0x475114[_0x134c1a[_0x29e3ee]['function']],'%s',_0x229280):_0x229280;_0x229280=_0x134c1a[_0x29e3ee][_0x47a5('0x6a')]?_[_0x47a5('0x69')](_0x281674[_0x134c1a[_0x29e3ee][_0x47a5('0x6a')]],'%s',_0x229280):_0x229280;if(_0x134c1a[_0x29e3ee][_0x47a5('0x6b')]){_0x41d2da[_0x47a5('0x5d')](_0x229280);}_0x134c1a[_0x29e3ee][_0x47a5('0x6d')]&&_0x41d2da[_0x47a5('0x6c')](_0x229280,_0x134c1a[_0x29e3ee][_0x47a5('0x6d')]===_0x47a5('0x6e')?![]:!![]);_0x41d2da[_0x47a5('0x3a')](_0x229280,_0x134c1a[_0x29e3ee][_0x47a5('0x6f')]||_0x229280);}if(_0x8b4354[_0x47a5('0x70')]){_0x8b4354[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x8b4354[_0x47a5('0x70')]);for(var _0x5e17cb=0x0;_0x5e17cb<_0x8b4354[_0x47a5('0x70')][_0x47a5('0x44')];_0x5e17cb+=0x1){if(_0x8b4354[_0x47a5('0x70')][_0x5e17cb][_0x47a5('0x38')]&&_['includes'](_0x1172fd,_0x8b4354[_0x47a5('0x70')][_0x5e17cb]['type'])&&_0x8b4354[_0x47a5('0x70')][_0x5e17cb]['parentKey']&&_0x8b4354[_0x47a5('0x70')][_0x5e17cb][_0x47a5('0x73')]&&_0x8b4354[_0x47a5('0x70')][_0x5e17cb]['foreignKey']){_0x41d2da[_0x8b4354[_0x47a5('0x70')][_0x5e17cb][_0x47a5('0x38')]](_0x8b4354[_0x47a5('0x70')][_0x5e17cb]['foreignTable'],null,util['format'](_0x47a5('0x74'),_0x8b4354[_0x47a5('0x65')],_0x8b4354[_0x47a5('0x70')][_0x5e17cb][_0x47a5('0x75')],_0x8b4354[_0x47a5('0x70')][_0x5e17cb]['foreignTable'],_0x8b4354[_0x47a5('0x70')][_0x5e17cb]['foreignKey']));}}}if(_0x8b4354[_0x47a5('0x76')]){_0x8b4354[_0x47a5('0x76')]=JSON[_0x47a5('0x71')](_0x8b4354[_0x47a5('0x76')]);_0x41d2da['where'](_0x3ec683(_0x8b4354['conditions'][_0x47a5('0x5d')]));}_0x220557=_0x41d2da[_0x47a5('0x77')]();_0x41d2da[_0x47a5('0x19')](_0x48a491);_0x41d2da[_0x47a5('0x32')](0x0);logger[_0x47a5('0x78')](_0x47a5('0x79'),_0x41d2da[_0x47a5('0x7a')]());return db[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x41d2da['toString'](),{'type':db['sequelize'][_0x47a5('0x7c')]['SELECT']});}})[_0x47a5('0x20')](function(){return{'sql':_0x220557[_0x47a5('0x7a')]()};})[_0x47a5('0x20')](respondWithResult(_0xee23c7,null))['catch'](handleError(_0xee23c7,null));}; \ No newline at end of file +var _0xb10b=['get','DefaultReports','UserProfileResource','error','stack','name','send','index','AnalyticDefaultReport','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','field','options','count','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','format','replace','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','group','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','condition','from','function','debug','No\x20available\x20data','output','fullPath','randomstring','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','ValidationErrorItem','groupBy','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xb10b,0x12a));var _0xbb10=function(_0x226e5b,_0x4935ed){_0x226e5b=_0x226e5b-0x0;var _0x3c44d3=_0xb10b[_0x226e5b];return _0x3c44d3;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xcc;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x18')](_0x44fb19);}return _0x5be7e0[_0xbb10('0x19')](_0x44fb19)[_0xbb10('0x1a')]();};}function respondWithResult(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xc8;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x19')](_0x58a612)[_0xbb10('0x1b')](_0x26e021);}};}function respondWithFilteredResult(_0x17fd46,_0x3df17b){return function(_0x2f2ebf){if(_0x2f2ebf){var _0x24a57b=_0x2f2ebf['count'],_0x36b5e8=_0x3df17b[_0xbb10('0x1c')],_0x3e26f4=_0x3df17b[_0xbb10('0x1c')]+_0x3df17b[_0xbb10('0x1d')],_0x2b184e;if(_0x3e26f4>=_0x24a57b){_0x3e26f4=_0x24a57b;_0x2b184e=0xc8;}else{_0x2b184e=0xce;}_0x17fd46[_0xbb10('0x19')](_0x2b184e);return _0x17fd46[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x36b5e8+'-'+_0x3e26f4+'/'+_0x24a57b)[_0xbb10('0x1b')](_0x2f2ebf);}return null;};}function patchUpdates(_0x30efc6){return function(_0xbf2906){try{jsonpatch[_0xbb10('0x20')](_0xbf2906,_0x30efc6,!![]);}catch(_0x48b6e9){return BPromise[_0xbb10('0x21')](_0x48b6e9);}return _0xbf2906[_0xbb10('0x22')]();};}function saveUpdates(_0x388fab,_0x109908){return function(_0xdf237d){if(_0xdf237d){return _0xdf237d[_0xbb10('0x23')](_0x388fab)['then'](function(_0x12f888){return _0x12f888;});}return null;};}function removeEntity(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x24')]()[_0xbb10('0x25')](function(){var _0x2e911d=_0x4c4b0d[_0xbb10('0x26')]({'plain':!![]});var _0x445761=_0xbb10('0x27');return db[_0xbb10('0x28')][_0xbb10('0x24')]({'where':{'type':_0x445761,'resourceId':_0x2e911d['id']}})[_0xbb10('0x25')](function(){return _0x4c4b0d;});})[_0xbb10('0x25')](function(){_0x12ef77[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x29')](_0x4e25ff[_0xbb10('0x2a')]);if(_0x4e25ff[_0xbb10('0x2b')]){delete _0x4e25ff[_0xbb10('0x2b')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x2c')](_0x4e25ff);};}exports[_0xbb10('0x2d')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=db[_0xbb10('0x2e')]['rawAttributes'];_0xfc3595[_0xbb10('0x2f')]=_['keys'](_0x1d30aa);_0xfc3595[_0xbb10('0x30')]=_['keys'](_0x4aabb9[_0xbb10('0x30')]);_0xfc3595[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0xfc3595['model'],_0xfc3595['query']);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595['model'],qs[_0xbb10('0x34')](_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595['model'];if(!_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x1d')]);_0x21ac54[_0xbb10('0x1c')]=qs[_0xbb10('0x1c')](_0x4aabb9['query'][_0xbb10('0x1c')]);}_0x21ac54[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x4aabb9[_0xbb10('0x30')]['sort']);_0x21ac54[_0xbb10('0x3a')]=qs['filters'](_['pick'](_0x4aabb9[_0xbb10('0x30')],_0xfc3595[_0xbb10('0x31')]));if(_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x3b')]){_0x21ac54[_0xbb10('0x3a')]=_[_0xbb10('0x3c')](_0x21ac54['where'],{'$or':_[_0xbb10('0x3d')](_0x1d30aa,function(_0x25d72f){if(_0x25d72f['type']['key']!=='VIRTUAL'){var _0x31bee3={};_0x31bee3[_0x25d72f[_0xbb10('0x3e')]]={'$like':'%'+_0x4aabb9[_0xbb10('0x30')]['filter']+'%'};return _0x31bee3;}})});}_0x21ac54=_[_0xbb10('0x3c')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x4345f3={'where':_0x21ac54['where']};return db[_0xbb10('0x2e')][_0xbb10('0x40')](_0x4345f3)[_0xbb10('0x25')](function(_0x446f49){_0x2e0249['count']=_0x446f49;if(_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x41')]){_0x21ac54['include']=[{'all':!![]}];}return db[_0xbb10('0x2e')][_0xbb10('0x42')](_0x21ac54);})[_0xbb10('0x25')](function(_0x3a9934){_0x2e0249[_0xbb10('0x43')]=_0x3a9934;return _0x2e0249;})[_0xbb10('0x25')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x44')]=function(_0x1c7fae,_0x3e7b4c){var _0x3d3c41={'raw':!![],'where':{'id':_0x1c7fae[_0xbb10('0x45')]['id']}},_0x4943d9={};_0x4943d9[_0xbb10('0x2f')]=_[_0xbb10('0x46')](db[_0xbb10('0x2e')]['rawAttributes']);_0x4943d9[_0xbb10('0x30')]=_[_0xbb10('0x46')](_0x1c7fae['query']);_0x4943d9['filters']=_[_0xbb10('0x32')](_0x4943d9['model'],_0x4943d9[_0xbb10('0x30')]);_0x3d3c41[_0xbb10('0x33')]=_['intersection'](_0x4943d9[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x1c7fae[_0xbb10('0x30')]['fields']));_0x3d3c41[_0xbb10('0x33')]=_0x3d3c41[_0xbb10('0x33')][_0xbb10('0x35')]?_0x3d3c41[_0xbb10('0x33')]:_0x4943d9[_0xbb10('0x2f')];if(_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x41')]){_0x3d3c41[_0xbb10('0x47')]=[{'all':!![]}];}_0x3d3c41=_[_0xbb10('0x3c')]({},_0x3d3c41,_0x1c7fae[_0xbb10('0x3f')]);return db[_0xbb10('0x2e')][_0xbb10('0x48')](_0x3d3c41)['then'](handleEntityNotFound(_0x3e7b4c,null))[_0xbb10('0x25')](respondWithResult(_0x3e7b4c,null))[_0xbb10('0x49')](handleError(_0x3e7b4c,null));};exports['create']=function(_0x14e1cb,_0x2f5027){return db[_0xbb10('0x2e')][_0xbb10('0x4a')](_0x14e1cb[_0xbb10('0x4b')],{})[_0xbb10('0x25')](function(_0x3e06b0){var _0x5be85e=_0x14e1cb['user'][_0xbb10('0x26')]({'plain':!![]});if(!_0x5be85e)throw new Error(_0xbb10('0x4c'));if(_0x5be85e[_0xbb10('0x4d')]==='user'){var _0x5f0c12=_0x3e06b0[_0xbb10('0x26')]({'plain':!![]});var _0x34cf4e=_0xbb10('0x4e');return db[_0xbb10('0x4f')][_0xbb10('0x48')]({'where':{'name':_0x34cf4e,'userProfileId':_0x5be85e[_0xbb10('0x50')]},'raw':!![]})[_0xbb10('0x25')](function(_0x460788){if(_0x460788&&_0x460788[_0xbb10('0x51')]===0x0){return db[_0xbb10('0x28')]['create']({'name':_0x5f0c12['name'],'resourceId':_0x5f0c12['id'],'type':_0xbb10('0x27'),'sectionId':_0x460788['id']},{})[_0xbb10('0x25')](function(){return _0x3e06b0;});}else{return _0x3e06b0;}})[_0xbb10('0x49')](function(_0xb014b0){logger[_0xbb10('0x29')](_0xbb10('0x52'),_0xb014b0);throw _0xb014b0;});}return _0x3e06b0;})[_0xbb10('0x25')](respondWithResult(_0x2f5027,0xc9))[_0xbb10('0x49')](handleError(_0x2f5027,null));};exports[_0xbb10('0x23')]=function(_0x1214f7,_0x19ca3e){if(_0x1214f7[_0xbb10('0x4b')]['id']){delete _0x1214f7[_0xbb10('0x4b')]['id'];}return db[_0xbb10('0x2e')][_0xbb10('0x48')]({'where':{'id':_0x1214f7['params']['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x19ca3e,null))['then'](saveUpdates(_0x1214f7[_0xbb10('0x4b')],null))[_0xbb10('0x25')](respondWithResult(_0x19ca3e,null))[_0xbb10('0x49')](handleError(_0x19ca3e,null));};exports[_0xbb10('0x24')]=function(_0x26e66e,_0x32d8e9){return db[_0xbb10('0x2e')][_0xbb10('0x48')]({'where':{'id':_0x26e66e[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x32d8e9,null))[_0xbb10('0x25')](removeEntity(_0x32d8e9,null))[_0xbb10('0x49')](handleError(_0x32d8e9,null));};exports[_0xbb10('0x53')]=function(_0x3d7e17,_0x4475e1){var _0x5de0cc=0xa;var _0x4571b6=[_0xbb10('0x54'),_0xbb10('0x55'),_0xbb10('0x56'),_0xbb10('0x57')];var _0x379d8c={'SUM':'SUM(%s)','COUNT':_0xbb10('0x58'),'COUNT DISTINCT':_0xbb10('0x59'),'MAX':_0xbb10('0x5a'),'MIN':_0xbb10('0x5b'),'AVG':_0xbb10('0x5c'),'GROUP_CONCAT':_0xbb10('0x5d'),'GROUP_CONCAT ASC':_0xbb10('0x5e'),'GROUP_CONCAT DESC':_0xbb10('0x5f')};var _0x205e01={'SEC_TO_TIME':_0xbb10('0x60'),'DATE':_0xbb10('0x61'),'HOUR':_0xbb10('0x62'),'ROUND':_0xbb10('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4ea1a6=function(_0x16272d){return!_[_0xbb10('0x64')]([_0xbb10('0x65'),_0xbb10('0x66'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x16272d);};var _0x79411e=function(_0xaf2cc3){if(!_0xaf2cc3||!_0xaf2cc3[_0xbb10('0x67')][_0xbb10('0x35')]){return'';}for(var _0x412f13='(',_0x3e9753=0x0;_0x3e9753<_0xaf2cc3[_0xbb10('0x67')]['length'];_0x3e9753+=0x1){_0x3e9753>0x0&&(_0x412f13+='\x20'+_0xaf2cc3[_0xbb10('0x68')]+'\x20');_0x412f13+=_0xaf2cc3[_0xbb10('0x67')][_0x3e9753]['group']?_0x79411e(_0xaf2cc3['rules'][_0x3e9753]['group']):_0xaf2cc3[_0xbb10('0x67')][_0x3e9753][_0xbb10('0x3e')]+'\x20'+_0xaf2cc3[_0xbb10('0x67')][_0x3e9753]['condition']+(_0x4ea1a6(_0xaf2cc3['rules'][_0x3e9753]['condition'])?'\x20'+_0xaf2cc3[_0xbb10('0x67')][_0x3e9753][_0xbb10('0x69')]:'');}return _0x412f13+')';};var _0x45167a={'where':{'id':_0x3d7e17[_0xbb10('0x45')]['id']}},_0x4e9fbd,_0xa1bbd9,_0x13131c,_0x5a6538,_0x4a560c;_0x45167a=_[_0xbb10('0x3c')]({},_0x45167a,_0x3d7e17[_0xbb10('0x3f')]);return db[_0xbb10('0x2e')]['find'](_0x45167a)[_0xbb10('0x25')](function(_0xec48ac){if(_0xec48ac){_0x4e9fbd=_0xec48ac;return _0xec48ac[_0xbb10('0x6a')]();}return null;})['then'](function(_0x402a01){if(_0x402a01){if(!_0x402a01[_0xbb10('0x35')]){throw new db[(_0xbb10('0x6b'))]['ValidationErrorItem'](_0xbb10('0x6c'),0x193);}_0xa1bbd9=_0x402a01;return db[_0xbb10('0x6d')][_0xbb10('0x42')]({'raw':!![]});}return null;})[_0xbb10('0x25')](function(_0x5e4a6e){if(_0x5e4a6e){_0x13131c=_[_0xbb10('0x6e')](_0x5e4a6e,'id');var _0x258e55;var _0x108e5b=squel[_0xbb10('0x6f')]();_0x108e5b['from'](_0x4e9fbd[_0xbb10('0x70')]);for(var _0x277fe7=0x0;_0x277fe7<_0xa1bbd9[_0xbb10('0x35')];_0x277fe7+=0x1){_0x258e55=_0xa1bbd9[_0x277fe7][_0xbb10('0x71')]?_0x13131c[_0xa1bbd9[_0x277fe7][_0xbb10('0x71')]][_0xbb10('0x72')]:_0xa1bbd9[_0x277fe7][_0xbb10('0x3e')];_0x258e55=_0xa1bbd9[_0x277fe7]['function']?_['replace'](_0x379d8c[_0xa1bbd9[_0x277fe7]['function']],'%s',_0x258e55):_0x258e55;_0x258e55=_0xa1bbd9[_0x277fe7][_0xbb10('0x73')]?_[_0xbb10('0x74')](_0x205e01[_0xa1bbd9[_0x277fe7][_0xbb10('0x73')]],'%s',_0x258e55):_0x258e55;if(_0xa1bbd9[_0x277fe7]['groupBy']){_0x108e5b['group'](_0x258e55);}_0xa1bbd9[_0x277fe7][_0xbb10('0x75')]&&_0x108e5b[_0xbb10('0x38')](_0x258e55,_0xa1bbd9[_0x277fe7][_0xbb10('0x75')]===_0xbb10('0x76')?![]:!![]);_0x108e5b[_0xbb10('0x3e')](_0x258e55,_0xa1bbd9[_0x277fe7][_0xbb10('0x77')]||_0x258e55);}if(_0x4e9fbd['joins']){_0x4e9fbd[_0xbb10('0x78')]=JSON[_0xbb10('0x79')](_0x4e9fbd[_0xbb10('0x78')]);for(var _0x14f16b=0x0;_0x14f16b<_0x4e9fbd[_0xbb10('0x78')]['length'];_0x14f16b+=0x1){if(_0x4e9fbd['joins'][_0x14f16b]['type']&&_[_0xbb10('0x64')](_0x4571b6,_0x4e9fbd[_0xbb10('0x78')][_0x14f16b][_0xbb10('0x7a')])&&_0x4e9fbd[_0xbb10('0x78')][_0x14f16b][_0xbb10('0x7b')]&&_0x4e9fbd[_0xbb10('0x78')][_0x14f16b]['foreignTable']&&_0x4e9fbd[_0xbb10('0x78')][_0x14f16b]['foreignKey']){_0x108e5b[_0x4e9fbd['joins'][_0x14f16b]['type']](_0x4e9fbd[_0xbb10('0x78')][_0x14f16b][_0xbb10('0x7c')],null,util[_0xbb10('0x73')](_0xbb10('0x7d'),_0x4e9fbd['table'],_0x4e9fbd[_0xbb10('0x78')][_0x14f16b]['parentKey'],_0x4e9fbd['joins'][_0x14f16b][_0xbb10('0x7c')],_0x4e9fbd[_0xbb10('0x78')][_0x14f16b][_0xbb10('0x7e')]));}}}if(_0x4e9fbd[_0xbb10('0x7f')]){_0x4e9fbd[_0xbb10('0x7f')]=JSON['parse'](_0x4e9fbd[_0xbb10('0x7f')]);_0x108e5b[_0xbb10('0x3a')](_0x79411e(_0x4e9fbd[_0xbb10('0x7f')][_0xbb10('0x80')]));}_0x4a560c=_0x108e5b[_0xbb10('0x81')]();_0x108e5b[_0xbb10('0x1d')](_0x5de0cc);_0x108e5b[_0xbb10('0x1c')](0x0);logger['debug'](_0xbb10('0x82'),_0x108e5b[_0xbb10('0x83')]());return db[_0xbb10('0x84')][_0xbb10('0x30')](_0x108e5b[_0xbb10('0x83')](),{'type':db[_0xbb10('0x84')][_0xbb10('0x85')][_0xbb10('0x86')]});}})['then'](respondWithResult(_0x4475e1,null))[_0xbb10('0x49')](handleError(_0x4475e1,null));};function runReport(_0x218690,_0x145baf,_0x56416a){var _0x4ee101=_0x145baf['name'];var _0x23286d=0xa;var _0x5a3c44=['join',_0xbb10('0x55'),_0xbb10('0x56'),_0xbb10('0x57')];var _0x12ed63={'SUM':_0xbb10('0x87'),'COUNT':_0xbb10('0x58'),'COUNT DISTINCT':_0xbb10('0x59'),'MAX':_0xbb10('0x5a'),'MIN':_0xbb10('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xbb10('0x5d'),'GROUP_CONCAT ASC':_0xbb10('0x5e'),'GROUP_CONCAT DESC':_0xbb10('0x5f')};var _0x35b811={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xbb10('0x62'),'ROUND':_0xbb10('0x63'),'UNIX_TIMESTAMP':_0xbb10('0x88')};var _0x32bb25=function(_0x5ee705){return!_[_0xbb10('0x64')]([_0xbb10('0x65'),_0xbb10('0x66'),_0xbb10('0x89'),_0xbb10('0x8a')],_0x5ee705);};var _0x517185=function(_0x5f0691){if(!_0x5f0691||!_0x5f0691[_0xbb10('0x67')][_0xbb10('0x35')]){return'';}for(var _0x22c030='(',_0x5239da=0x0;_0x5239da<_0x5f0691[_0xbb10('0x67')][_0xbb10('0x35')];_0x5239da+=0x1){_0x5239da>0x0&&(_0x22c030+='\x20'+_0x5f0691['operator']+'\x20');_0x22c030+=_0x5f0691['rules'][_0x5239da][_0xbb10('0x80')]?_0x517185(_0x5f0691[_0xbb10('0x67')][_0x5239da][_0xbb10('0x80')]):_0x5f0691['rules'][_0x5239da][_0xbb10('0x3e')]+'\x20'+_0x5f0691[_0xbb10('0x67')][_0x5239da][_0xbb10('0x8b')]+(_0x32bb25(_0x5f0691[_0xbb10('0x67')][_0x5239da][_0xbb10('0x8b')])?'\x20'+_0x5f0691[_0xbb10('0x67')][_0x5239da][_0xbb10('0x69')]:'');}return _0x22c030+')';};var _0x226363={'where':{'id':_0x218690['id']}},_0x3e6246,_0x479d51,_0x3367d4,_0x28cc46,_0x412fbf;_0x226363=_[_0xbb10('0x3c')]({},_0x226363,_0x56416a);return db[_0xbb10('0x2e')][_0xbb10('0x48')](_0x226363)[_0xbb10('0x25')](function(_0x305d52){if(_0x305d52){_0x3e6246=_0x305d52;return _0x305d52[_0xbb10('0x6a')]();}return null;})[_0xbb10('0x25')](function(_0x15e043){if(_0x15e043){if(!_0x15e043[_0xbb10('0x35')]){throw new db['Sequelize']['ValidationErrorItem'](_0xbb10('0x6c'),0x193);}_0x479d51=_0x15e043;return db[_0xbb10('0x6d')][_0xbb10('0x42')]({'raw':!![]});}return null;})[_0xbb10('0x25')](function(_0x238c7a){if(_0x238c7a){_0x3367d4=_['keyBy'](_0x238c7a,'id');var _0x2749a7;var _0x332fbe=squel[_0xbb10('0x6f')]();_0x332fbe[_0xbb10('0x8c')](_0x3e6246[_0xbb10('0x70')]);for(var _0x379d49=0x0;_0x379d49<_0x479d51['length'];_0x379d49+=0x1){_0x2749a7=_0x479d51[_0x379d49][_0xbb10('0x71')]?_0x3367d4[_0x479d51[_0x379d49][_0xbb10('0x71')]]['metric']:_0x479d51[_0x379d49][_0xbb10('0x3e')];_0x2749a7=_0x479d51[_0x379d49]['function']?_[_0xbb10('0x74')](_0x12ed63[_0x479d51[_0x379d49][_0xbb10('0x8d')]],'%s',_0x2749a7):_0x2749a7;_0x2749a7=_0x479d51[_0x379d49][_0xbb10('0x73')]?_[_0xbb10('0x74')](_0x35b811[_0x479d51[_0x379d49][_0xbb10('0x73')]],'%s',_0x2749a7):_0x2749a7;if(_0x479d51[_0x379d49]['groupBy']){_0x332fbe[_0xbb10('0x80')](_0x2749a7);}_0x479d51[_0x379d49]['orderBy']&&_0x332fbe[_0xbb10('0x38')](_0x2749a7,_0x479d51[_0x379d49][_0xbb10('0x75')]==='DESC'?![]:!![]);_0x332fbe['field'](_0x2749a7,_0x479d51[_0x379d49][_0xbb10('0x77')]||_0x2749a7);}if(_0x3e6246[_0xbb10('0x78')]){_0x3e6246[_0xbb10('0x78')]=JSON[_0xbb10('0x79')](_0x3e6246[_0xbb10('0x78')]);for(var _0x1cb22f=0x0;_0x1cb22f<_0x3e6246[_0xbb10('0x78')][_0xbb10('0x35')];_0x1cb22f+=0x1){if(_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7a')]&&_[_0xbb10('0x64')](_0x5a3c44,_0x3e6246['joins'][_0x1cb22f][_0xbb10('0x7a')])&&_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7b')]&&_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7c')]&&_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7e')]){_0x332fbe[_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7a')]](_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7c')],null,util[_0xbb10('0x73')]('%s.%s\x20=\x20%s.%s',_0x3e6246[_0xbb10('0x70')],_0x3e6246['joins'][_0x1cb22f][_0xbb10('0x7b')],_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7c')],_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7e')]));}}}if(_0x3e6246['conditions']){_0x3e6246[_0xbb10('0x7f')]=JSON[_0xbb10('0x79')](_0x3e6246[_0xbb10('0x7f')]);_0x332fbe[_0xbb10('0x3a')](_0x517185(_0x3e6246[_0xbb10('0x7f')][_0xbb10('0x80')]));}_0x412fbf=_0x332fbe['clone']();_0x332fbe['limit'](_0x23286d);_0x332fbe[_0xbb10('0x1c')](0x0);logger[_0xbb10('0x8e')](_0xbb10('0x82'),_0x332fbe['toString']());return db[_0xbb10('0x84')][_0xbb10('0x30')](_0x332fbe['toString'](),{'type':db[_0xbb10('0x84')][_0xbb10('0x85')]['SELECT']});}})[_0xbb10('0x25')](function(_0x4d7bca){if(!_0x4d7bca[_0xbb10('0x35')]){throw new db[(_0xbb10('0x6b'))]['ValidationErrorItem'](_0xbb10('0x8f'),0xcc);}if(_0x145baf[_0xbb10('0x90')]==='web'){return null;}var _0x5dae56=_[_0xbb10('0x3c')](_0x145baf,{'name':_0x145baf[_0xbb10('0x91')]||_0x145baf[_0xbb10('0x2b')]||_0x3e6246[_0xbb10('0x2b')],'basename':_0x4ee101,'savename':util[_0xbb10('0x73')]('%s-%s.%s',_0x145baf[_0xbb10('0x2b')]||_0x3e6246[_0xbb10('0x2b')],require(_0xbb10('0x92'))['generate'](0x4),_0x145baf[_0xbb10('0x90')]||_0xbb10('0x93')),'reportId':_0x3e6246['id'],'reportType':_0xbb10('0x94')});return db[_0xbb10('0x95')][_0xbb10('0x4a')](_0x5dae56,{'raw':!![]});})[_0xbb10('0x25')](function(_0x1f55d3){if(_0x3e6246[_0xbb10('0x70')]===_0xbb10('0x96')){_0x412fbf['where'](_0x3e6246['table']+_0xbb10('0x97'),_0x145baf[_0xbb10('0x98')],_0x145baf[_0xbb10('0x99')]);}else{_0x412fbf[_0xbb10('0x3a')](_0x3e6246[_0xbb10('0x70')]+_0xbb10('0x9a'),_0x145baf[_0xbb10('0x98')],_0x145baf[_0xbb10('0x99')]);}if(_0x1f55d3){logger[_0xbb10('0x9b')](_0xbb10('0x9c'),_0x412fbf[_0xbb10('0x83')]());require(_0xbb10('0x9d'))[_0xbb10('0x9e')](path['join'](__dirname,_0xbb10('0x9f'),_0x1f55d3[_0xbb10('0x90')]),[_0x1f55d3['id'],_0x412fbf[_0xbb10('0x83')](),path[_0xbb10('0x54')](__dirname,_0xbb10('0xa0'),_0x1f55d3[_0xbb10('0xa1')]),_0x4ee101]);return _0x1f55d3;}else{var _0x4258fc=squel[_0xbb10('0x6f')]();_0x4258fc[_0xbb10('0x8c')]('('+_0x412fbf[_0xbb10('0x83')]()+')',_0xbb10('0xa2'));_0x4258fc['field'](_0xbb10('0xa3'),'count');_0x412fbf[_0xbb10('0x1d')](_0x145baf[_0xbb10('0x1d')]||_0x23286d);_0x412fbf[_0xbb10('0x1c')](_0x145baf[_0xbb10('0x1c')]||0x0);return db[_0xbb10('0x84')][_0xbb10('0x30')](_0x4258fc['toString'](),{'type':db[_0xbb10('0x84')]['QueryTypes'][_0xbb10('0x86')]})[_0xbb10('0x25')](function(_0xda122){if(!_0xda122[_0xbb10('0x35')]){_0x28cc46=0x0;}else{_0x28cc46=_0xda122[0x0][_0xbb10('0x40')]||0x0;}return db[_0xbb10('0x84')][_0xbb10('0x30')](_0x412fbf[_0xbb10('0x83')](),{'type':db[_0xbb10('0x84')][_0xbb10('0x85')][_0xbb10('0x86')]});})[_0xbb10('0x25')](function(_0x589565){return{'rows':_0x589565||[],'count':_0x28cc46};});}});}exports[_0xbb10('0xa4')]=function(_0x516520,_0xe70161){return runReport(_0x516520[_0xbb10('0x45')],_0x516520[_0xbb10('0x30')],_0x516520[_0xbb10('0x3f')])[_0xbb10('0x25')](respondWithResult(_0xe70161,null))[_0xbb10('0x49')](handleError(_0xe70161,null));};exports[_0xbb10('0xa5')]=runReport;exports['query']=function(_0x350657,_0x5ca9a0){var _0x51063a=0xa;var _0x1513e0=[_0xbb10('0x54'),_0xbb10('0x55'),_0xbb10('0x56'),_0xbb10('0x57')];var _0x16b8c1={'SUM':'SUM(%s)','COUNT':_0xbb10('0x58'),'COUNT DISTINCT':_0xbb10('0x59'),'MAX':_0xbb10('0x5a'),'MIN':_0xbb10('0x5b'),'AVG':_0xbb10('0x5c'),'GROUP_CONCAT':_0xbb10('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xbb10('0x5f')};var _0x4093a4={'SEC_TO_TIME':_0xbb10('0x60'),'DATE':_0xbb10('0x61'),'HOUR':_0xbb10('0x62'),'ROUND':_0xbb10('0x63'),'UNIX_TIMESTAMP':_0xbb10('0x88')};var _0x5e405b=function(_0x33a43e){return!_['includes']([_0xbb10('0x65'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xbb10('0x8a')],_0x33a43e);};var _0x225064=function(_0x24edcb){if(!_0x24edcb||!_0x24edcb[_0xbb10('0x67')][_0xbb10('0x35')]){return'';}for(var _0x4b3fc7='(',_0xa42b80=0x0;_0xa42b80<_0x24edcb['rules']['length'];_0xa42b80+=0x1){_0xa42b80>0x0&&(_0x4b3fc7+='\x20'+_0x24edcb['operator']+'\x20');_0x4b3fc7+=_0x24edcb[_0xbb10('0x67')][_0xa42b80][_0xbb10('0x80')]?_0x225064(_0x24edcb[_0xbb10('0x67')][_0xa42b80][_0xbb10('0x80')]):_0x24edcb[_0xbb10('0x67')][_0xa42b80]['field']+'\x20'+_0x24edcb[_0xbb10('0x67')][_0xa42b80][_0xbb10('0x8b')]+(_0x5e405b(_0x24edcb[_0xbb10('0x67')][_0xa42b80][_0xbb10('0x8b')])?'\x20'+_0x24edcb[_0xbb10('0x67')][_0xa42b80][_0xbb10('0x69')]:'');}return _0x4b3fc7+')';};var _0x2ef6ee={'where':{'id':_0x350657[_0xbb10('0x45')]['id']}},_0x485c1a,_0x4c95c2,_0x584a62,_0x386eac,_0x1581ef;_0x2ef6ee=_[_0xbb10('0x3c')]({},_0x2ef6ee,_0x350657[_0xbb10('0x3f')]);return db[_0xbb10('0x2e')][_0xbb10('0x48')](_0x2ef6ee)[_0xbb10('0x25')](function(_0x340d70){if(_0x340d70){_0x485c1a=_0x340d70;return _0x340d70[_0xbb10('0x6a')]();}return null;})['then'](function(_0x58295f){if(_0x58295f){if(!_0x58295f['length']){throw new db[(_0xbb10('0x6b'))][(_0xbb10('0xa6'))](_0xbb10('0x6c'),0x193);}_0x4c95c2=_0x58295f;return db['AnalyticMetric'][_0xbb10('0x42')]({'raw':!![]});}return null;})[_0xbb10('0x25')](function(_0x2c638d){if(_0x2c638d){_0x584a62=_[_0xbb10('0x6e')](_0x2c638d,'id');var _0x2a6589;var _0x11279d=squel['select']();_0x11279d['from'](_0x485c1a[_0xbb10('0x70')]);for(var _0x48889b=0x0;_0x48889b<_0x4c95c2[_0xbb10('0x35')];_0x48889b+=0x1){_0x2a6589=_0x4c95c2[_0x48889b][_0xbb10('0x71')]?_0x584a62[_0x4c95c2[_0x48889b][_0xbb10('0x71')]][_0xbb10('0x72')]:_0x4c95c2[_0x48889b][_0xbb10('0x3e')];_0x2a6589=_0x4c95c2[_0x48889b][_0xbb10('0x8d')]?_[_0xbb10('0x74')](_0x16b8c1[_0x4c95c2[_0x48889b][_0xbb10('0x8d')]],'%s',_0x2a6589):_0x2a6589;_0x2a6589=_0x4c95c2[_0x48889b][_0xbb10('0x73')]?_[_0xbb10('0x74')](_0x4093a4[_0x4c95c2[_0x48889b]['format']],'%s',_0x2a6589):_0x2a6589;if(_0x4c95c2[_0x48889b][_0xbb10('0xa7')]){_0x11279d['group'](_0x2a6589);}_0x4c95c2[_0x48889b][_0xbb10('0x75')]&&_0x11279d['order'](_0x2a6589,_0x4c95c2[_0x48889b][_0xbb10('0x75')]===_0xbb10('0x76')?![]:!![]);_0x11279d[_0xbb10('0x3e')](_0x2a6589,_0x4c95c2[_0x48889b][_0xbb10('0x77')]||_0x2a6589);}if(_0x485c1a['joins']){_0x485c1a[_0xbb10('0x78')]=JSON['parse'](_0x485c1a[_0xbb10('0x78')]);for(var _0x1b6b9f=0x0;_0x1b6b9f<_0x485c1a[_0xbb10('0x78')]['length'];_0x1b6b9f+=0x1){if(_0x485c1a[_0xbb10('0x78')][_0x1b6b9f][_0xbb10('0x7a')]&&_[_0xbb10('0x64')](_0x1513e0,_0x485c1a[_0xbb10('0x78')][_0x1b6b9f][_0xbb10('0x7a')])&&_0x485c1a[_0xbb10('0x78')][_0x1b6b9f]['parentKey']&&_0x485c1a['joins'][_0x1b6b9f]['foreignTable']&&_0x485c1a[_0xbb10('0x78')][_0x1b6b9f]['foreignKey']){_0x11279d[_0x485c1a[_0xbb10('0x78')][_0x1b6b9f]['type']](_0x485c1a[_0xbb10('0x78')][_0x1b6b9f][_0xbb10('0x7c')],null,util[_0xbb10('0x73')]('%s.%s\x20=\x20%s.%s',_0x485c1a['table'],_0x485c1a[_0xbb10('0x78')][_0x1b6b9f][_0xbb10('0x7b')],_0x485c1a[_0xbb10('0x78')][_0x1b6b9f]['foreignTable'],_0x485c1a[_0xbb10('0x78')][_0x1b6b9f][_0xbb10('0x7e')]));}}}if(_0x485c1a[_0xbb10('0x7f')]){_0x485c1a['conditions']=JSON['parse'](_0x485c1a['conditions']);_0x11279d[_0xbb10('0x3a')](_0x225064(_0x485c1a['conditions'][_0xbb10('0x80')]));}_0x1581ef=_0x11279d[_0xbb10('0x81')]();_0x11279d[_0xbb10('0x1d')](_0x51063a);_0x11279d[_0xbb10('0x1c')](0x0);logger[_0xbb10('0x8e')](_0xbb10('0x82'),_0x11279d[_0xbb10('0x83')]());return db[_0xbb10('0x84')][_0xbb10('0x30')](_0x11279d[_0xbb10('0x83')](),{'type':db[_0xbb10('0x84')]['QueryTypes'][_0xbb10('0x86')]});}})[_0xbb10('0x25')](function(){return{'sql':_0x1581ef['toString']()};})[_0xbb10('0x25')](respondWithResult(_0x5ca9a0,null))['catch'](handleError(_0x5ca9a0,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index cb56c9a..61a2f7d 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d11=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x9d11,0x17a));var _0x19d1=function(_0x1d94d1,_0x347bb8){_0x1d94d1=_0x1d94d1-0x0;var _0x23c397=_0x9d11[_0x1d94d1];return _0x23c397;};'use strict';var _=require(_0x19d1('0x0'));var util=require('util');var logger=require(_0x19d1('0x1'))(_0x19d1('0x2'));var moment=require('moment');var BPromise=require(_0x19d1('0x3'));var rp=require(_0x19d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x19d1('0x5'));var config=require(_0x19d1('0x6'));var attributes=require(_0x19d1('0x7'));module[_0x19d1('0x8')]=function(_0x557ac0,_0x31ad2d){return _0x557ac0[_0x19d1('0x9')](_0x19d1('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb30f=['path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','moment','request-promise'];(function(_0x58a239,_0x4b5d29){var _0x3ba432=function(_0xda4381){while(--_0xda4381){_0x58a239['push'](_0x58a239['shift']());}};_0x3ba432(++_0x4b5d29);}(_0xb30f,0x163));var _0xfb30=function(_0x5ea913,_0x2c71d2){_0x5ea913=_0x5ea913-0x0;var _0x5ddefe=_0xb30f[_0x5ea913];return _0x5ddefe;};'use strict';var _=require(_0xfb30('0x0'));var util=require(_0xfb30('0x1'));var logger=require(_0xfb30('0x2'))('api');var moment=require(_0xfb30('0x3'));var BPromise=require('bluebird');var rp=require(_0xfb30('0x4'));var fs=require('fs');var path=require(_0xfb30('0x5'));var rimraf=require(_0xfb30('0x6'));var config=require(_0xfb30('0x7'));var attributes=require(_0xfb30('0x8'));module[_0xfb30('0x9')]=function(_0x7d2342,_0x45a641){return _0x7d2342[_0xfb30('0xa')](_0xfb30('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 490ce3b..0f56348 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5c0=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x16b277,_0x8d5656){var _0x2f5e8c=function(_0x381269){while(--_0x381269){_0x16b277['push'](_0x16b277['shift']());}};_0x2f5e8c(++_0x8d5656);}(_0xc5c0,0x6c));var _0x0c5c=function(_0x59333a,_0x1d1be){_0x59333a=_0x59333a-0x0;var _0x1cf2e2=_0xc5c0[_0x59333a];return _0x1cf2e2;};'use strict';var _=require(_0x0c5c('0x0'));var util=require(_0x0c5c('0x1'));var moment=require(_0x0c5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c5c('0x3'));var db=require(_0x0c5c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c5c('0x5'))(_0x0c5c('0x6'));var config=require(_0x0c5c('0x7'));var jayson=require(_0x0c5c('0x8'));var client=jayson[_0x0c5c('0x9')][_0x0c5c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x465ff0,_0x58e41c,_0x1709fd){return new BPromise(function(_0x1d1386,_0x52592e){return client[_0x0c5c('0xb')](_0x465ff0,_0x1709fd)[_0x0c5c('0xc')](function(_0x4145aa){logger[_0x0c5c('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x58e41c,_0x0c5c('0xe'));logger[_0x0c5c('0xf')](_0x0c5c('0x10'),_0x58e41c,_0x0c5c('0xe'),JSON[_0x0c5c('0x11')](_0x4145aa));if(_0x4145aa['error']){if(_0x4145aa[_0x0c5c('0x12')]['code']===0x1f4){logger[_0x0c5c('0x12')](_0x0c5c('0x13'),_0x58e41c,_0x4145aa[_0x0c5c('0x12')][_0x0c5c('0x14')]);return _0x52592e(_0x4145aa[_0x0c5c('0x12')][_0x0c5c('0x14')]);}logger[_0x0c5c('0x12')](_0x0c5c('0x13'),_0x58e41c,_0x4145aa[_0x0c5c('0x12')][_0x0c5c('0x14')]);return _0x1d1386(_0x4145aa['error'][_0x0c5c('0x14')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x58e41c,_0x0c5c('0xe'));_0x1d1386(_0x4145aa[_0x0c5c('0x15')]['message']);}})[_0x0c5c('0x16')](function(_0x5c0be8){logger[_0x0c5c('0x12')](_0x0c5c('0x13'),_0x58e41c,_0x5c0be8);_0x52592e(_0x5c0be8);});});} \ No newline at end of file +var _0x34ab=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result'];(function(_0x6eb02d,_0x20bdf5){var _0xb756de=function(_0x18fef2){while(--_0x18fef2){_0x6eb02d['push'](_0x6eb02d['shift']());}};_0xb756de(++_0x20bdf5);}(_0x34ab,0x169));var _0xb34a=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x34ab[_0x207a02];return _0xd995c3;};'use strict';var _=require(_0xb34a('0x0'));var util=require(_0xb34a('0x1'));var moment=require(_0xb34a('0x2'));var BPromise=require(_0xb34a('0x3'));var rs=require(_0xb34a('0x4'));var fs=require('fs');var Redis=require(_0xb34a('0x5'));var db=require(_0xb34a('0x6'))['db'];var utils=require(_0xb34a('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xb34a('0x8'));var jayson=require(_0xb34a('0x9'));var client=jayson[_0xb34a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b8d3e,_0x492c6d,_0x14c0d2){return new BPromise(function(_0xb915fb,_0x3afc6d){return client[_0xb34a('0xb')](_0x2b8d3e,_0x14c0d2)[_0xb34a('0xc')](function(_0x286281){logger[_0xb34a('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x492c6d,_0xb34a('0xe'));logger[_0xb34a('0xf')](_0xb34a('0x10'),_0x492c6d,'request\x20sent',JSON[_0xb34a('0x11')](_0x286281));if(_0x286281[_0xb34a('0x12')]){if(_0x286281[_0xb34a('0x12')][_0xb34a('0x13')]===0x1f4){logger[_0xb34a('0x12')](_0xb34a('0x14'),_0x492c6d,_0x286281['error']['message']);return _0x3afc6d(_0x286281['error']['message']);}logger[_0xb34a('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x492c6d,_0x286281['error'][_0xb34a('0x15')]);return _0xb915fb(_0x286281[_0xb34a('0x12')][_0xb34a('0x15')]);}else{logger['info'](_0xb34a('0x14'),_0x492c6d,_0xb34a('0xe'));_0xb915fb(_0x286281[_0xb34a('0x16')]['message']);}})[_0xb34a('0x17')](function(_0x4f4abe){logger[_0xb34a('0x12')](_0xb34a('0x14'),_0x492c6d,_0x4f4abe);_0x3afc6d(_0x4f4abe);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 5be775a..739deb6 100644 --- a/server/api/analyticDefaultReport/index.js +++ b/server/api/analyticDefaultReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a4b=['run','post','create','update','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','preview'];(function(_0xef4cf0,_0x16c9c3){var _0x497ad2=function(_0xce63d4){while(--_0xce63d4){_0xef4cf0['push'](_0xef4cf0['shift']());}};_0x497ad2(++_0x16c9c3);}(_0x9a4b,0x1b5));var _0xb9a4=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0x9a4b[_0x37cc52];return _0x2b4a90;};'use strict';var multer=require('multer');var util=require(_0xb9a4('0x0'));var path=require(_0xb9a4('0x1'));var timeout=require(_0xb9a4('0x2'));var express=require(_0xb9a4('0x3'));var router=express[_0xb9a4('0x4')]();var auth=require(_0xb9a4('0x5'));var interaction=require(_0xb9a4('0x6'));var config=require('../../config/environment');var controller=require(_0xb9a4('0x7'));router[_0xb9a4('0x8')]('/',auth[_0xb9a4('0x9')](),controller[_0xb9a4('0xa')]);router[_0xb9a4('0x8')](_0xb9a4('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb9a4('0x8')]('/:id/preview',auth['isAuthenticated'](),controller[_0xb9a4('0xc')]);router[_0xb9a4('0x8')]('/:id/run',auth[_0xb9a4('0x9')](),controller[_0xb9a4('0xd')]);router['get']('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0xb9a4('0xe')]('/',auth[_0xb9a4('0x9')](),controller[_0xb9a4('0xf')]);router['put']('/:id',auth[_0xb9a4('0x9')](),controller[_0xb9a4('0x10')]);router['delete'](_0xb9a4('0xb'),auth['isAuthenticated'](),controller[_0xb9a4('0x11')]);module['exports']=router; \ No newline at end of file +var _0x377a=['/:id','isAuthenticated','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index'];(function(_0x4a4676,_0x4adc31){var _0x3d5ce3=function(_0x58306e){while(--_0x58306e){_0x4a4676['push'](_0x4a4676['shift']());}};_0x3d5ce3(++_0x4adc31);}(_0x377a,0x1e2));var _0xa377=function(_0x3299d1,_0x545733){_0x3299d1=_0x3299d1-0x0;var _0x44356e=_0x377a[_0x3299d1];return _0x44356e;};'use strict';var multer=require(_0xa377('0x0'));var util=require(_0xa377('0x1'));var path=require(_0xa377('0x2'));var timeout=require(_0xa377('0x3'));var express=require(_0xa377('0x4'));var router=express[_0xa377('0x5')]();var auth=require(_0xa377('0x6'));var interaction=require(_0xa377('0x7'));var config=require(_0xa377('0x8'));var controller=require(_0xa377('0x9'));router[_0xa377('0xa')]('/',auth['isAuthenticated'](),controller[_0xa377('0xb')]);router[_0xa377('0xa')](_0xa377('0xc'),auth[_0xa377('0xd')](),controller['show']);router[_0xa377('0xa')](_0xa377('0xe'),auth['isAuthenticated'](),controller[_0xa377('0xf')]);router['get'](_0xa377('0x10'),auth[_0xa377('0xd')](),controller[_0xa377('0x11')]);router['get'](_0xa377('0x12'),auth[_0xa377('0xd')](),controller[_0xa377('0x13')]);router['post']('/',auth[_0xa377('0xd')](),controller[_0xa377('0x14')]);router[_0xa377('0x15')](_0xa377('0xc'),auth[_0xa377('0xd')](),controller[_0xa377('0x16')]);router[_0xa377('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xa377('0x18')]);module[_0xa377('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index abc9624..a0adb0a 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa136=['INTEGER','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE','Loading','ENUM','manual'];(function(_0x1c86f4,_0x20d870){var _0xf20c5d=function(_0x5032f8){while(--_0x5032f8){_0x1c86f4['push'](_0x1c86f4['shift']());}};_0xf20c5d(++_0x20d870);}(_0xa136,0x199));var _0x6a13=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0xa136[_0x3a6e4b];return _0x36572d;};'use strict';var Sequelize=require(_0x6a13('0x0'));var moment=require(_0x6a13('0x1'));module[_0x6a13('0x2')]={'name':{'type':Sequelize[_0x6a13('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x6a13('0x4'),_0x6a13('0x5'),_0x6a13('0x6')),'allowNull':![],'defaultValue':_0x6a13('0x4')},'savename':{'type':Sequelize[_0x6a13('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6a13('0x7')]},'endDate':{'type':Sequelize[_0x6a13('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x6a13('0x8')},'type':{'type':Sequelize[_0x6a13('0x9')](_0x6a13('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0x6a13('0xa')},'reportId':{'type':Sequelize[_0x6a13('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x6a13('0x3')]}}; \ No newline at end of file +var _0x99ac=['UNSIGNED','sequelize','moment','STRING','ENUM','csv','xlsx','DATE','Loading','manual','scheduled'];(function(_0x9f7a51,_0x37d9ef){var _0x4e48d7=function(_0x31c337){while(--_0x31c337){_0x9f7a51['push'](_0x9f7a51['shift']());}};_0x4e48d7(++_0x37d9ef);}(_0x99ac,0x85));var _0xc99a=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x99ac[_0x17928f];return _0x500b63;};'use strict';var Sequelize=require(_0xc99a('0x0'));var moment=require(_0xc99a('0x1'));module['exports']={'name':{'type':Sequelize[_0xc99a('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xc99a('0x3')](_0xc99a('0x4'),'pdf',_0xc99a('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xc99a('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc99a('0x6')]},'endDate':{'type':Sequelize[_0xc99a('0x6')]},'status':{'type':Sequelize[_0xc99a('0x2')],'defaultValue':_0xc99a('0x7')},'type':{'type':Sequelize[_0xc99a('0x3')](_0xc99a('0x8'),_0xc99a('0x9')),'allowNull':![],'defaultValue':_0xc99a('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xc99a('0xa')]},'reportType':{'type':Sequelize[_0xc99a('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index e20cdd3..435df97 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c5a=['end','json','count','offset','set','apply','reject','update','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','index','AnalyticExtractedReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','html-pdf','eml-format','fast-json-patch','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x598684,_0x51a385){var _0x3c8adb=function(_0x435c4f){while(--_0x435c4f){_0x598684['push'](_0x598684['shift']());}};_0x3c8adb(++_0x51a385);}(_0x7c5a,0xa5));var _0xa7c5=function(_0x1bad8a,_0x4a160f){_0x1bad8a=_0x1bad8a-0x0;var _0xfa3b6b=_0x7c5a[_0x1bad8a];return _0xfa3b6b;};'use strict';var pdf=require(_0xa7c5('0x0'));var emlformat=require(_0xa7c5('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa7c5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa7c5('0x3'));var path=require(_0xa7c5('0x4'));var sox=require(_0xa7c5('0x5'));var csv=require(_0xa7c5('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa7c5('0x7'));var squel=require(_0xa7c5('0x8'));var crypto=require(_0xa7c5('0x9'));var jsforce=require(_0xa7c5('0xa'));var deskjs=require(_0xa7c5('0xb'));var toCsv=require(_0xa7c5('0x6'));var querystring=require('querystring');var Papa=require(_0xa7c5('0xc'));var Redis=require(_0xa7c5('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa7c5('0xe'));var hardwareService=require(_0xa7c5('0xf'));var logger=require(_0xa7c5('0x10'))(_0xa7c5('0x11'));var utils=require(_0xa7c5('0x12'));var config=require(_0xa7c5('0x13'));var db=require(_0xa7c5('0x14'))['db'];function respondWithStatusCode(_0x157a32,_0x396faa){_0x396faa=_0x396faa||0xcc;return function(_0x302f4d){if(_0x302f4d){return _0x157a32[_0xa7c5('0x15')](_0x396faa);}return _0x157a32[_0xa7c5('0x16')](_0x396faa)[_0xa7c5('0x17')]();};}function respondWithResult(_0x26adfd,_0x49a85f){_0x49a85f=_0x49a85f||0xc8;return function(_0x11f188){if(_0x11f188){return _0x26adfd[_0xa7c5('0x16')](_0x49a85f)[_0xa7c5('0x18')](_0x11f188);}};}function respondWithFilteredResult(_0x58b71c,_0x34f3e3){return function(_0x4c9fd8){if(_0x4c9fd8){var _0x365d2d=_0x4c9fd8[_0xa7c5('0x19')],_0x599d55=_0x34f3e3[_0xa7c5('0x1a')],_0xb35dd9=_0x34f3e3[_0xa7c5('0x1a')]+_0x34f3e3['limit'],_0x628eee;if(_0xb35dd9>=_0x365d2d){_0xb35dd9=_0x365d2d;_0x628eee=0xc8;}else{_0x628eee=0xce;}_0x58b71c['status'](_0x628eee);return _0x58b71c[_0xa7c5('0x1b')]('Content-Range',_0x599d55+'-'+_0xb35dd9+'/'+_0x365d2d)[_0xa7c5('0x18')](_0x4c9fd8);}return null;};}function patchUpdates(_0x230198){return function(_0x31e60d){try{jsonpatch[_0xa7c5('0x1c')](_0x31e60d,_0x230198,!![]);}catch(_0xb70b38){return BPromise[_0xa7c5('0x1d')](_0xb70b38);}return _0x31e60d['save']();};}function saveUpdates(_0x10cb86,_0x63df3d){return function(_0x1a4250){if(_0x1a4250){return _0x1a4250[_0xa7c5('0x1e')](_0x10cb86)[_0xa7c5('0x1f')](function(_0x37ef83){return _0x37ef83;});}return null;};}function removeEntity(_0x7a532f,_0x406b2e){return function(_0x314c96){if(_0x314c96){return _0x314c96[_0xa7c5('0x20')]()['then'](function(){var _0x4acc7e=_0x314c96['get']({'plain':!![]});var _0x517b08=_0xa7c5('0x21');return db[_0xa7c5('0x22')][_0xa7c5('0x20')]({'where':{'type':_0x517b08,'resourceId':_0x4acc7e['id']}})['then'](function(){return _0x314c96;});})[_0xa7c5('0x1f')](function(){_0x7a532f['status'](0xcc)[_0xa7c5('0x17')]();});}};}function handleEntityNotFound(_0x5a070d,_0x54fe5f){return function(_0x189af6){if(!_0x189af6){_0x5a070d[_0xa7c5('0x15')](0x194);}return _0x189af6;};}function handleError(_0x5c9376,_0x103386){_0x103386=_0x103386||0x1f4;return function(_0x4b0795){logger[_0xa7c5('0x23')](_0x4b0795[_0xa7c5('0x24')]);if(_0x4b0795[_0xa7c5('0x25')]){delete _0x4b0795[_0xa7c5('0x25')];}_0x5c9376[_0xa7c5('0x16')](_0x103386)['send'](_0x4b0795);};}exports[_0xa7c5('0x26')]=function(_0x231429,_0x5345a5){var _0x3859d1={},_0x58210b={},_0x5ba5f6={'count':0x0,'rows':[]};var _0x247dfb=db[_0xa7c5('0x27')][_0xa7c5('0x28')];_0x58210b[_0xa7c5('0x29')]=_[_0xa7c5('0x2a')](_0x247dfb);_0x58210b[_0xa7c5('0x2b')]=_['keys'](_0x231429['query']);_0x58210b['filters']=_[_0xa7c5('0x2c')](_0x58210b[_0xa7c5('0x29')],_0x58210b['query']);_0x3859d1[_0xa7c5('0x2d')]=_['intersection'](_0x58210b[_0xa7c5('0x29')],qs['fields'](_0x231429[_0xa7c5('0x2b')][_0xa7c5('0x2e')]));_0x3859d1[_0xa7c5('0x2d')]=_0x3859d1[_0xa7c5('0x2d')][_0xa7c5('0x2f')]?_0x3859d1[_0xa7c5('0x2d')]:_0x58210b[_0xa7c5('0x29')];if(!_0x231429[_0xa7c5('0x2b')][_0xa7c5('0x30')](_0xa7c5('0x31'))){_0x3859d1[_0xa7c5('0x32')]=qs[_0xa7c5('0x32')](_0x231429[_0xa7c5('0x2b')]['limit']);_0x3859d1[_0xa7c5('0x1a')]=qs[_0xa7c5('0x1a')](_0x231429[_0xa7c5('0x2b')]['offset']);}_0x3859d1[_0xa7c5('0x33')]=qs[_0xa7c5('0x34')](_0x231429[_0xa7c5('0x2b')]['sort']);_0x3859d1[_0xa7c5('0x35')]=qs[_0xa7c5('0x36')](_[_0xa7c5('0x37')](_0x231429[_0xa7c5('0x2b')],_0x58210b[_0xa7c5('0x36')]));if(_0x231429[_0xa7c5('0x2b')][_0xa7c5('0x38')]){_0x3859d1[_0xa7c5('0x35')]=_[_0xa7c5('0x39')](_0x3859d1[_0xa7c5('0x35')],{'$or':_[_0xa7c5('0x3a')](_0x247dfb,function(_0x1d76dc){if(_0x1d76dc[_0xa7c5('0x3b')][_0xa7c5('0x3c')]!==_0xa7c5('0x3d')){var _0xcabab1={};_0xcabab1[_0x1d76dc[_0xa7c5('0x3e')]]={'$like':'%'+_0x231429[_0xa7c5('0x2b')][_0xa7c5('0x38')]+'%'};return _0xcabab1;}})});}_0x3859d1=_[_0xa7c5('0x39')]({},_0x3859d1,_0x231429[_0xa7c5('0x3f')]);var _0x345c4f={'where':_0x3859d1[_0xa7c5('0x35')]};return db['AnalyticExtractedReport'][_0xa7c5('0x19')](_0x345c4f)[_0xa7c5('0x1f')](function(_0x42696a){_0x5ba5f6[_0xa7c5('0x19')]=_0x42696a;if(_0x231429[_0xa7c5('0x2b')][_0xa7c5('0x40')]){_0x3859d1[_0xa7c5('0x41')]=[{'all':!![]}];}return db[_0xa7c5('0x27')]['findAll'](_0x3859d1);})[_0xa7c5('0x1f')](function(_0xdf5341){_0x5ba5f6[_0xa7c5('0x42')]=_0xdf5341;return _0x5ba5f6;})['then'](respondWithFilteredResult(_0x5345a5,_0x3859d1))[_0xa7c5('0x43')](handleError(_0x5345a5,null));};exports[_0xa7c5('0x44')]=function(_0x172ab6,_0x3350be){var _0x566729={'raw':!![],'where':{'id':_0x172ab6[_0xa7c5('0x45')]['id']}},_0x3081e7={};_0x3081e7[_0xa7c5('0x29')]=_[_0xa7c5('0x2a')](db[_0xa7c5('0x27')]['rawAttributes']);_0x3081e7['query']=_[_0xa7c5('0x2a')](_0x172ab6[_0xa7c5('0x2b')]);_0x3081e7['filters']=_[_0xa7c5('0x2c')](_0x3081e7[_0xa7c5('0x29')],_0x3081e7[_0xa7c5('0x2b')]);_0x566729[_0xa7c5('0x2d')]=_[_0xa7c5('0x2c')](_0x3081e7[_0xa7c5('0x29')],qs[_0xa7c5('0x2e')](_0x172ab6[_0xa7c5('0x2b')][_0xa7c5('0x2e')]));_0x566729[_0xa7c5('0x2d')]=_0x566729[_0xa7c5('0x2d')][_0xa7c5('0x2f')]?_0x566729[_0xa7c5('0x2d')]:_0x3081e7['model'];if(_0x172ab6[_0xa7c5('0x2b')][_0xa7c5('0x40')]){_0x566729[_0xa7c5('0x41')]=[{'all':!![]}];}_0x566729=_['merge']({},_0x566729,_0x172ab6['options']);return db['AnalyticExtractedReport'][_0xa7c5('0x46')](_0x566729)['then'](handleEntityNotFound(_0x3350be,null))['then'](respondWithResult(_0x3350be,null))[_0xa7c5('0x43')](handleError(_0x3350be,null));};exports[_0xa7c5('0x47')]=function(_0x293350,_0x57500a){return db[_0xa7c5('0x27')][_0xa7c5('0x47')](_0x293350[_0xa7c5('0x48')],{})[_0xa7c5('0x1f')](function(_0x1c3dfa){var _0x3158a3=_0x293350[_0xa7c5('0x49')][_0xa7c5('0x4a')]({'plain':!![]});if(!_0x3158a3)throw new Error(_0xa7c5('0x4b'));if(_0x3158a3[_0xa7c5('0x4c')]===_0xa7c5('0x49')){var _0x46a796=_0x1c3dfa['get']({'plain':!![]});var _0x44d7e3=_0xa7c5('0x21');return db[_0xa7c5('0x4d')][_0xa7c5('0x46')]({'where':{'name':_0x44d7e3,'userProfileId':_0x3158a3[_0xa7c5('0x4e')]},'raw':!![]})[_0xa7c5('0x1f')](function(_0x5e52cd){if(_0x5e52cd&&_0x5e52cd[_0xa7c5('0x4f')]===0x0){return db[_0xa7c5('0x22')][_0xa7c5('0x47')]({'name':_0x46a796[_0xa7c5('0x25')],'resourceId':_0x46a796['id'],'type':_0x5e52cd[_0xa7c5('0x25')],'sectionId':_0x5e52cd['id']},{})['then'](function(){return _0x1c3dfa;});}else{return _0x1c3dfa;}})['catch'](function(_0x1ad51f){logger['error'](_0xa7c5('0x50'),_0x1ad51f);throw _0x1ad51f;});}return _0x1c3dfa;})['then'](respondWithResult(_0x57500a,0xc9))['catch'](handleError(_0x57500a,null));};exports[_0xa7c5('0x1e')]=function(_0x47f656,_0x19774f){if(_0x47f656[_0xa7c5('0x48')]['id']){delete _0x47f656[_0xa7c5('0x48')]['id'];}return db[_0xa7c5('0x27')][_0xa7c5('0x46')]({'where':{'id':_0x47f656[_0xa7c5('0x45')]['id']}})['then'](handleEntityNotFound(_0x19774f,null))['then'](saveUpdates(_0x47f656[_0xa7c5('0x48')],null))['then'](respondWithResult(_0x19774f,null))['catch'](handleError(_0x19774f,null));};exports[_0xa7c5('0x20')]=function(_0x2c83cb,_0x5cfe68){return db[_0xa7c5('0x27')][_0xa7c5('0x46')]({'where':{'id':_0x2c83cb[_0xa7c5('0x45')]['id']}})[_0xa7c5('0x1f')](handleEntityNotFound(_0x5cfe68,null))[_0xa7c5('0x1f')](removeEntity(_0x5cfe68,null))[_0xa7c5('0x43')](handleError(_0x5cfe68,null));};exports[_0xa7c5('0x51')]=function(_0x590b2e,_0x5d38e2,_0x2b79f7){return db['AnalyticExtractedReport'][_0xa7c5('0x46')]({'where':{'id':_0x590b2e['params']['id']},'attributes':[_0xa7c5('0x25'),_0xa7c5('0x52'),_0xa7c5('0x53'),_0xa7c5('0x54')],'raw':!![]})[_0xa7c5('0x1f')](handleEntityNotFound(_0x5d38e2,null))[_0xa7c5('0x1f')](function(_0x1a110a){if(_0x1a110a){if(!fs[_0xa7c5('0x55')](path[_0xa7c5('0x56')](config[_0xa7c5('0x57')],_0xa7c5('0x58'),_0x1a110a[_0xa7c5('0x53')]))){throw new db[(_0xa7c5('0x59'))]['ValidationError'](_0xa7c5('0x5a'));}if(_0x590b2e[_0xa7c5('0x2b')][_0xa7c5('0x5b')]){return _0x5d38e2[_0xa7c5('0x15')](0xc8);}return _0x5d38e2[_0xa7c5('0x51')](path[_0xa7c5('0x56')](config['root'],_0xa7c5('0x58'),_0x1a110a[_0xa7c5('0x53')]),util['format'](_0xa7c5('0x5c'),_0x1a110a['basename']||_0x1a110a[_0xa7c5('0x25')],_0x1a110a[_0xa7c5('0x54')][_0xa7c5('0x5d')]()));}})[_0xa7c5('0x43')](handleError(_0x5d38e2,null));}; \ No newline at end of file +var _0x8bb2=['Content-Range','update','then','get','ExtractedReports','sendStatus','error','stack','name','send','AnalyticExtractedReport','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','type','key','field','options','include','findAll','rows','catch','show','params','includeAll','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set'];(function(_0x36df81,_0x34fc9e){var _0x2ad5a4=function(_0x15261b){while(--_0x15261b){_0x36df81['push'](_0x36df81['shift']());}};_0x2ad5a4(++_0x34fc9e);}(_0x8bb2,0x1bc));var _0x28bb=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x8bb2[_0x5d7227];return _0x15ac55;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x28bb('0x0'));var rimraf=require(_0x28bb('0x1'));var zipdir=require(_0x28bb('0x2'));var jsonpatch=require(_0x28bb('0x3'));var rp=require('request-promise');var moment=require(_0x28bb('0x4'));var BPromise=require(_0x28bb('0x5'));var Mustache=require(_0x28bb('0x6'));var util=require('util');var path=require(_0x28bb('0x7'));var sox=require(_0x28bb('0x8'));var csv=require(_0x28bb('0x9'));var ejs=require(_0x28bb('0xa'));var fs=require('fs');var _=require(_0x28bb('0xb'));var squel=require(_0x28bb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x28bb('0xd'));var toCsv=require(_0x28bb('0x9'));var querystring=require(_0x28bb('0xe'));var Papa=require('papaparse');var Redis=require(_0x28bb('0xf'));var authService=require(_0x28bb('0x10'));var qs=require(_0x28bb('0x11'));var hardwareService=require(_0x28bb('0x12'));var logger=require(_0x28bb('0x13'))(_0x28bb('0x14'));var utils=require(_0x28bb('0x15'));var config=require(_0x28bb('0x16'));var db=require(_0x28bb('0x17'))['db'];function respondWithStatusCode(_0x5dbe0f,_0x5d0d2e){_0x5d0d2e=_0x5d0d2e||0xcc;return function(_0x49935c){if(_0x49935c){return _0x5dbe0f['sendStatus'](_0x5d0d2e);}return _0x5dbe0f[_0x28bb('0x18')](_0x5d0d2e)[_0x28bb('0x19')]();};}function respondWithResult(_0x17857a,_0x3e0f01){_0x3e0f01=_0x3e0f01||0xc8;return function(_0x9e9d7f){if(_0x9e9d7f){return _0x17857a[_0x28bb('0x18')](_0x3e0f01)[_0x28bb('0x1a')](_0x9e9d7f);}};}function respondWithFilteredResult(_0x1af8ba,_0x3e1059){return function(_0x28a9e4){if(_0x28a9e4){var _0x22d9e0=_0x28a9e4[_0x28bb('0x1b')],_0x525d88=_0x3e1059['offset'],_0x14638=_0x3e1059[_0x28bb('0x1c')]+_0x3e1059[_0x28bb('0x1d')],_0x5af5cb;if(_0x14638>=_0x22d9e0){_0x14638=_0x22d9e0;_0x5af5cb=0xc8;}else{_0x5af5cb=0xce;}_0x1af8ba[_0x28bb('0x18')](_0x5af5cb);return _0x1af8ba[_0x28bb('0x1e')](_0x28bb('0x1f'),_0x525d88+'-'+_0x14638+'/'+_0x22d9e0)[_0x28bb('0x1a')](_0x28a9e4);}return null;};}function patchUpdates(_0x4ad044){return function(_0x449b54){try{jsonpatch['apply'](_0x449b54,_0x4ad044,!![]);}catch(_0x2d1c1c){return BPromise['reject'](_0x2d1c1c);}return _0x449b54['save']();};}function saveUpdates(_0x24adf9,_0x69d8a2){return function(_0x1e1c1b){if(_0x1e1c1b){return _0x1e1c1b[_0x28bb('0x20')](_0x24adf9)[_0x28bb('0x21')](function(_0xceb229){return _0xceb229;});}return null;};}function removeEntity(_0x1cc612,_0x2e4475){return function(_0x4e1180){if(_0x4e1180){return _0x4e1180['destroy']()[_0x28bb('0x21')](function(){var _0x356bdd=_0x4e1180[_0x28bb('0x22')]({'plain':!![]});var _0x27ed62=_0x28bb('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x27ed62,'resourceId':_0x356bdd['id']}})[_0x28bb('0x21')](function(){return _0x4e1180;});})[_0x28bb('0x21')](function(){_0x1cc612[_0x28bb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c8259,_0x21ac41){return function(_0x558704){if(!_0x558704){_0x1c8259[_0x28bb('0x24')](0x194);}return _0x558704;};}function handleError(_0x920523,_0x242983){_0x242983=_0x242983||0x1f4;return function(_0x23c273){logger[_0x28bb('0x25')](_0x23c273[_0x28bb('0x26')]);if(_0x23c273[_0x28bb('0x27')]){delete _0x23c273[_0x28bb('0x27')];}_0x920523[_0x28bb('0x18')](_0x242983)[_0x28bb('0x28')](_0x23c273);};}exports['index']=function(_0x3553f4,_0x3292e7){var _0x9a835b={},_0x24e1d5={},_0x383ce7={'count':0x0,'rows':[]};var _0x23e69e=db[_0x28bb('0x29')][_0x28bb('0x2a')];_0x24e1d5['model']=_[_0x28bb('0x2b')](_0x23e69e);_0x24e1d5[_0x28bb('0x2c')]=_[_0x28bb('0x2b')](_0x3553f4['query']);_0x24e1d5['filters']=_[_0x28bb('0x2d')](_0x24e1d5[_0x28bb('0x2e')],_0x24e1d5[_0x28bb('0x2c')]);_0x9a835b['attributes']=_[_0x28bb('0x2d')](_0x24e1d5[_0x28bb('0x2e')],qs[_0x28bb('0x2f')](_0x3553f4['query'][_0x28bb('0x2f')]));_0x9a835b[_0x28bb('0x30')]=_0x9a835b[_0x28bb('0x30')][_0x28bb('0x31')]?_0x9a835b[_0x28bb('0x30')]:_0x24e1d5[_0x28bb('0x2e')];if(!_0x3553f4['query'][_0x28bb('0x32')](_0x28bb('0x33'))){_0x9a835b[_0x28bb('0x1d')]=qs[_0x28bb('0x1d')](_0x3553f4['query']['limit']);_0x9a835b[_0x28bb('0x1c')]=qs[_0x28bb('0x1c')](_0x3553f4[_0x28bb('0x2c')][_0x28bb('0x1c')]);}_0x9a835b['order']=qs[_0x28bb('0x34')](_0x3553f4['query'][_0x28bb('0x34')]);_0x9a835b[_0x28bb('0x35')]=qs[_0x28bb('0x36')](_[_0x28bb('0x37')](_0x3553f4['query'],_0x24e1d5[_0x28bb('0x36')]));if(_0x3553f4[_0x28bb('0x2c')][_0x28bb('0x38')]){_0x9a835b['where']=_['merge'](_0x9a835b['where'],{'$or':_[_0x28bb('0x39')](_0x23e69e,function(_0x5c99ec){if(_0x5c99ec[_0x28bb('0x3a')][_0x28bb('0x3b')]!=='VIRTUAL'){var _0x181c73={};_0x181c73[_0x5c99ec[_0x28bb('0x3c')]]={'$like':'%'+_0x3553f4['query'][_0x28bb('0x38')]+'%'};return _0x181c73;}})});}_0x9a835b=_['merge']({},_0x9a835b,_0x3553f4[_0x28bb('0x3d')]);var _0x51b6a2={'where':_0x9a835b[_0x28bb('0x35')]};return db[_0x28bb('0x29')]['count'](_0x51b6a2)[_0x28bb('0x21')](function(_0x1b51b1){_0x383ce7[_0x28bb('0x1b')]=_0x1b51b1;if(_0x3553f4[_0x28bb('0x2c')]['includeAll']){_0x9a835b[_0x28bb('0x3e')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x28bb('0x3f')](_0x9a835b);})[_0x28bb('0x21')](function(_0x5c9869){_0x383ce7[_0x28bb('0x40')]=_0x5c9869;return _0x383ce7;})[_0x28bb('0x21')](respondWithFilteredResult(_0x3292e7,_0x9a835b))[_0x28bb('0x41')](handleError(_0x3292e7,null));};exports[_0x28bb('0x42')]=function(_0x5b20d0,_0x32a67f){var _0x15a551={'raw':!![],'where':{'id':_0x5b20d0[_0x28bb('0x43')]['id']}},_0x3d5ea8={};_0x3d5ea8[_0x28bb('0x2e')]=_[_0x28bb('0x2b')](db[_0x28bb('0x29')][_0x28bb('0x2a')]);_0x3d5ea8['query']=_[_0x28bb('0x2b')](_0x5b20d0[_0x28bb('0x2c')]);_0x3d5ea8[_0x28bb('0x36')]=_[_0x28bb('0x2d')](_0x3d5ea8[_0x28bb('0x2e')],_0x3d5ea8['query']);_0x15a551['attributes']=_[_0x28bb('0x2d')](_0x3d5ea8[_0x28bb('0x2e')],qs[_0x28bb('0x2f')](_0x5b20d0[_0x28bb('0x2c')]['fields']));_0x15a551[_0x28bb('0x30')]=_0x15a551[_0x28bb('0x30')][_0x28bb('0x31')]?_0x15a551['attributes']:_0x3d5ea8[_0x28bb('0x2e')];if(_0x5b20d0['query'][_0x28bb('0x44')]){_0x15a551[_0x28bb('0x3e')]=[{'all':!![]}];}_0x15a551=_[_0x28bb('0x45')]({},_0x15a551,_0x5b20d0[_0x28bb('0x3d')]);return db[_0x28bb('0x29')][_0x28bb('0x46')](_0x15a551)[_0x28bb('0x21')](handleEntityNotFound(_0x32a67f,null))[_0x28bb('0x21')](respondWithResult(_0x32a67f,null))['catch'](handleError(_0x32a67f,null));};exports[_0x28bb('0x47')]=function(_0x1aaecc,_0x52bb11){return db[_0x28bb('0x29')][_0x28bb('0x47')](_0x1aaecc[_0x28bb('0x48')],{})[_0x28bb('0x21')](function(_0x1c2a89){var _0x3b15bf=_0x1aaecc['user'][_0x28bb('0x22')]({'plain':!![]});if(!_0x3b15bf)throw new Error(_0x28bb('0x49'));if(_0x3b15bf[_0x28bb('0x4a')]==='user'){var _0x726f35=_0x1c2a89['get']({'plain':!![]});var _0x5140a5='ExtractedReports';return db[_0x28bb('0x4b')][_0x28bb('0x46')]({'where':{'name':_0x5140a5,'userProfileId':_0x3b15bf[_0x28bb('0x4c')]},'raw':!![]})[_0x28bb('0x21')](function(_0x2334ac){if(_0x2334ac&&_0x2334ac[_0x28bb('0x4d')]===0x0){return db[_0x28bb('0x4e')][_0x28bb('0x47')]({'name':_0x726f35['name'],'resourceId':_0x726f35['id'],'type':_0x2334ac[_0x28bb('0x27')],'sectionId':_0x2334ac['id']},{})[_0x28bb('0x21')](function(){return _0x1c2a89;});}else{return _0x1c2a89;}})[_0x28bb('0x41')](function(_0x38a699){logger['error'](_0x28bb('0x4f'),_0x38a699);throw _0x38a699;});}return _0x1c2a89;})[_0x28bb('0x21')](respondWithResult(_0x52bb11,0xc9))['catch'](handleError(_0x52bb11,null));};exports['update']=function(_0x1856c3,_0x38abf8){if(_0x1856c3[_0x28bb('0x48')]['id']){delete _0x1856c3[_0x28bb('0x48')]['id'];}return db[_0x28bb('0x29')][_0x28bb('0x46')]({'where':{'id':_0x1856c3[_0x28bb('0x43')]['id']}})[_0x28bb('0x21')](handleEntityNotFound(_0x38abf8,null))[_0x28bb('0x21')](saveUpdates(_0x1856c3[_0x28bb('0x48')],null))[_0x28bb('0x21')](respondWithResult(_0x38abf8,null))['catch'](handleError(_0x38abf8,null));};exports[_0x28bb('0x50')]=function(_0x701afe,_0x351de0){return db[_0x28bb('0x29')]['find']({'where':{'id':_0x701afe['params']['id']}})['then'](handleEntityNotFound(_0x351de0,null))['then'](removeEntity(_0x351de0,null))['catch'](handleError(_0x351de0,null));};exports['download']=function(_0x4ad557,_0x5742fb,_0x1a8811){return db[_0x28bb('0x29')][_0x28bb('0x46')]({'where':{'id':_0x4ad557[_0x28bb('0x43')]['id']},'attributes':[_0x28bb('0x27'),'basename',_0x28bb('0x51'),_0x28bb('0x52')],'raw':!![]})[_0x28bb('0x21')](handleEntityNotFound(_0x5742fb,null))[_0x28bb('0x21')](function(_0x201a6b){if(_0x201a6b){if(!fs[_0x28bb('0x53')](path[_0x28bb('0x54')](config[_0x28bb('0x55')],_0x28bb('0x56'),_0x201a6b[_0x28bb('0x51')]))){throw new db[(_0x28bb('0x57'))][(_0x28bb('0x58'))](_0x28bb('0x59'));}if(_0x4ad557[_0x28bb('0x2c')][_0x28bb('0x5a')]){return _0x5742fb['sendStatus'](0xc8);}return _0x5742fb[_0x28bb('0x5b')](path['join'](config[_0x28bb('0x55')],_0x28bb('0x56'),_0x201a6b[_0x28bb('0x51')]),util['format'](_0x28bb('0x5c'),_0x201a6b[_0x28bb('0x5d')]||_0x201a6b[_0x28bb('0x27')],_0x201a6b[_0x28bb('0x52')][_0x28bb('0x5e')]()));}})[_0x28bb('0x41')](handleError(_0x5742fb,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index ffe25b2..a174351 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc469=['analytics_extracted_reports','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x302f08,_0x2e69ef){var _0xb5a389=function(_0x354962){while(--_0x354962){_0x302f08['push'](_0x302f08['shift']());}};_0xb5a389(++_0x2e69ef);}(_0xc469,0x1eb));var _0x9c46=function(_0x1c5142,_0x30ea72){_0x1c5142=_0x1c5142-0x0;var _0x1268cb=_0xc469[_0x1c5142];return _0x1268cb;};'use strict';var _=require('lodash');var util=require(_0x9c46('0x0'));var logger=require(_0x9c46('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9c46('0x2'));var fs=require('fs');var path=require(_0x9c46('0x3'));var rimraf=require(_0x9c46('0x4'));var config=require(_0x9c46('0x5'));var attributes=require(_0x9c46('0x6'));module[_0x9c46('0x7')]=function(_0x4da3c6,_0x5e03a9){return _0x4da3c6[_0x9c46('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0x9c46('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd30d=['rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x49d352,_0x2fa521){var _0x1fdb44=function(_0x2b3a5e){while(--_0x2b3a5e){_0x49d352['push'](_0x49d352['shift']());}};_0x1fdb44(++_0x2fa521);}(_0xd30d,0x1b6));var _0xdd30=function(_0xfcf5c7,_0x28fc5e){_0xfcf5c7=_0xfcf5c7-0x0;var _0x4ebd54=_0xd30d[_0xfcf5c7];return _0x4ebd54;};'use strict';var _=require(_0xdd30('0x0'));var util=require(_0xdd30('0x1'));var logger=require(_0xdd30('0x2'))('api');var moment=require(_0xdd30('0x3'));var BPromise=require(_0xdd30('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd30('0x5'));var rimraf=require(_0xdd30('0x6'));var config=require(_0xdd30('0x7'));var attributes=require(_0xdd30('0x8'));module[_0xdd30('0x9')]=function(_0x5bc868,_0x1f4f71){return _0x5bc868[_0xdd30('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0xdd30('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 2524c14..f888a2b 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7e5=['client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0xf7e5,0xc7));var _0x5f7e=function(_0x3cfdf5,_0x5e11fe){_0x3cfdf5=_0x3cfdf5-0x0;var _0x1b135a=_0xf7e5[_0x3cfdf5];return _0x1b135a;};'use strict';var _=require(_0x5f7e('0x0'));var util=require('util');var moment=require(_0x5f7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x5f7e('0x2'));var fs=require('fs');var Redis=require(_0x5f7e('0x3'));var db=require(_0x5f7e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f7e('0x5'))(_0x5f7e('0x6'));var config=require('../../config/environment');var jayson=require(_0x5f7e('0x7'));var client=jayson[_0x5f7e('0x8')][_0x5f7e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29da8e,_0x49976f,_0x12e620){return new BPromise(function(_0x49911a,_0x47b6f7){return client[_0x5f7e('0xa')](_0x29da8e,_0x12e620)[_0x5f7e('0xb')](function(_0x156bf6){logger[_0x5f7e('0xc')](_0x5f7e('0xd'),_0x49976f,_0x5f7e('0xe'));logger[_0x5f7e('0xf')](_0x5f7e('0x10'),_0x49976f,_0x5f7e('0xe'),JSON[_0x5f7e('0x11')](_0x156bf6));if(_0x156bf6['error']){if(_0x156bf6[_0x5f7e('0x12')][_0x5f7e('0x13')]===0x1f4){logger[_0x5f7e('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x49976f,_0x156bf6[_0x5f7e('0x12')][_0x5f7e('0x14')]);return _0x47b6f7(_0x156bf6[_0x5f7e('0x12')][_0x5f7e('0x14')]);}logger['error'](_0x5f7e('0xd'),_0x49976f,_0x156bf6['error'][_0x5f7e('0x14')]);return _0x49911a(_0x156bf6[_0x5f7e('0x12')][_0x5f7e('0x14')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x49976f,_0x5f7e('0xe'));_0x49911a(_0x156bf6[_0x5f7e('0x15')][_0x5f7e('0x14')]);}})[_0x5f7e('0x16')](function(_0x25e18f){logger[_0x5f7e('0x12')](_0x5f7e('0xd'),_0x49976f,_0x25e18f);_0x47b6f7(_0x25e18f);});});} \ No newline at end of file +var _0x09a4=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c5a82,_0x544e92){var _0x45d0dd=function(_0x68935d){while(--_0x68935d){_0x4c5a82['push'](_0x4c5a82['shift']());}};_0x45d0dd(++_0x544e92);}(_0x09a4,0x1e3));var _0x409a=function(_0x227e7e,_0x5a2be4){_0x227e7e=_0x227e7e-0x0;var _0x677614=_0x09a4[_0x227e7e];return _0x677614;};'use strict';var _=require('lodash');var util=require(_0x409a('0x0'));var moment=require(_0x409a('0x1'));var BPromise=require('bluebird');var rs=require(_0x409a('0x2'));var fs=require('fs');var Redis=require(_0x409a('0x3'));var db=require(_0x409a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x409a('0x5'))(_0x409a('0x6'));var config=require('../../config/environment');var jayson=require(_0x409a('0x7'));var client=jayson[_0x409a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12a126,_0x4f178b,_0x57f7b6){return new BPromise(function(_0x3a4b81,_0x1f2b65){return client['request'](_0x12a126,_0x57f7b6)[_0x409a('0x9')](function(_0xdf6dc7){logger[_0x409a('0xa')](_0x409a('0xb'),_0x4f178b,_0x409a('0xc'));logger[_0x409a('0xd')](_0x409a('0xe'),_0x4f178b,'request\x20sent',JSON[_0x409a('0xf')](_0xdf6dc7));if(_0xdf6dc7[_0x409a('0x10')]){if(_0xdf6dc7['error']['code']===0x1f4){logger['error'](_0x409a('0xb'),_0x4f178b,_0xdf6dc7['error'][_0x409a('0x11')]);return _0x1f2b65(_0xdf6dc7['error'][_0x409a('0x11')]);}logger['error'](_0x409a('0xb'),_0x4f178b,_0xdf6dc7['error'][_0x409a('0x11')]);return _0x3a4b81(_0xdf6dc7[_0x409a('0x10')][_0x409a('0x11')]);}else{logger[_0x409a('0xa')](_0x409a('0xb'),_0x4f178b,_0x409a('0xc'));_0x3a4b81(_0xdf6dc7[_0x409a('0x12')][_0x409a('0x11')]);}})[_0x409a('0x13')](function(_0x12e8bd){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4f178b,_0x12e8bd);_0x1f2b65(_0x12e8bd);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index d1d4ed4..6dd6706 100644 --- a/server/api/analyticExtractedReport/index.js +++ b/server/api/analyticExtractedReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbab7=['get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./analyticExtractedReport.controller'];(function(_0x3d3ab4,_0x3d5b30){var _0x30bd2a=function(_0x1bdea2){while(--_0x1bdea2){_0x3d3ab4['push'](_0x3d3ab4['shift']());}};_0x30bd2a(++_0x3d5b30);}(_0xbab7,0x19c));var _0x7bab=function(_0x4b75c2,_0x11ba23){_0x4b75c2=_0x4b75c2-0x0;var _0x483241=_0xbab7[_0x4b75c2];return _0x483241;};'use strict';var multer=require(_0x7bab('0x0'));var util=require(_0x7bab('0x1'));var path=require(_0x7bab('0x2'));var timeout=require(_0x7bab('0x3'));var express=require(_0x7bab('0x4'));var router=express[_0x7bab('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7bab('0x6'));var config=require('../../config/environment');var controller=require(_0x7bab('0x7'));router[_0x7bab('0x8')]('/',auth[_0x7bab('0x9')](),controller[_0x7bab('0xa')]);router[_0x7bab('0x8')](_0x7bab('0xb'),auth[_0x7bab('0x9')](),controller['show']);router[_0x7bab('0x8')](_0x7bab('0xc'),auth['isAuthenticated'](),controller[_0x7bab('0xd')]);router[_0x7bab('0xe')]('/',auth[_0x7bab('0x9')](),controller[_0x7bab('0xf')]);router[_0x7bab('0x10')](_0x7bab('0xb'),auth[_0x7bab('0x9')](),controller[_0x7bab('0x11')]);router[_0x7bab('0x12')](_0x7bab('0xb'),auth[_0x7bab('0x9')](),controller[_0x7bab('0x13')]);module[_0x7bab('0x14')]=router; \ No newline at end of file +var _0x9007=['update','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/download','download','post','put','/:id'];(function(_0x37795e,_0x5903f7){var _0x3caad2=function(_0x1d5b37){while(--_0x1d5b37){_0x37795e['push'](_0x37795e['shift']());}};_0x3caad2(++_0x5903f7);}(_0x9007,0xb3));var _0x7900=function(_0x1894e7,_0x1253e6){_0x1894e7=_0x1894e7-0x0;var _0x5e857f=_0x9007[_0x1894e7];return _0x5e857f;};'use strict';var multer=require(_0x7900('0x0'));var util=require('util');var path=require(_0x7900('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7900('0x2')]();var auth=require(_0x7900('0x3'));var interaction=require(_0x7900('0x4'));var config=require(_0x7900('0x5'));var controller=require('./analyticExtractedReport.controller');router[_0x7900('0x6')]('/',auth[_0x7900('0x7')](),controller['index']);router[_0x7900('0x6')]('/:id',auth[_0x7900('0x7')](),controller['show']);router['get'](_0x7900('0x8'),auth[_0x7900('0x7')](),controller[_0x7900('0x9')]);router[_0x7900('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7900('0xb')](_0x7900('0xc'),auth[_0x7900('0x7')](),controller[_0x7900('0xd')]);router['delete'](_0x7900('0xc'),auth[_0x7900('0x7')](),controller[_0x7900('0xe')]);module[_0x7900('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 389baf9..9f77651 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js +++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['exports','TEXT','STRING','BOOLEAN'];(function(_0x286035,_0xe7575d){var _0x4e97fc=function(_0x24a72b){while(--_0x24a72b){_0x286035['push'](_0x286035['shift']());}};_0x4e97fc(++_0xe7575d);}(_0x1261,0x144));var _0x1126=function(_0x168c60,_0x539d96){_0x168c60=_0x168c60-0x0;var _0x29bea4=_0x1261[_0x168c60];return _0x29bea4;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'field':{'type':Sequelize[_0x1126('0x1')]},'alias':{'type':Sequelize[_0x1126('0x2')]},'function':{'type':Sequelize[_0x1126('0x2')]},'format':{'type':Sequelize[_0x1126('0x2')]},'groupBy':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1126('0x2')]},'custom':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x7a54=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x4861dd,_0x5bae15){var _0x36b3b2=function(_0x15e17a){while(--_0x15e17a){_0x4861dd['push'](_0x4861dd['shift']());}};_0x36b3b2(++_0x5bae15);}(_0x7a54,0x106));var _0x47a5=function(_0x43c794,_0x45c7c9){_0x43c794=_0x43c794-0x0;var _0x564957=_0x7a54[_0x43c794];return _0x564957;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'field':{'type':Sequelize[_0x47a5('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x47a5('0x3')]},'format':{'type':Sequelize[_0x47a5('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x47a5('0x3')]},'custom':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index df85c82..e52ea04 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.controller.js +++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c50=['error','name','index','AnalyticFieldReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filter','merge','map','type','key','field','includeAll','include','findAll','rows','catch','show','options','create','body','bulkCreate','find','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','params','CustomReportId','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','set','apply','reject','update','then','destroy'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x2c50,0x1b3));var _0x02c5=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0x2c50[_0x3718b7];return _0xf8c91e;};'use strict';var pdf=require(_0x02c5('0x0'));var emlformat=require(_0x02c5('0x1'));var rimraf=require(_0x02c5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x02c5('0x3'));var rp=require(_0x02c5('0x4'));var moment=require(_0x02c5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x02c5('0x6'));var util=require(_0x02c5('0x7'));var path=require(_0x02c5('0x8'));var sox=require(_0x02c5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x02c5('0xa'));var squel=require(_0x02c5('0xb'));var crypto=require(_0x02c5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x02c5('0xd'));var querystring=require(_0x02c5('0xe'));var Papa=require(_0x02c5('0xf'));var Redis=require('ioredis');var authService=require(_0x02c5('0x10'));var qs=require(_0x02c5('0x11'));var hardwareService=require(_0x02c5('0x12'));var logger=require('../../config/logger')(_0x02c5('0x13'));var utils=require('../../config/utils');var config=require(_0x02c5('0x14'));var db=require(_0x02c5('0x15'))['db'];function respondWithStatusCode(_0x5a1727,_0x21edd7){_0x21edd7=_0x21edd7||0xcc;return function(_0x2ccbfd){if(_0x2ccbfd){return _0x5a1727[_0x02c5('0x16')](_0x21edd7);}return _0x5a1727[_0x02c5('0x17')](_0x21edd7)[_0x02c5('0x18')]();};}function respondWithResult(_0x3fd19e,_0x335cfc){_0x335cfc=_0x335cfc||0xc8;return function(_0x4bb7e2){if(_0x4bb7e2){return _0x3fd19e[_0x02c5('0x17')](_0x335cfc)[_0x02c5('0x19')](_0x4bb7e2);}};}function respondWithFilteredResult(_0x11f4ea,_0x1e76e8){return function(_0x1a3fc7){if(_0x1a3fc7){var _0x4a7232=_0x1a3fc7[_0x02c5('0x1a')],_0xc5c50=_0x1e76e8['offset'],_0x343e11=_0x1e76e8['offset']+_0x1e76e8['limit'],_0x3fd929;if(_0x343e11>=_0x4a7232){_0x343e11=_0x4a7232;_0x3fd929=0xc8;}else{_0x3fd929=0xce;}_0x11f4ea[_0x02c5('0x17')](_0x3fd929);return _0x11f4ea[_0x02c5('0x1b')]('Content-Range',_0xc5c50+'-'+_0x343e11+'/'+_0x4a7232)['json'](_0x1a3fc7);}return null;};}function patchUpdates(_0xa16b65){return function(_0x11a77e){try{jsonpatch[_0x02c5('0x1c')](_0x11a77e,_0xa16b65,!![]);}catch(_0x2cb49f){return BPromise[_0x02c5('0x1d')](_0x2cb49f);}return _0x11a77e['save']();};}function saveUpdates(_0x1f92fc,_0xddb931){return function(_0x6c8335){if(_0x6c8335){return _0x6c8335[_0x02c5('0x1e')](_0x1f92fc)[_0x02c5('0x1f')](function(_0x194272){return _0x194272;});}return null;};}function removeEntity(_0x210781,_0x263709){return function(_0x5b4fa4){if(_0x5b4fa4){return _0x5b4fa4[_0x02c5('0x20')]()[_0x02c5('0x1f')](function(){_0x210781[_0x02c5('0x17')](0xcc)[_0x02c5('0x18')]();});}};}function handleEntityNotFound(_0xfc2041,_0x7f7d06){return function(_0x30d9a0){if(!_0x30d9a0){_0xfc2041[_0x02c5('0x16')](0x194);}return _0x30d9a0;};}function handleError(_0x323a94,_0x470828){_0x470828=_0x470828||0x1f4;return function(_0x40c9b8){logger[_0x02c5('0x21')](_0x40c9b8['stack']);if(_0x40c9b8[_0x02c5('0x22')]){delete _0x40c9b8[_0x02c5('0x22')];}_0x323a94['status'](_0x470828)['send'](_0x40c9b8);};}exports[_0x02c5('0x23')]=function(_0x53a57a,_0x3ff04d){var _0x1110ce={},_0x21002f={},_0x3b7590={'count':0x0,'rows':[]};var _0x2bcfe8=db[_0x02c5('0x24')][_0x02c5('0x25')];_0x21002f['model']=_[_0x02c5('0x26')](_0x2bcfe8);_0x21002f[_0x02c5('0x27')]=_[_0x02c5('0x26')](_0x53a57a[_0x02c5('0x27')]);_0x21002f[_0x02c5('0x28')]=_[_0x02c5('0x29')](_0x21002f[_0x02c5('0x2a')],_0x21002f['query']);_0x1110ce[_0x02c5('0x2b')]=_[_0x02c5('0x29')](_0x21002f[_0x02c5('0x2a')],qs[_0x02c5('0x2c')](_0x53a57a['query'][_0x02c5('0x2c')]));_0x1110ce['attributes']=_0x1110ce[_0x02c5('0x2b')][_0x02c5('0x2d')]?_0x1110ce[_0x02c5('0x2b')]:_0x21002f['model'];if(!_0x53a57a[_0x02c5('0x27')][_0x02c5('0x2e')](_0x02c5('0x2f'))){_0x1110ce[_0x02c5('0x30')]=qs['limit'](_0x53a57a[_0x02c5('0x27')][_0x02c5('0x30')]);_0x1110ce['offset']=qs['offset'](_0x53a57a[_0x02c5('0x27')][_0x02c5('0x31')]);}_0x1110ce[_0x02c5('0x32')]=qs[_0x02c5('0x33')](_0x53a57a['query']['sort']);_0x1110ce[_0x02c5('0x34')]=qs[_0x02c5('0x28')](_['pick'](_0x53a57a['query'],_0x21002f[_0x02c5('0x28')]));if(_0x53a57a['query'][_0x02c5('0x35')]){_0x1110ce[_0x02c5('0x34')]=_[_0x02c5('0x36')](_0x1110ce[_0x02c5('0x34')],{'$or':_[_0x02c5('0x37')](_0x2bcfe8,function(_0x587da1){if(_0x587da1[_0x02c5('0x38')][_0x02c5('0x39')]!=='VIRTUAL'){var _0x36977c={};_0x36977c[_0x587da1[_0x02c5('0x3a')]]={'$like':'%'+_0x53a57a[_0x02c5('0x27')][_0x02c5('0x35')]+'%'};return _0x36977c;}})});}_0x1110ce=_[_0x02c5('0x36')]({},_0x1110ce,_0x53a57a['options']);var _0x1d009a={'where':_0x1110ce[_0x02c5('0x34')]};return db['AnalyticFieldReport'][_0x02c5('0x1a')](_0x1d009a)['then'](function(_0x31951a){_0x3b7590[_0x02c5('0x1a')]=_0x31951a;if(_0x53a57a['query'][_0x02c5('0x3b')]){_0x1110ce[_0x02c5('0x3c')]=[{'all':!![]}];}return db[_0x02c5('0x24')][_0x02c5('0x3d')](_0x1110ce);})['then'](function(_0x9a4a77){_0x3b7590[_0x02c5('0x3e')]=_0x9a4a77;return _0x3b7590;})[_0x02c5('0x1f')](respondWithFilteredResult(_0x3ff04d,_0x1110ce))[_0x02c5('0x3f')](handleError(_0x3ff04d,null));};exports[_0x02c5('0x40')]=function(_0x967e53,_0x3e20b8){var _0x2707b5={'raw':![],'where':{'id':_0x967e53['params']['id']}},_0xef1df6={};_0xef1df6['model']=_[_0x02c5('0x26')](db[_0x02c5('0x24')][_0x02c5('0x25')]);_0xef1df6[_0x02c5('0x27')]=_[_0x02c5('0x26')](_0x967e53['query']);_0xef1df6[_0x02c5('0x28')]=_[_0x02c5('0x29')](_0xef1df6[_0x02c5('0x2a')],_0xef1df6[_0x02c5('0x27')]);_0x2707b5['attributes']=_['intersection'](_0xef1df6['model'],qs['fields'](_0x967e53[_0x02c5('0x27')]['fields']));_0x2707b5[_0x02c5('0x2b')]=_0x2707b5['attributes'][_0x02c5('0x2d')]?_0x2707b5[_0x02c5('0x2b')]:_0xef1df6[_0x02c5('0x2a')];if(_0x967e53[_0x02c5('0x27')]['includeAll']){_0x2707b5[_0x02c5('0x3c')]=[{'all':!![]}];}_0x2707b5=_['merge']({},_0x2707b5,_0x967e53[_0x02c5('0x41')]);return db[_0x02c5('0x24')]['find'](_0x2707b5)[_0x02c5('0x1f')](handleEntityNotFound(_0x3e20b8,null))[_0x02c5('0x1f')](respondWithResult(_0x3e20b8,null))[_0x02c5('0x3f')](handleError(_0x3e20b8,null));};exports[_0x02c5('0x42')]=function(_0x597ce5,_0x3976a7){return db['AnalyticFieldReport'][_0x02c5('0x42')](_0x597ce5[_0x02c5('0x43')],{})[_0x02c5('0x1f')](respondWithResult(_0x3976a7,0xc9))[_0x02c5('0x3f')](handleError(_0x3976a7,null));};exports[_0x02c5('0x44')]=function(_0x179ede,_0x2bcb2f){return db['AnalyticFieldReport'][_0x02c5('0x44')](_0x179ede[_0x02c5('0x43')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2bcb2f,0xc9))[_0x02c5('0x3f')](handleError(_0x2bcb2f,null));};exports[_0x02c5('0x1e')]=function(_0x54c1b3,_0x166204){if(_0x54c1b3[_0x02c5('0x43')]['id']){delete _0x54c1b3[_0x02c5('0x43')]['id'];}return db[_0x02c5('0x24')][_0x02c5('0x45')]({'where':{'id':_0x54c1b3['params']['id']}})[_0x02c5('0x1f')](handleEntityNotFound(_0x166204,null))['then'](saveUpdates(_0x54c1b3[_0x02c5('0x43')],null))[_0x02c5('0x1f')](respondWithResult(_0x166204,null))[_0x02c5('0x3f')](handleError(_0x166204,null));};exports[_0x02c5('0x20')]=function(_0x466cb2,_0x42baae){return db[_0x02c5('0x24')][_0x02c5('0x45')]({'where':{'id':_0x466cb2['params']['id']}})['then'](handleEntityNotFound(_0x42baae,null))['then'](removeEntity(_0x42baae,null))[_0x02c5('0x3f')](handleError(_0x42baae,null));};exports['bulkDestroy']=function(_0x5b2c06,_0x428c68){return db[_0x02c5('0x24')][_0x02c5('0x20')]({'where':{'id':_0x5b2c06[_0x02c5('0x27')][_0x02c5('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x02c5('0x1f')](respondWithResult(_0x428c68,0xcc))[_0x02c5('0x3f')](handleError(_0x428c68,null));};exports[_0x02c5('0x47')]=function(_0x3f131d,_0x3b3c49,_0xba093){return db[_0x02c5('0x48')][_0x02c5('0x49')]({'where':{'id':_0x3f131d['params']['id']}})[_0x02c5('0x1f')](handleEntityNotFound(_0x3b3c49,null))['then'](function(_0x2126ed){if(_0x2126ed){return db[_0x02c5('0x4a')][_0x02c5('0x4b')](function(_0x3ce576){return db[_0x02c5('0x24')][_0x02c5('0x20')]({'where':{'CustomReportId':_0x3f131d[_0x02c5('0x4c')]['id']},'transaction':_0x3ce576})[_0x02c5('0x1f')](function(_0x1f447f){var _0x337c48=_[_0x02c5('0x37')](_0x3f131d[_0x02c5('0x43')],function(_0x46f808){delete _0x46f808['id'];_0x46f808[_0x02c5('0x4d')]=_0x3f131d[_0x02c5('0x4c')]['id'];return _0x46f808;});return db[_0x02c5('0x24')][_0x02c5('0x44')](_0x337c48,{'transaction':_0x3ce576});});})['then'](function(){return db[_0x02c5('0x24')][_0x02c5('0x3d')]({'where':{'CustomReportId':_0x3f131d[_0x02c5('0x4c')]['id']}});});}})[_0x02c5('0x1f')](respondWithResult(_0x3b3c49,null))[_0x02c5('0x3f')](handleError(_0x3b3c49,null));}; \ No newline at end of file +var _0x890b=['rawAttributes','merge','find','create','body','catch','bulkCreate','params','ids','addFields','findOne','sequelize','transaction','CustomReportId','findAll','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','save','update','destroy','then','stack','name','send','index','AnalyticFieldReport','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','key','VIRTUAL','field','options','count','includeAll','include','rows','show'];(function(_0x5732a1,_0x3c4cb3){var _0x542d29=function(_0xe769e3){while(--_0xe769e3){_0x5732a1['push'](_0x5732a1['shift']());}};_0x542d29(++_0x3c4cb3);}(_0x890b,0x147));var _0xb890=function(_0x1e5cd7,_0x10d93f){_0x1e5cd7=_0x1e5cd7-0x0;var _0x14acd3=_0x890b[_0x1e5cd7];return _0x14acd3;};'use strict';var pdf=require(_0xb890('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb890('0x1'));var zipdir=require(_0xb890('0x2'));var jsonpatch=require(_0xb890('0x3'));var rp=require(_0xb890('0x4'));var moment=require(_0xb890('0x5'));var BPromise=require(_0xb890('0x6'));var Mustache=require(_0xb890('0x7'));var util=require('util');var path=require(_0xb890('0x8'));var sox=require(_0xb890('0x9'));var csv=require(_0xb890('0xa'));var ejs=require(_0xb890('0xb'));var fs=require('fs');var _=require(_0xb890('0xc'));var squel=require(_0xb890('0xd'));var crypto=require(_0xb890('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb890('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb890('0x10'));var Papa=require('papaparse');var Redis=require(_0xb890('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb890('0x12'))(_0xb890('0x13'));var utils=require(_0xb890('0x14'));var config=require(_0xb890('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41b367,_0x327e69){_0x327e69=_0x327e69||0xcc;return function(_0x557d12){if(_0x557d12){return _0x41b367[_0xb890('0x16')](_0x327e69);}return _0x41b367[_0xb890('0x17')](_0x327e69)[_0xb890('0x18')]();};}function respondWithResult(_0x488459,_0x598b19){_0x598b19=_0x598b19||0xc8;return function(_0x5d4555){if(_0x5d4555){return _0x488459[_0xb890('0x17')](_0x598b19)[_0xb890('0x19')](_0x5d4555);}};}function respondWithFilteredResult(_0x2b6616,_0x5bc2ee){return function(_0x1742ab){if(_0x1742ab){var _0x53f494=_0x1742ab['count'],_0x3a0ade=_0x5bc2ee['offset'],_0x379381=_0x5bc2ee[_0xb890('0x1a')]+_0x5bc2ee[_0xb890('0x1b')],_0x2ea531;if(_0x379381>=_0x53f494){_0x379381=_0x53f494;_0x2ea531=0xc8;}else{_0x2ea531=0xce;}_0x2b6616['status'](_0x2ea531);return _0x2b6616[_0xb890('0x1c')]('Content-Range',_0x3a0ade+'-'+_0x379381+'/'+_0x53f494)[_0xb890('0x19')](_0x1742ab);}return null;};}function patchUpdates(_0x39c2f1){return function(_0x5195a8){try{jsonpatch['apply'](_0x5195a8,_0x39c2f1,!![]);}catch(_0x2d92b5){return BPromise['reject'](_0x2d92b5);}return _0x5195a8[_0xb890('0x1d')]();};}function saveUpdates(_0x87c6dd,_0x3ea774){return function(_0x402201){if(_0x402201){return _0x402201[_0xb890('0x1e')](_0x87c6dd)['then'](function(_0x37b8db){return _0x37b8db;});}return null;};}function removeEntity(_0x4b661c,_0x334b47){return function(_0x486c21){if(_0x486c21){return _0x486c21[_0xb890('0x1f')]()[_0xb890('0x20')](function(){_0x4b661c[_0xb890('0x17')](0xcc)[_0xb890('0x18')]();});}};}function handleEntityNotFound(_0x1051d5,_0x859b94){return function(_0x10a31f){if(!_0x10a31f){_0x1051d5[_0xb890('0x16')](0x194);}return _0x10a31f;};}function handleError(_0x48a8c7,_0x982bb2){_0x982bb2=_0x982bb2||0x1f4;return function(_0x161eaa){logger['error'](_0x161eaa[_0xb890('0x21')]);if(_0x161eaa[_0xb890('0x22')]){delete _0x161eaa[_0xb890('0x22')];}_0x48a8c7[_0xb890('0x17')](_0x982bb2)[_0xb890('0x23')](_0x161eaa);};}exports[_0xb890('0x24')]=function(_0x5a35bd,_0x216ae6){var _0xa07468={},_0x43e420={},_0x38e22a={'count':0x0,'rows':[]};var _0x50205d=db[_0xb890('0x25')]['rawAttributes'];_0x43e420[_0xb890('0x26')]=_[_0xb890('0x27')](_0x50205d);_0x43e420['query']=_[_0xb890('0x27')](_0x5a35bd[_0xb890('0x28')]);_0x43e420['filters']=_['intersection'](_0x43e420['model'],_0x43e420[_0xb890('0x28')]);_0xa07468[_0xb890('0x29')]=_[_0xb890('0x2a')](_0x43e420[_0xb890('0x26')],qs[_0xb890('0x2b')](_0x5a35bd['query'][_0xb890('0x2b')]));_0xa07468[_0xb890('0x29')]=_0xa07468['attributes'][_0xb890('0x2c')]?_0xa07468['attributes']:_0x43e420['model'];if(!_0x5a35bd[_0xb890('0x28')][_0xb890('0x2d')](_0xb890('0x2e'))){_0xa07468[_0xb890('0x1b')]=qs['limit'](_0x5a35bd[_0xb890('0x28')][_0xb890('0x1b')]);_0xa07468['offset']=qs[_0xb890('0x1a')](_0x5a35bd[_0xb890('0x28')][_0xb890('0x1a')]);}_0xa07468[_0xb890('0x2f')]=qs[_0xb890('0x30')](_0x5a35bd[_0xb890('0x28')][_0xb890('0x30')]);_0xa07468['where']=qs[_0xb890('0x31')](_[_0xb890('0x32')](_0x5a35bd[_0xb890('0x28')],_0x43e420[_0xb890('0x31')]));if(_0x5a35bd[_0xb890('0x28')][_0xb890('0x33')]){_0xa07468[_0xb890('0x34')]=_['merge'](_0xa07468[_0xb890('0x34')],{'$or':_[_0xb890('0x35')](_0x50205d,function(_0x1d4019){if(_0x1d4019['type'][_0xb890('0x36')]!==_0xb890('0x37')){var _0x3878d4={};_0x3878d4[_0x1d4019[_0xb890('0x38')]]={'$like':'%'+_0x5a35bd[_0xb890('0x28')][_0xb890('0x33')]+'%'};return _0x3878d4;}})});}_0xa07468=_['merge']({},_0xa07468,_0x5a35bd[_0xb890('0x39')]);var _0x15f619={'where':_0xa07468[_0xb890('0x34')]};return db[_0xb890('0x25')][_0xb890('0x3a')](_0x15f619)[_0xb890('0x20')](function(_0x3910d4){_0x38e22a['count']=_0x3910d4;if(_0x5a35bd[_0xb890('0x28')][_0xb890('0x3b')]){_0xa07468[_0xb890('0x3c')]=[{'all':!![]}];}return db[_0xb890('0x25')]['findAll'](_0xa07468);})[_0xb890('0x20')](function(_0x4f08d9){_0x38e22a[_0xb890('0x3d')]=_0x4f08d9;return _0x38e22a;})[_0xb890('0x20')](respondWithFilteredResult(_0x216ae6,_0xa07468))['catch'](handleError(_0x216ae6,null));};exports[_0xb890('0x3e')]=function(_0x5c86be,_0x3869f6){var _0x143fe7={'raw':![],'where':{'id':_0x5c86be['params']['id']}},_0x42ad86={};_0x42ad86[_0xb890('0x26')]=_[_0xb890('0x27')](db[_0xb890('0x25')][_0xb890('0x3f')]);_0x42ad86[_0xb890('0x28')]=_[_0xb890('0x27')](_0x5c86be[_0xb890('0x28')]);_0x42ad86['filters']=_[_0xb890('0x2a')](_0x42ad86['model'],_0x42ad86[_0xb890('0x28')]);_0x143fe7[_0xb890('0x29')]=_['intersection'](_0x42ad86[_0xb890('0x26')],qs[_0xb890('0x2b')](_0x5c86be[_0xb890('0x28')]['fields']));_0x143fe7['attributes']=_0x143fe7['attributes'][_0xb890('0x2c')]?_0x143fe7[_0xb890('0x29')]:_0x42ad86['model'];if(_0x5c86be[_0xb890('0x28')][_0xb890('0x3b')]){_0x143fe7[_0xb890('0x3c')]=[{'all':!![]}];}_0x143fe7=_[_0xb890('0x40')]({},_0x143fe7,_0x5c86be[_0xb890('0x39')]);return db[_0xb890('0x25')][_0xb890('0x41')](_0x143fe7)['then'](handleEntityNotFound(_0x3869f6,null))[_0xb890('0x20')](respondWithResult(_0x3869f6,null))['catch'](handleError(_0x3869f6,null));};exports[_0xb890('0x42')]=function(_0x166c25,_0x4e7587){return db[_0xb890('0x25')][_0xb890('0x42')](_0x166c25[_0xb890('0x43')],{})[_0xb890('0x20')](respondWithResult(_0x4e7587,0xc9))[_0xb890('0x44')](handleError(_0x4e7587,null));};exports[_0xb890('0x45')]=function(_0x195869,_0x52e756){return db['AnalyticFieldReport']['bulkCreate'](_0x195869[_0xb890('0x43')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x52e756,0xc9))[_0xb890('0x44')](handleError(_0x52e756,null));};exports[_0xb890('0x1e')]=function(_0x5e9741,_0x4e975a){if(_0x5e9741[_0xb890('0x43')]['id']){delete _0x5e9741[_0xb890('0x43')]['id'];}return db[_0xb890('0x25')][_0xb890('0x41')]({'where':{'id':_0x5e9741[_0xb890('0x46')]['id']}})[_0xb890('0x20')](handleEntityNotFound(_0x4e975a,null))[_0xb890('0x20')](saveUpdates(_0x5e9741['body'],null))[_0xb890('0x20')](respondWithResult(_0x4e975a,null))['catch'](handleError(_0x4e975a,null));};exports[_0xb890('0x1f')]=function(_0xf41e85,_0x39ba80){return db[_0xb890('0x25')][_0xb890('0x41')]({'where':{'id':_0xf41e85['params']['id']}})[_0xb890('0x20')](handleEntityNotFound(_0x39ba80,null))[_0xb890('0x20')](removeEntity(_0x39ba80,null))['catch'](handleError(_0x39ba80,null));};exports['bulkDestroy']=function(_0x429538,_0x11ae00){return db[_0xb890('0x25')]['destroy']({'where':{'id':_0x429538[_0xb890('0x28')][_0xb890('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0xb890('0x20')](respondWithResult(_0x11ae00,0xcc))[_0xb890('0x44')](handleError(_0x11ae00,null));};exports[_0xb890('0x48')]=function(_0x53f84f,_0xc9ff38,_0x3727e){return db['AnalyticCustomReport'][_0xb890('0x49')]({'where':{'id':_0x53f84f[_0xb890('0x46')]['id']}})[_0xb890('0x20')](handleEntityNotFound(_0xc9ff38,null))[_0xb890('0x20')](function(_0x1a750e){if(_0x1a750e){return db[_0xb890('0x4a')][_0xb890('0x4b')](function(_0x35cac6){return db[_0xb890('0x25')]['destroy']({'where':{'CustomReportId':_0x53f84f['params']['id']},'transaction':_0x35cac6})[_0xb890('0x20')](function(_0x2d82be){var _0x5628de=_[_0xb890('0x35')](_0x53f84f[_0xb890('0x43')],function(_0x3cf04e){delete _0x3cf04e['id'];_0x3cf04e[_0xb890('0x4c')]=_0x53f84f[_0xb890('0x46')]['id'];return _0x3cf04e;});return db['AnalyticFieldReport'][_0xb890('0x45')](_0x5628de,{'transaction':_0x35cac6});});})['then'](function(){return db[_0xb890('0x25')][_0xb890('0x4d')]({'where':{'CustomReportId':_0x53f84f[_0xb890('0x46')]['id']}});});}})['then'](respondWithResult(_0xc9ff38,null))[_0xb890('0x44')](handleError(_0xc9ff38,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 5cb45ee..14f8d62 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.model.js +++ b/server/api/analyticFieldReport/analyticFieldReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd5ef=['../../config/logger','moment','request-promise','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','util'];(function(_0x1c5b71,_0xb975ed){var _0x47cd16=function(_0x325847){while(--_0x325847){_0x1c5b71['push'](_0x1c5b71['shift']());}};_0x47cd16(++_0xb975ed);}(_0xd5ef,0x17a));var _0xfd5e=function(_0x5a86d4,_0x1ccb59){_0x5a86d4=_0x5a86d4-0x0;var _0x54a380=_0xd5ef[_0x5a86d4];return _0x54a380;};'use strict';var _=require(_0xfd5e('0x0'));var util=require(_0xfd5e('0x1'));var logger=require(_0xfd5e('0x2'))('api');var moment=require(_0xfd5e('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd5e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfd5e('0x5'));var attributes=require(_0xfd5e('0x6'));module[_0xfd5e('0x7')]=function(_0xfd09ce,_0x1760c5){return _0xfd09ce[_0xfd5e('0x8')](_0xfd5e('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06b2=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x06b2,0x1ec));var _0x206b=function(_0xe3214d,_0x2387de){_0xe3214d=_0xe3214d-0x0;var _0x3e2a1f=_0x06b2[_0xe3214d];return _0x3e2a1f;};'use strict';var _=require(_0x206b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x206b('0x1'));var moment=require(_0x206b('0x2'));var BPromise=require(_0x206b('0x3'));var rp=require(_0x206b('0x4'));var fs=require('fs');var path=require(_0x206b('0x5'));var rimraf=require(_0x206b('0x6'));var config=require(_0x206b('0x7'));var attributes=require(_0x206b('0x8'));module[_0x206b('0x9')]=function(_0x4a6a16,_0x16ef06){return _0x4a6a16[_0x206b('0xa')](_0x206b('0xb'),attributes,{'tableName':_0x206b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 2cfb34b..a3b936f 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js +++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0450=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','util','moment','bluebird'];(function(_0x508a06,_0x5d9822){var _0x31882d=function(_0x2f7726){while(--_0x2f7726){_0x508a06['push'](_0x508a06['shift']());}};_0x31882d(++_0x5d9822);}(_0x0450,0xe4));var _0x0045=function(_0x89de20,_0x182ee0){_0x89de20=_0x89de20-0x0;var _0x457d64=_0x0450[_0x89de20];return _0x457d64;};'use strict';var _=require('lodash');var util=require(_0x0045('0x0'));var moment=require(_0x0045('0x1'));var BPromise=require(_0x0045('0x2'));var rs=require(_0x0045('0x3'));var fs=require('fs');var Redis=require(_0x0045('0x4'));var db=require(_0x0045('0x5'))['db'];var utils=require(_0x0045('0x6'));var logger=require('../../config/logger')(_0x0045('0x7'));var config=require(_0x0045('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0045('0x9')][_0x0045('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19a3b3,_0x3d1f5a,_0x47163f){return new BPromise(function(_0x312fb1,_0x5dddfe){return client['request'](_0x19a3b3,_0x47163f)[_0x0045('0xb')](function(_0x15e1c3){logger['info'](_0x0045('0xc'),_0x3d1f5a,'request\x20sent');logger['debug'](_0x0045('0xd'),_0x3d1f5a,'request\x20sent',JSON[_0x0045('0xe')](_0x15e1c3));if(_0x15e1c3[_0x0045('0xf')]){if(_0x15e1c3[_0x0045('0xf')][_0x0045('0x10')]===0x1f4){logger[_0x0045('0xf')](_0x0045('0xc'),_0x3d1f5a,_0x15e1c3[_0x0045('0xf')][_0x0045('0x11')]);return _0x5dddfe(_0x15e1c3['error']['message']);}logger[_0x0045('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3d1f5a,_0x15e1c3['error'][_0x0045('0x11')]);return _0x312fb1(_0x15e1c3[_0x0045('0xf')]['message']);}else{logger[_0x0045('0x12')](_0x0045('0xc'),_0x3d1f5a,_0x0045('0x13'));_0x312fb1(_0x15e1c3[_0x0045('0x14')]['message']);}})['catch'](function(_0x541f28){logger[_0x0045('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3d1f5a,_0x541f28);_0x5dddfe(_0x541f28);});});} \ No newline at end of file +var _0xd529=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x86f641,_0x448934){var _0x58800f=function(_0xb99205){while(--_0xb99205){_0x86f641['push'](_0x86f641['shift']());}};_0x58800f(++_0x448934);}(_0xd529,0xd7));var _0x9d52=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd529[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x9d52('0x0'));var util=require(_0x9d52('0x1'));var moment=require(_0x9d52('0x2'));var BPromise=require(_0x9d52('0x3'));var rs=require(_0x9d52('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d52('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9d52('0x6'));var config=require(_0x9d52('0x7'));var jayson=require(_0x9d52('0x8'));var client=jayson[_0x9d52('0x9')][_0x9d52('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13f94a,_0xecef56,_0xc6c5a9){return new BPromise(function(_0x33eda5,_0x1db13b){return client[_0x9d52('0xb')](_0x13f94a,_0xc6c5a9)[_0x9d52('0xc')](function(_0x1bfd9b){logger[_0x9d52('0xd')](_0x9d52('0xe'),_0xecef56,_0x9d52('0xf'));logger[_0x9d52('0x10')](_0x9d52('0x11'),_0xecef56,'request\x20sent',JSON[_0x9d52('0x12')](_0x1bfd9b));if(_0x1bfd9b[_0x9d52('0x13')]){if(_0x1bfd9b[_0x9d52('0x13')]['code']===0x1f4){logger[_0x9d52('0x13')](_0x9d52('0xe'),_0xecef56,_0x1bfd9b[_0x9d52('0x13')][_0x9d52('0x14')]);return _0x1db13b(_0x1bfd9b[_0x9d52('0x13')]['message']);}logger[_0x9d52('0x13')](_0x9d52('0xe'),_0xecef56,_0x1bfd9b[_0x9d52('0x13')][_0x9d52('0x14')]);return _0x33eda5(_0x1bfd9b[_0x9d52('0x13')][_0x9d52('0x14')]);}else{logger[_0x9d52('0xd')](_0x9d52('0xe'),_0xecef56,_0x9d52('0xf'));_0x33eda5(_0x1bfd9b['result'][_0x9d52('0x14')]);}})[_0x9d52('0x15')](function(_0x4596db){logger[_0x9d52('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0xecef56,_0x4596db);_0x1db13b(_0x4596db);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index e7029ed..1f40845 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['./analyticFieldReport.controller','get','isAuthenticated','index','show','post','create','/create_many','/:id/create_many','addFields','/:id','delete','/destroy_many','bulkDestroy','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service'];(function(_0x1786fb,_0x76f76f){var _0x50d9c0=function(_0x1d3d3a){while(--_0x1d3d3a){_0x1786fb['push'](_0x1786fb['shift']());}};_0x50d9c0(++_0x76f76f);}(_0x3e74,0x175));var _0x43e7=function(_0x1e266c,_0xb9009b){_0x1e266c=_0x1e266c-0x0;var _0x7a4e32=_0x3e74[_0x1e266c];return _0x7a4e32;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0xa')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0xb')]);router['post'](_0x43e7('0xc'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x43e7('0xa')](_0x43e7('0xd'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router['put'](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller['update']);router[_0x43e7('0x10')](_0x43e7('0x11'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x12')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x13')]);module[_0x43e7('0x14')]=router; \ No newline at end of file +var _0x3e74=['./analyticFieldReport.controller','get','isAuthenticated','index','show','post','create','/create_many','/:id/create_many','addFields','/:id','delete','/destroy_many','bulkDestroy','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service'];(function(_0x517e67,_0x46d63c){var _0x4d7215=function(_0x4d4208){while(--_0x4d4208){_0x517e67['push'](_0x517e67['shift']());}};_0x4d7215(++_0x46d63c);}(_0x3e74,0x175));var _0x43e7=function(_0x290447,_0x422fed){_0x290447=_0x290447-0x0;var _0x2c58cb=_0x3e74[_0x290447];return _0x2c58cb;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0xa')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0xb')]);router['post'](_0x43e7('0xc'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x43e7('0xa')](_0x43e7('0xd'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router['put'](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller['update']);router[_0x43e7('0x10')](_0x43e7('0x11'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x12')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x13')]);module[_0x43e7('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 947d7bd..0d9662c 100644 --- a/server/api/analyticMetric/analyticMetric.attributes.js +++ b/server/api/analyticMetric/analyticMetric.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb574=['name','STRING','sequelize','exports'];(function(_0x15b2fb,_0x471def){var _0x5661dc=function(_0x533f29){while(--_0x533f29){_0x15b2fb['push'](_0x15b2fb['shift']());}};_0x5661dc(++_0x471def);}(_0xb574,0x106));var _0x4b57=function(_0x447caf,_0x3c1a86){_0x447caf=_0x447caf-0x0;var _0x3ed9aa=_0xb574[_0x447caf];return _0x3ed9aa;};'use strict';var Sequelize=require(_0x4b57('0x0'));module[_0x4b57('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4b57('0x2')},'table':{'type':Sequelize[_0x4b57('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x4b57('0x3')]}}; \ No newline at end of file +var _0x38dc=['name','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x38dc,0x117));var _0xc38d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x38dc[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc38d('0x0')],'allowNull':![],'unique':_0xc38d('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 6115f51..30f3a7a 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b4b=['Content-Range','apply','save','update','then','get','Metrics','UserProfileResource','end','error','stack','name','send','index','rawAttributes','model','query','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','AnalyticMetric','findAll','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set'];(function(_0x31ee59,_0x548b61){var _0x59c238=function(_0x188914){while(--_0x188914){_0x31ee59['push'](_0x31ee59['shift']());}};_0x59c238(++_0x548b61);}(_0x3b4b,0x11f));var _0xb3b4=function(_0x19b5eb,_0x24f84f){_0x19b5eb=_0x19b5eb-0x0;var _0x398dd2=_0x3b4b[_0x19b5eb];return _0x398dd2;};'use strict';var pdf=require(_0xb3b4('0x0'));var emlformat=require(_0xb3b4('0x1'));var rimraf=require(_0xb3b4('0x2'));var zipdir=require(_0xb3b4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3b4('0x4'));var moment=require(_0xb3b4('0x5'));var BPromise=require(_0xb3b4('0x6'));var Mustache=require('mustache');var util=require(_0xb3b4('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb3b4('0x8'));var ejs=require(_0xb3b4('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb3b4('0xa'));var Papa=require(_0xb3b4('0xb'));var Redis=require(_0xb3b4('0xc'));var authService=require(_0xb3b4('0xd'));var qs=require(_0xb3b4('0xe'));var hardwareService=require(_0xb3b4('0xf'));var logger=require('../../config/logger')(_0xb3b4('0x10'));var utils=require(_0xb3b4('0x11'));var config=require(_0xb3b4('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d40b1,_0x334ef1){_0x334ef1=_0x334ef1||0xcc;return function(_0x4c5d0e){if(_0x4c5d0e){return _0x2d40b1[_0xb3b4('0x13')](_0x334ef1);}return _0x2d40b1[_0xb3b4('0x14')](_0x334ef1)['end']();};}function respondWithResult(_0x14143c,_0x478be4){_0x478be4=_0x478be4||0xc8;return function(_0x257720){if(_0x257720){return _0x14143c[_0xb3b4('0x14')](_0x478be4)[_0xb3b4('0x15')](_0x257720);}};}function respondWithFilteredResult(_0x2dcbe8,_0x534e81){return function(_0x4bf7f1){if(_0x4bf7f1){var _0x3f31e4=_0x4bf7f1[_0xb3b4('0x16')],_0x1356de=_0x534e81['offset'],_0x4558cb=_0x534e81[_0xb3b4('0x17')]+_0x534e81['limit'],_0x2a2bf6;if(_0x4558cb>=_0x3f31e4){_0x4558cb=_0x3f31e4;_0x2a2bf6=0xc8;}else{_0x2a2bf6=0xce;}_0x2dcbe8[_0xb3b4('0x14')](_0x2a2bf6);return _0x2dcbe8[_0xb3b4('0x18')](_0xb3b4('0x19'),_0x1356de+'-'+_0x4558cb+'/'+_0x3f31e4)[_0xb3b4('0x15')](_0x4bf7f1);}return null;};}function patchUpdates(_0xa33168){return function(_0x11fb3a){try{jsonpatch[_0xb3b4('0x1a')](_0x11fb3a,_0xa33168,!![]);}catch(_0x2c1c52){return BPromise['reject'](_0x2c1c52);}return _0x11fb3a[_0xb3b4('0x1b')]();};}function saveUpdates(_0x42a84e,_0xa4208a){return function(_0x13797b){if(_0x13797b){return _0x13797b[_0xb3b4('0x1c')](_0x42a84e)[_0xb3b4('0x1d')](function(_0x431811){return _0x431811;});}return null;};}function removeEntity(_0xc84abd,_0x4d660f){return function(_0x21e873){if(_0x21e873){return _0x21e873['destroy']()[_0xb3b4('0x1d')](function(){var _0x91140d=_0x21e873[_0xb3b4('0x1e')]({'plain':!![]});var _0x42bc28=_0xb3b4('0x1f');return db[_0xb3b4('0x20')]['destroy']({'where':{'type':_0x42bc28,'resourceId':_0x91140d['id']}})[_0xb3b4('0x1d')](function(){return _0x21e873;});})[_0xb3b4('0x1d')](function(){_0xc84abd[_0xb3b4('0x14')](0xcc)[_0xb3b4('0x21')]();});}};}function handleEntityNotFound(_0x3647d0,_0x2f9cda){return function(_0x40bfcb){if(!_0x40bfcb){_0x3647d0[_0xb3b4('0x13')](0x194);}return _0x40bfcb;};}function handleError(_0x409eb3,_0x1c379a){_0x1c379a=_0x1c379a||0x1f4;return function(_0x1c6fe8){logger[_0xb3b4('0x22')](_0x1c6fe8[_0xb3b4('0x23')]);if(_0x1c6fe8[_0xb3b4('0x24')]){delete _0x1c6fe8[_0xb3b4('0x24')];}_0x409eb3['status'](_0x1c379a)[_0xb3b4('0x25')](_0x1c6fe8);};}exports[_0xb3b4('0x26')]=function(_0x210cfa,_0x57ddfb){var _0x49c8f0={},_0x31b3b8={},_0x2bf70c={'count':0x0,'rows':[]};var _0x3231cb=db['AnalyticMetric'][_0xb3b4('0x27')];_0x31b3b8[_0xb3b4('0x28')]=_['keys'](_0x3231cb);_0x31b3b8[_0xb3b4('0x29')]=_['keys'](_0x210cfa[_0xb3b4('0x29')]);_0x31b3b8[_0xb3b4('0x2a')]=_['intersection'](_0x31b3b8['model'],_0x31b3b8[_0xb3b4('0x29')]);_0x49c8f0[_0xb3b4('0x2b')]=_[_0xb3b4('0x2c')](_0x31b3b8[_0xb3b4('0x28')],qs[_0xb3b4('0x2d')](_0x210cfa[_0xb3b4('0x29')][_0xb3b4('0x2d')]));_0x49c8f0['attributes']=_0x49c8f0[_0xb3b4('0x2b')]['length']?_0x49c8f0[_0xb3b4('0x2b')]:_0x31b3b8['model'];if(!_0x210cfa[_0xb3b4('0x29')][_0xb3b4('0x2e')]('nolimit')){_0x49c8f0[_0xb3b4('0x2f')]=qs[_0xb3b4('0x2f')](_0x210cfa[_0xb3b4('0x29')]['limit']);_0x49c8f0['offset']=qs[_0xb3b4('0x17')](_0x210cfa[_0xb3b4('0x29')][_0xb3b4('0x17')]);}_0x49c8f0[_0xb3b4('0x30')]=qs[_0xb3b4('0x31')](_0x210cfa[_0xb3b4('0x29')][_0xb3b4('0x31')]);_0x49c8f0[_0xb3b4('0x32')]=qs[_0xb3b4('0x2a')](_['pick'](_0x210cfa[_0xb3b4('0x29')],_0x31b3b8[_0xb3b4('0x2a')]));if(_0x210cfa[_0xb3b4('0x29')][_0xb3b4('0x33')]){_0x49c8f0[_0xb3b4('0x32')]=_[_0xb3b4('0x34')](_0x49c8f0[_0xb3b4('0x32')],{'$or':_[_0xb3b4('0x35')](_0x3231cb,function(_0xb10b2d){if(_0xb10b2d[_0xb3b4('0x36')]['key']!==_0xb3b4('0x37')){var _0x1bcd63={};_0x1bcd63[_0xb10b2d[_0xb3b4('0x38')]]={'$like':'%'+_0x210cfa[_0xb3b4('0x29')]['filter']+'%'};return _0x1bcd63;}})});}_0x49c8f0=_[_0xb3b4('0x34')]({},_0x49c8f0,_0x210cfa[_0xb3b4('0x39')]);var _0x554999={'where':_0x49c8f0[_0xb3b4('0x32')]};return db['AnalyticMetric'][_0xb3b4('0x16')](_0x554999)[_0xb3b4('0x1d')](function(_0x1657fc){_0x2bf70c['count']=_0x1657fc;if(_0x210cfa[_0xb3b4('0x29')][_0xb3b4('0x3a')]){_0x49c8f0[_0xb3b4('0x3b')]=[{'all':!![]}];}return db[_0xb3b4('0x3c')][_0xb3b4('0x3d')](_0x49c8f0);})[_0xb3b4('0x1d')](function(_0x209ec7){_0x2bf70c[_0xb3b4('0x3e')]=_0x209ec7;return _0x2bf70c;})[_0xb3b4('0x1d')](respondWithFilteredResult(_0x57ddfb,_0x49c8f0))[_0xb3b4('0x3f')](handleError(_0x57ddfb,null));};exports[_0xb3b4('0x40')]=function(_0x54f8e3,_0x2cfe1c){var _0x50f5a9={'raw':!![],'where':{'id':_0x54f8e3[_0xb3b4('0x41')]['id']}},_0x1671f9={};_0x1671f9[_0xb3b4('0x28')]=_[_0xb3b4('0x42')](db[_0xb3b4('0x3c')][_0xb3b4('0x27')]);_0x1671f9[_0xb3b4('0x29')]=_[_0xb3b4('0x42')](_0x54f8e3[_0xb3b4('0x29')]);_0x1671f9[_0xb3b4('0x2a')]=_[_0xb3b4('0x2c')](_0x1671f9[_0xb3b4('0x28')],_0x1671f9[_0xb3b4('0x29')]);_0x50f5a9[_0xb3b4('0x2b')]=_[_0xb3b4('0x2c')](_0x1671f9[_0xb3b4('0x28')],qs['fields'](_0x54f8e3[_0xb3b4('0x29')][_0xb3b4('0x2d')]));_0x50f5a9[_0xb3b4('0x2b')]=_0x50f5a9['attributes'][_0xb3b4('0x43')]?_0x50f5a9['attributes']:_0x1671f9[_0xb3b4('0x28')];if(_0x54f8e3[_0xb3b4('0x29')]['includeAll']){_0x50f5a9['include']=[{'all':!![]}];}_0x50f5a9=_['merge']({},_0x50f5a9,_0x54f8e3[_0xb3b4('0x39')]);return db[_0xb3b4('0x3c')][_0xb3b4('0x44')](_0x50f5a9)[_0xb3b4('0x1d')](handleEntityNotFound(_0x2cfe1c,null))[_0xb3b4('0x1d')](respondWithResult(_0x2cfe1c,null))[_0xb3b4('0x3f')](handleError(_0x2cfe1c,null));};exports[_0xb3b4('0x45')]=function(_0x516987,_0x30fe56){return db[_0xb3b4('0x3c')][_0xb3b4('0x45')](_0x516987[_0xb3b4('0x46')],{})[_0xb3b4('0x1d')](function(_0x2570ec){var _0x30319b=_0x516987[_0xb3b4('0x47')]['get']({'plain':!![]});if(!_0x30319b)throw new Error(_0xb3b4('0x48'));if(_0x30319b[_0xb3b4('0x49')]===_0xb3b4('0x47')){var _0xdf2ef4=_0x2570ec[_0xb3b4('0x1e')]({'plain':!![]});var _0x444319=_0xb3b4('0x1f');return db[_0xb3b4('0x4a')][_0xb3b4('0x44')]({'where':{'name':_0x444319,'userProfileId':_0x30319b['userProfileId']},'raw':!![]})[_0xb3b4('0x1d')](function(_0x4e5a03){if(_0x4e5a03&&_0x4e5a03[_0xb3b4('0x4b')]===0x0){return db[_0xb3b4('0x20')][_0xb3b4('0x45')]({'name':_0xdf2ef4[_0xb3b4('0x24')],'resourceId':_0xdf2ef4['id'],'type':_0x4e5a03[_0xb3b4('0x24')],'sectionId':_0x4e5a03['id']},{})[_0xb3b4('0x1d')](function(){return _0x2570ec;});}else{return _0x2570ec;}})['catch'](function(_0x142179){logger[_0xb3b4('0x22')](_0xb3b4('0x4c'),_0x142179);throw _0x142179;});}return _0x2570ec;})[_0xb3b4('0x1d')](respondWithResult(_0x30fe56,0xc9))[_0xb3b4('0x3f')](handleError(_0x30fe56,null));};exports[_0xb3b4('0x1c')]=function(_0xbd6e21,_0x6d03d0){if(_0xbd6e21[_0xb3b4('0x46')]['id']){delete _0xbd6e21[_0xb3b4('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xbd6e21[_0xb3b4('0x41')]['id']}})[_0xb3b4('0x1d')](handleEntityNotFound(_0x6d03d0,null))[_0xb3b4('0x1d')](saveUpdates(_0xbd6e21[_0xb3b4('0x46')],null))[_0xb3b4('0x1d')](respondWithResult(_0x6d03d0,null))[_0xb3b4('0x3f')](handleError(_0x6d03d0,null));};exports[_0xb3b4('0x4d')]=function(_0x2584c9,_0x46000c){return db[_0xb3b4('0x3c')][_0xb3b4('0x44')]({'where':{'id':_0x2584c9[_0xb3b4('0x41')]['id']}})[_0xb3b4('0x1d')](handleEntityNotFound(_0x46000c,null))[_0xb3b4('0x1d')](removeEntity(_0x46000c,null))['catch'](handleError(_0x46000c,null));}; \ No newline at end of file +var _0x9493=['Metrics','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','then','destroy','get','error','stack','name','send','index','AnalyticMetric','rawAttributes','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','field','options','count','includeAll','include','rows','catch','show','params','keys','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x147aea,_0x337eb3){var _0x268bb1=function(_0xb568ff){while(--_0xb568ff){_0x147aea['push'](_0x147aea['shift']());}};_0x268bb1(++_0x337eb3);}(_0x9493,0x13f));var _0x3949=function(_0x55b7da,_0x464403){_0x55b7da=_0x55b7da-0x0;var _0x57cc76=_0x9493[_0x55b7da];return _0x57cc76;};'use strict';var pdf=require(_0x3949('0x0'));var emlformat=require(_0x3949('0x1'));var rimraf=require(_0x3949('0x2'));var zipdir=require(_0x3949('0x3'));var jsonpatch=require(_0x3949('0x4'));var rp=require(_0x3949('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3949('0x6'));var path=require(_0x3949('0x7'));var sox=require(_0x3949('0x8'));var csv=require(_0x3949('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3949('0xa'));var squel=require('squel');var crypto=require(_0x3949('0xb'));var jsforce=require(_0x3949('0xc'));var deskjs=require(_0x3949('0xd'));var toCsv=require(_0x3949('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3949('0xe'));var qs=require(_0x3949('0xf'));var hardwareService=require(_0x3949('0x10'));var logger=require(_0x3949('0x11'))(_0x3949('0x12'));var utils=require('../../config/utils');var config=require(_0x3949('0x13'));var db=require(_0x3949('0x14'))['db'];function respondWithStatusCode(_0x590c3c,_0x133ce8){_0x133ce8=_0x133ce8||0xcc;return function(_0x3ec3c5){if(_0x3ec3c5){return _0x590c3c[_0x3949('0x15')](_0x133ce8);}return _0x590c3c[_0x3949('0x16')](_0x133ce8)[_0x3949('0x17')]();};}function respondWithResult(_0x78c058,_0x6b5ebc){_0x6b5ebc=_0x6b5ebc||0xc8;return function(_0x4125df){if(_0x4125df){return _0x78c058['status'](_0x6b5ebc)[_0x3949('0x18')](_0x4125df);}};}function respondWithFilteredResult(_0x37ec8e,_0x27a927){return function(_0x30f8c1){if(_0x30f8c1){var _0x29b4c2=_0x30f8c1['count'],_0x4aae0d=_0x27a927[_0x3949('0x19')],_0x42ff80=_0x27a927['offset']+_0x27a927[_0x3949('0x1a')],_0x3e3471;if(_0x42ff80>=_0x29b4c2){_0x42ff80=_0x29b4c2;_0x3e3471=0xc8;}else{_0x3e3471=0xce;}_0x37ec8e[_0x3949('0x16')](_0x3e3471);return _0x37ec8e[_0x3949('0x1b')](_0x3949('0x1c'),_0x4aae0d+'-'+_0x42ff80+'/'+_0x29b4c2)['json'](_0x30f8c1);}return null;};}function patchUpdates(_0x157968){return function(_0x167167){try{jsonpatch[_0x3949('0x1d')](_0x167167,_0x157968,!![]);}catch(_0x29c4de){return BPromise[_0x3949('0x1e')](_0x29c4de);}return _0x167167['save']();};}function saveUpdates(_0x49a0a5,_0x365540){return function(_0x455d2f){if(_0x455d2f){return _0x455d2f['update'](_0x49a0a5)[_0x3949('0x1f')](function(_0xbe88e8){return _0xbe88e8;});}return null;};}function removeEntity(_0x1acfd8,_0x26d794){return function(_0x5c0f3f){if(_0x5c0f3f){return _0x5c0f3f[_0x3949('0x20')]()[_0x3949('0x1f')](function(){var _0x57fe1b=_0x5c0f3f[_0x3949('0x21')]({'plain':!![]});var _0x43d927='Metrics';return db['UserProfileResource'][_0x3949('0x20')]({'where':{'type':_0x43d927,'resourceId':_0x57fe1b['id']}})[_0x3949('0x1f')](function(){return _0x5c0f3f;});})[_0x3949('0x1f')](function(){_0x1acfd8['status'](0xcc)[_0x3949('0x17')]();});}};}function handleEntityNotFound(_0x8a6122,_0x21cd59){return function(_0x3a5b35){if(!_0x3a5b35){_0x8a6122[_0x3949('0x15')](0x194);}return _0x3a5b35;};}function handleError(_0x492689,_0x2705e3){_0x2705e3=_0x2705e3||0x1f4;return function(_0xaa676d){logger[_0x3949('0x22')](_0xaa676d[_0x3949('0x23')]);if(_0xaa676d[_0x3949('0x24')]){delete _0xaa676d[_0x3949('0x24')];}_0x492689[_0x3949('0x16')](_0x2705e3)[_0x3949('0x25')](_0xaa676d);};}exports[_0x3949('0x26')]=function(_0xe359d1,_0x27abd2){var _0x5c20df={},_0xbd246e={},_0x41ef16={'count':0x0,'rows':[]};var _0x53fef5=db[_0x3949('0x27')][_0x3949('0x28')];_0xbd246e[_0x3949('0x29')]=_['keys'](_0x53fef5);_0xbd246e['query']=_['keys'](_0xe359d1[_0x3949('0x2a')]);_0xbd246e[_0x3949('0x2b')]=_[_0x3949('0x2c')](_0xbd246e[_0x3949('0x29')],_0xbd246e[_0x3949('0x2a')]);_0x5c20df[_0x3949('0x2d')]=_['intersection'](_0xbd246e[_0x3949('0x29')],qs['fields'](_0xe359d1[_0x3949('0x2a')][_0x3949('0x2e')]));_0x5c20df[_0x3949('0x2d')]=_0x5c20df[_0x3949('0x2d')]['length']?_0x5c20df[_0x3949('0x2d')]:_0xbd246e['model'];if(!_0xe359d1['query'][_0x3949('0x2f')](_0x3949('0x30'))){_0x5c20df[_0x3949('0x1a')]=qs['limit'](_0xe359d1[_0x3949('0x2a')]['limit']);_0x5c20df[_0x3949('0x19')]=qs[_0x3949('0x19')](_0xe359d1[_0x3949('0x2a')]['offset']);}_0x5c20df[_0x3949('0x31')]=qs[_0x3949('0x32')](_0xe359d1[_0x3949('0x2a')]['sort']);_0x5c20df[_0x3949('0x33')]=qs[_0x3949('0x2b')](_[_0x3949('0x34')](_0xe359d1[_0x3949('0x2a')],_0xbd246e[_0x3949('0x2b')]));if(_0xe359d1[_0x3949('0x2a')]['filter']){_0x5c20df[_0x3949('0x33')]=_[_0x3949('0x35')](_0x5c20df[_0x3949('0x33')],{'$or':_[_0x3949('0x36')](_0x53fef5,function(_0x5eb8a7){if(_0x5eb8a7[_0x3949('0x37')]['key']!=='VIRTUAL'){var _0x182c39={};_0x182c39[_0x5eb8a7[_0x3949('0x38')]]={'$like':'%'+_0xe359d1[_0x3949('0x2a')]['filter']+'%'};return _0x182c39;}})});}_0x5c20df=_[_0x3949('0x35')]({},_0x5c20df,_0xe359d1[_0x3949('0x39')]);var _0x5d53e3={'where':_0x5c20df[_0x3949('0x33')]};return db[_0x3949('0x27')][_0x3949('0x3a')](_0x5d53e3)[_0x3949('0x1f')](function(_0x104ec6){_0x41ef16[_0x3949('0x3a')]=_0x104ec6;if(_0xe359d1[_0x3949('0x2a')][_0x3949('0x3b')]){_0x5c20df[_0x3949('0x3c')]=[{'all':!![]}];}return db[_0x3949('0x27')]['findAll'](_0x5c20df);})[_0x3949('0x1f')](function(_0x366f31){_0x41ef16[_0x3949('0x3d')]=_0x366f31;return _0x41ef16;})[_0x3949('0x1f')](respondWithFilteredResult(_0x27abd2,_0x5c20df))[_0x3949('0x3e')](handleError(_0x27abd2,null));};exports[_0x3949('0x3f')]=function(_0x31ae63,_0x35084c){var _0x2fd5b5={'raw':!![],'where':{'id':_0x31ae63[_0x3949('0x40')]['id']}},_0x1558b4={};_0x1558b4[_0x3949('0x29')]=_['keys'](db[_0x3949('0x27')][_0x3949('0x28')]);_0x1558b4['query']=_[_0x3949('0x41')](_0x31ae63[_0x3949('0x2a')]);_0x1558b4['filters']=_[_0x3949('0x2c')](_0x1558b4[_0x3949('0x29')],_0x1558b4[_0x3949('0x2a')]);_0x2fd5b5['attributes']=_[_0x3949('0x2c')](_0x1558b4[_0x3949('0x29')],qs[_0x3949('0x2e')](_0x31ae63[_0x3949('0x2a')][_0x3949('0x2e')]));_0x2fd5b5['attributes']=_0x2fd5b5[_0x3949('0x2d')][_0x3949('0x42')]?_0x2fd5b5[_0x3949('0x2d')]:_0x1558b4[_0x3949('0x29')];if(_0x31ae63['query'][_0x3949('0x3b')]){_0x2fd5b5[_0x3949('0x3c')]=[{'all':!![]}];}_0x2fd5b5=_[_0x3949('0x35')]({},_0x2fd5b5,_0x31ae63[_0x3949('0x39')]);return db[_0x3949('0x27')]['find'](_0x2fd5b5)['then'](handleEntityNotFound(_0x35084c,null))['then'](respondWithResult(_0x35084c,null))[_0x3949('0x3e')](handleError(_0x35084c,null));};exports[_0x3949('0x43')]=function(_0x1c1981,_0x376bd5){return db[_0x3949('0x27')][_0x3949('0x43')](_0x1c1981[_0x3949('0x44')],{})[_0x3949('0x1f')](function(_0xb33ce){var _0x2e8e5c=_0x1c1981[_0x3949('0x45')][_0x3949('0x21')]({'plain':!![]});if(!_0x2e8e5c)throw new Error(_0x3949('0x46'));if(_0x2e8e5c['role']===_0x3949('0x45')){var _0x3eb21d=_0xb33ce['get']({'plain':!![]});var _0x342b3c=_0x3949('0x47');return db[_0x3949('0x48')][_0x3949('0x49')]({'where':{'name':_0x342b3c,'userProfileId':_0x2e8e5c[_0x3949('0x4a')]},'raw':!![]})['then'](function(_0x50074b){if(_0x50074b&&_0x50074b[_0x3949('0x4b')]===0x0){return db['UserProfileResource'][_0x3949('0x43')]({'name':_0x3eb21d['name'],'resourceId':_0x3eb21d['id'],'type':_0x50074b[_0x3949('0x24')],'sectionId':_0x50074b['id']},{})[_0x3949('0x1f')](function(){return _0xb33ce;});}else{return _0xb33ce;}})['catch'](function(_0x364908){logger[_0x3949('0x22')](_0x3949('0x4c'),_0x364908);throw _0x364908;});}return _0xb33ce;})[_0x3949('0x1f')](respondWithResult(_0x376bd5,0xc9))[_0x3949('0x3e')](handleError(_0x376bd5,null));};exports[_0x3949('0x4d')]=function(_0x5a323a,_0x36133f){if(_0x5a323a[_0x3949('0x44')]['id']){delete _0x5a323a['body']['id'];}return db[_0x3949('0x27')][_0x3949('0x49')]({'where':{'id':_0x5a323a[_0x3949('0x40')]['id']}})[_0x3949('0x1f')](handleEntityNotFound(_0x36133f,null))[_0x3949('0x1f')](saveUpdates(_0x5a323a[_0x3949('0x44')],null))[_0x3949('0x1f')](respondWithResult(_0x36133f,null))['catch'](handleError(_0x36133f,null));};exports[_0x3949('0x20')]=function(_0x402264,_0x5b0f3d){return db[_0x3949('0x27')][_0x3949('0x49')]({'where':{'id':_0x402264['params']['id']}})[_0x3949('0x1f')](handleEntityNotFound(_0x5b0f3d,null))[_0x3949('0x1f')](removeEntity(_0x5b0f3d,null))[_0x3949('0x3e')](handleError(_0x5b0f3d,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index dfd639e..6714040 100644 --- a/server/api/analyticMetric/analyticMetric.model.js +++ b/server/api/analyticMetric/analyticMetric.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa716=['util','api','request-promise','path','../../config/environment','exports','analytics_metrics','lodash'];(function(_0x4af712,_0x4de61f){var _0x36be73=function(_0x40808e){while(--_0x40808e){_0x4af712['push'](_0x4af712['shift']());}};_0x36be73(++_0x4de61f);}(_0xa716,0x7f));var _0x6a71=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xa716[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x6a71('0x0'));var util=require(_0x6a71('0x1'));var logger=require('../../config/logger')(_0x6a71('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6a71('0x3'));var fs=require('fs');var path=require(_0x6a71('0x4'));var rimraf=require('rimraf');var config=require(_0x6a71('0x5'));var attributes=require('./analyticMetric.attributes');module[_0x6a71('0x6')]=function(_0xd2ba81,_0x377759){return _0xd2ba81['define']('AnalyticMetric',attributes,{'tableName':_0x6a71('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9b9=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3f6392,_0x117574){var _0x41e1c9=function(_0x2fed2c){while(--_0x2fed2c){_0x3f6392['push'](_0x3f6392['shift']());}};_0x41e1c9(++_0x117574);}(_0xe9b9,0x161));var _0x9e9b=function(_0x5cd675,_0x352cca){_0x5cd675=_0x5cd675-0x0;var _0x2379b0=_0xe9b9[_0x5cd675];return _0x2379b0;};'use strict';var _=require('lodash');var util=require(_0x9e9b('0x0'));var logger=require(_0x9e9b('0x1'))('api');var moment=require(_0x9e9b('0x2'));var BPromise=require(_0x9e9b('0x3'));var rp=require(_0x9e9b('0x4'));var fs=require('fs');var path=require(_0x9e9b('0x5'));var rimraf=require(_0x9e9b('0x6'));var config=require('../../config/environment');var attributes=require(_0x9e9b('0x7'));module[_0x9e9b('0x8')]=function(_0x27e62a,_0x33ed68){return _0x27e62a[_0x9e9b('0x9')](_0x9e9b('0xa'),attributes,{'tableName':_0x9e9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index b179266..c89a3df 100644 --- a/server/api/analyticMetric/analyticMetric.rpc.js +++ b/server/api/analyticMetric/analyticMetric.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc42=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','util','moment'];(function(_0x35de80,_0x49567e){var _0x21ea57=function(_0x4d7dcc){while(--_0x4d7dcc){_0x35de80['push'](_0x35de80['shift']());}};_0x21ea57(++_0x49567e);}(_0xdc42,0x18d));var _0x2dc4=function(_0x5eda66,_0x165ba3){_0x5eda66=_0x5eda66-0x0;var _0x148e8d=_0xdc42[_0x5eda66];return _0x148e8d;};'use strict';var _=require('lodash');var util=require(_0x2dc4('0x0'));var moment=require(_0x2dc4('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2dc4('0x2'))['db'];var utils=require(_0x2dc4('0x3'));var logger=require(_0x2dc4('0x4'))(_0x2dc4('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2dc4('0x6')][_0x2dc4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x521917,_0x2660ac,_0x48b8d3){return new BPromise(function(_0x2601a0,_0x2554ab){return client[_0x2dc4('0x8')](_0x521917,_0x48b8d3)['then'](function(_0x24453d){logger[_0x2dc4('0x9')](_0x2dc4('0xa'),_0x2660ac,'request\x20sent');logger[_0x2dc4('0xb')](_0x2dc4('0xc'),_0x2660ac,'request\x20sent',JSON[_0x2dc4('0xd')](_0x24453d));if(_0x24453d[_0x2dc4('0xe')]){if(_0x24453d[_0x2dc4('0xe')]['code']===0x1f4){logger[_0x2dc4('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x2660ac,_0x24453d['error']['message']);return _0x2554ab(_0x24453d[_0x2dc4('0xe')]['message']);}logger[_0x2dc4('0xe')](_0x2dc4('0xa'),_0x2660ac,_0x24453d['error'][_0x2dc4('0xf')]);return _0x2601a0(_0x24453d['error']['message']);}else{logger[_0x2dc4('0x9')](_0x2dc4('0xa'),_0x2660ac,_0x2dc4('0x10'));_0x2601a0(_0x24453d[_0x2dc4('0x11')][_0x2dc4('0xf')]);}})[_0x2dc4('0x12')](function(_0x16a971){logger['error'](_0x2dc4('0xa'),_0x2660ac,_0x16a971);_0x2554ab(_0x16a971);});});} \ No newline at end of file +var _0xb499=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','then','info'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0xb499,0x166));var _0x9b49=function(_0x636822,_0x1bde13){_0x636822=_0x636822-0x0;var _0x1f3319=_0xb499[_0x636822];return _0x1f3319;};'use strict';var _=require(_0x9b49('0x0'));var util=require('util');var moment=require(_0x9b49('0x1'));var BPromise=require(_0x9b49('0x2'));var rs=require(_0x9b49('0x3'));var fs=require('fs');var Redis=require(_0x9b49('0x4'));var db=require(_0x9b49('0x5'))['db'];var utils=require(_0x9b49('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9b49('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a80ce,_0x16f78f,_0x4a9004){return new BPromise(function(_0x166ed8,_0x79d637){return client['request'](_0x5a80ce,_0x4a9004)[_0x9b49('0x8')](function(_0x32ec0b){logger[_0x9b49('0x9')](_0x9b49('0xa'),_0x16f78f,_0x9b49('0xb'));logger[_0x9b49('0xc')](_0x9b49('0xd'),_0x16f78f,_0x9b49('0xb'),JSON['stringify'](_0x32ec0b));if(_0x32ec0b[_0x9b49('0xe')]){if(_0x32ec0b[_0x9b49('0xe')]['code']===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x16f78f,_0x32ec0b[_0x9b49('0xe')]['message']);return _0x79d637(_0x32ec0b['error']['message']);}logger[_0x9b49('0xe')](_0x9b49('0xa'),_0x16f78f,_0x32ec0b[_0x9b49('0xe')][_0x9b49('0xf')]);return _0x166ed8(_0x32ec0b[_0x9b49('0xe')][_0x9b49('0xf')]);}else{logger[_0x9b49('0x9')](_0x9b49('0xa'),_0x16f78f,_0x9b49('0xb'));_0x166ed8(_0x32ec0b['result'][_0x9b49('0xf')]);}})['catch'](function(_0x273723){logger[_0x9b49('0xe')](_0x9b49('0xa'),_0x16f78f,_0x273723);_0x79d637(_0x273723);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 4b0451c..d0524c8 100644 --- a/server/api/analyticMetric/index.js +++ b/server/api/analyticMetric/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2675=['post','put','update','delete','exports','multer','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x539948,_0x289d5e){var _0x4db07e=function(_0xb1b91){while(--_0xb1b91){_0x539948['push'](_0x539948['shift']());}};_0x4db07e(++_0x289d5e);}(_0x2675,0x75));var _0x5267=function(_0x312626,_0x22b9b1){_0x312626=_0x312626-0x0;var _0x1ecf54=_0x2675[_0x312626];return _0x1ecf54;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x5267('0x3'));var config=require(_0x5267('0x4'));var controller=require('./analyticMetric.controller');router[_0x5267('0x5')]('/',auth[_0x5267('0x6')](),controller[_0x5267('0x7')]);router[_0x5267('0x5')](_0x5267('0x8'),auth[_0x5267('0x6')](),controller['show']);router[_0x5267('0x9')]('/',auth[_0x5267('0x6')](),controller['create']);router[_0x5267('0xa')]('/:id',auth[_0x5267('0x6')](),controller[_0x5267('0xb')]);router[_0x5267('0xc')]('/:id',auth[_0x5267('0x6')](),controller['destroy']);module[_0x5267('0xd')]=router; \ No newline at end of file +var _0x3f8a=['index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x20d3e2,_0x2922f8){var _0x1dd1ae=function(_0x513c5d){while(--_0x513c5d){_0x20d3e2['push'](_0x20d3e2['shift']());}};_0x1dd1ae(++_0x2922f8);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x1f7584,_0x114b68){_0x1f7584=_0x1f7584-0x0;var _0x501b34=_0x3f8a[_0x1f7584];return _0x501b34;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var auth=require(_0xa3f8('0x5'));var interaction=require(_0xa3f8('0x6'));var config=require(_0xa3f8('0x7'));var controller=require(_0xa3f8('0x8'));router[_0xa3f8('0x9')]('/',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xb')]);router[_0xa3f8('0x9')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0xe')]('/',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')](_0xa3f8('0xc'),auth['isAuthenticated'](),controller[_0xa3f8('0x11')]);router[_0xa3f8('0x12')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller['destroy']);module[_0xa3f8('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 0fcb955..e90bf23 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js +++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94ce=['TEXT','sequelize','exports'];(function(_0x2336f0,_0x578fa1){var _0x1f3d93=function(_0x40a954){while(--_0x40a954){_0x2336f0['push'](_0x2336f0['shift']());}};_0x1f3d93(++_0x578fa1);}(_0x94ce,0x19f));var _0xe94c=function(_0x278113,_0x85c78f){_0x278113=_0x278113-0x0;var _0x559e2c=_0x94ce[_0x278113];return _0x559e2c;};'use strict';var Sequelize=require(_0xe94c('0x0'));module[_0xe94c('0x1')]={'tree':{'type':Sequelize[_0xe94c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x95e2=['exports','TEXT','sequelize'];(function(_0x3e1a80,_0x31c4c0){var _0x247521=function(_0xad18bc){while(--_0xad18bc){_0x3e1a80['push'](_0x3e1a80['shift']());}};_0x247521(++_0x31c4c0);}(_0x95e2,0x134));var _0x295e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x95e2[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x295e('0x0'));module[_0x295e('0x1')]={'tree':{'type':Sequelize[_0x295e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 2da92eb..25d9d92 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.controller.js +++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca6b=['stack','name','send','index','AnalyticTreeReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','map','type','key','field','includeAll','include','findAll','params','options','find','catch','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end','error'];(function(_0x7caee1,_0x40dc30){var _0x4d26af=function(_0x479a34){while(--_0x479a34){_0x7caee1['push'](_0x7caee1['shift']());}};_0x4d26af(++_0x40dc30);}(_0xca6b,0x66));var _0xbca6=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xca6b[_0x4baae2];return _0x1a2285;};'use strict';var pdf=require(_0xbca6('0x0'));var emlformat=require(_0xbca6('0x1'));var rimraf=require(_0xbca6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbca6('0x3'));var rp=require(_0xbca6('0x4'));var moment=require(_0xbca6('0x5'));var BPromise=require(_0xbca6('0x6'));var Mustache=require('mustache');var util=require(_0xbca6('0x7'));var path=require(_0xbca6('0x8'));var sox=require(_0xbca6('0x9'));var csv=require('to-csv');var ejs=require(_0xbca6('0xa'));var fs=require('fs');var _=require(_0xbca6('0xb'));var squel=require('squel');var crypto=require(_0xbca6('0xc'));var jsforce=require(_0xbca6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbca6('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbca6('0xf'));var qs=require(_0xbca6('0x10'));var hardwareService=require(_0xbca6('0x11'));var logger=require(_0xbca6('0x12'))('api');var utils=require(_0xbca6('0x13'));var config=require('../../config/environment');var db=require(_0xbca6('0x14'))['db'];function respondWithStatusCode(_0x1c23e3,_0x45e517){_0x45e517=_0x45e517||0xcc;return function(_0x2ed079){if(_0x2ed079){return _0x1c23e3[_0xbca6('0x15')](_0x45e517);}return _0x1c23e3[_0xbca6('0x16')](_0x45e517)['end']();};}function respondWithResult(_0x4cb1d6,_0x3a1da3){_0x3a1da3=_0x3a1da3||0xc8;return function(_0x136e78){if(_0x136e78){return _0x4cb1d6['status'](_0x3a1da3)[_0xbca6('0x17')](_0x136e78);}};}function respondWithFilteredResult(_0x185f07,_0x7eec91){return function(_0x1280cd){if(_0x1280cd){var _0x39097a=_0x1280cd[_0xbca6('0x18')],_0x1b57bf=_0x7eec91['offset'],_0x3dcd19=_0x7eec91[_0xbca6('0x19')]+_0x7eec91[_0xbca6('0x1a')],_0x27269f;if(_0x3dcd19>=_0x39097a){_0x3dcd19=_0x39097a;_0x27269f=0xc8;}else{_0x27269f=0xce;}_0x185f07[_0xbca6('0x16')](_0x27269f);return _0x185f07[_0xbca6('0x1b')]('Content-Range',_0x1b57bf+'-'+_0x3dcd19+'/'+_0x39097a)['json'](_0x1280cd);}return null;};}function patchUpdates(_0x550dff){return function(_0x2ee8e8){try{jsonpatch[_0xbca6('0x1c')](_0x2ee8e8,_0x550dff,!![]);}catch(_0x212dc4){return BPromise[_0xbca6('0x1d')](_0x212dc4);}return _0x2ee8e8[_0xbca6('0x1e')]();};}function saveUpdates(_0x50b294,_0x543cba){return function(_0x4484bd){if(_0x4484bd){return _0x4484bd[_0xbca6('0x1f')](_0x50b294)[_0xbca6('0x20')](function(_0x500c7d){return _0x500c7d;});}return null;};}function removeEntity(_0x342f4d,_0x5519f0){return function(_0x3ac760){if(_0x3ac760){return _0x3ac760[_0xbca6('0x21')]()['then'](function(){_0x342f4d[_0xbca6('0x16')](0xcc)[_0xbca6('0x22')]();});}};}function handleEntityNotFound(_0x102e94,_0x161340){return function(_0xf2d54f){if(!_0xf2d54f){_0x102e94[_0xbca6('0x15')](0x194);}return _0xf2d54f;};}function handleError(_0x42c3b6,_0x2395cf){_0x2395cf=_0x2395cf||0x1f4;return function(_0x353e86){logger[_0xbca6('0x23')](_0x353e86[_0xbca6('0x24')]);if(_0x353e86[_0xbca6('0x25')]){delete _0x353e86[_0xbca6('0x25')];}_0x42c3b6[_0xbca6('0x16')](_0x2395cf)[_0xbca6('0x26')](_0x353e86);};}exports[_0xbca6('0x27')]=function(_0x317977,_0x1678e5){var _0x517c1c={},_0xdde0ce={},_0x19b6a2={'count':0x0,'rows':[]};var _0x212c13=db[_0xbca6('0x28')][_0xbca6('0x29')];_0xdde0ce[_0xbca6('0x2a')]=_[_0xbca6('0x2b')](_0x212c13);_0xdde0ce[_0xbca6('0x2c')]=_['keys'](_0x317977[_0xbca6('0x2c')]);_0xdde0ce[_0xbca6('0x2d')]=_[_0xbca6('0x2e')](_0xdde0ce[_0xbca6('0x2a')],_0xdde0ce[_0xbca6('0x2c')]);_0x517c1c[_0xbca6('0x2f')]=_[_0xbca6('0x2e')](_0xdde0ce[_0xbca6('0x2a')],qs[_0xbca6('0x30')](_0x317977[_0xbca6('0x2c')][_0xbca6('0x30')]));_0x517c1c[_0xbca6('0x2f')]=_0x517c1c['attributes'][_0xbca6('0x31')]?_0x517c1c[_0xbca6('0x2f')]:_0xdde0ce['model'];if(!_0x317977[_0xbca6('0x2c')]['hasOwnProperty']('nolimit')){_0x517c1c['limit']=qs['limit'](_0x317977[_0xbca6('0x2c')]['limit']);_0x517c1c[_0xbca6('0x19')]=qs['offset'](_0x317977[_0xbca6('0x2c')][_0xbca6('0x19')]);}_0x517c1c[_0xbca6('0x32')]=qs[_0xbca6('0x33')](_0x317977[_0xbca6('0x2c')][_0xbca6('0x33')]);_0x517c1c[_0xbca6('0x34')]=qs['filters'](_[_0xbca6('0x35')](_0x317977[_0xbca6('0x2c')],_0xdde0ce['filters']));if(_0x317977['query'][_0xbca6('0x36')]){_0x517c1c['where']=_[_0xbca6('0x37')](_0x517c1c[_0xbca6('0x34')],{'$or':_[_0xbca6('0x38')](_0x212c13,function(_0x331cac){if(_0x331cac[_0xbca6('0x39')][_0xbca6('0x3a')]!=='VIRTUAL'){var _0x12da9d={};_0x12da9d[_0x331cac[_0xbca6('0x3b')]]={'$like':'%'+_0x317977[_0xbca6('0x2c')][_0xbca6('0x36')]+'%'};return _0x12da9d;}})});}_0x517c1c=_[_0xbca6('0x37')]({},_0x517c1c,_0x317977['options']);var _0x3d3a2d={'where':_0x517c1c['where']};return db[_0xbca6('0x28')][_0xbca6('0x18')](_0x3d3a2d)[_0xbca6('0x20')](function(_0x5ad5e3){_0x19b6a2[_0xbca6('0x18')]=_0x5ad5e3;if(_0x317977[_0xbca6('0x2c')][_0xbca6('0x3c')]){_0x517c1c[_0xbca6('0x3d')]=[{'all':!![]}];}return db[_0xbca6('0x28')][_0xbca6('0x3e')](_0x517c1c);})[_0xbca6('0x20')](function(_0x2d0527){_0x19b6a2['rows']=_0x2d0527;return _0x19b6a2;})[_0xbca6('0x20')](respondWithFilteredResult(_0x1678e5,_0x517c1c))['catch'](handleError(_0x1678e5,null));};exports['show']=function(_0x118521,_0xcd0040){var _0x3759ce={'raw':!![],'where':{'id':_0x118521[_0xbca6('0x3f')]['id']}},_0x435ae5={};_0x435ae5[_0xbca6('0x2a')]=_[_0xbca6('0x2b')](db[_0xbca6('0x28')][_0xbca6('0x29')]);_0x435ae5[_0xbca6('0x2c')]=_[_0xbca6('0x2b')](_0x118521['query']);_0x435ae5['filters']=_[_0xbca6('0x2e')](_0x435ae5[_0xbca6('0x2a')],_0x435ae5[_0xbca6('0x2c')]);_0x3759ce['attributes']=_[_0xbca6('0x2e')](_0x435ae5['model'],qs[_0xbca6('0x30')](_0x118521['query'][_0xbca6('0x30')]));_0x3759ce['attributes']=_0x3759ce[_0xbca6('0x2f')][_0xbca6('0x31')]?_0x3759ce[_0xbca6('0x2f')]:_0x435ae5[_0xbca6('0x2a')];if(_0x118521['query'][_0xbca6('0x3c')]){_0x3759ce[_0xbca6('0x3d')]=[{'all':!![]}];}_0x3759ce=_['merge']({},_0x3759ce,_0x118521[_0xbca6('0x40')]);return db[_0xbca6('0x28')][_0xbca6('0x41')](_0x3759ce)['then'](handleEntityNotFound(_0xcd0040,null))[_0xbca6('0x20')](respondWithResult(_0xcd0040,null))[_0xbca6('0x42')](handleError(_0xcd0040,null));};exports[_0xbca6('0x43')]=function(_0x238734,_0x29d03a){return db[_0xbca6('0x28')]['create'](_0x238734[_0xbca6('0x44')],{})[_0xbca6('0x20')](respondWithResult(_0x29d03a,0xc9))['catch'](handleError(_0x29d03a,null));};exports['update']=function(_0x41398f,_0x49f8f6){if(_0x41398f[_0xbca6('0x44')]['id']){delete _0x41398f['body']['id'];}return db[_0xbca6('0x28')]['find']({'where':{'id':_0x41398f['params']['id']}})[_0xbca6('0x20')](handleEntityNotFound(_0x49f8f6,null))['then'](saveUpdates(_0x41398f[_0xbca6('0x44')],null))[_0xbca6('0x20')](respondWithResult(_0x49f8f6,null))[_0xbca6('0x42')](handleError(_0x49f8f6,null));};exports['destroy']=function(_0x5be5b2,_0x468fa3){return db['AnalyticTreeReport']['find']({'where':{'id':_0x5be5b2[_0xbca6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x468fa3,null))['then'](removeEntity(_0x468fa3,null))['catch'](handleError(_0x468fa3,null));}; \ No newline at end of file +var _0xf0d9=['../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','error','stack','name','send','index','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','type','key','field','filter','options','AnalyticTreeReport','then','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x101359,_0x196c09){var _0x4886de=function(_0x505e60){while(--_0x505e60){_0x101359['push'](_0x101359['shift']());}};_0x4886de(++_0x196c09);}(_0xf0d9,0x78));var _0x9f0d=function(_0x5b5ca0,_0x4160a0){_0x5b5ca0=_0x5b5ca0-0x0;var _0x4de91b=_0xf0d9[_0x5b5ca0];return _0x4de91b;};'use strict';var pdf=require(_0x9f0d('0x0'));var emlformat=require(_0x9f0d('0x1'));var rimraf=require(_0x9f0d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f0d('0x3'));var rp=require(_0x9f0d('0x4'));var moment=require(_0x9f0d('0x5'));var BPromise=require(_0x9f0d('0x6'));var Mustache=require('mustache');var util=require(_0x9f0d('0x7'));var path=require(_0x9f0d('0x8'));var sox=require(_0x9f0d('0x9'));var csv=require(_0x9f0d('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9f0d('0xa'));var querystring=require(_0x9f0d('0xb'));var Papa=require('papaparse');var Redis=require(_0x9f0d('0xc'));var authService=require(_0x9f0d('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f0d('0xe'))(_0x9f0d('0xf'));var utils=require(_0x9f0d('0x10'));var config=require(_0x9f0d('0x11'));var db=require(_0x9f0d('0x12'))['db'];function respondWithStatusCode(_0x2fa40f,_0x84c425){_0x84c425=_0x84c425||0xcc;return function(_0x1946c9){if(_0x1946c9){return _0x2fa40f[_0x9f0d('0x13')](_0x84c425);}return _0x2fa40f[_0x9f0d('0x14')](_0x84c425)[_0x9f0d('0x15')]();};}function respondWithResult(_0x4fbb74,_0x44b296){_0x44b296=_0x44b296||0xc8;return function(_0x3a3fab){if(_0x3a3fab){return _0x4fbb74[_0x9f0d('0x14')](_0x44b296)[_0x9f0d('0x16')](_0x3a3fab);}};}function respondWithFilteredResult(_0x214ef6,_0x39bd9a){return function(_0x570c08){if(_0x570c08){var _0x48e993=_0x570c08[_0x9f0d('0x17')],_0x1afb69=_0x39bd9a['offset'],_0x30ac2b=_0x39bd9a[_0x9f0d('0x18')]+_0x39bd9a[_0x9f0d('0x19')],_0x210ce6;if(_0x30ac2b>=_0x48e993){_0x30ac2b=_0x48e993;_0x210ce6=0xc8;}else{_0x210ce6=0xce;}_0x214ef6['status'](_0x210ce6);return _0x214ef6[_0x9f0d('0x1a')](_0x9f0d('0x1b'),_0x1afb69+'-'+_0x30ac2b+'/'+_0x48e993)[_0x9f0d('0x16')](_0x570c08);}return null;};}function patchUpdates(_0x3b2233){return function(_0x34eccd){try{jsonpatch['apply'](_0x34eccd,_0x3b2233,!![]);}catch(_0x20e7b2){return BPromise[_0x9f0d('0x1c')](_0x20e7b2);}return _0x34eccd[_0x9f0d('0x1d')]();};}function saveUpdates(_0x3724c9,_0x48817b){return function(_0x3fe6ea){if(_0x3fe6ea){return _0x3fe6ea[_0x9f0d('0x1e')](_0x3724c9)['then'](function(_0x15f52b){return _0x15f52b;});}return null;};}function removeEntity(_0x5f554e,_0x53e2c1){return function(_0x49085c){if(_0x49085c){return _0x49085c['destroy']()['then'](function(){_0x5f554e['status'](0xcc)[_0x9f0d('0x15')]();});}};}function handleEntityNotFound(_0x52fdfa,_0x5360c6){return function(_0x2c972c){if(!_0x2c972c){_0x52fdfa[_0x9f0d('0x13')](0x194);}return _0x2c972c;};}function handleError(_0x252fb7,_0x48fe48){_0x48fe48=_0x48fe48||0x1f4;return function(_0x154cc8){logger[_0x9f0d('0x1f')](_0x154cc8[_0x9f0d('0x20')]);if(_0x154cc8['name']){delete _0x154cc8[_0x9f0d('0x21')];}_0x252fb7[_0x9f0d('0x14')](_0x48fe48)[_0x9f0d('0x22')](_0x154cc8);};}exports[_0x9f0d('0x23')]=function(_0x22f04e,_0x58bb3a){var _0x4b9886={},_0x5eefe3={},_0x30db11={'count':0x0,'rows':[]};var _0x4b0983=db['AnalyticTreeReport'][_0x9f0d('0x24')];_0x5eefe3[_0x9f0d('0x25')]=_['keys'](_0x4b0983);_0x5eefe3[_0x9f0d('0x26')]=_['keys'](_0x22f04e['query']);_0x5eefe3['filters']=_[_0x9f0d('0x27')](_0x5eefe3[_0x9f0d('0x25')],_0x5eefe3[_0x9f0d('0x26')]);_0x4b9886['attributes']=_['intersection'](_0x5eefe3[_0x9f0d('0x25')],qs[_0x9f0d('0x28')](_0x22f04e[_0x9f0d('0x26')]['fields']));_0x4b9886[_0x9f0d('0x29')]=_0x4b9886['attributes'][_0x9f0d('0x2a')]?_0x4b9886['attributes']:_0x5eefe3[_0x9f0d('0x25')];if(!_0x22f04e[_0x9f0d('0x26')][_0x9f0d('0x2b')]('nolimit')){_0x4b9886[_0x9f0d('0x19')]=qs['limit'](_0x22f04e[_0x9f0d('0x26')]['limit']);_0x4b9886[_0x9f0d('0x18')]=qs[_0x9f0d('0x18')](_0x22f04e[_0x9f0d('0x26')][_0x9f0d('0x18')]);}_0x4b9886[_0x9f0d('0x2c')]=qs[_0x9f0d('0x2d')](_0x22f04e[_0x9f0d('0x26')]['sort']);_0x4b9886[_0x9f0d('0x2e')]=qs[_0x9f0d('0x2f')](_[_0x9f0d('0x30')](_0x22f04e['query'],_0x5eefe3[_0x9f0d('0x2f')]));if(_0x22f04e[_0x9f0d('0x26')]['filter']){_0x4b9886[_0x9f0d('0x2e')]=_[_0x9f0d('0x31')](_0x4b9886[_0x9f0d('0x2e')],{'$or':_[_0x9f0d('0x32')](_0x4b0983,function(_0xddc709){if(_0xddc709[_0x9f0d('0x33')][_0x9f0d('0x34')]!=='VIRTUAL'){var _0x1b6179={};_0x1b6179[_0xddc709[_0x9f0d('0x35')]]={'$like':'%'+_0x22f04e['query'][_0x9f0d('0x36')]+'%'};return _0x1b6179;}})});}_0x4b9886=_[_0x9f0d('0x31')]({},_0x4b9886,_0x22f04e[_0x9f0d('0x37')]);var _0x40ac18={'where':_0x4b9886[_0x9f0d('0x2e')]};return db[_0x9f0d('0x38')][_0x9f0d('0x17')](_0x40ac18)[_0x9f0d('0x39')](function(_0x54af32){_0x30db11['count']=_0x54af32;if(_0x22f04e[_0x9f0d('0x26')]['includeAll']){_0x4b9886[_0x9f0d('0x3a')]=[{'all':!![]}];}return db[_0x9f0d('0x38')][_0x9f0d('0x3b')](_0x4b9886);})[_0x9f0d('0x39')](function(_0x189080){_0x30db11[_0x9f0d('0x3c')]=_0x189080;return _0x30db11;})[_0x9f0d('0x39')](respondWithFilteredResult(_0x58bb3a,_0x4b9886))['catch'](handleError(_0x58bb3a,null));};exports[_0x9f0d('0x3d')]=function(_0x3789d2,_0x15da14){var _0x339f96={'raw':!![],'where':{'id':_0x3789d2[_0x9f0d('0x3e')]['id']}},_0x2e3307={};_0x2e3307[_0x9f0d('0x25')]=_[_0x9f0d('0x3f')](db[_0x9f0d('0x38')][_0x9f0d('0x24')]);_0x2e3307['query']=_['keys'](_0x3789d2[_0x9f0d('0x26')]);_0x2e3307['filters']=_[_0x9f0d('0x27')](_0x2e3307['model'],_0x2e3307[_0x9f0d('0x26')]);_0x339f96[_0x9f0d('0x29')]=_[_0x9f0d('0x27')](_0x2e3307[_0x9f0d('0x25')],qs[_0x9f0d('0x28')](_0x3789d2[_0x9f0d('0x26')][_0x9f0d('0x28')]));_0x339f96['attributes']=_0x339f96[_0x9f0d('0x29')][_0x9f0d('0x2a')]?_0x339f96[_0x9f0d('0x29')]:_0x2e3307[_0x9f0d('0x25')];if(_0x3789d2['query'][_0x9f0d('0x40')]){_0x339f96[_0x9f0d('0x3a')]=[{'all':!![]}];}_0x339f96=_[_0x9f0d('0x31')]({},_0x339f96,_0x3789d2['options']);return db[_0x9f0d('0x38')][_0x9f0d('0x41')](_0x339f96)[_0x9f0d('0x39')](handleEntityNotFound(_0x15da14,null))[_0x9f0d('0x39')](respondWithResult(_0x15da14,null))[_0x9f0d('0x42')](handleError(_0x15da14,null));};exports[_0x9f0d('0x43')]=function(_0x40704c,_0x808459){return db[_0x9f0d('0x38')]['create'](_0x40704c[_0x9f0d('0x44')],{})[_0x9f0d('0x39')](respondWithResult(_0x808459,0xc9))[_0x9f0d('0x42')](handleError(_0x808459,null));};exports[_0x9f0d('0x1e')]=function(_0xe01ef9,_0x568634){if(_0xe01ef9['body']['id']){delete _0xe01ef9[_0x9f0d('0x44')]['id'];}return db['AnalyticTreeReport'][_0x9f0d('0x41')]({'where':{'id':_0xe01ef9[_0x9f0d('0x3e')]['id']}})[_0x9f0d('0x39')](handleEntityNotFound(_0x568634,null))[_0x9f0d('0x39')](saveUpdates(_0xe01ef9[_0x9f0d('0x44')],null))['then'](respondWithResult(_0x568634,null))[_0x9f0d('0x42')](handleError(_0x568634,null));};exports['destroy']=function(_0x40726c,_0x2f68f7){return db[_0x9f0d('0x38')]['find']({'where':{'id':_0x40726c[_0x9f0d('0x3e')]['id']}})[_0x9f0d('0x39')](handleEntityNotFound(_0x2f68f7,null))[_0x9f0d('0x39')](removeEntity(_0x2f68f7,null))[_0x9f0d('0x42')](handleError(_0x2f68f7,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 50ac978..8e95f6c 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.model.js +++ b/server/api/analyticTreeReport/analyticTreeReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07fa=['../../config/logger','api','moment','bluebird','path','rimraf','AnalyticTreeReport','util'];(function(_0x206197,_0x661ce4){var _0x912bd3=function(_0x19d8e4){while(--_0x19d8e4){_0x206197['push'](_0x206197['shift']());}};_0x912bd3(++_0x661ce4);}(_0x07fa,0x177));var _0xa07f=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x07fa[_0x4c445a];return _0x2f611c;};'use strict';var _=require('lodash');var util=require(_0xa07f('0x0'));var logger=require(_0xa07f('0x1'))(_0xa07f('0x2'));var moment=require(_0xa07f('0x3'));var BPromise=require(_0xa07f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa07f('0x5'));var rimraf=require(_0xa07f('0x6'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x3fb738,_0x362c91){return _0x3fb738['define'](_0xa07f('0x7'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4888=['define','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x23e2c0,_0x570028){var _0x136704=function(_0x5cb342){while(--_0x5cb342){_0x23e2c0['push'](_0x23e2c0['shift']());}};_0x136704(++_0x570028);}(_0x4888,0x198));var _0x8488=function(_0x245f64,_0x4ae342){_0x245f64=_0x245f64-0x0;var _0x3447e0=_0x4888[_0x245f64];return _0x3447e0;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var logger=require(_0x8488('0x1'))(_0x8488('0x2'));var moment=require(_0x8488('0x3'));var BPromise=require(_0x8488('0x4'));var rp=require(_0x8488('0x5'));var fs=require('fs');var path=require(_0x8488('0x6'));var rimraf=require('rimraf');var config=require(_0x8488('0x7'));var attributes=require(_0x8488('0x8'));module[_0x8488('0x9')]=function(_0x421292,_0x326887){return _0x421292[_0x8488('0xa')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index f7b007b..2ed276f 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e27=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info','request\x20sent','debug','stringify','code','error','message','AnalyticTreeReport,\x20%s,\x20%s','catch','lodash'];(function(_0x35f616,_0xc97542){var _0x4057dc=function(_0x526fd9){while(--_0x526fd9){_0x35f616['push'](_0x35f616['shift']());}};_0x4057dc(++_0xc97542);}(_0x5e27,0x77));var _0x75e2=function(_0x1aead2,_0x33bd89){_0x1aead2=_0x1aead2-0x0;var _0x25553d=_0x5e27[_0x1aead2];return _0x25553d;};'use strict';var _=require(_0x75e2('0x0'));var util=require(_0x75e2('0x1'));var moment=require(_0x75e2('0x2'));var BPromise=require('bluebird');var rs=require(_0x75e2('0x3'));var fs=require('fs');var Redis=require(_0x75e2('0x4'));var db=require(_0x75e2('0x5'))['db'];var utils=require(_0x75e2('0x6'));var logger=require(_0x75e2('0x7'))('rpc');var config=require(_0x75e2('0x8'));var jayson=require(_0x75e2('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27a3c6,_0x1c9dad,_0x267e21){return new BPromise(function(_0xf39971,_0x4a7b32){return client[_0x75e2('0xa')](_0x27a3c6,_0x267e21)['then'](function(_0x1acbb7){logger[_0x75e2('0xb')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c9dad,_0x75e2('0xc'));logger[_0x75e2('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x1c9dad,_0x75e2('0xc'),JSON[_0x75e2('0xe')](_0x1acbb7));if(_0x1acbb7['error']){if(_0x1acbb7['error'][_0x75e2('0xf')]===0x1f4){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x1c9dad,_0x1acbb7[_0x75e2('0x10')][_0x75e2('0x11')]);return _0x4a7b32(_0x1acbb7[_0x75e2('0x10')][_0x75e2('0x11')]);}logger[_0x75e2('0x10')](_0x75e2('0x12'),_0x1c9dad,_0x1acbb7[_0x75e2('0x10')]['message']);return _0xf39971(_0x1acbb7[_0x75e2('0x10')]['message']);}else{logger[_0x75e2('0xb')](_0x75e2('0x12'),_0x1c9dad,_0x75e2('0xc'));_0xf39971(_0x1acbb7['result'][_0x75e2('0x11')]);}})[_0x75e2('0x13')](function(_0x14a8a2){logger[_0x75e2('0x10')](_0x75e2('0x12'),_0x1c9dad,_0x14a8a2);_0x4a7b32(_0x14a8a2);});});} \ No newline at end of file +var _0xa7f0=['lodash','util','moment','randomstring','ioredis','rpc','jayson/promise','client','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x143df7,_0x53fd92){var _0x257eb2=function(_0xc7893b){while(--_0xc7893b){_0x143df7['push'](_0x143df7['shift']());}};_0x257eb2(++_0x53fd92);}(_0xa7f0,0x1e0));var _0x0a7f=function(_0x2dc917,_0x49148e){_0x2dc917=_0x2dc917-0x0;var _0x174097=_0xa7f0[_0x2dc917];return _0x174097;};'use strict';var _=require(_0x0a7f('0x0'));var util=require(_0x0a7f('0x1'));var moment=require(_0x0a7f('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a7f('0x3'));var fs=require('fs');var Redis=require(_0x0a7f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0a7f('0x5'));var config=require('../../config/environment');var jayson=require(_0x0a7f('0x6'));var client=jayson[_0x0a7f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b61b4,_0x445f6e,_0x4c8e4d){return new BPromise(function(_0x2191ca,_0x385a37){return client[_0x0a7f('0x8')](_0x3b61b4,_0x4c8e4d)[_0x0a7f('0x9')](function(_0x26dea6){logger[_0x0a7f('0xa')](_0x0a7f('0xb'),_0x445f6e,_0x0a7f('0xc'));logger[_0x0a7f('0xd')](_0x0a7f('0xe'),_0x445f6e,_0x0a7f('0xc'),JSON['stringify'](_0x26dea6));if(_0x26dea6[_0x0a7f('0xf')]){if(_0x26dea6[_0x0a7f('0xf')][_0x0a7f('0x10')]===0x1f4){logger[_0x0a7f('0xf')]('AnalyticTreeReport,\x20%s,\x20%s',_0x445f6e,_0x26dea6['error']['message']);return _0x385a37(_0x26dea6[_0x0a7f('0xf')][_0x0a7f('0x11')]);}logger[_0x0a7f('0xf')]('AnalyticTreeReport,\x20%s,\x20%s',_0x445f6e,_0x26dea6[_0x0a7f('0xf')][_0x0a7f('0x11')]);return _0x2191ca(_0x26dea6[_0x0a7f('0xf')][_0x0a7f('0x11')]);}else{logger['info'](_0x0a7f('0xb'),_0x445f6e,_0x0a7f('0xc'));_0x2191ca(_0x26dea6[_0x0a7f('0x12')][_0x0a7f('0x11')]);}})[_0x0a7f('0x13')](function(_0x8819c5){logger[_0x0a7f('0xf')](_0x0a7f('0xb'),_0x445f6e,_0x8819c5);_0x385a37(_0x8819c5);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index b2bce2a..649b707 100644 --- a/server/api/analyticTreeReport/index.js +++ b/server/api/analyticTreeReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80f6=['show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x1efbf0,_0x340627){var _0x188287=function(_0x3ac30c){while(--_0x3ac30c){_0x1efbf0['push'](_0x1efbf0['shift']());}};_0x188287(++_0x340627);}(_0x80f6,0x15d));var _0x680f=function(_0x22574d,_0x29679a){_0x22574d=_0x22574d-0x0;var _0x4ef855=_0x80f6[_0x22574d];return _0x4ef855;};'use strict';var multer=require(_0x680f('0x0'));var util=require(_0x680f('0x1'));var path=require(_0x680f('0x2'));var timeout=require(_0x680f('0x3'));var express=require(_0x680f('0x4'));var router=express[_0x680f('0x5')]();var auth=require(_0x680f('0x6'));var interaction=require(_0x680f('0x7'));var config=require(_0x680f('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x680f('0x9')]('/',auth[_0x680f('0xa')](),controller['index']);router[_0x680f('0x9')](_0x680f('0xb'),auth['isAuthenticated'](),controller[_0x680f('0xc')]);router[_0x680f('0xd')]('/',auth[_0x680f('0xa')](),controller[_0x680f('0xe')]);router[_0x680f('0xf')](_0x680f('0xb'),auth[_0x680f('0xa')](),controller[_0x680f('0x10')]);router[_0x680f('0x11')](_0x680f('0xb'),auth[_0x680f('0xa')](),controller[_0x680f('0x12')]);module['exports']=router; \ No newline at end of file +var _0xdf12=['/:id','isAuthenticated','post','create','put','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','index'];(function(_0x1bdfb6,_0x19794b){var _0x39c68c=function(_0x564f32){while(--_0x564f32){_0x1bdfb6['push'](_0x1bdfb6['shift']());}};_0x39c68c(++_0x19794b);}(_0xdf12,0x1e7));var _0x2df1=function(_0xeb3cb4,_0x57c932){_0xeb3cb4=_0xeb3cb4-0x0;var _0x143269=_0xdf12[_0xeb3cb4];return _0x143269;};'use strict';var multer=require(_0x2df1('0x0'));var util=require('util');var path=require(_0x2df1('0x1'));var timeout=require(_0x2df1('0x2'));var express=require('express');var router=express[_0x2df1('0x3')]();var auth=require(_0x2df1('0x4'));var interaction=require(_0x2df1('0x5'));var config=require('../../config/environment');var controller=require(_0x2df1('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x2df1('0x7')]);router['get'](_0x2df1('0x8'),auth[_0x2df1('0x9')](),controller['show']);router[_0x2df1('0xa')]('/',auth[_0x2df1('0x9')](),controller[_0x2df1('0xb')]);router[_0x2df1('0xc')](_0x2df1('0x8'),auth[_0x2df1('0x9')](),controller['update']);router[_0x2df1('0xd')](_0x2df1('0x8'),auth[_0x2df1('0x9')](),controller['destroy']);module[_0x2df1('0xe')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index d708b0a..4eccff3 100644 --- a/server/api/attachment/attachment.attributes.js +++ b/server/api/attachment/attachment.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2ce=['sequelize','STRING'];(function(_0x18a16d,_0x199976){var _0x21cf0c=function(_0x2717d1){while(--_0x2717d1){_0x18a16d['push'](_0x18a16d['shift']());}};_0x21cf0c(++_0x199976);}(_0xc2ce,0xcc));var _0xec2c=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xc2ce[_0x45e98e];return _0x374dba;};'use strict';var Sequelize=require(_0xec2c('0x0'));module['exports']={'name':{'type':Sequelize[_0xec2c('0x1')]},'basename':{'type':Sequelize[_0xec2c('0x1')]},'type':{'type':Sequelize[_0xec2c('0x1')]}}; \ No newline at end of file +var _0x9774=['STRING','exports'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x9774,0x131));var _0x4977=function(_0x2d9780,_0x11a964){_0x2d9780=_0x2d9780-0x0;var _0x9014ac=_0x9774[_0x2d9780];return _0x9014ac;};'use strict';var Sequelize=require('sequelize');module[_0x4977('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x4977('0x1')]},'type':{'type':Sequelize[_0x4977('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index fe218a2..3d0a84b 100644 --- a/server/api/attachment/attachment.controller.js +++ b/server/api/attachment/attachment.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f94=['error','stack','name','index','Attachment','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','rawAttributes','length','include','find','update','body','params','originalname','file','create','download','findOne','join','root','server/files/attachments/','basename','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','reject','then','destroy'];(function(_0x54daf5,_0x528643){var _0xf70158=function(_0x4902d6){while(--_0x4902d6){_0x54daf5['push'](_0x54daf5['shift']());}};_0xf70158(++_0x528643);}(_0x2f94,0x117));var _0x42f9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2f94[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x42f9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x42f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42f9('0x2'));var rp=require(_0x42f9('0x3'));var moment=require(_0x42f9('0x4'));var BPromise=require(_0x42f9('0x5'));var Mustache=require(_0x42f9('0x6'));var util=require(_0x42f9('0x7'));var path=require(_0x42f9('0x8'));var sox=require(_0x42f9('0x9'));var csv=require(_0x42f9('0xa'));var ejs=require(_0x42f9('0xb'));var fs=require('fs');var _=require(_0x42f9('0xc'));var squel=require('squel');var crypto=require(_0x42f9('0xd'));var jsforce=require(_0x42f9('0xe'));var deskjs=require(_0x42f9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x42f9('0x10'));var Papa=require(_0x42f9('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x42f9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x42f9('0x13'))(_0x42f9('0x14'));var utils=require('../../config/utils');var config=require(_0x42f9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17cdab,_0x15712e){_0x15712e=_0x15712e||0xcc;return function(_0x5d6dc5){if(_0x5d6dc5){return _0x17cdab[_0x42f9('0x16')](_0x15712e);}return _0x17cdab[_0x42f9('0x17')](_0x15712e)[_0x42f9('0x18')]();};}function respondWithResult(_0xd0b6e7,_0x92a73a){_0x92a73a=_0x92a73a||0xc8;return function(_0x266276){if(_0x266276){return _0xd0b6e7[_0x42f9('0x17')](_0x92a73a)[_0x42f9('0x19')](_0x266276);}};}function respondWithFilteredResult(_0x46dede,_0x17229a){return function(_0x8e09c8){if(_0x8e09c8){var _0x1edfdf=_0x8e09c8['count'],_0x4c9aed=_0x17229a[_0x42f9('0x1a')],_0x1c06fb=_0x17229a[_0x42f9('0x1a')]+_0x17229a[_0x42f9('0x1b')],_0x468d81;if(_0x1c06fb>=_0x1edfdf){_0x1c06fb=_0x1edfdf;_0x468d81=0xc8;}else{_0x468d81=0xce;}_0x46dede[_0x42f9('0x17')](_0x468d81);return _0x46dede[_0x42f9('0x1c')]('Content-Range',_0x4c9aed+'-'+_0x1c06fb+'/'+_0x1edfdf)['json'](_0x8e09c8);}return null;};}function patchUpdates(_0x10ff80){return function(_0x3ed13b){try{jsonpatch[_0x42f9('0x1d')](_0x3ed13b,_0x10ff80,!![]);}catch(_0x1c0d72){return BPromise[_0x42f9('0x1e')](_0x1c0d72);}return _0x3ed13b['save']();};}function saveUpdates(_0x562a96,_0x227afc){return function(_0x575be7){if(_0x575be7){return _0x575be7['update'](_0x562a96)[_0x42f9('0x1f')](function(_0xd79e4f){return _0xd79e4f;});}return null;};}function removeEntity(_0x26b469,_0x2960b8){return function(_0x585827){if(_0x585827){return _0x585827[_0x42f9('0x20')]()[_0x42f9('0x1f')](function(){_0x26b469[_0x42f9('0x17')](0xcc)[_0x42f9('0x18')]();});}};}function handleEntityNotFound(_0x3b664b,_0x55b079){return function(_0x2677ee){if(!_0x2677ee){_0x3b664b['sendStatus'](0x194);}return _0x2677ee;};}function handleError(_0x1c4c5b,_0x477322){_0x477322=_0x477322||0x1f4;return function(_0xd2fd1d){logger[_0x42f9('0x21')](_0xd2fd1d[_0x42f9('0x22')]);if(_0xd2fd1d[_0x42f9('0x23')]){delete _0xd2fd1d[_0x42f9('0x23')];}_0x1c4c5b['status'](_0x477322)['send'](_0xd2fd1d);};}exports[_0x42f9('0x24')]=function(_0x17b093,_0x54b006){var _0x48b668={},_0x330eca={},_0x48003c={'count':0x0,'rows':[]};var _0x36f958=db[_0x42f9('0x25')]['rawAttributes'];_0x330eca[_0x42f9('0x26')]=_[_0x42f9('0x27')](_0x36f958);_0x330eca[_0x42f9('0x28')]=_[_0x42f9('0x27')](_0x17b093[_0x42f9('0x28')]);_0x330eca['filters']=_[_0x42f9('0x29')](_0x330eca[_0x42f9('0x26')],_0x330eca[_0x42f9('0x28')]);_0x48b668[_0x42f9('0x2a')]=_[_0x42f9('0x29')](_0x330eca[_0x42f9('0x26')],qs[_0x42f9('0x2b')](_0x17b093[_0x42f9('0x28')][_0x42f9('0x2b')]));_0x48b668[_0x42f9('0x2a')]=_0x48b668[_0x42f9('0x2a')]['length']?_0x48b668[_0x42f9('0x2a')]:_0x330eca[_0x42f9('0x26')];if(!_0x17b093[_0x42f9('0x28')][_0x42f9('0x2c')](_0x42f9('0x2d'))){_0x48b668[_0x42f9('0x1b')]=qs['limit'](_0x17b093[_0x42f9('0x28')][_0x42f9('0x1b')]);_0x48b668[_0x42f9('0x1a')]=qs['offset'](_0x17b093[_0x42f9('0x28')][_0x42f9('0x1a')]);}_0x48b668['order']=qs[_0x42f9('0x2e')](_0x17b093[_0x42f9('0x28')][_0x42f9('0x2e')]);_0x48b668[_0x42f9('0x2f')]=qs[_0x42f9('0x30')](_[_0x42f9('0x31')](_0x17b093[_0x42f9('0x28')],_0x330eca['filters']));if(_0x17b093[_0x42f9('0x28')][_0x42f9('0x32')]){_0x48b668[_0x42f9('0x2f')]=_[_0x42f9('0x33')](_0x48b668[_0x42f9('0x2f')],{'$or':_[_0x42f9('0x34')](_0x36f958,function(_0x392972){if(_0x392972[_0x42f9('0x35')]['key']!==_0x42f9('0x36')){var _0x4388a7={};_0x4388a7[_0x392972[_0x42f9('0x37')]]={'$like':'%'+_0x17b093[_0x42f9('0x28')]['filter']+'%'};return _0x4388a7;}})});}_0x48b668=_[_0x42f9('0x33')]({},_0x48b668,_0x17b093[_0x42f9('0x38')]);var _0x57bd0c={'where':_0x48b668['where']};return db[_0x42f9('0x25')][_0x42f9('0x39')](_0x57bd0c)[_0x42f9('0x1f')](function(_0x33c99e){_0x48003c[_0x42f9('0x39')]=_0x33c99e;if(_0x17b093[_0x42f9('0x28')][_0x42f9('0x3a')]){_0x48b668['include']=[{'all':!![]}];}return db['Attachment'][_0x42f9('0x3b')](_0x48b668);})[_0x42f9('0x1f')](function(_0x244356){_0x48003c[_0x42f9('0x3c')]=_0x244356;return _0x48003c;})['then'](respondWithFilteredResult(_0x54b006,_0x48b668))[_0x42f9('0x3d')](handleError(_0x54b006,null));};exports['show']=function(_0x470a0b,_0x1daa25){var _0x18ae04={'raw':!![],'where':{'id':_0x470a0b['params']['id']}},_0x3b7e7a={};_0x3b7e7a[_0x42f9('0x26')]=_['keys'](db['Attachment'][_0x42f9('0x3e')]);_0x3b7e7a['query']=_['keys'](_0x470a0b[_0x42f9('0x28')]);_0x3b7e7a[_0x42f9('0x30')]=_[_0x42f9('0x29')](_0x3b7e7a[_0x42f9('0x26')],_0x3b7e7a[_0x42f9('0x28')]);_0x18ae04[_0x42f9('0x2a')]=_[_0x42f9('0x29')](_0x3b7e7a['model'],qs['fields'](_0x470a0b['query']['fields']));_0x18ae04['attributes']=_0x18ae04[_0x42f9('0x2a')][_0x42f9('0x3f')]?_0x18ae04[_0x42f9('0x2a')]:_0x3b7e7a[_0x42f9('0x26')];if(_0x470a0b['query']['includeAll']){_0x18ae04[_0x42f9('0x40')]=[{'all':!![]}];}_0x18ae04=_[_0x42f9('0x33')]({},_0x18ae04,_0x470a0b[_0x42f9('0x38')]);return db[_0x42f9('0x25')][_0x42f9('0x41')](_0x18ae04)[_0x42f9('0x1f')](handleEntityNotFound(_0x1daa25,null))['then'](respondWithResult(_0x1daa25,null))['catch'](handleError(_0x1daa25,null));};exports[_0x42f9('0x42')]=function(_0x5ae51e,_0x52e7e6){if(_0x5ae51e['body']['id']){delete _0x5ae51e[_0x42f9('0x43')]['id'];}return db[_0x42f9('0x25')][_0x42f9('0x41')]({'where':{'id':_0x5ae51e['params']['id']}})['then'](handleEntityNotFound(_0x52e7e6,null))['then'](saveUpdates(_0x5ae51e[_0x42f9('0x43')],null))[_0x42f9('0x1f')](respondWithResult(_0x52e7e6,null))[_0x42f9('0x3d')](handleError(_0x52e7e6,null));};exports['destroy']=function(_0x3e200f,_0x328596){return db['Attachment'][_0x42f9('0x41')]({'where':{'id':_0x3e200f[_0x42f9('0x44')]['id']}})[_0x42f9('0x1f')](handleEntityNotFound(_0x328596,null))['then'](removeEntity(_0x328596,null))['catch'](handleError(_0x328596,null));};exports['create']=function(_0x588c7c,_0x474e8e,_0x1457ef){_0x588c7c['body'][_0x42f9('0x23')]=_0x588c7c['file'][_0x42f9('0x45')];_0x588c7c[_0x42f9('0x43')]['basename']=_0x588c7c[_0x42f9('0x46')]['filename'];_0x588c7c[_0x42f9('0x43')]['type']=_0x588c7c[_0x42f9('0x46')]['mimetype'];return db[_0x42f9('0x25')][_0x42f9('0x47')](_0x588c7c[_0x42f9('0x43')])[_0x42f9('0x1f')](respondWithResult(_0x474e8e,0xc9))['catch'](handleError(_0x474e8e,null));};exports[_0x42f9('0x48')]=function(_0x12744a,_0x3f87f1,_0x471b91){return db[_0x42f9('0x25')][_0x42f9('0x49')]({'where':{'id':_0x12744a[_0x42f9('0x44')]['id']},'raw':!![]})[_0x42f9('0x1f')](handleEntityNotFound(_0x3f87f1,null))[_0x42f9('0x1f')](function(_0x69c460){if(_0x69c460){return _0x3f87f1[_0x42f9('0x48')](path[_0x42f9('0x4a')](config[_0x42f9('0x4b')],_0x42f9('0x4c'),_0x69c460[_0x42f9('0x4d')]));}})[_0x42f9('0x3d')](handleError(_0x3f87f1,null));}; \ No newline at end of file +var _0x1e4c=['end','json','offset','limit','set','save','update','then','error','name','send','index','Attachment','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','options','count','findAll','catch','show','params','include','find','body','destroy','create','file','originalname','basename','filename','mimetype','findOne','download','join','root','server/files/attachments/','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x330740,_0x58c0c0){var _0x1cb5f2=function(_0xa5c99a){while(--_0xa5c99a){_0x330740['push'](_0x330740['shift']());}};_0x1cb5f2(++_0x58c0c0);}(_0x1e4c,0x1bc));var _0xc1e4=function(_0x3a8b2d,_0x5e6413){_0x3a8b2d=_0x3a8b2d-0x0;var _0x444072=_0x1e4c[_0x3a8b2d];return _0x444072;};'use strict';var pdf=require(_0xc1e4('0x0'));var emlformat=require(_0xc1e4('0x1'));var rimraf=require(_0xc1e4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1e4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc1e4('0x4'));var Mustache=require(_0xc1e4('0x5'));var util=require(_0xc1e4('0x6'));var path=require('path');var sox=require(_0xc1e4('0x7'));var csv=require(_0xc1e4('0x8'));var ejs=require(_0xc1e4('0x9'));var fs=require('fs');var _=require(_0xc1e4('0xa'));var squel=require(_0xc1e4('0xb'));var crypto=require('crypto');var jsforce=require(_0xc1e4('0xc'));var deskjs=require(_0xc1e4('0xd'));var toCsv=require(_0xc1e4('0x8'));var querystring=require('querystring');var Papa=require(_0xc1e4('0xe'));var Redis=require('ioredis');var authService=require(_0xc1e4('0xf'));var qs=require(_0xc1e4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc1e4('0x11'))(_0xc1e4('0x12'));var utils=require(_0xc1e4('0x13'));var config=require(_0xc1e4('0x14'));var db=require(_0xc1e4('0x15'))['db'];function respondWithStatusCode(_0x1b735c,_0x53cb50){_0x53cb50=_0x53cb50||0xcc;return function(_0x1819f4){if(_0x1819f4){return _0x1b735c[_0xc1e4('0x16')](_0x53cb50);}return _0x1b735c[_0xc1e4('0x17')](_0x53cb50)[_0xc1e4('0x18')]();};}function respondWithResult(_0x59cc63,_0x4536b0){_0x4536b0=_0x4536b0||0xc8;return function(_0x12c535){if(_0x12c535){return _0x59cc63[_0xc1e4('0x17')](_0x4536b0)[_0xc1e4('0x19')](_0x12c535);}};}function respondWithFilteredResult(_0x4f7351,_0x2258ea){return function(_0x3a72e4){if(_0x3a72e4){var _0x264a5f=_0x3a72e4['count'],_0x938763=_0x2258ea[_0xc1e4('0x1a')],_0x34d21c=_0x2258ea[_0xc1e4('0x1a')]+_0x2258ea[_0xc1e4('0x1b')],_0x439b2c;if(_0x34d21c>=_0x264a5f){_0x34d21c=_0x264a5f;_0x439b2c=0xc8;}else{_0x439b2c=0xce;}_0x4f7351[_0xc1e4('0x17')](_0x439b2c);return _0x4f7351[_0xc1e4('0x1c')]('Content-Range',_0x938763+'-'+_0x34d21c+'/'+_0x264a5f)[_0xc1e4('0x19')](_0x3a72e4);}return null;};}function patchUpdates(_0x20717d){return function(_0x45f5ac){try{jsonpatch['apply'](_0x45f5ac,_0x20717d,!![]);}catch(_0x41e73b){return BPromise['reject'](_0x41e73b);}return _0x45f5ac[_0xc1e4('0x1d')]();};}function saveUpdates(_0x1c5ef1,_0x8cdf6e){return function(_0x5b1bb6){if(_0x5b1bb6){return _0x5b1bb6[_0xc1e4('0x1e')](_0x1c5ef1)[_0xc1e4('0x1f')](function(_0x5a25fe){return _0x5a25fe;});}return null;};}function removeEntity(_0x291d0a,_0x31a77a){return function(_0x6413ff){if(_0x6413ff){return _0x6413ff['destroy']()['then'](function(){_0x291d0a[_0xc1e4('0x17')](0xcc)[_0xc1e4('0x18')]();});}};}function handleEntityNotFound(_0x7edf1e,_0x550bdd){return function(_0x24b693){if(!_0x24b693){_0x7edf1e['sendStatus'](0x194);}return _0x24b693;};}function handleError(_0x300892,_0xd7ad52){_0xd7ad52=_0xd7ad52||0x1f4;return function(_0x5b2ff7){logger[_0xc1e4('0x20')](_0x5b2ff7['stack']);if(_0x5b2ff7[_0xc1e4('0x21')]){delete _0x5b2ff7[_0xc1e4('0x21')];}_0x300892[_0xc1e4('0x17')](_0xd7ad52)[_0xc1e4('0x22')](_0x5b2ff7);};}exports[_0xc1e4('0x23')]=function(_0x33b936,_0x7d2145){var _0x40c713={},_0x4a6cda={},_0x478a3b={'count':0x0,'rows':[]};var _0x3c1e7d=db[_0xc1e4('0x24')][_0xc1e4('0x25')];_0x4a6cda[_0xc1e4('0x26')]=_[_0xc1e4('0x27')](_0x3c1e7d);_0x4a6cda[_0xc1e4('0x28')]=_['keys'](_0x33b936[_0xc1e4('0x28')]);_0x4a6cda['filters']=_[_0xc1e4('0x29')](_0x4a6cda['model'],_0x4a6cda[_0xc1e4('0x28')]);_0x40c713['attributes']=_[_0xc1e4('0x29')](_0x4a6cda[_0xc1e4('0x26')],qs[_0xc1e4('0x2a')](_0x33b936[_0xc1e4('0x28')][_0xc1e4('0x2a')]));_0x40c713[_0xc1e4('0x2b')]=_0x40c713['attributes'][_0xc1e4('0x2c')]?_0x40c713['attributes']:_0x4a6cda[_0xc1e4('0x26')];if(!_0x33b936[_0xc1e4('0x28')][_0xc1e4('0x2d')](_0xc1e4('0x2e'))){_0x40c713[_0xc1e4('0x1b')]=qs['limit'](_0x33b936[_0xc1e4('0x28')]['limit']);_0x40c713[_0xc1e4('0x1a')]=qs[_0xc1e4('0x1a')](_0x33b936[_0xc1e4('0x28')][_0xc1e4('0x1a')]);}_0x40c713[_0xc1e4('0x2f')]=qs[_0xc1e4('0x30')](_0x33b936[_0xc1e4('0x28')][_0xc1e4('0x30')]);_0x40c713[_0xc1e4('0x31')]=qs[_0xc1e4('0x32')](_[_0xc1e4('0x33')](_0x33b936[_0xc1e4('0x28')],_0x4a6cda[_0xc1e4('0x32')]));if(_0x33b936[_0xc1e4('0x28')][_0xc1e4('0x34')]){_0x40c713[_0xc1e4('0x31')]=_[_0xc1e4('0x35')](_0x40c713['where'],{'$or':_[_0xc1e4('0x36')](_0x3c1e7d,function(_0x32c77d){if(_0x32c77d['type'][_0xc1e4('0x37')]!==_0xc1e4('0x38')){var _0x4ff58a={};_0x4ff58a[_0x32c77d['field']]={'$like':'%'+_0x33b936[_0xc1e4('0x28')]['filter']+'%'};return _0x4ff58a;}})});}_0x40c713=_[_0xc1e4('0x35')]({},_0x40c713,_0x33b936[_0xc1e4('0x39')]);var _0x377c1e={'where':_0x40c713[_0xc1e4('0x31')]};return db[_0xc1e4('0x24')][_0xc1e4('0x3a')](_0x377c1e)[_0xc1e4('0x1f')](function(_0x1bf49d){_0x478a3b[_0xc1e4('0x3a')]=_0x1bf49d;if(_0x33b936[_0xc1e4('0x28')]['includeAll']){_0x40c713['include']=[{'all':!![]}];}return db[_0xc1e4('0x24')][_0xc1e4('0x3b')](_0x40c713);})[_0xc1e4('0x1f')](function(_0x220f5a){_0x478a3b['rows']=_0x220f5a;return _0x478a3b;})[_0xc1e4('0x1f')](respondWithFilteredResult(_0x7d2145,_0x40c713))[_0xc1e4('0x3c')](handleError(_0x7d2145,null));};exports[_0xc1e4('0x3d')]=function(_0x2f85a8,_0x570291){var _0x233c2e={'raw':!![],'where':{'id':_0x2f85a8[_0xc1e4('0x3e')]['id']}},_0x543d0f={};_0x543d0f[_0xc1e4('0x26')]=_[_0xc1e4('0x27')](db[_0xc1e4('0x24')][_0xc1e4('0x25')]);_0x543d0f[_0xc1e4('0x28')]=_[_0xc1e4('0x27')](_0x2f85a8[_0xc1e4('0x28')]);_0x543d0f[_0xc1e4('0x32')]=_[_0xc1e4('0x29')](_0x543d0f['model'],_0x543d0f[_0xc1e4('0x28')]);_0x233c2e[_0xc1e4('0x2b')]=_[_0xc1e4('0x29')](_0x543d0f['model'],qs[_0xc1e4('0x2a')](_0x2f85a8['query']['fields']));_0x233c2e['attributes']=_0x233c2e[_0xc1e4('0x2b')][_0xc1e4('0x2c')]?_0x233c2e['attributes']:_0x543d0f[_0xc1e4('0x26')];if(_0x2f85a8[_0xc1e4('0x28')]['includeAll']){_0x233c2e[_0xc1e4('0x3f')]=[{'all':!![]}];}_0x233c2e=_[_0xc1e4('0x35')]({},_0x233c2e,_0x2f85a8[_0xc1e4('0x39')]);return db[_0xc1e4('0x24')][_0xc1e4('0x40')](_0x233c2e)[_0xc1e4('0x1f')](handleEntityNotFound(_0x570291,null))['then'](respondWithResult(_0x570291,null))[_0xc1e4('0x3c')](handleError(_0x570291,null));};exports[_0xc1e4('0x1e')]=function(_0x12ca53,_0x5d6e84){if(_0x12ca53[_0xc1e4('0x41')]['id']){delete _0x12ca53[_0xc1e4('0x41')]['id'];}return db[_0xc1e4('0x24')]['find']({'where':{'id':_0x12ca53[_0xc1e4('0x3e')]['id']}})[_0xc1e4('0x1f')](handleEntityNotFound(_0x5d6e84,null))['then'](saveUpdates(_0x12ca53[_0xc1e4('0x41')],null))['then'](respondWithResult(_0x5d6e84,null))[_0xc1e4('0x3c')](handleError(_0x5d6e84,null));};exports[_0xc1e4('0x42')]=function(_0x289f5a,_0x56f87e){return db['Attachment']['find']({'where':{'id':_0x289f5a[_0xc1e4('0x3e')]['id']}})[_0xc1e4('0x1f')](handleEntityNotFound(_0x56f87e,null))['then'](removeEntity(_0x56f87e,null))['catch'](handleError(_0x56f87e,null));};exports[_0xc1e4('0x43')]=function(_0x15b1f7,_0x4d6dfb,_0x8ca46c){_0x15b1f7[_0xc1e4('0x41')][_0xc1e4('0x21')]=_0x15b1f7[_0xc1e4('0x44')][_0xc1e4('0x45')];_0x15b1f7[_0xc1e4('0x41')][_0xc1e4('0x46')]=_0x15b1f7['file'][_0xc1e4('0x47')];_0x15b1f7[_0xc1e4('0x41')]['type']=_0x15b1f7[_0xc1e4('0x44')][_0xc1e4('0x48')];return db[_0xc1e4('0x24')][_0xc1e4('0x43')](_0x15b1f7[_0xc1e4('0x41')])['then'](respondWithResult(_0x4d6dfb,0xc9))['catch'](handleError(_0x4d6dfb,null));};exports['download']=function(_0x3e642c,_0x1a921b,_0x35c6aa){return db[_0xc1e4('0x24')][_0xc1e4('0x49')]({'where':{'id':_0x3e642c[_0xc1e4('0x3e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1a921b,null))[_0xc1e4('0x1f')](function(_0x118fc5){if(_0x118fc5){return _0x1a921b[_0xc1e4('0x4a')](path[_0xc1e4('0x4b')](config[_0xc1e4('0x4c')],_0xc1e4('0x4d'),_0x118fc5[_0xc1e4('0x46')]));}})['catch'](handleError(_0x1a921b,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 1ec5bcd..10b3238 100644 --- a/server/api/attachment/attachment.model.js +++ b/server/api/attachment/attachment.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f54=['bluebird','request-promise','path','rimraf','./attachment.attributes','Attachment','attachments','lodash','util','../../config/logger'];(function(_0x245f63,_0x59d966){var _0x994f7b=function(_0x261cae){while(--_0x261cae){_0x245f63['push'](_0x245f63['shift']());}};_0x994f7b(++_0x59d966);}(_0x6f54,0xcf));var _0x46f5=function(_0xb139a0,_0x30f8b1){_0xb139a0=_0xb139a0-0x0;var _0x7a2108=_0x6f54[_0xb139a0];return _0x7a2108;};'use strict';var _=require(_0x46f5('0x0'));var util=require(_0x46f5('0x1'));var logger=require(_0x46f5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x46f5('0x3'));var rp=require(_0x46f5('0x4'));var fs=require('fs');var path=require(_0x46f5('0x5'));var rimraf=require(_0x46f5('0x6'));var config=require('../../config/environment');var attributes=require(_0x46f5('0x7'));module['exports']=function(_0x479d56,_0x21c3d2){return _0x479d56['define'](_0x46f5('0x8'),attributes,{'tableName':_0x46f5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bd1=['attachments','lodash','util','../../config/logger','moment','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x1dbe16,_0x3700df){var _0x31db74=function(_0x158d0e){while(--_0x158d0e){_0x1dbe16['push'](_0x1dbe16['shift']());}};_0x31db74(++_0x3700df);}(_0x1bd1,0x123));var _0x11bd=function(_0x339567,_0x399536){_0x339567=_0x339567-0x0;var _0x2b3335=_0x1bd1[_0x339567];return _0x2b3335;};'use strict';var _=require(_0x11bd('0x0'));var util=require(_0x11bd('0x1'));var logger=require(_0x11bd('0x2'))('api');var moment=require(_0x11bd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x11bd('0x4'));var attributes=require(_0x11bd('0x5'));module[_0x11bd('0x6')]=function(_0x612ff3,_0x57c032){return _0x612ff3[_0x11bd('0x7')](_0x11bd('0x8'),attributes,{'tableName':_0x11bd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 6f07d9d..4ef7f2c 100644 --- a/server/api/attachment/attachment.rpc.js +++ b/server/api/attachment/attachment.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x071e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0x071e,0x1bd));var _0xe071=function(_0xe01693,_0x474e53){_0xe01693=_0xe01693-0x0;var _0x568eaf=_0x071e[_0xe01693];return _0x568eaf;};'use strict';var _=require(_0xe071('0x0'));var util=require(_0xe071('0x1'));var moment=require(_0xe071('0x2'));var BPromise=require(_0xe071('0x3'));var rs=require(_0xe071('0x4'));var fs=require('fs');var Redis=require(_0xe071('0x5'));var db=require(_0xe071('0x6'))['db'];var utils=require(_0xe071('0x7'));var logger=require(_0xe071('0x8'))(_0xe071('0x9'));var config=require(_0xe071('0xa'));var jayson=require(_0xe071('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2172ca,_0x284206,_0x49285d){return new BPromise(function(_0x1a6b80,_0x77046){return client[_0xe071('0xc')](_0x2172ca,_0x49285d)['then'](function(_0x1d975b){logger[_0xe071('0xd')](_0xe071('0xe'),_0x284206,_0xe071('0xf'));logger[_0xe071('0x10')](_0xe071('0x11'),_0x284206,_0xe071('0xf'),JSON[_0xe071('0x12')](_0x1d975b));if(_0x1d975b[_0xe071('0x13')]){if(_0x1d975b[_0xe071('0x13')]['code']===0x1f4){logger[_0xe071('0x13')](_0xe071('0xe'),_0x284206,_0x1d975b[_0xe071('0x13')][_0xe071('0x14')]);return _0x77046(_0x1d975b[_0xe071('0x13')]['message']);}logger[_0xe071('0x13')](_0xe071('0xe'),_0x284206,_0x1d975b[_0xe071('0x13')]['message']);return _0x1a6b80(_0x1d975b[_0xe071('0x13')][_0xe071('0x14')]);}else{logger[_0xe071('0xd')](_0xe071('0xe'),_0x284206,_0xe071('0xf'));_0x1a6b80(_0x1d975b[_0xe071('0x15')]['message']);}})[_0xe071('0x16')](function(_0x23b7e7){logger['error'](_0xe071('0xe'),_0x284206,_0x23b7e7);_0x77046(_0x23b7e7);});});}exports[_0xe071('0x17')]=function(_0x546586){var _0x45212e=this;return new Promise(function(_0x42d0b8,_0x9347e3){return db[_0xe071('0x18')][_0xe071('0x19')](_0x546586[_0xe071('0x1a')],{'raw':_0x546586[_0xe071('0x1b')]?_0x546586[_0xe071('0x1b')][_0xe071('0x1c')]===undefined?!![]:![]:!![]})[_0xe071('0x1d')](function(_0x23b65f){logger['info']('CreateAttachment',_0x546586);logger[_0xe071('0x10')](_0xe071('0x17'),_0x546586,JSON[_0xe071('0x12')](_0x23b65f));_0x42d0b8(_0x23b65f);})[_0xe071('0x16')](function(_0x5da0aa){logger['error'](_0xe071('0x17'),_0x5da0aa[_0xe071('0x14')],_0x546586);_0x9347e3(_0x45212e[_0xe071('0x13')](0x1f4,_0x5da0aa['message']));});});}; \ No newline at end of file +var _0x52c6=['lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateAttachment','body','options','raw'];(function(_0x1a2172,_0x184053){var _0x3a899b=function(_0x4d9d6c){while(--_0x4d9d6c){_0x1a2172['push'](_0x1a2172['shift']());}};_0x3a899b(++_0x184053);}(_0x52c6,0x160));var _0x652c=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x52c6[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x652c('0x0'));var util=require('util');var moment=require(_0x652c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x652c('0x2'));var db=require(_0x652c('0x3'))['db'];var utils=require(_0x652c('0x4'));var logger=require('../../config/logger')(_0x652c('0x5'));var config=require(_0x652c('0x6'));var jayson=require(_0x652c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cee6c,_0x16c70c,_0x5b40ca){return new BPromise(function(_0x732ab8,_0x1f71df){return client[_0x652c('0x8')](_0x5cee6c,_0x5b40ca)[_0x652c('0x9')](function(_0x7bde8b){logger['info'](_0x652c('0xa'),_0x16c70c,_0x652c('0xb'));logger[_0x652c('0xc')](_0x652c('0xd'),_0x16c70c,'request\x20sent',JSON[_0x652c('0xe')](_0x7bde8b));if(_0x7bde8b[_0x652c('0xf')]){if(_0x7bde8b[_0x652c('0xf')]['code']===0x1f4){logger['error'](_0x652c('0xa'),_0x16c70c,_0x7bde8b[_0x652c('0xf')][_0x652c('0x10')]);return _0x1f71df(_0x7bde8b[_0x652c('0xf')][_0x652c('0x10')]);}logger[_0x652c('0xf')](_0x652c('0xa'),_0x16c70c,_0x7bde8b[_0x652c('0xf')][_0x652c('0x10')]);return _0x732ab8(_0x7bde8b[_0x652c('0xf')][_0x652c('0x10')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x16c70c,_0x652c('0xb'));_0x732ab8(_0x7bde8b['result']['message']);}})[_0x652c('0x11')](function(_0x25c15a){logger[_0x652c('0xf')]('Attachment,\x20%s,\x20%s',_0x16c70c,_0x25c15a);_0x1f71df(_0x25c15a);});});}exports[_0x652c('0x12')]=function(_0x1a0551){var _0x3e618c=this;return new Promise(function(_0x195ab9,_0x14f95f){return db['Attachment']['create'](_0x1a0551[_0x652c('0x13')],{'raw':_0x1a0551[_0x652c('0x14')]?_0x1a0551[_0x652c('0x14')][_0x652c('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x213053){logger['info'](_0x652c('0x12'),_0x1a0551);logger['debug'](_0x652c('0x12'),_0x1a0551,JSON[_0x652c('0xe')](_0x213053));_0x195ab9(_0x213053);})[_0x652c('0x11')](function(_0x57f514){logger[_0x652c('0xf')](_0x652c('0x12'),_0x57f514[_0x652c('0x10')],_0x1a0551);_0x14f95f(_0x3e618c[_0x652c('0xf')](0x1f4,_0x57f514['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index eccd443..66ee8e8 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49d5=['join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post','file','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./attachment.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x49d5,0x12f));var _0x549d=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x49d5[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0x549d('0x0'));var util=require(_0x549d('0x1'));var path=require('path');var timeout=require(_0x549d('0x2'));var express=require(_0x549d('0x3'));var router=express[_0x549d('0x4')]();var auth=require(_0x549d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x549d('0x6'));var controller=require(_0x549d('0x7'));router[_0x549d('0x8')]('/',auth['isAuthenticated'](),controller[_0x549d('0x9')]);router[_0x549d('0x8')](_0x549d('0xa'),auth[_0x549d('0xb')](),controller[_0x549d('0xc')]);router[_0x549d('0x8')](_0x549d('0xd'),auth[_0x549d('0xb')](),controller[_0x549d('0xe')]);var upload=multer({'storage':multer[_0x549d('0xf')]({'destination':function(_0x56f151,_0x53fae3,_0x118ee1){_0x118ee1(null,path[_0x549d('0x10')](config[_0x549d('0x11')],_0x549d('0x12')));},'filename':function(_0xd7961,_0x2c6d00,_0x86d085){_0x86d085(null,util[_0x549d('0x13')](_0x549d('0x14'),Date[_0x549d('0x15')](),_0x2c6d00[_0x549d('0x16')][_0x549d('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x549d('0x18')]('/',upload['single'](_0x549d('0x19')),controller['create']);router['put'](_0x549d('0xa'),auth[_0x549d('0xb')](),controller[_0x549d('0x1a')]);router[_0x549d('0x1b')](_0x549d('0xa'),auth['isAuthenticated'](),controller[_0x549d('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xe49e=['diskStorage','join','root','server/files/attachments/','format','replace','post','single','file','create','put','delete','destroy','multer','util','path','connect-timeout','Router','../../config/environment','./attachment.controller','get','index','/:id','isAuthenticated','download'];(function(_0x2eb849,_0x237b0c){var _0x1f6177=function(_0x11f0a7){while(--_0x11f0a7){_0x2eb849['push'](_0x2eb849['shift']());}};_0x1f6177(++_0x237b0c);}(_0xe49e,0x16b));var _0xee49=function(_0x397e2c,_0x4fa6db){_0x397e2c=_0x397e2c-0x0;var _0x2c367f=_0xe49e[_0x397e2c];return _0x2c367f;};'use strict';var multer=require(_0xee49('0x0'));var util=require(_0xee49('0x1'));var path=require(_0xee49('0x2'));var timeout=require(_0xee49('0x3'));var express=require('express');var router=express[_0xee49('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xee49('0x5'));var controller=require(_0xee49('0x6'));router[_0xee49('0x7')]('/',auth['isAuthenticated'](),controller[_0xee49('0x8')]);router['get'](_0xee49('0x9'),auth[_0xee49('0xa')](),controller['show']);router['get']('/:id/download',auth[_0xee49('0xa')](),controller[_0xee49('0xb')]);var upload=multer({'storage':multer[_0xee49('0xc')]({'destination':function(_0xefebfc,_0x3632ad,_0x473b11){_0x473b11(null,path[_0xee49('0xd')](config[_0xee49('0xe')],_0xee49('0xf')));},'filename':function(_0x21b351,_0x4eb9b7,_0x146b83){_0x146b83(null,util[_0xee49('0x10')]('%s-%s',Date['now'](),_0x4eb9b7['originalname'][_0xee49('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xee49('0x12')]('/',upload[_0xee49('0x13')](_0xee49('0x14')),controller[_0xee49('0x15')]);router[_0xee49('0x16')](_0xee49('0x9'),auth[_0xee49('0xa')](),controller['update']);router[_0xee49('0x17')](_0xee49('0x9'),auth['isAuthenticated'](),controller[_0xee49('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 843e022..5de48e1 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb06=['admin','user','agent','disabled','blocked','blockedAt','add','minutes','then','getLicense','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../components/auth/service','login','authenticate','/login','email','callback','use','google','clientID','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','map','emails','value'];(function(_0x38de3e,_0x140dd5){var _0x3cfd26=function(_0x32c088){while(--_0x32c088){_0x38de3e['push'](_0x38de3e['shift']());}};_0x3cfd26(++_0x140dd5);}(_0xfb06,0x160));var _0x6fb0=function(_0x458edc,_0x9baf98){_0x458edc=_0x458edc-0x0;var _0x44af29=_0xfb06[_0x458edc];return _0x44af29;};'use strict';var _=require(_0x6fb0('0x0'));var passport=require(_0x6fb0('0x1'));var GoogleStrategy=require(_0x6fb0('0x2'))['Strategy'];var moment=require(_0x6fb0('0x3'));var db=require(_0x6fb0('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0x6fb0('0x5'))['signToken'];var utils=require('../../config/utils');exports[_0x6fb0('0x6')]=passport[_0x6fb0('0x7')]('google',{'failureRedirect':_0x6fb0('0x8'),'scope':['profile',_0x6fb0('0x9')],'session':![]});exports[_0x6fb0('0xa')]=passport[_0x6fb0('0x7')]('google',{'failureRedirect':_0x6fb0('0x8'),'session':![]});passport[_0x6fb0('0xb')](new GoogleStrategy({'clientID':config['google']?config[_0x6fb0('0xc')][_0x6fb0('0xd')]:'id','clientSecret':config[_0x6fb0('0xc')]?config[_0x6fb0('0xc')]['clientSecret']:_0x6fb0('0xe'),'callbackURL':config[_0x6fb0('0xc')]?config[_0x6fb0('0xc')][_0x6fb0('0xf')]:''},function(_0x12da2e,_0x323d34,_0x1e5bad,_0x44a7f1){var _0x2cd664,_0x484a50;return db[_0x6fb0('0x10')]['findOne']({'where':{'id':0x1},'attributes':[_0x6fb0('0x11'),_0x6fb0('0x12')],'raw':!![]})['then'](function(_0x5eb7df){_0x2cd664=_0x5eb7df;return db['User']['find']({'where':{'email':_[_0x6fb0('0x13')](_0x1e5bad[_0x6fb0('0x14')],_0x6fb0('0x15')),'role':{'$or':[_0x6fb0('0x16'),_0x6fb0('0x17'),_0x6fb0('0x18')]}}});})['then'](function(_0xb91a39){_0x484a50=_0xb91a39;if(_0x484a50){if(_0x484a50[_0x6fb0('0x19')]){return _0x44a7f1('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x2cd664[_0x6fb0('0x12')]>0x0){if(_0x484a50[_0x6fb0('0x1a')]){if(moment(_0x484a50[_0x6fb0('0x1b')])[_0x6fb0('0x1c')](_0x2cd664[_0x6fb0('0x12')],_0x6fb0('0x1d'))>moment()){return _0x44a7f1('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x484a50,0x0,![],null)[_0x6fb0('0x1e')](function(){return utils[_0x6fb0('0x1f')](_0x484a50);})['then'](function(){return _0x44a7f1(null,_0x484a50);});}}else{return utils[_0x6fb0('0x1f')](_0x484a50)['then'](function(){return _0x44a7f1(null,_0x484a50);});}}else{return utils[_0x6fb0('0x1f')](_0x484a50)[_0x6fb0('0x1e')](function(){return _0x44a7f1(null,_0x484a50);});}}return _0x44a7f1(_0x6fb0('0x20'));})[_0x6fb0('0x21')](function(_0x297730){_0x44a7f1(_0x297730);});})); \ No newline at end of file +var _0x0a22=['clientSecret','secret','callbackURL','Setting','then','User','find','emails','value','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','../../components/auth/service','signToken','../../config/utils','authenticate','google','/login','profile','email','callback','use','clientID'];(function(_0x402488,_0x416403){var _0x2c5790=function(_0x2d2e51){while(--_0x2d2e51){_0x402488['push'](_0x402488['shift']());}};_0x2c5790(++_0x416403);}(_0x0a22,0x1cd));var _0x20a2=function(_0x43cbbe,_0x3c2db5){_0x43cbbe=_0x43cbbe-0x0;var _0x4c0056=_0x0a22[_0x43cbbe];return _0x4c0056;};'use strict';var _=require(_0x20a2('0x0'));var passport=require(_0x20a2('0x1'));var GoogleStrategy=require(_0x20a2('0x2'))[_0x20a2('0x3')];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0x20a2('0x4'))[_0x20a2('0x5')];var utils=require(_0x20a2('0x6'));exports['login']=passport[_0x20a2('0x7')](_0x20a2('0x8'),{'failureRedirect':_0x20a2('0x9'),'scope':[_0x20a2('0xa'),_0x20a2('0xb')],'session':![]});exports[_0x20a2('0xc')]=passport[_0x20a2('0x7')]('google',{'failureRedirect':'/login','session':![]});passport[_0x20a2('0xd')](new GoogleStrategy({'clientID':config[_0x20a2('0x8')]?config[_0x20a2('0x8')][_0x20a2('0xe')]:'id','clientSecret':config[_0x20a2('0x8')]?config['google'][_0x20a2('0xf')]:_0x20a2('0x10'),'callbackURL':config[_0x20a2('0x8')]?config['google'][_0x20a2('0x11')]:''},function(_0xae9f6d,_0x3dc4fd,_0x54b61f,_0x1c3755){var _0x3c05ef,_0x245b1e;return db[_0x20a2('0x12')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x20a2('0x13')](function(_0x479818){_0x3c05ef=_0x479818;return db[_0x20a2('0x14')][_0x20a2('0x15')]({'where':{'email':_['map'](_0x54b61f[_0x20a2('0x16')],_0x20a2('0x17')),'role':{'$or':['admin',_0x20a2('0x18'),'agent']}}});})[_0x20a2('0x13')](function(_0x38126d){_0x245b1e=_0x38126d;if(_0x245b1e){if(_0x245b1e[_0x20a2('0x19')]){return _0x1c3755(_0x20a2('0x1a'));}else if(_0x3c05ef[_0x20a2('0x1b')]>0x0){if(_0x245b1e[_0x20a2('0x1c')]){if(moment(_0x245b1e[_0x20a2('0x1d')])[_0x20a2('0x1e')](_0x3c05ef[_0x20a2('0x1b')],_0x20a2('0x1f'))>moment()){return _0x1c3755(_0x20a2('0x1a'));}else{return utils[_0x20a2('0x20')](_0x245b1e,0x0,![],null)[_0x20a2('0x13')](function(){return utils[_0x20a2('0x21')](_0x245b1e);})[_0x20a2('0x13')](function(){return _0x1c3755(null,_0x245b1e);});}}else{return utils['getLicense'](_0x245b1e)[_0x20a2('0x13')](function(){return _0x1c3755(null,_0x245b1e);});}}else{return utils[_0x20a2('0x21')](_0x245b1e)['then'](function(){return _0x1c3755(null,_0x245b1e);});}}return _0x1c3755('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0xf3222b){_0x1c3755(_0xf3222b);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 2f659aa..735e8ef 100644 --- a/server/api/authGoogle/index.js +++ b/server/api/authGoogle/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54f3=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','setTokenCookie'];(function(_0x1bb02b,_0x58453f){var _0x77b3b0=function(_0x36301c){while(--_0x36301c){_0x1bb02b['push'](_0x1bb02b['shift']());}};_0x77b3b0(++_0x58453f);}(_0x54f3,0x120));var _0x354f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x54f3[_0xfae23b];return _0x200640;};'use strict';var express=require('express');var passport=require(_0x354f('0x0'));var router=express[_0x354f('0x1')]();var controller=require(_0x354f('0x2'));var userController=require(_0x354f('0x3'));var authService=require(_0x354f('0x4'));router['get']('/',controller['login']);router[_0x354f('0x5')](_0x354f('0x6'),controller[_0x354f('0x7')],authService['isMiddleware'],userController['login'],authService[_0x354f('0x8')]);module['exports']=router; \ No newline at end of file +var _0xb6b1=['exports','express','Router','../user/user.controller.js','../../components/auth/service','login','/callback','callback','isMiddleware'];(function(_0x36b51b,_0x220bd1){var _0x1d87d4=function(_0x5d36f5){while(--_0x5d36f5){_0x36b51b['push'](_0x36b51b['shift']());}};_0x1d87d4(++_0x220bd1);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xb6b1[_0x13e741];return _0x3f8bb3;};'use strict';var express=require(_0x1b6b('0x0'));var passport=require('passport');var router=express[_0x1b6b('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x1b6b('0x2'));var authService=require(_0x1b6b('0x3'));router['get']('/',controller[_0x1b6b('0x4')]);router['get'](_0x1b6b('0x5'),controller[_0x1b6b('0x6')],authService[_0x1b6b('0x7')],userController[_0x1b6b('0x4')],authService['setTokenCookie']);module[_0x1b6b('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 5b322ac..3346481 100644 --- a/server/api/authLocal/authLocal.controller.js +++ b/server/api/authLocal/authLocal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb791=['pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','Password\x20reset!','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','signToken','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blockedAt','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','loginAttempts','blocked','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','user'];(function(_0x15976d,_0x3eee15){var _0x2ed963=function(_0x23453b){while(--_0x23453b){_0x15976d['push'](_0x15976d['shift']());}};_0x2ed963(++_0x3eee15);}(_0xb791,0xd5));var _0x1b79=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xb791[_0x3e44fa];return _0x2a0aba;};'use strict';var util=require(_0x1b79('0x0'));var passport=require('passport');var LocalStrategy=require(_0x1b79('0x1'))[_0x1b79('0x2')];var jayson=require(_0x1b79('0x3'));var _=require(_0x1b79('0x4'));var rs=require(_0x1b79('0x5'));var moment=require(_0x1b79('0x6'));var db=require(_0x1b79('0x7'))['db'];var signToken=require('../../components/auth/service')[_0x1b79('0x8')];var utils=require(_0x1b79('0x9'));var client=jayson[_0x1b79('0xa')][_0x1b79('0xb')]({'port':0x232b});function localAuthenticate(_0x2ca931,_0x2f3222,_0x6ad15b,_0x344a8a){var _0x170a25,_0x4f6ea3;return db[_0x1b79('0xc')][_0x1b79('0xd')]({'where':{'id':0x1},'attributes':[_0x1b79('0xe'),_0x1b79('0xf')],'raw':!![]})['then'](function(_0x1aa49f){_0x170a25=_0x1aa49f;return _0x2ca931[_0x1b79('0xd')]({'attributes':['id',_0x1b79('0x10'),_0x1b79('0x11'),_0x1b79('0x12'),_0x1b79('0x13'),_0x1b79('0x14'),'blocked',_0x1b79('0x15'),'loginAttempts'],'where':{'name':_0x2f3222,'role':{'$or':['admin','user',_0x1b79('0x16')]}}});})['then'](function(_0x9100f0){if(!_0x9100f0||_0x9100f0&&_0x9100f0['name']!==_0x2f3222){throw new Error(_0x1b79('0x17'));}else{_0x4f6ea3=_0x9100f0;return _0x4f6ea3;}})[_0x1b79('0x18')](function(){_0x4f6ea3['authenticate'](_0x6ad15b,function(_0x1473c6,_0x5a0677){var _0x3c7268=_0x4f6ea3[_0x1b79('0x19')]+0x1;if(_0x1473c6){return _0x344a8a(_0x1473c6);}else if(!_0x5a0677){if(_0x4f6ea3[_0x1b79('0x14')]){return _0x344a8a(null,![],{'message':_0x1b79('0x17')});}else if(_0x170a25[_0x1b79('0xe')]>0x0){if(_0x4f6ea3[_0x1b79('0x1a')]){if(_0x170a25[_0x1b79('0xf')]>0x0){if(moment(_0x4f6ea3[_0x1b79('0x15')])['add'](_0x170a25[_0x1b79('0xf')],_0x1b79('0x1b'))>moment()){return _0x344a8a(null,![],{'message':_0x1b79('0x17')});}else{return utils[_0x1b79('0x1c')](_0x4f6ea3,_0x3c7268,![],null)[_0x1b79('0x18')](function(){return _0x344a8a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x344a8a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3c7268>=_0x170a25[_0x1b79('0xe')]){return utils[_0x1b79('0x1c')](_0x4f6ea3,0x0,!![],moment())[_0x1b79('0x18')](function(){return _0x344a8a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x1b79('0x1c')](_0x4f6ea3,_0x3c7268,![],null)['then'](function(){return _0x344a8a(null,![],{'message':_0x1b79('0x17')});});}}}else{return _0x344a8a(null,![],{'message':_0x1b79('0x17')});}}else{if(_0x4f6ea3['disabled']){return _0x344a8a(null,![],{'message':_0x1b79('0x17')});}else if(_0x170a25['allowedLoginAttempts']>0x0){if(_0x4f6ea3['blocked']){if(_0x170a25['blockDuration']>0x0){if(moment(_0x4f6ea3[_0x1b79('0x15')])['add'](_0x170a25[_0x1b79('0xf')],'minutes')>moment()){return _0x344a8a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1b79('0x1c')](_0x4f6ea3,0x0,![],null)[_0x1b79('0x18')](function(){return utils[_0x1b79('0x1d')](_0x4f6ea3);})[_0x1b79('0x18')](function(){return _0x344a8a(null,_0x4f6ea3);});}}else{return _0x344a8a(null,![],{'message':_0x1b79('0x17')});}}else{return utils[_0x1b79('0x1c')](_0x4f6ea3,0x0,![],null)['then'](function(){return utils[_0x1b79('0x1d')](_0x4f6ea3);})[_0x1b79('0x18')](function(){return _0x344a8a(null,_0x4f6ea3);})[_0x1b79('0x1e')](function(_0x4e0494){return _0x344a8a(null,![],_0x4e0494);});}}else{if(_0x4f6ea3[_0x1b79('0x1a')]){return _0x344a8a(null,![],{'message':_0x1b79('0x17')});}else{return utils[_0x1b79('0x1d')](_0x4f6ea3)['then'](function(){return _0x344a8a(null,_0x4f6ea3);});}}}});})[_0x1b79('0x1e')](function(_0x3332b8){return _0x344a8a(null,![],_0x3332b8);});}function sendServiceMail(_0x57d395){return db['MailAccount'][_0x1b79('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x1b79('0x10'),_0x1b79('0x20')],'include':[{'model':db[_0x1b79('0x21')],'as':_0x1b79('0x22')}]})[_0x1b79('0x18')](function(_0x5afbb6){if(!_0x5afbb6){throw new Error(_0x1b79('0x23'));}var _0x1e9417={'tls':{'rejectUnauthorized':![]}};if(_0x5afbb6['Smtp'][_0x1b79('0x24')]){_0x1e9417[_0x1b79('0x24')]=_0x5afbb6['Smtp']['service'];}else{_0x1e9417[_0x1b79('0x25')]=_0x5afbb6[_0x1b79('0x22')][_0x1b79('0x25')];_0x1e9417['port']=_0x5afbb6[_0x1b79('0x22')][_0x1b79('0x26')];_0x1e9417[_0x1b79('0x27')]=_0x5afbb6[_0x1b79('0x22')][_0x1b79('0x27')];}if(_0x5afbb6[_0x1b79('0x22')][_0x1b79('0x28')]){_0x1e9417['auth']={'user':_0x5afbb6[_0x1b79('0x22')][_0x1b79('0x29')],'pass':_0x5afbb6[_0x1b79('0x22')][_0x1b79('0x2a')]};}var _0x2541df={'account':_0x1e9417,'message':_[_0x1b79('0x2b')]({'from':util[_0x1b79('0x2c')](_0x1b79('0x2d'),_0x5afbb6[_0x1b79('0x10')],_0x5afbb6[_0x1b79('0x20')]||_0x5afbb6[_0x1b79('0x22')]['user'])},_0x57d395)};return client['request'](_0x1b79('0x2e'),_0x2541df);})['then'](function(_0x529fd6){if(_0x529fd6[_0x1b79('0x2f')]){throw new Error(util['format'](_0x1b79('0x30'),_0x529fd6[_0x1b79('0x2f')][_0x1b79('0x31')]||JSON[_0x1b79('0x32')](_0x529fd6[_0x1b79('0x2f')])));}return!![];});}function handleError(_0x39c36e,_0x579353,_0x2a4034){return _0x39c36e[_0x1b79('0x33')](_0x579353||0x1f4)[_0x1b79('0x34')]({'message':_0x2a4034?_0x2a4034[_0x1b79('0x31')]||_0x2a4034:''});}function checkPasswordPattern(_0x6c77b5,_0x2e73fd,_0x51ef51){if(_0x51ef51){var _0x44f4b4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44f4b4[_0x1b79('0x35')](_0x2e73fd)){return _0x6c77b5;}else{throw new Error(_0x1b79('0x36'));}}else{return _0x6c77b5;}}exports[_0x1b79('0x37')]=function(_0x3c7a04,_0x17c626,_0x220ae1){passport['authenticate'](_0x1b79('0x38'),function(_0x22805a,_0xce5ee9,_0x4e9c53){var _0x1e1c2a=_0x22805a||_0x4e9c53;if(_0x1e1c2a){return handleError(_0x17c626,0x191,_0x1e1c2a);}if(!_0xce5ee9){return handleError(_0x17c626,0x194,{'message':_0x1b79('0x39')});}else{var _0x63d5b6=signToken(_0xce5ee9['id'],_0xce5ee9[_0x1b79('0x13')]);_0x17c626[_0x1b79('0x3a')]({'id':_0xce5ee9['id'],'token':_0x63d5b6,'statusCall':'','isAlreadyLogged':_0xce5ee9[_0x1b79('0x3b')]});}})(_0x3c7a04,_0x17c626,_0x220ae1);};exports[_0x1b79('0x3c')]=function(_0x2ff337,_0x56079c,_0x422888){if(!_0x2ff337[_0x1b79('0x3d')][_0x1b79('0x20')]){return handleError(_0x56079c,0x1f4,{'message':_0x1b79('0x3e')});}var _0x64b9f5=rs[_0x1b79('0x3f')]();_0x2ff337[_0x1b79('0x3d')][_0x1b79('0x20')]=_0x2ff337[_0x1b79('0x3d')]['email'][_0x1b79('0x40')]()[_0x1b79('0x41')]();var _0x34c0bd;return db['Setting'][_0x1b79('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x1b79('0xf')],'raw':!![]})[_0x1b79('0x18')](function(_0x4b9b24){_0x34c0bd=_0x4b9b24;return db[_0x1b79('0x42')]['find']({'where':{'email':_0x2ff337['body'][_0x1b79('0x20')]}});})['then'](function(_0x2738ee){if(!_0x2738ee){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x2738ee[_0x1b79('0x14')]){throw new Error(_0x1b79('0x43'));}if(_0x2738ee[_0x1b79('0x1a')]){if(moment(_0x2738ee['blockedAt'])['add'](_0x34c0bd[_0x1b79('0xf')],_0x1b79('0x1b'))>moment()){throw new Error(_0x1b79('0x44'));}else{_0x2738ee[_0x1b79('0x1a')]=![];_0x2738ee['blockedAt']=null;}}_0x2738ee[_0x1b79('0x45')]=_0x64b9f5;_0x2738ee[_0x1b79('0x46')]=Date[_0x1b79('0x47')]()+0x36ee80;return _0x2738ee[_0x1b79('0x48')]();})[_0x1b79('0x18')](function(){return sendServiceMail({'to':_0x2ff337['body']['email'],'subject':_0x1b79('0x49'),'text':_0x1b79('0x4a')+_0x1b79('0x4b')+_0x1b79('0x4c')+_0x2ff337[_0x1b79('0x4d')][_0x1b79('0x25')]+'/reset/'+_0x64b9f5+'\x0a\x0a'+_0x1b79('0x4e')});})[_0x1b79('0x18')](function(){_0x56079c[_0x1b79('0x33')](0xc8)[_0x1b79('0x34')]({'message':_0x1b79('0x4f')});})['catch'](function(_0xf1a9a){return handleError(_0x56079c,0x1f4,_0xf1a9a);});};exports[_0x1b79('0x50')]=function(_0xf0c027,_0x3dee14,_0x29bd4c){var _0x33773f;return db[_0x1b79('0x42')][_0x1b79('0x1f')]({'where':{'resetPasswordToken':_0xf0c027['params'][_0x1b79('0x51')],'resetPasswordExpires':{'$gt':Date[_0x1b79('0x47')]()}}})['then'](function(_0x490dbb){_0x33773f=_0x490dbb;if(!_0x33773f){throw new Error(_0x1b79('0x52'));}return db[_0x1b79('0xc')][_0x1b79('0xd')]({'attributes':['id','securePassword']});})[_0x1b79('0x18')](function(_0x2e72b2){return checkPasswordPattern(_0x2e72b2,_0xf0c027[_0x1b79('0x3d')][_0x1b79('0x11')],_0x2e72b2[_0x1b79('0x53')]);})[_0x1b79('0x18')](function(){_0x33773f[_0x1b79('0x11')]=_0xf0c027[_0x1b79('0x3d')][_0x1b79('0x11')];_0x33773f[_0x1b79('0x45')]=null;_0x33773f[_0x1b79('0x46')]=null;return _0x33773f['save']();})[_0x1b79('0x18')](function(){_0x3dee14[_0x1b79('0x33')](0xc8)['send']({'message':_0x1b79('0x54')});})[_0x1b79('0x1e')](function(_0x15fc31){return handleError(_0x3dee14,0x1f4,_0x15fc31);});};passport['use'](new LocalStrategy({'usernameField':_0x1b79('0x10'),'passwordField':_0x1b79('0x11')},function(_0x1224e5,_0x220326,_0x456dcf){return localAuthenticate(db[_0x1b79('0x42')],_0x1224e5,_0x220326,_0x456dcf);})); \ No newline at end of file +var _0xf53d=['secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','test','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','resetPasswordToken','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','signToken','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','add','clearBlockUser','minutes','catch','getLicense','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xf53d,0x138));var _0xdf53=function(_0x52059a,_0x1dbb54){_0x52059a=_0x52059a-0x0;var _0x58caf8=_0xf53d[_0x52059a];return _0x58caf8;};'use strict';var util=require(_0xdf53('0x0'));var passport=require(_0xdf53('0x1'));var LocalStrategy=require('passport-local')[_0xdf53('0x2')];var jayson=require(_0xdf53('0x3'));var _=require(_0xdf53('0x4'));var rs=require(_0xdf53('0x5'));var moment=require(_0xdf53('0x6'));var db=require(_0xdf53('0x7'))['db'];var signToken=require('../../components/auth/service')[_0xdf53('0x8')];var utils=require(_0xdf53('0x9'));var client=jayson[_0xdf53('0xa')][_0xdf53('0xb')]({'port':0x232b});function localAuthenticate(_0x5a708c,_0x8c63e8,_0x12de68,_0x4f51fb){var _0x42020e,_0x55ea0e;return db[_0xdf53('0xc')][_0xdf53('0xd')]({'where':{'id':0x1},'attributes':[_0xdf53('0xe'),_0xdf53('0xf')],'raw':!![]})['then'](function(_0x56ee6a){_0x42020e=_0x56ee6a;return _0x5a708c[_0xdf53('0xd')]({'attributes':['id',_0xdf53('0x10'),'password',_0xdf53('0x11'),_0xdf53('0x12'),_0xdf53('0x13'),_0xdf53('0x14'),_0xdf53('0x15'),_0xdf53('0x16')],'where':{'name':_0x8c63e8,'role':{'$or':[_0xdf53('0x17'),_0xdf53('0x18'),_0xdf53('0x19')]}}});})['then'](function(_0x1ed055){if(!_0x1ed055||_0x1ed055&&_0x1ed055[_0xdf53('0x10')]!==_0x8c63e8){throw new Error(_0xdf53('0x1a'));}else{_0x55ea0e=_0x1ed055;return _0x55ea0e;}})[_0xdf53('0x1b')](function(){_0x55ea0e['authenticate'](_0x12de68,function(_0x87e6d0,_0x3a8191){var _0x30d989=_0x55ea0e[_0xdf53('0x16')]+0x1;if(_0x87e6d0){return _0x4f51fb(_0x87e6d0);}else if(!_0x3a8191){if(_0x55ea0e[_0xdf53('0x13')]){return _0x4f51fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x42020e['allowedLoginAttempts']>0x0){if(_0x55ea0e[_0xdf53('0x14')]){if(_0x42020e[_0xdf53('0xf')]>0x0){if(moment(_0x55ea0e[_0xdf53('0x15')])[_0xdf53('0x1c')](_0x42020e['blockDuration'],'minutes')>moment()){return _0x4f51fb(null,![],{'message':_0xdf53('0x1a')});}else{return utils[_0xdf53('0x1d')](_0x55ea0e,_0x30d989,![],null)[_0xdf53('0x1b')](function(){return _0x4f51fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4f51fb(null,![],{'message':_0xdf53('0x1a')});}}else{if(_0x30d989>=_0x42020e[_0xdf53('0xe')]){return utils[_0xdf53('0x1d')](_0x55ea0e,0x0,!![],moment())['then'](function(){return _0x4f51fb(null,![],{'message':_0xdf53('0x1a')});});}else{return utils[_0xdf53('0x1d')](_0x55ea0e,_0x30d989,![],null)[_0xdf53('0x1b')](function(){return _0x4f51fb(null,![],{'message':_0xdf53('0x1a')});});}}}else{return _0x4f51fb(null,![],{'message':_0xdf53('0x1a')});}}else{if(_0x55ea0e[_0xdf53('0x13')]){return _0x4f51fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x42020e['allowedLoginAttempts']>0x0){if(_0x55ea0e[_0xdf53('0x14')]){if(_0x42020e['blockDuration']>0x0){if(moment(_0x55ea0e[_0xdf53('0x15')])[_0xdf53('0x1c')](_0x42020e[_0xdf53('0xf')],_0xdf53('0x1e'))>moment()){return _0x4f51fb(null,![],{'message':_0xdf53('0x1a')});}else{return utils[_0xdf53('0x1d')](_0x55ea0e,0x0,![],null)['then'](function(){return utils['getLicense'](_0x55ea0e);})[_0xdf53('0x1b')](function(){return _0x4f51fb(null,_0x55ea0e);});}}else{return _0x4f51fb(null,![],{'message':_0xdf53('0x1a')});}}else{return utils[_0xdf53('0x1d')](_0x55ea0e,0x0,![],null)['then'](function(){return utils['getLicense'](_0x55ea0e);})[_0xdf53('0x1b')](function(){return _0x4f51fb(null,_0x55ea0e);})[_0xdf53('0x1f')](function(_0x4c74c8){return _0x4f51fb(null,![],_0x4c74c8);});}}else{if(_0x55ea0e[_0xdf53('0x14')]){return _0x4f51fb(null,![],{'message':_0xdf53('0x1a')});}else{return utils[_0xdf53('0x20')](_0x55ea0e)[_0xdf53('0x1b')](function(){return _0x4f51fb(null,_0x55ea0e);});}}}});})[_0xdf53('0x1f')](function(_0x5644de){return _0x4f51fb(null,![],_0x5644de);});}function sendServiceMail(_0x488a75){return db[_0xdf53('0x21')][_0xdf53('0x22')]({'where':{'service':!![]},'attributes':['id',_0xdf53('0x10'),_0xdf53('0x23')],'include':[{'model':db[_0xdf53('0x24')],'as':'Smtp'}]})[_0xdf53('0x1b')](function(_0x289454){if(!_0x289454){throw new Error(_0xdf53('0x25'));}var _0xa500e0={'tls':{'rejectUnauthorized':![]}};if(_0x289454[_0xdf53('0x26')]['service']){_0xa500e0['service']=_0x289454['Smtp'][_0xdf53('0x27')];}else{_0xa500e0['host']=_0x289454[_0xdf53('0x26')]['host'];_0xa500e0['port']=_0x289454[_0xdf53('0x26')]['port'];_0xa500e0[_0xdf53('0x28')]=_0x289454[_0xdf53('0x26')][_0xdf53('0x28')];}if(_0x289454[_0xdf53('0x26')][_0xdf53('0x29')]){_0xa500e0[_0xdf53('0x2a')]={'user':_0x289454[_0xdf53('0x26')][_0xdf53('0x18')],'pass':_0x289454[_0xdf53('0x26')][_0xdf53('0x2b')]};}var _0x433569={'account':_0xa500e0,'message':_[_0xdf53('0x2c')]({'from':util[_0xdf53('0x2d')](_0xdf53('0x2e'),_0x289454[_0xdf53('0x10')],_0x289454[_0xdf53('0x23')]||_0x289454[_0xdf53('0x26')][_0xdf53('0x18')])},_0x488a75)};return client[_0xdf53('0x2f')]('SendMail',_0x433569);})[_0xdf53('0x1b')](function(_0x114949){if(_0x114949[_0xdf53('0x30')]){throw new Error(util['format'](_0xdf53('0x31'),_0x114949[_0xdf53('0x30')][_0xdf53('0x32')]||JSON[_0xdf53('0x33')](_0x114949['error'])));}return!![];});}function handleError(_0x38343f,_0xb932ea,_0x3f42f4){return _0x38343f[_0xdf53('0x34')](_0xb932ea||0x1f4)[_0xdf53('0x35')]({'message':_0x3f42f4?_0x3f42f4['message']||_0x3f42f4:''});}function checkPasswordPattern(_0x4a1e89,_0x2ebd68,_0xdcf880){if(_0xdcf880){var _0x273f8b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x273f8b[_0xdf53('0x36')](_0x2ebd68)){return _0x4a1e89;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4a1e89;}}exports['login']=function(_0x26b01a,_0x169b22,_0x5a61ed){passport['authenticate'](_0xdf53('0x37'),function(_0x27b2dc,_0x31d8bc,_0xa74645){var _0x1730c9=_0x27b2dc||_0xa74645;if(_0x1730c9){return handleError(_0x169b22,0x191,_0x1730c9);}if(!_0x31d8bc){return handleError(_0x169b22,0x194,{'message':_0xdf53('0x38')});}else{var _0x35a914=signToken(_0x31d8bc['id'],_0x31d8bc[_0xdf53('0x12')]);_0x169b22[_0xdf53('0x39')]({'id':_0x31d8bc['id'],'token':_0x35a914,'statusCall':'','isAlreadyLogged':_0x31d8bc[_0xdf53('0x3a')]});}})(_0x26b01a,_0x169b22,_0x5a61ed);};exports[_0xdf53('0x3b')]=function(_0x126980,_0x297b88,_0x1a82ab){if(!_0x126980[_0xdf53('0x3c')][_0xdf53('0x23')]){return handleError(_0x297b88,0x1f4,{'message':_0xdf53('0x3d')});}var _0x480808=rs[_0xdf53('0x3e')]();_0x126980['body'][_0xdf53('0x23')]=_0x126980[_0xdf53('0x3c')][_0xdf53('0x23')][_0xdf53('0x3f')]()[_0xdf53('0x40')]();var _0x5120bc;return db[_0xdf53('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0xdf53('0xe'),_0xdf53('0xf')],'raw':!![]})['then'](function(_0x4e7708){_0x5120bc=_0x4e7708;return db[_0xdf53('0x41')]['find']({'where':{'email':_0x126980[_0xdf53('0x3c')][_0xdf53('0x23')]}});})['then'](function(_0x259323){if(!_0x259323){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x259323[_0xdf53('0x13')]){throw new Error(_0xdf53('0x42'));}if(_0x259323[_0xdf53('0x14')]){if(moment(_0x259323[_0xdf53('0x15')])['add'](_0x5120bc[_0xdf53('0xf')],'minutes')>moment()){throw new Error(_0xdf53('0x43'));}else{_0x259323[_0xdf53('0x14')]=![];_0x259323[_0xdf53('0x15')]=null;}}_0x259323['resetPasswordToken']=_0x480808;_0x259323[_0xdf53('0x44')]=Date[_0xdf53('0x45')]()+0x36ee80;return _0x259323[_0xdf53('0x46')]();})[_0xdf53('0x1b')](function(){return sendServiceMail({'to':_0x126980['body'][_0xdf53('0x23')],'subject':_0xdf53('0x47'),'text':_0xdf53('0x48')+_0xdf53('0x49')+'http://'+_0x126980[_0xdf53('0x4a')][_0xdf53('0x4b')]+_0xdf53('0x4c')+_0x480808+'\x0a\x0a'+_0xdf53('0x4d')});})['then'](function(){_0x297b88[_0xdf53('0x34')](0xc8)[_0xdf53('0x35')]({'message':_0xdf53('0x4e')});})[_0xdf53('0x1f')](function(_0x26368d){return handleError(_0x297b88,0x1f4,_0x26368d);});};exports[_0xdf53('0x4f')]=function(_0x5218ff,_0x480673,_0x4c3fe2){var _0x5ed290;return db[_0xdf53('0x41')][_0xdf53('0x22')]({'where':{'resetPasswordToken':_0x5218ff[_0xdf53('0x50')][_0xdf53('0x51')],'resetPasswordExpires':{'$gt':Date[_0xdf53('0x45')]()}}})[_0xdf53('0x1b')](function(_0xde00c2){_0x5ed290=_0xde00c2;if(!_0x5ed290){throw new Error(_0xdf53('0x52'));}return db[_0xdf53('0xc')][_0xdf53('0xd')]({'attributes':['id',_0xdf53('0x53')]});})[_0xdf53('0x1b')](function(_0x52e164){return checkPasswordPattern(_0x52e164,_0x5218ff['body']['password'],_0x52e164[_0xdf53('0x53')]);})[_0xdf53('0x1b')](function(){_0x5ed290[_0xdf53('0x54')]=_0x5218ff[_0xdf53('0x3c')][_0xdf53('0x54')];_0x5ed290[_0xdf53('0x55')]=null;_0x5ed290[_0xdf53('0x44')]=null;return _0x5ed290['save']();})[_0xdf53('0x1b')](function(){_0x480673[_0xdf53('0x34')](0xc8)['send']({'message':_0xdf53('0x56')});})[_0xdf53('0x1f')](function(_0x1211ed){return handleError(_0x480673,0x1f4,_0x1211ed);});};passport[_0xdf53('0x57')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0xc40727,_0x4c3c87,_0x1ef1b1){return localAuthenticate(db[_0xdf53('0x41')],_0xc40727,_0x4c3c87,_0x1ef1b1);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index c8fa522..63e8c79 100644 --- a/server/api/authLocal/index.js +++ b/server/api/authLocal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bbb=['/forgot','forgot','/reset/:token','reset','exports','Router','post'];(function(_0x2796f8,_0x55edc9){var _0x4f9ba9=function(_0x59f190){while(--_0x59f190){_0x2796f8['push'](_0x2796f8['shift']());}};_0x4f9ba9(++_0x55edc9);}(_0x4bbb,0x140));var _0xb4bb=function(_0x1320c4,_0x3d5d1d){_0x1320c4=_0x1320c4-0x0;var _0x9a94c1=_0x4bbb[_0x1320c4];return _0x9a94c1;};'use strict';var express=require('express');var router=express[_0xb4bb('0x0')]();var controller=require('./authLocal.controller');router[_0xb4bb('0x1')]('/',controller['login']);router[_0xb4bb('0x1')](_0xb4bb('0x2'),controller[_0xb4bb('0x3')]);router[_0xb4bb('0x1')](_0xb4bb('0x4'),controller[_0xb4bb('0x5')]);module[_0xb4bb('0x6')]=router; \ No newline at end of file +var _0xd993=['post','login','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller'];(function(_0x11b0f2,_0x2b1936){var _0x4c3eca=function(_0x4df16a){while(--_0x4df16a){_0x11b0f2['push'](_0x11b0f2['shift']());}};_0x4c3eca(++_0x2b1936);}(_0xd993,0x180));var _0x3d99=function(_0x16c9db,_0x58d2e8){_0x16c9db=_0x16c9db-0x0;var _0x5411d8=_0xd993[_0x16c9db];return _0x5411d8;};'use strict';var express=require(_0x3d99('0x0'));var router=express[_0x3d99('0x1')]();var controller=require(_0x3d99('0x2'));router[_0x3d99('0x3')]('/',controller[_0x3d99('0x4')]);router[_0x3d99('0x3')]('/forgot',controller[_0x3d99('0x5')]);router['post'](_0x3d99('0x6'),controller[_0x3d99('0x7')]);module[_0x3d99('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 5b54338..0312eba 100644 --- a/server/api/automation/automation.attributes.js +++ b/server/api/automation/automation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5876=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5876,0x124));var _0x6587=function(_0x5508db,_0x22ecbe){_0x5508db=_0x5508db-0x0;var _0x54ce94=_0x5876[_0x5508db];return _0x54ce94;};'use strict';var Sequelize=require('sequelize');module[_0x6587('0x0')]={'name':{'type':Sequelize[_0x6587('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x6587('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x6587('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6587('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x53c4=['exports','STRING','INTEGER','sequelize'];(function(_0x57c4e3,_0x463bbd){var _0x156147=function(_0x40c202){while(--_0x40c202){_0x57c4e3['push'](_0x57c4e3['shift']());}};_0x156147(++_0x463bbd);}(_0x53c4,0x173));var _0x453c=function(_0x5af485,_0x23927d){_0x5af485=_0x5af485-0x0;var _0x15e68a=_0x53c4[_0x5af485];return _0x15e68a;};'use strict';var Sequelize=require(_0x453c('0x0'));module[_0x453c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x453c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x453c('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index f486367..a995cb6 100644 --- a/server/api/automation/automation.controller.js +++ b/server/api/automation/automation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc4a=['status','json','count','offset','limit','set','apply','update','then','destroy','error','stack','send','index','Automation','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','include','rows','catch','show','params','includeAll','options','find','create','body','addConditions','ids','omit','getConditions','findOne','Condition','fields','order','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0xbc4a,0x1c3));var _0xabc4=function(_0x1e6539,_0x44ac9f){_0x1e6539=_0x1e6539-0x0;var _0x58dc65=_0xbc4a[_0x1e6539];return _0x58dc65;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xabc4('0x0'));var rimraf=require(_0xabc4('0x1'));var zipdir=require(_0xabc4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabc4('0x3'));var moment=require(_0xabc4('0x4'));var BPromise=require(_0xabc4('0x5'));var Mustache=require(_0xabc4('0x6'));var util=require(_0xabc4('0x7'));var path=require(_0xabc4('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xabc4('0x9'));var jsforce=require(_0xabc4('0xa'));var deskjs=require(_0xabc4('0xb'));var toCsv=require(_0xabc4('0xc'));var querystring=require('querystring');var Papa=require(_0xabc4('0xd'));var Redis=require(_0xabc4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xabc4('0xf'));var hardwareService=require(_0xabc4('0x10'));var logger=require('../../config/logger')(_0xabc4('0x11'));var utils=require(_0xabc4('0x12'));var config=require(_0xabc4('0x13'));var db=require(_0xabc4('0x14'))['db'];function respondWithStatusCode(_0x240ccc,_0x2ce4be){_0x2ce4be=_0x2ce4be||0xcc;return function(_0x13d20e){if(_0x13d20e){return _0x240ccc[_0xabc4('0x15')](_0x2ce4be);}return _0x240ccc['status'](_0x2ce4be)[_0xabc4('0x16')]();};}function respondWithResult(_0x29f201,_0x3c7262){_0x3c7262=_0x3c7262||0xc8;return function(_0x262ce8){if(_0x262ce8){return _0x29f201[_0xabc4('0x17')](_0x3c7262)[_0xabc4('0x18')](_0x262ce8);}};}function respondWithFilteredResult(_0xcc0877,_0x8c5807){return function(_0x14d718){if(_0x14d718){var _0x17b707=_0x14d718[_0xabc4('0x19')],_0x20fb65=_0x8c5807[_0xabc4('0x1a')],_0x520d93=_0x8c5807['offset']+_0x8c5807[_0xabc4('0x1b')],_0x3071d8;if(_0x520d93>=_0x17b707){_0x520d93=_0x17b707;_0x3071d8=0xc8;}else{_0x3071d8=0xce;}_0xcc0877[_0xabc4('0x17')](_0x3071d8);return _0xcc0877[_0xabc4('0x1c')]('Content-Range',_0x20fb65+'-'+_0x520d93+'/'+_0x17b707)['json'](_0x14d718);}return null;};}function patchUpdates(_0xa17319){return function(_0x59ae09){try{jsonpatch[_0xabc4('0x1d')](_0x59ae09,_0xa17319,!![]);}catch(_0x2d335f){return BPromise['reject'](_0x2d335f);}return _0x59ae09['save']();};}function saveUpdates(_0x30f4bf,_0x327121){return function(_0x37cf2a){if(_0x37cf2a){return _0x37cf2a[_0xabc4('0x1e')](_0x30f4bf)[_0xabc4('0x1f')](function(_0x19c5a6){return _0x19c5a6;});}return null;};}function removeEntity(_0xf06a1d,_0x3213ad){return function(_0x199f97){if(_0x199f97){return _0x199f97[_0xabc4('0x20')]()['then'](function(){_0xf06a1d['status'](0xcc)[_0xabc4('0x16')]();});}};}function handleEntityNotFound(_0x36eb7f,_0x1b3943){return function(_0x1cf70c){if(!_0x1cf70c){_0x36eb7f[_0xabc4('0x15')](0x194);}return _0x1cf70c;};}function handleError(_0x3c53a1,_0x4bc114){_0x4bc114=_0x4bc114||0x1f4;return function(_0x1daaf4){logger[_0xabc4('0x21')](_0x1daaf4[_0xabc4('0x22')]);if(_0x1daaf4['name']){delete _0x1daaf4['name'];}_0x3c53a1[_0xabc4('0x17')](_0x4bc114)[_0xabc4('0x23')](_0x1daaf4);};}exports[_0xabc4('0x24')]=function(_0x44ac76,_0x586f8b){var _0x490834={},_0x1289ec={},_0x2c2ee8={'count':0x0,'rows':[]};var _0x5c97a8=db[_0xabc4('0x25')][_0xabc4('0x26')];_0x1289ec[_0xabc4('0x27')]=_[_0xabc4('0x28')](_0x5c97a8);_0x1289ec[_0xabc4('0x29')]=_[_0xabc4('0x28')](_0x44ac76[_0xabc4('0x29')]);_0x1289ec[_0xabc4('0x2a')]=_[_0xabc4('0x2b')](_0x1289ec['model'],_0x1289ec[_0xabc4('0x29')]);_0x490834['attributes']=_[_0xabc4('0x2b')](_0x1289ec['model'],qs['fields'](_0x44ac76[_0xabc4('0x29')]['fields']));_0x490834[_0xabc4('0x2c')]=_0x490834[_0xabc4('0x2c')][_0xabc4('0x2d')]?_0x490834[_0xabc4('0x2c')]:_0x1289ec[_0xabc4('0x27')];if(!_0x44ac76[_0xabc4('0x29')][_0xabc4('0x2e')](_0xabc4('0x2f'))){_0x490834['limit']=qs[_0xabc4('0x1b')](_0x44ac76[_0xabc4('0x29')][_0xabc4('0x1b')]);_0x490834[_0xabc4('0x1a')]=qs['offset'](_0x44ac76[_0xabc4('0x29')]['offset']);}_0x490834['order']=qs['sort'](_0x44ac76[_0xabc4('0x29')][_0xabc4('0x30')]);_0x490834[_0xabc4('0x31')]=qs[_0xabc4('0x2a')](_[_0xabc4('0x32')](_0x44ac76['query'],_0x1289ec['filters']));if(_0x44ac76[_0xabc4('0x29')][_0xabc4('0x33')]){_0x490834[_0xabc4('0x31')]=_[_0xabc4('0x34')](_0x490834[_0xabc4('0x31')],{'$or':_[_0xabc4('0x35')](_0x5c97a8,function(_0x2617d3){if(_0x2617d3[_0xabc4('0x36')][_0xabc4('0x37')]!==_0xabc4('0x38')){var _0x45acbe={};_0x45acbe[_0x2617d3[_0xabc4('0x39')]]={'$like':'%'+_0x44ac76[_0xabc4('0x29')][_0xabc4('0x33')]+'%'};return _0x45acbe;}})});}_0x490834=_[_0xabc4('0x34')]({},_0x490834,_0x44ac76['options']);var _0x4a815c={'where':_0x490834[_0xabc4('0x31')]};return db[_0xabc4('0x25')][_0xabc4('0x19')](_0x4a815c)[_0xabc4('0x1f')](function(_0x3d44c6){_0x2c2ee8[_0xabc4('0x19')]=_0x3d44c6;if(_0x44ac76['query']['includeAll']){_0x490834[_0xabc4('0x3a')]=[{'all':!![]}];}return db[_0xabc4('0x25')]['findAll'](_0x490834);})[_0xabc4('0x1f')](function(_0x6299be){_0x2c2ee8[_0xabc4('0x3b')]=_0x6299be;return _0x2c2ee8;})[_0xabc4('0x1f')](respondWithFilteredResult(_0x586f8b,_0x490834))[_0xabc4('0x3c')](handleError(_0x586f8b,null));};exports[_0xabc4('0x3d')]=function(_0x2ad734,_0x2a49f4){var _0x4b3021={'raw':![],'where':{'id':_0x2ad734[_0xabc4('0x3e')]['id']}},_0x1d144a={};_0x1d144a[_0xabc4('0x27')]=_[_0xabc4('0x28')](db[_0xabc4('0x25')][_0xabc4('0x26')]);_0x1d144a['query']=_[_0xabc4('0x28')](_0x2ad734[_0xabc4('0x29')]);_0x1d144a[_0xabc4('0x2a')]=_[_0xabc4('0x2b')](_0x1d144a['model'],_0x1d144a['query']);_0x4b3021[_0xabc4('0x2c')]=_['intersection'](_0x1d144a[_0xabc4('0x27')],qs['fields'](_0x2ad734['query']['fields']));_0x4b3021[_0xabc4('0x2c')]=_0x4b3021[_0xabc4('0x2c')][_0xabc4('0x2d')]?_0x4b3021[_0xabc4('0x2c')]:_0x1d144a[_0xabc4('0x27')];if(_0x2ad734[_0xabc4('0x29')][_0xabc4('0x3f')]){_0x4b3021['include']=[{'all':!![]}];}_0x4b3021=_[_0xabc4('0x34')]({},_0x4b3021,_0x2ad734[_0xabc4('0x40')]);return db['Automation'][_0xabc4('0x41')](_0x4b3021)[_0xabc4('0x1f')](handleEntityNotFound(_0x2a49f4,null))[_0xabc4('0x1f')](respondWithResult(_0x2a49f4,null))[_0xabc4('0x3c')](handleError(_0x2a49f4,null));};exports[_0xabc4('0x42')]=function(_0x4625bc,_0x396845){return db[_0xabc4('0x25')]['create'](_0x4625bc[_0xabc4('0x43')],{})[_0xabc4('0x1f')](respondWithResult(_0x396845,0xc9))[_0xabc4('0x3c')](handleError(_0x396845,null));};exports['update']=function(_0x1eb7ad,_0xb9a30){if(_0x1eb7ad[_0xabc4('0x43')]['id']){delete _0x1eb7ad[_0xabc4('0x43')]['id'];}return db[_0xabc4('0x25')]['find']({'where':{'id':_0x1eb7ad[_0xabc4('0x3e')]['id']}})[_0xabc4('0x1f')](handleEntityNotFound(_0xb9a30,null))['then'](saveUpdates(_0x1eb7ad[_0xabc4('0x43')],null))[_0xabc4('0x1f')](respondWithResult(_0xb9a30,null))[_0xabc4('0x3c')](handleError(_0xb9a30,null));};exports['destroy']=function(_0x573031,_0x3fe817){return db['Automation']['find']({'where':{'id':_0x573031[_0xabc4('0x3e')]['id']}})[_0xabc4('0x1f')](handleEntityNotFound(_0x3fe817,null))[_0xabc4('0x1f')](removeEntity(_0x3fe817,null))[_0xabc4('0x3c')](handleError(_0x3fe817,null));};exports[_0xabc4('0x44')]=function(_0x12ed57,_0x59e812,_0x1d3b52){return db['Condition']['find']({'where':{'id':_0x12ed57[_0xabc4('0x3e')]['id']}})[_0xabc4('0x1f')](handleEntityNotFound(_0x59e812,null))[_0xabc4('0x1f')](function(_0x10c328){if(_0x10c328){return _0x10c328[_0xabc4('0x44')](_0x12ed57['body'][_0xabc4('0x45')],_[_0xabc4('0x46')](_0x12ed57[_0xabc4('0x43')],[_0xabc4('0x45'),'id'])||{});}})['then'](respondWithResult(_0x59e812,null))['catch'](handleError(_0x59e812,null));};exports[_0xabc4('0x47')]=function(_0x100a13,_0x2a1df6,_0x8a1d85){var _0x2e223a={};var _0x1f7310={};var _0x3df263;var _0x2d2bde;return db[_0xabc4('0x25')][_0xabc4('0x48')]({'where':{'id':_0x100a13[_0xabc4('0x3e')]['id']}})[_0xabc4('0x1f')](handleEntityNotFound(_0x2a1df6,null))[_0xabc4('0x1f')](function(_0x2501a7){if(_0x2501a7){_0x3df263=_0x2501a7;_0x1f7310['model']=_[_0xabc4('0x28')](db[_0xabc4('0x49')][_0xabc4('0x26')]);_0x1f7310[_0xabc4('0x29')]=_[_0xabc4('0x28')](_0x100a13[_0xabc4('0x29')]);_0x1f7310[_0xabc4('0x2a')]=_[_0xabc4('0x2b')](_0x1f7310[_0xabc4('0x27')],_0x1f7310[_0xabc4('0x29')]);_0x2e223a[_0xabc4('0x2c')]=_[_0xabc4('0x2b')](_0x1f7310[_0xabc4('0x27')],qs[_0xabc4('0x4a')](_0x100a13[_0xabc4('0x29')][_0xabc4('0x4a')]));_0x2e223a['attributes']=_0x2e223a[_0xabc4('0x2c')]['length']?_0x2e223a[_0xabc4('0x2c')]:_0x1f7310['model'];_0x2e223a[_0xabc4('0x4b')]=qs['sort'](_0x100a13[_0xabc4('0x29')]['sort']);_0x2e223a[_0xabc4('0x31')]=qs[_0xabc4('0x2a')](_[_0xabc4('0x32')](_0x100a13[_0xabc4('0x29')],_0x1f7310[_0xabc4('0x2a')]));if(_0x100a13['query'][_0xabc4('0x33')]){_0x2e223a['where']=_[_0xabc4('0x34')](_0x2e223a[_0xabc4('0x31')],{'$or':_[_0xabc4('0x35')](_0x2e223a[_0xabc4('0x2c')],function(_0x197415){var _0x2762b4={};_0x2762b4[_0x197415]={'$like':'%'+_0x100a13[_0xabc4('0x29')][_0xabc4('0x33')]+'%'};return _0x2762b4;})});}_0x2e223a=_[_0xabc4('0x34')]({},_0x2e223a,_0x100a13['options']);return _0x3df263[_0xabc4('0x47')](_0x2e223a);}})[_0xabc4('0x1f')](function(_0x4f5e03){if(_0x4f5e03){_0x2d2bde=_0x4f5e03[_0xabc4('0x2d')];if(!_0x100a13[_0xabc4('0x29')][_0xabc4('0x2e')](_0xabc4('0x2f'))){_0x2e223a[_0xabc4('0x1b')]=qs[_0xabc4('0x1b')](_0x100a13[_0xabc4('0x29')][_0xabc4('0x1b')]);_0x2e223a[_0xabc4('0x1a')]=qs[_0xabc4('0x1a')](_0x100a13[_0xabc4('0x29')][_0xabc4('0x1a')]);}return _0x3df263[_0xabc4('0x47')](_0x2e223a);}})[_0xabc4('0x1f')](function(_0x1d274b){if(_0x1d274b){return _0x1d274b?{'count':_0x2d2bde,'rows':_0x1d274b}:null;}})[_0xabc4('0x1f')](respondWithResult(_0x2a1df6,null))[_0xabc4('0x3c')](handleError(_0x2a1df6,null));};exports[_0xabc4('0x4c')]=function(_0xc14703,_0x57dca9,_0x71f152){return db[_0xabc4('0x4d')][_0xabc4('0x41')]({'where':{'id':_0xc14703[_0xabc4('0x3e')]['id']}})['then'](handleEntityNotFound(_0x57dca9,null))[_0xabc4('0x1f')](function(_0x3aae87){if(_0x3aae87){return _0x3aae87[_0xabc4('0x4c')](_0xc14703[_0xabc4('0x43')]['ids'],_['omit'](_0xc14703[_0xabc4('0x43')],['ids','id'])||{});}})[_0xabc4('0x1f')](respondWithResult(_0x57dca9,null))['catch'](handleError(_0x57dca9,null));};exports[_0xabc4('0x4e')]=function(_0x177c39,_0x21aee9,_0x2fa0ac){var _0x3f7293={};var _0x1b5f73={};var _0x3c2165;var _0x5f20fb;return db[_0xabc4('0x25')][_0xabc4('0x48')]({'where':{'id':_0x177c39['params']['id']}})[_0xabc4('0x1f')](handleEntityNotFound(_0x21aee9,null))[_0xabc4('0x1f')](function(_0x238f87){if(_0x238f87){_0x3c2165=_0x238f87;_0x1b5f73[_0xabc4('0x27')]=_[_0xabc4('0x28')](db[_0xabc4('0x4d')][_0xabc4('0x26')]);_0x1b5f73['query']=_['keys'](_0x177c39[_0xabc4('0x29')]);_0x1b5f73[_0xabc4('0x2a')]=_[_0xabc4('0x2b')](_0x1b5f73[_0xabc4('0x27')],_0x1b5f73[_0xabc4('0x29')]);_0x3f7293[_0xabc4('0x2c')]=_[_0xabc4('0x2b')](_0x1b5f73[_0xabc4('0x27')],qs[_0xabc4('0x4a')](_0x177c39['query'][_0xabc4('0x4a')]));_0x3f7293[_0xabc4('0x2c')]=_0x3f7293[_0xabc4('0x2c')][_0xabc4('0x2d')]?_0x3f7293[_0xabc4('0x2c')]:_0x1b5f73[_0xabc4('0x27')];_0x3f7293[_0xabc4('0x4b')]=qs['sort'](_0x177c39[_0xabc4('0x29')][_0xabc4('0x30')]);_0x3f7293['where']=qs[_0xabc4('0x2a')](_[_0xabc4('0x32')](_0x177c39[_0xabc4('0x29')],_0x1b5f73[_0xabc4('0x2a')]));if(_0x177c39['query'][_0xabc4('0x33')]){_0x3f7293[_0xabc4('0x31')]=_[_0xabc4('0x34')](_0x3f7293['where'],{'$or':_['map'](_0x3f7293['attributes'],function(_0x413820){var _0x51d804={};_0x51d804[_0x413820]={'$like':'%'+_0x177c39[_0xabc4('0x29')][_0xabc4('0x33')]+'%'};return _0x51d804;})});}_0x3f7293=_['merge']({},_0x3f7293,_0x177c39[_0xabc4('0x40')]);return _0x3c2165['getActions'](_0x3f7293);}})[_0xabc4('0x1f')](function(_0x51bc9d){if(_0x51bc9d){_0x5f20fb=_0x51bc9d[_0xabc4('0x2d')];if(!_0x177c39['query']['hasOwnProperty'](_0xabc4('0x2f'))){_0x3f7293[_0xabc4('0x1b')]=qs[_0xabc4('0x1b')](_0x177c39[_0xabc4('0x29')]['limit']);_0x3f7293[_0xabc4('0x1a')]=qs[_0xabc4('0x1a')](_0x177c39[_0xabc4('0x29')][_0xabc4('0x1a')]);}return _0x3c2165['getActions'](_0x3f7293);}})['then'](function(_0x34b9cd){if(_0x34b9cd){return _0x34b9cd?{'count':_0x5f20fb,'rows':_0x34b9cd}:null;}})[_0xabc4('0x1f')](respondWithResult(_0x21aee9,null))['catch'](handleError(_0x21aee9,null));}; \ No newline at end of file +var _0xc75c=['params','Condition','addConditions','ids','omit','getConditions','findOne','addActions','getActions','Action','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','sendStatus','error','stack','name','send','index','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','Automation','count','then','includeAll','rows','catch','show','rawAttributes','intersection','include','find','create','body'];(function(_0x9d163d,_0x262aa4){var _0x2e41ce=function(_0x2bc40b){while(--_0x2bc40b){_0x9d163d['push'](_0x9d163d['shift']());}};_0x2e41ce(++_0x262aa4);}(_0xc75c,0xac));var _0xcc75=function(_0x1d2bc8,_0x2860bc){_0x1d2bc8=_0x1d2bc8-0x0;var _0x1857e1=_0xc75c[_0x1d2bc8];return _0x1857e1;};'use strict';var pdf=require(_0xcc75('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcc75('0x1'));var zipdir=require(_0xcc75('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc75('0x3'));var moment=require(_0xcc75('0x4'));var BPromise=require(_0xcc75('0x5'));var Mustache=require(_0xcc75('0x6'));var util=require('util');var path=require(_0xcc75('0x7'));var sox=require(_0xcc75('0x8'));var csv=require('to-csv');var ejs=require(_0xcc75('0x9'));var fs=require('fs');var _=require(_0xcc75('0xa'));var squel=require('squel');var crypto=require(_0xcc75('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcc75('0xc'));var toCsv=require(_0xcc75('0xd'));var querystring=require(_0xcc75('0xe'));var Papa=require(_0xcc75('0xf'));var Redis=require(_0xcc75('0x10'));var authService=require(_0xcc75('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc75('0x12'))(_0xcc75('0x13'));var utils=require(_0xcc75('0x14'));var config=require(_0xcc75('0x15'));var db=require(_0xcc75('0x16'))['db'];function respondWithStatusCode(_0xb52c9e,_0x4c3b38){_0x4c3b38=_0x4c3b38||0xcc;return function(_0x4a1120){if(_0x4a1120){return _0xb52c9e['sendStatus'](_0x4c3b38);}return _0xb52c9e[_0xcc75('0x17')](_0x4c3b38)['end']();};}function respondWithResult(_0x2a896c,_0x273473){_0x273473=_0x273473||0xc8;return function(_0x2c009a){if(_0x2c009a){return _0x2a896c['status'](_0x273473)[_0xcc75('0x18')](_0x2c009a);}};}function respondWithFilteredResult(_0xf78852,_0x4c37d8){return function(_0x3f1973){if(_0x3f1973){var _0x90f3d8=_0x3f1973['count'],_0x361dce=_0x4c37d8[_0xcc75('0x19')],_0x275bb6=_0x4c37d8['offset']+_0x4c37d8[_0xcc75('0x1a')],_0x3963d5;if(_0x275bb6>=_0x90f3d8){_0x275bb6=_0x90f3d8;_0x3963d5=0xc8;}else{_0x3963d5=0xce;}_0xf78852[_0xcc75('0x17')](_0x3963d5);return _0xf78852[_0xcc75('0x1b')](_0xcc75('0x1c'),_0x361dce+'-'+_0x275bb6+'/'+_0x90f3d8)[_0xcc75('0x18')](_0x3f1973);}return null;};}function patchUpdates(_0x18d100){return function(_0x3e07ae){try{jsonpatch['apply'](_0x3e07ae,_0x18d100,!![]);}catch(_0x468ca7){return BPromise[_0xcc75('0x1d')](_0x468ca7);}return _0x3e07ae[_0xcc75('0x1e')]();};}function saveUpdates(_0x58a989,_0x4afd73){return function(_0x40f1dd){if(_0x40f1dd){return _0x40f1dd[_0xcc75('0x1f')](_0x58a989)['then'](function(_0x14a86d){return _0x14a86d;});}return null;};}function removeEntity(_0x3e2228,_0x6c3a11){return function(_0x2d5bf){if(_0x2d5bf){return _0x2d5bf[_0xcc75('0x20')]()['then'](function(){_0x3e2228['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8950c,_0x3f61b3){return function(_0x1e8d8c){if(!_0x1e8d8c){_0x8950c[_0xcc75('0x21')](0x194);}return _0x1e8d8c;};}function handleError(_0x4cc5b7,_0x48f2b5){_0x48f2b5=_0x48f2b5||0x1f4;return function(_0x2fdbca){logger[_0xcc75('0x22')](_0x2fdbca[_0xcc75('0x23')]);if(_0x2fdbca[_0xcc75('0x24')]){delete _0x2fdbca[_0xcc75('0x24')];}_0x4cc5b7[_0xcc75('0x17')](_0x48f2b5)[_0xcc75('0x25')](_0x2fdbca);};}exports[_0xcc75('0x26')]=function(_0x5b81f2,_0x322083){var _0x4b5d8a={},_0x36efd6={},_0x57ecf4={'count':0x0,'rows':[]};var _0x130081=db['Automation']['rawAttributes'];_0x36efd6['model']=_[_0xcc75('0x27')](_0x130081);_0x36efd6['query']=_[_0xcc75('0x27')](_0x5b81f2[_0xcc75('0x28')]);_0x36efd6[_0xcc75('0x29')]=_['intersection'](_0x36efd6[_0xcc75('0x2a')],_0x36efd6[_0xcc75('0x28')]);_0x4b5d8a[_0xcc75('0x2b')]=_['intersection'](_0x36efd6['model'],qs[_0xcc75('0x2c')](_0x5b81f2[_0xcc75('0x28')][_0xcc75('0x2c')]));_0x4b5d8a[_0xcc75('0x2b')]=_0x4b5d8a['attributes'][_0xcc75('0x2d')]?_0x4b5d8a[_0xcc75('0x2b')]:_0x36efd6[_0xcc75('0x2a')];if(!_0x5b81f2[_0xcc75('0x28')][_0xcc75('0x2e')](_0xcc75('0x2f'))){_0x4b5d8a[_0xcc75('0x1a')]=qs['limit'](_0x5b81f2['query'][_0xcc75('0x1a')]);_0x4b5d8a[_0xcc75('0x19')]=qs[_0xcc75('0x19')](_0x5b81f2[_0xcc75('0x28')][_0xcc75('0x19')]);}_0x4b5d8a[_0xcc75('0x30')]=qs[_0xcc75('0x31')](_0x5b81f2[_0xcc75('0x28')]['sort']);_0x4b5d8a[_0xcc75('0x32')]=qs[_0xcc75('0x29')](_[_0xcc75('0x33')](_0x5b81f2['query'],_0x36efd6['filters']));if(_0x5b81f2['query'][_0xcc75('0x34')]){_0x4b5d8a[_0xcc75('0x32')]=_[_0xcc75('0x35')](_0x4b5d8a[_0xcc75('0x32')],{'$or':_['map'](_0x130081,function(_0x2c754e){if(_0x2c754e[_0xcc75('0x36')][_0xcc75('0x37')]!==_0xcc75('0x38')){var _0x43746b={};_0x43746b[_0x2c754e['field']]={'$like':'%'+_0x5b81f2[_0xcc75('0x28')][_0xcc75('0x34')]+'%'};return _0x43746b;}})});}_0x4b5d8a=_[_0xcc75('0x35')]({},_0x4b5d8a,_0x5b81f2[_0xcc75('0x39')]);var _0x37d12d={'where':_0x4b5d8a['where']};return db[_0xcc75('0x3a')][_0xcc75('0x3b')](_0x37d12d)[_0xcc75('0x3c')](function(_0x5e7140){_0x57ecf4[_0xcc75('0x3b')]=_0x5e7140;if(_0x5b81f2[_0xcc75('0x28')][_0xcc75('0x3d')]){_0x4b5d8a['include']=[{'all':!![]}];}return db[_0xcc75('0x3a')]['findAll'](_0x4b5d8a);})[_0xcc75('0x3c')](function(_0x580bfe){_0x57ecf4[_0xcc75('0x3e')]=_0x580bfe;return _0x57ecf4;})[_0xcc75('0x3c')](respondWithFilteredResult(_0x322083,_0x4b5d8a))[_0xcc75('0x3f')](handleError(_0x322083,null));};exports[_0xcc75('0x40')]=function(_0xcce324,_0x7180d8){var _0x371ae3={'raw':![],'where':{'id':_0xcce324['params']['id']}},_0x4fbbc5={};_0x4fbbc5[_0xcc75('0x2a')]=_[_0xcc75('0x27')](db[_0xcc75('0x3a')][_0xcc75('0x41')]);_0x4fbbc5['query']=_['keys'](_0xcce324[_0xcc75('0x28')]);_0x4fbbc5['filters']=_[_0xcc75('0x42')](_0x4fbbc5[_0xcc75('0x2a')],_0x4fbbc5[_0xcc75('0x28')]);_0x371ae3[_0xcc75('0x2b')]=_[_0xcc75('0x42')](_0x4fbbc5[_0xcc75('0x2a')],qs[_0xcc75('0x2c')](_0xcce324[_0xcc75('0x28')][_0xcc75('0x2c')]));_0x371ae3[_0xcc75('0x2b')]=_0x371ae3[_0xcc75('0x2b')][_0xcc75('0x2d')]?_0x371ae3[_0xcc75('0x2b')]:_0x4fbbc5['model'];if(_0xcce324[_0xcc75('0x28')][_0xcc75('0x3d')]){_0x371ae3[_0xcc75('0x43')]=[{'all':!![]}];}_0x371ae3=_[_0xcc75('0x35')]({},_0x371ae3,_0xcce324[_0xcc75('0x39')]);return db[_0xcc75('0x3a')][_0xcc75('0x44')](_0x371ae3)[_0xcc75('0x3c')](handleEntityNotFound(_0x7180d8,null))[_0xcc75('0x3c')](respondWithResult(_0x7180d8,null))['catch'](handleError(_0x7180d8,null));};exports[_0xcc75('0x45')]=function(_0x436838,_0x809bc1){return db['Automation'][_0xcc75('0x45')](_0x436838['body'],{})[_0xcc75('0x3c')](respondWithResult(_0x809bc1,0xc9))[_0xcc75('0x3f')](handleError(_0x809bc1,null));};exports['update']=function(_0x571d1b,_0x5e2cd0){if(_0x571d1b[_0xcc75('0x46')]['id']){delete _0x571d1b[_0xcc75('0x46')]['id'];}return db[_0xcc75('0x3a')][_0xcc75('0x44')]({'where':{'id':_0x571d1b['params']['id']}})[_0xcc75('0x3c')](handleEntityNotFound(_0x5e2cd0,null))[_0xcc75('0x3c')](saveUpdates(_0x571d1b[_0xcc75('0x46')],null))[_0xcc75('0x3c')](respondWithResult(_0x5e2cd0,null))[_0xcc75('0x3f')](handleError(_0x5e2cd0,null));};exports[_0xcc75('0x20')]=function(_0x1d0039,_0x4993d0){return db['Automation'][_0xcc75('0x44')]({'where':{'id':_0x1d0039[_0xcc75('0x47')]['id']}})[_0xcc75('0x3c')](handleEntityNotFound(_0x4993d0,null))[_0xcc75('0x3c')](removeEntity(_0x4993d0,null))[_0xcc75('0x3f')](handleError(_0x4993d0,null));};exports['addConditions']=function(_0x2e5329,_0x3b5e7b,_0x20ff17){return db[_0xcc75('0x48')][_0xcc75('0x44')]({'where':{'id':_0x2e5329[_0xcc75('0x47')]['id']}})[_0xcc75('0x3c')](handleEntityNotFound(_0x3b5e7b,null))['then'](function(_0x52982e){if(_0x52982e){return _0x52982e[_0xcc75('0x49')](_0x2e5329['body'][_0xcc75('0x4a')],_[_0xcc75('0x4b')](_0x2e5329[_0xcc75('0x46')],['ids','id'])||{});}})[_0xcc75('0x3c')](respondWithResult(_0x3b5e7b,null))[_0xcc75('0x3f')](handleError(_0x3b5e7b,null));};exports[_0xcc75('0x4c')]=function(_0x3775a7,_0x58d8fd,_0x1efed9){var _0x5b058c={};var _0x5d1765={};var _0x59aa2a;var _0x4fd453;return db[_0xcc75('0x3a')][_0xcc75('0x4d')]({'where':{'id':_0x3775a7[_0xcc75('0x47')]['id']}})['then'](handleEntityNotFound(_0x58d8fd,null))[_0xcc75('0x3c')](function(_0x3d27a6){if(_0x3d27a6){_0x59aa2a=_0x3d27a6;_0x5d1765['model']=_[_0xcc75('0x27')](db[_0xcc75('0x48')][_0xcc75('0x41')]);_0x5d1765[_0xcc75('0x28')]=_['keys'](_0x3775a7[_0xcc75('0x28')]);_0x5d1765[_0xcc75('0x29')]=_[_0xcc75('0x42')](_0x5d1765['model'],_0x5d1765[_0xcc75('0x28')]);_0x5b058c['attributes']=_[_0xcc75('0x42')](_0x5d1765[_0xcc75('0x2a')],qs[_0xcc75('0x2c')](_0x3775a7[_0xcc75('0x28')]['fields']));_0x5b058c[_0xcc75('0x2b')]=_0x5b058c[_0xcc75('0x2b')]['length']?_0x5b058c[_0xcc75('0x2b')]:_0x5d1765[_0xcc75('0x2a')];_0x5b058c[_0xcc75('0x30')]=qs[_0xcc75('0x31')](_0x3775a7[_0xcc75('0x28')][_0xcc75('0x31')]);_0x5b058c[_0xcc75('0x32')]=qs[_0xcc75('0x29')](_[_0xcc75('0x33')](_0x3775a7[_0xcc75('0x28')],_0x5d1765[_0xcc75('0x29')]));if(_0x3775a7[_0xcc75('0x28')][_0xcc75('0x34')]){_0x5b058c[_0xcc75('0x32')]=_[_0xcc75('0x35')](_0x5b058c[_0xcc75('0x32')],{'$or':_['map'](_0x5b058c[_0xcc75('0x2b')],function(_0x1b62f8){var _0x20f299={};_0x20f299[_0x1b62f8]={'$like':'%'+_0x3775a7['query']['filter']+'%'};return _0x20f299;})});}_0x5b058c=_[_0xcc75('0x35')]({},_0x5b058c,_0x3775a7['options']);return _0x59aa2a[_0xcc75('0x4c')](_0x5b058c);}})[_0xcc75('0x3c')](function(_0x1368c9){if(_0x1368c9){_0x4fd453=_0x1368c9[_0xcc75('0x2d')];if(!_0x3775a7[_0xcc75('0x28')][_0xcc75('0x2e')](_0xcc75('0x2f'))){_0x5b058c['limit']=qs[_0xcc75('0x1a')](_0x3775a7[_0xcc75('0x28')]['limit']);_0x5b058c[_0xcc75('0x19')]=qs['offset'](_0x3775a7[_0xcc75('0x28')][_0xcc75('0x19')]);}return _0x59aa2a[_0xcc75('0x4c')](_0x5b058c);}})['then'](function(_0x710beb){if(_0x710beb){return _0x710beb?{'count':_0x4fd453,'rows':_0x710beb}:null;}})[_0xcc75('0x3c')](respondWithResult(_0x58d8fd,null))[_0xcc75('0x3f')](handleError(_0x58d8fd,null));};exports[_0xcc75('0x4e')]=function(_0x5c2633,_0x353709,_0x186fff){return db['Action']['find']({'where':{'id':_0x5c2633[_0xcc75('0x47')]['id']}})[_0xcc75('0x3c')](handleEntityNotFound(_0x353709,null))['then'](function(_0x931c13){if(_0x931c13){return _0x931c13[_0xcc75('0x4e')](_0x5c2633['body'][_0xcc75('0x4a')],_[_0xcc75('0x4b')](_0x5c2633['body'],[_0xcc75('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x353709,null))[_0xcc75('0x3f')](handleError(_0x353709,null));};exports[_0xcc75('0x4f')]=function(_0x362e40,_0xbc58a5,_0x4bcb5b){var _0x32e895={};var _0x18a0b1={};var _0x40ee6b;var _0xa218fe;return db[_0xcc75('0x3a')][_0xcc75('0x4d')]({'where':{'id':_0x362e40[_0xcc75('0x47')]['id']}})[_0xcc75('0x3c')](handleEntityNotFound(_0xbc58a5,null))['then'](function(_0xc9e9df){if(_0xc9e9df){_0x40ee6b=_0xc9e9df;_0x18a0b1[_0xcc75('0x2a')]=_[_0xcc75('0x27')](db[_0xcc75('0x50')]['rawAttributes']);_0x18a0b1[_0xcc75('0x28')]=_[_0xcc75('0x27')](_0x362e40[_0xcc75('0x28')]);_0x18a0b1['filters']=_[_0xcc75('0x42')](_0x18a0b1[_0xcc75('0x2a')],_0x18a0b1['query']);_0x32e895[_0xcc75('0x2b')]=_[_0xcc75('0x42')](_0x18a0b1['model'],qs[_0xcc75('0x2c')](_0x362e40[_0xcc75('0x28')][_0xcc75('0x2c')]));_0x32e895['attributes']=_0x32e895[_0xcc75('0x2b')][_0xcc75('0x2d')]?_0x32e895['attributes']:_0x18a0b1['model'];_0x32e895[_0xcc75('0x30')]=qs[_0xcc75('0x31')](_0x362e40[_0xcc75('0x28')]['sort']);_0x32e895[_0xcc75('0x32')]=qs[_0xcc75('0x29')](_[_0xcc75('0x33')](_0x362e40[_0xcc75('0x28')],_0x18a0b1[_0xcc75('0x29')]));if(_0x362e40[_0xcc75('0x28')][_0xcc75('0x34')]){_0x32e895[_0xcc75('0x32')]=_['merge'](_0x32e895[_0xcc75('0x32')],{'$or':_['map'](_0x32e895[_0xcc75('0x2b')],function(_0x522608){var _0x3f00f7={};_0x3f00f7[_0x522608]={'$like':'%'+_0x362e40[_0xcc75('0x28')][_0xcc75('0x34')]+'%'};return _0x3f00f7;})});}_0x32e895=_[_0xcc75('0x35')]({},_0x32e895,_0x362e40['options']);return _0x40ee6b['getActions'](_0x32e895);}})[_0xcc75('0x3c')](function(_0x595976){if(_0x595976){_0xa218fe=_0x595976[_0xcc75('0x2d')];if(!_0x362e40[_0xcc75('0x28')][_0xcc75('0x2e')](_0xcc75('0x2f'))){_0x32e895[_0xcc75('0x1a')]=qs[_0xcc75('0x1a')](_0x362e40['query'][_0xcc75('0x1a')]);_0x32e895['offset']=qs['offset'](_0x362e40[_0xcc75('0x28')]['offset']);}return _0x40ee6b[_0xcc75('0x4f')](_0x32e895);}})['then'](function(_0x304840){if(_0x304840){return _0x304840?{'count':_0xa218fe,'rows':_0x304840}:null;}})['then'](respondWithResult(_0xbc58a5,null))[_0xcc75('0x3f')](handleError(_0xbc58a5,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 0687bf4..392d089 100644 --- a/server/api/automation/automation.model.js +++ b/server/api/automation/automation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2868=['path','../../config/environment','./automation.attributes','define','Automation','lodash','../../config/logger','api','bluebird'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x2868,0x191));var _0x8286=function(_0x36a063,_0x11c7fe){_0x36a063=_0x36a063-0x0;var _0x5e86a7=_0x2868[_0x36a063];return _0x5e86a7;};'use strict';var _=require(_0x8286('0x0'));var util=require('util');var logger=require(_0x8286('0x1'))(_0x8286('0x2'));var moment=require('moment');var BPromise=require(_0x8286('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8286('0x4'));var rimraf=require('rimraf');var config=require(_0x8286('0x5'));var attributes=require(_0x8286('0x6'));module['exports']=function(_0xa1b0f9,_0x9a8dcd){return _0xa1b0f9[_0x8286('0x7')](_0x8286('0x8'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a5f=['api','moment','request-promise','../../config/environment','define','Automation','tools_automations','lodash','util'];(function(_0x1a3885,_0x20644a){var _0x3fe45e=function(_0x53a453){while(--_0x53a453){_0x1a3885['push'](_0x1a3885['shift']());}};_0x3fe45e(++_0x20644a);}(_0x6a5f,0xbb));var _0xf6a5=function(_0x502ec7,_0x8e99b3){_0x502ec7=_0x502ec7-0x0;var _0x362b0f=_0x6a5f[_0x502ec7];return _0x362b0f;};'use strict';var _=require(_0xf6a5('0x0'));var util=require(_0xf6a5('0x1'));var logger=require('../../config/logger')(_0xf6a5('0x2'));var moment=require(_0xf6a5('0x3'));var BPromise=require('bluebird');var rp=require(_0xf6a5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf6a5('0x5'));var attributes=require('./automation.attributes');module['exports']=function(_0x295c72,_0x556571){return _0x295c72[_0xf6a5('0x6')](_0xf6a5('0x7'),attributes,{'tableName':_0xf6a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 08c9d28..45f0c7f 100644 --- a/server/api/automation/automation.rpc.js +++ b/server/api/automation/automation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3a0=['../../config/environment','client','http','then','info','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x9b9ecf,_0x2feb50){var _0x5816d9=function(_0x5b3085){while(--_0x5b3085){_0x9b9ecf['push'](_0x9b9ecf['shift']());}};_0x5816d9(++_0x2feb50);}(_0xd3a0,0x7c));var _0x0d3a=function(_0x2e4e82,_0xdcbd54){_0x2e4e82=_0x2e4e82-0x0;var _0x1a4c11=_0xd3a0[_0x2e4e82];return _0x1a4c11;};'use strict';var _=require(_0x0d3a('0x0'));var util=require(_0x0d3a('0x1'));var moment=require('moment');var BPromise=require(_0x0d3a('0x2'));var rs=require(_0x0d3a('0x3'));var fs=require('fs');var Redis=require(_0x0d3a('0x4'));var db=require(_0x0d3a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d3a('0x6'))(_0x0d3a('0x7'));var config=require(_0x0d3a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0d3a('0x9')][_0x0d3a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ba00e,_0x452d97,_0x212591){return new BPromise(function(_0x587d16,_0x264314){return client['request'](_0x1ba00e,_0x212591)[_0x0d3a('0xb')](function(_0x543266){logger[_0x0d3a('0xc')]('Automation,\x20%s,\x20%s',_0x452d97,'request\x20sent');logger['debug'](_0x0d3a('0xd'),_0x452d97,_0x0d3a('0xe'),JSON[_0x0d3a('0xf')](_0x543266));if(_0x543266[_0x0d3a('0x10')]){if(_0x543266[_0x0d3a('0x10')][_0x0d3a('0x11')]===0x1f4){logger[_0x0d3a('0x10')](_0x0d3a('0x12'),_0x452d97,_0x543266[_0x0d3a('0x10')][_0x0d3a('0x13')]);return _0x264314(_0x543266['error']['message']);}logger['error']('Automation,\x20%s,\x20%s',_0x452d97,_0x543266['error'][_0x0d3a('0x13')]);return _0x587d16(_0x543266['error'][_0x0d3a('0x13')]);}else{logger[_0x0d3a('0xc')](_0x0d3a('0x12'),_0x452d97,_0x0d3a('0xe'));_0x587d16(_0x543266[_0x0d3a('0x14')][_0x0d3a('0x13')]);}})[_0x0d3a('0x15')](function(_0x2c72c0){logger[_0x0d3a('0x10')](_0x0d3a('0x12'),_0x452d97,_0x2c72c0);_0x264314(_0x2c72c0);});});} \ No newline at end of file +var _0x98b9=['client','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x41b91d,_0x5ce1f4){var _0x357bbd=function(_0x4f83f3){while(--_0x4f83f3){_0x41b91d['push'](_0x41b91d['shift']());}};_0x357bbd(++_0x5ce1f4);}(_0x98b9,0x97));var _0x998b=function(_0x568c71,_0x245416){_0x568c71=_0x568c71-0x0;var _0x1809c7=_0x98b9[_0x568c71];return _0x1809c7;};'use strict';var _=require('lodash');var util=require(_0x998b('0x0'));var moment=require(_0x998b('0x1'));var BPromise=require(_0x998b('0x2'));var rs=require(_0x998b('0x3'));var fs=require('fs');var Redis=require(_0x998b('0x4'));var db=require(_0x998b('0x5'))['db'];var utils=require(_0x998b('0x6'));var logger=require(_0x998b('0x7'))(_0x998b('0x8'));var config=require('../../config/environment');var jayson=require(_0x998b('0x9'));var client=jayson[_0x998b('0xa')][_0x998b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x501201,_0x5327da,_0x3e82ef){return new BPromise(function(_0x317e2b,_0x4c414b){return client[_0x998b('0xc')](_0x501201,_0x3e82ef)['then'](function(_0x486def){logger[_0x998b('0xd')](_0x998b('0xe'),_0x5327da,_0x998b('0xf'));logger['debug'](_0x998b('0x10'),_0x5327da,'request\x20sent',JSON[_0x998b('0x11')](_0x486def));if(_0x486def[_0x998b('0x12')]){if(_0x486def[_0x998b('0x12')][_0x998b('0x13')]===0x1f4){logger[_0x998b('0x12')](_0x998b('0xe'),_0x5327da,_0x486def[_0x998b('0x12')]['message']);return _0x4c414b(_0x486def['error']['message']);}logger[_0x998b('0x12')](_0x998b('0xe'),_0x5327da,_0x486def[_0x998b('0x12')][_0x998b('0x14')]);return _0x317e2b(_0x486def['error']['message']);}else{logger[_0x998b('0xd')](_0x998b('0xe'),_0x5327da,_0x998b('0xf'));_0x317e2b(_0x486def[_0x998b('0x15')][_0x998b('0x14')]);}})[_0x998b('0x16')](function(_0x464b38){logger['error']('Automation,\x20%s,\x20%s',_0x5327da,_0x464b38);_0x4c414b(_0x464b38);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 546e24b..3b3326d 100644 --- a/server/api/automation/index.js +++ b/server/api/automation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0de=['getConditions','/:id/actions','getActions','post','create','addActions','put','/:id','update','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./automation.controller','index','get','show','/:id/conditions','isAuthenticated'];(function(_0x475d93,_0x57f86f){var _0x378f3e=function(_0x4d52f6){while(--_0x4d52f6){_0x475d93['push'](_0x475d93['shift']());}};_0x378f3e(++_0x57f86f);}(_0xe0de,0x128));var _0xee0d=function(_0xda76fa,_0x2acfe5){_0xda76fa=_0xda76fa-0x0;var _0x110c0f=_0xe0de[_0xda76fa];return _0x110c0f;};'use strict';var multer=require(_0xee0d('0x0'));var util=require('util');var path=require(_0xee0d('0x1'));var timeout=require(_0xee0d('0x2'));var express=require('express');var router=express[_0xee0d('0x3')]();var auth=require(_0xee0d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xee0d('0x5'));var controller=require(_0xee0d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xee0d('0x7')]);router[_0xee0d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xee0d('0x9')]);router[_0xee0d('0x8')](_0xee0d('0xa'),auth[_0xee0d('0xb')](),controller[_0xee0d('0xc')]);router[_0xee0d('0x8')](_0xee0d('0xd'),auth[_0xee0d('0xb')](),controller[_0xee0d('0xe')]);router[_0xee0d('0xf')]('/',auth[_0xee0d('0xb')](),controller[_0xee0d('0x10')]);router[_0xee0d('0xf')](_0xee0d('0xa'),auth[_0xee0d('0xb')](),controller['addConditions']);router[_0xee0d('0xf')](_0xee0d('0xd'),auth[_0xee0d('0xb')](),controller[_0xee0d('0x11')]);router[_0xee0d('0x12')](_0xee0d('0x13'),auth[_0xee0d('0xb')](),controller[_0xee0d('0x14')]);router['delete'](_0xee0d('0x13'),auth['isAuthenticated'](),controller[_0xee0d('0x15')]);module['exports']=router; \ No newline at end of file +var _0x78b3=['get','isAuthenticated','index','/:id','show','/:id/actions','create','post','/:id/conditions','addConditions','addActions','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./automation.controller'];(function(_0x43377d,_0x12fcbe){var _0x6c9dbe=function(_0x54f9dc){while(--_0x54f9dc){_0x43377d['push'](_0x43377d['shift']());}};_0x6c9dbe(++_0x12fcbe);}(_0x78b3,0x151));var _0x378b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78b3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x378b('0x0'));var util=require(_0x378b('0x1'));var path=require(_0x378b('0x2'));var timeout=require(_0x378b('0x3'));var express=require(_0x378b('0x4'));var router=express['Router']();var auth=require(_0x378b('0x5'));var interaction=require(_0x378b('0x6'));var config=require('../../config/environment');var controller=require(_0x378b('0x7'));router[_0x378b('0x8')]('/',auth[_0x378b('0x9')](),controller[_0x378b('0xa')]);router['get'](_0x378b('0xb'),auth[_0x378b('0x9')](),controller[_0x378b('0xc')]);router['get']('/:id/conditions',auth[_0x378b('0x9')](),controller['getConditions']);router[_0x378b('0x8')](_0x378b('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth[_0x378b('0x9')](),controller[_0x378b('0xe')]);router[_0x378b('0xf')](_0x378b('0x10'),auth[_0x378b('0x9')](),controller[_0x378b('0x11')]);router[_0x378b('0xf')](_0x378b('0xd'),auth[_0x378b('0x9')](),controller[_0x378b('0x12')]);router[_0x378b('0x13')](_0x378b('0xb'),auth[_0x378b('0x9')](),controller[_0x378b('0x14')]);router[_0x378b('0x15')](_0x378b('0xb'),auth[_0x378b('0x9')](),controller['destroy']);module[_0x378b('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 3e63210..b5bdc6a 100644 --- a/server/api/campaign/campaign.attributes.js +++ b/server/api/campaign/campaign.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9735=['#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x115b95,_0xa1f8b9){var _0x460b3d=function(_0x510c02){while(--_0x510c02){_0x115b95['push'](_0x115b95['shift']());}};_0x460b3d(++_0xa1f8b9);}(_0x9735,0x1b7));var _0x5973=function(_0x265a1f,_0x1fd256){_0x265a1f=_0x265a1f-0x0;var _0x2e08f3=_0x9735[_0x265a1f];return _0x2e08f3;};'use strict';var Sequelize=require('sequelize');module[_0x5973('0x0')]={'name':{'type':Sequelize[_0x5973('0x1')],'unique':_0x5973('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5973('0x3')](_0x5973('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x5973('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5973('0x5')},'limitCalls':{'type':Sequelize[_0x5973('0x6')](0x4)[_0x5973('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5973('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5973('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5973('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x5973('0x6')](0x3)[_0x5973('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x5973('0x6')](0x3)[_0x5973('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5973('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5973('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5973('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x5973('0x6')](0x3)[_0x5973('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5973('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5973('0x6')](0x5)[_0x5973('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5973('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5973('0x7')],'defaultValue':0x3,'comment':_0x5973('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5973('0x6')](0x5)[_0x5973('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x5973('0x6')](0x3)[_0x5973('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5973('0xe')},'dialTimezone':{'type':Sequelize[_0x5973('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x5973('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x5973('0x3')](_0x5973('0x10'),_0x5973('0x11'),_0x5973('0x12')),'defaultValue':_0x5973('0x10')},'dialAMDActive':{'type':Sequelize[_0x5973('0x13')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x5973('0x6')](0x9)[_0x5973('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5973('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x5973('0x6')](0x9)[_0x5973('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5973('0x6')](0x9)[_0x5973('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5973('0x6')](0x9)[_0x5973('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5973('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x5973('0x6')](0x9)[_0x5973('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5973('0x6')](0x9)[_0x5973('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5973('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5973('0x6')](0x9)[_0x5973('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5973('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x5973('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5973('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5973('0x6')](0x9)[_0x5973('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5973('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5973('0x3')](_0x5973('0x1a'),_0x5973('0x1b')),'defaultValue':_0x5973('0x1a')},'dialPrefix':{'type':Sequelize[_0x5973('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x5973('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5973('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x5973('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5973('0x1d')}}; \ No newline at end of file +var _0xa6a7=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence'];(function(_0x33c18f,_0x4b2dd6){var _0xdf7c7a=function(_0x1dc31b){while(--_0x1dc31b){_0x33c18f['push'](_0x33c18f['shift']());}};_0xdf7c7a(++_0x4b2dd6);}(_0xa6a7,0x1a6));var _0x7a6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa6a7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7a6a('0x0'));module['exports']={'name':{'type':Sequelize[_0x7a6a('0x1')],'unique':_0x7a6a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7a6a('0x3')](_0x7a6a('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x7a6a('0x5')],'defaultValue':0x0,'comment':_0x7a6a('0x6')},'limitCalls':{'type':Sequelize[_0x7a6a('0x7')](0x4)[_0x7a6a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7a6a('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7a6a('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7a6a('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x7a6a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a6a('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7a6a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7a6a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a6a('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x7a6a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a6a('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7a6a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a6a('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7a6a('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7a6a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a6a('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7a6a('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7a6a('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7a6a('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x7a6a('0x3')](_0x7a6a('0x10'),_0x7a6a('0x11'),_0x7a6a('0x12')),'defaultValue':_0x7a6a('0x10')},'dialAMDActive':{'type':Sequelize[_0x7a6a('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x7a6a('0x7')](0x9)[_0x7a6a('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7a6a('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x7a6a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7a6a('0x7')](0x9)[_0x7a6a('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7a6a('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7a6a('0x7')](0x9)[_0x7a6a('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7a6a('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x7a6a('0x7')](0x9)[_0x7a6a('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7a6a('0x7')](0x9)[_0x7a6a('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7a6a('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x7a6a('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7a6a('0x7')](0x9)[_0x7a6a('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7a6a('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7a6a('0x3')](_0x7a6a('0x18'),'ASC'),'defaultValue':_0x7a6a('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7a6a('0x7')](0x3)[_0x7a6a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x7a6a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7a6a('0x19')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index f35d0db..08ec3ce 100644 --- a/server/api/campaign/campaign.controller.js +++ b/server/api/campaign/campaign.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe63e=['clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','autoAssociation','update','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','phone','scheduledAt','ContactId','NOW()','toString','ListId','from','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','fromQuery','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','insert','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','limit','set','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','map','type','key','VIRTUAL','field','filter','merge','options','Campaign','includeAll','include','rows','catch','show','params','find','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x5960a0,_0x8837a8){var _0xe1e027=function(_0x13454b){while(--_0x13454b){_0x5960a0['push'](_0x5960a0['shift']());}};_0xe1e027(++_0x8837a8);}(_0xe63e,0xba));var _0xee63=function(_0x48c163,_0x45cb59){_0x48c163=_0x48c163-0x0;var _0x4f7a23=_0xe63e[_0x48c163];return _0x4f7a23;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xee63('0x0'));var rimraf=require(_0xee63('0x1'));var zipdir=require(_0xee63('0x2'));var jsonpatch=require(_0xee63('0x3'));var rp=require('request-promise');var moment=require(_0xee63('0x4'));var BPromise=require(_0xee63('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xee63('0x6'));var sox=require(_0xee63('0x7'));var csv=require(_0xee63('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xee63('0x9'));var squel=require(_0xee63('0xa'));var crypto=require(_0xee63('0xb'));var jsforce=require(_0xee63('0xc'));var deskjs=require(_0xee63('0xd'));var toCsv=require(_0xee63('0x8'));var querystring=require(_0xee63('0xe'));var Papa=require(_0xee63('0xf'));var Redis=require(_0xee63('0x10'));var authService=require(_0xee63('0x11'));var qs=require(_0xee63('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee63('0x13'))(_0xee63('0x14'));var utils=require(_0xee63('0x15'));var config=require('../../config/environment');var db=require(_0xee63('0x16'))['db'];function respondWithStatusCode(_0x480ce6,_0x5a82c1){_0x5a82c1=_0x5a82c1||0xcc;return function(_0x3335c1){if(_0x3335c1){return _0x480ce6[_0xee63('0x17')](_0x5a82c1);}return _0x480ce6[_0xee63('0x18')](_0x5a82c1)[_0xee63('0x19')]();};}function respondWithResult(_0x124e72,_0x333177){_0x333177=_0x333177||0xc8;return function(_0x3d27ed){if(_0x3d27ed){return _0x124e72[_0xee63('0x18')](_0x333177)[_0xee63('0x1a')](_0x3d27ed);}};}function respondWithFilteredResult(_0x50fc03,_0x4a0d31){return function(_0x1f369d){if(_0x1f369d){var _0x37723a=_0x1f369d[_0xee63('0x1b')],_0x2c811b=_0x4a0d31['offset'],_0x6682fb=_0x4a0d31['offset']+_0x4a0d31[_0xee63('0x1c')],_0x1d9b19;if(_0x6682fb>=_0x37723a){_0x6682fb=_0x37723a;_0x1d9b19=0xc8;}else{_0x1d9b19=0xce;}_0x50fc03['status'](_0x1d9b19);return _0x50fc03[_0xee63('0x1d')]('Content-Range',_0x2c811b+'-'+_0x6682fb+'/'+_0x37723a)['json'](_0x1f369d);}return null;};}function patchUpdates(_0x17c18d){return function(_0x179711){try{jsonpatch['apply'](_0x179711,_0x17c18d,!![]);}catch(_0x2ff86a){return BPromise['reject'](_0x2ff86a);}return _0x179711[_0xee63('0x1e')]();};}function saveUpdates(_0x360b14,_0x3cd4ca){return function(_0x3f5bc6){if(_0x3f5bc6){return _0x3f5bc6['update'](_0x360b14)[_0xee63('0x1f')](function(_0x4a672f){return _0x4a672f;});}return null;};}function removeEntity(_0x2ae870,_0x2f8c6d){return function(_0x54556d){if(_0x54556d){return _0x54556d[_0xee63('0x20')]()[_0xee63('0x1f')](function(){var _0x8c248b=_0x54556d[_0xee63('0x21')]({'plain':!![]});var _0x31d2ab='IvrCampaigns';return db[_0xee63('0x22')][_0xee63('0x20')]({'where':{'type':_0x31d2ab,'resourceId':_0x8c248b['id']}})['then'](function(){return _0x54556d;});})['then'](function(){_0x2ae870[_0xee63('0x18')](0xcc)[_0xee63('0x19')]();});}};}function handleEntityNotFound(_0x2eafe3,_0x27d63c){return function(_0x542c9b){if(!_0x542c9b){_0x2eafe3[_0xee63('0x17')](0x194);}return _0x542c9b;};}function handleError(_0xd25454,_0x50b331){_0x50b331=_0x50b331||0x1f4;return function(_0x47a33e){logger[_0xee63('0x23')](_0x47a33e[_0xee63('0x24')]);if(_0x47a33e[_0xee63('0x25')]){delete _0x47a33e['name'];}_0xd25454[_0xee63('0x18')](_0x50b331)[_0xee63('0x26')](_0x47a33e);};}exports[_0xee63('0x27')]=function(_0x28d0de,_0x17a9f5){var _0x2c36e4={},_0x252668={},_0x27119b={'count':0x0,'rows':[]};var _0x46626c=db['Campaign'][_0xee63('0x28')];_0x252668[_0xee63('0x29')]=_['keys'](_0x46626c);_0x252668['query']=_[_0xee63('0x2a')](_0x28d0de[_0xee63('0x2b')]);_0x252668['filters']=_['intersection'](_0x252668[_0xee63('0x29')],_0x252668['query']);_0x2c36e4[_0xee63('0x2c')]=_[_0xee63('0x2d')](_0x252668['model'],qs[_0xee63('0x2e')](_0x28d0de[_0xee63('0x2b')][_0xee63('0x2e')]));_0x2c36e4['attributes']=_0x2c36e4[_0xee63('0x2c')][_0xee63('0x2f')]?_0x2c36e4[_0xee63('0x2c')]:_0x252668[_0xee63('0x29')];if(!_0x28d0de['query'][_0xee63('0x30')](_0xee63('0x31'))){_0x2c36e4['limit']=qs[_0xee63('0x1c')](_0x28d0de[_0xee63('0x2b')][_0xee63('0x1c')]);_0x2c36e4[_0xee63('0x32')]=qs[_0xee63('0x32')](_0x28d0de[_0xee63('0x2b')][_0xee63('0x32')]);}_0x2c36e4[_0xee63('0x33')]=qs['sort'](_0x28d0de[_0xee63('0x2b')][_0xee63('0x34')]);_0x2c36e4[_0xee63('0x35')]=qs[_0xee63('0x36')](_[_0xee63('0x37')](_0x28d0de[_0xee63('0x2b')],_0x252668[_0xee63('0x36')]));if(_0x28d0de[_0xee63('0x2b')]['filter']){_0x2c36e4['where']=_['merge'](_0x2c36e4[_0xee63('0x35')],{'$or':_[_0xee63('0x38')](_0x46626c,function(_0x1b96e9){if(_0x1b96e9[_0xee63('0x39')][_0xee63('0x3a')]!==_0xee63('0x3b')){var _0x443152={};_0x443152[_0x1b96e9[_0xee63('0x3c')]]={'$like':'%'+_0x28d0de[_0xee63('0x2b')][_0xee63('0x3d')]+'%'};return _0x443152;}})});}_0x2c36e4=_[_0xee63('0x3e')]({},_0x2c36e4,_0x28d0de[_0xee63('0x3f')]);var _0x217e09={'where':_0x2c36e4[_0xee63('0x35')]};return db[_0xee63('0x40')][_0xee63('0x1b')](_0x217e09)[_0xee63('0x1f')](function(_0x2cda09){_0x27119b[_0xee63('0x1b')]=_0x2cda09;if(_0x28d0de[_0xee63('0x2b')][_0xee63('0x41')]){_0x2c36e4[_0xee63('0x42')]=[{'all':!![]}];}return db[_0xee63('0x40')]['findAll'](_0x2c36e4);})[_0xee63('0x1f')](function(_0x349423){_0x27119b[_0xee63('0x43')]=_0x349423;return _0x27119b;})[_0xee63('0x1f')](respondWithFilteredResult(_0x17a9f5,_0x2c36e4))[_0xee63('0x44')](handleError(_0x17a9f5,null));};exports[_0xee63('0x45')]=function(_0x542e06,_0x301880){var _0x325d88={'raw':![],'where':{'id':_0x542e06[_0xee63('0x46')]['id']}},_0xc89a53={};_0xc89a53[_0xee63('0x29')]=_[_0xee63('0x2a')](db[_0xee63('0x40')]['rawAttributes']);_0xc89a53['query']=_[_0xee63('0x2a')](_0x542e06[_0xee63('0x2b')]);_0xc89a53[_0xee63('0x36')]=_['intersection'](_0xc89a53['model'],_0xc89a53[_0xee63('0x2b')]);_0x325d88['attributes']=_[_0xee63('0x2d')](_0xc89a53[_0xee63('0x29')],qs[_0xee63('0x2e')](_0x542e06[_0xee63('0x2b')][_0xee63('0x2e')]));_0x325d88['attributes']=_0x325d88['attributes'][_0xee63('0x2f')]?_0x325d88[_0xee63('0x2c')]:_0xc89a53[_0xee63('0x29')];if(_0x542e06[_0xee63('0x2b')][_0xee63('0x41')]){_0x325d88['include']=[{'all':!![]}];}_0x325d88=_[_0xee63('0x3e')]({},_0x325d88,_0x542e06['options']);return db[_0xee63('0x40')][_0xee63('0x47')](_0x325d88)[_0xee63('0x1f')](handleEntityNotFound(_0x301880,null))[_0xee63('0x1f')](respondWithResult(_0x301880,null))[_0xee63('0x44')](handleError(_0x301880,null));};exports['create']=function(_0x3ca6d6,_0x813415){return db['Campaign'][_0xee63('0x48')](_0x3ca6d6[_0xee63('0x49')],{})[_0xee63('0x1f')](function(_0x7b7079){var _0xffdf2d=_0x3ca6d6[_0xee63('0x4a')][_0xee63('0x21')]({'plain':!![]});if(!_0xffdf2d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xffdf2d[_0xee63('0x4b')]===_0xee63('0x4a')){var _0x285881=_0x7b7079[_0xee63('0x21')]({'plain':!![]});var _0x550d5b='IvrCampaigns';return db['UserProfileSection'][_0xee63('0x47')]({'where':{'name':_0x550d5b,'userProfileId':_0xffdf2d[_0xee63('0x4c')]},'raw':!![]})[_0xee63('0x1f')](function(_0x3dcc24){if(_0x3dcc24&&_0x3dcc24['autoAssociation']===0x0){return db[_0xee63('0x22')]['create']({'name':_0x285881[_0xee63('0x25')],'resourceId':_0x285881['id'],'type':_0x3dcc24[_0xee63('0x25')],'sectionId':_0x3dcc24['id']},{})[_0xee63('0x1f')](function(){return _0x7b7079;});}else{return _0x7b7079;}})[_0xee63('0x44')](function(_0x33d4d7){logger['error'](_0xee63('0x4d'),_0x33d4d7);throw _0x33d4d7;});}return _0x7b7079;})[_0xee63('0x1f')](respondWithResult(_0x813415,0xc9))[_0xee63('0x44')](handleError(_0x813415,null));};exports[_0xee63('0x4e')]=function(_0x24984f,_0x26548){var _0x30c88c={'raw':![],'where':{'id':_0x24984f[_0xee63('0x46')]['id']}},_0xf81a02={};_0xf81a02[_0xee63('0x29')]=_[_0xee63('0x2a')](db[_0xee63('0x40')]['rawAttributes']);_0x30c88c[_0xee63('0x2c')]=_[_0xee63('0x2d')](_0xf81a02['model'],qs['fields'](_0x24984f[_0xee63('0x2b')][_0xee63('0x2e')]));_0x30c88c[_0xee63('0x2c')]=_0x30c88c[_0xee63('0x2c')]['length']?_0x30c88c['attributes']:_0xf81a02[_0xee63('0x29')];if(_0x24984f[_0xee63('0x2b')]['includeAll']){_0x30c88c[_0xee63('0x42')]=[{'all':!![]}];}_0x30c88c=_['merge']({},_0x30c88c,_0x24984f[_0xee63('0x3f')]);return db['Campaign']['find'](_0x30c88c)[_0xee63('0x1f')](handleEntityNotFound(_0x26548,null))[_0xee63('0x1f')](function(_0x14c4d5){if(_0x14c4d5){var _0x512512=_0x14c4d5[_0xee63('0x21')]({'plain':!![]});_0x512512=qs[_0xee63('0x4f')](_0x512512,['id',_0xee63('0x50'),_0xee63('0x51')]);_0x24984f[_0xee63('0x49')]=_['omit'](_0x24984f['body'],['id','createdAt',_0xee63('0x51')]);return db['Campaign'][_0xee63('0x48')](_[_0xee63('0x3e')](_0x512512,_0x24984f[_0xee63('0x49')]),{'include':_0x24984f[_0xee63('0x2b')][_0xee63('0x41')]?[{'all':!![]}]:undefined})[_0xee63('0x1f')](function(_0x4a7d53){var _0x331460=_0x24984f[_0xee63('0x4a')][_0xee63('0x21')]({'plain':!![]});if(!_0x331460)throw new Error(_0xee63('0x52'));if(_0x331460[_0xee63('0x4b')]===_0xee63('0x4a')){var _0x487913=_0x4a7d53['get']({'plain':!![]});var _0x22da5b=_0xee63('0x53');return db['UserProfileSection']['find']({'where':{'name':_0x22da5b,'userProfileId':_0x331460['userProfileId']},'raw':!![]})[_0xee63('0x1f')](function(_0x2a5d19){if(_0x2a5d19&&_0x2a5d19[_0xee63('0x54')]===0x0){return db[_0xee63('0x22')][_0xee63('0x48')]({'name':_0x487913[_0xee63('0x25')],'resourceId':_0x487913['id'],'type':_0x2a5d19[_0xee63('0x25')],'sectionId':_0x2a5d19['id']},{})['then'](function(){return _0x4a7d53;});}else{return _0x4a7d53;}})[_0xee63('0x44')](function(_0x4a66b2){logger[_0xee63('0x23')](_0xee63('0x4d'),_0x4a66b2);throw _0x4a66b2;});}return _0x4a7d53;});}})[_0xee63('0x1f')](respondWithResult(_0x26548,0xc9))['catch'](handleError(_0x26548,null));};exports[_0xee63('0x55')]=function(_0x5f44aa,_0x29f7de){if(_0x5f44aa[_0xee63('0x49')]['id']){delete _0x5f44aa[_0xee63('0x49')]['id'];}return db[_0xee63('0x40')]['find']({'where':{'id':_0x5f44aa[_0xee63('0x46')]['id']}})[_0xee63('0x1f')](handleEntityNotFound(_0x29f7de,null))[_0xee63('0x1f')](saveUpdates(_0x5f44aa[_0xee63('0x49')],null))[_0xee63('0x1f')](respondWithResult(_0x29f7de,null))[_0xee63('0x44')](handleError(_0x29f7de,null));};exports[_0xee63('0x20')]=function(_0x4cfbdd,_0x409b3c){return db[_0xee63('0x40')]['find']({'where':{'id':_0x4cfbdd[_0xee63('0x46')]['id']}})[_0xee63('0x1f')](handleEntityNotFound(_0x409b3c,null))['then'](removeEntity(_0x409b3c,null))[_0xee63('0x44')](handleError(_0x409b3c,null));};exports[_0xee63('0x56')]=function(_0x11c926,_0x43ce45,_0x144de5){var _0x266fb1={'raw':!![],'where':{}};var _0x2b04d1={};var _0x2a78f5={'count':0x0,'rows':[]};return db[_0xee63('0x40')][_0xee63('0x57')]({'where':{'id':_0x11c926[_0xee63('0x46')]['id']}})['then'](handleEntityNotFound(_0x43ce45,null))[_0xee63('0x1f')](function(_0x3082c2){if(_0x3082c2){_0x2b04d1['model']=_[_0xee63('0x2a')](db[_0xee63('0x58')][_0xee63('0x28')]);_0x2b04d1[_0xee63('0x2b')]=_['keys'](_0x11c926[_0xee63('0x2b')]);_0x2b04d1[_0xee63('0x36')]=_[_0xee63('0x2d')](_0x2b04d1[_0xee63('0x29')],_0x2b04d1[_0xee63('0x2b')]);_0x266fb1[_0xee63('0x2c')]=_['intersection'](_0x2b04d1['model'],qs['fields'](_0x11c926[_0xee63('0x2b')][_0xee63('0x2e')]));_0x266fb1[_0xee63('0x2c')]=_0x266fb1[_0xee63('0x2c')][_0xee63('0x2f')]?_0x266fb1[_0xee63('0x2c')]:_0x2b04d1[_0xee63('0x29')];if(!_0x11c926[_0xee63('0x2b')][_0xee63('0x30')](_0xee63('0x31'))){_0x266fb1[_0xee63('0x1c')]=qs[_0xee63('0x1c')](_0x11c926[_0xee63('0x2b')][_0xee63('0x1c')]);_0x266fb1[_0xee63('0x32')]=qs[_0xee63('0x32')](_0x11c926['query']['offset']);}_0x266fb1[_0xee63('0x33')]=qs[_0xee63('0x34')](_0x11c926[_0xee63('0x2b')]['sort']);_0x266fb1[_0xee63('0x35')]=qs[_0xee63('0x36')](_[_0xee63('0x37')](_0x11c926['query'],_0x2b04d1['filters']));_0x266fb1[_0xee63('0x35')][_0xee63('0x59')]=_0x3082c2['id'];if(_0x11c926[_0xee63('0x2b')][_0xee63('0x3d')]){_0x266fb1[_0xee63('0x35')]=_[_0xee63('0x3e')](_0x266fb1[_0xee63('0x35')],{'$or':_['map'](_0x266fb1['attributes'],function(_0x57fc43){var _0x5d2174={};_0x5d2174[_0x57fc43]={'$like':'%'+_0x11c926[_0xee63('0x2b')]['filter']+'%'};return _0x5d2174;})});}_0x266fb1=_[_0xee63('0x3e')]({},_0x266fb1,_0x11c926[_0xee63('0x3f')]);return db[_0xee63('0x58')]['count']({'where':_0x266fb1[_0xee63('0x35')]})[_0xee63('0x1f')](function(_0x39eff9){_0x2a78f5['count']=_0x39eff9;if(_0x11c926[_0xee63('0x2b')][_0xee63('0x41')]){_0x266fb1['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x266fb1);})[_0xee63('0x1f')](function(_0x3b23fc){_0x2a78f5[_0xee63('0x43')]=_0x3b23fc;return _0x2a78f5;});}})['then'](respondWithFilteredResult(_0x43ce45,_0x266fb1))[_0xee63('0x44')](handleError(_0x43ce45,null));};exports[_0xee63('0x5a')]=function(_0x4943f4,_0x291fe3,_0x503290){var _0x2a623a={'raw':!![],'where':{}};var _0x31276a={};var _0x4ab081={'count':0x0,'rows':[]};return db['Campaign'][_0xee63('0x57')]({'where':{'id':_0x4943f4['params']['id']}})[_0xee63('0x1f')](handleEntityNotFound(_0x291fe3,null))[_0xee63('0x1f')](function(_0x51a7b3){if(_0x51a7b3){_0x31276a[_0xee63('0x29')]=_[_0xee63('0x2a')](db[_0xee63('0x5b')][_0xee63('0x28')]);_0x31276a[_0xee63('0x2b')]=_[_0xee63('0x2a')](_0x4943f4[_0xee63('0x2b')]);_0x31276a[_0xee63('0x36')]=_[_0xee63('0x2d')](_0x31276a[_0xee63('0x29')],_0x31276a[_0xee63('0x2b')]);_0x2a623a[_0xee63('0x2c')]=_['intersection'](_0x31276a[_0xee63('0x29')],qs['fields'](_0x4943f4['query'][_0xee63('0x2e')]));_0x2a623a['attributes']=_0x2a623a['attributes'][_0xee63('0x2f')]?_0x2a623a['attributes']:_0x31276a['model'];if(!_0x4943f4[_0xee63('0x2b')][_0xee63('0x30')](_0xee63('0x31'))){_0x2a623a[_0xee63('0x1c')]=qs[_0xee63('0x1c')](_0x4943f4[_0xee63('0x2b')]['limit']);_0x2a623a[_0xee63('0x32')]=qs[_0xee63('0x32')](_0x4943f4[_0xee63('0x2b')]['offset']);}_0x2a623a[_0xee63('0x33')]=qs[_0xee63('0x34')](_0x4943f4['query'][_0xee63('0x34')]);_0x2a623a[_0xee63('0x35')]=qs[_0xee63('0x36')](_[_0xee63('0x37')](_0x4943f4[_0xee63('0x2b')],_0x31276a[_0xee63('0x36')]));_0x2a623a[_0xee63('0x35')][_0xee63('0x59')]=_0x51a7b3['id'];if(_0x4943f4[_0xee63('0x2b')]['filter']){_0x2a623a[_0xee63('0x35')]=_[_0xee63('0x3e')](_0x2a623a[_0xee63('0x35')],{'$or':_[_0xee63('0x38')](_0x2a623a[_0xee63('0x2c')],function(_0x51090b){var _0x4d3f74={};_0x4d3f74[_0x51090b]={'$like':'%'+_0x4943f4[_0xee63('0x2b')][_0xee63('0x3d')]+'%'};return _0x4d3f74;})});}_0x2a623a=_['merge']({},_0x2a623a,_0x4943f4[_0xee63('0x3f')]);return db[_0xee63('0x5b')][_0xee63('0x1b')]({'where':_0x2a623a[_0xee63('0x35')]})[_0xee63('0x1f')](function(_0x1a981c){_0x4ab081['count']=_0x1a981c;if(_0x4943f4['query'][_0xee63('0x41')]){_0x2a623a['include']=[{'all':!![]}];}return db[_0xee63('0x5b')][_0xee63('0x5c')](_0x2a623a);})['then'](function(_0x1511dc){_0x4ab081[_0xee63('0x43')]=_0x1511dc;return _0x4ab081;});}})['then'](respondWithFilteredResult(_0x291fe3,_0x2a623a))[_0xee63('0x44')](handleError(_0x291fe3,null));};exports[_0xee63('0x5d')]=function(_0x132fe1,_0xa250ba,_0x5aa8b1){var _0x517821={'raw':!![],'where':{}};var _0x20eeb5={};var _0x5c81e9={'count':0x0,'rows':[]};return db['Campaign'][_0xee63('0x57')]({'where':{'id':_0x132fe1[_0xee63('0x46')]['id']}})[_0xee63('0x1f')](handleEntityNotFound(_0xa250ba,null))['then'](function(_0x3e1c0e){if(_0x3e1c0e){_0x20eeb5[_0xee63('0x29')]=_[_0xee63('0x2a')](db[_0xee63('0x5e')][_0xee63('0x28')]);_0x20eeb5[_0xee63('0x2b')]=_['keys'](_0x132fe1[_0xee63('0x2b')]);_0x20eeb5['filters']=_[_0xee63('0x2d')](_0x20eeb5[_0xee63('0x29')],_0x20eeb5[_0xee63('0x2b')]);_0x517821['attributes']=_[_0xee63('0x2d')](_0x20eeb5[_0xee63('0x29')],qs['fields'](_0x132fe1[_0xee63('0x2b')][_0xee63('0x2e')]));_0x517821[_0xee63('0x2c')]=_0x517821[_0xee63('0x2c')][_0xee63('0x2f')]?_0x517821[_0xee63('0x2c')]:_0x20eeb5[_0xee63('0x29')];if(!_0x132fe1[_0xee63('0x2b')][_0xee63('0x30')](_0xee63('0x31'))){_0x517821[_0xee63('0x1c')]=qs[_0xee63('0x1c')](_0x132fe1[_0xee63('0x2b')]['limit']);_0x517821[_0xee63('0x32')]=qs[_0xee63('0x32')](_0x132fe1['query'][_0xee63('0x32')]);}_0x517821[_0xee63('0x33')]=qs['sort'](_0x132fe1[_0xee63('0x2b')]['sort']);_0x517821[_0xee63('0x35')]=qs[_0xee63('0x36')](_[_0xee63('0x37')](_0x132fe1[_0xee63('0x2b')],_0x20eeb5['filters']));_0x517821['where'][_0xee63('0x59')]=_0x3e1c0e['id'];if(_0x132fe1[_0xee63('0x2b')][_0xee63('0x3d')]){_0x517821[_0xee63('0x35')]=_[_0xee63('0x3e')](_0x517821[_0xee63('0x35')],{'$or':_['map'](_0x517821[_0xee63('0x2c')],function(_0x4564d0){var _0x108851={};_0x108851[_0x4564d0]={'$like':'%'+_0x132fe1[_0xee63('0x2b')]['filter']+'%'};return _0x108851;})});}_0x517821=_[_0xee63('0x3e')]({},_0x517821,_0x132fe1['options']);return db[_0xee63('0x5e')][_0xee63('0x1b')]({'where':_0x517821[_0xee63('0x35')]})[_0xee63('0x1f')](function(_0x2d07b6){_0x5c81e9[_0xee63('0x1b')]=_0x2d07b6;if(_0x132fe1[_0xee63('0x2b')][_0xee63('0x41')]){_0x517821['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xee63('0x5c')](_0x517821);})['then'](function(_0x2e3cc0){_0x5c81e9[_0xee63('0x43')]=_0x2e3cc0;return _0x5c81e9;});}})[_0xee63('0x1f')](respondWithFilteredResult(_0xa250ba,_0x517821))[_0xee63('0x44')](handleError(_0xa250ba,null));};exports['getHopperBlacks']=function(_0x53f481,_0x14decd,_0x415513){var _0x5606b7={'raw':!![],'where':{}};var _0x119003={};var _0x407352={'count':0x0,'rows':[]};return db['Campaign'][_0xee63('0x57')]({'where':{'id':_0x53f481[_0xee63('0x46')]['id']}})[_0xee63('0x1f')](handleEntityNotFound(_0x14decd,null))['then'](function(_0x1369d0){if(_0x1369d0){_0x119003['model']=_[_0xee63('0x2a')](db[_0xee63('0x5f')][_0xee63('0x28')]);_0x119003['query']=_['keys'](_0x53f481[_0xee63('0x2b')]);_0x119003['filters']=_[_0xee63('0x2d')](_0x119003[_0xee63('0x29')],_0x119003[_0xee63('0x2b')]);_0x5606b7[_0xee63('0x2c')]=_['intersection'](_0x119003[_0xee63('0x29')],qs[_0xee63('0x2e')](_0x53f481[_0xee63('0x2b')]['fields']));_0x5606b7[_0xee63('0x2c')]=_0x5606b7[_0xee63('0x2c')][_0xee63('0x2f')]?_0x5606b7[_0xee63('0x2c')]:_0x119003[_0xee63('0x29')];if(!_0x53f481[_0xee63('0x2b')][_0xee63('0x30')](_0xee63('0x31'))){_0x5606b7[_0xee63('0x1c')]=qs[_0xee63('0x1c')](_0x53f481[_0xee63('0x2b')][_0xee63('0x1c')]);_0x5606b7['offset']=qs[_0xee63('0x32')](_0x53f481[_0xee63('0x2b')]['offset']);}_0x5606b7[_0xee63('0x33')]=qs[_0xee63('0x34')](_0x53f481[_0xee63('0x2b')]['sort']);_0x5606b7[_0xee63('0x35')]=qs[_0xee63('0x36')](_[_0xee63('0x37')](_0x53f481[_0xee63('0x2b')],_0x119003[_0xee63('0x36')]));_0x5606b7[_0xee63('0x35')][_0xee63('0x59')]=_0x1369d0['id'];if(_0x53f481[_0xee63('0x2b')]['filter']){_0x5606b7[_0xee63('0x35')]=_[_0xee63('0x3e')](_0x5606b7[_0xee63('0x35')],{'$or':_['map'](_0x5606b7['attributes'],function(_0x81701){var _0x2367bd={};_0x2367bd[_0x81701]={'$like':'%'+_0x53f481[_0xee63('0x2b')][_0xee63('0x3d')]+'%'};return _0x2367bd;})});}_0x5606b7=_[_0xee63('0x3e')]({},_0x5606b7,_0x53f481['options']);return db[_0xee63('0x5f')]['count']({'where':_0x5606b7[_0xee63('0x35')]})[_0xee63('0x1f')](function(_0xd42f83){_0x407352[_0xee63('0x1b')]=_0xd42f83;if(_0x53f481[_0xee63('0x2b')][_0xee63('0x41')]){_0x5606b7[_0xee63('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xee63('0x5c')](_0x5606b7);})['then'](function(_0x666e22){_0x407352[_0xee63('0x43')]=_0x666e22;return _0x407352;});}})[_0xee63('0x1f')](respondWithFilteredResult(_0x14decd,_0x5606b7))[_0xee63('0x44')](handleError(_0x14decd,null));};exports[_0xee63('0x60')]=function(_0x31e16f,_0x23a408,_0x4f702f){var _0x52ce4f={};var _0x577d4f={};var _0x26de1d;var _0x5ece0c;return db[_0xee63('0x40')][_0xee63('0x57')]({'where':{'id':_0x31e16f['params']['id']}})[_0xee63('0x1f')](handleEntityNotFound(_0x23a408,null))['then'](function(_0x5fd77b){if(_0x5fd77b){_0x26de1d=_0x5fd77b;_0x577d4f[_0xee63('0x29')]=_[_0xee63('0x2a')](db[_0xee63('0x61')][_0xee63('0x28')]);_0x577d4f[_0xee63('0x2b')]=_['keys'](_0x31e16f[_0xee63('0x2b')]);_0x577d4f[_0xee63('0x36')]=_['intersection'](_0x577d4f[_0xee63('0x29')],_0x577d4f[_0xee63('0x2b')]);_0x52ce4f[_0xee63('0x2c')]=_['intersection'](_0x577d4f[_0xee63('0x29')],qs['fields'](_0x31e16f[_0xee63('0x2b')][_0xee63('0x2e')]));_0x52ce4f['attributes']=_0x52ce4f[_0xee63('0x2c')][_0xee63('0x2f')]?_0x52ce4f[_0xee63('0x2c')]:_0x577d4f['model'];_0x52ce4f['order']=qs['sort'](_0x31e16f[_0xee63('0x2b')][_0xee63('0x34')]);_0x52ce4f['where']=qs['filters'](_[_0xee63('0x37')](_0x31e16f[_0xee63('0x2b')],_0x577d4f[_0xee63('0x36')]));if(_0x31e16f['query'][_0xee63('0x3d')]){_0x52ce4f[_0xee63('0x35')]=_[_0xee63('0x3e')](_0x52ce4f[_0xee63('0x35')],{'$or':_[_0xee63('0x38')](_0x52ce4f['attributes'],function(_0x359f23){var _0xb04bb6={};_0xb04bb6[_0x359f23]={'$like':'%'+_0x31e16f[_0xee63('0x2b')]['filter']+'%'};return _0xb04bb6;})});}_0x52ce4f=_[_0xee63('0x3e')]({},_0x52ce4f,_0x31e16f[_0xee63('0x3f')]);return _0x26de1d[_0xee63('0x60')](_0x52ce4f);}})[_0xee63('0x1f')](function(_0x4d28e7){if(_0x4d28e7){_0x5ece0c=_0x4d28e7[_0xee63('0x2f')];if(!_0x31e16f[_0xee63('0x2b')]['hasOwnProperty']('nolimit')){_0x52ce4f[_0xee63('0x1c')]=qs['limit'](_0x31e16f['query'][_0xee63('0x1c')]);_0x52ce4f['offset']=qs[_0xee63('0x32')](_0x31e16f[_0xee63('0x2b')][_0xee63('0x32')]);}return _0x26de1d['getLists'](_0x52ce4f);}})['then'](function(_0x17512f){if(_0x17512f){return _0x17512f?{'count':_0x5ece0c,'rows':_0x17512f}:null;}})['then'](respondWithResult(_0x23a408,null))[_0xee63('0x44')](handleError(_0x23a408,null));};exports[_0xee63('0x62')]=function(_0x5d39e6,_0x3c8144,_0x4379e0){var _0x1c88b3,_0x47be69;return db['Campaign'][_0xee63('0x47')]({'where':{'id':_0x5d39e6[_0xee63('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c8144,null))['then'](function(_0x338e9a){if(_0x338e9a){_0x47be69=_0x338e9a;return _0x338e9a[_0xee63('0x62')](_0x5d39e6[_0xee63('0x49')][_0xee63('0x63')],_['omit'](_0x5d39e6[_0xee63('0x49')],[_0xee63('0x63'),'id'])||{});}return null;})[_0xee63('0x64')](function(_0x35c4f4){var _0x312d54;_0x1c88b3=_0x35c4f4||[];var _0x15c289=[];if(_0x35c4f4){for(var _0x45fb80=0x0;_0x45fb80<_0x35c4f4[_0xee63('0x2f')];_0x45fb80+=0x1){var _0x27e2bc=_0x35c4f4[_0x45fb80][_0xee63('0x21')]({'plain':!![]});_0x47be69[_0xee63('0x65')]=_0x5d39e6[_0xee63('0x49')][_0xee63('0x65')]?_0x5d39e6['body']['dialCheckDuplicateType']:_0x47be69['dialCheckDuplicateType'];switch(_0x47be69[_0xee63('0x65')]){case _0xee63('0x66'):_0x312d54=squel['insert']()[_0xee63('0x67')]('cm_hopper')['fromQuery']([_0xee63('0x68'),_0xee63('0x69'),_0xee63('0x6a'),'ListId',_0xee63('0x59'),'createdAt',_0xee63('0x51')],squel['select']()['field'](_0xee63('0x68'),_0xee63('0x68'))[_0xee63('0x3c')](_0xee63('0x6b'),_0xee63('0x69'))[_0xee63('0x3c')]('id',_0xee63('0x6a'))['field'](_0x27e2bc['CmListId'][_0xee63('0x6c')](),_0xee63('0x6d'))[_0xee63('0x3c')](_0x5d39e6['params']['id'][_0xee63('0x6c')](),_0xee63('0x59'))[_0xee63('0x3c')]('NOW()',_0xee63('0x50'))[_0xee63('0x3c')](_0xee63('0x6b'),_0xee63('0x51'))[_0xee63('0x6e')](_0xee63('0x6f'))['where']('deletedAt\x20IS\x20NULL')[_0xee63('0x35')](_0xee63('0x70'),_0x27e2bc[_0xee63('0x71')][_0xee63('0x6c')]())[_0xee63('0x35')](_0xee63('0x72'))[_0xee63('0x35')](_0xee63('0x73'),squel[_0xee63('0x74')]()[_0xee63('0x3c')](_0xee63('0x75'))[_0xee63('0x6e')](_0xee63('0x76'))[_0xee63('0x35')](_0xee63('0x77'),_0x5d39e6[_0xee63('0x46')]['id']['toString']()))[_0xee63('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0xee63('0x74')]()[_0xee63('0x3c')]('COALESCE(phone,\x27\x27)')['from'](_0xee63('0x78'))[_0xee63('0x35')]('CampaignId\x20=\x20?',_0x5d39e6[_0xee63('0x46')]['id']['toString']())))[_0xee63('0x6c')]();break;case _0xee63('0x79'):_0x312d54=squel['insert']()[_0xee63('0x67')](_0xee63('0x78'))[_0xee63('0x7a')]([_0xee63('0x68'),_0xee63('0x69'),_0xee63('0x6a'),_0xee63('0x6d'),'CampaignId',_0xee63('0x50'),'updatedAt'],squel[_0xee63('0x74')]()[_0xee63('0x3c')](_0xee63('0x68'),_0xee63('0x68'))['field'](_0xee63('0x6b'),_0xee63('0x69'))[_0xee63('0x3c')]('id',_0xee63('0x6a'))[_0xee63('0x3c')](_0x27e2bc[_0xee63('0x71')][_0xee63('0x6c')](),_0xee63('0x6d'))['field'](_0x5d39e6['params']['id'][_0xee63('0x6c')](),_0xee63('0x59'))['field'](_0xee63('0x6b'),_0xee63('0x50'))[_0xee63('0x3c')]('NOW()',_0xee63('0x51'))['from'](_0xee63('0x6f'))[_0xee63('0x35')](_0xee63('0x7b'))[_0xee63('0x35')](_0xee63('0x70'),_0x27e2bc[_0xee63('0x71')][_0xee63('0x6c')]())[_0xee63('0x35')](_0xee63('0x72'))[_0xee63('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0xee63('0x74')]()[_0xee63('0x3c')](_0xee63('0x7c'))[_0xee63('0x6e')]('cm_hopper')[_0xee63('0x35')]('CampaignId\x20=\x20?',_0x5d39e6[_0xee63('0x46')]['id'][_0xee63('0x6c')]())))['toString']();break;default:_0x312d54=squel[_0xee63('0x7d')]()[_0xee63('0x67')](_0xee63('0x78'))[_0xee63('0x7a')](['phone',_0xee63('0x69'),_0xee63('0x6a'),_0xee63('0x6d'),'CampaignId','createdAt',_0xee63('0x51')],squel[_0xee63('0x74')]()[_0xee63('0x3c')](_0xee63('0x68'),'phone')[_0xee63('0x3c')](_0xee63('0x6b'),'scheduledAt')[_0xee63('0x3c')]('id',_0xee63('0x6a'))[_0xee63('0x3c')](_0x27e2bc[_0xee63('0x71')][_0xee63('0x6c')](),_0xee63('0x6d'))[_0xee63('0x3c')](_0x5d39e6['params']['id'][_0xee63('0x6c')](),_0xee63('0x59'))['field'](_0xee63('0x6b'),'createdAt')[_0xee63('0x3c')](_0xee63('0x6b'),_0xee63('0x51'))[_0xee63('0x6e')](_0xee63('0x6f'))['where']('deletedAt\x20IS\x20NULL')[_0xee63('0x35')](_0xee63('0x70'),_0x27e2bc[_0xee63('0x71')][_0xee63('0x6c')]())['where'](_0xee63('0x72')))['toString']();}_0x15c289['push'](db[_0xee63('0x7e')][_0xee63('0x2b')](_0x312d54));}return BPromise[_0xee63('0x7f')](_0x15c289);}})[_0xee63('0x1f')](function(){return _0x1c88b3;})[_0xee63('0x1f')](respondWithResult(_0x3c8144,null))[_0xee63('0x44')](handleError(_0x3c8144,null));};exports[_0xee63('0x80')]=function(_0x575c0f,_0x16a70f,_0x3ee929){return db['Campaign']['find']({'where':{'id':_0x575c0f[_0xee63('0x46')]['id']}})[_0xee63('0x1f')](handleEntityNotFound(_0x16a70f,null))[_0xee63('0x1f')](function(_0x43b408){if(_0x43b408){return _0x43b408[_0xee63('0x80')](_0x575c0f['query'][_0xee63('0x63')]);}})['then'](function(_0x5d8d0e){if(_0x5d8d0e){return db['CmHopper']['destroy']({'where':{'ListId':_0x575c0f[_0xee63('0x2b')][_0xee63('0x63')],'CampaignId':_0x575c0f['params']['id']}})[_0xee63('0x1f')](function(){return _0x5d8d0e;});}})[_0xee63('0x1f')](respondWithStatusCode(_0x16a70f,null))[_0xee63('0x44')](handleError(_0x16a70f,null));};exports[_0xee63('0x81')]=function(_0x2b39b6,_0x1b8ded,_0x2bbb26){var _0xb4d1d={'raw':!![],'where':{}};var _0x3a24e2={};var _0x5b425d={'count':0x0,'rows':[]};return db[_0xee63('0x40')][_0xee63('0x57')]({'where':{'id':_0x2b39b6[_0xee63('0x46')]['id']}})[_0xee63('0x1f')](handleEntityNotFound(_0x1b8ded,null))[_0xee63('0x1f')](function(_0x36ecce){if(_0x36ecce){_0x3a24e2[_0xee63('0x29')]=_[_0xee63('0x2a')](db['CmList'][_0xee63('0x28')]);_0x3a24e2[_0xee63('0x2b')]=_[_0xee63('0x2a')](_0x2b39b6[_0xee63('0x2b')]);_0x3a24e2[_0xee63('0x36')]=_[_0xee63('0x2d')](_0x3a24e2[_0xee63('0x29')],_0x3a24e2[_0xee63('0x2b')]);_0xb4d1d[_0xee63('0x2c')]=_[_0xee63('0x2d')](_0x3a24e2['model'],qs[_0xee63('0x2e')](_0x2b39b6[_0xee63('0x2b')]['fields']));_0xb4d1d[_0xee63('0x2c')]=_0xb4d1d[_0xee63('0x2c')]['length']?_0xb4d1d['attributes']:_0x3a24e2[_0xee63('0x29')];if(!_0x2b39b6[_0xee63('0x2b')]['hasOwnProperty']('nolimit')){_0xb4d1d[_0xee63('0x1c')]=qs[_0xee63('0x1c')](_0x2b39b6['query']['limit']);_0xb4d1d[_0xee63('0x32')]=qs['offset'](_0x2b39b6[_0xee63('0x2b')]['offset']);}_0xb4d1d[_0xee63('0x33')]=qs[_0xee63('0x34')](_0x2b39b6[_0xee63('0x2b')]['sort']);_0xb4d1d[_0xee63('0x35')]=qs[_0xee63('0x36')](_[_0xee63('0x37')](_0x2b39b6[_0xee63('0x2b')],_0x3a24e2[_0xee63('0x36')]));_0xb4d1d[_0xee63('0x35')][_0xee63('0x59')]=_0x36ecce['id'];if(_0x2b39b6[_0xee63('0x2b')][_0xee63('0x3d')]){_0xb4d1d['where']=_['merge'](_0xb4d1d[_0xee63('0x35')],{'$or':_[_0xee63('0x38')](_0xb4d1d['attributes'],function(_0x3ca5eb){var _0x4ee1d3={};_0x4ee1d3[_0x3ca5eb]={'$like':'%'+_0x2b39b6[_0xee63('0x2b')][_0xee63('0x3d')]+'%'};return _0x4ee1d3;})});}_0xb4d1d=_[_0xee63('0x3e')]({},_0xb4d1d,_0x2b39b6[_0xee63('0x3f')]);return db[_0xee63('0x61')][_0xee63('0x1b')]({'where':_0xb4d1d[_0xee63('0x35')]})['then'](function(_0x2a3354){_0x5b425d['count']=_0x2a3354;if(_0x2b39b6[_0xee63('0x2b')][_0xee63('0x41')]){_0xb4d1d[_0xee63('0x42')]=[{'all':!![]}];}return db[_0xee63('0x61')][_0xee63('0x5c')](_0xb4d1d);})[_0xee63('0x1f')](function(_0x806fd){_0x5b425d[_0xee63('0x43')]=_0x806fd;return _0x5b425d;});}})[_0xee63('0x1f')](respondWithFilteredResult(_0x1b8ded,_0xb4d1d))['catch'](handleError(_0x1b8ded,null));};exports['addBlackLists']=function(_0x11a210,_0x54a327,_0x2043bc){var _0x285635,_0x10bf70;return db[_0xee63('0x40')][_0xee63('0x47')]({'where':{'id':_0x11a210[_0xee63('0x46')]['id']}})[_0xee63('0x1f')](handleEntityNotFound(_0x54a327,null))[_0xee63('0x1f')](function(_0x3883cb){if(_0x3883cb){_0x10bf70=_0x3883cb;return _0x3883cb[_0xee63('0x82')](_0x11a210[_0xee63('0x49')][_0xee63('0x63')],_[_0xee63('0x4f')](_0x11a210['body'],[_0xee63('0x63'),'id'])||{});}return null;})[_0xee63('0x64')](function(_0x5dae80){var _0x557d75;_0x285635=_0x5dae80||[];var _0x41fb69=[];if(_0x5dae80){for(var _0x1c0a10=0x0;_0x1c0a10<_0x5dae80[_0xee63('0x2f')];_0x1c0a10+=0x1){var _0x29fe67=_0x5dae80[_0x1c0a10][_0xee63('0x21')]({'plain':!![]});_0x557d75=squel['insert']()['into']('cm_hopper_black')[_0xee63('0x7a')]([_0xee63('0x68'),'ContactId',_0xee63('0x6d'),_0xee63('0x59'),_0xee63('0x50'),_0xee63('0x51')],squel[_0xee63('0x74')]()['field']('phone',_0xee63('0x68'))[_0xee63('0x3c')]('id','ContactId')[_0xee63('0x3c')](_0x29fe67[_0xee63('0x71')]['toString'](),_0xee63('0x6d'))[_0xee63('0x3c')](_0x11a210[_0xee63('0x46')]['id'][_0xee63('0x6c')](),'CampaignId')['field'](_0xee63('0x6b'),_0xee63('0x50'))[_0xee63('0x3c')](_0xee63('0x6b'),_0xee63('0x51'))[_0xee63('0x6e')](_0xee63('0x6f'))[_0xee63('0x35')]('deletedAt\x20IS\x20NULL')[_0xee63('0x35')](_0xee63('0x70'),_0x29fe67[_0xee63('0x71')]['toString']())[_0xee63('0x35')]('phone\x20IS\x20NOT\x20NULL'))[_0xee63('0x6c')]();_0x41fb69['push'](db[_0xee63('0x7e')]['query'](_0x557d75));}return BPromise[_0xee63('0x7f')](_0x41fb69);}})[_0xee63('0x1f')](function(){return _0x285635;})[_0xee63('0x1f')](respondWithResult(_0x54a327,null))[_0xee63('0x44')](handleError(_0x54a327,null));};exports[_0xee63('0x83')]=function(_0x15c71b,_0x5386ea,_0x2c84fa){return db['Campaign'][_0xee63('0x47')]({'where':{'id':_0x15c71b['params']['id']}})[_0xee63('0x1f')](handleEntityNotFound(_0x5386ea,null))[_0xee63('0x1f')](function(_0x36a90b){if(_0x36a90b){return _0x36a90b[_0xee63('0x83')](_0x15c71b[_0xee63('0x2b')]['ids']);}})[_0xee63('0x1f')](function(_0x2441f7){if(_0x2441f7){return db['CmHopperBlack'][_0xee63('0x20')]({'where':{'ListId':_0x15c71b[_0xee63('0x2b')][_0xee63('0x63')],'CampaignId':_0x15c71b[_0xee63('0x46')]['id']}})['then'](function(){return _0x2441f7;});}})[_0xee63('0x1f')](respondWithStatusCode(_0x5386ea,null))['catch'](handleError(_0x5386ea,null));}; \ No newline at end of file +var _0xb96e=['ids','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ListId','select','ContactId','CmListId','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','toString','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','push','removeLists','spread','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','Campaign','count','findAll','rows','show','params','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','nolimit','pick','CampaignId','findOne','CmHopperHistory','order','CmHopperFinal','include','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists'];(function(_0xf738ad,_0x5e1d7f){var _0x598570=function(_0x35088e){while(--_0x35088e){_0xf738ad['push'](_0xf738ad['shift']());}};_0x598570(++_0x5e1d7f);}(_0xb96e,0xa0));var _0xeb96=function(_0xceee1e,_0x1736f0){_0xceee1e=_0xceee1e-0x0;var _0x384611=_0xb96e[_0xceee1e];return _0x384611;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xeb96('0x0'));var rimraf=require(_0xeb96('0x1'));var zipdir=require(_0xeb96('0x2'));var jsonpatch=require(_0xeb96('0x3'));var rp=require('request-promise');var moment=require(_0xeb96('0x4'));var BPromise=require(_0xeb96('0x5'));var Mustache=require('mustache');var util=require(_0xeb96('0x6'));var path=require(_0xeb96('0x7'));var sox=require('sox');var csv=require(_0xeb96('0x8'));var ejs=require(_0xeb96('0x9'));var fs=require('fs');var _=require(_0xeb96('0xa'));var squel=require(_0xeb96('0xb'));var crypto=require(_0xeb96('0xc'));var jsforce=require(_0xeb96('0xd'));var deskjs=require(_0xeb96('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xeb96('0xf'));var Redis=require(_0xeb96('0x10'));var authService=require(_0xeb96('0x11'));var qs=require(_0xeb96('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb96('0x13'))('api');var utils=require(_0xeb96('0x14'));var config=require('../../config/environment');var db=require(_0xeb96('0x15'))['db'];function respondWithStatusCode(_0x44332f,_0x4b0bfe){_0x4b0bfe=_0x4b0bfe||0xcc;return function(_0x31eea3){if(_0x31eea3){return _0x44332f[_0xeb96('0x16')](_0x4b0bfe);}return _0x44332f[_0xeb96('0x17')](_0x4b0bfe)[_0xeb96('0x18')]();};}function respondWithResult(_0x15d958,_0x292fe3){_0x292fe3=_0x292fe3||0xc8;return function(_0x24c46f){if(_0x24c46f){return _0x15d958['status'](_0x292fe3)[_0xeb96('0x19')](_0x24c46f);}};}function respondWithFilteredResult(_0x2695ba,_0x11001a){return function(_0x1bea83){if(_0x1bea83){var _0x4ba827=_0x1bea83['count'],_0x2fef69=_0x11001a[_0xeb96('0x1a')],_0x1576d2=_0x11001a[_0xeb96('0x1a')]+_0x11001a['limit'],_0xaf4329;if(_0x1576d2>=_0x4ba827){_0x1576d2=_0x4ba827;_0xaf4329=0xc8;}else{_0xaf4329=0xce;}_0x2695ba[_0xeb96('0x17')](_0xaf4329);return _0x2695ba[_0xeb96('0x1b')](_0xeb96('0x1c'),_0x2fef69+'-'+_0x1576d2+'/'+_0x4ba827)[_0xeb96('0x19')](_0x1bea83);}return null;};}function patchUpdates(_0x32ab02){return function(_0x56c90b){try{jsonpatch[_0xeb96('0x1d')](_0x56c90b,_0x32ab02,!![]);}catch(_0xc9b6e4){return BPromise[_0xeb96('0x1e')](_0xc9b6e4);}return _0x56c90b['save']();};}function saveUpdates(_0x57ec55,_0x534a2e){return function(_0x1d3a0c){if(_0x1d3a0c){return _0x1d3a0c[_0xeb96('0x1f')](_0x57ec55)[_0xeb96('0x20')](function(_0x15feb5){return _0x15feb5;});}return null;};}function removeEntity(_0x424e87,_0x32b6a6){return function(_0x1cc6db){if(_0x1cc6db){return _0x1cc6db[_0xeb96('0x21')]()[_0xeb96('0x20')](function(){var _0x305a58=_0x1cc6db[_0xeb96('0x22')]({'plain':!![]});var _0x5d9b65=_0xeb96('0x23');return db[_0xeb96('0x24')][_0xeb96('0x21')]({'where':{'type':_0x5d9b65,'resourceId':_0x305a58['id']}})[_0xeb96('0x20')](function(){return _0x1cc6db;});})[_0xeb96('0x20')](function(){_0x424e87[_0xeb96('0x17')](0xcc)[_0xeb96('0x18')]();});}};}function handleEntityNotFound(_0x132c3e,_0x24db84){return function(_0x4e631f){if(!_0x4e631f){_0x132c3e[_0xeb96('0x16')](0x194);}return _0x4e631f;};}function handleError(_0x10dd44,_0x1ec1bf){_0x1ec1bf=_0x1ec1bf||0x1f4;return function(_0x517568){logger[_0xeb96('0x25')](_0x517568[_0xeb96('0x26')]);if(_0x517568[_0xeb96('0x27')]){delete _0x517568[_0xeb96('0x27')];}_0x10dd44[_0xeb96('0x17')](_0x1ec1bf)[_0xeb96('0x28')](_0x517568);};}exports['index']=function(_0x51ac7b,_0x32e002){var _0x4c218a={},_0x4e4307={},_0x548831={'count':0x0,'rows':[]};var _0x184502=db['Campaign'][_0xeb96('0x29')];_0x4e4307[_0xeb96('0x2a')]=_[_0xeb96('0x2b')](_0x184502);_0x4e4307[_0xeb96('0x2c')]=_[_0xeb96('0x2b')](_0x51ac7b[_0xeb96('0x2c')]);_0x4e4307[_0xeb96('0x2d')]=_[_0xeb96('0x2e')](_0x4e4307['model'],_0x4e4307[_0xeb96('0x2c')]);_0x4c218a['attributes']=_[_0xeb96('0x2e')](_0x4e4307[_0xeb96('0x2a')],qs[_0xeb96('0x2f')](_0x51ac7b[_0xeb96('0x2c')][_0xeb96('0x2f')]));_0x4c218a[_0xeb96('0x30')]=_0x4c218a['attributes'][_0xeb96('0x31')]?_0x4c218a[_0xeb96('0x30')]:_0x4e4307['model'];if(!_0x51ac7b[_0xeb96('0x2c')][_0xeb96('0x32')]('nolimit')){_0x4c218a[_0xeb96('0x33')]=qs['limit'](_0x51ac7b[_0xeb96('0x2c')][_0xeb96('0x33')]);_0x4c218a[_0xeb96('0x1a')]=qs[_0xeb96('0x1a')](_0x51ac7b[_0xeb96('0x2c')][_0xeb96('0x1a')]);}_0x4c218a['order']=qs['sort'](_0x51ac7b['query'][_0xeb96('0x34')]);_0x4c218a[_0xeb96('0x35')]=qs[_0xeb96('0x2d')](_['pick'](_0x51ac7b['query'],_0x4e4307[_0xeb96('0x2d')]));if(_0x51ac7b[_0xeb96('0x2c')][_0xeb96('0x36')]){_0x4c218a[_0xeb96('0x35')]=_[_0xeb96('0x37')](_0x4c218a[_0xeb96('0x35')],{'$or':_[_0xeb96('0x38')](_0x184502,function(_0x5e37e2){if(_0x5e37e2[_0xeb96('0x39')][_0xeb96('0x3a')]!==_0xeb96('0x3b')){var _0x1be77d={};_0x1be77d[_0x5e37e2[_0xeb96('0x3c')]]={'$like':'%'+_0x51ac7b[_0xeb96('0x2c')][_0xeb96('0x36')]+'%'};return _0x1be77d;}})});}_0x4c218a=_['merge']({},_0x4c218a,_0x51ac7b[_0xeb96('0x3d')]);var _0x56d704={'where':_0x4c218a['where']};return db[_0xeb96('0x3e')][_0xeb96('0x3f')](_0x56d704)[_0xeb96('0x20')](function(_0x447cd2){_0x548831['count']=_0x447cd2;if(_0x51ac7b['query']['includeAll']){_0x4c218a['include']=[{'all':!![]}];}return db[_0xeb96('0x3e')][_0xeb96('0x40')](_0x4c218a);})[_0xeb96('0x20')](function(_0x56c274){_0x548831[_0xeb96('0x41')]=_0x56c274;return _0x548831;})[_0xeb96('0x20')](respondWithFilteredResult(_0x32e002,_0x4c218a))['catch'](handleError(_0x32e002,null));};exports[_0xeb96('0x42')]=function(_0x55d75c,_0x4295fc){var _0x596096={'raw':![],'where':{'id':_0x55d75c[_0xeb96('0x43')]['id']}},_0x14a735={};_0x14a735[_0xeb96('0x2a')]=_[_0xeb96('0x2b')](db[_0xeb96('0x3e')][_0xeb96('0x29')]);_0x14a735['query']=_[_0xeb96('0x2b')](_0x55d75c[_0xeb96('0x2c')]);_0x14a735['filters']=_[_0xeb96('0x2e')](_0x14a735[_0xeb96('0x2a')],_0x14a735[_0xeb96('0x2c')]);_0x596096[_0xeb96('0x30')]=_['intersection'](_0x14a735[_0xeb96('0x2a')],qs[_0xeb96('0x2f')](_0x55d75c[_0xeb96('0x2c')][_0xeb96('0x2f')]));_0x596096[_0xeb96('0x30')]=_0x596096[_0xeb96('0x30')][_0xeb96('0x31')]?_0x596096[_0xeb96('0x30')]:_0x14a735['model'];if(_0x55d75c[_0xeb96('0x2c')][_0xeb96('0x44')]){_0x596096['include']=[{'all':!![]}];}_0x596096=_[_0xeb96('0x37')]({},_0x596096,_0x55d75c[_0xeb96('0x3d')]);return db['Campaign'][_0xeb96('0x45')](_0x596096)[_0xeb96('0x20')](handleEntityNotFound(_0x4295fc,null))['then'](respondWithResult(_0x4295fc,null))['catch'](handleError(_0x4295fc,null));};exports[_0xeb96('0x46')]=function(_0x16115c,_0x2a7897){return db[_0xeb96('0x3e')]['create'](_0x16115c[_0xeb96('0x47')],{})[_0xeb96('0x20')](function(_0x8d1a2d){var _0x4b3d5b=_0x16115c[_0xeb96('0x48')]['get']({'plain':!![]});if(!_0x4b3d5b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b3d5b[_0xeb96('0x49')]===_0xeb96('0x48')){var _0x5cb566=_0x8d1a2d['get']({'plain':!![]});var _0x469d31=_0xeb96('0x23');return db[_0xeb96('0x4a')]['find']({'where':{'name':_0x469d31,'userProfileId':_0x4b3d5b[_0xeb96('0x4b')]},'raw':!![]})[_0xeb96('0x20')](function(_0x50b41d){if(_0x50b41d&&_0x50b41d['autoAssociation']===0x0){return db[_0xeb96('0x24')][_0xeb96('0x46')]({'name':_0x5cb566[_0xeb96('0x27')],'resourceId':_0x5cb566['id'],'type':_0x50b41d[_0xeb96('0x27')],'sectionId':_0x50b41d['id']},{})[_0xeb96('0x20')](function(){return _0x8d1a2d;});}else{return _0x8d1a2d;}})[_0xeb96('0x4c')](function(_0x22a9ba){logger[_0xeb96('0x25')](_0xeb96('0x4d'),_0x22a9ba);throw _0x22a9ba;});}return _0x8d1a2d;})[_0xeb96('0x20')](respondWithResult(_0x2a7897,0xc9))[_0xeb96('0x4c')](handleError(_0x2a7897,null));};exports[_0xeb96('0x4e')]=function(_0x318d8f,_0x275f16){var _0x236154={'raw':![],'where':{'id':_0x318d8f['params']['id']}},_0x561860={};_0x561860[_0xeb96('0x2a')]=_[_0xeb96('0x2b')](db[_0xeb96('0x3e')][_0xeb96('0x29')]);_0x236154[_0xeb96('0x30')]=_[_0xeb96('0x2e')](_0x561860[_0xeb96('0x2a')],qs[_0xeb96('0x2f')](_0x318d8f['query'][_0xeb96('0x2f')]));_0x236154[_0xeb96('0x30')]=_0x236154[_0xeb96('0x30')]['length']?_0x236154[_0xeb96('0x30')]:_0x561860[_0xeb96('0x2a')];if(_0x318d8f[_0xeb96('0x2c')]['includeAll']){_0x236154['include']=[{'all':!![]}];}_0x236154=_[_0xeb96('0x37')]({},_0x236154,_0x318d8f[_0xeb96('0x3d')]);return db['Campaign'][_0xeb96('0x45')](_0x236154)[_0xeb96('0x20')](handleEntityNotFound(_0x275f16,null))[_0xeb96('0x20')](function(_0x1086ff){if(_0x1086ff){var _0x17178d=_0x1086ff[_0xeb96('0x22')]({'plain':!![]});_0x17178d=qs['omit'](_0x17178d,['id',_0xeb96('0x4f'),'updatedAt']);_0x318d8f[_0xeb96('0x47')]=_[_0xeb96('0x50')](_0x318d8f[_0xeb96('0x47')],['id',_0xeb96('0x4f'),_0xeb96('0x51')]);return db['Campaign'][_0xeb96('0x46')](_['merge'](_0x17178d,_0x318d8f['body']),{'include':_0x318d8f['query'][_0xeb96('0x44')]?[{'all':!![]}]:undefined})[_0xeb96('0x20')](function(_0xf017d9){var _0x417e2e=_0x318d8f[_0xeb96('0x48')][_0xeb96('0x22')]({'plain':!![]});if(!_0x417e2e)throw new Error(_0xeb96('0x52'));if(_0x417e2e[_0xeb96('0x49')]===_0xeb96('0x48')){var _0x5ed89c=_0xf017d9['get']({'plain':!![]});var _0x581181=_0xeb96('0x23');return db[_0xeb96('0x4a')][_0xeb96('0x45')]({'where':{'name':_0x581181,'userProfileId':_0x417e2e[_0xeb96('0x4b')]},'raw':!![]})[_0xeb96('0x20')](function(_0x5b2c3a){if(_0x5b2c3a&&_0x5b2c3a['autoAssociation']===0x0){return db[_0xeb96('0x24')][_0xeb96('0x46')]({'name':_0x5ed89c[_0xeb96('0x27')],'resourceId':_0x5ed89c['id'],'type':_0x5b2c3a[_0xeb96('0x27')],'sectionId':_0x5b2c3a['id']},{})['then'](function(){return _0xf017d9;});}else{return _0xf017d9;}})[_0xeb96('0x4c')](function(_0x22fde1){logger['error'](_0xeb96('0x4d'),_0x22fde1);throw _0x22fde1;});}return _0xf017d9;});}})[_0xeb96('0x20')](respondWithResult(_0x275f16,0xc9))[_0xeb96('0x4c')](handleError(_0x275f16,null));};exports[_0xeb96('0x1f')]=function(_0x28b2bc,_0x228e12){if(_0x28b2bc[_0xeb96('0x47')]['id']){delete _0x28b2bc[_0xeb96('0x47')]['id'];}return db[_0xeb96('0x3e')][_0xeb96('0x45')]({'where':{'id':_0x28b2bc['params']['id']}})[_0xeb96('0x20')](handleEntityNotFound(_0x228e12,null))[_0xeb96('0x20')](saveUpdates(_0x28b2bc[_0xeb96('0x47')],null))[_0xeb96('0x20')](respondWithResult(_0x228e12,null))[_0xeb96('0x4c')](handleError(_0x228e12,null));};exports[_0xeb96('0x21')]=function(_0x18be9f,_0x39e16e){return db[_0xeb96('0x3e')][_0xeb96('0x45')]({'where':{'id':_0x18be9f[_0xeb96('0x43')]['id']}})[_0xeb96('0x20')](handleEntityNotFound(_0x39e16e,null))[_0xeb96('0x20')](removeEntity(_0x39e16e,null))[_0xeb96('0x4c')](handleError(_0x39e16e,null));};exports[_0xeb96('0x53')]=function(_0x18f304,_0x331ac0,_0x2f5932){var _0x3520d8={'raw':!![],'where':{}};var _0x53e33d={};var _0x1b9d34={'count':0x0,'rows':[]};return db[_0xeb96('0x3e')]['findOne']({'where':{'id':_0x18f304['params']['id']}})[_0xeb96('0x20')](handleEntityNotFound(_0x331ac0,null))[_0xeb96('0x20')](function(_0x4d884e){if(_0x4d884e){_0x53e33d[_0xeb96('0x2a')]=_['keys'](db[_0xeb96('0x54')][_0xeb96('0x29')]);_0x53e33d[_0xeb96('0x2c')]=_[_0xeb96('0x2b')](_0x18f304[_0xeb96('0x2c')]);_0x53e33d[_0xeb96('0x2d')]=_[_0xeb96('0x2e')](_0x53e33d[_0xeb96('0x2a')],_0x53e33d[_0xeb96('0x2c')]);_0x3520d8[_0xeb96('0x30')]=_[_0xeb96('0x2e')](_0x53e33d['model'],qs['fields'](_0x18f304[_0xeb96('0x2c')][_0xeb96('0x2f')]));_0x3520d8[_0xeb96('0x30')]=_0x3520d8[_0xeb96('0x30')][_0xeb96('0x31')]?_0x3520d8[_0xeb96('0x30')]:_0x53e33d[_0xeb96('0x2a')];if(!_0x18f304['query'][_0xeb96('0x32')](_0xeb96('0x55'))){_0x3520d8[_0xeb96('0x33')]=qs[_0xeb96('0x33')](_0x18f304['query'][_0xeb96('0x33')]);_0x3520d8[_0xeb96('0x1a')]=qs[_0xeb96('0x1a')](_0x18f304[_0xeb96('0x2c')][_0xeb96('0x1a')]);}_0x3520d8['order']=qs[_0xeb96('0x34')](_0x18f304['query']['sort']);_0x3520d8[_0xeb96('0x35')]=qs[_0xeb96('0x2d')](_[_0xeb96('0x56')](_0x18f304[_0xeb96('0x2c')],_0x53e33d[_0xeb96('0x2d')]));_0x3520d8[_0xeb96('0x35')][_0xeb96('0x57')]=_0x4d884e['id'];if(_0x18f304['query'][_0xeb96('0x36')]){_0x3520d8[_0xeb96('0x35')]=_[_0xeb96('0x37')](_0x3520d8['where'],{'$or':_[_0xeb96('0x38')](_0x3520d8['attributes'],function(_0x4d5d3b){var _0x589e5f={};_0x589e5f[_0x4d5d3b]={'$like':'%'+_0x18f304[_0xeb96('0x2c')][_0xeb96('0x36')]+'%'};return _0x589e5f;})});}_0x3520d8=_[_0xeb96('0x37')]({},_0x3520d8,_0x18f304[_0xeb96('0x3d')]);return db[_0xeb96('0x54')]['count']({'where':_0x3520d8[_0xeb96('0x35')]})[_0xeb96('0x20')](function(_0x42242b){_0x1b9d34['count']=_0x42242b;if(_0x18f304['query'][_0xeb96('0x44')]){_0x3520d8['include']=[{'all':!![]}];}return db[_0xeb96('0x54')][_0xeb96('0x40')](_0x3520d8);})[_0xeb96('0x20')](function(_0xc51f13){_0x1b9d34[_0xeb96('0x41')]=_0xc51f13;return _0x1b9d34;});}})[_0xeb96('0x20')](respondWithFilteredResult(_0x331ac0,_0x3520d8))[_0xeb96('0x4c')](handleError(_0x331ac0,null));};exports['getHopperHistories']=function(_0x3bf8ba,_0x100068,_0x141749){var _0x8593d2={'raw':!![],'where':{}};var _0x48abea={};var _0x41934b={'count':0x0,'rows':[]};return db[_0xeb96('0x3e')][_0xeb96('0x58')]({'where':{'id':_0x3bf8ba[_0xeb96('0x43')]['id']}})[_0xeb96('0x20')](handleEntityNotFound(_0x100068,null))[_0xeb96('0x20')](function(_0x38d993){if(_0x38d993){_0x48abea[_0xeb96('0x2a')]=_[_0xeb96('0x2b')](db[_0xeb96('0x59')]['rawAttributes']);_0x48abea[_0xeb96('0x2c')]=_[_0xeb96('0x2b')](_0x3bf8ba[_0xeb96('0x2c')]);_0x48abea['filters']=_[_0xeb96('0x2e')](_0x48abea['model'],_0x48abea[_0xeb96('0x2c')]);_0x8593d2[_0xeb96('0x30')]=_[_0xeb96('0x2e')](_0x48abea[_0xeb96('0x2a')],qs['fields'](_0x3bf8ba[_0xeb96('0x2c')][_0xeb96('0x2f')]));_0x8593d2[_0xeb96('0x30')]=_0x8593d2[_0xeb96('0x30')][_0xeb96('0x31')]?_0x8593d2['attributes']:_0x48abea['model'];if(!_0x3bf8ba['query'][_0xeb96('0x32')](_0xeb96('0x55'))){_0x8593d2[_0xeb96('0x33')]=qs[_0xeb96('0x33')](_0x3bf8ba[_0xeb96('0x2c')]['limit']);_0x8593d2[_0xeb96('0x1a')]=qs[_0xeb96('0x1a')](_0x3bf8ba[_0xeb96('0x2c')][_0xeb96('0x1a')]);}_0x8593d2[_0xeb96('0x5a')]=qs[_0xeb96('0x34')](_0x3bf8ba[_0xeb96('0x2c')][_0xeb96('0x34')]);_0x8593d2[_0xeb96('0x35')]=qs[_0xeb96('0x2d')](_['pick'](_0x3bf8ba[_0xeb96('0x2c')],_0x48abea[_0xeb96('0x2d')]));_0x8593d2[_0xeb96('0x35')][_0xeb96('0x57')]=_0x38d993['id'];if(_0x3bf8ba['query'][_0xeb96('0x36')]){_0x8593d2[_0xeb96('0x35')]=_[_0xeb96('0x37')](_0x8593d2[_0xeb96('0x35')],{'$or':_[_0xeb96('0x38')](_0x8593d2[_0xeb96('0x30')],function(_0x53b94c){var _0x5e77be={};_0x5e77be[_0x53b94c]={'$like':'%'+_0x3bf8ba[_0xeb96('0x2c')][_0xeb96('0x36')]+'%'};return _0x5e77be;})});}_0x8593d2=_[_0xeb96('0x37')]({},_0x8593d2,_0x3bf8ba[_0xeb96('0x3d')]);return db[_0xeb96('0x59')][_0xeb96('0x3f')]({'where':_0x8593d2['where']})[_0xeb96('0x20')](function(_0xd61e22){_0x41934b[_0xeb96('0x3f')]=_0xd61e22;if(_0x3bf8ba[_0xeb96('0x2c')]['includeAll']){_0x8593d2['include']=[{'all':!![]}];}return db[_0xeb96('0x59')][_0xeb96('0x40')](_0x8593d2);})[_0xeb96('0x20')](function(_0x466d73){_0x41934b[_0xeb96('0x41')]=_0x466d73;return _0x41934b;});}})[_0xeb96('0x20')](respondWithFilteredResult(_0x100068,_0x8593d2))[_0xeb96('0x4c')](handleError(_0x100068,null));};exports['getHopperFinals']=function(_0x7351cd,_0x50a145,_0x2c5220){var _0x155bcb={'raw':!![],'where':{}};var _0x335c51={};var _0x246f36={'count':0x0,'rows':[]};return db[_0xeb96('0x3e')][_0xeb96('0x58')]({'where':{'id':_0x7351cd[_0xeb96('0x43')]['id']}})[_0xeb96('0x20')](handleEntityNotFound(_0x50a145,null))[_0xeb96('0x20')](function(_0x26f706){if(_0x26f706){_0x335c51[_0xeb96('0x2a')]=_['keys'](db[_0xeb96('0x5b')][_0xeb96('0x29')]);_0x335c51[_0xeb96('0x2c')]=_[_0xeb96('0x2b')](_0x7351cd[_0xeb96('0x2c')]);_0x335c51[_0xeb96('0x2d')]=_['intersection'](_0x335c51['model'],_0x335c51[_0xeb96('0x2c')]);_0x155bcb[_0xeb96('0x30')]=_[_0xeb96('0x2e')](_0x335c51[_0xeb96('0x2a')],qs[_0xeb96('0x2f')](_0x7351cd[_0xeb96('0x2c')][_0xeb96('0x2f')]));_0x155bcb['attributes']=_0x155bcb[_0xeb96('0x30')][_0xeb96('0x31')]?_0x155bcb[_0xeb96('0x30')]:_0x335c51['model'];if(!_0x7351cd[_0xeb96('0x2c')]['hasOwnProperty'](_0xeb96('0x55'))){_0x155bcb['limit']=qs['limit'](_0x7351cd[_0xeb96('0x2c')][_0xeb96('0x33')]);_0x155bcb[_0xeb96('0x1a')]=qs[_0xeb96('0x1a')](_0x7351cd[_0xeb96('0x2c')][_0xeb96('0x1a')]);}_0x155bcb[_0xeb96('0x5a')]=qs[_0xeb96('0x34')](_0x7351cd[_0xeb96('0x2c')][_0xeb96('0x34')]);_0x155bcb['where']=qs[_0xeb96('0x2d')](_[_0xeb96('0x56')](_0x7351cd[_0xeb96('0x2c')],_0x335c51['filters']));_0x155bcb[_0xeb96('0x35')]['CampaignId']=_0x26f706['id'];if(_0x7351cd[_0xeb96('0x2c')][_0xeb96('0x36')]){_0x155bcb['where']=_[_0xeb96('0x37')](_0x155bcb['where'],{'$or':_[_0xeb96('0x38')](_0x155bcb[_0xeb96('0x30')],function(_0x248c00){var _0x3bd7f8={};_0x3bd7f8[_0x248c00]={'$like':'%'+_0x7351cd[_0xeb96('0x2c')]['filter']+'%'};return _0x3bd7f8;})});}_0x155bcb=_['merge']({},_0x155bcb,_0x7351cd['options']);return db['CmHopperFinal'][_0xeb96('0x3f')]({'where':_0x155bcb[_0xeb96('0x35')]})[_0xeb96('0x20')](function(_0x2597de){_0x246f36[_0xeb96('0x3f')]=_0x2597de;if(_0x7351cd[_0xeb96('0x2c')][_0xeb96('0x44')]){_0x155bcb[_0xeb96('0x5c')]=[{'all':!![]}];}return db[_0xeb96('0x5b')][_0xeb96('0x40')](_0x155bcb);})['then'](function(_0x1e7fba){_0x246f36[_0xeb96('0x41')]=_0x1e7fba;return _0x246f36;});}})[_0xeb96('0x20')](respondWithFilteredResult(_0x50a145,_0x155bcb))['catch'](handleError(_0x50a145,null));};exports[_0xeb96('0x5d')]=function(_0xb5a315,_0x4a6c5f,_0xfc13bb){var _0x1702c4={'raw':!![],'where':{}};var _0x3c3831={};var _0x131c00={'count':0x0,'rows':[]};return db[_0xeb96('0x3e')][_0xeb96('0x58')]({'where':{'id':_0xb5a315['params']['id']}})[_0xeb96('0x20')](handleEntityNotFound(_0x4a6c5f,null))[_0xeb96('0x20')](function(_0x578361){if(_0x578361){_0x3c3831[_0xeb96('0x2a')]=_[_0xeb96('0x2b')](db[_0xeb96('0x5e')]['rawAttributes']);_0x3c3831['query']=_[_0xeb96('0x2b')](_0xb5a315['query']);_0x3c3831[_0xeb96('0x2d')]=_[_0xeb96('0x2e')](_0x3c3831['model'],_0x3c3831[_0xeb96('0x2c')]);_0x1702c4[_0xeb96('0x30')]=_[_0xeb96('0x2e')](_0x3c3831['model'],qs['fields'](_0xb5a315[_0xeb96('0x2c')][_0xeb96('0x2f')]));_0x1702c4[_0xeb96('0x30')]=_0x1702c4[_0xeb96('0x30')]['length']?_0x1702c4[_0xeb96('0x30')]:_0x3c3831[_0xeb96('0x2a')];if(!_0xb5a315[_0xeb96('0x2c')][_0xeb96('0x32')]('nolimit')){_0x1702c4[_0xeb96('0x33')]=qs['limit'](_0xb5a315['query'][_0xeb96('0x33')]);_0x1702c4[_0xeb96('0x1a')]=qs['offset'](_0xb5a315['query'][_0xeb96('0x1a')]);}_0x1702c4[_0xeb96('0x5a')]=qs['sort'](_0xb5a315[_0xeb96('0x2c')][_0xeb96('0x34')]);_0x1702c4[_0xeb96('0x35')]=qs['filters'](_[_0xeb96('0x56')](_0xb5a315['query'],_0x3c3831[_0xeb96('0x2d')]));_0x1702c4[_0xeb96('0x35')][_0xeb96('0x57')]=_0x578361['id'];if(_0xb5a315[_0xeb96('0x2c')][_0xeb96('0x36')]){_0x1702c4[_0xeb96('0x35')]=_[_0xeb96('0x37')](_0x1702c4[_0xeb96('0x35')],{'$or':_['map'](_0x1702c4['attributes'],function(_0x3f0e27){var _0x47c3ce={};_0x47c3ce[_0x3f0e27]={'$like':'%'+_0xb5a315[_0xeb96('0x2c')][_0xeb96('0x36')]+'%'};return _0x47c3ce;})});}_0x1702c4=_[_0xeb96('0x37')]({},_0x1702c4,_0xb5a315['options']);return db['CmHopperBlack'][_0xeb96('0x3f')]({'where':_0x1702c4[_0xeb96('0x35')]})[_0xeb96('0x20')](function(_0x3dac0b){_0x131c00['count']=_0x3dac0b;if(_0xb5a315[_0xeb96('0x2c')][_0xeb96('0x44')]){_0x1702c4['include']=[{'all':!![]}];}return db[_0xeb96('0x5e')][_0xeb96('0x40')](_0x1702c4);})[_0xeb96('0x20')](function(_0x6596e6){_0x131c00[_0xeb96('0x41')]=_0x6596e6;return _0x131c00;});}})['then'](respondWithFilteredResult(_0x4a6c5f,_0x1702c4))[_0xeb96('0x4c')](handleError(_0x4a6c5f,null));};exports[_0xeb96('0x5f')]=function(_0x4f8728,_0x563280,_0x45d963){var _0x30ecb1={};var _0x201ac2={};var _0x11ce5d;var _0x886463;return db[_0xeb96('0x3e')][_0xeb96('0x58')]({'where':{'id':_0x4f8728[_0xeb96('0x43')]['id']}})['then'](handleEntityNotFound(_0x563280,null))[_0xeb96('0x20')](function(_0x506530){if(_0x506530){_0x11ce5d=_0x506530;_0x201ac2[_0xeb96('0x2a')]=_['keys'](db[_0xeb96('0x60')][_0xeb96('0x29')]);_0x201ac2[_0xeb96('0x2c')]=_[_0xeb96('0x2b')](_0x4f8728['query']);_0x201ac2['filters']=_[_0xeb96('0x2e')](_0x201ac2[_0xeb96('0x2a')],_0x201ac2[_0xeb96('0x2c')]);_0x30ecb1[_0xeb96('0x30')]=_['intersection'](_0x201ac2[_0xeb96('0x2a')],qs[_0xeb96('0x2f')](_0x4f8728[_0xeb96('0x2c')]['fields']));_0x30ecb1['attributes']=_0x30ecb1[_0xeb96('0x30')][_0xeb96('0x31')]?_0x30ecb1[_0xeb96('0x30')]:_0x201ac2[_0xeb96('0x2a')];_0x30ecb1[_0xeb96('0x5a')]=qs[_0xeb96('0x34')](_0x4f8728[_0xeb96('0x2c')][_0xeb96('0x34')]);_0x30ecb1[_0xeb96('0x35')]=qs['filters'](_[_0xeb96('0x56')](_0x4f8728[_0xeb96('0x2c')],_0x201ac2[_0xeb96('0x2d')]));if(_0x4f8728[_0xeb96('0x2c')][_0xeb96('0x36')]){_0x30ecb1[_0xeb96('0x35')]=_[_0xeb96('0x37')](_0x30ecb1[_0xeb96('0x35')],{'$or':_['map'](_0x30ecb1[_0xeb96('0x30')],function(_0x83e788){var _0x3ade7f={};_0x3ade7f[_0x83e788]={'$like':'%'+_0x4f8728[_0xeb96('0x2c')][_0xeb96('0x36')]+'%'};return _0x3ade7f;})});}_0x30ecb1=_[_0xeb96('0x37')]({},_0x30ecb1,_0x4f8728[_0xeb96('0x3d')]);return _0x11ce5d[_0xeb96('0x5f')](_0x30ecb1);}})[_0xeb96('0x20')](function(_0x3ef112){if(_0x3ef112){_0x886463=_0x3ef112[_0xeb96('0x31')];if(!_0x4f8728[_0xeb96('0x2c')][_0xeb96('0x32')](_0xeb96('0x55'))){_0x30ecb1[_0xeb96('0x33')]=qs[_0xeb96('0x33')](_0x4f8728[_0xeb96('0x2c')][_0xeb96('0x33')]);_0x30ecb1[_0xeb96('0x1a')]=qs['offset'](_0x4f8728[_0xeb96('0x2c')][_0xeb96('0x1a')]);}return _0x11ce5d[_0xeb96('0x5f')](_0x30ecb1);}})['then'](function(_0x58b230){if(_0x58b230){return _0x58b230?{'count':_0x886463,'rows':_0x58b230}:null;}})[_0xeb96('0x20')](respondWithResult(_0x563280,null))[_0xeb96('0x4c')](handleError(_0x563280,null));};exports[_0xeb96('0x61')]=function(_0x5b5816,_0x3f1a05,_0x4a7f52){var _0x232850,_0x14552e;return db[_0xeb96('0x3e')][_0xeb96('0x45')]({'where':{'id':_0x5b5816[_0xeb96('0x43')]['id']}})[_0xeb96('0x20')](handleEntityNotFound(_0x3f1a05,null))[_0xeb96('0x20')](function(_0x524353){if(_0x524353){_0x14552e=_0x524353;return _0x524353[_0xeb96('0x61')](_0x5b5816['body']['ids'],_['omit'](_0x5b5816[_0xeb96('0x47')],[_0xeb96('0x62'),'id'])||{});}return null;})['spread'](function(_0x28e573){var _0x2c959b;_0x232850=_0x28e573||[];var _0x461132=[];if(_0x28e573){for(var _0x29daf4=0x0;_0x29daf4<_0x28e573['length'];_0x29daf4+=0x1){var _0x40b5cc=_0x28e573[_0x29daf4][_0xeb96('0x22')]({'plain':!![]});_0x14552e[_0xeb96('0x63')]=_0x5b5816[_0xeb96('0x47')][_0xeb96('0x63')]?_0x5b5816[_0xeb96('0x47')][_0xeb96('0x63')]:_0x14552e[_0xeb96('0x63')];switch(_0x14552e[_0xeb96('0x63')]){case _0xeb96('0x64'):_0x2c959b=squel[_0xeb96('0x65')]()[_0xeb96('0x66')]('cm_hopper')[_0xeb96('0x67')]([_0xeb96('0x68'),_0xeb96('0x69'),'ContactId',_0xeb96('0x6a'),_0xeb96('0x57'),_0xeb96('0x4f'),_0xeb96('0x51')],squel[_0xeb96('0x6b')]()[_0xeb96('0x3c')]('phone',_0xeb96('0x68'))[_0xeb96('0x3c')]('NOW()',_0xeb96('0x69'))['field']('id',_0xeb96('0x6c'))['field'](_0x40b5cc[_0xeb96('0x6d')]['toString'](),'ListId')['field'](_0x5b5816[_0xeb96('0x43')]['id']['toString'](),_0xeb96('0x57'))['field'](_0xeb96('0x6e'),_0xeb96('0x4f'))['field'](_0xeb96('0x6e'),_0xeb96('0x51'))[_0xeb96('0x6f')](_0xeb96('0x70'))[_0xeb96('0x35')](_0xeb96('0x71'))[_0xeb96('0x35')]('ListId\x20=\x20?',_0x40b5cc[_0xeb96('0x6d')]['toString']())[_0xeb96('0x35')](_0xeb96('0x72'))[_0xeb96('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0xeb96('0x6b')]()[_0xeb96('0x3c')](_0xeb96('0x73'))[_0xeb96('0x6f')](_0xeb96('0x74'))[_0xeb96('0x35')](_0xeb96('0x75'),_0x5b5816[_0xeb96('0x43')]['id'][_0xeb96('0x76')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xeb96('0x6b')]()[_0xeb96('0x3c')](_0xeb96('0x77'))[_0xeb96('0x6f')](_0xeb96('0x78'))['where'](_0xeb96('0x75'),_0x5b5816[_0xeb96('0x43')]['id'][_0xeb96('0x76')]())))[_0xeb96('0x76')]();break;case _0xeb96('0x79'):_0x2c959b=squel[_0xeb96('0x65')]()[_0xeb96('0x66')]('cm_hopper')['fromQuery']([_0xeb96('0x68'),_0xeb96('0x69'),_0xeb96('0x6c'),_0xeb96('0x6a'),_0xeb96('0x57'),_0xeb96('0x4f'),'updatedAt'],squel[_0xeb96('0x6b')]()[_0xeb96('0x3c')](_0xeb96('0x68'),_0xeb96('0x68'))[_0xeb96('0x3c')](_0xeb96('0x6e'),_0xeb96('0x69'))[_0xeb96('0x3c')]('id',_0xeb96('0x6c'))[_0xeb96('0x3c')](_0x40b5cc[_0xeb96('0x6d')][_0xeb96('0x76')](),_0xeb96('0x6a'))['field'](_0x5b5816[_0xeb96('0x43')]['id']['toString'](),_0xeb96('0x57'))['field'](_0xeb96('0x6e'),_0xeb96('0x4f'))[_0xeb96('0x3c')](_0xeb96('0x6e'),_0xeb96('0x51'))['from'](_0xeb96('0x70'))[_0xeb96('0x35')](_0xeb96('0x71'))[_0xeb96('0x35')](_0xeb96('0x7a'),_0x40b5cc[_0xeb96('0x6d')][_0xeb96('0x76')]())[_0xeb96('0x35')](_0xeb96('0x72'))[_0xeb96('0x35')](_0xeb96('0x7b'),squel[_0xeb96('0x6b')]()[_0xeb96('0x3c')](_0xeb96('0x77'))['from'](_0xeb96('0x78'))['where'](_0xeb96('0x75'),_0x5b5816[_0xeb96('0x43')]['id'][_0xeb96('0x76')]())))[_0xeb96('0x76')]();break;default:_0x2c959b=squel[_0xeb96('0x65')]()[_0xeb96('0x66')]('cm_hopper')[_0xeb96('0x67')]([_0xeb96('0x68'),_0xeb96('0x69'),_0xeb96('0x6c'),'ListId','CampaignId',_0xeb96('0x4f'),_0xeb96('0x51')],squel[_0xeb96('0x6b')]()[_0xeb96('0x3c')](_0xeb96('0x68'),'phone')['field'](_0xeb96('0x6e'),'scheduledAt')['field']('id',_0xeb96('0x6c'))[_0xeb96('0x3c')](_0x40b5cc[_0xeb96('0x6d')][_0xeb96('0x76')](),'ListId')[_0xeb96('0x3c')](_0x5b5816['params']['id'][_0xeb96('0x76')](),_0xeb96('0x57'))[_0xeb96('0x3c')]('NOW()',_0xeb96('0x4f'))['field'](_0xeb96('0x6e'),'updatedAt')[_0xeb96('0x6f')](_0xeb96('0x70'))[_0xeb96('0x35')](_0xeb96('0x71'))[_0xeb96('0x35')](_0xeb96('0x7a'),_0x40b5cc[_0xeb96('0x6d')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xeb96('0x76')]();}_0x461132[_0xeb96('0x7c')](db['sequelize']['query'](_0x2c959b));}return BPromise['all'](_0x461132);}})[_0xeb96('0x20')](function(){return _0x232850;})[_0xeb96('0x20')](respondWithResult(_0x3f1a05,null))[_0xeb96('0x4c')](handleError(_0x3f1a05,null));};exports['removeLists']=function(_0x5e30bd,_0x93c72d,_0x5665e0){return db[_0xeb96('0x3e')][_0xeb96('0x45')]({'where':{'id':_0x5e30bd['params']['id']}})[_0xeb96('0x20')](handleEntityNotFound(_0x93c72d,null))[_0xeb96('0x20')](function(_0x4991b3){if(_0x4991b3){return _0x4991b3[_0xeb96('0x7d')](_0x5e30bd[_0xeb96('0x2c')][_0xeb96('0x62')]);}})[_0xeb96('0x20')](function(_0x4e2216){if(_0x4e2216){return db[_0xeb96('0x54')]['destroy']({'where':{'ListId':_0x5e30bd[_0xeb96('0x2c')]['ids'],'CampaignId':_0x5e30bd['params']['id']}})[_0xeb96('0x20')](function(){return _0x4e2216;});}})['then'](respondWithStatusCode(_0x93c72d,null))['catch'](handleError(_0x93c72d,null));};exports['getBlackLists']=function(_0x8aeba4,_0x174846,_0x1ee973){var _0x27a702={'raw':!![],'where':{}};var _0x5a50d7={};var _0x5b4a87={'count':0x0,'rows':[]};return db[_0xeb96('0x3e')][_0xeb96('0x58')]({'where':{'id':_0x8aeba4[_0xeb96('0x43')]['id']}})['then'](handleEntityNotFound(_0x174846,null))[_0xeb96('0x20')](function(_0x21f31a){if(_0x21f31a){_0x5a50d7[_0xeb96('0x2a')]=_[_0xeb96('0x2b')](db['CmList'][_0xeb96('0x29')]);_0x5a50d7[_0xeb96('0x2c')]=_[_0xeb96('0x2b')](_0x8aeba4['query']);_0x5a50d7[_0xeb96('0x2d')]=_[_0xeb96('0x2e')](_0x5a50d7[_0xeb96('0x2a')],_0x5a50d7[_0xeb96('0x2c')]);_0x27a702['attributes']=_[_0xeb96('0x2e')](_0x5a50d7['model'],qs[_0xeb96('0x2f')](_0x8aeba4[_0xeb96('0x2c')]['fields']));_0x27a702[_0xeb96('0x30')]=_0x27a702[_0xeb96('0x30')][_0xeb96('0x31')]?_0x27a702[_0xeb96('0x30')]:_0x5a50d7['model'];if(!_0x8aeba4[_0xeb96('0x2c')][_0xeb96('0x32')]('nolimit')){_0x27a702['limit']=qs[_0xeb96('0x33')](_0x8aeba4[_0xeb96('0x2c')][_0xeb96('0x33')]);_0x27a702[_0xeb96('0x1a')]=qs[_0xeb96('0x1a')](_0x8aeba4[_0xeb96('0x2c')]['offset']);}_0x27a702[_0xeb96('0x5a')]=qs[_0xeb96('0x34')](_0x8aeba4[_0xeb96('0x2c')][_0xeb96('0x34')]);_0x27a702['where']=qs[_0xeb96('0x2d')](_[_0xeb96('0x56')](_0x8aeba4['query'],_0x5a50d7[_0xeb96('0x2d')]));_0x27a702[_0xeb96('0x35')][_0xeb96('0x57')]=_0x21f31a['id'];if(_0x8aeba4[_0xeb96('0x2c')][_0xeb96('0x36')]){_0x27a702[_0xeb96('0x35')]=_[_0xeb96('0x37')](_0x27a702[_0xeb96('0x35')],{'$or':_[_0xeb96('0x38')](_0x27a702['attributes'],function(_0x23e228){var _0x3b38c0={};_0x3b38c0[_0x23e228]={'$like':'%'+_0x8aeba4[_0xeb96('0x2c')][_0xeb96('0x36')]+'%'};return _0x3b38c0;})});}_0x27a702=_[_0xeb96('0x37')]({},_0x27a702,_0x8aeba4[_0xeb96('0x3d')]);return db['CmList']['count']({'where':_0x27a702[_0xeb96('0x35')]})[_0xeb96('0x20')](function(_0x2704af){_0x5b4a87[_0xeb96('0x3f')]=_0x2704af;if(_0x8aeba4[_0xeb96('0x2c')][_0xeb96('0x44')]){_0x27a702[_0xeb96('0x5c')]=[{'all':!![]}];}return db[_0xeb96('0x60')][_0xeb96('0x40')](_0x27a702);})[_0xeb96('0x20')](function(_0x23926d){_0x5b4a87['rows']=_0x23926d;return _0x5b4a87;});}})[_0xeb96('0x20')](respondWithFilteredResult(_0x174846,_0x27a702))[_0xeb96('0x4c')](handleError(_0x174846,null));};exports['addBlackLists']=function(_0x31bc2c,_0x26fd20,_0x50b85b){var _0x93a634,_0x288b10;return db[_0xeb96('0x3e')][_0xeb96('0x45')]({'where':{'id':_0x31bc2c[_0xeb96('0x43')]['id']}})[_0xeb96('0x20')](handleEntityNotFound(_0x26fd20,null))[_0xeb96('0x20')](function(_0x313d7b){if(_0x313d7b){_0x288b10=_0x313d7b;return _0x313d7b['addBlackLists'](_0x31bc2c[_0xeb96('0x47')][_0xeb96('0x62')],_[_0xeb96('0x50')](_0x31bc2c['body'],['ids','id'])||{});}return null;})[_0xeb96('0x7e')](function(_0x57b84f){var _0x28183f;_0x93a634=_0x57b84f||[];var _0x1165ce=[];if(_0x57b84f){for(var _0x1a53f1=0x0;_0x1a53f1<_0x57b84f[_0xeb96('0x31')];_0x1a53f1+=0x1){var _0x5d8ce8=_0x57b84f[_0x1a53f1]['get']({'plain':!![]});_0x28183f=squel['insert']()[_0xeb96('0x66')]('cm_hopper_black')[_0xeb96('0x67')](['phone',_0xeb96('0x6c'),_0xeb96('0x6a'),_0xeb96('0x57'),_0xeb96('0x4f'),_0xeb96('0x51')],squel[_0xeb96('0x6b')]()[_0xeb96('0x3c')]('phone',_0xeb96('0x68'))[_0xeb96('0x3c')]('id',_0xeb96('0x6c'))[_0xeb96('0x3c')](_0x5d8ce8[_0xeb96('0x6d')][_0xeb96('0x76')](),'ListId')[_0xeb96('0x3c')](_0x31bc2c[_0xeb96('0x43')]['id']['toString'](),_0xeb96('0x57'))[_0xeb96('0x3c')](_0xeb96('0x6e'),'createdAt')[_0xeb96('0x3c')](_0xeb96('0x6e'),_0xeb96('0x51'))[_0xeb96('0x6f')](_0xeb96('0x70'))[_0xeb96('0x35')](_0xeb96('0x71'))['where']('ListId\x20=\x20?',_0x5d8ce8[_0xeb96('0x6d')][_0xeb96('0x76')]())[_0xeb96('0x35')](_0xeb96('0x72')))[_0xeb96('0x76')]();_0x1165ce[_0xeb96('0x7c')](db['sequelize'][_0xeb96('0x2c')](_0x28183f));}return BPromise[_0xeb96('0x7f')](_0x1165ce);}})[_0xeb96('0x20')](function(){return _0x93a634;})[_0xeb96('0x20')](respondWithResult(_0x26fd20,null))['catch'](handleError(_0x26fd20,null));};exports[_0xeb96('0x80')]=function(_0x1e77f0,_0x13d89a,_0x2547d0){return db['Campaign'][_0xeb96('0x45')]({'where':{'id':_0x1e77f0['params']['id']}})[_0xeb96('0x20')](handleEntityNotFound(_0x13d89a,null))[_0xeb96('0x20')](function(_0x2eeb73){if(_0x2eeb73){return _0x2eeb73[_0xeb96('0x80')](_0x1e77f0[_0xeb96('0x2c')][_0xeb96('0x62')]);}})[_0xeb96('0x20')](function(_0x42f890){if(_0x42f890){return db[_0xeb96('0x5e')][_0xeb96('0x21')]({'where':{'ListId':_0x1e77f0[_0xeb96('0x2c')]['ids'],'CampaignId':_0x1e77f0[_0xeb96('0x43')]['id']}})[_0xeb96('0x20')](function(){return _0x42f890;});}})['then'](respondWithStatusCode(_0x13d89a,null))[_0xeb96('0x4c')](handleError(_0x13d89a,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 8076699..dcbecd5 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4dc4=['define','Campaign','campaigns','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./campaign.attributes','exports'];(function(_0xb87bcb,_0x1fac04){var _0x101621=function(_0x3b0351){while(--_0x3b0351){_0xb87bcb['push'](_0xb87bcb['shift']());}};_0x101621(++_0x1fac04);}(_0x4dc4,0x1ef));var _0x44dc=function(_0x1afff9,_0xacdca3){_0x1afff9=_0x1afff9-0x0;var _0x3afe03=_0x4dc4[_0x1afff9];return _0x3afe03;};'use strict';var _=require(_0x44dc('0x0'));var util=require(_0x44dc('0x1'));var logger=require(_0x44dc('0x2'))(_0x44dc('0x3'));var moment=require(_0x44dc('0x4'));var BPromise=require(_0x44dc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x44dc('0x6'));var config=require('../../config/environment');var attributes=require(_0x44dc('0x7'));module[_0x44dc('0x8')]=function(_0x496e83,_0x46794e){return _0x496e83[_0x44dc('0x9')](_0x44dc('0xa'),attributes,{'tableName':_0x44dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f73=['api','moment','bluebird','request-promise','path','rimraf','./campaign.attributes','exports','define','Campaign','campaigns'];(function(_0x523832,_0x22aa8b){var _0xc7d7d8=function(_0x1c0b01){while(--_0x1c0b01){_0x523832['push'](_0x523832['shift']());}};_0xc7d7d8(++_0x22aa8b);}(_0x4f73,0x134));var _0x34f7=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x4f73[_0x5ecadc];return _0x565037;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x34f7('0x0'));var moment=require(_0x34f7('0x1'));var BPromise=require(_0x34f7('0x2'));var rp=require(_0x34f7('0x3'));var fs=require('fs');var path=require(_0x34f7('0x4'));var rimraf=require(_0x34f7('0x5'));var config=require('../../config/environment');var attributes=require(_0x34f7('0x6'));module[_0x34f7('0x7')]=function(_0x7462e7,_0x989a7){return _0x7462e7[_0x34f7('0x8')](_0x34f7('0x9'),attributes,{'tableName':_0x34f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 6037f16..2ff61ba 100644 --- a/server/api/campaign/campaign.rpc.js +++ b/server/api/campaign/campaign.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x25ee8c,_0x22f1b6){var _0x397341=function(_0x41fa1b){while(--_0x41fa1b){_0x25ee8c['push'](_0x25ee8c['shift']());}};_0x397341(++_0x22f1b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x9d735a,_0x137f85){var _0x3513e1=function(_0x3c69e3){while(--_0x3c69e3){_0x9d735a['push'](_0x9d735a['shift']());}};_0x3513e1(++_0x137f85);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 11261f4..50640b5 100644 --- a/server/api/campaign/index.js +++ b/server/api/campaign/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf264=['delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./campaign.controller','isAuthenticated','index','get','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','update'];(function(_0x177d1f,_0x4bbaf2){var _0x38d059=function(_0x20f24d){while(--_0x20f24d){_0x177d1f['push'](_0x177d1f['shift']());}};_0x38d059(++_0x4bbaf2);}(_0xf264,0xfd));var _0x4f26=function(_0x52e91c,_0x2c0f4a){_0x52e91c=_0x52e91c-0x0;var _0x2e227d=_0xf264[_0x52e91c];return _0x2e227d;};'use strict';var multer=require(_0x4f26('0x0'));var util=require(_0x4f26('0x1'));var path=require(_0x4f26('0x2'));var timeout=require(_0x4f26('0x3'));var express=require('express');var router=express[_0x4f26('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4f26('0x5'));var config=require('../../config/environment');var controller=require(_0x4f26('0x6'));router['get']('/',auth[_0x4f26('0x7')](),controller[_0x4f26('0x8')]);router[_0x4f26('0x9')](_0x4f26('0xa'),auth[_0x4f26('0x7')](),controller['show']);router['get'](_0x4f26('0xb'),auth[_0x4f26('0x7')](),controller[_0x4f26('0xc')]);router[_0x4f26('0x9')](_0x4f26('0xd'),auth['isAuthenticated'](),controller[_0x4f26('0xe')]);router[_0x4f26('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x4f26('0x9')](_0x4f26('0xf'),auth[_0x4f26('0x7')](),controller[_0x4f26('0x10')]);router['get'](_0x4f26('0x11'),auth[_0x4f26('0x7')](),controller[_0x4f26('0x12')]);router['get'](_0x4f26('0x13'),auth[_0x4f26('0x7')](),controller[_0x4f26('0x14')]);router[_0x4f26('0x15')]('/',auth[_0x4f26('0x7')](),controller['create']);router[_0x4f26('0x15')](_0x4f26('0x16'),auth['isAuthenticated'](),controller[_0x4f26('0x17')]);router[_0x4f26('0x15')](_0x4f26('0x11'),auth['isAuthenticated'](),controller[_0x4f26('0x18')]);router[_0x4f26('0x15')](_0x4f26('0x13'),auth['isAuthenticated'](),controller['addBlackLists']);router['put']('/:id',auth[_0x4f26('0x7')](),controller[_0x4f26('0x19')]);router[_0x4f26('0x1a')]('/:id',auth[_0x4f26('0x7')](),controller[_0x4f26('0x1b')]);router['delete'](_0x4f26('0x11'),auth['isAuthenticated'](),controller[_0x4f26('0x1c')]);router[_0x4f26('0x1a')]('/:id/blacklists',auth[_0x4f26('0x7')](),controller[_0x4f26('0x1d')]);module[_0x4f26('0x1e')]=router; \ No newline at end of file +var _0xd983=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','/:id/clone','clone','post','addBlackLists','put','/:id','update','destroy','delete','removeLists','removeBlackLists','multer'];(function(_0x3cb616,_0x300c19){var _0x10ccaa=function(_0x29e49e){while(--_0x29e49e){_0x3cb616['push'](_0x3cb616['shift']());}};_0x10ccaa(++_0x300c19);}(_0xd983,0x1df));var _0x3d98=function(_0x28b17b,_0x13cf41){_0x28b17b=_0x28b17b-0x0;var _0x32060d=_0xd983[_0x28b17b];return _0x32060d;};'use strict';var multer=require(_0x3d98('0x0'));var util=require(_0x3d98('0x1'));var path=require(_0x3d98('0x2'));var timeout=require(_0x3d98('0x3'));var express=require(_0x3d98('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3d98('0x5'));var config=require(_0x3d98('0x6'));var controller=require(_0x3d98('0x7'));router[_0x3d98('0x8')]('/',auth[_0x3d98('0x9')](),controller[_0x3d98('0xa')]);router[_0x3d98('0x8')]('/:id',auth[_0x3d98('0x9')](),controller[_0x3d98('0xb')]);router[_0x3d98('0x8')](_0x3d98('0xc'),auth[_0x3d98('0x9')](),controller[_0x3d98('0xd')]);router[_0x3d98('0x8')](_0x3d98('0xe'),auth[_0x3d98('0x9')](),controller['getHopperHistories']);router['get'](_0x3d98('0xf'),auth[_0x3d98('0x9')](),controller[_0x3d98('0x10')]);router[_0x3d98('0x8')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x3d98('0x11')]);router[_0x3d98('0x8')](_0x3d98('0x12'),auth[_0x3d98('0x9')](),controller['getLists']);router[_0x3d98('0x8')](_0x3d98('0x13'),auth['isAuthenticated'](),controller[_0x3d98('0x14')]);router['post']('/',auth[_0x3d98('0x9')](),controller['create']);router['post'](_0x3d98('0x15'),auth[_0x3d98('0x9')](),controller[_0x3d98('0x16')]);router['post'](_0x3d98('0x12'),auth[_0x3d98('0x9')](),controller['addLists']);router[_0x3d98('0x17')](_0x3d98('0x13'),auth[_0x3d98('0x9')](),controller[_0x3d98('0x18')]);router[_0x3d98('0x19')](_0x3d98('0x1a'),auth[_0x3d98('0x9')](),controller[_0x3d98('0x1b')]);router['delete'](_0x3d98('0x1a'),auth[_0x3d98('0x9')](),controller[_0x3d98('0x1c')]);router[_0x3d98('0x1d')]('/:id/lists',auth[_0x3d98('0x9')](),controller[_0x3d98('0x1e')]);router[_0x3d98('0x1d')]('/:id/blacklists',auth[_0x3d98('0x9')](),controller[_0x3d98('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 582ee8b..854c425 100644 --- a/server/api/cannedAnswer/cannedAnswer.attributes.js +++ b/server/api/cannedAnswer/cannedAnswer.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1d6=['exports','STRING','VIRTUAL','getDataValue','key','sequelize'];(function(_0x5b8c72,_0x38cf40){var _0x1fcf2c=function(_0x3a7a1a){while(--_0x3a7a1a){_0x5b8c72['push'](_0x5b8c72['shift']());}};_0x1fcf2c(++_0x38cf40);}(_0xe1d6,0x89));var _0x6e1d=function(_0x5a5fa8,_0x5f208a){_0x5a5fa8=_0x5a5fa8-0x0;var _0x5a2983=_0xe1d6[_0x5a5fa8];return _0x5a2983;};'use strict';var Sequelize=require(_0x6e1d('0x0'));module[_0x6e1d('0x1')]={'key':{'type':Sequelize[_0x6e1d('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x6e1d('0x2')]},'name':{'type':Sequelize[_0x6e1d('0x3')],'get':function(){return this[_0x6e1d('0x4')](_0x6e1d('0x5'));}}}; \ No newline at end of file +var _0xc548=['TEXT','VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x107eb7,_0x39616a){var _0x5cfe42=function(_0x1e63b6){while(--_0x1e63b6){_0x107eb7['push'](_0x107eb7['shift']());}};_0x5cfe42(++_0x39616a);}(_0xc548,0x177));var _0x8c54=function(_0x3c5f09,_0x4963f5){_0x3c5f09=_0x3c5f09-0x0;var _0x51223a=_0xc548[_0x3c5f09];return _0x51223a;};'use strict';var Sequelize=require(_0x8c54('0x0'));module[_0x8c54('0x1')]={'key':{'type':Sequelize[_0x8c54('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x8c54('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x8c54('0x2')]},'name':{'type':Sequelize[_0x8c54('0x4')],'get':function(){return this[_0x8c54('0x5')](_0x8c54('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index bdd2b63..3d8c244 100644 --- a/server/api/cannedAnswer/cannedAnswer.controller.js +++ b/server/api/cannedAnswer/cannedAnswer.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4517=['body','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','create','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','send','index','CannedAnswer','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','map','type','key','VIRTUAL','options','includeAll','include','rows','params','catch'];(function(_0x1c82f0,_0x41f2e9){var _0x59463d=function(_0x4149e9){while(--_0x4149e9){_0x1c82f0['push'](_0x1c82f0['shift']());}};_0x59463d(++_0x41f2e9);}(_0x4517,0x112));var _0x7451=function(_0x400d83,_0x38f1f9){_0x400d83=_0x400d83-0x0;var _0x12166e=_0x4517[_0x400d83];return _0x12166e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7451('0x0'));var rimraf=require(_0x7451('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7451('0x2'));var rp=require(_0x7451('0x3'));var moment=require(_0x7451('0x4'));var BPromise=require(_0x7451('0x5'));var Mustache=require(_0x7451('0x6'));var util=require(_0x7451('0x7'));var path=require(_0x7451('0x8'));var sox=require(_0x7451('0x9'));var csv=require(_0x7451('0xa'));var ejs=require(_0x7451('0xb'));var fs=require('fs');var _=require(_0x7451('0xc'));var squel=require(_0x7451('0xd'));var crypto=require(_0x7451('0xe'));var jsforce=require(_0x7451('0xf'));var deskjs=require(_0x7451('0x10'));var toCsv=require(_0x7451('0xa'));var querystring=require(_0x7451('0x11'));var Papa=require('papaparse');var Redis=require(_0x7451('0x12'));var authService=require(_0x7451('0x13'));var qs=require(_0x7451('0x14'));var hardwareService=require(_0x7451('0x15'));var logger=require(_0x7451('0x16'))(_0x7451('0x17'));var utils=require(_0x7451('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf47f51,_0x5c7605){_0x5c7605=_0x5c7605||0xcc;return function(_0x450463){if(_0x450463){return _0xf47f51[_0x7451('0x19')](_0x5c7605);}return _0xf47f51['status'](_0x5c7605)[_0x7451('0x1a')]();};}function respondWithResult(_0x38129d,_0x4dbe5b){_0x4dbe5b=_0x4dbe5b||0xc8;return function(_0x46811e){if(_0x46811e){return _0x38129d[_0x7451('0x1b')](_0x4dbe5b)[_0x7451('0x1c')](_0x46811e);}};}function respondWithFilteredResult(_0x187e87,_0x54848e){return function(_0x357ea9){if(_0x357ea9){var _0x313385=_0x357ea9[_0x7451('0x1d')],_0x408336=_0x54848e[_0x7451('0x1e')],_0x58c0cd=_0x54848e[_0x7451('0x1e')]+_0x54848e[_0x7451('0x1f')],_0x4c9e54;if(_0x58c0cd>=_0x313385){_0x58c0cd=_0x313385;_0x4c9e54=0xc8;}else{_0x4c9e54=0xce;}_0x187e87[_0x7451('0x1b')](_0x4c9e54);return _0x187e87[_0x7451('0x20')](_0x7451('0x21'),_0x408336+'-'+_0x58c0cd+'/'+_0x313385)[_0x7451('0x1c')](_0x357ea9);}return null;};}function patchUpdates(_0x125ab1){return function(_0x5e52fe){try{jsonpatch[_0x7451('0x22')](_0x5e52fe,_0x125ab1,!![]);}catch(_0x32e250){return BPromise[_0x7451('0x23')](_0x32e250);}return _0x5e52fe['save']();};}function saveUpdates(_0x59562d,_0x33f01c){return function(_0x3ffb08){if(_0x3ffb08){return _0x3ffb08[_0x7451('0x24')](_0x59562d)[_0x7451('0x25')](function(_0x293e29){return _0x293e29;});}return null;};}function removeEntity(_0x29f0bd,_0x55b549){return function(_0x3a0c1e){if(_0x3a0c1e){return _0x3a0c1e[_0x7451('0x26')]()['then'](function(){var _0x406b03=_0x3a0c1e[_0x7451('0x27')]({'plain':!![]});var _0x2962f8='CannedAnswers';return db[_0x7451('0x28')][_0x7451('0x26')]({'where':{'type':_0x2962f8,'resourceId':_0x406b03['id']}})[_0x7451('0x25')](function(){return _0x3a0c1e;});})[_0x7451('0x25')](function(){_0x29f0bd[_0x7451('0x1b')](0xcc)[_0x7451('0x1a')]();});}};}function handleEntityNotFound(_0x3c56f1,_0xdfc7d1){return function(_0x3c4eae){if(!_0x3c4eae){_0x3c56f1['sendStatus'](0x194);}return _0x3c4eae;};}function handleError(_0x328d0b,_0x2b8a8b){_0x2b8a8b=_0x2b8a8b||0x1f4;return function(_0x5df311){logger['error'](_0x5df311[_0x7451('0x29')]);if(_0x5df311[_0x7451('0x2a')]){delete _0x5df311[_0x7451('0x2a')];}_0x328d0b[_0x7451('0x1b')](_0x2b8a8b)[_0x7451('0x2b')](_0x5df311);};}exports[_0x7451('0x2c')]=function(_0x4b5b26,_0x3827c9){var _0x4c3ac4={},_0x1b960f={},_0x6c10ee={'count':0x0,'rows':[]};var _0x4d99f3=db[_0x7451('0x2d')][_0x7451('0x2e')];_0x1b960f[_0x7451('0x2f')]=_[_0x7451('0x30')](_0x4d99f3);_0x1b960f[_0x7451('0x31')]=_['keys'](_0x4b5b26[_0x7451('0x31')]);_0x1b960f[_0x7451('0x32')]=_[_0x7451('0x33')](_0x1b960f['model'],_0x1b960f[_0x7451('0x31')]);_0x4c3ac4[_0x7451('0x34')]=_['intersection'](_0x1b960f['model'],qs[_0x7451('0x35')](_0x4b5b26[_0x7451('0x31')]['fields']));_0x4c3ac4['attributes']=_0x4c3ac4[_0x7451('0x34')][_0x7451('0x36')]?_0x4c3ac4[_0x7451('0x34')]:_0x1b960f[_0x7451('0x2f')];if(!_0x4b5b26[_0x7451('0x31')][_0x7451('0x37')](_0x7451('0x38'))){_0x4c3ac4[_0x7451('0x1f')]=qs['limit'](_0x4b5b26[_0x7451('0x31')][_0x7451('0x1f')]);_0x4c3ac4['offset']=qs[_0x7451('0x1e')](_0x4b5b26[_0x7451('0x31')][_0x7451('0x1e')]);}_0x4c3ac4[_0x7451('0x39')]=qs[_0x7451('0x3a')](_0x4b5b26[_0x7451('0x31')]['sort']);_0x4c3ac4[_0x7451('0x3b')]=qs[_0x7451('0x32')](_['pick'](_0x4b5b26[_0x7451('0x31')],_0x1b960f[_0x7451('0x32')]));if(_0x4b5b26['query']['filter']){_0x4c3ac4['where']=_['merge'](_0x4c3ac4['where'],{'$or':_[_0x7451('0x3c')](_0x4d99f3,function(_0x3bac33){if(_0x3bac33[_0x7451('0x3d')][_0x7451('0x3e')]!==_0x7451('0x3f')){var _0x5f55c3={};_0x5f55c3[_0x3bac33['field']]={'$like':'%'+_0x4b5b26['query']['filter']+'%'};return _0x5f55c3;}})});}_0x4c3ac4=_['merge']({},_0x4c3ac4,_0x4b5b26[_0x7451('0x40')]);var _0x103d87={'where':_0x4c3ac4[_0x7451('0x3b')]};return db[_0x7451('0x2d')][_0x7451('0x1d')](_0x103d87)[_0x7451('0x25')](function(_0xdbbc08){_0x6c10ee[_0x7451('0x1d')]=_0xdbbc08;if(_0x4b5b26[_0x7451('0x31')][_0x7451('0x41')]){_0x4c3ac4[_0x7451('0x42')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4c3ac4);})[_0x7451('0x25')](function(_0x57f1b2){_0x6c10ee[_0x7451('0x43')]=_0x57f1b2;return _0x6c10ee;})[_0x7451('0x25')](respondWithFilteredResult(_0x3827c9,_0x4c3ac4))['catch'](handleError(_0x3827c9,null));};exports['show']=function(_0x1f5bf3,_0x53af12){var _0x2e805f={'raw':!![],'where':{'id':_0x1f5bf3[_0x7451('0x44')]['id']}},_0x514a3c={};_0x514a3c[_0x7451('0x2f')]=_['keys'](db[_0x7451('0x2d')]['rawAttributes']);_0x514a3c[_0x7451('0x31')]=_[_0x7451('0x30')](_0x1f5bf3[_0x7451('0x31')]);_0x514a3c[_0x7451('0x32')]=_[_0x7451('0x33')](_0x514a3c[_0x7451('0x2f')],_0x514a3c[_0x7451('0x31')]);_0x2e805f[_0x7451('0x34')]=_[_0x7451('0x33')](_0x514a3c[_0x7451('0x2f')],qs[_0x7451('0x35')](_0x1f5bf3[_0x7451('0x31')][_0x7451('0x35')]));_0x2e805f[_0x7451('0x34')]=_0x2e805f['attributes'][_0x7451('0x36')]?_0x2e805f[_0x7451('0x34')]:_0x514a3c[_0x7451('0x2f')];if(_0x1f5bf3[_0x7451('0x31')]['includeAll']){_0x2e805f[_0x7451('0x42')]=[{'all':!![]}];}_0x2e805f=_['merge']({},_0x2e805f,_0x1f5bf3['options']);return db['CannedAnswer']['find'](_0x2e805f)['then'](handleEntityNotFound(_0x53af12,null))[_0x7451('0x25')](respondWithResult(_0x53af12,null))[_0x7451('0x45')](handleError(_0x53af12,null));};exports[_0x7451('0x24')]=function(_0x489d7d,_0x39438a){if(_0x489d7d[_0x7451('0x46')]['id']){delete _0x489d7d[_0x7451('0x46')]['id'];}return db[_0x7451('0x2d')][_0x7451('0x47')]({'where':{'id':_0x489d7d[_0x7451('0x44')]['id']}})[_0x7451('0x25')](handleEntityNotFound(_0x39438a,null))[_0x7451('0x25')](saveUpdates(_0x489d7d[_0x7451('0x46')],null))['then'](respondWithResult(_0x39438a,null))['catch'](handleError(_0x39438a,null));};exports['destroy']=function(_0xd26beb,_0x3acf1d){return db[_0x7451('0x2d')]['find']({'where':{'id':_0xd26beb['params']['id']}})['then'](handleEntityNotFound(_0x3acf1d,null))[_0x7451('0x25')](removeEntity(_0x3acf1d,null))['catch'](handleError(_0x3acf1d,null));};exports['create']=function(_0x4763d6,_0x3993df){var _0x3dbd20={'key':_0x4763d6[_0x7451('0x46')][_0x7451('0x3e')]};if(_0x4763d6['body'][_0x7451('0x48')]){_0x3dbd20['MailAccountId']=_0x4763d6[_0x7451('0x46')][_0x7451('0x48')];}else if(_0x4763d6[_0x7451('0x46')][_0x7451('0x49')]){_0x3dbd20[_0x7451('0x49')]=_0x4763d6[_0x7451('0x46')][_0x7451('0x49')];}else if(_0x4763d6[_0x7451('0x46')][_0x7451('0x4a')]){_0x3dbd20['OpenchannelAccountId']=_0x4763d6['body'][_0x7451('0x4a')];}else if(_0x4763d6[_0x7451('0x46')]['ChatWebsiteId']){_0x3dbd20['ChatWebsiteId']=_0x4763d6['body'][_0x7451('0x4b')];}return db[_0x7451('0x2d')][_0x7451('0x47')]({'where':_0x3dbd20})[_0x7451('0x25')](function(_0x2e4f1f){if(_0x2e4f1f){throw new db[(_0x7451('0x4c'))]['ValidationError'](_0x7451('0x4d'));}return db['CannedAnswer']['create'](_0x4763d6['body']);})[_0x7451('0x25')](function(_0x3db1fe){var _0x2548be=_0x4763d6[_0x7451('0x4e')][_0x7451('0x27')]({'plain':!![]});if(!_0x2548be)throw new Error(_0x7451('0x4f'));if(_0x2548be[_0x7451('0x50')]==='user'){var _0x1566e5=_0x3db1fe[_0x7451('0x27')]({'plain':!![]});return db[_0x7451('0x51')][_0x7451('0x47')]({'where':{'name':_0x7451('0x52'),'userProfileId':_0x2548be[_0x7451('0x53')]},'raw':!![]})[_0x7451('0x25')](function(_0x5378b6){if(_0x5378b6&&_0x5378b6[_0x7451('0x54')]===0x0){return db[_0x7451('0x28')][_0x7451('0x55')]({'name':_0x1566e5[_0x7451('0x2a')],'resourceId':_0x1566e5['id'],'type':_0x5378b6[_0x7451('0x2a')],'sectionId':_0x5378b6['id']},{})[_0x7451('0x25')](function(){return _0x3db1fe;});}else{return _0x3db1fe;}})['catch'](function(_0x376b70){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x376b70);throw _0x376b70;});}return _0x3db1fe;})[_0x7451('0x25')](respondWithResult(_0x3993df,0xc9))[_0x7451('0x45')](handleError(_0x3993df,null));}; \ No newline at end of file +var _0xd3a8=['offset','limit','set','apply','reject','update','then','destroy','get','CannedAnswers','error','stack','send','index','CannedAnswer','model','keys','query','intersection','fields','attributes','nolimit','order','sort','pick','filters','filter','where','map','type','key','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','end'];(function(_0x5d8c97,_0x312874){var _0xa77b02=function(_0x5d4c26){while(--_0x5d4c26){_0x5d8c97['push'](_0x5d8c97['shift']());}};_0xa77b02(++_0x312874);}(_0xd3a8,0x135));var _0x8d3a=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xd3a8[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require(_0x8d3a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8d3a('0x1'));var zipdir=require(_0x8d3a('0x2'));var jsonpatch=require(_0x8d3a('0x3'));var rp=require(_0x8d3a('0x4'));var moment=require('moment');var BPromise=require(_0x8d3a('0x5'));var Mustache=require(_0x8d3a('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8d3a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8d3a('0x8'));var crypto=require(_0x8d3a('0x9'));var jsforce=require(_0x8d3a('0xa'));var deskjs=require(_0x8d3a('0xb'));var toCsv=require(_0x8d3a('0x7'));var querystring=require(_0x8d3a('0xc'));var Papa=require(_0x8d3a('0xd'));var Redis=require(_0x8d3a('0xe'));var authService=require(_0x8d3a('0xf'));var qs=require(_0x8d3a('0x10'));var hardwareService=require(_0x8d3a('0x11'));var logger=require(_0x8d3a('0x12'))(_0x8d3a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x222886,_0x880a06){_0x880a06=_0x880a06||0xcc;return function(_0xc834ec){if(_0xc834ec){return _0x222886[_0x8d3a('0x14')](_0x880a06);}return _0x222886[_0x8d3a('0x15')](_0x880a06)[_0x8d3a('0x16')]();};}function respondWithResult(_0x58b2b7,_0x1bcfbf){_0x1bcfbf=_0x1bcfbf||0xc8;return function(_0xb66692){if(_0xb66692){return _0x58b2b7['status'](_0x1bcfbf)['json'](_0xb66692);}};}function respondWithFilteredResult(_0x2fd704,_0x560396){return function(_0x14db8){if(_0x14db8){var _0x4225d9=_0x14db8['count'],_0x10f582=_0x560396[_0x8d3a('0x17')],_0x4c915d=_0x560396['offset']+_0x560396[_0x8d3a('0x18')],_0x33eefb;if(_0x4c915d>=_0x4225d9){_0x4c915d=_0x4225d9;_0x33eefb=0xc8;}else{_0x33eefb=0xce;}_0x2fd704[_0x8d3a('0x15')](_0x33eefb);return _0x2fd704[_0x8d3a('0x19')]('Content-Range',_0x10f582+'-'+_0x4c915d+'/'+_0x4225d9)['json'](_0x14db8);}return null;};}function patchUpdates(_0x1bbbe1){return function(_0xc8208c){try{jsonpatch[_0x8d3a('0x1a')](_0xc8208c,_0x1bbbe1,!![]);}catch(_0x3478ee){return BPromise[_0x8d3a('0x1b')](_0x3478ee);}return _0xc8208c['save']();};}function saveUpdates(_0x2bd58a,_0x78c938){return function(_0x3dc3c1){if(_0x3dc3c1){return _0x3dc3c1[_0x8d3a('0x1c')](_0x2bd58a)[_0x8d3a('0x1d')](function(_0x1b562b){return _0x1b562b;});}return null;};}function removeEntity(_0x563d44,_0x421879){return function(_0x3ca6a9){if(_0x3ca6a9){return _0x3ca6a9[_0x8d3a('0x1e')]()[_0x8d3a('0x1d')](function(){var _0x5c32bf=_0x3ca6a9[_0x8d3a('0x1f')]({'plain':!![]});var _0x2187dd=_0x8d3a('0x20');return db['UserProfileResource'][_0x8d3a('0x1e')]({'where':{'type':_0x2187dd,'resourceId':_0x5c32bf['id']}})[_0x8d3a('0x1d')](function(){return _0x3ca6a9;});})[_0x8d3a('0x1d')](function(){_0x563d44[_0x8d3a('0x15')](0xcc)[_0x8d3a('0x16')]();});}};}function handleEntityNotFound(_0xb9ba91,_0x3bff9e){return function(_0x4f6551){if(!_0x4f6551){_0xb9ba91[_0x8d3a('0x14')](0x194);}return _0x4f6551;};}function handleError(_0x4749d6,_0x2204a7){_0x2204a7=_0x2204a7||0x1f4;return function(_0x45451e){logger[_0x8d3a('0x21')](_0x45451e[_0x8d3a('0x22')]);if(_0x45451e['name']){delete _0x45451e['name'];}_0x4749d6[_0x8d3a('0x15')](_0x2204a7)[_0x8d3a('0x23')](_0x45451e);};}exports[_0x8d3a('0x24')]=function(_0x2ab876,_0x1c6ff6){var _0x24e990={},_0x497328={},_0x400ee4={'count':0x0,'rows':[]};var _0x266a4c=db[_0x8d3a('0x25')]['rawAttributes'];_0x497328[_0x8d3a('0x26')]=_[_0x8d3a('0x27')](_0x266a4c);_0x497328[_0x8d3a('0x28')]=_['keys'](_0x2ab876[_0x8d3a('0x28')]);_0x497328['filters']=_[_0x8d3a('0x29')](_0x497328[_0x8d3a('0x26')],_0x497328[_0x8d3a('0x28')]);_0x24e990['attributes']=_[_0x8d3a('0x29')](_0x497328['model'],qs['fields'](_0x2ab876[_0x8d3a('0x28')][_0x8d3a('0x2a')]));_0x24e990['attributes']=_0x24e990[_0x8d3a('0x2b')]['length']?_0x24e990['attributes']:_0x497328[_0x8d3a('0x26')];if(!_0x2ab876[_0x8d3a('0x28')]['hasOwnProperty'](_0x8d3a('0x2c'))){_0x24e990[_0x8d3a('0x18')]=qs[_0x8d3a('0x18')](_0x2ab876[_0x8d3a('0x28')][_0x8d3a('0x18')]);_0x24e990[_0x8d3a('0x17')]=qs[_0x8d3a('0x17')](_0x2ab876[_0x8d3a('0x28')][_0x8d3a('0x17')]);}_0x24e990[_0x8d3a('0x2d')]=qs['sort'](_0x2ab876[_0x8d3a('0x28')][_0x8d3a('0x2e')]);_0x24e990['where']=qs['filters'](_[_0x8d3a('0x2f')](_0x2ab876[_0x8d3a('0x28')],_0x497328[_0x8d3a('0x30')]));if(_0x2ab876['query'][_0x8d3a('0x31')]){_0x24e990[_0x8d3a('0x32')]=_['merge'](_0x24e990[_0x8d3a('0x32')],{'$or':_[_0x8d3a('0x33')](_0x266a4c,function(_0x3112ac){if(_0x3112ac[_0x8d3a('0x34')][_0x8d3a('0x35')]!==_0x8d3a('0x36')){var _0x562cde={};_0x562cde[_0x3112ac[_0x8d3a('0x37')]]={'$like':'%'+_0x2ab876[_0x8d3a('0x28')][_0x8d3a('0x31')]+'%'};return _0x562cde;}})});}_0x24e990=_[_0x8d3a('0x38')]({},_0x24e990,_0x2ab876[_0x8d3a('0x39')]);var _0x2c05f6={'where':_0x24e990[_0x8d3a('0x32')]};return db[_0x8d3a('0x25')][_0x8d3a('0x3a')](_0x2c05f6)[_0x8d3a('0x1d')](function(_0x591b98){_0x400ee4['count']=_0x591b98;if(_0x2ab876[_0x8d3a('0x28')][_0x8d3a('0x3b')]){_0x24e990[_0x8d3a('0x3c')]=[{'all':!![]}];}return db[_0x8d3a('0x25')][_0x8d3a('0x3d')](_0x24e990);})[_0x8d3a('0x1d')](function(_0x5397c7){_0x400ee4[_0x8d3a('0x3e')]=_0x5397c7;return _0x400ee4;})[_0x8d3a('0x1d')](respondWithFilteredResult(_0x1c6ff6,_0x24e990))[_0x8d3a('0x3f')](handleError(_0x1c6ff6,null));};exports[_0x8d3a('0x40')]=function(_0x2b5255,_0x35ad38){var _0x21517f={'raw':!![],'where':{'id':_0x2b5255[_0x8d3a('0x41')]['id']}},_0x3dd0fd={};_0x3dd0fd[_0x8d3a('0x26')]=_[_0x8d3a('0x27')](db[_0x8d3a('0x25')]['rawAttributes']);_0x3dd0fd[_0x8d3a('0x28')]=_[_0x8d3a('0x27')](_0x2b5255[_0x8d3a('0x28')]);_0x3dd0fd['filters']=_[_0x8d3a('0x29')](_0x3dd0fd[_0x8d3a('0x26')],_0x3dd0fd[_0x8d3a('0x28')]);_0x21517f['attributes']=_['intersection'](_0x3dd0fd[_0x8d3a('0x26')],qs[_0x8d3a('0x2a')](_0x2b5255[_0x8d3a('0x28')][_0x8d3a('0x2a')]));_0x21517f[_0x8d3a('0x2b')]=_0x21517f['attributes'][_0x8d3a('0x42')]?_0x21517f[_0x8d3a('0x2b')]:_0x3dd0fd[_0x8d3a('0x26')];if(_0x2b5255[_0x8d3a('0x28')]['includeAll']){_0x21517f['include']=[{'all':!![]}];}_0x21517f=_['merge']({},_0x21517f,_0x2b5255[_0x8d3a('0x39')]);return db[_0x8d3a('0x25')][_0x8d3a('0x43')](_0x21517f)[_0x8d3a('0x1d')](handleEntityNotFound(_0x35ad38,null))[_0x8d3a('0x1d')](respondWithResult(_0x35ad38,null))[_0x8d3a('0x3f')](handleError(_0x35ad38,null));};exports['update']=function(_0x38d47f,_0xad0c6e){if(_0x38d47f['body']['id']){delete _0x38d47f[_0x8d3a('0x44')]['id'];}return db[_0x8d3a('0x25')][_0x8d3a('0x43')]({'where':{'id':_0x38d47f[_0x8d3a('0x41')]['id']}})['then'](handleEntityNotFound(_0xad0c6e,null))[_0x8d3a('0x1d')](saveUpdates(_0x38d47f[_0x8d3a('0x44')],null))[_0x8d3a('0x1d')](respondWithResult(_0xad0c6e,null))[_0x8d3a('0x3f')](handleError(_0xad0c6e,null));};exports[_0x8d3a('0x1e')]=function(_0x45361c,_0x1ffb91){return db[_0x8d3a('0x25')][_0x8d3a('0x43')]({'where':{'id':_0x45361c[_0x8d3a('0x41')]['id']}})['then'](handleEntityNotFound(_0x1ffb91,null))[_0x8d3a('0x1d')](removeEntity(_0x1ffb91,null))[_0x8d3a('0x3f')](handleError(_0x1ffb91,null));};exports['create']=function(_0x254680,_0x5e47c5){var _0x22d6dd={'key':_0x254680[_0x8d3a('0x44')][_0x8d3a('0x35')]};if(_0x254680[_0x8d3a('0x44')]['MailAccountId']){_0x22d6dd[_0x8d3a('0x45')]=_0x254680[_0x8d3a('0x44')][_0x8d3a('0x45')];}else if(_0x254680[_0x8d3a('0x44')][_0x8d3a('0x46')]){_0x22d6dd[_0x8d3a('0x46')]=_0x254680[_0x8d3a('0x44')][_0x8d3a('0x46')];}else if(_0x254680['body']['OpenchannelAccountId']){_0x22d6dd[_0x8d3a('0x47')]=_0x254680[_0x8d3a('0x44')][_0x8d3a('0x47')];}else if(_0x254680['body'][_0x8d3a('0x48')]){_0x22d6dd[_0x8d3a('0x48')]=_0x254680['body'][_0x8d3a('0x48')];}return db[_0x8d3a('0x25')][_0x8d3a('0x43')]({'where':_0x22d6dd})[_0x8d3a('0x1d')](function(_0x19c4a3){if(_0x19c4a3){throw new db[(_0x8d3a('0x49'))]['ValidationError'](_0x8d3a('0x4a'));}return db[_0x8d3a('0x25')][_0x8d3a('0x4b')](_0x254680['body']);})[_0x8d3a('0x1d')](function(_0x29725b){var _0x53718b=_0x254680['user'][_0x8d3a('0x1f')]({'plain':!![]});if(!_0x53718b)throw new Error(_0x8d3a('0x4c'));if(_0x53718b[_0x8d3a('0x4d')]==='user'){var _0x5e401a=_0x29725b[_0x8d3a('0x1f')]({'plain':!![]});return db[_0x8d3a('0x4e')][_0x8d3a('0x43')]({'where':{'name':_0x8d3a('0x20'),'userProfileId':_0x53718b[_0x8d3a('0x4f')]},'raw':!![]})[_0x8d3a('0x1d')](function(_0x4416ea){if(_0x4416ea&&_0x4416ea[_0x8d3a('0x50')]===0x0){return db['UserProfileResource'][_0x8d3a('0x4b')]({'name':_0x5e401a[_0x8d3a('0x51')],'resourceId':_0x5e401a['id'],'type':_0x4416ea[_0x8d3a('0x51')],'sectionId':_0x4416ea['id']},{})[_0x8d3a('0x1d')](function(){return _0x29725b;});}else{return _0x29725b;}})['catch'](function(_0x565420){logger['error'](_0x8d3a('0x52'),_0x565420);throw _0x565420;});}return _0x29725b;})['then'](respondWithResult(_0x5e47c5,0xc9))[_0x8d3a('0x3f')](handleError(_0x5e47c5,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 77e8bb0..f317700 100644 --- a/server/api/cannedAnswer/cannedAnswer.model.js +++ b/server/api/cannedAnswer/cannedAnswer.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x652b=['../../config/environment','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x652b,0x68));var _0xb652=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x652b[_0x2962d5];return _0x273406;};'use strict';var _=require(_0xb652('0x0'));var util=require(_0xb652('0x1'));var logger=require(_0xb652('0x2'))('api');var moment=require(_0xb652('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb652('0x4'));var rimraf=require(_0xb652('0x5'));var config=require(_0xb652('0x6'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x43f467,_0x491ce7){return _0x43f467['define'](_0xb652('0x7'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb652('0x8'),'collate':_0xb652('0x9')});}; \ No newline at end of file +var _0x5c9c=['api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','lodash','util','../../config/logger'];(function(_0x5b7c94,_0x2221f5){var _0x569f38=function(_0x20e29d){while(--_0x20e29d){_0x5b7c94['push'](_0x5b7c94['shift']());}};_0x569f38(++_0x2221f5);}(_0x5c9c,0x1d1));var _0xc5c9=function(_0x541fed,_0x2579cc){_0x541fed=_0x541fed-0x0;var _0xfc369=_0x5c9c[_0x541fed];return _0xfc369;};'use strict';var _=require(_0xc5c9('0x0'));var util=require(_0xc5c9('0x1'));var logger=require(_0xc5c9('0x2'))(_0xc5c9('0x3'));var moment=require(_0xc5c9('0x4'));var BPromise=require('bluebird');var rp=require(_0xc5c9('0x5'));var fs=require('fs');var path=require(_0xc5c9('0x6'));var rimraf=require(_0xc5c9('0x7'));var config=require(_0xc5c9('0x8'));var attributes=require(_0xc5c9('0x9'));module[_0xc5c9('0xa')]=function(_0x576fb2,_0x3d7538){return _0x576fb2[_0xc5c9('0xb')]('CannedAnswer',attributes,{'tableName':_0xc5c9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index de18c10..26b982c 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e4c=['CannedAnswer,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x28043c,_0x2700ef){var _0x2971ad=function(_0x53067d){while(--_0x53067d){_0x28043c['push'](_0x28043c['shift']());}};_0x2971ad(++_0x2700ef);}(_0x0e4c,0x162));var _0xc0e4=function(_0x2b58d2,_0x419f3c){_0x2b58d2=_0x2b58d2-0x0;var _0x1dd973=_0x0e4c[_0x2b58d2];return _0x1dd973;};'use strict';var _=require(_0xc0e4('0x0'));var util=require(_0xc0e4('0x1'));var moment=require(_0xc0e4('0x2'));var BPromise=require('bluebird');var rs=require(_0xc0e4('0x3'));var fs=require('fs');var Redis=require(_0xc0e4('0x4'));var db=require(_0xc0e4('0x5'))['db'];var utils=require(_0xc0e4('0x6'));var logger=require(_0xc0e4('0x7'))(_0xc0e4('0x8'));var config=require(_0xc0e4('0x9'));var jayson=require(_0xc0e4('0xa'));var client=jayson['client'][_0xc0e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7ccefd,_0x137c23,_0x283da2){return new BPromise(function(_0x3cce55,_0x4f7ed3){return client[_0xc0e4('0xc')](_0x7ccefd,_0x283da2)[_0xc0e4('0xd')](function(_0x5dfc07){logger[_0xc0e4('0xe')]('CannedAnswer,\x20%s,\x20%s',_0x137c23,_0xc0e4('0xf'));logger[_0xc0e4('0x10')](_0xc0e4('0x11'),_0x137c23,_0xc0e4('0xf'),JSON[_0xc0e4('0x12')](_0x5dfc07));if(_0x5dfc07['error']){if(_0x5dfc07[_0xc0e4('0x13')][_0xc0e4('0x14')]===0x1f4){logger[_0xc0e4('0x13')](_0xc0e4('0x15'),_0x137c23,_0x5dfc07[_0xc0e4('0x13')][_0xc0e4('0x16')]);return _0x4f7ed3(_0x5dfc07['error'][_0xc0e4('0x16')]);}logger[_0xc0e4('0x13')]('CannedAnswer,\x20%s,\x20%s',_0x137c23,_0x5dfc07[_0xc0e4('0x13')][_0xc0e4('0x16')]);return _0x3cce55(_0x5dfc07[_0xc0e4('0x13')]['message']);}else{logger[_0xc0e4('0xe')]('CannedAnswer,\x20%s,\x20%s',_0x137c23,_0xc0e4('0xf'));_0x3cce55(_0x5dfc07[_0xc0e4('0x17')][_0xc0e4('0x16')]);}})[_0xc0e4('0x18')](function(_0x26c054){logger[_0xc0e4('0x13')](_0xc0e4('0x15'),_0x137c23,_0x26c054);_0x4f7ed3(_0x26c054);});});} \ No newline at end of file +var _0x634a=['bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x232eb7,_0x199b07){var _0xd7fb8=function(_0x149ed6){while(--_0x149ed6){_0x232eb7['push'](_0x232eb7['shift']());}};_0xd7fb8(++_0x199b07);}(_0x634a,0x18c));var _0xa634=function(_0x353485,_0x554168){_0x353485=_0x353485-0x0;var _0x2fc11f=_0x634a[_0x353485];return _0x2fc11f;};'use strict';var _=require(_0xa634('0x0'));var util=require(_0xa634('0x1'));var moment=require(_0xa634('0x2'));var BPromise=require(_0xa634('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa634('0x4'));var db=require(_0xa634('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa634('0x6'))('rpc');var config=require(_0xa634('0x7'));var jayson=require(_0xa634('0x8'));var client=jayson[_0xa634('0x9')][_0xa634('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57d45e,_0x249470,_0x32f5d3){return new BPromise(function(_0x144883,_0x5ae264){return client[_0xa634('0xb')](_0x57d45e,_0x32f5d3)['then'](function(_0x569f0d){logger[_0xa634('0xc')](_0xa634('0xd'),_0x249470,_0xa634('0xe'));logger[_0xa634('0xf')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x249470,_0xa634('0xe'),JSON[_0xa634('0x10')](_0x569f0d));if(_0x569f0d[_0xa634('0x11')]){if(_0x569f0d[_0xa634('0x11')]['code']===0x1f4){logger['error'](_0xa634('0xd'),_0x249470,_0x569f0d[_0xa634('0x11')][_0xa634('0x12')]);return _0x5ae264(_0x569f0d[_0xa634('0x11')]['message']);}logger['error'](_0xa634('0xd'),_0x249470,_0x569f0d[_0xa634('0x11')][_0xa634('0x12')]);return _0x144883(_0x569f0d['error'][_0xa634('0x12')]);}else{logger['info'](_0xa634('0xd'),_0x249470,_0xa634('0xe'));_0x144883(_0x569f0d[_0xa634('0x13')][_0xa634('0x12')]);}})[_0xa634('0x14')](function(_0x5066ee){logger[_0xa634('0x11')](_0xa634('0xd'),_0x249470,_0x5066ee);_0x5ae264(_0x5066ee);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 1005610..610f7a8 100644 --- a/server/api/cannedAnswer/index.js +++ b/server/api/cannedAnswer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa74a=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','index','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x52e7d0,_0x2e1216){var _0x48059f=function(_0x27ae49){while(--_0x27ae49){_0x52e7d0['push'](_0x52e7d0['shift']());}};_0x48059f(++_0x2e1216);}(_0xa74a,0x66));var _0xaa74=function(_0x1daaaf,_0x1f784c){_0x1daaaf=_0x1daaaf-0x0;var _0x553804=_0xa74a[_0x1daaaf];return _0x553804;};'use strict';var multer=require(_0xaa74('0x0'));var util=require(_0xaa74('0x1'));var path=require(_0xaa74('0x2'));var timeout=require(_0xaa74('0x3'));var express=require(_0xaa74('0x4'));var router=express[_0xaa74('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xaa74('0x6'));var config=require(_0xaa74('0x7'));var controller=require(_0xaa74('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xaa74('0x9')]);router[_0xaa74('0xa')](_0xaa74('0xb'),auth[_0xaa74('0xc')](),controller[_0xaa74('0xd')]);router['post']('/',auth[_0xaa74('0xc')](),controller['create']);router[_0xaa74('0xe')]('/:id',auth[_0xaa74('0xc')](),controller[_0xaa74('0xf')]);router['delete'](_0xaa74('0xb'),auth['isAuthenticated'](),controller[_0xaa74('0x10')]);module[_0xaa74('0x11')]=router; \ No newline at end of file +var _0x35bc=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','index','post','isAuthenticated','create','put'];(function(_0x322296,_0x57eb19){var _0x432ea7=function(_0x4bd2b3){while(--_0x4bd2b3){_0x322296['push'](_0x322296['shift']());}};_0x432ea7(++_0x57eb19);}(_0x35bc,0xa5));var _0xc35b=function(_0x540600,_0x53d2da){_0x540600=_0x540600-0x0;var _0x5eae09=_0x35bc[_0x540600];return _0x5eae09;};'use strict';var multer=require(_0xc35b('0x0'));var util=require(_0xc35b('0x1'));var path=require(_0xc35b('0x2'));var timeout=require(_0xc35b('0x3'));var express=require(_0xc35b('0x4'));var router=express[_0xc35b('0x5')]();var auth=require(_0xc35b('0x6'));var interaction=require(_0xc35b('0x7'));var config=require('../../config/environment');var controller=require(_0xc35b('0x8'));router[_0xc35b('0x9')]('/',auth['isAuthenticated'](),controller[_0xc35b('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc35b('0xb')]('/',auth[_0xc35b('0xc')](),controller[_0xc35b('0xd')]);router[_0xc35b('0xe')](_0xc35b('0xf'),auth[_0xc35b('0xc')](),controller[_0xc35b('0x10')]);router[_0xc35b('0x11')](_0xc35b('0xf'),auth['isAuthenticated'](),controller[_0xc35b('0x12')]);module[_0xc35b('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index d869289..e69625b 100644 --- a/server/api/cdr/cdr.attributes.js +++ b/server/api/cdr/cdr.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4200=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0xf98ec1,_0x4c73b8){var _0x514b6a=function(_0x3dbc32){while(--_0x3dbc32){_0xf98ec1['push'](_0xf98ec1['shift']());}};_0x514b6a(++_0x4c73b8);}(_0x4200,0x1a9));var _0x0420=function(_0x117bf0,_0x5942be){_0x117bf0=_0x117bf0-0x0;var _0x3f9c19=_0x4200[_0x117bf0];return _0x3f9c19;};'use strict';var Sequelize=require(_0x0420('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x0420('0x1')],'allowNull':![],'defaultValue':_0x0420('0x2')},'clid':{'type':Sequelize[_0x0420('0x3')]},'src':{'type':Sequelize[_0x0420('0x3')]},'dst':{'type':Sequelize[_0x0420('0x3')]},'dcontext':{'type':Sequelize[_0x0420('0x3')]},'channel':{'type':Sequelize[_0x0420('0x3')]},'dstchannel':{'type':Sequelize[_0x0420('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x0420('0x3')]},'duration':{'type':Sequelize[_0x0420('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0420('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0420('0x3')]},'amaflags':{'type':Sequelize[_0x0420('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0420('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0420('0x3')]},'linkedid':{'type':Sequelize[_0x0420('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x0420('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x0420('0x3')]}}; \ No newline at end of file +var _0x2be2=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1bfa86,_0x4a8606){var _0x1bd346=function(_0x1a1135){while(--_0x1a1135){_0x1bfa86['push'](_0x1bfa86['shift']());}};_0x1bd346(++_0x4a8606);}(_0x2be2,0x159));var _0x22be=function(_0x37dc2d,_0x4bb0a5){_0x37dc2d=_0x37dc2d-0x0;var _0x454586=_0x2be2[_0x37dc2d];return _0x454586;};'use strict';var Sequelize=require(_0x22be('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x22be('0x1')],'allowNull':![],'defaultValue':_0x22be('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x22be('0x3')]},'dst':{'type':Sequelize[_0x22be('0x3')]},'dcontext':{'type':Sequelize[_0x22be('0x3')]},'channel':{'type':Sequelize[_0x22be('0x3')]},'dstchannel':{'type':Sequelize[_0x22be('0x3')]},'lastapp':{'type':Sequelize[_0x22be('0x3')]},'lastdata':{'type':Sequelize[_0x22be('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x22be('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x22be('0x3')]},'amaflags':{'type':Sequelize[_0x22be('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x22be('0x3')]},'userfield':{'type':Sequelize[_0x22be('0x3')]},'uniqueid':{'type':Sequelize[_0x22be('0x3')]},'linkedid':{'type':Sequelize[_0x22be('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x22be('0x3')]},'tag':{'type':Sequelize[_0x22be('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index c6933cb..aba692a 100644 --- a/server/api/cdr/cdr.controller.js +++ b/server/api/cdr/cdr.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7916=['error','send','index','Cdr','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','map','key','field','merge','options','includeAll','include','rows','show','params','find','create','body','catch','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x1c949b,_0x1b5777){var _0x733463=function(_0x1157dc){while(--_0x1157dc){_0x1c949b['push'](_0x1c949b['shift']());}};_0x733463(++_0x1b5777);}(_0x7916,0x128));var _0x6791=function(_0x37a95b,_0x316828){_0x37a95b=_0x37a95b-0x0;var _0x204e39=_0x7916[_0x37a95b];return _0x204e39;};'use strict';var pdf=require(_0x6791('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6791('0x1'));var zipdir=require(_0x6791('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6791('0x3'));var moment=require(_0x6791('0x4'));var BPromise=require(_0x6791('0x5'));var Mustache=require(_0x6791('0x6'));var util=require('util');var path=require(_0x6791('0x7'));var sox=require('sox');var csv=require(_0x6791('0x8'));var ejs=require(_0x6791('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6791('0xa'));var crypto=require('crypto');var jsforce=require(_0x6791('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6791('0xc'));var Papa=require(_0x6791('0xd'));var Redis=require('ioredis');var authService=require(_0x6791('0xe'));var qs=require(_0x6791('0xf'));var hardwareService=require(_0x6791('0x10'));var logger=require('../../config/logger')(_0x6791('0x11'));var utils=require(_0x6791('0x12'));var config=require(_0x6791('0x13'));var db=require(_0x6791('0x14'))['db'];function respondWithStatusCode(_0x2e606f,_0x1eddd3){_0x1eddd3=_0x1eddd3||0xcc;return function(_0x61ac73){if(_0x61ac73){return _0x2e606f[_0x6791('0x15')](_0x1eddd3);}return _0x2e606f[_0x6791('0x16')](_0x1eddd3)[_0x6791('0x17')]();};}function respondWithResult(_0x39aeab,_0x5c51f8){_0x5c51f8=_0x5c51f8||0xc8;return function(_0x4b1719){if(_0x4b1719){return _0x39aeab[_0x6791('0x16')](_0x5c51f8)['json'](_0x4b1719);}};}function respondWithFilteredResult(_0x2a9151,_0x4c32a1){return function(_0x3be9f0){if(_0x3be9f0){var _0x163898=_0x3be9f0[_0x6791('0x18')],_0x517910=_0x4c32a1[_0x6791('0x19')],_0x3e4792=_0x4c32a1['offset']+_0x4c32a1[_0x6791('0x1a')],_0x4b80ed;if(_0x3e4792>=_0x163898){_0x3e4792=_0x163898;_0x4b80ed=0xc8;}else{_0x4b80ed=0xce;}_0x2a9151[_0x6791('0x16')](_0x4b80ed);return _0x2a9151['set'](_0x6791('0x1b'),_0x517910+'-'+_0x3e4792+'/'+_0x163898)['json'](_0x3be9f0);}return null;};}function patchUpdates(_0xe55dba){return function(_0x126451){try{jsonpatch[_0x6791('0x1c')](_0x126451,_0xe55dba,!![]);}catch(_0x3a72ce){return BPromise[_0x6791('0x1d')](_0x3a72ce);}return _0x126451[_0x6791('0x1e')]();};}function saveUpdates(_0x2ba11a,_0x581d51){return function(_0x4a2922){if(_0x4a2922){return _0x4a2922[_0x6791('0x1f')](_0x2ba11a)['then'](function(_0x21ef16){return _0x21ef16;});}return null;};}function removeEntity(_0x3b57f0,_0x595cf2){return function(_0x17f200){if(_0x17f200){return _0x17f200[_0x6791('0x20')]()[_0x6791('0x21')](function(){_0x3b57f0[_0x6791('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e17b3,_0x1b516d){return function(_0x4a8717){if(!_0x4a8717){_0x3e17b3['sendStatus'](0x194);}return _0x4a8717;};}function handleError(_0x4b23bc,_0x372dae){_0x372dae=_0x372dae||0x1f4;return function(_0x502043){logger[_0x6791('0x22')](_0x502043['stack']);if(_0x502043['name']){delete _0x502043['name'];}_0x4b23bc[_0x6791('0x16')](_0x372dae)[_0x6791('0x23')](_0x502043);};}exports[_0x6791('0x24')]=function(_0x56a74e,_0x3def2e){var _0x30cc17={},_0x493a59={},_0x342107={'count':0x0,'rows':[]};var _0x5cbb79=db[_0x6791('0x25')]['rawAttributes'];_0x493a59['model']=_[_0x6791('0x26')](_0x5cbb79);_0x493a59['query']=_[_0x6791('0x26')](_0x56a74e[_0x6791('0x27')]);_0x493a59['filters']=_[_0x6791('0x28')](_0x493a59[_0x6791('0x29')],_0x493a59[_0x6791('0x27')]);_0x30cc17[_0x6791('0x2a')]=_['intersection'](_0x493a59['model'],qs[_0x6791('0x2b')](_0x56a74e['query'][_0x6791('0x2b')]));_0x30cc17[_0x6791('0x2a')]=_0x30cc17[_0x6791('0x2a')][_0x6791('0x2c')]?_0x30cc17[_0x6791('0x2a')]:_0x493a59[_0x6791('0x29')];if(!_0x56a74e[_0x6791('0x27')][_0x6791('0x2d')](_0x6791('0x2e'))){_0x30cc17[_0x6791('0x1a')]=qs['limit'](_0x56a74e[_0x6791('0x27')][_0x6791('0x1a')]);_0x30cc17[_0x6791('0x19')]=qs[_0x6791('0x19')](_0x56a74e[_0x6791('0x27')][_0x6791('0x19')]);}_0x30cc17['order']=qs['sort'](_0x56a74e['query'][_0x6791('0x2f')]);_0x30cc17[_0x6791('0x30')]=qs[_0x6791('0x31')](_['pick'](_0x56a74e['query'],_0x493a59[_0x6791('0x31')]));if(_0x56a74e[_0x6791('0x27')][_0x6791('0x32')]){_0x30cc17[_0x6791('0x30')]=_['merge'](_0x30cc17[_0x6791('0x30')],{'$or':_[_0x6791('0x33')](_0x5cbb79,function(_0x2068a5){if(_0x2068a5['type'][_0x6791('0x34')]!=='VIRTUAL'){var _0x4ee010={};_0x4ee010[_0x2068a5[_0x6791('0x35')]]={'$like':'%'+_0x56a74e[_0x6791('0x27')]['filter']+'%'};return _0x4ee010;}})});}_0x30cc17=_[_0x6791('0x36')]({},_0x30cc17,_0x56a74e[_0x6791('0x37')]);var _0x407882={'where':_0x30cc17[_0x6791('0x30')]};return db[_0x6791('0x25')]['count'](_0x407882)[_0x6791('0x21')](function(_0xc95516){_0x342107[_0x6791('0x18')]=_0xc95516;if(_0x56a74e['query'][_0x6791('0x38')]){_0x30cc17[_0x6791('0x39')]=[{'all':!![]}];}return db[_0x6791('0x25')]['findAll'](_0x30cc17);})[_0x6791('0x21')](function(_0x31f2bb){_0x342107[_0x6791('0x3a')]=_0x31f2bb;return _0x342107;})[_0x6791('0x21')](respondWithFilteredResult(_0x3def2e,_0x30cc17))['catch'](handleError(_0x3def2e,null));};exports[_0x6791('0x3b')]=function(_0x1a4b64,_0x3e95b6){var _0xd0f1c={'raw':!![],'where':{'id':_0x1a4b64[_0x6791('0x3c')]['id']}},_0x12f121={};_0x12f121[_0x6791('0x29')]=_[_0x6791('0x26')](db[_0x6791('0x25')]['rawAttributes']);_0x12f121['query']=_[_0x6791('0x26')](_0x1a4b64[_0x6791('0x27')]);_0x12f121['filters']=_[_0x6791('0x28')](_0x12f121[_0x6791('0x29')],_0x12f121[_0x6791('0x27')]);_0xd0f1c[_0x6791('0x2a')]=_[_0x6791('0x28')](_0x12f121[_0x6791('0x29')],qs[_0x6791('0x2b')](_0x1a4b64['query'][_0x6791('0x2b')]));_0xd0f1c['attributes']=_0xd0f1c[_0x6791('0x2a')][_0x6791('0x2c')]?_0xd0f1c[_0x6791('0x2a')]:_0x12f121[_0x6791('0x29')];if(_0x1a4b64['query'][_0x6791('0x38')]){_0xd0f1c[_0x6791('0x39')]=[{'all':!![]}];}_0xd0f1c=_[_0x6791('0x36')]({},_0xd0f1c,_0x1a4b64[_0x6791('0x37')]);return db[_0x6791('0x25')][_0x6791('0x3d')](_0xd0f1c)[_0x6791('0x21')](handleEntityNotFound(_0x3e95b6,null))[_0x6791('0x21')](respondWithResult(_0x3e95b6,null))['catch'](handleError(_0x3e95b6,null));};exports[_0x6791('0x3e')]=function(_0x2b9b56,_0x3124bc){return db[_0x6791('0x25')]['create'](_0x2b9b56[_0x6791('0x3f')],{})[_0x6791('0x21')](respondWithResult(_0x3124bc,0xc9))['catch'](handleError(_0x3124bc,null));};exports[_0x6791('0x1f')]=function(_0x54ef7b,_0x38b6b5){if(_0x54ef7b[_0x6791('0x3f')]['id']){delete _0x54ef7b[_0x6791('0x3f')]['id'];}return db[_0x6791('0x25')][_0x6791('0x3d')]({'where':{'id':_0x54ef7b[_0x6791('0x3c')]['id']}})[_0x6791('0x21')](handleEntityNotFound(_0x38b6b5,null))[_0x6791('0x21')](saveUpdates(_0x54ef7b[_0x6791('0x3f')],null))['then'](respondWithResult(_0x38b6b5,null))[_0x6791('0x40')](handleError(_0x38b6b5,null));};exports['destroy']=function(_0x10e806,_0x2bb86a){return db[_0x6791('0x25')][_0x6791('0x3d')]({'where':{'id':_0x10e806[_0x6791('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2bb86a,null))[_0x6791('0x21')](removeEntity(_0x2bb86a,null))[_0x6791('0x40')](handleError(_0x2bb86a,null));};exports[_0x6791('0x41')]=function(_0x3d22f3,_0x2b1656){return db['Cdr'][_0x6791('0x41')]()[_0x6791('0x21')](respondWithResult(_0x2b1656,null))['catch'](handleError(_0x2b1656,null));}; \ No newline at end of file +var _0xac4a=['Content-Range','apply','reject','save','then','destroy','stack','index','Cdr','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','length','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset'];(function(_0x55b025,_0x27f2c8){var _0x57b127=function(_0x1c2303){while(--_0x1c2303){_0x55b025['push'](_0x55b025['shift']());}};_0x57b127(++_0x27f2c8);}(_0xac4a,0x13f));var _0xaac4=function(_0x3e760f,_0x59c20d){_0x3e760f=_0x3e760f-0x0;var _0xcfec68=_0xac4a[_0x3e760f];return _0xcfec68;};'use strict';var pdf=require(_0xaac4('0x0'));var emlformat=require(_0xaac4('0x1'));var rimraf=require(_0xaac4('0x2'));var zipdir=require(_0xaac4('0x3'));var jsonpatch=require(_0xaac4('0x4'));var rp=require(_0xaac4('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaac4('0x6'));var util=require(_0xaac4('0x7'));var path=require(_0xaac4('0x8'));var sox=require('sox');var csv=require(_0xaac4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xaac4('0xf'));var logger=require(_0xaac4('0x10'))(_0xaac4('0x11'));var utils=require(_0xaac4('0x12'));var config=require(_0xaac4('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x508e14,_0x2348c2){_0x2348c2=_0x2348c2||0xcc;return function(_0x2e2d02){if(_0x2e2d02){return _0x508e14[_0xaac4('0x14')](_0x2348c2);}return _0x508e14['status'](_0x2348c2)[_0xaac4('0x15')]();};}function respondWithResult(_0x45c129,_0x5bcacd){_0x5bcacd=_0x5bcacd||0xc8;return function(_0xf06b1d){if(_0xf06b1d){return _0x45c129[_0xaac4('0x16')](_0x5bcacd)[_0xaac4('0x17')](_0xf06b1d);}};}function respondWithFilteredResult(_0x150fdd,_0x187624){return function(_0x2fbeb7){if(_0x2fbeb7){var _0x31b7e5=_0x2fbeb7[_0xaac4('0x18')],_0x1df9ae=_0x187624[_0xaac4('0x19')],_0x233278=_0x187624[_0xaac4('0x19')]+_0x187624['limit'],_0xb8466e;if(_0x233278>=_0x31b7e5){_0x233278=_0x31b7e5;_0xb8466e=0xc8;}else{_0xb8466e=0xce;}_0x150fdd[_0xaac4('0x16')](_0xb8466e);return _0x150fdd['set'](_0xaac4('0x1a'),_0x1df9ae+'-'+_0x233278+'/'+_0x31b7e5)['json'](_0x2fbeb7);}return null;};}function patchUpdates(_0x3ce35a){return function(_0x27fe7b){try{jsonpatch[_0xaac4('0x1b')](_0x27fe7b,_0x3ce35a,!![]);}catch(_0x271bcb){return BPromise[_0xaac4('0x1c')](_0x271bcb);}return _0x27fe7b[_0xaac4('0x1d')]();};}function saveUpdates(_0x44f0e8,_0x25b946){return function(_0x4166ee){if(_0x4166ee){return _0x4166ee['update'](_0x44f0e8)[_0xaac4('0x1e')](function(_0x4e1e89){return _0x4e1e89;});}return null;};}function removeEntity(_0x3303f1,_0x2013b7){return function(_0x43625c){if(_0x43625c){return _0x43625c[_0xaac4('0x1f')]()[_0xaac4('0x1e')](function(){_0x3303f1[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43ccdc,_0x27a84d){return function(_0x174860){if(!_0x174860){_0x43ccdc[_0xaac4('0x14')](0x194);}return _0x174860;};}function handleError(_0x3dd059,_0x2dcc59){_0x2dcc59=_0x2dcc59||0x1f4;return function(_0xb2577b){logger['error'](_0xb2577b[_0xaac4('0x20')]);if(_0xb2577b['name']){delete _0xb2577b['name'];}_0x3dd059['status'](_0x2dcc59)['send'](_0xb2577b);};}exports[_0xaac4('0x21')]=function(_0x17d25f,_0x22cda2){var _0xe93120={},_0x3c1445={},_0x249a5d={'count':0x0,'rows':[]};var _0x43b122=db[_0xaac4('0x22')][_0xaac4('0x23')];_0x3c1445[_0xaac4('0x24')]=_['keys'](_0x43b122);_0x3c1445[_0xaac4('0x25')]=_[_0xaac4('0x26')](_0x17d25f[_0xaac4('0x25')]);_0x3c1445[_0xaac4('0x27')]=_[_0xaac4('0x28')](_0x3c1445[_0xaac4('0x24')],_0x3c1445['query']);_0xe93120[_0xaac4('0x29')]=_['intersection'](_0x3c1445[_0xaac4('0x24')],qs[_0xaac4('0x2a')](_0x17d25f[_0xaac4('0x25')][_0xaac4('0x2a')]));_0xe93120['attributes']=_0xe93120['attributes']['length']?_0xe93120[_0xaac4('0x29')]:_0x3c1445[_0xaac4('0x24')];if(!_0x17d25f[_0xaac4('0x25')][_0xaac4('0x2b')](_0xaac4('0x2c'))){_0xe93120[_0xaac4('0x2d')]=qs[_0xaac4('0x2d')](_0x17d25f[_0xaac4('0x25')][_0xaac4('0x2d')]);_0xe93120[_0xaac4('0x19')]=qs[_0xaac4('0x19')](_0x17d25f[_0xaac4('0x25')][_0xaac4('0x19')]);}_0xe93120[_0xaac4('0x2e')]=qs[_0xaac4('0x2f')](_0x17d25f['query']['sort']);_0xe93120[_0xaac4('0x30')]=qs[_0xaac4('0x27')](_[_0xaac4('0x31')](_0x17d25f['query'],_0x3c1445[_0xaac4('0x27')]));if(_0x17d25f[_0xaac4('0x25')][_0xaac4('0x32')]){_0xe93120[_0xaac4('0x30')]=_[_0xaac4('0x33')](_0xe93120[_0xaac4('0x30')],{'$or':_[_0xaac4('0x34')](_0x43b122,function(_0x53b7cb){if(_0x53b7cb[_0xaac4('0x35')][_0xaac4('0x36')]!==_0xaac4('0x37')){var _0x5d64a2={};_0x5d64a2[_0x53b7cb[_0xaac4('0x38')]]={'$like':'%'+_0x17d25f['query']['filter']+'%'};return _0x5d64a2;}})});}_0xe93120=_[_0xaac4('0x33')]({},_0xe93120,_0x17d25f[_0xaac4('0x39')]);var _0x2da28a={'where':_0xe93120['where']};return db['Cdr'][_0xaac4('0x18')](_0x2da28a)[_0xaac4('0x1e')](function(_0x2f7300){_0x249a5d[_0xaac4('0x18')]=_0x2f7300;if(_0x17d25f[_0xaac4('0x25')][_0xaac4('0x3a')]){_0xe93120['include']=[{'all':!![]}];}return db['Cdr'][_0xaac4('0x3b')](_0xe93120);})[_0xaac4('0x1e')](function(_0x5371b4){_0x249a5d[_0xaac4('0x3c')]=_0x5371b4;return _0x249a5d;})[_0xaac4('0x1e')](respondWithFilteredResult(_0x22cda2,_0xe93120))[_0xaac4('0x3d')](handleError(_0x22cda2,null));};exports['show']=function(_0x74a1c,_0x4a4773){var _0x2259fc={'raw':!![],'where':{'id':_0x74a1c[_0xaac4('0x3e')]['id']}},_0x5bc387={};_0x5bc387[_0xaac4('0x24')]=_[_0xaac4('0x26')](db[_0xaac4('0x22')]['rawAttributes']);_0x5bc387[_0xaac4('0x25')]=_['keys'](_0x74a1c['query']);_0x5bc387[_0xaac4('0x27')]=_[_0xaac4('0x28')](_0x5bc387[_0xaac4('0x24')],_0x5bc387[_0xaac4('0x25')]);_0x2259fc[_0xaac4('0x29')]=_[_0xaac4('0x28')](_0x5bc387[_0xaac4('0x24')],qs[_0xaac4('0x2a')](_0x74a1c['query'][_0xaac4('0x2a')]));_0x2259fc[_0xaac4('0x29')]=_0x2259fc[_0xaac4('0x29')][_0xaac4('0x3f')]?_0x2259fc['attributes']:_0x5bc387[_0xaac4('0x24')];if(_0x74a1c[_0xaac4('0x25')][_0xaac4('0x3a')]){_0x2259fc['include']=[{'all':!![]}];}_0x2259fc=_[_0xaac4('0x33')]({},_0x2259fc,_0x74a1c[_0xaac4('0x39')]);return db[_0xaac4('0x22')][_0xaac4('0x40')](_0x2259fc)['then'](handleEntityNotFound(_0x4a4773,null))[_0xaac4('0x1e')](respondWithResult(_0x4a4773,null))[_0xaac4('0x3d')](handleError(_0x4a4773,null));};exports[_0xaac4('0x41')]=function(_0x57a7ab,_0xf404b9){return db[_0xaac4('0x22')][_0xaac4('0x41')](_0x57a7ab[_0xaac4('0x42')],{})[_0xaac4('0x1e')](respondWithResult(_0xf404b9,0xc9))[_0xaac4('0x3d')](handleError(_0xf404b9,null));};exports[_0xaac4('0x43')]=function(_0xa8d1c9,_0x6c713){if(_0xa8d1c9['body']['id']){delete _0xa8d1c9[_0xaac4('0x42')]['id'];}return db[_0xaac4('0x22')][_0xaac4('0x40')]({'where':{'id':_0xa8d1c9[_0xaac4('0x3e')]['id']}})[_0xaac4('0x1e')](handleEntityNotFound(_0x6c713,null))['then'](saveUpdates(_0xa8d1c9['body'],null))[_0xaac4('0x1e')](respondWithResult(_0x6c713,null))[_0xaac4('0x3d')](handleError(_0x6c713,null));};exports[_0xaac4('0x1f')]=function(_0x16c7f4,_0x5f33ea){return db[_0xaac4('0x22')]['find']({'where':{'id':_0x16c7f4[_0xaac4('0x3e')]['id']}})[_0xaac4('0x1e')](handleEntityNotFound(_0x5f33ea,null))['then'](removeEntity(_0x5f33ea,null))[_0xaac4('0x3d')](handleError(_0x5f33ea,null));};exports[_0xaac4('0x44')]=function(_0x357bc6,_0x5cbbdc){return db['Cdr'][_0xaac4('0x44')]()[_0xaac4('0x1e')](respondWithResult(_0x5cbbdc,null))[_0xaac4('0x3d')](handleError(_0x5cbbdc,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 1ff6815..b68c539 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x524e=['define','Cdr','accountcode','calldate','disposition','dst','src','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x402cf1,_0x510897){var _0x10b192=function(_0x205ab1){while(--_0x205ab1){_0x402cf1['push'](_0x402cf1['shift']());}};_0x10b192(++_0x510897);}(_0x524e,0x15e));var _0xe524=function(_0x1a059f,_0x18834a){_0x1a059f=_0x1a059f-0x0;var _0x4d1ee5=_0x524e[_0x1a059f];return _0x4d1ee5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));module[_0xe524('0x9')]=function(_0x4f75d6,_0xaaeaa9){return _0x4f75d6[_0xe524('0xa')](_0xe524('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0xe524('0xc'),'fields':[_0xe524('0xc')]},{'name':_0xe524('0xd'),'fields':[_0xe524('0xd')]},{'name':_0xe524('0xe'),'fields':[_0xe524('0xe')]},{'name':_0xe524('0xf'),'fields':[_0xe524('0xf')]},{'name':_0xe524('0x10'),'fields':[_0xe524('0x10')]},{'name':_0xe524('0x11'),'fields':[_0xe524('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1883=['dst','src','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition'];(function(_0x4d7892,_0x167fab){var _0x511a0c=function(_0x1f1e4c){while(--_0x1f1e4c){_0x4d7892['push'](_0x4d7892['shift']());}};_0x511a0c(++_0x167fab);}(_0x1883,0xab));var _0x3188=function(_0x451996,_0x5100d0){_0x451996=_0x451996-0x0;var _0x33b8ca=_0x1883[_0x451996];return _0x33b8ca;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x3188('0xf')]},{'name':_0x3188('0x10'),'fields':['calldate']},{'name':_0x3188('0x11'),'fields':['disposition']},{'name':_0x3188('0x12'),'fields':[_0x3188('0x12')]},{'name':_0x3188('0x13'),'fields':[_0x3188('0x13')]},{'name':'uniqueid','fields':[_0x3188('0x14')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index d8297ec..77093f1 100644 --- a/server/api/cdr/cdr.rpc.js +++ b/server/api/cdr/cdr.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3247=['lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','catch'];(function(_0x4941d4,_0x430b57){var _0x3400ec=function(_0x1438d5){while(--_0x1438d5){_0x4941d4['push'](_0x4941d4['shift']());}};_0x3400ec(++_0x430b57);}(_0x3247,0x176));var _0x7324=function(_0x4b808f,_0x2bedb7){_0x4b808f=_0x4b808f-0x0;var _0x71e72=_0x3247[_0x4b808f];return _0x71e72;};'use strict';var _=require(_0x7324('0x0'));var util=require(_0x7324('0x1'));var moment=require(_0x7324('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7324('0x3'))['db'];var utils=require(_0x7324('0x4'));var logger=require(_0x7324('0x5'))(_0x7324('0x6'));var config=require(_0x7324('0x7'));var jayson=require(_0x7324('0x8'));var client=jayson[_0x7324('0x9')][_0x7324('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x528bf7,_0x3d5716,_0xf25c24){return new BPromise(function(_0x26a54f,_0x451254){return client[_0x7324('0xb')](_0x528bf7,_0xf25c24)[_0x7324('0xc')](function(_0x45b2d6){logger[_0x7324('0xd')]('Cdr,\x20%s,\x20%s',_0x3d5716,_0x7324('0xe'));logger['debug'](_0x7324('0xf'),_0x3d5716,_0x7324('0xe'),JSON[_0x7324('0x10')](_0x45b2d6));if(_0x45b2d6[_0x7324('0x11')]){if(_0x45b2d6[_0x7324('0x11')][_0x7324('0x12')]===0x1f4){logger['error'](_0x7324('0x13'),_0x3d5716,_0x45b2d6[_0x7324('0x11')][_0x7324('0x14')]);return _0x451254(_0x45b2d6[_0x7324('0x11')][_0x7324('0x14')]);}logger[_0x7324('0x11')]('Cdr,\x20%s,\x20%s',_0x3d5716,_0x45b2d6['error']['message']);return _0x26a54f(_0x45b2d6[_0x7324('0x11')][_0x7324('0x14')]);}else{logger[_0x7324('0xd')](_0x7324('0x13'),_0x3d5716,_0x7324('0xe'));_0x26a54f(_0x45b2d6['result'][_0x7324('0x14')]);}})[_0x7324('0x15')](function(_0x243c4f){logger[_0x7324('0x11')]('Cdr,\x20%s,\x20%s',_0x3d5716,_0x243c4f);_0x451254(_0x243c4f);});});} \ No newline at end of file +var _0xfcea=['message','info','lodash','moment','randomstring','ioredis','../../config/utils','jayson/promise','client','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x2c492c,_0x53bd45){var _0x1fc784=function(_0x21527b){while(--_0x21527b){_0x2c492c['push'](_0x2c492c['shift']());}};_0x1fc784(++_0x53bd45);}(_0xfcea,0xc2));var _0xafce=function(_0x6b81d8,_0x339081){_0x6b81d8=_0x6b81d8-0x0;var _0x551f31=_0xfcea[_0x6b81d8];return _0x551f31;};'use strict';var _=require(_0xafce('0x0'));var util=require('util');var moment=require(_0xafce('0x1'));var BPromise=require('bluebird');var rs=require(_0xafce('0x2'));var fs=require('fs');var Redis=require(_0xafce('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xafce('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xafce('0x5'));var client=jayson[_0xafce('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a7ab4,_0x56b253,_0x51118c){return new BPromise(function(_0xf9583e,_0x270a43){return client['request'](_0x3a7ab4,_0x51118c)[_0xafce('0x7')](function(_0x47bc81){logger['info'](_0xafce('0x8'),_0x56b253,_0xafce('0x9'));logger[_0xafce('0xa')](_0xafce('0xb'),_0x56b253,_0xafce('0x9'),JSON['stringify'](_0x47bc81));if(_0x47bc81['error']){if(_0x47bc81['error'][_0xafce('0xc')]===0x1f4){logger[_0xafce('0xd')](_0xafce('0x8'),_0x56b253,_0x47bc81[_0xafce('0xd')][_0xafce('0xe')]);return _0x270a43(_0x47bc81['error']['message']);}logger['error']('Cdr,\x20%s,\x20%s',_0x56b253,_0x47bc81['error'][_0xafce('0xe')]);return _0xf9583e(_0x47bc81[_0xafce('0xd')][_0xafce('0xe')]);}else{logger[_0xafce('0xf')]('Cdr,\x20%s,\x20%s',_0x56b253,_0xafce('0x9'));_0xf9583e(_0x47bc81['result'][_0xafce('0xe')]);}})['catch'](function(_0x15b19a){logger[_0xafce('0xd')](_0xafce('0x8'),_0x56b253,_0x15b19a);_0x270a43(_0x15b19a);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index f3e8a6c..7bdb17e 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd21a=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x49d6c1,_0x3f40ac){var _0x37268a=function(_0x2df9b5){while(--_0x2df9b5){_0x49d6c1['push'](_0x49d6c1['shift']());}};_0x37268a(++_0x3f40ac);}(_0xd21a,0x165));var _0xad21=function(_0x41ed29,_0x1c4e80){_0x41ed29=_0x41ed29-0x0;var _0x2b50df=_0xd21a[_0x41ed29];return _0x2b50df;};'use strict';var multer=require(_0xad21('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xad21('0x1'));var express=require(_0xad21('0x2'));var router=express[_0xad21('0x3')]();var auth=require(_0xad21('0x4'));var interaction=require(_0xad21('0x5'));var config=require(_0xad21('0x6'));var controller=require('./cdr.controller');router[_0xad21('0x7')]('/',auth['isAuthenticated'](),controller[_0xad21('0x8')]);router[_0xad21('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xad21('0x7')]('/:id',auth[_0xad21('0x9')](),controller[_0xad21('0xa')]);router[_0xad21('0xb')]('/',auth[_0xad21('0x9')](),controller[_0xad21('0xc')]);router[_0xad21('0xd')](_0xad21('0xe'),auth[_0xad21('0x9')](),controller[_0xad21('0xf')]);router[_0xad21('0x10')](_0xad21('0xe'),auth[_0xad21('0x9')](),controller[_0xad21('0x11')]);module[_0xad21('0x12')]=router; \ No newline at end of file +var _0xac14=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','connect-timeout','Router'];(function(_0x20fd36,_0x1e1783){var _0x57d123=function(_0x9afbb5){while(--_0x9afbb5){_0x20fd36['push'](_0x20fd36['shift']());}};_0x57d123(++_0x1e1783);}(_0xac14,0x1ac));var _0x4ac1=function(_0x5417b4,_0x50d5d9){_0x5417b4=_0x5417b4-0x0;var _0x14aa84=_0xac14[_0x5417b4];return _0x14aa84;};'use strict';var multer=require(_0x4ac1('0x0'));var util=require(_0x4ac1('0x1'));var path=require('path');var timeout=require(_0x4ac1('0x2'));var express=require('express');var router=express[_0x4ac1('0x3')]();var auth=require(_0x4ac1('0x4'));var interaction=require(_0x4ac1('0x5'));var config=require('../../config/environment');var controller=require('./cdr.controller');router[_0x4ac1('0x6')]('/',auth[_0x4ac1('0x7')](),controller[_0x4ac1('0x8')]);router['get']('/describe',auth[_0x4ac1('0x7')](),controller['describe']);router[_0x4ac1('0x6')](_0x4ac1('0x9'),auth[_0x4ac1('0x7')](),controller['show']);router[_0x4ac1('0xa')]('/',auth[_0x4ac1('0x7')](),controller[_0x4ac1('0xb')]);router[_0x4ac1('0xc')](_0x4ac1('0x9'),auth[_0x4ac1('0x7')](),controller[_0x4ac1('0xd')]);router[_0x4ac1('0xe')](_0x4ac1('0x9'),auth[_0x4ac1('0x7')](),controller['destroy']);module[_0x4ac1('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 5a3c756..08442f2 100644 --- a/server/api/chatApplication/chatApplication.attributes.js +++ b/server/api/chatApplication/chatApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd716=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xd716,0x6a));var _0x6d71=function(_0x3b7fb7,_0x30abbb){_0x3b7fb7=_0x3b7fb7-0x0;var _0x34da82=_0xd716[_0x3b7fb7];return _0x34da82;};'use strict';var Sequelize=require(_0x6d71('0x0'));module[_0x6d71('0x1')]={'priority':{'type':Sequelize[_0x6d71('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6d71('0x3')},'appdata':{'type':Sequelize[_0x6d71('0x4')]()},'description':{'type':Sequelize[_0x6d71('0x5')]},'interval':{'type':Sequelize[_0x6d71('0x5')],'defaultValue':_0x6d71('0x6')}}; \ No newline at end of file +var _0x2044=['STRING','noop','sequelize','exports','INTEGER'];(function(_0x40a7b3,_0x3e36b7){var _0x43d586=function(_0x1038bd){while(--_0x1038bd){_0x40a7b3['push'](_0x40a7b3['shift']());}};_0x43d586(++_0x3e36b7);}(_0x2044,0x11f));var _0x4204=function(_0x1ad79a,_0x38eee4){_0x1ad79a=_0x1ad79a-0x0;var _0xb98a81=_0x2044[_0x1ad79a];return _0xb98a81;};'use strict';var Sequelize=require(_0x4204('0x0'));module[_0x4204('0x1')]={'priority':{'type':Sequelize[_0x4204('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4204('0x3')],'allowNull':![],'defaultValue':_0x4204('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4204('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index d6ab715..3a6e334 100644 --- a/server/api/chatApplication/chatApplication.controller.js +++ b/server/api/chatApplication/chatApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6910=['ChatApplication','find','catch','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','save','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options'];(function(_0x515651,_0x4f08a5){var _0x4f456b=function(_0x5234a1){while(--_0x5234a1){_0x515651['push'](_0x515651['shift']());}};_0x4f456b(++_0x4f08a5);}(_0x6910,0x186));var _0x0691=function(_0x497948,_0x4ca60c){_0x497948=_0x497948-0x0;var _0x39bb36=_0x6910[_0x497948];return _0x39bb36;};'use strict';var pdf=require(_0x0691('0x0'));var emlformat=require(_0x0691('0x1'));var rimraf=require(_0x0691('0x2'));var zipdir=require(_0x0691('0x3'));var jsonpatch=require(_0x0691('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0691('0x5'));var Mustache=require('mustache');var util=require(_0x0691('0x6'));var path=require(_0x0691('0x7'));var sox=require(_0x0691('0x8'));var csv=require(_0x0691('0x9'));var ejs=require(_0x0691('0xa'));var fs=require('fs');var _=require(_0x0691('0xb'));var squel=require(_0x0691('0xc'));var crypto=require(_0x0691('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0691('0xe'));var toCsv=require(_0x0691('0x9'));var querystring=require(_0x0691('0xf'));var Papa=require(_0x0691('0x10'));var Redis=require(_0x0691('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0691('0x12'));var hardwareService=require(_0x0691('0x13'));var logger=require(_0x0691('0x14'))('api');var utils=require(_0x0691('0x15'));var config=require('../../config/environment');var db=require(_0x0691('0x16'))['db'];function respondWithStatusCode(_0x1babd2,_0xd51e54){_0xd51e54=_0xd51e54||0xcc;return function(_0x214114){if(_0x214114){return _0x1babd2[_0x0691('0x17')](_0xd51e54);}return _0x1babd2[_0x0691('0x18')](_0xd51e54)[_0x0691('0x19')]();};}function respondWithResult(_0x5582a7,_0x43d04e){_0x43d04e=_0x43d04e||0xc8;return function(_0x3c399e){if(_0x3c399e){return _0x5582a7[_0x0691('0x18')](_0x43d04e)[_0x0691('0x1a')](_0x3c399e);}};}function respondWithFilteredResult(_0x34efec,_0x4cf969){return function(_0x3bc773){if(_0x3bc773){var _0x12740f=_0x3bc773[_0x0691('0x1b')],_0x394603=_0x4cf969['offset'],_0x1d5f05=_0x4cf969['offset']+_0x4cf969[_0x0691('0x1c')],_0x5d2e00;if(_0x1d5f05>=_0x12740f){_0x1d5f05=_0x12740f;_0x5d2e00=0xc8;}else{_0x5d2e00=0xce;}_0x34efec[_0x0691('0x18')](_0x5d2e00);return _0x34efec[_0x0691('0x1d')](_0x0691('0x1e'),_0x394603+'-'+_0x1d5f05+'/'+_0x12740f)[_0x0691('0x1a')](_0x3bc773);}return null;};}function patchUpdates(_0x5de59c){return function(_0xee8bb9){try{jsonpatch['apply'](_0xee8bb9,_0x5de59c,!![]);}catch(_0x47e86e){return BPromise['reject'](_0x47e86e);}return _0xee8bb9[_0x0691('0x1f')]();};}function saveUpdates(_0x483f99,_0x140362){return function(_0x3af820){if(_0x3af820){return _0x3af820['update'](_0x483f99)[_0x0691('0x20')](function(_0x151353){return _0x151353;});}return null;};}function removeEntity(_0x1ebe95,_0x343805){return function(_0x31cfd3){if(_0x31cfd3){return _0x31cfd3[_0x0691('0x21')]()[_0x0691('0x20')](function(){_0x1ebe95[_0x0691('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x188005,_0x219376){return function(_0x29c466){if(!_0x29c466){_0x188005[_0x0691('0x17')](0x194);}return _0x29c466;};}function handleError(_0xa34b5b,_0x3bb3bf){_0x3bb3bf=_0x3bb3bf||0x1f4;return function(_0x21e69a){logger[_0x0691('0x22')](_0x21e69a[_0x0691('0x23')]);if(_0x21e69a[_0x0691('0x24')]){delete _0x21e69a['name'];}_0xa34b5b[_0x0691('0x18')](_0x3bb3bf)[_0x0691('0x25')](_0x21e69a);};}exports[_0x0691('0x26')]=function(_0x4db5e4,_0xc8d65b){var _0x4b7705={'raw':!![],'where':{'id':_0x4db5e4[_0x0691('0x27')]['id']}},_0x2858d2={};_0x2858d2[_0x0691('0x28')]=_[_0x0691('0x29')](db['ChatApplication'][_0x0691('0x2a')]);_0x2858d2[_0x0691('0x2b')]=_[_0x0691('0x29')](_0x4db5e4[_0x0691('0x2b')]);_0x2858d2[_0x0691('0x2c')]=_[_0x0691('0x2d')](_0x2858d2[_0x0691('0x28')],_0x2858d2[_0x0691('0x2b')]);_0x4b7705[_0x0691('0x2e')]=_['intersection'](_0x2858d2[_0x0691('0x28')],qs['fields'](_0x4db5e4[_0x0691('0x2b')][_0x0691('0x2f')]));_0x4b7705[_0x0691('0x2e')]=_0x4b7705[_0x0691('0x2e')]['length']?_0x4b7705['attributes']:_0x2858d2['model'];if(_0x4db5e4[_0x0691('0x2b')]['includeAll']){_0x4b7705['include']=[{'all':!![]}];}_0x4b7705=_[_0x0691('0x30')]({},_0x4b7705,_0x4db5e4[_0x0691('0x31')]);return db[_0x0691('0x32')][_0x0691('0x33')](_0x4b7705)[_0x0691('0x20')](handleEntityNotFound(_0xc8d65b,null))[_0x0691('0x20')](respondWithResult(_0xc8d65b,null))[_0x0691('0x34')](handleError(_0xc8d65b,null));};exports[_0x0691('0x35')]=function(_0x38009b,_0x202db9){if(_0x38009b[_0x0691('0x36')]['id']){delete _0x38009b[_0x0691('0x36')]['id'];}return db['ChatApplication'][_0x0691('0x33')]({'where':{'id':_0x38009b[_0x0691('0x27')]['id']}})['then'](handleEntityNotFound(_0x202db9,null))[_0x0691('0x20')](saveUpdates(_0x38009b[_0x0691('0x36')],null))['then'](respondWithResult(_0x202db9,null))[_0x0691('0x34')](handleError(_0x202db9,null));};exports['destroy']=function(_0x854c97,_0x1e05eb){return db[_0x0691('0x32')][_0x0691('0x33')]({'where':{'id':_0x854c97[_0x0691('0x27')]['id']}})[_0x0691('0x20')](handleEntityNotFound(_0x1e05eb,null))[_0x0691('0x20')](removeEntity(_0x1e05eb,null))[_0x0691('0x34')](handleError(_0x1e05eb,null));}; \ No newline at end of file +var _0x06c6=['then','destroy','end','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x06c6,0xd7));var _0x606c=function(_0x5a0ed2,_0x1efef5){_0x5a0ed2=_0x5a0ed2-0x0;var _0x57a2b3=_0x06c6[_0x5a0ed2];return _0x57a2b3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x606c('0x0'));var rimraf=require(_0x606c('0x1'));var zipdir=require(_0x606c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x606c('0x3'));var moment=require(_0x606c('0x4'));var BPromise=require(_0x606c('0x5'));var Mustache=require(_0x606c('0x6'));var util=require(_0x606c('0x7'));var path=require(_0x606c('0x8'));var sox=require(_0x606c('0x9'));var csv=require(_0x606c('0xa'));var ejs=require(_0x606c('0xb'));var fs=require('fs');var _=require(_0x606c('0xc'));var squel=require('squel');var crypto=require(_0x606c('0xd'));var jsforce=require(_0x606c('0xe'));var deskjs=require(_0x606c('0xf'));var toCsv=require(_0x606c('0xa'));var querystring=require(_0x606c('0x10'));var Papa=require(_0x606c('0x11'));var Redis=require(_0x606c('0x12'));var authService=require(_0x606c('0x13'));var qs=require(_0x606c('0x14'));var hardwareService=require(_0x606c('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x606c('0x16'));var config=require(_0x606c('0x17'));var db=require(_0x606c('0x18'))['db'];function respondWithStatusCode(_0xfc5547,_0x3b0c3e){_0x3b0c3e=_0x3b0c3e||0xcc;return function(_0x4184c5){if(_0x4184c5){return _0xfc5547[_0x606c('0x19')](_0x3b0c3e);}return _0xfc5547[_0x606c('0x1a')](_0x3b0c3e)['end']();};}function respondWithResult(_0x29ac35,_0x31e667){_0x31e667=_0x31e667||0xc8;return function(_0x2c9d8a){if(_0x2c9d8a){return _0x29ac35[_0x606c('0x1a')](_0x31e667)[_0x606c('0x1b')](_0x2c9d8a);}};}function respondWithFilteredResult(_0x1ac233,_0x4f9663){return function(_0xb899f8){if(_0xb899f8){var _0x350d8d=_0xb899f8[_0x606c('0x1c')],_0x5839f7=_0x4f9663['offset'],_0x46f2de=_0x4f9663[_0x606c('0x1d')]+_0x4f9663[_0x606c('0x1e')],_0x39128f;if(_0x46f2de>=_0x350d8d){_0x46f2de=_0x350d8d;_0x39128f=0xc8;}else{_0x39128f=0xce;}_0x1ac233[_0x606c('0x1a')](_0x39128f);return _0x1ac233[_0x606c('0x1f')](_0x606c('0x20'),_0x5839f7+'-'+_0x46f2de+'/'+_0x350d8d)['json'](_0xb899f8);}return null;};}function patchUpdates(_0x4dabe4){return function(_0x4f0b10){try{jsonpatch[_0x606c('0x21')](_0x4f0b10,_0x4dabe4,!![]);}catch(_0x3adada){return BPromise[_0x606c('0x22')](_0x3adada);}return _0x4f0b10[_0x606c('0x23')]();};}function saveUpdates(_0xfc1c6b,_0xb66a51){return function(_0x46c9e5){if(_0x46c9e5){return _0x46c9e5[_0x606c('0x24')](_0xfc1c6b)[_0x606c('0x25')](function(_0x478731){return _0x478731;});}return null;};}function removeEntity(_0x142696,_0x312fa0){return function(_0x145faf){if(_0x145faf){return _0x145faf[_0x606c('0x26')]()[_0x606c('0x25')](function(){_0x142696[_0x606c('0x1a')](0xcc)[_0x606c('0x27')]();});}};}function handleEntityNotFound(_0xa58008,_0x4ccc40){return function(_0x5f1526){if(!_0x5f1526){_0xa58008[_0x606c('0x19')](0x194);}return _0x5f1526;};}function handleError(_0xcc302a,_0x16a5f6){_0x16a5f6=_0x16a5f6||0x1f4;return function(_0x325fe9){logger[_0x606c('0x28')](_0x325fe9[_0x606c('0x29')]);if(_0x325fe9[_0x606c('0x2a')]){delete _0x325fe9[_0x606c('0x2a')];}_0xcc302a[_0x606c('0x1a')](_0x16a5f6)[_0x606c('0x2b')](_0x325fe9);};}exports[_0x606c('0x2c')]=function(_0x532dfd,_0x202cd6){var _0x35a650={'raw':!![],'where':{'id':_0x532dfd[_0x606c('0x2d')]['id']}},_0x508464={};_0x508464[_0x606c('0x2e')]=_[_0x606c('0x2f')](db[_0x606c('0x30')][_0x606c('0x31')]);_0x508464[_0x606c('0x32')]=_[_0x606c('0x2f')](_0x532dfd['query']);_0x508464[_0x606c('0x33')]=_[_0x606c('0x34')](_0x508464[_0x606c('0x2e')],_0x508464[_0x606c('0x32')]);_0x35a650['attributes']=_[_0x606c('0x34')](_0x508464['model'],qs[_0x606c('0x35')](_0x532dfd[_0x606c('0x32')]['fields']));_0x35a650[_0x606c('0x36')]=_0x35a650[_0x606c('0x36')][_0x606c('0x37')]?_0x35a650[_0x606c('0x36')]:_0x508464['model'];if(_0x532dfd[_0x606c('0x32')][_0x606c('0x38')]){_0x35a650[_0x606c('0x39')]=[{'all':!![]}];}_0x35a650=_[_0x606c('0x3a')]({},_0x35a650,_0x532dfd[_0x606c('0x3b')]);return db[_0x606c('0x30')][_0x606c('0x3c')](_0x35a650)[_0x606c('0x25')](handleEntityNotFound(_0x202cd6,null))['then'](respondWithResult(_0x202cd6,null))[_0x606c('0x3d')](handleError(_0x202cd6,null));};exports[_0x606c('0x24')]=function(_0x399c1b,_0x4f7337){if(_0x399c1b[_0x606c('0x3e')]['id']){delete _0x399c1b['body']['id'];}return db['ChatApplication']['find']({'where':{'id':_0x399c1b[_0x606c('0x2d')]['id']}})[_0x606c('0x25')](handleEntityNotFound(_0x4f7337,null))[_0x606c('0x25')](saveUpdates(_0x399c1b[_0x606c('0x3e')],null))['then'](respondWithResult(_0x4f7337,null))[_0x606c('0x3d')](handleError(_0x4f7337,null));};exports[_0x606c('0x26')]=function(_0x54a2f0,_0x46f03c){return db[_0x606c('0x30')][_0x606c('0x3c')]({'where':{'id':_0x54a2f0[_0x606c('0x2d')]['id']}})[_0x606c('0x25')](handleEntityNotFound(_0x46f03c,null))['then'](removeEntity(_0x46f03c,null))[_0x606c('0x3d')](handleError(_0x46f03c,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 09a3dd7..b4f6377 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file +var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index f69eb6c..6c8e542 100644 --- a/server/api/chatApplication/chatApplication.rpc.js +++ b/server/api/chatApplication/chatApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa920=['request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xa920,0x1bd));var _0x0a92=function(_0x474e05,_0x31cae6){_0x474e05=_0x474e05-0x0;var _0x11c912=_0xa920[_0x474e05];return _0x11c912;};'use strict';var _=require(_0x0a92('0x0'));var util=require('util');var moment=require(_0x0a92('0x1'));var BPromise=require('bluebird');var rs=require(_0x0a92('0x2'));var fs=require('fs');var Redis=require(_0x0a92('0x3'));var db=require(_0x0a92('0x4'))['db'];var utils=require(_0x0a92('0x5'));var logger=require(_0x0a92('0x6'))(_0x0a92('0x7'));var config=require(_0x0a92('0x8'));var jayson=require(_0x0a92('0x9'));var client=jayson[_0x0a92('0xa')][_0x0a92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20c1fa,_0x1b5383,_0x2e8d4e){return new BPromise(function(_0x495f38,_0x2b6dc2){return client[_0x0a92('0xc')](_0x20c1fa,_0x2e8d4e)['then'](function(_0x461b8c){logger[_0x0a92('0xd')](_0x0a92('0xe'),_0x1b5383,_0x0a92('0xf'));logger[_0x0a92('0x10')](_0x0a92('0x11'),_0x1b5383,_0x0a92('0xf'),JSON[_0x0a92('0x12')](_0x461b8c));if(_0x461b8c[_0x0a92('0x13')]){if(_0x461b8c[_0x0a92('0x13')][_0x0a92('0x14')]===0x1f4){logger[_0x0a92('0x13')]('ChatApplication,\x20%s,\x20%s',_0x1b5383,_0x461b8c[_0x0a92('0x13')][_0x0a92('0x15')]);return _0x2b6dc2(_0x461b8c[_0x0a92('0x13')]['message']);}logger['error'](_0x0a92('0xe'),_0x1b5383,_0x461b8c[_0x0a92('0x13')][_0x0a92('0x15')]);return _0x495f38(_0x461b8c[_0x0a92('0x13')][_0x0a92('0x15')]);}else{logger[_0x0a92('0xd')](_0x0a92('0xe'),_0x1b5383,_0x0a92('0xf'));_0x495f38(_0x461b8c['result']['message']);}})[_0x0a92('0x16')](function(_0x5afe16){logger['error'](_0x0a92('0xe'),_0x1b5383,_0x5afe16);_0x2b6dc2(_0x5afe16);});});} \ No newline at end of file +var _0x53e4=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x52a505,_0x5dec98){var _0x1fc95e=function(_0xdc7744){while(--_0xdc7744){_0x52a505['push'](_0x52a505['shift']());}};_0x1fc95e(++_0x5dec98);}(_0x53e4,0x8d));var _0x453e=function(_0x40df90,_0x5e0e67){_0x40df90=_0x40df90-0x0;var _0x964ccd=_0x53e4[_0x40df90];return _0x964ccd;};'use strict';var _=require(_0x453e('0x0'));var util=require(_0x453e('0x1'));var moment=require('moment');var BPromise=require(_0x453e('0x2'));var rs=require(_0x453e('0x3'));var fs=require('fs');var Redis=require(_0x453e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x453e('0x5'));var logger=require('../../config/logger')(_0x453e('0x6'));var config=require(_0x453e('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43a7d7,_0x4863e9,_0x326d28){return new BPromise(function(_0x25a530,_0x17a4a9){return client[_0x453e('0x8')](_0x43a7d7,_0x326d28)['then'](function(_0x5c672a){logger[_0x453e('0x9')](_0x453e('0xa'),_0x4863e9,_0x453e('0xb'));logger[_0x453e('0xc')](_0x453e('0xd'),_0x4863e9,_0x453e('0xb'),JSON[_0x453e('0xe')](_0x5c672a));if(_0x5c672a[_0x453e('0xf')]){if(_0x5c672a['error'][_0x453e('0x10')]===0x1f4){logger['error'](_0x453e('0xa'),_0x4863e9,_0x5c672a[_0x453e('0xf')]['message']);return _0x17a4a9(_0x5c672a['error'][_0x453e('0x11')]);}logger[_0x453e('0xf')]('ChatApplication,\x20%s,\x20%s',_0x4863e9,_0x5c672a['error'][_0x453e('0x11')]);return _0x25a530(_0x5c672a[_0x453e('0xf')][_0x453e('0x11')]);}else{logger[_0x453e('0x9')]('ChatApplication,\x20%s,\x20%s',_0x4863e9,_0x453e('0xb'));_0x25a530(_0x5c672a[_0x453e('0x12')][_0x453e('0x11')]);}})[_0x453e('0x13')](function(_0x4ff5c5){logger[_0x453e('0xf')]('ChatApplication,\x20%s,\x20%s',_0x4863e9,_0x4ff5c5);_0x17a4a9(_0x4ff5c5);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 60be8ae..3d31444 100644 --- a/server/api/chatApplication/index.js +++ b/server/api/chatApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6bfa=['Router','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3b81eb,_0x175f32){var _0x149491=function(_0x454753){while(--_0x454753){_0x3b81eb['push'](_0x3b81eb['shift']());}};_0x149491(++_0x175f32);}(_0x6bfa,0x1d7));var _0xa6bf=function(_0x9bf5b9,_0x129b0f){_0x9bf5b9=_0x9bf5b9-0x0;var _0xdf1f35=_0x6bfa[_0x9bf5b9];return _0xdf1f35;};'use strict';var multer=require(_0xa6bf('0x0'));var util=require(_0xa6bf('0x1'));var path=require(_0xa6bf('0x2'));var timeout=require(_0xa6bf('0x3'));var express=require(_0xa6bf('0x4'));var router=express[_0xa6bf('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa6bf('0x6'));var config=require(_0xa6bf('0x7'));var controller=require(_0xa6bf('0x8'));router['get'](_0xa6bf('0x9'),auth[_0xa6bf('0xa')](),controller[_0xa6bf('0xb')]);router[_0xa6bf('0xc')]('/:id',auth[_0xa6bf('0xa')](),controller[_0xa6bf('0xd')]);router[_0xa6bf('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa6bf('0xf')]);module[_0xa6bf('0x10')]=router; \ No newline at end of file +var _0xe331=['/:id','isAuthenticated','show','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get'];(function(_0x4a67e5,_0x920af4){var _0x52a7dd=function(_0x5a8c64){while(--_0x5a8c64){_0x4a67e5['push'](_0x4a67e5['shift']());}};_0x52a7dd(++_0x920af4);}(_0xe331,0x66));var _0x1e33=function(_0x2645b5,_0x2d8c84){_0x2645b5=_0x2645b5-0x0;var _0x46c7cb=_0xe331[_0x2645b5];return _0x46c7cb;};'use strict';var multer=require('multer');var util=require(_0x1e33('0x0'));var path=require(_0x1e33('0x1'));var timeout=require(_0x1e33('0x2'));var express=require(_0x1e33('0x3'));var router=express[_0x1e33('0x4')]();var auth=require(_0x1e33('0x5'));var interaction=require(_0x1e33('0x6'));var config=require(_0x1e33('0x7'));var controller=require(_0x1e33('0x8'));router[_0x1e33('0x9')](_0x1e33('0xa'),auth[_0x1e33('0xb')](),controller[_0x1e33('0xc')]);router[_0x1e33('0xd')](_0x1e33('0xa'),auth['isAuthenticated'](),controller[_0x1e33('0xe')]);router[_0x1e33('0xf')](_0x1e33('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 5ac02af..93cbad5 100644 --- a/server/api/chatGroup/chatGroup.attributes.js +++ b/server/api/chatGroup/chatGroup.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x403d=['BOOLEAN','sequelize','STRING'];(function(_0x48c7b9,_0x3c7f06){var _0x43e335=function(_0x17baa8){while(--_0x17baa8){_0x48c7b9['push'](_0x48c7b9['shift']());}};_0x43e335(++_0x3c7f06);}(_0x403d,0x6d));var _0xd403=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0x403d[_0x555b2f];return _0x81c0a6;};'use strict';var Sequelize=require(_0xd403('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd403('0x1')]},'write':{'type':Sequelize[_0xd403('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xeb6b=['exports','STRING'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xeb6b,0xe4));var _0xbeb6=function(_0x50c266,_0x501dae){_0x50c266=_0x50c266-0x0;var _0x5808e7=_0xeb6b[_0x50c266];return _0x5808e7;};'use strict';var Sequelize=require('sequelize');module[_0xbeb6('0x0')]={'name':{'type':Sequelize[_0xbeb6('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xbeb6('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 3ee9a17..39d2de4 100644 --- a/server/api/chatGroup/chatGroup.controller.js +++ b/server/api/chatGroup/chatGroup.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5847=['ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','http','test','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send','index','ChatGroup','rawAttributes','filters','model','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','User','sort','removeMembers','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','desk.js','papaparse'];(function(_0x4f53c3,_0x509b92){var _0xc0c037=function(_0x2c3f3d){while(--_0x2c3f3d){_0x4f53c3['push'](_0x4f53c3['shift']());}};_0xc0c037(++_0x509b92);}(_0x5847,0xbe));var _0x7584=function(_0x146365,_0x548eb7){_0x146365=_0x146365-0x0;var _0x5ac529=_0x5847[_0x146365];return _0x5ac529;};'use strict';var pdf=require(_0x7584('0x0'));var emlformat=require(_0x7584('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7584('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7584('0x3'));var moment=require(_0x7584('0x4'));var BPromise=require(_0x7584('0x5'));var Mustache=require(_0x7584('0x6'));var util=require(_0x7584('0x7'));var path=require('path');var sox=require(_0x7584('0x8'));var csv=require(_0x7584('0x9'));var ejs=require(_0x7584('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7584('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7584('0xc'));var toCsv=require(_0x7584('0x9'));var querystring=require('querystring');var Papa=require(_0x7584('0xd'));var Redis=require(_0x7584('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7584('0xf'));var hardwareService=require(_0x7584('0x10'));var logger=require('../../config/logger')(_0x7584('0x11'));var utils=require(_0x7584('0x12'));var config=require(_0x7584('0x13'));var db=require(_0x7584('0x14'))['db'];config[_0x7584('0x15')]=_['defaults'](config[_0x7584('0x15')],{'host':_0x7584('0x16'),'port':0x18eb});var socket=require(_0x7584('0x17'))(new Redis(config['redis']));require(_0x7584('0x18'))[_0x7584('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7584('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x14dd83,_0x2fde35,_0x46ec60){if(_0x46ec60){var _0x20236c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20236c[_0x7584('0x1b')](_0x2fde35)){return _0x14dd83;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x14dd83;}}function respondWithRpcPromise(_0x530f66,_0x36ccf3,_0x11fe99,_0x580bfb){return new BPromise(function(_0x667774,_0xdddfaa){var _0x36ecda=_0x580bfb||client;return _0x36ecda[_0x7584('0x1c')](_0x530f66,_0x11fe99)['then'](function(_0x19d0f1){logger[_0x7584('0x1d')](_0x7584('0x1e'),_0x36ccf3,_0x7584('0x1f'));logger[_0x7584('0x20')](_0x7584('0x21'),_0x36ccf3,_0x7584('0x1f'),JSON['stringify'](_0x19d0f1));if(_0x19d0f1[_0x7584('0x22')]){if(_0x19d0f1[_0x7584('0x22')][_0x7584('0x23')]===0x1f4){logger[_0x7584('0x22')]('ChatGroup,\x20%s,\x20%s',_0x36ccf3,_0x19d0f1['error'][_0x7584('0x24')]);return _0xdddfaa(_0x19d0f1['error'][_0x7584('0x24')]);}logger[_0x7584('0x22')](_0x7584('0x1e'),_0x36ccf3,_0x19d0f1['error'][_0x7584('0x24')]);return _0x667774(_0x19d0f1['error']['message']);}else{logger[_0x7584('0x1d')](_0x7584('0x1e'),_0x36ccf3,_0x7584('0x1f'));_0x667774(_0x19d0f1['result'][_0x7584('0x24')]);}})['catch'](function(_0x4ee519){logger['error'](_0x7584('0x1e'),_0x36ccf3,_0x4ee519);_0xdddfaa(_0x4ee519);});});}function respondWithStatusCode(_0xffa38c,_0x538fc6){_0x538fc6=_0x538fc6||0xcc;return function(_0x3ceae7){if(_0x3ceae7){return _0xffa38c[_0x7584('0x25')](_0x538fc6);}return _0xffa38c[_0x7584('0x26')](_0x538fc6)['end']();};}function respondWithResult(_0x1fe65d,_0x4f565d){_0x4f565d=_0x4f565d||0xc8;return function(_0x250d7e){if(_0x250d7e){return _0x1fe65d[_0x7584('0x26')](_0x4f565d)['json'](_0x250d7e);}};}function respondWithFilteredResult(_0x279b47,_0x1cd321){return function(_0xf477eb){if(_0xf477eb){var _0x751857=_0xf477eb[_0x7584('0x27')],_0x17560d=_0x1cd321[_0x7584('0x28')],_0x55ac1f=_0x1cd321[_0x7584('0x28')]+_0x1cd321['limit'],_0x4e34f6;if(_0x55ac1f>=_0x751857){_0x55ac1f=_0x751857;_0x4e34f6=0xc8;}else{_0x4e34f6=0xce;}_0x279b47[_0x7584('0x26')](_0x4e34f6);return _0x279b47[_0x7584('0x29')](_0x7584('0x2a'),_0x17560d+'-'+_0x55ac1f+'/'+_0x751857)[_0x7584('0x2b')](_0xf477eb);}return null;};}function patchUpdates(_0x48b256){return function(_0x63e77){try{jsonpatch[_0x7584('0x2c')](_0x63e77,_0x48b256,!![]);}catch(_0x4ee0d9){return BPromise[_0x7584('0x2d')](_0x4ee0d9);}return _0x63e77[_0x7584('0x2e')]();};}function saveUpdates(_0x517c84,_0x489cba){return function(_0xb70103){if(_0xb70103){return _0xb70103[_0x7584('0x2f')](_0x517c84)[_0x7584('0x30')](function(_0x37580f){return _0x37580f;});}return null;};}function removeEntity(_0x2e38a4,_0x17c783){return function(_0x2e0151){if(_0x2e0151){return _0x2e0151[_0x7584('0x31')]()[_0x7584('0x30')](function(){_0x2e38a4[_0x7584('0x26')](0xcc)[_0x7584('0x32')]();});}};}function handleEntityNotFound(_0x1aceba,_0x616be4){return function(_0x4e1849){if(!_0x4e1849){_0x1aceba[_0x7584('0x25')](0x194);}return _0x4e1849;};}function handleError(_0x5ce213,_0x19ef08){_0x19ef08=_0x19ef08||0x1f4;return function(_0x13e857){logger[_0x7584('0x22')](_0x13e857['stack']);if(_0x13e857[_0x7584('0x33')]){delete _0x13e857['name'];}_0x5ce213[_0x7584('0x26')](_0x19ef08)[_0x7584('0x34')](_0x13e857);};}exports[_0x7584('0x35')]=function(_0x1b1a74,_0x289216){var _0x4becce={},_0x13ac70={},_0x14949a={'count':0x0,'rows':[]};var _0x2e261a=db[_0x7584('0x36')][_0x7584('0x37')];_0x13ac70['model']=_['keys'](_0x2e261a);_0x13ac70['query']=_['keys'](_0x1b1a74['query']);_0x13ac70[_0x7584('0x38')]=_['intersection'](_0x13ac70[_0x7584('0x39')],_0x13ac70['query']);_0x4becce[_0x7584('0x3a')]=_[_0x7584('0x3b')](_0x13ac70[_0x7584('0x39')],qs[_0x7584('0x3c')](_0x1b1a74[_0x7584('0x3d')]['fields']));_0x4becce['attributes']=_0x4becce[_0x7584('0x3a')][_0x7584('0x3e')]?_0x4becce[_0x7584('0x3a')]:_0x13ac70['model'];if(!_0x1b1a74[_0x7584('0x3d')][_0x7584('0x3f')](_0x7584('0x40'))){_0x4becce['limit']=qs['limit'](_0x1b1a74['query'][_0x7584('0x41')]);_0x4becce['offset']=qs[_0x7584('0x28')](_0x1b1a74[_0x7584('0x3d')][_0x7584('0x28')]);}_0x4becce[_0x7584('0x42')]=qs['sort'](_0x1b1a74[_0x7584('0x3d')]['sort']);_0x4becce[_0x7584('0x43')]=qs[_0x7584('0x38')](_[_0x7584('0x44')](_0x1b1a74[_0x7584('0x3d')],_0x13ac70[_0x7584('0x38')]));if(_0x1b1a74[_0x7584('0x3d')][_0x7584('0x45')]){_0x4becce['where']=_[_0x7584('0x46')](_0x4becce['where'],{'$or':_[_0x7584('0x47')](_0x2e261a,function(_0x2d6ef2){if(_0x2d6ef2[_0x7584('0x48')]['key']!==_0x7584('0x49')){var _0x15ac8f={};_0x15ac8f[_0x2d6ef2[_0x7584('0x4a')]]={'$like':'%'+_0x1b1a74[_0x7584('0x3d')][_0x7584('0x45')]+'%'};return _0x15ac8f;}})});}_0x4becce=_[_0x7584('0x46')]({},_0x4becce,_0x1b1a74[_0x7584('0x4b')]);var _0x5c5259={'where':_0x4becce[_0x7584('0x43')]};return db['ChatGroup'][_0x7584('0x27')](_0x5c5259)[_0x7584('0x30')](function(_0x55bc14){_0x14949a[_0x7584('0x27')]=_0x55bc14;if(_0x1b1a74[_0x7584('0x3d')][_0x7584('0x4c')]){_0x4becce[_0x7584('0x4d')]=[{'all':!![]}];}return db['ChatGroup'][_0x7584('0x4e')](_0x4becce);})['then'](function(_0x2d10ed){_0x14949a['rows']=_0x2d10ed;return _0x14949a;})[_0x7584('0x30')](respondWithFilteredResult(_0x289216,_0x4becce))[_0x7584('0x4f')](handleError(_0x289216,null));};exports[_0x7584('0x50')]=function(_0x552b60,_0x41f0cf){var _0x4d4b45={'raw':!![],'where':{'id':_0x552b60[_0x7584('0x51')]['id']}},_0x635da={};_0x635da[_0x7584('0x39')]=_['keys'](db[_0x7584('0x36')]['rawAttributes']);_0x635da[_0x7584('0x3d')]=_[_0x7584('0x52')](_0x552b60['query']);_0x635da[_0x7584('0x38')]=_['intersection'](_0x635da[_0x7584('0x39')],_0x635da[_0x7584('0x3d')]);_0x4d4b45[_0x7584('0x3a')]=_['intersection'](_0x635da[_0x7584('0x39')],qs[_0x7584('0x3c')](_0x552b60[_0x7584('0x3d')][_0x7584('0x3c')]));_0x4d4b45[_0x7584('0x3a')]=_0x4d4b45[_0x7584('0x3a')][_0x7584('0x3e')]?_0x4d4b45[_0x7584('0x3a')]:_0x635da['model'];if(_0x552b60[_0x7584('0x3d')][_0x7584('0x4c')]){_0x4d4b45[_0x7584('0x4d')]=[{'all':!![]}];}_0x4d4b45=_[_0x7584('0x46')]({},_0x4d4b45,_0x552b60['options']);return db[_0x7584('0x36')][_0x7584('0x53')](_0x4d4b45)[_0x7584('0x30')](handleEntityNotFound(_0x41f0cf,null))['then'](respondWithResult(_0x41f0cf,null))[_0x7584('0x4f')](handleError(_0x41f0cf,null));};exports[_0x7584('0x54')]=function(_0x19f5aa,_0x2e25a6){return db[_0x7584('0x36')]['create'](_0x19f5aa[_0x7584('0x55')],{})[_0x7584('0x30')](respondWithResult(_0x2e25a6,0xc9))['catch'](handleError(_0x2e25a6,null));};exports['update']=function(_0x25f8b2,_0x511e42){if(_0x25f8b2[_0x7584('0x55')]['id']){delete _0x25f8b2[_0x7584('0x55')]['id'];}return db[_0x7584('0x36')]['find']({'where':{'id':_0x25f8b2['params']['id']}})[_0x7584('0x30')](handleEntityNotFound(_0x511e42,null))['then'](saveUpdates(_0x25f8b2[_0x7584('0x55')],null))['then'](respondWithResult(_0x511e42,null))['catch'](handleError(_0x511e42,null));};exports[_0x7584('0x31')]=function(_0x5ca460,_0x45856c){return db[_0x7584('0x36')][_0x7584('0x53')]({'where':{'id':_0x5ca460['params']['id']}})[_0x7584('0x30')](handleEntityNotFound(_0x45856c,null))['then'](removeEntity(_0x45856c,null))[_0x7584('0x4f')](handleError(_0x45856c,null));};exports['describe']=function(_0x38493e,_0x244a9b){return db['ChatGroup'][_0x7584('0x56')]()[_0x7584('0x30')](respondWithResult(_0x244a9b,null))[_0x7584('0x4f')](handleError(_0x244a9b,null));};exports[_0x7584('0x57')]=function(_0x494606,_0x5aea8d,_0xbaf0ce){return db[_0x7584('0x58')][_0x7584('0x27')]({'where':{'ChatGroupId':_0x494606[_0x7584('0x51')]['id'],'ToId':_0x494606['user']['id'],'read':![]}})[_0x7584('0x30')](function(_0x16084f){return{'id':_[_0x7584('0x59')](_0x494606[_0x7584('0x51')]['id']),'count':_0x16084f};})['then'](respondWithResult(_0x5aea8d,null))[_0x7584('0x4f')](handleError(_0x5aea8d,null));};exports[_0x7584('0x5a')]=function(_0x446191,_0x430480,_0x12eb86){return db[_0x7584('0x36')][_0x7584('0x53')]({'where':{'id':_0x446191['params']['id']}})[_0x7584('0x30')](handleEntityNotFound(_0x430480,null))[_0x7584('0x30')](function(_0x361079){if(_0x361079){return _0x361079['addMembers'](_0x446191[_0x7584('0x55')][_0x7584('0x5b')],_[_0x7584('0x5c')](_0x446191[_0x7584('0x55')],[_0x7584('0x5b'),'id'])||{});}})[_0x7584('0x30')](respondWithResult(_0x430480,null))[_0x7584('0x4f')](handleError(_0x430480,null));};exports[_0x7584('0x5d')]=function(_0x28f9b5,_0x28e36e,_0x3b72c3){var _0x1b1a8c={};var _0x364fd5={};var _0x3e41d4;var _0x4f53f9;return db[_0x7584('0x36')]['findOne']({'where':{'id':_0x28f9b5[_0x7584('0x51')]['id']}})['then'](handleEntityNotFound(_0x28e36e,null))[_0x7584('0x30')](function(_0x3697cb){if(_0x3697cb){_0x3e41d4=_0x3697cb;_0x364fd5[_0x7584('0x39')]=_['keys'](db[_0x7584('0x5e')][_0x7584('0x37')]);_0x364fd5[_0x7584('0x3d')]=_[_0x7584('0x52')](_0x28f9b5[_0x7584('0x3d')]);_0x364fd5[_0x7584('0x38')]=_[_0x7584('0x3b')](_0x364fd5[_0x7584('0x39')],_0x364fd5[_0x7584('0x3d')]);_0x1b1a8c['attributes']=_[_0x7584('0x3b')](_0x364fd5[_0x7584('0x39')],qs[_0x7584('0x3c')](_0x28f9b5[_0x7584('0x3d')][_0x7584('0x3c')]));_0x1b1a8c['attributes']=_0x1b1a8c[_0x7584('0x3a')]['length']?_0x1b1a8c[_0x7584('0x3a')]:_0x364fd5[_0x7584('0x39')];_0x1b1a8c[_0x7584('0x42')]=qs[_0x7584('0x5f')](_0x28f9b5[_0x7584('0x3d')][_0x7584('0x5f')]);_0x1b1a8c[_0x7584('0x43')]=qs[_0x7584('0x38')](_[_0x7584('0x44')](_0x28f9b5[_0x7584('0x3d')],_0x364fd5[_0x7584('0x38')]));if(_0x28f9b5[_0x7584('0x3d')][_0x7584('0x45')]){_0x1b1a8c[_0x7584('0x43')]=_[_0x7584('0x46')](_0x1b1a8c[_0x7584('0x43')],{'$or':_['map'](_0x1b1a8c['attributes'],function(_0x428d5c){var _0x1d9a63={};_0x1d9a63[_0x428d5c]={'$like':'%'+_0x28f9b5[_0x7584('0x3d')][_0x7584('0x45')]+'%'};return _0x1d9a63;})});}_0x1b1a8c=_[_0x7584('0x46')]({},_0x1b1a8c,_0x28f9b5[_0x7584('0x4b')]);return _0x3e41d4[_0x7584('0x5d')](_0x1b1a8c);}})[_0x7584('0x30')](function(_0x428443){if(_0x428443){_0x4f53f9=_0x428443[_0x7584('0x3e')];if(!_0x28f9b5[_0x7584('0x3d')][_0x7584('0x3f')]('nolimit')){_0x1b1a8c[_0x7584('0x41')]=qs['limit'](_0x28f9b5[_0x7584('0x3d')][_0x7584('0x41')]);_0x1b1a8c[_0x7584('0x28')]=qs[_0x7584('0x28')](_0x28f9b5[_0x7584('0x3d')]['offset']);}return _0x3e41d4['getMembers'](_0x1b1a8c);}})[_0x7584('0x30')](function(_0x1e8577){if(_0x1e8577){return _0x1e8577?{'count':_0x4f53f9,'rows':_0x1e8577}:null;}})[_0x7584('0x30')](respondWithResult(_0x28e36e,null))[_0x7584('0x4f')](handleError(_0x28e36e,null));};exports[_0x7584('0x60')]=function(_0x17874f,_0x47321b,_0x29562b){return db['ChatGroup'][_0x7584('0x53')]({'where':{'id':_0x17874f['params']['id']}})[_0x7584('0x30')](handleEntityNotFound(_0x47321b,null))[_0x7584('0x30')](function(_0x1770cc){if(_0x1770cc){return _0x1770cc[_0x7584('0x60')](_0x17874f[_0x7584('0x3d')][_0x7584('0x5b')]);}})['then'](respondWithStatusCode(_0x47321b,null))['catch'](handleError(_0x47321b,null));};exports['addMessage']=function(_0x157315,_0x56698b,_0x20427c){if(_0x157315[_0x7584('0x55')]['id']){delete _0x157315[_0x7584('0x55')]['id'];}return db['ChatGroup'][_0x7584('0x53')]({'where':{'id':_0x157315[_0x7584('0x51')]['id']}})[_0x7584('0x30')](handleEntityNotFound(_0x56698b,null))[_0x7584('0x30')](function(_0x542c6d){if(_0x542c6d){_0x157315['body'][_0x7584('0x61')]=_0x542c6d['id'];return db['ChatInternalMessage'][_0x7584('0x54')](_0x157315[_0x7584('0x55')]);}})[_0x7584('0x30')](respondWithResult(_0x56698b,null))[_0x7584('0x4f')](handleError(_0x56698b,null));};exports[_0x7584('0x62')]=function(_0x2fce9d,_0x1c811f,_0x1a7aa7){var _0x19b320={};var _0x25c35a={};var _0x4c6c74;var _0x32eee9;return db[_0x7584('0x36')]['findOne']({'where':{'id':_0x2fce9d[_0x7584('0x51')]['id']}})['then'](handleEntityNotFound(_0x1c811f,null))[_0x7584('0x30')](function(_0x50f653){if(_0x50f653){_0x4c6c74=_0x50f653;_0x25c35a[_0x7584('0x39')]=_[_0x7584('0x52')](db['ChatInternalMessage'][_0x7584('0x37')]);_0x25c35a[_0x7584('0x3d')]=_[_0x7584('0x52')](_0x2fce9d[_0x7584('0x3d')]);_0x25c35a['filters']=_[_0x7584('0x3b')](_0x25c35a['model'],_0x25c35a[_0x7584('0x3d')]);_0x19b320[_0x7584('0x3a')]=_[_0x7584('0x3b')](_0x25c35a[_0x7584('0x39')],qs['fields'](_0x2fce9d['query'][_0x7584('0x3c')]));_0x19b320['attributes']=_0x19b320[_0x7584('0x3a')][_0x7584('0x3e')]?_0x19b320['attributes']:_0x25c35a['model'];_0x19b320[_0x7584('0x42')]=qs[_0x7584('0x5f')](_0x2fce9d[_0x7584('0x3d')][_0x7584('0x5f')]);_0x19b320[_0x7584('0x43')]=qs['filters'](_[_0x7584('0x44')](_0x2fce9d[_0x7584('0x3d')],_0x25c35a[_0x7584('0x38')]));if(_0x2fce9d[_0x7584('0x3d')]['filter']){_0x19b320[_0x7584('0x43')]=_['merge'](_0x19b320['where'],{'$or':_[_0x7584('0x47')](_0x19b320['attributes'],function(_0x572a75){var _0x4d7209={};_0x4d7209[_0x572a75]={'$like':'%'+_0x2fce9d[_0x7584('0x3d')][_0x7584('0x45')]+'%'};return _0x4d7209;})});}if(_0x2fce9d[_0x7584('0x3d')]['$gte']){var _0x3f5f9c=_0x2fce9d[_0x7584('0x3d')][_0x7584('0x63')][_0x7584('0x64')](',');var _0x14a426={};_0x14a426[_0x3f5f9c[0x0]]={'$gte':moment(_0x3f5f9c[0x1])['format'](_0x7584('0x65'))};_0x19b320[_0x7584('0x43')]=_[_0x7584('0x46')](_0x19b320['where'],_0x14a426);}_0x19b320=_['merge']({},_0x19b320,_0x2fce9d[_0x7584('0x4b')]);return _0x4c6c74[_0x7584('0x62')](_0x19b320);}})[_0x7584('0x30')](function(_0x120e3c){if(_0x120e3c){_0x32eee9=_0x120e3c[_0x7584('0x3e')];if(!_0x2fce9d['query'][_0x7584('0x3f')](_0x7584('0x40'))){_0x19b320[_0x7584('0x41')]=qs[_0x7584('0x41')](_0x2fce9d[_0x7584('0x3d')][_0x7584('0x41')]);_0x19b320['offset']=qs[_0x7584('0x28')](_0x2fce9d['query'][_0x7584('0x28')]);}return _0x4c6c74[_0x7584('0x62')](_0x19b320);}})['then'](function(_0x233c45){if(_0x233c45){return _0x233c45?{'count':_0x32eee9,'rows':_0x233c45}:null;}})[_0x7584('0x30')](respondWithResult(_0x1c811f,null))[_0x7584('0x4f')](handleError(_0x1c811f,null));}; \ No newline at end of file +var _0x293a=['status','end','json','offset','limit','set','Content-Range','apply','update','then','destroy','stack','name','send','index','ChatGroup','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','key','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','params','find','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','User','map','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','sendStatus'];(function(_0x231609,_0xe15b62){var _0x36a001=function(_0x53886c){while(--_0x53886c){_0x231609['push'](_0x231609['shift']());}};_0x36a001(++_0xe15b62);}(_0x293a,0x119));var _0xa293=function(_0x241ee0,_0x3d2c4d){_0x241ee0=_0x241ee0-0x0;var _0x4f3b96=_0x293a[_0x241ee0];return _0x4f3b96;};'use strict';var pdf=require(_0xa293('0x0'));var emlformat=require(_0xa293('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa293('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa293('0x3'));var moment=require(_0xa293('0x4'));var BPromise=require(_0xa293('0x5'));var Mustache=require('mustache');var util=require(_0xa293('0x6'));var path=require(_0xa293('0x7'));var sox=require(_0xa293('0x8'));var csv=require('to-csv');var ejs=require(_0xa293('0x9'));var fs=require('fs');var _=require(_0xa293('0xa'));var squel=require(_0xa293('0xb'));var crypto=require(_0xa293('0xc'));var jsforce=require(_0xa293('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa293('0xe'));var Papa=require('papaparse');var Redis=require(_0xa293('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa293('0x10'));var logger=require(_0xa293('0x11'))(_0xa293('0x12'));var utils=require(_0xa293('0x13'));var config=require(_0xa293('0x14'));var db=require(_0xa293('0x15'))['db'];config[_0xa293('0x16')]=_[_0xa293('0x17')](config[_0xa293('0x16')],{'host':_0xa293('0x18'),'port':0x18eb});var socket=require(_0xa293('0x19'))(new Redis(config[_0xa293('0x16')]));require(_0xa293('0x1a'))['register'](socket);var jayson=require(_0xa293('0x1b'));var client=jayson['client'][_0xa293('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5f2bc2,_0x29850c,_0x53c9ca){if(_0x53c9ca){var _0x3c7b13=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3c7b13[_0xa293('0x1d')](_0x29850c)){return _0x5f2bc2;}else{throw new Error(_0xa293('0x1e'));}}else{return _0x5f2bc2;}}function respondWithRpcPromise(_0x55e276,_0x269b83,_0x4e62b1,_0x2f4abc){return new BPromise(function(_0x3c9dd5,_0x58c9a8){var _0xcd297a=_0x2f4abc||client;return _0xcd297a['request'](_0x55e276,_0x4e62b1)['then'](function(_0x503106){logger[_0xa293('0x1f')]('ChatGroup,\x20%s,\x20%s',_0x269b83,_0xa293('0x20'));logger[_0xa293('0x21')](_0xa293('0x22'),_0x269b83,_0xa293('0x20'),JSON[_0xa293('0x23')](_0x503106));if(_0x503106[_0xa293('0x24')]){if(_0x503106[_0xa293('0x24')][_0xa293('0x25')]===0x1f4){logger[_0xa293('0x24')](_0xa293('0x26'),_0x269b83,_0x503106[_0xa293('0x24')][_0xa293('0x27')]);return _0x58c9a8(_0x503106[_0xa293('0x24')][_0xa293('0x27')]);}logger[_0xa293('0x24')]('ChatGroup,\x20%s,\x20%s',_0x269b83,_0x503106[_0xa293('0x24')]['message']);return _0x3c9dd5(_0x503106[_0xa293('0x24')][_0xa293('0x27')]);}else{logger[_0xa293('0x1f')]('ChatGroup,\x20%s,\x20%s',_0x269b83,_0xa293('0x20'));_0x3c9dd5(_0x503106[_0xa293('0x28')][_0xa293('0x27')]);}})[_0xa293('0x29')](function(_0x26b31e){logger['error'](_0xa293('0x26'),_0x269b83,_0x26b31e);_0x58c9a8(_0x26b31e);});});}function respondWithStatusCode(_0x52a226,_0x11000b){_0x11000b=_0x11000b||0xcc;return function(_0x32a9ec){if(_0x32a9ec){return _0x52a226[_0xa293('0x2a')](_0x11000b);}return _0x52a226[_0xa293('0x2b')](_0x11000b)[_0xa293('0x2c')]();};}function respondWithResult(_0x176578,_0x3aa099){_0x3aa099=_0x3aa099||0xc8;return function(_0xa9c11a){if(_0xa9c11a){return _0x176578[_0xa293('0x2b')](_0x3aa099)[_0xa293('0x2d')](_0xa9c11a);}};}function respondWithFilteredResult(_0x213715,_0x491b8a){return function(_0x46c788){if(_0x46c788){var _0x15ca7a=_0x46c788['count'],_0x1b81ad=_0x491b8a['offset'],_0x1a1be4=_0x491b8a[_0xa293('0x2e')]+_0x491b8a[_0xa293('0x2f')],_0x11baf3;if(_0x1a1be4>=_0x15ca7a){_0x1a1be4=_0x15ca7a;_0x11baf3=0xc8;}else{_0x11baf3=0xce;}_0x213715[_0xa293('0x2b')](_0x11baf3);return _0x213715[_0xa293('0x30')](_0xa293('0x31'),_0x1b81ad+'-'+_0x1a1be4+'/'+_0x15ca7a)['json'](_0x46c788);}return null;};}function patchUpdates(_0x51deb5){return function(_0x25c5e5){try{jsonpatch[_0xa293('0x32')](_0x25c5e5,_0x51deb5,!![]);}catch(_0xa595a5){return BPromise['reject'](_0xa595a5);}return _0x25c5e5['save']();};}function saveUpdates(_0x23c3b4,_0x2d1a4e){return function(_0x21c9f7){if(_0x21c9f7){return _0x21c9f7[_0xa293('0x33')](_0x23c3b4)[_0xa293('0x34')](function(_0x4aa841){return _0x4aa841;});}return null;};}function removeEntity(_0x4aa99f,_0x2000a3){return function(_0x8ef3d3){if(_0x8ef3d3){return _0x8ef3d3[_0xa293('0x35')]()['then'](function(){_0x4aa99f['status'](0xcc)[_0xa293('0x2c')]();});}};}function handleEntityNotFound(_0x518d2a,_0x1b0b69){return function(_0x10bff8){if(!_0x10bff8){_0x518d2a[_0xa293('0x2a')](0x194);}return _0x10bff8;};}function handleError(_0x5a8586,_0x4a1c42){_0x4a1c42=_0x4a1c42||0x1f4;return function(_0x1731b6){logger[_0xa293('0x24')](_0x1731b6[_0xa293('0x36')]);if(_0x1731b6[_0xa293('0x37')]){delete _0x1731b6[_0xa293('0x37')];}_0x5a8586[_0xa293('0x2b')](_0x4a1c42)[_0xa293('0x38')](_0x1731b6);};}exports[_0xa293('0x39')]=function(_0x216ac5,_0x59332d){var _0x490d9b={},_0x53f634={},_0x3a9b09={'count':0x0,'rows':[]};var _0x3effe4=db[_0xa293('0x3a')][_0xa293('0x3b')];_0x53f634[_0xa293('0x3c')]=_[_0xa293('0x3d')](_0x3effe4);_0x53f634[_0xa293('0x3e')]=_['keys'](_0x216ac5['query']);_0x53f634[_0xa293('0x3f')]=_[_0xa293('0x40')](_0x53f634[_0xa293('0x3c')],_0x53f634[_0xa293('0x3e')]);_0x490d9b[_0xa293('0x41')]=_[_0xa293('0x40')](_0x53f634[_0xa293('0x3c')],qs[_0xa293('0x42')](_0x216ac5[_0xa293('0x3e')][_0xa293('0x42')]));_0x490d9b['attributes']=_0x490d9b[_0xa293('0x41')][_0xa293('0x43')]?_0x490d9b[_0xa293('0x41')]:_0x53f634[_0xa293('0x3c')];if(!_0x216ac5[_0xa293('0x3e')][_0xa293('0x44')](_0xa293('0x45'))){_0x490d9b['limit']=qs['limit'](_0x216ac5['query'][_0xa293('0x2f')]);_0x490d9b['offset']=qs[_0xa293('0x2e')](_0x216ac5[_0xa293('0x3e')][_0xa293('0x2e')]);}_0x490d9b[_0xa293('0x46')]=qs[_0xa293('0x47')](_0x216ac5[_0xa293('0x3e')][_0xa293('0x47')]);_0x490d9b['where']=qs['filters'](_[_0xa293('0x48')](_0x216ac5['query'],_0x53f634[_0xa293('0x3f')]));if(_0x216ac5[_0xa293('0x3e')][_0xa293('0x49')]){_0x490d9b[_0xa293('0x4a')]=_['merge'](_0x490d9b[_0xa293('0x4a')],{'$or':_['map'](_0x3effe4,function(_0x261ed6){if(_0x261ed6[_0xa293('0x4b')][_0xa293('0x4c')]!==_0xa293('0x4d')){var _0x44f6b3={};_0x44f6b3[_0x261ed6[_0xa293('0x4e')]]={'$like':'%'+_0x216ac5[_0xa293('0x3e')][_0xa293('0x49')]+'%'};return _0x44f6b3;}})});}_0x490d9b=_[_0xa293('0x4f')]({},_0x490d9b,_0x216ac5[_0xa293('0x50')]);var _0x8907be={'where':_0x490d9b[_0xa293('0x4a')]};return db[_0xa293('0x3a')][_0xa293('0x51')](_0x8907be)[_0xa293('0x34')](function(_0x1023a2){_0x3a9b09['count']=_0x1023a2;if(_0x216ac5[_0xa293('0x3e')][_0xa293('0x52')]){_0x490d9b[_0xa293('0x53')]=[{'all':!![]}];}return db[_0xa293('0x3a')][_0xa293('0x54')](_0x490d9b);})[_0xa293('0x34')](function(_0xd602c6){_0x3a9b09[_0xa293('0x55')]=_0xd602c6;return _0x3a9b09;})[_0xa293('0x34')](respondWithFilteredResult(_0x59332d,_0x490d9b))[_0xa293('0x29')](handleError(_0x59332d,null));};exports['show']=function(_0x184de9,_0x5e5fab){var _0x5e7852={'raw':!![],'where':{'id':_0x184de9[_0xa293('0x56')]['id']}},_0xd68c5d={};_0xd68c5d[_0xa293('0x3c')]=_[_0xa293('0x3d')](db[_0xa293('0x3a')][_0xa293('0x3b')]);_0xd68c5d['query']=_[_0xa293('0x3d')](_0x184de9[_0xa293('0x3e')]);_0xd68c5d[_0xa293('0x3f')]=_[_0xa293('0x40')](_0xd68c5d[_0xa293('0x3c')],_0xd68c5d[_0xa293('0x3e')]);_0x5e7852[_0xa293('0x41')]=_['intersection'](_0xd68c5d[_0xa293('0x3c')],qs[_0xa293('0x42')](_0x184de9[_0xa293('0x3e')][_0xa293('0x42')]));_0x5e7852[_0xa293('0x41')]=_0x5e7852['attributes'][_0xa293('0x43')]?_0x5e7852[_0xa293('0x41')]:_0xd68c5d[_0xa293('0x3c')];if(_0x184de9[_0xa293('0x3e')][_0xa293('0x52')]){_0x5e7852['include']=[{'all':!![]}];}_0x5e7852=_['merge']({},_0x5e7852,_0x184de9[_0xa293('0x50')]);return db[_0xa293('0x3a')][_0xa293('0x57')](_0x5e7852)[_0xa293('0x34')](handleEntityNotFound(_0x5e5fab,null))[_0xa293('0x34')](respondWithResult(_0x5e5fab,null))[_0xa293('0x29')](handleError(_0x5e5fab,null));};exports[_0xa293('0x58')]=function(_0x106df2,_0x3e789e){return db[_0xa293('0x3a')][_0xa293('0x58')](_0x106df2['body'],{})[_0xa293('0x34')](respondWithResult(_0x3e789e,0xc9))[_0xa293('0x29')](handleError(_0x3e789e,null));};exports[_0xa293('0x33')]=function(_0xbdd762,_0x3eada4){if(_0xbdd762[_0xa293('0x59')]['id']){delete _0xbdd762[_0xa293('0x59')]['id'];}return db[_0xa293('0x3a')][_0xa293('0x57')]({'where':{'id':_0xbdd762[_0xa293('0x56')]['id']}})[_0xa293('0x34')](handleEntityNotFound(_0x3eada4,null))['then'](saveUpdates(_0xbdd762[_0xa293('0x59')],null))[_0xa293('0x34')](respondWithResult(_0x3eada4,null))[_0xa293('0x29')](handleError(_0x3eada4,null));};exports[_0xa293('0x35')]=function(_0x16b021,_0x58f729){return db[_0xa293('0x3a')][_0xa293('0x57')]({'where':{'id':_0x16b021[_0xa293('0x56')]['id']}})[_0xa293('0x34')](handleEntityNotFound(_0x58f729,null))[_0xa293('0x34')](removeEntity(_0x58f729,null))['catch'](handleError(_0x58f729,null));};exports['describe']=function(_0x336559,_0x2ccb02){return db[_0xa293('0x3a')][_0xa293('0x5a')]()[_0xa293('0x34')](respondWithResult(_0x2ccb02,null))[_0xa293('0x29')](handleError(_0x2ccb02,null));};exports['getUnread']=function(_0x3fbd27,_0x37888d,_0x51e6cd){return db[_0xa293('0x5b')][_0xa293('0x51')]({'where':{'ChatGroupId':_0x3fbd27[_0xa293('0x56')]['id'],'ToId':_0x3fbd27[_0xa293('0x5c')]['id'],'read':![]}})[_0xa293('0x34')](function(_0x3834a0){return{'id':_[_0xa293('0x5d')](_0x3fbd27['params']['id']),'count':_0x3834a0};})[_0xa293('0x34')](respondWithResult(_0x37888d,null))['catch'](handleError(_0x37888d,null));};exports['addMembers']=function(_0x3c9947,_0xc0b97e,_0x3ae6cb){return db['ChatGroup'][_0xa293('0x57')]({'where':{'id':_0x3c9947[_0xa293('0x56')]['id']}})[_0xa293('0x34')](handleEntityNotFound(_0xc0b97e,null))[_0xa293('0x34')](function(_0x1dccbc){if(_0x1dccbc){return _0x1dccbc[_0xa293('0x5e')](_0x3c9947[_0xa293('0x59')][_0xa293('0x5f')],_[_0xa293('0x60')](_0x3c9947['body'],[_0xa293('0x5f'),'id'])||{});}})['then'](respondWithResult(_0xc0b97e,null))[_0xa293('0x29')](handleError(_0xc0b97e,null));};exports['getMembers']=function(_0xde1141,_0x615f30,_0x43de06){var _0x54c6e8={};var _0x4110c3={};var _0x37fe39;var _0x597d25;return db[_0xa293('0x3a')][_0xa293('0x61')]({'where':{'id':_0xde1141[_0xa293('0x56')]['id']}})['then'](handleEntityNotFound(_0x615f30,null))['then'](function(_0x258c1c){if(_0x258c1c){_0x37fe39=_0x258c1c;_0x4110c3['model']=_[_0xa293('0x3d')](db[_0xa293('0x62')][_0xa293('0x3b')]);_0x4110c3['query']=_[_0xa293('0x3d')](_0xde1141[_0xa293('0x3e')]);_0x4110c3[_0xa293('0x3f')]=_[_0xa293('0x40')](_0x4110c3[_0xa293('0x3c')],_0x4110c3[_0xa293('0x3e')]);_0x54c6e8[_0xa293('0x41')]=_[_0xa293('0x40')](_0x4110c3[_0xa293('0x3c')],qs[_0xa293('0x42')](_0xde1141['query'][_0xa293('0x42')]));_0x54c6e8[_0xa293('0x41')]=_0x54c6e8[_0xa293('0x41')]['length']?_0x54c6e8['attributes']:_0x4110c3['model'];_0x54c6e8[_0xa293('0x46')]=qs[_0xa293('0x47')](_0xde1141['query'][_0xa293('0x47')]);_0x54c6e8[_0xa293('0x4a')]=qs['filters'](_[_0xa293('0x48')](_0xde1141[_0xa293('0x3e')],_0x4110c3[_0xa293('0x3f')]));if(_0xde1141['query']['filter']){_0x54c6e8[_0xa293('0x4a')]=_['merge'](_0x54c6e8[_0xa293('0x4a')],{'$or':_[_0xa293('0x63')](_0x54c6e8[_0xa293('0x41')],function(_0x158364){var _0x130bde={};_0x130bde[_0x158364]={'$like':'%'+_0xde1141[_0xa293('0x3e')][_0xa293('0x49')]+'%'};return _0x130bde;})});}_0x54c6e8=_[_0xa293('0x4f')]({},_0x54c6e8,_0xde1141[_0xa293('0x50')]);return _0x37fe39[_0xa293('0x64')](_0x54c6e8);}})[_0xa293('0x34')](function(_0x245211){if(_0x245211){_0x597d25=_0x245211[_0xa293('0x43')];if(!_0xde1141[_0xa293('0x3e')][_0xa293('0x44')](_0xa293('0x45'))){_0x54c6e8[_0xa293('0x2f')]=qs['limit'](_0xde1141['query'][_0xa293('0x2f')]);_0x54c6e8['offset']=qs[_0xa293('0x2e')](_0xde1141['query'][_0xa293('0x2e')]);}return _0x37fe39['getMembers'](_0x54c6e8);}})[_0xa293('0x34')](function(_0x4f2f78){if(_0x4f2f78){return _0x4f2f78?{'count':_0x597d25,'rows':_0x4f2f78}:null;}})[_0xa293('0x34')](respondWithResult(_0x615f30,null))[_0xa293('0x29')](handleError(_0x615f30,null));};exports[_0xa293('0x65')]=function(_0x24651f,_0x326990,_0x374a7a){return db[_0xa293('0x3a')][_0xa293('0x57')]({'where':{'id':_0x24651f['params']['id']}})[_0xa293('0x34')](handleEntityNotFound(_0x326990,null))['then'](function(_0x3db9b9){if(_0x3db9b9){return _0x3db9b9['removeMembers'](_0x24651f[_0xa293('0x3e')]['ids']);}})[_0xa293('0x34')](respondWithStatusCode(_0x326990,null))[_0xa293('0x29')](handleError(_0x326990,null));};exports[_0xa293('0x66')]=function(_0x4f2dcc,_0x231833,_0x55f22a){if(_0x4f2dcc['body']['id']){delete _0x4f2dcc[_0xa293('0x59')]['id'];}return db[_0xa293('0x3a')]['find']({'where':{'id':_0x4f2dcc['params']['id']}})['then'](handleEntityNotFound(_0x231833,null))[_0xa293('0x34')](function(_0x740d70){if(_0x740d70){_0x4f2dcc[_0xa293('0x59')][_0xa293('0x67')]=_0x740d70['id'];return db['ChatInternalMessage'][_0xa293('0x58')](_0x4f2dcc['body']);}})[_0xa293('0x34')](respondWithResult(_0x231833,null))[_0xa293('0x29')](handleError(_0x231833,null));};exports[_0xa293('0x68')]=function(_0x1d20a2,_0x364347,_0x3c0422){var _0x497c2a={};var _0x51e81b={};var _0x4e0a37;var _0x521dc2;return db[_0xa293('0x3a')][_0xa293('0x61')]({'where':{'id':_0x1d20a2[_0xa293('0x56')]['id']}})[_0xa293('0x34')](handleEntityNotFound(_0x364347,null))[_0xa293('0x34')](function(_0x379d20){if(_0x379d20){_0x4e0a37=_0x379d20;_0x51e81b[_0xa293('0x3c')]=_['keys'](db[_0xa293('0x5b')][_0xa293('0x3b')]);_0x51e81b['query']=_[_0xa293('0x3d')](_0x1d20a2['query']);_0x51e81b[_0xa293('0x3f')]=_[_0xa293('0x40')](_0x51e81b[_0xa293('0x3c')],_0x51e81b[_0xa293('0x3e')]);_0x497c2a[_0xa293('0x41')]=_['intersection'](_0x51e81b[_0xa293('0x3c')],qs[_0xa293('0x42')](_0x1d20a2[_0xa293('0x3e')][_0xa293('0x42')]));_0x497c2a[_0xa293('0x41')]=_0x497c2a['attributes']['length']?_0x497c2a[_0xa293('0x41')]:_0x51e81b[_0xa293('0x3c')];_0x497c2a['order']=qs[_0xa293('0x47')](_0x1d20a2['query'][_0xa293('0x47')]);_0x497c2a[_0xa293('0x4a')]=qs['filters'](_[_0xa293('0x48')](_0x1d20a2[_0xa293('0x3e')],_0x51e81b[_0xa293('0x3f')]));if(_0x1d20a2[_0xa293('0x3e')][_0xa293('0x49')]){_0x497c2a['where']=_[_0xa293('0x4f')](_0x497c2a[_0xa293('0x4a')],{'$or':_[_0xa293('0x63')](_0x497c2a[_0xa293('0x41')],function(_0x554505){var _0x1a9f28={};_0x1a9f28[_0x554505]={'$like':'%'+_0x1d20a2[_0xa293('0x3e')]['filter']+'%'};return _0x1a9f28;})});}if(_0x1d20a2[_0xa293('0x3e')][_0xa293('0x69')]){var _0x3fe1b8=_0x1d20a2['query'][_0xa293('0x69')]['split'](',');var _0x411d1a={};_0x411d1a[_0x3fe1b8[0x0]]={'$gte':moment(_0x3fe1b8[0x1])[_0xa293('0x6a')](_0xa293('0x6b'))};_0x497c2a[_0xa293('0x4a')]=_[_0xa293('0x4f')](_0x497c2a[_0xa293('0x4a')],_0x411d1a);}_0x497c2a=_[_0xa293('0x4f')]({},_0x497c2a,_0x1d20a2[_0xa293('0x50')]);return _0x4e0a37[_0xa293('0x68')](_0x497c2a);}})['then'](function(_0x52e5d8){if(_0x52e5d8){_0x521dc2=_0x52e5d8[_0xa293('0x43')];if(!_0x1d20a2[_0xa293('0x3e')][_0xa293('0x44')](_0xa293('0x45'))){_0x497c2a[_0xa293('0x2f')]=qs[_0xa293('0x2f')](_0x1d20a2['query']['limit']);_0x497c2a[_0xa293('0x2e')]=qs[_0xa293('0x2e')](_0x1d20a2['query'][_0xa293('0x2e')]);}return _0x4e0a37[_0xa293('0x68')](_0x497c2a);}})[_0xa293('0x34')](function(_0x10130e){if(_0x10130e){return _0x10130e?{'count':_0x521dc2,'rows':_0x10130e}:null;}})[_0xa293('0x34')](respondWithResult(_0x364347,null))[_0xa293('0x29')](handleError(_0x364347,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index ccaa35b..58d3fc8 100644 --- a/server/api/chatGroup/chatGroup.events.js +++ b/server/api/chatGroup/chatGroup.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['hasOwnProperty','hook','events','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0x2f6aba,_0x228675){var _0x3349d2=function(_0x571ca2){while(--_0x571ca2){_0x2f6aba['push'](_0x2f6aba['shift']());}};_0x3349d2(++_0x228675);}(_0xb10b,0x12a));var _0xbb10=function(_0x129216,_0x5c208d){_0x129216=_0x129216-0x0;var _0x2a0306=_0xb10b[_0x129216];return _0x2a0306;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatGroupEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatGroupEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatGroup[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x5f66=['remove','emit','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x3b38a2,_0x312cd0){var _0xd324a1=function(_0x164661){while(--_0x164661){_0x3b38a2['push'](_0x3b38a2['shift']());}};_0xd324a1(++_0x312cd0);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x65f6('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x65f6('0x1')](0x0);var events={'afterCreate':_0x65f6('0x2'),'afterUpdate':_0x65f6('0x3'),'afterDestroy':_0x65f6('0x4')};function emitEvent(_0x1a330c){return function(_0x5eb9ad,_0x3c5029,_0x5150c8){ChatGroupEvents[_0x65f6('0x5')](_0x1a330c+':'+_0x5eb9ad['id'],_0x5eb9ad);ChatGroupEvents[_0x65f6('0x5')](_0x1a330c,_0x5eb9ad);_0x5150c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x65f6('0x6')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index d8151f0..8fa886e 100644 --- a/server/api/chatGroup/chatGroup.model.js +++ b/server/api/chatGroup/chatGroup.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c7b=['path','rimraf','./chatGroup.attributes','exports','define','chat_groups','lodash','moment','request-promise'];(function(_0x1fe1a5,_0x1f96cf){var _0x1378a8=function(_0xad8425){while(--_0xad8425){_0x1fe1a5['push'](_0x1fe1a5['shift']());}};_0x1378a8(++_0x1f96cf);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x59c1dd,_0xa83f98){_0x59c1dd=_0x59c1dd-0x0;var _0x2ada60=_0x6c7b[_0x59c1dd];return _0x2ada60;};'use strict';var _=require(_0xb6c7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb6c7('0x1'));var BPromise=require('bluebird');var rp=require(_0xb6c7('0x2'));var fs=require('fs');var path=require(_0xb6c7('0x3'));var rimraf=require(_0xb6c7('0x4'));var config=require('../../config/environment');var attributes=require(_0xb6c7('0x5'));module[_0xb6c7('0x6')]=function(_0xfe3eb9,_0x219abc){return _0xfe3eb9[_0xb6c7('0x7')]('ChatGroup',attributes,{'tableName':_0xb6c7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe132=['ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define'];(function(_0x44bcde,_0x386fb5){var _0x3f1e9c=function(_0x46846d){while(--_0x46846d){_0x44bcde['push'](_0x44bcde['shift']());}};_0x3f1e9c(++_0x386fb5);}(_0xe132,0x162));var _0x2e13=function(_0x21ff22,_0x2e4b3b){_0x21ff22=_0x21ff22-0x0;var _0x20fe49=_0xe132[_0x21ff22];return _0x20fe49;};'use strict';var _=require(_0x2e13('0x0'));var util=require('util');var logger=require(_0x2e13('0x1'))(_0x2e13('0x2'));var moment=require(_0x2e13('0x3'));var BPromise=require(_0x2e13('0x4'));var rp=require(_0x2e13('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e13('0x6'));var config=require(_0x2e13('0x7'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x260dc1,_0x2f9d00){return _0x260dc1[_0x2e13('0x8')](_0x2e13('0x9'),attributes,{'tableName':_0x2e13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 9667df9..349f701 100644 --- a/server/api/chatGroup/chatGroup.rpc.js +++ b/server/api/chatGroup/chatGroup.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bf4=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0x402245,_0x466fd5){var _0x48dbca=function(_0x20b08a){while(--_0x20b08a){_0x402245['push'](_0x402245['shift']());}};_0x48dbca(++_0x466fd5);}(_0x0bf4,0x17d));var _0x40bf=function(_0x5d4898,_0x57d66e){_0x5d4898=_0x5d4898-0x0;var _0x4d2ebc=_0x0bf4[_0x5d4898];return _0x4d2ebc;};'use strict';var _=require(_0x40bf('0x0'));var util=require(_0x40bf('0x1'));var moment=require('moment');var BPromise=require(_0x40bf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40bf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x40bf('0x4'));var logger=require(_0x40bf('0x5'))(_0x40bf('0x6'));var config=require(_0x40bf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x40bf('0x8')][_0x40bf('0x9')]({'port':0x232a});config[_0x40bf('0xa')]=_[_0x40bf('0xb')](config[_0x40bf('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x40bf('0xc'))(new Redis(config[_0x40bf('0xa')]));require('./chatGroup.socket')[_0x40bf('0xd')](socket);function respondWithRpcPromise(_0x2d31d6,_0x4e2378,_0x16daa2){return new BPromise(function(_0x55cd49,_0x202c4b){return client[_0x40bf('0xe')](_0x2d31d6,_0x16daa2)['then'](function(_0x3cf03b){logger[_0x40bf('0xf')](_0x40bf('0x10'),_0x4e2378,_0x40bf('0x11'));logger[_0x40bf('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4e2378,_0x40bf('0x11'),JSON[_0x40bf('0x13')](_0x3cf03b));if(_0x3cf03b['error']){if(_0x3cf03b[_0x40bf('0x14')][_0x40bf('0x15')]===0x1f4){logger['error'](_0x40bf('0x10'),_0x4e2378,_0x3cf03b[_0x40bf('0x14')][_0x40bf('0x16')]);return _0x202c4b(_0x3cf03b[_0x40bf('0x14')]['message']);}logger[_0x40bf('0x14')](_0x40bf('0x10'),_0x4e2378,_0x3cf03b[_0x40bf('0x14')][_0x40bf('0x16')]);return _0x55cd49(_0x3cf03b[_0x40bf('0x14')][_0x40bf('0x16')]);}else{logger[_0x40bf('0xf')](_0x40bf('0x10'),_0x4e2378,'request\x20sent');_0x55cd49(_0x3cf03b['result'][_0x40bf('0x16')]);}})[_0x40bf('0x17')](function(_0x116ff5){logger[_0x40bf('0x14')](_0x40bf('0x10'),_0x4e2378,_0x116ff5);_0x202c4b(_0x116ff5);});});} \ No newline at end of file +var _0xb5bb=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','request','then','info','request\x20sent','debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','util'];(function(_0x5d1bd4,_0x5ad706){var _0x330536=function(_0x47eda7){while(--_0x47eda7){_0x5d1bd4['push'](_0x5d1bd4['shift']());}};_0x330536(++_0x5ad706);}(_0xb5bb,0x107));var _0xbb5b=function(_0x37ed75,_0x589b55){_0x37ed75=_0x37ed75-0x0;var _0x5eb709=_0xb5bb[_0x37ed75];return _0x5eb709;};'use strict';var _=require('lodash');var util=require(_0xbb5b('0x0'));var moment=require('moment');var BPromise=require(_0xbb5b('0x1'));var rs=require(_0xbb5b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb5b('0x3'))['db'];var utils=require(_0xbb5b('0x4'));var logger=require(_0xbb5b('0x5'))(_0xbb5b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb5b('0x7')][_0xbb5b('0x8')]({'port':0x232a});config[_0xbb5b('0x9')]=_[_0xbb5b('0xa')](config[_0xbb5b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb5b('0xb'))(new Redis(config[_0xbb5b('0x9')]));require(_0xbb5b('0xc'))['register'](socket);function respondWithRpcPromise(_0x20696f,_0x1ebbb8,_0x18439f){return new BPromise(function(_0x4637c9,_0x7075a5){return client[_0xbb5b('0xd')](_0x20696f,_0x18439f)[_0xbb5b('0xe')](function(_0x1ebea1){logger[_0xbb5b('0xf')]('ChatGroup,\x20%s,\x20%s',_0x1ebbb8,_0xbb5b('0x10'));logger[_0xbb5b('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1ebbb8,_0xbb5b('0x10'),JSON[_0xbb5b('0x12')](_0x1ebea1));if(_0x1ebea1[_0xbb5b('0x13')]){if(_0x1ebea1[_0xbb5b('0x13')][_0xbb5b('0x14')]===0x1f4){logger[_0xbb5b('0x13')](_0xbb5b('0x15'),_0x1ebbb8,_0x1ebea1[_0xbb5b('0x13')][_0xbb5b('0x16')]);return _0x7075a5(_0x1ebea1[_0xbb5b('0x13')][_0xbb5b('0x16')]);}logger[_0xbb5b('0x13')]('ChatGroup,\x20%s,\x20%s',_0x1ebbb8,_0x1ebea1[_0xbb5b('0x13')]['message']);return _0x4637c9(_0x1ebea1[_0xbb5b('0x13')][_0xbb5b('0x16')]);}else{logger[_0xbb5b('0xf')]('ChatGroup,\x20%s,\x20%s',_0x1ebbb8,_0xbb5b('0x10'));_0x4637c9(_0x1ebea1[_0xbb5b('0x17')][_0xbb5b('0x16')]);}})['catch'](function(_0x7f0be9){logger[_0xbb5b('0x13')](_0xbb5b('0x15'),_0x1ebbb8,_0x7f0be9);_0x7075a5(_0x7f0be9);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 66a3cfd..b5d6cdd 100644 --- a/server/api/chatGroup/chatGroup.socket.js +++ b/server/api/chatGroup/chatGroup.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xecff=['chatGroup:','./chatGroup.events','save','remove','length'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0xecff,0x1c8));var _0xfecf=function(_0x20e48a,_0x35d7bd){_0x20e48a=_0x20e48a-0x0;var _0x427b94=_0xecff[_0x20e48a];return _0x427b94;};'use strict';var ChatGroupEvents=require(_0xfecf('0x0'));var events=[_0xfecf('0x1'),_0xfecf('0x2'),'update'];function createListener(_0x47df3d,_0xc9ab52){return function(_0x58d012){_0xc9ab52['emit'](_0x47df3d,_0x58d012);};}function removeListener(_0x147325,_0x3e31ad){return function(){ChatGroupEvents['removeListener'](_0x147325,_0x3e31ad);};}exports['register']=function(_0x94ea32){for(var _0x46eb0a=0x0,_0x3000fb=events[_0xfecf('0x3')];_0x46eb0a<_0x3000fb;_0x46eb0a++){var _0x356a13=events[_0x46eb0a];var _0x3c0ad2=createListener(_0xfecf('0x4')+_0x356a13,_0x94ea32);ChatGroupEvents['on'](_0x356a13,_0x3c0ad2);}}; \ No newline at end of file +var _0x8755=['save','remove','update','emit','length','chatGroup:','./chatGroup.events'];(function(_0x574ef4,_0xf51f63){var _0x20815e=function(_0x52f5c2){while(--_0x52f5c2){_0x574ef4['push'](_0x574ef4['shift']());}};_0x20815e(++_0xf51f63);}(_0x8755,0x133));var _0x5875=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8755[_0x321bb2];return _0x9c12ed;};'use strict';var ChatGroupEvents=require(_0x5875('0x0'));var events=[_0x5875('0x1'),_0x5875('0x2'),_0x5875('0x3')];function createListener(_0x4af1eb,_0x420718){return function(_0x45ba3d){_0x420718[_0x5875('0x4')](_0x4af1eb,_0x45ba3d);};}function removeListener(_0x5119ad,_0x30998e){return function(){ChatGroupEvents['removeListener'](_0x5119ad,_0x30998e);};}exports['register']=function(_0x16cd02){for(var _0x4fdb55=0x0,_0x534d49=events[_0x5875('0x5')];_0x4fdb55<_0x534d49;_0x4fdb55++){var _0x15aa9c=events[_0x4fdb55];var _0x143286=createListener(_0x5875('0x6')+_0x15aa9c,_0x16cd02);ChatGroupEvents['on'](_0x15aa9c,_0x143286);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index e24d56b..0d4ad4c 100644 --- a/server/api/chatGroup/index.js +++ b/server/api/chatGroup/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcfb=['connect-timeout','Router','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','create','post','addMembers','addMessage','put','delete','destroy','removeMembers','multer','path'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xfcfb,0xc6));var _0xbfcf=function(_0x1f8999,_0x58ef02){_0x1f8999=_0x1f8999-0x0;var _0x4a4d99=_0xfcfb[_0x1f8999];return _0x4a4d99;};'use strict';var multer=require(_0xbfcf('0x0'));var util=require('util');var path=require(_0xbfcf('0x1'));var timeout=require(_0xbfcf('0x2'));var express=require('express');var router=express[_0xbfcf('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbfcf('0x4'));var controller=require(_0xbfcf('0x5'));router[_0xbfcf('0x6')]('/',auth[_0xbfcf('0x7')](),controller[_0xbfcf('0x8')]);router['get']('/describe',auth[_0xbfcf('0x7')](),controller[_0xbfcf('0x9')]);router[_0xbfcf('0x6')](_0xbfcf('0xa'),auth[_0xbfcf('0x7')](),controller[_0xbfcf('0xb')]);router[_0xbfcf('0x6')](_0xbfcf('0xc'),auth[_0xbfcf('0x7')](),controller[_0xbfcf('0xd')]);router['get'](_0xbfcf('0xe'),auth[_0xbfcf('0x7')](),controller[_0xbfcf('0xf')]);router['get'](_0xbfcf('0x10'),auth[_0xbfcf('0x7')](),controller['getMessages']);router['post']('/',auth[_0xbfcf('0x7')](),controller[_0xbfcf('0x11')]);router[_0xbfcf('0x12')]('/:id/members',auth[_0xbfcf('0x7')](),controller[_0xbfcf('0x13')]);router[_0xbfcf('0x12')](_0xbfcf('0x10'),auth[_0xbfcf('0x7')](),controller[_0xbfcf('0x14')]);router[_0xbfcf('0x15')](_0xbfcf('0xa'),auth[_0xbfcf('0x7')](),controller['update']);router[_0xbfcf('0x16')](_0xbfcf('0xa'),auth[_0xbfcf('0x7')](),controller[_0xbfcf('0x17')]);router[_0xbfcf('0x16')](_0xbfcf('0xe'),auth['isAuthenticated'](),controller[_0xbfcf('0x18')]);module['exports']=router; \ No newline at end of file +var _0xe3f8=['addMessage','put','update','delete','removeMembers','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe3f8,0x92));var _0x8e3f=function(_0x323019,_0x5b9b7f){_0x323019=_0x323019-0x0;var _0x2e2528=_0xe3f8[_0x323019];return _0x2e2528;};'use strict';var multer=require('multer');var util=require(_0x8e3f('0x0'));var path=require(_0x8e3f('0x1'));var timeout=require(_0x8e3f('0x2'));var express=require('express');var router=express[_0x8e3f('0x3')]();var auth=require(_0x8e3f('0x4'));var interaction=require(_0x8e3f('0x5'));var config=require('../../config/environment');var controller=require(_0x8e3f('0x6'));router[_0x8e3f('0x7')]('/',auth[_0x8e3f('0x8')](),controller[_0x8e3f('0x9')]);router[_0x8e3f('0x7')](_0x8e3f('0xa'),auth[_0x8e3f('0x8')](),controller[_0x8e3f('0xb')]);router[_0x8e3f('0x7')](_0x8e3f('0xc'),auth[_0x8e3f('0x8')](),controller[_0x8e3f('0xd')]);router[_0x8e3f('0x7')](_0x8e3f('0xe'),auth[_0x8e3f('0x8')](),controller[_0x8e3f('0xf')]);router[_0x8e3f('0x7')](_0x8e3f('0x10'),auth[_0x8e3f('0x8')](),controller[_0x8e3f('0x11')]);router[_0x8e3f('0x7')](_0x8e3f('0x12'),auth[_0x8e3f('0x8')](),controller['getMessages']);router[_0x8e3f('0x13')]('/',auth[_0x8e3f('0x8')](),controller[_0x8e3f('0x14')]);router['post']('/:id/members',auth[_0x8e3f('0x8')](),controller[_0x8e3f('0x15')]);router['post'](_0x8e3f('0x12'),auth[_0x8e3f('0x8')](),controller[_0x8e3f('0x16')]);router[_0x8e3f('0x17')](_0x8e3f('0xc'),auth['isAuthenticated'](),controller[_0x8e3f('0x18')]);router[_0x8e3f('0x19')](_0x8e3f('0xc'),auth[_0x8e3f('0x8')](),controller['destroy']);router[_0x8e3f('0x19')](_0x8e3f('0x10'),auth[_0x8e3f('0x8')](),controller[_0x8e3f('0x1a')]);module[_0x8e3f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 6231f50..6ca9464 100644 --- a/server/api/chatInteraction/chatInteraction.attributes.js +++ b/server/api/chatInteraction/chatInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2730=['ENUM','thumb','star','TEXT','STRING','DATE','long','sequelize','exports','BOOLEAN','INTEGER'];(function(_0x436e20,_0x2ec801){var _0x59eb84=function(_0x4183d8){while(--_0x4183d8){_0x436e20['push'](_0x436e20['shift']());}};_0x59eb84(++_0x2ec801);}(_0x2730,0x130));var _0x0273=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2730[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x0273('0x0'));module[_0x0273('0x1')]={'closed':{'type':Sequelize[_0x0273('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x0273('0x3')]},'ratingType':{'type':Sequelize[_0x0273('0x4')]('star',_0x0273('0x5')),'defaultValue':_0x0273('0x6')},'ratingMessage':{'type':Sequelize[_0x0273('0x7')]},'pathTranscript':{'type':Sequelize[_0x0273('0x7')]},'mailTranscript':{'type':Sequelize[_0x0273('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0273('0x9')]},'disposition':{'type':Sequelize[_0x0273('0x8')]},'note':{'type':Sequelize[_0x0273('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x0273('0x8')]},'osName':{'type':Sequelize[_0x0273('0x8')]},'osVersion':{'type':Sequelize[_0x0273('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x0273('0x8')]},'deviceType':{'type':Sequelize[_0x0273('0x8')]},'referer':{'type':Sequelize[_0x0273('0x7')]},'customerIp':{'type':Sequelize[_0x0273('0x8')]},'formData':{'type':Sequelize[_0x0273('0x7')](_0x0273('0xa'))},'read1stAt':{'type':Sequelize[_0x0273('0x9')]},'lastMsgAt':{'type':Sequelize[_0x0273('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x0273('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9a04=['TEXT','STRING','DATE','long','exports','INTEGER','ENUM','star','thumb'];(function(_0xddc012,_0x5cf07a){var _0x395581=function(_0x483e9d){while(--_0x483e9d){_0xddc012['push'](_0xddc012['shift']());}};_0x395581(++_0x5cf07a);}(_0x9a04,0xaf));var _0x49a0=function(_0x24529f,_0x33f02c){_0x24529f=_0x24529f-0x0;var _0x24bb75=_0x9a04[_0x24529f];return _0x24bb75;};'use strict';var Sequelize=require('sequelize');module[_0x49a0('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x49a0('0x1')]},'ratingType':{'type':Sequelize[_0x49a0('0x2')](_0x49a0('0x3'),_0x49a0('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x49a0('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x49a0('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x49a0('0x7')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x49a0('0x6')]},'browserVersion':{'type':Sequelize[_0x49a0('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x49a0('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x49a0('0x6')]},'formData':{'type':Sequelize[_0x49a0('0x5')](_0x49a0('0x8'))},'read1stAt':{'type':Sequelize[_0x49a0('0x7')]},'lastMsgAt':{'type':Sequelize[_0x49a0('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x49a0('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x49a0('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 171315c..59f857f 100644 --- a/server/api/chatInteraction/chatInteraction.controller.js +++ b/server/api/chatInteraction/chatInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1271=['\x20IS\x20NULL','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','toString','join','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','i.id','Sequelize','QueryTypes','clone','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','keyBy','merge','COUNT(me.id)','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','it.ChatInteractionId\x20=\x20i.id','ui.ChatInteractionId\x20IN\x20?','all','rows','show','params','fields','includeAll','options','find','create','body','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','ValidationError','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','download','root','close','mailTranscript','transcript-%s.txt','now','Messages','User','ChatWebsite','CmContact','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','authentication','auth','user','pass','SendMail','sendMail','addMessage','ChatMessage','ids','omit','getMessages','pick','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','nolimit','includeAgent','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','Owner','10px','40px','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','YYYY-MM-DD','mkdirSync','Chat','Account','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','out','Contact','firstName','lastName','views','downloadInteraction.html','toFile','transcript-','.pdf','log','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','test','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','Users','TagIds','Tags','split','forEach','push','index','ChatInteraction','rawAttributes','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','field','color','select','COUNT(*)','from','chat_messages','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.ChatInteractionId','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.ChatInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','createdAt','startOf','day','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','unreadMessages','value','tableAlias','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','TagId','\x20IN\x20?','LIKE','c.lastName','map','filter','isNil','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','null'];(function(_0x293fd7,_0x16e1d7){var _0x5a0fe8=function(_0x117e7c){while(--_0x117e7c){_0x293fd7['push'](_0x293fd7['shift']());}};_0x5a0fe8(++_0x16e1d7);}(_0x1271,0xa9));var _0x1127=function(_0x45481f,_0x1a179a){_0x45481f=_0x45481f-0x0;var _0x44bc23=_0x1271[_0x45481f];return _0x44bc23;};'use strict';var pdf=require(_0x1127('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1127('0x1'));var zipdir=require(_0x1127('0x2'));var jsonpatch=require(_0x1127('0x3'));var rp=require(_0x1127('0x4'));var moment=require('moment');var BPromise=require(_0x1127('0x5'));var Mustache=require(_0x1127('0x6'));var util=require(_0x1127('0x7'));var path=require(_0x1127('0x8'));var sox=require('sox');var csv=require(_0x1127('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1127('0xa'));var squel=require('squel');var crypto=require(_0x1127('0xb'));var jsforce=require(_0x1127('0xc'));var deskjs=require(_0x1127('0xd'));var toCsv=require(_0x1127('0x9'));var querystring=require(_0x1127('0xe'));var Papa=require('papaparse');var Redis=require(_0x1127('0xf'));var authService=require(_0x1127('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1127('0x11'));var logger=require('../../config/logger')(_0x1127('0x12'));var utils=require('../../config/utils');var config=require(_0x1127('0x13'));var db=require(_0x1127('0x14'))['db'];config['redis']=_[_0x1127('0x15')](config[_0x1127('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x1127('0x17'))(new Redis(config['redis']));require(_0x1127('0x18'))[_0x1127('0x19')](socket);var jayson=require(_0x1127('0x1a'));var client=jayson[_0x1127('0x1b')]['http']({'port':0x232b});var client9004=jayson[_0x1127('0x1b')][_0x1127('0x1c')]({'port':0x232c});function checkPasswordPattern(_0xcffe3b,_0x5daee9,_0x5d3bd5){if(_0x5d3bd5){var _0x262d7a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x262d7a[_0x1127('0x1d')](_0x5daee9)){return _0xcffe3b;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xcffe3b;}}function respondWithRpcPromise(_0x39235e,_0x39dadf,_0x2618d1,_0x394204){return new BPromise(function(_0x224893,_0x33ec82){var _0x3b0543=_0x394204||client;return _0x3b0543['request'](_0x39235e,_0x2618d1)['then'](function(_0x58a74c){logger['info'](_0x1127('0x1e'),_0x39dadf,'request\x20sent');logger['debug'](_0x1127('0x1f'),_0x39dadf,'request\x20sent',JSON[_0x1127('0x20')](_0x58a74c));if(_0x58a74c[_0x1127('0x21')]){if(_0x58a74c[_0x1127('0x21')][_0x1127('0x22')]===0x1f4){logger[_0x1127('0x21')](_0x1127('0x1e'),_0x39dadf,_0x58a74c[_0x1127('0x21')][_0x1127('0x23')]);return _0x33ec82(_0x58a74c[_0x1127('0x21')]['message']);}logger[_0x1127('0x21')](_0x1127('0x1e'),_0x39dadf,_0x58a74c[_0x1127('0x21')]['message']);return _0x224893(_0x58a74c[_0x1127('0x21')]['message']);}else{logger[_0x1127('0x24')](_0x1127('0x1e'),_0x39dadf,_0x1127('0x25'));_0x224893(_0x58a74c[_0x1127('0x26')][_0x1127('0x23')]);}})[_0x1127('0x27')](function(_0xe743c9){logger[_0x1127('0x21')](_0x1127('0x1e'),_0x39dadf,_0xe743c9);_0x33ec82(_0xe743c9);});});}function respondWithStatusCode(_0xaa8071,_0x235022){_0x235022=_0x235022||0xcc;return function(_0x2d2684){if(_0x2d2684){return _0xaa8071[_0x1127('0x28')](_0x235022);}return _0xaa8071[_0x1127('0x29')](_0x235022)[_0x1127('0x2a')]();};}function respondWithResult(_0x34d8a9,_0x2d5aec){_0x2d5aec=_0x2d5aec||0xc8;return function(_0x596559){if(_0x596559){return _0x34d8a9[_0x1127('0x29')](_0x2d5aec)[_0x1127('0x2b')](_0x596559);}};}function respondWithFilteredResult(_0x4cd7eb,_0x194b36){return function(_0x3cf321){if(_0x3cf321){var _0x10a66b=_0x3cf321[_0x1127('0x2c')],_0x58b848=_0x194b36[_0x1127('0x2d')],_0x1e529e=_0x194b36[_0x1127('0x2d')]+_0x194b36[_0x1127('0x2e')],_0x1b3a92;if(_0x1e529e>=_0x10a66b){_0x1e529e=_0x10a66b;_0x1b3a92=0xc8;}else{_0x1b3a92=0xce;}_0x4cd7eb[_0x1127('0x29')](_0x1b3a92);return _0x4cd7eb[_0x1127('0x2f')](_0x1127('0x30'),_0x58b848+'-'+_0x1e529e+'/'+_0x10a66b)[_0x1127('0x2b')](_0x3cf321);}return null;};}function patchUpdates(_0x46ace2){return function(_0x303c2a){try{jsonpatch['apply'](_0x303c2a,_0x46ace2,!![]);}catch(_0x4b2be3){return BPromise[_0x1127('0x31')](_0x4b2be3);}return _0x303c2a[_0x1127('0x32')]();};}function saveUpdates(_0x1a9e41,_0x129742){return function(_0x277db6){if(_0x277db6){return _0x277db6[_0x1127('0x33')](_0x1a9e41)[_0x1127('0x34')](function(_0x12b40e){return _0x12b40e;});}return null;};}function removeEntity(_0x379c14,_0x14cb4a){return function(_0x144f23){if(_0x144f23){return _0x144f23[_0x1127('0x35')]()['then'](function(){_0x379c14['status'](0xcc)[_0x1127('0x2a')]();});}};}function handleEntityNotFound(_0x725b38,_0x2f2734){return function(_0x204d62){if(!_0x204d62){_0x725b38[_0x1127('0x28')](0x194);}return _0x204d62;};}function handleError(_0x16398a,_0x3c15bd){_0x3c15bd=_0x3c15bd||0x1f4;return function(_0x4dba76){logger[_0x1127('0x21')](_0x4dba76[_0x1127('0x36')]);if(_0x4dba76['name']){delete _0x4dba76[_0x1127('0x37')];}_0x16398a['status'](_0x3c15bd)['send'](_0x4dba76);};}function getInteractionUsers(_0x379614,_0x10bfb1){return new BPromise(function(_0x33c848,_0x499aa2){try{if(_0x10bfb1[_0x379614['id']]){_0x379614[_0x1127('0x38')]=_['map'](_0x10bfb1[_0x379614['id']],function(_0x433657){return{'id':_0x433657['id']};});}}catch(_0x294f46){_0x499aa2(_0x294f46);}_0x33c848(_0x379614);});}function getInteractionTags(_0x5236a0,_0x4c4a13){return new BPromise(function(_0xff5129,_0x1a1f45){try{if(_0x5236a0[_0x1127('0x39')]){_0x5236a0[_0x1127('0x3a')]=[];_0x5236a0[_0x1127('0x39')][_0x1127('0x3b')](',')[_0x1127('0x3c')](function(_0x2393d8){_0x5236a0[_0x1127('0x3a')][_0x1127('0x3d')](_0x4c4a13[_0x2393d8]);});}delete _0x5236a0['TagIds'];}catch(_0x12c229){_0x1a1f45(_0x12c229);}_0xff5129(_0x5236a0);});}function updateChatInteraction(_0x5303af,_0x42c9da,_0x114b87){return new BPromise(function(_0x2b1a4b,_0x5937ab){return getInteractionUsers(_0x5303af,_0x114b87)['then'](function(_0x12addf){return getInteractionTags(_0x12addf,_0x42c9da);})[_0x1127('0x34')](function(_0xb54b75){_0x2b1a4b(_0xb54b75);})[_0x1127('0x27')](function(_0x25324f){_0x5937ab(_0x25324f);});});}exports[_0x1127('0x3e')]=function(_0x3ed71d,_0x494584){var _0x1e7e36={},_0x3eb9db={},_0x19c58e={'count':0x0,'rows':[]};var _0x2bb658=db[_0x1127('0x3f')][_0x1127('0x40')];_0x3eb9db['model']=_[_0x1127('0x41')](_0x2bb658);_0x3eb9db[_0x1127('0x42')]=_[_0x1127('0x41')](_0x3ed71d[_0x1127('0x42')]);_0x3eb9db[_0x1127('0x43')]=_[_0x1127('0x44')](_0x3eb9db[_0x1127('0x45')],_0x3eb9db[_0x1127('0x42')]);_0x1e7e36[_0x1127('0x46')]=_[_0x1127('0x44')](_0x3eb9db[_0x1127('0x45')],qs['fields'](_0x3ed71d[_0x1127('0x42')]['fields']));_0x1e7e36['attributes']=_0x1e7e36[_0x1127('0x46')][_0x1127('0x47')]?_0x1e7e36[_0x1127('0x46')]:_0x3eb9db[_0x1127('0x45')];if(!_0x3ed71d['query'][_0x1127('0x48')]('nolimit')){_0x1e7e36[_0x1127('0x2e')]=qs[_0x1127('0x2e')](_0x3ed71d[_0x1127('0x42')][_0x1127('0x2e')]);_0x1e7e36['offset']=qs[_0x1127('0x2d')](_0x3ed71d[_0x1127('0x42')]['offset']);}_0x1e7e36[_0x1127('0x49')]=qs['sort'](_0x3ed71d[_0x1127('0x42')][_0x1127('0x4a')]);_0x1e7e36[_0x1127('0x4b')]=qs['filters'](_['pick'](_0x3ed71d[_0x1127('0x42')],_0x3eb9db['filters']));var _0xbdb727=[];var _0x180df6=squel['select']()[_0x1127('0x4c')]('id')[_0x1127('0x4c')](_0x1127('0x37'))[_0x1127('0x4c')](_0x1127('0x4d'))['from']('tools_tags');var _0x4f4e60=squel[_0x1127('0x4e')]()[_0x1127('0x4c')](_0x1127('0x4f'))[_0x1127('0x50')](_0x1127('0x51'),'me')[_0x1127('0x4b')](_0x1127('0x52'))[_0x1127('0x4b')](_0x1127('0x53'))[_0x1127('0x4b')](_0x1127('0x54'));var _0x18744e=squel[_0x1127('0x4e')]()[_0x1127('0x4c')](_0x1127('0x55'))['field'](_0x1127('0x56'))[_0x1127('0x50')]('user_has_chat_interactions','ui')['left_join'](_0x1127('0x57'),'u',_0x1127('0x58'));var _0x385a52=squel[_0x1127('0x4e')]()['from'](_0x1127('0x59'),'i')[_0x1127('0x5a')](_0x1127('0x5b'),'c',_0x1127('0x5c'))[_0x1127('0x5a')](_0x1127('0x57'),'o',_0x1127('0x5d'))[_0x1127('0x5a')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x1127('0x5a')](_0x1127('0x51'),'me',_0x1127('0x5e'));var _0x5b5b34=squel[_0x1127('0x5f')]();if(_0x3ed71d[_0x1127('0x42')][_0x1127('0x60')]){var _0x400030=JSON['parse'](_0x3ed71d[_0x1127('0x42')][_0x1127('0x60')]);_['keys'](_0x400030)[_0x1127('0x3c')](function(_0x4df3c8){var _0x49660b=_0x400030[_0x4df3c8];if(_0x4df3c8===_0x1127('0x61')){var _0x1163f8=moment(_0x49660b['value']['dateStart'])[_0x1127('0x62')](_0x1127('0x63'))[_0x1127('0x64')]()['format']();var _0x4dbff8=moment(_0x4dbff8)[_0x1127('0x64')]()['endOf'](_0x1127('0x63'))[_0x1127('0x65')]();_0x5b5b34[_0x1127('0x66')](_0x1127('0x67'),_0x1163f8,_0x4dbff8);}else{if(_[_0x1127('0x68')](_0x49660b[_0x1127('0x69')])){_0x49660b[_0x1127('0x69')][_0x1127('0x3c')](function(_0x5c0cb7){switch(_0x49660b[_0x1127('0x69')]['value']){case'IS':if(_0x4df3c8!=='TagId'&&_0x4df3c8!==_0x1127('0x6a')){if(_[_0x1127('0x68')](_0x49660b['value'])&&_0x49660b[_0x1127('0x6b')][_0x1127('0x47')]>0x1){_0x5b5b34[_0x1127('0x66')](_0x49660b[_0x1127('0x6c')]+'.'+_0x4df3c8+'\x20IN\x20?',_0x49660b[_0x1127('0x6b')]);}else{_0x5b5b34[_0x1127('0x66')](_0x49660b[_0x1127('0x6c')]+'.'+_0x4df3c8+_0x1127('0x6d'),_0x49660b[_0x1127('0x6b')][0x0]);}}break;case'=':_0x5b5b34['and'](_0x49660b[_0x1127('0x6c')]+'.'+_0x4df3c8+_0x1127('0x6d'),_0x49660b['value']);break;case'LIKE':if(_0x4df3c8===_0x1127('0x6e')){_0x5b5b34[_0x1127('0x66')](_0x1127('0x6f')+_0x1127('0x70'),'%'+_0x49660b[_0x1127('0x6b')]+'%');_0x5b5b34['or']('c.lastName'+_0x1127('0x70'),'%'+_0x49660b[_0x1127('0x6b')]+'%');_0x5b5b34['or'](_0x1127('0x71')+_0x1127('0x70'),'%'+_0x49660b[_0x1127('0x6b')]+'%');}else{_0x5b5b34[_0x1127('0x66')](_0x49660b[_0x1127('0x6c')]+'.'+_0x4df3c8+'\x20LIKE\x20?','%'+_0x49660b[_0x1127('0x6b')]+'%');}break;case'>':_0x5b5b34[_0x1127('0x66')](_0x49660b[_0x1127('0x6c')]+'.'+_0x4df3c8+_0x1127('0x72'),_0x49660b[_0x1127('0x6b')]);break;case'<':_0x5b5b34[_0x1127('0x66')](_0x49660b['tableAlias']+'.'+_0x4df3c8+_0x1127('0x73'),_0x49660b['value']);break;}});}else{switch(_0x49660b['condition'][_0x1127('0x6b')]){case'IS':if(_0x4df3c8!==_0x1127('0x74')&&_0x4df3c8!==_0x1127('0x6a')){if(_[_0x1127('0x68')](_0x49660b[_0x1127('0x6b')])&&_0x49660b[_0x1127('0x6b')][_0x1127('0x47')]>0x1){_0x5b5b34[_0x1127('0x66')](_0x49660b[_0x1127('0x6c')]+'.'+_0x4df3c8+_0x1127('0x75'),_0x49660b[_0x1127('0x6b')]);}else{_0x5b5b34[_0x1127('0x66')](_0x49660b[_0x1127('0x6c')]+'.'+_0x4df3c8+'\x20=\x20?',_0x49660b[_0x1127('0x6b')][0x0]);}}break;case'=':_0x5b5b34[_0x1127('0x66')](_0x49660b[_0x1127('0x6c')]+'.'+_0x4df3c8+_0x1127('0x6d'),_0x49660b[_0x1127('0x6b')]);break;case _0x1127('0x76'):if(_0x4df3c8===_0x1127('0x6e')){_0x5b5b34[_0x1127('0x66')](_0x1127('0x6f')+_0x1127('0x70'),'%'+_0x49660b[_0x1127('0x6b')]+'%');_0x5b5b34['or'](_0x1127('0x77')+_0x1127('0x70'),'%'+_0x49660b[_0x1127('0x6b')]+'%');_0x5b5b34['or']('c.email'+_0x1127('0x70'),'%'+_0x49660b['value']+'%');}else{_0x5b5b34[_0x1127('0x66')](_0x49660b[_0x1127('0x6c')]+'.'+_0x4df3c8+_0x1127('0x70'),'%'+_0x49660b[_0x1127('0x6b')]+'%');}break;case'>':_0x5b5b34[_0x1127('0x66')](_0x49660b[_0x1127('0x6c')]+'.'+_0x4df3c8+_0x1127('0x72'),_0x49660b[_0x1127('0x6b')]);break;case'<':_0x5b5b34['and'](_0x49660b[_0x1127('0x6c')]+'.'+_0x4df3c8+_0x1127('0x73'),_0x49660b['value']);break;}}}});}else{var _0x405aad=_(Object['keys'](_0x3ed71d[_0x1127('0x42')]))[_0x1127('0x78')](function(_0x41b6e1){return _0x2bb658[_0x1127('0x48')](_0x41b6e1)?_0x41b6e1:undefined;})[_0x1127('0x79')](function(_0x123b33){return!_[_0x1127('0x7a')](_0x123b33);})[_0x1127('0x6b')]();if(!_['isEmpty'](_0x405aad)){_0x405aad[_0x1127('0x3c')](function(_0x2379a2){if(_0x2379a2===_0x1127('0x7b')){_0x385a52[_0x1127('0x4b')](_0x1127('0x7c'),[][_0x1127('0x7d')](_0x3ed71d[_0x1127('0x42')][_0x2379a2]));}else if(_0x2379a2===_0x1127('0x61')){var _0x1c5c20=JSON[_0x1127('0x7e')](_0x3ed71d[_0x1127('0x42')][_0x2379a2])[_0x1127('0x7f')];var _0xa43b78=JSON[_0x1127('0x7e')](_0x3ed71d['query'][_0x2379a2])[_0x1127('0x80')];_0x385a52['where'](_0x1127('0x67'),_0x1c5c20,_0xa43b78);}else{if(_0x3ed71d[_0x1127('0x42')][_0x2379a2]===_0x1127('0x81')){_0x385a52[_0x1127('0x4b')]('i.'+_0x2379a2+_0x1127('0x82'));}else{_0x385a52[_0x1127('0x4b')]('i.'+_0x2379a2+_0x1127('0x6d'),_0x3ed71d[_0x1127('0x42')][_0x2379a2]);}}});}if(_0x3ed71d['query'][_0x1127('0x79')]){var _0x7c703c=_0x3ed71d['query'][_0x1127('0x79')][_0x1127('0x83')]('\x5c','\x5c\x5c')[_0x1127('0x83')]('\x27\x27',_0x1127('0x84'));if(qs['isNumeric'](_0x7c703c)){_0x5b5b34['or'](_0x1127('0x85'),_0x7c703c+'%');}else{var _0x43e245=[];_0x7c703c['split']('\x20')['forEach'](function(_0x84fdfc){_0x43e245[_0x1127('0x3d')]('+'+_0x84fdfc[_0x1127('0x86')]());});var _0x413728=_0x43e245[_0x1127('0x87')]('\x20');_0x5b5b34['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x413728)['or'](_0x1127('0x88'),_0x7c703c+'%');}}}_0x385a52[_0x1127('0x4b')](_0x5b5b34);if(_0x1e7e36[_0x1127('0x49')]){_0x1e7e36['order'][_0x1127('0x3c')](function(_0x4eb572){_0x385a52[_0x1127('0x49')]('i.'+_0x4eb572[0x0],_0x4eb572[0x1]===_0x1127('0x89')?![]:!![]);});}_0x385a52[_0x1127('0x8a')](_0x1127('0x8b'));var _0x4346b1={'type':db[_0x1127('0x8c')][_0x1127('0x8d')]['SELECT'],'raw':!![]};var _0x2a9c25=_0x385a52[_0x1127('0x8e')]()['field'](_0x1127('0x4f'))['field']('COUNT(me.id)','unreadMessages');if(!_0x3ed71d[_0x1127('0x42')][_0x1127('0x60')]){if(_0x3ed71d[_0x1127('0x42')][_0x1127('0x8f')]){if(_0x3ed71d[_0x1127('0x42')]['read']==0x1){_0x2a9c25[_0x1127('0x90')](_0x1127('0x91'));_0x385a52[_0x1127('0x90')](_0x1127('0x91'));}else{_0x2a9c25[_0x1127('0x90')]('`unreadMessages`\x20>\x200');_0x385a52[_0x1127('0x90')](_0x1127('0x92'));}}if(_0x3ed71d[_0x1127('0x42')][_0x1127('0x93')]){var _0x199f0d=_[_0x1127('0x68')](_0x3ed71d[_0x1127('0x42')][_0x1127('0x93')])?_0x3ed71d['query']['tag']:new Array(_0x3ed71d[_0x1127('0x42')][_0x1127('0x93')]);var _0x2ce223=squel[_0x1127('0x5f')]();_0x199f0d[_0x1127('0x3c')](function(_0xd3cb42){_0x2ce223['or'](_0x1127('0x94'),'%,'+_0xd3cb42+',%');});_0x385a52[_0x1127('0x90')](_0x2ce223);_0x2a9c25[_0x1127('0x5a')](_0x1127('0x95'),'it','it.ChatInteractionId\x20=\x20i.id');_0x2a9c25[_0x1127('0x5a')](_0x1127('0x96'),'t',_0x1127('0x97'));_0x2a9c25[_0x1127('0x4b')](_0x1127('0x98'),_0x199f0d);}}else{var _0x400030=JSON[_0x1127('0x7e')](_0x3ed71d[_0x1127('0x42')][_0x1127('0x60')]);_[_0x1127('0x41')](_0x400030)[_0x1127('0x3c')](function(_0x45ccb9){var _0x39dc10=_0x400030[_0x45ccb9];if(_0x45ccb9==='TagId'){var _0x16cf4f=_0x39dc10['value'];var _0x31078b=squel[_0x1127('0x5f')]();_0x16cf4f[_0x1127('0x3c')](function(_0x388f35){_0x31078b['or'](_0x1127('0x94'),'%,'+_0x388f35+',%');});_0x385a52[_0x1127('0x90')](_0x31078b);_0x2a9c25[_0x1127('0x5a')](_0x1127('0x99'),'it',_0x1127('0x9a'));_0x2a9c25[_0x1127('0x5a')](_0x1127('0x96'),'t',_0x1127('0x97'));_0x2a9c25[_0x1127('0x4b')](_0x1127('0x98'),_0x16cf4f);}else if(_0x45ccb9===_0x1127('0x6a')){if(_0x39dc10[_0x1127('0x6b')][_0x1127('0x47')]===0x1){if(_0x39dc10[_0x1127('0x6b')][0x0]===0x1){_0x2a9c25[_0x1127('0x90')](_0x1127('0x91'));_0x385a52[_0x1127('0x90')]('`unreadMessages`\x20=\x200');}else{_0x2a9c25['having'](_0x1127('0x92'));_0x385a52['having'](_0x1127('0x92'));}}}});}db[_0x1127('0x9b')][_0x1127('0x42')](_0x2a9c25[_0x1127('0x86')](),_0x4346b1)[_0x1127('0x34')](function(_0x465f75){_0x19c58e[_0x1127('0x2c')]=_0x465f75['length'];if(_0x19c58e[_0x1127('0x2c')]===0x0)return[];return db[_0x1127('0x9b')][_0x1127('0x42')](_0x180df6[_0x1127('0x86')](),_0x4346b1)['then'](function(_0x4258f8){_0xbdb727=_[_0x1127('0x9c')](_0x4258f8,'id');_0x4346b1=_[_0x1127('0x9d')](_0x4346b1,{'model':db[_0x1127('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x385a52[_0x1127('0x4c')](_0x1127('0x9e'),_0x1127('0x6a'));_0x385a52['field'](_0x1127('0x9f'),_0x1127('0xa0'));_0x385a52[_0x1127('0x4c')]('a.mandatoryDisposition',_0x1127('0xa1'));_0x385a52[_0x1127('0x4c')](_0x1127('0xa2'));_0x385a52[_0x1127('0x4c')]('c.firstName',_0x1127('0xa3'));_0x385a52[_0x1127('0x4c')](_0x1127('0x77'),'Contact.lastName');_0x385a52[_0x1127('0x4c')](_0x1127('0x71'),_0x1127('0xa4'));_0x385a52['field']('c.phone',_0x1127('0xa5'));_0x385a52[_0x1127('0x4c')](_0x1127('0xa6'),_0x1127('0xa7'));_0x385a52[_0x1127('0x4c')](_0x1127('0xa8'),_0x1127('0xa9'));_0x385a52['field'](_0x1127('0xaa'),_0x1127('0x39'));_0x385a52[_0x1127('0x5a')](_0x1127('0x95'),'it',_0x1127('0xab'));_0x385a52[_0x1127('0x5a')]('tools_tags','t',_0x1127('0x97'));_0x385a52[_0x1127('0x2e')](_0x1e7e36[_0x1127('0x2e')]);_0x385a52[_0x1127('0x2d')](_0x1e7e36[_0x1127('0x2d')]);return db[_0x1127('0x9b')][_0x1127('0x42')](_0x385a52['toString'](),_0x4346b1);})[_0x1127('0x34')](function(_0x4cb149){_0x18744e['where'](_0x1127('0xac'),_[_0x1127('0x78')](_0x4cb149,'id'));return db[_0x1127('0x9b')][_0x1127('0x42')](_0x18744e['toString'](),_0x4346b1)[_0x1127('0x34')](function(_0xd08352){var _0x32b13c=_['groupBy'](_0xd08352,'ChatInteractionId');var _0x2300fb=[];_0x4cb149[_0x1127('0x3c')](function(_0x2cd605){_0x2300fb[_0x1127('0x3d')](updateChatInteraction(_0x2cd605,_0xbdb727,_0x32b13c));});return BPromise[_0x1127('0xad')](_0x2300fb);});});})['then'](function(_0x3cf127){_0x19c58e[_0x1127('0xae')]=_0x3cf127;return _0x19c58e;})[_0x1127('0x34')](respondWithFilteredResult(_0x494584,_0x1e7e36))['catch'](handleError(_0x494584,null));};exports[_0x1127('0xaf')]=function(_0x5a36df,_0x2989ae){var _0x1a7a7e={'raw':![],'where':{'id':_0x5a36df[_0x1127('0xb0')]['id']}},_0x4564fe={};_0x4564fe[_0x1127('0x45')]=_['keys'](db[_0x1127('0x3f')]['rawAttributes']);_0x4564fe['query']=_['keys'](_0x5a36df['query']);_0x4564fe[_0x1127('0x43')]=_[_0x1127('0x44')](_0x4564fe[_0x1127('0x45')],_0x4564fe[_0x1127('0x42')]);_0x1a7a7e['attributes']=_[_0x1127('0x44')](_0x4564fe[_0x1127('0x45')],qs[_0x1127('0xb1')](_0x5a36df[_0x1127('0x42')]['fields']));_0x1a7a7e[_0x1127('0x46')]=_0x1a7a7e[_0x1127('0x46')][_0x1127('0x47')]?_0x1a7a7e[_0x1127('0x46')]:_0x4564fe[_0x1127('0x45')];if(_0x5a36df[_0x1127('0x42')][_0x1127('0xb2')]){_0x1a7a7e['include']=[{'all':!![]}];}_0x1a7a7e=_[_0x1127('0x9d')]({},_0x1a7a7e,_0x5a36df[_0x1127('0xb3')]);return db[_0x1127('0x3f')][_0x1127('0xb4')](_0x1a7a7e)[_0x1127('0x34')](handleEntityNotFound(_0x2989ae,null))[_0x1127('0x34')](respondWithResult(_0x2989ae,null))[_0x1127('0x27')](handleError(_0x2989ae,null));};exports[_0x1127('0xb5')]=function(_0x4f660d,_0x52ff99){return db['ChatInteraction'][_0x1127('0xb5')](_0x4f660d['body'],{})[_0x1127('0x34')](respondWithResult(_0x52ff99,0xc9))[_0x1127('0x27')](handleError(_0x52ff99,null));};exports[_0x1127('0x33')]=function(_0x40c36a,_0x1e597c){if(_0x40c36a['body']['id']){delete _0x40c36a[_0x1127('0xb6')]['id'];}return db[_0x1127('0x3f')][_0x1127('0xb4')]({'where':{'id':_0x40c36a[_0x1127('0xb0')]['id']}})['then'](handleEntityNotFound(_0x1e597c,null))[_0x1127('0x34')](saveUpdates(_0x40c36a[_0x1127('0xb6')],null))[_0x1127('0x34')](respondWithResult(_0x1e597c,null))[_0x1127('0x27')](handleError(_0x1e597c,null));};exports[_0x1127('0x35')]=function(_0x4001ed,_0x1fde55){return db[_0x1127('0x3f')][_0x1127('0xb4')]({'where':{'id':_0x4001ed['params']['id']}})[_0x1127('0x34')](handleEntityNotFound(_0x1fde55,null))['then'](removeEntity(_0x1fde55,null))[_0x1127('0x27')](handleError(_0x1fde55,null));};exports['describe']=function(_0x3df001,_0x4e774b){return db[_0x1127('0x3f')][_0x1127('0xb7')]()[_0x1127('0x34')](respondWithResult(_0x4e774b,null))[_0x1127('0x27')](handleError(_0x4e774b,null));};exports[_0x1127('0xb8')]=function(_0x5c80ff,_0x13ce48){if(_0x5c80ff['body']['id']){delete _0x5c80ff['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c80ff[_0x1127('0xb0')]['id']}})[_0x1127('0x34')](handleEntityNotFound(_0x13ce48,null))[_0x1127('0x34')](saveUpdates(_0x5c80ff[_0x1127('0xb6')],null))[_0x1127('0x34')](respondWithResult(_0x13ce48,null))['catch'](handleError(_0x13ce48,null));};exports[_0x1127('0xb9')]=function(_0x4b02a3,_0x45cd4b,_0x4d5a88){if(_0x4b02a3[_0x1127('0xb6')]['id']){delete _0x4b02a3[_0x1127('0xb6')]['id'];}return db[_0x1127('0x3f')][_0x1127('0xb4')]({'where':{'id':_0x4b02a3[_0x1127('0xb0')]['id']}})[_0x1127('0x34')](function(_0x5eb9a3){if(!_0x5eb9a3){logger[_0x1127('0x21')](_0x1127('0xba'),'abandon',0x194,_0x1127('0xbb'));_0x45cd4b[_0x1127('0x28')](0x194);}else{if(_0x5eb9a3[_0x1127('0xbc')]){throw new db[(_0x1127('0x8c'))][(_0x1127('0xbd'))](_0x1127('0xbe'));}}return _0x5eb9a3;})[_0x1127('0x34')](function(_0x3bc6d8){if(_0x3bc6d8){return _0x3bc6d8[_0x1127('0x33')]({'closed':_0x4b02a3[_0x1127('0xb6')][_0x1127('0xbf')],'disposition':_0x4b02a3[_0x1127('0xb6')]['disposition']})[_0x1127('0x34')](function(_0x389cdc){return _0x389cdc;});}})['then'](function(_0x389224){return respondWithRpcPromise(_0x1127('0xc0'),_0x1127('0xb9'),_0x4b02a3[_0x1127('0xb6')],client9004);})['then'](respondWithResult(_0x45cd4b,null))[_0x1127('0x27')](handleError(_0x45cd4b,null));};exports[_0x1127('0xc1')]=function(_0x437be3,_0x529764,_0x18ac75){_0x437be3[_0x1127('0xb6')]['name']=_0x437be3[_0x1127('0xc2')][_0x1127('0xc3')];_0x437be3[_0x1127('0xb6')][_0x1127('0xc4')]=_0x437be3[_0x1127('0xc2')][_0x1127('0xc5')];_0x437be3[_0x1127('0xb6')][_0x1127('0xc6')]=_0x437be3[_0x1127('0xc2')][_0x1127('0xc7')];return db[_0x1127('0xc8')][_0x1127('0xb5')](_0x437be3['body'])[_0x1127('0x34')](respondWithResult(_0x529764,0xc9))['catch'](handleError(_0x529764,null));};exports[_0x1127('0xc9')]=function(_0x650d65,_0x1fed93,_0x34b2f9){return db[_0x1127('0x3f')][_0x1127('0xca')]({'where':{'id':_0x650d65['params']['id']},'raw':!![]})[_0x1127('0x34')](handleEntityNotFound(_0x1fed93,null))[_0x1127('0x34')](function(_0x120455){if(_0x120455){if(_0x120455[_0x1127('0xbf')]){return _0x1fed93[_0x1127('0x29')](0x193)[_0x1127('0x2b')]({'status':0x193,'message':_0x1127('0xcb')});}return db[_0x1127('0xc8')][_0x1127('0xca')]({'where':{'id':_0x650d65[_0x1127('0x42')][_0x1127('0xcc')]},'raw':!![]})['then'](handleEntityNotFound(_0x1fed93,null));}})['then'](function(_0x1868c1){if(_0x1868c1){return _0x1fed93[_0x1127('0xcd')](path[_0x1127('0x87')](config[_0x1127('0xce')],'server/files/attachments/',_0x1868c1[_0x1127('0xc4')]));}})[_0x1127('0x27')](handleError(_0x1fed93,null));};exports[_0x1127('0xcf')]=function(_0x4e1eb2,_0x455541){var _0x1ce4c6=null;var _0x2db805=null;var _0x42fd51=null;var _0x1471ee=null;if(_0x4e1eb2[_0x1127('0xb6')]['id']){delete _0x4e1eb2[_0x1127('0xb6')]['id'];}if(_0x4e1eb2[_0x1127('0xb6')][_0x1127('0xd0')]){_0x1471ee=path[_0x1127('0x87')](config[_0x1127('0xce')],'server/files/chat/upload/',util[_0x1127('0x65')](_0x1127('0xd1'),Date[_0x1127('0xd2')]()));_0x4e1eb2[_0x1127('0xb6')]['pathTranscript']=_0x1471ee;}return db[_0x1127('0x3f')][_0x1127('0xb4')]({'where':{'id':_0x4e1eb2[_0x1127('0xb0')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x1127('0xd3'),'include':[{'model':db[_0x1127('0xd4')],'as':_0x1127('0xd4')}]}]})[_0x1127('0x34')](handleEntityNotFound(_0x455541,null))[_0x1127('0x34')](saveUpdates(_0x4e1eb2[_0x1127('0xb6')],null))['then'](function(_0x4bb478){if(_0x4bb478){_0x1ce4c6=_0x4bb478;return db[_0x1127('0xd5')][_0x1127('0xb4')]({'where':{'id':_0x1ce4c6['ChatWebsiteId']}});}})[_0x1127('0x34')](function(_0x13b713){if(_0x13b713){_0x42fd51=_0x13b713;return db[_0x1127('0xd6')][_0x1127('0xb4')]({'where':{'id':_0x1ce4c6[_0x1127('0x6e')]}});}})[_0x1127('0x34')](function(_0x3a6726){if(_0x3a6726){_0x2db805=_0x3a6726;if(_0x1471ee){var _0x2572e0=null;for(var _0x12df5a=0x1;_0x12df5a<_0x1ce4c6[_0x1127('0xd3')]['length'];++_0x12df5a){_0x2572e0=_0x1ce4c6[_0x1127('0xd3')][_0x12df5a];var _0x3fb284=_0x2572e0['UserId']?util[_0x1127('0x65')]('%s%d',_0x42fd51['agentAlias'],_0x2572e0[_0x1127('0xbc')]):_0x1127('0xd7');var _0x532f1c=_0x4e1eb2[_0x1127('0xb6')][_0x1127('0xd8')]||util[_0x1127('0x65')](_0x1127('0xd9'),_0x1127('0xda'),_0x2572e0[_0x1127('0x6e')]);switch(_0x42fd51[_0x1127('0xdb')]){case _0x1127('0xdc'):_0x3fb284=_0x2572e0['UserId']?util[_0x1127('0x65')](_0x1127('0xd9'),_0x42fd51[_0x1127('0xdd')],_0x2572e0[_0x1127('0xbc')]):_0x1127('0xd7');break;case _0x1127('0xde'):_0x3fb284=_0x2572e0[_0x1127('0xbc')]?_0x2572e0[_0x1127('0xd4')][_0x1127('0xdf')]||_0x2572e0[_0x1127('0xd4')][_0x1127('0xe0')]:_0x1127('0xd7');break;case _0x1127('0xe1'):_0x3fb284=_0x2572e0['UserId']?_0x2572e0['User'][_0x1127('0xe0')]:'System';break;default:_0x3fb284=_0x2572e0['UserId']?util['format'](_0x1127('0xd9'),_0x42fd51[_0x1127('0xdd')],_0x2572e0['UserId']):_0x1127('0xd7');}var _0x58a8de=util[_0x1127('0x65')](_0x1127('0xe2'),moment(_0x2572e0[_0x1127('0x61')])[_0x1127('0x65')](_0x1127('0xe3')),_0x2572e0[_0x1127('0xe4')]==='in'?_0x532f1c:_0x3fb284,_0x2572e0[_0x1127('0xb6')]);if(!_0x2572e0[_0x1127('0xe5')]){fs[_0x1127('0xe6')](_0x1471ee,_0x58a8de);}}return db[_0x1127('0xe7')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x1127('0xe8')],'as':_0x1127('0xe9'),'raw':!![]}]});}}})[_0x1127('0x34')](function(_0x3a265e){if(_0x3a265e&&_0x3a265e[_0x1127('0xe9')]&&_0x4e1eb2[_0x1127('0xb6')]){var _0x557529={'tls':{'rejectUnauthorized':![]}};if(_0x3a265e[_0x1127('0xe9')][_0x1127('0xea')]){_0x557529[_0x1127('0xea')]=_0x3a265e[_0x1127('0xe9')]['service'];}else{_0x557529[_0x1127('0xeb')]=_0x3a265e[_0x1127('0xe9')][_0x1127('0xeb')];_0x557529['port']=_0x3a265e[_0x1127('0xe9')][_0x1127('0xec')];_0x557529['secure']=_0x3a265e[_0x1127('0xe9')]['secure'];}if(_0x3a265e[_0x1127('0xe9')][_0x1127('0xed')]){_0x557529[_0x1127('0xee')]={'user':_0x3a265e[_0x1127('0xe9')][_0x1127('0xef')],'pass':_0x3a265e[_0x1127('0xe9')][_0x1127('0xf0')]};}return respondWithRpcPromise(_0x1127('0xf1'),_0x1127('0xf2'),{'account':_0x557529,'message':{'from':util[_0x1127('0x65')]('\x22%s\x22\x20<%s>',_0x3a265e['name'],_0x3a265e['email']||_0x3a265e[_0x1127('0xe9')][_0x1127('0xef')]),'to':_0x4e1eb2[_0x1127('0xb6')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x1127('0x65')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x4e1eb2[_0x1127('0xb6')][_0x1127('0xd0')]),'attachments':[{'path':_0x1471ee}]}})[_0x1127('0x34')](function(){return _0x1ce4c6;})['catch'](function(_0x8c97cc){console[_0x1127('0x21')](_0x8c97cc);});}else{return _0x1ce4c6;}})[_0x1127('0x34')](respondWithStatusCode(_0x455541,0xc8))[_0x1127('0x27')](handleError(_0x455541,null));};exports[_0x1127('0xf3')]=function(_0x1f148a,_0x15acab,_0x3f5f71){return db[_0x1127('0xf4')][_0x1127('0xb4')]({'where':{'id':_0x1f148a['params']['id']}})[_0x1127('0x34')](handleEntityNotFound(_0x15acab,null))[_0x1127('0x34')](function(_0x16f340){if(_0x16f340){return _0x16f340[_0x1127('0xf3')](_0x1f148a[_0x1127('0xb6')][_0x1127('0xf5')],_[_0x1127('0xf6')](_0x1f148a[_0x1127('0xb6')],['ids','id'])||{});}})['then'](respondWithResult(_0x15acab,null))[_0x1127('0x27')](handleError(_0x15acab,null));};exports[_0x1127('0xf7')]=function(_0x284f6c,_0x3fd767,_0x5de195){var _0x32e447={'raw':![],'where':{}};var _0x13e7f2={};var _0x5294e3={'count':0x0,'rows':[]};return db[_0x1127('0x3f')]['findOne']({'where':{'id':_0x284f6c[_0x1127('0xb0')]['id']}})[_0x1127('0x34')](handleEntityNotFound(_0x3fd767,null))[_0x1127('0x34')](function(_0x14ff8b){if(_0x14ff8b){_0x13e7f2['model']=_[_0x1127('0x41')](db['ChatMessage'][_0x1127('0x40')]);_0x13e7f2[_0x1127('0x42')]=_[_0x1127('0x41')](_0x284f6c[_0x1127('0x42')]);_0x13e7f2[_0x1127('0x43')]=_[_0x1127('0x44')](_0x13e7f2['model'],_0x13e7f2[_0x1127('0x42')]);_0x32e447['attributes']=_[_0x1127('0x44')](_0x13e7f2[_0x1127('0x45')],qs[_0x1127('0xb1')](_0x284f6c[_0x1127('0x42')][_0x1127('0xb1')]));_0x32e447[_0x1127('0x46')]=_0x32e447[_0x1127('0x46')][_0x1127('0x47')]?_0x32e447[_0x1127('0x46')]:_0x13e7f2['model'];if(!_0x284f6c[_0x1127('0x42')][_0x1127('0x48')]('nolimit')){_0x32e447[_0x1127('0x2e')]=qs[_0x1127('0x2e')](_0x284f6c['query'][_0x1127('0x2e')]);_0x32e447['offset']=qs['offset'](_0x284f6c['query'][_0x1127('0x2d')]);}_0x32e447[_0x1127('0x49')]=qs['sort'](_0x284f6c[_0x1127('0x42')][_0x1127('0x4a')]);_0x32e447[_0x1127('0x4b')]=qs[_0x1127('0x43')](_[_0x1127('0xf8')](_0x284f6c['query'],_0x13e7f2[_0x1127('0x43')]));_0x32e447[_0x1127('0x4b')][_0x1127('0xf9')]=_0x14ff8b['id'];if(_0x284f6c['query'][_0x1127('0x79')]){_0x32e447[_0x1127('0x4b')]=_[_0x1127('0x9d')](_0x32e447[_0x1127('0x4b')],{'$or':_[_0x1127('0x78')](_0x32e447[_0x1127('0x46')],function(_0x483b3f){var _0xacafde={};_0xacafde[_0x483b3f]={'$like':'%'+_0x284f6c[_0x1127('0x42')][_0x1127('0x79')]+'%'};return _0xacafde;})});}if(_0x284f6c[_0x1127('0x42')][_0x1127('0x7f')]){var _0x7f203a=_0x284f6c[_0x1127('0x42')][_0x1127('0x7f')][_0x1127('0x3b')](',');var _0x33fa5d={};_0x33fa5d[_0x7f203a[0x0]]={'$gte':moment(_0x7f203a[0x1])[_0x1127('0x65')](_0x1127('0xfa'))};_0x32e447[_0x1127('0x4b')]=_[_0x1127('0x9d')](_0x32e447[_0x1127('0x4b')],_0x33fa5d);}_0x32e447=_[_0x1127('0x9d')]({},_0x32e447,_0x284f6c[_0x1127('0xb3')]);return db[_0x1127('0xf4')]['count']({'where':_0x32e447[_0x1127('0x4b')]})[_0x1127('0x34')](function(_0x1a4e19){_0x5294e3[_0x1127('0x2c')]=_0x1a4e19;if(_0x284f6c[_0x1127('0x42')][_0x1127('0xb2')]){_0x32e447[_0x1127('0xfb')]=[{'all':!![]}];}return db[_0x1127('0xf4')][_0x1127('0xfc')](_0x32e447);})[_0x1127('0x34')](function(_0xe2d452){_0x5294e3['rows']=_0xe2d452;return _0x5294e3;});}})[_0x1127('0x34')](respondWithFilteredResult(_0x3fd767,_0x32e447))[_0x1127('0x27')](handleError(_0x3fd767,null));};exports[_0x1127('0xfd')]=function(_0x499718,_0x39998e,_0x25401e){var _0x253ac5={'where':{}},_0x2ac3bb={},_0x39a5c4={'count':0x0,'rows':[]};return db[_0x1127('0x3f')][_0x1127('0xca')]({'where':{'id':_0x499718[_0x1127('0xb0')]['id']}})['then'](handleEntityNotFound(_0x39998e,null))['then'](function(_0x643f6a){if(_0x643f6a){_0x2ac3bb[_0x1127('0x45')]=_['keys'](db[_0x1127('0xf4')][_0x1127('0x40')]);_0x2ac3bb[_0x1127('0x42')]=_[_0x1127('0x41')](_0x499718[_0x1127('0x42')]);_0x2ac3bb[_0x1127('0x43')]=_[_0x1127('0x44')](_0x2ac3bb[_0x1127('0x45')],_0x2ac3bb[_0x1127('0x42')]);_0x253ac5[_0x1127('0x46')]=_[_0x1127('0x44')](_0x2ac3bb['model'],qs['fields'](_0x499718[_0x1127('0x42')][_0x1127('0xb1')]));_0x253ac5[_0x1127('0x46')]=_0x253ac5[_0x1127('0x46')][_0x1127('0x47')]?_0x253ac5[_0x1127('0x46')]:_0x2ac3bb[_0x1127('0x45')];if(!_0x499718[_0x1127('0x42')]['hasOwnProperty'](_0x1127('0xfe'))){_0x253ac5[_0x1127('0x2e')]=qs[_0x1127('0x2e')](_0x499718[_0x1127('0x42')][_0x1127('0x2e')]);_0x253ac5[_0x1127('0x2d')]=qs[_0x1127('0x2d')](_0x499718['query'][_0x1127('0x2d')]);}_0x253ac5[_0x1127('0x49')]=qs[_0x1127('0x4a')](_0x499718[_0x1127('0x42')][_0x1127('0x4a')]);_0x253ac5[_0x1127('0x4b')]=qs['filters'](_[_0x1127('0xf8')](_0x499718[_0x1127('0x42')],_0x2ac3bb[_0x1127('0x43')]));_0x253ac5[_0x1127('0x4b')][_0x1127('0xf9')]=_0x643f6a['id'];if(_0x499718[_0x1127('0x42')][_0x1127('0x79')]){_0x253ac5[_0x1127('0x4b')]=_[_0x1127('0x9d')](_0x253ac5[_0x1127('0x4b')],{'$or':_[_0x1127('0x78')](_0x253ac5[_0x1127('0x46')],function(_0x4fdded){var _0x813122={};_0x813122[_0x4fdded]={'$like':'%'+_0x499718[_0x1127('0x42')][_0x1127('0x79')]+'%'};return _0x813122;})});}_0x253ac5[_0x1127('0x4b')][_0x1127('0xe5')]=![];if(_0x499718[_0x1127('0x42')]['id']){_0x253ac5[_0x1127('0x4b')]['id']={'$gt':_0x499718[_0x1127('0x42')]['id']};}_0x253ac5=_[_0x1127('0x9d')]({},_0x253ac5,_0x499718[_0x1127('0xb3')]);return db[_0x1127('0xf4')]['count']({'where':_0x253ac5[_0x1127('0x4b')]})[_0x1127('0x34')](function(_0x8aeb76){_0x39a5c4[_0x1127('0x2c')]=_0x8aeb76;_0x253ac5[_0x1127('0xfb')]=[];if(_0x499718[_0x1127('0x42')][_0x1127('0xff')]){_0x253ac5[_0x1127('0xfb')][_0x1127('0x3d')]({'model':db['User'],'as':_0x1127('0xd4'),'attributes':['id',_0x1127('0xe0'),_0x1127('0xdf')]});}if(_0x499718['query'][_0x1127('0xb2')]){_0x253ac5[_0x1127('0xfb')]=[{'all':!![]}];}return db[_0x1127('0xf4')][_0x1127('0xfc')](_0x253ac5);})[_0x1127('0x34')](function(_0x350bb8){_0x39a5c4[_0x1127('0xae')]=_0x350bb8;return _0x39a5c4;});}})[_0x1127('0x34')](respondWithFilteredResult(_0x39998e,_0x253ac5))['catch'](handleError(_0x39998e,null));};exports['addTags']=function(_0x1d25c4,_0x461ec4,_0x1746a9){return db[_0x1127('0x3f')][_0x1127('0xb4')]({'where':{'id':_0x1d25c4['params']['id']}})[_0x1127('0x34')](handleEntityNotFound(_0x461ec4,null))['then'](function(_0x12c037){if(_0x12c037){return _0x12c037[_0x1127('0x100')](_0x1d25c4[_0x1127('0xb6')]['ids'],_['omit'](_0x1d25c4[_0x1127('0xb6')],[_0x1127('0xf5'),'id'])||{})[_0x1127('0x101')](function(){return db[_0x1127('0x102')]['findAll']({'attributes':['id',_0x1127('0x37'),_0x1127('0x4d')],'where':{'id':_0x1d25c4[_0x1127('0xb6')]['ids']}});})[_0x1127('0x34')](function(_0x20e709){socket[_0x1127('0x103')](_0x1127('0x104'),{'id':Number(_0x1d25c4[_0x1127('0xb0')]['id']),'tags':_0x20e709||[]});return{'id':Number(_0x1d25c4[_0x1127('0xb0')]['id']),'tags':_0x20e709||[]};});}})[_0x1127('0x34')](respondWithResult(_0x461ec4,null))[_0x1127('0x27')](handleError(_0x461ec4,null));};exports[_0x1127('0x105')]=function(_0x509d55,_0x50ac61,_0xb3507){return db[_0x1127('0x3f')][_0x1127('0xb4')]({'where':{'id':_0x509d55[_0x1127('0xb0')]['id']}})[_0x1127('0x34')](handleEntityNotFound(_0x50ac61,null))['then'](function(_0x310ce4){if(_0x310ce4){return _0x310ce4['removeTags'](_0x509d55[_0x1127('0x42')]['ids']);}})[_0x1127('0x34')](respondWithStatusCode(_0x50ac61,null))['catch'](handleError(_0x50ac61,null));};exports[_0x1127('0xcd')]=function(_0x5b7f82,_0x20841a){var _0xa8a20d=moment()[_0x1127('0x106')]()[_0x1127('0x86')]();var _0xdc3968=path[_0x1127('0x87')](config['root'],_0x1127('0x107'),_0x1127('0x108'),_0x1127('0x109'));var _0x519de6=path[_0x1127('0x87')](config[_0x1127('0xce')],'server','files','attachments');var _0x30befa=path[_0x1127('0x87')](_0xdc3968,_0xa8a20d);var _0x588918=util['format']('transcript-%d-%s.zip',_0x5b7f82[_0x1127('0xb0')]['id'],_0xa8a20d);var _0x4473fb=path['join'](_0xdc3968,_0x588918);var _0x69c565=![];return db['ChatInteraction'][_0x1127('0xb4')]({'where':{'id':_0x5b7f82[_0x1127('0xb0')]['id']},'include':[{'model':db[_0x1127('0xf4')],'as':_0x1127('0xd3'),'attributes':['id',_0x1127('0xb6'),_0x1127('0x61'),_0x1127('0xe4'),_0x1127('0xe5')],'include':[{'model':db[_0x1127('0xd4')],'as':_0x1127('0xd4'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x1127('0xd6')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]},{'model':db[_0x1127('0xc8')],'as':'Attachment','raw':!![]}]},{'model':db[_0x1127('0xd5')],'as':'Account','attributes':['id',_0x1127('0x37')]},{'model':db[_0x1127('0xd4')],'as':_0x1127('0x10a'),'attributes':['id',_0x1127('0xe0')]}]})[_0x1127('0x34')](handleEntityNotFound(_0x20841a,null))['then'](function(_0x4beeb3){if(_0x4beeb3){var _0x38ee4a=_0x4beeb3['get']({'plain':!![]});_0x69c565=!![];var _0x2ad33b={'format':'A4','border':_0x1127('0x10b'),'header':{'height':_0x1127('0x10c'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x1127('0x10d'),'contents':{'default':util['format'](_0x1127('0x10e'),util[_0x1127('0x65')](_0x1127('0x10f'),'Chat',_0x38ee4a['id']),moment()[_0x1127('0x65')](_0x1127('0x110'))[_0x1127('0x86')]())}}};fs[_0x1127('0x111')](_0x30befa);var _0x223d79={'channel':_0x1127('0x112'),'account':_0x38ee4a[_0x1127('0x113')][_0x1127('0x37')],'agent':_0x38ee4a[_0x1127('0x10a')]?_0x38ee4a[_0x1127('0x10a')][_0x1127('0xe0')]:'N.A.','createdAt':moment(_0x38ee4a[_0x1127('0x61')])[_0x1127('0x65')](_0x1127('0xfa'))[_0x1127('0x86')](),'closedAt':_0x38ee4a['closed']?moment(_0x38ee4a[_0x1127('0x114')])[_0x1127('0x65')](_0x1127('0xfa'))[_0x1127('0x86')]():'','disposition':_0x38ee4a[_0x1127('0x115')],'chatInfo':{'browser':_0x38ee4a[_0x1127('0x116')],'os':_0x38ee4a[_0x1127('0x117')],'referer':_0x38ee4a[_0x1127('0x118')],'customerIp':_0x38ee4a[_0x1127('0x119')],'customerPort':_0x38ee4a[_0x1127('0x11a')]?_0x38ee4a[_0x1127('0x11a')]:_0x1127('0x11b')},'messages':_(_0x38ee4a[_0x1127('0xd3')])[_0x1127('0x11c')]()[_0x1127('0x79')]({'secret':![]})[_0x1127('0x78')](function(_0x57974e){if(_0x57974e['Attachment']){var _0xe086b6=path[_0x1127('0x87')](_0x519de6,_0x57974e[_0x1127('0xc8')][_0x1127('0xc4')]);if(fs[_0x1127('0x11d')](_0xe086b6)){fs[_0x1127('0x11e')](_0xe086b6)[_0x1127('0x11f')](fs['createWriteStream'](path[_0x1127('0x87')](_0x30befa,_0x57974e[_0x1127('0xc8')][_0x1127('0xc4')])));}}return{'date':moment(_0x57974e[_0x1127('0x61')])[_0x1127('0x65')](_0x1127('0xfa'))[_0x1127('0x86')](),'sender':_0x57974e[_0x1127('0xe4')]===_0x1127('0x120')?_0x57974e[_0x1127('0xd4')]?_0x57974e[_0x1127('0xd4')][_0x1127('0xe0')]:_0x1127('0xd7'):_0x57974e[_0x1127('0x121')][_0x1127('0x122')]+(_0x57974e['Contact']['lastName']?'\x20'+_0x57974e[_0x1127('0x121')][_0x1127('0x123')]:''),'body':_0x57974e[_0x1127('0xc8')]?_0x57974e[_0x1127('0xc8')][_0x1127('0xc4')]:_0x57974e[_0x1127('0xb6')],'direction':_0x57974e['direction']===_0x1127('0x120')?'A':'C','secret':_0x57974e[_0x1127('0xe5')],'attachment':_0x57974e[_0x1127('0xc8')]};})['value']()};return ejs['renderFile'](path[_0x1127('0x87')](config[_0x1127('0xce')],_0x1127('0x107'),_0x1127('0x124'),_0x1127('0x125')),{'interaction':_0x223d79})[_0x1127('0x34')](function(_0x5ec224){return new BPromise(function(_0x3e747b,_0x8bb0d0){pdf['create'](_0x5ec224,_0x2ad33b)[_0x1127('0x126')](path[_0x1127('0x87')](_0x30befa,_0x1127('0x127')+_0x38ee4a['id']+'-'+_0xa8a20d+_0x1127('0x128')),function(_0x298b3f,_0x540d38){if(_0x298b3f)return _0x8bb0d0(_0x298b3f);_0x3e747b(_0x540d38);});});});}})[_0x1127('0x34')](function(){if(_0x69c565){return new BPromise(function(_0xc5c237,_0xb4ffed){zipdir(_0x30befa,{'saveTo':_0x4473fb},function(_0x43354c,_0x29ad73){if(_0x43354c)return _0xb4ffed(_0x43354c);return _0xc5c237(_0x29ad73);});})[_0x1127('0x34')](function(){return new BPromise(function(_0x24a75d,_0x5a16f3){rimraf(_0x30befa,function(_0x57d0b4){if(_0x57d0b4)_0x5a16f3(_0x57d0b4);return _0x24a75d();});});})[_0x1127('0x34')](function(){return _0x20841a['download'](_0x4473fb,_0x588918,function(_0x43640f){if(_0x43640f){console[_0x1127('0x129')]('err',_0x43640f);}else{fs[_0x1127('0x12a')](_0x4473fb);}});});}else{return _0x20841a[_0x1127('0x28')](0xc8);}})[_0x1127('0x27')](handleError(_0x20841a,null));}; \ No newline at end of file +var _0x03b9=['closedAt','disposition','browserName','referer','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','lastName','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','err','unlinkSync','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','Users','TagIds','Tags','index','ChatInteraction','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','field','color','tools_tags','select','COUNT(*)','from','chat_messages','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.ChatInteractionId','u.id\x20=\x20ui.UserId','chat_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','me.ChatInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','advancedFilter','forEach','createdAt','value','dateStart','startOf','format','utc','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','\x20IN\x20?','c.lastName','map','filter','isNil','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','QueryTypes','SELECT','COUNT(me.id)','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.ChatInteractionId\x20=\x20i.id','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','sequelize','toString','keyBy','merge','a.key','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','chat_interaction_has_tags','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','show','includeAll','options','find','create','body','params','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Sequelize','ValidationError','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','findOne','attachId','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','CmContact','agentAlias','System','customer','Visitor','website_alias','UserId','alias','fullname','agent_fullname','%s%d','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','split','YYYY-MM-DD\x20HH:mm:ss','include','nolimit','includeAgent','push','findAll','rows','addTags','setTags','Tag','emit','chatInteractionTags:save','removeTags','download','unix','server','files','attachments','Contact','firstName','ChatWebsite','Account','Owner','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Chat','YYYY-MM-DD','mkdirSync'];(function(_0xeea277,_0x56ce7b){var _0x4a84cb=function(_0x3acad0){while(--_0x3acad0){_0xeea277['push'](_0xeea277['shift']());}};_0x4a84cb(++_0x56ce7b);}(_0x03b9,0x136));var _0x903b=function(_0x424b3c,_0x3f03b5){_0x424b3c=_0x424b3c-0x0;var _0x40b7fe=_0x03b9[_0x424b3c];return _0x40b7fe;};'use strict';var pdf=require(_0x903b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x903b('0x1'));var jsonpatch=require(_0x903b('0x2'));var rp=require(_0x903b('0x3'));var moment=require(_0x903b('0x4'));var BPromise=require(_0x903b('0x5'));var Mustache=require(_0x903b('0x6'));var util=require('util');var path=require('path');var sox=require(_0x903b('0x7'));var csv=require(_0x903b('0x8'));var ejs=require(_0x903b('0x9'));var fs=require('fs');var _=require(_0x903b('0xa'));var squel=require(_0x903b('0xb'));var crypto=require(_0x903b('0xc'));var jsforce=require(_0x903b('0xd'));var deskjs=require(_0x903b('0xe'));var toCsv=require(_0x903b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x903b('0xf'));var authService=require(_0x903b('0x10'));var qs=require(_0x903b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x903b('0x12'))(_0x903b('0x13'));var utils=require(_0x903b('0x14'));var config=require('../../config/environment');var db=require(_0x903b('0x15'))['db'];config['redis']=_[_0x903b('0x16')](config[_0x903b('0x17')],{'host':_0x903b('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x903b('0x17')]));require(_0x903b('0x19'))['register'](socket);var jayson=require(_0x903b('0x1a'));var client=jayson[_0x903b('0x1b')][_0x903b('0x1c')]({'port':0x232b});var client9004=jayson['client'][_0x903b('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x3dccb0,_0x140221,_0x167540){if(_0x167540){var _0x28d294=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28d294['test'](_0x140221)){return _0x3dccb0;}else{throw new Error(_0x903b('0x1d'));}}else{return _0x3dccb0;}}function respondWithRpcPromise(_0x5e435b,_0x416be2,_0x5b0920,_0x226fdf){return new BPromise(function(_0xa07254,_0x203afe){var _0x223091=_0x226fdf||client;return _0x223091['request'](_0x5e435b,_0x5b0920)['then'](function(_0x2334e5){logger[_0x903b('0x1e')](_0x903b('0x1f'),_0x416be2,_0x903b('0x20'));logger[_0x903b('0x21')](_0x903b('0x22'),_0x416be2,_0x903b('0x20'),JSON['stringify'](_0x2334e5));if(_0x2334e5[_0x903b('0x23')]){if(_0x2334e5['error'][_0x903b('0x24')]===0x1f4){logger[_0x903b('0x23')](_0x903b('0x1f'),_0x416be2,_0x2334e5[_0x903b('0x23')][_0x903b('0x25')]);return _0x203afe(_0x2334e5[_0x903b('0x23')][_0x903b('0x25')]);}logger[_0x903b('0x23')](_0x903b('0x1f'),_0x416be2,_0x2334e5[_0x903b('0x23')][_0x903b('0x25')]);return _0xa07254(_0x2334e5[_0x903b('0x23')]['message']);}else{logger[_0x903b('0x1e')](_0x903b('0x1f'),_0x416be2,_0x903b('0x20'));_0xa07254(_0x2334e5[_0x903b('0x26')]['message']);}})[_0x903b('0x27')](function(_0x3c9296){logger[_0x903b('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x416be2,_0x3c9296);_0x203afe(_0x3c9296);});});}function respondWithStatusCode(_0x551412,_0x36a33b){_0x36a33b=_0x36a33b||0xcc;return function(_0x1f95e6){if(_0x1f95e6){return _0x551412[_0x903b('0x28')](_0x36a33b);}return _0x551412[_0x903b('0x29')](_0x36a33b)[_0x903b('0x2a')]();};}function respondWithResult(_0x1f923f,_0x5ad3f9){_0x5ad3f9=_0x5ad3f9||0xc8;return function(_0x2b1ead){if(_0x2b1ead){return _0x1f923f['status'](_0x5ad3f9)[_0x903b('0x2b')](_0x2b1ead);}};}function respondWithFilteredResult(_0x497631,_0x3afc1b){return function(_0x2c0e25){if(_0x2c0e25){var _0xc3dbfb=_0x2c0e25[_0x903b('0x2c')],_0x2e0984=_0x3afc1b[_0x903b('0x2d')],_0x163ab3=_0x3afc1b['offset']+_0x3afc1b[_0x903b('0x2e')],_0x79f9cd;if(_0x163ab3>=_0xc3dbfb){_0x163ab3=_0xc3dbfb;_0x79f9cd=0xc8;}else{_0x79f9cd=0xce;}_0x497631[_0x903b('0x29')](_0x79f9cd);return _0x497631[_0x903b('0x2f')](_0x903b('0x30'),_0x2e0984+'-'+_0x163ab3+'/'+_0xc3dbfb)[_0x903b('0x2b')](_0x2c0e25);}return null;};}function patchUpdates(_0x1af375){return function(_0x73050d){try{jsonpatch[_0x903b('0x31')](_0x73050d,_0x1af375,!![]);}catch(_0x1a0758){return BPromise['reject'](_0x1a0758);}return _0x73050d[_0x903b('0x32')]();};}function saveUpdates(_0x2164a3,_0x452be2){return function(_0x178f67){if(_0x178f67){return _0x178f67[_0x903b('0x33')](_0x2164a3)[_0x903b('0x34')](function(_0x217863){return _0x217863;});}return null;};}function removeEntity(_0x1bc832,_0x5f2093){return function(_0x26cacc){if(_0x26cacc){return _0x26cacc[_0x903b('0x35')]()[_0x903b('0x34')](function(){_0x1bc832[_0x903b('0x29')](0xcc)[_0x903b('0x2a')]();});}};}function handleEntityNotFound(_0x4ac146,_0x49aa7c){return function(_0x53701c){if(!_0x53701c){_0x4ac146[_0x903b('0x28')](0x194);}return _0x53701c;};}function handleError(_0x47fe79,_0x2e92a1){_0x2e92a1=_0x2e92a1||0x1f4;return function(_0x9fe6e0){logger[_0x903b('0x23')](_0x9fe6e0[_0x903b('0x36')]);if(_0x9fe6e0[_0x903b('0x37')]){delete _0x9fe6e0[_0x903b('0x37')];}_0x47fe79['status'](_0x2e92a1)[_0x903b('0x38')](_0x9fe6e0);};}function getInteractionUsers(_0x135fef,_0x493639){return new BPromise(function(_0x3c3710,_0x16a1f9){try{if(_0x493639[_0x135fef['id']]){_0x135fef[_0x903b('0x39')]=_['map'](_0x493639[_0x135fef['id']],function(_0x5263bf){return{'id':_0x5263bf['id']};});}}catch(_0x70a8e5){_0x16a1f9(_0x70a8e5);}_0x3c3710(_0x135fef);});}function getInteractionTags(_0x298f7d,_0x2fc36e){return new BPromise(function(_0x4c5885,_0x354ece){try{if(_0x298f7d[_0x903b('0x3a')]){_0x298f7d[_0x903b('0x3b')]=[];_0x298f7d[_0x903b('0x3a')]['split'](',')['forEach'](function(_0x33b296){_0x298f7d[_0x903b('0x3b')]['push'](_0x2fc36e[_0x33b296]);});}delete _0x298f7d[_0x903b('0x3a')];}catch(_0x5ad3bf){_0x354ece(_0x5ad3bf);}_0x4c5885(_0x298f7d);});}function updateChatInteraction(_0x426ad0,_0x1a31e0,_0x232dc6){return new BPromise(function(_0x272a73,_0x3d5529){return getInteractionUsers(_0x426ad0,_0x232dc6)[_0x903b('0x34')](function(_0xaff669){return getInteractionTags(_0xaff669,_0x1a31e0);})['then'](function(_0x2b783a){_0x272a73(_0x2b783a);})[_0x903b('0x27')](function(_0x260d5b){_0x3d5529(_0x260d5b);});});}exports[_0x903b('0x3c')]=function(_0x5f0a1f,_0x49436d){var _0x18cc1a={},_0x1500af={},_0xe878e1={'count':0x0,'rows':[]};var _0x329f14=db[_0x903b('0x3d')][_0x903b('0x3e')];_0x1500af['model']=_[_0x903b('0x3f')](_0x329f14);_0x1500af[_0x903b('0x40')]=_[_0x903b('0x3f')](_0x5f0a1f[_0x903b('0x40')]);_0x1500af[_0x903b('0x41')]=_[_0x903b('0x42')](_0x1500af[_0x903b('0x43')],_0x1500af[_0x903b('0x40')]);_0x18cc1a['attributes']=_[_0x903b('0x42')](_0x1500af[_0x903b('0x43')],qs[_0x903b('0x44')](_0x5f0a1f['query'][_0x903b('0x44')]));_0x18cc1a['attributes']=_0x18cc1a[_0x903b('0x45')][_0x903b('0x46')]?_0x18cc1a[_0x903b('0x45')]:_0x1500af['model'];if(!_0x5f0a1f[_0x903b('0x40')][_0x903b('0x47')]('nolimit')){_0x18cc1a[_0x903b('0x2e')]=qs['limit'](_0x5f0a1f[_0x903b('0x40')]['limit']);_0x18cc1a[_0x903b('0x2d')]=qs[_0x903b('0x2d')](_0x5f0a1f[_0x903b('0x40')][_0x903b('0x2d')]);}_0x18cc1a[_0x903b('0x48')]=qs[_0x903b('0x49')](_0x5f0a1f[_0x903b('0x40')]['sort']);_0x18cc1a[_0x903b('0x4a')]=qs[_0x903b('0x41')](_[_0x903b('0x4b')](_0x5f0a1f[_0x903b('0x40')],_0x1500af['filters']));var _0xce8031=[];var _0x23be96=squel['select']()[_0x903b('0x4c')]('id')[_0x903b('0x4c')]('name')['field'](_0x903b('0x4d'))['from'](_0x903b('0x4e'));var _0x5d0158=squel[_0x903b('0x4f')]()[_0x903b('0x4c')](_0x903b('0x50'))[_0x903b('0x51')](_0x903b('0x52'),'me')[_0x903b('0x4a')](_0x903b('0x53'))[_0x903b('0x4a')](_0x903b('0x54'))[_0x903b('0x4a')](_0x903b('0x55'));var _0x4edeec=squel[_0x903b('0x4f')]()[_0x903b('0x4c')](_0x903b('0x56'))[_0x903b('0x4c')](_0x903b('0x57'))[_0x903b('0x51')]('user_has_chat_interactions','ui')['left_join']('users','u',_0x903b('0x58'));var _0x5b2afb=squel['select']()[_0x903b('0x51')](_0x903b('0x59'),'i')[_0x903b('0x5a')]('cm_contacts','c',_0x903b('0x5b'))[_0x903b('0x5a')]('users','o',_0x903b('0x5c'))[_0x903b('0x5a')](_0x903b('0x5d'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x903b('0x5a')](_0x903b('0x52'),'me',_0x903b('0x5e'));var _0x494787=squel['expr']();if(_0x5f0a1f[_0x903b('0x40')][_0x903b('0x5f')]){var _0x607811=JSON['parse'](_0x5f0a1f[_0x903b('0x40')]['advancedFilter']);_[_0x903b('0x3f')](_0x607811)[_0x903b('0x60')](function(_0x29b728){var _0x1d2d88=_0x607811[_0x29b728];if(_0x29b728===_0x903b('0x61')){var _0x57d53b=moment(_0x1d2d88[_0x903b('0x62')][_0x903b('0x63')])[_0x903b('0x64')]('day')['utc']()[_0x903b('0x65')]();var _0x5252f1=moment(_0x5252f1)[_0x903b('0x66')]()['endOf'](_0x903b('0x67'))['format']();_0x494787[_0x903b('0x68')](_0x903b('0x69'),_0x57d53b,_0x5252f1);}else{if(_[_0x903b('0x6a')](_0x1d2d88['condition'])){_0x1d2d88[_0x903b('0x6b')][_0x903b('0x60')](function(_0x4daa16){switch(_0x1d2d88['condition'][_0x903b('0x62')]){case'IS':if(_0x29b728!==_0x903b('0x6c')&&_0x29b728!==_0x903b('0x6d')){if(_[_0x903b('0x6a')](_0x1d2d88[_0x903b('0x62')])&&_0x1d2d88[_0x903b('0x62')][_0x903b('0x46')]>0x1){_0x494787[_0x903b('0x68')](_0x1d2d88[_0x903b('0x6e')]+'.'+_0x29b728+'\x20IN\x20?',_0x1d2d88[_0x903b('0x62')]);}else{_0x494787[_0x903b('0x68')](_0x1d2d88['tableAlias']+'.'+_0x29b728+'\x20=\x20?',_0x1d2d88[_0x903b('0x62')][0x0]);}}break;case'=':_0x494787[_0x903b('0x68')](_0x1d2d88[_0x903b('0x6e')]+'.'+_0x29b728+_0x903b('0x6f'),_0x1d2d88[_0x903b('0x62')]);break;case _0x903b('0x70'):if(_0x29b728===_0x903b('0x71')){_0x494787['and'](_0x903b('0x72')+_0x903b('0x73'),'%'+_0x1d2d88[_0x903b('0x62')]+'%');_0x494787['or']('c.lastName'+'\x20LIKE\x20?','%'+_0x1d2d88[_0x903b('0x62')]+'%');_0x494787['or'](_0x903b('0x74')+_0x903b('0x73'),'%'+_0x1d2d88['value']+'%');}else{_0x494787[_0x903b('0x68')](_0x1d2d88['tableAlias']+'.'+_0x29b728+_0x903b('0x73'),'%'+_0x1d2d88[_0x903b('0x62')]+'%');}break;case'>':_0x494787[_0x903b('0x68')](_0x1d2d88['tableAlias']+'.'+_0x29b728+_0x903b('0x75'),_0x1d2d88[_0x903b('0x62')]);break;case'<':_0x494787[_0x903b('0x68')](_0x1d2d88['tableAlias']+'.'+_0x29b728+_0x903b('0x76'),_0x1d2d88['value']);break;}});}else{switch(_0x1d2d88[_0x903b('0x6b')][_0x903b('0x62')]){case'IS':if(_0x29b728!=='TagId'&&_0x29b728!==_0x903b('0x6d')){if(_[_0x903b('0x6a')](_0x1d2d88[_0x903b('0x62')])&&_0x1d2d88[_0x903b('0x62')][_0x903b('0x46')]>0x1){_0x494787['and'](_0x1d2d88[_0x903b('0x6e')]+'.'+_0x29b728+_0x903b('0x77'),_0x1d2d88['value']);}else{_0x494787[_0x903b('0x68')](_0x1d2d88[_0x903b('0x6e')]+'.'+_0x29b728+'\x20=\x20?',_0x1d2d88[_0x903b('0x62')][0x0]);}}break;case'=':_0x494787[_0x903b('0x68')](_0x1d2d88[_0x903b('0x6e')]+'.'+_0x29b728+_0x903b('0x6f'),_0x1d2d88['value']);break;case _0x903b('0x70'):if(_0x29b728===_0x903b('0x71')){_0x494787[_0x903b('0x68')](_0x903b('0x72')+_0x903b('0x73'),'%'+_0x1d2d88['value']+'%');_0x494787['or'](_0x903b('0x78')+_0x903b('0x73'),'%'+_0x1d2d88[_0x903b('0x62')]+'%');_0x494787['or'](_0x903b('0x74')+_0x903b('0x73'),'%'+_0x1d2d88[_0x903b('0x62')]+'%');}else{_0x494787[_0x903b('0x68')](_0x1d2d88[_0x903b('0x6e')]+'.'+_0x29b728+_0x903b('0x73'),'%'+_0x1d2d88[_0x903b('0x62')]+'%');}break;case'>':_0x494787[_0x903b('0x68')](_0x1d2d88[_0x903b('0x6e')]+'.'+_0x29b728+_0x903b('0x75'),_0x1d2d88['value']);break;case'<':_0x494787['and'](_0x1d2d88['tableAlias']+'.'+_0x29b728+_0x903b('0x76'),_0x1d2d88['value']);break;}}}});}else{var _0x219d78=_(Object['keys'](_0x5f0a1f['query']))[_0x903b('0x79')](function(_0x60dd2a){return _0x329f14[_0x903b('0x47')](_0x60dd2a)?_0x60dd2a:undefined;})[_0x903b('0x7a')](function(_0x3627f2){return!_[_0x903b('0x7b')](_0x3627f2);})['value']();if(!_[_0x903b('0x7c')](_0x219d78)){_0x219d78[_0x903b('0x60')](function(_0x2033cd){if(_0x2033cd===_0x903b('0x7d')){_0x5b2afb[_0x903b('0x4a')](_0x903b('0x7e'),[][_0x903b('0x7f')](_0x5f0a1f[_0x903b('0x40')][_0x2033cd]));}else if(_0x2033cd==='createdAt'){var _0x2d067e=JSON[_0x903b('0x80')](_0x5f0a1f[_0x903b('0x40')][_0x2033cd])[_0x903b('0x81')];var _0x1f034f=JSON[_0x903b('0x80')](_0x5f0a1f['query'][_0x2033cd])[_0x903b('0x82')];_0x5b2afb['where'](_0x903b('0x69'),_0x2d067e,_0x1f034f);}else{if(_0x5f0a1f[_0x903b('0x40')][_0x2033cd]==='null'){_0x5b2afb[_0x903b('0x4a')]('i.'+_0x2033cd+'\x20IS\x20NULL');}else{_0x5b2afb[_0x903b('0x4a')]('i.'+_0x2033cd+_0x903b('0x6f'),_0x5f0a1f[_0x903b('0x40')][_0x2033cd]);}}});}if(_0x5f0a1f[_0x903b('0x40')][_0x903b('0x7a')]){var _0x1f5a87=_0x5f0a1f[_0x903b('0x40')]['filter']['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x903b('0x83'));if(qs[_0x903b('0x84')](_0x1f5a87)){_0x494787['or'](_0x903b('0x85'),_0x1f5a87+'%');}else{var _0x266897=[];_0x1f5a87['split']('\x20')[_0x903b('0x60')](function(_0x135d21){_0x266897['push']('+'+_0x135d21['toString']());});var _0x167b32=_0x266897[_0x903b('0x86')]('\x20');_0x494787['or'](_0x903b('0x87'),_0x167b32)['or'](_0x903b('0x88'),_0x1f5a87+'%');}}}_0x5b2afb[_0x903b('0x4a')](_0x494787);if(_0x18cc1a[_0x903b('0x48')]){_0x18cc1a[_0x903b('0x48')]['forEach'](function(_0x4ceaa2){_0x5b2afb[_0x903b('0x48')]('i.'+_0x4ceaa2[0x0],_0x4ceaa2[0x1]===_0x903b('0x89')?![]:!![]);});}_0x5b2afb['group']('i.id');var _0x3907a4={'type':db['Sequelize'][_0x903b('0x8a')][_0x903b('0x8b')],'raw':!![]};var _0xfcaa03=_0x5b2afb['clone']()[_0x903b('0x4c')](_0x903b('0x50'))[_0x903b('0x4c')](_0x903b('0x8c'),'unreadMessages');if(!_0x5f0a1f[_0x903b('0x40')][_0x903b('0x5f')]){if(_0x5f0a1f[_0x903b('0x40')][_0x903b('0x8d')]){if(_0x5f0a1f[_0x903b('0x40')][_0x903b('0x8d')]==0x1){_0xfcaa03['having'](_0x903b('0x8e'));_0x5b2afb[_0x903b('0x8f')](_0x903b('0x8e'));}else{_0xfcaa03[_0x903b('0x8f')](_0x903b('0x90'));_0x5b2afb['having'](_0x903b('0x90'));}}if(_0x5f0a1f['query']['tag']){var _0x10e597=_[_0x903b('0x6a')](_0x5f0a1f['query']['tag'])?_0x5f0a1f['query'][_0x903b('0x91')]:new Array(_0x5f0a1f[_0x903b('0x40')][_0x903b('0x91')]);var _0x51e6fd=squel[_0x903b('0x92')]();_0x10e597['forEach'](function(_0x5da8b1){_0x51e6fd['or'](_0x903b('0x93'),'%,'+_0x5da8b1+',%');});_0x5b2afb[_0x903b('0x8f')](_0x51e6fd);_0xfcaa03[_0x903b('0x5a')]('chat_interaction_has_tags','it',_0x903b('0x94'));_0xfcaa03[_0x903b('0x5a')](_0x903b('0x4e'),'t','t.id\x20=\x20it.TagId');_0xfcaa03[_0x903b('0x4a')](_0x903b('0x95'),_0x10e597);}}else{var _0x607811=JSON[_0x903b('0x80')](_0x5f0a1f[_0x903b('0x40')][_0x903b('0x5f')]);_[_0x903b('0x3f')](_0x607811)['forEach'](function(_0x29c982){var _0x3c9202=_0x607811[_0x29c982];if(_0x29c982===_0x903b('0x6c')){var _0x678ad7=_0x3c9202['value'];var _0x92e603=squel[_0x903b('0x92')]();_0x678ad7[_0x903b('0x60')](function(_0x3839d0){_0x92e603['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3839d0+',%');});_0x5b2afb[_0x903b('0x8f')](_0x92e603);_0xfcaa03['left_join'](_0x903b('0x96'),'it',_0x903b('0x97'));_0xfcaa03[_0x903b('0x5a')](_0x903b('0x4e'),'t',_0x903b('0x98'));_0xfcaa03[_0x903b('0x4a')]('t.id\x20IN\x20?',_0x678ad7);}else if(_0x29c982===_0x903b('0x6d')){if(_0x3c9202['value'][_0x903b('0x46')]===0x1){if(_0x3c9202[_0x903b('0x62')][0x0]===0x1){_0xfcaa03[_0x903b('0x8f')]('`unreadMessages`\x20=\x200');_0x5b2afb[_0x903b('0x8f')](_0x903b('0x8e'));}else{_0xfcaa03[_0x903b('0x8f')](_0x903b('0x90'));_0x5b2afb[_0x903b('0x8f')]('`unreadMessages`\x20>\x200');}}}});}db['sequelize'][_0x903b('0x40')](_0xfcaa03['toString'](),_0x3907a4)['then'](function(_0x44c679){_0xe878e1[_0x903b('0x2c')]=_0x44c679[_0x903b('0x46')];if(_0xe878e1[_0x903b('0x2c')]===0x0)return[];return db[_0x903b('0x99')][_0x903b('0x40')](_0x23be96[_0x903b('0x9a')](),_0x3907a4)[_0x903b('0x34')](function(_0x273d38){_0xce8031=_[_0x903b('0x9b')](_0x273d38,'id');_0x3907a4=_[_0x903b('0x9c')](_0x3907a4,{'model':db[_0x903b('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5b2afb[_0x903b('0x4c')]('COUNT(me.id)','unreadMessages');_0x5b2afb['field'](_0x903b('0x9d'),'Account.key');_0x5b2afb[_0x903b('0x4c')]('a.mandatoryDisposition',_0x903b('0x9e'));_0x5b2afb[_0x903b('0x4c')](_0x903b('0x9f'));_0x5b2afb[_0x903b('0x4c')](_0x903b('0x72'),_0x903b('0xa0'));_0x5b2afb[_0x903b('0x4c')](_0x903b('0x78'),_0x903b('0xa1'));_0x5b2afb[_0x903b('0x4c')](_0x903b('0x74'),_0x903b('0xa2'));_0x5b2afb[_0x903b('0x4c')](_0x903b('0xa3'),_0x903b('0xa4'));_0x5b2afb[_0x903b('0x4c')]('c.mobile',_0x903b('0xa5'));_0x5b2afb[_0x903b('0x4c')]('c.fax',_0x903b('0xa6'));_0x5b2afb[_0x903b('0x4c')](_0x903b('0xa7'),_0x903b('0x3a'));_0x5b2afb[_0x903b('0x5a')](_0x903b('0xa8'),'it',_0x903b('0x94'));_0x5b2afb[_0x903b('0x5a')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x5b2afb[_0x903b('0x2e')](_0x18cc1a[_0x903b('0x2e')]);_0x5b2afb['offset'](_0x18cc1a[_0x903b('0x2d')]);return db[_0x903b('0x99')][_0x903b('0x40')](_0x5b2afb['toString'](),_0x3907a4);})[_0x903b('0x34')](function(_0x2b744e){_0x4edeec[_0x903b('0x4a')](_0x903b('0xa9'),_['map'](_0x2b744e,'id'));return db['sequelize'][_0x903b('0x40')](_0x4edeec[_0x903b('0x9a')](),_0x3907a4)[_0x903b('0x34')](function(_0x15fbc0){var _0x387472=_[_0x903b('0xaa')](_0x15fbc0,_0x903b('0xab'));var _0x1a71f3=[];_0x2b744e[_0x903b('0x60')](function(_0x4d0707){_0x1a71f3['push'](updateChatInteraction(_0x4d0707,_0xce8031,_0x387472));});return BPromise['all'](_0x1a71f3);});});})[_0x903b('0x34')](function(_0xb58d7){_0xe878e1['rows']=_0xb58d7;return _0xe878e1;})[_0x903b('0x34')](respondWithFilteredResult(_0x49436d,_0x18cc1a))['catch'](handleError(_0x49436d,null));};exports[_0x903b('0xac')]=function(_0x8118e5,_0x54b1bc){var _0x34266d={'raw':![],'where':{'id':_0x8118e5['params']['id']}},_0x3f2024={};_0x3f2024[_0x903b('0x43')]=_[_0x903b('0x3f')](db[_0x903b('0x3d')][_0x903b('0x3e')]);_0x3f2024[_0x903b('0x40')]=_[_0x903b('0x3f')](_0x8118e5[_0x903b('0x40')]);_0x3f2024[_0x903b('0x41')]=_[_0x903b('0x42')](_0x3f2024[_0x903b('0x43')],_0x3f2024[_0x903b('0x40')]);_0x34266d[_0x903b('0x45')]=_[_0x903b('0x42')](_0x3f2024[_0x903b('0x43')],qs[_0x903b('0x44')](_0x8118e5[_0x903b('0x40')]['fields']));_0x34266d['attributes']=_0x34266d[_0x903b('0x45')]['length']?_0x34266d[_0x903b('0x45')]:_0x3f2024[_0x903b('0x43')];if(_0x8118e5[_0x903b('0x40')][_0x903b('0xad')]){_0x34266d['include']=[{'all':!![]}];}_0x34266d=_['merge']({},_0x34266d,_0x8118e5[_0x903b('0xae')]);return db[_0x903b('0x3d')][_0x903b('0xaf')](_0x34266d)[_0x903b('0x34')](handleEntityNotFound(_0x54b1bc,null))[_0x903b('0x34')](respondWithResult(_0x54b1bc,null))['catch'](handleError(_0x54b1bc,null));};exports[_0x903b('0xb0')]=function(_0x190780,_0x5a49b7){return db[_0x903b('0x3d')][_0x903b('0xb0')](_0x190780['body'],{})['then'](respondWithResult(_0x5a49b7,0xc9))[_0x903b('0x27')](handleError(_0x5a49b7,null));};exports[_0x903b('0x33')]=function(_0x6943ee,_0x2db234){if(_0x6943ee[_0x903b('0xb1')]['id']){delete _0x6943ee['body']['id'];}return db[_0x903b('0x3d')]['find']({'where':{'id':_0x6943ee['params']['id']}})[_0x903b('0x34')](handleEntityNotFound(_0x2db234,null))[_0x903b('0x34')](saveUpdates(_0x6943ee['body'],null))[_0x903b('0x34')](respondWithResult(_0x2db234,null))[_0x903b('0x27')](handleError(_0x2db234,null));};exports[_0x903b('0x35')]=function(_0x3f1028,_0x32f950){return db[_0x903b('0x3d')][_0x903b('0xaf')]({'where':{'id':_0x3f1028[_0x903b('0xb2')]['id']}})[_0x903b('0x34')](handleEntityNotFound(_0x32f950,null))[_0x903b('0x34')](removeEntity(_0x32f950,null))[_0x903b('0x27')](handleError(_0x32f950,null));};exports['describe']=function(_0x114dc9,_0x134004){return db[_0x903b('0x3d')]['describe']()[_0x903b('0x34')](respondWithResult(_0x134004,null))['catch'](handleError(_0x134004,null));};exports['customUpdate']=function(_0x5aec91,_0x5b0e76){if(_0x5aec91['body']['id']){delete _0x5aec91[_0x903b('0xb1')]['id'];}return db[_0x903b('0x3d')][_0x903b('0xaf')]({'where':{'id':_0x5aec91[_0x903b('0xb2')]['id']}})[_0x903b('0x34')](handleEntityNotFound(_0x5b0e76,null))['then'](saveUpdates(_0x5aec91['body'],null))[_0x903b('0x34')](respondWithResult(_0x5b0e76,null))[_0x903b('0x27')](handleError(_0x5b0e76,null));};exports[_0x903b('0xb3')]=function(_0xba65ee,_0x444322,_0x4db549){if(_0xba65ee[_0x903b('0xb1')]['id']){delete _0xba65ee[_0x903b('0xb1')]['id'];}return db[_0x903b('0x3d')][_0x903b('0xaf')]({'where':{'id':_0xba65ee[_0x903b('0xb2')]['id']}})[_0x903b('0x34')](function(_0xc9685){if(!_0xc9685){logger[_0x903b('0x23')](_0x903b('0xb4'),_0x903b('0xb3'),0x194,_0x903b('0xb5'));_0x444322[_0x903b('0x28')](0x194);}else{if(_0xc9685['UserId']){throw new db[(_0x903b('0xb6'))][(_0x903b('0xb7'))](_0x903b('0xb8'));}}return _0xc9685;})['then'](function(_0x1f738f){if(_0x1f738f){return _0x1f738f[_0x903b('0x33')]({'closed':_0xba65ee['body'][_0x903b('0xb9')],'disposition':_0xba65ee[_0x903b('0xb1')]['disposition']})['then'](function(_0x418a60){return _0x418a60;});}})[_0x903b('0x34')](function(_0x496d85){return respondWithRpcPromise(_0x903b('0xba'),_0x903b('0xb3'),_0xba65ee[_0x903b('0xb1')],client9004);})[_0x903b('0x34')](respondWithResult(_0x444322,null))[_0x903b('0x27')](handleError(_0x444322,null));};exports[_0x903b('0xbb')]=function(_0x34f9c7,_0x51cb6d,_0x1265f7){_0x34f9c7['body'][_0x903b('0x37')]=_0x34f9c7[_0x903b('0xbc')][_0x903b('0xbd')];_0x34f9c7[_0x903b('0xb1')][_0x903b('0xbe')]=_0x34f9c7[_0x903b('0xbc')][_0x903b('0xbf')];_0x34f9c7[_0x903b('0xb1')][_0x903b('0xc0')]=_0x34f9c7[_0x903b('0xbc')][_0x903b('0xc1')];return db[_0x903b('0xc2')][_0x903b('0xb0')](_0x34f9c7[_0x903b('0xb1')])[_0x903b('0x34')](respondWithResult(_0x51cb6d,0xc9))[_0x903b('0x27')](handleError(_0x51cb6d,null));};exports[_0x903b('0xc3')]=function(_0xe4e94f,_0x49eb85,_0xe71e50){return db[_0x903b('0x3d')]['findOne']({'where':{'id':_0xe4e94f['params']['id']},'raw':!![]})[_0x903b('0x34')](handleEntityNotFound(_0x49eb85,null))[_0x903b('0x34')](function(_0x4fafbf){if(_0x4fafbf){if(_0x4fafbf[_0x903b('0xb9')]){return _0x49eb85[_0x903b('0x29')](0x193)[_0x903b('0x2b')]({'status':0x193,'message':'Unauthorized'});}return db[_0x903b('0xc2')][_0x903b('0xc4')]({'where':{'id':_0xe4e94f[_0x903b('0x40')][_0x903b('0xc5')]},'raw':!![]})[_0x903b('0x34')](handleEntityNotFound(_0x49eb85,null));}})['then'](function(_0x42752e){if(_0x42752e){return _0x49eb85['download'](path[_0x903b('0x86')](config[_0x903b('0xc6')],_0x903b('0xc7'),_0x42752e['basename']));}})[_0x903b('0x27')](handleError(_0x49eb85,null));};exports[_0x903b('0xc8')]=function(_0x21c761,_0x5cf6e9){var _0x5e74d7=null;var _0x5531ca=null;var _0x413ab8=null;var _0x188c23=null;if(_0x21c761[_0x903b('0xb1')]['id']){delete _0x21c761['body']['id'];}if(_0x21c761['body'][_0x903b('0xc9')]){_0x188c23=path[_0x903b('0x86')](config['root'],_0x903b('0xca'),util[_0x903b('0x65')](_0x903b('0xcb'),Date[_0x903b('0xcc')]()));_0x21c761['body'][_0x903b('0xcd')]=_0x188c23;}return db[_0x903b('0x3d')][_0x903b('0xaf')]({'where':{'id':_0x21c761[_0x903b('0xb2')]['id']},'include':[{'model':db[_0x903b('0xce')],'as':_0x903b('0xcf'),'include':[{'model':db[_0x903b('0xd0')],'as':_0x903b('0xd0')}]}]})['then'](handleEntityNotFound(_0x5cf6e9,null))[_0x903b('0x34')](saveUpdates(_0x21c761[_0x903b('0xb1')],null))[_0x903b('0x34')](function(_0xfb5ee0){if(_0xfb5ee0){_0x5e74d7=_0xfb5ee0;return db['ChatWebsite'][_0x903b('0xaf')]({'where':{'id':_0x5e74d7[_0x903b('0x7d')]}});}})['then'](function(_0x133e62){if(_0x133e62){_0x413ab8=_0x133e62;return db[_0x903b('0xd1')][_0x903b('0xaf')]({'where':{'id':_0x5e74d7[_0x903b('0x71')]}});}})[_0x903b('0x34')](function(_0x15ad26){if(_0x15ad26){_0x5531ca=_0x15ad26;if(_0x188c23){var _0x52f366=null;for(var _0x339dc6=0x1;_0x339dc6<_0x5e74d7[_0x903b('0xcf')][_0x903b('0x46')];++_0x339dc6){_0x52f366=_0x5e74d7['Messages'][_0x339dc6];var _0x508009=_0x52f366['UserId']?util[_0x903b('0x65')]('%s%d',_0x413ab8[_0x903b('0xd2')],_0x52f366['UserId']):_0x903b('0xd3');var _0x51469d=_0x21c761[_0x903b('0xb1')][_0x903b('0xd4')]||util[_0x903b('0x65')]('%s%d',_0x903b('0xd5'),_0x52f366[_0x903b('0x71')]);switch(_0x413ab8['agentIdentifier']){case _0x903b('0xd6'):_0x508009=_0x52f366[_0x903b('0xd7')]?util[_0x903b('0x65')]('%s%d',_0x413ab8[_0x903b('0xd2')],_0x52f366['UserId']):_0x903b('0xd3');break;case'agent_alias':_0x508009=_0x52f366[_0x903b('0xd7')]?_0x52f366['User'][_0x903b('0xd8')]||_0x52f366[_0x903b('0xd0')][_0x903b('0xd9')]:'System';break;case _0x903b('0xda'):_0x508009=_0x52f366[_0x903b('0xd7')]?_0x52f366['User']['fullname']:_0x903b('0xd3');break;default:_0x508009=_0x52f366['UserId']?util[_0x903b('0x65')](_0x903b('0xdb'),_0x413ab8[_0x903b('0xd2')],_0x52f366[_0x903b('0xd7')]):'System';}var _0xf73713=util[_0x903b('0x65')](_0x903b('0xdc'),moment(_0x52f366[_0x903b('0x61')])[_0x903b('0x65')](_0x903b('0xdd')),_0x52f366[_0x903b('0xde')]==='in'?_0x51469d:_0x508009,_0x52f366[_0x903b('0xb1')]);if(!_0x52f366[_0x903b('0xdf')]){fs['appendFileSync'](_0x188c23,_0xf73713);}}return db[_0x903b('0xe0')][_0x903b('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x903b('0xe1'),'raw':!![]}]});}}})['then'](function(_0x443159){if(_0x443159&&_0x443159[_0x903b('0xe1')]&&_0x21c761[_0x903b('0xb1')]){var _0x1b2b82={'tls':{'rejectUnauthorized':![]}};if(_0x443159[_0x903b('0xe1')][_0x903b('0xe2')]){_0x1b2b82[_0x903b('0xe2')]=_0x443159[_0x903b('0xe1')][_0x903b('0xe2')];}else{_0x1b2b82[_0x903b('0xe3')]=_0x443159[_0x903b('0xe1')][_0x903b('0xe3')];_0x1b2b82[_0x903b('0xe4')]=_0x443159['Smtp'][_0x903b('0xe4')];_0x1b2b82['secure']=_0x443159[_0x903b('0xe1')][_0x903b('0xe5')];}if(_0x443159[_0x903b('0xe1')][_0x903b('0xe6')]){_0x1b2b82[_0x903b('0xe7')]={'user':_0x443159['Smtp'][_0x903b('0xe8')],'pass':_0x443159[_0x903b('0xe1')][_0x903b('0xe9')]};}return respondWithRpcPromise('SendMail',_0x903b('0xea'),{'account':_0x1b2b82,'message':{'from':util[_0x903b('0x65')](_0x903b('0xeb'),_0x443159[_0x903b('0x37')],_0x443159['email']||_0x443159[_0x903b('0xe1')][_0x903b('0xe8')]),'to':_0x21c761[_0x903b('0xb1')][_0x903b('0xc9')],'subject':_0x903b('0xec'),'text':util[_0x903b('0x65')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x21c761['body']['mailTranscript']),'attachments':[{'path':_0x188c23}]}})[_0x903b('0x34')](function(){return _0x5e74d7;})[_0x903b('0x27')](function(_0x4a993b){console['error'](_0x4a993b);});}else{return _0x5e74d7;}})[_0x903b('0x34')](respondWithStatusCode(_0x5cf6e9,0xc8))[_0x903b('0x27')](handleError(_0x5cf6e9,null));};exports[_0x903b('0xed')]=function(_0x1f9d4f,_0x116ac9,_0x12daf9){return db[_0x903b('0xce')]['find']({'where':{'id':_0x1f9d4f['params']['id']}})[_0x903b('0x34')](handleEntityNotFound(_0x116ac9,null))[_0x903b('0x34')](function(_0x3ca940){if(_0x3ca940){return _0x3ca940[_0x903b('0xed')](_0x1f9d4f['body'][_0x903b('0xee')],_[_0x903b('0xef')](_0x1f9d4f[_0x903b('0xb1')],[_0x903b('0xee'),'id'])||{});}})['then'](respondWithResult(_0x116ac9,null))[_0x903b('0x27')](handleError(_0x116ac9,null));};exports['getMessages']=function(_0x5b8a87,_0x135069,_0x2a7005){var _0x59bc68={'raw':![],'where':{}};var _0x1c534a={};var _0x413223={'count':0x0,'rows':[]};return db[_0x903b('0x3d')][_0x903b('0xc4')]({'where':{'id':_0x5b8a87[_0x903b('0xb2')]['id']}})[_0x903b('0x34')](handleEntityNotFound(_0x135069,null))[_0x903b('0x34')](function(_0x251f05){if(_0x251f05){_0x1c534a['model']=_['keys'](db[_0x903b('0xce')]['rawAttributes']);_0x1c534a[_0x903b('0x40')]=_['keys'](_0x5b8a87[_0x903b('0x40')]);_0x1c534a[_0x903b('0x41')]=_[_0x903b('0x42')](_0x1c534a[_0x903b('0x43')],_0x1c534a[_0x903b('0x40')]);_0x59bc68['attributes']=_[_0x903b('0x42')](_0x1c534a[_0x903b('0x43')],qs['fields'](_0x5b8a87[_0x903b('0x40')][_0x903b('0x44')]));_0x59bc68[_0x903b('0x45')]=_0x59bc68[_0x903b('0x45')]['length']?_0x59bc68[_0x903b('0x45')]:_0x1c534a[_0x903b('0x43')];if(!_0x5b8a87[_0x903b('0x40')][_0x903b('0x47')]('nolimit')){_0x59bc68[_0x903b('0x2e')]=qs['limit'](_0x5b8a87[_0x903b('0x40')][_0x903b('0x2e')]);_0x59bc68[_0x903b('0x2d')]=qs[_0x903b('0x2d')](_0x5b8a87[_0x903b('0x40')][_0x903b('0x2d')]);}_0x59bc68[_0x903b('0x48')]=qs[_0x903b('0x49')](_0x5b8a87[_0x903b('0x40')][_0x903b('0x49')]);_0x59bc68['where']=qs[_0x903b('0x41')](_[_0x903b('0x4b')](_0x5b8a87[_0x903b('0x40')],_0x1c534a[_0x903b('0x41')]));_0x59bc68[_0x903b('0x4a')][_0x903b('0xab')]=_0x251f05['id'];if(_0x5b8a87['query'][_0x903b('0x7a')]){_0x59bc68['where']=_[_0x903b('0x9c')](_0x59bc68[_0x903b('0x4a')],{'$or':_['map'](_0x59bc68['attributes'],function(_0x2169d3){var _0x27a6ea={};_0x27a6ea[_0x2169d3]={'$like':'%'+_0x5b8a87['query']['filter']+'%'};return _0x27a6ea;})});}if(_0x5b8a87[_0x903b('0x40')][_0x903b('0x81')]){var _0x2649ae=_0x5b8a87[_0x903b('0x40')][_0x903b('0x81')][_0x903b('0xf0')](',');var _0x38405f={};_0x38405f[_0x2649ae[0x0]]={'$gte':moment(_0x2649ae[0x1])['format'](_0x903b('0xf1'))};_0x59bc68[_0x903b('0x4a')]=_[_0x903b('0x9c')](_0x59bc68[_0x903b('0x4a')],_0x38405f);}_0x59bc68=_['merge']({},_0x59bc68,_0x5b8a87[_0x903b('0xae')]);return db[_0x903b('0xce')][_0x903b('0x2c')]({'where':_0x59bc68['where']})[_0x903b('0x34')](function(_0x1c9bf5){_0x413223[_0x903b('0x2c')]=_0x1c9bf5;if(_0x5b8a87[_0x903b('0x40')][_0x903b('0xad')]){_0x59bc68[_0x903b('0xf2')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x59bc68);})[_0x903b('0x34')](function(_0x4819c2){_0x413223['rows']=_0x4819c2;return _0x413223;});}})[_0x903b('0x34')](respondWithFilteredResult(_0x135069,_0x59bc68))['catch'](handleError(_0x135069,null));};exports['getMyMessages']=function(_0x397775,_0x4386f6,_0x4837be){var _0x341003={'where':{}},_0x5397d7={},_0x47bbf0={'count':0x0,'rows':[]};return db[_0x903b('0x3d')]['findOne']({'where':{'id':_0x397775['params']['id']}})[_0x903b('0x34')](handleEntityNotFound(_0x4386f6,null))[_0x903b('0x34')](function(_0x4574e3){if(_0x4574e3){_0x5397d7['model']=_[_0x903b('0x3f')](db[_0x903b('0xce')][_0x903b('0x3e')]);_0x5397d7['query']=_[_0x903b('0x3f')](_0x397775[_0x903b('0x40')]);_0x5397d7['filters']=_['intersection'](_0x5397d7[_0x903b('0x43')],_0x5397d7['query']);_0x341003['attributes']=_['intersection'](_0x5397d7[_0x903b('0x43')],qs['fields'](_0x397775[_0x903b('0x40')][_0x903b('0x44')]));_0x341003['attributes']=_0x341003[_0x903b('0x45')][_0x903b('0x46')]?_0x341003[_0x903b('0x45')]:_0x5397d7[_0x903b('0x43')];if(!_0x397775[_0x903b('0x40')][_0x903b('0x47')](_0x903b('0xf3'))){_0x341003[_0x903b('0x2e')]=qs[_0x903b('0x2e')](_0x397775['query']['limit']);_0x341003[_0x903b('0x2d')]=qs[_0x903b('0x2d')](_0x397775[_0x903b('0x40')]['offset']);}_0x341003[_0x903b('0x48')]=qs[_0x903b('0x49')](_0x397775[_0x903b('0x40')][_0x903b('0x49')]);_0x341003[_0x903b('0x4a')]=qs['filters'](_[_0x903b('0x4b')](_0x397775[_0x903b('0x40')],_0x5397d7[_0x903b('0x41')]));_0x341003[_0x903b('0x4a')][_0x903b('0xab')]=_0x4574e3['id'];if(_0x397775[_0x903b('0x40')][_0x903b('0x7a')]){_0x341003[_0x903b('0x4a')]=_[_0x903b('0x9c')](_0x341003[_0x903b('0x4a')],{'$or':_[_0x903b('0x79')](_0x341003[_0x903b('0x45')],function(_0x1981c6){var _0x317f10={};_0x317f10[_0x1981c6]={'$like':'%'+_0x397775['query'][_0x903b('0x7a')]+'%'};return _0x317f10;})});}_0x341003['where'][_0x903b('0xdf')]=![];if(_0x397775[_0x903b('0x40')]['id']){_0x341003[_0x903b('0x4a')]['id']={'$gt':_0x397775[_0x903b('0x40')]['id']};}_0x341003=_['merge']({},_0x341003,_0x397775[_0x903b('0xae')]);return db[_0x903b('0xce')][_0x903b('0x2c')]({'where':_0x341003[_0x903b('0x4a')]})[_0x903b('0x34')](function(_0x2d0d26){_0x47bbf0[_0x903b('0x2c')]=_0x2d0d26;_0x341003[_0x903b('0xf2')]=[];if(_0x397775[_0x903b('0x40')][_0x903b('0xf4')]){_0x341003['include'][_0x903b('0xf5')]({'model':db[_0x903b('0xd0')],'as':_0x903b('0xd0'),'attributes':['id','fullname',_0x903b('0xd8')]});}if(_0x397775[_0x903b('0x40')][_0x903b('0xad')]){_0x341003[_0x903b('0xf2')]=[{'all':!![]}];}return db[_0x903b('0xce')][_0x903b('0xf6')](_0x341003);})['then'](function(_0x575aa4){_0x47bbf0[_0x903b('0xf7')]=_0x575aa4;return _0x47bbf0;});}})[_0x903b('0x34')](respondWithFilteredResult(_0x4386f6,_0x341003))[_0x903b('0x27')](handleError(_0x4386f6,null));};exports[_0x903b('0xf8')]=function(_0x63bdef,_0x2d265f,_0x3ebb29){return db[_0x903b('0x3d')][_0x903b('0xaf')]({'where':{'id':_0x63bdef[_0x903b('0xb2')]['id']}})[_0x903b('0x34')](handleEntityNotFound(_0x2d265f,null))['then'](function(_0x1551ea){if(_0x1551ea){return _0x1551ea[_0x903b('0xf9')](_0x63bdef['body'][_0x903b('0xee')],_[_0x903b('0xef')](_0x63bdef[_0x903b('0xb1')],['ids','id'])||{})['spread'](function(){return db[_0x903b('0xfa')]['findAll']({'attributes':['id',_0x903b('0x37'),_0x903b('0x4d')],'where':{'id':_0x63bdef['body'][_0x903b('0xee')]}});})['then'](function(_0x52e529){socket[_0x903b('0xfb')](_0x903b('0xfc'),{'id':Number(_0x63bdef[_0x903b('0xb2')]['id']),'tags':_0x52e529||[]});return{'id':Number(_0x63bdef[_0x903b('0xb2')]['id']),'tags':_0x52e529||[]};});}})[_0x903b('0x34')](respondWithResult(_0x2d265f,null))[_0x903b('0x27')](handleError(_0x2d265f,null));};exports[_0x903b('0xfd')]=function(_0x27d173,_0x146ceb,_0x51b11f){return db[_0x903b('0x3d')]['find']({'where':{'id':_0x27d173[_0x903b('0xb2')]['id']}})['then'](handleEntityNotFound(_0x146ceb,null))[_0x903b('0x34')](function(_0x444ba3){if(_0x444ba3){return _0x444ba3[_0x903b('0xfd')](_0x27d173[_0x903b('0x40')][_0x903b('0xee')]);}})[_0x903b('0x34')](respondWithStatusCode(_0x146ceb,null))[_0x903b('0x27')](handleError(_0x146ceb,null));};exports[_0x903b('0xfe')]=function(_0x3ede26,_0x5a02ea){var _0x4d24cd=moment()[_0x903b('0xff')]()['toString']();var _0x4c6f00=path['join'](config['root'],_0x903b('0x100'),_0x903b('0x101'),'tmp');var _0x3bb45a=path[_0x903b('0x86')](config[_0x903b('0xc6')],'server',_0x903b('0x101'),_0x903b('0x102'));var _0x4d0b0b=path[_0x903b('0x86')](_0x4c6f00,_0x4d24cd);var _0x4b0243=util[_0x903b('0x65')]('transcript-%d-%s.zip',_0x3ede26[_0x903b('0xb2')]['id'],_0x4d24cd);var _0x2ad790=path[_0x903b('0x86')](_0x4c6f00,_0x4b0243);var _0x29aca2=![];return db[_0x903b('0x3d')][_0x903b('0xaf')]({'where':{'id':_0x3ede26['params']['id']},'include':[{'model':db[_0x903b('0xce')],'as':_0x903b('0xcf'),'attributes':['id',_0x903b('0xb1'),'createdAt',_0x903b('0xde'),_0x903b('0xdf')],'include':[{'model':db[_0x903b('0xd0')],'as':_0x903b('0xd0'),'attributes':['id',_0x903b('0xd9')],'raw':!![]},{'model':db[_0x903b('0xd1')],'as':_0x903b('0x103'),'attributes':['id',_0x903b('0x104'),'lastName'],'raw':!![]},{'model':db[_0x903b('0xc2')],'as':_0x903b('0xc2'),'raw':!![]}]},{'model':db[_0x903b('0x105')],'as':_0x903b('0x106'),'attributes':['id',_0x903b('0x37')]},{'model':db['User'],'as':_0x903b('0x107'),'attributes':['id',_0x903b('0xd9')]}]})[_0x903b('0x34')](handleEntityNotFound(_0x5a02ea,null))['then'](function(_0x679128){if(_0x679128){var _0x32887f=_0x679128['get']({'plain':!![]});_0x29aca2=!![];var _0x2a8a4b={'format':'A4','border':'10px','header':{'height':_0x903b('0x108'),'contents':{'first':_0x903b('0x109')}},'footer':{'height':_0x903b('0x10a'),'contents':{'default':util[_0x903b('0x65')](_0x903b('0x10b'),util['format'](_0x903b('0x10c'),_0x903b('0x10d'),_0x32887f['id']),moment()[_0x903b('0x65')](_0x903b('0x10e'))[_0x903b('0x9a')]())}}};fs[_0x903b('0x10f')](_0x4d0b0b);var _0x570b4b={'channel':_0x903b('0x10d'),'account':_0x32887f['Account']['name'],'agent':_0x32887f[_0x903b('0x107')]?_0x32887f[_0x903b('0x107')][_0x903b('0xd9')]:'N.A.','createdAt':moment(_0x32887f['createdAt'])[_0x903b('0x65')](_0x903b('0xf1'))[_0x903b('0x9a')](),'closedAt':_0x32887f[_0x903b('0xb9')]?moment(_0x32887f[_0x903b('0x110')])[_0x903b('0x65')]('YYYY-MM-DD\x20HH:mm:ss')[_0x903b('0x9a')]():'','disposition':_0x32887f[_0x903b('0x111')],'chatInfo':{'browser':_0x32887f[_0x903b('0x112')],'os':_0x32887f['osName'],'referer':_0x32887f[_0x903b('0x113')],'customerIp':_0x32887f['customerIp'],'customerPort':_0x32887f['customerPort']?_0x32887f[_0x903b('0x114')]:'N.A.'},'messages':_(_0x32887f['Messages'])['tail']()['filter']({'secret':![]})[_0x903b('0x79')](function(_0x4bf786){if(_0x4bf786[_0x903b('0xc2')]){var _0x435aac=path[_0x903b('0x86')](_0x3bb45a,_0x4bf786[_0x903b('0xc2')][_0x903b('0xbe')]);if(fs[_0x903b('0x115')](_0x435aac)){fs[_0x903b('0x116')](_0x435aac)[_0x903b('0x117')](fs[_0x903b('0x118')](path['join'](_0x4d0b0b,_0x4bf786[_0x903b('0xc2')][_0x903b('0xbe')])));}}return{'date':moment(_0x4bf786['createdAt'])['format'](_0x903b('0xf1'))['toString'](),'sender':_0x4bf786['direction']===_0x903b('0x119')?_0x4bf786['User']?_0x4bf786[_0x903b('0xd0')][_0x903b('0xd9')]:_0x903b('0xd3'):_0x4bf786[_0x903b('0x103')][_0x903b('0x104')]+(_0x4bf786[_0x903b('0x103')][_0x903b('0x11a')]?'\x20'+_0x4bf786[_0x903b('0x103')]['lastName']:''),'body':_0x4bf786[_0x903b('0xc2')]?_0x4bf786['Attachment'][_0x903b('0xbe')]:_0x4bf786[_0x903b('0xb1')],'direction':_0x4bf786['direction']===_0x903b('0x119')?'A':'C','secret':_0x4bf786[_0x903b('0xdf')],'attachment':_0x4bf786[_0x903b('0xc2')]};})[_0x903b('0x62')]()};return ejs[_0x903b('0x11b')](path[_0x903b('0x86')](config['root'],'server',_0x903b('0x11c'),_0x903b('0x11d')),{'interaction':_0x570b4b})['then'](function(_0x55f6d4){return new BPromise(function(_0x3b9621,_0x13d054){pdf[_0x903b('0xb0')](_0x55f6d4,_0x2a8a4b)[_0x903b('0x11e')](path[_0x903b('0x86')](_0x4d0b0b,_0x903b('0x11f')+_0x32887f['id']+'-'+_0x4d24cd+_0x903b('0x120')),function(_0x49d791,_0x501092){if(_0x49d791)return _0x13d054(_0x49d791);_0x3b9621(_0x501092);});});});}})[_0x903b('0x34')](function(){if(_0x29aca2){return new BPromise(function(_0x287e76,_0x245c26){zipdir(_0x4d0b0b,{'saveTo':_0x2ad790},function(_0x32fffb,_0x38f1af){if(_0x32fffb)return _0x245c26(_0x32fffb);return _0x287e76(_0x38f1af);});})[_0x903b('0x34')](function(){return new BPromise(function(_0x1fb12c,_0x67288){rimraf(_0x4d0b0b,function(_0x16821a){if(_0x16821a)_0x67288(_0x16821a);return _0x1fb12c();});});})[_0x903b('0x34')](function(){return _0x5a02ea['download'](_0x2ad790,_0x4b0243,function(_0x1011cf){if(_0x1011cf){console['log'](_0x903b('0x121'),_0x1011cf);}else{fs[_0x903b('0x122')](_0x2ad790);}});});}else{return _0x5a02ea['sendStatus'](0xc8);}})[_0x903b('0x27')](handleError(_0x5a02ea,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index ee50237..56c8a07 100644 --- a/server/api/chatInteraction/chatInteraction.events.js +++ b/server/api/chatInteraction/chatInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b10=['findAll','length','emit','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map'];(function(_0x1c8567,_0x5180c6){var _0x5309fd=function(_0x257c5f){while(--_0x257c5f){_0x1c8567['push'](_0x1c8567['shift']());}};_0x5309fd(++_0x5180c6);}(_0x2b10,0x114));var _0x02b1=function(_0x15f07c,_0x24790e){_0x15f07c=_0x15f07c-0x0;var _0x4b0b24=_0x2b10[_0x15f07c];return _0x4b0b24;};'use strict';var EventEmitter=require(_0x02b1('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x02b1('0x1')];var ChatMessage=require(_0x02b1('0x2'))['db'][_0x02b1('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x02b1('0x4')](0x0);var events={'afterCreate':_0x02b1('0x5'),'afterUpdate':'update','afterDestroy':_0x02b1('0x6')};function emitEvent(_0x5900ca){return function(_0x51f63e,_0x32be24,_0x1bb3bc){_0x51f63e[_0x02b1('0x7')]({'attributes':['id'],'raw':!![]})[_0x02b1('0x8')](function(_0x5151bc){_0x51f63e[_0x02b1('0x9')](_0x02b1('0xa'),_0x5151bc[_0x02b1('0xb')](function(_0x647b17){return{'id':_0x647b17['id']};}));return ChatMessage[_0x02b1('0xc')]({'where':{'ChatInteractionId':_0x51f63e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x02b1('0x8')](function(_0x2515fb){_0x51f63e['setDataValue']('unreadMessages',_0x2515fb[_0x02b1('0xd')]);ChatInteractionEvents[_0x02b1('0xe')](_0x5900ca+':'+_0x51f63e['id'],_0x51f63e);ChatInteractionEvents[_0x02b1('0xe')](_0x5900ca,_0x51f63e);_0x1bb3bc(null);})['catch'](_0x1bb3bc(null));};}for(var e in events){if(events[_0x02b1('0xf')](e)){var event=events[e];ChatInteraction[_0x02b1('0x10')](e,emitEvent(event));}}module[_0x02b1('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x8506=['setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','remove','getUsers','then','map','findAll'];(function(_0x46f82f,_0x1b6039){var _0x110133=function(_0x2a0ccf){while(--_0x2a0ccf){_0x46f82f['push'](_0x46f82f['shift']());}};_0x110133(++_0x1b6039);}(_0x8506,0xe8));var _0x6850=function(_0x24796a,_0x169518){_0x24796a=_0x24796a-0x0;var _0x370c63=_0x8506[_0x24796a];return _0x370c63;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x6850('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x6850('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6850('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6850('0x2'),'afterDestroy':_0x6850('0x3')};function emitEvent(_0x321eff){return function(_0x5e9ff2,_0x13731e,_0x372f0b){_0x5e9ff2[_0x6850('0x4')]({'attributes':['id'],'raw':!![]})[_0x6850('0x5')](function(_0x5858ca){_0x5e9ff2['setDataValue']('Users',_0x5858ca[_0x6850('0x6')](function(_0x1db15d){return{'id':_0x1db15d['id']};}));return ChatMessage[_0x6850('0x7')]({'where':{'ChatInteractionId':_0x5e9ff2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5abd3b){_0x5e9ff2[_0x6850('0x8')](_0x6850('0x9'),_0x5abd3b[_0x6850('0xa')]);ChatInteractionEvents[_0x6850('0xb')](_0x321eff+':'+_0x5e9ff2['id'],_0x5e9ff2);ChatInteractionEvents[_0x6850('0xb')](_0x321eff,_0x5e9ff2);_0x372f0b(null);})['catch'](_0x372f0b(null));};}for(var e in events){if(events[_0x6850('0xc')](e)){var event=events[e];ChatInteraction[_0x6850('0xd')](e,emitEvent(event));}}module[_0x6850('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index a0ae191..9c58967 100644 --- a/server/api/chatInteraction/chatInteraction.model.js +++ b/server/api/chatInteraction/chatInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf13=['../../config/logger','api','moment','bluebird','path','rimraf','exports','define','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0xcf13,0xa8));var _0x3cf1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf13[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3cf1('0x0'));var util=require(_0x3cf1('0x1'));var logger=require(_0x3cf1('0x2'))(_0x3cf1('0x3'));var moment=require(_0x3cf1('0x4'));var BPromise=require(_0x3cf1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3cf1('0x6'));var rimraf=require(_0x3cf1('0x7'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x3cf1('0x8')]=function(_0x419d1c,_0x1bac29){return _0x419d1c[_0x3cf1('0x9')](_0x3cf1('0xa'),attributes,{'tableName':_0x3cf1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x589190,_0x171e54,_0x5f1e33){if(_0x589190['changed'](_0x3cf1('0xc'))){_0x589190[_0x3cf1('0xd')]=moment()[_0x3cf1('0xe')](_0x3cf1('0xf'));}_0x5f1e33(null,_0x589190);}},'charset':_0x3cf1('0x10'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x75f4=['util','../../config/logger','bluebird','request-promise','rimraf','./chatInteraction.attributes','exports','define','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x385467,_0x298239){var _0x5ed67e=function(_0x4b252c){while(--_0x4b252c){_0x385467['push'](_0x385467['shift']());}};_0x5ed67e(++_0x298239);}(_0x75f4,0xb6));var _0x475f=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0x75f4[_0x2e3545];return _0xcf18f;};'use strict';var _=require('lodash');var util=require(_0x475f('0x0'));var logger=require(_0x475f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x475f('0x2'));var rp=require(_0x475f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x475f('0x4'));var config=require('../../config/environment');var attributes=require(_0x475f('0x5'));module[_0x475f('0x6')]=function(_0x2ce4b5,_0x22be55){return _0x2ce4b5[_0x475f('0x7')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x393aa1,_0x40d623,_0x54db4e){if(_0x393aa1['changed'](_0x475f('0x8'))){_0x393aa1[_0x475f('0x9')]=moment()[_0x475f('0xa')](_0x475f('0xb'));}_0x54db4e(null,_0x393aa1);}},'charset':_0x475f('0xc'),'collate':_0x475f('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 9b19353..074a0c4 100644 --- a/server/api/chatInteraction/chatInteraction.rpc.js +++ b/server/api/chatInteraction/chatInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x778b=['addTags','ids','omit','spread','AddTags','lodash','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','debug','AddTagsToChatInteraction','ChatInteraction','find'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x778b,0x116));var _0xb778=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x778b[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0xb778('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb778('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb778('0x2'));var logger=require(_0xb778('0x3'))(_0xb778('0x4'));var config=require(_0xb778('0x5'));var jayson=require(_0xb778('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xb778('0x7')]=_[_0xb778('0x8')](config[_0xb778('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xb778('0x9'))(new Redis(config['redis']));require(_0xb778('0xa'))[_0xb778('0xb')](socket);function respondWithRpcPromise(_0x2fde9f,_0x54a2ae,_0x2f9093){return new BPromise(function(_0x38190c,_0x2720ec){return client['request'](_0x2fde9f,_0x2f9093)[_0xb778('0xc')](function(_0x3ba6f7){logger[_0xb778('0xd')](_0xb778('0xe'),_0x54a2ae,_0xb778('0xf'));logger['debug'](_0xb778('0x10'),_0x54a2ae,_0xb778('0xf'),JSON[_0xb778('0x11')](_0x3ba6f7));if(_0x3ba6f7[_0xb778('0x12')]){if(_0x3ba6f7[_0xb778('0x12')][_0xb778('0x13')]===0x1f4){logger[_0xb778('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x54a2ae,_0x3ba6f7[_0xb778('0x12')][_0xb778('0x14')]);return _0x2720ec(_0x3ba6f7[_0xb778('0x12')][_0xb778('0x14')]);}logger[_0xb778('0x12')](_0xb778('0xe'),_0x54a2ae,_0x3ba6f7['error'][_0xb778('0x14')]);return _0x38190c(_0x3ba6f7[_0xb778('0x12')]['message']);}else{logger['info'](_0xb778('0xe'),_0x54a2ae,_0xb778('0xf'));_0x38190c(_0x3ba6f7[_0xb778('0x15')]['message']);}})[_0xb778('0x16')](function(_0x5aa774){logger['error'](_0xb778('0xe'),_0x54a2ae,_0x5aa774);_0x2720ec(_0x5aa774);});});}exports[_0xb778('0x17')]=function(_0x36f31f){var _0x213dcd=this;return new Promise(function(_0x57c823,_0x5bde64){return db['ChatInteraction'][_0xb778('0x18')](_0x36f31f[_0xb778('0x19')],{'raw':_0x36f31f[_0xb778('0x1a')]?_0x36f31f[_0xb778('0x1a')][_0xb778('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36f31f[_0xb778('0x1a')]?_0x36f31f[_0xb778('0x1a')][_0xb778('0x1c')]||null:null,'attributes':_0x36f31f[_0xb778('0x1a')]?_0x36f31f[_0xb778('0x1a')][_0xb778('0x1d')]||null:null,'limit':_0x36f31f[_0xb778('0x1a')]?_0x36f31f[_0xb778('0x1a')]['limit']||null:null})[_0xb778('0xc')](function(_0x5ac4cc){logger['info']('UpdateChatInteraction',_0x36f31f);logger[_0xb778('0x1e')](_0xb778('0x17'),_0x36f31f,JSON['stringify'](_0x5ac4cc));_0x57c823(_0x5ac4cc);})[_0xb778('0x16')](function(_0x367c4f){logger[_0xb778('0x12')](_0xb778('0x17'),_0x367c4f[_0xb778('0x14')],_0x36f31f);_0x5bde64(_0x213dcd[_0xb778('0x12')](0x1f4,_0x367c4f['message']));});});};exports[_0xb778('0x1f')]=function(_0x301949){return new Promise(function(_0x5ed385,_0x12e765){return db[_0xb778('0x20')][_0xb778('0x21')]({'where':_0x301949['options']?_0x301949['options'][_0xb778('0x1c')]||null:null})[_0xb778('0xc')](function(_0x1f9663){if(_0x1f9663){return _0x1f9663[_0xb778('0x22')](_0x301949['body'][_0xb778('0x23')],_[_0xb778('0x24')](_0x301949[_0xb778('0x19')],[_0xb778('0x23'),'id'])||{});}})[_0xb778('0x25')](function(_0x237f5f){logger['info']('AddTags',_0x301949);logger[_0xb778('0x1e')](_0xb778('0x26'),_0x301949,JSON[_0xb778('0x11')](_0x237f5f));_0x5ed385(_0x237f5f);})[_0xb778('0x16')](function(_0xf3a1f4){logger[_0xb778('0x12')]('AddTags',_0xf3a1f4[_0xb778('0x14')],_0x301949);_0x12e765(_this[_0xb778('0x12')](0x1f4,_0xf3a1f4[_0xb778('0x14')]));});});}; \ No newline at end of file +var _0x5d3b=['error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','addTags','ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x22d045,_0x13fd64){var _0x2460b1=function(_0x3e0ddf){while(--_0x3e0ddf){_0x22d045['push'](_0x22d045['shift']());}};_0x2460b1(++_0x13fd64);}(_0x5d3b,0x199));var _0xb5d3=function(_0x10ed7b,_0x18bc05){_0x10ed7b=_0x10ed7b-0x0;var _0x2e928e=_0x5d3b[_0x10ed7b];return _0x2e928e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb5d3('0x0'));var BPromise=require(_0xb5d3('0x1'));var rs=require(_0xb5d3('0x2'));var fs=require('fs');var Redis=require(_0xb5d3('0x3'));var db=require(_0xb5d3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb5d3('0x5'));var config=require(_0xb5d3('0x6'));var jayson=require(_0xb5d3('0x7'));var client=jayson[_0xb5d3('0x8')][_0xb5d3('0x9')]({'port':0x232a});config[_0xb5d3('0xa')]=_['defaults'](config['redis'],{'host':_0xb5d3('0xb'),'port':0x18eb});var socket=require(_0xb5d3('0xc'))(new Redis(config[_0xb5d3('0xa')]));require(_0xb5d3('0xd'))['register'](socket);function respondWithRpcPromise(_0x50ebac,_0x14d0cb,_0x557967){return new BPromise(function(_0x10d113,_0x20936c){return client[_0xb5d3('0xe')](_0x50ebac,_0x557967)[_0xb5d3('0xf')](function(_0x481e2f){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x14d0cb,_0xb5d3('0x10'));logger[_0xb5d3('0x11')](_0xb5d3('0x12'),_0x14d0cb,_0xb5d3('0x10'),JSON[_0xb5d3('0x13')](_0x481e2f));if(_0x481e2f[_0xb5d3('0x14')]){if(_0x481e2f[_0xb5d3('0x14')][_0xb5d3('0x15')]===0x1f4){logger[_0xb5d3('0x14')](_0xb5d3('0x16'),_0x14d0cb,_0x481e2f[_0xb5d3('0x14')][_0xb5d3('0x17')]);return _0x20936c(_0x481e2f[_0xb5d3('0x14')][_0xb5d3('0x17')]);}logger[_0xb5d3('0x14')](_0xb5d3('0x16'),_0x14d0cb,_0x481e2f['error'][_0xb5d3('0x17')]);return _0x10d113(_0x481e2f[_0xb5d3('0x14')][_0xb5d3('0x17')]);}else{logger[_0xb5d3('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x14d0cb,_0xb5d3('0x10'));_0x10d113(_0x481e2f[_0xb5d3('0x19')][_0xb5d3('0x17')]);}})[_0xb5d3('0x1a')](function(_0x34d64a){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x14d0cb,_0x34d64a);_0x20936c(_0x34d64a);});});}exports[_0xb5d3('0x1b')]=function(_0x42e129){var _0x400b9b=this;return new Promise(function(_0x3f983f,_0x2905ac){return db[_0xb5d3('0x1c')][_0xb5d3('0x1d')](_0x42e129[_0xb5d3('0x1e')],{'raw':_0x42e129[_0xb5d3('0x1f')]?_0x42e129[_0xb5d3('0x1f')][_0xb5d3('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42e129[_0xb5d3('0x1f')]?_0x42e129[_0xb5d3('0x1f')][_0xb5d3('0x21')]||null:null,'attributes':_0x42e129['options']?_0x42e129[_0xb5d3('0x1f')][_0xb5d3('0x22')]||null:null,'limit':_0x42e129[_0xb5d3('0x1f')]?_0x42e129[_0xb5d3('0x1f')]['limit']||null:null})[_0xb5d3('0xf')](function(_0x33b980){logger['info']('UpdateChatInteraction',_0x42e129);logger[_0xb5d3('0x11')](_0xb5d3('0x1b'),_0x42e129,JSON[_0xb5d3('0x13')](_0x33b980));_0x3f983f(_0x33b980);})[_0xb5d3('0x1a')](function(_0x101cf3){logger[_0xb5d3('0x14')](_0xb5d3('0x1b'),_0x101cf3[_0xb5d3('0x17')],_0x42e129);_0x2905ac(_0x400b9b[_0xb5d3('0x14')](0x1f4,_0x101cf3['message']));});});};exports['AddTagsToChatInteraction']=function(_0x446c66){return new Promise(function(_0x574c8c,_0x5f4460){return db[_0xb5d3('0x1c')]['find']({'where':_0x446c66[_0xb5d3('0x1f')]?_0x446c66['options']['where']||null:null})[_0xb5d3('0xf')](function(_0x9fea0e){if(_0x9fea0e){return _0x9fea0e[_0xb5d3('0x23')](_0x446c66[_0xb5d3('0x1e')][_0xb5d3('0x24')],_['omit'](_0x446c66['body'],['ids','id'])||{});}})[_0xb5d3('0x25')](function(_0x3bb833){logger[_0xb5d3('0x18')](_0xb5d3('0x26'),_0x446c66);logger[_0xb5d3('0x11')](_0xb5d3('0x26'),_0x446c66,JSON[_0xb5d3('0x13')](_0x3bb833));_0x574c8c(_0x3bb833);})[_0xb5d3('0x1a')](function(_0x3b9698){logger[_0xb5d3('0x14')](_0xb5d3('0x26'),_0x3b9698[_0xb5d3('0x17')],_0x446c66);_0x5f4460(_this[_0xb5d3('0x14')](0x1f4,_0x3b9698[_0xb5d3('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index dd75e5a..c0eda61 100644 --- a/server/api/chatInteraction/chatInteraction.socket.js +++ b/server/api/chatInteraction/chatInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49db=['removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove','update','emit'];(function(_0x455e00,_0x29577f){var _0x568400=function(_0x6dd5c9){while(--_0x6dd5c9){_0x455e00['push'](_0x455e00['shift']());}};_0x568400(++_0x29577f);}(_0x49db,0x82));var _0xb49d=function(_0x4c4d47,_0x35f28d){_0x4c4d47=_0x4c4d47-0x0;var _0x538a8d=_0x49db[_0x4c4d47];return _0x538a8d;};'use strict';var ChatInteractionEvents=require(_0xb49d('0x0'));var events=[_0xb49d('0x1'),_0xb49d('0x2'),_0xb49d('0x3')];function createListener(_0x392c6b,_0x1ceac8){return function(_0x16d9ef){_0x1ceac8[_0xb49d('0x4')](_0x392c6b,_0x16d9ef);};}function removeListener(_0x109f2b,_0x168667){return function(){ChatInteractionEvents[_0xb49d('0x5')](_0x109f2b,_0x168667);};}exports[_0xb49d('0x6')]=function(_0x4e209e){for(var _0x9f6579=0x0,_0x175906=events[_0xb49d('0x7')];_0x9f6579<_0x175906;_0x9f6579++){var _0xae9cac=events[_0x9f6579];var _0x3f5e1f=createListener(_0xb49d('0x8')+_0xae9cac,_0x4e209e);ChatInteractionEvents['on'](_0xae9cac,_0x3f5e1f);}}; \ No newline at end of file +var _0x06e7=['removeListener','register','length','chatInteraction:','./chatInteraction.events','remove','update','emit'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x06e7,0x1cc));var _0x706e=function(_0x391473,_0x1ea3cf){_0x391473=_0x391473-0x0;var _0x2e6ab8=_0x06e7[_0x391473];return _0x2e6ab8;};'use strict';var ChatInteractionEvents=require(_0x706e('0x0'));var events=['save',_0x706e('0x1'),_0x706e('0x2')];function createListener(_0xd6b51b,_0x48b9e9){return function(_0x3e5605){_0x48b9e9[_0x706e('0x3')](_0xd6b51b,_0x3e5605);};}function removeListener(_0x47e10d,_0x4daacb){return function(){ChatInteractionEvents[_0x706e('0x4')](_0x47e10d,_0x4daacb);};}exports[_0x706e('0x5')]=function(_0x113718){for(var _0x4e728f=0x0,_0x365776=events[_0x706e('0x6')];_0x4e728f<_0x365776;_0x4e728f++){var _0x56c5ff=events[_0x4e728f];var _0x42da2f=createListener(_0x706e('0x7')+_0x56c5ff,_0x113718);ChatInteractionEvents['on'](_0x56c5ff,_0x42da2f);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index de2d8ae..e1e7aba 100644 --- a/server/api/chatInteraction/index.js +++ b/server/api/chatInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0316=['server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','attachmentUpload','/:id/tags','tracked','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','/:id/abandon','close','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','join'];(function(_0x1f9295,_0x82aa05){var _0x3c8315=function(_0x38eb79){while(--_0x38eb79){_0x1f9295['push'](_0x1f9295['shift']());}};_0x3c8315(++_0x82aa05);}(_0x0316,0xd7));var _0x6031=function(_0x200c21,_0x471c7d){_0x200c21=_0x200c21-0x0;var _0x361107=_0x0316[_0x200c21];return _0x361107;};'use strict';var multer=require(_0x6031('0x0'));var util=require(_0x6031('0x1'));var path=require(_0x6031('0x2'));var timeout=require(_0x6031('0x3'));var express=require('express');var router=express[_0x6031('0x4')]();var auth=require(_0x6031('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6031('0x6'));router[_0x6031('0x7')]('/',auth[_0x6031('0x8')](),controller[_0x6031('0x9')]);router[_0x6031('0x7')](_0x6031('0xa'),auth[_0x6031('0x8')](),controller[_0x6031('0xb')]);router[_0x6031('0x7')](_0x6031('0xc'),auth[_0x6031('0xd')](),controller[_0x6031('0xe')]);router[_0x6031('0x7')](_0x6031('0xf'),auth[_0x6031('0xd')](),controller[_0x6031('0x10')]);router[_0x6031('0x7')](_0x6031('0x11'),auth[_0x6031('0x8')](),controller[_0x6031('0x12')]);router['get']('/:id/my_messages',auth[_0x6031('0xd')](),controller[_0x6031('0x13')]);router[_0x6031('0x7')](_0x6031('0x14'),auth[_0x6031('0x8')](),controller[_0x6031('0x15')]);router[_0x6031('0x16')]('/',auth['isAuthenticated'](),controller[_0x6031('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x409c9f,_0x3cf1d2,_0x1edeae){_0x1edeae(null,path[_0x6031('0x18')](config['root'],_0x6031('0x19')));},'filename':function(_0x546e55,_0x34c377,_0x3cce5d){_0x3cce5d(null,util[_0x6031('0x1a')](_0x6031('0x1b'),Date[_0x6031('0x1c')](),_0x34c377['originalname'][_0x6031('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6031('0x16')](_0x6031('0x1e'),upload[_0x6031('0x1f')]('file'),controller[_0x6031('0x20')]);router['post'](_0x6031('0x11'),auth[_0x6031('0xd')](),controller['addMessage']);router[_0x6031('0x16')](_0x6031('0x21'),auth[_0x6031('0x8')](),interaction[_0x6031('0x22')]('chat','chatinteraction:addtags'),controller[_0x6031('0x23')]);router[_0x6031('0x24')](_0x6031('0xc'),auth[_0x6031('0x8')](),interaction[_0x6031('0x22')](_0x6031('0x25'),_0x6031('0x26')),controller[_0x6031('0x27')]);router[_0x6031('0x24')](_0x6031('0x28'),controller['customUpdate']);router[_0x6031('0x24')](_0x6031('0x29'),auth[_0x6031('0xd')](),controller['abandon']);router[_0x6031('0x24')]('/:id/close',controller[_0x6031('0x2a')]);router['delete'](_0x6031('0xc'),auth[_0x6031('0x8')](),interaction[_0x6031('0x22')](_0x6031('0x25'),_0x6031('0x2b')),controller[_0x6031('0x2c')]);router[_0x6031('0x2d')](_0x6031('0x21'),auth['isAuthenticated'](),controller[_0x6031('0x2e')]);module[_0x6031('0x2f')]=router; \ No newline at end of file +var _0x7e23=['show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','diskStorage','join','root','format','%s-%s','now','replace','post','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','put','chat','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','destroy','removeTags','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','isChatInteractionAuthorized'];(function(_0x128c30,_0x287797){var _0x1ccab4=function(_0x40960d){while(--_0x40960d){_0x128c30['push'](_0x128c30['shift']());}};_0x1ccab4(++_0x287797);}(_0x7e23,0x83));var _0x37e2=function(_0x161736,_0x444985){_0x161736=_0x161736-0x0;var _0x171766=_0x7e23[_0x161736];return _0x171766;};'use strict';var multer=require(_0x37e2('0x0'));var util=require(_0x37e2('0x1'));var path=require(_0x37e2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x37e2('0x3')]();var auth=require(_0x37e2('0x4'));var interaction=require(_0x37e2('0x5'));var config=require(_0x37e2('0x6'));var controller=require('./chatInteraction.controller');router[_0x37e2('0x7')]('/',auth['isAuthenticated'](),controller[_0x37e2('0x8')]);router[_0x37e2('0x7')]('/describe',auth[_0x37e2('0x9')](),controller[_0x37e2('0xa')]);router[_0x37e2('0x7')](_0x37e2('0xb'),auth[_0x37e2('0xc')](),controller[_0x37e2('0xd')]);router['get'](_0x37e2('0xe'),auth[_0x37e2('0xc')](),controller['attachmentDownload']);router[_0x37e2('0x7')](_0x37e2('0xf'),auth[_0x37e2('0x9')](),controller[_0x37e2('0x10')]);router[_0x37e2('0x7')](_0x37e2('0x11'),auth[_0x37e2('0xc')](),controller[_0x37e2('0x12')]);router[_0x37e2('0x7')](_0x37e2('0x13'),auth[_0x37e2('0x9')](),controller[_0x37e2('0x14')]);router['post']('/',auth[_0x37e2('0x9')](),controller[_0x37e2('0x15')]);var upload=multer({'storage':multer[_0x37e2('0x16')]({'destination':function(_0x3fa454,_0x5506e4,_0x1dded2){_0x1dded2(null,path[_0x37e2('0x17')](config[_0x37e2('0x18')],'server/files/attachments/'));},'filename':function(_0x1db9c8,_0x165c31,_0x557055){_0x557055(null,util[_0x37e2('0x19')](_0x37e2('0x1a'),Date[_0x37e2('0x1b')](),_0x165c31['originalname'][_0x37e2('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x37e2('0x1d')]('/:id/attachment_upload',upload[_0x37e2('0x1e')](_0x37e2('0x1f')),controller[_0x37e2('0x20')]);router[_0x37e2('0x1d')](_0x37e2('0xf'),auth[_0x37e2('0xc')](),controller[_0x37e2('0x21')]);router['post'](_0x37e2('0x22'),auth[_0x37e2('0x9')](),interaction[_0x37e2('0x23')]('chat',_0x37e2('0x24')),controller['addTags']);router[_0x37e2('0x25')](_0x37e2('0xb'),auth[_0x37e2('0x9')](),interaction[_0x37e2('0x23')](_0x37e2('0x26'),'chatinteraction:update'),controller['update']);router[_0x37e2('0x25')](_0x37e2('0x27'),controller[_0x37e2('0x28')]);router['put']('/:id/abandon',auth[_0x37e2('0xc')](),controller[_0x37e2('0x29')]);router[_0x37e2('0x25')](_0x37e2('0x2a'),controller[_0x37e2('0x2b')]);router[_0x37e2('0x2c')](_0x37e2('0xb'),auth[_0x37e2('0x9')](),interaction['tracked'](_0x37e2('0x26'),'chatinteraction:destroy'),controller[_0x37e2('0x2d')]);router[_0x37e2('0x2c')]('/:id/tags',auth['isAuthenticated'](),controller[_0x37e2('0x2e')]);module[_0x37e2('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index c5e61a9..6bab356 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js +++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x1c226b,_0x11116b){var _0x3b5842=function(_0x5ccde1){while(--_0x5ccde1){_0x1c226b['push'](_0x1c226b['shift']());}};_0x3b5842(++_0x11116b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x775521,_0x438802){_0x775521=_0x775521-0x0;var _0x3ff68d=_0x5f2f[_0x775521];return _0x3ff68d;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf5f2('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf5f2('0x5')]}}; \ No newline at end of file +var _0xda2d=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x3095ea,_0x2d9bd4){var _0x2f42dd=function(_0x5bd3d9){while(--_0x5bd3d9){_0x3095ea['push'](_0x3095ea['shift']());}};_0x2f42dd(++_0x2d9bd4);}(_0xda2d,0x102));var _0xdda2=function(_0x482bc6,_0x5d195c){_0x482bc6=_0x482bc6-0x0;var _0x1c95c2=_0xda2d[_0x482bc6];return _0x1c95c2;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'body':{'type':Sequelize[_0xdda2('0x1')](_0xdda2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdda2('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 4142208..7d61a65 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.controller.js +++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4329=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','offset','limit','set','json','apply','reject','save','update','then','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','count','includeAll','findAll','rows','show','params','ChatInternalMessage','include','catch','create','body','find','destroy','describe','get','messages','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','User','agent','user','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','isEmpty','resourceId','push','createdAt','FromId','read','all'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4329,0x13b));var _0x9432=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x4329[_0xefd519];return _0x4bb882;};'use strict';var pdf=require(_0x9432('0x0'));var emlformat=require(_0x9432('0x1'));var rimraf=require(_0x9432('0x2'));var zipdir=require(_0x9432('0x3'));var jsonpatch=require(_0x9432('0x4'));var rp=require(_0x9432('0x5'));var moment=require(_0x9432('0x6'));var BPromise=require(_0x9432('0x7'));var Mustache=require(_0x9432('0x8'));var util=require(_0x9432('0x9'));var path=require(_0x9432('0xa'));var sox=require(_0x9432('0xb'));var csv=require(_0x9432('0xc'));var ejs=require(_0x9432('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9432('0xe'));var crypto=require('crypto');var jsforce=require(_0x9432('0xf'));var deskjs=require(_0x9432('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9432('0x11'));var Papa=require(_0x9432('0x12'));var Redis=require(_0x9432('0x13'));var authService=require(_0x9432('0x14'));var qs=require(_0x9432('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9432('0x16'))(_0x9432('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x9432('0x18'))['db'];config[_0x9432('0x19')]=_[_0x9432('0x1a')](config[_0x9432('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x9432('0x1b'))(new Redis(config[_0x9432('0x19')]));require(_0x9432('0x1c'))[_0x9432('0x1d')](socket);function respondWithStatusCode(_0x4a9793,_0x5e3c0d){_0x5e3c0d=_0x5e3c0d||0xcc;return function(_0x3c2eea){if(_0x3c2eea){return _0x4a9793[_0x9432('0x1e')](_0x5e3c0d);}return _0x4a9793['status'](_0x5e3c0d)[_0x9432('0x1f')]();};}function respondWithResult(_0x37bd72,_0x5678c4){_0x5678c4=_0x5678c4||0xc8;return function(_0x2b8d4b){if(_0x2b8d4b){return _0x37bd72[_0x9432('0x20')](_0x5678c4)['json'](_0x2b8d4b);}};}function respondWithFilteredResult(_0x5c4360,_0x496a9f){return function(_0x5e2163){if(_0x5e2163){var _0x5c6610=_0x5e2163['count'],_0x2eabe3=_0x496a9f[_0x9432('0x21')],_0x18f944=_0x496a9f['offset']+_0x496a9f[_0x9432('0x22')],_0xac7dce;if(_0x18f944>=_0x5c6610){_0x18f944=_0x5c6610;_0xac7dce=0xc8;}else{_0xac7dce=0xce;}_0x5c4360[_0x9432('0x20')](_0xac7dce);return _0x5c4360[_0x9432('0x23')]('Content-Range',_0x2eabe3+'-'+_0x18f944+'/'+_0x5c6610)[_0x9432('0x24')](_0x5e2163);}return null;};}function patchUpdates(_0x1122ee){return function(_0x450101){try{jsonpatch[_0x9432('0x25')](_0x450101,_0x1122ee,!![]);}catch(_0xf62a59){return BPromise[_0x9432('0x26')](_0xf62a59);}return _0x450101[_0x9432('0x27')]();};}function saveUpdates(_0x57721f,_0x47c4aa){return function(_0x4e247c){if(_0x4e247c){return _0x4e247c[_0x9432('0x28')](_0x57721f)[_0x9432('0x29')](function(_0xf1b400){return _0xf1b400;});}return null;};}function removeEntity(_0x1c4829,_0x4a9895){return function(_0x243225){if(_0x243225){return _0x243225['destroy']()[_0x9432('0x29')](function(){_0x1c4829[_0x9432('0x20')](0xcc)[_0x9432('0x1f')]();});}};}function handleEntityNotFound(_0x1dfee6,_0x274610){return function(_0x21aab4){if(!_0x21aab4){_0x1dfee6[_0x9432('0x1e')](0x194);}return _0x21aab4;};}function handleError(_0x205ce9,_0x9d258d){_0x9d258d=_0x9d258d||0x1f4;return function(_0x14627b){logger['error'](_0x14627b['stack']);if(_0x14627b[_0x9432('0x2a')]){delete _0x14627b['name'];}_0x205ce9['status'](_0x9d258d)[_0x9432('0x2b')](_0x14627b);};}exports['index']=function(_0x4bf4ae,_0x3c8992){var _0x27a638={},_0x146a06={},_0x22ba3d={'count':0x0,'rows':[]};var _0x5d4f68=db['ChatInternalMessage'][_0x9432('0x2c')];_0x146a06[_0x9432('0x2d')]=_[_0x9432('0x2e')](_0x5d4f68);_0x146a06[_0x9432('0x2f')]=_[_0x9432('0x2e')](_0x4bf4ae[_0x9432('0x2f')]);_0x146a06[_0x9432('0x30')]=_[_0x9432('0x31')](_0x146a06[_0x9432('0x2d')],_0x146a06['query']);_0x27a638['attributes']=_['intersection'](_0x146a06[_0x9432('0x2d')],qs[_0x9432('0x32')](_0x4bf4ae['query']['fields']));_0x27a638[_0x9432('0x33')]=_0x27a638[_0x9432('0x33')][_0x9432('0x34')]?_0x27a638['attributes']:_0x146a06[_0x9432('0x2d')];if(!_0x4bf4ae[_0x9432('0x2f')][_0x9432('0x35')]('nolimit')){_0x27a638[_0x9432('0x22')]=qs['limit'](_0x4bf4ae[_0x9432('0x2f')][_0x9432('0x22')]);_0x27a638['offset']=qs[_0x9432('0x21')](_0x4bf4ae[_0x9432('0x2f')][_0x9432('0x21')]);}_0x27a638[_0x9432('0x36')]=qs[_0x9432('0x37')](_0x4bf4ae[_0x9432('0x2f')][_0x9432('0x37')]);_0x27a638[_0x9432('0x38')]=qs[_0x9432('0x30')](_[_0x9432('0x39')](_0x4bf4ae['query'],_0x146a06['filters']));if(_0x4bf4ae[_0x9432('0x2f')][_0x9432('0x3a')]){_0x27a638[_0x9432('0x38')]=_[_0x9432('0x3b')](_0x27a638[_0x9432('0x38')],{'$or':_[_0x9432('0x3c')](_0x5d4f68,function(_0x19b364){if(_0x19b364[_0x9432('0x3d')]['key']!==_0x9432('0x3e')){var _0x157ca6={};_0x157ca6[_0x19b364[_0x9432('0x3f')]]={'$like':'%'+_0x4bf4ae['query'][_0x9432('0x3a')]+'%'};return _0x157ca6;}})});}_0x27a638=_['merge']({},_0x27a638,_0x4bf4ae[_0x9432('0x40')]);var _0x5ece1c={'where':_0x27a638[_0x9432('0x38')]};return db['ChatInternalMessage'][_0x9432('0x41')](_0x5ece1c)[_0x9432('0x29')](function(_0x26eb35){_0x22ba3d['count']=_0x26eb35;if(_0x4bf4ae[_0x9432('0x2f')][_0x9432('0x42')]){_0x27a638['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x9432('0x43')](_0x27a638);})[_0x9432('0x29')](function(_0x3f6809){_0x22ba3d[_0x9432('0x44')]=_0x3f6809;return _0x22ba3d;})[_0x9432('0x29')](respondWithFilteredResult(_0x3c8992,_0x27a638))['catch'](handleError(_0x3c8992,null));};exports[_0x9432('0x45')]=function(_0x16b539,_0x575d46){var _0x51e068={'raw':!![],'where':{'id':_0x16b539[_0x9432('0x46')]['id']}},_0x110e87={};_0x110e87[_0x9432('0x2d')]=_[_0x9432('0x2e')](db[_0x9432('0x47')][_0x9432('0x2c')]);_0x110e87[_0x9432('0x2f')]=_[_0x9432('0x2e')](_0x16b539['query']);_0x110e87[_0x9432('0x30')]=_[_0x9432('0x31')](_0x110e87[_0x9432('0x2d')],_0x110e87[_0x9432('0x2f')]);_0x51e068['attributes']=_['intersection'](_0x110e87[_0x9432('0x2d')],qs[_0x9432('0x32')](_0x16b539[_0x9432('0x2f')][_0x9432('0x32')]));_0x51e068['attributes']=_0x51e068[_0x9432('0x33')][_0x9432('0x34')]?_0x51e068[_0x9432('0x33')]:_0x110e87[_0x9432('0x2d')];if(_0x16b539[_0x9432('0x2f')][_0x9432('0x42')]){_0x51e068[_0x9432('0x48')]=[{'all':!![]}];}_0x51e068=_['merge']({},_0x51e068,_0x16b539[_0x9432('0x40')]);return db[_0x9432('0x47')]['find'](_0x51e068)['then'](handleEntityNotFound(_0x575d46,null))[_0x9432('0x29')](respondWithResult(_0x575d46,null))[_0x9432('0x49')](handleError(_0x575d46,null));};exports['create']=function(_0x8ab032,_0x5f0127){return db[_0x9432('0x47')][_0x9432('0x4a')](_0x8ab032[_0x9432('0x4b')],{})['then'](respondWithResult(_0x5f0127,0xc9))['catch'](handleError(_0x5f0127,null));};exports[_0x9432('0x28')]=function(_0x572a11,_0x3974a5){if(_0x572a11['body']['id']){delete _0x572a11['body']['id'];}return db['ChatInternalMessage'][_0x9432('0x4c')]({'where':{'id':_0x572a11[_0x9432('0x46')]['id']}})['then'](handleEntityNotFound(_0x3974a5,null))[_0x9432('0x29')](saveUpdates(_0x572a11[_0x9432('0x4b')],null))[_0x9432('0x29')](respondWithResult(_0x3974a5,null))[_0x9432('0x49')](handleError(_0x3974a5,null));};exports[_0x9432('0x4d')]=function(_0x5047f0,_0x2fcf4f){return db['ChatInternalMessage'][_0x9432('0x4c')]({'where':{'id':_0x5047f0[_0x9432('0x46')]['id']}})[_0x9432('0x29')](handleEntityNotFound(_0x2fcf4f,null))[_0x9432('0x29')](removeEntity(_0x2fcf4f,null))[_0x9432('0x49')](handleError(_0x2fcf4f,null));};exports[_0x9432('0x4e')]=function(_0x47c19e,_0x29b214){return db[_0x9432('0x47')][_0x9432('0x4e')]()[_0x9432('0x29')](respondWithResult(_0x29b214,null))[_0x9432('0x49')](handleError(_0x29b214,null));};function wrapUser(_0x34ebe7){return function(_0x5cbfcb){var _0x22af6e=_0x34ebe7[_0x9432('0x4f')]({'plain':!![]});_0x22af6e[_0x9432('0x50')]=[];if(_0x5cbfcb){_0x22af6e[_0x9432('0x51')]=_0x5cbfcb['createdAt'];_0x22af6e['lastMessage']=_0x5cbfcb;}else{_0x22af6e[_0x9432('0x51')]=moment(0x0)['format'](_0x9432('0x52'));_0x22af6e['lastMessage']={};}return _0x22af6e;};}exports['getUsers']=function(_0xe7a473,_0xe2171f,_0x1c3f54){var _0x306f10=[];return db[_0x9432('0x53')]['findAll']({'where':{'role':[_0x9432('0x54'),'admin',_0x9432('0x55')]},'attributes':['id','fullname',_0x9432('0x2a'),'role',_0x9432('0x56'),_0x9432('0x57'),_0x9432('0x58'),_0x9432('0x59'),'allowmessenger',_0x9432('0x5a')],'order':qs['sort'](_0x9432('0x5b')),'include':[{'model':db[_0x9432('0x5c')],'as':_0x9432('0x5d'),'attributes':['id','name',_0x9432('0x3d')],'through':{'attributes':[]}}]})[_0x9432('0x29')](function(_0x9cac3f){if(_0x9cac3f){var _0x126fa6=_0xe7a473['user'][_0x9432('0x4f')]({'plain':!![]});if(!_0x126fa6)throw new Error(_0x9432('0x5e'));if(_0x126fa6[_0x9432('0x5f')]==='user'){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x126fa6[_0x9432('0x60')]},'raw':!![]})[_0x9432('0x29')](function(_0x6125b0){if(_0x6125b0){if(_0x6125b0[_0x9432('0x61')]===0x0){return db['UserProfileResource'][_0x9432('0x43')]({'where':{'sectionId':_0x6125b0['id']},'raw':!![]})[_0x9432('0x29')](function(_0x489e3e){var _0x577771=[];if(_[_0x9432('0x62')](_0x489e3e)){_0x577771=_[_0x9432('0x3a')](_0x9cac3f,function(_0x149a13){if(_0x149a13[_0x9432('0x5f')]!==_0x9432('0x54')){return _0x149a13;}});return _0x577771;}else{for(var _0x283cdf=0x0;_0x283cdf<_0x9cac3f[_0x9432('0x34')];_0x283cdf++){var _0x4fe999=_0x9cac3f[_0x283cdf];if(_0x4fe999[_0x9432('0x5f')]===_0x9432('0x54')){var _0x14d616=_['find'](_0x489e3e,function(_0x4d4fbd){return _0x4d4fbd[_0x9432('0x63')]===_0x4fe999['id'];});if(_0x14d616)_0x577771[_0x9432('0x64')](_0x4fe999);}else{_0x577771['push'](_0x4fe999);}}return _0x577771;}});}else{return _0x9cac3f;}}else{var _0x3ab0f4=_[_0x9432('0x3a')](_0x9cac3f,function(_0xfe5353){if(_0xfe5353[_0x9432('0x5f')]!==_0x9432('0x54')){return _0xfe5353;}});return _0x3ab0f4;}});}else{return _0x9cac3f;}}})[_0x9432('0x29')](function(_0xb146e2){var _0x196bba=[];if(_0xb146e2){_0x306f10=_0xb146e2;for(var _0x142d6b=0x0;_0x142d6b<_0xb146e2['length'];_0x142d6b+=0x1){_0x306f10[_0x142d6b]['messages']=[];_0x196bba[_0x9432('0x64')](db[_0x9432('0x47')][_0x9432('0x4c')]({'where':{'FromId':[_0xe7a473[_0x9432('0x55')]['id'],_0xb146e2[_0x142d6b]['id']],'ToId':[_0xe7a473[_0x9432('0x55')]['id'],_0xb146e2[_0x142d6b]['id']],'ChatGroupId':null},'attributes':['id',_0x9432('0x65'),_0x9432('0x66'),'ToId',_0x9432('0x67'),_0x9432('0x4b')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9432('0x29')](wrapUser(_0xb146e2[_0x142d6b])));}return BPromise[_0x9432('0x68')](_0x196bba);}return[];})[_0x9432('0x29')](function(_0x4e1020){return{'rows':_0x4e1020,'count':_0x4e1020['length']};})[_0x9432('0x29')](respondWithResult(_0xe2171f,null))[_0x9432('0x49')](handleError(_0xe2171f,null));}; \ No newline at end of file +var _0x1bc6=['type','VIRTUAL','field','include','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','update','destroy','describe','messages','lastMessageAt','createdAt','lastMessage','User','findAll','agent','user','fullname','role','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','resourceId','push','ToId','read','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','ChatInternalMessage','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x2d7398,_0x28d445){var _0x18400c=function(_0x37cc70){while(--_0x37cc70){_0x2d7398['push'](_0x2d7398['shift']());}};_0x18400c(++_0x28d445);}(_0x1bc6,0x94));var _0x61bc=function(_0x49f8c4,_0xfaa8d4){_0x49f8c4=_0x49f8c4-0x0;var _0x1c60b3=_0x1bc6[_0x49f8c4];return _0x1c60b3;};'use strict';var pdf=require(_0x61bc('0x0'));var emlformat=require(_0x61bc('0x1'));var rimraf=require(_0x61bc('0x2'));var zipdir=require(_0x61bc('0x3'));var jsonpatch=require(_0x61bc('0x4'));var rp=require(_0x61bc('0x5'));var moment=require(_0x61bc('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x61bc('0x7'));var util=require(_0x61bc('0x8'));var path=require(_0x61bc('0x9'));var sox=require(_0x61bc('0xa'));var csv=require(_0x61bc('0xb'));var ejs=require(_0x61bc('0xc'));var fs=require('fs');var _=require(_0x61bc('0xd'));var squel=require(_0x61bc('0xe'));var crypto=require(_0x61bc('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x61bc('0x10'));var toCsv=require('to-csv');var querystring=require(_0x61bc('0x11'));var Papa=require('papaparse');var Redis=require(_0x61bc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x61bc('0x13'));var hardwareService=require(_0x61bc('0x14'));var logger=require(_0x61bc('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x61bc('0x16')](config['redis'],{'host':_0x61bc('0x17'),'port':0x18eb});var socket=require(_0x61bc('0x18'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x1029ff,_0x2872f0){_0x2872f0=_0x2872f0||0xcc;return function(_0x4f6796){if(_0x4f6796){return _0x1029ff[_0x61bc('0x19')](_0x2872f0);}return _0x1029ff[_0x61bc('0x1a')](_0x2872f0)[_0x61bc('0x1b')]();};}function respondWithResult(_0x10ec88,_0x2d763e){_0x2d763e=_0x2d763e||0xc8;return function(_0x16c23b){if(_0x16c23b){return _0x10ec88['status'](_0x2d763e)[_0x61bc('0x1c')](_0x16c23b);}};}function respondWithFilteredResult(_0x21b974,_0x4f9189){return function(_0x5cc088){if(_0x5cc088){var _0xc7a331=_0x5cc088[_0x61bc('0x1d')],_0x2a6f35=_0x4f9189[_0x61bc('0x1e')],_0x96cd3=_0x4f9189[_0x61bc('0x1e')]+_0x4f9189[_0x61bc('0x1f')],_0x4ca1c3;if(_0x96cd3>=_0xc7a331){_0x96cd3=_0xc7a331;_0x4ca1c3=0xc8;}else{_0x4ca1c3=0xce;}_0x21b974['status'](_0x4ca1c3);return _0x21b974[_0x61bc('0x20')](_0x61bc('0x21'),_0x2a6f35+'-'+_0x96cd3+'/'+_0xc7a331)[_0x61bc('0x1c')](_0x5cc088);}return null;};}function patchUpdates(_0x144b07){return function(_0x48019f){try{jsonpatch[_0x61bc('0x22')](_0x48019f,_0x144b07,!![]);}catch(_0x17a5e3){return BPromise[_0x61bc('0x23')](_0x17a5e3);}return _0x48019f[_0x61bc('0x24')]();};}function saveUpdates(_0x1895fc,_0x141db2){return function(_0x1f4f49){if(_0x1f4f49){return _0x1f4f49['update'](_0x1895fc)[_0x61bc('0x25')](function(_0x35fb36){return _0x35fb36;});}return null;};}function removeEntity(_0x14d391,_0x3a8d1f){return function(_0x270f1c){if(_0x270f1c){return _0x270f1c['destroy']()[_0x61bc('0x25')](function(){_0x14d391[_0x61bc('0x1a')](0xcc)[_0x61bc('0x1b')]();});}};}function handleEntityNotFound(_0x297f40,_0x2caf2a){return function(_0x52432d){if(!_0x52432d){_0x297f40['sendStatus'](0x194);}return _0x52432d;};}function handleError(_0x1b1cb5,_0x49065a){_0x49065a=_0x49065a||0x1f4;return function(_0x2efe90){logger[_0x61bc('0x26')](_0x2efe90[_0x61bc('0x27')]);if(_0x2efe90[_0x61bc('0x28')]){delete _0x2efe90['name'];}_0x1b1cb5[_0x61bc('0x1a')](_0x49065a)[_0x61bc('0x29')](_0x2efe90);};}exports[_0x61bc('0x2a')]=function(_0x256b54,_0x364600){var _0x35498e={},_0x1e65a6={},_0x13c3db={'count':0x0,'rows':[]};var _0x3215b9=db[_0x61bc('0x2b')]['rawAttributes'];_0x1e65a6[_0x61bc('0x2c')]=_[_0x61bc('0x2d')](_0x3215b9);_0x1e65a6[_0x61bc('0x2e')]=_[_0x61bc('0x2d')](_0x256b54[_0x61bc('0x2e')]);_0x1e65a6[_0x61bc('0x2f')]=_[_0x61bc('0x30')](_0x1e65a6[_0x61bc('0x2c')],_0x1e65a6[_0x61bc('0x2e')]);_0x35498e['attributes']=_['intersection'](_0x1e65a6['model'],qs[_0x61bc('0x31')](_0x256b54[_0x61bc('0x2e')][_0x61bc('0x31')]));_0x35498e[_0x61bc('0x32')]=_0x35498e[_0x61bc('0x32')][_0x61bc('0x33')]?_0x35498e[_0x61bc('0x32')]:_0x1e65a6[_0x61bc('0x2c')];if(!_0x256b54['query'][_0x61bc('0x34')](_0x61bc('0x35'))){_0x35498e['limit']=qs[_0x61bc('0x1f')](_0x256b54['query'][_0x61bc('0x1f')]);_0x35498e['offset']=qs[_0x61bc('0x1e')](_0x256b54[_0x61bc('0x2e')][_0x61bc('0x1e')]);}_0x35498e['order']=qs['sort'](_0x256b54['query'][_0x61bc('0x36')]);_0x35498e[_0x61bc('0x37')]=qs['filters'](_['pick'](_0x256b54[_0x61bc('0x2e')],_0x1e65a6[_0x61bc('0x2f')]));if(_0x256b54['query'][_0x61bc('0x38')]){_0x35498e[_0x61bc('0x37')]=_[_0x61bc('0x39')](_0x35498e['where'],{'$or':_['map'](_0x3215b9,function(_0x4d35e5){if(_0x4d35e5[_0x61bc('0x3a')]['key']!==_0x61bc('0x3b')){var _0x1c2e83={};_0x1c2e83[_0x4d35e5[_0x61bc('0x3c')]]={'$like':'%'+_0x256b54[_0x61bc('0x2e')]['filter']+'%'};return _0x1c2e83;}})});}_0x35498e=_[_0x61bc('0x39')]({},_0x35498e,_0x256b54['options']);var _0x448daf={'where':_0x35498e['where']};return db[_0x61bc('0x2b')][_0x61bc('0x1d')](_0x448daf)[_0x61bc('0x25')](function(_0x49310f){_0x13c3db[_0x61bc('0x1d')]=_0x49310f;if(_0x256b54[_0x61bc('0x2e')]['includeAll']){_0x35498e[_0x61bc('0x3d')]=[{'all':!![]}];}return db[_0x61bc('0x2b')]['findAll'](_0x35498e);})[_0x61bc('0x25')](function(_0x4322b6){_0x13c3db[_0x61bc('0x3e')]=_0x4322b6;return _0x13c3db;})[_0x61bc('0x25')](respondWithFilteredResult(_0x364600,_0x35498e))[_0x61bc('0x3f')](handleError(_0x364600,null));};exports[_0x61bc('0x40')]=function(_0x328931,_0xd77db3){var _0x3df4f1={'raw':!![],'where':{'id':_0x328931[_0x61bc('0x41')]['id']}},_0x2447ea={};_0x2447ea['model']=_[_0x61bc('0x2d')](db['ChatInternalMessage'][_0x61bc('0x42')]);_0x2447ea[_0x61bc('0x2e')]=_['keys'](_0x328931[_0x61bc('0x2e')]);_0x2447ea[_0x61bc('0x2f')]=_[_0x61bc('0x30')](_0x2447ea[_0x61bc('0x2c')],_0x2447ea[_0x61bc('0x2e')]);_0x3df4f1[_0x61bc('0x32')]=_['intersection'](_0x2447ea[_0x61bc('0x2c')],qs[_0x61bc('0x31')](_0x328931[_0x61bc('0x2e')]['fields']));_0x3df4f1[_0x61bc('0x32')]=_0x3df4f1[_0x61bc('0x32')][_0x61bc('0x33')]?_0x3df4f1[_0x61bc('0x32')]:_0x2447ea['model'];if(_0x328931['query'][_0x61bc('0x43')]){_0x3df4f1[_0x61bc('0x3d')]=[{'all':!![]}];}_0x3df4f1=_[_0x61bc('0x39')]({},_0x3df4f1,_0x328931[_0x61bc('0x44')]);return db['ChatInternalMessage'][_0x61bc('0x45')](_0x3df4f1)[_0x61bc('0x25')](handleEntityNotFound(_0xd77db3,null))[_0x61bc('0x25')](respondWithResult(_0xd77db3,null))[_0x61bc('0x3f')](handleError(_0xd77db3,null));};exports[_0x61bc('0x46')]=function(_0x2b156c,_0x53774f){return db[_0x61bc('0x2b')][_0x61bc('0x46')](_0x2b156c[_0x61bc('0x47')],{})[_0x61bc('0x25')](respondWithResult(_0x53774f,0xc9))[_0x61bc('0x3f')](handleError(_0x53774f,null));};exports[_0x61bc('0x48')]=function(_0x1c97fd,_0x45b61b){if(_0x1c97fd['body']['id']){delete _0x1c97fd[_0x61bc('0x47')]['id'];}return db[_0x61bc('0x2b')][_0x61bc('0x45')]({'where':{'id':_0x1c97fd['params']['id']}})[_0x61bc('0x25')](handleEntityNotFound(_0x45b61b,null))['then'](saveUpdates(_0x1c97fd[_0x61bc('0x47')],null))['then'](respondWithResult(_0x45b61b,null))['catch'](handleError(_0x45b61b,null));};exports[_0x61bc('0x49')]=function(_0x3caa5e,_0x5afdcf){return db[_0x61bc('0x2b')][_0x61bc('0x45')]({'where':{'id':_0x3caa5e['params']['id']}})[_0x61bc('0x25')](handleEntityNotFound(_0x5afdcf,null))[_0x61bc('0x25')](removeEntity(_0x5afdcf,null))['catch'](handleError(_0x5afdcf,null));};exports[_0x61bc('0x4a')]=function(_0x239f96,_0xbfc5b3){return db[_0x61bc('0x2b')][_0x61bc('0x4a')]()[_0x61bc('0x25')](respondWithResult(_0xbfc5b3,null))[_0x61bc('0x3f')](handleError(_0xbfc5b3,null));};function wrapUser(_0x349dc1){return function(_0x43fad9){var _0x225381=_0x349dc1['get']({'plain':!![]});_0x225381[_0x61bc('0x4b')]=[];if(_0x43fad9){_0x225381[_0x61bc('0x4c')]=_0x43fad9[_0x61bc('0x4d')];_0x225381[_0x61bc('0x4e')]=_0x43fad9;}else{_0x225381['lastMessageAt']=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x225381[_0x61bc('0x4e')]={};}return _0x225381;};}exports['getUsers']=function(_0x242410,_0x559519,_0xc1c33e){var _0x463ddb=[];return db[_0x61bc('0x4f')][_0x61bc('0x50')]({'where':{'role':[_0x61bc('0x51'),'admin',_0x61bc('0x52')]},'attributes':['id',_0x61bc('0x53'),_0x61bc('0x28'),_0x61bc('0x54'),'userpic',_0x61bc('0x55'),_0x61bc('0x56'),_0x61bc('0x57'),_0x61bc('0x58'),'showWebBar'],'order':qs['sort'](_0x61bc('0x59')),'include':[{'model':db[_0x61bc('0x5a')],'as':_0x61bc('0x5b'),'attributes':['id',_0x61bc('0x28'),_0x61bc('0x3a')],'through':{'attributes':[]}}]})[_0x61bc('0x25')](function(_0x4beeeb){if(_0x4beeeb){var _0x1068bb=_0x242410['user'][_0x61bc('0x5c')]({'plain':!![]});if(!_0x1068bb)throw new Error(_0x61bc('0x5d'));if(_0x1068bb[_0x61bc('0x54')]===_0x61bc('0x52')){return db[_0x61bc('0x5e')]['find']({'where':{'name':_0x61bc('0x5f'),'userProfileId':_0x1068bb['userProfileId']},'raw':!![]})[_0x61bc('0x25')](function(_0x2ba110){if(_0x2ba110){if(_0x2ba110[_0x61bc('0x60')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2ba110['id']},'raw':!![]})[_0x61bc('0x25')](function(_0x4b960c){var _0x1842a8=[];if(_['isEmpty'](_0x4b960c)){_0x1842a8=_[_0x61bc('0x38')](_0x4beeeb,function(_0x1b1072){if(_0x1b1072[_0x61bc('0x54')]!==_0x61bc('0x51')){return _0x1b1072;}});return _0x1842a8;}else{for(var _0x3e09cb=0x0;_0x3e09cb<_0x4beeeb['length'];_0x3e09cb++){var _0x22a71e=_0x4beeeb[_0x3e09cb];if(_0x22a71e['role']===_0x61bc('0x51')){var _0x15fe6a=_[_0x61bc('0x45')](_0x4b960c,function(_0x28d0f6){return _0x28d0f6[_0x61bc('0x61')]===_0x22a71e['id'];});if(_0x15fe6a)_0x1842a8['push'](_0x22a71e);}else{_0x1842a8[_0x61bc('0x62')](_0x22a71e);}}return _0x1842a8;}});}else{return _0x4beeeb;}}else{var _0x5da476=_[_0x61bc('0x38')](_0x4beeeb,function(_0x2ea757){if(_0x2ea757[_0x61bc('0x54')]!==_0x61bc('0x51')){return _0x2ea757;}});return _0x5da476;}});}else{return _0x4beeeb;}}})[_0x61bc('0x25')](function(_0x4fbd4d){var _0x971b45=[];if(_0x4fbd4d){_0x463ddb=_0x4fbd4d;for(var _0x4bd891=0x0;_0x4bd891<_0x4fbd4d[_0x61bc('0x33')];_0x4bd891+=0x1){_0x463ddb[_0x4bd891][_0x61bc('0x4b')]=[];_0x971b45['push'](db[_0x61bc('0x2b')]['find']({'where':{'FromId':[_0x242410[_0x61bc('0x52')]['id'],_0x4fbd4d[_0x4bd891]['id']],'ToId':[_0x242410[_0x61bc('0x52')]['id'],_0x4fbd4d[_0x4bd891]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x61bc('0x63'),_0x61bc('0x64'),'body'],'order':qs['sort'](_0x61bc('0x65')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x61bc('0x25')](wrapUser(_0x4fbd4d[_0x4bd891])));}return BPromise[_0x61bc('0x66')](_0x971b45);}return[];})[_0x61bc('0x25')](function(_0x17e53f){return{'rows':_0x17e53f,'count':_0x17e53f[_0x61bc('0x33')]};})['then'](respondWithResult(_0x559519,null))[_0x61bc('0x3f')](handleError(_0x559519,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index d10457a..8e4dcf1 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.events.js +++ b/server/api/chatInternalMessage/chatInternalMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb613=['emit','hasOwnProperty','exports','events','../../mysqldb','save','update'];(function(_0x3bd478,_0x1bb19a){var _0x5d4211=function(_0xa26806){while(--_0xa26806){_0x3bd478['push'](_0x3bd478['shift']());}};_0x5d4211(++_0x1bb19a);}(_0xb613,0x9d));var _0x3b61=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0xb613[_0x4e1a49];return _0x136aae;};'use strict';var EventEmitter=require(_0x3b61('0x0'));var ChatInternalMessage=require(_0x3b61('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3b61('0x2'),'afterUpdate':_0x3b61('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4110a2){return function(_0x37051e,_0x20747b,_0x190052){ChatInternalMessageEvents[_0x3b61('0x4')](_0x4110a2+':'+_0x37051e['id'],_0x37051e);ChatInternalMessageEvents[_0x3b61('0x4')](_0x4110a2,_0x37051e);_0x190052(null);};}for(var e in events){if(events[_0x3b61('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x3b61('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x1fdc=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5ec688,_0x115f65){var _0x557ef0=function(_0x329696){while(--_0x329696){_0x5ec688['push'](_0x5ec688['shift']());}};_0x557ef0(++_0x115f65);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x42bb6d,_0x412255){_0x42bb6d=_0x42bb6d-0x0;var _0x1db89b=_0x1fdc[_0x42bb6d];return _0x1db89b;};'use strict';var EventEmitter=require(_0xc1fd('0x0'));var ChatInternalMessage=require(_0xc1fd('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc1fd('0x2')](0x0);var events={'afterCreate':_0xc1fd('0x3'),'afterUpdate':_0xc1fd('0x4'),'afterDestroy':_0xc1fd('0x5')};function emitEvent(_0x2218db){return function(_0x7fe059,_0x259024,_0x57b96f){ChatInternalMessageEvents[_0xc1fd('0x6')](_0x2218db+':'+_0x7fe059['id'],_0x7fe059);ChatInternalMessageEvents[_0xc1fd('0x6')](_0x2218db,_0x7fe059);_0x57b96f(null);};}for(var e in events){if(events[_0xc1fd('0x7')](e)){var event=events[e];ChatInternalMessage[_0xc1fd('0x8')](e,emitEvent(event));}}module[_0xc1fd('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index c4d85d9..7aea049 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.model.js +++ b/server/api/chatInternalMessage/chatInternalMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x2969ec,_0xf8efe0){var _0x26ea75=function(_0x3ef1f8){while(--_0x3ef1f8){_0x2969ec['push'](_0x2969ec['shift']());}};_0x26ea75(++_0xf8efe0);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0baf('0xd')});}; \ No newline at end of file +var _0xbaf0=['define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x5d4bb8,_0x1a1700){var _0x49e873=function(_0x2dcfdd){while(--_0x2dcfdd){_0x5d4bb8['push'](_0x5d4bb8['shift']());}};_0x49e873(++_0x1a1700);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0baf('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 1a73c5d..49ae3f1 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js +++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x725e=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','localhost','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x283781,_0x154fa2){var _0x21ad38=function(_0x8cb322){while(--_0x8cb322){_0x283781['push'](_0x283781['shift']());}};_0x21ad38(++_0x154fa2);}(_0x725e,0xd2));var _0xe725=function(_0x355b8c,_0x2750fb){_0x355b8c=_0x355b8c-0x0;var _0x54afa3=_0x725e[_0x355b8c];return _0x54afa3;};'use strict';var _=require(_0xe725('0x0'));var util=require(_0xe725('0x1'));var moment=require(_0xe725('0x2'));var BPromise=require(_0xe725('0x3'));var rs=require(_0xe725('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe725('0x5'))['db'];var utils=require(_0xe725('0x6'));var logger=require(_0xe725('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe725('0x8'));var client=jayson[_0xe725('0x9')]['http']({'port':0x232a});config[_0xe725('0xa')]=_['defaults'](config[_0xe725('0xa')],{'host':_0xe725('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe725('0xa')]));require(_0xe725('0xc'))[_0xe725('0xd')](socket);function respondWithRpcPromise(_0x8daaa,_0x142b6e,_0x50a628){return new BPromise(function(_0x38872c,_0x42e86f){return client['request'](_0x8daaa,_0x50a628)[_0xe725('0xe')](function(_0x3d8d58){logger[_0xe725('0xf')](_0xe725('0x10'),_0x142b6e,'request\x20sent');logger[_0xe725('0x11')](_0xe725('0x12'),_0x142b6e,'request\x20sent',JSON[_0xe725('0x13')](_0x3d8d58));if(_0x3d8d58['error']){if(_0x3d8d58[_0xe725('0x14')][_0xe725('0x15')]===0x1f4){logger[_0xe725('0x14')](_0xe725('0x10'),_0x142b6e,_0x3d8d58[_0xe725('0x14')][_0xe725('0x16')]);return _0x42e86f(_0x3d8d58[_0xe725('0x14')][_0xe725('0x16')]);}logger['error'](_0xe725('0x10'),_0x142b6e,_0x3d8d58[_0xe725('0x14')][_0xe725('0x16')]);return _0x38872c(_0x3d8d58[_0xe725('0x14')][_0xe725('0x16')]);}else{logger[_0xe725('0xf')](_0xe725('0x10'),_0x142b6e,_0xe725('0x17'));_0x38872c(_0x3d8d58[_0xe725('0x18')][_0xe725('0x16')]);}})[_0xe725('0x19')](function(_0x1d8b6d){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x142b6e,_0x1d8b6d);_0x42e86f(_0x1d8b6d);});});} \ No newline at end of file +var _0xc570=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0xc570,0x13a));var _0x0c57=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xc570[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x0c57('0x0'));var util=require('util');var moment=require(_0x0c57('0x1'));var BPromise=require(_0x0c57('0x2'));var rs=require(_0x0c57('0x3'));var fs=require('fs');var Redis=require(_0x0c57('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c57('0x5'));var logger=require(_0x0c57('0x6'))(_0x0c57('0x7'));var config=require('../../config/environment');var jayson=require(_0x0c57('0x8'));var client=jayson[_0x0c57('0x9')][_0x0c57('0xa')]({'port':0x232a});config[_0x0c57('0xb')]=_[_0x0c57('0xc')](config[_0x0c57('0xb')],{'host':_0x0c57('0xd'),'port':0x18eb});var socket=require(_0x0c57('0xe'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x0c57('0xf')](socket);function respondWithRpcPromise(_0x3c17f5,_0x448a02,_0x147681){return new BPromise(function(_0x1941d7,_0x1779c9){return client[_0x0c57('0x10')](_0x3c17f5,_0x147681)[_0x0c57('0x11')](function(_0x3efd07){logger[_0x0c57('0x12')](_0x0c57('0x13'),_0x448a02,_0x0c57('0x14'));logger[_0x0c57('0x15')](_0x0c57('0x16'),_0x448a02,_0x0c57('0x14'),JSON[_0x0c57('0x17')](_0x3efd07));if(_0x3efd07[_0x0c57('0x18')]){if(_0x3efd07[_0x0c57('0x18')][_0x0c57('0x19')]===0x1f4){logger[_0x0c57('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x448a02,_0x3efd07[_0x0c57('0x18')][_0x0c57('0x1a')]);return _0x1779c9(_0x3efd07[_0x0c57('0x18')][_0x0c57('0x1a')]);}logger[_0x0c57('0x18')](_0x0c57('0x13'),_0x448a02,_0x3efd07[_0x0c57('0x18')][_0x0c57('0x1a')]);return _0x1941d7(_0x3efd07[_0x0c57('0x18')][_0x0c57('0x1a')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x448a02,_0x0c57('0x14'));_0x1941d7(_0x3efd07[_0x0c57('0x1b')][_0x0c57('0x1a')]);}})[_0x0c57('0x1c')](function(_0x3a21e1){logger[_0x0c57('0x18')](_0x0c57('0x13'),_0x448a02,_0x3a21e1);_0x1779c9(_0x3a21e1);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index d245630..b213eac 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.socket.js +++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97d5=['emit','register','length','./chatInternalMessage.events','save','remove','update'];(function(_0x5c192b,_0x4b8850){var _0x208b21=function(_0x17bcc9){while(--_0x17bcc9){_0x5c192b['push'](_0x5c192b['shift']());}};_0x208b21(++_0x4b8850);}(_0x97d5,0x199));var _0x597d=function(_0x991f55,_0x37e310){_0x991f55=_0x991f55-0x0;var _0x6fa155=_0x97d5[_0x991f55];return _0x6fa155;};'use strict';var ChatInternalMessageEvents=require(_0x597d('0x0'));var events=[_0x597d('0x1'),_0x597d('0x2'),_0x597d('0x3')];function createListener(_0x5907c6,_0x1b1ab5){return function(_0x484c73){_0x1b1ab5[_0x597d('0x4')](_0x5907c6,_0x484c73);};}function removeListener(_0x2d89ef,_0x10ecda){return function(){ChatInternalMessageEvents['removeListener'](_0x2d89ef,_0x10ecda);};}exports[_0x597d('0x5')]=function(_0x2bafef){for(var _0x2a6640=0x0,_0x316e5a=events[_0x597d('0x6')];_0x2a6640<_0x316e5a;_0x2a6640++){var _0xe0072a=events[_0x2a6640];var _0x228d4d=createListener('chatInternalMessage:'+_0xe0072a,_0x2bafef);ChatInternalMessageEvents['on'](_0xe0072a,_0x228d4d);}}; \ No newline at end of file +var _0xbd50=['length','./chatInternalMessage.events','save','remove','emit'];(function(_0x4a4785,_0x1f88d3){var _0x56cb80=function(_0x3d3521){while(--_0x3d3521){_0x4a4785['push'](_0x4a4785['shift']());}};_0x56cb80(++_0x1f88d3);}(_0xbd50,0x196));var _0x0bd5=function(_0x22d11a,_0x430f72){_0x22d11a=_0x22d11a-0x0;var _0x4a2f37=_0xbd50[_0x22d11a];return _0x4a2f37;};'use strict';var ChatInternalMessageEvents=require(_0x0bd5('0x0'));var events=[_0x0bd5('0x1'),_0x0bd5('0x2'),'update'];function createListener(_0x44fcb9,_0x167372){return function(_0x37acba){_0x167372[_0x0bd5('0x3')](_0x44fcb9,_0x37acba);};}function removeListener(_0x15620d,_0x4c17ee){return function(){ChatInternalMessageEvents['removeListener'](_0x15620d,_0x4c17ee);};}exports['register']=function(_0x376024){for(var _0x2ef1d0=0x0,_0xcc6cfa=events[_0x0bd5('0x4')];_0x2ef1d0<_0xcc6cfa;_0x2ef1d0++){var _0x1b99f3=events[_0x2ef1d0];var _0x5ebe64=createListener('chatInternalMessage:'+_0x1b99f3,_0x376024);ChatInternalMessageEvents['on'](_0x1b99f3,_0x5ebe64);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index e0c5442..5a87a9e 100644 --- a/server/api/chatInternalMessage/index.js +++ b/server/api/chatInternalMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','/:id','show','post','delete'];(function(_0x116246,_0x2dfa41){var _0x439ddd=function(_0x546da8){while(--_0x546da8){_0x116246['push'](_0x116246['shift']());}};_0x439ddd(++_0x2dfa41);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getUsers']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')]('/',auth[_0x0a9e('0x8')](),controller['create']);router['put']('/:id',controller['update']);router[_0x0a9e('0xe')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xf')]);module[_0x0a9e('0x10')]=router; \ No newline at end of file +var _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','put','update','delete'];(function(_0x28aaf9,_0x24fc7b){var _0x5a0249=function(_0x57a015){while(--_0x57a015){_0x28aaf9['push'](_0x28aaf9['shift']());}};_0x5a0249(++_0x24fc7b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['get'](_0x3071('0xe'),auth[_0x3071('0x8')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth[_0x3071('0x8')](),controller['create']);router[_0x3071('0x11')](_0x3071('0xe'),controller[_0x3071('0x12')]);router[_0x3071('0x13')](_0x3071('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 1a949a5..2d97965 100644 --- a/server/api/chatMessage/chatMessage.attributes.js +++ b/server/api/chatMessage/chatMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3732=['DATE','sequelize','TEXT','BOOLEAN','ENUM','out'];(function(_0x39534f,_0x2e63b7){var _0x2b5c16=function(_0xf7be94){while(--_0xf7be94){_0x39534f['push'](_0x39534f['shift']());}};_0x2b5c16(++_0x2e63b7);}(_0x3732,0xcd));var _0x2373=function(_0x380b52,_0x10915f){_0x380b52=_0x380b52-0x0;var _0x3287dd=_0x3732[_0x380b52];return _0x3287dd;};'use strict';var Sequelize=require(_0x2373('0x0'));module['exports']={'body':{'type':Sequelize[_0x2373('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2373('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2373('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2373('0x3')]('in','out'),'defaultValue':_0x2373('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2373('0x5')]}}; \ No newline at end of file +var _0x733e=['sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x577caa,_0x3194d4){var _0x2b4fae=function(_0x1ffa0a){while(--_0x1ffa0a){_0x577caa['push'](_0x577caa['shift']());}};_0x2b4fae(++_0x3194d4);}(_0x733e,0x163));var _0xe733=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0x733e[_0xdbd4f7];return _0x5c3f9d;};'use strict';var Sequelize=require(_0xe733('0x0'));module[_0xe733('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe733('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe733('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe733('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe733('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 3b10af6..d89a41e 100644 --- a/server/api/chatMessage/chatMessage.controller.js +++ b/server/api/chatMessage/chatMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd943=['util','to-csv','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','reject','update','destroy','name','send','index','ChatMessage','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','merge','where','map','key','field','filter','options','include','findAll','rows','show','params','fields','includeAll','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','UserId','user','Contact','ChatInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','manual','interface','SIP/%s','channel','event','acceptmessage','parse','agent','ChatInteractionId','RejectMessage','rejectMessage','EventManager','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0xd943,0x15d));var _0x3d94=function(_0x4b2ed8,_0x17b5af){_0x4b2ed8=_0x4b2ed8-0x0;var _0x41aa80=_0xd943[_0x4b2ed8];return _0x41aa80;};'use strict';var pdf=require(_0x3d94('0x0'));var emlformat=require(_0x3d94('0x1'));var rimraf=require(_0x3d94('0x2'));var zipdir=require(_0x3d94('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3d94('0x4'));var moment=require(_0x3d94('0x5'));var BPromise=require(_0x3d94('0x6'));var Mustache=require(_0x3d94('0x7'));var util=require(_0x3d94('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x3d94('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d94('0x10'))(_0x3d94('0x11'));var utils=require('../../config/utils');var config=require(_0x3d94('0x12'));var db=require(_0x3d94('0x13'))['db'];config[_0x3d94('0x14')]=_[_0x3d94('0x15')](config[_0x3d94('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d94('0x16'))(new Redis(config[_0x3d94('0x14')]));require(_0x3d94('0x17'))['register'](socket);var jayson=require(_0x3d94('0x18'));var client=jayson[_0x3d94('0x19')][_0x3d94('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0x3d94('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x340818,_0x292419,_0x34098e){if(_0x34098e){var _0xaf939a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xaf939a[_0x3d94('0x1b')](_0x292419)){return _0x340818;}else{throw new Error(_0x3d94('0x1c'));}}else{return _0x340818;}}function respondWithRpcPromise(_0x9893cb,_0x540658,_0x22676a,_0x1a9315){return new BPromise(function(_0x2acee3,_0x1c35a8){var _0x4afc92=_0x1a9315||client;return _0x4afc92[_0x3d94('0x1d')](_0x9893cb,_0x22676a)[_0x3d94('0x1e')](function(_0x54f6fd){logger[_0x3d94('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x540658,_0x3d94('0x20'));logger[_0x3d94('0x21')](_0x3d94('0x22'),_0x540658,_0x3d94('0x20'),JSON[_0x3d94('0x23')](_0x54f6fd));if(_0x54f6fd['error']){if(_0x54f6fd['error'][_0x3d94('0x24')]===0x1f4){logger[_0x3d94('0x25')](_0x3d94('0x26'),_0x540658,_0x54f6fd['error'][_0x3d94('0x27')]);return _0x1c35a8(_0x54f6fd[_0x3d94('0x25')][_0x3d94('0x27')]);}logger[_0x3d94('0x25')](_0x3d94('0x26'),_0x540658,_0x54f6fd[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x2acee3(_0x54f6fd[_0x3d94('0x25')][_0x3d94('0x27')]);}else{logger[_0x3d94('0x1f')](_0x3d94('0x26'),_0x540658,_0x3d94('0x20'));_0x2acee3(_0x54f6fd[_0x3d94('0x28')][_0x3d94('0x27')]);}})[_0x3d94('0x29')](function(_0x5b3b31){logger[_0x3d94('0x25')]('ChatMessage,\x20%s,\x20%s',_0x540658,_0x5b3b31);_0x1c35a8(_0x5b3b31);});});}function respondWithStatusCode(_0x28a698,_0x1d0a7a){_0x1d0a7a=_0x1d0a7a||0xcc;return function(_0xc2885){if(_0xc2885){return _0x28a698[_0x3d94('0x2a')](_0x1d0a7a);}return _0x28a698[_0x3d94('0x2b')](_0x1d0a7a)[_0x3d94('0x2c')]();};}function respondWithResult(_0x401857,_0x47d6ab){_0x47d6ab=_0x47d6ab||0xc8;return function(_0x584c4a){if(_0x584c4a){return _0x401857[_0x3d94('0x2b')](_0x47d6ab)['json'](_0x584c4a);}};}function respondWithFilteredResult(_0x4dd410,_0x23d20d){return function(_0x58c0d0){if(_0x58c0d0){var _0x19bfd4=_0x58c0d0[_0x3d94('0x2d')],_0xef9644=_0x23d20d['offset'],_0x32403a=_0x23d20d[_0x3d94('0x2e')]+_0x23d20d['limit'],_0x4cef9c;if(_0x32403a>=_0x19bfd4){_0x32403a=_0x19bfd4;_0x4cef9c=0xc8;}else{_0x4cef9c=0xce;}_0x4dd410[_0x3d94('0x2b')](_0x4cef9c);return _0x4dd410[_0x3d94('0x2f')](_0x3d94('0x30'),_0xef9644+'-'+_0x32403a+'/'+_0x19bfd4)[_0x3d94('0x31')](_0x58c0d0);}return null;};}function patchUpdates(_0x50560c){return function(_0x18f854){try{jsonpatch['apply'](_0x18f854,_0x50560c,!![]);}catch(_0x1f9559){return BPromise[_0x3d94('0x32')](_0x1f9559);}return _0x18f854['save']();};}function saveUpdates(_0x5288da,_0x24bffe){return function(_0x280c73){if(_0x280c73){return _0x280c73[_0x3d94('0x33')](_0x5288da)['then'](function(_0x1e6dbc){return _0x1e6dbc;});}return null;};}function removeEntity(_0x3d29fd,_0x5426bd){return function(_0x242500){if(_0x242500){return _0x242500[_0x3d94('0x34')]()[_0x3d94('0x1e')](function(){_0x3d29fd[_0x3d94('0x2b')](0xcc)[_0x3d94('0x2c')]();});}};}function handleEntityNotFound(_0x4d55ff,_0xa43fc){return function(_0x42b742){if(!_0x42b742){_0x4d55ff[_0x3d94('0x2a')](0x194);}return _0x42b742;};}function handleError(_0x52bdb9,_0xb493f1){_0xb493f1=_0xb493f1||0x1f4;return function(_0x441523){logger['error'](_0x441523['stack']);if(_0x441523[_0x3d94('0x35')]){delete _0x441523[_0x3d94('0x35')];}_0x52bdb9[_0x3d94('0x2b')](_0xb493f1)[_0x3d94('0x36')](_0x441523);};}exports[_0x3d94('0x37')]=function(_0x40a3d8,_0x2ef743){var _0x12c01a={},_0x2e7b97={},_0x2235f9={'count':0x0,'rows':[]};var _0x4e2244=db[_0x3d94('0x38')][_0x3d94('0x39')];_0x2e7b97[_0x3d94('0x3a')]=_[_0x3d94('0x3b')](_0x4e2244);_0x2e7b97['query']=_[_0x3d94('0x3b')](_0x40a3d8[_0x3d94('0x3c')]);_0x2e7b97[_0x3d94('0x3d')]=_[_0x3d94('0x3e')](_0x2e7b97[_0x3d94('0x3a')],_0x2e7b97['query']);_0x12c01a[_0x3d94('0x3f')]=_[_0x3d94('0x3e')](_0x2e7b97[_0x3d94('0x3a')],qs['fields'](_0x40a3d8['query']['fields']));_0x12c01a['attributes']=_0x12c01a[_0x3d94('0x3f')][_0x3d94('0x40')]?_0x12c01a[_0x3d94('0x3f')]:_0x2e7b97[_0x3d94('0x3a')];if(!_0x40a3d8[_0x3d94('0x3c')][_0x3d94('0x41')](_0x3d94('0x42'))){_0x12c01a['limit']=qs['limit'](_0x40a3d8[_0x3d94('0x3c')][_0x3d94('0x43')]);_0x12c01a['offset']=qs[_0x3d94('0x2e')](_0x40a3d8['query'][_0x3d94('0x2e')]);}_0x12c01a[_0x3d94('0x44')]=qs[_0x3d94('0x45')](_0x40a3d8[_0x3d94('0x3c')][_0x3d94('0x45')]);_0x12c01a['where']=qs[_0x3d94('0x3d')](_[_0x3d94('0x46')](_0x40a3d8[_0x3d94('0x3c')],_0x2e7b97['filters']));if(_0x40a3d8[_0x3d94('0x3c')]['filter']){_0x12c01a['where']=_[_0x3d94('0x47')](_0x12c01a[_0x3d94('0x48')],{'$or':_[_0x3d94('0x49')](_0x4e2244,function(_0xfeae3a){if(_0xfeae3a['type'][_0x3d94('0x4a')]!=='VIRTUAL'){var _0x26426e={};_0x26426e[_0xfeae3a[_0x3d94('0x4b')]]={'$like':'%'+_0x40a3d8[_0x3d94('0x3c')][_0x3d94('0x4c')]+'%'};return _0x26426e;}})});}_0x12c01a=_[_0x3d94('0x47')]({},_0x12c01a,_0x40a3d8[_0x3d94('0x4d')]);var _0x200fe3={'where':_0x12c01a['where']};return db[_0x3d94('0x38')][_0x3d94('0x2d')](_0x200fe3)['then'](function(_0x53e611){_0x2235f9[_0x3d94('0x2d')]=_0x53e611;if(_0x40a3d8[_0x3d94('0x3c')]['includeAll']){_0x12c01a[_0x3d94('0x4e')]=[{'all':!![]}];}return db[_0x3d94('0x38')][_0x3d94('0x4f')](_0x12c01a);})[_0x3d94('0x1e')](function(_0x30ce31){_0x2235f9[_0x3d94('0x50')]=_0x30ce31;return _0x2235f9;})[_0x3d94('0x1e')](respondWithFilteredResult(_0x2ef743,_0x12c01a))[_0x3d94('0x29')](handleError(_0x2ef743,null));};exports[_0x3d94('0x51')]=function(_0x2429bc,_0x4075ef){var _0x29682b={'raw':!![],'where':{'id':_0x2429bc[_0x3d94('0x52')]['id']}},_0x2dad4f={};_0x2dad4f[_0x3d94('0x3a')]=_['keys'](db[_0x3d94('0x38')][_0x3d94('0x39')]);_0x2dad4f[_0x3d94('0x3c')]=_[_0x3d94('0x3b')](_0x2429bc[_0x3d94('0x3c')]);_0x2dad4f[_0x3d94('0x3d')]=_[_0x3d94('0x3e')](_0x2dad4f[_0x3d94('0x3a')],_0x2dad4f[_0x3d94('0x3c')]);_0x29682b['attributes']=_[_0x3d94('0x3e')](_0x2dad4f['model'],qs[_0x3d94('0x53')](_0x2429bc[_0x3d94('0x3c')]['fields']));_0x29682b[_0x3d94('0x3f')]=_0x29682b['attributes']['length']?_0x29682b[_0x3d94('0x3f')]:_0x2dad4f['model'];if(_0x2429bc[_0x3d94('0x3c')][_0x3d94('0x54')]){_0x29682b['include']=[{'all':!![]}];}_0x29682b=_[_0x3d94('0x47')]({},_0x29682b,_0x2429bc['options']);return db['ChatMessage'][_0x3d94('0x55')](_0x29682b)[_0x3d94('0x1e')](handleEntityNotFound(_0x4075ef,null))[_0x3d94('0x1e')](respondWithResult(_0x4075ef,null))[_0x3d94('0x29')](handleError(_0x4075ef,null));};exports[_0x3d94('0x56')]=function(_0x3e49f5,_0x137052){return db[_0x3d94('0x38')][_0x3d94('0x56')](_0x3e49f5['body'],{})[_0x3d94('0x1e')](respondWithResult(_0x137052,0xc9))[_0x3d94('0x29')](handleError(_0x137052,null));};exports[_0x3d94('0x33')]=function(_0x2625e0,_0xe7d1dc){if(_0x2625e0[_0x3d94('0x57')]['id']){delete _0x2625e0[_0x3d94('0x57')]['id'];}return db[_0x3d94('0x38')][_0x3d94('0x55')]({'where':{'id':_0x2625e0[_0x3d94('0x52')]['id']}})[_0x3d94('0x1e')](handleEntityNotFound(_0xe7d1dc,null))['then'](saveUpdates(_0x2625e0[_0x3d94('0x57')],null))['then'](respondWithResult(_0xe7d1dc,null))[_0x3d94('0x29')](handleError(_0xe7d1dc,null));};exports[_0x3d94('0x34')]=function(_0x10bd54,_0x17591b){return db[_0x3d94('0x38')][_0x3d94('0x55')]({'where':{'id':_0x10bd54[_0x3d94('0x52')]['id']}})[_0x3d94('0x1e')](handleEntityNotFound(_0x17591b,null))[_0x3d94('0x1e')](removeEntity(_0x17591b,null))['catch'](handleError(_0x17591b,null));};exports['describe']=function(_0x46bff3,_0x4bd97c){return db[_0x3d94('0x38')][_0x3d94('0x58')]()['then'](respondWithResult(_0x4bd97c,null))[_0x3d94('0x29')](handleError(_0x4bd97c,null));};var interaction_log=require(_0x3d94('0x10'))(_0x3d94('0x59'));exports[_0x3d94('0x5a')]=function(_0xcefff5,_0x42eb81,_0xd3bb){var _0x4b023e={'channel':_0x3d94('0x5b')};if(_0xcefff5[_0x3d94('0x57')]['id']){delete _0xcefff5[_0x3d94('0x57')]['id'];}_0xcefff5['body'][_0x3d94('0x5c')]=!![];_0xcefff5[_0x3d94('0x57')][_0x3d94('0x5d')]=moment()[_0x3d94('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0xcefff5['body'][_0x3d94('0x5f')]=_0xcefff5[_0x3d94('0x57')][_0x3d94('0x5f')]||_0xcefff5[_0x3d94('0x60')]['id'];return db['ChatMessage'][_0x3d94('0x55')]({'where':{'id':_0xcefff5[_0x3d94('0x52')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x3d94('0x61')}]})[_0x3d94('0x1e')](handleEntityNotFound(_0x42eb81,null))[_0x3d94('0x1e')](saveUpdates(_0xcefff5['body'],null))[_0x3d94('0x1e')](function(_0x227372){if(_0x227372){_0x4b023e[_0x3d94('0x27')]=_0x227372['get']({'plain':!![]});return db[_0x3d94('0x62')][_0x3d94('0x55')]({'where':{'id':_0x227372['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x42eb81,null))['then'](function(_0x3ac9ea){if(_0x3ac9ea){return _0x3ac9ea[_0x3d94('0x33')]({'UserId':_0xcefff5[_0x3d94('0x57')][_0x3d94('0x5f')],'read1stAt':_[_0x3d94('0x63')](_0x3ac9ea['read1stAt'])?moment()[_0x3d94('0x5e')](_0x3d94('0x64')):undefined});}return null;})[_0x3d94('0x1e')](function(_0x1e8e3d){if(_0x1e8e3d){_0x4b023e[_0x3d94('0x65')]=_0x1e8e3d[_0x3d94('0x66')]({'plain':!![]});interaction_log['info'](_0x3d94('0x67'),_0xcefff5['user']['id'],_0xcefff5[_0x3d94('0x60')][_0x3d94('0x35')],_0xcefff5[_0x3d94('0x60')][_0x3d94('0x68')],_0x4b023e[_0x3d94('0x65')]['id'],_0xcefff5[_0x3d94('0x57')]?JSON['stringify'](_0xcefff5['body']):_0x3d94('0x69'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x4b023e);}return null;})['then'](function(_0x3c7dc4){if(_0x3c7dc4){if(_0xcefff5[_0x3d94('0x57')][_0x3d94('0x6a')]){_0x4b023e[_0x3d94('0x27')][_0x3d94('0x6b')]=util[_0x3d94('0x5e')](_0x3d94('0x6c'),_0xcefff5[_0x3d94('0x60')]['name']);_0x4b023e[_0x3d94('0x27')]['channel']=_0x4b023e[_0x3d94('0x6d')];_0x4b023e[_0x3d94('0x27')][_0x3d94('0x6e')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x3d94('0x6f'),'message':_[_0x3d94('0x47')](_0x4b023e[_0x3d94('0x27')],JSON[_0x3d94('0x70')](_0x4b023e[_0x3d94('0x65')]['formData']))},client9002)['then'](function(){return _0x4b023e;});}return _0x4b023e;}return null;})[_0x3d94('0x1e')](respondWithResult(_0x42eb81,null))[_0x3d94('0x29')](handleError(_0x42eb81,null));};var interaction_log=require(_0x3d94('0x10'))('chat-interactions');exports[_0x3d94('0x32')]=function(_0x53d471,_0x255d56,_0x5789df){var _0x15adf7={'agent':{},'channel':_0x3d94('0x5b')};if(_0x53d471[_0x3d94('0x57')]['id']){delete _0x53d471[_0x3d94('0x57')]['id'];}_0x53d471[_0x3d94('0x57')][_0x3d94('0x5f')]=_0x53d471[_0x3d94('0x57')][_0x3d94('0x5f')]||_0x53d471[_0x3d94('0x60')]['id'];_0x15adf7[_0x3d94('0x71')]['id']=_0x53d471[_0x3d94('0x57')]['UserId'];return db[_0x3d94('0x38')][_0x3d94('0x55')]({'where':{'id':_0x53d471[_0x3d94('0x52')]['id'],'UserId':null}})[_0x3d94('0x1e')](handleEntityNotFound(_0x255d56,null))['then'](function(_0x9b282a){if(_0x9b282a){_0x15adf7['message']=_0x9b282a['get']({'plain':!![]});return db[_0x3d94('0x62')]['find']({'where':{'id':_0x9b282a[_0x3d94('0x72')]}});}return null;})[_0x3d94('0x1e')](handleEntityNotFound(_0x255d56,null))['then'](function(_0x4558ff){if(_0x4558ff){_0x15adf7['interaction']=_0x4558ff[_0x3d94('0x66')]({'plain':!![]});interaction_log[_0x3d94('0x1f')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x53d471['user']['id'],_0x53d471['user'][_0x3d94('0x35')],_0x53d471['user']['role'],_0x15adf7[_0x3d94('0x65')]['id'],_0x53d471[_0x3d94('0x57')]?JSON[_0x3d94('0x23')](_0x53d471[_0x3d94('0x57')]):'null');return respondWithRpcPromise(_0x3d94('0x73'),_0x3d94('0x74'),_0x15adf7);}return null;})[_0x3d94('0x1e')](function(_0x3d6648){if(_0x3d6648){_0x3d6648[_0x3d94('0x27')][_0x3d94('0x6b')]=util['format'](_0x3d94('0x6c'),_0x53d471[_0x3d94('0x60')][_0x3d94('0x35')]);_0x3d6648[_0x3d94('0x27')][_0x3d94('0x6d')]=_0x15adf7[_0x3d94('0x6d')];_0x3d6648[_0x3d94('0x27')][_0x3d94('0x6e')]='reject';respondWithRpcPromise('EventManager',_0x3d94('0x75'),{'event':_0x3d94('0x76'),'message':_0x3d6648[_0x3d94('0x27')]},client9002);return _0x15adf7;}return null;})['then'](respondWithResult(_0x255d56,null))[_0x3d94('0x29')](handleError(_0x255d56,null));}; \ No newline at end of file +var _0x93e9=['ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','destroy','stack','name','send','index','ChatMessage','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','merge','map','type','field','filter','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','chat-interactions','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteraction','ChatInteractionId','update','isNil','format','interaction','role','null','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xf3807a,_0x29e20e){var _0x562bf6=function(_0x17313d){while(--_0x17313d){_0xf3807a['push'](_0xf3807a['shift']());}};_0x562bf6(++_0x29e20e);}(_0x93e9,0xcc));var _0x993e=function(_0x34da86,_0x16cd32){_0x34da86=_0x34da86-0x0;var _0x396bc1=_0x93e9[_0x34da86];return _0x396bc1;};'use strict';var pdf=require(_0x993e('0x0'));var emlformat=require(_0x993e('0x1'));var rimraf=require(_0x993e('0x2'));var zipdir=require(_0x993e('0x3'));var jsonpatch=require(_0x993e('0x4'));var rp=require(_0x993e('0x5'));var moment=require(_0x993e('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x993e('0x7'));var path=require(_0x993e('0x8'));var sox=require(_0x993e('0x9'));var csv=require(_0x993e('0xa'));var ejs=require(_0x993e('0xb'));var fs=require('fs');var _=require(_0x993e('0xc'));var squel=require(_0x993e('0xd'));var crypto=require(_0x993e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x993e('0xf'));var toCsv=require(_0x993e('0xa'));var querystring=require(_0x993e('0x10'));var Papa=require(_0x993e('0x11'));var Redis=require(_0x993e('0x12'));var authService=require(_0x993e('0x13'));var qs=require(_0x993e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x993e('0x15'))(_0x993e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x993e('0x17'))['db'];config['redis']=_[_0x993e('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x993e('0x19'))(new Redis(config[_0x993e('0x1a')]));require(_0x993e('0x1b'))[_0x993e('0x1c')](socket);var jayson=require(_0x993e('0x1d'));var client=jayson[_0x993e('0x1e')][_0x993e('0x1f')]({'port':0x232c});var client9002=jayson[_0x993e('0x1e')][_0x993e('0x1f')]({'port':0x232a});function checkPasswordPattern(_0xa43a4e,_0x1a7726,_0x135771){if(_0x135771){var _0x3df0e7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3df0e7[_0x993e('0x20')](_0x1a7726)){return _0xa43a4e;}else{throw new Error(_0x993e('0x21'));}}else{return _0xa43a4e;}}function respondWithRpcPromise(_0x454475,_0x111707,_0x526e06,_0x22f7cc){return new BPromise(function(_0x1acd21,_0x3cc2b9){var _0x3d6109=_0x22f7cc||client;return _0x3d6109[_0x993e('0x22')](_0x454475,_0x526e06)[_0x993e('0x23')](function(_0x5f3205){logger[_0x993e('0x24')](_0x993e('0x25'),_0x111707,_0x993e('0x26'));logger[_0x993e('0x27')](_0x993e('0x28'),_0x111707,_0x993e('0x26'),JSON[_0x993e('0x29')](_0x5f3205));if(_0x5f3205[_0x993e('0x2a')]){if(_0x5f3205['error'][_0x993e('0x2b')]===0x1f4){logger['error'](_0x993e('0x25'),_0x111707,_0x5f3205[_0x993e('0x2a')][_0x993e('0x2c')]);return _0x3cc2b9(_0x5f3205['error'][_0x993e('0x2c')]);}logger[_0x993e('0x2a')](_0x993e('0x25'),_0x111707,_0x5f3205[_0x993e('0x2a')][_0x993e('0x2c')]);return _0x1acd21(_0x5f3205[_0x993e('0x2a')][_0x993e('0x2c')]);}else{logger[_0x993e('0x24')](_0x993e('0x25'),_0x111707,_0x993e('0x26'));_0x1acd21(_0x5f3205[_0x993e('0x2d')][_0x993e('0x2c')]);}})['catch'](function(_0x2756a7){logger[_0x993e('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x111707,_0x2756a7);_0x3cc2b9(_0x2756a7);});});}function respondWithStatusCode(_0x27bbf7,_0x4f5cc1){_0x4f5cc1=_0x4f5cc1||0xcc;return function(_0x14a0c7){if(_0x14a0c7){return _0x27bbf7[_0x993e('0x2e')](_0x4f5cc1);}return _0x27bbf7[_0x993e('0x2f')](_0x4f5cc1)[_0x993e('0x30')]();};}function respondWithResult(_0x5c7507,_0x48d457){_0x48d457=_0x48d457||0xc8;return function(_0x32e332){if(_0x32e332){return _0x5c7507[_0x993e('0x2f')](_0x48d457)['json'](_0x32e332);}};}function respondWithFilteredResult(_0x223af0,_0x46670a){return function(_0x248354){if(_0x248354){var _0x4c5ee3=_0x248354[_0x993e('0x31')],_0x2495b7=_0x46670a[_0x993e('0x32')],_0x9e0309=_0x46670a['offset']+_0x46670a[_0x993e('0x33')],_0x1f5d51;if(_0x9e0309>=_0x4c5ee3){_0x9e0309=_0x4c5ee3;_0x1f5d51=0xc8;}else{_0x1f5d51=0xce;}_0x223af0['status'](_0x1f5d51);return _0x223af0[_0x993e('0x34')]('Content-Range',_0x2495b7+'-'+_0x9e0309+'/'+_0x4c5ee3)[_0x993e('0x35')](_0x248354);}return null;};}function patchUpdates(_0x567ed4){return function(_0x3b9c3c){try{jsonpatch[_0x993e('0x36')](_0x3b9c3c,_0x567ed4,!![]);}catch(_0x94a2fc){return BPromise[_0x993e('0x37')](_0x94a2fc);}return _0x3b9c3c[_0x993e('0x38')]();};}function saveUpdates(_0x360e2d,_0x5562f1){return function(_0x1920c6){if(_0x1920c6){return _0x1920c6['update'](_0x360e2d)['then'](function(_0x997dea){return _0x997dea;});}return null;};}function removeEntity(_0x497d29,_0x4230c0){return function(_0x4546a1){if(_0x4546a1){return _0x4546a1[_0x993e('0x39')]()[_0x993e('0x23')](function(){_0x497d29[_0x993e('0x2f')](0xcc)[_0x993e('0x30')]();});}};}function handleEntityNotFound(_0x22a6bd,_0x14424a){return function(_0x16c944){if(!_0x16c944){_0x22a6bd[_0x993e('0x2e')](0x194);}return _0x16c944;};}function handleError(_0x248edf,_0x110504){_0x110504=_0x110504||0x1f4;return function(_0x1d5806){logger[_0x993e('0x2a')](_0x1d5806[_0x993e('0x3a')]);if(_0x1d5806['name']){delete _0x1d5806[_0x993e('0x3b')];}_0x248edf[_0x993e('0x2f')](_0x110504)[_0x993e('0x3c')](_0x1d5806);};}exports[_0x993e('0x3d')]=function(_0x2b4d1,_0x6f8808){var _0x1913c0={},_0x416afd={},_0x1b4b8f={'count':0x0,'rows':[]};var _0x533e5a=db[_0x993e('0x3e')]['rawAttributes'];_0x416afd[_0x993e('0x3f')]=_[_0x993e('0x40')](_0x533e5a);_0x416afd[_0x993e('0x41')]=_[_0x993e('0x40')](_0x2b4d1[_0x993e('0x41')]);_0x416afd[_0x993e('0x42')]=_[_0x993e('0x43')](_0x416afd[_0x993e('0x3f')],_0x416afd['query']);_0x1913c0[_0x993e('0x44')]=_['intersection'](_0x416afd[_0x993e('0x3f')],qs['fields'](_0x2b4d1[_0x993e('0x41')][_0x993e('0x45')]));_0x1913c0[_0x993e('0x44')]=_0x1913c0[_0x993e('0x44')][_0x993e('0x46')]?_0x1913c0[_0x993e('0x44')]:_0x416afd[_0x993e('0x3f')];if(!_0x2b4d1[_0x993e('0x41')]['hasOwnProperty'](_0x993e('0x47'))){_0x1913c0['limit']=qs['limit'](_0x2b4d1[_0x993e('0x41')][_0x993e('0x33')]);_0x1913c0[_0x993e('0x32')]=qs['offset'](_0x2b4d1[_0x993e('0x41')][_0x993e('0x32')]);}_0x1913c0[_0x993e('0x48')]=qs['sort'](_0x2b4d1['query']['sort']);_0x1913c0[_0x993e('0x49')]=qs[_0x993e('0x42')](_[_0x993e('0x4a')](_0x2b4d1['query'],_0x416afd[_0x993e('0x42')]));if(_0x2b4d1[_0x993e('0x41')]['filter']){_0x1913c0[_0x993e('0x49')]=_[_0x993e('0x4b')](_0x1913c0['where'],{'$or':_[_0x993e('0x4c')](_0x533e5a,function(_0x576ea){if(_0x576ea[_0x993e('0x4d')]['key']!=='VIRTUAL'){var _0x5e2453={};_0x5e2453[_0x576ea[_0x993e('0x4e')]]={'$like':'%'+_0x2b4d1[_0x993e('0x41')][_0x993e('0x4f')]+'%'};return _0x5e2453;}})});}_0x1913c0=_[_0x993e('0x4b')]({},_0x1913c0,_0x2b4d1['options']);var _0xc15a35={'where':_0x1913c0[_0x993e('0x49')]};return db[_0x993e('0x3e')][_0x993e('0x31')](_0xc15a35)[_0x993e('0x23')](function(_0xb8860b){_0x1b4b8f['count']=_0xb8860b;if(_0x2b4d1['query'][_0x993e('0x50')]){_0x1913c0[_0x993e('0x51')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x1913c0);})[_0x993e('0x23')](function(_0x1480dd){_0x1b4b8f[_0x993e('0x52')]=_0x1480dd;return _0x1b4b8f;})[_0x993e('0x23')](respondWithFilteredResult(_0x6f8808,_0x1913c0))[_0x993e('0x53')](handleError(_0x6f8808,null));};exports[_0x993e('0x54')]=function(_0x5b18e3,_0x206a74){var _0x51ca44={'raw':!![],'where':{'id':_0x5b18e3[_0x993e('0x55')]['id']}},_0xb8629f={};_0xb8629f[_0x993e('0x3f')]=_[_0x993e('0x40')](db[_0x993e('0x3e')][_0x993e('0x56')]);_0xb8629f[_0x993e('0x41')]=_[_0x993e('0x40')](_0x5b18e3['query']);_0xb8629f[_0x993e('0x42')]=_[_0x993e('0x43')](_0xb8629f[_0x993e('0x3f')],_0xb8629f['query']);_0x51ca44[_0x993e('0x44')]=_['intersection'](_0xb8629f[_0x993e('0x3f')],qs[_0x993e('0x45')](_0x5b18e3['query'][_0x993e('0x45')]));_0x51ca44[_0x993e('0x44')]=_0x51ca44['attributes'][_0x993e('0x46')]?_0x51ca44[_0x993e('0x44')]:_0xb8629f[_0x993e('0x3f')];if(_0x5b18e3[_0x993e('0x41')][_0x993e('0x50')]){_0x51ca44['include']=[{'all':!![]}];}_0x51ca44=_['merge']({},_0x51ca44,_0x5b18e3['options']);return db[_0x993e('0x3e')][_0x993e('0x57')](_0x51ca44)[_0x993e('0x23')](handleEntityNotFound(_0x206a74,null))[_0x993e('0x23')](respondWithResult(_0x206a74,null))[_0x993e('0x53')](handleError(_0x206a74,null));};exports[_0x993e('0x58')]=function(_0x5c0610,_0x3a897d){return db[_0x993e('0x3e')][_0x993e('0x58')](_0x5c0610['body'],{})[_0x993e('0x23')](respondWithResult(_0x3a897d,0xc9))['catch'](handleError(_0x3a897d,null));};exports['update']=function(_0x377cef,_0x37d7b1){if(_0x377cef['body']['id']){delete _0x377cef[_0x993e('0x59')]['id'];}return db['ChatMessage'][_0x993e('0x57')]({'where':{'id':_0x377cef[_0x993e('0x55')]['id']}})['then'](handleEntityNotFound(_0x37d7b1,null))['then'](saveUpdates(_0x377cef[_0x993e('0x59')],null))[_0x993e('0x23')](respondWithResult(_0x37d7b1,null))[_0x993e('0x53')](handleError(_0x37d7b1,null));};exports[_0x993e('0x39')]=function(_0xd04096,_0x3bbd9a){return db['ChatMessage'][_0x993e('0x57')]({'where':{'id':_0xd04096[_0x993e('0x55')]['id']}})['then'](handleEntityNotFound(_0x3bbd9a,null))[_0x993e('0x23')](removeEntity(_0x3bbd9a,null))[_0x993e('0x53')](handleError(_0x3bbd9a,null));};exports[_0x993e('0x5a')]=function(_0x5ebaec,_0x426341){return db[_0x993e('0x3e')][_0x993e('0x5a')]()['then'](respondWithResult(_0x426341,null))[_0x993e('0x53')](handleError(_0x426341,null));};var interaction_log=require(_0x993e('0x15'))(_0x993e('0x5b'));exports['accept']=function(_0x55444c,_0x53c68a,_0x2534ca){var _0x98d16c={'channel':_0x993e('0x5c')};if(_0x55444c[_0x993e('0x59')]['id']){delete _0x55444c[_0x993e('0x59')]['id'];}_0x55444c['body'][_0x993e('0x5d')]=!![];_0x55444c[_0x993e('0x59')][_0x993e('0x5e')]=moment()['format'](_0x993e('0x5f'));_0x55444c[_0x993e('0x59')][_0x993e('0x60')]=_0x55444c[_0x993e('0x59')]['UserId']||_0x55444c[_0x993e('0x61')]['id'];return db[_0x993e('0x3e')]['find']({'where':{'id':_0x55444c['params']['id'],'UserId':null},'include':[{'model':db[_0x993e('0x62')],'as':_0x993e('0x63')}]})[_0x993e('0x23')](handleEntityNotFound(_0x53c68a,null))[_0x993e('0x23')](saveUpdates(_0x55444c[_0x993e('0x59')],null))[_0x993e('0x23')](function(_0x211204){if(_0x211204){_0x98d16c[_0x993e('0x2c')]=_0x211204[_0x993e('0x64')]({'plain':!![]});return db[_0x993e('0x65')][_0x993e('0x57')]({'where':{'id':_0x211204[_0x993e('0x66')]}});}return null;})[_0x993e('0x23')](handleEntityNotFound(_0x53c68a,null))[_0x993e('0x23')](function(_0x33e05f){if(_0x33e05f){return _0x33e05f[_0x993e('0x67')]({'UserId':_0x55444c['body'][_0x993e('0x60')],'read1stAt':_[_0x993e('0x68')](_0x33e05f['read1stAt'])?moment()[_0x993e('0x69')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x993e('0x23')](function(_0x239dbc){if(_0x239dbc){_0x98d16c[_0x993e('0x6a')]=_0x239dbc['get']({'plain':!![]});interaction_log[_0x993e('0x24')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x55444c['user']['id'],_0x55444c[_0x993e('0x61')][_0x993e('0x3b')],_0x55444c[_0x993e('0x61')][_0x993e('0x6b')],_0x98d16c[_0x993e('0x6a')]['id'],_0x55444c['body']?JSON[_0x993e('0x29')](_0x55444c[_0x993e('0x59')]):_0x993e('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x993e('0x6d'),_0x98d16c);}return null;})['then'](function(_0x1ab10e){if(_0x1ab10e){if(_0x55444c[_0x993e('0x59')][_0x993e('0x6e')]){_0x98d16c['message'][_0x993e('0x6f')]=util[_0x993e('0x69')](_0x993e('0x70'),_0x55444c[_0x993e('0x61')][_0x993e('0x3b')]);_0x98d16c[_0x993e('0x2c')][_0x993e('0x71')]=_0x98d16c[_0x993e('0x71')];_0x98d16c[_0x993e('0x2c')][_0x993e('0x72')]='accept';return respondWithRpcPromise(_0x993e('0x73'),_0x993e('0x73'),{'event':_0x993e('0x74'),'message':_[_0x993e('0x4b')](_0x98d16c[_0x993e('0x2c')],JSON[_0x993e('0x75')](_0x98d16c[_0x993e('0x6a')][_0x993e('0x76')]))},client9002)['then'](function(){return _0x98d16c;});}return _0x98d16c;}return null;})['then'](respondWithResult(_0x53c68a,null))[_0x993e('0x53')](handleError(_0x53c68a,null));};var interaction_log=require('../../config/logger')(_0x993e('0x5b'));exports[_0x993e('0x37')]=function(_0x2ce913,_0x49788e,_0x2bf739){var _0x580c2c={'agent':{},'channel':_0x993e('0x5c')};if(_0x2ce913[_0x993e('0x59')]['id']){delete _0x2ce913[_0x993e('0x59')]['id'];}_0x2ce913[_0x993e('0x59')][_0x993e('0x60')]=_0x2ce913[_0x993e('0x59')][_0x993e('0x60')]||_0x2ce913[_0x993e('0x61')]['id'];_0x580c2c['agent']['id']=_0x2ce913['body'][_0x993e('0x60')];return db['ChatMessage'][_0x993e('0x57')]({'where':{'id':_0x2ce913[_0x993e('0x55')]['id'],'UserId':null}})[_0x993e('0x23')](handleEntityNotFound(_0x49788e,null))[_0x993e('0x23')](function(_0xb4e02c){if(_0xb4e02c){_0x580c2c[_0x993e('0x2c')]=_0xb4e02c[_0x993e('0x64')]({'plain':!![]});return db[_0x993e('0x65')][_0x993e('0x57')]({'where':{'id':_0xb4e02c[_0x993e('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x49788e,null))[_0x993e('0x23')](function(_0x14347f){if(_0x14347f){_0x580c2c['interaction']=_0x14347f[_0x993e('0x64')]({'plain':!![]});interaction_log[_0x993e('0x24')](_0x993e('0x77'),_0x2ce913[_0x993e('0x61')]['id'],_0x2ce913[_0x993e('0x61')][_0x993e('0x3b')],_0x2ce913[_0x993e('0x61')][_0x993e('0x6b')],_0x580c2c[_0x993e('0x6a')]['id'],_0x2ce913['body']?JSON[_0x993e('0x29')](_0x2ce913[_0x993e('0x59')]):_0x993e('0x6c'));return respondWithRpcPromise(_0x993e('0x78'),'rejectMessage',_0x580c2c);}return null;})['then'](function(_0x35ad1b){if(_0x35ad1b){_0x35ad1b['message'][_0x993e('0x6f')]=util[_0x993e('0x69')](_0x993e('0x70'),_0x2ce913[_0x993e('0x61')][_0x993e('0x3b')]);_0x35ad1b[_0x993e('0x2c')][_0x993e('0x71')]=_0x580c2c[_0x993e('0x71')];_0x35ad1b[_0x993e('0x2c')][_0x993e('0x72')]='reject';respondWithRpcPromise(_0x993e('0x73'),_0x993e('0x73'),{'event':_0x993e('0x79'),'message':_0x35ad1b[_0x993e('0x2c')]},client9002);return _0x580c2c;}return null;})[_0x993e('0x23')](respondWithResult(_0x49788e,null))[_0x993e('0x53')](handleError(_0x49788e,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 12dfd05..d9d33f3 100644 --- a/server/api/chatMessage/chatMessage.events.js +++ b/server/api/chatMessage/chatMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6697=['hook','../../mysqldb','ChatMessage','setMaxListeners','emit','hasOwnProperty'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x6697,0xaf));var _0x7669=function(_0x5ae268,_0x4b3d90){_0x5ae268=_0x5ae268-0x0;var _0x3fea8b=_0x6697[_0x5ae268];return _0x3fea8b;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x7669('0x0'))['db'][_0x7669('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7669('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1ab83e){return function(_0x253c44,_0x1a2b78,_0x7997bf){ChatMessageEvents[_0x7669('0x3')](_0x1ab83e+':'+_0x253c44['id'],_0x253c44);ChatMessageEvents[_0x7669('0x3')](_0x1ab83e,_0x253c44);_0x7997bf(null);};}for(var e in events){if(events[_0x7669('0x4')](e)){var event=events[e];ChatMessage[_0x7669('0x5')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x903b=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','ChatMessage'];(function(_0x4429c8,_0xb30048){var _0x719670=function(_0x1f6141){while(--_0x1f6141){_0x4429c8['push'](_0x4429c8['shift']());}};_0x719670(++_0xb30048);}(_0x903b,0x91));var _0xb903=function(_0x2845d7,_0xd09cb1){_0x2845d7=_0x2845d7-0x0;var _0x147181=_0x903b[_0x2845d7];return _0x147181;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xb903('0x0'))['db'][_0xb903('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb903('0x2'),'afterDestroy':_0xb903('0x3')};function emitEvent(_0x3637c9){return function(_0xc4144a,_0x419c89,_0x40989f){ChatMessageEvents[_0xb903('0x4')](_0x3637c9+':'+_0xc4144a['id'],_0xc4144a);ChatMessageEvents[_0xb903('0x4')](_0x3637c9,_0xc4144a);_0x40989f(null);};}for(var e in events){if(events[_0xb903('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xb903('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 194dc47..29af147 100644 --- a/server/api/chatMessage/chatMessage.model.js +++ b/server/api/chatMessage/chatMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48ef=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','findOne','ChatInteractionId','then','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2ded4f,_0xb3c93){var _0xe9f2e=function(_0x38c50e){while(--_0x38c50e){_0x2ded4f['push'](_0x2ded4f['shift']());}};_0xe9f2e(++_0xb3c93);}(_0x48ef,0x14e));var _0xf48e=function(_0x4be687,_0xe630cc){_0x4be687=_0x4be687-0x0;var _0x42156f=_0x48ef[_0x4be687];return _0x42156f;};'use strict';var _=require(_0xf48e('0x0'));var util=require(_0xf48e('0x1'));var logger=require(_0xf48e('0x2'))(_0xf48e('0x3'));var moment=require(_0xf48e('0x4'));var BPromise=require(_0xf48e('0x5'));var rp=require(_0xf48e('0x6'));var fs=require('fs');var path=require(_0xf48e('0x7'));var rimraf=require('rimraf');var config=require(_0xf48e('0x8'));var attributes=require(_0xf48e('0x9'));module['exports']=function(_0x17337b,_0x30fad0){return _0x17337b[_0xf48e('0xa')](_0xf48e('0xb'),attributes,{'tableName':_0xf48e('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xf48e('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x82342a,_0x599548,_0x282320){var _0x48a409=_0x17337b[_0xf48e('0xe')];var _0x548866=_0x82342a[_0xf48e('0xf')]({'plain':!![]});if(_0x548866[_0xf48e('0x10')][_0xf48e('0x11')]()==='in'||_0x548866['direction'][_0xf48e('0x11')]()===_0xf48e('0x12')&&!_0x548866['secret']&&!_[_0xf48e('0x13')](_0x548866[_0xf48e('0x14')])){_0x48a409['ChatInteraction'][_0xf48e('0x15')]({'where':{'id':_0x548866[_0xf48e('0x16')]}})[_0xf48e('0x17')](function(_0x460678){if(_0x460678){_0x460678[_0xf48e('0x18')]({'lastMsgAt':_0x548866['createdAt'],'lastMsgDirection':_0x548866[_0xf48e('0x10')][_0xf48e('0x11')]()});}})['catch'](function(_0x1f3453){console[_0xf48e('0x19')](_0x1f3453);});}_0x282320();}},'charset':_0xf48e('0x1a'),'collate':_0xf48e('0x1b')});}; \ No newline at end of file +var _0x9197=['bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','models','get','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','direction','catch','error','utf8mb4','lodash','util','../../config/logger'];(function(_0x872367,_0x419eeb){var _0x493401=function(_0x32f6df){while(--_0x32f6df){_0x872367['push'](_0x872367['shift']());}};_0x493401(++_0x419eeb);}(_0x9197,0xc1));var _0x7919=function(_0x3dd094,_0x43f08e){_0x3dd094=_0x3dd094-0x0;var _0x236e86=_0x9197[_0x3dd094];return _0x236e86;};'use strict';var _=require(_0x7919('0x0'));var util=require(_0x7919('0x1'));var logger=require(_0x7919('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7919('0x3'));var rp=require(_0x7919('0x4'));var fs=require('fs');var path=require(_0x7919('0x5'));var rimraf=require(_0x7919('0x6'));var config=require('../../config/environment');var attributes=require(_0x7919('0x7'));module[_0x7919('0x8')]=function(_0x22cffa,_0x20d445){return _0x22cffa[_0x7919('0x9')]('ChatMessage',attributes,{'tableName':_0x7919('0xa'),'paranoid':![],'indexes':[{'name':_0x7919('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56a764,_0x2549a8,_0x3158e9){var _0x51156c=_0x22cffa[_0x7919('0xc')];var _0x51969c=_0x56a764[_0x7919('0xd')]({'plain':!![]});if(_0x51969c['direction'][_0x7919('0xe')]()==='in'||_0x51969c['direction'][_0x7919('0xe')]()===_0x7919('0xf')&&!_0x51969c[_0x7919('0x10')]&&!_[_0x7919('0x11')](_0x51969c[_0x7919('0x12')])){_0x51156c[_0x7919('0x13')]['findOne']({'where':{'id':_0x51969c[_0x7919('0x14')]}})[_0x7919('0x15')](function(_0x57981b){if(_0x57981b){_0x57981b[_0x7919('0x16')]({'lastMsgAt':_0x51969c[_0x7919('0x17')],'lastMsgDirection':_0x51969c[_0x7919('0x18')][_0x7919('0xe')]()});}})[_0x7919('0x19')](function(_0x1dc4a9){console[_0x7919('0x1a')](_0x1dc4a9);});}_0x3158e9();}},'charset':_0x7919('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 78ebdae..11d13f1 100644 --- a/server/api/chatMessage/chatMessage.rpc.js +++ b/server/api/chatMessage/chatMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0161=['client','http','redis','defaults','localhost','./chatMessage.socket','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc'];(function(_0x4b649c,_0x3732ca){var _0x1b8068=function(_0x1ab463){while(--_0x1ab463){_0x4b649c['push'](_0x4b649c['shift']());}};_0x1b8068(++_0x3732ca);}(_0x0161,0x17f));var _0x1016=function(_0x48b685,_0x1676cd){_0x48b685=_0x48b685-0x0;var _0x298ce5=_0x0161[_0x48b685];return _0x298ce5;};'use strict';var _=require(_0x1016('0x0'));var util=require(_0x1016('0x1'));var moment=require(_0x1016('0x2'));var BPromise=require(_0x1016('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1016('0x4'));var logger=require(_0x1016('0x5'))(_0x1016('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1016('0x7')][_0x1016('0x8')]({'port':0x232a});config[_0x1016('0x9')]=_[_0x1016('0xa')](config[_0x1016('0x9')],{'host':_0x1016('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1016('0x9')]));require(_0x1016('0xc'))['register'](socket);function respondWithRpcPromise(_0x2b006f,_0x154fca,_0x555497){return new BPromise(function(_0x51de8a,_0x54c7a9){return client['request'](_0x2b006f,_0x555497)[_0x1016('0xd')](function(_0x6f282a){logger[_0x1016('0xe')](_0x1016('0xf'),_0x154fca,_0x1016('0x10'));logger[_0x1016('0x11')](_0x1016('0x12'),_0x154fca,'request\x20sent',JSON['stringify'](_0x6f282a));if(_0x6f282a[_0x1016('0x13')]){if(_0x6f282a['error'][_0x1016('0x14')]===0x1f4){logger[_0x1016('0x13')](_0x1016('0xf'),_0x154fca,_0x6f282a[_0x1016('0x13')]['message']);return _0x54c7a9(_0x6f282a[_0x1016('0x13')][_0x1016('0x15')]);}logger[_0x1016('0x13')](_0x1016('0xf'),_0x154fca,_0x6f282a[_0x1016('0x13')][_0x1016('0x15')]);return _0x51de8a(_0x6f282a[_0x1016('0x13')]['message']);}else{logger[_0x1016('0xe')](_0x1016('0xf'),_0x154fca,'request\x20sent');_0x51de8a(_0x6f282a[_0x1016('0x16')]['message']);}})[_0x1016('0x17')](function(_0x439e39){logger[_0x1016('0x13')]('ChatMessage,\x20%s,\x20%s',_0x154fca,_0x439e39);_0x54c7a9(_0x439e39);});});}exports[_0x1016('0x18')]=function(_0x385680){var _0x3efa15=this;return new Promise(function(_0x3d2f91,_0x1f6f50){return db['ChatMessage'][_0x1016('0x19')](_0x385680[_0x1016('0x1a')],{'raw':_0x385680[_0x1016('0x1b')]?_0x385680[_0x1016('0x1b')][_0x1016('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x36d039){logger['info'](_0x1016('0x18'),_0x385680);logger['debug'](_0x1016('0x18'),_0x385680,JSON[_0x1016('0x1d')](_0x36d039));_0x3d2f91(_0x36d039);})['catch'](function(_0x206838){logger[_0x1016('0x13')](_0x1016('0x18'),_0x206838[_0x1016('0x15')],_0x385680);_0x1f6f50(_0x3efa15[_0x1016('0x13')](0x1f4,_0x206838[_0x1016('0x15')]));});});}; \ No newline at end of file +var _0x818c=['ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatMessage.socket','register','request','then','info','request\x20sent','stringify','error','code'];(function(_0xe5c582,_0x245e29){var _0x58ff7b=function(_0x5a18a8){while(--_0x5a18a8){_0xe5c582['push'](_0xe5c582['shift']());}};_0x58ff7b(++_0x245e29);}(_0x818c,0x197));var _0xc818=function(_0x466efb,_0x105d6e){_0x466efb=_0x466efb-0x0;var _0x46e36c=_0x818c[_0x466efb];return _0x46e36c;};'use strict';var _=require(_0xc818('0x0'));var util=require(_0xc818('0x1'));var moment=require('moment');var BPromise=require(_0xc818('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc818('0x3'));var logger=require(_0xc818('0x4'))(_0xc818('0x5'));var config=require(_0xc818('0x6'));var jayson=require(_0xc818('0x7'));var client=jayson[_0xc818('0x8')][_0xc818('0x9')]({'port':0x232a});config['redis']=_[_0xc818('0xa')](config[_0xc818('0xb')],{'host':_0xc818('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc818('0xb')]));require(_0xc818('0xd'))[_0xc818('0xe')](socket);function respondWithRpcPromise(_0x3a8201,_0x2c4691,_0x526103){return new BPromise(function(_0x34c536,_0x11f617){return client[_0xc818('0xf')](_0x3a8201,_0x526103)[_0xc818('0x10')](function(_0x2948c1){logger[_0xc818('0x11')]('ChatMessage,\x20%s,\x20%s',_0x2c4691,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2c4691,_0xc818('0x12'),JSON[_0xc818('0x13')](_0x2948c1));if(_0x2948c1[_0xc818('0x14')]){if(_0x2948c1[_0xc818('0x14')][_0xc818('0x15')]===0x1f4){logger[_0xc818('0x14')](_0xc818('0x16'),_0x2c4691,_0x2948c1[_0xc818('0x14')][_0xc818('0x17')]);return _0x11f617(_0x2948c1[_0xc818('0x14')]['message']);}logger[_0xc818('0x14')](_0xc818('0x16'),_0x2c4691,_0x2948c1[_0xc818('0x14')]['message']);return _0x34c536(_0x2948c1[_0xc818('0x14')][_0xc818('0x17')]);}else{logger['info'](_0xc818('0x16'),_0x2c4691,_0xc818('0x12'));_0x34c536(_0x2948c1[_0xc818('0x18')][_0xc818('0x17')]);}})[_0xc818('0x19')](function(_0x4cc105){logger['error'](_0xc818('0x16'),_0x2c4691,_0x4cc105);_0x11f617(_0x4cc105);});});}exports[_0xc818('0x1a')]=function(_0x6f069b){var _0x5c73ba=this;return new Promise(function(_0xafef04,_0xa0448a){return db[_0xc818('0x1b')][_0xc818('0x1c')](_0x6f069b[_0xc818('0x1d')],{'raw':_0x6f069b[_0xc818('0x1e')]?_0x6f069b[_0xc818('0x1e')][_0xc818('0x1f')]===undefined?!![]:![]:!![]})[_0xc818('0x10')](function(_0x1d78cc){logger['info']('CreateChatMessage',_0x6f069b);logger[_0xc818('0x20')](_0xc818('0x1a'),_0x6f069b,JSON[_0xc818('0x13')](_0x1d78cc));_0xafef04(_0x1d78cc);})['catch'](function(_0x433057){logger['error'](_0xc818('0x1a'),_0x433057[_0xc818('0x17')],_0x6f069b);_0xa0448a(_0x5c73ba[_0xc818('0x14')](0x1f4,_0x433057['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 7072ea1..a8dcd87 100644 --- a/server/api/chatMessage/chatMessage.socket.js +++ b/server/api/chatMessage/chatMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f0e=['save','remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0xbff3a4,_0x1b5edc){var _0x26e69e=function(_0x2fa7ba){while(--_0x2fa7ba){_0xbff3a4['push'](_0xbff3a4['shift']());}};_0x26e69e(++_0x1b5edc);}(_0x9f0e,0x116));var _0xe9f0=function(_0x383dd0,_0x2a5926){_0x383dd0=_0x383dd0-0x0;var _0x2b62cc=_0x9f0e[_0x383dd0];return _0x2b62cc;};'use strict';var ChatMessageEvents=require(_0xe9f0('0x0'));var events=[_0xe9f0('0x1'),_0xe9f0('0x2'),_0xe9f0('0x3')];function createListener(_0x146ad8,_0x4a1a30){return function(_0x5856dc){_0x4a1a30[_0xe9f0('0x4')](_0x146ad8,_0x5856dc);};}function removeListener(_0x150a03,_0x3c589d){return function(){ChatMessageEvents[_0xe9f0('0x5')](_0x150a03,_0x3c589d);};}exports[_0xe9f0('0x6')]=function(_0x50313d){for(var _0x5b87c1=0x0,_0x3a17b3=events[_0xe9f0('0x7')];_0x5b87c1<_0x3a17b3;_0x5b87c1++){var _0xe64a79=events[_0x5b87c1];var _0x4be6a6=createListener(_0xe9f0('0x8')+_0xe64a79,_0x50313d);ChatMessageEvents['on'](_0xe64a79,_0x4be6a6);}}; \ No newline at end of file +var _0x4991=['length','chatMessage:','./chatMessage.events','remove','emit','removeListener','register'];(function(_0x381b64,_0x4ba9d9){var _0x1cfc83=function(_0x104589){while(--_0x104589){_0x381b64['push'](_0x381b64['shift']());}};_0x1cfc83(++_0x4ba9d9);}(_0x4991,0xf7));var _0x1499=function(_0x76c797,_0x6e6570){_0x76c797=_0x76c797-0x0;var _0x39a216=_0x4991[_0x76c797];return _0x39a216;};'use strict';var ChatMessageEvents=require(_0x1499('0x0'));var events=['save',_0x1499('0x1'),'update'];function createListener(_0x30d640,_0x256e41){return function(_0x16ac22){_0x256e41[_0x1499('0x2')](_0x30d640,_0x16ac22);};}function removeListener(_0x1b291f,_0x158134){return function(){ChatMessageEvents[_0x1499('0x3')](_0x1b291f,_0x158134);};}exports[_0x1499('0x4')]=function(_0x4b6154){for(var _0x2a8e96=0x0,_0x1c3bd7=events[_0x1499('0x5')];_0x2a8e96<_0x1c3bd7;_0x2a8e96++){var _0x33b261=events[_0x2a8e96];var _0x133bae=createListener(_0x1499('0x6')+_0x33b261,_0x4b6154);ChatMessageEvents['on'](_0x33b261,_0x133bae);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 05b31de..1137d7f 100644 --- a/server/api/chatMessage/index.js +++ b/server/api/chatMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x294d=['../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','post','tracked','chat','create','put','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x2c1ac1,_0x3dfb07){var _0x240e2d=function(_0x5e6afd){while(--_0x5e6afd){_0x2c1ac1['push'](_0x2c1ac1['shift']());}};_0x240e2d(++_0x3dfb07);}(_0x294d,0x198));var _0xd294=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x294d[_0x65c50e];return _0x4573e7;};'use strict';var multer=require(_0xd294('0x0'));var util=require(_0xd294('0x1'));var path=require(_0xd294('0x2'));var timeout=require(_0xd294('0x3'));var express=require(_0xd294('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd294('0x5'));var config=require(_0xd294('0x6'));var controller=require(_0xd294('0x7'));router[_0xd294('0x8')]('/',auth[_0xd294('0x9')](),controller['index']);router[_0xd294('0x8')](_0xd294('0xa'),auth['isAuthenticated'](),controller[_0xd294('0xb')]);router[_0xd294('0x8')](_0xd294('0xc'),auth[_0xd294('0x9')](),controller['show']);router[_0xd294('0xd')]('/',auth[_0xd294('0x9')](),interaction[_0xd294('0xe')](_0xd294('0xf'),'chatmessage:create'),controller[_0xd294('0x10')]);router[_0xd294('0x11')](_0xd294('0xc'),controller['update']);router['put'](_0xd294('0x12'),auth[_0xd294('0x9')](),controller['accept']);router['put'](_0xd294('0x13'),auth[_0xd294('0x9')](),controller[_0xd294('0x14')]);router['delete'](_0xd294('0xc'),auth[_0xd294('0x9')](),controller[_0xd294('0x15')]);module[_0xd294('0x16')]=router; \ No newline at end of file +var _0x4061=['accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','post','chat','put','update'];(function(_0x32f883,_0xaf9d53){var _0x392130=function(_0x4ab8bd){while(--_0x4ab8bd){_0x32f883['push'](_0x32f883['shift']());}};_0x392130(++_0xaf9d53);}(_0x4061,0xe7));var _0x1406=function(_0x385a58,_0x127519){_0x385a58=_0x385a58-0x0;var _0x38adb8=_0x4061[_0x385a58];return _0x38adb8;};'use strict';var multer=require('multer');var util=require(_0x1406('0x0'));var path=require(_0x1406('0x1'));var timeout=require(_0x1406('0x2'));var express=require(_0x1406('0x3'));var router=express[_0x1406('0x4')]();var auth=require(_0x1406('0x5'));var interaction=require(_0x1406('0x6'));var config=require(_0x1406('0x7'));var controller=require(_0x1406('0x8'));router[_0x1406('0x9')]('/',auth['isAuthenticated'](),controller[_0x1406('0xa')]);router[_0x1406('0x9')](_0x1406('0xb'),auth[_0x1406('0xc')](),controller[_0x1406('0xd')]);router[_0x1406('0x9')](_0x1406('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x1406('0xf')]('/',auth[_0x1406('0xc')](),interaction['tracked'](_0x1406('0x10'),'chatmessage:create'),controller['create']);router[_0x1406('0x11')](_0x1406('0xe'),controller[_0x1406('0x12')]);router[_0x1406('0x11')]('/:id/accept',auth[_0x1406('0xc')](),controller[_0x1406('0x13')]);router['put'](_0x1406('0x14'),auth['isAuthenticated'](),controller[_0x1406('0x15')]);router[_0x1406('0x16')](_0x1406('0xe'),auth[_0x1406('0xc')](),controller[_0x1406('0x17')]);module[_0x1406('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 145dd93..84ad647 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc92=['TEXT','sequelize'];(function(_0x1683cf,_0x20b3cb){var _0x1159ad=function(_0x241e90){while(--_0x241e90){_0x1683cf['push'](_0x1683cf['shift']());}};_0x1159ad(++_0x20b3cb);}(_0xfc92,0x121));var _0x2fc9=function(_0x4801a0,_0x252c24){_0x4801a0=_0x4801a0-0x0;var _0x338e26=_0xfc92[_0x4801a0];return _0x338e26;};'use strict';var Sequelize=require(_0x2fc9('0x0'));module['exports']={'body':{'type':Sequelize[_0x2fc9('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x3161=['medium','sequelize','exports','TEXT'];(function(_0x34c285,_0x2dab0d){var _0x1c4129=function(_0x5cfa08){while(--_0x5cfa08){_0x34c285['push'](_0x34c285['shift']());}};_0x1c4129(++_0x2dab0d);}(_0x3161,0x19d));var _0x1316=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3161[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1316('0x0'));module[_0x1316('0x1')]={'body':{'type':Sequelize[_0x1316('0x2')](_0x1316('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 304c014..8ee7d99 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0be3=['findAll','rows','show','rawAttributes','length','catch','create','body','find','params','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','ChatOfflineMessage','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','merge','where','map','type','VIRTUAL','field','options','includeAll','include'];(function(_0x39281a,_0x232677){var _0x23e5b9=function(_0x7fe631){while(--_0x7fe631){_0x39281a['push'](_0x39281a['shift']());}};_0x23e5b9(++_0x232677);}(_0x0be3,0x9a));var _0x30be=function(_0x4d5a4d,_0x1c7249){_0x4d5a4d=_0x4d5a4d-0x0;var _0x55bb93=_0x0be3[_0x4d5a4d];return _0x55bb93;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x30be('0x0'));var zipdir=require(_0x30be('0x1'));var jsonpatch=require(_0x30be('0x2'));var rp=require('request-promise');var moment=require(_0x30be('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x30be('0x4'));var util=require(_0x30be('0x5'));var path=require(_0x30be('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x30be('0x7'));var fs=require('fs');var _=require(_0x30be('0x8'));var squel=require('squel');var crypto=require(_0x30be('0x9'));var jsforce=require(_0x30be('0xa'));var deskjs=require(_0x30be('0xb'));var toCsv=require('to-csv');var querystring=require(_0x30be('0xc'));var Papa=require(_0x30be('0xd'));var Redis=require(_0x30be('0xe'));var authService=require(_0x30be('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x30be('0x10'));var utils=require('../../config/utils');var config=require(_0x30be('0x11'));var db=require(_0x30be('0x12'))['db'];function respondWithStatusCode(_0x300311,_0x36f962){_0x36f962=_0x36f962||0xcc;return function(_0x381ace){if(_0x381ace){return _0x300311[_0x30be('0x13')](_0x36f962);}return _0x300311[_0x30be('0x14')](_0x36f962)[_0x30be('0x15')]();};}function respondWithResult(_0x6043f7,_0x5ec0e6){_0x5ec0e6=_0x5ec0e6||0xc8;return function(_0x460bc7){if(_0x460bc7){return _0x6043f7['status'](_0x5ec0e6)[_0x30be('0x16')](_0x460bc7);}};}function respondWithFilteredResult(_0x44f51b,_0x57161a){return function(_0x108972){if(_0x108972){var _0x7e4c86=_0x108972[_0x30be('0x17')],_0x542c79=_0x57161a[_0x30be('0x18')],_0xd6aa18=_0x57161a[_0x30be('0x18')]+_0x57161a[_0x30be('0x19')],_0x235824;if(_0xd6aa18>=_0x7e4c86){_0xd6aa18=_0x7e4c86;_0x235824=0xc8;}else{_0x235824=0xce;}_0x44f51b[_0x30be('0x14')](_0x235824);return _0x44f51b[_0x30be('0x1a')](_0x30be('0x1b'),_0x542c79+'-'+_0xd6aa18+'/'+_0x7e4c86)[_0x30be('0x16')](_0x108972);}return null;};}function patchUpdates(_0x562648){return function(_0x3bb542){try{jsonpatch[_0x30be('0x1c')](_0x3bb542,_0x562648,!![]);}catch(_0xec2b2c){return BPromise[_0x30be('0x1d')](_0xec2b2c);}return _0x3bb542[_0x30be('0x1e')]();};}function saveUpdates(_0x38639f,_0x356964){return function(_0x216ae0){if(_0x216ae0){return _0x216ae0[_0x30be('0x1f')](_0x38639f)[_0x30be('0x20')](function(_0x18747f){return _0x18747f;});}return null;};}function removeEntity(_0x178bf9,_0x25ed6e){return function(_0x29d6f6){if(_0x29d6f6){return _0x29d6f6['destroy']()['then'](function(){_0x178bf9[_0x30be('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dfa0f,_0x4d1b93){return function(_0x251572){if(!_0x251572){_0x3dfa0f[_0x30be('0x13')](0x194);}return _0x251572;};}function handleError(_0x3e088c,_0x20b5b5){_0x20b5b5=_0x20b5b5||0x1f4;return function(_0x4779a2){logger[_0x30be('0x21')](_0x4779a2[_0x30be('0x22')]);if(_0x4779a2[_0x30be('0x23')]){delete _0x4779a2[_0x30be('0x23')];}_0x3e088c[_0x30be('0x14')](_0x20b5b5)[_0x30be('0x24')](_0x4779a2);};}exports[_0x30be('0x25')]=function(_0x589cf3,_0xa5df79){var _0x5b6069={},_0x230ab3={},_0x3c1fd0={'count':0x0,'rows':[]};var _0x2caa0a=db[_0x30be('0x26')]['rawAttributes'];_0x230ab3[_0x30be('0x27')]=_[_0x30be('0x28')](_0x2caa0a);_0x230ab3['query']=_['keys'](_0x589cf3[_0x30be('0x29')]);_0x230ab3[_0x30be('0x2a')]=_[_0x30be('0x2b')](_0x230ab3[_0x30be('0x27')],_0x230ab3[_0x30be('0x29')]);_0x5b6069[_0x30be('0x2c')]=_[_0x30be('0x2b')](_0x230ab3[_0x30be('0x27')],qs[_0x30be('0x2d')](_0x589cf3['query']['fields']));_0x5b6069[_0x30be('0x2c')]=_0x5b6069['attributes']['length']?_0x5b6069[_0x30be('0x2c')]:_0x230ab3['model'];if(!_0x589cf3['query'][_0x30be('0x2e')]('nolimit')){_0x5b6069[_0x30be('0x19')]=qs[_0x30be('0x19')](_0x589cf3[_0x30be('0x29')][_0x30be('0x19')]);_0x5b6069[_0x30be('0x18')]=qs['offset'](_0x589cf3[_0x30be('0x29')][_0x30be('0x18')]);}_0x5b6069[_0x30be('0x2f')]=qs['sort'](_0x589cf3[_0x30be('0x29')][_0x30be('0x30')]);_0x5b6069['where']=qs[_0x30be('0x2a')](_[_0x30be('0x31')](_0x589cf3['query'],_0x230ab3[_0x30be('0x2a')]));if(_0x589cf3['query']['filter']){_0x5b6069['where']=_[_0x30be('0x32')](_0x5b6069[_0x30be('0x33')],{'$or':_[_0x30be('0x34')](_0x2caa0a,function(_0x54daf6){if(_0x54daf6[_0x30be('0x35')]['key']!==_0x30be('0x36')){var _0x3b0744={};_0x3b0744[_0x54daf6[_0x30be('0x37')]]={'$like':'%'+_0x589cf3[_0x30be('0x29')]['filter']+'%'};return _0x3b0744;}})});}_0x5b6069=_[_0x30be('0x32')]({},_0x5b6069,_0x589cf3[_0x30be('0x38')]);var _0x54810f={'where':_0x5b6069[_0x30be('0x33')]};return db[_0x30be('0x26')][_0x30be('0x17')](_0x54810f)[_0x30be('0x20')](function(_0x50df73){_0x3c1fd0[_0x30be('0x17')]=_0x50df73;if(_0x589cf3['query'][_0x30be('0x39')]){_0x5b6069[_0x30be('0x3a')]=[{'all':!![]}];}return db[_0x30be('0x26')][_0x30be('0x3b')](_0x5b6069);})['then'](function(_0x35b566){_0x3c1fd0[_0x30be('0x3c')]=_0x35b566;return _0x3c1fd0;})[_0x30be('0x20')](respondWithFilteredResult(_0xa5df79,_0x5b6069))['catch'](handleError(_0xa5df79,null));};exports[_0x30be('0x3d')]=function(_0x37eaa2,_0x5c2c36){var _0x5bd0e2={'raw':!![],'where':{'id':_0x37eaa2['params']['id']}},_0x302a97={};_0x302a97[_0x30be('0x27')]=_[_0x30be('0x28')](db[_0x30be('0x26')][_0x30be('0x3e')]);_0x302a97['query']=_['keys'](_0x37eaa2['query']);_0x302a97[_0x30be('0x2a')]=_[_0x30be('0x2b')](_0x302a97[_0x30be('0x27')],_0x302a97[_0x30be('0x29')]);_0x5bd0e2['attributes']=_[_0x30be('0x2b')](_0x302a97[_0x30be('0x27')],qs['fields'](_0x37eaa2[_0x30be('0x29')][_0x30be('0x2d')]));_0x5bd0e2[_0x30be('0x2c')]=_0x5bd0e2['attributes'][_0x30be('0x3f')]?_0x5bd0e2['attributes']:_0x302a97[_0x30be('0x27')];if(_0x37eaa2[_0x30be('0x29')]['includeAll']){_0x5bd0e2['include']=[{'all':!![]}];}_0x5bd0e2=_[_0x30be('0x32')]({},_0x5bd0e2,_0x37eaa2[_0x30be('0x38')]);return db[_0x30be('0x26')]['find'](_0x5bd0e2)['then'](handleEntityNotFound(_0x5c2c36,null))[_0x30be('0x20')](respondWithResult(_0x5c2c36,null))[_0x30be('0x40')](handleError(_0x5c2c36,null));};exports[_0x30be('0x41')]=function(_0x4f2c58,_0x474523){return db['ChatOfflineMessage']['create'](_0x4f2c58[_0x30be('0x42')],{})['then'](respondWithResult(_0x474523,0xc9))[_0x30be('0x40')](handleError(_0x474523,null));};exports[_0x30be('0x1f')]=function(_0x3a5b23,_0x3ee14c){if(_0x3a5b23[_0x30be('0x42')]['id']){delete _0x3a5b23[_0x30be('0x42')]['id'];}return db[_0x30be('0x26')][_0x30be('0x43')]({'where':{'id':_0x3a5b23[_0x30be('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ee14c,null))[_0x30be('0x20')](saveUpdates(_0x3a5b23[_0x30be('0x42')],null))[_0x30be('0x20')](respondWithResult(_0x3ee14c,null))[_0x30be('0x40')](handleError(_0x3ee14c,null));};exports[_0x30be('0x45')]=function(_0x109860,_0x2aabd3){return db[_0x30be('0x26')][_0x30be('0x43')]({'where':{'id':_0x109860['params']['id']}})[_0x30be('0x20')](handleEntityNotFound(_0x2aabd3,null))['then'](removeEntity(_0x2aabd3,null))[_0x30be('0x40')](handleError(_0x2aabd3,null));};exports[_0x30be('0x46')]=function(_0x4b7047,_0x3521e7){return db[_0x30be('0x26')][_0x30be('0x46')]()[_0x30be('0x20')](respondWithResult(_0x3521e7,null))['catch'](handleError(_0x3521e7,null));}; \ No newline at end of file +var _0x908e=['json','offset','limit','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','ChatOfflineMessage','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','where','pick','filter','merge','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','show','params','find','catch','create','body','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status'];(function(_0x4d6bfd,_0x8d79ff){var _0x243a46=function(_0x3883b1){while(--_0x3883b1){_0x4d6bfd['push'](_0x4d6bfd['shift']());}};_0x243a46(++_0x8d79ff);}(_0x908e,0x182));var _0xe908=function(_0x2e3ebb,_0x5afc59){_0x2e3ebb=_0x2e3ebb-0x0;var _0x8f027f=_0x908e[_0x2e3ebb];return _0x8f027f;};'use strict';var pdf=require(_0xe908('0x0'));var emlformat=require(_0xe908('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe908('0x2'));var rp=require(_0xe908('0x3'));var moment=require(_0xe908('0x4'));var BPromise=require(_0xe908('0x5'));var Mustache=require('mustache');var util=require(_0xe908('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe908('0x7'));var ejs=require(_0xe908('0x8'));var fs=require('fs');var _=require(_0xe908('0x9'));var squel=require(_0xe908('0xa'));var crypto=require(_0xe908('0xb'));var jsforce=require(_0xe908('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe908('0x7'));var querystring=require('querystring');var Papa=require(_0xe908('0xd'));var Redis=require(_0xe908('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe908('0xf'));var logger=require(_0xe908('0x10'))(_0xe908('0x11'));var utils=require(_0xe908('0x12'));var config=require(_0xe908('0x13'));var db=require(_0xe908('0x14'))['db'];function respondWithStatusCode(_0x24ac42,_0x105761){_0x105761=_0x105761||0xcc;return function(_0x54347e){if(_0x54347e){return _0x24ac42['sendStatus'](_0x105761);}return _0x24ac42[_0xe908('0x15')](_0x105761)['end']();};}function respondWithResult(_0x3ac3ff,_0xf24ff1){_0xf24ff1=_0xf24ff1||0xc8;return function(_0x21029a){if(_0x21029a){return _0x3ac3ff[_0xe908('0x15')](_0xf24ff1)[_0xe908('0x16')](_0x21029a);}};}function respondWithFilteredResult(_0x582894,_0x214997){return function(_0x34343c){if(_0x34343c){var _0xc5182b=_0x34343c['count'],_0x114ea7=_0x214997[_0xe908('0x17')],_0x564500=_0x214997[_0xe908('0x17')]+_0x214997[_0xe908('0x18')],_0x530227;if(_0x564500>=_0xc5182b){_0x564500=_0xc5182b;_0x530227=0xc8;}else{_0x530227=0xce;}_0x582894[_0xe908('0x15')](_0x530227);return _0x582894['set'](_0xe908('0x19'),_0x114ea7+'-'+_0x564500+'/'+_0xc5182b)[_0xe908('0x16')](_0x34343c);}return null;};}function patchUpdates(_0x457c57){return function(_0x2c9787){try{jsonpatch[_0xe908('0x1a')](_0x2c9787,_0x457c57,!![]);}catch(_0x4cbdcd){return BPromise[_0xe908('0x1b')](_0x4cbdcd);}return _0x2c9787['save']();};}function saveUpdates(_0x3c0e63,_0x417943){return function(_0x43ad6c){if(_0x43ad6c){return _0x43ad6c[_0xe908('0x1c')](_0x3c0e63)[_0xe908('0x1d')](function(_0x59bca6){return _0x59bca6;});}return null;};}function removeEntity(_0xa1d7b9,_0x163263){return function(_0x122960){if(_0x122960){return _0x122960[_0xe908('0x1e')]()[_0xe908('0x1d')](function(){_0xa1d7b9[_0xe908('0x15')](0xcc)[_0xe908('0x1f')]();});}};}function handleEntityNotFound(_0x43114c,_0x212c95){return function(_0x537e56){if(!_0x537e56){_0x43114c['sendStatus'](0x194);}return _0x537e56;};}function handleError(_0x2b0027,_0xd64396){_0xd64396=_0xd64396||0x1f4;return function(_0x136abb){logger['error'](_0x136abb[_0xe908('0x20')]);if(_0x136abb[_0xe908('0x21')]){delete _0x136abb['name'];}_0x2b0027[_0xe908('0x15')](_0xd64396)[_0xe908('0x22')](_0x136abb);};}exports[_0xe908('0x23')]=function(_0x69f6c0,_0x296b02){var _0x53b512={},_0x154d4a={},_0x19e180={'count':0x0,'rows':[]};var _0x2d06b9=db[_0xe908('0x24')][_0xe908('0x25')];_0x154d4a['model']=_[_0xe908('0x26')](_0x2d06b9);_0x154d4a[_0xe908('0x27')]=_[_0xe908('0x26')](_0x69f6c0[_0xe908('0x27')]);_0x154d4a[_0xe908('0x28')]=_[_0xe908('0x29')](_0x154d4a[_0xe908('0x2a')],_0x154d4a[_0xe908('0x27')]);_0x53b512['attributes']=_[_0xe908('0x29')](_0x154d4a[_0xe908('0x2a')],qs[_0xe908('0x2b')](_0x69f6c0[_0xe908('0x27')][_0xe908('0x2b')]));_0x53b512[_0xe908('0x2c')]=_0x53b512[_0xe908('0x2c')][_0xe908('0x2d')]?_0x53b512[_0xe908('0x2c')]:_0x154d4a['model'];if(!_0x69f6c0[_0xe908('0x27')]['hasOwnProperty'](_0xe908('0x2e'))){_0x53b512[_0xe908('0x18')]=qs['limit'](_0x69f6c0[_0xe908('0x27')]['limit']);_0x53b512['offset']=qs[_0xe908('0x17')](_0x69f6c0[_0xe908('0x27')][_0xe908('0x17')]);}_0x53b512[_0xe908('0x2f')]=qs['sort'](_0x69f6c0[_0xe908('0x27')]['sort']);_0x53b512[_0xe908('0x30')]=qs['filters'](_[_0xe908('0x31')](_0x69f6c0['query'],_0x154d4a[_0xe908('0x28')]));if(_0x69f6c0[_0xe908('0x27')][_0xe908('0x32')]){_0x53b512[_0xe908('0x30')]=_[_0xe908('0x33')](_0x53b512[_0xe908('0x30')],{'$or':_[_0xe908('0x34')](_0x2d06b9,function(_0x13d403){if(_0x13d403['type'][_0xe908('0x35')]!==_0xe908('0x36')){var _0x1b2012={};_0x1b2012[_0x13d403[_0xe908('0x37')]]={'$like':'%'+_0x69f6c0[_0xe908('0x27')][_0xe908('0x32')]+'%'};return _0x1b2012;}})});}_0x53b512=_[_0xe908('0x33')]({},_0x53b512,_0x69f6c0[_0xe908('0x38')]);var _0x858f52={'where':_0x53b512[_0xe908('0x30')]};return db[_0xe908('0x24')][_0xe908('0x39')](_0x858f52)['then'](function(_0x1a3b16){_0x19e180['count']=_0x1a3b16;if(_0x69f6c0[_0xe908('0x27')][_0xe908('0x3a')]){_0x53b512[_0xe908('0x3b')]=[{'all':!![]}];}return db[_0xe908('0x24')][_0xe908('0x3c')](_0x53b512);})['then'](function(_0x437eac){_0x19e180['rows']=_0x437eac;return _0x19e180;})[_0xe908('0x1d')](respondWithFilteredResult(_0x296b02,_0x53b512))['catch'](handleError(_0x296b02,null));};exports[_0xe908('0x3d')]=function(_0x2632b8,_0x2633c1){var _0x35c1a7={'raw':!![],'where':{'id':_0x2632b8[_0xe908('0x3e')]['id']}},_0x4c65a0={};_0x4c65a0[_0xe908('0x2a')]=_['keys'](db[_0xe908('0x24')][_0xe908('0x25')]);_0x4c65a0[_0xe908('0x27')]=_[_0xe908('0x26')](_0x2632b8['query']);_0x4c65a0[_0xe908('0x28')]=_[_0xe908('0x29')](_0x4c65a0[_0xe908('0x2a')],_0x4c65a0[_0xe908('0x27')]);_0x35c1a7['attributes']=_[_0xe908('0x29')](_0x4c65a0[_0xe908('0x2a')],qs[_0xe908('0x2b')](_0x2632b8[_0xe908('0x27')][_0xe908('0x2b')]));_0x35c1a7[_0xe908('0x2c')]=_0x35c1a7[_0xe908('0x2c')][_0xe908('0x2d')]?_0x35c1a7[_0xe908('0x2c')]:_0x4c65a0[_0xe908('0x2a')];if(_0x2632b8['query'][_0xe908('0x3a')]){_0x35c1a7[_0xe908('0x3b')]=[{'all':!![]}];}_0x35c1a7=_[_0xe908('0x33')]({},_0x35c1a7,_0x2632b8[_0xe908('0x38')]);return db['ChatOfflineMessage'][_0xe908('0x3f')](_0x35c1a7)[_0xe908('0x1d')](handleEntityNotFound(_0x2633c1,null))[_0xe908('0x1d')](respondWithResult(_0x2633c1,null))[_0xe908('0x40')](handleError(_0x2633c1,null));};exports[_0xe908('0x41')]=function(_0xa03141,_0x507037){return db[_0xe908('0x24')][_0xe908('0x41')](_0xa03141['body'],{})[_0xe908('0x1d')](respondWithResult(_0x507037,0xc9))['catch'](handleError(_0x507037,null));};exports[_0xe908('0x1c')]=function(_0x50d79a,_0x3b2400){if(_0x50d79a[_0xe908('0x42')]['id']){delete _0x50d79a['body']['id'];}return db['ChatOfflineMessage'][_0xe908('0x3f')]({'where':{'id':_0x50d79a[_0xe908('0x3e')]['id']}})[_0xe908('0x1d')](handleEntityNotFound(_0x3b2400,null))[_0xe908('0x1d')](saveUpdates(_0x50d79a['body'],null))[_0xe908('0x1d')](respondWithResult(_0x3b2400,null))[_0xe908('0x40')](handleError(_0x3b2400,null));};exports[_0xe908('0x1e')]=function(_0x481a7f,_0x14d25e){return db['ChatOfflineMessage'][_0xe908('0x3f')]({'where':{'id':_0x481a7f['params']['id']}})[_0xe908('0x1d')](handleEntityNotFound(_0x14d25e,null))[_0xe908('0x1d')](removeEntity(_0x14d25e,null))['catch'](handleError(_0x14d25e,null));};exports[_0xe908('0x43')]=function(_0x24dd5c,_0x390602){return db[_0xe908('0x24')]['describe']()[_0xe908('0x1d')](respondWithResult(_0x390602,null))[_0xe908('0x40')](handleError(_0x390602,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index cb9d0dc..ea0976a 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ce3=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x230ed6,_0xd974d8){var _0x3eafd9=function(_0x561fbf){while(--_0x561fbf){_0x230ed6['push'](_0x230ed6['shift']());}};_0x3eafd9(++_0xd974d8);}(_0x8ce3,0xc3));var _0x38ce=function(_0x4a7b64,_0x16733c){_0x4a7b64=_0x4a7b64-0x0;var _0x500da6=_0x8ce3[_0x4a7b64];return _0x500da6;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var logger=require('../../config/logger')(_0x38ce('0x2'));var moment=require(_0x38ce('0x3'));var BPromise=require(_0x38ce('0x4'));var rp=require(_0x38ce('0x5'));var fs=require('fs');var path=require(_0x38ce('0x6'));var rimraf=require(_0x38ce('0x7'));var config=require(_0x38ce('0x8'));var attributes=require(_0x38ce('0x9'));module['exports']=function(_0x372f86,_0xb24f4c){return _0x372f86['define'](_0x38ce('0xa'),attributes,{'tableName':_0x38ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x38ce('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9a19=['exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x9a19,0x114));var _0x99a1=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x9a19[_0x35af23];return _0x340506;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x99a1('0xc')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index be40f52..35f1b8e 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ea4=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0x5ea4,0x148));var _0x45ea=function(_0x2143f6,_0x994bb3){_0x2143f6=_0x2143f6-0x0;var _0x1a78cb=_0x5ea4[_0x2143f6];return _0x1a78cb;};'use strict';var _=require(_0x45ea('0x0'));var util=require(_0x45ea('0x1'));var moment=require(_0x45ea('0x2'));var BPromise=require('bluebird');var rs=require(_0x45ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45ea('0x4'))['db'];var utils=require(_0x45ea('0x5'));var logger=require(_0x45ea('0x6'))('rpc');var config=require(_0x45ea('0x7'));var jayson=require(_0x45ea('0x8'));var client=jayson['client'][_0x45ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3010a3,_0x332505,_0x113132){return new BPromise(function(_0x59ba5b,_0x54fdea){return client[_0x45ea('0xa')](_0x3010a3,_0x113132)[_0x45ea('0xb')](function(_0x5b658e){logger['info'](_0x45ea('0xc'),_0x332505,_0x45ea('0xd'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x332505,'request\x20sent',JSON['stringify'](_0x5b658e));if(_0x5b658e[_0x45ea('0xe')]){if(_0x5b658e[_0x45ea('0xe')][_0x45ea('0xf')]===0x1f4){logger[_0x45ea('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x332505,_0x5b658e[_0x45ea('0xe')]['message']);return _0x54fdea(_0x5b658e['error']['message']);}logger['error'](_0x45ea('0xc'),_0x332505,_0x5b658e['error'][_0x45ea('0x10')]);return _0x59ba5b(_0x5b658e[_0x45ea('0xe')][_0x45ea('0x10')]);}else{logger[_0x45ea('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x332505,_0x45ea('0xd'));_0x59ba5b(_0x5b658e[_0x45ea('0x12')]['message']);}})[_0x45ea('0x13')](function(_0x20f612){logger[_0x45ea('0xe')](_0x45ea('0xc'),_0x332505,_0x20f612);_0x54fdea(_0x20f612);});});} \ No newline at end of file +var _0x49b0=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x40f031,_0x1c6247){var _0x50fed3=function(_0x448d30){while(--_0x448d30){_0x40f031['push'](_0x40f031['shift']());}};_0x50fed3(++_0x1c6247);}(_0x49b0,0x170));var _0x049b=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x49b0[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x049b('0x0'));var util=require(_0x049b('0x1'));var moment=require(_0x049b('0x2'));var BPromise=require(_0x049b('0x3'));var rs=require(_0x049b('0x4'));var fs=require('fs');var Redis=require(_0x049b('0x5'));var db=require(_0x049b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x049b('0x7'))(_0x049b('0x8'));var config=require(_0x049b('0x9'));var jayson=require(_0x049b('0xa'));var client=jayson[_0x049b('0xb')][_0x049b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x540aaf,_0x5ba45f,_0x8570fb){return new BPromise(function(_0x239d01,_0x2a299e){return client['request'](_0x540aaf,_0x8570fb)[_0x049b('0xd')](function(_0x1eb5bf){logger[_0x049b('0xe')](_0x049b('0xf'),_0x5ba45f,'request\x20sent');logger[_0x049b('0x10')](_0x049b('0x11'),_0x5ba45f,_0x049b('0x12'),JSON[_0x049b('0x13')](_0x1eb5bf));if(_0x1eb5bf[_0x049b('0x14')]){if(_0x1eb5bf['error'][_0x049b('0x15')]===0x1f4){logger[_0x049b('0x14')](_0x049b('0xf'),_0x5ba45f,_0x1eb5bf[_0x049b('0x14')][_0x049b('0x16')]);return _0x2a299e(_0x1eb5bf[_0x049b('0x14')][_0x049b('0x16')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5ba45f,_0x1eb5bf['error']['message']);return _0x239d01(_0x1eb5bf[_0x049b('0x14')]['message']);}else{logger[_0x049b('0xe')](_0x049b('0xf'),_0x5ba45f,_0x049b('0x12'));_0x239d01(_0x1eb5bf[_0x049b('0x17')][_0x049b('0x16')]);}})[_0x049b('0x18')](function(_0x4d545b){logger[_0x049b('0x14')](_0x049b('0xf'),_0x5ba45f,_0x4d545b);_0x2a299e(_0x4d545b);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 852edd8..82b7f12 100644 --- a/server/api/chatOfflineMessage/index.js +++ b/server/api/chatOfflineMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18bf=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatOfflineMessage.controller','get','index','isAuthenticated','put','update'];(function(_0x18d630,_0x50a604){var _0x4a631a=function(_0x5d82ad){while(--_0x5d82ad){_0x18d630['push'](_0x18d630['shift']());}};_0x4a631a(++_0x50a604);}(_0x18bf,0x1e2));var _0xf18b=function(_0x7d50c5,_0x1c7af0){_0x7d50c5=_0x7d50c5-0x0;var _0x28b830=_0x18bf[_0x7d50c5];return _0x28b830;};'use strict';var multer=require(_0xf18b('0x0'));var util=require(_0xf18b('0x1'));var path=require(_0xf18b('0x2'));var timeout=require(_0xf18b('0x3'));var express=require(_0xf18b('0x4'));var router=express[_0xf18b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xf18b('0x6'));var config=require('../../config/environment');var controller=require(_0xf18b('0x7'));router[_0xf18b('0x8')]('/',auth['isAuthenticated'](),controller[_0xf18b('0x9')]);router['get']('/describe',auth[_0xf18b('0xa')](),controller['describe']);router[_0xf18b('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf18b('0xa')](),controller['create']);router[_0xf18b('0xb')]('/:id',auth[_0xf18b('0xa')](),controller[_0xf18b('0xc')]);router[_0xf18b('0xd')]('/:id',auth[_0xf18b('0xa')](),controller['destroy']);module[_0xf18b('0xe')]=router; \ No newline at end of file +var _0xc9b3=['isAuthenticated','show','post','create','update','delete','destroy','exports','connect-timeout','Router','../../components/interaction/service','./chatOfflineMessage.controller','get','/describe','describe','/:id'];(function(_0x23e116,_0x5109ac){var _0xde0bda=function(_0x5ba797){while(--_0x5ba797){_0x23e116['push'](_0x23e116['shift']());}};_0xde0bda(++_0x5109ac);}(_0xc9b3,0xd8));var _0x3c9b=function(_0x568fb5,_0x5a6190){_0x568fb5=_0x568fb5-0x0;var _0x4a4225=_0xc9b3[_0x568fb5];return _0x4a4225;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3c9b('0x0'));var express=require('express');var router=express[_0x3c9b('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x3c9b('0x2'));var config=require('../../config/environment');var controller=require(_0x3c9b('0x3'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3c9b('0x4')](_0x3c9b('0x5'),auth['isAuthenticated'](),controller[_0x3c9b('0x6')]);router[_0x3c9b('0x4')](_0x3c9b('0x7'),auth[_0x3c9b('0x8')](),controller[_0x3c9b('0x9')]);router[_0x3c9b('0xa')]('/',auth[_0x3c9b('0x8')](),controller[_0x3c9b('0xb')]);router['put'](_0x3c9b('0x7'),auth['isAuthenticated'](),controller[_0x3c9b('0xc')]);router[_0x3c9b('0xd')](_0x3c9b('0x7'),auth[_0x3c9b('0x8')](),controller[_0x3c9b('0xe')]);module[_0x3c9b('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 09d606a..4fd2b0f 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js +++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeef3=['STRING','ENUM','mouseOver','INTEGER','sequelize','exports'];(function(_0x1d9219,_0x5317a4){var _0x4e1fc7=function(_0x2d1bdb){while(--_0x2d1bdb){_0x1d9219['push'](_0x1d9219['shift']());}};_0x4e1fc7(++_0x5317a4);}(_0xeef3,0x136));var _0x3eef=function(_0x24392f,_0x15a3e5){_0x24392f=_0x24392f-0x0;var _0x591e33=_0xeef3[_0x24392f];return _0x591e33;};'use strict';var Sequelize=require(_0x3eef('0x0'));module[_0x3eef('0x1')]={'name':{'type':Sequelize[_0x3eef('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3eef('0x3')](_0x3eef('0x4'),'timeout'),'defaultValue':_0x3eef('0x4')},'selector':{'type':Sequelize[_0x3eef('0x2')]},'timeout':{'type':Sequelize[_0x3eef('0x5')]}}; \ No newline at end of file +var _0x52a5=['mouseOver','timeout','INTEGER','sequelize','STRING','ENUM'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x52a5,0x18f));var _0x552a=function(_0x4ca917,_0x44fd73){_0x4ca917=_0x4ca917-0x0;var _0x246327=_0x52a5[_0x4ca917];return _0x246327;};'use strict';var Sequelize=require(_0x552a('0x0'));module['exports']={'name':{'type':Sequelize[_0x552a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x552a('0x2')](_0x552a('0x3'),_0x552a('0x4')),'defaultValue':_0x552a('0x3')},'selector':{'type':Sequelize[_0x552a('0x1')]},'timeout':{'type':Sequelize[_0x552a('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index ee52ce3..1b05128 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.controller.js +++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbccd=['status','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','end','sendStatus','stack','name','show','params','keys','ChatProactiveAction','rawAttributes','filters','model','attributes','intersection','fields','query','length','include','merge','catch','create','body','find','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x400fe9,_0x54c6e7){var _0x197699=function(_0x47bfd2){while(--_0x47bfd2){_0x400fe9['push'](_0x400fe9['shift']());}};_0x197699(++_0x54c6e7);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xbccd[_0x4e9628];return _0x27bc8c;};'use strict';var pdf=require(_0xdbcc('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdbcc('0x1'));var jsonpatch=require(_0xdbcc('0x2'));var rp=require(_0xdbcc('0x3'));var moment=require(_0xdbcc('0x4'));var BPromise=require(_0xdbcc('0x5'));var Mustache=require(_0xdbcc('0x6'));var util=require('util');var path=require(_0xdbcc('0x7'));var sox=require(_0xdbcc('0x8'));var csv=require(_0xdbcc('0x9'));var ejs=require(_0xdbcc('0xa'));var fs=require('fs');var _=require(_0xdbcc('0xb'));var squel=require(_0xdbcc('0xc'));var crypto=require(_0xdbcc('0xd'));var jsforce=require(_0xdbcc('0xe'));var deskjs=require(_0xdbcc('0xf'));var toCsv=require(_0xdbcc('0x9'));var querystring=require(_0xdbcc('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbcc('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xdbcc('0x12'));var logger=require(_0xdbcc('0x13'))(_0xdbcc('0x14'));var utils=require(_0xdbcc('0x15'));var config=require(_0xdbcc('0x16'));var db=require(_0xdbcc('0x17'))['db'];function respondWithStatusCode(_0x2de9ac,_0x5b3b04){_0x5b3b04=_0x5b3b04||0xcc;return function(_0x2fbd02){if(_0x2fbd02){return _0x2de9ac['sendStatus'](_0x5b3b04);}return _0x2de9ac['status'](_0x5b3b04)['end']();};}function respondWithResult(_0x358f8b,_0x395c75){_0x395c75=_0x395c75||0xc8;return function(_0x290b93){if(_0x290b93){return _0x358f8b[_0xdbcc('0x18')](_0x395c75)[_0xdbcc('0x19')](_0x290b93);}};}function respondWithFilteredResult(_0x4677b8,_0x37caf5){return function(_0x4649d2){if(_0x4649d2){var _0x5c53a1=_0x4649d2[_0xdbcc('0x1a')],_0x5688ce=_0x37caf5[_0xdbcc('0x1b')],_0x2b189a=_0x37caf5[_0xdbcc('0x1b')]+_0x37caf5[_0xdbcc('0x1c')],_0x4f9aac;if(_0x2b189a>=_0x5c53a1){_0x2b189a=_0x5c53a1;_0x4f9aac=0xc8;}else{_0x4f9aac=0xce;}_0x4677b8[_0xdbcc('0x18')](_0x4f9aac);return _0x4677b8[_0xdbcc('0x1d')](_0xdbcc('0x1e'),_0x5688ce+'-'+_0x2b189a+'/'+_0x5c53a1)[_0xdbcc('0x19')](_0x4649d2);}return null;};}function patchUpdates(_0x3f0bc5){return function(_0x2ce1a6){try{jsonpatch[_0xdbcc('0x1f')](_0x2ce1a6,_0x3f0bc5,!![]);}catch(_0x4dd404){return BPromise['reject'](_0x4dd404);}return _0x2ce1a6[_0xdbcc('0x20')]();};}function saveUpdates(_0x4757cf,_0x47aed6){return function(_0x447f70){if(_0x447f70){return _0x447f70['update'](_0x4757cf)[_0xdbcc('0x21')](function(_0x500ec4){return _0x500ec4;});}return null;};}function removeEntity(_0x4f8213,_0x369ccc){return function(_0x3c321f){if(_0x3c321f){return _0x3c321f[_0xdbcc('0x22')]()[_0xdbcc('0x21')](function(){_0x4f8213[_0xdbcc('0x18')](0xcc)[_0xdbcc('0x23')]();});}};}function handleEntityNotFound(_0x2d797a,_0x18d47f){return function(_0x591962){if(!_0x591962){_0x2d797a[_0xdbcc('0x24')](0x194);}return _0x591962;};}function handleError(_0x5591ed,_0x2a55de){_0x2a55de=_0x2a55de||0x1f4;return function(_0x3622af){logger['error'](_0x3622af[_0xdbcc('0x25')]);if(_0x3622af[_0xdbcc('0x26')]){delete _0x3622af[_0xdbcc('0x26')];}_0x5591ed['status'](_0x2a55de)['send'](_0x3622af);};}exports[_0xdbcc('0x27')]=function(_0x17e223,_0x24e517){var _0x4f40b7={'raw':!![],'where':{'id':_0x17e223[_0xdbcc('0x28')]['id']}},_0x26647d={};_0x26647d['model']=_[_0xdbcc('0x29')](db[_0xdbcc('0x2a')][_0xdbcc('0x2b')]);_0x26647d['query']=_[_0xdbcc('0x29')](_0x17e223['query']);_0x26647d[_0xdbcc('0x2c')]=_['intersection'](_0x26647d[_0xdbcc('0x2d')],_0x26647d['query']);_0x4f40b7[_0xdbcc('0x2e')]=_[_0xdbcc('0x2f')](_0x26647d[_0xdbcc('0x2d')],qs[_0xdbcc('0x30')](_0x17e223[_0xdbcc('0x31')][_0xdbcc('0x30')]));_0x4f40b7[_0xdbcc('0x2e')]=_0x4f40b7['attributes'][_0xdbcc('0x32')]?_0x4f40b7['attributes']:_0x26647d[_0xdbcc('0x2d')];if(_0x17e223['query']['includeAll']){_0x4f40b7[_0xdbcc('0x33')]=[{'all':!![]}];}_0x4f40b7=_[_0xdbcc('0x34')]({},_0x4f40b7,_0x17e223['options']);return db[_0xdbcc('0x2a')]['find'](_0x4f40b7)[_0xdbcc('0x21')](handleEntityNotFound(_0x24e517,null))[_0xdbcc('0x21')](respondWithResult(_0x24e517,null))[_0xdbcc('0x35')](handleError(_0x24e517,null));};exports[_0xdbcc('0x36')]=function(_0x8b9573,_0x5183b9){return db[_0xdbcc('0x2a')][_0xdbcc('0x36')](_0x8b9573[_0xdbcc('0x37')],{})[_0xdbcc('0x21')](respondWithResult(_0x5183b9,0xc9))['catch'](handleError(_0x5183b9,null));};exports['update']=function(_0x35530d,_0x51d86f){if(_0x35530d['body']['id']){delete _0x35530d[_0xdbcc('0x37')]['id'];}return db[_0xdbcc('0x2a')][_0xdbcc('0x38')]({'where':{'id':_0x35530d['params']['id']}})['then'](handleEntityNotFound(_0x51d86f,null))[_0xdbcc('0x21')](saveUpdates(_0x35530d[_0xdbcc('0x37')],null))['then'](respondWithResult(_0x51d86f,null))['catch'](handleError(_0x51d86f,null));};exports[_0xdbcc('0x22')]=function(_0x33591e,_0x333dae){return db[_0xdbcc('0x2a')][_0xdbcc('0x38')]({'where':{'id':_0x33591e[_0xdbcc('0x28')]['id']}})[_0xdbcc('0x21')](handleEntityNotFound(_0x333dae,null))['then'](removeEntity(_0x333dae,null))[_0xdbcc('0x35')](handleError(_0x333dae,null));}; \ No newline at end of file +var _0xd046=['request-promise','mustache','path','ejs','lodash','jsforce','desk.js','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','ChatProactiveAction','rawAttributes','query','keys','attributes','fields','length','includeAll','include','find','create','body','catch','eml-format','rimraf','zip-dir'];(function(_0x4863f2,_0x34a70b){var _0x2e8470=function(_0x202cef){while(--_0x202cef){_0x4863f2['push'](_0x4863f2['shift']());}};_0x2e8470(++_0x34a70b);}(_0xd046,0x129));var _0x6d04=function(_0x43aaa0,_0xbb8828){_0x43aaa0=_0x43aaa0-0x0;var _0x45c1ce=_0xd046[_0x43aaa0];return _0x45c1ce;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6d04('0x0'));var rimraf=require(_0x6d04('0x1'));var zipdir=require(_0x6d04('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d04('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6d04('0x4'));var util=require('util');var path=require(_0x6d04('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6d04('0x6'));var fs=require('fs');var _=require(_0x6d04('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6d04('0x8'));var deskjs=require(_0x6d04('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6d04('0xa'));var Redis=require('ioredis');var authService=require(_0x6d04('0xb'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6d04('0xc'));var utils=require(_0x6d04('0xd'));var config=require(_0x6d04('0xe'));var db=require(_0x6d04('0xf'))['db'];function respondWithStatusCode(_0x500adc,_0x26a6ab){_0x26a6ab=_0x26a6ab||0xcc;return function(_0x103593){if(_0x103593){return _0x500adc[_0x6d04('0x10')](_0x26a6ab);}return _0x500adc[_0x6d04('0x11')](_0x26a6ab)[_0x6d04('0x12')]();};}function respondWithResult(_0x3e1da1,_0x2cadb8){_0x2cadb8=_0x2cadb8||0xc8;return function(_0x3d7dd5){if(_0x3d7dd5){return _0x3e1da1[_0x6d04('0x11')](_0x2cadb8)[_0x6d04('0x13')](_0x3d7dd5);}};}function respondWithFilteredResult(_0x252eee,_0x43f451){return function(_0x165b23){if(_0x165b23){var _0x92a88b=_0x165b23[_0x6d04('0x14')],_0x2da704=_0x43f451[_0x6d04('0x15')],_0x14f13c=_0x43f451[_0x6d04('0x15')]+_0x43f451[_0x6d04('0x16')],_0x18170c;if(_0x14f13c>=_0x92a88b){_0x14f13c=_0x92a88b;_0x18170c=0xc8;}else{_0x18170c=0xce;}_0x252eee[_0x6d04('0x11')](_0x18170c);return _0x252eee[_0x6d04('0x17')](_0x6d04('0x18'),_0x2da704+'-'+_0x14f13c+'/'+_0x92a88b)['json'](_0x165b23);}return null;};}function patchUpdates(_0x3657a1){return function(_0x1dcd3d){try{jsonpatch[_0x6d04('0x19')](_0x1dcd3d,_0x3657a1,!![]);}catch(_0x7edbfc){return BPromise[_0x6d04('0x1a')](_0x7edbfc);}return _0x1dcd3d[_0x6d04('0x1b')]();};}function saveUpdates(_0x32531b,_0x260135){return function(_0x2e9d6e){if(_0x2e9d6e){return _0x2e9d6e[_0x6d04('0x1c')](_0x32531b)[_0x6d04('0x1d')](function(_0x2994d9){return _0x2994d9;});}return null;};}function removeEntity(_0xeec9cf,_0x5bda3a){return function(_0x7aa27){if(_0x7aa27){return _0x7aa27[_0x6d04('0x1e')]()['then'](function(){_0xeec9cf['status'](0xcc)[_0x6d04('0x12')]();});}};}function handleEntityNotFound(_0x326276,_0x4386bd){return function(_0xe8f198){if(!_0xe8f198){_0x326276[_0x6d04('0x10')](0x194);}return _0xe8f198;};}function handleError(_0x2ddec6,_0x325c71){_0x325c71=_0x325c71||0x1f4;return function(_0xb2bd60){logger[_0x6d04('0x1f')](_0xb2bd60[_0x6d04('0x20')]);if(_0xb2bd60[_0x6d04('0x21')]){delete _0xb2bd60[_0x6d04('0x21')];}_0x2ddec6[_0x6d04('0x11')](_0x325c71)[_0x6d04('0x22')](_0xb2bd60);};}exports['show']=function(_0x1dc29b,_0x656654){var _0x6104a2={'raw':!![],'where':{'id':_0x1dc29b[_0x6d04('0x23')]['id']}},_0x292647={};_0x292647[_0x6d04('0x24')]=_['keys'](db[_0x6d04('0x25')][_0x6d04('0x26')]);_0x292647[_0x6d04('0x27')]=_[_0x6d04('0x28')](_0x1dc29b[_0x6d04('0x27')]);_0x292647['filters']=_['intersection'](_0x292647['model'],_0x292647['query']);_0x6104a2[_0x6d04('0x29')]=_['intersection'](_0x292647[_0x6d04('0x24')],qs['fields'](_0x1dc29b[_0x6d04('0x27')][_0x6d04('0x2a')]));_0x6104a2[_0x6d04('0x29')]=_0x6104a2[_0x6d04('0x29')][_0x6d04('0x2b')]?_0x6104a2[_0x6d04('0x29')]:_0x292647[_0x6d04('0x24')];if(_0x1dc29b[_0x6d04('0x27')][_0x6d04('0x2c')]){_0x6104a2[_0x6d04('0x2d')]=[{'all':!![]}];}_0x6104a2=_['merge']({},_0x6104a2,_0x1dc29b['options']);return db[_0x6d04('0x25')][_0x6d04('0x2e')](_0x6104a2)[_0x6d04('0x1d')](handleEntityNotFound(_0x656654,null))[_0x6d04('0x1d')](respondWithResult(_0x656654,null))['catch'](handleError(_0x656654,null));};exports[_0x6d04('0x2f')]=function(_0x3f680b,_0x40758d){return db[_0x6d04('0x25')]['create'](_0x3f680b[_0x6d04('0x30')],{})[_0x6d04('0x1d')](respondWithResult(_0x40758d,0xc9))[_0x6d04('0x31')](handleError(_0x40758d,null));};exports[_0x6d04('0x1c')]=function(_0x2f59ef,_0x185753){if(_0x2f59ef[_0x6d04('0x30')]['id']){delete _0x2f59ef[_0x6d04('0x30')]['id'];}return db[_0x6d04('0x25')][_0x6d04('0x2e')]({'where':{'id':_0x2f59ef[_0x6d04('0x23')]['id']}})[_0x6d04('0x1d')](handleEntityNotFound(_0x185753,null))[_0x6d04('0x1d')](saveUpdates(_0x2f59ef[_0x6d04('0x30')],null))[_0x6d04('0x1d')](respondWithResult(_0x185753,null))['catch'](handleError(_0x185753,null));};exports[_0x6d04('0x1e')]=function(_0x5bba32,_0x3ddbc1){return db[_0x6d04('0x25')]['find']({'where':{'id':_0x5bba32[_0x6d04('0x23')]['id']}})[_0x6d04('0x1d')](handleEntityNotFound(_0x3ddbc1,null))[_0x6d04('0x1d')](removeEntity(_0x3ddbc1,null))[_0x6d04('0x31')](handleError(_0x3ddbc1,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 50bd56c..50ffecf 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.model.js +++ b/server/api/chatProactiveAction/chatProactiveAction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3ad=['bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatProactiveAction','chat_proactive_actions','lodash','api','moment'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xc3ad,0xef));var _0xdc3a=function(_0x404d06,_0x1edbf7){_0x404d06=_0x404d06-0x0;var _0x37af7e=_0xc3ad[_0x404d06];return _0x37af7e;};'use strict';var _=require(_0xdc3a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdc3a('0x1'));var moment=require(_0xdc3a('0x2'));var BPromise=require(_0xdc3a('0x3'));var rp=require(_0xdc3a('0x4'));var fs=require('fs');var path=require(_0xdc3a('0x5'));var rimraf=require(_0xdc3a('0x6'));var config=require(_0xdc3a('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0xdc3a('0x8')]=function(_0x58dddc,_0x2ee140){return _0x58dddc['define'](_0xdc3a('0x9'),attributes,{'tableName':_0xdc3a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe619=['exports','ChatProactiveAction','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x8c8176,_0x5360a1){var _0x4dc47b=function(_0x1a7f65){while(--_0x1a7f65){_0x8c8176['push'](_0x8c8176['shift']());}};_0x4dc47b(++_0x5360a1);}(_0xe619,0x6e));var _0x9e61=function(_0x32bff9,_0x3f27d5){_0x32bff9=_0x32bff9-0x0;var _0xbab93=_0xe619[_0x32bff9];return _0xbab93;};'use strict';var _=require(_0x9e61('0x0'));var util=require(_0x9e61('0x1'));var logger=require(_0x9e61('0x2'))('api');var moment=require(_0x9e61('0x3'));var BPromise=require(_0x9e61('0x4'));var rp=require(_0x9e61('0x5'));var fs=require('fs');var path=require(_0x9e61('0x6'));var rimraf=require(_0x9e61('0x7'));var config=require(_0x9e61('0x8'));var attributes=require(_0x9e61('0x9'));module[_0x9e61('0xa')]=function(_0x24f036,_0x20482d){return _0x24f036['define'](_0x9e61('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 44336a6..b042a79 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js +++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb40c=['stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x30730f,_0x1656c5){var _0x2ebd16=function(_0x2842d9){while(--_0x2842d9){_0x30730f['push'](_0x30730f['shift']());}};_0x2ebd16(++_0x1656c5);}(_0xb40c,0x147));var _0xcb40=function(_0x4dd325,_0x500c22){_0x4dd325=_0x4dd325-0x0;var _0x5d3a01=_0xb40c[_0x4dd325];return _0x5d3a01;};'use strict';var _=require(_0xcb40('0x0'));var util=require('util');var moment=require(_0xcb40('0x1'));var BPromise=require(_0xcb40('0x2'));var rs=require(_0xcb40('0x3'));var fs=require('fs');var Redis=require(_0xcb40('0x4'));var db=require(_0xcb40('0x5'))['db'];var utils=require(_0xcb40('0x6'));var logger=require(_0xcb40('0x7'))(_0xcb40('0x8'));var config=require(_0xcb40('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcb40('0xa')][_0xcb40('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3179f2,_0x559631,_0x3924d6){return new BPromise(function(_0x2cbeca,_0x10e483){return client[_0xcb40('0xc')](_0x3179f2,_0x3924d6)[_0xcb40('0xd')](function(_0x5d8d66){logger[_0xcb40('0xe')](_0xcb40('0xf'),_0x559631,_0xcb40('0x10'));logger[_0xcb40('0x11')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x559631,_0xcb40('0x10'),JSON[_0xcb40('0x12')](_0x5d8d66));if(_0x5d8d66[_0xcb40('0x13')]){if(_0x5d8d66[_0xcb40('0x13')][_0xcb40('0x14')]===0x1f4){logger[_0xcb40('0x13')](_0xcb40('0xf'),_0x559631,_0x5d8d66[_0xcb40('0x13')][_0xcb40('0x15')]);return _0x10e483(_0x5d8d66[_0xcb40('0x13')][_0xcb40('0x15')]);}logger['error'](_0xcb40('0xf'),_0x559631,_0x5d8d66[_0xcb40('0x13')][_0xcb40('0x15')]);return _0x2cbeca(_0x5d8d66[_0xcb40('0x13')][_0xcb40('0x15')]);}else{logger[_0xcb40('0xe')](_0xcb40('0xf'),_0x559631,_0xcb40('0x10'));_0x2cbeca(_0x5d8d66[_0xcb40('0x16')][_0xcb40('0x15')]);}})['catch'](function(_0x37cab0){logger['error'](_0xcb40('0xf'),_0x559631,_0x37cab0);_0x10e483(_0x37cab0);});});} \ No newline at end of file +var _0x5192=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x5ea887,_0x5bb376){var _0x45c71b=function(_0x2353a3){while(--_0x2353a3){_0x5ea887['push'](_0x5ea887['shift']());}};_0x45c71b(++_0x5bb376);}(_0x5192,0x1e2));var _0x2519=function(_0x46cad2,_0xf7712e){_0x46cad2=_0x46cad2-0x0;var _0x232a60=_0x5192[_0x46cad2];return _0x232a60;};'use strict';var _=require(_0x2519('0x0'));var util=require(_0x2519('0x1'));var moment=require(_0x2519('0x2'));var BPromise=require('bluebird');var rs=require(_0x2519('0x3'));var fs=require('fs');var Redis=require(_0x2519('0x4'));var db=require(_0x2519('0x5'))['db'];var utils=require(_0x2519('0x6'));var logger=require(_0x2519('0x7'))('rpc');var config=require(_0x2519('0x8'));var jayson=require(_0x2519('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d8539,_0xdf571a,_0x1d6b01){return new BPromise(function(_0x2b6dbe,_0x4dac03){return client[_0x2519('0xa')](_0x5d8539,_0x1d6b01)[_0x2519('0xb')](function(_0x225e75){logger[_0x2519('0xc')](_0x2519('0xd'),_0xdf571a,_0x2519('0xe'));logger[_0x2519('0xf')](_0x2519('0x10'),_0xdf571a,_0x2519('0xe'),JSON[_0x2519('0x11')](_0x225e75));if(_0x225e75[_0x2519('0x12')]){if(_0x225e75[_0x2519('0x12')][_0x2519('0x13')]===0x1f4){logger[_0x2519('0x12')](_0x2519('0xd'),_0xdf571a,_0x225e75[_0x2519('0x12')][_0x2519('0x14')]);return _0x4dac03(_0x225e75[_0x2519('0x12')]['message']);}logger[_0x2519('0x12')](_0x2519('0xd'),_0xdf571a,_0x225e75['error'][_0x2519('0x14')]);return _0x2b6dbe(_0x225e75['error'][_0x2519('0x14')]);}else{logger[_0x2519('0xc')](_0x2519('0xd'),_0xdf571a,'request\x20sent');_0x2b6dbe(_0x225e75[_0x2519('0x15')][_0x2519('0x14')]);}})[_0x2519('0x16')](function(_0x260376){logger['error'](_0x2519('0xd'),_0xdf571a,_0x260376);_0x4dac03(_0x260376);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index cdeacbb..222bd54 100644 --- a/server/api/chatProactiveAction/index.js +++ b/server/api/chatProactiveAction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa57=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','post','isAuthenticated','create','put','update','delete','/:id'];(function(_0x266152,_0x51d4d1){var _0x3c00d0=function(_0x15d80e){while(--_0x15d80e){_0x266152['push'](_0x266152['shift']());}};_0x3c00d0(++_0x51d4d1);}(_0xfa57,0xe6));var _0x7fa5=function(_0x5685ca,_0x28558e){_0x5685ca=_0x5685ca-0x0;var _0x305ac0=_0xfa57[_0x5685ca];return _0x305ac0;};'use strict';var multer=require(_0x7fa5('0x0'));var util=require(_0x7fa5('0x1'));var path=require(_0x7fa5('0x2'));var timeout=require(_0x7fa5('0x3'));var express=require(_0x7fa5('0x4'));var router=express[_0x7fa5('0x5')]();var auth=require(_0x7fa5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7fa5('0x7'));var controller=require(_0x7fa5('0x8'));router[_0x7fa5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7fa5('0xa')]('/',auth[_0x7fa5('0xb')](),controller[_0x7fa5('0xc')]);router[_0x7fa5('0xd')]('/:id',auth[_0x7fa5('0xb')](),controller[_0x7fa5('0xe')]);router[_0x7fa5('0xf')](_0x7fa5('0x10'),auth[_0x7fa5('0xb')](),controller[_0x7fa5('0x11')]);module[_0x7fa5('0x12')]=router; \ No newline at end of file +var _0x45a8=['post','put','isAuthenticated','update','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show'];(function(_0x128b91,_0x42f4e4){var _0x726a3d=function(_0x57e5e4){while(--_0x57e5e4){_0x128b91['push'](_0x128b91['shift']());}};_0x726a3d(++_0x42f4e4);}(_0x45a8,0x9f));var _0x845a=function(_0x509491,_0x572a0f){_0x509491=_0x509491-0x0;var _0x3ba965=_0x45a8[_0x509491];return _0x3ba965;};'use strict';var multer=require(_0x845a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x845a('0x1'));var express=require(_0x845a('0x2'));var router=express[_0x845a('0x3')]();var auth=require(_0x845a('0x4'));var interaction=require(_0x845a('0x5'));var config=require(_0x845a('0x6'));var controller=require(_0x845a('0x7'));router[_0x845a('0x8')](_0x845a('0x9'),auth['isAuthenticated'](),controller[_0x845a('0xa')]);router[_0x845a('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x845a('0xc')](_0x845a('0x9'),auth[_0x845a('0xd')](),controller[_0x845a('0xe')]);router['delete'](_0x845a('0x9'),auth[_0x845a('0xd')](),controller[_0x845a('0xf')]);module[_0x845a('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 22f8663..dd29edf 100644 --- a/server/api/chatQueue/chatQueue.attributes.js +++ b/server/api/chatQueue/chatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ea1=['roundrobin','sequelize','exports','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x576864,_0x5be987){var _0x2a2f43=function(_0x1924d3){while(--_0x1924d3){_0x576864['push'](_0x576864['shift']());}};_0x2a2f43(++_0x5be987);}(_0x1ea1,0x91));var _0x11ea=function(_0x2f1ed4,_0x5b06cc){_0x2f1ed4=_0x2f1ed4-0x0;var _0x573cd3=_0x1ea1[_0x2f1ed4];return _0x573cd3;};'use strict';var Sequelize=require(_0x11ea('0x0'));module[_0x11ea('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x11ea('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x11ea('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x11ea('0x4')](_0x11ea('0x5'),_0x11ea('0x6'),_0x11ea('0x7'))}}; \ No newline at end of file +var _0x747d=['name','beepall','roundrobin','sequelize','STRING'];(function(_0x2d76c8,_0x122dd6){var _0x5811e7=function(_0x4694b8){while(--_0x4694b8){_0x2d76c8['push'](_0x2d76c8['shift']());}};_0x5811e7(++_0x122dd6);}(_0x747d,0x1ed));var _0xd747=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x747d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd747('0x0'));module['exports']={'name':{'type':Sequelize[_0xd747('0x1')],'unique':_0xd747('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd747('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xd747('0x3'),_0xd747('0x4'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 9b76215..aef5318 100644 --- a/server/api/chatQueue/chatQueue.controller.js +++ b/server/api/chatQueue/chatQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x291d=['localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','get','UserProfileResource','end','stack','send','index','ChatQueue','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','sort','where','pick','type','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','destroy','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','map','User','agent','chatPause','updatedAt','createdAt','%s/%s','getTeams','Team','addTeams','teams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','union','compact','value','ids','isEmpty','addAgents','spread','removeAgents','userChatQueue:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','redis','defaults'];(function(_0x28ad83,_0x3b7f20){var _0xb3bc91=function(_0x3a007d){while(--_0x3a007d){_0x28ad83['push'](_0x28ad83['shift']());}};_0xb3bc91(++_0x3b7f20);}(_0x291d,0x7a));var _0xd291=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x291d[_0x21aec3];return _0x288bbc;};'use strict';var pdf=require(_0xd291('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd291('0x1'));var zipdir=require(_0xd291('0x2'));var jsonpatch=require(_0xd291('0x3'));var rp=require(_0xd291('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd291('0x5'));var util=require(_0xd291('0x6'));var path=require('path');var sox=require(_0xd291('0x7'));var csv=require(_0xd291('0x8'));var ejs=require(_0xd291('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd291('0xa'));var crypto=require('crypto');var jsforce=require(_0xd291('0xb'));var deskjs=require(_0xd291('0xc'));var toCsv=require(_0xd291('0x8'));var querystring=require('querystring');var Papa=require(_0xd291('0xd'));var Redis=require(_0xd291('0xe'));var authService=require(_0xd291('0xf'));var qs=require(_0xd291('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd291('0x11'))('api');var utils=require(_0xd291('0x12'));var config=require(_0xd291('0x13'));var db=require('../../mysqldb')['db'];config[_0xd291('0x14')]=_[_0xd291('0x15')](config[_0xd291('0x14')],{'host':_0xd291('0x16'),'port':0x18eb});var socket=require(_0xd291('0x17'))(new Redis(config['redis']));require(_0xd291('0x18'))['register'](socket);var jayson=require(_0xd291('0x19'));var client=jayson[_0xd291('0x1a')][_0xd291('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5be10e,_0x44bca1,_0x311c5e){if(_0x311c5e){var _0x1c2b28=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c2b28['test'](_0x44bca1)){return _0x5be10e;}else{throw new Error(_0xd291('0x1c'));}}else{return _0x5be10e;}}function respondWithRpcPromise(_0x5acec7,_0x51899e,_0x4fa9df,_0xacd65b){return new BPromise(function(_0xcd5615,_0x328444){var _0x15df15=_0xacd65b||client;return _0x15df15[_0xd291('0x1d')](_0x5acec7,_0x4fa9df)[_0xd291('0x1e')](function(_0x412731){logger[_0xd291('0x1f')](_0xd291('0x20'),_0x51899e,_0xd291('0x21'));logger[_0xd291('0x22')](_0xd291('0x23'),_0x51899e,_0xd291('0x21'),JSON[_0xd291('0x24')](_0x412731));if(_0x412731[_0xd291('0x25')]){if(_0x412731[_0xd291('0x25')]['code']===0x1f4){logger[_0xd291('0x25')](_0xd291('0x20'),_0x51899e,_0x412731[_0xd291('0x25')][_0xd291('0x26')]);return _0x328444(_0x412731[_0xd291('0x25')][_0xd291('0x26')]);}logger[_0xd291('0x25')](_0xd291('0x20'),_0x51899e,_0x412731[_0xd291('0x25')][_0xd291('0x26')]);return _0xcd5615(_0x412731['error'][_0xd291('0x26')]);}else{logger[_0xd291('0x1f')](_0xd291('0x20'),_0x51899e,'request\x20sent');_0xcd5615(_0x412731[_0xd291('0x27')]['message']);}})[_0xd291('0x28')](function(_0x4cdd5b){logger['error']('ChatQueue,\x20%s,\x20%s',_0x51899e,_0x4cdd5b);_0x328444(_0x4cdd5b);});});}function respondWithStatusCode(_0x4e6349,_0x32a921){_0x32a921=_0x32a921||0xcc;return function(_0x5288a3){if(_0x5288a3){return _0x4e6349[_0xd291('0x29')](_0x32a921);}return _0x4e6349['status'](_0x32a921)['end']();};}function respondWithResult(_0x30207b,_0x59b265){_0x59b265=_0x59b265||0xc8;return function(_0x566fb1){if(_0x566fb1){return _0x30207b[_0xd291('0x2a')](_0x59b265)[_0xd291('0x2b')](_0x566fb1);}};}function respondWithFilteredResult(_0x57213d,_0x4a0cea){return function(_0x229d36){if(_0x229d36){var _0x193316=_0x229d36[_0xd291('0x2c')],_0x4dfa19=_0x4a0cea[_0xd291('0x2d')],_0x97e478=_0x4a0cea[_0xd291('0x2d')]+_0x4a0cea[_0xd291('0x2e')],_0x281df2;if(_0x97e478>=_0x193316){_0x97e478=_0x193316;_0x281df2=0xc8;}else{_0x281df2=0xce;}_0x57213d['status'](_0x281df2);return _0x57213d[_0xd291('0x2f')](_0xd291('0x30'),_0x4dfa19+'-'+_0x97e478+'/'+_0x193316)['json'](_0x229d36);}return null;};}function patchUpdates(_0x1a9782){return function(_0x6b0f6f){try{jsonpatch['apply'](_0x6b0f6f,_0x1a9782,!![]);}catch(_0x7ce741){return BPromise[_0xd291('0x31')](_0x7ce741);}return _0x6b0f6f['save']();};}function saveUpdates(_0x2ba151,_0x3fac45){return function(_0x2e1a22){if(_0x2e1a22){return _0x2e1a22['update'](_0x2ba151)[_0xd291('0x1e')](function(_0x3b4de6){return _0x3b4de6;});}return null;};}function removeEntity(_0x250d4e,_0x3acd7f){return function(_0x355504){if(_0x355504){return _0x355504['destroy']()[_0xd291('0x1e')](function(){var _0xb5ae9e=_0x355504[_0xd291('0x32')]({'plain':!![]});var _0x57be7b='ChatQueues';return db[_0xd291('0x33')]['destroy']({'where':{'type':_0x57be7b,'resourceId':_0xb5ae9e['id']}})[_0xd291('0x1e')](function(){return _0x355504;});})[_0xd291('0x1e')](function(){_0x250d4e[_0xd291('0x2a')](0xcc)[_0xd291('0x34')]();});}};}function handleEntityNotFound(_0x29e71a,_0x739dd1){return function(_0x93c175){if(!_0x93c175){_0x29e71a['sendStatus'](0x194);}return _0x93c175;};}function handleError(_0x32cb70,_0x34b29f){_0x34b29f=_0x34b29f||0x1f4;return function(_0x4acc03){logger[_0xd291('0x25')](_0x4acc03[_0xd291('0x35')]);if(_0x4acc03['name']){delete _0x4acc03['name'];}_0x32cb70[_0xd291('0x2a')](_0x34b29f)[_0xd291('0x36')](_0x4acc03);};}exports[_0xd291('0x37')]=function(_0x48231c,_0x5be32f){var _0x5dcb08={},_0xa11c60={},_0xea3eec={'count':0x0,'rows':[]};var _0x1bdd57=db[_0xd291('0x38')][_0xd291('0x39')];_0xa11c60[_0xd291('0x3a')]=_[_0xd291('0x3b')](_0x1bdd57);_0xa11c60[_0xd291('0x3c')]=_[_0xd291('0x3b')](_0x48231c[_0xd291('0x3c')]);_0xa11c60[_0xd291('0x3d')]=_['intersection'](_0xa11c60[_0xd291('0x3a')],_0xa11c60['query']);_0x5dcb08[_0xd291('0x3e')]=_[_0xd291('0x3f')](_0xa11c60[_0xd291('0x3a')],qs[_0xd291('0x40')](_0x48231c[_0xd291('0x3c')]['fields']));_0x5dcb08[_0xd291('0x3e')]=_0x5dcb08['attributes'][_0xd291('0x41')]?_0x5dcb08[_0xd291('0x3e')]:_0xa11c60[_0xd291('0x3a')];if(!_0x48231c['query']['hasOwnProperty']('nolimit')){_0x5dcb08[_0xd291('0x2e')]=qs['limit'](_0x48231c[_0xd291('0x3c')][_0xd291('0x2e')]);_0x5dcb08['offset']=qs[_0xd291('0x2d')](_0x48231c[_0xd291('0x3c')][_0xd291('0x2d')]);}_0x5dcb08['order']=qs[_0xd291('0x42')](_0x48231c[_0xd291('0x3c')][_0xd291('0x42')]);_0x5dcb08[_0xd291('0x43')]=qs['filters'](_[_0xd291('0x44')](_0x48231c['query'],_0xa11c60[_0xd291('0x3d')]));if(_0x48231c[_0xd291('0x3c')]['filter']){_0x5dcb08[_0xd291('0x43')]=_['merge'](_0x5dcb08['where'],{'$or':_['map'](_0x1bdd57,function(_0x33b9b6){if(_0x33b9b6[_0xd291('0x45')]['key']!==_0xd291('0x46')){var _0x1b60d2={};_0x1b60d2[_0x33b9b6[_0xd291('0x47')]]={'$like':'%'+_0x48231c[_0xd291('0x3c')][_0xd291('0x48')]+'%'};return _0x1b60d2;}})});}_0x5dcb08=_[_0xd291('0x49')]({},_0x5dcb08,_0x48231c[_0xd291('0x4a')]);var _0x37a0e4={'where':_0x5dcb08[_0xd291('0x43')]};return db[_0xd291('0x38')][_0xd291('0x2c')](_0x37a0e4)[_0xd291('0x1e')](function(_0x565bbb){_0xea3eec[_0xd291('0x2c')]=_0x565bbb;if(_0x48231c[_0xd291('0x3c')][_0xd291('0x4b')]){_0x5dcb08[_0xd291('0x4c')]=[{'all':!![]}];}return db[_0xd291('0x38')][_0xd291('0x4d')](_0x5dcb08);})[_0xd291('0x1e')](function(_0x1f1e3e){_0xea3eec[_0xd291('0x4e')]=_0x1f1e3e;return _0xea3eec;})[_0xd291('0x1e')](respondWithFilteredResult(_0x5be32f,_0x5dcb08))[_0xd291('0x28')](handleError(_0x5be32f,null));};exports['show']=function(_0x4a71b0,_0x1f5ee3){var _0x4fbc69={'raw':!![],'where':{'id':_0x4a71b0['params']['id']}},_0x5c7286={};_0x5c7286[_0xd291('0x3a')]=_[_0xd291('0x3b')](db[_0xd291('0x38')][_0xd291('0x39')]);_0x5c7286[_0xd291('0x3c')]=_[_0xd291('0x3b')](_0x4a71b0[_0xd291('0x3c')]);_0x5c7286['filters']=_[_0xd291('0x3f')](_0x5c7286[_0xd291('0x3a')],_0x5c7286[_0xd291('0x3c')]);_0x4fbc69[_0xd291('0x3e')]=_[_0xd291('0x3f')](_0x5c7286[_0xd291('0x3a')],qs[_0xd291('0x40')](_0x4a71b0['query']['fields']));_0x4fbc69[_0xd291('0x3e')]=_0x4fbc69['attributes'][_0xd291('0x41')]?_0x4fbc69['attributes']:_0x5c7286[_0xd291('0x3a')];if(_0x4a71b0[_0xd291('0x3c')]['includeAll']){_0x4fbc69[_0xd291('0x4c')]=[{'all':!![]}];}_0x4fbc69=_['merge']({},_0x4fbc69,_0x4a71b0['options']);return db['ChatQueue'][_0xd291('0x4f')](_0x4fbc69)[_0xd291('0x1e')](handleEntityNotFound(_0x1f5ee3,null))[_0xd291('0x1e')](respondWithResult(_0x1f5ee3,null))[_0xd291('0x28')](handleError(_0x1f5ee3,null));};exports[_0xd291('0x50')]=function(_0x48c679,_0x21ee3c){return db[_0xd291('0x38')][_0xd291('0x50')](_0x48c679['body'],{})[_0xd291('0x1e')](function(_0x51ca58){var _0x27c141=_0x48c679[_0xd291('0x51')]['get']({'plain':!![]});if(!_0x27c141)throw new Error(_0xd291('0x52'));if(_0x27c141[_0xd291('0x53')]===_0xd291('0x51')){var _0x54ea67=_0x51ca58[_0xd291('0x32')]({'plain':!![]});var _0x12a8fb=_0xd291('0x54');return db[_0xd291('0x55')]['find']({'where':{'name':_0x12a8fb,'userProfileId':_0x27c141['userProfileId']},'raw':!![]})[_0xd291('0x1e')](function(_0x279cd4){if(_0x279cd4&&_0x279cd4[_0xd291('0x56')]===0x0){return db[_0xd291('0x33')][_0xd291('0x50')]({'name':_0x54ea67[_0xd291('0x57')],'resourceId':_0x54ea67['id'],'type':_0x279cd4['name'],'sectionId':_0x279cd4['id']},{})['then'](function(){return _0x51ca58;});}else{return _0x51ca58;}})[_0xd291('0x28')](function(_0x12d685){logger['error'](_0xd291('0x58'),_0x12d685);throw _0x12d685;});}return _0x51ca58;})[_0xd291('0x1e')](respondWithResult(_0x21ee3c,0xc9))[_0xd291('0x28')](handleError(_0x21ee3c,null));};exports[_0xd291('0x59')]=function(_0x5caca9,_0x30eec9){if(_0x5caca9['body']['id']){delete _0x5caca9[_0xd291('0x5a')]['id'];}return db['ChatQueue'][_0xd291('0x4f')]({'where':{'id':_0x5caca9[_0xd291('0x5b')]['id']}})[_0xd291('0x1e')](handleEntityNotFound(_0x30eec9,null))[_0xd291('0x1e')](saveUpdates(_0x5caca9['body'],null))['then'](respondWithResult(_0x30eec9,null))[_0xd291('0x28')](handleError(_0x30eec9,null));};exports[_0xd291('0x5c')]=function(_0x186901,_0x175def){return db[_0xd291('0x38')][_0xd291('0x4f')]({'where':{'id':_0x186901[_0xd291('0x5b')]['id']}})[_0xd291('0x1e')](handleEntityNotFound(_0x175def,null))[_0xd291('0x1e')](removeEntity(_0x175def,null))[_0xd291('0x28')](handleError(_0x175def,null));};exports[_0xd291('0x5d')]=function(_0x10a46c,_0x1494fe){return db[_0xd291('0x38')][_0xd291('0x5d')]()['then'](respondWithResult(_0x1494fe,null))[_0xd291('0x28')](handleError(_0x1494fe,null));};exports[_0xd291('0x5e')]=function(_0x427387,_0x4e2c7c,_0x9ee6ad){var _0x1b392f={'raw':!![],'where':{}},_0xb3c14d={},_0x1d7ca3;return db[_0xd291('0x38')][_0xd291('0x5f')]({'where':{'id':_0x427387[_0xd291('0x5b')]['id']}})[_0xd291('0x1e')](handleEntityNotFound(_0x4e2c7c,null))[_0xd291('0x1e')](function(_0x9fda4){if(_0x9fda4){_0x1d7ca3=_0x9fda4[_0xd291('0x32')]({'plain':!![]});_0xb3c14d[_0xd291('0x3a')]=_[_0xd291('0x3b')](db[_0xd291('0x60')][_0xd291('0x39')]);_0xb3c14d[_0xd291('0x3c')]=_[_0xd291('0x3b')](_0x427387['query']);_0xb3c14d[_0xd291('0x3d')]=_[_0xd291('0x3f')](_0xb3c14d[_0xd291('0x3a')],_0xb3c14d[_0xd291('0x3c')]);_0x1b392f[_0xd291('0x3e')]=_[_0xd291('0x3f')](_0xb3c14d[_0xd291('0x3a')],qs['fields'](_0x427387[_0xd291('0x3c')][_0xd291('0x40')]));_0x1b392f[_0xd291('0x3e')]=_0x1b392f['attributes'][_0xd291('0x41')]?_0x1b392f['attributes']:_0xb3c14d[_0xd291('0x3a')];if(!_0x427387['query'][_0xd291('0x61')](_0xd291('0x62'))){_0x1b392f[_0xd291('0x2e')]=qs[_0xd291('0x2e')](_0x427387['query'][_0xd291('0x2e')]);_0x1b392f[_0xd291('0x2d')]=qs['offset'](_0x427387['query'][_0xd291('0x2d')]);}_0x1b392f[_0xd291('0x63')]=qs[_0xd291('0x42')](_0x427387[_0xd291('0x3c')][_0xd291('0x42')]);_0x1b392f['where']=qs['filters'](_['pick'](_0x427387[_0xd291('0x3c')],_0xb3c14d[_0xd291('0x3d')]));_0x1b392f[_0xd291('0x43')]['ChatQueueId']=_0x9fda4['id'];if(_0x427387['query'][_0xd291('0x48')]){_0x1b392f[_0xd291('0x43')]=_[_0xd291('0x49')](_0x1b392f[_0xd291('0x43')],{'$or':_[_0xd291('0x64')](_0x1b392f[_0xd291('0x3e')],function(_0x287b5d){var _0x17e7ca={};_0x17e7ca[_0x287b5d]={'$like':'%'+_0x427387[_0xd291('0x3c')][_0xd291('0x48')]+'%'};return _0x17e7ca;})});}_0x1b392f=_['merge']({},_0x1b392f,_0x427387[_0xd291('0x4a')]);return db['UserChatQueue'][_0xd291('0x4d')](_0x1b392f);}})[_0xd291('0x1e')](function(_0x2bfb64){if(_0x2bfb64){return db[_0xd291('0x65')]['findAndCountAll']({'where':{'id':_[_0xd291('0x64')](_0x2bfb64,'UserId'),'role':_0xd291('0x66')},'attributes':['id',_0xd291('0x57'),_0xd291('0x67'),_0xd291('0x68'),_0xd291('0x69')]});}})[_0xd291('0x1e')](function(_0x18f260){if(_0x18f260){return{'count':_0x18f260[_0xd291('0x2c')],'rows':_[_0xd291('0x64')](_0x18f260[_0xd291('0x4e')],function(_0xf2ab5b){return{'membername':_0xf2ab5b[_0xd291('0x57')],'UserId':_0xf2ab5b['id'],'queue_name':_0x1d7ca3[_0xd291('0x57')],'ChatQueueId':_0x1d7ca3['id'],'interface':util['format'](_0xd291('0x6a'),'SIP',_0xf2ab5b['name']),'penalty':0x0,'paused':_0xf2ab5b[_0xd291('0x67')],'createdAt':_0xf2ab5b[_0xd291('0x69')],'updatedAt':_0xf2ab5b[_0xd291('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd291('0x1e')](respondWithFilteredResult(_0x4e2c7c,_0x1b392f))[_0xd291('0x28')](handleError(_0x4e2c7c,null));};exports[_0xd291('0x6b')]=function(_0x36f862,_0x3b3e8d,_0x3a75b6){var _0xcd4e36={};var _0x3453e7={};var _0x8b80ae;var _0x434220;return db['ChatQueue'][_0xd291('0x5f')]({'where':{'id':_0x36f862['params']['id']}})[_0xd291('0x1e')](handleEntityNotFound(_0x3b3e8d,null))[_0xd291('0x1e')](function(_0x22682d){if(_0x22682d){_0x8b80ae=_0x22682d;_0x3453e7[_0xd291('0x3a')]=_[_0xd291('0x3b')](db[_0xd291('0x6c')][_0xd291('0x39')]);_0x3453e7[_0xd291('0x3c')]=_[_0xd291('0x3b')](_0x36f862['query']);_0x3453e7[_0xd291('0x3d')]=_[_0xd291('0x3f')](_0x3453e7[_0xd291('0x3a')],_0x3453e7['query']);_0xcd4e36[_0xd291('0x3e')]=_[_0xd291('0x3f')](_0x3453e7['model'],qs[_0xd291('0x40')](_0x36f862[_0xd291('0x3c')][_0xd291('0x40')]));_0xcd4e36[_0xd291('0x3e')]=_0xcd4e36['attributes'][_0xd291('0x41')]?_0xcd4e36[_0xd291('0x3e')]:_0x3453e7['model'];_0xcd4e36[_0xd291('0x63')]=qs[_0xd291('0x42')](_0x36f862[_0xd291('0x3c')]['sort']);_0xcd4e36[_0xd291('0x43')]=qs[_0xd291('0x3d')](_['pick'](_0x36f862[_0xd291('0x3c')],_0x3453e7[_0xd291('0x3d')]));if(_0x36f862[_0xd291('0x3c')][_0xd291('0x48')]){_0xcd4e36['where']=_[_0xd291('0x49')](_0xcd4e36[_0xd291('0x43')],{'$or':_['map'](_0xcd4e36[_0xd291('0x3e')],function(_0x3daaeb){var _0x4d94c6={};_0x4d94c6[_0x3daaeb]={'$like':'%'+_0x36f862[_0xd291('0x3c')][_0xd291('0x48')]+'%'};return _0x4d94c6;})});}_0xcd4e36=_['merge']({},_0xcd4e36,_0x36f862[_0xd291('0x4a')]);return _0x8b80ae[_0xd291('0x6b')](_0xcd4e36);}})[_0xd291('0x1e')](function(_0x462d8b){if(_0x462d8b){_0x434220=_0x462d8b[_0xd291('0x41')];if(!_0x36f862[_0xd291('0x3c')]['hasOwnProperty'](_0xd291('0x62'))){_0xcd4e36['limit']=qs[_0xd291('0x2e')](_0x36f862['query'][_0xd291('0x2e')]);_0xcd4e36['offset']=qs[_0xd291('0x2d')](_0x36f862[_0xd291('0x3c')][_0xd291('0x2d')]);}return _0x8b80ae[_0xd291('0x6b')](_0xcd4e36);}})[_0xd291('0x1e')](function(_0x3ff706){if(_0x3ff706){return _0x3ff706?{'count':_0x434220,'rows':_0x3ff706}:null;}})['then'](respondWithResult(_0x3b3e8d,null))[_0xd291('0x28')](handleError(_0x3b3e8d,null));};exports[_0xd291('0x6d')]=function(_0x2978b2,_0x162ac6,_0x24585a){var _0x4c1feb=_0x2978b2[_0xd291('0x5a')][_0xd291('0x6e')];return db[_0xd291('0x6c')][_0xd291('0x4d')]({'where':{'id':_[_0xd291('0x64')](_0x4c1feb,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd291('0x6f'),'attributes':['id',_0xd291('0x57'),_0xd291('0x70'),_0xd291('0x71'),_0xd291('0x72')],'raw':!![]}]})[_0xd291('0x1e')](function(_0x579e6c){if(_0x579e6c){var _0x4696aa=_[_0xd291('0x73')](_0x579e6c,function(_0x4adaf7){var _0x79a849=_0x4adaf7[_0xd291('0x32')]({'plain':!![]});return _0x79a849[_0xd291('0x6f')];});return db[_0xd291('0x38')][_0xd291('0x4f')]({'where':{'id':_0x2978b2[_0xd291('0x5b')]['id']}})[_0xd291('0x1e')](function(_0x326627){return db[_0xd291('0x74')][_0xd291('0x75')](function(_0x247fbc){return _0x326627[_0xd291('0x6d')](_[_0xd291('0x64')](_0x4c1feb,'id'),{'transaction':_0x247fbc})[_0xd291('0x1e')](function(){return BPromise[_0xd291('0x76')](_0x4696aa,function(_0x594430){return db[_0xd291('0x60')]['findOrCreate']({'where':{'UserId':_0x594430['id'],'ChatQueueId':_0x2978b2['params']['id']},'transaction':_0x247fbc});});})[_0xd291('0x1e')](function(){_0x4696aa[_0xd291('0x77')](function(_0x49621e){socket[_0xd291('0x78')](_0xd291('0x79'),{'UserId':_0x49621e['id'],'ChatQueueId':_0x326627['id']});});});});});}})[_0xd291('0x1e')](respondWithStatusCode(_0x162ac6,null))[_0xd291('0x28')](handleError(_0x162ac6,null));};exports[_0xd291('0x7a')]=function(_0x5227a4,_0x35895a,_0xdd8365){return db[_0xd291('0x6c')]['findAll']({'where':{'id':_0x5227a4[_0xd291('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd291('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd291('0x1e')](handleEntityNotFound(_0x35895a,null))[_0xd291('0x1e')](function(_0x405287){var _0x3f4b9a=_[_0xd291('0x64')](_0x405287,'id');var _0x5168a3=[];var _0x4b8dc3=[];var _0x1c575a=squel[_0xd291('0x7b')]();_0x1c575a[_0xd291('0x47')](_0xd291('0x7c'))['from']('team_has_chat_queues','tq')['join'](_0xd291('0x7d'),'ut',_0xd291('0x7e'))[_0xd291('0x43')](_0xd291('0x7f'),_0x5227a4['params']['id']);for(var _0x40c9f3=0x0;_0x40c9f3<_0x405287[_0xd291('0x41')];_0x40c9f3+=0x1){let _0x120f51=_0x405287[_0x40c9f3];for(var _0x1a142d=0x0;_0x1a142d<_0x120f51[_0xd291('0x6f')][_0xd291('0x41')];_0x1a142d+=0x1){let _0x3de909=_0x120f51[_0xd291('0x6f')][_0x1a142d];var _0x385817=_0x1c575a['clone']();_0x385817[_0xd291('0x43')](_0xd291('0x80'),_0x3de909['id']);_0x4b8dc3[_0xd291('0x81')](db[_0xd291('0x74')]['query'](_0x385817['toString'](),{'type':db[_0xd291('0x74')][_0xd291('0x82')][_0xd291('0x83')]})[_0xd291('0x1e')](function(_0x51c865){if(_0x51c865[_0xd291('0x41')]===0x1){return _0x3de909['id'];}else{var _0x362314=_['every'](_[_0xd291('0x64')](_0x51c865,_0xd291('0x84')),function(_0x513201){return _['includes'](_0x3f4b9a,_0x513201);});if(_0x362314){return _0x3de909['id'];}}}));}}return BPromise[_0xd291('0x85')](_0x4b8dc3)[_0xd291('0x1e')](function(_0x4b19c4){_0x5168a3=_(_0x5168a3)[_0xd291('0x86')](_0x4b19c4)[_0xd291('0x87')]()[_0xd291('0x88')]();return db[_0xd291('0x38')][_0xd291('0x4f')]({'where':{'id':_0x5227a4[_0xd291('0x5b')]['id']}})[_0xd291('0x1e')](function(_0x37e349){return db[_0xd291('0x74')]['transaction'](function(_0x354c46){return _0x37e349[_0xd291('0x7a')](_0x5227a4[_0xd291('0x3c')][_0xd291('0x89')],{'transaction':_0x354c46})['then'](function(){if(!_[_0xd291('0x8a')](_0x5168a3)){return _0x37e349['removeAgents'](_0x5168a3,{'transaction':_0x354c46});}})['then'](function(){_0x5168a3[_0xd291('0x77')](function(_0x28fa75){socket[_0xd291('0x78')]('userChatQueue:remove',{'UserId':_0x28fa75,'ChatQueueId':_0x37e349['id']});});});});});});})[_0xd291('0x1e')](respondWithStatusCode(_0x35895a,null))[_0xd291('0x28')](handleError(_0x35895a,null));};exports[_0xd291('0x8b')]=function(_0xe5de1b,_0x9e777a,_0xc64197){return db['ChatQueue'][_0xd291('0x4f')]({'where':{'id':_0xe5de1b[_0xd291('0x5b')]['id']}})[_0xd291('0x1e')](handleEntityNotFound(_0x9e777a,null))[_0xd291('0x1e')](function(_0x2cec78){if(_0x2cec78){return _0x2cec78[_0xd291('0x8b')](_0xe5de1b[_0xd291('0x5a')][_0xd291('0x89')],_['omit'](_0xe5de1b[_0xd291('0x5a')],[_0xd291('0x89'),'id'])||{})[_0xd291('0x8c')](function(_0x4ba5ca){for(var _0x567875=0x0;_0x567875<_0xe5de1b[_0xd291('0x5a')][_0xd291('0x89')][_0xd291('0x41')];_0x567875+=0x1){socket[_0xd291('0x78')](_0xd291('0x79'),{'UserId':_0xe5de1b[_0xd291('0x5a')]['ids'][_0x567875],'ChatQueueId':_0xe5de1b['params']['id']});}return _0x4ba5ca;});}})[_0xd291('0x1e')](respondWithResult(_0x9e777a,null))['catch'](handleError(_0x9e777a,null));};exports[_0xd291('0x8d')]=function(_0x46930c,_0x57fac2,_0x21e8ee){return db[_0xd291('0x38')][_0xd291('0x4f')]({'where':{'id':_0x46930c['params']['id']}})[_0xd291('0x1e')](handleEntityNotFound(_0x57fac2,null))['then'](function(_0x5ed330){if(_0x5ed330){return _0x5ed330['removeAgents'](_0x46930c[_0xd291('0x3c')][_0xd291('0x89')])[_0xd291('0x1e')](function(){if(_['isArray'](_0x46930c[_0xd291('0x3c')][_0xd291('0x89')])){for(var _0x1409ba=0x0;_0x1409ba<_0x46930c[_0xd291('0x3c')][_0xd291('0x89')]['length'];_0x1409ba+=0x1){socket[_0xd291('0x78')](_0xd291('0x8e'),{'UserId':Number(_0x46930c[_0xd291('0x3c')][_0xd291('0x89')][_0x1409ba]),'ChatQueueId':Number(_0x46930c[_0xd291('0x5b')]['id'])});}}else{socket['emit'](_0xd291('0x8e'),{'UserId':Number(_0x46930c[_0xd291('0x3c')][_0xd291('0x89')]),'ChatQueueId':Number(_0x46930c[_0xd291('0x5b')]['id'])});}});}})[_0xd291('0x1e')](respondWithStatusCode(_0x57fac2,null))[_0xd291('0x28')](handleError(_0x57fac2,null));};exports[_0xd291('0x8f')]=function(_0xcc191e,_0x1f5c5f,_0x16a8de){var _0x553503={};var _0x20e5af={};var _0x3c022a;var _0x5da4d4;return db[_0xd291('0x38')]['findOne']({'where':{'id':_0xcc191e[_0xd291('0x5b')]['id']}})[_0xd291('0x1e')](handleEntityNotFound(_0x1f5c5f,null))[_0xd291('0x1e')](function(_0x104ce0){if(_0x104ce0){_0x3c022a=_0x104ce0;_0x20e5af[_0xd291('0x3a')]=_[_0xd291('0x3b')](db['User'][_0xd291('0x39')]);_0x20e5af[_0xd291('0x3c')]=_[_0xd291('0x3b')](_0xcc191e['query']);_0x20e5af[_0xd291('0x3d')]=_[_0xd291('0x3f')](_0x20e5af['model'],_0x20e5af[_0xd291('0x3c')]);_0x553503['attributes']=_[_0xd291('0x3f')](_0x20e5af[_0xd291('0x3a')],qs['fields'](_0xcc191e[_0xd291('0x3c')][_0xd291('0x40')]));_0x553503[_0xd291('0x3e')]=_0x553503['attributes'][_0xd291('0x41')]?_0x553503['attributes']:_0x20e5af['model'];_0x553503[_0xd291('0x63')]=qs[_0xd291('0x42')](_0xcc191e[_0xd291('0x3c')][_0xd291('0x42')]);_0x553503[_0xd291('0x43')]=qs['filters'](_[_0xd291('0x44')](_0xcc191e[_0xd291('0x3c')],_0x20e5af['filters']));if(_0xcc191e[_0xd291('0x3c')][_0xd291('0x48')]){_0x553503['where']=_[_0xd291('0x49')](_0x553503[_0xd291('0x43')],{'$or':_['map'](_0x553503[_0xd291('0x3e')],function(_0xb0fcd9){var _0x16b4c4={};_0x16b4c4[_0xb0fcd9]={'$like':'%'+_0xcc191e[_0xd291('0x3c')][_0xd291('0x48')]+'%'};return _0x16b4c4;})});}_0x553503=_[_0xd291('0x49')]({},_0x553503,_0xcc191e[_0xd291('0x4a')]);return _0x3c022a[_0xd291('0x8f')](_0x553503);}})[_0xd291('0x1e')](function(_0x214fc6){if(_0x214fc6){_0x5da4d4=_0x214fc6[_0xd291('0x41')];if(!_0xcc191e[_0xd291('0x3c')][_0xd291('0x61')](_0xd291('0x62'))){_0x553503[_0xd291('0x2e')]=qs[_0xd291('0x2e')](_0xcc191e[_0xd291('0x3c')][_0xd291('0x2e')]);_0x553503[_0xd291('0x2d')]=qs[_0xd291('0x2d')](_0xcc191e['query']['offset']);}return _0x3c022a[_0xd291('0x8f')](_0x553503);}})[_0xd291('0x1e')](function(_0x561827){if(_0x561827){return _0x561827?{'count':_0x5da4d4,'rows':_0x561827}:null;}})[_0xd291('0x1e')](respondWithResult(_0x1f5c5f,null))['catch'](handleError(_0x1f5c5f,null));}; \ No newline at end of file +var _0x42d1=['findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','Team','getTeams','addTeams','Agents','online','interface','sequelize','transaction','each','emit','userChatQueue:save','ids','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','compact','removeTeams','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','isArray','getAgents','html-pdf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatQueue.socket','register','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','ChatQueue','rawAttributes','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','findAll','rows','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User'];(function(_0x5e0ec4,_0x29dda5){var _0x104e61=function(_0x5b9f53){while(--_0x5b9f53){_0x5e0ec4['push'](_0x5e0ec4['shift']());}};_0x104e61(++_0x29dda5);}(_0x42d1,0xc5));var _0x142d=function(_0x23c284,_0x436efd){_0x23c284=_0x23c284-0x0;var _0x5da5ca=_0x42d1[_0x23c284];return _0x5da5ca;};'use strict';var pdf=require(_0x142d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x142d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x142d('0x2'));var moment=require('moment');var BPromise=require(_0x142d('0x3'));var Mustache=require(_0x142d('0x4'));var util=require(_0x142d('0x5'));var path=require('path');var sox=require(_0x142d('0x6'));var csv=require(_0x142d('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x142d('0x8'));var squel=require(_0x142d('0x9'));var crypto=require(_0x142d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x142d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x142d('0xc'));var Papa=require(_0x142d('0xd'));var Redis=require('ioredis');var authService=require(_0x142d('0xe'));var qs=require(_0x142d('0xf'));var hardwareService=require(_0x142d('0x10'));var logger=require(_0x142d('0x11'))('api');var utils=require(_0x142d('0x12'));var config=require(_0x142d('0x13'));var db=require(_0x142d('0x14'))['db'];config['redis']=_[_0x142d('0x15')](config[_0x142d('0x16')],{'host':_0x142d('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x142d('0x18'))[_0x142d('0x19')](socket);var jayson=require(_0x142d('0x1a'));var client=jayson['client'][_0x142d('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x7de98b,_0x2675f4,_0x9f43fd){if(_0x9f43fd){var _0x1e0d08=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e0d08[_0x142d('0x1c')](_0x2675f4)){return _0x7de98b;}else{throw new Error(_0x142d('0x1d'));}}else{return _0x7de98b;}}function respondWithRpcPromise(_0x370748,_0x3ada44,_0x5c5f60,_0x465052){return new BPromise(function(_0x2c8ff9,_0x56f58c){var _0x37bec2=_0x465052||client;return _0x37bec2['request'](_0x370748,_0x5c5f60)[_0x142d('0x1e')](function(_0x44329a){logger[_0x142d('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x3ada44,_0x142d('0x20'));logger['debug'](_0x142d('0x21'),_0x3ada44,_0x142d('0x20'),JSON['stringify'](_0x44329a));if(_0x44329a[_0x142d('0x22')]){if(_0x44329a['error']['code']===0x1f4){logger['error'](_0x142d('0x23'),_0x3ada44,_0x44329a['error'][_0x142d('0x24')]);return _0x56f58c(_0x44329a[_0x142d('0x22')][_0x142d('0x24')]);}logger[_0x142d('0x22')](_0x142d('0x23'),_0x3ada44,_0x44329a[_0x142d('0x22')]['message']);return _0x2c8ff9(_0x44329a[_0x142d('0x22')]['message']);}else{logger[_0x142d('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x3ada44,_0x142d('0x20'));_0x2c8ff9(_0x44329a[_0x142d('0x25')]['message']);}})[_0x142d('0x26')](function(_0x201db5){logger[_0x142d('0x22')](_0x142d('0x23'),_0x3ada44,_0x201db5);_0x56f58c(_0x201db5);});});}function respondWithStatusCode(_0x12bd14,_0x348aac){_0x348aac=_0x348aac||0xcc;return function(_0x45e5c9){if(_0x45e5c9){return _0x12bd14[_0x142d('0x27')](_0x348aac);}return _0x12bd14[_0x142d('0x28')](_0x348aac)['end']();};}function respondWithResult(_0x17dff3,_0x3fec04){_0x3fec04=_0x3fec04||0xc8;return function(_0x5464ad){if(_0x5464ad){return _0x17dff3[_0x142d('0x28')](_0x3fec04)[_0x142d('0x29')](_0x5464ad);}};}function respondWithFilteredResult(_0xa2c46,_0x4e11f2){return function(_0x21c64a){if(_0x21c64a){var _0x3855dc=_0x21c64a[_0x142d('0x2a')],_0x3f1b7f=_0x4e11f2[_0x142d('0x2b')],_0x58930f=_0x4e11f2[_0x142d('0x2b')]+_0x4e11f2['limit'],_0x16c1c1;if(_0x58930f>=_0x3855dc){_0x58930f=_0x3855dc;_0x16c1c1=0xc8;}else{_0x16c1c1=0xce;}_0xa2c46[_0x142d('0x28')](_0x16c1c1);return _0xa2c46[_0x142d('0x2c')](_0x142d('0x2d'),_0x3f1b7f+'-'+_0x58930f+'/'+_0x3855dc)['json'](_0x21c64a);}return null;};}function patchUpdates(_0x11754f){return function(_0xfb9740){try{jsonpatch[_0x142d('0x2e')](_0xfb9740,_0x11754f,!![]);}catch(_0x3f0c87){return BPromise[_0x142d('0x2f')](_0x3f0c87);}return _0xfb9740[_0x142d('0x30')]();};}function saveUpdates(_0x337a14,_0x5cadc4){return function(_0x1b025c){if(_0x1b025c){return _0x1b025c[_0x142d('0x31')](_0x337a14)[_0x142d('0x1e')](function(_0x90cc6){return _0x90cc6;});}return null;};}function removeEntity(_0x333c5e,_0x126774){return function(_0x24e6a9){if(_0x24e6a9){return _0x24e6a9[_0x142d('0x32')]()[_0x142d('0x1e')](function(){var _0x32ac99=_0x24e6a9[_0x142d('0x33')]({'plain':!![]});var _0x2a41b7=_0x142d('0x34');return db[_0x142d('0x35')][_0x142d('0x32')]({'where':{'type':_0x2a41b7,'resourceId':_0x32ac99['id']}})[_0x142d('0x1e')](function(){return _0x24e6a9;});})[_0x142d('0x1e')](function(){_0x333c5e[_0x142d('0x28')](0xcc)[_0x142d('0x36')]();});}};}function handleEntityNotFound(_0xac2d67,_0x27303e){return function(_0x534617){if(!_0x534617){_0xac2d67[_0x142d('0x27')](0x194);}return _0x534617;};}function handleError(_0x114aee,_0x2e620d){_0x2e620d=_0x2e620d||0x1f4;return function(_0x40ab1b){logger[_0x142d('0x22')](_0x40ab1b[_0x142d('0x37')]);if(_0x40ab1b[_0x142d('0x38')]){delete _0x40ab1b[_0x142d('0x38')];}_0x114aee[_0x142d('0x28')](_0x2e620d)[_0x142d('0x39')](_0x40ab1b);};}exports['index']=function(_0x5b88b1,_0x14968c){var _0x3dc94d={},_0xa86f59={},_0x120f79={'count':0x0,'rows':[]};var _0x27a3ed=db[_0x142d('0x3a')][_0x142d('0x3b')];_0xa86f59['model']=_[_0x142d('0x3c')](_0x27a3ed);_0xa86f59[_0x142d('0x3d')]=_['keys'](_0x5b88b1[_0x142d('0x3d')]);_0xa86f59[_0x142d('0x3e')]=_[_0x142d('0x3f')](_0xa86f59['model'],_0xa86f59[_0x142d('0x3d')]);_0x3dc94d[_0x142d('0x40')]=_['intersection'](_0xa86f59[_0x142d('0x41')],qs[_0x142d('0x42')](_0x5b88b1[_0x142d('0x3d')][_0x142d('0x42')]));_0x3dc94d['attributes']=_0x3dc94d[_0x142d('0x40')]['length']?_0x3dc94d[_0x142d('0x40')]:_0xa86f59['model'];if(!_0x5b88b1[_0x142d('0x3d')][_0x142d('0x43')](_0x142d('0x44'))){_0x3dc94d[_0x142d('0x45')]=qs['limit'](_0x5b88b1[_0x142d('0x3d')][_0x142d('0x45')]);_0x3dc94d[_0x142d('0x2b')]=qs['offset'](_0x5b88b1[_0x142d('0x3d')][_0x142d('0x2b')]);}_0x3dc94d[_0x142d('0x46')]=qs[_0x142d('0x47')](_0x5b88b1[_0x142d('0x3d')]['sort']);_0x3dc94d[_0x142d('0x48')]=qs[_0x142d('0x3e')](_[_0x142d('0x49')](_0x5b88b1[_0x142d('0x3d')],_0xa86f59[_0x142d('0x3e')]));if(_0x5b88b1['query'][_0x142d('0x4a')]){_0x3dc94d['where']=_[_0x142d('0x4b')](_0x3dc94d[_0x142d('0x48')],{'$or':_[_0x142d('0x4c')](_0x27a3ed,function(_0x2abb99){if(_0x2abb99[_0x142d('0x4d')][_0x142d('0x4e')]!==_0x142d('0x4f')){var _0x2fe077={};_0x2fe077[_0x2abb99['field']]={'$like':'%'+_0x5b88b1[_0x142d('0x3d')]['filter']+'%'};return _0x2fe077;}})});}_0x3dc94d=_['merge']({},_0x3dc94d,_0x5b88b1[_0x142d('0x50')]);var _0x40bfed={'where':_0x3dc94d['where']};return db[_0x142d('0x3a')][_0x142d('0x2a')](_0x40bfed)[_0x142d('0x1e')](function(_0x39cff1){_0x120f79[_0x142d('0x2a')]=_0x39cff1;if(_0x5b88b1[_0x142d('0x3d')][_0x142d('0x51')]){_0x3dc94d['include']=[{'all':!![]}];}return db['ChatQueue'][_0x142d('0x52')](_0x3dc94d);})[_0x142d('0x1e')](function(_0x518e83){_0x120f79[_0x142d('0x53')]=_0x518e83;return _0x120f79;})[_0x142d('0x1e')](respondWithFilteredResult(_0x14968c,_0x3dc94d))[_0x142d('0x26')](handleError(_0x14968c,null));};exports['show']=function(_0x455c26,_0x2bb557){var _0x2ec80e={'raw':!![],'where':{'id':_0x455c26[_0x142d('0x54')]['id']}},_0x156b98={};_0x156b98[_0x142d('0x41')]=_[_0x142d('0x3c')](db[_0x142d('0x3a')][_0x142d('0x3b')]);_0x156b98[_0x142d('0x3d')]=_[_0x142d('0x3c')](_0x455c26[_0x142d('0x3d')]);_0x156b98[_0x142d('0x3e')]=_['intersection'](_0x156b98[_0x142d('0x41')],_0x156b98[_0x142d('0x3d')]);_0x2ec80e['attributes']=_[_0x142d('0x3f')](_0x156b98['model'],qs[_0x142d('0x42')](_0x455c26[_0x142d('0x3d')]['fields']));_0x2ec80e[_0x142d('0x40')]=_0x2ec80e['attributes'][_0x142d('0x55')]?_0x2ec80e[_0x142d('0x40')]:_0x156b98['model'];if(_0x455c26[_0x142d('0x3d')][_0x142d('0x51')]){_0x2ec80e[_0x142d('0x56')]=[{'all':!![]}];}_0x2ec80e=_['merge']({},_0x2ec80e,_0x455c26[_0x142d('0x50')]);return db['ChatQueue'][_0x142d('0x57')](_0x2ec80e)[_0x142d('0x1e')](handleEntityNotFound(_0x2bb557,null))['then'](respondWithResult(_0x2bb557,null))['catch'](handleError(_0x2bb557,null));};exports[_0x142d('0x58')]=function(_0x432506,_0x144165){return db[_0x142d('0x3a')][_0x142d('0x58')](_0x432506[_0x142d('0x59')],{})['then'](function(_0x474230){var _0x52f7c4=_0x432506['user'][_0x142d('0x33')]({'plain':!![]});if(!_0x52f7c4)throw new Error(_0x142d('0x5a'));if(_0x52f7c4[_0x142d('0x5b')]===_0x142d('0x5c')){var _0x133982=_0x474230[_0x142d('0x33')]({'plain':!![]});var _0x14cc7d=_0x142d('0x34');return db[_0x142d('0x5d')][_0x142d('0x57')]({'where':{'name':_0x14cc7d,'userProfileId':_0x52f7c4[_0x142d('0x5e')]},'raw':!![]})[_0x142d('0x1e')](function(_0x156780){if(_0x156780&&_0x156780[_0x142d('0x5f')]===0x0){return db['UserProfileResource'][_0x142d('0x58')]({'name':_0x133982[_0x142d('0x38')],'resourceId':_0x133982['id'],'type':_0x156780[_0x142d('0x38')],'sectionId':_0x156780['id']},{})[_0x142d('0x1e')](function(){return _0x474230;});}else{return _0x474230;}})[_0x142d('0x26')](function(_0x30be46){logger[_0x142d('0x22')](_0x142d('0x60'),_0x30be46);throw _0x30be46;});}return _0x474230;})[_0x142d('0x1e')](respondWithResult(_0x144165,0xc9))['catch'](handleError(_0x144165,null));};exports[_0x142d('0x31')]=function(_0x6ae78,_0x1d9c1b){if(_0x6ae78[_0x142d('0x59')]['id']){delete _0x6ae78[_0x142d('0x59')]['id'];}return db[_0x142d('0x3a')][_0x142d('0x57')]({'where':{'id':_0x6ae78['params']['id']}})[_0x142d('0x1e')](handleEntityNotFound(_0x1d9c1b,null))['then'](saveUpdates(_0x6ae78['body'],null))[_0x142d('0x1e')](respondWithResult(_0x1d9c1b,null))[_0x142d('0x26')](handleError(_0x1d9c1b,null));};exports[_0x142d('0x32')]=function(_0x14eeed,_0x4234bd){return db[_0x142d('0x3a')][_0x142d('0x57')]({'where':{'id':_0x14eeed[_0x142d('0x54')]['id']}})[_0x142d('0x1e')](handleEntityNotFound(_0x4234bd,null))[_0x142d('0x1e')](removeEntity(_0x4234bd,null))[_0x142d('0x26')](handleError(_0x4234bd,null));};exports[_0x142d('0x61')]=function(_0x335b38,_0x7c2d39){return db[_0x142d('0x3a')]['describe']()[_0x142d('0x1e')](respondWithResult(_0x7c2d39,null))[_0x142d('0x26')](handleError(_0x7c2d39,null));};exports[_0x142d('0x62')]=function(_0x55de84,_0x2ec683,_0x4300a7){var _0x2637f3={'raw':!![],'where':{}},_0x24b089={},_0x317466;return db[_0x142d('0x3a')][_0x142d('0x63')]({'where':{'id':_0x55de84[_0x142d('0x54')]['id']}})[_0x142d('0x1e')](handleEntityNotFound(_0x2ec683,null))[_0x142d('0x1e')](function(_0x169914){if(_0x169914){_0x317466=_0x169914[_0x142d('0x33')]({'plain':!![]});_0x24b089[_0x142d('0x41')]=_[_0x142d('0x3c')](db[_0x142d('0x64')][_0x142d('0x3b')]);_0x24b089[_0x142d('0x3d')]=_[_0x142d('0x3c')](_0x55de84[_0x142d('0x3d')]);_0x24b089[_0x142d('0x3e')]=_['intersection'](_0x24b089[_0x142d('0x41')],_0x24b089[_0x142d('0x3d')]);_0x2637f3[_0x142d('0x40')]=_['intersection'](_0x24b089['model'],qs['fields'](_0x55de84[_0x142d('0x3d')]['fields']));_0x2637f3['attributes']=_0x2637f3['attributes']['length']?_0x2637f3[_0x142d('0x40')]:_0x24b089[_0x142d('0x41')];if(!_0x55de84[_0x142d('0x3d')][_0x142d('0x43')]('nolimit')){_0x2637f3['limit']=qs['limit'](_0x55de84[_0x142d('0x3d')]['limit']);_0x2637f3[_0x142d('0x2b')]=qs[_0x142d('0x2b')](_0x55de84[_0x142d('0x3d')][_0x142d('0x2b')]);}_0x2637f3[_0x142d('0x46')]=qs[_0x142d('0x47')](_0x55de84['query'][_0x142d('0x47')]);_0x2637f3['where']=qs[_0x142d('0x3e')](_[_0x142d('0x49')](_0x55de84[_0x142d('0x3d')],_0x24b089[_0x142d('0x3e')]));_0x2637f3[_0x142d('0x48')][_0x142d('0x65')]=_0x169914['id'];if(_0x55de84[_0x142d('0x3d')]['filter']){_0x2637f3[_0x142d('0x48')]=_[_0x142d('0x4b')](_0x2637f3[_0x142d('0x48')],{'$or':_[_0x142d('0x4c')](_0x2637f3['attributes'],function(_0x3afa00){var _0x4a1188={};_0x4a1188[_0x3afa00]={'$like':'%'+_0x55de84['query'][_0x142d('0x4a')]+'%'};return _0x4a1188;})});}_0x2637f3=_[_0x142d('0x4b')]({},_0x2637f3,_0x55de84[_0x142d('0x50')]);return db[_0x142d('0x64')][_0x142d('0x52')](_0x2637f3);}})[_0x142d('0x1e')](function(_0x416d73){if(_0x416d73){return db[_0x142d('0x66')][_0x142d('0x67')]({'where':{'id':_[_0x142d('0x4c')](_0x416d73,_0x142d('0x68')),'role':_0x142d('0x69')},'attributes':['id','name',_0x142d('0x6a'),_0x142d('0x6b'),_0x142d('0x6c')]});}})[_0x142d('0x1e')](function(_0x35dfbc){if(_0x35dfbc){return{'count':_0x35dfbc[_0x142d('0x2a')],'rows':_[_0x142d('0x4c')](_0x35dfbc['rows'],function(_0x4497de){return{'membername':_0x4497de[_0x142d('0x38')],'UserId':_0x4497de['id'],'queue_name':_0x317466['name'],'ChatQueueId':_0x317466['id'],'interface':util['format'](_0x142d('0x6d'),_0x142d('0x6e'),_0x4497de['name']),'penalty':0x0,'paused':_0x4497de[_0x142d('0x6a')],'createdAt':_0x4497de[_0x142d('0x6c')],'updatedAt':_0x4497de['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x142d('0x1e')](respondWithFilteredResult(_0x2ec683,_0x2637f3))['catch'](handleError(_0x2ec683,null));};exports['getTeams']=function(_0xa9e79,_0x33e95d,_0x4fec25){var _0x57b48c={};var _0x4c3b61={};var _0x19503c;var _0x119fc1;return db['ChatQueue'][_0x142d('0x63')]({'where':{'id':_0xa9e79['params']['id']}})[_0x142d('0x1e')](handleEntityNotFound(_0x33e95d,null))[_0x142d('0x1e')](function(_0x38fe4f){if(_0x38fe4f){_0x19503c=_0x38fe4f;_0x4c3b61[_0x142d('0x41')]=_[_0x142d('0x3c')](db[_0x142d('0x6f')]['rawAttributes']);_0x4c3b61[_0x142d('0x3d')]=_['keys'](_0xa9e79[_0x142d('0x3d')]);_0x4c3b61['filters']=_[_0x142d('0x3f')](_0x4c3b61[_0x142d('0x41')],_0x4c3b61[_0x142d('0x3d')]);_0x57b48c['attributes']=_[_0x142d('0x3f')](_0x4c3b61[_0x142d('0x41')],qs[_0x142d('0x42')](_0xa9e79[_0x142d('0x3d')][_0x142d('0x42')]));_0x57b48c[_0x142d('0x40')]=_0x57b48c[_0x142d('0x40')][_0x142d('0x55')]?_0x57b48c[_0x142d('0x40')]:_0x4c3b61[_0x142d('0x41')];_0x57b48c[_0x142d('0x46')]=qs['sort'](_0xa9e79[_0x142d('0x3d')]['sort']);_0x57b48c[_0x142d('0x48')]=qs[_0x142d('0x3e')](_[_0x142d('0x49')](_0xa9e79['query'],_0x4c3b61[_0x142d('0x3e')]));if(_0xa9e79['query'][_0x142d('0x4a')]){_0x57b48c['where']=_[_0x142d('0x4b')](_0x57b48c['where'],{'$or':_['map'](_0x57b48c[_0x142d('0x40')],function(_0x9e4260){var _0x58ce1e={};_0x58ce1e[_0x9e4260]={'$like':'%'+_0xa9e79[_0x142d('0x3d')][_0x142d('0x4a')]+'%'};return _0x58ce1e;})});}_0x57b48c=_[_0x142d('0x4b')]({},_0x57b48c,_0xa9e79[_0x142d('0x50')]);return _0x19503c[_0x142d('0x70')](_0x57b48c);}})[_0x142d('0x1e')](function(_0x572682){if(_0x572682){_0x119fc1=_0x572682['length'];if(!_0xa9e79['query'][_0x142d('0x43')](_0x142d('0x44'))){_0x57b48c[_0x142d('0x45')]=qs[_0x142d('0x45')](_0xa9e79[_0x142d('0x3d')][_0x142d('0x45')]);_0x57b48c['offset']=qs['offset'](_0xa9e79['query'][_0x142d('0x2b')]);}return _0x19503c[_0x142d('0x70')](_0x57b48c);}})[_0x142d('0x1e')](function(_0x227ca2){if(_0x227ca2){return _0x227ca2?{'count':_0x119fc1,'rows':_0x227ca2}:null;}})['then'](respondWithResult(_0x33e95d,null))[_0x142d('0x26')](handleError(_0x33e95d,null));};exports[_0x142d('0x71')]=function(_0xea3451,_0x1a1ebe,_0x493bfd){var _0x409865=_0xea3451[_0x142d('0x59')]['teams'];return db['Team']['findAll']({'where':{'id':_['map'](_0x409865,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x142d('0x72'),'attributes':['id','name',_0x142d('0x73'),'voicePause',_0x142d('0x74')],'raw':!![]}]})['then'](function(_0x5a5ae9){if(_0x5a5ae9){var _0x1fba3a=_['flatMap'](_0x5a5ae9,function(_0x5119b6){var _0x42dd8b=_0x5119b6[_0x142d('0x33')]({'plain':!![]});return _0x42dd8b['Agents'];});return db['ChatQueue'][_0x142d('0x57')]({'where':{'id':_0xea3451[_0x142d('0x54')]['id']}})[_0x142d('0x1e')](function(_0x3fa36c){return db[_0x142d('0x75')][_0x142d('0x76')](function(_0x2504d6){return _0x3fa36c[_0x142d('0x71')](_[_0x142d('0x4c')](_0x409865,'id'),{'transaction':_0x2504d6})['then'](function(){return BPromise[_0x142d('0x77')](_0x1fba3a,function(_0x54ccf5){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x54ccf5['id'],'ChatQueueId':_0xea3451['params']['id']},'transaction':_0x2504d6});});})[_0x142d('0x1e')](function(){_0x1fba3a['forEach'](function(_0x45fcf7){socket[_0x142d('0x78')](_0x142d('0x79'),{'UserId':_0x45fcf7['id'],'ChatQueueId':_0x3fa36c['id']});});});});});}})['then'](respondWithStatusCode(_0x1a1ebe,null))[_0x142d('0x26')](handleError(_0x1a1ebe,null));};exports['removeTeams']=function(_0x4c269f,_0x4b4561,_0x5bf3e8){return db[_0x142d('0x6f')][_0x142d('0x52')]({'where':{'id':_0x4c269f[_0x142d('0x3d')][_0x142d('0x7a')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x142d('0x1e')](handleEntityNotFound(_0x4b4561,null))[_0x142d('0x1e')](function(_0x43978a){var _0x4d5c70=_['map'](_0x43978a,'id');var _0x55a221=[];var _0x4f01ba=[];var _0x263166=squel[_0x142d('0x7b')]();_0x263166[_0x142d('0x7c')]('tq.TeamId')[_0x142d('0x7d')](_0x142d('0x7e'),'tq')[_0x142d('0x7f')](_0x142d('0x80'),'ut',_0x142d('0x81'))[_0x142d('0x48')](_0x142d('0x82'),_0x4c269f['params']['id']);for(var _0x1a8bf4=0x0;_0x1a8bf4<_0x43978a[_0x142d('0x55')];_0x1a8bf4+=0x1){let _0x3e91ee=_0x43978a[_0x1a8bf4];for(var _0x792f86=0x0;_0x792f86<_0x3e91ee[_0x142d('0x72')]['length'];_0x792f86+=0x1){let _0x1cdf61=_0x3e91ee[_0x142d('0x72')][_0x792f86];var _0x1cc77e=_0x263166[_0x142d('0x83')]();_0x1cc77e[_0x142d('0x48')](_0x142d('0x84'),_0x1cdf61['id']);_0x4f01ba[_0x142d('0x85')](db[_0x142d('0x75')][_0x142d('0x3d')](_0x1cc77e[_0x142d('0x86')](),{'type':db['sequelize'][_0x142d('0x87')][_0x142d('0x88')]})['then'](function(_0x7ad49b){if(_0x7ad49b['length']===0x1){return _0x1cdf61['id'];}else{var _0xcf5fe6=_[_0x142d('0x89')](_[_0x142d('0x4c')](_0x7ad49b,_0x142d('0x8a')),function(_0x3c619c){return _[_0x142d('0x8b')](_0x4d5c70,_0x3c619c);});if(_0xcf5fe6){return _0x1cdf61['id'];}}}));}}return BPromise['all'](_0x4f01ba)[_0x142d('0x1e')](function(_0x2aa999){_0x55a221=_(_0x55a221)['union'](_0x2aa999)[_0x142d('0x8c')]()['value']();return db['ChatQueue'][_0x142d('0x57')]({'where':{'id':_0x4c269f[_0x142d('0x54')]['id']}})[_0x142d('0x1e')](function(_0x2fa580){return db[_0x142d('0x75')][_0x142d('0x76')](function(_0x22b45f){return _0x2fa580[_0x142d('0x8d')](_0x4c269f['query'][_0x142d('0x7a')],{'transaction':_0x22b45f})[_0x142d('0x1e')](function(){if(!_[_0x142d('0x8e')](_0x55a221)){return _0x2fa580[_0x142d('0x8f')](_0x55a221,{'transaction':_0x22b45f});}})['then'](function(){_0x55a221[_0x142d('0x90')](function(_0x3e4079){socket[_0x142d('0x78')](_0x142d('0x91'),{'UserId':_0x3e4079,'ChatQueueId':_0x2fa580['id']});});});});});});})[_0x142d('0x1e')](respondWithStatusCode(_0x4b4561,null))[_0x142d('0x26')](handleError(_0x4b4561,null));};exports[_0x142d('0x92')]=function(_0x245a09,_0x400a93,_0x5ea5e6){return db[_0x142d('0x3a')][_0x142d('0x57')]({'where':{'id':_0x245a09['params']['id']}})['then'](handleEntityNotFound(_0x400a93,null))[_0x142d('0x1e')](function(_0xc6985){if(_0xc6985){return _0xc6985[_0x142d('0x92')](_0x245a09[_0x142d('0x59')][_0x142d('0x7a')],_[_0x142d('0x93')](_0x245a09[_0x142d('0x59')],['ids','id'])||{})['spread'](function(_0x3d6fc2){for(var _0x4e7e86=0x0;_0x4e7e86<_0x245a09[_0x142d('0x59')][_0x142d('0x7a')]['length'];_0x4e7e86+=0x1){socket[_0x142d('0x78')](_0x142d('0x79'),{'UserId':_0x245a09[_0x142d('0x59')][_0x142d('0x7a')][_0x4e7e86],'ChatQueueId':_0x245a09[_0x142d('0x54')]['id']});}return _0x3d6fc2;});}})[_0x142d('0x1e')](respondWithResult(_0x400a93,null))['catch'](handleError(_0x400a93,null));};exports['removeAgents']=function(_0x264d56,_0x4617c3,_0x3a1519){return db['ChatQueue']['find']({'where':{'id':_0x264d56[_0x142d('0x54')]['id']}})[_0x142d('0x1e')](handleEntityNotFound(_0x4617c3,null))['then'](function(_0x23a596){if(_0x23a596){return _0x23a596['removeAgents'](_0x264d56[_0x142d('0x3d')]['ids'])['then'](function(){if(_[_0x142d('0x94')](_0x264d56['query'][_0x142d('0x7a')])){for(var _0x23f540=0x0;_0x23f540<_0x264d56[_0x142d('0x3d')][_0x142d('0x7a')][_0x142d('0x55')];_0x23f540+=0x1){socket[_0x142d('0x78')](_0x142d('0x91'),{'UserId':Number(_0x264d56[_0x142d('0x3d')][_0x142d('0x7a')][_0x23f540]),'ChatQueueId':Number(_0x264d56['params']['id'])});}}else{socket['emit'](_0x142d('0x91'),{'UserId':Number(_0x264d56[_0x142d('0x3d')]['ids']),'ChatQueueId':Number(_0x264d56[_0x142d('0x54')]['id'])});}});}})[_0x142d('0x1e')](respondWithStatusCode(_0x4617c3,null))['catch'](handleError(_0x4617c3,null));};exports['getAgents']=function(_0x34190f,_0x16b00e,_0x1a6b17){var _0x1c1183={};var _0x18c969={};var _0x59e16d;var _0x51e61a;return db[_0x142d('0x3a')][_0x142d('0x63')]({'where':{'id':_0x34190f['params']['id']}})['then'](handleEntityNotFound(_0x16b00e,null))[_0x142d('0x1e')](function(_0x1e2073){if(_0x1e2073){_0x59e16d=_0x1e2073;_0x18c969[_0x142d('0x41')]=_[_0x142d('0x3c')](db[_0x142d('0x66')][_0x142d('0x3b')]);_0x18c969['query']=_['keys'](_0x34190f[_0x142d('0x3d')]);_0x18c969[_0x142d('0x3e')]=_[_0x142d('0x3f')](_0x18c969[_0x142d('0x41')],_0x18c969['query']);_0x1c1183[_0x142d('0x40')]=_['intersection'](_0x18c969[_0x142d('0x41')],qs['fields'](_0x34190f[_0x142d('0x3d')]['fields']));_0x1c1183[_0x142d('0x40')]=_0x1c1183['attributes']['length']?_0x1c1183['attributes']:_0x18c969[_0x142d('0x41')];_0x1c1183['order']=qs[_0x142d('0x47')](_0x34190f[_0x142d('0x3d')]['sort']);_0x1c1183[_0x142d('0x48')]=qs['filters'](_[_0x142d('0x49')](_0x34190f[_0x142d('0x3d')],_0x18c969[_0x142d('0x3e')]));if(_0x34190f[_0x142d('0x3d')]['filter']){_0x1c1183[_0x142d('0x48')]=_[_0x142d('0x4b')](_0x1c1183['where'],{'$or':_['map'](_0x1c1183[_0x142d('0x40')],function(_0x3bc1c7){var _0x71e143={};_0x71e143[_0x3bc1c7]={'$like':'%'+_0x34190f[_0x142d('0x3d')][_0x142d('0x4a')]+'%'};return _0x71e143;})});}_0x1c1183=_[_0x142d('0x4b')]({},_0x1c1183,_0x34190f[_0x142d('0x50')]);return _0x59e16d[_0x142d('0x95')](_0x1c1183);}})[_0x142d('0x1e')](function(_0xfbaf9a){if(_0xfbaf9a){_0x51e61a=_0xfbaf9a[_0x142d('0x55')];if(!_0x34190f[_0x142d('0x3d')][_0x142d('0x43')]('nolimit')){_0x1c1183[_0x142d('0x45')]=qs[_0x142d('0x45')](_0x34190f[_0x142d('0x3d')][_0x142d('0x45')]);_0x1c1183[_0x142d('0x2b')]=qs[_0x142d('0x2b')](_0x34190f['query'][_0x142d('0x2b')]);}return _0x59e16d[_0x142d('0x95')](_0x1c1183);}})[_0x142d('0x1e')](function(_0x24eedc){if(_0x24eedc){return _0x24eedc?{'count':_0x51e61a,'rows':_0x24eedc}:null;}})[_0x142d('0x1e')](respondWithResult(_0x16b00e,null))[_0x142d('0x26')](handleError(_0x16b00e,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index d48cda4..17d4280 100644 --- a/server/api/chatQueue/chatQueue.events.js +++ b/server/api/chatQueue/chatQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x5c24bf,_0x3e9422){var _0x840544=function(_0x16bf36){while(--_0x16bf36){_0x5c24bf['push'](_0x5c24bf['shift']());}};_0x840544(++_0x3e9422);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e0b23,_0x447f13){_0x1e0b23=_0x1e0b23-0x0;var _0x9e049c=_0xb10b[_0x1e0b23];return _0x9e049c;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x18fa24,_0x3924ee){var _0x34f2e2=function(_0x32e447){while(--_0x32e447){_0x18fa24['push'](_0x18fa24['shift']());}};_0x34f2e2(++_0x3924ee);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56aae5,_0x1569cc){_0x56aae5=_0x56aae5-0x0;var _0x5745c8=_0x5f2f[_0x56aae5];return _0x5745c8;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 6ba7beb..496ce9a 100644 --- a/server/api/chatQueue/chatQueue.model.js +++ b/server/api/chatQueue/chatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d4d=['path','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x10f40a,_0x324827){var _0x3fd602=function(_0x1c2737){while(--_0x1c2737){_0x10f40a['push'](_0x10f40a['shift']());}};_0x3fd602(++_0x324827);}(_0x4d4d,0x192));var _0xd4d4=function(_0xb20e7e,_0x3472cc){_0xb20e7e=_0xb20e7e-0x0;var _0x2d8b10=_0x4d4d[_0xb20e7e];return _0x2d8b10;};'use strict';var _=require(_0xd4d4('0x0'));var util=require(_0xd4d4('0x1'));var logger=require(_0xd4d4('0x2'))(_0xd4d4('0x3'));var moment=require(_0xd4d4('0x4'));var BPromise=require(_0xd4d4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4d4('0x6'));var rimraf=require('rimraf');var config=require(_0xd4d4('0x7'));var attributes=require('./chatQueue.attributes');module[_0xd4d4('0x8')]=function(_0xeb745a,_0x19f8c2){return _0xeb745a[_0xd4d4('0x9')](_0xd4d4('0xa'),attributes,{'tableName':_0xd4d4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8afa=['./chatQueue.attributes','exports','define','chat_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x14d977,_0x4e272d){var _0x5c29ba=function(_0x370d56){while(--_0x370d56){_0x14d977['push'](_0x14d977['shift']());}};_0x5c29ba(++_0x4e272d);}(_0x8afa,0x138));var _0xa8af=function(_0x3b1644,_0x547fcc){_0x3b1644=_0x3b1644-0x0;var _0x18ff65=_0x8afa[_0x3b1644];return _0x18ff65;};'use strict';var _=require('lodash');var util=require(_0xa8af('0x0'));var logger=require(_0xa8af('0x1'))(_0xa8af('0x2'));var moment=require('moment');var BPromise=require(_0xa8af('0x3'));var rp=require(_0xa8af('0x4'));var fs=require('fs');var path=require(_0xa8af('0x5'));var rimraf=require(_0xa8af('0x6'));var config=require('../../config/environment');var attributes=require(_0xa8af('0x7'));module[_0xa8af('0x8')]=function(_0x1804ea,_0x2fc9d4){return _0x1804ea[_0xa8af('0x9')]('ChatQueue',attributes,{'tableName':_0xa8af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index eafa844..89d58d1 100644 --- a/server/api/chatQueue/chatQueue.rpc.js +++ b/server/api/chatQueue/chatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c7d=['then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatQueue,\x20%s,\x20%s','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','register'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x8c7d,0xe1));var _0xd8c7=function(_0x176d1a,_0x56c5db){_0x176d1a=_0x176d1a-0x0;var _0x46c451=_0x8c7d[_0x176d1a];return _0x46c451;};'use strict';var _=require(_0xd8c7('0x0'));var util=require('util');var moment=require(_0xd8c7('0x1'));var BPromise=require('bluebird');var rs=require(_0xd8c7('0x2'));var fs=require('fs');var Redis=require(_0xd8c7('0x3'));var db=require(_0xd8c7('0x4'))['db'];var utils=require(_0xd8c7('0x5'));var logger=require(_0xd8c7('0x6'))(_0xd8c7('0x7'));var config=require(_0xd8c7('0x8'));var jayson=require(_0xd8c7('0x9'));var client=jayson[_0xd8c7('0xa')]['http']({'port':0x232a});config['redis']=_[_0xd8c7('0xb')](config[_0xd8c7('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd8c7('0xd'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xd8c7('0xe')](socket);function respondWithRpcPromise(_0x215838,_0x24351f,_0x40ef67){return new BPromise(function(_0x4ba8d0,_0x8cd919){return client['request'](_0x215838,_0x40ef67)[_0xd8c7('0xf')](function(_0x86d58d){logger[_0xd8c7('0x10')]('ChatQueue,\x20%s,\x20%s',_0x24351f,'request\x20sent');logger[_0xd8c7('0x11')](_0xd8c7('0x12'),_0x24351f,_0xd8c7('0x13'),JSON[_0xd8c7('0x14')](_0x86d58d));if(_0x86d58d[_0xd8c7('0x15')]){if(_0x86d58d['error'][_0xd8c7('0x16')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x24351f,_0x86d58d[_0xd8c7('0x15')][_0xd8c7('0x17')]);return _0x8cd919(_0x86d58d['error'][_0xd8c7('0x17')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x24351f,_0x86d58d[_0xd8c7('0x15')]['message']);return _0x4ba8d0(_0x86d58d['error']['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x24351f,_0xd8c7('0x13'));_0x4ba8d0(_0x86d58d[_0xd8c7('0x18')][_0xd8c7('0x17')]);}})[_0xd8c7('0x19')](function(_0x5c84fe){logger[_0xd8c7('0x15')](_0xd8c7('0x1a'),_0x24351f,_0x5c84fe);_0x8cd919(_0x5c84fe);});});}exports['GetChatQueue']=function(_0x32939f){var _0x465f32=this;return new Promise(function(_0x4c83a1,_0x3dc3c4){return db[_0xd8c7('0x1b')][_0xd8c7('0x1c')]({'raw':_0x32939f[_0xd8c7('0x1d')]?_0x32939f[_0xd8c7('0x1d')][_0xd8c7('0x1e')]===undefined?!![]:![]:!![],'where':_0x32939f[_0xd8c7('0x1d')]?_0x32939f['options'][_0xd8c7('0x1f')]||null:null,'attributes':_0x32939f[_0xd8c7('0x1d')]?_0x32939f[_0xd8c7('0x1d')][_0xd8c7('0x20')]||null:null,'limit':_0x32939f['options']?_0x32939f[_0xd8c7('0x1d')][_0xd8c7('0x21')]||null:null,'include':_0x32939f['options']?_0x32939f[_0xd8c7('0x1d')][_0xd8c7('0x22')]?_[_0xd8c7('0x23')](_0x32939f[_0xd8c7('0x1d')]['include'],function(_0x598a9b){return{'model':db[_0x598a9b[_0xd8c7('0x24')]],'as':_0x598a9b['as'],'attributes':_0x598a9b[_0xd8c7('0x20')],'include':_0x598a9b[_0xd8c7('0x22')]?_[_0xd8c7('0x23')](_0x598a9b[_0xd8c7('0x22')],function(_0x4bfed5){return{'model':db[_0x4bfed5[_0xd8c7('0x24')]],'as':_0x4bfed5['as'],'attributes':_0x4bfed5[_0xd8c7('0x20')],'include':_0x4bfed5[_0xd8c7('0x22')]?_[_0xd8c7('0x23')](_0x4bfed5[_0xd8c7('0x22')],function(_0x3b2c71){return{'model':db[_0x3b2c71[_0xd8c7('0x24')]],'as':_0x3b2c71['as'],'attributes':_0x3b2c71['attributes']};}):[]};}):[]};}):[]:[]})[_0xd8c7('0xf')](function(_0x3f7a74){logger[_0xd8c7('0x10')]('GetChatQueue',_0x32939f);logger[_0xd8c7('0x11')](_0xd8c7('0x25'),_0x32939f,JSON[_0xd8c7('0x14')](_0x3f7a74));_0x4c83a1(_0x3f7a74);})[_0xd8c7('0x19')](function(_0xb58d8f){logger['error'](_0xd8c7('0x25'),_0xb58d8f['message'],_0x32939f);_0x3dc3c4(_0x465f32[_0xd8c7('0x15')](0x1f4,_0xb58d8f[_0xd8c7('0x17')]));});});};exports[_0xd8c7('0x26')]=function(_0x1f4afd){var _0x92c82b=this;return new Promise(function(_0x6d7de5,_0x5d895d){return db[_0xd8c7('0x1b')][_0xd8c7('0x27')]({'raw':_0x1f4afd[_0xd8c7('0x1d')]?_0x1f4afd['options'][_0xd8c7('0x1e')]===undefined?!![]:![]:!![],'where':_0x1f4afd[_0xd8c7('0x1d')]?_0x1f4afd['options'][_0xd8c7('0x1f')]||null:null,'attributes':_0x1f4afd[_0xd8c7('0x1d')]?_0x1f4afd[_0xd8c7('0x1d')][_0xd8c7('0x20')]||null:null,'include':_0x1f4afd[_0xd8c7('0x1d')]?_0x1f4afd[_0xd8c7('0x1d')][_0xd8c7('0x22')]?_[_0xd8c7('0x23')](_0x1f4afd[_0xd8c7('0x1d')][_0xd8c7('0x22')],function(_0x3bcc2f){return{'model':db[_0x3bcc2f['model']],'as':_0x3bcc2f['as'],'attributes':_0x3bcc2f[_0xd8c7('0x20')],'include':_0x3bcc2f['include']?_['map'](_0x3bcc2f['include'],function(_0x2fa222){return{'model':db[_0x2fa222[_0xd8c7('0x24')]],'as':_0x2fa222['as'],'attributes':_0x2fa222['attributes'],'include':_0x2fa222[_0xd8c7('0x22')]?_['map'](_0x2fa222[_0xd8c7('0x22')],function(_0x45bb7b){return{'model':db[_0x45bb7b[_0xd8c7('0x24')]],'as':_0x45bb7b['as'],'attributes':_0x45bb7b[_0xd8c7('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23b31b){logger['info'](_0xd8c7('0x26'),_0x1f4afd);logger[_0xd8c7('0x11')]('ShowChatQueue',_0x1f4afd,JSON[_0xd8c7('0x14')](_0x23b31b));_0x6d7de5(_0x23b31b);})[_0xd8c7('0x19')](function(_0x509331){logger[_0xd8c7('0x15')](_0xd8c7('0x26'),_0x509331['message'],_0x1f4afd);_0x5d895d(_0x92c82b[_0xd8c7('0x15')](0x1f4,_0x509331[_0xd8c7('0x17')]));});});}; \ No newline at end of file +var _0x6582=['http','redis','defaults','localhost','./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetChatQueue','ChatQueue','options','attributes','limit','include','map','model','then','ShowChatQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x3dfb7c,_0x3ea513){var _0x47d3bc=function(_0x1fc067){while(--_0x1fc067){_0x3dfb7c['push'](_0x3dfb7c['shift']());}};_0x47d3bc(++_0x3ea513);}(_0x6582,0x108));var _0x2658=function(_0x3a833e,_0x5a1878){_0x3a833e=_0x3a833e-0x0;var _0xdff445=_0x6582[_0x3a833e];return _0xdff445;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require(_0x2658('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2658('0x5'))['db'];var utils=require(_0x2658('0x6'));var logger=require(_0x2658('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2658('0x8')][_0x2658('0x9')]({'port':0x232a});config[_0x2658('0xa')]=_[_0x2658('0xb')](config[_0x2658('0xa')],{'host':_0x2658('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2658('0xa')]));require(_0x2658('0xd'))[_0x2658('0xe')](socket);function respondWithRpcPromise(_0x99b9db,_0x455ff9,_0x2b2561){return new BPromise(function(_0x3f22a5,_0x1aaaac){return client[_0x2658('0xf')](_0x99b9db,_0x2b2561)['then'](function(_0x20fe6d){logger['info'](_0x2658('0x10'),_0x455ff9,_0x2658('0x11'));logger[_0x2658('0x12')](_0x2658('0x13'),_0x455ff9,_0x2658('0x11'),JSON[_0x2658('0x14')](_0x20fe6d));if(_0x20fe6d[_0x2658('0x15')]){if(_0x20fe6d['error'][_0x2658('0x16')]===0x1f4){logger[_0x2658('0x15')](_0x2658('0x10'),_0x455ff9,_0x20fe6d[_0x2658('0x15')][_0x2658('0x17')]);return _0x1aaaac(_0x20fe6d['error'][_0x2658('0x17')]);}logger[_0x2658('0x15')](_0x2658('0x10'),_0x455ff9,_0x20fe6d['error'][_0x2658('0x17')]);return _0x3f22a5(_0x20fe6d[_0x2658('0x15')][_0x2658('0x17')]);}else{logger[_0x2658('0x18')]('ChatQueue,\x20%s,\x20%s',_0x455ff9,_0x2658('0x11'));_0x3f22a5(_0x20fe6d['result'][_0x2658('0x17')]);}})[_0x2658('0x19')](function(_0x307220){logger[_0x2658('0x15')]('ChatQueue,\x20%s,\x20%s',_0x455ff9,_0x307220);_0x1aaaac(_0x307220);});});}exports[_0x2658('0x1a')]=function(_0x42c350){var _0x467481=this;return new Promise(function(_0xb0dab8,_0x23cf70){return db[_0x2658('0x1b')]['findAll']({'raw':_0x42c350[_0x2658('0x1c')]?_0x42c350['options']['raw']===undefined?!![]:![]:!![],'where':_0x42c350[_0x2658('0x1c')]?_0x42c350[_0x2658('0x1c')]['where']||null:null,'attributes':_0x42c350[_0x2658('0x1c')]?_0x42c350['options'][_0x2658('0x1d')]||null:null,'limit':_0x42c350[_0x2658('0x1c')]?_0x42c350[_0x2658('0x1c')][_0x2658('0x1e')]||null:null,'include':_0x42c350[_0x2658('0x1c')]?_0x42c350[_0x2658('0x1c')][_0x2658('0x1f')]?_[_0x2658('0x20')](_0x42c350[_0x2658('0x1c')][_0x2658('0x1f')],function(_0x566cec){return{'model':db[_0x566cec[_0x2658('0x21')]],'as':_0x566cec['as'],'attributes':_0x566cec[_0x2658('0x1d')],'include':_0x566cec[_0x2658('0x1f')]?_[_0x2658('0x20')](_0x566cec[_0x2658('0x1f')],function(_0x3a4b45){return{'model':db[_0x3a4b45['model']],'as':_0x3a4b45['as'],'attributes':_0x3a4b45[_0x2658('0x1d')],'include':_0x3a4b45[_0x2658('0x1f')]?_[_0x2658('0x20')](_0x3a4b45[_0x2658('0x1f')],function(_0x27e0f5){return{'model':db[_0x27e0f5[_0x2658('0x21')]],'as':_0x27e0f5['as'],'attributes':_0x27e0f5[_0x2658('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2658('0x22')](function(_0xd891fe){logger[_0x2658('0x18')](_0x2658('0x1a'),_0x42c350);logger[_0x2658('0x12')](_0x2658('0x1a'),_0x42c350,JSON[_0x2658('0x14')](_0xd891fe));_0xb0dab8(_0xd891fe);})[_0x2658('0x19')](function(_0x3db87d){logger[_0x2658('0x15')](_0x2658('0x1a'),_0x3db87d['message'],_0x42c350);_0x23cf70(_0x467481[_0x2658('0x15')](0x1f4,_0x3db87d[_0x2658('0x17')]));});});};exports[_0x2658('0x23')]=function(_0x49bd5e){var _0x3955eb=this;return new Promise(function(_0x44db3c,_0x28cea6){return db['ChatQueue'][_0x2658('0x24')]({'raw':_0x49bd5e[_0x2658('0x1c')]?_0x49bd5e[_0x2658('0x1c')][_0x2658('0x25')]===undefined?!![]:![]:!![],'where':_0x49bd5e[_0x2658('0x1c')]?_0x49bd5e[_0x2658('0x1c')][_0x2658('0x26')]||null:null,'attributes':_0x49bd5e[_0x2658('0x1c')]?_0x49bd5e[_0x2658('0x1c')]['attributes']||null:null,'include':_0x49bd5e[_0x2658('0x1c')]?_0x49bd5e[_0x2658('0x1c')][_0x2658('0x1f')]?_['map'](_0x49bd5e['options']['include'],function(_0x15e7ec){return{'model':db[_0x15e7ec[_0x2658('0x21')]],'as':_0x15e7ec['as'],'attributes':_0x15e7ec[_0x2658('0x1d')],'include':_0x15e7ec[_0x2658('0x1f')]?_[_0x2658('0x20')](_0x15e7ec[_0x2658('0x1f')],function(_0x57f891){return{'model':db[_0x57f891[_0x2658('0x21')]],'as':_0x57f891['as'],'attributes':_0x57f891[_0x2658('0x1d')],'include':_0x57f891[_0x2658('0x1f')]?_['map'](_0x57f891[_0x2658('0x1f')],function(_0x3798ba){return{'model':db[_0x3798ba[_0x2658('0x21')]],'as':_0x3798ba['as'],'attributes':_0x3798ba[_0x2658('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf632b6){logger[_0x2658('0x18')]('ShowChatQueue',_0x49bd5e);logger['debug']('ShowChatQueue',_0x49bd5e,JSON['stringify'](_0xf632b6));_0x44db3c(_0xf632b6);})[_0x2658('0x19')](function(_0x1f6b70){logger[_0x2658('0x15')]('ShowChatQueue',_0x1f6b70[_0x2658('0x17')],_0x49bd5e);_0x28cea6(_0x3955eb['error'](0x1f4,_0x1f6b70['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 0106a98..a605e46 100644 --- a/server/api/chatQueue/chatQueue.socket.js +++ b/server/api/chatQueue/chatQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['update','emit','register','length','chatQueue:','save'];(function(_0xf97b12,_0x3032ff){var _0x556e5d=function(_0x506502){while(--_0x506502){_0xf97b12['push'](_0xf97b12['shift']());}};_0x556e5d(++_0x3032ff);}(_0xadb5,0xad));var _0x5adb=function(_0x4f87c6,_0x5b86d4){_0x4f87c6=_0x4f87c6-0x0;var _0x36aa2d=_0xadb5[_0x4f87c6];return _0x36aa2d;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x5adb('0x0'),'remove',_0x5adb('0x1')];function createListener(_0x38f67f,_0x3129c3){return function(_0x4aecec){_0x3129c3[_0x5adb('0x2')](_0x38f67f,_0x4aecec);};}function removeListener(_0x31457,_0x2e3ef4){return function(){ChatQueueEvents['removeListener'](_0x31457,_0x2e3ef4);};}exports[_0x5adb('0x3')]=function(_0x168d89){for(var _0x3e2555=0x0,_0x3213e8=events[_0x5adb('0x4')];_0x3e2555<_0x3213e8;_0x3e2555++){var _0x353885=events[_0x3e2555];var _0x47228a=createListener(_0x5adb('0x5')+_0x353885,_0x168d89);ChatQueueEvents['on'](_0x353885,_0x47228a);}}; \ No newline at end of file +var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x26d9b3,_0x591f4e){var _0x15c226=function(_0x17bbdb){while(--_0x17bbdb){_0x26d9b3['push'](_0x26d9b3['shift']());}};_0x15c226(++_0x591f4e);}(_0xb10b,0x12a));var _0xbb10=function(_0xe7a99e,_0x4902a1){_0xe7a99e=_0xe7a99e-0x0;var _0x3bef5c=_0xb10b[_0xe7a99e];return _0x3bef5c;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index bd01413..0f86f9d 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b73=['put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','create','/:id/teams','addAgents'];(function(_0x8550ba,_0x57c10d){var _0x432399=function(_0x33ab8a){while(--_0x33ab8a){_0x8550ba['push'](_0x8550ba['shift']());}};_0x432399(++_0x57c10d);}(_0x3b73,0xe7));var _0x33b7=function(_0x25e9df,_0x17a63a){_0x25e9df=_0x25e9df-0x0;var _0x3dea70=_0x3b73[_0x25e9df];return _0x3dea70;};'use strict';var multer=require(_0x33b7('0x0'));var util=require(_0x33b7('0x1'));var path=require(_0x33b7('0x2'));var timeout=require('connect-timeout');var express=require(_0x33b7('0x3'));var router=express[_0x33b7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x33b7('0x5'));var config=require(_0x33b7('0x6'));var controller=require(_0x33b7('0x7'));router[_0x33b7('0x8')]('/',auth[_0x33b7('0x9')](),controller[_0x33b7('0xa')]);router[_0x33b7('0x8')]('/describe',auth[_0x33b7('0x9')](),controller['describe']);router[_0x33b7('0x8')](_0x33b7('0xb'),auth['isAuthenticated'](),controller[_0x33b7('0xc')]);router[_0x33b7('0x8')](_0x33b7('0xd'),auth[_0x33b7('0x9')](),controller[_0x33b7('0xe')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x33b7('0x8')](_0x33b7('0xf'),auth[_0x33b7('0x9')](),controller[_0x33b7('0x10')]);router[_0x33b7('0x11')]('/',auth['isAuthenticated'](),controller[_0x33b7('0x12')]);router[_0x33b7('0x11')](_0x33b7('0x13'),auth[_0x33b7('0x9')](),controller['addTeams']);router['post'](_0x33b7('0xf'),auth['isAuthenticated'](),controller[_0x33b7('0x14')]);router[_0x33b7('0x15')](_0x33b7('0xb'),auth[_0x33b7('0x9')](),controller[_0x33b7('0x16')]);router['delete']('/:id',auth[_0x33b7('0x9')](),controller[_0x33b7('0x17')]);router[_0x33b7('0x18')](_0x33b7('0x13'),auth['isAuthenticated'](),controller[_0x33b7('0x19')]);router[_0x33b7('0x18')](_0x33b7('0xf'),auth[_0x33b7('0x9')](),controller[_0x33b7('0x1a')]);module[_0x33b7('0x1b')]=router; \ No newline at end of file +var _0x9996=['path','Router','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','util'];(function(_0x34af10,_0x2b7343){var _0x31e0b4=function(_0x315af8){while(--_0x315af8){_0x34af10['push'](_0x34af10['shift']());}};_0x31e0b4(++_0x2b7343);}(_0x9996,0xc3));var _0x6999=function(_0x246cd0,_0x36e3e8){_0x246cd0=_0x246cd0-0x0;var _0x1fd2de=_0x9996[_0x246cd0];return _0x1fd2de;};'use strict';var multer=require('multer');var util=require(_0x6999('0x0'));var path=require(_0x6999('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6999('0x2')]();var auth=require(_0x6999('0x3'));var interaction=require(_0x6999('0x4'));var config=require('../../config/environment');var controller=require(_0x6999('0x5'));router[_0x6999('0x6')]('/',auth['isAuthenticated'](),controller[_0x6999('0x7')]);router[_0x6999('0x6')](_0x6999('0x8'),auth[_0x6999('0x9')](),controller['describe']);router[_0x6999('0x6')](_0x6999('0xa'),auth['isAuthenticated'](),controller[_0x6999('0xb')]);router[_0x6999('0x6')](_0x6999('0xc'),auth['isAuthenticated'](),controller[_0x6999('0xd')]);router[_0x6999('0x6')](_0x6999('0xe'),auth['isAuthenticated'](),controller[_0x6999('0xf')]);router[_0x6999('0x6')](_0x6999('0x10'),auth[_0x6999('0x9')](),controller[_0x6999('0x11')]);router[_0x6999('0x12')]('/',auth[_0x6999('0x9')](),controller[_0x6999('0x13')]);router[_0x6999('0x12')](_0x6999('0xe'),auth[_0x6999('0x9')](),controller[_0x6999('0x14')]);router[_0x6999('0x12')](_0x6999('0x10'),auth[_0x6999('0x9')](),controller[_0x6999('0x15')]);router['put'](_0x6999('0xa'),auth[_0x6999('0x9')](),controller[_0x6999('0x16')]);router[_0x6999('0x17')](_0x6999('0xa'),auth[_0x6999('0x9')](),controller[_0x6999('0x18')]);router['delete'](_0x6999('0xe'),auth[_0x6999('0x9')](),controller[_0x6999('0x19')]);router[_0x6999('0x17')](_0x6999('0x10'),auth[_0x6999('0x9')](),controller[_0x6999('0x1a')]);module[_0x6999('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 313580b..16693ca 100644 --- a/server/api/chatQueueReport/chatQueueReport.attributes.js +++ b/server/api/chatQueueReport/chatQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe800=['STRING','DATE','moment','sequelize'];(function(_0x33b9ea,_0x1d3314){var _0x1f8c3b=function(_0x44e536){while(--_0x44e536){_0x33b9ea['push'](_0x33b9ea['shift']());}};_0x1f8c3b(++_0x1d3314);}(_0xe800,0xce));var _0x0e80=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xe800[_0x550d12];return _0x12103d;};'use strict';var moment=require(_0x0e80('0x0'));var Sequelize=require(_0x0e80('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0e80('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0e80('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0e80('0x3')]},'acceptAt':{'type':Sequelize[_0x0e80('0x3')]},'exitAt':{'type':Sequelize[_0x0e80('0x3')]},'reason':{'type':Sequelize[_0x0e80('0x2')]}}; \ No newline at end of file +var _0x9c44=['sequelize','exports','STRING','DATE','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9c44,0x1e9));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var moment=require(_0x49c4('0x0'));var Sequelize=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x49c4('0x3')]},'joinAt':{'type':Sequelize[_0x49c4('0x4')]},'leaveAt':{'type':Sequelize[_0x49c4('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x49c4('0x4')]},'reason':{'type':Sequelize[_0x49c4('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index c496f08..90819fd 100644 --- a/server/api/chatQueueReport/chatQueueReport.controller.js +++ b/server/api/chatQueueReport/chatQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe22=['intersection','create','body','find','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','index','ChatQueueReport','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','count','includeAll','include','findAll','rows','catch','show','params'];(function(_0x207abf,_0x33cf2e){var _0x481744=function(_0x4dc6bf){while(--_0x4dc6bf){_0x207abf['push'](_0x207abf['shift']());}};_0x481744(++_0x33cf2e);}(_0xbe22,0x1c1));var _0x2be2=function(_0x5c2570,_0x3a3162){_0x5c2570=_0x5c2570-0x0;var _0x4edf48=_0xbe22[_0x5c2570];return _0x4edf48;};'use strict';var pdf=require(_0x2be2('0x0'));var emlformat=require(_0x2be2('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2be2('0x2'));var rp=require(_0x2be2('0x3'));var moment=require(_0x2be2('0x4'));var BPromise=require(_0x2be2('0x5'));var Mustache=require(_0x2be2('0x6'));var util=require(_0x2be2('0x7'));var path=require(_0x2be2('0x8'));var sox=require(_0x2be2('0x9'));var csv=require(_0x2be2('0xa'));var ejs=require(_0x2be2('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2be2('0xc'));var crypto=require(_0x2be2('0xd'));var jsforce=require(_0x2be2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2be2('0xa'));var querystring=require(_0x2be2('0xf'));var Papa=require(_0x2be2('0x10'));var Redis=require(_0x2be2('0x11'));var authService=require(_0x2be2('0x12'));var qs=require(_0x2be2('0x13'));var hardwareService=require(_0x2be2('0x14'));var logger=require(_0x2be2('0x15'))('api');var utils=require(_0x2be2('0x16'));var config=require(_0x2be2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d38f1,_0x3015c5){_0x3015c5=_0x3015c5||0xcc;return function(_0x37667f){if(_0x37667f){return _0x1d38f1['sendStatus'](_0x3015c5);}return _0x1d38f1[_0x2be2('0x18')](_0x3015c5)[_0x2be2('0x19')]();};}function respondWithResult(_0x5d2438,_0x10beca){_0x10beca=_0x10beca||0xc8;return function(_0x2f61aa){if(_0x2f61aa){return _0x5d2438[_0x2be2('0x18')](_0x10beca)['json'](_0x2f61aa);}};}function respondWithFilteredResult(_0x3c5953,_0x1348d4){return function(_0x528d4e){if(_0x528d4e){var _0x18c13e=_0x528d4e['count'],_0x358bf5=_0x1348d4[_0x2be2('0x1a')],_0x5d9719=_0x1348d4[_0x2be2('0x1a')]+_0x1348d4[_0x2be2('0x1b')],_0x2fd029;if(_0x5d9719>=_0x18c13e){_0x5d9719=_0x18c13e;_0x2fd029=0xc8;}else{_0x2fd029=0xce;}_0x3c5953[_0x2be2('0x18')](_0x2fd029);return _0x3c5953[_0x2be2('0x1c')](_0x2be2('0x1d'),_0x358bf5+'-'+_0x5d9719+'/'+_0x18c13e)['json'](_0x528d4e);}return null;};}function patchUpdates(_0x11ae5b){return function(_0x41abad){try{jsonpatch[_0x2be2('0x1e')](_0x41abad,_0x11ae5b,!![]);}catch(_0x59e2c6){return BPromise['reject'](_0x59e2c6);}return _0x41abad[_0x2be2('0x1f')]();};}function saveUpdates(_0x522708,_0x1bb818){return function(_0xefbaf5){if(_0xefbaf5){return _0xefbaf5[_0x2be2('0x20')](_0x522708)[_0x2be2('0x21')](function(_0x173862){return _0x173862;});}return null;};}function removeEntity(_0x5c5d2d,_0x4c7b70){return function(_0x5c2d00){if(_0x5c2d00){return _0x5c2d00[_0x2be2('0x22')]()[_0x2be2('0x21')](function(){_0x5c5d2d[_0x2be2('0x18')](0xcc)[_0x2be2('0x19')]();});}};}function handleEntityNotFound(_0x281853,_0x16a512){return function(_0x4d68ef){if(!_0x4d68ef){_0x281853[_0x2be2('0x23')](0x194);}return _0x4d68ef;};}function handleError(_0x4ef62c,_0x262747){_0x262747=_0x262747||0x1f4;return function(_0x1a7847){logger['error'](_0x1a7847[_0x2be2('0x24')]);if(_0x1a7847[_0x2be2('0x25')]){delete _0x1a7847[_0x2be2('0x25')];}_0x4ef62c['status'](_0x262747)['send'](_0x1a7847);};}exports[_0x2be2('0x26')]=function(_0x47618d,_0x5dfb40){var _0x4ccee6={},_0x34b598={},_0x1e37ca={'count':0x0,'rows':[]};var _0x594b05=db[_0x2be2('0x27')][_0x2be2('0x28')];_0x34b598[_0x2be2('0x29')]=_[_0x2be2('0x2a')](_0x594b05);_0x34b598[_0x2be2('0x2b')]=_[_0x2be2('0x2a')](_0x47618d[_0x2be2('0x2b')]);_0x34b598[_0x2be2('0x2c')]=_['intersection'](_0x34b598[_0x2be2('0x29')],_0x34b598[_0x2be2('0x2b')]);_0x4ccee6[_0x2be2('0x2d')]=_['intersection'](_0x34b598[_0x2be2('0x29')],qs['fields'](_0x47618d[_0x2be2('0x2b')][_0x2be2('0x2e')]));_0x4ccee6[_0x2be2('0x2d')]=_0x4ccee6[_0x2be2('0x2d')][_0x2be2('0x2f')]?_0x4ccee6[_0x2be2('0x2d')]:_0x34b598[_0x2be2('0x29')];if(!_0x47618d[_0x2be2('0x2b')][_0x2be2('0x30')](_0x2be2('0x31'))){_0x4ccee6['limit']=qs[_0x2be2('0x1b')](_0x47618d[_0x2be2('0x2b')]['limit']);_0x4ccee6[_0x2be2('0x1a')]=qs['offset'](_0x47618d[_0x2be2('0x2b')][_0x2be2('0x1a')]);}_0x4ccee6[_0x2be2('0x32')]=qs['sort'](_0x47618d[_0x2be2('0x2b')][_0x2be2('0x33')]);_0x4ccee6[_0x2be2('0x34')]=qs['filters'](_[_0x2be2('0x35')](_0x47618d[_0x2be2('0x2b')],_0x34b598[_0x2be2('0x2c')]));if(_0x47618d[_0x2be2('0x2b')][_0x2be2('0x36')]){_0x4ccee6[_0x2be2('0x34')]=_[_0x2be2('0x37')](_0x4ccee6[_0x2be2('0x34')],{'$or':_[_0x2be2('0x38')](_0x594b05,function(_0x2d6709){if(_0x2d6709[_0x2be2('0x39')][_0x2be2('0x3a')]!=='VIRTUAL'){var _0x154415={};_0x154415[_0x2d6709[_0x2be2('0x3b')]]={'$like':'%'+_0x47618d[_0x2be2('0x2b')]['filter']+'%'};return _0x154415;}})});}_0x4ccee6=_['merge']({},_0x4ccee6,_0x47618d[_0x2be2('0x3c')]);var _0x120830={'where':_0x4ccee6[_0x2be2('0x34')]};return db['ChatQueueReport'][_0x2be2('0x3d')](_0x120830)[_0x2be2('0x21')](function(_0x311352){_0x1e37ca[_0x2be2('0x3d')]=_0x311352;if(_0x47618d[_0x2be2('0x2b')][_0x2be2('0x3e')]){_0x4ccee6[_0x2be2('0x3f')]=[{'all':!![]}];}return db[_0x2be2('0x27')][_0x2be2('0x40')](_0x4ccee6);})['then'](function(_0x7d1bac){_0x1e37ca[_0x2be2('0x41')]=_0x7d1bac;return _0x1e37ca;})['then'](respondWithFilteredResult(_0x5dfb40,_0x4ccee6))[_0x2be2('0x42')](handleError(_0x5dfb40,null));};exports[_0x2be2('0x43')]=function(_0x211320,_0x4f704e){var _0x42f4ae={'raw':!![],'where':{'id':_0x211320[_0x2be2('0x44')]['id']}},_0x6e6b49={};_0x6e6b49[_0x2be2('0x29')]=_['keys'](db['ChatQueueReport'][_0x2be2('0x28')]);_0x6e6b49[_0x2be2('0x2b')]=_[_0x2be2('0x2a')](_0x211320[_0x2be2('0x2b')]);_0x6e6b49['filters']=_['intersection'](_0x6e6b49['model'],_0x6e6b49['query']);_0x42f4ae[_0x2be2('0x2d')]=_[_0x2be2('0x45')](_0x6e6b49[_0x2be2('0x29')],qs[_0x2be2('0x2e')](_0x211320['query'][_0x2be2('0x2e')]));_0x42f4ae[_0x2be2('0x2d')]=_0x42f4ae[_0x2be2('0x2d')]['length']?_0x42f4ae[_0x2be2('0x2d')]:_0x6e6b49[_0x2be2('0x29')];if(_0x211320[_0x2be2('0x2b')][_0x2be2('0x3e')]){_0x42f4ae['include']=[{'all':!![]}];}_0x42f4ae=_[_0x2be2('0x37')]({},_0x42f4ae,_0x211320['options']);return db[_0x2be2('0x27')]['find'](_0x42f4ae)['then'](handleEntityNotFound(_0x4f704e,null))[_0x2be2('0x21')](respondWithResult(_0x4f704e,null))[_0x2be2('0x42')](handleError(_0x4f704e,null));};exports[_0x2be2('0x46')]=function(_0x1b95ef,_0x29fed9){return db['ChatQueueReport'][_0x2be2('0x46')](_0x1b95ef[_0x2be2('0x47')],{})['then'](respondWithResult(_0x29fed9,0xc9))[_0x2be2('0x42')](handleError(_0x29fed9,null));};exports[_0x2be2('0x20')]=function(_0x3208bc,_0x486979){if(_0x3208bc[_0x2be2('0x47')]['id']){delete _0x3208bc['body']['id'];}return db[_0x2be2('0x27')][_0x2be2('0x48')]({'where':{'id':_0x3208bc['params']['id']}})[_0x2be2('0x21')](handleEntityNotFound(_0x486979,null))[_0x2be2('0x21')](saveUpdates(_0x3208bc[_0x2be2('0x47')],null))['then'](respondWithResult(_0x486979,null))[_0x2be2('0x42')](handleError(_0x486979,null));};exports[_0x2be2('0x22')]=function(_0x44418a,_0xb70cae){return db[_0x2be2('0x27')]['find']({'where':{'id':_0x44418a['params']['id']}})[_0x2be2('0x21')](handleEntityNotFound(_0xb70cae,null))[_0x2be2('0x21')](removeEntity(_0xb70cae,null))[_0x2be2('0x42')](handleError(_0xb70cae,null));};exports['describe']=function(_0xd65541,_0x2c80a1){return db[_0x2be2('0x27')][_0x2be2('0x49')]()[_0x2be2('0x21')](respondWithResult(_0x2c80a1,null))['catch'](handleError(_0x2c80a1,null));}; \ No newline at end of file +var _0x8e0f=['ChatQueueReport','findAll','rows','catch','show','params','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','reject','save','update','destroy','then','error','stack','name','index','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','map','type','key','field','options','include'];(function(_0x5959ce,_0xfaac21){var _0x250707=function(_0x84c2bd){while(--_0x84c2bd){_0x5959ce['push'](_0x5959ce['shift']());}};_0x250707(++_0xfaac21);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x4b5ed9,_0x207734){_0x4b5ed9=_0x4b5ed9-0x0;var _0x5598e4=_0x8e0f[_0x4b5ed9];return _0x5598e4;};'use strict';var pdf=require(_0xf8e0('0x0'));var emlformat=require(_0xf8e0('0x1'));var rimraf=require(_0xf8e0('0x2'));var zipdir=require(_0xf8e0('0x3'));var jsonpatch=require(_0xf8e0('0x4'));var rp=require(_0xf8e0('0x5'));var moment=require(_0xf8e0('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf8e0('0x7'));var util=require('util');var path=require(_0xf8e0('0x8'));var sox=require(_0xf8e0('0x9'));var csv=require('to-csv');var ejs=require(_0xf8e0('0xa'));var fs=require('fs');var _=require(_0xf8e0('0xb'));var squel=require(_0xf8e0('0xc'));var crypto=require(_0xf8e0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf8e0('0xe'));var toCsv=require(_0xf8e0('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf8e0('0x10'));var authService=require(_0xf8e0('0x11'));var qs=require(_0xf8e0('0x12'));var hardwareService=require(_0xf8e0('0x13'));var logger=require(_0xf8e0('0x14'))(_0xf8e0('0x15'));var utils=require(_0xf8e0('0x16'));var config=require(_0xf8e0('0x17'));var db=require(_0xf8e0('0x18'))['db'];function respondWithStatusCode(_0x5649f6,_0x1272ff){_0x1272ff=_0x1272ff||0xcc;return function(_0x113b45){if(_0x113b45){return _0x5649f6[_0xf8e0('0x19')](_0x1272ff);}return _0x5649f6[_0xf8e0('0x1a')](_0x1272ff)['end']();};}function respondWithResult(_0xf9ec0f,_0x5e958d){_0x5e958d=_0x5e958d||0xc8;return function(_0xea93ae){if(_0xea93ae){return _0xf9ec0f[_0xf8e0('0x1a')](_0x5e958d)[_0xf8e0('0x1b')](_0xea93ae);}};}function respondWithFilteredResult(_0x506587,_0x173f34){return function(_0x534844){if(_0x534844){var _0x151990=_0x534844[_0xf8e0('0x1c')],_0x4de3de=_0x173f34[_0xf8e0('0x1d')],_0x430b06=_0x173f34[_0xf8e0('0x1d')]+_0x173f34['limit'],_0x12d6f0;if(_0x430b06>=_0x151990){_0x430b06=_0x151990;_0x12d6f0=0xc8;}else{_0x12d6f0=0xce;}_0x506587[_0xf8e0('0x1a')](_0x12d6f0);return _0x506587['set'](_0xf8e0('0x1e'),_0x4de3de+'-'+_0x430b06+'/'+_0x151990)[_0xf8e0('0x1b')](_0x534844);}return null;};}function patchUpdates(_0x253064){return function(_0x366925){try{jsonpatch['apply'](_0x366925,_0x253064,!![]);}catch(_0x592936){return BPromise[_0xf8e0('0x1f')](_0x592936);}return _0x366925[_0xf8e0('0x20')]();};}function saveUpdates(_0x46f109,_0x1809a4){return function(_0x5e5ad6){if(_0x5e5ad6){return _0x5e5ad6[_0xf8e0('0x21')](_0x46f109)['then'](function(_0xd533d){return _0xd533d;});}return null;};}function removeEntity(_0x31da2f,_0x5d8089){return function(_0x2e3826){if(_0x2e3826){return _0x2e3826[_0xf8e0('0x22')]()[_0xf8e0('0x23')](function(){_0x31da2f[_0xf8e0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47d885,_0x8d9993){return function(_0x4cb871){if(!_0x4cb871){_0x47d885['sendStatus'](0x194);}return _0x4cb871;};}function handleError(_0x5f1b58,_0x13a022){_0x13a022=_0x13a022||0x1f4;return function(_0x2fe292){logger[_0xf8e0('0x24')](_0x2fe292[_0xf8e0('0x25')]);if(_0x2fe292[_0xf8e0('0x26')]){delete _0x2fe292[_0xf8e0('0x26')];}_0x5f1b58[_0xf8e0('0x1a')](_0x13a022)['send'](_0x2fe292);};}exports[_0xf8e0('0x27')]=function(_0x1bcaf6,_0x5b6a97){var _0x2458a6={},_0x17436a={},_0x37bacd={'count':0x0,'rows':[]};var _0x257362=db['ChatQueueReport'][_0xf8e0('0x28')];_0x17436a['model']=_['keys'](_0x257362);_0x17436a[_0xf8e0('0x29')]=_[_0xf8e0('0x2a')](_0x1bcaf6[_0xf8e0('0x29')]);_0x17436a[_0xf8e0('0x2b')]=_[_0xf8e0('0x2c')](_0x17436a[_0xf8e0('0x2d')],_0x17436a[_0xf8e0('0x29')]);_0x2458a6[_0xf8e0('0x2e')]=_[_0xf8e0('0x2c')](_0x17436a[_0xf8e0('0x2d')],qs['fields'](_0x1bcaf6[_0xf8e0('0x29')][_0xf8e0('0x2f')]));_0x2458a6[_0xf8e0('0x2e')]=_0x2458a6['attributes'][_0xf8e0('0x30')]?_0x2458a6['attributes']:_0x17436a[_0xf8e0('0x2d')];if(!_0x1bcaf6[_0xf8e0('0x29')]['hasOwnProperty'](_0xf8e0('0x31'))){_0x2458a6[_0xf8e0('0x32')]=qs['limit'](_0x1bcaf6[_0xf8e0('0x29')][_0xf8e0('0x32')]);_0x2458a6['offset']=qs[_0xf8e0('0x1d')](_0x1bcaf6['query'][_0xf8e0('0x1d')]);}_0x2458a6['order']=qs['sort'](_0x1bcaf6[_0xf8e0('0x29')][_0xf8e0('0x33')]);_0x2458a6[_0xf8e0('0x34')]=qs[_0xf8e0('0x2b')](_[_0xf8e0('0x35')](_0x1bcaf6[_0xf8e0('0x29')],_0x17436a[_0xf8e0('0x2b')]));if(_0x1bcaf6[_0xf8e0('0x29')][_0xf8e0('0x36')]){_0x2458a6[_0xf8e0('0x34')]=_[_0xf8e0('0x37')](_0x2458a6[_0xf8e0('0x34')],{'$or':_[_0xf8e0('0x38')](_0x257362,function(_0x5431dc){if(_0x5431dc[_0xf8e0('0x39')][_0xf8e0('0x3a')]!=='VIRTUAL'){var _0x4b900e={};_0x4b900e[_0x5431dc[_0xf8e0('0x3b')]]={'$like':'%'+_0x1bcaf6['query']['filter']+'%'};return _0x4b900e;}})});}_0x2458a6=_[_0xf8e0('0x37')]({},_0x2458a6,_0x1bcaf6[_0xf8e0('0x3c')]);var _0x17ff76={'where':_0x2458a6[_0xf8e0('0x34')]};return db['ChatQueueReport'][_0xf8e0('0x1c')](_0x17ff76)[_0xf8e0('0x23')](function(_0x812725){_0x37bacd[_0xf8e0('0x1c')]=_0x812725;if(_0x1bcaf6[_0xf8e0('0x29')]['includeAll']){_0x2458a6[_0xf8e0('0x3d')]=[{'all':!![]}];}return db[_0xf8e0('0x3e')][_0xf8e0('0x3f')](_0x2458a6);})[_0xf8e0('0x23')](function(_0xf88bf9){_0x37bacd[_0xf8e0('0x40')]=_0xf88bf9;return _0x37bacd;})[_0xf8e0('0x23')](respondWithFilteredResult(_0x5b6a97,_0x2458a6))[_0xf8e0('0x41')](handleError(_0x5b6a97,null));};exports[_0xf8e0('0x42')]=function(_0x398184,_0x13f517){var _0x4cfc38={'raw':!![],'where':{'id':_0x398184[_0xf8e0('0x43')]['id']}},_0x4a32b6={};_0x4a32b6[_0xf8e0('0x2d')]=_[_0xf8e0('0x2a')](db['ChatQueueReport'][_0xf8e0('0x28')]);_0x4a32b6['query']=_['keys'](_0x398184[_0xf8e0('0x29')]);_0x4a32b6[_0xf8e0('0x2b')]=_[_0xf8e0('0x2c')](_0x4a32b6[_0xf8e0('0x2d')],_0x4a32b6[_0xf8e0('0x29')]);_0x4cfc38[_0xf8e0('0x2e')]=_[_0xf8e0('0x2c')](_0x4a32b6[_0xf8e0('0x2d')],qs[_0xf8e0('0x2f')](_0x398184[_0xf8e0('0x29')][_0xf8e0('0x2f')]));_0x4cfc38[_0xf8e0('0x2e')]=_0x4cfc38[_0xf8e0('0x2e')][_0xf8e0('0x30')]?_0x4cfc38[_0xf8e0('0x2e')]:_0x4a32b6[_0xf8e0('0x2d')];if(_0x398184[_0xf8e0('0x29')][_0xf8e0('0x44')]){_0x4cfc38[_0xf8e0('0x3d')]=[{'all':!![]}];}_0x4cfc38=_[_0xf8e0('0x37')]({},_0x4cfc38,_0x398184[_0xf8e0('0x3c')]);return db[_0xf8e0('0x3e')][_0xf8e0('0x45')](_0x4cfc38)[_0xf8e0('0x23')](handleEntityNotFound(_0x13f517,null))[_0xf8e0('0x23')](respondWithResult(_0x13f517,null))['catch'](handleError(_0x13f517,null));};exports[_0xf8e0('0x46')]=function(_0x4dc2b8,_0x3f4f16){return db[_0xf8e0('0x3e')][_0xf8e0('0x46')](_0x4dc2b8[_0xf8e0('0x47')],{})[_0xf8e0('0x23')](respondWithResult(_0x3f4f16,0xc9))[_0xf8e0('0x41')](handleError(_0x3f4f16,null));};exports['update']=function(_0x44b9e0,_0x26ff76){if(_0x44b9e0[_0xf8e0('0x47')]['id']){delete _0x44b9e0[_0xf8e0('0x47')]['id'];}return db[_0xf8e0('0x3e')][_0xf8e0('0x45')]({'where':{'id':_0x44b9e0['params']['id']}})[_0xf8e0('0x23')](handleEntityNotFound(_0x26ff76,null))[_0xf8e0('0x23')](saveUpdates(_0x44b9e0['body'],null))[_0xf8e0('0x23')](respondWithResult(_0x26ff76,null))[_0xf8e0('0x41')](handleError(_0x26ff76,null));};exports[_0xf8e0('0x22')]=function(_0x1e4767,_0x24a838){return db[_0xf8e0('0x3e')][_0xf8e0('0x45')]({'where':{'id':_0x1e4767[_0xf8e0('0x43')]['id']}})['then'](handleEntityNotFound(_0x24a838,null))['then'](removeEntity(_0x24a838,null))[_0xf8e0('0x41')](handleError(_0x24a838,null));};exports['describe']=function(_0x2453fd,_0x4671ad){return db[_0xf8e0('0x3e')][_0xf8e0('0x48')]()['then'](respondWithResult(_0x4671ad,null))[_0xf8e0('0x41')](handleError(_0x4671ad,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index d3b5a35..b5da363 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bbe=['rimraf','../../config/environment','./chatQueueReport.attributes','exports','report_chat_queue','uniqueid','util','../../config/logger','api','bluebird','request-promise'];(function(_0x36f284,_0x24cbd1){var _0x4ea099=function(_0xea729e){while(--_0xea729e){_0x36f284['push'](_0x36f284['shift']());}};_0x4ea099(++_0x24cbd1);}(_0x0bbe,0x8a));var _0xe0bb=function(_0x5649c2,_0x5c8d04){_0x5649c2=_0x5649c2-0x0;var _0x28b072=_0x0bbe[_0x5649c2];return _0x28b072;};'use strict';var _=require('lodash');var util=require(_0xe0bb('0x0'));var logger=require(_0xe0bb('0x1'))(_0xe0bb('0x2'));var moment=require('moment');var BPromise=require(_0xe0bb('0x3'));var rp=require(_0xe0bb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0bb('0x5'));var config=require(_0xe0bb('0x6'));var attributes=require(_0xe0bb('0x7'));module[_0xe0bb('0x8')]=function(_0x3499ed,_0x1debeb){return _0x3499ed['define']('ChatQueueReport',attributes,{'tableName':_0xe0bb('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe0bb('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1ad7=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x5a3793,_0xd4db58){var _0x324792=function(_0x31ffdd){while(--_0x31ffdd){_0x5a3793['push'](_0x5a3793['shift']());}};_0x324792(++_0xd4db58);}(_0x1ad7,0x1b2));var _0x71ad=function(_0xef8e69,_0xbc78ff){_0xef8e69=_0xef8e69-0x0;var _0x463ee6=_0x1ad7[_0xef8e69];return _0x463ee6;};'use strict';var _=require(_0x71ad('0x0'));var util=require(_0x71ad('0x1'));var logger=require(_0x71ad('0x2'))(_0x71ad('0x3'));var moment=require(_0x71ad('0x4'));var BPromise=require('bluebird');var rp=require(_0x71ad('0x5'));var fs=require('fs');var path=require(_0x71ad('0x6'));var rimraf=require('rimraf');var config=require(_0x71ad('0x7'));var attributes=require(_0x71ad('0x8'));module[_0x71ad('0x9')]=function(_0x2462fc,_0x5bc1c0){return _0x2462fc[_0x71ad('0xa')](_0x71ad('0xb'),attributes,{'tableName':_0x71ad('0xc'),'paranoid':![],'indexes':[{'name':_0x71ad('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index b00f48d..2c3024f 100644 --- a/server/api/chatQueueReport/chatQueueReport.rpc.js +++ b/server/api/chatQueueReport/chatQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ab8=['client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where','limit','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x303221,_0x254ba3){var _0x43acd5=function(_0x17f12d){while(--_0x17f12d){_0x303221['push'](_0x303221['shift']());}};_0x43acd5(++_0x254ba3);}(_0x0ab8,0xb8));var _0x80ab=function(_0x52524a,_0x4ab4e0){_0x52524a=_0x52524a-0x0;var _0x53a6d5=_0x0ab8[_0x52524a];return _0x53a6d5;};'use strict';var _=require('lodash');var util=require(_0x80ab('0x0'));var moment=require(_0x80ab('0x1'));var BPromise=require(_0x80ab('0x2'));var rs=require(_0x80ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80ab('0x4'))['db'];var utils=require(_0x80ab('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x80ab('0x6'));var jayson=require(_0x80ab('0x7'));var client=jayson[_0x80ab('0x8')][_0x80ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18099a,_0x3b5948,_0x37113f){return new BPromise(function(_0x37e2d8,_0x3f4dec){return client[_0x80ab('0xa')](_0x18099a,_0x37113f)[_0x80ab('0xb')](function(_0x59cc09){logger[_0x80ab('0xc')](_0x80ab('0xd'),_0x3b5948,'request\x20sent');logger['debug'](_0x80ab('0xe'),_0x3b5948,'request\x20sent',JSON[_0x80ab('0xf')](_0x59cc09));if(_0x59cc09['error']){if(_0x59cc09[_0x80ab('0x10')][_0x80ab('0x11')]===0x1f4){logger[_0x80ab('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x3b5948,_0x59cc09[_0x80ab('0x10')]['message']);return _0x3f4dec(_0x59cc09['error']['message']);}logger[_0x80ab('0x10')](_0x80ab('0xd'),_0x3b5948,_0x59cc09[_0x80ab('0x10')]['message']);return _0x37e2d8(_0x59cc09[_0x80ab('0x10')][_0x80ab('0x12')]);}else{logger[_0x80ab('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x3b5948,_0x80ab('0x13'));_0x37e2d8(_0x59cc09[_0x80ab('0x14')][_0x80ab('0x12')]);}})[_0x80ab('0x15')](function(_0x303670){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3b5948,_0x303670);_0x3f4dec(_0x303670);});});}exports[_0x80ab('0x16')]=function(_0x4204ee){var _0x15c524=this;return new Promise(function(_0x127d50,_0x470c1f){return db[_0x80ab('0x17')][_0x80ab('0x18')](_0x4204ee[_0x80ab('0x19')],{'raw':_0x4204ee[_0x80ab('0x1a')]?_0x4204ee[_0x80ab('0x1a')][_0x80ab('0x1b')]===undefined?!![]:![]:!![]})[_0x80ab('0xb')](function(_0x4b345c){logger[_0x80ab('0xc')](_0x80ab('0x16'),_0x4204ee);logger['debug'](_0x80ab('0x16'),_0x4204ee,JSON['stringify'](_0x4b345c));_0x127d50(_0x4b345c);})[_0x80ab('0x15')](function(_0xc959d4){logger[_0x80ab('0x10')](_0x80ab('0x16'),_0xc959d4[_0x80ab('0x12')],_0x4204ee);_0x470c1f(_0x15c524[_0x80ab('0x10')](0x1f4,_0xc959d4['message']));});});};exports[_0x80ab('0x1c')]=function(_0x5b4349){var _0x5d7608=this;return new Promise(function(_0xc55a71,_0x1f51b6){return db['ChatQueueReport']['update'](_0x5b4349[_0x80ab('0x19')],{'raw':_0x5b4349[_0x80ab('0x1a')]?_0x5b4349[_0x80ab('0x1a')][_0x80ab('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b4349['options']?_0x5b4349[_0x80ab('0x1a')][_0x80ab('0x1d')]||null:null,'attributes':_0x5b4349[_0x80ab('0x1a')]?_0x5b4349[_0x80ab('0x1a')]['attributes']||null:null,'limit':_0x5b4349[_0x80ab('0x1a')]?_0x5b4349[_0x80ab('0x1a')][_0x80ab('0x1e')]||null:null})['then'](function(_0x53819f){logger[_0x80ab('0xc')](_0x80ab('0x1c'),_0x5b4349);logger[_0x80ab('0x1f')](_0x80ab('0x1c'),_0x5b4349,JSON[_0x80ab('0xf')](_0x53819f));_0xc55a71(_0x53819f);})[_0x80ab('0x15')](function(_0x245b1f){logger[_0x80ab('0x10')](_0x80ab('0x1c'),_0x245b1f[_0x80ab('0x12')],_0x5b4349);_0x1f51b6(_0x5d7608[_0x80ab('0x10')](0x1f4,_0x245b1f[_0x80ab('0x12')]));});});}; \ No newline at end of file +var _0x62ef=['create','body','raw','info','update','options','where','attributes','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x44655d,_0x5350d0){var _0x3e479c=function(_0x2e70c9){while(--_0x2e70c9){_0x44655d['push'](_0x44655d['shift']());}};_0x3e479c(++_0x5350d0);}(_0x62ef,0xcf));var _0xf62e=function(_0x384a65,_0x4a54b1){_0x384a65=_0x384a65-0x0;var _0x158090=_0x62ef[_0x384a65];return _0x158090;};'use strict';var _=require(_0xf62e('0x0'));var util=require('util');var moment=require(_0xf62e('0x1'));var BPromise=require(_0xf62e('0x2'));var rs=require(_0xf62e('0x3'));var fs=require('fs');var Redis=require(_0xf62e('0x4'));var db=require(_0xf62e('0x5'))['db'];var utils=require(_0xf62e('0x6'));var logger=require('../../config/logger')(_0xf62e('0x7'));var config=require(_0xf62e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf62e('0x9')][_0xf62e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cca67,_0x3259c8,_0x44fcae){return new BPromise(function(_0x2bd4b0,_0x1363ba){return client[_0xf62e('0xb')](_0x5cca67,_0x44fcae)[_0xf62e('0xc')](function(_0x2f5e6f){logger['info'](_0xf62e('0xd'),_0x3259c8,_0xf62e('0xe'));logger[_0xf62e('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3259c8,_0xf62e('0xe'),JSON[_0xf62e('0x10')](_0x2f5e6f));if(_0x2f5e6f['error']){if(_0x2f5e6f[_0xf62e('0x11')][_0xf62e('0x12')]===0x1f4){logger[_0xf62e('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x3259c8,_0x2f5e6f[_0xf62e('0x11')][_0xf62e('0x13')]);return _0x1363ba(_0x2f5e6f['error']['message']);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3259c8,_0x2f5e6f['error'][_0xf62e('0x13')]);return _0x2bd4b0(_0x2f5e6f[_0xf62e('0x11')][_0xf62e('0x13')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x3259c8,_0xf62e('0xe'));_0x2bd4b0(_0x2f5e6f[_0xf62e('0x14')][_0xf62e('0x13')]);}})[_0xf62e('0x15')](function(_0x5255aa){logger[_0xf62e('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x3259c8,_0x5255aa);_0x1363ba(_0x5255aa);});});}exports[_0xf62e('0x16')]=function(_0xd03460){var _0x2eea00=this;return new Promise(function(_0x585b0f,_0x395688){return db[_0xf62e('0x17')][_0xf62e('0x18')](_0xd03460[_0xf62e('0x19')],{'raw':_0xd03460['options']?_0xd03460['options'][_0xf62e('0x1a')]===undefined?!![]:![]:!![]})[_0xf62e('0xc')](function(_0x50c761){logger[_0xf62e('0x1b')](_0xf62e('0x16'),_0xd03460);logger['debug'](_0xf62e('0x16'),_0xd03460,JSON[_0xf62e('0x10')](_0x50c761));_0x585b0f(_0x50c761);})['catch'](function(_0x4a28c9){logger[_0xf62e('0x11')](_0xf62e('0x16'),_0x4a28c9['message'],_0xd03460);_0x395688(_0x2eea00[_0xf62e('0x11')](0x1f4,_0x4a28c9[_0xf62e('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x32357e){var _0x35d206=this;return new Promise(function(_0x16e319,_0x39d7b0){return db[_0xf62e('0x17')][_0xf62e('0x1c')](_0x32357e['body'],{'raw':_0x32357e[_0xf62e('0x1d')]?_0x32357e[_0xf62e('0x1d')][_0xf62e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32357e[_0xf62e('0x1d')]?_0x32357e[_0xf62e('0x1d')][_0xf62e('0x1e')]||null:null,'attributes':_0x32357e['options']?_0x32357e['options'][_0xf62e('0x1f')]||null:null,'limit':_0x32357e[_0xf62e('0x1d')]?_0x32357e[_0xf62e('0x1d')]['limit']||null:null})[_0xf62e('0xc')](function(_0x46d9b2){logger[_0xf62e('0x1b')]('UpdateChatQueueReport',_0x32357e);logger[_0xf62e('0xf')](_0xf62e('0x20'),_0x32357e,JSON['stringify'](_0x46d9b2));_0x16e319(_0x46d9b2);})[_0xf62e('0x15')](function(_0x528ad1){logger['error']('UpdateChatQueueReport',_0x528ad1[_0xf62e('0x13')],_0x32357e);_0x39d7b0(_0x35d206[_0xf62e('0x11')](0x1f4,_0x528ad1[_0xf62e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index eb83f44..12f35af 100644 --- a/server/api/chatQueueReport/index.js +++ b/server/api/chatQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a85=['isAuthenticated','index','/describe','/:id','show','create','update','delete','destroy','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x3a85,0x6f));var _0x53a8=function(_0xac04d7,_0x58894e){_0xac04d7=_0xac04d7-0x0;var _0x5b1ee1=_0x3a85[_0xac04d7];return _0x5b1ee1;};'use strict';var multer=require('multer');var util=require(_0x53a8('0x0'));var path=require(_0x53a8('0x1'));var timeout=require('connect-timeout');var express=require(_0x53a8('0x2'));var router=express[_0x53a8('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x53a8('0x4'));var config=require(_0x53a8('0x5'));var controller=require(_0x53a8('0x6'));router[_0x53a8('0x7')]('/',auth[_0x53a8('0x8')](),controller[_0x53a8('0x9')]);router[_0x53a8('0x7')](_0x53a8('0xa'),auth[_0x53a8('0x8')](),controller['describe']);router[_0x53a8('0x7')](_0x53a8('0xb'),auth[_0x53a8('0x8')](),controller[_0x53a8('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x53a8('0xd')]);router['put'](_0x53a8('0xb'),auth['isAuthenticated'](),controller[_0x53a8('0xe')]);router[_0x53a8('0xf')](_0x53a8('0xb'),auth[_0x53a8('0x8')](),controller[_0x53a8('0x10')]);module['exports']=router; \ No newline at end of file +var _0xabb5=['show','create','put','destroy','util','path','connect-timeout','Router','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','/:id'];(function(_0x2d061c,_0x48e86c){var _0x2f1dfd=function(_0x38238c){while(--_0x38238c){_0x2d061c['push'](_0x2d061c['shift']());}};_0x2f1dfd(++_0x48e86c);}(_0xabb5,0xa9));var _0x5abb=function(_0x23b9c8,_0x466b18){_0x23b9c8=_0x23b9c8-0x0;var _0x31b3b2=_0xabb5[_0x23b9c8];return _0x31b3b2;};'use strict';var multer=require('multer');var util=require(_0x5abb('0x0'));var path=require(_0x5abb('0x1'));var timeout=require(_0x5abb('0x2'));var express=require('express');var router=express[_0x5abb('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5abb('0x4'));var controller=require(_0x5abb('0x5'));router['get']('/',auth[_0x5abb('0x6')](),controller[_0x5abb('0x7')]);router[_0x5abb('0x8')](_0x5abb('0x9'),auth[_0x5abb('0x6')](),controller['describe']);router[_0x5abb('0x8')](_0x5abb('0xa'),auth['isAuthenticated'](),controller[_0x5abb('0xb')]);router['post']('/',auth[_0x5abb('0x6')](),controller[_0x5abb('0xc')]);router[_0x5abb('0xd')]('/:id',auth[_0x5abb('0x6')](),controller['update']);router['delete'](_0x5abb('0xa'),auth['isAuthenticated'](),controller[_0x5abb('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index b46496f..fb6efc2 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0983=['sequelize','exports','STRING','ENUM','agent','queue','DATE','NOW','moment'];(function(_0x1bcf5b,_0xd5637f){var _0x352544=function(_0x1401a7){while(--_0x1401a7){_0x1bcf5b['push'](_0x1bcf5b['shift']());}};_0x352544(++_0xd5637f);}(_0x0983,0xbc));var _0x3098=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0983[_0x1cc8fe];return _0x230054;};'use strict';var moment=require(_0x3098('0x0'));var Sequelize=require(_0x3098('0x1'));module[_0x3098('0x2')]={'uniqueid':{'type':Sequelize[_0x3098('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x3098('0x4')]('account',_0x3098('0x5'),_0x3098('0x6')),'allowNull':![],'defaultValue':_0x3098('0x6')},'transferredAt':{'type':Sequelize[_0x3098('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x3098('0x8')]}}; \ No newline at end of file +var _0x899f=['sequelize','ENUM','account','queue','NOW','moment'];(function(_0x2248f6,_0x24ee4d){var _0x1446ea=function(_0x52dd40){while(--_0x52dd40){_0x2248f6['push'](_0x2248f6['shift']());}};_0x1446ea(++_0x24ee4d);}(_0x899f,0x191));var _0xf899=function(_0x27530d,_0x46480a){_0x27530d=_0x27530d-0x0;var _0x59e561=_0x899f[_0x27530d];return _0x59e561;};'use strict';var moment=require(_0xf899('0x0'));var Sequelize=require(_0xf899('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf899('0x2')](_0xf899('0x3'),'agent',_0xf899('0x4')),'allowNull':![],'defaultValue':_0xf899('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xf899('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 87c6b5e..0956b16 100644 --- a/server/api/chatTransferReport/chatTransferReport.controller.js +++ b/server/api/chatTransferReport/chatTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6846=['intersection','fields','length','nolimit','limit','sort','pick','where','map','key','VIRTUAL','filter','options','includeAll','include','findAll','catch','merge','find','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','ChatTransferReport','rawAttributes','keys','query','filters','model','attributes'];(function(_0x3b9368,_0x52be6f){var _0x27290d=function(_0x4161b5){while(--_0x4161b5){_0x3b9368['push'](_0x3b9368['shift']());}};_0x27290d(++_0x52be6f);}(_0x6846,0xf2));var _0x6684=function(_0x5c18cf,_0x21e920){_0x5c18cf=_0x5c18cf-0x0;var _0x26f627=_0x6846[_0x5c18cf];return _0x26f627;};'use strict';var pdf=require(_0x6684('0x0'));var emlformat=require(_0x6684('0x1'));var rimraf=require(_0x6684('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6684('0x3'));var rp=require(_0x6684('0x4'));var moment=require(_0x6684('0x5'));var BPromise=require(_0x6684('0x6'));var Mustache=require(_0x6684('0x7'));var util=require(_0x6684('0x8'));var path=require(_0x6684('0x9'));var sox=require(_0x6684('0xa'));var csv=require(_0x6684('0xb'));var ejs=require(_0x6684('0xc'));var fs=require('fs');var _=require(_0x6684('0xd'));var squel=require(_0x6684('0xe'));var crypto=require(_0x6684('0xf'));var jsforce=require(_0x6684('0x10'));var deskjs=require(_0x6684('0x11'));var toCsv=require('to-csv');var querystring=require(_0x6684('0x12'));var Papa=require(_0x6684('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6684('0x14'));var hardwareService=require(_0x6684('0x15'));var logger=require(_0x6684('0x16'))(_0x6684('0x17'));var utils=require(_0x6684('0x18'));var config=require(_0x6684('0x19'));var db=require(_0x6684('0x1a'))['db'];function respondWithStatusCode(_0x1f362b,_0x5bbe45){_0x5bbe45=_0x5bbe45||0xcc;return function(_0x285dea){if(_0x285dea){return _0x1f362b[_0x6684('0x1b')](_0x5bbe45);}return _0x1f362b[_0x6684('0x1c')](_0x5bbe45)['end']();};}function respondWithResult(_0x11ea36,_0x42dec8){_0x42dec8=_0x42dec8||0xc8;return function(_0x4d17c6){if(_0x4d17c6){return _0x11ea36[_0x6684('0x1c')](_0x42dec8)[_0x6684('0x1d')](_0x4d17c6);}};}function respondWithFilteredResult(_0x38dcf2,_0x458ffb){return function(_0x18d6c8){if(_0x18d6c8){var _0x511d0a=_0x18d6c8[_0x6684('0x1e')],_0x2cda98=_0x458ffb[_0x6684('0x1f')],_0x198b3e=_0x458ffb[_0x6684('0x1f')]+_0x458ffb['limit'],_0x4602c3;if(_0x198b3e>=_0x511d0a){_0x198b3e=_0x511d0a;_0x4602c3=0xc8;}else{_0x4602c3=0xce;}_0x38dcf2[_0x6684('0x1c')](_0x4602c3);return _0x38dcf2[_0x6684('0x20')](_0x6684('0x21'),_0x2cda98+'-'+_0x198b3e+'/'+_0x511d0a)[_0x6684('0x1d')](_0x18d6c8);}return null;};}function patchUpdates(_0x4960ea){return function(_0x5ef763){try{jsonpatch[_0x6684('0x22')](_0x5ef763,_0x4960ea,!![]);}catch(_0x61b8cc){return BPromise[_0x6684('0x23')](_0x61b8cc);}return _0x5ef763[_0x6684('0x24')]();};}function saveUpdates(_0x220b3d,_0x46df5a){return function(_0x44afeb){if(_0x44afeb){return _0x44afeb[_0x6684('0x25')](_0x220b3d)[_0x6684('0x26')](function(_0x26a718){return _0x26a718;});}return null;};}function removeEntity(_0x405e91,_0x6c7898){return function(_0x2945bd){if(_0x2945bd){return _0x2945bd[_0x6684('0x27')]()[_0x6684('0x26')](function(){_0x405e91[_0x6684('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2884f9,_0x449025){return function(_0x49fbd2){if(!_0x49fbd2){_0x2884f9[_0x6684('0x1b')](0x194);}return _0x49fbd2;};}function handleError(_0x189d09,_0x5e6399){_0x5e6399=_0x5e6399||0x1f4;return function(_0x879f71){logger['error'](_0x879f71[_0x6684('0x28')]);if(_0x879f71['name']){delete _0x879f71[_0x6684('0x29')];}_0x189d09[_0x6684('0x1c')](_0x5e6399)['send'](_0x879f71);};}exports[_0x6684('0x2a')]=function(_0x278b86,_0x3dbf61){var _0x4e3010={},_0x286a67={},_0xd56222={'count':0x0,'rows':[]};var _0x6d0529=db[_0x6684('0x2b')][_0x6684('0x2c')];_0x286a67['model']=_[_0x6684('0x2d')](_0x6d0529);_0x286a67[_0x6684('0x2e')]=_[_0x6684('0x2d')](_0x278b86[_0x6684('0x2e')]);_0x286a67[_0x6684('0x2f')]=_['intersection'](_0x286a67[_0x6684('0x30')],_0x286a67[_0x6684('0x2e')]);_0x4e3010[_0x6684('0x31')]=_[_0x6684('0x32')](_0x286a67['model'],qs[_0x6684('0x33')](_0x278b86[_0x6684('0x2e')]['fields']));_0x4e3010[_0x6684('0x31')]=_0x4e3010[_0x6684('0x31')][_0x6684('0x34')]?_0x4e3010['attributes']:_0x286a67[_0x6684('0x30')];if(!_0x278b86[_0x6684('0x2e')]['hasOwnProperty'](_0x6684('0x35'))){_0x4e3010[_0x6684('0x36')]=qs[_0x6684('0x36')](_0x278b86['query'][_0x6684('0x36')]);_0x4e3010[_0x6684('0x1f')]=qs[_0x6684('0x1f')](_0x278b86[_0x6684('0x2e')][_0x6684('0x1f')]);}_0x4e3010['order']=qs[_0x6684('0x37')](_0x278b86[_0x6684('0x2e')]['sort']);_0x4e3010['where']=qs[_0x6684('0x2f')](_[_0x6684('0x38')](_0x278b86[_0x6684('0x2e')],_0x286a67[_0x6684('0x2f')]));if(_0x278b86[_0x6684('0x2e')]['filter']){_0x4e3010['where']=_['merge'](_0x4e3010[_0x6684('0x39')],{'$or':_[_0x6684('0x3a')](_0x6d0529,function(_0x5389d0){if(_0x5389d0['type'][_0x6684('0x3b')]!==_0x6684('0x3c')){var _0xd73e03={};_0xd73e03[_0x5389d0['field']]={'$like':'%'+_0x278b86[_0x6684('0x2e')][_0x6684('0x3d')]+'%'};return _0xd73e03;}})});}_0x4e3010=_['merge']({},_0x4e3010,_0x278b86[_0x6684('0x3e')]);var _0xfea05f={'where':_0x4e3010[_0x6684('0x39')]};return db[_0x6684('0x2b')]['count'](_0xfea05f)[_0x6684('0x26')](function(_0x2d66d5){_0xd56222[_0x6684('0x1e')]=_0x2d66d5;if(_0x278b86['query'][_0x6684('0x3f')]){_0x4e3010[_0x6684('0x40')]=[{'all':!![]}];}return db[_0x6684('0x2b')][_0x6684('0x41')](_0x4e3010);})['then'](function(_0x11e098){_0xd56222['rows']=_0x11e098;return _0xd56222;})['then'](respondWithFilteredResult(_0x3dbf61,_0x4e3010))[_0x6684('0x42')](handleError(_0x3dbf61,null));};exports['show']=function(_0x1e6c23,_0x5f5ab0){var _0x97edbb={'raw':!![],'where':{'id':_0x1e6c23['params']['id']}},_0xde6fd4={};_0xde6fd4[_0x6684('0x30')]=_[_0x6684('0x2d')](db[_0x6684('0x2b')][_0x6684('0x2c')]);_0xde6fd4[_0x6684('0x2e')]=_[_0x6684('0x2d')](_0x1e6c23[_0x6684('0x2e')]);_0xde6fd4[_0x6684('0x2f')]=_[_0x6684('0x32')](_0xde6fd4[_0x6684('0x30')],_0xde6fd4['query']);_0x97edbb['attributes']=_[_0x6684('0x32')](_0xde6fd4['model'],qs[_0x6684('0x33')](_0x1e6c23[_0x6684('0x2e')][_0x6684('0x33')]));_0x97edbb[_0x6684('0x31')]=_0x97edbb[_0x6684('0x31')][_0x6684('0x34')]?_0x97edbb['attributes']:_0xde6fd4[_0x6684('0x30')];if(_0x1e6c23[_0x6684('0x2e')]['includeAll']){_0x97edbb[_0x6684('0x40')]=[{'all':!![]}];}_0x97edbb=_[_0x6684('0x43')]({},_0x97edbb,_0x1e6c23[_0x6684('0x3e')]);return db[_0x6684('0x2b')][_0x6684('0x44')](_0x97edbb)['then'](handleEntityNotFound(_0x5f5ab0,null))[_0x6684('0x26')](respondWithResult(_0x5f5ab0,null))[_0x6684('0x42')](handleError(_0x5f5ab0,null));};exports[_0x6684('0x45')]=function(_0x1a1775,_0x14aefa){return db['ChatTransferReport'][_0x6684('0x45')](_0x1a1775['body'],{})[_0x6684('0x26')](respondWithResult(_0x14aefa,0xc9))[_0x6684('0x42')](handleError(_0x14aefa,null));};exports[_0x6684('0x25')]=function(_0x384cb7,_0x553f5b){if(_0x384cb7[_0x6684('0x46')]['id']){delete _0x384cb7[_0x6684('0x46')]['id'];}return db['ChatTransferReport'][_0x6684('0x44')]({'where':{'id':_0x384cb7[_0x6684('0x47')]['id']}})['then'](handleEntityNotFound(_0x553f5b,null))[_0x6684('0x26')](saveUpdates(_0x384cb7['body'],null))['then'](respondWithResult(_0x553f5b,null))['catch'](handleError(_0x553f5b,null));};exports['destroy']=function(_0x1450a4,_0x3b0d49){return db[_0x6684('0x2b')][_0x6684('0x44')]({'where':{'id':_0x1450a4['params']['id']}})[_0x6684('0x26')](handleEntityNotFound(_0x3b0d49,null))['then'](removeEntity(_0x3b0d49,null))[_0x6684('0x42')](handleError(_0x3b0d49,null));};exports[_0x6684('0x48')]=function(_0x187f0b,_0x378135){return db[_0x6684('0x2b')][_0x6684('0x48')]()[_0x6684('0x26')](respondWithResult(_0x378135,null))['catch'](handleError(_0x378135,null));}; \ No newline at end of file +var _0xa096=['to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatTransferReport','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','nolimit','limit','sort','pick','merge','where','type','key','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x1e6668,_0x4c3957){var _0x31798e=function(_0xef8599){while(--_0xef8599){_0x1e6668['push'](_0x1e6668['shift']());}};_0x31798e(++_0x4c3957);}(_0xa096,0xcd));var _0x6a09=function(_0x3c1898,_0x334e10){_0x3c1898=_0x3c1898-0x0;var _0x2043f0=_0xa096[_0x3c1898];return _0x2043f0;};'use strict';var pdf=require(_0x6a09('0x0'));var emlformat=require(_0x6a09('0x1'));var rimraf=require(_0x6a09('0x2'));var zipdir=require(_0x6a09('0x3'));var jsonpatch=require(_0x6a09('0x4'));var rp=require('request-promise');var moment=require(_0x6a09('0x5'));var BPromise=require(_0x6a09('0x6'));var Mustache=require(_0x6a09('0x7'));var util=require(_0x6a09('0x8'));var path=require(_0x6a09('0x9'));var sox=require(_0x6a09('0xa'));var csv=require(_0x6a09('0xb'));var ejs=require(_0x6a09('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6a09('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6a09('0xe'));var toCsv=require(_0x6a09('0xb'));var querystring=require('querystring');var Papa=require(_0x6a09('0xf'));var Redis=require(_0x6a09('0x10'));var authService=require(_0x6a09('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a09('0x12'))(_0x6a09('0x13'));var utils=require('../../config/utils');var config=require(_0x6a09('0x14'));var db=require(_0x6a09('0x15'))['db'];function respondWithStatusCode(_0x3567cd,_0x15d560){_0x15d560=_0x15d560||0xcc;return function(_0x44037f){if(_0x44037f){return _0x3567cd[_0x6a09('0x16')](_0x15d560);}return _0x3567cd[_0x6a09('0x17')](_0x15d560)[_0x6a09('0x18')]();};}function respondWithResult(_0x536fd0,_0x5cfabc){_0x5cfabc=_0x5cfabc||0xc8;return function(_0x4f179c){if(_0x4f179c){return _0x536fd0[_0x6a09('0x17')](_0x5cfabc)[_0x6a09('0x19')](_0x4f179c);}};}function respondWithFilteredResult(_0x2770a0,_0x426b95){return function(_0x240cc6){if(_0x240cc6){var _0x593034=_0x240cc6[_0x6a09('0x1a')],_0x5deebd=_0x426b95[_0x6a09('0x1b')],_0x47d6f5=_0x426b95['offset']+_0x426b95['limit'],_0xf5e7db;if(_0x47d6f5>=_0x593034){_0x47d6f5=_0x593034;_0xf5e7db=0xc8;}else{_0xf5e7db=0xce;}_0x2770a0[_0x6a09('0x17')](_0xf5e7db);return _0x2770a0[_0x6a09('0x1c')](_0x6a09('0x1d'),_0x5deebd+'-'+_0x47d6f5+'/'+_0x593034)['json'](_0x240cc6);}return null;};}function patchUpdates(_0x53bd26){return function(_0x54996f){try{jsonpatch[_0x6a09('0x1e')](_0x54996f,_0x53bd26,!![]);}catch(_0x7f86e0){return BPromise[_0x6a09('0x1f')](_0x7f86e0);}return _0x54996f[_0x6a09('0x20')]();};}function saveUpdates(_0x176c64,_0x3c7904){return function(_0x25b39c){if(_0x25b39c){return _0x25b39c[_0x6a09('0x21')](_0x176c64)[_0x6a09('0x22')](function(_0x46ff9f){return _0x46ff9f;});}return null;};}function removeEntity(_0x52e74e,_0x190fee){return function(_0x148d5b){if(_0x148d5b){return _0x148d5b[_0x6a09('0x23')]()[_0x6a09('0x22')](function(){_0x52e74e['status'](0xcc)[_0x6a09('0x18')]();});}};}function handleEntityNotFound(_0x48d35c,_0x25f57b){return function(_0x7cb06e){if(!_0x7cb06e){_0x48d35c['sendStatus'](0x194);}return _0x7cb06e;};}function handleError(_0x5a7bfe,_0x14d9f8){_0x14d9f8=_0x14d9f8||0x1f4;return function(_0x12c611){logger[_0x6a09('0x24')](_0x12c611[_0x6a09('0x25')]);if(_0x12c611[_0x6a09('0x26')]){delete _0x12c611[_0x6a09('0x26')];}_0x5a7bfe[_0x6a09('0x17')](_0x14d9f8)[_0x6a09('0x27')](_0x12c611);};}exports[_0x6a09('0x28')]=function(_0x391415,_0xc6f9bf){var _0x3b7057={},_0x3f8e89={},_0x4879={'count':0x0,'rows':[]};var _0x54d2b0=db[_0x6a09('0x29')][_0x6a09('0x2a')];_0x3f8e89['model']=_[_0x6a09('0x2b')](_0x54d2b0);_0x3f8e89[_0x6a09('0x2c')]=_['keys'](_0x391415[_0x6a09('0x2c')]);_0x3f8e89[_0x6a09('0x2d')]=_[_0x6a09('0x2e')](_0x3f8e89['model'],_0x3f8e89[_0x6a09('0x2c')]);_0x3b7057['attributes']=_['intersection'](_0x3f8e89[_0x6a09('0x2f')],qs[_0x6a09('0x30')](_0x391415[_0x6a09('0x2c')][_0x6a09('0x30')]));_0x3b7057[_0x6a09('0x31')]=_0x3b7057[_0x6a09('0x31')][_0x6a09('0x32')]?_0x3b7057[_0x6a09('0x31')]:_0x3f8e89[_0x6a09('0x2f')];if(!_0x391415['query']['hasOwnProperty'](_0x6a09('0x33'))){_0x3b7057[_0x6a09('0x34')]=qs['limit'](_0x391415[_0x6a09('0x2c')][_0x6a09('0x34')]);_0x3b7057['offset']=qs[_0x6a09('0x1b')](_0x391415[_0x6a09('0x2c')][_0x6a09('0x1b')]);}_0x3b7057['order']=qs[_0x6a09('0x35')](_0x391415['query'][_0x6a09('0x35')]);_0x3b7057['where']=qs[_0x6a09('0x2d')](_[_0x6a09('0x36')](_0x391415[_0x6a09('0x2c')],_0x3f8e89[_0x6a09('0x2d')]));if(_0x391415[_0x6a09('0x2c')]['filter']){_0x3b7057['where']=_[_0x6a09('0x37')](_0x3b7057[_0x6a09('0x38')],{'$or':_['map'](_0x54d2b0,function(_0x4e69ad){if(_0x4e69ad[_0x6a09('0x39')][_0x6a09('0x3a')]!=='VIRTUAL'){var _0x4783f8={};_0x4783f8[_0x4e69ad['field']]={'$like':'%'+_0x391415[_0x6a09('0x2c')][_0x6a09('0x3b')]+'%'};return _0x4783f8;}})});}_0x3b7057=_['merge']({},_0x3b7057,_0x391415[_0x6a09('0x3c')]);var _0x46582b={'where':_0x3b7057[_0x6a09('0x38')]};return db[_0x6a09('0x29')][_0x6a09('0x1a')](_0x46582b)[_0x6a09('0x22')](function(_0x3c439b){_0x4879[_0x6a09('0x1a')]=_0x3c439b;if(_0x391415[_0x6a09('0x2c')][_0x6a09('0x3d')]){_0x3b7057[_0x6a09('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x6a09('0x3f')](_0x3b7057);})[_0x6a09('0x22')](function(_0x37dd8a){_0x4879[_0x6a09('0x40')]=_0x37dd8a;return _0x4879;})[_0x6a09('0x22')](respondWithFilteredResult(_0xc6f9bf,_0x3b7057))[_0x6a09('0x41')](handleError(_0xc6f9bf,null));};exports[_0x6a09('0x42')]=function(_0x822154,_0x16d67e){var _0x6ace58={'raw':!![],'where':{'id':_0x822154['params']['id']}},_0x209f74={};_0x209f74[_0x6a09('0x2f')]=_[_0x6a09('0x2b')](db[_0x6a09('0x29')]['rawAttributes']);_0x209f74[_0x6a09('0x2c')]=_[_0x6a09('0x2b')](_0x822154[_0x6a09('0x2c')]);_0x209f74[_0x6a09('0x2d')]=_[_0x6a09('0x2e')](_0x209f74[_0x6a09('0x2f')],_0x209f74[_0x6a09('0x2c')]);_0x6ace58['attributes']=_[_0x6a09('0x2e')](_0x209f74['model'],qs[_0x6a09('0x30')](_0x822154[_0x6a09('0x2c')][_0x6a09('0x30')]));_0x6ace58['attributes']=_0x6ace58['attributes'][_0x6a09('0x32')]?_0x6ace58[_0x6a09('0x31')]:_0x209f74['model'];if(_0x822154[_0x6a09('0x2c')][_0x6a09('0x3d')]){_0x6ace58[_0x6a09('0x3e')]=[{'all':!![]}];}_0x6ace58=_[_0x6a09('0x37')]({},_0x6ace58,_0x822154[_0x6a09('0x3c')]);return db['ChatTransferReport'][_0x6a09('0x43')](_0x6ace58)['then'](handleEntityNotFound(_0x16d67e,null))['then'](respondWithResult(_0x16d67e,null))[_0x6a09('0x41')](handleError(_0x16d67e,null));};exports['create']=function(_0x5891cd,_0x658cf6){return db[_0x6a09('0x29')][_0x6a09('0x44')](_0x5891cd[_0x6a09('0x45')],{})[_0x6a09('0x22')](respondWithResult(_0x658cf6,0xc9))[_0x6a09('0x41')](handleError(_0x658cf6,null));};exports['update']=function(_0x9a5dd7,_0x1aa566){if(_0x9a5dd7[_0x6a09('0x45')]['id']){delete _0x9a5dd7['body']['id'];}return db[_0x6a09('0x29')][_0x6a09('0x43')]({'where':{'id':_0x9a5dd7[_0x6a09('0x46')]['id']}})[_0x6a09('0x22')](handleEntityNotFound(_0x1aa566,null))[_0x6a09('0x22')](saveUpdates(_0x9a5dd7[_0x6a09('0x45')],null))[_0x6a09('0x22')](respondWithResult(_0x1aa566,null))[_0x6a09('0x41')](handleError(_0x1aa566,null));};exports[_0x6a09('0x23')]=function(_0x16c8a0,_0x596e2f){return db['ChatTransferReport'][_0x6a09('0x43')]({'where':{'id':_0x16c8a0[_0x6a09('0x46')]['id']}})[_0x6a09('0x22')](handleEntityNotFound(_0x596e2f,null))['then'](removeEntity(_0x596e2f,null))[_0x6a09('0x41')](handleError(_0x596e2f,null));};exports[_0x6a09('0x47')]=function(_0x1708f2,_0x4773c9){return db[_0x6a09('0x29')]['describe']()[_0x6a09('0x22')](respondWithResult(_0x4773c9,null))[_0x6a09('0x41')](handleError(_0x4773c9,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 96ea203..810b4a4 100644 --- a/server/api/chatTransferReport/chatTransferReport.model.js +++ b/server/api/chatTransferReport/chatTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8baa=['uniqueid','util','../../config/logger','api','path','../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer'];(function(_0x21a8ba,_0x2b09e1){var _0x1da12a=function(_0xb9a7f0){while(--_0xb9a7f0){_0x21a8ba['push'](_0x21a8ba['shift']());}};_0x1da12a(++_0x2b09e1);}(_0x8baa,0x12a));var _0xa8ba=function(_0x3eba80,_0x569e49){_0x3eba80=_0x3eba80-0x0;var _0x3dfa32=_0x8baa[_0x3eba80];return _0x3dfa32;};'use strict';var _=require('lodash');var util=require(_0xa8ba('0x0'));var logger=require(_0xa8ba('0x1'))(_0xa8ba('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8ba('0x3'));var rimraf=require('rimraf');var config=require(_0xa8ba('0x4'));var attributes=require(_0xa8ba('0x5'));module['exports']=function(_0x49cbaf,_0x438796){return _0x49cbaf['define'](_0xa8ba('0x6'),attributes,{'tableName':_0xa8ba('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa8ba('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0aa4=['path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','bluebird','request-promise'];(function(_0x50549f,_0x242628){var _0x19eaba=function(_0xc97812){while(--_0xc97812){_0x50549f['push'](_0x50549f['shift']());}};_0x19eaba(++_0x242628);}(_0x0aa4,0x13c));var _0x40aa=function(_0x4a3f82,_0x150492){_0x4a3f82=_0x4a3f82-0x0;var _0x4356f5=_0x0aa4[_0x4a3f82];return _0x4356f5;};'use strict';var _=require(_0x40aa('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x40aa('0x1'));var rp=require(_0x40aa('0x2'));var fs=require('fs');var path=require(_0x40aa('0x3'));var rimraf=require(_0x40aa('0x4'));var config=require(_0x40aa('0x5'));var attributes=require(_0x40aa('0x6'));module['exports']=function(_0x2eb9d7,_0x554996){return _0x2eb9d7[_0x40aa('0x7')](_0x40aa('0x8'),attributes,{'tableName':_0x40aa('0x9'),'paranoid':![],'indexes':[{'name':_0x40aa('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 4c5c743..15a202f 100644 --- a/server/api/chatTransferReport/chatTransferReport.rpc.js +++ b/server/api/chatTransferReport/chatTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6604=['ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','request\x20sent','debug'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0x6604,0x1ab));var _0x4660=function(_0x52067c,_0x316b0b){_0x52067c=_0x52067c-0x0;var _0x278e95=_0x6604[_0x52067c];return _0x278e95;};'use strict';var _=require(_0x4660('0x0'));var util=require(_0x4660('0x1'));var moment=require(_0x4660('0x2'));var BPromise=require(_0x4660('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4660('0x4'));var db=require(_0x4660('0x5'))['db'];var utils=require(_0x4660('0x6'));var logger=require(_0x4660('0x7'))(_0x4660('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4660('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5dad1f,_0xdda522,_0x3f2c1b){return new BPromise(function(_0xef10af,_0x5022c8){return client['request'](_0x5dad1f,_0x3f2c1b)[_0x4660('0xa')](function(_0x266abf){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0xdda522,_0x4660('0xb'));logger[_0x4660('0xc')](_0x4660('0xd'),_0xdda522,_0x4660('0xb'),JSON[_0x4660('0xe')](_0x266abf));if(_0x266abf[_0x4660('0xf')]){if(_0x266abf[_0x4660('0xf')]['code']===0x1f4){logger[_0x4660('0xf')](_0x4660('0x10'),_0xdda522,_0x266abf[_0x4660('0xf')][_0x4660('0x11')]);return _0x5022c8(_0x266abf[_0x4660('0xf')][_0x4660('0x11')]);}logger['error'](_0x4660('0x10'),_0xdda522,_0x266abf[_0x4660('0xf')][_0x4660('0x11')]);return _0xef10af(_0x266abf[_0x4660('0xf')][_0x4660('0x11')]);}else{logger[_0x4660('0x12')](_0x4660('0x10'),_0xdda522,'request\x20sent');_0xef10af(_0x266abf[_0x4660('0x13')][_0x4660('0x11')]);}})['catch'](function(_0x4f1378){logger['error'](_0x4660('0x10'),_0xdda522,_0x4f1378);_0x5022c8(_0x4f1378);});});} \ No newline at end of file +var _0x9d91=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird'];(function(_0x53d6d5,_0x2fdeff){var _0x51aa68=function(_0x15e915){while(--_0x15e915){_0x53d6d5['push'](_0x53d6d5['shift']());}};_0x51aa68(++_0x2fdeff);}(_0x9d91,0x1ca));var _0x19d9=function(_0x187f49,_0xb229c5){_0x187f49=_0x187f49-0x0;var _0x4b8667=_0x9d91[_0x187f49];return _0x4b8667;};'use strict';var _=require('lodash');var util=require(_0x19d9('0x0'));var moment=require('moment');var BPromise=require(_0x19d9('0x1'));var rs=require(_0x19d9('0x2'));var fs=require('fs');var Redis=require(_0x19d9('0x3'));var db=require(_0x19d9('0x4'))['db'];var utils=require(_0x19d9('0x5'));var logger=require(_0x19d9('0x6'))('rpc');var config=require(_0x19d9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x19d9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b20df,_0x3c3c8e,_0x1b5ec7){return new BPromise(function(_0x5a6e91,_0x48d762){return client['request'](_0x5b20df,_0x1b5ec7)[_0x19d9('0x9')](function(_0xc5e5ce){logger[_0x19d9('0xa')](_0x19d9('0xb'),_0x3c3c8e,_0x19d9('0xc'));logger[_0x19d9('0xd')](_0x19d9('0xe'),_0x3c3c8e,'request\x20sent',JSON['stringify'](_0xc5e5ce));if(_0xc5e5ce[_0x19d9('0xf')]){if(_0xc5e5ce[_0x19d9('0xf')][_0x19d9('0x10')]===0x1f4){logger[_0x19d9('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x3c3c8e,_0xc5e5ce['error'][_0x19d9('0x11')]);return _0x48d762(_0xc5e5ce[_0x19d9('0xf')][_0x19d9('0x11')]);}logger[_0x19d9('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x3c3c8e,_0xc5e5ce[_0x19d9('0xf')][_0x19d9('0x11')]);return _0x5a6e91(_0xc5e5ce[_0x19d9('0xf')][_0x19d9('0x11')]);}else{logger[_0x19d9('0xa')](_0x19d9('0xb'),_0x3c3c8e,'request\x20sent');_0x5a6e91(_0xc5e5ce[_0x19d9('0x12')][_0x19d9('0x11')]);}})[_0x19d9('0x13')](function(_0x1666a9){logger[_0x19d9('0xf')](_0x19d9('0xb'),_0x3c3c8e,_0x1666a9);_0x48d762(_0x1666a9);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 9fb7ddf..b8ad999 100644 --- a/server/api/chatTransferReport/index.js +++ b/server/api/chatTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x5c9217,_0x1520f3){var _0x56f9b1=function(_0x48eaac){while(--_0x48eaac){_0x5c9217['push'](_0x5c9217['shift']());}};_0x56f9b1(++_0x1520f3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3ba772,_0x11d79a){_0x3ba772=_0x3ba772-0x0;var _0x30027a=_0x5f2f[_0x3ba772];return _0x30027a;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file +var _0x2032=['describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x467542,_0x24f3f4){var _0x483b66=function(_0x371f9f){while(--_0x371f9f){_0x467542['push'](_0x467542['shift']());}};_0x483b66(++_0x24f3f4);}(_0x2032,0xd9));var _0x2203=function(_0x25fbc8,_0x2784ab){_0x25fbc8=_0x25fbc8-0x0;var _0xdcd14a=_0x2032[_0x25fbc8];return _0xdcd14a;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var auth=require(_0x2203('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2203('0x5'));var controller=require(_0x2203('0x6'));router[_0x2203('0x7')]('/',auth[_0x2203('0x8')](),controller[_0x2203('0x9')]);router[_0x2203('0x7')](_0x2203('0xa'),auth[_0x2203('0x8')](),controller[_0x2203('0xb')]);router[_0x2203('0x7')](_0x2203('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller[_0x2203('0xe')]);router[_0x2203('0xf')](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x10')]);router['delete'](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);module[_0x2203('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 8149010..b7168ae 100644 --- a/server/api/chatWebsite/chatWebsite.attributes.js +++ b/server/api/chatWebsite/chatWebsite.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7cf=['parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','rounded','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','name','text','input','getDataValue','onlineForm'];(function(_0x4a5839,_0x51e495){var _0x289f3b=function(_0x3ec1ce){while(--_0x3ec1ce){_0x4a5839['push'](_0x4a5839['shift']());}};_0x289f3b(++_0x51e495);}(_0xd7cf,0xdb));var _0xfd7c=function(_0x54d49e,_0x5d9911){_0x54d49e=_0x54d49e-0x0;var _0x4af0f1=_0xd7cf[_0x54d49e];return _0x4af0f1;};'use strict';var Sequelize=require(_0xfd7c('0x0'));var rs=require(_0xfd7c('0x1'));module[_0xfd7c('0x2')]={'name':{'type':Sequelize[_0xfd7c('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xfd7c('0x3')],'allowNull':![],'unique':_0xfd7c('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0x5')},'mapKeyOffline':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xfd7c('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfd7c('0x3')],'allowNull':![],'defaultValue':_0xfd7c('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xfd7c('0x3')],'allowNull':![],'defaultValue':_0xfd7c('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfd7c('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xfd7c('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded','squared'),'defaultValue':_0xfd7c('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xfd7c('0xc')},'start_chat_button':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfd7c('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xfd7c('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xfd7c('0x10')]},'closingQuestion':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0x12')},'noteTitle':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0x13')},'closingMessage':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0x14')},'closingMessageButton':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xfd7c('0x15')},'conditionAgreement':{'type':Sequelize[_0xfd7c('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfd7c('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xfd7c('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0xfd7c('0x17'),_0xfd7c('0x18')),'defaultValue':_0xfd7c('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xfd7c('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xfd7c('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xfd7c('0x1a'),'type':_0xfd7c('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xfd7c('0x1c'),'props':{'title':_0xfd7c('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xfd7c('0x5'),'type':_0xfd7c('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xfd7c('0x1d')](_0xfd7c('0x1e'))?JSON[_0xfd7c('0x1f')](this[_0xfd7c('0x1d')](_0xfd7c('0x1e'))):{};},'set':function(_0x2c8ac4){return this[_0xfd7c('0x20')]('onlineForm',JSON[_0xfd7c('0x19')](_0x2c8ac4));}},'offlineForm':{'type':Sequelize[_0xfd7c('0x10')],'defaultValue':function(){return JSON[_0xfd7c('0x19')]({'items':[{'type':_0xfd7c('0x1c'),'props':{'title':_0xfd7c('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xfd7c('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xfd7c('0x21')},'props':{'title':_0xfd7c('0x21'),'helpText':_0xfd7c('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xfd7c('0x1d')]('offlineForm')?JSON[_0xfd7c('0x1f')](this['getDataValue'](_0xfd7c('0x23'))):{};},'set':function(_0x1c14b2){return this['setDataValue'](_0xfd7c('0x23'),JSON['stringify'](_0x1c14b2));}},'token':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':function(){return rs[_0xfd7c('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfd7c('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfd7c('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfd7c('0x3')]},'forwardOffline':{'type':Sequelize[_0xfd7c('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfd7c('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xfd7c('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0x26')},'offlineMessageBody':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xfd7c('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0x27')},'skipUnmanaged':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0x15')},'sendUnmanaged':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0x28')},'enableCustomerAttachment':{'type':Sequelize[_0xfd7c('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfd7c('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfd7c('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xfd7c('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xfd7c('0x3')]},'notificationTemplate':{'type':Sequelize[_0xfd7c('0x10')],'defaultValue':function(){return _0xfd7c('0x29');}},'notificationSound':{'type':Sequelize[_0xfd7c('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xfd7c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xfd7c('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfd7c('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfd7c('0x3')],'allowNull':![],'defaultValue':_0xfd7c('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfd7c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xfd7c('0x3')],'defaultValue':_0xfd7c('0x2d')},'systemAvatar':{'type':Sequelize[_0xfd7c('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfd7c('0x9')],'comment':_0xfd7c('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xfd7c('0x2f'),'set':function(_0x1dbf50){if(!_0x1dbf50)this[_0xfd7c('0x20')](_0xfd7c('0x30'),null);this[_0xfd7c('0x20')](_0xfd7c('0x31'),_0x1dbf50);}}}; \ No newline at end of file +var _0x1c90=['Type\x20a\x20message','Send','Feedback','star','thumb','stringify','name','text','input','email','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','address','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note'];(function(_0xf1e4bf,_0x1730be){var _0x5d8cd8=function(_0xeb427c){while(--_0xeb427c){_0xf1e4bf['push'](_0xf1e4bf['shift']());}};_0x5d8cd8(++_0x1730be);}(_0x1c90,0x114));var _0x01c9=function(_0x237972,_0x5b960d){_0x237972=_0x237972-0x0;var _0x321d03=_0x1c90[_0x237972];return _0x321d03;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x01c9('0x0'));module[_0x01c9('0x1')]={'name':{'type':Sequelize[_0x01c9('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x01c9('0x2')],'allowNull':![],'unique':_0x01c9('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x01c9('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x01c9('0x2')],'allowNull':![],'defaultValue':_0x01c9('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x01c9('0x2')],'allowNull':![],'defaultValue':_0x01c9('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x01c9('0x2')],'allowNull':![],'defaultValue':_0x01c9('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x01c9('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x01c9('0x2')]},'animation':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x01c9('0x8')](_0x01c9('0x9'),_0x01c9('0xa')),'defaultValue':_0x01c9('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x01c9('0xb')},'start_chat_button':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x01c9('0xc')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x01c9('0xd')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x01c9('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':_0x01c9('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':_0x01c9('0x10')},'noteTitle':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':_0x01c9('0x11')},'placeholderMessage':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':_0x01c9('0x12')},'closingMessage':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':_0x01c9('0x13')},'skipMessageButton':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x01c9('0x14')},'ratingType':{'type':Sequelize[_0x01c9('0x8')](_0x01c9('0x15'),_0x01c9('0x16')),'defaultValue':_0x01c9('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x01c9('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x01c9('0xd')],'defaultValue':function(){return JSON[_0x01c9('0x17')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x01c9('0x18'),'type':_0x01c9('0x19'),'required':!![]},'props':{'title':_0x01c9('0x18'),'helpText':''}},{'type':_0x01c9('0x1a'),'props':{'title':_0x01c9('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0x01c9('0x1b'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x01c9('0x1c'))?JSON[_0x01c9('0x1d')](this[_0x01c9('0x1e')](_0x01c9('0x1c'))):{};},'set':function(_0xa59173){return this[_0x01c9('0x1f')](_0x01c9('0x1c'),JSON[_0x01c9('0x17')](_0xa59173));}},'offlineForm':{'type':Sequelize[_0x01c9('0xd')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x01c9('0x1a'),'props':{'title':_0x01c9('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x01c9('0x1b')},'variable':null},{'type':_0x01c9('0x20'),'config':{'placeholder':_0x01c9('0x21')},'props':{'title':_0x01c9('0x21'),'helpText':_0x01c9('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x01c9('0x1e')](_0x01c9('0x23'))?JSON[_0x01c9('0x1d')](this[_0x01c9('0x1e')]('offlineForm')):{};},'set':function(_0x6ef1b1){return this[_0x01c9('0x1f')](_0x01c9('0x23'),JSON[_0x01c9('0x17')](_0x6ef1b1));}},'token':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x01c9('0x2')]},'forwardOffline':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':_0x01c9('0x24')},'waitingMessage':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':_0x01c9('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':_0x01c9('0x26')},'offlineMessageBody':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':_0x01c9('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x01c9('0x28')},'skipUnmanaged':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x01c9('0xd')]},'showAgentAvatar':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x01c9('0x2')]},'notificationTemplate':{'type':Sequelize[_0x01c9('0xd')],'defaultValue':function(){return _0x01c9('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':_0x01c9('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x01c9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x01c9('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x01c9('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x01c9('0x2')],'allowNull':![],'defaultValue':_0x01c9('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x01c9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x01c9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x01c9('0x2')],'defaultValue':_0x01c9('0x2d')},'systemAvatar':{'type':Sequelize[_0x01c9('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x01c9('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x01c9('0x7')],'defaultValue':![],'comment':_0x01c9('0x2e'),'set':function(_0x287d90){if(!_0x287d90)this[_0x01c9('0x1f')](_0x01c9('0x2f'),null);this[_0x01c9('0x1f')](_0x01c9('0x30'),_0x287d90);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 02bf59c..c044205 100644 --- a/server/api/chatWebsite/chatWebsite.controller.js +++ b/server/api/chatWebsite/chatWebsite.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd26f=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','./chatWebsite.socket','register','jayson/promise','client','http','test','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','offset','sort','where','map','key','field','filter','merge','findAll','show','keys','include','options','find','create','user','get','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','order','pick','rows','removeDispositions','CannedAnswer','getAnswers','hasOwnProperty','includeAll','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','sitepic','../../config/license/util','isNil','server/files/images/logos/','join','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','customerAvatar','existsSync','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','Applications','List','account','applications','list','priority','asc','defaults','from','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','type','stringify','threadId','externalUrl','ContactId','interaction','ChatInteraction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','MailAccount','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','addInteraction','getInteractions','User','internal','Tag','Tags','color','tag','Command','iftime\x20%s,%s','interval','timezone','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','getSnippet','Interval','getProactiveActions','virtual','custom','License','increment','Intervals','all','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','sequelize','transaction','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','removeAgents','emit','userChatWebsite:remove','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto'];(function(_0x5e8122,_0x196014){var _0x2a7d6f=function(_0x187b73){while(--_0x187b73){_0x5e8122['push'](_0x5e8122['shift']());}};_0x2a7d6f(++_0x196014);}(_0xd26f,0x113));var _0xfd26=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xd26f[_0x47b58b];return _0x46bebe;};'use strict';var pdf=require(_0xfd26('0x0'));var emlformat=require(_0xfd26('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfd26('0x2'));var rp=require(_0xfd26('0x3'));var moment=require(_0xfd26('0x4'));var BPromise=require(_0xfd26('0x5'));var Mustache=require(_0xfd26('0x6'));var util=require(_0xfd26('0x7'));var path=require(_0xfd26('0x8'));var sox=require(_0xfd26('0x9'));var csv=require(_0xfd26('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfd26('0xb'));var squel=require(_0xfd26('0xc'));var crypto=require(_0xfd26('0xd'));var jsforce=require(_0xfd26('0xe'));var deskjs=require(_0xfd26('0xf'));var toCsv=require(_0xfd26('0xa'));var querystring=require('querystring');var Papa=require(_0xfd26('0x10'));var Redis=require(_0xfd26('0x11'));var authService=require(_0xfd26('0x12'));var qs=require(_0xfd26('0x13'));var hardwareService=require(_0xfd26('0x14'));var logger=require(_0xfd26('0x15'))('api');var utils=require(_0xfd26('0x16'));var config=require('../../config/environment');var db=require(_0xfd26('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd26('0x18')]));require(_0xfd26('0x19'))[_0xfd26('0x1a')](socket);var jayson=require(_0xfd26('0x1b'));var client=jayson[_0xfd26('0x1c')][_0xfd26('0x1d')]({'port':0x232c});var client9002=jayson[_0xfd26('0x1c')][_0xfd26('0x1d')]({'port':0x232a});var client9003=jayson[_0xfd26('0x1c')][_0xfd26('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x9c5bcd,_0x186d30,_0xc10394){if(_0xc10394){var _0xbdcbbb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbdcbbb[_0xfd26('0x1e')](_0x186d30)){return _0x9c5bcd;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x9c5bcd;}}function respondWithRpcPromise(_0x9060e1,_0x1426b2,_0xeb7aeb,_0x210dd4){return new BPromise(function(_0x36a275,_0x5b3e8b){var _0x3a2725=_0x210dd4||client;return _0x3a2725['request'](_0x9060e1,_0xeb7aeb)['then'](function(_0x56d960){logger[_0xfd26('0x1f')](_0xfd26('0x20'),_0x1426b2,'request\x20sent');logger['debug'](_0xfd26('0x21'),_0x1426b2,_0xfd26('0x22'),JSON['stringify'](_0x56d960));if(_0x56d960[_0xfd26('0x23')]){if(_0x56d960['error'][_0xfd26('0x24')]===0x1f4){logger['error'](_0xfd26('0x20'),_0x1426b2,_0x56d960['error'][_0xfd26('0x25')]);return _0x5b3e8b(_0x56d960[_0xfd26('0x23')]['message']);}logger['error'](_0xfd26('0x20'),_0x1426b2,_0x56d960['error'][_0xfd26('0x25')]);return _0x36a275(_0x56d960[_0xfd26('0x23')][_0xfd26('0x25')]);}else{logger[_0xfd26('0x1f')](_0xfd26('0x20'),_0x1426b2,'request\x20sent');_0x36a275(_0x56d960[_0xfd26('0x26')]['message']);}})[_0xfd26('0x27')](function(_0x217a38){logger['error'](_0xfd26('0x20'),_0x1426b2,_0x217a38);_0x5b3e8b(_0x217a38);});});}function respondWithStatusCode(_0x1239e8,_0x375c98){_0x375c98=_0x375c98||0xcc;return function(_0x3d4279){if(_0x3d4279){return _0x1239e8[_0xfd26('0x28')](_0x375c98);}return _0x1239e8[_0xfd26('0x29')](_0x375c98)[_0xfd26('0x2a')]();};}function respondWithResult(_0x565c0,_0x3cdef1){_0x3cdef1=_0x3cdef1||0xc8;return function(_0x5b3be9){if(_0x5b3be9){return _0x565c0['status'](_0x3cdef1)['json'](_0x5b3be9);}};}function respondWithFilteredResult(_0x57a993,_0xe29044){return function(_0x5d0101){if(_0x5d0101){var _0x21df6d=_0x5d0101[_0xfd26('0x2b')],_0x944d20=_0xe29044['offset'],_0x481b18=_0xe29044['offset']+_0xe29044[_0xfd26('0x2c')],_0x5d8dab;if(_0x481b18>=_0x21df6d){_0x481b18=_0x21df6d;_0x5d8dab=0xc8;}else{_0x5d8dab=0xce;}_0x57a993[_0xfd26('0x29')](_0x5d8dab);return _0x57a993[_0xfd26('0x2d')](_0xfd26('0x2e'),_0x944d20+'-'+_0x481b18+'/'+_0x21df6d)[_0xfd26('0x2f')](_0x5d0101);}return null;};}function patchUpdates(_0x5d7886){return function(_0x43f94a){try{jsonpatch[_0xfd26('0x30')](_0x43f94a,_0x5d7886,!![]);}catch(_0x2303b4){return BPromise[_0xfd26('0x31')](_0x2303b4);}return _0x43f94a[_0xfd26('0x32')]();};}function saveUpdates(_0x5afa0b,_0x210b50){return function(_0x54c40b){if(_0x54c40b){return _0x54c40b[_0xfd26('0x33')](_0x5afa0b)[_0xfd26('0x34')](function(_0x2e1545){return _0x2e1545;});}return null;};}function removeEntity(_0x560d37,_0x1dbf0e){return function(_0x82956){if(_0x82956){return _0x82956[_0xfd26('0x35')]()[_0xfd26('0x34')](function(){var _0x585002=_0x82956['get']({'plain':!![]});var _0x43e213='ChatWebsites';return db[_0xfd26('0x36')]['destroy']({'where':{'type':_0x43e213,'resourceId':_0x585002['id']}})[_0xfd26('0x34')](function(){return _0x82956;});})[_0xfd26('0x34')](function(){_0x560d37[_0xfd26('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12774d,_0x285f5a){return function(_0x3b3440){if(!_0x3b3440){_0x12774d[_0xfd26('0x28')](0x194);}return _0x3b3440;};}function handleError(_0x526de9,_0x38ed27){_0x38ed27=_0x38ed27||0x1f4;return function(_0x50cca5){logger[_0xfd26('0x23')](_0x50cca5['stack']);if(_0x50cca5[_0xfd26('0x37')]){delete _0x50cca5[_0xfd26('0x37')];}_0x526de9[_0xfd26('0x29')](_0x38ed27)['send'](_0x50cca5);};}exports[_0xfd26('0x38')]=function(_0x36a849,_0x701de2){var _0x9db6d4={'include':[{'model':db[_0xfd26('0x39')],'as':_0xfd26('0x3a')}]},_0x1e711a={},_0x42a6c4={'count':0x0,'rows':[]};var _0x2083c7=db[_0xfd26('0x3b')][_0xfd26('0x3c')];_0x1e711a[_0xfd26('0x3d')]=_['keys'](_0x2083c7);_0x1e711a[_0xfd26('0x3e')]=_['keys'](_0x36a849[_0xfd26('0x3e')]);_0x1e711a[_0xfd26('0x3f')]=_[_0xfd26('0x40')](_0x1e711a[_0xfd26('0x3d')],_0x1e711a[_0xfd26('0x3e')]);_0x9db6d4[_0xfd26('0x41')]=_['intersection'](_0x1e711a[_0xfd26('0x3d')],qs['fields'](_0x36a849[_0xfd26('0x3e')][_0xfd26('0x42')]));_0x9db6d4[_0xfd26('0x41')]=_0x9db6d4[_0xfd26('0x41')][_0xfd26('0x43')]?_0x9db6d4['attributes']:_0x1e711a[_0xfd26('0x3d')];if(!_0x36a849[_0xfd26('0x3e')]['hasOwnProperty'](_0xfd26('0x44'))){_0x9db6d4[_0xfd26('0x2c')]=qs['limit'](_0x36a849['query'][_0xfd26('0x2c')]);_0x9db6d4[_0xfd26('0x45')]=qs[_0xfd26('0x45')](_0x36a849[_0xfd26('0x3e')][_0xfd26('0x45')]);}_0x9db6d4['order']=qs['sort'](_0x36a849[_0xfd26('0x3e')][_0xfd26('0x46')]);_0x9db6d4[_0xfd26('0x47')]=qs['filters'](_['pick'](_0x36a849[_0xfd26('0x3e')],_0x1e711a[_0xfd26('0x3f')]));if(_0x36a849[_0xfd26('0x3e')]['filter']){_0x9db6d4[_0xfd26('0x47')]=_['merge'](_0x9db6d4['where'],{'$or':_[_0xfd26('0x48')](_0x2083c7,function(_0x4a9137){if(_0x4a9137['type'][_0xfd26('0x49')]!=='VIRTUAL'){var _0x582aac={};_0x582aac[_0x4a9137[_0xfd26('0x4a')]]={'$like':'%'+_0x36a849[_0xfd26('0x3e')][_0xfd26('0x4b')]+'%'};return _0x582aac;}})});}_0x9db6d4=_[_0xfd26('0x4c')]({},_0x9db6d4,_0x36a849['options']);var _0x25cf8e={'where':_0x9db6d4['where']};return db[_0xfd26('0x3b')][_0xfd26('0x2b')](_0x25cf8e)[_0xfd26('0x34')](function(_0x27e06a){_0x42a6c4[_0xfd26('0x2b')]=_0x27e06a;if(_0x36a849[_0xfd26('0x3e')]['includeAll']){_0x9db6d4['include']=[{'all':!![]}];}return db[_0xfd26('0x3b')][_0xfd26('0x4d')](_0x9db6d4);})[_0xfd26('0x34')](function(_0x4eaff0){_0x42a6c4['rows']=_0x4eaff0;return _0x42a6c4;})['then'](respondWithFilteredResult(_0x701de2,_0x9db6d4))[_0xfd26('0x27')](handleError(_0x701de2,null));};exports[_0xfd26('0x4e')]=function(_0x504ba1,_0x467b7c){var _0x2d8b34={'raw':![],'where':{'id':_0x504ba1['params']['id']},'include':[{'model':db[_0xfd26('0x39')],'as':_0xfd26('0x3a')}]},_0x490ee7={};_0x490ee7[_0xfd26('0x3d')]=_['keys'](db[_0xfd26('0x3b')][_0xfd26('0x3c')]);_0x490ee7[_0xfd26('0x3e')]=_[_0xfd26('0x4f')](_0x504ba1[_0xfd26('0x3e')]);_0x490ee7[_0xfd26('0x3f')]=_[_0xfd26('0x40')](_0x490ee7[_0xfd26('0x3d')],_0x490ee7[_0xfd26('0x3e')]);_0x2d8b34[_0xfd26('0x41')]=_[_0xfd26('0x40')](_0x490ee7[_0xfd26('0x3d')],qs[_0xfd26('0x42')](_0x504ba1['query'][_0xfd26('0x42')]));_0x2d8b34[_0xfd26('0x41')]=_0x2d8b34[_0xfd26('0x41')][_0xfd26('0x43')]?_0x2d8b34[_0xfd26('0x41')]:_0x490ee7['model'];if(_0x504ba1['query']['includeAll']){_0x2d8b34[_0xfd26('0x50')]=[{'all':!![]}];}_0x2d8b34=_[_0xfd26('0x4c')]({},_0x2d8b34,_0x504ba1[_0xfd26('0x51')]);return db[_0xfd26('0x3b')][_0xfd26('0x52')](_0x2d8b34)[_0xfd26('0x34')](handleEntityNotFound(_0x467b7c,null))[_0xfd26('0x34')](respondWithResult(_0x467b7c,null))[_0xfd26('0x27')](handleError(_0x467b7c,null));};exports[_0xfd26('0x53')]=function(_0x1aa52b,_0x46310e){return db[_0xfd26('0x3b')][_0xfd26('0x53')](_0x1aa52b['body'],{})[_0xfd26('0x34')](function(_0x520023){var _0x307e73=_0x1aa52b[_0xfd26('0x54')][_0xfd26('0x55')]({'plain':!![]});if(!_0x307e73)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x307e73[_0xfd26('0x56')]===_0xfd26('0x54')){var _0x63f4ba=_0x520023['get']({'plain':!![]});var _0x3d2e0e=_0xfd26('0x57');return db[_0xfd26('0x58')][_0xfd26('0x52')]({'where':{'name':_0x3d2e0e,'userProfileId':_0x307e73[_0xfd26('0x59')]},'raw':!![]})['then'](function(_0x1937f4){if(_0x1937f4&&_0x1937f4[_0xfd26('0x5a')]===0x0){return db[_0xfd26('0x36')][_0xfd26('0x53')]({'name':_0x63f4ba[_0xfd26('0x37')],'resourceId':_0x63f4ba['id'],'type':_0x1937f4['name'],'sectionId':_0x1937f4['id']},{})[_0xfd26('0x34')](function(){return _0x520023;});}else{return _0x520023;}})[_0xfd26('0x27')](function(_0x3e3e6a){logger[_0xfd26('0x23')](_0xfd26('0x5b'),_0x3e3e6a);throw _0x3e3e6a;});}return _0x520023;})[_0xfd26('0x34')](respondWithResult(_0x46310e,0xc9))[_0xfd26('0x27')](handleError(_0x46310e,null));};exports[_0xfd26('0x33')]=function(_0x26034c,_0x5c5bd7){if(_0x26034c[_0xfd26('0x5c')]['id']){delete _0x26034c['body']['id'];}return db[_0xfd26('0x3b')][_0xfd26('0x52')]({'where':{'id':_0x26034c[_0xfd26('0x5d')]['id']},'include':[{'model':db[_0xfd26('0x39')],'as':_0xfd26('0x3a')}]})[_0xfd26('0x34')](handleEntityNotFound(_0x5c5bd7,null))[_0xfd26('0x34')](saveUpdates(_0x26034c[_0xfd26('0x5c')],null))[_0xfd26('0x34')](respondWithResult(_0x5c5bd7,null))[_0xfd26('0x27')](handleError(_0x5c5bd7,null));};exports['destroy']=function(_0x212417,_0x1698c5){return db['ChatWebsite']['find']({'where':{'id':_0x212417[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x1698c5,null))[_0xfd26('0x34')](removeEntity(_0x1698c5,null))['catch'](handleError(_0x1698c5,null));};exports['describe']=function(_0x167c51,_0x52c519){return db[_0xfd26('0x3b')]['describe']()['then'](respondWithResult(_0x52c519,null))[_0xfd26('0x27')](handleError(_0x52c519,null));};exports[_0xfd26('0x5e')]=function(_0x56428c,_0x1ebd84,_0x3825cb){if(_0x56428c['body']['id']){delete _0x56428c[_0xfd26('0x5c')]['id'];}return db[_0xfd26('0x3b')][_0xfd26('0x52')]({'where':{'id':_0x56428c[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x1ebd84,null))[_0xfd26('0x34')](function(_0xccda2b){if(_0xccda2b){_0x56428c[_0xfd26('0x5c')][_0xfd26('0x5f')]=_0xccda2b['id'];return db[_0xfd26('0x60')][_0xfd26('0x53')](_0x56428c[_0xfd26('0x5c')]);}})[_0xfd26('0x34')](respondWithResult(_0x1ebd84,null))[_0xfd26('0x27')](handleError(_0x1ebd84,null));};exports[_0xfd26('0x61')]=function(_0x2274de,_0x121550,_0x499fe2){var _0x36fe8c={'raw':![],'where':{}};var _0x2dfc6f={};var _0x3f8ad5={'count':0x0,'rows':[]};return db[_0xfd26('0x3b')][_0xfd26('0x62')]({'where':{'id':_0x2274de[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x121550,null))[_0xfd26('0x34')](function(_0x53efc6){if(_0x53efc6){_0x2dfc6f[_0xfd26('0x3d')]=_[_0xfd26('0x4f')](db[_0xfd26('0x60')][_0xfd26('0x3c')]);_0x2dfc6f[_0xfd26('0x3e')]=_['keys'](_0x2274de[_0xfd26('0x3e')]);_0x2dfc6f[_0xfd26('0x3f')]=_[_0xfd26('0x40')](_0x2dfc6f[_0xfd26('0x3d')],_0x2dfc6f[_0xfd26('0x3e')]);_0x36fe8c['attributes']=_['intersection'](_0x2dfc6f[_0xfd26('0x3d')],qs[_0xfd26('0x42')](_0x2274de['query'][_0xfd26('0x42')]));_0x36fe8c[_0xfd26('0x41')]=_0x36fe8c[_0xfd26('0x41')][_0xfd26('0x43')]?_0x36fe8c[_0xfd26('0x41')]:_0x2dfc6f[_0xfd26('0x3d')];if(!_0x2274de['query']['hasOwnProperty']('nolimit')){_0x36fe8c['limit']=qs[_0xfd26('0x2c')](_0x2274de['query'][_0xfd26('0x2c')]);_0x36fe8c['offset']=qs[_0xfd26('0x45')](_0x2274de[_0xfd26('0x3e')][_0xfd26('0x45')]);}_0x36fe8c[_0xfd26('0x63')]=qs[_0xfd26('0x46')](_0x2274de['query'][_0xfd26('0x46')]);_0x36fe8c[_0xfd26('0x47')]=qs[_0xfd26('0x3f')](_[_0xfd26('0x64')](_0x2274de[_0xfd26('0x3e')],_0x2dfc6f[_0xfd26('0x3f')]));_0x36fe8c['where'][_0xfd26('0x5f')]=_0x53efc6['id'];if(_0x2274de[_0xfd26('0x3e')][_0xfd26('0x4b')]){_0x36fe8c[_0xfd26('0x47')]=_['merge'](_0x36fe8c[_0xfd26('0x47')],{'$or':_[_0xfd26('0x48')](_0x36fe8c[_0xfd26('0x41')],function(_0x28c3a5){var _0x24fa6b={};_0x24fa6b[_0x28c3a5]={'$like':'%'+_0x2274de[_0xfd26('0x3e')][_0xfd26('0x4b')]+'%'};return _0x24fa6b;})});}_0x36fe8c=_['merge']({},_0x36fe8c,_0x2274de['options']);return db[_0xfd26('0x60')][_0xfd26('0x2b')]({'where':_0x36fe8c[_0xfd26('0x47')]})[_0xfd26('0x34')](function(_0x18d49f){_0x3f8ad5[_0xfd26('0x2b')]=_0x18d49f;if(_0x2274de[_0xfd26('0x3e')]['includeAll']){_0x36fe8c['include']=[{'all':!![]}];}return db[_0xfd26('0x60')]['findAll'](_0x36fe8c);})[_0xfd26('0x34')](function(_0xfaedcd){_0x3f8ad5[_0xfd26('0x65')]=_0xfaedcd;return _0x3f8ad5;});}})['then'](respondWithFilteredResult(_0x121550,_0x36fe8c))[_0xfd26('0x27')](handleError(_0x121550,null));};exports['removeDispositions']=function(_0x4e74f3,_0xbb063a,_0x2bf086){return db[_0xfd26('0x3b')][_0xfd26('0x52')]({'where':{'id':_0x4e74f3[_0xfd26('0x5d')]['id']}})['then'](handleEntityNotFound(_0xbb063a,null))[_0xfd26('0x34')](function(_0x251140){if(_0x251140){return _0x251140[_0xfd26('0x66')](_0x4e74f3['query']['ids']);}})['then'](respondWithStatusCode(_0xbb063a,null))[_0xfd26('0x27')](handleError(_0xbb063a,null));};exports['addAnswer']=function(_0x2f204d,_0x222249,_0x346f6f){if(_0x2f204d[_0xfd26('0x5c')]['id']){delete _0x2f204d['body']['id'];}return db['ChatWebsite'][_0xfd26('0x52')]({'where':{'id':_0x2f204d[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x222249,null))['then'](function(_0x2f8b1c){if(_0x2f8b1c){_0x2f204d[_0xfd26('0x5c')]['ChatWebsiteId']=_0x2f8b1c['id'];return db[_0xfd26('0x67')]['create'](_0x2f204d[_0xfd26('0x5c')]);}})[_0xfd26('0x34')](respondWithResult(_0x222249,null))[_0xfd26('0x27')](handleError(_0x222249,null));};exports[_0xfd26('0x68')]=function(_0x36d472,_0x39dd3e,_0x59fdeb){var _0x4ac7e1={'raw':![],'where':{}};var _0x1ed3ef={};var _0x47e690={'count':0x0,'rows':[]};return db[_0xfd26('0x3b')][_0xfd26('0x62')]({'where':{'id':_0x36d472[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x39dd3e,null))[_0xfd26('0x34')](function(_0x35bccf){if(_0x35bccf){_0x1ed3ef[_0xfd26('0x3d')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x1ed3ef[_0xfd26('0x3e')]=_[_0xfd26('0x4f')](_0x36d472['query']);_0x1ed3ef[_0xfd26('0x3f')]=_[_0xfd26('0x40')](_0x1ed3ef['model'],_0x1ed3ef[_0xfd26('0x3e')]);_0x4ac7e1[_0xfd26('0x41')]=_[_0xfd26('0x40')](_0x1ed3ef[_0xfd26('0x3d')],qs[_0xfd26('0x42')](_0x36d472[_0xfd26('0x3e')][_0xfd26('0x42')]));_0x4ac7e1[_0xfd26('0x41')]=_0x4ac7e1['attributes'][_0xfd26('0x43')]?_0x4ac7e1['attributes']:_0x1ed3ef[_0xfd26('0x3d')];if(!_0x36d472[_0xfd26('0x3e')][_0xfd26('0x69')](_0xfd26('0x44'))){_0x4ac7e1['limit']=qs['limit'](_0x36d472[_0xfd26('0x3e')][_0xfd26('0x2c')]);_0x4ac7e1[_0xfd26('0x45')]=qs[_0xfd26('0x45')](_0x36d472[_0xfd26('0x3e')][_0xfd26('0x45')]);}_0x4ac7e1[_0xfd26('0x63')]=qs[_0xfd26('0x46')](_0x36d472[_0xfd26('0x3e')][_0xfd26('0x46')]);_0x4ac7e1[_0xfd26('0x47')]=qs[_0xfd26('0x3f')](_[_0xfd26('0x64')](_0x36d472['query'],_0x1ed3ef['filters']));_0x4ac7e1['where']['ChatWebsiteId']=_0x35bccf['id'];if(_0x36d472[_0xfd26('0x3e')][_0xfd26('0x4b')]){_0x4ac7e1[_0xfd26('0x47')]=_[_0xfd26('0x4c')](_0x4ac7e1[_0xfd26('0x47')],{'$or':_[_0xfd26('0x48')](_0x4ac7e1[_0xfd26('0x41')],function(_0x3a89a0){var _0x5a89b6={};_0x5a89b6[_0x3a89a0]={'$like':'%'+_0x36d472[_0xfd26('0x3e')][_0xfd26('0x4b')]+'%'};return _0x5a89b6;})});}_0x4ac7e1=_['merge']({},_0x4ac7e1,_0x36d472[_0xfd26('0x51')]);return db[_0xfd26('0x67')][_0xfd26('0x2b')]({'where':_0x4ac7e1[_0xfd26('0x47')]})[_0xfd26('0x34')](function(_0x2a0353){_0x47e690[_0xfd26('0x2b')]=_0x2a0353;if(_0x36d472[_0xfd26('0x3e')][_0xfd26('0x6a')]){_0x4ac7e1[_0xfd26('0x50')]=[{'all':!![]}];}return db[_0xfd26('0x67')][_0xfd26('0x4d')](_0x4ac7e1);})[_0xfd26('0x34')](function(_0xbdae70){_0x47e690[_0xfd26('0x65')]=_0xbdae70;return _0x47e690;});}})[_0xfd26('0x34')](respondWithFilteredResult(_0x39dd3e,_0x4ac7e1))['catch'](handleError(_0x39dd3e,null));};exports[_0xfd26('0x6b')]=function(_0x4d0681,_0x1aae35,_0x5b1dc7){return db[_0xfd26('0x3b')][_0xfd26('0x52')]({'where':{'id':_0x4d0681[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x1aae35,null))[_0xfd26('0x34')](function(_0x4cef2c){if(_0x4cef2c){return _0x4cef2c[_0xfd26('0x6b')](_0x4d0681[_0xfd26('0x3e')][_0xfd26('0x6c')]);}})[_0xfd26('0x34')](respondWithStatusCode(_0x1aae35,null))['catch'](handleError(_0x1aae35,null));};exports[_0xfd26('0x6d')]=function(_0x53ed20,_0x391177,_0x18972d){_0x53ed20[_0xfd26('0x5c')]['sitepic']=_0x53ed20[_0xfd26('0x6e')][_0xfd26('0x6f')];return db[_0xfd26('0x3b')]['find']({'where':{'id':_0x53ed20[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x391177,null))[_0xfd26('0x34')](saveUpdates(_0x53ed20[_0xfd26('0x5c')],null))['then'](respondWithResult(_0x391177,null))[_0xfd26('0x27')](handleError(_0x391177,null));};exports[_0xfd26('0x70')]=function(_0x3ea685,_0x2f9a33,_0x40e35e){_0x3ea685[_0xfd26('0x5c')][_0xfd26('0x71')]=_0x3ea685[_0xfd26('0x6e')][_0xfd26('0x6f')];return db[_0xfd26('0x3b')][_0xfd26('0x52')]({'where':{'id':_0x3ea685[_0xfd26('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2f9a33,null))[_0xfd26('0x34')](saveUpdates(_0x3ea685[_0xfd26('0x5c')],null))[_0xfd26('0x34')](respondWithResult(_0x2f9a33,null))[_0xfd26('0x27')](handleError(_0x2f9a33,null));};exports[_0xfd26('0x72')]=function(_0x4e8887,_0x26e42b,_0x3b5092){_0x4e8887['body']['customerAvatar']=_0x4e8887[_0xfd26('0x6e')]['filename'];return db[_0xfd26('0x3b')][_0xfd26('0x52')]({'where':{'id':_0x4e8887['params']['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x26e42b,null))[_0xfd26('0x34')](saveUpdates(_0x4e8887[_0xfd26('0x5c')],null))['then'](respondWithResult(_0x26e42b,null))['catch'](handleError(_0x26e42b,null));};exports[_0xfd26('0x73')]=function(_0x1edc33,_0xaca872,_0xc6261a){_0x1edc33[_0xfd26('0x5c')][_0xfd26('0x74')]=_0x1edc33[_0xfd26('0x6e')][_0xfd26('0x6f')];return db[_0xfd26('0x3b')][_0xfd26('0x52')]({'where':{'id':_0x1edc33[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0xaca872,null))[_0xfd26('0x34')](saveUpdates(_0x1edc33[_0xfd26('0x5c')],null))[_0xfd26('0x34')](respondWithResult(_0xaca872,null))['catch'](handleError(_0xaca872,null));};exports[_0xfd26('0x75')]=function(_0x26510a,_0x196314,_0x3567ca){var _0x1896cb=path['join'](config[_0xfd26('0x76')],'server/files/images/logos/default_logo.png');var _0x5c7a8a={'where':{'id':_0x26510a['params']['id']},'attributes':['id',_0xfd26('0x77')],'raw':!![]};var _0x55cdd2=![];return require(_0xfd26('0x78'))['getLicense']()['then'](function(_0x3f548c){if(_0x3f548c){_0x55cdd2=_0x3f548c['custom'];}})['then'](function(){return db[_0xfd26('0x3b')][_0xfd26('0x52')](_0x5c7a8a);})[_0xfd26('0x34')](handleEntityNotFound(_0x196314,null))[_0xfd26('0x34')](function(_0x8d224){if(_0x8d224){if(!_[_0xfd26('0x79')](_0x8d224[_0xfd26('0x77')])){if(fs['existsSync'](path['join'](config[_0xfd26('0x76')],_0xfd26('0x7a'),_0x8d224[_0xfd26('0x77')]))&&_0x55cdd2){_0x1896cb=path[_0xfd26('0x7b')](config['root'],_0xfd26('0x7a'),_0x8d224[_0xfd26('0x77')]);}}return _0x196314['download'](_0x1896cb);}})[_0xfd26('0x27')](handleError(_0x196314,null));};exports['getAvatar']=function(_0x29fed5,_0xe1b5fe,_0x110092){var _0x1cb65f=path[_0xfd26('0x7b')](config[_0xfd26('0x76')],_0xfd26('0x7c'));var _0x194fed={'where':{'id':_0x29fed5[_0xfd26('0x5d')]['id']},'attributes':['id',_0xfd26('0x71')],'raw':!![]};return db[_0xfd26('0x3b')][_0xfd26('0x52')](_0x194fed)[_0xfd26('0x34')](handleEntityNotFound(_0xe1b5fe,null))['then'](function(_0x2d8f6a){if(_0x2d8f6a){if(!_['isNil'](_0x2d8f6a['agentAvatar'])){if(fs['existsSync'](path['join'](config[_0xfd26('0x76')],_0xfd26('0x7d'),_0x2d8f6a[_0xfd26('0x71')]))){_0x1cb65f=path[_0xfd26('0x7b')](config[_0xfd26('0x76')],'server/files/images/avatars/',_0x2d8f6a[_0xfd26('0x71')]);}}return _0xe1b5fe['download'](_0x1cb65f);}})[_0xfd26('0x27')](handleError(_0xe1b5fe,null));};exports[_0xfd26('0x7e')]=function(_0x40af0e,_0x4e36b2,_0x38970a){var _0x3eb6ca=path[_0xfd26('0x7b')](config[_0xfd26('0x76')],'server/files/images/avatars/customer_avatar.png');var _0x34e859={'where':{'id':_0x40af0e[_0xfd26('0x5d')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xfd26('0x3b')]['find'](_0x34e859)[_0xfd26('0x34')](handleEntityNotFound(_0x4e36b2,null))[_0xfd26('0x34')](function(_0x3b6abe){if(_0x3b6abe){if(!_[_0xfd26('0x79')](_0x3b6abe[_0xfd26('0x7f')])){if(fs[_0xfd26('0x80')](path[_0xfd26('0x7b')](config[_0xfd26('0x76')],_0xfd26('0x7d'),_0x3b6abe[_0xfd26('0x7f')]))&&_0x3b6abe[_0xfd26('0x81')]){_0x3eb6ca=path['join'](config[_0xfd26('0x76')],_0xfd26('0x7d'),_0x3b6abe[_0xfd26('0x7f')]);}}return _0x4e36b2[_0xfd26('0x82')](_0x3eb6ca);}})[_0xfd26('0x27')](handleError(_0x4e36b2,null));};exports[_0xfd26('0x83')]=function(_0x38304b,_0x37131c,_0x22149e){var _0x348b3b=path[_0xfd26('0x7b')](config['root'],_0xfd26('0x84'));var _0xe13336={'where':{'id':_0x38304b['params']['id']},'attributes':['id',_0xfd26('0x74')],'raw':!![]};return db[_0xfd26('0x3b')]['find'](_0xe13336)[_0xfd26('0x34')](handleEntityNotFound(_0x37131c,null))[_0xfd26('0x34')](function(_0x36bbad){if(_0x36bbad){if(!_[_0xfd26('0x79')](_0x36bbad[_0xfd26('0x74')])){if(fs['existsSync'](path[_0xfd26('0x7b')](config['root'],_0xfd26('0x7d'),_0x36bbad[_0xfd26('0x74')]))){_0x348b3b=path['join'](config[_0xfd26('0x76')],'server/files/images/avatars/',_0x36bbad[_0xfd26('0x74')]);}}return _0x37131c[_0xfd26('0x82')](_0x348b3b);}})[_0xfd26('0x27')](handleError(_0x37131c,null));};exports[_0xfd26('0x85')]=function(_0x5876a7,_0x308518,_0x2814db){var _0x5745e5=require(_0xfd26('0x86'));var _0xbed9cd=new _0x5745e5();var _0x387219=_0xbed9cd[_0xfd26('0x87')](_0x5876a7[_0xfd26('0x88')]['user-agent'])[_0xfd26('0x89')]();var _0x4e3746={'body':_0x5876a7[_0xfd26('0x5c')],'channel':_0xfd26('0x8a')};var _0x51c5fa=[];var _0x485f9d=[];var _0x4ae535={};var _0x662980=![];return db['CmContact'][_0xfd26('0x8b')]()[_0xfd26('0x34')](function(_0x32e7f4){if(!_0x32e7f4){throw new db[(_0xfd26('0x8c'))]['ValidationError'](_0xfd26('0x8d'));}_0x51c5fa=_[_0xfd26('0x8e')](_[_0xfd26('0x4f')](_0x32e7f4),[_0xfd26('0x8f'),_0xfd26('0x90')]);_0x485f9d=_[_0xfd26('0x8e')](_['keys'](_0x32e7f4),[_0xfd26('0x8f'),'updatedAt',_0xfd26('0x91'),'ListId']);if(_0x5876a7[_0xfd26('0x5c')]['id']){delete _0x5876a7['body']['id'];}if(_[_0xfd26('0x79')](_0x5876a7[_0xfd26('0x5c')]['from'])){throw new db['Sequelize'][(_0xfd26('0x92'))]('from\x20is\x20mandatory');}if(_[_0xfd26('0x79')](_0x5876a7[_0xfd26('0x5c')][_0xfd26('0x5c')])||_0x5876a7[_0xfd26('0x5c')][_0xfd26('0x5c')]===''){throw new db['Sequelize'][(_0xfd26('0x92'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfd26('0x79')](_0x5876a7[_0xfd26('0x5c')][_0xfd26('0x93')])){throw new db[(_0xfd26('0x8c'))][(_0xfd26('0x92'))](_0xfd26('0x94')+_0x485f9d);}if(!_[_0xfd26('0x95')](_0x485f9d,_0x5876a7[_0xfd26('0x5c')][_0xfd26('0x93')])){throw new db['Sequelize'][(_0xfd26('0x92'))](_0xfd26('0x96')+_0x485f9d);}_0x4ae535[_0x5876a7['body'][_0xfd26('0x93')]]=_0x5876a7['body']['from'];})[_0xfd26('0x34')](function(){return db[_0xfd26('0x3b')][_0xfd26('0x52')]({'where':{'id':_0x5876a7['params']['id']},'include':[{'model':db[_0xfd26('0x97')],'as':'List','include':[{'model':db[_0xfd26('0x98')],'as':_0xfd26('0x99'),'where':_0x4ae535,'limit':0x1,'order':[[_0xfd26('0x90'),_0xfd26('0x9a')]]}]},{'model':db['ChatApplication'],'as':_0xfd26('0x9b')}]});})[_0xfd26('0x34')](handleEntityNotFound(_0x308518,null))[_0xfd26('0x34')](function(_0x49373c){if(_0x49373c&&_0x49373c[_0xfd26('0x9c')]){_0x4e3746[_0xfd26('0x9d')]=_0x49373c;_0x4e3746[_0xfd26('0x9e')]=_0x49373c['Applications'];_0x4e3746[_0xfd26('0x9f')]=_0x49373c[_0xfd26('0x9c')];_0x4e3746[_0xfd26('0x9e')]=_['orderBy'](_0x4e3746[_0xfd26('0x9e')],[_0xfd26('0xa0')],[_0xfd26('0xa1')]);if(_0x4e3746['account'][_0xfd26('0x9b')]){delete _0x4e3746[_0xfd26('0x9d')]['Applications'];}if(_0x4e3746['account'][_0xfd26('0x9c')]&&_0x4e3746[_0xfd26('0x9d')][_0xfd26('0x9c')]['Contacts'][_0xfd26('0x43')]){return _0x4e3746[_0xfd26('0x9d')][_0xfd26('0x9c')][_0xfd26('0x99')][0x0];}var _0x41ec46=_[_0xfd26('0xa2')](_0x5876a7['body'],{'firstName':_0x5876a7[_0xfd26('0x5c')][_0xfd26('0xa3')],'ListId':_0x49373c[_0xfd26('0xa4')]});_0x41ec46[_0x5876a7['body'][_0xfd26('0x93')]]=_0x5876a7[_0xfd26('0x5c')][_0xfd26('0xa3')];return db['CmContact'][_0xfd26('0x53')](_0x41ec46,{'fields':_0x51c5fa,'raw':!![]});}})[_0xfd26('0x34')](handleEntityNotFound(_0x308518,null))[_0xfd26('0x34')](function(_0x1ccd1c){_0x4e3746[_0xfd26('0xa5')]=_0x1ccd1c;var _0x185046=_0x5876a7[_0xfd26('0x5c')][_0xfd26('0xa6')];if(_0x5876a7[_0xfd26('0x88')][_0xfd26('0xa7')]){_0x185046=_0x5876a7[_0xfd26('0x88')]['cf-connecting-ip'];}else if(_0x5876a7[_0xfd26('0x88')]['x-forwarded-for']){_0x185046=_['first'](_0x5876a7['headers'][_0xfd26('0xa8')][_0xfd26('0xa9')](','));}if(_0x1ccd1c){var _0x39de34={'ContactId':_0x1ccd1c['id'],'ChatWebsiteId':_0x5876a7[_0xfd26('0x5d')]['id'],'from':(_0x1ccd1c[_0xfd26('0xaa')]||'')+'\x20'+(_0x1ccd1c[_0xfd26('0xab')]||''),'customerIp':_0x185046,'customerPort':_0x5876a7['headers'][_0xfd26('0xac')]?_0x5876a7[_0xfd26('0x88')][_0xfd26('0xac')]:null,'referer':_0x5876a7[_0xfd26('0x5c')][_0xfd26('0xad')],'browserName':_0x387219[_0xfd26('0xae')]['name']&&_0x387219[_0xfd26('0xae')][_0xfd26('0xaf')]?util['format'](_0xfd26('0xb0'),_0x387219[_0xfd26('0xae')][_0xfd26('0x37')],_0x387219[_0xfd26('0xae')][_0xfd26('0xaf')]):_0xfd26('0xb1'),'browserVersion':_0x387219[_0xfd26('0xae')][_0xfd26('0xaf')]||_0xfd26('0xb1'),'osName':util[_0xfd26('0xb2')](_0xfd26('0xb0'),_0x387219['os'][_0xfd26('0x37')],_0x387219['os'][_0xfd26('0xaf')]),'osVersion':_0x387219['os']['version'],'deviceModel':_0x387219['device'][_0xfd26('0x3d')]&&_0x387219[_0xfd26('0xb3')][_0xfd26('0xb4')]?util['format'](_0xfd26('0xb5'),_0x387219['device'][_0xfd26('0x3d')],_0x387219[_0xfd26('0xb3')][_0xfd26('0xb4')],_0x387219[_0xfd26('0xb3')][_0xfd26('0xb6')]):null,'deviceVendor':_0x387219['device']['vendor'],'deviceType':_0x387219[_0xfd26('0xb3')][_0xfd26('0xb6')],'formData':JSON[_0xfd26('0xb7')](_0x5876a7[_0xfd26('0x5c')])};var _0x5f11f8={'ChatWebsiteId':_0x5876a7[_0xfd26('0x5d')]['id'],'closed':![]};if(_0x5876a7[_0xfd26('0x5c')][_0xfd26('0xb8')]){_0x5f11f8[_0xfd26('0xb8')]=_0x5876a7[_0xfd26('0x5c')][_0xfd26('0xb8')];return db['ChatInteraction'][_0xfd26('0x52')]({'where':_0x5f11f8})['then'](function(_0xd7f0f7){if(_0xd7f0f7){return[_0xd7f0f7,![]];}_0x39de34[_0xfd26('0xb8')]=_0x5876a7[_0xfd26('0x5c')][_0xfd26('0xb8')];_0x39de34[_0xfd26('0xb9')]=_0x5876a7['body']['externalUrl'];return db['ChatInteraction']['create'](_0x39de34)[_0xfd26('0x34')](function(_0x3e28b6){return[_0x3e28b6,!![]];});});}_0x5f11f8[_0xfd26('0xba')]=_0x1ccd1c['id'];if(_0x5876a7[_0xfd26('0x5c')][_0xfd26('0xbb')]&&_0x5876a7[_0xfd26('0x5c')][_0xfd26('0xbb')]['id']){_0x5f11f8['id']=_0x5876a7[_0xfd26('0x5c')][_0xfd26('0xbb')]['id'];return db[_0xfd26('0xbc')][_0xfd26('0x52')]({'where':_0x5f11f8})[_0xfd26('0x34')](function(_0x5f1036){if(_0x5f1036){return[_0x5f1036,![]];}return db[_0xfd26('0xbc')][_0xfd26('0x53')](_0x39de34)[_0xfd26('0x34')](function(_0x61a649){return[_0x61a649,!![]];});});}return db[_0xfd26('0xbc')][_0xfd26('0x53')](_0x39de34)[_0xfd26('0x34')](function(_0x45977c){return[_0x45977c,!![]];});}})[_0xfd26('0xbd')](function(_0x2078c1,_0x5091ac){if(_0x2078c1){_0x662980=_0x5091ac;if(!_0x5091ac){var _0x4c0a25={'from':(_0x4e3746[_0xfd26('0xa5')][_0xfd26('0xaa')]||'')+'\x20'+(_0x4e3746['contact'][_0xfd26('0xab')]||'')};if(_0x5876a7[_0xfd26('0x5c')]['threadId']&&_0x5876a7['body']['messageId']&&_0x5876a7['body'][_0xfd26('0xb8')]!=_0x5876a7[_0xfd26('0x5c')]['messageId']){_0x4c0a25[_0xfd26('0xb8')]=_0x5876a7['body'][_0xfd26('0xbe')];}return _0x2078c1[_0xfd26('0x33')](_0x4c0a25);}else{return _0x2078c1;}}})[_0xfd26('0x34')](function(_0xe87a5e){_0x4e3746[_0xfd26('0xbb')]=_0xe87a5e['get']({'plain':!![]});_0x4e3746[_0xfd26('0xbb')]['created']=_0x662980;if(_0x4e3746[_0xfd26('0xbb')][_0xfd26('0xbf')]){if(_0x4e3746[_0xfd26('0x9d')][_0xfd26('0xc0')]){_0x4e3746[_0xfd26('0x9e')][_0xfd26('0xc1')]({'id':0x0,'priority':_0x4e3746[_0xfd26('0x9e')]['length']+0x1,'app':'close','appdata':_0xfd26('0xc2'),'interval':_0xfd26('0xc3')});}}return db['ChatMessage'][_0xfd26('0x53')]({'body':_0x5876a7[_0xfd26('0x5c')][_0xfd26('0x5c')],'ChatWebsiteId':_0x5876a7['params']['id'],'ChatInteractionId':_0xe87a5e['id'],'direction':'in','ContactId':_0x4e3746[_0xfd26('0xa5')]['id'],'AttachmentId':_0x5876a7[_0xfd26('0x5c')][_0xfd26('0xc4')]});})[_0xfd26('0x34')](function(_0x3c2f9c){_0x4e3746['message']=_0x3c2f9c;if(_0x4e3746['interaction'][_0xfd26('0xc5')]){return db['User']['find']({'attributes':['id',_0xfd26('0x37')],'where':{'id':_0x4e3746[_0xfd26('0xbb')]['UserId']}})[_0xfd26('0x34')](function(_0x2b84c4){if(_0x2b84c4){_0x4e3746[_0xfd26('0x9e')][_0xfd26('0xc6')]({'id':0x0,'priority':0x0,'app':_0xfd26('0xc7'),'appdata':_0x2b84c4[_0xfd26('0x37')]+','+(_0x4e3746[_0xfd26('0x9d')][_0xfd26('0xc8')]||0xa),'interval':'*,*,*,*'});_0x4e3746[_0xfd26('0xc9')]=!![];}return respondWithRpcPromise(_0xfd26('0xca'),_0xfd26('0xcb'),_0x4e3746);});}return respondWithRpcPromise(_0xfd26('0xca'),'startRouting',_0x4e3746);})[_0xfd26('0x34')](function(_0x4b8eab){respondWithRpcPromise('EventManager',_0xfd26('0xcc'),{'event':_0xfd26('0x85'),'message':_0x4b8eab},client9002);return _0x4b8eab;})[_0xfd26('0x34')](respondWithResult(_0x308518,null))[_0xfd26('0x27')](handleError(_0x308518,null));};exports[_0xfd26('0xcd')]=function(_0x5d24ce,_0x2db3f7,_0x58a6c9){var _0x32c0ba,_0x2dbdd6,_0x566b7b;var _0x55b6c4=[];var _0x475c61=[];var _0xa16216={};return db['CmContact'][_0xfd26('0x8b')]()[_0xfd26('0x34')](function(_0xe0874c){if(!_0xe0874c){throw new db['Sequelize'][(_0xfd26('0x92'))]('no\x20available\x20attributes');}_0x475c61=_[_0xfd26('0x8e')](_[_0xfd26('0x4f')](_0xe0874c),['createdAt',_0xfd26('0x90')]);_0x55b6c4=_[_0xfd26('0x8e')](_[_0xfd26('0x4f')](_0xe0874c),[_0xfd26('0x8f'),_0xfd26('0x90'),'CompanyId',_0xfd26('0xa4')]);if(_0x5d24ce[_0xfd26('0x5c')]['id']){delete _0x5d24ce[_0xfd26('0x5c')]['id'];}if(_[_0xfd26('0x79')](_0x5d24ce['body'][_0xfd26('0xa3')])){throw _0x2db3f7[_0xfd26('0x29')](0x1f4)['send'](new db[(_0xfd26('0x8c'))][(_0xfd26('0x92'))]('from\x20is\x20mandatory'));}if(_[_0xfd26('0x79')](_0x5d24ce[_0xfd26('0x5c')]['body'])||_0x5d24ce[_0xfd26('0x5c')][_0xfd26('0x5c')]===''){throw _0x2db3f7[_0xfd26('0x29')](0x1f4)[_0xfd26('0xce')](new db['Sequelize'][(_0xfd26('0x92'))](_0xfd26('0xcf')));}if(_['isNil'](_0x5d24ce[_0xfd26('0x5c')][_0xfd26('0xd0')])){throw _0x2db3f7['status'](0x1f4)['send'](new db[(_0xfd26('0x8c'))][(_0xfd26('0x92'))](_0xfd26('0xd1')+_0x55b6c4));}if(!_[_0xfd26('0x95')](_0x55b6c4,_0x5d24ce['body'][_0xfd26('0xd0')])){throw _0x2db3f7[_0xfd26('0x29')](0x1f4)[_0xfd26('0xce')](new db[(_0xfd26('0x8c'))][(_0xfd26('0x92'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x55b6c4));}_0xa16216[_0x5d24ce[_0xfd26('0x5c')][_0xfd26('0xd0')]]=_0x5d24ce['body'][_0xfd26('0xa3')];})[_0xfd26('0x34')](function(){return db['ChatWebsite'][_0xfd26('0x52')]({'where':{'id':_0x5d24ce[_0xfd26('0x5d')]['id']},'include':[{'model':db['CmList'],'as':'List'}]});})[_0xfd26('0x34')](handleEntityNotFound(_0x2db3f7,null))[_0xfd26('0x34')](function(_0x53a521){if(_0x53a521&&_0x53a521[_0xfd26('0x9c')]){_0x2dbdd6=_0x53a521;var _0x26ffdc=_[_0xfd26('0xa2')](_0x5d24ce[_0xfd26('0x5c')],{'firstName':_0x5d24ce[_0xfd26('0x5c')][_0xfd26('0xa3')],'phone':_0x5d24ce[_0xfd26('0x5c')][_0xfd26('0xa3')],'ListId':_0x53a521['ListId']});_0x26ffdc[_0x5d24ce[_0xfd26('0x5c')][_0xfd26('0xd0')]]=_0x5d24ce['body'][_0xfd26('0xa3')];return db[_0xfd26('0x98')][_0xfd26('0xd2')]({'where':_0xa16216,'defaults':_0x26ffdc});}})[_0xfd26('0xbd')](function(_0x2f22be){if(_0x2f22be){_0x566b7b=_0x2f22be;var _0x6a355e=fs[_0xfd26('0xd3')](path[_0xfd26('0x7b')](config[_0xfd26('0x76')],_0xfd26('0xd4')),_0xfd26('0xd5'));var _0x3fe60c=ejs[_0xfd26('0xd6')](_0x6a355e,{'body':_[_0xfd26('0xd7')](_0x5d24ce['body'][_0xfd26('0x5c')]),'bodyTitle':_0x2dbdd6[_0xfd26('0xd8')]});return db['ChatOfflineMessage']['create']({'body':_0x3fe60c,'ContactId':_0x2f22be['id'],'ChatWebsiteId':_0x2dbdd6['id']});}})[_0xfd26('0x34')](function(_0x4255fc){if(_0x4255fc){_0x32c0ba=_0x4255fc;return db[_0xfd26('0xd9')][_0xfd26('0x62')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0xfd26('0x34')](function(_0x2c0537){if(_0x2c0537&&_0x2c0537[_0xfd26('0xda')]&&_0x2dbdd6[_0xfd26('0xdb')]){var _0x35d2f0={'tls':{'rejectUnauthorized':![]}};if(_0x2c0537[_0xfd26('0xda')]['service']){_0x35d2f0[_0xfd26('0xdc')]=_0x2c0537[_0xfd26('0xda')][_0xfd26('0xdc')];}else{_0x35d2f0[_0xfd26('0xdd')]=_0x2c0537[_0xfd26('0xda')][_0xfd26('0xdd')];_0x35d2f0[_0xfd26('0xde')]=_0x2c0537[_0xfd26('0xda')]['port'];_0x35d2f0[_0xfd26('0xdf')]=_0x2c0537[_0xfd26('0xda')][_0xfd26('0xdf')];}if(_0x2c0537['Smtp'][_0xfd26('0xe0')]){_0x35d2f0[_0xfd26('0xe1')]={'user':_0x2c0537[_0xfd26('0xda')][_0xfd26('0x54')],'pass':_0x2c0537['Smtp'][_0xfd26('0xe2')]};}return respondWithRpcPromise(_0xfd26('0xe3'),_0xfd26('0xe4'),{'account':_0x35d2f0,'message':{'from':util[_0xfd26('0xb2')](_0xfd26('0xe5'),_0x2c0537[_0xfd26('0x37')],_0x2c0537['email']||_0x2c0537[_0xfd26('0xda')]['user']),'to':_0x2dbdd6[_0xfd26('0xdb')],'subject':_0x2dbdd6[_0xfd26('0xe6')],'text':_0x32c0ba[_0xfd26('0x5c')]}},client9003)['then'](function(){return _0x32c0ba;})[_0xfd26('0x27')](function(_0x28f7c0){console[_0xfd26('0x23')](_0x28f7c0);});}})[_0xfd26('0x34')](function(){if(_0x32c0ba){return _0x32c0ba;}})[_0xfd26('0x34')](respondWithResult(_0x2db3f7,null))[_0xfd26('0x27')](handleError(_0x2db3f7,null));};exports[_0xfd26('0xe7')]=function(_0x3a0053,_0x25f17b,_0x2acf68){return db[_0xfd26('0xbc')][_0xfd26('0x52')]({'where':{'id':_0x3a0053[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x25f17b,null))[_0xfd26('0x34')](function(_0x1a623b){if(_0x1a623b){return _0x1a623b['addInteraction'](_0x3a0053[_0xfd26('0x5c')]['ids'],_['omit'](_0x3a0053[_0xfd26('0x5c')],[_0xfd26('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x25f17b,null))[_0xfd26('0x27')](handleError(_0x25f17b,null));};exports[_0xfd26('0xe8')]=function(_0x58edc9,_0x5a619a,_0x5495ee){var _0xf27031={'raw':![],'where':{}};var _0x4e4ea6={};var _0x5ed5d9={'count':0x0,'rows':[]};return db[_0xfd26('0x3b')][_0xfd26('0x62')]({'where':{'id':_0x58edc9[_0xfd26('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5a619a,null))[_0xfd26('0x34')](function(_0x3ce664){if(_0x3ce664){_0x4e4ea6[_0xfd26('0x3d')]=_[_0xfd26('0x4f')](db[_0xfd26('0xbc')][_0xfd26('0x3c')]);_0x4e4ea6[_0xfd26('0x3e')]=_[_0xfd26('0x4f')](_0x58edc9[_0xfd26('0x3e')]);_0x4e4ea6[_0xfd26('0x3f')]=_[_0xfd26('0x40')](_0x4e4ea6[_0xfd26('0x3d')],_0x4e4ea6['query']);_0xf27031[_0xfd26('0x41')]=_['intersection'](_0x4e4ea6[_0xfd26('0x3d')],qs['fields'](_0x58edc9[_0xfd26('0x3e')][_0xfd26('0x42')]));_0xf27031[_0xfd26('0x41')]=_0xf27031[_0xfd26('0x41')]['length']?_0xf27031['attributes']:_0x4e4ea6[_0xfd26('0x3d')];if(!_0x58edc9[_0xfd26('0x3e')][_0xfd26('0x69')](_0xfd26('0x44'))){_0xf27031[_0xfd26('0x2c')]=qs[_0xfd26('0x2c')](_0x58edc9[_0xfd26('0x3e')][_0xfd26('0x2c')]);_0xf27031['offset']=qs[_0xfd26('0x45')](_0x58edc9['query']['offset']);}_0xf27031['order']=qs['sort'](_0x58edc9[_0xfd26('0x3e')][_0xfd26('0x46')]);_0xf27031['where']=qs[_0xfd26('0x3f')](_[_0xfd26('0x64')](_0x58edc9[_0xfd26('0x3e')],_0x4e4ea6['filters']));_0xf27031[_0xfd26('0x47')][_0xfd26('0x5f')]=_0x3ce664['id'];if(_0x58edc9[_0xfd26('0x3e')][_0xfd26('0x4b')]){_0xf27031[_0xfd26('0x47')]=_['merge'](_0xf27031[_0xfd26('0x47')],{'$or':_[_0xfd26('0x48')](_0xf27031['attributes'],function(_0x2a081f){var _0x222748={};_0x222748[_0x2a081f]={'$like':'%'+_0x58edc9['query'][_0xfd26('0x4b')]+'%'};return _0x222748;})});}_0xf27031=_['merge']({},_0xf27031,_0x58edc9[_0xfd26('0x51')]);return db[_0xfd26('0xbc')][_0xfd26('0x2b')]({'where':_0xf27031[_0xfd26('0x47')]})[_0xfd26('0x34')](function(_0xa2a596){_0x5ed5d9[_0xfd26('0x2b')]=_0xa2a596;if(_0x58edc9[_0xfd26('0x3e')][_0xfd26('0x6a')]){_0xf27031[_0xfd26('0x50')]=[{'model':db[_0xfd26('0x98')],'as':'Contact','required':![]},{'model':db[_0xfd26('0xe9')],'as':'Owner','attributes':[_0xfd26('0x37'),'fullname',_0xfd26('0xea')],'required':![]},{'model':db[_0xfd26('0xeb')],'as':_0xfd26('0xec'),'attributes':['id',_0xfd26('0x37'),_0xfd26('0xed')],'where':_0x58edc9['query'][_0xfd26('0xee')]?{'id':_0x58edc9[_0xfd26('0x3e')][_0xfd26('0xee')]}:undefined,'required':_0x58edc9[_0xfd26('0x3e')][_0xfd26('0xee')]?!![]:![]}];}return db['ChatInteraction'][_0xfd26('0x4d')](_0xf27031);})[_0xfd26('0x34')](function(_0x3917f5){_0x5ed5d9['rows']=_0x3917f5;return _0x5ed5d9;});}})[_0xfd26('0x34')](respondWithFilteredResult(_0x5a619a,_0xf27031))[_0xfd26('0x27')](handleError(_0x5a619a,null));};function iftimePromise(_0x3efa42,_0x24de17){return respondWithRpcPromise(_0xfd26('0xef'),'getSnippet',{'command':_0x24de17['timezone']?util['format'](_0xfd26('0xf0'),_0x3efa42[_0xfd26('0xf1')],_0x24de17[_0xfd26('0xf2')]):util[_0xfd26('0xb2')]('iftime\x20%s',_0x3efa42['interval'])},client9002)[_0xfd26('0x34')](function(_0x550853){var _0x582140=_0x550853&&_0x550853[_0xfd26('0xf3')]('true')>=0x0?!![]:![];logger[_0xfd26('0x1f')](_0xfd26('0xf4'),_0x24de17['id'],_0x3efa42['id'],_0x3efa42[_0xfd26('0xf1')],_0x582140?_0xfd26('0xf5'):_0xfd26('0xf6'),_0x24de17['timezone']?_0x24de17[_0xfd26('0xf2')]:'No\x20timezone');return _0x582140;})[_0xfd26('0x27')](function(_0x139b3c){logger[_0xfd26('0x23')](_0xfd26('0xf4'),_0x24de17['id'],_0x3efa42['id'],_0x3efa42[_0xfd26('0xf1')],util['inspect'](_0x139b3c,{'showHidden':![],'depth':null}),_0x24de17[_0xfd26('0xf2')]?_0x24de17[_0xfd26('0xf2')]:_0xfd26('0xf7'));return![];});}exports[_0xfd26('0xf8')]=function(_0x3cfdbb,_0x1e6af4,_0x500f59){var _0x3bc4b6=0x0;var _0x103a39=0x0;var _0x243fa1=![];var _0x5c56e1;var _0x4dbdeb;return db[_0xfd26('0x3b')][_0xfd26('0x52')]({'where':{'id':_0x3cfdbb[_0xfd26('0x5d')]['id']},'include':[{'model':db[_0xfd26('0xf9')],'as':_0xfd26('0xf9'),'include':[{'model':db[_0xfd26('0xf9')],'as':'Intervals','attributes':['id',_0xfd26('0xf1')],'raw':!![]}]}]})[_0xfd26('0x34')](handleEntityNotFound(_0x1e6af4,null))[_0xfd26('0x34')](function(_0x441881){if(_0x441881){_0x5c56e1=_0x441881;return _0x441881[_0xfd26('0xfa')]({'raw':!![]});}})['then'](function(_0x4cc640){if(_0x5c56e1){if(_0x4cc640){_0x4dbdeb=_0x4cc640;}}return require(_0xfd26('0x78'))['getLicense']();})[_0xfd26('0x34')](function(_0x53989b){if(_0x53989b){_0x103a39=_0x53989b[_0xfd26('0xfb')];_0x243fa1=_0x53989b[_0xfd26('0xfc')];}})[_0xfd26('0x34')](function(){return db[_0xfd26('0xbc')][_0xfd26('0x2b')]({'where':{'closed':![]}});})[_0xfd26('0x34')](function(_0x2cfb2d){_0x3bc4b6=_0x2cfb2d;if(_0x103a39&&_0x2cfb2d>_0x103a39){return db[_0xfd26('0xfd')][_0xfd26('0x62')]({'where':{'id':0x1}})[_0xfd26('0x34')](function(_0x5bffe8){if(_0x5bffe8){_0x5bffe8[_0xfd26('0xfe')]('chatLicenseExceeded');}});}})[_0xfd26('0x34')](function(){if(_0x5c56e1['Interval']&&_0x5c56e1[_0xfd26('0xf9')][_0xfd26('0xff')]){var _0x453649=[];for(var _0x244f45=0x0;_0x244f45<_0x5c56e1[_0xfd26('0xf9')][_0xfd26('0xff')][_0xfd26('0x43')];_0x244f45++){var _0x2e819d=_0x5c56e1[_0xfd26('0xf9')]['Intervals'][_0x244f45][_0xfd26('0x55')]({'plain':!![]});_0x453649[_0xfd26('0xc1')](iftimePromise(_0x2e819d,_0x5c56e1));}return BPromise[_0xfd26('0x100')](_0x453649)['then'](function(_0x5ad091){return _[_0xfd26('0x101')](_0x5ad091);});}else{return!![];}})[_0xfd26('0x34')](function(_0xa8ad3){var _0x2d9b22=fs[_0xfd26('0xd3')](path[_0xfd26('0x7b')](config[_0xfd26('0x76')],_0xfd26('0x102')),_0xfd26('0xd5'));var _0x4e569c={'remote':_0x5c56e1[_0xfd26('0x103')],'query':querystring['stringify'](_['merge'](_0x5c56e1[_0xfd26('0x55')]({'plain':!![]}),{'customerIp':_0x3cfdbb[_0xfd26('0x88')][_0xfd26('0xa8')]||_0x3cfdbb[_0xfd26('0x88')][_0xfd26('0x104')]||_0x3cfdbb[_0xfd26('0x105')][_0xfd26('0x106')]||_0x3cfdbb['ip'],'referer':_0x3cfdbb[_0xfd26('0x88')][_0xfd26('0xad')],'openedInteractions':_0x3bc4b6,'maxInteractions':_0x103a39,'virtual':_0x243fa1[_0xfd26('0xfb')],'online':_0xa8ad3,'custom':_0x243fa1}))[_0xfd26('0x107')](/'/g,'\x5c\x27')};_0x1e6af4[_0xfd26('0xce')](ejs[_0xfd26('0xd6')](Mustache[_0xfd26('0xd6')](_0x2d9b22,_0x4e569c),{'proactiveActions':_0x4dbdeb,'alignment':_0x5c56e1['alignment'],'verticalAlignment':_0x5c56e1[_0xfd26('0x108')]}));})[_0xfd26('0x27')](handleError(_0x1e6af4,null));};exports['addApplications']=function(_0x25d52b,_0x340762,_0x2866a8){return db['ChatWebsite']['findOne']({'where':{'id':_0x25d52b['params']['id']}})['then'](handleEntityNotFound(_0x340762,null))[_0xfd26('0x34')](function(_0xa447){if(_0xa447){return db[_0xfd26('0x109')][_0xfd26('0x10a')](function(_0x188bbd){return db[_0xfd26('0x10b')][_0xfd26('0x35')]({'where':{'ChatWebsiteId':_0x25d52b['params']['id']},'transaction':_0x188bbd})['then'](function(_0x2f9faa){var _0x59f2db=_[_0xfd26('0x48')](_0x25d52b[_0xfd26('0x5c')],function(_0x278047){_0x278047[_0xfd26('0x5f')]=_0x25d52b[_0xfd26('0x5d')]['id'];return _0x278047;});return db[_0xfd26('0x10b')][_0xfd26('0x10c')](_0x59f2db,{'transaction':_0x188bbd});});})[_0xfd26('0x34')](function(){return db[_0xfd26('0x10b')][_0xfd26('0x10d')]({'where':{'ChatWebsiteId':_0x25d52b[_0xfd26('0x5d')]['id']},'order':_0xfd26('0xa0')});});}})[_0xfd26('0x34')](respondWithResult(_0x340762,null))[_0xfd26('0x27')](handleError(_0x340762,null));};exports[_0xfd26('0x10e')]=function(_0x1e2669,_0x368349,_0x5641cd){var _0x453541={};var _0x18401d={};var _0x16f207;var _0x46a6e4;return db[_0xfd26('0x3b')]['findOne']({'where':{'id':_0x1e2669['params']['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x368349,null))['then'](function(_0x4bbc11){if(_0x4bbc11){_0x16f207=_0x4bbc11;_0x18401d[_0xfd26('0x3d')]=_[_0xfd26('0x4f')](db[_0xfd26('0x10b')]['rawAttributes']);_0x18401d[_0xfd26('0x3e')]=_[_0xfd26('0x4f')](_0x1e2669['query']);_0x18401d[_0xfd26('0x3f')]=_['intersection'](_0x18401d[_0xfd26('0x3d')],_0x18401d['query']);_0x453541[_0xfd26('0x41')]=_[_0xfd26('0x40')](_0x18401d[_0xfd26('0x3d')],qs[_0xfd26('0x42')](_0x1e2669[_0xfd26('0x3e')]['fields']));_0x453541['attributes']=_0x453541['attributes'][_0xfd26('0x43')]?_0x453541['attributes']:_0x18401d[_0xfd26('0x3d')];_0x453541[_0xfd26('0x63')]=qs[_0xfd26('0x46')](_0x1e2669[_0xfd26('0x3e')][_0xfd26('0x46')]);_0x453541[_0xfd26('0x47')]=qs[_0xfd26('0x3f')](_[_0xfd26('0x64')](_0x1e2669[_0xfd26('0x3e')],_0x18401d[_0xfd26('0x3f')]));if(_0x1e2669[_0xfd26('0x3e')][_0xfd26('0x4b')]){_0x453541[_0xfd26('0x47')]=_[_0xfd26('0x4c')](_0x453541[_0xfd26('0x47')],{'$or':_[_0xfd26('0x48')](_0x453541[_0xfd26('0x41')],function(_0x4524cc){var _0x1f4d57={};_0x1f4d57[_0x4524cc]={'$like':'%'+_0x1e2669['query']['filter']+'%'};return _0x1f4d57;})});}_0x453541=_[_0xfd26('0x4c')]({},_0x453541,_0x1e2669[_0xfd26('0x51')]);return _0x16f207[_0xfd26('0x10e')](_0x453541);}})[_0xfd26('0x34')](function(_0x20cb79){if(_0x20cb79){_0x46a6e4=_0x20cb79[_0xfd26('0x43')];if(!_0x1e2669[_0xfd26('0x3e')][_0xfd26('0x69')](_0xfd26('0x44'))){_0x453541['limit']=qs[_0xfd26('0x2c')](_0x1e2669[_0xfd26('0x3e')][_0xfd26('0x2c')]);_0x453541['offset']=qs['offset'](_0x1e2669['query'][_0xfd26('0x45')]);}return _0x16f207[_0xfd26('0x10e')](_0x453541);}})[_0xfd26('0x34')](function(_0x59dae6){if(_0x59dae6){return _0x59dae6?{'count':_0x46a6e4,'rows':_0x59dae6}:null;}})['then'](respondWithResult(_0x368349,null))[_0xfd26('0x27')](handleError(_0x368349,null));};exports[_0xfd26('0x10f')]=function(_0x67d4fd,_0x2ed716,_0x306441){return db[_0xfd26('0x110')][_0xfd26('0x52')]({'where':{'id':_0x67d4fd[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x2ed716,null))['then'](function(_0x4183e2){if(_0x4183e2){return _0x4183e2[_0xfd26('0x10f')](_0x67d4fd[_0xfd26('0x5c')][_0xfd26('0x6c')],_[_0xfd26('0x111')](_0x67d4fd[_0xfd26('0x5c')],[_0xfd26('0x6c'),'id'])||{});}})[_0xfd26('0x34')](respondWithResult(_0x2ed716,null))[_0xfd26('0x27')](handleError(_0x2ed716,null));};exports[_0xfd26('0xfa')]=function(_0x59e6e4,_0x5b63b1,_0x311db3){var _0x434886={};var _0x41f081={};var _0x2cf1b6;var _0xea6589;return db[_0xfd26('0x3b')][_0xfd26('0x62')]({'where':{'id':_0x59e6e4[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x5b63b1,null))[_0xfd26('0x34')](function(_0x57f37f){if(_0x57f37f){_0x2cf1b6=_0x57f37f;_0x41f081['model']=_[_0xfd26('0x4f')](db[_0xfd26('0x112')][_0xfd26('0x3c')]);_0x41f081['query']=_[_0xfd26('0x4f')](_0x59e6e4[_0xfd26('0x3e')]);_0x41f081['filters']=_[_0xfd26('0x40')](_0x41f081[_0xfd26('0x3d')],_0x41f081['query']);_0x434886[_0xfd26('0x41')]=_[_0xfd26('0x40')](_0x41f081[_0xfd26('0x3d')],qs[_0xfd26('0x42')](_0x59e6e4[_0xfd26('0x3e')][_0xfd26('0x42')]));_0x434886['attributes']=_0x434886[_0xfd26('0x41')][_0xfd26('0x43')]?_0x434886[_0xfd26('0x41')]:_0x41f081[_0xfd26('0x3d')];_0x434886[_0xfd26('0x63')]=qs['sort'](_0x59e6e4[_0xfd26('0x3e')][_0xfd26('0x46')]);_0x434886['where']=qs[_0xfd26('0x3f')](_[_0xfd26('0x64')](_0x59e6e4[_0xfd26('0x3e')],_0x41f081[_0xfd26('0x3f')]));if(_0x59e6e4[_0xfd26('0x3e')][_0xfd26('0x4b')]){_0x434886[_0xfd26('0x47')]=_[_0xfd26('0x4c')](_0x434886[_0xfd26('0x47')],{'$or':_[_0xfd26('0x48')](_0x434886[_0xfd26('0x41')],function(_0x13ab2f){var _0x52b129={};_0x52b129[_0x13ab2f]={'$like':'%'+_0x59e6e4[_0xfd26('0x3e')][_0xfd26('0x4b')]+'%'};return _0x52b129;})});}_0x434886=_[_0xfd26('0x4c')]({},_0x434886,_0x59e6e4[_0xfd26('0x51')]);return _0x2cf1b6[_0xfd26('0xfa')](_0x434886);}})['then'](function(_0xef0c01){if(_0xef0c01){_0xea6589=_0xef0c01[_0xfd26('0x43')];if(!_0x59e6e4['query'][_0xfd26('0x69')](_0xfd26('0x44'))){_0x434886[_0xfd26('0x2c')]=qs[_0xfd26('0x2c')](_0x59e6e4[_0xfd26('0x3e')][_0xfd26('0x2c')]);_0x434886[_0xfd26('0x45')]=qs['offset'](_0x59e6e4['query'][_0xfd26('0x45')]);}return _0x2cf1b6[_0xfd26('0xfa')](_0x434886);}})['then'](function(_0x46a657){if(_0x46a657){return _0x46a657?{'count':_0xea6589,'rows':_0x46a657}:null;}})[_0xfd26('0x34')](respondWithResult(_0x5b63b1,null))[_0xfd26('0x27')](handleError(_0x5b63b1,null));};exports[_0xfd26('0x113')]=function(_0x277d47,_0x2dc71e,_0x47ef68){var _0x51620f=_0x277d47[_0xfd26('0x3e')][_0xfd26('0x114')]===_0xfd26('0x115')?_0xfd26('0x116'):_0xfd26('0x117');return db[_0xfd26('0x3b')][_0xfd26('0x52')]({'attributes':['id',_0x51620f],'where':{'id':_0x277d47[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x2dc71e,null))[_0xfd26('0x34')](function(_0x491661){if(_0x491661){var _0x199cbe=_0x491661[_0x51620f];var _0x24d672=_0x199cbe&&_0x199cbe[_0xfd26('0x118')]?_0x199cbe[_0xfd26('0x118')]:[];_0x2dc71e[_0xfd26('0xce')]({'fromKey':_[_0xfd26('0x79')](_0x199cbe[_0xfd26('0x119')])?undefined:_0x199cbe['fromKey'],'count':_0x24d672[_0xfd26('0x43')],'rows':_0x24d672});}})[_0xfd26('0x27')](handleError(_0x2dc71e,null));};exports[_0xfd26('0x11a')]=function(_0x252b82,_0x2e02ad,_0x1e1e34){var _0x4ac06f={'raw':!![],'where':{}};var _0x28b6dd={};var _0x2300cf={'count':0x0,'rows':[]};return db[_0xfd26('0x3b')]['findOne']({'where':{'id':_0x252b82[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x2e02ad,null))[_0xfd26('0x34')](function(_0x4826ff){if(_0x4826ff){_0x28b6dd[_0xfd26('0x3d')]=_[_0xfd26('0x4f')](db[_0xfd26('0x11b')][_0xfd26('0x3c')]);_0x28b6dd[_0xfd26('0x3e')]=_[_0xfd26('0x4f')](_0x252b82[_0xfd26('0x3e')]);_0x28b6dd[_0xfd26('0x3f')]=_[_0xfd26('0x40')](_0x28b6dd[_0xfd26('0x3d')],_0x28b6dd[_0xfd26('0x3e')]);_0x4ac06f[_0xfd26('0x41')]=_[_0xfd26('0x40')](_0x28b6dd['model'],qs[_0xfd26('0x42')](_0x252b82[_0xfd26('0x3e')][_0xfd26('0x42')]));_0x4ac06f['attributes']=_0x4ac06f[_0xfd26('0x41')][_0xfd26('0x43')]?_0x4ac06f[_0xfd26('0x41')]:_0x28b6dd[_0xfd26('0x3d')];if(!_0x252b82[_0xfd26('0x3e')][_0xfd26('0x69')](_0xfd26('0x44'))){_0x4ac06f['limit']=qs['limit'](_0x252b82[_0xfd26('0x3e')][_0xfd26('0x2c')]);_0x4ac06f[_0xfd26('0x45')]=qs['offset'](_0x252b82[_0xfd26('0x3e')][_0xfd26('0x45')]);}_0x4ac06f[_0xfd26('0x63')]=qs[_0xfd26('0x46')](_0x252b82['query'][_0xfd26('0x46')]);_0x4ac06f[_0xfd26('0x47')]=qs[_0xfd26('0x3f')](_[_0xfd26('0x64')](_0x252b82[_0xfd26('0x3e')],_0x28b6dd['filters']));_0x4ac06f[_0xfd26('0x47')][_0xfd26('0x5f')]=_0x4826ff['id'];if(_0x252b82['query'][_0xfd26('0x4b')]){_0x4ac06f[_0xfd26('0x47')]=_[_0xfd26('0x4c')](_0x4ac06f[_0xfd26('0x47')],{'$or':_[_0xfd26('0x48')](_0x4ac06f[_0xfd26('0x41')],function(_0x501c67){var _0x3cf828={};_0x3cf828[_0x501c67]={'$like':'%'+_0x252b82[_0xfd26('0x3e')]['filter']+'%'};return _0x3cf828;})});}_0x4ac06f=_[_0xfd26('0x4c')]({},_0x4ac06f,_0x252b82[_0xfd26('0x51')]);return db[_0xfd26('0x11b')][_0xfd26('0x2b')]({'where':_0x4ac06f['where']})[_0xfd26('0x34')](function(_0x8ce949){_0x2300cf[_0xfd26('0x2b')]=_0x8ce949;if(_0x252b82[_0xfd26('0x3e')]['includeAll']){_0x4ac06f[_0xfd26('0x50')]=[{'all':!![]}];}return db[_0xfd26('0x11b')]['findAll'](_0x4ac06f);})[_0xfd26('0x34')](function(_0x403724){_0x2300cf[_0xfd26('0x65')]=_0x403724;return _0x2300cf;});}})[_0xfd26('0x34')](respondWithFilteredResult(_0x2e02ad,_0x4ac06f))[_0xfd26('0x27')](handleError(_0x2e02ad,null));};exports[_0xfd26('0x11c')]=function(_0x2f3a00,_0x5ca2e7,_0xc49236){return db[_0xfd26('0x3b')][_0xfd26('0x52')]({'where':{'id':_0x2f3a00[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x5ca2e7,null))['then'](function(_0x9fe481){if(_0x9fe481){return _0x9fe481['addAgents'](_0x2f3a00[_0xfd26('0x5c')][_0xfd26('0x6c')],_[_0xfd26('0x111')](_0x2f3a00['body'],[_0xfd26('0x6c'),'id'])||{})[_0xfd26('0xbd')](function(_0x19e47c){for(var _0x5dd4f9=0x0;_0x5dd4f9<_0x2f3a00[_0xfd26('0x5c')][_0xfd26('0x6c')][_0xfd26('0x43')];_0x5dd4f9+=0x1){socket['emit']('userChatWebsite:save',{'UserId':_0x2f3a00['body']['ids'][_0x5dd4f9],'ChatWebsiteId':_0x2f3a00['params']['id']});}return _0x19e47c;});}})[_0xfd26('0x34')](respondWithResult(_0x5ca2e7,null))[_0xfd26('0x27')](handleError(_0x5ca2e7,null));};exports[_0xfd26('0x11d')]=function(_0x1f42fc,_0x2c11a8,_0xdfb531){return db['ChatWebsite'][_0xfd26('0x52')]({'where':{'id':_0x1f42fc[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x2c11a8,null))['then'](function(_0x42684e){if(_0x42684e){return _0x42684e[_0xfd26('0x11d')](_0x1f42fc[_0xfd26('0x3e')]['ids'])[_0xfd26('0x34')](function(){if(_['isArray'](_0x1f42fc[_0xfd26('0x3e')][_0xfd26('0x6c')])){for(var _0x5b0196=0x0;_0x5b0196<_0x1f42fc[_0xfd26('0x3e')][_0xfd26('0x6c')][_0xfd26('0x43')];_0x5b0196+=0x1){socket[_0xfd26('0x11e')]('userChatWebsite:remove',{'UserId':Number(_0x1f42fc['query']['ids'][_0x5b0196]),'ChatWebsiteId':Number(_0x1f42fc['params']['id'])});}}else{socket[_0xfd26('0x11e')](_0xfd26('0x11f'),{'UserId':Number(_0x1f42fc[_0xfd26('0x3e')][_0xfd26('0x6c')]),'ChatWebsiteId':Number(_0x1f42fc[_0xfd26('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x2c11a8,null))['catch'](handleError(_0x2c11a8,null));};exports['getAgents']=function(_0x2e9f32,_0x2a6642,_0x2af076){var _0x3825b5={};var _0x566bfc={};var _0x4be706;var _0x1d1ed;return db[_0xfd26('0x3b')]['findOne']({'where':{'id':_0x2e9f32[_0xfd26('0x5d')]['id']}})[_0xfd26('0x34')](handleEntityNotFound(_0x2a6642,null))['then'](function(_0x23ba23){if(_0x23ba23){_0x4be706=_0x23ba23;_0x566bfc['model']=_[_0xfd26('0x4f')](db[_0xfd26('0xe9')][_0xfd26('0x3c')]);_0x566bfc[_0xfd26('0x3e')]=_[_0xfd26('0x4f')](_0x2e9f32[_0xfd26('0x3e')]);_0x566bfc[_0xfd26('0x3f')]=_[_0xfd26('0x40')](_0x566bfc[_0xfd26('0x3d')],_0x566bfc['query']);_0x3825b5[_0xfd26('0x41')]=_['intersection'](_0x566bfc[_0xfd26('0x3d')],qs['fields'](_0x2e9f32[_0xfd26('0x3e')][_0xfd26('0x42')]));_0x3825b5['attributes']=_0x3825b5[_0xfd26('0x41')][_0xfd26('0x43')]?_0x3825b5[_0xfd26('0x41')]:_0x566bfc[_0xfd26('0x3d')];_0x3825b5[_0xfd26('0x63')]=qs[_0xfd26('0x46')](_0x2e9f32[_0xfd26('0x3e')][_0xfd26('0x46')]);_0x3825b5[_0xfd26('0x47')]=qs[_0xfd26('0x3f')](_[_0xfd26('0x64')](_0x2e9f32[_0xfd26('0x3e')],_0x566bfc[_0xfd26('0x3f')]));if(_0x2e9f32['query'][_0xfd26('0x4b')]){_0x3825b5['where']=_[_0xfd26('0x4c')](_0x3825b5[_0xfd26('0x47')],{'$or':_[_0xfd26('0x48')](_0x3825b5['attributes'],function(_0x59027c){var _0x8989d5={};_0x8989d5[_0x59027c]={'$like':'%'+_0x2e9f32[_0xfd26('0x3e')][_0xfd26('0x4b')]+'%'};return _0x8989d5;})});}_0x3825b5=_[_0xfd26('0x4c')]({},_0x3825b5,_0x2e9f32['options']);return _0x4be706[_0xfd26('0x120')](_0x3825b5);}})[_0xfd26('0x34')](function(_0x2d8c08){if(_0x2d8c08){_0x1d1ed=_0x2d8c08[_0xfd26('0x43')];if(!_0x2e9f32[_0xfd26('0x3e')][_0xfd26('0x69')]('nolimit')){_0x3825b5[_0xfd26('0x2c')]=qs[_0xfd26('0x2c')](_0x2e9f32[_0xfd26('0x3e')][_0xfd26('0x2c')]);_0x3825b5[_0xfd26('0x45')]=qs['offset'](_0x2e9f32[_0xfd26('0x3e')]['offset']);}return _0x4be706['getAgents'](_0x3825b5);}})['then'](function(_0x7d12f2){if(_0x7d12f2){return _0x7d12f2?{'count':_0x1d1ed,'rows':_0x7d12f2}:null;}})[_0xfd26('0x34')](respondWithResult(_0x2a6642,null))[_0xfd26('0x27')](handleError(_0x2a6642,null));}; \ No newline at end of file +var _0xee7f=['x-real-port','referer','version','%s\x20%s','browser','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','messageId','created','autoclose','push','unmanaged','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','no\x20available\x20attributes','send','from\x20is\x20mandatory','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','addInteraction','ids','getInteractions','Owner','internal','Tag','Tags','color','tag','iftime\x20%s,%s','timezone','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','getSnippet','Interval','../../config/license/util','getLicense','virtual','custom','License','chatLicenseExceeded','Intervals','all','some','remote','x-real-ip','remoteAddress','alignment','verticalAlignment','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','getFields','false','offlineForm','items','fromKey','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','redis','localhost','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','set','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','ChatWebsite','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','rows','show','params','includeAll','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','Disposition','rawAttributes','hasOwnProperty','ChatWebsiteId','findAll','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','isNil','existsSync','server/files/images/logos/','download','getAvatar','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','list','applications','orderBy','priority','asc','defaults','from','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName'];(function(_0x5c40b5,_0x1c1f41){var _0x4c2cdc=function(_0x1e6264){while(--_0x1e6264){_0x5c40b5['push'](_0x5c40b5['shift']());}};_0x4c2cdc(++_0x1c1f41);}(_0xee7f,0x18a));var _0xfee7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xee7f[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xfee7('0x0'));var emlformat=require(_0xfee7('0x1'));var rimraf=require(_0xfee7('0x2'));var zipdir=require(_0xfee7('0x3'));var jsonpatch=require(_0xfee7('0x4'));var rp=require(_0xfee7('0x5'));var moment=require(_0xfee7('0x6'));var BPromise=require(_0xfee7('0x7'));var Mustache=require(_0xfee7('0x8'));var util=require('util');var path=require('path');var sox=require(_0xfee7('0x9'));var csv=require('to-csv');var ejs=require(_0xfee7('0xa'));var fs=require('fs');var _=require(_0xfee7('0xb'));var squel=require(_0xfee7('0xc'));var crypto=require(_0xfee7('0xd'));var jsforce=require(_0xfee7('0xe'));var deskjs=require(_0xfee7('0xf'));var toCsv=require(_0xfee7('0x10'));var querystring=require(_0xfee7('0x11'));var Papa=require(_0xfee7('0x12'));var Redis=require(_0xfee7('0x13'));var authService=require(_0xfee7('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfee7('0x15'))('api');var utils=require(_0xfee7('0x16'));var config=require(_0xfee7('0x17'));var db=require('../../mysqldb')['db'];config[_0xfee7('0x18')]=_['defaults'](config[_0xfee7('0x18')],{'host':_0xfee7('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfee7('0x18')]));require('./chatWebsite.socket')['register'](socket);var jayson=require(_0xfee7('0x1a'));var client=jayson['client'][_0xfee7('0x1b')]({'port':0x232c});var client9002=jayson[_0xfee7('0x1c')][_0xfee7('0x1b')]({'port':0x232a});var client9003=jayson['client'][_0xfee7('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x2f5196,_0x44890a,_0x5374ad){if(_0x5374ad){var _0x17a1cc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17a1cc[_0xfee7('0x1d')](_0x44890a)){return _0x2f5196;}else{throw new Error(_0xfee7('0x1e'));}}else{return _0x2f5196;}}function respondWithRpcPromise(_0x7f4dcb,_0x12442b,_0x49ca9f,_0x578f1e){return new BPromise(function(_0x21817b,_0x387c43){var _0x3bbfb8=_0x578f1e||client;return _0x3bbfb8['request'](_0x7f4dcb,_0x49ca9f)[_0xfee7('0x1f')](function(_0x48ccd0){logger[_0xfee7('0x20')](_0xfee7('0x21'),_0x12442b,_0xfee7('0x22'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x12442b,_0xfee7('0x22'),JSON[_0xfee7('0x23')](_0x48ccd0));if(_0x48ccd0[_0xfee7('0x24')]){if(_0x48ccd0['error'][_0xfee7('0x25')]===0x1f4){logger[_0xfee7('0x24')](_0xfee7('0x21'),_0x12442b,_0x48ccd0['error'][_0xfee7('0x26')]);return _0x387c43(_0x48ccd0['error'][_0xfee7('0x26')]);}logger[_0xfee7('0x24')](_0xfee7('0x21'),_0x12442b,_0x48ccd0[_0xfee7('0x24')][_0xfee7('0x26')]);return _0x21817b(_0x48ccd0['error'][_0xfee7('0x26')]);}else{logger[_0xfee7('0x20')](_0xfee7('0x21'),_0x12442b,_0xfee7('0x22'));_0x21817b(_0x48ccd0['result'][_0xfee7('0x26')]);}})['catch'](function(_0x20a3f0){logger['error'](_0xfee7('0x21'),_0x12442b,_0x20a3f0);_0x387c43(_0x20a3f0);});});}function respondWithStatusCode(_0xa8d6c9,_0x41351f){_0x41351f=_0x41351f||0xcc;return function(_0x48329c){if(_0x48329c){return _0xa8d6c9[_0xfee7('0x27')](_0x41351f);}return _0xa8d6c9[_0xfee7('0x28')](_0x41351f)[_0xfee7('0x29')]();};}function respondWithResult(_0x331cf2,_0x2f3951){_0x2f3951=_0x2f3951||0xc8;return function(_0xa2dd1a){if(_0xa2dd1a){return _0x331cf2['status'](_0x2f3951)[_0xfee7('0x2a')](_0xa2dd1a);}};}function respondWithFilteredResult(_0x4a9aaf,_0x19c0b1){return function(_0xfdc47){if(_0xfdc47){var _0x26a6a8=_0xfdc47['count'],_0x3ba87d=_0x19c0b1['offset'],_0x49f8a6=_0x19c0b1['offset']+_0x19c0b1['limit'],_0x33a31e;if(_0x49f8a6>=_0x26a6a8){_0x49f8a6=_0x26a6a8;_0x33a31e=0xc8;}else{_0x33a31e=0xce;}_0x4a9aaf['status'](_0x33a31e);return _0x4a9aaf[_0xfee7('0x2b')]('Content-Range',_0x3ba87d+'-'+_0x49f8a6+'/'+_0x26a6a8)[_0xfee7('0x2a')](_0xfdc47);}return null;};}function patchUpdates(_0x2998b4){return function(_0x17fafb){try{jsonpatch[_0xfee7('0x2c')](_0x17fafb,_0x2998b4,!![]);}catch(_0x44e755){return BPromise[_0xfee7('0x2d')](_0x44e755);}return _0x17fafb[_0xfee7('0x2e')]();};}function saveUpdates(_0x7d5dfc,_0x46b4af){return function(_0x52d372){if(_0x52d372){return _0x52d372[_0xfee7('0x2f')](_0x7d5dfc)[_0xfee7('0x1f')](function(_0x3c52b6){return _0x3c52b6;});}return null;};}function removeEntity(_0xb68d31,_0x2436d0){return function(_0x2dad8e){if(_0x2dad8e){return _0x2dad8e[_0xfee7('0x30')]()['then'](function(){var _0x1daff8=_0x2dad8e[_0xfee7('0x31')]({'plain':!![]});var _0x5ae888=_0xfee7('0x32');return db[_0xfee7('0x33')][_0xfee7('0x30')]({'where':{'type':_0x5ae888,'resourceId':_0x1daff8['id']}})[_0xfee7('0x1f')](function(){return _0x2dad8e;});})['then'](function(){_0xb68d31[_0xfee7('0x28')](0xcc)[_0xfee7('0x29')]();});}};}function handleEntityNotFound(_0x3c483d,_0x3125bd){return function(_0x1d9f78){if(!_0x1d9f78){_0x3c483d[_0xfee7('0x27')](0x194);}return _0x1d9f78;};}function handleError(_0x38a8f4,_0x46ae93){_0x46ae93=_0x46ae93||0x1f4;return function(_0x197983){logger[_0xfee7('0x24')](_0x197983[_0xfee7('0x34')]);if(_0x197983[_0xfee7('0x35')]){delete _0x197983[_0xfee7('0x35')];}_0x38a8f4[_0xfee7('0x28')](_0x46ae93)['send'](_0x197983);};}exports['index']=function(_0x99695a,_0x297153){var _0x5f2998={'include':[{'model':db[_0xfee7('0x36')],'as':_0xfee7('0x37')}]},_0x48a641={},_0x2c9579={'count':0x0,'rows':[]};var _0xcad17f=db[_0xfee7('0x38')]['rawAttributes'];_0x48a641[_0xfee7('0x39')]=_[_0xfee7('0x3a')](_0xcad17f);_0x48a641[_0xfee7('0x3b')]=_[_0xfee7('0x3a')](_0x99695a[_0xfee7('0x3b')]);_0x48a641[_0xfee7('0x3c')]=_[_0xfee7('0x3d')](_0x48a641['model'],_0x48a641[_0xfee7('0x3b')]);_0x5f2998['attributes']=_[_0xfee7('0x3d')](_0x48a641[_0xfee7('0x39')],qs[_0xfee7('0x3e')](_0x99695a[_0xfee7('0x3b')][_0xfee7('0x3e')]));_0x5f2998[_0xfee7('0x3f')]=_0x5f2998[_0xfee7('0x3f')][_0xfee7('0x40')]?_0x5f2998[_0xfee7('0x3f')]:_0x48a641[_0xfee7('0x39')];if(!_0x99695a[_0xfee7('0x3b')]['hasOwnProperty'](_0xfee7('0x41'))){_0x5f2998[_0xfee7('0x42')]=qs[_0xfee7('0x42')](_0x99695a[_0xfee7('0x3b')]['limit']);_0x5f2998['offset']=qs[_0xfee7('0x43')](_0x99695a[_0xfee7('0x3b')][_0xfee7('0x43')]);}_0x5f2998[_0xfee7('0x44')]=qs[_0xfee7('0x45')](_0x99695a['query'][_0xfee7('0x45')]);_0x5f2998[_0xfee7('0x46')]=qs[_0xfee7('0x3c')](_[_0xfee7('0x47')](_0x99695a[_0xfee7('0x3b')],_0x48a641[_0xfee7('0x3c')]));if(_0x99695a['query'][_0xfee7('0x48')]){_0x5f2998['where']=_[_0xfee7('0x49')](_0x5f2998[_0xfee7('0x46')],{'$or':_[_0xfee7('0x4a')](_0xcad17f,function(_0x41f369){if(_0x41f369[_0xfee7('0x4b')][_0xfee7('0x4c')]!==_0xfee7('0x4d')){var _0x20b0e6={};_0x20b0e6[_0x41f369[_0xfee7('0x4e')]]={'$like':'%'+_0x99695a['query'][_0xfee7('0x48')]+'%'};return _0x20b0e6;}})});}_0x5f2998=_[_0xfee7('0x49')]({},_0x5f2998,_0x99695a[_0xfee7('0x4f')]);var _0x318187={'where':_0x5f2998[_0xfee7('0x46')]};return db['ChatWebsite'][_0xfee7('0x50')](_0x318187)[_0xfee7('0x1f')](function(_0x2eecc0){_0x2c9579[_0xfee7('0x50')]=_0x2eecc0;if(_0x99695a['query']['includeAll']){_0x5f2998['include']=[{'all':!![]}];}return db[_0xfee7('0x38')]['findAll'](_0x5f2998);})[_0xfee7('0x1f')](function(_0x2c48c4){_0x2c9579[_0xfee7('0x51')]=_0x2c48c4;return _0x2c9579;})['then'](respondWithFilteredResult(_0x297153,_0x5f2998))['catch'](handleError(_0x297153,null));};exports[_0xfee7('0x52')]=function(_0xcf6f62,_0x1c6c90){var _0x5416fd={'raw':![],'where':{'id':_0xcf6f62[_0xfee7('0x53')]['id']},'include':[{'model':db[_0xfee7('0x36')],'as':_0xfee7('0x37')}]},_0xf924fa={};_0xf924fa[_0xfee7('0x39')]=_['keys'](db['ChatWebsite']['rawAttributes']);_0xf924fa['query']=_['keys'](_0xcf6f62[_0xfee7('0x3b')]);_0xf924fa[_0xfee7('0x3c')]=_['intersection'](_0xf924fa[_0xfee7('0x39')],_0xf924fa['query']);_0x5416fd[_0xfee7('0x3f')]=_['intersection'](_0xf924fa['model'],qs[_0xfee7('0x3e')](_0xcf6f62[_0xfee7('0x3b')][_0xfee7('0x3e')]));_0x5416fd['attributes']=_0x5416fd[_0xfee7('0x3f')][_0xfee7('0x40')]?_0x5416fd[_0xfee7('0x3f')]:_0xf924fa[_0xfee7('0x39')];if(_0xcf6f62[_0xfee7('0x3b')][_0xfee7('0x54')]){_0x5416fd[_0xfee7('0x55')]=[{'all':!![]}];}_0x5416fd=_['merge']({},_0x5416fd,_0xcf6f62[_0xfee7('0x4f')]);return db[_0xfee7('0x38')]['find'](_0x5416fd)['then'](handleEntityNotFound(_0x1c6c90,null))[_0xfee7('0x1f')](respondWithResult(_0x1c6c90,null))[_0xfee7('0x56')](handleError(_0x1c6c90,null));};exports[_0xfee7('0x57')]=function(_0x15d579,_0x2d9707){return db[_0xfee7('0x38')]['create'](_0x15d579[_0xfee7('0x58')],{})[_0xfee7('0x1f')](function(_0x5f2a62){var _0x410a71=_0x15d579[_0xfee7('0x59')][_0xfee7('0x31')]({'plain':!![]});if(!_0x410a71)throw new Error(_0xfee7('0x5a'));if(_0x410a71[_0xfee7('0x5b')]===_0xfee7('0x59')){var _0x20ff27=_0x5f2a62[_0xfee7('0x31')]({'plain':!![]});var _0x3942d4=_0xfee7('0x32');return db[_0xfee7('0x5c')][_0xfee7('0x5d')]({'where':{'name':_0x3942d4,'userProfileId':_0x410a71['userProfileId']},'raw':!![]})['then'](function(_0x453ec4){if(_0x453ec4&&_0x453ec4[_0xfee7('0x5e')]===0x0){return db[_0xfee7('0x33')]['create']({'name':_0x20ff27['name'],'resourceId':_0x20ff27['id'],'type':_0x453ec4[_0xfee7('0x35')],'sectionId':_0x453ec4['id']},{})[_0xfee7('0x1f')](function(){return _0x5f2a62;});}else{return _0x5f2a62;}})['catch'](function(_0x15fcc1){logger['error'](_0xfee7('0x5f'),_0x15fcc1);throw _0x15fcc1;});}return _0x5f2a62;})['then'](respondWithResult(_0x2d9707,0xc9))[_0xfee7('0x56')](handleError(_0x2d9707,null));};exports[_0xfee7('0x2f')]=function(_0x43e00b,_0x31a0e6){if(_0x43e00b[_0xfee7('0x58')]['id']){delete _0x43e00b[_0xfee7('0x58')]['id'];}return db[_0xfee7('0x38')][_0xfee7('0x5d')]({'where':{'id':_0x43e00b[_0xfee7('0x53')]['id']},'include':[{'model':db[_0xfee7('0x36')],'as':_0xfee7('0x37')}]})[_0xfee7('0x1f')](handleEntityNotFound(_0x31a0e6,null))['then'](saveUpdates(_0x43e00b[_0xfee7('0x58')],null))[_0xfee7('0x1f')](respondWithResult(_0x31a0e6,null))[_0xfee7('0x56')](handleError(_0x31a0e6,null));};exports[_0xfee7('0x30')]=function(_0x3da596,_0x27a89e){return db[_0xfee7('0x38')][_0xfee7('0x5d')]({'where':{'id':_0x3da596[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x27a89e,null))[_0xfee7('0x1f')](removeEntity(_0x27a89e,null))[_0xfee7('0x56')](handleError(_0x27a89e,null));};exports[_0xfee7('0x60')]=function(_0x368015,_0x44ae63){return db['ChatWebsite'][_0xfee7('0x60')]()[_0xfee7('0x1f')](respondWithResult(_0x44ae63,null))[_0xfee7('0x56')](handleError(_0x44ae63,null));};exports[_0xfee7('0x61')]=function(_0x5d9d81,_0x3e6c28,_0x13d572){if(_0x5d9d81['body']['id']){delete _0x5d9d81[_0xfee7('0x58')]['id'];}return db['ChatWebsite'][_0xfee7('0x5d')]({'where':{'id':_0x5d9d81[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x3e6c28,null))['then'](function(_0x5debc5){if(_0x5debc5){_0x5d9d81['body']['ChatWebsiteId']=_0x5debc5['id'];return db['Disposition'][_0xfee7('0x57')](_0x5d9d81[_0xfee7('0x58')]);}})[_0xfee7('0x1f')](respondWithResult(_0x3e6c28,null))[_0xfee7('0x56')](handleError(_0x3e6c28,null));};exports[_0xfee7('0x62')]=function(_0x3ad8cc,_0x93d820,_0x2441e3){var _0x424b95={'raw':![],'where':{}};var _0x564299={};var _0x428d49={'count':0x0,'rows':[]};return db[_0xfee7('0x38')]['findOne']({'where':{'id':_0x3ad8cc[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x93d820,null))[_0xfee7('0x1f')](function(_0x35699f){if(_0x35699f){_0x564299[_0xfee7('0x39')]=_['keys'](db[_0xfee7('0x63')][_0xfee7('0x64')]);_0x564299['query']=_[_0xfee7('0x3a')](_0x3ad8cc[_0xfee7('0x3b')]);_0x564299[_0xfee7('0x3c')]=_[_0xfee7('0x3d')](_0x564299[_0xfee7('0x39')],_0x564299[_0xfee7('0x3b')]);_0x424b95['attributes']=_[_0xfee7('0x3d')](_0x564299[_0xfee7('0x39')],qs[_0xfee7('0x3e')](_0x3ad8cc['query']['fields']));_0x424b95['attributes']=_0x424b95[_0xfee7('0x3f')][_0xfee7('0x40')]?_0x424b95[_0xfee7('0x3f')]:_0x564299[_0xfee7('0x39')];if(!_0x3ad8cc[_0xfee7('0x3b')][_0xfee7('0x65')](_0xfee7('0x41'))){_0x424b95['limit']=qs[_0xfee7('0x42')](_0x3ad8cc[_0xfee7('0x3b')]['limit']);_0x424b95[_0xfee7('0x43')]=qs[_0xfee7('0x43')](_0x3ad8cc[_0xfee7('0x3b')]['offset']);}_0x424b95[_0xfee7('0x44')]=qs[_0xfee7('0x45')](_0x3ad8cc[_0xfee7('0x3b')][_0xfee7('0x45')]);_0x424b95['where']=qs['filters'](_[_0xfee7('0x47')](_0x3ad8cc['query'],_0x564299[_0xfee7('0x3c')]));_0x424b95['where'][_0xfee7('0x66')]=_0x35699f['id'];if(_0x3ad8cc[_0xfee7('0x3b')][_0xfee7('0x48')]){_0x424b95['where']=_[_0xfee7('0x49')](_0x424b95[_0xfee7('0x46')],{'$or':_[_0xfee7('0x4a')](_0x424b95[_0xfee7('0x3f')],function(_0x1ae97d){var _0x1a2444={};_0x1a2444[_0x1ae97d]={'$like':'%'+_0x3ad8cc[_0xfee7('0x3b')][_0xfee7('0x48')]+'%'};return _0x1a2444;})});}_0x424b95=_[_0xfee7('0x49')]({},_0x424b95,_0x3ad8cc[_0xfee7('0x4f')]);return db['Disposition'][_0xfee7('0x50')]({'where':_0x424b95[_0xfee7('0x46')]})[_0xfee7('0x1f')](function(_0x235bf4){_0x428d49['count']=_0x235bf4;if(_0x3ad8cc[_0xfee7('0x3b')][_0xfee7('0x54')]){_0x424b95[_0xfee7('0x55')]=[{'all':!![]}];}return db[_0xfee7('0x63')][_0xfee7('0x67')](_0x424b95);})[_0xfee7('0x1f')](function(_0x64b6a2){_0x428d49[_0xfee7('0x51')]=_0x64b6a2;return _0x428d49;});}})[_0xfee7('0x1f')](respondWithFilteredResult(_0x93d820,_0x424b95))['catch'](handleError(_0x93d820,null));};exports['removeDispositions']=function(_0x1fbcde,_0x1eab0c,_0x1e2884){return db[_0xfee7('0x38')][_0xfee7('0x5d')]({'where':{'id':_0x1fbcde['params']['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x1eab0c,null))['then'](function(_0x4c4fbb){if(_0x4c4fbb){return _0x4c4fbb[_0xfee7('0x68')](_0x1fbcde[_0xfee7('0x3b')]['ids']);}})[_0xfee7('0x1f')](respondWithStatusCode(_0x1eab0c,null))[_0xfee7('0x56')](handleError(_0x1eab0c,null));};exports[_0xfee7('0x69')]=function(_0x28a895,_0x6ca029,_0x56ebaa){if(_0x28a895[_0xfee7('0x58')]['id']){delete _0x28a895[_0xfee7('0x58')]['id'];}return db[_0xfee7('0x38')][_0xfee7('0x5d')]({'where':{'id':_0x28a895['params']['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x6ca029,null))[_0xfee7('0x1f')](function(_0xaf64c4){if(_0xaf64c4){_0x28a895[_0xfee7('0x58')][_0xfee7('0x66')]=_0xaf64c4['id'];return db['CannedAnswer'][_0xfee7('0x57')](_0x28a895['body']);}})[_0xfee7('0x1f')](respondWithResult(_0x6ca029,null))['catch'](handleError(_0x6ca029,null));};exports[_0xfee7('0x6a')]=function(_0x3c3f23,_0x6554d4,_0x5800c7){var _0x43babe={'raw':![],'where':{}};var _0x2462a0={};var _0x1112e7={'count':0x0,'rows':[]};return db[_0xfee7('0x38')][_0xfee7('0x6b')]({'where':{'id':_0x3c3f23[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x6554d4,null))[_0xfee7('0x1f')](function(_0x3bd20a){if(_0x3bd20a){_0x2462a0['model']=_['keys'](db['CannedAnswer'][_0xfee7('0x64')]);_0x2462a0['query']=_['keys'](_0x3c3f23['query']);_0x2462a0['filters']=_[_0xfee7('0x3d')](_0x2462a0[_0xfee7('0x39')],_0x2462a0[_0xfee7('0x3b')]);_0x43babe[_0xfee7('0x3f')]=_['intersection'](_0x2462a0[_0xfee7('0x39')],qs[_0xfee7('0x3e')](_0x3c3f23[_0xfee7('0x3b')][_0xfee7('0x3e')]));_0x43babe[_0xfee7('0x3f')]=_0x43babe[_0xfee7('0x3f')][_0xfee7('0x40')]?_0x43babe['attributes']:_0x2462a0[_0xfee7('0x39')];if(!_0x3c3f23['query'][_0xfee7('0x65')](_0xfee7('0x41'))){_0x43babe[_0xfee7('0x42')]=qs[_0xfee7('0x42')](_0x3c3f23[_0xfee7('0x3b')]['limit']);_0x43babe[_0xfee7('0x43')]=qs[_0xfee7('0x43')](_0x3c3f23[_0xfee7('0x3b')][_0xfee7('0x43')]);}_0x43babe['order']=qs['sort'](_0x3c3f23['query'][_0xfee7('0x45')]);_0x43babe['where']=qs[_0xfee7('0x3c')](_[_0xfee7('0x47')](_0x3c3f23[_0xfee7('0x3b')],_0x2462a0[_0xfee7('0x3c')]));_0x43babe[_0xfee7('0x46')]['ChatWebsiteId']=_0x3bd20a['id'];if(_0x3c3f23[_0xfee7('0x3b')][_0xfee7('0x48')]){_0x43babe['where']=_[_0xfee7('0x49')](_0x43babe[_0xfee7('0x46')],{'$or':_[_0xfee7('0x4a')](_0x43babe['attributes'],function(_0x2a902a){var _0x3c44a1={};_0x3c44a1[_0x2a902a]={'$like':'%'+_0x3c3f23[_0xfee7('0x3b')][_0xfee7('0x48')]+'%'};return _0x3c44a1;})});}_0x43babe=_[_0xfee7('0x49')]({},_0x43babe,_0x3c3f23[_0xfee7('0x4f')]);return db['CannedAnswer'][_0xfee7('0x50')]({'where':_0x43babe[_0xfee7('0x46')]})[_0xfee7('0x1f')](function(_0x617b70){_0x1112e7[_0xfee7('0x50')]=_0x617b70;if(_0x3c3f23[_0xfee7('0x3b')][_0xfee7('0x54')]){_0x43babe[_0xfee7('0x55')]=[{'all':!![]}];}return db[_0xfee7('0x6c')]['findAll'](_0x43babe);})[_0xfee7('0x1f')](function(_0x16b119){_0x1112e7['rows']=_0x16b119;return _0x1112e7;});}})[_0xfee7('0x1f')](respondWithFilteredResult(_0x6554d4,_0x43babe))['catch'](handleError(_0x6554d4,null));};exports[_0xfee7('0x6d')]=function(_0x18db6b,_0x40e161,_0xc33b7){return db[_0xfee7('0x38')][_0xfee7('0x5d')]({'where':{'id':_0x18db6b[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x40e161,null))[_0xfee7('0x1f')](function(_0x2dd3de){if(_0x2dd3de){return _0x2dd3de[_0xfee7('0x6d')](_0x18db6b[_0xfee7('0x3b')]['ids']);}})[_0xfee7('0x1f')](respondWithStatusCode(_0x40e161,null))['catch'](handleError(_0x40e161,null));};exports[_0xfee7('0x6e')]=function(_0x209f9b,_0x25b8d2,_0x590005){_0x209f9b['body'][_0xfee7('0x6f')]=_0x209f9b[_0xfee7('0x70')][_0xfee7('0x71')];return db[_0xfee7('0x38')][_0xfee7('0x5d')]({'where':{'id':_0x209f9b[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x25b8d2,null))['then'](saveUpdates(_0x209f9b[_0xfee7('0x58')],null))[_0xfee7('0x1f')](respondWithResult(_0x25b8d2,null))[_0xfee7('0x56')](handleError(_0x25b8d2,null));};exports['addAvatar']=function(_0x2a6f88,_0x10185b,_0x8a7c03){_0x2a6f88[_0xfee7('0x58')]['agentAvatar']=_0x2a6f88[_0xfee7('0x70')]['filename'];return db[_0xfee7('0x38')][_0xfee7('0x5d')]({'where':{'id':_0x2a6f88[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x10185b,null))['then'](saveUpdates(_0x2a6f88['body'],null))[_0xfee7('0x1f')](respondWithResult(_0x10185b,null))['catch'](handleError(_0x10185b,null));};exports[_0xfee7('0x72')]=function(_0x1dddcd,_0x5507fc,_0x873292){_0x1dddcd[_0xfee7('0x58')]['customerAvatar']=_0x1dddcd['file'][_0xfee7('0x71')];return db[_0xfee7('0x38')]['find']({'where':{'id':_0x1dddcd[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x5507fc,null))['then'](saveUpdates(_0x1dddcd['body'],null))[_0xfee7('0x1f')](respondWithResult(_0x5507fc,null))[_0xfee7('0x56')](handleError(_0x5507fc,null));};exports[_0xfee7('0x73')]=function(_0x1315fc,_0xbc5de4,_0xba75d2){_0x1315fc[_0xfee7('0x58')][_0xfee7('0x74')]=_0x1315fc[_0xfee7('0x70')][_0xfee7('0x71')];return db[_0xfee7('0x38')][_0xfee7('0x5d')]({'where':{'id':_0x1315fc[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0xbc5de4,null))[_0xfee7('0x1f')](saveUpdates(_0x1315fc[_0xfee7('0x58')],null))['then'](respondWithResult(_0xbc5de4,null))[_0xfee7('0x56')](handleError(_0xbc5de4,null));};exports[_0xfee7('0x75')]=function(_0x13ce11,_0x5bd041,_0x3d6254){var _0x1cd96f=path[_0xfee7('0x76')](config[_0xfee7('0x77')],_0xfee7('0x78'));var _0x30c9da={'where':{'id':_0x13ce11[_0xfee7('0x53')]['id']},'attributes':['id',_0xfee7('0x6f')],'raw':!![]};var _0x45c7f1=![];return require('../../config/license/util')['getLicense']()[_0xfee7('0x1f')](function(_0x1bb3e4){if(_0x1bb3e4){_0x45c7f1=_0x1bb3e4['custom'];}})[_0xfee7('0x1f')](function(){return db[_0xfee7('0x38')]['find'](_0x30c9da);})[_0xfee7('0x1f')](handleEntityNotFound(_0x5bd041,null))['then'](function(_0x2788ae){if(_0x2788ae){if(!_[_0xfee7('0x79')](_0x2788ae[_0xfee7('0x6f')])){if(fs[_0xfee7('0x7a')](path[_0xfee7('0x76')](config[_0xfee7('0x77')],_0xfee7('0x7b'),_0x2788ae['sitepic']))&&_0x45c7f1){_0x1cd96f=path[_0xfee7('0x76')](config[_0xfee7('0x77')],_0xfee7('0x7b'),_0x2788ae[_0xfee7('0x6f')]);}}return _0x5bd041[_0xfee7('0x7c')](_0x1cd96f);}})[_0xfee7('0x56')](handleError(_0x5bd041,null));};exports[_0xfee7('0x7d')]=function(_0x5a035e,_0x2c75c5,_0x2b0709){var _0x443051=path['join'](config[_0xfee7('0x77')],'server/files/images/avatars/default_avatar.png');var _0x401370={'where':{'id':_0x5a035e[_0xfee7('0x53')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xfee7('0x38')][_0xfee7('0x5d')](_0x401370)[_0xfee7('0x1f')](handleEntityNotFound(_0x2c75c5,null))['then'](function(_0x1cf4da){if(_0x1cf4da){if(!_['isNil'](_0x1cf4da[_0xfee7('0x7e')])){if(fs[_0xfee7('0x7a')](path['join'](config[_0xfee7('0x77')],_0xfee7('0x7f'),_0x1cf4da[_0xfee7('0x7e')]))){_0x443051=path['join'](config[_0xfee7('0x77')],_0xfee7('0x7f'),_0x1cf4da[_0xfee7('0x7e')]);}}return _0x2c75c5['download'](_0x443051);}})[_0xfee7('0x56')](handleError(_0x2c75c5,null));};exports[_0xfee7('0x80')]=function(_0x11ce13,_0x372aee,_0x208c96){var _0x347b5=path[_0xfee7('0x76')](config[_0xfee7('0x77')],_0xfee7('0x81'));var _0x48d701={'where':{'id':_0x11ce13['params']['id']},'attributes':['id',_0xfee7('0x82'),_0xfee7('0x83')],'raw':!![]};return db['ChatWebsite'][_0xfee7('0x5d')](_0x48d701)[_0xfee7('0x1f')](handleEntityNotFound(_0x372aee,null))[_0xfee7('0x1f')](function(_0x5395cc){if(_0x5395cc){if(!_[_0xfee7('0x79')](_0x5395cc['customerAvatar'])){if(fs[_0xfee7('0x7a')](path[_0xfee7('0x76')](config[_0xfee7('0x77')],_0xfee7('0x7f'),_0x5395cc[_0xfee7('0x82')]))&&_0x5395cc[_0xfee7('0x83')]){_0x347b5=path[_0xfee7('0x76')](config[_0xfee7('0x77')],'server/files/images/avatars/',_0x5395cc[_0xfee7('0x82')]);}}return _0x372aee['download'](_0x347b5);}})[_0xfee7('0x56')](handleError(_0x372aee,null));};exports[_0xfee7('0x84')]=function(_0xb838f5,_0x4fee44,_0x2a6233){var _0x55a833=path[_0xfee7('0x76')](config[_0xfee7('0x77')],_0xfee7('0x85'));var _0x404894={'where':{'id':_0xb838f5[_0xfee7('0x53')]['id']},'attributes':['id',_0xfee7('0x74')],'raw':!![]};return db['ChatWebsite']['find'](_0x404894)[_0xfee7('0x1f')](handleEntityNotFound(_0x4fee44,null))[_0xfee7('0x1f')](function(_0x3b5d66){if(_0x3b5d66){if(!_[_0xfee7('0x79')](_0x3b5d66[_0xfee7('0x74')])){if(fs[_0xfee7('0x7a')](path['join'](config[_0xfee7('0x77')],_0xfee7('0x7f'),_0x3b5d66[_0xfee7('0x74')]))){_0x55a833=path[_0xfee7('0x76')](config['root'],_0xfee7('0x7f'),_0x3b5d66[_0xfee7('0x74')]);}}return _0x4fee44['download'](_0x55a833);}})['catch'](handleError(_0x4fee44,null));};exports[_0xfee7('0x86')]=function(_0x58ef3e,_0x366bd0,_0x1df933){var _0x835cec=require(_0xfee7('0x87'));var _0x55ca97=new _0x835cec();var _0x37c60b=_0x55ca97[_0xfee7('0x88')](_0x58ef3e[_0xfee7('0x89')][_0xfee7('0x8a')])[_0xfee7('0x8b')]();var _0x204c63={'body':_0x58ef3e['body'],'channel':'chat'};var _0xcabd47=[];var _0x227d4d=[];var _0x5763e9={};var _0x5457fd=![];return db[_0xfee7('0x8c')][_0xfee7('0x60')]()['then'](function(_0x177d72){if(!_0x177d72){throw new db[(_0xfee7('0x8d'))][(_0xfee7('0x8e'))]('no\x20available\x20attributes');}_0xcabd47=_[_0xfee7('0x8f')](_['keys'](_0x177d72),[_0xfee7('0x90'),_0xfee7('0x91')]);_0x227d4d=_['difference'](_[_0xfee7('0x3a')](_0x177d72),[_0xfee7('0x90'),'updatedAt',_0xfee7('0x92'),_0xfee7('0x93')]);if(_0x58ef3e[_0xfee7('0x58')]['id']){delete _0x58ef3e[_0xfee7('0x58')]['id'];}if(_[_0xfee7('0x79')](_0x58ef3e[_0xfee7('0x58')]['from'])){throw new db[(_0xfee7('0x8d'))][(_0xfee7('0x8e'))]('from\x20is\x20mandatory');}if(_[_0xfee7('0x79')](_0x58ef3e[_0xfee7('0x58')][_0xfee7('0x58')])||_0x58ef3e[_0xfee7('0x58')]['body']===''){throw new db[(_0xfee7('0x8d'))][(_0xfee7('0x8e'))](_0xfee7('0x94'));}if(_[_0xfee7('0x79')](_0x58ef3e['body'][_0xfee7('0x95')])){throw new db[(_0xfee7('0x8d'))][(_0xfee7('0x8e'))](_0xfee7('0x96')+_0x227d4d);}if(!_['includes'](_0x227d4d,_0x58ef3e['body'][_0xfee7('0x95')])){throw new db[(_0xfee7('0x8d'))][(_0xfee7('0x8e'))](_0xfee7('0x97')+_0x227d4d);}_0x5763e9[_0x58ef3e[_0xfee7('0x58')][_0xfee7('0x95')]]=_0x58ef3e[_0xfee7('0x58')]['from'];})[_0xfee7('0x1f')](function(){return db[_0xfee7('0x38')][_0xfee7('0x5d')]({'where':{'id':_0x58ef3e[_0xfee7('0x53')]['id']},'include':[{'model':db[_0xfee7('0x98')],'as':_0xfee7('0x99'),'include':[{'model':db[_0xfee7('0x8c')],'as':_0xfee7('0x9a'),'where':_0x5763e9,'limit':0x1,'order':[[_0xfee7('0x91'),_0xfee7('0x9b')]]}]},{'model':db[_0xfee7('0x9c')],'as':_0xfee7('0x9d')}]});})[_0xfee7('0x1f')](handleEntityNotFound(_0x366bd0,null))[_0xfee7('0x1f')](function(_0x344639){if(_0x344639&&_0x344639[_0xfee7('0x99')]){_0x204c63[_0xfee7('0x9e')]=_0x344639;_0x204c63['applications']=_0x344639[_0xfee7('0x9d')];_0x204c63[_0xfee7('0x9f')]=_0x344639['List'];_0x204c63[_0xfee7('0xa0')]=_[_0xfee7('0xa1')](_0x204c63['applications'],[_0xfee7('0xa2')],[_0xfee7('0xa3')]);if(_0x204c63[_0xfee7('0x9e')][_0xfee7('0x9d')]){delete _0x204c63[_0xfee7('0x9e')][_0xfee7('0x9d')];}if(_0x204c63['account'][_0xfee7('0x99')]&&_0x204c63[_0xfee7('0x9e')][_0xfee7('0x99')][_0xfee7('0x9a')][_0xfee7('0x40')]){return _0x204c63['account'][_0xfee7('0x99')][_0xfee7('0x9a')][0x0];}var _0x112af5=_[_0xfee7('0xa4')](_0x58ef3e['body'],{'firstName':_0x58ef3e[_0xfee7('0x58')][_0xfee7('0xa5')],'ListId':_0x344639[_0xfee7('0x93')]});_0x112af5[_0x58ef3e[_0xfee7('0x58')]['mapKey']]=_0x58ef3e[_0xfee7('0x58')][_0xfee7('0xa5')];return db[_0xfee7('0x8c')][_0xfee7('0x57')](_0x112af5,{'fields':_0xcabd47,'raw':!![]});}})[_0xfee7('0x1f')](handleEntityNotFound(_0x366bd0,null))['then'](function(_0xea2011){_0x204c63[_0xfee7('0xa6')]=_0xea2011;var _0x405821=_0x58ef3e[_0xfee7('0x58')][_0xfee7('0xa7')];if(_0x58ef3e[_0xfee7('0x89')][_0xfee7('0xa8')]){_0x405821=_0x58ef3e[_0xfee7('0x89')][_0xfee7('0xa8')];}else if(_0x58ef3e[_0xfee7('0x89')][_0xfee7('0xa9')]){_0x405821=_[_0xfee7('0xaa')](_0x58ef3e[_0xfee7('0x89')]['x-forwarded-for'][_0xfee7('0xab')](','));}if(_0xea2011){var _0x29dfc2={'ContactId':_0xea2011['id'],'ChatWebsiteId':_0x58ef3e[_0xfee7('0x53')]['id'],'from':(_0xea2011[_0xfee7('0xac')]||'')+'\x20'+(_0xea2011[_0xfee7('0xad')]||''),'customerIp':_0x405821,'customerPort':_0x58ef3e[_0xfee7('0x89')][_0xfee7('0xae')]?_0x58ef3e[_0xfee7('0x89')][_0xfee7('0xae')]:null,'referer':_0x58ef3e[_0xfee7('0x58')][_0xfee7('0xaf')],'browserName':_0x37c60b['browser'][_0xfee7('0x35')]&&_0x37c60b['browser'][_0xfee7('0xb0')]?util['format'](_0xfee7('0xb1'),_0x37c60b[_0xfee7('0xb2')]['name'],_0x37c60b[_0xfee7('0xb2')][_0xfee7('0xb0')]):_0xfee7('0xb3'),'browserVersion':_0x37c60b['browser'][_0xfee7('0xb0')]||_0xfee7('0xb3'),'osName':util[_0xfee7('0xb4')]('%s\x20%s',_0x37c60b['os'][_0xfee7('0x35')],_0x37c60b['os']['version']),'osVersion':_0x37c60b['os'][_0xfee7('0xb0')],'deviceModel':_0x37c60b[_0xfee7('0xb5')]['model']&&_0x37c60b[_0xfee7('0xb5')][_0xfee7('0xb6')]?util[_0xfee7('0xb4')](_0xfee7('0xb7'),_0x37c60b['device'][_0xfee7('0x39')],_0x37c60b[_0xfee7('0xb5')][_0xfee7('0xb6')],_0x37c60b[_0xfee7('0xb5')][_0xfee7('0x4b')]):null,'deviceVendor':_0x37c60b['device']['vendor'],'deviceType':_0x37c60b['device'][_0xfee7('0x4b')],'formData':JSON['stringify'](_0x58ef3e['body'])};var _0x4ad7a4={'ChatWebsiteId':_0x58ef3e[_0xfee7('0x53')]['id'],'closed':![]};if(_0x58ef3e[_0xfee7('0x58')]['threadId']){_0x4ad7a4[_0xfee7('0xb8')]=_0x58ef3e['body'][_0xfee7('0xb8')];return db[_0xfee7('0xb9')]['find']({'where':_0x4ad7a4})[_0xfee7('0x1f')](function(_0x1c536d){if(_0x1c536d){return[_0x1c536d,![]];}_0x29dfc2[_0xfee7('0xb8')]=_0x58ef3e[_0xfee7('0x58')][_0xfee7('0xb8')];_0x29dfc2[_0xfee7('0xba')]=_0x58ef3e[_0xfee7('0x58')]['externalUrl'];return db['ChatInteraction'][_0xfee7('0x57')](_0x29dfc2)[_0xfee7('0x1f')](function(_0x2b3b8e){return[_0x2b3b8e,!![]];});});}_0x4ad7a4['ContactId']=_0xea2011['id'];if(_0x58ef3e[_0xfee7('0x58')][_0xfee7('0xbb')]&&_0x58ef3e['body'][_0xfee7('0xbb')]['id']){_0x4ad7a4['id']=_0x58ef3e[_0xfee7('0x58')][_0xfee7('0xbb')]['id'];return db[_0xfee7('0xb9')]['find']({'where':_0x4ad7a4})[_0xfee7('0x1f')](function(_0x12861f){if(_0x12861f){return[_0x12861f,![]];}return db[_0xfee7('0xb9')]['create'](_0x29dfc2)[_0xfee7('0x1f')](function(_0x2628cd){return[_0x2628cd,!![]];});});}return db[_0xfee7('0xb9')][_0xfee7('0x57')](_0x29dfc2)[_0xfee7('0x1f')](function(_0x2603cf){return[_0x2603cf,!![]];});}})['spread'](function(_0x4f32ac,_0x4d1fba){if(_0x4f32ac){_0x5457fd=_0x4d1fba;if(!_0x4d1fba){var _0x43b690={'from':(_0x204c63[_0xfee7('0xa6')][_0xfee7('0xac')]||'')+'\x20'+(_0x204c63[_0xfee7('0xa6')][_0xfee7('0xad')]||'')};if(_0x58ef3e[_0xfee7('0x58')][_0xfee7('0xb8')]&&_0x58ef3e['body'][_0xfee7('0xbc')]&&_0x58ef3e[_0xfee7('0x58')]['threadId']!=_0x58ef3e[_0xfee7('0x58')][_0xfee7('0xbc')]){_0x43b690[_0xfee7('0xb8')]=_0x58ef3e[_0xfee7('0x58')]['messageId'];}return _0x4f32ac['update'](_0x43b690);}else{return _0x4f32ac;}}})[_0xfee7('0x1f')](function(_0x4426d3){_0x204c63['interaction']=_0x4426d3[_0xfee7('0x31')]({'plain':!![]});_0x204c63[_0xfee7('0xbb')]['created']=_0x5457fd;if(_0x204c63[_0xfee7('0xbb')][_0xfee7('0xbd')]){if(_0x204c63[_0xfee7('0x9e')][_0xfee7('0xbe')]){_0x204c63[_0xfee7('0xa0')][_0xfee7('0xbf')]({'id':0x0,'priority':_0x204c63['applications']['length']+0x1,'app':'close','appdata':_0xfee7('0xc0'),'interval':'*,*,*,*'});}}return db[_0xfee7('0xc1')]['create']({'body':_0x58ef3e[_0xfee7('0x58')][_0xfee7('0x58')],'ChatWebsiteId':_0x58ef3e[_0xfee7('0x53')]['id'],'ChatInteractionId':_0x4426d3['id'],'direction':'in','ContactId':_0x204c63[_0xfee7('0xa6')]['id'],'AttachmentId':_0x58ef3e['body']['AttachmentId']});})[_0xfee7('0x1f')](function(_0x1d14c1){_0x204c63['message']=_0x1d14c1;if(_0x204c63[_0xfee7('0xbb')][_0xfee7('0xc2')]){return db[_0xfee7('0xc3')][_0xfee7('0x5d')]({'attributes':['id',_0xfee7('0x35')],'where':{'id':_0x204c63['interaction']['UserId']}})[_0xfee7('0x1f')](function(_0xbb48d9){if(_0xbb48d9){_0x204c63[_0xfee7('0xa0')][_0xfee7('0xc4')]({'id':0x0,'priority':0x0,'app':_0xfee7('0xc5'),'appdata':_0xbb48d9['name']+','+(_0x204c63[_0xfee7('0x9e')][_0xfee7('0xc6')]||0xa),'interval':_0xfee7('0xc7')});_0x204c63[_0xfee7('0xc8')]=!![];}return respondWithRpcPromise(_0xfee7('0xc9'),_0xfee7('0xca'),_0x204c63);});}return respondWithRpcPromise('Start',_0xfee7('0xca'),_0x204c63);})[_0xfee7('0x1f')](function(_0x3a3a69){respondWithRpcPromise(_0xfee7('0xcb'),_0xfee7('0xcb'),{'event':'notify','message':_0x3a3a69},client9002);return _0x3a3a69;})[_0xfee7('0x1f')](respondWithResult(_0x366bd0,null))[_0xfee7('0x56')](handleError(_0x366bd0,null));};exports['offline']=function(_0x3f3538,_0x39b8fc,_0x544085){var _0x57d8f0,_0x78d359,_0x1040b7;var _0x1bd95a=[];var _0x3b2153=[];var _0x461735={};return db[_0xfee7('0x8c')][_0xfee7('0x60')]()['then'](function(_0x4f5a5e){if(!_0x4f5a5e){throw new db[(_0xfee7('0x8d'))][(_0xfee7('0x8e'))](_0xfee7('0xcc'));}_0x3b2153=_[_0xfee7('0x8f')](_[_0xfee7('0x3a')](_0x4f5a5e),[_0xfee7('0x90'),_0xfee7('0x91')]);_0x1bd95a=_[_0xfee7('0x8f')](_['keys'](_0x4f5a5e),[_0xfee7('0x90'),'updatedAt',_0xfee7('0x92'),_0xfee7('0x93')]);if(_0x3f3538[_0xfee7('0x58')]['id']){delete _0x3f3538[_0xfee7('0x58')]['id'];}if(_[_0xfee7('0x79')](_0x3f3538['body'][_0xfee7('0xa5')])){throw _0x39b8fc['status'](0x1f4)[_0xfee7('0xcd')](new db['Sequelize'][(_0xfee7('0x8e'))](_0xfee7('0xce')));}if(_[_0xfee7('0x79')](_0x3f3538[_0xfee7('0x58')][_0xfee7('0x58')])||_0x3f3538[_0xfee7('0x58')][_0xfee7('0x58')]===''){throw _0x39b8fc['status'](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0xfee7('0x94')));}if(_['isNil'](_0x3f3538[_0xfee7('0x58')][_0xfee7('0xcf')])){throw _0x39b8fc[_0xfee7('0x28')](0x1f4)[_0xfee7('0xcd')](new db[(_0xfee7('0x8d'))][(_0xfee7('0x8e'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1bd95a));}if(!_[_0xfee7('0xd0')](_0x1bd95a,_0x3f3538[_0xfee7('0x58')]['mapKeyOffline'])){throw _0x39b8fc[_0xfee7('0x28')](0x1f4)[_0xfee7('0xcd')](new db[(_0xfee7('0x8d'))][(_0xfee7('0x8e'))](_0xfee7('0xd1')+_0x1bd95a));}_0x461735[_0x3f3538[_0xfee7('0x58')][_0xfee7('0xcf')]]=_0x3f3538[_0xfee7('0x58')]['from'];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x3f3538[_0xfee7('0x53')]['id']},'include':[{'model':db['CmList'],'as':_0xfee7('0x99')}]});})[_0xfee7('0x1f')](handleEntityNotFound(_0x39b8fc,null))[_0xfee7('0x1f')](function(_0x5102a3){if(_0x5102a3&&_0x5102a3[_0xfee7('0x99')]){_0x78d359=_0x5102a3;var _0x3b3b4e=_[_0xfee7('0xa4')](_0x3f3538[_0xfee7('0x58')],{'firstName':_0x3f3538[_0xfee7('0x58')][_0xfee7('0xa5')],'phone':_0x3f3538[_0xfee7('0x58')]['from'],'ListId':_0x5102a3[_0xfee7('0x93')]});_0x3b3b4e[_0x3f3538[_0xfee7('0x58')][_0xfee7('0xcf')]]=_0x3f3538[_0xfee7('0x58')][_0xfee7('0xa5')];return db[_0xfee7('0x8c')]['findOrCreate']({'where':_0x461735,'defaults':_0x3b3b4e});}})[_0xfee7('0xd2')](function(_0x44ef4c){if(_0x44ef4c){_0x1040b7=_0x44ef4c;var _0x227f5d=fs[_0xfee7('0xd3')](path['join'](config[_0xfee7('0x77')],_0xfee7('0xd4')),_0xfee7('0xd5'));var _0x4a8821=ejs[_0xfee7('0xd6')](_0x227f5d,{'body':_[_0xfee7('0xd7')](_0x3f3538['body'][_0xfee7('0x58')]),'bodyTitle':_0x78d359['offlineMessageBody']});return db['ChatOfflineMessage']['create']({'body':_0x4a8821,'ContactId':_0x44ef4c['id'],'ChatWebsiteId':_0x78d359['id']});}})['then'](function(_0x317fa5){if(_0x317fa5){_0x57d8f0=_0x317fa5;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xfee7('0xd8'),'raw':!![]}]});}})[_0xfee7('0x1f')](function(_0x202c31){if(_0x202c31&&_0x202c31[_0xfee7('0xd8')]&&_0x78d359['forwardOfflineAddress']){var _0x132237={'tls':{'rejectUnauthorized':![]}};if(_0x202c31['Smtp'][_0xfee7('0xd9')]){_0x132237[_0xfee7('0xd9')]=_0x202c31[_0xfee7('0xd8')][_0xfee7('0xd9')];}else{_0x132237['host']=_0x202c31[_0xfee7('0xd8')][_0xfee7('0xda')];_0x132237[_0xfee7('0xdb')]=_0x202c31['Smtp']['port'];_0x132237[_0xfee7('0xdc')]=_0x202c31[_0xfee7('0xd8')][_0xfee7('0xdc')];}if(_0x202c31['Smtp']['authentication']){_0x132237[_0xfee7('0xdd')]={'user':_0x202c31['Smtp'][_0xfee7('0x59')],'pass':_0x202c31[_0xfee7('0xd8')][_0xfee7('0xde')]};}return respondWithRpcPromise(_0xfee7('0xdf'),_0xfee7('0xe0'),{'account':_0x132237,'message':{'from':util[_0xfee7('0xb4')](_0xfee7('0xe1'),_0x202c31[_0xfee7('0x35')],_0x202c31[_0xfee7('0xe2')]||_0x202c31['Smtp'][_0xfee7('0x59')]),'to':_0x78d359[_0xfee7('0xe3')],'subject':_0x78d359[_0xfee7('0xe4')],'text':_0x57d8f0[_0xfee7('0x58')]}},client9003)[_0xfee7('0x1f')](function(){return _0x57d8f0;})[_0xfee7('0x56')](function(_0x127d81){console[_0xfee7('0x24')](_0x127d81);});}})[_0xfee7('0x1f')](function(){if(_0x57d8f0){return _0x57d8f0;}})[_0xfee7('0x1f')](respondWithResult(_0x39b8fc,null))[_0xfee7('0x56')](handleError(_0x39b8fc,null));};exports[_0xfee7('0xe5')]=function(_0x35ff3a,_0x5be4ab,_0x12adbb){return db[_0xfee7('0xb9')]['find']({'where':{'id':_0x35ff3a[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x5be4ab,null))['then'](function(_0xd5fdbd){if(_0xd5fdbd){return _0xd5fdbd[_0xfee7('0xe5')](_0x35ff3a['body'][_0xfee7('0xe6')],_['omit'](_0x35ff3a[_0xfee7('0x58')],[_0xfee7('0xe6'),'id'])||{});}})[_0xfee7('0x1f')](respondWithResult(_0x5be4ab,null))['catch'](handleError(_0x5be4ab,null));};exports[_0xfee7('0xe7')]=function(_0x37b60b,_0x1215c4,_0x2b0425){var _0x57149b={'raw':![],'where':{}};var _0x53f0fe={};var _0x198e3b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfee7('0x6b')]({'where':{'id':_0x37b60b[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x1215c4,null))[_0xfee7('0x1f')](function(_0x1f8547){if(_0x1f8547){_0x53f0fe[_0xfee7('0x39')]=_[_0xfee7('0x3a')](db['ChatInteraction'][_0xfee7('0x64')]);_0x53f0fe[_0xfee7('0x3b')]=_[_0xfee7('0x3a')](_0x37b60b[_0xfee7('0x3b')]);_0x53f0fe[_0xfee7('0x3c')]=_[_0xfee7('0x3d')](_0x53f0fe[_0xfee7('0x39')],_0x53f0fe[_0xfee7('0x3b')]);_0x57149b[_0xfee7('0x3f')]=_[_0xfee7('0x3d')](_0x53f0fe['model'],qs[_0xfee7('0x3e')](_0x37b60b['query'][_0xfee7('0x3e')]));_0x57149b[_0xfee7('0x3f')]=_0x57149b[_0xfee7('0x3f')][_0xfee7('0x40')]?_0x57149b['attributes']:_0x53f0fe[_0xfee7('0x39')];if(!_0x37b60b[_0xfee7('0x3b')][_0xfee7('0x65')]('nolimit')){_0x57149b[_0xfee7('0x42')]=qs[_0xfee7('0x42')](_0x37b60b[_0xfee7('0x3b')][_0xfee7('0x42')]);_0x57149b[_0xfee7('0x43')]=qs[_0xfee7('0x43')](_0x37b60b[_0xfee7('0x3b')][_0xfee7('0x43')]);}_0x57149b[_0xfee7('0x44')]=qs[_0xfee7('0x45')](_0x37b60b[_0xfee7('0x3b')]['sort']);_0x57149b[_0xfee7('0x46')]=qs[_0xfee7('0x3c')](_['pick'](_0x37b60b['query'],_0x53f0fe[_0xfee7('0x3c')]));_0x57149b[_0xfee7('0x46')][_0xfee7('0x66')]=_0x1f8547['id'];if(_0x37b60b[_0xfee7('0x3b')][_0xfee7('0x48')]){_0x57149b[_0xfee7('0x46')]=_[_0xfee7('0x49')](_0x57149b['where'],{'$or':_['map'](_0x57149b[_0xfee7('0x3f')],function(_0x4040c3){var _0x787482={};_0x787482[_0x4040c3]={'$like':'%'+_0x37b60b[_0xfee7('0x3b')][_0xfee7('0x48')]+'%'};return _0x787482;})});}_0x57149b=_[_0xfee7('0x49')]({},_0x57149b,_0x37b60b[_0xfee7('0x4f')]);return db[_0xfee7('0xb9')]['count']({'where':_0x57149b[_0xfee7('0x46')]})['then'](function(_0xf3b9aa){_0x198e3b[_0xfee7('0x50')]=_0xf3b9aa;if(_0x37b60b[_0xfee7('0x3b')]['includeAll']){_0x57149b['include']=[{'model':db[_0xfee7('0x8c')],'as':'Contact','required':![]},{'model':db[_0xfee7('0xc3')],'as':_0xfee7('0xe8'),'attributes':[_0xfee7('0x35'),'fullname',_0xfee7('0xe9')],'required':![]},{'model':db[_0xfee7('0xea')],'as':_0xfee7('0xeb'),'attributes':['id','name',_0xfee7('0xec')],'where':_0x37b60b[_0xfee7('0x3b')][_0xfee7('0xed')]?{'id':_0x37b60b[_0xfee7('0x3b')]['tag']}:undefined,'required':_0x37b60b[_0xfee7('0x3b')][_0xfee7('0xed')]?!![]:![]}];}return db[_0xfee7('0xb9')][_0xfee7('0x67')](_0x57149b);})['then'](function(_0x2000f9){_0x198e3b[_0xfee7('0x51')]=_0x2000f9;return _0x198e3b;});}})['then'](respondWithFilteredResult(_0x1215c4,_0x57149b))[_0xfee7('0x56')](handleError(_0x1215c4,null));};function iftimePromise(_0x2f204c,_0x1ac396){return respondWithRpcPromise('Command','getSnippet',{'command':_0x1ac396['timezone']?util[_0xfee7('0xb4')](_0xfee7('0xee'),_0x2f204c['interval'],_0x1ac396[_0xfee7('0xef')]):util['format'](_0xfee7('0xf0'),_0x2f204c[_0xfee7('0xf1')])},client9002)[_0xfee7('0x1f')](function(_0x3a2fd3){var _0x45b1bd=_0x3a2fd3&&_0x3a2fd3[_0xfee7('0xf2')]('true')>=0x0?!![]:![];logger['info'](_0xfee7('0xf3'),_0x1ac396['id'],_0x2f204c['id'],_0x2f204c['interval'],_0x45b1bd?_0xfee7('0xf4'):_0xfee7('0xf5'),_0x1ac396[_0xfee7('0xef')]?_0x1ac396['timezone']:'No\x20timezone');return _0x45b1bd;})[_0xfee7('0x56')](function(_0x38b76c){logger['error'](_0xfee7('0xf3'),_0x1ac396['id'],_0x2f204c['id'],_0x2f204c['interval'],util['inspect'](_0x38b76c,{'showHidden':![],'depth':null}),_0x1ac396[_0xfee7('0xef')]?_0x1ac396[_0xfee7('0xef')]:'No\x20timezone');return![];});}exports[_0xfee7('0xf6')]=function(_0x4967b5,_0xc19122,_0xdb6b8b){var _0x4a6c0d=0x0;var _0x5e2496=0x0;var _0x2ef5bf=![];var _0x58da3c;var _0x175118;return db['ChatWebsite'][_0xfee7('0x5d')]({'where':{'id':_0x4967b5[_0xfee7('0x53')]['id']},'include':[{'model':db[_0xfee7('0xf7')],'as':_0xfee7('0xf7'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xfee7('0xf1')],'raw':!![]}]}]})[_0xfee7('0x1f')](handleEntityNotFound(_0xc19122,null))[_0xfee7('0x1f')](function(_0x1a9002){if(_0x1a9002){_0x58da3c=_0x1a9002;return _0x1a9002['getProactiveActions']({'raw':!![]});}})[_0xfee7('0x1f')](function(_0x12f2d0){if(_0x58da3c){if(_0x12f2d0){_0x175118=_0x12f2d0;}}return require(_0xfee7('0xf8'))[_0xfee7('0xf9')]();})[_0xfee7('0x1f')](function(_0x49d412){if(_0x49d412){_0x5e2496=_0x49d412[_0xfee7('0xfa')];_0x2ef5bf=_0x49d412[_0xfee7('0xfb')];}})[_0xfee7('0x1f')](function(){return db[_0xfee7('0xb9')][_0xfee7('0x50')]({'where':{'closed':![]}});})['then'](function(_0x36bcf3){_0x4a6c0d=_0x36bcf3;if(_0x5e2496&&_0x36bcf3>_0x5e2496){return db[_0xfee7('0xfc')][_0xfee7('0x6b')]({'where':{'id':0x1}})[_0xfee7('0x1f')](function(_0x1286bc){if(_0x1286bc){_0x1286bc['increment'](_0xfee7('0xfd'));}});}})[_0xfee7('0x1f')](function(){if(_0x58da3c['Interval']&&_0x58da3c['Interval'][_0xfee7('0xfe')]){var _0x1882ba=[];for(var _0x1060c5=0x0;_0x1060c5<_0x58da3c[_0xfee7('0xf7')][_0xfee7('0xfe')][_0xfee7('0x40')];_0x1060c5++){var _0x2c6f41=_0x58da3c[_0xfee7('0xf7')][_0xfee7('0xfe')][_0x1060c5][_0xfee7('0x31')]({'plain':!![]});_0x1882ba[_0xfee7('0xbf')](iftimePromise(_0x2c6f41,_0x58da3c));}return BPromise[_0xfee7('0xff')](_0x1882ba)[_0xfee7('0x1f')](function(_0x525064){return _[_0xfee7('0x100')](_0x525064);});}else{return!![];}})['then'](function(_0x5ee04d){var _0x4e671f=fs['readFileSync'](path[_0xfee7('0x76')](config[_0xfee7('0x77')],'server/files/chat/iframe.js'),_0xfee7('0xd5'));var _0x65e175={'remote':_0x58da3c[_0xfee7('0x101')],'query':querystring[_0xfee7('0x23')](_['merge'](_0x58da3c[_0xfee7('0x31')]({'plain':!![]}),{'customerIp':_0x4967b5[_0xfee7('0x89')][_0xfee7('0xa9')]||_0x4967b5[_0xfee7('0x89')][_0xfee7('0x102')]||_0x4967b5['connection'][_0xfee7('0x103')]||_0x4967b5['ip'],'referer':_0x4967b5[_0xfee7('0x89')][_0xfee7('0xaf')],'openedInteractions':_0x4a6c0d,'maxInteractions':_0x5e2496,'virtual':_0x2ef5bf[_0xfee7('0xfa')],'online':_0x5ee04d,'custom':_0x2ef5bf}))['replace'](/'/g,'\x5c\x27')};_0xc19122['send'](ejs[_0xfee7('0xd6')](Mustache[_0xfee7('0xd6')](_0x4e671f,_0x65e175),{'proactiveActions':_0x175118,'alignment':_0x58da3c[_0xfee7('0x104')],'verticalAlignment':_0x58da3c[_0xfee7('0x105')]}));})['catch'](handleError(_0xc19122,null));};exports['addApplications']=function(_0x1950fc,_0x3253d2,_0x301328){return db['ChatWebsite'][_0xfee7('0x6b')]({'where':{'id':_0x1950fc['params']['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x3253d2,null))[_0xfee7('0x1f')](function(_0x1975ff){if(_0x1975ff){return db[_0xfee7('0x106')][_0xfee7('0x107')](function(_0x470073){return db[_0xfee7('0x9c')][_0xfee7('0x30')]({'where':{'ChatWebsiteId':_0x1950fc['params']['id']},'transaction':_0x470073})['then'](function(_0x35f6eb){var _0xd953e1=_[_0xfee7('0x4a')](_0x1950fc[_0xfee7('0x58')],function(_0x2ea2e3){_0x2ea2e3['ChatWebsiteId']=_0x1950fc['params']['id'];return _0x2ea2e3;});return db['ChatApplication'][_0xfee7('0x108')](_0xd953e1,{'transaction':_0x470073});});})[_0xfee7('0x1f')](function(){return db[_0xfee7('0x9c')][_0xfee7('0x109')]({'where':{'ChatWebsiteId':_0x1950fc[_0xfee7('0x53')]['id']},'order':'priority'});});}})[_0xfee7('0x1f')](respondWithResult(_0x3253d2,null))[_0xfee7('0x56')](handleError(_0x3253d2,null));};exports[_0xfee7('0x10a')]=function(_0x339374,_0x5c655b,_0x3ac6b4){var _0x18b3d1={};var _0xf526ae={};var _0x24b935;var _0x38363a;return db['ChatWebsite'][_0xfee7('0x6b')]({'where':{'id':_0x339374[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x5c655b,null))[_0xfee7('0x1f')](function(_0x30d82a){if(_0x30d82a){_0x24b935=_0x30d82a;_0xf526ae[_0xfee7('0x39')]=_['keys'](db[_0xfee7('0x9c')][_0xfee7('0x64')]);_0xf526ae[_0xfee7('0x3b')]=_[_0xfee7('0x3a')](_0x339374[_0xfee7('0x3b')]);_0xf526ae[_0xfee7('0x3c')]=_[_0xfee7('0x3d')](_0xf526ae[_0xfee7('0x39')],_0xf526ae[_0xfee7('0x3b')]);_0x18b3d1[_0xfee7('0x3f')]=_[_0xfee7('0x3d')](_0xf526ae[_0xfee7('0x39')],qs[_0xfee7('0x3e')](_0x339374[_0xfee7('0x3b')][_0xfee7('0x3e')]));_0x18b3d1['attributes']=_0x18b3d1['attributes'][_0xfee7('0x40')]?_0x18b3d1[_0xfee7('0x3f')]:_0xf526ae[_0xfee7('0x39')];_0x18b3d1[_0xfee7('0x44')]=qs[_0xfee7('0x45')](_0x339374[_0xfee7('0x3b')][_0xfee7('0x45')]);_0x18b3d1[_0xfee7('0x46')]=qs['filters'](_[_0xfee7('0x47')](_0x339374[_0xfee7('0x3b')],_0xf526ae[_0xfee7('0x3c')]));if(_0x339374['query']['filter']){_0x18b3d1['where']=_[_0xfee7('0x49')](_0x18b3d1[_0xfee7('0x46')],{'$or':_[_0xfee7('0x4a')](_0x18b3d1[_0xfee7('0x3f')],function(_0x45b683){var _0x15aaef={};_0x15aaef[_0x45b683]={'$like':'%'+_0x339374['query'][_0xfee7('0x48')]+'%'};return _0x15aaef;})});}_0x18b3d1=_[_0xfee7('0x49')]({},_0x18b3d1,_0x339374['options']);return _0x24b935[_0xfee7('0x10a')](_0x18b3d1);}})[_0xfee7('0x1f')](function(_0x349652){if(_0x349652){_0x38363a=_0x349652[_0xfee7('0x40')];if(!_0x339374['query'][_0xfee7('0x65')]('nolimit')){_0x18b3d1[_0xfee7('0x42')]=qs[_0xfee7('0x42')](_0x339374[_0xfee7('0x3b')]['limit']);_0x18b3d1[_0xfee7('0x43')]=qs[_0xfee7('0x43')](_0x339374[_0xfee7('0x3b')][_0xfee7('0x43')]);}return _0x24b935[_0xfee7('0x10a')](_0x18b3d1);}})[_0xfee7('0x1f')](function(_0x16ff9b){if(_0x16ff9b){return _0x16ff9b?{'count':_0x38363a,'rows':_0x16ff9b}:null;}})[_0xfee7('0x1f')](respondWithResult(_0x5c655b,null))[_0xfee7('0x56')](handleError(_0x5c655b,null));};exports[_0xfee7('0x10b')]=function(_0xf3c5df,_0x264966,_0x339e47){return db[_0xfee7('0x10c')]['find']({'where':{'id':_0xf3c5df['params']['id']}})['then'](handleEntityNotFound(_0x264966,null))['then'](function(_0x1bd537){if(_0x1bd537){return _0x1bd537[_0xfee7('0x10b')](_0xf3c5df['body'][_0xfee7('0xe6')],_[_0xfee7('0x10d')](_0xf3c5df[_0xfee7('0x58')],['ids','id'])||{});}})[_0xfee7('0x1f')](respondWithResult(_0x264966,null))[_0xfee7('0x56')](handleError(_0x264966,null));};exports['getProactiveActions']=function(_0x3fd8f2,_0xf07a09,_0x5e892a){var _0x37a8c4={};var _0x3622a5={};var _0x1d1624;var _0x28dcce;return db[_0xfee7('0x38')][_0xfee7('0x6b')]({'where':{'id':_0x3fd8f2[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0xf07a09,null))[_0xfee7('0x1f')](function(_0x27fc55){if(_0x27fc55){_0x1d1624=_0x27fc55;_0x3622a5[_0xfee7('0x39')]=_[_0xfee7('0x3a')](db['ChatProactiveAction']['rawAttributes']);_0x3622a5[_0xfee7('0x3b')]=_['keys'](_0x3fd8f2[_0xfee7('0x3b')]);_0x3622a5['filters']=_['intersection'](_0x3622a5['model'],_0x3622a5[_0xfee7('0x3b')]);_0x37a8c4[_0xfee7('0x3f')]=_['intersection'](_0x3622a5['model'],qs[_0xfee7('0x3e')](_0x3fd8f2['query'][_0xfee7('0x3e')]));_0x37a8c4[_0xfee7('0x3f')]=_0x37a8c4[_0xfee7('0x3f')][_0xfee7('0x40')]?_0x37a8c4[_0xfee7('0x3f')]:_0x3622a5['model'];_0x37a8c4[_0xfee7('0x44')]=qs[_0xfee7('0x45')](_0x3fd8f2[_0xfee7('0x3b')]['sort']);_0x37a8c4[_0xfee7('0x46')]=qs[_0xfee7('0x3c')](_[_0xfee7('0x47')](_0x3fd8f2[_0xfee7('0x3b')],_0x3622a5[_0xfee7('0x3c')]));if(_0x3fd8f2[_0xfee7('0x3b')][_0xfee7('0x48')]){_0x37a8c4[_0xfee7('0x46')]=_[_0xfee7('0x49')](_0x37a8c4['where'],{'$or':_['map'](_0x37a8c4['attributes'],function(_0x2210bc){var _0x559b30={};_0x559b30[_0x2210bc]={'$like':'%'+_0x3fd8f2['query'][_0xfee7('0x48')]+'%'};return _0x559b30;})});}_0x37a8c4=_[_0xfee7('0x49')]({},_0x37a8c4,_0x3fd8f2[_0xfee7('0x4f')]);return _0x1d1624[_0xfee7('0x10e')](_0x37a8c4);}})[_0xfee7('0x1f')](function(_0x5dc70e){if(_0x5dc70e){_0x28dcce=_0x5dc70e[_0xfee7('0x40')];if(!_0x3fd8f2[_0xfee7('0x3b')][_0xfee7('0x65')]('nolimit')){_0x37a8c4[_0xfee7('0x42')]=qs[_0xfee7('0x42')](_0x3fd8f2['query']['limit']);_0x37a8c4[_0xfee7('0x43')]=qs['offset'](_0x3fd8f2['query']['offset']);}return _0x1d1624[_0xfee7('0x10e')](_0x37a8c4);}})[_0xfee7('0x1f')](function(_0x13f433){if(_0x13f433){return _0x13f433?{'count':_0x28dcce,'rows':_0x13f433}:null;}})[_0xfee7('0x1f')](respondWithResult(_0xf07a09,null))[_0xfee7('0x56')](handleError(_0xf07a09,null));};exports[_0xfee7('0x10f')]=function(_0x3cec4c,_0xd554fc,_0x4574e7){var _0x304f24=_0x3cec4c[_0xfee7('0x3b')]['online']===_0xfee7('0x110')?_0xfee7('0x111'):'onlineForm';return db[_0xfee7('0x38')][_0xfee7('0x5d')]({'attributes':['id',_0x304f24],'where':{'id':_0x3cec4c[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0xd554fc,null))[_0xfee7('0x1f')](function(_0x147c77){if(_0x147c77){var _0x51b952=_0x147c77[_0x304f24];var _0x409924=_0x51b952&&_0x51b952[_0xfee7('0x112')]?_0x51b952['items']:[];_0xd554fc[_0xfee7('0xcd')]({'fromKey':_[_0xfee7('0x79')](_0x51b952[_0xfee7('0x113')])?undefined:_0x51b952['fromKey'],'count':_0x409924[_0xfee7('0x40')],'rows':_0x409924});}})['catch'](handleError(_0xd554fc,null));};exports['getOfflineMessages']=function(_0x685dfb,_0x5dae38,_0x122663){var _0x17a64b={'raw':!![],'where':{}};var _0x1e07a9={};var _0x510342={'count':0x0,'rows':[]};return db[_0xfee7('0x38')][_0xfee7('0x6b')]({'where':{'id':_0x685dfb[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x5dae38,null))[_0xfee7('0x1f')](function(_0x8b8ac2){if(_0x8b8ac2){_0x1e07a9[_0xfee7('0x39')]=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x1e07a9[_0xfee7('0x3b')]=_['keys'](_0x685dfb[_0xfee7('0x3b')]);_0x1e07a9['filters']=_[_0xfee7('0x3d')](_0x1e07a9[_0xfee7('0x39')],_0x1e07a9[_0xfee7('0x3b')]);_0x17a64b['attributes']=_[_0xfee7('0x3d')](_0x1e07a9[_0xfee7('0x39')],qs[_0xfee7('0x3e')](_0x685dfb[_0xfee7('0x3b')][_0xfee7('0x3e')]));_0x17a64b['attributes']=_0x17a64b[_0xfee7('0x3f')][_0xfee7('0x40')]?_0x17a64b[_0xfee7('0x3f')]:_0x1e07a9[_0xfee7('0x39')];if(!_0x685dfb[_0xfee7('0x3b')][_0xfee7('0x65')](_0xfee7('0x41'))){_0x17a64b['limit']=qs[_0xfee7('0x42')](_0x685dfb[_0xfee7('0x3b')][_0xfee7('0x42')]);_0x17a64b[_0xfee7('0x43')]=qs[_0xfee7('0x43')](_0x685dfb[_0xfee7('0x3b')][_0xfee7('0x43')]);}_0x17a64b['order']=qs[_0xfee7('0x45')](_0x685dfb[_0xfee7('0x3b')][_0xfee7('0x45')]);_0x17a64b[_0xfee7('0x46')]=qs[_0xfee7('0x3c')](_[_0xfee7('0x47')](_0x685dfb[_0xfee7('0x3b')],_0x1e07a9[_0xfee7('0x3c')]));_0x17a64b['where']['ChatWebsiteId']=_0x8b8ac2['id'];if(_0x685dfb[_0xfee7('0x3b')][_0xfee7('0x48')]){_0x17a64b['where']=_[_0xfee7('0x49')](_0x17a64b[_0xfee7('0x46')],{'$or':_[_0xfee7('0x4a')](_0x17a64b[_0xfee7('0x3f')],function(_0x4cb323){var _0x1780a1={};_0x1780a1[_0x4cb323]={'$like':'%'+_0x685dfb[_0xfee7('0x3b')][_0xfee7('0x48')]+'%'};return _0x1780a1;})});}_0x17a64b=_[_0xfee7('0x49')]({},_0x17a64b,_0x685dfb[_0xfee7('0x4f')]);return db[_0xfee7('0x114')][_0xfee7('0x50')]({'where':_0x17a64b[_0xfee7('0x46')]})[_0xfee7('0x1f')](function(_0x689cf8){_0x510342[_0xfee7('0x50')]=_0x689cf8;if(_0x685dfb[_0xfee7('0x3b')][_0xfee7('0x54')]){_0x17a64b[_0xfee7('0x55')]=[{'all':!![]}];}return db[_0xfee7('0x114')][_0xfee7('0x67')](_0x17a64b);})['then'](function(_0x46d6fa){_0x510342['rows']=_0x46d6fa;return _0x510342;});}})[_0xfee7('0x1f')](respondWithFilteredResult(_0x5dae38,_0x17a64b))[_0xfee7('0x56')](handleError(_0x5dae38,null));};exports[_0xfee7('0x115')]=function(_0x860226,_0x19733a,_0x28f2d6){return db[_0xfee7('0x38')]['find']({'where':{'id':_0x860226[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x19733a,null))['then'](function(_0x6eb6ac){if(_0x6eb6ac){return _0x6eb6ac[_0xfee7('0x115')](_0x860226[_0xfee7('0x58')]['ids'],_[_0xfee7('0x10d')](_0x860226[_0xfee7('0x58')],['ids','id'])||{})[_0xfee7('0xd2')](function(_0x202461){for(var _0x2ca7bf=0x0;_0x2ca7bf<_0x860226[_0xfee7('0x58')][_0xfee7('0xe6')]['length'];_0x2ca7bf+=0x1){socket[_0xfee7('0x116')](_0xfee7('0x117'),{'UserId':_0x860226[_0xfee7('0x58')][_0xfee7('0xe6')][_0x2ca7bf],'ChatWebsiteId':_0x860226[_0xfee7('0x53')]['id']});}return _0x202461;});}})[_0xfee7('0x1f')](respondWithResult(_0x19733a,null))[_0xfee7('0x56')](handleError(_0x19733a,null));};exports['removeAgents']=function(_0x871649,_0x59c1e1,_0x18e542){return db[_0xfee7('0x38')][_0xfee7('0x5d')]({'where':{'id':_0x871649[_0xfee7('0x53')]['id']}})['then'](handleEntityNotFound(_0x59c1e1,null))[_0xfee7('0x1f')](function(_0x53e3b6){if(_0x53e3b6){return _0x53e3b6[_0xfee7('0x118')](_0x871649[_0xfee7('0x3b')][_0xfee7('0xe6')])['then'](function(){if(_[_0xfee7('0x119')](_0x871649[_0xfee7('0x3b')][_0xfee7('0xe6')])){for(var _0x3882e7=0x0;_0x3882e7<_0x871649[_0xfee7('0x3b')][_0xfee7('0xe6')]['length'];_0x3882e7+=0x1){socket[_0xfee7('0x116')]('userChatWebsite:remove',{'UserId':Number(_0x871649[_0xfee7('0x3b')][_0xfee7('0xe6')][_0x3882e7]),'ChatWebsiteId':Number(_0x871649['params']['id'])});}}else{socket[_0xfee7('0x116')](_0xfee7('0x11a'),{'UserId':Number(_0x871649[_0xfee7('0x3b')][_0xfee7('0xe6')]),'ChatWebsiteId':Number(_0x871649[_0xfee7('0x53')]['id'])});}});}})[_0xfee7('0x1f')](respondWithStatusCode(_0x59c1e1,null))['catch'](handleError(_0x59c1e1,null));};exports[_0xfee7('0x11b')]=function(_0x4419d1,_0x582e9e,_0x3e62ef){var _0x2068a4={};var _0x140b9e={};var _0x3fe3d1;var _0x1216f4;return db[_0xfee7('0x38')]['findOne']({'where':{'id':_0x4419d1[_0xfee7('0x53')]['id']}})[_0xfee7('0x1f')](handleEntityNotFound(_0x582e9e,null))['then'](function(_0x1b7e42){if(_0x1b7e42){_0x3fe3d1=_0x1b7e42;_0x140b9e[_0xfee7('0x39')]=_[_0xfee7('0x3a')](db[_0xfee7('0xc3')]['rawAttributes']);_0x140b9e[_0xfee7('0x3b')]=_[_0xfee7('0x3a')](_0x4419d1[_0xfee7('0x3b')]);_0x140b9e[_0xfee7('0x3c')]=_['intersection'](_0x140b9e[_0xfee7('0x39')],_0x140b9e[_0xfee7('0x3b')]);_0x2068a4[_0xfee7('0x3f')]=_[_0xfee7('0x3d')](_0x140b9e['model'],qs[_0xfee7('0x3e')](_0x4419d1[_0xfee7('0x3b')][_0xfee7('0x3e')]));_0x2068a4[_0xfee7('0x3f')]=_0x2068a4[_0xfee7('0x3f')][_0xfee7('0x40')]?_0x2068a4[_0xfee7('0x3f')]:_0x140b9e[_0xfee7('0x39')];_0x2068a4[_0xfee7('0x44')]=qs[_0xfee7('0x45')](_0x4419d1['query'][_0xfee7('0x45')]);_0x2068a4['where']=qs[_0xfee7('0x3c')](_[_0xfee7('0x47')](_0x4419d1['query'],_0x140b9e[_0xfee7('0x3c')]));if(_0x4419d1[_0xfee7('0x3b')][_0xfee7('0x48')]){_0x2068a4[_0xfee7('0x46')]=_['merge'](_0x2068a4[_0xfee7('0x46')],{'$or':_[_0xfee7('0x4a')](_0x2068a4[_0xfee7('0x3f')],function(_0x1088ce){var _0x3b1461={};_0x3b1461[_0x1088ce]={'$like':'%'+_0x4419d1[_0xfee7('0x3b')][_0xfee7('0x48')]+'%'};return _0x3b1461;})});}_0x2068a4=_[_0xfee7('0x49')]({},_0x2068a4,_0x4419d1['options']);return _0x3fe3d1[_0xfee7('0x11b')](_0x2068a4);}})[_0xfee7('0x1f')](function(_0x561828){if(_0x561828){_0x1216f4=_0x561828['length'];if(!_0x4419d1[_0xfee7('0x3b')][_0xfee7('0x65')](_0xfee7('0x41'))){_0x2068a4[_0xfee7('0x42')]=qs[_0xfee7('0x42')](_0x4419d1[_0xfee7('0x3b')][_0xfee7('0x42')]);_0x2068a4[_0xfee7('0x43')]=qs[_0xfee7('0x43')](_0x4419d1[_0xfee7('0x3b')]['offset']);}return _0x3fe3d1[_0xfee7('0x11b')](_0x2068a4);}})[_0xfee7('0x1f')](function(_0x25e899){if(_0x25e899){return _0x25e899?{'count':_0x1216f4,'rows':_0x25e899}:null;}})[_0xfee7('0x1f')](respondWithResult(_0x582e9e,null))[_0xfee7('0x56')](handleError(_0x582e9e,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index e4dd9a7..4626a4a 100644 --- a/server/api/chatWebsite/chatWebsite.events.js +++ b/server/api/chatWebsite/chatWebsite.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2383=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0x2383,0xb2));var _0x3238=function(_0x3b216c,_0x435fea){_0x3b216c=_0x3b216c-0x0;var _0x18e258=_0x2383[_0x3b216c];return _0x18e258;};'use strict';var EventEmitter=require(_0x3238('0x0'));var ChatWebsite=require(_0x3238('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3238('0x2')](0x0);var events={'afterCreate':_0x3238('0x3'),'afterUpdate':_0x3238('0x4'),'afterDestroy':_0x3238('0x5')};function emitEvent(_0x3ea5b1){return function(_0x4bca38,_0x493657,_0x52ac30){ChatWebsiteEvents[_0x3238('0x6')](_0x3ea5b1+':'+_0x4bca38['id'],_0x4bca38);ChatWebsiteEvents[_0x3238('0x6')](_0x3ea5b1,_0x4bca38);_0x52ac30(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x3238('0x7')](e,emitEvent(event));}}module[_0x3238('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0xd1b3=['hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xd1b3,0xec));var _0x3d1b=function(_0x2e7685,_0x3bff10){_0x2e7685=_0x2e7685-0x0;var _0x90bc02=_0xd1b3[_0x2e7685];return _0x90bc02;};'use strict';var EventEmitter=require(_0x3d1b('0x0'));var ChatWebsite=require(_0x3d1b('0x1'))['db'][_0x3d1b('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3d1b('0x3')](0x0);var events={'afterCreate':_0x3d1b('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x47a42a){return function(_0x18480d,_0x26034b,_0x45bdac){ChatWebsiteEvents[_0x3d1b('0x5')](_0x47a42a+':'+_0x18480d['id'],_0x18480d);ChatWebsiteEvents[_0x3d1b('0x5')](_0x47a42a,_0x18480d);_0x45bdac(null);};}for(var e in events){if(events[_0x3d1b('0x6')](e)){var event=events[e];ChatWebsite[_0x3d1b('0x7')](e,emitEvent(event));}}module[_0x3d1b('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 855151a..a5ece70 100644 --- a/server/api/chatWebsite/chatWebsite.model.js +++ b/server/api/chatWebsite/chatWebsite.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b29=['lodash','../../config/logger','api','request-promise','path','../../config/environment','exports','define','ChatWebsite','chat_websites'];(function(_0x54933a,_0x2a4fa1){var _0x7525b7=function(_0x214dd7){while(--_0x214dd7){_0x54933a['push'](_0x54933a['shift']());}};_0x7525b7(++_0x2a4fa1);}(_0x8b29,0xbe));var _0x98b2=function(_0x540415,_0x44f377){_0x540415=_0x540415-0x0;var _0x348b9e=_0x8b29[_0x540415];return _0x348b9e;};'use strict';var _=require(_0x98b2('0x0'));var util=require('util');var logger=require(_0x98b2('0x1'))(_0x98b2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x98b2('0x3'));var fs=require('fs');var path=require(_0x98b2('0x4'));var rimraf=require('rimraf');var config=require(_0x98b2('0x5'));var attributes=require('./chatWebsite.attributes');module[_0x98b2('0x6')]=function(_0xa3c251,_0xb0082c){return _0xa3c251[_0x98b2('0x7')](_0x98b2('0x8'),attributes,{'tableName':_0x98b2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3eec=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','bluebird'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x47cc4a,_0x4b4c03){_0x47cc4a=_0x47cc4a-0x0;var _0xea989=_0x3eec[_0x47cc4a];return _0xea989;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var logger=require(_0xc3ee('0x2'))(_0xc3ee('0x3'));var moment=require('moment');var BPromise=require(_0xc3ee('0x4'));var rp=require(_0xc3ee('0x5'));var fs=require('fs');var path=require(_0xc3ee('0x6'));var rimraf=require(_0xc3ee('0x7'));var config=require(_0xc3ee('0x8'));var attributes=require(_0xc3ee('0x9'));module['exports']=function(_0x471de7,_0xbd5b6){return _0x471de7[_0xc3ee('0xa')](_0xc3ee('0xb'),attributes,{'tableName':_0xc3ee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 19a982a..32144b5 100644 --- a/server/api/chatWebsite/chatWebsite.rpc.js +++ b/server/api/chatWebsite/chatWebsite.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x524e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment'];(function(_0x40f4cc,_0x432f55){var _0x458315=function(_0xcfda5e){while(--_0xcfda5e){_0x40f4cc['push'](_0x40f4cc['shift']());}};_0x458315(++_0x432f55);}(_0x524e,0x15e));var _0xe524=function(_0x21f22e,_0x351ac2){_0x21f22e=_0x21f22e-0x0;var _0x26e2a4=_0x524e[_0x21f22e];return _0x26e2a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});config[_0xe524('0xb')]=_[_0xe524('0xc')](config['redis'],{'host':_0xe524('0xd'),'port':0x18eb});var socket=require(_0xe524('0xe'))(new Redis(config[_0xe524('0xb')]));require(_0xe524('0xf'))[_0xe524('0x10')](socket);function respondWithRpcPromise(_0x4082b1,_0x1a08e2,_0xb3eb9f){return new BPromise(function(_0x1b75bd,_0x1641ec){return client[_0xe524('0x11')](_0x4082b1,_0xb3eb9f)[_0xe524('0x12')](function(_0x1184df){logger[_0xe524('0x13')](_0xe524('0x14'),_0x1a08e2,_0xe524('0x15'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1a08e2,_0xe524('0x15'),JSON[_0xe524('0x16')](_0x1184df));if(_0x1184df[_0xe524('0x17')]){if(_0x1184df[_0xe524('0x17')][_0xe524('0x18')]===0x1f4){logger['error'](_0xe524('0x14'),_0x1a08e2,_0x1184df['error'][_0xe524('0x19')]);return _0x1641ec(_0x1184df[_0xe524('0x17')]['message']);}logger[_0xe524('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1a08e2,_0x1184df[_0xe524('0x17')]['message']);return _0x1b75bd(_0x1184df[_0xe524('0x17')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1a08e2,_0xe524('0x15'));_0x1b75bd(_0x1184df['result'][_0xe524('0x19')]);}})[_0xe524('0x1a')](function(_0x278de9){logger[_0xe524('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1a08e2,_0x278de9);_0x1641ec(_0x278de9);});});} \ No newline at end of file +var _0x2542=['register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket'];(function(_0x4bae5c,_0x13fc6a){var _0x16e3b6=function(_0x549f77){while(--_0x549f77){_0x4bae5c['push'](_0x4bae5c['shift']());}};_0x16e3b6(++_0x13fc6a);}(_0x2542,0x169));var _0x2254=function(_0x4f7226,_0x41c052){_0x4f7226=_0x4f7226-0x0;var _0x50b42c=_0x2542[_0x4f7226];return _0x50b42c;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});config[_0x2254('0xb')]=_[_0x2254('0xc')](config[_0x2254('0xb')],{'host':_0x2254('0xd'),'port':0x18eb});var socket=require(_0x2254('0xe'))(new Redis(config[_0x2254('0xb')]));require(_0x2254('0xf'))[_0x2254('0x10')](socket);function respondWithRpcPromise(_0x1ae415,_0x38fb2b,_0x5b1ab9){return new BPromise(function(_0x336e14,_0x2655ea){return client[_0x2254('0x11')](_0x1ae415,_0x5b1ab9)[_0x2254('0x12')](function(_0x575d58){logger['info'](_0x2254('0x13'),_0x38fb2b,_0x2254('0x14'));logger[_0x2254('0x15')](_0x2254('0x16'),_0x38fb2b,_0x2254('0x14'),JSON[_0x2254('0x17')](_0x575d58));if(_0x575d58['error']){if(_0x575d58[_0x2254('0x18')][_0x2254('0x19')]===0x1f4){logger['error'](_0x2254('0x13'),_0x38fb2b,_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);return _0x2655ea(_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);}logger[_0x2254('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x38fb2b,_0x575d58[_0x2254('0x18')]['message']);return _0x336e14(_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);}else{logger[_0x2254('0x1b')](_0x2254('0x13'),_0x38fb2b,_0x2254('0x14'));_0x336e14(_0x575d58[_0x2254('0x1c')]['message']);}})['catch'](function(_0x5ec98d){logger[_0x2254('0x18')](_0x2254('0x13'),_0x38fb2b,_0x5ec98d);_0x2655ea(_0x5ec98d);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 40923e6..78622d1 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x31d707,_0x733c2b){var _0x3ff20d=function(_0x42de7a){while(--_0x42de7a){_0x31d707['push'](_0x31d707['shift']());}};_0x3ff20d(++_0x733c2b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x46a00e,_0x595365){_0x46a00e=_0x46a00e-0x0;var _0x1b3984=_0x5f2f[_0x46a00e];return _0x1b3984;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x335201,_0x314d57){var _0x39b053=function(_0x22d774){while(--_0x22d774){_0x335201['push'](_0x335201['shift']());}};_0x39b053(++_0x314d57);}(_0x5f2f,0x73));var _0xf5f2=function(_0x50e6ba,_0x4c816f){_0x50e6ba=_0x50e6ba-0x0;var _0x1ad4f7=_0x5f2f[_0x50e6ba];return _0x1ad4f7;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 6bf48d0..c0cd95d 100644 --- a/server/api/chatWebsite/index.js +++ b/server/api/chatWebsite/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d94=['addLogo','root','server/files/images/avatars/','single','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','express','../../components/auth/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','format','%s-%s','now','/:id/logo','file'];(function(_0x281e51,_0x182f0a){var _0x51091c=function(_0x37a202){while(--_0x37a202){_0x281e51['push'](_0x281e51['shift']());}};_0x51091c(++_0x182f0a);}(_0x0d94,0x11e));var _0x40d9=function(_0x51b764,_0x527497){_0x51b764=_0x51b764-0x0;var _0x1d9607=_0x0d94[_0x51b764];return _0x1d9607;};'use strict';var multer=require('multer');var util=require(_0x40d9('0x0'));var path=require(_0x40d9('0x1'));var timeout=require('connect-timeout');var express=require(_0x40d9('0x2'));var router=express['Router']();var auth=require(_0x40d9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x40d9('0x4'));var controller=require(_0x40d9('0x5'));router['get']('/',auth[_0x40d9('0x6')](),controller[_0x40d9('0x7')]);router[_0x40d9('0x8')](_0x40d9('0x9'),auth['isAuthenticated'](),controller[_0x40d9('0xa')]);router[_0x40d9('0x8')]('/:id',auth[_0x40d9('0x6')](),controller[_0x40d9('0xb')]);router[_0x40d9('0x8')](_0x40d9('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x40d9('0x8')]('/:id/canned_answers',auth[_0x40d9('0x6')](),controller[_0x40d9('0xd')]);router[_0x40d9('0x8')]('/:id/logo',controller[_0x40d9('0xe')]);router[_0x40d9('0x8')](_0x40d9('0xf'),controller[_0x40d9('0x10')]);router['get'](_0x40d9('0x11'),controller[_0x40d9('0x12')]);router[_0x40d9('0x8')](_0x40d9('0x13'),controller[_0x40d9('0x14')]);router[_0x40d9('0x8')](_0x40d9('0x15'),auth[_0x40d9('0x6')](),controller[_0x40d9('0x16')]);router['get'](_0x40d9('0x17'),controller[_0x40d9('0x18')]);router[_0x40d9('0x8')](_0x40d9('0x19'),auth[_0x40d9('0x6')](),controller[_0x40d9('0x1a')]);router[_0x40d9('0x8')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x40d9('0x8')](_0x40d9('0x1b'),controller[_0x40d9('0x1c')]);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x40d9('0x1d')]);router['get'](_0x40d9('0x1e'),auth[_0x40d9('0x6')](),controller[_0x40d9('0x1f')]);router[_0x40d9('0x20')]('/',auth[_0x40d9('0x6')](),controller[_0x40d9('0x21')]);router[_0x40d9('0x20')]('/:id/dispositions',auth[_0x40d9('0x6')](),controller[_0x40d9('0x22')]);router['post'](_0x40d9('0x23'),auth['isAuthenticated'](),controller[_0x40d9('0x24')]);var upload=multer({'storage':multer[_0x40d9('0x25')]({'destination':function(_0x1a2130,_0x3a5b43,_0x41c44e){_0x41c44e(null,path[_0x40d9('0x26')](config['root'],'server/files/images/logos/'));},'filename':function(_0xc32a6e,_0x4bb4e5,_0x47fd0a){_0x47fd0a(null,util[_0x40d9('0x27')](_0x40d9('0x28'),Date[_0x40d9('0x29')](),_0x4bb4e5['originalname']));}})});router[_0x40d9('0x20')](_0x40d9('0x2a'),upload['single'](_0x40d9('0x2b')),controller[_0x40d9('0x2c')]);var upload=multer({'storage':multer[_0x40d9('0x25')]({'destination':function(_0x1d82f1,_0x2c40eb,_0x39e56a){_0x39e56a(null,path[_0x40d9('0x26')](config[_0x40d9('0x2d')],_0x40d9('0x2e')));},'filename':function(_0x2da200,_0x2edc1e,_0x3341ed){_0x3341ed(null,util[_0x40d9('0x27')](_0x40d9('0x28'),Date[_0x40d9('0x29')](),_0x2edc1e['originalname']));}})});router[_0x40d9('0x20')](_0x40d9('0xf'),upload[_0x40d9('0x2f')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x40d9('0x25')]({'destination':function(_0x32f156,_0x382cf7,_0x168714){_0x168714(null,path['join'](config[_0x40d9('0x2d')],'server/files/images/avatars/'));},'filename':function(_0x568e22,_0x2f44fa,_0x2f81f4){_0x2f81f4(null,util[_0x40d9('0x27')](_0x40d9('0x28'),Date[_0x40d9('0x29')](),_0x2f44fa[_0x40d9('0x30')]));}})});router[_0x40d9('0x20')](_0x40d9('0x11'),upload[_0x40d9('0x2f')](_0x40d9('0x2b')),controller[_0x40d9('0x31')]);var upload=multer({'storage':multer[_0x40d9('0x25')]({'destination':function(_0x1ef08d,_0xdff66c,_0x494eb7){_0x494eb7(null,path['join'](config[_0x40d9('0x2d')],_0x40d9('0x2e')));},'filename':function(_0x2c172b,_0x34905b,_0x67bf60){_0x67bf60(null,util[_0x40d9('0x27')](_0x40d9('0x28'),Date[_0x40d9('0x29')](),_0x34905b[_0x40d9('0x30')]));}})});router['post'](_0x40d9('0x13'),upload[_0x40d9('0x2f')](_0x40d9('0x2b')),controller[_0x40d9('0x32')]);router[_0x40d9('0x20')](_0x40d9('0x33'),controller[_0x40d9('0x34')]);router[_0x40d9('0x20')]('/:id/offline',controller[_0x40d9('0x35')]);router[_0x40d9('0x20')](_0x40d9('0x15'),auth[_0x40d9('0x6')](),controller[_0x40d9('0x36')]);router[_0x40d9('0x20')](_0x40d9('0x19'),auth[_0x40d9('0x6')](),controller[_0x40d9('0x37')]);router[_0x40d9('0x20')]('/:id/proactive_actions',auth[_0x40d9('0x6')](),controller[_0x40d9('0x38')]);router[_0x40d9('0x20')](_0x40d9('0x1e'),auth[_0x40d9('0x6')](),controller[_0x40d9('0x39')]);router[_0x40d9('0x3a')](_0x40d9('0x3b'),auth['isAuthenticated'](),controller[_0x40d9('0x3c')]);router[_0x40d9('0x3d')](_0x40d9('0x3b'),auth[_0x40d9('0x6')](),controller[_0x40d9('0x3e')]);router[_0x40d9('0x3d')](_0x40d9('0xc'),auth[_0x40d9('0x6')](),controller['removeDispositions']);router[_0x40d9('0x3d')](_0x40d9('0x23'),auth[_0x40d9('0x6')](),controller[_0x40d9('0x3f')]);router[_0x40d9('0x3d')]('/:id/users',auth[_0x40d9('0x6')](),controller[_0x40d9('0x40')]);module[_0x40d9('0x41')]=router; \ No newline at end of file +var _0x2ea7=['root','server/files/images/logos/','%s-%s','now','originalname','/:id/logo','single','file','diskStorage','server/files/images/avatars/','format','/:id/avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getLogo','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','join'];(function(_0x5b8aa5,_0x41c69a){var _0x72d1dd=function(_0x5b1ca6){while(--_0x5b1ca6){_0x5b8aa5['push'](_0x5b8aa5['shift']());}};_0x72d1dd(++_0x41c69a);}(_0x2ea7,0xdb));var _0x72ea=function(_0x59db19,_0x30c1c6){_0x59db19=_0x59db19-0x0;var _0x5f0f09=_0x2ea7[_0x59db19];return _0x5f0f09;};'use strict';var multer=require('multer');var util=require(_0x72ea('0x0'));var path=require('path');var timeout=require(_0x72ea('0x1'));var express=require(_0x72ea('0x2'));var router=express['Router']();var auth=require(_0x72ea('0x3'));var interaction=require(_0x72ea('0x4'));var config=require(_0x72ea('0x5'));var controller=require(_0x72ea('0x6'));router['get']('/',auth[_0x72ea('0x7')](),controller[_0x72ea('0x8')]);router[_0x72ea('0x9')](_0x72ea('0xa'),auth['isAuthenticated'](),controller[_0x72ea('0xb')]);router[_0x72ea('0x9')](_0x72ea('0xc'),auth['isAuthenticated'](),controller[_0x72ea('0xd')]);router[_0x72ea('0x9')](_0x72ea('0xe'),auth[_0x72ea('0x7')](),controller['getDispositions']);router[_0x72ea('0x9')]('/:id/canned_answers',auth[_0x72ea('0x7')](),controller['getAnswers']);router[_0x72ea('0x9')]('/:id/logo',controller[_0x72ea('0xf')]);router[_0x72ea('0x9')]('/:id/avatar',controller['getAvatar']);router['get'](_0x72ea('0x10'),controller['getCustomerAvatar']);router[_0x72ea('0x9')](_0x72ea('0x11'),controller[_0x72ea('0x12')]);router[_0x72ea('0x9')]('/:id/interactions',auth[_0x72ea('0x7')](),controller[_0x72ea('0x13')]);router[_0x72ea('0x9')](_0x72ea('0x14'),controller[_0x72ea('0x15')]);router[_0x72ea('0x9')](_0x72ea('0x16'),auth[_0x72ea('0x7')](),controller[_0x72ea('0x17')]);router[_0x72ea('0x9')]('/:id/proactive_actions',auth[_0x72ea('0x7')](),controller['getProactiveActions']);router[_0x72ea('0x9')]('/:id/fields',controller['getFields']);router['get'](_0x72ea('0x18'),auth[_0x72ea('0x7')](),controller[_0x72ea('0x19')]);router[_0x72ea('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x72ea('0x1a')]);router[_0x72ea('0x1b')]('/',auth[_0x72ea('0x7')](),controller[_0x72ea('0x1c')]);router['post'](_0x72ea('0xe'),auth[_0x72ea('0x7')](),controller[_0x72ea('0x1d')]);router[_0x72ea('0x1b')](_0x72ea('0x1e'),auth['isAuthenticated'](),controller[_0x72ea('0x1f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2bfca9,_0x57d83f,_0xfe4fc2){_0xfe4fc2(null,path[_0x72ea('0x20')](config[_0x72ea('0x21')],_0x72ea('0x22')));},'filename':function(_0x5c8968,_0x460b61,_0xfc9aea){_0xfc9aea(null,util['format'](_0x72ea('0x23'),Date[_0x72ea('0x24')](),_0x460b61[_0x72ea('0x25')]));}})});router[_0x72ea('0x1b')](_0x72ea('0x26'),upload[_0x72ea('0x27')](_0x72ea('0x28')),controller['addLogo']);var upload=multer({'storage':multer[_0x72ea('0x29')]({'destination':function(_0x42afda,_0xe83082,_0x53ad2d){_0x53ad2d(null,path['join'](config[_0x72ea('0x21')],_0x72ea('0x2a')));},'filename':function(_0x5303f7,_0x18f10b,_0x5544d7){_0x5544d7(null,util[_0x72ea('0x2b')](_0x72ea('0x23'),Date[_0x72ea('0x24')](),_0x18f10b[_0x72ea('0x25')]));}})});router[_0x72ea('0x1b')](_0x72ea('0x2c'),upload['single'](_0x72ea('0x28')),controller['addAvatar']);var upload=multer({'storage':multer[_0x72ea('0x29')]({'destination':function(_0xb95f35,_0x588440,_0x3bacb6){_0x3bacb6(null,path[_0x72ea('0x20')](config[_0x72ea('0x21')],_0x72ea('0x2a')));},'filename':function(_0x300bf8,_0x11848f,_0x32bb5a){_0x32bb5a(null,util['format'](_0x72ea('0x23'),Date['now'](),_0x11848f[_0x72ea('0x25')]));}})});router[_0x72ea('0x1b')]('/:id/customer_avatar',upload[_0x72ea('0x27')](_0x72ea('0x28')),controller[_0x72ea('0x2d')]);var upload=multer({'storage':multer[_0x72ea('0x29')]({'destination':function(_0x2e5340,_0x1cad42,_0x34bef4){_0x34bef4(null,path[_0x72ea('0x20')](config[_0x72ea('0x21')],'server/files/images/avatars/'));},'filename':function(_0x280f9b,_0x52c202,_0x30efd3){_0x30efd3(null,util['format']('%s-%s',Date[_0x72ea('0x24')](),_0x52c202['originalname']));}})});router['post']('/:id/system_avatar',upload['single'](_0x72ea('0x28')),controller[_0x72ea('0x2e')]);router[_0x72ea('0x1b')](_0x72ea('0x2f'),controller[_0x72ea('0x30')]);router[_0x72ea('0x1b')]('/:id/offline',controller[_0x72ea('0x31')]);router[_0x72ea('0x1b')](_0x72ea('0x32'),auth[_0x72ea('0x7')](),controller[_0x72ea('0x33')]);router[_0x72ea('0x1b')](_0x72ea('0x16'),auth[_0x72ea('0x7')](),controller[_0x72ea('0x34')]);router['post'](_0x72ea('0x35'),auth['isAuthenticated'](),controller[_0x72ea('0x36')]);router[_0x72ea('0x1b')](_0x72ea('0x37'),auth[_0x72ea('0x7')](),controller[_0x72ea('0x38')]);router[_0x72ea('0x39')](_0x72ea('0xc'),auth[_0x72ea('0x7')](),controller[_0x72ea('0x3a')]);router[_0x72ea('0x3b')]('/:id',auth[_0x72ea('0x7')](),controller[_0x72ea('0x3c')]);router[_0x72ea('0x3b')](_0x72ea('0xe'),auth[_0x72ea('0x7')](),controller['removeDispositions']);router[_0x72ea('0x3b')](_0x72ea('0x1e'),auth[_0x72ea('0x7')](),controller[_0x72ea('0x3d')]);router[_0x72ea('0x3b')](_0x72ea('0x37'),auth['isAuthenticated'](),controller[_0x72ea('0x3e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index e77b076..49a76f2 100644 --- a/server/api/cmCompany/cmCompany.attributes.js +++ b/server/api/cmCompany/cmCompany.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd61=['sequelize','exports','STRING','name'];(function(_0x3a9549,_0xc6e586){var _0x58d056=function(_0x330636){while(--_0x330636){_0x3a9549['push'](_0x3a9549['shift']());}};_0x58d056(++_0xc6e586);}(_0xdd61,0x64));var _0x1dd6=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xdd61[_0x4b7b62];return _0x2280df;};'use strict';var Sequelize=require(_0x1dd6('0x0'));module[_0x1dd6('0x1')]={'name':{'type':Sequelize[_0x1dd6('0x2')],'unique':_0x1dd6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1dd6('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x1dd6('0x2')]},'phone':{'type':Sequelize[_0x1dd6('0x2')]},'fax':{'type':Sequelize[_0x1dd6('0x2')]},'type':{'type':Sequelize[_0x1dd6('0x2')]},'street':{'type':Sequelize[_0x1dd6('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1dd6('0x2')]},'country':{'type':Sequelize[_0x1dd6('0x2')]},'email':{'type':Sequelize[_0x1dd6('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x1dd6('0x2')]},'sCity':{'type':Sequelize[_0x1dd6('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1dd6('0x2')]}}; \ No newline at end of file +var _0xfd9f=['name','exports','STRING'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0xfd9f,0x13f));var _0xffd9=function(_0x3dbb51,_0x4ccb2d){_0x3dbb51=_0x3dbb51-0x0;var _0x56add2=_0xfd9f[_0x3dbb51];return _0x56add2;};'use strict';var Sequelize=require('sequelize');module[_0xffd9('0x0')]={'name':{'type':Sequelize[_0xffd9('0x1')],'unique':_0xffd9('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xffd9('0x1')]},'website':{'type':Sequelize[_0xffd9('0x1')]},'phone':{'type':Sequelize[_0xffd9('0x1')]},'fax':{'type':Sequelize[_0xffd9('0x1')]},'type':{'type':Sequelize[_0xffd9('0x1')]},'street':{'type':Sequelize[_0xffd9('0x1')]},'postalCode':{'type':Sequelize[_0xffd9('0x1')]},'city':{'type':Sequelize[_0xffd9('0x1')]},'country':{'type':Sequelize[_0xffd9('0x1')]},'email':{'type':Sequelize[_0xffd9('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xffd9('0x1')]},'sStreet':{'type':Sequelize[_0xffd9('0x1')]},'sPostalCode':{'type':Sequelize[_0xffd9('0x1')]},'sCity':{'type':Sequelize[_0xffd9('0x1')]},'sCountry':{'type':Sequelize[_0xffd9('0x1')]},'description':{'type':Sequelize[_0xffd9('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 5e26d79..d447632 100644 --- a/server/api/cmCompany/cmCompany.controller.js +++ b/server/api/cmCompany/cmCompany.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0dc9=['show','params','CmCompany','rawAttributes','create','user','role','Companies','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContact','ids','omit','map','merge','getContacts','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','key','VIRTUAL','field','options','includeAll','include','findAll','catch'];(function(_0x34bff5,_0x17b716){var _0x4c7732=function(_0x34eeca){while(--_0x34eeca){_0x34bff5['push'](_0x34bff5['shift']());}};_0x4c7732(++_0x17b716);}(_0x0dc9,0x113));var _0x90dc=function(_0x5303b9,_0x5c548){_0x5303b9=_0x5303b9-0x0;var _0x455125=_0x0dc9[_0x5303b9];return _0x455125;};'use strict';var pdf=require(_0x90dc('0x0'));var emlformat=require(_0x90dc('0x1'));var rimraf=require(_0x90dc('0x2'));var zipdir=require(_0x90dc('0x3'));var jsonpatch=require(_0x90dc('0x4'));var rp=require(_0x90dc('0x5'));var moment=require(_0x90dc('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x90dc('0x7'));var util=require('util');var path=require(_0x90dc('0x8'));var sox=require(_0x90dc('0x9'));var csv=require(_0x90dc('0xa'));var ejs=require(_0x90dc('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x90dc('0xc'));var deskjs=require(_0x90dc('0xd'));var toCsv=require(_0x90dc('0xa'));var querystring=require(_0x90dc('0xe'));var Papa=require(_0x90dc('0xf'));var Redis=require('ioredis');var authService=require(_0x90dc('0x10'));var qs=require(_0x90dc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x90dc('0x12'))(_0x90dc('0x13'));var utils=require('../../config/utils');var config=require(_0x90dc('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ecd6d,_0xc65dfd){_0xc65dfd=_0xc65dfd||0xcc;return function(_0x2b979f){if(_0x2b979f){return _0x5ecd6d[_0x90dc('0x15')](_0xc65dfd);}return _0x5ecd6d[_0x90dc('0x16')](_0xc65dfd)[_0x90dc('0x17')]();};}function respondWithResult(_0x551112,_0x1bb19a){_0x1bb19a=_0x1bb19a||0xc8;return function(_0x3b64c6){if(_0x3b64c6){return _0x551112[_0x90dc('0x16')](_0x1bb19a)[_0x90dc('0x18')](_0x3b64c6);}};}function respondWithFilteredResult(_0xe618d0,_0x83124b){return function(_0x26290b){if(_0x26290b){var _0x2e13fd=_0x26290b[_0x90dc('0x19')],_0x51b700=_0x83124b[_0x90dc('0x1a')],_0x4c6100=_0x83124b['offset']+_0x83124b[_0x90dc('0x1b')],_0x432587;if(_0x4c6100>=_0x2e13fd){_0x4c6100=_0x2e13fd;_0x432587=0xc8;}else{_0x432587=0xce;}_0xe618d0['status'](_0x432587);return _0xe618d0[_0x90dc('0x1c')](_0x90dc('0x1d'),_0x51b700+'-'+_0x4c6100+'/'+_0x2e13fd)[_0x90dc('0x18')](_0x26290b);}return null;};}function patchUpdates(_0x2c1e88){return function(_0x2a8cbf){try{jsonpatch[_0x90dc('0x1e')](_0x2a8cbf,_0x2c1e88,!![]);}catch(_0x2240eb){return BPromise[_0x90dc('0x1f')](_0x2240eb);}return _0x2a8cbf[_0x90dc('0x20')]();};}function saveUpdates(_0x25baff,_0x554601){return function(_0x2f990e){if(_0x2f990e){return _0x2f990e[_0x90dc('0x21')](_0x25baff)[_0x90dc('0x22')](function(_0x43f5e6){return _0x43f5e6;});}return null;};}function removeEntity(_0x5cdef1,_0x11fb17){return function(_0x4b32d6){if(_0x4b32d6){return _0x4b32d6[_0x90dc('0x23')]()[_0x90dc('0x22')](function(){var _0x5f54c2=_0x4b32d6[_0x90dc('0x24')]({'plain':!![]});var _0x49d275='Companies';return db[_0x90dc('0x25')][_0x90dc('0x23')]({'where':{'type':_0x49d275,'resourceId':_0x5f54c2['id']}})['then'](function(){return _0x4b32d6;});})[_0x90dc('0x22')](function(){_0x5cdef1[_0x90dc('0x16')](0xcc)[_0x90dc('0x17')]();});}};}function handleEntityNotFound(_0x696cb6,_0x4ea16f){return function(_0x5e56b7){if(!_0x5e56b7){_0x696cb6[_0x90dc('0x15')](0x194);}return _0x5e56b7;};}function handleError(_0xac7199,_0x8c2214){_0x8c2214=_0x8c2214||0x1f4;return function(_0x58a72a){logger[_0x90dc('0x26')](_0x58a72a[_0x90dc('0x27')]);if(_0x58a72a[_0x90dc('0x28')]){delete _0x58a72a[_0x90dc('0x28')];}_0xac7199[_0x90dc('0x16')](_0x8c2214)['send'](_0x58a72a);};}exports['index']=function(_0x14481b,_0x3838b8){var _0x5b6e4b={},_0x2d09fd={},_0x54aa36={'count':0x0,'rows':[]};var _0x2fb8f9=db['CmCompany']['rawAttributes'];_0x2d09fd[_0x90dc('0x29')]=_[_0x90dc('0x2a')](_0x2fb8f9);_0x2d09fd[_0x90dc('0x2b')]=_['keys'](_0x14481b[_0x90dc('0x2b')]);_0x2d09fd[_0x90dc('0x2c')]=_[_0x90dc('0x2d')](_0x2d09fd['model'],_0x2d09fd[_0x90dc('0x2b')]);_0x5b6e4b[_0x90dc('0x2e')]=_['intersection'](_0x2d09fd[_0x90dc('0x29')],qs[_0x90dc('0x2f')](_0x14481b[_0x90dc('0x2b')][_0x90dc('0x2f')]));_0x5b6e4b[_0x90dc('0x2e')]=_0x5b6e4b[_0x90dc('0x2e')][_0x90dc('0x30')]?_0x5b6e4b['attributes']:_0x2d09fd[_0x90dc('0x29')];if(!_0x14481b[_0x90dc('0x2b')][_0x90dc('0x31')](_0x90dc('0x32'))){_0x5b6e4b[_0x90dc('0x1b')]=qs[_0x90dc('0x1b')](_0x14481b['query'][_0x90dc('0x1b')]);_0x5b6e4b['offset']=qs[_0x90dc('0x1a')](_0x14481b['query']['offset']);}_0x5b6e4b[_0x90dc('0x33')]=qs[_0x90dc('0x34')](_0x14481b[_0x90dc('0x2b')][_0x90dc('0x34')]);_0x5b6e4b['where']=qs[_0x90dc('0x2c')](_[_0x90dc('0x35')](_0x14481b['query'],_0x2d09fd[_0x90dc('0x2c')]));if(_0x14481b[_0x90dc('0x2b')][_0x90dc('0x36')]){_0x5b6e4b[_0x90dc('0x37')]=_['merge'](_0x5b6e4b['where'],{'$or':_['map'](_0x2fb8f9,function(_0x4c5ab9){if(_0x4c5ab9[_0x90dc('0x38')][_0x90dc('0x39')]!==_0x90dc('0x3a')){var _0x513f89={};_0x513f89[_0x4c5ab9[_0x90dc('0x3b')]]={'$like':'%'+_0x14481b['query'][_0x90dc('0x36')]+'%'};return _0x513f89;}})});}_0x5b6e4b=_['merge']({},_0x5b6e4b,_0x14481b[_0x90dc('0x3c')]);var _0x263b1a={'where':_0x5b6e4b['where']};return db['CmCompany'][_0x90dc('0x19')](_0x263b1a)[_0x90dc('0x22')](function(_0x4dcec6){_0x54aa36[_0x90dc('0x19')]=_0x4dcec6;if(_0x14481b['query'][_0x90dc('0x3d')]){_0x5b6e4b[_0x90dc('0x3e')]=[{'all':!![]}];}return db['CmCompany'][_0x90dc('0x3f')](_0x5b6e4b);})[_0x90dc('0x22')](function(_0x335407){_0x54aa36['rows']=_0x335407;return _0x54aa36;})[_0x90dc('0x22')](respondWithFilteredResult(_0x3838b8,_0x5b6e4b))[_0x90dc('0x40')](handleError(_0x3838b8,null));};exports[_0x90dc('0x41')]=function(_0x50834a,_0x3bdccc){var _0x1361a4={'raw':![],'where':{'id':_0x50834a[_0x90dc('0x42')]['id']}},_0x3b8462={};_0x3b8462[_0x90dc('0x29')]=_[_0x90dc('0x2a')](db[_0x90dc('0x43')][_0x90dc('0x44')]);_0x3b8462[_0x90dc('0x2b')]=_[_0x90dc('0x2a')](_0x50834a[_0x90dc('0x2b')]);_0x3b8462[_0x90dc('0x2c')]=_[_0x90dc('0x2d')](_0x3b8462[_0x90dc('0x29')],_0x3b8462[_0x90dc('0x2b')]);_0x1361a4[_0x90dc('0x2e')]=_['intersection'](_0x3b8462[_0x90dc('0x29')],qs[_0x90dc('0x2f')](_0x50834a[_0x90dc('0x2b')][_0x90dc('0x2f')]));_0x1361a4[_0x90dc('0x2e')]=_0x1361a4[_0x90dc('0x2e')]['length']?_0x1361a4['attributes']:_0x3b8462[_0x90dc('0x29')];if(_0x50834a['query'][_0x90dc('0x3d')]){_0x1361a4[_0x90dc('0x3e')]=[{'all':!![]}];}_0x1361a4=_['merge']({},_0x1361a4,_0x50834a[_0x90dc('0x3c')]);return db[_0x90dc('0x43')]['find'](_0x1361a4)[_0x90dc('0x22')](handleEntityNotFound(_0x3bdccc,null))[_0x90dc('0x22')](respondWithResult(_0x3bdccc,null))[_0x90dc('0x40')](handleError(_0x3bdccc,null));};exports[_0x90dc('0x45')]=function(_0x4eb9f8,_0x430c30){return db[_0x90dc('0x43')][_0x90dc('0x45')](_0x4eb9f8['body'],{})[_0x90dc('0x22')](function(_0x31fba1){var _0x5ac093=_0x4eb9f8[_0x90dc('0x46')][_0x90dc('0x24')]({'plain':!![]});if(!_0x5ac093)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ac093[_0x90dc('0x47')]==='user'){var _0x220493=_0x31fba1[_0x90dc('0x24')]({'plain':!![]});var _0x564533=_0x90dc('0x48');return db[_0x90dc('0x49')][_0x90dc('0x4a')]({'where':{'name':_0x564533,'userProfileId':_0x5ac093[_0x90dc('0x4b')]},'raw':!![]})[_0x90dc('0x22')](function(_0x3cd034){if(_0x3cd034&&_0x3cd034[_0x90dc('0x4c')]===0x0){return db['UserProfileResource'][_0x90dc('0x45')]({'name':_0x220493[_0x90dc('0x28')],'resourceId':_0x220493['id'],'type':_0x3cd034[_0x90dc('0x28')],'sectionId':_0x3cd034['id']},{})[_0x90dc('0x22')](function(){return _0x31fba1;});}else{return _0x31fba1;}})[_0x90dc('0x40')](function(_0x2e1a66){logger[_0x90dc('0x26')](_0x90dc('0x4d'),_0x2e1a66);throw _0x2e1a66;});}return _0x31fba1;})[_0x90dc('0x22')](respondWithResult(_0x430c30,0xc9))[_0x90dc('0x40')](handleError(_0x430c30,null));};exports['update']=function(_0xa9e689,_0x94957b){if(_0xa9e689[_0x90dc('0x4e')]['id']){delete _0xa9e689[_0x90dc('0x4e')]['id'];}return db['CmCompany']['find']({'where':{'id':_0xa9e689['params']['id']}})[_0x90dc('0x22')](handleEntityNotFound(_0x94957b,null))[_0x90dc('0x22')](saveUpdates(_0xa9e689['body'],null))[_0x90dc('0x22')](respondWithResult(_0x94957b,null))['catch'](handleError(_0x94957b,null));};exports[_0x90dc('0x23')]=function(_0x27bfa9,_0x5ae755){return db[_0x90dc('0x43')][_0x90dc('0x4a')]({'where':{'id':_0x27bfa9['params']['id']}})['then'](handleEntityNotFound(_0x5ae755,null))[_0x90dc('0x22')](removeEntity(_0x5ae755,null))['catch'](handleError(_0x5ae755,null));};exports['addContacts']=function(_0x15a0a3,_0x412887,_0x1bd2db){return db[_0x90dc('0x4f')]['find']({'where':{'id':_0x15a0a3[_0x90dc('0x42')]['id']}})[_0x90dc('0x22')](handleEntityNotFound(_0x412887,null))[_0x90dc('0x22')](function(_0x2c7571){if(_0x2c7571){return _0x2c7571['addContacts'](_0x15a0a3['body'][_0x90dc('0x50')],_[_0x90dc('0x51')](_0x15a0a3[_0x90dc('0x4e')],[_0x90dc('0x50'),'id'])||{});}})[_0x90dc('0x22')](respondWithResult(_0x412887,null))[_0x90dc('0x40')](handleError(_0x412887,null));};exports['getContacts']=function(_0x31494a,_0x32aff3,_0x11156e){var _0x3b64d7={};var _0x2436c1={};var _0x138fd5;var _0x36b3c4;return db[_0x90dc('0x43')]['findOne']({'where':{'id':_0x31494a['params']['id']}})[_0x90dc('0x22')](handleEntityNotFound(_0x32aff3,null))[_0x90dc('0x22')](function(_0x162dec){if(_0x162dec){_0x138fd5=_0x162dec;_0x2436c1[_0x90dc('0x29')]=_['keys'](db['CmContact'][_0x90dc('0x44')]);_0x2436c1['query']=_[_0x90dc('0x2a')](_0x31494a[_0x90dc('0x2b')]);_0x2436c1['filters']=_[_0x90dc('0x2d')](_0x2436c1[_0x90dc('0x29')],_0x2436c1['query']);_0x3b64d7['attributes']=_[_0x90dc('0x2d')](_0x2436c1['model'],qs[_0x90dc('0x2f')](_0x31494a[_0x90dc('0x2b')]['fields']));_0x3b64d7[_0x90dc('0x2e')]=_0x3b64d7[_0x90dc('0x2e')][_0x90dc('0x30')]?_0x3b64d7[_0x90dc('0x2e')]:_0x2436c1[_0x90dc('0x29')];_0x3b64d7[_0x90dc('0x33')]=qs[_0x90dc('0x34')](_0x31494a[_0x90dc('0x2b')][_0x90dc('0x34')]);_0x3b64d7[_0x90dc('0x37')]=qs[_0x90dc('0x2c')](_[_0x90dc('0x35')](_0x31494a[_0x90dc('0x2b')],_0x2436c1[_0x90dc('0x2c')]));if(_0x31494a['query'][_0x90dc('0x36')]){_0x3b64d7[_0x90dc('0x37')]=_['merge'](_0x3b64d7[_0x90dc('0x37')],{'$or':_[_0x90dc('0x52')](_0x3b64d7[_0x90dc('0x2e')],function(_0x12bae9){var _0x79f967={};_0x79f967[_0x12bae9]={'$like':'%'+_0x31494a[_0x90dc('0x2b')][_0x90dc('0x36')]+'%'};return _0x79f967;})});}_0x3b64d7=_[_0x90dc('0x53')]({},_0x3b64d7,_0x31494a[_0x90dc('0x3c')]);return _0x138fd5[_0x90dc('0x54')](_0x3b64d7);}})[_0x90dc('0x22')](function(_0x352e27){if(_0x352e27){_0x36b3c4=_0x352e27[_0x90dc('0x30')];if(!_0x31494a['query'][_0x90dc('0x31')](_0x90dc('0x32'))){_0x3b64d7['limit']=qs[_0x90dc('0x1b')](_0x31494a[_0x90dc('0x2b')][_0x90dc('0x1b')]);_0x3b64d7[_0x90dc('0x1a')]=qs[_0x90dc('0x1a')](_0x31494a['query'][_0x90dc('0x1a')]);}return _0x138fd5[_0x90dc('0x54')](_0x3b64d7);}})[_0x90dc('0x22')](function(_0x2ffeb3){if(_0x2ffeb3){return _0x2ffeb3?{'count':_0x36b3c4,'rows':_0x2ffeb3}:null;}})[_0x90dc('0x22')](respondWithResult(_0x32aff3,null))['catch'](handleError(_0x32aff3,null));}; \ No newline at end of file +var _0x7b05=['catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','findOne','getContacts','nolimit','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','end','json','count','offset','limit','set','reject','then','destroy','get','Companies','UserProfileResource','status','sendStatus','error','stack','name','send','index','CmCompany','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows'];(function(_0x4989fe,_0x201e34){var _0x4afd24=function(_0x3bb870){while(--_0x3bb870){_0x4989fe['push'](_0x4989fe['shift']());}};_0x4afd24(++_0x201e34);}(_0x7b05,0x1bc));var _0x57b0=function(_0x37a7c6,_0x3a84b6){_0x37a7c6=_0x37a7c6-0x0;var _0x539905=_0x7b05[_0x37a7c6];return _0x539905;};'use strict';var pdf=require(_0x57b0('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x57b0('0x1'));var jsonpatch=require(_0x57b0('0x2'));var rp=require('request-promise');var moment=require(_0x57b0('0x3'));var BPromise=require(_0x57b0('0x4'));var Mustache=require(_0x57b0('0x5'));var util=require('util');var path=require(_0x57b0('0x6'));var sox=require(_0x57b0('0x7'));var csv=require(_0x57b0('0x8'));var ejs=require(_0x57b0('0x9'));var fs=require('fs');var _=require(_0x57b0('0xa'));var squel=require(_0x57b0('0xb'));var crypto=require('crypto');var jsforce=require(_0x57b0('0xc'));var deskjs=require(_0x57b0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x57b0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x57b0('0xf'));var qs=require(_0x57b0('0x10'));var hardwareService=require(_0x57b0('0x11'));var logger=require('../../config/logger')(_0x57b0('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x57b0('0x13'))['db'];function respondWithStatusCode(_0x2729c3,_0x11e40e){_0x11e40e=_0x11e40e||0xcc;return function(_0x364459){if(_0x364459){return _0x2729c3['sendStatus'](_0x11e40e);}return _0x2729c3['status'](_0x11e40e)[_0x57b0('0x14')]();};}function respondWithResult(_0x26da20,_0x576a65){_0x576a65=_0x576a65||0xc8;return function(_0x2408ad){if(_0x2408ad){return _0x26da20['status'](_0x576a65)[_0x57b0('0x15')](_0x2408ad);}};}function respondWithFilteredResult(_0x517938,_0x4437bd){return function(_0x3d2608){if(_0x3d2608){var _0x531473=_0x3d2608[_0x57b0('0x16')],_0x21daee=_0x4437bd[_0x57b0('0x17')],_0x258ddb=_0x4437bd[_0x57b0('0x17')]+_0x4437bd[_0x57b0('0x18')],_0x16765d;if(_0x258ddb>=_0x531473){_0x258ddb=_0x531473;_0x16765d=0xc8;}else{_0x16765d=0xce;}_0x517938['status'](_0x16765d);return _0x517938[_0x57b0('0x19')]('Content-Range',_0x21daee+'-'+_0x258ddb+'/'+_0x531473)['json'](_0x3d2608);}return null;};}function patchUpdates(_0x4314b5){return function(_0x6dc1a0){try{jsonpatch['apply'](_0x6dc1a0,_0x4314b5,!![]);}catch(_0x2d1eb0){return BPromise[_0x57b0('0x1a')](_0x2d1eb0);}return _0x6dc1a0['save']();};}function saveUpdates(_0xc46dc2,_0x15ccc1){return function(_0x2edf97){if(_0x2edf97){return _0x2edf97['update'](_0xc46dc2)[_0x57b0('0x1b')](function(_0x30416c){return _0x30416c;});}return null;};}function removeEntity(_0x53a6ee,_0xf2449b){return function(_0x3334cd){if(_0x3334cd){return _0x3334cd[_0x57b0('0x1c')]()[_0x57b0('0x1b')](function(){var _0x5844e6=_0x3334cd[_0x57b0('0x1d')]({'plain':!![]});var _0x2d822d=_0x57b0('0x1e');return db[_0x57b0('0x1f')]['destroy']({'where':{'type':_0x2d822d,'resourceId':_0x5844e6['id']}})[_0x57b0('0x1b')](function(){return _0x3334cd;});})[_0x57b0('0x1b')](function(){_0x53a6ee[_0x57b0('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x524c83,_0x197760){return function(_0x4e6f15){if(!_0x4e6f15){_0x524c83[_0x57b0('0x21')](0x194);}return _0x4e6f15;};}function handleError(_0x42dd40,_0x5edbca){_0x5edbca=_0x5edbca||0x1f4;return function(_0x1337f0){logger[_0x57b0('0x22')](_0x1337f0[_0x57b0('0x23')]);if(_0x1337f0[_0x57b0('0x24')]){delete _0x1337f0['name'];}_0x42dd40[_0x57b0('0x20')](_0x5edbca)[_0x57b0('0x25')](_0x1337f0);};}exports[_0x57b0('0x26')]=function(_0x2d32ff,_0x56fd03){var _0x2c0c1a={},_0x43e670={},_0xf74a43={'count':0x0,'rows':[]};var _0x51eef9=db[_0x57b0('0x27')][_0x57b0('0x28')];_0x43e670[_0x57b0('0x29')]=_[_0x57b0('0x2a')](_0x51eef9);_0x43e670[_0x57b0('0x2b')]=_[_0x57b0('0x2a')](_0x2d32ff[_0x57b0('0x2b')]);_0x43e670['filters']=_['intersection'](_0x43e670[_0x57b0('0x29')],_0x43e670[_0x57b0('0x2b')]);_0x2c0c1a[_0x57b0('0x2c')]=_[_0x57b0('0x2d')](_0x43e670[_0x57b0('0x29')],qs[_0x57b0('0x2e')](_0x2d32ff[_0x57b0('0x2b')]['fields']));_0x2c0c1a[_0x57b0('0x2c')]=_0x2c0c1a[_0x57b0('0x2c')][_0x57b0('0x2f')]?_0x2c0c1a[_0x57b0('0x2c')]:_0x43e670[_0x57b0('0x29')];if(!_0x2d32ff[_0x57b0('0x2b')][_0x57b0('0x30')]('nolimit')){_0x2c0c1a[_0x57b0('0x18')]=qs[_0x57b0('0x18')](_0x2d32ff[_0x57b0('0x2b')]['limit']);_0x2c0c1a[_0x57b0('0x17')]=qs[_0x57b0('0x17')](_0x2d32ff[_0x57b0('0x2b')]['offset']);}_0x2c0c1a[_0x57b0('0x31')]=qs[_0x57b0('0x32')](_0x2d32ff['query'][_0x57b0('0x32')]);_0x2c0c1a[_0x57b0('0x33')]=qs[_0x57b0('0x34')](_[_0x57b0('0x35')](_0x2d32ff[_0x57b0('0x2b')],_0x43e670['filters']));if(_0x2d32ff['query'][_0x57b0('0x36')]){_0x2c0c1a[_0x57b0('0x33')]=_['merge'](_0x2c0c1a[_0x57b0('0x33')],{'$or':_[_0x57b0('0x37')](_0x51eef9,function(_0xf5ecbc){if(_0xf5ecbc[_0x57b0('0x38')][_0x57b0('0x39')]!==_0x57b0('0x3a')){var _0x4117ed={};_0x4117ed[_0xf5ecbc[_0x57b0('0x3b')]]={'$like':'%'+_0x2d32ff[_0x57b0('0x2b')][_0x57b0('0x36')]+'%'};return _0x4117ed;}})});}_0x2c0c1a=_[_0x57b0('0x3c')]({},_0x2c0c1a,_0x2d32ff[_0x57b0('0x3d')]);var _0x37cce7={'where':_0x2c0c1a[_0x57b0('0x33')]};return db[_0x57b0('0x27')]['count'](_0x37cce7)[_0x57b0('0x1b')](function(_0x5c0d26){_0xf74a43[_0x57b0('0x16')]=_0x5c0d26;if(_0x2d32ff[_0x57b0('0x2b')][_0x57b0('0x3e')]){_0x2c0c1a[_0x57b0('0x3f')]=[{'all':!![]}];}return db[_0x57b0('0x27')][_0x57b0('0x40')](_0x2c0c1a);})['then'](function(_0x26423f){_0xf74a43[_0x57b0('0x41')]=_0x26423f;return _0xf74a43;})[_0x57b0('0x1b')](respondWithFilteredResult(_0x56fd03,_0x2c0c1a))[_0x57b0('0x42')](handleError(_0x56fd03,null));};exports[_0x57b0('0x43')]=function(_0x5bdeaa,_0x4357fb){var _0x374120={'raw':![],'where':{'id':_0x5bdeaa[_0x57b0('0x44')]['id']}},_0x2c38db={};_0x2c38db[_0x57b0('0x29')]=_['keys'](db[_0x57b0('0x27')]['rawAttributes']);_0x2c38db['query']=_[_0x57b0('0x2a')](_0x5bdeaa[_0x57b0('0x2b')]);_0x2c38db[_0x57b0('0x34')]=_['intersection'](_0x2c38db[_0x57b0('0x29')],_0x2c38db['query']);_0x374120[_0x57b0('0x2c')]=_[_0x57b0('0x2d')](_0x2c38db[_0x57b0('0x29')],qs['fields'](_0x5bdeaa[_0x57b0('0x2b')][_0x57b0('0x2e')]));_0x374120[_0x57b0('0x2c')]=_0x374120[_0x57b0('0x2c')][_0x57b0('0x2f')]?_0x374120['attributes']:_0x2c38db[_0x57b0('0x29')];if(_0x5bdeaa[_0x57b0('0x2b')]['includeAll']){_0x374120[_0x57b0('0x3f')]=[{'all':!![]}];}_0x374120=_[_0x57b0('0x3c')]({},_0x374120,_0x5bdeaa[_0x57b0('0x3d')]);return db[_0x57b0('0x27')][_0x57b0('0x45')](_0x374120)['then'](handleEntityNotFound(_0x4357fb,null))[_0x57b0('0x1b')](respondWithResult(_0x4357fb,null))[_0x57b0('0x42')](handleError(_0x4357fb,null));};exports[_0x57b0('0x46')]=function(_0x4828b9,_0x28e4f2){return db[_0x57b0('0x27')][_0x57b0('0x46')](_0x4828b9[_0x57b0('0x47')],{})[_0x57b0('0x1b')](function(_0xbe16ab){var _0x27a858=_0x4828b9[_0x57b0('0x48')][_0x57b0('0x1d')]({'plain':!![]});if(!_0x27a858)throw new Error(_0x57b0('0x49'));if(_0x27a858['role']===_0x57b0('0x48')){var _0xec32bf=_0xbe16ab[_0x57b0('0x1d')]({'plain':!![]});var _0x3aac22=_0x57b0('0x1e');return db['UserProfileSection'][_0x57b0('0x45')]({'where':{'name':_0x3aac22,'userProfileId':_0x27a858[_0x57b0('0x4a')]},'raw':!![]})[_0x57b0('0x1b')](function(_0x591a8b){if(_0x591a8b&&_0x591a8b[_0x57b0('0x4b')]===0x0){return db[_0x57b0('0x1f')][_0x57b0('0x46')]({'name':_0xec32bf[_0x57b0('0x24')],'resourceId':_0xec32bf['id'],'type':_0x591a8b[_0x57b0('0x24')],'sectionId':_0x591a8b['id']},{})[_0x57b0('0x1b')](function(){return _0xbe16ab;});}else{return _0xbe16ab;}})['catch'](function(_0x27d534){logger[_0x57b0('0x22')](_0x57b0('0x4c'),_0x27d534);throw _0x27d534;});}return _0xbe16ab;})[_0x57b0('0x1b')](respondWithResult(_0x28e4f2,0xc9))[_0x57b0('0x42')](handleError(_0x28e4f2,null));};exports[_0x57b0('0x4d')]=function(_0x3460b0,_0x2a62ec){if(_0x3460b0['body']['id']){delete _0x3460b0[_0x57b0('0x47')]['id'];}return db[_0x57b0('0x27')]['find']({'where':{'id':_0x3460b0['params']['id']}})[_0x57b0('0x1b')](handleEntityNotFound(_0x2a62ec,null))['then'](saveUpdates(_0x3460b0[_0x57b0('0x47')],null))[_0x57b0('0x1b')](respondWithResult(_0x2a62ec,null))['catch'](handleError(_0x2a62ec,null));};exports[_0x57b0('0x1c')]=function(_0x234ff5,_0x2efbc4){return db[_0x57b0('0x27')]['find']({'where':{'id':_0x234ff5[_0x57b0('0x44')]['id']}})['then'](handleEntityNotFound(_0x2efbc4,null))[_0x57b0('0x1b')](removeEntity(_0x2efbc4,null))['catch'](handleError(_0x2efbc4,null));};exports[_0x57b0('0x4e')]=function(_0xb0f40f,_0x5319c9,_0x7e111a){return db[_0x57b0('0x4f')][_0x57b0('0x45')]({'where':{'id':_0xb0f40f[_0x57b0('0x44')]['id']}})[_0x57b0('0x1b')](handleEntityNotFound(_0x5319c9,null))['then'](function(_0x7679d1){if(_0x7679d1){return _0x7679d1['addContacts'](_0xb0f40f['body'][_0x57b0('0x50')],_[_0x57b0('0x51')](_0xb0f40f[_0x57b0('0x47')],[_0x57b0('0x50'),'id'])||{});}})[_0x57b0('0x1b')](respondWithResult(_0x5319c9,null))['catch'](handleError(_0x5319c9,null));};exports['getContacts']=function(_0x475db2,_0x45c20d,_0x245166){var _0x3b1398={};var _0x58f982={};var _0x73ed29;var _0x23c172;return db[_0x57b0('0x27')][_0x57b0('0x52')]({'where':{'id':_0x475db2['params']['id']}})[_0x57b0('0x1b')](handleEntityNotFound(_0x45c20d,null))[_0x57b0('0x1b')](function(_0x2fb649){if(_0x2fb649){_0x73ed29=_0x2fb649;_0x58f982[_0x57b0('0x29')]=_[_0x57b0('0x2a')](db[_0x57b0('0x4f')][_0x57b0('0x28')]);_0x58f982[_0x57b0('0x2b')]=_['keys'](_0x475db2['query']);_0x58f982[_0x57b0('0x34')]=_[_0x57b0('0x2d')](_0x58f982[_0x57b0('0x29')],_0x58f982[_0x57b0('0x2b')]);_0x3b1398[_0x57b0('0x2c')]=_[_0x57b0('0x2d')](_0x58f982[_0x57b0('0x29')],qs['fields'](_0x475db2['query'][_0x57b0('0x2e')]));_0x3b1398[_0x57b0('0x2c')]=_0x3b1398[_0x57b0('0x2c')][_0x57b0('0x2f')]?_0x3b1398[_0x57b0('0x2c')]:_0x58f982[_0x57b0('0x29')];_0x3b1398[_0x57b0('0x31')]=qs[_0x57b0('0x32')](_0x475db2[_0x57b0('0x2b')][_0x57b0('0x32')]);_0x3b1398[_0x57b0('0x33')]=qs[_0x57b0('0x34')](_[_0x57b0('0x35')](_0x475db2[_0x57b0('0x2b')],_0x58f982[_0x57b0('0x34')]));if(_0x475db2['query'][_0x57b0('0x36')]){_0x3b1398['where']=_[_0x57b0('0x3c')](_0x3b1398['where'],{'$or':_['map'](_0x3b1398[_0x57b0('0x2c')],function(_0x2d9d63){var _0x295a3f={};_0x295a3f[_0x2d9d63]={'$like':'%'+_0x475db2[_0x57b0('0x2b')][_0x57b0('0x36')]+'%'};return _0x295a3f;})});}_0x3b1398=_['merge']({},_0x3b1398,_0x475db2[_0x57b0('0x3d')]);return _0x73ed29[_0x57b0('0x53')](_0x3b1398);}})[_0x57b0('0x1b')](function(_0x3d6cdc){if(_0x3d6cdc){_0x23c172=_0x3d6cdc[_0x57b0('0x2f')];if(!_0x475db2[_0x57b0('0x2b')][_0x57b0('0x30')](_0x57b0('0x54'))){_0x3b1398[_0x57b0('0x18')]=qs[_0x57b0('0x18')](_0x475db2['query'][_0x57b0('0x18')]);_0x3b1398['offset']=qs[_0x57b0('0x17')](_0x475db2[_0x57b0('0x2b')][_0x57b0('0x17')]);}return _0x73ed29[_0x57b0('0x53')](_0x3b1398);}})['then'](function(_0x5311f4){if(_0x5311f4){return _0x5311f4?{'count':_0x23c172,'rows':_0x5311f4}:null;}})[_0x57b0('0x1b')](respondWithResult(_0x45c20d,null))['catch'](handleError(_0x45c20d,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 036c568..962e720 100644 --- a/server/api/cmCompany/cmCompany.model.js +++ b/server/api/cmCompany/cmCompany.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0ae=['api','bluebird','path','rimraf','./cmCompany.attributes','define','CmCompany','cm_companies','../../config/logger'];(function(_0x2f19ac,_0x1aa7cc){var _0x56b308=function(_0x5b05e9){while(--_0x5b05e9){_0x2f19ac['push'](_0x2f19ac['shift']());}};_0x56b308(++_0x1aa7cc);}(_0xe0ae,0xa1));var _0xee0a=function(_0x1fc18b,_0x13d27d){_0x1fc18b=_0x1fc18b-0x0;var _0x16a351=_0xe0ae[_0x1fc18b];return _0x16a351;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xee0a('0x0'))(_0xee0a('0x1'));var moment=require('moment');var BPromise=require(_0xee0a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee0a('0x3'));var rimraf=require(_0xee0a('0x4'));var config=require('../../config/environment');var attributes=require(_0xee0a('0x5'));module['exports']=function(_0x5bef07,_0x39a302){return _0x5bef07[_0xee0a('0x6')](_0xee0a('0x7'),attributes,{'tableName':_0xee0a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56e6=['exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x588fa7,_0xe45efb){var _0x4374f2=function(_0x3eb020){while(--_0x3eb020){_0x588fa7['push'](_0x588fa7['shift']());}};_0x4374f2(++_0xe45efb);}(_0x56e6,0x6b));var _0x656e=function(_0x11786e,_0xc0200d){_0x11786e=_0x11786e-0x0;var _0x1b5def=_0x56e6[_0x11786e];return _0x1b5def;};'use strict';var _=require(_0x656e('0x0'));var util=require(_0x656e('0x1'));var logger=require(_0x656e('0x2'))(_0x656e('0x3'));var moment=require(_0x656e('0x4'));var BPromise=require(_0x656e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x656e('0x6'));var rimraf=require(_0x656e('0x7'));var config=require(_0x656e('0x8'));var attributes=require(_0x656e('0x9'));module[_0x656e('0xa')]=function(_0x3fef98,_0x81c232){return _0x3fef98['define'](_0x656e('0xb'),attributes,{'tableName':_0x656e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index c526d06..1b58921 100644 --- a/server/api/cmCompany/cmCompany.rpc.js +++ b/server/api/cmCompany/cmCompany.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5172=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','info','catch'];(function(_0x20dd87,_0x510d8b){var _0x31d72f=function(_0x42bc8e){while(--_0x42bc8e){_0x20dd87['push'](_0x20dd87['shift']());}};_0x31d72f(++_0x510d8b);}(_0x5172,0x72));var _0x2517=function(_0x1cac4a,_0x49d1fc){_0x1cac4a=_0x1cac4a-0x0;var _0x5f5328=_0x5172[_0x1cac4a];return _0x5f5328;};'use strict';var _=require(_0x2517('0x0'));var util=require(_0x2517('0x1'));var moment=require(_0x2517('0x2'));var BPromise=require(_0x2517('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2517('0x4'));var db=require(_0x2517('0x5'))['db'];var utils=require(_0x2517('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2517('0x7'));var jayson=require(_0x2517('0x8'));var client=jayson[_0x2517('0x9')][_0x2517('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aedd0,_0x34cd53,_0x179937){return new BPromise(function(_0x3fc906,_0x5e7817){return client['request'](_0x4aedd0,_0x179937)['then'](function(_0x55c8a6){logger['info'](_0x2517('0xb'),_0x34cd53,_0x2517('0xc'));logger['debug'](_0x2517('0xd'),_0x34cd53,'request\x20sent',JSON['stringify'](_0x55c8a6));if(_0x55c8a6[_0x2517('0xe')]){if(_0x55c8a6[_0x2517('0xe')][_0x2517('0xf')]===0x1f4){logger[_0x2517('0xe')](_0x2517('0xb'),_0x34cd53,_0x55c8a6[_0x2517('0xe')][_0x2517('0x10')]);return _0x5e7817(_0x55c8a6[_0x2517('0xe')][_0x2517('0x10')]);}logger['error'](_0x2517('0xb'),_0x34cd53,_0x55c8a6[_0x2517('0xe')]['message']);return _0x3fc906(_0x55c8a6[_0x2517('0xe')][_0x2517('0x10')]);}else{logger[_0x2517('0x11')](_0x2517('0xb'),_0x34cd53,_0x2517('0xc'));_0x3fc906(_0x55c8a6['result'][_0x2517('0x10')]);}})[_0x2517('0x12')](function(_0x52cda1){logger[_0x2517('0xe')]('CmCompany,\x20%s,\x20%s',_0x34cd53,_0x52cda1);_0x5e7817(_0x52cda1);});});} \ No newline at end of file +var _0xbdc9=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x2dcac4,_0x54364d){var _0x432c7=function(_0x15bab3){while(--_0x15bab3){_0x2dcac4['push'](_0x2dcac4['shift']());}};_0x432c7(++_0x54364d);}(_0xbdc9,0xbc));var _0x9bdc=function(_0x1241aa,_0x14179e){_0x1241aa=_0x1241aa-0x0;var _0x768752=_0xbdc9[_0x1241aa];return _0x768752;};'use strict';var _=require(_0x9bdc('0x0'));var util=require('util');var moment=require(_0x9bdc('0x1'));var BPromise=require('bluebird');var rs=require(_0x9bdc('0x2'));var fs=require('fs');var Redis=require(_0x9bdc('0x3'));var db=require(_0x9bdc('0x4'))['db'];var utils=require(_0x9bdc('0x5'));var logger=require(_0x9bdc('0x6'))(_0x9bdc('0x7'));var config=require('../../config/environment');var jayson=require(_0x9bdc('0x8'));var client=jayson[_0x9bdc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51d01e,_0x4182e6,_0x51a013){return new BPromise(function(_0x1c1b71,_0x7c0a07){return client[_0x9bdc('0xa')](_0x51d01e,_0x51a013)[_0x9bdc('0xb')](function(_0xdc6346){logger[_0x9bdc('0xc')](_0x9bdc('0xd'),_0x4182e6,_0x9bdc('0xe'));logger[_0x9bdc('0xf')](_0x9bdc('0x10'),_0x4182e6,_0x9bdc('0xe'),JSON[_0x9bdc('0x11')](_0xdc6346));if(_0xdc6346[_0x9bdc('0x12')]){if(_0xdc6346[_0x9bdc('0x12')][_0x9bdc('0x13')]===0x1f4){logger[_0x9bdc('0x12')]('CmCompany,\x20%s,\x20%s',_0x4182e6,_0xdc6346[_0x9bdc('0x12')][_0x9bdc('0x14')]);return _0x7c0a07(_0xdc6346[_0x9bdc('0x12')][_0x9bdc('0x14')]);}logger[_0x9bdc('0x12')](_0x9bdc('0xd'),_0x4182e6,_0xdc6346[_0x9bdc('0x12')][_0x9bdc('0x14')]);return _0x1c1b71(_0xdc6346[_0x9bdc('0x12')][_0x9bdc('0x14')]);}else{logger[_0x9bdc('0xc')](_0x9bdc('0xd'),_0x4182e6,'request\x20sent');_0x1c1b71(_0xdc6346['result'][_0x9bdc('0x14')]);}})['catch'](function(_0x44d102){logger[_0x9bdc('0x12')]('CmCompany,\x20%s,\x20%s',_0x4182e6,_0x44d102);_0x7c0a07(_0x44d102);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 395be61..a0909e0 100644 --- a/server/api/cmCompany/index.js +++ b/server/api/cmCompany/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94c2=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','show','/:id/contacts','create','addContacts','put','/:id','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x4aba15,_0x4e90aa){var _0x1c8122=function(_0x568dba){while(--_0x568dba){_0x4aba15['push'](_0x4aba15['shift']());}};_0x1c8122(++_0x4e90aa);}(_0x94c2,0x13d));var _0x294c=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x94c2[_0x24061a];return _0x82054e;};'use strict';var multer=require('multer');var util=require(_0x294c('0x0'));var path=require('path');var timeout=require(_0x294c('0x1'));var express=require(_0x294c('0x2'));var router=express[_0x294c('0x3')]();var auth=require(_0x294c('0x4'));var interaction=require(_0x294c('0x5'));var config=require(_0x294c('0x6'));var controller=require(_0x294c('0x7'));router[_0x294c('0x8')]('/',auth[_0x294c('0x9')](),controller['index']);router[_0x294c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x294c('0xa')]);router[_0x294c('0x8')](_0x294c('0xb'),auth[_0x294c('0x9')](),controller['getContacts']);router['post']('/',auth[_0x294c('0x9')](),controller[_0x294c('0xc')]);router['post']('/:id/contacts',auth[_0x294c('0x9')](),controller[_0x294c('0xd')]);router[_0x294c('0xe')](_0x294c('0xf'),auth[_0x294c('0x9')](),controller[_0x294c('0x10')]);router[_0x294c('0x11')](_0x294c('0xf'),auth[_0x294c('0x9')](),controller[_0x294c('0x12')]);module[_0x294c('0x13')]=router; \ No newline at end of file +var _0x61b8=['getContacts','post','addContacts','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id/contacts','isAuthenticated'];(function(_0xbf9c2a,_0x25241d){var _0x4a7cbb=function(_0x3b6f87){while(--_0x3b6f87){_0xbf9c2a['push'](_0xbf9c2a['shift']());}};_0x4a7cbb(++_0x25241d);}(_0x61b8,0xcf));var _0x861b=function(_0x260707,_0x4d5c70){_0x260707=_0x260707-0x0;var _0x4d3747=_0x61b8[_0x260707];return _0x4d3747;};'use strict';var multer=require(_0x861b('0x0'));var util=require(_0x861b('0x1'));var path=require(_0x861b('0x2'));var timeout=require(_0x861b('0x3'));var express=require(_0x861b('0x4'));var router=express[_0x861b('0x5')]();var auth=require(_0x861b('0x6'));var interaction=require(_0x861b('0x7'));var config=require(_0x861b('0x8'));var controller=require('./cmCompany.controller');router[_0x861b('0x9')]('/',auth['isAuthenticated'](),controller[_0x861b('0xa')]);router[_0x861b('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x861b('0x9')](_0x861b('0xb'),auth[_0x861b('0xc')](),controller[_0x861b('0xd')]);router['post']('/',auth[_0x861b('0xc')](),controller['create']);router[_0x861b('0xe')]('/:id/contacts',auth[_0x861b('0xc')](),controller[_0x861b('0xf')]);router['put'](_0x861b('0x10'),auth['isAuthenticated'](),controller[_0x861b('0x11')]);router[_0x861b('0x12')](_0x861b('0x10'),auth['isAuthenticated'](),controller[_0x861b('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 79ccddc..e6f1992 100644 --- a/server/api/cmContact/cmContact.attributes.js +++ b/server/api/cmContact/cmContact.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e03=['exports','STRING','TEXT','INTEGER','NOW','sequelize'];(function(_0x4fb280,_0x3f232a){var _0x28c5a6=function(_0x1e5bb4){while(--_0x1e5bb4){_0x4fb280['push'](_0x4fb280['shift']());}};_0x28c5a6(++_0x3f232a);}(_0x8e03,0x191));var _0x38e0=function(_0x4adb01,_0x202444){_0x4adb01=_0x4adb01-0x0;var _0x30370b=_0x8e03[_0x4adb01];return _0x30370b;};'use strict';var _=require('lodash');var Sequelize=require(_0x38e0('0x0'));module[_0x38e0('0x1')]={'firstName':{'type':Sequelize[_0x38e0('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x38e0('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x38e0('0x2')]},'city':{'type':Sequelize[_0x38e0('0x2')]},'country':{'type':Sequelize[_0x38e0('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x38e0('0x3')]},'phone':{'type':Sequelize[_0x38e0('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x38e0('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x38e0('0x2')]},'facebook':{'type':Sequelize[_0x38e0('0x2')]},'fb_data':{'type':Sequelize[_0x38e0('0x2')]},'twitter':{'type':Sequelize[_0x38e0('0x2')]},'skype':{'type':Sequelize[_0x38e0('0x2')]},'teams':{'type':Sequelize[_0x38e0('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x38e0('0x2')]},'wechat':{'type':Sequelize[_0x38e0('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x38e0('0x4')]},'priority':{'type':Sequelize[_0x38e0('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x38e0('0x5')]}}; \ No newline at end of file +var _0x978f=['INTEGER','UNSIGNED','DATE','NOW','lodash','STRING','TEXT'];(function(_0x2de1cb,_0x501118){var _0x242eda=function(_0x3cde9b){while(--_0x3cde9b){_0x2de1cb['push'](_0x2de1cb['shift']());}};_0x242eda(++_0x501118);}(_0x978f,0x169));var _0xf978=function(_0x4db5dc,_0x522901){_0x4db5dc=_0x4db5dc-0x0;var _0x62ee23=_0x978f[_0x4db5dc];return _0x62ee23;};'use strict';var _=require(_0xf978('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0xf978('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf978('0x1')]},'street':{'type':Sequelize[_0xf978('0x1')]},'postalCode':{'type':Sequelize[_0xf978('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xf978('0x1')]},'dateOfBirth':{'type':Sequelize[_0xf978('0x1')]},'description':{'type':Sequelize[_0xf978('0x2')]},'phone':{'type':Sequelize[_0xf978('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xf978('0x1')]},'email':{'type':Sequelize[_0xf978('0x1')]},'url':{'type':Sequelize[_0xf978('0x1')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xf978('0x1')]},'twitter':{'type':Sequelize[_0xf978('0x1')]},'skype':{'type':Sequelize[_0xf978('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xf978('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xf978('0x1')]},'UserId':{'type':Sequelize[_0xf978('0x3')]},'priority':{'type':Sequelize[_0xf978('0x3')](0x2)[_0xf978('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf978('0x5')],'defaultValue':Sequelize[_0xf978('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 2e21c68..f32649e 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4e9=['rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmContact.socket','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','CmContact','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','select','field','name','color','from','cm_contacts','c.deletedAt\x20IS\x20NULL','expr','parse','forEach','condition','isArray','value','and','\x20IN\x20?','tableAlias','\x20=\x20?','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','map','filter','isNil','isEmpty','ListId','concat','replace','\x27\x27\x27\x27','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','order','c.id','Sequelize','QueryTypes','COUNT(*)','tag','having','left_join','tools_tags','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','sequelize','toString','count','merge','c.*','GROUP_CONCAT(DISTINCT\x20t.id)','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','TagIds','Tags','split','push','rows','params','catch','startsWith','cf_','columnName','displayName','CmCustomField','findAll','alias','custom','values','body','get','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','OpenchannelQueueReport','JscriptySessionReport','bulkCreate','each','duplicates','findOrCreate','error','show','find','Tag','omit','format','cf_%d','$and','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','findOne','rawAttributes','options','nolimit','ids','getHoppers','includeAll','include','getHopperHistories','ContactId','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','join','root','server/files/tmp','file','filename','chmodSync','0777','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','meta','import','User','agent','binding','child_process','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','html-pdf','eml-format'];(function(_0x27fc7d,_0x5ed454){var _0x3fe2f4=function(_0x1c4403){while(--_0x1c4403){_0x27fc7d['push'](_0x27fc7d['shift']());}};_0x3fe2f4(++_0x5ed454);}(_0xb4e9,0xda));var _0x9b4e=function(_0x113a7b,_0x3d8bae){_0x113a7b=_0x113a7b-0x0;var _0xa6fedf=_0xb4e9[_0x113a7b];return _0xa6fedf;};'use strict';var pdf=require(_0x9b4e('0x0'));var emlformat=require(_0x9b4e('0x1'));var rimraf=require(_0x9b4e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b4e('0x3'));var rp=require('request-promise');var moment=require(_0x9b4e('0x4'));var BPromise=require(_0x9b4e('0x5'));var Mustache=require(_0x9b4e('0x6'));var util=require(_0x9b4e('0x7'));var path=require('path');var sox=require(_0x9b4e('0x8'));var csv=require('to-csv');var ejs=require(_0x9b4e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9b4e('0xa'));var crypto=require(_0x9b4e('0xb'));var jsforce=require(_0x9b4e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9b4e('0xd'));var querystring=require(_0x9b4e('0xe'));var Papa=require(_0x9b4e('0xf'));var Redis=require(_0x9b4e('0x10'));var authService=require(_0x9b4e('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x9b4e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9b4e('0x13'));var config=require(_0x9b4e('0x14'));var db=require(_0x9b4e('0x15'))['db'];config[_0x9b4e('0x16')]=_[_0x9b4e('0x17')](config[_0x9b4e('0x16')],{'host':_0x9b4e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b4e('0x16')]));require(_0x9b4e('0x19'))['register'](socket);function respondWithStatusCode(_0x1a4c8d,_0x25828e){_0x25828e=_0x25828e||0xcc;return function(_0x5b1f36){if(_0x5b1f36){return _0x1a4c8d[_0x9b4e('0x1a')](_0x25828e);}return _0x1a4c8d[_0x9b4e('0x1b')](_0x25828e)['end']();};}function respondWithResult(_0x3476d5,_0x5a1635){_0x5a1635=_0x5a1635||0xc8;return function(_0x46bbce){if(_0x46bbce){return _0x3476d5[_0x9b4e('0x1b')](_0x5a1635)[_0x9b4e('0x1c')](_0x46bbce);}};}function respondWithFilteredResult(_0x457fed,_0x22fcc8){return function(_0x5b5dba){if(_0x5b5dba){var _0x29f987=_0x5b5dba['count'],_0xb48db3=_0x22fcc8[_0x9b4e('0x1d')],_0x1269bf=_0x22fcc8[_0x9b4e('0x1d')]+_0x22fcc8[_0x9b4e('0x1e')],_0xe2e9fe;if(_0x1269bf>=_0x29f987){_0x1269bf=_0x29f987;_0xe2e9fe=0xc8;}else{_0xe2e9fe=0xce;}_0x457fed['status'](_0xe2e9fe);return _0x457fed[_0x9b4e('0x1f')](_0x9b4e('0x20'),_0xb48db3+'-'+_0x1269bf+'/'+_0x29f987)['json'](_0x5b5dba);}return null;};}function patchUpdates(_0x136fe3){return function(_0x3f6056){try{jsonpatch[_0x9b4e('0x21')](_0x3f6056,_0x136fe3,!![]);}catch(_0x7cf20d){return BPromise[_0x9b4e('0x22')](_0x7cf20d);}return _0x3f6056[_0x9b4e('0x23')]();};}function saveUpdates(_0xa7e0ff,_0x4c215f){return function(_0x1869df){if(_0x1869df){return _0x1869df[_0x9b4e('0x24')](_0xa7e0ff)[_0x9b4e('0x25')](function(_0x17ba5f){return _0x17ba5f;});}return null;};}function removeEntity(_0x2b758d,_0x15c976){return function(_0x3ea39f){if(_0x3ea39f){return _0x3ea39f[_0x9b4e('0x26')]()[_0x9b4e('0x25')](function(){_0x2b758d[_0x9b4e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f84a9,_0x5a59c0){return function(_0x52a1cb){if(!_0x52a1cb){_0x1f84a9['sendStatus'](0x194);}return _0x52a1cb;};}function handleError(_0x1a8a4a,_0x185679){_0x185679=_0x185679||0x1f4;return function(_0x6e04dc){logger['error'](_0x6e04dc[_0x9b4e('0x27')]);if(_0x6e04dc['name']){delete _0x6e04dc['name'];}_0x1a8a4a[_0x9b4e('0x1b')](_0x185679)[_0x9b4e('0x28')](_0x6e04dc);};}exports[_0x9b4e('0x29')]=function(_0x21de84,_0x5f5d21){var _0x3ea954={},_0x5c3ab0={},_0x252e93={'count':0x0,'rows':[]};return db[_0x9b4e('0x2a')][_0x9b4e('0x2b')]()[_0x9b4e('0x25')](function(_0x15c81e){_0x5c3ab0[_0x9b4e('0x2c')]=_[_0x9b4e('0x2d')](_0x15c81e);_0x5c3ab0[_0x9b4e('0x2e')]=_[_0x9b4e('0x2d')](_0x21de84[_0x9b4e('0x2e')]);_0x5c3ab0[_0x9b4e('0x2f')]=_[_0x9b4e('0x30')](_0x5c3ab0[_0x9b4e('0x2c')],_0x5c3ab0[_0x9b4e('0x2e')]);_0x3ea954['attributes']=_['intersection'](_0x5c3ab0[_0x9b4e('0x2c')],qs[_0x9b4e('0x31')](_0x21de84['query'][_0x9b4e('0x31')]));_0x3ea954[_0x9b4e('0x32')]=_0x3ea954['attributes'][_0x9b4e('0x33')]?_0x3ea954[_0x9b4e('0x32')]:_0x5c3ab0['model'];if(!_0x21de84[_0x9b4e('0x2e')][_0x9b4e('0x34')]('nolimit')){_0x3ea954[_0x9b4e('0x1e')]=qs[_0x9b4e('0x1e')](_0x21de84['query'][_0x9b4e('0x1e')]);_0x3ea954[_0x9b4e('0x1d')]=qs[_0x9b4e('0x1d')](_0x21de84['query'][_0x9b4e('0x1d')]);}_0x3ea954['order']=qs[_0x9b4e('0x35')](_0x21de84[_0x9b4e('0x2e')][_0x9b4e('0x35')]);_0x3ea954[_0x9b4e('0x36')]=qs['filters'](_[_0x9b4e('0x37')](_0x21de84[_0x9b4e('0x2e')],_0x5c3ab0[_0x9b4e('0x2f')]));var _0xf21c52=[];var _0x54ea46=squel[_0x9b4e('0x38')]()[_0x9b4e('0x39')]('id')[_0x9b4e('0x39')](_0x9b4e('0x3a'))[_0x9b4e('0x39')](_0x9b4e('0x3b'))[_0x9b4e('0x3c')]('tools_tags');var _0x4973db=squel['select']()[_0x9b4e('0x3c')](_0x9b4e('0x3d'),'c')['where'](_0x9b4e('0x3e'));var _0x1b7624=squel[_0x9b4e('0x3f')]();if(_0x21de84[_0x9b4e('0x2e')]['advancedFilter']){var _0x47b8b8=JSON[_0x9b4e('0x40')](_0x21de84['query']['advancedFilter']);_[_0x9b4e('0x2d')](_0x47b8b8)[_0x9b4e('0x41')](function(_0xfa5ab3){var _0x451d14=_0x47b8b8[_0xfa5ab3];switch(_0x451d14[_0x9b4e('0x42')]){case'IS':if(_[_0x9b4e('0x43')](_0x451d14[_0x9b4e('0x44')])&&_0x451d14['value'][_0x9b4e('0x33')]>0x1){_0x1b7624[_0x9b4e('0x45')](_0x451d14['tableAlias']+'.'+_0xfa5ab3+_0x9b4e('0x46'),_0x451d14['value']);}else{_0x1b7624[_0x9b4e('0x45')](_0x451d14[_0x9b4e('0x47')]+'.'+_0xfa5ab3+_0x9b4e('0x48'),_0x451d14[_0x9b4e('0x44')][0x0]);}break;case'=':_0x1b7624[_0x9b4e('0x45')](_0x451d14[_0x9b4e('0x47')]+'.'+_0xfa5ab3+_0x9b4e('0x48'),_0x451d14[_0x9b4e('0x44')]);break;case'LIKE':_0x1b7624['and'](_0x451d14[_0x9b4e('0x47')]+'.'+_0xfa5ab3+_0x9b4e('0x49'),'%'+_0x451d14[_0x9b4e('0x44')]+'%');break;case'>':_0x1b7624[_0x9b4e('0x45')](_0x451d14[_0x9b4e('0x47')]+'.'+_0xfa5ab3+_0x9b4e('0x4a'),_0x451d14[_0x9b4e('0x44')]);break;case'<':_0x1b7624[_0x9b4e('0x45')](_0x451d14[_0x9b4e('0x47')]+'.'+_0xfa5ab3+_0x9b4e('0x4b'),_0x451d14['value']);break;}});}else{var _0x243ac2=_(Object[_0x9b4e('0x2d')](_0x21de84['query']))[_0x9b4e('0x4c')](function(_0x51ee70){return _0x15c81e[_0x9b4e('0x34')](_0x51ee70)?_0x51ee70:undefined;})[_0x9b4e('0x4d')](function(_0x31cdbd){return!_[_0x9b4e('0x4e')](_0x31cdbd);})[_0x9b4e('0x44')]();if(!_[_0x9b4e('0x4f')](_0x243ac2)){_0x243ac2[_0x9b4e('0x41')](function(_0x28695f){if(_0x28695f===_0x9b4e('0x50')){_0x4973db[_0x9b4e('0x36')]('c.ListId\x20IN\x20?',[][_0x9b4e('0x51')](_0x21de84[_0x9b4e('0x2e')][_0x28695f]));}else{_0x4973db[_0x9b4e('0x36')]('c.'+_0x28695f+_0x9b4e('0x48'),_0x21de84[_0x9b4e('0x2e')][_0x28695f]);}});}if(_0x21de84[_0x9b4e('0x2e')][_0x9b4e('0x4d')]){var _0xebbec7=_0x21de84[_0x9b4e('0x2e')][_0x9b4e('0x4d')][_0x9b4e('0x52')]('\x5c','\x5c\x5c')[_0x9b4e('0x52')]('\x27\x27',_0x9b4e('0x53'));if(qs[_0x9b4e('0x54')](_0xebbec7)){_0x1b7624['or'](_0x9b4e('0x55'),_0xebbec7+'%');_0x1b7624['or'](_0x9b4e('0x56'),_0xebbec7+'%');_0x1b7624['or'](_0x9b4e('0x57'),_0xebbec7+'%');_0x1b7624['or'](_0x9b4e('0x58'),_0xebbec7+'%');}else if(qs['isEmail'](_0xebbec7)){_0x1b7624['or'](_0x9b4e('0x59'),_0xebbec7+'%');}else{_0x1b7624['or'](_0x9b4e('0x59'),_0xebbec7+'%');_0x1b7624['or'](_0x9b4e('0x5a'),_0xebbec7+'%');_0x1b7624['or']('c.lastName\x20LIKE\x20?',_0xebbec7+'%');}}}_0x4973db[_0x9b4e('0x36')](_0x1b7624);if(_0x3ea954[_0x9b4e('0x5b')]){_0x3ea954['order']['forEach'](function(_0xe278ef){_0x4973db['order']('c.'+_0xe278ef[0x0],_0xe278ef[0x1]==='DESC'?![]:!![]);});}_0x4973db['group'](_0x9b4e('0x5c'));var _0x4cb53c={'type':db[_0x9b4e('0x5d')][_0x9b4e('0x5e')]['SELECT'],'raw':!![]};var _0x577db6=_0x4973db['clone']()[_0x9b4e('0x39')](_0x9b4e('0x5f'));if(!_0x21de84[_0x9b4e('0x2e')]['advancedFilter']){if(_0x21de84[_0x9b4e('0x2e')][_0x9b4e('0x60')]){var _0x1cd7c9=_[_0x9b4e('0x43')](_0x21de84[_0x9b4e('0x2e')][_0x9b4e('0x60')])?_0x21de84['query'][_0x9b4e('0x60')]:new Array(_0x21de84['query']['tag']);var _0x55e17f=squel[_0x9b4e('0x3f')]();_0x1cd7c9[_0x9b4e('0x41')](function(_0x2ef004){_0x55e17f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2ef004+',%');});_0x4973db[_0x9b4e('0x61')](_0x55e17f);_0x577db6[_0x9b4e('0x62')]('cm_contact_has_tags','ct','ct.CmContactId\x20=\x20c.id');_0x577db6['left_join'](_0x9b4e('0x63'),'t',_0x9b4e('0x64'));_0x577db6[_0x9b4e('0x36')](_0x9b4e('0x65'),_0x1cd7c9);}}db[_0x9b4e('0x66')][_0x9b4e('0x2e')](_0x54ea46[_0x9b4e('0x67')](),_0x4cb53c)[_0x9b4e('0x25')](function(_0xc335){_0xf21c52=_['keyBy'](_0xc335,'id');return db[_0x9b4e('0x66')][_0x9b4e('0x2e')](_0x577db6[_0x9b4e('0x67')](),_0x4cb53c);})[_0x9b4e('0x25')](function(_0x389e77){_0x252e93[_0x9b4e('0x68')]=_0x389e77[_0x9b4e('0x33')];_0x4cb53c=_[_0x9b4e('0x69')](_0x4cb53c,{'model':db[_0x9b4e('0x2a')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4973db[_0x9b4e('0x39')](_0x9b4e('0x6a'));_0x4973db[_0x9b4e('0x39')](_0x9b4e('0x6b'),'TagIds');_0x4973db[_0x9b4e('0x62')](_0x9b4e('0x6c'),'ct',_0x9b4e('0x6d'));_0x4973db[_0x9b4e('0x62')]('tools_tags','t','t.id\x20=\x20ct.TagId');if(_0x3ea954[_0x9b4e('0x1e')]){_0x4973db[_0x9b4e('0x1e')](_0x3ea954[_0x9b4e('0x1e')]);}if(_0x3ea954['offset']){_0x4973db[_0x9b4e('0x1d')](_0x3ea954['offset']);}db[_0x9b4e('0x66')]['query'](_0x4973db[_0x9b4e('0x67')](),_0x4cb53c)['then'](function(_0x3b443d){_0x3b443d[_0x9b4e('0x41')](function(_0x536a9b){if(_0x536a9b[_0x9b4e('0x6e')]){_0x536a9b[_0x9b4e('0x6f')]=[];_0x536a9b[_0x9b4e('0x6e')][_0x9b4e('0x70')](',')['forEach'](function(_0x41ab8a){_0x536a9b[_0x9b4e('0x6f')][_0x9b4e('0x71')](_0xf21c52[_0x41ab8a]);});}delete _0x536a9b[_0x9b4e('0x6e')];});_0x252e93[_0x9b4e('0x72')]=_0x3b443d;return _0x252e93;})[_0x9b4e('0x25')](respondWithFilteredResult(_0x5f5d21,_0x3ea954))['catch'](handleError(_0x5f5d21,null));});});};exports[_0x9b4e('0x26')]=function(_0x294a2c,_0x25dae8){return db['CmContact']['find']({'where':{'id':_0x294a2c[_0x9b4e('0x73')]['id']}})[_0x9b4e('0x25')](handleEntityNotFound(_0x25dae8,null))[_0x9b4e('0x25')](removeEntity(_0x25dae8,null))[_0x9b4e('0x74')](handleError(_0x25dae8,null));};exports['describe']=function(_0x486988,_0x473cde){return db['CmContact']['describe']()[_0x9b4e('0x25')](function(_0x3322d3){for(var _0x24e2ab=0x0;_0x24e2ab\x20?','\x20<\x20?','map','isNil','isEmpty','ListId','c.ListId\x20IN\x20?','concat','filter','replace','\x27\x27\x27\x27','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','order','DESC','c.id','Sequelize','QueryTypes','clone','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','cm_contact_has_tags','left_join','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','sequelize','keyBy','merge','TagIds','ct.CmContactId\x20=\x20c.id','toString','Tags','split','push','catch','find','params','describe','cf_','columnName','displayName','CmCustomField','alias','custom','type','values'];(function(_0x16216a,_0x55226d){var _0x274993=function(_0x5814ef){while(--_0x5814ef){_0x16216a['push'](_0x16216a['shift']());}};_0x274993(++_0x55226d);}(_0xb51e,0x12f));var _0xeb51=function(_0x23d677,_0x22134f){_0x23d677=_0x23d677-0x0;var _0x56a5de=_0xb51e[_0x23d677];return _0x56a5de;};'use strict';var pdf=require(_0xeb51('0x0'));var emlformat=require(_0xeb51('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeb51('0x2'));var rp=require(_0xeb51('0x3'));var moment=require(_0xeb51('0x4'));var BPromise=require(_0xeb51('0x5'));var Mustache=require(_0xeb51('0x6'));var util=require(_0xeb51('0x7'));var path=require(_0xeb51('0x8'));var sox=require(_0xeb51('0x9'));var csv=require(_0xeb51('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeb51('0xb'));var squel=require('squel');var crypto=require(_0xeb51('0xc'));var jsforce=require(_0xeb51('0xd'));var deskjs=require(_0xeb51('0xe'));var toCsv=require(_0xeb51('0xa'));var querystring=require(_0xeb51('0xf'));var Papa=require('papaparse');var Redis=require(_0xeb51('0x10'));var authService=require(_0xeb51('0x11'));var qs=require(_0xeb51('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb51('0x13'))(_0xeb51('0x14'));var utils=require(_0xeb51('0x15'));var config=require(_0xeb51('0x16'));var db=require(_0xeb51('0x17'))['db'];config['redis']=_['defaults'](config[_0xeb51('0x18')],{'host':_0xeb51('0x19'),'port':0x18eb});var socket=require(_0xeb51('0x1a'))(new Redis(config[_0xeb51('0x18')]));require(_0xeb51('0x1b'))[_0xeb51('0x1c')](socket);function respondWithStatusCode(_0x4375c4,_0x1ca440){_0x1ca440=_0x1ca440||0xcc;return function(_0x292ef2){if(_0x292ef2){return _0x4375c4[_0xeb51('0x1d')](_0x1ca440);}return _0x4375c4['status'](_0x1ca440)[_0xeb51('0x1e')]();};}function respondWithResult(_0x2b5aaf,_0x2b0ee2){_0x2b0ee2=_0x2b0ee2||0xc8;return function(_0x1c6748){if(_0x1c6748){return _0x2b5aaf[_0xeb51('0x1f')](_0x2b0ee2)[_0xeb51('0x20')](_0x1c6748);}};}function respondWithFilteredResult(_0xa19fea,_0x2f09a8){return function(_0x412a9e){if(_0x412a9e){var _0x50948f=_0x412a9e[_0xeb51('0x21')],_0x335d3a=_0x2f09a8[_0xeb51('0x22')],_0xeb6d0e=_0x2f09a8['offset']+_0x2f09a8['limit'],_0x12ca74;if(_0xeb6d0e>=_0x50948f){_0xeb6d0e=_0x50948f;_0x12ca74=0xc8;}else{_0x12ca74=0xce;}_0xa19fea['status'](_0x12ca74);return _0xa19fea[_0xeb51('0x23')](_0xeb51('0x24'),_0x335d3a+'-'+_0xeb6d0e+'/'+_0x50948f)[_0xeb51('0x20')](_0x412a9e);}return null;};}function patchUpdates(_0x46fa6c){return function(_0x175fa2){try{jsonpatch['apply'](_0x175fa2,_0x46fa6c,!![]);}catch(_0x9981b8){return BPromise[_0xeb51('0x25')](_0x9981b8);}return _0x175fa2[_0xeb51('0x26')]();};}function saveUpdates(_0x159445,_0x268a30){return function(_0xc42047){if(_0xc42047){return _0xc42047[_0xeb51('0x27')](_0x159445)[_0xeb51('0x28')](function(_0x1a7082){return _0x1a7082;});}return null;};}function removeEntity(_0x632163,_0x21993a){return function(_0x534968){if(_0x534968){return _0x534968[_0xeb51('0x29')]()[_0xeb51('0x28')](function(){_0x632163['status'](0xcc)[_0xeb51('0x1e')]();});}};}function handleEntityNotFound(_0x2afddd,_0x18af0e){return function(_0x1ebb7d){if(!_0x1ebb7d){_0x2afddd[_0xeb51('0x1d')](0x194);}return _0x1ebb7d;};}function handleError(_0x24f7fc,_0x3b8cf1){_0x3b8cf1=_0x3b8cf1||0x1f4;return function(_0xed7b88){logger[_0xeb51('0x2a')](_0xed7b88['stack']);if(_0xed7b88[_0xeb51('0x2b')]){delete _0xed7b88[_0xeb51('0x2b')];}_0x24f7fc[_0xeb51('0x1f')](_0x3b8cf1)[_0xeb51('0x2c')](_0xed7b88);};}exports[_0xeb51('0x2d')]=function(_0x1c48fc,_0xaa433){var _0x321b67={},_0x28933f={},_0x3901cc={'count':0x0,'rows':[]};return db[_0xeb51('0x2e')]['describe']()[_0xeb51('0x28')](function(_0x3df529){_0x28933f[_0xeb51('0x2f')]=_[_0xeb51('0x30')](_0x3df529);_0x28933f[_0xeb51('0x31')]=_[_0xeb51('0x30')](_0x1c48fc[_0xeb51('0x31')]);_0x28933f[_0xeb51('0x32')]=_[_0xeb51('0x33')](_0x28933f[_0xeb51('0x2f')],_0x28933f[_0xeb51('0x31')]);_0x321b67[_0xeb51('0x34')]=_['intersection'](_0x28933f[_0xeb51('0x2f')],qs[_0xeb51('0x35')](_0x1c48fc[_0xeb51('0x31')]['fields']));_0x321b67[_0xeb51('0x34')]=_0x321b67[_0xeb51('0x34')][_0xeb51('0x36')]?_0x321b67['attributes']:_0x28933f[_0xeb51('0x2f')];if(!_0x1c48fc[_0xeb51('0x31')][_0xeb51('0x37')](_0xeb51('0x38'))){_0x321b67[_0xeb51('0x39')]=qs[_0xeb51('0x39')](_0x1c48fc[_0xeb51('0x31')][_0xeb51('0x39')]);_0x321b67['offset']=qs[_0xeb51('0x22')](_0x1c48fc[_0xeb51('0x31')]['offset']);}_0x321b67['order']=qs[_0xeb51('0x3a')](_0x1c48fc['query'][_0xeb51('0x3a')]);_0x321b67[_0xeb51('0x3b')]=qs[_0xeb51('0x32')](_[_0xeb51('0x3c')](_0x1c48fc[_0xeb51('0x31')],_0x28933f[_0xeb51('0x32')]));var _0x4eeb3c=[];var _0x56e132=squel[_0xeb51('0x3d')]()[_0xeb51('0x3e')]('id')[_0xeb51('0x3e')]('name')['field'](_0xeb51('0x3f'))[_0xeb51('0x40')](_0xeb51('0x41'));var _0x282a29=squel[_0xeb51('0x3d')]()[_0xeb51('0x40')](_0xeb51('0x42'),'c')[_0xeb51('0x3b')](_0xeb51('0x43'));var _0x468a39=squel['expr']();if(_0x1c48fc[_0xeb51('0x31')]['advancedFilter']){var _0x36af07=JSON[_0xeb51('0x44')](_0x1c48fc[_0xeb51('0x31')][_0xeb51('0x45')]);_[_0xeb51('0x30')](_0x36af07)[_0xeb51('0x46')](function(_0x4d2c08){var _0x14f4ab=_0x36af07[_0x4d2c08];switch(_0x14f4ab['condition']){case'IS':if(_[_0xeb51('0x47')](_0x14f4ab[_0xeb51('0x48')])&&_0x14f4ab[_0xeb51('0x48')][_0xeb51('0x36')]>0x1){_0x468a39[_0xeb51('0x49')](_0x14f4ab[_0xeb51('0x4a')]+'.'+_0x4d2c08+'\x20IN\x20?',_0x14f4ab[_0xeb51('0x48')]);}else{_0x468a39[_0xeb51('0x49')](_0x14f4ab[_0xeb51('0x4a')]+'.'+_0x4d2c08+_0xeb51('0x4b'),_0x14f4ab[_0xeb51('0x48')][0x0]);}break;case'=':_0x468a39['and'](_0x14f4ab[_0xeb51('0x4a')]+'.'+_0x4d2c08+_0xeb51('0x4b'),_0x14f4ab[_0xeb51('0x48')]);break;case'LIKE':_0x468a39[_0xeb51('0x49')](_0x14f4ab[_0xeb51('0x4a')]+'.'+_0x4d2c08+_0xeb51('0x4c'),'%'+_0x14f4ab['value']+'%');break;case'>':_0x468a39[_0xeb51('0x49')](_0x14f4ab['tableAlias']+'.'+_0x4d2c08+_0xeb51('0x4d'),_0x14f4ab['value']);break;case'<':_0x468a39[_0xeb51('0x49')](_0x14f4ab[_0xeb51('0x4a')]+'.'+_0x4d2c08+_0xeb51('0x4e'),_0x14f4ab[_0xeb51('0x48')]);break;}});}else{var _0x285493=_(Object[_0xeb51('0x30')](_0x1c48fc[_0xeb51('0x31')]))[_0xeb51('0x4f')](function(_0xf2da20){return _0x3df529[_0xeb51('0x37')](_0xf2da20)?_0xf2da20:undefined;})['filter'](function(_0x2beb10){return!_[_0xeb51('0x50')](_0x2beb10);})[_0xeb51('0x48')]();if(!_[_0xeb51('0x51')](_0x285493)){_0x285493['forEach'](function(_0x1ccfd7){if(_0x1ccfd7===_0xeb51('0x52')){_0x282a29[_0xeb51('0x3b')](_0xeb51('0x53'),[][_0xeb51('0x54')](_0x1c48fc[_0xeb51('0x31')][_0x1ccfd7]));}else{_0x282a29['where']('c.'+_0x1ccfd7+_0xeb51('0x4b'),_0x1c48fc[_0xeb51('0x31')][_0x1ccfd7]);}});}if(_0x1c48fc[_0xeb51('0x31')][_0xeb51('0x55')]){var _0x574100=_0x1c48fc[_0xeb51('0x31')][_0xeb51('0x55')][_0xeb51('0x56')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xeb51('0x57'));if(qs[_0xeb51('0x58')](_0x574100)){_0x468a39['or'](_0xeb51('0x59'),_0x574100+'%');_0x468a39['or'](_0xeb51('0x5a'),_0x574100+'%');_0x468a39['or'](_0xeb51('0x5b'),_0x574100+'%');_0x468a39['or'](_0xeb51('0x5c'),_0x574100+'%');}else if(qs[_0xeb51('0x5d')](_0x574100)){_0x468a39['or']('c.email\x20LIKE\x20?',_0x574100+'%');}else{_0x468a39['or']('c.email\x20LIKE\x20?',_0x574100+'%');_0x468a39['or'](_0xeb51('0x5e'),_0x574100+'%');_0x468a39['or']('c.lastName\x20LIKE\x20?',_0x574100+'%');}}}_0x282a29['where'](_0x468a39);if(_0x321b67[_0xeb51('0x5f')]){_0x321b67['order'][_0xeb51('0x46')](function(_0x203c7e){_0x282a29[_0xeb51('0x5f')]('c.'+_0x203c7e[0x0],_0x203c7e[0x1]===_0xeb51('0x60')?![]:!![]);});}_0x282a29['group'](_0xeb51('0x61'));var _0x418242={'type':db[_0xeb51('0x62')][_0xeb51('0x63')]['SELECT'],'raw':!![]};var _0x391bef=_0x282a29[_0xeb51('0x64')]()['field']('COUNT(*)');if(!_0x1c48fc[_0xeb51('0x31')][_0xeb51('0x45')]){if(_0x1c48fc[_0xeb51('0x31')][_0xeb51('0x65')]){var _0x5d341b=_[_0xeb51('0x47')](_0x1c48fc['query'][_0xeb51('0x65')])?_0x1c48fc[_0xeb51('0x31')]['tag']:new Array(_0x1c48fc[_0xeb51('0x31')][_0xeb51('0x65')]);var _0x227d6e=squel[_0xeb51('0x66')]();_0x5d341b[_0xeb51('0x46')](function(_0x2fa8f1){_0x227d6e['or'](_0xeb51('0x67'),'%,'+_0x2fa8f1+',%');});_0x282a29['having'](_0x227d6e);_0x391bef['left_join'](_0xeb51('0x68'),'ct','ct.CmContactId\x20=\x20c.id');_0x391bef[_0xeb51('0x69')](_0xeb51('0x41'),'t',_0xeb51('0x6a'));_0x391bef[_0xeb51('0x3b')](_0xeb51('0x6b'),_0x5d341b);}}db[_0xeb51('0x6c')][_0xeb51('0x31')](_0x56e132['toString'](),_0x418242)[_0xeb51('0x28')](function(_0x16cd67){_0x4eeb3c=_[_0xeb51('0x6d')](_0x16cd67,'id');return db[_0xeb51('0x6c')][_0xeb51('0x31')](_0x391bef['toString'](),_0x418242);})[_0xeb51('0x28')](function(_0x23bda3){_0x3901cc['count']=_0x23bda3[_0xeb51('0x36')];_0x418242=_[_0xeb51('0x6e')](_0x418242,{'model':db[_0xeb51('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x282a29['field']('c.*');_0x282a29[_0xeb51('0x3e')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xeb51('0x6f'));_0x282a29[_0xeb51('0x69')](_0xeb51('0x68'),'ct',_0xeb51('0x70'));_0x282a29['left_join'](_0xeb51('0x41'),'t','t.id\x20=\x20ct.TagId');if(_0x321b67[_0xeb51('0x39')]){_0x282a29['limit'](_0x321b67[_0xeb51('0x39')]);}if(_0x321b67[_0xeb51('0x22')]){_0x282a29['offset'](_0x321b67[_0xeb51('0x22')]);}db[_0xeb51('0x6c')][_0xeb51('0x31')](_0x282a29[_0xeb51('0x71')](),_0x418242)['then'](function(_0x11d3b4){_0x11d3b4[_0xeb51('0x46')](function(_0x4543d7){if(_0x4543d7[_0xeb51('0x6f')]){_0x4543d7[_0xeb51('0x72')]=[];_0x4543d7['TagIds'][_0xeb51('0x73')](',')[_0xeb51('0x46')](function(_0x426c13){_0x4543d7['Tags'][_0xeb51('0x74')](_0x4eeb3c[_0x426c13]);});}delete _0x4543d7[_0xeb51('0x6f')];});_0x3901cc['rows']=_0x11d3b4;return _0x3901cc;})[_0xeb51('0x28')](respondWithFilteredResult(_0xaa433,_0x321b67))[_0xeb51('0x75')](handleError(_0xaa433,null));});});};exports[_0xeb51('0x29')]=function(_0x2d5825,_0x237c5a){return db[_0xeb51('0x2e')][_0xeb51('0x76')]({'where':{'id':_0x2d5825[_0xeb51('0x77')]['id']}})['then'](handleEntityNotFound(_0x237c5a,null))['then'](removeEntity(_0x237c5a,null))[_0xeb51('0x75')](handleError(_0x237c5a,null));};exports[_0xeb51('0x78')]=function(_0x975742,_0x5accda){return db[_0xeb51('0x2e')]['describe']()[_0xeb51('0x28')](function(_0xa44f9e){for(var _0x10d159=0x0;_0x10d159{}\s\\|]/g,'-');_0x56e409(null,util[_0x91cb('0x1a')](_0x91cb('0x1b'),path[_0x91cb('0x1c')](_0x160ded['originalname'],path[_0x91cb('0x1d')](_0x160ded[_0x91cb('0x1e')])),Date[_0x91cb('0x1f')](),path['extname'](_0x160ded[_0x91cb('0x1e')])));}})});router[_0x91cb('0x13')](_0x91cb('0x20'),upload[_0x91cb('0x21')](_0x91cb('0x22')),controller[_0x91cb('0x23')]);var upload=multer({'storage':multer[_0x91cb('0x24')]({'destination':function(_0x423c4f,_0x264e9b,_0x4c8438){_0x4c8438(null,path['join'](config[_0x91cb('0x25')],'server/files/tmp'));},'filename':function(_0x1c67d2,_0x34d372,_0x318031){_0x34d372['originalname']=_0x34d372[_0x91cb('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x318031(null,util[_0x91cb('0x1a')](_0x91cb('0x1b'),path[_0x91cb('0x1c')](_0x34d372[_0x91cb('0x1e')],path[_0x91cb('0x1d')](_0x34d372['originalname'])),Date[_0x91cb('0x1f')](),path['extname'](_0x34d372[_0x91cb('0x1e')])));}})});router[_0x91cb('0x13')](_0x91cb('0x26'),upload['single'](_0x91cb('0x22')),controller[_0x91cb('0x27')]);router[_0x91cb('0x13')](_0x91cb('0x28'),auth[_0x91cb('0x8')](),controller[_0x91cb('0x29')]);router[_0x91cb('0x2a')](_0x91cb('0x2b'),auth[_0x91cb('0x8')](),controller['update']);router[_0x91cb('0x2c')](_0x91cb('0x2b'),auth[_0x91cb('0x8')](),controller[_0x91cb('0x2d')]);module[_0x91cb('0x2e')]=router; \ No newline at end of file +var _0x032e=['isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','root','originalname','replace','format','basename','extname','now','uploadCsv','join','server/files/tmp','/upload','single','file','upload','/upload/:id','import','put','update','delete','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x032e,0x124));var _0xe032=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x032e[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe032('0x3'));var interaction=require(_0xe032('0x4'));var config=require(_0xe032('0x5'));var controller=require(_0xe032('0x6'));router[_0xe032('0x7')]('/',auth[_0xe032('0x8')](),controller[_0xe032('0x9')]);router[_0xe032('0x7')](_0xe032('0xa'),auth[_0xe032('0x8')](),controller[_0xe032('0xb')]);router[_0xe032('0x7')](_0xe032('0xc'),auth[_0xe032('0x8')](),controller[_0xe032('0xd')]);router[_0xe032('0x7')](_0xe032('0xe'),auth[_0xe032('0x8')](),controller['getTags']);router[_0xe032('0x7')](_0xe032('0xf'),auth[_0xe032('0x8')](),controller[_0xe032('0x10')]);router[_0xe032('0x7')](_0xe032('0x11'),auth[_0xe032('0x8')](),controller['getHopperHistories']);router[_0xe032('0x7')](_0xe032('0x12'),auth[_0xe032('0x8')](),controller[_0xe032('0x13')]);router['get'](_0xe032('0x14'),auth[_0xe032('0x8')](),controller[_0xe032('0x15')]);router[_0xe032('0x16')](_0xe032('0x17'),auth[_0xe032('0x8')](),controller[_0xe032('0x18')]);router['post']('/',auth[_0xe032('0x8')](),controller[_0xe032('0x19')]);router[_0xe032('0x16')](_0xe032('0x1a'),auth[_0xe032('0x8')](),controller[_0xe032('0x1b')]);router['post'](_0xe032('0xe'),auth[_0xe032('0x8')](),controller[_0xe032('0x1c')]);var upload=multer({'storage':multer[_0xe032('0x1d')]({'destination':function(_0x208c47,_0x5721ce,_0x4b644b){_0x4b644b(null,path['join'](config[_0xe032('0x1e')],'server/files/tmp'));},'filename':function(_0x46dc27,_0x4608e4,_0x3f0257){_0x4608e4[_0xe032('0x1f')]=_0x4608e4[_0xe032('0x1f')][_0xe032('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3f0257(null,util[_0xe032('0x21')]('%s-%s%s',path[_0xe032('0x22')](_0x4608e4[_0xe032('0x1f')],path[_0xe032('0x23')](_0x4608e4[_0xe032('0x1f')])),Date[_0xe032('0x24')](),path[_0xe032('0x23')](_0x4608e4[_0xe032('0x1f')])));}})});router[_0xe032('0x16')]('/csv',upload['single']('file'),controller[_0xe032('0x25')]);var upload=multer({'storage':multer[_0xe032('0x1d')]({'destination':function(_0x302559,_0x2a56e5,_0x2bfe8f){_0x2bfe8f(null,path[_0xe032('0x26')](config[_0xe032('0x1e')],_0xe032('0x27')));},'filename':function(_0x4dcbf1,_0x1ac20b,_0x5bb36a){_0x1ac20b[_0xe032('0x1f')]=_0x1ac20b[_0xe032('0x1f')][_0xe032('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5bb36a(null,util[_0xe032('0x21')]('%s-%s%s',path['basename'](_0x1ac20b[_0xe032('0x1f')],path[_0xe032('0x23')](_0x1ac20b[_0xe032('0x1f')])),Date[_0xe032('0x24')](),path['extname'](_0x1ac20b['originalname'])));}})});router['post'](_0xe032('0x28'),upload[_0xe032('0x29')](_0xe032('0x2a')),controller[_0xe032('0x2b')]);router['post'](_0xe032('0x2c'),auth[_0xe032('0x8')](),controller[_0xe032('0x2d')]);router[_0xe032('0x2e')](_0xe032('0xc'),auth['isAuthenticated'](),controller[_0xe032('0x2f')]);router[_0xe032('0x30')](_0xe032('0xc'),auth[_0xe032('0x8')](),controller['destroy']);module[_0xe032('0x31')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 3b8a3da..fb764a9 100644 --- a/server/api/cmCustomField/cmCustomField.attributes.js +++ b/server/api/cmCustomField/cmCustomField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5581=['parse','values','isArray','stringify','BOOLEAN','sequelize','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','long','type','select'];(function(_0x39cb92,_0x532326){var _0x2fe207=function(_0x53a898){while(--_0x53a898){_0x39cb92['push'](_0x39cb92['shift']());}};_0x2fe207(++_0x532326);}(_0x5581,0x115));var _0x1558=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x5581[_0x35da42];return _0x370035;};'use strict';var Sequelize=require(_0x1558('0x0'));var _=require('lodash');module[_0x1558('0x1')]={'name':{'type':Sequelize[_0x1558('0x2')],'get':function(_0x24a5be){return this[_0x1558('0x3')](_0x1558('0x4'));}},'alias':{'type':Sequelize[_0x1558('0x5')],'allowNull':![],'set':function(_0x48c6fa){this[_0x1558('0x6')](_0x1558('0x4'),_0x48c6fa?_0x48c6fa:this['getDataValue'](_0x1558('0x7')));}},'type':{'type':Sequelize[_0x1558('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x1558('0x8')),'get':function(){if(this[_0x1558('0x3')](_0x1558('0x9'))===_0x1558('0xa')){return JSON[_0x1558('0xb')](this['getDataValue'](_0x1558('0xc')));}else{return this[_0x1558('0x3')](_0x1558('0xc'));}},'set':function(_0x296193){if(Array[_0x1558('0xd')](_0x296193)){this[_0x1558('0x6')](_0x1558('0xc'),JSON[_0x1558('0xe')](_0x296193));}else{this[_0x1558('0x6')](_0x1558('0xc'),_0x296193);}}},'required':{'type':Sequelize[_0x1558('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x0cab=['select','parse','isArray','values','stringify','lodash','VIRTUAL','STRING','setDataValue','getDataValue','TEXT','long','type'];(function(_0x6d33d2,_0x15e8a9){var _0x52c499=function(_0x5aff12){while(--_0x5aff12){_0x6d33d2['push'](_0x6d33d2['shift']());}};_0x52c499(++_0x15e8a9);}(_0x0cab,0x109));var _0xb0ca=function(_0x44071b,_0x2fa7bb){_0x44071b=_0x44071b-0x0;var _0x589ef9=_0x0cab[_0x44071b];return _0x589ef9;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb0ca('0x0'));module['exports']={'name':{'type':Sequelize[_0xb0ca('0x1')],'get':function(_0x2a69d1){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xb0ca('0x2')],'allowNull':![],'set':function(_0x1becf0){this[_0xb0ca('0x3')]('alias',_0x1becf0?_0x1becf0:this[_0xb0ca('0x4')]('name'));}},'type':{'type':Sequelize[_0xb0ca('0x2')],'allowNull':![]},'values':{'type':Sequelize[_0xb0ca('0x5')](_0xb0ca('0x6')),'get':function(){if(this['getDataValue'](_0xb0ca('0x7'))===_0xb0ca('0x8')){return JSON[_0xb0ca('0x9')](this[_0xb0ca('0x4')]('values'));}else{return this[_0xb0ca('0x4')]('values');}},'set':function(_0x2c7417){if(Array[_0xb0ca('0xa')](_0x2c7417)){this[_0xb0ca('0x3')](_0xb0ca('0xb'),JSON[_0xb0ca('0xc')](_0x2c7417));}else{this['setDataValue'](_0xb0ca('0xb'),_0x2c7417);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index e63577c..b444bb6 100644 --- a/server/api/cmCustomField/cmCustomField.controller.js +++ b/server/api/cmCustomField/cmCustomField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0afa=['stack','name','send','CmCustomField','rawAttributes','model','differenceBy','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','filter','where','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','transaction','Sequelize','TEXT','text','number','defaultValue','sequelize','queryInterface','addColumn','format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','error'];(function(_0xa5bd84,_0x287943){var _0x22bcca=function(_0x13f6f4){while(--_0x13f6f4){_0xa5bd84['push'](_0xa5bd84['shift']());}};_0x22bcca(++_0x287943);}(_0x0afa,0x1c3));var _0xa0af=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0afa[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xa0af('0x0'));var emlformat=require(_0xa0af('0x1'));var rimraf=require(_0xa0af('0x2'));var zipdir=require(_0xa0af('0x3'));var jsonpatch=require(_0xa0af('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa0af('0x5'));var Mustache=require(_0xa0af('0x6'));var util=require(_0xa0af('0x7'));var path=require('path');var sox=require(_0xa0af('0x8'));var csv=require(_0xa0af('0x9'));var ejs=require(_0xa0af('0xa'));var fs=require('fs');var _=require(_0xa0af('0xb'));var squel=require(_0xa0af('0xc'));var crypto=require('crypto');var jsforce=require(_0xa0af('0xd'));var deskjs=require(_0xa0af('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa0af('0xf'));var Redis=require(_0xa0af('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa0af('0x11'));var logger=require(_0xa0af('0x12'))(_0xa0af('0x13'));var utils=require(_0xa0af('0x14'));var config=require('../../config/environment');var db=require(_0xa0af('0x15'))['db'];function respondWithStatusCode(_0x36ace5,_0x51930b){_0x51930b=_0x51930b||0xcc;return function(_0x18fafc){if(_0x18fafc){return _0x36ace5[_0xa0af('0x16')](_0x51930b);}return _0x36ace5[_0xa0af('0x17')](_0x51930b)[_0xa0af('0x18')]();};}function respondWithResult(_0x110ce3,_0x134499){_0x134499=_0x134499||0xc8;return function(_0x112075){if(_0x112075){return _0x110ce3[_0xa0af('0x17')](_0x134499)[_0xa0af('0x19')](_0x112075);}};}function respondWithFilteredResult(_0x5cd3e4,_0x13d4fb){return function(_0x1ab337){if(_0x1ab337){var _0x494d4d=_0x1ab337['count'],_0x13d86e=_0x13d4fb[_0xa0af('0x1a')],_0x1c6b93=_0x13d4fb[_0xa0af('0x1a')]+_0x13d4fb[_0xa0af('0x1b')],_0x20b3d6;if(_0x1c6b93>=_0x494d4d){_0x1c6b93=_0x494d4d;_0x20b3d6=0xc8;}else{_0x20b3d6=0xce;}_0x5cd3e4[_0xa0af('0x17')](_0x20b3d6);return _0x5cd3e4[_0xa0af('0x1c')](_0xa0af('0x1d'),_0x13d86e+'-'+_0x1c6b93+'/'+_0x494d4d)[_0xa0af('0x19')](_0x1ab337);}return null;};}function patchUpdates(_0x2be2a0){return function(_0x5bfda6){try{jsonpatch['apply'](_0x5bfda6,_0x2be2a0,!![]);}catch(_0x33cbd7){return BPromise[_0xa0af('0x1e')](_0x33cbd7);}return _0x5bfda6[_0xa0af('0x1f')]();};}function saveUpdates(_0x548bb3,_0x3eb0f5){return function(_0x2a162c){if(_0x2a162c){return _0x2a162c[_0xa0af('0x20')](_0x548bb3)[_0xa0af('0x21')](function(_0x1e897a){return _0x1e897a;});}return null;};}function removeEntity(_0x49513d,_0x3b810b){return function(_0xe0fd5c){if(_0xe0fd5c){return _0xe0fd5c['destroy']()['then'](function(){_0x49513d[_0xa0af('0x17')](0xcc)[_0xa0af('0x18')]();});}};}function handleEntityNotFound(_0x4cda27,_0x320432){return function(_0x709005){if(!_0x709005){_0x4cda27['sendStatus'](0x194);}return _0x709005;};}function handleError(_0x1146c0,_0x4bf8b0){_0x4bf8b0=_0x4bf8b0||0x1f4;return function(_0x4caa32){logger[_0xa0af('0x22')](_0x4caa32[_0xa0af('0x23')]);if(_0x4caa32[_0xa0af('0x24')]){delete _0x4caa32[_0xa0af('0x24')];}_0x1146c0['status'](_0x4bf8b0)[_0xa0af('0x25')](_0x4caa32);};}exports['index']=function(_0xc9fedb,_0x4ee578){var _0x2b4008={},_0x18bd99={},_0x323359={'count':0x0,'rows':[]};var _0x53eb4b=db[_0xa0af('0x26')][_0xa0af('0x27')];_0x18bd99[_0xa0af('0x28')]=_[_0xa0af('0x29')](_['keys'](_0x53eb4b),[_0xa0af('0x24')]);_0x18bd99[_0xa0af('0x2a')]=_['keys'](_0xc9fedb['query']);_0x18bd99['filters']=_[_0xa0af('0x2b')](_0x18bd99['model'],_0x18bd99['query']);_0x2b4008[_0xa0af('0x2c')]=_[_0xa0af('0x2b')](_0x18bd99[_0xa0af('0x28')],qs[_0xa0af('0x2d')](_0xc9fedb['query']['fields']));_0x2b4008[_0xa0af('0x2c')]=_0x2b4008[_0xa0af('0x2c')][_0xa0af('0x2e')]?_0x2b4008['attributes']:_0x18bd99[_0xa0af('0x28')];if(!_0xc9fedb['query'][_0xa0af('0x2f')]('nolimit')){_0x2b4008[_0xa0af('0x1b')]=qs[_0xa0af('0x1b')](_0xc9fedb[_0xa0af('0x2a')][_0xa0af('0x1b')]);_0x2b4008[_0xa0af('0x1a')]=qs[_0xa0af('0x1a')](_0xc9fedb[_0xa0af('0x2a')]['offset']);}_0x2b4008['order']=qs['sort'](_0xc9fedb[_0xa0af('0x2a')][_0xa0af('0x30')]);_0x2b4008['where']=qs['filters'](_['pick'](_0xc9fedb[_0xa0af('0x2a')],_0x18bd99[_0xa0af('0x31')]));if(_0xc9fedb[_0xa0af('0x2a')][_0xa0af('0x32')]){_0x2b4008[_0xa0af('0x33')]=_[_0xa0af('0x34')](_0x2b4008[_0xa0af('0x33')],{'$or':_[_0xa0af('0x35')](_0x53eb4b,function(_0x326002){if(_0x326002[_0xa0af('0x36')][_0xa0af('0x37')]!==_0xa0af('0x38')){var _0x3dd2f2={};_0x3dd2f2[_0x326002[_0xa0af('0x39')]]={'$like':'%'+_0xc9fedb[_0xa0af('0x2a')][_0xa0af('0x32')]+'%'};return _0x3dd2f2;}})});}_0x2b4008=_[_0xa0af('0x34')]({},_0x2b4008,_0xc9fedb[_0xa0af('0x3a')]);var _0x22a65e={'where':_0x2b4008[_0xa0af('0x33')]};return db[_0xa0af('0x26')][_0xa0af('0x3b')](_0x22a65e)[_0xa0af('0x21')](function(_0x14de76){_0x323359[_0xa0af('0x3b')]=_0x14de76;if(_0xc9fedb[_0xa0af('0x2a')][_0xa0af('0x3c')]){_0x2b4008[_0xa0af('0x3d')]=[{'all':!![]}];}return db['CmCustomField'][_0xa0af('0x3e')](_0x2b4008);})[_0xa0af('0x21')](function(_0xcaac8d){_0x323359[_0xa0af('0x3f')]=_0xcaac8d;return _0x323359;})['then'](respondWithFilteredResult(_0x4ee578,_0x2b4008))[_0xa0af('0x40')](handleError(_0x4ee578,null));};exports[_0xa0af('0x41')]=function(_0x583f82,_0x161642){var _0x370e6b={'raw':!![],'where':{'id':_0x583f82[_0xa0af('0x42')]['id']}},_0x339794={};_0x339794['model']=_[_0xa0af('0x43')](db['CmCustomField'][_0xa0af('0x27')]);_0x339794[_0xa0af('0x2a')]=_[_0xa0af('0x43')](_0x583f82[_0xa0af('0x2a')]);_0x339794[_0xa0af('0x31')]=_[_0xa0af('0x2b')](_0x339794[_0xa0af('0x28')],_0x339794[_0xa0af('0x2a')]);_0x370e6b[_0xa0af('0x2c')]=_['intersection'](_0x339794[_0xa0af('0x28')],qs[_0xa0af('0x2d')](_0x583f82[_0xa0af('0x2a')][_0xa0af('0x2d')]));_0x370e6b[_0xa0af('0x2c')]=_0x370e6b[_0xa0af('0x2c')][_0xa0af('0x2e')]?_0x370e6b[_0xa0af('0x2c')]:_0x339794[_0xa0af('0x28')];if(_0x583f82[_0xa0af('0x2a')][_0xa0af('0x3c')]){_0x370e6b[_0xa0af('0x3d')]=[{'all':!![]}];}_0x370e6b=_[_0xa0af('0x34')]({},_0x370e6b,_0x583f82[_0xa0af('0x3a')]);return db[_0xa0af('0x26')][_0xa0af('0x44')](_0x370e6b)[_0xa0af('0x21')](handleEntityNotFound(_0x161642,null))['then'](respondWithResult(_0x161642,null))[_0xa0af('0x40')](handleError(_0x161642,null));};exports[_0xa0af('0x20')]=function(_0x4e0fb1,_0x432865){if(_0x4e0fb1['body']['id']){delete _0x4e0fb1[_0xa0af('0x45')]['id'];}return db[_0xa0af('0x26')][_0xa0af('0x44')]({'where':{'id':_0x4e0fb1[_0xa0af('0x42')]['id']}})[_0xa0af('0x21')](handleEntityNotFound(_0x432865,null))[_0xa0af('0x21')](saveUpdates(_0x4e0fb1[_0xa0af('0x45')],null))[_0xa0af('0x21')](respondWithResult(_0x432865,null))[_0xa0af('0x40')](handleError(_0x432865,null));};exports['destroy']=function(_0x2faf3f,_0x582640){return db['CmCustomField']['find']({'where':{'id':_0x2faf3f['params']['id']}})[_0xa0af('0x21')](handleEntityNotFound(_0x582640,null))[_0xa0af('0x21')](removeEntity(_0x582640,null))[_0xa0af('0x40')](handleError(_0x582640,null));};exports[_0xa0af('0x46')]=function(_0x4b2eee,_0x540f01){var _0x4128e5;return db['sequelize'][_0xa0af('0x47')](function(_0x4311f6){return db[_0xa0af('0x26')][_0xa0af('0x46')](_0x4b2eee[_0xa0af('0x45')],{'transaction':_0x4311f6})[_0xa0af('0x21')](function(_0x38be5f){_0x4128e5=_0x38be5f;var _0x2aade6={'type':db[_0xa0af('0x48')][_0xa0af('0x49')],'transaction':_0x4311f6};switch(_0x4b2eee[_0xa0af('0x45')]['type']){case _0xa0af('0x4a'):_0x2aade6[_0xa0af('0x36')]=db[_0xa0af('0x48')][_0xa0af('0x49')];break;case _0xa0af('0x4b'):_0x2aade6[_0xa0af('0x36')]=db[_0xa0af('0x48')]['INTEGER'];break;case'switch':_0x2aade6[_0xa0af('0x36')]=db['Sequelize']['BOOLEAN'];_0x2aade6[_0xa0af('0x4c')]=![];break;default:}return db[_0xa0af('0x4d')][_0xa0af('0x4e')][_0xa0af('0x4f')]('cm_contacts',util[_0xa0af('0x50')]('cf_%d',_0x4128e5['id']),_0x2aade6);})[_0xa0af('0x21')](function(){return _0x4128e5;});})['then'](respondWithResult(_0x540f01,0xc9))[_0xa0af('0x40')](handleError(_0x540f01,null));}; \ No newline at end of file +var _0x059a=['sequelize','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','queryInterface','cm_contacts','cf_%d','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','CmCustomField','includeAll','include','findAll','rows','catch','show','find','body','params','destroy','create'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0x059a,0x113));var _0xa059=function(_0x1c3765,_0xc3b431){_0x1c3765=_0x1c3765-0x0;var _0x3ab003=_0x059a[_0x1c3765];return _0x3ab003;};'use strict';var pdf=require(_0xa059('0x0'));var emlformat=require(_0xa059('0x1'));var rimraf=require(_0xa059('0x2'));var zipdir=require(_0xa059('0x3'));var jsonpatch=require(_0xa059('0x4'));var rp=require(_0xa059('0x5'));var moment=require(_0xa059('0x6'));var BPromise=require(_0xa059('0x7'));var Mustache=require(_0xa059('0x8'));var util=require(_0xa059('0x9'));var path=require(_0xa059('0xa'));var sox=require(_0xa059('0xb'));var csv=require('to-csv');var ejs=require(_0xa059('0xc'));var fs=require('fs');var _=require(_0xa059('0xd'));var squel=require(_0xa059('0xe'));var crypto=require(_0xa059('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa059('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa059('0x11'));var Papa=require(_0xa059('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa059('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa059('0x14'))(_0xa059('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa059('0x16'))['db'];function respondWithStatusCode(_0x224542,_0x36a35b){_0x36a35b=_0x36a35b||0xcc;return function(_0x5a9697){if(_0x5a9697){return _0x224542[_0xa059('0x17')](_0x36a35b);}return _0x224542['status'](_0x36a35b)[_0xa059('0x18')]();};}function respondWithResult(_0xf6f72f,_0x31f943){_0x31f943=_0x31f943||0xc8;return function(_0x21bdd2){if(_0x21bdd2){return _0xf6f72f[_0xa059('0x19')](_0x31f943)[_0xa059('0x1a')](_0x21bdd2);}};}function respondWithFilteredResult(_0x2fedf2,_0x49f2d8){return function(_0x30dd56){if(_0x30dd56){var _0x264341=_0x30dd56[_0xa059('0x1b')],_0x5e6c3d=_0x49f2d8['offset'],_0x1f912c=_0x49f2d8['offset']+_0x49f2d8[_0xa059('0x1c')],_0x5a5d7d;if(_0x1f912c>=_0x264341){_0x1f912c=_0x264341;_0x5a5d7d=0xc8;}else{_0x5a5d7d=0xce;}_0x2fedf2['status'](_0x5a5d7d);return _0x2fedf2[_0xa059('0x1d')](_0xa059('0x1e'),_0x5e6c3d+'-'+_0x1f912c+'/'+_0x264341)[_0xa059('0x1a')](_0x30dd56);}return null;};}function patchUpdates(_0x52428b){return function(_0x1503aa){try{jsonpatch[_0xa059('0x1f')](_0x1503aa,_0x52428b,!![]);}catch(_0x323c19){return BPromise[_0xa059('0x20')](_0x323c19);}return _0x1503aa[_0xa059('0x21')]();};}function saveUpdates(_0x2a1275,_0x5db880){return function(_0x220f61){if(_0x220f61){return _0x220f61[_0xa059('0x22')](_0x2a1275)[_0xa059('0x23')](function(_0x1cc649){return _0x1cc649;});}return null;};}function removeEntity(_0x11b8b0,_0x342eeb){return function(_0x2a120e){if(_0x2a120e){return _0x2a120e['destroy']()[_0xa059('0x23')](function(){_0x11b8b0[_0xa059('0x19')](0xcc)[_0xa059('0x18')]();});}};}function handleEntityNotFound(_0x9e501b,_0x29019e){return function(_0x48ce28){if(!_0x48ce28){_0x9e501b[_0xa059('0x17')](0x194);}return _0x48ce28;};}function handleError(_0x10a274,_0x1658eb){_0x1658eb=_0x1658eb||0x1f4;return function(_0x2fbb3d){logger[_0xa059('0x24')](_0x2fbb3d[_0xa059('0x25')]);if(_0x2fbb3d[_0xa059('0x26')]){delete _0x2fbb3d['name'];}_0x10a274[_0xa059('0x19')](_0x1658eb)[_0xa059('0x27')](_0x2fbb3d);};}exports[_0xa059('0x28')]=function(_0x41bcb4,_0x4e0bec){var _0x321e6a={},_0x1ff90c={},_0x59e142={'count':0x0,'rows':[]};var _0x34d04f=db['CmCustomField'][_0xa059('0x29')];_0x1ff90c[_0xa059('0x2a')]=_[_0xa059('0x2b')](_[_0xa059('0x2c')](_0x34d04f),[_0xa059('0x26')]);_0x1ff90c[_0xa059('0x2d')]=_[_0xa059('0x2c')](_0x41bcb4[_0xa059('0x2d')]);_0x1ff90c[_0xa059('0x2e')]=_[_0xa059('0x2f')](_0x1ff90c[_0xa059('0x2a')],_0x1ff90c[_0xa059('0x2d')]);_0x321e6a[_0xa059('0x30')]=_['intersection'](_0x1ff90c[_0xa059('0x2a')],qs['fields'](_0x41bcb4['query'][_0xa059('0x31')]));_0x321e6a[_0xa059('0x30')]=_0x321e6a[_0xa059('0x30')][_0xa059('0x32')]?_0x321e6a[_0xa059('0x30')]:_0x1ff90c['model'];if(!_0x41bcb4[_0xa059('0x2d')][_0xa059('0x33')](_0xa059('0x34'))){_0x321e6a[_0xa059('0x1c')]=qs['limit'](_0x41bcb4['query'][_0xa059('0x1c')]);_0x321e6a[_0xa059('0x35')]=qs[_0xa059('0x35')](_0x41bcb4[_0xa059('0x2d')][_0xa059('0x35')]);}_0x321e6a['order']=qs[_0xa059('0x36')](_0x41bcb4[_0xa059('0x2d')][_0xa059('0x36')]);_0x321e6a[_0xa059('0x37')]=qs[_0xa059('0x2e')](_[_0xa059('0x38')](_0x41bcb4[_0xa059('0x2d')],_0x1ff90c['filters']));if(_0x41bcb4[_0xa059('0x2d')][_0xa059('0x39')]){_0x321e6a[_0xa059('0x37')]=_[_0xa059('0x3a')](_0x321e6a['where'],{'$or':_[_0xa059('0x3b')](_0x34d04f,function(_0x1ca10f){if(_0x1ca10f[_0xa059('0x3c')][_0xa059('0x3d')]!==_0xa059('0x3e')){var _0xd9be17={};_0xd9be17[_0x1ca10f[_0xa059('0x3f')]]={'$like':'%'+_0x41bcb4['query']['filter']+'%'};return _0xd9be17;}})});}_0x321e6a=_[_0xa059('0x3a')]({},_0x321e6a,_0x41bcb4[_0xa059('0x40')]);var _0x3937b6={'where':_0x321e6a[_0xa059('0x37')]};return db[_0xa059('0x41')][_0xa059('0x1b')](_0x3937b6)[_0xa059('0x23')](function(_0x37f5af){_0x59e142[_0xa059('0x1b')]=_0x37f5af;if(_0x41bcb4[_0xa059('0x2d')][_0xa059('0x42')]){_0x321e6a[_0xa059('0x43')]=[{'all':!![]}];}return db[_0xa059('0x41')][_0xa059('0x44')](_0x321e6a);})[_0xa059('0x23')](function(_0x42213b){_0x59e142[_0xa059('0x45')]=_0x42213b;return _0x59e142;})[_0xa059('0x23')](respondWithFilteredResult(_0x4e0bec,_0x321e6a))[_0xa059('0x46')](handleError(_0x4e0bec,null));};exports[_0xa059('0x47')]=function(_0x3e01af,_0x138cb0){var _0x53bdfb={'raw':!![],'where':{'id':_0x3e01af['params']['id']}},_0x2a74c1={};_0x2a74c1[_0xa059('0x2a')]=_['keys'](db['CmCustomField'][_0xa059('0x29')]);_0x2a74c1[_0xa059('0x2d')]=_[_0xa059('0x2c')](_0x3e01af[_0xa059('0x2d')]);_0x2a74c1[_0xa059('0x2e')]=_[_0xa059('0x2f')](_0x2a74c1['model'],_0x2a74c1[_0xa059('0x2d')]);_0x53bdfb['attributes']=_['intersection'](_0x2a74c1[_0xa059('0x2a')],qs[_0xa059('0x31')](_0x3e01af[_0xa059('0x2d')][_0xa059('0x31')]));_0x53bdfb['attributes']=_0x53bdfb[_0xa059('0x30')][_0xa059('0x32')]?_0x53bdfb[_0xa059('0x30')]:_0x2a74c1[_0xa059('0x2a')];if(_0x3e01af['query']['includeAll']){_0x53bdfb[_0xa059('0x43')]=[{'all':!![]}];}_0x53bdfb=_[_0xa059('0x3a')]({},_0x53bdfb,_0x3e01af[_0xa059('0x40')]);return db['CmCustomField'][_0xa059('0x48')](_0x53bdfb)[_0xa059('0x23')](handleEntityNotFound(_0x138cb0,null))[_0xa059('0x23')](respondWithResult(_0x138cb0,null))[_0xa059('0x46')](handleError(_0x138cb0,null));};exports[_0xa059('0x22')]=function(_0x145345,_0x3a65c7){if(_0x145345[_0xa059('0x49')]['id']){delete _0x145345[_0xa059('0x49')]['id'];}return db[_0xa059('0x41')][_0xa059('0x48')]({'where':{'id':_0x145345[_0xa059('0x4a')]['id']}})[_0xa059('0x23')](handleEntityNotFound(_0x3a65c7,null))['then'](saveUpdates(_0x145345[_0xa059('0x49')],null))[_0xa059('0x23')](respondWithResult(_0x3a65c7,null))[_0xa059('0x46')](handleError(_0x3a65c7,null));};exports[_0xa059('0x4b')]=function(_0x4610d2,_0x3f47d6){return db[_0xa059('0x41')]['find']({'where':{'id':_0x4610d2['params']['id']}})[_0xa059('0x23')](handleEntityNotFound(_0x3f47d6,null))[_0xa059('0x23')](removeEntity(_0x3f47d6,null))[_0xa059('0x46')](handleError(_0x3f47d6,null));};exports[_0xa059('0x4c')]=function(_0x23b400,_0x584c87){var _0x59b671;return db[_0xa059('0x4d')]['transaction'](function(_0x4437ee){return db['CmCustomField'][_0xa059('0x4c')](_0x23b400[_0xa059('0x49')],{'transaction':_0x4437ee})[_0xa059('0x23')](function(_0x4932da){_0x59b671=_0x4932da;var _0x57911a={'type':db[_0xa059('0x4e')][_0xa059('0x4f')],'transaction':_0x4437ee};switch(_0x23b400[_0xa059('0x49')]['type']){case _0xa059('0x50'):_0x57911a[_0xa059('0x3c')]=db[_0xa059('0x4e')][_0xa059('0x4f')];break;case _0xa059('0x51'):_0x57911a[_0xa059('0x3c')]=db[_0xa059('0x4e')][_0xa059('0x52')];break;case _0xa059('0x53'):_0x57911a[_0xa059('0x3c')]=db['Sequelize']['BOOLEAN'];_0x57911a[_0xa059('0x54')]=![];break;default:}return db[_0xa059('0x4d')][_0xa059('0x55')]['addColumn'](_0xa059('0x56'),util['format'](_0xa059('0x57'),_0x59b671['id']),_0x57911a);})[_0xa059('0x23')](function(){return _0x59b671;});})[_0xa059('0x23')](respondWithResult(_0x584c87,0xc9))[_0xa059('0x46')](handleError(_0x584c87,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index d5190b4..03600ff 100644 --- a/server/api/cmCustomField/cmCustomField.model.js +++ b/server/api/cmCustomField/cmCustomField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeeeb=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','lodash','util','../../config/logger'];(function(_0x5ec334,_0x20923c){var _0x311347=function(_0x327185){while(--_0x327185){_0x5ec334['push'](_0x5ec334['shift']());}};_0x311347(++_0x20923c);}(_0xeeeb,0x1d9));var _0xbeee=function(_0x218fb2,_0x73dded){_0x218fb2=_0x218fb2-0x0;var _0x4462bf=_0xeeeb[_0x218fb2];return _0x4462bf;};'use strict';var _=require(_0xbeee('0x0'));var util=require(_0xbeee('0x1'));var logger=require(_0xbeee('0x2'))(_0xbeee('0x3'));var moment=require(_0xbeee('0x4'));var BPromise=require(_0xbeee('0x5'));var rp=require(_0xbeee('0x6'));var fs=require('fs');var path=require(_0xbeee('0x7'));var rimraf=require(_0xbeee('0x8'));var config=require(_0xbeee('0x9'));var attributes=require(_0xbeee('0xa'));module[_0xbeee('0xb')]=function(_0xe5c536,_0x47a187){return _0xe5c536['define'](_0xbeee('0xc'),attributes,{'tableName':_0xbeee('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x237d=['exports','CmCustomField','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x2d580b,_0x2b11f3){var _0x7c1374=function(_0x4c1a85){while(--_0x4c1a85){_0x2d580b['push'](_0x2d580b['shift']());}};_0x7c1374(++_0x2b11f3);}(_0x237d,0x1ea));var _0xd237=function(_0x4d3ca6,_0xc33ee5){_0x4d3ca6=_0x4d3ca6-0x0;var _0x46c604=_0x237d[_0x4d3ca6];return _0x46c604;};'use strict';var _=require(_0xd237('0x0'));var util=require('util');var logger=require(_0xd237('0x1'))(_0xd237('0x2'));var moment=require('moment');var BPromise=require(_0xd237('0x3'));var rp=require(_0xd237('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd237('0x5'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0xd237('0x6')]=function(_0x26363e,_0x2c9f7e){return _0x26363e['define'](_0xd237('0x7'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index ab1be01..5ef5e3f 100644 --- a/server/api/cmCustomField/cmCustomField.rpc.js +++ b/server/api/cmCustomField/cmCustomField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f0d=['CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent'];(function(_0x1bb33a,_0xfe364c){var _0x30cad1=function(_0x20430d){while(--_0x20430d){_0x1bb33a['push'](_0x1bb33a['shift']());}};_0x30cad1(++_0xfe364c);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x565387,_0x39b89a){_0x565387=_0x565387-0x0;var _0x33cdfb=_0x6f0d[_0x565387];return _0x33cdfb;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe21ac4,_0x1af29c,_0x8b89a9){return new BPromise(function(_0x1a48a0,_0x4c4916){return client['request'](_0xe21ac4,_0x8b89a9)[_0xd6f0('0xa')](function(_0x272c4e){logger[_0xd6f0('0xb')](_0xd6f0('0xc'),_0x1af29c,_0xd6f0('0xd'));logger['debug'](_0xd6f0('0xe'),_0x1af29c,_0xd6f0('0xd'),JSON[_0xd6f0('0xf')](_0x272c4e));if(_0x272c4e[_0xd6f0('0x10')]){if(_0x272c4e['error'][_0xd6f0('0x11')]===0x1f4){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);return _0x4c4916(_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);}logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e['error'][_0xd6f0('0x12')]);return _0x1a48a0(_0x272c4e[_0xd6f0('0x10')]['message']);}else{logger[_0xd6f0('0xb')]('CmCustomField,\x20%s,\x20%s',_0x1af29c,_0xd6f0('0xd'));_0x1a48a0(_0x272c4e[_0xd6f0('0x13')][_0xd6f0('0x12')]);}})[_0xd6f0('0x14')](function(_0x64ff5f){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x64ff5f);_0x4c4916(_0x64ff5f);});});} \ No newline at end of file +var _0xc6d8=['debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent'];(function(_0x1f29a4,_0x2c7667){var _0x37ff73=function(_0x66b26){while(--_0x66b26){_0x1f29a4['push'](_0x1f29a4['shift']());}};_0x37ff73(++_0x2c7667);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0xc6d8[_0x2850c0];return _0x21e830;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('CmCustomField,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 010bada..18fc1d2 100644 --- a/server/api/cmCustomField/index.js +++ b/server/api/cmCustomField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d98=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x109294,_0x5db2a7){var _0x3f0c24=function(_0x54c324){while(--_0x54c324){_0x109294['push'](_0x109294['shift']());}};_0x3f0c24(++_0x5db2a7);}(_0x9d98,0x13e));var _0x89d9=function(_0x5a0dd6,_0x4b8bc8){_0x5a0dd6=_0x5a0dd6-0x0;var _0x233b9c=_0x9d98[_0x5a0dd6];return _0x233b9c;};'use strict';var multer=require(_0x89d9('0x0'));var util=require(_0x89d9('0x1'));var path=require(_0x89d9('0x2'));var timeout=require(_0x89d9('0x3'));var express=require('express');var router=express[_0x89d9('0x4')]();var auth=require(_0x89d9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x89d9('0x6'));var controller=require(_0x89d9('0x7'));router[_0x89d9('0x8')]('/',auth['isAuthenticated'](),controller[_0x89d9('0x9')]);router['get'](_0x89d9('0xa'),auth[_0x89d9('0xb')](),controller[_0x89d9('0xc')]);router[_0x89d9('0xd')]('/',auth[_0x89d9('0xb')](),controller[_0x89d9('0xe')]);router[_0x89d9('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x89d9('0x10')]);router[_0x89d9('0x11')]('/:id',auth[_0x89d9('0xb')](),controller[_0x89d9('0x12')]);module[_0x89d9('0x13')]=router; \ No newline at end of file +var _0x36f9=['../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x36f9,0x7f));var _0x936f=function(_0x37a042,_0x2c307a){_0x37a042=_0x37a042-0x0;var _0x19a727=_0x36f9[_0x37a042];return _0x19a727;};'use strict';var multer=require('multer');var util=require(_0x936f('0x0'));var path=require(_0x936f('0x1'));var timeout=require(_0x936f('0x2'));var express=require(_0x936f('0x3'));var router=express[_0x936f('0x4')]();var auth=require(_0x936f('0x5'));var interaction=require(_0x936f('0x6'));var config=require(_0x936f('0x7'));var controller=require(_0x936f('0x8'));router[_0x936f('0x9')]('/',auth[_0x936f('0xa')](),controller[_0x936f('0xb')]);router[_0x936f('0x9')](_0x936f('0xc'),auth[_0x936f('0xa')](),controller[_0x936f('0xd')]);router['post']('/',auth[_0x936f('0xa')](),controller[_0x936f('0xe')]);router[_0x936f('0xf')](_0x936f('0xc'),auth[_0x936f('0xa')](),controller[_0x936f('0x10')]);router[_0x936f('0x11')](_0x936f('0xc'),auth['isAuthenticated'](),controller[_0x936f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 7af59ba..becab2a 100644 --- a/server/api/cmHopper/cmHopper.attributes.js +++ b/server/api/cmHopper/cmHopper.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45a7=['DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','moment','sequelize','exports','STRING','BOOLEAN'];(function(_0x371145,_0x271b3d){var _0x583fae=function(_0x596df7){while(--_0x596df7){_0x371145['push'](_0x371145['shift']());}};_0x583fae(++_0x271b3d);}(_0x45a7,0x17e));var _0x745a=function(_0x496997,_0x5a576c){_0x496997=_0x496997-0x0;var _0x3d16b2=_0x45a7[_0x496997];return _0x3d16b2;};'use strict';var moment=require(_0x745a('0x0'));var Sequelize=require(_0x745a('0x1'));module[_0x745a('0x2')]={'phone':{'type':Sequelize[_0x745a('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x745a('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x745a('0x5')],'defaultValue':moment()['format'](_0x745a('0x6'))},'countbusyretry':{'type':Sequelize[_0x745a('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x745a('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x745a('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x745a('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x745a('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x745a('0x5')]},'priority':{'type':Sequelize[_0x745a('0x7')](0x2)[_0x745a('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x745a('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x745a('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x745a('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x745a('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x745a('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x745a('0x7')]}}; \ No newline at end of file +var _0xc99e=['INTEGER','STRING','UNSIGNED','contactListQueue','moment','sequelize','BOOLEAN','DATE','format'];(function(_0x13cb79,_0x4957d8){var _0x427366=function(_0x562724){while(--_0x562724){_0x13cb79['push'](_0x13cb79['shift']());}};_0x427366(++_0x4957d8);}(_0xc99e,0x1d8));var _0xec99=function(_0x5c9cc9,_0x1feffa){_0x5c9cc9=_0x5c9cc9-0x0;var _0x4d5ddb=_0xc99e[_0x5c9cc9];return _0x4d5ddb;};'use strict';var moment=require(_0xec99('0x0'));var Sequelize=require(_0xec99('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xec99('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xec99('0x3')],'defaultValue':moment()[_0xec99('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xec99('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xec99('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xec99('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xec99('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xec99('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xec99('0x5')],'unique':_0xec99('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xec99('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xec99('0x8')},'CampaignId':{'type':Sequelize[_0xec99('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 5b1fa12..cd45fca 100644 --- a/server/api/cmHopper/cmHopper.controller.js +++ b/server/api/cmHopper/cmHopper.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['CmHopper,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmHopper','rawAttributes','model','keys','query','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','Campaign','name','dataValues','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','CmContact','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','map','direction','prev','isEmpty','hopperIds','priority','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledAt','findOne','LOCK','Contact','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','preview','isNumber'];(function(_0x5334c4,_0x382168){var _0x2ed125=function(_0x2d7fb7){while(--_0x2d7fb7){_0x5334c4['push'](_0x5334c4['shift']());}};_0x2ed125(++_0x382168);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_[_0x0a9e('0x2a')](_0x479bc4['filters'],[_0x0a9e('0x2b'),_0x0a9e('0x2c'),_0x0a9e('0x2d'),_0x0a9e('0x2e'),_0x0a9e('0x2f'),_0x0a9e('0x30'),_0x0a9e('0x31'),_0x0a9e('0x32'),_0x0a9e('0x33'),'$between',_0x0a9e('0x34'),'$in',_0x0a9e('0x35'),_0x0a9e('0x36'),_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39'),'$like',_0x0a9e('0x3a'),_0x0a9e('0x3b'),_0x0a9e('0x3c'),_0x0a9e('0x3d')]);_0x384319[_0x0a9e('0x3e')]=_[_0x0a9e('0x3f')](_0x479bc4[_0x0a9e('0x26')],qs[_0x0a9e('0x40')](_0x33161b['query'][_0x0a9e('0x40')]));_0x384319['attributes']=_0x384319[_0x0a9e('0x3e')][_0x0a9e('0x41')]?_0x384319[_0x0a9e('0x3e')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b['query'][_0x0a9e('0x42')](_0x0a9e('0x43'))){_0x384319[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x33161b['query']['limit']);_0x384319[_0x0a9e('0x18')]=qs['offset'](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x44')]=qs[_0x0a9e('0x45')](_0x33161b['query'][_0x0a9e('0x45')]);_0x384319[_0x0a9e('0x46')]=qs[_0x0a9e('0x29')](_['pick'](_0x33161b[_0x0a9e('0x28')],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b[_0x0a9e('0x28')]['filter']){_0x384319['where']=_[_0x0a9e('0x47')](_0x384319[_0x0a9e('0x46')],{'$or':_['map'](_0x5bfb33,function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x48')][_0x0a9e('0x49')]!==_0x0a9e('0x4a')){var _0x4b38d9={};_0x4b38d9[_0x2b814e['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x4b')]+'%'};return _0x4b38d9;}})});}_0x384319=_['merge']({},_0x384319,_0x33161b[_0x0a9e('0x4c')]);var _0x1dec2e={'where':_0x384319[_0x0a9e('0x46')]};return db['CmHopper'][_0x0a9e('0x17')](_0x1dec2e)[_0x0a9e('0x1f')](function(_0x274e8e){_0x45a1e7[_0x0a9e('0x17')]=_0x274e8e;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x4d')]){_0x384319[_0x0a9e('0x4e')]=[{'all':!![]}];}return db[_0x0a9e('0x24')][_0x0a9e('0x4f')](_0x384319);})[_0x0a9e('0x1f')](function(_0x2c3711){_0x45a1e7[_0x0a9e('0x50')]=_0x2c3711;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x51')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x52')]=function(_0x4d04c8,_0x52628e){var _0x473fdc={'raw':!![],'where':{'id':_0x4d04c8[_0x0a9e('0x53')]['id']}},_0xb3795a={};_0xb3795a[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0xb3795a[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x4d04c8[_0x0a9e('0x28')]);_0xb3795a[_0x0a9e('0x29')]=_[_0x0a9e('0x3f')](_0xb3795a['model'],_0xb3795a[_0x0a9e('0x28')]);_0x473fdc[_0x0a9e('0x3e')]=_[_0x0a9e('0x3f')](_0xb3795a[_0x0a9e('0x26')],qs[_0x0a9e('0x40')](_0x4d04c8[_0x0a9e('0x28')][_0x0a9e('0x40')]));_0x473fdc[_0x0a9e('0x3e')]=_0x473fdc['attributes'][_0x0a9e('0x41')]?_0x473fdc['attributes']:_0xb3795a[_0x0a9e('0x26')];if(_0x4d04c8[_0x0a9e('0x28')][_0x0a9e('0x4d')]){_0x473fdc['include']=[{'all':!![]}];}_0x473fdc=_[_0x0a9e('0x47')]({},_0x473fdc,_0x4d04c8[_0x0a9e('0x4c')]);return db[_0x0a9e('0x24')][_0x0a9e('0x54')](_0x473fdc)[_0x0a9e('0x1f')](handleEntityNotFound(_0x52628e,null))[_0x0a9e('0x1f')](respondWithResult(_0x52628e,null))[_0x0a9e('0x51')](handleError(_0x52628e,null));};exports['create']=function(_0x13f44d,_0x1bde3c){return db[_0x0a9e('0x24')][_0x0a9e('0x55')](_0x13f44d[_0x0a9e('0x56')],{})[_0x0a9e('0x1f')](respondWithResult(_0x1bde3c,0xc9))[_0x0a9e('0x51')](handleError(_0x1bde3c,null));};exports[_0x0a9e('0x57')]=function(_0x34febd,_0x58a5c2){if(_0x34febd[_0x0a9e('0x56')]['id']){delete _0x34febd[_0x0a9e('0x56')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x34febd['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x58a5c2,null))[_0x0a9e('0x1f')](saveUpdates(_0x34febd[_0x0a9e('0x56')],null))[_0x0a9e('0x1f')](respondWithResult(_0x58a5c2,null))[_0x0a9e('0x51')](handleError(_0x58a5c2,null));};exports[_0x0a9e('0x58')]=function(_0x2e5165,_0x375c18){return db['CmHopper']['describe']()['then'](respondWithResult(_0x375c18,null))[_0x0a9e('0x51')](handleError(_0x375c18,null));};exports[_0x0a9e('0x59')]=function(_0x14d602,_0x5bb3ed){var _0x2b69d9;return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x14d602['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5bb3ed,null))['then'](function(_0x443e72){if(_0x443e72){return _0x443e72['destroy']()[_0x0a9e('0x1f')](function(_0x3c20b2){return _0x3c20b2;});}})[_0x0a9e('0x1f')](function(_0x53613a){_0x2b69d9=_0x53613a;if(_0x53613a){if(_0x53613a[_0x0a9e('0x5a')]||_0x53613a[_0x0a9e('0x5b')]){return db[_0x53613a['VoiceQueueId']?'VoiceQueue':_0x0a9e('0x5c')][_0x0a9e('0x54')]({'where':{'id':_0x53613a['VoiceQueueId']?_0x53613a[_0x0a9e('0x5a')]:_0x53613a['CampaignId']},'attributes':['id',_0x0a9e('0x5d')],'raw':!![]});}}})['then'](function(_0xe22ccc){var _0x4a6deb={};if(_0xe22ccc){_['merge'](_0x4a6deb,_['omit'](_0x2b69d9[_0x0a9e('0x5e')],['createdAt',_0x0a9e('0x5f'),'id']));_0x4a6deb[_0x0a9e('0x60')]=0x15;_0x4a6deb[_0x0a9e('0x61')]=_0x0a9e('0x62');_0x4a6deb[_0x0a9e('0x63')]=_0xe22ccc[_0x0a9e('0x5d')];_0x4a6deb[_0x0a9e('0x64')]=_0x14d602[_0x0a9e('0x65')]['name'];_0x4a6deb[_0x0a9e('0x66')]=_0x14d602[_0x0a9e('0x65')]['id'];_0x4a6deb[_0x0a9e('0x62')]=!![];_0x4a6deb[_0x0a9e('0x67')]=moment()[_0x0a9e('0x68')](_0x0a9e('0x69'));_0x4a6deb['calleridnum']=_0x2b69d9[_0x0a9e('0x6a')];_0x4a6deb[_0x0a9e('0x6b')]=_0x2b69d9['VoiceQueueId']?_0x0a9e('0x6c'):'ivr';return db[_0x0a9e('0x6d')]['find']({'where':{'id':_0x4a6deb['ContactId']},'attributes':['firstName',_0x0a9e('0x6e')]})['then'](function(_0x2244d6){if(!_[_0x0a9e('0x6f')](_0x5bb3ed)&&!_[_0x0a9e('0x6f')](_0x2244d6[_0x0a9e('0x70')])){_0x4a6deb[_0x0a9e('0x71')]=_0x2244d6[_0x0a9e('0x70')];if(!_['isNil'](_0x2244d6[_0x0a9e('0x6e')])){_0x4a6deb['calleridname']+='\x20'+_0x2244d6[_0x0a9e('0x6e')];}}})[_0x0a9e('0x72')](function(){return db[_0x0a9e('0x73')]['create'](_0x4a6deb);});}})[_0x0a9e('0x1f')](function(){return _0x5bb3ed[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();})[_0x0a9e('0x51')](handleError(_0x5bb3ed,null));};exports['getPreview']=function(_0x1d0dc8,_0xe05a5a,_0x54327c){var _0x797b45=[];return db[_0x0a9e('0x6d')][_0x0a9e('0x58')]()[_0x0a9e('0x1f')](function(_0x401837){_0x797b45=_['keys'](_0x401837);return _0x1d0dc8[_0x0a9e('0x65')][_0x0a9e('0x74')]({'where':{'type':_0x0a9e('0x75'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x0a9e('0x76')],'raw':!![]});})['then'](function(_0x5211e3){if(_0x5211e3&&_0x5211e3[_0x0a9e('0x41')]){return db[_0x0a9e('0x77')][_0x0a9e('0x78')](function(_0x19c995){var _0x186f39={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a9e('0x68')](_0x0a9e('0x69'))},'VoiceQueueId':{'$in':_[_0x0a9e('0x79')](_0x5211e3,'id')},'$or':[{'UserId':null},{'UserId':_0x1d0dc8[_0x0a9e('0x65')]['id']}]};var _0x1cc4f3=[];if(_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7a')]&&_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7a')]===_0x0a9e('0x7b')){if(!_[_0x0a9e('0x7c')](_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7d')])){_0x186f39['id']={'$in':_0x1d0dc8['body'][_0x0a9e('0x7d')]};}_0x1cc4f3=[[_0x0a9e('0x7e'),_0x0a9e('0x7f')],['scheduledAt',_0x5211e3[0x0][_0x0a9e('0x76')]===_0x0a9e('0x7f')?'DESC':_0x0a9e('0x7f')],db[_0x0a9e('0x77')][_0x0a9e('0x80')](_0x0a9e('0x81')),['id',_0x0a9e('0x82')]];}else{if(!_['isEmpty'](_0x1d0dc8['body']['hopperIds'])){_0x186f39['id']={'$notIn':_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7d')]};}_0x1cc4f3=[[_0x0a9e('0x7e'),_0x0a9e('0x82')],[_0x0a9e('0x83'),_0x5211e3[0x0][_0x0a9e('0x76')]],db[_0x0a9e('0x77')][_0x0a9e('0x80')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x0a9e('0x7f')]];}return db[_0x0a9e('0x24')][_0x0a9e('0x84')]({'attributes':['id','scheduledat'],'where':_0x186f39,'order':_0x1cc4f3,'transaction':_0x19c995,'lock':_0x19c995[_0x0a9e('0x85')]['UPDATE'],'include':[{'model':db[_0x0a9e('0x6d')],'as':_0x0a9e('0x86'),'attributes':_0x797b45,'include':[{'model':db['CmCompany'],'as':_0x0a9e('0x87'),'attributes':['id',_0x0a9e('0x5d')]}]},{'model':db[_0x0a9e('0x88')],'as':_0x0a9e('0x89'),'attributes':['id','name']},{'model':db[_0x0a9e('0x8a')],'as':_0x0a9e('0x8b'),'attributes':['id',_0x0a9e('0x5d'),_0x0a9e('0x8c')]}]})['then'](function(_0x109ccb){if(_0x109ccb){return _0x109ccb[_0x0a9e('0x57')]({'UserId':_0x1d0dc8[_0x0a9e('0x65')]['id']},{'transaction':_0x19c995});}});});}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xe05a5a,null))['then'](respondWithResult(_0xe05a5a,null))[_0x0a9e('0x51')](handleError(_0xe05a5a,null));};exports[_0x0a9e('0x8d')]=function(_0x30a4c7,_0xf410e5,_0x332367){return _0x30a4c7[_0x0a9e('0x65')][_0x0a9e('0x74')]({'where':{'type':_0x0a9e('0x75'),'dialActive':!![],'dialMethod':_0x0a9e('0x8e')},'attributes':['id'],'raw':!![]})[_0x0a9e('0x1f')](function(_0xc4c230){if(_0xc4c230&&_0xc4c230[_0x0a9e('0x41')]){return db[_0x0a9e('0x24')][_0x0a9e('0x17')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x0a9e('0x69'))},'VoiceQueueId':{'$in':_[_0x0a9e('0x79')](_0xc4c230,'id')},'$or':[{'UserId':null},{'UserId':_0x30a4c7[_0x0a9e('0x65')]['id']}]}});}return 0x0;})['then'](function(_0x3736e0){if(!_[_0x0a9e('0x6f')](_0x3736e0)&&_[_0x0a9e('0x8f')](_0x3736e0)){return _0xf410e5[_0x0a9e('0x14')](0xc8)['json']({'contacts':_0x3736e0});}else{logger['error'](_0x0a9e('0x90'),_0x0a9e('0x8d'),0x194,'entity\x20not\x20found');_0xf410e5[_0x0a9e('0x13')](0x194);}})['catch'](handleError(_0xf410e5,null));}; \ No newline at end of file +var _0xa9e0=['CmHopper,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmHopper','rawAttributes','model','keys','query','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','Campaign','name','dataValues','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','CmContact','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','map','direction','prev','isEmpty','hopperIds','priority','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledAt','findOne','LOCK','Contact','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','preview','isNumber'];(function(_0x3fc417,_0xdf0014){var _0x20a869=function(_0x2c5262){while(--_0x2c5262){_0x3fc417['push'](_0x3fc417['shift']());}};_0x20a869(++_0xdf0014);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_[_0x0a9e('0x2a')](_0x479bc4['filters'],[_0x0a9e('0x2b'),_0x0a9e('0x2c'),_0x0a9e('0x2d'),_0x0a9e('0x2e'),_0x0a9e('0x2f'),_0x0a9e('0x30'),_0x0a9e('0x31'),_0x0a9e('0x32'),_0x0a9e('0x33'),'$between',_0x0a9e('0x34'),'$in',_0x0a9e('0x35'),_0x0a9e('0x36'),_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39'),'$like',_0x0a9e('0x3a'),_0x0a9e('0x3b'),_0x0a9e('0x3c'),_0x0a9e('0x3d')]);_0x384319[_0x0a9e('0x3e')]=_[_0x0a9e('0x3f')](_0x479bc4[_0x0a9e('0x26')],qs[_0x0a9e('0x40')](_0x33161b['query'][_0x0a9e('0x40')]));_0x384319['attributes']=_0x384319[_0x0a9e('0x3e')][_0x0a9e('0x41')]?_0x384319[_0x0a9e('0x3e')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b['query'][_0x0a9e('0x42')](_0x0a9e('0x43'))){_0x384319[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x33161b['query']['limit']);_0x384319[_0x0a9e('0x18')]=qs['offset'](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x44')]=qs[_0x0a9e('0x45')](_0x33161b['query'][_0x0a9e('0x45')]);_0x384319[_0x0a9e('0x46')]=qs[_0x0a9e('0x29')](_['pick'](_0x33161b[_0x0a9e('0x28')],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b[_0x0a9e('0x28')]['filter']){_0x384319['where']=_[_0x0a9e('0x47')](_0x384319[_0x0a9e('0x46')],{'$or':_['map'](_0x5bfb33,function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x48')][_0x0a9e('0x49')]!==_0x0a9e('0x4a')){var _0x4b38d9={};_0x4b38d9[_0x2b814e['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x4b')]+'%'};return _0x4b38d9;}})});}_0x384319=_['merge']({},_0x384319,_0x33161b[_0x0a9e('0x4c')]);var _0x1dec2e={'where':_0x384319[_0x0a9e('0x46')]};return db['CmHopper'][_0x0a9e('0x17')](_0x1dec2e)[_0x0a9e('0x1f')](function(_0x274e8e){_0x45a1e7[_0x0a9e('0x17')]=_0x274e8e;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x4d')]){_0x384319[_0x0a9e('0x4e')]=[{'all':!![]}];}return db[_0x0a9e('0x24')][_0x0a9e('0x4f')](_0x384319);})[_0x0a9e('0x1f')](function(_0x2c3711){_0x45a1e7[_0x0a9e('0x50')]=_0x2c3711;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x51')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x52')]=function(_0x4d04c8,_0x52628e){var _0x473fdc={'raw':!![],'where':{'id':_0x4d04c8[_0x0a9e('0x53')]['id']}},_0xb3795a={};_0xb3795a[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0xb3795a[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x4d04c8[_0x0a9e('0x28')]);_0xb3795a[_0x0a9e('0x29')]=_[_0x0a9e('0x3f')](_0xb3795a['model'],_0xb3795a[_0x0a9e('0x28')]);_0x473fdc[_0x0a9e('0x3e')]=_[_0x0a9e('0x3f')](_0xb3795a[_0x0a9e('0x26')],qs[_0x0a9e('0x40')](_0x4d04c8[_0x0a9e('0x28')][_0x0a9e('0x40')]));_0x473fdc[_0x0a9e('0x3e')]=_0x473fdc['attributes'][_0x0a9e('0x41')]?_0x473fdc['attributes']:_0xb3795a[_0x0a9e('0x26')];if(_0x4d04c8[_0x0a9e('0x28')][_0x0a9e('0x4d')]){_0x473fdc['include']=[{'all':!![]}];}_0x473fdc=_[_0x0a9e('0x47')]({},_0x473fdc,_0x4d04c8[_0x0a9e('0x4c')]);return db[_0x0a9e('0x24')][_0x0a9e('0x54')](_0x473fdc)[_0x0a9e('0x1f')](handleEntityNotFound(_0x52628e,null))[_0x0a9e('0x1f')](respondWithResult(_0x52628e,null))[_0x0a9e('0x51')](handleError(_0x52628e,null));};exports['create']=function(_0x13f44d,_0x1bde3c){return db[_0x0a9e('0x24')][_0x0a9e('0x55')](_0x13f44d[_0x0a9e('0x56')],{})[_0x0a9e('0x1f')](respondWithResult(_0x1bde3c,0xc9))[_0x0a9e('0x51')](handleError(_0x1bde3c,null));};exports[_0x0a9e('0x57')]=function(_0x34febd,_0x58a5c2){if(_0x34febd[_0x0a9e('0x56')]['id']){delete _0x34febd[_0x0a9e('0x56')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x34febd['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x58a5c2,null))[_0x0a9e('0x1f')](saveUpdates(_0x34febd[_0x0a9e('0x56')],null))[_0x0a9e('0x1f')](respondWithResult(_0x58a5c2,null))[_0x0a9e('0x51')](handleError(_0x58a5c2,null));};exports[_0x0a9e('0x58')]=function(_0x2e5165,_0x375c18){return db['CmHopper']['describe']()['then'](respondWithResult(_0x375c18,null))[_0x0a9e('0x51')](handleError(_0x375c18,null));};exports[_0x0a9e('0x59')]=function(_0x14d602,_0x5bb3ed){var _0x2b69d9;return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x14d602['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5bb3ed,null))['then'](function(_0x443e72){if(_0x443e72){return _0x443e72['destroy']()[_0x0a9e('0x1f')](function(_0x3c20b2){return _0x3c20b2;});}})[_0x0a9e('0x1f')](function(_0x53613a){_0x2b69d9=_0x53613a;if(_0x53613a){if(_0x53613a[_0x0a9e('0x5a')]||_0x53613a[_0x0a9e('0x5b')]){return db[_0x53613a['VoiceQueueId']?'VoiceQueue':_0x0a9e('0x5c')][_0x0a9e('0x54')]({'where':{'id':_0x53613a['VoiceQueueId']?_0x53613a[_0x0a9e('0x5a')]:_0x53613a['CampaignId']},'attributes':['id',_0x0a9e('0x5d')],'raw':!![]});}}})['then'](function(_0xe22ccc){var _0x4a6deb={};if(_0xe22ccc){_['merge'](_0x4a6deb,_['omit'](_0x2b69d9[_0x0a9e('0x5e')],['createdAt',_0x0a9e('0x5f'),'id']));_0x4a6deb[_0x0a9e('0x60')]=0x15;_0x4a6deb[_0x0a9e('0x61')]=_0x0a9e('0x62');_0x4a6deb[_0x0a9e('0x63')]=_0xe22ccc[_0x0a9e('0x5d')];_0x4a6deb[_0x0a9e('0x64')]=_0x14d602[_0x0a9e('0x65')]['name'];_0x4a6deb[_0x0a9e('0x66')]=_0x14d602[_0x0a9e('0x65')]['id'];_0x4a6deb[_0x0a9e('0x62')]=!![];_0x4a6deb[_0x0a9e('0x67')]=moment()[_0x0a9e('0x68')](_0x0a9e('0x69'));_0x4a6deb['calleridnum']=_0x2b69d9[_0x0a9e('0x6a')];_0x4a6deb[_0x0a9e('0x6b')]=_0x2b69d9['VoiceQueueId']?_0x0a9e('0x6c'):'ivr';return db[_0x0a9e('0x6d')]['find']({'where':{'id':_0x4a6deb['ContactId']},'attributes':['firstName',_0x0a9e('0x6e')]})['then'](function(_0x2244d6){if(!_[_0x0a9e('0x6f')](_0x5bb3ed)&&!_[_0x0a9e('0x6f')](_0x2244d6[_0x0a9e('0x70')])){_0x4a6deb[_0x0a9e('0x71')]=_0x2244d6[_0x0a9e('0x70')];if(!_['isNil'](_0x2244d6[_0x0a9e('0x6e')])){_0x4a6deb['calleridname']+='\x20'+_0x2244d6[_0x0a9e('0x6e')];}}})[_0x0a9e('0x72')](function(){return db[_0x0a9e('0x73')]['create'](_0x4a6deb);});}})[_0x0a9e('0x1f')](function(){return _0x5bb3ed[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();})[_0x0a9e('0x51')](handleError(_0x5bb3ed,null));};exports['getPreview']=function(_0x1d0dc8,_0xe05a5a,_0x54327c){var _0x797b45=[];return db[_0x0a9e('0x6d')][_0x0a9e('0x58')]()[_0x0a9e('0x1f')](function(_0x401837){_0x797b45=_['keys'](_0x401837);return _0x1d0dc8[_0x0a9e('0x65')][_0x0a9e('0x74')]({'where':{'type':_0x0a9e('0x75'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x0a9e('0x76')],'raw':!![]});})['then'](function(_0x5211e3){if(_0x5211e3&&_0x5211e3[_0x0a9e('0x41')]){return db[_0x0a9e('0x77')][_0x0a9e('0x78')](function(_0x19c995){var _0x186f39={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a9e('0x68')](_0x0a9e('0x69'))},'VoiceQueueId':{'$in':_[_0x0a9e('0x79')](_0x5211e3,'id')},'$or':[{'UserId':null},{'UserId':_0x1d0dc8[_0x0a9e('0x65')]['id']}]};var _0x1cc4f3=[];if(_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7a')]&&_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7a')]===_0x0a9e('0x7b')){if(!_[_0x0a9e('0x7c')](_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7d')])){_0x186f39['id']={'$in':_0x1d0dc8['body'][_0x0a9e('0x7d')]};}_0x1cc4f3=[[_0x0a9e('0x7e'),_0x0a9e('0x7f')],['scheduledAt',_0x5211e3[0x0][_0x0a9e('0x76')]===_0x0a9e('0x7f')?'DESC':_0x0a9e('0x7f')],db[_0x0a9e('0x77')][_0x0a9e('0x80')](_0x0a9e('0x81')),['id',_0x0a9e('0x82')]];}else{if(!_['isEmpty'](_0x1d0dc8['body']['hopperIds'])){_0x186f39['id']={'$notIn':_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7d')]};}_0x1cc4f3=[[_0x0a9e('0x7e'),_0x0a9e('0x82')],[_0x0a9e('0x83'),_0x5211e3[0x0][_0x0a9e('0x76')]],db[_0x0a9e('0x77')][_0x0a9e('0x80')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x0a9e('0x7f')]];}return db[_0x0a9e('0x24')][_0x0a9e('0x84')]({'attributes':['id','scheduledat'],'where':_0x186f39,'order':_0x1cc4f3,'transaction':_0x19c995,'lock':_0x19c995[_0x0a9e('0x85')]['UPDATE'],'include':[{'model':db[_0x0a9e('0x6d')],'as':_0x0a9e('0x86'),'attributes':_0x797b45,'include':[{'model':db['CmCompany'],'as':_0x0a9e('0x87'),'attributes':['id',_0x0a9e('0x5d')]}]},{'model':db[_0x0a9e('0x88')],'as':_0x0a9e('0x89'),'attributes':['id','name']},{'model':db[_0x0a9e('0x8a')],'as':_0x0a9e('0x8b'),'attributes':['id',_0x0a9e('0x5d'),_0x0a9e('0x8c')]}]})['then'](function(_0x109ccb){if(_0x109ccb){return _0x109ccb[_0x0a9e('0x57')]({'UserId':_0x1d0dc8[_0x0a9e('0x65')]['id']},{'transaction':_0x19c995});}});});}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xe05a5a,null))['then'](respondWithResult(_0xe05a5a,null))[_0x0a9e('0x51')](handleError(_0xe05a5a,null));};exports[_0x0a9e('0x8d')]=function(_0x30a4c7,_0xf410e5,_0x332367){return _0x30a4c7[_0x0a9e('0x65')][_0x0a9e('0x74')]({'where':{'type':_0x0a9e('0x75'),'dialActive':!![],'dialMethod':_0x0a9e('0x8e')},'attributes':['id'],'raw':!![]})[_0x0a9e('0x1f')](function(_0xc4c230){if(_0xc4c230&&_0xc4c230[_0x0a9e('0x41')]){return db[_0x0a9e('0x24')][_0x0a9e('0x17')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x0a9e('0x69'))},'VoiceQueueId':{'$in':_[_0x0a9e('0x79')](_0xc4c230,'id')},'$or':[{'UserId':null},{'UserId':_0x30a4c7[_0x0a9e('0x65')]['id']}]}});}return 0x0;})['then'](function(_0x3736e0){if(!_[_0x0a9e('0x6f')](_0x3736e0)&&_[_0x0a9e('0x8f')](_0x3736e0)){return _0xf410e5[_0x0a9e('0x14')](0xc8)['json']({'contacts':_0x3736e0});}else{logger['error'](_0x0a9e('0x90'),_0x0a9e('0x8d'),0x194,'entity\x20not\x20found');_0xf410e5[_0x0a9e('0x13')](0x194);}})['catch'](handleError(_0xf410e5,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 6b62608..67826f9 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdac1=['api','moment','bluebird','path','../../config/environment','./cmHopper.attributes','exports','scheduledat','phone','priority','lodash','util','../../config/logger'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xdac1,0x101));var _0x1dac=function(_0x2d5166,_0x132546){_0x2d5166=_0x2d5166-0x0;var _0x4d4cbc=_0xdac1[_0x2d5166];return _0x4d4cbc;};'use strict';var _=require(_0x1dac('0x0'));var util=require(_0x1dac('0x1'));var logger=require(_0x1dac('0x2'))(_0x1dac('0x3'));var moment=require(_0x1dac('0x4'));var BPromise=require(_0x1dac('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1dac('0x6'));var rimraf=require('rimraf');var config=require(_0x1dac('0x7'));var attributes=require(_0x1dac('0x8'));module[_0x1dac('0x9')]=function(_0x71f693,_0x2eed77){return _0x71f693['define']('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x1dac('0xa'),'fields':[_0x1dac('0xa')]},{'name':_0x1dac('0xb'),'fields':[_0x1dac('0xb')]},{'name':'priority','fields':[_0x1dac('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x00e5=['./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x442d38,_0x51065a){var _0x27db04=function(_0x4e7785){while(--_0x4e7785){_0x442d38['push'](_0x442d38['shift']());}};_0x27db04(++_0x51065a);}(_0x00e5,0x13a));var _0x500e=function(_0x15a3b0,_0x2af7fc){_0x15a3b0=_0x15a3b0-0x0;var _0x48af2e=_0x00e5[_0x15a3b0];return _0x48af2e;};'use strict';var _=require(_0x500e('0x0'));var util=require(_0x500e('0x1'));var logger=require('../../config/logger')(_0x500e('0x2'));var moment=require(_0x500e('0x3'));var BPromise=require(_0x500e('0x4'));var rp=require(_0x500e('0x5'));var fs=require('fs');var path=require(_0x500e('0x6'));var rimraf=require(_0x500e('0x7'));var config=require(_0x500e('0x8'));var attributes=require(_0x500e('0x9'));module[_0x500e('0xa')]=function(_0x149531,_0x33039f){return _0x149531[_0x500e('0xb')](_0x500e('0xc'),attributes,{'tableName':_0x500e('0xd'),'paranoid':![],'indexes':[{'name':_0x500e('0xe'),'fields':[_0x500e('0xe')]},{'name':_0x500e('0xf'),'fields':[_0x500e('0xf')]},{'name':_0x500e('0x10'),'fields':[_0x500e('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 7b6d50e..32fa4b7 100644 --- a/server/api/cmHopper/cmHopper.rpc.js +++ b/server/api/cmHopper/cmHopper.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4f6=['destroy','GetContactDialer','CmContact','describe','sequelize','transaction','limit','order','LOCK','keys','length','push','CmHopperFinal','create','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','UserId','UPDATE','all','GetContactRecallMe','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CmHopper','findAll','options','raw','where','attributes','include','map','GetCmHopper','ShowCmHopper','model','catch','CreateCmHopper','body','then','update','UpdateCmHopper','DestroyCmHopper'];(function(_0x3f52a7,_0x1928dc){var _0x528c98=function(_0x4da161){while(--_0x4da161){_0x3f52a7['push'](_0x3f52a7['shift']());}};_0x528c98(++_0x1928dc);}(_0xa4f6,0xe0));var _0x6a4f=function(_0x196a55,_0x21c14c){_0x196a55=_0x196a55-0x0;var _0x26a39f=_0xa4f6[_0x196a55];return _0x26a39f;};'use strict';var _=require(_0x6a4f('0x0'));var util=require(_0x6a4f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a4f('0x2'));var db=require(_0x6a4f('0x3'))['db'];var utils=require(_0x6a4f('0x4'));var logger=require(_0x6a4f('0x5'))(_0x6a4f('0x6'));var config=require(_0x6a4f('0x7'));var jayson=require(_0x6a4f('0x8'));var client=jayson[_0x6a4f('0x9')][_0x6a4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xba9e59,_0x3c04fe,_0x453faa){return new BPromise(function(_0x4a44a7,_0x5375b9){return client[_0x6a4f('0xb')](_0xba9e59,_0x453faa)['then'](function(_0x133687){logger[_0x6a4f('0xc')](_0x6a4f('0xd'),_0x3c04fe,_0x6a4f('0xe'));logger[_0x6a4f('0xf')](_0x6a4f('0x10'),_0x3c04fe,_0x6a4f('0xe'),JSON[_0x6a4f('0x11')](_0x133687));if(_0x133687[_0x6a4f('0x12')]){if(_0x133687[_0x6a4f('0x12')][_0x6a4f('0x13')]===0x1f4){logger[_0x6a4f('0x12')](_0x6a4f('0xd'),_0x3c04fe,_0x133687[_0x6a4f('0x12')][_0x6a4f('0x14')]);return _0x5375b9(_0x133687[_0x6a4f('0x12')]['message']);}logger[_0x6a4f('0x12')](_0x6a4f('0xd'),_0x3c04fe,_0x133687[_0x6a4f('0x12')][_0x6a4f('0x14')]);return _0x4a44a7(_0x133687['error'][_0x6a4f('0x14')]);}else{logger[_0x6a4f('0xc')]('CmHopper,\x20%s,\x20%s',_0x3c04fe,'request\x20sent');_0x4a44a7(_0x133687[_0x6a4f('0x15')][_0x6a4f('0x14')]);}})['catch'](function(_0x40894f){logger[_0x6a4f('0x12')](_0x6a4f('0xd'),_0x3c04fe,_0x40894f);_0x5375b9(_0x40894f);});});}exports['GetCmHopper']=function(_0x381889){var _0x22ea3b=this;return new Promise(function(_0x5b46b7,_0x3adc8e){return db[_0x6a4f('0x16')][_0x6a4f('0x17')]({'raw':_0x381889[_0x6a4f('0x18')]?_0x381889['options'][_0x6a4f('0x19')]===undefined?!![]:![]:!![],'where':_0x381889[_0x6a4f('0x18')]?_0x381889['options'][_0x6a4f('0x1a')]||null:null,'attributes':_0x381889['options']?_0x381889[_0x6a4f('0x18')][_0x6a4f('0x1b')]||null:null,'limit':_0x381889[_0x6a4f('0x18')]?_0x381889[_0x6a4f('0x18')]['limit']||null:null,'include':_0x381889['options']?_0x381889[_0x6a4f('0x18')][_0x6a4f('0x1c')]?_[_0x6a4f('0x1d')](_0x381889[_0x6a4f('0x18')][_0x6a4f('0x1c')],function(_0x319d0e){return{'model':db[_0x319d0e['model']],'as':_0x319d0e['as'],'attributes':_0x319d0e[_0x6a4f('0x1b')],'include':_0x319d0e['include']?_[_0x6a4f('0x1d')](_0x319d0e[_0x6a4f('0x1c')],function(_0x40bee4){return{'model':db[_0x40bee4['model']],'as':_0x40bee4['as'],'attributes':_0x40bee4[_0x6a4f('0x1b')],'include':_0x40bee4[_0x6a4f('0x1c')]?_['map'](_0x40bee4[_0x6a4f('0x1c')],function(_0x45a9b9){return{'model':db[_0x45a9b9['model']],'as':_0x45a9b9['as'],'attributes':_0x45a9b9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x29b24b){logger[_0x6a4f('0xc')](_0x6a4f('0x1e'),_0x381889);logger[_0x6a4f('0xf')](_0x6a4f('0x1e'),_0x381889,JSON[_0x6a4f('0x11')](_0x29b24b));_0x5b46b7(_0x29b24b);})['catch'](function(_0x5c1e02){logger[_0x6a4f('0x12')](_0x6a4f('0x1e'),_0x5c1e02[_0x6a4f('0x14')],_0x381889);_0x3adc8e(_0x22ea3b[_0x6a4f('0x12')](0x1f4,_0x5c1e02[_0x6a4f('0x14')]));});});};exports[_0x6a4f('0x1f')]=function(_0x4d9148){var _0x3173f3=this;return new Promise(function(_0x4b2deb,_0x289ca4){return db[_0x6a4f('0x16')]['find']({'raw':_0x4d9148[_0x6a4f('0x18')]?_0x4d9148[_0x6a4f('0x18')][_0x6a4f('0x19')]===undefined?!![]:![]:!![],'where':_0x4d9148['options']?_0x4d9148['options'][_0x6a4f('0x1a')]||null:null,'attributes':_0x4d9148[_0x6a4f('0x18')]?_0x4d9148[_0x6a4f('0x18')][_0x6a4f('0x1b')]||null:null,'include':_0x4d9148[_0x6a4f('0x18')]?_0x4d9148[_0x6a4f('0x18')]['include']?_[_0x6a4f('0x1d')](_0x4d9148[_0x6a4f('0x18')][_0x6a4f('0x1c')],function(_0x1e9d9b){return{'model':db[_0x1e9d9b['model']],'as':_0x1e9d9b['as'],'attributes':_0x1e9d9b[_0x6a4f('0x1b')],'include':_0x1e9d9b['include']?_[_0x6a4f('0x1d')](_0x1e9d9b[_0x6a4f('0x1c')],function(_0x50f41f){return{'model':db[_0x50f41f[_0x6a4f('0x20')]],'as':_0x50f41f['as'],'attributes':_0x50f41f[_0x6a4f('0x1b')],'include':_0x50f41f[_0x6a4f('0x1c')]?_[_0x6a4f('0x1d')](_0x50f41f['include'],function(_0x1d8c62){return{'model':db[_0x1d8c62[_0x6a4f('0x20')]],'as':_0x1d8c62['as'],'attributes':_0x1d8c62[_0x6a4f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x591a78){logger[_0x6a4f('0xc')](_0x6a4f('0x1f'),_0x4d9148);logger['debug'](_0x6a4f('0x1f'),_0x4d9148,JSON[_0x6a4f('0x11')](_0x591a78));_0x4b2deb(_0x591a78);})[_0x6a4f('0x21')](function(_0x7d6c96){logger['error'](_0x6a4f('0x1f'),_0x7d6c96[_0x6a4f('0x14')],_0x4d9148);_0x289ca4(_0x3173f3['error'](0x1f4,_0x7d6c96[_0x6a4f('0x14')]));});});};exports[_0x6a4f('0x22')]=function(_0x4e71ba){var _0x42cf32=this;return new Promise(function(_0x55b7b3,_0x36c58d){return db['CmHopper']['create'](_0x4e71ba[_0x6a4f('0x23')],{'raw':_0x4e71ba[_0x6a4f('0x18')]?_0x4e71ba[_0x6a4f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x6a4f('0x24')](function(_0x40c397){logger[_0x6a4f('0xc')](_0x6a4f('0x22'),_0x4e71ba);logger['debug'](_0x6a4f('0x22'),_0x4e71ba,JSON['stringify'](_0x40c397));_0x55b7b3(_0x40c397);})['catch'](function(_0x5bf5e3){logger[_0x6a4f('0x12')](_0x6a4f('0x22'),_0x5bf5e3['message'],_0x4e71ba);_0x36c58d(_0x42cf32[_0x6a4f('0x12')](0x1f4,_0x5bf5e3[_0x6a4f('0x14')]));});});};exports['UpdateCmHopper']=function(_0x57530c){var _0x1a5a96=this;return new Promise(function(_0x496cb6,_0x485eb5){return db[_0x6a4f('0x16')][_0x6a4f('0x25')](_0x57530c[_0x6a4f('0x23')],{'raw':_0x57530c[_0x6a4f('0x18')]?_0x57530c[_0x6a4f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57530c[_0x6a4f('0x18')]?_0x57530c[_0x6a4f('0x18')][_0x6a4f('0x1a')]||null:null,'attributes':_0x57530c[_0x6a4f('0x18')]?_0x57530c[_0x6a4f('0x18')][_0x6a4f('0x1b')]||null:null,'limit':_0x57530c[_0x6a4f('0x18')]?_0x57530c['options']['limit']||null:null})[_0x6a4f('0x24')](function(_0x525e95){logger['info'](_0x6a4f('0x26'),_0x57530c);logger[_0x6a4f('0xf')](_0x6a4f('0x26'),_0x57530c,JSON['stringify'](_0x525e95));_0x496cb6(_0x525e95);})[_0x6a4f('0x21')](function(_0x35f048){logger[_0x6a4f('0x12')](_0x6a4f('0x26'),_0x35f048[_0x6a4f('0x14')],_0x57530c);_0x485eb5(_0x1a5a96[_0x6a4f('0x12')](0x1f4,_0x35f048['message']));});});};exports[_0x6a4f('0x27')]=function(_0x38ed40){var _0x101c46=this;return new Promise(function(_0x4caffa,_0x486b80){return db[_0x6a4f('0x16')][_0x6a4f('0x28')]({'where':_0x38ed40['options']?_0x38ed40[_0x6a4f('0x18')][_0x6a4f('0x1a')]||null:null})['then'](function(_0x36ac84){logger[_0x6a4f('0xc')](_0x6a4f('0x27'),_0x38ed40);logger[_0x6a4f('0xf')](_0x6a4f('0x27'),_0x38ed40,JSON[_0x6a4f('0x11')](_0x36ac84));_0x4caffa(_0x36ac84);})['catch'](function(_0x500077){logger['error'](_0x6a4f('0x27'),_0x500077[_0x6a4f('0x14')],_0x38ed40);_0x486b80(_0x101c46['error'](0x1f4,_0x500077['message']));});});};exports[_0x6a4f('0x29')]=function(_0x55677e){var _0x54be90=this;return new Promise(function(_0x62f902,_0x20d2a8){return db[_0x6a4f('0x2a')][_0x6a4f('0x2b')]()[_0x6a4f('0x24')](function(_0x16527f){return db[_0x6a4f('0x2c')][_0x6a4f('0x2d')](function(_0x905bd6){return db['CmHopper']['findAll']({'where':_0x55677e[_0x6a4f('0x18')]?_0x55677e[_0x6a4f('0x18')][_0x6a4f('0x1a')]||null:null,'attributes':_0x55677e['options']?_0x55677e['options'][_0x6a4f('0x1b')]||null:null,'limit':_0x55677e[_0x6a4f('0x18')]?_0x55677e[_0x6a4f('0x18')][_0x6a4f('0x2e')]||null:null,'order':_0x55677e[_0x6a4f('0x18')]?_0x55677e['options'][_0x6a4f('0x2f')]||null:null,'transaction':_0x905bd6,'lock':_0x905bd6[_0x6a4f('0x30')]['UPDATE'],'include':[{'model':db[_0x6a4f('0x2a')],'as':'Contact','attributes':_[_0x6a4f('0x31')](_0x16527f)}]})[_0x6a4f('0x24')](function(_0x404009){var _0x37ee30=[];for(var _0x54caef=0x0;_0x54caef<_0x404009[_0x6a4f('0x32')];_0x54caef+=0x1){_0x37ee30[_0x6a4f('0x33')](_0x404009[_0x54caef][_0x6a4f('0x25')](_0x55677e['body'],{'transaction':_0x905bd6}));}return BPromise['all'](_0x37ee30);});})[_0x6a4f('0x24')](function(_0x144d60){logger[_0x6a4f('0xc')](_0x6a4f('0x29'),_0x55677e);logger[_0x6a4f('0xf')]('GetContactDialer',_0x55677e,JSON['stringify'](_0x144d60));_0x62f902(_0x144d60);})[_0x6a4f('0x21')](function(_0x45ee66){logger['error']('GetContactDialer',_0x45ee66[_0x6a4f('0x14')],_0x55677e);_0x20d2a8(_0x54be90[_0x6a4f('0x12')](0x1f4,_0x45ee66[_0x6a4f('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x536b8f){var _0x528402=this;return new Promise(function(_0x1752eb,_0x38bfc6){return db[_0x6a4f('0x2c')][_0x6a4f('0x2d')](function(_0x6795b8){return db[_0x6a4f('0x34')][_0x6a4f('0x35')](_0x536b8f[_0x6a4f('0x23')],{'raw':_0x536b8f['options']?_0x536b8f[_0x6a4f('0x18')][_0x6a4f('0x19')]===undefined?!![]:![]:!![],'transaction':_0x6795b8})['then'](function(){return db[_0x6a4f('0x16')][_0x6a4f('0x28')]({'where':_0x536b8f[_0x6a4f('0x18')]?_0x536b8f[_0x6a4f('0x18')][_0x6a4f('0x1a')]||null:null,'transaction':_0x6795b8});});})[_0x6a4f('0x24')](function(_0x407544){logger['info'](_0x6a4f('0x36'),_0x536b8f);logger[_0x6a4f('0xf')]('MoveContactManagedDialer',_0x536b8f,JSON[_0x6a4f('0x11')](_0x407544));_0x1752eb(_0x407544);})[_0x6a4f('0x21')](function(_0x498c0e){logger[_0x6a4f('0x12')](_0x6a4f('0x36'),_0x498c0e[_0x6a4f('0x14')],_0x536b8f);_0x38bfc6(_0x528402[_0x6a4f('0x12')](0x1f4,_0x498c0e[_0x6a4f('0x14')]));});});};exports[_0x6a4f('0x37')]=function(_0x3eb073){var _0x31242d=this;return new Promise(function(_0xa60ed6,_0x388d9c){return db['CmHopper'][_0x6a4f('0x17')]({'raw':_0x3eb073['options']?_0x3eb073[_0x6a4f('0x18')][_0x6a4f('0x19')]===undefined?!![]:![]:!![],'where':_0x3eb073[_0x6a4f('0x18')]?_0x3eb073[_0x6a4f('0x18')][_0x6a4f('0x1a')]||null:null,'attributes':[[db['sequelize']['fn'](_0x6a4f('0x38'),db[_0x6a4f('0x2c')]['fn']('IF',db['sequelize'][_0x6a4f('0x39')](_0x6a4f('0x3a')+util[_0x6a4f('0x3b')]('\x22%s\x22',moment()[_0x6a4f('0x3b')](_0x6a4f('0x3c')))+'\x20,\x201,\x20null'))),_0x6a4f('0x3d')]]})['then'](function(_0x2e7d54){logger[_0x6a4f('0xc')](_0x6a4f('0x37'),_0x3eb073);logger[_0x6a4f('0xf')](_0x6a4f('0x37'),_0x3eb073,JSON[_0x6a4f('0x11')](_0x2e7d54));_0xa60ed6(_0x2e7d54);})[_0x6a4f('0x21')](function(_0x253b51){logger[_0x6a4f('0x12')](_0x6a4f('0x37'),_0x253b51['message'],_0x3eb073);_0x388d9c(_0x31242d[_0x6a4f('0x12')](0x1f4,_0x253b51[_0x6a4f('0x14')]));});});};exports['GetContactRecallMe']=function(_0x5708e5){var _0x2828c4=this;return new Promise(function(_0x303e19,_0x8c502e){return db[_0x6a4f('0x2a')][_0x6a4f('0x2b')]()[_0x6a4f('0x24')](function(_0x308ab5){return db['sequelize']['transaction'](function(_0x1ff6ad){return db[_0x6a4f('0x16')]['findAll']({'where':_0x5708e5[_0x6a4f('0x18')]?_0x5708e5[_0x6a4f('0x18')][_0x6a4f('0x1a')]||null:null,'attributes':_0x5708e5[_0x6a4f('0x18')]?_0x5708e5['options'][_0x6a4f('0x1b')]||null:null,'limit':0x1,'order':_0x5708e5[_0x6a4f('0x18')]?_0x5708e5[_0x6a4f('0x18')][_0x6a4f('0x2f')]||null:null,'group':db[_0x6a4f('0x16')][_0x6a4f('0x3e')],'transaction':_0x1ff6ad,'lock':_0x1ff6ad[_0x6a4f('0x30')][_0x6a4f('0x3f')],'include':_0x5708e5[_0x6a4f('0x18')]?_0x5708e5[_0x6a4f('0x18')]['include']?_[_0x6a4f('0x1d')](_0x5708e5[_0x6a4f('0x18')][_0x6a4f('0x1c')],function(_0x4e348f){return{'model':db[_0x4e348f[_0x6a4f('0x20')]],'as':_0x4e348f['as'],'attributes':_0x4e348f[_0x6a4f('0x1b')],'include':_0x4e348f['include']?_['map'](_0x4e348f[_0x6a4f('0x1c')],function(_0x112483){return{'model':db[_0x112483['model']],'as':_0x112483['as'],'attributes':_0x112483[_0x6a4f('0x1b')],'include':_0x112483[_0x6a4f('0x1c')]?_['map'](_0x112483[_0x6a4f('0x1c')],function(_0x130c70){return{'model':db[_0x130c70[_0x6a4f('0x20')]],'as':_0x130c70['as'],'attributes':_0x130c70['attributes']};}):[]};}):[]};}):[]:[]})[_0x6a4f('0x24')](function(_0x2c949e){var _0x31f17b=[];for(var _0x210c81=0x0;_0x210c81<_0x2c949e[_0x6a4f('0x32')];_0x210c81+=0x1){_0x31f17b[_0x6a4f('0x33')](_0x2c949e[_0x210c81][_0x6a4f('0x25')](_0x5708e5[_0x6a4f('0x23')],{'transaction':_0x1ff6ad}));}return BPromise[_0x6a4f('0x40')](_0x31f17b);});})[_0x6a4f('0x24')](function(_0x3b2bc9){logger[_0x6a4f('0xc')]('GetContactRecallMe',_0x5708e5);logger['debug']('GetContactRecallMe',_0x5708e5,JSON[_0x6a4f('0x11')](_0x3b2bc9));_0x303e19(_0x3b2bc9);})[_0x6a4f('0x21')](function(_0x362f77){logger[_0x6a4f('0x12')](_0x6a4f('0x41'),_0x362f77['message'],_0x5708e5);_0x8c502e(_0x2828c4[_0x6a4f('0x12')](0x1f4,_0x362f77[_0x6a4f('0x14')]));});});});}; \ No newline at end of file +var _0xa6e1=['model','ShowCmHopper','find','where','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','push','all','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','CmContact','UserId','length','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopper,\x20%s,\x20%s','result','catch','GetCmHopper','CmHopper','findAll','options','raw','limit','map','attributes','include'];(function(_0x590e72,_0x482b5c){var _0x196726=function(_0x359a9d){while(--_0x359a9d){_0x590e72['push'](_0x590e72['shift']());}};_0x196726(++_0x482b5c);}(_0xa6e1,0x161));var _0x1a6e=function(_0x5e2185,_0x3ed4f7){_0x5e2185=_0x5e2185-0x0;var _0x250af9=_0xa6e1[_0x5e2185];return _0x250af9;};'use strict';var _=require(_0x1a6e('0x0'));var util=require('util');var moment=require(_0x1a6e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a6e('0x2'))['db'];var utils=require(_0x1a6e('0x3'));var logger=require(_0x1a6e('0x4'))(_0x1a6e('0x5'));var config=require(_0x1a6e('0x6'));var jayson=require(_0x1a6e('0x7'));var client=jayson['client'][_0x1a6e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x266a39,_0x2287fa,_0x1c85cb){return new BPromise(function(_0x1919e2,_0xaa2b5f){return client[_0x1a6e('0x9')](_0x266a39,_0x1c85cb)[_0x1a6e('0xa')](function(_0x4d1d75){logger[_0x1a6e('0xb')]('CmHopper,\x20%s,\x20%s',_0x2287fa,_0x1a6e('0xc'));logger[_0x1a6e('0xd')](_0x1a6e('0xe'),_0x2287fa,_0x1a6e('0xc'),JSON[_0x1a6e('0xf')](_0x4d1d75));if(_0x4d1d75[_0x1a6e('0x10')]){if(_0x4d1d75[_0x1a6e('0x10')][_0x1a6e('0x11')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x2287fa,_0x4d1d75[_0x1a6e('0x10')][_0x1a6e('0x12')]);return _0xaa2b5f(_0x4d1d75[_0x1a6e('0x10')][_0x1a6e('0x12')]);}logger[_0x1a6e('0x10')](_0x1a6e('0x13'),_0x2287fa,_0x4d1d75[_0x1a6e('0x10')]['message']);return _0x1919e2(_0x4d1d75[_0x1a6e('0x10')]['message']);}else{logger[_0x1a6e('0xb')](_0x1a6e('0x13'),_0x2287fa,_0x1a6e('0xc'));_0x1919e2(_0x4d1d75[_0x1a6e('0x14')][_0x1a6e('0x12')]);}})[_0x1a6e('0x15')](function(_0x31a6b0){logger['error'](_0x1a6e('0x13'),_0x2287fa,_0x31a6b0);_0xaa2b5f(_0x31a6b0);});});}exports[_0x1a6e('0x16')]=function(_0x3e7c58){var _0x24cbb5=this;return new Promise(function(_0x3cb78b,_0x26b28b){return db[_0x1a6e('0x17')][_0x1a6e('0x18')]({'raw':_0x3e7c58[_0x1a6e('0x19')]?_0x3e7c58[_0x1a6e('0x19')][_0x1a6e('0x1a')]===undefined?!![]:![]:!![],'where':_0x3e7c58[_0x1a6e('0x19')]?_0x3e7c58[_0x1a6e('0x19')]['where']||null:null,'attributes':_0x3e7c58[_0x1a6e('0x19')]?_0x3e7c58['options']['attributes']||null:null,'limit':_0x3e7c58[_0x1a6e('0x19')]?_0x3e7c58[_0x1a6e('0x19')][_0x1a6e('0x1b')]||null:null,'include':_0x3e7c58['options']?_0x3e7c58[_0x1a6e('0x19')]['include']?_[_0x1a6e('0x1c')](_0x3e7c58[_0x1a6e('0x19')]['include'],function(_0x1b7643){return{'model':db[_0x1b7643['model']],'as':_0x1b7643['as'],'attributes':_0x1b7643[_0x1a6e('0x1d')],'include':_0x1b7643[_0x1a6e('0x1e')]?_[_0x1a6e('0x1c')](_0x1b7643['include'],function(_0x49ba02){return{'model':db[_0x49ba02['model']],'as':_0x49ba02['as'],'attributes':_0x49ba02[_0x1a6e('0x1d')],'include':_0x49ba02[_0x1a6e('0x1e')]?_[_0x1a6e('0x1c')](_0x49ba02[_0x1a6e('0x1e')],function(_0x170ccc){return{'model':db[_0x170ccc[_0x1a6e('0x1f')]],'as':_0x170ccc['as'],'attributes':_0x170ccc['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a6e('0xa')](function(_0x13d00b){logger[_0x1a6e('0xb')](_0x1a6e('0x16'),_0x3e7c58);logger['debug'](_0x1a6e('0x16'),_0x3e7c58,JSON[_0x1a6e('0xf')](_0x13d00b));_0x3cb78b(_0x13d00b);})[_0x1a6e('0x15')](function(_0x4c8637){logger[_0x1a6e('0x10')](_0x1a6e('0x16'),_0x4c8637['message'],_0x3e7c58);_0x26b28b(_0x24cbb5[_0x1a6e('0x10')](0x1f4,_0x4c8637[_0x1a6e('0x12')]));});});};exports[_0x1a6e('0x20')]=function(_0x1c9969){var _0x549c15=this;return new Promise(function(_0x5f466f,_0x56fba6){return db['CmHopper'][_0x1a6e('0x21')]({'raw':_0x1c9969[_0x1a6e('0x19')]?_0x1c9969[_0x1a6e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1c9969[_0x1a6e('0x19')]?_0x1c9969[_0x1a6e('0x19')][_0x1a6e('0x22')]||null:null,'attributes':_0x1c9969[_0x1a6e('0x19')]?_0x1c9969[_0x1a6e('0x19')]['attributes']||null:null,'include':_0x1c9969[_0x1a6e('0x19')]?_0x1c9969[_0x1a6e('0x19')][_0x1a6e('0x1e')]?_[_0x1a6e('0x1c')](_0x1c9969[_0x1a6e('0x19')][_0x1a6e('0x1e')],function(_0x136ab9){return{'model':db[_0x136ab9[_0x1a6e('0x1f')]],'as':_0x136ab9['as'],'attributes':_0x136ab9['attributes'],'include':_0x136ab9[_0x1a6e('0x1e')]?_[_0x1a6e('0x1c')](_0x136ab9[_0x1a6e('0x1e')],function(_0x1fcd14){return{'model':db[_0x1fcd14['model']],'as':_0x1fcd14['as'],'attributes':_0x1fcd14[_0x1a6e('0x1d')],'include':_0x1fcd14[_0x1a6e('0x1e')]?_[_0x1a6e('0x1c')](_0x1fcd14[_0x1a6e('0x1e')],function(_0x1c5d77){return{'model':db[_0x1c5d77[_0x1a6e('0x1f')]],'as':_0x1c5d77['as'],'attributes':_0x1c5d77[_0x1a6e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1a6e('0xa')](function(_0x466bd4){logger[_0x1a6e('0xb')](_0x1a6e('0x20'),_0x1c9969);logger[_0x1a6e('0xd')](_0x1a6e('0x20'),_0x1c9969,JSON[_0x1a6e('0xf')](_0x466bd4));_0x5f466f(_0x466bd4);})['catch'](function(_0x467600){logger[_0x1a6e('0x10')](_0x1a6e('0x20'),_0x467600[_0x1a6e('0x12')],_0x1c9969);_0x56fba6(_0x549c15['error'](0x1f4,_0x467600['message']));});});};exports[_0x1a6e('0x23')]=function(_0x1a9a8d){var _0x58769e=this;return new Promise(function(_0x5be905,_0x53ad8b){return db['CmHopper'][_0x1a6e('0x24')](_0x1a9a8d[_0x1a6e('0x25')],{'raw':_0x1a9a8d[_0x1a6e('0x19')]?_0x1a9a8d[_0x1a6e('0x19')][_0x1a6e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x274b35){logger[_0x1a6e('0xb')](_0x1a6e('0x23'),_0x1a9a8d);logger[_0x1a6e('0xd')](_0x1a6e('0x23'),_0x1a9a8d,JSON[_0x1a6e('0xf')](_0x274b35));_0x5be905(_0x274b35);})[_0x1a6e('0x15')](function(_0xb4e5f2){logger[_0x1a6e('0x10')](_0x1a6e('0x23'),_0xb4e5f2[_0x1a6e('0x12')],_0x1a9a8d);_0x53ad8b(_0x58769e['error'](0x1f4,_0xb4e5f2[_0x1a6e('0x12')]));});});};exports[_0x1a6e('0x26')]=function(_0x3e9fd6){var _0x39ff45=this;return new Promise(function(_0xb8bc03,_0x9f4f79){return db['CmHopper'][_0x1a6e('0x27')](_0x3e9fd6['body'],{'raw':_0x3e9fd6[_0x1a6e('0x19')]?_0x3e9fd6[_0x1a6e('0x19')][_0x1a6e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e9fd6[_0x1a6e('0x19')]?_0x3e9fd6[_0x1a6e('0x19')][_0x1a6e('0x22')]||null:null,'attributes':_0x3e9fd6['options']?_0x3e9fd6['options'][_0x1a6e('0x1d')]||null:null,'limit':_0x3e9fd6[_0x1a6e('0x19')]?_0x3e9fd6[_0x1a6e('0x19')][_0x1a6e('0x1b')]||null:null})[_0x1a6e('0xa')](function(_0x573a67){logger[_0x1a6e('0xb')](_0x1a6e('0x26'),_0x3e9fd6);logger[_0x1a6e('0xd')]('UpdateCmHopper',_0x3e9fd6,JSON[_0x1a6e('0xf')](_0x573a67));_0xb8bc03(_0x573a67);})['catch'](function(_0x17204a){logger[_0x1a6e('0x10')](_0x1a6e('0x26'),_0x17204a[_0x1a6e('0x12')],_0x3e9fd6);_0x9f4f79(_0x39ff45['error'](0x1f4,_0x17204a['message']));});});};exports[_0x1a6e('0x28')]=function(_0x4de37e){var _0x40e068=this;return new Promise(function(_0x9112ae,_0x252dfc){return db[_0x1a6e('0x17')][_0x1a6e('0x29')]({'where':_0x4de37e[_0x1a6e('0x19')]?_0x4de37e[_0x1a6e('0x19')]['where']||null:null})['then'](function(_0x4442b5){logger[_0x1a6e('0xb')](_0x1a6e('0x28'),_0x4de37e);logger[_0x1a6e('0xd')](_0x1a6e('0x28'),_0x4de37e,JSON['stringify'](_0x4442b5));_0x9112ae(_0x4442b5);})[_0x1a6e('0x15')](function(_0x588021){logger[_0x1a6e('0x10')](_0x1a6e('0x28'),_0x588021[_0x1a6e('0x12')],_0x4de37e);_0x252dfc(_0x40e068[_0x1a6e('0x10')](0x1f4,_0x588021[_0x1a6e('0x12')]));});});};exports[_0x1a6e('0x2a')]=function(_0x459dc9){var _0x35a189=this;return new Promise(function(_0x171a42,_0x425977){return db['CmContact'][_0x1a6e('0x2b')]()['then'](function(_0x308824){return db[_0x1a6e('0x2c')][_0x1a6e('0x2d')](function(_0x428a3b){return db[_0x1a6e('0x17')][_0x1a6e('0x18')]({'where':_0x459dc9[_0x1a6e('0x19')]?_0x459dc9[_0x1a6e('0x19')][_0x1a6e('0x22')]||null:null,'attributes':_0x459dc9[_0x1a6e('0x19')]?_0x459dc9[_0x1a6e('0x19')][_0x1a6e('0x1d')]||null:null,'limit':_0x459dc9[_0x1a6e('0x19')]?_0x459dc9[_0x1a6e('0x19')][_0x1a6e('0x1b')]||null:null,'order':_0x459dc9['options']?_0x459dc9[_0x1a6e('0x19')][_0x1a6e('0x2e')]||null:null,'transaction':_0x428a3b,'lock':_0x428a3b[_0x1a6e('0x2f')][_0x1a6e('0x30')],'include':[{'model':db['CmContact'],'as':_0x1a6e('0x31'),'attributes':_['keys'](_0x308824)}]})[_0x1a6e('0xa')](function(_0x5a4228){var _0x929c7=[];for(var _0xd1508f=0x0;_0xd1508f<_0x5a4228['length'];_0xd1508f+=0x1){_0x929c7[_0x1a6e('0x32')](_0x5a4228[_0xd1508f][_0x1a6e('0x27')](_0x459dc9[_0x1a6e('0x25')],{'transaction':_0x428a3b}));}return BPromise[_0x1a6e('0x33')](_0x929c7);});})[_0x1a6e('0xa')](function(_0x17d9e6){logger['info'](_0x1a6e('0x2a'),_0x459dc9);logger[_0x1a6e('0xd')]('GetContactDialer',_0x459dc9,JSON[_0x1a6e('0xf')](_0x17d9e6));_0x171a42(_0x17d9e6);})['catch'](function(_0xeb319d){logger[_0x1a6e('0x10')](_0x1a6e('0x2a'),_0xeb319d[_0x1a6e('0x12')],_0x459dc9);_0x425977(_0x35a189[_0x1a6e('0x10')](0x1f4,_0xeb319d[_0x1a6e('0x12')]));});});});};exports[_0x1a6e('0x34')]=function(_0x5bd330){var _0x6987f1=this;return new Promise(function(_0xe149f1,_0x33d3a5){return db[_0x1a6e('0x2c')]['transaction'](function(_0x40127f){return db['CmHopperFinal'][_0x1a6e('0x24')](_0x5bd330['body'],{'raw':_0x5bd330[_0x1a6e('0x19')]?_0x5bd330[_0x1a6e('0x19')]['raw']===undefined?!![]:![]:!![],'transaction':_0x40127f})[_0x1a6e('0xa')](function(){return db['CmHopper'][_0x1a6e('0x29')]({'where':_0x5bd330[_0x1a6e('0x19')]?_0x5bd330[_0x1a6e('0x19')][_0x1a6e('0x22')]||null:null,'transaction':_0x40127f});});})[_0x1a6e('0xa')](function(_0x2ce34a){logger[_0x1a6e('0xb')](_0x1a6e('0x34'),_0x5bd330);logger[_0x1a6e('0xd')](_0x1a6e('0x34'),_0x5bd330,JSON[_0x1a6e('0xf')](_0x2ce34a));_0xe149f1(_0x2ce34a);})[_0x1a6e('0x15')](function(_0x4b265c){logger['error'](_0x1a6e('0x34'),_0x4b265c['message'],_0x5bd330);_0x33d3a5(_0x6987f1[_0x1a6e('0x10')](0x1f4,_0x4b265c['message']));});});};exports[_0x1a6e('0x35')]=function(_0xd58e9a){var _0x34b265=this;return new Promise(function(_0x3738b5,_0x3bd1de){return db[_0x1a6e('0x17')][_0x1a6e('0x18')]({'raw':_0xd58e9a['options']?_0xd58e9a[_0x1a6e('0x19')][_0x1a6e('0x1a')]===undefined?!![]:![]:!![],'where':_0xd58e9a['options']?_0xd58e9a[_0x1a6e('0x19')][_0x1a6e('0x22')]||null:null,'attributes':[[db['sequelize']['fn'](_0x1a6e('0x36'),db[_0x1a6e('0x2c')]['fn']('IF',db[_0x1a6e('0x2c')][_0x1a6e('0x37')](_0x1a6e('0x38')+util['format'](_0x1a6e('0x39'),moment()[_0x1a6e('0x3a')](_0x1a6e('0x3b')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x1a6e('0xa')](function(_0x32ca9e){logger[_0x1a6e('0xb')](_0x1a6e('0x35'),_0xd58e9a);logger[_0x1a6e('0xd')](_0x1a6e('0x35'),_0xd58e9a,JSON['stringify'](_0x32ca9e));_0x3738b5(_0x32ca9e);})[_0x1a6e('0x15')](function(_0x3d25b2){logger['error'](_0x1a6e('0x35'),_0x3d25b2[_0x1a6e('0x12')],_0xd58e9a);_0x3bd1de(_0x34b265[_0x1a6e('0x10')](0x1f4,_0x3d25b2['message']));});});};exports[_0x1a6e('0x3c')]=function(_0x2f8496){var _0x321733=this;return new Promise(function(_0x444e23,_0x2a6d6d){return db[_0x1a6e('0x3d')][_0x1a6e('0x2b')]()[_0x1a6e('0xa')](function(_0x2445bd){return db[_0x1a6e('0x2c')][_0x1a6e('0x2d')](function(_0x59e4e5){return db[_0x1a6e('0x17')][_0x1a6e('0x18')]({'where':_0x2f8496[_0x1a6e('0x19')]?_0x2f8496[_0x1a6e('0x19')][_0x1a6e('0x22')]||null:null,'attributes':_0x2f8496[_0x1a6e('0x19')]?_0x2f8496['options'][_0x1a6e('0x1d')]||null:null,'limit':0x1,'order':_0x2f8496[_0x1a6e('0x19')]?_0x2f8496[_0x1a6e('0x19')][_0x1a6e('0x2e')]||null:null,'group':db[_0x1a6e('0x17')][_0x1a6e('0x3e')],'transaction':_0x59e4e5,'lock':_0x59e4e5[_0x1a6e('0x2f')][_0x1a6e('0x30')],'include':_0x2f8496['options']?_0x2f8496[_0x1a6e('0x19')][_0x1a6e('0x1e')]?_['map'](_0x2f8496[_0x1a6e('0x19')]['include'],function(_0x76539c){return{'model':db[_0x76539c[_0x1a6e('0x1f')]],'as':_0x76539c['as'],'attributes':_0x76539c[_0x1a6e('0x1d')],'include':_0x76539c[_0x1a6e('0x1e')]?_[_0x1a6e('0x1c')](_0x76539c['include'],function(_0xd6e785){return{'model':db[_0xd6e785['model']],'as':_0xd6e785['as'],'attributes':_0xd6e785[_0x1a6e('0x1d')],'include':_0xd6e785[_0x1a6e('0x1e')]?_[_0x1a6e('0x1c')](_0xd6e785[_0x1a6e('0x1e')],function(_0x14e745){return{'model':db[_0x14e745['model']],'as':_0x14e745['as'],'attributes':_0x14e745[_0x1a6e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1a6e('0xa')](function(_0x56f7a0){var _0x37af84=[];for(var _0x5e72e3=0x0;_0x5e72e3<_0x56f7a0[_0x1a6e('0x3f')];_0x5e72e3+=0x1){_0x37af84['push'](_0x56f7a0[_0x5e72e3][_0x1a6e('0x27')](_0x2f8496['body'],{'transaction':_0x59e4e5}));}return BPromise[_0x1a6e('0x33')](_0x37af84);});})[_0x1a6e('0xa')](function(_0x37aa00){logger['info'](_0x1a6e('0x3c'),_0x2f8496);logger[_0x1a6e('0xd')](_0x1a6e('0x3c'),_0x2f8496,JSON[_0x1a6e('0xf')](_0x37aa00));_0x444e23(_0x37aa00);})['catch'](function(_0x243eb6){logger[_0x1a6e('0x10')](_0x1a6e('0x3c'),_0x243eb6[_0x1a6e('0x12')],_0x2f8496);_0x2a6d6d(_0x321733[_0x1a6e('0x10')](0x1f4,_0x243eb6[_0x1a6e('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 2068f66..a9eb75a 100644 --- a/server/api/cmHopper/index.js +++ b/server/api/cmHopper/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8937=['../../config/environment','./cmHopper.controller','get','/describe','isAuthenticated','describe','/opencontacts','show','post','create','getPreview','put','/:id','update','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x8937,0x1b3));var _0x7893=function(_0xd49cf1,_0x39fc6b){_0xd49cf1=_0xd49cf1-0x0;var _0xf94b5a=_0x8937[_0xd49cf1];return _0xf94b5a;};'use strict';var multer=require('multer');var util=require(_0x7893('0x0'));var path=require(_0x7893('0x1'));var timeout=require(_0x7893('0x2'));var express=require('express');var router=express[_0x7893('0x3')]();var auth=require(_0x7893('0x4'));var interaction=require(_0x7893('0x5'));var config=require(_0x7893('0x6'));var controller=require(_0x7893('0x7'));router[_0x7893('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7893('0x8')](_0x7893('0x9'),auth[_0x7893('0xa')](),controller[_0x7893('0xb')]);router[_0x7893('0x8')](_0x7893('0xc'),auth[_0x7893('0xa')](),controller['getOpenContacts']);router['get']('/:id',auth[_0x7893('0xa')](),controller[_0x7893('0xd')]);router[_0x7893('0xe')]('/',auth[_0x7893('0xa')](),controller[_0x7893('0xf')]);router[_0x7893('0xe')]('/preview',auth[_0x7893('0xa')](),controller[_0x7893('0x10')]);router[_0x7893('0x11')](_0x7893('0x12'),auth[_0x7893('0xa')](),controller[_0x7893('0x13')]);router['delete'](_0x7893('0x12'),auth[_0x7893('0xa')](),controller['destroy']);module[_0x7893('0x14')]=router; \ No newline at end of file +var _0x1ad0=['/:id','post','create','/preview','put','update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','/describe','get','/opencontacts','isAuthenticated','getOpenContacts'];(function(_0x1e8b82,_0x1993fe){var _0x431938=function(_0x3cbd1d){while(--_0x3cbd1d){_0x1e8b82['push'](_0x1e8b82['shift']());}};_0x431938(++_0x1993fe);}(_0x1ad0,0x16d));var _0x01ad=function(_0x1bada5,_0x5e12e7){_0x1bada5=_0x1bada5-0x0;var _0x278a1d=_0x1ad0[_0x1bada5];return _0x278a1d;};'use strict';var multer=require(_0x01ad('0x0'));var util=require(_0x01ad('0x1'));var path=require(_0x01ad('0x2'));var timeout=require('connect-timeout');var express=require(_0x01ad('0x3'));var router=express['Router']();var auth=require(_0x01ad('0x4'));var interaction=require(_0x01ad('0x5'));var config=require(_0x01ad('0x6'));var controller=require(_0x01ad('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x01ad('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x01ad('0x9')](_0x01ad('0xa'),auth[_0x01ad('0xb')](),controller[_0x01ad('0xc')]);router['get'](_0x01ad('0xd'),auth[_0x01ad('0xb')](),controller['show']);router[_0x01ad('0xe')]('/',auth[_0x01ad('0xb')](),controller[_0x01ad('0xf')]);router['post'](_0x01ad('0x10'),auth[_0x01ad('0xb')](),controller['getPreview']);router[_0x01ad('0x11')](_0x01ad('0xd'),auth[_0x01ad('0xb')](),controller[_0x01ad('0x12')]);router[_0x01ad('0x13')]('/:id',auth[_0x01ad('0xb')](),controller[_0x01ad('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index fc9cf1c..8dad1fa 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.attributes.js +++ b/server/api/cmHopperBlack/cmHopperBlack.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b4e=['exports','STRING','INTEGER','contactListQueue'];(function(_0x5f4f61,_0x36cd94){var _0x387e99=function(_0x2c046e){while(--_0x2c046e){_0x5f4f61['push'](_0x5f4f61['shift']());}};_0x387e99(++_0x36cd94);}(_0x5b4e,0x188));var _0xe5b4=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5b4e[_0x4a9fb1];return _0x348672;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xe5b4('0x0')]={'phone':{'type':Sequelize[_0xe5b4('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xe5b4('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xe5b4('0x2')],'unique':_0xe5b4('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xe5b4('0x3')}}; \ No newline at end of file +var _0xdb90=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0xc731bb,_0x5891d4){var _0xfe197d=function(_0x2cd6a7){while(--_0x2cd6a7){_0xc731bb['push'](_0xc731bb['shift']());}};_0xfe197d(++_0x5891d4);}(_0xdb90,0x13b));var _0x0db9=function(_0x1cb128,_0x2770eb){_0x1cb128=_0x1cb128-0x0;var _0x4843e2=_0xdb90[_0x1cb128];return _0x4843e2;};'use strict';var moment=require(_0x0db9('0x0'));var Sequelize=require(_0x0db9('0x1'));module[_0x0db9('0x2')]={'phone':{'type':Sequelize[_0x0db9('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0db9('0x4')],'unique':_0x0db9('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x0db9('0x4')],'unique':_0x0db9('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index eec3507..7474242 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.controller.js +++ b/server/api/cmHopperBlack/cmHopperBlack.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9538=['filters','filter','merge','map','key','VIRTUAL','field','options','then','includeAll','include','catch','show','length','find','body','destroy','params','describe','zip-dir','fast-json-patch','request-promise','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','sendStatus','error','stack','name','send','index','CmHopperBlack','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9538,0x167));var _0x8953=function(_0x397e41,_0x48b621){_0x397e41=_0x397e41-0x0;var _0x2f9cd0=_0x9538[_0x397e41];return _0x2f9cd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8953('0x0'));var jsonpatch=require(_0x8953('0x1'));var rp=require(_0x8953('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8953('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x8953('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8953('0x5'));var squel=require(_0x8953('0x6'));var crypto=require(_0x8953('0x7'));var jsforce=require(_0x8953('0x8'));var deskjs=require(_0x8953('0x9'));var toCsv=require(_0x8953('0x4'));var querystring=require(_0x8953('0xa'));var Papa=require(_0x8953('0xb'));var Redis=require(_0x8953('0xc'));var authService=require(_0x8953('0xd'));var qs=require(_0x8953('0xe'));var hardwareService=require(_0x8953('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x8953('0x10'));var config=require(_0x8953('0x11'));var db=require(_0x8953('0x12'))['db'];function respondWithStatusCode(_0x10eb70,_0x3b0eb0){_0x3b0eb0=_0x3b0eb0||0xcc;return function(_0x82b448){if(_0x82b448){return _0x10eb70['sendStatus'](_0x3b0eb0);}return _0x10eb70['status'](_0x3b0eb0)[_0x8953('0x13')]();};}function respondWithResult(_0x3beb05,_0xa0b909){_0xa0b909=_0xa0b909||0xc8;return function(_0x33b3df){if(_0x33b3df){return _0x3beb05[_0x8953('0x14')](_0xa0b909)[_0x8953('0x15')](_0x33b3df);}};}function respondWithFilteredResult(_0x36b9e2,_0x485899){return function(_0x425658){if(_0x425658){var _0x2da11a=_0x425658[_0x8953('0x16')],_0xc92716=_0x485899['offset'],_0x2f3087=_0x485899[_0x8953('0x17')]+_0x485899[_0x8953('0x18')],_0x311d8b;if(_0x2f3087>=_0x2da11a){_0x2f3087=_0x2da11a;_0x311d8b=0xc8;}else{_0x311d8b=0xce;}_0x36b9e2[_0x8953('0x14')](_0x311d8b);return _0x36b9e2[_0x8953('0x19')](_0x8953('0x1a'),_0xc92716+'-'+_0x2f3087+'/'+_0x2da11a)[_0x8953('0x15')](_0x425658);}return null;};}function patchUpdates(_0x54ed48){return function(_0x18c54b){try{jsonpatch[_0x8953('0x1b')](_0x18c54b,_0x54ed48,!![]);}catch(_0x234bfd){return BPromise['reject'](_0x234bfd);}return _0x18c54b[_0x8953('0x1c')]();};}function saveUpdates(_0x501a3a,_0x5f1228){return function(_0x2da507){if(_0x2da507){return _0x2da507[_0x8953('0x1d')](_0x501a3a)['then'](function(_0x45211a){return _0x45211a;});}return null;};}function removeEntity(_0x4c6b2d,_0xf49b95){return function(_0x474b05){if(_0x474b05){return _0x474b05['destroy']()['then'](function(){_0x4c6b2d['status'](0xcc)[_0x8953('0x13')]();});}};}function handleEntityNotFound(_0x26314e,_0x59496d){return function(_0xfbfa46){if(!_0xfbfa46){_0x26314e[_0x8953('0x1e')](0x194);}return _0xfbfa46;};}function handleError(_0x429770,_0x132da6){_0x132da6=_0x132da6||0x1f4;return function(_0x345bd0){logger[_0x8953('0x1f')](_0x345bd0[_0x8953('0x20')]);if(_0x345bd0[_0x8953('0x21')]){delete _0x345bd0['name'];}_0x429770[_0x8953('0x14')](_0x132da6)[_0x8953('0x22')](_0x345bd0);};}exports[_0x8953('0x23')]=function(_0x34ec70,_0x588b0e){var _0x21d4d9={},_0x4d10d9={},_0x3dcbac={'count':0x0,'rows':[]};var _0x3ece53=db[_0x8953('0x24')][_0x8953('0x25')];_0x4d10d9[_0x8953('0x26')]=_[_0x8953('0x27')](_0x3ece53);_0x4d10d9[_0x8953('0x28')]=_[_0x8953('0x27')](_0x34ec70[_0x8953('0x28')]);_0x4d10d9['filters']=_[_0x8953('0x29')](_0x4d10d9['model'],_0x4d10d9[_0x8953('0x28')]);_0x21d4d9['attributes']=_[_0x8953('0x29')](_0x4d10d9[_0x8953('0x26')],qs[_0x8953('0x2a')](_0x34ec70[_0x8953('0x28')][_0x8953('0x2a')]));_0x21d4d9[_0x8953('0x2b')]=_0x21d4d9[_0x8953('0x2b')]['length']?_0x21d4d9[_0x8953('0x2b')]:_0x4d10d9[_0x8953('0x26')];if(!_0x34ec70[_0x8953('0x28')][_0x8953('0x2c')](_0x8953('0x2d'))){_0x21d4d9[_0x8953('0x18')]=qs[_0x8953('0x18')](_0x34ec70[_0x8953('0x28')][_0x8953('0x18')]);_0x21d4d9[_0x8953('0x17')]=qs[_0x8953('0x17')](_0x34ec70[_0x8953('0x28')][_0x8953('0x17')]);}_0x21d4d9['order']=qs[_0x8953('0x2e')](_0x34ec70[_0x8953('0x28')][_0x8953('0x2e')]);_0x21d4d9[_0x8953('0x2f')]=qs['filters'](_[_0x8953('0x30')](_0x34ec70[_0x8953('0x28')],_0x4d10d9[_0x8953('0x31')]));if(_0x34ec70[_0x8953('0x28')][_0x8953('0x32')]){_0x21d4d9[_0x8953('0x2f')]=_[_0x8953('0x33')](_0x21d4d9[_0x8953('0x2f')],{'$or':_[_0x8953('0x34')](_0x3ece53,function(_0x5a556f){if(_0x5a556f['type'][_0x8953('0x35')]!==_0x8953('0x36')){var _0x3469b4={};_0x3469b4[_0x5a556f[_0x8953('0x37')]]={'$like':'%'+_0x34ec70[_0x8953('0x28')][_0x8953('0x32')]+'%'};return _0x3469b4;}})});}_0x21d4d9=_[_0x8953('0x33')]({},_0x21d4d9,_0x34ec70[_0x8953('0x38')]);var _0x156529={'where':_0x21d4d9[_0x8953('0x2f')]};return db['CmHopperBlack'][_0x8953('0x16')](_0x156529)[_0x8953('0x39')](function(_0x4d169e){_0x3dcbac[_0x8953('0x16')]=_0x4d169e;if(_0x34ec70['query'][_0x8953('0x3a')]){_0x21d4d9[_0x8953('0x3b')]=[{'all':!![]}];}return db[_0x8953('0x24')]['findAll'](_0x21d4d9);})[_0x8953('0x39')](function(_0x407600){_0x3dcbac['rows']=_0x407600;return _0x3dcbac;})[_0x8953('0x39')](respondWithFilteredResult(_0x588b0e,_0x21d4d9))[_0x8953('0x3c')](handleError(_0x588b0e,null));};exports[_0x8953('0x3d')]=function(_0x13dab4,_0xb1778a){var _0x3d3582={'raw':!![],'where':{'id':_0x13dab4['params']['id']}},_0x560b61={};_0x560b61['model']=_[_0x8953('0x27')](db['CmHopperBlack'][_0x8953('0x25')]);_0x560b61[_0x8953('0x28')]=_[_0x8953('0x27')](_0x13dab4[_0x8953('0x28')]);_0x560b61[_0x8953('0x31')]=_['intersection'](_0x560b61[_0x8953('0x26')],_0x560b61['query']);_0x3d3582[_0x8953('0x2b')]=_[_0x8953('0x29')](_0x560b61[_0x8953('0x26')],qs[_0x8953('0x2a')](_0x13dab4[_0x8953('0x28')][_0x8953('0x2a')]));_0x3d3582[_0x8953('0x2b')]=_0x3d3582[_0x8953('0x2b')][_0x8953('0x3e')]?_0x3d3582[_0x8953('0x2b')]:_0x560b61[_0x8953('0x26')];if(_0x13dab4[_0x8953('0x28')][_0x8953('0x3a')]){_0x3d3582['include']=[{'all':!![]}];}_0x3d3582=_[_0x8953('0x33')]({},_0x3d3582,_0x13dab4[_0x8953('0x38')]);return db['CmHopperBlack'][_0x8953('0x3f')](_0x3d3582)[_0x8953('0x39')](handleEntityNotFound(_0xb1778a,null))[_0x8953('0x39')](respondWithResult(_0xb1778a,null))[_0x8953('0x3c')](handleError(_0xb1778a,null));};exports[_0x8953('0x1d')]=function(_0x2d3bf7,_0x680e05){if(_0x2d3bf7[_0x8953('0x40')]['id']){delete _0x2d3bf7[_0x8953('0x40')]['id'];}return db[_0x8953('0x24')][_0x8953('0x3f')]({'where':{'id':_0x2d3bf7['params']['id']}})[_0x8953('0x39')](handleEntityNotFound(_0x680e05,null))[_0x8953('0x39')](saveUpdates(_0x2d3bf7['body'],null))[_0x8953('0x39')](respondWithResult(_0x680e05,null))['catch'](handleError(_0x680e05,null));};exports[_0x8953('0x41')]=function(_0xcd04a6,_0xbea413){return db['CmHopperBlack'][_0x8953('0x3f')]({'where':{'id':_0xcd04a6[_0x8953('0x42')]['id']}})[_0x8953('0x39')](handleEntityNotFound(_0xbea413,null))[_0x8953('0x39')](removeEntity(_0xbea413,null))[_0x8953('0x3c')](handleError(_0xbea413,null));};exports[_0x8953('0x43')]=function(_0x1a87f3,_0x307429){return db['CmHopperBlack'][_0x8953('0x43')]()[_0x8953('0x39')](respondWithResult(_0x307429,null))[_0x8953('0x3c')](handleError(_0x307429,null));}; \ No newline at end of file +var _0xd600=['json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','CmHopperBlack','rawAttributes','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','key','VIRTUAL','field','filter','includeAll','include','findAll','catch','show','params','intersection','options','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd600,0x77));var _0x0d60=function(_0x538798,_0x404123){_0x538798=_0x538798-0x0;var _0x1137fe=_0xd600[_0x538798];return _0x1137fe;};'use strict';var pdf=require(_0x0d60('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0d60('0x1'));var zipdir=require(_0x0d60('0x2'));var jsonpatch=require(_0x0d60('0x3'));var rp=require(_0x0d60('0x4'));var moment=require(_0x0d60('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0d60('0x6'));var util=require(_0x0d60('0x7'));var path=require(_0x0d60('0x8'));var sox=require(_0x0d60('0x9'));var csv=require(_0x0d60('0xa'));var ejs=require(_0x0d60('0xb'));var fs=require('fs');var _=require(_0x0d60('0xc'));var squel=require(_0x0d60('0xd'));var crypto=require('crypto');var jsforce=require(_0x0d60('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0d60('0xa'));var querystring=require('querystring');var Papa=require(_0x0d60('0xf'));var Redis=require(_0x0d60('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0d60('0x11'));var hardwareService=require(_0x0d60('0x12'));var logger=require(_0x0d60('0x13'))(_0x0d60('0x14'));var utils=require(_0x0d60('0x15'));var config=require(_0x0d60('0x16'));var db=require(_0x0d60('0x17'))['db'];function respondWithStatusCode(_0x4dfaea,_0x103df9){_0x103df9=_0x103df9||0xcc;return function(_0x1ee9fb){if(_0x1ee9fb){return _0x4dfaea[_0x0d60('0x18')](_0x103df9);}return _0x4dfaea[_0x0d60('0x19')](_0x103df9)[_0x0d60('0x1a')]();};}function respondWithResult(_0x264240,_0x156870){_0x156870=_0x156870||0xc8;return function(_0x208cfd){if(_0x208cfd){return _0x264240[_0x0d60('0x19')](_0x156870)[_0x0d60('0x1b')](_0x208cfd);}};}function respondWithFilteredResult(_0x1e7bb1,_0x354ae6){return function(_0x5c0ba6){if(_0x5c0ba6){var _0x3b77ba=_0x5c0ba6[_0x0d60('0x1c')],_0x12be95=_0x354ae6[_0x0d60('0x1d')],_0x462365=_0x354ae6[_0x0d60('0x1d')]+_0x354ae6[_0x0d60('0x1e')],_0x82f077;if(_0x462365>=_0x3b77ba){_0x462365=_0x3b77ba;_0x82f077=0xc8;}else{_0x82f077=0xce;}_0x1e7bb1[_0x0d60('0x19')](_0x82f077);return _0x1e7bb1[_0x0d60('0x1f')](_0x0d60('0x20'),_0x12be95+'-'+_0x462365+'/'+_0x3b77ba)[_0x0d60('0x1b')](_0x5c0ba6);}return null;};}function patchUpdates(_0x6a742a){return function(_0x930125){try{jsonpatch[_0x0d60('0x21')](_0x930125,_0x6a742a,!![]);}catch(_0x3c6f5c){return BPromise[_0x0d60('0x22')](_0x3c6f5c);}return _0x930125[_0x0d60('0x23')]();};}function saveUpdates(_0x58f7e5,_0x3d5546){return function(_0x3f9eaf){if(_0x3f9eaf){return _0x3f9eaf[_0x0d60('0x24')](_0x58f7e5)[_0x0d60('0x25')](function(_0x49da3f){return _0x49da3f;});}return null;};}function removeEntity(_0x47da18,_0x354daf){return function(_0x1d735b){if(_0x1d735b){return _0x1d735b[_0x0d60('0x26')]()[_0x0d60('0x25')](function(){_0x47da18['status'](0xcc)[_0x0d60('0x1a')]();});}};}function handleEntityNotFound(_0x54780d,_0x18f1c4){return function(_0x3fcbb7){if(!_0x3fcbb7){_0x54780d[_0x0d60('0x18')](0x194);}return _0x3fcbb7;};}function handleError(_0x31c5f8,_0x161110){_0x161110=_0x161110||0x1f4;return function(_0x1a9b36){logger[_0x0d60('0x27')](_0x1a9b36[_0x0d60('0x28')]);if(_0x1a9b36[_0x0d60('0x29')]){delete _0x1a9b36[_0x0d60('0x29')];}_0x31c5f8[_0x0d60('0x19')](_0x161110)['send'](_0x1a9b36);};}exports['index']=function(_0x16d9eb,_0x594d8f){var _0xcdfaca={},_0x576956={},_0xf08f9a={'count':0x0,'rows':[]};var _0x120c75=db[_0x0d60('0x2a')][_0x0d60('0x2b')];_0x576956[_0x0d60('0x2c')]=_[_0x0d60('0x2d')](_0x120c75);_0x576956[_0x0d60('0x2e')]=_[_0x0d60('0x2d')](_0x16d9eb[_0x0d60('0x2e')]);_0x576956[_0x0d60('0x2f')]=_['intersection'](_0x576956[_0x0d60('0x2c')],_0x576956[_0x0d60('0x2e')]);_0xcdfaca['attributes']=_['intersection'](_0x576956[_0x0d60('0x2c')],qs[_0x0d60('0x30')](_0x16d9eb['query'][_0x0d60('0x30')]));_0xcdfaca[_0x0d60('0x31')]=_0xcdfaca[_0x0d60('0x31')][_0x0d60('0x32')]?_0xcdfaca[_0x0d60('0x31')]:_0x576956[_0x0d60('0x2c')];if(!_0x16d9eb['query'][_0x0d60('0x33')](_0x0d60('0x34'))){_0xcdfaca['limit']=qs[_0x0d60('0x1e')](_0x16d9eb['query']['limit']);_0xcdfaca[_0x0d60('0x1d')]=qs['offset'](_0x16d9eb['query']['offset']);}_0xcdfaca[_0x0d60('0x35')]=qs[_0x0d60('0x36')](_0x16d9eb[_0x0d60('0x2e')][_0x0d60('0x36')]);_0xcdfaca['where']=qs[_0x0d60('0x2f')](_[_0x0d60('0x37')](_0x16d9eb['query'],_0x576956[_0x0d60('0x2f')]));if(_0x16d9eb[_0x0d60('0x2e')]['filter']){_0xcdfaca['where']=_[_0x0d60('0x38')](_0xcdfaca[_0x0d60('0x39')],{'$or':_['map'](_0x120c75,function(_0x4f5bea){if(_0x4f5bea['type'][_0x0d60('0x3a')]!==_0x0d60('0x3b')){var _0x54fc90={};_0x54fc90[_0x4f5bea[_0x0d60('0x3c')]]={'$like':'%'+_0x16d9eb[_0x0d60('0x2e')][_0x0d60('0x3d')]+'%'};return _0x54fc90;}})});}_0xcdfaca=_['merge']({},_0xcdfaca,_0x16d9eb['options']);var _0x285b8f={'where':_0xcdfaca[_0x0d60('0x39')]};return db[_0x0d60('0x2a')][_0x0d60('0x1c')](_0x285b8f)[_0x0d60('0x25')](function(_0x29321b){_0xf08f9a[_0x0d60('0x1c')]=_0x29321b;if(_0x16d9eb[_0x0d60('0x2e')][_0x0d60('0x3e')]){_0xcdfaca[_0x0d60('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0d60('0x40')](_0xcdfaca);})['then'](function(_0x1c5c0f){_0xf08f9a['rows']=_0x1c5c0f;return _0xf08f9a;})[_0x0d60('0x25')](respondWithFilteredResult(_0x594d8f,_0xcdfaca))[_0x0d60('0x41')](handleError(_0x594d8f,null));};exports[_0x0d60('0x42')]=function(_0x4228cc,_0x2906fa){var _0x141bf7={'raw':!![],'where':{'id':_0x4228cc[_0x0d60('0x43')]['id']}},_0x46738a={};_0x46738a['model']=_[_0x0d60('0x2d')](db[_0x0d60('0x2a')][_0x0d60('0x2b')]);_0x46738a['query']=_[_0x0d60('0x2d')](_0x4228cc[_0x0d60('0x2e')]);_0x46738a['filters']=_[_0x0d60('0x44')](_0x46738a[_0x0d60('0x2c')],_0x46738a['query']);_0x141bf7[_0x0d60('0x31')]=_[_0x0d60('0x44')](_0x46738a['model'],qs['fields'](_0x4228cc[_0x0d60('0x2e')][_0x0d60('0x30')]));_0x141bf7[_0x0d60('0x31')]=_0x141bf7[_0x0d60('0x31')][_0x0d60('0x32')]?_0x141bf7['attributes']:_0x46738a['model'];if(_0x4228cc[_0x0d60('0x2e')]['includeAll']){_0x141bf7[_0x0d60('0x3f')]=[{'all':!![]}];}_0x141bf7=_[_0x0d60('0x38')]({},_0x141bf7,_0x4228cc[_0x0d60('0x45')]);return db['CmHopperBlack']['find'](_0x141bf7)[_0x0d60('0x25')](handleEntityNotFound(_0x2906fa,null))['then'](respondWithResult(_0x2906fa,null))[_0x0d60('0x41')](handleError(_0x2906fa,null));};exports['update']=function(_0x3261ad,_0x842eb9){if(_0x3261ad[_0x0d60('0x46')]['id']){delete _0x3261ad[_0x0d60('0x46')]['id'];}return db['CmHopperBlack'][_0x0d60('0x47')]({'where':{'id':_0x3261ad['params']['id']}})[_0x0d60('0x25')](handleEntityNotFound(_0x842eb9,null))['then'](saveUpdates(_0x3261ad['body'],null))['then'](respondWithResult(_0x842eb9,null))[_0x0d60('0x41')](handleError(_0x842eb9,null));};exports[_0x0d60('0x26')]=function(_0x2174ab,_0x4963d9){return db[_0x0d60('0x2a')][_0x0d60('0x47')]({'where':{'id':_0x2174ab['params']['id']}})[_0x0d60('0x25')](handleEntityNotFound(_0x4963d9,null))['then'](removeEntity(_0x4963d9,null))[_0x0d60('0x41')](handleError(_0x4963d9,null));};exports[_0x0d60('0x48')]=function(_0x4784d1,_0x5aea37){return db[_0x0d60('0x2a')][_0x0d60('0x48')]()[_0x0d60('0x25')](respondWithResult(_0x5aea37,null))['catch'](handleError(_0x5aea37,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 9fd25f4..cad069f 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.model.js +++ b/server/api/cmHopperBlack/cmHopperBlack.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b4d=['../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x3b4d,0x6e));var _0xd3b4=function(_0x3be658,_0x5b5905){_0x3be658=_0x3be658-0x0;var _0x8382ed=_0x3b4d[_0x3be658];return _0x8382ed;};'use strict';var _=require(_0xd3b4('0x0'));var util=require('util');var logger=require(_0xd3b4('0x1'))('api');var moment=require(_0xd3b4('0x2'));var BPromise=require(_0xd3b4('0x3'));var rp=require(_0xd3b4('0x4'));var fs=require('fs');var path=require(_0xd3b4('0x5'));var rimraf=require(_0xd3b4('0x6'));var config=require(_0xd3b4('0x7'));var attributes=require(_0xd3b4('0x8'));module[_0xd3b4('0x9')]=function(_0x48e5ec,_0x5bb2ef){return _0x48e5ec[_0xd3b4('0xa')](_0xd3b4('0xb'),attributes,{'tableName':_0xd3b4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9276=['api','bluebird','request-promise','path','rimraf','../../config/environment','define','CmHopperBlack','cm_hopper_black','util','../../config/logger'];(function(_0x597377,_0x3f69fe){var _0x51526b=function(_0x1fbf98){while(--_0x1fbf98){_0x597377['push'](_0x597377['shift']());}};_0x51526b(++_0x3f69fe);}(_0x9276,0x148));var _0x6927=function(_0x5561d2,_0x3e7701){_0x5561d2=_0x5561d2-0x0;var _0x4baa52=_0x9276[_0x5561d2];return _0x4baa52;};'use strict';var _=require('lodash');var util=require(_0x6927('0x0'));var logger=require(_0x6927('0x1'))(_0x6927('0x2'));var moment=require('moment');var BPromise=require(_0x6927('0x3'));var rp=require(_0x6927('0x4'));var fs=require('fs');var path=require(_0x6927('0x5'));var rimraf=require(_0x6927('0x6'));var config=require(_0x6927('0x7'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x6dde0e,_0x5a0d76){return _0x6dde0e[_0x6927('0x8')](_0x6927('0x9'),attributes,{'tableName':_0x6927('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index c15a2ec..6e960ad 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.rpc.js +++ b/server/api/cmHopperBlack/cmHopperBlack.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a1a=['DestroyCmHopperBlack','destroy','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','CmHopperBlack','update','body','UpdateCmHopperBlack','debug'];(function(_0xf48b2,_0x2e228a){var _0x45787a=function(_0x11c3bf){while(--_0x11c3bf){_0xf48b2['push'](_0xf48b2['shift']());}};_0x45787a(++_0x2e228a);}(_0x0a1a,0x10c));var _0xa0a1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0a1a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa0a1('0x0'));var util=require('util');var moment=require(_0xa0a1('0x1'));var BPromise=require(_0xa0a1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa0a1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0a1('0x4'));var logger=require(_0xa0a1('0x5'))(_0xa0a1('0x6'));var config=require(_0xa0a1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa0a1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38c05d,_0x434025,_0x40a6c9){return new BPromise(function(_0x162325,_0x206560){return client[_0xa0a1('0x9')](_0x38c05d,_0x40a6c9)[_0xa0a1('0xa')](function(_0x15c886){logger[_0xa0a1('0xb')](_0xa0a1('0xc'),_0x434025,_0xa0a1('0xd'));logger['debug'](_0xa0a1('0xe'),_0x434025,_0xa0a1('0xd'),JSON[_0xa0a1('0xf')](_0x15c886));if(_0x15c886[_0xa0a1('0x10')]){if(_0x15c886['error'][_0xa0a1('0x11')]===0x1f4){logger[_0xa0a1('0x10')](_0xa0a1('0xc'),_0x434025,_0x15c886[_0xa0a1('0x10')][_0xa0a1('0x12')]);return _0x206560(_0x15c886['error'][_0xa0a1('0x12')]);}logger[_0xa0a1('0x10')](_0xa0a1('0xc'),_0x434025,_0x15c886[_0xa0a1('0x10')][_0xa0a1('0x12')]);return _0x162325(_0x15c886[_0xa0a1('0x10')][_0xa0a1('0x12')]);}else{logger[_0xa0a1('0xb')](_0xa0a1('0xc'),_0x434025,_0xa0a1('0xd'));_0x162325(_0x15c886[_0xa0a1('0x13')][_0xa0a1('0x12')]);}})[_0xa0a1('0x14')](function(_0x1fcc56){logger[_0xa0a1('0x10')](_0xa0a1('0xc'),_0x434025,_0x1fcc56);_0x206560(_0x1fcc56);});});}exports[_0xa0a1('0x15')]=function(_0x415509){var _0x238ded=this;return new Promise(function(_0x2b4adb,_0x2a1a7e){return db['CmHopperBlack'][_0xa0a1('0x16')]({'raw':_0x415509[_0xa0a1('0x17')]?_0x415509['options'][_0xa0a1('0x18')]===undefined?!![]:![]:!![],'where':_0x415509['options']?_0x415509[_0xa0a1('0x17')][_0xa0a1('0x19')]||null:null,'attributes':_0x415509[_0xa0a1('0x17')]?_0x415509['options'][_0xa0a1('0x1a')]||null:null,'limit':_0x415509[_0xa0a1('0x17')]?_0x415509['options'][_0xa0a1('0x1b')]||null:null,'include':_0x415509['options']?_0x415509[_0xa0a1('0x17')][_0xa0a1('0x1c')]?_[_0xa0a1('0x1d')](_0x415509[_0xa0a1('0x17')][_0xa0a1('0x1c')],function(_0x10a13d){return{'model':db[_0x10a13d['model']],'as':_0x10a13d['as'],'attributes':_0x10a13d['attributes'],'include':_0x10a13d[_0xa0a1('0x1c')]?_[_0xa0a1('0x1d')](_0x10a13d[_0xa0a1('0x1c')],function(_0x551a8a){return{'model':db[_0x551a8a[_0xa0a1('0x1e')]],'as':_0x551a8a['as'],'attributes':_0x551a8a[_0xa0a1('0x1a')],'include':_0x551a8a['include']?_[_0xa0a1('0x1d')](_0x551a8a[_0xa0a1('0x1c')],function(_0x1207b6){return{'model':db[_0x1207b6[_0xa0a1('0x1e')]],'as':_0x1207b6['as'],'attributes':_0x1207b6[_0xa0a1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x486535){logger[_0xa0a1('0xb')](_0xa0a1('0x15'),_0x415509);logger['debug']('GetCmHopperBlack',_0x415509,JSON[_0xa0a1('0xf')](_0x486535));_0x2b4adb(_0x486535);})['catch'](function(_0x363565){logger[_0xa0a1('0x10')]('GetCmHopperBlack',_0x363565[_0xa0a1('0x12')],_0x415509);_0x2a1a7e(_0x238ded['error'](0x1f4,_0x363565[_0xa0a1('0x12')]));});});};exports['UpdateCmHopperBlack']=function(_0x1f3568){var _0x8b8090=this;return new Promise(function(_0x10b20d,_0x316760){return db[_0xa0a1('0x1f')][_0xa0a1('0x20')](_0x1f3568[_0xa0a1('0x21')],{'raw':_0x1f3568[_0xa0a1('0x17')]?_0x1f3568['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f3568[_0xa0a1('0x17')]?_0x1f3568['options'][_0xa0a1('0x19')]||null:null,'attributes':_0x1f3568[_0xa0a1('0x17')]?_0x1f3568[_0xa0a1('0x17')][_0xa0a1('0x1a')]||null:null,'limit':_0x1f3568['options']?_0x1f3568['options'][_0xa0a1('0x1b')]||null:null})[_0xa0a1('0xa')](function(_0x397805){logger[_0xa0a1('0xb')](_0xa0a1('0x22'),_0x1f3568);logger[_0xa0a1('0x23')]('UpdateCmHopperBlack',_0x1f3568,JSON[_0xa0a1('0xf')](_0x397805));_0x10b20d(_0x397805);})[_0xa0a1('0x14')](function(_0x56401c){logger[_0xa0a1('0x10')]('UpdateCmHopperBlack',_0x56401c[_0xa0a1('0x12')],_0x1f3568);_0x316760(_0x8b8090[_0xa0a1('0x10')](0x1f4,_0x56401c['message']));});});};exports[_0xa0a1('0x24')]=function(_0x3cd45b){var _0xf42f57=this;return new Promise(function(_0x57eea6,_0xaf33a){return db[_0xa0a1('0x1f')][_0xa0a1('0x25')]({'where':_0x3cd45b[_0xa0a1('0x17')]?_0x3cd45b['options']['where']||null:null})['then'](function(_0x3e237e){logger[_0xa0a1('0xb')]('DestroyCmHopperBlack',_0x3cd45b);logger[_0xa0a1('0x23')](_0xa0a1('0x24'),_0x3cd45b,JSON[_0xa0a1('0xf')](_0x3e237e));_0x57eea6(_0x3e237e);})[_0xa0a1('0x14')](function(_0x271a88){logger[_0xa0a1('0x10')](_0xa0a1('0x24'),_0x271a88[_0xa0a1('0x12')],_0x3cd45b);_0xaf33a(_0xf42f57[_0xa0a1('0x10')](0x1f4,_0x271a88[_0xa0a1('0x12')]));});});}; \ No newline at end of file +var _0xa097=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','limit','map','include','model','attributes','UpdateCmHopperBlack','CmHopperBlack','body','stringify','DestroyCmHopperBlack','destroy','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xa097,0x92));var _0x7a09=function(_0x37f9fa,_0x4acb2d){_0x37f9fa=_0x37f9fa-0x0;var _0x3e4ffe=_0xa097[_0x37f9fa];return _0x3e4ffe;};'use strict';var _=require(_0x7a09('0x0'));var util=require(_0x7a09('0x1'));var moment=require('moment');var BPromise=require(_0x7a09('0x2'));var rs=require(_0x7a09('0x3'));var fs=require('fs');var Redis=require(_0x7a09('0x4'));var db=require(_0x7a09('0x5'))['db'];var utils=require(_0x7a09('0x6'));var logger=require('../../config/logger')(_0x7a09('0x7'));var config=require(_0x7a09('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7a09('0x9')][_0x7a09('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x494e2e,_0xfec8b4,_0x27a558){return new BPromise(function(_0xa523f0,_0xaa1e8f){return client[_0x7a09('0xb')](_0x494e2e,_0x27a558)[_0x7a09('0xc')](function(_0x180ae5){logger[_0x7a09('0xd')](_0x7a09('0xe'),_0xfec8b4,'request\x20sent');logger[_0x7a09('0xf')](_0x7a09('0x10'),_0xfec8b4,_0x7a09('0x11'),JSON['stringify'](_0x180ae5));if(_0x180ae5['error']){if(_0x180ae5['error']['code']===0x1f4){logger[_0x7a09('0x12')](_0x7a09('0xe'),_0xfec8b4,_0x180ae5['error'][_0x7a09('0x13')]);return _0xaa1e8f(_0x180ae5[_0x7a09('0x12')][_0x7a09('0x13')]);}logger[_0x7a09('0x12')](_0x7a09('0xe'),_0xfec8b4,_0x180ae5[_0x7a09('0x12')][_0x7a09('0x13')]);return _0xa523f0(_0x180ae5[_0x7a09('0x12')][_0x7a09('0x13')]);}else{logger[_0x7a09('0xd')](_0x7a09('0xe'),_0xfec8b4,'request\x20sent');_0xa523f0(_0x180ae5[_0x7a09('0x14')]['message']);}})[_0x7a09('0x15')](function(_0x5c0af6){logger[_0x7a09('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0xfec8b4,_0x5c0af6);_0xaa1e8f(_0x5c0af6);});});}exports[_0x7a09('0x16')]=function(_0x38a983){var _0x107e1a=this;return new Promise(function(_0x8ab2a1,_0x3ed093){return db['CmHopperBlack'][_0x7a09('0x17')]({'raw':_0x38a983[_0x7a09('0x18')]?_0x38a983[_0x7a09('0x18')][_0x7a09('0x19')]===undefined?!![]:![]:!![],'where':_0x38a983['options']?_0x38a983[_0x7a09('0x18')][_0x7a09('0x1a')]||null:null,'attributes':_0x38a983[_0x7a09('0x18')]?_0x38a983['options']['attributes']||null:null,'limit':_0x38a983[_0x7a09('0x18')]?_0x38a983[_0x7a09('0x18')][_0x7a09('0x1b')]||null:null,'include':_0x38a983['options']?_0x38a983[_0x7a09('0x18')]['include']?_[_0x7a09('0x1c')](_0x38a983[_0x7a09('0x18')][_0x7a09('0x1d')],function(_0x579fab){return{'model':db[_0x579fab[_0x7a09('0x1e')]],'as':_0x579fab['as'],'attributes':_0x579fab[_0x7a09('0x1f')],'include':_0x579fab[_0x7a09('0x1d')]?_['map'](_0x579fab[_0x7a09('0x1d')],function(_0x1daecf){return{'model':db[_0x1daecf[_0x7a09('0x1e')]],'as':_0x1daecf['as'],'attributes':_0x1daecf['attributes'],'include':_0x1daecf[_0x7a09('0x1d')]?_['map'](_0x1daecf[_0x7a09('0x1d')],function(_0x171583){return{'model':db[_0x171583[_0x7a09('0x1e')]],'as':_0x171583['as'],'attributes':_0x171583[_0x7a09('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7a09('0xc')](function(_0x14a312){logger[_0x7a09('0xd')](_0x7a09('0x16'),_0x38a983);logger[_0x7a09('0xf')](_0x7a09('0x16'),_0x38a983,JSON['stringify'](_0x14a312));_0x8ab2a1(_0x14a312);})['catch'](function(_0x435883){logger['error'](_0x7a09('0x16'),_0x435883[_0x7a09('0x13')],_0x38a983);_0x3ed093(_0x107e1a[_0x7a09('0x12')](0x1f4,_0x435883[_0x7a09('0x13')]));});});};exports[_0x7a09('0x20')]=function(_0x5add50){var _0x1c86e2=this;return new Promise(function(_0x56220d,_0x3c61d6){return db[_0x7a09('0x21')]['update'](_0x5add50[_0x7a09('0x22')],{'raw':_0x5add50['options']?_0x5add50[_0x7a09('0x18')][_0x7a09('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5add50[_0x7a09('0x18')]?_0x5add50[_0x7a09('0x18')][_0x7a09('0x1a')]||null:null,'attributes':_0x5add50[_0x7a09('0x18')]?_0x5add50[_0x7a09('0x18')]['attributes']||null:null,'limit':_0x5add50[_0x7a09('0x18')]?_0x5add50['options']['limit']||null:null})[_0x7a09('0xc')](function(_0x18ce67){logger[_0x7a09('0xd')](_0x7a09('0x20'),_0x5add50);logger[_0x7a09('0xf')](_0x7a09('0x20'),_0x5add50,JSON[_0x7a09('0x23')](_0x18ce67));_0x56220d(_0x18ce67);})[_0x7a09('0x15')](function(_0x497be2){logger[_0x7a09('0x12')](_0x7a09('0x20'),_0x497be2[_0x7a09('0x13')],_0x5add50);_0x3c61d6(_0x1c86e2['error'](0x1f4,_0x497be2[_0x7a09('0x13')]));});});};exports[_0x7a09('0x24')]=function(_0x511388){var _0x59dcf2=this;return new Promise(function(_0x56e8bb,_0x2f171d){return db[_0x7a09('0x21')][_0x7a09('0x25')]({'where':_0x511388[_0x7a09('0x18')]?_0x511388['options'][_0x7a09('0x1a')]||null:null})[_0x7a09('0xc')](function(_0x2b1412){logger['info'](_0x7a09('0x24'),_0x511388);logger[_0x7a09('0xf')](_0x7a09('0x24'),_0x511388,JSON[_0x7a09('0x23')](_0x2b1412));_0x56e8bb(_0x2b1412);})[_0x7a09('0x15')](function(_0x81f00b){logger[_0x7a09('0x12')](_0x7a09('0x24'),_0x81f00b[_0x7a09('0x13')],_0x511388);_0x2f171d(_0x59dcf2['error'](0x1f4,_0x81f00b[_0x7a09('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index cc13370..4025f6b 100644 --- a/server/api/cmHopperBlack/index.js +++ b/server/api/cmHopperBlack/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x425d=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x599c94,_0x464f0e){var _0x34e215=function(_0x36295a){while(--_0x36295a){_0x599c94['push'](_0x599c94['shift']());}};_0x34e215(++_0x464f0e);}(_0x425d,0x1e0));var _0xd425=function(_0x52f247,_0x329e5f){_0x52f247=_0x52f247-0x0;var _0x48c78d=_0x425d[_0x52f247];return _0x48c78d;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var auth=require(_0xd425('0x5'));var interaction=require(_0xd425('0x6'));var config=require(_0xd425('0x7'));var controller=require('./cmHopperBlack.controller');router[_0xd425('0x8')]('/',auth[_0xd425('0x9')](),controller[_0xd425('0xa')]);router[_0xd425('0x8')](_0xd425('0xb'),auth[_0xd425('0x9')](),controller['describe']);router[_0xd425('0x8')](_0xd425('0xc'),auth[_0xd425('0x9')](),controller[_0xd425('0xd')]);router[_0xd425('0xe')](_0xd425('0xc'),auth[_0xd425('0x9')](),controller[_0xd425('0xf')]);router[_0xd425('0x10')](_0xd425('0xc'),auth[_0xd425('0x9')](),controller[_0xd425('0x11')]);module[_0xd425('0x12')]=router; \ No newline at end of file +var _0xd6d6=['./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2a00a7,_0x1fdf20){var _0x4674ae=function(_0x1e881f){while(--_0x1e881f){_0x2a00a7['push'](_0x2a00a7['shift']());}};_0x4674ae(++_0x1fdf20);}(_0xd6d6,0xbe));var _0x6d6d=function(_0xd69681,_0x1ab828){_0xd69681=_0xd69681-0x0;var _0x49069c=_0xd6d6[_0xd69681];return _0x49069c;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require(_0x6d6d('0x3'));var express=require('express');var router=express[_0x6d6d('0x4')]();var auth=require(_0x6d6d('0x5'));var interaction=require(_0x6d6d('0x6'));var config=require(_0x6d6d('0x7'));var controller=require(_0x6d6d('0x8'));router[_0x6d6d('0x9')]('/',auth[_0x6d6d('0xa')](),controller['index']);router[_0x6d6d('0x9')](_0x6d6d('0xb'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0xc')]);router[_0x6d6d('0x9')](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller['show']);router['put'](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0xe')]);router[_0x6d6d('0xf')](_0x6d6d('0xd'),auth['isAuthenticated'](),controller[_0x6d6d('0x10')]);module[_0x6d6d('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 82af988..cd02809 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.attributes.js +++ b/server/api/cmHopperFinal/cmHopperFinal.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb45f=['sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','seconds','dispositionat','BOOLEAN'];(function(_0x298431,_0x1ffbb8){var _0x5b3657=function(_0x48e363){while(--_0x48e363){_0x298431['push'](_0x298431['shift']());}};_0x5b3657(++_0x1ffbb8);}(_0xb45f,0x1b0));var _0xfb45=function(_0x49a3dd,_0x50f02d){_0x49a3dd=_0x49a3dd-0x0;var _0x7eb4f0=_0xb45f[_0x49a3dd];return _0x7eb4f0;};'use strict';var Sequelize=require(_0xfb45('0x0'));var moment=require(_0xfb45('0x1'));module[_0xfb45('0x2')]={'state':{'type':Sequelize[_0xfb45('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xfb45('0x4')]},'scheduledat':{'type':Sequelize[_0xfb45('0x5')]},'countbusyretry':{'type':Sequelize[_0xfb45('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xfb45('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfb45('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xfb45('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xfb45('0x4')]},'originatecalleridname':{'type':Sequelize[_0xfb45('0x4')]},'calleridnum':{'type':Sequelize[_0xfb45('0x4')]},'calleridname':{'type':Sequelize[_0xfb45('0x4')]},'starttime':{'type':Sequelize[_0xfb45('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xfb45('0x5')]},'droptime':{'type':Sequelize[_0xfb45('0x5')]},'endtime':{'type':Sequelize[_0xfb45('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfb45('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfb45('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfb45('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xfb45('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xfb45('0x4')]},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xfb45('0x5')],'set':function(_0x14d9b2){var _0x12f83b=this[_0xfb45('0x6')]('endtime');if(_0x12f83b&&_0x14d9b2){this[_0xfb45('0x7')](_0xfb45('0x8'),moment(_0x14d9b2)['diff'](moment(_0x12f83b),_0xfb45('0x9')));}return this[_0xfb45('0x7')](_0xfb45('0xa'),_0x14d9b2);}},'amd':{'type':Sequelize[_0xfb45('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xfb45('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xfb45('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xfb45('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfb45('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xfb45('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xfb45('0x5')]},'recallme':{'type':Sequelize[_0xfb45('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xfb45('0x5')]}}; \ No newline at end of file +var _0x383c=['dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','seconds'];(function(_0x594c2f,_0x59d4bf){var _0x191347=function(_0x439bda){while(--_0x439bda){_0x594c2f['push'](_0x594c2f['shift']());}};_0x191347(++_0x59d4bf);}(_0x383c,0xe6));var _0xc383=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x383c[_0x42bdad];return _0x122626;};'use strict';var Sequelize=require(_0xc383('0x0'));var moment=require(_0xc383('0x1'));module[_0xc383('0x2')]={'state':{'type':Sequelize[_0xc383('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xc383('0x4')]},'scheduledat':{'type':Sequelize[_0xc383('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc383('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc383('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc383('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xc383('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc383('0x4')]},'calleridname':{'type':Sequelize[_0xc383('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xc383('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xc383('0x5')]},'endtime':{'type':Sequelize[_0xc383('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc383('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc383('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc383('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xc383('0x4')]},'campaigntype':{'type':Sequelize[_0xc383('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xc383('0x4')]},'disposition':{'type':Sequelize[_0xc383('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x2b896e){var _0x3c3d43=this[_0xc383('0x6')]('endtime');if(_0x3c3d43&&_0x2b896e){this[_0xc383('0x7')](_0xc383('0x8'),moment(_0x2b896e)['diff'](moment(_0x3c3d43),_0xc383('0x9')));}return this[_0xc383('0x7')](_0xc383('0xa'),_0x2b896e);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xc383('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xc383('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc383('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xc383('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xc383('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index e765532..58c63e1 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.controller.js +++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbfd3=['params','includeAll','include','find','catch','describe','update','uniqueid','body','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','createdAt','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','group','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x204','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','then','error','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','map','type','key','VIRTUAL','field','options','CmHopperFinal','rows','show'];(function(_0x41eb8b,_0x8e630f){var _0x57f6be=function(_0x552d87){while(--_0x552d87){_0x41eb8b['push'](_0x41eb8b['shift']());}};_0x57f6be(++_0x8e630f);}(_0xbfd3,0x144));var _0x3bfd=function(_0x9930f9,_0xb6b473){_0x9930f9=_0x9930f9-0x0;var _0x23ee0a=_0xbfd3[_0x9930f9];return _0x23ee0a;};'use strict';var pdf=require(_0x3bfd('0x0'));var emlformat=require(_0x3bfd('0x1'));var rimraf=require(_0x3bfd('0x2'));var zipdir=require(_0x3bfd('0x3'));var jsonpatch=require(_0x3bfd('0x4'));var rp=require('request-promise');var moment=require(_0x3bfd('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3bfd('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3bfd('0x7'));var ejs=require(_0x3bfd('0x8'));var fs=require('fs');var _=require(_0x3bfd('0x9'));var squel=require(_0x3bfd('0xa'));var crypto=require(_0x3bfd('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3bfd('0x7'));var querystring=require(_0x3bfd('0xc'));var Papa=require(_0x3bfd('0xd'));var Redis=require('ioredis');var authService=require(_0x3bfd('0xe'));var qs=require(_0x3bfd('0xf'));var hardwareService=require(_0x3bfd('0x10'));var logger=require(_0x3bfd('0x11'))(_0x3bfd('0x12'));var utils=require(_0x3bfd('0x13'));var config=require(_0x3bfd('0x14'));var db=require(_0x3bfd('0x15'))['db'];function respondWithStatusCode(_0x2ca7e8,_0x27eadd){_0x27eadd=_0x27eadd||0xcc;return function(_0x16ec95){if(_0x16ec95){return _0x2ca7e8[_0x3bfd('0x16')](_0x27eadd);}return _0x2ca7e8['status'](_0x27eadd)[_0x3bfd('0x17')]();};}function respondWithResult(_0x202649,_0x5802a4){_0x5802a4=_0x5802a4||0xc8;return function(_0x33ab85){if(_0x33ab85){return _0x202649[_0x3bfd('0x18')](_0x5802a4)[_0x3bfd('0x19')](_0x33ab85);}};}function respondWithFilteredResult(_0x3b6bfb,_0x20506c){return function(_0x584cf2){if(_0x584cf2){var _0x43c174=_0x584cf2[_0x3bfd('0x1a')],_0x1f3ebf=_0x20506c[_0x3bfd('0x1b')],_0x4f25f0=_0x20506c[_0x3bfd('0x1b')]+_0x20506c[_0x3bfd('0x1c')],_0x18bba0;if(_0x4f25f0>=_0x43c174){_0x4f25f0=_0x43c174;_0x18bba0=0xc8;}else{_0x18bba0=0xce;}_0x3b6bfb['status'](_0x18bba0);return _0x3b6bfb[_0x3bfd('0x1d')]('Content-Range',_0x1f3ebf+'-'+_0x4f25f0+'/'+_0x43c174)[_0x3bfd('0x19')](_0x584cf2);}return null;};}function patchUpdates(_0x3f45a8){return function(_0x24e378){try{jsonpatch[_0x3bfd('0x1e')](_0x24e378,_0x3f45a8,!![]);}catch(_0x1a87ba){return BPromise[_0x3bfd('0x1f')](_0x1a87ba);}return _0x24e378['save']();};}function saveUpdates(_0x1a2b1c,_0x1a192a){return function(_0x1ca2af){if(_0x1ca2af){return _0x1ca2af['update'](_0x1a2b1c)['then'](function(_0x5764e8){return _0x5764e8;});}return null;};}function removeEntity(_0x121342,_0x260114){return function(_0x2acfea){if(_0x2acfea){return _0x2acfea['destroy']()[_0x3bfd('0x20')](function(){_0x121342[_0x3bfd('0x18')](0xcc)[_0x3bfd('0x17')]();});}};}function handleEntityNotFound(_0x5b1c32,_0x3dcb1f){return function(_0xb8e84f){if(!_0xb8e84f){_0x5b1c32[_0x3bfd('0x16')](0x194);}return _0xb8e84f;};}function handleError(_0x4587a3,_0x770b4c){_0x770b4c=_0x770b4c||0x1f4;return function(_0x2db772){logger[_0x3bfd('0x21')](_0x2db772['stack']);if(_0x2db772[_0x3bfd('0x22')]){delete _0x2db772[_0x3bfd('0x22')];}_0x4587a3[_0x3bfd('0x18')](_0x770b4c)['send'](_0x2db772);};}exports[_0x3bfd('0x23')]=function(_0x3c4578,_0x46f5e9){var _0x505f82={},_0x15cf39={},_0x2f613f={'count':0x0,'rows':[]};var _0x9d3da2=db['CmHopperFinal'][_0x3bfd('0x24')];_0x15cf39[_0x3bfd('0x25')]=_[_0x3bfd('0x26')](_0x9d3da2);_0x15cf39[_0x3bfd('0x27')]=_[_0x3bfd('0x26')](_0x3c4578[_0x3bfd('0x27')]);_0x15cf39[_0x3bfd('0x28')]=_[_0x3bfd('0x29')](_0x15cf39[_0x3bfd('0x25')],_0x15cf39[_0x3bfd('0x27')]);_0x505f82[_0x3bfd('0x2a')]=_['intersection'](_0x15cf39['model'],qs[_0x3bfd('0x2b')](_0x3c4578[_0x3bfd('0x27')][_0x3bfd('0x2b')]));_0x505f82[_0x3bfd('0x2a')]=_0x505f82[_0x3bfd('0x2a')][_0x3bfd('0x2c')]?_0x505f82[_0x3bfd('0x2a')]:_0x15cf39[_0x3bfd('0x25')];if(!_0x3c4578[_0x3bfd('0x27')][_0x3bfd('0x2d')]('nolimit')){_0x505f82[_0x3bfd('0x1c')]=qs['limit'](_0x3c4578['query'][_0x3bfd('0x1c')]);_0x505f82[_0x3bfd('0x1b')]=qs[_0x3bfd('0x1b')](_0x3c4578[_0x3bfd('0x27')][_0x3bfd('0x1b')]);}_0x505f82[_0x3bfd('0x2e')]=qs[_0x3bfd('0x2f')](_0x3c4578[_0x3bfd('0x27')][_0x3bfd('0x2f')]);_0x505f82['where']=qs[_0x3bfd('0x28')](_['pick'](_0x3c4578[_0x3bfd('0x27')],_0x15cf39[_0x3bfd('0x28')]));if(_0x3c4578[_0x3bfd('0x27')][_0x3bfd('0x30')]){_0x505f82[_0x3bfd('0x31')]=_[_0x3bfd('0x32')](_0x505f82['where'],{'$or':_[_0x3bfd('0x33')](_0x9d3da2,function(_0x2fd436){if(_0x2fd436[_0x3bfd('0x34')][_0x3bfd('0x35')]!==_0x3bfd('0x36')){var _0x394320={};_0x394320[_0x2fd436[_0x3bfd('0x37')]]={'$like':'%'+_0x3c4578[_0x3bfd('0x27')][_0x3bfd('0x30')]+'%'};return _0x394320;}})});}_0x505f82=_[_0x3bfd('0x32')]({},_0x505f82,_0x3c4578[_0x3bfd('0x38')]);var _0x2a129b={'where':_0x505f82[_0x3bfd('0x31')]};return db[_0x3bfd('0x39')][_0x3bfd('0x1a')](_0x2a129b)['then'](function(_0x63dada){_0x2f613f['count']=_0x63dada;if(_0x3c4578[_0x3bfd('0x27')]['includeAll']){_0x505f82['include']=[{'all':!![]}];}return db[_0x3bfd('0x39')]['findAll'](_0x505f82);})[_0x3bfd('0x20')](function(_0x136555){_0x2f613f[_0x3bfd('0x3a')]=_0x136555;return _0x2f613f;})['then'](respondWithFilteredResult(_0x46f5e9,_0x505f82))['catch'](handleError(_0x46f5e9,null));};exports[_0x3bfd('0x3b')]=function(_0x54f7e8,_0x3576bb){var _0x798ebd={'raw':!![],'where':{'id':_0x54f7e8[_0x3bfd('0x3c')]['id']}},_0x585d31={};_0x585d31['model']=_[_0x3bfd('0x26')](db[_0x3bfd('0x39')]['rawAttributes']);_0x585d31['query']=_['keys'](_0x54f7e8['query']);_0x585d31[_0x3bfd('0x28')]=_['intersection'](_0x585d31[_0x3bfd('0x25')],_0x585d31['query']);_0x798ebd[_0x3bfd('0x2a')]=_[_0x3bfd('0x29')](_0x585d31['model'],qs[_0x3bfd('0x2b')](_0x54f7e8[_0x3bfd('0x27')]['fields']));_0x798ebd[_0x3bfd('0x2a')]=_0x798ebd[_0x3bfd('0x2a')][_0x3bfd('0x2c')]?_0x798ebd['attributes']:_0x585d31[_0x3bfd('0x25')];if(_0x54f7e8['query'][_0x3bfd('0x3d')]){_0x798ebd[_0x3bfd('0x3e')]=[{'all':!![]}];}_0x798ebd=_['merge']({},_0x798ebd,_0x54f7e8[_0x3bfd('0x38')]);return db[_0x3bfd('0x39')][_0x3bfd('0x3f')](_0x798ebd)[_0x3bfd('0x20')](handleEntityNotFound(_0x3576bb,null))[_0x3bfd('0x20')](respondWithResult(_0x3576bb,null))[_0x3bfd('0x40')](handleError(_0x3576bb,null));};exports[_0x3bfd('0x41')]=function(_0x1e2310,_0x41c831){return db[_0x3bfd('0x39')][_0x3bfd('0x41')]()[_0x3bfd('0x20')](respondWithResult(_0x41c831,null))[_0x3bfd('0x40')](handleError(_0x41c831,null));};exports[_0x3bfd('0x42')]=function(_0xf7c000,_0x5b1ca5){if(_0xf7c000['body']['uniqueid']){delete _0xf7c000['body'][_0x3bfd('0x43')];}return db[_0x3bfd('0x39')][_0x3bfd('0x3f')]({'where':{'uniqueid':_0xf7c000['params']['id']}})[_0x3bfd('0x20')](handleEntityNotFound(_0x5b1ca5,null))[_0x3bfd('0x20')](saveUpdates(_0xf7c000[_0x3bfd('0x44')],null))[_0x3bfd('0x20')](respondWithResult(_0x5b1ca5,null))[_0x3bfd('0x40')](handleError(_0x5b1ca5,null));};exports[_0x3bfd('0x45')]=function(_0x192482,_0x3667e9,_0x12f0e7){return db['CmHopperFinal'][_0x3bfd('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x192482[_0x3bfd('0x3c')]['id']},'attributes':[[db[_0x3bfd('0x47')]['fn'](_0x3bfd('0x48'),db[_0x3bfd('0x47')]['fn']('IF',db[_0x3bfd('0x47')]['literal'](_0x3bfd('0x49')))),'noSuchContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3bfd('0x47')][_0x3bfd('0x4a')](_0x3bfd('0x4b')))),_0x3bfd('0x4c')],[db[_0x3bfd('0x47')]['fn'](_0x3bfd('0x48'),db[_0x3bfd('0x47')]['fn']('IF',db[_0x3bfd('0x47')][_0x3bfd('0x4a')](_0x3bfd('0x4d')))),_0x3bfd('0x4e')],[db['sequelize']['fn']('COUNT',db[_0x3bfd('0x47')]['fn']('IF',db[_0x3bfd('0x47')][_0x3bfd('0x4a')](_0x3bfd('0x4f')))),_0x3bfd('0x50')],[db['sequelize']['fn'](_0x3bfd('0x48'),db[_0x3bfd('0x47')]['fn']('IF',db[_0x3bfd('0x47')]['literal'](_0x3bfd('0x51')))),_0x3bfd('0x52')],[db[_0x3bfd('0x47')]['fn'](_0x3bfd('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x3bfd('0x4a')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x3bfd('0x53')],[db[_0x3bfd('0x47')]['fn'](_0x3bfd('0x48'),db[_0x3bfd('0x47')]['fn']('IF',db[_0x3bfd('0x47')][_0x3bfd('0x4a')](_0x3bfd('0x54')))),_0x3bfd('0x55')],[db[_0x3bfd('0x47')]['fn'](_0x3bfd('0x48'),db[_0x3bfd('0x47')]['fn']('IF',db[_0x3bfd('0x47')][_0x3bfd('0x4a')](_0x3bfd('0x56')))),_0x3bfd('0x57')]]})[_0x3bfd('0x20')](handleEntityNotFound(_0x3667e9,null))[_0x3bfd('0x20')](respondWithResult(_0x3667e9,null))['catch'](handleError(_0x3667e9,null));};exports[_0x3bfd('0x58')]=function(_0x52dbca,_0x5b7d71,_0x4ad6f6){return db[_0x3bfd('0x39')]['findAll']({'raw':![],'where':{'CampaignId':_0x52dbca[_0x3bfd('0x3c')]['id']},'attributes':[[db[_0x3bfd('0x47')]['fn'](_0x3bfd('0x48'),db['sequelize']['fn']('IF',db[_0x3bfd('0x47')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x3bfd('0x59')],[db[_0x3bfd('0x47')]['fn'](_0x3bfd('0x48'),db[_0x3bfd('0x47')]['fn']('IF',db['sequelize'][_0x3bfd('0x4a')](_0x3bfd('0x4b')))),_0x3bfd('0x4c')],[db[_0x3bfd('0x47')]['fn'](_0x3bfd('0x48'),db[_0x3bfd('0x47')]['fn']('IF',db[_0x3bfd('0x47')][_0x3bfd('0x4a')](_0x3bfd('0x4d')))),'busyContacts'],[db['sequelize']['fn'](_0x3bfd('0x48'),db[_0x3bfd('0x47')]['fn']('IF',db[_0x3bfd('0x47')][_0x3bfd('0x4a')](_0x3bfd('0x4f')))),'congestionContacts'],[db[_0x3bfd('0x47')]['fn'](_0x3bfd('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x3bfd('0x4a')](_0x3bfd('0x51')))),_0x3bfd('0x52')],[db[_0x3bfd('0x47')]['fn']('COUNT',db[_0x3bfd('0x47')]['fn']('IF',db[_0x3bfd('0x47')][_0x3bfd('0x4a')](_0x3bfd('0x5a')))),'abandonedContacts'],[db[_0x3bfd('0x47')]['fn'](_0x3bfd('0x48'),db[_0x3bfd('0x47')]['fn']('IF',db[_0x3bfd('0x47')][_0x3bfd('0x4a')](_0x3bfd('0x54')))),_0x3bfd('0x55')],[db[_0x3bfd('0x47')]['fn'](_0x3bfd('0x48'),db[_0x3bfd('0x47')]['fn']('IF',db['sequelize']['literal'](_0x3bfd('0x56')))),'answeringMachine']]})[_0x3bfd('0x20')](handleEntityNotFound(_0x5b7d71,null))[_0x3bfd('0x20')](respondWithResult(_0x5b7d71,null))[_0x3bfd('0x40')](handleError(_0x5b7d71,null));};exports[_0x3bfd('0x5b')]=function(_0x274111,_0x442c5d,_0xb7806){return db[_0x3bfd('0x5c')][_0x3bfd('0x3f')]({'where':{'id':_0x274111[_0x3bfd('0x3c')]['id']}})[_0x3bfd('0x20')](handleEntityNotFound(_0x442c5d,null))[_0x3bfd('0x20')](function(_0x171691){var _0x17fad9;if(_0x171691){_0x17fad9=squel[_0x3bfd('0x5d')]()[_0x3bfd('0x5e')](_0x3bfd('0x5f'))[_0x3bfd('0x60')]([_0x3bfd('0x61'),_0x3bfd('0x62'),'ContactId',_0x3bfd('0x63'),_0x3bfd('0x64'),'createdAt','updatedAt'],squel['select']()[_0x3bfd('0x37')](_0x3bfd('0x65'),'phone')[_0x3bfd('0x37')](_0x3bfd('0x66'),'scheduledAt')[_0x3bfd('0x37')](_0x3bfd('0x67'),_0x3bfd('0x68'))['field'](_0x3bfd('0x69'),_0x3bfd('0x63'))['field'](_0x3bfd('0x6a'),'VoiceQueueId')[_0x3bfd('0x37')]('NOW()',_0x3bfd('0x6b'))['field'](_0x3bfd('0x66'),_0x3bfd('0x6c'))[_0x3bfd('0x6d')](_0x3bfd('0x6e'))[_0x3bfd('0x31')](_0x3bfd('0x6f'),_0x274111['params']['id'][_0x3bfd('0x70')]())[_0x3bfd('0x31')](_0x3bfd('0x71'),_0x274111['body'][_0x3bfd('0x72')][_0x3bfd('0x70')]())[_0x3bfd('0x31')](_0x3bfd('0x73'))['where'](_0x3bfd('0x74'),squel[_0x3bfd('0x75')]()[_0x3bfd('0x37')]('phone')[_0x3bfd('0x6d')](_0x3bfd('0x5f'))['where'](_0x3bfd('0x6f'),_0x274111[_0x3bfd('0x3c')]['id'][_0x3bfd('0x70')]()))['where'](_0x3bfd('0x74'),squel[_0x3bfd('0x75')]()[_0x3bfd('0x37')](_0x3bfd('0x76'))[_0x3bfd('0x6d')](_0x3bfd('0x6e'))[_0x3bfd('0x31')](_0x3bfd('0x6f'),_0x274111[_0x3bfd('0x3c')]['id'][_0x3bfd('0x70')]())['where']('state\x20=\x204'))[_0x3bfd('0x77')](_0x3bfd('0x68')))['toString']();return db['sequelize'][_0x3bfd('0x27')](_0x17fad9);}return[];})[_0x3bfd('0x20')](respondWithResult(_0x442c5d,null))[_0x3bfd('0x40')](handleError(_0x442c5d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x2710a,_0x14578c,_0x5794c1){return db[_0x3bfd('0x78')]['find']({'where':{'id':_0x2710a[_0x3bfd('0x3c')]['id']}})[_0x3bfd('0x20')](handleEntityNotFound(_0x14578c,null))[_0x3bfd('0x20')](function(_0x50aa1f){var _0x4e98c4;if(_0x50aa1f){_0x4e98c4=squel[_0x3bfd('0x5d')]()['into'](_0x3bfd('0x5f'))[_0x3bfd('0x60')]([_0x3bfd('0x61'),_0x3bfd('0x62'),_0x3bfd('0x68'),_0x3bfd('0x63'),_0x3bfd('0x79'),_0x3bfd('0x6b'),_0x3bfd('0x6c')],squel['select']()[_0x3bfd('0x37')](_0x3bfd('0x65'),_0x3bfd('0x61'))['field'](_0x3bfd('0x66'),_0x3bfd('0x62'))[_0x3bfd('0x37')](_0x3bfd('0x67'),'ContactId')[_0x3bfd('0x37')]('ANY_VALUE(ListId)','ListId')['field'](_0x3bfd('0x7a'),_0x3bfd('0x79'))[_0x3bfd('0x37')](_0x3bfd('0x66'),_0x3bfd('0x6b'))[_0x3bfd('0x37')](_0x3bfd('0x66'),_0x3bfd('0x6c'))[_0x3bfd('0x6d')](_0x3bfd('0x6e'))[_0x3bfd('0x31')](_0x3bfd('0x7b'),_0x2710a[_0x3bfd('0x3c')]['id'][_0x3bfd('0x70')]())[_0x3bfd('0x31')]('state\x20=\x20?',_0x2710a[_0x3bfd('0x44')][_0x3bfd('0x72')][_0x3bfd('0x70')]())[_0x3bfd('0x31')](_0x3bfd('0x73'))[_0x3bfd('0x31')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x3bfd('0x37')](_0x3bfd('0x61'))['from']('cm_hopper')['where'](_0x3bfd('0x7b'),_0x2710a[_0x3bfd('0x3c')]['id']['toString']()))[_0x3bfd('0x31')](_0x3bfd('0x74'),squel['select']()[_0x3bfd('0x37')]('calleridnum')[_0x3bfd('0x6d')](_0x3bfd('0x6e'))[_0x3bfd('0x31')](_0x3bfd('0x7b'),_0x2710a[_0x3bfd('0x3c')]['id'][_0x3bfd('0x70')]())['where'](_0x3bfd('0x7c')))[_0x3bfd('0x77')](_0x3bfd('0x68')))[_0x3bfd('0x70')]();return db[_0x3bfd('0x47')][_0x3bfd('0x27')](_0x4e98c4);}return[];})[_0x3bfd('0x20')](respondWithResult(_0x14578c,null))[_0x3bfd('0x40')](handleError(_0x14578c,null));};exports[_0x3bfd('0x7d')]=function(_0x30b8ce,_0x323f97,_0x38b7ab){return db[_0x3bfd('0x7e')][_0x3bfd('0x7f')]({'where':{'VoiceQueueId':_0x30b8ce[_0x3bfd('0x44')][_0x3bfd('0x64')],'CampaignId':_0x30b8ce[_0x3bfd('0x44')][_0x3bfd('0x79')],'ContactId':_0x30b8ce[_0x3bfd('0x44')][_0x3bfd('0x68')]}})['then'](handleEntityNotFound(_0x323f97,null))[_0x3bfd('0x20')](function(_0x40a8f8){if(_0x40a8f8){return _0x40a8f8;}return null;})[_0x3bfd('0x20')](respondWithResult(_0x323f97,null))[_0x3bfd('0x40')](handleError(_0x323f97,null));}; \ No newline at end of file +var _0x2636=['catch','show','params','rawAttributes','includeAll','include','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','updatedAt','select','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','createdAt','VoiceQueueId\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','calleridnum','from','cm_hopper_final','moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','state\x20=\x204','group','checkContactHopper','findOne','html-pdf','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','count','offset','Content-Range','json','reject','update','then','destroy','end','error','stack','name','send','index','CmHopperFinal','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','field','findAll'];(function(_0x3f9ac2,_0x1b670b){var _0xe6a436=function(_0x1f3ea5){while(--_0x1f3ea5){_0x3f9ac2['push'](_0x3f9ac2['shift']());}};_0xe6a436(++_0x1b670b);}(_0x2636,0x1c0));var _0x6263=function(_0x206315,_0x4eb8ef){_0x206315=_0x206315-0x0;var _0x1f63e8=_0x2636[_0x206315];return _0x1f63e8;};'use strict';var pdf=require(_0x6263('0x0'));var emlformat=require(_0x6263('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6263('0x2'));var moment=require(_0x6263('0x3'));var BPromise=require(_0x6263('0x4'));var Mustache=require('mustache');var util=require(_0x6263('0x5'));var path=require(_0x6263('0x6'));var sox=require(_0x6263('0x7'));var csv=require(_0x6263('0x8'));var ejs=require(_0x6263('0x9'));var fs=require('fs');var _=require(_0x6263('0xa'));var squel=require(_0x6263('0xb'));var crypto=require(_0x6263('0xc'));var jsforce=require(_0x6263('0xd'));var deskjs=require(_0x6263('0xe'));var toCsv=require(_0x6263('0x8'));var querystring=require('querystring');var Papa=require(_0x6263('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6263('0x10'));var hardwareService=require(_0x6263('0x11'));var logger=require(_0x6263('0x12'))('api');var utils=require(_0x6263('0x13'));var config=require(_0x6263('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x71f46c,_0x43f09a){_0x43f09a=_0x43f09a||0xcc;return function(_0x2d3d7d){if(_0x2d3d7d){return _0x71f46c[_0x6263('0x15')](_0x43f09a);}return _0x71f46c['status'](_0x43f09a)['end']();};}function respondWithResult(_0x1dd344,_0x4b2f1c){_0x4b2f1c=_0x4b2f1c||0xc8;return function(_0x3984a1){if(_0x3984a1){return _0x1dd344[_0x6263('0x16')](_0x4b2f1c)['json'](_0x3984a1);}};}function respondWithFilteredResult(_0x2afec8,_0x2ae3a9){return function(_0x384ba2){if(_0x384ba2){var _0x45c180=_0x384ba2[_0x6263('0x17')],_0x4dc804=_0x2ae3a9[_0x6263('0x18')],_0x4583c1=_0x2ae3a9[_0x6263('0x18')]+_0x2ae3a9['limit'],_0x59dd74;if(_0x4583c1>=_0x45c180){_0x4583c1=_0x45c180;_0x59dd74=0xc8;}else{_0x59dd74=0xce;}_0x2afec8[_0x6263('0x16')](_0x59dd74);return _0x2afec8['set'](_0x6263('0x19'),_0x4dc804+'-'+_0x4583c1+'/'+_0x45c180)[_0x6263('0x1a')](_0x384ba2);}return null;};}function patchUpdates(_0x4ccf0f){return function(_0xc99f08){try{jsonpatch['apply'](_0xc99f08,_0x4ccf0f,!![]);}catch(_0x5edb0b){return BPromise[_0x6263('0x1b')](_0x5edb0b);}return _0xc99f08['save']();};}function saveUpdates(_0x5bc71a,_0x3699c0){return function(_0x4489fa){if(_0x4489fa){return _0x4489fa[_0x6263('0x1c')](_0x5bc71a)[_0x6263('0x1d')](function(_0x1e660c){return _0x1e660c;});}return null;};}function removeEntity(_0x17fbe4,_0x23abcf){return function(_0x689f26){if(_0x689f26){return _0x689f26[_0x6263('0x1e')]()[_0x6263('0x1d')](function(){_0x17fbe4[_0x6263('0x16')](0xcc)[_0x6263('0x1f')]();});}};}function handleEntityNotFound(_0x2b02e4,_0x2a9bd9){return function(_0x3d0add){if(!_0x3d0add){_0x2b02e4[_0x6263('0x15')](0x194);}return _0x3d0add;};}function handleError(_0x22a8cc,_0x5150fa){_0x5150fa=_0x5150fa||0x1f4;return function(_0x582e94){logger[_0x6263('0x20')](_0x582e94[_0x6263('0x21')]);if(_0x582e94[_0x6263('0x22')]){delete _0x582e94[_0x6263('0x22')];}_0x22a8cc[_0x6263('0x16')](_0x5150fa)[_0x6263('0x23')](_0x582e94);};}exports[_0x6263('0x24')]=function(_0x5e47f6,_0x3c25b3){var _0x48f57a={},_0x3e6605={},_0x441538={'count':0x0,'rows':[]};var _0x59418c=db[_0x6263('0x25')]['rawAttributes'];_0x3e6605[_0x6263('0x26')]=_[_0x6263('0x27')](_0x59418c);_0x3e6605[_0x6263('0x28')]=_[_0x6263('0x27')](_0x5e47f6['query']);_0x3e6605[_0x6263('0x29')]=_[_0x6263('0x2a')](_0x3e6605[_0x6263('0x26')],_0x3e6605['query']);_0x48f57a[_0x6263('0x2b')]=_['intersection'](_0x3e6605[_0x6263('0x26')],qs[_0x6263('0x2c')](_0x5e47f6[_0x6263('0x28')]['fields']));_0x48f57a[_0x6263('0x2b')]=_0x48f57a[_0x6263('0x2b')][_0x6263('0x2d')]?_0x48f57a[_0x6263('0x2b')]:_0x3e6605[_0x6263('0x26')];if(!_0x5e47f6[_0x6263('0x28')][_0x6263('0x2e')](_0x6263('0x2f'))){_0x48f57a[_0x6263('0x30')]=qs['limit'](_0x5e47f6[_0x6263('0x28')][_0x6263('0x30')]);_0x48f57a[_0x6263('0x18')]=qs[_0x6263('0x18')](_0x5e47f6[_0x6263('0x28')][_0x6263('0x18')]);}_0x48f57a[_0x6263('0x31')]=qs[_0x6263('0x32')](_0x5e47f6[_0x6263('0x28')][_0x6263('0x32')]);_0x48f57a['where']=qs[_0x6263('0x29')](_[_0x6263('0x33')](_0x5e47f6[_0x6263('0x28')],_0x3e6605[_0x6263('0x29')]));if(_0x5e47f6[_0x6263('0x28')][_0x6263('0x34')]){_0x48f57a[_0x6263('0x35')]=_[_0x6263('0x36')](_0x48f57a[_0x6263('0x35')],{'$or':_[_0x6263('0x37')](_0x59418c,function(_0x889e88){if(_0x889e88[_0x6263('0x38')][_0x6263('0x39')]!=='VIRTUAL'){var _0x27910b={};_0x27910b[_0x889e88[_0x6263('0x3a')]]={'$like':'%'+_0x5e47f6[_0x6263('0x28')][_0x6263('0x34')]+'%'};return _0x27910b;}})});}_0x48f57a=_[_0x6263('0x36')]({},_0x48f57a,_0x5e47f6['options']);var _0x42939f={'where':_0x48f57a['where']};return db['CmHopperFinal']['count'](_0x42939f)['then'](function(_0x15e6bf){_0x441538[_0x6263('0x17')]=_0x15e6bf;if(_0x5e47f6['query']['includeAll']){_0x48f57a['include']=[{'all':!![]}];}return db[_0x6263('0x25')][_0x6263('0x3b')](_0x48f57a);})[_0x6263('0x1d')](function(_0x533f73){_0x441538['rows']=_0x533f73;return _0x441538;})[_0x6263('0x1d')](respondWithFilteredResult(_0x3c25b3,_0x48f57a))[_0x6263('0x3c')](handleError(_0x3c25b3,null));};exports[_0x6263('0x3d')]=function(_0x1f8862,_0x107d49){var _0x489ddc={'raw':!![],'where':{'id':_0x1f8862[_0x6263('0x3e')]['id']}},_0x2a8ace={};_0x2a8ace[_0x6263('0x26')]=_[_0x6263('0x27')](db[_0x6263('0x25')][_0x6263('0x3f')]);_0x2a8ace[_0x6263('0x28')]=_[_0x6263('0x27')](_0x1f8862[_0x6263('0x28')]);_0x2a8ace[_0x6263('0x29')]=_[_0x6263('0x2a')](_0x2a8ace[_0x6263('0x26')],_0x2a8ace[_0x6263('0x28')]);_0x489ddc[_0x6263('0x2b')]=_[_0x6263('0x2a')](_0x2a8ace[_0x6263('0x26')],qs[_0x6263('0x2c')](_0x1f8862[_0x6263('0x28')][_0x6263('0x2c')]));_0x489ddc['attributes']=_0x489ddc[_0x6263('0x2b')][_0x6263('0x2d')]?_0x489ddc[_0x6263('0x2b')]:_0x2a8ace['model'];if(_0x1f8862[_0x6263('0x28')][_0x6263('0x40')]){_0x489ddc[_0x6263('0x41')]=[{'all':!![]}];}_0x489ddc=_[_0x6263('0x36')]({},_0x489ddc,_0x1f8862['options']);return db['CmHopperFinal'][_0x6263('0x42')](_0x489ddc)['then'](handleEntityNotFound(_0x107d49,null))['then'](respondWithResult(_0x107d49,null))[_0x6263('0x3c')](handleError(_0x107d49,null));};exports[_0x6263('0x43')]=function(_0x1d4211,_0x5c2164){return db['CmHopperFinal'][_0x6263('0x43')]()[_0x6263('0x1d')](respondWithResult(_0x5c2164,null))[_0x6263('0x3c')](handleError(_0x5c2164,null));};exports['update']=function(_0x200b19,_0xaae784){if(_0x200b19['body'][_0x6263('0x44')]){delete _0x200b19[_0x6263('0x45')][_0x6263('0x44')];}return db[_0x6263('0x25')][_0x6263('0x42')]({'where':{'uniqueid':_0x200b19[_0x6263('0x3e')]['id']}})[_0x6263('0x1d')](handleEntityNotFound(_0xaae784,null))[_0x6263('0x1d')](saveUpdates(_0x200b19['body'],null))['then'](respondWithResult(_0xaae784,null))['catch'](handleError(_0xaae784,null));};exports[_0x6263('0x46')]=function(_0x59c3c0,_0x2c7c9a,_0x406790){return db[_0x6263('0x25')][_0x6263('0x3b')]({'raw':![],'where':{'VoiceQueueId':_0x59c3c0[_0x6263('0x3e')]['id']},'attributes':[[db[_0x6263('0x47')]['fn'](_0x6263('0x48'),db['sequelize']['fn']('IF',db[_0x6263('0x47')][_0x6263('0x49')](_0x6263('0x4a')))),_0x6263('0x4b')],[db[_0x6263('0x47')]['fn'](_0x6263('0x48'),db[_0x6263('0x47')]['fn']('IF',db[_0x6263('0x47')][_0x6263('0x49')](_0x6263('0x4c')))),_0x6263('0x4d')],[db[_0x6263('0x47')]['fn']('COUNT',db[_0x6263('0x47')]['fn']('IF',db[_0x6263('0x47')][_0x6263('0x49')](_0x6263('0x4e')))),_0x6263('0x4f')],[db[_0x6263('0x47')]['fn'](_0x6263('0x48'),db[_0x6263('0x47')]['fn']('IF',db[_0x6263('0x47')][_0x6263('0x49')]('`state`\x20=\x208,\x201,\x20null'))),_0x6263('0x50')],[db[_0x6263('0x47')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6263('0x47')][_0x6263('0x49')](_0x6263('0x51')))),_0x6263('0x52')],[db['sequelize']['fn'](_0x6263('0x48'),db[_0x6263('0x47')]['fn']('IF',db[_0x6263('0x47')][_0x6263('0x49')](_0x6263('0x53')))),_0x6263('0x54')],[db[_0x6263('0x47')]['fn'](_0x6263('0x48'),db[_0x6263('0x47')]['fn']('IF',db[_0x6263('0x47')][_0x6263('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),_0x6263('0x55')],[db[_0x6263('0x47')]['fn'](_0x6263('0x48'),db[_0x6263('0x47')]['fn']('IF',db['sequelize'][_0x6263('0x49')](_0x6263('0x56')))),_0x6263('0x57')]]})[_0x6263('0x1d')](handleEntityNotFound(_0x2c7c9a,null))[_0x6263('0x1d')](respondWithResult(_0x2c7c9a,null))[_0x6263('0x3c')](handleError(_0x2c7c9a,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xb0eb6b,_0x5e9cf1,_0x27c5f9){return db[_0x6263('0x25')][_0x6263('0x3b')]({'raw':![],'where':{'CampaignId':_0xb0eb6b['params']['id']},'attributes':[[db[_0x6263('0x47')]['fn']('COUNT',db[_0x6263('0x47')]['fn']('IF',db[_0x6263('0x47')][_0x6263('0x49')](_0x6263('0x4a')))),_0x6263('0x4b')],[db[_0x6263('0x47')]['fn'](_0x6263('0x48'),db[_0x6263('0x47')]['fn']('IF',db[_0x6263('0x47')]['literal'](_0x6263('0x4c')))),_0x6263('0x4d')],[db['sequelize']['fn'](_0x6263('0x48'),db['sequelize']['fn']('IF',db[_0x6263('0x47')][_0x6263('0x49')]('`state`\x20=\x205,\x201,\x20null'))),_0x6263('0x4f')],[db[_0x6263('0x47')]['fn'](_0x6263('0x48'),db[_0x6263('0x47')]['fn']('IF',db[_0x6263('0x47')][_0x6263('0x49')](_0x6263('0x58')))),_0x6263('0x50')],[db['sequelize']['fn'](_0x6263('0x48'),db[_0x6263('0x47')]['fn']('IF',db['sequelize'][_0x6263('0x49')](_0x6263('0x51')))),_0x6263('0x52')],[db[_0x6263('0x47')]['fn']('COUNT',db[_0x6263('0x47')]['fn']('IF',db[_0x6263('0x47')]['literal'](_0x6263('0x53')))),_0x6263('0x54')],[db[_0x6263('0x47')]['fn'](_0x6263('0x48'),db[_0x6263('0x47')]['fn']('IF',db['sequelize'][_0x6263('0x49')](_0x6263('0x59')))),'reCallContacts'],[db[_0x6263('0x47')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6263('0x47')][_0x6263('0x49')]('`state`\x20=\x2019,\x201,\x20null'))),_0x6263('0x57')]]})[_0x6263('0x1d')](handleEntityNotFound(_0x5e9cf1,null))['then'](respondWithResult(_0x5e9cf1,null))[_0x6263('0x3c')](handleError(_0x5e9cf1,null));};exports[_0x6263('0x5a')]=function(_0x341d99,_0x171c6e,_0x3ca62c){return db[_0x6263('0x5b')][_0x6263('0x42')]({'where':{'id':_0x341d99[_0x6263('0x3e')]['id']}})[_0x6263('0x1d')](handleEntityNotFound(_0x171c6e,null))['then'](function(_0x3bf9d7){var _0x5b60b5;if(_0x3bf9d7){_0x5b60b5=squel[_0x6263('0x5c')]()[_0x6263('0x5d')]('cm_hopper')[_0x6263('0x5e')]([_0x6263('0x5f'),_0x6263('0x60'),_0x6263('0x61'),_0x6263('0x62'),_0x6263('0x63'),'createdAt',_0x6263('0x64')],squel[_0x6263('0x65')]()['field'](_0x6263('0x66'),'phone')[_0x6263('0x3a')](_0x6263('0x67'),_0x6263('0x60'))[_0x6263('0x3a')](_0x6263('0x68'),_0x6263('0x61'))[_0x6263('0x3a')](_0x6263('0x69'),_0x6263('0x62'))['field'](_0x6263('0x6a'),_0x6263('0x63'))[_0x6263('0x3a')](_0x6263('0x67'),_0x6263('0x6b'))['field'](_0x6263('0x67'),_0x6263('0x64'))['from']('cm_hopper_final')['where'](_0x6263('0x6c'),_0x341d99[_0x6263('0x3e')]['id']['toString']())[_0x6263('0x35')]('state\x20=\x20?',_0x341d99[_0x6263('0x45')][_0x6263('0x6d')][_0x6263('0x6e')]())[_0x6263('0x35')](_0x6263('0x6f'))[_0x6263('0x35')](_0x6263('0x70'),squel['select']()[_0x6263('0x3a')](_0x6263('0x5f'))['from'](_0x6263('0x71'))[_0x6263('0x35')](_0x6263('0x6c'),_0x341d99['params']['id'][_0x6263('0x6e')]()))[_0x6263('0x35')](_0x6263('0x70'),squel[_0x6263('0x65')]()[_0x6263('0x3a')](_0x6263('0x72'))[_0x6263('0x73')](_0x6263('0x74'))[_0x6263('0x35')](_0x6263('0x6c'),_0x341d99[_0x6263('0x3e')]['id'][_0x6263('0x6e')]())[_0x6263('0x35')]('state\x20=\x204'))['group'](_0x6263('0x61')))[_0x6263('0x6e')]();return db['sequelize']['query'](_0x5b60b5);}return[];})['then'](respondWithResult(_0x171c6e,null))[_0x6263('0x3c')](handleError(_0x171c6e,null));};exports[_0x6263('0x75')]=function(_0x1a1ed1,_0x5bc9ba,_0x4579a7){return db[_0x6263('0x76')][_0x6263('0x42')]({'where':{'id':_0x1a1ed1[_0x6263('0x3e')]['id']}})[_0x6263('0x1d')](handleEntityNotFound(_0x5bc9ba,null))[_0x6263('0x1d')](function(_0x209720){var _0x5baf41;if(_0x209720){_0x5baf41=squel['insert']()[_0x6263('0x5d')](_0x6263('0x71'))[_0x6263('0x5e')](['phone',_0x6263('0x60'),'ContactId','ListId','CampaignId',_0x6263('0x6b'),_0x6263('0x64')],squel['select']()[_0x6263('0x3a')]('ANY_VALUE(calleridnum)',_0x6263('0x5f'))[_0x6263('0x3a')]('NOW()',_0x6263('0x60'))['field'](_0x6263('0x68'),'ContactId')[_0x6263('0x3a')](_0x6263('0x69'),_0x6263('0x62'))[_0x6263('0x3a')](_0x6263('0x77'),_0x6263('0x78'))[_0x6263('0x3a')](_0x6263('0x67'),_0x6263('0x6b'))[_0x6263('0x3a')](_0x6263('0x67'),_0x6263('0x64'))[_0x6263('0x73')](_0x6263('0x74'))[_0x6263('0x35')](_0x6263('0x79'),_0x1a1ed1[_0x6263('0x3e')]['id']['toString']())[_0x6263('0x35')](_0x6263('0x7a'),_0x1a1ed1[_0x6263('0x45')][_0x6263('0x6d')][_0x6263('0x6e')]())[_0x6263('0x35')](_0x6263('0x6f'))[_0x6263('0x35')](_0x6263('0x70'),squel[_0x6263('0x65')]()[_0x6263('0x3a')]('phone')[_0x6263('0x73')](_0x6263('0x71'))[_0x6263('0x35')]('CampaignId\x20=\x20?',_0x1a1ed1[_0x6263('0x3e')]['id'][_0x6263('0x6e')]()))['where'](_0x6263('0x70'),squel['select']()[_0x6263('0x3a')](_0x6263('0x72'))[_0x6263('0x73')](_0x6263('0x74'))[_0x6263('0x35')](_0x6263('0x79'),_0x1a1ed1[_0x6263('0x3e')]['id'][_0x6263('0x6e')]())[_0x6263('0x35')](_0x6263('0x7b')))[_0x6263('0x7c')]('ContactId'))[_0x6263('0x6e')]();return db['sequelize']['query'](_0x5baf41);}return[];})[_0x6263('0x1d')](respondWithResult(_0x5bc9ba,null))[_0x6263('0x3c')](handleError(_0x5bc9ba,null));};exports[_0x6263('0x7d')]=function(_0x2abdc7,_0x5b421a,_0x2c88af){return db['CmHopper'][_0x6263('0x7e')]({'where':{'VoiceQueueId':_0x2abdc7['body'][_0x6263('0x63')],'CampaignId':_0x2abdc7[_0x6263('0x45')][_0x6263('0x78')],'ContactId':_0x2abdc7['body'][_0x6263('0x61')]}})[_0x6263('0x1d')](handleEntityNotFound(_0x5b421a,null))[_0x6263('0x1d')](function(_0x1098e1){if(_0x1098e1){return _0x1098e1;}return null;})['then'](respondWithResult(_0x5b421a,null))[_0x6263('0x3c')](handleError(_0x5b421a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 559d932..3b36f81 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.model.js +++ b/server/api/cmHopperFinal/cmHopperFinal.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc64e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','cm_hopper_final','util'];(function(_0x524bee,_0x593a5d){var _0x5c765e=function(_0x21ae2f){while(--_0x21ae2f){_0x524bee['push'](_0x524bee['shift']());}};_0x5c765e(++_0x593a5d);}(_0xc64e,0x154));var _0xec64=function(_0x14a91a,_0x34701e){_0x14a91a=_0x14a91a-0x0;var _0x19a902=_0xc64e[_0x14a91a];return _0x19a902;};'use strict';var _=require('lodash');var util=require(_0xec64('0x0'));var logger=require(_0xec64('0x1'))(_0xec64('0x2'));var moment=require(_0xec64('0x3'));var BPromise=require(_0xec64('0x4'));var rp=require(_0xec64('0x5'));var fs=require('fs');var path=require(_0xec64('0x6'));var rimraf=require(_0xec64('0x7'));var config=require(_0xec64('0x8'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x2aaff8,_0x3fd2d0){return _0x2aaff8[_0xec64('0x9')]('CmHopperFinal',attributes,{'tableName':_0xec64('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf6bb=['request-promise','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','bluebird'];(function(_0x13b099,_0x3d9292){var _0x40f2fc=function(_0x1039ff){while(--_0x1039ff){_0x13b099['push'](_0x13b099['shift']());}};_0x40f2fc(++_0x3d9292);}(_0xf6bb,0x71));var _0xbf6b=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xf6bb[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0xbf6b('0x0'));var util=require(_0xbf6b('0x1'));var logger=require(_0xbf6b('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbf6b('0x3'));var rp=require(_0xbf6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf6b('0x5'));var config=require('../../config/environment');var attributes=require(_0xbf6b('0x6'));module[_0xbf6b('0x7')]=function(_0x145e40,_0x6182c0){return _0x145e40[_0xbf6b('0x8')](_0xbf6b('0x9'),attributes,{'tableName':_0xbf6b('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xbf6b('0xb')]},{'name':_0xbf6b('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index e4cf844..d7f1345 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34c2=['moment','bluebird','randomstring','../../config/utils','../../config/environment','request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateCmHopperFinal','CmHopperFinal','create','options','raw','debug','lodash','util'];(function(_0x1a32d3,_0x3b3d4f){var _0x330890=function(_0x4c6674){while(--_0x4c6674){_0x1a32d3['push'](_0x1a32d3['shift']());}};_0x330890(++_0x3b3d4f);}(_0x34c2,0x136));var _0x234c=function(_0x1a3e33,_0xe419f4){_0x1a3e33=_0x1a3e33-0x0;var _0x545085=_0x34c2[_0x1a3e33];return _0x545085;};'use strict';var _=require(_0x234c('0x0'));var util=require(_0x234c('0x1'));var moment=require(_0x234c('0x2'));var BPromise=require(_0x234c('0x3'));var rs=require(_0x234c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x234c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x234c('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a3583,_0x18b36e,_0x4ff485){return new BPromise(function(_0x11c531,_0xcbc16f){return client[_0x234c('0x7')](_0x5a3583,_0x4ff485)[_0x234c('0x8')](function(_0x1397f0){logger[_0x234c('0x9')](_0x234c('0xa'),_0x18b36e,_0x234c('0xb'));logger['debug'](_0x234c('0xc'),_0x18b36e,_0x234c('0xb'),JSON['stringify'](_0x1397f0));if(_0x1397f0[_0x234c('0xd')]){if(_0x1397f0[_0x234c('0xd')][_0x234c('0xe')]===0x1f4){logger[_0x234c('0xd')](_0x234c('0xa'),_0x18b36e,_0x1397f0[_0x234c('0xd')][_0x234c('0xf')]);return _0xcbc16f(_0x1397f0[_0x234c('0xd')][_0x234c('0xf')]);}logger[_0x234c('0xd')]('CmHopperFinal,\x20%s,\x20%s',_0x18b36e,_0x1397f0[_0x234c('0xd')][_0x234c('0xf')]);return _0x11c531(_0x1397f0[_0x234c('0xd')]['message']);}else{logger[_0x234c('0x9')](_0x234c('0xa'),_0x18b36e,_0x234c('0xb'));_0x11c531(_0x1397f0[_0x234c('0x10')][_0x234c('0xf')]);}})[_0x234c('0x11')](function(_0x14a619){logger[_0x234c('0xd')](_0x234c('0xa'),_0x18b36e,_0x14a619);_0xcbc16f(_0x14a619);});});}exports[_0x234c('0x12')]=function(_0x5d2ce4){var _0x106948=this;return new Promise(function(_0x4c2623,_0x5f5523){return db[_0x234c('0x13')][_0x234c('0x14')](_0x5d2ce4['body'],{'raw':_0x5d2ce4[_0x234c('0x15')]?_0x5d2ce4['options'][_0x234c('0x16')]===undefined?!![]:![]:!![]})[_0x234c('0x8')](function(_0x1e5548){logger[_0x234c('0x9')](_0x234c('0x12'),_0x5d2ce4);logger[_0x234c('0x17')](_0x234c('0x12'),_0x5d2ce4,JSON['stringify'](_0x1e5548));_0x4c2623(_0x1e5548);})[_0x234c('0x11')](function(_0x408bce){logger[_0x234c('0xd')](_0x234c('0x12'),_0x408bce[_0x234c('0xf')],_0x5d2ce4);_0x5f5523(_0x106948[_0x234c('0xd')](0x1f4,_0x408bce[_0x234c('0xf')]));});});}; \ No newline at end of file +var _0xd681=['result','catch','CreateCmHopperFinal','create','body','options','raw','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperFinal,\x20%s,\x20%s','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x45c3a0,_0x2940d1){var _0x2897a3=function(_0x4ff9b8){while(--_0x4ff9b8){_0x45c3a0['push'](_0x45c3a0['shift']());}};_0x2897a3(++_0x2940d1);}(_0xd681,0x1d8));var _0x1d68=function(_0xa0d21a,_0x4e412c){_0xa0d21a=_0xa0d21a-0x0;var _0x35eb26=_0xd681[_0xa0d21a];return _0x35eb26;};'use strict';var _=require(_0x1d68('0x0'));var util=require(_0x1d68('0x1'));var moment=require(_0x1d68('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d68('0x3'));var db=require(_0x1d68('0x4'))['db'];var utils=require(_0x1d68('0x5'));var logger=require(_0x1d68('0x6'))(_0x1d68('0x7'));var config=require(_0x1d68('0x8'));var jayson=require(_0x1d68('0x9'));var client=jayson[_0x1d68('0xa')][_0x1d68('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52f2fb,_0x2f8fb8,_0xa77fcd){return new BPromise(function(_0x547368,_0x53d15e){return client[_0x1d68('0xc')](_0x52f2fb,_0xa77fcd)[_0x1d68('0xd')](function(_0x10b606){logger['info'](_0x1d68('0xe'),_0x2f8fb8,_0x1d68('0xf'));logger['debug'](_0x1d68('0x10'),_0x2f8fb8,_0x1d68('0xf'),JSON[_0x1d68('0x11')](_0x10b606));if(_0x10b606['error']){if(_0x10b606['error'][_0x1d68('0x12')]===0x1f4){logger['error']('CmHopperFinal,\x20%s,\x20%s',_0x2f8fb8,_0x10b606[_0x1d68('0x13')][_0x1d68('0x14')]);return _0x53d15e(_0x10b606[_0x1d68('0x13')][_0x1d68('0x14')]);}logger[_0x1d68('0x13')](_0x1d68('0xe'),_0x2f8fb8,_0x10b606[_0x1d68('0x13')][_0x1d68('0x14')]);return _0x547368(_0x10b606[_0x1d68('0x13')][_0x1d68('0x14')]);}else{logger['info'](_0x1d68('0xe'),_0x2f8fb8,_0x1d68('0xf'));_0x547368(_0x10b606[_0x1d68('0x15')][_0x1d68('0x14')]);}})[_0x1d68('0x16')](function(_0x1fe251){logger[_0x1d68('0x13')](_0x1d68('0xe'),_0x2f8fb8,_0x1fe251);_0x53d15e(_0x1fe251);});});}exports[_0x1d68('0x17')]=function(_0x420190){var _0x4c2eb4=this;return new Promise(function(_0x8a3cdd,_0x4a4949){return db['CmHopperFinal'][_0x1d68('0x18')](_0x420190[_0x1d68('0x19')],{'raw':_0x420190[_0x1d68('0x1a')]?_0x420190[_0x1d68('0x1a')][_0x1d68('0x1b')]===undefined?!![]:![]:!![]})[_0x1d68('0xd')](function(_0x541535){logger['info'](_0x1d68('0x17'),_0x420190);logger[_0x1d68('0x1c')](_0x1d68('0x17'),_0x420190,JSON[_0x1d68('0x11')](_0x541535));_0x8a3cdd(_0x541535);})['catch'](function(_0x2803cb){logger['error']('CreateCmHopperFinal',_0x2803cb[_0x1d68('0x14')],_0x420190);_0x4a4949(_0x4c2eb4['error'](0x1f4,_0x2803cb[_0x1d68('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 139c7e0..5fa02e6 100644 --- a/server/api/cmHopperFinal/index.js +++ b/server/api/cmHopperFinal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a7c=['express','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path'];(function(_0x3a1a54,_0xf02f5f){var _0x517708=function(_0x4457b9){while(--_0x4457b9){_0x3a1a54['push'](_0x3a1a54['shift']());}};_0x517708(++_0xf02f5f);}(_0x2a7c,0x189));var _0xc2a7=function(_0x3f1c4f,_0x6d4033){_0x3f1c4f=_0x3f1c4f-0x0;var _0x3d08a7=_0x2a7c[_0x3f1c4f];return _0x3d08a7;};'use strict';var multer=require(_0xc2a7('0x0'));var util=require(_0xc2a7('0x1'));var path=require(_0xc2a7('0x2'));var timeout=require('connect-timeout');var express=require(_0xc2a7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc2a7('0x4'));var config=require('../../config/environment');var controller=require(_0xc2a7('0x5'));router[_0xc2a7('0x6')]('/',auth[_0xc2a7('0x7')](),controller[_0xc2a7('0x8')]);router[_0xc2a7('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc2a7('0x6')](_0xc2a7('0x9'),auth[_0xc2a7('0x7')](),controller['show']);router['get'](_0xc2a7('0xa'),auth[_0xc2a7('0x7')](),controller[_0xc2a7('0xb')]);router[_0xc2a7('0x6')]('/campaign/countAttributes/:id',auth[_0xc2a7('0x7')](),controller[_0xc2a7('0xc')]);router['post'](_0xc2a7('0xd'),auth[_0xc2a7('0x7')](),controller[_0xc2a7('0xe')]);router[_0xc2a7('0xf')](_0xc2a7('0x10'),auth[_0xc2a7('0x7')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xc2a7('0xf')](_0xc2a7('0x11'),auth[_0xc2a7('0x7')](),controller[_0xc2a7('0x12')]);router[_0xc2a7('0x13')](_0xc2a7('0x9'),auth[_0xc2a7('0x7')](),controller[_0xc2a7('0x14')]);module[_0xc2a7('0x15')]=router; \ No newline at end of file +var _0xf26b=['../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x54c003,_0x4295ec){var _0x4f8f34=function(_0x21f3b5){while(--_0x21f3b5){_0x54c003['push'](_0x54c003['shift']());}};_0x4f8f34(++_0x4295ec);}(_0xf26b,0x133));var _0xbf26=function(_0x236209,_0x51b840){_0x236209=_0x236209-0x0;var _0x2afd5b=_0xf26b[_0x236209];return _0x2afd5b;};'use strict';var multer=require(_0xbf26('0x0'));var util=require(_0xbf26('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbf26('0x2'));var router=express[_0xbf26('0x3')]();var auth=require(_0xbf26('0x4'));var interaction=require(_0xbf26('0x5'));var config=require(_0xbf26('0x6'));var controller=require(_0xbf26('0x7'));router[_0xbf26('0x8')]('/',auth[_0xbf26('0x9')](),controller['index']);router[_0xbf26('0x8')](_0xbf26('0xa'),auth['isAuthenticated'](),controller[_0xbf26('0xb')]);router[_0xbf26('0x8')](_0xbf26('0xc'),auth[_0xbf26('0x9')](),controller['show']);router[_0xbf26('0x8')](_0xbf26('0xd'),auth[_0xbf26('0x9')](),controller[_0xbf26('0xe')]);router[_0xbf26('0x8')](_0xbf26('0xf'),auth[_0xbf26('0x9')](),controller[_0xbf26('0x10')]);router[_0xbf26('0x11')](_0xbf26('0x12'),auth[_0xbf26('0x9')](),controller[_0xbf26('0x13')]);router[_0xbf26('0x11')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0xbf26('0x14')]);router['post'](_0xbf26('0x15'),auth[_0xbf26('0x9')](),controller[_0xbf26('0x16')]);router[_0xbf26('0x17')](_0xbf26('0xc'),auth[_0xbf26('0x9')](),controller[_0xbf26('0x18')]);module[_0xbf26('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index e5e41b5..86f5569 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.attributes.js +++ b/server/api/cmHopperHistory/cmHopperHistory.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7efe=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7efe,0x168));var _0xe7ef=function(_0x2f9bca,_0x1b2bff){_0x2f9bca=_0x2f9bca-0x0;var _0x1c6359=_0x7efe[_0x2f9bca];return _0x1c6359;};'use strict';var Sequelize=require(_0xe7ef('0x0'));module[_0xe7ef('0x1')]={'state':{'type':Sequelize[_0xe7ef('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe7ef('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe7ef('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xe7ef('0x3')]},'originatecalleridname':{'type':Sequelize[_0xe7ef('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe7ef('0x3')]},'starttime':{'type':Sequelize[_0xe7ef('0x4')]},'responsetime':{'type':Sequelize[_0xe7ef('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xe7ef('0x4')]},'endtime':{'type':Sequelize[_0xe7ef('0x4')]},'ringtime':{'type':Sequelize[_0xe7ef('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe7ef('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe7ef('0x3')]},'campaign':{'type':Sequelize[_0xe7ef('0x3')]},'campaigntype':{'type':Sequelize[_0xe7ef('0x3')]},'membername':{'type':Sequelize[_0xe7ef('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xe7ef('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xe7ef('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe7ef('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe7ef('0x4')]},'recallme':{'type':Sequelize[_0xe7ef('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xe7ef('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0620=['INTEGER','BOOLEAN','sequelize','STRING','DATE'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0620,0x129));var _0x0062=function(_0x4eaa63,_0x421ceb){_0x4eaa63=_0x4eaa63-0x0;var _0x5a5bcc=_0x0620[_0x4eaa63];return _0x5a5bcc;};'use strict';var Sequelize=require(_0x0062('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0062('0x1')]},'scheduledat':{'type':Sequelize[_0x0062('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0062('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0062('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0062('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0062('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x0062('0x1')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0062('0x1')]},'calleridname':{'type':Sequelize[_0x0062('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x0062('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x0062('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0062('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0062('0x1')]},'campaign':{'type':Sequelize[_0x0062('0x1')]},'campaigntype':{'type':Sequelize[_0x0062('0x1')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x0062('0x1')]},'amd':{'type':Sequelize[_0x0062('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0062('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0062('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0062('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0062('0x2')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x0062('0x2')]},'edited':{'type':Sequelize[_0x0062('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 0a33b7e..97185ca 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.controller.js +++ b/server/api/cmHopperHistory/cmHopperHistory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','index','CmHopperHistory','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','update','uniqueid','params','html-pdf'];(function(_0x5d0609,_0x127562){var _0xaa3fd1=function(_0x47f457){while(--_0x47f457){_0x5d0609['push'](_0x5d0609['shift']());}};_0xaa3fd1(++_0x127562);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c872,_0x2cb37a){_0x2cb37a=_0x2cb37a||0xcc;return function(_0x19a27e){if(_0x19a27e){return _0xb0c872[_0x7995('0x19')](_0x2cb37a);}return _0xb0c872[_0x7995('0x1a')](_0x2cb37a)[_0x7995('0x1b')]();};}function respondWithResult(_0x2bbe7a,_0x4cc004){_0x4cc004=_0x4cc004||0xc8;return function(_0x58f5ad){if(_0x58f5ad){return _0x2bbe7a[_0x7995('0x1a')](_0x4cc004)[_0x7995('0x1c')](_0x58f5ad);}};}function respondWithFilteredResult(_0x24b5bb,_0x321ae8){return function(_0x3f1d3e){if(_0x3f1d3e){var _0x1a5310=_0x3f1d3e[_0x7995('0x1d')],_0x2202ce=_0x321ae8['offset'],_0x41cbf0=_0x321ae8[_0x7995('0x1e')]+_0x321ae8[_0x7995('0x1f')],_0x5377e5;if(_0x41cbf0>=_0x1a5310){_0x41cbf0=_0x1a5310;_0x5377e5=0xc8;}else{_0x5377e5=0xce;}_0x24b5bb[_0x7995('0x1a')](_0x5377e5);return _0x24b5bb[_0x7995('0x20')](_0x7995('0x21'),_0x2202ce+'-'+_0x41cbf0+'/'+_0x1a5310)[_0x7995('0x1c')](_0x3f1d3e);}return null;};}function patchUpdates(_0x4faa60){return function(_0x54c9ae){try{jsonpatch[_0x7995('0x22')](_0x54c9ae,_0x4faa60,!![]);}catch(_0x5e6f90){return BPromise['reject'](_0x5e6f90);}return _0x54c9ae[_0x7995('0x23')]();};}function saveUpdates(_0x3d463e,_0x4cbe10){return function(_0x3a9b54){if(_0x3a9b54){return _0x3a9b54['update'](_0x3d463e)['then'](function(_0x3e4c54){return _0x3e4c54;});}return null;};}function removeEntity(_0x327b1f,_0x350fd9){return function(_0x1a8568){if(_0x1a8568){return _0x1a8568[_0x7995('0x24')]()[_0x7995('0x25')](function(){_0x327b1f['status'](0xcc)[_0x7995('0x1b')]();});}};}function handleEntityNotFound(_0x46ee4b,_0x204507){return function(_0x285437){if(!_0x285437){_0x46ee4b[_0x7995('0x19')](0x194);}return _0x285437;};}function handleError(_0x13bc35,_0x475351){_0x475351=_0x475351||0x1f4;return function(_0x472195){logger['error'](_0x472195[_0x7995('0x26')]);if(_0x472195[_0x7995('0x27')]){delete _0x472195[_0x7995('0x27')];}_0x13bc35[_0x7995('0x1a')](_0x475351)[_0x7995('0x28')](_0x472195);};}exports[_0x7995('0x29')]=function(_0x56691a,_0x47625f){var _0x5911c3={},_0x229742={},_0x49bc7e={'count':0x0,'rows':[]};var _0xf16cc2=db[_0x7995('0x2a')][_0x7995('0x2b')];_0x229742['model']=_[_0x7995('0x2c')](_0xf16cc2);_0x229742['query']=_[_0x7995('0x2c')](_0x56691a[_0x7995('0x2d')]);_0x229742[_0x7995('0x2e')]=_['intersection'](_0x229742['model'],_0x229742['query']);_0x5911c3[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x229742[_0x7995('0x31')],qs[_0x7995('0x32')](_0x56691a[_0x7995('0x2d')][_0x7995('0x32')]));_0x5911c3['attributes']=_0x5911c3['attributes'][_0x7995('0x33')]?_0x5911c3['attributes']:_0x229742[_0x7995('0x31')];if(!_0x56691a[_0x7995('0x2d')][_0x7995('0x34')](_0x7995('0x35'))){_0x5911c3[_0x7995('0x1f')]=qs['limit'](_0x56691a[_0x7995('0x2d')][_0x7995('0x1f')]);_0x5911c3['offset']=qs['offset'](_0x56691a['query'][_0x7995('0x1e')]);}_0x5911c3[_0x7995('0x36')]=qs['sort'](_0x56691a[_0x7995('0x2d')]['sort']);_0x5911c3[_0x7995('0x37')]=qs[_0x7995('0x2e')](_[_0x7995('0x38')](_0x56691a['query'],_0x229742['filters']));if(_0x56691a[_0x7995('0x2d')]['filter']){_0x5911c3['where']=_[_0x7995('0x39')](_0x5911c3[_0x7995('0x37')],{'$or':_['map'](_0xf16cc2,function(_0x1baa15){if(_0x1baa15[_0x7995('0x3a')][_0x7995('0x3b')]!==_0x7995('0x3c')){var _0x1e3dbf={};_0x1e3dbf[_0x1baa15['field']]={'$like':'%'+_0x56691a[_0x7995('0x2d')][_0x7995('0x3d')]+'%'};return _0x1e3dbf;}})});}_0x5911c3=_[_0x7995('0x39')]({},_0x5911c3,_0x56691a[_0x7995('0x3e')]);var _0x4b1541={'where':_0x5911c3[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1d')](_0x4b1541)[_0x7995('0x25')](function(_0x1f5bee){_0x49bc7e[_0x7995('0x1d')]=_0x1f5bee;if(_0x56691a['query'][_0x7995('0x3f')]){_0x5911c3[_0x7995('0x40')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x41')](_0x5911c3);})[_0x7995('0x25')](function(_0x298fc2){_0x49bc7e[_0x7995('0x42')]=_0x298fc2;return _0x49bc7e;})[_0x7995('0x25')](respondWithFilteredResult(_0x47625f,_0x5911c3))[_0x7995('0x43')](handleError(_0x47625f,null));};exports[_0x7995('0x44')]=function(_0x6fe77b,_0x270d52){var _0x7b4e67={'raw':!![],'where':{'id':_0x6fe77b['params']['id']}},_0x53cda2={};_0x53cda2[_0x7995('0x31')]=_[_0x7995('0x2c')](db['CmHopperHistory']['rawAttributes']);_0x53cda2[_0x7995('0x2d')]=_['keys'](_0x6fe77b['query']);_0x53cda2[_0x7995('0x2e')]=_[_0x7995('0x30')](_0x53cda2[_0x7995('0x31')],_0x53cda2['query']);_0x7b4e67[_0x7995('0x2f')]=_['intersection'](_0x53cda2[_0x7995('0x31')],qs['fields'](_0x6fe77b['query'][_0x7995('0x32')]));_0x7b4e67[_0x7995('0x2f')]=_0x7b4e67[_0x7995('0x2f')][_0x7995('0x33')]?_0x7b4e67['attributes']:_0x53cda2[_0x7995('0x31')];if(_0x6fe77b[_0x7995('0x2d')][_0x7995('0x3f')]){_0x7b4e67[_0x7995('0x40')]=[{'all':!![]}];}_0x7b4e67=_['merge']({},_0x7b4e67,_0x6fe77b['options']);return db[_0x7995('0x2a')]['find'](_0x7b4e67)[_0x7995('0x25')](handleEntityNotFound(_0x270d52,null))['then'](respondWithResult(_0x270d52,null))[_0x7995('0x43')](handleError(_0x270d52,null));};exports['create']=function(_0x1e795e,_0x1b0373){return db['CmHopperHistory'][_0x7995('0x45')](_0x1e795e[_0x7995('0x46')],{})[_0x7995('0x25')](respondWithResult(_0x1b0373,0xc9))[_0x7995('0x43')](handleError(_0x1b0373,null));};exports['describe']=function(_0x2458cb,_0x3e787d){return db[_0x7995('0x2a')]['describe']()[_0x7995('0x25')](respondWithResult(_0x3e787d,null))[_0x7995('0x43')](handleError(_0x3e787d,null));};exports[_0x7995('0x47')]=function(_0x3d8ae3,_0x255313){if(_0x3d8ae3['body'][_0x7995('0x48')]){delete _0x3d8ae3[_0x7995('0x46')]['uniqueid'];}return db[_0x7995('0x2a')]['find']({'where':{'uniqueid':_0x3d8ae3[_0x7995('0x49')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x255313,null))[_0x7995('0x25')](saveUpdates(_0x3d8ae3[_0x7995('0x46')],null))[_0x7995('0x25')](respondWithResult(_0x255313,null))[_0x7995('0x43')](handleError(_0x255313,null));}; \ No newline at end of file +var _0x34e8=['util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','key','VIRTUAL','field','options','CmHopperHistory','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','describe','uniqueid','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x34e8,0x12c));var _0x834e=function(_0x15ccc7,_0x52e349){_0x15ccc7=_0x15ccc7-0x0;var _0x2242ab=_0x34e8[_0x15ccc7];return _0x2242ab;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var db=require(_0x834e('0x1b'))['db'];function respondWithStatusCode(_0x2fd95c,_0x538bb3){_0x538bb3=_0x538bb3||0xcc;return function(_0x5e5b6d){if(_0x5e5b6d){return _0x2fd95c[_0x834e('0x1c')](_0x538bb3);}return _0x2fd95c['status'](_0x538bb3)[_0x834e('0x1d')]();};}function respondWithResult(_0x2d95f2,_0x28e659){_0x28e659=_0x28e659||0xc8;return function(_0x21cc0a){if(_0x21cc0a){return _0x2d95f2['status'](_0x28e659)[_0x834e('0x1e')](_0x21cc0a);}};}function respondWithFilteredResult(_0x302cbd,_0x57274a){return function(_0x316205){if(_0x316205){var _0x4a9cdc=_0x316205[_0x834e('0x1f')],_0x38a8cd=_0x57274a[_0x834e('0x20')],_0x36d443=_0x57274a[_0x834e('0x20')]+_0x57274a['limit'],_0x478afe;if(_0x36d443>=_0x4a9cdc){_0x36d443=_0x4a9cdc;_0x478afe=0xc8;}else{_0x478afe=0xce;}_0x302cbd[_0x834e('0x21')](_0x478afe);return _0x302cbd[_0x834e('0x22')](_0x834e('0x23'),_0x38a8cd+'-'+_0x36d443+'/'+_0x4a9cdc)[_0x834e('0x1e')](_0x316205);}return null;};}function patchUpdates(_0x237947){return function(_0x254677){try{jsonpatch[_0x834e('0x24')](_0x254677,_0x237947,!![]);}catch(_0x595515){return BPromise[_0x834e('0x25')](_0x595515);}return _0x254677[_0x834e('0x26')]();};}function saveUpdates(_0x113ff4,_0x325a99){return function(_0x4ab05d){if(_0x4ab05d){return _0x4ab05d[_0x834e('0x27')](_0x113ff4)[_0x834e('0x28')](function(_0x5a05c0){return _0x5a05c0;});}return null;};}function removeEntity(_0x1b4bdf,_0x28d687){return function(_0x8d406e){if(_0x8d406e){return _0x8d406e['destroy']()['then'](function(){_0x1b4bdf[_0x834e('0x21')](0xcc)[_0x834e('0x1d')]();});}};}function handleEntityNotFound(_0x589dde,_0x25ee1d){return function(_0x1dc1e0){if(!_0x1dc1e0){_0x589dde['sendStatus'](0x194);}return _0x1dc1e0;};}function handleError(_0x3bc4f7,_0x2e1983){_0x2e1983=_0x2e1983||0x1f4;return function(_0x338636){logger['error'](_0x338636[_0x834e('0x29')]);if(_0x338636[_0x834e('0x2a')]){delete _0x338636['name'];}_0x3bc4f7['status'](_0x2e1983)[_0x834e('0x2b')](_0x338636);};}exports['index']=function(_0x2826ec,_0x3f1b0b){var _0x3db026={},_0x2cc2eb={},_0x3cd928={'count':0x0,'rows':[]};var _0x130cc5=db['CmHopperHistory']['rawAttributes'];_0x2cc2eb['model']=_['keys'](_0x130cc5);_0x2cc2eb[_0x834e('0x2c')]=_[_0x834e('0x2d')](_0x2826ec[_0x834e('0x2c')]);_0x2cc2eb['filters']=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],_0x2cc2eb[_0x834e('0x2c')]);_0x3db026[_0x834e('0x30')]=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],qs[_0x834e('0x31')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x31')]));_0x3db026['attributes']=_0x3db026[_0x834e('0x30')]['length']?_0x3db026[_0x834e('0x30')]:_0x2cc2eb[_0x834e('0x2f')];if(!_0x2826ec[_0x834e('0x2c')][_0x834e('0x32')](_0x834e('0x33'))){_0x3db026[_0x834e('0x34')]=qs[_0x834e('0x34')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x34')]);_0x3db026[_0x834e('0x20')]=qs['offset'](_0x2826ec[_0x834e('0x2c')][_0x834e('0x20')]);}_0x3db026[_0x834e('0x35')]=qs[_0x834e('0x36')](_0x2826ec['query'][_0x834e('0x36')]);_0x3db026[_0x834e('0x37')]=qs['filters'](_['pick'](_0x2826ec['query'],_0x2cc2eb[_0x834e('0x38')]));if(_0x2826ec[_0x834e('0x2c')][_0x834e('0x39')]){_0x3db026[_0x834e('0x37')]=_[_0x834e('0x3a')](_0x3db026[_0x834e('0x37')],{'$or':_['map'](_0x130cc5,function(_0x2c2d94){if(_0x2c2d94['type'][_0x834e('0x3b')]!==_0x834e('0x3c')){var _0x47abed={};_0x47abed[_0x2c2d94[_0x834e('0x3d')]]={'$like':'%'+_0x2826ec[_0x834e('0x2c')]['filter']+'%'};return _0x47abed;}})});}_0x3db026=_['merge']({},_0x3db026,_0x2826ec[_0x834e('0x3e')]);var _0xd0d43a={'where':_0x3db026[_0x834e('0x37')]};return db[_0x834e('0x3f')][_0x834e('0x1f')](_0xd0d43a)['then'](function(_0x1c5ed6){_0x3cd928['count']=_0x1c5ed6;if(_0x2826ec['query'][_0x834e('0x40')]){_0x3db026['include']=[{'all':!![]}];}return db[_0x834e('0x3f')][_0x834e('0x41')](_0x3db026);})[_0x834e('0x28')](function(_0x3c59af){_0x3cd928[_0x834e('0x42')]=_0x3c59af;return _0x3cd928;})['then'](respondWithFilteredResult(_0x3f1b0b,_0x3db026))[_0x834e('0x43')](handleError(_0x3f1b0b,null));};exports[_0x834e('0x44')]=function(_0x38f266,_0x58c5fb){var _0x35380e={'raw':!![],'where':{'id':_0x38f266['params']['id']}},_0x16ac45={};_0x16ac45[_0x834e('0x2f')]=_['keys'](db[_0x834e('0x3f')][_0x834e('0x45')]);_0x16ac45['query']=_['keys'](_0x38f266[_0x834e('0x2c')]);_0x16ac45[_0x834e('0x38')]=_[_0x834e('0x2e')](_0x16ac45[_0x834e('0x2f')],_0x16ac45[_0x834e('0x2c')]);_0x35380e[_0x834e('0x30')]=_[_0x834e('0x2e')](_0x16ac45['model'],qs[_0x834e('0x31')](_0x38f266['query'][_0x834e('0x31')]));_0x35380e['attributes']=_0x35380e[_0x834e('0x30')]['length']?_0x35380e[_0x834e('0x30')]:_0x16ac45[_0x834e('0x2f')];if(_0x38f266['query'][_0x834e('0x40')]){_0x35380e[_0x834e('0x46')]=[{'all':!![]}];}_0x35380e=_[_0x834e('0x3a')]({},_0x35380e,_0x38f266[_0x834e('0x3e')]);return db[_0x834e('0x3f')][_0x834e('0x47')](_0x35380e)[_0x834e('0x28')](handleEntityNotFound(_0x58c5fb,null))[_0x834e('0x28')](respondWithResult(_0x58c5fb,null))[_0x834e('0x43')](handleError(_0x58c5fb,null));};exports[_0x834e('0x48')]=function(_0x5f3943,_0x3124be){return db[_0x834e('0x3f')]['create'](_0x5f3943[_0x834e('0x49')],{})[_0x834e('0x28')](respondWithResult(_0x3124be,0xc9))[_0x834e('0x43')](handleError(_0x3124be,null));};exports[_0x834e('0x4a')]=function(_0x19b5ef,_0x4264b8){return db['CmHopperHistory']['describe']()[_0x834e('0x28')](respondWithResult(_0x4264b8,null))[_0x834e('0x43')](handleError(_0x4264b8,null));};exports[_0x834e('0x27')]=function(_0x40ff5a,_0x3da408){if(_0x40ff5a[_0x834e('0x49')][_0x834e('0x4b')]){delete _0x40ff5a[_0x834e('0x49')][_0x834e('0x4b')];}return db[_0x834e('0x3f')][_0x834e('0x47')]({'where':{'uniqueid':_0x40ff5a[_0x834e('0x4c')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x3da408,null))[_0x834e('0x28')](saveUpdates(_0x40ff5a[_0x834e('0x49')],null))[_0x834e('0x28')](respondWithResult(_0x3da408,null))[_0x834e('0x43')](handleError(_0x3da408,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 0ee7832..2a47fa2 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.model.js +++ b/server/api/cmHopperHistory/cmHopperHistory.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf863=['define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x510129,_0x199547){var _0x33a2b2=function(_0x8df806){while(--_0x8df806){_0x510129['push'](_0x510129['shift']());}};_0x33a2b2(++_0x199547);}(_0xf863,0xef));var _0x3f86=function(_0x4e2542,_0x35350e){_0x4e2542=_0x4e2542-0x0;var _0x50a6e0=_0xf863[_0x4e2542];return _0x50a6e0;};'use strict';var _=require(_0x3f86('0x0'));var util=require(_0x3f86('0x1'));var logger=require('../../config/logger')(_0x3f86('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3f86('0x3'));var fs=require('fs');var path=require(_0x3f86('0x4'));var rimraf=require(_0x3f86('0x5'));var config=require(_0x3f86('0x6'));var attributes=require('./cmHopperHistory.attributes');module[_0x3f86('0x7')]=function(_0x13b6ac,_0x4e5f1b){return _0x13b6ac[_0x3f86('0x8')](_0x3f86('0x9'),attributes,{'tableName':_0x3f86('0xa'),'paranoid':![],'indexes':[{'name':_0x3f86('0xb'),'fields':[_0x3f86('0xb')]},{'name':_0x3f86('0xc'),'fields':[_0x3f86('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1098=['cm_hopper_history','endtime','uniqueid','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory'];(function(_0x2683d4,_0x1148c2){var _0x493266=function(_0x566c4a){while(--_0x566c4a){_0x2683d4['push'](_0x2683d4['shift']());}};_0x493266(++_0x1148c2);}(_0x1098,0x161));var _0x8109=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1098[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8109('0x0'));var logger=require('../../config/logger')(_0x8109('0x1'));var moment=require(_0x8109('0x2'));var BPromise=require(_0x8109('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8109('0x4'));var rimraf=require(_0x8109('0x5'));var config=require(_0x8109('0x6'));var attributes=require(_0x8109('0x7'));module[_0x8109('0x8')]=function(_0x59be48,_0x37e926){return _0x59be48[_0x8109('0x9')](_0x8109('0xa'),attributes,{'tableName':_0x8109('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x8109('0xc')]},{'name':_0x8109('0xd'),'fields':[_0x8109('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 8829387..f51d359 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js +++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7916=['body','options','raw','sequelize','COUNT','col','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','AvgHandleTime','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','findAll','ivrAnswerCallsDay','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create'];(function(_0x4f6f84,_0x31e197){var _0x20d989=function(_0x34db70){while(--_0x34db70){_0x4f6f84['push'](_0x4f6f84['shift']());}};_0x20d989(++_0x31e197);}(_0x7916,0x128));var _0x6791=function(_0x141dd0,_0x13f015){_0x141dd0=_0x141dd0-0x0;var _0x41aa2a=_0x7916[_0x141dd0];return _0x41aa2a;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var moment=require(_0x6791('0x1'));var BPromise=require(_0x6791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6791('0x3'));var db=require(_0x6791('0x4'))['db'];var utils=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('rpc');var config=require(_0x6791('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6791('0x8')][_0x6791('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad8c0,_0x8b85ff,_0x5d2118){return new BPromise(function(_0x2b240c,_0x50c563){return client['request'](_0x5ad8c0,_0x5d2118)[_0x6791('0xa')](function(_0x198a64){logger['info'](_0x6791('0xb'),_0x8b85ff,_0x6791('0xc'));logger[_0x6791('0xd')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x8b85ff,_0x6791('0xc'),JSON[_0x6791('0xe')](_0x198a64));if(_0x198a64[_0x6791('0xf')]){if(_0x198a64[_0x6791('0xf')][_0x6791('0x10')]===0x1f4){logger[_0x6791('0xf')](_0x6791('0xb'),_0x8b85ff,_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);return _0x50c563(_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x8b85ff,_0x198a64[_0x6791('0xf')]['message']);return _0x2b240c(_0x198a64[_0x6791('0xf')]['message']);}else{logger[_0x6791('0x12')](_0x6791('0xb'),_0x8b85ff,'request\x20sent');_0x2b240c(_0x198a64[_0x6791('0x13')]['message']);}})[_0x6791('0x14')](function(_0x150d1f){logger['error'](_0x6791('0xb'),_0x8b85ff,_0x150d1f);_0x50c563(_0x150d1f);});});}exports[_0x6791('0x15')]=function(_0x5bec14){var _0x1872f5=this;return new Promise(function(_0x4d8a79,_0xe55dba){return db[_0x6791('0x16')][_0x6791('0x17')](_0x5bec14[_0x6791('0x18')],{'raw':_0x5bec14[_0x6791('0x19')]?_0x5bec14[_0x6791('0x19')][_0x6791('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4a2922){logger[_0x6791('0x12')]('CreateCmHopperHistory',_0x5bec14);logger[_0x6791('0xd')](_0x6791('0x15'),_0x5bec14,JSON['stringify'](_0x4a2922));_0x4d8a79(_0x4a2922);})[_0x6791('0x14')](function(_0x309610){logger[_0x6791('0xf')](_0x6791('0x15'),_0x309610['message'],_0x5bec14);_0xe55dba(_0x1872f5[_0x6791('0xf')](0x1f4,_0x309610[_0x6791('0x11')]));});});};exports['AvgHandleTime']=function(_0x53bb44){var _0x4b23bc=this;return new Promise(function(_0x372dae,_0x502043){return db[_0x6791('0x16')]['findAll']({'raw':_0x53bb44['options']?_0x53bb44['options'][_0x6791('0x1a')]===undefined?!![]:![]:!![],'where':_0x53bb44[_0x6791('0x19')]?_0x53bb44[_0x6791('0x19')]['where']||null:null,'attributes':[[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db['sequelize'][_0x6791('0x1d')]('id')),'predictiveIntervalTotalCalls'],[db[_0x6791('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x1e')))),_0x6791('0x1f')],[db['sequelize']['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x6791('0x1b')]['fn']('COUNT',db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x21')))),_0x6791('0x22')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x23'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x6791('0x24')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x23'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x1de770){logger[_0x6791('0x12')](_0x6791('0x25'),_0x53bb44);logger['debug']('AvgHandleTime',_0x53bb44,JSON[_0x6791('0xe')](_0x1de770));_0x372dae(_0x1de770);})[_0x6791('0x14')](function(_0x31a525){logger[_0x6791('0xf')]('AvgHandleTime',_0x31a525[_0x6791('0x11')],_0x53bb44);_0x502043(_0x4b23bc[_0x6791('0xf')](0x1f4,_0x31a525[_0x6791('0x11')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x31217d){var _0x567e36=this;return new Promise(function(_0x4ee010,_0x256c02){return db[_0x6791('0x16')]['findAll']({'raw':_0x31217d[_0x6791('0x19')]?_0x31217d[_0x6791('0x19')][_0x6791('0x1a')]===undefined?!![]:![]:!![],'where':_0x31217d[_0x6791('0x19')]?_0x31217d[_0x6791('0x19')]['where']||null:null,'attributes':[[_0x6791('0x26'),_0x6791('0x27')],[db[_0x6791('0x1b')]['fn']('COUNT',db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x200,\x201,\x20null'))),_0x6791('0x28')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db['sequelize'][_0x6791('0x20')](_0x6791('0x29')))),_0x6791('0x2a')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x1e')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db['sequelize'][_0x6791('0x20')](_0x6791('0x2b')))),_0x6791('0x2c')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x2d')))),'outboundCongestionCallsDay'],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x2e')))),_0x6791('0x2f')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x30')))),'outboundDropCallsDayCallersExit'],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x31')))),_0x6791('0x32')],[db['sequelize']['fn'](_0x6791('0x1c'),db['sequelize']['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x33')))),_0x6791('0x34')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x2014,\x201,\x20null'))),_0x6791('0x35')],[db['sequelize']['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x36')))),'outboundRejectCallsDay'],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x2016,\x201,\x20null'))),_0x6791('0x37')],[db[_0x6791('0x1b')]['fn']('COUNT',db[_0x6791('0x1b')]['fn']('IF',db['sequelize'][_0x6791('0x20')](_0x6791('0x38')))),_0x6791('0x39')],[db[_0x6791('0x1b')]['fn']('COUNT',db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x3a')))),_0x6791('0x3b')]],'group':[_0x6791('0x26')]})['then'](function(_0x355e97){logger[_0x6791('0x12')]('GetVoiceQueueHopperHistory',_0x31217d);logger[_0x6791('0xd')](_0x6791('0x3c'),_0x31217d,JSON['stringify'](_0x355e97));_0x4ee010(_0x355e97);})[_0x6791('0x14')](function(_0x216498){logger[_0x6791('0xf')](_0x6791('0x3c'),_0x216498['message'],_0x31217d);_0x256c02(_0x567e36[_0x6791('0xf')](0x1f4,_0x216498[_0x6791('0x11')]));});});};exports[_0x6791('0x3d')]=function(_0x5b534b){var _0x5a7a88=this;return new Promise(function(_0x1d6bec,_0x6b8acd){return db[_0x6791('0x16')][_0x6791('0x3e')]({'raw':_0x5b534b[_0x6791('0x19')]?_0x5b534b['options']['raw']===undefined?!![]:![]:!![],'where':_0x5b534b[_0x6791('0x19')]?_0x5b534b['options']['where']||null:null,'attributes':[[_0x6791('0x26'),_0x6791('0x27')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')][_0x6791('0x1d')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db['sequelize'][_0x6791('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0x6791('0x3f')]],'group':[_0x6791('0x26')]})['then'](function(_0x1ebfb6){logger[_0x6791('0x12')](_0x6791('0x3d'),_0x5b534b);logger['debug'](_0x6791('0x3d'),_0x5b534b,JSON[_0x6791('0xe')](_0x1ebfb6));_0x1d6bec(_0x1ebfb6);})[_0x6791('0x14')](function(_0x383853){logger[_0x6791('0xf')]('GetCampaignHopperHistory',_0x383853['message'],_0x5b534b);_0x6b8acd(_0x5a7a88[_0x6791('0xf')](0x1f4,_0x383853[_0x6791('0x11')]));});});}; \ No newline at end of file +var _0x750a=['CmHopperHistory','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','catch','body','options','then','AvgHandleTime'];(function(_0x29b41b,_0x566b51){var _0xb5ab60=function(_0x2ab86c){while(--_0x2ab86c){_0x29b41b['push'](_0x29b41b['shift']());}};_0xb5ab60(++_0x566b51);}(_0x750a,0x140));var _0xa750=function(_0xe787f3,_0x1d2631){_0xe787f3=_0xe787f3-0x0;var _0x5d5f16=_0x750a[_0xe787f3];return _0x5d5f16;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});}exports['CreateCmHopperHistory']=function(_0x433dbd){var _0x1bde87=this;return new Promise(function(_0x4f1faa,_0x36dcca){return db['CmHopperHistory']['create'](_0x433dbd[_0xa750('0x15')],{'raw':_0x433dbd['options']?_0x433dbd[_0xa750('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xa750('0x17')](function(_0x4a007d){logger[_0xa750('0xc')]('CreateCmHopperHistory',_0x433dbd);logger[_0xa750('0xe')]('CreateCmHopperHistory',_0x433dbd,JSON['stringify'](_0x4a007d));_0x4f1faa(_0x4a007d);})[_0xa750('0x14')](function(_0x52da84){logger[_0xa750('0x10')]('CreateCmHopperHistory',_0x52da84['message'],_0x433dbd);_0x36dcca(_0x1bde87['error'](0x1f4,_0x52da84['message']));});});};exports[_0xa750('0x18')]=function(_0x2ec6c4){var _0x2c43ef=this;return new Promise(function(_0x384d48,_0x1b80a5){return db[_0xa750('0x19')][_0xa750('0x1a')]({'raw':_0x2ec6c4[_0xa750('0x16')]?_0x2ec6c4[_0xa750('0x16')][_0xa750('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ec6c4[_0xa750('0x16')]?_0x2ec6c4[_0xa750('0x16')][_0xa750('0x1c')]||null:null,'attributes':[[db[_0xa750('0x1d')]['fn'](_0xa750('0x1e'),db['sequelize'][_0xa750('0x1f')]('id')),_0xa750('0x20')],[db[_0xa750('0x1d')]['fn']('COUNT',db[_0xa750('0x1d')]['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')](_0xa750('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0xa750('0x1d')]['fn'](_0xa750('0x1e'),db[_0xa750('0x1d')]['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')]('`state`\x20=\x2010,\x201,\x20null'))),_0xa750('0x23')],[db['sequelize']['fn'](_0xa750('0x1e'),db[_0xa750('0x1d')]['fn']('IF',db['sequelize'][_0xa750('0x21')](_0xa750('0x24')))),_0xa750('0x25')],[db[_0xa750('0x1d')]['fn'](_0xa750('0x26'),db[_0xa750('0x1d')]['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xa750('0x27')],[db['sequelize']['fn'](_0xa750('0x26'),db[_0xa750('0x1d')]['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xa750('0x28')]]})[_0xa750('0x17')](function(_0x5c2e02){logger[_0xa750('0xc')](_0xa750('0x18'),_0x2ec6c4);logger[_0xa750('0xe')](_0xa750('0x18'),_0x2ec6c4,JSON['stringify'](_0x5c2e02));_0x384d48(_0x5c2e02);})[_0xa750('0x14')](function(_0x5a0bbd){logger['error'](_0xa750('0x18'),_0x5a0bbd[_0xa750('0x13')],_0x2ec6c4);_0x1b80a5(_0x2c43ef[_0xa750('0x10')](0x1f4,_0x5a0bbd['message']));});});};exports[_0xa750('0x29')]=function(_0x28603e){var _0x181d77=this;return new Promise(function(_0x53ad23,_0x37abd2){return db[_0xa750('0x19')][_0xa750('0x1a')]({'raw':_0x28603e['options']?_0x28603e[_0xa750('0x16')][_0xa750('0x1b')]===undefined?!![]:![]:!![],'where':_0x28603e[_0xa750('0x16')]?_0x28603e['options'][_0xa750('0x1c')]||null:null,'attributes':[[_0xa750('0x2a'),_0xa750('0x2b')],[db[_0xa750('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')]('`state`\x20=\x200,\x201,\x20null'))),_0xa750('0x2c')],[db[_0xa750('0x1d')]['fn'](_0xa750('0x1e'),db[_0xa750('0x1d')]['fn']('IF',db[_0xa750('0x1d')]['literal'](_0xa750('0x2d')))),_0xa750('0x2e')],[db[_0xa750('0x1d')]['fn'](_0xa750('0x1e'),db[_0xa750('0x1d')]['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0xa750('0x2f')],[db['sequelize']['fn'](_0xa750('0x1e'),db['sequelize']['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')](_0xa750('0x30')))),_0xa750('0x31')],[db[_0xa750('0x1d')]['fn'](_0xa750('0x1e'),db[_0xa750('0x1d')]['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')](_0xa750('0x32')))),_0xa750('0x33')],[db[_0xa750('0x1d')]['fn'](_0xa750('0x1e'),db[_0xa750('0x1d')]['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')](_0xa750('0x34')))),_0xa750('0x35')],[db[_0xa750('0x1d')]['fn'](_0xa750('0x1e'),db['sequelize']['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')](_0xa750('0x36')))),_0xa750('0x37')],[db[_0xa750('0x1d')]['fn'](_0xa750('0x1e'),db[_0xa750('0x1d')]['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')]('`state`\x20=\x2012,\x201,\x20null'))),_0xa750('0x38')],[db[_0xa750('0x1d')]['fn']('COUNT',db[_0xa750('0x1d')]['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')](_0xa750('0x39')))),_0xa750('0x3a')],[db[_0xa750('0x1d')]['fn'](_0xa750('0x1e'),db[_0xa750('0x1d')]['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')]('`state`\x20=\x2014,\x201,\x20null'))),_0xa750('0x3b')],[db[_0xa750('0x1d')]['fn']('COUNT',db[_0xa750('0x1d')]['fn']('IF',db[_0xa750('0x1d')][_0xa750('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),_0xa750('0x3c')],[db[_0xa750('0x1d')]['fn'](_0xa750('0x1e'),db[_0xa750('0x1d')]['fn']('IF',db['sequelize'][_0xa750('0x21')](_0xa750('0x3d')))),_0xa750('0x3e')],[db[_0xa750('0x1d')]['fn']('COUNT',db[_0xa750('0x1d')]['fn']('IF',db[_0xa750('0x1d')]['literal'](_0xa750('0x3f')))),'outboundRejectCallsDay'],[db[_0xa750('0x1d')]['fn'](_0xa750('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xa750('0x40')))),_0xa750('0x41')]],'group':['campaign']})[_0xa750('0x17')](function(_0x1a79a9){logger[_0xa750('0xc')]('GetVoiceQueueHopperHistory',_0x28603e);logger['debug']('GetVoiceQueueHopperHistory',_0x28603e,JSON['stringify'](_0x1a79a9));_0x53ad23(_0x1a79a9);})[_0xa750('0x14')](function(_0x4a1b5d){logger[_0xa750('0x10')](_0xa750('0x29'),_0x4a1b5d['message'],_0x28603e);_0x37abd2(_0x181d77[_0xa750('0x10')](0x1f4,_0x4a1b5d['message']));});});};exports[_0xa750('0x42')]=function(_0x53c0a9){var _0x54788d=this;return new Promise(function(_0x5940be,_0x495457){return db[_0xa750('0x19')][_0xa750('0x1a')]({'raw':_0x53c0a9['options']?_0x53c0a9['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c0a9[_0xa750('0x16')]?_0x53c0a9[_0xa750('0x16')][_0xa750('0x1c')]||null:null,'attributes':[[_0xa750('0x2a'),_0xa750('0x2b')],[db[_0xa750('0x1d')]['fn']('COUNT',db['sequelize'][_0xa750('0x1f')]('id')),_0xa750('0x43')],[db[_0xa750('0x1d')]['fn'](_0xa750('0x1e'),db[_0xa750('0x1d')]['fn']('IF',db['sequelize'][_0xa750('0x21')](_0xa750('0x22')))),_0xa750('0x44')]],'group':[_0xa750('0x2a')]})[_0xa750('0x17')](function(_0x2ec84f){logger[_0xa750('0xc')](_0xa750('0x42'),_0x53c0a9);logger['debug'](_0xa750('0x42'),_0x53c0a9,JSON[_0xa750('0xf')](_0x2ec84f));_0x5940be(_0x2ec84f);})[_0xa750('0x14')](function(_0x1f03e2){logger[_0xa750('0x10')]('GetCampaignHopperHistory',_0x1f03e2[_0xa750('0x13')],_0x53c0a9);_0x495457(_0x54788d[_0xa750('0x10')](0x1f4,_0x1f03e2[_0xa750('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index b338f85..4c89b62 100644 --- a/server/api/cmHopperHistory/index.js +++ b/server/api/cmHopperHistory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x120c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1f47ec,_0x38b00b){var _0x259910=function(_0x1de11e){while(--_0x1de11e){_0x1f47ec['push'](_0x1f47ec['shift']());}};_0x259910(++_0x38b00b);}(_0x120c,0x189));var _0xc120=function(_0x28767a,_0x5311a8){_0x28767a=_0x28767a-0x0;var _0x2fc023=_0x120c[_0x28767a];return _0x2fc023;};'use strict';var multer=require(_0xc120('0x0'));var util=require(_0xc120('0x1'));var path=require(_0xc120('0x2'));var timeout=require(_0xc120('0x3'));var express=require(_0xc120('0x4'));var router=express[_0xc120('0x5')]();var auth=require(_0xc120('0x6'));var interaction=require(_0xc120('0x7'));var config=require(_0xc120('0x8'));var controller=require(_0xc120('0x9'));router[_0xc120('0xa')]('/',auth[_0xc120('0xb')](),controller[_0xc120('0xc')]);router[_0xc120('0xa')](_0xc120('0xd'),auth[_0xc120('0xb')](),controller['describe']);router['get']('/:id',auth[_0xc120('0xb')](),controller[_0xc120('0xe')]);router[_0xc120('0xf')]('/',auth[_0xc120('0xb')](),controller[_0xc120('0x10')]);router[_0xc120('0x11')](_0xc120('0x12'),auth[_0xc120('0xb')](),controller[_0xc120('0x13')]);module[_0xc120('0x14')]=router; \ No newline at end of file +var _0xa7be=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','exports'];(function(_0x3a0631,_0x2d8a7e){var _0x44bdf0=function(_0x3d5b19){while(--_0x3d5b19){_0x3a0631['push'](_0x3a0631['shift']());}};_0x44bdf0(++_0x2d8a7e);}(_0xa7be,0x1a4));var _0xea7b=function(_0xe11474,_0x15f1b2){_0xe11474=_0xe11474-0x0;var _0x418d29=_0xa7be[_0xe11474];return _0x418d29;};'use strict';var multer=require(_0xea7b('0x0'));var util=require(_0xea7b('0x1'));var path=require(_0xea7b('0x2'));var timeout=require(_0xea7b('0x3'));var express=require(_0xea7b('0x4'));var router=express[_0xea7b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xea7b('0x6'));var config=require(_0xea7b('0x7'));var controller=require(_0xea7b('0x8'));router[_0xea7b('0x9')]('/',auth[_0xea7b('0xa')](),controller[_0xea7b('0xb')]);router[_0xea7b('0x9')](_0xea7b('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xea7b('0xd'),auth[_0xea7b('0xa')](),controller[_0xea7b('0xe')]);router[_0xea7b('0xf')]('/',auth[_0xea7b('0xa')](),controller[_0xea7b('0x10')]);router[_0xea7b('0x11')](_0xea7b('0xd'),auth[_0xea7b('0xa')](),controller[_0xea7b('0x12')]);module[_0xea7b('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index c1d9806..f2743d3 100644 --- a/server/api/cmList/cmList.attributes.js +++ b/server/api/cmList/cmList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf898=['STRING','sequelize','exports'];(function(_0x32f578,_0x445c0a){var _0x1a0a9f=function(_0x34d4a8){while(--_0x34d4a8){_0x32f578['push'](_0x32f578['shift']());}};_0x1a0a9f(++_0x445c0a);}(_0xf898,0x181));var _0x8f89=function(_0x816b92,_0x2a5008){_0x816b92=_0x816b92-0x0;var _0x49c4bd=_0xf898[_0x816b92];return _0x49c4bd;};'use strict';var Sequelize=require(_0x8f89('0x0'));module[_0x8f89('0x1')]={'name':{'type':Sequelize[_0x8f89('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8f89('0x2')]},'dialPrefix':{'type':Sequelize[_0x8f89('0x2')]}}; \ No newline at end of file +var _0x5536=['sequelize','exports','STRING','name'];(function(_0xc5462a,_0x40e2e9){var _0x7d0b67=function(_0x2cd8a0){while(--_0x2cd8a0){_0xc5462a['push'](_0xc5462a['shift']());}};_0x7d0b67(++_0x40e2e9);}(_0x5536,0x180));var _0x6553=function(_0x39c9a2,_0x450368){_0x39c9a2=_0x39c9a2-0x0;var _0x5e770f=_0x5536[_0x39c9a2];return _0x5e770f;};'use strict';var Sequelize=require(_0x6553('0x0'));module[_0x6553('0x1')]={'name':{'type':Sequelize[_0x6553('0x2')],'unique':_0x6553('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6553('0x2')]},'dialPrefix':{'type':Sequelize[_0x6553('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 47866e5..1e6bfac 100644 --- a/server/api/cmList/cmList.controller.js +++ b/server/api/cmList/cmList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','end','error','stack','name','index','CmList','rawAttributes','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','params','describe','Disposition','getDispositions','findOne','hasOwnProperty','ListId','filter','map','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','success','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js'];(function(_0x51b2bd,_0x8bfed6){var _0x8d7a18=function(_0x198608){while(--_0x198608){_0x51b2bd['push'](_0x51b2bd['shift']());}};_0x8d7a18(++_0x8bfed6);}(_0x7a54,0x106));var _0x47a5=function(_0x502f0e,_0x458ce2){_0x502f0e=_0x502f0e-0x0;var _0x475322=_0x7a54[_0x502f0e];return _0x475322;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];config[_0x47a5('0x14')]=_[_0x47a5('0x15')](config[_0x47a5('0x14')],{'host':_0x47a5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x14')]));require(_0x47a5('0x17'))[_0x47a5('0x18')](socket);function respondWithStatusCode(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xcc;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x19')](_0x139f25);}return _0x711793[_0x47a5('0x1a')](_0x139f25)['end']();};}function respondWithResult(_0x362359,_0x11faf5){_0x11faf5=_0x11faf5||0xc8;return function(_0x3b001e){if(_0x3b001e){return _0x362359[_0x47a5('0x1a')](_0x11faf5)[_0x47a5('0x1b')](_0x3b001e);}};}function respondWithFilteredResult(_0x574af6,_0x549de3){return function(_0x138bc0){if(_0x138bc0){var _0x4b966e=_0x138bc0[_0x47a5('0x1c')],_0x5247fd=_0x549de3[_0x47a5('0x1d')],_0x423a81=_0x549de3[_0x47a5('0x1d')]+_0x549de3[_0x47a5('0x1e')],_0xaf70a6;if(_0x423a81>=_0x4b966e){_0x423a81=_0x4b966e;_0xaf70a6=0xc8;}else{_0xaf70a6=0xce;}_0x574af6[_0x47a5('0x1a')](_0xaf70a6);return _0x574af6[_0x47a5('0x1f')](_0x47a5('0x20'),_0x5247fd+'-'+_0x423a81+'/'+_0x4b966e)['json'](_0x138bc0);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x21')](_0x2b0360);}return _0xf160ba[_0x47a5('0x22')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x23')](_0x4c5910)[_0x47a5('0x24')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x25')]()[_0x47a5('0x24')](function(){var _0x4437f1=_0x513981[_0x47a5('0x26')]({'plain':!![]});var _0x3abd6a='Lists';return db['UserProfileResource'][_0x47a5('0x25')]({'where':{'type':_0x3abd6a,'resourceId':_0x4437f1['id']}})['then'](function(){return _0x513981;});})[_0x47a5('0x24')](function(){_0xe2dea9['status'](0xcc)[_0x47a5('0x27')]();});}};}function handleEntityNotFound(_0x378208,_0x36ad34){return function(_0x1dac65){if(!_0x1dac65){_0x378208[_0x47a5('0x19')](0x194);}return _0x1dac65;};}function handleError(_0x3ba0b7,_0x24b162){_0x24b162=_0x24b162||0x1f4;return function(_0x136b14){logger[_0x47a5('0x28')](_0x136b14[_0x47a5('0x29')]);if(_0x136b14[_0x47a5('0x2a')]){delete _0x136b14[_0x47a5('0x2a')];}_0x3ba0b7[_0x47a5('0x1a')](_0x24b162)['send'](_0x136b14);};}exports[_0x47a5('0x2b')]=function(_0x51833b,_0x2ef875){var _0x9ac908={},_0x16901f={},_0x4d6b57={'count':0x0,'rows':[]};var _0x256650=db[_0x47a5('0x2c')][_0x47a5('0x2d')];_0x16901f[_0x47a5('0x2e')]=_['keys'](_0x256650);_0x16901f['query']=_[_0x47a5('0x2f')](_0x51833b[_0x47a5('0x30')]);_0x16901f['filters']=_['intersection'](_0x16901f[_0x47a5('0x2e')],_0x16901f[_0x47a5('0x30')]);_0x9ac908['attributes']=_[_0x47a5('0x31')](_0x16901f['model'],qs[_0x47a5('0x32')](_0x51833b[_0x47a5('0x30')]['fields']));_0x9ac908['attributes']=_0x9ac908[_0x47a5('0x33')]['length']?_0x9ac908[_0x47a5('0x33')]:_0x16901f[_0x47a5('0x2e')];if(!_0x51833b[_0x47a5('0x30')]['hasOwnProperty'](_0x47a5('0x34'))){_0x9ac908['limit']=qs['limit'](_0x51833b[_0x47a5('0x30')]['limit']);_0x9ac908[_0x47a5('0x1d')]=qs['offset'](_0x51833b[_0x47a5('0x30')][_0x47a5('0x1d')]);}_0x9ac908[_0x47a5('0x35')]=qs[_0x47a5('0x36')](_0x51833b[_0x47a5('0x30')][_0x47a5('0x36')]);_0x9ac908[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_[_0x47a5('0x39')](_0x51833b['query'],_0x16901f[_0x47a5('0x38')]));if(_0x51833b[_0x47a5('0x30')]['filter']){_0x9ac908[_0x47a5('0x37')]=_[_0x47a5('0x3a')](_0x9ac908[_0x47a5('0x37')],{'$or':_['map'](_0x256650,function(_0x101f70){if(_0x101f70[_0x47a5('0x3b')]['key']!==_0x47a5('0x3c')){var _0x19218a={};_0x19218a[_0x101f70['field']]={'$like':'%'+_0x51833b['query']['filter']+'%'};return _0x19218a;}})});}_0x9ac908=_[_0x47a5('0x3a')]({},_0x9ac908,_0x51833b['options']);var _0x9b5eaf={'where':_0x9ac908[_0x47a5('0x37')]};return db[_0x47a5('0x2c')][_0x47a5('0x1c')](_0x9b5eaf)[_0x47a5('0x24')](function(_0xcb5243){_0x4d6b57[_0x47a5('0x1c')]=_0xcb5243;if(_0x51833b[_0x47a5('0x30')][_0x47a5('0x3d')]){_0x9ac908[_0x47a5('0x3e')]=[{'all':!![]}];}return db[_0x47a5('0x2c')][_0x47a5('0x3f')](_0x9ac908);})[_0x47a5('0x24')](function(_0x56dbbd){_0x4d6b57[_0x47a5('0x40')]=_0x56dbbd;return _0x4d6b57;})[_0x47a5('0x24')](respondWithFilteredResult(_0x2ef875,_0x9ac908))[_0x47a5('0x41')](handleError(_0x2ef875,null));};exports[_0x47a5('0x42')]=function(_0x586f4f,_0x7de536){var _0x528ef3={'raw':![],'where':{'id':_0x586f4f['params']['id']}},_0x47c7a2={};_0x47c7a2['model']=_[_0x47a5('0x2f')](db['CmList'][_0x47a5('0x2d')]);_0x47c7a2[_0x47a5('0x30')]=_[_0x47a5('0x2f')](_0x586f4f['query']);_0x47c7a2[_0x47a5('0x38')]=_[_0x47a5('0x31')](_0x47c7a2['model'],_0x47c7a2['query']);_0x528ef3[_0x47a5('0x33')]=_['intersection'](_0x47c7a2[_0x47a5('0x2e')],qs[_0x47a5('0x32')](_0x586f4f[_0x47a5('0x30')][_0x47a5('0x32')]));_0x528ef3[_0x47a5('0x33')]=_0x528ef3[_0x47a5('0x33')][_0x47a5('0x43')]?_0x528ef3[_0x47a5('0x33')]:_0x47c7a2[_0x47a5('0x2e')];if(_0x586f4f[_0x47a5('0x30')][_0x47a5('0x3d')]){_0x528ef3[_0x47a5('0x3e')]=[{'all':!![]}];}_0x528ef3=_[_0x47a5('0x3a')]({},_0x528ef3,_0x586f4f[_0x47a5('0x44')]);return db[_0x47a5('0x2c')][_0x47a5('0x45')](_0x528ef3)['then'](handleEntityNotFound(_0x7de536,null))[_0x47a5('0x24')](respondWithResult(_0x7de536,null))[_0x47a5('0x41')](handleError(_0x7de536,null));};exports['create']=function(_0x52b3a8,_0x3d0a88){return db['CmList'][_0x47a5('0x46')](_0x52b3a8[_0x47a5('0x47')],{})['then'](function(_0x4f62d3){var _0x3d85cc=_0x52b3a8['user'][_0x47a5('0x26')]({'plain':!![]});if(!_0x3d85cc)throw new Error(_0x47a5('0x48'));if(_0x3d85cc[_0x47a5('0x49')]===_0x47a5('0x4a')){var _0x44fe8a=_0x4f62d3[_0x47a5('0x26')]({'plain':!![]});var _0x238ebb='Lists';return db['UserProfileSection'][_0x47a5('0x45')]({'where':{'name':_0x238ebb,'userProfileId':_0x3d85cc[_0x47a5('0x4b')]},'raw':!![]})[_0x47a5('0x24')](function(_0x9ea93e){if(_0x9ea93e&&_0x9ea93e[_0x47a5('0x4c')]===0x0){return db[_0x47a5('0x4d')][_0x47a5('0x46')]({'name':_0x44fe8a['name'],'resourceId':_0x44fe8a['id'],'type':_0x9ea93e[_0x47a5('0x2a')],'sectionId':_0x9ea93e['id']},{})[_0x47a5('0x24')](function(){return _0x4f62d3;});}else{return _0x4f62d3;}})[_0x47a5('0x41')](function(_0x5c3c75){logger[_0x47a5('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c3c75);throw _0x5c3c75;});}return _0x4f62d3;})[_0x47a5('0x24')](respondWithResult(_0x3d0a88,0xc9))[_0x47a5('0x41')](handleError(_0x3d0a88,null));};exports[_0x47a5('0x23')]=function(_0xf03bd5,_0x588551){if(_0xf03bd5[_0x47a5('0x47')]['id']){delete _0xf03bd5[_0x47a5('0x47')]['id'];}return db[_0x47a5('0x2c')][_0x47a5('0x45')]({'where':{'id':_0xf03bd5[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x588551,null))[_0x47a5('0x24')](saveUpdates(_0xf03bd5['body'],null))[_0x47a5('0x24')](respondWithResult(_0x588551,null))[_0x47a5('0x41')](handleError(_0x588551,null));};exports[_0x47a5('0x25')]=function(_0x8da9fb,_0x3329aa){return db[_0x47a5('0x2c')]['find']({'where':{'id':_0x8da9fb[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x3329aa,null))[_0x47a5('0x24')](removeEntity(_0x3329aa,null))['catch'](handleError(_0x3329aa,null));};exports[_0x47a5('0x4f')]=function(_0x3c78b7,_0x183b3c){return db['CmList']['describe']()[_0x47a5('0x24')](respondWithResult(_0x183b3c,null))[_0x47a5('0x41')](handleError(_0x183b3c,null));};exports['addDisposition']=function(_0x4cf792,_0x6d6b2b,_0x4d6a82){if(_0x4cf792[_0x47a5('0x47')]['id']){delete _0x4cf792['body']['id'];}return db['CmList'][_0x47a5('0x45')]({'where':{'id':_0x4cf792[_0x47a5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x6d6b2b,null))[_0x47a5('0x24')](function(_0x72fe){if(_0x72fe){_0x4cf792['body']['ListId']=_0x72fe['id'];return db[_0x47a5('0x50')][_0x47a5('0x46')](_0x4cf792[_0x47a5('0x47')]);}})[_0x47a5('0x24')](respondWithResult(_0x6d6b2b,null))['catch'](handleError(_0x6d6b2b,null));};exports[_0x47a5('0x51')]=function(_0x2b4255,_0x1af800,_0x5a33b8){var _0x30ea7a={'raw':![],'where':{}};var _0x4db625={};var _0x485e3c={'count':0x0,'rows':[]};return db[_0x47a5('0x2c')][_0x47a5('0x52')]({'where':{'id':_0x2b4255[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x1af800,null))['then'](function(_0x144af9){if(_0x144af9){_0x4db625['model']=_['keys'](db['Disposition']['rawAttributes']);_0x4db625[_0x47a5('0x30')]=_[_0x47a5('0x2f')](_0x2b4255[_0x47a5('0x30')]);_0x4db625['filters']=_['intersection'](_0x4db625[_0x47a5('0x2e')],_0x4db625[_0x47a5('0x30')]);_0x30ea7a[_0x47a5('0x33')]=_[_0x47a5('0x31')](_0x4db625[_0x47a5('0x2e')],qs['fields'](_0x2b4255[_0x47a5('0x30')]['fields']));_0x30ea7a[_0x47a5('0x33')]=_0x30ea7a[_0x47a5('0x33')]['length']?_0x30ea7a[_0x47a5('0x33')]:_0x4db625[_0x47a5('0x2e')];if(!_0x2b4255[_0x47a5('0x30')][_0x47a5('0x53')](_0x47a5('0x34'))){_0x30ea7a[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x2b4255[_0x47a5('0x30')]['limit']);_0x30ea7a[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x2b4255[_0x47a5('0x30')][_0x47a5('0x1d')]);}_0x30ea7a[_0x47a5('0x35')]=qs['sort'](_0x2b4255[_0x47a5('0x30')][_0x47a5('0x36')]);_0x30ea7a[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_[_0x47a5('0x39')](_0x2b4255[_0x47a5('0x30')],_0x4db625[_0x47a5('0x38')]));_0x30ea7a[_0x47a5('0x37')][_0x47a5('0x54')]=_0x144af9['id'];if(_0x2b4255[_0x47a5('0x30')][_0x47a5('0x55')]){_0x30ea7a[_0x47a5('0x37')]=_[_0x47a5('0x3a')](_0x30ea7a[_0x47a5('0x37')],{'$or':_[_0x47a5('0x56')](_0x30ea7a['attributes'],function(_0x42dd7d){var _0x284fb8={};_0x284fb8[_0x42dd7d]={'$like':'%'+_0x2b4255[_0x47a5('0x30')]['filter']+'%'};return _0x284fb8;})});}_0x30ea7a=_[_0x47a5('0x3a')]({},_0x30ea7a,_0x2b4255[_0x47a5('0x44')]);return db[_0x47a5('0x50')][_0x47a5('0x1c')]({'where':_0x30ea7a['where']})[_0x47a5('0x24')](function(_0x522ccf){_0x485e3c[_0x47a5('0x1c')]=_0x522ccf;if(_0x2b4255['query'][_0x47a5('0x3d')]){_0x30ea7a['include']=[{'all':!![]}];}return db[_0x47a5('0x50')][_0x47a5('0x3f')](_0x30ea7a);})[_0x47a5('0x24')](function(_0x58473b){_0x485e3c['rows']=_0x58473b;return _0x485e3c;});}})['then'](respondWithFilteredResult(_0x1af800,_0x30ea7a))[_0x47a5('0x41')](handleError(_0x1af800,null));};exports[_0x47a5('0x57')]=function(_0xe3c0a7,_0x117510,_0x525055){return db[_0x47a5('0x2c')][_0x47a5('0x45')]({'where':{'id':_0xe3c0a7[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x117510,null))[_0x47a5('0x24')](function(_0xb9f589){if(_0xb9f589){return _0xb9f589[_0x47a5('0x57')](_0xe3c0a7[_0x47a5('0x30')][_0x47a5('0x58')]);}})[_0x47a5('0x24')](respondWithStatusCode(_0x117510,null))[_0x47a5('0x41')](handleError(_0x117510,null));};exports[_0x47a5('0x59')]=function(_0x49d3dc,_0x1e3212,_0x4833be){return db[_0x47a5('0x2c')][_0x47a5('0x45')]({'where':{'id':_0x49d3dc[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x1e3212,null))[_0x47a5('0x24')](function(_0xa9c853){if(_0xa9c853){var _0x12025a=[];var _0x448981={'success':[],'errors':[]};return db[_0x47a5('0x5a')][_0x47a5('0x4f')]()[_0x47a5('0x24')](function(_0x1f07ac){if(_0x49d3dc[_0x47a5('0x47')][_0x47a5('0x5b')]&&_[_0x47a5('0x5c')](_0x49d3dc['body']['tags'])){if(_0x49d3dc['body']['tags'][_0x47a5('0x43')]){_0x49d3dc[_0x47a5('0x47')]['tags']=_0x49d3dc[_0x47a5('0x47')][_0x47a5('0x5b')][_0x47a5('0x5d')](';')+';';}else{_0x49d3dc[_0x47a5('0x47')][_0x47a5('0x5b')]=null;}}else{_0x49d3dc[_0x47a5('0x47')][_0x47a5('0x5b')]=null;}if(_0x49d3dc[_0x47a5('0x47')]&&_[_0x47a5('0x5c')](_0x49d3dc[_0x47a5('0x47')])){for(var _0x24a6c1=0x0;_0x24a6c1<_0x49d3dc['body'][_0x47a5('0x43')];_0x24a6c1+=0x1){_0x49d3dc[_0x47a5('0x47')][_0x24a6c1][_0x47a5('0x54')]=_0x49d3dc['params']['id'];_0x12025a[_0x47a5('0x5e')](_0x49d3dc[_0x47a5('0x47')][_0x24a6c1]);}return BPromise[_0x47a5('0x5f')](_0x12025a,function(_0x5d41d8){return db[_0x47a5('0x5a')]['create'](_['omit'](_0x5d41d8,[_0x47a5('0x58'),'id'])||{},{'fields':_[_0x47a5('0x2f')](_0x1f07ac),'raw':!![]})[_0x47a5('0x24')](function(_0x27333e){_0x448981[_0x47a5('0x60')][_0x47a5('0x5e')](_0x27333e['dataValues']);})['catch'](function(_0x3e0dbd){_0x448981['errors'][_0x47a5('0x5e')]({'data':_0x5d41d8,'error':_0x3e0dbd[_0x47a5('0x61')]});});})[_0x47a5('0x24')](function(_0xb16bdd){return _0x448981;})['catch'](function(_0x3c66e3){return _0x3c66e3;});}else{_0x1e3212['status'](0x190)['json']({'message':_0x47a5('0x62')});}});}})[_0x47a5('0x24')](respondWithResult(_0x1e3212,null))['catch'](handleError(_0x1e3212,null));};exports[_0x47a5('0x63')]=function(_0x21828e,_0x24a98b,_0x4c25ec){var _0x280372;return db['CmList'][_0x47a5('0x45')]({'where':{'id':_0x21828e[_0x47a5('0x4e')]['id']},'include':[{'model':db[_0x47a5('0x64')],'as':'CustomFields'}]})[_0x47a5('0x24')](handleEntityNotFound(_0x24a98b,null))[_0x47a5('0x24')](function(_0x2ae38b){if(_0x2ae38b){_0x280372=_0x2ae38b;return db['CmContact'][_0x47a5('0x2d')];}})['then'](function(_0x3c012b){if(_0x3c012b){var _0x491bb4={};var _0x135d2e={};_0x135d2e[_0x47a5('0x2e')]=_[_0x47a5('0x65')](_[_0x47a5('0x2f')](_0x3c012b),_['map'](_0x280372[_0x47a5('0x66')],function(_0x2ae130){return util[_0x47a5('0x67')](_0x47a5('0x68'),_0x2ae130['id']);}));_0x135d2e[_0x47a5('0x30')]=_['keys'](_0x21828e['query']);_0x135d2e[_0x47a5('0x38')]=_['intersection'](_0x135d2e[_0x47a5('0x2e')],_0x135d2e[_0x47a5('0x30')]);_0x491bb4[_0x47a5('0x33')]=_['intersection'](_0x135d2e[_0x47a5('0x2e')],qs[_0x47a5('0x32')](_0x21828e['query'][_0x47a5('0x32')]));_0x491bb4[_0x47a5('0x33')]=_0x491bb4[_0x47a5('0x33')][_0x47a5('0x43')]?_0x491bb4['attributes']:_0x135d2e['model'];if(!_0x21828e[_0x47a5('0x30')][_0x47a5('0x53')]('nolimit')){_0x491bb4[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x21828e['query'][_0x47a5('0x1e')]);_0x491bb4[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x21828e['query'][_0x47a5('0x1d')]);}_0x491bb4['order']=qs[_0x47a5('0x36')](_0x21828e['query'][_0x47a5('0x36')]);_0x491bb4[_0x47a5('0x37')]=qs['filters'](_[_0x47a5('0x39')](_0x21828e['query'],_0x135d2e[_0x47a5('0x38')]));_0x491bb4[_0x47a5('0x69')]=!![];if(_0x21828e[_0x47a5('0x30')][_0x47a5('0x55')]){_0x491bb4['where']=_[_0x47a5('0x3a')](_0x491bb4['where'],{'$or':_['map'](_0x491bb4[_0x47a5('0x33')],function(_0x46bdb1){var _0x352238={};_0x352238[_0x46bdb1]={'$like':'%'+_0x21828e[_0x47a5('0x30')][_0x47a5('0x55')]+'%'};return _0x352238;})});}_0x491bb4=_['merge']({},_0x491bb4,_0x21828e[_0x47a5('0x44')]);return _0x280372[_0x47a5('0x63')](_0x491bb4);}})[_0x47a5('0x24')](respondWithResult(_0x24a98b,null))[_0x47a5('0x41')](handleError(_0x24a98b,null));};exports['getContactsCsv']=function(_0x240db9,_0x4af162,_0x12891d){var _0x13b958;return db[_0x47a5('0x2c')][_0x47a5('0x45')]({'where':{'id':_0x240db9[_0x47a5('0x4e')]['id']},'include':[{'model':db[_0x47a5('0x64')],'as':_0x47a5('0x66')}]})[_0x47a5('0x24')](handleEntityNotFound(_0x4af162,null))[_0x47a5('0x24')](function(_0x583746){if(_0x583746){_0x13b958=_0x583746;return db[_0x47a5('0x5a')][_0x47a5('0x2d')];}})['then'](function(_0x2fd46f){if(_0x2fd46f){var _0x32035e={};var _0x6d6a5={};_0x6d6a5['model']=_['concat'](_[_0x47a5('0x2f')](_0x2fd46f),_[_0x47a5('0x56')](_0x13b958['CustomFields'],function(_0x537552){return util[_0x47a5('0x67')](_0x47a5('0x68'),_0x537552['id']);}));_0x6d6a5['query']=_[_0x47a5('0x2f')](_0x240db9[_0x47a5('0x30')]);_0x6d6a5['filters']=_[_0x47a5('0x31')](_0x6d6a5[_0x47a5('0x2e')],_0x6d6a5[_0x47a5('0x30')]);_0x32035e[_0x47a5('0x33')]=_[_0x47a5('0x31')](_0x6d6a5[_0x47a5('0x2e')],qs['fields'](_0x240db9['query']['fields']));_0x32035e[_0x47a5('0x33')]=_0x32035e[_0x47a5('0x33')]['length']?_0x32035e[_0x47a5('0x33')]:_0x6d6a5[_0x47a5('0x2e')];if(!_0x240db9[_0x47a5('0x30')][_0x47a5('0x53')](_0x47a5('0x34'))){_0x32035e['limit']=qs[_0x47a5('0x1e')](_0x240db9['query']['limit']);_0x32035e['offset']=qs[_0x47a5('0x1d')](_0x240db9['query'][_0x47a5('0x1d')]);}_0x32035e[_0x47a5('0x35')]=qs[_0x47a5('0x36')](_0x240db9['query'][_0x47a5('0x36')]);_0x32035e[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_[_0x47a5('0x39')](_0x240db9[_0x47a5('0x30')],_0x6d6a5['filters']));_0x32035e[_0x47a5('0x69')]=!![];if(_0x240db9[_0x47a5('0x30')]['filter']){_0x32035e[_0x47a5('0x37')]=_[_0x47a5('0x3a')](_0x32035e[_0x47a5('0x37')],{'$or':_[_0x47a5('0x56')](_0x32035e[_0x47a5('0x33')],function(_0x186aad){var _0x5112d7={};_0x5112d7[_0x186aad]={'$like':'%'+_0x240db9[_0x47a5('0x30')][_0x47a5('0x55')]+'%'};return _0x5112d7;})});}_0x32035e=_['merge']({},_0x32035e,_0x240db9[_0x47a5('0x44')]);return _0x13b958[_0x47a5('0x63')](_0x32035e);}})[_0x47a5('0x24')](function(_0x12a1de){if(!_['isEmpty'](_0x12a1de)){var _0x4a68b0=toCsv(_0x12a1de);var _0x485e10=Date['now']();fs[_0x47a5('0x6a')](util[_0x47a5('0x67')](_0x47a5('0x6b'),_0x13b958['id'],_0x485e10),_0x4a68b0);_0x4af162[_0x47a5('0x6c')](_0x47a5('0x6d'),_0x47a5('0x6e')+util[_0x47a5('0x67')](_0x47a5('0x6f'),_0x13b958['id'],_0x485e10));_0x4af162['setHeader'](_0x47a5('0x70'),_0x47a5('0x71'));return _0x4af162[_0x47a5('0x72')](util[_0x47a5('0x67')]('/tmp/list_%d_%s.csv',_0x13b958['id'],_0x485e10));}else{return _0x4af162['sendStatus'](0xcc);}})[_0x47a5('0x41')](handleError(_0x4af162,null));};exports['addCustomField']=function(_0x4cb8e4,_0x1b6a5c,_0x3f0a15){var _0x491cef;delete _0x4cb8e4[_0x47a5('0x47')]['id'];return db[_0x47a5('0x2c')][_0x47a5('0x52')]({'where':{'id':_0x4cb8e4['params']['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x1b6a5c,null))[_0x47a5('0x24')](function(_0x48a491){if(_0x48a491){return db[_0x47a5('0x73')][_0x47a5('0x74')](function(_0x10ee87){return db[_0x47a5('0x64')][_0x47a5('0x46')](_0x4cb8e4[_0x47a5('0x47')],{'transaction':_0x10ee87})['then'](function(_0x3fee67){_0x491cef=_0x3fee67;return _0x48a491['addCustomFields'](_0x3fee67,{'transaction':_0x10ee87});})[_0x47a5('0x24')](function(){var _0x3ab7ac={'type':db[_0x47a5('0x75')][_0x47a5('0x76')],'transaction':_0x10ee87};switch(_0x4cb8e4['body'][_0x47a5('0x3b')]){case _0x47a5('0x77'):_0x3ab7ac[_0x47a5('0x3b')]=db[_0x47a5('0x75')][_0x47a5('0x76')];break;case _0x47a5('0x78'):_0x3ab7ac[_0x47a5('0x3b')]=db[_0x47a5('0x75')][_0x47a5('0x79')];break;case _0x47a5('0x7a'):_0x3ab7ac[_0x47a5('0x3b')]=db[_0x47a5('0x75')]['BOOLEAN'];_0x3ab7ac[_0x47a5('0x7b')]=![];break;default:}return db[_0x47a5('0x73')]['queryInterface'][_0x47a5('0x7c')](_0x47a5('0x7d'),util[_0x47a5('0x67')](_0x47a5('0x7e'),_0x491cef['id']),_0x3ab7ac);})[_0x47a5('0x24')](function(){return _0x491cef;});});}})['then'](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x41')](handleError(_0x1b6a5c,null));};exports[_0x47a5('0x7f')]=function(_0x285e7b,_0x266a2f,_0x343214){var _0x363077={};var _0x29c205={};var _0x5e4387;var _0x596562;return db[_0x47a5('0x2c')]['findOne']({'where':{'id':_0x285e7b[_0x47a5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x266a2f,null))[_0x47a5('0x24')](function(_0x8b4354){if(_0x8b4354){_0x5e4387=_0x8b4354;_0x29c205[_0x47a5('0x2e')]=_[_0x47a5('0x2f')](db['CmCustomField'][_0x47a5('0x2d')]);_0x29c205[_0x47a5('0x30')]=_[_0x47a5('0x2f')](_0x285e7b['query']);_0x29c205['filters']=_[_0x47a5('0x31')](_0x29c205[_0x47a5('0x2e')],_0x29c205[_0x47a5('0x30')]);_0x363077[_0x47a5('0x33')]=_[_0x47a5('0x31')](_0x29c205[_0x47a5('0x2e')],qs[_0x47a5('0x32')](_0x285e7b[_0x47a5('0x30')]['fields']));_0x363077[_0x47a5('0x33')]=_0x363077['attributes'][_0x47a5('0x43')]?_0x363077[_0x47a5('0x33')]:_0x29c205['model'];_0x363077['order']=qs[_0x47a5('0x36')](_0x285e7b[_0x47a5('0x30')]['sort']);_0x363077[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_[_0x47a5('0x39')](_0x285e7b[_0x47a5('0x30')],_0x29c205['filters']));_0x363077[_0x47a5('0x37')]=_['merge'](_0x363077['where'],{'$or':[{'ListId':_0x8b4354['id']},{'ListId':null}]});if(_0x285e7b['query'][_0x47a5('0x55')]){_0x363077['where']=_[_0x47a5('0x3a')](_0x363077[_0x47a5('0x37')],{'$or':_[_0x47a5('0x56')](_0x363077[_0x47a5('0x33')],function(_0x267d40){var _0x1dae08={};_0x1dae08[_0x267d40]={'$like':'%'+_0x285e7b[_0x47a5('0x30')][_0x47a5('0x55')]+'%'};return _0x1dae08;})});}_0x363077=_[_0x47a5('0x3a')]({},_0x363077,_0x285e7b[_0x47a5('0x44')]);return db[_0x47a5('0x64')][_0x47a5('0x80')](_0x363077);}})[_0x47a5('0x24')](respondWithResult(_0x266a2f,null))[_0x47a5('0x41')](handleError(_0x266a2f,null));};exports[_0x47a5('0x81')]=function(_0x5e17cb,_0xdd95c8,_0x40aee5){return db[_0x47a5('0x2c')][_0x47a5('0x45')]({'where':{'id':_0x5e17cb['params']['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0xdd95c8,null))['then'](function(_0x4476b5){if(_0x4476b5){return _0x4476b5['addAgents'](_0x5e17cb[_0x47a5('0x47')][_0x47a5('0x58')],_[_0x47a5('0x82')](_0x5e17cb['body'],[_0x47a5('0x58'),'id'])||{})[_0x47a5('0x83')](function(_0x14771b){for(var _0x4ac804=0x0;_0x4ac804<_0x5e17cb['body'][_0x47a5('0x58')][_0x47a5('0x43')];_0x4ac804+=0x1){socket[_0x47a5('0x84')](_0x47a5('0x85'),{'UserId':_0x5e17cb[_0x47a5('0x47')]['ids'][_0x4ac804],'CmListId':_0x5e17cb[_0x47a5('0x4e')]['id']});}return _0x14771b;});}})['then'](respondWithResult(_0xdd95c8,null))[_0x47a5('0x41')](handleError(_0xdd95c8,null));};exports[_0x47a5('0x86')]=function(_0x46647f,_0x2d6ae7,_0x5b18a2){return db['CmList'][_0x47a5('0x45')]({'where':{'id':_0x46647f[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x2d6ae7,null))[_0x47a5('0x24')](function(_0x259088){if(_0x259088){return _0x259088[_0x47a5('0x86')](_0x46647f[_0x47a5('0x30')][_0x47a5('0x58')])[_0x47a5('0x24')](function(){if(_['isArray'](_0x46647f['query'][_0x47a5('0x58')])){for(var _0x5b6ee0=0x0;_0x5b6ee0<_0x46647f[_0x47a5('0x30')][_0x47a5('0x58')][_0x47a5('0x43')];_0x5b6ee0+=0x1){socket['emit'](_0x47a5('0x87'),{'UserId':Number(_0x46647f[_0x47a5('0x30')]['ids'][_0x5b6ee0]),'CmListId':Number(_0x46647f[_0x47a5('0x4e')]['id'])});}}else{socket['emit'](_0x47a5('0x87'),{'UserId':Number(_0x46647f[_0x47a5('0x30')][_0x47a5('0x58')]),'CmListId':Number(_0x46647f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2d6ae7,null))['catch'](handleError(_0x2d6ae7,null));};exports['getAgents']=function(_0x5075a6,_0x1ba5b6,_0x4f1315){var _0x1f26e9={};var _0x2287b0={};var _0x530e98;var _0x49da2a;return db['CmList'][_0x47a5('0x52')]({'where':{'id':_0x5075a6['params']['id']}})['then'](handleEntityNotFound(_0x1ba5b6,null))['then'](function(_0x45947c){if(_0x45947c){_0x530e98=_0x45947c;_0x2287b0[_0x47a5('0x2e')]=_[_0x47a5('0x2f')](db[_0x47a5('0x88')]['rawAttributes']);_0x2287b0[_0x47a5('0x30')]=_['keys'](_0x5075a6[_0x47a5('0x30')]);_0x2287b0['filters']=_[_0x47a5('0x31')](_0x2287b0[_0x47a5('0x2e')],_0x2287b0[_0x47a5('0x30')]);_0x1f26e9['attributes']=_[_0x47a5('0x31')](_0x2287b0[_0x47a5('0x2e')],qs[_0x47a5('0x32')](_0x5075a6[_0x47a5('0x30')]['fields']));_0x1f26e9[_0x47a5('0x33')]=_0x1f26e9[_0x47a5('0x33')][_0x47a5('0x43')]?_0x1f26e9[_0x47a5('0x33')]:_0x2287b0[_0x47a5('0x2e')];_0x1f26e9[_0x47a5('0x35')]=qs['sort'](_0x5075a6[_0x47a5('0x30')][_0x47a5('0x36')]);_0x1f26e9[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_[_0x47a5('0x39')](_0x5075a6[_0x47a5('0x30')],_0x2287b0[_0x47a5('0x38')]));if(_0x5075a6[_0x47a5('0x30')][_0x47a5('0x55')]){_0x1f26e9[_0x47a5('0x37')]=_[_0x47a5('0x3a')](_0x1f26e9[_0x47a5('0x37')],{'$or':_[_0x47a5('0x56')](_0x1f26e9[_0x47a5('0x33')],function(_0x29b926){var _0x3b4b08={};_0x3b4b08[_0x29b926]={'$like':'%'+_0x5075a6[_0x47a5('0x30')]['filter']+'%'};return _0x3b4b08;})});}_0x1f26e9=_[_0x47a5('0x3a')]({},_0x1f26e9,_0x5075a6['options']);return _0x530e98['getAgents'](_0x1f26e9);}})[_0x47a5('0x24')](function(_0x154365){if(_0x154365){_0x49da2a=_0x154365[_0x47a5('0x43')];if(!_0x5075a6['query'][_0x47a5('0x53')](_0x47a5('0x34'))){_0x1f26e9[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x5075a6[_0x47a5('0x30')][_0x47a5('0x1e')]);_0x1f26e9[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x5075a6[_0x47a5('0x30')][_0x47a5('0x1d')]);}return _0x530e98[_0x47a5('0x89')](_0x1f26e9);}})[_0x47a5('0x24')](function(_0x203bc9){if(_0x203bc9){return _0x203bc9?{'count':_0x49da2a,'rows':_0x203bc9}:null;}})['then'](respondWithResult(_0x1ba5b6,null))['catch'](handleError(_0x1ba5b6,null));}; \ No newline at end of file +var _0x90b1=['isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','list_%d_%s.csv','Content-type','text/csv','transaction','addCustomFields','Sequelize','TEXT','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','emit','removeAgents','userCmList:remove','User','nolimit','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','then','destroy','Lists','name','send','CmList','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','map','type','key','VIRTUAL','merge','options','count','include','findAll','show','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','getDispositions','findOne','Disposition','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','dataValues','errors','Malformed\x20request\x20syntax','CmCustomField','CustomFields','format','cf_%d','hasOwnProperty','raw','getContacts','getContactsCsv','concat'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90b1,0x1bb));var _0x190b=function(_0x9d9183,_0x4704df){_0x9d9183=_0x9d9183-0x0;var _0x3bec8e=_0x90b1[_0x9d9183];return _0x3bec8e;};'use strict';var pdf=require(_0x190b('0x0'));var emlformat=require(_0x190b('0x1'));var rimraf=require(_0x190b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x190b('0x3'));var moment=require(_0x190b('0x4'));var BPromise=require(_0x190b('0x5'));var Mustache=require(_0x190b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x190b('0x7'));var fs=require('fs');var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var hardwareService=require(_0x190b('0x12'));var logger=require(_0x190b('0x13'))(_0x190b('0x14'));var utils=require(_0x190b('0x15'));var config=require('../../config/environment');var db=require(_0x190b('0x16'))['db'];config[_0x190b('0x17')]=_['defaults'](config[_0x190b('0x17')],{'host':_0x190b('0x18'),'port':0x18eb});var socket=require(_0x190b('0x19'))(new Redis(config[_0x190b('0x17')]));require(_0x190b('0x1a'))[_0x190b('0x1b')](socket);function respondWithStatusCode(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xcc;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x1c')](_0x13544c);}return _0x2e12d4[_0x190b('0x1d')](_0x13544c)[_0x190b('0x1e')]();};}function respondWithResult(_0xab346,_0x3e8781){_0x3e8781=_0x3e8781||0xc8;return function(_0x3fbfc3){if(_0x3fbfc3){return _0xab346[_0x190b('0x1d')](_0x3e8781)[_0x190b('0x1f')](_0x3fbfc3);}};}function respondWithFilteredResult(_0x5c63d9,_0x428fec){return function(_0x5efbed){if(_0x5efbed){var _0x2a9323=_0x5efbed['count'],_0x21e458=_0x428fec[_0x190b('0x20')],_0x56d07a=_0x428fec[_0x190b('0x20')]+_0x428fec[_0x190b('0x21')],_0x16c009;if(_0x56d07a>=_0x2a9323){_0x56d07a=_0x2a9323;_0x16c009=0xc8;}else{_0x16c009=0xce;}_0x5c63d9[_0x190b('0x1d')](_0x16c009);return _0x5c63d9[_0x190b('0x22')](_0x190b('0x23'),_0x21e458+'-'+_0x56d07a+'/'+_0x2a9323)['json'](_0x5efbed);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x24')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x25')]()[_0x190b('0x24')](function(){var _0x519a76=_0x3b8c74['get']({'plain':!![]});var _0x262a63=_0x190b('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x262a63,'resourceId':_0x519a76['id']}})[_0x190b('0x24')](function(){return _0x3b8c74;});})['then'](function(){_0x16e989[_0x190b('0x1d')](0xcc)[_0x190b('0x1e')]();});}};}function handleEntityNotFound(_0x51f8b4,_0x3e7a10){return function(_0x1deea6){if(!_0x1deea6){_0x51f8b4['sendStatus'](0x194);}return _0x1deea6;};}function handleError(_0xa9d6f7,_0x2c47ae){_0x2c47ae=_0x2c47ae||0x1f4;return function(_0x359b4a){logger['error'](_0x359b4a['stack']);if(_0x359b4a[_0x190b('0x27')]){delete _0x359b4a['name'];}_0xa9d6f7[_0x190b('0x1d')](_0x2c47ae)[_0x190b('0x28')](_0x359b4a);};}exports['index']=function(_0x29775f,_0x580b92){var _0x40d060={},_0x4ff5a6={},_0x19600d={'count':0x0,'rows':[]};var _0x5650e1=db[_0x190b('0x29')][_0x190b('0x2a')];_0x4ff5a6['model']=_[_0x190b('0x2b')](_0x5650e1);_0x4ff5a6[_0x190b('0x2c')]=_[_0x190b('0x2b')](_0x29775f[_0x190b('0x2c')]);_0x4ff5a6[_0x190b('0x2d')]=_[_0x190b('0x2e')](_0x4ff5a6[_0x190b('0x2f')],_0x4ff5a6[_0x190b('0x2c')]);_0x40d060['attributes']=_['intersection'](_0x4ff5a6[_0x190b('0x2f')],qs[_0x190b('0x30')](_0x29775f['query'][_0x190b('0x30')]));_0x40d060[_0x190b('0x31')]=_0x40d060[_0x190b('0x31')][_0x190b('0x32')]?_0x40d060[_0x190b('0x31')]:_0x4ff5a6[_0x190b('0x2f')];if(!_0x29775f[_0x190b('0x2c')]['hasOwnProperty']('nolimit')){_0x40d060[_0x190b('0x21')]=qs[_0x190b('0x21')](_0x29775f[_0x190b('0x2c')]['limit']);_0x40d060[_0x190b('0x20')]=qs[_0x190b('0x20')](_0x29775f[_0x190b('0x2c')]['offset']);}_0x40d060[_0x190b('0x33')]=qs['sort'](_0x29775f['query'][_0x190b('0x34')]);_0x40d060[_0x190b('0x35')]=qs['filters'](_[_0x190b('0x36')](_0x29775f[_0x190b('0x2c')],_0x4ff5a6[_0x190b('0x2d')]));if(_0x29775f['query'][_0x190b('0x37')]){_0x40d060[_0x190b('0x35')]=_['merge'](_0x40d060['where'],{'$or':_[_0x190b('0x38')](_0x5650e1,function(_0x4ab72d){if(_0x4ab72d[_0x190b('0x39')][_0x190b('0x3a')]!==_0x190b('0x3b')){var _0xad955a={};_0xad955a[_0x4ab72d['field']]={'$like':'%'+_0x29775f[_0x190b('0x2c')]['filter']+'%'};return _0xad955a;}})});}_0x40d060=_[_0x190b('0x3c')]({},_0x40d060,_0x29775f[_0x190b('0x3d')]);var _0x47c488={'where':_0x40d060[_0x190b('0x35')]};return db[_0x190b('0x29')][_0x190b('0x3e')](_0x47c488)['then'](function(_0x2c7c0e){_0x19600d['count']=_0x2c7c0e;if(_0x29775f['query']['includeAll']){_0x40d060[_0x190b('0x3f')]=[{'all':!![]}];}return db[_0x190b('0x29')][_0x190b('0x40')](_0x40d060);})[_0x190b('0x24')](function(_0x48b2fa){_0x19600d['rows']=_0x48b2fa;return _0x19600d;})[_0x190b('0x24')](respondWithFilteredResult(_0x580b92,_0x40d060))['catch'](handleError(_0x580b92,null));};exports[_0x190b('0x41')]=function(_0x3d67f0,_0x497c5e){var _0x2e25e3={'raw':![],'where':{'id':_0x3d67f0[_0x190b('0x42')]['id']}},_0x36db47={};_0x36db47['model']=_[_0x190b('0x2b')](db[_0x190b('0x29')]['rawAttributes']);_0x36db47[_0x190b('0x2c')]=_['keys'](_0x3d67f0[_0x190b('0x2c')]);_0x36db47[_0x190b('0x2d')]=_[_0x190b('0x2e')](_0x36db47['model'],_0x36db47[_0x190b('0x2c')]);_0x2e25e3['attributes']=_[_0x190b('0x2e')](_0x36db47[_0x190b('0x2f')],qs[_0x190b('0x30')](_0x3d67f0[_0x190b('0x2c')][_0x190b('0x30')]));_0x2e25e3[_0x190b('0x31')]=_0x2e25e3[_0x190b('0x31')]['length']?_0x2e25e3[_0x190b('0x31')]:_0x36db47[_0x190b('0x2f')];if(_0x3d67f0[_0x190b('0x2c')]['includeAll']){_0x2e25e3[_0x190b('0x3f')]=[{'all':!![]}];}_0x2e25e3=_[_0x190b('0x3c')]({},_0x2e25e3,_0x3d67f0[_0x190b('0x3d')]);return db[_0x190b('0x29')][_0x190b('0x43')](_0x2e25e3)['then'](handleEntityNotFound(_0x497c5e,null))[_0x190b('0x24')](respondWithResult(_0x497c5e,null))[_0x190b('0x44')](handleError(_0x497c5e,null));};exports[_0x190b('0x45')]=function(_0x50db2b,_0x129a53){return db[_0x190b('0x29')][_0x190b('0x45')](_0x50db2b['body'],{})['then'](function(_0x14958e){var _0x4597e9=_0x50db2b[_0x190b('0x46')][_0x190b('0x47')]({'plain':!![]});if(!_0x4597e9)throw new Error(_0x190b('0x48'));if(_0x4597e9[_0x190b('0x49')]==='user'){var _0x8c0c1d=_0x14958e[_0x190b('0x47')]({'plain':!![]});var _0x30b23b='Lists';return db[_0x190b('0x4a')][_0x190b('0x43')]({'where':{'name':_0x30b23b,'userProfileId':_0x4597e9[_0x190b('0x4b')]},'raw':!![]})['then'](function(_0xbc6757){if(_0xbc6757&&_0xbc6757[_0x190b('0x4c')]===0x0){return db[_0x190b('0x4d')][_0x190b('0x45')]({'name':_0x8c0c1d[_0x190b('0x27')],'resourceId':_0x8c0c1d['id'],'type':_0xbc6757[_0x190b('0x27')],'sectionId':_0xbc6757['id']},{})[_0x190b('0x24')](function(){return _0x14958e;});}else{return _0x14958e;}})[_0x190b('0x44')](function(_0x3a9087){logger[_0x190b('0x4e')](_0x190b('0x4f'),_0x3a9087);throw _0x3a9087;});}return _0x14958e;})['then'](respondWithResult(_0x129a53,0xc9))[_0x190b('0x44')](handleError(_0x129a53,null));};exports['update']=function(_0x1141c6,_0x18f361){if(_0x1141c6['body']['id']){delete _0x1141c6[_0x190b('0x50')]['id'];}return db[_0x190b('0x29')][_0x190b('0x43')]({'where':{'id':_0x1141c6[_0x190b('0x42')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x18f361,null))[_0x190b('0x24')](saveUpdates(_0x1141c6[_0x190b('0x50')],null))[_0x190b('0x24')](respondWithResult(_0x18f361,null))['catch'](handleError(_0x18f361,null));};exports[_0x190b('0x25')]=function(_0x260adb,_0x300730){return db['CmList'][_0x190b('0x43')]({'where':{'id':_0x260adb['params']['id']}})['then'](handleEntityNotFound(_0x300730,null))[_0x190b('0x24')](removeEntity(_0x300730,null))[_0x190b('0x44')](handleError(_0x300730,null));};exports[_0x190b('0x51')]=function(_0x150312,_0x38e63f){return db[_0x190b('0x29')][_0x190b('0x51')]()[_0x190b('0x24')](respondWithResult(_0x38e63f,null))[_0x190b('0x44')](handleError(_0x38e63f,null));};exports[_0x190b('0x52')]=function(_0x39a630,_0x149902,_0x2f8775){if(_0x39a630[_0x190b('0x50')]['id']){delete _0x39a630['body']['id'];}return db[_0x190b('0x29')][_0x190b('0x43')]({'where':{'id':_0x39a630[_0x190b('0x42')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x149902,null))['then'](function(_0x50f9f7){if(_0x50f9f7){_0x39a630[_0x190b('0x50')][_0x190b('0x53')]=_0x50f9f7['id'];return db['Disposition'][_0x190b('0x45')](_0x39a630['body']);}})[_0x190b('0x24')](respondWithResult(_0x149902,null))[_0x190b('0x44')](handleError(_0x149902,null));};exports[_0x190b('0x54')]=function(_0x4d2814,_0x362e9f,_0x270b59){var _0xffe7cb={'raw':![],'where':{}};var _0x405e04={};var _0x135fbe={'count':0x0,'rows':[]};return db[_0x190b('0x29')][_0x190b('0x55')]({'where':{'id':_0x4d2814[_0x190b('0x42')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x362e9f,null))['then'](function(_0x4b44f7){if(_0x4b44f7){_0x405e04[_0x190b('0x2f')]=_[_0x190b('0x2b')](db[_0x190b('0x56')][_0x190b('0x2a')]);_0x405e04['query']=_[_0x190b('0x2b')](_0x4d2814[_0x190b('0x2c')]);_0x405e04['filters']=_[_0x190b('0x2e')](_0x405e04[_0x190b('0x2f')],_0x405e04[_0x190b('0x2c')]);_0xffe7cb[_0x190b('0x31')]=_[_0x190b('0x2e')](_0x405e04[_0x190b('0x2f')],qs[_0x190b('0x30')](_0x4d2814[_0x190b('0x2c')]['fields']));_0xffe7cb[_0x190b('0x31')]=_0xffe7cb['attributes']['length']?_0xffe7cb[_0x190b('0x31')]:_0x405e04[_0x190b('0x2f')];if(!_0x4d2814[_0x190b('0x2c')]['hasOwnProperty']('nolimit')){_0xffe7cb[_0x190b('0x21')]=qs[_0x190b('0x21')](_0x4d2814[_0x190b('0x2c')][_0x190b('0x21')]);_0xffe7cb[_0x190b('0x20')]=qs[_0x190b('0x20')](_0x4d2814[_0x190b('0x2c')][_0x190b('0x20')]);}_0xffe7cb['order']=qs[_0x190b('0x34')](_0x4d2814[_0x190b('0x2c')][_0x190b('0x34')]);_0xffe7cb[_0x190b('0x35')]=qs[_0x190b('0x2d')](_['pick'](_0x4d2814[_0x190b('0x2c')],_0x405e04[_0x190b('0x2d')]));_0xffe7cb[_0x190b('0x35')]['ListId']=_0x4b44f7['id'];if(_0x4d2814[_0x190b('0x2c')][_0x190b('0x37')]){_0xffe7cb[_0x190b('0x35')]=_[_0x190b('0x3c')](_0xffe7cb['where'],{'$or':_[_0x190b('0x38')](_0xffe7cb[_0x190b('0x31')],function(_0x2bf55e){var _0x2f97ef={};_0x2f97ef[_0x2bf55e]={'$like':'%'+_0x4d2814['query'][_0x190b('0x37')]+'%'};return _0x2f97ef;})});}_0xffe7cb=_['merge']({},_0xffe7cb,_0x4d2814[_0x190b('0x3d')]);return db[_0x190b('0x56')][_0x190b('0x3e')]({'where':_0xffe7cb[_0x190b('0x35')]})['then'](function(_0x2a36b3){_0x135fbe['count']=_0x2a36b3;if(_0x4d2814[_0x190b('0x2c')]['includeAll']){_0xffe7cb['include']=[{'all':!![]}];}return db[_0x190b('0x56')]['findAll'](_0xffe7cb);})[_0x190b('0x24')](function(_0x76f768){_0x135fbe[_0x190b('0x57')]=_0x76f768;return _0x135fbe;});}})[_0x190b('0x24')](respondWithFilteredResult(_0x362e9f,_0xffe7cb))[_0x190b('0x44')](handleError(_0x362e9f,null));};exports['removeDispositions']=function(_0x2f9922,_0xa26f18,_0xdafef7){return db['CmList'][_0x190b('0x43')]({'where':{'id':_0x2f9922[_0x190b('0x42')]['id']}})['then'](handleEntityNotFound(_0xa26f18,null))[_0x190b('0x24')](function(_0x164820){if(_0x164820){return _0x164820[_0x190b('0x58')](_0x2f9922['query'][_0x190b('0x59')]);}})[_0x190b('0x24')](respondWithStatusCode(_0xa26f18,null))[_0x190b('0x44')](handleError(_0xa26f18,null));};exports[_0x190b('0x5a')]=function(_0x5e8c28,_0x1252be,_0x3aa830){return db[_0x190b('0x29')]['find']({'where':{'id':_0x5e8c28[_0x190b('0x42')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x1252be,null))[_0x190b('0x24')](function(_0x49bd3b){if(_0x49bd3b){var _0x1a5d4c=[];var _0x28038e={'success':[],'errors':[]};return db[_0x190b('0x5b')][_0x190b('0x51')]()[_0x190b('0x24')](function(_0x5d67c1){if(_0x5e8c28['body'][_0x190b('0x5c')]&&_[_0x190b('0x5d')](_0x5e8c28['body'][_0x190b('0x5c')])){if(_0x5e8c28[_0x190b('0x50')]['tags']['length']){_0x5e8c28[_0x190b('0x50')][_0x190b('0x5c')]=_0x5e8c28['body']['tags'][_0x190b('0x5e')](';')+';';}else{_0x5e8c28[_0x190b('0x50')][_0x190b('0x5c')]=null;}}else{_0x5e8c28[_0x190b('0x50')][_0x190b('0x5c')]=null;}if(_0x5e8c28['body']&&_['isArray'](_0x5e8c28[_0x190b('0x50')])){for(var _0x4813ee=0x0;_0x4813ee<_0x5e8c28[_0x190b('0x50')][_0x190b('0x32')];_0x4813ee+=0x1){_0x5e8c28[_0x190b('0x50')][_0x4813ee][_0x190b('0x53')]=_0x5e8c28[_0x190b('0x42')]['id'];_0x1a5d4c[_0x190b('0x5f')](_0x5e8c28[_0x190b('0x50')][_0x4813ee]);}return BPromise[_0x190b('0x60')](_0x1a5d4c,function(_0x3f78bc){return db[_0x190b('0x5b')][_0x190b('0x45')](_['omit'](_0x3f78bc,[_0x190b('0x59'),'id'])||{},{'fields':_[_0x190b('0x2b')](_0x5d67c1),'raw':!![]})[_0x190b('0x24')](function(_0x517e9c){_0x28038e['success'][_0x190b('0x5f')](_0x517e9c[_0x190b('0x61')]);})['catch'](function(_0x40ac95){_0x28038e[_0x190b('0x62')][_0x190b('0x5f')]({'data':_0x3f78bc,'error':_0x40ac95['message']});});})[_0x190b('0x24')](function(_0x38b615){return _0x28038e;})['catch'](function(_0x23298e){return _0x23298e;});}else{_0x1252be[_0x190b('0x1d')](0x190)['json']({'message':_0x190b('0x63')});}});}})['then'](respondWithResult(_0x1252be,null))['catch'](handleError(_0x1252be,null));};exports['getContacts']=function(_0x55e228,_0x1da32e,_0x457ebe){var _0x509965;return db[_0x190b('0x29')][_0x190b('0x43')]({'where':{'id':_0x55e228['params']['id']},'include':[{'model':db[_0x190b('0x64')],'as':_0x190b('0x65')}]})[_0x190b('0x24')](handleEntityNotFound(_0x1da32e,null))[_0x190b('0x24')](function(_0x74036e){if(_0x74036e){_0x509965=_0x74036e;return db[_0x190b('0x5b')][_0x190b('0x2a')];}})[_0x190b('0x24')](function(_0xc3610b){if(_0xc3610b){var _0x55eab0={};var _0x19ec6c={};_0x19ec6c['model']=_['concat'](_[_0x190b('0x2b')](_0xc3610b),_[_0x190b('0x38')](_0x509965[_0x190b('0x65')],function(_0x42169f){return util[_0x190b('0x66')](_0x190b('0x67'),_0x42169f['id']);}));_0x19ec6c[_0x190b('0x2c')]=_[_0x190b('0x2b')](_0x55e228[_0x190b('0x2c')]);_0x19ec6c[_0x190b('0x2d')]=_[_0x190b('0x2e')](_0x19ec6c[_0x190b('0x2f')],_0x19ec6c['query']);_0x55eab0[_0x190b('0x31')]=_[_0x190b('0x2e')](_0x19ec6c[_0x190b('0x2f')],qs[_0x190b('0x30')](_0x55e228[_0x190b('0x2c')][_0x190b('0x30')]));_0x55eab0[_0x190b('0x31')]=_0x55eab0[_0x190b('0x31')][_0x190b('0x32')]?_0x55eab0['attributes']:_0x19ec6c[_0x190b('0x2f')];if(!_0x55e228[_0x190b('0x2c')][_0x190b('0x68')]('nolimit')){_0x55eab0[_0x190b('0x21')]=qs[_0x190b('0x21')](_0x55e228['query']['limit']);_0x55eab0[_0x190b('0x20')]=qs[_0x190b('0x20')](_0x55e228[_0x190b('0x2c')][_0x190b('0x20')]);}_0x55eab0[_0x190b('0x33')]=qs[_0x190b('0x34')](_0x55e228[_0x190b('0x2c')][_0x190b('0x34')]);_0x55eab0[_0x190b('0x35')]=qs[_0x190b('0x2d')](_['pick'](_0x55e228[_0x190b('0x2c')],_0x19ec6c[_0x190b('0x2d')]));_0x55eab0[_0x190b('0x69')]=!![];if(_0x55e228['query'][_0x190b('0x37')]){_0x55eab0[_0x190b('0x35')]=_[_0x190b('0x3c')](_0x55eab0[_0x190b('0x35')],{'$or':_[_0x190b('0x38')](_0x55eab0[_0x190b('0x31')],function(_0x5eefe2){var _0x476c86={};_0x476c86[_0x5eefe2]={'$like':'%'+_0x55e228[_0x190b('0x2c')]['filter']+'%'};return _0x476c86;})});}_0x55eab0=_[_0x190b('0x3c')]({},_0x55eab0,_0x55e228[_0x190b('0x3d')]);return _0x509965[_0x190b('0x6a')](_0x55eab0);}})[_0x190b('0x24')](respondWithResult(_0x1da32e,null))[_0x190b('0x44')](handleError(_0x1da32e,null));};exports[_0x190b('0x6b')]=function(_0x3abe8f,_0x3ef868,_0x56f872){var _0x33c4da;return db[_0x190b('0x29')][_0x190b('0x43')]({'where':{'id':_0x3abe8f[_0x190b('0x42')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x190b('0x65')}]})[_0x190b('0x24')](handleEntityNotFound(_0x3ef868,null))['then'](function(_0x2d3bea){if(_0x2d3bea){_0x33c4da=_0x2d3bea;return db[_0x190b('0x5b')][_0x190b('0x2a')];}})[_0x190b('0x24')](function(_0x3835d7){if(_0x3835d7){var _0x256cb7={};var _0x30d48e={};_0x30d48e['model']=_[_0x190b('0x6c')](_[_0x190b('0x2b')](_0x3835d7),_[_0x190b('0x38')](_0x33c4da['CustomFields'],function(_0x29974f){return util['format'](_0x190b('0x67'),_0x29974f['id']);}));_0x30d48e[_0x190b('0x2c')]=_[_0x190b('0x2b')](_0x3abe8f[_0x190b('0x2c')]);_0x30d48e[_0x190b('0x2d')]=_[_0x190b('0x2e')](_0x30d48e[_0x190b('0x2f')],_0x30d48e['query']);_0x256cb7[_0x190b('0x31')]=_['intersection'](_0x30d48e['model'],qs['fields'](_0x3abe8f[_0x190b('0x2c')][_0x190b('0x30')]));_0x256cb7['attributes']=_0x256cb7[_0x190b('0x31')][_0x190b('0x32')]?_0x256cb7[_0x190b('0x31')]:_0x30d48e[_0x190b('0x2f')];if(!_0x3abe8f[_0x190b('0x2c')]['hasOwnProperty']('nolimit')){_0x256cb7['limit']=qs[_0x190b('0x21')](_0x3abe8f[_0x190b('0x2c')][_0x190b('0x21')]);_0x256cb7['offset']=qs[_0x190b('0x20')](_0x3abe8f[_0x190b('0x2c')][_0x190b('0x20')]);}_0x256cb7[_0x190b('0x33')]=qs[_0x190b('0x34')](_0x3abe8f['query'][_0x190b('0x34')]);_0x256cb7['where']=qs[_0x190b('0x2d')](_[_0x190b('0x36')](_0x3abe8f[_0x190b('0x2c')],_0x30d48e['filters']));_0x256cb7['raw']=!![];if(_0x3abe8f[_0x190b('0x2c')]['filter']){_0x256cb7[_0x190b('0x35')]=_[_0x190b('0x3c')](_0x256cb7[_0x190b('0x35')],{'$or':_[_0x190b('0x38')](_0x256cb7[_0x190b('0x31')],function(_0x3b6792){var _0x3e5b34={};_0x3e5b34[_0x3b6792]={'$like':'%'+_0x3abe8f[_0x190b('0x2c')][_0x190b('0x37')]+'%'};return _0x3e5b34;})});}_0x256cb7=_[_0x190b('0x3c')]({},_0x256cb7,_0x3abe8f[_0x190b('0x3d')]);return _0x33c4da[_0x190b('0x6a')](_0x256cb7);}})[_0x190b('0x24')](function(_0x1fdf64){if(!_[_0x190b('0x6d')](_0x1fdf64)){var _0x5aa196=toCsv(_0x1fdf64);var _0x583814=Date[_0x190b('0x6e')]();fs[_0x190b('0x6f')](util['format'](_0x190b('0x70'),_0x33c4da['id'],_0x583814),_0x5aa196);_0x3ef868[_0x190b('0x71')]('Content-disposition','attachment;\x20filename='+util['format'](_0x190b('0x72'),_0x33c4da['id'],_0x583814));_0x3ef868[_0x190b('0x71')](_0x190b('0x73'),_0x190b('0x74'));return _0x3ef868['download'](util[_0x190b('0x66')](_0x190b('0x70'),_0x33c4da['id'],_0x583814));}else{return _0x3ef868[_0x190b('0x1c')](0xcc);}})[_0x190b('0x44')](handleError(_0x3ef868,null));};exports['addCustomField']=function(_0xf22ff7,_0x3ab704,_0x1171f3){var _0x44f13a;delete _0xf22ff7['body']['id'];return db['CmList'][_0x190b('0x55')]({'where':{'id':_0xf22ff7[_0x190b('0x42')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x3ab704,null))[_0x190b('0x24')](function(_0x741024){if(_0x741024){return db['sequelize'][_0x190b('0x75')](function(_0x3eff7f){return db[_0x190b('0x64')][_0x190b('0x45')](_0xf22ff7['body'],{'transaction':_0x3eff7f})['then'](function(_0x50e90c){_0x44f13a=_0x50e90c;return _0x741024[_0x190b('0x76')](_0x50e90c,{'transaction':_0x3eff7f});})['then'](function(){var _0x419d67={'type':db[_0x190b('0x77')][_0x190b('0x78')],'transaction':_0x3eff7f};switch(_0xf22ff7['body'][_0x190b('0x39')]){case'text':_0x419d67[_0x190b('0x39')]=db[_0x190b('0x77')][_0x190b('0x78')];break;case'number':_0x419d67['type']=db[_0x190b('0x77')][_0x190b('0x79')];break;case _0x190b('0x7a'):_0x419d67[_0x190b('0x39')]=db['Sequelize'][_0x190b('0x7b')];_0x419d67[_0x190b('0x7c')]=![];break;default:}return db[_0x190b('0x7d')][_0x190b('0x7e')][_0x190b('0x7f')]('cm_contacts',util['format'](_0x190b('0x80'),_0x44f13a['id']),_0x419d67);})[_0x190b('0x24')](function(){return _0x44f13a;});});}})[_0x190b('0x24')](respondWithResult(_0x3ab704,null))[_0x190b('0x44')](handleError(_0x3ab704,null));};exports[_0x190b('0x81')]=function(_0x3a5a7c,_0x2538f0,_0x4eeff4){var _0x4df93d={};var _0x1b2301={};var _0x2a1399;var _0x3ad1bb;return db[_0x190b('0x29')][_0x190b('0x55')]({'where':{'id':_0x3a5a7c[_0x190b('0x42')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x2538f0,null))[_0x190b('0x24')](function(_0x417e1e){if(_0x417e1e){_0x2a1399=_0x417e1e;_0x1b2301[_0x190b('0x2f')]=_[_0x190b('0x2b')](db[_0x190b('0x64')][_0x190b('0x2a')]);_0x1b2301[_0x190b('0x2c')]=_['keys'](_0x3a5a7c['query']);_0x1b2301[_0x190b('0x2d')]=_[_0x190b('0x2e')](_0x1b2301[_0x190b('0x2f')],_0x1b2301[_0x190b('0x2c')]);_0x4df93d[_0x190b('0x31')]=_[_0x190b('0x2e')](_0x1b2301[_0x190b('0x2f')],qs[_0x190b('0x30')](_0x3a5a7c[_0x190b('0x2c')][_0x190b('0x30')]));_0x4df93d['attributes']=_0x4df93d[_0x190b('0x31')][_0x190b('0x32')]?_0x4df93d['attributes']:_0x1b2301[_0x190b('0x2f')];_0x4df93d['order']=qs['sort'](_0x3a5a7c[_0x190b('0x2c')][_0x190b('0x34')]);_0x4df93d[_0x190b('0x35')]=qs[_0x190b('0x2d')](_[_0x190b('0x36')](_0x3a5a7c['query'],_0x1b2301[_0x190b('0x2d')]));_0x4df93d[_0x190b('0x35')]=_[_0x190b('0x3c')](_0x4df93d['where'],{'$or':[{'ListId':_0x417e1e['id']},{'ListId':null}]});if(_0x3a5a7c[_0x190b('0x2c')][_0x190b('0x37')]){_0x4df93d[_0x190b('0x35')]=_['merge'](_0x4df93d[_0x190b('0x35')],{'$or':_[_0x190b('0x38')](_0x4df93d[_0x190b('0x31')],function(_0x11929e){var _0x443af0={};_0x443af0[_0x11929e]={'$like':'%'+_0x3a5a7c[_0x190b('0x2c')][_0x190b('0x37')]+'%'};return _0x443af0;})});}_0x4df93d=_['merge']({},_0x4df93d,_0x3a5a7c['options']);return db[_0x190b('0x64')][_0x190b('0x82')](_0x4df93d);}})[_0x190b('0x24')](respondWithResult(_0x2538f0,null))[_0x190b('0x44')](handleError(_0x2538f0,null));};exports[_0x190b('0x83')]=function(_0x19c2a3,_0x1786d3,_0xa06794){return db['CmList'][_0x190b('0x43')]({'where':{'id':_0x19c2a3[_0x190b('0x42')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x1786d3,null))[_0x190b('0x24')](function(_0x6a8c46){if(_0x6a8c46){return _0x6a8c46[_0x190b('0x83')](_0x19c2a3['body']['ids'],_[_0x190b('0x84')](_0x19c2a3[_0x190b('0x50')],[_0x190b('0x59'),'id'])||{})['spread'](function(_0x160ee7){for(var _0x1b27de=0x0;_0x1b27de<_0x19c2a3[_0x190b('0x50')]['ids'][_0x190b('0x32')];_0x1b27de+=0x1){socket[_0x190b('0x85')]('userCmList:save',{'UserId':_0x19c2a3[_0x190b('0x50')][_0x190b('0x59')][_0x1b27de],'CmListId':_0x19c2a3[_0x190b('0x42')]['id']});}return _0x160ee7;});}})[_0x190b('0x24')](respondWithResult(_0x1786d3,null))[_0x190b('0x44')](handleError(_0x1786d3,null));};exports[_0x190b('0x86')]=function(_0x1b7399,_0x1187bb,_0xafe6fe){return db[_0x190b('0x29')]['find']({'where':{'id':_0x1b7399[_0x190b('0x42')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x1187bb,null))[_0x190b('0x24')](function(_0x30a546){if(_0x30a546){return _0x30a546[_0x190b('0x86')](_0x1b7399[_0x190b('0x2c')][_0x190b('0x59')])[_0x190b('0x24')](function(){if(_[_0x190b('0x5d')](_0x1b7399['query']['ids'])){for(var _0x31c261=0x0;_0x31c261<_0x1b7399[_0x190b('0x2c')]['ids']['length'];_0x31c261+=0x1){socket[_0x190b('0x85')](_0x190b('0x87'),{'UserId':Number(_0x1b7399[_0x190b('0x2c')][_0x190b('0x59')][_0x31c261]),'CmListId':Number(_0x1b7399[_0x190b('0x42')]['id'])});}}else{socket[_0x190b('0x85')](_0x190b('0x87'),{'UserId':Number(_0x1b7399[_0x190b('0x2c')][_0x190b('0x59')]),'CmListId':Number(_0x1b7399[_0x190b('0x42')]['id'])});}});}})[_0x190b('0x24')](respondWithStatusCode(_0x1187bb,null))['catch'](handleError(_0x1187bb,null));};exports['getAgents']=function(_0x515ef6,_0x19503f,_0x38746c){var _0x4e0d11={};var _0x334951={};var _0x533e78;var _0x184392;return db[_0x190b('0x29')][_0x190b('0x55')]({'where':{'id':_0x515ef6[_0x190b('0x42')]['id']}})['then'](handleEntityNotFound(_0x19503f,null))[_0x190b('0x24')](function(_0x547673){if(_0x547673){_0x533e78=_0x547673;_0x334951[_0x190b('0x2f')]=_['keys'](db[_0x190b('0x88')][_0x190b('0x2a')]);_0x334951[_0x190b('0x2c')]=_['keys'](_0x515ef6[_0x190b('0x2c')]);_0x334951[_0x190b('0x2d')]=_['intersection'](_0x334951[_0x190b('0x2f')],_0x334951['query']);_0x4e0d11[_0x190b('0x31')]=_[_0x190b('0x2e')](_0x334951[_0x190b('0x2f')],qs[_0x190b('0x30')](_0x515ef6[_0x190b('0x2c')][_0x190b('0x30')]));_0x4e0d11[_0x190b('0x31')]=_0x4e0d11[_0x190b('0x31')]['length']?_0x4e0d11[_0x190b('0x31')]:_0x334951[_0x190b('0x2f')];_0x4e0d11[_0x190b('0x33')]=qs[_0x190b('0x34')](_0x515ef6[_0x190b('0x2c')][_0x190b('0x34')]);_0x4e0d11[_0x190b('0x35')]=qs[_0x190b('0x2d')](_[_0x190b('0x36')](_0x515ef6[_0x190b('0x2c')],_0x334951[_0x190b('0x2d')]));if(_0x515ef6[_0x190b('0x2c')][_0x190b('0x37')]){_0x4e0d11[_0x190b('0x35')]=_[_0x190b('0x3c')](_0x4e0d11[_0x190b('0x35')],{'$or':_[_0x190b('0x38')](_0x4e0d11[_0x190b('0x31')],function(_0x2eb06c){var _0x3910b0={};_0x3910b0[_0x2eb06c]={'$like':'%'+_0x515ef6[_0x190b('0x2c')][_0x190b('0x37')]+'%'};return _0x3910b0;})});}_0x4e0d11=_['merge']({},_0x4e0d11,_0x515ef6[_0x190b('0x3d')]);return _0x533e78['getAgents'](_0x4e0d11);}})[_0x190b('0x24')](function(_0x115e9e){if(_0x115e9e){_0x184392=_0x115e9e[_0x190b('0x32')];if(!_0x515ef6[_0x190b('0x2c')][_0x190b('0x68')](_0x190b('0x89'))){_0x4e0d11[_0x190b('0x21')]=qs['limit'](_0x515ef6[_0x190b('0x2c')]['limit']);_0x4e0d11[_0x190b('0x20')]=qs['offset'](_0x515ef6[_0x190b('0x2c')][_0x190b('0x20')]);}return _0x533e78['getAgents'](_0x4e0d11);}})['then'](function(_0x17d900){if(_0x17d900){return _0x17d900?{'count':_0x184392,'rows':_0x17d900}:null;}})[_0x190b('0x24')](respondWithResult(_0x19503f,null))['catch'](handleError(_0x19503f,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 803cd05..76a0880 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x888f=['hook','exports','events','../../mysqldb','remove','emit','hasOwnProperty'];(function(_0x5c725c,_0x2106b5){var _0x59a1e2=function(_0x243882){while(--_0x243882){_0x5c725c['push'](_0x5c725c['shift']());}};_0x59a1e2(++_0x2106b5);}(_0x888f,0x175));var _0xf888=function(_0x261991,_0x1039c5){_0x261991=_0x261991-0x0;var _0x48023c=_0x888f[_0x261991];return _0x48023c;};'use strict';var EventEmitter=require(_0xf888('0x0'));var CmList=require(_0xf888('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf888('0x2')};function emitEvent(_0x22faee){return function(_0x41344a,_0x42832d,_0x3535da){CmListEvents[_0xf888('0x3')](_0x22faee+':'+_0x41344a['id'],_0x41344a);CmListEvents[_0xf888('0x3')](_0x22faee,_0x41344a);_0x3535da(null);};}for(var e in events){if(events[_0xf888('0x4')](e)){var event=events[e];CmList[_0xf888('0x5')](e,emitEvent(event));}}module[_0xf888('0x6')]=CmListEvents; \ No newline at end of file +var _0xa9a1=['../../mysqldb','CmList','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa9a1,0x1cc));var _0x1a9a=function(_0x7b6715,_0x429993){_0x7b6715=_0x7b6715-0x0;var _0x37f262=_0xa9a1[_0x7b6715];return _0x37f262;};'use strict';var EventEmitter=require('events');var CmList=require(_0x1a9a('0x0'))['db'][_0x1a9a('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x1a9a('0x2')](0x0);var events={'afterCreate':_0x1a9a('0x3'),'afterUpdate':_0x1a9a('0x4'),'afterDestroy':_0x1a9a('0x5')};function emitEvent(_0x950491){return function(_0xe27c63,_0x42e682,_0x588c67){CmListEvents[_0x1a9a('0x6')](_0x950491+':'+_0xe27c63['id'],_0xe27c63);CmListEvents[_0x1a9a('0x6')](_0x950491,_0xe27c63);_0x588c67(null);};}for(var e in events){if(events[_0x1a9a('0x7')](e)){var event=events[e];CmList[_0x1a9a('0x8')](e,emitEvent(event));}}module[_0x1a9a('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 88a16dd..6ef99d3 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb71=['path','rimraf','../../config/environment','./cmList.attributes','exports','lodash','util','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb71,0x1db));var _0x1db7=function(_0x4311a8,_0xc356ea){_0x4311a8=_0x4311a8-0x0;var _0x3a1773=_0xdb71[_0x4311a8];return _0x3a1773;};'use strict';var _=require(_0x1db7('0x0'));var util=require(_0x1db7('0x1'));var logger=require(_0x1db7('0x2'))(_0x1db7('0x3'));var moment=require(_0x1db7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1db7('0x5'));var rimraf=require(_0x1db7('0x6'));var config=require(_0x1db7('0x7'));var attributes=require(_0x1db7('0x8'));module[_0x1db7('0x9')]=function(_0x389be2,_0x5d801e){return _0x389be2['define']('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8fc=['rimraf','../../config/environment','define','CmList','cm_lists','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x236459,_0x2a0c79){var _0x5cab9a=function(_0x179a8c){while(--_0x179a8c){_0x236459['push'](_0x236459['shift']());}};_0x5cab9a(++_0x2a0c79);}(_0xd8fc,0x1b5));var _0xcd8f=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0xd8fc[_0x257b0e];return _0x27ac2a;};'use strict';var _=require(_0xcd8f('0x0'));var util=require(_0xcd8f('0x1'));var logger=require(_0xcd8f('0x2'))(_0xcd8f('0x3'));var moment=require(_0xcd8f('0x4'));var BPromise=require(_0xcd8f('0x5'));var rp=require(_0xcd8f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd8f('0x7'));var config=require(_0xcd8f('0x8'));var attributes=require('./cmList.attributes');module['exports']=function(_0x2a558c,_0x227ca5){return _0x2a558c[_0xcd8f('0x9')](_0xcd8f('0xa'),attributes,{'tableName':_0xcd8f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 72c7874..443d43a 100644 --- a/server/api/cmList/cmList.rpc.js +++ b/server/api/cmList/cmList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53ed=['request','then','info','CmList,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x53ed,0x11e));var _0xd53e=function(_0x16db18,_0x43fd3f){_0x16db18=_0x16db18-0x0;var _0x48cc3a=_0x53ed[_0x16db18];return _0x48cc3a;};'use strict';var _=require(_0xd53e('0x0'));var util=require(_0xd53e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd53e('0x2'));var fs=require('fs');var Redis=require(_0xd53e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd53e('0x4'))(_0xd53e('0x5'));var config=require(_0xd53e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd53e('0x7')][_0xd53e('0x8')]({'port':0x232a});config[_0xd53e('0x9')]=_[_0xd53e('0xa')](config[_0xd53e('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xd53e('0xb'))(new Redis(config[_0xd53e('0x9')]));require(_0xd53e('0xc'))[_0xd53e('0xd')](socket);function respondWithRpcPromise(_0x2a6791,_0x6e710c,_0x25feda){return new BPromise(function(_0x32155c,_0x26d937){return client[_0xd53e('0xe')](_0x2a6791,_0x25feda)[_0xd53e('0xf')](function(_0x3c11b5){logger[_0xd53e('0x10')](_0xd53e('0x11'),_0x6e710c,'request\x20sent');logger[_0xd53e('0x12')]('CmList,\x20%s,\x20%s,\x20%s',_0x6e710c,_0xd53e('0x13'),JSON[_0xd53e('0x14')](_0x3c11b5));if(_0x3c11b5[_0xd53e('0x15')]){if(_0x3c11b5[_0xd53e('0x15')]['code']===0x1f4){logger[_0xd53e('0x15')](_0xd53e('0x11'),_0x6e710c,_0x3c11b5[_0xd53e('0x15')][_0xd53e('0x16')]);return _0x26d937(_0x3c11b5[_0xd53e('0x15')][_0xd53e('0x16')]);}logger[_0xd53e('0x15')](_0xd53e('0x11'),_0x6e710c,_0x3c11b5[_0xd53e('0x15')][_0xd53e('0x16')]);return _0x32155c(_0x3c11b5['error'][_0xd53e('0x16')]);}else{logger[_0xd53e('0x10')](_0xd53e('0x11'),_0x6e710c,_0xd53e('0x13'));_0x32155c(_0x3c11b5[_0xd53e('0x17')][_0xd53e('0x16')]);}})[_0xd53e('0x18')](function(_0x3da0d7){logger[_0xd53e('0x15')]('CmList,\x20%s,\x20%s',_0x6e710c,_0x3da0d7);_0x26d937(_0x3da0d7);});});} \ No newline at end of file +var _0x0a7b=['request\x20sent','stringify','code','error','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','then','info','CmList,\x20%s,\x20%s'];(function(_0x1b2399,_0x52810a){var _0x4d15dd=function(_0x1399ef){while(--_0x1399ef){_0x1b2399['push'](_0x1b2399['shift']());}};_0x4d15dd(++_0x52810a);}(_0x0a7b,0x67));var _0xb0a7=function(_0x33c07c,_0xd4f855){_0x33c07c=_0x33c07c-0x0;var _0xccf08d=_0x0a7b[_0x33c07c];return _0xccf08d;};'use strict';var _=require('lodash');var util=require(_0xb0a7('0x0'));var moment=require(_0xb0a7('0x1'));var BPromise=require('bluebird');var rs=require(_0xb0a7('0x2'));var fs=require('fs');var Redis=require(_0xb0a7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb0a7('0x4'));var logger=require('../../config/logger')(_0xb0a7('0x5'));var config=require('../../config/environment');var jayson=require(_0xb0a7('0x6'));var client=jayson[_0xb0a7('0x7')]['http']({'port':0x232a});config[_0xb0a7('0x8')]=_[_0xb0a7('0x9')](config[_0xb0a7('0x8')],{'host':_0xb0a7('0xa'),'port':0x18eb});var socket=require(_0xb0a7('0xb'))(new Redis(config[_0xb0a7('0x8')]));require(_0xb0a7('0xc'))[_0xb0a7('0xd')](socket);function respondWithRpcPromise(_0x48284e,_0x41150f,_0x3eb872){return new BPromise(function(_0x340b55,_0x5dc5a1){return client['request'](_0x48284e,_0x3eb872)[_0xb0a7('0xe')](function(_0x46dbff){logger[_0xb0a7('0xf')](_0xb0a7('0x10'),_0x41150f,_0xb0a7('0x11'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x41150f,_0xb0a7('0x11'),JSON[_0xb0a7('0x12')](_0x46dbff));if(_0x46dbff['error']){if(_0x46dbff['error'][_0xb0a7('0x13')]===0x1f4){logger[_0xb0a7('0x14')](_0xb0a7('0x10'),_0x41150f,_0x46dbff[_0xb0a7('0x14')]['message']);return _0x5dc5a1(_0x46dbff[_0xb0a7('0x14')]['message']);}logger[_0xb0a7('0x14')](_0xb0a7('0x10'),_0x41150f,_0x46dbff[_0xb0a7('0x14')][_0xb0a7('0x15')]);return _0x340b55(_0x46dbff['error'][_0xb0a7('0x15')]);}else{logger['info'](_0xb0a7('0x10'),_0x41150f,_0xb0a7('0x11'));_0x340b55(_0x46dbff[_0xb0a7('0x16')][_0xb0a7('0x15')]);}})[_0xb0a7('0x17')](function(_0x21e104){logger[_0xb0a7('0x14')]('CmList,\x20%s,\x20%s',_0x41150f,_0x21e104);_0x5dc5a1(_0x21e104);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 058a8ec..832ae98 100644 --- a/server/api/cmList/cmList.socket.js +++ b/server/api/cmList/cmList.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5549=['emit','removeListener','length','cmList:','./cmList.events','save','remove','update'];(function(_0x551b28,_0x4897b4){var _0x17e6f3=function(_0x225e77){while(--_0x225e77){_0x551b28['push'](_0x551b28['shift']());}};_0x17e6f3(++_0x4897b4);}(_0x5549,0x1f4));var _0x9554=function(_0x427146,_0x14b4a6){_0x427146=_0x427146-0x0;var _0x126d64=_0x5549[_0x427146];return _0x126d64;};'use strict';var CmListEvents=require(_0x9554('0x0'));var events=[_0x9554('0x1'),_0x9554('0x2'),_0x9554('0x3')];function createListener(_0x153cf2,_0x53ff34){return function(_0x1a31f7){_0x53ff34[_0x9554('0x4')](_0x153cf2,_0x1a31f7);};}function removeListener(_0x244b13,_0x36fc55){return function(){CmListEvents[_0x9554('0x5')](_0x244b13,_0x36fc55);};}exports['register']=function(_0x3a0631){for(var _0x4e8442=0x0,_0x456914=events[_0x9554('0x6')];_0x4e8442<_0x456914;_0x4e8442++){var _0xac6b80=events[_0x4e8442];var _0x5afdf7=createListener(_0x9554('0x7')+_0xac6b80,_0x3a0631);CmListEvents['on'](_0xac6b80,_0x5afdf7);}}; \ No newline at end of file +var _0xce22=['removeListener','register','cmList:','./cmList.events','save','remove','update'];(function(_0x1f7865,_0x517786){var _0xab71c0=function(_0x3d3d71){while(--_0x3d3d71){_0x1f7865['push'](_0x1f7865['shift']());}};_0xab71c0(++_0x517786);}(_0xce22,0xea));var _0x2ce2=function(_0x5b8b72,_0x5940f5){_0x5b8b72=_0x5b8b72-0x0;var _0x539f5b=_0xce22[_0x5b8b72];return _0x539f5b;};'use strict';var CmListEvents=require(_0x2ce2('0x0'));var events=[_0x2ce2('0x1'),_0x2ce2('0x2'),_0x2ce2('0x3')];function createListener(_0x3a106f,_0x47de4a){return function(_0xd7b953){_0x47de4a['emit'](_0x3a106f,_0xd7b953);};}function removeListener(_0x26b273,_0x1801be){return function(){CmListEvents[_0x2ce2('0x4')](_0x26b273,_0x1801be);};}exports[_0x2ce2('0x5')]=function(_0x25110e){for(var _0x29f060=0x0,_0x6515b5=events['length'];_0x29f060<_0x6515b5;_0x29f060++){var _0x225737=events[_0x29f060];var _0x111f56=createListener(_0x2ce2('0x6')+_0x225737,_0x25110e);CmListEvents['on'](_0x225737,_0x111f56);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 9d071df..e560293 100644 --- a/server/api/cmList/index.js +++ b/server/api/cmList/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe406=['addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','/:id/users','getAgents','post','addDisposition','addContacts'];(function(_0xd3650c,_0x59afb8){var _0x88cd67=function(_0x2d4438){while(--_0x2d4438){_0xd3650c['push'](_0xd3650c['shift']());}};_0x88cd67(++_0x59afb8);}(_0xe406,0x75));var _0x6e40=function(_0x29a22a,_0x517b05){_0x29a22a=_0x29a22a-0x0;var _0x3486d2=_0xe406[_0x29a22a];return _0x3486d2;};'use strict';var multer=require(_0x6e40('0x0'));var util=require(_0x6e40('0x1'));var path=require(_0x6e40('0x2'));var timeout=require(_0x6e40('0x3'));var express=require('express');var router=express[_0x6e40('0x4')]();var auth=require(_0x6e40('0x5'));var interaction=require(_0x6e40('0x6'));var config=require(_0x6e40('0x7'));var controller=require(_0x6e40('0x8'));router[_0x6e40('0x9')]('/',auth['isAuthenticated'](),controller[_0x6e40('0xa')]);router['get'](_0x6e40('0xb'),auth[_0x6e40('0xc')](),controller[_0x6e40('0xd')]);router[_0x6e40('0x9')](_0x6e40('0xe'),auth[_0x6e40('0xc')](),controller[_0x6e40('0xf')]);router[_0x6e40('0x9')](_0x6e40('0x10'),auth[_0x6e40('0xc')](),controller[_0x6e40('0x11')]);router[_0x6e40('0x9')](_0x6e40('0x12'),auth[_0x6e40('0xc')](),controller[_0x6e40('0x13')]);router[_0x6e40('0x9')](_0x6e40('0x14'),auth[_0x6e40('0xc')](),controller['getContactsCsv']);router['get'](_0x6e40('0x15'),auth[_0x6e40('0xc')](),controller['getCustomFields']);router[_0x6e40('0x9')](_0x6e40('0x16'),auth[_0x6e40('0xc')](),controller[_0x6e40('0x17')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6e40('0x18')](_0x6e40('0x10'),auth[_0x6e40('0xc')](),controller[_0x6e40('0x19')]);router[_0x6e40('0x18')](_0x6e40('0x12'),auth[_0x6e40('0xc')](),controller[_0x6e40('0x1a')]);router[_0x6e40('0x18')]('/:id/fields',auth[_0x6e40('0xc')](),controller[_0x6e40('0x1b')]);router[_0x6e40('0x18')](_0x6e40('0x16'),auth[_0x6e40('0xc')](),controller[_0x6e40('0x1c')]);router[_0x6e40('0x1d')]('/:id',auth[_0x6e40('0xc')](),controller[_0x6e40('0x1e')]);router[_0x6e40('0x1f')](_0x6e40('0xe'),auth[_0x6e40('0xc')](),controller[_0x6e40('0x20')]);router[_0x6e40('0x1f')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x6e40('0x21')]);router[_0x6e40('0x1f')](_0x6e40('0x16'),auth[_0x6e40('0xc')](),controller[_0x6e40('0x22')]);module[_0x6e40('0x23')]=router; \ No newline at end of file +var _0x6c59=['get','isAuthenticated','index','describe','/:id','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller'];(function(_0x553145,_0x4f9ab8){var _0x11cfbd=function(_0x2e7702){while(--_0x2e7702){_0x553145['push'](_0x553145['shift']());}};_0x11cfbd(++_0x4f9ab8);}(_0x6c59,0x156));var _0x96c5=function(_0xef6b9d,_0x264d03){_0xef6b9d=_0xef6b9d-0x0;var _0x189f10=_0x6c59[_0xef6b9d];return _0x189f10;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x96c5('0x0'));var timeout=require(_0x96c5('0x1'));var express=require(_0x96c5('0x2'));var router=express[_0x96c5('0x3')]();var auth=require(_0x96c5('0x4'));var interaction=require(_0x96c5('0x5'));var config=require(_0x96c5('0x6'));var controller=require(_0x96c5('0x7'));router[_0x96c5('0x8')]('/',auth[_0x96c5('0x9')](),controller[_0x96c5('0xa')]);router['get']('/describe',auth[_0x96c5('0x9')](),controller[_0x96c5('0xb')]);router[_0x96c5('0x8')](_0x96c5('0xc'),auth[_0x96c5('0x9')](),controller['show']);router[_0x96c5('0x8')]('/:id/dispositions',auth[_0x96c5('0x9')](),controller[_0x96c5('0xd')]);router[_0x96c5('0x8')](_0x96c5('0xe'),auth[_0x96c5('0x9')](),controller[_0x96c5('0xf')]);router[_0x96c5('0x8')](_0x96c5('0x10'),auth[_0x96c5('0x9')](),controller[_0x96c5('0x11')]);router['get']('/:id/fields',auth[_0x96c5('0x9')](),controller[_0x96c5('0x12')]);router[_0x96c5('0x8')](_0x96c5('0x13'),auth[_0x96c5('0x9')](),controller[_0x96c5('0x14')]);router['post']('/',auth[_0x96c5('0x9')](),controller['create']);router[_0x96c5('0x15')](_0x96c5('0x16'),auth[_0x96c5('0x9')](),controller[_0x96c5('0x17')]);router[_0x96c5('0x15')](_0x96c5('0xe'),auth[_0x96c5('0x9')](),controller[_0x96c5('0x18')]);router[_0x96c5('0x15')](_0x96c5('0x19'),auth[_0x96c5('0x9')](),controller[_0x96c5('0x1a')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x96c5('0x1b')]);router[_0x96c5('0x1c')](_0x96c5('0xc'),auth[_0x96c5('0x9')](),controller[_0x96c5('0x1d')]);router[_0x96c5('0x1e')](_0x96c5('0xc'),auth['isAuthenticated'](),controller[_0x96c5('0x1f')]);router[_0x96c5('0x1e')](_0x96c5('0x16'),auth[_0x96c5('0x9')](),controller[_0x96c5('0x20')]);router[_0x96c5('0x1e')]('/:id/users',auth[_0x96c5('0x9')](),controller[_0x96c5('0x21')]);module[_0x96c5('0x22')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 0e679ec..61cc2de 100644 --- a/server/api/condition/condition.attributes.js +++ b/server/api/condition/condition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x176f34,_0x20f6be){var _0x312339=function(_0x52630a){while(--_0x52630a){_0x176f34['push'](_0x176f34['shift']());}};_0x312339(++_0x20f6be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x553c52,_0x1e7a18){var _0x512761=function(_0x4565a3){while(--_0x4565a3){_0x553c52['push'](_0x553c52['shift']());}};_0x512761(++_0x1e7a18);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index c6ac713..6c123b9 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7b5=['to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','count','offset','set','Content-Range','reject','save','then','end','name','update','body','params','catch','destroy','Condition','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x354bb4,_0x393b13){var _0x5708ec=function(_0x54aa70){while(--_0x54aa70){_0x354bb4['push'](_0x354bb4['shift']());}};_0x5708ec(++_0x393b13);}(_0xb7b5,0x75));var _0x5b7b=function(_0x5eac1a,_0x5c3668){_0x5eac1a=_0x5eac1a-0x0;var _0x32a5b2=_0xb7b5[_0x5eac1a];return _0x32a5b2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5b7b('0x0'));var rimraf=require(_0x5b7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b7b('0x2'));var rp=require(_0x5b7b('0x3'));var moment=require(_0x5b7b('0x4'));var BPromise=require(_0x5b7b('0x5'));var Mustache=require(_0x5b7b('0x6'));var util=require(_0x5b7b('0x7'));var path=require(_0x5b7b('0x8'));var sox=require('sox');var csv=require(_0x5b7b('0x9'));var ejs=require(_0x5b7b('0xa'));var fs=require('fs');var _=require(_0x5b7b('0xb'));var squel=require(_0x5b7b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5b7b('0xd'));var toCsv=require(_0x5b7b('0x9'));var querystring=require(_0x5b7b('0xe'));var Papa=require(_0x5b7b('0xf'));var Redis=require(_0x5b7b('0x10'));var authService=require(_0x5b7b('0x11'));var qs=require(_0x5b7b('0x12'));var hardwareService=require(_0x5b7b('0x13'));var logger=require(_0x5b7b('0x14'))(_0x5b7b('0x15'));var utils=require(_0x5b7b('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x726250,_0x5eedcc){_0x5eedcc=_0x5eedcc||0xcc;return function(_0x28bae3){if(_0x28bae3){return _0x726250[_0x5b7b('0x17')](_0x5eedcc);}return _0x726250[_0x5b7b('0x18')](_0x5eedcc)['end']();};}function respondWithResult(_0x1c0f22,_0xff071c){_0xff071c=_0xff071c||0xc8;return function(_0x298503){if(_0x298503){return _0x1c0f22[_0x5b7b('0x18')](_0xff071c)[_0x5b7b('0x19')](_0x298503);}};}function respondWithFilteredResult(_0x43bdd2,_0x1d82c0){return function(_0x26af3b){if(_0x26af3b){var _0x4b7575=_0x26af3b[_0x5b7b('0x1a')],_0x1d9072=_0x1d82c0[_0x5b7b('0x1b')],_0x1d1e46=_0x1d82c0[_0x5b7b('0x1b')]+_0x1d82c0['limit'],_0x2af4dc;if(_0x1d1e46>=_0x4b7575){_0x1d1e46=_0x4b7575;_0x2af4dc=0xc8;}else{_0x2af4dc=0xce;}_0x43bdd2['status'](_0x2af4dc);return _0x43bdd2[_0x5b7b('0x1c')](_0x5b7b('0x1d'),_0x1d9072+'-'+_0x1d1e46+'/'+_0x4b7575)[_0x5b7b('0x19')](_0x26af3b);}return null;};}function patchUpdates(_0x5b4318){return function(_0x37589f){try{jsonpatch['apply'](_0x37589f,_0x5b4318,!![]);}catch(_0x49000a){return BPromise[_0x5b7b('0x1e')](_0x49000a);}return _0x37589f[_0x5b7b('0x1f')]();};}function saveUpdates(_0x49d015,_0xaf8aac){return function(_0x12f8cd){if(_0x12f8cd){return _0x12f8cd['update'](_0x49d015)[_0x5b7b('0x20')](function(_0x5233b9){return _0x5233b9;});}return null;};}function removeEntity(_0x19df45,_0x1e5118){return function(_0x205388){if(_0x205388){return _0x205388['destroy']()[_0x5b7b('0x20')](function(){_0x19df45[_0x5b7b('0x18')](0xcc)[_0x5b7b('0x21')]();});}};}function handleEntityNotFound(_0x432223,_0x5a8fad){return function(_0x18c61c){if(!_0x18c61c){_0x432223[_0x5b7b('0x17')](0x194);}return _0x18c61c;};}function handleError(_0x3d4c1f,_0x571921){_0x571921=_0x571921||0x1f4;return function(_0x3cea02){logger['error'](_0x3cea02['stack']);if(_0x3cea02[_0x5b7b('0x22')]){delete _0x3cea02[_0x5b7b('0x22')];}_0x3d4c1f[_0x5b7b('0x18')](_0x571921)['send'](_0x3cea02);};}exports[_0x5b7b('0x23')]=function(_0x27070d,_0x37fd7b){if(_0x27070d[_0x5b7b('0x24')]['id']){delete _0x27070d[_0x5b7b('0x24')]['id'];}return db['Condition']['find']({'where':{'id':_0x27070d[_0x5b7b('0x25')]['id']}})['then'](handleEntityNotFound(_0x37fd7b,null))['then'](saveUpdates(_0x27070d[_0x5b7b('0x24')],null))[_0x5b7b('0x20')](respondWithResult(_0x37fd7b,null))[_0x5b7b('0x26')](handleError(_0x37fd7b,null));};exports[_0x5b7b('0x27')]=function(_0x49d8b7,_0x3544b4){return db[_0x5b7b('0x28')][_0x5b7b('0x29')]({'where':{'id':_0x49d8b7[_0x5b7b('0x25')]['id']}})[_0x5b7b('0x20')](handleEntityNotFound(_0x3544b4,null))['then'](removeEntity(_0x3544b4,null))['catch'](handleError(_0x3544b4,null));}; \ No newline at end of file +var _0x4d1b=['stack','name','send','update','body','Condition','find','params','catch','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','Content-Range','apply','save','destroy','then','sendStatus','error'];(function(_0x1a5fd2,_0x47e4ad){var _0x13c9e7=function(_0x5b67d6){while(--_0x5b67d6){_0x1a5fd2['push'](_0x1a5fd2['shift']());}};_0x13c9e7(++_0x47e4ad);}(_0x4d1b,0x128));var _0xb4d1=function(_0x4b2b03,_0xbf34ee){_0x4b2b03=_0x4b2b03-0x0;var _0x1bf0ed=_0x4d1b[_0x4b2b03];return _0x1bf0ed;};'use strict';var pdf=require(_0xb4d1('0x0'));var emlformat=require(_0xb4d1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb4d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb4d1('0x3'));var moment=require(_0xb4d1('0x4'));var BPromise=require(_0xb4d1('0x5'));var Mustache=require(_0xb4d1('0x6'));var util=require(_0xb4d1('0x7'));var path=require(_0xb4d1('0x8'));var sox=require('sox');var csv=require(_0xb4d1('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb4d1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb4d1('0xb'));var toCsv=require(_0xb4d1('0x9'));var querystring=require('querystring');var Papa=require(_0xb4d1('0xc'));var Redis=require('ioredis');var authService=require(_0xb4d1('0xd'));var qs=require(_0xb4d1('0xe'));var hardwareService=require(_0xb4d1('0xf'));var logger=require(_0xb4d1('0x10'))(_0xb4d1('0x11'));var utils=require('../../config/utils');var config=require(_0xb4d1('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43a46d,_0x170cde){_0x170cde=_0x170cde||0xcc;return function(_0x54f0dc){if(_0x54f0dc){return _0x43a46d['sendStatus'](_0x170cde);}return _0x43a46d[_0xb4d1('0x13')](_0x170cde)[_0xb4d1('0x14')]();};}function respondWithResult(_0x1f39e2,_0x11229b){_0x11229b=_0x11229b||0xc8;return function(_0x590e46){if(_0x590e46){return _0x1f39e2[_0xb4d1('0x13')](_0x11229b)[_0xb4d1('0x15')](_0x590e46);}};}function respondWithFilteredResult(_0x2df6ed,_0x5c3599){return function(_0x2f3ad6){if(_0x2f3ad6){var _0x47227b=_0x2f3ad6[_0xb4d1('0x16')],_0x53f235=_0x5c3599['offset'],_0x205501=_0x5c3599[_0xb4d1('0x17')]+_0x5c3599[_0xb4d1('0x18')],_0x3fb71d;if(_0x205501>=_0x47227b){_0x205501=_0x47227b;_0x3fb71d=0xc8;}else{_0x3fb71d=0xce;}_0x2df6ed[_0xb4d1('0x13')](_0x3fb71d);return _0x2df6ed['set'](_0xb4d1('0x19'),_0x53f235+'-'+_0x205501+'/'+_0x47227b)['json'](_0x2f3ad6);}return null;};}function patchUpdates(_0x196c97){return function(_0x497fb5){try{jsonpatch[_0xb4d1('0x1a')](_0x497fb5,_0x196c97,!![]);}catch(_0x29709d){return BPromise['reject'](_0x29709d);}return _0x497fb5[_0xb4d1('0x1b')]();};}function saveUpdates(_0x4be986,_0x422eff){return function(_0x1cd1b2){if(_0x1cd1b2){return _0x1cd1b2['update'](_0x4be986)['then'](function(_0x3c2b20){return _0x3c2b20;});}return null;};}function removeEntity(_0x2b29e8,_0xa5c6f6){return function(_0x6aee52){if(_0x6aee52){return _0x6aee52[_0xb4d1('0x1c')]()[_0xb4d1('0x1d')](function(){_0x2b29e8[_0xb4d1('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58f67f,_0x233e6a){return function(_0x537cd4){if(!_0x537cd4){_0x58f67f[_0xb4d1('0x1e')](0x194);}return _0x537cd4;};}function handleError(_0x35d6b6,_0x5e68bd){_0x5e68bd=_0x5e68bd||0x1f4;return function(_0x5f1bed){logger[_0xb4d1('0x1f')](_0x5f1bed[_0xb4d1('0x20')]);if(_0x5f1bed[_0xb4d1('0x21')]){delete _0x5f1bed[_0xb4d1('0x21')];}_0x35d6b6['status'](_0x5e68bd)[_0xb4d1('0x22')](_0x5f1bed);};}exports[_0xb4d1('0x23')]=function(_0x17c3a9,_0x3ebdc1){if(_0x17c3a9[_0xb4d1('0x24')]['id']){delete _0x17c3a9['body']['id'];}return db[_0xb4d1('0x25')][_0xb4d1('0x26')]({'where':{'id':_0x17c3a9[_0xb4d1('0x27')]['id']}})[_0xb4d1('0x1d')](handleEntityNotFound(_0x3ebdc1,null))[_0xb4d1('0x1d')](saveUpdates(_0x17c3a9[_0xb4d1('0x24')],null))['then'](respondWithResult(_0x3ebdc1,null))['catch'](handleError(_0x3ebdc1,null));};exports['destroy']=function(_0x349411,_0x2d55cc){return db[_0xb4d1('0x25')]['find']({'where':{'id':_0x349411['params']['id']}})[_0xb4d1('0x1d')](handleEntityNotFound(_0x2d55cc,null))['then'](removeEntity(_0x2d55cc,null))[_0xb4d1('0x28')](handleError(_0x2d55cc,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 815a682..8d6df1e 100644 --- a/server/api/condition/condition.model.js +++ b/server/api/condition/condition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e74=['util','../../config/logger','moment','request-promise','path','rimraf','exports','define','Condition','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6e74,0x77));var _0x46e7=function(_0x1e6229,_0x5f4a1c){_0x1e6229=_0x1e6229-0x0;var _0x5bcf88=_0x6e74[_0x1e6229];return _0x5bcf88;};'use strict';var _=require(_0x46e7('0x0'));var util=require(_0x46e7('0x1'));var logger=require(_0x46e7('0x2'))('api');var moment=require(_0x46e7('0x3'));var BPromise=require('bluebird');var rp=require(_0x46e7('0x4'));var fs=require('fs');var path=require(_0x46e7('0x5'));var rimraf=require(_0x46e7('0x6'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0x46e7('0x7')]=function(_0x443636,_0x2a7205){return _0x443636[_0x46e7('0x8')](_0x46e7('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d58=['api','moment','bluebird','request-promise','path','rimraf','define','Condition','tools_conditions','util','../../config/logger'];(function(_0x1b603b,_0x52fb4a){var _0x29bb9e=function(_0xb50bff){while(--_0xb50bff){_0x1b603b['push'](_0x1b603b['shift']());}};_0x29bb9e(++_0x52fb4a);}(_0x9d58,0xda));var _0x89d5=function(_0x1c1b8c,_0x4c253d){_0x1c1b8c=_0x1c1b8c-0x0;var _0x1ee4c4=_0x9d58[_0x1c1b8c];return _0x1ee4c4;};'use strict';var _=require('lodash');var util=require(_0x89d5('0x0'));var logger=require(_0x89d5('0x1'))(_0x89d5('0x2'));var moment=require(_0x89d5('0x3'));var BPromise=require(_0x89d5('0x4'));var rp=require(_0x89d5('0x5'));var fs=require('fs');var path=require(_0x89d5('0x6'));var rimraf=require(_0x89d5('0x7'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module['exports']=function(_0x39f528,_0x1744a9){return _0x39f528[_0x89d5('0x8')](_0x89d5('0x9'),attributes,{'tableName':_0x89d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index f68f89b..b266b60 100644 --- a/server/api/condition/condition.rpc.js +++ b/server/api/condition/condition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e00=['request','then','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x559cb3,_0x293d1e){var _0x5059ef=function(_0x18ed08){while(--_0x18ed08){_0x559cb3['push'](_0x559cb3['shift']());}};_0x5059ef(++_0x293d1e);}(_0x6e00,0x145));var _0x06e0=function(_0x5b8749,_0x51c519){_0x5b8749=_0x5b8749-0x0;var _0x572ac3=_0x6e00[_0x5b8749];return _0x572ac3;};'use strict';var _=require(_0x06e0('0x0'));var util=require(_0x06e0('0x1'));var moment=require('moment');var BPromise=require(_0x06e0('0x2'));var rs=require(_0x06e0('0x3'));var fs=require('fs');var Redis=require(_0x06e0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x06e0('0x5'))(_0x06e0('0x6'));var config=require(_0x06e0('0x7'));var jayson=require(_0x06e0('0x8'));var client=jayson[_0x06e0('0x9')][_0x06e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30a99c,_0x24000c,_0x1266e7){return new BPromise(function(_0x56cef4,_0x355d92){return client[_0x06e0('0xb')](_0x30a99c,_0x1266e7)[_0x06e0('0xc')](function(_0x50fe41){logger['info']('Condition,\x20%s,\x20%s',_0x24000c,_0x06e0('0xd'));logger[_0x06e0('0xe')](_0x06e0('0xf'),_0x24000c,_0x06e0('0xd'),JSON[_0x06e0('0x10')](_0x50fe41));if(_0x50fe41[_0x06e0('0x11')]){if(_0x50fe41[_0x06e0('0x11')][_0x06e0('0x12')]===0x1f4){logger[_0x06e0('0x11')](_0x06e0('0x13'),_0x24000c,_0x50fe41['error'][_0x06e0('0x14')]);return _0x355d92(_0x50fe41['error']['message']);}logger[_0x06e0('0x11')](_0x06e0('0x13'),_0x24000c,_0x50fe41[_0x06e0('0x11')][_0x06e0('0x14')]);return _0x56cef4(_0x50fe41[_0x06e0('0x11')][_0x06e0('0x14')]);}else{logger[_0x06e0('0x15')](_0x06e0('0x13'),_0x24000c,_0x06e0('0xd'));_0x56cef4(_0x50fe41[_0x06e0('0x16')][_0x06e0('0x14')]);}})[_0x06e0('0x17')](function(_0xc8e900){logger['error'](_0x06e0('0x13'),_0x24000c,_0xc8e900);_0x355d92(_0xc8e900);});});} \ No newline at end of file +var _0xa51e=['util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash'];(function(_0x5047e4,_0x521ffc){var _0x235cc0=function(_0x531acd){while(--_0x531acd){_0x5047e4['push'](_0x5047e4['shift']());}};_0x235cc0(++_0x521ffc);}(_0xa51e,0x125));var _0xea51=function(_0x1aac60,_0x2e5ce5){_0x1aac60=_0x1aac60-0x0;var _0x186adf=_0xa51e[_0x1aac60];return _0x186adf;};'use strict';var _=require(_0xea51('0x0'));var util=require(_0xea51('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xea51('0x2'));var fs=require('fs');var Redis=require(_0xea51('0x3'));var db=require(_0xea51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xea51('0x5'))('rpc');var config=require(_0xea51('0x6'));var jayson=require(_0xea51('0x7'));var client=jayson[_0xea51('0x8')][_0xea51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x497a0a,_0x3419ce,_0x15d196){return new BPromise(function(_0x48cd4e,_0x49a59e){return client['request'](_0x497a0a,_0x15d196)[_0xea51('0xa')](function(_0x647682){logger['info'](_0xea51('0xb'),_0x3419ce,_0xea51('0xc'));logger[_0xea51('0xd')](_0xea51('0xe'),_0x3419ce,_0xea51('0xc'),JSON[_0xea51('0xf')](_0x647682));if(_0x647682[_0xea51('0x10')]){if(_0x647682[_0xea51('0x10')]['code']===0x1f4){logger[_0xea51('0x10')]('Condition,\x20%s,\x20%s',_0x3419ce,_0x647682['error'][_0xea51('0x11')]);return _0x49a59e(_0x647682[_0xea51('0x10')][_0xea51('0x11')]);}logger['error'](_0xea51('0xb'),_0x3419ce,_0x647682['error'][_0xea51('0x11')]);return _0x48cd4e(_0x647682[_0xea51('0x10')][_0xea51('0x11')]);}else{logger[_0xea51('0x12')]('Condition,\x20%s,\x20%s',_0x3419ce,_0xea51('0xc'));_0x48cd4e(_0x647682[_0xea51('0x13')][_0xea51('0x11')]);}})[_0xea51('0x14')](function(_0x4eee0a){logger[_0xea51('0x10')](_0xea51('0xb'),_0x3419ce,_0x4eee0a);_0x49a59e(_0x4eee0a);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index fe383a3..96561e0 100644 --- a/server/api/condition/index.js +++ b/server/api/condition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x287f=['/:id','isAuthenticated','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./condition.controller','put'];(function(_0x587783,_0x6296e6){var _0x1cca44=function(_0x2c5082){while(--_0x2c5082){_0x587783['push'](_0x587783['shift']());}};_0x1cca44(++_0x6296e6);}(_0x287f,0x171));var _0xf287=function(_0x10d0bf,_0x5f3acb){_0x10d0bf=_0x10d0bf-0x0;var _0x2dabd4=_0x287f[_0x10d0bf];return _0x2dabd4;};'use strict';var multer=require(_0xf287('0x0'));var util=require('util');var path=require(_0xf287('0x1'));var timeout=require(_0xf287('0x2'));var express=require(_0xf287('0x3'));var router=express[_0xf287('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf287('0x5'));var config=require('../../config/environment');var controller=require(_0xf287('0x6'));router[_0xf287('0x7')](_0xf287('0x8'),auth[_0xf287('0x9')](),controller[_0xf287('0xa')]);router[_0xf287('0xb')](_0xf287('0x8'),auth[_0xf287('0x9')](),controller['destroy']);module[_0xf287('0xc')]=router; \ No newline at end of file +var _0x8909=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update','delete','exports','multer','util'];(function(_0x126252,_0x2e41d4){var _0x589e99=function(_0x313b0b){while(--_0x313b0b){_0x126252['push'](_0x126252['shift']());}};_0x589e99(++_0x2e41d4);}(_0x8909,0xa6));var _0x9890=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x8909[_0x1ad926];return _0x1b81dc;};'use strict';var multer=require(_0x9890('0x0'));var util=require(_0x9890('0x1'));var path=require(_0x9890('0x2'));var timeout=require(_0x9890('0x3'));var express=require(_0x9890('0x4'));var router=express[_0x9890('0x5')]();var auth=require(_0x9890('0x6'));var interaction=require(_0x9890('0x7'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0x9890('0x8')](_0x9890('0x9'),auth[_0x9890('0xa')](),controller[_0x9890('0xb')]);router[_0x9890('0xc')](_0x9890('0x9'),auth[_0x9890('0xa')](),controller['destroy']);module[_0x9890('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index e48d333..4e064ef 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6934=['exports','STRING','name','sequelize'];(function(_0x3f8f60,_0x5b9f07){var _0x18d2d5=function(_0x400fd8){while(--_0x400fd8){_0x3f8f60['push'](_0x3f8f60['shift']());}};_0x18d2d5(++_0x5b9f07);}(_0x6934,0x17f));var _0x4693=function(_0x45150d,_0xb07642){_0x45150d=_0x45150d-0x0;var _0x2ee034=_0x6934[_0x45150d];return _0x2ee034;};'use strict';var Sequelize=require(_0x4693('0x0'));module[_0x4693('0x1')]={'name':{'type':Sequelize[_0x4693('0x2')],'allowNull':![],'unique':_0x4693('0x3')},'description':{'type':Sequelize[_0x4693('0x2')]}}; \ No newline at end of file +var _0xeb5d=['sequelize','exports','STRING','name'];(function(_0x53e0c3,_0x38a35a){var _0x5c26ea=function(_0x1decad){while(--_0x1decad){_0x53e0c3['push'](_0x53e0c3['shift']());}};_0x5c26ea(++_0x38a35a);}(_0xeb5d,0x174));var _0xdeb5=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xeb5d[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0xdeb5('0x0'));module[_0xdeb5('0x1')]={'name':{'type':Sequelize[_0xdeb5('0x2')],'allowNull':![],'unique':_0xdeb5('0x3')},'description':{'type':Sequelize[_0xdeb5('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index b55a436..a084520 100644 --- a/server/api/dashboard/dashboard.controller.js +++ b/server/api/dashboard/dashboard.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bc9=['attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','addItem','DashboardId','DashboardItem','getItems','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','CustomDashboards','sendStatus','error','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','options','Dashboard','includeAll','include','findAll','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','role','userProfileId','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock'];(function(_0x13992d,_0x3029ea){var _0x3d15bf=function(_0x3444f7){while(--_0x3444f7){_0x13992d['push'](_0x13992d['shift']());}};_0x3d15bf(++_0x3029ea);}(_0x7bc9,0x107));var _0x97bc=function(_0x515919,_0x390adc){_0x515919=_0x515919-0x0;var _0x5a5c3b=_0x7bc9[_0x515919];return _0x5a5c3b;};'use strict';var pdf=require(_0x97bc('0x0'));var emlformat=require(_0x97bc('0x1'));var rimraf=require(_0x97bc('0x2'));var zipdir=require(_0x97bc('0x3'));var jsonpatch=require(_0x97bc('0x4'));var rp=require(_0x97bc('0x5'));var moment=require(_0x97bc('0x6'));var BPromise=require(_0x97bc('0x7'));var Mustache=require(_0x97bc('0x8'));var util=require('util');var path=require(_0x97bc('0x9'));var sox=require(_0x97bc('0xa'));var csv=require(_0x97bc('0xb'));var ejs=require(_0x97bc('0xc'));var fs=require('fs');var _=require(_0x97bc('0xd'));var squel=require(_0x97bc('0xe'));var crypto=require(_0x97bc('0xf'));var jsforce=require(_0x97bc('0x10'));var deskjs=require(_0x97bc('0x11'));var toCsv=require('to-csv');var querystring=require(_0x97bc('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x97bc('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x97bc('0x14'))(_0x97bc('0x15'));var utils=require(_0x97bc('0x16'));var config=require('../../config/environment');var db=require(_0x97bc('0x17'))['db'];config[_0x97bc('0x18')]=_[_0x97bc('0x19')](config[_0x97bc('0x18')],{'host':_0x97bc('0x1a'),'port':0x18eb});var socket=require(_0x97bc('0x1b'))(new Redis(config[_0x97bc('0x18')]));require(_0x97bc('0x1c'))[_0x97bc('0x1d')](socket);function respondWithStatusCode(_0x5c5628,_0x5a2708){_0x5a2708=_0x5a2708||0xcc;return function(_0x726b0){if(_0x726b0){return _0x5c5628['sendStatus'](_0x5a2708);}return _0x5c5628[_0x97bc('0x1e')](_0x5a2708)[_0x97bc('0x1f')]();};}function respondWithResult(_0x2e9eb3,_0x5e2bbc){_0x5e2bbc=_0x5e2bbc||0xc8;return function(_0x1f4a57){if(_0x1f4a57){return _0x2e9eb3[_0x97bc('0x1e')](_0x5e2bbc)[_0x97bc('0x20')](_0x1f4a57);}};}function respondWithFilteredResult(_0x286e2e,_0x7888d2){return function(_0x5d5b9e){if(_0x5d5b9e){var _0x2fcf4c=_0x5d5b9e[_0x97bc('0x21')],_0x2c2a21=_0x7888d2[_0x97bc('0x22')],_0x23716c=_0x7888d2[_0x97bc('0x22')]+_0x7888d2[_0x97bc('0x23')],_0x1f765f;if(_0x23716c>=_0x2fcf4c){_0x23716c=_0x2fcf4c;_0x1f765f=0xc8;}else{_0x1f765f=0xce;}_0x286e2e[_0x97bc('0x1e')](_0x1f765f);return _0x286e2e[_0x97bc('0x24')](_0x97bc('0x25'),_0x2c2a21+'-'+_0x23716c+'/'+_0x2fcf4c)[_0x97bc('0x20')](_0x5d5b9e);}return null;};}function patchUpdates(_0xc90003){return function(_0x212c9d){try{jsonpatch[_0x97bc('0x26')](_0x212c9d,_0xc90003,!![]);}catch(_0x1fe659){return BPromise[_0x97bc('0x27')](_0x1fe659);}return _0x212c9d[_0x97bc('0x28')]();};}function saveUpdates(_0x3f5403,_0x15673c){return function(_0x53f475){if(_0x53f475){return _0x53f475[_0x97bc('0x29')](_0x3f5403)['then'](function(_0x777e41){return _0x777e41;});}return null;};}function removeEntity(_0x390063,_0x2b9d67){return function(_0x346cdf){if(_0x346cdf){return _0x346cdf[_0x97bc('0x2a')]()[_0x97bc('0x2b')](function(){var _0x27c822=_0x346cdf[_0x97bc('0x2c')]({'plain':!![]});var _0x22e100=_0x97bc('0x2d');return db['UserProfileResource'][_0x97bc('0x2a')]({'where':{'type':_0x22e100,'resourceId':_0x27c822['id']}})[_0x97bc('0x2b')](function(){return _0x346cdf;});})[_0x97bc('0x2b')](function(){_0x390063[_0x97bc('0x1e')](0xcc)[_0x97bc('0x1f')]();});}};}function handleEntityNotFound(_0x3450d2,_0x8442e1){return function(_0x4c464b){if(!_0x4c464b){_0x3450d2[_0x97bc('0x2e')](0x194);}return _0x4c464b;};}function handleError(_0x331e07,_0x59dc9f){_0x59dc9f=_0x59dc9f||0x1f4;return function(_0x437b03){logger[_0x97bc('0x2f')](_0x437b03[_0x97bc('0x30')]);if(_0x437b03[_0x97bc('0x31')]){delete _0x437b03[_0x97bc('0x31')];}_0x331e07[_0x97bc('0x1e')](_0x59dc9f)['send'](_0x437b03);};}exports[_0x97bc('0x32')]=function(_0x6cd2c2,_0x1d600d){var _0x146cbc={},_0xdeea4f={},_0x499d95={'count':0x0,'rows':[]};var _0x3ede80=db['Dashboard'][_0x97bc('0x33')];_0xdeea4f[_0x97bc('0x34')]=_[_0x97bc('0x35')](_0x3ede80);_0xdeea4f[_0x97bc('0x36')]=_[_0x97bc('0x35')](_0x6cd2c2[_0x97bc('0x36')]);_0xdeea4f[_0x97bc('0x37')]=_[_0x97bc('0x38')](_0xdeea4f[_0x97bc('0x34')],_0xdeea4f[_0x97bc('0x36')]);_0x146cbc[_0x97bc('0x39')]=_[_0x97bc('0x38')](_0xdeea4f[_0x97bc('0x34')],qs[_0x97bc('0x3a')](_0x6cd2c2[_0x97bc('0x36')][_0x97bc('0x3a')]));_0x146cbc[_0x97bc('0x39')]=_0x146cbc[_0x97bc('0x39')][_0x97bc('0x3b')]?_0x146cbc[_0x97bc('0x39')]:_0xdeea4f[_0x97bc('0x34')];if(!_0x6cd2c2['query'][_0x97bc('0x3c')](_0x97bc('0x3d'))){_0x146cbc[_0x97bc('0x23')]=qs[_0x97bc('0x23')](_0x6cd2c2[_0x97bc('0x36')][_0x97bc('0x23')]);_0x146cbc[_0x97bc('0x22')]=qs[_0x97bc('0x22')](_0x6cd2c2['query'][_0x97bc('0x22')]);}_0x146cbc[_0x97bc('0x3e')]=qs['sort'](_0x6cd2c2['query'][_0x97bc('0x3f')]);_0x146cbc[_0x97bc('0x40')]=qs[_0x97bc('0x37')](_[_0x97bc('0x41')](_0x6cd2c2[_0x97bc('0x36')],_0xdeea4f[_0x97bc('0x37')]));if(_0x6cd2c2[_0x97bc('0x36')][_0x97bc('0x42')]){_0x146cbc[_0x97bc('0x40')]=_[_0x97bc('0x43')](_0x146cbc[_0x97bc('0x40')],{'$or':_[_0x97bc('0x44')](_0x3ede80,function(_0x2bc321){if(_0x2bc321[_0x97bc('0x45')][_0x97bc('0x46')]!=='VIRTUAL'){var _0x40e620={};_0x40e620[_0x2bc321['field']]={'$like':'%'+_0x6cd2c2[_0x97bc('0x36')][_0x97bc('0x42')]+'%'};return _0x40e620;}})});}_0x146cbc=_[_0x97bc('0x43')]({},_0x146cbc,_0x6cd2c2[_0x97bc('0x47')]);var _0xcc052={'where':_0x146cbc[_0x97bc('0x40')]};return db[_0x97bc('0x48')][_0x97bc('0x21')](_0xcc052)[_0x97bc('0x2b')](function(_0x50512a){_0x499d95['count']=_0x50512a;if(_0x6cd2c2[_0x97bc('0x36')][_0x97bc('0x49')]){_0x146cbc[_0x97bc('0x4a')]=[{'all':!![]}];}return db[_0x97bc('0x48')][_0x97bc('0x4b')](_0x146cbc);})[_0x97bc('0x2b')](function(_0x12af89){_0x499d95['rows']=_0x12af89;return _0x499d95;})[_0x97bc('0x2b')](respondWithFilteredResult(_0x1d600d,_0x146cbc))[_0x97bc('0x4c')](handleError(_0x1d600d,null));};exports['show']=function(_0x5eaadc,_0x531124){var _0x246b4c={'raw':![],'where':{'id':_0x5eaadc['params']['id']}},_0x297223={};_0x297223[_0x97bc('0x34')]=_['keys'](db[_0x97bc('0x48')]['rawAttributes']);_0x297223[_0x97bc('0x36')]=_['keys'](_0x5eaadc[_0x97bc('0x36')]);_0x297223['filters']=_[_0x97bc('0x38')](_0x297223['model'],_0x297223[_0x97bc('0x36')]);_0x246b4c[_0x97bc('0x39')]=_[_0x97bc('0x38')](_0x297223[_0x97bc('0x34')],qs[_0x97bc('0x3a')](_0x5eaadc['query'][_0x97bc('0x3a')]));_0x246b4c['attributes']=_0x246b4c['attributes'][_0x97bc('0x3b')]?_0x246b4c[_0x97bc('0x39')]:_0x297223['model'];if(_0x5eaadc[_0x97bc('0x36')][_0x97bc('0x49')]){_0x246b4c[_0x97bc('0x4a')]=[{'all':!![]}];}_0x246b4c=_[_0x97bc('0x43')]({},_0x246b4c,_0x5eaadc['options']);return db[_0x97bc('0x48')][_0x97bc('0x4d')](_0x246b4c)[_0x97bc('0x2b')](handleEntityNotFound(_0x531124,null))[_0x97bc('0x2b')](respondWithResult(_0x531124,null))['catch'](handleError(_0x531124,null));};exports[_0x97bc('0x4e')]=function(_0x4393de,_0x7454b6){return db[_0x97bc('0x48')][_0x97bc('0x4e')](_0x4393de[_0x97bc('0x4f')],{})['then'](function(_0x23b77c){var _0x31b7ef=_0x4393de[_0x97bc('0x50')][_0x97bc('0x2c')]({'plain':!![]});if(!_0x31b7ef)throw new Error(_0x97bc('0x51'));if(_0x31b7ef['role']===_0x97bc('0x50')){var _0x47fe3a=_0x23b77c[_0x97bc('0x2c')]({'plain':!![]});var _0x2520fb=_0x97bc('0x2d');return db[_0x97bc('0x52')][_0x97bc('0x4d')]({'where':{'name':_0x2520fb,'userProfileId':_0x31b7ef['userProfileId']},'raw':!![]})[_0x97bc('0x2b')](function(_0x38368f){if(_0x38368f&&_0x38368f[_0x97bc('0x53')]===0x0){return db[_0x97bc('0x54')][_0x97bc('0x4e')]({'name':_0x47fe3a['name'],'resourceId':_0x47fe3a['id'],'type':_0x38368f[_0x97bc('0x31')],'sectionId':_0x38368f['id']},{})[_0x97bc('0x2b')](function(){return _0x23b77c;});}else{return _0x23b77c;}})['catch'](function(_0x42605a){logger[_0x97bc('0x2f')](_0x97bc('0x55'),_0x42605a);throw _0x42605a;});}return _0x23b77c;})[_0x97bc('0x2b')](respondWithResult(_0x7454b6,0xc9))['catch'](handleError(_0x7454b6,null));};exports['clone']=function(_0x142a70,_0x18d4ce){var _0x3af6df={'raw':![],'where':{'id':_0x142a70[_0x97bc('0x56')]['id']}},_0x17636c={};_0x17636c[_0x97bc('0x34')]=_[_0x97bc('0x35')](db[_0x97bc('0x48')]['rawAttributes']);_0x3af6df['attributes']=_[_0x97bc('0x38')](_0x17636c['model'],qs[_0x97bc('0x3a')](_0x142a70[_0x97bc('0x36')]['fields']));_0x3af6df[_0x97bc('0x39')]=_0x3af6df[_0x97bc('0x39')][_0x97bc('0x3b')]?_0x3af6df['attributes']:_0x17636c[_0x97bc('0x34')];if(_0x142a70[_0x97bc('0x36')]['includeAll']){_0x3af6df[_0x97bc('0x4a')]=[{'all':!![]}];}_0x3af6df=_[_0x97bc('0x43')]({},_0x3af6df,_0x142a70[_0x97bc('0x47')]);return db[_0x97bc('0x48')][_0x97bc('0x4d')](_0x3af6df)[_0x97bc('0x2b')](handleEntityNotFound(_0x18d4ce,null))[_0x97bc('0x2b')](function(_0x2733b8){if(_0x2733b8){var _0x527b65=_0x2733b8[_0x97bc('0x2c')]({'plain':!![]});_0x527b65=qs[_0x97bc('0x57')](_0x527b65,['id',_0x97bc('0x58'),_0x97bc('0x59')]);_0x142a70[_0x97bc('0x4f')]=_[_0x97bc('0x57')](_0x142a70['body'],['id',_0x97bc('0x58'),_0x97bc('0x59')]);return db[_0x97bc('0x48')][_0x97bc('0x4e')](_[_0x97bc('0x43')](_0x527b65,_0x142a70[_0x97bc('0x4f')]),{'include':_0x142a70[_0x97bc('0x36')][_0x97bc('0x49')]?[{'all':!![]}]:undefined})[_0x97bc('0x2b')](function(_0x4b14b4){var _0x388b23=_0x142a70['user']['get']({'plain':!![]});if(!_0x388b23)throw new Error(_0x97bc('0x51'));if(_0x388b23[_0x97bc('0x5a')]===_0x97bc('0x50')){var _0xfe3f2e=_0x4b14b4['get']({'plain':!![]});var _0x196915=_0x97bc('0x2d');return db[_0x97bc('0x52')][_0x97bc('0x4d')]({'where':{'name':_0x196915,'userProfileId':_0x388b23[_0x97bc('0x5b')]},'raw':!![]})[_0x97bc('0x2b')](function(_0xb78f5b){if(_0xb78f5b&&_0xb78f5b['autoAssociation']===0x0){return db[_0x97bc('0x54')][_0x97bc('0x4e')]({'name':_0xfe3f2e[_0x97bc('0x31')],'resourceId':_0xfe3f2e['id'],'type':_0xb78f5b['name'],'sectionId':_0xb78f5b['id']},{})[_0x97bc('0x2b')](function(){return _0x4b14b4;});}else{return _0x4b14b4;}})[_0x97bc('0x4c')](function(_0x1cec04){logger['error'](_0x97bc('0x55'),_0x1cec04);throw _0x1cec04;});}return _0x4b14b4;});}})[_0x97bc('0x2b')](respondWithResult(_0x18d4ce,0xc9))[_0x97bc('0x4c')](handleError(_0x18d4ce,null));};exports[_0x97bc('0x29')]=function(_0x5743e2,_0x159bf5){if(_0x5743e2[_0x97bc('0x4f')]['id']){delete _0x5743e2[_0x97bc('0x4f')]['id'];}return db[_0x97bc('0x48')]['find']({'where':{'id':_0x5743e2[_0x97bc('0x56')]['id']}})['then'](handleEntityNotFound(_0x159bf5,null))[_0x97bc('0x2b')](saveUpdates(_0x5743e2[_0x97bc('0x4f')],null))['then'](respondWithResult(_0x159bf5,null))[_0x97bc('0x4c')](handleError(_0x159bf5,null));};exports[_0x97bc('0x2a')]=function(_0x5d978e,_0x419ec2){return db[_0x97bc('0x48')][_0x97bc('0x4d')]({'where':{'id':_0x5d978e[_0x97bc('0x56')]['id']}})[_0x97bc('0x2b')](handleEntityNotFound(_0x419ec2,null))['then'](removeEntity(_0x419ec2,null))[_0x97bc('0x4c')](handleError(_0x419ec2,null));};function widgetAttributes(_0x13d9fe){try{switch(_0x13d9fe[_0x97bc('0x45')]){case _0x97bc('0x5c'):return[{'name':_0x97bc('0x5d'),'value':_0x13d9fe[_0x97bc('0x5d')]||(_0x13d9fe['attrs']&&_0x13d9fe[_0x97bc('0x5e')][0x0]?_0x13d9fe[_0x97bc('0x5e')][0x0][_0x97bc('0x5f')]:undefined)||_0x97bc('0x60')}];case _0x97bc('0x61'):return[{'name':_0x97bc('0x62'),'value':_0x13d9fe[_0x97bc('0x62')]||(_0x13d9fe[_0x97bc('0x5e')]&&_0x13d9fe[_0x97bc('0x5e')][0x0]?_0x13d9fe[_0x97bc('0x5e')][0x0][_0x97bc('0x5f')]:undefined)||''}];case _0x97bc('0x63'):return[{'name':_0x97bc('0x64'),'value':_0x13d9fe['attrHourFormat']||(_0x13d9fe[_0x97bc('0x5e')]&&_0x13d9fe[_0x97bc('0x5e')][0x0]?_0x13d9fe[_0x97bc('0x5e')][0x0][_0x97bc('0x5f')]:undefined)||_0x97bc('0x65')},{'name':_0x97bc('0x66'),'value':_0x13d9fe[_0x97bc('0x66')]||(_0x13d9fe[_0x97bc('0x5e')]&&_0x13d9fe['attrs'][0x1]?_0x13d9fe['attrs'][0x1]['value']:undefined)||_0x97bc('0x67')},{'name':_0x97bc('0x68'),'value':_0x13d9fe[_0x97bc('0x68')]||(_0x13d9fe[_0x97bc('0x5e')]&&_0x13d9fe[_0x97bc('0x5e')][0x2]?_0x13d9fe[_0x97bc('0x5e')][0x2]['value']:undefined)||0xc}];case _0x97bc('0x69'):return[{'name':_0x97bc('0x6a'),'value':_0x13d9fe[_0x97bc('0x6a')]||(_0x13d9fe[_0x97bc('0x5e')]&&_0x13d9fe[_0x97bc('0x5e')][0x0]?_0x13d9fe[_0x97bc('0x5e')][0x0][_0x97bc('0x5f')]:undefined)||'total'},{'name':_0x97bc('0x6b'),'value':_0x13d9fe[_0x97bc('0x6b')]||(_0x13d9fe[_0x97bc('0x5e')]&&_0x13d9fe[_0x97bc('0x5e')][0x1]?_0x13d9fe['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x13d9fe['attrFontSize']||(_0x13d9fe[_0x97bc('0x5e')]&&_0x13d9fe[_0x97bc('0x5e')][0x2]?_0x13d9fe[_0x97bc('0x5e')][0x2][_0x97bc('0x5f')]:undefined)||0x14}];case'multibar-chart':case _0x97bc('0x6c'):return[{'name':_0x97bc('0x6d'),'value':_0x13d9fe[_0x97bc('0x6d')]||(_0x13d9fe['attrs']&&_0x13d9fe['attrs'][0x0]?_0x13d9fe[_0x97bc('0x5e')][0x0][_0x97bc('0x5f')]:undefined)||'total'},{'name':_0x97bc('0x6e'),'value':_0x13d9fe[_0x97bc('0x6e')]||(_0x13d9fe[_0x97bc('0x5e')]&&_0x13d9fe[_0x97bc('0x5e')][0x1]?_0x13d9fe[_0x97bc('0x5e')][0x1][_0x97bc('0x5f')]:undefined)||null},{'name':_0x97bc('0x6f'),'value':_0x13d9fe[_0x97bc('0x6f')]||(_0x13d9fe[_0x97bc('0x5e')]&&_0x13d9fe[_0x97bc('0x5e')][0x2]?_0x13d9fe['attrs'][0x2]['value']:undefined)||null},{'name':_0x97bc('0x6b'),'value':_0x13d9fe['attrVoiceQueues']||(_0x13d9fe[_0x97bc('0x5e')]&&_0x13d9fe[_0x97bc('0x5e')][0x3]?_0x13d9fe[_0x97bc('0x5e')][0x3]['value']:undefined)||[]}];case _0x97bc('0x70'):return[{'name':_0x97bc('0x71'),'type':_0x13d9fe[_0x97bc('0x72')]||(_0x13d9fe['attrs']&&_0x13d9fe[_0x97bc('0x5e')][0x0]?_0x13d9fe['attrs'][0x0][_0x97bc('0x45')]:undefined)||null,'value':_0x13d9fe['attrReport']||(_0x13d9fe['attrs']&&_0x13d9fe[_0x97bc('0x5e')][0x0]?_0x13d9fe[_0x97bc('0x5e')][0x0][_0x97bc('0x5f')]:undefined)||null},{'name':_0x97bc('0x73'),'value':_0x13d9fe[_0x97bc('0x73')]||(_0x13d9fe[_0x97bc('0x5e')]&&_0x13d9fe[_0x97bc('0x5e')][0x1]?_0x13d9fe[_0x97bc('0x5e')][0x1][_0x97bc('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x75dbd2){logger[_0x97bc('0x2f')]('widgetAttributes:\x20%s',JSON['stringify'](_0x75dbd2));return[];}}exports[_0x97bc('0x74')]=function(_0x5a2b8a,_0xd559dd,_0x17cb47){if(_0x5a2b8a[_0x97bc('0x4f')]['id']){delete _0x5a2b8a[_0x97bc('0x4f')]['id'];}return db[_0x97bc('0x48')][_0x97bc('0x4d')]({'where':{'id':_0x5a2b8a[_0x97bc('0x56')]['id']}})[_0x97bc('0x2b')](handleEntityNotFound(_0xd559dd,null))[_0x97bc('0x2b')](function(_0x283bd2){if(_0x283bd2){_0x5a2b8a['body'][_0x97bc('0x75')]=_0x283bd2['id'];_0x5a2b8a['body'][_0x97bc('0x5e')]=widgetAttributes(_0x5a2b8a[_0x97bc('0x4f')]);return db[_0x97bc('0x76')][_0x97bc('0x4e')](_0x5a2b8a[_0x97bc('0x4f')]);}})[_0x97bc('0x2b')](respondWithResult(_0xd559dd,null))[_0x97bc('0x4c')](handleError(_0xd559dd,null));};exports[_0x97bc('0x77')]=function(_0x3b7623,_0x3b4436,_0x557d34){var _0x7524c2={};var _0x17a6ee={};var _0xe45c92;var _0x69c7f0;return db[_0x97bc('0x48')][_0x97bc('0x78')]({'where':{'id':_0x3b7623[_0x97bc('0x56')]['id']}})[_0x97bc('0x2b')](handleEntityNotFound(_0x3b4436,null))[_0x97bc('0x2b')](function(_0x3e6204){if(_0x3e6204){_0xe45c92=_0x3e6204;_0x17a6ee[_0x97bc('0x34')]=_['keys'](db[_0x97bc('0x76')][_0x97bc('0x33')]);_0x17a6ee['query']=_[_0x97bc('0x35')](_0x3b7623[_0x97bc('0x36')]);_0x17a6ee[_0x97bc('0x37')]=_[_0x97bc('0x38')](_0x17a6ee['model'],_0x17a6ee[_0x97bc('0x36')]);_0x7524c2['attributes']=_[_0x97bc('0x38')](_0x17a6ee[_0x97bc('0x34')],qs[_0x97bc('0x3a')](_0x3b7623[_0x97bc('0x36')][_0x97bc('0x3a')]));_0x7524c2[_0x97bc('0x39')]=_0x7524c2[_0x97bc('0x39')][_0x97bc('0x3b')]?_0x7524c2[_0x97bc('0x39')]:_0x17a6ee['model'];_0x7524c2[_0x97bc('0x3e')]=qs['sort'](_0x3b7623[_0x97bc('0x36')][_0x97bc('0x3f')]);_0x7524c2[_0x97bc('0x40')]=qs[_0x97bc('0x37')](_['pick'](_0x3b7623[_0x97bc('0x36')],_0x17a6ee['filters']));if(_0x3b7623[_0x97bc('0x36')][_0x97bc('0x42')]){_0x7524c2[_0x97bc('0x40')]=_['merge'](_0x7524c2['where'],{'$or':_[_0x97bc('0x44')](_0x7524c2[_0x97bc('0x39')],function(_0x11acf6){var _0x2212e2={};_0x2212e2[_0x11acf6]={'$like':'%'+_0x3b7623[_0x97bc('0x36')][_0x97bc('0x42')]+'%'};return _0x2212e2;})});}_0x7524c2=_['merge']({},_0x7524c2,_0x3b7623[_0x97bc('0x47')]);return _0xe45c92[_0x97bc('0x77')](_0x7524c2);}})[_0x97bc('0x2b')](function(_0x5ba779){if(_0x5ba779){_0x69c7f0=_0x5ba779['length'];if(!_0x3b7623[_0x97bc('0x36')]['hasOwnProperty'](_0x97bc('0x3d'))){_0x7524c2['limit']=qs['limit'](_0x3b7623[_0x97bc('0x36')]['limit']);_0x7524c2[_0x97bc('0x22')]=qs[_0x97bc('0x22')](_0x3b7623[_0x97bc('0x36')][_0x97bc('0x22')]);}return _0xe45c92['getItems'](_0x7524c2);}})[_0x97bc('0x2b')](function(_0x495d54){if(_0x495d54){return _0x495d54?{'count':_0x69c7f0,'rows':_0x495d54}:null;}})[_0x97bc('0x2b')](respondWithResult(_0x3b4436,null))['catch'](handleError(_0x3b4436,null));}; \ No newline at end of file +var _0x54bf=['bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','Dashboard','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','key','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','userProfileId','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','attrMetric','attrVoiceQueues','multibar-chart','attrSerie1','total','attrSerie3','web-report','reportType','type','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','getItems','findOne','DashboardItem','filter','map','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x54bf,0x1e1));var _0xf54b=function(_0x3d6689,_0x482c10){_0x3d6689=_0x3d6689-0x0;var _0x33be64=_0x54bf[_0x3d6689];return _0x33be64;};'use strict';var pdf=require(_0xf54b('0x0'));var emlformat=require(_0xf54b('0x1'));var rimraf=require(_0xf54b('0x2'));var zipdir=require(_0xf54b('0x3'));var jsonpatch=require(_0xf54b('0x4'));var rp=require(_0xf54b('0x5'));var moment=require(_0xf54b('0x6'));var BPromise=require(_0xf54b('0x7'));var Mustache=require(_0xf54b('0x8'));var util=require('util');var path=require(_0xf54b('0x9'));var sox=require(_0xf54b('0xa'));var csv=require(_0xf54b('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf54b('0xc'));var squel=require(_0xf54b('0xd'));var crypto=require(_0xf54b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf54b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf54b('0x10'));var Papa=require(_0xf54b('0x11'));var Redis=require(_0xf54b('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf54b('0x13'));var logger=require(_0xf54b('0x14'))(_0xf54b('0x15'));var utils=require(_0xf54b('0x16'));var config=require(_0xf54b('0x17'));var db=require(_0xf54b('0x18'))['db'];config[_0xf54b('0x19')]=_[_0xf54b('0x1a')](config[_0xf54b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf54b('0x1b'))(new Redis(config[_0xf54b('0x19')]));require(_0xf54b('0x1c'))[_0xf54b('0x1d')](socket);function respondWithStatusCode(_0x47874e,_0xd9c97b){_0xd9c97b=_0xd9c97b||0xcc;return function(_0x545f5d){if(_0x545f5d){return _0x47874e[_0xf54b('0x1e')](_0xd9c97b);}return _0x47874e['status'](_0xd9c97b)[_0xf54b('0x1f')]();};}function respondWithResult(_0x529cb0,_0x3db827){_0x3db827=_0x3db827||0xc8;return function(_0x3ef3b0){if(_0x3ef3b0){return _0x529cb0[_0xf54b('0x20')](_0x3db827)[_0xf54b('0x21')](_0x3ef3b0);}};}function respondWithFilteredResult(_0x9da846,_0x1f9e7c){return function(_0x1f2f0a){if(_0x1f2f0a){var _0x8ad99f=_0x1f2f0a[_0xf54b('0x22')],_0x1cd3fc=_0x1f9e7c['offset'],_0x36cbdc=_0x1f9e7c[_0xf54b('0x23')]+_0x1f9e7c[_0xf54b('0x24')],_0x30287e;if(_0x36cbdc>=_0x8ad99f){_0x36cbdc=_0x8ad99f;_0x30287e=0xc8;}else{_0x30287e=0xce;}_0x9da846['status'](_0x30287e);return _0x9da846[_0xf54b('0x25')](_0xf54b('0x26'),_0x1cd3fc+'-'+_0x36cbdc+'/'+_0x8ad99f)[_0xf54b('0x21')](_0x1f2f0a);}return null;};}function patchUpdates(_0x534cb2){return function(_0x3bca04){try{jsonpatch[_0xf54b('0x27')](_0x3bca04,_0x534cb2,!![]);}catch(_0x1da434){return BPromise[_0xf54b('0x28')](_0x1da434);}return _0x3bca04[_0xf54b('0x29')]();};}function saveUpdates(_0x48ae9a,_0x4aed4a){return function(_0x4f5c98){if(_0x4f5c98){return _0x4f5c98[_0xf54b('0x2a')](_0x48ae9a)[_0xf54b('0x2b')](function(_0x3b5420){return _0x3b5420;});}return null;};}function removeEntity(_0x25f1a1,_0x1d546d){return function(_0x290fe2){if(_0x290fe2){return _0x290fe2[_0xf54b('0x2c')]()[_0xf54b('0x2b')](function(){var _0x401765=_0x290fe2[_0xf54b('0x2d')]({'plain':!![]});var _0x5ab9ba=_0xf54b('0x2e');return db[_0xf54b('0x2f')]['destroy']({'where':{'type':_0x5ab9ba,'resourceId':_0x401765['id']}})['then'](function(){return _0x290fe2;});})[_0xf54b('0x2b')](function(){_0x25f1a1['status'](0xcc)[_0xf54b('0x1f')]();});}};}function handleEntityNotFound(_0x45721e,_0x15aa87){return function(_0x561294){if(!_0x561294){_0x45721e[_0xf54b('0x1e')](0x194);}return _0x561294;};}function handleError(_0x4bf797,_0x546395){_0x546395=_0x546395||0x1f4;return function(_0x247875){logger[_0xf54b('0x30')](_0x247875[_0xf54b('0x31')]);if(_0x247875['name']){delete _0x247875[_0xf54b('0x32')];}_0x4bf797['status'](_0x546395)[_0xf54b('0x33')](_0x247875);};}exports[_0xf54b('0x34')]=function(_0x16bb48,_0x57f90f){var _0x579a19={},_0x30267e={},_0x4ef666={'count':0x0,'rows':[]};var _0x57f648=db[_0xf54b('0x35')][_0xf54b('0x36')];_0x30267e['model']=_[_0xf54b('0x37')](_0x57f648);_0x30267e[_0xf54b('0x38')]=_[_0xf54b('0x37')](_0x16bb48['query']);_0x30267e[_0xf54b('0x39')]=_['intersection'](_0x30267e[_0xf54b('0x3a')],_0x30267e[_0xf54b('0x38')]);_0x579a19[_0xf54b('0x3b')]=_[_0xf54b('0x3c')](_0x30267e[_0xf54b('0x3a')],qs[_0xf54b('0x3d')](_0x16bb48[_0xf54b('0x38')][_0xf54b('0x3d')]));_0x579a19[_0xf54b('0x3b')]=_0x579a19[_0xf54b('0x3b')][_0xf54b('0x3e')]?_0x579a19['attributes']:_0x30267e[_0xf54b('0x3a')];if(!_0x16bb48[_0xf54b('0x38')][_0xf54b('0x3f')](_0xf54b('0x40'))){_0x579a19[_0xf54b('0x24')]=qs[_0xf54b('0x24')](_0x16bb48[_0xf54b('0x38')][_0xf54b('0x24')]);_0x579a19[_0xf54b('0x23')]=qs[_0xf54b('0x23')](_0x16bb48['query']['offset']);}_0x579a19[_0xf54b('0x41')]=qs[_0xf54b('0x42')](_0x16bb48[_0xf54b('0x38')][_0xf54b('0x42')]);_0x579a19['where']=qs['filters'](_[_0xf54b('0x43')](_0x16bb48['query'],_0x30267e[_0xf54b('0x39')]));if(_0x16bb48[_0xf54b('0x38')]['filter']){_0x579a19[_0xf54b('0x44')]=_[_0xf54b('0x45')](_0x579a19['where'],{'$or':_['map'](_0x57f648,function(_0xfec782){if(_0xfec782['type'][_0xf54b('0x46')]!=='VIRTUAL'){var _0x17bb10={};_0x17bb10[_0xfec782[_0xf54b('0x47')]]={'$like':'%'+_0x16bb48[_0xf54b('0x38')]['filter']+'%'};return _0x17bb10;}})});}_0x579a19=_[_0xf54b('0x45')]({},_0x579a19,_0x16bb48[_0xf54b('0x48')]);var _0x4908d0={'where':_0x579a19['where']};return db[_0xf54b('0x35')][_0xf54b('0x22')](_0x4908d0)['then'](function(_0x26672c){_0x4ef666['count']=_0x26672c;if(_0x16bb48[_0xf54b('0x38')][_0xf54b('0x49')]){_0x579a19[_0xf54b('0x4a')]=[{'all':!![]}];}return db[_0xf54b('0x35')][_0xf54b('0x4b')](_0x579a19);})[_0xf54b('0x2b')](function(_0x21b1f4){_0x4ef666[_0xf54b('0x4c')]=_0x21b1f4;return _0x4ef666;})[_0xf54b('0x2b')](respondWithFilteredResult(_0x57f90f,_0x579a19))[_0xf54b('0x4d')](handleError(_0x57f90f,null));};exports[_0xf54b('0x4e')]=function(_0x523554,_0x1d7e50){var _0x47499c={'raw':![],'where':{'id':_0x523554[_0xf54b('0x4f')]['id']}},_0xad8ea6={};_0xad8ea6[_0xf54b('0x3a')]=_[_0xf54b('0x37')](db['Dashboard']['rawAttributes']);_0xad8ea6['query']=_[_0xf54b('0x37')](_0x523554[_0xf54b('0x38')]);_0xad8ea6[_0xf54b('0x39')]=_[_0xf54b('0x3c')](_0xad8ea6[_0xf54b('0x3a')],_0xad8ea6['query']);_0x47499c[_0xf54b('0x3b')]=_[_0xf54b('0x3c')](_0xad8ea6[_0xf54b('0x3a')],qs[_0xf54b('0x3d')](_0x523554[_0xf54b('0x38')][_0xf54b('0x3d')]));_0x47499c[_0xf54b('0x3b')]=_0x47499c[_0xf54b('0x3b')][_0xf54b('0x3e')]?_0x47499c[_0xf54b('0x3b')]:_0xad8ea6[_0xf54b('0x3a')];if(_0x523554[_0xf54b('0x38')][_0xf54b('0x49')]){_0x47499c['include']=[{'all':!![]}];}_0x47499c=_['merge']({},_0x47499c,_0x523554[_0xf54b('0x48')]);return db[_0xf54b('0x35')][_0xf54b('0x50')](_0x47499c)[_0xf54b('0x2b')](handleEntityNotFound(_0x1d7e50,null))[_0xf54b('0x2b')](respondWithResult(_0x1d7e50,null))[_0xf54b('0x4d')](handleError(_0x1d7e50,null));};exports[_0xf54b('0x51')]=function(_0x429b09,_0x2714aa){return db['Dashboard'][_0xf54b('0x51')](_0x429b09['body'],{})['then'](function(_0x346ab5){var _0x10ea82=_0x429b09['user'][_0xf54b('0x2d')]({'plain':!![]});if(!_0x10ea82)throw new Error(_0xf54b('0x52'));if(_0x10ea82[_0xf54b('0x53')]===_0xf54b('0x54')){var _0x1be22b=_0x346ab5[_0xf54b('0x2d')]({'plain':!![]});var _0x1cb57d=_0xf54b('0x2e');return db['UserProfileSection'][_0xf54b('0x50')]({'where':{'name':_0x1cb57d,'userProfileId':_0x10ea82['userProfileId']},'raw':!![]})[_0xf54b('0x2b')](function(_0x5a510c){if(_0x5a510c&&_0x5a510c[_0xf54b('0x55')]===0x0){return db[_0xf54b('0x2f')][_0xf54b('0x51')]({'name':_0x1be22b[_0xf54b('0x32')],'resourceId':_0x1be22b['id'],'type':_0x5a510c['name'],'sectionId':_0x5a510c['id']},{})[_0xf54b('0x2b')](function(){return _0x346ab5;});}else{return _0x346ab5;}})['catch'](function(_0x599b81){logger[_0xf54b('0x30')](_0xf54b('0x56'),_0x599b81);throw _0x599b81;});}return _0x346ab5;})[_0xf54b('0x2b')](respondWithResult(_0x2714aa,0xc9))[_0xf54b('0x4d')](handleError(_0x2714aa,null));};exports[_0xf54b('0x57')]=function(_0x523778,_0x590646){var _0x43ae50={'raw':![],'where':{'id':_0x523778[_0xf54b('0x4f')]['id']}},_0x4632f8={};_0x4632f8[_0xf54b('0x3a')]=_[_0xf54b('0x37')](db[_0xf54b('0x35')]['rawAttributes']);_0x43ae50['attributes']=_[_0xf54b('0x3c')](_0x4632f8[_0xf54b('0x3a')],qs[_0xf54b('0x3d')](_0x523778['query'][_0xf54b('0x3d')]));_0x43ae50['attributes']=_0x43ae50['attributes'][_0xf54b('0x3e')]?_0x43ae50[_0xf54b('0x3b')]:_0x4632f8[_0xf54b('0x3a')];if(_0x523778['query'][_0xf54b('0x49')]){_0x43ae50[_0xf54b('0x4a')]=[{'all':!![]}];}_0x43ae50=_['merge']({},_0x43ae50,_0x523778[_0xf54b('0x48')]);return db[_0xf54b('0x35')][_0xf54b('0x50')](_0x43ae50)[_0xf54b('0x2b')](handleEntityNotFound(_0x590646,null))[_0xf54b('0x2b')](function(_0x7ae24a){if(_0x7ae24a){var _0x40ed9e=_0x7ae24a['get']({'plain':!![]});_0x40ed9e=qs[_0xf54b('0x58')](_0x40ed9e,['id',_0xf54b('0x59'),'updatedAt']);_0x523778['body']=_[_0xf54b('0x58')](_0x523778[_0xf54b('0x5a')],['id','createdAt',_0xf54b('0x5b')]);return db[_0xf54b('0x35')][_0xf54b('0x51')](_['merge'](_0x40ed9e,_0x523778['body']),{'include':_0x523778[_0xf54b('0x38')][_0xf54b('0x49')]?[{'all':!![]}]:undefined})[_0xf54b('0x2b')](function(_0x278fc7){var _0x2f4a91=_0x523778[_0xf54b('0x54')][_0xf54b('0x2d')]({'plain':!![]});if(!_0x2f4a91)throw new Error(_0xf54b('0x52'));if(_0x2f4a91[_0xf54b('0x53')]==='user'){var _0x5cc45b=_0x278fc7[_0xf54b('0x2d')]({'plain':!![]});var _0x4de957=_0xf54b('0x2e');return db['UserProfileSection']['find']({'where':{'name':_0x4de957,'userProfileId':_0x2f4a91[_0xf54b('0x5c')]},'raw':!![]})[_0xf54b('0x2b')](function(_0x31ae28){if(_0x31ae28&&_0x31ae28['autoAssociation']===0x0){return db[_0xf54b('0x2f')][_0xf54b('0x51')]({'name':_0x5cc45b[_0xf54b('0x32')],'resourceId':_0x5cc45b['id'],'type':_0x31ae28[_0xf54b('0x32')],'sectionId':_0x31ae28['id']},{})[_0xf54b('0x2b')](function(){return _0x278fc7;});}else{return _0x278fc7;}})['catch'](function(_0x1a58b4){logger[_0xf54b('0x30')](_0xf54b('0x56'),_0x1a58b4);throw _0x1a58b4;});}return _0x278fc7;});}})[_0xf54b('0x2b')](respondWithResult(_0x590646,0xc9))[_0xf54b('0x4d')](handleError(_0x590646,null));};exports['update']=function(_0xbf79f1,_0x4f02ec){if(_0xbf79f1['body']['id']){delete _0xbf79f1[_0xf54b('0x5a')]['id'];}return db['Dashboard'][_0xf54b('0x50')]({'where':{'id':_0xbf79f1[_0xf54b('0x4f')]['id']}})[_0xf54b('0x2b')](handleEntityNotFound(_0x4f02ec,null))[_0xf54b('0x2b')](saveUpdates(_0xbf79f1['body'],null))[_0xf54b('0x2b')](respondWithResult(_0x4f02ec,null))['catch'](handleError(_0x4f02ec,null));};exports[_0xf54b('0x2c')]=function(_0x53b20e,_0x35ee24){return db[_0xf54b('0x35')][_0xf54b('0x50')]({'where':{'id':_0x53b20e[_0xf54b('0x4f')]['id']}})[_0xf54b('0x2b')](handleEntityNotFound(_0x35ee24,null))[_0xf54b('0x2b')](removeEntity(_0x35ee24,null))[_0xf54b('0x4d')](handleError(_0x35ee24,null));};function widgetAttributes(_0x2ae07b){try{switch(_0x2ae07b['type']){case'iframe':return[{'name':_0xf54b('0x5d'),'value':_0x2ae07b[_0xf54b('0x5d')]||(_0x2ae07b[_0xf54b('0x5e')]&&_0x2ae07b[_0xf54b('0x5e')][0x0]?_0x2ae07b[_0xf54b('0x5e')][0x0][_0xf54b('0x5f')]:undefined)||_0xf54b('0x60')}];case _0xf54b('0x61'):return[{'name':_0xf54b('0x62'),'value':_0x2ae07b['attrPath']||(_0x2ae07b[_0xf54b('0x5e')]&&_0x2ae07b['attrs'][0x0]?_0x2ae07b[_0xf54b('0x5e')][0x0][_0xf54b('0x5f')]:undefined)||''}];case _0xf54b('0x63'):return[{'name':_0xf54b('0x64'),'value':_0x2ae07b[_0xf54b('0x64')]||(_0x2ae07b['attrs']&&_0x2ae07b[_0xf54b('0x5e')][0x0]?_0x2ae07b[_0xf54b('0x5e')][0x0][_0xf54b('0x5f')]:undefined)||_0xf54b('0x65')},{'name':'attrTimezone','value':_0x2ae07b['attrTimezone']||(_0x2ae07b[_0xf54b('0x5e')]&&_0x2ae07b['attrs'][0x1]?_0x2ae07b[_0xf54b('0x5e')][0x1][_0xf54b('0x5f')]:undefined)||_0xf54b('0x66')},{'name':_0xf54b('0x67'),'value':_0x2ae07b[_0xf54b('0x67')]||(_0x2ae07b[_0xf54b('0x5e')]&&_0x2ae07b[_0xf54b('0x5e')][0x2]?_0x2ae07b[_0xf54b('0x5e')][0x2][_0xf54b('0x5f')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x2ae07b[_0xf54b('0x68')]||(_0x2ae07b['attrs']&&_0x2ae07b[_0xf54b('0x5e')][0x0]?_0x2ae07b[_0xf54b('0x5e')][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x2ae07b[_0xf54b('0x69')]||(_0x2ae07b['attrs']&&_0x2ae07b[_0xf54b('0x5e')][0x1]?_0x2ae07b['attrs'][0x1][_0xf54b('0x5f')]:undefined)||[]},{'name':_0xf54b('0x67'),'value':_0x2ae07b[_0xf54b('0x67')]||(_0x2ae07b[_0xf54b('0x5e')]&&_0x2ae07b[_0xf54b('0x5e')][0x2]?_0x2ae07b[_0xf54b('0x5e')][0x2][_0xf54b('0x5f')]:undefined)||0x14}];case _0xf54b('0x6a'):case'pie-chart':return[{'name':_0xf54b('0x6b'),'value':_0x2ae07b['attrSerie1']||(_0x2ae07b[_0xf54b('0x5e')]&&_0x2ae07b['attrs'][0x0]?_0x2ae07b[_0xf54b('0x5e')][0x0][_0xf54b('0x5f')]:undefined)||_0xf54b('0x6c')},{'name':'attrSerie2','value':_0x2ae07b['attrSerie2']||(_0x2ae07b['attrs']&&_0x2ae07b[_0xf54b('0x5e')][0x1]?_0x2ae07b[_0xf54b('0x5e')][0x1][_0xf54b('0x5f')]:undefined)||null},{'name':_0xf54b('0x6d'),'value':_0x2ae07b['attrSerie3']||(_0x2ae07b[_0xf54b('0x5e')]&&_0x2ae07b[_0xf54b('0x5e')][0x2]?_0x2ae07b[_0xf54b('0x5e')][0x2][_0xf54b('0x5f')]:undefined)||null},{'name':_0xf54b('0x69'),'value':_0x2ae07b['attrVoiceQueues']||(_0x2ae07b[_0xf54b('0x5e')]&&_0x2ae07b['attrs'][0x3]?_0x2ae07b[_0xf54b('0x5e')][0x3][_0xf54b('0x5f')]:undefined)||[]}];case _0xf54b('0x6e'):return[{'name':'attrReport','type':_0x2ae07b[_0xf54b('0x6f')]||(_0x2ae07b[_0xf54b('0x5e')]&&_0x2ae07b[_0xf54b('0x5e')][0x0]?_0x2ae07b[_0xf54b('0x5e')][0x0][_0xf54b('0x70')]:undefined)||null,'value':_0x2ae07b[_0xf54b('0x71')]||(_0x2ae07b['attrs']&&_0x2ae07b[_0xf54b('0x5e')][0x0]?_0x2ae07b[_0xf54b('0x5e')][0x0][_0xf54b('0x5f')]:undefined)||null},{'name':_0xf54b('0x72'),'value':_0x2ae07b[_0xf54b('0x72')]||(_0x2ae07b[_0xf54b('0x5e')]&&_0x2ae07b[_0xf54b('0x5e')][0x1]?_0x2ae07b[_0xf54b('0x5e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x59e7f6){logger[_0xf54b('0x30')](_0xf54b('0x73'),JSON[_0xf54b('0x74')](_0x59e7f6));return[];}}exports['addItem']=function(_0x222e24,_0x14cea9,_0x447190){if(_0x222e24['body']['id']){delete _0x222e24[_0xf54b('0x5a')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x222e24[_0xf54b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x14cea9,null))[_0xf54b('0x2b')](function(_0x2f2370){if(_0x2f2370){_0x222e24[_0xf54b('0x5a')]['DashboardId']=_0x2f2370['id'];_0x222e24[_0xf54b('0x5a')][_0xf54b('0x5e')]=widgetAttributes(_0x222e24[_0xf54b('0x5a')]);return db['DashboardItem']['create'](_0x222e24[_0xf54b('0x5a')]);}})[_0xf54b('0x2b')](respondWithResult(_0x14cea9,null))[_0xf54b('0x4d')](handleError(_0x14cea9,null));};exports[_0xf54b('0x75')]=function(_0x59e3af,_0x5729ed,_0x46d956){var _0x2be5b7={};var _0x4976e7={};var _0x517bb2;var _0x4930c9;return db['Dashboard'][_0xf54b('0x76')]({'where':{'id':_0x59e3af[_0xf54b('0x4f')]['id']}})[_0xf54b('0x2b')](handleEntityNotFound(_0x5729ed,null))[_0xf54b('0x2b')](function(_0xb3bc11){if(_0xb3bc11){_0x517bb2=_0xb3bc11;_0x4976e7[_0xf54b('0x3a')]=_[_0xf54b('0x37')](db[_0xf54b('0x77')][_0xf54b('0x36')]);_0x4976e7[_0xf54b('0x38')]=_['keys'](_0x59e3af[_0xf54b('0x38')]);_0x4976e7[_0xf54b('0x39')]=_['intersection'](_0x4976e7[_0xf54b('0x3a')],_0x4976e7[_0xf54b('0x38')]);_0x2be5b7[_0xf54b('0x3b')]=_[_0xf54b('0x3c')](_0x4976e7[_0xf54b('0x3a')],qs['fields'](_0x59e3af[_0xf54b('0x38')][_0xf54b('0x3d')]));_0x2be5b7[_0xf54b('0x3b')]=_0x2be5b7[_0xf54b('0x3b')][_0xf54b('0x3e')]?_0x2be5b7[_0xf54b('0x3b')]:_0x4976e7[_0xf54b('0x3a')];_0x2be5b7[_0xf54b('0x41')]=qs['sort'](_0x59e3af[_0xf54b('0x38')][_0xf54b('0x42')]);_0x2be5b7[_0xf54b('0x44')]=qs['filters'](_['pick'](_0x59e3af[_0xf54b('0x38')],_0x4976e7[_0xf54b('0x39')]));if(_0x59e3af[_0xf54b('0x38')][_0xf54b('0x78')]){_0x2be5b7[_0xf54b('0x44')]=_['merge'](_0x2be5b7[_0xf54b('0x44')],{'$or':_[_0xf54b('0x79')](_0x2be5b7[_0xf54b('0x3b')],function(_0x2d04ff){var _0x297cea={};_0x297cea[_0x2d04ff]={'$like':'%'+_0x59e3af[_0xf54b('0x38')][_0xf54b('0x78')]+'%'};return _0x297cea;})});}_0x2be5b7=_[_0xf54b('0x45')]({},_0x2be5b7,_0x59e3af[_0xf54b('0x48')]);return _0x517bb2[_0xf54b('0x75')](_0x2be5b7);}})[_0xf54b('0x2b')](function(_0x3c3c57){if(_0x3c3c57){_0x4930c9=_0x3c3c57[_0xf54b('0x3e')];if(!_0x59e3af[_0xf54b('0x38')][_0xf54b('0x3f')]('nolimit')){_0x2be5b7[_0xf54b('0x24')]=qs[_0xf54b('0x24')](_0x59e3af['query'][_0xf54b('0x24')]);_0x2be5b7['offset']=qs[_0xf54b('0x23')](_0x59e3af[_0xf54b('0x38')][_0xf54b('0x23')]);}return _0x517bb2[_0xf54b('0x75')](_0x2be5b7);}})[_0xf54b('0x2b')](function(_0xa423b4){if(_0xa423b4){return _0xa423b4?{'count':_0x4930c9,'rows':_0xa423b4}:null;}})[_0xf54b('0x2b')](respondWithResult(_0x5729ed,null))[_0xf54b('0x4d')](handleError(_0x5729ed,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 7391dee..55234a8 100644 --- a/server/api/dashboard/dashboard.events.js +++ b/server/api/dashboard/dashboard.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce06=['setMaxListeners','emit','exports','events','../../mysqldb','Dashboard'];(function(_0x54f179,_0x5e259d){var _0x25e3d7=function(_0x392ec4){while(--_0x392ec4){_0x54f179['push'](_0x54f179['shift']());}};_0x25e3d7(++_0x5e259d);}(_0xce06,0x15f));var _0x6ce0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xce06[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x6ce0('0x0'));var Dashboard=require(_0x6ce0('0x1'))['db'][_0x6ce0('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x6ce0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3d1122){return function(_0x32a669,_0x2c5861,_0x28f8da){DashboardEvents['emit'](_0x3d1122+':'+_0x32a669['id'],_0x32a669);DashboardEvents[_0x6ce0('0x4')](_0x3d1122,_0x32a669);_0x28f8da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x6ce0('0x5')]=DashboardEvents; \ No newline at end of file +var _0x44be=['hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save','emit'];(function(_0x178beb,_0x4f7709){var _0x5e8a18=function(_0x5aa66c){while(--_0x5aa66c){_0x178beb['push'](_0x178beb['shift']());}};_0x5e8a18(++_0x4f7709);}(_0x44be,0xed));var _0xe44b=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x44be[_0x178e48];return _0x440d7e;};'use strict';var EventEmitter=require(_0xe44b('0x0'));var Dashboard=require(_0xe44b('0x1'))['db'][_0xe44b('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xe44b('0x3')](0x0);var events={'afterCreate':_0xe44b('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xd9ecc7){return function(_0x24680b,_0x3619c4,_0x95b1d3){DashboardEvents[_0xe44b('0x5')](_0xd9ecc7+':'+_0x24680b['id'],_0x24680b);DashboardEvents[_0xe44b('0x5')](_0xd9ecc7,_0x24680b);_0x95b1d3(null);};}for(var e in events){if(events[_0xe44b('0x6')](e)){var event=events[e];Dashboard[_0xe44b('0x7')](e,emitEvent(event));}}module[_0xe44b('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index fe1d6e2..e35a52b 100644 --- a/server/api/dashboard/dashboard.model.js +++ b/server/api/dashboard/dashboard.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb217=['request-promise','path','rimraf','./dashboard.attributes','exports','define','dashboards','lodash','util','moment','bluebird'];(function(_0x2ba3f9,_0x158585){var _0xde7e33=function(_0x24076f){while(--_0x24076f){_0x2ba3f9['push'](_0x2ba3f9['shift']());}};_0xde7e33(++_0x158585);}(_0xb217,0x193));var _0x7b21=function(_0x8e67b2,_0x2c1ed7){_0x8e67b2=_0x8e67b2-0x0;var _0x454bf5=_0xb217[_0x8e67b2];return _0x454bf5;};'use strict';var _=require(_0x7b21('0x0'));var util=require(_0x7b21('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7b21('0x2'));var BPromise=require(_0x7b21('0x3'));var rp=require(_0x7b21('0x4'));var fs=require('fs');var path=require(_0x7b21('0x5'));var rimraf=require(_0x7b21('0x6'));var config=require('../../config/environment');var attributes=require(_0x7b21('0x7'));module[_0x7b21('0x8')]=function(_0x455807,_0x2f805a){return _0x455807[_0x7b21('0x9')]('Dashboard',attributes,{'tableName':_0x7b21('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9de6=['define','Dashboard','dashboards','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x9de6,0xb7));var _0x69de=function(_0x80f206,_0x5a5c93){_0x80f206=_0x80f206-0x0;var _0x17e558=_0x9de6[_0x80f206];return _0x17e558;};'use strict';var _=require(_0x69de('0x0'));var util=require(_0x69de('0x1'));var logger=require('../../config/logger')(_0x69de('0x2'));var moment=require(_0x69de('0x3'));var BPromise=require(_0x69de('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x69de('0x5'));var rimraf=require(_0x69de('0x6'));var config=require(_0x69de('0x7'));var attributes=require('./dashboard.attributes');module[_0x69de('0x8')]=function(_0x4d10cf,_0x3d6c72){return _0x4d10cf[_0x69de('0x9')](_0x69de('0xa'),attributes,{'tableName':_0x69de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index a7cc27c..b43a25f 100644 --- a/server/api/dashboard/dashboard.rpc.js +++ b/server/api/dashboard/dashboard.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9085=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','message','lodash'];(function(_0x1554e6,_0x28607d){var _0x4cafbf=function(_0x478aaf){while(--_0x478aaf){_0x1554e6['push'](_0x1554e6['shift']());}};_0x4cafbf(++_0x28607d);}(_0x9085,0x1c1));var _0x5908=function(_0xc298fe,_0x53be01){_0xc298fe=_0xc298fe-0x0;var _0x2096d3=_0x9085[_0xc298fe];return _0x2096d3;};'use strict';var _=require(_0x5908('0x0'));var util=require(_0x5908('0x1'));var moment=require(_0x5908('0x2'));var BPromise=require('bluebird');var rs=require(_0x5908('0x3'));var fs=require('fs');var Redis=require(_0x5908('0x4'));var db=require(_0x5908('0x5'))['db'];var utils=require(_0x5908('0x6'));var logger=require(_0x5908('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5908('0x8'));var client=jayson[_0x5908('0x9')][_0x5908('0xa')]({'port':0x232a});config[_0x5908('0xb')]=_[_0x5908('0xc')](config[_0x5908('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5908('0xd'))(new Redis(config[_0x5908('0xb')]));require(_0x5908('0xe'))[_0x5908('0xf')](socket);function respondWithRpcPromise(_0x113035,_0x25bfd8,_0x4529a0){return new BPromise(function(_0x11efdd,_0x1780be){return client[_0x5908('0x10')](_0x113035,_0x4529a0)[_0x5908('0x11')](function(_0x47eb06){logger[_0x5908('0x12')](_0x5908('0x13'),_0x25bfd8,_0x5908('0x14'));logger[_0x5908('0x15')](_0x5908('0x16'),_0x25bfd8,_0x5908('0x14'),JSON['stringify'](_0x47eb06));if(_0x47eb06[_0x5908('0x17')]){if(_0x47eb06[_0x5908('0x17')]['code']===0x1f4){logger[_0x5908('0x17')](_0x5908('0x13'),_0x25bfd8,_0x47eb06['error'][_0x5908('0x18')]);return _0x1780be(_0x47eb06[_0x5908('0x17')][_0x5908('0x18')]);}logger[_0x5908('0x17')](_0x5908('0x13'),_0x25bfd8,_0x47eb06[_0x5908('0x17')][_0x5908('0x18')]);return _0x11efdd(_0x47eb06[_0x5908('0x17')][_0x5908('0x18')]);}else{logger['info'](_0x5908('0x13'),_0x25bfd8,_0x5908('0x14'));_0x11efdd(_0x47eb06['result'][_0x5908('0x18')]);}})['catch'](function(_0x516845){logger[_0x5908('0x17')]('Dashboard,\x20%s,\x20%s',_0x25bfd8,_0x516845);_0x1780be(_0x516845);});});} \ No newline at end of file +var _0x0c81=['localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x10ff81,_0x15002e){var _0x49b5c9=function(_0x8f8b28){while(--_0x8f8b28){_0x10ff81['push'](_0x10ff81['shift']());}};_0x49b5c9(++_0x15002e);}(_0x0c81,0xd4));var _0x10c8=function(_0x1d69ba,_0x4090c9){_0x1d69ba=_0x1d69ba-0x0;var _0x8bab8c=_0x0c81[_0x1d69ba];return _0x8bab8c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x10c8('0x0'));var BPromise=require(_0x10c8('0x1'));var rs=require(_0x10c8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10c8('0x3'))['db'];var utils=require(_0x10c8('0x4'));var logger=require(_0x10c8('0x5'))(_0x10c8('0x6'));var config=require(_0x10c8('0x7'));var jayson=require(_0x10c8('0x8'));var client=jayson[_0x10c8('0x9')]['http']({'port':0x232a});config[_0x10c8('0xa')]=_[_0x10c8('0xb')](config['redis'],{'host':_0x10c8('0xc'),'port':0x18eb});var socket=require(_0x10c8('0xd'))(new Redis(config['redis']));require(_0x10c8('0xe'))[_0x10c8('0xf')](socket);function respondWithRpcPromise(_0x2c6ff4,_0x475c99,_0x508a95){return new BPromise(function(_0x3bad99,_0x2d7eec){return client[_0x10c8('0x10')](_0x2c6ff4,_0x508a95)[_0x10c8('0x11')](function(_0x337346){logger[_0x10c8('0x12')](_0x10c8('0x13'),_0x475c99,_0x10c8('0x14'));logger[_0x10c8('0x15')](_0x10c8('0x16'),_0x475c99,_0x10c8('0x14'),JSON[_0x10c8('0x17')](_0x337346));if(_0x337346[_0x10c8('0x18')]){if(_0x337346[_0x10c8('0x18')][_0x10c8('0x19')]===0x1f4){logger['error'](_0x10c8('0x13'),_0x475c99,_0x337346[_0x10c8('0x18')]['message']);return _0x2d7eec(_0x337346['error'][_0x10c8('0x1a')]);}logger[_0x10c8('0x18')](_0x10c8('0x13'),_0x475c99,_0x337346[_0x10c8('0x18')][_0x10c8('0x1a')]);return _0x3bad99(_0x337346[_0x10c8('0x18')][_0x10c8('0x1a')]);}else{logger[_0x10c8('0x12')](_0x10c8('0x13'),_0x475c99,_0x10c8('0x14'));_0x3bad99(_0x337346[_0x10c8('0x1b')][_0x10c8('0x1a')]);}})['catch'](function(_0x6f9c3a){logger[_0x10c8('0x18')](_0x10c8('0x13'),_0x475c99,_0x6f9c3a);_0x2d7eec(_0x6f9c3a);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index b6ac81c..659be09 100644 --- a/server/api/dashboard/dashboard.socket.js +++ b/server/api/dashboard/dashboard.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x216f=['register','length','dashboard:','save','update','emit','removeListener'];(function(_0x432f37,_0x3532ff){var _0x800eea=function(_0xad00b2){while(--_0xad00b2){_0x432f37['push'](_0x432f37['shift']());}};_0x800eea(++_0x3532ff);}(_0x216f,0xd5));var _0xf216=function(_0x4a8237,_0x380cad){_0x4a8237=_0x4a8237-0x0;var _0x2238cb=_0x216f[_0x4a8237];return _0x2238cb;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xf216('0x0'),'remove',_0xf216('0x1')];function createListener(_0x1e6a85,_0x519a32){return function(_0x50d8eb){_0x519a32[_0xf216('0x2')](_0x1e6a85,_0x50d8eb);};}function removeListener(_0x5df52d,_0x1906f9){return function(){DashboardEvents[_0xf216('0x3')](_0x5df52d,_0x1906f9);};}exports[_0xf216('0x4')]=function(_0x24f2cc){for(var _0x2228ec=0x0,_0x5afcf6=events[_0xf216('0x5')];_0x2228ec<_0x5afcf6;_0x2228ec++){var _0x38a04e=events[_0x2228ec];var _0x2f44a1=createListener(_0xf216('0x6')+_0x38a04e,_0x24f2cc);DashboardEvents['on'](_0x38a04e,_0x2f44a1);}}; \ No newline at end of file +var _0x5bb2=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener'];(function(_0x32531d,_0x5ef577){var _0x28d3cf=function(_0x205b6f){while(--_0x205b6f){_0x32531d['push'](_0x32531d['shift']());}};_0x28d3cf(++_0x5ef577);}(_0x5bb2,0x119));var _0x25bb=function(_0x1627e6,_0x3c75ce){_0x1627e6=_0x1627e6-0x0;var _0x42c5c3=_0x5bb2[_0x1627e6];return _0x42c5c3;};'use strict';var DashboardEvents=require(_0x25bb('0x0'));var events=[_0x25bb('0x1'),_0x25bb('0x2'),_0x25bb('0x3')];function createListener(_0x5aa2f6,_0x572ef8){return function(_0x1a043a){_0x572ef8[_0x25bb('0x4')](_0x5aa2f6,_0x1a043a);};}function removeListener(_0x1c7a43,_0x48a10c){return function(){DashboardEvents[_0x25bb('0x5')](_0x1c7a43,_0x48a10c);};}exports['register']=function(_0x9761ba){for(var _0x5b708f=0x0,_0x2376f5=events['length'];_0x5b708f<_0x2376f5;_0x5b708f++){var _0x5a2acd=events[_0x5b708f];var _0x12a1e4=createListener(_0x25bb('0x6')+_0x5a2acd,_0x9761ba);DashboardEvents['on'](_0x5a2acd,_0x12a1e4);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 78fd2ef..52f2df5 100644 --- a/server/api/dashboard/index.js +++ b/server/api/dashboard/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['addItem','put','update','delete','multer','path','express','../../components/auth/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','/:id/items','getItems','post','create','/:id/clone','clone'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb7e7[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xc')]);router['post'](_0x7b7e('0xd'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xe')]);router[_0x7b7e('0xb')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0x7'),auth['isAuthenticated'](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x12')]('/:id',auth[_0x7b7e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa9e0=['/:id','/:id/items','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x1e2352,_0x401fd8){var _0x4ae3ce=function(_0x249176){while(--_0x249176){_0x1e2352['push'](_0x1e2352['shift']());}};_0x4ae3ce(++_0x401fd8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getItems']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xb')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller['clone']);router['post']('/:id/items',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')]('/:id',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);module[_0x0a9e('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index f1ea805..18946fe 100644 --- a/server/api/dashboardItem/dashboardItem.attributes.js +++ b/server/api/dashboardItem/dashboardItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fdd=['setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','long','getDataValue','attrs'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x8fdd,0x7a));var _0xd8fd=function(_0x5650b4,_0x2723ba){_0x5650b4=_0x5650b4-0x0;var _0x297a62=_0x8fdd[_0x5650b4];return _0x297a62;};'use strict';var Sequelize=require(_0xd8fd('0x0'));var squel=require(_0xd8fd('0x1'));var _=require(_0xd8fd('0x2'));module[_0xd8fd('0x3')]={'title':{'type':Sequelize[_0xd8fd('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xd8fd('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xd8fd('0x5')),'get':function(){try{return JSON['parse'](this[_0xd8fd('0x6')](_0xd8fd('0x7')));}catch(_0x1cc9dc){return[];}},'set':function(_0x473cd0){try{this[_0xd8fd('0x8')]('attrs',JSON[_0xd8fd('0x9')](_0x473cd0));}catch(_0x27c0df){this[_0xd8fd('0x8')]('attrs',JSON[_0xd8fd('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xd8fd('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xd8fd('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xd8fd('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xd8fd('0x4')],'allowNull':![],'defaultValue':_0xd8fd('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd8fd('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xd8fd('0x4')]}}; \ No newline at end of file +var _0x1ea0=['#ffffff','#2196f3','sequelize','lodash','STRING','TEXT','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1ea0,0x1ba));var _0x01ea=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1ea0[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x01ea('0x0'));var squel=require('squel');var _=require(_0x01ea('0x1'));module['exports']={'title':{'type':Sequelize[_0x01ea('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x01ea('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x01ea('0x3')]('long'),'get':function(){try{return JSON['parse'](this[_0x01ea('0x4')](_0x01ea('0x5')));}catch(_0x545d46){return[];}},'set':function(_0x4e3fd2){try{this[_0x01ea('0x6')]('attrs',JSON['stringify'](_0x4e3fd2));}catch(_0x306e15){this[_0x01ea('0x6')](_0x01ea('0x5'),JSON[_0x01ea('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x01ea('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x01ea('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x01ea('0x8')]},'col':{'type':Sequelize[_0x01ea('0x8')]},'background':{'type':Sequelize[_0x01ea('0x2')],'allowNull':![],'defaultValue':_0x01ea('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x01ea('0x2')],'allowNull':![],'defaultValue':_0x01ea('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index bf770f3..7024111 100644 --- a/server/api/dashboardItem/dashboardItem.controller.js +++ b/server/api/dashboardItem/dashboardItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa45c=['type','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','reportType','widgetAttributes:\x20%s','stringify','create','body','html-pdf','eml-format','fast-json-patch','moment','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','show','params','keys','DashboardItem','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch'];(function(_0x35e388,_0x18d3f9){var _0x28f976=function(_0x5c9b73){while(--_0x5c9b73){_0x35e388['push'](_0x35e388['shift']());}};_0x28f976(++_0x18d3f9);}(_0xa45c,0x6d));var _0xca45=function(_0x129f83,_0x29cc9b){_0x129f83=_0x129f83-0x0;var _0x9ae907=_0xa45c[_0x129f83];return _0x9ae907;};'use strict';var pdf=require(_0xca45('0x0'));var emlformat=require(_0xca45('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xca45('0x2'));var rp=require('request-promise');var moment=require(_0xca45('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xca45('0x4'));var util=require('util');var path=require('path');var sox=require(_0xca45('0x5'));var csv=require(_0xca45('0x6'));var ejs=require(_0xca45('0x7'));var fs=require('fs');var _=require(_0xca45('0x8'));var squel=require('squel');var crypto=require(_0xca45('0x9'));var jsforce=require(_0xca45('0xa'));var deskjs=require(_0xca45('0xb'));var toCsv=require(_0xca45('0x6'));var querystring=require(_0xca45('0xc'));var Papa=require('papaparse');var Redis=require(_0xca45('0xd'));var authService=require(_0xca45('0xe'));var qs=require(_0xca45('0xf'));var hardwareService=require(_0xca45('0x10'));var logger=require(_0xca45('0x11'))(_0xca45('0x12'));var utils=require(_0xca45('0x13'));var config=require('../../config/environment');var db=require(_0xca45('0x14'))['db'];config[_0xca45('0x15')]=_[_0xca45('0x16')](config[_0xca45('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xca45('0x17'))(new Redis(config[_0xca45('0x15')]));require(_0xca45('0x18'))['register'](socket);function respondWithStatusCode(_0x214939,_0x569ba6){_0x569ba6=_0x569ba6||0xcc;return function(_0x22ce19){if(_0x22ce19){return _0x214939[_0xca45('0x19')](_0x569ba6);}return _0x214939[_0xca45('0x1a')](_0x569ba6)[_0xca45('0x1b')]();};}function respondWithResult(_0x35b130,_0x323b19){_0x323b19=_0x323b19||0xc8;return function(_0x18dd61){if(_0x18dd61){return _0x35b130['status'](_0x323b19)[_0xca45('0x1c')](_0x18dd61);}};}function respondWithFilteredResult(_0x5b4e29,_0x533853){return function(_0x213986){if(_0x213986){var _0x8d4b83=_0x213986['count'],_0x553af4=_0x533853[_0xca45('0x1d')],_0x2e18aa=_0x533853[_0xca45('0x1d')]+_0x533853[_0xca45('0x1e')],_0x184bbf;if(_0x2e18aa>=_0x8d4b83){_0x2e18aa=_0x8d4b83;_0x184bbf=0xc8;}else{_0x184bbf=0xce;}_0x5b4e29[_0xca45('0x1a')](_0x184bbf);return _0x5b4e29['set'](_0xca45('0x1f'),_0x553af4+'-'+_0x2e18aa+'/'+_0x8d4b83)[_0xca45('0x1c')](_0x213986);}return null;};}function patchUpdates(_0x1a16f1){return function(_0xdea7de){try{jsonpatch['apply'](_0xdea7de,_0x1a16f1,!![]);}catch(_0x2c0a39){return BPromise[_0xca45('0x20')](_0x2c0a39);}return _0xdea7de[_0xca45('0x21')]();};}function saveUpdates(_0x34bb8d,_0x2068df){return function(_0x3e8068){if(_0x3e8068){return _0x3e8068[_0xca45('0x22')](_0x34bb8d)[_0xca45('0x23')](function(_0x14cd25){return _0x14cd25;});}return null;};}function removeEntity(_0x4998b5,_0x3d9007){return function(_0x1acb89){if(_0x1acb89){return _0x1acb89[_0xca45('0x24')]()[_0xca45('0x23')](function(){_0x4998b5[_0xca45('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5927e2,_0x4d4869){return function(_0x28d9f1){if(!_0x28d9f1){_0x5927e2['sendStatus'](0x194);}return _0x28d9f1;};}function handleError(_0x5c36c7,_0x3547cd){_0x3547cd=_0x3547cd||0x1f4;return function(_0x3e3b03){logger[_0xca45('0x25')](_0x3e3b03[_0xca45('0x26')]);if(_0x3e3b03[_0xca45('0x27')]){delete _0x3e3b03['name'];}_0x5c36c7[_0xca45('0x1a')](_0x3547cd)[_0xca45('0x28')](_0x3e3b03);};}exports[_0xca45('0x29')]=function(_0x4d546c,_0x4da9b6){var _0x592ad2={'raw':![],'where':{'id':_0x4d546c[_0xca45('0x2a')]['id']}},_0x430591={};_0x430591['model']=_[_0xca45('0x2b')](db[_0xca45('0x2c')][_0xca45('0x2d')]);_0x430591[_0xca45('0x2e')]=_['keys'](_0x4d546c['query']);_0x430591['filters']=_[_0xca45('0x2f')](_0x430591['model'],_0x430591['query']);_0x592ad2['attributes']=_[_0xca45('0x2f')](_0x430591['model'],qs['fields'](_0x4d546c[_0xca45('0x2e')][_0xca45('0x30')]));_0x592ad2[_0xca45('0x31')]=_0x592ad2['attributes'][_0xca45('0x32')]?_0x592ad2[_0xca45('0x31')]:_0x430591['model'];if(_0x4d546c[_0xca45('0x2e')][_0xca45('0x33')]){_0x592ad2[_0xca45('0x34')]=[{'all':!![]}];}_0x592ad2=_[_0xca45('0x35')]({},_0x592ad2,_0x4d546c[_0xca45('0x36')]);return db[_0xca45('0x2c')][_0xca45('0x37')](_0x592ad2)[_0xca45('0x23')](handleEntityNotFound(_0x4da9b6,null))[_0xca45('0x23')](respondWithResult(_0x4da9b6,null))[_0xca45('0x38')](handleError(_0x4da9b6,null));};exports[_0xca45('0x24')]=function(_0x3045e7,_0x1d594c){return db['DashboardItem']['find']({'where':{'id':_0x3045e7['params']['id']}})[_0xca45('0x23')](handleEntityNotFound(_0x1d594c,null))[_0xca45('0x23')](removeEntity(_0x1d594c,null))['catch'](handleError(_0x1d594c,null));};function widgetAttributes(_0x5a8859){try{switch(_0x5a8859[_0xca45('0x39')]){case'iframe':return[{'name':_0xca45('0x3a'),'value':_0x5a8859['attrUrl']||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859[_0xca45('0x3b')][0x0]?_0x5a8859[_0xca45('0x3b')][0x0][_0xca45('0x3c')]:undefined)||_0xca45('0x3d')}];case'custom':return[{'name':_0xca45('0x3e'),'value':_0x5a8859['attrPath']||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859[_0xca45('0x3b')][0x0]?_0x5a8859[_0xca45('0x3b')][0x0][_0xca45('0x3c')]:undefined)||''}];case'clock':return[{'name':_0xca45('0x3f'),'value':_0x5a8859[_0xca45('0x3f')]||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859['attrs'][0x0]?_0x5a8859['attrs'][0x0][_0xca45('0x3c')]:undefined)||_0xca45('0x40')},{'name':_0xca45('0x41'),'value':_0x5a8859[_0xca45('0x41')]||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859[_0xca45('0x3b')][0x1]?_0x5a8859[_0xca45('0x3b')][0x1][_0xca45('0x3c')]:undefined)||_0xca45('0x42')},{'name':_0xca45('0x43'),'value':_0x5a8859[_0xca45('0x43')]||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859[_0xca45('0x3b')][0x2]?_0x5a8859[_0xca45('0x3b')][0x2][_0xca45('0x3c')]:undefined)||0xc}];case _0xca45('0x44'):return[{'name':_0xca45('0x45'),'value':_0x5a8859[_0xca45('0x45')]||(_0x5a8859['attrs']&&_0x5a8859[_0xca45('0x3b')][0x0]?_0x5a8859[_0xca45('0x3b')][0x0][_0xca45('0x3c')]:undefined)||'total'},{'name':_0xca45('0x46'),'value':_0x5a8859[_0xca45('0x46')]||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859[_0xca45('0x3b')][0x1]?_0x5a8859['attrs'][0x1][_0xca45('0x3c')]:undefined)||[]},{'name':_0xca45('0x43'),'value':_0x5a8859[_0xca45('0x43')]||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859[_0xca45('0x3b')][0x2]?_0x5a8859[_0xca45('0x3b')][0x2][_0xca45('0x3c')]:undefined)||0x14}];case _0xca45('0x47'):case _0xca45('0x48'):return[{'name':_0xca45('0x49'),'value':_0x5a8859[_0xca45('0x49')]||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859[_0xca45('0x3b')][0x0]?_0x5a8859[_0xca45('0x3b')][0x0][_0xca45('0x3c')]:undefined)||_0xca45('0x4a')},{'name':_0xca45('0x4b'),'value':_0x5a8859[_0xca45('0x4b')]||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859['attrs'][0x1]?_0x5a8859[_0xca45('0x3b')][0x1][_0xca45('0x3c')]:undefined)||null},{'name':_0xca45('0x4c'),'value':_0x5a8859[_0xca45('0x4c')]||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859[_0xca45('0x3b')][0x2]?_0x5a8859[_0xca45('0x3b')][0x2][_0xca45('0x3c')]:undefined)||null},{'name':_0xca45('0x46'),'value':_0x5a8859[_0xca45('0x46')]||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859[_0xca45('0x3b')][0x3]?_0x5a8859[_0xca45('0x3b')][0x3][_0xca45('0x3c')]:undefined)||[]}];case'web-report':return[{'name':_0xca45('0x4d'),'type':_0x5a8859[_0xca45('0x4e')]||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859[_0xca45('0x3b')][0x0]?_0x5a8859[_0xca45('0x3b')][0x0][_0xca45('0x39')]:undefined)||null,'value':_0x5a8859[_0xca45('0x4d')]||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859[_0xca45('0x3b')][0x0]?_0x5a8859[_0xca45('0x3b')][0x0][_0xca45('0x3c')]:undefined)||null},{'name':'attrRefresh','value':_0x5a8859['attrRefresh']||(_0x5a8859[_0xca45('0x3b')]&&_0x5a8859[_0xca45('0x3b')][0x1]?_0x5a8859['attrs'][0x1][_0xca45('0x3c')]:undefined)||0x0}];default:return[];}}catch(_0x1d8bbb){logger[_0xca45('0x25')](_0xca45('0x4f'),JSON[_0xca45('0x50')](_0x1d8bbb));return[];}}exports[_0xca45('0x51')]=function(_0x394202,_0x1c6984){if(_0x394202[_0xca45('0x52')]){_0x394202[_0xca45('0x52')][_0xca45('0x3b')]=widgetAttributes(_0x394202[_0xca45('0x52')]);}return db[_0xca45('0x2c')]['create'](_0x394202[_0xca45('0x52')],{})[_0xca45('0x23')](respondWithResult(_0x1c6984,0xc9))[_0xca45('0x38')](handleError(_0x1c6984,null));};exports[_0xca45('0x22')]=function(_0x44b7e1,_0x1e1bf7){if(_0x44b7e1[_0xca45('0x52')]['id']){delete _0x44b7e1[_0xca45('0x52')]['id'];}_0x44b7e1[_0xca45('0x52')]['attrs']=widgetAttributes(_0x44b7e1['body']);return db['DashboardItem']['find']({'where':{'id':_0x44b7e1[_0xca45('0x2a')]['id']}})[_0xca45('0x23')](handleEntityNotFound(_0x1e1bf7,null))[_0xca45('0x23')](saveUpdates(_0x44b7e1[_0xca45('0x52')],null))['then'](respondWithResult(_0x1e1bf7,null))[_0xca45('0x38')](handleError(_0x1e1bf7,null));}; \ No newline at end of file +var _0x7f3c=['DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','merge','options','find','catch','params','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','error','stringify','create','body','rimraf','fast-json-patch','moment','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','socket.io-emitter','redis','./dashboardItem.socket','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','show','model','keys'];(function(_0x179039,_0x1fb713){var _0xeb427=function(_0x307847){while(--_0x307847){_0x179039['push'](_0x179039['shift']());}};_0xeb427(++_0x1fb713);}(_0x7f3c,0x1d3));var _0xc7f3=function(_0x5244bc,_0xbeed11){_0x5244bc=_0x5244bc-0x0;var _0x3ae51c=_0x7f3c[_0x5244bc];return _0x3ae51c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xc7f3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc7f3('0x1'));var rp=require('request-promise');var moment=require(_0xc7f3('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc7f3('0x3'));var path=require(_0xc7f3('0x4'));var sox=require('sox');var csv=require(_0xc7f3('0x5'));var ejs=require(_0xc7f3('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc7f3('0x7'));var crypto=require('crypto');var jsforce=require(_0xc7f3('0x8'));var deskjs=require(_0xc7f3('0x9'));var toCsv=require(_0xc7f3('0x5'));var querystring=require(_0xc7f3('0xa'));var Papa=require(_0xc7f3('0xb'));var Redis=require(_0xc7f3('0xc'));var authService=require(_0xc7f3('0xd'));var qs=require(_0xc7f3('0xe'));var hardwareService=require(_0xc7f3('0xf'));var logger=require(_0xc7f3('0x10'))(_0xc7f3('0x11'));var utils=require(_0xc7f3('0x12'));var config=require('../../config/environment');var db=require(_0xc7f3('0x13'))['db'];config['redis']=_[_0xc7f3('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc7f3('0x15'))(new Redis(config[_0xc7f3('0x16')]));require(_0xc7f3('0x17'))['register'](socket);function respondWithStatusCode(_0x52334a,_0x5db434){_0x5db434=_0x5db434||0xcc;return function(_0x208b1b){if(_0x208b1b){return _0x52334a['sendStatus'](_0x5db434);}return _0x52334a[_0xc7f3('0x18')](_0x5db434)[_0xc7f3('0x19')]();};}function respondWithResult(_0x105111,_0x20c572){_0x20c572=_0x20c572||0xc8;return function(_0x3fcb89){if(_0x3fcb89){return _0x105111['status'](_0x20c572)[_0xc7f3('0x1a')](_0x3fcb89);}};}function respondWithFilteredResult(_0x15e234,_0x3db641){return function(_0x1206c9){if(_0x1206c9){var _0xebb408=_0x1206c9[_0xc7f3('0x1b')],_0x2e728c=_0x3db641['offset'],_0x5743ff=_0x3db641[_0xc7f3('0x1c')]+_0x3db641[_0xc7f3('0x1d')],_0x43f216;if(_0x5743ff>=_0xebb408){_0x5743ff=_0xebb408;_0x43f216=0xc8;}else{_0x43f216=0xce;}_0x15e234[_0xc7f3('0x18')](_0x43f216);return _0x15e234[_0xc7f3('0x1e')](_0xc7f3('0x1f'),_0x2e728c+'-'+_0x5743ff+'/'+_0xebb408)[_0xc7f3('0x1a')](_0x1206c9);}return null;};}function patchUpdates(_0x4efee9){return function(_0x265555){try{jsonpatch[_0xc7f3('0x20')](_0x265555,_0x4efee9,!![]);}catch(_0x5837cb){return BPromise[_0xc7f3('0x21')](_0x5837cb);}return _0x265555[_0xc7f3('0x22')]();};}function saveUpdates(_0x5f4b93,_0x19fed1){return function(_0xd2cad3){if(_0xd2cad3){return _0xd2cad3[_0xc7f3('0x23')](_0x5f4b93)[_0xc7f3('0x24')](function(_0x5daacb){return _0x5daacb;});}return null;};}function removeEntity(_0x3eb0b6,_0x3535fd){return function(_0x2e7fa8){if(_0x2e7fa8){return _0x2e7fa8[_0xc7f3('0x25')]()[_0xc7f3('0x24')](function(){_0x3eb0b6[_0xc7f3('0x18')](0xcc)[_0xc7f3('0x19')]();});}};}function handleEntityNotFound(_0x17190d,_0x2c3a02){return function(_0x120ffe){if(!_0x120ffe){_0x17190d['sendStatus'](0x194);}return _0x120ffe;};}function handleError(_0x237116,_0x17211f){_0x17211f=_0x17211f||0x1f4;return function(_0x1a9c65){logger['error'](_0x1a9c65[_0xc7f3('0x26')]);if(_0x1a9c65['name']){delete _0x1a9c65[_0xc7f3('0x27')];}_0x237116['status'](_0x17211f)['send'](_0x1a9c65);};}exports[_0xc7f3('0x28')]=function(_0x7fa34d,_0x1c32df){var _0x4bf6ac={'raw':![],'where':{'id':_0x7fa34d['params']['id']}},_0x5b5a5f={};_0x5b5a5f[_0xc7f3('0x29')]=_[_0xc7f3('0x2a')](db[_0xc7f3('0x2b')][_0xc7f3('0x2c')]);_0x5b5a5f['query']=_['keys'](_0x7fa34d[_0xc7f3('0x2d')]);_0x5b5a5f[_0xc7f3('0x2e')]=_['intersection'](_0x5b5a5f['model'],_0x5b5a5f['query']);_0x4bf6ac[_0xc7f3('0x2f')]=_[_0xc7f3('0x30')](_0x5b5a5f[_0xc7f3('0x29')],qs[_0xc7f3('0x31')](_0x7fa34d[_0xc7f3('0x2d')][_0xc7f3('0x31')]));_0x4bf6ac['attributes']=_0x4bf6ac[_0xc7f3('0x2f')][_0xc7f3('0x32')]?_0x4bf6ac[_0xc7f3('0x2f')]:_0x5b5a5f[_0xc7f3('0x29')];if(_0x7fa34d[_0xc7f3('0x2d')][_0xc7f3('0x33')]){_0x4bf6ac['include']=[{'all':!![]}];}_0x4bf6ac=_[_0xc7f3('0x34')]({},_0x4bf6ac,_0x7fa34d[_0xc7f3('0x35')]);return db['DashboardItem'][_0xc7f3('0x36')](_0x4bf6ac)[_0xc7f3('0x24')](handleEntityNotFound(_0x1c32df,null))[_0xc7f3('0x24')](respondWithResult(_0x1c32df,null))[_0xc7f3('0x37')](handleError(_0x1c32df,null));};exports[_0xc7f3('0x25')]=function(_0x1f74e5,_0x39d72a){return db[_0xc7f3('0x2b')]['find']({'where':{'id':_0x1f74e5[_0xc7f3('0x38')]['id']}})[_0xc7f3('0x24')](handleEntityNotFound(_0x39d72a,null))[_0xc7f3('0x24')](removeEntity(_0x39d72a,null))['catch'](handleError(_0x39d72a,null));};function widgetAttributes(_0x304dda){try{switch(_0x304dda['type']){case'iframe':return[{'name':_0xc7f3('0x39'),'value':_0x304dda[_0xc7f3('0x39')]||(_0x304dda['attrs']&&_0x304dda[_0xc7f3('0x3a')][0x0]?_0x304dda['attrs'][0x0][_0xc7f3('0x3b')]:undefined)||_0xc7f3('0x3c')}];case _0xc7f3('0x3d'):return[{'name':_0xc7f3('0x3e'),'value':_0x304dda[_0xc7f3('0x3e')]||(_0x304dda['attrs']&&_0x304dda['attrs'][0x0]?_0x304dda['attrs'][0x0][_0xc7f3('0x3b')]:undefined)||''}];case _0xc7f3('0x3f'):return[{'name':_0xc7f3('0x40'),'value':_0x304dda['attrHourFormat']||(_0x304dda['attrs']&&_0x304dda[_0xc7f3('0x3a')][0x0]?_0x304dda[_0xc7f3('0x3a')][0x0][_0xc7f3('0x3b')]:undefined)||_0xc7f3('0x41')},{'name':_0xc7f3('0x42'),'value':_0x304dda[_0xc7f3('0x42')]||(_0x304dda[_0xc7f3('0x3a')]&&_0x304dda[_0xc7f3('0x3a')][0x1]?_0x304dda[_0xc7f3('0x3a')][0x1]['value']:undefined)||'0.00'},{'name':_0xc7f3('0x43'),'value':_0x304dda['attrFontSize']||(_0x304dda[_0xc7f3('0x3a')]&&_0x304dda['attrs'][0x2]?_0x304dda[_0xc7f3('0x3a')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0xc7f3('0x44'),'value':_0x304dda[_0xc7f3('0x44')]||(_0x304dda[_0xc7f3('0x3a')]&&_0x304dda[_0xc7f3('0x3a')][0x0]?_0x304dda['attrs'][0x0][_0xc7f3('0x3b')]:undefined)||_0xc7f3('0x45')},{'name':_0xc7f3('0x46'),'value':_0x304dda['attrVoiceQueues']||(_0x304dda[_0xc7f3('0x3a')]&&_0x304dda['attrs'][0x1]?_0x304dda[_0xc7f3('0x3a')][0x1][_0xc7f3('0x3b')]:undefined)||[]},{'name':_0xc7f3('0x43'),'value':_0x304dda[_0xc7f3('0x43')]||(_0x304dda[_0xc7f3('0x3a')]&&_0x304dda[_0xc7f3('0x3a')][0x2]?_0x304dda[_0xc7f3('0x3a')][0x2]['value']:undefined)||0x14}];case _0xc7f3('0x47'):case _0xc7f3('0x48'):return[{'name':_0xc7f3('0x49'),'value':_0x304dda[_0xc7f3('0x49')]||(_0x304dda[_0xc7f3('0x3a')]&&_0x304dda['attrs'][0x0]?_0x304dda[_0xc7f3('0x3a')][0x0]['value']:undefined)||'total'},{'name':_0xc7f3('0x4a'),'value':_0x304dda[_0xc7f3('0x4a')]||(_0x304dda[_0xc7f3('0x3a')]&&_0x304dda[_0xc7f3('0x3a')][0x1]?_0x304dda[_0xc7f3('0x3a')][0x1][_0xc7f3('0x3b')]:undefined)||null},{'name':_0xc7f3('0x4b'),'value':_0x304dda[_0xc7f3('0x4b')]||(_0x304dda['attrs']&&_0x304dda[_0xc7f3('0x3a')][0x2]?_0x304dda[_0xc7f3('0x3a')][0x2][_0xc7f3('0x3b')]:undefined)||null},{'name':_0xc7f3('0x46'),'value':_0x304dda[_0xc7f3('0x46')]||(_0x304dda['attrs']&&_0x304dda['attrs'][0x3]?_0x304dda[_0xc7f3('0x3a')][0x3][_0xc7f3('0x3b')]:undefined)||[]}];case _0xc7f3('0x4c'):return[{'name':_0xc7f3('0x4d'),'type':_0x304dda[_0xc7f3('0x4e')]||(_0x304dda[_0xc7f3('0x3a')]&&_0x304dda[_0xc7f3('0x3a')][0x0]?_0x304dda[_0xc7f3('0x3a')][0x0][_0xc7f3('0x4f')]:undefined)||null,'value':_0x304dda[_0xc7f3('0x4d')]||(_0x304dda[_0xc7f3('0x3a')]&&_0x304dda['attrs'][0x0]?_0x304dda[_0xc7f3('0x3a')][0x0][_0xc7f3('0x3b')]:undefined)||null},{'name':_0xc7f3('0x50'),'value':_0x304dda[_0xc7f3('0x50')]||(_0x304dda['attrs']&&_0x304dda['attrs'][0x1]?_0x304dda[_0xc7f3('0x3a')][0x1][_0xc7f3('0x3b')]:undefined)||0x0}];default:return[];}}catch(_0x2fb3f5){logger[_0xc7f3('0x51')]('widgetAttributes:\x20%s',JSON[_0xc7f3('0x52')](_0x2fb3f5));return[];}}exports[_0xc7f3('0x53')]=function(_0x3b42fb,_0x5b1f50){if(_0x3b42fb[_0xc7f3('0x54')]){_0x3b42fb['body'][_0xc7f3('0x3a')]=widgetAttributes(_0x3b42fb[_0xc7f3('0x54')]);}return db['DashboardItem']['create'](_0x3b42fb[_0xc7f3('0x54')],{})[_0xc7f3('0x24')](respondWithResult(_0x5b1f50,0xc9))[_0xc7f3('0x37')](handleError(_0x5b1f50,null));};exports[_0xc7f3('0x23')]=function(_0x4b2d8a,_0x2283d1){if(_0x4b2d8a[_0xc7f3('0x54')]['id']){delete _0x4b2d8a[_0xc7f3('0x54')]['id'];}_0x4b2d8a[_0xc7f3('0x54')][_0xc7f3('0x3a')]=widgetAttributes(_0x4b2d8a['body']);return db['DashboardItem'][_0xc7f3('0x36')]({'where':{'id':_0x4b2d8a[_0xc7f3('0x38')]['id']}})['then'](handleEntityNotFound(_0x2283d1,null))[_0xc7f3('0x24')](saveUpdates(_0x4b2d8a[_0xc7f3('0x54')],null))[_0xc7f3('0x24')](respondWithResult(_0x2283d1,null))[_0xc7f3('0x37')](handleError(_0x2283d1,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 1a07d3b..45b5e7c 100644 --- a/server/api/dashboardItem/dashboardItem.events.js +++ b/server/api/dashboardItem/dashboardItem.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19cc=['hook','events','DashboardItem','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4327fe,_0x4f8040){var _0x138651=function(_0x418acc){while(--_0x418acc){_0x4327fe['push'](_0x4327fe['shift']());}};_0x138651(++_0x4f8040);}(_0x19cc,0x139));var _0xc19c=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x19cc[_0x1ca9e9];return _0x309f3c;};'use strict';var EventEmitter=require(_0xc19c('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xc19c('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc19c('0x2')](0x0);var events={'afterCreate':_0xc19c('0x3'),'afterUpdate':'update','afterDestroy':_0xc19c('0x4')};function emitEvent(_0x2e35cb){return function(_0x448ebe,_0x51b3b3,_0x111c32){DashboardItemEvents[_0xc19c('0x5')](_0x2e35cb+':'+_0x448ebe['id'],_0x448ebe);DashboardItemEvents[_0xc19c('0x5')](_0x2e35cb,_0x448ebe);_0x111c32(null);};}for(var e in events){if(events[_0xc19c('0x6')](e)){var event=events[e];DashboardItem[_0xc19c('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xb840=['hasOwnProperty','hook','exports','events','DashboardItem','setMaxListeners','update','emit'];(function(_0x139229,_0x236164){var _0xa15684=function(_0x107918){while(--_0x107918){_0x139229['push'](_0x139229['shift']());}};_0xa15684(++_0x236164);}(_0xb840,0xc3));var _0x0b84=function(_0x4c587a,_0x3bf54a){_0x4c587a=_0x4c587a-0x0;var _0x3e66fc=_0xb840[_0x4c587a];return _0x3e66fc;};'use strict';var EventEmitter=require(_0x0b84('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x0b84('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x0b84('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0b84('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1e9388){return function(_0x2c84df,_0x508ad7,_0x55713a){DashboardItemEvents[_0x0b84('0x4')](_0x1e9388+':'+_0x2c84df['id'],_0x2c84df);DashboardItemEvents['emit'](_0x1e9388,_0x2c84df);_0x55713a(null);};}for(var e in events){if(events[_0x0b84('0x5')](e)){var event=events[e];DashboardItem[_0x0b84('0x6')](e,emitEvent(event));}}module[_0x0b84('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 4fb37b4..0661729 100644 --- a/server/api/dashboardItem/dashboardItem.model.js +++ b/server/api/dashboardItem/dashboardItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd87=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xdd87,0xcf));var _0x7dd8=function(_0x6d7fc8,_0x5c8eed){_0x6d7fc8=_0x6d7fc8-0x0;var _0x3228ca=_0xdd87[_0x6d7fc8];return _0x3228ca;};'use strict';var _=require(_0x7dd8('0x0'));var util=require(_0x7dd8('0x1'));var logger=require(_0x7dd8('0x2'))('api');var moment=require(_0x7dd8('0x3'));var BPromise=require(_0x7dd8('0x4'));var rp=require(_0x7dd8('0x5'));var fs=require('fs');var path=require(_0x7dd8('0x6'));var rimraf=require(_0x7dd8('0x7'));var config=require('../../config/environment');var attributes=require(_0x7dd8('0x8'));module[_0x7dd8('0x9')]=function(_0x1f043d,_0xe8764a){return _0x1f043d[_0x7dd8('0xa')](_0x7dd8('0xb'),attributes,{'tableName':_0x7dd8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc614=['rimraf','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4bb305,_0x423939){var _0x116370=function(_0x5764f4){while(--_0x5764f4){_0x4bb305['push'](_0x4bb305['shift']());}};_0x116370(++_0x423939);}(_0xc614,0x1a7));var _0x4c61=function(_0x41392f,_0x4a02af){_0x41392f=_0x41392f-0x0;var _0x4227a7=_0xc614[_0x41392f];return _0x4227a7;};'use strict';var _=require(_0x4c61('0x0'));var util=require('util');var logger=require(_0x4c61('0x1'))(_0x4c61('0x2'));var moment=require(_0x4c61('0x3'));var BPromise=require(_0x4c61('0x4'));var rp=require(_0x4c61('0x5'));var fs=require('fs');var path=require(_0x4c61('0x6'));var rimraf=require(_0x4c61('0x7'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x4c61('0x8')]=function(_0x56b646,_0x11efcd){return _0x56b646[_0x4c61('0x9')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index b59caba..07ab24e 100644 --- a/server/api/dashboardItem/dashboardItem.rpc.js +++ b/server/api/dashboardItem/dashboardItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fa9=['jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x33bbf1,_0x3f7ddb){var _0x7cae01=function(_0x107b23){while(--_0x107b23){_0x33bbf1['push'](_0x33bbf1['shift']());}};_0x7cae01(++_0x3f7ddb);}(_0x5fa9,0x1ee));var _0x95fa=function(_0x32e6b9,_0x1ba001){_0x32e6b9=_0x32e6b9-0x0;var _0xd18132=_0x5fa9[_0x32e6b9];return _0xd18132;};'use strict';var _=require(_0x95fa('0x0'));var util=require(_0x95fa('0x1'));var moment=require(_0x95fa('0x2'));var BPromise=require(_0x95fa('0x3'));var rs=require(_0x95fa('0x4'));var fs=require('fs');var Redis=require(_0x95fa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x95fa('0x6'));var logger=require(_0x95fa('0x7'))(_0x95fa('0x8'));var config=require(_0x95fa('0x9'));var jayson=require(_0x95fa('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x95fa('0xb')]=_[_0x95fa('0xc')](config[_0x95fa('0xb')],{'host':_0x95fa('0xd'),'port':0x18eb});var socket=require(_0x95fa('0xe'))(new Redis(config['redis']));require(_0x95fa('0xf'))[_0x95fa('0x10')](socket);function respondWithRpcPromise(_0x497837,_0x15b2c7,_0x1094fa){return new BPromise(function(_0x82c677,_0xf6a358){return client['request'](_0x497837,_0x1094fa)[_0x95fa('0x11')](function(_0x180ef7){logger[_0x95fa('0x12')](_0x95fa('0x13'),_0x15b2c7,_0x95fa('0x14'));logger[_0x95fa('0x15')](_0x95fa('0x16'),_0x15b2c7,'request\x20sent',JSON[_0x95fa('0x17')](_0x180ef7));if(_0x180ef7[_0x95fa('0x18')]){if(_0x180ef7['error'][_0x95fa('0x19')]===0x1f4){logger[_0x95fa('0x18')]('DashboardItem,\x20%s,\x20%s',_0x15b2c7,_0x180ef7[_0x95fa('0x18')][_0x95fa('0x1a')]);return _0xf6a358(_0x180ef7[_0x95fa('0x18')][_0x95fa('0x1a')]);}logger[_0x95fa('0x18')](_0x95fa('0x13'),_0x15b2c7,_0x180ef7['error'][_0x95fa('0x1a')]);return _0x82c677(_0x180ef7[_0x95fa('0x18')][_0x95fa('0x1a')]);}else{logger[_0x95fa('0x12')]('DashboardItem,\x20%s,\x20%s',_0x15b2c7,'request\x20sent');_0x82c677(_0x180ef7[_0x95fa('0x1b')][_0x95fa('0x1a')]);}})['catch'](function(_0x3f93f3){logger[_0x95fa('0x18')]('DashboardItem,\x20%s,\x20%s',_0x15b2c7,_0x3f93f3);_0xf6a358(_0x3f93f3);});});} \ No newline at end of file +var _0x88ee=['info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','client','http','redis','socket.io-emitter','./dashboardItem.socket','request'];(function(_0x553579,_0x269bd9){var _0x156ea3=function(_0x3bd6bb){while(--_0x3bd6bb){_0x553579['push'](_0x553579['shift']());}};_0x156ea3(++_0x269bd9);}(_0x88ee,0x1ee));var _0xe88e=function(_0x2284ad,_0x29907d){_0x2284ad=_0x2284ad-0x0;var _0x2ed355=_0x88ee[_0x2284ad];return _0x2ed355;};'use strict';var _=require(_0xe88e('0x0'));var util=require('util');var moment=require(_0xe88e('0x1'));var BPromise=require('bluebird');var rs=require(_0xe88e('0x2'));var fs=require('fs');var Redis=require(_0xe88e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe88e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe88e('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe88e('0x6')][_0xe88e('0x7')]({'port':0x232a});config[_0xe88e('0x8')]=_['defaults'](config[_0xe88e('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xe88e('0x9'))(new Redis(config[_0xe88e('0x8')]));require(_0xe88e('0xa'))['register'](socket);function respondWithRpcPromise(_0x387af6,_0x5e84ae,_0x422c7e){return new BPromise(function(_0x345c8a,_0x1bead6){return client[_0xe88e('0xb')](_0x387af6,_0x422c7e)['then'](function(_0x37d876){logger[_0xe88e('0xc')](_0xe88e('0xd'),_0x5e84ae,_0xe88e('0xe'));logger[_0xe88e('0xf')](_0xe88e('0x10'),_0x5e84ae,_0xe88e('0xe'),JSON[_0xe88e('0x11')](_0x37d876));if(_0x37d876[_0xe88e('0x12')]){if(_0x37d876['error'][_0xe88e('0x13')]===0x1f4){logger[_0xe88e('0x12')]('DashboardItem,\x20%s,\x20%s',_0x5e84ae,_0x37d876[_0xe88e('0x12')][_0xe88e('0x14')]);return _0x1bead6(_0x37d876['error']['message']);}logger[_0xe88e('0x12')]('DashboardItem,\x20%s,\x20%s',_0x5e84ae,_0x37d876[_0xe88e('0x12')][_0xe88e('0x14')]);return _0x345c8a(_0x37d876['error'][_0xe88e('0x14')]);}else{logger['info'](_0xe88e('0xd'),_0x5e84ae,_0xe88e('0xe'));_0x345c8a(_0x37d876['result'][_0xe88e('0x14')]);}})[_0xe88e('0x15')](function(_0xef7f09){logger[_0xe88e('0x12')](_0xe88e('0xd'),_0x5e84ae,_0xef7f09);_0x1bead6(_0xef7f09);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index c8999e5..d332d2c 100644 --- a/server/api/dashboardItem/dashboardItem.socket.js +++ b/server/api/dashboardItem/dashboardItem.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa715=['./dashboardItem.events','save','remove','update','emit','removeListener','register','length'];(function(_0x440453,_0x4b3ce8){var _0x3a4513=function(_0xb286d3){while(--_0xb286d3){_0x440453['push'](_0x440453['shift']());}};_0x3a4513(++_0x4b3ce8);}(_0xa715,0x1d0));var _0x5a71=function(_0x7ccfa7,_0x2cbe4a){_0x7ccfa7=_0x7ccfa7-0x0;var _0x56d42e=_0xa715[_0x7ccfa7];return _0x56d42e;};'use strict';var DashboardItemEvents=require(_0x5a71('0x0'));var events=[_0x5a71('0x1'),_0x5a71('0x2'),_0x5a71('0x3')];function createListener(_0x4db4f3,_0x147a6b){return function(_0x9c3cab){_0x147a6b[_0x5a71('0x4')](_0x4db4f3,_0x9c3cab);};}function removeListener(_0x24fa6c,_0x500abf){return function(){DashboardItemEvents[_0x5a71('0x5')](_0x24fa6c,_0x500abf);};}exports[_0x5a71('0x6')]=function(_0x46c0a7){for(var _0x3e4318=0x0,_0x436add=events[_0x5a71('0x7')];_0x3e4318<_0x436add;_0x3e4318++){var _0x3c3652=events[_0x3e4318];var _0x2ca488=createListener('dashboardItem:'+_0x3c3652,_0x46c0a7);DashboardItemEvents['on'](_0x3c3652,_0x2ca488);}}; \ No newline at end of file +var _0x267a=['update','register','length','./dashboardItem.events','save'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0x267a,0xa3));var _0xa267=function(_0x38a6c6,_0x4062ca){_0x38a6c6=_0x38a6c6-0x0;var _0x142f0a=_0x267a[_0x38a6c6];return _0x142f0a;};'use strict';var DashboardItemEvents=require(_0xa267('0x0'));var events=[_0xa267('0x1'),'remove',_0xa267('0x2')];function createListener(_0x153ab0,_0x4ae68a){return function(_0xc7835e){_0x4ae68a['emit'](_0x153ab0,_0xc7835e);};}function removeListener(_0x15ef2f,_0x5d6e43){return function(){DashboardItemEvents['removeListener'](_0x15ef2f,_0x5d6e43);};}exports[_0xa267('0x3')]=function(_0x29b174){for(var _0x4ba8ab=0x0,_0x542568=events[_0xa267('0x4')];_0x4ba8ab<_0x542568;_0x4ba8ab++){var _0x25f250=events[_0x4ba8ab];var _0x245f11=createListener('dashboardItem:'+_0x25f250,_0x29b174);DashboardItemEvents['on'](_0x25f250,_0x245f11);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index a282941..3122412 100644 --- a/server/api/dashboardItem/index.js +++ b/server/api/dashboardItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post'];(function(_0x4da007,_0x5596c7){var _0x2be473=function(_0x3d3cae){while(--_0x3d3cae){_0x4da007['push'](_0x4da007['shift']());}};_0x2be473(++_0x5596c7);}(_0xf494,0x1c6));var _0x4f49=function(_0x435934,_0x170309){_0x435934=_0x435934-0x0;var _0x5c170e=_0xf494[_0x435934];return _0x5c170e;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var auth=require(_0x4f49('0x5'));var interaction=require(_0x4f49('0x6'));var config=require(_0x4f49('0x7'));var controller=require(_0x4f49('0x8'));router[_0x4f49('0x9')](_0x4f49('0xa'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0xe')](_0x4f49('0xa'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')](_0x4f49('0xa'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);module['exports']=router; \ No newline at end of file +var _0xba34=['get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./dashboardItem.controller'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xba34,0x119));var _0x4ba3=function(_0xd872b2,_0x599b1c){_0xd872b2=_0xd872b2-0x0;var _0xb2f5e5=_0xba34[_0xd872b2];return _0xb2f5e5;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ba3('0x5'));var controller=require(_0x4ba3('0x6'));router[_0x4ba3('0x7')](_0x4ba3('0x8'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0xb')]('/',auth['isAuthenticated'](),controller[_0x4ba3('0xc')]);router[_0x4ba3('0xd')](_0x4ba3('0x8'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xe')]);router[_0x4ba3('0xf')](_0x4ba3('0x8'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0x10')]);module[_0x4ba3('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index cd1f929..2ce88f7 100644 --- a/server/api/disposition/disposition.attributes.js +++ b/server/api/disposition/disposition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7d7=['STRING','sequelize','exports'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xa7d7,0x1e4));var _0x7a7d=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0xa7d7[_0x202d24];return _0x2b3a8e;};'use strict';var Sequelize=require(_0x7a7d('0x0'));module[_0x7a7d('0x1')]={'name':{'type':Sequelize[_0x7a7d('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4f9e=['sequelize','exports','STRING'];(function(_0x59bd2d,_0x307929){var _0x572487=function(_0x217fec){while(--_0x217fec){_0x59bd2d['push'](_0x59bd2d['shift']());}};_0x572487(++_0x307929);}(_0x4f9e,0x19e));var _0xe4f9=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0x4f9e[_0x352d28];return _0x387d7e;};'use strict';var Sequelize=require(_0xe4f9('0x0'));module[_0xe4f9('0x1')]={'name':{'type':Sequelize[_0xe4f9('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 27935cb..ada4f81 100644 --- a/server/api/disposition/disposition.controller.js +++ b/server/api/disposition/disposition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x430c=['sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','Disposition','count','include','findAll','rows','catch','show','params','includeAll','create','user','role','UserProfileSection','find','userProfileId','body','html-pdf','zip-dir','fast-json-patch','request-promise','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','save','update','destroy','then','get','Dispositions','UserProfileResource','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x4bc0a5,_0x3600d5){var _0x23e9af=function(_0x527605){while(--_0x527605){_0x4bc0a5['push'](_0x4bc0a5['shift']());}};_0x23e9af(++_0x3600d5);}(_0x430c,0x1a1));var _0xc430=function(_0x87506e,_0x5680ec){_0x87506e=_0x87506e-0x0;var _0x5496a4=_0x430c[_0x87506e];return _0x5496a4;};'use strict';var pdf=require(_0xc430('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc430('0x1'));var jsonpatch=require(_0xc430('0x2'));var rp=require(_0xc430('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc430('0x4'));var sox=require(_0xc430('0x5'));var csv=require('to-csv');var ejs=require(_0xc430('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0xb'));var querystring=require(_0xc430('0xc'));var Papa=require(_0xc430('0xd'));var Redis=require(_0xc430('0xe'));var authService=require(_0xc430('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc430('0x10'));var logger=require(_0xc430('0x11'))('api');var utils=require(_0xc430('0x12'));var config=require('../../config/environment');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x47e664,_0x2ce28a){_0x2ce28a=_0x2ce28a||0xcc;return function(_0x8aa2e6){if(_0x8aa2e6){return _0x47e664[_0xc430('0x14')](_0x2ce28a);}return _0x47e664[_0xc430('0x15')](_0x2ce28a)[_0xc430('0x16')]();};}function respondWithResult(_0x2777af,_0x2a3777){_0x2a3777=_0x2a3777||0xc8;return function(_0x54d851){if(_0x54d851){return _0x2777af['status'](_0x2a3777)[_0xc430('0x17')](_0x54d851);}};}function respondWithFilteredResult(_0x10e6a6,_0x17d5c8){return function(_0x2ef538){if(_0x2ef538){var _0x31d3b7=_0x2ef538['count'],_0x55cc6c=_0x17d5c8[_0xc430('0x18')],_0x111598=_0x17d5c8[_0xc430('0x18')]+_0x17d5c8[_0xc430('0x19')],_0x4aeb72;if(_0x111598>=_0x31d3b7){_0x111598=_0x31d3b7;_0x4aeb72=0xc8;}else{_0x4aeb72=0xce;}_0x10e6a6['status'](_0x4aeb72);return _0x10e6a6['set'](_0xc430('0x1a'),_0x55cc6c+'-'+_0x111598+'/'+_0x31d3b7)['json'](_0x2ef538);}return null;};}function patchUpdates(_0x2bcb21){return function(_0x4f7094){try{jsonpatch['apply'](_0x4f7094,_0x2bcb21,!![]);}catch(_0x2f3203){return BPromise['reject'](_0x2f3203);}return _0x4f7094[_0xc430('0x1b')]();};}function saveUpdates(_0x1eae3b,_0x3eb888){return function(_0x1f90bb){if(_0x1f90bb){return _0x1f90bb[_0xc430('0x1c')](_0x1eae3b)['then'](function(_0x388a2f){return _0x388a2f;});}return null;};}function removeEntity(_0x4d9dbf,_0x4d2d43){return function(_0x3b7c3d){if(_0x3b7c3d){return _0x3b7c3d[_0xc430('0x1d')]()[_0xc430('0x1e')](function(){var _0x56dd16=_0x3b7c3d[_0xc430('0x1f')]({'plain':!![]});var _0x57d26e=_0xc430('0x20');return db[_0xc430('0x21')]['destroy']({'where':{'type':_0x57d26e,'resourceId':_0x56dd16['id']}})[_0xc430('0x1e')](function(){return _0x3b7c3d;});})[_0xc430('0x1e')](function(){_0x4d9dbf['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x22')](_0x33433f[_0xc430('0x23')]);if(_0x33433f[_0xc430('0x24')]){delete _0x33433f[_0xc430('0x24')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x25')](_0x33433f);};}exports[_0xc430('0x26')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=db['Disposition'][_0xc430('0x27')];_0x1f8086[_0xc430('0x28')]=_[_0xc430('0x29')](_0x1d65ee);_0x1f8086[_0xc430('0x2a')]=_['keys'](_0x1c1da9[_0xc430('0x2a')]);_0x1f8086[_0xc430('0x2b')]=_[_0xc430('0x2c')](_0x1f8086[_0xc430('0x28')],_0x1f8086['query']);_0x542cba[_0xc430('0x2d')]=_[_0xc430('0x2c')](_0x1f8086['model'],qs[_0xc430('0x2e')](_0x1c1da9['query']['fields']));_0x542cba[_0xc430('0x2d')]=_0x542cba[_0xc430('0x2d')][_0xc430('0x2f')]?_0x542cba[_0xc430('0x2d')]:_0x1f8086[_0xc430('0x28')];if(!_0x1c1da9[_0xc430('0x2a')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba['limit']=qs[_0xc430('0x19')](_0x1c1da9['query'][_0xc430('0x19')]);_0x542cba[_0xc430('0x18')]=qs[_0xc430('0x18')](_0x1c1da9[_0xc430('0x2a')]['offset']);}_0x542cba[_0xc430('0x32')]=qs['sort'](_0x1c1da9['query'][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs['filters'](_[_0xc430('0x35')](_0x1c1da9[_0xc430('0x2a')],_0x1f8086[_0xc430('0x2b')]));if(_0x1c1da9[_0xc430('0x2a')][_0xc430('0x36')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x37')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x38')](_0x1d65ee,function(_0x7e18ec){if(_0x7e18ec[_0xc430('0x39')][_0xc430('0x3a')]!==_0xc430('0x3b')){var _0x283483={};_0x283483[_0x7e18ec[_0xc430('0x3c')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x36')]+'%'};return _0x283483;}})});}_0x542cba=_[_0xc430('0x37')]({},_0x542cba,_0x1c1da9[_0xc430('0x3d')]);var _0x8c163e={'where':_0x542cba['where']};return db[_0xc430('0x3e')][_0xc430('0x3f')](_0x8c163e)[_0xc430('0x1e')](function(_0x45b3dc){_0x4cf56c[_0xc430('0x3f')]=_0x45b3dc;if(_0x1c1da9[_0xc430('0x2a')]['includeAll']){_0x542cba[_0xc430('0x40')]=[{'all':!![]}];}return db[_0xc430('0x3e')][_0xc430('0x41')](_0x542cba);})[_0xc430('0x1e')](function(_0x1d156c){_0x4cf56c[_0xc430('0x42')]=_0x1d156c;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x43')](handleError(_0x1591e3,null));};exports[_0xc430('0x44')]=function(_0x4174d2,_0x31f32a){var _0xc9ad7d={'raw':!![],'where':{'id':_0x4174d2[_0xc430('0x45')]['id']}},_0x3bc969={};_0x3bc969['model']=_['keys'](db['Disposition'][_0xc430('0x27')]);_0x3bc969[_0xc430('0x2a')]=_[_0xc430('0x29')](_0x4174d2[_0xc430('0x2a')]);_0x3bc969[_0xc430('0x2b')]=_[_0xc430('0x2c')](_0x3bc969[_0xc430('0x28')],_0x3bc969[_0xc430('0x2a')]);_0xc9ad7d[_0xc430('0x2d')]=_[_0xc430('0x2c')](_0x3bc969[_0xc430('0x28')],qs[_0xc430('0x2e')](_0x4174d2[_0xc430('0x2a')][_0xc430('0x2e')]));_0xc9ad7d[_0xc430('0x2d')]=_0xc9ad7d[_0xc430('0x2d')]['length']?_0xc9ad7d[_0xc430('0x2d')]:_0x3bc969[_0xc430('0x28')];if(_0x4174d2[_0xc430('0x2a')][_0xc430('0x46')]){_0xc9ad7d[_0xc430('0x40')]=[{'all':!![]}];}_0xc9ad7d=_[_0xc430('0x37')]({},_0xc9ad7d,_0x4174d2[_0xc430('0x3d')]);return db[_0xc430('0x3e')]['find'](_0xc9ad7d)[_0xc430('0x1e')](handleEntityNotFound(_0x31f32a,null))['then'](respondWithResult(_0x31f32a,null))[_0xc430('0x43')](handleError(_0x31f32a,null));};exports[_0xc430('0x47')]=function(_0x5a704d,_0x5ce31b){return db[_0xc430('0x3e')]['create'](_0x5a704d['body'],{})[_0xc430('0x1e')](function(_0x4eafae){var _0x175f3f=_0x5a704d[_0xc430('0x48')][_0xc430('0x1f')]({'plain':!![]});if(!_0x175f3f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x175f3f[_0xc430('0x49')]===_0xc430('0x48')){var _0x19e563=_0x4eafae['get']({'plain':!![]});var _0x34fd8c=_0xc430('0x20');return db[_0xc430('0x4a')][_0xc430('0x4b')]({'where':{'name':_0x34fd8c,'userProfileId':_0x175f3f[_0xc430('0x4c')]},'raw':!![]})[_0xc430('0x1e')](function(_0x2975be){if(_0x2975be&&_0x2975be['autoAssociation']===0x0){return db[_0xc430('0x21')][_0xc430('0x47')]({'name':_0x19e563[_0xc430('0x24')],'resourceId':_0x19e563['id'],'type':_0x2975be['name'],'sectionId':_0x2975be['id']},{})[_0xc430('0x1e')](function(){return _0x4eafae;});}else{return _0x4eafae;}})[_0xc430('0x43')](function(_0x2d064b){logger[_0xc430('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d064b);throw _0x2d064b;});}return _0x4eafae;})[_0xc430('0x1e')](respondWithResult(_0x5ce31b,0xc9))['catch'](handleError(_0x5ce31b,null));};exports[_0xc430('0x1c')]=function(_0x214954,_0x2a5143){if(_0x214954[_0xc430('0x4d')]['id']){delete _0x214954[_0xc430('0x4d')]['id'];}return db[_0xc430('0x3e')]['find']({'where':{'id':_0x214954[_0xc430('0x45')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x2a5143,null))['then'](saveUpdates(_0x214954[_0xc430('0x4d')],null))[_0xc430('0x1e')](respondWithResult(_0x2a5143,null))[_0xc430('0x43')](handleError(_0x2a5143,null));};exports[_0xc430('0x1d')]=function(_0x5e361a,_0x23f2e9){return db['Disposition'][_0xc430('0x4b')]({'where':{'id':_0x5e361a[_0xc430('0x45')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x23f2e9,null))[_0xc430('0x1e')](removeEntity(_0x23f2e9,null))['catch'](handleError(_0x23f2e9,null));}; \ No newline at end of file +var _0x94d4=['role','Dispositions','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','key','VIRTUAL','field','options','Disposition','includeAll','include','catch','show','params','attributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0xe20d48,_0x11f1d0){var _0x1580e6=function(_0x43b82f){while(--_0x43b82f){_0xe20d48['push'](_0xe20d48['shift']());}};_0x1580e6(++_0x11f1d0);}(_0x94d4,0xa5));var _0x494d=function(_0xfeb26f,_0x53d9a7){_0xfeb26f=_0xfeb26f-0x0;var _0x1c43a4=_0x94d4[_0xfeb26f];return _0x1c43a4;};'use strict';var pdf=require(_0x494d('0x0'));var emlformat=require(_0x494d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x494d('0x2'));var jsonpatch=require(_0x494d('0x3'));var rp=require(_0x494d('0x4'));var moment=require('moment');var BPromise=require(_0x494d('0x5'));var Mustache=require(_0x494d('0x6'));var util=require(_0x494d('0x7'));var path=require(_0x494d('0x8'));var sox=require(_0x494d('0x9'));var csv=require(_0x494d('0xa'));var ejs=require(_0x494d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x494d('0xc'));var deskjs=require(_0x494d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x494d('0xe'));var Redis=require(_0x494d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x494d('0x10'));var hardwareService=require(_0x494d('0x11'));var logger=require(_0x494d('0x12'))(_0x494d('0x13'));var utils=require('../../config/utils');var config=require(_0x494d('0x14'));var db=require(_0x494d('0x15'))['db'];function respondWithStatusCode(_0x5155ac,_0x50c3db){_0x50c3db=_0x50c3db||0xcc;return function(_0x56fc3a){if(_0x56fc3a){return _0x5155ac[_0x494d('0x16')](_0x50c3db);}return _0x5155ac[_0x494d('0x17')](_0x50c3db)[_0x494d('0x18')]();};}function respondWithResult(_0x25f188,_0x3bc5c9){_0x3bc5c9=_0x3bc5c9||0xc8;return function(_0x2c89c9){if(_0x2c89c9){return _0x25f188[_0x494d('0x17')](_0x3bc5c9)[_0x494d('0x19')](_0x2c89c9);}};}function respondWithFilteredResult(_0x2fe493,_0x441d77){return function(_0x263405){if(_0x263405){var _0x5c2c67=_0x263405[_0x494d('0x1a')],_0x22f04f=_0x441d77[_0x494d('0x1b')],_0x215a65=_0x441d77[_0x494d('0x1b')]+_0x441d77[_0x494d('0x1c')],_0x2a2917;if(_0x215a65>=_0x5c2c67){_0x215a65=_0x5c2c67;_0x2a2917=0xc8;}else{_0x2a2917=0xce;}_0x2fe493[_0x494d('0x17')](_0x2a2917);return _0x2fe493[_0x494d('0x1d')](_0x494d('0x1e'),_0x22f04f+'-'+_0x215a65+'/'+_0x5c2c67)[_0x494d('0x19')](_0x263405);}return null;};}function patchUpdates(_0xd67ea4){return function(_0xb2fc39){try{jsonpatch[_0x494d('0x1f')](_0xb2fc39,_0xd67ea4,!![]);}catch(_0x20dd3d){return BPromise[_0x494d('0x20')](_0x20dd3d);}return _0xb2fc39[_0x494d('0x21')]();};}function saveUpdates(_0x5bf90b,_0x2be3b5){return function(_0x172763){if(_0x172763){return _0x172763[_0x494d('0x22')](_0x5bf90b)[_0x494d('0x23')](function(_0x4c2731){return _0x4c2731;});}return null;};}function removeEntity(_0x5ea684,_0x3eaf7e){return function(_0x15a532){if(_0x15a532){return _0x15a532['destroy']()['then'](function(){var _0x1b029b=_0x15a532['get']({'plain':!![]});var _0x1dec57='Dispositions';return db[_0x494d('0x24')][_0x494d('0x25')]({'where':{'type':_0x1dec57,'resourceId':_0x1b029b['id']}})['then'](function(){return _0x15a532;});})[_0x494d('0x23')](function(){_0x5ea684[_0x494d('0x17')](0xcc)[_0x494d('0x18')]();});}};}function handleEntityNotFound(_0x2ab88b,_0x1120c9){return function(_0x575f07){if(!_0x575f07){_0x2ab88b[_0x494d('0x16')](0x194);}return _0x575f07;};}function handleError(_0x178444,_0x4a8356){_0x4a8356=_0x4a8356||0x1f4;return function(_0x5d8d88){logger[_0x494d('0x26')](_0x5d8d88[_0x494d('0x27')]);if(_0x5d8d88[_0x494d('0x28')]){delete _0x5d8d88[_0x494d('0x28')];}_0x178444[_0x494d('0x17')](_0x4a8356)[_0x494d('0x29')](_0x5d8d88);};}exports[_0x494d('0x2a')]=function(_0x347c58,_0x213939){var _0x2d9615={},_0x1a8d4b={},_0x44f757={'count':0x0,'rows':[]};var _0x5f0318=db['Disposition'][_0x494d('0x2b')];_0x1a8d4b[_0x494d('0x2c')]=_[_0x494d('0x2d')](_0x5f0318);_0x1a8d4b[_0x494d('0x2e')]=_[_0x494d('0x2d')](_0x347c58[_0x494d('0x2e')]);_0x1a8d4b[_0x494d('0x2f')]=_[_0x494d('0x30')](_0x1a8d4b[_0x494d('0x2c')],_0x1a8d4b[_0x494d('0x2e')]);_0x2d9615['attributes']=_[_0x494d('0x30')](_0x1a8d4b[_0x494d('0x2c')],qs['fields'](_0x347c58[_0x494d('0x2e')][_0x494d('0x31')]));_0x2d9615['attributes']=_0x2d9615['attributes'][_0x494d('0x32')]?_0x2d9615['attributes']:_0x1a8d4b[_0x494d('0x2c')];if(!_0x347c58[_0x494d('0x2e')][_0x494d('0x33')](_0x494d('0x34'))){_0x2d9615['limit']=qs['limit'](_0x347c58[_0x494d('0x2e')][_0x494d('0x1c')]);_0x2d9615[_0x494d('0x1b')]=qs['offset'](_0x347c58['query'][_0x494d('0x1b')]);}_0x2d9615[_0x494d('0x35')]=qs['sort'](_0x347c58[_0x494d('0x2e')][_0x494d('0x36')]);_0x2d9615[_0x494d('0x37')]=qs['filters'](_['pick'](_0x347c58['query'],_0x1a8d4b[_0x494d('0x2f')]));if(_0x347c58['query']['filter']){_0x2d9615[_0x494d('0x37')]=_[_0x494d('0x38')](_0x2d9615[_0x494d('0x37')],{'$or':_[_0x494d('0x39')](_0x5f0318,function(_0x2080ef){if(_0x2080ef['type'][_0x494d('0x3a')]!==_0x494d('0x3b')){var _0x29439f={};_0x29439f[_0x2080ef[_0x494d('0x3c')]]={'$like':'%'+_0x347c58[_0x494d('0x2e')]['filter']+'%'};return _0x29439f;}})});}_0x2d9615=_[_0x494d('0x38')]({},_0x2d9615,_0x347c58[_0x494d('0x3d')]);var _0x5a54b8={'where':_0x2d9615[_0x494d('0x37')]};return db[_0x494d('0x3e')][_0x494d('0x1a')](_0x5a54b8)['then'](function(_0x33545c){_0x44f757[_0x494d('0x1a')]=_0x33545c;if(_0x347c58['query'][_0x494d('0x3f')]){_0x2d9615[_0x494d('0x40')]=[{'all':!![]}];}return db[_0x494d('0x3e')]['findAll'](_0x2d9615);})['then'](function(_0x2e4454){_0x44f757['rows']=_0x2e4454;return _0x44f757;})[_0x494d('0x23')](respondWithFilteredResult(_0x213939,_0x2d9615))[_0x494d('0x41')](handleError(_0x213939,null));};exports[_0x494d('0x42')]=function(_0x5ce269,_0x3a9a30){var _0x2c7208={'raw':!![],'where':{'id':_0x5ce269[_0x494d('0x43')]['id']}},_0x5cac99={};_0x5cac99[_0x494d('0x2c')]=_['keys'](db[_0x494d('0x3e')][_0x494d('0x2b')]);_0x5cac99['query']=_[_0x494d('0x2d')](_0x5ce269[_0x494d('0x2e')]);_0x5cac99[_0x494d('0x2f')]=_[_0x494d('0x30')](_0x5cac99['model'],_0x5cac99[_0x494d('0x2e')]);_0x2c7208[_0x494d('0x44')]=_[_0x494d('0x30')](_0x5cac99[_0x494d('0x2c')],qs['fields'](_0x5ce269['query'][_0x494d('0x31')]));_0x2c7208[_0x494d('0x44')]=_0x2c7208['attributes'][_0x494d('0x32')]?_0x2c7208[_0x494d('0x44')]:_0x5cac99[_0x494d('0x2c')];if(_0x5ce269['query']['includeAll']){_0x2c7208[_0x494d('0x40')]=[{'all':!![]}];}_0x2c7208=_[_0x494d('0x38')]({},_0x2c7208,_0x5ce269[_0x494d('0x3d')]);return db[_0x494d('0x3e')][_0x494d('0x45')](_0x2c7208)[_0x494d('0x23')](handleEntityNotFound(_0x3a9a30,null))[_0x494d('0x23')](respondWithResult(_0x3a9a30,null))[_0x494d('0x41')](handleError(_0x3a9a30,null));};exports[_0x494d('0x46')]=function(_0xcc60c2,_0x54cf30){return db[_0x494d('0x3e')]['create'](_0xcc60c2[_0x494d('0x47')],{})[_0x494d('0x23')](function(_0x184027){var _0x284e64=_0xcc60c2[_0x494d('0x48')][_0x494d('0x49')]({'plain':!![]});if(!_0x284e64)throw new Error(_0x494d('0x4a'));if(_0x284e64[_0x494d('0x4b')]==='user'){var _0x20170d=_0x184027[_0x494d('0x49')]({'plain':!![]});var _0x18bb3b=_0x494d('0x4c');return db[_0x494d('0x4d')]['find']({'where':{'name':_0x18bb3b,'userProfileId':_0x284e64['userProfileId']},'raw':!![]})[_0x494d('0x23')](function(_0x57f392){if(_0x57f392&&_0x57f392[_0x494d('0x4e')]===0x0){return db[_0x494d('0x24')][_0x494d('0x46')]({'name':_0x20170d[_0x494d('0x28')],'resourceId':_0x20170d['id'],'type':_0x57f392['name'],'sectionId':_0x57f392['id']},{})[_0x494d('0x23')](function(){return _0x184027;});}else{return _0x184027;}})[_0x494d('0x41')](function(_0x529e3b){logger[_0x494d('0x26')](_0x494d('0x4f'),_0x529e3b);throw _0x529e3b;});}return _0x184027;})[_0x494d('0x23')](respondWithResult(_0x54cf30,0xc9))[_0x494d('0x41')](handleError(_0x54cf30,null));};exports[_0x494d('0x22')]=function(_0x305c34,_0x168049){if(_0x305c34[_0x494d('0x47')]['id']){delete _0x305c34['body']['id'];}return db['Disposition'][_0x494d('0x45')]({'where':{'id':_0x305c34['params']['id']}})['then'](handleEntityNotFound(_0x168049,null))[_0x494d('0x23')](saveUpdates(_0x305c34[_0x494d('0x47')],null))[_0x494d('0x23')](respondWithResult(_0x168049,null))[_0x494d('0x41')](handleError(_0x168049,null));};exports[_0x494d('0x25')]=function(_0x159960,_0x59e747){return db[_0x494d('0x3e')][_0x494d('0x45')]({'where':{'id':_0x159960[_0x494d('0x43')]['id']}})['then'](handleEntityNotFound(_0x59e747,null))[_0x494d('0x23')](removeEntity(_0x59e747,null))[_0x494d('0x41')](handleError(_0x59e747,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 8d958f7..c0986b0 100644 --- a/server/api/disposition/disposition.model.js +++ b/server/api/disposition/disposition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x260e=['name_sms','SmsAccountId','name_fax','name_openchannel','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId'];(function(_0xbc3e62,_0x341141){var _0x27f98f=function(_0x96eccc){while(--_0x96eccc){_0xbc3e62['push'](_0xbc3e62['shift']());}};_0x27f98f(++_0x341141);}(_0x260e,0x1b9));var _0xe260=function(_0x389104,_0x324453){_0x389104=_0x389104-0x0;var _0x1cd87b=_0x260e[_0x389104];return _0x1cd87b;};'use strict';var _=require(_0xe260('0x0'));var util=require(_0xe260('0x1'));var logger=require(_0xe260('0x2'))(_0xe260('0x3'));var moment=require(_0xe260('0x4'));var BPromise=require(_0xe260('0x5'));var rp=require(_0xe260('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe260('0x7'));var config=require(_0xe260('0x8'));var attributes=require(_0xe260('0x9'));module[_0xe260('0xa')]=function(_0x5dfb93,_0x1e44c1){return _0x5dfb93[_0xe260('0xb')](_0xe260('0xc'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xe260('0xd'),'fields':[_0xe260('0xe'),_0xe260('0xf')]},{'unique':!![],'name':_0xe260('0x10'),'fields':[_0xe260('0xe'),_0xe260('0x11')]},{'unique':!![],'name':'name_mail','fields':[_0xe260('0xe'),_0xe260('0x12')]},{'unique':!![],'name':_0xe260('0x13'),'fields':[_0xe260('0xe'),_0xe260('0x14')]},{'unique':!![],'name':_0xe260('0x15'),'fields':[_0xe260('0xe'),'FaxAccountId']},{'unique':!![],'name':_0xe260('0x16'),'fields':[_0xe260('0xe'),'OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2e3d=['define','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./disposition.attributes','exports'];(function(_0x5e58b2,_0x1b7ed4){var _0x4facd0=function(_0x58d136){while(--_0x58d136){_0x5e58b2['push'](_0x5e58b2['shift']());}};_0x4facd0(++_0x1b7ed4);}(_0x2e3d,0xe8));var _0xd2e3=function(_0x443c6f,_0x5cec0d){_0x443c6f=_0x443c6f-0x0;var _0x309124=_0x2e3d[_0x443c6f];return _0x309124;};'use strict';var _=require(_0xd2e3('0x0'));var util=require(_0xd2e3('0x1'));var logger=require(_0xd2e3('0x2'))(_0xd2e3('0x3'));var moment=require(_0xd2e3('0x4'));var BPromise=require(_0xd2e3('0x5'));var rp=require(_0xd2e3('0x6'));var fs=require('fs');var path=require(_0xd2e3('0x7'));var rimraf=require(_0xd2e3('0x8'));var config=require('../../config/environment');var attributes=require(_0xd2e3('0x9'));module[_0xd2e3('0xa')]=function(_0x5cad6e,_0x4ca6df){return _0x5cad6e[_0xd2e3('0xb')](_0xd2e3('0xc'),attributes,{'tableName':_0xd2e3('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xd2e3('0xe'),'fields':['name',_0xd2e3('0xf')]},{'unique':!![],'name':_0xd2e3('0x10'),'fields':[_0xd2e3('0x11'),_0xd2e3('0x12')]},{'unique':!![],'name':_0xd2e3('0x13'),'fields':['name',_0xd2e3('0x14')]},{'unique':!![],'name':_0xd2e3('0x15'),'fields':[_0xd2e3('0x11'),_0xd2e3('0x16')]},{'unique':!![],'name':_0xd2e3('0x17'),'fields':[_0xd2e3('0x11'),_0xd2e3('0x18')]},{'unique':!![],'name':_0xd2e3('0x19'),'fields':['name',_0xd2e3('0x1a')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 8a76e91..5e33cd5 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3828=['catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1cfea3,_0x1ba651){var _0x34ab68=function(_0x5084c1){while(--_0x5084c1){_0x1cfea3['push'](_0x1cfea3['shift']());}};_0x34ab68(++_0x1ba651);}(_0x3828,0xa9));var _0x8382=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3828[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x8382('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8382('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8382('0x2'))['db'];var utils=require(_0x8382('0x3'));var logger=require(_0x8382('0x4'))(_0x8382('0x5'));var config=require(_0x8382('0x6'));var jayson=require(_0x8382('0x7'));var client=jayson[_0x8382('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24308,_0x55ff7c,_0x3def97){return new BPromise(function(_0x1ccdb7,_0x273354){return client[_0x8382('0x9')](_0x24308,_0x3def97)[_0x8382('0xa')](function(_0xe9e226){logger[_0x8382('0xb')](_0x8382('0xc'),_0x55ff7c,_0x8382('0xd'));logger[_0x8382('0xe')](_0x8382('0xf'),_0x55ff7c,_0x8382('0xd'),JSON[_0x8382('0x10')](_0xe9e226));if(_0xe9e226[_0x8382('0x11')]){if(_0xe9e226[_0x8382('0x11')][_0x8382('0x12')]===0x1f4){logger[_0x8382('0x11')](_0x8382('0xc'),_0x55ff7c,_0xe9e226['error'][_0x8382('0x13')]);return _0x273354(_0xe9e226[_0x8382('0x11')][_0x8382('0x13')]);}logger[_0x8382('0x11')](_0x8382('0xc'),_0x55ff7c,_0xe9e226[_0x8382('0x11')][_0x8382('0x13')]);return _0x1ccdb7(_0xe9e226['error'][_0x8382('0x13')]);}else{logger[_0x8382('0xb')](_0x8382('0xc'),_0x55ff7c,_0x8382('0xd'));_0x1ccdb7(_0xe9e226['result'][_0x8382('0x13')]);}})[_0x8382('0x14')](function(_0x216b00){logger[_0x8382('0x11')](_0x8382('0xc'),_0x55ff7c,_0x216b00);_0x273354(_0x216b00);});});} \ No newline at end of file +var _0x418b=['request','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x418b,0xfe));var _0xb418=function(_0x120ad2,_0x49de58){_0x120ad2=_0x120ad2-0x0;var _0x1e9994=_0x418b[_0x120ad2];return _0x1e9994;};'use strict';var _=require(_0xb418('0x0'));var util=require(_0xb418('0x1'));var moment=require(_0xb418('0x2'));var BPromise=require(_0xb418('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb418('0x4'));var db=require(_0xb418('0x5'))['db'];var utils=require(_0xb418('0x6'));var logger=require('../../config/logger')(_0xb418('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb418('0x8')][_0xb418('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49a3d5,_0x3e5da4,_0x4e2a3d){return new BPromise(function(_0x375f89,_0x525ff4){return client[_0xb418('0xa')](_0x49a3d5,_0x4e2a3d)['then'](function(_0x2def2c){logger[_0xb418('0xb')](_0xb418('0xc'),_0x3e5da4,_0xb418('0xd'));logger[_0xb418('0xe')](_0xb418('0xf'),_0x3e5da4,'request\x20sent',JSON[_0xb418('0x10')](_0x2def2c));if(_0x2def2c[_0xb418('0x11')]){if(_0x2def2c[_0xb418('0x11')][_0xb418('0x12')]===0x1f4){logger[_0xb418('0x11')](_0xb418('0xc'),_0x3e5da4,_0x2def2c['error'][_0xb418('0x13')]);return _0x525ff4(_0x2def2c['error']['message']);}logger[_0xb418('0x11')](_0xb418('0xc'),_0x3e5da4,_0x2def2c[_0xb418('0x11')][_0xb418('0x13')]);return _0x375f89(_0x2def2c[_0xb418('0x11')]['message']);}else{logger[_0xb418('0xb')]('Disposition,\x20%s,\x20%s',_0x3e5da4,_0xb418('0xd'));_0x375f89(_0x2def2c[_0xb418('0x14')]['message']);}})[_0xb418('0x15')](function(_0x33c965){logger[_0xb418('0x11')](_0xb418('0xc'),_0x3e5da4,_0x33c965);_0x525ff4(_0x33c965);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 2eac58b..2b9249d 100644 --- a/server/api/disposition/index.js +++ b/server/api/disposition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x988c=['Router','../../components/auth/service','get','isAuthenticated','index','/:id','create','put','delete','destroy','exports','multer','express'];(function(_0x1ad049,_0x59e9a0){var _0x5c0942=function(_0x9f2cfc){while(--_0x9f2cfc){_0x1ad049['push'](_0x1ad049['shift']());}};_0x5c0942(++_0x59e9a0);}(_0x988c,0x19e));var _0xc988=function(_0x526bda,_0xf8cbcf){_0x526bda=_0x526bda-0x0;var _0x4cea63=_0x988c[_0x526bda];return _0x4cea63;};'use strict';var multer=require(_0xc988('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc988('0x1'));var router=express[_0xc988('0x2')]();var auth=require(_0xc988('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0xc988('0x4')]('/',auth[_0xc988('0x5')](),controller[_0xc988('0x6')]);router['get'](_0xc988('0x7'),auth[_0xc988('0x5')](),controller['show']);router['post']('/',auth[_0xc988('0x5')](),controller[_0xc988('0x8')]);router[_0xc988('0x9')](_0xc988('0x7'),auth[_0xc988('0x5')](),controller['update']);router[_0xc988('0xa')](_0xc988('0x7'),auth[_0xc988('0x5')](),controller[_0xc988('0xb')]);module[_0xc988('0xc')]=router; \ No newline at end of file +var _0x75dc=['/:id','show','post','isAuthenticated','create','delete','destroy','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','index'];(function(_0x53b511,_0x4fb2b1){var _0x1d3232=function(_0x250b83){while(--_0x250b83){_0x53b511['push'](_0x53b511['shift']());}};_0x1d3232(++_0x4fb2b1);}(_0x75dc,0x1d7));var _0xc75d=function(_0x4ee89a,_0x56d642){_0x4ee89a=_0x4ee89a-0x0;var _0x42aca9=_0x75dc[_0x4ee89a];return _0x42aca9;};'use strict';var multer=require(_0xc75d('0x0'));var util=require(_0xc75d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc75d('0x2')]();var auth=require(_0xc75d('0x3'));var interaction=require(_0xc75d('0x4'));var config=require(_0xc75d('0x5'));var controller=require(_0xc75d('0x6'));router[_0xc75d('0x7')]('/',auth['isAuthenticated'](),controller[_0xc75d('0x8')]);router[_0xc75d('0x7')](_0xc75d('0x9'),auth['isAuthenticated'](),controller[_0xc75d('0xa')]);router[_0xc75d('0xb')]('/',auth[_0xc75d('0xc')](),controller[_0xc75d('0xd')]);router['put'](_0xc75d('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xc75d('0xe')](_0xc75d('0x9'),auth[_0xc75d('0xc')](),controller[_0xc75d('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index d930a32..d3b158c 100644 --- a/server/api/faxAccount/faxAccount.attributes.js +++ b/server/api/faxAccount/faxAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb5c=['yes','xCALLY\x20Motion\x20Fax','2400','9600','12000','14400','4800','7200','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','ENUM'];(function(_0x274009,_0x100581){var _0x4b377b=function(_0x29decc){while(--_0x29decc){_0x274009['push'](_0x274009['shift']());}};_0x4b377b(++_0x100581);}(_0xdb5c,0xee));var _0xcdb5=function(_0x44778e,_0xf32cfb){_0x44778e=_0x44778e-0x0;var _0x4d7f54=_0xdb5c[_0x44778e];return _0x4d7f54;};'use strict';var Sequelize=require(_0xcdb5('0x0'));module[_0xcdb5('0x1')]={'name':{'type':Sequelize[_0xcdb5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcdb5('0x2')]},'ecm':{'type':Sequelize[_0xcdb5('0x3')]('yes','no'),'defaultValue':_0xcdb5('0x4')},'headerinfo':{'type':Sequelize[_0xcdb5('0x2')],'defaultValue':_0xcdb5('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM'](_0xcdb5('0x6'),'4800','7200',_0xcdb5('0x7'),_0xcdb5('0x8'),_0xcdb5('0x9')),'defaultValue':_0xcdb5('0xa')},'maxrate':{'type':Sequelize[_0xcdb5('0x3')](_0xcdb5('0x6'),'4800',_0xcdb5('0xb'),_0xcdb5('0x7'),'12000',_0xcdb5('0x9')),'defaultValue':_0xcdb5('0x9')},'modem':{'type':Sequelize[_0xcdb5('0x2')],'defaultValue':_0xcdb5('0xc')},'gateway':{'type':Sequelize[_0xcdb5('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xcdb5('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xcdb5('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xcdb5('0x3')](_0xcdb5('0xe'),_0xcdb5('0xf'),'DADHI',_0xcdb5('0x10')),'defaultValue':_0xcdb5('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xcdb5('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcdb5('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcdb5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcdb5('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcdb5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcdb5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcdb5('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xcdb5('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xcdb5('0x11')],'defaultValue':![],'comment':_0xcdb5('0x13'),'set':function(_0x4b1d07){if(!_0x4b1d07)this['setDataValue'](_0xcdb5('0x14'),null);this[_0xcdb5('0x15')]('mandatoryDisposition',_0x4b1d07);}}}; \ No newline at end of file +var _0xf895=['2400','7200','9600','14400','4800','v17,v27,v29','INTEGER','IAX','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM'];(function(_0x3dd375,_0x8b62b4){var _0x345f85=function(_0x17b7a5){while(--_0x17b7a5){_0x3dd375['push'](_0x3dd375['shift']());}};_0x345f85(++_0x8b62b4);}(_0xf895,0x143));var _0x5f89=function(_0x152f2d,_0x2eddbf){_0x152f2d=_0x152f2d-0x0;var _0x363b2b=_0xf895[_0x152f2d];return _0x363b2b;};'use strict';var Sequelize=require(_0x5f89('0x0'));module[_0x5f89('0x1')]={'name':{'type':Sequelize[_0x5f89('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5f89('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x5f89('0x3')},'headerinfo':{'type':Sequelize[_0x5f89('0x2')],'defaultValue':_0x5f89('0x4')},'localstationid':{'type':Sequelize[_0x5f89('0x2')],'unique':_0x5f89('0x5')},'minrate':{'type':Sequelize[_0x5f89('0x6')](_0x5f89('0x7'),'4800',_0x5f89('0x8'),_0x5f89('0x9'),'12000',_0x5f89('0xa')),'defaultValue':_0x5f89('0xb')},'maxrate':{'type':Sequelize[_0x5f89('0x6')](_0x5f89('0x7'),_0x5f89('0xb'),_0x5f89('0x8'),_0x5f89('0x9'),'12000',_0x5f89('0xa')),'defaultValue':_0x5f89('0xa')},'modem':{'type':Sequelize[_0x5f89('0x2')],'defaultValue':_0x5f89('0xc')},'gateway':{'type':Sequelize[_0x5f89('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5f89('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x5f89('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5f89('0x6')]('SIP',_0x5f89('0xe'),'DADHI','KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x5f89('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5f89('0xf')],'defaultValue':function(){return _0x5f89('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5f89('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5f89('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5f89('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5f89('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5f89('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5f89('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5f89('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x5f89('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x5f89('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x58ce24){if(!_0x58ce24)this[_0x5f89('0x13')](_0x5f89('0x14'),null);this['setDataValue'](_0x5f89('0x15'),_0x58ce24);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 1180127..fef70b0 100644 --- a/server/api/faxAccount/faxAccount.controller.js +++ b/server/api/faxAccount/faxAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','FaxAccount,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','then','get','FaxAccounts','destroy','name','send','Pause','mandatoryDispositionPause','FaxAccount','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','key','VIRTUAL','field','filter','options','includeAll','include','rows','catch','fields','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addDisposition','FaxAccountId','Disposition','findOne','rawAttributes','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','ids','omit','FaxInteraction','Contact','User','internal','Tag','Tags','tag','addApplications','sequelize','FaxApplication','findAndCountAll','getApplications','context','exten','app','type','system','description','Fax\x20Extension','priority','appdata','push','Answer','Set','localstationid','faxdetect','headerinfo','maxrate','minrate','modem','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','bulkCreate','updateAccountApplications','updatedAt','TrunkId','ListId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','Contacts','DESC','attachments','join','root','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List','CmContact','defaults','out','filename','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','userFaxAccount:save','removeAgents','emit','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x4571ae,_0x5309bf){var _0x52b48b=function(_0x20695c){while(--_0x20695c){_0x4571ae['push'](_0x4571ae['shift']());}};_0x52b48b(++_0x5309bf);}(_0xadb5,0xad));var _0x5adb=function(_0x68abed,_0x12019c){_0x68abed=_0x68abed-0x0;var _0x69b709=_0xadb5[_0x68abed];return _0x69b709;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5adb('0x14'));var utils=require(_0x5adb('0x15'));var config=require(_0x5adb('0x16'));var db=require('../../mysqldb')['db'];config[_0x5adb('0x17')]=_['defaults'](config[_0x5adb('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x5adb('0x18'))(new Redis(config[_0x5adb('0x17')]));require(_0x5adb('0x19'))['register'](socket);var jayson=require(_0x5adb('0x1a'));var client=jayson[_0x5adb('0x1b')][_0x5adb('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x5adb('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x518823,_0x367d82,_0x42a482){if(_0x42a482){var _0x30614e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30614e[_0x5adb('0x1d')](_0x367d82)){return _0x518823;}else{throw new Error(_0x5adb('0x1e'));}}else{return _0x518823;}}function respondWithRpcPromise(_0x39d24d,_0xa29dc,_0x42f4c6,_0xb953a6){return new BPromise(function(_0x529b65,_0x3fff62){var _0x5de028=_0xb953a6||client;return _0x5de028[_0x5adb('0x1f')](_0x39d24d,_0x42f4c6)['then'](function(_0x3ef465){logger['info']('FaxAccount,\x20%s,\x20%s',_0xa29dc,_0x5adb('0x20'));logger[_0x5adb('0x21')](_0x5adb('0x22'),_0xa29dc,_0x5adb('0x20'),JSON[_0x5adb('0x23')](_0x3ef465));if(_0x3ef465['error']){if(_0x3ef465[_0x5adb('0x24')]['code']===0x1f4){logger['error'](_0x5adb('0x25'),_0xa29dc,_0x3ef465[_0x5adb('0x24')][_0x5adb('0x26')]);return _0x3fff62(_0x3ef465[_0x5adb('0x24')][_0x5adb('0x26')]);}logger[_0x5adb('0x24')](_0x5adb('0x25'),_0xa29dc,_0x3ef465['error'][_0x5adb('0x26')]);return _0x529b65(_0x3ef465[_0x5adb('0x24')][_0x5adb('0x26')]);}else{logger[_0x5adb('0x27')](_0x5adb('0x25'),_0xa29dc,'request\x20sent');_0x529b65(_0x3ef465[_0x5adb('0x28')][_0x5adb('0x26')]);}})['catch'](function(_0x1feecf){logger[_0x5adb('0x24')](_0x5adb('0x25'),_0xa29dc,_0x1feecf);_0x3fff62(_0x1feecf);});});}function respondWithStatusCode(_0x55b40a,_0x13ad1d){_0x13ad1d=_0x13ad1d||0xcc;return function(_0xbe21b1){if(_0xbe21b1){return _0x55b40a[_0x5adb('0x29')](_0x13ad1d);}return _0x55b40a[_0x5adb('0x2a')](_0x13ad1d)[_0x5adb('0x2b')]();};}function respondWithResult(_0x1c06c4,_0x4a5d46){_0x4a5d46=_0x4a5d46||0xc8;return function(_0x49992e){if(_0x49992e){return _0x1c06c4['status'](_0x4a5d46)[_0x5adb('0x2c')](_0x49992e);}};}function respondWithFilteredResult(_0x1eac55,_0x60a672){return function(_0x512bab){if(_0x512bab){var _0x137a5c=_0x512bab[_0x5adb('0x2d')],_0x4de310=_0x60a672[_0x5adb('0x2e')],_0x11ec2a=_0x60a672[_0x5adb('0x2e')]+_0x60a672[_0x5adb('0x2f')],_0x34b793;if(_0x11ec2a>=_0x137a5c){_0x11ec2a=_0x137a5c;_0x34b793=0xc8;}else{_0x34b793=0xce;}_0x1eac55[_0x5adb('0x2a')](_0x34b793);return _0x1eac55[_0x5adb('0x30')](_0x5adb('0x31'),_0x4de310+'-'+_0x11ec2a+'/'+_0x137a5c)[_0x5adb('0x2c')](_0x512bab);}return null;};}function patchUpdates(_0x4790f1){return function(_0x2e46ce){try{jsonpatch['apply'](_0x2e46ce,_0x4790f1,!![]);}catch(_0x12424d){return BPromise[_0x5adb('0x32')](_0x12424d);}return _0x2e46ce['save']();};}function saveUpdates(_0x226390,_0xe389ca){return function(_0x461a39){if(_0x461a39){return _0x461a39['update'](_0x226390)[_0x5adb('0x33')](function(_0x14cf00){return _0x14cf00;});}return null;};}function removeEntity(_0x4b5887,_0x5bb227){return function(_0x1ed9ea){if(_0x1ed9ea){return _0x1ed9ea['destroy']()[_0x5adb('0x33')](function(){var _0x222568=_0x1ed9ea[_0x5adb('0x34')]({'plain':!![]});var _0x2da912=_0x5adb('0x35');return db['UserProfileResource'][_0x5adb('0x36')]({'where':{'type':_0x2da912,'resourceId':_0x222568['id']}})[_0x5adb('0x33')](function(){return _0x1ed9ea;});})[_0x5adb('0x33')](function(){_0x4b5887['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32eb69,_0x5d1baa){return function(_0x586820){if(!_0x586820){_0x32eb69[_0x5adb('0x29')](0x194);}return _0x586820;};}function handleError(_0x4a4260,_0x199d3b){_0x199d3b=_0x199d3b||0x1f4;return function(_0x58cc5d){logger[_0x5adb('0x24')](_0x58cc5d['stack']);if(_0x58cc5d[_0x5adb('0x37')]){delete _0x58cc5d[_0x5adb('0x37')];}_0x4a4260['status'](_0x199d3b)[_0x5adb('0x38')](_0x58cc5d);};}exports['index']=function(_0xadbe37,_0x34e828){var _0xd5660c={'include':[{'model':db[_0x5adb('0x39')],'as':_0x5adb('0x3a')}]},_0x50edd1={},_0x425dc7={'count':0x0,'rows':[]};var _0x132803=db[_0x5adb('0x3b')]['rawAttributes'];_0x50edd1['model']=_['keys'](_0x132803);_0x50edd1['query']=_[_0x5adb('0x3c')](_0xadbe37[_0x5adb('0x3d')]);_0x50edd1[_0x5adb('0x3e')]=_[_0x5adb('0x3f')](_0x50edd1[_0x5adb('0x40')],_0x50edd1[_0x5adb('0x3d')]);_0xd5660c[_0x5adb('0x41')]=_[_0x5adb('0x3f')](_0x50edd1['model'],qs['fields'](_0xadbe37[_0x5adb('0x3d')]['fields']));_0xd5660c[_0x5adb('0x41')]=_0xd5660c[_0x5adb('0x41')][_0x5adb('0x42')]?_0xd5660c[_0x5adb('0x41')]:_0x50edd1[_0x5adb('0x40')];if(!_0xadbe37['query'][_0x5adb('0x43')](_0x5adb('0x44'))){_0xd5660c['limit']=qs[_0x5adb('0x2f')](_0xadbe37[_0x5adb('0x3d')]['limit']);_0xd5660c[_0x5adb('0x2e')]=qs[_0x5adb('0x2e')](_0xadbe37[_0x5adb('0x3d')][_0x5adb('0x2e')]);}_0xd5660c[_0x5adb('0x45')]=qs[_0x5adb('0x46')](_0xadbe37[_0x5adb('0x3d')]['sort']);_0xd5660c['where']=qs[_0x5adb('0x3e')](_[_0x5adb('0x47')](_0xadbe37[_0x5adb('0x3d')],_0x50edd1[_0x5adb('0x3e')]));if(_0xadbe37['query']['filter']){_0xd5660c[_0x5adb('0x48')]=_[_0x5adb('0x49')](_0xd5660c[_0x5adb('0x48')],{'$or':_[_0x5adb('0x4a')](_0x132803,function(_0x1713bc){if(_0x1713bc['type'][_0x5adb('0x4b')]!==_0x5adb('0x4c')){var _0x5b574c={};_0x5b574c[_0x1713bc[_0x5adb('0x4d')]]={'$like':'%'+_0xadbe37[_0x5adb('0x3d')][_0x5adb('0x4e')]+'%'};return _0x5b574c;}})});}_0xd5660c=_[_0x5adb('0x49')]({},_0xd5660c,_0xadbe37[_0x5adb('0x4f')]);var _0x3a5409={'where':_0xd5660c[_0x5adb('0x48')]};return db[_0x5adb('0x3b')]['count'](_0x3a5409)[_0x5adb('0x33')](function(_0x57dc8b){_0x425dc7['count']=_0x57dc8b;if(_0xadbe37['query'][_0x5adb('0x50')]){_0xd5660c[_0x5adb('0x51')]=[{'all':!![]}];}return db[_0x5adb('0x3b')]['findAll'](_0xd5660c);})[_0x5adb('0x33')](function(_0x5cbab5){_0x425dc7[_0x5adb('0x52')]=_0x5cbab5;return _0x425dc7;})[_0x5adb('0x33')](respondWithFilteredResult(_0x34e828,_0xd5660c))[_0x5adb('0x53')](handleError(_0x34e828,null));};exports['show']=function(_0x27ddc4,_0x560bac){var _0x22fa54={'raw':![],'where':{'id':_0x27ddc4['params']['id']},'include':[{'model':db[_0x5adb('0x39')],'as':_0x5adb('0x3a')}]},_0x6dc067={};_0x6dc067[_0x5adb('0x40')]=_[_0x5adb('0x3c')](db[_0x5adb('0x3b')]['rawAttributes']);_0x6dc067[_0x5adb('0x3d')]=_[_0x5adb('0x3c')](_0x27ddc4[_0x5adb('0x3d')]);_0x6dc067[_0x5adb('0x3e')]=_['intersection'](_0x6dc067[_0x5adb('0x40')],_0x6dc067[_0x5adb('0x3d')]);_0x22fa54[_0x5adb('0x41')]=_['intersection'](_0x6dc067[_0x5adb('0x40')],qs[_0x5adb('0x54')](_0x27ddc4[_0x5adb('0x3d')][_0x5adb('0x54')]));_0x22fa54['attributes']=_0x22fa54[_0x5adb('0x41')][_0x5adb('0x42')]?_0x22fa54[_0x5adb('0x41')]:_0x6dc067[_0x5adb('0x40')];if(_0x27ddc4[_0x5adb('0x3d')]['includeAll']){_0x22fa54[_0x5adb('0x51')]=[{'all':!![]}];}_0x22fa54=_['merge']({},_0x22fa54,_0x27ddc4[_0x5adb('0x4f')]);return db['FaxAccount'][_0x5adb('0x55')](_0x22fa54)[_0x5adb('0x33')](handleEntityNotFound(_0x560bac,null))[_0x5adb('0x33')](respondWithResult(_0x560bac,null))[_0x5adb('0x53')](handleError(_0x560bac,null));};exports['create']=function(_0x18f95c,_0x229ae2){return db[_0x5adb('0x3b')]['create'](_0x18f95c['body'],{})['then'](function(_0x18ee9a){var _0x31a1f9=_0x18f95c[_0x5adb('0x56')][_0x5adb('0x34')]({'plain':!![]});if(!_0x31a1f9)throw new Error(_0x5adb('0x57'));if(_0x31a1f9[_0x5adb('0x58')]===_0x5adb('0x56')){var _0x8d7810=_0x18ee9a[_0x5adb('0x34')]({'plain':!![]});var _0x380d76=_0x5adb('0x35');return db[_0x5adb('0x59')][_0x5adb('0x55')]({'where':{'name':_0x380d76,'userProfileId':_0x31a1f9['userProfileId']},'raw':!![]})['then'](function(_0x3d55c2){if(_0x3d55c2&&_0x3d55c2[_0x5adb('0x5a')]===0x0){return db[_0x5adb('0x5b')][_0x5adb('0x5c')]({'name':_0x8d7810['name'],'resourceId':_0x8d7810['id'],'type':_0x3d55c2[_0x5adb('0x37')],'sectionId':_0x3d55c2['id']},{})[_0x5adb('0x33')](function(){return _0x18ee9a;});}else{return _0x18ee9a;}})['catch'](function(_0x5cb50e){logger[_0x5adb('0x24')](_0x5adb('0x5d'),_0x5cb50e);throw _0x5cb50e;});}return _0x18ee9a;})['then'](respondWithResult(_0x229ae2,0xc9))[_0x5adb('0x53')](handleError(_0x229ae2,null));};exports[_0x5adb('0x5e')]=function(_0x19df2f,_0x30c92c){if(_0x19df2f[_0x5adb('0x5f')]['id']){delete _0x19df2f[_0x5adb('0x5f')]['id'];}return db['FaxAccount'][_0x5adb('0x55')]({'where':{'id':_0x19df2f[_0x5adb('0x60')]['id']},'include':[{'model':db[_0x5adb('0x39')],'as':'mandatoryDispositionPause'}]})[_0x5adb('0x33')](handleEntityNotFound(_0x30c92c,null))[_0x5adb('0x33')](saveUpdates(_0x19df2f[_0x5adb('0x5f')],null))['then'](respondWithResult(_0x30c92c,null))[_0x5adb('0x53')](handleError(_0x30c92c,null));};exports['destroy']=function(_0xa8ff64,_0x1e7e3a){return db[_0x5adb('0x3b')]['find']({'where':{'id':_0xa8ff64[_0x5adb('0x60')]['id']}})[_0x5adb('0x33')](handleEntityNotFound(_0x1e7e3a,null))['then'](removeEntity(_0x1e7e3a,null))[_0x5adb('0x53')](handleError(_0x1e7e3a,null));};exports[_0x5adb('0x61')]=function(_0x248739,_0x3fcad5){return db['FaxAccount'][_0x5adb('0x61')]()[_0x5adb('0x33')](respondWithResult(_0x3fcad5,null))[_0x5adb('0x53')](handleError(_0x3fcad5,null));};exports[_0x5adb('0x62')]=function(_0x5b7556,_0x53a4bc,_0x304512){if(_0x5b7556['body']['id']){delete _0x5b7556['body']['id'];}return db['FaxAccount'][_0x5adb('0x55')]({'where':{'id':_0x5b7556[_0x5adb('0x60')]['id']}})['then'](handleEntityNotFound(_0x53a4bc,null))[_0x5adb('0x33')](function(_0x91e023){if(_0x91e023){_0x5b7556[_0x5adb('0x5f')][_0x5adb('0x63')]=_0x91e023['id'];return db[_0x5adb('0x64')][_0x5adb('0x5c')](_0x5b7556[_0x5adb('0x5f')]);}})[_0x5adb('0x33')](respondWithResult(_0x53a4bc,null))['catch'](handleError(_0x53a4bc,null));};exports['getDispositions']=function(_0x58112b,_0x347b7b,_0x4357a6){var _0x3a0d1b={'raw':![],'where':{}};var _0x2a55a3={};var _0x1f59bb={'count':0x0,'rows':[]};return db[_0x5adb('0x3b')][_0x5adb('0x65')]({'where':{'id':_0x58112b[_0x5adb('0x60')]['id']}})['then'](handleEntityNotFound(_0x347b7b,null))['then'](function(_0x1fc73b){if(_0x1fc73b){_0x2a55a3[_0x5adb('0x40')]=_[_0x5adb('0x3c')](db[_0x5adb('0x64')][_0x5adb('0x66')]);_0x2a55a3[_0x5adb('0x3d')]=_[_0x5adb('0x3c')](_0x58112b[_0x5adb('0x3d')]);_0x2a55a3[_0x5adb('0x3e')]=_[_0x5adb('0x3f')](_0x2a55a3['model'],_0x2a55a3[_0x5adb('0x3d')]);_0x3a0d1b[_0x5adb('0x41')]=_[_0x5adb('0x3f')](_0x2a55a3['model'],qs[_0x5adb('0x54')](_0x58112b[_0x5adb('0x3d')]['fields']));_0x3a0d1b[_0x5adb('0x41')]=_0x3a0d1b['attributes'][_0x5adb('0x42')]?_0x3a0d1b[_0x5adb('0x41')]:_0x2a55a3['model'];if(!_0x58112b[_0x5adb('0x3d')][_0x5adb('0x43')](_0x5adb('0x44'))){_0x3a0d1b[_0x5adb('0x2f')]=qs[_0x5adb('0x2f')](_0x58112b[_0x5adb('0x3d')][_0x5adb('0x2f')]);_0x3a0d1b[_0x5adb('0x2e')]=qs['offset'](_0x58112b[_0x5adb('0x3d')][_0x5adb('0x2e')]);}_0x3a0d1b[_0x5adb('0x45')]=qs['sort'](_0x58112b['query'][_0x5adb('0x46')]);_0x3a0d1b['where']=qs[_0x5adb('0x3e')](_[_0x5adb('0x47')](_0x58112b[_0x5adb('0x3d')],_0x2a55a3['filters']));_0x3a0d1b[_0x5adb('0x48')][_0x5adb('0x63')]=_0x1fc73b['id'];if(_0x58112b[_0x5adb('0x3d')][_0x5adb('0x4e')]){_0x3a0d1b[_0x5adb('0x48')]=_['merge'](_0x3a0d1b[_0x5adb('0x48')],{'$or':_[_0x5adb('0x4a')](_0x3a0d1b[_0x5adb('0x41')],function(_0xe3d12d){var _0x562ba4={};_0x562ba4[_0xe3d12d]={'$like':'%'+_0x58112b[_0x5adb('0x3d')][_0x5adb('0x4e')]+'%'};return _0x562ba4;})});}_0x3a0d1b=_[_0x5adb('0x49')]({},_0x3a0d1b,_0x58112b[_0x5adb('0x4f')]);return db[_0x5adb('0x64')][_0x5adb('0x2d')]({'where':_0x3a0d1b[_0x5adb('0x48')]})['then'](function(_0x2801f2){_0x1f59bb[_0x5adb('0x2d')]=_0x2801f2;if(_0x58112b['query'][_0x5adb('0x50')]){_0x3a0d1b[_0x5adb('0x51')]=[{'all':!![]}];}return db['Disposition'][_0x5adb('0x67')](_0x3a0d1b);})['then'](function(_0x372354){_0x1f59bb[_0x5adb('0x52')]=_0x372354;return _0x1f59bb;});}})['then'](respondWithFilteredResult(_0x347b7b,_0x3a0d1b))[_0x5adb('0x53')](handleError(_0x347b7b,null));};exports['removeDispositions']=function(_0x2f6415,_0x118968,_0x36ba02){return db[_0x5adb('0x3b')][_0x5adb('0x55')]({'where':{'id':_0x2f6415['params']['id']}})[_0x5adb('0x33')](handleEntityNotFound(_0x118968,null))[_0x5adb('0x33')](function(_0x3f33c0){if(_0x3f33c0){return _0x3f33c0[_0x5adb('0x68')](_0x2f6415['query']['ids']);}})[_0x5adb('0x33')](respondWithStatusCode(_0x118968,null))[_0x5adb('0x53')](handleError(_0x118968,null));};exports[_0x5adb('0x69')]=function(_0xa1d7c8,_0x277668,_0xc74e86){if(_0xa1d7c8[_0x5adb('0x5f')]['id']){delete _0xa1d7c8['body']['id'];}return db[_0x5adb('0x3b')][_0x5adb('0x55')]({'where':{'id':_0xa1d7c8[_0x5adb('0x60')]['id']}})[_0x5adb('0x33')](handleEntityNotFound(_0x277668,null))['then'](function(_0x450f90){if(_0x450f90){_0xa1d7c8[_0x5adb('0x5f')][_0x5adb('0x63')]=_0x450f90['id'];return db[_0x5adb('0x6a')][_0x5adb('0x5c')](_0xa1d7c8[_0x5adb('0x5f')]);}})[_0x5adb('0x33')](respondWithResult(_0x277668,null))[_0x5adb('0x53')](handleError(_0x277668,null));};exports[_0x5adb('0x6b')]=function(_0x51ea1e,_0x2a3e17,_0x456799){var _0x5c55ee={'raw':![],'where':{}};var _0x44d50f={};var _0x290a7b={'count':0x0,'rows':[]};return db[_0x5adb('0x3b')][_0x5adb('0x65')]({'where':{'id':_0x51ea1e[_0x5adb('0x60')]['id']}})[_0x5adb('0x33')](handleEntityNotFound(_0x2a3e17,null))[_0x5adb('0x33')](function(_0x350bb1){if(_0x350bb1){_0x44d50f['model']=_[_0x5adb('0x3c')](db[_0x5adb('0x6a')]['rawAttributes']);_0x44d50f[_0x5adb('0x3d')]=_[_0x5adb('0x3c')](_0x51ea1e[_0x5adb('0x3d')]);_0x44d50f['filters']=_['intersection'](_0x44d50f[_0x5adb('0x40')],_0x44d50f[_0x5adb('0x3d')]);_0x5c55ee[_0x5adb('0x41')]=_['intersection'](_0x44d50f[_0x5adb('0x40')],qs[_0x5adb('0x54')](_0x51ea1e[_0x5adb('0x3d')][_0x5adb('0x54')]));_0x5c55ee[_0x5adb('0x41')]=_0x5c55ee[_0x5adb('0x41')][_0x5adb('0x42')]?_0x5c55ee[_0x5adb('0x41')]:_0x44d50f[_0x5adb('0x40')];if(!_0x51ea1e[_0x5adb('0x3d')][_0x5adb('0x43')](_0x5adb('0x44'))){_0x5c55ee['limit']=qs['limit'](_0x51ea1e[_0x5adb('0x3d')][_0x5adb('0x2f')]);_0x5c55ee['offset']=qs[_0x5adb('0x2e')](_0x51ea1e[_0x5adb('0x3d')][_0x5adb('0x2e')]);}_0x5c55ee[_0x5adb('0x45')]=qs[_0x5adb('0x46')](_0x51ea1e[_0x5adb('0x3d')][_0x5adb('0x46')]);_0x5c55ee[_0x5adb('0x48')]=qs[_0x5adb('0x3e')](_['pick'](_0x51ea1e[_0x5adb('0x3d')],_0x44d50f[_0x5adb('0x3e')]));_0x5c55ee[_0x5adb('0x48')]['FaxAccountId']=_0x350bb1['id'];if(_0x51ea1e[_0x5adb('0x3d')][_0x5adb('0x4e')]){_0x5c55ee[_0x5adb('0x48')]=_[_0x5adb('0x49')](_0x5c55ee[_0x5adb('0x48')],{'$or':_[_0x5adb('0x4a')](_0x5c55ee['attributes'],function(_0x13a4aa){var _0x2c4129={};_0x2c4129[_0x13a4aa]={'$like':'%'+_0x51ea1e[_0x5adb('0x3d')][_0x5adb('0x4e')]+'%'};return _0x2c4129;})});}_0x5c55ee=_[_0x5adb('0x49')]({},_0x5c55ee,_0x51ea1e[_0x5adb('0x4f')]);return db[_0x5adb('0x6a')][_0x5adb('0x2d')]({'where':_0x5c55ee[_0x5adb('0x48')]})[_0x5adb('0x33')](function(_0x484a60){_0x290a7b[_0x5adb('0x2d')]=_0x484a60;if(_0x51ea1e['query'][_0x5adb('0x50')]){_0x5c55ee[_0x5adb('0x51')]=[{'all':!![]}];}return db[_0x5adb('0x6a')][_0x5adb('0x67')](_0x5c55ee);})[_0x5adb('0x33')](function(_0x5c7b1b){_0x290a7b['rows']=_0x5c7b1b;return _0x290a7b;});}})[_0x5adb('0x33')](respondWithFilteredResult(_0x2a3e17,_0x5c55ee))[_0x5adb('0x53')](handleError(_0x2a3e17,null));};exports[_0x5adb('0x6c')]=function(_0x5c08d5,_0x3c1a6f,_0x162b9a){return db['FaxAccount']['find']({'where':{'id':_0x5c08d5[_0x5adb('0x60')]['id']}})[_0x5adb('0x33')](handleEntityNotFound(_0x3c1a6f,null))[_0x5adb('0x33')](function(_0x4f5721){if(_0x4f5721){return _0x4f5721['removeAnswers'](_0x5c08d5[_0x5adb('0x3d')]['ids']);}})[_0x5adb('0x33')](respondWithStatusCode(_0x3c1a6f,null))[_0x5adb('0x53')](handleError(_0x3c1a6f,null));};exports['addInteraction']=function(_0x498ecc,_0x43b91c,_0x4bb198){return db['FaxInteraction'][_0x5adb('0x55')]({'where':{'id':_0x498ecc[_0x5adb('0x60')]['id']}})[_0x5adb('0x33')](handleEntityNotFound(_0x43b91c,null))[_0x5adb('0x33')](function(_0xbfd441){if(_0xbfd441){return _0xbfd441[_0x5adb('0x6d')](_0x498ecc[_0x5adb('0x5f')][_0x5adb('0x6e')],_[_0x5adb('0x6f')](_0x498ecc[_0x5adb('0x5f')],[_0x5adb('0x6e'),'id'])||{});}})[_0x5adb('0x33')](respondWithResult(_0x43b91c,null))[_0x5adb('0x53')](handleError(_0x43b91c,null));};exports['getInteractions']=function(_0xb3a828,_0x56d563,_0x409910){var _0x4c7163={'raw':![],'where':{}};var _0x280f30={};var _0xad6905={'count':0x0,'rows':[]};return db[_0x5adb('0x3b')][_0x5adb('0x65')]({'where':{'id':_0xb3a828[_0x5adb('0x60')]['id']}})[_0x5adb('0x33')](handleEntityNotFound(_0x56d563,null))[_0x5adb('0x33')](function(_0x36a8f0){if(_0x36a8f0){_0x280f30[_0x5adb('0x40')]=_[_0x5adb('0x3c')](db['FaxInteraction'][_0x5adb('0x66')]);_0x280f30[_0x5adb('0x3d')]=_[_0x5adb('0x3c')](_0xb3a828[_0x5adb('0x3d')]);_0x280f30[_0x5adb('0x3e')]=_[_0x5adb('0x3f')](_0x280f30[_0x5adb('0x40')],_0x280f30[_0x5adb('0x3d')]);_0x4c7163['attributes']=_[_0x5adb('0x3f')](_0x280f30[_0x5adb('0x40')],qs[_0x5adb('0x54')](_0xb3a828['query'][_0x5adb('0x54')]));_0x4c7163['attributes']=_0x4c7163[_0x5adb('0x41')]['length']?_0x4c7163['attributes']:_0x280f30[_0x5adb('0x40')];if(!_0xb3a828[_0x5adb('0x3d')][_0x5adb('0x43')](_0x5adb('0x44'))){_0x4c7163[_0x5adb('0x2f')]=qs[_0x5adb('0x2f')](_0xb3a828[_0x5adb('0x3d')][_0x5adb('0x2f')]);_0x4c7163[_0x5adb('0x2e')]=qs[_0x5adb('0x2e')](_0xb3a828[_0x5adb('0x3d')][_0x5adb('0x2e')]);}_0x4c7163['order']=qs[_0x5adb('0x46')](_0xb3a828['query'][_0x5adb('0x46')]);_0x4c7163[_0x5adb('0x48')]=qs['filters'](_[_0x5adb('0x47')](_0xb3a828[_0x5adb('0x3d')],_0x280f30['filters']));_0x4c7163['where'][_0x5adb('0x63')]=_0x36a8f0['id'];if(_0xb3a828[_0x5adb('0x3d')][_0x5adb('0x4e')]){_0x4c7163[_0x5adb('0x48')]=_[_0x5adb('0x49')](_0x4c7163[_0x5adb('0x48')],{'$or':_['map'](_0x4c7163[_0x5adb('0x41')],function(_0x263421){var _0x88aac7={};_0x88aac7[_0x263421]={'$like':'%'+_0xb3a828[_0x5adb('0x3d')][_0x5adb('0x4e')]+'%'};return _0x88aac7;})});}_0x4c7163=_['merge']({},_0x4c7163,_0xb3a828['options']);return db[_0x5adb('0x70')][_0x5adb('0x2d')]({'where':_0x4c7163[_0x5adb('0x48')]})[_0x5adb('0x33')](function(_0x37bfe6){_0xad6905[_0x5adb('0x2d')]=_0x37bfe6;if(_0xb3a828[_0x5adb('0x3d')][_0x5adb('0x50')]){_0x4c7163[_0x5adb('0x51')]=[{'model':db['CmContact'],'as':_0x5adb('0x71'),'required':![]},{'model':db[_0x5adb('0x72')],'as':'Owner','attributes':['name','fullname',_0x5adb('0x73')],'required':![]},{'model':db[_0x5adb('0x74')],'as':_0x5adb('0x75'),'attributes':['id','name','color'],'where':_0xb3a828[_0x5adb('0x3d')][_0x5adb('0x76')]?{'id':_0xb3a828[_0x5adb('0x3d')][_0x5adb('0x76')]}:undefined,'required':_0xb3a828[_0x5adb('0x3d')][_0x5adb('0x76')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x4c7163);})[_0x5adb('0x33')](function(_0x5a9e55){_0xad6905[_0x5adb('0x52')]=_0x5a9e55;return _0xad6905;});}})[_0x5adb('0x33')](respondWithFilteredResult(_0x56d563,_0x4c7163))['catch'](handleError(_0x56d563,null));};exports[_0x5adb('0x77')]=function(_0x108694,_0x277c24,_0x2aebe2){return db['FaxAccount'][_0x5adb('0x65')]({'where':{'id':_0x108694[_0x5adb('0x60')]['id']}})[_0x5adb('0x33')](handleEntityNotFound(_0x277c24,null))[_0x5adb('0x33')](function(_0x4ec5bd){if(_0x4ec5bd){return db[_0x5adb('0x78')]['transaction'](function(_0x29cc2f){return db[_0x5adb('0x79')][_0x5adb('0x36')]({'where':{'FaxAccountId':_0x108694[_0x5adb('0x60')]['id']},'transaction':_0x29cc2f})[_0x5adb('0x33')](function(_0x190c08){var _0x597ed3=_[_0x5adb('0x4a')](_0x108694[_0x5adb('0x5f')],function(_0x3b1dfb){_0x3b1dfb[_0x5adb('0x63')]=_0x108694['params']['id'];return _0x3b1dfb;});return db[_0x5adb('0x79')]['bulkCreate'](_0x597ed3,{'transaction':_0x29cc2f});});})['then'](function(){return db['FaxApplication'][_0x5adb('0x7a')]({'where':{'FaxAccountId':_0x108694['params']['id']},'order':'priority'});});}})[_0x5adb('0x33')](respondWithResult(_0x277c24,null))[_0x5adb('0x53')](handleError(_0x277c24,null));};exports[_0x5adb('0x7b')]=function(_0x2d6898,_0x1958ab,_0x11fb8c){var _0x1fac75={};var _0x4791b1={};var _0x59d227;var _0x429257;return db['FaxAccount'][_0x5adb('0x65')]({'where':{'id':_0x2d6898[_0x5adb('0x60')]['id']}})[_0x5adb('0x33')](handleEntityNotFound(_0x1958ab,null))[_0x5adb('0x33')](function(_0x39762c){if(_0x39762c){_0x59d227=_0x39762c;_0x4791b1[_0x5adb('0x40')]=_[_0x5adb('0x3c')](db[_0x5adb('0x79')][_0x5adb('0x66')]);_0x4791b1[_0x5adb('0x3d')]=_[_0x5adb('0x3c')](_0x2d6898[_0x5adb('0x3d')]);_0x4791b1['filters']=_['intersection'](_0x4791b1[_0x5adb('0x40')],_0x4791b1[_0x5adb('0x3d')]);_0x1fac75[_0x5adb('0x41')]=_[_0x5adb('0x3f')](_0x4791b1['model'],qs[_0x5adb('0x54')](_0x2d6898[_0x5adb('0x3d')][_0x5adb('0x54')]));_0x1fac75[_0x5adb('0x41')]=_0x1fac75[_0x5adb('0x41')]['length']?_0x1fac75['attributes']:_0x4791b1[_0x5adb('0x40')];_0x1fac75['order']=qs[_0x5adb('0x46')](_0x2d6898[_0x5adb('0x3d')][_0x5adb('0x46')]);_0x1fac75[_0x5adb('0x48')]=qs[_0x5adb('0x3e')](_[_0x5adb('0x47')](_0x2d6898['query'],_0x4791b1[_0x5adb('0x3e')]));if(_0x2d6898[_0x5adb('0x3d')][_0x5adb('0x4e')]){_0x1fac75[_0x5adb('0x48')]=_[_0x5adb('0x49')](_0x1fac75[_0x5adb('0x48')],{'$or':_[_0x5adb('0x4a')](_0x1fac75['attributes'],function(_0x5d8b31){var _0x57543b={};_0x57543b[_0x5d8b31]={'$like':'%'+_0x2d6898[_0x5adb('0x3d')]['filter']+'%'};return _0x57543b;})});}_0x1fac75=_[_0x5adb('0x49')]({},_0x1fac75,_0x2d6898['options']);return _0x59d227['getApplications'](_0x1fac75);}})[_0x5adb('0x33')](function(_0x340434){if(_0x340434){_0x429257=_0x340434['length'];if(!_0x2d6898['query'][_0x5adb('0x43')](_0x5adb('0x44'))){_0x1fac75[_0x5adb('0x2f')]=qs['limit'](_0x2d6898[_0x5adb('0x3d')]['limit']);_0x1fac75['offset']=qs[_0x5adb('0x2e')](_0x2d6898[_0x5adb('0x3d')][_0x5adb('0x2e')]);}return _0x59d227['getApplications'](_0x1fac75);}})['then'](function(_0x296bef){if(_0x296bef){return _0x296bef?{'count':_0x429257,'rows':_0x296bef}:null;}})[_0x5adb('0x33')](respondWithResult(_0x1958ab,null))['catch'](handleError(_0x1958ab,null));};function Extension(_0x5366d4,_0x272f92,_0x3f09d2,_0x4d2ae8){this[_0x5adb('0x7c')]='from-voip-provider';this[_0x5adb('0x7d')]=_0x5366d4['localstationid'];this[_0x5adb('0x7e')]=_0x4d2ae8;this[_0x5adb('0x7f')]=_0x5adb('0x80');this[_0x5adb('0x81')]=_0x5adb('0x82');this['FaxAccountId']=_0x5366d4['id'];this[_0x5adb('0x83')]=_0x272f92;this[_0x5adb('0x84')]=_0x3f09d2;}function createExtensionsReciveFax(_0x23c07a){var _0x5874b2=0x1;var _0x2fbbe3=[];_0x2fbbe3[_0x5adb('0x85')](new Extension(_0x23c07a,_0x5874b2,'',_0x5adb('0x86')));_0x5874b2+=0x1;_0x2fbbe3[_0x5adb('0x85')](new Extension(_0x23c07a,_0x5874b2,'CDR(type)=inbound-fax',_0x5adb('0x87')));_0x5874b2+=0x1;for(var _0x1ff2e6 in _0x23c07a){if(_0x23c07a[_0x5adb('0x43')](_0x1ff2e6)&&(_0x1ff2e6==='ecm'||_0x1ff2e6===_0x5adb('0x88')||_0x1ff2e6==='gateway'||_0x1ff2e6===_0x5adb('0x89')||_0x1ff2e6===_0x5adb('0x8a')||_0x1ff2e6===_0x5adb('0x8b')||_0x1ff2e6===_0x5adb('0x8c')||_0x1ff2e6===_0x5adb('0x8d')||_0x1ff2e6==='t38timeout')){_0x2fbbe3['push'](new Extension(_0x23c07a,_0x5874b2,'FAXOPT('+_0x1ff2e6+')='+_0x23c07a[_0x1ff2e6],_0x5adb('0x87')));_0x5874b2+=0x1;}}_0x2fbbe3['push'](new Extension(_0x23c07a,_0x5874b2,'6','Wait'));_0x5874b2+=0x1;_0x2fbbe3[_0x5adb('0x85')](new Extension(_0x23c07a,_0x5874b2,_0x5adb('0x8e'),_0x5adb('0x8f')));_0x5874b2=0x0;return _0x2fbbe3;}exports[_0x5adb('0x90')]=function(_0x20b54a,_0x2d58b8,_0x2a9cc9){var _0x338404;return db['sequelize'][_0x5adb('0x91')](function(_0x2dc495){return db['FaxAccount'][_0x5adb('0x5c')](_0x20b54a[_0x5adb('0x5f')],{'transaction':_0x2dc495})['then'](function(_0x19a72c){_0x338404=_0x19a72c['get']({'plain':!![]});return db[_0x5adb('0x92')][_0x5adb('0x93')](createExtensionsReciveFax(_0x338404),{'transaction':_0x2dc495});});})[_0x5adb('0x33')](function(){return _0x338404;})[_0x5adb('0x33')](respondWithResult(_0x2d58b8,null))[_0x5adb('0x53')](handleError(_0x2d58b8,null));};exports[_0x5adb('0x94')]=function(_0x7b0fdc,_0x1d8434,_0x52f89f){var _0x422e46;return db['sequelize'][_0x5adb('0x91')](function(_0x4ed144){return db[_0x5adb('0x3b')]['update'](_0x7b0fdc[_0x5adb('0x5f')],{'where':{'id':_0x7b0fdc[_0x5adb('0x5f')]['id']},'transaction':_0x4ed144})[_0x5adb('0x33')](function(_0x759016){return db[_0x5adb('0x92')][_0x5adb('0x36')]({'where':{'FaxAccountId':_0x7b0fdc[_0x5adb('0x5f')]['id']},'transaction':_0x4ed144})[_0x5adb('0x33')](function(_0x3fe6d4){return db[_0x5adb('0x92')][_0x5adb('0x93')](createExtensionsReciveFax(_[_0x5adb('0x6f')](_0x7b0fdc[_0x5adb('0x5f')],['tech',_0x5adb('0x4b'),'createdAt',_0x5adb('0x95'),_0x5adb('0x96'),_0x5adb('0x97')])),{'transaction':_0x4ed144});});});})['then'](function(){return db['FaxAccount']['findById'](_0x7b0fdc['body']['id']);})[_0x5adb('0x33')](respondWithResult(_0x1d8434,null))[_0x5adb('0x53')](handleError(_0x1d8434,null));};exports[_0x5adb('0x98')]=function(_0x2e8c0c,_0x3fb440,_0x452e5e){var _0xff11b7={'raw':!![],'where':{}};var _0x3d3a36={};var _0x2ee217={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5adb('0x65')]({'where':{'id':_0x2e8c0c[_0x5adb('0x60')]['id']}})[_0x5adb('0x33')](handleEntityNotFound(_0x3fb440,null))[_0x5adb('0x33')](function(_0x1ba4ba){if(_0x1ba4ba){_0x3d3a36[_0x5adb('0x40')]=_['keys'](db['FaxMessage']['rawAttributes']);_0x3d3a36[_0x5adb('0x3d')]=_[_0x5adb('0x3c')](_0x2e8c0c[_0x5adb('0x3d')]);_0x3d3a36[_0x5adb('0x3e')]=_[_0x5adb('0x3f')](_0x3d3a36['model'],_0x3d3a36[_0x5adb('0x3d')]);_0xff11b7[_0x5adb('0x41')]=_[_0x5adb('0x3f')](_0x3d3a36[_0x5adb('0x40')],qs[_0x5adb('0x54')](_0x2e8c0c[_0x5adb('0x3d')][_0x5adb('0x54')]));_0xff11b7[_0x5adb('0x41')]=_0xff11b7[_0x5adb('0x41')][_0x5adb('0x42')]?_0xff11b7[_0x5adb('0x41')]:_0x3d3a36[_0x5adb('0x40')];if(!_0x2e8c0c[_0x5adb('0x3d')]['hasOwnProperty'](_0x5adb('0x44'))){_0xff11b7['limit']=qs[_0x5adb('0x2f')](_0x2e8c0c[_0x5adb('0x3d')][_0x5adb('0x2f')]);_0xff11b7[_0x5adb('0x2e')]=qs[_0x5adb('0x2e')](_0x2e8c0c[_0x5adb('0x3d')][_0x5adb('0x2e')]);}_0xff11b7[_0x5adb('0x45')]=qs['sort'](_0x2e8c0c[_0x5adb('0x3d')]['sort']);_0xff11b7['where']=qs[_0x5adb('0x3e')](_[_0x5adb('0x47')](_0x2e8c0c['query'],_0x3d3a36[_0x5adb('0x3e')]));_0xff11b7['where'][_0x5adb('0x63')]=_0x1ba4ba['id'];if(_0x2e8c0c[_0x5adb('0x3d')]['filter']){_0xff11b7[_0x5adb('0x48')]=_['merge'](_0xff11b7[_0x5adb('0x48')],{'$or':_[_0x5adb('0x4a')](_0xff11b7[_0x5adb('0x41')],function(_0x420808){var _0x69887b={};_0x69887b[_0x420808]={'$like':'%'+_0x2e8c0c['query']['filter']+'%'};return _0x69887b;})});}if(_0x2e8c0c[_0x5adb('0x3d')][_0x5adb('0x99')]){var _0x51e1bb=_0x2e8c0c[_0x5adb('0x3d')][_0x5adb('0x99')][_0x5adb('0x9a')](',');var _0x2f2122={};_0x2f2122[_0x51e1bb[0x0]]={'$gte':moment(_0x51e1bb[0x1])[_0x5adb('0x9b')](_0x5adb('0x9c'))};_0xff11b7[_0x5adb('0x48')]=_[_0x5adb('0x49')](_0xff11b7['where'],_0x2f2122);}_0xff11b7=_[_0x5adb('0x49')]({},_0xff11b7,_0x2e8c0c[_0x5adb('0x4f')]);return db[_0x5adb('0x9d')]['count']({'where':_0xff11b7['where']})[_0x5adb('0x33')](function(_0x5057fe){_0x2ee217['count']=_0x5057fe;if(_0x2e8c0c[_0x5adb('0x3d')][_0x5adb('0x50')]){_0xff11b7[_0x5adb('0x51')]=[{'all':!![]}];}return db[_0x5adb('0x9d')]['findAll'](_0xff11b7);})[_0x5adb('0x33')](function(_0x3ca38d){_0x2ee217['rows']=_0x3ca38d;return _0x2ee217;});}})[_0x5adb('0x33')](respondWithFilteredResult(_0x3fb440,_0xff11b7))[_0x5adb('0x53')](handleError(_0x3fb440,null));};exports['send']=function(_0x37720e,_0x2072e2,_0x25ce58){var _0x4b0530,_0x11396b={},_0x452560;if(_0x37720e['body']['to']){_0x452560=_0x37720e[_0x5adb('0x5f')]['to'][0x0];}return db[_0x5adb('0x3b')][_0x5adb('0x55')]({'where':{'id':_0x37720e[_0x5adb('0x60')]['id']},'include':[{'model':db[_0x5adb('0x9e')],'as':'List','include':[{'model':db['CmContact'],'as':_0x5adb('0x9f'),'where':{'fax':_0x452560},'limit':0x1,'order':[[_0x5adb('0x95'),_0x5adb('0xa0')]]}]}]})[_0x5adb('0x33')](handleEntityNotFound(_0x2072e2,null))[_0x5adb('0x33')](function(_0x232787){_0x4b0530=_0x232787;if(_0x37720e[_0x5adb('0x5f')]['attachments']&&_0x37720e[_0x5adb('0x5f')][_0x5adb('0xa1')][_0x5adb('0x42')]){for(var _0x5b6f8b=0x0;_0x5b6f8b<_0x37720e[_0x5adb('0x5f')]['attachments'][_0x5adb('0x42')];_0x5b6f8b+=0x1){_0x37720e[_0x5adb('0x5f')]['attachments'][_0x5b6f8b]={'filename':_0x37720e['body'][_0x5adb('0xa1')][_0x5b6f8b][_0x5adb('0x37')],'id':_0x37720e[_0x5adb('0x5f')][_0x5adb('0xa1')][_0x5b6f8b]['id'],'path':path[_0x5adb('0xa2')](config[_0x5adb('0xa3')],'server/files/attachments',_0x37720e[_0x5adb('0x5f')][_0x5adb('0xa1')][_0x5b6f8b]['basename'])};}}return respondWithRpcPromise(_0x5adb('0xa4'),'CheckAfterSend',{'FaxAccountId':_[_0x5adb('0xa5')](_0x37720e[_0x5adb('0x60')]['id'])?undefined:_0x37720e[_0x5adb('0x60')]['id'],'path':_[_0x5adb('0xa5')](_0x37720e['body']['attachments'][0x0][_0x5adb('0xa6')])?undefined:_0x37720e[_0x5adb('0x5f')][_0x5adb('0xa1')][0x0]['path'],'fax':_[_0x5adb('0xa5')](_0x37720e['body']['to'][0x0])?undefined:_0x37720e['body']['to'][0x0]},client9002);})[_0x5adb('0x33')](function(){if(_0x4b0530){if(_[_0x5adb('0xa5')](_0x37720e['body'][_0x5adb('0xa7')])){_0x37720e[_0x5adb('0x5f')][_0x5adb('0xa7')]=util['format'](_0x5adb('0xa8'),_0x4b0530[_0x5adb('0x37')],_0x4b0530[_0x5adb('0xa9')]);}if(_0x4b0530[_0x5adb('0xaa')]){if(_0x4b0530['List']['Contacts']['length']){return _0x4b0530[_0x5adb('0xaa')][_0x5adb('0x9f')][0x0];}else{return db[_0x5adb('0xab')]['create'](_[_0x5adb('0xac')](_0x37720e[_0x5adb('0x5f')],{'firstName':_0x37720e[_0x5adb('0x5f')]['to'][0x0],'phone':_0x37720e[_0x5adb('0x5f')]['to'][0x0],'fax':_0x37720e[_0x5adb('0x5f')]['to'][0x0],'ListId':_0x4b0530[_0x5adb('0x97')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x5adb('0x33')](function(_0x4c8e26){if(_0x4c8e26){return db[_0x5adb('0x70')]['find']({'where':{'ContactId':_0x4c8e26['id'],'closed':![],'FaxAccountId':_0x4b0530['id']}})[_0x5adb('0x33')](function(_0x29aefa){if(_0x29aefa){return[_0x29aefa,![]];}return db[_0x5adb('0x70')][_0x5adb('0x5c')]({'UserId':_0x37720e[_0x5adb('0x56')]['id'],'ContactId':_0x4c8e26['id'],'FaxAccountId':_0x4b0530['id'],'fax':_0x37720e[_0x5adb('0x5f')]['to'][0x0],'firstMsgDirection':_0x5adb('0xad'),'Messages':[_[_0x5adb('0x49')](_0x37720e[_0x5adb('0x5f')],{'read':![],'body':_0x37720e[_0x5adb('0x5f')][_0x5adb('0xa1')][0x0][_0x5adb('0xae')],'FaxAccountId':_0x4b0530['id'],'UserId':_0x37720e[_0x5adb('0x56')]['id'],'ContactId':_0x4c8e26['id'],'AttachmentId':_0x37720e['body'][_0x5adb('0xa1')][0x0]['id']})]},{'include':[{'model':db[_0x5adb('0x9d')],'as':_0x5adb('0xaf')}]})[_0x5adb('0x33')](function(_0x317071){return[_0x317071,!![]];});});}else{throw new Error(_0x5adb('0xb0'));}})['spread'](function(_0x337dcd,_0x12872a){if(_0x12872a){return _0x337dcd;}return db[_0x5adb('0x9d')][_0x5adb('0x5c')]({'direction':_0x5adb('0xad'),'read':![],'body':_0x37720e[_0x5adb('0x5f')][_0x5adb('0xa1')][0x0][_0x5adb('0xae')],'FaxAccountId':_0x4b0530['id'],'FaxInteractionId':_0x337dcd['id'],'UserId':_0x37720e['user']['id'],'ContactId':_0x337dcd[_0x5adb('0xb1')],'AttachmentId':_0x37720e[_0x5adb('0x5f')]['attachments'][0x0]['id']})[_0x5adb('0x33')](function(_0x5aa725){_0x337dcd[_0x5adb('0xb2')][_0x5adb('0xaf')]=[];_0x337dcd[_0x5adb('0xb2')][_0x5adb('0xaf')][_0x5adb('0x85')](_0x5aa725['dataValues']);return _0x337dcd;});})['then'](function(_0x55144f){respondWithRpcPromise(_0x5adb('0xb3'),_0x5adb('0xb3'),{'FaxAccountId':_[_0x5adb('0xa5')](_0x37720e['params']['id'])?undefined:_0x37720e['params']['id'],'path':_[_0x5adb('0xa5')](_0x37720e[_0x5adb('0x5f')][_0x5adb('0xa1')][0x0]['path'])?undefined:_0x37720e['body'][_0x5adb('0xa1')][0x0][_0x5adb('0xa6')],'fax':_[_0x5adb('0xa5')](_0x37720e[_0x5adb('0x5f')]['to'][0x0])?undefined:_0x37720e[_0x5adb('0x5f')]['to'][0x0],'AttachmentId':_0x37720e[_0x5adb('0x5f')]['attachments'][0x0]['id']},client9002)['then'](function(_0x26210b){logger[_0x5adb('0x27')](_0x5adb('0xb4'),_0x26210b);})[_0x5adb('0x53')](function(_0x3a85e5){logger['info']('SendFaxRpc,\x20%s',_0x3a85e5);});return _0x55144f;})['then'](respondWithResult(_0x2072e2,null))[_0x5adb('0x53')](handleError(_0x2072e2,null));};exports[_0x5adb('0xb5')]=function(_0x5358ed,_0x4911b8,_0x762500){return db[_0x5adb('0x3b')][_0x5adb('0x55')]({'where':{'id':_0x5358ed[_0x5adb('0x60')]['id']}})[_0x5adb('0x33')](handleEntityNotFound(_0x4911b8,null))[_0x5adb('0x33')](function(_0x166372){if(_0x166372){return _0x166372[_0x5adb('0xb5')](_0x5358ed['body'][_0x5adb('0x6e')],_[_0x5adb('0x6f')](_0x5358ed[_0x5adb('0x5f')],[_0x5adb('0x6e'),'id'])||{})[_0x5adb('0xb6')](function(_0x3e78e9){for(var _0x2aff20=0x0;_0x2aff20<_0x5358ed[_0x5adb('0x5f')]['ids'][_0x5adb('0x42')];_0x2aff20+=0x1){socket['emit'](_0x5adb('0xb7'),{'UserId':_0x5358ed['body']['ids'][_0x2aff20],'FaxAccountId':_0x5358ed['params']['id']});}return _0x3e78e9;});}})['then'](respondWithResult(_0x4911b8,null))[_0x5adb('0x53')](handleError(_0x4911b8,null));};exports[_0x5adb('0xb8')]=function(_0x34fd0f,_0x1cf766,_0x337051){return db['FaxAccount'][_0x5adb('0x55')]({'where':{'id':_0x34fd0f[_0x5adb('0x60')]['id']}})[_0x5adb('0x33')](handleEntityNotFound(_0x1cf766,null))[_0x5adb('0x33')](function(_0xa3233c){if(_0xa3233c){return _0xa3233c['removeAgents'](_0x34fd0f['query']['ids'])[_0x5adb('0x33')](function(){if(_['isArray'](_0x34fd0f['query']['ids'])){for(var _0x4a1cd2=0x0;_0x4a1cd2<_0x34fd0f[_0x5adb('0x3d')][_0x5adb('0x6e')][_0x5adb('0x42')];_0x4a1cd2+=0x1){socket[_0x5adb('0xb9')]('userFaxAccount:remove',{'UserId':Number(_0x34fd0f[_0x5adb('0x3d')][_0x5adb('0x6e')][_0x4a1cd2]),'FaxAccountId':Number(_0x34fd0f[_0x5adb('0x60')]['id'])});}}else{socket[_0x5adb('0xb9')](_0x5adb('0xba'),{'UserId':Number(_0x34fd0f['query']['ids']),'FaxAccountId':Number(_0x34fd0f[_0x5adb('0x60')]['id'])});}});}})[_0x5adb('0x33')](respondWithStatusCode(_0x1cf766,null))[_0x5adb('0x53')](handleError(_0x1cf766,null));};exports[_0x5adb('0xbb')]=function(_0x1b45cf,_0x2cc9c0,_0x1eea98){var _0x17ae02={};var _0x9e204d={};var _0x1dd7aa;var _0x2aac56;return db['FaxAccount'][_0x5adb('0x65')]({'where':{'id':_0x1b45cf['params']['id']}})[_0x5adb('0x33')](handleEntityNotFound(_0x2cc9c0,null))[_0x5adb('0x33')](function(_0x5b93c7){if(_0x5b93c7){_0x1dd7aa=_0x5b93c7;_0x9e204d[_0x5adb('0x40')]=_[_0x5adb('0x3c')](db[_0x5adb('0x72')]['rawAttributes']);_0x9e204d['query']=_[_0x5adb('0x3c')](_0x1b45cf[_0x5adb('0x3d')]);_0x9e204d['filters']=_['intersection'](_0x9e204d['model'],_0x9e204d[_0x5adb('0x3d')]);_0x17ae02[_0x5adb('0x41')]=_[_0x5adb('0x3f')](_0x9e204d[_0x5adb('0x40')],qs[_0x5adb('0x54')](_0x1b45cf[_0x5adb('0x3d')][_0x5adb('0x54')]));_0x17ae02[_0x5adb('0x41')]=_0x17ae02[_0x5adb('0x41')][_0x5adb('0x42')]?_0x17ae02['attributes']:_0x9e204d['model'];_0x17ae02[_0x5adb('0x45')]=qs[_0x5adb('0x46')](_0x1b45cf[_0x5adb('0x3d')][_0x5adb('0x46')]);_0x17ae02[_0x5adb('0x48')]=qs['filters'](_[_0x5adb('0x47')](_0x1b45cf[_0x5adb('0x3d')],_0x9e204d[_0x5adb('0x3e')]));if(_0x1b45cf[_0x5adb('0x3d')]['filter']){_0x17ae02[_0x5adb('0x48')]=_['merge'](_0x17ae02[_0x5adb('0x48')],{'$or':_[_0x5adb('0x4a')](_0x17ae02[_0x5adb('0x41')],function(_0x495dc7){var _0x38b5a1={};_0x38b5a1[_0x495dc7]={'$like':'%'+_0x1b45cf[_0x5adb('0x3d')][_0x5adb('0x4e')]+'%'};return _0x38b5a1;})});}_0x17ae02=_[_0x5adb('0x49')]({},_0x17ae02,_0x1b45cf['options']);return _0x1dd7aa['getAgents'](_0x17ae02);}})[_0x5adb('0x33')](function(_0x477983){if(_0x477983){_0x2aac56=_0x477983[_0x5adb('0x42')];if(!_0x1b45cf[_0x5adb('0x3d')]['hasOwnProperty'](_0x5adb('0x44'))){_0x17ae02[_0x5adb('0x2f')]=qs[_0x5adb('0x2f')](_0x1b45cf[_0x5adb('0x3d')]['limit']);_0x17ae02['offset']=qs['offset'](_0x1b45cf[_0x5adb('0x3d')][_0x5adb('0x2e')]);}return _0x1dd7aa[_0x5adb('0xbb')](_0x17ae02);}})[_0x5adb('0x33')](function(_0x2f6e6e){if(_0x2f6e6e){return _0x2f6e6e?{'count':_0x2aac56,'rows':_0x2f6e6e}:null;}})[_0x5adb('0x33')](respondWithResult(_0x2cc9c0,null))[_0x5adb('0x53')](handleError(_0x2cc9c0,null));}; \ No newline at end of file +var _0x056b=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','type','VIRTUAL','field','filter','merge','options','includeAll','include','rows','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','params','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','where','map','findAll','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','length','CmContact','Contact','User','Owner','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','system','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','Wait','ReceiveFax','VoiceExtension','bulkCreate','tech','key','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','isNil','from','\x22%s\x22\x20<%s>','fax','List','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto'];(function(_0x28a134,_0x17009b){var _0x1610d8=function(_0x947961){while(--_0x947961){_0x28a134['push'](_0x28a134['shift']());}};_0x1610d8(++_0x17009b);}(_0x056b,0xb6));var _0xb056=function(_0x2eee38,_0x44a0ad){_0x2eee38=_0x2eee38-0x0;var _0x4a3fc6=_0x056b[_0x2eee38];return _0x4a3fc6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb056('0x0'));var rimraf=require(_0xb056('0x1'));var zipdir=require(_0xb056('0x2'));var jsonpatch=require(_0xb056('0x3'));var rp=require(_0xb056('0x4'));var moment=require(_0xb056('0x5'));var BPromise=require(_0xb056('0x6'));var Mustache=require(_0xb056('0x7'));var util=require(_0xb056('0x8'));var path=require(_0xb056('0x9'));var sox=require(_0xb056('0xa'));var csv=require('to-csv');var ejs=require(_0xb056('0xb'));var fs=require('fs');var _=require(_0xb056('0xc'));var squel=require(_0xb056('0xd'));var crypto=require(_0xb056('0xe'));var jsforce=require(_0xb056('0xf'));var deskjs=require(_0xb056('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb056('0x11'));var Redis=require(_0xb056('0x12'));var authService=require(_0xb056('0x13'));var qs=require(_0xb056('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb056('0x15'))('api');var utils=require(_0xb056('0x16'));var config=require(_0xb056('0x17'));var db=require(_0xb056('0x18'))['db'];config[_0xb056('0x19')]=_[_0xb056('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb056('0x1b'))(new Redis(config[_0xb056('0x19')]));require('./faxAccount.socket')[_0xb056('0x1c')](socket);var jayson=require(_0xb056('0x1d'));var client=jayson[_0xb056('0x1e')][_0xb056('0x1f')]({'port':0x232c});var client9002=jayson[_0xb056('0x1e')][_0xb056('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x179e49,_0x4b838e,_0x162146){if(_0x162146){var _0x43565e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x43565e[_0xb056('0x20')](_0x4b838e)){return _0x179e49;}else{throw new Error(_0xb056('0x21'));}}else{return _0x179e49;}}function respondWithRpcPromise(_0x5a4ef1,_0x16085d,_0x4e501a,_0x2daffc){return new BPromise(function(_0x311eb9,_0x48e140){var _0x29c77e=_0x2daffc||client;return _0x29c77e['request'](_0x5a4ef1,_0x4e501a)[_0xb056('0x22')](function(_0x2038c6){logger['info'](_0xb056('0x23'),_0x16085d,'request\x20sent');logger[_0xb056('0x24')](_0xb056('0x25'),_0x16085d,_0xb056('0x26'),JSON[_0xb056('0x27')](_0x2038c6));if(_0x2038c6['error']){if(_0x2038c6[_0xb056('0x28')]['code']===0x1f4){logger[_0xb056('0x28')]('FaxAccount,\x20%s,\x20%s',_0x16085d,_0x2038c6[_0xb056('0x28')][_0xb056('0x29')]);return _0x48e140(_0x2038c6[_0xb056('0x28')][_0xb056('0x29')]);}logger[_0xb056('0x28')](_0xb056('0x23'),_0x16085d,_0x2038c6['error'][_0xb056('0x29')]);return _0x311eb9(_0x2038c6[_0xb056('0x28')][_0xb056('0x29')]);}else{logger[_0xb056('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x16085d,_0xb056('0x26'));_0x311eb9(_0x2038c6[_0xb056('0x2b')]['message']);}})[_0xb056('0x2c')](function(_0x265782){logger[_0xb056('0x28')](_0xb056('0x23'),_0x16085d,_0x265782);_0x48e140(_0x265782);});});}function respondWithStatusCode(_0x20a6c6,_0x4024d7){_0x4024d7=_0x4024d7||0xcc;return function(_0x211898){if(_0x211898){return _0x20a6c6[_0xb056('0x2d')](_0x4024d7);}return _0x20a6c6['status'](_0x4024d7)[_0xb056('0x2e')]();};}function respondWithResult(_0x51b06b,_0x3d83d3){_0x3d83d3=_0x3d83d3||0xc8;return function(_0x9c6f4a){if(_0x9c6f4a){return _0x51b06b[_0xb056('0x2f')](_0x3d83d3)['json'](_0x9c6f4a);}};}function respondWithFilteredResult(_0xd53267,_0x264569){return function(_0x4ba5f8){if(_0x4ba5f8){var _0x3a9e7d=_0x4ba5f8[_0xb056('0x30')],_0x43aa63=_0x264569['offset'],_0x329eaa=_0x264569[_0xb056('0x31')]+_0x264569[_0xb056('0x32')],_0x1fad05;if(_0x329eaa>=_0x3a9e7d){_0x329eaa=_0x3a9e7d;_0x1fad05=0xc8;}else{_0x1fad05=0xce;}_0xd53267[_0xb056('0x2f')](_0x1fad05);return _0xd53267[_0xb056('0x33')](_0xb056('0x34'),_0x43aa63+'-'+_0x329eaa+'/'+_0x3a9e7d)['json'](_0x4ba5f8);}return null;};}function patchUpdates(_0x16bbd2){return function(_0x290807){try{jsonpatch[_0xb056('0x35')](_0x290807,_0x16bbd2,!![]);}catch(_0x3afb2c){return BPromise[_0xb056('0x36')](_0x3afb2c);}return _0x290807[_0xb056('0x37')]();};}function saveUpdates(_0x19f277,_0x4522ef){return function(_0x54eda7){if(_0x54eda7){return _0x54eda7[_0xb056('0x38')](_0x19f277)['then'](function(_0x45975d){return _0x45975d;});}return null;};}function removeEntity(_0x4dffe5,_0x53bc89){return function(_0x2f8339){if(_0x2f8339){return _0x2f8339[_0xb056('0x39')]()[_0xb056('0x22')](function(){var _0x1b7934=_0x2f8339[_0xb056('0x3a')]({'plain':!![]});var _0x293f5c=_0xb056('0x3b');return db['UserProfileResource'][_0xb056('0x39')]({'where':{'type':_0x293f5c,'resourceId':_0x1b7934['id']}})[_0xb056('0x22')](function(){return _0x2f8339;});})['then'](function(){_0x4dffe5['status'](0xcc)[_0xb056('0x2e')]();});}};}function handleEntityNotFound(_0xb2d52a,_0x7e1f72){return function(_0x5c911b){if(!_0x5c911b){_0xb2d52a[_0xb056('0x2d')](0x194);}return _0x5c911b;};}function handleError(_0x3a7bac,_0x10b32d){_0x10b32d=_0x10b32d||0x1f4;return function(_0x2eed72){logger[_0xb056('0x28')](_0x2eed72[_0xb056('0x3c')]);if(_0x2eed72[_0xb056('0x3d')]){delete _0x2eed72[_0xb056('0x3d')];}_0x3a7bac[_0xb056('0x2f')](_0x10b32d)[_0xb056('0x3e')](_0x2eed72);};}exports[_0xb056('0x3f')]=function(_0x1afc7f,_0x560fca){var _0x40d1cf={'include':[{'model':db[_0xb056('0x40')],'as':_0xb056('0x41')}]},_0x4acc94={},_0x321333={'count':0x0,'rows':[]};var _0xa8b5cd=db[_0xb056('0x42')][_0xb056('0x43')];_0x4acc94[_0xb056('0x44')]=_[_0xb056('0x45')](_0xa8b5cd);_0x4acc94['query']=_[_0xb056('0x45')](_0x1afc7f[_0xb056('0x46')]);_0x4acc94[_0xb056('0x47')]=_[_0xb056('0x48')](_0x4acc94[_0xb056('0x44')],_0x4acc94['query']);_0x40d1cf[_0xb056('0x49')]=_[_0xb056('0x48')](_0x4acc94[_0xb056('0x44')],qs[_0xb056('0x4a')](_0x1afc7f[_0xb056('0x46')][_0xb056('0x4a')]));_0x40d1cf['attributes']=_0x40d1cf[_0xb056('0x49')]['length']?_0x40d1cf[_0xb056('0x49')]:_0x4acc94[_0xb056('0x44')];if(!_0x1afc7f[_0xb056('0x46')][_0xb056('0x4b')](_0xb056('0x4c'))){_0x40d1cf[_0xb056('0x32')]=qs[_0xb056('0x32')](_0x1afc7f[_0xb056('0x46')][_0xb056('0x32')]);_0x40d1cf[_0xb056('0x31')]=qs['offset'](_0x1afc7f[_0xb056('0x46')][_0xb056('0x31')]);}_0x40d1cf[_0xb056('0x4d')]=qs['sort'](_0x1afc7f[_0xb056('0x46')][_0xb056('0x4e')]);_0x40d1cf['where']=qs['filters'](_[_0xb056('0x4f')](_0x1afc7f[_0xb056('0x46')],_0x4acc94[_0xb056('0x47')]));if(_0x1afc7f[_0xb056('0x46')]['filter']){_0x40d1cf['where']=_['merge'](_0x40d1cf['where'],{'$or':_['map'](_0xa8b5cd,function(_0x4a64dd){if(_0x4a64dd[_0xb056('0x50')]['key']!==_0xb056('0x51')){var _0x53f231={};_0x53f231[_0x4a64dd[_0xb056('0x52')]]={'$like':'%'+_0x1afc7f[_0xb056('0x46')][_0xb056('0x53')]+'%'};return _0x53f231;}})});}_0x40d1cf=_[_0xb056('0x54')]({},_0x40d1cf,_0x1afc7f[_0xb056('0x55')]);var _0x1d3f86={'where':_0x40d1cf['where']};return db[_0xb056('0x42')][_0xb056('0x30')](_0x1d3f86)['then'](function(_0x354af1){_0x321333[_0xb056('0x30')]=_0x354af1;if(_0x1afc7f[_0xb056('0x46')][_0xb056('0x56')]){_0x40d1cf[_0xb056('0x57')]=[{'all':!![]}];}return db[_0xb056('0x42')]['findAll'](_0x40d1cf);})[_0xb056('0x22')](function(_0x5e2224){_0x321333[_0xb056('0x58')]=_0x5e2224;return _0x321333;})[_0xb056('0x22')](respondWithFilteredResult(_0x560fca,_0x40d1cf))[_0xb056('0x2c')](handleError(_0x560fca,null));};exports[_0xb056('0x59')]=function(_0xb4e6cc,_0x26cebb){var _0x2b6733={'raw':![],'where':{'id':_0xb4e6cc['params']['id']},'include':[{'model':db[_0xb056('0x40')],'as':_0xb056('0x41')}]},_0x25bb16={};_0x25bb16[_0xb056('0x44')]=_[_0xb056('0x45')](db[_0xb056('0x42')][_0xb056('0x43')]);_0x25bb16[_0xb056('0x46')]=_[_0xb056('0x45')](_0xb4e6cc['query']);_0x25bb16[_0xb056('0x47')]=_[_0xb056('0x48')](_0x25bb16[_0xb056('0x44')],_0x25bb16[_0xb056('0x46')]);_0x2b6733[_0xb056('0x49')]=_[_0xb056('0x48')](_0x25bb16['model'],qs[_0xb056('0x4a')](_0xb4e6cc[_0xb056('0x46')][_0xb056('0x4a')]));_0x2b6733['attributes']=_0x2b6733[_0xb056('0x49')]['length']?_0x2b6733[_0xb056('0x49')]:_0x25bb16[_0xb056('0x44')];if(_0xb4e6cc[_0xb056('0x46')][_0xb056('0x56')]){_0x2b6733['include']=[{'all':!![]}];}_0x2b6733=_[_0xb056('0x54')]({},_0x2b6733,_0xb4e6cc[_0xb056('0x55')]);return db['FaxAccount'][_0xb056('0x5a')](_0x2b6733)[_0xb056('0x22')](handleEntityNotFound(_0x26cebb,null))[_0xb056('0x22')](respondWithResult(_0x26cebb,null))[_0xb056('0x2c')](handleError(_0x26cebb,null));};exports[_0xb056('0x5b')]=function(_0x51bd1b,_0x3a0854){return db[_0xb056('0x42')][_0xb056('0x5b')](_0x51bd1b[_0xb056('0x5c')],{})[_0xb056('0x22')](function(_0x3aedff){var _0x1725cb=_0x51bd1b[_0xb056('0x5d')][_0xb056('0x3a')]({'plain':!![]});if(!_0x1725cb)throw new Error(_0xb056('0x5e'));if(_0x1725cb[_0xb056('0x5f')]===_0xb056('0x5d')){var _0x2ab5a8=_0x3aedff[_0xb056('0x3a')]({'plain':!![]});var _0xf7924b=_0xb056('0x3b');return db[_0xb056('0x60')][_0xb056('0x5a')]({'where':{'name':_0xf7924b,'userProfileId':_0x1725cb[_0xb056('0x61')]},'raw':!![]})[_0xb056('0x22')](function(_0x3a617d){if(_0x3a617d&&_0x3a617d['autoAssociation']===0x0){return db[_0xb056('0x62')][_0xb056('0x5b')]({'name':_0x2ab5a8[_0xb056('0x3d')],'resourceId':_0x2ab5a8['id'],'type':_0x3a617d[_0xb056('0x3d')],'sectionId':_0x3a617d['id']},{})[_0xb056('0x22')](function(){return _0x3aedff;});}else{return _0x3aedff;}})[_0xb056('0x2c')](function(_0x2012b5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2012b5);throw _0x2012b5;});}return _0x3aedff;})[_0xb056('0x22')](respondWithResult(_0x3a0854,0xc9))[_0xb056('0x2c')](handleError(_0x3a0854,null));};exports[_0xb056('0x38')]=function(_0x7b81c7,_0x2e7a8f){if(_0x7b81c7['body']['id']){delete _0x7b81c7[_0xb056('0x5c')]['id'];}return db[_0xb056('0x42')][_0xb056('0x5a')]({'where':{'id':_0x7b81c7[_0xb056('0x63')]['id']},'include':[{'model':db['Pause'],'as':_0xb056('0x41')}]})[_0xb056('0x22')](handleEntityNotFound(_0x2e7a8f,null))[_0xb056('0x22')](saveUpdates(_0x7b81c7['body'],null))[_0xb056('0x22')](respondWithResult(_0x2e7a8f,null))[_0xb056('0x2c')](handleError(_0x2e7a8f,null));};exports[_0xb056('0x39')]=function(_0x5f16f7,_0x278db1){return db[_0xb056('0x42')][_0xb056('0x5a')]({'where':{'id':_0x5f16f7['params']['id']}})[_0xb056('0x22')](handleEntityNotFound(_0x278db1,null))['then'](removeEntity(_0x278db1,null))[_0xb056('0x2c')](handleError(_0x278db1,null));};exports[_0xb056('0x64')]=function(_0x103ff2,_0x556a93){return db[_0xb056('0x42')][_0xb056('0x64')]()['then'](respondWithResult(_0x556a93,null))[_0xb056('0x2c')](handleError(_0x556a93,null));};exports[_0xb056('0x65')]=function(_0x53f15f,_0x31a0d1,_0x4af25b){if(_0x53f15f['body']['id']){delete _0x53f15f['body']['id'];}return db[_0xb056('0x42')]['find']({'where':{'id':_0x53f15f[_0xb056('0x63')]['id']}})['then'](handleEntityNotFound(_0x31a0d1,null))[_0xb056('0x22')](function(_0x2b33ba){if(_0x2b33ba){_0x53f15f[_0xb056('0x5c')][_0xb056('0x66')]=_0x2b33ba['id'];return db['Disposition']['create'](_0x53f15f[_0xb056('0x5c')]);}})[_0xb056('0x22')](respondWithResult(_0x31a0d1,null))[_0xb056('0x2c')](handleError(_0x31a0d1,null));};exports[_0xb056('0x67')]=function(_0x47e509,_0x2d2c20,_0x4d2233){var _0x349d7e={'raw':![],'where':{}};var _0x5f0278={};var _0x2129c5={'count':0x0,'rows':[]};return db['FaxAccount'][_0xb056('0x68')]({'where':{'id':_0x47e509[_0xb056('0x63')]['id']}})[_0xb056('0x22')](handleEntityNotFound(_0x2d2c20,null))[_0xb056('0x22')](function(_0x59e8f0){if(_0x59e8f0){_0x5f0278[_0xb056('0x44')]=_['keys'](db[_0xb056('0x69')][_0xb056('0x43')]);_0x5f0278[_0xb056('0x46')]=_[_0xb056('0x45')](_0x47e509[_0xb056('0x46')]);_0x5f0278[_0xb056('0x47')]=_[_0xb056('0x48')](_0x5f0278[_0xb056('0x44')],_0x5f0278[_0xb056('0x46')]);_0x349d7e[_0xb056('0x49')]=_[_0xb056('0x48')](_0x5f0278[_0xb056('0x44')],qs['fields'](_0x47e509['query'][_0xb056('0x4a')]));_0x349d7e['attributes']=_0x349d7e[_0xb056('0x49')]['length']?_0x349d7e[_0xb056('0x49')]:_0x5f0278['model'];if(!_0x47e509['query']['hasOwnProperty'](_0xb056('0x4c'))){_0x349d7e['limit']=qs['limit'](_0x47e509[_0xb056('0x46')][_0xb056('0x32')]);_0x349d7e[_0xb056('0x31')]=qs['offset'](_0x47e509['query']['offset']);}_0x349d7e[_0xb056('0x4d')]=qs[_0xb056('0x4e')](_0x47e509[_0xb056('0x46')][_0xb056('0x4e')]);_0x349d7e[_0xb056('0x6a')]=qs[_0xb056('0x47')](_[_0xb056('0x4f')](_0x47e509[_0xb056('0x46')],_0x5f0278[_0xb056('0x47')]));_0x349d7e[_0xb056('0x6a')][_0xb056('0x66')]=_0x59e8f0['id'];if(_0x47e509[_0xb056('0x46')][_0xb056('0x53')]){_0x349d7e[_0xb056('0x6a')]=_['merge'](_0x349d7e['where'],{'$or':_[_0xb056('0x6b')](_0x349d7e['attributes'],function(_0x11ef5f){var _0x4532ad={};_0x4532ad[_0x11ef5f]={'$like':'%'+_0x47e509[_0xb056('0x46')][_0xb056('0x53')]+'%'};return _0x4532ad;})});}_0x349d7e=_['merge']({},_0x349d7e,_0x47e509['options']);return db[_0xb056('0x69')][_0xb056('0x30')]({'where':_0x349d7e[_0xb056('0x6a')]})['then'](function(_0x53e1a5){_0x2129c5[_0xb056('0x30')]=_0x53e1a5;if(_0x47e509[_0xb056('0x46')]['includeAll']){_0x349d7e[_0xb056('0x57')]=[{'all':!![]}];}return db[_0xb056('0x69')][_0xb056('0x6c')](_0x349d7e);})[_0xb056('0x22')](function(_0xf637bd){_0x2129c5[_0xb056('0x58')]=_0xf637bd;return _0x2129c5;});}})[_0xb056('0x22')](respondWithFilteredResult(_0x2d2c20,_0x349d7e))[_0xb056('0x2c')](handleError(_0x2d2c20,null));};exports[_0xb056('0x6d')]=function(_0x416d33,_0xfad362,_0x5a7a61){return db[_0xb056('0x42')][_0xb056('0x5a')]({'where':{'id':_0x416d33[_0xb056('0x63')]['id']}})['then'](handleEntityNotFound(_0xfad362,null))[_0xb056('0x22')](function(_0x4dc495){if(_0x4dc495){return _0x4dc495['removeDispositions'](_0x416d33[_0xb056('0x46')][_0xb056('0x6e')]);}})[_0xb056('0x22')](respondWithStatusCode(_0xfad362,null))['catch'](handleError(_0xfad362,null));};exports['addAnswer']=function(_0x210d48,_0x2ae344,_0x4975b7){if(_0x210d48[_0xb056('0x5c')]['id']){delete _0x210d48['body']['id'];}return db[_0xb056('0x42')][_0xb056('0x5a')]({'where':{'id':_0x210d48['params']['id']}})['then'](handleEntityNotFound(_0x2ae344,null))[_0xb056('0x22')](function(_0x1cf122){if(_0x1cf122){_0x210d48['body'][_0xb056('0x66')]=_0x1cf122['id'];return db['CannedAnswer']['create'](_0x210d48[_0xb056('0x5c')]);}})[_0xb056('0x22')](respondWithResult(_0x2ae344,null))[_0xb056('0x2c')](handleError(_0x2ae344,null));};exports[_0xb056('0x6f')]=function(_0x33ba84,_0x3bc460,_0x5c4f3c){var _0x444342={'raw':![],'where':{}};var _0x5b7b5a={};var _0x6dae={'count':0x0,'rows':[]};return db[_0xb056('0x42')]['findOne']({'where':{'id':_0x33ba84[_0xb056('0x63')]['id']}})[_0xb056('0x22')](handleEntityNotFound(_0x3bc460,null))['then'](function(_0x6751b0){if(_0x6751b0){_0x5b7b5a['model']=_[_0xb056('0x45')](db['CannedAnswer'][_0xb056('0x43')]);_0x5b7b5a[_0xb056('0x46')]=_['keys'](_0x33ba84[_0xb056('0x46')]);_0x5b7b5a['filters']=_[_0xb056('0x48')](_0x5b7b5a[_0xb056('0x44')],_0x5b7b5a[_0xb056('0x46')]);_0x444342[_0xb056('0x49')]=_[_0xb056('0x48')](_0x5b7b5a[_0xb056('0x44')],qs[_0xb056('0x4a')](_0x33ba84[_0xb056('0x46')]['fields']));_0x444342[_0xb056('0x49')]=_0x444342['attributes']['length']?_0x444342['attributes']:_0x5b7b5a[_0xb056('0x44')];if(!_0x33ba84[_0xb056('0x46')][_0xb056('0x4b')](_0xb056('0x4c'))){_0x444342['limit']=qs[_0xb056('0x32')](_0x33ba84[_0xb056('0x46')][_0xb056('0x32')]);_0x444342[_0xb056('0x31')]=qs[_0xb056('0x31')](_0x33ba84['query'][_0xb056('0x31')]);}_0x444342[_0xb056('0x4d')]=qs[_0xb056('0x4e')](_0x33ba84['query']['sort']);_0x444342['where']=qs['filters'](_['pick'](_0x33ba84['query'],_0x5b7b5a[_0xb056('0x47')]));_0x444342[_0xb056('0x6a')][_0xb056('0x66')]=_0x6751b0['id'];if(_0x33ba84[_0xb056('0x46')][_0xb056('0x53')]){_0x444342[_0xb056('0x6a')]=_['merge'](_0x444342[_0xb056('0x6a')],{'$or':_[_0xb056('0x6b')](_0x444342[_0xb056('0x49')],function(_0x3e4ba5){var _0x1ff1e7={};_0x1ff1e7[_0x3e4ba5]={'$like':'%'+_0x33ba84[_0xb056('0x46')][_0xb056('0x53')]+'%'};return _0x1ff1e7;})});}_0x444342=_[_0xb056('0x54')]({},_0x444342,_0x33ba84[_0xb056('0x55')]);return db[_0xb056('0x70')]['count']({'where':_0x444342['where']})['then'](function(_0x406887){_0x6dae['count']=_0x406887;if(_0x33ba84[_0xb056('0x46')][_0xb056('0x56')]){_0x444342[_0xb056('0x57')]=[{'all':!![]}];}return db[_0xb056('0x70')][_0xb056('0x6c')](_0x444342);})[_0xb056('0x22')](function(_0x34702f){_0x6dae[_0xb056('0x58')]=_0x34702f;return _0x6dae;});}})[_0xb056('0x22')](respondWithFilteredResult(_0x3bc460,_0x444342))['catch'](handleError(_0x3bc460,null));};exports[_0xb056('0x71')]=function(_0x141dbb,_0x683536,_0x68b905){return db['FaxAccount']['find']({'where':{'id':_0x141dbb[_0xb056('0x63')]['id']}})[_0xb056('0x22')](handleEntityNotFound(_0x683536,null))[_0xb056('0x22')](function(_0x1a3666){if(_0x1a3666){return _0x1a3666[_0xb056('0x71')](_0x141dbb[_0xb056('0x46')][_0xb056('0x6e')]);}})['then'](respondWithStatusCode(_0x683536,null))[_0xb056('0x2c')](handleError(_0x683536,null));};exports['addInteraction']=function(_0x1d7021,_0x3f470e,_0x5ba4b4){return db[_0xb056('0x72')]['find']({'where':{'id':_0x1d7021[_0xb056('0x63')]['id']}})[_0xb056('0x22')](handleEntityNotFound(_0x3f470e,null))[_0xb056('0x22')](function(_0x219aa7){if(_0x219aa7){return _0x219aa7[_0xb056('0x73')](_0x1d7021['body'][_0xb056('0x6e')],_[_0xb056('0x74')](_0x1d7021[_0xb056('0x5c')],[_0xb056('0x6e'),'id'])||{});}})[_0xb056('0x22')](respondWithResult(_0x3f470e,null))[_0xb056('0x2c')](handleError(_0x3f470e,null));};exports[_0xb056('0x75')]=function(_0x7d7cb4,_0x281513,_0x1a9c89){var _0x62da08={'raw':![],'where':{}};var _0x1636e0={};var _0x44a1de={'count':0x0,'rows':[]};return db[_0xb056('0x42')][_0xb056('0x68')]({'where':{'id':_0x7d7cb4[_0xb056('0x63')]['id']}})[_0xb056('0x22')](handleEntityNotFound(_0x281513,null))[_0xb056('0x22')](function(_0x1a8d5b){if(_0x1a8d5b){_0x1636e0[_0xb056('0x44')]=_['keys'](db[_0xb056('0x72')][_0xb056('0x43')]);_0x1636e0[_0xb056('0x46')]=_[_0xb056('0x45')](_0x7d7cb4[_0xb056('0x46')]);_0x1636e0[_0xb056('0x47')]=_[_0xb056('0x48')](_0x1636e0[_0xb056('0x44')],_0x1636e0[_0xb056('0x46')]);_0x62da08[_0xb056('0x49')]=_[_0xb056('0x48')](_0x1636e0['model'],qs['fields'](_0x7d7cb4[_0xb056('0x46')]['fields']));_0x62da08[_0xb056('0x49')]=_0x62da08[_0xb056('0x49')][_0xb056('0x76')]?_0x62da08['attributes']:_0x1636e0[_0xb056('0x44')];if(!_0x7d7cb4[_0xb056('0x46')]['hasOwnProperty']('nolimit')){_0x62da08[_0xb056('0x32')]=qs[_0xb056('0x32')](_0x7d7cb4[_0xb056('0x46')][_0xb056('0x32')]);_0x62da08[_0xb056('0x31')]=qs['offset'](_0x7d7cb4['query'][_0xb056('0x31')]);}_0x62da08['order']=qs[_0xb056('0x4e')](_0x7d7cb4[_0xb056('0x46')][_0xb056('0x4e')]);_0x62da08[_0xb056('0x6a')]=qs['filters'](_[_0xb056('0x4f')](_0x7d7cb4[_0xb056('0x46')],_0x1636e0[_0xb056('0x47')]));_0x62da08[_0xb056('0x6a')][_0xb056('0x66')]=_0x1a8d5b['id'];if(_0x7d7cb4[_0xb056('0x46')][_0xb056('0x53')]){_0x62da08['where']=_[_0xb056('0x54')](_0x62da08[_0xb056('0x6a')],{'$or':_[_0xb056('0x6b')](_0x62da08[_0xb056('0x49')],function(_0x38c9fd){var _0x3d277a={};_0x3d277a[_0x38c9fd]={'$like':'%'+_0x7d7cb4[_0xb056('0x46')]['filter']+'%'};return _0x3d277a;})});}_0x62da08=_[_0xb056('0x54')]({},_0x62da08,_0x7d7cb4[_0xb056('0x55')]);return db[_0xb056('0x72')]['count']({'where':_0x62da08['where']})[_0xb056('0x22')](function(_0x54bd8d){_0x44a1de['count']=_0x54bd8d;if(_0x7d7cb4[_0xb056('0x46')][_0xb056('0x56')]){_0x62da08[_0xb056('0x57')]=[{'model':db[_0xb056('0x77')],'as':_0xb056('0x78'),'required':![]},{'model':db[_0xb056('0x79')],'as':_0xb056('0x7a'),'attributes':[_0xb056('0x3d'),'fullname','internal'],'required':![]},{'model':db[_0xb056('0x7b')],'as':_0xb056('0x7c'),'attributes':['id',_0xb056('0x3d'),_0xb056('0x7d')],'where':_0x7d7cb4[_0xb056('0x46')][_0xb056('0x7e')]?{'id':_0x7d7cb4['query']['tag']}:undefined,'required':_0x7d7cb4['query'][_0xb056('0x7e')]?!![]:![]}];}return db['FaxInteraction'][_0xb056('0x6c')](_0x62da08);})['then'](function(_0x5edbc2){_0x44a1de[_0xb056('0x58')]=_0x5edbc2;return _0x44a1de;});}})[_0xb056('0x22')](respondWithFilteredResult(_0x281513,_0x62da08))[_0xb056('0x2c')](handleError(_0x281513,null));};exports[_0xb056('0x7f')]=function(_0x3d2b1e,_0x2786a9,_0x5729b7){return db[_0xb056('0x42')][_0xb056('0x68')]({'where':{'id':_0x3d2b1e[_0xb056('0x63')]['id']}})[_0xb056('0x22')](handleEntityNotFound(_0x2786a9,null))[_0xb056('0x22')](function(_0x499233){if(_0x499233){return db[_0xb056('0x80')][_0xb056('0x81')](function(_0x3cf0d2){return db[_0xb056('0x82')][_0xb056('0x39')]({'where':{'FaxAccountId':_0x3d2b1e[_0xb056('0x63')]['id']},'transaction':_0x3cf0d2})[_0xb056('0x22')](function(_0x30ce17){var _0x12139=_[_0xb056('0x6b')](_0x3d2b1e[_0xb056('0x5c')],function(_0x5c415b){_0x5c415b[_0xb056('0x66')]=_0x3d2b1e[_0xb056('0x63')]['id'];return _0x5c415b;});return db['FaxApplication']['bulkCreate'](_0x12139,{'transaction':_0x3cf0d2});});})['then'](function(){return db['FaxApplication'][_0xb056('0x83')]({'where':{'FaxAccountId':_0x3d2b1e[_0xb056('0x63')]['id']},'order':_0xb056('0x84')});});}})[_0xb056('0x22')](respondWithResult(_0x2786a9,null))[_0xb056('0x2c')](handleError(_0x2786a9,null));};exports[_0xb056('0x85')]=function(_0x311a23,_0x596b4e,_0x25986e){var _0x539bca={};var _0x51a428={};var _0x33b1ad;var _0x412041;return db[_0xb056('0x42')][_0xb056('0x68')]({'where':{'id':_0x311a23[_0xb056('0x63')]['id']}})[_0xb056('0x22')](handleEntityNotFound(_0x596b4e,null))[_0xb056('0x22')](function(_0x41c53){if(_0x41c53){_0x33b1ad=_0x41c53;_0x51a428[_0xb056('0x44')]=_[_0xb056('0x45')](db[_0xb056('0x82')]['rawAttributes']);_0x51a428['query']=_[_0xb056('0x45')](_0x311a23[_0xb056('0x46')]);_0x51a428[_0xb056('0x47')]=_['intersection'](_0x51a428['model'],_0x51a428['query']);_0x539bca[_0xb056('0x49')]=_[_0xb056('0x48')](_0x51a428['model'],qs['fields'](_0x311a23[_0xb056('0x46')][_0xb056('0x4a')]));_0x539bca[_0xb056('0x49')]=_0x539bca['attributes'][_0xb056('0x76')]?_0x539bca[_0xb056('0x49')]:_0x51a428[_0xb056('0x44')];_0x539bca['order']=qs['sort'](_0x311a23[_0xb056('0x46')]['sort']);_0x539bca[_0xb056('0x6a')]=qs[_0xb056('0x47')](_[_0xb056('0x4f')](_0x311a23[_0xb056('0x46')],_0x51a428[_0xb056('0x47')]));if(_0x311a23[_0xb056('0x46')][_0xb056('0x53')]){_0x539bca[_0xb056('0x6a')]=_[_0xb056('0x54')](_0x539bca[_0xb056('0x6a')],{'$or':_[_0xb056('0x6b')](_0x539bca[_0xb056('0x49')],function(_0x1ee644){var _0xf5e39f={};_0xf5e39f[_0x1ee644]={'$like':'%'+_0x311a23[_0xb056('0x46')][_0xb056('0x53')]+'%'};return _0xf5e39f;})});}_0x539bca=_[_0xb056('0x54')]({},_0x539bca,_0x311a23[_0xb056('0x55')]);return _0x33b1ad[_0xb056('0x85')](_0x539bca);}})[_0xb056('0x22')](function(_0x30a099){if(_0x30a099){_0x412041=_0x30a099[_0xb056('0x76')];if(!_0x311a23[_0xb056('0x46')][_0xb056('0x4b')](_0xb056('0x4c'))){_0x539bca[_0xb056('0x32')]=qs['limit'](_0x311a23[_0xb056('0x46')]['limit']);_0x539bca['offset']=qs[_0xb056('0x31')](_0x311a23['query']['offset']);}return _0x33b1ad[_0xb056('0x85')](_0x539bca);}})[_0xb056('0x22')](function(_0x3b1a0c){if(_0x3b1a0c){return _0x3b1a0c?{'count':_0x412041,'rows':_0x3b1a0c}:null;}})[_0xb056('0x22')](respondWithResult(_0x596b4e,null))['catch'](handleError(_0x596b4e,null));};function Extension(_0xb5ae3,_0x2f0f36,_0x4c44f0,_0x909e81){this[_0xb056('0x86')]=_0xb056('0x87');this[_0xb056('0x88')]=_0xb5ae3['localstationid'];this['app']=_0x909e81;this['type']=_0xb056('0x89');this['description']=_0xb056('0x8a');this['FaxAccountId']=_0xb5ae3['id'];this['priority']=_0x2f0f36;this['appdata']=_0x4c44f0;}function createExtensionsReciveFax(_0x247125){var _0x507843=0x1;var _0x223927=[];_0x223927[_0xb056('0x8b')](new Extension(_0x247125,_0x507843,'',_0xb056('0x8c')));_0x507843+=0x1;_0x223927[_0xb056('0x8b')](new Extension(_0x247125,_0x507843,_0xb056('0x8d'),_0xb056('0x8e')));_0x507843+=0x1;for(var _0x37a153 in _0x247125){if(_0x247125[_0xb056('0x4b')](_0x37a153)&&(_0x37a153===_0xb056('0x8f')||_0x37a153===_0xb056('0x90')||_0x37a153===_0xb056('0x91')||_0x37a153===_0xb056('0x92')||_0x37a153===_0xb056('0x93')||_0x37a153===_0xb056('0x94')||_0x37a153===_0xb056('0x95')||_0x37a153==='modem'||_0x37a153===_0xb056('0x96'))){_0x223927[_0xb056('0x8b')](new Extension(_0x247125,_0x507843,'FAXOPT('+_0x37a153+')='+_0x247125[_0x37a153],'Set'));_0x507843+=0x1;}}_0x223927[_0xb056('0x8b')](new Extension(_0x247125,_0x507843,'6',_0xb056('0x97')));_0x507843+=0x1;_0x223927[_0xb056('0x8b')](new Extension(_0x247125,_0x507843,'/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d',_0xb056('0x98')));_0x507843=0x0;return _0x223927;}exports['addAccountApplications']=function(_0x4a4b8c,_0x5bd3ab,_0x37b0f2){var _0x5863fb;return db[_0xb056('0x80')]['transaction'](function(_0xd7ae1c){return db[_0xb056('0x42')]['create'](_0x4a4b8c['body'],{'transaction':_0xd7ae1c})[_0xb056('0x22')](function(_0x161dce){_0x5863fb=_0x161dce[_0xb056('0x3a')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x5863fb),{'transaction':_0xd7ae1c});});})[_0xb056('0x22')](function(){return _0x5863fb;})[_0xb056('0x22')](respondWithResult(_0x5bd3ab,null))[_0xb056('0x2c')](handleError(_0x5bd3ab,null));};exports['updateAccountApplications']=function(_0x4180dd,_0xd86ae6,_0x547d7e){var _0x4d15ba;return db['sequelize']['transaction'](function(_0x4a8164){return db['FaxAccount'][_0xb056('0x38')](_0x4180dd[_0xb056('0x5c')],{'where':{'id':_0x4180dd[_0xb056('0x5c')]['id']},'transaction':_0x4a8164})[_0xb056('0x22')](function(_0x4b0f9e){return db[_0xb056('0x99')][_0xb056('0x39')]({'where':{'FaxAccountId':_0x4180dd[_0xb056('0x5c')]['id']},'transaction':_0x4a8164})[_0xb056('0x22')](function(_0x51b113){return db[_0xb056('0x99')][_0xb056('0x9a')](createExtensionsReciveFax(_[_0xb056('0x74')](_0x4180dd[_0xb056('0x5c')],[_0xb056('0x9b'),_0xb056('0x9c'),_0xb056('0x9d'),'updatedAt',_0xb056('0x9e'),_0xb056('0x9f')])),{'transaction':_0x4a8164});});});})[_0xb056('0x22')](function(){return db['FaxAccount'][_0xb056('0xa0')](_0x4180dd[_0xb056('0x5c')]['id']);})[_0xb056('0x22')](respondWithResult(_0xd86ae6,null))[_0xb056('0x2c')](handleError(_0xd86ae6,null));};exports[_0xb056('0xa1')]=function(_0x1bd4dd,_0x4ca7c8,_0x54fd0e){var _0x327dac={'raw':!![],'where':{}};var _0x471a29={};var _0x2753d4={'count':0x0,'rows':[]};return db[_0xb056('0x42')][_0xb056('0x68')]({'where':{'id':_0x1bd4dd['params']['id']}})['then'](handleEntityNotFound(_0x4ca7c8,null))[_0xb056('0x22')](function(_0x586b4d){if(_0x586b4d){_0x471a29[_0xb056('0x44')]=_['keys'](db[_0xb056('0xa2')][_0xb056('0x43')]);_0x471a29[_0xb056('0x46')]=_[_0xb056('0x45')](_0x1bd4dd['query']);_0x471a29['filters']=_[_0xb056('0x48')](_0x471a29[_0xb056('0x44')],_0x471a29[_0xb056('0x46')]);_0x327dac[_0xb056('0x49')]=_[_0xb056('0x48')](_0x471a29['model'],qs['fields'](_0x1bd4dd[_0xb056('0x46')][_0xb056('0x4a')]));_0x327dac[_0xb056('0x49')]=_0x327dac['attributes'][_0xb056('0x76')]?_0x327dac[_0xb056('0x49')]:_0x471a29[_0xb056('0x44')];if(!_0x1bd4dd['query']['hasOwnProperty'](_0xb056('0x4c'))){_0x327dac[_0xb056('0x32')]=qs[_0xb056('0x32')](_0x1bd4dd[_0xb056('0x46')][_0xb056('0x32')]);_0x327dac[_0xb056('0x31')]=qs[_0xb056('0x31')](_0x1bd4dd[_0xb056('0x46')][_0xb056('0x31')]);}_0x327dac['order']=qs['sort'](_0x1bd4dd[_0xb056('0x46')]['sort']);_0x327dac[_0xb056('0x6a')]=qs[_0xb056('0x47')](_[_0xb056('0x4f')](_0x1bd4dd['query'],_0x471a29[_0xb056('0x47')]));_0x327dac[_0xb056('0x6a')][_0xb056('0x66')]=_0x586b4d['id'];if(_0x1bd4dd[_0xb056('0x46')][_0xb056('0x53')]){_0x327dac['where']=_['merge'](_0x327dac[_0xb056('0x6a')],{'$or':_[_0xb056('0x6b')](_0x327dac[_0xb056('0x49')],function(_0x4c743d){var _0xefbddd={};_0xefbddd[_0x4c743d]={'$like':'%'+_0x1bd4dd[_0xb056('0x46')][_0xb056('0x53')]+'%'};return _0xefbddd;})});}if(_0x1bd4dd['query'][_0xb056('0xa3')]){var _0xad2843=_0x1bd4dd[_0xb056('0x46')][_0xb056('0xa3')]['split'](',');var _0x345894={};_0x345894[_0xad2843[0x0]]={'$gte':moment(_0xad2843[0x1])[_0xb056('0xa4')](_0xb056('0xa5'))};_0x327dac['where']=_[_0xb056('0x54')](_0x327dac['where'],_0x345894);}_0x327dac=_['merge']({},_0x327dac,_0x1bd4dd[_0xb056('0x55')]);return db[_0xb056('0xa2')][_0xb056('0x30')]({'where':_0x327dac[_0xb056('0x6a')]})['then'](function(_0x30fc8a){_0x2753d4[_0xb056('0x30')]=_0x30fc8a;if(_0x1bd4dd[_0xb056('0x46')][_0xb056('0x56')]){_0x327dac['include']=[{'all':!![]}];}return db[_0xb056('0xa2')][_0xb056('0x6c')](_0x327dac);})['then'](function(_0x235008){_0x2753d4['rows']=_0x235008;return _0x2753d4;});}})[_0xb056('0x22')](respondWithFilteredResult(_0x4ca7c8,_0x327dac))['catch'](handleError(_0x4ca7c8,null));};exports[_0xb056('0x3e')]=function(_0x431400,_0x318997,_0x11c074){var _0xfc2315,_0x56114a={},_0x3565f1;if(_0x431400[_0xb056('0x5c')]['to']){_0x3565f1=_0x431400[_0xb056('0x5c')]['to'][0x0];}return db[_0xb056('0x42')][_0xb056('0x5a')]({'where':{'id':_0x431400['params']['id']},'include':[{'model':db[_0xb056('0xa6')],'as':'List','include':[{'model':db['CmContact'],'as':_0xb056('0xa7'),'where':{'fax':_0x3565f1},'limit':0x1,'order':[[_0xb056('0xa8'),_0xb056('0xa9')]]}]}]})[_0xb056('0x22')](handleEntityNotFound(_0x318997,null))[_0xb056('0x22')](function(_0x1417bc){_0xfc2315=_0x1417bc;if(_0x431400['body'][_0xb056('0xaa')]&&_0x431400[_0xb056('0x5c')][_0xb056('0xaa')][_0xb056('0x76')]){for(var _0x1f9eb2=0x0;_0x1f9eb2<_0x431400[_0xb056('0x5c')]['attachments'][_0xb056('0x76')];_0x1f9eb2+=0x1){_0x431400['body']['attachments'][_0x1f9eb2]={'filename':_0x431400['body'][_0xb056('0xaa')][_0x1f9eb2][_0xb056('0x3d')],'id':_0x431400[_0xb056('0x5c')][_0xb056('0xaa')][_0x1f9eb2]['id'],'path':path[_0xb056('0xab')](config[_0xb056('0xac')],_0xb056('0xad'),_0x431400['body']['attachments'][_0x1f9eb2][_0xb056('0xae')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0xb056('0xaf')](_0x431400[_0xb056('0x63')]['id'])?undefined:_0x431400[_0xb056('0x63')]['id'],'path':_['isNil'](_0x431400[_0xb056('0x5c')][_0xb056('0xaa')][0x0][_0xb056('0x9')])?undefined:_0x431400[_0xb056('0x5c')][_0xb056('0xaa')][0x0][_0xb056('0x9')],'fax':_[_0xb056('0xaf')](_0x431400[_0xb056('0x5c')]['to'][0x0])?undefined:_0x431400[_0xb056('0x5c')]['to'][0x0]},client9002);})[_0xb056('0x22')](function(){if(_0xfc2315){if(_[_0xb056('0xaf')](_0x431400[_0xb056('0x5c')]['from'])){_0x431400[_0xb056('0x5c')][_0xb056('0xb0')]=util[_0xb056('0xa4')](_0xb056('0xb1'),_0xfc2315['name'],_0xfc2315[_0xb056('0xb2')]);}if(_0xfc2315[_0xb056('0xb3')]){if(_0xfc2315['List'][_0xb056('0xa7')]['length']){return _0xfc2315[_0xb056('0xb3')][_0xb056('0xa7')][0x0];}else{return db[_0xb056('0x77')][_0xb056('0x5b')](_[_0xb056('0x1a')](_0x431400[_0xb056('0x5c')],{'firstName':_0x431400[_0xb056('0x5c')]['to'][0x0],'phone':_0x431400[_0xb056('0x5c')]['to'][0x0],'fax':_0x431400[_0xb056('0x5c')]['to'][0x0],'ListId':_0xfc2315[_0xb056('0x9f')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xb056('0xb4'));}})[_0xb056('0x22')](function(_0x240833){if(_0x240833){return db['FaxInteraction']['find']({'where':{'ContactId':_0x240833['id'],'closed':![],'FaxAccountId':_0xfc2315['id']}})[_0xb056('0x22')](function(_0xcfa6ee){if(_0xcfa6ee){return[_0xcfa6ee,![]];}return db[_0xb056('0x72')][_0xb056('0x5b')]({'UserId':_0x431400['user']['id'],'ContactId':_0x240833['id'],'FaxAccountId':_0xfc2315['id'],'fax':_0x431400['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xb056('0x54')](_0x431400[_0xb056('0x5c')],{'read':![],'body':_0x431400[_0xb056('0x5c')][_0xb056('0xaa')][0x0][_0xb056('0xb5')],'FaxAccountId':_0xfc2315['id'],'UserId':_0x431400[_0xb056('0x5d')]['id'],'ContactId':_0x240833['id'],'AttachmentId':_0x431400[_0xb056('0x5c')][_0xb056('0xaa')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xb056('0xb6')}]})[_0xb056('0x22')](function(_0x54812e){return[_0x54812e,!![]];});});}else{throw new Error(_0xb056('0xb7'));}})[_0xb056('0xb8')](function(_0x31fcf6,_0x4edc9d){if(_0x4edc9d){return _0x31fcf6;}return db[_0xb056('0xa2')][_0xb056('0x5b')]({'direction':_0xb056('0xb9'),'read':![],'body':_0x431400[_0xb056('0x5c')][_0xb056('0xaa')][0x0][_0xb056('0xb5')],'FaxAccountId':_0xfc2315['id'],'FaxInteractionId':_0x31fcf6['id'],'UserId':_0x431400[_0xb056('0x5d')]['id'],'ContactId':_0x31fcf6[_0xb056('0xba')],'AttachmentId':_0x431400[_0xb056('0x5c')][_0xb056('0xaa')][0x0]['id']})[_0xb056('0x22')](function(_0x2e9f13){_0x31fcf6[_0xb056('0xbb')][_0xb056('0xb6')]=[];_0x31fcf6[_0xb056('0xbb')][_0xb056('0xb6')]['push'](_0x2e9f13[_0xb056('0xbb')]);return _0x31fcf6;});})['then'](function(_0x21692c){respondWithRpcPromise(_0xb056('0xbc'),'SendFax',{'FaxAccountId':_['isNil'](_0x431400[_0xb056('0x63')]['id'])?undefined:_0x431400[_0xb056('0x63')]['id'],'path':_['isNil'](_0x431400[_0xb056('0x5c')][_0xb056('0xaa')][0x0][_0xb056('0x9')])?undefined:_0x431400['body'][_0xb056('0xaa')][0x0]['path'],'fax':_[_0xb056('0xaf')](_0x431400[_0xb056('0x5c')]['to'][0x0])?undefined:_0x431400[_0xb056('0x5c')]['to'][0x0],'AttachmentId':_0x431400[_0xb056('0x5c')]['attachments'][0x0]['id']},client9002)[_0xb056('0x22')](function(_0x479fab){logger[_0xb056('0x2a')]('SendFaxRpc,\x20%s',_0x479fab);})[_0xb056('0x2c')](function(_0x59525e){logger['info'](_0xb056('0xbd'),_0x59525e);});return _0x21692c;})[_0xb056('0x22')](respondWithResult(_0x318997,null))[_0xb056('0x2c')](handleError(_0x318997,null));};exports[_0xb056('0xbe')]=function(_0x1b6c85,_0x5a4fe7,_0x16b2a3){return db[_0xb056('0x42')][_0xb056('0x5a')]({'where':{'id':_0x1b6c85[_0xb056('0x63')]['id']}})['then'](handleEntityNotFound(_0x5a4fe7,null))['then'](function(_0x3c7af6){if(_0x3c7af6){return _0x3c7af6[_0xb056('0xbe')](_0x1b6c85[_0xb056('0x5c')][_0xb056('0x6e')],_[_0xb056('0x74')](_0x1b6c85[_0xb056('0x5c')],['ids','id'])||{})['spread'](function(_0x14ec53){for(var _0x27f010=0x0;_0x27f010<_0x1b6c85[_0xb056('0x5c')][_0xb056('0x6e')][_0xb056('0x76')];_0x27f010+=0x1){socket[_0xb056('0xbf')](_0xb056('0xc0'),{'UserId':_0x1b6c85[_0xb056('0x5c')][_0xb056('0x6e')][_0x27f010],'FaxAccountId':_0x1b6c85[_0xb056('0x63')]['id']});}return _0x14ec53;});}})[_0xb056('0x22')](respondWithResult(_0x5a4fe7,null))['catch'](handleError(_0x5a4fe7,null));};exports[_0xb056('0xc1')]=function(_0x4a75c0,_0x546b68,_0x5058fe){return db[_0xb056('0x42')][_0xb056('0x5a')]({'where':{'id':_0x4a75c0[_0xb056('0x63')]['id']}})['then'](handleEntityNotFound(_0x546b68,null))[_0xb056('0x22')](function(_0x53eeeb){if(_0x53eeeb){return _0x53eeeb['removeAgents'](_0x4a75c0[_0xb056('0x46')][_0xb056('0x6e')])[_0xb056('0x22')](function(){if(_[_0xb056('0xc2')](_0x4a75c0['query']['ids'])){for(var _0x508970=0x0;_0x508970<_0x4a75c0[_0xb056('0x46')]['ids'][_0xb056('0x76')];_0x508970+=0x1){socket['emit'](_0xb056('0xc3'),{'UserId':Number(_0x4a75c0[_0xb056('0x46')][_0xb056('0x6e')][_0x508970]),'FaxAccountId':Number(_0x4a75c0[_0xb056('0x63')]['id'])});}}else{socket[_0xb056('0xbf')]('userFaxAccount:remove',{'UserId':Number(_0x4a75c0[_0xb056('0x46')][_0xb056('0x6e')]),'FaxAccountId':Number(_0x4a75c0['params']['id'])});}});}})[_0xb056('0x22')](respondWithStatusCode(_0x546b68,null))[_0xb056('0x2c')](handleError(_0x546b68,null));};exports['getAgents']=function(_0x110b94,_0x5192f2,_0x2bdc1e){var _0x4ccdc8={};var _0x58473c={};var _0x3e467f;var _0x1be45a;return db[_0xb056('0x42')][_0xb056('0x68')]({'where':{'id':_0x110b94['params']['id']}})[_0xb056('0x22')](handleEntityNotFound(_0x5192f2,null))[_0xb056('0x22')](function(_0x91a7ba){if(_0x91a7ba){_0x3e467f=_0x91a7ba;_0x58473c['model']=_[_0xb056('0x45')](db[_0xb056('0x79')][_0xb056('0x43')]);_0x58473c[_0xb056('0x46')]=_['keys'](_0x110b94[_0xb056('0x46')]);_0x58473c[_0xb056('0x47')]=_['intersection'](_0x58473c[_0xb056('0x44')],_0x58473c['query']);_0x4ccdc8[_0xb056('0x49')]=_[_0xb056('0x48')](_0x58473c[_0xb056('0x44')],qs[_0xb056('0x4a')](_0x110b94[_0xb056('0x46')][_0xb056('0x4a')]));_0x4ccdc8[_0xb056('0x49')]=_0x4ccdc8[_0xb056('0x49')][_0xb056('0x76')]?_0x4ccdc8['attributes']:_0x58473c['model'];_0x4ccdc8[_0xb056('0x4d')]=qs[_0xb056('0x4e')](_0x110b94[_0xb056('0x46')][_0xb056('0x4e')]);_0x4ccdc8[_0xb056('0x6a')]=qs[_0xb056('0x47')](_['pick'](_0x110b94[_0xb056('0x46')],_0x58473c[_0xb056('0x47')]));if(_0x110b94[_0xb056('0x46')][_0xb056('0x53')]){_0x4ccdc8['where']=_[_0xb056('0x54')](_0x4ccdc8[_0xb056('0x6a')],{'$or':_[_0xb056('0x6b')](_0x4ccdc8['attributes'],function(_0x2418b0){var _0x32b4f1={};_0x32b4f1[_0x2418b0]={'$like':'%'+_0x110b94[_0xb056('0x46')][_0xb056('0x53')]+'%'};return _0x32b4f1;})});}_0x4ccdc8=_[_0xb056('0x54')]({},_0x4ccdc8,_0x110b94[_0xb056('0x55')]);return _0x3e467f[_0xb056('0xc4')](_0x4ccdc8);}})['then'](function(_0x255ee5){if(_0x255ee5){_0x1be45a=_0x255ee5[_0xb056('0x76')];if(!_0x110b94[_0xb056('0x46')][_0xb056('0x4b')](_0xb056('0x4c'))){_0x4ccdc8[_0xb056('0x32')]=qs['limit'](_0x110b94[_0xb056('0x46')][_0xb056('0x32')]);_0x4ccdc8[_0xb056('0x31')]=qs['offset'](_0x110b94[_0xb056('0x46')][_0xb056('0x31')]);}return _0x3e467f[_0xb056('0xc4')](_0x4ccdc8);}})[_0xb056('0x22')](function(_0x39a652){if(_0x39a652){return _0x39a652?{'count':_0x1be45a,'rows':_0x39a652}:null;}})[_0xb056('0x22')](respondWithResult(_0x5192f2,null))['catch'](handleError(_0x5192f2,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 7e20f4a..04051aa 100644 --- a/server/api/faxAccount/faxAccount.events.js +++ b/server/api/faxAccount/faxAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3da=['FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa3da,0x195));var _0xaa3d=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa3da[_0x2b10c6];return _0x3789d2;};'use strict';var EventEmitter=require(_0xaa3d('0x0'));var FaxAccount=require(_0xaa3d('0x1'))['db'][_0xaa3d('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xaa3d('0x3')](0x0);var events={'afterCreate':_0xaa3d('0x4'),'afterUpdate':_0xaa3d('0x5'),'afterDestroy':_0xaa3d('0x6')};function emitEvent(_0x2db68d){return function(_0xa76cb,_0x2d6fd0,_0x11ab45){FaxAccountEvents[_0xaa3d('0x7')](_0x2db68d+':'+_0xa76cb['id'],_0xa76cb);FaxAccountEvents[_0xaa3d('0x7')](_0x2db68d,_0xa76cb);_0x11ab45(null);};}for(var e in events){if(events[_0xaa3d('0x8')](e)){var event=events[e];FaxAccount[_0xaa3d('0x9')](e,emitEvent(event));}}module[_0xaa3d('0xa')]=FaxAccountEvents; \ No newline at end of file +var _0xce47=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','FaxAccount'];(function(_0x41e3a4,_0x14968d){var _0x2ab186=function(_0xa203b7){while(--_0xa203b7){_0x41e3a4['push'](_0x41e3a4['shift']());}};_0x2ab186(++_0x14968d);}(_0xce47,0x6e));var _0x7ce4=function(_0x32fd35,_0x33ea47){_0x32fd35=_0x32fd35-0x0;var _0x4132b2=_0xce47[_0x32fd35];return _0x4132b2;};'use strict';var EventEmitter=require(_0x7ce4('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x7ce4('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x7ce4('0x2')](0x0);var events={'afterCreate':_0x7ce4('0x3'),'afterUpdate':'update','afterDestroy':_0x7ce4('0x4')};function emitEvent(_0x28dafc){return function(_0x2b818e,_0x4ef469,_0x7f4dc4){FaxAccountEvents[_0x7ce4('0x5')](_0x28dafc+':'+_0x2b818e['id'],_0x2b818e);FaxAccountEvents[_0x7ce4('0x5')](_0x28dafc,_0x2b818e);_0x7f4dc4(null);};}for(var e in events){if(events[_0x7ce4('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x7ce4('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index e97acf9..4116ffa 100644 --- a/server/api/faxAccount/faxAccount.model.js +++ b/server/api/faxAccount/faxAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9339=['define','FaxAccount','lodash','util','../../config/logger','api','bluebird','rimraf','./faxAccount.attributes','exports'];(function(_0x11cd22,_0x12bdf1){var _0x262b96=function(_0x504d6e){while(--_0x504d6e){_0x11cd22['push'](_0x11cd22['shift']());}};_0x262b96(++_0x12bdf1);}(_0x9339,0x12e));var _0x9933=function(_0x36ae06,_0x57da2d){_0x36ae06=_0x36ae06-0x0;var _0x25ffc7=_0x9339[_0x36ae06];return _0x25ffc7;};'use strict';var _=require(_0x9933('0x0'));var util=require(_0x9933('0x1'));var logger=require(_0x9933('0x2'))(_0x9933('0x3'));var moment=require('moment');var BPromise=require(_0x9933('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9933('0x5'));var config=require('../../config/environment');var attributes=require(_0x9933('0x6'));module[_0x9933('0x7')]=function(_0x2a2cd6,_0xe9fd46){return _0x2a2cd6[_0x9933('0x8')](_0x9933('0x9'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b8b=['./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0x7b8b,0x88));var _0xb7b8=function(_0xadde88,_0x58ad47){_0xadde88=_0xadde88-0x0;var _0x3b8eb6=_0x7b8b[_0xadde88];return _0x3b8eb6;};'use strict';var _=require(_0xb7b8('0x0'));var util=require(_0xb7b8('0x1'));var logger=require(_0xb7b8('0x2'))(_0xb7b8('0x3'));var moment=require(_0xb7b8('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7b8('0x5'));var rimraf=require(_0xb7b8('0x6'));var config=require('../../config/environment');var attributes=require(_0xb7b8('0x7'));module[_0xb7b8('0x8')]=function(_0x3dc7aa,_0x1c2c09){return _0x3dc7aa['define'](_0xb7b8('0x9'),attributes,{'tableName':_0xb7b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 6598ff5..8912828 100644 --- a/server/api/faxAccount/faxAccount.rpc.js +++ b/server/api/faxAccount/faxAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4a0=['CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','FaxAccount','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','asc','contact','create','Contact\x20not\x20found','spread','push','length','*,*,*,*','created','ContactId','AttachmentId','interaction','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','where','include','map','attributes','model','NotifyFaxAccount','body','fax'];(function(_0xfc0976,_0x33776f){var _0x23579f=function(_0x4143d9){while(--_0x4143d9){_0xfc0976['push'](_0xfc0976['shift']());}};_0x23579f(++_0x33776f);}(_0xe4a0,0x19a));var _0x0e4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe4a0[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x0e4a('0x0'));var util=require(_0x0e4a('0x1'));var moment=require('moment');var BPromise=require(_0x0e4a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e4a('0x3'));var db=require(_0x0e4a('0x4'))['db'];var utils=require(_0x0e4a('0x5'));var logger=require(_0x0e4a('0x6'))(_0x0e4a('0x7'));var config=require('../../config/environment');var jayson=require(_0x0e4a('0x8'));var client=jayson[_0x0e4a('0x9')][_0x0e4a('0xa')]({'port':0x232c});config[_0x0e4a('0xb')]=_['defaults'](config[_0x0e4a('0xb')],{'host':_0x0e4a('0xc'),'port':0x18eb});var socket=require(_0x0e4a('0xd'))(new Redis(config[_0x0e4a('0xb')]));require('./faxAccount.socket')[_0x0e4a('0xe')](socket);function respondWithRpcPromise(_0x40acd0,_0x1b53e0,_0x4f2062){return new BPromise(function(_0xb373a2,_0x3dbda6){return client[_0x0e4a('0xf')](_0x40acd0,_0x4f2062)[_0x0e4a('0x10')](function(_0x32a0a3){logger[_0x0e4a('0x11')](_0x0e4a('0x12'),_0x1b53e0,'request\x20sent');logger[_0x0e4a('0x13')](_0x0e4a('0x14'),_0x1b53e0,_0x0e4a('0x15'),JSON[_0x0e4a('0x16')](_0x32a0a3));if(_0x32a0a3[_0x0e4a('0x17')]){if(_0x32a0a3['error'][_0x0e4a('0x18')]===0x1f4){logger[_0x0e4a('0x17')](_0x0e4a('0x12'),_0x1b53e0,_0x32a0a3[_0x0e4a('0x17')][_0x0e4a('0x19')]);return _0x3dbda6(_0x32a0a3[_0x0e4a('0x17')]['message']);}logger[_0x0e4a('0x17')](_0x0e4a('0x12'),_0x1b53e0,_0x32a0a3[_0x0e4a('0x17')][_0x0e4a('0x19')]);return _0xb373a2(_0x32a0a3[_0x0e4a('0x17')][_0x0e4a('0x19')]);}else{logger[_0x0e4a('0x11')](_0x0e4a('0x12'),_0x1b53e0,_0x0e4a('0x15'));_0xb373a2(_0x32a0a3[_0x0e4a('0x1a')][_0x0e4a('0x19')]);}})[_0x0e4a('0x1b')](function(_0x3b2fa5){logger['error'](_0x0e4a('0x12'),_0x1b53e0,_0x3b2fa5);_0x3dbda6(_0x3b2fa5);});});}exports[_0x0e4a('0x1c')]=function(_0x63bfb6){var _0x474907=this;return new Promise(function(_0x3dc824,_0x1df21f){return db['FaxAccount'][_0x0e4a('0x1d')]({'raw':_0x63bfb6[_0x0e4a('0x1e')]?_0x63bfb6[_0x0e4a('0x1e')][_0x0e4a('0x1f')]===undefined?!![]:![]:!![],'where':_0x63bfb6[_0x0e4a('0x1e')]?_0x63bfb6[_0x0e4a('0x1e')][_0x0e4a('0x20')]||null:null,'attributes':_0x63bfb6[_0x0e4a('0x1e')]?_0x63bfb6['options']['attributes']||null:null,'limit':_0x63bfb6[_0x0e4a('0x1e')]?_0x63bfb6[_0x0e4a('0x1e')]['limit']||null:null,'include':_0x63bfb6[_0x0e4a('0x1e')]?_0x63bfb6['options'][_0x0e4a('0x21')]?_[_0x0e4a('0x22')](_0x63bfb6['options'][_0x0e4a('0x21')],function(_0x1ea1e5){return{'model':db[_0x1ea1e5['model']],'as':_0x1ea1e5['as'],'attributes':_0x1ea1e5[_0x0e4a('0x23')],'include':_0x1ea1e5[_0x0e4a('0x21')]?_['map'](_0x1ea1e5[_0x0e4a('0x21')],function(_0x382567){return{'model':db[_0x382567['model']],'as':_0x382567['as'],'attributes':_0x382567['attributes'],'include':_0x382567[_0x0e4a('0x21')]?_[_0x0e4a('0x22')](_0x382567[_0x0e4a('0x21')],function(_0x570773){return{'model':db[_0x570773[_0x0e4a('0x24')]],'as':_0x570773['as'],'attributes':_0x570773[_0x0e4a('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5825a9){logger[_0x0e4a('0x11')]('GetFaxAccount',_0x63bfb6);logger[_0x0e4a('0x13')]('GetFaxAccount',_0x63bfb6,JSON[_0x0e4a('0x16')](_0x5825a9));_0x3dc824(_0x5825a9);})['catch'](function(_0x21c307){logger[_0x0e4a('0x17')](_0x0e4a('0x1c'),_0x21c307['message'],_0x63bfb6);_0x1df21f(_0x474907['error'](0x1f4,_0x21c307[_0x0e4a('0x19')]));});});};exports[_0x0e4a('0x25')]=function(_0x55169e,_0x434698,_0x3362fd){var _0x29a2e7=this;return new Promise(function(_0x37fd21,_0x5b25cb){var _0xb3068d={'body':_0x55169e[_0x0e4a('0x26')],'channel':_0x0e4a('0x27')};var _0x1d5178=[];var _0x54d510=[];var _0x22e961={};return db[_0x0e4a('0x28')][_0x0e4a('0x29')]()[_0x0e4a('0x10')](function(_0x51207d){if(!_0x51207d){throw new db[(_0x0e4a('0x2a'))][(_0x0e4a('0x2b'))](_0x0e4a('0x2c'));}_0x1d5178=_[_0x0e4a('0x2d')](_[_0x0e4a('0x2e')](_0x51207d),[_0x0e4a('0x2f'),_0x0e4a('0x30')]);_0x54d510=_['difference'](_[_0x0e4a('0x2e')](_0x51207d),[_0x0e4a('0x2f'),_0x0e4a('0x30'),_0x0e4a('0x31'),_0x0e4a('0x32')]);if(_0x55169e[_0x0e4a('0x26')]['id']){delete _0x55169e[_0x0e4a('0x26')]['id'];}if(_[_0x0e4a('0x33')](_0x55169e[_0x0e4a('0x26')][_0x0e4a('0x34')])){throw new db['Sequelize'][(_0x0e4a('0x2b'))](_0x0e4a('0x35'));}if(_['isNil'](_0x55169e['body']['body'])||_0x55169e[_0x0e4a('0x26')][_0x0e4a('0x26')]===''){throw new db['Sequelize'][(_0x0e4a('0x2b'))](_0x0e4a('0x36'));}if(_[_0x0e4a('0x33')](_0x55169e[_0x0e4a('0x26')]['mapKey'])){throw new db[(_0x0e4a('0x2a'))][(_0x0e4a('0x2b'))](_0x0e4a('0x37')+_0x54d510);}if(!_[_0x0e4a('0x38')](_0x54d510,_0x55169e['body']['mapKey'])){throw new db[(_0x0e4a('0x2a'))][(_0x0e4a('0x2b'))](_0x0e4a('0x39')+_0x54d510);}_0x22e961[_0x55169e['body'][_0x0e4a('0x3a')]]=_0x55169e[_0x0e4a('0x26')][_0x0e4a('0x34')];})[_0x0e4a('0x10')](function(){return db[_0x0e4a('0x3b')][_0x0e4a('0x3c')]({'where':{'id':_0x55169e[_0x0e4a('0x3d')]['id']},'include':[{'model':db[_0x0e4a('0x3e')],'as':_0x0e4a('0x3f'),'include':[{'model':db['CmContact'],'as':_0x0e4a('0x40'),'where':_0x22e961,'limit':0x1,'order':[[_0x0e4a('0x30'),_0x0e4a('0x41')]]}]},{'model':db[_0x0e4a('0x42')],'as':_0x0e4a('0x43')}]});})[_0x0e4a('0x10')](function(_0x46f72a){if(_0x46f72a&&_0x46f72a[_0x0e4a('0x3f')]){var _0x2b3ee5=_0x46f72a[_0x0e4a('0x44')]({'plain':!![]});_0xb3068d[_0x0e4a('0x3d')]=_0x2b3ee5;_0xb3068d[_0x0e4a('0x45')]=_0x2b3ee5[_0x0e4a('0x43')];_0xb3068d[_0x0e4a('0x46')]=_0x2b3ee5[_0x0e4a('0x3f')];_0xb3068d['applications']=_[_0x0e4a('0x47')](_0xb3068d[_0x0e4a('0x45')],['priority'],[_0x0e4a('0x48')]);if(_0xb3068d[_0x0e4a('0x3d')][_0x0e4a('0x43')]){delete _0xb3068d[_0x0e4a('0x3d')][_0x0e4a('0x43')];}if(_0xb3068d[_0x0e4a('0x3d')][_0x0e4a('0x3f')]&&_0xb3068d[_0x0e4a('0x3d')][_0x0e4a('0x3f')][_0x0e4a('0x40')]['length']){return _0xb3068d[_0x0e4a('0x3d')][_0x0e4a('0x3f')]['Contacts'][0x0];}var _0x2c4490=_['defaults'](_0x55169e[_0x0e4a('0x26')],{'firstName':_0x55169e[_0x0e4a('0x26')]['from'],'ListId':_0x2b3ee5[_0x0e4a('0x32')]});_0x2c4490[_0x55169e[_0x0e4a('0x26')]['mapKey']]=_0x55169e[_0x0e4a('0x26')][_0x0e4a('0x34')];return db[_0x0e4a('0x28')]['create'](_0x2c4490,{'fields':_0x1d5178,'raw':!![]});}})[_0x0e4a('0x10')](function(_0x36a323){_0xb3068d[_0x0e4a('0x49')]=_0x36a323;if(_0x36a323){var _0x52438a={'ContactId':_0x36a323['id'],'FaxAccountId':_0x55169e[_0x0e4a('0x3d')]['id'],'fax':_0x36a323['fax']};return db['FaxInteraction'][_0x0e4a('0x3c')]({'where':{'ContactId':_0x36a323['id'],'closed':![],'FaxAccountId':_0x55169e[_0x0e4a('0x3d')]['id']}})['then'](function(_0x481fa5){if(_0x481fa5){return[_0x481fa5,![]];}return db['FaxInteraction'][_0x0e4a('0x4a')](_0x52438a)['then'](function(_0x2df388){return[_0x2df388,!![]];});});}else{throw new Error(_0x0e4a('0x4b'));}})[_0x0e4a('0x4c')](function(_0xfcc4ee,_0x160cd7){var _0x1c26a6=_0xfcc4ee[_0x0e4a('0x44')]({'plain':!![]});if(_0x160cd7){if(_0xb3068d['account']['autoclose']){_0xb3068d[_0x0e4a('0x45')][_0x0e4a('0x4d')]({'id':0x0,'priority':_0xb3068d[_0x0e4a('0x45')][_0x0e4a('0x4e')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x0e4a('0x4f')});}_0x1c26a6[_0x0e4a('0x50')]=!![];}else{_0x1c26a6[_0x0e4a('0x50')]=![];}_0xb3068d['interaction']=_0x1c26a6;return db['FaxMessage'][_0x0e4a('0x4a')]({'body':_0x55169e['body']['body'],'FaxAccountId':_0x55169e[_0x0e4a('0x3d')]['id'],'FaxInteractionId':_0xfcc4ee['id'],'direction':'in','ContactId':_0xfcc4ee[_0x0e4a('0x51')],'AttachmentId':_0x55169e[_0x0e4a('0x26')][_0x0e4a('0x52')]});})[_0x0e4a('0x10')](function(_0x4fe8df){_0xb3068d[_0x0e4a('0x19')]=_0x4fe8df;if(_0xb3068d[_0x0e4a('0x53')]['UserId']){return db[_0x0e4a('0x54')][_0x0e4a('0x3c')]({'attributes':['id',_0x0e4a('0x55')],'where':{'id':_0xb3068d[_0x0e4a('0x53')]['UserId']}})[_0x0e4a('0x10')](function(_0x1aaf9d){if(_0x1aaf9d){_0xb3068d[_0x0e4a('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0e4a('0x56'),'appdata':_0x1aaf9d[_0x0e4a('0x55')]+','+(_0xb3068d['account'][_0x0e4a('0x57')]||0xa),'interval':_0x0e4a('0x4f')});}return respondWithRpcPromise(_0x0e4a('0x58'),_0x0e4a('0x59'),_0xb3068d);});}return respondWithRpcPromise(_0x0e4a('0x58'),_0x0e4a('0x59'),_0xb3068d);})[_0x0e4a('0x10')](function(_0x5390bf){_0x37fd21(_0x5390bf);})[_0x0e4a('0x1b')](function(_0x5ae753){_0x5b25cb(_0x29a2e7[_0x0e4a('0x17')](0x1f4,_0x5ae753['message']));});});}; \ No newline at end of file +var _0xaef9=['model','map','debug','NotifyFaxAccount','CmContact','describe','no\x20available\x20attributes','difference','keys','createdAt','CompanyId','ListId','body','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','updatedAt','DESC','FaxApplication','Applications','get','applications','orderBy','asc','Contacts','from','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','AttachmentId','interaction','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xaef9,0x13b));var _0x9aef=function(_0x29b8e3,_0x508f07){_0x29b8e3=_0x29b8e3-0x0;var _0x4039f0=_0xaef9[_0x29b8e3];return _0x4039f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9aef('0x0'));var BPromise=require(_0x9aef('0x1'));var rs=require(_0x9aef('0x2'));var fs=require('fs');var Redis=require(_0x9aef('0x3'));var db=require(_0x9aef('0x4'))['db'];var utils=require(_0x9aef('0x5'));var logger=require(_0x9aef('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9aef('0x7')][_0x9aef('0x8')]({'port':0x232c});config[_0x9aef('0x9')]=_[_0x9aef('0xa')](config[_0x9aef('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9aef('0x9')]));require('./faxAccount.socket')[_0x9aef('0xb')](socket);function respondWithRpcPromise(_0x38e60f,_0x5ad5cf,_0x5a816e){return new BPromise(function(_0x55cc6d,_0x3cf112){return client[_0x9aef('0xc')](_0x38e60f,_0x5a816e)[_0x9aef('0xd')](function(_0x2eaa55){logger[_0x9aef('0xe')](_0x9aef('0xf'),_0x5ad5cf,_0x9aef('0x10'));logger['debug'](_0x9aef('0x11'),_0x5ad5cf,'request\x20sent',JSON[_0x9aef('0x12')](_0x2eaa55));if(_0x2eaa55[_0x9aef('0x13')]){if(_0x2eaa55[_0x9aef('0x13')][_0x9aef('0x14')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x5ad5cf,_0x2eaa55[_0x9aef('0x13')][_0x9aef('0x15')]);return _0x3cf112(_0x2eaa55[_0x9aef('0x13')][_0x9aef('0x15')]);}logger[_0x9aef('0x13')]('FaxAccount,\x20%s,\x20%s',_0x5ad5cf,_0x2eaa55[_0x9aef('0x13')][_0x9aef('0x15')]);return _0x55cc6d(_0x2eaa55[_0x9aef('0x13')][_0x9aef('0x15')]);}else{logger[_0x9aef('0xe')]('FaxAccount,\x20%s,\x20%s',_0x5ad5cf,_0x9aef('0x10'));_0x55cc6d(_0x2eaa55[_0x9aef('0x16')][_0x9aef('0x15')]);}})[_0x9aef('0x17')](function(_0x1b78bc){logger[_0x9aef('0x13')](_0x9aef('0xf'),_0x5ad5cf,_0x1b78bc);_0x3cf112(_0x1b78bc);});});}exports[_0x9aef('0x18')]=function(_0x1b6a01){var _0x5a7738=this;return new Promise(function(_0xcd6b4e,_0x427113){return db[_0x9aef('0x19')][_0x9aef('0x1a')]({'raw':_0x1b6a01['options']?_0x1b6a01[_0x9aef('0x1b')][_0x9aef('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b6a01[_0x9aef('0x1b')]?_0x1b6a01[_0x9aef('0x1b')][_0x9aef('0x1d')]||null:null,'attributes':_0x1b6a01[_0x9aef('0x1b')]?_0x1b6a01[_0x9aef('0x1b')][_0x9aef('0x1e')]||null:null,'limit':_0x1b6a01['options']?_0x1b6a01[_0x9aef('0x1b')][_0x9aef('0x1f')]||null:null,'include':_0x1b6a01['options']?_0x1b6a01[_0x9aef('0x1b')][_0x9aef('0x20')]?_['map'](_0x1b6a01[_0x9aef('0x1b')][_0x9aef('0x20')],function(_0x326a16){return{'model':db[_0x326a16[_0x9aef('0x21')]],'as':_0x326a16['as'],'attributes':_0x326a16[_0x9aef('0x1e')],'include':_0x326a16[_0x9aef('0x20')]?_['map'](_0x326a16['include'],function(_0x20066b){return{'model':db[_0x20066b[_0x9aef('0x21')]],'as':_0x20066b['as'],'attributes':_0x20066b[_0x9aef('0x1e')],'include':_0x20066b[_0x9aef('0x20')]?_[_0x9aef('0x22')](_0x20066b[_0x9aef('0x20')],function(_0x387ebf){return{'model':db[_0x387ebf['model']],'as':_0x387ebf['as'],'attributes':_0x387ebf['attributes']};}):[]};}):[]};}):[]:[]})[_0x9aef('0xd')](function(_0x35f4ea){logger['info'](_0x9aef('0x18'),_0x1b6a01);logger[_0x9aef('0x23')]('GetFaxAccount',_0x1b6a01,JSON[_0x9aef('0x12')](_0x35f4ea));_0xcd6b4e(_0x35f4ea);})[_0x9aef('0x17')](function(_0x12f700){logger[_0x9aef('0x13')](_0x9aef('0x18'),_0x12f700['message'],_0x1b6a01);_0x427113(_0x5a7738[_0x9aef('0x13')](0x1f4,_0x12f700[_0x9aef('0x15')]));});});};exports[_0x9aef('0x24')]=function(_0x2be4ea,_0x3e0042,_0x59c137){var _0x3c7cef=this;return new Promise(function(_0x4386ce,_0x46047b){var _0x23147d={'body':_0x2be4ea['body'],'channel':'fax'};var _0x1734a1=[];var _0x3984b7=[];var _0x166bea={};return db[_0x9aef('0x25')][_0x9aef('0x26')]()[_0x9aef('0xd')](function(_0x211ed1){if(!_0x211ed1){throw new db['Sequelize']['ValidationError'](_0x9aef('0x27'));}_0x1734a1=_[_0x9aef('0x28')](_[_0x9aef('0x29')](_0x211ed1),['createdAt','updatedAt']);_0x3984b7=_[_0x9aef('0x28')](_[_0x9aef('0x29')](_0x211ed1),[_0x9aef('0x2a'),'updatedAt',_0x9aef('0x2b'),_0x9aef('0x2c')]);if(_0x2be4ea[_0x9aef('0x2d')]['id']){delete _0x2be4ea[_0x9aef('0x2d')]['id'];}if(_[_0x9aef('0x2e')](_0x2be4ea['body']['from'])){throw new db[(_0x9aef('0x2f'))][(_0x9aef('0x30'))](_0x9aef('0x31'));}if(_['isNil'](_0x2be4ea[_0x9aef('0x2d')][_0x9aef('0x2d')])||_0x2be4ea[_0x9aef('0x2d')][_0x9aef('0x2d')]===''){throw new db[(_0x9aef('0x2f'))][(_0x9aef('0x30'))](_0x9aef('0x32'));}if(_[_0x9aef('0x2e')](_0x2be4ea[_0x9aef('0x2d')][_0x9aef('0x33')])){throw new db[(_0x9aef('0x2f'))][(_0x9aef('0x30'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3984b7);}if(!_[_0x9aef('0x34')](_0x3984b7,_0x2be4ea[_0x9aef('0x2d')]['mapKey'])){throw new db[(_0x9aef('0x2f'))][(_0x9aef('0x30'))](_0x9aef('0x35')+_0x3984b7);}_0x166bea[_0x2be4ea['body'][_0x9aef('0x33')]]=_0x2be4ea[_0x9aef('0x2d')]['from'];})['then'](function(){return db[_0x9aef('0x19')][_0x9aef('0x36')]({'where':{'id':_0x2be4ea[_0x9aef('0x37')]['id']},'include':[{'model':db[_0x9aef('0x38')],'as':_0x9aef('0x39'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x166bea,'limit':0x1,'order':[[_0x9aef('0x3a'),_0x9aef('0x3b')]]}]},{'model':db[_0x9aef('0x3c')],'as':_0x9aef('0x3d')}]});})['then'](function(_0x1f14a9){if(_0x1f14a9&&_0x1f14a9[_0x9aef('0x39')]){var _0x4b8940=_0x1f14a9[_0x9aef('0x3e')]({'plain':!![]});_0x23147d[_0x9aef('0x37')]=_0x4b8940;_0x23147d[_0x9aef('0x3f')]=_0x4b8940[_0x9aef('0x3d')];_0x23147d['list']=_0x4b8940[_0x9aef('0x39')];_0x23147d[_0x9aef('0x3f')]=_[_0x9aef('0x40')](_0x23147d[_0x9aef('0x3f')],['priority'],[_0x9aef('0x41')]);if(_0x23147d[_0x9aef('0x37')][_0x9aef('0x3d')]){delete _0x23147d[_0x9aef('0x37')][_0x9aef('0x3d')];}if(_0x23147d[_0x9aef('0x37')][_0x9aef('0x39')]&&_0x23147d[_0x9aef('0x37')][_0x9aef('0x39')][_0x9aef('0x42')]['length']){return _0x23147d[_0x9aef('0x37')][_0x9aef('0x39')]['Contacts'][0x0];}var _0x397465=_[_0x9aef('0xa')](_0x2be4ea[_0x9aef('0x2d')],{'firstName':_0x2be4ea[_0x9aef('0x2d')][_0x9aef('0x43')],'ListId':_0x4b8940[_0x9aef('0x2c')]});_0x397465[_0x2be4ea[_0x9aef('0x2d')][_0x9aef('0x33')]]=_0x2be4ea['body']['from'];return db[_0x9aef('0x25')][_0x9aef('0x44')](_0x397465,{'fields':_0x1734a1,'raw':!![]});}})[_0x9aef('0xd')](function(_0x409deb){_0x23147d[_0x9aef('0x45')]=_0x409deb;if(_0x409deb){var _0x54cd3b={'ContactId':_0x409deb['id'],'FaxAccountId':_0x2be4ea[_0x9aef('0x37')]['id'],'fax':_0x409deb['fax']};return db[_0x9aef('0x46')]['find']({'where':{'ContactId':_0x409deb['id'],'closed':![],'FaxAccountId':_0x2be4ea[_0x9aef('0x37')]['id']}})['then'](function(_0x28b253){if(_0x28b253){return[_0x28b253,![]];}return db[_0x9aef('0x46')][_0x9aef('0x44')](_0x54cd3b)['then'](function(_0x482ba7){return[_0x482ba7,!![]];});});}else{throw new Error(_0x9aef('0x47'));}})[_0x9aef('0x48')](function(_0x4e7deb,_0x5a13d2){var _0x3acfb3=_0x4e7deb[_0x9aef('0x3e')]({'plain':!![]});if(_0x5a13d2){if(_0x23147d[_0x9aef('0x37')]['autoclose']){_0x23147d[_0x9aef('0x3f')][_0x9aef('0x49')]({'id':0x0,'priority':_0x23147d[_0x9aef('0x3f')]['length']+0x1,'app':_0x9aef('0x4a'),'appdata':_0x9aef('0x4b'),'interval':_0x9aef('0x4c')});}_0x3acfb3[_0x9aef('0x4d')]=!![];}else{_0x3acfb3[_0x9aef('0x4d')]=![];}_0x23147d['interaction']=_0x3acfb3;return db['FaxMessage']['create']({'body':_0x2be4ea[_0x9aef('0x2d')]['body'],'FaxAccountId':_0x2be4ea[_0x9aef('0x37')]['id'],'FaxInteractionId':_0x4e7deb['id'],'direction':'in','ContactId':_0x4e7deb['ContactId'],'AttachmentId':_0x2be4ea[_0x9aef('0x2d')][_0x9aef('0x4e')]});})['then'](function(_0x395cdb){_0x23147d[_0x9aef('0x15')]=_0x395cdb;if(_0x23147d[_0x9aef('0x4f')]['UserId']){return db['User'][_0x9aef('0x36')]({'attributes':['id',_0x9aef('0x50')],'where':{'id':_0x23147d[_0x9aef('0x4f')][_0x9aef('0x51')]}})[_0x9aef('0xd')](function(_0x451429){if(_0x451429){_0x23147d['applications'][_0x9aef('0x52')]({'id':0x0,'priority':0x0,'app':_0x9aef('0x53'),'appdata':_0x451429['name']+','+(_0x23147d[_0x9aef('0x37')][_0x9aef('0x54')]||0xa),'interval':_0x9aef('0x4c')});}return respondWithRpcPromise(_0x9aef('0x55'),_0x9aef('0x56'),_0x23147d);});}return respondWithRpcPromise(_0x9aef('0x55'),_0x9aef('0x56'),_0x23147d);})[_0x9aef('0xd')](function(_0x3fb03e){_0x4386ce(_0x3fb03e);})[_0x9aef('0x17')](function(_0xd45415){_0x46047b(_0x3c7cef[_0x9aef('0x13')](0x1f4,_0xd45415[_0x9aef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index f3f730d..c9c3015 100644 --- a/server/api/faxAccount/faxAccount.socket.js +++ b/server/api/faxAccount/faxAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd046=['removeListener','faxAccount:','save','remove','update'];(function(_0x3d3ddd,_0x59b504){var _0x52a4f9=function(_0x349a69){while(--_0x349a69){_0x3d3ddd['push'](_0x3d3ddd['shift']());}};_0x52a4f9(++_0x59b504);}(_0xd046,0x129));var _0x6d04=function(_0x120a87,_0x4a0305){_0x120a87=_0x120a87-0x0;var _0x3b8ac9=_0xd046[_0x120a87];return _0x3b8ac9;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x6d04('0x0'),_0x6d04('0x1'),_0x6d04('0x2')];function createListener(_0x4b78e1,_0xedb518){return function(_0x55be3b){_0xedb518['emit'](_0x4b78e1,_0x55be3b);};}function removeListener(_0x33720a,_0x4d2121){return function(){FaxAccountEvents[_0x6d04('0x3')](_0x33720a,_0x4d2121);};}exports['register']=function(_0x4bacb1){for(var _0xf3b4e7=0x0,_0x1968c4=events['length'];_0xf3b4e7<_0x1968c4;_0xf3b4e7++){var _0x569c7b=events[_0xf3b4e7];var _0x2e2c01=createListener(_0x6d04('0x4')+_0x569c7b,_0x4bacb1);FaxAccountEvents['on'](_0x569c7b,_0x2e2c01);}}; \ No newline at end of file +var _0x187d=['./faxAccount.events','remove','update','emit','removeListener','length','faxAccount:'];(function(_0x147c96,_0x58b78b){var _0x1a7093=function(_0x2b35ac){while(--_0x2b35ac){_0x147c96['push'](_0x147c96['shift']());}};_0x1a7093(++_0x58b78b);}(_0x187d,0x93));var _0xd187=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x187d[_0x47e7cb];return _0x2a8874;};'use strict';var FaxAccountEvents=require(_0xd187('0x0'));var events=['save',_0xd187('0x1'),_0xd187('0x2')];function createListener(_0x44d5f6,_0x1cb41f){return function(_0x18498b){_0x1cb41f[_0xd187('0x3')](_0x44d5f6,_0x18498b);};}function removeListener(_0x58622a,_0x28fa0b){return function(){FaxAccountEvents[_0xd187('0x4')](_0x58622a,_0x28fa0b);};}exports['register']=function(_0x1d2533){for(var _0x58ee7=0x0,_0x444a60=events[_0xd187('0x5')];_0x58ee7<_0x444a60;_0x58ee7++){var _0x28ce2f=events[_0x58ee7];var _0x2d6992=createListener(_0xd187('0x6')+_0x28ce2f,_0x1d2533);FaxAccountEvents['on'](_0x28ce2f,_0x2d6992);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index f9d9960..dbbec34 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb173=['post','addDisposition','/:id/canned_answers','addApplications','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','addAgents','put','update','destroy','delete','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxAccount.controller','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','create'];(function(_0x56b5bb,_0x12ac1e){var _0x464dd6=function(_0x5e3ee6){while(--_0x5e3ee6){_0x56b5bb['push'](_0x56b5bb['shift']());}};_0x464dd6(++_0x12ac1e);}(_0xb173,0xd2));var _0x3b17=function(_0x1a5b50,_0x178c12){_0x1a5b50=_0x1a5b50-0x0;var _0x1c325f=_0xb173[_0x1a5b50];return _0x1c325f;};'use strict';var multer=require(_0x3b17('0x0'));var util=require('util');var path=require(_0x3b17('0x1'));var timeout=require(_0x3b17('0x2'));var express=require(_0x3b17('0x3'));var router=express[_0x3b17('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3b17('0x5'));var config=require(_0x3b17('0x6'));var controller=require(_0x3b17('0x7'));router['get']('/',auth[_0x3b17('0x8')](),controller['index']);router[_0x3b17('0x9')](_0x3b17('0xa'),auth[_0x3b17('0x8')](),controller['describe']);router[_0x3b17('0x9')](_0x3b17('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x3b17('0x9')](_0x3b17('0xc'),auth['isAuthenticated'](),controller[_0x3b17('0xd')]);router[_0x3b17('0x9')]('/:id/canned_answers',auth[_0x3b17('0x8')](),controller[_0x3b17('0xe')]);router[_0x3b17('0x9')](_0x3b17('0xf'),auth[_0x3b17('0x8')](),controller[_0x3b17('0x10')]);router['get'](_0x3b17('0x11'),auth[_0x3b17('0x8')](),controller[_0x3b17('0x12')]);router[_0x3b17('0x9')](_0x3b17('0x13'),auth['isAuthenticated'](),controller[_0x3b17('0x14')]);router[_0x3b17('0x9')](_0x3b17('0x15'),auth[_0x3b17('0x8')](),controller[_0x3b17('0x16')]);router['post']('/',auth[_0x3b17('0x8')](),controller[_0x3b17('0x17')]);router[_0x3b17('0x18')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3b17('0x19')]);router[_0x3b17('0x18')](_0x3b17('0x1a'),auth[_0x3b17('0x8')](),controller['addAnswer']);router['post'](_0x3b17('0xf'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x3b17('0x18')](_0x3b17('0x11'),auth[_0x3b17('0x8')](),controller[_0x3b17('0x1b')]);router[_0x3b17('0x18')](_0x3b17('0x1c'),auth[_0x3b17('0x8')](),controller[_0x3b17('0x1d')]);router['post']('/updateaccountapplications',auth[_0x3b17('0x8')](),controller[_0x3b17('0x1e')]);router['post'](_0x3b17('0x1f'),auth[_0x3b17('0x8')](),controller['send']);router[_0x3b17('0x18')](_0x3b17('0x15'),auth['isAuthenticated'](),controller[_0x3b17('0x20')]);router[_0x3b17('0x21')](_0x3b17('0xb'),auth[_0x3b17('0x8')](),controller[_0x3b17('0x22')]);router['delete'](_0x3b17('0xb'),auth[_0x3b17('0x8')](),controller[_0x3b17('0x23')]);router[_0x3b17('0x24')]('/:id/dispositions',auth[_0x3b17('0x8')](),controller[_0x3b17('0x25')]);router[_0x3b17('0x24')](_0x3b17('0x1a'),auth[_0x3b17('0x8')](),controller['removeAnswers']);router[_0x3b17('0x24')](_0x3b17('0x15'),auth[_0x3b17('0x8')](),controller['removeAgents']);module[_0x3b17('0x26')]=router; \ No newline at end of file +var _0x378c=['describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/messages','getMessages','/:id/users','post','create','addAnswer','addInteraction','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','delete','removeDispositions','removeAnswers','removeAgents','path','Router','../../components/auth/service','../../components/interaction/service','./faxAccount.controller','isAuthenticated','index','get'];(function(_0x538760,_0x2be832){var _0x395616=function(_0x7f4413){while(--_0x7f4413){_0x538760['push'](_0x538760['shift']());}};_0x395616(++_0x2be832);}(_0x378c,0x1b4));var _0xc378=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x378c[_0x24f31b];return _0x488401;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc378('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc378('0x1')]();var auth=require(_0xc378('0x2'));var interaction=require(_0xc378('0x3'));var config=require('../../config/environment');var controller=require(_0xc378('0x4'));router['get']('/',auth[_0xc378('0x5')](),controller[_0xc378('0x6')]);router[_0xc378('0x7')]('/describe',auth[_0xc378('0x5')](),controller[_0xc378('0x8')]);router[_0xc378('0x7')](_0xc378('0x9'),auth[_0xc378('0x5')](),controller[_0xc378('0xa')]);router[_0xc378('0x7')](_0xc378('0xb'),auth[_0xc378('0x5')](),controller[_0xc378('0xc')]);router['get'](_0xc378('0xd'),auth[_0xc378('0x5')](),controller[_0xc378('0xe')]);router[_0xc378('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0xc378('0x7')]('/:id/applications',auth[_0xc378('0x5')](),controller[_0xc378('0xf')]);router['get'](_0xc378('0x10'),auth[_0xc378('0x5')](),controller[_0xc378('0x11')]);router[_0xc378('0x7')](_0xc378('0x12'),auth['isAuthenticated'](),controller['getAgents']);router[_0xc378('0x13')]('/',auth['isAuthenticated'](),controller[_0xc378('0x14')]);router['post'](_0xc378('0xb'),auth[_0xc378('0x5')](),controller['addDisposition']);router[_0xc378('0x13')]('/:id/canned_answers',auth[_0xc378('0x5')](),controller[_0xc378('0x15')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0xc378('0x16')]);router['post'](_0xc378('0x17'),auth[_0xc378('0x5')](),controller[_0xc378('0x18')]);router['post'](_0xc378('0x19'),auth[_0xc378('0x5')](),controller[_0xc378('0x1a')]);router['post'](_0xc378('0x1b'),auth[_0xc378('0x5')](),controller[_0xc378('0x1c')]);router[_0xc378('0x13')](_0xc378('0x1d'),auth['isAuthenticated'](),controller[_0xc378('0x1e')]);router[_0xc378('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0xc378('0x1f')]);router[_0xc378('0x20')](_0xc378('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xc378('0x21')](_0xc378('0x9'),auth[_0xc378('0x5')](),controller['destroy']);router['delete'](_0xc378('0xb'),auth[_0xc378('0x5')](),controller[_0xc378('0x22')]);router[_0xc378('0x21')](_0xc378('0xd'),auth['isAuthenticated'](),controller[_0xc378('0x23')]);router[_0xc378('0x21')]('/:id/users',auth[_0xc378('0x5')](),controller[_0xc378('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index ed4a144..6a83bf8 100644 --- a/server/api/faxApplication/faxApplication.attributes.js +++ b/server/api/faxApplication/faxApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f48=['INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x56bdb8,_0x37a1ec){var _0x55ec60=function(_0x23af23){while(--_0x23af23){_0x56bdb8['push'](_0x56bdb8['shift']());}};_0x55ec60(++_0x37a1ec);}(_0x3f48,0x17c));var _0x83f4=function(_0x5a9ff7,_0x1da078){_0x5a9ff7=_0x5a9ff7-0x0;var _0x4ca1c0=_0x3f48[_0x5a9ff7];return _0x4ca1c0;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x83f4('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x83f4('0x1')],'allowNull':![],'defaultValue':_0x83f4('0x2')},'appdata':{'type':Sequelize[_0x83f4('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x83f4('0x1')],'defaultValue':_0x83f4('0x4')}}; \ No newline at end of file +var _0xda81=['STRING','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x229a03,_0x36fefc){var _0x2d6e11=function(_0x592d00){while(--_0x592d00){_0x229a03['push'](_0x229a03['shift']());}};_0x2d6e11(++_0x36fefc);}(_0xda81,0x1c3));var _0x1da8=function(_0x5afc66,_0x108eea){_0x5afc66=_0x5afc66-0x0;var _0x5578ae=_0xda81[_0x5afc66];return _0x5578ae;};'use strict';var Sequelize=require(_0x1da8('0x0'));module[_0x1da8('0x1')]={'priority':{'type':Sequelize[_0x1da8('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1da8('0x3')},'appdata':{'type':Sequelize[_0x1da8('0x4')]()},'description':{'type':Sequelize[_0x1da8('0x5')]},'interval':{'type':Sequelize[_0x1da8('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index d576e9b..a90fcc7 100644 --- a/server/api/faxApplication/faxApplication.controller.js +++ b/server/api/faxApplication/faxApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd43e=['request-promise','mustache','util','path','sox','ejs','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','count','offset','limit','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','rawAttributes','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','field','filter','options','FaxApplication','includeAll','findAll','rows','catch','show','include','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch'];(function(_0x48780c,_0x35c2d9){var _0x48e6e5=function(_0x3e684a){while(--_0x3e684a){_0x48780c['push'](_0x48780c['shift']());}};_0x48e6e5(++_0x35c2d9);}(_0xd43e,0x88));var _0xed43=function(_0x2021e4,_0x3be733){_0x2021e4=_0x2021e4-0x0;var _0x352368=_0xd43e[_0x2021e4];return _0x352368;};'use strict';var pdf=require(_0xed43('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xed43('0x1'));var zipdir=require(_0xed43('0x2'));var jsonpatch=require(_0xed43('0x3'));var rp=require(_0xed43('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xed43('0x5'));var util=require(_0xed43('0x6'));var path=require(_0xed43('0x7'));var sox=require(_0xed43('0x8'));var csv=require('to-csv');var ejs=require(_0xed43('0x9'));var fs=require('fs');var _=require(_0xed43('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed43('0xb'));var toCsv=require(_0xed43('0xc'));var querystring=require(_0xed43('0xd'));var Papa=require(_0xed43('0xe'));var Redis=require(_0xed43('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xed43('0x10'));var hardwareService=require(_0xed43('0x11'));var logger=require('../../config/logger')(_0xed43('0x12'));var utils=require(_0xed43('0x13'));var config=require(_0xed43('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x598f43,_0x2bb700){_0x2bb700=_0x2bb700||0xcc;return function(_0x34027b){if(_0x34027b){return _0x598f43['sendStatus'](_0x2bb700);}return _0x598f43[_0xed43('0x15')](_0x2bb700)[_0xed43('0x16')]();};}function respondWithResult(_0x446f34,_0x4995f1){_0x4995f1=_0x4995f1||0xc8;return function(_0x2adbc5){if(_0x2adbc5){return _0x446f34[_0xed43('0x15')](_0x4995f1)['json'](_0x2adbc5);}};}function respondWithFilteredResult(_0xb89cbe,_0x4d9ea5){return function(_0x2ec9c3){if(_0x2ec9c3){var _0x4a9621=_0x2ec9c3[_0xed43('0x17')],_0x2d457a=_0x4d9ea5['offset'],_0x4caa03=_0x4d9ea5[_0xed43('0x18')]+_0x4d9ea5[_0xed43('0x19')],_0x54ba66;if(_0x4caa03>=_0x4a9621){_0x4caa03=_0x4a9621;_0x54ba66=0xc8;}else{_0x54ba66=0xce;}_0xb89cbe[_0xed43('0x15')](_0x54ba66);return _0xb89cbe['set'](_0xed43('0x1a'),_0x2d457a+'-'+_0x4caa03+'/'+_0x4a9621)[_0xed43('0x1b')](_0x2ec9c3);}return null;};}function patchUpdates(_0x4b001c){return function(_0x594458){try{jsonpatch[_0xed43('0x1c')](_0x594458,_0x4b001c,!![]);}catch(_0x46a875){return BPromise[_0xed43('0x1d')](_0x46a875);}return _0x594458['save']();};}function saveUpdates(_0x52e265,_0x456527){return function(_0x5bbd5c){if(_0x5bbd5c){return _0x5bbd5c[_0xed43('0x1e')](_0x52e265)[_0xed43('0x1f')](function(_0x336ce7){return _0x336ce7;});}return null;};}function removeEntity(_0x4bc5ea,_0x55fa3c){return function(_0x2a6329){if(_0x2a6329){return _0x2a6329[_0xed43('0x20')]()[_0xed43('0x1f')](function(){_0x4bc5ea[_0xed43('0x15')](0xcc)[_0xed43('0x16')]();});}};}function handleEntityNotFound(_0x45a24a,_0x556440){return function(_0x414c7a){if(!_0x414c7a){_0x45a24a[_0xed43('0x21')](0x194);}return _0x414c7a;};}function handleError(_0x352494,_0x507dee){_0x507dee=_0x507dee||0x1f4;return function(_0x2a18ee){logger[_0xed43('0x22')](_0x2a18ee[_0xed43('0x23')]);if(_0x2a18ee[_0xed43('0x24')]){delete _0x2a18ee['name'];}_0x352494[_0xed43('0x15')](_0x507dee)['send'](_0x2a18ee);};}exports[_0xed43('0x25')]=function(_0xed8706,_0x1d9172){var _0x104860={},_0x59ad56={},_0xf22ed1={'count':0x0,'rows':[]};var _0x56f3f8=db['FaxApplication'][_0xed43('0x26')];_0x59ad56['model']=_['keys'](_0x56f3f8);_0x59ad56[_0xed43('0x27')]=_[_0xed43('0x28')](_0xed8706[_0xed43('0x27')]);_0x59ad56[_0xed43('0x29')]=_[_0xed43('0x2a')](_0x59ad56['model'],_0x59ad56[_0xed43('0x27')]);_0x104860[_0xed43('0x2b')]=_[_0xed43('0x2a')](_0x59ad56[_0xed43('0x2c')],qs[_0xed43('0x2d')](_0xed8706['query'][_0xed43('0x2d')]));_0x104860[_0xed43('0x2b')]=_0x104860[_0xed43('0x2b')]['length']?_0x104860[_0xed43('0x2b')]:_0x59ad56[_0xed43('0x2c')];if(!_0xed8706[_0xed43('0x27')][_0xed43('0x2e')](_0xed43('0x2f'))){_0x104860[_0xed43('0x19')]=qs[_0xed43('0x19')](_0xed8706[_0xed43('0x27')]['limit']);_0x104860['offset']=qs[_0xed43('0x18')](_0xed8706['query'][_0xed43('0x18')]);}_0x104860[_0xed43('0x30')]=qs['sort'](_0xed8706[_0xed43('0x27')][_0xed43('0x31')]);_0x104860[_0xed43('0x32')]=qs[_0xed43('0x29')](_[_0xed43('0x33')](_0xed8706[_0xed43('0x27')],_0x59ad56[_0xed43('0x29')]));if(_0xed8706[_0xed43('0x27')]['filter']){_0x104860['where']=_[_0xed43('0x34')](_0x104860[_0xed43('0x32')],{'$or':_[_0xed43('0x35')](_0x56f3f8,function(_0x1ff34b){if(_0x1ff34b[_0xed43('0x36')]['key']!==_0xed43('0x37')){var _0x51c18f={};_0x51c18f[_0x1ff34b[_0xed43('0x38')]]={'$like':'%'+_0xed8706[_0xed43('0x27')][_0xed43('0x39')]+'%'};return _0x51c18f;}})});}_0x104860=_['merge']({},_0x104860,_0xed8706[_0xed43('0x3a')]);var _0x145c4b={'where':_0x104860['where']};return db[_0xed43('0x3b')][_0xed43('0x17')](_0x145c4b)['then'](function(_0x475185){_0xf22ed1['count']=_0x475185;if(_0xed8706[_0xed43('0x27')][_0xed43('0x3c')]){_0x104860['include']=[{'all':!![]}];}return db[_0xed43('0x3b')][_0xed43('0x3d')](_0x104860);})[_0xed43('0x1f')](function(_0x4a6ff6){_0xf22ed1[_0xed43('0x3e')]=_0x4a6ff6;return _0xf22ed1;})[_0xed43('0x1f')](respondWithFilteredResult(_0x1d9172,_0x104860))[_0xed43('0x3f')](handleError(_0x1d9172,null));};exports[_0xed43('0x40')]=function(_0xa6a7c3,_0x318241){var _0x5979f8={'raw':!![],'where':{'id':_0xa6a7c3['params']['id']}},_0x29ba91={};_0x29ba91[_0xed43('0x2c')]=_[_0xed43('0x28')](db[_0xed43('0x3b')][_0xed43('0x26')]);_0x29ba91[_0xed43('0x27')]=_[_0xed43('0x28')](_0xa6a7c3[_0xed43('0x27')]);_0x29ba91[_0xed43('0x29')]=_[_0xed43('0x2a')](_0x29ba91[_0xed43('0x2c')],_0x29ba91[_0xed43('0x27')]);_0x5979f8[_0xed43('0x2b')]=_[_0xed43('0x2a')](_0x29ba91[_0xed43('0x2c')],qs[_0xed43('0x2d')](_0xa6a7c3['query'][_0xed43('0x2d')]));_0x5979f8[_0xed43('0x2b')]=_0x5979f8[_0xed43('0x2b')]['length']?_0x5979f8[_0xed43('0x2b')]:_0x29ba91['model'];if(_0xa6a7c3['query'][_0xed43('0x3c')]){_0x5979f8[_0xed43('0x41')]=[{'all':!![]}];}_0x5979f8=_[_0xed43('0x34')]({},_0x5979f8,_0xa6a7c3[_0xed43('0x3a')]);return db['FaxApplication'][_0xed43('0x42')](_0x5979f8)[_0xed43('0x1f')](handleEntityNotFound(_0x318241,null))['then'](respondWithResult(_0x318241,null))['catch'](handleError(_0x318241,null));};exports[_0xed43('0x43')]=function(_0x4a0f1b,_0x3c9e35){return db['FaxApplication'][_0xed43('0x43')](_0x4a0f1b[_0xed43('0x44')],{})[_0xed43('0x1f')](respondWithResult(_0x3c9e35,0xc9))[_0xed43('0x3f')](handleError(_0x3c9e35,null));};exports[_0xed43('0x1e')]=function(_0x24e6bb,_0x59cf8f){if(_0x24e6bb[_0xed43('0x44')]['id']){delete _0x24e6bb[_0xed43('0x44')]['id'];}return db[_0xed43('0x3b')][_0xed43('0x42')]({'where':{'id':_0x24e6bb[_0xed43('0x45')]['id']}})[_0xed43('0x1f')](handleEntityNotFound(_0x59cf8f,null))['then'](saveUpdates(_0x24e6bb[_0xed43('0x44')],null))[_0xed43('0x1f')](respondWithResult(_0x59cf8f,null))[_0xed43('0x3f')](handleError(_0x59cf8f,null));};exports[_0xed43('0x20')]=function(_0x567327,_0xeda46e){return db[_0xed43('0x3b')]['find']({'where':{'id':_0x567327[_0xed43('0x45')]['id']}})[_0xed43('0x1f')](handleEntityNotFound(_0xeda46e,null))[_0xed43('0x1f')](removeEntity(_0xeda46e,null))[_0xed43('0x3f')](handleError(_0xeda46e,null));}; \ No newline at end of file +var _0xce1a=['to-csv','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','save','update','then','destroy','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','field','options','FaxApplication','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xce1a,0xbf));var _0xace1=function(_0x406134,_0x41e277){_0x406134=_0x406134-0x0;var _0x36bd34=_0xce1a[_0x406134];return _0x36bd34;};'use strict';var pdf=require(_0xace1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xace1('0x1'));var rp=require(_0xace1('0x2'));var moment=require(_0xace1('0x3'));var BPromise=require(_0xace1('0x4'));var Mustache=require(_0xace1('0x5'));var util=require('util');var path=require(_0xace1('0x6'));var sox=require('sox');var csv=require(_0xace1('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xace1('0x8'));var squel=require(_0xace1('0x9'));var crypto=require(_0xace1('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xace1('0x7'));var querystring=require('querystring');var Papa=require(_0xace1('0xb'));var Redis=require(_0xace1('0xc'));var authService=require(_0xace1('0xd'));var qs=require(_0xace1('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xace1('0xf'))(_0xace1('0x10'));var utils=require('../../config/utils');var config=require(_0xace1('0x11'));var db=require(_0xace1('0x12'))['db'];function respondWithStatusCode(_0x5b1db9,_0x5d05d9){_0x5d05d9=_0x5d05d9||0xcc;return function(_0x56d771){if(_0x56d771){return _0x5b1db9[_0xace1('0x13')](_0x5d05d9);}return _0x5b1db9[_0xace1('0x14')](_0x5d05d9)[_0xace1('0x15')]();};}function respondWithResult(_0x4f3995,_0x54cb30){_0x54cb30=_0x54cb30||0xc8;return function(_0x4e8389){if(_0x4e8389){return _0x4f3995[_0xace1('0x14')](_0x54cb30)[_0xace1('0x16')](_0x4e8389);}};}function respondWithFilteredResult(_0x54b542,_0x2ca339){return function(_0x248193){if(_0x248193){var _0x303080=_0x248193['count'],_0x25114d=_0x2ca339[_0xace1('0x17')],_0x6cc04e=_0x2ca339[_0xace1('0x17')]+_0x2ca339['limit'],_0x5d0aba;if(_0x6cc04e>=_0x303080){_0x6cc04e=_0x303080;_0x5d0aba=0xc8;}else{_0x5d0aba=0xce;}_0x54b542[_0xace1('0x14')](_0x5d0aba);return _0x54b542[_0xace1('0x18')](_0xace1('0x19'),_0x25114d+'-'+_0x6cc04e+'/'+_0x303080)[_0xace1('0x16')](_0x248193);}return null;};}function patchUpdates(_0x28ab49){return function(_0x5ecd76){try{jsonpatch['apply'](_0x5ecd76,_0x28ab49,!![]);}catch(_0x1781aa){return BPromise['reject'](_0x1781aa);}return _0x5ecd76[_0xace1('0x1a')]();};}function saveUpdates(_0x2d43de,_0x1bafc9){return function(_0x4fe2ba){if(_0x4fe2ba){return _0x4fe2ba[_0xace1('0x1b')](_0x2d43de)[_0xace1('0x1c')](function(_0x4fce58){return _0x4fce58;});}return null;};}function removeEntity(_0xc238d1,_0x46189d){return function(_0xe0bda8){if(_0xe0bda8){return _0xe0bda8[_0xace1('0x1d')]()[_0xace1('0x1c')](function(){_0xc238d1[_0xace1('0x14')](0xcc)[_0xace1('0x15')]();});}};}function handleEntityNotFound(_0x15f2fb,_0x324b52){return function(_0x120c33){if(!_0x120c33){_0x15f2fb[_0xace1('0x13')](0x194);}return _0x120c33;};}function handleError(_0x44ef27,_0xfc37dd){_0xfc37dd=_0xfc37dd||0x1f4;return function(_0x20706f){logger['error'](_0x20706f[_0xace1('0x1e')]);if(_0x20706f[_0xace1('0x1f')]){delete _0x20706f[_0xace1('0x1f')];}_0x44ef27[_0xace1('0x14')](_0xfc37dd)['send'](_0x20706f);};}exports[_0xace1('0x20')]=function(_0x51ab2c,_0x13a6a9){var _0x13c596={},_0x1d356b={},_0x15ca0d={'count':0x0,'rows':[]};var _0x4dfe29=db['FaxApplication'][_0xace1('0x21')];_0x1d356b[_0xace1('0x22')]=_[_0xace1('0x23')](_0x4dfe29);_0x1d356b[_0xace1('0x24')]=_['keys'](_0x51ab2c['query']);_0x1d356b[_0xace1('0x25')]=_[_0xace1('0x26')](_0x1d356b[_0xace1('0x22')],_0x1d356b[_0xace1('0x24')]);_0x13c596[_0xace1('0x27')]=_[_0xace1('0x26')](_0x1d356b[_0xace1('0x22')],qs[_0xace1('0x28')](_0x51ab2c[_0xace1('0x24')][_0xace1('0x28')]));_0x13c596[_0xace1('0x27')]=_0x13c596[_0xace1('0x27')][_0xace1('0x29')]?_0x13c596[_0xace1('0x27')]:_0x1d356b['model'];if(!_0x51ab2c['query'][_0xace1('0x2a')]('nolimit')){_0x13c596[_0xace1('0x2b')]=qs[_0xace1('0x2b')](_0x51ab2c[_0xace1('0x24')][_0xace1('0x2b')]);_0x13c596[_0xace1('0x17')]=qs[_0xace1('0x17')](_0x51ab2c['query'][_0xace1('0x17')]);}_0x13c596[_0xace1('0x2c')]=qs[_0xace1('0x2d')](_0x51ab2c['query']['sort']);_0x13c596[_0xace1('0x2e')]=qs[_0xace1('0x25')](_[_0xace1('0x2f')](_0x51ab2c[_0xace1('0x24')],_0x1d356b[_0xace1('0x25')]));if(_0x51ab2c[_0xace1('0x24')][_0xace1('0x30')]){_0x13c596[_0xace1('0x2e')]=_[_0xace1('0x31')](_0x13c596[_0xace1('0x2e')],{'$or':_[_0xace1('0x32')](_0x4dfe29,function(_0x3b6557){if(_0x3b6557[_0xace1('0x33')]['key']!=='VIRTUAL'){var _0x4fde2e={};_0x4fde2e[_0x3b6557[_0xace1('0x34')]]={'$like':'%'+_0x51ab2c[_0xace1('0x24')]['filter']+'%'};return _0x4fde2e;}})});}_0x13c596=_[_0xace1('0x31')]({},_0x13c596,_0x51ab2c[_0xace1('0x35')]);var _0x20ab20={'where':_0x13c596[_0xace1('0x2e')]};return db[_0xace1('0x36')]['count'](_0x20ab20)['then'](function(_0x52e2ce){_0x15ca0d[_0xace1('0x37')]=_0x52e2ce;if(_0x51ab2c[_0xace1('0x24')][_0xace1('0x38')]){_0x13c596[_0xace1('0x39')]=[{'all':!![]}];}return db['FaxApplication'][_0xace1('0x3a')](_0x13c596);})[_0xace1('0x1c')](function(_0x160807){_0x15ca0d[_0xace1('0x3b')]=_0x160807;return _0x15ca0d;})[_0xace1('0x1c')](respondWithFilteredResult(_0x13a6a9,_0x13c596))[_0xace1('0x3c')](handleError(_0x13a6a9,null));};exports[_0xace1('0x3d')]=function(_0x3d4b39,_0x1b3579){var _0x3e2082={'raw':!![],'where':{'id':_0x3d4b39[_0xace1('0x3e')]['id']}},_0x2282ad={};_0x2282ad[_0xace1('0x22')]=_['keys'](db[_0xace1('0x36')][_0xace1('0x21')]);_0x2282ad[_0xace1('0x24')]=_[_0xace1('0x23')](_0x3d4b39[_0xace1('0x24')]);_0x2282ad[_0xace1('0x25')]=_[_0xace1('0x26')](_0x2282ad[_0xace1('0x22')],_0x2282ad['query']);_0x3e2082[_0xace1('0x27')]=_['intersection'](_0x2282ad[_0xace1('0x22')],qs[_0xace1('0x28')](_0x3d4b39['query']['fields']));_0x3e2082['attributes']=_0x3e2082['attributes'][_0xace1('0x29')]?_0x3e2082[_0xace1('0x27')]:_0x2282ad[_0xace1('0x22')];if(_0x3d4b39['query'][_0xace1('0x38')]){_0x3e2082[_0xace1('0x39')]=[{'all':!![]}];}_0x3e2082=_[_0xace1('0x31')]({},_0x3e2082,_0x3d4b39[_0xace1('0x35')]);return db[_0xace1('0x36')][_0xace1('0x3f')](_0x3e2082)[_0xace1('0x1c')](handleEntityNotFound(_0x1b3579,null))['then'](respondWithResult(_0x1b3579,null))['catch'](handleError(_0x1b3579,null));};exports[_0xace1('0x40')]=function(_0x46e629,_0x83ee36){return db['FaxApplication']['create'](_0x46e629[_0xace1('0x41')],{})[_0xace1('0x1c')](respondWithResult(_0x83ee36,0xc9))[_0xace1('0x3c')](handleError(_0x83ee36,null));};exports[_0xace1('0x1b')]=function(_0x28084a,_0xa14f07){if(_0x28084a['body']['id']){delete _0x28084a[_0xace1('0x41')]['id'];}return db[_0xace1('0x36')][_0xace1('0x3f')]({'where':{'id':_0x28084a[_0xace1('0x3e')]['id']}})[_0xace1('0x1c')](handleEntityNotFound(_0xa14f07,null))['then'](saveUpdates(_0x28084a['body'],null))[_0xace1('0x1c')](respondWithResult(_0xa14f07,null))[_0xace1('0x3c')](handleError(_0xa14f07,null));};exports[_0xace1('0x1d')]=function(_0x101919,_0x5cb72d){return db['FaxApplication']['find']({'where':{'id':_0x101919[_0xace1('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5cb72d,null))[_0xace1('0x1c')](removeEntity(_0x5cb72d,null))['catch'](handleError(_0x5cb72d,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index c14a15c..fccebb5 100644 --- a/server/api/faxApplication/faxApplication.model.js +++ b/server/api/faxApplication/faxApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9492=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4_unicode_ci','lodash','util'];(function(_0x39aeb3,_0x2bf538){var _0x5f1700=function(_0x27db2f){while(--_0x27db2f){_0x39aeb3['push'](_0x39aeb3['shift']());}};_0x5f1700(++_0x2bf538);}(_0x9492,0x9a));var _0x2949=function(_0x39d258,_0x586ab4){_0x39d258=_0x39d258-0x0;var _0x2d15b2=_0x9492[_0x39d258];return _0x2d15b2;};'use strict';var _=require(_0x2949('0x0'));var util=require(_0x2949('0x1'));var logger=require(_0x2949('0x2'))(_0x2949('0x3'));var moment=require('moment');var BPromise=require(_0x2949('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2949('0x5'));var rimraf=require(_0x2949('0x6'));var config=require(_0x2949('0x7'));var attributes=require(_0x2949('0x8'));module[_0x2949('0x9')]=function(_0x48778f,_0x20caf1){return _0x48778f[_0x2949('0xa')](_0x2949('0xb'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2949('0xc')});}; \ No newline at end of file +var _0x3a28=['define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports'];(function(_0x555026,_0x52ce6f){var _0x192c26=function(_0x3b3975){while(--_0x3b3975){_0x555026['push'](_0x555026['shift']());}};_0x192c26(++_0x52ce6f);}(_0x3a28,0x9a));var _0x83a2=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x3a28[_0x279d37];return _0x530173;};'use strict';var _=require(_0x83a2('0x0'));var util=require(_0x83a2('0x1'));var logger=require(_0x83a2('0x2'))('api');var moment=require(_0x83a2('0x3'));var BPromise=require(_0x83a2('0x4'));var rp=require(_0x83a2('0x5'));var fs=require('fs');var path=require(_0x83a2('0x6'));var rimraf=require(_0x83a2('0x7'));var config=require(_0x83a2('0x8'));var attributes=require(_0x83a2('0x9'));module[_0x83a2('0xa')]=function(_0x149cd1,_0x4aee7e){return _0x149cd1[_0x83a2('0xb')]('FaxApplication',attributes,{'tableName':_0x83a2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x83a2('0xd'),'collate':_0x83a2('0xe')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 25f7668..79f9a8e 100644 --- a/server/api/faxApplication/faxApplication.rpc.js +++ b/server/api/faxApplication/faxApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a8c=['options','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','UpdateFaxApplication','FaxApplication','update','body'];(function(_0xb4ac12,_0x4cb3b3){var _0x593fa9=function(_0x28e813){while(--_0x28e813){_0xb4ac12['push'](_0xb4ac12['shift']());}};_0x593fa9(++_0x4cb3b3);}(_0x8a8c,0x16c));var _0xc8a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a8c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8a8('0x0'));var util=require('util');var moment=require(_0xc8a8('0x1'));var BPromise=require('bluebird');var rs=require(_0xc8a8('0x2'));var fs=require('fs');var Redis=require(_0xc8a8('0x3'));var db=require(_0xc8a8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc8a8('0x5'))(_0xc8a8('0x6'));var config=require(_0xc8a8('0x7'));var jayson=require(_0xc8a8('0x8'));var client=jayson[_0xc8a8('0x9')][_0xc8a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ba96e,_0x1ce0f9,_0xcbdb9){return new BPromise(function(_0x1dd006,_0x481876){return client[_0xc8a8('0xb')](_0x4ba96e,_0xcbdb9)[_0xc8a8('0xc')](function(_0xf44d92){logger[_0xc8a8('0xd')](_0xc8a8('0xe'),_0x1ce0f9,'request\x20sent');logger[_0xc8a8('0xf')](_0xc8a8('0x10'),_0x1ce0f9,_0xc8a8('0x11'),JSON['stringify'](_0xf44d92));if(_0xf44d92[_0xc8a8('0x12')]){if(_0xf44d92[_0xc8a8('0x12')][_0xc8a8('0x13')]===0x1f4){logger[_0xc8a8('0x12')]('FaxApplication,\x20%s,\x20%s',_0x1ce0f9,_0xf44d92[_0xc8a8('0x12')][_0xc8a8('0x14')]);return _0x481876(_0xf44d92[_0xc8a8('0x12')][_0xc8a8('0x14')]);}logger[_0xc8a8('0x12')]('FaxApplication,\x20%s,\x20%s',_0x1ce0f9,_0xf44d92['error'][_0xc8a8('0x14')]);return _0x1dd006(_0xf44d92[_0xc8a8('0x12')][_0xc8a8('0x14')]);}else{logger[_0xc8a8('0xd')](_0xc8a8('0xe'),_0x1ce0f9,_0xc8a8('0x11'));_0x1dd006(_0xf44d92[_0xc8a8('0x15')][_0xc8a8('0x14')]);}})['catch'](function(_0x355dd2){logger[_0xc8a8('0x12')](_0xc8a8('0xe'),_0x1ce0f9,_0x355dd2);_0x481876(_0x355dd2);});});}exports[_0xc8a8('0x16')]=function(_0x1b31cc){var _0x48f08b=this;return new Promise(function(_0x448252,_0x116254){return db[_0xc8a8('0x17')][_0xc8a8('0x18')](_0x1b31cc[_0xc8a8('0x19')],{'raw':_0x1b31cc['options']?_0x1b31cc[_0xc8a8('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b31cc['options']?_0x1b31cc[_0xc8a8('0x1a')][_0xc8a8('0x1b')]||null:null,'attributes':_0x1b31cc[_0xc8a8('0x1a')]?_0x1b31cc[_0xc8a8('0x1a')][_0xc8a8('0x1c')]||null:null,'limit':_0x1b31cc[_0xc8a8('0x1a')]?_0x1b31cc[_0xc8a8('0x1a')][_0xc8a8('0x1d')]||null:null})[_0xc8a8('0xc')](function(_0x4ac8c4){logger[_0xc8a8('0xd')]('UpdateFaxApplication',_0x1b31cc);logger[_0xc8a8('0xf')](_0xc8a8('0x16'),_0x1b31cc,JSON['stringify'](_0x4ac8c4));_0x448252(_0x4ac8c4);})['catch'](function(_0x290f35){logger[_0xc8a8('0x12')](_0xc8a8('0x16'),_0x290f35[_0xc8a8('0x14')],_0x1b31cc);_0x116254(_0x48f08b[_0xc8a8('0x12')](0x1f4,_0x290f35[_0xc8a8('0x14')]));});});}; \ No newline at end of file +var _0x2ac5=['FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateFaxApplication','options','where','attributes','limit','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3822e8,_0xa691ab){var _0x4e5955=function(_0x5ba2f0){while(--_0x5ba2f0){_0x3822e8['push'](_0x3822e8['shift']());}};_0x4e5955(++_0xa691ab);}(_0x2ac5,0x140));var _0x52ac=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0x2ac5[_0x2307fa];return _0x496486;};'use strict';var _=require(_0x52ac('0x0'));var util=require('util');var moment=require(_0x52ac('0x1'));var BPromise=require(_0x52ac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52ac('0x3'))['db'];var utils=require(_0x52ac('0x4'));var logger=require(_0x52ac('0x5'))(_0x52ac('0x6'));var config=require(_0x52ac('0x7'));var jayson=require(_0x52ac('0x8'));var client=jayson[_0x52ac('0x9')][_0x52ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf39ff3,_0x55471d,_0x5c78f1){return new BPromise(function(_0x468483,_0x4c70a8){return client[_0x52ac('0xb')](_0xf39ff3,_0x5c78f1)[_0x52ac('0xc')](function(_0xd020e9){logger['info'](_0x52ac('0xd'),_0x55471d,_0x52ac('0xe'));logger[_0x52ac('0xf')](_0x52ac('0x10'),_0x55471d,_0x52ac('0xe'),JSON[_0x52ac('0x11')](_0xd020e9));if(_0xd020e9[_0x52ac('0x12')]){if(_0xd020e9[_0x52ac('0x12')]['code']===0x1f4){logger[_0x52ac('0x12')](_0x52ac('0xd'),_0x55471d,_0xd020e9[_0x52ac('0x12')]['message']);return _0x4c70a8(_0xd020e9['error']['message']);}logger[_0x52ac('0x12')](_0x52ac('0xd'),_0x55471d,_0xd020e9[_0x52ac('0x12')][_0x52ac('0x13')]);return _0x468483(_0xd020e9['error'][_0x52ac('0x13')]);}else{logger[_0x52ac('0x14')](_0x52ac('0xd'),_0x55471d,'request\x20sent');_0x468483(_0xd020e9[_0x52ac('0x15')][_0x52ac('0x13')]);}})[_0x52ac('0x16')](function(_0x598235){logger['error'](_0x52ac('0xd'),_0x55471d,_0x598235);_0x4c70a8(_0x598235);});});}exports[_0x52ac('0x17')]=function(_0x338205){var _0x4bf388=this;return new Promise(function(_0x389d62,_0x3d2f6d){return db['FaxApplication']['update'](_0x338205['body'],{'raw':_0x338205[_0x52ac('0x18')]?_0x338205['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x338205['options']?_0x338205['options'][_0x52ac('0x19')]||null:null,'attributes':_0x338205['options']?_0x338205['options'][_0x52ac('0x1a')]||null:null,'limit':_0x338205['options']?_0x338205[_0x52ac('0x18')][_0x52ac('0x1b')]||null:null})[_0x52ac('0xc')](function(_0x39cc3b){logger[_0x52ac('0x14')]('UpdateFaxApplication',_0x338205);logger['debug']('UpdateFaxApplication',_0x338205,JSON[_0x52ac('0x11')](_0x39cc3b));_0x389d62(_0x39cc3b);})[_0x52ac('0x16')](function(_0x188e2d){logger[_0x52ac('0x12')](_0x52ac('0x17'),_0x188e2d[_0x52ac('0x13')],_0x338205);_0x3d2f6d(_0x4bf388['error'](0x1f4,_0x188e2d[_0x52ac('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index dc16556..88d18a5 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x038b=['update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put'];(function(_0x4780d5,_0x2e9f87){var _0x2dc425=function(_0xaea589){while(--_0xaea589){_0x4780d5['push'](_0x4780d5['shift']());}};_0x2dc425(++_0x2e9f87);}(_0x038b,0x114));var _0xb038=function(_0x43bf3f,_0x474857){_0x43bf3f=_0x43bf3f-0x0;var _0x3f1a34=_0x038b[_0x43bf3f];return _0x3f1a34;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb038('0x4'));var config=require(_0xb038('0x5'));var controller=require('./faxApplication.controller');router[_0xb038('0x6')]('/',auth[_0xb038('0x7')](),controller['index']);router['get'](_0xb038('0x8'),auth[_0xb038('0x7')](),controller[_0xb038('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb038('0xa')]);router[_0xb038('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0xc')]);router[_0xb038('0xd')]('/:id',auth[_0xb038('0x7')](),controller[_0xb038('0xe')]);module[_0xb038('0xf')]=router; \ No newline at end of file +var _0xae24=['destroy','multer','path','express','Router','../../config/environment','get','isAuthenticated','index','/:id','delete'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xae24,0x182));var _0x4ae2=function(_0x5b245e,_0x273563){_0x5b245e=_0x5b245e-0x0;var _0x47ee4c=_0xae24[_0x5b245e];return _0x47ee4c;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ae2('0x4'));var controller=require('./faxApplication.controller');router[_0x4ae2('0x5')]('/',auth[_0x4ae2('0x6')](),controller[_0x4ae2('0x7')]);router[_0x4ae2('0x5')](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller['show']);router['post']('/',auth[_0x4ae2('0x6')](),controller['create']);router['put'](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller['update']);router[_0x4ae2('0x9')](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller[_0x4ae2('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 6be36c5..b2d9316 100644 --- a/server/api/faxInteraction/faxInteraction.attributes.js +++ b/server/api/faxInteraction/faxInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x95f4=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x53015a,_0xf569bf){var _0x291adb=function(_0x66cfee){while(--_0x66cfee){_0x53015a['push'](_0x53015a['shift']());}};_0x291adb(++_0xf569bf);}(_0x95f4,0x1af));var _0x495f=function(_0x12d555,_0x1a8144){_0x12d555=_0x12d555-0x0;var _0x2018ad=_0x95f4[_0x12d555];return _0x2018ad;};'use strict';var Sequelize=require(_0x495f('0x0'));module[_0x495f('0x1')]={'closed':{'type':Sequelize[_0x495f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x495f('0x3')]},'disposition':{'type':Sequelize[_0x495f('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x495f('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x495f('0x5')]('in',_0x495f('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x495f('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x495f('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xa1e3=['BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x2b1f60,_0x32d583){var _0x2c595a=function(_0x514621){while(--_0x514621){_0x2b1f60['push'](_0x2b1f60['shift']());}};_0x2c595a(++_0x32d583);}(_0xa1e3,0x113));var _0x3a1e=function(_0x438feb,_0x38e592){_0x438feb=_0x438feb-0x0;var _0x24de5d=_0xa1e3[_0x438feb];return _0x24de5d;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x3a1e('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3a1e('0x1')]},'disposition':{'type':Sequelize[_0x3a1e('0x2')]},'note':{'type':Sequelize[_0x3a1e('0x2')]},'read1stAt':{'type':Sequelize[_0x3a1e('0x1')]},'fax':{'type':Sequelize[_0x3a1e('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x3a1e('0x3')]('in',_0x3a1e('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3a1e('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x3a1e('0x3')]('in',_0x3a1e('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 9ed95fb..dcc4979 100644 --- a/server/api/faxInteraction/faxInteraction.controller.js +++ b/server/api/faxInteraction/faxInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b5=['model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','select','field','color','from','tools_tags','fax_messages','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','left_join','me.FaxInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','parse','advancedFilter','createdAt','value','dateStart','startOf','utc','endOf','day','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','tableAlias','\x20IN\x20?','\x20=\x20?','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','LIKE','ContactId','filter','isNil','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','$gte','\x20IS\x20NULL','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','SELECT','clone','COUNT(me.id)','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','rawAttributes','includeAll','create','body','find','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','hasOwnProperty','options','include','findAll','addTags','setTags','spread','removeTags','download','join','root','files','server','tmp','interaction-%s.zip','Attachment','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','count','offset','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','Users','map','TagIds','forEach','Tags','push','catch','index','FaxInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5b5,0x92));var _0x5e5b=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xe5b5[_0x43d11d];return _0x38cd08;};'use strict';var pdf=require(_0x5e5b('0x0'));var emlformat=require(_0x5e5b('0x1'));var rimraf=require(_0x5e5b('0x2'));var zipdir=require(_0x5e5b('0x3'));var jsonpatch=require(_0x5e5b('0x4'));var rp=require(_0x5e5b('0x5'));var moment=require(_0x5e5b('0x6'));var BPromise=require(_0x5e5b('0x7'));var Mustache=require('mustache');var util=require(_0x5e5b('0x8'));var path=require(_0x5e5b('0x9'));var sox=require(_0x5e5b('0xa'));var csv=require(_0x5e5b('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5e5b('0xc'));var squel=require(_0x5e5b('0xd'));var crypto=require(_0x5e5b('0xe'));var jsforce=require(_0x5e5b('0xf'));var deskjs=require(_0x5e5b('0x10'));var toCsv=require(_0x5e5b('0xb'));var querystring=require('querystring');var Papa=require(_0x5e5b('0x11'));var Redis=require(_0x5e5b('0x12'));var authService=require(_0x5e5b('0x13'));var qs=require(_0x5e5b('0x14'));var hardwareService=require(_0x5e5b('0x15'));var logger=require(_0x5e5b('0x16'))(_0x5e5b('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5e5b('0x18'))['db'];config[_0x5e5b('0x19')]=_[_0x5e5b('0x1a')](config[_0x5e5b('0x19')],{'host':_0x5e5b('0x1b'),'port':0x18eb});var socket=require(_0x5e5b('0x1c'))(new Redis(config[_0x5e5b('0x19')]));require('./faxInteraction.socket')[_0x5e5b('0x1d')](socket);function respondWithStatusCode(_0x5a850a,_0xc2a9e8){_0xc2a9e8=_0xc2a9e8||0xcc;return function(_0x3cc39a){if(_0x3cc39a){return _0x5a850a['sendStatus'](_0xc2a9e8);}return _0x5a850a[_0x5e5b('0x1e')](_0xc2a9e8)[_0x5e5b('0x1f')]();};}function respondWithResult(_0x4374bd,_0x45e582){_0x45e582=_0x45e582||0xc8;return function(_0x4d7d02){if(_0x4d7d02){return _0x4374bd[_0x5e5b('0x1e')](_0x45e582)['json'](_0x4d7d02);}};}function respondWithFilteredResult(_0x4d4423,_0x492b1b){return function(_0x1cbe11){if(_0x1cbe11){var _0x2db7d8=_0x1cbe11[_0x5e5b('0x20')],_0x3ae6af=_0x492b1b[_0x5e5b('0x21')],_0x4dc16f=_0x492b1b['offset']+_0x492b1b['limit'],_0x5cb47e;if(_0x4dc16f>=_0x2db7d8){_0x4dc16f=_0x2db7d8;_0x5cb47e=0xc8;}else{_0x5cb47e=0xce;}_0x4d4423['status'](_0x5cb47e);return _0x4d4423[_0x5e5b('0x22')](_0x5e5b('0x23'),_0x3ae6af+'-'+_0x4dc16f+'/'+_0x2db7d8)[_0x5e5b('0x24')](_0x1cbe11);}return null;};}function patchUpdates(_0x5cc33a){return function(_0x11bb90){try{jsonpatch['apply'](_0x11bb90,_0x5cc33a,!![]);}catch(_0x5d6f74){return BPromise[_0x5e5b('0x25')](_0x5d6f74);}return _0x11bb90[_0x5e5b('0x26')]();};}function saveUpdates(_0x4067c0,_0x132441){return function(_0x431ff1){if(_0x431ff1){return _0x431ff1[_0x5e5b('0x27')](_0x4067c0)[_0x5e5b('0x28')](function(_0x38897a){return _0x38897a;});}return null;};}function removeEntity(_0x313529,_0x4f32de){return function(_0x26c77c){if(_0x26c77c){return _0x26c77c[_0x5e5b('0x29')]()['then'](function(){_0x313529[_0x5e5b('0x1e')](0xcc)[_0x5e5b('0x1f')]();});}};}function handleEntityNotFound(_0x208a37,_0x50db6e){return function(_0x2c9e61){if(!_0x2c9e61){_0x208a37[_0x5e5b('0x2a')](0x194);}return _0x2c9e61;};}function handleError(_0x56f4cf,_0x167dd4){_0x167dd4=_0x167dd4||0x1f4;return function(_0x2f6c98){logger[_0x5e5b('0x2b')](_0x2f6c98[_0x5e5b('0x2c')]);if(_0x2f6c98[_0x5e5b('0x2d')]){delete _0x2f6c98['name'];}_0x56f4cf[_0x5e5b('0x1e')](_0x167dd4)[_0x5e5b('0x2e')](_0x2f6c98);};}function getInteractionUsers(_0x1f921e,_0x307ef0){return new BPromise(function(_0x4a8188,_0x323370){try{if(_0x307ef0[_0x1f921e['id']]){_0x1f921e[_0x5e5b('0x2f')]=_[_0x5e5b('0x30')](_0x307ef0[_0x1f921e['id']],function(_0x236325){return{'id':_0x236325['id']};});}}catch(_0x2629c4){_0x323370(_0x2629c4);}_0x4a8188(_0x1f921e);});}function getInteractionTags(_0x9def3a,_0x1856c5){return new BPromise(function(_0x33560c,_0x596787){try{if(_0x9def3a[_0x5e5b('0x31')]){_0x9def3a['Tags']=[];_0x9def3a['TagIds']['split'](',')[_0x5e5b('0x32')](function(_0xd2a285){_0x9def3a[_0x5e5b('0x33')][_0x5e5b('0x34')](_0x1856c5[_0xd2a285]);});}delete _0x9def3a['TagIds'];}catch(_0x39d045){_0x596787(_0x39d045);}_0x33560c(_0x9def3a);});}function updateFaxInteraction(_0x1d8c68,_0x91db19,_0x33fea4){return new BPromise(function(_0x2ecb0c,_0x3d55fc){return getInteractionUsers(_0x1d8c68,_0x33fea4)['then'](function(_0x4d2176){return getInteractionTags(_0x4d2176,_0x91db19);})[_0x5e5b('0x28')](function(_0x11ee4e){_0x2ecb0c(_0x11ee4e);})[_0x5e5b('0x35')](function(_0x151ce0){_0x3d55fc(_0x151ce0);});});}exports[_0x5e5b('0x36')]=function(_0x40b29d,_0x45ae57){var _0x1bbf39={},_0x2f2bef={},_0x32a3a2={'count':0x0,'rows':[]};var _0x2360b6=db[_0x5e5b('0x37')]['rawAttributes'];_0x2f2bef[_0x5e5b('0x38')]=_[_0x5e5b('0x39')](_0x2360b6);_0x2f2bef[_0x5e5b('0x3a')]=_[_0x5e5b('0x39')](_0x40b29d[_0x5e5b('0x3a')]);_0x2f2bef[_0x5e5b('0x3b')]=_[_0x5e5b('0x3c')](_0x2f2bef[_0x5e5b('0x38')],_0x2f2bef[_0x5e5b('0x3a')]);_0x1bbf39[_0x5e5b('0x3d')]=_[_0x5e5b('0x3c')](_0x2f2bef[_0x5e5b('0x38')],qs[_0x5e5b('0x3e')](_0x40b29d['query'][_0x5e5b('0x3e')]));_0x1bbf39['attributes']=_0x1bbf39[_0x5e5b('0x3d')][_0x5e5b('0x3f')]?_0x1bbf39['attributes']:_0x2f2bef[_0x5e5b('0x38')];if(!_0x40b29d['query']['hasOwnProperty'](_0x5e5b('0x40'))){_0x1bbf39[_0x5e5b('0x41')]=qs[_0x5e5b('0x41')](_0x40b29d[_0x5e5b('0x3a')]['limit']);_0x1bbf39[_0x5e5b('0x21')]=qs[_0x5e5b('0x21')](_0x40b29d[_0x5e5b('0x3a')][_0x5e5b('0x21')]);}_0x1bbf39['order']=qs[_0x5e5b('0x42')](_0x40b29d[_0x5e5b('0x3a')][_0x5e5b('0x42')]);_0x1bbf39[_0x5e5b('0x43')]=qs[_0x5e5b('0x3b')](_[_0x5e5b('0x44')](_0x40b29d[_0x5e5b('0x3a')],_0x2f2bef['filters']));var _0x407216=[];var _0x4acc70=squel[_0x5e5b('0x45')]()['field']('id')[_0x5e5b('0x46')](_0x5e5b('0x2d'))[_0x5e5b('0x46')](_0x5e5b('0x47'))[_0x5e5b('0x48')](_0x5e5b('0x49'));var _0x441590=squel[_0x5e5b('0x45')]()[_0x5e5b('0x46')]('COUNT(*)')[_0x5e5b('0x48')](_0x5e5b('0x4a'),'me')[_0x5e5b('0x43')]('me.FaxInteractionId\x20=\x20i.id')[_0x5e5b('0x43')](_0x5e5b('0x4b'))[_0x5e5b('0x43')](_0x5e5b('0x4c'));var _0xf7e68c=squel[_0x5e5b('0x45')]()['field']('u.id')[_0x5e5b('0x46')](_0x5e5b('0x4d'))['from'](_0x5e5b('0x4e'),'ui')['left_join'](_0x5e5b('0x4f'),'u',_0x5e5b('0x50'));var _0x3f77ac=squel['select']()[_0x5e5b('0x48')]('fax_interactions','i')['left_join']('cm_contacts','c',_0x5e5b('0x51'))['left_join'](_0x5e5b('0x4f'),'o',_0x5e5b('0x52'))['left_join'](_0x5e5b('0x53'),'a','a.id\x20=\x20i.FaxAccountId')[_0x5e5b('0x54')]('fax_messages','me',_0x5e5b('0x55'));var _0x23b624=squel[_0x5e5b('0x56')]();if(_0x40b29d['query']['advancedFilter']){var _0x434cde=JSON[_0x5e5b('0x57')](_0x40b29d[_0x5e5b('0x3a')][_0x5e5b('0x58')]);_[_0x5e5b('0x39')](_0x434cde)[_0x5e5b('0x32')](function(_0x534e26){var _0x212bd5=_0x434cde[_0x534e26];if(_0x534e26===_0x5e5b('0x59')){var _0x3c25bc=moment(_0x212bd5[_0x5e5b('0x5a')][_0x5e5b('0x5b')])[_0x5e5b('0x5c')]('day')[_0x5e5b('0x5d')]()['format']();var _0x4ff0ab=moment(_0x4ff0ab)[_0x5e5b('0x5d')]()[_0x5e5b('0x5e')](_0x5e5b('0x5f'))[_0x5e5b('0x60')]();_0x23b624[_0x5e5b('0x61')](_0x5e5b('0x62'),_0x3c25bc,_0x4ff0ab);}else{if(_[_0x5e5b('0x63')](_0x212bd5['condition'])){_0x212bd5[_0x5e5b('0x64')][_0x5e5b('0x32')](function(_0x407904){switch(_0x212bd5[_0x5e5b('0x64')][_0x5e5b('0x5a')]){case'IS':if(_0x534e26!==_0x5e5b('0x65')&&_0x534e26!==_0x5e5b('0x66')){if(_[_0x5e5b('0x63')](_0x212bd5[_0x5e5b('0x5a')])&&_0x212bd5['value'][_0x5e5b('0x3f')]>0x1){_0x23b624[_0x5e5b('0x61')](_0x212bd5[_0x5e5b('0x67')]+'.'+_0x534e26+_0x5e5b('0x68'),_0x212bd5[_0x5e5b('0x5a')]);}else{_0x23b624[_0x5e5b('0x61')](_0x212bd5[_0x5e5b('0x67')]+'.'+_0x534e26+_0x5e5b('0x69'),_0x212bd5[_0x5e5b('0x5a')][0x0]);}}break;case'=':_0x23b624['and'](_0x212bd5[_0x5e5b('0x67')]+'.'+_0x534e26+_0x5e5b('0x69'),_0x212bd5['value']);break;case'LIKE':if(_0x534e26==='ContactId'){_0x23b624['and'](_0x5e5b('0x6a')+_0x5e5b('0x6b'),'%'+_0x212bd5['value']+'%');_0x23b624['or'](_0x5e5b('0x6c')+_0x5e5b('0x6b'),'%'+_0x212bd5[_0x5e5b('0x5a')]+'%');_0x23b624['or'](_0x5e5b('0x6d')+'\x20LIKE\x20?','%'+_0x212bd5['value']+'%');}else{_0x23b624['and'](_0x212bd5[_0x5e5b('0x67')]+'.'+_0x534e26+'\x20LIKE\x20?','%'+_0x212bd5[_0x5e5b('0x5a')]+'%');}break;case'>':_0x23b624['and'](_0x212bd5[_0x5e5b('0x67')]+'.'+_0x534e26+_0x5e5b('0x6e'),_0x212bd5['value']);break;case'<':_0x23b624['and'](_0x212bd5[_0x5e5b('0x67')]+'.'+_0x534e26+_0x5e5b('0x6f'),_0x212bd5[_0x5e5b('0x5a')]);break;}});}else{switch(_0x212bd5['condition'][_0x5e5b('0x5a')]){case'IS':if(_0x534e26!==_0x5e5b('0x65')&&_0x534e26!==_0x5e5b('0x66')){if(_['isArray'](_0x212bd5[_0x5e5b('0x5a')])&&_0x212bd5[_0x5e5b('0x5a')][_0x5e5b('0x3f')]>0x1){_0x23b624[_0x5e5b('0x61')](_0x212bd5[_0x5e5b('0x67')]+'.'+_0x534e26+_0x5e5b('0x68'),_0x212bd5[_0x5e5b('0x5a')]);}else{_0x23b624[_0x5e5b('0x61')](_0x212bd5[_0x5e5b('0x67')]+'.'+_0x534e26+_0x5e5b('0x69'),_0x212bd5['value'][0x0]);}}break;case'=':_0x23b624[_0x5e5b('0x61')](_0x212bd5[_0x5e5b('0x67')]+'.'+_0x534e26+'\x20=\x20?',_0x212bd5[_0x5e5b('0x5a')]);break;case _0x5e5b('0x70'):if(_0x534e26===_0x5e5b('0x71')){_0x23b624[_0x5e5b('0x61')](_0x5e5b('0x6a')+_0x5e5b('0x6b'),'%'+_0x212bd5[_0x5e5b('0x5a')]+'%');_0x23b624['or']('c.lastName'+_0x5e5b('0x6b'),'%'+_0x212bd5[_0x5e5b('0x5a')]+'%');_0x23b624['or'](_0x5e5b('0x6d')+_0x5e5b('0x6b'),'%'+_0x212bd5[_0x5e5b('0x5a')]+'%');}else{_0x23b624[_0x5e5b('0x61')](_0x212bd5[_0x5e5b('0x67')]+'.'+_0x534e26+_0x5e5b('0x6b'),'%'+_0x212bd5['value']+'%');}break;case'>':_0x23b624[_0x5e5b('0x61')](_0x212bd5['tableAlias']+'.'+_0x534e26+_0x5e5b('0x6e'),_0x212bd5[_0x5e5b('0x5a')]);break;case'<':_0x23b624['and'](_0x212bd5[_0x5e5b('0x67')]+'.'+_0x534e26+_0x5e5b('0x6f'),_0x212bd5[_0x5e5b('0x5a')]);break;}}}});}else{var _0x592167=_(Object[_0x5e5b('0x39')](_0x40b29d['query']))[_0x5e5b('0x30')](function(_0x51704b){return _0x2360b6['hasOwnProperty'](_0x51704b)?_0x51704b:undefined;})[_0x5e5b('0x72')](function(_0x43c619){return!_[_0x5e5b('0x73')](_0x43c619);})[_0x5e5b('0x5a')]();if(!_[_0x5e5b('0x74')](_0x592167)){_0x592167['forEach'](function(_0x5ed418){if(_0x5ed418===_0x5e5b('0x75')){_0x3f77ac[_0x5e5b('0x43')](_0x5e5b('0x76'),[][_0x5e5b('0x77')](_0x40b29d['query'][_0x5ed418]));}else if(_0x5ed418===_0x5e5b('0x59')){var _0x43b7c7=JSON[_0x5e5b('0x57')](_0x40b29d[_0x5e5b('0x3a')][_0x5ed418])[_0x5e5b('0x78')];var _0xc032ee=JSON['parse'](_0x40b29d['query'][_0x5ed418])['$lte'];_0x3f77ac['where'](_0x5e5b('0x62'),_0x43b7c7,_0xc032ee);}else{if(_0x40b29d['query'][_0x5ed418]==='null'){_0x3f77ac['where']('i.'+_0x5ed418+_0x5e5b('0x79'));}else{_0x3f77ac['where']('i.'+_0x5ed418+'\x20=\x20?',_0x40b29d[_0x5e5b('0x3a')][_0x5ed418]);}}});}if(_0x40b29d[_0x5e5b('0x3a')][_0x5e5b('0x72')]){var _0x22f7ea=_0x40b29d['query'][_0x5e5b('0x72')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x5e5b('0x7a')](_0x22f7ea)){_0x23b624['or'](_0x5e5b('0x7b'),_0x22f7ea+'%')['or'](_0x5e5b('0x7c'),_0x22f7ea+'%');}_0x23b624['or'](_0x5e5b('0x7d'),_0x22f7ea+'%');}}_0x3f77ac['where'](_0x23b624);if(_0x1bbf39[_0x5e5b('0x7e')]){_0x1bbf39['order'][_0x5e5b('0x32')](function(_0x1b3206){_0x3f77ac[_0x5e5b('0x7e')]('i.'+_0x1b3206[0x0],_0x1b3206[0x1]===_0x5e5b('0x7f')?![]:!![]);});}_0x3f77ac[_0x5e5b('0x80')]('i.id');var _0x2d002e={'type':db['Sequelize']['QueryTypes'][_0x5e5b('0x81')],'raw':!![]};var _0x59fb84=_0x3f77ac[_0x5e5b('0x82')]()[_0x5e5b('0x46')]('COUNT(*)')[_0x5e5b('0x46')](_0x5e5b('0x83'),'unreadMessages');if(!_0x40b29d[_0x5e5b('0x3a')][_0x5e5b('0x58')]){if(_0x40b29d[_0x5e5b('0x3a')][_0x5e5b('0x84')]){if(_0x40b29d['query']['read']==0x1){_0x59fb84['having'](_0x5e5b('0x85'));_0x3f77ac[_0x5e5b('0x86')](_0x5e5b('0x85'));}else{_0x59fb84[_0x5e5b('0x86')](_0x5e5b('0x87'));_0x3f77ac['having'](_0x5e5b('0x87'));}}if(_0x40b29d['query'][_0x5e5b('0x88')]){var _0x3d6427=_[_0x5e5b('0x63')](_0x40b29d[_0x5e5b('0x3a')][_0x5e5b('0x88')])?_0x40b29d[_0x5e5b('0x3a')][_0x5e5b('0x88')]:new Array(_0x40b29d[_0x5e5b('0x3a')]['tag']);var _0x9f652b=squel[_0x5e5b('0x56')]();_0x3d6427[_0x5e5b('0x32')](function(_0x1f7fef){_0x9f652b['or'](_0x5e5b('0x89'),'%,'+_0x1f7fef+',%');});_0x3f77ac['having'](_0x9f652b);_0x59fb84[_0x5e5b('0x54')](_0x5e5b('0x8a'),'it',_0x5e5b('0x8b'));_0x59fb84[_0x5e5b('0x54')](_0x5e5b('0x49'),'t','t.id\x20=\x20it.TagId');_0x59fb84[_0x5e5b('0x43')](_0x5e5b('0x8c'),_0x3d6427);}}else{var _0x434cde=JSON[_0x5e5b('0x57')](_0x40b29d[_0x5e5b('0x3a')][_0x5e5b('0x58')]);_[_0x5e5b('0x39')](_0x434cde)['forEach'](function(_0x56a8bd){var _0xe5578e=_0x434cde[_0x56a8bd];if(_0x56a8bd===_0x5e5b('0x65')){var _0x535425=_0xe5578e[_0x5e5b('0x5a')];var _0x2e1c38=squel[_0x5e5b('0x56')]();_0x535425[_0x5e5b('0x32')](function(_0xddbd76){_0x2e1c38['or'](_0x5e5b('0x89'),'%,'+_0xddbd76+',%');});_0x3f77ac[_0x5e5b('0x86')](_0x2e1c38);_0x59fb84['left_join'](_0x5e5b('0x8d'),'it',_0x5e5b('0x8e'));_0x59fb84[_0x5e5b('0x54')](_0x5e5b('0x49'),'t',_0x5e5b('0x8f'));_0x59fb84[_0x5e5b('0x43')](_0x5e5b('0x8c'),_0x535425);}else if(_0x56a8bd===_0x5e5b('0x66')){if(_0xe5578e[_0x5e5b('0x5a')][_0x5e5b('0x3f')]===0x1){if(_0xe5578e[_0x5e5b('0x5a')][0x0]===0x1){_0x59fb84[_0x5e5b('0x86')](_0x5e5b('0x85'));_0x3f77ac['having'](_0x5e5b('0x85'));}else{_0x59fb84[_0x5e5b('0x86')](_0x5e5b('0x87'));_0x3f77ac['having'](_0x5e5b('0x87'));}}}});}db[_0x5e5b('0x90')][_0x5e5b('0x3a')](_0x59fb84['toString'](),_0x2d002e)[_0x5e5b('0x28')](function(_0x1fcc4d){_0x32a3a2['count']=_0x1fcc4d['length'];if(_0x32a3a2['count']===0x0)return[];return db[_0x5e5b('0x90')]['query'](_0x4acc70[_0x5e5b('0x91')](),_0x2d002e)[_0x5e5b('0x28')](function(_0x446011){_0x407216=_[_0x5e5b('0x92')](_0x446011,'id');_0x2d002e=_[_0x5e5b('0x93')](_0x2d002e,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x3f77ac[_0x5e5b('0x46')](_0x5e5b('0x83'),'unreadMessages');_0x3f77ac[_0x5e5b('0x46')](_0x5e5b('0x94'),_0x5e5b('0x95'));_0x3f77ac[_0x5e5b('0x46')](_0x5e5b('0x96'),'Account.mandatoryDisposition');_0x3f77ac[_0x5e5b('0x46')](_0x5e5b('0x97'));_0x3f77ac[_0x5e5b('0x46')]('c.firstName',_0x5e5b('0x98'));_0x3f77ac[_0x5e5b('0x46')](_0x5e5b('0x6c'),_0x5e5b('0x99'));_0x3f77ac[_0x5e5b('0x46')](_0x5e5b('0x6d'),_0x5e5b('0x9a'));_0x3f77ac[_0x5e5b('0x46')](_0x5e5b('0x9b'),'Contact.phone');_0x3f77ac[_0x5e5b('0x46')]('c.mobile',_0x5e5b('0x9c'));_0x3f77ac[_0x5e5b('0x46')](_0x5e5b('0x9d'),_0x5e5b('0x9e'));_0x3f77ac['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5e5b('0x31'));_0x3f77ac[_0x5e5b('0x54')](_0x5e5b('0x8a'),'it','it.FaxInteractionId\x20=\x20i.id');_0x3f77ac[_0x5e5b('0x54')](_0x5e5b('0x49'),'t',_0x5e5b('0x8f'));_0x3f77ac[_0x5e5b('0x41')](_0x1bbf39[_0x5e5b('0x41')]);_0x3f77ac[_0x5e5b('0x21')](_0x1bbf39[_0x5e5b('0x21')]);return db['sequelize'][_0x5e5b('0x3a')](_0x3f77ac[_0x5e5b('0x91')](),_0x2d002e);})[_0x5e5b('0x28')](function(_0x4ff8fc){_0xf7e68c[_0x5e5b('0x43')](_0x5e5b('0x9f'),_[_0x5e5b('0x30')](_0x4ff8fc,'id'));return db[_0x5e5b('0x90')][_0x5e5b('0x3a')](_0xf7e68c[_0x5e5b('0x91')](),_0x2d002e)[_0x5e5b('0x28')](function(_0x4a6d73){var _0x973f3c=_[_0x5e5b('0xa0')](_0x4a6d73,_0x5e5b('0xa1'));var _0x3b939c=[];_0x4ff8fc['forEach'](function(_0x17dbe3){_0x3b939c['push'](updateFaxInteraction(_0x17dbe3,_0x407216,_0x973f3c));});return BPromise[_0x5e5b('0xa2')](_0x3b939c);});});})[_0x5e5b('0x28')](function(_0x2a0002){_0x32a3a2[_0x5e5b('0xa3')]=_0x2a0002;return _0x32a3a2;})['then'](respondWithFilteredResult(_0x45ae57,_0x1bbf39))['catch'](handleError(_0x45ae57,null));};exports[_0x5e5b('0xa4')]=function(_0xcdcc78,_0x1a0074){var _0x5b4713={'raw':![],'where':{'id':_0xcdcc78[_0x5e5b('0xa5')]['id']}},_0x412bb2={};_0x412bb2[_0x5e5b('0x38')]=_['keys'](db[_0x5e5b('0x37')][_0x5e5b('0xa6')]);_0x412bb2[_0x5e5b('0x3a')]=_['keys'](_0xcdcc78[_0x5e5b('0x3a')]);_0x412bb2[_0x5e5b('0x3b')]=_['intersection'](_0x412bb2[_0x5e5b('0x38')],_0x412bb2[_0x5e5b('0x3a')]);_0x5b4713[_0x5e5b('0x3d')]=_['intersection'](_0x412bb2[_0x5e5b('0x38')],qs[_0x5e5b('0x3e')](_0xcdcc78['query']['fields']));_0x5b4713[_0x5e5b('0x3d')]=_0x5b4713[_0x5e5b('0x3d')][_0x5e5b('0x3f')]?_0x5b4713['attributes']:_0x412bb2[_0x5e5b('0x38')];if(_0xcdcc78['query'][_0x5e5b('0xa7')]){_0x5b4713['include']=[{'all':!![]}];}_0x5b4713=_[_0x5e5b('0x93')]({},_0x5b4713,_0xcdcc78['options']);return db[_0x5e5b('0x37')]['find'](_0x5b4713)[_0x5e5b('0x28')](handleEntityNotFound(_0x1a0074,null))[_0x5e5b('0x28')](respondWithResult(_0x1a0074,null))[_0x5e5b('0x35')](handleError(_0x1a0074,null));};exports[_0x5e5b('0xa8')]=function(_0x51e6e9,_0x3ff5df){return db[_0x5e5b('0x37')][_0x5e5b('0xa8')](_0x51e6e9[_0x5e5b('0xa9')],{})['then'](respondWithResult(_0x3ff5df,0xc9))[_0x5e5b('0x35')](handleError(_0x3ff5df,null));};exports[_0x5e5b('0x27')]=function(_0x334f57,_0x24aa7c){if(_0x334f57[_0x5e5b('0xa9')]['id']){delete _0x334f57['body']['id'];}return db[_0x5e5b('0x37')]['find']({'where':{'id':_0x334f57[_0x5e5b('0xa5')]['id']}})[_0x5e5b('0x28')](handleEntityNotFound(_0x24aa7c,null))['then'](saveUpdates(_0x334f57[_0x5e5b('0xa9')],null))[_0x5e5b('0x28')](respondWithResult(_0x24aa7c,null))[_0x5e5b('0x35')](handleError(_0x24aa7c,null));};exports[_0x5e5b('0x29')]=function(_0x3725a1,_0x2eb8e1){return db[_0x5e5b('0x37')][_0x5e5b('0xaa')]({'where':{'id':_0x3725a1[_0x5e5b('0xa5')]['id']}})[_0x5e5b('0x28')](handleEntityNotFound(_0x2eb8e1,null))['then'](removeEntity(_0x2eb8e1,null))[_0x5e5b('0x35')](handleError(_0x2eb8e1,null));};exports[_0x5e5b('0xab')]=function(_0x1df269,_0x50bc8f){return db[_0x5e5b('0x37')][_0x5e5b('0xab')]()[_0x5e5b('0x28')](respondWithResult(_0x50bc8f,null))['catch'](handleError(_0x50bc8f,null));};exports[_0x5e5b('0xac')]=function(_0x119a6c,_0x450fd3,_0x373756){return db[_0x5e5b('0xad')]['find']({'where':{'id':_0x119a6c['params']['id']}})[_0x5e5b('0x28')](handleEntityNotFound(_0x450fd3,null))['then'](function(_0x3f7d72){if(_0x3f7d72){return _0x3f7d72[_0x5e5b('0xac')](_0x119a6c[_0x5e5b('0xa9')]['ids'],_[_0x5e5b('0xae')](_0x119a6c[_0x5e5b('0xa9')],[_0x5e5b('0xaf'),'id'])||{});}})['then'](respondWithResult(_0x450fd3,null))['catch'](handleError(_0x450fd3,null));};exports[_0x5e5b('0xb0')]=function(_0x9a7cab,_0x2f356b,_0x2fb471){var _0x1cc901={'raw':![],'where':{}};var _0x41d1e5={};var _0x4d5bbb={'count':0x0,'rows':[]};return db[_0x5e5b('0x37')][_0x5e5b('0xb1')]({'where':{'id':_0x9a7cab[_0x5e5b('0xa5')]['id']}})['then'](handleEntityNotFound(_0x2f356b,null))[_0x5e5b('0x28')](function(_0x2ae314){if(_0x2ae314){_0x41d1e5[_0x5e5b('0x38')]=_[_0x5e5b('0x39')](db[_0x5e5b('0xad')]['rawAttributes']);_0x41d1e5[_0x5e5b('0x3a')]=_[_0x5e5b('0x39')](_0x9a7cab[_0x5e5b('0x3a')]);_0x41d1e5[_0x5e5b('0x3b')]=_[_0x5e5b('0x3c')](_0x41d1e5[_0x5e5b('0x38')],_0x41d1e5['query']);_0x1cc901[_0x5e5b('0x3d')]=_[_0x5e5b('0x3c')](_0x41d1e5['model'],qs[_0x5e5b('0x3e')](_0x9a7cab[_0x5e5b('0x3a')][_0x5e5b('0x3e')]));_0x1cc901[_0x5e5b('0x3d')]=_0x1cc901[_0x5e5b('0x3d')][_0x5e5b('0x3f')]?_0x1cc901[_0x5e5b('0x3d')]:_0x41d1e5['model'];if(!_0x9a7cab[_0x5e5b('0x3a')][_0x5e5b('0xb2')](_0x5e5b('0x40'))){_0x1cc901[_0x5e5b('0x41')]=qs[_0x5e5b('0x41')](_0x9a7cab['query'][_0x5e5b('0x41')]);_0x1cc901['offset']=qs[_0x5e5b('0x21')](_0x9a7cab[_0x5e5b('0x3a')][_0x5e5b('0x21')]);}_0x1cc901[_0x5e5b('0x7e')]=qs[_0x5e5b('0x42')](_0x9a7cab[_0x5e5b('0x3a')]['sort']);_0x1cc901[_0x5e5b('0x43')]=qs['filters'](_[_0x5e5b('0x44')](_0x9a7cab[_0x5e5b('0x3a')],_0x41d1e5[_0x5e5b('0x3b')]));_0x1cc901['where']['FaxInteractionId']=_0x2ae314['id'];if(_0x9a7cab[_0x5e5b('0x3a')]['filter']){_0x1cc901[_0x5e5b('0x43')]=_[_0x5e5b('0x93')](_0x1cc901[_0x5e5b('0x43')],{'$or':_[_0x5e5b('0x30')](_0x1cc901['attributes'],function(_0x455c8c){var _0x54567e={};_0x54567e[_0x455c8c]={'$like':'%'+_0x9a7cab[_0x5e5b('0x3a')][_0x5e5b('0x72')]+'%'};return _0x54567e;})});}if(_0x9a7cab[_0x5e5b('0x3a')][_0x5e5b('0x78')]){var _0x2e0cdb=_0x9a7cab[_0x5e5b('0x3a')]['$gte']['split'](',');var _0x577535={};_0x577535[_0x2e0cdb[0x0]]={'$gte':moment(_0x2e0cdb[0x1])[_0x5e5b('0x60')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1cc901[_0x5e5b('0x43')]=_['merge'](_0x1cc901[_0x5e5b('0x43')],_0x577535);}_0x1cc901=_[_0x5e5b('0x93')]({},_0x1cc901,_0x9a7cab[_0x5e5b('0xb3')]);return db[_0x5e5b('0xad')]['count']({'where':_0x1cc901[_0x5e5b('0x43')]})[_0x5e5b('0x28')](function(_0xe68e82){_0x4d5bbb[_0x5e5b('0x20')]=_0xe68e82;if(_0x9a7cab['query'][_0x5e5b('0xa7')]){_0x1cc901[_0x5e5b('0xb4')]=[{'all':!![]}];}return db[_0x5e5b('0xad')][_0x5e5b('0xb5')](_0x1cc901);})[_0x5e5b('0x28')](function(_0x4d6e16){_0x4d5bbb[_0x5e5b('0xa3')]=_0x4d6e16;return _0x4d5bbb;});}})[_0x5e5b('0x28')](respondWithFilteredResult(_0x2f356b,_0x1cc901))[_0x5e5b('0x35')](handleError(_0x2f356b,null));};exports[_0x5e5b('0xb6')]=function(_0xb8409d,_0x100ae6,_0x3b55a3){return db[_0x5e5b('0x37')][_0x5e5b('0xaa')]({'where':{'id':_0xb8409d['params']['id']}})[_0x5e5b('0x28')](handleEntityNotFound(_0x100ae6,null))['then'](function(_0xd75d08){if(_0xd75d08){return _0xd75d08[_0x5e5b('0xb7')](_0xb8409d[_0x5e5b('0xa9')][_0x5e5b('0xaf')],_[_0x5e5b('0xae')](_0xb8409d[_0x5e5b('0xa9')],[_0x5e5b('0xaf'),'id'])||{})[_0x5e5b('0xb8')](function(){return db['Tag'][_0x5e5b('0xb5')]({'attributes':['id',_0x5e5b('0x2d'),_0x5e5b('0x47')],'where':{'id':_0xb8409d[_0x5e5b('0xa9')][_0x5e5b('0xaf')]}});})[_0x5e5b('0x28')](function(_0x130cdb){socket['emit']('faxInteractionTags:save',{'id':Number(_0xb8409d[_0x5e5b('0xa5')]['id']),'tags':_0x130cdb||[]});return{'id':Number(_0xb8409d[_0x5e5b('0xa5')]['id']),'tags':_0x130cdb||[]};});}})[_0x5e5b('0x28')](respondWithResult(_0x100ae6,null))['catch'](handleError(_0x100ae6,null));};exports[_0x5e5b('0xb9')]=function(_0x5613d0,_0x460352,_0x5cc1c4){return db[_0x5e5b('0x37')]['find']({'where':{'id':_0x5613d0[_0x5e5b('0xa5')]['id']}})[_0x5e5b('0x28')](handleEntityNotFound(_0x460352,null))['then'](function(_0x51cd7b){if(_0x51cd7b){return _0x51cd7b[_0x5e5b('0xb9')](_0x5613d0[_0x5e5b('0x3a')][_0x5e5b('0xaf')]);}})[_0x5e5b('0x28')](respondWithStatusCode(_0x460352,null))[_0x5e5b('0x35')](handleError(_0x460352,null));};exports[_0x5e5b('0xba')]=function(_0x34a1a2,_0x69936b){var _0x2df4fe=moment()['unix']()[_0x5e5b('0x91')]();var _0x4448aa=path[_0x5e5b('0xbb')](config[_0x5e5b('0xbc')],'server',_0x5e5b('0xbd'),'attachments');var _0x209ec2=path['join'](config[_0x5e5b('0xbc')],_0x5e5b('0xbe'),_0x5e5b('0xbd'),_0x5e5b('0xbf'));var _0x518cde=path['join'](_0x209ec2,_0x2df4fe);var _0x47598e=util[_0x5e5b('0x60')](_0x5e5b('0xc0'),_0x2df4fe);var _0x6d125b=path[_0x5e5b('0xbb')](_0x209ec2,_0x47598e);var _0x40588e=![];return db[_0x5e5b('0x37')]['find']({'where':{'id':_0x34a1a2[_0x5e5b('0xa5')]['id']}})[_0x5e5b('0x28')](handleEntityNotFound(_0x69936b,null))[_0x5e5b('0x28')](function(_0x50139b){if(_0x50139b){return _0x50139b[_0x5e5b('0xb0')]({'attributes':['id',_0x5e5b('0xa9'),_0x5e5b('0x59')],'include':[{'model':db[_0x5e5b('0xc1')],'as':_0x5e5b('0xc1')}]});}return[];})['then'](function(_0x395495){_0x40588e=_0x395495[_0x5e5b('0x3f')];if(_0x395495[_0x5e5b('0x3f')]){fs[_0x5e5b('0xc2')](_0x518cde);for(var _0xa5b23f=0x0;_0xa5b23f<_0x395495['length'];_0xa5b23f++){var _0x2d5e19=_0x395495[_0xa5b23f];var _0x1f7a49=_0x2d5e19[_0x5e5b('0xc1')];if(_0x1f7a49){var _0x3f494a=path['join'](_0x4448aa,_0x1f7a49[_0x5e5b('0xc3')]);if(fs[_0x5e5b('0xc4')](_0x3f494a)){fs[_0x5e5b('0xc5')](_0x3f494a)[_0x5e5b('0xc6')](fs[_0x5e5b('0xc7')](path['join'](_0x518cde,_0x1f7a49[_0x5e5b('0xc3')])));}}}}})[_0x5e5b('0x28')](function(){if(_0x40588e){return new BPromise(function(_0x5e8e39,_0x4ade58){zipdir(_0x518cde,{'saveTo':_0x6d125b},function(_0x1063e4,_0x5e305c){if(_0x1063e4)return _0x4ade58(_0x1063e4);return _0x5e8e39(_0x5e305c);});});}})['then'](function(){if(_0x40588e){return new BPromise(function(_0x991565,_0x40ff8f){rimraf(_0x518cde,function(_0x22f68c){if(_0x22f68c)_0x40ff8f(_0x22f68c);return _0x991565();});});}})['then'](function(){if(_0x40588e){return _0x69936b[_0x5e5b('0xba')](_0x6d125b,_0x47598e,function(_0x404069){if(_0x404069){console['log'](_0x5e5b('0xc8'),_0x404069);}else{fs[_0x5e5b('0xc9')](_0x6d125b);}});}else{return _0x69936b['sendStatus'](0xc8);}})[_0x5e5b('0x35')](handleError(_0x69936b,null));}; \ No newline at end of file +var _0xaa25=['c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','fax_interaction_has_tags','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','includeAll','include','options','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','faxInteractionTags:save','unix','join','server','attachments','root','tmp','Attachment','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','download','log','err','unlinkSync','sendStatus','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','limit','order','sort','where','pick','select','field','color','from','COUNT(*)','fax_messages','me.FaxInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','value','dateStart','startOf','utc','day','format','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','\x20IN\x20?','tableAlias','and','LIKE','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','unreadMessages','\x20=\x20?','isNil','FaxAccountId','i.FaxAccountId\x20IN\x20?','$gte','$lte','null','\x20IS\x20NULL','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','i.id','Sequelize','QueryTypes','SELECT','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.FaxInteractionId\x20=\x20i.id','tools_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','sequelize','toString','count','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email'];(function(_0x4a606c,_0x1b9167){var _0x113b4f=function(_0x4b0633){while(--_0x4b0633){_0x4a606c['push'](_0x4a606c['shift']());}};_0x113b4f(++_0x1b9167);}(_0xaa25,0x100));var _0x5aa2=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xaa25[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require(_0x5aa2('0x0'));var emlformat=require(_0x5aa2('0x1'));var rimraf=require(_0x5aa2('0x2'));var zipdir=require(_0x5aa2('0x3'));var jsonpatch=require(_0x5aa2('0x4'));var rp=require(_0x5aa2('0x5'));var moment=require(_0x5aa2('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5aa2('0x7'));var util=require(_0x5aa2('0x8'));var path=require(_0x5aa2('0x9'));var sox=require(_0x5aa2('0xa'));var csv=require(_0x5aa2('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5aa2('0xc'));var squel=require(_0x5aa2('0xd'));var crypto=require('crypto');var jsforce=require(_0x5aa2('0xe'));var deskjs=require(_0x5aa2('0xf'));var toCsv=require(_0x5aa2('0xb'));var querystring=require(_0x5aa2('0x10'));var Papa=require(_0x5aa2('0x11'));var Redis=require('ioredis');var authService=require(_0x5aa2('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5aa2('0x13'))('api');var utils=require(_0x5aa2('0x14'));var config=require(_0x5aa2('0x15'));var db=require(_0x5aa2('0x16'))['db'];config['redis']=_[_0x5aa2('0x17')](config[_0x5aa2('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5aa2('0x19'))(new Redis(config[_0x5aa2('0x18')]));require(_0x5aa2('0x1a'))[_0x5aa2('0x1b')](socket);function respondWithStatusCode(_0x4b8cc3,_0xe173c0){_0xe173c0=_0xe173c0||0xcc;return function(_0x14d0a7){if(_0x14d0a7){return _0x4b8cc3['sendStatus'](_0xe173c0);}return _0x4b8cc3[_0x5aa2('0x1c')](_0xe173c0)[_0x5aa2('0x1d')]();};}function respondWithResult(_0x1f3b03,_0x13f176){_0x13f176=_0x13f176||0xc8;return function(_0xda29c1){if(_0xda29c1){return _0x1f3b03['status'](_0x13f176)[_0x5aa2('0x1e')](_0xda29c1);}};}function respondWithFilteredResult(_0xea8e86,_0x29709c){return function(_0x437f64){if(_0x437f64){var _0x2e7076=_0x437f64['count'],_0x4c5ce0=_0x29709c[_0x5aa2('0x1f')],_0x18acbe=_0x29709c[_0x5aa2('0x1f')]+_0x29709c['limit'],_0x1df250;if(_0x18acbe>=_0x2e7076){_0x18acbe=_0x2e7076;_0x1df250=0xc8;}else{_0x1df250=0xce;}_0xea8e86[_0x5aa2('0x1c')](_0x1df250);return _0xea8e86[_0x5aa2('0x20')](_0x5aa2('0x21'),_0x4c5ce0+'-'+_0x18acbe+'/'+_0x2e7076)['json'](_0x437f64);}return null;};}function patchUpdates(_0x29ea5e){return function(_0x2948f8){try{jsonpatch[_0x5aa2('0x22')](_0x2948f8,_0x29ea5e,!![]);}catch(_0x57eb58){return BPromise[_0x5aa2('0x23')](_0x57eb58);}return _0x2948f8[_0x5aa2('0x24')]();};}function saveUpdates(_0x31b648,_0x462fb4){return function(_0x45a8fa){if(_0x45a8fa){return _0x45a8fa[_0x5aa2('0x25')](_0x31b648)[_0x5aa2('0x26')](function(_0x5096ff){return _0x5096ff;});}return null;};}function removeEntity(_0x17bc98,_0x32acde){return function(_0x27f925){if(_0x27f925){return _0x27f925[_0x5aa2('0x27')]()[_0x5aa2('0x26')](function(){_0x17bc98[_0x5aa2('0x1c')](0xcc)[_0x5aa2('0x1d')]();});}};}function handleEntityNotFound(_0x181b50,_0x3b5112){return function(_0x4d90fa){if(!_0x4d90fa){_0x181b50['sendStatus'](0x194);}return _0x4d90fa;};}function handleError(_0x68e500,_0x1a80e9){_0x1a80e9=_0x1a80e9||0x1f4;return function(_0x14d48f){logger[_0x5aa2('0x28')](_0x14d48f[_0x5aa2('0x29')]);if(_0x14d48f[_0x5aa2('0x2a')]){delete _0x14d48f[_0x5aa2('0x2a')];}_0x68e500[_0x5aa2('0x1c')](_0x1a80e9)[_0x5aa2('0x2b')](_0x14d48f);};}function getInteractionUsers(_0x52b301,_0x2ded52){return new BPromise(function(_0x4eb510,_0x3ec3d4){try{if(_0x2ded52[_0x52b301['id']]){_0x52b301[_0x5aa2('0x2c')]=_[_0x5aa2('0x2d')](_0x2ded52[_0x52b301['id']],function(_0x5eb14e){return{'id':_0x5eb14e['id']};});}}catch(_0x54d9ed){_0x3ec3d4(_0x54d9ed);}_0x4eb510(_0x52b301);});}function getInteractionTags(_0x17bb01,_0x1aa4c2){return new BPromise(function(_0x31cb81,_0x57455f){try{if(_0x17bb01[_0x5aa2('0x2e')]){_0x17bb01[_0x5aa2('0x2f')]=[];_0x17bb01[_0x5aa2('0x2e')][_0x5aa2('0x30')](',')[_0x5aa2('0x31')](function(_0xb8b954){_0x17bb01['Tags'][_0x5aa2('0x32')](_0x1aa4c2[_0xb8b954]);});}delete _0x17bb01[_0x5aa2('0x2e')];}catch(_0x2ebf63){_0x57455f(_0x2ebf63);}_0x31cb81(_0x17bb01);});}function updateFaxInteraction(_0x257539,_0x40a9a1,_0x4700ca){return new BPromise(function(_0x2b0c1f,_0x13bf15){return getInteractionUsers(_0x257539,_0x4700ca)[_0x5aa2('0x26')](function(_0x42c991){return getInteractionTags(_0x42c991,_0x40a9a1);})['then'](function(_0x470702){_0x2b0c1f(_0x470702);})[_0x5aa2('0x33')](function(_0x1263cd){_0x13bf15(_0x1263cd);});});}exports[_0x5aa2('0x34')]=function(_0x30f332,_0x215eb3){var _0x10aa8b={},_0x117ba3={},_0x840463={'count':0x0,'rows':[]};var _0x6b24fe=db[_0x5aa2('0x35')][_0x5aa2('0x36')];_0x117ba3[_0x5aa2('0x37')]=_[_0x5aa2('0x38')](_0x6b24fe);_0x117ba3[_0x5aa2('0x39')]=_[_0x5aa2('0x38')](_0x30f332[_0x5aa2('0x39')]);_0x117ba3[_0x5aa2('0x3a')]=_[_0x5aa2('0x3b')](_0x117ba3[_0x5aa2('0x37')],_0x117ba3['query']);_0x10aa8b[_0x5aa2('0x3c')]=_['intersection'](_0x117ba3[_0x5aa2('0x37')],qs['fields'](_0x30f332[_0x5aa2('0x39')]['fields']));_0x10aa8b[_0x5aa2('0x3c')]=_0x10aa8b[_0x5aa2('0x3c')][_0x5aa2('0x3d')]?_0x10aa8b['attributes']:_0x117ba3['model'];if(!_0x30f332[_0x5aa2('0x39')][_0x5aa2('0x3e')]('nolimit')){_0x10aa8b[_0x5aa2('0x3f')]=qs[_0x5aa2('0x3f')](_0x30f332[_0x5aa2('0x39')]['limit']);_0x10aa8b[_0x5aa2('0x1f')]=qs[_0x5aa2('0x1f')](_0x30f332[_0x5aa2('0x39')]['offset']);}_0x10aa8b[_0x5aa2('0x40')]=qs[_0x5aa2('0x41')](_0x30f332[_0x5aa2('0x39')][_0x5aa2('0x41')]);_0x10aa8b[_0x5aa2('0x42')]=qs[_0x5aa2('0x3a')](_[_0x5aa2('0x43')](_0x30f332[_0x5aa2('0x39')],_0x117ba3['filters']));var _0x5f1a41=[];var _0x51970a=squel[_0x5aa2('0x44')]()['field']('id')[_0x5aa2('0x45')]('name')[_0x5aa2('0x45')](_0x5aa2('0x46'))[_0x5aa2('0x47')]('tools_tags');var _0x25b5b2=squel[_0x5aa2('0x44')]()[_0x5aa2('0x45')](_0x5aa2('0x48'))['from'](_0x5aa2('0x49'),'me')[_0x5aa2('0x42')](_0x5aa2('0x4a'))[_0x5aa2('0x42')](_0x5aa2('0x4b'))['where']('me.read\x20=\x20false');var _0x3f704a=squel[_0x5aa2('0x44')]()['field']('u.id')['field']('ui.FaxInteractionId')['from'](_0x5aa2('0x4c'),'ui')['left_join'](_0x5aa2('0x4d'),'u',_0x5aa2('0x4e'));var _0x40257c=squel[_0x5aa2('0x44')]()[_0x5aa2('0x47')](_0x5aa2('0x4f'),'i')[_0x5aa2('0x50')](_0x5aa2('0x51'),'c',_0x5aa2('0x52'))[_0x5aa2('0x50')](_0x5aa2('0x4d'),'o',_0x5aa2('0x53'))[_0x5aa2('0x50')](_0x5aa2('0x54'),'a',_0x5aa2('0x55'))[_0x5aa2('0x50')](_0x5aa2('0x49'),'me',_0x5aa2('0x56'));var _0x362917=squel[_0x5aa2('0x57')]();if(_0x30f332[_0x5aa2('0x39')][_0x5aa2('0x58')]){var _0x1801d7=JSON[_0x5aa2('0x59')](_0x30f332['query'][_0x5aa2('0x58')]);_[_0x5aa2('0x38')](_0x1801d7)[_0x5aa2('0x31')](function(_0x548a3f){var _0x43de1f=_0x1801d7[_0x548a3f];if(_0x548a3f==='createdAt'){var _0x525d51=moment(_0x43de1f[_0x5aa2('0x5a')][_0x5aa2('0x5b')])[_0x5aa2('0x5c')]('day')[_0x5aa2('0x5d')]()['format']();var _0x57093c=moment(_0x57093c)[_0x5aa2('0x5d')]()['endOf'](_0x5aa2('0x5e'))[_0x5aa2('0x5f')]();_0x362917['and'](_0x5aa2('0x60'),_0x525d51,_0x57093c);}else{if(_[_0x5aa2('0x61')](_0x43de1f[_0x5aa2('0x62')])){_0x43de1f[_0x5aa2('0x62')][_0x5aa2('0x31')](function(_0x5be471){switch(_0x43de1f[_0x5aa2('0x62')]['value']){case'IS':if(_0x548a3f!==_0x5aa2('0x63')&&_0x548a3f!=='unreadMessages'){if(_[_0x5aa2('0x61')](_0x43de1f['value'])&&_0x43de1f[_0x5aa2('0x5a')][_0x5aa2('0x3d')]>0x1){_0x362917['and'](_0x43de1f['tableAlias']+'.'+_0x548a3f+_0x5aa2('0x64'),_0x43de1f[_0x5aa2('0x5a')]);}else{_0x362917['and'](_0x43de1f[_0x5aa2('0x65')]+'.'+_0x548a3f+'\x20=\x20?',_0x43de1f[_0x5aa2('0x5a')][0x0]);}}break;case'=':_0x362917[_0x5aa2('0x66')](_0x43de1f[_0x5aa2('0x65')]+'.'+_0x548a3f+'\x20=\x20?',_0x43de1f[_0x5aa2('0x5a')]);break;case _0x5aa2('0x67'):if(_0x548a3f==='ContactId'){_0x362917[_0x5aa2('0x66')]('c.firstName'+_0x5aa2('0x68'),'%'+_0x43de1f['value']+'%');_0x362917['or'](_0x5aa2('0x69')+_0x5aa2('0x68'),'%'+_0x43de1f[_0x5aa2('0x5a')]+'%');_0x362917['or'](_0x5aa2('0x6a')+_0x5aa2('0x68'),'%'+_0x43de1f[_0x5aa2('0x5a')]+'%');}else{_0x362917['and'](_0x43de1f[_0x5aa2('0x65')]+'.'+_0x548a3f+_0x5aa2('0x68'),'%'+_0x43de1f[_0x5aa2('0x5a')]+'%');}break;case'>':_0x362917[_0x5aa2('0x66')](_0x43de1f[_0x5aa2('0x65')]+'.'+_0x548a3f+_0x5aa2('0x6b'),_0x43de1f[_0x5aa2('0x5a')]);break;case'<':_0x362917[_0x5aa2('0x66')](_0x43de1f[_0x5aa2('0x65')]+'.'+_0x548a3f+_0x5aa2('0x6c'),_0x43de1f[_0x5aa2('0x5a')]);break;}});}else{switch(_0x43de1f['condition']['value']){case'IS':if(_0x548a3f!==_0x5aa2('0x63')&&_0x548a3f!==_0x5aa2('0x6d')){if(_['isArray'](_0x43de1f[_0x5aa2('0x5a')])&&_0x43de1f['value'][_0x5aa2('0x3d')]>0x1){_0x362917[_0x5aa2('0x66')](_0x43de1f[_0x5aa2('0x65')]+'.'+_0x548a3f+_0x5aa2('0x64'),_0x43de1f[_0x5aa2('0x5a')]);}else{_0x362917[_0x5aa2('0x66')](_0x43de1f['tableAlias']+'.'+_0x548a3f+_0x5aa2('0x6e'),_0x43de1f['value'][0x0]);}}break;case'=':_0x362917[_0x5aa2('0x66')](_0x43de1f[_0x5aa2('0x65')]+'.'+_0x548a3f+_0x5aa2('0x6e'),_0x43de1f[_0x5aa2('0x5a')]);break;case _0x5aa2('0x67'):if(_0x548a3f==='ContactId'){_0x362917[_0x5aa2('0x66')]('c.firstName'+_0x5aa2('0x68'),'%'+_0x43de1f[_0x5aa2('0x5a')]+'%');_0x362917['or'](_0x5aa2('0x69')+_0x5aa2('0x68'),'%'+_0x43de1f[_0x5aa2('0x5a')]+'%');_0x362917['or'](_0x5aa2('0x6a')+_0x5aa2('0x68'),'%'+_0x43de1f['value']+'%');}else{_0x362917[_0x5aa2('0x66')](_0x43de1f[_0x5aa2('0x65')]+'.'+_0x548a3f+_0x5aa2('0x68'),'%'+_0x43de1f[_0x5aa2('0x5a')]+'%');}break;case'>':_0x362917['and'](_0x43de1f[_0x5aa2('0x65')]+'.'+_0x548a3f+_0x5aa2('0x6b'),_0x43de1f[_0x5aa2('0x5a')]);break;case'<':_0x362917[_0x5aa2('0x66')](_0x43de1f[_0x5aa2('0x65')]+'.'+_0x548a3f+'\x20<\x20?',_0x43de1f['value']);break;}}}});}else{var _0x3f7205=_(Object[_0x5aa2('0x38')](_0x30f332[_0x5aa2('0x39')]))[_0x5aa2('0x2d')](function(_0x71a615){return _0x6b24fe[_0x5aa2('0x3e')](_0x71a615)?_0x71a615:undefined;})['filter'](function(_0xe49e20){return!_[_0x5aa2('0x6f')](_0xe49e20);})[_0x5aa2('0x5a')]();if(!_['isEmpty'](_0x3f7205)){_0x3f7205[_0x5aa2('0x31')](function(_0x5a8201){if(_0x5a8201===_0x5aa2('0x70')){_0x40257c[_0x5aa2('0x42')](_0x5aa2('0x71'),[]['concat'](_0x30f332[_0x5aa2('0x39')][_0x5a8201]));}else if(_0x5a8201==='createdAt'){var _0x4a4e8a=JSON[_0x5aa2('0x59')](_0x30f332[_0x5aa2('0x39')][_0x5a8201])[_0x5aa2('0x72')];var _0x3138eb=JSON[_0x5aa2('0x59')](_0x30f332['query'][_0x5a8201])[_0x5aa2('0x73')];_0x40257c['where'](_0x5aa2('0x60'),_0x4a4e8a,_0x3138eb);}else{if(_0x30f332['query'][_0x5a8201]===_0x5aa2('0x74')){_0x40257c[_0x5aa2('0x42')]('i.'+_0x5a8201+_0x5aa2('0x75'));}else{_0x40257c[_0x5aa2('0x42')]('i.'+_0x5a8201+_0x5aa2('0x6e'),_0x30f332[_0x5aa2('0x39')][_0x5a8201]);}}});}if(_0x30f332[_0x5aa2('0x39')][_0x5aa2('0x76')]){var _0x102220=_0x30f332[_0x5aa2('0x39')][_0x5aa2('0x76')][_0x5aa2('0x77')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x5aa2('0x78'));if(qs['isNumeric'](_0x102220)){_0x362917['or'](_0x5aa2('0x79'),_0x102220+'%')['or'](_0x5aa2('0x7a'),_0x102220+'%');}_0x362917['or'](_0x5aa2('0x7b'),_0x102220+'%');}}_0x40257c[_0x5aa2('0x42')](_0x362917);if(_0x10aa8b[_0x5aa2('0x40')]){_0x10aa8b[_0x5aa2('0x40')][_0x5aa2('0x31')](function(_0x1515c7){_0x40257c[_0x5aa2('0x40')]('i.'+_0x1515c7[0x0],_0x1515c7[0x1]===_0x5aa2('0x7c')?![]:!![]);});}_0x40257c[_0x5aa2('0x7d')](_0x5aa2('0x7e'));var _0x3e2ccd={'type':db[_0x5aa2('0x7f')][_0x5aa2('0x80')][_0x5aa2('0x81')],'raw':!![]};var _0x328fb0=_0x40257c['clone']()[_0x5aa2('0x45')](_0x5aa2('0x48'))['field'](_0x5aa2('0x82'),'unreadMessages');if(!_0x30f332[_0x5aa2('0x39')][_0x5aa2('0x58')]){if(_0x30f332[_0x5aa2('0x39')][_0x5aa2('0x83')]){if(_0x30f332[_0x5aa2('0x39')][_0x5aa2('0x83')]==0x1){_0x328fb0[_0x5aa2('0x84')](_0x5aa2('0x85'));_0x40257c['having'](_0x5aa2('0x85'));}else{_0x328fb0[_0x5aa2('0x84')](_0x5aa2('0x86'));_0x40257c[_0x5aa2('0x84')](_0x5aa2('0x86'));}}if(_0x30f332[_0x5aa2('0x39')]['tag']){var _0x1c130c=_['isArray'](_0x30f332[_0x5aa2('0x39')]['tag'])?_0x30f332['query'][_0x5aa2('0x87')]:new Array(_0x30f332[_0x5aa2('0x39')]['tag']);var _0x4b7b44=squel[_0x5aa2('0x57')]();_0x1c130c[_0x5aa2('0x31')](function(_0x1ab08d){_0x4b7b44['or'](_0x5aa2('0x88'),'%,'+_0x1ab08d+',%');});_0x40257c['having'](_0x4b7b44);_0x328fb0[_0x5aa2('0x50')]('fax_interaction_has_tags','it',_0x5aa2('0x89'));_0x328fb0[_0x5aa2('0x50')](_0x5aa2('0x8a'),'t','t.id\x20=\x20it.TagId');_0x328fb0[_0x5aa2('0x42')]('t.id\x20IN\x20?',_0x1c130c);}}else{var _0x1801d7=JSON[_0x5aa2('0x59')](_0x30f332['query']['advancedFilter']);_[_0x5aa2('0x38')](_0x1801d7)['forEach'](function(_0x1c890a){var _0x2203ce=_0x1801d7[_0x1c890a];if(_0x1c890a===_0x5aa2('0x63')){var _0x5ec0e6=_0x2203ce['value'];var _0x2f5abb=squel[_0x5aa2('0x57')]();_0x5ec0e6[_0x5aa2('0x31')](function(_0x800e92){_0x2f5abb['or'](_0x5aa2('0x88'),'%,'+_0x800e92+',%');});_0x40257c[_0x5aa2('0x84')](_0x2f5abb);_0x328fb0[_0x5aa2('0x50')]('mail_interaction_has_tags','it',_0x5aa2('0x8b'));_0x328fb0[_0x5aa2('0x50')](_0x5aa2('0x8a'),'t',_0x5aa2('0x8c'));_0x328fb0['where']('t.id\x20IN\x20?',_0x5ec0e6);}else if(_0x1c890a===_0x5aa2('0x6d')){if(_0x2203ce['value'][_0x5aa2('0x3d')]===0x1){if(_0x2203ce[_0x5aa2('0x5a')][0x0]===0x1){_0x328fb0[_0x5aa2('0x84')]('`unreadMessages`\x20=\x200');_0x40257c[_0x5aa2('0x84')]('`unreadMessages`\x20=\x200');}else{_0x328fb0[_0x5aa2('0x84')](_0x5aa2('0x86'));_0x40257c[_0x5aa2('0x84')](_0x5aa2('0x86'));}}}});}db[_0x5aa2('0x8d')][_0x5aa2('0x39')](_0x328fb0[_0x5aa2('0x8e')](),_0x3e2ccd)[_0x5aa2('0x26')](function(_0x59158d){_0x840463[_0x5aa2('0x8f')]=_0x59158d['length'];if(_0x840463[_0x5aa2('0x8f')]===0x0)return[];return db[_0x5aa2('0x8d')][_0x5aa2('0x39')](_0x51970a[_0x5aa2('0x8e')](),_0x3e2ccd)[_0x5aa2('0x26')](function(_0x391894){_0x5f1a41=_[_0x5aa2('0x90')](_0x391894,'id');_0x3e2ccd=_[_0x5aa2('0x91')](_0x3e2ccd,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x40257c[_0x5aa2('0x45')](_0x5aa2('0x82'),_0x5aa2('0x6d'));_0x40257c['field']('a.key',_0x5aa2('0x92'));_0x40257c['field'](_0x5aa2('0x93'),_0x5aa2('0x94'));_0x40257c['field'](_0x5aa2('0x95'));_0x40257c[_0x5aa2('0x45')](_0x5aa2('0x96'),_0x5aa2('0x97'));_0x40257c['field'](_0x5aa2('0x69'),_0x5aa2('0x98'));_0x40257c[_0x5aa2('0x45')]('c.email',_0x5aa2('0x99'));_0x40257c[_0x5aa2('0x45')](_0x5aa2('0x9a'),_0x5aa2('0x9b'));_0x40257c[_0x5aa2('0x45')]('c.mobile',_0x5aa2('0x9c'));_0x40257c[_0x5aa2('0x45')](_0x5aa2('0x9d'),_0x5aa2('0x9e'));_0x40257c[_0x5aa2('0x45')](_0x5aa2('0x9f'),_0x5aa2('0x2e'));_0x40257c[_0x5aa2('0x50')](_0x5aa2('0xa0'),'it',_0x5aa2('0x89'));_0x40257c['left_join'](_0x5aa2('0x8a'),'t',_0x5aa2('0x8c'));_0x40257c[_0x5aa2('0x3f')](_0x10aa8b['limit']);_0x40257c['offset'](_0x10aa8b[_0x5aa2('0x1f')]);return db[_0x5aa2('0x8d')][_0x5aa2('0x39')](_0x40257c['toString'](),_0x3e2ccd);})[_0x5aa2('0x26')](function(_0x1b7a7f){_0x3f704a[_0x5aa2('0x42')](_0x5aa2('0xa1'),_[_0x5aa2('0x2d')](_0x1b7a7f,'id'));return db[_0x5aa2('0x8d')][_0x5aa2('0x39')](_0x3f704a[_0x5aa2('0x8e')](),_0x3e2ccd)[_0x5aa2('0x26')](function(_0xfe60df){var _0x5e9c4d=_[_0x5aa2('0xa2')](_0xfe60df,_0x5aa2('0xa3'));var _0x5e49ad=[];_0x1b7a7f[_0x5aa2('0x31')](function(_0x254aae){_0x5e49ad['push'](updateFaxInteraction(_0x254aae,_0x5f1a41,_0x5e9c4d));});return BPromise[_0x5aa2('0xa4')](_0x5e49ad);});});})[_0x5aa2('0x26')](function(_0x28df62){_0x840463[_0x5aa2('0xa5')]=_0x28df62;return _0x840463;})['then'](respondWithFilteredResult(_0x215eb3,_0x10aa8b))[_0x5aa2('0x33')](handleError(_0x215eb3,null));};exports[_0x5aa2('0xa6')]=function(_0x14b2e5,_0x5c94e6){var _0x1cf119={'raw':![],'where':{'id':_0x14b2e5[_0x5aa2('0xa7')]['id']}},_0x13d6c2={};_0x13d6c2[_0x5aa2('0x37')]=_[_0x5aa2('0x38')](db[_0x5aa2('0x35')][_0x5aa2('0x36')]);_0x13d6c2[_0x5aa2('0x39')]=_[_0x5aa2('0x38')](_0x14b2e5[_0x5aa2('0x39')]);_0x13d6c2[_0x5aa2('0x3a')]=_[_0x5aa2('0x3b')](_0x13d6c2['model'],_0x13d6c2['query']);_0x1cf119['attributes']=_[_0x5aa2('0x3b')](_0x13d6c2['model'],qs['fields'](_0x14b2e5[_0x5aa2('0x39')]['fields']));_0x1cf119[_0x5aa2('0x3c')]=_0x1cf119[_0x5aa2('0x3c')][_0x5aa2('0x3d')]?_0x1cf119[_0x5aa2('0x3c')]:_0x13d6c2['model'];if(_0x14b2e5[_0x5aa2('0x39')][_0x5aa2('0xa8')]){_0x1cf119[_0x5aa2('0xa9')]=[{'all':!![]}];}_0x1cf119=_[_0x5aa2('0x91')]({},_0x1cf119,_0x14b2e5[_0x5aa2('0xaa')]);return db[_0x5aa2('0x35')][_0x5aa2('0xab')](_0x1cf119)['then'](handleEntityNotFound(_0x5c94e6,null))[_0x5aa2('0x26')](respondWithResult(_0x5c94e6,null))[_0x5aa2('0x33')](handleError(_0x5c94e6,null));};exports['create']=function(_0xac9c3e,_0x2dba69){return db['FaxInteraction'][_0x5aa2('0xac')](_0xac9c3e[_0x5aa2('0xad')],{})[_0x5aa2('0x26')](respondWithResult(_0x2dba69,0xc9))[_0x5aa2('0x33')](handleError(_0x2dba69,null));};exports[_0x5aa2('0x25')]=function(_0xc79025,_0x5ed2f2){if(_0xc79025[_0x5aa2('0xad')]['id']){delete _0xc79025['body']['id'];}return db[_0x5aa2('0x35')][_0x5aa2('0xab')]({'where':{'id':_0xc79025['params']['id']}})['then'](handleEntityNotFound(_0x5ed2f2,null))['then'](saveUpdates(_0xc79025[_0x5aa2('0xad')],null))[_0x5aa2('0x26')](respondWithResult(_0x5ed2f2,null))['catch'](handleError(_0x5ed2f2,null));};exports['destroy']=function(_0x12be80,_0x4793da){return db[_0x5aa2('0x35')][_0x5aa2('0xab')]({'where':{'id':_0x12be80[_0x5aa2('0xa7')]['id']}})[_0x5aa2('0x26')](handleEntityNotFound(_0x4793da,null))[_0x5aa2('0x26')](removeEntity(_0x4793da,null))['catch'](handleError(_0x4793da,null));};exports[_0x5aa2('0xae')]=function(_0x4067d6,_0x108b9f){return db['FaxInteraction']['describe']()[_0x5aa2('0x26')](respondWithResult(_0x108b9f,null))[_0x5aa2('0x33')](handleError(_0x108b9f,null));};exports[_0x5aa2('0xaf')]=function(_0x4be624,_0x24e392,_0x1c48f2){return db[_0x5aa2('0xb0')]['find']({'where':{'id':_0x4be624[_0x5aa2('0xa7')]['id']}})[_0x5aa2('0x26')](handleEntityNotFound(_0x24e392,null))[_0x5aa2('0x26')](function(_0x1849fa){if(_0x1849fa){return _0x1849fa[_0x5aa2('0xaf')](_0x4be624[_0x5aa2('0xad')][_0x5aa2('0xb1')],_[_0x5aa2('0xb2')](_0x4be624[_0x5aa2('0xad')],[_0x5aa2('0xb1'),'id'])||{});}})['then'](respondWithResult(_0x24e392,null))['catch'](handleError(_0x24e392,null));};exports[_0x5aa2('0xb3')]=function(_0x50c175,_0x2c3015,_0x4c315a){var _0x3d73f2={'raw':![],'where':{}};var _0xe077af={};var _0x3df2d1={'count':0x0,'rows':[]};return db[_0x5aa2('0x35')][_0x5aa2('0xb4')]({'where':{'id':_0x50c175[_0x5aa2('0xa7')]['id']}})[_0x5aa2('0x26')](handleEntityNotFound(_0x2c3015,null))[_0x5aa2('0x26')](function(_0x4a4151){if(_0x4a4151){_0xe077af['model']=_[_0x5aa2('0x38')](db[_0x5aa2('0xb0')][_0x5aa2('0x36')]);_0xe077af['query']=_[_0x5aa2('0x38')](_0x50c175[_0x5aa2('0x39')]);_0xe077af[_0x5aa2('0x3a')]=_['intersection'](_0xe077af[_0x5aa2('0x37')],_0xe077af['query']);_0x3d73f2[_0x5aa2('0x3c')]=_[_0x5aa2('0x3b')](_0xe077af['model'],qs['fields'](_0x50c175['query']['fields']));_0x3d73f2[_0x5aa2('0x3c')]=_0x3d73f2[_0x5aa2('0x3c')][_0x5aa2('0x3d')]?_0x3d73f2[_0x5aa2('0x3c')]:_0xe077af[_0x5aa2('0x37')];if(!_0x50c175['query'][_0x5aa2('0x3e')](_0x5aa2('0xb5'))){_0x3d73f2[_0x5aa2('0x3f')]=qs[_0x5aa2('0x3f')](_0x50c175[_0x5aa2('0x39')]['limit']);_0x3d73f2[_0x5aa2('0x1f')]=qs[_0x5aa2('0x1f')](_0x50c175[_0x5aa2('0x39')][_0x5aa2('0x1f')]);}_0x3d73f2[_0x5aa2('0x40')]=qs[_0x5aa2('0x41')](_0x50c175[_0x5aa2('0x39')][_0x5aa2('0x41')]);_0x3d73f2[_0x5aa2('0x42')]=qs['filters'](_['pick'](_0x50c175[_0x5aa2('0x39')],_0xe077af[_0x5aa2('0x3a')]));_0x3d73f2[_0x5aa2('0x42')][_0x5aa2('0xa3')]=_0x4a4151['id'];if(_0x50c175[_0x5aa2('0x39')][_0x5aa2('0x76')]){_0x3d73f2[_0x5aa2('0x42')]=_['merge'](_0x3d73f2[_0x5aa2('0x42')],{'$or':_[_0x5aa2('0x2d')](_0x3d73f2['attributes'],function(_0x54f6f1){var _0x2f1507={};_0x2f1507[_0x54f6f1]={'$like':'%'+_0x50c175[_0x5aa2('0x39')][_0x5aa2('0x76')]+'%'};return _0x2f1507;})});}if(_0x50c175['query'][_0x5aa2('0x72')]){var _0x20fcec=_0x50c175[_0x5aa2('0x39')][_0x5aa2('0x72')][_0x5aa2('0x30')](',');var _0x449c07={};_0x449c07[_0x20fcec[0x0]]={'$gte':moment(_0x20fcec[0x1])[_0x5aa2('0x5f')](_0x5aa2('0xb6'))};_0x3d73f2[_0x5aa2('0x42')]=_[_0x5aa2('0x91')](_0x3d73f2[_0x5aa2('0x42')],_0x449c07);}_0x3d73f2=_[_0x5aa2('0x91')]({},_0x3d73f2,_0x50c175['options']);return db[_0x5aa2('0xb0')][_0x5aa2('0x8f')]({'where':_0x3d73f2[_0x5aa2('0x42')]})[_0x5aa2('0x26')](function(_0x49063b){_0x3df2d1[_0x5aa2('0x8f')]=_0x49063b;if(_0x50c175[_0x5aa2('0x39')][_0x5aa2('0xa8')]){_0x3d73f2[_0x5aa2('0xa9')]=[{'all':!![]}];}return db[_0x5aa2('0xb0')][_0x5aa2('0xb7')](_0x3d73f2);})[_0x5aa2('0x26')](function(_0x510544){_0x3df2d1['rows']=_0x510544;return _0x3df2d1;});}})['then'](respondWithFilteredResult(_0x2c3015,_0x3d73f2))[_0x5aa2('0x33')](handleError(_0x2c3015,null));};exports[_0x5aa2('0xb8')]=function(_0x54a817,_0x498227,_0x5a314d){return db[_0x5aa2('0x35')][_0x5aa2('0xab')]({'where':{'id':_0x54a817[_0x5aa2('0xa7')]['id']}})[_0x5aa2('0x26')](handleEntityNotFound(_0x498227,null))['then'](function(_0x23e081){if(_0x23e081){return _0x23e081[_0x5aa2('0xb9')](_0x54a817[_0x5aa2('0xad')]['ids'],_[_0x5aa2('0xb2')](_0x54a817[_0x5aa2('0xad')],[_0x5aa2('0xb1'),'id'])||{})[_0x5aa2('0xba')](function(){return db['Tag']['findAll']({'attributes':['id',_0x5aa2('0x2a'),_0x5aa2('0x46')],'where':{'id':_0x54a817[_0x5aa2('0xad')][_0x5aa2('0xb1')]}});})[_0x5aa2('0x26')](function(_0xce9c4e){socket['emit'](_0x5aa2('0xbb'),{'id':Number(_0x54a817[_0x5aa2('0xa7')]['id']),'tags':_0xce9c4e||[]});return{'id':Number(_0x54a817[_0x5aa2('0xa7')]['id']),'tags':_0xce9c4e||[]};});}})[_0x5aa2('0x26')](respondWithResult(_0x498227,null))[_0x5aa2('0x33')](handleError(_0x498227,null));};exports['removeTags']=function(_0x4ed979,_0x1dc9c3,_0x4084e0){return db[_0x5aa2('0x35')]['find']({'where':{'id':_0x4ed979['params']['id']}})[_0x5aa2('0x26')](handleEntityNotFound(_0x1dc9c3,null))[_0x5aa2('0x26')](function(_0x4d47a4){if(_0x4d47a4){return _0x4d47a4['removeTags'](_0x4ed979[_0x5aa2('0x39')][_0x5aa2('0xb1')]);}})[_0x5aa2('0x26')](respondWithStatusCode(_0x1dc9c3,null))[_0x5aa2('0x33')](handleError(_0x1dc9c3,null));};exports['download']=function(_0x4dc545,_0x5b08ff){var _0x493b25=moment()[_0x5aa2('0xbc')]()[_0x5aa2('0x8e')]();var _0x2f30d7=path[_0x5aa2('0xbd')](config['root'],_0x5aa2('0xbe'),'files',_0x5aa2('0xbf'));var _0x4cad86=path[_0x5aa2('0xbd')](config[_0x5aa2('0xc0')],_0x5aa2('0xbe'),'files',_0x5aa2('0xc1'));var _0x577fbd=path['join'](_0x4cad86,_0x493b25);var _0x6a4afb=util[_0x5aa2('0x5f')]('interaction-%s.zip',_0x493b25);var _0x12b047=path['join'](_0x4cad86,_0x6a4afb);var _0x1c335b=![];return db[_0x5aa2('0x35')][_0x5aa2('0xab')]({'where':{'id':_0x4dc545[_0x5aa2('0xa7')]['id']}})[_0x5aa2('0x26')](handleEntityNotFound(_0x5b08ff,null))[_0x5aa2('0x26')](function(_0x2499a3){if(_0x2499a3){return _0x2499a3[_0x5aa2('0xb3')]({'attributes':['id',_0x5aa2('0xad'),'createdAt'],'include':[{'model':db['Attachment'],'as':_0x5aa2('0xc2')}]});}return[];})['then'](function(_0x3ef2d5){_0x1c335b=_0x3ef2d5[_0x5aa2('0x3d')];if(_0x3ef2d5[_0x5aa2('0x3d')]){fs[_0x5aa2('0xc3')](_0x577fbd);for(var _0x5ea696=0x0;_0x5ea696<_0x3ef2d5['length'];_0x5ea696++){var _0x2a2568=_0x3ef2d5[_0x5ea696];var _0x572bc4=_0x2a2568[_0x5aa2('0xc2')];if(_0x572bc4){var _0x7aa64d=path['join'](_0x2f30d7,_0x572bc4['basename']);if(fs[_0x5aa2('0xc4')](_0x7aa64d)){fs[_0x5aa2('0xc5')](_0x7aa64d)[_0x5aa2('0xc6')](fs[_0x5aa2('0xc7')](path[_0x5aa2('0xbd')](_0x577fbd,_0x572bc4['basename'])));}}}}})[_0x5aa2('0x26')](function(){if(_0x1c335b){return new BPromise(function(_0x3f6ee1,_0x594056){zipdir(_0x577fbd,{'saveTo':_0x12b047},function(_0x26979b,_0x945a69){if(_0x26979b)return _0x594056(_0x26979b);return _0x3f6ee1(_0x945a69);});});}})['then'](function(){if(_0x1c335b){return new BPromise(function(_0x58f51c,_0xffc27){rimraf(_0x577fbd,function(_0x15c2f4){if(_0x15c2f4)_0xffc27(_0x15c2f4);return _0x58f51c();});});}})[_0x5aa2('0x26')](function(){if(_0x1c335b){return _0x5b08ff[_0x5aa2('0xc8')](_0x12b047,_0x6a4afb,function(_0xe9f7db){if(_0xe9f7db){console[_0x5aa2('0xc9')](_0x5aa2('0xca'),_0xe9f7db);}else{fs[_0x5aa2('0xcb')](_0x12b047);}});}else{return _0x5b08ff[_0x5aa2('0xcc')](0xc8);}})[_0x5aa2('0x33')](handleError(_0x5b08ff,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index af06ea8..b54ee05 100644 --- a/server/api/faxInteraction/faxInteraction.events.js +++ b/server/api/faxInteraction/faxInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','getUsers','then','setDataValue','findAll'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xc4aa[_0x1969a7];return _0x3d665f;};'use strict';var EventEmitter=require(_0xac4a('0x0'));var FaxInteraction=require(_0xac4a('0x1'))['db'][_0xac4a('0x2')];var FaxMessage=require(_0xac4a('0x1'))['db'][_0xac4a('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xac4a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2f48ed){return function(_0x15b967,_0x730a38,_0x215f39){_0x15b967[_0xac4a('0x5')]({'attributes':['id'],'raw':!![]})[_0xac4a('0x6')](function(_0x3ef77c){_0x15b967[_0xac4a('0x7')]('Users',_0x3ef77c['map'](function(_0x1aba6d){return{'id':_0x1aba6d['id']};}));return FaxMessage[_0xac4a('0x8')]({'where':{'FaxInteractionId':_0x15b967['id'],'direction':'in','read':![]},'raw':!![]});})[_0xac4a('0x6')](function(_0x4f4146){_0x15b967[_0xac4a('0x7')](_0xac4a('0x9'),_0x4f4146[_0xac4a('0xa')]);FaxInteractionEvents['emit'](_0x2f48ed+':'+_0x15b967['id'],_0x15b967);FaxInteractionEvents[_0xac4a('0xb')](_0x2f48ed,_0x15b967);_0x215f39(null);})['catch'](_0x215f39(null));};}for(var e in events){if(events[_0xac4a('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xac4a('0xd')]=FaxInteractionEvents; \ No newline at end of file +var _0x7a54=['setDataValue','map','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers'];(function(_0x13a72e,_0x16e7e8){var _0x2069e7=function(_0x5ce2ce){while(--_0x5ce2ce){_0x13a72e['push'](_0x13a72e['shift']());}};_0x2069e7(++_0x16e7e8);}(_0x7a54,0x106));var _0x47a5=function(_0x125a09,_0x1fde80){_0x125a09=_0x125a09-0x0;var _0x59e145=_0x7a54[_0x125a09];return _0x59e145;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var FaxInteraction=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x47a5('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x47a5('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x47a5('0x5'),'afterDestroy':_0x47a5('0x6')};function emitEvent(_0x2a1a7e){return function(_0x3717e1,_0xfdf934,_0x545a97){_0x3717e1[_0x47a5('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x343372){_0x3717e1[_0x47a5('0x8')]('Users',_0x343372[_0x47a5('0x9')](function(_0x5077f3){return{'id':_0x5077f3['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x3717e1['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a0e98){_0x3717e1[_0x47a5('0x8')]('unreadMessages',_0x2a0e98[_0x47a5('0xa')]);FaxInteractionEvents['emit'](_0x2a1a7e+':'+_0x3717e1['id'],_0x3717e1);FaxInteractionEvents['emit'](_0x2a1a7e,_0x3717e1);_0x545a97(null);})[_0x47a5('0xb')](_0x545a97(null));};}for(var e in events){if(events[_0x47a5('0xc')](e)){var event=events[e];FaxInteraction[_0x47a5('0xd')](e,emitEvent(event));}}module[_0x47a5('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 5e35cdf..0cdc97b 100644 --- a/server/api/faxInteraction/faxInteraction.model.js +++ b/server/api/faxInteraction/faxInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0592=['FaxInteraction','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define'];(function(_0x19b5b7,_0x2070e7){var _0x381f0e=function(_0x218bab){while(--_0x218bab){_0x19b5b7['push'](_0x19b5b7['shift']());}};_0x381f0e(++_0x2070e7);}(_0x0592,0x7c));var _0x2059=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0592[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x2059('0x0'));var util=require(_0x2059('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2059('0x2'));var BPromise=require(_0x2059('0x3'));var rp=require(_0x2059('0x4'));var fs=require('fs');var path=require(_0x2059('0x5'));var rimraf=require(_0x2059('0x6'));var config=require(_0x2059('0x7'));var attributes=require(_0x2059('0x8'));module[_0x2059('0x9')]=function(_0x349063,_0x256d3a){return _0x349063[_0x2059('0xa')](_0x2059('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x587ce6,_0x2c947f,_0x2abceb){if(_0x587ce6[_0x2059('0xc')]('closed')){_0x587ce6['closedAt']=moment()[_0x2059('0xd')](_0x2059('0xe'));}_0x2abceb(null,_0x587ce6);}}});}; \ No newline at end of file +var _0x18e3=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed'];(function(_0x29d0f2,_0x5d6cd8){var _0x520360=function(_0x17fb8e){while(--_0x17fb8e){_0x29d0f2['push'](_0x29d0f2['shift']());}};_0x520360(++_0x5d6cd8);}(_0x18e3,0x1df));var _0x318e=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0x18e3[_0x4c4037];return _0x357862;};'use strict';var _=require(_0x318e('0x0'));var util=require(_0x318e('0x1'));var logger=require(_0x318e('0x2'))(_0x318e('0x3'));var moment=require('moment');var BPromise=require(_0x318e('0x4'));var rp=require(_0x318e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x318e('0x6'));var config=require('../../config/environment');var attributes=require(_0x318e('0x7'));module[_0x318e('0x8')]=function(_0x2c801a,_0x4fdf6a){return _0x2c801a[_0x318e('0x9')](_0x318e('0xa'),attributes,{'tableName':_0x318e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x222b5e,_0x5553c1,_0x204a84){if(_0x222b5e[_0x318e('0xc')](_0x318e('0xd'))){_0x222b5e[_0x318e('0xe')]=moment()[_0x318e('0xf')](_0x318e('0x10'));}_0x204a84(null,_0x222b5e);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 58e62e9..cd7f90c 100644 --- a/server/api/faxInteraction/faxInteraction.rpc.js +++ b/server/api/faxInteraction/faxInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4447=['raw','where','attributes','limit','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','options'];(function(_0x41c842,_0x3865f6){var _0x15ee6b=function(_0x2505f5){while(--_0x2505f5){_0x41c842['push'](_0x41c842['shift']());}};_0x15ee6b(++_0x3865f6);}(_0x4447,0x11f));var _0x7444=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x4447[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x7444('0x0'));var util=require(_0x7444('0x1'));var moment=require(_0x7444('0x2'));var BPromise=require(_0x7444('0x3'));var rs=require(_0x7444('0x4'));var fs=require('fs');var Redis=require(_0x7444('0x5'));var db=require(_0x7444('0x6'))['db'];var utils=require(_0x7444('0x7'));var logger=require(_0x7444('0x8'))(_0x7444('0x9'));var config=require(_0x7444('0xa'));var jayson=require(_0x7444('0xb'));var client=jayson[_0x7444('0xc')]['http']({'port':0x232a});config['redis']=_[_0x7444('0xd')](config[_0x7444('0xe')],{'host':_0x7444('0xf'),'port':0x18eb});var socket=require(_0x7444('0x10'))(new Redis(config[_0x7444('0xe')]));require(_0x7444('0x11'))[_0x7444('0x12')](socket);function respondWithRpcPromise(_0x28e8f6,_0x3b7c1b,_0x3d3df6){return new BPromise(function(_0x13f5d6,_0x1e0322){return client[_0x7444('0x13')](_0x28e8f6,_0x3d3df6)[_0x7444('0x14')](function(_0x2ac81b){logger[_0x7444('0x15')](_0x7444('0x16'),_0x3b7c1b,_0x7444('0x17'));logger[_0x7444('0x18')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x3b7c1b,_0x7444('0x17'),JSON[_0x7444('0x19')](_0x2ac81b));if(_0x2ac81b[_0x7444('0x1a')]){if(_0x2ac81b[_0x7444('0x1a')][_0x7444('0x1b')]===0x1f4){logger[_0x7444('0x1a')](_0x7444('0x16'),_0x3b7c1b,_0x2ac81b[_0x7444('0x1a')][_0x7444('0x1c')]);return _0x1e0322(_0x2ac81b[_0x7444('0x1a')][_0x7444('0x1c')]);}logger[_0x7444('0x1a')](_0x7444('0x16'),_0x3b7c1b,_0x2ac81b[_0x7444('0x1a')]['message']);return _0x13f5d6(_0x2ac81b[_0x7444('0x1a')][_0x7444('0x1c')]);}else{logger[_0x7444('0x15')](_0x7444('0x16'),_0x3b7c1b,'request\x20sent');_0x13f5d6(_0x2ac81b[_0x7444('0x1d')]['message']);}})[_0x7444('0x1e')](function(_0x3d256d){logger[_0x7444('0x1a')](_0x7444('0x16'),_0x3b7c1b,_0x3d256d);_0x1e0322(_0x3d256d);});});}exports[_0x7444('0x1f')]=function(_0x5bde41){var _0x19cce5=this;return new Promise(function(_0x37790c,_0x1ad3b1){return db[_0x7444('0x20')][_0x7444('0x21')](_0x5bde41['body'],{'raw':_0x5bde41[_0x7444('0x22')]?_0x5bde41[_0x7444('0x22')][_0x7444('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bde41[_0x7444('0x22')]?_0x5bde41['options'][_0x7444('0x24')]||null:null,'attributes':_0x5bde41['options']?_0x5bde41[_0x7444('0x22')][_0x7444('0x25')]||null:null,'limit':_0x5bde41[_0x7444('0x22')]?_0x5bde41[_0x7444('0x22')][_0x7444('0x26')]||null:null})[_0x7444('0x14')](function(_0x1c5fb1){logger[_0x7444('0x15')]('UpdateFaxInteraction',_0x5bde41);logger[_0x7444('0x18')]('UpdateFaxInteraction',_0x5bde41,JSON[_0x7444('0x19')](_0x1c5fb1));_0x37790c(_0x1c5fb1);})[_0x7444('0x1e')](function(_0x5d26b0){logger['error'](_0x7444('0x1f'),_0x5d26b0[_0x7444('0x1c')],_0x5bde41);_0x1ad3b1(_0x19cce5[_0x7444('0x1a')](0x1f4,_0x5d26b0[_0x7444('0x1c')]));});});};exports['AddTagsToFaxInteraction']=function(_0x21ab75){return new Promise(function(_0x4dfca0,_0x233816){return db['FaxInteraction'][_0x7444('0x27')]({'where':_0x21ab75[_0x7444('0x22')]?_0x21ab75[_0x7444('0x22')]['where']||null:null})[_0x7444('0x14')](function(_0x4e7984){if(_0x4e7984){return _0x4e7984[_0x7444('0x28')](_0x21ab75[_0x7444('0x29')][_0x7444('0x2a')],_[_0x7444('0x2b')](_0x21ab75[_0x7444('0x29')],[_0x7444('0x2a'),'id'])||{});}})[_0x7444('0x2c')](function(_0x1239e0){logger[_0x7444('0x15')](_0x7444('0x2d'),_0x21ab75);logger[_0x7444('0x18')]('AddTags',_0x21ab75,JSON[_0x7444('0x19')](_0x1239e0));_0x4dfca0(_0x1239e0);})[_0x7444('0x1e')](function(_0x1887e2){logger['error'](_0x7444('0x2d'),_0x1887e2[_0x7444('0x1c')],_0x21ab75);_0x233816(_this['error'](0x1f4,_0x1887e2[_0x7444('0x1c')]));});});}; \ No newline at end of file +var _0x7252=['request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','then','AddTagsToFaxInteraction','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','FaxInteraction,\x20%s,\x20%s'];(function(_0x1ae8be,_0x34af04){var _0x18550a=function(_0x3bc579){while(--_0x3bc579){_0x1ae8be['push'](_0x1ae8be['shift']());}};_0x18550a(++_0x34af04);}(_0x7252,0x15f));var _0x2725=function(_0x547645,_0xd0e9ae){_0x547645=_0x547645-0x0;var _0x419710=_0x7252[_0x547645];return _0x419710;};'use strict';var _=require('lodash');var util=require(_0x2725('0x0'));var moment=require(_0x2725('0x1'));var BPromise=require(_0x2725('0x2'));var rs=require(_0x2725('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2725('0x4'));var logger=require(_0x2725('0x5'))(_0x2725('0x6'));var config=require(_0x2725('0x7'));var jayson=require(_0x2725('0x8'));var client=jayson[_0x2725('0x9')][_0x2725('0xa')]({'port':0x232a});config[_0x2725('0xb')]=_['defaults'](config['redis'],{'host':_0x2725('0xc'),'port':0x18eb});var socket=require(_0x2725('0xd'))(new Redis(config[_0x2725('0xb')]));require(_0x2725('0xe'))[_0x2725('0xf')](socket);function respondWithRpcPromise(_0x1d36e7,_0x4c587c,_0x2a7171){return new BPromise(function(_0x3bf045,_0x1da42f){return client[_0x2725('0x10')](_0x1d36e7,_0x2a7171)['then'](function(_0x382260){logger['info'](_0x2725('0x11'),_0x4c587c,_0x2725('0x12'));logger[_0x2725('0x13')](_0x2725('0x14'),_0x4c587c,_0x2725('0x12'),JSON[_0x2725('0x15')](_0x382260));if(_0x382260[_0x2725('0x16')]){if(_0x382260[_0x2725('0x16')][_0x2725('0x17')]===0x1f4){logger['error'](_0x2725('0x11'),_0x4c587c,_0x382260[_0x2725('0x16')][_0x2725('0x18')]);return _0x1da42f(_0x382260[_0x2725('0x16')][_0x2725('0x18')]);}logger['error'](_0x2725('0x11'),_0x4c587c,_0x382260[_0x2725('0x16')][_0x2725('0x18')]);return _0x3bf045(_0x382260['error'][_0x2725('0x18')]);}else{logger[_0x2725('0x19')](_0x2725('0x11'),_0x4c587c,_0x2725('0x12'));_0x3bf045(_0x382260[_0x2725('0x1a')]['message']);}})[_0x2725('0x1b')](function(_0x452059){logger['error'](_0x2725('0x11'),_0x4c587c,_0x452059);_0x1da42f(_0x452059);});});}exports[_0x2725('0x1c')]=function(_0x1da974){var _0x390e2c=this;return new Promise(function(_0x4aa287,_0x393583){return db[_0x2725('0x1d')][_0x2725('0x1e')](_0x1da974[_0x2725('0x1f')],{'raw':_0x1da974[_0x2725('0x20')]?_0x1da974[_0x2725('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1da974[_0x2725('0x20')]?_0x1da974['options'][_0x2725('0x21')]||null:null,'attributes':_0x1da974['options']?_0x1da974['options']['attributes']||null:null,'limit':_0x1da974[_0x2725('0x20')]?_0x1da974['options']['limit']||null:null})[_0x2725('0x22')](function(_0x21cabe){logger['info'](_0x2725('0x1c'),_0x1da974);logger[_0x2725('0x13')](_0x2725('0x1c'),_0x1da974,JSON[_0x2725('0x15')](_0x21cabe));_0x4aa287(_0x21cabe);})[_0x2725('0x1b')](function(_0x30952b){logger[_0x2725('0x16')]('UpdateFaxInteraction',_0x30952b[_0x2725('0x18')],_0x1da974);_0x393583(_0x390e2c[_0x2725('0x16')](0x1f4,_0x30952b[_0x2725('0x18')]));});});};exports[_0x2725('0x23')]=function(_0x486088){return new Promise(function(_0x44b932,_0x46b8bc){return db[_0x2725('0x1d')]['find']({'where':_0x486088[_0x2725('0x20')]?_0x486088[_0x2725('0x20')]['where']||null:null})[_0x2725('0x22')](function(_0x56c2dc){if(_0x56c2dc){return _0x56c2dc[_0x2725('0x24')](_0x486088['body'][_0x2725('0x25')],_[_0x2725('0x26')](_0x486088[_0x2725('0x1f')],[_0x2725('0x25'),'id'])||{});}})[_0x2725('0x27')](function(_0x3dc4c8){logger[_0x2725('0x19')](_0x2725('0x28'),_0x486088);logger[_0x2725('0x13')](_0x2725('0x28'),_0x486088,JSON[_0x2725('0x15')](_0x3dc4c8));_0x44b932(_0x3dc4c8);})['catch'](function(_0x3044a5){logger[_0x2725('0x16')]('AddTags',_0x3044a5[_0x2725('0x18')],_0x486088);_0x46b8bc(_this['error'](0x1f4,_0x3044a5[_0x2725('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 0da3e5f..d686868 100644 --- a/server/api/faxInteraction/faxInteraction.socket.js +++ b/server/api/faxInteraction/faxInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0bf=['removeListener','register','length','faxInteraction:','save','remove','update'];(function(_0xa78f27,_0x23df51){var _0x5960f1=function(_0x108331){while(--_0x108331){_0xa78f27['push'](_0xa78f27['shift']());}};_0x5960f1(++_0x23df51);}(_0xb0bf,0x18c));var _0xfb0b=function(_0x762cc5,_0x2920a6){_0x762cc5=_0x762cc5-0x0;var _0x2ce222=_0xb0bf[_0x762cc5];return _0x2ce222;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xfb0b('0x0'),_0xfb0b('0x1'),_0xfb0b('0x2')];function createListener(_0x2e7e7f,_0x2e3fa8){return function(_0x5f5cb2){_0x2e3fa8['emit'](_0x2e7e7f,_0x5f5cb2);};}function removeListener(_0x3bcb3b,_0x5dcf21){return function(){FaxInteractionEvents[_0xfb0b('0x3')](_0x3bcb3b,_0x5dcf21);};}exports[_0xfb0b('0x4')]=function(_0x525288){for(var _0x4a6209=0x0,_0x4be95e=events[_0xfb0b('0x5')];_0x4a6209<_0x4be95e;_0x4a6209++){var _0x4d4635=events[_0x4a6209];var _0x25a887=createListener(_0xfb0b('0x6')+_0x4d4635,_0x525288);FaxInteractionEvents['on'](_0x4d4635,_0x25a887);}}; \ No newline at end of file +var _0xa0a6=['faxInteraction:','./faxInteraction.events','save','remove','update','register','length'];(function(_0x1be180,_0xc88943){var _0xd9b586=function(_0x56c1e4){while(--_0x56c1e4){_0x1be180['push'](_0x1be180['shift']());}};_0xd9b586(++_0xc88943);}(_0xa0a6,0x197));var _0x6a0a=function(_0x21f49f,_0x53cda3){_0x21f49f=_0x21f49f-0x0;var _0x7cba2a=_0xa0a6[_0x21f49f];return _0x7cba2a;};'use strict';var FaxInteractionEvents=require(_0x6a0a('0x0'));var events=[_0x6a0a('0x1'),_0x6a0a('0x2'),_0x6a0a('0x3')];function createListener(_0x7e7c37,_0x3a18a6){return function(_0x2bd97e){_0x3a18a6['emit'](_0x7e7c37,_0x2bd97e);};}function removeListener(_0x3ec803,_0x25db68){return function(){FaxInteractionEvents['removeListener'](_0x3ec803,_0x25db68);};}exports[_0x6a0a('0x4')]=function(_0xeee2b1){for(var _0x1f500a=0x0,_0x28dc88=events[_0x6a0a('0x5')];_0x1f500a<_0x28dc88;_0x1f500a++){var _0x562753=events[_0x1f500a];var _0x222391=createListener(_0x6a0a('0x6')+_0x562753,_0xeee2b1);FaxInteractionEvents['on'](_0x562753,_0x222391);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index b140f01..2e34cf7 100644 --- a/server/api/faxInteraction/index.js +++ b/server/api/faxInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7c4=['addMessage','tracked','fax','/:id','faxinteraction:update','update','delete','faxinteraction:destroy','/:id/tags','removeTags','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','/:id/download','create','post'];(function(_0x2590be,_0x20f2e3){var _0x15aa28=function(_0x4c486c){while(--_0x4c486c){_0x2590be['push'](_0x2590be['shift']());}};_0x15aa28(++_0x20f2e3);}(_0xd7c4,0x1ae));var _0x4d7c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd7c4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4d7c('0x0'));var util=require(_0x4d7c('0x1'));var path=require(_0x4d7c('0x2'));var timeout=require('connect-timeout');var express=require(_0x4d7c('0x3'));var router=express[_0x4d7c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4d7c('0x5'));var config=require(_0x4d7c('0x6'));var controller=require(_0x4d7c('0x7'));router[_0x4d7c('0x8')]('/',auth[_0x4d7c('0x9')](),controller['index']);router[_0x4d7c('0x8')](_0x4d7c('0xa'),auth[_0x4d7c('0x9')](),controller[_0x4d7c('0xb')]);router[_0x4d7c('0x8')]('/:id',auth[_0x4d7c('0x9')](),controller[_0x4d7c('0xc')]);router[_0x4d7c('0x8')](_0x4d7c('0xd'),auth['isAuthenticated'](),controller[_0x4d7c('0xe')]);router['get'](_0x4d7c('0xf'),auth[_0x4d7c('0x9')](),controller['download']);router['post']('/',auth[_0x4d7c('0x9')](),controller[_0x4d7c('0x10')]);router[_0x4d7c('0x11')](_0x4d7c('0xd'),auth[_0x4d7c('0x9')](),controller[_0x4d7c('0x12')]);router[_0x4d7c('0x11')]('/:id/tags',auth[_0x4d7c('0x9')](),interaction[_0x4d7c('0x13')](_0x4d7c('0x14'),'faxinteraction:addtags'),controller['addTags']);router['put'](_0x4d7c('0x15'),auth[_0x4d7c('0x9')](),interaction[_0x4d7c('0x13')](_0x4d7c('0x14'),_0x4d7c('0x16')),controller[_0x4d7c('0x17')]);router[_0x4d7c('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0x4d7c('0x13')](_0x4d7c('0x14'),_0x4d7c('0x19')),controller['destroy']);router['delete'](_0x4d7c('0x1a'),auth[_0x4d7c('0x9')](),controller[_0x4d7c('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x89b2=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','download','create','post','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','/:id','faxinteraction:update','update','faxinteraction:destroy','delete','removeTags','exports'];(function(_0x290fba,_0x4eda75){var _0xefeca1=function(_0x1eed15){while(--_0x1eed15){_0x290fba['push'](_0x290fba['shift']());}};_0xefeca1(++_0x4eda75);}(_0x89b2,0xc6));var _0x289b=function(_0xfdf7a4,_0x37da46){_0xfdf7a4=_0xfdf7a4-0x0;var _0x59ec89=_0x89b2[_0xfdf7a4];return _0x59ec89;};'use strict';var multer=require(_0x289b('0x0'));var util=require(_0x289b('0x1'));var path=require(_0x289b('0x2'));var timeout=require(_0x289b('0x3'));var express=require(_0x289b('0x4'));var router=express[_0x289b('0x5')]();var auth=require(_0x289b('0x6'));var interaction=require(_0x289b('0x7'));var config=require(_0x289b('0x8'));var controller=require(_0x289b('0x9'));router[_0x289b('0xa')]('/',auth[_0x289b('0xb')](),controller['index']);router[_0x289b('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x289b('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x289b('0xd')]);router[_0x289b('0xa')](_0x289b('0xe'),auth[_0x289b('0xb')](),controller[_0x289b('0xf')]);router['get'](_0x289b('0x10'),auth['isAuthenticated'](),controller[_0x289b('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x289b('0x12')]);router[_0x289b('0x13')]('/:id/messages',auth[_0x289b('0xb')](),controller['addMessage']);router[_0x289b('0x13')](_0x289b('0x14'),auth[_0x289b('0xb')](),interaction[_0x289b('0x15')](_0x289b('0x16'),_0x289b('0x17')),controller[_0x289b('0x18')]);router[_0x289b('0x19')](_0x289b('0x1a'),auth[_0x289b('0xb')](),interaction[_0x289b('0x15')](_0x289b('0x16'),_0x289b('0x1b')),controller[_0x289b('0x1c')]);router['delete'](_0x289b('0x1a'),auth[_0x289b('0xb')](),interaction[_0x289b('0x15')](_0x289b('0x16'),_0x289b('0x1d')),controller['destroy']);router[_0x289b('0x1e')](_0x289b('0x14'),auth['isAuthenticated'](),controller[_0x289b('0x1f')]);module[_0x289b('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index ef4223a..48525ba 100644 --- a/server/api/faxMessage/faxMessage.attributes.js +++ b/server/api/faxMessage/faxMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa744=['BOOLEAN','ENUM','DATE','sequelize','medium'];(function(_0x558097,_0x5a6cc2){var _0xe80464=function(_0x46db4f){while(--_0x46db4f){_0x558097['push'](_0x558097['shift']());}};_0xe80464(++_0x5a6cc2);}(_0xa744,0x1a7));var _0x4a74=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa744[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x4a74('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x4a74('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x4a74('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4a74('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x4a74('0x4')]}}; \ No newline at end of file +var _0xdca6=['BOOLEAN','ENUM','out','DATE','sequelize','TEXT','medium'];(function(_0x4bbf23,_0x2670ee){var _0x11d4c4=function(_0x4c7493){while(--_0x4c7493){_0x4bbf23['push'](_0x4bbf23['shift']());}};_0x11d4c4(++_0x2670ee);}(_0xdca6,0x170));var _0x6dca=function(_0x2129f6,_0x168269){_0x2129f6=_0x2129f6-0x0;var _0x256ef7=_0xdca6[_0x2129f6];return _0x256ef7;};'use strict';var Sequelize=require(_0x6dca('0x0'));module['exports']={'body':{'type':Sequelize[_0x6dca('0x1')](_0x6dca('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6dca('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6dca('0x4')]('in','out'),'defaultValue':_0x6dca('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x6dca('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x6dca('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 0b0a7ef..688cf76 100644 --- a/server/api/faxMessage/faxMessage.controller.js +++ b/server/api/faxMessage/faxMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe953=['SIP/%s','channel','event','EventManager','acceptmessage','fax-interactions','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectmessage','ContactId','findOne','AttachmentId','FaxAccountId','join','root','attachments','Attachment','download','basename','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','FaxMessage','rawAttributes','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','fields','find','body','params','describe','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','FaxInteraction','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','acceptMessage','manual','interface'];(function(_0x1f930a,_0x17dcee){var _0x369859=function(_0xdfb85){while(--_0xdfb85){_0x1f930a['push'](_0x1f930a['shift']());}};_0x369859(++_0x17dcee);}(_0xe953,0x122));var _0x3e95=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xe953[_0x5c2e3e];return _0x53f64a;};'use strict';var pdf=require(_0x3e95('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3e95('0x1'));var zipdir=require(_0x3e95('0x2'));var jsonpatch=require(_0x3e95('0x3'));var rp=require(_0x3e95('0x4'));var moment=require(_0x3e95('0x5'));var BPromise=require(_0x3e95('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3e95('0x7'));var csv=require(_0x3e95('0x8'));var ejs=require(_0x3e95('0x9'));var fs=require('fs');var _=require(_0x3e95('0xa'));var squel=require(_0x3e95('0xb'));var crypto=require(_0x3e95('0xc'));var jsforce=require(_0x3e95('0xd'));var deskjs=require(_0x3e95('0xe'));var toCsv=require(_0x3e95('0x8'));var querystring=require(_0x3e95('0xf'));var Papa=require(_0x3e95('0x10'));var Redis=require(_0x3e95('0x11'));var authService=require(_0x3e95('0x12'));var qs=require(_0x3e95('0x13'));var hardwareService=require(_0x3e95('0x14'));var logger=require(_0x3e95('0x15'))(_0x3e95('0x16'));var utils=require(_0x3e95('0x17'));var config=require(_0x3e95('0x18'));var db=require(_0x3e95('0x19'))['db'];config['redis']=_['defaults'](config[_0x3e95('0x1a')],{'host':_0x3e95('0x1b'),'port':0x18eb});var socket=require(_0x3e95('0x1c'))(new Redis(config[_0x3e95('0x1a')]));require(_0x3e95('0x1d'))['register'](socket);var jayson=require(_0x3e95('0x1e'));var client=jayson[_0x3e95('0x1f')][_0x3e95('0x20')]({'port':0x232c});var client9002=jayson[_0x3e95('0x1f')][_0x3e95('0x20')]({'port':0x232a});function checkPasswordPattern(_0x997f1,_0x2e6dce,_0x161a56){if(_0x161a56){var _0x2659d0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2659d0[_0x3e95('0x21')](_0x2e6dce)){return _0x997f1;}else{throw new Error(_0x3e95('0x22'));}}else{return _0x997f1;}}function respondWithRpcPromise(_0x128311,_0x4a2776,_0x30bfa1,_0x2892d8){return new BPromise(function(_0x1bea79,_0x38e127){var _0x1049e5=_0x2892d8||client;return _0x1049e5['request'](_0x128311,_0x30bfa1)['then'](function(_0x52e6ab){logger[_0x3e95('0x23')](_0x3e95('0x24'),_0x4a2776,_0x3e95('0x25'));logger[_0x3e95('0x26')](_0x3e95('0x27'),_0x4a2776,_0x3e95('0x25'),JSON[_0x3e95('0x28')](_0x52e6ab));if(_0x52e6ab[_0x3e95('0x29')]){if(_0x52e6ab[_0x3e95('0x29')][_0x3e95('0x2a')]===0x1f4){logger['error'](_0x3e95('0x24'),_0x4a2776,_0x52e6ab[_0x3e95('0x29')]['message']);return _0x38e127(_0x52e6ab[_0x3e95('0x29')][_0x3e95('0x2b')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x4a2776,_0x52e6ab[_0x3e95('0x29')][_0x3e95('0x2b')]);return _0x1bea79(_0x52e6ab[_0x3e95('0x29')]['message']);}else{logger[_0x3e95('0x23')]('FaxMessage,\x20%s,\x20%s',_0x4a2776,'request\x20sent');_0x1bea79(_0x52e6ab[_0x3e95('0x2c')]['message']);}})[_0x3e95('0x2d')](function(_0x4aa941){logger['error']('FaxMessage,\x20%s,\x20%s',_0x4a2776,_0x4aa941);_0x38e127(_0x4aa941);});});}function respondWithStatusCode(_0x35e27b,_0x3afed4){_0x3afed4=_0x3afed4||0xcc;return function(_0x1935e6){if(_0x1935e6){return _0x35e27b[_0x3e95('0x2e')](_0x3afed4);}return _0x35e27b[_0x3e95('0x2f')](_0x3afed4)['end']();};}function respondWithResult(_0x4b6268,_0x5f0a5b){_0x5f0a5b=_0x5f0a5b||0xc8;return function(_0x30a856){if(_0x30a856){return _0x4b6268[_0x3e95('0x2f')](_0x5f0a5b)[_0x3e95('0x30')](_0x30a856);}};}function respondWithFilteredResult(_0xae8229,_0x19f8e7){return function(_0x4efb0d){if(_0x4efb0d){var _0x2a000a=_0x4efb0d[_0x3e95('0x31')],_0x57d147=_0x19f8e7[_0x3e95('0x32')],_0x138d0c=_0x19f8e7[_0x3e95('0x32')]+_0x19f8e7[_0x3e95('0x33')],_0x568e45;if(_0x138d0c>=_0x2a000a){_0x138d0c=_0x2a000a;_0x568e45=0xc8;}else{_0x568e45=0xce;}_0xae8229[_0x3e95('0x2f')](_0x568e45);return _0xae8229['set'](_0x3e95('0x34'),_0x57d147+'-'+_0x138d0c+'/'+_0x2a000a)['json'](_0x4efb0d);}return null;};}function patchUpdates(_0x1517ff){return function(_0x225ad5){try{jsonpatch[_0x3e95('0x35')](_0x225ad5,_0x1517ff,!![]);}catch(_0x14c0b0){return BPromise[_0x3e95('0x36')](_0x14c0b0);}return _0x225ad5[_0x3e95('0x37')]();};}function saveUpdates(_0x46df93,_0x5a576f){return function(_0x133cf0){if(_0x133cf0){return _0x133cf0[_0x3e95('0x38')](_0x46df93)['then'](function(_0x111de5){return _0x111de5;});}return null;};}function removeEntity(_0x20b912,_0x44a508){return function(_0x15e6d7){if(_0x15e6d7){return _0x15e6d7[_0x3e95('0x39')]()[_0x3e95('0x3a')](function(){_0x20b912['status'](0xcc)[_0x3e95('0x3b')]();});}};}function handleEntityNotFound(_0x3fd990,_0xd57fbe){return function(_0x29bdad){if(!_0x29bdad){_0x3fd990[_0x3e95('0x2e')](0x194);}return _0x29bdad;};}function handleError(_0x1f0446,_0x4d5768){_0x4d5768=_0x4d5768||0x1f4;return function(_0x701760){logger[_0x3e95('0x29')](_0x701760[_0x3e95('0x3c')]);if(_0x701760[_0x3e95('0x3d')]){delete _0x701760[_0x3e95('0x3d')];}_0x1f0446[_0x3e95('0x2f')](_0x4d5768)[_0x3e95('0x3e')](_0x701760);};}exports['index']=function(_0x40fd64,_0x567858){var _0x3d4522={},_0x38c7cd={},_0x29ede1={'count':0x0,'rows':[]};var _0x4800ff=db[_0x3e95('0x3f')][_0x3e95('0x40')];_0x38c7cd['model']=_[_0x3e95('0x41')](_0x4800ff);_0x38c7cd[_0x3e95('0x42')]=_[_0x3e95('0x41')](_0x40fd64['query']);_0x38c7cd[_0x3e95('0x43')]=_[_0x3e95('0x44')](_0x38c7cd[_0x3e95('0x45')],_0x38c7cd[_0x3e95('0x42')]);_0x3d4522['attributes']=_['intersection'](_0x38c7cd[_0x3e95('0x45')],qs['fields'](_0x40fd64[_0x3e95('0x42')]['fields']));_0x3d4522[_0x3e95('0x46')]=_0x3d4522['attributes'][_0x3e95('0x47')]?_0x3d4522[_0x3e95('0x46')]:_0x38c7cd[_0x3e95('0x45')];if(!_0x40fd64[_0x3e95('0x42')][_0x3e95('0x48')](_0x3e95('0x49'))){_0x3d4522[_0x3e95('0x33')]=qs[_0x3e95('0x33')](_0x40fd64[_0x3e95('0x42')]['limit']);_0x3d4522[_0x3e95('0x32')]=qs[_0x3e95('0x32')](_0x40fd64[_0x3e95('0x42')][_0x3e95('0x32')]);}_0x3d4522[_0x3e95('0x4a')]=qs[_0x3e95('0x4b')](_0x40fd64[_0x3e95('0x42')]['sort']);_0x3d4522[_0x3e95('0x4c')]=qs['filters'](_[_0x3e95('0x4d')](_0x40fd64[_0x3e95('0x42')],_0x38c7cd[_0x3e95('0x43')]));if(_0x40fd64[_0x3e95('0x42')][_0x3e95('0x4e')]){_0x3d4522[_0x3e95('0x4c')]=_[_0x3e95('0x4f')](_0x3d4522[_0x3e95('0x4c')],{'$or':_['map'](_0x4800ff,function(_0x5e379f){if(_0x5e379f[_0x3e95('0x50')][_0x3e95('0x51')]!==_0x3e95('0x52')){var _0x326728={};_0x326728[_0x5e379f[_0x3e95('0x53')]]={'$like':'%'+_0x40fd64[_0x3e95('0x42')][_0x3e95('0x4e')]+'%'};return _0x326728;}})});}_0x3d4522=_[_0x3e95('0x4f')]({},_0x3d4522,_0x40fd64[_0x3e95('0x54')]);var _0xbbf4a1={'where':_0x3d4522[_0x3e95('0x4c')]};return db['FaxMessage']['count'](_0xbbf4a1)[_0x3e95('0x3a')](function(_0xf2e970){_0x29ede1['count']=_0xf2e970;if(_0x40fd64[_0x3e95('0x42')][_0x3e95('0x55')]){_0x3d4522[_0x3e95('0x56')]=[{'all':!![]}];}return db[_0x3e95('0x3f')][_0x3e95('0x57')](_0x3d4522);})['then'](function(_0x581111){_0x29ede1[_0x3e95('0x58')]=_0x581111;return _0x29ede1;})['then'](respondWithFilteredResult(_0x567858,_0x3d4522))[_0x3e95('0x2d')](handleError(_0x567858,null));};exports[_0x3e95('0x59')]=function(_0x3e4f9f,_0x1639d3){var _0x3b3b77={'raw':!![],'where':{'id':_0x3e4f9f['params']['id']}},_0x35c51d={};_0x35c51d[_0x3e95('0x45')]=_['keys'](db[_0x3e95('0x3f')][_0x3e95('0x40')]);_0x35c51d[_0x3e95('0x42')]=_[_0x3e95('0x41')](_0x3e4f9f['query']);_0x35c51d[_0x3e95('0x43')]=_[_0x3e95('0x44')](_0x35c51d[_0x3e95('0x45')],_0x35c51d['query']);_0x3b3b77[_0x3e95('0x46')]=_['intersection'](_0x35c51d[_0x3e95('0x45')],qs[_0x3e95('0x5a')](_0x3e4f9f['query'][_0x3e95('0x5a')]));_0x3b3b77[_0x3e95('0x46')]=_0x3b3b77[_0x3e95('0x46')][_0x3e95('0x47')]?_0x3b3b77['attributes']:_0x35c51d['model'];if(_0x3e4f9f[_0x3e95('0x42')][_0x3e95('0x55')]){_0x3b3b77[_0x3e95('0x56')]=[{'all':!![]}];}_0x3b3b77=_[_0x3e95('0x4f')]({},_0x3b3b77,_0x3e4f9f[_0x3e95('0x54')]);return db['FaxMessage'][_0x3e95('0x5b')](_0x3b3b77)['then'](handleEntityNotFound(_0x1639d3,null))[_0x3e95('0x3a')](respondWithResult(_0x1639d3,null))['catch'](handleError(_0x1639d3,null));};exports[_0x3e95('0x38')]=function(_0x5a7b73,_0x387440){if(_0x5a7b73[_0x3e95('0x5c')]['id']){delete _0x5a7b73['body']['id'];}return db[_0x3e95('0x3f')][_0x3e95('0x5b')]({'where':{'id':_0x5a7b73['params']['id']}})['then'](handleEntityNotFound(_0x387440,null))[_0x3e95('0x3a')](saveUpdates(_0x5a7b73[_0x3e95('0x5c')],null))['then'](respondWithResult(_0x387440,null))[_0x3e95('0x2d')](handleError(_0x387440,null));};exports['destroy']=function(_0x4e65e3,_0x59b0f0){return db[_0x3e95('0x3f')]['find']({'where':{'id':_0x4e65e3[_0x3e95('0x5d')]['id']}})[_0x3e95('0x3a')](handleEntityNotFound(_0x59b0f0,null))[_0x3e95('0x3a')](removeEntity(_0x59b0f0,null))[_0x3e95('0x2d')](handleError(_0x59b0f0,null));};exports[_0x3e95('0x5e')]=function(_0x20bcb5,_0x22eb8c){return db[_0x3e95('0x3f')][_0x3e95('0x5e')]()[_0x3e95('0x3a')](respondWithResult(_0x22eb8c,null))[_0x3e95('0x2d')](handleError(_0x22eb8c,null));};var interaction_log=require(_0x3e95('0x15'))('fax-interactions');exports['accept']=function(_0x41a4fe,_0x330578,_0x16e814){var _0x261844={'channel':_0x3e95('0x5f')};if(_0x41a4fe[_0x3e95('0x5c')]['id']){delete _0x41a4fe['body']['id'];}_0x41a4fe[_0x3e95('0x5c')][_0x3e95('0x60')]=!![];_0x41a4fe[_0x3e95('0x5c')][_0x3e95('0x61')]=moment()[_0x3e95('0x62')](_0x3e95('0x63'));_0x41a4fe[_0x3e95('0x5c')][_0x3e95('0x64')]=_0x41a4fe[_0x3e95('0x5c')][_0x3e95('0x64')]||_0x41a4fe['user']['id'];return db[_0x3e95('0x3f')][_0x3e95('0x5b')]({'where':{'id':_0x41a4fe['params']['id'],'UserId':null},'include':[{'model':db[_0x3e95('0x65')],'as':_0x3e95('0x66')}]})['then'](handleEntityNotFound(_0x330578,null))[_0x3e95('0x3a')](saveUpdates(_0x41a4fe[_0x3e95('0x5c')],null))[_0x3e95('0x3a')](function(_0x53b8f3){if(_0x53b8f3){_0x261844[_0x3e95('0x2b')]=_0x53b8f3[_0x3e95('0x67')]({'plain':!![]});return db[_0x3e95('0x68')]['find']({'where':{'id':_0x53b8f3['FaxInteractionId']}});}return null;})[_0x3e95('0x3a')](handleEntityNotFound(_0x330578,null))[_0x3e95('0x3a')](function(_0x2bf710){if(_0x2bf710){return _0x2bf710['update']({'UserId':_0x41a4fe[_0x3e95('0x5c')]['UserId'],'read1stAt':_[_0x3e95('0x69')](_0x2bf710[_0x3e95('0x6a')])?moment()[_0x3e95('0x62')](_0x3e95('0x63')):undefined});}return null;})['then'](function(_0x1d93e5){if(_0x1d93e5){_0x261844['interaction']=_0x1d93e5[_0x3e95('0x67')]({'plain':!![]});interaction_log[_0x3e95('0x23')](_0x3e95('0x6b'),_0x41a4fe[_0x3e95('0x6c')]['id'],_0x41a4fe[_0x3e95('0x6c')][_0x3e95('0x3d')],_0x41a4fe['user'][_0x3e95('0x6d')],_0x261844[_0x3e95('0x6e')]['id'],_0x41a4fe[_0x3e95('0x5c')]?JSON[_0x3e95('0x28')](_0x41a4fe[_0x3e95('0x5c')]):_0x3e95('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x3e95('0x70'),_0x261844);}return null;})[_0x3e95('0x3a')](function(_0x5eb326){if(_0x5eb326){if(_0x41a4fe[_0x3e95('0x5c')][_0x3e95('0x71')]){_0x261844[_0x3e95('0x2b')][_0x3e95('0x72')]=util[_0x3e95('0x62')](_0x3e95('0x73'),_0x41a4fe['user'][_0x3e95('0x3d')]);_0x261844[_0x3e95('0x2b')][_0x3e95('0x74')]=_0x261844[_0x3e95('0x74')];_0x261844['message'][_0x3e95('0x75')]='accept';return respondWithRpcPromise(_0x3e95('0x76'),_0x3e95('0x76'),{'event':_0x3e95('0x77'),'message':_0x261844['message']},client9002)[_0x3e95('0x3a')](function(){return _0x261844;});}return _0x261844;}return null;})['then'](respondWithResult(_0x330578,null))[_0x3e95('0x2d')](handleError(_0x330578,null));};var interaction_log=require('../../config/logger')(_0x3e95('0x78'));exports['reject']=function(_0x47eb3b,_0x20bb23,_0x4fdd76){var _0x59f20c={'agent':{},'channel':_0x3e95('0x5f')};if(_0x47eb3b[_0x3e95('0x5c')]['id']){delete _0x47eb3b[_0x3e95('0x5c')]['id'];}_0x47eb3b[_0x3e95('0x5c')][_0x3e95('0x64')]=_0x47eb3b[_0x3e95('0x5c')]['UserId']||_0x47eb3b[_0x3e95('0x6c')]['id'];_0x59f20c[_0x3e95('0x79')]['id']=_0x47eb3b['body'][_0x3e95('0x64')];return db[_0x3e95('0x3f')]['find']({'where':{'id':_0x47eb3b[_0x3e95('0x5d')]['id'],'UserId':null}})[_0x3e95('0x3a')](handleEntityNotFound(_0x20bb23,null))[_0x3e95('0x3a')](function(_0x360722){if(_0x360722){_0x59f20c[_0x3e95('0x2b')]=_0x360722[_0x3e95('0x67')]({'plain':!![]});return db[_0x3e95('0x68')][_0x3e95('0x5b')]({'where':{'id':_0x360722[_0x3e95('0x7a')]}});}return null;})[_0x3e95('0x3a')](handleEntityNotFound(_0x20bb23,null))[_0x3e95('0x3a')](function(_0x5c6f41){if(_0x5c6f41){_0x59f20c[_0x3e95('0x6e')]=_0x5c6f41[_0x3e95('0x67')]({'plain':!![]});interaction_log['info'](_0x3e95('0x7b'),_0x47eb3b['user']['id'],_0x47eb3b[_0x3e95('0x6c')][_0x3e95('0x3d')],_0x47eb3b[_0x3e95('0x6c')][_0x3e95('0x6d')],_0x59f20c[_0x3e95('0x6e')]['id'],_0x47eb3b['body']?JSON[_0x3e95('0x28')](_0x47eb3b['body']):_0x3e95('0x6f'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x59f20c);}return null;})['then'](function(_0x584af5){if(_0x584af5){_0x584af5[_0x3e95('0x2b')]['interface']=util['format']('SIP/%s',_0x47eb3b[_0x3e95('0x6c')][_0x3e95('0x3d')]);_0x584af5[_0x3e95('0x2b')][_0x3e95('0x74')]=_0x59f20c[_0x3e95('0x74')];_0x584af5[_0x3e95('0x2b')]['event']=_0x3e95('0x36');respondWithRpcPromise(_0x3e95('0x76'),'EventManager',{'event':_0x3e95('0x7c'),'message':_0x584af5[_0x3e95('0x2b')]},client9002);return _0x59f20c;}return null;})[_0x3e95('0x3a')](respondWithResult(_0x20bb23,null))[_0x3e95('0x2d')](handleError(_0x20bb23,null));};exports['create']=function(_0x4d8ead,_0x3d846d){var _0x322b05;return db[_0x3e95('0x3f')]['create'](_0x4d8ead[_0x3e95('0x5c')],{})[_0x3e95('0x3a')](function(_0x2e6042){_0x322b05=_0x2e6042;return db[_0x3e95('0x65')]['findOne']({'where':{'id':_0x322b05[_0x3e95('0x7d')]}});})['then'](function(_0x2948d1){if(_['isNil'](_0x2948d1)){return;}else{_0x322b05['fax']=_0x2948d1[_0x3e95('0x5f')];return db['Attachment'][_0x3e95('0x7e')]({'where':{'id':_0x322b05[_0x3e95('0x7f')]}});}})[_0x3e95('0x3a')](function(_0x445a0f){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x3e95('0x69')](_0x4d8ead[_0x3e95('0x5c')])?undefined:_0x4d8ead[_0x3e95('0x5c')][_0x3e95('0x80')],'path':_[_0x3e95('0x69')](_0x445a0f)?undefined:util[_0x3e95('0x62')]('/var/opt/motion2/server/files/attachments/%s',_0x445a0f['basename']),'fax':_['isNil'](_0x322b05[_0x3e95('0x5f')])?undefined:_0x322b05[_0x3e95('0x5f')],'AttachmentId':_0x322b05[_0x3e95('0x7f')]},client9002);})[_0x3e95('0x3a')](respondWithResult(_0x3d846d,0xc9))[_0x3e95('0x2d')](handleError(_0x3d846d,null));};exports['download']=function(_0x9cd1a8,_0x39d3e){var _0x535db4=path[_0x3e95('0x81')](config[_0x3e95('0x82')],'server','files',_0x3e95('0x83'));return db[_0x3e95('0x3f')][_0x3e95('0x5b')]({'where':{'id':_0x9cd1a8[_0x3e95('0x5d')]['id']},'include':[{'model':db[_0x3e95('0x84')],'as':_0x3e95('0x84')}]})[_0x3e95('0x3a')](handleEntityNotFound(_0x39d3e,null))[_0x3e95('0x3a')](function(_0x3527ca){if(_0x3527ca){return _0x39d3e[_0x3e95('0x85')](path[_0x3e95('0x81')](_0x535db4,_0x3527ca['Attachment'][_0x3e95('0x86')]));}})[_0x3e95('0x2d')](handleError(_0x39d3e,null));}; \ No newline at end of file +var _0x3391=['type','key','VIRTUAL','field','options','includeAll','include','findAll','show','fields','body','params','describe','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','find','CmContact','Contact','get','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','EventManager','acceptmessage','fax-interactions','agent','FaxInteraction','FaxInteractionId','RejectMessage','rejectMessage','SIP/%s','rejectmessage','create','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','download','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','FaxMessage','rawAttributes','model','keys','query','intersection','attributes','length','nolimit','order','sort','pick','filters','filter','where','merge','map'];(function(_0x56bcf9,_0x2e4ffb){var _0xcbabe2=function(_0x110cb7){while(--_0x110cb7){_0x56bcf9['push'](_0x56bcf9['shift']());}};_0xcbabe2(++_0x2e4ffb);}(_0x3391,0x1d8));var _0x1339=function(_0x4c095a,_0x24e0ad){_0x4c095a=_0x4c095a-0x0;var _0x1b2af9=_0x3391[_0x4c095a];return _0x1b2af9;};'use strict';var pdf=require(_0x1339('0x0'));var emlformat=require(_0x1339('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1339('0x2'));var rp=require(_0x1339('0x3'));var moment=require(_0x1339('0x4'));var BPromise=require(_0x1339('0x5'));var Mustache=require(_0x1339('0x6'));var util=require(_0x1339('0x7'));var path=require('path');var sox=require(_0x1339('0x8'));var csv=require(_0x1339('0x9'));var ejs=require(_0x1339('0xa'));var fs=require('fs');var _=require(_0x1339('0xb'));var squel=require(_0x1339('0xc'));var crypto=require(_0x1339('0xd'));var jsforce=require(_0x1339('0xe'));var deskjs=require(_0x1339('0xf'));var toCsv=require(_0x1339('0x9'));var querystring=require(_0x1339('0x10'));var Papa=require(_0x1339('0x11'));var Redis=require(_0x1339('0x12'));var authService=require(_0x1339('0x13'));var qs=require(_0x1339('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1339('0x15'))(_0x1339('0x16'));var utils=require(_0x1339('0x17'));var config=require(_0x1339('0x18'));var db=require(_0x1339('0x19'))['db'];config[_0x1339('0x1a')]=_['defaults'](config[_0x1339('0x1a')],{'host':_0x1339('0x1b'),'port':0x18eb});var socket=require(_0x1339('0x1c'))(new Redis(config[_0x1339('0x1a')]));require(_0x1339('0x1d'))[_0x1339('0x1e')](socket);var jayson=require(_0x1339('0x1f'));var client=jayson['client'][_0x1339('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x347f6b,_0xc674d3,_0x2adf18){if(_0x2adf18){var _0x133aab=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x133aab[_0x1339('0x21')](_0xc674d3)){return _0x347f6b;}else{throw new Error(_0x1339('0x22'));}}else{return _0x347f6b;}}function respondWithRpcPromise(_0x3a8817,_0x31a891,_0x5ec929,_0x390590){return new BPromise(function(_0x3abc9d,_0x699ded){var _0x129fd6=_0x390590||client;return _0x129fd6[_0x1339('0x23')](_0x3a8817,_0x5ec929)[_0x1339('0x24')](function(_0x26af02){logger[_0x1339('0x25')](_0x1339('0x26'),_0x31a891,'request\x20sent');logger[_0x1339('0x27')](_0x1339('0x28'),_0x31a891,_0x1339('0x29'),JSON['stringify'](_0x26af02));if(_0x26af02[_0x1339('0x2a')]){if(_0x26af02[_0x1339('0x2a')]['code']===0x1f4){logger[_0x1339('0x2a')](_0x1339('0x26'),_0x31a891,_0x26af02[_0x1339('0x2a')][_0x1339('0x2b')]);return _0x699ded(_0x26af02[_0x1339('0x2a')][_0x1339('0x2b')]);}logger[_0x1339('0x2a')](_0x1339('0x26'),_0x31a891,_0x26af02['error'][_0x1339('0x2b')]);return _0x3abc9d(_0x26af02[_0x1339('0x2a')][_0x1339('0x2b')]);}else{logger[_0x1339('0x25')]('FaxMessage,\x20%s,\x20%s',_0x31a891,_0x1339('0x29'));_0x3abc9d(_0x26af02[_0x1339('0x2c')][_0x1339('0x2b')]);}})[_0x1339('0x2d')](function(_0x52e906){logger[_0x1339('0x2a')]('FaxMessage,\x20%s,\x20%s',_0x31a891,_0x52e906);_0x699ded(_0x52e906);});});}function respondWithStatusCode(_0xc9b57a,_0x1e8ba3){_0x1e8ba3=_0x1e8ba3||0xcc;return function(_0x3e75f4){if(_0x3e75f4){return _0xc9b57a[_0x1339('0x2e')](_0x1e8ba3);}return _0xc9b57a[_0x1339('0x2f')](_0x1e8ba3)[_0x1339('0x30')]();};}function respondWithResult(_0x1fee53,_0x30d062){_0x30d062=_0x30d062||0xc8;return function(_0x231cc9){if(_0x231cc9){return _0x1fee53[_0x1339('0x2f')](_0x30d062)[_0x1339('0x31')](_0x231cc9);}};}function respondWithFilteredResult(_0x35c7b4,_0x36b01b){return function(_0x265f3a){if(_0x265f3a){var _0x1b5244=_0x265f3a[_0x1339('0x32')],_0x21a5c5=_0x36b01b[_0x1339('0x33')],_0x4827fb=_0x36b01b[_0x1339('0x33')]+_0x36b01b[_0x1339('0x34')],_0x33530b;if(_0x4827fb>=_0x1b5244){_0x4827fb=_0x1b5244;_0x33530b=0xc8;}else{_0x33530b=0xce;}_0x35c7b4[_0x1339('0x2f')](_0x33530b);return _0x35c7b4[_0x1339('0x35')](_0x1339('0x36'),_0x21a5c5+'-'+_0x4827fb+'/'+_0x1b5244)[_0x1339('0x31')](_0x265f3a);}return null;};}function patchUpdates(_0x3dae38){return function(_0x148c33){try{jsonpatch[_0x1339('0x37')](_0x148c33,_0x3dae38,!![]);}catch(_0x2aa26f){return BPromise[_0x1339('0x38')](_0x2aa26f);}return _0x148c33[_0x1339('0x39')]();};}function saveUpdates(_0x5bedb2,_0xc0af8c){return function(_0x36b51a){if(_0x36b51a){return _0x36b51a[_0x1339('0x3a')](_0x5bedb2)[_0x1339('0x24')](function(_0x1abb6d){return _0x1abb6d;});}return null;};}function removeEntity(_0x42861d,_0x591439){return function(_0x5aadbb){if(_0x5aadbb){return _0x5aadbb[_0x1339('0x3b')]()[_0x1339('0x24')](function(){_0x42861d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x495ee0,_0x18270d){return function(_0x220b8b){if(!_0x220b8b){_0x495ee0['sendStatus'](0x194);}return _0x220b8b;};}function handleError(_0x4c18a1,_0x292413){_0x292413=_0x292413||0x1f4;return function(_0x4f20e6){logger['error'](_0x4f20e6[_0x1339('0x3c')]);if(_0x4f20e6[_0x1339('0x3d')]){delete _0x4f20e6[_0x1339('0x3d')];}_0x4c18a1[_0x1339('0x2f')](_0x292413)['send'](_0x4f20e6);};}exports[_0x1339('0x3e')]=function(_0x344c6d,_0x5749d4){var _0x124e28={},_0x42d024={},_0x3bc8b3={'count':0x0,'rows':[]};var _0x12c414=db[_0x1339('0x3f')][_0x1339('0x40')];_0x42d024[_0x1339('0x41')]=_[_0x1339('0x42')](_0x12c414);_0x42d024['query']=_['keys'](_0x344c6d[_0x1339('0x43')]);_0x42d024['filters']=_['intersection'](_0x42d024[_0x1339('0x41')],_0x42d024[_0x1339('0x43')]);_0x124e28['attributes']=_[_0x1339('0x44')](_0x42d024[_0x1339('0x41')],qs['fields'](_0x344c6d[_0x1339('0x43')]['fields']));_0x124e28['attributes']=_0x124e28[_0x1339('0x45')][_0x1339('0x46')]?_0x124e28['attributes']:_0x42d024[_0x1339('0x41')];if(!_0x344c6d[_0x1339('0x43')]['hasOwnProperty'](_0x1339('0x47'))){_0x124e28[_0x1339('0x34')]=qs['limit'](_0x344c6d[_0x1339('0x43')][_0x1339('0x34')]);_0x124e28['offset']=qs['offset'](_0x344c6d[_0x1339('0x43')][_0x1339('0x33')]);}_0x124e28[_0x1339('0x48')]=qs[_0x1339('0x49')](_0x344c6d['query']['sort']);_0x124e28['where']=qs['filters'](_[_0x1339('0x4a')](_0x344c6d[_0x1339('0x43')],_0x42d024[_0x1339('0x4b')]));if(_0x344c6d['query'][_0x1339('0x4c')]){_0x124e28[_0x1339('0x4d')]=_[_0x1339('0x4e')](_0x124e28[_0x1339('0x4d')],{'$or':_[_0x1339('0x4f')](_0x12c414,function(_0x18a726){if(_0x18a726[_0x1339('0x50')][_0x1339('0x51')]!==_0x1339('0x52')){var _0x4f10d9={};_0x4f10d9[_0x18a726[_0x1339('0x53')]]={'$like':'%'+_0x344c6d['query']['filter']+'%'};return _0x4f10d9;}})});}_0x124e28=_[_0x1339('0x4e')]({},_0x124e28,_0x344c6d[_0x1339('0x54')]);var _0x823339={'where':_0x124e28[_0x1339('0x4d')]};return db[_0x1339('0x3f')]['count'](_0x823339)[_0x1339('0x24')](function(_0x167319){_0x3bc8b3[_0x1339('0x32')]=_0x167319;if(_0x344c6d[_0x1339('0x43')][_0x1339('0x55')]){_0x124e28[_0x1339('0x56')]=[{'all':!![]}];}return db['FaxMessage'][_0x1339('0x57')](_0x124e28);})[_0x1339('0x24')](function(_0x5c3d3d){_0x3bc8b3['rows']=_0x5c3d3d;return _0x3bc8b3;})['then'](respondWithFilteredResult(_0x5749d4,_0x124e28))[_0x1339('0x2d')](handleError(_0x5749d4,null));};exports[_0x1339('0x58')]=function(_0x3a5703,_0x13fbaa){var _0x46256a={'raw':!![],'where':{'id':_0x3a5703['params']['id']}},_0x1bb5b6={};_0x1bb5b6[_0x1339('0x41')]=_['keys'](db['FaxMessage'][_0x1339('0x40')]);_0x1bb5b6[_0x1339('0x43')]=_[_0x1339('0x42')](_0x3a5703[_0x1339('0x43')]);_0x1bb5b6[_0x1339('0x4b')]=_[_0x1339('0x44')](_0x1bb5b6[_0x1339('0x41')],_0x1bb5b6[_0x1339('0x43')]);_0x46256a[_0x1339('0x45')]=_['intersection'](_0x1bb5b6['model'],qs[_0x1339('0x59')](_0x3a5703['query'][_0x1339('0x59')]));_0x46256a[_0x1339('0x45')]=_0x46256a[_0x1339('0x45')][_0x1339('0x46')]?_0x46256a[_0x1339('0x45')]:_0x1bb5b6['model'];if(_0x3a5703['query'][_0x1339('0x55')]){_0x46256a['include']=[{'all':!![]}];}_0x46256a=_[_0x1339('0x4e')]({},_0x46256a,_0x3a5703[_0x1339('0x54')]);return db[_0x1339('0x3f')]['find'](_0x46256a)[_0x1339('0x24')](handleEntityNotFound(_0x13fbaa,null))[_0x1339('0x24')](respondWithResult(_0x13fbaa,null))[_0x1339('0x2d')](handleError(_0x13fbaa,null));};exports['update']=function(_0x27a7e0,_0x416f81){if(_0x27a7e0[_0x1339('0x5a')]['id']){delete _0x27a7e0[_0x1339('0x5a')]['id'];}return db[_0x1339('0x3f')]['find']({'where':{'id':_0x27a7e0[_0x1339('0x5b')]['id']}})[_0x1339('0x24')](handleEntityNotFound(_0x416f81,null))[_0x1339('0x24')](saveUpdates(_0x27a7e0[_0x1339('0x5a')],null))[_0x1339('0x24')](respondWithResult(_0x416f81,null))[_0x1339('0x2d')](handleError(_0x416f81,null));};exports['destroy']=function(_0x48c1f7,_0x567c98){return db[_0x1339('0x3f')]['find']({'where':{'id':_0x48c1f7[_0x1339('0x5b')]['id']}})[_0x1339('0x24')](handleEntityNotFound(_0x567c98,null))[_0x1339('0x24')](removeEntity(_0x567c98,null))['catch'](handleError(_0x567c98,null));};exports[_0x1339('0x5c')]=function(_0x2c5bdd,_0xa3cf53){return db['FaxMessage'][_0x1339('0x5c')]()[_0x1339('0x24')](respondWithResult(_0xa3cf53,null))[_0x1339('0x2d')](handleError(_0xa3cf53,null));};var interaction_log=require(_0x1339('0x15'))('fax-interactions');exports[_0x1339('0x5d')]=function(_0x52326c,_0x30f947,_0x3256fc){var _0x576b2e={'channel':_0x1339('0x5e')};if(_0x52326c[_0x1339('0x5a')]['id']){delete _0x52326c[_0x1339('0x5a')]['id'];}_0x52326c[_0x1339('0x5a')][_0x1339('0x5f')]=!![];_0x52326c[_0x1339('0x5a')]['readAt']=moment()[_0x1339('0x60')](_0x1339('0x61'));_0x52326c[_0x1339('0x5a')][_0x1339('0x62')]=_0x52326c[_0x1339('0x5a')][_0x1339('0x62')]||_0x52326c[_0x1339('0x63')]['id'];return db[_0x1339('0x3f')][_0x1339('0x64')]({'where':{'id':_0x52326c['params']['id'],'UserId':null},'include':[{'model':db[_0x1339('0x65')],'as':_0x1339('0x66')}]})[_0x1339('0x24')](handleEntityNotFound(_0x30f947,null))[_0x1339('0x24')](saveUpdates(_0x52326c[_0x1339('0x5a')],null))[_0x1339('0x24')](function(_0x20cd57){if(_0x20cd57){_0x576b2e[_0x1339('0x2b')]=_0x20cd57[_0x1339('0x67')]({'plain':!![]});return db['FaxInteraction'][_0x1339('0x64')]({'where':{'id':_0x20cd57['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x30f947,null))[_0x1339('0x24')](function(_0xcf35a6){if(_0xcf35a6){return _0xcf35a6['update']({'UserId':_0x52326c[_0x1339('0x5a')]['UserId'],'read1stAt':_[_0x1339('0x68')](_0xcf35a6['read1stAt'])?moment()[_0x1339('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x1339('0x24')](function(_0xccb6e7){if(_0xccb6e7){_0x576b2e[_0x1339('0x69')]=_0xccb6e7[_0x1339('0x67')]({'plain':!![]});interaction_log[_0x1339('0x25')](_0x1339('0x6a'),_0x52326c[_0x1339('0x63')]['id'],_0x52326c[_0x1339('0x63')][_0x1339('0x3d')],_0x52326c[_0x1339('0x63')]['role'],_0x576b2e['interaction']['id'],_0x52326c[_0x1339('0x5a')]?JSON[_0x1339('0x6b')](_0x52326c[_0x1339('0x5a')]):_0x1339('0x6c'));return respondWithRpcPromise(_0x1339('0x6d'),_0x1339('0x6e'),_0x576b2e);}return null;})['then'](function(_0x56b40b){if(_0x56b40b){if(_0x52326c[_0x1339('0x5a')]['manual']){_0x576b2e[_0x1339('0x2b')][_0x1339('0x6f')]=util[_0x1339('0x60')]('SIP/%s',_0x52326c[_0x1339('0x63')][_0x1339('0x3d')]);_0x576b2e[_0x1339('0x2b')]['channel']=_0x576b2e[_0x1339('0x70')];_0x576b2e['message'][_0x1339('0x71')]=_0x1339('0x5d');return respondWithRpcPromise(_0x1339('0x72'),_0x1339('0x72'),{'event':_0x1339('0x73'),'message':_0x576b2e['message']},client9002)[_0x1339('0x24')](function(){return _0x576b2e;});}return _0x576b2e;}return null;})[_0x1339('0x24')](respondWithResult(_0x30f947,null))[_0x1339('0x2d')](handleError(_0x30f947,null));};var interaction_log=require(_0x1339('0x15'))(_0x1339('0x74'));exports[_0x1339('0x38')]=function(_0x5d6050,_0x47e135,_0x363531){var _0x230337={'agent':{},'channel':_0x1339('0x5e')};if(_0x5d6050['body']['id']){delete _0x5d6050[_0x1339('0x5a')]['id'];}_0x5d6050['body'][_0x1339('0x62')]=_0x5d6050[_0x1339('0x5a')][_0x1339('0x62')]||_0x5d6050[_0x1339('0x63')]['id'];_0x230337[_0x1339('0x75')]['id']=_0x5d6050['body'][_0x1339('0x62')];return db[_0x1339('0x3f')][_0x1339('0x64')]({'where':{'id':_0x5d6050['params']['id'],'UserId':null}})[_0x1339('0x24')](handleEntityNotFound(_0x47e135,null))[_0x1339('0x24')](function(_0x211bf1){if(_0x211bf1){_0x230337[_0x1339('0x2b')]=_0x211bf1[_0x1339('0x67')]({'plain':!![]});return db[_0x1339('0x76')][_0x1339('0x64')]({'where':{'id':_0x211bf1[_0x1339('0x77')]}});}return null;})[_0x1339('0x24')](handleEntityNotFound(_0x47e135,null))['then'](function(_0x1da57c){if(_0x1da57c){_0x230337[_0x1339('0x69')]=_0x1da57c[_0x1339('0x67')]({'plain':!![]});interaction_log[_0x1339('0x25')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d6050[_0x1339('0x63')]['id'],_0x5d6050[_0x1339('0x63')][_0x1339('0x3d')],_0x5d6050['user']['role'],_0x230337[_0x1339('0x69')]['id'],_0x5d6050[_0x1339('0x5a')]?JSON[_0x1339('0x6b')](_0x5d6050[_0x1339('0x5a')]):_0x1339('0x6c'));return respondWithRpcPromise(_0x1339('0x78'),_0x1339('0x79'),_0x230337);}return null;})[_0x1339('0x24')](function(_0x336c0d){if(_0x336c0d){_0x336c0d[_0x1339('0x2b')][_0x1339('0x6f')]=util[_0x1339('0x60')](_0x1339('0x7a'),_0x5d6050[_0x1339('0x63')][_0x1339('0x3d')]);_0x336c0d[_0x1339('0x2b')][_0x1339('0x70')]=_0x230337[_0x1339('0x70')];_0x336c0d['message'][_0x1339('0x71')]=_0x1339('0x38');respondWithRpcPromise(_0x1339('0x72'),_0x1339('0x72'),{'event':_0x1339('0x7b'),'message':_0x336c0d[_0x1339('0x2b')]},client9002);return _0x230337;}return null;})['then'](respondWithResult(_0x47e135,null))['catch'](handleError(_0x47e135,null));};exports[_0x1339('0x7c')]=function(_0x1873dc,_0x2d7c2e){var _0x446c4e;return db[_0x1339('0x3f')][_0x1339('0x7c')](_0x1873dc[_0x1339('0x5a')],{})[_0x1339('0x24')](function(_0x300aaf){_0x446c4e=_0x300aaf;return db['CmContact'][_0x1339('0x7d')]({'where':{'id':_0x446c4e[_0x1339('0x7e')]}});})[_0x1339('0x24')](function(_0x215919){if(_['isNil'](_0x215919)){return;}else{_0x446c4e[_0x1339('0x5e')]=_0x215919[_0x1339('0x5e')];return db[_0x1339('0x7f')]['findOne']({'where':{'id':_0x446c4e[_0x1339('0x80')]}});}})[_0x1339('0x24')](function(_0xa3f498){return respondWithRpcPromise('SendFax',_0x1339('0x81'),{'FaxAccountId':_[_0x1339('0x68')](_0x1873dc['body'])?undefined:_0x1873dc[_0x1339('0x5a')][_0x1339('0x82')],'path':_[_0x1339('0x68')](_0xa3f498)?undefined:util[_0x1339('0x60')](_0x1339('0x83'),_0xa3f498[_0x1339('0x84')]),'fax':_[_0x1339('0x68')](_0x446c4e[_0x1339('0x5e')])?undefined:_0x446c4e[_0x1339('0x5e')],'AttachmentId':_0x446c4e['AttachmentId']},client9002);})[_0x1339('0x24')](respondWithResult(_0x2d7c2e,0xc9))[_0x1339('0x2d')](handleError(_0x2d7c2e,null));};exports['download']=function(_0x49dae4,_0x149906){var _0x190b66=path[_0x1339('0x85')](config['root'],_0x1339('0x86'),_0x1339('0x87'),_0x1339('0x88'));return db['FaxMessage'][_0x1339('0x64')]({'where':{'id':_0x49dae4[_0x1339('0x5b')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x1339('0x24')](handleEntityNotFound(_0x149906,null))[_0x1339('0x24')](function(_0x3e0359){if(_0x3e0359){return _0x149906[_0x1339('0x89')](path[_0x1339('0x85')](_0x190b66,_0x3e0359[_0x1339('0x7f')][_0x1339('0x84')]));}})['catch'](handleError(_0x149906,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 8cfd472..ab76254 100644 --- a/server/api/faxMessage/faxMessage.events.js +++ b/server/api/faxMessage/faxMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x319798,_0x6dee32){var _0x404e98=function(_0x5e2c44){while(--_0x5e2c44){_0x319798['push'](_0x319798['shift']());}};_0x404e98(++_0x6dee32);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x7995('0x0'));var FaxMessage=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){FaxMessageEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);FaxMessageEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];FaxMessage[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe14b,0x93));var _0xbe14=function(_0x4e5a66,_0x5ae1a2){_0x4e5a66=_0x4e5a66-0x0;var _0x50ec70=_0xe14b[_0x4e5a66];return _0x50ec70;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var FaxMessage=require(_0xbe14('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){FaxMessageEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);FaxMessageEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];FaxMessage[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 80e7aa2..3c243f1 100644 --- a/server/api/faxMessage/faxMessage.model.js +++ b/server/api/faxMessage/faxMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f79=['get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x4f79,0x1d0));var _0x94f7=function(_0xf913ed,_0x4eb80b){_0xf913ed=_0xf913ed-0x0;var _0xc7eeb4=_0x4f79[_0xf913ed];return _0xc7eeb4;};'use strict';var _=require(_0x94f7('0x0'));var util=require(_0x94f7('0x1'));var logger=require(_0x94f7('0x2'))(_0x94f7('0x3'));var moment=require(_0x94f7('0x4'));var BPromise=require(_0x94f7('0x5'));var rp=require(_0x94f7('0x6'));var fs=require('fs');var path=require(_0x94f7('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0x94f7('0x8')]=function(_0x5ddba0,_0x5d21e6){return _0x5ddba0[_0x94f7('0x9')](_0x94f7('0xa'),attributes,{'tableName':_0x94f7('0xb'),'paranoid':![],'indexes':[{'name':_0x94f7('0xc'),'fields':[_0x94f7('0xd')],'type':_0x94f7('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x46ca8f,_0x190c0b,_0x502a7e){var _0x30b54a=_0x5ddba0[_0x94f7('0xf')];var _0x4e953e=_0x46ca8f[_0x94f7('0x10')]({'plain':!![]});if(_0x4e953e[_0x94f7('0x11')][_0x94f7('0x12')]()==='in'||_0x4e953e[_0x94f7('0x11')][_0x94f7('0x12')]()===_0x94f7('0x13')&&!_0x4e953e[_0x94f7('0x14')]&&!_[_0x94f7('0x15')](_0x4e953e[_0x94f7('0x16')])){_0x30b54a[_0x94f7('0x17')]['findOne']({'where':{'id':_0x4e953e[_0x94f7('0x18')]}})[_0x94f7('0x19')](function(_0x3db9b3){if(_0x3db9b3){_0x3db9b3['update']({'lastMsgAt':_0x4e953e['createdAt'],'lastMsgDirection':_0x4e953e[_0x94f7('0x11')][_0x94f7('0x12')]()});}})[_0x94f7('0x1a')](function(_0x105bd8){console[_0x94f7('0x1b')](_0x105bd8);});}_0x502a7e();}},'charset':_0x94f7('0x1c'),'collate':_0x94f7('0x1d')});}; \ No newline at end of file +var _0xfdf4=['isNil','UserId','FaxInteraction','findOne','FaxInteractionId','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','models','get','direction','toLowerCase','secret'];(function(_0xc5b468,_0x4edb12){var _0x3f668a=function(_0x82e7bd){while(--_0x82e7bd){_0xc5b468['push'](_0xc5b468['shift']());}};_0x3f668a(++_0x4edb12);}(_0xfdf4,0x166));var _0x4fdf=function(_0x289187,_0x5b6795){_0x289187=_0x289187-0x0;var _0x5c4db4=_0xfdf4[_0x289187];return _0x5c4db4;};'use strict';var _=require(_0x4fdf('0x0'));var util=require(_0x4fdf('0x1'));var logger=require(_0x4fdf('0x2'))(_0x4fdf('0x3'));var moment=require(_0x4fdf('0x4'));var BPromise=require(_0x4fdf('0x5'));var rp=require(_0x4fdf('0x6'));var fs=require('fs');var path=require(_0x4fdf('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4fdf('0x8'));module[_0x4fdf('0x9')]=function(_0x450cbe,_0x421aeb){return _0x450cbe[_0x4fdf('0xa')](_0x4fdf('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x4fdf('0xc'),'fields':[_0x4fdf('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47cc24,_0x2ddb9f,_0x265193){var _0x4dad67=_0x450cbe[_0x4fdf('0xe')];var _0x57ec64=_0x47cc24[_0x4fdf('0xf')]({'plain':!![]});if(_0x57ec64[_0x4fdf('0x10')]['toLowerCase']()==='in'||_0x57ec64['direction'][_0x4fdf('0x11')]()==='out'&&!_0x57ec64[_0x4fdf('0x12')]&&!_[_0x4fdf('0x13')](_0x57ec64[_0x4fdf('0x14')])){_0x4dad67[_0x4fdf('0x15')][_0x4fdf('0x16')]({'where':{'id':_0x57ec64[_0x4fdf('0x17')]}})['then'](function(_0x3de51f){if(_0x3de51f){_0x3de51f['update']({'lastMsgAt':_0x57ec64[_0x4fdf('0x18')],'lastMsgDirection':_0x57ec64['direction'][_0x4fdf('0x11')]()});}})[_0x4fdf('0x19')](function(_0x1959c2){console[_0x4fdf('0x1a')](_0x1959c2);});}_0x265193();}},'charset':_0x4fdf('0x1b'),'collate':_0x4fdf('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 1632e29..d7396a1 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa508=['then','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateFaxMessage','body','options','UpdateFaxMessage','FaxMessage','update','raw','where','attributes','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./faxMessage.socket','register','request'];(function(_0x56a7dd,_0x3fd9ae){var _0xc7b980=function(_0x34221b){while(--_0x34221b){_0x56a7dd['push'](_0x56a7dd['shift']());}};_0xc7b980(++_0x3fd9ae);}(_0xa508,0x187));var _0x8a50=function(_0x4ca677,_0x14859a){_0x4ca677=_0x4ca677-0x0;var _0x406c2f=_0xa508[_0x4ca677];return _0x406c2f;};'use strict';var _=require(_0x8a50('0x0'));var util=require(_0x8a50('0x1'));var moment=require('moment');var BPromise=require(_0x8a50('0x2'));var rs=require(_0x8a50('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8a50('0x4'));var logger=require(_0x8a50('0x5'))(_0x8a50('0x6'));var config=require('../../config/environment');var jayson=require(_0x8a50('0x7'));var client=jayson[_0x8a50('0x8')][_0x8a50('0x9')]({'port':0x232a});config['redis']=_[_0x8a50('0xa')](config[_0x8a50('0xb')],{'host':_0x8a50('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a50('0xb')]));require(_0x8a50('0xd'))[_0x8a50('0xe')](socket);function respondWithRpcPromise(_0x4c1446,_0xebc797,_0x4ff450){return new BPromise(function(_0x1488f1,_0xbc2ecc){return client[_0x8a50('0xf')](_0x4c1446,_0x4ff450)[_0x8a50('0x10')](function(_0x2884b2){logger['info'](_0x8a50('0x11'),_0xebc797,'request\x20sent');logger[_0x8a50('0x12')](_0x8a50('0x13'),_0xebc797,_0x8a50('0x14'),JSON[_0x8a50('0x15')](_0x2884b2));if(_0x2884b2['error']){if(_0x2884b2[_0x8a50('0x16')][_0x8a50('0x17')]===0x1f4){logger[_0x8a50('0x16')]('FaxMessage,\x20%s,\x20%s',_0xebc797,_0x2884b2[_0x8a50('0x16')][_0x8a50('0x18')]);return _0xbc2ecc(_0x2884b2[_0x8a50('0x16')][_0x8a50('0x18')]);}logger[_0x8a50('0x16')](_0x8a50('0x11'),_0xebc797,_0x2884b2[_0x8a50('0x16')][_0x8a50('0x18')]);return _0x1488f1(_0x2884b2[_0x8a50('0x16')]['message']);}else{logger[_0x8a50('0x19')]('FaxMessage,\x20%s,\x20%s',_0xebc797,_0x8a50('0x14'));_0x1488f1(_0x2884b2[_0x8a50('0x1a')][_0x8a50('0x18')]);}})[_0x8a50('0x1b')](function(_0x54f912){logger['error'](_0x8a50('0x11'),_0xebc797,_0x54f912);_0xbc2ecc(_0x54f912);});});}exports[_0x8a50('0x1c')]=function(_0x27f3b9){var _0x25f094=this;return new Promise(function(_0x447425,_0x14f0e3){return db['FaxMessage']['create'](_0x27f3b9[_0x8a50('0x1d')],{'raw':_0x27f3b9[_0x8a50('0x1e')]?_0x27f3b9[_0x8a50('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x8a50('0x10')](function(_0x4d2661){logger[_0x8a50('0x19')]('CreateFaxMessage',_0x27f3b9);logger[_0x8a50('0x12')](_0x8a50('0x1c'),_0x27f3b9,JSON[_0x8a50('0x15')](_0x4d2661));_0x447425(_0x4d2661);})['catch'](function(_0x1ec8bc){logger['error'](_0x8a50('0x1c'),_0x1ec8bc['message'],_0x27f3b9);_0x14f0e3(_0x25f094['error'](0x1f4,_0x1ec8bc[_0x8a50('0x18')]));});});};exports[_0x8a50('0x1f')]=function(_0x4ccb91){var _0x414047=this;return new Promise(function(_0x2e83f0,_0x8ed841){return db[_0x8a50('0x20')][_0x8a50('0x21')](_0x4ccb91[_0x8a50('0x1d')],{'raw':_0x4ccb91[_0x8a50('0x1e')]?_0x4ccb91[_0x8a50('0x1e')][_0x8a50('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ccb91['options']?_0x4ccb91[_0x8a50('0x1e')][_0x8a50('0x23')]||null:null,'attributes':_0x4ccb91[_0x8a50('0x1e')]?_0x4ccb91[_0x8a50('0x1e')][_0x8a50('0x24')]||null:null,'limit':_0x4ccb91['options']?_0x4ccb91[_0x8a50('0x1e')]['limit']||null:null})[_0x8a50('0x10')](function(_0xcc5a9e){logger['info']('UpdateFaxMessage',_0x4ccb91);logger['debug'](_0x8a50('0x1f'),_0x4ccb91,JSON[_0x8a50('0x15')](_0xcc5a9e));_0x2e83f0(_0xcc5a9e);})['catch'](function(_0x3ca791){logger[_0x8a50('0x16')](_0x8a50('0x1f'),_0x3ca791[_0x8a50('0x18')],_0x4ccb91);_0x8ed841(_0x414047[_0x8a50('0x16')](0x1f4,_0x3ca791[_0x8a50('0x18')]));});});}; \ No newline at end of file +var _0xd8ea=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateFaxMessage','FaxMessage','create','body','options','stringify','catch','raw','where','attributes','limit','UpdateFaxMessage','lodash','util'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xd8ea,0xb7));var _0xad8e=function(_0x5d1e99,_0x529766){_0x5d1e99=_0x5d1e99-0x0;var _0x3849d2=_0xd8ea[_0x5d1e99];return _0x3849d2;};'use strict';var _=require(_0xad8e('0x0'));var util=require(_0xad8e('0x1'));var moment=require(_0xad8e('0x2'));var BPromise=require(_0xad8e('0x3'));var rs=require(_0xad8e('0x4'));var fs=require('fs');var Redis=require(_0xad8e('0x5'));var db=require(_0xad8e('0x6'))['db'];var utils=require(_0xad8e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xad8e('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xad8e('0x9')]=_[_0xad8e('0xa')](config[_0xad8e('0x9')],{'host':_0xad8e('0xb'),'port':0x18eb});var socket=require(_0xad8e('0xc'))(new Redis(config[_0xad8e('0x9')]));require(_0xad8e('0xd'))['register'](socket);function respondWithRpcPromise(_0x4471d3,_0x436e67,_0x1eaba3){return new BPromise(function(_0x396c5f,_0x497555){return client[_0xad8e('0xe')](_0x4471d3,_0x1eaba3)[_0xad8e('0xf')](function(_0x1320d6){logger['info'](_0xad8e('0x10'),_0x436e67,_0xad8e('0x11'));logger[_0xad8e('0x12')](_0xad8e('0x13'),_0x436e67,_0xad8e('0x11'),JSON['stringify'](_0x1320d6));if(_0x1320d6[_0xad8e('0x14')]){if(_0x1320d6[_0xad8e('0x14')][_0xad8e('0x15')]===0x1f4){logger[_0xad8e('0x14')]('FaxMessage,\x20%s,\x20%s',_0x436e67,_0x1320d6[_0xad8e('0x14')]['message']);return _0x497555(_0x1320d6[_0xad8e('0x14')][_0xad8e('0x16')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x436e67,_0x1320d6[_0xad8e('0x14')][_0xad8e('0x16')]);return _0x396c5f(_0x1320d6['error'][_0xad8e('0x16')]);}else{logger[_0xad8e('0x17')]('FaxMessage,\x20%s,\x20%s',_0x436e67,_0xad8e('0x11'));_0x396c5f(_0x1320d6[_0xad8e('0x18')][_0xad8e('0x16')]);}})['catch'](function(_0x19c74a){logger['error'](_0xad8e('0x10'),_0x436e67,_0x19c74a);_0x497555(_0x19c74a);});});}exports[_0xad8e('0x19')]=function(_0x19fe5d){var _0xa1af3f=this;return new Promise(function(_0x18f541,_0x1570f9){return db[_0xad8e('0x1a')][_0xad8e('0x1b')](_0x19fe5d[_0xad8e('0x1c')],{'raw':_0x19fe5d[_0xad8e('0x1d')]?_0x19fe5d[_0xad8e('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xad8e('0xf')](function(_0x5f183e){logger['info'](_0xad8e('0x19'),_0x19fe5d);logger[_0xad8e('0x12')](_0xad8e('0x19'),_0x19fe5d,JSON[_0xad8e('0x1e')](_0x5f183e));_0x18f541(_0x5f183e);})[_0xad8e('0x1f')](function(_0x2babbd){logger[_0xad8e('0x14')](_0xad8e('0x19'),_0x2babbd[_0xad8e('0x16')],_0x19fe5d);_0x1570f9(_0xa1af3f['error'](0x1f4,_0x2babbd[_0xad8e('0x16')]));});});};exports['UpdateFaxMessage']=function(_0x511671){var _0x19d066=this;return new Promise(function(_0x504b90,_0x536ccc){return db['FaxMessage']['update'](_0x511671[_0xad8e('0x1c')],{'raw':_0x511671[_0xad8e('0x1d')]?_0x511671['options'][_0xad8e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x511671['options']?_0x511671[_0xad8e('0x1d')][_0xad8e('0x21')]||null:null,'attributes':_0x511671[_0xad8e('0x1d')]?_0x511671[_0xad8e('0x1d')][_0xad8e('0x22')]||null:null,'limit':_0x511671[_0xad8e('0x1d')]?_0x511671['options'][_0xad8e('0x23')]||null:null})[_0xad8e('0xf')](function(_0x46554d){logger[_0xad8e('0x17')](_0xad8e('0x24'),_0x511671);logger[_0xad8e('0x12')](_0xad8e('0x24'),_0x511671,JSON[_0xad8e('0x1e')](_0x46554d));_0x504b90(_0x46554d);})[_0xad8e('0x1f')](function(_0x48a575){logger[_0xad8e('0x14')](_0xad8e('0x24'),_0x48a575['message'],_0x511671);_0x536ccc(_0x19d066['error'](0x1f4,_0x48a575[_0xad8e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 3558883..fe97222 100644 --- a/server/api/faxMessage/faxMessage.socket.js +++ b/server/api/faxMessage/faxMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var FaxMessageEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){FaxMessageEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 9e39972..bbe5ecc 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2baf=['/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./faxMessage.controller','isAuthenticated','get','show','download','post','tracked','fax','faxmessage:create','create','put','/:id','update'];(function(_0x4da6ba,_0x554ea7){var _0x4b8317=function(_0x573de2){while(--_0x573de2){_0x4da6ba['push'](_0x4da6ba['shift']());}};_0x4b8317(++_0x554ea7);}(_0x2baf,0xe7));var _0xf2ba=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x2baf[_0x15bc81];return _0x59440e;};'use strict';var multer=require(_0xf2ba('0x0'));var util=require(_0xf2ba('0x1'));var path=require(_0xf2ba('0x2'));var timeout=require(_0xf2ba('0x3'));var express=require('express');var router=express[_0xf2ba('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf2ba('0x5'));var config=require('../../config/environment');var controller=require(_0xf2ba('0x6'));router['get']('/',auth[_0xf2ba('0x7')](),controller['index']);router[_0xf2ba('0x8')]('/describe',auth[_0xf2ba('0x7')](),controller['describe']);router[_0xf2ba('0x8')]('/:id',auth[_0xf2ba('0x7')](),controller[_0xf2ba('0x9')]);router[_0xf2ba('0x8')]('/:id/download',auth[_0xf2ba('0x7')](),controller[_0xf2ba('0xa')]);router[_0xf2ba('0xb')]('/',auth[_0xf2ba('0x7')](),interaction[_0xf2ba('0xc')](_0xf2ba('0xd'),_0xf2ba('0xe')),controller[_0xf2ba('0xf')]);router[_0xf2ba('0x10')](_0xf2ba('0x11'),auth['isAuthenticated'](),controller[_0xf2ba('0x12')]);router[_0xf2ba('0x10')](_0xf2ba('0x13'),auth[_0xf2ba('0x7')](),controller['accept']);router[_0xf2ba('0x10')](_0xf2ba('0x14'),auth[_0xf2ba('0x7')](),controller[_0xf2ba('0x15')]);router[_0xf2ba('0x16')]('/:id',auth[_0xf2ba('0x7')](),controller[_0xf2ba('0x17')]);module[_0xf2ba('0x18')]=router; \ No newline at end of file +var _0xbee0=['reject','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','show','/:id/download','download','post','tracked','fax','create','update','put','/:id/accept'];(function(_0x15ee30,_0x318377){var _0x1bf893=function(_0x498762){while(--_0x498762){_0x15ee30['push'](_0x15ee30['shift']());}};_0x1bf893(++_0x318377);}(_0xbee0,0x147));var _0x0bee=function(_0x2c9cc3,_0x2c1368){_0x2c9cc3=_0x2c9cc3-0x0;var _0x558e2b=_0xbee0[_0x2c9cc3];return _0x558e2b;};'use strict';var multer=require('multer');var util=require(_0x0bee('0x0'));var path=require(_0x0bee('0x1'));var timeout=require(_0x0bee('0x2'));var express=require(_0x0bee('0x3'));var router=express[_0x0bee('0x4')]();var auth=require(_0x0bee('0x5'));var interaction=require(_0x0bee('0x6'));var config=require(_0x0bee('0x7'));var controller=require('./faxMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0bee('0x8')]);router[_0x0bee('0x9')](_0x0bee('0xa'),auth[_0x0bee('0xb')](),controller['describe']);router[_0x0bee('0x9')](_0x0bee('0xc'),auth[_0x0bee('0xb')](),controller[_0x0bee('0xd')]);router['get'](_0x0bee('0xe'),auth[_0x0bee('0xb')](),controller[_0x0bee('0xf')]);router[_0x0bee('0x10')]('/',auth[_0x0bee('0xb')](),interaction[_0x0bee('0x11')](_0x0bee('0x12'),'faxmessage:create'),controller[_0x0bee('0x13')]);router['put'](_0x0bee('0xc'),auth[_0x0bee('0xb')](),controller[_0x0bee('0x14')]);router[_0x0bee('0x15')](_0x0bee('0x16'),auth[_0x0bee('0xb')](),controller['accept']);router['put']('/:id/reject',auth[_0x0bee('0xb')](),controller[_0x0bee('0x17')]);router[_0x0bee('0x18')](_0x0bee('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index f600853..33de1bc 100644 --- a/server/api/faxQueue/faxQueue.attributes.js +++ b/server/api/faxQueue/faxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef88=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xef88,0x10f));var _0x8ef8=function(_0x33dca7,_0x4397c0){_0x33dca7=_0x33dca7-0x0;var _0x375512=_0xef88[_0x33dca7];return _0x375512;};'use strict';var Sequelize=require('sequelize');module[_0x8ef8('0x0')]={'name':{'type':Sequelize[_0x8ef8('0x1')],'unique':_0x8ef8('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8ef8('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8ef8('0x4')](_0x8ef8('0x5'),_0x8ef8('0x6'),_0x8ef8('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9bc3=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x4a2673,_0x1290a1){var _0x20f7ff=function(_0x48b1b3){while(--_0x48b1b3){_0x4a2673['push'](_0x4a2673['shift']());}};_0x20f7ff(++_0x1290a1);}(_0x9bc3,0x137));var _0x39bc=function(_0x1bc9cd,_0x4da80c){_0x1bc9cd=_0x1bc9cd-0x0;var _0x13bc89=_0x9bc3[_0x1bc9cd];return _0x13bc89;};'use strict';var Sequelize=require(_0x39bc('0x0'));module[_0x39bc('0x1')]={'name':{'type':Sequelize[_0x39bc('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x39bc('0x2')]},'timeout':{'type':Sequelize[_0x39bc('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x39bc('0x4')](_0x39bc('0x5'),'beepall',_0x39bc('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x39bc('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 11a156a..237c589 100644 --- a/server/api/faxQueue/faxQueue.controller.js +++ b/server/api/faxQueue/faxQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x612d=['merge','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','describe','findOne','UserFaxQueue','nolimit','order','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','teams','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','Agents','tq.TeamId','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','all','union','compact','isEmpty','removeAgents','userFaxQueue:remove','addAgents','userFaxQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./faxQueue.socket','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','update','then','FaxQueues','UserProfileResource','error','name','send','index','rawAttributes','model','keys','query','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','map','type','field','options','FaxQueue','findAll','rows','catch','show','params','intersection','includeAll','include'];(function(_0x5a7e78,_0x47a628){var _0x1f6fff=function(_0x59c71c){while(--_0x59c71c){_0x5a7e78['push'](_0x5a7e78['shift']());}};_0x1f6fff(++_0x47a628);}(_0x612d,0x158));var _0xd612=function(_0x2caae5,_0x23acda){_0x2caae5=_0x2caae5-0x0;var _0x5e1f96=_0x612d[_0x2caae5];return _0x5e1f96;};'use strict';var pdf=require(_0xd612('0x0'));var emlformat=require(_0xd612('0x1'));var rimraf=require(_0xd612('0x2'));var zipdir=require(_0xd612('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd612('0x4'));var moment=require('moment');var BPromise=require(_0xd612('0x5'));var Mustache=require('mustache');var util=require(_0xd612('0x6'));var path=require(_0xd612('0x7'));var sox=require(_0xd612('0x8'));var csv=require(_0xd612('0x9'));var ejs=require(_0xd612('0xa'));var fs=require('fs');var _=require(_0xd612('0xb'));var squel=require(_0xd612('0xc'));var crypto=require(_0xd612('0xd'));var jsforce=require(_0xd612('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd612('0xf'));var Papa=require('papaparse');var Redis=require(_0xd612('0x10'));var authService=require(_0xd612('0x11'));var qs=require(_0xd612('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd612('0x13'));var utils=require(_0xd612('0x14'));var config=require(_0xd612('0x15'));var db=require('../../mysqldb')['db'];config[_0xd612('0x16')]=_[_0xd612('0x17')](config[_0xd612('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xd612('0x18'))(new Redis(config[_0xd612('0x16')]));require(_0xd612('0x19'))['register'](socket);function respondWithStatusCode(_0x307fa4,_0x379a86){_0x379a86=_0x379a86||0xcc;return function(_0x2bfce5){if(_0x2bfce5){return _0x307fa4[_0xd612('0x1a')](_0x379a86);}return _0x307fa4['status'](_0x379a86)[_0xd612('0x1b')]();};}function respondWithResult(_0x2cfe58,_0x4859a6){_0x4859a6=_0x4859a6||0xc8;return function(_0x2dcf11){if(_0x2dcf11){return _0x2cfe58['status'](_0x4859a6)[_0xd612('0x1c')](_0x2dcf11);}};}function respondWithFilteredResult(_0x2e8991,_0x14dbff){return function(_0x5cb7b1){if(_0x5cb7b1){var _0x58dbb6=_0x5cb7b1[_0xd612('0x1d')],_0x25ac5f=_0x14dbff[_0xd612('0x1e')],_0x3a0c76=_0x14dbff['offset']+_0x14dbff[_0xd612('0x1f')],_0x4bb1de;if(_0x3a0c76>=_0x58dbb6){_0x3a0c76=_0x58dbb6;_0x4bb1de=0xc8;}else{_0x4bb1de=0xce;}_0x2e8991[_0xd612('0x20')](_0x4bb1de);return _0x2e8991[_0xd612('0x21')](_0xd612('0x22'),_0x25ac5f+'-'+_0x3a0c76+'/'+_0x58dbb6)['json'](_0x5cb7b1);}return null;};}function patchUpdates(_0x5aa3bc){return function(_0x36a213){try{jsonpatch[_0xd612('0x23')](_0x36a213,_0x5aa3bc,!![]);}catch(_0x48d4f1){return BPromise['reject'](_0x48d4f1);}return _0x36a213['save']();};}function saveUpdates(_0x212a57,_0x21d344){return function(_0x498372){if(_0x498372){return _0x498372[_0xd612('0x24')](_0x212a57)['then'](function(_0x54a2cd){return _0x54a2cd;});}return null;};}function removeEntity(_0x5d022b,_0x40960d){return function(_0x488233){if(_0x488233){return _0x488233['destroy']()[_0xd612('0x25')](function(){var _0x5aa3cf=_0x488233['get']({'plain':!![]});var _0x554fd0=_0xd612('0x26');return db[_0xd612('0x27')]['destroy']({'where':{'type':_0x554fd0,'resourceId':_0x5aa3cf['id']}})['then'](function(){return _0x488233;});})[_0xd612('0x25')](function(){_0x5d022b[_0xd612('0x20')](0xcc)[_0xd612('0x1b')]();});}};}function handleEntityNotFound(_0x27312a,_0x347d4d){return function(_0x22fed1){if(!_0x22fed1){_0x27312a[_0xd612('0x1a')](0x194);}return _0x22fed1;};}function handleError(_0x295daf,_0x367f3d){_0x367f3d=_0x367f3d||0x1f4;return function(_0x4223c6){logger[_0xd612('0x28')](_0x4223c6['stack']);if(_0x4223c6[_0xd612('0x29')]){delete _0x4223c6[_0xd612('0x29')];}_0x295daf[_0xd612('0x20')](_0x367f3d)[_0xd612('0x2a')](_0x4223c6);};}exports[_0xd612('0x2b')]=function(_0x4b965d,_0x424db7){var _0x248b05={},_0x2d598d={},_0xd48546={'count':0x0,'rows':[]};var _0x259ecb=db['FaxQueue'][_0xd612('0x2c')];_0x2d598d[_0xd612('0x2d')]=_[_0xd612('0x2e')](_0x259ecb);_0x2d598d[_0xd612('0x2f')]=_[_0xd612('0x2e')](_0x4b965d[_0xd612('0x2f')]);_0x2d598d['filters']=_['intersection'](_0x2d598d[_0xd612('0x2d')],_0x2d598d[_0xd612('0x2f')]);_0x248b05[_0xd612('0x30')]=_['intersection'](_0x2d598d['model'],qs['fields'](_0x4b965d[_0xd612('0x2f')][_0xd612('0x31')]));_0x248b05[_0xd612('0x30')]=_0x248b05[_0xd612('0x30')][_0xd612('0x32')]?_0x248b05[_0xd612('0x30')]:_0x2d598d[_0xd612('0x2d')];if(!_0x4b965d['query'][_0xd612('0x33')]('nolimit')){_0x248b05[_0xd612('0x1f')]=qs[_0xd612('0x1f')](_0x4b965d[_0xd612('0x2f')][_0xd612('0x1f')]);_0x248b05[_0xd612('0x1e')]=qs[_0xd612('0x1e')](_0x4b965d[_0xd612('0x2f')][_0xd612('0x1e')]);}_0x248b05['order']=qs['sort'](_0x4b965d[_0xd612('0x2f')][_0xd612('0x34')]);_0x248b05[_0xd612('0x35')]=qs[_0xd612('0x36')](_[_0xd612('0x37')](_0x4b965d[_0xd612('0x2f')],_0x2d598d['filters']));if(_0x4b965d[_0xd612('0x2f')][_0xd612('0x38')]){_0x248b05['where']=_['merge'](_0x248b05[_0xd612('0x35')],{'$or':_[_0xd612('0x39')](_0x259ecb,function(_0x124e85){if(_0x124e85[_0xd612('0x3a')]['key']!=='VIRTUAL'){var _0x40c85f={};_0x40c85f[_0x124e85[_0xd612('0x3b')]]={'$like':'%'+_0x4b965d[_0xd612('0x2f')][_0xd612('0x38')]+'%'};return _0x40c85f;}})});}_0x248b05=_['merge']({},_0x248b05,_0x4b965d[_0xd612('0x3c')]);var _0x11c027={'where':_0x248b05[_0xd612('0x35')]};return db[_0xd612('0x3d')]['count'](_0x11c027)[_0xd612('0x25')](function(_0x4722eb){_0xd48546['count']=_0x4722eb;if(_0x4b965d[_0xd612('0x2f')]['includeAll']){_0x248b05['include']=[{'all':!![]}];}return db[_0xd612('0x3d')][_0xd612('0x3e')](_0x248b05);})[_0xd612('0x25')](function(_0x3cf1c1){_0xd48546[_0xd612('0x3f')]=_0x3cf1c1;return _0xd48546;})[_0xd612('0x25')](respondWithFilteredResult(_0x424db7,_0x248b05))[_0xd612('0x40')](handleError(_0x424db7,null));};exports[_0xd612('0x41')]=function(_0x3ef7c7,_0x36e507){var _0x3423c0={'raw':!![],'where':{'id':_0x3ef7c7[_0xd612('0x42')]['id']}},_0x22e382={};_0x22e382[_0xd612('0x2d')]=_[_0xd612('0x2e')](db[_0xd612('0x3d')][_0xd612('0x2c')]);_0x22e382[_0xd612('0x2f')]=_['keys'](_0x3ef7c7['query']);_0x22e382[_0xd612('0x36')]=_['intersection'](_0x22e382[_0xd612('0x2d')],_0x22e382[_0xd612('0x2f')]);_0x3423c0[_0xd612('0x30')]=_[_0xd612('0x43')](_0x22e382[_0xd612('0x2d')],qs[_0xd612('0x31')](_0x3ef7c7[_0xd612('0x2f')][_0xd612('0x31')]));_0x3423c0[_0xd612('0x30')]=_0x3423c0['attributes']['length']?_0x3423c0['attributes']:_0x22e382['model'];if(_0x3ef7c7[_0xd612('0x2f')][_0xd612('0x44')]){_0x3423c0[_0xd612('0x45')]=[{'all':!![]}];}_0x3423c0=_[_0xd612('0x46')]({},_0x3423c0,_0x3ef7c7[_0xd612('0x3c')]);return db[_0xd612('0x3d')]['find'](_0x3423c0)[_0xd612('0x25')](handleEntityNotFound(_0x36e507,null))['then'](respondWithResult(_0x36e507,null))['catch'](handleError(_0x36e507,null));};exports[_0xd612('0x47')]=function(_0x49878d,_0x5eaebc){return db[_0xd612('0x3d')]['create'](_0x49878d[_0xd612('0x48')],{})[_0xd612('0x25')](function(_0x108b85){var _0x1b15af=_0x49878d['user'][_0xd612('0x49')]({'plain':!![]});if(!_0x1b15af)throw new Error(_0xd612('0x4a'));if(_0x1b15af[_0xd612('0x4b')]===_0xd612('0x4c')){var _0x8bc1f2=_0x108b85[_0xd612('0x49')]({'plain':!![]});var _0x2cc637=_0xd612('0x26');return db[_0xd612('0x4d')]['find']({'where':{'name':_0x2cc637,'userProfileId':_0x1b15af[_0xd612('0x4e')]},'raw':!![]})[_0xd612('0x25')](function(_0x4b4006){if(_0x4b4006&&_0x4b4006[_0xd612('0x4f')]===0x0){return db[_0xd612('0x27')][_0xd612('0x47')]({'name':_0x8bc1f2['name'],'resourceId':_0x8bc1f2['id'],'type':_0x4b4006[_0xd612('0x29')],'sectionId':_0x4b4006['id']},{})['then'](function(){return _0x108b85;});}else{return _0x108b85;}})[_0xd612('0x40')](function(_0x5f3fa0){logger[_0xd612('0x28')](_0xd612('0x50'),_0x5f3fa0);throw _0x5f3fa0;});}return _0x108b85;})[_0xd612('0x25')](respondWithResult(_0x5eaebc,0xc9))['catch'](handleError(_0x5eaebc,null));};exports[_0xd612('0x24')]=function(_0x24b2ed,_0x45fa79){if(_0x24b2ed['body']['id']){delete _0x24b2ed[_0xd612('0x48')]['id'];}return db[_0xd612('0x3d')][_0xd612('0x51')]({'where':{'id':_0x24b2ed[_0xd612('0x42')]['id']}})[_0xd612('0x25')](handleEntityNotFound(_0x45fa79,null))[_0xd612('0x25')](saveUpdates(_0x24b2ed['body'],null))[_0xd612('0x25')](respondWithResult(_0x45fa79,null))['catch'](handleError(_0x45fa79,null));};exports[_0xd612('0x52')]=function(_0x3cb2f8,_0x82132a){return db[_0xd612('0x3d')][_0xd612('0x51')]({'where':{'id':_0x3cb2f8[_0xd612('0x42')]['id']}})[_0xd612('0x25')](handleEntityNotFound(_0x82132a,null))[_0xd612('0x25')](removeEntity(_0x82132a,null))[_0xd612('0x40')](handleError(_0x82132a,null));};exports[_0xd612('0x53')]=function(_0xb7a306,_0x24698a){return db[_0xd612('0x3d')][_0xd612('0x53')]()['then'](respondWithResult(_0x24698a,null))['catch'](handleError(_0x24698a,null));};exports['getMembers']=function(_0x389f24,_0x55dcd2,_0x49e963){var _0x571d10={'raw':!![],'where':{}},_0x4bd5e3={},_0x2dfcf4;return db['FaxQueue'][_0xd612('0x54')]({'where':{'id':_0x389f24[_0xd612('0x42')]['id']}})[_0xd612('0x25')](handleEntityNotFound(_0x55dcd2,null))[_0xd612('0x25')](function(_0x58df4f){if(_0x58df4f){_0x2dfcf4=_0x58df4f[_0xd612('0x49')]({'plain':!![]});_0x4bd5e3[_0xd612('0x2d')]=_['keys'](db[_0xd612('0x55')][_0xd612('0x2c')]);_0x4bd5e3[_0xd612('0x2f')]=_[_0xd612('0x2e')](_0x389f24[_0xd612('0x2f')]);_0x4bd5e3[_0xd612('0x36')]=_['intersection'](_0x4bd5e3[_0xd612('0x2d')],_0x4bd5e3[_0xd612('0x2f')]);_0x571d10[_0xd612('0x30')]=_[_0xd612('0x43')](_0x4bd5e3['model'],qs[_0xd612('0x31')](_0x389f24[_0xd612('0x2f')][_0xd612('0x31')]));_0x571d10[_0xd612('0x30')]=_0x571d10[_0xd612('0x30')][_0xd612('0x32')]?_0x571d10[_0xd612('0x30')]:_0x4bd5e3['model'];if(!_0x389f24['query'][_0xd612('0x33')](_0xd612('0x56'))){_0x571d10[_0xd612('0x1f')]=qs['limit'](_0x389f24['query'][_0xd612('0x1f')]);_0x571d10[_0xd612('0x1e')]=qs[_0xd612('0x1e')](_0x389f24['query']['offset']);}_0x571d10[_0xd612('0x57')]=qs[_0xd612('0x34')](_0x389f24[_0xd612('0x2f')][_0xd612('0x34')]);_0x571d10[_0xd612('0x35')]=qs[_0xd612('0x36')](_['pick'](_0x389f24[_0xd612('0x2f')],_0x4bd5e3[_0xd612('0x36')]));_0x571d10['where'][_0xd612('0x58')]=_0x58df4f['id'];if(_0x389f24['query']['filter']){_0x571d10[_0xd612('0x35')]=_[_0xd612('0x46')](_0x571d10[_0xd612('0x35')],{'$or':_[_0xd612('0x39')](_0x571d10['attributes'],function(_0x38946d){var _0xda5ffd={};_0xda5ffd[_0x38946d]={'$like':'%'+_0x389f24['query']['filter']+'%'};return _0xda5ffd;})});}_0x571d10=_[_0xd612('0x46')]({},_0x571d10,_0x389f24['options']);return db['UserFaxQueue'][_0xd612('0x3e')](_0x571d10);}})[_0xd612('0x25')](function(_0x34206c){if(_0x34206c){return db[_0xd612('0x59')][_0xd612('0x5a')]({'where':{'id':_['map'](_0x34206c,_0xd612('0x5b')),'role':_0xd612('0x5c')},'attributes':['id',_0xd612('0x29'),_0xd612('0x5d'),_0xd612('0x5e'),_0xd612('0x5f')]});}})['then'](function(_0x342e88){if(_0x342e88){return{'count':_0x342e88[_0xd612('0x1d')],'rows':_[_0xd612('0x39')](_0x342e88[_0xd612('0x3f')],function(_0x37d4a4){return{'membername':_0x37d4a4[_0xd612('0x29')],'UserId':_0x37d4a4['id'],'queue_name':_0x2dfcf4[_0xd612('0x29')],'FaxQueueId':_0x2dfcf4['id'],'interface':util[_0xd612('0x60')](_0xd612('0x61'),_0xd612('0x62'),_0x37d4a4[_0xd612('0x29')]),'penalty':0x0,'paused':_0x37d4a4[_0xd612('0x5d')],'createdAt':_0x37d4a4[_0xd612('0x5f')],'updatedAt':_0x37d4a4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xd612('0x25')](respondWithFilteredResult(_0x55dcd2,_0x571d10))['catch'](handleError(_0x55dcd2,null));};exports[_0xd612('0x63')]=function(_0xd44772,_0xd18f1a,_0x6db57a){var _0x267082={};var _0x3a0e02={};var _0x5a8faa;var _0xb534a1;return db[_0xd612('0x3d')][_0xd612('0x54')]({'where':{'id':_0xd44772[_0xd612('0x42')]['id']}})['then'](handleEntityNotFound(_0xd18f1a,null))['then'](function(_0x541729){if(_0x541729){_0x5a8faa=_0x541729;_0x3a0e02[_0xd612('0x2d')]=_['keys'](db[_0xd612('0x64')][_0xd612('0x2c')]);_0x3a0e02[_0xd612('0x2f')]=_[_0xd612('0x2e')](_0xd44772[_0xd612('0x2f')]);_0x3a0e02['filters']=_[_0xd612('0x43')](_0x3a0e02[_0xd612('0x2d')],_0x3a0e02[_0xd612('0x2f')]);_0x267082[_0xd612('0x30')]=_['intersection'](_0x3a0e02[_0xd612('0x2d')],qs[_0xd612('0x31')](_0xd44772['query'][_0xd612('0x31')]));_0x267082[_0xd612('0x30')]=_0x267082[_0xd612('0x30')][_0xd612('0x32')]?_0x267082[_0xd612('0x30')]:_0x3a0e02['model'];_0x267082[_0xd612('0x57')]=qs[_0xd612('0x34')](_0xd44772[_0xd612('0x2f')][_0xd612('0x34')]);_0x267082['where']=qs['filters'](_[_0xd612('0x37')](_0xd44772[_0xd612('0x2f')],_0x3a0e02['filters']));if(_0xd44772[_0xd612('0x2f')][_0xd612('0x38')]){_0x267082[_0xd612('0x35')]=_[_0xd612('0x46')](_0x267082[_0xd612('0x35')],{'$or':_[_0xd612('0x39')](_0x267082[_0xd612('0x30')],function(_0xe4c063){var _0x59533d={};_0x59533d[_0xe4c063]={'$like':'%'+_0xd44772[_0xd612('0x2f')][_0xd612('0x38')]+'%'};return _0x59533d;})});}_0x267082=_['merge']({},_0x267082,_0xd44772[_0xd612('0x3c')]);return _0x5a8faa[_0xd612('0x63')](_0x267082);}})[_0xd612('0x25')](function(_0xe468ab){if(_0xe468ab){_0xb534a1=_0xe468ab['length'];if(!_0xd44772[_0xd612('0x2f')]['hasOwnProperty'](_0xd612('0x56'))){_0x267082[_0xd612('0x1f')]=qs[_0xd612('0x1f')](_0xd44772[_0xd612('0x2f')][_0xd612('0x1f')]);_0x267082[_0xd612('0x1e')]=qs['offset'](_0xd44772[_0xd612('0x2f')][_0xd612('0x1e')]);}return _0x5a8faa[_0xd612('0x63')](_0x267082);}})[_0xd612('0x25')](function(_0x3ac13d){if(_0x3ac13d){return _0x3ac13d?{'count':_0xb534a1,'rows':_0x3ac13d}:null;}})[_0xd612('0x25')](respondWithResult(_0xd18f1a,null))[_0xd612('0x40')](handleError(_0xd18f1a,null));};exports[_0xd612('0x65')]=function(_0x35b871,_0x1fa463,_0x1fb833){var _0x556123=_0x35b871[_0xd612('0x48')][_0xd612('0x66')];return db[_0xd612('0x64')][_0xd612('0x3e')]({'where':{'id':_[_0xd612('0x39')](_0x556123,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xd612('0x29'),_0xd612('0x67'),_0xd612('0x68'),'interface'],'raw':!![]}]})[_0xd612('0x25')](function(_0x5c923a){if(_0x5c923a){var _0x2e52b2=_[_0xd612('0x69')](_0x5c923a,function(_0x1bae33){var _0x280d7c=_0x1bae33[_0xd612('0x49')]({'plain':!![]});return _0x280d7c['Agents'];});return db[_0xd612('0x3d')][_0xd612('0x51')]({'where':{'id':_0x35b871['params']['id']}})[_0xd612('0x25')](function(_0x4073b7){return db['sequelize'][_0xd612('0x6a')](function(_0x6d4621){return _0x4073b7[_0xd612('0x65')](_[_0xd612('0x39')](_0x556123,'id'),{'transaction':_0x6d4621})[_0xd612('0x25')](function(){return BPromise[_0xd612('0x6b')](_0x2e52b2,function(_0xadebee){return db[_0xd612('0x55')][_0xd612('0x6c')]({'where':{'UserId':_0xadebee['id'],'FaxQueueId':_0x35b871[_0xd612('0x42')]['id']},'transaction':_0x6d4621});});})[_0xd612('0x25')](function(){_0x2e52b2[_0xd612('0x6d')](function(_0x32d0c1){socket[_0xd612('0x6e')]('userFaxQueue:save',{'UserId':_0x32d0c1['id'],'FaxQueueId':_0x4073b7['id']});});});});});}})['then'](respondWithStatusCode(_0x1fa463,null))['catch'](handleError(_0x1fa463,null));};exports[_0xd612('0x6f')]=function(_0x166682,_0x522551,_0x3de3e9){return db[_0xd612('0x64')][_0xd612('0x3e')]({'where':{'id':_0x166682['query'][_0xd612('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd612('0x71'),'attributes':['id'],'raw':!![]}]})[_0xd612('0x25')](handleEntityNotFound(_0x522551,null))['then'](function(_0x55ff49){var _0x3d4db2=_[_0xd612('0x39')](_0x55ff49,'id');var _0x2fd51f=[];var _0x5f1d48=[];var _0xa7ea69=squel['select']();_0xa7ea69[_0xd612('0x3b')](_0xd612('0x72'))['from'](_0xd612('0x73'),'tq')[_0xd612('0x74')](_0xd612('0x75'),'ut',_0xd612('0x76'))[_0xd612('0x35')](_0xd612('0x77'),_0x166682[_0xd612('0x42')]['id']);for(var _0x47c45f=0x0;_0x47c45f<_0x55ff49['length'];_0x47c45f+=0x1){let _0x178767=_0x55ff49[_0x47c45f];for(var _0x2c2ea2=0x0;_0x2c2ea2<_0x178767['Agents'][_0xd612('0x32')];_0x2c2ea2+=0x1){let _0x58b973=_0x178767[_0xd612('0x71')][_0x2c2ea2];var _0x1b0081=_0xa7ea69['clone']();_0x1b0081[_0xd612('0x35')](_0xd612('0x78'),_0x58b973['id']);_0x5f1d48[_0xd612('0x79')](db['sequelize'][_0xd612('0x2f')](_0x1b0081[_0xd612('0x7a')](),{'type':db[_0xd612('0x7b')][_0xd612('0x7c')][_0xd612('0x7d')]})[_0xd612('0x25')](function(_0x1b7094){if(_0x1b7094[_0xd612('0x32')]===0x1){return _0x58b973['id'];}else{var _0x5a62a8=_[_0xd612('0x7e')](_['map'](_0x1b7094,_0xd612('0x7f')),function(_0x217bb8){return _['includes'](_0x3d4db2,_0x217bb8);});if(_0x5a62a8){return _0x58b973['id'];}}}));}}return BPromise[_0xd612('0x80')](_0x5f1d48)[_0xd612('0x25')](function(_0x329fdf){_0x2fd51f=_(_0x2fd51f)[_0xd612('0x81')](_0x329fdf)[_0xd612('0x82')]()['value']();return db[_0xd612('0x3d')][_0xd612('0x51')]({'where':{'id':_0x166682[_0xd612('0x42')]['id']}})[_0xd612('0x25')](function(_0x3f85c4){return db[_0xd612('0x7b')][_0xd612('0x6a')](function(_0x3013a1){return _0x3f85c4[_0xd612('0x6f')](_0x166682['query'][_0xd612('0x70')],{'transaction':_0x3013a1})['then'](function(){if(!_[_0xd612('0x83')](_0x2fd51f)){return _0x3f85c4[_0xd612('0x84')](_0x2fd51f,{'transaction':_0x3013a1});}})[_0xd612('0x25')](function(){_0x2fd51f[_0xd612('0x6d')](function(_0x59a37d){socket[_0xd612('0x6e')](_0xd612('0x85'),{'UserId':_0x59a37d,'FaxQueueId':_0x3f85c4['id']});});});});});});})['then'](respondWithStatusCode(_0x522551,null))[_0xd612('0x40')](handleError(_0x522551,null));};exports[_0xd612('0x86')]=function(_0x6b9ba3,_0x5be988,_0x40a3c4){return db[_0xd612('0x3d')][_0xd612('0x51')]({'where':{'id':_0x6b9ba3[_0xd612('0x42')]['id']}})[_0xd612('0x25')](handleEntityNotFound(_0x5be988,null))[_0xd612('0x25')](function(_0xb4870b){if(_0xb4870b){return _0xb4870b[_0xd612('0x86')](_0x6b9ba3[_0xd612('0x48')]['ids'],_['omit'](_0x6b9ba3[_0xd612('0x48')],[_0xd612('0x70'),'id'])||{})['spread'](function(_0x183872){for(var _0x21ba9d=0x0;_0x21ba9d<_0x6b9ba3[_0xd612('0x48')]['ids']['length'];_0x21ba9d+=0x1){socket['emit'](_0xd612('0x87'),{'UserId':_0x6b9ba3[_0xd612('0x48')][_0xd612('0x70')][_0x21ba9d],'FaxQueueId':_0x6b9ba3[_0xd612('0x42')]['id']});}return _0x183872;});}})[_0xd612('0x25')](respondWithResult(_0x5be988,null))[_0xd612('0x40')](handleError(_0x5be988,null));};exports[_0xd612('0x84')]=function(_0x14e7c1,_0x16b3fa,_0x41e0ef){return db[_0xd612('0x3d')][_0xd612('0x51')]({'where':{'id':_0x14e7c1[_0xd612('0x42')]['id']}})['then'](handleEntityNotFound(_0x16b3fa,null))[_0xd612('0x25')](function(_0x58ce7c){if(_0x58ce7c){return _0x58ce7c[_0xd612('0x84')](_0x14e7c1[_0xd612('0x2f')]['ids'])['then'](function(){if(_[_0xd612('0x88')](_0x14e7c1['query'][_0xd612('0x70')])){for(var _0x446978=0x0;_0x446978<_0x14e7c1[_0xd612('0x2f')][_0xd612('0x70')]['length'];_0x446978+=0x1){socket['emit'](_0xd612('0x85'),{'UserId':Number(_0x14e7c1['query'][_0xd612('0x70')][_0x446978]),'FaxQueueId':Number(_0x14e7c1[_0xd612('0x42')]['id'])});}}else{socket[_0xd612('0x6e')](_0xd612('0x85'),{'UserId':Number(_0x14e7c1['query'][_0xd612('0x70')]),'FaxQueueId':Number(_0x14e7c1['params']['id'])});}});}})[_0xd612('0x25')](respondWithStatusCode(_0x16b3fa,null))[_0xd612('0x40')](handleError(_0x16b3fa,null));};exports[_0xd612('0x89')]=function(_0x133fd2,_0xca86fb,_0x5982fe){var _0xe60b06={};var _0x1f393a={};var _0x2e3d1e;var _0x897789;return db['FaxQueue'][_0xd612('0x54')]({'where':{'id':_0x133fd2[_0xd612('0x42')]['id']}})[_0xd612('0x25')](handleEntityNotFound(_0xca86fb,null))[_0xd612('0x25')](function(_0x44837f){if(_0x44837f){_0x2e3d1e=_0x44837f;_0x1f393a[_0xd612('0x2d')]=_[_0xd612('0x2e')](db['User'][_0xd612('0x2c')]);_0x1f393a['query']=_[_0xd612('0x2e')](_0x133fd2['query']);_0x1f393a[_0xd612('0x36')]=_[_0xd612('0x43')](_0x1f393a[_0xd612('0x2d')],_0x1f393a['query']);_0xe60b06[_0xd612('0x30')]=_[_0xd612('0x43')](_0x1f393a['model'],qs['fields'](_0x133fd2['query'][_0xd612('0x31')]));_0xe60b06[_0xd612('0x30')]=_0xe60b06[_0xd612('0x30')][_0xd612('0x32')]?_0xe60b06[_0xd612('0x30')]:_0x1f393a[_0xd612('0x2d')];_0xe60b06[_0xd612('0x57')]=qs[_0xd612('0x34')](_0x133fd2['query']['sort']);_0xe60b06['where']=qs[_0xd612('0x36')](_['pick'](_0x133fd2[_0xd612('0x2f')],_0x1f393a['filters']));if(_0x133fd2[_0xd612('0x2f')][_0xd612('0x38')]){_0xe60b06[_0xd612('0x35')]=_[_0xd612('0x46')](_0xe60b06[_0xd612('0x35')],{'$or':_[_0xd612('0x39')](_0xe60b06[_0xd612('0x30')],function(_0x553664){var _0x121e2c={};_0x121e2c[_0x553664]={'$like':'%'+_0x133fd2[_0xd612('0x2f')][_0xd612('0x38')]+'%'};return _0x121e2c;})});}_0xe60b06=_[_0xd612('0x46')]({},_0xe60b06,_0x133fd2[_0xd612('0x3c')]);return _0x2e3d1e[_0xd612('0x89')](_0xe60b06);}})[_0xd612('0x25')](function(_0x5c163a){if(_0x5c163a){_0x897789=_0x5c163a[_0xd612('0x32')];if(!_0x133fd2[_0xd612('0x2f')][_0xd612('0x33')](_0xd612('0x56'))){_0xe60b06[_0xd612('0x1f')]=qs['limit'](_0x133fd2[_0xd612('0x2f')][_0xd612('0x1f')]);_0xe60b06['offset']=qs[_0xd612('0x1e')](_0x133fd2['query'][_0xd612('0x1e')]);}return _0x2e3d1e[_0xd612('0x89')](_0xe60b06);}})[_0xd612('0x25')](function(_0x4d13b1){if(_0x4d13b1){return _0x4d13b1?{'count':_0x897789,'rows':_0x4d13b1}:null;}})[_0xd612('0x25')](respondWithResult(_0xca86fb,null))[_0xd612('0x40')](handleError(_0xca86fb,null));}; \ No newline at end of file +var _0xc68e=['VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserFaxQueue','pick','FaxQueueId','User','findAndCountAll','UserId','faxPause','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','teams','Agents','online','flatMap','sequelize','transaction','each','forEach','userFaxQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userFaxQueue:remove','omit','isArray','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./faxQueue.socket','register','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','error','stack','name','index','FaxQueue','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','map','key'];(function(_0x1a660d,_0x182bba){var _0x3c1a19=function(_0x49f149){while(--_0x49f149){_0x1a660d['push'](_0x1a660d['shift']());}};_0x3c1a19(++_0x182bba);}(_0xc68e,0x1e4));var _0xec68=function(_0x2853f6,_0x328b27){_0x2853f6=_0x2853f6-0x0;var _0x44150c=_0xc68e[_0x2853f6];return _0x44150c;};'use strict';var pdf=require(_0xec68('0x0'));var emlformat=require(_0xec68('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xec68('0x2'));var jsonpatch=require(_0xec68('0x3'));var rp=require('request-promise');var moment=require(_0xec68('0x4'));var BPromise=require(_0xec68('0x5'));var Mustache=require(_0xec68('0x6'));var util=require('util');var path=require(_0xec68('0x7'));var sox=require('sox');var csv=require(_0xec68('0x8'));var ejs=require(_0xec68('0x9'));var fs=require('fs');var _=require(_0xec68('0xa'));var squel=require(_0xec68('0xb'));var crypto=require('crypto');var jsforce=require(_0xec68('0xc'));var deskjs=require(_0xec68('0xd'));var toCsv=require(_0xec68('0x8'));var querystring=require(_0xec68('0xe'));var Papa=require(_0xec68('0xf'));var Redis=require(_0xec68('0x10'));var authService=require(_0xec68('0x11'));var qs=require(_0xec68('0x12'));var hardwareService=require(_0xec68('0x13'));var logger=require(_0xec68('0x14'))('api');var utils=require(_0xec68('0x15'));var config=require(_0xec68('0x16'));var db=require(_0xec68('0x17'))['db'];config['redis']=_[_0xec68('0x18')](config[_0xec68('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xec68('0x19')]));require(_0xec68('0x1a'))[_0xec68('0x1b')](socket);function respondWithStatusCode(_0xb991fd,_0x48b525){_0x48b525=_0x48b525||0xcc;return function(_0x476e6c){if(_0x476e6c){return _0xb991fd['sendStatus'](_0x48b525);}return _0xb991fd[_0xec68('0x1c')](_0x48b525)[_0xec68('0x1d')]();};}function respondWithResult(_0x386123,_0x8182d4){_0x8182d4=_0x8182d4||0xc8;return function(_0x53add2){if(_0x53add2){return _0x386123[_0xec68('0x1c')](_0x8182d4)[_0xec68('0x1e')](_0x53add2);}};}function respondWithFilteredResult(_0x19cd25,_0x395eae){return function(_0x439e91){if(_0x439e91){var _0x4d55c1=_0x439e91[_0xec68('0x1f')],_0x4a70d2=_0x395eae[_0xec68('0x20')],_0x389c80=_0x395eae[_0xec68('0x20')]+_0x395eae['limit'],_0x5e46b5;if(_0x389c80>=_0x4d55c1){_0x389c80=_0x4d55c1;_0x5e46b5=0xc8;}else{_0x5e46b5=0xce;}_0x19cd25[_0xec68('0x1c')](_0x5e46b5);return _0x19cd25[_0xec68('0x21')](_0xec68('0x22'),_0x4a70d2+'-'+_0x389c80+'/'+_0x4d55c1)[_0xec68('0x1e')](_0x439e91);}return null;};}function patchUpdates(_0x28b57a){return function(_0x5b636f){try{jsonpatch[_0xec68('0x23')](_0x5b636f,_0x28b57a,!![]);}catch(_0x58f94d){return BPromise[_0xec68('0x24')](_0x58f94d);}return _0x5b636f[_0xec68('0x25')]();};}function saveUpdates(_0x273f14,_0x17ccc9){return function(_0x52b9e3){if(_0x52b9e3){return _0x52b9e3[_0xec68('0x26')](_0x273f14)[_0xec68('0x27')](function(_0x38f88b){return _0x38f88b;});}return null;};}function removeEntity(_0x5b6c9b,_0x9e757c){return function(_0x1068d3){if(_0x1068d3){return _0x1068d3[_0xec68('0x28')]()[_0xec68('0x27')](function(){var _0x49baac=_0x1068d3[_0xec68('0x29')]({'plain':!![]});var _0xf25f19=_0xec68('0x2a');return db[_0xec68('0x2b')]['destroy']({'where':{'type':_0xf25f19,'resourceId':_0x49baac['id']}})[_0xec68('0x27')](function(){return _0x1068d3;});})[_0xec68('0x27')](function(){_0x5b6c9b['status'](0xcc)[_0xec68('0x1d')]();});}};}function handleEntityNotFound(_0x300ae7,_0xf42fb4){return function(_0x2354dc){if(!_0x2354dc){_0x300ae7[_0xec68('0x2c')](0x194);}return _0x2354dc;};}function handleError(_0x9f6d96,_0x566919){_0x566919=_0x566919||0x1f4;return function(_0x45c72d){logger[_0xec68('0x2d')](_0x45c72d[_0xec68('0x2e')]);if(_0x45c72d[_0xec68('0x2f')]){delete _0x45c72d['name'];}_0x9f6d96[_0xec68('0x1c')](_0x566919)['send'](_0x45c72d);};}exports[_0xec68('0x30')]=function(_0x15dab7,_0x1134c0){var _0x462fec={},_0xe334fb={},_0xd13c45={'count':0x0,'rows':[]};var _0xb54e05=db[_0xec68('0x31')][_0xec68('0x32')];_0xe334fb[_0xec68('0x33')]=_[_0xec68('0x34')](_0xb54e05);_0xe334fb[_0xec68('0x35')]=_['keys'](_0x15dab7['query']);_0xe334fb[_0xec68('0x36')]=_[_0xec68('0x37')](_0xe334fb['model'],_0xe334fb[_0xec68('0x35')]);_0x462fec[_0xec68('0x38')]=_[_0xec68('0x37')](_0xe334fb[_0xec68('0x33')],qs['fields'](_0x15dab7['query']['fields']));_0x462fec['attributes']=_0x462fec[_0xec68('0x38')][_0xec68('0x39')]?_0x462fec[_0xec68('0x38')]:_0xe334fb[_0xec68('0x33')];if(!_0x15dab7[_0xec68('0x35')][_0xec68('0x3a')](_0xec68('0x3b'))){_0x462fec[_0xec68('0x3c')]=qs['limit'](_0x15dab7[_0xec68('0x35')]['limit']);_0x462fec['offset']=qs['offset'](_0x15dab7['query'][_0xec68('0x20')]);}_0x462fec[_0xec68('0x3d')]=qs[_0xec68('0x3e')](_0x15dab7[_0xec68('0x35')][_0xec68('0x3e')]);_0x462fec['where']=qs[_0xec68('0x36')](_['pick'](_0x15dab7[_0xec68('0x35')],_0xe334fb[_0xec68('0x36')]));if(_0x15dab7[_0xec68('0x35')][_0xec68('0x3f')]){_0x462fec[_0xec68('0x40')]=_[_0xec68('0x41')](_0x462fec[_0xec68('0x40')],{'$or':_[_0xec68('0x42')](_0xb54e05,function(_0xff3712){if(_0xff3712['type'][_0xec68('0x43')]!==_0xec68('0x44')){var _0x20397c={};_0x20397c[_0xff3712[_0xec68('0x45')]]={'$like':'%'+_0x15dab7['query'][_0xec68('0x3f')]+'%'};return _0x20397c;}})});}_0x462fec=_['merge']({},_0x462fec,_0x15dab7[_0xec68('0x46')]);var _0x124888={'where':_0x462fec['where']};return db[_0xec68('0x31')][_0xec68('0x1f')](_0x124888)[_0xec68('0x27')](function(_0x2e1382){_0xd13c45[_0xec68('0x1f')]=_0x2e1382;if(_0x15dab7['query'][_0xec68('0x47')]){_0x462fec[_0xec68('0x48')]=[{'all':!![]}];}return db[_0xec68('0x31')][_0xec68('0x49')](_0x462fec);})[_0xec68('0x27')](function(_0x2941cb){_0xd13c45[_0xec68('0x4a')]=_0x2941cb;return _0xd13c45;})[_0xec68('0x27')](respondWithFilteredResult(_0x1134c0,_0x462fec))[_0xec68('0x4b')](handleError(_0x1134c0,null));};exports[_0xec68('0x4c')]=function(_0x23df36,_0x4d1847){var _0x58e5ff={'raw':!![],'where':{'id':_0x23df36[_0xec68('0x4d')]['id']}},_0x503254={};_0x503254[_0xec68('0x33')]=_[_0xec68('0x34')](db[_0xec68('0x31')][_0xec68('0x32')]);_0x503254[_0xec68('0x35')]=_['keys'](_0x23df36[_0xec68('0x35')]);_0x503254[_0xec68('0x36')]=_[_0xec68('0x37')](_0x503254['model'],_0x503254[_0xec68('0x35')]);_0x58e5ff[_0xec68('0x38')]=_[_0xec68('0x37')](_0x503254[_0xec68('0x33')],qs[_0xec68('0x4e')](_0x23df36['query']['fields']));_0x58e5ff['attributes']=_0x58e5ff[_0xec68('0x38')]['length']?_0x58e5ff['attributes']:_0x503254['model'];if(_0x23df36[_0xec68('0x35')][_0xec68('0x47')]){_0x58e5ff[_0xec68('0x48')]=[{'all':!![]}];}_0x58e5ff=_[_0xec68('0x41')]({},_0x58e5ff,_0x23df36['options']);return db[_0xec68('0x31')][_0xec68('0x4f')](_0x58e5ff)[_0xec68('0x27')](handleEntityNotFound(_0x4d1847,null))[_0xec68('0x27')](respondWithResult(_0x4d1847,null))['catch'](handleError(_0x4d1847,null));};exports[_0xec68('0x50')]=function(_0xf55e02,_0x3fa90b){return db['FaxQueue'][_0xec68('0x50')](_0xf55e02['body'],{})[_0xec68('0x27')](function(_0x5f090b){var _0x1a23c7=_0xf55e02[_0xec68('0x51')][_0xec68('0x29')]({'plain':!![]});if(!_0x1a23c7)throw new Error(_0xec68('0x52'));if(_0x1a23c7[_0xec68('0x53')]===_0xec68('0x51')){var _0x16d042=_0x5f090b[_0xec68('0x29')]({'plain':!![]});var _0x4c1f8c=_0xec68('0x2a');return db[_0xec68('0x54')][_0xec68('0x4f')]({'where':{'name':_0x4c1f8c,'userProfileId':_0x1a23c7[_0xec68('0x55')]},'raw':!![]})[_0xec68('0x27')](function(_0x38ca09){if(_0x38ca09&&_0x38ca09['autoAssociation']===0x0){return db[_0xec68('0x2b')][_0xec68('0x50')]({'name':_0x16d042['name'],'resourceId':_0x16d042['id'],'type':_0x38ca09[_0xec68('0x2f')],'sectionId':_0x38ca09['id']},{})[_0xec68('0x27')](function(){return _0x5f090b;});}else{return _0x5f090b;}})[_0xec68('0x4b')](function(_0x37112c){logger[_0xec68('0x2d')](_0xec68('0x56'),_0x37112c);throw _0x37112c;});}return _0x5f090b;})[_0xec68('0x27')](respondWithResult(_0x3fa90b,0xc9))[_0xec68('0x4b')](handleError(_0x3fa90b,null));};exports[_0xec68('0x26')]=function(_0x3654b8,_0x5bbad5){if(_0x3654b8[_0xec68('0x57')]['id']){delete _0x3654b8[_0xec68('0x57')]['id'];}return db[_0xec68('0x31')][_0xec68('0x4f')]({'where':{'id':_0x3654b8[_0xec68('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5bbad5,null))['then'](saveUpdates(_0x3654b8[_0xec68('0x57')],null))[_0xec68('0x27')](respondWithResult(_0x5bbad5,null))['catch'](handleError(_0x5bbad5,null));};exports[_0xec68('0x28')]=function(_0x25ac2e,_0x56e666){return db['FaxQueue']['find']({'where':{'id':_0x25ac2e[_0xec68('0x4d')]['id']}})[_0xec68('0x27')](handleEntityNotFound(_0x56e666,null))['then'](removeEntity(_0x56e666,null))[_0xec68('0x4b')](handleError(_0x56e666,null));};exports[_0xec68('0x58')]=function(_0x17c9a2,_0x2a9146){return db[_0xec68('0x31')][_0xec68('0x58')]()[_0xec68('0x27')](respondWithResult(_0x2a9146,null))['catch'](handleError(_0x2a9146,null));};exports[_0xec68('0x59')]=function(_0x5b366f,_0xba781d,_0xc8f3b0){var _0x32be2f={'raw':!![],'where':{}},_0xd1f1c3={},_0x5193e9;return db[_0xec68('0x31')][_0xec68('0x5a')]({'where':{'id':_0x5b366f[_0xec68('0x4d')]['id']}})[_0xec68('0x27')](handleEntityNotFound(_0xba781d,null))[_0xec68('0x27')](function(_0x586fab){if(_0x586fab){_0x5193e9=_0x586fab['get']({'plain':!![]});_0xd1f1c3['model']=_[_0xec68('0x34')](db[_0xec68('0x5b')][_0xec68('0x32')]);_0xd1f1c3['query']=_['keys'](_0x5b366f[_0xec68('0x35')]);_0xd1f1c3[_0xec68('0x36')]=_['intersection'](_0xd1f1c3[_0xec68('0x33')],_0xd1f1c3[_0xec68('0x35')]);_0x32be2f[_0xec68('0x38')]=_['intersection'](_0xd1f1c3[_0xec68('0x33')],qs[_0xec68('0x4e')](_0x5b366f[_0xec68('0x35')][_0xec68('0x4e')]));_0x32be2f['attributes']=_0x32be2f[_0xec68('0x38')]['length']?_0x32be2f['attributes']:_0xd1f1c3[_0xec68('0x33')];if(!_0x5b366f[_0xec68('0x35')][_0xec68('0x3a')](_0xec68('0x3b'))){_0x32be2f['limit']=qs['limit'](_0x5b366f[_0xec68('0x35')][_0xec68('0x3c')]);_0x32be2f[_0xec68('0x20')]=qs[_0xec68('0x20')](_0x5b366f['query'][_0xec68('0x20')]);}_0x32be2f[_0xec68('0x3d')]=qs[_0xec68('0x3e')](_0x5b366f[_0xec68('0x35')]['sort']);_0x32be2f[_0xec68('0x40')]=qs[_0xec68('0x36')](_[_0xec68('0x5c')](_0x5b366f[_0xec68('0x35')],_0xd1f1c3[_0xec68('0x36')]));_0x32be2f['where'][_0xec68('0x5d')]=_0x586fab['id'];if(_0x5b366f[_0xec68('0x35')][_0xec68('0x3f')]){_0x32be2f[_0xec68('0x40')]=_[_0xec68('0x41')](_0x32be2f[_0xec68('0x40')],{'$or':_[_0xec68('0x42')](_0x32be2f[_0xec68('0x38')],function(_0x4f0dd9){var _0x5e0bfb={};_0x5e0bfb[_0x4f0dd9]={'$like':'%'+_0x5b366f[_0xec68('0x35')][_0xec68('0x3f')]+'%'};return _0x5e0bfb;})});}_0x32be2f=_['merge']({},_0x32be2f,_0x5b366f[_0xec68('0x46')]);return db[_0xec68('0x5b')][_0xec68('0x49')](_0x32be2f);}})[_0xec68('0x27')](function(_0x39e220){if(_0x39e220){return db[_0xec68('0x5e')][_0xec68('0x5f')]({'where':{'id':_[_0xec68('0x42')](_0x39e220,_0xec68('0x60')),'role':'agent'},'attributes':['id',_0xec68('0x2f'),_0xec68('0x61'),'updatedAt',_0xec68('0x62')]});}})['then'](function(_0xf0b9b5){if(_0xf0b9b5){return{'count':_0xf0b9b5[_0xec68('0x1f')],'rows':_[_0xec68('0x42')](_0xf0b9b5['rows'],function(_0x4b733c){return{'membername':_0x4b733c[_0xec68('0x2f')],'UserId':_0x4b733c['id'],'queue_name':_0x5193e9[_0xec68('0x2f')],'FaxQueueId':_0x5193e9['id'],'interface':util[_0xec68('0x63')](_0xec68('0x64'),_0xec68('0x65'),_0x4b733c[_0xec68('0x2f')]),'penalty':0x0,'paused':_0x4b733c[_0xec68('0x61')],'createdAt':_0x4b733c[_0xec68('0x62')],'updatedAt':_0x4b733c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xba781d,_0x32be2f))[_0xec68('0x4b')](handleError(_0xba781d,null));};exports[_0xec68('0x66')]=function(_0x127f2d,_0x4b1765,_0x514234){var _0x50cce8={};var _0x1cf829={};var _0x5ec18a;var _0x3501c0;return db['FaxQueue']['findOne']({'where':{'id':_0x127f2d['params']['id']}})[_0xec68('0x27')](handleEntityNotFound(_0x4b1765,null))[_0xec68('0x27')](function(_0x30f8c2){if(_0x30f8c2){_0x5ec18a=_0x30f8c2;_0x1cf829['model']=_[_0xec68('0x34')](db[_0xec68('0x67')][_0xec68('0x32')]);_0x1cf829[_0xec68('0x35')]=_[_0xec68('0x34')](_0x127f2d[_0xec68('0x35')]);_0x1cf829[_0xec68('0x36')]=_['intersection'](_0x1cf829[_0xec68('0x33')],_0x1cf829['query']);_0x50cce8[_0xec68('0x38')]=_[_0xec68('0x37')](_0x1cf829[_0xec68('0x33')],qs[_0xec68('0x4e')](_0x127f2d[_0xec68('0x35')][_0xec68('0x4e')]));_0x50cce8[_0xec68('0x38')]=_0x50cce8[_0xec68('0x38')]['length']?_0x50cce8[_0xec68('0x38')]:_0x1cf829[_0xec68('0x33')];_0x50cce8[_0xec68('0x3d')]=qs[_0xec68('0x3e')](_0x127f2d['query'][_0xec68('0x3e')]);_0x50cce8[_0xec68('0x40')]=qs[_0xec68('0x36')](_['pick'](_0x127f2d['query'],_0x1cf829[_0xec68('0x36')]));if(_0x127f2d['query']['filter']){_0x50cce8['where']=_[_0xec68('0x41')](_0x50cce8[_0xec68('0x40')],{'$or':_[_0xec68('0x42')](_0x50cce8[_0xec68('0x38')],function(_0x51cf7e){var _0x565bc9={};_0x565bc9[_0x51cf7e]={'$like':'%'+_0x127f2d[_0xec68('0x35')][_0xec68('0x3f')]+'%'};return _0x565bc9;})});}_0x50cce8=_[_0xec68('0x41')]({},_0x50cce8,_0x127f2d[_0xec68('0x46')]);return _0x5ec18a[_0xec68('0x66')](_0x50cce8);}})[_0xec68('0x27')](function(_0x19a5f5){if(_0x19a5f5){_0x3501c0=_0x19a5f5[_0xec68('0x39')];if(!_0x127f2d[_0xec68('0x35')][_0xec68('0x3a')](_0xec68('0x3b'))){_0x50cce8[_0xec68('0x3c')]=qs[_0xec68('0x3c')](_0x127f2d[_0xec68('0x35')][_0xec68('0x3c')]);_0x50cce8[_0xec68('0x20')]=qs[_0xec68('0x20')](_0x127f2d[_0xec68('0x35')]['offset']);}return _0x5ec18a[_0xec68('0x66')](_0x50cce8);}})[_0xec68('0x27')](function(_0x1ccb40){if(_0x1ccb40){return _0x1ccb40?{'count':_0x3501c0,'rows':_0x1ccb40}:null;}})[_0xec68('0x27')](respondWithResult(_0x4b1765,null))[_0xec68('0x4b')](handleError(_0x4b1765,null));};exports[_0xec68('0x68')]=function(_0x3b6ccd,_0x1ca552,_0x19ca9b){var _0x467b33=_0x3b6ccd['body'][_0xec68('0x69')];return db['Team'][_0xec68('0x49')]({'where':{'id':_[_0xec68('0x42')](_0x467b33,'id')},'attributes':['id'],'include':[{'model':db[_0xec68('0x5e')],'as':_0xec68('0x6a'),'attributes':['id',_0xec68('0x2f'),_0xec68('0x6b'),'voicePause','interface'],'raw':!![]}]})[_0xec68('0x27')](function(_0x538762){if(_0x538762){var _0x5d4859=_[_0xec68('0x6c')](_0x538762,function(_0x13a1e6){var _0x58b314=_0x13a1e6[_0xec68('0x29')]({'plain':!![]});return _0x58b314[_0xec68('0x6a')];});return db[_0xec68('0x31')]['find']({'where':{'id':_0x3b6ccd[_0xec68('0x4d')]['id']}})[_0xec68('0x27')](function(_0x48f73c){return db[_0xec68('0x6d')][_0xec68('0x6e')](function(_0x24063a){return _0x48f73c[_0xec68('0x68')](_['map'](_0x467b33,'id'),{'transaction':_0x24063a})[_0xec68('0x27')](function(){return BPromise[_0xec68('0x6f')](_0x5d4859,function(_0x206ab6){return db[_0xec68('0x5b')]['findOrCreate']({'where':{'UserId':_0x206ab6['id'],'FaxQueueId':_0x3b6ccd['params']['id']},'transaction':_0x24063a});});})[_0xec68('0x27')](function(){_0x5d4859[_0xec68('0x70')](function(_0x4c2ca5){socket['emit'](_0xec68('0x71'),{'UserId':_0x4c2ca5['id'],'FaxQueueId':_0x48f73c['id']});});});});});}})[_0xec68('0x27')](respondWithStatusCode(_0x1ca552,null))[_0xec68('0x4b')](handleError(_0x1ca552,null));};exports[_0xec68('0x72')]=function(_0xa2a543,_0x54ed3a,_0xddbf74){return db[_0xec68('0x67')][_0xec68('0x49')]({'where':{'id':_0xa2a543[_0xec68('0x35')][_0xec68('0x73')]},'attributes':['id'],'include':[{'model':db[_0xec68('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xec68('0x27')](handleEntityNotFound(_0x54ed3a,null))['then'](function(_0x3c5db2){var _0x18a47c=_[_0xec68('0x42')](_0x3c5db2,'id');var _0x8c9108=[];var _0x827a42=[];var _0x2e9ec2=squel[_0xec68('0x74')]();_0x2e9ec2[_0xec68('0x45')](_0xec68('0x75'))[_0xec68('0x76')](_0xec68('0x77'),'tq')['join'](_0xec68('0x78'),'ut',_0xec68('0x79'))[_0xec68('0x40')]('FaxQueueId\x20=\x20?',_0xa2a543[_0xec68('0x4d')]['id']);for(var _0x17496c=0x0;_0x17496c<_0x3c5db2[_0xec68('0x39')];_0x17496c+=0x1){let _0x545929=_0x3c5db2[_0x17496c];for(var _0x1ae7cf=0x0;_0x1ae7cf<_0x545929[_0xec68('0x6a')]['length'];_0x1ae7cf+=0x1){let _0x2d7dfd=_0x545929[_0xec68('0x6a')][_0x1ae7cf];var _0x56949f=_0x2e9ec2['clone']();_0x56949f['where'](_0xec68('0x7a'),_0x2d7dfd['id']);_0x827a42['push'](db[_0xec68('0x6d')][_0xec68('0x35')](_0x56949f['toString'](),{'type':db[_0xec68('0x6d')][_0xec68('0x7b')][_0xec68('0x7c')]})[_0xec68('0x27')](function(_0x332674){if(_0x332674[_0xec68('0x39')]===0x1){return _0x2d7dfd['id'];}else{var _0x35da95=_['every'](_[_0xec68('0x42')](_0x332674,_0xec68('0x7d')),function(_0x51b940){return _[_0xec68('0x7e')](_0x18a47c,_0x51b940);});if(_0x35da95){return _0x2d7dfd['id'];}}}));}}return BPromise[_0xec68('0x7f')](_0x827a42)['then'](function(_0x3e4cf6){_0x8c9108=_(_0x8c9108)[_0xec68('0x80')](_0x3e4cf6)[_0xec68('0x81')]()[_0xec68('0x82')]();return db['FaxQueue'][_0xec68('0x4f')]({'where':{'id':_0xa2a543[_0xec68('0x4d')]['id']}})[_0xec68('0x27')](function(_0x4b41c4){return db['sequelize'][_0xec68('0x6e')](function(_0x4edc75){return _0x4b41c4[_0xec68('0x72')](_0xa2a543[_0xec68('0x35')]['ids'],{'transaction':_0x4edc75})[_0xec68('0x27')](function(){if(!_[_0xec68('0x83')](_0x8c9108)){return _0x4b41c4[_0xec68('0x84')](_0x8c9108,{'transaction':_0x4edc75});}})[_0xec68('0x27')](function(){_0x8c9108[_0xec68('0x70')](function(_0x416964){socket[_0xec68('0x85')](_0xec68('0x86'),{'UserId':_0x416964,'FaxQueueId':_0x4b41c4['id']});});});});});});})[_0xec68('0x27')](respondWithStatusCode(_0x54ed3a,null))[_0xec68('0x4b')](handleError(_0x54ed3a,null));};exports['addAgents']=function(_0x39fa7c,_0x4f03d6,_0x543390){return db[_0xec68('0x31')]['find']({'where':{'id':_0x39fa7c[_0xec68('0x4d')]['id']}})[_0xec68('0x27')](handleEntityNotFound(_0x4f03d6,null))[_0xec68('0x27')](function(_0x3be8a3){if(_0x3be8a3){return _0x3be8a3['addAgents'](_0x39fa7c[_0xec68('0x57')][_0xec68('0x73')],_[_0xec68('0x87')](_0x39fa7c[_0xec68('0x57')],[_0xec68('0x73'),'id'])||{})['spread'](function(_0x3edfb6){for(var _0x3c3b34=0x0;_0x3c3b34<_0x39fa7c[_0xec68('0x57')][_0xec68('0x73')][_0xec68('0x39')];_0x3c3b34+=0x1){socket[_0xec68('0x85')](_0xec68('0x71'),{'UserId':_0x39fa7c[_0xec68('0x57')][_0xec68('0x73')][_0x3c3b34],'FaxQueueId':_0x39fa7c[_0xec68('0x4d')]['id']});}return _0x3edfb6;});}})[_0xec68('0x27')](respondWithResult(_0x4f03d6,null))['catch'](handleError(_0x4f03d6,null));};exports['removeAgents']=function(_0x304246,_0x477cde,_0x34bd16){return db[_0xec68('0x31')]['find']({'where':{'id':_0x304246[_0xec68('0x4d')]['id']}})[_0xec68('0x27')](handleEntityNotFound(_0x477cde,null))['then'](function(_0x4d1a26){if(_0x4d1a26){return _0x4d1a26['removeAgents'](_0x304246['query']['ids'])['then'](function(){if(_[_0xec68('0x88')](_0x304246['query'][_0xec68('0x73')])){for(var _0x5d92d3=0x0;_0x5d92d3<_0x304246['query'][_0xec68('0x73')][_0xec68('0x39')];_0x5d92d3+=0x1){socket[_0xec68('0x85')]('userFaxQueue:remove',{'UserId':Number(_0x304246[_0xec68('0x35')][_0xec68('0x73')][_0x5d92d3]),'FaxQueueId':Number(_0x304246[_0xec68('0x4d')]['id'])});}}else{socket[_0xec68('0x85')]('userFaxQueue:remove',{'UserId':Number(_0x304246[_0xec68('0x35')][_0xec68('0x73')]),'FaxQueueId':Number(_0x304246[_0xec68('0x4d')]['id'])});}});}})[_0xec68('0x27')](respondWithStatusCode(_0x477cde,null))[_0xec68('0x4b')](handleError(_0x477cde,null));};exports[_0xec68('0x89')]=function(_0x338003,_0x40f420,_0xead4dd){var _0x5202ca={};var _0x27c4c6={};var _0x38de00;var _0x11cf61;return db[_0xec68('0x31')][_0xec68('0x5a')]({'where':{'id':_0x338003[_0xec68('0x4d')]['id']}})[_0xec68('0x27')](handleEntityNotFound(_0x40f420,null))[_0xec68('0x27')](function(_0x38b559){if(_0x38b559){_0x38de00=_0x38b559;_0x27c4c6[_0xec68('0x33')]=_[_0xec68('0x34')](db[_0xec68('0x5e')][_0xec68('0x32')]);_0x27c4c6[_0xec68('0x35')]=_['keys'](_0x338003['query']);_0x27c4c6[_0xec68('0x36')]=_[_0xec68('0x37')](_0x27c4c6[_0xec68('0x33')],_0x27c4c6[_0xec68('0x35')]);_0x5202ca[_0xec68('0x38')]=_[_0xec68('0x37')](_0x27c4c6[_0xec68('0x33')],qs['fields'](_0x338003[_0xec68('0x35')]['fields']));_0x5202ca[_0xec68('0x38')]=_0x5202ca[_0xec68('0x38')][_0xec68('0x39')]?_0x5202ca[_0xec68('0x38')]:_0x27c4c6[_0xec68('0x33')];_0x5202ca[_0xec68('0x3d')]=qs[_0xec68('0x3e')](_0x338003['query'][_0xec68('0x3e')]);_0x5202ca[_0xec68('0x40')]=qs[_0xec68('0x36')](_[_0xec68('0x5c')](_0x338003[_0xec68('0x35')],_0x27c4c6['filters']));if(_0x338003[_0xec68('0x35')][_0xec68('0x3f')]){_0x5202ca['where']=_[_0xec68('0x41')](_0x5202ca[_0xec68('0x40')],{'$or':_[_0xec68('0x42')](_0x5202ca[_0xec68('0x38')],function(_0x94e25e){var _0x4a9e32={};_0x4a9e32[_0x94e25e]={'$like':'%'+_0x338003[_0xec68('0x35')][_0xec68('0x3f')]+'%'};return _0x4a9e32;})});}_0x5202ca=_[_0xec68('0x41')]({},_0x5202ca,_0x338003['options']);return _0x38de00[_0xec68('0x89')](_0x5202ca);}})[_0xec68('0x27')](function(_0x1828c8){if(_0x1828c8){_0x11cf61=_0x1828c8['length'];if(!_0x338003[_0xec68('0x35')]['hasOwnProperty'](_0xec68('0x3b'))){_0x5202ca['limit']=qs[_0xec68('0x3c')](_0x338003[_0xec68('0x35')][_0xec68('0x3c')]);_0x5202ca['offset']=qs[_0xec68('0x20')](_0x338003[_0xec68('0x35')][_0xec68('0x20')]);}return _0x38de00[_0xec68('0x89')](_0x5202ca);}})[_0xec68('0x27')](function(_0x2c9b2b){if(_0x2c9b2b){return _0x2c9b2b?{'count':_0x11cf61,'rows':_0x2c9b2b}:null;}})[_0xec68('0x27')](respondWithResult(_0x40f420,null))[_0xec68('0x4b')](handleError(_0x40f420,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 8cfbe82..2b2607a 100644 --- a/server/api/faxQueue/faxQueue.events.js +++ b/server/api/faxQueue/faxQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30d5=['save','remove','emit','hook','exports','events','FaxQueue','setMaxListeners'];(function(_0x49a769,_0x362ec3){var _0x29a460=function(_0x366e9b){while(--_0x366e9b){_0x49a769['push'](_0x49a769['shift']());}};_0x29a460(++_0x362ec3);}(_0x30d5,0x6d));var _0x530d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x30d5[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x530d('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x530d('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x530d('0x2')](0x0);var events={'afterCreate':_0x530d('0x3'),'afterUpdate':'update','afterDestroy':_0x530d('0x4')};function emitEvent(_0x62f58){return function(_0x295ab9,_0x120d82,_0x2c2942){FaxQueueEvents[_0x530d('0x5')](_0x62f58+':'+_0x295ab9['id'],_0x295ab9);FaxQueueEvents[_0x530d('0x5')](_0x62f58,_0x295ab9);_0x2c2942(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x530d('0x6')](e,emitEvent(event));}}module[_0x530d('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x0efb=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x0efb,0x109));var _0xb0ef=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x0efb[_0x53cf8e];return _0x459197;};'use strict';var EventEmitter=require(_0xb0ef('0x0'));var FaxQueue=require(_0xb0ef('0x1'))['db'][_0xb0ef('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xb0ef('0x3')](0x0);var events={'afterCreate':_0xb0ef('0x4'),'afterUpdate':_0xb0ef('0x5'),'afterDestroy':'remove'};function emitEvent(_0x544b87){return function(_0x429827,_0x25ed2b,_0x89045b){FaxQueueEvents['emit'](_0x544b87+':'+_0x429827['id'],_0x429827);FaxQueueEvents[_0xb0ef('0x6')](_0x544b87,_0x429827);_0x89045b(null);};}for(var e in events){if(events[_0xb0ef('0x7')](e)){var event=events[e];FaxQueue[_0xb0ef('0x8')](e,emitEvent(event));}}module[_0xb0ef('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 23a134e..ff3c12d 100644 --- a/server/api/faxQueue/faxQueue.model.js +++ b/server/api/faxQueue/faxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f11=['path','rimraf','./faxQueue.attributes','exports','define','FaxQueue','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x31f027,_0x2276ea){var _0x53a600=function(_0x1f7644){while(--_0x1f7644){_0x31f027['push'](_0x31f027['shift']());}};_0x53a600(++_0x2276ea);}(_0x4f11,0x162));var _0x14f1=function(_0x588ccf,_0x355553){_0x588ccf=_0x588ccf-0x0;var _0x11761d=_0x4f11[_0x588ccf];return _0x11761d;};'use strict';var _=require(_0x14f1('0x0'));var util=require('util');var logger=require(_0x14f1('0x1'))(_0x14f1('0x2'));var moment=require(_0x14f1('0x3'));var BPromise=require(_0x14f1('0x4'));var rp=require(_0x14f1('0x5'));var fs=require('fs');var path=require(_0x14f1('0x6'));var rimraf=require(_0x14f1('0x7'));var config=require('../../config/environment');var attributes=require(_0x14f1('0x8'));module[_0x14f1('0x9')]=function(_0x1bcdf2,_0x35d203){return _0x1bcdf2[_0x14f1('0xa')](_0x14f1('0xb'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59ac=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','../../config/logger','api','request-promise'];(function(_0x15a2db,_0x401e43){var _0x2b0ba3=function(_0x1953bd){while(--_0x1953bd){_0x15a2db['push'](_0x15a2db['shift']());}};_0x2b0ba3(++_0x401e43);}(_0x59ac,0xa4));var _0xc59a=function(_0x2c416a,_0x732630){_0x2c416a=_0x2c416a-0x0;var _0x4218d5=_0x59ac[_0x2c416a];return _0x4218d5;};'use strict';var _=require(_0xc59a('0x0'));var util=require('util');var logger=require(_0xc59a('0x1'))(_0xc59a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc59a('0x3'));var fs=require('fs');var path=require(_0xc59a('0x4'));var rimraf=require(_0xc59a('0x5'));var config=require(_0xc59a('0x6'));var attributes=require(_0xc59a('0x7'));module[_0xc59a('0x8')]=function(_0x3e0cca,_0x5676cf){return _0x3e0cca[_0xc59a('0x9')](_0xc59a('0xa'),attributes,{'tableName':_0xc59a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index f097696..9e32851 100644 --- a/server/api/faxQueue/faxQueue.rpc.js +++ b/server/api/faxQueue/faxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bd5=['map','debug','find','ShowFaxQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','options','raw','attributes','include','model'];(function(_0x549917,_0x4ffe64){var _0x25a6c6=function(_0xb44a74){while(--_0xb44a74){_0x549917['push'](_0x549917['shift']());}};_0x25a6c6(++_0x4ffe64);}(_0x4bd5,0x79));var _0x54bd=function(_0x460666,_0x24bfa0){_0x460666=_0x460666-0x0;var _0x555cbf=_0x4bd5[_0x460666];return _0x555cbf;};'use strict';var _=require(_0x54bd('0x0'));var util=require(_0x54bd('0x1'));var moment=require(_0x54bd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54bd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x54bd('0x4'));var logger=require(_0x54bd('0x5'))(_0x54bd('0x6'));var config=require(_0x54bd('0x7'));var jayson=require(_0x54bd('0x8'));var client=jayson[_0x54bd('0x9')][_0x54bd('0xa')]({'port':0x232a});config[_0x54bd('0xb')]=_[_0x54bd('0xc')](config['redis'],{'host':_0x54bd('0xd'),'port':0x18eb});var socket=require(_0x54bd('0xe'))(new Redis(config[_0x54bd('0xb')]));require(_0x54bd('0xf'))[_0x54bd('0x10')](socket);function respondWithRpcPromise(_0x425a5a,_0x6233a8,_0x215cfa){return new BPromise(function(_0x324a47,_0x5f152d){return client['request'](_0x425a5a,_0x215cfa)[_0x54bd('0x11')](function(_0x5c44bf){logger[_0x54bd('0x12')](_0x54bd('0x13'),_0x6233a8,_0x54bd('0x14'));logger['debug'](_0x54bd('0x15'),_0x6233a8,_0x54bd('0x14'),JSON[_0x54bd('0x16')](_0x5c44bf));if(_0x5c44bf[_0x54bd('0x17')]){if(_0x5c44bf[_0x54bd('0x17')][_0x54bd('0x18')]===0x1f4){logger[_0x54bd('0x17')]('FaxQueue,\x20%s,\x20%s',_0x6233a8,_0x5c44bf[_0x54bd('0x17')][_0x54bd('0x19')]);return _0x5f152d(_0x5c44bf['error'][_0x54bd('0x19')]);}logger[_0x54bd('0x17')]('FaxQueue,\x20%s,\x20%s',_0x6233a8,_0x5c44bf[_0x54bd('0x17')][_0x54bd('0x19')]);return _0x324a47(_0x5c44bf['error']['message']);}else{logger[_0x54bd('0x12')](_0x54bd('0x13'),_0x6233a8,_0x54bd('0x14'));_0x324a47(_0x5c44bf[_0x54bd('0x1a')]['message']);}})[_0x54bd('0x1b')](function(_0x391f19){logger[_0x54bd('0x17')](_0x54bd('0x13'),_0x6233a8,_0x391f19);_0x5f152d(_0x391f19);});});}exports[_0x54bd('0x1c')]=function(_0x288716){var _0x520d1b=this;return new Promise(function(_0x3a6ce3,_0x1ecf65){return db[_0x54bd('0x1d')]['findAll']({'raw':_0x288716[_0x54bd('0x1e')]?_0x288716[_0x54bd('0x1e')][_0x54bd('0x1f')]===undefined?!![]:![]:!![],'where':_0x288716[_0x54bd('0x1e')]?_0x288716[_0x54bd('0x1e')]['where']||null:null,'attributes':_0x288716[_0x54bd('0x1e')]?_0x288716[_0x54bd('0x1e')][_0x54bd('0x20')]||null:null,'limit':_0x288716['options']?_0x288716['options']['limit']||null:null,'include':_0x288716[_0x54bd('0x1e')]?_0x288716[_0x54bd('0x1e')][_0x54bd('0x21')]?_['map'](_0x288716['options'][_0x54bd('0x21')],function(_0x7f2737){return{'model':db[_0x7f2737[_0x54bd('0x22')]],'as':_0x7f2737['as'],'attributes':_0x7f2737[_0x54bd('0x20')],'include':_0x7f2737[_0x54bd('0x21')]?_[_0x54bd('0x23')](_0x7f2737[_0x54bd('0x21')],function(_0xd56669){return{'model':db[_0xd56669[_0x54bd('0x22')]],'as':_0xd56669['as'],'attributes':_0xd56669['attributes'],'include':_0xd56669[_0x54bd('0x21')]?_[_0x54bd('0x23')](_0xd56669[_0x54bd('0x21')],function(_0x6e3cc4){return{'model':db[_0x6e3cc4[_0x54bd('0x22')]],'as':_0x6e3cc4['as'],'attributes':_0x6e3cc4[_0x54bd('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ef172){logger[_0x54bd('0x12')]('GetFaxQueue',_0x288716);logger[_0x54bd('0x24')](_0x54bd('0x1c'),_0x288716,JSON[_0x54bd('0x16')](_0x2ef172));_0x3a6ce3(_0x2ef172);})[_0x54bd('0x1b')](function(_0x5662a2){logger[_0x54bd('0x17')]('GetFaxQueue',_0x5662a2[_0x54bd('0x19')],_0x288716);_0x1ecf65(_0x520d1b[_0x54bd('0x17')](0x1f4,_0x5662a2[_0x54bd('0x19')]));});});};exports['ShowFaxQueue']=function(_0xf9c3e2){var _0xc0711b=this;return new Promise(function(_0x22ec8b,_0x57e067){return db['FaxQueue'][_0x54bd('0x25')]({'raw':_0xf9c3e2[_0x54bd('0x1e')]?_0xf9c3e2[_0x54bd('0x1e')][_0x54bd('0x1f')]===undefined?!![]:![]:!![],'where':_0xf9c3e2[_0x54bd('0x1e')]?_0xf9c3e2[_0x54bd('0x1e')]['where']||null:null,'attributes':_0xf9c3e2[_0x54bd('0x1e')]?_0xf9c3e2[_0x54bd('0x1e')][_0x54bd('0x20')]||null:null,'include':_0xf9c3e2[_0x54bd('0x1e')]?_0xf9c3e2[_0x54bd('0x1e')][_0x54bd('0x21')]?_[_0x54bd('0x23')](_0xf9c3e2[_0x54bd('0x1e')][_0x54bd('0x21')],function(_0x2b12d4){return{'model':db[_0x2b12d4[_0x54bd('0x22')]],'as':_0x2b12d4['as'],'attributes':_0x2b12d4['attributes'],'include':_0x2b12d4['include']?_['map'](_0x2b12d4[_0x54bd('0x21')],function(_0x2310f3){return{'model':db[_0x2310f3[_0x54bd('0x22')]],'as':_0x2310f3['as'],'attributes':_0x2310f3[_0x54bd('0x20')],'include':_0x2310f3[_0x54bd('0x21')]?_['map'](_0x2310f3[_0x54bd('0x21')],function(_0x186255){return{'model':db[_0x186255[_0x54bd('0x22')]],'as':_0x186255['as'],'attributes':_0x186255[_0x54bd('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a46f7){logger['info'](_0x54bd('0x26'),_0xf9c3e2);logger[_0x54bd('0x24')]('ShowFaxQueue',_0xf9c3e2,JSON['stringify'](_0x5a46f7));_0x22ec8b(_0x5a46f7);})[_0x54bd('0x1b')](function(_0x5eb29a){logger['error'](_0x54bd('0x26'),_0x5eb29a[_0x54bd('0x19')],_0xf9c3e2);_0x57e067(_0xc0711b[_0x54bd('0x17')](0x1f4,_0x5eb29a[_0x54bd('0x19')]));});});}; \ No newline at end of file +var _0xec53=['FaxQueue,\x20%s,\x20%s','GetFaxQueue','FaxQueue','findAll','options','raw','where','include','map','attributes','model','catch','ShowFaxQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x401144,_0x4a8c0d){var _0x8dc3b2=function(_0x8c202){while(--_0x8c202){_0x401144['push'](_0x401144['shift']());}};_0x8dc3b2(++_0x4a8c0d);}(_0xec53,0xf1));var _0x3ec5=function(_0x5a3e47,_0x45b309){_0x5a3e47=_0x5a3e47-0x0;var _0xd2726=_0xec53[_0x5a3e47];return _0xd2726;};'use strict';var _=require('lodash');var util=require(_0x3ec5('0x0'));var moment=require(_0x3ec5('0x1'));var BPromise=require(_0x3ec5('0x2'));var rs=require(_0x3ec5('0x3'));var fs=require('fs');var Redis=require(_0x3ec5('0x4'));var db=require(_0x3ec5('0x5'))['db'];var utils=require(_0x3ec5('0x6'));var logger=require(_0x3ec5('0x7'))(_0x3ec5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3ec5('0x9')][_0x3ec5('0xa')]({'port':0x232a});config[_0x3ec5('0xb')]=_[_0x3ec5('0xc')](config[_0x3ec5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ec5('0xd'))(new Redis(config[_0x3ec5('0xb')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x15bd7d,_0x55f47a,_0x828b92){return new BPromise(function(_0x2d436d,_0x5cdace){return client[_0x3ec5('0xe')](_0x15bd7d,_0x828b92)[_0x3ec5('0xf')](function(_0x5c8afd){logger[_0x3ec5('0x10')]('FaxQueue,\x20%s,\x20%s',_0x55f47a,_0x3ec5('0x11'));logger[_0x3ec5('0x12')](_0x3ec5('0x13'),_0x55f47a,_0x3ec5('0x11'),JSON[_0x3ec5('0x14')](_0x5c8afd));if(_0x5c8afd['error']){if(_0x5c8afd[_0x3ec5('0x15')][_0x3ec5('0x16')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x55f47a,_0x5c8afd['error'][_0x3ec5('0x17')]);return _0x5cdace(_0x5c8afd[_0x3ec5('0x15')]['message']);}logger[_0x3ec5('0x15')]('FaxQueue,\x20%s,\x20%s',_0x55f47a,_0x5c8afd['error'][_0x3ec5('0x17')]);return _0x2d436d(_0x5c8afd['error']['message']);}else{logger[_0x3ec5('0x10')]('FaxQueue,\x20%s,\x20%s',_0x55f47a,_0x3ec5('0x11'));_0x2d436d(_0x5c8afd[_0x3ec5('0x18')][_0x3ec5('0x17')]);}})['catch'](function(_0x2d29ae){logger[_0x3ec5('0x15')](_0x3ec5('0x19'),_0x55f47a,_0x2d29ae);_0x5cdace(_0x2d29ae);});});}exports[_0x3ec5('0x1a')]=function(_0x5c8c30){var _0xed42a1=this;return new Promise(function(_0x154f3b,_0x2101a6){return db[_0x3ec5('0x1b')][_0x3ec5('0x1c')]({'raw':_0x5c8c30['options']?_0x5c8c30[_0x3ec5('0x1d')][_0x3ec5('0x1e')]===undefined?!![]:![]:!![],'where':_0x5c8c30[_0x3ec5('0x1d')]?_0x5c8c30[_0x3ec5('0x1d')][_0x3ec5('0x1f')]||null:null,'attributes':_0x5c8c30[_0x3ec5('0x1d')]?_0x5c8c30['options']['attributes']||null:null,'limit':_0x5c8c30[_0x3ec5('0x1d')]?_0x5c8c30['options']['limit']||null:null,'include':_0x5c8c30[_0x3ec5('0x1d')]?_0x5c8c30['options'][_0x3ec5('0x20')]?_[_0x3ec5('0x21')](_0x5c8c30[_0x3ec5('0x1d')][_0x3ec5('0x20')],function(_0x24e3f0){return{'model':db[_0x24e3f0['model']],'as':_0x24e3f0['as'],'attributes':_0x24e3f0[_0x3ec5('0x22')],'include':_0x24e3f0[_0x3ec5('0x20')]?_[_0x3ec5('0x21')](_0x24e3f0['include'],function(_0x262bac){return{'model':db[_0x262bac[_0x3ec5('0x23')]],'as':_0x262bac['as'],'attributes':_0x262bac[_0x3ec5('0x22')],'include':_0x262bac['include']?_[_0x3ec5('0x21')](_0x262bac[_0x3ec5('0x20')],function(_0x320af8){return{'model':db[_0x320af8['model']],'as':_0x320af8['as'],'attributes':_0x320af8[_0x3ec5('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x505441){logger[_0x3ec5('0x10')](_0x3ec5('0x1a'),_0x5c8c30);logger[_0x3ec5('0x12')](_0x3ec5('0x1a'),_0x5c8c30,JSON['stringify'](_0x505441));_0x154f3b(_0x505441);})[_0x3ec5('0x24')](function(_0x4bb64c){logger['error']('GetFaxQueue',_0x4bb64c[_0x3ec5('0x17')],_0x5c8c30);_0x2101a6(_0xed42a1[_0x3ec5('0x15')](0x1f4,_0x4bb64c[_0x3ec5('0x17')]));});});};exports[_0x3ec5('0x25')]=function(_0x5a8d72){var _0x54cb47=this;return new Promise(function(_0x27552e,_0x4c3ab5){return db['FaxQueue']['find']({'raw':_0x5a8d72['options']?_0x5a8d72[_0x3ec5('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5a8d72[_0x3ec5('0x1d')]?_0x5a8d72[_0x3ec5('0x1d')][_0x3ec5('0x1f')]||null:null,'attributes':_0x5a8d72[_0x3ec5('0x1d')]?_0x5a8d72[_0x3ec5('0x1d')][_0x3ec5('0x22')]||null:null,'include':_0x5a8d72[_0x3ec5('0x1d')]?_0x5a8d72['options'][_0x3ec5('0x20')]?_[_0x3ec5('0x21')](_0x5a8d72['options']['include'],function(_0x27937d){return{'model':db[_0x27937d['model']],'as':_0x27937d['as'],'attributes':_0x27937d[_0x3ec5('0x22')],'include':_0x27937d['include']?_[_0x3ec5('0x21')](_0x27937d[_0x3ec5('0x20')],function(_0x3a4da6){return{'model':db[_0x3a4da6[_0x3ec5('0x23')]],'as':_0x3a4da6['as'],'attributes':_0x3a4da6[_0x3ec5('0x22')],'include':_0x3a4da6[_0x3ec5('0x20')]?_[_0x3ec5('0x21')](_0x3a4da6[_0x3ec5('0x20')],function(_0x669191){return{'model':db[_0x669191['model']],'as':_0x669191['as'],'attributes':_0x669191['attributes']};}):[]};}):[]};}):[]:[]})[_0x3ec5('0xf')](function(_0x138b5c){logger['info'](_0x3ec5('0x25'),_0x5a8d72);logger[_0x3ec5('0x12')]('ShowFaxQueue',_0x5a8d72,JSON[_0x3ec5('0x14')](_0x138b5c));_0x27552e(_0x138b5c);})[_0x3ec5('0x24')](function(_0x46970a){logger[_0x3ec5('0x15')]('ShowFaxQueue',_0x46970a[_0x3ec5('0x17')],_0x5a8d72);_0x4c3ab5(_0x54cb47[_0x3ec5('0x15')](0x1f4,_0x46970a[_0x3ec5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 2e301d0..5cfc1d8 100644 --- a/server/api/faxQueue/faxQueue.socket.js +++ b/server/api/faxQueue/faxQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09fe=['save','remove','update','emit','removeListener','register','faxQueue:','./faxQueue.events'];(function(_0x4f1e23,_0x166b91){var _0x4354b1=function(_0x1a3b71){while(--_0x1a3b71){_0x4f1e23['push'](_0x4f1e23['shift']());}};_0x4354b1(++_0x166b91);}(_0x09fe,0x1d7));var _0xe09f=function(_0x1c556b,_0xf127cb){_0x1c556b=_0x1c556b-0x0;var _0x2901bf=_0x09fe[_0x1c556b];return _0x2901bf;};'use strict';var FaxQueueEvents=require(_0xe09f('0x0'));var events=[_0xe09f('0x1'),_0xe09f('0x2'),_0xe09f('0x3')];function createListener(_0x1ca759,_0x1a046f){return function(_0x441280){_0x1a046f[_0xe09f('0x4')](_0x1ca759,_0x441280);};}function removeListener(_0x150b4d,_0x3d93b7){return function(){FaxQueueEvents[_0xe09f('0x5')](_0x150b4d,_0x3d93b7);};}exports[_0xe09f('0x6')]=function(_0x188d38){for(var _0x39c20f=0x0,_0x280cbf=events['length'];_0x39c20f<_0x280cbf;_0x39c20f++){var _0x26a438=events[_0x39c20f];var _0x2fdd14=createListener(_0xe09f('0x7')+_0x26a438,_0x188d38);FaxQueueEvents['on'](_0x26a438,_0x2fdd14);}}; \ No newline at end of file +var _0x0f15=['faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x28e5d9,_0x2f49ee){var _0xa90938=function(_0xc9e3df){while(--_0xc9e3df){_0x28e5d9['push'](_0x28e5d9['shift']());}};_0xa90938(++_0x2f49ee);}(_0x0f15,0x196));var _0x50f1=function(_0x4ed17b,_0x2b1745){_0x4ed17b=_0x4ed17b-0x0;var _0x24b248=_0x0f15[_0x4ed17b];return _0x24b248;};'use strict';var FaxQueueEvents=require(_0x50f1('0x0'));var events=[_0x50f1('0x1'),_0x50f1('0x2'),_0x50f1('0x3')];function createListener(_0x46885a,_0x5c3b26){return function(_0x3e21a3){_0x5c3b26[_0x50f1('0x4')](_0x46885a,_0x3e21a3);};}function removeListener(_0x4e4109,_0x3fdaa8){return function(){FaxQueueEvents[_0x50f1('0x5')](_0x4e4109,_0x3fdaa8);};}exports[_0x50f1('0x6')]=function(_0x24859c){for(var _0x4ddc1c=0x0,_0x303df7=events[_0x50f1('0x7')];_0x4ddc1c<_0x303df7;_0x4ddc1c++){var _0x6adc0e=events[_0x4ddc1c];var _0x34bf9d=createListener(_0x50f1('0x8')+_0x6adc0e,_0x24859c);FaxQueueEvents['on'](_0x6adc0e,_0x34bf9d);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 5385eb0..711df5b 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x55855c,_0x151e65){var _0x551f70=function(_0x1ed38f){while(--_0x1ed38f){_0x55855c['push'](_0x55855c['shift']());}};_0x551f70(++_0x151e65);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=router; \ No newline at end of file +var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0xb10b,0x12a));var _0xbb10=function(_0xa92559,_0x1d2e45){_0xa92559=_0xa92559-0x0;var _0x502df8=_0xb10b[_0xa92559];return _0x502df8;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index ac91188..6fcf773 100644 --- a/server/api/faxQueueReport/faxQueueReport.attributes.js +++ b/server/api/faxQueueReport/faxQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8f2=['sequelize','exports','STRING','DATE'];(function(_0x3e7555,_0x442ce2){var _0x3719e9=function(_0x1825e1){while(--_0x1825e1){_0x3e7555['push'](_0x3e7555['shift']());}};_0x3719e9(++_0x442ce2);}(_0xc8f2,0x168));var _0x2c8f=function(_0x2a88e0,_0x1688ae){_0x2a88e0=_0x2a88e0-0x0;var _0xcee4c0=_0xc8f2[_0x2a88e0];return _0xcee4c0;};'use strict';var moment=require('moment');var Sequelize=require(_0x2c8f('0x0'));module[_0x2c8f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2c8f('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x2c8f('0x3')]},'acceptAt':{'type':Sequelize[_0x2c8f('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x2c8f('0x2')]}}; \ No newline at end of file +var _0x8f1f=['STRING','DATE','exports'];(function(_0x148191,_0x2e850e){var _0x1e075e=function(_0x3d5a20){while(--_0x3d5a20){_0x148191['push'](_0x148191['shift']());}};_0x1e075e(++_0x2e850e);}(_0x8f1f,0xad));var _0xf8f1=function(_0x4e0403,_0x23bb0a){_0x4e0403=_0x4e0403-0x0;var _0xb4ab4f=_0x8f1f[_0x4e0403];return _0xb4ab4f;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xf8f1('0x0')]={'uniqueid':{'type':Sequelize[_0xf8f1('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xf8f1('0x1')]},'joinAt':{'type':Sequelize[_0xf8f1('0x2')]},'leaveAt':{'type':Sequelize[_0xf8f1('0x2')]},'acceptAt':{'type':Sequelize[_0xf8f1('0x2')]},'exitAt':{'type':Sequelize[_0xf8f1('0x2')]},'reason':{'type':Sequelize[_0xf8f1('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 3275645..ccf1639 100644 --- a/server/api/faxQueueReport/faxQueueReport.controller.js +++ b/server/api/faxQueueReport/faxQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c3d=['VIRTUAL','includeAll','include','findAll','rows','catch','show','options','create','update','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','apply','save','then','destroy','end','sendStatus','error','stack','name','send','index','FaxQueueReport','rawAttributes','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','pick','merge','map','type','key'];(function(_0x4b55db,_0x33626c){var _0x15354a=function(_0x26b528){while(--_0x26b528){_0x4b55db['push'](_0x4b55db['shift']());}};_0x15354a(++_0x33626c);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x340c0f,_0x3f434a){_0x340c0f=_0x340c0f-0x0;var _0x4e5d8f=_0x1c3d[_0x340c0f];return _0x4e5d8f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd1c3('0x0'));var rimraf=require(_0xd1c3('0x1'));var zipdir=require(_0xd1c3('0x2'));var jsonpatch=require(_0xd1c3('0x3'));var rp=require(_0xd1c3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd1c3('0x5'));var util=require(_0xd1c3('0x6'));var path=require(_0xd1c3('0x7'));var sox=require(_0xd1c3('0x8'));var csv=require(_0xd1c3('0x9'));var ejs=require(_0xd1c3('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd1c3('0xb'));var crypto=require(_0xd1c3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd1c3('0xd'));var toCsv=require(_0xd1c3('0x9'));var querystring=require(_0xd1c3('0xe'));var Papa=require(_0xd1c3('0xf'));var Redis=require(_0xd1c3('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd1c3('0x11'));var logger=require(_0xd1c3('0x12'))(_0xd1c3('0x13'));var utils=require(_0xd1c3('0x14'));var config=require(_0xd1c3('0x15'));var db=require(_0xd1c3('0x16'))['db'];function respondWithStatusCode(_0x373ffb,_0x280405){_0x280405=_0x280405||0xcc;return function(_0x159691){if(_0x159691){return _0x373ffb['sendStatus'](_0x280405);}return _0x373ffb[_0xd1c3('0x17')](_0x280405)['end']();};}function respondWithResult(_0x5eb3c1,_0x11d1f3){_0x11d1f3=_0x11d1f3||0xc8;return function(_0x57a55e){if(_0x57a55e){return _0x5eb3c1[_0xd1c3('0x17')](_0x11d1f3)[_0xd1c3('0x18')](_0x57a55e);}};}function respondWithFilteredResult(_0x37d175,_0x52e7bc){return function(_0xaaa259){if(_0xaaa259){var _0x4230f7=_0xaaa259[_0xd1c3('0x19')],_0x127067=_0x52e7bc[_0xd1c3('0x1a')],_0x3bc2b=_0x52e7bc[_0xd1c3('0x1a')]+_0x52e7bc[_0xd1c3('0x1b')],_0x42ba11;if(_0x3bc2b>=_0x4230f7){_0x3bc2b=_0x4230f7;_0x42ba11=0xc8;}else{_0x42ba11=0xce;}_0x37d175[_0xd1c3('0x17')](_0x42ba11);return _0x37d175['set']('Content-Range',_0x127067+'-'+_0x3bc2b+'/'+_0x4230f7)[_0xd1c3('0x18')](_0xaaa259);}return null;};}function patchUpdates(_0x3a1a74){return function(_0x3f1df3){try{jsonpatch[_0xd1c3('0x1c')](_0x3f1df3,_0x3a1a74,!![]);}catch(_0x5b2571){return BPromise['reject'](_0x5b2571);}return _0x3f1df3[_0xd1c3('0x1d')]();};}function saveUpdates(_0xac3076,_0x1dcb29){return function(_0x588f4e){if(_0x588f4e){return _0x588f4e['update'](_0xac3076)[_0xd1c3('0x1e')](function(_0x1b5fae){return _0x1b5fae;});}return null;};}function removeEntity(_0x4f8277,_0x4b2f00){return function(_0x1b5732){if(_0x1b5732){return _0x1b5732[_0xd1c3('0x1f')]()[_0xd1c3('0x1e')](function(){_0x4f8277[_0xd1c3('0x17')](0xcc)[_0xd1c3('0x20')]();});}};}function handleEntityNotFound(_0x46ed40,_0x137fd5){return function(_0xaa7580){if(!_0xaa7580){_0x46ed40[_0xd1c3('0x21')](0x194);}return _0xaa7580;};}function handleError(_0x218ef1,_0x5a9d5d){_0x5a9d5d=_0x5a9d5d||0x1f4;return function(_0x56091a){logger[_0xd1c3('0x22')](_0x56091a[_0xd1c3('0x23')]);if(_0x56091a[_0xd1c3('0x24')]){delete _0x56091a[_0xd1c3('0x24')];}_0x218ef1['status'](_0x5a9d5d)[_0xd1c3('0x25')](_0x56091a);};}exports[_0xd1c3('0x26')]=function(_0x54fd33,_0xcb5283){var _0x3f5206={},_0x6f912b={},_0x173cb9={'count':0x0,'rows':[]};var _0x10be91=db[_0xd1c3('0x27')][_0xd1c3('0x28')];_0x6f912b['model']=_['keys'](_0x10be91);_0x6f912b[_0xd1c3('0x29')]=_[_0xd1c3('0x2a')](_0x54fd33[_0xd1c3('0x29')]);_0x6f912b[_0xd1c3('0x2b')]=_[_0xd1c3('0x2c')](_0x6f912b['model'],_0x6f912b[_0xd1c3('0x29')]);_0x3f5206[_0xd1c3('0x2d')]=_['intersection'](_0x6f912b[_0xd1c3('0x2e')],qs['fields'](_0x54fd33[_0xd1c3('0x29')][_0xd1c3('0x2f')]));_0x3f5206[_0xd1c3('0x2d')]=_0x3f5206[_0xd1c3('0x2d')][_0xd1c3('0x30')]?_0x3f5206[_0xd1c3('0x2d')]:_0x6f912b[_0xd1c3('0x2e')];if(!_0x54fd33[_0xd1c3('0x29')][_0xd1c3('0x31')]('nolimit')){_0x3f5206[_0xd1c3('0x1b')]=qs[_0xd1c3('0x1b')](_0x54fd33['query'][_0xd1c3('0x1b')]);_0x3f5206['offset']=qs[_0xd1c3('0x1a')](_0x54fd33[_0xd1c3('0x29')][_0xd1c3('0x1a')]);}_0x3f5206['order']=qs[_0xd1c3('0x32')](_0x54fd33[_0xd1c3('0x29')][_0xd1c3('0x32')]);_0x3f5206[_0xd1c3('0x33')]=qs[_0xd1c3('0x2b')](_[_0xd1c3('0x34')](_0x54fd33[_0xd1c3('0x29')],_0x6f912b[_0xd1c3('0x2b')]));if(_0x54fd33[_0xd1c3('0x29')]['filter']){_0x3f5206['where']=_[_0xd1c3('0x35')](_0x3f5206['where'],{'$or':_[_0xd1c3('0x36')](_0x10be91,function(_0x3b2efa){if(_0x3b2efa[_0xd1c3('0x37')][_0xd1c3('0x38')]!==_0xd1c3('0x39')){var _0x3690f8={};_0x3690f8[_0x3b2efa['field']]={'$like':'%'+_0x54fd33[_0xd1c3('0x29')]['filter']+'%'};return _0x3690f8;}})});}_0x3f5206=_[_0xd1c3('0x35')]({},_0x3f5206,_0x54fd33['options']);var _0x292a57={'where':_0x3f5206['where']};return db['FaxQueueReport'][_0xd1c3('0x19')](_0x292a57)[_0xd1c3('0x1e')](function(_0x40d394){_0x173cb9['count']=_0x40d394;if(_0x54fd33[_0xd1c3('0x29')][_0xd1c3('0x3a')]){_0x3f5206[_0xd1c3('0x3b')]=[{'all':!![]}];}return db['FaxQueueReport'][_0xd1c3('0x3c')](_0x3f5206);})[_0xd1c3('0x1e')](function(_0x21b01a){_0x173cb9[_0xd1c3('0x3d')]=_0x21b01a;return _0x173cb9;})[_0xd1c3('0x1e')](respondWithFilteredResult(_0xcb5283,_0x3f5206))[_0xd1c3('0x3e')](handleError(_0xcb5283,null));};exports[_0xd1c3('0x3f')]=function(_0x5744f0,_0x20c891){var _0x357855={'raw':!![],'where':{'id':_0x5744f0['params']['id']}},_0x58d588={};_0x58d588[_0xd1c3('0x2e')]=_[_0xd1c3('0x2a')](db[_0xd1c3('0x27')][_0xd1c3('0x28')]);_0x58d588[_0xd1c3('0x29')]=_['keys'](_0x5744f0[_0xd1c3('0x29')]);_0x58d588[_0xd1c3('0x2b')]=_[_0xd1c3('0x2c')](_0x58d588[_0xd1c3('0x2e')],_0x58d588[_0xd1c3('0x29')]);_0x357855[_0xd1c3('0x2d')]=_[_0xd1c3('0x2c')](_0x58d588[_0xd1c3('0x2e')],qs[_0xd1c3('0x2f')](_0x5744f0[_0xd1c3('0x29')]['fields']));_0x357855[_0xd1c3('0x2d')]=_0x357855['attributes'][_0xd1c3('0x30')]?_0x357855[_0xd1c3('0x2d')]:_0x58d588[_0xd1c3('0x2e')];if(_0x5744f0['query'][_0xd1c3('0x3a')]){_0x357855[_0xd1c3('0x3b')]=[{'all':!![]}];}_0x357855=_[_0xd1c3('0x35')]({},_0x357855,_0x5744f0[_0xd1c3('0x40')]);return db[_0xd1c3('0x27')]['find'](_0x357855)['then'](handleEntityNotFound(_0x20c891,null))[_0xd1c3('0x1e')](respondWithResult(_0x20c891,null))['catch'](handleError(_0x20c891,null));};exports[_0xd1c3('0x41')]=function(_0x3a261c,_0x426a31){return db[_0xd1c3('0x27')]['create'](_0x3a261c['body'],{})[_0xd1c3('0x1e')](respondWithResult(_0x426a31,0xc9))[_0xd1c3('0x3e')](handleError(_0x426a31,null));};exports[_0xd1c3('0x42')]=function(_0x5df790,_0xc860d5){if(_0x5df790['body']['id']){delete _0x5df790[_0xd1c3('0x43')]['id'];}return db[_0xd1c3('0x27')][_0xd1c3('0x44')]({'where':{'id':_0x5df790[_0xd1c3('0x45')]['id']}})['then'](handleEntityNotFound(_0xc860d5,null))['then'](saveUpdates(_0x5df790[_0xd1c3('0x43')],null))[_0xd1c3('0x1e')](respondWithResult(_0xc860d5,null))[_0xd1c3('0x3e')](handleError(_0xc860d5,null));};exports[_0xd1c3('0x1f')]=function(_0xbaf0b7,_0xae72ab){return db[_0xd1c3('0x27')][_0xd1c3('0x44')]({'where':{'id':_0xbaf0b7['params']['id']}})[_0xd1c3('0x1e')](handleEntityNotFound(_0xae72ab,null))[_0xd1c3('0x1e')](removeEntity(_0xae72ab,null))[_0xd1c3('0x3e')](handleError(_0xae72ab,null));};exports[_0xd1c3('0x46')]=function(_0x2eb58e,_0x5d3db4){return db['FaxQueueReport'][_0xd1c3('0x46')]()['then'](respondWithResult(_0x5d3db4,null))[_0xd1c3('0x3e')](handleError(_0x5d3db4,null));}; \ No newline at end of file +var _0xdec3=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','index','FaxQueueReport','rawAttributes','model','keys','intersection','attributes','fields','length','nolimit','query','sort','where','pick','filters','filter','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','params','merge','find','create','body','describe','html-pdf'];(function(_0x3df09c,_0x502545){var _0x18b371=function(_0xe8d6a8){while(--_0xe8d6a8){_0x3df09c['push'](_0x3df09c['shift']());}};_0x18b371(++_0x502545);}(_0xdec3,0x89));var _0x3dec=function(_0x399874,_0x454910){_0x399874=_0x399874-0x0;var _0x2d9df4=_0xdec3[_0x399874];return _0x2d9df4;};'use strict';var pdf=require(_0x3dec('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3dec('0x1'));var zipdir=require(_0x3dec('0x2'));var jsonpatch=require(_0x3dec('0x3'));var rp=require('request-promise');var moment=require(_0x3dec('0x4'));var BPromise=require(_0x3dec('0x5'));var Mustache=require(_0x3dec('0x6'));var util=require(_0x3dec('0x7'));var path=require('path');var sox=require(_0x3dec('0x8'));var csv=require(_0x3dec('0x9'));var ejs=require(_0x3dec('0xa'));var fs=require('fs');var _=require(_0x3dec('0xb'));var squel=require(_0x3dec('0xc'));var crypto=require(_0x3dec('0xd'));var jsforce=require(_0x3dec('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3dec('0x9'));var querystring=require(_0x3dec('0xf'));var Papa=require('papaparse');var Redis=require(_0x3dec('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3dec('0x11'));var logger=require(_0x3dec('0x12'))('api');var utils=require(_0x3dec('0x13'));var config=require(_0x3dec('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xde8d67,_0x1c300c){_0x1c300c=_0x1c300c||0xcc;return function(_0x23949e){if(_0x23949e){return _0xde8d67[_0x3dec('0x15')](_0x1c300c);}return _0xde8d67[_0x3dec('0x16')](_0x1c300c)[_0x3dec('0x17')]();};}function respondWithResult(_0x51fa77,_0x4c2c65){_0x4c2c65=_0x4c2c65||0xc8;return function(_0x3d4759){if(_0x3d4759){return _0x51fa77['status'](_0x4c2c65)[_0x3dec('0x18')](_0x3d4759);}};}function respondWithFilteredResult(_0xed2beb,_0x5702f2){return function(_0x5605b8){if(_0x5605b8){var _0x1daae8=_0x5605b8[_0x3dec('0x19')],_0x480e08=_0x5702f2['offset'],_0x1fdf82=_0x5702f2[_0x3dec('0x1a')]+_0x5702f2[_0x3dec('0x1b')],_0x4b5ae2;if(_0x1fdf82>=_0x1daae8){_0x1fdf82=_0x1daae8;_0x4b5ae2=0xc8;}else{_0x4b5ae2=0xce;}_0xed2beb['status'](_0x4b5ae2);return _0xed2beb[_0x3dec('0x1c')](_0x3dec('0x1d'),_0x480e08+'-'+_0x1fdf82+'/'+_0x1daae8)[_0x3dec('0x18')](_0x5605b8);}return null;};}function patchUpdates(_0x2f2868){return function(_0x189fd8){try{jsonpatch[_0x3dec('0x1e')](_0x189fd8,_0x2f2868,!![]);}catch(_0x198c3a){return BPromise[_0x3dec('0x1f')](_0x198c3a);}return _0x189fd8[_0x3dec('0x20')]();};}function saveUpdates(_0x331c8f,_0xba1017){return function(_0x334861){if(_0x334861){return _0x334861[_0x3dec('0x21')](_0x331c8f)[_0x3dec('0x22')](function(_0x450717){return _0x450717;});}return null;};}function removeEntity(_0x26d334,_0x2ce00b){return function(_0x576b0d){if(_0x576b0d){return _0x576b0d['destroy']()['then'](function(){_0x26d334['status'](0xcc)[_0x3dec('0x17')]();});}};}function handleEntityNotFound(_0x5a40bc,_0x2399dc){return function(_0x15267f){if(!_0x15267f){_0x5a40bc[_0x3dec('0x15')](0x194);}return _0x15267f;};}function handleError(_0x35fe4b,_0x22e3ae){_0x22e3ae=_0x22e3ae||0x1f4;return function(_0x362f3c){logger[_0x3dec('0x23')](_0x362f3c['stack']);if(_0x362f3c[_0x3dec('0x24')]){delete _0x362f3c[_0x3dec('0x24')];}_0x35fe4b[_0x3dec('0x16')](_0x22e3ae)['send'](_0x362f3c);};}exports[_0x3dec('0x25')]=function(_0x2febf7,_0x598ccc){var _0x4144ce={},_0x45237d={},_0x5a578f={'count':0x0,'rows':[]};var _0x833f77=db[_0x3dec('0x26')][_0x3dec('0x27')];_0x45237d[_0x3dec('0x28')]=_[_0x3dec('0x29')](_0x833f77);_0x45237d['query']=_[_0x3dec('0x29')](_0x2febf7['query']);_0x45237d['filters']=_[_0x3dec('0x2a')](_0x45237d['model'],_0x45237d['query']);_0x4144ce[_0x3dec('0x2b')]=_[_0x3dec('0x2a')](_0x45237d[_0x3dec('0x28')],qs[_0x3dec('0x2c')](_0x2febf7['query'][_0x3dec('0x2c')]));_0x4144ce[_0x3dec('0x2b')]=_0x4144ce[_0x3dec('0x2b')][_0x3dec('0x2d')]?_0x4144ce['attributes']:_0x45237d[_0x3dec('0x28')];if(!_0x2febf7['query']['hasOwnProperty'](_0x3dec('0x2e'))){_0x4144ce[_0x3dec('0x1b')]=qs[_0x3dec('0x1b')](_0x2febf7[_0x3dec('0x2f')][_0x3dec('0x1b')]);_0x4144ce[_0x3dec('0x1a')]=qs['offset'](_0x2febf7['query'][_0x3dec('0x1a')]);}_0x4144ce['order']=qs[_0x3dec('0x30')](_0x2febf7[_0x3dec('0x2f')][_0x3dec('0x30')]);_0x4144ce[_0x3dec('0x31')]=qs['filters'](_[_0x3dec('0x32')](_0x2febf7['query'],_0x45237d[_0x3dec('0x33')]));if(_0x2febf7[_0x3dec('0x2f')][_0x3dec('0x34')]){_0x4144ce[_0x3dec('0x31')]=_['merge'](_0x4144ce['where'],{'$or':_[_0x3dec('0x35')](_0x833f77,function(_0x3d2e25){if(_0x3d2e25[_0x3dec('0x36')][_0x3dec('0x37')]!==_0x3dec('0x38')){var _0x2c1ab4={};_0x2c1ab4[_0x3d2e25[_0x3dec('0x39')]]={'$like':'%'+_0x2febf7[_0x3dec('0x2f')]['filter']+'%'};return _0x2c1ab4;}})});}_0x4144ce=_['merge']({},_0x4144ce,_0x2febf7[_0x3dec('0x3a')]);var _0x447f34={'where':_0x4144ce[_0x3dec('0x31')]};return db[_0x3dec('0x26')][_0x3dec('0x19')](_0x447f34)['then'](function(_0x3ae162){_0x5a578f[_0x3dec('0x19')]=_0x3ae162;if(_0x2febf7['query'][_0x3dec('0x3b')]){_0x4144ce[_0x3dec('0x3c')]=[{'all':!![]}];}return db[_0x3dec('0x26')]['findAll'](_0x4144ce);})[_0x3dec('0x22')](function(_0x3d3db4){_0x5a578f[_0x3dec('0x3d')]=_0x3d3db4;return _0x5a578f;})[_0x3dec('0x22')](respondWithFilteredResult(_0x598ccc,_0x4144ce))[_0x3dec('0x3e')](handleError(_0x598ccc,null));};exports['show']=function(_0x461c86,_0x218733){var _0x212afb={'raw':!![],'where':{'id':_0x461c86[_0x3dec('0x3f')]['id']}},_0x10d70a={};_0x10d70a[_0x3dec('0x28')]=_['keys'](db[_0x3dec('0x26')][_0x3dec('0x27')]);_0x10d70a[_0x3dec('0x2f')]=_[_0x3dec('0x29')](_0x461c86[_0x3dec('0x2f')]);_0x10d70a[_0x3dec('0x33')]=_['intersection'](_0x10d70a[_0x3dec('0x28')],_0x10d70a[_0x3dec('0x2f')]);_0x212afb['attributes']=_['intersection'](_0x10d70a[_0x3dec('0x28')],qs['fields'](_0x461c86[_0x3dec('0x2f')][_0x3dec('0x2c')]));_0x212afb[_0x3dec('0x2b')]=_0x212afb[_0x3dec('0x2b')]['length']?_0x212afb[_0x3dec('0x2b')]:_0x10d70a['model'];if(_0x461c86['query'][_0x3dec('0x3b')]){_0x212afb[_0x3dec('0x3c')]=[{'all':!![]}];}_0x212afb=_[_0x3dec('0x40')]({},_0x212afb,_0x461c86[_0x3dec('0x3a')]);return db[_0x3dec('0x26')][_0x3dec('0x41')](_0x212afb)['then'](handleEntityNotFound(_0x218733,null))[_0x3dec('0x22')](respondWithResult(_0x218733,null))[_0x3dec('0x3e')](handleError(_0x218733,null));};exports[_0x3dec('0x42')]=function(_0x345cc2,_0x5da901){return db['FaxQueueReport'][_0x3dec('0x42')](_0x345cc2[_0x3dec('0x43')],{})['then'](respondWithResult(_0x5da901,0xc9))['catch'](handleError(_0x5da901,null));};exports[_0x3dec('0x21')]=function(_0x590863,_0x2ad046){if(_0x590863['body']['id']){delete _0x590863['body']['id'];}return db[_0x3dec('0x26')][_0x3dec('0x41')]({'where':{'id':_0x590863['params']['id']}})[_0x3dec('0x22')](handleEntityNotFound(_0x2ad046,null))[_0x3dec('0x22')](saveUpdates(_0x590863['body'],null))[_0x3dec('0x22')](respondWithResult(_0x2ad046,null))[_0x3dec('0x3e')](handleError(_0x2ad046,null));};exports['destroy']=function(_0x3c8eea,_0x2a4abc){return db[_0x3dec('0x26')][_0x3dec('0x41')]({'where':{'id':_0x3c8eea[_0x3dec('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2a4abc,null))[_0x3dec('0x22')](removeEntity(_0x2a4abc,null))[_0x3dec('0x3e')](handleError(_0x2a4abc,null));};exports[_0x3dec('0x44')]=function(_0x20335b,_0x2e4208){return db[_0x3dec('0x26')]['describe']()[_0x3dec('0x22')](respondWithResult(_0x2e4208,null))[_0x3dec('0x3e')](handleError(_0x2e4208,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 07c3cec..d9ec2cf 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2606=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_fax_queue','uniqueid','../../config/logger','api'];(function(_0x14c696,_0x43e421){var _0x39d58e=function(_0x109913){while(--_0x109913){_0x14c696['push'](_0x14c696['shift']());}};_0x39d58e(++_0x43e421);}(_0x2606,0xd6));var _0x6260=function(_0x518aa7,_0x53c94d){_0x518aa7=_0x518aa7-0x0;var _0x1a1215=_0x2606[_0x518aa7];return _0x1a1215;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6260('0x0'))(_0x6260('0x1'));var moment=require(_0x6260('0x2'));var BPromise=require(_0x6260('0x3'));var rp=require(_0x6260('0x4'));var fs=require('fs');var path=require(_0x6260('0x5'));var rimraf=require(_0x6260('0x6'));var config=require(_0x6260('0x7'));var attributes=require('./faxQueueReport.attributes');module[_0x6260('0x8')]=function(_0x43848e,_0x2f50f2){return _0x43848e[_0x6260('0x9')]('FaxQueueReport',attributes,{'tableName':_0x6260('0xa'),'paranoid':![],'indexes':[{'name':_0x6260('0xb'),'fields':[_0x6260('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba88=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxQueueReport.attributes','FaxQueueReport','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xba88,0x11d));var _0x8ba8=function(_0x2f335b,_0xbb0c31){_0x2f335b=_0x2f335b-0x0;var _0x28cf68=_0xba88[_0x2f335b];return _0x28cf68;};'use strict';var _=require(_0x8ba8('0x0'));var util=require(_0x8ba8('0x1'));var logger=require(_0x8ba8('0x2'))(_0x8ba8('0x3'));var moment=require(_0x8ba8('0x4'));var BPromise=require(_0x8ba8('0x5'));var rp=require(_0x8ba8('0x6'));var fs=require('fs');var path=require(_0x8ba8('0x7'));var rimraf=require(_0x8ba8('0x8'));var config=require('../../config/environment');var attributes=require(_0x8ba8('0x9'));module['exports']=function(_0x345750,_0x4461f4){return _0x345750['define'](_0x8ba8('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index f980065..d232971 100644 --- a/server/api/faxQueueReport/faxQueueReport.rpc.js +++ b/server/api/faxQueueReport/faxQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2610=['body','options','raw','catch','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateFaxQueueReport','FaxQueueReport','create'];(function(_0x2099a3,_0x48244f){var _0x433780=function(_0x23c8c4){while(--_0x23c8c4){_0x2099a3['push'](_0x2099a3['shift']());}};_0x433780(++_0x48244f);}(_0x2610,0xf0));var _0x0261=function(_0x204e43,_0x59a350){_0x204e43=_0x204e43-0x0;var _0x3888d2=_0x2610[_0x204e43];return _0x3888d2;};'use strict';var _=require(_0x0261('0x0'));var util=require(_0x0261('0x1'));var moment=require(_0x0261('0x2'));var BPromise=require(_0x0261('0x3'));var rs=require(_0x0261('0x4'));var fs=require('fs');var Redis=require(_0x0261('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0261('0x6'));var logger=require(_0x0261('0x7'))('rpc');var config=require(_0x0261('0x8'));var jayson=require(_0x0261('0x9'));var client=jayson['client'][_0x0261('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3becab,_0x9f7bf0,_0x5d76bc){return new BPromise(function(_0x2dafe7,_0x39f980){return client['request'](_0x3becab,_0x5d76bc)[_0x0261('0xb')](function(_0x47044f){logger[_0x0261('0xc')](_0x0261('0xd'),_0x9f7bf0,_0x0261('0xe'));logger[_0x0261('0xf')](_0x0261('0x10'),_0x9f7bf0,_0x0261('0xe'),JSON[_0x0261('0x11')](_0x47044f));if(_0x47044f[_0x0261('0x12')]){if(_0x47044f[_0x0261('0x12')][_0x0261('0x13')]===0x1f4){logger[_0x0261('0x12')](_0x0261('0xd'),_0x9f7bf0,_0x47044f['error']['message']);return _0x39f980(_0x47044f[_0x0261('0x12')][_0x0261('0x14')]);}logger['error'](_0x0261('0xd'),_0x9f7bf0,_0x47044f['error']['message']);return _0x2dafe7(_0x47044f[_0x0261('0x12')][_0x0261('0x14')]);}else{logger[_0x0261('0xc')](_0x0261('0xd'),_0x9f7bf0,'request\x20sent');_0x2dafe7(_0x47044f['result'][_0x0261('0x14')]);}})['catch'](function(_0x4b4836){logger[_0x0261('0x12')](_0x0261('0xd'),_0x9f7bf0,_0x4b4836);_0x39f980(_0x4b4836);});});}exports[_0x0261('0x15')]=function(_0x3db422){var _0x224450=this;return new Promise(function(_0x435c0d,_0xd47ff1){return db[_0x0261('0x16')][_0x0261('0x17')](_0x3db422[_0x0261('0x18')],{'raw':_0x3db422[_0x0261('0x19')]?_0x3db422[_0x0261('0x19')][_0x0261('0x1a')]===undefined?!![]:![]:!![]})[_0x0261('0xb')](function(_0x301ba2){logger['info'](_0x0261('0x15'),_0x3db422);logger[_0x0261('0xf')](_0x0261('0x15'),_0x3db422,JSON[_0x0261('0x11')](_0x301ba2));_0x435c0d(_0x301ba2);})[_0x0261('0x1b')](function(_0x38ed47){logger[_0x0261('0x12')]('CreateFaxQueueReport',_0x38ed47['message'],_0x3db422);_0xd47ff1(_0x224450[_0x0261('0x12')](0x1f4,_0x38ed47[_0x0261('0x14')]));});});};exports[_0x0261('0x1c')]=function(_0x168a9c){var _0x24019c=this;return new Promise(function(_0x63be3d,_0xc75d6){return db['FaxQueueReport'][_0x0261('0x1d')](_0x168a9c['body'],{'raw':_0x168a9c['options']?_0x168a9c[_0x0261('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x168a9c[_0x0261('0x19')]?_0x168a9c['options'][_0x0261('0x1e')]||null:null,'attributes':_0x168a9c[_0x0261('0x19')]?_0x168a9c[_0x0261('0x19')][_0x0261('0x1f')]||null:null,'limit':_0x168a9c[_0x0261('0x19')]?_0x168a9c[_0x0261('0x19')][_0x0261('0x20')]||null:null})[_0x0261('0xb')](function(_0x1a5476){logger[_0x0261('0xc')](_0x0261('0x1c'),_0x168a9c);logger[_0x0261('0xf')](_0x0261('0x1c'),_0x168a9c,JSON[_0x0261('0x11')](_0x1a5476));_0x63be3d(_0x1a5476);})['catch'](function(_0x551c46){logger[_0x0261('0x12')](_0x0261('0x1c'),_0x551c46[_0x0261('0x14')],_0x168a9c);_0xc75d6(_0x24019c[_0x0261('0x12')](0x1f4,_0x551c46[_0x0261('0x14')]));});});}; \ No newline at end of file +var _0xd829=['create','body','options','UpdateFaxQueueReport','update','raw','attributes','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport'];(function(_0xfd65f6,_0x504bb0){var _0x3d96d9=function(_0x51d2c7){while(--_0x51d2c7){_0xfd65f6['push'](_0xfd65f6['shift']());}};_0x3d96d9(++_0x504bb0);}(_0xd829,0x103));var _0x9d82=function(_0x520db2,_0x3bee45){_0x520db2=_0x520db2-0x0;var _0x51e176=_0xd829[_0x520db2];return _0x51e176;};'use strict';var _=require(_0x9d82('0x0'));var util=require('util');var moment=require(_0x9d82('0x1'));var BPromise=require(_0x9d82('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d82('0x3'));var db=require(_0x9d82('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d82('0x5'))(_0x9d82('0x6'));var config=require('../../config/environment');var jayson=require(_0x9d82('0x7'));var client=jayson[_0x9d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12692f,_0x126a09,_0x5bf014){return new BPromise(function(_0x2da50c,_0x961e98){return client[_0x9d82('0x9')](_0x12692f,_0x5bf014)[_0x9d82('0xa')](function(_0xf29150){logger[_0x9d82('0xb')](_0x9d82('0xc'),_0x126a09,'request\x20sent');logger[_0x9d82('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x126a09,_0x9d82('0xe'),JSON['stringify'](_0xf29150));if(_0xf29150[_0x9d82('0xf')]){if(_0xf29150[_0x9d82('0xf')]['code']===0x1f4){logger['error'](_0x9d82('0xc'),_0x126a09,_0xf29150['error'][_0x9d82('0x10')]);return _0x961e98(_0xf29150[_0x9d82('0xf')][_0x9d82('0x10')]);}logger[_0x9d82('0xf')](_0x9d82('0xc'),_0x126a09,_0xf29150['error']['message']);return _0x2da50c(_0xf29150[_0x9d82('0xf')]['message']);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x126a09,'request\x20sent');_0x2da50c(_0xf29150[_0x9d82('0x11')][_0x9d82('0x10')]);}})[_0x9d82('0x12')](function(_0x5a7aab){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x126a09,_0x5a7aab);_0x961e98(_0x5a7aab);});});}exports[_0x9d82('0x13')]=function(_0xe0d0c1){var _0x3d66ec=this;return new Promise(function(_0x1d8be4,_0x3a3f35){return db[_0x9d82('0x14')][_0x9d82('0x15')](_0xe0d0c1[_0x9d82('0x16')],{'raw':_0xe0d0c1['options']?_0xe0d0c1[_0x9d82('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x9d82('0xa')](function(_0x313099){logger[_0x9d82('0xb')]('CreateFaxQueueReport',_0xe0d0c1);logger[_0x9d82('0xd')]('CreateFaxQueueReport',_0xe0d0c1,JSON['stringify'](_0x313099));_0x1d8be4(_0x313099);})[_0x9d82('0x12')](function(_0x2df6f6){logger[_0x9d82('0xf')]('CreateFaxQueueReport',_0x2df6f6[_0x9d82('0x10')],_0xe0d0c1);_0x3a3f35(_0x3d66ec[_0x9d82('0xf')](0x1f4,_0x2df6f6['message']));});});};exports[_0x9d82('0x18')]=function(_0x157358){var _0x47f0bb=this;return new Promise(function(_0xff45bf,_0x5b9eb6){return db[_0x9d82('0x14')][_0x9d82('0x19')](_0x157358['body'],{'raw':_0x157358[_0x9d82('0x17')]?_0x157358[_0x9d82('0x17')][_0x9d82('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x157358[_0x9d82('0x17')]?_0x157358[_0x9d82('0x17')]['where']||null:null,'attributes':_0x157358[_0x9d82('0x17')]?_0x157358[_0x9d82('0x17')][_0x9d82('0x1b')]||null:null,'limit':_0x157358['options']?_0x157358['options']['limit']||null:null})[_0x9d82('0xa')](function(_0x3e022e){logger[_0x9d82('0xb')]('UpdateFaxQueueReport',_0x157358);logger[_0x9d82('0xd')]('UpdateFaxQueueReport',_0x157358,JSON['stringify'](_0x3e022e));_0xff45bf(_0x3e022e);})['catch'](function(_0x414c2c){logger['error'](_0x9d82('0x18'),_0x414c2c[_0x9d82('0x10')],_0x157358);_0x5b9eb6(_0x47f0bb['error'](0x1f4,_0x414c2c['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 4ca575a..7f32e7f 100644 --- a/server/api/faxQueueReport/index.js +++ b/server/api/faxQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa690=['connect-timeout','Router','../../components/auth/service','../../config/environment','./faxQueueReport.controller','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2e5a17,_0x558f0e){var _0x24f53d=function(_0x564eb5){while(--_0x564eb5){_0x2e5a17['push'](_0x2e5a17['shift']());}};_0x24f53d(++_0x558f0e);}(_0xa690,0xcf));var _0x0a69=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0xa690[_0x1aba25];return _0x47d997;};'use strict';var multer=require(_0x0a69('0x0'));var util=require(_0x0a69('0x1'));var path=require(_0x0a69('0x2'));var timeout=require(_0x0a69('0x3'));var express=require('express');var router=express[_0x0a69('0x4')]();var auth=require(_0x0a69('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0a69('0x6'));var controller=require(_0x0a69('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0a69('0x8')]);router['get'](_0x0a69('0x9'),auth[_0x0a69('0xa')](),controller[_0x0a69('0xb')]);router['get'](_0x0a69('0xc'),auth[_0x0a69('0xa')](),controller[_0x0a69('0xd')]);router[_0x0a69('0xe')]('/',auth[_0x0a69('0xa')](),controller[_0x0a69('0xf')]);router[_0x0a69('0x10')]('/:id',auth[_0x0a69('0xa')](),controller[_0x0a69('0x11')]);router[_0x0a69('0x12')](_0x0a69('0xc'),auth[_0x0a69('0xa')](),controller[_0x0a69('0x13')]);module[_0x0a69('0x14')]=router; \ No newline at end of file +var _0xdd20=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','connect-timeout','express','./faxQueueReport.controller'];(function(_0x242c30,_0x30c07b){var _0x49ed1b=function(_0x4c89b3){while(--_0x4c89b3){_0x242c30['push'](_0x242c30['shift']());}};_0x49ed1b(++_0x30c07b);}(_0xdd20,0x172));var _0x0dd2=function(_0x4f336f,_0x13072c){_0x4f336f=_0x4f336f-0x0;var _0x48578f=_0xdd20[_0x4f336f];return _0x48578f;};'use strict';var multer=require(_0x0dd2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0dd2('0x1'));var express=require(_0x0dd2('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0dd2('0x3'));router[_0x0dd2('0x4')]('/',auth[_0x0dd2('0x5')](),controller[_0x0dd2('0x6')]);router[_0x0dd2('0x4')](_0x0dd2('0x7'),auth[_0x0dd2('0x5')](),controller[_0x0dd2('0x8')]);router[_0x0dd2('0x4')](_0x0dd2('0x9'),auth[_0x0dd2('0x5')](),controller[_0x0dd2('0xa')]);router[_0x0dd2('0xb')]('/',auth[_0x0dd2('0x5')](),controller[_0x0dd2('0xc')]);router['put'](_0x0dd2('0x9'),auth[_0x0dd2('0x5')](),controller[_0x0dd2('0xd')]);router[_0x0dd2('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0dd2('0xf')]);module[_0x0dd2('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index d809707..272d888 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5712=['queue','NOW','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5712,0x1d0));var _0x2571=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5712[_0x5b644e];return _0x49c6bf;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2571('0x0')]('account','agent',_0x2571('0x1')),'allowNull':![],'defaultValue':_0x2571('0x1')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x2571('0x2')]}}; \ No newline at end of file +var _0x4835=['queue','NOW','moment','sequelize','exports','STRING','ENUM','account'];(function(_0xc932e7,_0x40e588){var _0x59fecc=function(_0x23d884){while(--_0x23d884){_0xc932e7['push'](_0xc932e7['shift']());}};_0x59fecc(++_0x40e588);}(_0x4835,0x13a));var _0x5483=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4835[_0x122ef9];return _0x42fba0;};'use strict';var moment=require(_0x5483('0x0'));var Sequelize=require(_0x5483('0x1'));module[_0x5483('0x2')]={'uniqueid':{'type':Sequelize[_0x5483('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5483('0x4')](_0x5483('0x5'),'agent','queue'),'allowNull':![],'defaultValue':_0x5483('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x5483('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 8438670..d787fbf 100644 --- a/server/api/faxTransferReport/faxTransferReport.controller.js +++ b/server/api/faxTransferReport/faxTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8d0=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','FaxTransferReport','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','filters','filter','merge','type','key','options','count','rows','catch','show','params','includeAll','include','find','create','body','describe'];(function(_0x3a1776,_0xadf855){var _0x2100c6=function(_0x3ee0e5){while(--_0x3ee0e5){_0x3a1776['push'](_0x3a1776['shift']());}};_0x2100c6(++_0xadf855);}(_0xa8d0,0x11c));var _0x0a8d=function(_0x3aa9c7,_0x629939){_0x3aa9c7=_0x3aa9c7-0x0;var _0x4ed413=_0xa8d0[_0x3aa9c7];return _0x4ed413;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0a8d('0x0'));var rimraf=require(_0x0a8d('0x1'));var zipdir=require(_0x0a8d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a8d('0x3'));var moment=require(_0x0a8d('0x4'));var BPromise=require(_0x0a8d('0x5'));var Mustache=require(_0x0a8d('0x6'));var util=require('util');var path=require(_0x0a8d('0x7'));var sox=require(_0x0a8d('0x8'));var csv=require('to-csv');var ejs=require(_0x0a8d('0x9'));var fs=require('fs');var _=require(_0x0a8d('0xa'));var squel=require(_0x0a8d('0xb'));var crypto=require('crypto');var jsforce=require(_0x0a8d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0a8d('0xd'));var querystring=require(_0x0a8d('0xe'));var Papa=require(_0x0a8d('0xf'));var Redis=require(_0x0a8d('0x10'));var authService=require(_0x0a8d('0x11'));var qs=require(_0x0a8d('0x12'));var hardwareService=require(_0x0a8d('0x13'));var logger=require('../../config/logger')(_0x0a8d('0x14'));var utils=require(_0x0a8d('0x15'));var config=require(_0x0a8d('0x16'));var db=require(_0x0a8d('0x17'))['db'];function respondWithStatusCode(_0x412ed5,_0x3c807c){_0x3c807c=_0x3c807c||0xcc;return function(_0x21c27c){if(_0x21c27c){return _0x412ed5[_0x0a8d('0x18')](_0x3c807c);}return _0x412ed5[_0x0a8d('0x19')](_0x3c807c)[_0x0a8d('0x1a')]();};}function respondWithResult(_0x2fcd6b,_0x1e4fd8){_0x1e4fd8=_0x1e4fd8||0xc8;return function(_0x524980){if(_0x524980){return _0x2fcd6b[_0x0a8d('0x19')](_0x1e4fd8)[_0x0a8d('0x1b')](_0x524980);}};}function respondWithFilteredResult(_0x463ad7,_0x301f8c){return function(_0x59108a){if(_0x59108a){var _0x42b0ff=_0x59108a['count'],_0x29c964=_0x301f8c['offset'],_0x49a5f1=_0x301f8c[_0x0a8d('0x1c')]+_0x301f8c[_0x0a8d('0x1d')],_0x5ca0d4;if(_0x49a5f1>=_0x42b0ff){_0x49a5f1=_0x42b0ff;_0x5ca0d4=0xc8;}else{_0x5ca0d4=0xce;}_0x463ad7[_0x0a8d('0x19')](_0x5ca0d4);return _0x463ad7[_0x0a8d('0x1e')](_0x0a8d('0x1f'),_0x29c964+'-'+_0x49a5f1+'/'+_0x42b0ff)[_0x0a8d('0x1b')](_0x59108a);}return null;};}function patchUpdates(_0x499522){return function(_0xc43a7a){try{jsonpatch['apply'](_0xc43a7a,_0x499522,!![]);}catch(_0x4561e8){return BPromise[_0x0a8d('0x20')](_0x4561e8);}return _0xc43a7a[_0x0a8d('0x21')]();};}function saveUpdates(_0x42060c,_0xb26a2f){return function(_0x392070){if(_0x392070){return _0x392070[_0x0a8d('0x22')](_0x42060c)[_0x0a8d('0x23')](function(_0x1e0aaa){return _0x1e0aaa;});}return null;};}function removeEntity(_0x2b6707,_0x35b36e){return function(_0x30c12d){if(_0x30c12d){return _0x30c12d[_0x0a8d('0x24')]()[_0x0a8d('0x23')](function(){_0x2b6707[_0x0a8d('0x19')](0xcc)[_0x0a8d('0x1a')]();});}};}function handleEntityNotFound(_0x3a8710,_0x3cf9e6){return function(_0x4e4334){if(!_0x4e4334){_0x3a8710['sendStatus'](0x194);}return _0x4e4334;};}function handleError(_0x2d552b,_0x8b4a0b){_0x8b4a0b=_0x8b4a0b||0x1f4;return function(_0x544589){logger[_0x0a8d('0x25')](_0x544589[_0x0a8d('0x26')]);if(_0x544589[_0x0a8d('0x27')]){delete _0x544589[_0x0a8d('0x27')];}_0x2d552b[_0x0a8d('0x19')](_0x8b4a0b)[_0x0a8d('0x28')](_0x544589);};}exports[_0x0a8d('0x29')]=function(_0x33b41d,_0x410064){var _0x2d26b6={},_0x4c03b4={},_0x9ddc2e={'count':0x0,'rows':[]};var _0x28ec78=db[_0x0a8d('0x2a')][_0x0a8d('0x2b')];_0x4c03b4['model']=_['keys'](_0x28ec78);_0x4c03b4['query']=_[_0x0a8d('0x2c')](_0x33b41d[_0x0a8d('0x2d')]);_0x4c03b4['filters']=_[_0x0a8d('0x2e')](_0x4c03b4[_0x0a8d('0x2f')],_0x4c03b4[_0x0a8d('0x2d')]);_0x2d26b6['attributes']=_[_0x0a8d('0x2e')](_0x4c03b4[_0x0a8d('0x2f')],qs[_0x0a8d('0x30')](_0x33b41d[_0x0a8d('0x2d')]['fields']));_0x2d26b6[_0x0a8d('0x31')]=_0x2d26b6['attributes'][_0x0a8d('0x32')]?_0x2d26b6[_0x0a8d('0x31')]:_0x4c03b4['model'];if(!_0x33b41d[_0x0a8d('0x2d')][_0x0a8d('0x33')]('nolimit')){_0x2d26b6['limit']=qs[_0x0a8d('0x1d')](_0x33b41d[_0x0a8d('0x2d')][_0x0a8d('0x1d')]);_0x2d26b6[_0x0a8d('0x1c')]=qs[_0x0a8d('0x1c')](_0x33b41d[_0x0a8d('0x2d')]['offset']);}_0x2d26b6['order']=qs[_0x0a8d('0x34')](_0x33b41d['query']['sort']);_0x2d26b6[_0x0a8d('0x35')]=qs[_0x0a8d('0x36')](_['pick'](_0x33b41d['query'],_0x4c03b4['filters']));if(_0x33b41d[_0x0a8d('0x2d')][_0x0a8d('0x37')]){_0x2d26b6[_0x0a8d('0x35')]=_[_0x0a8d('0x38')](_0x2d26b6[_0x0a8d('0x35')],{'$or':_['map'](_0x28ec78,function(_0x3bb62f){if(_0x3bb62f[_0x0a8d('0x39')][_0x0a8d('0x3a')]!=='VIRTUAL'){var _0x56dc8e={};_0x56dc8e[_0x3bb62f['field']]={'$like':'%'+_0x33b41d[_0x0a8d('0x2d')][_0x0a8d('0x37')]+'%'};return _0x56dc8e;}})});}_0x2d26b6=_[_0x0a8d('0x38')]({},_0x2d26b6,_0x33b41d[_0x0a8d('0x3b')]);var _0xf29ea6={'where':_0x2d26b6[_0x0a8d('0x35')]};return db[_0x0a8d('0x2a')]['count'](_0xf29ea6)[_0x0a8d('0x23')](function(_0x442d7e){_0x9ddc2e[_0x0a8d('0x3c')]=_0x442d7e;if(_0x33b41d[_0x0a8d('0x2d')]['includeAll']){_0x2d26b6['include']=[{'all':!![]}];}return db[_0x0a8d('0x2a')]['findAll'](_0x2d26b6);})['then'](function(_0x11e03e){_0x9ddc2e[_0x0a8d('0x3d')]=_0x11e03e;return _0x9ddc2e;})['then'](respondWithFilteredResult(_0x410064,_0x2d26b6))[_0x0a8d('0x3e')](handleError(_0x410064,null));};exports[_0x0a8d('0x3f')]=function(_0x2881e2,_0x905c50){var _0x5f465d={'raw':!![],'where':{'id':_0x2881e2[_0x0a8d('0x40')]['id']}},_0xd4292f={};_0xd4292f[_0x0a8d('0x2f')]=_[_0x0a8d('0x2c')](db[_0x0a8d('0x2a')][_0x0a8d('0x2b')]);_0xd4292f[_0x0a8d('0x2d')]=_[_0x0a8d('0x2c')](_0x2881e2[_0x0a8d('0x2d')]);_0xd4292f[_0x0a8d('0x36')]=_['intersection'](_0xd4292f['model'],_0xd4292f[_0x0a8d('0x2d')]);_0x5f465d[_0x0a8d('0x31')]=_[_0x0a8d('0x2e')](_0xd4292f[_0x0a8d('0x2f')],qs['fields'](_0x2881e2[_0x0a8d('0x2d')][_0x0a8d('0x30')]));_0x5f465d['attributes']=_0x5f465d[_0x0a8d('0x31')][_0x0a8d('0x32')]?_0x5f465d[_0x0a8d('0x31')]:_0xd4292f[_0x0a8d('0x2f')];if(_0x2881e2[_0x0a8d('0x2d')][_0x0a8d('0x41')]){_0x5f465d[_0x0a8d('0x42')]=[{'all':!![]}];}_0x5f465d=_[_0x0a8d('0x38')]({},_0x5f465d,_0x2881e2['options']);return db[_0x0a8d('0x2a')][_0x0a8d('0x43')](_0x5f465d)[_0x0a8d('0x23')](handleEntityNotFound(_0x905c50,null))[_0x0a8d('0x23')](respondWithResult(_0x905c50,null))[_0x0a8d('0x3e')](handleError(_0x905c50,null));};exports[_0x0a8d('0x44')]=function(_0x58142c,_0x179b26){return db['FaxTransferReport'][_0x0a8d('0x44')](_0x58142c[_0x0a8d('0x45')],{})[_0x0a8d('0x23')](respondWithResult(_0x179b26,0xc9))['catch'](handleError(_0x179b26,null));};exports[_0x0a8d('0x22')]=function(_0x32da1e,_0x4a59f0){if(_0x32da1e[_0x0a8d('0x45')]['id']){delete _0x32da1e['body']['id'];}return db[_0x0a8d('0x2a')][_0x0a8d('0x43')]({'where':{'id':_0x32da1e[_0x0a8d('0x40')]['id']}})[_0x0a8d('0x23')](handleEntityNotFound(_0x4a59f0,null))[_0x0a8d('0x23')](saveUpdates(_0x32da1e[_0x0a8d('0x45')],null))[_0x0a8d('0x23')](respondWithResult(_0x4a59f0,null))[_0x0a8d('0x3e')](handleError(_0x4a59f0,null));};exports['destroy']=function(_0x5d0b70,_0x4c57bc){return db[_0x0a8d('0x2a')][_0x0a8d('0x43')]({'where':{'id':_0x5d0b70[_0x0a8d('0x40')]['id']}})[_0x0a8d('0x23')](handleEntityNotFound(_0x4c57bc,null))['then'](removeEntity(_0x4c57bc,null))['catch'](handleError(_0x4c57bc,null));};exports[_0x0a8d('0x46')]=function(_0x575e0e,_0x3ebb0d){return db[_0x0a8d('0x2a')][_0x0a8d('0x46')]()[_0x0a8d('0x23')](respondWithResult(_0x3ebb0d,null))[_0x0a8d('0x3e')](handleError(_0x3ebb0d,null));}; \ No newline at end of file +var _0xb6b2=['end','count','offset','set','Content-Range','json','apply','save','update','then','error','name','send','index','FaxTransferReport','rawAttributes','model','keys','query','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','merge','map','key','VIRTUAL','field','filter','includeAll','include','findAll','rows','show','params','intersection','options','find','catch','create','body','describe','html-pdf','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status'];(function(_0x1b8123,_0x2eb8b4){var _0x2e6887=function(_0x52220a){while(--_0x52220a){_0x1b8123['push'](_0x1b8123['shift']());}};_0x2e6887(++_0x2eb8b4);}(_0xb6b2,0x1e0));var _0x2b6b=function(_0x20d7b8,_0x41b1d4){_0x20d7b8=_0x20d7b8-0x0;var _0x366040=_0xb6b2[_0x20d7b8];return _0x366040;};'use strict';var pdf=require(_0x2b6b('0x0'));var emlformat=require(_0x2b6b('0x1'));var rimraf=require(_0x2b6b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2b6b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2b6b('0x4'));var util=require(_0x2b6b('0x5'));var path=require(_0x2b6b('0x6'));var sox=require(_0x2b6b('0x7'));var csv=require(_0x2b6b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2b6b('0x9'));var squel=require(_0x2b6b('0xa'));var crypto=require(_0x2b6b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2b6b('0xc'));var toCsv=require(_0x2b6b('0x8'));var querystring=require(_0x2b6b('0xd'));var Papa=require(_0x2b6b('0xe'));var Redis=require(_0x2b6b('0xf'));var authService=require(_0x2b6b('0x10'));var qs=require(_0x2b6b('0x11'));var hardwareService=require(_0x2b6b('0x12'));var logger=require(_0x2b6b('0x13'))(_0x2b6b('0x14'));var utils=require(_0x2b6b('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x120dfa,_0x470dbf){_0x470dbf=_0x470dbf||0xcc;return function(_0x1cd4fd){if(_0x1cd4fd){return _0x120dfa[_0x2b6b('0x16')](_0x470dbf);}return _0x120dfa[_0x2b6b('0x17')](_0x470dbf)[_0x2b6b('0x18')]();};}function respondWithResult(_0x27a87d,_0x42a145){_0x42a145=_0x42a145||0xc8;return function(_0x5be7ec){if(_0x5be7ec){return _0x27a87d[_0x2b6b('0x17')](_0x42a145)['json'](_0x5be7ec);}};}function respondWithFilteredResult(_0x382b52,_0x242ca1){return function(_0x2ad1d9){if(_0x2ad1d9){var _0x4a78b7=_0x2ad1d9[_0x2b6b('0x19')],_0x243700=_0x242ca1[_0x2b6b('0x1a')],_0x4b503f=_0x242ca1['offset']+_0x242ca1['limit'],_0x5d9b5f;if(_0x4b503f>=_0x4a78b7){_0x4b503f=_0x4a78b7;_0x5d9b5f=0xc8;}else{_0x5d9b5f=0xce;}_0x382b52[_0x2b6b('0x17')](_0x5d9b5f);return _0x382b52[_0x2b6b('0x1b')](_0x2b6b('0x1c'),_0x243700+'-'+_0x4b503f+'/'+_0x4a78b7)[_0x2b6b('0x1d')](_0x2ad1d9);}return null;};}function patchUpdates(_0x440aaf){return function(_0x57cbb1){try{jsonpatch[_0x2b6b('0x1e')](_0x57cbb1,_0x440aaf,!![]);}catch(_0x3155d3){return BPromise['reject'](_0x3155d3);}return _0x57cbb1[_0x2b6b('0x1f')]();};}function saveUpdates(_0x383821,_0x25f0ad){return function(_0x2d8069){if(_0x2d8069){return _0x2d8069[_0x2b6b('0x20')](_0x383821)[_0x2b6b('0x21')](function(_0xbb8eee){return _0xbb8eee;});}return null;};}function removeEntity(_0x635a43,_0x2dbea6){return function(_0x160715){if(_0x160715){return _0x160715['destroy']()[_0x2b6b('0x21')](function(){_0x635a43[_0x2b6b('0x17')](0xcc)[_0x2b6b('0x18')]();});}};}function handleEntityNotFound(_0x450d99,_0x24aa6e){return function(_0x548cc2){if(!_0x548cc2){_0x450d99[_0x2b6b('0x16')](0x194);}return _0x548cc2;};}function handleError(_0x48f0d5,_0x3572c8){_0x3572c8=_0x3572c8||0x1f4;return function(_0x5de24d){logger[_0x2b6b('0x22')](_0x5de24d['stack']);if(_0x5de24d[_0x2b6b('0x23')]){delete _0x5de24d[_0x2b6b('0x23')];}_0x48f0d5[_0x2b6b('0x17')](_0x3572c8)[_0x2b6b('0x24')](_0x5de24d);};}exports[_0x2b6b('0x25')]=function(_0x4de50a,_0x3f1d59){var _0x23cfd3={},_0x3e010d={},_0x3531a3={'count':0x0,'rows':[]};var _0x384b15=db[_0x2b6b('0x26')][_0x2b6b('0x27')];_0x3e010d[_0x2b6b('0x28')]=_[_0x2b6b('0x29')](_0x384b15);_0x3e010d[_0x2b6b('0x2a')]=_[_0x2b6b('0x29')](_0x4de50a[_0x2b6b('0x2a')]);_0x3e010d['filters']=_['intersection'](_0x3e010d['model'],_0x3e010d['query']);_0x23cfd3[_0x2b6b('0x2b')]=_['intersection'](_0x3e010d['model'],qs[_0x2b6b('0x2c')](_0x4de50a[_0x2b6b('0x2a')][_0x2b6b('0x2c')]));_0x23cfd3[_0x2b6b('0x2b')]=_0x23cfd3[_0x2b6b('0x2b')][_0x2b6b('0x2d')]?_0x23cfd3['attributes']:_0x3e010d[_0x2b6b('0x28')];if(!_0x4de50a[_0x2b6b('0x2a')]['hasOwnProperty'](_0x2b6b('0x2e'))){_0x23cfd3[_0x2b6b('0x2f')]=qs[_0x2b6b('0x2f')](_0x4de50a[_0x2b6b('0x2a')][_0x2b6b('0x2f')]);_0x23cfd3[_0x2b6b('0x1a')]=qs['offset'](_0x4de50a['query']['offset']);}_0x23cfd3[_0x2b6b('0x30')]=qs[_0x2b6b('0x31')](_0x4de50a[_0x2b6b('0x2a')][_0x2b6b('0x31')]);_0x23cfd3[_0x2b6b('0x32')]=qs[_0x2b6b('0x33')](_[_0x2b6b('0x34')](_0x4de50a[_0x2b6b('0x2a')],_0x3e010d['filters']));if(_0x4de50a[_0x2b6b('0x2a')]['filter']){_0x23cfd3[_0x2b6b('0x32')]=_[_0x2b6b('0x35')](_0x23cfd3['where'],{'$or':_[_0x2b6b('0x36')](_0x384b15,function(_0x533f37){if(_0x533f37['type'][_0x2b6b('0x37')]!==_0x2b6b('0x38')){var _0x3fe7f2={};_0x3fe7f2[_0x533f37[_0x2b6b('0x39')]]={'$like':'%'+_0x4de50a[_0x2b6b('0x2a')][_0x2b6b('0x3a')]+'%'};return _0x3fe7f2;}})});}_0x23cfd3=_[_0x2b6b('0x35')]({},_0x23cfd3,_0x4de50a['options']);var _0x22f650={'where':_0x23cfd3[_0x2b6b('0x32')]};return db['FaxTransferReport'][_0x2b6b('0x19')](_0x22f650)[_0x2b6b('0x21')](function(_0x238f67){_0x3531a3[_0x2b6b('0x19')]=_0x238f67;if(_0x4de50a['query'][_0x2b6b('0x3b')]){_0x23cfd3[_0x2b6b('0x3c')]=[{'all':!![]}];}return db[_0x2b6b('0x26')][_0x2b6b('0x3d')](_0x23cfd3);})[_0x2b6b('0x21')](function(_0x4e208e){_0x3531a3[_0x2b6b('0x3e')]=_0x4e208e;return _0x3531a3;})['then'](respondWithFilteredResult(_0x3f1d59,_0x23cfd3))['catch'](handleError(_0x3f1d59,null));};exports[_0x2b6b('0x3f')]=function(_0x3e6c10,_0xc24704){var _0x5c110d={'raw':!![],'where':{'id':_0x3e6c10[_0x2b6b('0x40')]['id']}},_0x415d65={};_0x415d65[_0x2b6b('0x28')]=_[_0x2b6b('0x29')](db[_0x2b6b('0x26')][_0x2b6b('0x27')]);_0x415d65[_0x2b6b('0x2a')]=_[_0x2b6b('0x29')](_0x3e6c10[_0x2b6b('0x2a')]);_0x415d65[_0x2b6b('0x33')]=_['intersection'](_0x415d65['model'],_0x415d65[_0x2b6b('0x2a')]);_0x5c110d['attributes']=_[_0x2b6b('0x41')](_0x415d65[_0x2b6b('0x28')],qs[_0x2b6b('0x2c')](_0x3e6c10['query'][_0x2b6b('0x2c')]));_0x5c110d['attributes']=_0x5c110d['attributes']['length']?_0x5c110d[_0x2b6b('0x2b')]:_0x415d65[_0x2b6b('0x28')];if(_0x3e6c10['query'][_0x2b6b('0x3b')]){_0x5c110d['include']=[{'all':!![]}];}_0x5c110d=_[_0x2b6b('0x35')]({},_0x5c110d,_0x3e6c10[_0x2b6b('0x42')]);return db['FaxTransferReport'][_0x2b6b('0x43')](_0x5c110d)[_0x2b6b('0x21')](handleEntityNotFound(_0xc24704,null))[_0x2b6b('0x21')](respondWithResult(_0xc24704,null))[_0x2b6b('0x44')](handleError(_0xc24704,null));};exports[_0x2b6b('0x45')]=function(_0x118331,_0x30ff8d){return db[_0x2b6b('0x26')][_0x2b6b('0x45')](_0x118331[_0x2b6b('0x46')],{})[_0x2b6b('0x21')](respondWithResult(_0x30ff8d,0xc9))[_0x2b6b('0x44')](handleError(_0x30ff8d,null));};exports[_0x2b6b('0x20')]=function(_0x2147f3,_0x239601){if(_0x2147f3[_0x2b6b('0x46')]['id']){delete _0x2147f3[_0x2b6b('0x46')]['id'];}return db['FaxTransferReport'][_0x2b6b('0x43')]({'where':{'id':_0x2147f3[_0x2b6b('0x40')]['id']}})[_0x2b6b('0x21')](handleEntityNotFound(_0x239601,null))[_0x2b6b('0x21')](saveUpdates(_0x2147f3[_0x2b6b('0x46')],null))[_0x2b6b('0x21')](respondWithResult(_0x239601,null))[_0x2b6b('0x44')](handleError(_0x239601,null));};exports['destroy']=function(_0x58e862,_0x58eeef){return db[_0x2b6b('0x26')]['find']({'where':{'id':_0x58e862[_0x2b6b('0x40')]['id']}})[_0x2b6b('0x21')](handleEntityNotFound(_0x58eeef,null))[_0x2b6b('0x21')](removeEntity(_0x58eeef,null))[_0x2b6b('0x44')](handleError(_0x58eeef,null));};exports[_0x2b6b('0x47')]=function(_0x3eb4d0,_0x365015){return db['FaxTransferReport'][_0x2b6b('0x47')]()['then'](respondWithResult(_0x365015,null))[_0x2b6b('0x44')](handleError(_0x365015,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 64c4bb8..e9c39ab 100644 --- a/server/api/faxTransferReport/faxTransferReport.model.js +++ b/server/api/faxTransferReport/faxTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4c3=['./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x35dd64,_0x861f54){var _0x328362=function(_0x116729){while(--_0x116729){_0x35dd64['push'](_0x35dd64['shift']());}};_0x328362(++_0x861f54);}(_0xe4c3,0x14a));var _0x3e4c=function(_0x30fd07,_0x3ba39b){_0x30fd07=_0x30fd07-0x0;var _0x4159b4=_0xe4c3[_0x30fd07];return _0x4159b4;};'use strict';var _=require(_0x3e4c('0x0'));var util=require(_0x3e4c('0x1'));var logger=require(_0x3e4c('0x2'))('api');var moment=require(_0x3e4c('0x3'));var BPromise=require('bluebird');var rp=require(_0x3e4c('0x4'));var fs=require('fs');var path=require(_0x3e4c('0x5'));var rimraf=require(_0x3e4c('0x6'));var config=require(_0x3e4c('0x7'));var attributes=require(_0x3e4c('0x8'));module[_0x3e4c('0x9')]=function(_0x2b4804,_0x4c855d){return _0x2b4804['define'](_0x3e4c('0xa'),attributes,{'tableName':_0x3e4c('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3e4c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd2f2=['path','../../config/environment','exports','define','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x49864d,_0x43d22c){var _0x22a0e1=function(_0x249d16){while(--_0x249d16){_0x49864d['push'](_0x49864d['shift']());}};_0x22a0e1(++_0x43d22c);}(_0xd2f2,0x16d));var _0x2d2f=function(_0x82f6bd,_0x2c3fd0){_0x82f6bd=_0x82f6bd-0x0;var _0x595e0a=_0xd2f2[_0x82f6bd];return _0x595e0a;};'use strict';var _=require(_0x2d2f('0x0'));var util=require(_0x2d2f('0x1'));var logger=require(_0x2d2f('0x2'))('api');var moment=require(_0x2d2f('0x3'));var BPromise=require(_0x2d2f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d2f('0x5'));var rimraf=require('rimraf');var config=require(_0x2d2f('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0x2d2f('0x7')]=function(_0x469734,_0x1a027){return _0x469734[_0x2d2f('0x8')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x2d2f('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index bdad06c..b780889 100644 --- a/server/api/faxTransferReport/faxTransferReport.rpc.js +++ b/server/api/faxTransferReport/faxTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93a0=['jayson/promise','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x93a0,0x1c5));var _0x093a=function(_0x1764f7,_0x527c82){_0x1764f7=_0x1764f7-0x0;var _0x4ae09c=_0x93a0[_0x1764f7];return _0x4ae09c;};'use strict';var _=require(_0x093a('0x0'));var util=require('util');var moment=require(_0x093a('0x1'));var BPromise=require(_0x093a('0x2'));var rs=require(_0x093a('0x3'));var fs=require('fs');var Redis=require(_0x093a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x093a('0x5'));var logger=require(_0x093a('0x6'))(_0x093a('0x7'));var config=require(_0x093a('0x8'));var jayson=require(_0x093a('0x9'));var client=jayson['client'][_0x093a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44b22f,_0x47ffe4,_0x192f42){return new BPromise(function(_0x189f50,_0x5c7347){return client[_0x093a('0xb')](_0x44b22f,_0x192f42)[_0x093a('0xc')](function(_0x5044ab){logger[_0x093a('0xd')](_0x093a('0xe'),_0x47ffe4,'request\x20sent');logger['debug'](_0x093a('0xf'),_0x47ffe4,_0x093a('0x10'),JSON[_0x093a('0x11')](_0x5044ab));if(_0x5044ab[_0x093a('0x12')]){if(_0x5044ab[_0x093a('0x12')]['code']===0x1f4){logger[_0x093a('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x47ffe4,_0x5044ab[_0x093a('0x12')][_0x093a('0x13')]);return _0x5c7347(_0x5044ab[_0x093a('0x12')][_0x093a('0x13')]);}logger[_0x093a('0x12')](_0x093a('0xe'),_0x47ffe4,_0x5044ab[_0x093a('0x12')]['message']);return _0x189f50(_0x5044ab['error'][_0x093a('0x13')]);}else{logger[_0x093a('0xd')](_0x093a('0xe'),_0x47ffe4,_0x093a('0x10'));_0x189f50(_0x5044ab[_0x093a('0x14')][_0x093a('0x13')]);}})[_0x093a('0x15')](function(_0x444941){logger[_0x093a('0x12')](_0x093a('0xe'),_0x47ffe4,_0x444941);_0x5c7347(_0x444941);});});} \ No newline at end of file +var _0xd167=['request','info','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0xd167,0x132));var _0x7d16=function(_0x14d3b5,_0x4dbd31){_0x14d3b5=_0x14d3b5-0x0;var _0x5a3872=_0xd167[_0x14d3b5];return _0x5a3872;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7d16('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d16('0x1'))['db'];var utils=require(_0x7d16('0x2'));var logger=require(_0x7d16('0x3'))(_0x7d16('0x4'));var config=require(_0x7d16('0x5'));var jayson=require(_0x7d16('0x6'));var client=jayson[_0x7d16('0x7')][_0x7d16('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c9ff7,_0x1633c5,_0xdcdfbb){return new BPromise(function(_0xa46bec,_0x6717b4){return client[_0x7d16('0x9')](_0x4c9ff7,_0xdcdfbb)['then'](function(_0x3ae875){logger[_0x7d16('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x1633c5,'request\x20sent');logger[_0x7d16('0xb')](_0x7d16('0xc'),_0x1633c5,_0x7d16('0xd'),JSON[_0x7d16('0xe')](_0x3ae875));if(_0x3ae875[_0x7d16('0xf')]){if(_0x3ae875[_0x7d16('0xf')][_0x7d16('0x10')]===0x1f4){logger['error'](_0x7d16('0x11'),_0x1633c5,_0x3ae875[_0x7d16('0xf')][_0x7d16('0x12')]);return _0x6717b4(_0x3ae875['error']['message']);}logger[_0x7d16('0xf')](_0x7d16('0x11'),_0x1633c5,_0x3ae875[_0x7d16('0xf')][_0x7d16('0x12')]);return _0xa46bec(_0x3ae875[_0x7d16('0xf')][_0x7d16('0x12')]);}else{logger[_0x7d16('0xa')](_0x7d16('0x11'),_0x1633c5,_0x7d16('0xd'));_0xa46bec(_0x3ae875[_0x7d16('0x13')]['message']);}})[_0x7d16('0x14')](function(_0x59cb55){logger['error'](_0x7d16('0x11'),_0x1633c5,_0x59cb55);_0x6717b4(_0x59cb55);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 0d66f10..253c42f 100644 --- a/server/api/faxTransferReport/index.js +++ b/server/api/faxTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5db=['put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','show','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf5db,0xd8));var _0xbf5d=function(_0x991495,_0x1743d2){_0x991495=_0x991495-0x0;var _0xbfa5ce=_0xf5db[_0x991495];return _0xbfa5ce;};'use strict';var multer=require(_0xbf5d('0x0'));var util=require('util');var path=require(_0xbf5d('0x1'));var timeout=require(_0xbf5d('0x2'));var express=require(_0xbf5d('0x3'));var router=express[_0xbf5d('0x4')]();var auth=require(_0xbf5d('0x5'));var interaction=require(_0xbf5d('0x6'));var config=require(_0xbf5d('0x7'));var controller=require(_0xbf5d('0x8'));router[_0xbf5d('0x9')]('/',auth[_0xbf5d('0xa')](),controller['index']);router['get'](_0xbf5d('0xb'),auth[_0xbf5d('0xa')](),controller[_0xbf5d('0xc')]);router[_0xbf5d('0x9')]('/:id',auth[_0xbf5d('0xa')](),controller[_0xbf5d('0xd')]);router['post']('/',auth[_0xbf5d('0xa')](),controller[_0xbf5d('0xe')]);router[_0xbf5d('0xf')](_0xbf5d('0x10'),auth[_0xbf5d('0xa')](),controller[_0xbf5d('0x11')]);router[_0xbf5d('0x12')](_0xbf5d('0x10'),auth[_0xbf5d('0xa')](),controller[_0xbf5d('0x13')]);module[_0xbf5d('0x14')]=router; \ No newline at end of file +var _0xa507=['./faxTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xa507,0x19c));var _0x7a50=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0xa507[_0x4c7b20];return _0x4872bd;};'use strict';var multer=require(_0x7a50('0x0'));var util=require(_0x7a50('0x1'));var path=require(_0x7a50('0x2'));var timeout=require('connect-timeout');var express=require(_0x7a50('0x3'));var router=express[_0x7a50('0x4')]();var auth=require(_0x7a50('0x5'));var interaction=require(_0x7a50('0x6'));var config=require(_0x7a50('0x7'));var controller=require(_0x7a50('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7a50('0x9')]);router[_0x7a50('0xa')](_0x7a50('0xb'),auth[_0x7a50('0xc')](),controller[_0x7a50('0xd')]);router[_0x7a50('0xa')](_0x7a50('0xe'),auth[_0x7a50('0xc')](),controller[_0x7a50('0xf')]);router['post']('/',auth[_0x7a50('0xc')](),controller['create']);router[_0x7a50('0x10')](_0x7a50('0xe'),auth[_0x7a50('0xc')](),controller['update']);router[_0x7a50('0x11')](_0x7a50('0xe'),auth[_0x7a50('0xc')](),controller[_0x7a50('0x12')]);module[_0x7a50('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 79186b3..c640c17 100644 --- a/server/api/intDeskAccount/index.js +++ b/server/api/intDeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd0f=['addConfiguration','update','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','post','create'];(function(_0xfeed64,_0x2330e6){var _0x17e15a=function(_0x37e69d){while(--_0x37e69d){_0xfeed64['push'](_0xfeed64['shift']());}};_0x17e15a(++_0x2330e6);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x12b6c4,_0x245f4f){_0x12b6c4=_0x12b6c4-0x0;var _0x596402=_0xfd0f[_0x12b6c4];return _0x596402;};'use strict';var multer=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var path=require('path');var timeout=require(_0xffd0('0x2'));var express=require(_0xffd0('0x3'));var router=express[_0xffd0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xffd0('0x5'));var config=require('../../config/environment');var controller=require(_0xffd0('0x6'));router[_0xffd0('0x7')]('/',auth[_0xffd0('0x8')](),controller[_0xffd0('0x9')]);router[_0xffd0('0x7')](_0xffd0('0xa'),auth[_0xffd0('0x8')](),controller[_0xffd0('0xb')]);router[_0xffd0('0x7')]('/:id/configurations',auth[_0xffd0('0x8')](),controller[_0xffd0('0xc')]);router[_0xffd0('0x7')](_0xffd0('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xffd0('0xe')]('/',auth[_0xffd0('0x8')](),controller[_0xffd0('0xf')]);router['post']('/:id/configurations',auth[_0xffd0('0x8')](),controller[_0xffd0('0x10')]);router['put'](_0xffd0('0xa'),auth[_0xffd0('0x8')](),controller[_0xffd0('0x11')]);router['delete'](_0xffd0('0xa'),auth[_0xffd0('0x8')](),controller['destroy']);module[_0xffd0('0x12')]=router; \ No newline at end of file +var _0xcca7=['getFields','post','create','addConfiguration','/:id','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x831b25,_0x2284dd){var _0x1c1fd2=function(_0x15b532){while(--_0x15b532){_0x831b25['push'](_0x831b25['shift']());}};_0x1c1fd2(++_0x2284dd);}(_0xcca7,0x1aa));var _0x7cca=function(_0x366bc3,_0x732556){_0x366bc3=_0x366bc3-0x0;var _0x1683fc=_0xcca7[_0x366bc3];return _0x1683fc;};'use strict';var multer=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var path=require(_0x7cca('0x2'));var timeout=require(_0x7cca('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x7cca('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7cca('0x5'));var controller=require(_0x7cca('0x6'));router[_0x7cca('0x7')]('/',auth[_0x7cca('0x8')](),controller[_0x7cca('0x9')]);router[_0x7cca('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7cca('0xa')]);router[_0x7cca('0x7')](_0x7cca('0xb'),auth[_0x7cca('0x8')](),controller[_0x7cca('0xc')]);router[_0x7cca('0x7')](_0x7cca('0xd'),auth[_0x7cca('0x8')](),controller[_0x7cca('0xe')]);router[_0x7cca('0xf')]('/',auth['isAuthenticated'](),controller[_0x7cca('0x10')]);router[_0x7cca('0xf')](_0x7cca('0xb'),auth[_0x7cca('0x8')](),controller[_0x7cca('0x11')]);router['put'](_0x7cca('0x12'),auth[_0x7cca('0x8')](),controller[_0x7cca('0x13')]);router['delete']('/:id',auth[_0x7cca('0x8')](),controller[_0x7cca('0x14')]);module[_0x7cca('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 75c1c37..6dd50c9 100644 --- a/server/api/intDeskAccount/intDeskAccount.attributes.js +++ b/server/api/intDeskAccount/intDeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8baf=['basic','integrationTab','newTab','sequelize','exports','STRING','ENUM'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x8baf,0x1d1));var _0xf8ba=function(_0x432101,_0x10157d){_0x432101=_0x432101-0x0;var _0x484aad=_0x8baf[_0x432101];return _0x484aad;};'use strict';var Sequelize=require(_0xf8ba('0x0'));module[_0xf8ba('0x1')]={'name':{'type':Sequelize[_0xf8ba('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf8ba('0x2')]},'remoteUri':{'type':Sequelize[_0xf8ba('0x2')]},'authType':{'type':Sequelize[_0xf8ba('0x3')](_0xf8ba('0x4')),'defaultValue':_0xf8ba('0x4')},'password':{'type':Sequelize[_0xf8ba('0x2')]},'consumerKey':{'type':Sequelize[_0xf8ba('0x2')]},'consumerSecret':{'type':Sequelize[_0xf8ba('0x2')]},'token':{'type':Sequelize[_0xf8ba('0x2')]},'tokenSecret':{'type':Sequelize[_0xf8ba('0x2')]},'serverUrl':{'type':Sequelize[_0xf8ba('0x2')]},'type':{'type':Sequelize[_0xf8ba('0x3')](_0xf8ba('0x5'),_0xf8ba('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x411d=['integrationTab','newTab','sequelize','exports','STRING','ENUM'];(function(_0x5a69ab,_0x610049){var _0x27f2f7=function(_0x452a0c){while(--_0x452a0c){_0x5a69ab['push'](_0x5a69ab['shift']());}};_0x27f2f7(++_0x610049);}(_0x411d,0x16a));var _0xd411=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x411d[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xd411('0x0'));module[_0xd411('0x1')]={'name':{'type':Sequelize[_0xd411('0x2')]},'description':{'type':Sequelize[_0xd411('0x2')]},'username':{'type':Sequelize[_0xd411('0x2')]},'remoteUri':{'type':Sequelize[_0xd411('0x2')]},'authType':{'type':Sequelize[_0xd411('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0xd411('0x2')]},'consumerKey':{'type':Sequelize[_0xd411('0x2')]},'consumerSecret':{'type':Sequelize[_0xd411('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xd411('0x2')]},'serverUrl':{'type':Sequelize[_0xd411('0x2')]},'type':{'type':Sequelize[_0xd411('0x3')](_0xd411('0x4'),_0xd411('0x5')),'defaultValue':_0xd411('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 02276a5..a478b19 100644 --- a/server/api/intDeskAccount/intDeskAccount.controller.js +++ b/server/api/intDeskAccount/intDeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4974=['then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','DeskAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','map','key','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','show','params','create','body','find','getConfigurations','findOne','DeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','DeskField','getFields','priority','authType','username','password','consumerSecret','token','tokenSecret','substring','GET','format','application/json','headers','Authorization','Basic\x20%s','toString','base64','concat','_embedded','active','label','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x4974,0x1c8));var _0x4497=function(_0x30df16,_0x554ff4){_0x30df16=_0x30df16-0x0;var _0x3b618d=_0x4974[_0x30df16];return _0x3b618d;};'use strict';var pdf=require(_0x4497('0x0'));var emlformat=require(_0x4497('0x1'));var rimraf=require(_0x4497('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4497('0x3'));var rp=require(_0x4497('0x4'));var moment=require(_0x4497('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4497('0x6'));var util=require(_0x4497('0x7'));var path=require('path');var sox=require(_0x4497('0x8'));var csv=require(_0x4497('0x9'));var ejs=require(_0x4497('0xa'));var fs=require('fs');var _=require(_0x4497('0xb'));var squel=require(_0x4497('0xc'));var crypto=require(_0x4497('0xd'));var jsforce=require(_0x4497('0xe'));var deskjs=require(_0x4497('0xf'));var toCsv=require(_0x4497('0x9'));var querystring=require(_0x4497('0x10'));var Papa=require(_0x4497('0x11'));var Redis=require(_0x4497('0x12'));var authService=require(_0x4497('0x13'));var qs=require(_0x4497('0x14'));var hardwareService=require(_0x4497('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x4497('0x16'));var config=require(_0x4497('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x4497('0x18'));var client=jayson['client'][_0x4497('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2aec2a,_0x5489bc,_0x566358){if(_0x566358){var _0x44507e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44507e[_0x4497('0x1a')](_0x5489bc)){return _0x2aec2a;}else{throw new Error(_0x4497('0x1b'));}}else{return _0x2aec2a;}}function respondWithRpcPromise(_0x1343cd,_0x2b13b9,_0x12bf61,_0x35a685){return new BPromise(function(_0x26b512,_0x3d1009){var _0xe10a12=_0x35a685||client;return _0xe10a12['request'](_0x1343cd,_0x12bf61)[_0x4497('0x1c')](function(_0x501f91){logger[_0x4497('0x1d')](_0x4497('0x1e'),_0x2b13b9,_0x4497('0x1f'));logger['debug'](_0x4497('0x20'),_0x2b13b9,_0x4497('0x1f'),JSON[_0x4497('0x21')](_0x501f91));if(_0x501f91[_0x4497('0x22')]){if(_0x501f91[_0x4497('0x22')]['code']===0x1f4){logger['error'](_0x4497('0x1e'),_0x2b13b9,_0x501f91[_0x4497('0x22')]['message']);return _0x3d1009(_0x501f91['error'][_0x4497('0x23')]);}logger[_0x4497('0x22')](_0x4497('0x1e'),_0x2b13b9,_0x501f91[_0x4497('0x22')][_0x4497('0x23')]);return _0x26b512(_0x501f91[_0x4497('0x22')]['message']);}else{logger[_0x4497('0x1d')](_0x4497('0x1e'),_0x2b13b9,_0x4497('0x1f'));_0x26b512(_0x501f91[_0x4497('0x24')]['message']);}})[_0x4497('0x25')](function(_0x330cc2){logger['error'](_0x4497('0x1e'),_0x2b13b9,_0x330cc2);_0x3d1009(_0x330cc2);});});}function respondWithStatusCode(_0x5b372a,_0x3ca754){_0x3ca754=_0x3ca754||0xcc;return function(_0x2f0a92){if(_0x2f0a92){return _0x5b372a[_0x4497('0x26')](_0x3ca754);}return _0x5b372a[_0x4497('0x27')](_0x3ca754)[_0x4497('0x28')]();};}function respondWithResult(_0x568d7b,_0x50d1c9){_0x50d1c9=_0x50d1c9||0xc8;return function(_0x451cff){if(_0x451cff){return _0x568d7b['status'](_0x50d1c9)[_0x4497('0x29')](_0x451cff);}};}function respondWithFilteredResult(_0x36c6f7,_0x221ad3){return function(_0x154586){if(_0x154586){var _0xd4fa53=_0x154586['count'],_0x1d24aa=_0x221ad3[_0x4497('0x2a')],_0x25af1b=_0x221ad3[_0x4497('0x2a')]+_0x221ad3['limit'],_0x227242;if(_0x25af1b>=_0xd4fa53){_0x25af1b=_0xd4fa53;_0x227242=0xc8;}else{_0x227242=0xce;}_0x36c6f7[_0x4497('0x27')](_0x227242);return _0x36c6f7[_0x4497('0x2b')](_0x4497('0x2c'),_0x1d24aa+'-'+_0x25af1b+'/'+_0xd4fa53)[_0x4497('0x29')](_0x154586);}return null;};}function patchUpdates(_0x577986){return function(_0x5be174){try{jsonpatch[_0x4497('0x2d')](_0x5be174,_0x577986,!![]);}catch(_0x23892f){return BPromise[_0x4497('0x2e')](_0x23892f);}return _0x5be174[_0x4497('0x2f')]();};}function saveUpdates(_0x577f0e,_0x1d0650){return function(_0x20ffd5){if(_0x20ffd5){return _0x20ffd5[_0x4497('0x30')](_0x577f0e)['then'](function(_0x144437){return _0x144437;});}return null;};}function removeEntity(_0x2554ef,_0x5542ce){return function(_0x45c5c4){if(_0x45c5c4){return _0x45c5c4[_0x4497('0x31')]()['then'](function(){_0x2554ef[_0x4497('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9fbacf,_0xf60885){return function(_0x319450){if(!_0x319450){_0x9fbacf[_0x4497('0x26')](0x194);}return _0x319450;};}function handleError(_0x2c7e28,_0x5d2816){_0x5d2816=_0x5d2816||0x1f4;return function(_0x3cc8e5){logger['error'](_0x3cc8e5[_0x4497('0x32')]);if(_0x3cc8e5['name']){delete _0x3cc8e5[_0x4497('0x33')];}_0x2c7e28[_0x4497('0x27')](_0x5d2816)['send'](_0x3cc8e5);};}exports['index']=function(_0x4c36bf,_0x271cee){var _0x5e7211={},_0x8d23b3={},_0x4849c2={'count':0x0,'rows':[]};var _0x5634bb=db[_0x4497('0x34')][_0x4497('0x35')];_0x8d23b3[_0x4497('0x36')]=_[_0x4497('0x37')](_0x5634bb);_0x8d23b3[_0x4497('0x38')]=_['keys'](_0x4c36bf[_0x4497('0x38')]);_0x8d23b3['filters']=_[_0x4497('0x39')](_0x8d23b3[_0x4497('0x36')],_0x8d23b3[_0x4497('0x38')]);_0x5e7211[_0x4497('0x3a')]=_['intersection'](_0x8d23b3[_0x4497('0x36')],qs[_0x4497('0x3b')](_0x4c36bf['query']['fields']));_0x5e7211[_0x4497('0x3a')]=_0x5e7211[_0x4497('0x3a')][_0x4497('0x3c')]?_0x5e7211[_0x4497('0x3a')]:_0x8d23b3[_0x4497('0x36')];if(!_0x4c36bf[_0x4497('0x38')][_0x4497('0x3d')](_0x4497('0x3e'))){_0x5e7211[_0x4497('0x3f')]=qs['limit'](_0x4c36bf[_0x4497('0x38')]['limit']);_0x5e7211[_0x4497('0x2a')]=qs[_0x4497('0x2a')](_0x4c36bf[_0x4497('0x38')][_0x4497('0x2a')]);}_0x5e7211[_0x4497('0x40')]=qs[_0x4497('0x41')](_0x4c36bf[_0x4497('0x38')]['sort']);_0x5e7211[_0x4497('0x42')]=qs['filters'](_['pick'](_0x4c36bf[_0x4497('0x38')],_0x8d23b3[_0x4497('0x43')]));if(_0x4c36bf[_0x4497('0x38')][_0x4497('0x44')]){_0x5e7211['where']=_['merge'](_0x5e7211['where'],{'$or':_[_0x4497('0x45')](_0x5634bb,function(_0x1d6428){if(_0x1d6428['type'][_0x4497('0x46')]!==_0x4497('0x47')){var _0x3ad8d3={};_0x3ad8d3[_0x1d6428[_0x4497('0x48')]]={'$like':'%'+_0x4c36bf[_0x4497('0x38')][_0x4497('0x44')]+'%'};return _0x3ad8d3;}})});}_0x5e7211=_[_0x4497('0x49')]({},_0x5e7211,_0x4c36bf[_0x4497('0x4a')]);var _0x229fa9={'where':_0x5e7211[_0x4497('0x42')]};return db[_0x4497('0x34')][_0x4497('0x4b')](_0x229fa9)[_0x4497('0x1c')](function(_0x4ac5e6){_0x4849c2[_0x4497('0x4b')]=_0x4ac5e6;if(_0x4c36bf[_0x4497('0x38')][_0x4497('0x4c')]){_0x5e7211[_0x4497('0x4d')]=[{'all':!![]}];}return db[_0x4497('0x34')][_0x4497('0x4e')](_0x5e7211);})['then'](function(_0x2b1217){_0x4849c2[_0x4497('0x4f')]=_0x2b1217;return _0x4849c2;})['then'](respondWithFilteredResult(_0x271cee,_0x5e7211))['catch'](handleError(_0x271cee,null));};exports[_0x4497('0x50')]=function(_0x37a820,_0x2a4c5a){var _0x26b769={'raw':![],'where':{'id':_0x37a820[_0x4497('0x51')]['id']}},_0x3a9d89={};_0x3a9d89['model']=_['keys'](db[_0x4497('0x34')][_0x4497('0x35')]);_0x3a9d89[_0x4497('0x38')]=_[_0x4497('0x37')](_0x37a820[_0x4497('0x38')]);_0x3a9d89['filters']=_['intersection'](_0x3a9d89['model'],_0x3a9d89[_0x4497('0x38')]);_0x26b769[_0x4497('0x3a')]=_[_0x4497('0x39')](_0x3a9d89[_0x4497('0x36')],qs[_0x4497('0x3b')](_0x37a820[_0x4497('0x38')]['fields']));_0x26b769[_0x4497('0x3a')]=_0x26b769['attributes']['length']?_0x26b769['attributes']:_0x3a9d89[_0x4497('0x36')];if(_0x37a820[_0x4497('0x38')][_0x4497('0x4c')]){_0x26b769[_0x4497('0x4d')]=[{'all':!![]}];}_0x26b769=_[_0x4497('0x49')]({},_0x26b769,_0x37a820[_0x4497('0x4a')]);return db['DeskAccount']['find'](_0x26b769)[_0x4497('0x1c')](handleEntityNotFound(_0x2a4c5a,null))['then'](respondWithResult(_0x2a4c5a,null))[_0x4497('0x25')](handleError(_0x2a4c5a,null));};exports[_0x4497('0x52')]=function(_0x1a1b5d,_0x160416){return db[_0x4497('0x34')][_0x4497('0x52')](_0x1a1b5d['body'],{})['then'](respondWithResult(_0x160416,0xc9))[_0x4497('0x25')](handleError(_0x160416,null));};exports[_0x4497('0x30')]=function(_0x269163,_0x71687d){if(_0x269163[_0x4497('0x53')]['id']){delete _0x269163[_0x4497('0x53')]['id'];}return db['DeskAccount'][_0x4497('0x54')]({'where':{'id':_0x269163[_0x4497('0x51')]['id']}})[_0x4497('0x1c')](handleEntityNotFound(_0x71687d,null))[_0x4497('0x1c')](saveUpdates(_0x269163['body'],null))[_0x4497('0x1c')](respondWithResult(_0x71687d,null))[_0x4497('0x25')](handleError(_0x71687d,null));};exports[_0x4497('0x31')]=function(_0x102888,_0x5963de){return db[_0x4497('0x34')]['find']({'where':{'id':_0x102888[_0x4497('0x51')]['id']}})[_0x4497('0x1c')](handleEntityNotFound(_0x5963de,null))[_0x4497('0x1c')](removeEntity(_0x5963de,null))[_0x4497('0x25')](handleError(_0x5963de,null));};exports[_0x4497('0x55')]=function(_0x2c9180,_0x3c64fb,_0x4b379b){var _0x1fcc04={};var _0x1c8ea3={};var _0x4404d2;var _0x52ee6a;return db[_0x4497('0x34')][_0x4497('0x56')]({'where':{'id':_0x2c9180[_0x4497('0x51')]['id']}})[_0x4497('0x1c')](handleEntityNotFound(_0x3c64fb,null))[_0x4497('0x1c')](function(_0x2c9517){if(_0x2c9517){_0x4404d2=_0x2c9517;_0x1c8ea3[_0x4497('0x36')]=_[_0x4497('0x37')](db[_0x4497('0x57')]['rawAttributes']);_0x1c8ea3[_0x4497('0x38')]=_[_0x4497('0x37')](_0x2c9180['query']);_0x1c8ea3[_0x4497('0x43')]=_['intersection'](_0x1c8ea3[_0x4497('0x36')],_0x1c8ea3[_0x4497('0x38')]);_0x1fcc04['attributes']=_[_0x4497('0x39')](_0x1c8ea3[_0x4497('0x36')],qs['fields'](_0x2c9180[_0x4497('0x38')][_0x4497('0x3b')]));_0x1fcc04[_0x4497('0x3a')]=_0x1fcc04[_0x4497('0x3a')][_0x4497('0x3c')]?_0x1fcc04[_0x4497('0x3a')]:_0x1c8ea3[_0x4497('0x36')];_0x1fcc04['order']=qs[_0x4497('0x41')](_0x2c9180[_0x4497('0x38')][_0x4497('0x41')]);_0x1fcc04[_0x4497('0x42')]=qs['filters'](_[_0x4497('0x58')](_0x2c9180['query'],_0x1c8ea3[_0x4497('0x43')]));if(_0x2c9180[_0x4497('0x38')][_0x4497('0x44')]){_0x1fcc04['where']=_[_0x4497('0x49')](_0x1fcc04[_0x4497('0x42')],{'$or':_[_0x4497('0x45')](_0x1fcc04[_0x4497('0x3a')],function(_0x3cd641){var _0x46d4cd={};_0x46d4cd[_0x3cd641]={'$like':'%'+_0x2c9180[_0x4497('0x38')][_0x4497('0x44')]+'%'};return _0x46d4cd;})});}_0x1fcc04=_[_0x4497('0x49')]({},_0x1fcc04,_0x2c9180['options']);return _0x4404d2[_0x4497('0x55')](_0x1fcc04);}})[_0x4497('0x1c')](function(_0x255f41){if(_0x255f41){_0x52ee6a=_0x255f41['length'];if(!_0x2c9180[_0x4497('0x38')][_0x4497('0x3d')](_0x4497('0x3e'))){_0x1fcc04[_0x4497('0x3f')]=qs[_0x4497('0x3f')](_0x2c9180[_0x4497('0x38')][_0x4497('0x3f')]);_0x1fcc04[_0x4497('0x2a')]=qs[_0x4497('0x2a')](_0x2c9180[_0x4497('0x38')]['offset']);}return _0x4404d2[_0x4497('0x55')](_0x1fcc04);}})['then'](function(_0x339bc2){if(_0x339bc2){return _0x339bc2?{'count':_0x52ee6a,'rows':_0x339bc2}:null;}})[_0x4497('0x1c')](respondWithResult(_0x3c64fb,null))['catch'](handleError(_0x3c64fb,null));};exports[_0x4497('0x59')]=function(_0x50bf89,_0x28c320,_0xc1d166){if(_0x50bf89[_0x4497('0x53')]['id']){delete _0x50bf89[_0x4497('0x53')]['id'];}return db[_0x4497('0x34')][_0x4497('0x56')]({'where':{'id':_0x50bf89[_0x4497('0x51')]['id']}})[_0x4497('0x1c')](handleEntityNotFound(_0x28c320,null))[_0x4497('0x1c')](function(_0x5cc0ad){if(_0x5cc0ad){_0x50bf89[_0x4497('0x53')][_0x4497('0x5a')]=_0x5cc0ad['id'];_0x50bf89['body'][_0x4497('0x5b')]=integrations[_0x4497('0x5c')](_0x50bf89[_0x4497('0x53')][_0x4497('0x5d')],_0x50bf89[_0x4497('0x53')][_0x4497('0x5e')]);_0x50bf89['body'][_0x4497('0x5f')]=integrations['getDescriptions'](_0x50bf89[_0x4497('0x53')][_0x4497('0x5d')],_0x50bf89[_0x4497('0x53')]['type']);return db[_0x4497('0x57')]['create'](_0x50bf89[_0x4497('0x53')],{'include':[{'model':db[_0x4497('0x60')],'as':_0x4497('0x5b')},{'model':db[_0x4497('0x60')],'as':_0x4497('0x5f')}]});}return null;})[_0x4497('0x1c')](respondWithResult(_0x28c320,null))['catch'](handleError(_0x28c320,null));};exports[_0x4497('0x61')]=function(_0x46f873,_0x59b267,_0x2a1f60){var _0x3a76da=[{'name':_0x4497('0x62'),'label':_0x4497('0x62'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1c9593='';return db['DeskAccount'][_0x4497('0x56')]({'where':{'id':_0x46f873[_0x4497('0x51')]['id']},'attributes':['id','remoteUri',_0x4497('0x63'),_0x4497('0x64'),_0x4497('0x65'),'consumerKey',_0x4497('0x66'),_0x4497('0x67'),_0x4497('0x68')]})[_0x4497('0x1c')](handleEntityNotFound(_0x59b267,null))[_0x4497('0x1c')](function(_0x12a519){if(_0x12a519){_0x1c9593=_0x12a519['remoteUri'];var _0x49f5fc=_0x1c9593['slice'](-0x1);if(_0x49f5fc==='/'){_0x1c9593=_0x1c9593[_0x4497('0x69')](0x0,_0x1c9593['lastIndexOf'](_0x49f5fc));}var _0x44940a={'method':_0x4497('0x6a'),'uri':util[_0x4497('0x6b')]('%s/custom_fields',_0x1c9593),'headers':{'Content-Type':_0x4497('0x6c'),'Accept':'application/json'},'json':!![]};if(_0x12a519[_0x4497('0x63')]==='basic'){_0x44940a[_0x4497('0x6d')][_0x4497('0x6e')]=util[_0x4497('0x6b')](_0x4497('0x6f'),new Buffer(util[_0x4497('0x6b')]('%s:%s',_0x12a519[_0x4497('0x64')],_0x12a519[_0x4497('0x65')]))[_0x4497('0x70')](_0x4497('0x71')));}return rp(_0x44940a)['then'](function(_0x2a3327){return _0x3a76da[_0x4497('0x72')](_[_0x4497('0x45')](_0x2a3327[_0x4497('0x73')]['entries'],function(_0x3dd33f){return{'id':_0x3dd33f[_0x4497('0x33')],'name':_0x3dd33f['name'],'type':_0x3dd33f[_0x4497('0x5e')],'active':_0x3dd33f[_0x4497('0x74')],'label':_0x3dd33f[_0x4497('0x75')],'custom':!![]};}));});}})[_0x4497('0x1c')](function(_0x5d0b02){return{'count':_0x5d0b02[_0x4497('0x3c')],'rows':_0x5d0b02};})['then'](respondWithResult(_0x59b267,null))[_0x4497('0x25')](function(_0x53d761){var _0x38e56c=_0x46f873['query'][_0x4497('0x1a')]?0x1f4:_0x53d761['statusCode']||0x1f4;logger[_0x4497('0x22')](_0x4497('0x76'),_0x4497('0x61'),_0x38e56c,JSON[_0x4497('0x21')](_0x53d761));delete _0x53d761['name'];if(_0x38e56c===0x191){_0x38e56c=0x190;}_0x59b267[_0x4497('0x27')](_0x38e56c)['send'](_0x46f873[_0x4497('0x38')][_0x4497('0x1a')]?{'message':_0x4497('0x77'),'statusCode':_0x53d761[_0x4497('0x78')]}:_0x53d761);});}; \ No newline at end of file +var _0xfa17=['The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','reject','save','update','destroy','stack','name','index','DeskAccount','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','type','getDescriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','authType','username','password','token','slice','substring','lastIndexOf','format','basic','headers','Authorization','Basic\x20%s','toString','base64','entries','active','label','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test'];(function(_0x10bd20,_0x1ce00c){var _0x31ecb1=function(_0x52be72){while(--_0x52be72){_0x10bd20['push'](_0x10bd20['shift']());}};_0x31ecb1(++_0x1ce00c);}(_0xfa17,0xd1));var _0x7fa1=function(_0x9f78e0,_0x9ff246){_0x9f78e0=_0x9f78e0-0x0;var _0x3a0d5d=_0xfa17[_0x9f78e0];return _0x3a0d5d;};'use strict';var pdf=require(_0x7fa1('0x0'));var emlformat=require(_0x7fa1('0x1'));var rimraf=require(_0x7fa1('0x2'));var zipdir=require(_0x7fa1('0x3'));var jsonpatch=require(_0x7fa1('0x4'));var rp=require(_0x7fa1('0x5'));var moment=require(_0x7fa1('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7fa1('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7fa1('0x8'));var ejs=require(_0x7fa1('0x9'));var fs=require('fs');var _=require(_0x7fa1('0xa'));var squel=require('squel');var crypto=require(_0x7fa1('0xb'));var jsforce=require(_0x7fa1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7fa1('0xd'));var authService=require(_0x7fa1('0xe'));var qs=require(_0x7fa1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fa1('0x10'))('api');var utils=require(_0x7fa1('0x11'));var config=require('../../config/environment');var db=require(_0x7fa1('0x12'))['db'];var integrations=require(_0x7fa1('0x13'));var jayson=require(_0x7fa1('0x14'));var client=jayson[_0x7fa1('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x4727d5,_0x40ad25,_0x261383){if(_0x261383){var _0x1e0da2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e0da2[_0x7fa1('0x16')](_0x40ad25)){return _0x4727d5;}else{throw new Error(_0x7fa1('0x17'));}}else{return _0x4727d5;}}function respondWithRpcPromise(_0x216192,_0x40e3e8,_0x30ecd7,_0x2c9635){return new BPromise(function(_0x17579e,_0x5c2191){var _0x109dc6=_0x2c9635||client;return _0x109dc6[_0x7fa1('0x18')](_0x216192,_0x30ecd7)[_0x7fa1('0x19')](function(_0x3ecb11){logger[_0x7fa1('0x1a')]('DeskAccount,\x20%s,\x20%s',_0x40e3e8,'request\x20sent');logger['debug'](_0x7fa1('0x1b'),_0x40e3e8,_0x7fa1('0x1c'),JSON['stringify'](_0x3ecb11));if(_0x3ecb11[_0x7fa1('0x1d')]){if(_0x3ecb11[_0x7fa1('0x1d')][_0x7fa1('0x1e')]===0x1f4){logger[_0x7fa1('0x1d')](_0x7fa1('0x1f'),_0x40e3e8,_0x3ecb11[_0x7fa1('0x1d')][_0x7fa1('0x20')]);return _0x5c2191(_0x3ecb11[_0x7fa1('0x1d')][_0x7fa1('0x20')]);}logger[_0x7fa1('0x1d')](_0x7fa1('0x1f'),_0x40e3e8,_0x3ecb11[_0x7fa1('0x1d')][_0x7fa1('0x20')]);return _0x17579e(_0x3ecb11[_0x7fa1('0x1d')]['message']);}else{logger['info'](_0x7fa1('0x1f'),_0x40e3e8,_0x7fa1('0x1c'));_0x17579e(_0x3ecb11[_0x7fa1('0x21')]['message']);}})[_0x7fa1('0x22')](function(_0x51c8bc){logger[_0x7fa1('0x1d')](_0x7fa1('0x1f'),_0x40e3e8,_0x51c8bc);_0x5c2191(_0x51c8bc);});});}function respondWithStatusCode(_0x1410c0,_0x467584){_0x467584=_0x467584||0xcc;return function(_0x40086a){if(_0x40086a){return _0x1410c0[_0x7fa1('0x23')](_0x467584);}return _0x1410c0['status'](_0x467584)[_0x7fa1('0x24')]();};}function respondWithResult(_0x214a74,_0x3fa941){_0x3fa941=_0x3fa941||0xc8;return function(_0x3f40c6){if(_0x3f40c6){return _0x214a74['status'](_0x3fa941)[_0x7fa1('0x25')](_0x3f40c6);}};}function respondWithFilteredResult(_0x846a2e,_0x2aec75){return function(_0x15e2bb){if(_0x15e2bb){var _0xd35f25=_0x15e2bb[_0x7fa1('0x26')],_0x3514e5=_0x2aec75[_0x7fa1('0x27')],_0x3eb07d=_0x2aec75['offset']+_0x2aec75[_0x7fa1('0x28')],_0x1d054b;if(_0x3eb07d>=_0xd35f25){_0x3eb07d=_0xd35f25;_0x1d054b=0xc8;}else{_0x1d054b=0xce;}_0x846a2e[_0x7fa1('0x29')](_0x1d054b);return _0x846a2e[_0x7fa1('0x2a')](_0x7fa1('0x2b'),_0x3514e5+'-'+_0x3eb07d+'/'+_0xd35f25)['json'](_0x15e2bb);}return null;};}function patchUpdates(_0x380329){return function(_0x45a639){try{jsonpatch['apply'](_0x45a639,_0x380329,!![]);}catch(_0x1a54a4){return BPromise[_0x7fa1('0x2c')](_0x1a54a4);}return _0x45a639[_0x7fa1('0x2d')]();};}function saveUpdates(_0x23ed81,_0x2bb7e1){return function(_0x3137a6){if(_0x3137a6){return _0x3137a6[_0x7fa1('0x2e')](_0x23ed81)[_0x7fa1('0x19')](function(_0x3351af){return _0x3351af;});}return null;};}function removeEntity(_0x471bcc,_0x44b449){return function(_0x1524ab){if(_0x1524ab){return _0x1524ab[_0x7fa1('0x2f')]()[_0x7fa1('0x19')](function(){_0x471bcc['status'](0xcc)[_0x7fa1('0x24')]();});}};}function handleEntityNotFound(_0x51ca0a,_0x410598){return function(_0x562104){if(!_0x562104){_0x51ca0a[_0x7fa1('0x23')](0x194);}return _0x562104;};}function handleError(_0x4ef5b2,_0x4a0de6){_0x4a0de6=_0x4a0de6||0x1f4;return function(_0x204099){logger[_0x7fa1('0x1d')](_0x204099[_0x7fa1('0x30')]);if(_0x204099[_0x7fa1('0x31')]){delete _0x204099['name'];}_0x4ef5b2[_0x7fa1('0x29')](_0x4a0de6)['send'](_0x204099);};}exports[_0x7fa1('0x32')]=function(_0x45a8d4,_0x5ec662){var _0x595165={},_0x4137b0={},_0x368135={'count':0x0,'rows':[]};var _0x23bfe8=db[_0x7fa1('0x33')][_0x7fa1('0x34')];_0x4137b0[_0x7fa1('0x35')]=_['keys'](_0x23bfe8);_0x4137b0[_0x7fa1('0x36')]=_[_0x7fa1('0x37')](_0x45a8d4[_0x7fa1('0x36')]);_0x4137b0[_0x7fa1('0x38')]=_['intersection'](_0x4137b0[_0x7fa1('0x35')],_0x4137b0['query']);_0x595165[_0x7fa1('0x39')]=_[_0x7fa1('0x3a')](_0x4137b0[_0x7fa1('0x35')],qs[_0x7fa1('0x3b')](_0x45a8d4['query'][_0x7fa1('0x3b')]));_0x595165['attributes']=_0x595165[_0x7fa1('0x39')][_0x7fa1('0x3c')]?_0x595165[_0x7fa1('0x39')]:_0x4137b0[_0x7fa1('0x35')];if(!_0x45a8d4[_0x7fa1('0x36')]['hasOwnProperty'](_0x7fa1('0x3d'))){_0x595165[_0x7fa1('0x28')]=qs[_0x7fa1('0x28')](_0x45a8d4[_0x7fa1('0x36')][_0x7fa1('0x28')]);_0x595165[_0x7fa1('0x27')]=qs[_0x7fa1('0x27')](_0x45a8d4['query'][_0x7fa1('0x27')]);}_0x595165[_0x7fa1('0x3e')]=qs['sort'](_0x45a8d4[_0x7fa1('0x36')][_0x7fa1('0x3f')]);_0x595165[_0x7fa1('0x40')]=qs[_0x7fa1('0x38')](_[_0x7fa1('0x41')](_0x45a8d4['query'],_0x4137b0[_0x7fa1('0x38')]));if(_0x45a8d4[_0x7fa1('0x36')][_0x7fa1('0x42')]){_0x595165[_0x7fa1('0x40')]=_[_0x7fa1('0x43')](_0x595165['where'],{'$or':_[_0x7fa1('0x44')](_0x23bfe8,function(_0x1ea423){if(_0x1ea423['type']['key']!==_0x7fa1('0x45')){var _0x44a8fd={};_0x44a8fd[_0x1ea423[_0x7fa1('0x46')]]={'$like':'%'+_0x45a8d4[_0x7fa1('0x36')][_0x7fa1('0x42')]+'%'};return _0x44a8fd;}})});}_0x595165=_[_0x7fa1('0x43')]({},_0x595165,_0x45a8d4[_0x7fa1('0x47')]);var _0xac5727={'where':_0x595165[_0x7fa1('0x40')]};return db[_0x7fa1('0x33')]['count'](_0xac5727)[_0x7fa1('0x19')](function(_0x28362a){_0x368135[_0x7fa1('0x26')]=_0x28362a;if(_0x45a8d4[_0x7fa1('0x36')][_0x7fa1('0x48')]){_0x595165[_0x7fa1('0x49')]=[{'all':!![]}];}return db[_0x7fa1('0x33')][_0x7fa1('0x4a')](_0x595165);})[_0x7fa1('0x19')](function(_0x162610){_0x368135[_0x7fa1('0x4b')]=_0x162610;return _0x368135;})[_0x7fa1('0x19')](respondWithFilteredResult(_0x5ec662,_0x595165))[_0x7fa1('0x22')](handleError(_0x5ec662,null));};exports[_0x7fa1('0x4c')]=function(_0x30dfef,_0x18eb21){var _0x22d17a={'raw':![],'where':{'id':_0x30dfef[_0x7fa1('0x4d')]['id']}},_0x208d04={};_0x208d04[_0x7fa1('0x35')]=_['keys'](db[_0x7fa1('0x33')]['rawAttributes']);_0x208d04[_0x7fa1('0x36')]=_[_0x7fa1('0x37')](_0x30dfef[_0x7fa1('0x36')]);_0x208d04[_0x7fa1('0x38')]=_[_0x7fa1('0x3a')](_0x208d04['model'],_0x208d04[_0x7fa1('0x36')]);_0x22d17a[_0x7fa1('0x39')]=_[_0x7fa1('0x3a')](_0x208d04[_0x7fa1('0x35')],qs[_0x7fa1('0x3b')](_0x30dfef[_0x7fa1('0x36')][_0x7fa1('0x3b')]));_0x22d17a[_0x7fa1('0x39')]=_0x22d17a['attributes'][_0x7fa1('0x3c')]?_0x22d17a[_0x7fa1('0x39')]:_0x208d04[_0x7fa1('0x35')];if(_0x30dfef[_0x7fa1('0x36')][_0x7fa1('0x48')]){_0x22d17a[_0x7fa1('0x49')]=[{'all':!![]}];}_0x22d17a=_[_0x7fa1('0x43')]({},_0x22d17a,_0x30dfef[_0x7fa1('0x47')]);return db[_0x7fa1('0x33')][_0x7fa1('0x4e')](_0x22d17a)[_0x7fa1('0x19')](handleEntityNotFound(_0x18eb21,null))[_0x7fa1('0x19')](respondWithResult(_0x18eb21,null))['catch'](handleError(_0x18eb21,null));};exports['create']=function(_0x22e94c,_0x5a5ea1){return db['DeskAccount'][_0x7fa1('0x4f')](_0x22e94c[_0x7fa1('0x50')],{})[_0x7fa1('0x19')](respondWithResult(_0x5a5ea1,0xc9))['catch'](handleError(_0x5a5ea1,null));};exports[_0x7fa1('0x2e')]=function(_0x5c6c2b,_0x243306){if(_0x5c6c2b[_0x7fa1('0x50')]['id']){delete _0x5c6c2b[_0x7fa1('0x50')]['id'];}return db[_0x7fa1('0x33')][_0x7fa1('0x4e')]({'where':{'id':_0x5c6c2b[_0x7fa1('0x4d')]['id']}})[_0x7fa1('0x19')](handleEntityNotFound(_0x243306,null))[_0x7fa1('0x19')](saveUpdates(_0x5c6c2b[_0x7fa1('0x50')],null))[_0x7fa1('0x19')](respondWithResult(_0x243306,null))[_0x7fa1('0x22')](handleError(_0x243306,null));};exports['destroy']=function(_0x4ab3c4,_0x37224e){return db[_0x7fa1('0x33')][_0x7fa1('0x4e')]({'where':{'id':_0x4ab3c4[_0x7fa1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x37224e,null))['then'](removeEntity(_0x37224e,null))[_0x7fa1('0x22')](handleError(_0x37224e,null));};exports[_0x7fa1('0x51')]=function(_0x28aba3,_0x2cfedd,_0x1b8f5d){var _0x508e64={};var _0x365b36={};var _0x3024ce;var _0x173b50;return db['DeskAccount'][_0x7fa1('0x52')]({'where':{'id':_0x28aba3[_0x7fa1('0x4d')]['id']}})[_0x7fa1('0x19')](handleEntityNotFound(_0x2cfedd,null))[_0x7fa1('0x19')](function(_0x130ea4){if(_0x130ea4){_0x3024ce=_0x130ea4;_0x365b36['model']=_['keys'](db['DeskConfiguration'][_0x7fa1('0x34')]);_0x365b36[_0x7fa1('0x36')]=_['keys'](_0x28aba3['query']);_0x365b36[_0x7fa1('0x38')]=_[_0x7fa1('0x3a')](_0x365b36[_0x7fa1('0x35')],_0x365b36[_0x7fa1('0x36')]);_0x508e64[_0x7fa1('0x39')]=_[_0x7fa1('0x3a')](_0x365b36[_0x7fa1('0x35')],qs[_0x7fa1('0x3b')](_0x28aba3[_0x7fa1('0x36')][_0x7fa1('0x3b')]));_0x508e64[_0x7fa1('0x39')]=_0x508e64[_0x7fa1('0x39')][_0x7fa1('0x3c')]?_0x508e64['attributes']:_0x365b36['model'];_0x508e64[_0x7fa1('0x3e')]=qs[_0x7fa1('0x3f')](_0x28aba3[_0x7fa1('0x36')]['sort']);_0x508e64['where']=qs[_0x7fa1('0x38')](_[_0x7fa1('0x41')](_0x28aba3[_0x7fa1('0x36')],_0x365b36[_0x7fa1('0x38')]));if(_0x28aba3[_0x7fa1('0x36')][_0x7fa1('0x42')]){_0x508e64[_0x7fa1('0x40')]=_[_0x7fa1('0x43')](_0x508e64[_0x7fa1('0x40')],{'$or':_[_0x7fa1('0x44')](_0x508e64[_0x7fa1('0x39')],function(_0x2c4e27){var _0x47e325={};_0x47e325[_0x2c4e27]={'$like':'%'+_0x28aba3['query'][_0x7fa1('0x42')]+'%'};return _0x47e325;})});}_0x508e64=_[_0x7fa1('0x43')]({},_0x508e64,_0x28aba3[_0x7fa1('0x47')]);return _0x3024ce[_0x7fa1('0x51')](_0x508e64);}})[_0x7fa1('0x19')](function(_0x75e60b){if(_0x75e60b){_0x173b50=_0x75e60b[_0x7fa1('0x3c')];if(!_0x28aba3[_0x7fa1('0x36')][_0x7fa1('0x53')](_0x7fa1('0x3d'))){_0x508e64['limit']=qs['limit'](_0x28aba3['query']['limit']);_0x508e64['offset']=qs[_0x7fa1('0x27')](_0x28aba3['query'][_0x7fa1('0x27')]);}return _0x3024ce[_0x7fa1('0x51')](_0x508e64);}})['then'](function(_0x108905){if(_0x108905){return _0x108905?{'count':_0x173b50,'rows':_0x108905}:null;}})['then'](respondWithResult(_0x2cfedd,null))[_0x7fa1('0x22')](handleError(_0x2cfedd,null));};exports[_0x7fa1('0x54')]=function(_0x4c40d3,_0x142df8,_0x4f1ead){if(_0x4c40d3['body']['id']){delete _0x4c40d3['body']['id'];}return db[_0x7fa1('0x33')]['findOne']({'where':{'id':_0x4c40d3[_0x7fa1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x142df8,null))[_0x7fa1('0x19')](function(_0x1f14c1){if(_0x1f14c1){_0x4c40d3['body'][_0x7fa1('0x55')]=_0x1f14c1['id'];_0x4c40d3[_0x7fa1('0x50')][_0x7fa1('0x56')]=integrations[_0x7fa1('0x57')](_0x4c40d3[_0x7fa1('0x50')][_0x7fa1('0x58')],_0x4c40d3[_0x7fa1('0x50')][_0x7fa1('0x59')]);_0x4c40d3[_0x7fa1('0x50')]['Descriptions']=integrations[_0x7fa1('0x5a')](_0x4c40d3[_0x7fa1('0x50')][_0x7fa1('0x58')],_0x4c40d3[_0x7fa1('0x50')]['type']);return db[_0x7fa1('0x5b')][_0x7fa1('0x4f')](_0x4c40d3[_0x7fa1('0x50')],{'include':[{'model':db[_0x7fa1('0x5c')],'as':'Subjects'},{'model':db[_0x7fa1('0x5c')],'as':'Descriptions'}]});}return null;})[_0x7fa1('0x19')](respondWithResult(_0x142df8,null))[_0x7fa1('0x22')](handleError(_0x142df8,null));};exports[_0x7fa1('0x5d')]=function(_0x5a8dcc,_0x51905d,_0x515561){var _0x45881c=[{'name':_0x7fa1('0x5e'),'label':_0x7fa1('0x5e'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x28a120='';return db[_0x7fa1('0x33')][_0x7fa1('0x52')]({'where':{'id':_0x5a8dcc[_0x7fa1('0x4d')]['id']},'attributes':['id',_0x7fa1('0x5f'),_0x7fa1('0x60'),_0x7fa1('0x61'),_0x7fa1('0x62'),'consumerKey','consumerSecret',_0x7fa1('0x63'),'tokenSecret']})[_0x7fa1('0x19')](handleEntityNotFound(_0x51905d,null))[_0x7fa1('0x19')](function(_0x5d2edd){if(_0x5d2edd){_0x28a120=_0x5d2edd[_0x7fa1('0x5f')];var _0xa4105d=_0x28a120[_0x7fa1('0x64')](-0x1);if(_0xa4105d==='/'){_0x28a120=_0x28a120[_0x7fa1('0x65')](0x0,_0x28a120[_0x7fa1('0x66')](_0xa4105d));}var _0x14bec6={'method':'GET','uri':util[_0x7fa1('0x67')]('%s/custom_fields',_0x28a120),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x5d2edd[_0x7fa1('0x60')]===_0x7fa1('0x68')){_0x14bec6[_0x7fa1('0x69')][_0x7fa1('0x6a')]=util[_0x7fa1('0x67')](_0x7fa1('0x6b'),new Buffer(util[_0x7fa1('0x67')]('%s:%s',_0x5d2edd[_0x7fa1('0x61')],_0x5d2edd[_0x7fa1('0x62')]))[_0x7fa1('0x6c')](_0x7fa1('0x6d')));}return rp(_0x14bec6)[_0x7fa1('0x19')](function(_0x3ec9e0){return _0x45881c['concat'](_['map'](_0x3ec9e0['_embedded'][_0x7fa1('0x6e')],function(_0x570aee){return{'id':_0x570aee[_0x7fa1('0x31')],'name':_0x570aee[_0x7fa1('0x31')],'type':_0x570aee[_0x7fa1('0x59')],'active':_0x570aee[_0x7fa1('0x6f')],'label':_0x570aee[_0x7fa1('0x70')],'custom':!![]};}));});}})[_0x7fa1('0x19')](function(_0x3ffad0){return{'count':_0x3ffad0['length'],'rows':_0x3ffad0};})['then'](respondWithResult(_0x51905d,null))[_0x7fa1('0x22')](function(_0x3234be){var _0x6ba3a7=_0x5a8dcc[_0x7fa1('0x36')][_0x7fa1('0x16')]?0x1f4:_0x3234be['statusCode']||0x1f4;logger[_0x7fa1('0x1d')](_0x7fa1('0x71'),_0x7fa1('0x5d'),_0x6ba3a7,JSON[_0x7fa1('0x72')](_0x3234be));delete _0x3234be[_0x7fa1('0x31')];if(_0x6ba3a7===0x191){_0x6ba3a7=0x190;}_0x51905d[_0x7fa1('0x29')](_0x6ba3a7)['send'](_0x5a8dcc[_0x7fa1('0x36')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3234be[_0x7fa1('0x73')]}:_0x3234be);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 597525d..4d37d5c 100644 --- a/server/api/intDeskAccount/intDeskAccount.model.js +++ b/server/api/intDeskAccount/intDeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27db=['int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','DeskAccount'];(function(_0x26a0b8,_0x14fb18){var _0x1a4465=function(_0x5877d0){while(--_0x5877d0){_0x26a0b8['push'](_0x26a0b8['shift']());}};_0x1a4465(++_0x14fb18);}(_0x27db,0xef));var _0xb27d=function(_0x4d5da0,_0x35a8da){_0x4d5da0=_0x4d5da0-0x0;var _0x2e1f5c=_0x27db[_0x4d5da0];return _0x2e1f5c;};'use strict';var _=require(_0xb27d('0x0'));var util=require(_0xb27d('0x1'));var logger=require(_0xb27d('0x2'))(_0xb27d('0x3'));var moment=require(_0xb27d('0x4'));var BPromise=require(_0xb27d('0x5'));var rp=require(_0xb27d('0x6'));var fs=require('fs');var path=require(_0xb27d('0x7'));var rimraf=require(_0xb27d('0x8'));var config=require(_0xb27d('0x9'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xb27d('0xa')]=function(_0x2064e9,_0x52f178){return _0x2064e9[_0xb27d('0xb')](_0xb27d('0xc'),attributes,{'tableName':_0xb27d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5760=['../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./intDeskAccount.attributes'];(function(_0x4a6833,_0x3091d1){var _0x21e38c=function(_0x225e42){while(--_0x225e42){_0x4a6833['push'](_0x4a6833['shift']());}};_0x21e38c(++_0x3091d1);}(_0x5760,0xeb));var _0x0576=function(_0x4e8b3d,_0x1f006f){_0x4e8b3d=_0x4e8b3d-0x0;var _0x482523=_0x5760[_0x4e8b3d];return _0x482523;};'use strict';var _=require(_0x0576('0x0'));var util=require('util');var logger=require(_0x0576('0x1'))(_0x0576('0x2'));var moment=require('moment');var BPromise=require(_0x0576('0x3'));var rp=require(_0x0576('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0576('0x5'));var attributes=require(_0x0576('0x6'));var integrations=require(_0x0576('0x7'));module[_0x0576('0x8')]=function(_0x2add69,_0xb9f4d4){return _0x2add69[_0x0576('0x9')]('DeskAccount',attributes,{'tableName':_0x0576('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 9cd0f6c..78d5f4c 100644 --- a/server/api/intDeskAccount/intDeskAccount.rpc.js +++ b/server/api/intDeskAccount/intDeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f7f=['findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowDeskAccount','DeskAccount','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetDeskAccount'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x5f7f,0xe5));var _0xf5f7=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x5f7f[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xf5f7('0x0'));var util=require(_0xf5f7('0x1'));var moment=require(_0xf5f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5f7('0x3'));var db=require(_0xf5f7('0x4'))['db'];var utils=require(_0xf5f7('0x5'));var logger=require(_0xf5f7('0x6'))(_0xf5f7('0x7'));var config=require(_0xf5f7('0x8'));var jayson=require(_0xf5f7('0x9'));var client=jayson[_0xf5f7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a46cd,_0x167cc3,_0x59b615){return new BPromise(function(_0x54cc78,_0x26dd63){return client[_0xf5f7('0xb')](_0x1a46cd,_0x59b615)[_0xf5f7('0xc')](function(_0x341af5){logger['info'](_0xf5f7('0xd'),_0x167cc3,_0xf5f7('0xe'));logger[_0xf5f7('0xf')](_0xf5f7('0x10'),_0x167cc3,_0xf5f7('0xe'),JSON[_0xf5f7('0x11')](_0x341af5));if(_0x341af5['error']){if(_0x341af5[_0xf5f7('0x12')]['code']===0x1f4){logger[_0xf5f7('0x12')](_0xf5f7('0xd'),_0x167cc3,_0x341af5[_0xf5f7('0x12')]['message']);return _0x26dd63(_0x341af5['error'][_0xf5f7('0x13')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x167cc3,_0x341af5['error']['message']);return _0x54cc78(_0x341af5[_0xf5f7('0x12')][_0xf5f7('0x13')]);}else{logger[_0xf5f7('0x14')](_0xf5f7('0xd'),_0x167cc3,_0xf5f7('0xe'));_0x54cc78(_0x341af5[_0xf5f7('0x15')][_0xf5f7('0x13')]);}})['catch'](function(_0x45e9bf){logger['error'](_0xf5f7('0xd'),_0x167cc3,_0x45e9bf);_0x26dd63(_0x45e9bf);});});}exports[_0xf5f7('0x16')]=function(_0x2fde1e){var _0x3cd347=this;return new Promise(function(_0x4ff0cc,_0x132dfe){return db['DeskAccount'][_0xf5f7('0x17')]({'raw':_0x2fde1e[_0xf5f7('0x18')]?_0x2fde1e[_0xf5f7('0x18')][_0xf5f7('0x19')]===undefined?!![]:![]:!![],'where':_0x2fde1e[_0xf5f7('0x18')]?_0x2fde1e[_0xf5f7('0x18')][_0xf5f7('0x1a')]||null:null,'attributes':_0x2fde1e[_0xf5f7('0x18')]?_0x2fde1e[_0xf5f7('0x18')][_0xf5f7('0x1b')]||null:null,'limit':_0x2fde1e[_0xf5f7('0x18')]?_0x2fde1e['options'][_0xf5f7('0x1c')]||null:null,'include':_0x2fde1e['options']?_0x2fde1e[_0xf5f7('0x18')]['include']?_[_0xf5f7('0x1d')](_0x2fde1e[_0xf5f7('0x18')][_0xf5f7('0x1e')],function(_0x125a07){return{'model':db[_0x125a07['model']],'as':_0x125a07['as'],'attributes':_0x125a07[_0xf5f7('0x1b')],'include':_0x125a07[_0xf5f7('0x1e')]?_[_0xf5f7('0x1d')](_0x125a07[_0xf5f7('0x1e')],function(_0xf1d1ff){return{'model':db[_0xf1d1ff[_0xf5f7('0x1f')]],'as':_0xf1d1ff['as'],'attributes':_0xf1d1ff[_0xf5f7('0x1b')],'include':_0xf1d1ff[_0xf5f7('0x1e')]?_[_0xf5f7('0x1d')](_0xf1d1ff[_0xf5f7('0x1e')],function(_0x239df6){return{'model':db[_0x239df6['model']],'as':_0x239df6['as'],'attributes':_0x239df6[_0xf5f7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf5f7('0xc')](function(_0x148346){logger['info'](_0xf5f7('0x16'),_0x2fde1e);logger[_0xf5f7('0xf')]('GetDeskAccount',_0x2fde1e,JSON['stringify'](_0x148346));_0x4ff0cc(_0x148346);})[_0xf5f7('0x20')](function(_0x1f7687){logger[_0xf5f7('0x12')](_0xf5f7('0x16'),_0x1f7687['message'],_0x2fde1e);_0x132dfe(_0x3cd347['error'](0x1f4,_0x1f7687[_0xf5f7('0x13')]));});});};exports[_0xf5f7('0x21')]=function(_0x173a57){var _0x53a017=this;return new Promise(function(_0x3d02a8,_0x3973e1){return db[_0xf5f7('0x22')][_0xf5f7('0x23')]({'raw':_0x173a57[_0xf5f7('0x18')]?_0x173a57['options'][_0xf5f7('0x19')]===undefined?!![]:![]:!![],'where':_0x173a57[_0xf5f7('0x18')]?_0x173a57[_0xf5f7('0x18')]['where']||null:null,'attributes':_0x173a57[_0xf5f7('0x18')]?_0x173a57[_0xf5f7('0x18')]['attributes']||null:null,'include':_0x173a57['options']?_0x173a57[_0xf5f7('0x18')][_0xf5f7('0x1e')]?_['map'](_0x173a57[_0xf5f7('0x18')][_0xf5f7('0x1e')],function(_0x4352cc){return{'model':db[_0x4352cc[_0xf5f7('0x1f')]],'as':_0x4352cc['as'],'attributes':_0x4352cc[_0xf5f7('0x1b')],'include':_0x4352cc['include']?_['map'](_0x4352cc[_0xf5f7('0x1e')],function(_0x304baa){return{'model':db[_0x304baa[_0xf5f7('0x1f')]],'as':_0x304baa['as'],'attributes':_0x304baa[_0xf5f7('0x1b')],'include':_0x304baa[_0xf5f7('0x1e')]?_['map'](_0x304baa[_0xf5f7('0x1e')],function(_0x5bf0f1){return{'model':db[_0x5bf0f1['model']],'as':_0x5bf0f1['as'],'attributes':_0x5bf0f1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a3f9c){logger[_0xf5f7('0x14')](_0xf5f7('0x21'),_0x173a57);logger[_0xf5f7('0xf')](_0xf5f7('0x21'),_0x173a57,JSON[_0xf5f7('0x11')](_0x1a3f9c));_0x3d02a8(_0x1a3f9c);})[_0xf5f7('0x20')](function(_0x1339c8){logger[_0xf5f7('0x12')](_0xf5f7('0x21'),_0x1339c8[_0xf5f7('0x13')],_0x173a57);_0x3973e1(_0x53a017[_0xf5f7('0x12')](0x1f4,_0x1339c8[_0xf5f7('0x13')]));});});}; \ No newline at end of file +var _0xd86d=['where','limit','include','map','model','attributes','ShowDeskAccount','DeskAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','findAll','options','raw'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xd86d,0x1a0));var _0xdd86=function(_0x699b3f,_0x2a2138){_0x699b3f=_0x699b3f-0x0;var _0x2a2027=_0xd86d[_0x699b3f];return _0x2a2027;};'use strict';var _=require(_0xdd86('0x0'));var util=require('util');var moment=require(_0xdd86('0x1'));var BPromise=require(_0xdd86('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd86('0x3'));var db=require(_0xdd86('0x4'))['db'];var utils=require(_0xdd86('0x5'));var logger=require(_0xdd86('0x6'))(_0xdd86('0x7'));var config=require(_0xdd86('0x8'));var jayson=require(_0xdd86('0x9'));var client=jayson[_0xdd86('0xa')][_0xdd86('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1caa34,_0x4e8a2c,_0x5efecc){return new BPromise(function(_0x3d11c0,_0x195e0e){return client[_0xdd86('0xc')](_0x1caa34,_0x5efecc)['then'](function(_0x28ca18){logger[_0xdd86('0xd')](_0xdd86('0xe'),_0x4e8a2c,_0xdd86('0xf'));logger[_0xdd86('0x10')](_0xdd86('0x11'),_0x4e8a2c,'request\x20sent',JSON[_0xdd86('0x12')](_0x28ca18));if(_0x28ca18[_0xdd86('0x13')]){if(_0x28ca18['error'][_0xdd86('0x14')]===0x1f4){logger['error'](_0xdd86('0xe'),_0x4e8a2c,_0x28ca18['error']['message']);return _0x195e0e(_0x28ca18[_0xdd86('0x13')][_0xdd86('0x15')]);}logger[_0xdd86('0x13')](_0xdd86('0xe'),_0x4e8a2c,_0x28ca18[_0xdd86('0x13')][_0xdd86('0x15')]);return _0x3d11c0(_0x28ca18[_0xdd86('0x13')][_0xdd86('0x15')]);}else{logger[_0xdd86('0xd')]('DeskAccount,\x20%s,\x20%s',_0x4e8a2c,'request\x20sent');_0x3d11c0(_0x28ca18[_0xdd86('0x16')][_0xdd86('0x15')]);}})[_0xdd86('0x17')](function(_0x360b01){logger[_0xdd86('0x13')]('DeskAccount,\x20%s,\x20%s',_0x4e8a2c,_0x360b01);_0x195e0e(_0x360b01);});});}exports[_0xdd86('0x18')]=function(_0x186798){var _0x3917cc=this;return new Promise(function(_0x443652,_0x3bcf38){return db['DeskAccount'][_0xdd86('0x19')]({'raw':_0x186798['options']?_0x186798[_0xdd86('0x1a')][_0xdd86('0x1b')]===undefined?!![]:![]:!![],'where':_0x186798[_0xdd86('0x1a')]?_0x186798[_0xdd86('0x1a')][_0xdd86('0x1c')]||null:null,'attributes':_0x186798[_0xdd86('0x1a')]?_0x186798['options']['attributes']||null:null,'limit':_0x186798[_0xdd86('0x1a')]?_0x186798[_0xdd86('0x1a')][_0xdd86('0x1d')]||null:null,'include':_0x186798[_0xdd86('0x1a')]?_0x186798[_0xdd86('0x1a')][_0xdd86('0x1e')]?_[_0xdd86('0x1f')](_0x186798[_0xdd86('0x1a')][_0xdd86('0x1e')],function(_0xb966c4){return{'model':db[_0xb966c4[_0xdd86('0x20')]],'as':_0xb966c4['as'],'attributes':_0xb966c4[_0xdd86('0x21')],'include':_0xb966c4[_0xdd86('0x1e')]?_[_0xdd86('0x1f')](_0xb966c4[_0xdd86('0x1e')],function(_0x52ab35){return{'model':db[_0x52ab35['model']],'as':_0x52ab35['as'],'attributes':_0x52ab35['attributes'],'include':_0x52ab35['include']?_[_0xdd86('0x1f')](_0x52ab35[_0xdd86('0x1e')],function(_0x4f339f){return{'model':db[_0x4f339f[_0xdd86('0x20')]],'as':_0x4f339f['as'],'attributes':_0x4f339f[_0xdd86('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40ccf3){logger['info'](_0xdd86('0x18'),_0x186798);logger[_0xdd86('0x10')](_0xdd86('0x18'),_0x186798,JSON[_0xdd86('0x12')](_0x40ccf3));_0x443652(_0x40ccf3);})[_0xdd86('0x17')](function(_0x258d21){logger[_0xdd86('0x13')]('GetDeskAccount',_0x258d21[_0xdd86('0x15')],_0x186798);_0x3bcf38(_0x3917cc[_0xdd86('0x13')](0x1f4,_0x258d21[_0xdd86('0x15')]));});});};exports[_0xdd86('0x22')]=function(_0x3b736e){var _0xad9266=this;return new Promise(function(_0x9f2f8f,_0x487425){return db[_0xdd86('0x23')][_0xdd86('0x24')]({'raw':_0x3b736e[_0xdd86('0x1a')]?_0x3b736e['options'][_0xdd86('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b736e['options']?_0x3b736e[_0xdd86('0x1a')][_0xdd86('0x1c')]||null:null,'attributes':_0x3b736e[_0xdd86('0x1a')]?_0x3b736e[_0xdd86('0x1a')][_0xdd86('0x21')]||null:null,'include':_0x3b736e[_0xdd86('0x1a')]?_0x3b736e[_0xdd86('0x1a')][_0xdd86('0x1e')]?_[_0xdd86('0x1f')](_0x3b736e[_0xdd86('0x1a')][_0xdd86('0x1e')],function(_0x4ace7f){return{'model':db[_0x4ace7f[_0xdd86('0x20')]],'as':_0x4ace7f['as'],'attributes':_0x4ace7f[_0xdd86('0x21')],'include':_0x4ace7f[_0xdd86('0x1e')]?_['map'](_0x4ace7f['include'],function(_0x1f2e73){return{'model':db[_0x1f2e73[_0xdd86('0x20')]],'as':_0x1f2e73['as'],'attributes':_0x1f2e73[_0xdd86('0x21')],'include':_0x1f2e73[_0xdd86('0x1e')]?_[_0xdd86('0x1f')](_0x1f2e73[_0xdd86('0x1e')],function(_0x207429){return{'model':db[_0x207429[_0xdd86('0x20')]],'as':_0x207429['as'],'attributes':_0x207429[_0xdd86('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d16ae){logger[_0xdd86('0xd')](_0xdd86('0x22'),_0x3b736e);logger[_0xdd86('0x10')]('ShowDeskAccount',_0x3b736e,JSON[_0xdd86('0x12')](_0x3d16ae));_0x9f2f8f(_0x3d16ae);})[_0xdd86('0x17')](function(_0x1d3539){logger[_0xdd86('0x13')]('ShowDeskAccount',_0x1d3539[_0xdd86('0x15')],_0x3b736e);_0x487425(_0xad9266[_0xdd86('0x13')](0x1f4,_0x1d3539[_0xdd86('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index dc6d809..d97c662 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcde7=['setTags','put','delete','destroy','exports','path','connect-timeout','express','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post'];(function(_0xd0e206,_0x3cc8b2){var _0x5cf26f=function(_0x378c43){while(--_0x378c43){_0xd0e206['push'](_0xd0e206['shift']());}};_0x5cf26f(++_0x3cc8b2);}(_0xcde7,0x65));var _0x7cde=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xcde7[_0x46e363];return _0x3fb059;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7cde('0x0'));var timeout=require(_0x7cde('0x1'));var express=require(_0x7cde('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7cde('0x3'));var config=require('../../config/environment');var controller=require(_0x7cde('0x4'));router[_0x7cde('0x5')]('/',auth[_0x7cde('0x6')](),controller[_0x7cde('0x7')]);router[_0x7cde('0x5')](_0x7cde('0x8'),auth['isAuthenticated'](),controller[_0x7cde('0x9')]);router['get'](_0x7cde('0xa'),auth[_0x7cde('0x6')](),controller[_0x7cde('0xb')]);router[_0x7cde('0x5')]('/:id/subjects',auth[_0x7cde('0x6')](),controller[_0x7cde('0xc')]);router[_0x7cde('0x5')](_0x7cde('0xd'),auth[_0x7cde('0x6')](),controller[_0x7cde('0xe')]);router[_0x7cde('0x5')](_0x7cde('0xf'),auth[_0x7cde('0x6')](),controller[_0x7cde('0x10')]);router['post']('/',auth[_0x7cde('0x6')](),controller[_0x7cde('0x11')]);router[_0x7cde('0x12')](_0x7cde('0xf'),auth[_0x7cde('0x6')](),controller[_0x7cde('0x13')]);router[_0x7cde('0x14')](_0x7cde('0x8'),auth[_0x7cde('0x6')](),controller['update']);router[_0x7cde('0x15')](_0x7cde('0x8'),auth[_0x7cde('0x6')](),controller[_0x7cde('0x16')]);module[_0x7cde('0x17')]=router; \ No newline at end of file +var _0x9bdb=['setTags','put','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','getTags','post','create','/:id/tags'];(function(_0x59987a,_0x399e11){var _0x460646=function(_0x32c3c0){while(--_0x32c3c0){_0x59987a['push'](_0x59987a['shift']());}};_0x460646(++_0x399e11);}(_0x9bdb,0x13c));var _0xb9bd=function(_0x16398e,_0x3d4933){_0x16398e=_0x16398e-0x0;var _0x26551a=_0x9bdb[_0x16398e];return _0x26551a;};'use strict';var multer=require(_0xb9bd('0x0'));var util=require(_0xb9bd('0x1'));var path=require(_0xb9bd('0x2'));var timeout=require(_0xb9bd('0x3'));var express=require('express');var router=express[_0xb9bd('0x4')]();var auth=require(_0xb9bd('0x5'));var interaction=require(_0xb9bd('0x6'));var config=require(_0xb9bd('0x7'));var controller=require(_0xb9bd('0x8'));router[_0xb9bd('0x9')]('/',auth[_0xb9bd('0xa')](),controller[_0xb9bd('0xb')]);router['get'](_0xb9bd('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb9bd('0x9')](_0xb9bd('0xd'),auth['isAuthenticated'](),controller[_0xb9bd('0xe')]);router[_0xb9bd('0x9')](_0xb9bd('0xf'),auth[_0xb9bd('0xa')](),controller[_0xb9bd('0x10')]);router['get']('/:id/descriptions',auth[_0xb9bd('0xa')](),controller[_0xb9bd('0x11')]);router[_0xb9bd('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0xb9bd('0x12')]);router[_0xb9bd('0x13')]('/',auth['isAuthenticated'](),controller[_0xb9bd('0x14')]);router[_0xb9bd('0x13')](_0xb9bd('0x15'),auth['isAuthenticated'](),controller[_0xb9bd('0x16')]);router[_0xb9bd('0x17')](_0xb9bd('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xb9bd('0x18')]('/:id',auth[_0xb9bd('0xa')](),controller['destroy']);module[_0xb9bd('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index a33b501..a77d2fb 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5da=['exports','STRING','sequelize'];(function(_0xf26077,_0x4880d9){var _0x522a44=function(_0x1e89e0){while(--_0x1e89e0){_0xf26077['push'](_0xf26077['shift']());}};_0x522a44(++_0x4880d9);}(_0xe5da,0x1b5));var _0xae5d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe5da[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xae5d('0x0'));module[_0xae5d('0x1')]={'name':{'type':Sequelize[_0xae5d('0x2')]},'description':{'type':Sequelize[_0xae5d('0x2')]}}; \ No newline at end of file +var _0xf05a=['exports','STRING'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0xf05a,0x1a0));var _0xaf05=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf05a[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module[_0xaf05('0x0')]={'name':{'type':Sequelize[_0xaf05('0x1')]},'description':{'type':Sequelize[_0xaf05('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 1ebe5ad..c1d4dbc 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35ff=['ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack','name','send','DeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','map','type','key','VIRTUAL','field','filter','merge','options','where','includeAll','include','rows','show','params','length','find','create','body','getFields','findOne','DeskField','getSubjects','getDescriptions','Tag','getTags','setTags','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x274e20,_0x3600c7){var _0x247ac8=function(_0x42488a){while(--_0x42488a){_0x274e20['push'](_0x274e20['shift']());}};_0x247ac8(++_0x3600c7);}(_0x35ff,0xb3));var _0xf35f=function(_0x3f9e07,_0x1c07a4){_0x3f9e07=_0x3f9e07-0x0;var _0x4f5c0a=_0x35ff[_0x3f9e07];return _0x4f5c0a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf35f('0x0'));var rimraf=require(_0xf35f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf35f('0x2'));var rp=require(_0xf35f('0x3'));var moment=require('moment');var BPromise=require(_0xf35f('0x4'));var Mustache=require('mustache');var util=require(_0xf35f('0x5'));var path=require(_0xf35f('0x6'));var sox=require(_0xf35f('0x7'));var csv=require(_0xf35f('0x8'));var ejs=require(_0xf35f('0x9'));var fs=require('fs');var _=require(_0xf35f('0xa'));var squel=require('squel');var crypto=require(_0xf35f('0xb'));var jsforce=require(_0xf35f('0xc'));var deskjs=require(_0xf35f('0xd'));var toCsv=require(_0xf35f('0x8'));var querystring=require('querystring');var Papa=require(_0xf35f('0xe'));var Redis=require(_0xf35f('0xf'));var authService=require(_0xf35f('0x10'));var qs=require(_0xf35f('0x11'));var hardwareService=require(_0xf35f('0x12'));var logger=require(_0xf35f('0x13'))(_0xf35f('0x14'));var utils=require('../../config/utils');var config=require(_0xf35f('0x15'));var db=require(_0xf35f('0x16'))['db'];var jayson=require(_0xf35f('0x17'));var client=jayson[_0xf35f('0x18')][_0xf35f('0x19')]({'port':0x232a});function checkPasswordPattern(_0xf33700,_0x26588a,_0x295701){if(_0x295701){var _0x5b38be=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b38be[_0xf35f('0x1a')](_0x26588a)){return _0xf33700;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xf33700;}}function respondWithRpcPromise(_0xe29ff7,_0x335c9a,_0x577fb0,_0x375bd3){return new BPromise(function(_0x378009,_0x83110d){var _0x2fff4c=_0x375bd3||client;return _0x2fff4c[_0xf35f('0x1b')](_0xe29ff7,_0x577fb0)['then'](function(_0x1ddc4f){logger[_0xf35f('0x1c')](_0xf35f('0x1d'),_0x335c9a,_0xf35f('0x1e'));logger['debug'](_0xf35f('0x1f'),_0x335c9a,_0xf35f('0x1e'),JSON[_0xf35f('0x20')](_0x1ddc4f));if(_0x1ddc4f[_0xf35f('0x21')]){if(_0x1ddc4f[_0xf35f('0x21')]['code']===0x1f4){logger[_0xf35f('0x21')](_0xf35f('0x1d'),_0x335c9a,_0x1ddc4f[_0xf35f('0x21')][_0xf35f('0x22')]);return _0x83110d(_0x1ddc4f[_0xf35f('0x21')][_0xf35f('0x22')]);}logger[_0xf35f('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x335c9a,_0x1ddc4f[_0xf35f('0x21')][_0xf35f('0x22')]);return _0x378009(_0x1ddc4f['error'][_0xf35f('0x22')]);}else{logger['info'](_0xf35f('0x1d'),_0x335c9a,'request\x20sent');_0x378009(_0x1ddc4f[_0xf35f('0x23')][_0xf35f('0x22')]);}})[_0xf35f('0x24')](function(_0x577c4b){logger[_0xf35f('0x21')](_0xf35f('0x1d'),_0x335c9a,_0x577c4b);_0x83110d(_0x577c4b);});});}function respondWithStatusCode(_0x168266,_0x30a846){_0x30a846=_0x30a846||0xcc;return function(_0x47518b){if(_0x47518b){return _0x168266['sendStatus'](_0x30a846);}return _0x168266['status'](_0x30a846)[_0xf35f('0x25')]();};}function respondWithResult(_0xfe214,_0x4dcd39){_0x4dcd39=_0x4dcd39||0xc8;return function(_0x25a6a3){if(_0x25a6a3){return _0xfe214[_0xf35f('0x26')](_0x4dcd39)['json'](_0x25a6a3);}};}function respondWithFilteredResult(_0x16c0e3,_0x4e9741){return function(_0x24a76c){if(_0x24a76c){var _0x3a67de=_0x24a76c[_0xf35f('0x27')],_0x5282b2=_0x4e9741[_0xf35f('0x28')],_0x3e2ce9=_0x4e9741[_0xf35f('0x28')]+_0x4e9741[_0xf35f('0x29')],_0x3f88dc;if(_0x3e2ce9>=_0x3a67de){_0x3e2ce9=_0x3a67de;_0x3f88dc=0xc8;}else{_0x3f88dc=0xce;}_0x16c0e3[_0xf35f('0x26')](_0x3f88dc);return _0x16c0e3[_0xf35f('0x2a')](_0xf35f('0x2b'),_0x5282b2+'-'+_0x3e2ce9+'/'+_0x3a67de)[_0xf35f('0x2c')](_0x24a76c);}return null;};}function patchUpdates(_0x41a4af){return function(_0x399d63){try{jsonpatch[_0xf35f('0x2d')](_0x399d63,_0x41a4af,!![]);}catch(_0x3be48e){return BPromise['reject'](_0x3be48e);}return _0x399d63[_0xf35f('0x2e')]();};}function saveUpdates(_0x192ca1,_0x2243f4){return function(_0x20c391){if(_0x20c391){return _0x20c391[_0xf35f('0x2f')](_0x192ca1)[_0xf35f('0x30')](function(_0x256b7b){return _0x256b7b;});}return null;};}function removeEntity(_0x338ad7,_0x389782){return function(_0x4eef2c){if(_0x4eef2c){return _0x4eef2c[_0xf35f('0x31')]()['then'](function(){_0x338ad7[_0xf35f('0x26')](0xcc)[_0xf35f('0x25')]();});}};}function handleEntityNotFound(_0x16b37d,_0x49b53a){return function(_0x430c81){if(!_0x430c81){_0x16b37d[_0xf35f('0x32')](0x194);}return _0x430c81;};}function handleError(_0x3d69af,_0x1ef7b4){_0x1ef7b4=_0x1ef7b4||0x1f4;return function(_0x1e4c3b){logger[_0xf35f('0x21')](_0x1e4c3b[_0xf35f('0x33')]);if(_0x1e4c3b[_0xf35f('0x34')]){delete _0x1e4c3b['name'];}_0x3d69af[_0xf35f('0x26')](_0x1ef7b4)[_0xf35f('0x35')](_0x1e4c3b);};}exports['index']=function(_0x5784e5,_0x551ad1){var _0x4c26f5={},_0x14f203={},_0x50616b={'count':0x0,'rows':[]};var _0xa2db7=db[_0xf35f('0x36')][_0xf35f('0x37')];_0x14f203[_0xf35f('0x38')]=_[_0xf35f('0x39')](_0xa2db7);_0x14f203[_0xf35f('0x3a')]=_[_0xf35f('0x39')](_0x5784e5['query']);_0x14f203[_0xf35f('0x3b')]=_[_0xf35f('0x3c')](_0x14f203['model'],_0x14f203['query']);_0x4c26f5[_0xf35f('0x3d')]=_[_0xf35f('0x3c')](_0x14f203[_0xf35f('0x38')],qs[_0xf35f('0x3e')](_0x5784e5[_0xf35f('0x3a')]['fields']));_0x4c26f5[_0xf35f('0x3d')]=_0x4c26f5['attributes']['length']?_0x4c26f5[_0xf35f('0x3d')]:_0x14f203['model'];if(!_0x5784e5[_0xf35f('0x3a')][_0xf35f('0x3f')](_0xf35f('0x40'))){_0x4c26f5[_0xf35f('0x29')]=qs['limit'](_0x5784e5[_0xf35f('0x3a')][_0xf35f('0x29')]);_0x4c26f5[_0xf35f('0x28')]=qs[_0xf35f('0x28')](_0x5784e5['query']['offset']);}_0x4c26f5[_0xf35f('0x41')]=qs[_0xf35f('0x42')](_0x5784e5['query'][_0xf35f('0x42')]);_0x4c26f5['where']=qs[_0xf35f('0x3b')](_[_0xf35f('0x43')](_0x5784e5[_0xf35f('0x3a')],_0x14f203[_0xf35f('0x3b')]));if(_0x5784e5[_0xf35f('0x3a')]['filter']){_0x4c26f5['where']=_['merge'](_0x4c26f5['where'],{'$or':_[_0xf35f('0x44')](_0xa2db7,function(_0x35cca3){if(_0x35cca3[_0xf35f('0x45')][_0xf35f('0x46')]!==_0xf35f('0x47')){var _0x16bcb1={};_0x16bcb1[_0x35cca3[_0xf35f('0x48')]]={'$like':'%'+_0x5784e5[_0xf35f('0x3a')][_0xf35f('0x49')]+'%'};return _0x16bcb1;}})});}_0x4c26f5=_[_0xf35f('0x4a')]({},_0x4c26f5,_0x5784e5[_0xf35f('0x4b')]);var _0x250f1b={'where':_0x4c26f5[_0xf35f('0x4c')]};return db[_0xf35f('0x36')]['count'](_0x250f1b)[_0xf35f('0x30')](function(_0x12b8b8){_0x50616b[_0xf35f('0x27')]=_0x12b8b8;if(_0x5784e5[_0xf35f('0x3a')][_0xf35f('0x4d')]){_0x4c26f5[_0xf35f('0x4e')]=[{'all':!![]}];}return db[_0xf35f('0x36')]['findAll'](_0x4c26f5);})[_0xf35f('0x30')](function(_0x2f2c88){_0x50616b[_0xf35f('0x4f')]=_0x2f2c88;return _0x50616b;})['then'](respondWithFilteredResult(_0x551ad1,_0x4c26f5))['catch'](handleError(_0x551ad1,null));};exports[_0xf35f('0x50')]=function(_0x244b80,_0xf355d9){var _0x48fb8c={'raw':![],'where':{'id':_0x244b80[_0xf35f('0x51')]['id']}},_0x1dc7e1={};_0x1dc7e1[_0xf35f('0x38')]=_[_0xf35f('0x39')](db[_0xf35f('0x36')]['rawAttributes']);_0x1dc7e1[_0xf35f('0x3a')]=_['keys'](_0x244b80[_0xf35f('0x3a')]);_0x1dc7e1[_0xf35f('0x3b')]=_['intersection'](_0x1dc7e1[_0xf35f('0x38')],_0x1dc7e1['query']);_0x48fb8c[_0xf35f('0x3d')]=_[_0xf35f('0x3c')](_0x1dc7e1[_0xf35f('0x38')],qs[_0xf35f('0x3e')](_0x244b80[_0xf35f('0x3a')][_0xf35f('0x3e')]));_0x48fb8c[_0xf35f('0x3d')]=_0x48fb8c[_0xf35f('0x3d')][_0xf35f('0x52')]?_0x48fb8c[_0xf35f('0x3d')]:_0x1dc7e1[_0xf35f('0x38')];if(_0x244b80[_0xf35f('0x3a')]['includeAll']){_0x48fb8c[_0xf35f('0x4e')]=[{'all':!![]}];}_0x48fb8c=_[_0xf35f('0x4a')]({},_0x48fb8c,_0x244b80[_0xf35f('0x4b')]);return db[_0xf35f('0x36')][_0xf35f('0x53')](_0x48fb8c)[_0xf35f('0x30')](handleEntityNotFound(_0xf355d9,null))[_0xf35f('0x30')](respondWithResult(_0xf355d9,null))[_0xf35f('0x24')](handleError(_0xf355d9,null));};exports['create']=function(_0x1e687e,_0x183a57){return db['DeskConfiguration'][_0xf35f('0x54')](_0x1e687e[_0xf35f('0x55')],{})[_0xf35f('0x30')](respondWithResult(_0x183a57,0xc9))[_0xf35f('0x24')](handleError(_0x183a57,null));};exports[_0xf35f('0x2f')]=function(_0x57d3d0,_0x4a1894){if(_0x57d3d0[_0xf35f('0x55')]['id']){delete _0x57d3d0[_0xf35f('0x55')]['id'];}return db[_0xf35f('0x36')][_0xf35f('0x53')]({'where':{'id':_0x57d3d0[_0xf35f('0x51')]['id']}})['then'](handleEntityNotFound(_0x4a1894,null))[_0xf35f('0x30')](saveUpdates(_0x57d3d0[_0xf35f('0x55')],null))[_0xf35f('0x30')](respondWithResult(_0x4a1894,null))[_0xf35f('0x24')](handleError(_0x4a1894,null));};exports[_0xf35f('0x31')]=function(_0xaf45de,_0x9a8f16){return db[_0xf35f('0x36')][_0xf35f('0x53')]({'where':{'id':_0xaf45de['params']['id']}})[_0xf35f('0x30')](handleEntityNotFound(_0x9a8f16,null))['then'](removeEntity(_0x9a8f16,null))['catch'](handleError(_0x9a8f16,null));};exports[_0xf35f('0x56')]=function(_0xde1de5,_0xe7eade,_0x369226){var _0x12241b={};var _0x6de3b={};var _0x96ee0d;var _0x5a6641;return db[_0xf35f('0x36')][_0xf35f('0x57')]({'where':{'id':_0xde1de5[_0xf35f('0x51')]['id']}})[_0xf35f('0x30')](handleEntityNotFound(_0xe7eade,null))[_0xf35f('0x30')](function(_0x3a0bc9){if(_0x3a0bc9){_0x96ee0d=_0x3a0bc9;_0x6de3b[_0xf35f('0x38')]=_[_0xf35f('0x39')](db[_0xf35f('0x58')][_0xf35f('0x37')]);_0x6de3b['query']=_[_0xf35f('0x39')](_0xde1de5[_0xf35f('0x3a')]);_0x6de3b['filters']=_[_0xf35f('0x3c')](_0x6de3b[_0xf35f('0x38')],_0x6de3b[_0xf35f('0x3a')]);_0x12241b[_0xf35f('0x3d')]=_[_0xf35f('0x3c')](_0x6de3b[_0xf35f('0x38')],qs[_0xf35f('0x3e')](_0xde1de5[_0xf35f('0x3a')][_0xf35f('0x3e')]));_0x12241b[_0xf35f('0x3d')]=_0x12241b[_0xf35f('0x3d')]['length']?_0x12241b[_0xf35f('0x3d')]:_0x6de3b[_0xf35f('0x38')];_0x12241b[_0xf35f('0x41')]=qs['sort'](_0xde1de5[_0xf35f('0x3a')][_0xf35f('0x42')]);_0x12241b[_0xf35f('0x4c')]=qs[_0xf35f('0x3b')](_[_0xf35f('0x43')](_0xde1de5['query'],_0x6de3b['filters']));if(_0xde1de5[_0xf35f('0x3a')][_0xf35f('0x49')]){_0x12241b['where']=_[_0xf35f('0x4a')](_0x12241b[_0xf35f('0x4c')],{'$or':_[_0xf35f('0x44')](_0x12241b[_0xf35f('0x3d')],function(_0x19511d){var _0x440066={};_0x440066[_0x19511d]={'$like':'%'+_0xde1de5[_0xf35f('0x3a')][_0xf35f('0x49')]+'%'};return _0x440066;})});}_0x12241b=_[_0xf35f('0x4a')]({},_0x12241b,_0xde1de5['options']);return _0x96ee0d[_0xf35f('0x56')](_0x12241b);}})['then'](function(_0x17d275){if(_0x17d275){_0x5a6641=_0x17d275[_0xf35f('0x52')];if(!_0xde1de5[_0xf35f('0x3a')][_0xf35f('0x3f')](_0xf35f('0x40'))){_0x12241b['limit']=qs[_0xf35f('0x29')](_0xde1de5[_0xf35f('0x3a')]['limit']);_0x12241b['offset']=qs['offset'](_0xde1de5[_0xf35f('0x3a')][_0xf35f('0x28')]);}return _0x96ee0d[_0xf35f('0x56')](_0x12241b);}})[_0xf35f('0x30')](function(_0x21c1f6){if(_0x21c1f6){return _0x21c1f6?{'count':_0x5a6641,'rows':_0x21c1f6}:null;}})['then'](respondWithResult(_0xe7eade,null))[_0xf35f('0x24')](handleError(_0xe7eade,null));};exports[_0xf35f('0x59')]=function(_0x29381c,_0x498706,_0x167236){var _0x294e6d={};var _0x777c1f={};var _0x1138af;var _0x433890;return db[_0xf35f('0x36')][_0xf35f('0x57')]({'where':{'id':_0x29381c[_0xf35f('0x51')]['id']}})[_0xf35f('0x30')](handleEntityNotFound(_0x498706,null))[_0xf35f('0x30')](function(_0x3806cb){if(_0x3806cb){_0x1138af=_0x3806cb;_0x777c1f[_0xf35f('0x38')]=_[_0xf35f('0x39')](db[_0xf35f('0x58')][_0xf35f('0x37')]);_0x777c1f[_0xf35f('0x3a')]=_[_0xf35f('0x39')](_0x29381c[_0xf35f('0x3a')]);_0x777c1f[_0xf35f('0x3b')]=_[_0xf35f('0x3c')](_0x777c1f[_0xf35f('0x38')],_0x777c1f['query']);_0x294e6d[_0xf35f('0x3d')]=_[_0xf35f('0x3c')](_0x777c1f[_0xf35f('0x38')],qs[_0xf35f('0x3e')](_0x29381c[_0xf35f('0x3a')][_0xf35f('0x3e')]));_0x294e6d[_0xf35f('0x3d')]=_0x294e6d[_0xf35f('0x3d')][_0xf35f('0x52')]?_0x294e6d[_0xf35f('0x3d')]:_0x777c1f[_0xf35f('0x38')];_0x294e6d[_0xf35f('0x41')]=qs[_0xf35f('0x42')](_0x29381c[_0xf35f('0x3a')][_0xf35f('0x42')]);_0x294e6d[_0xf35f('0x4c')]=qs['filters'](_[_0xf35f('0x43')](_0x29381c[_0xf35f('0x3a')],_0x777c1f['filters']));if(_0x29381c[_0xf35f('0x3a')]['filter']){_0x294e6d[_0xf35f('0x4c')]=_[_0xf35f('0x4a')](_0x294e6d[_0xf35f('0x4c')],{'$or':_[_0xf35f('0x44')](_0x294e6d['attributes'],function(_0xc8e189){var _0x20d654={};_0x20d654[_0xc8e189]={'$like':'%'+_0x29381c['query'][_0xf35f('0x49')]+'%'};return _0x20d654;})});}_0x294e6d=_[_0xf35f('0x4a')]({},_0x294e6d,_0x29381c[_0xf35f('0x4b')]);return _0x1138af[_0xf35f('0x59')](_0x294e6d);}})[_0xf35f('0x30')](function(_0x21cb72){if(_0x21cb72){_0x433890=_0x21cb72['length'];if(!_0x29381c['query']['hasOwnProperty'](_0xf35f('0x40'))){_0x294e6d['limit']=qs[_0xf35f('0x29')](_0x29381c['query']['limit']);_0x294e6d['offset']=qs['offset'](_0x29381c[_0xf35f('0x3a')][_0xf35f('0x28')]);}return _0x1138af[_0xf35f('0x59')](_0x294e6d);}})[_0xf35f('0x30')](function(_0x41506a){if(_0x41506a){return _0x41506a?{'count':_0x433890,'rows':_0x41506a}:null;}})['then'](respondWithResult(_0x498706,null))['catch'](handleError(_0x498706,null));};exports[_0xf35f('0x5a')]=function(_0x3f8863,_0x480f6e,_0x3f134f){var _0x4eb177={};var _0x4f59bf={};var _0x259093;var _0x4a51d5;return db[_0xf35f('0x36')][_0xf35f('0x57')]({'where':{'id':_0x3f8863[_0xf35f('0x51')]['id']}})[_0xf35f('0x30')](handleEntityNotFound(_0x480f6e,null))[_0xf35f('0x30')](function(_0x219a9d){if(_0x219a9d){_0x259093=_0x219a9d;_0x4f59bf[_0xf35f('0x38')]=_['keys'](db[_0xf35f('0x58')][_0xf35f('0x37')]);_0x4f59bf[_0xf35f('0x3a')]=_['keys'](_0x3f8863[_0xf35f('0x3a')]);_0x4f59bf[_0xf35f('0x3b')]=_['intersection'](_0x4f59bf[_0xf35f('0x38')],_0x4f59bf[_0xf35f('0x3a')]);_0x4eb177[_0xf35f('0x3d')]=_['intersection'](_0x4f59bf['model'],qs[_0xf35f('0x3e')](_0x3f8863['query'][_0xf35f('0x3e')]));_0x4eb177[_0xf35f('0x3d')]=_0x4eb177['attributes'][_0xf35f('0x52')]?_0x4eb177[_0xf35f('0x3d')]:_0x4f59bf['model'];_0x4eb177[_0xf35f('0x41')]=qs['sort'](_0x3f8863[_0xf35f('0x3a')][_0xf35f('0x42')]);_0x4eb177[_0xf35f('0x4c')]=qs[_0xf35f('0x3b')](_[_0xf35f('0x43')](_0x3f8863[_0xf35f('0x3a')],_0x4f59bf['filters']));if(_0x3f8863[_0xf35f('0x3a')][_0xf35f('0x49')]){_0x4eb177['where']=_['merge'](_0x4eb177['where'],{'$or':_[_0xf35f('0x44')](_0x4eb177[_0xf35f('0x3d')],function(_0x5b8e04){var _0x5052b3={};_0x5052b3[_0x5b8e04]={'$like':'%'+_0x3f8863[_0xf35f('0x3a')]['filter']+'%'};return _0x5052b3;})});}_0x4eb177=_[_0xf35f('0x4a')]({},_0x4eb177,_0x3f8863[_0xf35f('0x4b')]);return _0x259093[_0xf35f('0x5a')](_0x4eb177);}})[_0xf35f('0x30')](function(_0x4b6fc6){if(_0x4b6fc6){_0x4a51d5=_0x4b6fc6[_0xf35f('0x52')];if(!_0x3f8863['query']['hasOwnProperty'](_0xf35f('0x40'))){_0x4eb177[_0xf35f('0x29')]=qs[_0xf35f('0x29')](_0x3f8863[_0xf35f('0x3a')]['limit']);_0x4eb177[_0xf35f('0x28')]=qs[_0xf35f('0x28')](_0x3f8863['query'][_0xf35f('0x28')]);}return _0x259093[_0xf35f('0x5a')](_0x4eb177);}})['then'](function(_0x273053){if(_0x273053){return _0x273053?{'count':_0x4a51d5,'rows':_0x273053}:null;}})[_0xf35f('0x30')](respondWithResult(_0x480f6e,null))[_0xf35f('0x24')](handleError(_0x480f6e,null));};exports['getTags']=function(_0x1753b4,_0x3067de,_0x439a1b){var _0x40b1f7={};var _0x4b029b={};var _0x5d182e;var _0x1a7a0b;return db[_0xf35f('0x36')][_0xf35f('0x57')]({'where':{'id':_0x1753b4[_0xf35f('0x51')]['id']}})[_0xf35f('0x30')](handleEntityNotFound(_0x3067de,null))[_0xf35f('0x30')](function(_0x21a9f4){if(_0x21a9f4){_0x5d182e=_0x21a9f4;_0x4b029b[_0xf35f('0x38')]=_[_0xf35f('0x39')](db[_0xf35f('0x5b')][_0xf35f('0x37')]);_0x4b029b['query']=_['keys'](_0x1753b4[_0xf35f('0x3a')]);_0x4b029b[_0xf35f('0x3b')]=_[_0xf35f('0x3c')](_0x4b029b[_0xf35f('0x38')],_0x4b029b[_0xf35f('0x3a')]);_0x40b1f7[_0xf35f('0x3d')]=_['intersection'](_0x4b029b[_0xf35f('0x38')],qs[_0xf35f('0x3e')](_0x1753b4['query'][_0xf35f('0x3e')]));_0x40b1f7[_0xf35f('0x3d')]=_0x40b1f7['attributes'][_0xf35f('0x52')]?_0x40b1f7[_0xf35f('0x3d')]:_0x4b029b['model'];_0x40b1f7['order']=qs['sort'](_0x1753b4['query'][_0xf35f('0x42')]);_0x40b1f7[_0xf35f('0x4c')]=qs['filters'](_[_0xf35f('0x43')](_0x1753b4[_0xf35f('0x3a')],_0x4b029b['filters']));if(_0x1753b4[_0xf35f('0x3a')][_0xf35f('0x49')]){_0x40b1f7[_0xf35f('0x4c')]=_[_0xf35f('0x4a')](_0x40b1f7[_0xf35f('0x4c')],{'$or':_[_0xf35f('0x44')](_0x40b1f7[_0xf35f('0x3d')],function(_0x33c792){var _0x5ecbba={};_0x5ecbba[_0x33c792]={'$like':'%'+_0x1753b4[_0xf35f('0x3a')][_0xf35f('0x49')]+'%'};return _0x5ecbba;})});}_0x40b1f7=_[_0xf35f('0x4a')]({},_0x40b1f7,_0x1753b4['options']);return _0x5d182e[_0xf35f('0x5c')](_0x40b1f7);}})[_0xf35f('0x30')](function(_0x1c76e1){if(_0x1c76e1){_0x1a7a0b=_0x1c76e1['length'];if(!_0x1753b4[_0xf35f('0x3a')][_0xf35f('0x3f')](_0xf35f('0x40'))){_0x40b1f7[_0xf35f('0x29')]=qs[_0xf35f('0x29')](_0x1753b4[_0xf35f('0x3a')]['limit']);_0x40b1f7[_0xf35f('0x28')]=qs['offset'](_0x1753b4['query'][_0xf35f('0x28')]);}return _0x5d182e[_0xf35f('0x5c')](_0x40b1f7);}})['then'](function(_0xe14cf1){if(_0xe14cf1){return _0xe14cf1?{'count':_0x1a7a0b,'rows':_0xe14cf1}:null;}})['then'](respondWithResult(_0x3067de,null))[_0xf35f('0x24')](handleError(_0x3067de,null));};exports['setTags']=function(_0x1a97fe,_0x163c15,_0x5455b9){if(_0x1a97fe['body']['id']){delete _0x1a97fe[_0xf35f('0x55')]['id'];}return db[_0xf35f('0x36')][_0xf35f('0x57')]({'where':{'id':_0x1a97fe['params']['id']}})[_0xf35f('0x30')](handleEntityNotFound(_0x163c15,null))[_0xf35f('0x30')](function(_0xf93207){if(_0xf93207){return _0xf93207[_0xf35f('0x5d')](_0x1a97fe[_0xf35f('0x55')]['ids']||[]);}return null;})[_0xf35f('0x30')](respondWithResult(_0x163c15,null))[_0xf35f('0x24')](handleError(_0x163c15,null));}; \ No newline at end of file +var _0x3264=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','key','VIRTUAL','field','filter','options','include','rows','catch','show','params','includeAll','find','create','body','getFields','findOne','DeskField','rawAttributes','map','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','DeskConfiguration','keys','query','filters','intersection'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3264,0x7f));var _0x4326=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x3264[_0x1992f1];return _0x413dfe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4326('0x0'));var rimraf=require(_0x4326('0x1'));var zipdir=require(_0x4326('0x2'));var jsonpatch=require(_0x4326('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4326('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4326('0x5'));var sox=require(_0x4326('0x6'));var csv=require(_0x4326('0x7'));var ejs=require(_0x4326('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4326('0x9'));var crypto=require(_0x4326('0xa'));var jsforce=require(_0x4326('0xb'));var deskjs=require(_0x4326('0xc'));var toCsv=require(_0x4326('0x7'));var querystring=require(_0x4326('0xd'));var Papa=require(_0x4326('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4326('0xf'));var hardwareService=require(_0x4326('0x10'));var logger=require(_0x4326('0x11'))(_0x4326('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4326('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x4326('0x14')][_0x4326('0x15')]({'port':0x232a});function checkPasswordPattern(_0x3515af,_0x4f8f3d,_0x5f17ac){if(_0x5f17ac){var _0x1087d9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1087d9['test'](_0x4f8f3d)){return _0x3515af;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3515af;}}function respondWithRpcPromise(_0x1b082c,_0x2c2232,_0xd376ca,_0x99c1ae){return new BPromise(function(_0x5b26f3,_0x301025){var _0x353204=_0x99c1ae||client;return _0x353204[_0x4326('0x16')](_0x1b082c,_0xd376ca)['then'](function(_0x6ad5cf){logger[_0x4326('0x17')](_0x4326('0x18'),_0x2c2232,_0x4326('0x19'));logger['debug'](_0x4326('0x1a'),_0x2c2232,'request\x20sent',JSON[_0x4326('0x1b')](_0x6ad5cf));if(_0x6ad5cf[_0x4326('0x1c')]){if(_0x6ad5cf[_0x4326('0x1c')][_0x4326('0x1d')]===0x1f4){logger[_0x4326('0x1c')]('DeskConfiguration,\x20%s,\x20%s',_0x2c2232,_0x6ad5cf[_0x4326('0x1c')][_0x4326('0x1e')]);return _0x301025(_0x6ad5cf['error'][_0x4326('0x1e')]);}logger[_0x4326('0x1c')](_0x4326('0x18'),_0x2c2232,_0x6ad5cf['error'][_0x4326('0x1e')]);return _0x5b26f3(_0x6ad5cf[_0x4326('0x1c')][_0x4326('0x1e')]);}else{logger[_0x4326('0x17')](_0x4326('0x18'),_0x2c2232,_0x4326('0x19'));_0x5b26f3(_0x6ad5cf[_0x4326('0x1f')][_0x4326('0x1e')]);}})['catch'](function(_0x454565){logger[_0x4326('0x1c')]('DeskConfiguration,\x20%s,\x20%s',_0x2c2232,_0x454565);_0x301025(_0x454565);});});}function respondWithStatusCode(_0x430a95,_0x3d5e8f){_0x3d5e8f=_0x3d5e8f||0xcc;return function(_0xdb1b73){if(_0xdb1b73){return _0x430a95[_0x4326('0x20')](_0x3d5e8f);}return _0x430a95[_0x4326('0x21')](_0x3d5e8f)['end']();};}function respondWithResult(_0x5551df,_0x85600a){_0x85600a=_0x85600a||0xc8;return function(_0x3fe54b){if(_0x3fe54b){return _0x5551df[_0x4326('0x21')](_0x85600a)[_0x4326('0x22')](_0x3fe54b);}};}function respondWithFilteredResult(_0x4a1de7,_0x6f8243){return function(_0x410a97){if(_0x410a97){var _0x13765e=_0x410a97[_0x4326('0x23')],_0x584523=_0x6f8243[_0x4326('0x24')],_0x3b6569=_0x6f8243['offset']+_0x6f8243[_0x4326('0x25')],_0x5a1c44;if(_0x3b6569>=_0x13765e){_0x3b6569=_0x13765e;_0x5a1c44=0xc8;}else{_0x5a1c44=0xce;}_0x4a1de7[_0x4326('0x21')](_0x5a1c44);return _0x4a1de7[_0x4326('0x26')](_0x4326('0x27'),_0x584523+'-'+_0x3b6569+'/'+_0x13765e)['json'](_0x410a97);}return null;};}function patchUpdates(_0x5209ec){return function(_0x5e7e04){try{jsonpatch[_0x4326('0x28')](_0x5e7e04,_0x5209ec,!![]);}catch(_0x371c96){return BPromise[_0x4326('0x29')](_0x371c96);}return _0x5e7e04[_0x4326('0x2a')]();};}function saveUpdates(_0x26fd4e,_0x2d0d14){return function(_0x8917a1){if(_0x8917a1){return _0x8917a1[_0x4326('0x2b')](_0x26fd4e)[_0x4326('0x2c')](function(_0x28c48a){return _0x28c48a;});}return null;};}function removeEntity(_0x49a2d1,_0x20d43d){return function(_0x2ba262){if(_0x2ba262){return _0x2ba262[_0x4326('0x2d')]()[_0x4326('0x2c')](function(){_0x49a2d1['status'](0xcc)[_0x4326('0x2e')]();});}};}function handleEntityNotFound(_0x40b9c3,_0x387297){return function(_0x2ac453){if(!_0x2ac453){_0x40b9c3[_0x4326('0x20')](0x194);}return _0x2ac453;};}function handleError(_0xcaa306,_0x553eba){_0x553eba=_0x553eba||0x1f4;return function(_0x40c1a0){logger[_0x4326('0x1c')](_0x40c1a0[_0x4326('0x2f')]);if(_0x40c1a0[_0x4326('0x30')]){delete _0x40c1a0[_0x4326('0x30')];}_0xcaa306[_0x4326('0x21')](_0x553eba)[_0x4326('0x31')](_0x40c1a0);};}exports['index']=function(_0x5a677f,_0x34dfbf){var _0x49207c={},_0x2d5385={},_0xd394a0={'count':0x0,'rows':[]};var _0x2f7e66=db[_0x4326('0x32')]['rawAttributes'];_0x2d5385['model']=_[_0x4326('0x33')](_0x2f7e66);_0x2d5385[_0x4326('0x34')]=_['keys'](_0x5a677f[_0x4326('0x34')]);_0x2d5385[_0x4326('0x35')]=_[_0x4326('0x36')](_0x2d5385[_0x4326('0x37')],_0x2d5385[_0x4326('0x34')]);_0x49207c[_0x4326('0x38')]=_[_0x4326('0x36')](_0x2d5385[_0x4326('0x37')],qs[_0x4326('0x39')](_0x5a677f[_0x4326('0x34')]['fields']));_0x49207c['attributes']=_0x49207c['attributes'][_0x4326('0x3a')]?_0x49207c[_0x4326('0x38')]:_0x2d5385['model'];if(!_0x5a677f[_0x4326('0x34')][_0x4326('0x3b')](_0x4326('0x3c'))){_0x49207c[_0x4326('0x25')]=qs[_0x4326('0x25')](_0x5a677f['query'][_0x4326('0x25')]);_0x49207c[_0x4326('0x24')]=qs[_0x4326('0x24')](_0x5a677f[_0x4326('0x34')][_0x4326('0x24')]);}_0x49207c[_0x4326('0x3d')]=qs[_0x4326('0x3e')](_0x5a677f[_0x4326('0x34')][_0x4326('0x3e')]);_0x49207c['where']=qs[_0x4326('0x35')](_[_0x4326('0x3f')](_0x5a677f[_0x4326('0x34')],_0x2d5385['filters']));if(_0x5a677f[_0x4326('0x34')]['filter']){_0x49207c[_0x4326('0x40')]=_[_0x4326('0x41')](_0x49207c[_0x4326('0x40')],{'$or':_['map'](_0x2f7e66,function(_0x4af64b){if(_0x4af64b[_0x4326('0x42')][_0x4326('0x43')]!==_0x4326('0x44')){var _0x5e3866={};_0x5e3866[_0x4af64b[_0x4326('0x45')]]={'$like':'%'+_0x5a677f[_0x4326('0x34')][_0x4326('0x46')]+'%'};return _0x5e3866;}})});}_0x49207c=_[_0x4326('0x41')]({},_0x49207c,_0x5a677f[_0x4326('0x47')]);var _0x3e0009={'where':_0x49207c[_0x4326('0x40')]};return db['DeskConfiguration'][_0x4326('0x23')](_0x3e0009)[_0x4326('0x2c')](function(_0x319f9d){_0xd394a0[_0x4326('0x23')]=_0x319f9d;if(_0x5a677f['query']['includeAll']){_0x49207c[_0x4326('0x48')]=[{'all':!![]}];}return db[_0x4326('0x32')]['findAll'](_0x49207c);})[_0x4326('0x2c')](function(_0x1b43d3){_0xd394a0[_0x4326('0x49')]=_0x1b43d3;return _0xd394a0;})[_0x4326('0x2c')](respondWithFilteredResult(_0x34dfbf,_0x49207c))[_0x4326('0x4a')](handleError(_0x34dfbf,null));};exports[_0x4326('0x4b')]=function(_0x5a1db3,_0x2eb217){var _0x16b9d6={'raw':![],'where':{'id':_0x5a1db3[_0x4326('0x4c')]['id']}},_0xcd0eca={};_0xcd0eca[_0x4326('0x37')]=_[_0x4326('0x33')](db[_0x4326('0x32')]['rawAttributes']);_0xcd0eca[_0x4326('0x34')]=_[_0x4326('0x33')](_0x5a1db3[_0x4326('0x34')]);_0xcd0eca[_0x4326('0x35')]=_[_0x4326('0x36')](_0xcd0eca['model'],_0xcd0eca['query']);_0x16b9d6[_0x4326('0x38')]=_[_0x4326('0x36')](_0xcd0eca[_0x4326('0x37')],qs['fields'](_0x5a1db3[_0x4326('0x34')][_0x4326('0x39')]));_0x16b9d6[_0x4326('0x38')]=_0x16b9d6[_0x4326('0x38')][_0x4326('0x3a')]?_0x16b9d6['attributes']:_0xcd0eca[_0x4326('0x37')];if(_0x5a1db3[_0x4326('0x34')][_0x4326('0x4d')]){_0x16b9d6[_0x4326('0x48')]=[{'all':!![]}];}_0x16b9d6=_['merge']({},_0x16b9d6,_0x5a1db3['options']);return db[_0x4326('0x32')][_0x4326('0x4e')](_0x16b9d6)['then'](handleEntityNotFound(_0x2eb217,null))[_0x4326('0x2c')](respondWithResult(_0x2eb217,null))[_0x4326('0x4a')](handleError(_0x2eb217,null));};exports['create']=function(_0x234f18,_0xc40b79){return db[_0x4326('0x32')][_0x4326('0x4f')](_0x234f18['body'],{})[_0x4326('0x2c')](respondWithResult(_0xc40b79,0xc9))['catch'](handleError(_0xc40b79,null));};exports[_0x4326('0x2b')]=function(_0x40ec02,_0x48c7ce){if(_0x40ec02[_0x4326('0x50')]['id']){delete _0x40ec02['body']['id'];}return db[_0x4326('0x32')][_0x4326('0x4e')]({'where':{'id':_0x40ec02['params']['id']}})[_0x4326('0x2c')](handleEntityNotFound(_0x48c7ce,null))['then'](saveUpdates(_0x40ec02[_0x4326('0x50')],null))[_0x4326('0x2c')](respondWithResult(_0x48c7ce,null))[_0x4326('0x4a')](handleError(_0x48c7ce,null));};exports[_0x4326('0x2d')]=function(_0x299cb6,_0xbec6c0){return db['DeskConfiguration']['find']({'where':{'id':_0x299cb6['params']['id']}})[_0x4326('0x2c')](handleEntityNotFound(_0xbec6c0,null))[_0x4326('0x2c')](removeEntity(_0xbec6c0,null))[_0x4326('0x4a')](handleError(_0xbec6c0,null));};exports[_0x4326('0x51')]=function(_0x496c4b,_0xc58e1e,_0x49309a){var _0x1cb0a5={};var _0x38fe90={};var _0x2a3c84;var _0xddd890;return db[_0x4326('0x32')][_0x4326('0x52')]({'where':{'id':_0x496c4b[_0x4326('0x4c')]['id']}})[_0x4326('0x2c')](handleEntityNotFound(_0xc58e1e,null))[_0x4326('0x2c')](function(_0x47e1d1){if(_0x47e1d1){_0x2a3c84=_0x47e1d1;_0x38fe90[_0x4326('0x37')]=_[_0x4326('0x33')](db[_0x4326('0x53')][_0x4326('0x54')]);_0x38fe90[_0x4326('0x34')]=_['keys'](_0x496c4b[_0x4326('0x34')]);_0x38fe90[_0x4326('0x35')]=_[_0x4326('0x36')](_0x38fe90['model'],_0x38fe90[_0x4326('0x34')]);_0x1cb0a5[_0x4326('0x38')]=_[_0x4326('0x36')](_0x38fe90[_0x4326('0x37')],qs[_0x4326('0x39')](_0x496c4b[_0x4326('0x34')]['fields']));_0x1cb0a5[_0x4326('0x38')]=_0x1cb0a5['attributes'][_0x4326('0x3a')]?_0x1cb0a5['attributes']:_0x38fe90[_0x4326('0x37')];_0x1cb0a5[_0x4326('0x3d')]=qs[_0x4326('0x3e')](_0x496c4b[_0x4326('0x34')][_0x4326('0x3e')]);_0x1cb0a5[_0x4326('0x40')]=qs[_0x4326('0x35')](_[_0x4326('0x3f')](_0x496c4b['query'],_0x38fe90[_0x4326('0x35')]));if(_0x496c4b['query']['filter']){_0x1cb0a5[_0x4326('0x40')]=_[_0x4326('0x41')](_0x1cb0a5[_0x4326('0x40')],{'$or':_[_0x4326('0x55')](_0x1cb0a5[_0x4326('0x38')],function(_0x25c717){var _0x22beeb={};_0x22beeb[_0x25c717]={'$like':'%'+_0x496c4b['query'][_0x4326('0x46')]+'%'};return _0x22beeb;})});}_0x1cb0a5=_[_0x4326('0x41')]({},_0x1cb0a5,_0x496c4b[_0x4326('0x47')]);return _0x2a3c84[_0x4326('0x51')](_0x1cb0a5);}})[_0x4326('0x2c')](function(_0x40e166){if(_0x40e166){_0xddd890=_0x40e166['length'];if(!_0x496c4b[_0x4326('0x34')]['hasOwnProperty'](_0x4326('0x3c'))){_0x1cb0a5['limit']=qs[_0x4326('0x25')](_0x496c4b[_0x4326('0x34')][_0x4326('0x25')]);_0x1cb0a5[_0x4326('0x24')]=qs['offset'](_0x496c4b['query']['offset']);}return _0x2a3c84['getFields'](_0x1cb0a5);}})['then'](function(_0x3a6db8){if(_0x3a6db8){return _0x3a6db8?{'count':_0xddd890,'rows':_0x3a6db8}:null;}})['then'](respondWithResult(_0xc58e1e,null))[_0x4326('0x4a')](handleError(_0xc58e1e,null));};exports['getSubjects']=function(_0x4a244b,_0x3dbd43,_0x33cb70){var _0x2871dd={};var _0x5e7216={};var _0xf1f5a1;var _0x11bad4;return db[_0x4326('0x32')][_0x4326('0x52')]({'where':{'id':_0x4a244b[_0x4326('0x4c')]['id']}})[_0x4326('0x2c')](handleEntityNotFound(_0x3dbd43,null))[_0x4326('0x2c')](function(_0x31c3ba){if(_0x31c3ba){_0xf1f5a1=_0x31c3ba;_0x5e7216['model']=_['keys'](db[_0x4326('0x53')][_0x4326('0x54')]);_0x5e7216[_0x4326('0x34')]=_[_0x4326('0x33')](_0x4a244b[_0x4326('0x34')]);_0x5e7216[_0x4326('0x35')]=_[_0x4326('0x36')](_0x5e7216['model'],_0x5e7216[_0x4326('0x34')]);_0x2871dd['attributes']=_[_0x4326('0x36')](_0x5e7216['model'],qs[_0x4326('0x39')](_0x4a244b[_0x4326('0x34')][_0x4326('0x39')]));_0x2871dd['attributes']=_0x2871dd[_0x4326('0x38')][_0x4326('0x3a')]?_0x2871dd[_0x4326('0x38')]:_0x5e7216['model'];_0x2871dd['order']=qs[_0x4326('0x3e')](_0x4a244b[_0x4326('0x34')][_0x4326('0x3e')]);_0x2871dd[_0x4326('0x40')]=qs[_0x4326('0x35')](_[_0x4326('0x3f')](_0x4a244b[_0x4326('0x34')],_0x5e7216[_0x4326('0x35')]));if(_0x4a244b[_0x4326('0x34')]['filter']){_0x2871dd['where']=_['merge'](_0x2871dd[_0x4326('0x40')],{'$or':_['map'](_0x2871dd[_0x4326('0x38')],function(_0x1cf588){var _0x401313={};_0x401313[_0x1cf588]={'$like':'%'+_0x4a244b[_0x4326('0x34')][_0x4326('0x46')]+'%'};return _0x401313;})});}_0x2871dd=_[_0x4326('0x41')]({},_0x2871dd,_0x4a244b['options']);return _0xf1f5a1[_0x4326('0x56')](_0x2871dd);}})[_0x4326('0x2c')](function(_0x277db2){if(_0x277db2){_0x11bad4=_0x277db2[_0x4326('0x3a')];if(!_0x4a244b['query'][_0x4326('0x3b')](_0x4326('0x3c'))){_0x2871dd[_0x4326('0x25')]=qs[_0x4326('0x25')](_0x4a244b[_0x4326('0x34')][_0x4326('0x25')]);_0x2871dd[_0x4326('0x24')]=qs[_0x4326('0x24')](_0x4a244b[_0x4326('0x34')]['offset']);}return _0xf1f5a1[_0x4326('0x56')](_0x2871dd);}})[_0x4326('0x2c')](function(_0x5c6235){if(_0x5c6235){return _0x5c6235?{'count':_0x11bad4,'rows':_0x5c6235}:null;}})[_0x4326('0x2c')](respondWithResult(_0x3dbd43,null))[_0x4326('0x4a')](handleError(_0x3dbd43,null));};exports[_0x4326('0x57')]=function(_0x4b8cd3,_0x490060,_0x5313ce){var _0x5cdb3e={};var _0x5ba351={};var _0x17d2d3;var _0x20178a;return db['DeskConfiguration']['findOne']({'where':{'id':_0x4b8cd3[_0x4326('0x4c')]['id']}})[_0x4326('0x2c')](handleEntityNotFound(_0x490060,null))[_0x4326('0x2c')](function(_0x329ab4){if(_0x329ab4){_0x17d2d3=_0x329ab4;_0x5ba351[_0x4326('0x37')]=_[_0x4326('0x33')](db[_0x4326('0x53')][_0x4326('0x54')]);_0x5ba351[_0x4326('0x34')]=_[_0x4326('0x33')](_0x4b8cd3['query']);_0x5ba351[_0x4326('0x35')]=_[_0x4326('0x36')](_0x5ba351[_0x4326('0x37')],_0x5ba351[_0x4326('0x34')]);_0x5cdb3e[_0x4326('0x38')]=_[_0x4326('0x36')](_0x5ba351['model'],qs[_0x4326('0x39')](_0x4b8cd3[_0x4326('0x34')]['fields']));_0x5cdb3e[_0x4326('0x38')]=_0x5cdb3e['attributes'][_0x4326('0x3a')]?_0x5cdb3e[_0x4326('0x38')]:_0x5ba351[_0x4326('0x37')];_0x5cdb3e[_0x4326('0x3d')]=qs[_0x4326('0x3e')](_0x4b8cd3[_0x4326('0x34')][_0x4326('0x3e')]);_0x5cdb3e[_0x4326('0x40')]=qs[_0x4326('0x35')](_[_0x4326('0x3f')](_0x4b8cd3[_0x4326('0x34')],_0x5ba351[_0x4326('0x35')]));if(_0x4b8cd3[_0x4326('0x34')][_0x4326('0x46')]){_0x5cdb3e['where']=_[_0x4326('0x41')](_0x5cdb3e['where'],{'$or':_[_0x4326('0x55')](_0x5cdb3e[_0x4326('0x38')],function(_0x48d777){var _0x3f8395={};_0x3f8395[_0x48d777]={'$like':'%'+_0x4b8cd3['query'][_0x4326('0x46')]+'%'};return _0x3f8395;})});}_0x5cdb3e=_[_0x4326('0x41')]({},_0x5cdb3e,_0x4b8cd3['options']);return _0x17d2d3[_0x4326('0x57')](_0x5cdb3e);}})['then'](function(_0x4ed752){if(_0x4ed752){_0x20178a=_0x4ed752[_0x4326('0x3a')];if(!_0x4b8cd3[_0x4326('0x34')]['hasOwnProperty']('nolimit')){_0x5cdb3e[_0x4326('0x25')]=qs[_0x4326('0x25')](_0x4b8cd3[_0x4326('0x34')][_0x4326('0x25')]);_0x5cdb3e[_0x4326('0x24')]=qs[_0x4326('0x24')](_0x4b8cd3[_0x4326('0x34')][_0x4326('0x24')]);}return _0x17d2d3[_0x4326('0x57')](_0x5cdb3e);}})[_0x4326('0x2c')](function(_0x447831){if(_0x447831){return _0x447831?{'count':_0x20178a,'rows':_0x447831}:null;}})['then'](respondWithResult(_0x490060,null))[_0x4326('0x4a')](handleError(_0x490060,null));};exports[_0x4326('0x58')]=function(_0x529c19,_0x1a1e31,_0x2d96f0){var _0x806fcd={};var _0x2e8b42={};var _0x430ea4;var _0x3460b1;return db['DeskConfiguration'][_0x4326('0x52')]({'where':{'id':_0x529c19[_0x4326('0x4c')]['id']}})[_0x4326('0x2c')](handleEntityNotFound(_0x1a1e31,null))[_0x4326('0x2c')](function(_0x11b2b7){if(_0x11b2b7){_0x430ea4=_0x11b2b7;_0x2e8b42[_0x4326('0x37')]=_['keys'](db['Tag'][_0x4326('0x54')]);_0x2e8b42[_0x4326('0x34')]=_['keys'](_0x529c19[_0x4326('0x34')]);_0x2e8b42[_0x4326('0x35')]=_[_0x4326('0x36')](_0x2e8b42[_0x4326('0x37')],_0x2e8b42[_0x4326('0x34')]);_0x806fcd['attributes']=_[_0x4326('0x36')](_0x2e8b42[_0x4326('0x37')],qs[_0x4326('0x39')](_0x529c19['query']['fields']));_0x806fcd[_0x4326('0x38')]=_0x806fcd[_0x4326('0x38')][_0x4326('0x3a')]?_0x806fcd['attributes']:_0x2e8b42['model'];_0x806fcd[_0x4326('0x3d')]=qs[_0x4326('0x3e')](_0x529c19['query'][_0x4326('0x3e')]);_0x806fcd[_0x4326('0x40')]=qs[_0x4326('0x35')](_['pick'](_0x529c19[_0x4326('0x34')],_0x2e8b42['filters']));if(_0x529c19['query'][_0x4326('0x46')]){_0x806fcd[_0x4326('0x40')]=_['merge'](_0x806fcd[_0x4326('0x40')],{'$or':_[_0x4326('0x55')](_0x806fcd[_0x4326('0x38')],function(_0x17fcd1){var _0x2b8177={};_0x2b8177[_0x17fcd1]={'$like':'%'+_0x529c19['query'][_0x4326('0x46')]+'%'};return _0x2b8177;})});}_0x806fcd=_['merge']({},_0x806fcd,_0x529c19[_0x4326('0x47')]);return _0x430ea4['getTags'](_0x806fcd);}})[_0x4326('0x2c')](function(_0x536cbc){if(_0x536cbc){_0x3460b1=_0x536cbc['length'];if(!_0x529c19['query'][_0x4326('0x3b')]('nolimit')){_0x806fcd[_0x4326('0x25')]=qs['limit'](_0x529c19['query']['limit']);_0x806fcd[_0x4326('0x24')]=qs['offset'](_0x529c19[_0x4326('0x34')]['offset']);}return _0x430ea4[_0x4326('0x58')](_0x806fcd);}})['then'](function(_0x4d664a){if(_0x4d664a){return _0x4d664a?{'count':_0x3460b1,'rows':_0x4d664a}:null;}})[_0x4326('0x2c')](respondWithResult(_0x1a1e31,null))[_0x4326('0x4a')](handleError(_0x1a1e31,null));};exports['setTags']=function(_0x45fa35,_0x5d5e0f,_0x3b034b){if(_0x45fa35['body']['id']){delete _0x45fa35[_0x4326('0x50')]['id'];}return db[_0x4326('0x32')]['findOne']({'where':{'id':_0x45fa35[_0x4326('0x4c')]['id']}})[_0x4326('0x2c')](handleEntityNotFound(_0x5d5e0f,null))[_0x4326('0x2c')](function(_0x59e3a2){if(_0x59e3a2){return _0x59e3a2[_0x4326('0x59')](_0x45fa35[_0x4326('0x50')][_0x4326('0x5a')]||[]);}return null;})['then'](respondWithResult(_0x5d5e0f,null))[_0x4326('0x4a')](handleError(_0x5d5e0f,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index bac007a..3bbda2c 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.model.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bfa=['../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x53367c,_0x1de363){var _0x2d0555=function(_0x5346b9){while(--_0x5346b9){_0x53367c['push'](_0x53367c['shift']());}};_0x2d0555(++_0x1de363);}(_0x7bfa,0x1f0));var _0xa7bf=function(_0x45afc1,_0x52a029){_0x45afc1=_0x45afc1-0x0;var _0x182539=_0x7bfa[_0x45afc1];return _0x182539;};'use strict';var _=require(_0xa7bf('0x0'));var util=require(_0xa7bf('0x1'));var logger=require('../../config/logger')(_0xa7bf('0x2'));var moment=require(_0xa7bf('0x3'));var BPromise=require(_0xa7bf('0x4'));var rp=require(_0xa7bf('0x5'));var fs=require('fs');var path=require(_0xa7bf('0x6'));var rimraf=require(_0xa7bf('0x7'));var config=require(_0xa7bf('0x8'));var attributes=require(_0xa7bf('0x9'));module[_0xa7bf('0xa')]=function(_0x3e78e2,_0x313545){return _0x3e78e2[_0xa7bf('0xb')](_0xa7bf('0xc'),attributes,{'tableName':_0xa7bf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x377a=['../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','util','../../config/logger','api','moment','request-promise'];(function(_0xb8d3a7,_0x37fc48){var _0x48abbc=function(_0x4a9cbf){while(--_0x4a9cbf){_0xb8d3a7['push'](_0xb8d3a7['shift']());}};_0x48abbc(++_0x37fc48);}(_0x377a,0x109));var _0xa377=function(_0x48cac2,_0x483396){_0x48cac2=_0x48cac2-0x0;var _0xd2a59e=_0x377a[_0x48cac2];return _0xd2a59e;};'use strict';var _=require('lodash');var util=require(_0xa377('0x0'));var logger=require(_0xa377('0x1'))(_0xa377('0x2'));var moment=require(_0xa377('0x3'));var BPromise=require('bluebird');var rp=require(_0xa377('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa377('0x5'));var attributes=require(_0xa377('0x6'));module[_0xa377('0x7')]=function(_0x38dac3,_0x19d9d5){return _0x38dac3[_0xa377('0x8')](_0xa377('0x9'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 85b0230..7a5abab 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x894f=['jayson/promise','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x2e280a,_0x3075fd){var _0x2fe79e=function(_0x458823){while(--_0x458823){_0x2e280a['push'](_0x2e280a['shift']());}};_0x2fe79e(++_0x3075fd);}(_0x894f,0x14d));var _0xf894=function(_0x31e682,_0xc1aa61){_0x31e682=_0x31e682-0x0;var _0x238430=_0x894f[_0x31e682];return _0x238430;};'use strict';var _=require(_0xf894('0x0'));var util=require(_0xf894('0x1'));var moment=require(_0xf894('0x2'));var BPromise=require(_0xf894('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf894('0x4'))['db'];var utils=require(_0xf894('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf894('0x6'));var jayson=require(_0xf894('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23a9fc,_0x371f86,_0x56d9d6){return new BPromise(function(_0x190cb1,_0x3d8f21){return client[_0xf894('0x8')](_0x23a9fc,_0x56d9d6)[_0xf894('0x9')](function(_0x10bb84){logger[_0xf894('0xa')](_0xf894('0xb'),_0x371f86,_0xf894('0xc'));logger[_0xf894('0xd')](_0xf894('0xe'),_0x371f86,_0xf894('0xc'),JSON[_0xf894('0xf')](_0x10bb84));if(_0x10bb84[_0xf894('0x10')]){if(_0x10bb84[_0xf894('0x10')][_0xf894('0x11')]===0x1f4){logger[_0xf894('0x10')](_0xf894('0xb'),_0x371f86,_0x10bb84[_0xf894('0x10')][_0xf894('0x12')]);return _0x3d8f21(_0x10bb84[_0xf894('0x10')][_0xf894('0x12')]);}logger[_0xf894('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x371f86,_0x10bb84[_0xf894('0x10')]['message']);return _0x190cb1(_0x10bb84['error'][_0xf894('0x12')]);}else{logger[_0xf894('0xa')](_0xf894('0xb'),_0x371f86,_0xf894('0xc'));_0x190cb1(_0x10bb84[_0xf894('0x13')]['message']);}})['catch'](function(_0x1865be){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x371f86,_0x1865be);_0x3d8f21(_0x1865be);});});} \ No newline at end of file +var _0x0624=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x350819,_0x41e2c6){var _0x3aedfc=function(_0xb5acfe){while(--_0xb5acfe){_0x350819['push'](_0x350819['shift']());}};_0x3aedfc(++_0x41e2c6);}(_0x0624,0x132));var _0x4062=function(_0x105ce7,_0x233a97){_0x105ce7=_0x105ce7-0x0;var _0x41f14f=_0x0624[_0x105ce7];return _0x41f14f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4062('0x0'));var fs=require('fs');var Redis=require(_0x4062('0x1'));var db=require(_0x4062('0x2'))['db'];var utils=require(_0x4062('0x3'));var logger=require(_0x4062('0x4'))(_0x4062('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4062('0x6')][_0x4062('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f4928,_0xdff88c,_0x27794b){return new BPromise(function(_0x5d19e8,_0x75ce4e){return client['request'](_0x2f4928,_0x27794b)[_0x4062('0x8')](function(_0x35663b){logger[_0x4062('0x9')](_0x4062('0xa'),_0xdff88c,_0x4062('0xb'));logger[_0x4062('0xc')](_0x4062('0xd'),_0xdff88c,'request\x20sent',JSON[_0x4062('0xe')](_0x35663b));if(_0x35663b['error']){if(_0x35663b[_0x4062('0xf')][_0x4062('0x10')]===0x1f4){logger[_0x4062('0xf')](_0x4062('0xa'),_0xdff88c,_0x35663b[_0x4062('0xf')]['message']);return _0x75ce4e(_0x35663b[_0x4062('0xf')][_0x4062('0x11')]);}logger['error'](_0x4062('0xa'),_0xdff88c,_0x35663b[_0x4062('0xf')][_0x4062('0x11')]);return _0x5d19e8(_0x35663b['error']['message']);}else{logger[_0x4062('0x9')](_0x4062('0xa'),_0xdff88c,'request\x20sent');_0x5d19e8(_0x35663b['result']['message']);}})['catch'](function(_0x437432){logger['error'](_0x4062('0xa'),_0xdff88c,_0x437432);_0x75ce4e(_0x437432);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 51bef24..f227d6d 100644 --- a/server/api/intDeskField/index.js +++ b/server/api/intDeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa476=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','show','create','put','/:id'];(function(_0x2bfc42,_0x5a9e74){var _0x1630ef=function(_0xb82db3){while(--_0xb82db3){_0x2bfc42['push'](_0x2bfc42['shift']());}};_0x1630ef(++_0x5a9e74);}(_0xa476,0x1ea));var _0x6a47=function(_0x51cfa8,_0x42b02e){_0x51cfa8=_0x51cfa8-0x0;var _0x699a2f=_0xa476[_0x51cfa8];return _0x699a2f;};'use strict';var multer=require('multer');var util=require(_0x6a47('0x0'));var path=require(_0x6a47('0x1'));var timeout=require(_0x6a47('0x2'));var express=require(_0x6a47('0x3'));var router=express[_0x6a47('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6a47('0x5'));var config=require(_0x6a47('0x6'));var controller=require(_0x6a47('0x7'));router['get']('/',auth[_0x6a47('0x8')](),controller[_0x6a47('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6a47('0xa')]);router['post']('/',auth[_0x6a47('0x8')](),controller[_0x6a47('0xb')]);router[_0x6a47('0xc')](_0x6a47('0xd'),auth['isAuthenticated'](),controller[_0x6a47('0xe')]);router[_0x6a47('0xf')](_0x6a47('0xd'),auth['isAuthenticated'](),controller[_0x6a47('0x10')]);module[_0x6a47('0x11')]=router; \ No newline at end of file +var _0xd641=['/:id','show','post','create','delete','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get'];(function(_0x1553b5,_0x16d21c){var _0x215af2=function(_0x175243){while(--_0x175243){_0x1553b5['push'](_0x1553b5['shift']());}};_0x215af2(++_0x16d21c);}(_0xd641,0x18e));var _0x1d64=function(_0x30a616,_0x180454){_0x30a616=_0x30a616-0x0;var _0x16182d=_0xd641[_0x30a616];return _0x16182d;};'use strict';var multer=require(_0x1d64('0x0'));var util=require(_0x1d64('0x1'));var path=require(_0x1d64('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x1d64('0x3'));var interaction=require(_0x1d64('0x4'));var config=require(_0x1d64('0x5'));var controller=require(_0x1d64('0x6'));router['get']('/',auth[_0x1d64('0x7')](),controller[_0x1d64('0x8')]);router[_0x1d64('0x9')](_0x1d64('0xa'),auth[_0x1d64('0x7')](),controller[_0x1d64('0xb')]);router[_0x1d64('0xc')]('/',auth[_0x1d64('0x7')](),controller[_0x1d64('0xd')]);router['put']('/:id',auth[_0x1d64('0x7')](),controller['update']);router[_0x1d64('0xe')](_0x1d64('0xa'),auth[_0x1d64('0x7')](),controller[_0x1d64('0xf')]);module[_0x1d64('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 574df5b..4516bcc 100644 --- a/server/api/intDeskField/intDeskField.attributes.js +++ b/server/api/intDeskField/intDeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x411c=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0xed8b97,_0x42deb2){var _0x48ab0d=function(_0x30f5cc){while(--_0x30f5cc){_0xed8b97['push'](_0xed8b97['shift']());}};_0x48ab0d(++_0x42deb2);}(_0x411c,0x119));var _0xc411=function(_0x33a00e,_0x224a26){_0x33a00e=_0x33a00e-0x0;var _0x1252aa=_0x411c[_0x33a00e];return _0x1252aa;};'use strict';var Sequelize=require(_0xc411('0x0'));module['exports']={'type':{'type':Sequelize[_0xc411('0x1')](_0xc411('0x2'),_0xc411('0x3'),_0xc411('0x4'),_0xc411('0x5')),'defaultValue':_0xc411('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc411('0x6')]},'keyType':{'type':Sequelize[_0xc411('0x1')](_0xc411('0x2'),'variable',_0xc411('0x4'))},'keyContent':{'type':Sequelize[_0xc411('0x6')]},'idField':{'type':Sequelize[_0xc411('0x6')]},'nameField':{'type':Sequelize[_0xc411('0x6')]},'customField':{'type':Sequelize[_0xc411('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc411('0x6')]}}; \ No newline at end of file +var _0x4772=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x3a8545,_0x543f43){var _0x38dba1=function(_0x2373ff){while(--_0x2373ff){_0x3a8545['push'](_0x3a8545['shift']());}};_0x38dba1(++_0x543f43);}(_0x4772,0x106));var _0x2477=function(_0x4a7515,_0x357992){_0x4a7515=_0x4a7515-0x0;var _0x1ee2e7=_0x4772[_0x4a7515];return _0x1ee2e7;};'use strict';var Sequelize=require(_0x2477('0x0'));module[_0x2477('0x1')]={'type':{'type':Sequelize[_0x2477('0x2')](_0x2477('0x3'),_0x2477('0x4'),_0x2477('0x5'),_0x2477('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2477('0x7')]},'key':{'type':Sequelize[_0x2477('0x7')]},'keyType':{'type':Sequelize[_0x2477('0x2')](_0x2477('0x3'),_0x2477('0x4'),_0x2477('0x5'))},'keyContent':{'type':Sequelize[_0x2477('0x7')]},'idField':{'type':Sequelize[_0x2477('0x7')]},'nameField':{'type':Sequelize[_0x2477('0x7')]},'customField':{'type':Sequelize[_0x2477('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2477('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index b61d5a9..15d884e 100644 --- a/server/api/intDeskField/intDeskField.controller.js +++ b/server/api/intDeskField/intDeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf10=['show','params','rawAttributes','intersection','include','options','find','create','body','update','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','DeskField','keys','filters','model','query','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','includeAll','rows','catch'];(function(_0x23d624,_0x13bec1){var _0x35949c=function(_0x1b548d){while(--_0x1b548d){_0x23d624['push'](_0x23d624['shift']());}};_0x35949c(++_0x13bec1);}(_0xbf10,0x136));var _0x0bf1=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xbf10[_0x4fc9e6];return _0x551d28;};'use strict';var pdf=require(_0x0bf1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0bf1('0x1'));var jsonpatch=require(_0x0bf1('0x2'));var rp=require(_0x0bf1('0x3'));var moment=require(_0x0bf1('0x4'));var BPromise=require(_0x0bf1('0x5'));var Mustache=require(_0x0bf1('0x6'));var util=require(_0x0bf1('0x7'));var path=require(_0x0bf1('0x8'));var sox=require(_0x0bf1('0x9'));var csv=require(_0x0bf1('0xa'));var ejs=require(_0x0bf1('0xb'));var fs=require('fs');var _=require(_0x0bf1('0xc'));var squel=require(_0x0bf1('0xd'));var crypto=require('crypto');var jsforce=require(_0x0bf1('0xe'));var deskjs=require(_0x0bf1('0xf'));var toCsv=require(_0x0bf1('0xa'));var querystring=require(_0x0bf1('0x10'));var Papa=require(_0x0bf1('0x11'));var Redis=require(_0x0bf1('0x12'));var authService=require(_0x0bf1('0x13'));var qs=require(_0x0bf1('0x14'));var hardwareService=require(_0x0bf1('0x15'));var logger=require('../../config/logger')(_0x0bf1('0x16'));var utils=require(_0x0bf1('0x17'));var config=require(_0x0bf1('0x18'));var db=require(_0x0bf1('0x19'))['db'];function respondWithStatusCode(_0x30cb03,_0x51d471){_0x51d471=_0x51d471||0xcc;return function(_0x20fe78){if(_0x20fe78){return _0x30cb03[_0x0bf1('0x1a')](_0x51d471);}return _0x30cb03[_0x0bf1('0x1b')](_0x51d471)[_0x0bf1('0x1c')]();};}function respondWithResult(_0x5e0d3d,_0x2ac354){_0x2ac354=_0x2ac354||0xc8;return function(_0x2f3ec0){if(_0x2f3ec0){return _0x5e0d3d['status'](_0x2ac354)[_0x0bf1('0x1d')](_0x2f3ec0);}};}function respondWithFilteredResult(_0x3d3225,_0x331b3f){return function(_0x54cc58){if(_0x54cc58){var _0x4aeb3b=_0x54cc58[_0x0bf1('0x1e')],_0x7a3e57=_0x331b3f['offset'],_0x608ebf=_0x331b3f[_0x0bf1('0x1f')]+_0x331b3f[_0x0bf1('0x20')],_0x291cf9;if(_0x608ebf>=_0x4aeb3b){_0x608ebf=_0x4aeb3b;_0x291cf9=0xc8;}else{_0x291cf9=0xce;}_0x3d3225[_0x0bf1('0x1b')](_0x291cf9);return _0x3d3225[_0x0bf1('0x21')](_0x0bf1('0x22'),_0x7a3e57+'-'+_0x608ebf+'/'+_0x4aeb3b)[_0x0bf1('0x1d')](_0x54cc58);}return null;};}function patchUpdates(_0x52da69){return function(_0x590173){try{jsonpatch[_0x0bf1('0x23')](_0x590173,_0x52da69,!![]);}catch(_0x517e87){return BPromise[_0x0bf1('0x24')](_0x517e87);}return _0x590173[_0x0bf1('0x25')]();};}function saveUpdates(_0x27375b,_0x836a9b){return function(_0xea86c6){if(_0xea86c6){return _0xea86c6['update'](_0x27375b)[_0x0bf1('0x26')](function(_0x1ebffd){return _0x1ebffd;});}return null;};}function removeEntity(_0x52b5f4,_0x566e94){return function(_0x23f14c){if(_0x23f14c){return _0x23f14c[_0x0bf1('0x27')]()[_0x0bf1('0x26')](function(){_0x52b5f4[_0x0bf1('0x1b')](0xcc)[_0x0bf1('0x1c')]();});}};}function handleEntityNotFound(_0x8a102e,_0x558fb6){return function(_0x3f1e34){if(!_0x3f1e34){_0x8a102e[_0x0bf1('0x1a')](0x194);}return _0x3f1e34;};}function handleError(_0x49deb9,_0x426c27){_0x426c27=_0x426c27||0x1f4;return function(_0x109ca5){logger[_0x0bf1('0x28')](_0x109ca5[_0x0bf1('0x29')]);if(_0x109ca5[_0x0bf1('0x2a')]){delete _0x109ca5[_0x0bf1('0x2a')];}_0x49deb9[_0x0bf1('0x1b')](_0x426c27)[_0x0bf1('0x2b')](_0x109ca5);};}exports[_0x0bf1('0x2c')]=function(_0x180f84,_0x24a7ad){var _0x38c54d={},_0x53f8aa={},_0x392220={'count':0x0,'rows':[]};var _0xfbcbb3=db[_0x0bf1('0x2d')]['rawAttributes'];_0x53f8aa['model']=_[_0x0bf1('0x2e')](_0xfbcbb3);_0x53f8aa['query']=_['keys'](_0x180f84['query']);_0x53f8aa[_0x0bf1('0x2f')]=_['intersection'](_0x53f8aa[_0x0bf1('0x30')],_0x53f8aa[_0x0bf1('0x31')]);_0x38c54d[_0x0bf1('0x32')]=_['intersection'](_0x53f8aa[_0x0bf1('0x30')],qs['fields'](_0x180f84['query'][_0x0bf1('0x33')]));_0x38c54d['attributes']=_0x38c54d[_0x0bf1('0x32')][_0x0bf1('0x34')]?_0x38c54d[_0x0bf1('0x32')]:_0x53f8aa[_0x0bf1('0x30')];if(!_0x180f84['query']['hasOwnProperty'](_0x0bf1('0x35'))){_0x38c54d[_0x0bf1('0x20')]=qs[_0x0bf1('0x20')](_0x180f84[_0x0bf1('0x31')]['limit']);_0x38c54d[_0x0bf1('0x1f')]=qs[_0x0bf1('0x1f')](_0x180f84[_0x0bf1('0x31')]['offset']);}_0x38c54d['order']=qs[_0x0bf1('0x36')](_0x180f84[_0x0bf1('0x31')][_0x0bf1('0x36')]);_0x38c54d[_0x0bf1('0x37')]=qs['filters'](_[_0x0bf1('0x38')](_0x180f84[_0x0bf1('0x31')],_0x53f8aa[_0x0bf1('0x2f')]));if(_0x180f84['query'][_0x0bf1('0x39')]){_0x38c54d['where']=_[_0x0bf1('0x3a')](_0x38c54d[_0x0bf1('0x37')],{'$or':_['map'](_0xfbcbb3,function(_0x5534b8){if(_0x5534b8[_0x0bf1('0x3b')][_0x0bf1('0x3c')]!==_0x0bf1('0x3d')){var _0x46c04e={};_0x46c04e[_0x5534b8['field']]={'$like':'%'+_0x180f84[_0x0bf1('0x31')][_0x0bf1('0x39')]+'%'};return _0x46c04e;}})});}_0x38c54d=_[_0x0bf1('0x3a')]({},_0x38c54d,_0x180f84['options']);var _0x1d0571={'where':_0x38c54d[_0x0bf1('0x37')]};return db[_0x0bf1('0x2d')][_0x0bf1('0x1e')](_0x1d0571)['then'](function(_0x13db8b){_0x392220['count']=_0x13db8b;if(_0x180f84['query'][_0x0bf1('0x3e')]){_0x38c54d['include']=[{'all':!![]}];}return db['DeskField']['findAll'](_0x38c54d);})[_0x0bf1('0x26')](function(_0x44fc00){_0x392220[_0x0bf1('0x3f')]=_0x44fc00;return _0x392220;})[_0x0bf1('0x26')](respondWithFilteredResult(_0x24a7ad,_0x38c54d))[_0x0bf1('0x40')](handleError(_0x24a7ad,null));};exports[_0x0bf1('0x41')]=function(_0x565f50,_0xcd049c){var _0x26c9d2={'raw':!![],'where':{'id':_0x565f50[_0x0bf1('0x42')]['id']}},_0x4ecfea={};_0x4ecfea[_0x0bf1('0x30')]=_['keys'](db['DeskField'][_0x0bf1('0x43')]);_0x4ecfea[_0x0bf1('0x31')]=_[_0x0bf1('0x2e')](_0x565f50[_0x0bf1('0x31')]);_0x4ecfea[_0x0bf1('0x2f')]=_[_0x0bf1('0x44')](_0x4ecfea['model'],_0x4ecfea[_0x0bf1('0x31')]);_0x26c9d2[_0x0bf1('0x32')]=_[_0x0bf1('0x44')](_0x4ecfea[_0x0bf1('0x30')],qs[_0x0bf1('0x33')](_0x565f50[_0x0bf1('0x31')][_0x0bf1('0x33')]));_0x26c9d2[_0x0bf1('0x32')]=_0x26c9d2[_0x0bf1('0x32')]['length']?_0x26c9d2[_0x0bf1('0x32')]:_0x4ecfea[_0x0bf1('0x30')];if(_0x565f50['query'][_0x0bf1('0x3e')]){_0x26c9d2[_0x0bf1('0x45')]=[{'all':!![]}];}_0x26c9d2=_['merge']({},_0x26c9d2,_0x565f50[_0x0bf1('0x46')]);return db[_0x0bf1('0x2d')][_0x0bf1('0x47')](_0x26c9d2)[_0x0bf1('0x26')](handleEntityNotFound(_0xcd049c,null))['then'](respondWithResult(_0xcd049c,null))['catch'](handleError(_0xcd049c,null));};exports[_0x0bf1('0x48')]=function(_0x19571d,_0x5ba27b){return db[_0x0bf1('0x2d')][_0x0bf1('0x48')](_0x19571d[_0x0bf1('0x49')],{})[_0x0bf1('0x26')](respondWithResult(_0x5ba27b,0xc9))[_0x0bf1('0x40')](handleError(_0x5ba27b,null));};exports[_0x0bf1('0x4a')]=function(_0x11301d,_0x5b2e75){if(_0x11301d['body']['id']){delete _0x11301d[_0x0bf1('0x49')]['id'];}return db[_0x0bf1('0x2d')][_0x0bf1('0x47')]({'where':{'id':_0x11301d[_0x0bf1('0x42')]['id']}})[_0x0bf1('0x26')](handleEntityNotFound(_0x5b2e75,null))[_0x0bf1('0x26')](saveUpdates(_0x11301d[_0x0bf1('0x49')],null))['then'](respondWithResult(_0x5b2e75,null))['catch'](handleError(_0x5b2e75,null));};exports[_0x0bf1('0x27')]=function(_0x174726,_0x57981e){return db[_0x0bf1('0x2d')][_0x0bf1('0x47')]({'where':{'id':_0x174726[_0x0bf1('0x42')]['id']}})['then'](handleEntityNotFound(_0x57981e,null))[_0x0bf1('0x26')](removeEntity(_0x57981e,null))[_0x0bf1('0x40')](handleError(_0x57981e,null));}; \ No newline at end of file +var _0x94f0=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','options','DeskField','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel'];(function(_0x58d478,_0x3cca8f){var _0x441ad3=function(_0x186189){while(--_0x186189){_0x58d478['push'](_0x58d478['shift']());}};_0x441ad3(++_0x3cca8f);}(_0x94f0,0x1b4));var _0x094f=function(_0x46f4aa,_0x3086e6){_0x46f4aa=_0x46f4aa-0x0;var _0x197c3a=_0x94f0[_0x46f4aa];return _0x197c3a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x094f('0x0'));var rimraf=require(_0x094f('0x1'));var zipdir=require(_0x094f('0x2'));var jsonpatch=require(_0x094f('0x3'));var rp=require(_0x094f('0x4'));var moment=require(_0x094f('0x5'));var BPromise=require(_0x094f('0x6'));var Mustache=require(_0x094f('0x7'));var util=require(_0x094f('0x8'));var path=require(_0x094f('0x9'));var sox=require(_0x094f('0xa'));var csv=require(_0x094f('0xb'));var ejs=require(_0x094f('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x094f('0xd'));var crypto=require(_0x094f('0xe'));var jsforce=require(_0x094f('0xf'));var deskjs=require(_0x094f('0x10'));var toCsv=require(_0x094f('0xb'));var querystring=require(_0x094f('0x11'));var Papa=require(_0x094f('0x12'));var Redis=require(_0x094f('0x13'));var authService=require(_0x094f('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x094f('0x15'));var logger=require(_0x094f('0x16'))(_0x094f('0x17'));var utils=require(_0x094f('0x18'));var config=require('../../config/environment');var db=require(_0x094f('0x19'))['db'];function respondWithStatusCode(_0x1fafec,_0x29b4c3){_0x29b4c3=_0x29b4c3||0xcc;return function(_0x38065b){if(_0x38065b){return _0x1fafec[_0x094f('0x1a')](_0x29b4c3);}return _0x1fafec[_0x094f('0x1b')](_0x29b4c3)[_0x094f('0x1c')]();};}function respondWithResult(_0x539c4b,_0x3a188a){_0x3a188a=_0x3a188a||0xc8;return function(_0xa7c957){if(_0xa7c957){return _0x539c4b[_0x094f('0x1b')](_0x3a188a)[_0x094f('0x1d')](_0xa7c957);}};}function respondWithFilteredResult(_0x269f37,_0xcf8275){return function(_0x57497d){if(_0x57497d){var _0x481f0c=_0x57497d[_0x094f('0x1e')],_0x4cc30b=_0xcf8275[_0x094f('0x1f')],_0x26f8c5=_0xcf8275[_0x094f('0x1f')]+_0xcf8275[_0x094f('0x20')],_0x15d1a1;if(_0x26f8c5>=_0x481f0c){_0x26f8c5=_0x481f0c;_0x15d1a1=0xc8;}else{_0x15d1a1=0xce;}_0x269f37[_0x094f('0x1b')](_0x15d1a1);return _0x269f37['set'](_0x094f('0x21'),_0x4cc30b+'-'+_0x26f8c5+'/'+_0x481f0c)[_0x094f('0x1d')](_0x57497d);}return null;};}function patchUpdates(_0x537dd7){return function(_0x43d358){try{jsonpatch[_0x094f('0x22')](_0x43d358,_0x537dd7,!![]);}catch(_0x2b8265){return BPromise[_0x094f('0x23')](_0x2b8265);}return _0x43d358[_0x094f('0x24')]();};}function saveUpdates(_0x2a537f,_0x1baf2d){return function(_0x237731){if(_0x237731){return _0x237731[_0x094f('0x25')](_0x2a537f)['then'](function(_0x3e13b9){return _0x3e13b9;});}return null;};}function removeEntity(_0x302d53,_0x599341){return function(_0x5ad897){if(_0x5ad897){return _0x5ad897['destroy']()[_0x094f('0x26')](function(){_0x302d53[_0x094f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e34e,_0x4bfaaa){return function(_0x45553c){if(!_0x45553c){_0x28e34e[_0x094f('0x1a')](0x194);}return _0x45553c;};}function handleError(_0x20be12,_0x429753){_0x429753=_0x429753||0x1f4;return function(_0x5250c5){logger[_0x094f('0x27')](_0x5250c5[_0x094f('0x28')]);if(_0x5250c5['name']){delete _0x5250c5[_0x094f('0x29')];}_0x20be12[_0x094f('0x1b')](_0x429753)[_0x094f('0x2a')](_0x5250c5);};}exports[_0x094f('0x2b')]=function(_0x305463,_0x4f1823){var _0x2c5bd0={},_0x5a491e={},_0x2d25f8={'count':0x0,'rows':[]};var _0x342dc2=db['DeskField']['rawAttributes'];_0x5a491e['model']=_[_0x094f('0x2c')](_0x342dc2);_0x5a491e[_0x094f('0x2d')]=_[_0x094f('0x2c')](_0x305463[_0x094f('0x2d')]);_0x5a491e['filters']=_['intersection'](_0x5a491e[_0x094f('0x2e')],_0x5a491e['query']);_0x2c5bd0[_0x094f('0x2f')]=_[_0x094f('0x30')](_0x5a491e[_0x094f('0x2e')],qs['fields'](_0x305463[_0x094f('0x2d')][_0x094f('0x31')]));_0x2c5bd0[_0x094f('0x2f')]=_0x2c5bd0[_0x094f('0x2f')][_0x094f('0x32')]?_0x2c5bd0[_0x094f('0x2f')]:_0x5a491e[_0x094f('0x2e')];if(!_0x305463[_0x094f('0x2d')][_0x094f('0x33')]('nolimit')){_0x2c5bd0[_0x094f('0x20')]=qs[_0x094f('0x20')](_0x305463[_0x094f('0x2d')]['limit']);_0x2c5bd0[_0x094f('0x1f')]=qs[_0x094f('0x1f')](_0x305463['query'][_0x094f('0x1f')]);}_0x2c5bd0[_0x094f('0x34')]=qs[_0x094f('0x35')](_0x305463[_0x094f('0x2d')][_0x094f('0x35')]);_0x2c5bd0[_0x094f('0x36')]=qs[_0x094f('0x37')](_[_0x094f('0x38')](_0x305463['query'],_0x5a491e[_0x094f('0x37')]));if(_0x305463[_0x094f('0x2d')][_0x094f('0x39')]){_0x2c5bd0[_0x094f('0x36')]=_[_0x094f('0x3a')](_0x2c5bd0['where'],{'$or':_[_0x094f('0x3b')](_0x342dc2,function(_0x2d2477){if(_0x2d2477['type'][_0x094f('0x3c')]!==_0x094f('0x3d')){var _0xaa28dc={};_0xaa28dc[_0x2d2477['field']]={'$like':'%'+_0x305463['query'][_0x094f('0x39')]+'%'};return _0xaa28dc;}})});}_0x2c5bd0=_[_0x094f('0x3a')]({},_0x2c5bd0,_0x305463[_0x094f('0x3e')]);var _0x447807={'where':_0x2c5bd0[_0x094f('0x36')]};return db[_0x094f('0x3f')]['count'](_0x447807)[_0x094f('0x26')](function(_0x569e16){_0x2d25f8[_0x094f('0x1e')]=_0x569e16;if(_0x305463[_0x094f('0x2d')][_0x094f('0x40')]){_0x2c5bd0[_0x094f('0x41')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x2c5bd0);})[_0x094f('0x26')](function(_0x40f460){_0x2d25f8[_0x094f('0x42')]=_0x40f460;return _0x2d25f8;})[_0x094f('0x26')](respondWithFilteredResult(_0x4f1823,_0x2c5bd0))[_0x094f('0x43')](handleError(_0x4f1823,null));};exports[_0x094f('0x44')]=function(_0x117901,_0x161dca){var _0x5b889b={'raw':!![],'where':{'id':_0x117901[_0x094f('0x45')]['id']}},_0x342b14={};_0x342b14[_0x094f('0x2e')]=_[_0x094f('0x2c')](db[_0x094f('0x3f')][_0x094f('0x46')]);_0x342b14[_0x094f('0x2d')]=_[_0x094f('0x2c')](_0x117901[_0x094f('0x2d')]);_0x342b14['filters']=_[_0x094f('0x30')](_0x342b14['model'],_0x342b14['query']);_0x5b889b[_0x094f('0x2f')]=_['intersection'](_0x342b14[_0x094f('0x2e')],qs[_0x094f('0x31')](_0x117901[_0x094f('0x2d')][_0x094f('0x31')]));_0x5b889b[_0x094f('0x2f')]=_0x5b889b[_0x094f('0x2f')][_0x094f('0x32')]?_0x5b889b[_0x094f('0x2f')]:_0x342b14['model'];if(_0x117901['query'][_0x094f('0x40')]){_0x5b889b[_0x094f('0x41')]=[{'all':!![]}];}_0x5b889b=_[_0x094f('0x3a')]({},_0x5b889b,_0x117901[_0x094f('0x3e')]);return db[_0x094f('0x3f')][_0x094f('0x47')](_0x5b889b)[_0x094f('0x26')](handleEntityNotFound(_0x161dca,null))['then'](respondWithResult(_0x161dca,null))[_0x094f('0x43')](handleError(_0x161dca,null));};exports['create']=function(_0x184752,_0x31e653){return db[_0x094f('0x3f')][_0x094f('0x48')](_0x184752[_0x094f('0x49')],{})['then'](respondWithResult(_0x31e653,0xc9))[_0x094f('0x43')](handleError(_0x31e653,null));};exports[_0x094f('0x25')]=function(_0x51ca71,_0x4711bb){if(_0x51ca71[_0x094f('0x49')]['id']){delete _0x51ca71[_0x094f('0x49')]['id'];}return db[_0x094f('0x3f')][_0x094f('0x47')]({'where':{'id':_0x51ca71[_0x094f('0x45')]['id']}})[_0x094f('0x26')](handleEntityNotFound(_0x4711bb,null))[_0x094f('0x26')](saveUpdates(_0x51ca71[_0x094f('0x49')],null))[_0x094f('0x26')](respondWithResult(_0x4711bb,null))[_0x094f('0x43')](handleError(_0x4711bb,null));};exports[_0x094f('0x4a')]=function(_0x2e5f3e,_0x5ddaaf){return db[_0x094f('0x3f')][_0x094f('0x47')]({'where':{'id':_0x2e5f3e[_0x094f('0x45')]['id']}})[_0x094f('0x26')](handleEntityNotFound(_0x5ddaaf,null))[_0x094f('0x26')](removeEntity(_0x5ddaaf,null))[_0x094f('0x43')](handleError(_0x5ddaaf,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index d461bae..a67647b 100644 --- a/server/api/intDeskField/intDeskField.model.js +++ b/server/api/intDeskField/intDeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbf3=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','idField','FieldId','lodash','../../config/logger','api','moment'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xfbf3,0x155));var _0x3fbf=function(_0x296f77,_0x3b42a9){_0x296f77=_0x296f77-0x0;var _0x2c3f83=_0xfbf3[_0x296f77];return _0x2c3f83;};'use strict';var _=require(_0x3fbf('0x0'));var util=require('util');var logger=require(_0x3fbf('0x1'))(_0x3fbf('0x2'));var moment=require(_0x3fbf('0x3'));var BPromise=require(_0x3fbf('0x4'));var rp=require(_0x3fbf('0x5'));var fs=require('fs');var path=require(_0x3fbf('0x6'));var rimraf=require(_0x3fbf('0x7'));var config=require(_0x3fbf('0x8'));var attributes=require(_0x3fbf('0x9'));module[_0x3fbf('0xa')]=function(_0x2f069a,_0x27d29c){return _0x2f069a[_0x3fbf('0xb')](_0x3fbf('0xc'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x3fbf('0xd'),_0x3fbf('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b48=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields','FieldId'];(function(_0x272d97,_0x3cb745){var _0x40fc01=function(_0x1ad071){while(--_0x1ad071){_0x272d97['push'](_0x272d97['shift']());}};_0x40fc01(++_0x3cb745);}(_0x0b48,0xee));var _0x80b4=function(_0x5740bc,_0x52677b){_0x5740bc=_0x5740bc-0x0;var _0x544f6e=_0x0b48[_0x5740bc];return _0x544f6e;};'use strict';var _=require('lodash');var util=require(_0x80b4('0x0'));var logger=require(_0x80b4('0x1'))(_0x80b4('0x2'));var moment=require(_0x80b4('0x3'));var BPromise=require(_0x80b4('0x4'));var rp=require(_0x80b4('0x5'));var fs=require('fs');var path=require(_0x80b4('0x6'));var rimraf=require(_0x80b4('0x7'));var config=require(_0x80b4('0x8'));var attributes=require(_0x80b4('0x9'));module['exports']=function(_0x38fd3e,_0x5677bb){return _0x38fd3e[_0x80b4('0xa')](_0x80b4('0xb'),attributes,{'tableName':_0x80b4('0xc'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0x80b4('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 9d49b8a..7f08487 100644 --- a/server/api/intDeskField/intDeskField.rpc.js +++ b/server/api/intDeskField/intDeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b2e=['then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','jayson/promise','http'];(function(_0x2fd36f,_0x2fd3d8){var _0x34c0c7=function(_0x4005b5){while(--_0x4005b5){_0x2fd36f['push'](_0x2fd36f['shift']());}};_0x34c0c7(++_0x2fd3d8);}(_0x3b2e,0xe7));var _0xe3b2=function(_0x58ee96,_0x5affd5){_0x58ee96=_0x58ee96-0x0;var _0xb346aa=_0x3b2e[_0x58ee96];return _0xb346aa;};'use strict';var _=require(_0xe3b2('0x0'));var util=require('util');var moment=require(_0xe3b2('0x1'));var BPromise=require(_0xe3b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3b2('0x3'));var db=require(_0xe3b2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe3b2('0x5'));var client=jayson['client'][_0xe3b2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x16e004,_0x14d9af,_0xfb971){return new BPromise(function(_0x5e7b90,_0x3d21f3){return client['request'](_0x16e004,_0xfb971)[_0xe3b2('0x7')](function(_0x51d6eb){logger[_0xe3b2('0x8')](_0xe3b2('0x9'),_0x14d9af,_0xe3b2('0xa'));logger['debug'](_0xe3b2('0xb'),_0x14d9af,'request\x20sent',JSON[_0xe3b2('0xc')](_0x51d6eb));if(_0x51d6eb[_0xe3b2('0xd')]){if(_0x51d6eb[_0xe3b2('0xd')][_0xe3b2('0xe')]===0x1f4){logger['error'](_0xe3b2('0x9'),_0x14d9af,_0x51d6eb[_0xe3b2('0xd')][_0xe3b2('0xf')]);return _0x3d21f3(_0x51d6eb['error'][_0xe3b2('0xf')]);}logger[_0xe3b2('0xd')](_0xe3b2('0x9'),_0x14d9af,_0x51d6eb[_0xe3b2('0xd')][_0xe3b2('0xf')]);return _0x5e7b90(_0x51d6eb['error'][_0xe3b2('0xf')]);}else{logger['info'](_0xe3b2('0x9'),_0x14d9af,_0xe3b2('0xa'));_0x5e7b90(_0x51d6eb[_0xe3b2('0x10')][_0xe3b2('0xf')]);}})['catch'](function(_0x19e0f9){logger[_0xe3b2('0xd')]('DeskField,\x20%s,\x20%s',_0x14d9af,_0x19e0f9);_0x3d21f3(_0x19e0f9);});});} \ No newline at end of file +var _0xe006=['catch','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x2bd95c,_0x227191){var _0x4a9f69=function(_0x22f449){while(--_0x22f449){_0x2bd95c['push'](_0x2bd95c['shift']());}};_0x4a9f69(++_0x227191);}(_0xe006,0x1ba));var _0x6e00=function(_0x37512d,_0x44495e){_0x37512d=_0x37512d-0x0;var _0x133f49=_0xe006[_0x37512d];return _0x133f49;};'use strict';var _=require(_0x6e00('0x0'));var util=require(_0x6e00('0x1'));var moment=require(_0x6e00('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e00('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e00('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6e00('0x5'));var jayson=require(_0x6e00('0x6'));var client=jayson[_0x6e00('0x7')][_0x6e00('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x525f55,_0xb9822b,_0x20758e){return new BPromise(function(_0x3e915b,_0x195f3f){return client[_0x6e00('0x9')](_0x525f55,_0x20758e)[_0x6e00('0xa')](function(_0x59322c){logger[_0x6e00('0xb')](_0x6e00('0xc'),_0xb9822b,_0x6e00('0xd'));logger[_0x6e00('0xe')](_0x6e00('0xf'),_0xb9822b,_0x6e00('0xd'),JSON['stringify'](_0x59322c));if(_0x59322c[_0x6e00('0x10')]){if(_0x59322c[_0x6e00('0x10')][_0x6e00('0x11')]===0x1f4){logger['error'](_0x6e00('0xc'),_0xb9822b,_0x59322c['error'][_0x6e00('0x12')]);return _0x195f3f(_0x59322c[_0x6e00('0x10')][_0x6e00('0x12')]);}logger[_0x6e00('0x10')](_0x6e00('0xc'),_0xb9822b,_0x59322c['error'][_0x6e00('0x12')]);return _0x3e915b(_0x59322c[_0x6e00('0x10')]['message']);}else{logger[_0x6e00('0xb')](_0x6e00('0xc'),_0xb9822b,'request\x20sent');_0x3e915b(_0x59322c[_0x6e00('0x13')]['message']);}})[_0x6e00('0x14')](function(_0x10d887){logger[_0x6e00('0x10')]('DeskField,\x20%s,\x20%s',_0xb9822b,_0x10d887);_0x195f3f(_0x10d887);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index b132835..08e4dc7 100644 --- a/server/api/intDynamics365Account/index.js +++ b/server/api/intDynamics365Account/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x926a=['update','delete','destroy','exports','multer','path','express','../../components/auth/service','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x2cfd83,_0x31e833){var _0x410ca8=function(_0x5c3d47){while(--_0x5c3d47){_0x2cfd83['push'](_0x2cfd83['shift']());}};_0x410ca8(++_0x31e833);}(_0x926a,0x180));var _0xa926=function(_0x500cdd,_0x41dbf9){_0x500cdd=_0x500cdd-0x0;var _0x40a9e8=_0x926a[_0x500cdd];return _0x40a9e8;};'use strict';var multer=require(_0xa926('0x0'));var util=require('util');var path=require(_0xa926('0x1'));var timeout=require('connect-timeout');var express=require(_0xa926('0x2'));var router=express['Router']();var auth=require(_0xa926('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0xa926('0x4')]('/',auth[_0xa926('0x5')](),controller['index']);router[_0xa926('0x4')](_0xa926('0x6'),auth[_0xa926('0x5')](),controller[_0xa926('0x7')]);router[_0xa926('0x4')](_0xa926('0x8'),auth['isAuthenticated'](),controller[_0xa926('0x9')]);router[_0xa926('0x4')](_0xa926('0xa'),auth['isAuthenticated'](),controller[_0xa926('0xb')]);router[_0xa926('0xc')]('/',auth[_0xa926('0x5')](),controller[_0xa926('0xd')]);router[_0xa926('0xc')](_0xa926('0x8'),auth[_0xa926('0x5')](),controller[_0xa926('0xe')]);router['put'](_0xa926('0x6'),auth[_0xa926('0x5')](),controller[_0xa926('0xf')]);router[_0xa926('0x10')](_0xa926('0x6'),auth['isAuthenticated'](),controller[_0xa926('0x11')]);module[_0xa926('0x12')]=router; \ No newline at end of file +var _0x23d8=['./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x49279c,_0x56da65){var _0x472c04=function(_0x6b5a3d){while(--_0x6b5a3d){_0x49279c['push'](_0x49279c['shift']());}};_0x472c04(++_0x56da65);}(_0x23d8,0x1f3));var _0x823d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x23d8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x823d('0x0'));var util=require(_0x823d('0x1'));var path=require('path');var timeout=require(_0x823d('0x2'));var express=require('express');var router=express[_0x823d('0x3')]();var auth=require(_0x823d('0x4'));var interaction=require(_0x823d('0x5'));var config=require(_0x823d('0x6'));var controller=require(_0x823d('0x7'));router['get']('/',auth[_0x823d('0x8')](),controller[_0x823d('0x9')]);router[_0x823d('0xa')](_0x823d('0xb'),auth['isAuthenticated'](),controller[_0x823d('0xc')]);router[_0x823d('0xa')](_0x823d('0xd'),auth[_0x823d('0x8')](),controller['getConfigurations']);router[_0x823d('0xa')](_0x823d('0xe'),auth[_0x823d('0x8')](),controller['getFields']);router[_0x823d('0xf')]('/',auth[_0x823d('0x8')](),controller[_0x823d('0x10')]);router[_0x823d('0xf')](_0x823d('0xd'),auth['isAuthenticated'](),controller[_0x823d('0x11')]);router[_0x823d('0x12')]('/:id',auth[_0x823d('0x8')](),controller[_0x823d('0x13')]);router[_0x823d('0x14')]('/:id',auth[_0x823d('0x8')](),controller[_0x823d('0x15')]);module[_0x823d('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index e2f996b..62a0826 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.attributes.js +++ b/server/api/intDynamics365Account/intDynamics365Account.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd472=['STRING'];(function(_0xff53ed,_0x4424d2){var _0xabb084=function(_0x32737b){while(--_0x32737b){_0xff53ed['push'](_0xff53ed['shift']());}};_0xabb084(++_0x4424d2);}(_0xd472,0xc9));var _0x2d47=function(_0x553e09,_0xccf05f){_0x553e09=_0x553e09-0x0;var _0x19d948=_0xd472[_0x553e09];return _0x19d948;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x2d47('0x0')]},'password':{'type':Sequelize[_0x2d47('0x0')]},'remoteUri':{'type':Sequelize[_0x2d47('0x0')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x2d47('0x0')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x2d47('0x0')]},'description':{'type':Sequelize[_0x2d47('0x0')]}}; \ No newline at end of file +var _0xffd2=['exports','STRING','sequelize'];(function(_0x4dbac8,_0x21d060){var _0x343db9=function(_0x222faf){while(--_0x222faf){_0x4dbac8['push'](_0x4dbac8['shift']());}};_0x343db9(++_0x21d060);}(_0xffd2,0x1e8));var _0x2ffd=function(_0x72895a,_0x433607){_0x72895a=_0x72895a-0x0;var _0x5226d5=_0xffd2[_0x72895a];return _0x5226d5;};'use strict';var Sequelize=require(_0x2ffd('0x0'));module[_0x2ffd('0x1')]={'name':{'type':Sequelize[_0x2ffd('0x2')]},'username':{'type':Sequelize[_0x2ffd('0x2')]},'password':{'type':Sequelize[_0x2ffd('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x2ffd('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x2ffd('0x2')]},'description':{'type':Sequelize[_0x2ffd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index b5f96b8..305ebdf 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.controller.js +++ b/server/api/intDynamics365Account/intDynamics365Account.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ccd=['request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','limit','set','apply','reject','save','then','destroy','end','stack','name','send','index','Dynamics365Account','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','offset','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','find','catch','body','update','params','Dynamics365Configuration','rawAttributes','order','pick','getConfigurations','nolimit','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','Dynamics365Field','getFields','Incident','PhoneCall','title','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','Dynamics365Account,\x20%s,\x20%s'];(function(_0x3dc6f4,_0x362e2a){var _0x3b18e9=function(_0x5bf19e){while(--_0x5bf19e){_0x3dc6f4['push'](_0x3dc6f4['shift']());}};_0x3b18e9(++_0x362e2a);}(_0x1ccd,0x1a3));var _0xd1cc=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0x1ccd[_0x1ae31c];return _0x19519d;};'use strict';var pdf=require(_0xd1cc('0x0'));var emlformat=require(_0xd1cc('0x1'));var rimraf=require(_0xd1cc('0x2'));var zipdir=require(_0xd1cc('0x3'));var jsonpatch=require(_0xd1cc('0x4'));var rp=require(_0xd1cc('0x5'));var moment=require('moment');var BPromise=require(_0xd1cc('0x6'));var Mustache=require(_0xd1cc('0x7'));var util=require(_0xd1cc('0x8'));var path=require(_0xd1cc('0x9'));var sox=require(_0xd1cc('0xa'));var csv=require(_0xd1cc('0xb'));var ejs=require(_0xd1cc('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd1cc('0xd'));var crypto=require(_0xd1cc('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd1cc('0xf'));var toCsv=require(_0xd1cc('0xb'));var querystring=require('querystring');var Papa=require(_0xd1cc('0x10'));var Redis=require(_0xd1cc('0x11'));var authService=require(_0xd1cc('0x12'));var qs=require(_0xd1cc('0x13'));var hardwareService=require(_0xd1cc('0x14'));var logger=require('../../config/logger')(_0xd1cc('0x15'));var utils=require(_0xd1cc('0x16'));var config=require(_0xd1cc('0x17'));var db=require(_0xd1cc('0x18'))['db'];var integrations=require(_0xd1cc('0x19'));var jayson=require(_0xd1cc('0x1a'));var client=jayson[_0xd1cc('0x1b')][_0xd1cc('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5c48d4,_0x5f2fe4,_0x509cee){if(_0x509cee){var _0x5407e2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5407e2[_0xd1cc('0x1d')](_0x5f2fe4)){return _0x5c48d4;}else{throw new Error(_0xd1cc('0x1e'));}}else{return _0x5c48d4;}}function respondWithRpcPromise(_0x2d8c1e,_0x4c72b1,_0x381858,_0x6bc11b){return new BPromise(function(_0x1f59e8,_0x7b58bc){var _0x148430=_0x6bc11b||client;return _0x148430['request'](_0x2d8c1e,_0x381858)['then'](function(_0x3f9ec8){logger[_0xd1cc('0x1f')](_0xd1cc('0x20'),_0x4c72b1,_0xd1cc('0x21'));logger[_0xd1cc('0x22')](_0xd1cc('0x23'),_0x4c72b1,'request\x20sent',JSON[_0xd1cc('0x24')](_0x3f9ec8));if(_0x3f9ec8[_0xd1cc('0x25')]){if(_0x3f9ec8[_0xd1cc('0x25')][_0xd1cc('0x26')]===0x1f4){logger[_0xd1cc('0x25')](_0xd1cc('0x20'),_0x4c72b1,_0x3f9ec8['error'][_0xd1cc('0x27')]);return _0x7b58bc(_0x3f9ec8[_0xd1cc('0x25')][_0xd1cc('0x27')]);}logger[_0xd1cc('0x25')](_0xd1cc('0x20'),_0x4c72b1,_0x3f9ec8[_0xd1cc('0x25')]['message']);return _0x1f59e8(_0x3f9ec8[_0xd1cc('0x25')]['message']);}else{logger['info'](_0xd1cc('0x20'),_0x4c72b1,_0xd1cc('0x21'));_0x1f59e8(_0x3f9ec8['result'][_0xd1cc('0x27')]);}})['catch'](function(_0x4ae069){logger['error'](_0xd1cc('0x20'),_0x4c72b1,_0x4ae069);_0x7b58bc(_0x4ae069);});});}function respondWithStatusCode(_0x116abb,_0x4d4a6d){_0x4d4a6d=_0x4d4a6d||0xcc;return function(_0xfd14ae){if(_0xfd14ae){return _0x116abb[_0xd1cc('0x28')](_0x4d4a6d);}return _0x116abb['status'](_0x4d4a6d)['end']();};}function respondWithResult(_0x3b9098,_0x1a6ee1){_0x1a6ee1=_0x1a6ee1||0xc8;return function(_0x45f07d){if(_0x45f07d){return _0x3b9098[_0xd1cc('0x29')](_0x1a6ee1)[_0xd1cc('0x2a')](_0x45f07d);}};}function respondWithFilteredResult(_0x4e7bcf,_0x1e6fe4){return function(_0x3364f3){if(_0x3364f3){var _0x3e1cfc=_0x3364f3['count'],_0x28217a=_0x1e6fe4['offset'],_0x224788=_0x1e6fe4['offset']+_0x1e6fe4[_0xd1cc('0x2b')],_0x59b741;if(_0x224788>=_0x3e1cfc){_0x224788=_0x3e1cfc;_0x59b741=0xc8;}else{_0x59b741=0xce;}_0x4e7bcf[_0xd1cc('0x29')](_0x59b741);return _0x4e7bcf[_0xd1cc('0x2c')]('Content-Range',_0x28217a+'-'+_0x224788+'/'+_0x3e1cfc)['json'](_0x3364f3);}return null;};}function patchUpdates(_0x1aafaa){return function(_0xe67b63){try{jsonpatch[_0xd1cc('0x2d')](_0xe67b63,_0x1aafaa,!![]);}catch(_0x123af5){return BPromise[_0xd1cc('0x2e')](_0x123af5);}return _0xe67b63[_0xd1cc('0x2f')]();};}function saveUpdates(_0x44faa7,_0x49a38a){return function(_0x1e6283){if(_0x1e6283){return _0x1e6283['update'](_0x44faa7)[_0xd1cc('0x30')](function(_0x153194){return _0x153194;});}return null;};}function removeEntity(_0x5667a3,_0x1988b1){return function(_0x1a200a){if(_0x1a200a){return _0x1a200a[_0xd1cc('0x31')]()[_0xd1cc('0x30')](function(){_0x5667a3[_0xd1cc('0x29')](0xcc)[_0xd1cc('0x32')]();});}};}function handleEntityNotFound(_0x26b9ff,_0x4ecc01){return function(_0x311d06){if(!_0x311d06){_0x26b9ff[_0xd1cc('0x28')](0x194);}return _0x311d06;};}function handleError(_0x19fec5,_0xf154c2){_0xf154c2=_0xf154c2||0x1f4;return function(_0x18d380){logger[_0xd1cc('0x25')](_0x18d380[_0xd1cc('0x33')]);if(_0x18d380[_0xd1cc('0x34')]){delete _0x18d380[_0xd1cc('0x34')];}_0x19fec5[_0xd1cc('0x29')](_0xf154c2)[_0xd1cc('0x35')](_0x18d380);};}exports[_0xd1cc('0x36')]=function(_0x1acb55,_0x235534){var _0x4b88db={},_0x261e21={},_0x481207={'count':0x0,'rows':[]};var _0x56b783=db[_0xd1cc('0x37')]['rawAttributes'];_0x261e21[_0xd1cc('0x38')]=_[_0xd1cc('0x39')](_0x56b783);_0x261e21[_0xd1cc('0x3a')]=_[_0xd1cc('0x39')](_0x1acb55[_0xd1cc('0x3a')]);_0x261e21['filters']=_[_0xd1cc('0x3b')](_0x261e21[_0xd1cc('0x38')],_0x261e21[_0xd1cc('0x3a')]);_0x4b88db[_0xd1cc('0x3c')]=_[_0xd1cc('0x3b')](_0x261e21[_0xd1cc('0x38')],qs[_0xd1cc('0x3d')](_0x1acb55[_0xd1cc('0x3a')][_0xd1cc('0x3d')]));_0x4b88db[_0xd1cc('0x3c')]=_0x4b88db[_0xd1cc('0x3c')][_0xd1cc('0x3e')]?_0x4b88db[_0xd1cc('0x3c')]:_0x261e21['model'];if(!_0x1acb55['query'][_0xd1cc('0x3f')]('nolimit')){_0x4b88db['limit']=qs[_0xd1cc('0x2b')](_0x1acb55[_0xd1cc('0x3a')][_0xd1cc('0x2b')]);_0x4b88db['offset']=qs[_0xd1cc('0x40')](_0x1acb55[_0xd1cc('0x3a')][_0xd1cc('0x40')]);}_0x4b88db['order']=qs['sort'](_0x1acb55[_0xd1cc('0x3a')][_0xd1cc('0x41')]);_0x4b88db[_0xd1cc('0x42')]=qs[_0xd1cc('0x43')](_['pick'](_0x1acb55['query'],_0x261e21[_0xd1cc('0x43')]));if(_0x1acb55[_0xd1cc('0x3a')][_0xd1cc('0x44')]){_0x4b88db[_0xd1cc('0x42')]=_[_0xd1cc('0x45')](_0x4b88db['where'],{'$or':_[_0xd1cc('0x46')](_0x56b783,function(_0x458a38){if(_0x458a38[_0xd1cc('0x47')][_0xd1cc('0x48')]!==_0xd1cc('0x49')){var _0x3445bd={};_0x3445bd[_0x458a38[_0xd1cc('0x4a')]]={'$like':'%'+_0x1acb55['query'][_0xd1cc('0x44')]+'%'};return _0x3445bd;}})});}_0x4b88db=_[_0xd1cc('0x45')]({},_0x4b88db,_0x1acb55[_0xd1cc('0x4b')]);var _0x363608={'where':_0x4b88db['where']};return db['Dynamics365Account']['count'](_0x363608)['then'](function(_0x125dec){_0x481207[_0xd1cc('0x4c')]=_0x125dec;if(_0x1acb55['query'][_0xd1cc('0x4d')]){_0x4b88db[_0xd1cc('0x4e')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xd1cc('0x4f')](_0x4b88db);})[_0xd1cc('0x30')](function(_0x542603){_0x481207[_0xd1cc('0x50')]=_0x542603;return _0x481207;})[_0xd1cc('0x30')](respondWithFilteredResult(_0x235534,_0x4b88db))['catch'](handleError(_0x235534,null));};exports[_0xd1cc('0x51')]=function(_0x5522ed,_0x153562){var _0x130f02={'raw':![],'where':{'id':_0x5522ed['params']['id']}},_0xc1a695={};_0xc1a695['model']=_['keys'](db[_0xd1cc('0x37')]['rawAttributes']);_0xc1a695[_0xd1cc('0x3a')]=_['keys'](_0x5522ed['query']);_0xc1a695['filters']=_[_0xd1cc('0x3b')](_0xc1a695['model'],_0xc1a695['query']);_0x130f02[_0xd1cc('0x3c')]=_[_0xd1cc('0x3b')](_0xc1a695[_0xd1cc('0x38')],qs[_0xd1cc('0x3d')](_0x5522ed['query'][_0xd1cc('0x3d')]));_0x130f02['attributes']=_0x130f02[_0xd1cc('0x3c')][_0xd1cc('0x3e')]?_0x130f02[_0xd1cc('0x3c')]:_0xc1a695[_0xd1cc('0x38')];if(_0x5522ed[_0xd1cc('0x3a')][_0xd1cc('0x4d')]){_0x130f02[_0xd1cc('0x4e')]=[{'all':!![]}];}_0x130f02=_['merge']({},_0x130f02,_0x5522ed[_0xd1cc('0x4b')]);return db[_0xd1cc('0x37')][_0xd1cc('0x52')](_0x130f02)[_0xd1cc('0x30')](handleEntityNotFound(_0x153562,null))[_0xd1cc('0x30')](respondWithResult(_0x153562,null))[_0xd1cc('0x53')](handleError(_0x153562,null));};exports['create']=function(_0x37cc61,_0x26af2c){return db[_0xd1cc('0x37')]['create'](_0x37cc61[_0xd1cc('0x54')],{})['then'](respondWithResult(_0x26af2c,0xc9))[_0xd1cc('0x53')](handleError(_0x26af2c,null));};exports[_0xd1cc('0x55')]=function(_0x5bad18,_0x5b8781){if(_0x5bad18[_0xd1cc('0x54')]['id']){delete _0x5bad18[_0xd1cc('0x54')]['id'];}return db[_0xd1cc('0x37')][_0xd1cc('0x52')]({'where':{'id':_0x5bad18[_0xd1cc('0x56')]['id']}})[_0xd1cc('0x30')](handleEntityNotFound(_0x5b8781,null))[_0xd1cc('0x30')](saveUpdates(_0x5bad18[_0xd1cc('0x54')],null))[_0xd1cc('0x30')](respondWithResult(_0x5b8781,null))[_0xd1cc('0x53')](handleError(_0x5b8781,null));};exports[_0xd1cc('0x31')]=function(_0x73d11,_0x47c629){return db[_0xd1cc('0x37')][_0xd1cc('0x52')]({'where':{'id':_0x73d11['params']['id']}})[_0xd1cc('0x30')](handleEntityNotFound(_0x47c629,null))[_0xd1cc('0x30')](removeEntity(_0x47c629,null))[_0xd1cc('0x53')](handleError(_0x47c629,null));};exports['getConfigurations']=function(_0x132da5,_0x4bc342,_0x1afe85){var _0x515b80={};var _0x366dd5={};var _0x45c006;var _0x453acc;return db[_0xd1cc('0x37')]['findOne']({'where':{'id':_0x132da5[_0xd1cc('0x56')]['id']}})['then'](handleEntityNotFound(_0x4bc342,null))[_0xd1cc('0x30')](function(_0x41dee2){if(_0x41dee2){_0x45c006=_0x41dee2;_0x366dd5[_0xd1cc('0x38')]=_[_0xd1cc('0x39')](db[_0xd1cc('0x57')][_0xd1cc('0x58')]);_0x366dd5[_0xd1cc('0x3a')]=_[_0xd1cc('0x39')](_0x132da5[_0xd1cc('0x3a')]);_0x366dd5[_0xd1cc('0x43')]=_['intersection'](_0x366dd5[_0xd1cc('0x38')],_0x366dd5[_0xd1cc('0x3a')]);_0x515b80[_0xd1cc('0x3c')]=_['intersection'](_0x366dd5[_0xd1cc('0x38')],qs[_0xd1cc('0x3d')](_0x132da5['query']['fields']));_0x515b80[_0xd1cc('0x3c')]=_0x515b80['attributes'][_0xd1cc('0x3e')]?_0x515b80[_0xd1cc('0x3c')]:_0x366dd5[_0xd1cc('0x38')];_0x515b80[_0xd1cc('0x59')]=qs[_0xd1cc('0x41')](_0x132da5['query'][_0xd1cc('0x41')]);_0x515b80[_0xd1cc('0x42')]=qs[_0xd1cc('0x43')](_[_0xd1cc('0x5a')](_0x132da5[_0xd1cc('0x3a')],_0x366dd5[_0xd1cc('0x43')]));if(_0x132da5[_0xd1cc('0x3a')][_0xd1cc('0x44')]){_0x515b80[_0xd1cc('0x42')]=_[_0xd1cc('0x45')](_0x515b80[_0xd1cc('0x42')],{'$or':_[_0xd1cc('0x46')](_0x515b80[_0xd1cc('0x3c')],function(_0x60df39){var _0x4f1717={};_0x4f1717[_0x60df39]={'$like':'%'+_0x132da5[_0xd1cc('0x3a')]['filter']+'%'};return _0x4f1717;})});}_0x515b80=_[_0xd1cc('0x45')]({},_0x515b80,_0x132da5['options']);return _0x45c006[_0xd1cc('0x5b')](_0x515b80);}})['then'](function(_0x2f92ec){if(_0x2f92ec){_0x453acc=_0x2f92ec[_0xd1cc('0x3e')];if(!_0x132da5[_0xd1cc('0x3a')]['hasOwnProperty'](_0xd1cc('0x5c'))){_0x515b80['limit']=qs[_0xd1cc('0x2b')](_0x132da5[_0xd1cc('0x3a')]['limit']);_0x515b80[_0xd1cc('0x40')]=qs[_0xd1cc('0x40')](_0x132da5[_0xd1cc('0x3a')][_0xd1cc('0x40')]);}return _0x45c006['getConfigurations'](_0x515b80);}})['then'](function(_0x1635e5){if(_0x1635e5){return _0x1635e5?{'count':_0x453acc,'rows':_0x1635e5}:null;}})['then'](respondWithResult(_0x4bc342,null))[_0xd1cc('0x53')](handleError(_0x4bc342,null));};exports[_0xd1cc('0x5d')]=function(_0x3b7432,_0x246c1b,_0x547133){if(_0x3b7432[_0xd1cc('0x54')]['id']){delete _0x3b7432[_0xd1cc('0x54')]['id'];}return db[_0xd1cc('0x37')][_0xd1cc('0x5e')]({'where':{'id':_0x3b7432['params']['id']}})[_0xd1cc('0x30')](handleEntityNotFound(_0x246c1b,null))[_0xd1cc('0x30')](function(_0xaa26d){if(_0xaa26d){_0x3b7432[_0xd1cc('0x54')]['AccountId']=_0xaa26d['id'];_0x3b7432[_0xd1cc('0x54')][_0xd1cc('0x5f')]=integrations[_0xd1cc('0x60')](_0x3b7432[_0xd1cc('0x54')][_0xd1cc('0x61')],_0x3b7432['body'][_0xd1cc('0x47')]);_0x3b7432[_0xd1cc('0x54')][_0xd1cc('0x62')]=integrations[_0xd1cc('0x63')](_0x3b7432['body'][_0xd1cc('0x61')],_0x3b7432[_0xd1cc('0x54')][_0xd1cc('0x47')]);return db[_0xd1cc('0x57')][_0xd1cc('0x64')](_0x3b7432[_0xd1cc('0x54')],{'include':[{'model':db['Dynamics365Field'],'as':_0xd1cc('0x5f')},{'model':db[_0xd1cc('0x65')],'as':'Descriptions'}]});}return null;})[_0xd1cc('0x30')](respondWithResult(_0x246c1b,null))[_0xd1cc('0x53')](handleError(_0x246c1b,null));};exports[_0xd1cc('0x66')]=function(_0x863758,_0x2ba895,_0x128cd7){var _0x49d1ee=_0x863758[_0xd1cc('0x3a')]['ticketType'];var _0x52d60a=_0x49d1ee==='incident'?_0xd1cc('0x67'):_0xd1cc('0x68');var _0x5c1d72='';var _0x4f5ed4='';var _0x178140='';var _0x509eae='';var _0x39b6bb='';var _0x3b89b4='';var _0xa74966='';var _0x334217='';var _0x378819=[_0xd1cc('0x69'),'description',_0xd1cc('0x6a'),'ownerid',_0xd1cc('0x6b'),_0xd1cc('0x6c'),_0xd1cc('0x6d'),_0xd1cc('0x6e'),_0xd1cc('0x6f'),_0xd1cc('0x70')];var _0x2123c1=[_0xd1cc('0x71'),_0xd1cc('0x72'),_0xd1cc('0x73'),'billedserviceunits',_0xd1cc('0x74'),_0xd1cc('0x75'),_0xd1cc('0x76'),_0xd1cc('0x77'),'createdbyexternalpartyname',_0xd1cc('0x78'),'createdbyname','createdbyyominame','createdon',_0xd1cc('0x79'),_0xd1cc('0x7a'),_0xd1cc('0x7b'),_0xd1cc('0x7c'),_0xd1cc('0x7d'),_0xd1cc('0x7e'),_0xd1cc('0x7f'),'entityimage_timestamp',_0xd1cc('0x80'),_0xd1cc('0x81'),_0xd1cc('0x82'),_0xd1cc('0x83'),_0xd1cc('0x84'),_0xd1cc('0x85'),_0xd1cc('0x86'),_0xd1cc('0x87'),_0xd1cc('0x88'),_0xd1cc('0x89'),'modifiedbyexternalpartyname',_0xd1cc('0x8a'),_0xd1cc('0x8b'),_0xd1cc('0x8c'),_0xd1cc('0x8d'),_0xd1cc('0x8e'),_0xd1cc('0x8f'),_0xd1cc('0x90'),_0xd1cc('0x91'),_0xd1cc('0x92'),_0xd1cc('0x93'),_0xd1cc('0x94'),_0xd1cc('0x95'),_0xd1cc('0x96'),_0xd1cc('0x97'),_0xd1cc('0x98'),'primarycontactidname',_0xd1cc('0x99'),'prioritycodename','productidname',_0xd1cc('0x9a'),_0xd1cc('0x9b'),_0xd1cc('0x9c'),_0xd1cc('0x9d'),_0xd1cc('0x9e'),_0xd1cc('0x9f'),'sentimentvalue',_0xd1cc('0xa0'),_0xd1cc('0xa1'),_0xd1cc('0xa2'),_0xd1cc('0xa3'),_0xd1cc('0xa4'),_0xd1cc('0xa5'),_0xd1cc('0xa6'),_0xd1cc('0xa7'),_0xd1cc('0xa8'),_0xd1cc('0xa9'),_0xd1cc('0xaa'),_0xd1cc('0xab')];var _0x2addac=_0x378819[_0xd1cc('0xac')](_0x2123c1);return db[_0xd1cc('0x37')][_0xd1cc('0x5e')]({'where':{'id':_0x863758[_0xd1cc('0x56')]['id']},'attributes':['id','username',_0xd1cc('0xad'),_0xd1cc('0xae'),_0xd1cc('0xaf'),_0xd1cc('0xb0'),_0xd1cc('0xb1')]})[_0xd1cc('0x30')](handleEntityNotFound(_0x2ba895,null))[_0xd1cc('0x30')](function(_0x1ea1ec){if(_0x1ea1ec){_0x334217=_0x1ea1ec[_0xd1cc('0xae')];var _0x37e71d=_0x334217[_0xd1cc('0xb2')](-0x1);if(_0x37e71d==='/'){_0x334217=_0x334217[_0xd1cc('0xb3')](0x0,_0x334217[_0xd1cc('0xb4')](_0x37e71d));}_0xa74966=util['format'](_0xd1cc('0xb5'),_0x334217);var _0x418f0f={'method':_0xd1cc('0xb6'),'uri':_0xd1cc('0xb7')+_0x1ea1ec[_0xd1cc('0xaf')]+'/oauth2/token','form':{'client_id':_0x1ea1ec[_0xd1cc('0xb0')],'resource':_0x334217,'username':_0x1ea1ec[_0xd1cc('0xb8')],'password':_0x1ea1ec['password'],'grant_type':_0xd1cc('0xad'),'client_secret':_0x1ea1ec[_0xd1cc('0xb1')]},'json':!![]};return rp(_0x418f0f);}})[_0xd1cc('0x30')](function(_0x314151){_0x3b89b4=_0x314151[_0xd1cc('0xb9')];var _0x38c8c6={'method':_0xd1cc('0xba'),'uri':encodeURI(_0xa74966+_0xd1cc('0xbb')+_0x52d60a+'\x27'),'headers':{'Authorization':_0xd1cc('0xbc')+_0x3b89b4,'If-None-Match':null,'OData-Version':_0xd1cc('0xbd')},'json':!![]};return rp(_0x38c8c6);})[_0xd1cc('0x30')](function(_0xb1c034){var _0x47463d=_0xb1c034['value'][0x0];var _0x142d17=_0x47463d['MetadataId'];var _0x582857={'method':_0xd1cc('0xba'),'uri':_0xa74966+_0xd1cc('0xbe')+_0x142d17+_0xd1cc('0xbf'),'headers':{'Authorization':_0xd1cc('0xbc')+_0x3b89b4,'If-None-Match':null,'OData-Version':_0xd1cc('0xbd')},'json':!![]};return rp(_0x582857);})[_0xd1cc('0x30')](function(_0x2ba432){_0x5c1d72=_0x2ba432;_0x4f5ed4=_0x5c1d72[_0xd1cc('0xc0')];_0x4f5ed4=_[_0xd1cc('0xc1')](_0x4f5ed4,function(_0x500f4a){return!_0x2addac[_0xd1cc('0xc2')](_0x500f4a[_0xd1cc('0xc3')]);});var _0x3c2e96=[];var _0x3327a1=[];_0x4f5ed4[_0xd1cc('0xc4')](function(_0x29f9d0){if(_0x29f9d0[_0xd1cc('0xc5')]){var _0x13bbd0=_0x29f9d0[_0xd1cc('0xc5')][_0xd1cc('0xb3')](_0x29f9d0['@odata.type'][_0xd1cc('0xb4')]('.')+0x1);if(_0x13bbd0===_0xd1cc('0xc6')){_0x3c2e96[_0xd1cc('0xc7')](getSelectList(_0xa74966,_0x49d1ee,_0x3327a1,_0x5c1d72[_0xd1cc('0xc8')],_0x29f9d0['MetadataId'],_0x3b89b4));}}});return Promise['all'](_0x3c2e96);})[_0xd1cc('0x30')](function(_0x48e48f){_0x178140=_0x48e48f[0x0];var _0x11ec1f=[];var _0x32ef74=[];_0x4f5ed4['forEach'](function(_0x3fbe98){if(!_['isNil'](_0x3fbe98['@odata.type'])){var _0x5bebd7=_0x3fbe98[_0xd1cc('0xc5')][_0xd1cc('0xb3')](_0x3fbe98['@odata.type'][_0xd1cc('0xb4')]('.')+0x1);if(_0x5bebd7===_0xd1cc('0xc9')){_0x11ec1f[_0xd1cc('0xc7')](getBooleanList(_0xa74966,_0x49d1ee,_0x32ef74,_0x5c1d72[_0xd1cc('0xc8')],_0x3fbe98['MetadataId'],_0x3b89b4));}}});return Promise[_0xd1cc('0xca')](_0x11ec1f);})[_0xd1cc('0x30')](function(_0x403c4f){_0x509eae=_0x403c4f[0x0];var _0x911b5d=[];var _0x52a8f7=[];_0x4f5ed4[_0xd1cc('0xc4')](function(_0x268e86){if(_0x268e86[_0xd1cc('0xc5')]){var _0x4bb1e8=_0x268e86['@odata.type'][_0xd1cc('0xb3')](_0x268e86['@odata.type'][_0xd1cc('0xb4')]('.')+0x1);if(_0x4bb1e8===_0xd1cc('0xcb')||_0x4bb1e8===_0xd1cc('0xcc')||_0x4bb1e8===_0xd1cc('0xcd')||_0x4bb1e8==='IntegerAttributeMetadata'||_0x4bb1e8==='MemoAttributeMetadata'||_0x4bb1e8==='DateTimeAttributeMetadata'||_0x4bb1e8===_0xd1cc('0xce')||_0x4bb1e8==='EntityNameAttributeMetadata'||_0x4bb1e8===_0xd1cc('0xcf')||_0x4bb1e8===_0xd1cc('0xd0')){_0x911b5d['push'](getInputList(_0xa74966,_0x49d1ee,_0x4bb1e8,_0x52a8f7,_0x5c1d72[_0xd1cc('0xc8')],_0x268e86[_0xd1cc('0xc8')],_0x3b89b4));}}});return Promise['all'](_0x911b5d);})[_0xd1cc('0x30')](function(_0x114905){_0x39b6bb=_0x114905[0x0];var _0xca91d1=_0x178140[_0xd1cc('0xac')](_0x509eae)[_0xd1cc('0xac')](_0x39b6bb);var _0x20ad4b={'count':_0xca91d1[_0xd1cc('0x3e')],'rows':_0xca91d1};return _0x20ad4b;})[_0xd1cc('0x30')](respondWithResult(_0x2ba895,null))[_0xd1cc('0x53')](function(_0x3988e8){console[_0xd1cc('0xd1')](_0xd1cc('0xd2')+_0x3988e8);var _0x50ce5f=_0x863758['query'][_0xd1cc('0x1d')]?0x1f4:_0x3988e8[_0xd1cc('0xd3')]||0x1f4;logger[_0xd1cc('0x25')](_0x3988e8['stack']);delete _0x3988e8['name'];if(_0x50ce5f===0x191){_0x50ce5f=0x190;}_0x2ba895[_0xd1cc('0x29')](_0x50ce5f)[_0xd1cc('0x35')](_0x863758[_0xd1cc('0x3a')][_0xd1cc('0x1d')]?{'message':_0xd1cc('0xd4'),'statusCode':_0x3988e8[_0xd1cc('0xd3')]}:_0x3988e8);});};function getSelectList(_0x487e4f,_0x2a38e7,_0x4f3a0b,_0x2ea377,_0x4b2363,_0x2b364b){var _0x1e66ac={'method':_0xd1cc('0xba'),'uri':_0x487e4f+_0xd1cc('0xbe')+_0x2ea377+')/Attributes('+_0x4b2363+_0xd1cc('0xd5')+_0xd1cc('0xd6'),'headers':{'Authorization':'Bearer\x20'+_0x2b364b,'If-None-Match':null,'OData-Version':_0xd1cc('0xbd')},'json':!![]};return rp(_0x1e66ac)['then'](function(_0x418f84){var _0x19ab36=[];var _0x1c3985=_0x418f84['OptionSet'][_0xd1cc('0xd7')];_0x1c3985[_0xd1cc('0xc4')](function(_0x149207){_0x19ab36[_0xd1cc('0xc7')]({'name':_0x149207[_0xd1cc('0xd8')][_0xd1cc('0xd9')][_0xd1cc('0xd8')],'value':String(_0x149207['Value'])});});var _0x5c0801={'id':_0x2a38e7+'_'+_0x418f84['LogicalName'],'name':_0x418f84[_0xd1cc('0xda')][_0xd1cc('0xd9')][_0xd1cc('0xd8')],'custom':![],'options':_0x19ab36};_0x4f3a0b[_0xd1cc('0xc7')](_0x5c0801);return _0x4f3a0b;});}function getBooleanList(_0x5f289a,_0x4c3f5e,_0x4219cf,_0x104b3e,_0x22f259,_0x4babef){var _0x20b063={'method':'GET','uri':_0x5f289a+_0xd1cc('0xbe')+_0x104b3e+_0xd1cc('0xdb')+_0x22f259+_0xd1cc('0xdc'),'headers':{'Authorization':_0xd1cc('0xbc')+_0x4babef,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x20b063)[_0xd1cc('0x30')](function(_0x40514b){var _0x580efb=[];_0x580efb[_0xd1cc('0xc7')]({'name':_0x40514b[_0xd1cc('0xdd')]['TrueOption'][_0xd1cc('0xd8')][_0xd1cc('0xd9')]['Label'],'value':_0xd1cc('0xde')},{'name':_0x40514b[_0xd1cc('0xdd')][_0xd1cc('0xdf')][_0xd1cc('0xd8')][_0xd1cc('0xd9')][_0xd1cc('0xd8')],'value':'false'});var _0x2b5a95={'id':_0x4c3f5e+'_'+_0x40514b[_0xd1cc('0xc3')],'name':_0x40514b['DisplayName'][_0xd1cc('0xd9')][_0xd1cc('0xd8')],'custom':![],'options':_0x580efb};_0x4219cf[_0xd1cc('0xc7')](_0x2b5a95);return _0x4219cf;});}function getInputList(_0x27af70,_0x4b287d,_0x1a0890,_0x44b002,_0x1877b0,_0xaff2ca,_0x43e39b){var _0x55dbd3={'method':_0xd1cc('0xba'),'uri':_0x27af70+_0xd1cc('0xbe')+_0x1877b0+_0xd1cc('0xdb')+_0xaff2ca+_0xd1cc('0xe0')+_0x1a0890+_0xd1cc('0xe1'),'headers':{'Authorization':'Bearer\x20'+_0x43e39b,'If-None-Match':null,'OData-Version':_0xd1cc('0xbd')},'json':!![]};return rp(_0x55dbd3)['then'](function(_0x9d0a21){var _0x54a361={'id':_0x4b287d+'_'+_0x9d0a21[_0xd1cc('0xc3')],'name':_0x9d0a21['DisplayName'][_0xd1cc('0xd9')]?_0x9d0a21[_0xd1cc('0xda')][_0xd1cc('0xd9')][_0xd1cc('0xd8')]:_0x9d0a21[_0xd1cc('0xc3')],'custom':![],'options':[]};_0x44b002[_0xd1cc('0xc7')](_0x54a361);return _0x44b002;});} \ No newline at end of file +var _0xb0e9=['modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientSecret','slice','lastIndexOf','format','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','username','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','GET','EntityDefinitions(','4.0','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','substring','BooleanAttributeMetadata','StringAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','log','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','crypto','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','Dynamics365Account','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','find','create','body','destroy','params','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','subject','regardingobjectid','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname'];(function(_0x887593,_0x277599){var _0x5eed58=function(_0x14f8b8){while(--_0x14f8b8){_0x887593['push'](_0x887593['shift']());}};_0x5eed58(++_0x277599);}(_0xb0e9,0x127));var _0x9b0e=function(_0xb87c1a,_0x35d504){_0xb87c1a=_0xb87c1a-0x0;var _0x532480=_0xb0e9[_0xb87c1a];return _0x532480;};'use strict';var pdf=require(_0x9b0e('0x0'));var emlformat=require(_0x9b0e('0x1'));var rimraf=require(_0x9b0e('0x2'));var zipdir=require(_0x9b0e('0x3'));var jsonpatch=require(_0x9b0e('0x4'));var rp=require('request-promise');var moment=require(_0x9b0e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9b0e('0x6'));var path=require(_0x9b0e('0x7'));var sox=require(_0x9b0e('0x8'));var csv=require(_0x9b0e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9b0e('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b0e('0x9'));var querystring=require('querystring');var Papa=require(_0x9b0e('0xb'));var Redis=require(_0x9b0e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x9b0e('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9b0e('0xe'));var utils=require(_0x9b0e('0xf'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x9b0e('0x10'));var jayson=require(_0x9b0e('0x11'));var client=jayson[_0x9b0e('0x12')][_0x9b0e('0x13')]({'port':0x232a});function checkPasswordPattern(_0x25e86d,_0x3eb3e2,_0x2e890b){if(_0x2e890b){var _0xd4a3eb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd4a3eb[_0x9b0e('0x14')](_0x3eb3e2)){return _0x25e86d;}else{throw new Error(_0x9b0e('0x15'));}}else{return _0x25e86d;}}function respondWithRpcPromise(_0x48c7ae,_0x20ba1e,_0x526565,_0x40c3bb){return new BPromise(function(_0x2b73d0,_0x16d535){var _0x43b95d=_0x40c3bb||client;return _0x43b95d[_0x9b0e('0x16')](_0x48c7ae,_0x526565)[_0x9b0e('0x17')](function(_0x4441ea){logger[_0x9b0e('0x18')]('Dynamics365Account,\x20%s,\x20%s',_0x20ba1e,_0x9b0e('0x19'));logger[_0x9b0e('0x1a')](_0x9b0e('0x1b'),_0x20ba1e,_0x9b0e('0x19'),JSON[_0x9b0e('0x1c')](_0x4441ea));if(_0x4441ea[_0x9b0e('0x1d')]){if(_0x4441ea[_0x9b0e('0x1d')][_0x9b0e('0x1e')]===0x1f4){logger[_0x9b0e('0x1d')](_0x9b0e('0x1f'),_0x20ba1e,_0x4441ea[_0x9b0e('0x1d')][_0x9b0e('0x20')]);return _0x16d535(_0x4441ea[_0x9b0e('0x1d')][_0x9b0e('0x20')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x20ba1e,_0x4441ea[_0x9b0e('0x1d')][_0x9b0e('0x20')]);return _0x2b73d0(_0x4441ea[_0x9b0e('0x1d')][_0x9b0e('0x20')]);}else{logger[_0x9b0e('0x18')]('Dynamics365Account,\x20%s,\x20%s',_0x20ba1e,_0x9b0e('0x19'));_0x2b73d0(_0x4441ea[_0x9b0e('0x21')]['message']);}})[_0x9b0e('0x22')](function(_0x5c6120){logger[_0x9b0e('0x1d')]('Dynamics365Account,\x20%s,\x20%s',_0x20ba1e,_0x5c6120);_0x16d535(_0x5c6120);});});}function respondWithStatusCode(_0x50cace,_0x29781f){_0x29781f=_0x29781f||0xcc;return function(_0x10d162){if(_0x10d162){return _0x50cace[_0x9b0e('0x23')](_0x29781f);}return _0x50cace['status'](_0x29781f)[_0x9b0e('0x24')]();};}function respondWithResult(_0x189519,_0x11f03e){_0x11f03e=_0x11f03e||0xc8;return function(_0x68752){if(_0x68752){return _0x189519[_0x9b0e('0x25')](_0x11f03e)['json'](_0x68752);}};}function respondWithFilteredResult(_0x1bc312,_0x491369){return function(_0x24ce66){if(_0x24ce66){var _0x281d49=_0x24ce66['count'],_0x1a1246=_0x491369[_0x9b0e('0x26')],_0x429774=_0x491369[_0x9b0e('0x26')]+_0x491369[_0x9b0e('0x27')],_0x558664;if(_0x429774>=_0x281d49){_0x429774=_0x281d49;_0x558664=0xc8;}else{_0x558664=0xce;}_0x1bc312['status'](_0x558664);return _0x1bc312[_0x9b0e('0x28')](_0x9b0e('0x29'),_0x1a1246+'-'+_0x429774+'/'+_0x281d49)['json'](_0x24ce66);}return null;};}function patchUpdates(_0x4d0e72){return function(_0x162e18){try{jsonpatch[_0x9b0e('0x2a')](_0x162e18,_0x4d0e72,!![]);}catch(_0x27c9f8){return BPromise[_0x9b0e('0x2b')](_0x27c9f8);}return _0x162e18[_0x9b0e('0x2c')]();};}function saveUpdates(_0x162a2e,_0x45fd5e){return function(_0x3da896){if(_0x3da896){return _0x3da896[_0x9b0e('0x2d')](_0x162a2e)['then'](function(_0x40e32d){return _0x40e32d;});}return null;};}function removeEntity(_0x383e78,_0x19ef5){return function(_0x438d43){if(_0x438d43){return _0x438d43['destroy']()[_0x9b0e('0x17')](function(){_0x383e78[_0x9b0e('0x25')](0xcc)[_0x9b0e('0x24')]();});}};}function handleEntityNotFound(_0x138db0,_0x173671){return function(_0x192d0b){if(!_0x192d0b){_0x138db0['sendStatus'](0x194);}return _0x192d0b;};}function handleError(_0x5359dd,_0x22bee5){_0x22bee5=_0x22bee5||0x1f4;return function(_0x423674){logger[_0x9b0e('0x1d')](_0x423674[_0x9b0e('0x2e')]);if(_0x423674['name']){delete _0x423674[_0x9b0e('0x2f')];}_0x5359dd['status'](_0x22bee5)[_0x9b0e('0x30')](_0x423674);};}exports[_0x9b0e('0x31')]=function(_0x5d2eaa,_0xcb62f4){var _0x44aec2={},_0x32c19c={},_0x1d9bad={'count':0x0,'rows':[]};var _0x2790fc=db[_0x9b0e('0x32')][_0x9b0e('0x33')];_0x32c19c[_0x9b0e('0x34')]=_[_0x9b0e('0x35')](_0x2790fc);_0x32c19c[_0x9b0e('0x36')]=_['keys'](_0x5d2eaa['query']);_0x32c19c[_0x9b0e('0x37')]=_['intersection'](_0x32c19c[_0x9b0e('0x34')],_0x32c19c[_0x9b0e('0x36')]);_0x44aec2[_0x9b0e('0x38')]=_[_0x9b0e('0x39')](_0x32c19c[_0x9b0e('0x34')],qs[_0x9b0e('0x3a')](_0x5d2eaa[_0x9b0e('0x36')][_0x9b0e('0x3a')]));_0x44aec2[_0x9b0e('0x38')]=_0x44aec2[_0x9b0e('0x38')][_0x9b0e('0x3b')]?_0x44aec2['attributes']:_0x32c19c[_0x9b0e('0x34')];if(!_0x5d2eaa[_0x9b0e('0x36')][_0x9b0e('0x3c')](_0x9b0e('0x3d'))){_0x44aec2[_0x9b0e('0x27')]=qs[_0x9b0e('0x27')](_0x5d2eaa['query']['limit']);_0x44aec2[_0x9b0e('0x26')]=qs[_0x9b0e('0x26')](_0x5d2eaa['query'][_0x9b0e('0x26')]);}_0x44aec2['order']=qs[_0x9b0e('0x3e')](_0x5d2eaa['query'][_0x9b0e('0x3e')]);_0x44aec2[_0x9b0e('0x3f')]=qs[_0x9b0e('0x37')](_['pick'](_0x5d2eaa[_0x9b0e('0x36')],_0x32c19c[_0x9b0e('0x37')]));if(_0x5d2eaa[_0x9b0e('0x36')][_0x9b0e('0x40')]){_0x44aec2[_0x9b0e('0x3f')]=_[_0x9b0e('0x41')](_0x44aec2[_0x9b0e('0x3f')],{'$or':_[_0x9b0e('0x42')](_0x2790fc,function(_0x3865c0){if(_0x3865c0[_0x9b0e('0x43')][_0x9b0e('0x44')]!==_0x9b0e('0x45')){var _0x3141c7={};_0x3141c7[_0x3865c0[_0x9b0e('0x46')]]={'$like':'%'+_0x5d2eaa[_0x9b0e('0x36')][_0x9b0e('0x40')]+'%'};return _0x3141c7;}})});}_0x44aec2=_[_0x9b0e('0x41')]({},_0x44aec2,_0x5d2eaa[_0x9b0e('0x47')]);var _0x5b96fb={'where':_0x44aec2[_0x9b0e('0x3f')]};return db[_0x9b0e('0x32')]['count'](_0x5b96fb)[_0x9b0e('0x17')](function(_0x181c7a){_0x1d9bad[_0x9b0e('0x48')]=_0x181c7a;if(_0x5d2eaa[_0x9b0e('0x36')][_0x9b0e('0x49')]){_0x44aec2[_0x9b0e('0x4a')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x44aec2);})[_0x9b0e('0x17')](function(_0x3acde4){_0x1d9bad['rows']=_0x3acde4;return _0x1d9bad;})[_0x9b0e('0x17')](respondWithFilteredResult(_0xcb62f4,_0x44aec2))[_0x9b0e('0x22')](handleError(_0xcb62f4,null));};exports['show']=function(_0x55e9e9,_0x392f00){var _0x4f5b22={'raw':![],'where':{'id':_0x55e9e9['params']['id']}},_0x323163={};_0x323163[_0x9b0e('0x34')]=_[_0x9b0e('0x35')](db['Dynamics365Account'][_0x9b0e('0x33')]);_0x323163[_0x9b0e('0x36')]=_[_0x9b0e('0x35')](_0x55e9e9['query']);_0x323163[_0x9b0e('0x37')]=_[_0x9b0e('0x39')](_0x323163[_0x9b0e('0x34')],_0x323163['query']);_0x4f5b22[_0x9b0e('0x38')]=_['intersection'](_0x323163[_0x9b0e('0x34')],qs[_0x9b0e('0x3a')](_0x55e9e9[_0x9b0e('0x36')]['fields']));_0x4f5b22[_0x9b0e('0x38')]=_0x4f5b22['attributes']['length']?_0x4f5b22[_0x9b0e('0x38')]:_0x323163['model'];if(_0x55e9e9[_0x9b0e('0x36')][_0x9b0e('0x49')]){_0x4f5b22[_0x9b0e('0x4a')]=[{'all':!![]}];}_0x4f5b22=_[_0x9b0e('0x41')]({},_0x4f5b22,_0x55e9e9[_0x9b0e('0x47')]);return db[_0x9b0e('0x32')][_0x9b0e('0x4b')](_0x4f5b22)[_0x9b0e('0x17')](handleEntityNotFound(_0x392f00,null))[_0x9b0e('0x17')](respondWithResult(_0x392f00,null))[_0x9b0e('0x22')](handleError(_0x392f00,null));};exports[_0x9b0e('0x4c')]=function(_0x48f9df,_0x49cfbd){return db[_0x9b0e('0x32')][_0x9b0e('0x4c')](_0x48f9df[_0x9b0e('0x4d')],{})[_0x9b0e('0x17')](respondWithResult(_0x49cfbd,0xc9))[_0x9b0e('0x22')](handleError(_0x49cfbd,null));};exports[_0x9b0e('0x2d')]=function(_0x2e0911,_0x2fb694){if(_0x2e0911[_0x9b0e('0x4d')]['id']){delete _0x2e0911[_0x9b0e('0x4d')]['id'];}return db[_0x9b0e('0x32')]['find']({'where':{'id':_0x2e0911['params']['id']}})[_0x9b0e('0x17')](handleEntityNotFound(_0x2fb694,null))[_0x9b0e('0x17')](saveUpdates(_0x2e0911['body'],null))['then'](respondWithResult(_0x2fb694,null))['catch'](handleError(_0x2fb694,null));};exports[_0x9b0e('0x4e')]=function(_0x37c4a1,_0x412a7f){return db[_0x9b0e('0x32')]['find']({'where':{'id':_0x37c4a1[_0x9b0e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x412a7f,null))[_0x9b0e('0x17')](removeEntity(_0x412a7f,null))[_0x9b0e('0x22')](handleError(_0x412a7f,null));};exports[_0x9b0e('0x50')]=function(_0x39c426,_0x24cf50,_0x247198){var _0x5af7e7={};var _0x4142c0={};var _0x101cba;var _0x1cc022;return db[_0x9b0e('0x32')][_0x9b0e('0x51')]({'where':{'id':_0x39c426[_0x9b0e('0x4f')]['id']}})[_0x9b0e('0x17')](handleEntityNotFound(_0x24cf50,null))['then'](function(_0x5859af){if(_0x5859af){_0x101cba=_0x5859af;_0x4142c0[_0x9b0e('0x34')]=_[_0x9b0e('0x35')](db['Dynamics365Configuration']['rawAttributes']);_0x4142c0[_0x9b0e('0x36')]=_[_0x9b0e('0x35')](_0x39c426[_0x9b0e('0x36')]);_0x4142c0[_0x9b0e('0x37')]=_[_0x9b0e('0x39')](_0x4142c0[_0x9b0e('0x34')],_0x4142c0[_0x9b0e('0x36')]);_0x5af7e7[_0x9b0e('0x38')]=_[_0x9b0e('0x39')](_0x4142c0['model'],qs[_0x9b0e('0x3a')](_0x39c426[_0x9b0e('0x36')][_0x9b0e('0x3a')]));_0x5af7e7['attributes']=_0x5af7e7[_0x9b0e('0x38')][_0x9b0e('0x3b')]?_0x5af7e7[_0x9b0e('0x38')]:_0x4142c0[_0x9b0e('0x34')];_0x5af7e7['order']=qs[_0x9b0e('0x3e')](_0x39c426['query']['sort']);_0x5af7e7['where']=qs[_0x9b0e('0x37')](_[_0x9b0e('0x52')](_0x39c426[_0x9b0e('0x36')],_0x4142c0[_0x9b0e('0x37')]));if(_0x39c426[_0x9b0e('0x36')][_0x9b0e('0x40')]){_0x5af7e7[_0x9b0e('0x3f')]=_[_0x9b0e('0x41')](_0x5af7e7[_0x9b0e('0x3f')],{'$or':_[_0x9b0e('0x42')](_0x5af7e7[_0x9b0e('0x38')],function(_0x162fd0){var _0x31b02e={};_0x31b02e[_0x162fd0]={'$like':'%'+_0x39c426[_0x9b0e('0x36')][_0x9b0e('0x40')]+'%'};return _0x31b02e;})});}_0x5af7e7=_[_0x9b0e('0x41')]({},_0x5af7e7,_0x39c426[_0x9b0e('0x47')]);return _0x101cba[_0x9b0e('0x50')](_0x5af7e7);}})[_0x9b0e('0x17')](function(_0x4151eb){if(_0x4151eb){_0x1cc022=_0x4151eb[_0x9b0e('0x3b')];if(!_0x39c426[_0x9b0e('0x36')][_0x9b0e('0x3c')](_0x9b0e('0x3d'))){_0x5af7e7[_0x9b0e('0x27')]=qs['limit'](_0x39c426[_0x9b0e('0x36')]['limit']);_0x5af7e7[_0x9b0e('0x26')]=qs['offset'](_0x39c426[_0x9b0e('0x36')][_0x9b0e('0x26')]);}return _0x101cba[_0x9b0e('0x50')](_0x5af7e7);}})[_0x9b0e('0x17')](function(_0x3959bf){if(_0x3959bf){return _0x3959bf?{'count':_0x1cc022,'rows':_0x3959bf}:null;}})[_0x9b0e('0x17')](respondWithResult(_0x24cf50,null))[_0x9b0e('0x22')](handleError(_0x24cf50,null));};exports[_0x9b0e('0x53')]=function(_0x33f596,_0x282536,_0x4b7d98){if(_0x33f596[_0x9b0e('0x4d')]['id']){delete _0x33f596['body']['id'];}return db[_0x9b0e('0x32')]['findOne']({'where':{'id':_0x33f596[_0x9b0e('0x4f')]['id']}})[_0x9b0e('0x17')](handleEntityNotFound(_0x282536,null))['then'](function(_0x3c3f6b){if(_0x3c3f6b){_0x33f596['body'][_0x9b0e('0x54')]=_0x3c3f6b['id'];_0x33f596[_0x9b0e('0x4d')][_0x9b0e('0x55')]=integrations[_0x9b0e('0x56')](_0x33f596[_0x9b0e('0x4d')][_0x9b0e('0x57')],_0x33f596['body'][_0x9b0e('0x43')]);_0x33f596[_0x9b0e('0x4d')][_0x9b0e('0x58')]=integrations['getDescriptions'](_0x33f596['body']['channel'],_0x33f596[_0x9b0e('0x4d')][_0x9b0e('0x43')]);return db['Dynamics365Configuration']['create'](_0x33f596['body'],{'include':[{'model':db[_0x9b0e('0x59')],'as':_0x9b0e('0x55')},{'model':db['Dynamics365Field'],'as':_0x9b0e('0x58')}]});}return null;})[_0x9b0e('0x17')](respondWithResult(_0x282536,null))[_0x9b0e('0x22')](handleError(_0x282536,null));};exports[_0x9b0e('0x5a')]=function(_0x4dbeb7,_0x43ea67,_0x4dfa53){var _0x8eaeda=_0x4dbeb7['query'][_0x9b0e('0x5b')];var _0x252dde=_0x8eaeda===_0x9b0e('0x5c')?_0x9b0e('0x5d'):_0x9b0e('0x5e');var _0x2ebb8a='';var _0x122fca='';var _0x4bb73e='';var _0x416ca5='';var _0x786259='';var _0x3089fa='';var _0x3fca07='';var _0x1d2bf2='';var _0x45ae08=[_0x9b0e('0x5f'),_0x9b0e('0x60'),_0x9b0e('0x61'),_0x9b0e('0x62'),'caseorigincode',_0x9b0e('0x63'),'phonenumber',_0x9b0e('0x64'),'directioncode',_0x9b0e('0x65')];var _0x5cffb6=['accountidname',_0x9b0e('0x66'),_0x9b0e('0x67'),'billedserviceunits',_0x9b0e('0x68'),_0x9b0e('0x69'),'contractdetailidname',_0x9b0e('0x6a'),_0x9b0e('0x6b'),_0x9b0e('0x6c'),_0x9b0e('0x6d'),_0x9b0e('0x6e'),_0x9b0e('0x6f'),_0x9b0e('0x70'),_0x9b0e('0x71'),_0x9b0e('0x72'),_0x9b0e('0x73'),'customeridyominame',_0x9b0e('0x74'),_0x9b0e('0x75'),'entityimage_timestamp',_0x9b0e('0x76'),_0x9b0e('0x77'),_0x9b0e('0x78'),_0x9b0e('0x79'),_0x9b0e('0x7a'),'importsequencenumber',_0x9b0e('0x7b'),_0x9b0e('0x7c'),_0x9b0e('0x7d'),'masteridname',_0x9b0e('0x7e'),_0x9b0e('0x7f'),_0x9b0e('0x80'),_0x9b0e('0x81'),'modifiedon',_0x9b0e('0x82'),_0x9b0e('0x83'),_0x9b0e('0x84'),_0x9b0e('0x85'),'numberofchildincidents',_0x9b0e('0x86'),'overriddencreatedon',_0x9b0e('0x87'),_0x9b0e('0x88'),_0x9b0e('0x89'),_0x9b0e('0x8a'),_0x9b0e('0x8b'),_0x9b0e('0x8c'),_0x9b0e('0x8d'),_0x9b0e('0x8e'),_0x9b0e('0x8f'),_0x9b0e('0x90'),_0x9b0e('0x91'),_0x9b0e('0x92'),_0x9b0e('0x93'),_0x9b0e('0x94'),_0x9b0e('0x95'),_0x9b0e('0x96'),'slaname',_0x9b0e('0x97'),_0x9b0e('0x98'),'statuscode',_0x9b0e('0x99'),_0x9b0e('0x9a'),'timezoneruleversionnumber',_0x9b0e('0x9b'),_0x9b0e('0x9c'),_0x9b0e('0x9d'),_0x9b0e('0x9e')];var _0x47ec4c=_0x45ae08[_0x9b0e('0x9f')](_0x5cffb6);return db[_0x9b0e('0x32')][_0x9b0e('0x51')]({'where':{'id':_0x4dbeb7[_0x9b0e('0x4f')]['id']},'attributes':['id','username',_0x9b0e('0xa0'),_0x9b0e('0xa1'),_0x9b0e('0xa2'),'clientId',_0x9b0e('0xa3')]})[_0x9b0e('0x17')](handleEntityNotFound(_0x43ea67,null))[_0x9b0e('0x17')](function(_0x2dcb5f){if(_0x2dcb5f){_0x1d2bf2=_0x2dcb5f[_0x9b0e('0xa1')];var _0x2364e2=_0x1d2bf2[_0x9b0e('0xa4')](-0x1);if(_0x2364e2==='/'){_0x1d2bf2=_0x1d2bf2['substring'](0x0,_0x1d2bf2[_0x9b0e('0xa5')](_0x2364e2));}_0x3fca07=util[_0x9b0e('0xa6')]('%s/api/data/v9.0/',_0x1d2bf2);var _0x1d4a9f={'method':_0x9b0e('0xa7'),'uri':_0x9b0e('0xa8')+_0x2dcb5f[_0x9b0e('0xa2')]+_0x9b0e('0xa9'),'form':{'client_id':_0x2dcb5f[_0x9b0e('0xaa')],'resource':_0x1d2bf2,'username':_0x2dcb5f[_0x9b0e('0xab')],'password':_0x2dcb5f[_0x9b0e('0xa0')],'grant_type':_0x9b0e('0xa0'),'client_secret':_0x2dcb5f[_0x9b0e('0xa3')]},'json':!![]};return rp(_0x1d4a9f);}})[_0x9b0e('0x17')](function(_0x5bbc12){_0x3089fa=_0x5bbc12['access_token'];var _0x30b7cf={'method':'GET','uri':encodeURI(_0x3fca07+_0x9b0e('0xac')+_0x252dde+'\x27'),'headers':{'Authorization':_0x9b0e('0xad')+_0x3089fa,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x30b7cf);})['then'](function(_0x3e5233){var _0xb5696=_0x3e5233['value'][0x0];var _0x419b4e=_0xb5696['MetadataId'];var _0x60f109={'method':_0x9b0e('0xae'),'uri':_0x3fca07+_0x9b0e('0xaf')+_0x419b4e+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x9b0e('0xad')+_0x3089fa,'If-None-Match':null,'OData-Version':_0x9b0e('0xb0')},'json':!![]};return rp(_0x60f109);})[_0x9b0e('0x17')](function(_0x3f2e5d){_0x2ebb8a=_0x3f2e5d;_0x122fca=_0x2ebb8a['Attributes'];_0x122fca=_[_0x9b0e('0xb1')](_0x122fca,function(_0x185866){return!_0x47ec4c[_0x9b0e('0xb2')](_0x185866[_0x9b0e('0xb3')]);});var _0x4c77e4=[];var _0x5d9063=[];_0x122fca[_0x9b0e('0xb4')](function(_0x3de041){if(_0x3de041[_0x9b0e('0xb5')]){var _0x4fa107=_0x3de041[_0x9b0e('0xb5')]['substring'](_0x3de041['@odata.type'][_0x9b0e('0xa5')]('.')+0x1);if(_0x4fa107===_0x9b0e('0xb6')){_0x4c77e4[_0x9b0e('0xb7')](getSelectList(_0x3fca07,_0x8eaeda,_0x5d9063,_0x2ebb8a['MetadataId'],_0x3de041[_0x9b0e('0xb8')],_0x3089fa));}}});return Promise[_0x9b0e('0xb9')](_0x4c77e4);})[_0x9b0e('0x17')](function(_0x44f16b){_0x4bb73e=_0x44f16b[0x0];var _0x5d5add=[];var _0xca1b46=[];_0x122fca[_0x9b0e('0xb4')](function(_0x544af0){if(!_[_0x9b0e('0xba')](_0x544af0[_0x9b0e('0xb5')])){var _0x6975bc=_0x544af0[_0x9b0e('0xb5')][_0x9b0e('0xbb')](_0x544af0['@odata.type'][_0x9b0e('0xa5')]('.')+0x1);if(_0x6975bc===_0x9b0e('0xbc')){_0x5d5add[_0x9b0e('0xb7')](getBooleanList(_0x3fca07,_0x8eaeda,_0xca1b46,_0x2ebb8a[_0x9b0e('0xb8')],_0x544af0[_0x9b0e('0xb8')],_0x3089fa));}}});return Promise[_0x9b0e('0xb9')](_0x5d5add);})[_0x9b0e('0x17')](function(_0x23863d){_0x416ca5=_0x23863d[0x0];var _0x511e52=[];var _0x8bf463=[];_0x122fca[_0x9b0e('0xb4')](function(_0x293df2){if(_0x293df2[_0x9b0e('0xb5')]){var _0x2e4106=_0x293df2[_0x9b0e('0xb5')][_0x9b0e('0xbb')](_0x293df2[_0x9b0e('0xb5')][_0x9b0e('0xa5')]('.')+0x1);if(_0x2e4106===_0x9b0e('0xbd')||_0x2e4106==='DoubleAttributeMetadata'||_0x2e4106==='BigIntAttributeMetadata'||_0x2e4106===_0x9b0e('0xbe')||_0x2e4106===_0x9b0e('0xbf')||_0x2e4106===_0x9b0e('0xc0')||_0x2e4106==='StatusAttributeMetadata'||_0x2e4106==='EntityNameAttributeMetadata'||_0x2e4106===_0x9b0e('0xc1')||_0x2e4106===_0x9b0e('0xc2')){_0x511e52[_0x9b0e('0xb7')](getInputList(_0x3fca07,_0x8eaeda,_0x2e4106,_0x8bf463,_0x2ebb8a['MetadataId'],_0x293df2[_0x9b0e('0xb8')],_0x3089fa));}}});return Promise[_0x9b0e('0xb9')](_0x511e52);})['then'](function(_0x52b324){_0x786259=_0x52b324[0x0];var _0x1eabad=_0x4bb73e['concat'](_0x416ca5)['concat'](_0x786259);var _0x101a51={'count':_0x1eabad[_0x9b0e('0x3b')],'rows':_0x1eabad};return _0x101a51;})[_0x9b0e('0x17')](respondWithResult(_0x43ea67,null))[_0x9b0e('0x22')](function(_0x576f5d){console[_0x9b0e('0xc3')]('Dynamics365\x20error:\x20'+_0x576f5d);var _0x40e636=_0x4dbeb7[_0x9b0e('0x36')][_0x9b0e('0x14')]?0x1f4:_0x576f5d[_0x9b0e('0xc4')]||0x1f4;logger[_0x9b0e('0x1d')](_0x576f5d[_0x9b0e('0x2e')]);delete _0x576f5d[_0x9b0e('0x2f')];if(_0x40e636===0x191){_0x40e636=0x190;}_0x43ea67['status'](_0x40e636)[_0x9b0e('0x30')](_0x4dbeb7[_0x9b0e('0x36')][_0x9b0e('0x14')]?{'message':_0x9b0e('0xc5'),'statusCode':_0x576f5d[_0x9b0e('0xc4')]}:_0x576f5d);});};function getSelectList(_0x2f97e6,_0x587c29,_0x459d83,_0x1be41a,_0xf2b4d6,_0xce60ab){var _0x1e75f8={'method':_0x9b0e('0xae'),'uri':_0x2f97e6+'EntityDefinitions('+_0x1be41a+_0x9b0e('0xc6')+_0xf2b4d6+_0x9b0e('0xc7')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x9b0e('0xad')+_0xce60ab,'If-None-Match':null,'OData-Version':_0x9b0e('0xb0')},'json':!![]};return rp(_0x1e75f8)['then'](function(_0x56459b){var _0x3b2881=[];var _0x1470af=_0x56459b[_0x9b0e('0xc8')][_0x9b0e('0xc9')];_0x1470af['forEach'](function(_0x4893d4){_0x3b2881[_0x9b0e('0xb7')]({'name':_0x4893d4[_0x9b0e('0xca')][_0x9b0e('0xcb')][_0x9b0e('0xca')],'value':String(_0x4893d4[_0x9b0e('0xcc')])});});var _0x9a6d05={'id':_0x587c29+'_'+_0x56459b[_0x9b0e('0xb3')],'name':_0x56459b['DisplayName'][_0x9b0e('0xcb')][_0x9b0e('0xca')],'custom':![],'options':_0x3b2881};_0x459d83[_0x9b0e('0xb7')](_0x9a6d05);return _0x459d83;});}function getBooleanList(_0x5e4a6d,_0x35c140,_0x4c349d,_0x7b72a,_0x5da0b2,_0x292c00){var _0x47762c={'method':_0x9b0e('0xae'),'uri':_0x5e4a6d+_0x9b0e('0xaf')+_0x7b72a+_0x9b0e('0xc6')+_0x5da0b2+_0x9b0e('0xcd'),'headers':{'Authorization':_0x9b0e('0xad')+_0x292c00,'If-None-Match':null,'OData-Version':_0x9b0e('0xb0')},'json':!![]};return rp(_0x47762c)[_0x9b0e('0x17')](function(_0x4dc7c1){var _0xb04a4d=[];_0xb04a4d[_0x9b0e('0xb7')]({'name':_0x4dc7c1[_0x9b0e('0xc8')][_0x9b0e('0xce')][_0x9b0e('0xca')][_0x9b0e('0xcb')][_0x9b0e('0xca')],'value':_0x9b0e('0xcf')},{'name':_0x4dc7c1[_0x9b0e('0xc8')][_0x9b0e('0xd0')]['Label']['UserLocalizedLabel'][_0x9b0e('0xca')],'value':_0x9b0e('0xd1')});var _0x52d8cd={'id':_0x35c140+'_'+_0x4dc7c1['LogicalName'],'name':_0x4dc7c1[_0x9b0e('0xd2')][_0x9b0e('0xcb')][_0x9b0e('0xca')],'custom':![],'options':_0xb04a4d};_0x4c349d['push'](_0x52d8cd);return _0x4c349d;});}function getInputList(_0xffe139,_0x46bc8,_0x1facf4,_0x7be756,_0x585e5a,_0x11eb3d,_0x140488){var _0x2100cd={'method':_0x9b0e('0xae'),'uri':_0xffe139+'EntityDefinitions('+_0x585e5a+_0x9b0e('0xc6')+_0x11eb3d+_0x9b0e('0xd3')+_0x1facf4+_0x9b0e('0xd4'),'headers':{'Authorization':_0x9b0e('0xad')+_0x140488,'If-None-Match':null,'OData-Version':_0x9b0e('0xb0')},'json':!![]};return rp(_0x2100cd)[_0x9b0e('0x17')](function(_0x2799bf){var _0x5d7546={'id':_0x46bc8+'_'+_0x2799bf[_0x9b0e('0xb3')],'name':_0x2799bf[_0x9b0e('0xd2')][_0x9b0e('0xcb')]?_0x2799bf[_0x9b0e('0xd2')]['UserLocalizedLabel'][_0x9b0e('0xca')]:_0x2799bf[_0x9b0e('0xb3')],'custom':![],'options':[]};_0x7be756[_0x9b0e('0xb7')](_0x5d7546);return _0x7be756;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 3ed8c95..e807c77 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4169=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0x4169,0x154));var _0x9416=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4169[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9416('0x0'));var util=require(_0x9416('0x1'));var logger=require(_0x9416('0x2'))(_0x9416('0x3'));var moment=require(_0x9416('0x4'));var BPromise=require(_0x9416('0x5'));var rp=require(_0x9416('0x6'));var fs=require('fs');var path=require(_0x9416('0x7'));var rimraf=require(_0x9416('0x8'));var config=require(_0x9416('0x9'));var attributes=require('./intDynamics365Account.attributes');var integrations=require(_0x9416('0xa'));module[_0x9416('0xb')]=function(_0x1d85f0,_0x55e4b0){return _0x1d85f0[_0x9416('0xc')](_0x9416('0xd'),attributes,{'tableName':_0x9416('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1be0=['../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes'];(function(_0xfef6d6,_0x226c01){var _0x44045b=function(_0x185049){while(--_0x185049){_0xfef6d6['push'](_0xfef6d6['shift']());}};_0x44045b(++_0x226c01);}(_0x1be0,0xaa));var _0x01be=function(_0x33f22a,_0x25b8ac){_0x33f22a=_0x33f22a-0x0;var _0x275abe=_0x1be0[_0x33f22a];return _0x275abe;};'use strict';var _=require(_0x01be('0x0'));var util=require('util');var logger=require(_0x01be('0x1'))(_0x01be('0x2'));var moment=require(_0x01be('0x3'));var BPromise=require(_0x01be('0x4'));var rp=require(_0x01be('0x5'));var fs=require('fs');var path=require(_0x01be('0x6'));var rimraf=require(_0x01be('0x7'));var config=require(_0x01be('0x8'));var attributes=require(_0x01be('0x9'));var integrations=require(_0x01be('0xa'));module[_0x01be('0xb')]=function(_0x57438e,_0x1bb6e5){return _0x57438e[_0x01be('0xc')](_0x01be('0xd'),attributes,{'tableName':_0x01be('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index b58a1a8..a487b68 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.rpc.js +++ b/server/api/intDynamics365Account/intDynamics365Account.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22ed=['code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','limit','include','map','model','then','debug','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x46c396,_0x3bbc18){var _0x56aacb=function(_0x165f69){while(--_0x165f69){_0x46c396['push'](_0x46c396['shift']());}};_0x56aacb(++_0x3bbc18);}(_0x22ed,0x1a9));var _0xd22e=function(_0x316cfd,_0x1dfe9d){_0x316cfd=_0x316cfd-0x0;var _0x50d52d=_0x22ed[_0x316cfd];return _0x50d52d;};'use strict';var _=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var moment=require(_0xd22e('0x2'));var BPromise=require(_0xd22e('0x3'));var rs=require(_0xd22e('0x4'));var fs=require('fs');var Redis=require(_0xd22e('0x5'));var db=require(_0xd22e('0x6'))['db'];var utils=require(_0xd22e('0x7'));var logger=require(_0xd22e('0x8'))(_0xd22e('0x9'));var config=require(_0xd22e('0xa'));var jayson=require(_0xd22e('0xb'));var client=jayson['client'][_0xd22e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3185f2,_0x5d99d5,_0x405361){return new BPromise(function(_0x3378a3,_0x5dd614){return client[_0xd22e('0xd')](_0x3185f2,_0x405361)['then'](function(_0x5444e8){logger[_0xd22e('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x5d99d5,'request\x20sent');logger['debug'](_0xd22e('0xf'),_0x5d99d5,_0xd22e('0x10'),JSON[_0xd22e('0x11')](_0x5444e8));if(_0x5444e8[_0xd22e('0x12')]){if(_0x5444e8['error'][_0xd22e('0x13')]===0x1f4){logger[_0xd22e('0x12')](_0xd22e('0x14'),_0x5d99d5,_0x5444e8[_0xd22e('0x12')][_0xd22e('0x15')]);return _0x5dd614(_0x5444e8[_0xd22e('0x12')]['message']);}logger[_0xd22e('0x12')](_0xd22e('0x14'),_0x5d99d5,_0x5444e8[_0xd22e('0x12')]['message']);return _0x3378a3(_0x5444e8[_0xd22e('0x12')]['message']);}else{logger[_0xd22e('0xe')](_0xd22e('0x14'),_0x5d99d5,_0xd22e('0x10'));_0x3378a3(_0x5444e8[_0xd22e('0x16')][_0xd22e('0x15')]);}})[_0xd22e('0x17')](function(_0x3cbd14){logger[_0xd22e('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x5d99d5,_0x3cbd14);_0x5dd614(_0x3cbd14);});});}exports[_0xd22e('0x18')]=function(_0x288345){var _0x2ee456=this;return new Promise(function(_0x1a35bb,_0x11d356){return db[_0xd22e('0x19')]['findAll']({'raw':_0x288345[_0xd22e('0x1a')]?_0x288345['options'][_0xd22e('0x1b')]===undefined?!![]:![]:!![],'where':_0x288345['options']?_0x288345['options'][_0xd22e('0x1c')]||null:null,'attributes':_0x288345['options']?_0x288345['options'][_0xd22e('0x1d')]||null:null,'limit':_0x288345[_0xd22e('0x1a')]?_0x288345[_0xd22e('0x1a')][_0xd22e('0x1e')]||null:null,'include':_0x288345['options']?_0x288345[_0xd22e('0x1a')][_0xd22e('0x1f')]?_[_0xd22e('0x20')](_0x288345['options'][_0xd22e('0x1f')],function(_0x41b668){return{'model':db[_0x41b668[_0xd22e('0x21')]],'as':_0x41b668['as'],'attributes':_0x41b668[_0xd22e('0x1d')],'include':_0x41b668['include']?_[_0xd22e('0x20')](_0x41b668[_0xd22e('0x1f')],function(_0x11ec41){return{'model':db[_0x11ec41[_0xd22e('0x21')]],'as':_0x11ec41['as'],'attributes':_0x11ec41[_0xd22e('0x1d')],'include':_0x11ec41[_0xd22e('0x1f')]?_[_0xd22e('0x20')](_0x11ec41['include'],function(_0xc57b5b){return{'model':db[_0xc57b5b[_0xd22e('0x21')]],'as':_0xc57b5b['as'],'attributes':_0xc57b5b[_0xd22e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd22e('0x22')](function(_0x36d7ef){logger[_0xd22e('0xe')](_0xd22e('0x18'),_0x288345);logger[_0xd22e('0x23')]('GetDynamics365Account',_0x288345,JSON[_0xd22e('0x11')](_0x36d7ef));_0x1a35bb(_0x36d7ef);})[_0xd22e('0x17')](function(_0x3be9cc){logger[_0xd22e('0x12')]('GetDynamics365Account',_0x3be9cc['message'],_0x288345);_0x11d356(_0x2ee456[_0xd22e('0x12')](0x1f4,_0x3be9cc[_0xd22e('0x15')]));});});};exports[_0xd22e('0x24')]=function(_0x2183c0){var _0x3296b3=this;return new Promise(function(_0xeb7fe3,_0x4b6fea){return db[_0xd22e('0x19')]['find']({'raw':_0x2183c0['options']?_0x2183c0['options'][_0xd22e('0x1b')]===undefined?!![]:![]:!![],'where':_0x2183c0[_0xd22e('0x1a')]?_0x2183c0[_0xd22e('0x1a')][_0xd22e('0x1c')]||null:null,'attributes':_0x2183c0[_0xd22e('0x1a')]?_0x2183c0[_0xd22e('0x1a')]['attributes']||null:null,'include':_0x2183c0['options']?_0x2183c0[_0xd22e('0x1a')][_0xd22e('0x1f')]?_[_0xd22e('0x20')](_0x2183c0[_0xd22e('0x1a')][_0xd22e('0x1f')],function(_0x13e421){return{'model':db[_0x13e421[_0xd22e('0x21')]],'as':_0x13e421['as'],'attributes':_0x13e421[_0xd22e('0x1d')],'include':_0x13e421['include']?_[_0xd22e('0x20')](_0x13e421['include'],function(_0x24c07a){return{'model':db[_0x24c07a[_0xd22e('0x21')]],'as':_0x24c07a['as'],'attributes':_0x24c07a[_0xd22e('0x1d')],'include':_0x24c07a[_0xd22e('0x1f')]?_[_0xd22e('0x20')](_0x24c07a[_0xd22e('0x1f')],function(_0x15a400){return{'model':db[_0x15a400['model']],'as':_0x15a400['as'],'attributes':_0x15a400['attributes']};}):[]};}):[]};}):[]:[]})[_0xd22e('0x22')](function(_0x20c36c){logger[_0xd22e('0xe')](_0xd22e('0x24'),_0x2183c0);logger[_0xd22e('0x23')](_0xd22e('0x24'),_0x2183c0,JSON[_0xd22e('0x11')](_0x20c36c));_0xeb7fe3(_0x20c36c);})[_0xd22e('0x17')](function(_0x238320){logger[_0xd22e('0x12')](_0xd22e('0x24'),_0x238320[_0xd22e('0x15')],_0x2183c0);_0x4b6fea(_0x3296b3[_0xd22e('0x12')](0x1f4,_0x238320[_0xd22e('0x15')]));});});}; \ No newline at end of file +var _0xbf25=['raw','where','attributes','limit','include','map','model','GetDynamics365Account','ShowDynamics365Account','Dynamics365Account','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options'];(function(_0x30b045,_0x5cea47){var _0x290a8b=function(_0x3997cd){while(--_0x3997cd){_0x30b045['push'](_0x30b045['shift']());}};_0x290a8b(++_0x5cea47);}(_0xbf25,0x15e));var _0x5bf2=function(_0x51540d,_0x2f5eb6){_0x51540d=_0x51540d-0x0;var _0x5e7a5f=_0xbf25[_0x51540d];return _0x5e7a5f;};'use strict';var _=require(_0x5bf2('0x0'));var util=require('util');var moment=require(_0x5bf2('0x1'));var BPromise=require(_0x5bf2('0x2'));var rs=require(_0x5bf2('0x3'));var fs=require('fs');var Redis=require(_0x5bf2('0x4'));var db=require(_0x5bf2('0x5'))['db'];var utils=require(_0x5bf2('0x6'));var logger=require('../../config/logger')(_0x5bf2('0x7'));var config=require('../../config/environment');var jayson=require(_0x5bf2('0x8'));var client=jayson[_0x5bf2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29c6c8,_0x382b52,_0x3fa095){return new BPromise(function(_0x53acc6,_0x45af34){return client[_0x5bf2('0xa')](_0x29c6c8,_0x3fa095)[_0x5bf2('0xb')](function(_0x4b8772){logger[_0x5bf2('0xc')](_0x5bf2('0xd'),_0x382b52,_0x5bf2('0xe'));logger[_0x5bf2('0xf')](_0x5bf2('0x10'),_0x382b52,_0x5bf2('0xe'),JSON[_0x5bf2('0x11')](_0x4b8772));if(_0x4b8772[_0x5bf2('0x12')]){if(_0x4b8772[_0x5bf2('0x12')][_0x5bf2('0x13')]===0x1f4){logger[_0x5bf2('0x12')](_0x5bf2('0xd'),_0x382b52,_0x4b8772[_0x5bf2('0x12')]['message']);return _0x45af34(_0x4b8772['error'][_0x5bf2('0x14')]);}logger[_0x5bf2('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x382b52,_0x4b8772[_0x5bf2('0x12')][_0x5bf2('0x14')]);return _0x53acc6(_0x4b8772[_0x5bf2('0x12')][_0x5bf2('0x14')]);}else{logger[_0x5bf2('0xc')](_0x5bf2('0xd'),_0x382b52,_0x5bf2('0xe'));_0x53acc6(_0x4b8772[_0x5bf2('0x15')][_0x5bf2('0x14')]);}})[_0x5bf2('0x16')](function(_0x271a6d){logger[_0x5bf2('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x382b52,_0x271a6d);_0x45af34(_0x271a6d);});});}exports['GetDynamics365Account']=function(_0x2f87ff){var _0x4af54a=this;return new Promise(function(_0x3df0cd,_0x300834){return db['Dynamics365Account']['findAll']({'raw':_0x2f87ff[_0x5bf2('0x17')]?_0x2f87ff[_0x5bf2('0x17')][_0x5bf2('0x18')]===undefined?!![]:![]:!![],'where':_0x2f87ff[_0x5bf2('0x17')]?_0x2f87ff[_0x5bf2('0x17')][_0x5bf2('0x19')]||null:null,'attributes':_0x2f87ff[_0x5bf2('0x17')]?_0x2f87ff[_0x5bf2('0x17')][_0x5bf2('0x1a')]||null:null,'limit':_0x2f87ff['options']?_0x2f87ff['options'][_0x5bf2('0x1b')]||null:null,'include':_0x2f87ff[_0x5bf2('0x17')]?_0x2f87ff[_0x5bf2('0x17')][_0x5bf2('0x1c')]?_[_0x5bf2('0x1d')](_0x2f87ff[_0x5bf2('0x17')][_0x5bf2('0x1c')],function(_0x2eea63){return{'model':db[_0x2eea63[_0x5bf2('0x1e')]],'as':_0x2eea63['as'],'attributes':_0x2eea63[_0x5bf2('0x1a')],'include':_0x2eea63[_0x5bf2('0x1c')]?_[_0x5bf2('0x1d')](_0x2eea63[_0x5bf2('0x1c')],function(_0x5ae161){return{'model':db[_0x5ae161[_0x5bf2('0x1e')]],'as':_0x5ae161['as'],'attributes':_0x5ae161['attributes'],'include':_0x5ae161[_0x5bf2('0x1c')]?_[_0x5bf2('0x1d')](_0x5ae161['include'],function(_0xc028a0){return{'model':db[_0xc028a0[_0x5bf2('0x1e')]],'as':_0xc028a0['as'],'attributes':_0xc028a0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x8c54cd){logger[_0x5bf2('0xc')](_0x5bf2('0x1f'),_0x2f87ff);logger[_0x5bf2('0xf')]('GetDynamics365Account',_0x2f87ff,JSON[_0x5bf2('0x11')](_0x8c54cd));_0x3df0cd(_0x8c54cd);})[_0x5bf2('0x16')](function(_0x3cb9e6){logger[_0x5bf2('0x12')](_0x5bf2('0x1f'),_0x3cb9e6[_0x5bf2('0x14')],_0x2f87ff);_0x300834(_0x4af54a['error'](0x1f4,_0x3cb9e6[_0x5bf2('0x14')]));});});};exports[_0x5bf2('0x20')]=function(_0x44a6a3){var _0x59ac8b=this;return new Promise(function(_0x7023ae,_0x432de6){return db[_0x5bf2('0x21')]['find']({'raw':_0x44a6a3['options']?_0x44a6a3['options'][_0x5bf2('0x18')]===undefined?!![]:![]:!![],'where':_0x44a6a3[_0x5bf2('0x17')]?_0x44a6a3[_0x5bf2('0x17')][_0x5bf2('0x19')]||null:null,'attributes':_0x44a6a3[_0x5bf2('0x17')]?_0x44a6a3['options']['attributes']||null:null,'include':_0x44a6a3[_0x5bf2('0x17')]?_0x44a6a3[_0x5bf2('0x17')][_0x5bf2('0x1c')]?_[_0x5bf2('0x1d')](_0x44a6a3[_0x5bf2('0x17')][_0x5bf2('0x1c')],function(_0x3f2546){return{'model':db[_0x3f2546[_0x5bf2('0x1e')]],'as':_0x3f2546['as'],'attributes':_0x3f2546[_0x5bf2('0x1a')],'include':_0x3f2546[_0x5bf2('0x1c')]?_[_0x5bf2('0x1d')](_0x3f2546[_0x5bf2('0x1c')],function(_0x4076de){return{'model':db[_0x4076de['model']],'as':_0x4076de['as'],'attributes':_0x4076de[_0x5bf2('0x1a')],'include':_0x4076de['include']?_['map'](_0x4076de['include'],function(_0x5e472c){return{'model':db[_0x5e472c[_0x5bf2('0x1e')]],'as':_0x5e472c['as'],'attributes':_0x5e472c[_0x5bf2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5bf2('0xb')](function(_0xcdee4c){logger[_0x5bf2('0xc')]('ShowDynamics365Account',_0x44a6a3);logger['debug']('ShowDynamics365Account',_0x44a6a3,JSON[_0x5bf2('0x11')](_0xcdee4c));_0x7023ae(_0xcdee4c);})[_0x5bf2('0x16')](function(_0x541d7f){logger['error']('ShowDynamics365Account',_0x541d7f['message'],_0x44a6a3);_0x432de6(_0x59ac8b[_0x5bf2('0x12')](0x1f4,_0x541d7f['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 02246aa..5b0ad81 100644 --- a/server/api/intDynamics365Configuration/index.js +++ b/server/api/intDynamics365Configuration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6396=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','connect-timeout','express','Router'];(function(_0x4c84c9,_0x4d200e){var _0x3707fd=function(_0x19113a){while(--_0x19113a){_0x4c84c9['push'](_0x4c84c9['shift']());}};_0x3707fd(++_0x4d200e);}(_0x6396,0x70));var _0x6639=function(_0x336376,_0xe4b28d){_0x336376=_0x336376-0x0;var _0x1d2a8e=_0x6396[_0x336376];return _0x1d2a8e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6639('0x0'));var express=require(_0x6639('0x1'));var router=express[_0x6639('0x2')]();var auth=require(_0x6639('0x3'));var interaction=require(_0x6639('0x4'));var config=require(_0x6639('0x5'));var controller=require(_0x6639('0x6'));router['get']('/',auth[_0x6639('0x7')](),controller[_0x6639('0x8')]);router[_0x6639('0x9')](_0x6639('0xa'),auth[_0x6639('0x7')](),controller['show']);router[_0x6639('0x9')](_0x6639('0xb'),auth[_0x6639('0x7')](),controller[_0x6639('0xc')]);router[_0x6639('0x9')](_0x6639('0xd'),auth['isAuthenticated'](),controller[_0x6639('0xe')]);router[_0x6639('0x9')](_0x6639('0xf'),auth[_0x6639('0x7')](),controller[_0x6639('0x10')]);router[_0x6639('0x11')]('/',auth[_0x6639('0x7')](),controller[_0x6639('0x12')]);router[_0x6639('0x13')](_0x6639('0xa'),auth[_0x6639('0x7')](),controller[_0x6639('0x14')]);router[_0x6639('0x15')]('/:id',auth[_0x6639('0x7')](),controller['destroy']);module[_0x6639('0x16')]=router; \ No newline at end of file +var _0x92e2=['get','isAuthenticated','index','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','/:id','destroy','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x92e2,0x162));var _0x292e=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0x92e2[_0x2df724];return _0x1b2504;};'use strict';var multer=require('multer');var util=require(_0x292e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x292e('0x1')]();var auth=require(_0x292e('0x2'));var interaction=require(_0x292e('0x3'));var config=require(_0x292e('0x4'));var controller=require(_0x292e('0x5'));router[_0x292e('0x6')]('/',auth[_0x292e('0x7')](),controller[_0x292e('0x8')]);router[_0x292e('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x292e('0x9')]);router['get'](_0x292e('0xa'),auth[_0x292e('0x7')](),controller['getFields']);router[_0x292e('0x6')](_0x292e('0xb'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x292e('0x6')](_0x292e('0xc'),auth[_0x292e('0x7')](),controller[_0x292e('0xd')]);router[_0x292e('0xe')]('/',auth[_0x292e('0x7')](),controller[_0x292e('0xf')]);router[_0x292e('0x10')]('/:id',auth[_0x292e('0x7')](),controller[_0x292e('0x11')]);router['delete'](_0x292e('0x12'),auth[_0x292e('0x7')](),controller[_0x292e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 1a6a80f..fa34871 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57a2=['sequelize','exports','STRING','ENUM','incident','phonecall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57a2,0x1aa));var _0x257a=function(_0x4275f5,_0x46afff){_0x4275f5=_0x4275f5-0x0;var _0xda16e1=_0x57a2[_0x4275f5];return _0xda16e1;};'use strict';var Sequelize=require(_0x257a('0x0'));module[_0x257a('0x1')]={'name':{'type':Sequelize[_0x257a('0x2')]},'description':{'type':Sequelize[_0x257a('0x2')]},'ticketType':{'type':Sequelize[_0x257a('0x3')](_0x257a('0x4'),_0x257a('0x5')),'defaultValue':_0x257a('0x4')}}; \ No newline at end of file +var _0xd66c=['exports','STRING','incident','phonecall','sequelize'];(function(_0x3a5118,_0x254d46){var _0x8baa2c=function(_0x19855e){while(--_0x19855e){_0x3a5118['push'](_0x3a5118['shift']());}};_0x8baa2c(++_0x254d46);}(_0xd66c,0x1ee));var _0xcd66=function(_0x263b10,_0x2b6f05){_0x263b10=_0x263b10-0x0;var _0x4195f4=_0xd66c[_0x263b10];return _0x4195f4;};'use strict';var Sequelize=require(_0xcd66('0x0'));module[_0xcd66('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcd66('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xcd66('0x3'),_0xcd66('0x4')),'defaultValue':_0xcd66('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 6dd9e97..d148d39 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad82=['api','../../config/environment','../../mysqldb','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','offset','set','Content-Range','apply','save','update','then','name','send','index','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','where','filter','merge','map','key','VIRTUAL','options','Dynamics365Configuration','count','includeAll','include','findAll','rows','params','rawAttributes','intersection','find','create','body','destroy','getFields','findOne','order','sort','getSubjects','Dynamics365Field','pick','getDescriptions','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x2c0b11,_0x9cd67d){var _0x84dd45=function(_0x407376){while(--_0x407376){_0x2c0b11['push'](_0x2c0b11['shift']());}};_0x84dd45(++_0x9cd67d);}(_0xad82,0x187));var _0x2ad8=function(_0x379eaf,_0x4eb489){_0x379eaf=_0x379eaf-0x0;var _0x326f1f=_0xad82[_0x379eaf];return _0x326f1f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2ad8('0x0'));var jsonpatch=require(_0x2ad8('0x1'));var rp=require('request-promise');var moment=require(_0x2ad8('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2ad8('0x3'));var path=require(_0x2ad8('0x4'));var sox=require(_0x2ad8('0x5'));var csv=require(_0x2ad8('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2ad8('0x7'));var crypto=require(_0x2ad8('0x8'));var jsforce=require(_0x2ad8('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x2ad8('0x6'));var querystring=require('querystring');var Papa=require(_0x2ad8('0xa'));var Redis=require(_0x2ad8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x2ad8('0xc'));var hardwareService=require(_0x2ad8('0xd'));var logger=require('../../config/logger')(_0x2ad8('0xe'));var utils=require('../../config/utils');var config=require(_0x2ad8('0xf'));var db=require(_0x2ad8('0x10'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2ad8('0x11')]['http']({'port':0x232a});function checkPasswordPattern(_0x23dfb4,_0x4d30f9,_0xf76aeb){if(_0xf76aeb){var _0x111b28=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x111b28[_0x2ad8('0x12')](_0x4d30f9)){return _0x23dfb4;}else{throw new Error(_0x2ad8('0x13'));}}else{return _0x23dfb4;}}function respondWithRpcPromise(_0x2d8244,_0x1e8bb3,_0x10be5e,_0x2235f3){return new BPromise(function(_0x4435b7,_0x30d90b){var _0x3f70f8=_0x2235f3||client;return _0x3f70f8['request'](_0x2d8244,_0x10be5e)['then'](function(_0x860418){logger[_0x2ad8('0x14')](_0x2ad8('0x15'),_0x1e8bb3,_0x2ad8('0x16'));logger['debug'](_0x2ad8('0x17'),_0x1e8bb3,_0x2ad8('0x16'),JSON[_0x2ad8('0x18')](_0x860418));if(_0x860418['error']){if(_0x860418['error'][_0x2ad8('0x19')]===0x1f4){logger[_0x2ad8('0x1a')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1e8bb3,_0x860418[_0x2ad8('0x1a')]['message']);return _0x30d90b(_0x860418['error'][_0x2ad8('0x1b')]);}logger[_0x2ad8('0x1a')](_0x2ad8('0x15'),_0x1e8bb3,_0x860418['error']['message']);return _0x4435b7(_0x860418['error'][_0x2ad8('0x1b')]);}else{logger[_0x2ad8('0x14')](_0x2ad8('0x15'),_0x1e8bb3,_0x2ad8('0x16'));_0x4435b7(_0x860418[_0x2ad8('0x1c')]['message']);}})[_0x2ad8('0x1d')](function(_0x1f06be){logger[_0x2ad8('0x1a')](_0x2ad8('0x15'),_0x1e8bb3,_0x1f06be);_0x30d90b(_0x1f06be);});});}function respondWithStatusCode(_0x9ff685,_0x55cb71){_0x55cb71=_0x55cb71||0xcc;return function(_0xb61110){if(_0xb61110){return _0x9ff685[_0x2ad8('0x1e')](_0x55cb71);}return _0x9ff685[_0x2ad8('0x1f')](_0x55cb71)[_0x2ad8('0x20')]();};}function respondWithResult(_0x10558b,_0x538ec4){_0x538ec4=_0x538ec4||0xc8;return function(_0xfcd53a){if(_0xfcd53a){return _0x10558b['status'](_0x538ec4)['json'](_0xfcd53a);}};}function respondWithFilteredResult(_0x23c65f,_0x22aebb){return function(_0x6ae86c){if(_0x6ae86c){var _0x431b1b=_0x6ae86c['count'],_0x97a7e7=_0x22aebb[_0x2ad8('0x21')],_0x5b55b3=_0x22aebb['offset']+_0x22aebb['limit'],_0x1d19f3;if(_0x5b55b3>=_0x431b1b){_0x5b55b3=_0x431b1b;_0x1d19f3=0xc8;}else{_0x1d19f3=0xce;}_0x23c65f[_0x2ad8('0x1f')](_0x1d19f3);return _0x23c65f[_0x2ad8('0x22')](_0x2ad8('0x23'),_0x97a7e7+'-'+_0x5b55b3+'/'+_0x431b1b)['json'](_0x6ae86c);}return null;};}function patchUpdates(_0xf1b38d){return function(_0x3ea0d6){try{jsonpatch[_0x2ad8('0x24')](_0x3ea0d6,_0xf1b38d,!![]);}catch(_0x2ab7fd){return BPromise['reject'](_0x2ab7fd);}return _0x3ea0d6[_0x2ad8('0x25')]();};}function saveUpdates(_0x163bd3,_0x1c1c72){return function(_0x7349cc){if(_0x7349cc){return _0x7349cc[_0x2ad8('0x26')](_0x163bd3)[_0x2ad8('0x27')](function(_0x28d49c){return _0x28d49c;});}return null;};}function removeEntity(_0x1bdb3,_0x451087){return function(_0x92c3b4){if(_0x92c3b4){return _0x92c3b4['destroy']()[_0x2ad8('0x27')](function(){_0x1bdb3[_0x2ad8('0x1f')](0xcc)[_0x2ad8('0x20')]();});}};}function handleEntityNotFound(_0xcd54d5,_0x3708ab){return function(_0x5b3bb7){if(!_0x5b3bb7){_0xcd54d5[_0x2ad8('0x1e')](0x194);}return _0x5b3bb7;};}function handleError(_0x41dec9,_0xefd9c5){_0xefd9c5=_0xefd9c5||0x1f4;return function(_0x250ad6){logger[_0x2ad8('0x1a')](_0x250ad6['stack']);if(_0x250ad6[_0x2ad8('0x28')]){delete _0x250ad6['name'];}_0x41dec9[_0x2ad8('0x1f')](_0xefd9c5)[_0x2ad8('0x29')](_0x250ad6);};}exports[_0x2ad8('0x2a')]=function(_0x4b5d81,_0x379514){var _0x207006={},_0x222a14={},_0x861743={'count':0x0,'rows':[]};var _0x12e952=db['Dynamics365Configuration']['rawAttributes'];_0x222a14[_0x2ad8('0x2b')]=_[_0x2ad8('0x2c')](_0x12e952);_0x222a14[_0x2ad8('0x2d')]=_[_0x2ad8('0x2c')](_0x4b5d81['query']);_0x222a14[_0x2ad8('0x2e')]=_['intersection'](_0x222a14[_0x2ad8('0x2b')],_0x222a14[_0x2ad8('0x2d')]);_0x207006[_0x2ad8('0x2f')]=_['intersection'](_0x222a14['model'],qs[_0x2ad8('0x30')](_0x4b5d81[_0x2ad8('0x2d')][_0x2ad8('0x30')]));_0x207006[_0x2ad8('0x2f')]=_0x207006['attributes'][_0x2ad8('0x31')]?_0x207006['attributes']:_0x222a14['model'];if(!_0x4b5d81[_0x2ad8('0x2d')][_0x2ad8('0x32')](_0x2ad8('0x33'))){_0x207006[_0x2ad8('0x34')]=qs[_0x2ad8('0x34')](_0x4b5d81[_0x2ad8('0x2d')]['limit']);_0x207006['offset']=qs[_0x2ad8('0x21')](_0x4b5d81['query'][_0x2ad8('0x21')]);}_0x207006['order']=qs['sort'](_0x4b5d81[_0x2ad8('0x2d')]['sort']);_0x207006[_0x2ad8('0x35')]=qs[_0x2ad8('0x2e')](_['pick'](_0x4b5d81['query'],_0x222a14[_0x2ad8('0x2e')]));if(_0x4b5d81[_0x2ad8('0x2d')][_0x2ad8('0x36')]){_0x207006[_0x2ad8('0x35')]=_[_0x2ad8('0x37')](_0x207006[_0x2ad8('0x35')],{'$or':_[_0x2ad8('0x38')](_0x12e952,function(_0xfe54f3){if(_0xfe54f3['type'][_0x2ad8('0x39')]!==_0x2ad8('0x3a')){var _0x23b886={};_0x23b886[_0xfe54f3['field']]={'$like':'%'+_0x4b5d81[_0x2ad8('0x2d')][_0x2ad8('0x36')]+'%'};return _0x23b886;}})});}_0x207006=_[_0x2ad8('0x37')]({},_0x207006,_0x4b5d81[_0x2ad8('0x3b')]);var _0x197e88={'where':_0x207006[_0x2ad8('0x35')]};return db[_0x2ad8('0x3c')][_0x2ad8('0x3d')](_0x197e88)[_0x2ad8('0x27')](function(_0xb8f979){_0x861743[_0x2ad8('0x3d')]=_0xb8f979;if(_0x4b5d81['query'][_0x2ad8('0x3e')]){_0x207006[_0x2ad8('0x3f')]=[{'all':!![]}];}return db[_0x2ad8('0x3c')][_0x2ad8('0x40')](_0x207006);})[_0x2ad8('0x27')](function(_0x285156){_0x861743[_0x2ad8('0x41')]=_0x285156;return _0x861743;})[_0x2ad8('0x27')](respondWithFilteredResult(_0x379514,_0x207006))[_0x2ad8('0x1d')](handleError(_0x379514,null));};exports['show']=function(_0x2b2138,_0x3b5d87){var _0x2f54bf={'raw':![],'where':{'id':_0x2b2138[_0x2ad8('0x42')]['id']}},_0xf19dcd={};_0xf19dcd[_0x2ad8('0x2b')]=_[_0x2ad8('0x2c')](db[_0x2ad8('0x3c')][_0x2ad8('0x43')]);_0xf19dcd[_0x2ad8('0x2d')]=_[_0x2ad8('0x2c')](_0x2b2138[_0x2ad8('0x2d')]);_0xf19dcd[_0x2ad8('0x2e')]=_['intersection'](_0xf19dcd[_0x2ad8('0x2b')],_0xf19dcd[_0x2ad8('0x2d')]);_0x2f54bf['attributes']=_[_0x2ad8('0x44')](_0xf19dcd[_0x2ad8('0x2b')],qs[_0x2ad8('0x30')](_0x2b2138[_0x2ad8('0x2d')][_0x2ad8('0x30')]));_0x2f54bf[_0x2ad8('0x2f')]=_0x2f54bf[_0x2ad8('0x2f')]['length']?_0x2f54bf[_0x2ad8('0x2f')]:_0xf19dcd['model'];if(_0x2b2138[_0x2ad8('0x2d')][_0x2ad8('0x3e')]){_0x2f54bf[_0x2ad8('0x3f')]=[{'all':!![]}];}_0x2f54bf=_[_0x2ad8('0x37')]({},_0x2f54bf,_0x2b2138[_0x2ad8('0x3b')]);return db[_0x2ad8('0x3c')][_0x2ad8('0x45')](_0x2f54bf)[_0x2ad8('0x27')](handleEntityNotFound(_0x3b5d87,null))[_0x2ad8('0x27')](respondWithResult(_0x3b5d87,null))[_0x2ad8('0x1d')](handleError(_0x3b5d87,null));};exports['create']=function(_0x3196a8,_0x22fd5a){return db[_0x2ad8('0x3c')][_0x2ad8('0x46')](_0x3196a8[_0x2ad8('0x47')],{})['then'](respondWithResult(_0x22fd5a,0xc9))[_0x2ad8('0x1d')](handleError(_0x22fd5a,null));};exports[_0x2ad8('0x26')]=function(_0x5b7c0d,_0x24d807){if(_0x5b7c0d[_0x2ad8('0x47')]['id']){delete _0x5b7c0d['body']['id'];}return db['Dynamics365Configuration'][_0x2ad8('0x45')]({'where':{'id':_0x5b7c0d['params']['id']}})['then'](handleEntityNotFound(_0x24d807,null))['then'](saveUpdates(_0x5b7c0d['body'],null))['then'](respondWithResult(_0x24d807,null))[_0x2ad8('0x1d')](handleError(_0x24d807,null));};exports[_0x2ad8('0x48')]=function(_0x35c18c,_0x66c787){return db[_0x2ad8('0x3c')][_0x2ad8('0x45')]({'where':{'id':_0x35c18c['params']['id']}})[_0x2ad8('0x27')](handleEntityNotFound(_0x66c787,null))[_0x2ad8('0x27')](removeEntity(_0x66c787,null))[_0x2ad8('0x1d')](handleError(_0x66c787,null));};exports[_0x2ad8('0x49')]=function(_0x5a6e48,_0x4b9284,_0x4fcaf2){var _0x37a06b={};var _0xa1b20d={};var _0xf00a6;var _0x1e8a46;return db[_0x2ad8('0x3c')][_0x2ad8('0x4a')]({'where':{'id':_0x5a6e48[_0x2ad8('0x42')]['id']}})[_0x2ad8('0x27')](handleEntityNotFound(_0x4b9284,null))[_0x2ad8('0x27')](function(_0x78e3e6){if(_0x78e3e6){_0xf00a6=_0x78e3e6;_0xa1b20d[_0x2ad8('0x2b')]=_[_0x2ad8('0x2c')](db['Dynamics365Field'][_0x2ad8('0x43')]);_0xa1b20d[_0x2ad8('0x2d')]=_['keys'](_0x5a6e48[_0x2ad8('0x2d')]);_0xa1b20d[_0x2ad8('0x2e')]=_[_0x2ad8('0x44')](_0xa1b20d[_0x2ad8('0x2b')],_0xa1b20d['query']);_0x37a06b[_0x2ad8('0x2f')]=_['intersection'](_0xa1b20d[_0x2ad8('0x2b')],qs[_0x2ad8('0x30')](_0x5a6e48[_0x2ad8('0x2d')][_0x2ad8('0x30')]));_0x37a06b[_0x2ad8('0x2f')]=_0x37a06b['attributes'][_0x2ad8('0x31')]?_0x37a06b[_0x2ad8('0x2f')]:_0xa1b20d[_0x2ad8('0x2b')];_0x37a06b[_0x2ad8('0x4b')]=qs[_0x2ad8('0x4c')](_0x5a6e48[_0x2ad8('0x2d')]['sort']);_0x37a06b[_0x2ad8('0x35')]=qs['filters'](_['pick'](_0x5a6e48[_0x2ad8('0x2d')],_0xa1b20d[_0x2ad8('0x2e')]));if(_0x5a6e48[_0x2ad8('0x2d')][_0x2ad8('0x36')]){_0x37a06b['where']=_['merge'](_0x37a06b[_0x2ad8('0x35')],{'$or':_[_0x2ad8('0x38')](_0x37a06b[_0x2ad8('0x2f')],function(_0x5b6440){var _0x10e136={};_0x10e136[_0x5b6440]={'$like':'%'+_0x5a6e48['query'][_0x2ad8('0x36')]+'%'};return _0x10e136;})});}_0x37a06b=_[_0x2ad8('0x37')]({},_0x37a06b,_0x5a6e48['options']);return _0xf00a6[_0x2ad8('0x49')](_0x37a06b);}})[_0x2ad8('0x27')](function(_0x38ca27){if(_0x38ca27){_0x1e8a46=_0x38ca27[_0x2ad8('0x31')];if(!_0x5a6e48[_0x2ad8('0x2d')]['hasOwnProperty']('nolimit')){_0x37a06b[_0x2ad8('0x34')]=qs[_0x2ad8('0x34')](_0x5a6e48['query']['limit']);_0x37a06b[_0x2ad8('0x21')]=qs[_0x2ad8('0x21')](_0x5a6e48[_0x2ad8('0x2d')][_0x2ad8('0x21')]);}return _0xf00a6[_0x2ad8('0x49')](_0x37a06b);}})[_0x2ad8('0x27')](function(_0x50c3d9){if(_0x50c3d9){return _0x50c3d9?{'count':_0x1e8a46,'rows':_0x50c3d9}:null;}})['then'](respondWithResult(_0x4b9284,null))[_0x2ad8('0x1d')](handleError(_0x4b9284,null));};exports[_0x2ad8('0x4d')]=function(_0x21f793,_0x3d238e,_0x195ac0){var _0x43aab5={};var _0x344090={};var _0x15e202;var _0x2fcc58;return db[_0x2ad8('0x3c')][_0x2ad8('0x4a')]({'where':{'id':_0x21f793[_0x2ad8('0x42')]['id']}})[_0x2ad8('0x27')](handleEntityNotFound(_0x3d238e,null))[_0x2ad8('0x27')](function(_0x3f1974){if(_0x3f1974){_0x15e202=_0x3f1974;_0x344090[_0x2ad8('0x2b')]=_['keys'](db[_0x2ad8('0x4e')][_0x2ad8('0x43')]);_0x344090[_0x2ad8('0x2d')]=_[_0x2ad8('0x2c')](_0x21f793[_0x2ad8('0x2d')]);_0x344090[_0x2ad8('0x2e')]=_[_0x2ad8('0x44')](_0x344090[_0x2ad8('0x2b')],_0x344090[_0x2ad8('0x2d')]);_0x43aab5[_0x2ad8('0x2f')]=_[_0x2ad8('0x44')](_0x344090[_0x2ad8('0x2b')],qs['fields'](_0x21f793['query']['fields']));_0x43aab5['attributes']=_0x43aab5[_0x2ad8('0x2f')]['length']?_0x43aab5[_0x2ad8('0x2f')]:_0x344090[_0x2ad8('0x2b')];_0x43aab5[_0x2ad8('0x4b')]=qs[_0x2ad8('0x4c')](_0x21f793[_0x2ad8('0x2d')]['sort']);_0x43aab5['where']=qs[_0x2ad8('0x2e')](_[_0x2ad8('0x4f')](_0x21f793[_0x2ad8('0x2d')],_0x344090[_0x2ad8('0x2e')]));if(_0x21f793[_0x2ad8('0x2d')][_0x2ad8('0x36')]){_0x43aab5['where']=_['merge'](_0x43aab5[_0x2ad8('0x35')],{'$or':_[_0x2ad8('0x38')](_0x43aab5[_0x2ad8('0x2f')],function(_0x4b652b){var _0x11f984={};_0x11f984[_0x4b652b]={'$like':'%'+_0x21f793[_0x2ad8('0x2d')][_0x2ad8('0x36')]+'%'};return _0x11f984;})});}_0x43aab5=_[_0x2ad8('0x37')]({},_0x43aab5,_0x21f793[_0x2ad8('0x3b')]);return _0x15e202['getSubjects'](_0x43aab5);}})[_0x2ad8('0x27')](function(_0x44d748){if(_0x44d748){_0x2fcc58=_0x44d748[_0x2ad8('0x31')];if(!_0x21f793[_0x2ad8('0x2d')][_0x2ad8('0x32')]('nolimit')){_0x43aab5[_0x2ad8('0x34')]=qs[_0x2ad8('0x34')](_0x21f793[_0x2ad8('0x2d')][_0x2ad8('0x34')]);_0x43aab5[_0x2ad8('0x21')]=qs[_0x2ad8('0x21')](_0x21f793['query'][_0x2ad8('0x21')]);}return _0x15e202[_0x2ad8('0x4d')](_0x43aab5);}})['then'](function(_0x5ef1cb){if(_0x5ef1cb){return _0x5ef1cb?{'count':_0x2fcc58,'rows':_0x5ef1cb}:null;}})[_0x2ad8('0x27')](respondWithResult(_0x3d238e,null))['catch'](handleError(_0x3d238e,null));};exports['getDescriptions']=function(_0x375b12,_0x3673bd,_0x365e07){var _0x4b6c6c={};var _0x408383={};var _0x3dcd64;var _0x2444ee;return db[_0x2ad8('0x3c')][_0x2ad8('0x4a')]({'where':{'id':_0x375b12[_0x2ad8('0x42')]['id']}})[_0x2ad8('0x27')](handleEntityNotFound(_0x3673bd,null))[_0x2ad8('0x27')](function(_0x511c11){if(_0x511c11){_0x3dcd64=_0x511c11;_0x408383[_0x2ad8('0x2b')]=_['keys'](db[_0x2ad8('0x4e')][_0x2ad8('0x43')]);_0x408383[_0x2ad8('0x2d')]=_[_0x2ad8('0x2c')](_0x375b12[_0x2ad8('0x2d')]);_0x408383['filters']=_[_0x2ad8('0x44')](_0x408383[_0x2ad8('0x2b')],_0x408383[_0x2ad8('0x2d')]);_0x4b6c6c[_0x2ad8('0x2f')]=_[_0x2ad8('0x44')](_0x408383[_0x2ad8('0x2b')],qs[_0x2ad8('0x30')](_0x375b12['query']['fields']));_0x4b6c6c[_0x2ad8('0x2f')]=_0x4b6c6c[_0x2ad8('0x2f')][_0x2ad8('0x31')]?_0x4b6c6c[_0x2ad8('0x2f')]:_0x408383[_0x2ad8('0x2b')];_0x4b6c6c[_0x2ad8('0x4b')]=qs[_0x2ad8('0x4c')](_0x375b12[_0x2ad8('0x2d')][_0x2ad8('0x4c')]);_0x4b6c6c[_0x2ad8('0x35')]=qs[_0x2ad8('0x2e')](_[_0x2ad8('0x4f')](_0x375b12['query'],_0x408383[_0x2ad8('0x2e')]));if(_0x375b12[_0x2ad8('0x2d')][_0x2ad8('0x36')]){_0x4b6c6c[_0x2ad8('0x35')]=_[_0x2ad8('0x37')](_0x4b6c6c[_0x2ad8('0x35')],{'$or':_[_0x2ad8('0x38')](_0x4b6c6c[_0x2ad8('0x2f')],function(_0x3a66cb){var _0x7c10b1={};_0x7c10b1[_0x3a66cb]={'$like':'%'+_0x375b12[_0x2ad8('0x2d')][_0x2ad8('0x36')]+'%'};return _0x7c10b1;})});}_0x4b6c6c=_[_0x2ad8('0x37')]({},_0x4b6c6c,_0x375b12[_0x2ad8('0x3b')]);return _0x3dcd64[_0x2ad8('0x50')](_0x4b6c6c);}})[_0x2ad8('0x27')](function(_0x4ee69b){if(_0x4ee69b){_0x2444ee=_0x4ee69b['length'];if(!_0x375b12[_0x2ad8('0x2d')][_0x2ad8('0x32')](_0x2ad8('0x33'))){_0x4b6c6c[_0x2ad8('0x34')]=qs[_0x2ad8('0x34')](_0x375b12[_0x2ad8('0x2d')][_0x2ad8('0x34')]);_0x4b6c6c[_0x2ad8('0x21')]=qs['offset'](_0x375b12[_0x2ad8('0x2d')][_0x2ad8('0x21')]);}return _0x3dcd64['getDescriptions'](_0x4b6c6c);}})[_0x2ad8('0x27')](function(_0x19aa0d){if(_0x19aa0d){return _0x19aa0d?{'count':_0x2444ee,'rows':_0x19aa0d}:null;}})[_0x2ad8('0x27')](respondWithResult(_0x3673bd,null))['catch'](handleError(_0x3673bd,null));}; \ No newline at end of file +var _0x5f4e=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','map','type','field','filter','merge','options','count','includeAll','include','findAll','rows','show','params','find','create','update','body','destroy','getSubjects','findOne','pick','getDescriptions','html-pdf','eml-format','request-promise','moment','mustache','util','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','catch','status','end','json','offset','limit','set','Content-Range','apply','reject','save','sendStatus','name','send','Dynamics365Configuration','rawAttributes'];(function(_0x57409a,_0x24f469){var _0x3b9275=function(_0x50834a){while(--_0x50834a){_0x57409a['push'](_0x57409a['shift']());}};_0x3b9275(++_0x24f469);}(_0x5f4e,0x79));var _0xe5f4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f4e[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require(_0xe5f4('0x0'));var emlformat=require(_0xe5f4('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe5f4('0x2'));var moment=require(_0xe5f4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe5f4('0x4'));var util=require(_0xe5f4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xe5f4('0x6'));var ejs=require(_0xe5f4('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe5f4('0x8'));var jsforce=require(_0xe5f4('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xe5f4('0x6'));var querystring=require(_0xe5f4('0xa'));var Papa=require(_0xe5f4('0xb'));var Redis=require(_0xe5f4('0xc'));var authService=require(_0xe5f4('0xd'));var qs=require(_0xe5f4('0xe'));var hardwareService=require(_0xe5f4('0xf'));var logger=require(_0xe5f4('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xe5f4('0x11'));var db=require(_0xe5f4('0x12'))['db'];var jayson=require(_0xe5f4('0x13'));var client=jayson[_0xe5f4('0x14')][_0xe5f4('0x15')]({'port':0x232a});function checkPasswordPattern(_0x4965a7,_0x400a88,_0x230dd2){if(_0x230dd2){var _0x48b020=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x48b020[_0xe5f4('0x16')](_0x400a88)){return _0x4965a7;}else{throw new Error(_0xe5f4('0x17'));}}else{return _0x4965a7;}}function respondWithRpcPromise(_0x84d52f,_0x58908d,_0x1046c3,_0x5ebcf4){return new BPromise(function(_0x2b8a41,_0x266599){var _0x3f622d=_0x5ebcf4||client;return _0x3f622d[_0xe5f4('0x18')](_0x84d52f,_0x1046c3)[_0xe5f4('0x19')](function(_0x4c4db1){logger[_0xe5f4('0x1a')]('Dynamics365Configuration,\x20%s,\x20%s',_0x58908d,'request\x20sent');logger[_0xe5f4('0x1b')](_0xe5f4('0x1c'),_0x58908d,_0xe5f4('0x1d'),JSON[_0xe5f4('0x1e')](_0x4c4db1));if(_0x4c4db1[_0xe5f4('0x1f')]){if(_0x4c4db1[_0xe5f4('0x1f')][_0xe5f4('0x20')]===0x1f4){logger[_0xe5f4('0x1f')](_0xe5f4('0x21'),_0x58908d,_0x4c4db1[_0xe5f4('0x1f')][_0xe5f4('0x22')]);return _0x266599(_0x4c4db1[_0xe5f4('0x1f')][_0xe5f4('0x22')]);}logger[_0xe5f4('0x1f')](_0xe5f4('0x21'),_0x58908d,_0x4c4db1['error'][_0xe5f4('0x22')]);return _0x2b8a41(_0x4c4db1[_0xe5f4('0x1f')][_0xe5f4('0x22')]);}else{logger[_0xe5f4('0x1a')](_0xe5f4('0x21'),_0x58908d,_0xe5f4('0x1d'));_0x2b8a41(_0x4c4db1['result'][_0xe5f4('0x22')]);}})[_0xe5f4('0x23')](function(_0x2b457b){logger[_0xe5f4('0x1f')](_0xe5f4('0x21'),_0x58908d,_0x2b457b);_0x266599(_0x2b457b);});});}function respondWithStatusCode(_0x5696e2,_0x3b30b0){_0x3b30b0=_0x3b30b0||0xcc;return function(_0x5b3f33){if(_0x5b3f33){return _0x5696e2['sendStatus'](_0x3b30b0);}return _0x5696e2[_0xe5f4('0x24')](_0x3b30b0)[_0xe5f4('0x25')]();};}function respondWithResult(_0x52bcd4,_0xefdb2e){_0xefdb2e=_0xefdb2e||0xc8;return function(_0x52f7b4){if(_0x52f7b4){return _0x52bcd4[_0xe5f4('0x24')](_0xefdb2e)[_0xe5f4('0x26')](_0x52f7b4);}};}function respondWithFilteredResult(_0x537684,_0x1006ff){return function(_0x4f4451){if(_0x4f4451){var _0x1c7c4d=_0x4f4451['count'],_0x472763=_0x1006ff[_0xe5f4('0x27')],_0x22a370=_0x1006ff[_0xe5f4('0x27')]+_0x1006ff[_0xe5f4('0x28')],_0x4924f2;if(_0x22a370>=_0x1c7c4d){_0x22a370=_0x1c7c4d;_0x4924f2=0xc8;}else{_0x4924f2=0xce;}_0x537684[_0xe5f4('0x24')](_0x4924f2);return _0x537684[_0xe5f4('0x29')](_0xe5f4('0x2a'),_0x472763+'-'+_0x22a370+'/'+_0x1c7c4d)[_0xe5f4('0x26')](_0x4f4451);}return null;};}function patchUpdates(_0x229921){return function(_0x259f39){try{jsonpatch[_0xe5f4('0x2b')](_0x259f39,_0x229921,!![]);}catch(_0x58c89e){return BPromise[_0xe5f4('0x2c')](_0x58c89e);}return _0x259f39[_0xe5f4('0x2d')]();};}function saveUpdates(_0x51f036,_0x5ad614){return function(_0x11b8ed){if(_0x11b8ed){return _0x11b8ed['update'](_0x51f036)[_0xe5f4('0x19')](function(_0x2eb497){return _0x2eb497;});}return null;};}function removeEntity(_0x790c6c,_0x5781cd){return function(_0x39b1b3){if(_0x39b1b3){return _0x39b1b3['destroy']()[_0xe5f4('0x19')](function(){_0x790c6c[_0xe5f4('0x24')](0xcc)[_0xe5f4('0x25')]();});}};}function handleEntityNotFound(_0x467767,_0x40e780){return function(_0x3e8c60){if(!_0x3e8c60){_0x467767[_0xe5f4('0x2e')](0x194);}return _0x3e8c60;};}function handleError(_0x1a8cc2,_0x58c561){_0x58c561=_0x58c561||0x1f4;return function(_0x547d87){logger['error'](_0x547d87['stack']);if(_0x547d87['name']){delete _0x547d87[_0xe5f4('0x2f')];}_0x1a8cc2['status'](_0x58c561)[_0xe5f4('0x30')](_0x547d87);};}exports['index']=function(_0x224058,_0xd75688){var _0x2c6f44={},_0x2910d4={},_0x40ba59={'count':0x0,'rows':[]};var _0x1b4976=db[_0xe5f4('0x31')][_0xe5f4('0x32')];_0x2910d4[_0xe5f4('0x33')]=_['keys'](_0x1b4976);_0x2910d4[_0xe5f4('0x34')]=_[_0xe5f4('0x35')](_0x224058[_0xe5f4('0x34')]);_0x2910d4[_0xe5f4('0x36')]=_[_0xe5f4('0x37')](_0x2910d4[_0xe5f4('0x33')],_0x2910d4[_0xe5f4('0x34')]);_0x2c6f44[_0xe5f4('0x38')]=_[_0xe5f4('0x37')](_0x2910d4[_0xe5f4('0x33')],qs[_0xe5f4('0x39')](_0x224058['query']['fields']));_0x2c6f44[_0xe5f4('0x38')]=_0x2c6f44[_0xe5f4('0x38')][_0xe5f4('0x3a')]?_0x2c6f44[_0xe5f4('0x38')]:_0x2910d4[_0xe5f4('0x33')];if(!_0x224058[_0xe5f4('0x34')][_0xe5f4('0x3b')](_0xe5f4('0x3c'))){_0x2c6f44['limit']=qs[_0xe5f4('0x28')](_0x224058['query'][_0xe5f4('0x28')]);_0x2c6f44[_0xe5f4('0x27')]=qs[_0xe5f4('0x27')](_0x224058['query'][_0xe5f4('0x27')]);}_0x2c6f44[_0xe5f4('0x3d')]=qs[_0xe5f4('0x3e')](_0x224058['query'][_0xe5f4('0x3e')]);_0x2c6f44['where']=qs[_0xe5f4('0x36')](_['pick'](_0x224058[_0xe5f4('0x34')],_0x2910d4['filters']));if(_0x224058[_0xe5f4('0x34')]['filter']){_0x2c6f44[_0xe5f4('0x3f')]=_['merge'](_0x2c6f44[_0xe5f4('0x3f')],{'$or':_[_0xe5f4('0x40')](_0x1b4976,function(_0x26fb16){if(_0x26fb16[_0xe5f4('0x41')]['key']!=='VIRTUAL'){var _0x107ad7={};_0x107ad7[_0x26fb16[_0xe5f4('0x42')]]={'$like':'%'+_0x224058[_0xe5f4('0x34')][_0xe5f4('0x43')]+'%'};return _0x107ad7;}})});}_0x2c6f44=_[_0xe5f4('0x44')]({},_0x2c6f44,_0x224058[_0xe5f4('0x45')]);var _0x4b9670={'where':_0x2c6f44[_0xe5f4('0x3f')]};return db[_0xe5f4('0x31')][_0xe5f4('0x46')](_0x4b9670)['then'](function(_0x1bf25a){_0x40ba59['count']=_0x1bf25a;if(_0x224058[_0xe5f4('0x34')][_0xe5f4('0x47')]){_0x2c6f44[_0xe5f4('0x48')]=[{'all':!![]}];}return db[_0xe5f4('0x31')][_0xe5f4('0x49')](_0x2c6f44);})[_0xe5f4('0x19')](function(_0x1a7a31){_0x40ba59[_0xe5f4('0x4a')]=_0x1a7a31;return _0x40ba59;})[_0xe5f4('0x19')](respondWithFilteredResult(_0xd75688,_0x2c6f44))[_0xe5f4('0x23')](handleError(_0xd75688,null));};exports[_0xe5f4('0x4b')]=function(_0x3ae7da,_0x821c37){var _0x1efe04={'raw':![],'where':{'id':_0x3ae7da[_0xe5f4('0x4c')]['id']}},_0x139ad7={};_0x139ad7[_0xe5f4('0x33')]=_['keys'](db[_0xe5f4('0x31')][_0xe5f4('0x32')]);_0x139ad7['query']=_[_0xe5f4('0x35')](_0x3ae7da[_0xe5f4('0x34')]);_0x139ad7[_0xe5f4('0x36')]=_[_0xe5f4('0x37')](_0x139ad7[_0xe5f4('0x33')],_0x139ad7[_0xe5f4('0x34')]);_0x1efe04[_0xe5f4('0x38')]=_[_0xe5f4('0x37')](_0x139ad7[_0xe5f4('0x33')],qs[_0xe5f4('0x39')](_0x3ae7da[_0xe5f4('0x34')][_0xe5f4('0x39')]));_0x1efe04[_0xe5f4('0x38')]=_0x1efe04['attributes']['length']?_0x1efe04[_0xe5f4('0x38')]:_0x139ad7[_0xe5f4('0x33')];if(_0x3ae7da[_0xe5f4('0x34')][_0xe5f4('0x47')]){_0x1efe04[_0xe5f4('0x48')]=[{'all':!![]}];}_0x1efe04=_[_0xe5f4('0x44')]({},_0x1efe04,_0x3ae7da[_0xe5f4('0x45')]);return db[_0xe5f4('0x31')][_0xe5f4('0x4d')](_0x1efe04)[_0xe5f4('0x19')](handleEntityNotFound(_0x821c37,null))['then'](respondWithResult(_0x821c37,null))[_0xe5f4('0x23')](handleError(_0x821c37,null));};exports[_0xe5f4('0x4e')]=function(_0x335d9a,_0x3ed507){return db[_0xe5f4('0x31')][_0xe5f4('0x4e')](_0x335d9a['body'],{})[_0xe5f4('0x19')](respondWithResult(_0x3ed507,0xc9))['catch'](handleError(_0x3ed507,null));};exports[_0xe5f4('0x4f')]=function(_0xf53772,_0x2309d5){if(_0xf53772[_0xe5f4('0x50')]['id']){delete _0xf53772[_0xe5f4('0x50')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0xf53772[_0xe5f4('0x4c')]['id']}})[_0xe5f4('0x19')](handleEntityNotFound(_0x2309d5,null))[_0xe5f4('0x19')](saveUpdates(_0xf53772['body'],null))[_0xe5f4('0x19')](respondWithResult(_0x2309d5,null))[_0xe5f4('0x23')](handleError(_0x2309d5,null));};exports[_0xe5f4('0x51')]=function(_0x46e51f,_0x51255c){return db[_0xe5f4('0x31')][_0xe5f4('0x4d')]({'where':{'id':_0x46e51f['params']['id']}})['then'](handleEntityNotFound(_0x51255c,null))['then'](removeEntity(_0x51255c,null))[_0xe5f4('0x23')](handleError(_0x51255c,null));};exports['getFields']=function(_0x296196,_0x132a55,_0xe295d8){var _0xc87b01={};var _0x2a9296={};var _0x14ef14;var _0x3374d8;return db[_0xe5f4('0x31')]['findOne']({'where':{'id':_0x296196[_0xe5f4('0x4c')]['id']}})[_0xe5f4('0x19')](handleEntityNotFound(_0x132a55,null))[_0xe5f4('0x19')](function(_0x29a453){if(_0x29a453){_0x14ef14=_0x29a453;_0x2a9296[_0xe5f4('0x33')]=_[_0xe5f4('0x35')](db['Dynamics365Field'][_0xe5f4('0x32')]);_0x2a9296[_0xe5f4('0x34')]=_['keys'](_0x296196[_0xe5f4('0x34')]);_0x2a9296[_0xe5f4('0x36')]=_[_0xe5f4('0x37')](_0x2a9296[_0xe5f4('0x33')],_0x2a9296[_0xe5f4('0x34')]);_0xc87b01['attributes']=_[_0xe5f4('0x37')](_0x2a9296[_0xe5f4('0x33')],qs[_0xe5f4('0x39')](_0x296196[_0xe5f4('0x34')][_0xe5f4('0x39')]));_0xc87b01[_0xe5f4('0x38')]=_0xc87b01[_0xe5f4('0x38')][_0xe5f4('0x3a')]?_0xc87b01[_0xe5f4('0x38')]:_0x2a9296[_0xe5f4('0x33')];_0xc87b01[_0xe5f4('0x3d')]=qs[_0xe5f4('0x3e')](_0x296196[_0xe5f4('0x34')]['sort']);_0xc87b01[_0xe5f4('0x3f')]=qs['filters'](_['pick'](_0x296196[_0xe5f4('0x34')],_0x2a9296['filters']));if(_0x296196[_0xe5f4('0x34')]['filter']){_0xc87b01[_0xe5f4('0x3f')]=_['merge'](_0xc87b01[_0xe5f4('0x3f')],{'$or':_['map'](_0xc87b01[_0xe5f4('0x38')],function(_0x1b1d62){var _0x50f063={};_0x50f063[_0x1b1d62]={'$like':'%'+_0x296196[_0xe5f4('0x34')]['filter']+'%'};return _0x50f063;})});}_0xc87b01=_[_0xe5f4('0x44')]({},_0xc87b01,_0x296196[_0xe5f4('0x45')]);return _0x14ef14['getFields'](_0xc87b01);}})['then'](function(_0x339fd){if(_0x339fd){_0x3374d8=_0x339fd[_0xe5f4('0x3a')];if(!_0x296196['query'][_0xe5f4('0x3b')](_0xe5f4('0x3c'))){_0xc87b01[_0xe5f4('0x28')]=qs['limit'](_0x296196[_0xe5f4('0x34')]['limit']);_0xc87b01[_0xe5f4('0x27')]=qs['offset'](_0x296196['query']['offset']);}return _0x14ef14['getFields'](_0xc87b01);}})[_0xe5f4('0x19')](function(_0x530af3){if(_0x530af3){return _0x530af3?{'count':_0x3374d8,'rows':_0x530af3}:null;}})[_0xe5f4('0x19')](respondWithResult(_0x132a55,null))[_0xe5f4('0x23')](handleError(_0x132a55,null));};exports[_0xe5f4('0x52')]=function(_0x58a39d,_0x509b67,_0x4bfccf){var _0x5e5972={};var _0x315d1a={};var _0x40c5e4;var _0x51a142;return db[_0xe5f4('0x31')][_0xe5f4('0x53')]({'where':{'id':_0x58a39d[_0xe5f4('0x4c')]['id']}})[_0xe5f4('0x19')](handleEntityNotFound(_0x509b67,null))[_0xe5f4('0x19')](function(_0x1b51b3){if(_0x1b51b3){_0x40c5e4=_0x1b51b3;_0x315d1a[_0xe5f4('0x33')]=_[_0xe5f4('0x35')](db['Dynamics365Field']['rawAttributes']);_0x315d1a[_0xe5f4('0x34')]=_['keys'](_0x58a39d[_0xe5f4('0x34')]);_0x315d1a['filters']=_['intersection'](_0x315d1a[_0xe5f4('0x33')],_0x315d1a[_0xe5f4('0x34')]);_0x5e5972[_0xe5f4('0x38')]=_[_0xe5f4('0x37')](_0x315d1a[_0xe5f4('0x33')],qs[_0xe5f4('0x39')](_0x58a39d[_0xe5f4('0x34')]['fields']));_0x5e5972[_0xe5f4('0x38')]=_0x5e5972[_0xe5f4('0x38')]['length']?_0x5e5972[_0xe5f4('0x38')]:_0x315d1a[_0xe5f4('0x33')];_0x5e5972[_0xe5f4('0x3d')]=qs[_0xe5f4('0x3e')](_0x58a39d[_0xe5f4('0x34')][_0xe5f4('0x3e')]);_0x5e5972[_0xe5f4('0x3f')]=qs[_0xe5f4('0x36')](_[_0xe5f4('0x54')](_0x58a39d[_0xe5f4('0x34')],_0x315d1a[_0xe5f4('0x36')]));if(_0x58a39d[_0xe5f4('0x34')][_0xe5f4('0x43')]){_0x5e5972[_0xe5f4('0x3f')]=_[_0xe5f4('0x44')](_0x5e5972[_0xe5f4('0x3f')],{'$or':_[_0xe5f4('0x40')](_0x5e5972['attributes'],function(_0x175e58){var _0x2e1677={};_0x2e1677[_0x175e58]={'$like':'%'+_0x58a39d[_0xe5f4('0x34')][_0xe5f4('0x43')]+'%'};return _0x2e1677;})});}_0x5e5972=_[_0xe5f4('0x44')]({},_0x5e5972,_0x58a39d[_0xe5f4('0x45')]);return _0x40c5e4[_0xe5f4('0x52')](_0x5e5972);}})[_0xe5f4('0x19')](function(_0x4edff8){if(_0x4edff8){_0x51a142=_0x4edff8[_0xe5f4('0x3a')];if(!_0x58a39d['query'][_0xe5f4('0x3b')]('nolimit')){_0x5e5972[_0xe5f4('0x28')]=qs[_0xe5f4('0x28')](_0x58a39d['query'][_0xe5f4('0x28')]);_0x5e5972[_0xe5f4('0x27')]=qs[_0xe5f4('0x27')](_0x58a39d['query']['offset']);}return _0x40c5e4[_0xe5f4('0x52')](_0x5e5972);}})[_0xe5f4('0x19')](function(_0x1af526){if(_0x1af526){return _0x1af526?{'count':_0x51a142,'rows':_0x1af526}:null;}})[_0xe5f4('0x19')](respondWithResult(_0x509b67,null))['catch'](handleError(_0x509b67,null));};exports[_0xe5f4('0x55')]=function(_0xee2b79,_0x3f922f,_0x85e449){var _0x3ca899={};var _0x3a2f8f={};var _0x3a2670;var _0x3f1aea;return db[_0xe5f4('0x31')]['findOne']({'where':{'id':_0xee2b79[_0xe5f4('0x4c')]['id']}})[_0xe5f4('0x19')](handleEntityNotFound(_0x3f922f,null))[_0xe5f4('0x19')](function(_0x1b7602){if(_0x1b7602){_0x3a2670=_0x1b7602;_0x3a2f8f['model']=_[_0xe5f4('0x35')](db['Dynamics365Field'][_0xe5f4('0x32')]);_0x3a2f8f[_0xe5f4('0x34')]=_[_0xe5f4('0x35')](_0xee2b79[_0xe5f4('0x34')]);_0x3a2f8f['filters']=_[_0xe5f4('0x37')](_0x3a2f8f[_0xe5f4('0x33')],_0x3a2f8f[_0xe5f4('0x34')]);_0x3ca899[_0xe5f4('0x38')]=_[_0xe5f4('0x37')](_0x3a2f8f[_0xe5f4('0x33')],qs['fields'](_0xee2b79['query'][_0xe5f4('0x39')]));_0x3ca899[_0xe5f4('0x38')]=_0x3ca899[_0xe5f4('0x38')]['length']?_0x3ca899[_0xe5f4('0x38')]:_0x3a2f8f[_0xe5f4('0x33')];_0x3ca899[_0xe5f4('0x3d')]=qs['sort'](_0xee2b79[_0xe5f4('0x34')]['sort']);_0x3ca899[_0xe5f4('0x3f')]=qs['filters'](_[_0xe5f4('0x54')](_0xee2b79[_0xe5f4('0x34')],_0x3a2f8f[_0xe5f4('0x36')]));if(_0xee2b79[_0xe5f4('0x34')]['filter']){_0x3ca899[_0xe5f4('0x3f')]=_['merge'](_0x3ca899[_0xe5f4('0x3f')],{'$or':_['map'](_0x3ca899[_0xe5f4('0x38')],function(_0x49a2ba){var _0x1e2b8a={};_0x1e2b8a[_0x49a2ba]={'$like':'%'+_0xee2b79[_0xe5f4('0x34')][_0xe5f4('0x43')]+'%'};return _0x1e2b8a;})});}_0x3ca899=_[_0xe5f4('0x44')]({},_0x3ca899,_0xee2b79[_0xe5f4('0x45')]);return _0x3a2670[_0xe5f4('0x55')](_0x3ca899);}})[_0xe5f4('0x19')](function(_0x5d18f8){if(_0x5d18f8){_0x3f1aea=_0x5d18f8[_0xe5f4('0x3a')];if(!_0xee2b79[_0xe5f4('0x34')][_0xe5f4('0x3b')](_0xe5f4('0x3c'))){_0x3ca899['limit']=qs['limit'](_0xee2b79[_0xe5f4('0x34')][_0xe5f4('0x28')]);_0x3ca899[_0xe5f4('0x27')]=qs['offset'](_0xee2b79[_0xe5f4('0x34')][_0xe5f4('0x27')]);}return _0x3a2670[_0xe5f4('0x55')](_0x3ca899);}})[_0xe5f4('0x19')](function(_0x16385a){if(_0x16385a){return _0x16385a?{'count':_0x3f1aea,'rows':_0x16385a}:null;}})[_0xe5f4('0x19')](respondWithResult(_0x3f922f,null))['catch'](handleError(_0x3f922f,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 4b246eb..1039196 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5669=['api','bluebird','request-promise','path','../../config/environment','exports','define','Dynamics365Configuration','util','../../config/logger'];(function(_0x2aec9f,_0x17620b){var _0x3755e0=function(_0x4011de){while(--_0x4011de){_0x2aec9f['push'](_0x2aec9f['shift']());}};_0x3755e0(++_0x17620b);}(_0x5669,0xc6));var _0x9566=function(_0x25d4b5,_0x478a02){_0x25d4b5=_0x25d4b5-0x0;var _0x33d2f5=_0x5669[_0x25d4b5];return _0x33d2f5;};'use strict';var _=require('lodash');var util=require(_0x9566('0x0'));var logger=require(_0x9566('0x1'))(_0x9566('0x2'));var moment=require('moment');var BPromise=require(_0x9566('0x3'));var rp=require(_0x9566('0x4'));var fs=require('fs');var path=require(_0x9566('0x5'));var rimraf=require('rimraf');var config=require(_0x9566('0x6'));var attributes=require('./intDynamics365Configuration.attributes');module[_0x9566('0x7')]=function(_0x216711,_0x129866){return _0x216711[_0x9566('0x8')](_0x9566('0x9'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0532=['int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','rimraf','exports','define','Dynamics365Configuration'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x0532,0x16c));var _0x2053=function(_0x431a09,_0x109f87){_0x431a09=_0x431a09-0x0;var _0x33ca5e=_0x0532[_0x431a09];return _0x33ca5e;};'use strict';var _=require(_0x2053('0x0'));var util=require(_0x2053('0x1'));var logger=require(_0x2053('0x2'))(_0x2053('0x3'));var moment=require(_0x2053('0x4'));var BPromise=require('bluebird');var rp=require(_0x2053('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2053('0x6'));var config=require('../../config/environment');var attributes=require('./intDynamics365Configuration.attributes');module[_0x2053('0x7')]=function(_0x5bfd51,_0x3632c6){return _0x5bfd51[_0x2053('0x8')](_0x2053('0x9'),attributes,{'tableName':_0x2053('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 11b1497..18de560 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2650=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2650,0x134));var _0x0265=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x2650[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x0265('0x0'));var util=require(_0x0265('0x1'));var moment=require(_0x0265('0x2'));var BPromise=require('bluebird');var rs=require(_0x0265('0x3'));var fs=require('fs');var Redis=require(_0x0265('0x4'));var db=require(_0x0265('0x5'))['db'];var utils=require(_0x0265('0x6'));var logger=require(_0x0265('0x7'))('rpc');var config=require(_0x0265('0x8'));var jayson=require(_0x0265('0x9'));var client=jayson[_0x0265('0xa')][_0x0265('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51f697,_0x2b01e3,_0x30e2e6){return new BPromise(function(_0x19138e,_0x3259a7){return client[_0x0265('0xc')](_0x51f697,_0x30e2e6)['then'](function(_0x4e9a1a){logger[_0x0265('0xd')](_0x0265('0xe'),_0x2b01e3,_0x0265('0xf'));logger['debug'](_0x0265('0x10'),_0x2b01e3,_0x0265('0xf'),JSON[_0x0265('0x11')](_0x4e9a1a));if(_0x4e9a1a[_0x0265('0x12')]){if(_0x4e9a1a[_0x0265('0x12')][_0x0265('0x13')]===0x1f4){logger[_0x0265('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2b01e3,_0x4e9a1a[_0x0265('0x12')][_0x0265('0x14')]);return _0x3259a7(_0x4e9a1a['error'][_0x0265('0x14')]);}logger[_0x0265('0x12')](_0x0265('0xe'),_0x2b01e3,_0x4e9a1a[_0x0265('0x12')][_0x0265('0x14')]);return _0x19138e(_0x4e9a1a[_0x0265('0x12')][_0x0265('0x14')]);}else{logger[_0x0265('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2b01e3,_0x0265('0xf'));_0x19138e(_0x4e9a1a[_0x0265('0x15')][_0x0265('0x14')]);}})['catch'](function(_0x391b6c){logger[_0x0265('0x12')](_0x0265('0xe'),_0x2b01e3,_0x391b6c);_0x3259a7(_0x391b6c);});});} \ No newline at end of file +var _0x0a1a=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0x0a1a,0xb4));var _0xa0a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0a1a[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xa0a1('0x0'));var moment=require(_0xa0a1('0x1'));var BPromise=require(_0xa0a1('0x2'));var rs=require(_0xa0a1('0x3'));var fs=require('fs');var Redis=require(_0xa0a1('0x4'));var db=require(_0xa0a1('0x5'))['db'];var utils=require(_0xa0a1('0x6'));var logger=require('../../config/logger')(_0xa0a1('0x7'));var config=require(_0xa0a1('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa0a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x77f118,_0x3620c8,_0x29112c){return new BPromise(function(_0x6e7d58,_0x417a88){return client[_0xa0a1('0xa')](_0x77f118,_0x29112c)[_0xa0a1('0xb')](function(_0x373c04){logger[_0xa0a1('0xc')](_0xa0a1('0xd'),_0x3620c8,'request\x20sent');logger[_0xa0a1('0xe')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x3620c8,_0xa0a1('0xf'),JSON[_0xa0a1('0x10')](_0x373c04));if(_0x373c04['error']){if(_0x373c04[_0xa0a1('0x11')][_0xa0a1('0x12')]===0x1f4){logger['error'](_0xa0a1('0xd'),_0x3620c8,_0x373c04[_0xa0a1('0x11')][_0xa0a1('0x13')]);return _0x417a88(_0x373c04[_0xa0a1('0x11')][_0xa0a1('0x13')]);}logger['error'](_0xa0a1('0xd'),_0x3620c8,_0x373c04[_0xa0a1('0x11')][_0xa0a1('0x13')]);return _0x6e7d58(_0x373c04[_0xa0a1('0x11')]['message']);}else{logger[_0xa0a1('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3620c8,'request\x20sent');_0x6e7d58(_0x373c04[_0xa0a1('0x14')][_0xa0a1('0x13')]);}})[_0xa0a1('0x15')](function(_0xd5de74){logger[_0xa0a1('0x11')](_0xa0a1('0xd'),_0x3620c8,_0xd5de74);_0x417a88(_0xd5de74);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 7630645..3e55e37 100644 --- a/server/api/intDynamics365Field/index.js +++ b/server/api/intDynamics365Field/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fdb=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','put'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x106dfc,_0x4e362a){_0x106dfc=_0x106dfc-0x0;var _0x1e3d19=_0x4fdb[_0x106dfc];return _0x1e3d19;};'use strict';var multer=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var path=require(_0xb4fd('0x2'));var timeout=require(_0xb4fd('0x3'));var express=require(_0xb4fd('0x4'));var router=express[_0xb4fd('0x5')]();var auth=require(_0xb4fd('0x6'));var interaction=require(_0xb4fd('0x7'));var config=require(_0xb4fd('0x8'));var controller=require('./intDynamics365Field.controller');router[_0xb4fd('0x9')]('/',auth['isAuthenticated'](),controller[_0xb4fd('0xa')]);router['get']('/:id',auth[_0xb4fd('0xb')](),controller[_0xb4fd('0xc')]);router[_0xb4fd('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb4fd('0xe')](_0xb4fd('0xf'),auth[_0xb4fd('0xb')](),controller['update']);router[_0xb4fd('0x10')](_0xb4fd('0xf'),auth[_0xb4fd('0xb')](),controller[_0xb4fd('0x11')]);module[_0xb4fd('0x12')]=router; \ No newline at end of file +var _0xa588=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0xa588,0xe1));var _0x8a58=function(_0x2e6033,_0x48856c){_0x2e6033=_0x2e6033-0x0;var _0x35afe6=_0xa588[_0x2e6033];return _0x35afe6;};'use strict';var multer=require('multer');var util=require(_0x8a58('0x0'));var path=require(_0x8a58('0x1'));var timeout=require(_0x8a58('0x2'));var express=require(_0x8a58('0x3'));var router=express[_0x8a58('0x4')]();var auth=require(_0x8a58('0x5'));var interaction=require(_0x8a58('0x6'));var config=require(_0x8a58('0x7'));var controller=require(_0x8a58('0x8'));router['get']('/',auth[_0x8a58('0x9')](),controller[_0x8a58('0xa')]);router[_0x8a58('0xb')](_0x8a58('0xc'),auth[_0x8a58('0x9')](),controller[_0x8a58('0xd')]);router[_0x8a58('0xe')]('/',auth[_0x8a58('0x9')](),controller['create']);router[_0x8a58('0xf')](_0x8a58('0xc'),auth[_0x8a58('0x9')](),controller[_0x8a58('0x10')]);router[_0x8a58('0x11')]('/:id',auth[_0x8a58('0x9')](),controller[_0x8a58('0x12')]);module[_0x8a58('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 7c9154a..bd009e3 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.attributes.js +++ b/server/api/intDynamics365Field/intDynamics365Field.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa232=['ENUM','string','variable','customVariable','STRING'];(function(_0x31d24d,_0x19c6ea){var _0x240c95=function(_0x329047){while(--_0x329047){_0x31d24d['push'](_0x31d24d['shift']());}};_0x240c95(++_0x19c6ea);}(_0xa232,0x141));var _0x2a23=function(_0x2b3fb8,_0xac7ead){_0x2b3fb8=_0x2b3fb8-0x0;var _0x220a09=_0xa232[_0x2b3fb8];return _0x220a09;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x2a23('0x0'),_0x2a23('0x1'),_0x2a23('0x2'),'keyValue'),'defaultValue':_0x2a23('0x0')},'content':{'type':Sequelize[_0x2a23('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2a23('0x4')](_0x2a23('0x0'),_0x2a23('0x1'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2a23('0x3')]},'nameField':{'type':Sequelize[_0x2a23('0x3')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcdc9=['string','variable','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x561f25,_0x2d95c1){var _0x150e4c=function(_0x266e99){while(--_0x266e99){_0x561f25['push'](_0x561f25['shift']());}};_0x150e4c(++_0x2d95c1);}(_0xcdc9,0x1a9));var _0x9cdc=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcdc9[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x9cdc('0x0'));module[_0x9cdc('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9cdc('0x2'),_0x9cdc('0x3'),'customVariable','keyValue'),'defaultValue':_0x9cdc('0x2')},'content':{'type':Sequelize[_0x9cdc('0x4')]},'key':{'type':Sequelize[_0x9cdc('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x9cdc('0x2'),_0x9cdc('0x3'),_0x9cdc('0x5'))},'keyContent':{'type':Sequelize[_0x9cdc('0x4')]},'idField':{'type':Sequelize[_0x9cdc('0x4')]},'nameField':{'type':Sequelize[_0x9cdc('0x4')]},'customField':{'type':Sequelize[_0x9cdc('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9cdc('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index e2cc7bb..ef58818 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.controller.js +++ b/server/api/intDynamics365Field/intDynamics365Field.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c34=['pick','filter','where','merge','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','show','params','options','Dynamics365Field','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../mysqldb','status','offset','limit','set','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort'];(function(_0x504d1e,_0x358b66){var _0xe0f72d=function(_0x28b079){while(--_0x28b079){_0x504d1e['push'](_0x504d1e['shift']());}};_0xe0f72d(++_0x358b66);}(_0x9c34,0x1c6));var _0x49c3=function(_0x48a43f,_0x1b380b){_0x48a43f=_0x48a43f-0x0;var _0x5bcdc0=_0x9c34[_0x48a43f];return _0x5bcdc0;};'use strict';var pdf=require(_0x49c3('0x0'));var emlformat=require(_0x49c3('0x1'));var rimraf=require(_0x49c3('0x2'));var zipdir=require(_0x49c3('0x3'));var jsonpatch=require(_0x49c3('0x4'));var rp=require(_0x49c3('0x5'));var moment=require(_0x49c3('0x6'));var BPromise=require(_0x49c3('0x7'));var Mustache=require('mustache');var util=require(_0x49c3('0x8'));var path=require(_0x49c3('0x9'));var sox=require(_0x49c3('0xa'));var csv=require(_0x49c3('0xb'));var ejs=require(_0x49c3('0xc'));var fs=require('fs');var _=require(_0x49c3('0xd'));var squel=require(_0x49c3('0xe'));var crypto=require(_0x49c3('0xf'));var jsforce=require(_0x49c3('0x10'));var deskjs=require(_0x49c3('0x11'));var toCsv=require('to-csv');var querystring=require(_0x49c3('0x12'));var Papa=require('papaparse');var Redis=require(_0x49c3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x49c3('0x14'));var hardwareService=require(_0x49c3('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x49c3('0x16'))['db'];function respondWithStatusCode(_0x58018e,_0x8a25e9){_0x8a25e9=_0x8a25e9||0xcc;return function(_0x2ddb30){if(_0x2ddb30){return _0x58018e['sendStatus'](_0x8a25e9);}return _0x58018e[_0x49c3('0x17')](_0x8a25e9)['end']();};}function respondWithResult(_0x316815,_0x4f8380){_0x4f8380=_0x4f8380||0xc8;return function(_0x1a9a7e){if(_0x1a9a7e){return _0x316815[_0x49c3('0x17')](_0x4f8380)['json'](_0x1a9a7e);}};}function respondWithFilteredResult(_0x94e586,_0x3ccb47){return function(_0x43ec58){if(_0x43ec58){var _0x45bd8d=_0x43ec58['count'],_0x4717fb=_0x3ccb47[_0x49c3('0x18')],_0x27ddd4=_0x3ccb47[_0x49c3('0x18')]+_0x3ccb47[_0x49c3('0x19')],_0x3f6f00;if(_0x27ddd4>=_0x45bd8d){_0x27ddd4=_0x45bd8d;_0x3f6f00=0xc8;}else{_0x3f6f00=0xce;}_0x94e586['status'](_0x3f6f00);return _0x94e586[_0x49c3('0x1a')]('Content-Range',_0x4717fb+'-'+_0x27ddd4+'/'+_0x45bd8d)[_0x49c3('0x1b')](_0x43ec58);}return null;};}function patchUpdates(_0x3bafef){return function(_0x240b52){try{jsonpatch[_0x49c3('0x1c')](_0x240b52,_0x3bafef,!![]);}catch(_0x3fdee2){return BPromise[_0x49c3('0x1d')](_0x3fdee2);}return _0x240b52[_0x49c3('0x1e')]();};}function saveUpdates(_0x19d419,_0xe62af9){return function(_0x5bd42c){if(_0x5bd42c){return _0x5bd42c[_0x49c3('0x1f')](_0x19d419)[_0x49c3('0x20')](function(_0x482706){return _0x482706;});}return null;};}function removeEntity(_0x4ac102,_0x365051){return function(_0x4410b0){if(_0x4410b0){return _0x4410b0[_0x49c3('0x21')]()[_0x49c3('0x20')](function(){_0x4ac102['status'](0xcc)[_0x49c3('0x22')]();});}};}function handleEntityNotFound(_0x22a6fd,_0x152393){return function(_0x2f22a5){if(!_0x2f22a5){_0x22a6fd[_0x49c3('0x23')](0x194);}return _0x2f22a5;};}function handleError(_0x81a0fc,_0x32a4ba){_0x32a4ba=_0x32a4ba||0x1f4;return function(_0xffb325){logger[_0x49c3('0x24')](_0xffb325[_0x49c3('0x25')]);if(_0xffb325['name']){delete _0xffb325[_0x49c3('0x26')];}_0x81a0fc[_0x49c3('0x17')](_0x32a4ba)['send'](_0xffb325);};}exports[_0x49c3('0x27')]=function(_0x5801b9,_0x4671d4){var _0x4c2aaa={},_0x2e83ee={},_0x463e1e={'count':0x0,'rows':[]};var _0x3573d8=db['Dynamics365Field']['rawAttributes'];_0x2e83ee[_0x49c3('0x28')]=_[_0x49c3('0x29')](_0x3573d8);_0x2e83ee[_0x49c3('0x2a')]=_[_0x49c3('0x29')](_0x5801b9[_0x49c3('0x2a')]);_0x2e83ee[_0x49c3('0x2b')]=_['intersection'](_0x2e83ee['model'],_0x2e83ee[_0x49c3('0x2a')]);_0x4c2aaa['attributes']=_[_0x49c3('0x2c')](_0x2e83ee[_0x49c3('0x28')],qs[_0x49c3('0x2d')](_0x5801b9[_0x49c3('0x2a')][_0x49c3('0x2d')]));_0x4c2aaa[_0x49c3('0x2e')]=_0x4c2aaa[_0x49c3('0x2e')][_0x49c3('0x2f')]?_0x4c2aaa['attributes']:_0x2e83ee[_0x49c3('0x28')];if(!_0x5801b9[_0x49c3('0x2a')]['hasOwnProperty'](_0x49c3('0x30'))){_0x4c2aaa[_0x49c3('0x19')]=qs[_0x49c3('0x19')](_0x5801b9[_0x49c3('0x2a')][_0x49c3('0x19')]);_0x4c2aaa[_0x49c3('0x18')]=qs['offset'](_0x5801b9[_0x49c3('0x2a')][_0x49c3('0x18')]);}_0x4c2aaa['order']=qs[_0x49c3('0x31')](_0x5801b9[_0x49c3('0x2a')][_0x49c3('0x31')]);_0x4c2aaa['where']=qs['filters'](_[_0x49c3('0x32')](_0x5801b9[_0x49c3('0x2a')],_0x2e83ee['filters']));if(_0x5801b9[_0x49c3('0x2a')][_0x49c3('0x33')]){_0x4c2aaa[_0x49c3('0x34')]=_[_0x49c3('0x35')](_0x4c2aaa[_0x49c3('0x34')],{'$or':_[_0x49c3('0x36')](_0x3573d8,function(_0x31de10){if(_0x31de10[_0x49c3('0x37')][_0x49c3('0x38')]!==_0x49c3('0x39')){var _0x5355c0={};_0x5355c0[_0x31de10[_0x49c3('0x3a')]]={'$like':'%'+_0x5801b9[_0x49c3('0x2a')][_0x49c3('0x33')]+'%'};return _0x5355c0;}})});}_0x4c2aaa=_[_0x49c3('0x35')]({},_0x4c2aaa,_0x5801b9['options']);var _0x2341c8={'where':_0x4c2aaa[_0x49c3('0x34')]};return db['Dynamics365Field'][_0x49c3('0x3b')](_0x2341c8)['then'](function(_0xba0c61){_0x463e1e[_0x49c3('0x3b')]=_0xba0c61;if(_0x5801b9[_0x49c3('0x2a')][_0x49c3('0x3c')]){_0x4c2aaa[_0x49c3('0x3d')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x49c3('0x3e')](_0x4c2aaa);})[_0x49c3('0x20')](function(_0x58834a){_0x463e1e[_0x49c3('0x3f')]=_0x58834a;return _0x463e1e;})[_0x49c3('0x20')](respondWithFilteredResult(_0x4671d4,_0x4c2aaa))[_0x49c3('0x40')](handleError(_0x4671d4,null));};exports[_0x49c3('0x41')]=function(_0xa943f8,_0x390541){var _0x5f0ff2={'raw':!![],'where':{'id':_0xa943f8[_0x49c3('0x42')]['id']}},_0x21a089={};_0x21a089['model']=_[_0x49c3('0x29')](db['Dynamics365Field']['rawAttributes']);_0x21a089['query']=_['keys'](_0xa943f8['query']);_0x21a089[_0x49c3('0x2b')]=_[_0x49c3('0x2c')](_0x21a089[_0x49c3('0x28')],_0x21a089[_0x49c3('0x2a')]);_0x5f0ff2['attributes']=_[_0x49c3('0x2c')](_0x21a089[_0x49c3('0x28')],qs['fields'](_0xa943f8[_0x49c3('0x2a')][_0x49c3('0x2d')]));_0x5f0ff2[_0x49c3('0x2e')]=_0x5f0ff2[_0x49c3('0x2e')][_0x49c3('0x2f')]?_0x5f0ff2[_0x49c3('0x2e')]:_0x21a089[_0x49c3('0x28')];if(_0xa943f8[_0x49c3('0x2a')][_0x49c3('0x3c')]){_0x5f0ff2[_0x49c3('0x3d')]=[{'all':!![]}];}_0x5f0ff2=_['merge']({},_0x5f0ff2,_0xa943f8[_0x49c3('0x43')]);return db[_0x49c3('0x44')][_0x49c3('0x45')](_0x5f0ff2)[_0x49c3('0x20')](handleEntityNotFound(_0x390541,null))[_0x49c3('0x20')](respondWithResult(_0x390541,null))['catch'](handleError(_0x390541,null));};exports[_0x49c3('0x46')]=function(_0x272582,_0x4c1324){return db['Dynamics365Field']['create'](_0x272582[_0x49c3('0x47')],{})[_0x49c3('0x20')](respondWithResult(_0x4c1324,0xc9))['catch'](handleError(_0x4c1324,null));};exports[_0x49c3('0x1f')]=function(_0x4b2638,_0x4233b6){if(_0x4b2638['body']['id']){delete _0x4b2638[_0x49c3('0x47')]['id'];}return db[_0x49c3('0x44')][_0x49c3('0x45')]({'where':{'id':_0x4b2638['params']['id']}})[_0x49c3('0x20')](handleEntityNotFound(_0x4233b6,null))['then'](saveUpdates(_0x4b2638[_0x49c3('0x47')],null))[_0x49c3('0x20')](respondWithResult(_0x4233b6,null))[_0x49c3('0x40')](handleError(_0x4233b6,null));};exports['destroy']=function(_0x4bb944,_0x31799a){return db['Dynamics365Field'][_0x49c3('0x45')]({'where':{'id':_0x4bb944[_0x49c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x31799a,null))['then'](removeEntity(_0x31799a,null))[_0x49c3('0x40')](handleError(_0x31799a,null));}; \ No newline at end of file +var _0x734b=['to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','limit','Content-Range','apply','update','then','destroy','end','sendStatus','stack','name','send','index','Dynamics365Field','keys','query','filters','intersection','model','attributes','fields','nolimit','order','where','pick','filter','merge','map','key','VIRTUAL','field','options','count','include','findAll','rows','show','params','rawAttributes','length','catch','create','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x57899a,_0x310f56){var _0x3b8015=function(_0x3f76ec){while(--_0x3f76ec){_0x57899a['push'](_0x57899a['shift']());}};_0x3b8015(++_0x310f56);}(_0x734b,0x1d9));var _0xb734=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x734b[_0x9c2427];return _0x51984f;};'use strict';var pdf=require(_0xb734('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb734('0x1'));var zipdir=require(_0xb734('0x2'));var jsonpatch=require(_0xb734('0x3'));var rp=require(_0xb734('0x4'));var moment=require(_0xb734('0x5'));var BPromise=require(_0xb734('0x6'));var Mustache=require('mustache');var util=require(_0xb734('0x7'));var path=require(_0xb734('0x8'));var sox=require(_0xb734('0x9'));var csv=require(_0xb734('0xa'));var ejs=require(_0xb734('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb734('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb734('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb734('0xe'));var Papa=require(_0xb734('0xf'));var Redis=require('ioredis');var authService=require(_0xb734('0x10'));var qs=require(_0xb734('0x11'));var hardwareService=require(_0xb734('0x12'));var logger=require(_0xb734('0x13'))(_0xb734('0x14'));var utils=require(_0xb734('0x15'));var config=require('../../config/environment');var db=require(_0xb734('0x16'))['db'];function respondWithStatusCode(_0x295e28,_0x267a11){_0x267a11=_0x267a11||0xcc;return function(_0x216889){if(_0x216889){return _0x295e28['sendStatus'](_0x267a11);}return _0x295e28[_0xb734('0x17')](_0x267a11)['end']();};}function respondWithResult(_0x47d14e,_0x472d91){_0x472d91=_0x472d91||0xc8;return function(_0x59110f){if(_0x59110f){return _0x47d14e[_0xb734('0x17')](_0x472d91)[_0xb734('0x18')](_0x59110f);}};}function respondWithFilteredResult(_0x2e9017,_0x19306f){return function(_0x44bd5d){if(_0x44bd5d){var _0x41aadb=_0x44bd5d['count'],_0x182f5a=_0x19306f[_0xb734('0x19')],_0x2da406=_0x19306f['offset']+_0x19306f[_0xb734('0x1a')],_0x477494;if(_0x2da406>=_0x41aadb){_0x2da406=_0x41aadb;_0x477494=0xc8;}else{_0x477494=0xce;}_0x2e9017[_0xb734('0x17')](_0x477494);return _0x2e9017['set'](_0xb734('0x1b'),_0x182f5a+'-'+_0x2da406+'/'+_0x41aadb)[_0xb734('0x18')](_0x44bd5d);}return null;};}function patchUpdates(_0xd74833){return function(_0x58b66e){try{jsonpatch[_0xb734('0x1c')](_0x58b66e,_0xd74833,!![]);}catch(_0x14ea47){return BPromise['reject'](_0x14ea47);}return _0x58b66e['save']();};}function saveUpdates(_0x53b658,_0x4d06a9){return function(_0x158c3d){if(_0x158c3d){return _0x158c3d[_0xb734('0x1d')](_0x53b658)[_0xb734('0x1e')](function(_0x6b8db6){return _0x6b8db6;});}return null;};}function removeEntity(_0x548cea,_0x3ca932){return function(_0x50e7f6){if(_0x50e7f6){return _0x50e7f6[_0xb734('0x1f')]()[_0xb734('0x1e')](function(){_0x548cea[_0xb734('0x17')](0xcc)[_0xb734('0x20')]();});}};}function handleEntityNotFound(_0x4f63c2,_0x37dc9b){return function(_0x430f6e){if(!_0x430f6e){_0x4f63c2[_0xb734('0x21')](0x194);}return _0x430f6e;};}function handleError(_0x2e3f5f,_0x4023c3){_0x4023c3=_0x4023c3||0x1f4;return function(_0x2fcb80){logger['error'](_0x2fcb80[_0xb734('0x22')]);if(_0x2fcb80[_0xb734('0x23')]){delete _0x2fcb80[_0xb734('0x23')];}_0x2e3f5f[_0xb734('0x17')](_0x4023c3)[_0xb734('0x24')](_0x2fcb80);};}exports[_0xb734('0x25')]=function(_0x4f6658,_0x4f76d7){var _0x15724b={},_0x3ecef4={},_0x3d060c={'count':0x0,'rows':[]};var _0x25f021=db[_0xb734('0x26')]['rawAttributes'];_0x3ecef4['model']=_[_0xb734('0x27')](_0x25f021);_0x3ecef4[_0xb734('0x28')]=_[_0xb734('0x27')](_0x4f6658[_0xb734('0x28')]);_0x3ecef4[_0xb734('0x29')]=_[_0xb734('0x2a')](_0x3ecef4[_0xb734('0x2b')],_0x3ecef4['query']);_0x15724b[_0xb734('0x2c')]=_['intersection'](_0x3ecef4[_0xb734('0x2b')],qs[_0xb734('0x2d')](_0x4f6658[_0xb734('0x28')]['fields']));_0x15724b['attributes']=_0x15724b[_0xb734('0x2c')]['length']?_0x15724b['attributes']:_0x3ecef4[_0xb734('0x2b')];if(!_0x4f6658[_0xb734('0x28')]['hasOwnProperty'](_0xb734('0x2e'))){_0x15724b[_0xb734('0x1a')]=qs[_0xb734('0x1a')](_0x4f6658[_0xb734('0x28')]['limit']);_0x15724b['offset']=qs['offset'](_0x4f6658['query']['offset']);}_0x15724b[_0xb734('0x2f')]=qs['sort'](_0x4f6658['query']['sort']);_0x15724b[_0xb734('0x30')]=qs[_0xb734('0x29')](_[_0xb734('0x31')](_0x4f6658[_0xb734('0x28')],_0x3ecef4['filters']));if(_0x4f6658[_0xb734('0x28')][_0xb734('0x32')]){_0x15724b[_0xb734('0x30')]=_[_0xb734('0x33')](_0x15724b[_0xb734('0x30')],{'$or':_[_0xb734('0x34')](_0x25f021,function(_0x189d22){if(_0x189d22['type'][_0xb734('0x35')]!==_0xb734('0x36')){var _0x3220ab={};_0x3220ab[_0x189d22[_0xb734('0x37')]]={'$like':'%'+_0x4f6658[_0xb734('0x28')][_0xb734('0x32')]+'%'};return _0x3220ab;}})});}_0x15724b=_[_0xb734('0x33')]({},_0x15724b,_0x4f6658[_0xb734('0x38')]);var _0xb2b00={'where':_0x15724b['where']};return db['Dynamics365Field'][_0xb734('0x39')](_0xb2b00)[_0xb734('0x1e')](function(_0x1a37d0){_0x3d060c['count']=_0x1a37d0;if(_0x4f6658[_0xb734('0x28')]['includeAll']){_0x15724b[_0xb734('0x3a')]=[{'all':!![]}];}return db[_0xb734('0x26')][_0xb734('0x3b')](_0x15724b);})['then'](function(_0x506a94){_0x3d060c[_0xb734('0x3c')]=_0x506a94;return _0x3d060c;})[_0xb734('0x1e')](respondWithFilteredResult(_0x4f76d7,_0x15724b))['catch'](handleError(_0x4f76d7,null));};exports[_0xb734('0x3d')]=function(_0x41b29a,_0x455bda){var _0x161699={'raw':!![],'where':{'id':_0x41b29a[_0xb734('0x3e')]['id']}},_0x44cdc9={};_0x44cdc9[_0xb734('0x2b')]=_['keys'](db[_0xb734('0x26')][_0xb734('0x3f')]);_0x44cdc9[_0xb734('0x28')]=_[_0xb734('0x27')](_0x41b29a[_0xb734('0x28')]);_0x44cdc9['filters']=_[_0xb734('0x2a')](_0x44cdc9['model'],_0x44cdc9[_0xb734('0x28')]);_0x161699[_0xb734('0x2c')]=_[_0xb734('0x2a')](_0x44cdc9['model'],qs[_0xb734('0x2d')](_0x41b29a[_0xb734('0x28')][_0xb734('0x2d')]));_0x161699[_0xb734('0x2c')]=_0x161699[_0xb734('0x2c')][_0xb734('0x40')]?_0x161699[_0xb734('0x2c')]:_0x44cdc9[_0xb734('0x2b')];if(_0x41b29a['query']['includeAll']){_0x161699[_0xb734('0x3a')]=[{'all':!![]}];}_0x161699=_[_0xb734('0x33')]({},_0x161699,_0x41b29a[_0xb734('0x38')]);return db[_0xb734('0x26')]['find'](_0x161699)['then'](handleEntityNotFound(_0x455bda,null))[_0xb734('0x1e')](respondWithResult(_0x455bda,null))[_0xb734('0x41')](handleError(_0x455bda,null));};exports[_0xb734('0x42')]=function(_0x24aeee,_0x28b70f){return db['Dynamics365Field'][_0xb734('0x42')](_0x24aeee[_0xb734('0x43')],{})[_0xb734('0x1e')](respondWithResult(_0x28b70f,0xc9))['catch'](handleError(_0x28b70f,null));};exports[_0xb734('0x1d')]=function(_0x387775,_0xef4e9){if(_0x387775[_0xb734('0x43')]['id']){delete _0x387775['body']['id'];}return db[_0xb734('0x26')]['find']({'where':{'id':_0x387775['params']['id']}})[_0xb734('0x1e')](handleEntityNotFound(_0xef4e9,null))[_0xb734('0x1e')](saveUpdates(_0x387775[_0xb734('0x43')],null))[_0xb734('0x1e')](respondWithResult(_0xef4e9,null))[_0xb734('0x41')](handleError(_0xef4e9,null));};exports[_0xb734('0x1f')]=function(_0x23f4d4,_0x438a32){return db[_0xb734('0x26')][_0xb734('0x44')]({'where':{'id':_0x23f4d4[_0xb734('0x3e')]['id']}})[_0xb734('0x1e')](handleEntityNotFound(_0x438a32,null))[_0xb734('0x1e')](removeEntity(_0x438a32,null))[_0xb734('0x41')](handleError(_0x438a32,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 3642642..cf7fe93 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.model.js +++ b/server/api/intDynamics365Field/intDynamics365Field.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9986=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9986,0x145));var _0x6998=function(_0x156bab,_0x438a0c){_0x156bab=_0x156bab-0x0;var _0xebdf00=_0x9986[_0x156bab];return _0xebdf00;};'use strict';var _=require(_0x6998('0x0'));var util=require(_0x6998('0x1'));var logger=require(_0x6998('0x2'))(_0x6998('0x3'));var moment=require(_0x6998('0x4'));var BPromise=require(_0x6998('0x5'));var rp=require(_0x6998('0x6'));var fs=require('fs');var path=require(_0x6998('0x7'));var rimraf=require(_0x6998('0x8'));var config=require(_0x6998('0x9'));var attributes=require(_0x6998('0xa'));module[_0x6998('0xb')]=function(_0x1c7744,_0x489bec){return _0x1c7744[_0x6998('0xc')](_0x6998('0xd'),attributes,{'tableName':_0x6998('0xe'),'paranoid':![],'indexes':[{'name':_0x6998('0xf'),'fields':[_0x6998('0x10'),_0x6998('0x11')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x44a2=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash'];(function(_0x31a15c,_0x36e0ba){var _0x5e5f3b=function(_0x4d9270){while(--_0x4d9270){_0x31a15c['push'](_0x31a15c['shift']());}};_0x5e5f3b(++_0x36e0ba);}(_0x44a2,0x68));var _0x244a=function(_0x2c454e,_0x2d6084){_0x2c454e=_0x2c454e-0x0;var _0x46cab8=_0x44a2[_0x2c454e];return _0x46cab8;};'use strict';var _=require(_0x244a('0x0'));var util=require(_0x244a('0x1'));var logger=require(_0x244a('0x2'))(_0x244a('0x3'));var moment=require(_0x244a('0x4'));var BPromise=require(_0x244a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x244a('0x6'));var rimraf=require(_0x244a('0x7'));var config=require(_0x244a('0x8'));var attributes=require(_0x244a('0x9'));module[_0x244a('0xa')]=function(_0x3d7fef,_0x106e3b){return _0x3d7fef[_0x244a('0xb')]('Dynamics365Field',attributes,{'tableName':_0x244a('0xc'),'paranoid':![],'indexes':[{'name':_0x244a('0xd'),'fields':['idField',_0x244a('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 388565c..79af52c 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.rpc.js +++ b/server/api/intDynamics365Field/intDynamics365Field.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb67=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x8df889,_0x460bb7){var _0x54b345=function(_0x35936a){while(--_0x35936a){_0x8df889['push'](_0x8df889['shift']());}};_0x54b345(++_0x460bb7);}(_0xbb67,0x161));var _0x7bb6=function(_0x25412d,_0x1da952){_0x25412d=_0x25412d-0x0;var _0x2a634e=_0xbb67[_0x25412d];return _0x2a634e;};'use strict';var _=require('lodash');var util=require(_0x7bb6('0x0'));var moment=require(_0x7bb6('0x1'));var BPromise=require(_0x7bb6('0x2'));var rs=require(_0x7bb6('0x3'));var fs=require('fs');var Redis=require(_0x7bb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bb6('0x5'));var logger=require(_0x7bb6('0x6'))(_0x7bb6('0x7'));var config=require(_0x7bb6('0x8'));var jayson=require(_0x7bb6('0x9'));var client=jayson[_0x7bb6('0xa')][_0x7bb6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a059b,_0x5f1898,_0x45441a){return new BPromise(function(_0x15fb32,_0x214244){return client[_0x7bb6('0xc')](_0x2a059b,_0x45441a)[_0x7bb6('0xd')](function(_0x168bb6){logger[_0x7bb6('0xe')](_0x7bb6('0xf'),_0x5f1898,_0x7bb6('0x10'));logger['debug'](_0x7bb6('0x11'),_0x5f1898,_0x7bb6('0x10'),JSON[_0x7bb6('0x12')](_0x168bb6));if(_0x168bb6[_0x7bb6('0x13')]){if(_0x168bb6[_0x7bb6('0x13')][_0x7bb6('0x14')]===0x1f4){logger[_0x7bb6('0x13')](_0x7bb6('0xf'),_0x5f1898,_0x168bb6[_0x7bb6('0x13')]['message']);return _0x214244(_0x168bb6['error'][_0x7bb6('0x15')]);}logger[_0x7bb6('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x5f1898,_0x168bb6[_0x7bb6('0x13')][_0x7bb6('0x15')]);return _0x15fb32(_0x168bb6[_0x7bb6('0x13')][_0x7bb6('0x15')]);}else{logger[_0x7bb6('0xe')](_0x7bb6('0xf'),_0x5f1898,'request\x20sent');_0x15fb32(_0x168bb6[_0x7bb6('0x16')][_0x7bb6('0x15')]);}})[_0x7bb6('0x17')](function(_0x4095a1){logger[_0x7bb6('0x13')](_0x7bb6('0xf'),_0x5f1898,_0x4095a1);_0x214244(_0x4095a1);});});} \ No newline at end of file +var _0xd117=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','debug','stringify','code','error','message'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd117,0x182));var _0x7d11=function(_0x446f11,_0x95cf21){_0x446f11=_0x446f11-0x0;var _0x385cb5=_0xd117[_0x446f11];return _0x385cb5;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 925a6f4..5564b1c 100644 --- a/server/api/intFreshdeskAccount/index.js +++ b/server/api/intFreshdeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa17=['../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service'];(function(_0x48a63a,_0x47462c){var _0x1873f2=function(_0x1cad4c){while(--_0x1cad4c){_0x48a63a['push'](_0x48a63a['shift']());}};_0x1873f2(++_0x47462c);}(_0xaa17,0x12f));var _0x7aa1=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xaa17[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0x7aa1('0x0'));var util=require('util');var path=require(_0x7aa1('0x1'));var timeout=require(_0x7aa1('0x2'));var express=require(_0x7aa1('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7aa1('0x4'));var config=require(_0x7aa1('0x5'));var controller=require(_0x7aa1('0x6'));router[_0x7aa1('0x7')]('/',auth[_0x7aa1('0x8')](),controller[_0x7aa1('0x9')]);router[_0x7aa1('0x7')](_0x7aa1('0xa'),auth[_0x7aa1('0x8')](),controller[_0x7aa1('0xb')]);router['get'](_0x7aa1('0xc'),auth[_0x7aa1('0x8')](),controller['getConfigurations']);router[_0x7aa1('0x7')](_0x7aa1('0xd'),auth['isAuthenticated'](),controller[_0x7aa1('0xe')]);router[_0x7aa1('0xf')]('/',auth['isAuthenticated'](),controller[_0x7aa1('0x10')]);router[_0x7aa1('0xf')](_0x7aa1('0xc'),auth[_0x7aa1('0x8')](),controller[_0x7aa1('0x11')]);router[_0x7aa1('0x12')](_0x7aa1('0xa'),auth[_0x7aa1('0x8')](),controller['update']);router[_0x7aa1('0x13')]('/:id',auth[_0x7aa1('0x8')](),controller[_0x7aa1('0x14')]);module[_0x7aa1('0x15')]=router; \ No newline at end of file +var _0xdc28=['getFields','post','create','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields'];(function(_0x342507,_0x2f846f){var _0x2ed5f9=function(_0x4b2f6f){while(--_0x4b2f6f){_0x342507['push'](_0x342507['shift']());}};_0x2ed5f9(++_0x2f846f);}(_0xdc28,0xaa));var _0x8dc2=function(_0x104658,_0x1d39c9){_0x104658=_0x104658-0x0;var _0x161cd7=_0xdc28[_0x104658];return _0x161cd7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8dc2('0x0'));var timeout=require(_0x8dc2('0x1'));var express=require(_0x8dc2('0x2'));var router=express['Router']();var auth=require(_0x8dc2('0x3'));var interaction=require(_0x8dc2('0x4'));var config=require(_0x8dc2('0x5'));var controller=require(_0x8dc2('0x6'));router[_0x8dc2('0x7')]('/',auth[_0x8dc2('0x8')](),controller[_0x8dc2('0x9')]);router['get'](_0x8dc2('0xa'),auth[_0x8dc2('0x8')](),controller[_0x8dc2('0xb')]);router[_0x8dc2('0x7')](_0x8dc2('0xc'),auth[_0x8dc2('0x8')](),controller['getConfigurations']);router[_0x8dc2('0x7')](_0x8dc2('0xd'),auth[_0x8dc2('0x8')](),controller[_0x8dc2('0xe')]);router[_0x8dc2('0xf')]('/',auth[_0x8dc2('0x8')](),controller[_0x8dc2('0x10')]);router[_0x8dc2('0xf')](_0x8dc2('0xc'),auth[_0x8dc2('0x8')](),controller[_0x8dc2('0x11')]);router[_0x8dc2('0x12')]('/:id',auth[_0x8dc2('0x8')](),controller[_0x8dc2('0x13')]);router[_0x8dc2('0x14')]('/:id',auth[_0x8dc2('0x8')](),controller[_0x8dc2('0x15')]);module[_0x8dc2('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 6605e8f..4ce4f51 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x160f=['sequelize','exports','STRING','username','remoteUri'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf160('0x0'));module[_0xf160('0x1')]={'name':{'type':Sequelize[_0xf160('0x2')]},'description':{'type':Sequelize[_0xf160('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xf160('0x3')},'apiKey':{'type':Sequelize[_0xf160('0x2')]},'remoteUri':{'type':Sequelize[_0xf160('0x2')],'unique':_0xf160('0x4')},'serverUrl':{'type':Sequelize[_0xf160('0x2')]}}; \ No newline at end of file +var _0xdf5d=['STRING','username','sequelize','exports'];(function(_0xbfb4f7,_0x4faad1){var _0x24ad4d=function(_0x23fb8b){while(--_0x23fb8b){_0xbfb4f7['push'](_0xbfb4f7['shift']());}};_0x24ad4d(++_0x4faad1);}(_0xdf5d,0x126));var _0xddf5=function(_0xa82ef6,_0x17467b){_0xa82ef6=_0xa82ef6-0x0;var _0x1bc16e=_0xdf5d[_0xa82ef6];return _0x1bc16e;};'use strict';var Sequelize=require(_0xddf5('0x0'));module[_0xddf5('0x1')]={'name':{'type':Sequelize[_0xddf5('0x2')]},'description':{'type':Sequelize[_0xddf5('0x2')]},'username':{'type':Sequelize[_0xddf5('0x2')],'unique':_0xddf5('0x3')},'apiKey':{'type':Sequelize[_0xddf5('0x2')]},'remoteUri':{'type':Sequelize[_0xddf5('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xddf5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index b742885..67ca33d 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x277f=['limit','order','sort','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','findAll','rows','show','length','include','find','create','update','body','params','destroy','getConfigurations','findOne','pick','map','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','remoteUri','slice','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','base64','requester','subject','agent','priority','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','apply','reject','save','stack','name','send','index','FreshdeskAccount','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit'];(function(_0x5123a6,_0x2fc043){var _0x174cca=function(_0x5b4af2){while(--_0x5b4af2){_0x5123a6['push'](_0x5123a6['shift']());}};_0x174cca(++_0x2fc043);}(_0x277f,0x1ba));var _0xf277=function(_0x441dcd,_0x169c7b){_0x441dcd=_0x441dcd-0x0;var _0x25b063=_0x277f[_0x441dcd];return _0x25b063;};'use strict';var pdf=require(_0xf277('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf277('0x1'));var jsonpatch=require(_0xf277('0x2'));var rp=require(_0xf277('0x3'));var moment=require(_0xf277('0x4'));var BPromise=require(_0xf277('0x5'));var Mustache=require(_0xf277('0x6'));var util=require(_0xf277('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf277('0x8'));var ejs=require(_0xf277('0x9'));var fs=require('fs');var _=require(_0xf277('0xa'));var squel=require('squel');var crypto=require(_0xf277('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf277('0x8'));var querystring=require(_0xf277('0xc'));var Papa=require(_0xf277('0xd'));var Redis=require(_0xf277('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf277('0xf'));var hardwareService=require(_0xf277('0x10'));var logger=require(_0xf277('0x11'))(_0xf277('0x12'));var utils=require(_0xf277('0x13'));var config=require(_0xf277('0x14'));var db=require(_0xf277('0x15'))['db'];var integrations=require(_0xf277('0x16'));var jayson=require(_0xf277('0x17'));var client=jayson[_0xf277('0x18')][_0xf277('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2b5037,_0x441964,_0x595fc3){if(_0x595fc3){var _0x1530b9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1530b9[_0xf277('0x1a')](_0x441964)){return _0x2b5037;}else{throw new Error(_0xf277('0x1b'));}}else{return _0x2b5037;}}function respondWithRpcPromise(_0x81526,_0x4fbcb8,_0x529489,_0x470035){return new BPromise(function(_0x4a5eed,_0xf5f705){var _0x4090d3=_0x470035||client;return _0x4090d3[_0xf277('0x1c')](_0x81526,_0x529489)[_0xf277('0x1d')](function(_0x29726b){logger[_0xf277('0x1e')](_0xf277('0x1f'),_0x4fbcb8,_0xf277('0x20'));logger[_0xf277('0x21')](_0xf277('0x22'),_0x4fbcb8,'request\x20sent',JSON[_0xf277('0x23')](_0x29726b));if(_0x29726b[_0xf277('0x24')]){if(_0x29726b[_0xf277('0x24')][_0xf277('0x25')]===0x1f4){logger['error'](_0xf277('0x1f'),_0x4fbcb8,_0x29726b['error']['message']);return _0xf5f705(_0x29726b[_0xf277('0x24')][_0xf277('0x26')]);}logger[_0xf277('0x24')](_0xf277('0x1f'),_0x4fbcb8,_0x29726b['error'][_0xf277('0x26')]);return _0x4a5eed(_0x29726b[_0xf277('0x24')][_0xf277('0x26')]);}else{logger[_0xf277('0x1e')](_0xf277('0x1f'),_0x4fbcb8,_0xf277('0x20'));_0x4a5eed(_0x29726b[_0xf277('0x27')][_0xf277('0x26')]);}})[_0xf277('0x28')](function(_0xa2a885){logger[_0xf277('0x24')](_0xf277('0x1f'),_0x4fbcb8,_0xa2a885);_0xf5f705(_0xa2a885);});});}function respondWithStatusCode(_0x5ae9ed,_0x2ffa06){_0x2ffa06=_0x2ffa06||0xcc;return function(_0x5ea56e){if(_0x5ea56e){return _0x5ae9ed[_0xf277('0x29')](_0x2ffa06);}return _0x5ae9ed[_0xf277('0x2a')](_0x2ffa06)[_0xf277('0x2b')]();};}function respondWithResult(_0x1193c1,_0x734b82){_0x734b82=_0x734b82||0xc8;return function(_0x5d5029){if(_0x5d5029){return _0x1193c1['status'](_0x734b82)[_0xf277('0x2c')](_0x5d5029);}};}function respondWithFilteredResult(_0x3401be,_0xf5645e){return function(_0x348348){if(_0x348348){var _0x1f3919=_0x348348[_0xf277('0x2d')],_0x2e912c=_0xf5645e['offset'],_0x4bafaf=_0xf5645e[_0xf277('0x2e')]+_0xf5645e['limit'],_0x50816d;if(_0x4bafaf>=_0x1f3919){_0x4bafaf=_0x1f3919;_0x50816d=0xc8;}else{_0x50816d=0xce;}_0x3401be[_0xf277('0x2a')](_0x50816d);return _0x3401be[_0xf277('0x2f')]('Content-Range',_0x2e912c+'-'+_0x4bafaf+'/'+_0x1f3919)[_0xf277('0x2c')](_0x348348);}return null;};}function patchUpdates(_0x24eb39){return function(_0x183529){try{jsonpatch[_0xf277('0x30')](_0x183529,_0x24eb39,!![]);}catch(_0x23963e){return BPromise[_0xf277('0x31')](_0x23963e);}return _0x183529[_0xf277('0x32')]();};}function saveUpdates(_0x226832,_0x59fcb2){return function(_0x14c8d2){if(_0x14c8d2){return _0x14c8d2['update'](_0x226832)[_0xf277('0x1d')](function(_0x21adb2){return _0x21adb2;});}return null;};}function removeEntity(_0x44820a,_0x32dc51){return function(_0x21e6ac){if(_0x21e6ac){return _0x21e6ac['destroy']()['then'](function(){_0x44820a[_0xf277('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2217f7,_0x3e018f){return function(_0x203849){if(!_0x203849){_0x2217f7[_0xf277('0x29')](0x194);}return _0x203849;};}function handleError(_0x34530e,_0x5475cc){_0x5475cc=_0x5475cc||0x1f4;return function(_0x1de383){logger['error'](_0x1de383[_0xf277('0x33')]);if(_0x1de383[_0xf277('0x34')]){delete _0x1de383[_0xf277('0x34')];}_0x34530e[_0xf277('0x2a')](_0x5475cc)[_0xf277('0x35')](_0x1de383);};}exports[_0xf277('0x36')]=function(_0xf86631,_0x459a3a){var _0x58be7b={},_0x49f2f7={},_0x7c956={'count':0x0,'rows':[]};var _0x29aa28=db[_0xf277('0x37')][_0xf277('0x38')];_0x49f2f7[_0xf277('0x39')]=_[_0xf277('0x3a')](_0x29aa28);_0x49f2f7[_0xf277('0x3b')]=_[_0xf277('0x3a')](_0xf86631[_0xf277('0x3b')]);_0x49f2f7[_0xf277('0x3c')]=_['intersection'](_0x49f2f7[_0xf277('0x39')],_0x49f2f7[_0xf277('0x3b')]);_0x58be7b[_0xf277('0x3d')]=_[_0xf277('0x3e')](_0x49f2f7[_0xf277('0x39')],qs[_0xf277('0x3f')](_0xf86631[_0xf277('0x3b')]['fields']));_0x58be7b[_0xf277('0x3d')]=_0x58be7b['attributes']['length']?_0x58be7b[_0xf277('0x3d')]:_0x49f2f7['model'];if(!_0xf86631[_0xf277('0x3b')][_0xf277('0x40')](_0xf277('0x41'))){_0x58be7b[_0xf277('0x42')]=qs['limit'](_0xf86631[_0xf277('0x3b')][_0xf277('0x42')]);_0x58be7b[_0xf277('0x2e')]=qs['offset'](_0xf86631[_0xf277('0x3b')][_0xf277('0x2e')]);}_0x58be7b[_0xf277('0x43')]=qs[_0xf277('0x44')](_0xf86631[_0xf277('0x3b')][_0xf277('0x44')]);_0x58be7b['where']=qs[_0xf277('0x3c')](_['pick'](_0xf86631[_0xf277('0x3b')],_0x49f2f7[_0xf277('0x3c')]));if(_0xf86631[_0xf277('0x3b')][_0xf277('0x45')]){_0x58be7b[_0xf277('0x46')]=_[_0xf277('0x47')](_0x58be7b[_0xf277('0x46')],{'$or':_['map'](_0x29aa28,function(_0x4c80aa){if(_0x4c80aa[_0xf277('0x48')][_0xf277('0x49')]!==_0xf277('0x4a')){var _0x288f5e={};_0x288f5e[_0x4c80aa[_0xf277('0x4b')]]={'$like':'%'+_0xf86631[_0xf277('0x3b')][_0xf277('0x45')]+'%'};return _0x288f5e;}})});}_0x58be7b=_[_0xf277('0x47')]({},_0x58be7b,_0xf86631[_0xf277('0x4c')]);var _0x551722={'where':_0x58be7b[_0xf277('0x46')]};return db['FreshdeskAccount'][_0xf277('0x2d')](_0x551722)['then'](function(_0x1a5e07){_0x7c956[_0xf277('0x2d')]=_0x1a5e07;if(_0xf86631[_0xf277('0x3b')][_0xf277('0x4d')]){_0x58be7b['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0xf277('0x4e')](_0x58be7b);})[_0xf277('0x1d')](function(_0x29c3c7){_0x7c956[_0xf277('0x4f')]=_0x29c3c7;return _0x7c956;})[_0xf277('0x1d')](respondWithFilteredResult(_0x459a3a,_0x58be7b))['catch'](handleError(_0x459a3a,null));};exports[_0xf277('0x50')]=function(_0x1fffb7,_0xb87b0b){var _0x354ecb={'raw':![],'where':{'id':_0x1fffb7['params']['id']}},_0x7208a9={};_0x7208a9['model']=_[_0xf277('0x3a')](db[_0xf277('0x37')][_0xf277('0x38')]);_0x7208a9[_0xf277('0x3b')]=_[_0xf277('0x3a')](_0x1fffb7['query']);_0x7208a9['filters']=_['intersection'](_0x7208a9['model'],_0x7208a9['query']);_0x354ecb['attributes']=_[_0xf277('0x3e')](_0x7208a9[_0xf277('0x39')],qs[_0xf277('0x3f')](_0x1fffb7[_0xf277('0x3b')][_0xf277('0x3f')]));_0x354ecb[_0xf277('0x3d')]=_0x354ecb[_0xf277('0x3d')][_0xf277('0x51')]?_0x354ecb[_0xf277('0x3d')]:_0x7208a9['model'];if(_0x1fffb7[_0xf277('0x3b')][_0xf277('0x4d')]){_0x354ecb[_0xf277('0x52')]=[{'all':!![]}];}_0x354ecb=_[_0xf277('0x47')]({},_0x354ecb,_0x1fffb7[_0xf277('0x4c')]);return db[_0xf277('0x37')][_0xf277('0x53')](_0x354ecb)[_0xf277('0x1d')](handleEntityNotFound(_0xb87b0b,null))[_0xf277('0x1d')](respondWithResult(_0xb87b0b,null))[_0xf277('0x28')](handleError(_0xb87b0b,null));};exports[_0xf277('0x54')]=function(_0x582843,_0x2ee2e6){return db[_0xf277('0x37')]['create'](_0x582843['body'],{})['then'](respondWithResult(_0x2ee2e6,0xc9))[_0xf277('0x28')](handleError(_0x2ee2e6,null));};exports[_0xf277('0x55')]=function(_0x51a211,_0x5a9d18){if(_0x51a211['body']['id']){delete _0x51a211[_0xf277('0x56')]['id'];}return db['FreshdeskAccount'][_0xf277('0x53')]({'where':{'id':_0x51a211[_0xf277('0x57')]['id']}})[_0xf277('0x1d')](handleEntityNotFound(_0x5a9d18,null))[_0xf277('0x1d')](saveUpdates(_0x51a211['body'],null))[_0xf277('0x1d')](respondWithResult(_0x5a9d18,null))['catch'](handleError(_0x5a9d18,null));};exports[_0xf277('0x58')]=function(_0x5ca4bf,_0x55cf43){return db[_0xf277('0x37')]['find']({'where':{'id':_0x5ca4bf[_0xf277('0x57')]['id']}})[_0xf277('0x1d')](handleEntityNotFound(_0x55cf43,null))[_0xf277('0x1d')](removeEntity(_0x55cf43,null))[_0xf277('0x28')](handleError(_0x55cf43,null));};exports[_0xf277('0x59')]=function(_0x4deb9c,_0x38053a,_0x712cbb){var _0xc687ee={};var _0x50e881={};var _0x54be5c;var _0x4dd4ed;return db[_0xf277('0x37')][_0xf277('0x5a')]({'where':{'id':_0x4deb9c[_0xf277('0x57')]['id']}})['then'](handleEntityNotFound(_0x38053a,null))['then'](function(_0x5a57df){if(_0x5a57df){_0x54be5c=_0x5a57df;_0x50e881[_0xf277('0x39')]=_[_0xf277('0x3a')](db['FreshdeskConfiguration'][_0xf277('0x38')]);_0x50e881[_0xf277('0x3b')]=_[_0xf277('0x3a')](_0x4deb9c[_0xf277('0x3b')]);_0x50e881['filters']=_['intersection'](_0x50e881['model'],_0x50e881[_0xf277('0x3b')]);_0xc687ee['attributes']=_[_0xf277('0x3e')](_0x50e881['model'],qs['fields'](_0x4deb9c[_0xf277('0x3b')][_0xf277('0x3f')]));_0xc687ee['attributes']=_0xc687ee[_0xf277('0x3d')][_0xf277('0x51')]?_0xc687ee[_0xf277('0x3d')]:_0x50e881[_0xf277('0x39')];_0xc687ee[_0xf277('0x43')]=qs['sort'](_0x4deb9c[_0xf277('0x3b')][_0xf277('0x44')]);_0xc687ee[_0xf277('0x46')]=qs[_0xf277('0x3c')](_[_0xf277('0x5b')](_0x4deb9c['query'],_0x50e881[_0xf277('0x3c')]));if(_0x4deb9c[_0xf277('0x3b')][_0xf277('0x45')]){_0xc687ee[_0xf277('0x46')]=_[_0xf277('0x47')](_0xc687ee['where'],{'$or':_[_0xf277('0x5c')](_0xc687ee[_0xf277('0x3d')],function(_0x5a53d4){var _0x46a786={};_0x46a786[_0x5a53d4]={'$like':'%'+_0x4deb9c[_0xf277('0x3b')]['filter']+'%'};return _0x46a786;})});}_0xc687ee=_[_0xf277('0x47')]({},_0xc687ee,_0x4deb9c['options']);return _0x54be5c['getConfigurations'](_0xc687ee);}})[_0xf277('0x1d')](function(_0x46f8e4){if(_0x46f8e4){_0x4dd4ed=_0x46f8e4[_0xf277('0x51')];if(!_0x4deb9c[_0xf277('0x3b')][_0xf277('0x40')](_0xf277('0x41'))){_0xc687ee[_0xf277('0x42')]=qs['limit'](_0x4deb9c[_0xf277('0x3b')][_0xf277('0x42')]);_0xc687ee[_0xf277('0x2e')]=qs[_0xf277('0x2e')](_0x4deb9c['query'][_0xf277('0x2e')]);}return _0x54be5c[_0xf277('0x59')](_0xc687ee);}})[_0xf277('0x1d')](function(_0xc7ea91){if(_0xc7ea91){return _0xc7ea91?{'count':_0x4dd4ed,'rows':_0xc7ea91}:null;}})[_0xf277('0x1d')](respondWithResult(_0x38053a,null))[_0xf277('0x28')](handleError(_0x38053a,null));};exports[_0xf277('0x5d')]=function(_0x3e8698,_0x4f54c2,_0x21d31d){if(_0x3e8698[_0xf277('0x56')]['id']){delete _0x3e8698[_0xf277('0x56')]['id'];}return db[_0xf277('0x37')][_0xf277('0x5a')]({'where':{'id':_0x3e8698[_0xf277('0x57')]['id']}})[_0xf277('0x1d')](handleEntityNotFound(_0x4f54c2,null))['then'](function(_0x2aca1b){if(_0x2aca1b){_0x3e8698[_0xf277('0x56')][_0xf277('0x5e')]=_0x2aca1b['id'];_0x3e8698[_0xf277('0x56')][_0xf277('0x5f')]=integrations[_0xf277('0x60')](_0x3e8698[_0xf277('0x56')][_0xf277('0x61')],_0x3e8698[_0xf277('0x56')][_0xf277('0x48')]);_0x3e8698[_0xf277('0x56')]['Descriptions']=integrations[_0xf277('0x62')](_0x3e8698[_0xf277('0x56')][_0xf277('0x61')],_0x3e8698[_0xf277('0x56')][_0xf277('0x48')]);return db['FreshdeskConfiguration'][_0xf277('0x54')](_0x3e8698[_0xf277('0x56')],{'include':[{'model':db[_0xf277('0x63')],'as':_0xf277('0x5f')},{'model':db[_0xf277('0x63')],'as':_0xf277('0x64')}]});}return null;})[_0xf277('0x1d')](respondWithResult(_0x4f54c2,null))['catch'](handleError(_0x4f54c2,null));};exports['getFields']=function(_0x1265f2,_0x871815,_0x10ca27){var _0x14720c='';return db[_0xf277('0x37')][_0xf277('0x5a')]({'where':{'id':_0x1265f2[_0xf277('0x57')]['id']},'attributes':['id',_0xf277('0x65'),'apiKey']})[_0xf277('0x1d')](handleEntityNotFound(_0x871815,null))['then'](function(_0x550eba){if(_0x550eba){_0x14720c=_0x550eba[_0xf277('0x65')];var _0x3140cc=_0x14720c[_0xf277('0x66')](-0x1);if(_0x3140cc==='/'){_0x14720c=_0x14720c['substring'](0x0,_0x14720c[_0xf277('0x67')](_0x3140cc));}return rp({'method':_0xf277('0x68'),'uri':util[_0xf277('0x69')]('%s/%s',_0x14720c,_0xf277('0x6a')),'headers':{'Authorization':util['format'](_0xf277('0x6b'),new Buffer(util['format'](_0xf277('0x6c'),_0x550eba[_0xf277('0x6d')]))['toString'](_0xf277('0x6e')))},'json':!![]});}})[_0xf277('0x1d')](function(_0x2bf4a0){if(_0x2bf4a0){var _0x49e670=[_0xf277('0x6f'),_0xf277('0x70'),_0xf277('0x71'),'description','status',_0xf277('0x72'),_0xf277('0x73'),'source',_0xf277('0x74'),_0xf277('0x73'),_0xf277('0x75')];_[_0xf277('0x76')](_0x2bf4a0,function(_0x184ef9){return _0x49e670[_0xf277('0x77')](_0x184ef9[_0xf277('0x34')])||!_0x184ef9[_0xf277('0x78')]&&_0x184ef9[_0xf277('0x48')]!==_0xf277('0x79')&&_0x184ef9['type']!==_0xf277('0x7a');});return{'count':_0x2bf4a0[_0xf277('0x51')],'rows':_[_0xf277('0x5c')](_0x2bf4a0,function(_0xa47125){return{'id':_0xa47125[_0xf277('0x34')],'name':_0xa47125['label'],'custom':!_0xa47125['default'],'options':_0xa47125['choices']?_[_0xf277('0x5c')](_0xa47125[_0xf277('0x7b')],function(_0x704d70){return{'name':_['capitalize'](_0x704d70),'value':_0x704d70};}):[]};})};}})[_0xf277('0x1d')](respondWithResult(_0x871815,null))[_0xf277('0x28')](function(_0x1214f6){var _0x2f17e9=_0x1265f2[_0xf277('0x3b')]['test']?0x1f4:_0x1214f6[_0xf277('0x7c')]||0x1f4;logger[_0xf277('0x24')](_0xf277('0x7d'),_0xf277('0x7e'),_0x2f17e9,JSON[_0xf277('0x23')](_0x1214f6));delete _0x1214f6[_0xf277('0x34')];if(_0x2f17e9===0x191){_0x2f17e9=0x190;}_0x871815['status'](_0x2f17e9)['send'](_0x1265f2['query'][_0xf277('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x1214f6[_0xf277('0x7c')]}:_0x1214f6);});}; \ No newline at end of file +var _0x052f=['../../config/license/hardware','../../config/logger','../../config/utils','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','stack','name','index','FreshdeskAccount','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','rows','show','intersection','include','find','create','body','params','catch','destroy','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','getFields','remoteUri','substring','GET','%s/%s','format','Basic\x20%s','apiKey','toString','requester','subject','agent','description','group','source','ticket_type','company','remove','default','custom_text','custom_dropdown','label','choices','capitalize','send','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3d86f5,_0x257914){var _0x2d6881=function(_0x2d912e){while(--_0x2d912e){_0x3d86f5['push'](_0x3d86f5['shift']());}};_0x2d6881(++_0x257914);}(_0x052f,0x66));var _0xf052=function(_0x44f5b5,_0x1fc386){_0x44f5b5=_0x44f5b5-0x0;var _0x4c568f=_0x052f[_0x44f5b5];return _0x4c568f;};'use strict';var pdf=require(_0xf052('0x0'));var emlformat=require(_0xf052('0x1'));var rimraf=require(_0xf052('0x2'));var zipdir=require(_0xf052('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf052('0x4'));var moment=require(_0xf052('0x5'));var BPromise=require(_0xf052('0x6'));var Mustache=require(_0xf052('0x7'));var util=require('util');var path=require(_0xf052('0x8'));var sox=require(_0xf052('0x9'));var csv=require(_0xf052('0xa'));var ejs=require(_0xf052('0xb'));var fs=require('fs');var _=require(_0xf052('0xc'));var squel=require(_0xf052('0xd'));var crypto=require('crypto');var jsforce=require(_0xf052('0xe'));var deskjs=require(_0xf052('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf052('0x10'));var Papa=require(_0xf052('0x11'));var Redis=require(_0xf052('0x12'));var authService=require(_0xf052('0x13'));var qs=require(_0xf052('0x14'));var hardwareService=require(_0xf052('0x15'));var logger=require(_0xf052('0x16'))('api');var utils=require(_0xf052('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xf052('0x18'));var client=jayson['client'][_0xf052('0x19')]({'port':0x232a});function checkPasswordPattern(_0x28f1ec,_0x296e8a,_0x1a7e14){if(_0x1a7e14){var _0x3be4f8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3be4f8[_0xf052('0x1a')](_0x296e8a)){return _0x28f1ec;}else{throw new Error(_0xf052('0x1b'));}}else{return _0x28f1ec;}}function respondWithRpcPromise(_0x17cbeb,_0x105121,_0x4ac504,_0x57e362){return new BPromise(function(_0xc18734,_0x2b339f){var _0x13b1c0=_0x57e362||client;return _0x13b1c0['request'](_0x17cbeb,_0x4ac504)[_0xf052('0x1c')](function(_0x92c093){logger[_0xf052('0x1d')]('FreshdeskAccount,\x20%s,\x20%s',_0x105121,_0xf052('0x1e'));logger[_0xf052('0x1f')](_0xf052('0x20'),_0x105121,'request\x20sent',JSON[_0xf052('0x21')](_0x92c093));if(_0x92c093[_0xf052('0x22')]){if(_0x92c093[_0xf052('0x22')][_0xf052('0x23')]===0x1f4){logger[_0xf052('0x22')](_0xf052('0x24'),_0x105121,_0x92c093[_0xf052('0x22')][_0xf052('0x25')]);return _0x2b339f(_0x92c093['error'][_0xf052('0x25')]);}logger['error'](_0xf052('0x24'),_0x105121,_0x92c093[_0xf052('0x22')][_0xf052('0x25')]);return _0xc18734(_0x92c093[_0xf052('0x22')][_0xf052('0x25')]);}else{logger[_0xf052('0x1d')](_0xf052('0x24'),_0x105121,'request\x20sent');_0xc18734(_0x92c093['result'][_0xf052('0x25')]);}})['catch'](function(_0x1ac0cf){logger[_0xf052('0x22')](_0xf052('0x24'),_0x105121,_0x1ac0cf);_0x2b339f(_0x1ac0cf);});});}function respondWithStatusCode(_0x3b1350,_0x44bd10){_0x44bd10=_0x44bd10||0xcc;return function(_0x3128ef){if(_0x3128ef){return _0x3b1350[_0xf052('0x26')](_0x44bd10);}return _0x3b1350[_0xf052('0x27')](_0x44bd10)['end']();};}function respondWithResult(_0x18bd6f,_0xb43eed){_0xb43eed=_0xb43eed||0xc8;return function(_0x979898){if(_0x979898){return _0x18bd6f[_0xf052('0x27')](_0xb43eed)[_0xf052('0x28')](_0x979898);}};}function respondWithFilteredResult(_0x20570b,_0x43d991){return function(_0x22ab7a){if(_0x22ab7a){var _0x44188e=_0x22ab7a[_0xf052('0x29')],_0x53646e=_0x43d991[_0xf052('0x2a')],_0x9738b5=_0x43d991[_0xf052('0x2a')]+_0x43d991[_0xf052('0x2b')],_0x3916e5;if(_0x9738b5>=_0x44188e){_0x9738b5=_0x44188e;_0x3916e5=0xc8;}else{_0x3916e5=0xce;}_0x20570b[_0xf052('0x27')](_0x3916e5);return _0x20570b['set'](_0xf052('0x2c'),_0x53646e+'-'+_0x9738b5+'/'+_0x44188e)[_0xf052('0x28')](_0x22ab7a);}return null;};}function patchUpdates(_0x9b5860){return function(_0x5bc5ab){try{jsonpatch[_0xf052('0x2d')](_0x5bc5ab,_0x9b5860,!![]);}catch(_0x29e27f){return BPromise[_0xf052('0x2e')](_0x29e27f);}return _0x5bc5ab[_0xf052('0x2f')]();};}function saveUpdates(_0x31ffc6,_0x53e313){return function(_0x3bb302){if(_0x3bb302){return _0x3bb302['update'](_0x31ffc6)[_0xf052('0x1c')](function(_0x20b64b){return _0x20b64b;});}return null;};}function removeEntity(_0x44fee8,_0x42c829){return function(_0x21db04){if(_0x21db04){return _0x21db04['destroy']()[_0xf052('0x1c')](function(){_0x44fee8[_0xf052('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1385f5,_0x185e8a){return function(_0x576345){if(!_0x576345){_0x1385f5[_0xf052('0x26')](0x194);}return _0x576345;};}function handleError(_0x321843,_0x47dfe6){_0x47dfe6=_0x47dfe6||0x1f4;return function(_0x2c32ef){logger[_0xf052('0x22')](_0x2c32ef[_0xf052('0x30')]);if(_0x2c32ef[_0xf052('0x31')]){delete _0x2c32ef[_0xf052('0x31')];}_0x321843[_0xf052('0x27')](_0x47dfe6)['send'](_0x2c32ef);};}exports[_0xf052('0x32')]=function(_0x19c342,_0x14804e){var _0x38ca84={},_0x18645a={},_0xcb6af4={'count':0x0,'rows':[]};var _0x2208e9=db[_0xf052('0x33')][_0xf052('0x34')];_0x18645a[_0xf052('0x35')]=_[_0xf052('0x36')](_0x2208e9);_0x18645a[_0xf052('0x37')]=_['keys'](_0x19c342[_0xf052('0x37')]);_0x18645a[_0xf052('0x38')]=_['intersection'](_0x18645a[_0xf052('0x35')],_0x18645a[_0xf052('0x37')]);_0x38ca84[_0xf052('0x39')]=_['intersection'](_0x18645a[_0xf052('0x35')],qs['fields'](_0x19c342[_0xf052('0x37')][_0xf052('0x3a')]));_0x38ca84[_0xf052('0x39')]=_0x38ca84[_0xf052('0x39')][_0xf052('0x3b')]?_0x38ca84['attributes']:_0x18645a['model'];if(!_0x19c342[_0xf052('0x37')][_0xf052('0x3c')](_0xf052('0x3d'))){_0x38ca84[_0xf052('0x2b')]=qs[_0xf052('0x2b')](_0x19c342[_0xf052('0x37')][_0xf052('0x2b')]);_0x38ca84[_0xf052('0x2a')]=qs[_0xf052('0x2a')](_0x19c342[_0xf052('0x37')][_0xf052('0x2a')]);}_0x38ca84[_0xf052('0x3e')]=qs[_0xf052('0x3f')](_0x19c342['query'][_0xf052('0x3f')]);_0x38ca84[_0xf052('0x40')]=qs[_0xf052('0x38')](_[_0xf052('0x41')](_0x19c342[_0xf052('0x37')],_0x18645a[_0xf052('0x38')]));if(_0x19c342[_0xf052('0x37')][_0xf052('0x42')]){_0x38ca84['where']=_[_0xf052('0x43')](_0x38ca84[_0xf052('0x40')],{'$or':_[_0xf052('0x44')](_0x2208e9,function(_0x314e40){if(_0x314e40[_0xf052('0x45')][_0xf052('0x46')]!==_0xf052('0x47')){var _0x326cd9={};_0x326cd9[_0x314e40[_0xf052('0x48')]]={'$like':'%'+_0x19c342[_0xf052('0x37')]['filter']+'%'};return _0x326cd9;}})});}_0x38ca84=_[_0xf052('0x43')]({},_0x38ca84,_0x19c342[_0xf052('0x49')]);var _0x54b5ea={'where':_0x38ca84[_0xf052('0x40')]};return db[_0xf052('0x33')][_0xf052('0x29')](_0x54b5ea)['then'](function(_0x10192a){_0xcb6af4[_0xf052('0x29')]=_0x10192a;if(_0x19c342[_0xf052('0x37')][_0xf052('0x4a')]){_0x38ca84['include']=[{'all':!![]}];}return db[_0xf052('0x33')]['findAll'](_0x38ca84);})['then'](function(_0xf37582){_0xcb6af4[_0xf052('0x4b')]=_0xf37582;return _0xcb6af4;})[_0xf052('0x1c')](respondWithFilteredResult(_0x14804e,_0x38ca84))['catch'](handleError(_0x14804e,null));};exports[_0xf052('0x4c')]=function(_0x54ad97,_0x22939d){var _0x1aa187={'raw':![],'where':{'id':_0x54ad97['params']['id']}},_0x42bc98={};_0x42bc98[_0xf052('0x35')]=_[_0xf052('0x36')](db['FreshdeskAccount'][_0xf052('0x34')]);_0x42bc98[_0xf052('0x37')]=_[_0xf052('0x36')](_0x54ad97['query']);_0x42bc98['filters']=_[_0xf052('0x4d')](_0x42bc98[_0xf052('0x35')],_0x42bc98['query']);_0x1aa187['attributes']=_[_0xf052('0x4d')](_0x42bc98[_0xf052('0x35')],qs[_0xf052('0x3a')](_0x54ad97[_0xf052('0x37')][_0xf052('0x3a')]));_0x1aa187['attributes']=_0x1aa187[_0xf052('0x39')][_0xf052('0x3b')]?_0x1aa187[_0xf052('0x39')]:_0x42bc98[_0xf052('0x35')];if(_0x54ad97[_0xf052('0x37')][_0xf052('0x4a')]){_0x1aa187[_0xf052('0x4e')]=[{'all':!![]}];}_0x1aa187=_[_0xf052('0x43')]({},_0x1aa187,_0x54ad97[_0xf052('0x49')]);return db['FreshdeskAccount'][_0xf052('0x4f')](_0x1aa187)[_0xf052('0x1c')](handleEntityNotFound(_0x22939d,null))['then'](respondWithResult(_0x22939d,null))['catch'](handleError(_0x22939d,null));};exports[_0xf052('0x50')]=function(_0x39b1df,_0x4c6cc6){return db[_0xf052('0x33')][_0xf052('0x50')](_0x39b1df[_0xf052('0x51')],{})[_0xf052('0x1c')](respondWithResult(_0x4c6cc6,0xc9))['catch'](handleError(_0x4c6cc6,null));};exports['update']=function(_0x416ce6,_0x540d01){if(_0x416ce6['body']['id']){delete _0x416ce6[_0xf052('0x51')]['id'];}return db[_0xf052('0x33')][_0xf052('0x4f')]({'where':{'id':_0x416ce6[_0xf052('0x52')]['id']}})[_0xf052('0x1c')](handleEntityNotFound(_0x540d01,null))['then'](saveUpdates(_0x416ce6['body'],null))[_0xf052('0x1c')](respondWithResult(_0x540d01,null))[_0xf052('0x53')](handleError(_0x540d01,null));};exports[_0xf052('0x54')]=function(_0x41f1bb,_0x2fdbcd){return db['FreshdeskAccount'][_0xf052('0x4f')]({'where':{'id':_0x41f1bb[_0xf052('0x52')]['id']}})[_0xf052('0x1c')](handleEntityNotFound(_0x2fdbcd,null))[_0xf052('0x1c')](removeEntity(_0x2fdbcd,null))[_0xf052('0x53')](handleError(_0x2fdbcd,null));};exports[_0xf052('0x55')]=function(_0xd0767b,_0x11f4ec,_0x57da25){var _0x14215b={};var _0x35f59e={};var _0x43bc63;var _0x2770c6;return db['FreshdeskAccount'][_0xf052('0x56')]({'where':{'id':_0xd0767b[_0xf052('0x52')]['id']}})[_0xf052('0x1c')](handleEntityNotFound(_0x11f4ec,null))[_0xf052('0x1c')](function(_0x5c92be){if(_0x5c92be){_0x43bc63=_0x5c92be;_0x35f59e[_0xf052('0x35')]=_[_0xf052('0x36')](db[_0xf052('0x57')]['rawAttributes']);_0x35f59e[_0xf052('0x37')]=_[_0xf052('0x36')](_0xd0767b['query']);_0x35f59e[_0xf052('0x38')]=_[_0xf052('0x4d')](_0x35f59e[_0xf052('0x35')],_0x35f59e[_0xf052('0x37')]);_0x14215b[_0xf052('0x39')]=_[_0xf052('0x4d')](_0x35f59e[_0xf052('0x35')],qs[_0xf052('0x3a')](_0xd0767b[_0xf052('0x37')]['fields']));_0x14215b[_0xf052('0x39')]=_0x14215b[_0xf052('0x39')][_0xf052('0x3b')]?_0x14215b['attributes']:_0x35f59e['model'];_0x14215b[_0xf052('0x3e')]=qs['sort'](_0xd0767b[_0xf052('0x37')]['sort']);_0x14215b[_0xf052('0x40')]=qs[_0xf052('0x38')](_[_0xf052('0x41')](_0xd0767b[_0xf052('0x37')],_0x35f59e[_0xf052('0x38')]));if(_0xd0767b[_0xf052('0x37')]['filter']){_0x14215b[_0xf052('0x40')]=_['merge'](_0x14215b[_0xf052('0x40')],{'$or':_[_0xf052('0x44')](_0x14215b['attributes'],function(_0x30c387){var _0x451bac={};_0x451bac[_0x30c387]={'$like':'%'+_0xd0767b[_0xf052('0x37')][_0xf052('0x42')]+'%'};return _0x451bac;})});}_0x14215b=_['merge']({},_0x14215b,_0xd0767b['options']);return _0x43bc63[_0xf052('0x55')](_0x14215b);}})[_0xf052('0x1c')](function(_0x459e6e){if(_0x459e6e){_0x2770c6=_0x459e6e[_0xf052('0x3b')];if(!_0xd0767b[_0xf052('0x37')][_0xf052('0x3c')](_0xf052('0x3d'))){_0x14215b['limit']=qs[_0xf052('0x2b')](_0xd0767b[_0xf052('0x37')][_0xf052('0x2b')]);_0x14215b[_0xf052('0x2a')]=qs['offset'](_0xd0767b[_0xf052('0x37')]['offset']);}return _0x43bc63[_0xf052('0x55')](_0x14215b);}})[_0xf052('0x1c')](function(_0x479c97){if(_0x479c97){return _0x479c97?{'count':_0x2770c6,'rows':_0x479c97}:null;}})['then'](respondWithResult(_0x11f4ec,null))[_0xf052('0x53')](handleError(_0x11f4ec,null));};exports[_0xf052('0x58')]=function(_0x572fff,_0x1e2a81,_0x437668){if(_0x572fff[_0xf052('0x51')]['id']){delete _0x572fff[_0xf052('0x51')]['id'];}return db[_0xf052('0x33')]['findOne']({'where':{'id':_0x572fff['params']['id']}})[_0xf052('0x1c')](handleEntityNotFound(_0x1e2a81,null))['then'](function(_0x3aacf2){if(_0x3aacf2){_0x572fff['body'][_0xf052('0x59')]=_0x3aacf2['id'];_0x572fff[_0xf052('0x51')][_0xf052('0x5a')]=integrations[_0xf052('0x5b')](_0x572fff[_0xf052('0x51')]['channel'],_0x572fff[_0xf052('0x51')][_0xf052('0x45')]);_0x572fff['body'][_0xf052('0x5c')]=integrations[_0xf052('0x5d')](_0x572fff[_0xf052('0x51')][_0xf052('0x5e')],_0x572fff[_0xf052('0x51')][_0xf052('0x45')]);return db['FreshdeskConfiguration'][_0xf052('0x50')](_0x572fff['body'],{'include':[{'model':db[_0xf052('0x5f')],'as':_0xf052('0x5a')},{'model':db[_0xf052('0x5f')],'as':_0xf052('0x5c')}]});}return null;})[_0xf052('0x1c')](respondWithResult(_0x1e2a81,null))['catch'](handleError(_0x1e2a81,null));};exports[_0xf052('0x60')]=function(_0x5183a0,_0x53d23d,_0x121df7){var _0x5242af='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x5183a0[_0xf052('0x52')]['id']},'attributes':['id',_0xf052('0x61'),'apiKey']})[_0xf052('0x1c')](handleEntityNotFound(_0x53d23d,null))[_0xf052('0x1c')](function(_0x368f3e){if(_0x368f3e){_0x5242af=_0x368f3e['remoteUri'];var _0x3d491a=_0x5242af['slice'](-0x1);if(_0x3d491a==='/'){_0x5242af=_0x5242af[_0xf052('0x62')](0x0,_0x5242af['lastIndexOf'](_0x3d491a));}return rp({'method':_0xf052('0x63'),'uri':util['format'](_0xf052('0x64'),_0x5242af,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xf052('0x65')](_0xf052('0x66'),new Buffer(util['format']('%s:X',_0x368f3e[_0xf052('0x67')]))[_0xf052('0x68')]('base64'))},'json':!![]});}})[_0xf052('0x1c')](function(_0x474611){if(_0x474611){var _0x5773ee=[_0xf052('0x69'),_0xf052('0x6a'),_0xf052('0x6b'),_0xf052('0x6c'),_0xf052('0x27'),'priority',_0xf052('0x6d'),_0xf052('0x6e'),_0xf052('0x6f'),_0xf052('0x6d'),_0xf052('0x70')];_[_0xf052('0x71')](_0x474611,function(_0x2df9af){return _0x5773ee['includes'](_0x2df9af[_0xf052('0x31')])||!_0x2df9af[_0xf052('0x72')]&&_0x2df9af[_0xf052('0x45')]!==_0xf052('0x73')&&_0x2df9af[_0xf052('0x45')]!==_0xf052('0x74');});return{'count':_0x474611[_0xf052('0x3b')],'rows':_[_0xf052('0x44')](_0x474611,function(_0x42276e){return{'id':_0x42276e[_0xf052('0x31')],'name':_0x42276e[_0xf052('0x75')],'custom':!_0x42276e[_0xf052('0x72')],'options':_0x42276e[_0xf052('0x76')]?_[_0xf052('0x44')](_0x42276e[_0xf052('0x76')],function(_0x426e1a){return{'name':_[_0xf052('0x77')](_0x426e1a),'value':_0x426e1a};}):[]};})};}})[_0xf052('0x1c')](respondWithResult(_0x53d23d,null))['catch'](function(_0x2f195e){var _0x3ed643=_0x5183a0[_0xf052('0x37')]['test']?0x1f4:_0x2f195e['statusCode']||0x1f4;logger[_0xf052('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0xf052('0x60'),_0x3ed643,JSON[_0xf052('0x21')](_0x2f195e));delete _0x2f195e[_0xf052('0x31')];if(_0x3ed643===0x191){_0x3ed643=0x190;}_0x53d23d[_0xf052('0x27')](_0x3ed643)[_0xf052('0x78')](_0x5183a0['query'][_0xf052('0x1a')]?{'message':_0xf052('0x79'),'statusCode':_0x2f195e[_0xf052('0x7a')]}:_0x2f195e);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 2b2bbdd..5b218e9 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b26=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x453ea9,_0x383979){var _0x249c23=function(_0x541a11){while(--_0x541a11){_0x453ea9['push'](_0x453ea9['shift']());}};_0x249c23(++_0x383979);}(_0x6b26,0x9d));var _0x66b2=function(_0x557d17,_0x46e679){_0x557d17=_0x557d17-0x0;var _0x583724=_0x6b26[_0x557d17];return _0x583724;};'use strict';var _=require(_0x66b2('0x0'));var util=require(_0x66b2('0x1'));var logger=require(_0x66b2('0x2'))(_0x66b2('0x3'));var moment=require(_0x66b2('0x4'));var BPromise=require(_0x66b2('0x5'));var rp=require(_0x66b2('0x6'));var fs=require('fs');var path=require(_0x66b2('0x7'));var rimraf=require(_0x66b2('0x8'));var config=require(_0x66b2('0x9'));var attributes=require(_0x66b2('0xa'));var integrations=require(_0x66b2('0xb'));module[_0x66b2('0xc')]=function(_0x39a838,_0x11e38a){return _0x39a838[_0x66b2('0xd')]('FreshdeskAccount',attributes,{'tableName':_0x66b2('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ad4=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger'];(function(_0x10b09d,_0x4a72d2){var _0x1695c7=function(_0x31219b){while(--_0x31219b){_0x10b09d['push'](_0x10b09d['shift']());}};_0x1695c7(++_0x4a72d2);}(_0x4ad4,0x101));var _0x44ad=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x4ad4[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0x44ad('0x0'));var util=require(_0x44ad('0x1'));var logger=require(_0x44ad('0x2'))(_0x44ad('0x3'));var moment=require('moment');var BPromise=require(_0x44ad('0x4'));var rp=require(_0x44ad('0x5'));var fs=require('fs');var path=require(_0x44ad('0x6'));var rimraf=require(_0x44ad('0x7'));var config=require(_0x44ad('0x8'));var attributes=require(_0x44ad('0x9'));var integrations=require(_0x44ad('0xa'));module[_0x44ad('0xb')]=function(_0x42c614,_0xaf4100){return _0x42c614[_0x44ad('0xc')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 2dc05d1..c83c6aa 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3942=['info','result','catch','GetFreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowFreshdeskAccount','FreshdeskAccount','where','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x23a183,_0x3e3922){var _0xe5e487=function(_0x575e72){while(--_0x575e72){_0x23a183['push'](_0x23a183['shift']());}};_0xe5e487(++_0x3e3922);}(_0x3942,0x1af));var _0x2394=function(_0x4042a5,_0x5a0932){_0x4042a5=_0x4042a5-0x0;var _0x348c98=_0x3942[_0x4042a5];return _0x348c98;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2394('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2394('0x1'));var db=require(_0x2394('0x2'))['db'];var utils=require(_0x2394('0x3'));var logger=require(_0x2394('0x4'))(_0x2394('0x5'));var config=require(_0x2394('0x6'));var jayson=require(_0x2394('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43671a,_0x444d5e,_0xd91047){return new BPromise(function(_0x1975b8,_0x2e1507){return client[_0x2394('0x8')](_0x43671a,_0xd91047)[_0x2394('0x9')](function(_0x85865d){logger['info'](_0x2394('0xa'),_0x444d5e,_0x2394('0xb'));logger[_0x2394('0xc')](_0x2394('0xd'),_0x444d5e,_0x2394('0xb'),JSON[_0x2394('0xe')](_0x85865d));if(_0x85865d[_0x2394('0xf')]){if(_0x85865d[_0x2394('0xf')]['code']===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x444d5e,_0x85865d['error'][_0x2394('0x10')]);return _0x2e1507(_0x85865d[_0x2394('0xf')][_0x2394('0x10')]);}logger['error'](_0x2394('0xa'),_0x444d5e,_0x85865d['error']['message']);return _0x1975b8(_0x85865d['error'][_0x2394('0x10')]);}else{logger[_0x2394('0x11')](_0x2394('0xa'),_0x444d5e,'request\x20sent');_0x1975b8(_0x85865d[_0x2394('0x12')][_0x2394('0x10')]);}})[_0x2394('0x13')](function(_0x336358){logger['error'](_0x2394('0xa'),_0x444d5e,_0x336358);_0x2e1507(_0x336358);});});}exports[_0x2394('0x14')]=function(_0x397614){var _0x9e1ef4=this;return new Promise(function(_0x55bebf,_0x366e6b){return db['FreshdeskAccount'][_0x2394('0x15')]({'raw':_0x397614[_0x2394('0x16')]?_0x397614['options'][_0x2394('0x17')]===undefined?!![]:![]:!![],'where':_0x397614[_0x2394('0x16')]?_0x397614['options']['where']||null:null,'attributes':_0x397614[_0x2394('0x16')]?_0x397614['options'][_0x2394('0x18')]||null:null,'limit':_0x397614[_0x2394('0x16')]?_0x397614[_0x2394('0x16')][_0x2394('0x19')]||null:null,'include':_0x397614[_0x2394('0x16')]?_0x397614[_0x2394('0x16')][_0x2394('0x1a')]?_['map'](_0x397614[_0x2394('0x16')][_0x2394('0x1a')],function(_0xfafe07){return{'model':db[_0xfafe07['model']],'as':_0xfafe07['as'],'attributes':_0xfafe07[_0x2394('0x18')],'include':_0xfafe07[_0x2394('0x1a')]?_[_0x2394('0x1b')](_0xfafe07[_0x2394('0x1a')],function(_0x691e2c){return{'model':db[_0x691e2c[_0x2394('0x1c')]],'as':_0x691e2c['as'],'attributes':_0x691e2c[_0x2394('0x18')],'include':_0x691e2c[_0x2394('0x1a')]?_['map'](_0x691e2c[_0x2394('0x1a')],function(_0x28a5fe){return{'model':db[_0x28a5fe[_0x2394('0x1c')]],'as':_0x28a5fe['as'],'attributes':_0x28a5fe[_0x2394('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33266f){logger[_0x2394('0x11')]('GetFreshdeskAccount',_0x397614);logger[_0x2394('0xc')](_0x2394('0x14'),_0x397614,JSON[_0x2394('0xe')](_0x33266f));_0x55bebf(_0x33266f);})[_0x2394('0x13')](function(_0x5193f0){logger[_0x2394('0xf')](_0x2394('0x14'),_0x5193f0[_0x2394('0x10')],_0x397614);_0x366e6b(_0x9e1ef4[_0x2394('0xf')](0x1f4,_0x5193f0[_0x2394('0x10')]));});});};exports[_0x2394('0x1d')]=function(_0x533d01){var _0x191cb1=this;return new Promise(function(_0x5610bd,_0x180c08){return db[_0x2394('0x1e')]['find']({'raw':_0x533d01[_0x2394('0x16')]?_0x533d01[_0x2394('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x533d01[_0x2394('0x16')]?_0x533d01['options'][_0x2394('0x1f')]||null:null,'attributes':_0x533d01['options']?_0x533d01[_0x2394('0x16')]['attributes']||null:null,'include':_0x533d01[_0x2394('0x16')]?_0x533d01[_0x2394('0x16')][_0x2394('0x1a')]?_[_0x2394('0x1b')](_0x533d01['options'][_0x2394('0x1a')],function(_0x96c7a1){return{'model':db[_0x96c7a1['model']],'as':_0x96c7a1['as'],'attributes':_0x96c7a1[_0x2394('0x18')],'include':_0x96c7a1[_0x2394('0x1a')]?_['map'](_0x96c7a1[_0x2394('0x1a')],function(_0x5cbfef){return{'model':db[_0x5cbfef[_0x2394('0x1c')]],'as':_0x5cbfef['as'],'attributes':_0x5cbfef[_0x2394('0x18')],'include':_0x5cbfef['include']?_[_0x2394('0x1b')](_0x5cbfef['include'],function(_0x5327a1){return{'model':db[_0x5327a1[_0x2394('0x1c')]],'as':_0x5327a1['as'],'attributes':_0x5327a1['attributes']};}):[]};}):[]};}):[]:[]})[_0x2394('0x9')](function(_0x1edf31){logger['info'](_0x2394('0x1d'),_0x533d01);logger[_0x2394('0xc')]('ShowFreshdeskAccount',_0x533d01,JSON[_0x2394('0xe')](_0x1edf31));_0x5610bd(_0x1edf31);})[_0x2394('0x13')](function(_0x477d60){logger[_0x2394('0xf')]('ShowFreshdeskAccount',_0x477d60[_0x2394('0x10')],_0x533d01);_0x180c08(_0x191cb1[_0x2394('0xf')](0x1f4,_0x477d60[_0x2394('0x10')]));});});}; \ No newline at end of file +var _0xa8ae=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','info','GetFreshdeskAccount','ShowFreshdeskAccount','find','lodash','util'];(function(_0xf80b3,_0x25d5f3){var _0x10c489=function(_0x3c5aee){while(--_0x3c5aee){_0xf80b3['push'](_0xf80b3['shift']());}};_0x10c489(++_0x25d5f3);}(_0xa8ae,0x116));var _0xea8a=function(_0x2f2c47,_0x1cf5cb){_0x2f2c47=_0x2f2c47-0x0;var _0x45d74f=_0xa8ae[_0x2f2c47];return _0x45d74f;};'use strict';var _=require(_0xea8a('0x0'));var util=require(_0xea8a('0x1'));var moment=require(_0xea8a('0x2'));var BPromise=require(_0xea8a('0x3'));var rs=require(_0xea8a('0x4'));var fs=require('fs');var Redis=require(_0xea8a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xea8a('0x6'));var logger=require(_0xea8a('0x7'))(_0xea8a('0x8'));var config=require('../../config/environment');var jayson=require(_0xea8a('0x9'));var client=jayson['client'][_0xea8a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x196add,_0x116d95,_0x3d7798){return new BPromise(function(_0x10ed8a,_0x1c7ac6){return client['request'](_0x196add,_0x3d7798)[_0xea8a('0xb')](function(_0x18194d){logger['info'](_0xea8a('0xc'),_0x116d95,_0xea8a('0xd'));logger[_0xea8a('0xe')](_0xea8a('0xf'),_0x116d95,_0xea8a('0xd'),JSON[_0xea8a('0x10')](_0x18194d));if(_0x18194d[_0xea8a('0x11')]){if(_0x18194d['error'][_0xea8a('0x12')]===0x1f4){logger[_0xea8a('0x11')](_0xea8a('0xc'),_0x116d95,_0x18194d['error'][_0xea8a('0x13')]);return _0x1c7ac6(_0x18194d[_0xea8a('0x11')][_0xea8a('0x13')]);}logger[_0xea8a('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x116d95,_0x18194d[_0xea8a('0x11')][_0xea8a('0x13')]);return _0x10ed8a(_0x18194d[_0xea8a('0x11')][_0xea8a('0x13')]);}else{logger['info'](_0xea8a('0xc'),_0x116d95,_0xea8a('0xd'));_0x10ed8a(_0x18194d['result'][_0xea8a('0x13')]);}})[_0xea8a('0x14')](function(_0x117bd0){logger[_0xea8a('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x116d95,_0x117bd0);_0x1c7ac6(_0x117bd0);});});}exports['GetFreshdeskAccount']=function(_0xcb8516){var _0x396952=this;return new Promise(function(_0x5a1211,_0x3c7a84){return db[_0xea8a('0x15')][_0xea8a('0x16')]({'raw':_0xcb8516[_0xea8a('0x17')]?_0xcb8516[_0xea8a('0x17')][_0xea8a('0x18')]===undefined?!![]:![]:!![],'where':_0xcb8516[_0xea8a('0x17')]?_0xcb8516[_0xea8a('0x17')][_0xea8a('0x19')]||null:null,'attributes':_0xcb8516[_0xea8a('0x17')]?_0xcb8516[_0xea8a('0x17')][_0xea8a('0x1a')]||null:null,'limit':_0xcb8516[_0xea8a('0x17')]?_0xcb8516[_0xea8a('0x17')][_0xea8a('0x1b')]||null:null,'include':_0xcb8516[_0xea8a('0x17')]?_0xcb8516[_0xea8a('0x17')][_0xea8a('0x1c')]?_[_0xea8a('0x1d')](_0xcb8516[_0xea8a('0x17')][_0xea8a('0x1c')],function(_0x11f807){return{'model':db[_0x11f807[_0xea8a('0x1e')]],'as':_0x11f807['as'],'attributes':_0x11f807[_0xea8a('0x1a')],'include':_0x11f807[_0xea8a('0x1c')]?_[_0xea8a('0x1d')](_0x11f807[_0xea8a('0x1c')],function(_0x527137){return{'model':db[_0x527137[_0xea8a('0x1e')]],'as':_0x527137['as'],'attributes':_0x527137[_0xea8a('0x1a')],'include':_0x527137[_0xea8a('0x1c')]?_[_0xea8a('0x1d')](_0x527137[_0xea8a('0x1c')],function(_0x3b0faa){return{'model':db[_0x3b0faa['model']],'as':_0x3b0faa['as'],'attributes':_0x3b0faa[_0xea8a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44f5a2){logger[_0xea8a('0x1f')](_0xea8a('0x20'),_0xcb8516);logger[_0xea8a('0xe')](_0xea8a('0x20'),_0xcb8516,JSON[_0xea8a('0x10')](_0x44f5a2));_0x5a1211(_0x44f5a2);})[_0xea8a('0x14')](function(_0x2201d6){logger[_0xea8a('0x11')](_0xea8a('0x20'),_0x2201d6[_0xea8a('0x13')],_0xcb8516);_0x3c7a84(_0x396952[_0xea8a('0x11')](0x1f4,_0x2201d6[_0xea8a('0x13')]));});});};exports[_0xea8a('0x21')]=function(_0x35ce12){var _0x38098d=this;return new Promise(function(_0x3aac55,_0x3f7c34){return db[_0xea8a('0x15')][_0xea8a('0x22')]({'raw':_0x35ce12[_0xea8a('0x17')]?_0x35ce12[_0xea8a('0x17')][_0xea8a('0x18')]===undefined?!![]:![]:!![],'where':_0x35ce12[_0xea8a('0x17')]?_0x35ce12[_0xea8a('0x17')][_0xea8a('0x19')]||null:null,'attributes':_0x35ce12[_0xea8a('0x17')]?_0x35ce12[_0xea8a('0x17')]['attributes']||null:null,'include':_0x35ce12['options']?_0x35ce12[_0xea8a('0x17')][_0xea8a('0x1c')]?_[_0xea8a('0x1d')](_0x35ce12[_0xea8a('0x17')]['include'],function(_0x18c567){return{'model':db[_0x18c567['model']],'as':_0x18c567['as'],'attributes':_0x18c567[_0xea8a('0x1a')],'include':_0x18c567['include']?_['map'](_0x18c567[_0xea8a('0x1c')],function(_0x269b40){return{'model':db[_0x269b40['model']],'as':_0x269b40['as'],'attributes':_0x269b40[_0xea8a('0x1a')],'include':_0x269b40[_0xea8a('0x1c')]?_[_0xea8a('0x1d')](_0x269b40[_0xea8a('0x1c')],function(_0x1e6c4){return{'model':db[_0x1e6c4[_0xea8a('0x1e')]],'as':_0x1e6c4['as'],'attributes':_0x1e6c4[_0xea8a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xea8a('0xb')](function(_0x6bbcf5){logger[_0xea8a('0x1f')](_0xea8a('0x21'),_0x35ce12);logger[_0xea8a('0xe')](_0xea8a('0x21'),_0x35ce12,JSON['stringify'](_0x6bbcf5));_0x3aac55(_0x6bbcf5);})[_0xea8a('0x14')](function(_0x449bcf){logger['error'](_0xea8a('0x21'),_0x449bcf[_0xea8a('0x13')],_0x35ce12);_0x3f7c34(_0x38098d[_0xea8a('0x11')](0x1f4,_0x449bcf[_0xea8a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 7ebe2c3..bbfaa60 100644 --- a/server/api/intFreshdeskConfiguration/index.js +++ b/server/api/intFreshdeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1bb4=['isAuthenticated','get','/:id','show','/:id/fields','getFields','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller'];(function(_0x4847d3,_0x48ab5d){var _0x3b67b7=function(_0x4a7726){while(--_0x4a7726){_0x4847d3['push'](_0x4847d3['shift']());}};_0x3b67b7(++_0x48ab5d);}(_0x1bb4,0x13d));var _0x41bb=function(_0x127af4,_0x5ec247){_0x127af4=_0x127af4-0x0;var _0x275931=_0x1bb4[_0x127af4];return _0x275931;};'use strict';var multer=require(_0x41bb('0x0'));var util=require(_0x41bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x41bb('0x2'));var router=express[_0x41bb('0x3')]();var auth=require(_0x41bb('0x4'));var interaction=require(_0x41bb('0x5'));var config=require(_0x41bb('0x6'));var controller=require(_0x41bb('0x7'));router['get']('/',auth[_0x41bb('0x8')](),controller['index']);router[_0x41bb('0x9')](_0x41bb('0xa'),auth[_0x41bb('0x8')](),controller[_0x41bb('0xb')]);router[_0x41bb('0x9')](_0x41bb('0xc'),auth[_0x41bb('0x8')](),controller[_0x41bb('0xd')]);router[_0x41bb('0x9')]('/:id/subjects',auth[_0x41bb('0x8')](),controller['getSubjects']);router[_0x41bb('0x9')]('/:id/descriptions',auth[_0x41bb('0x8')](),controller[_0x41bb('0xe')]);router[_0x41bb('0x9')](_0x41bb('0xf'),auth[_0x41bb('0x8')](),controller[_0x41bb('0x10')]);router[_0x41bb('0x11')]('/',auth['isAuthenticated'](),controller[_0x41bb('0x12')]);router['post']('/:id/tags',auth[_0x41bb('0x8')](),controller[_0x41bb('0x13')]);router[_0x41bb('0x14')](_0x41bb('0xa'),auth[_0x41bb('0x8')](),controller[_0x41bb('0x15')]);router[_0x41bb('0x16')](_0x41bb('0xa'),auth[_0x41bb('0x8')](),controller[_0x41bb('0x17')]);module[_0x41bb('0x18')]=router; \ No newline at end of file +var _0xc29b=['create','/:id/tags','setTags','put','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post'];(function(_0x3d39a1,_0x36899b){var _0x5725a2=function(_0x4d2446){while(--_0x4d2446){_0x3d39a1['push'](_0x3d39a1['shift']());}};_0x5725a2(++_0x36899b);}(_0xc29b,0x12f));var _0xbc29=function(_0x469f79,_0x2a71b6){_0x469f79=_0x469f79-0x0;var _0x113e32=_0xc29b[_0x469f79];return _0x113e32;};'use strict';var multer=require(_0xbc29('0x0'));var util=require(_0xbc29('0x1'));var path=require(_0xbc29('0x2'));var timeout=require(_0xbc29('0x3'));var express=require(_0xbc29('0x4'));var router=express['Router']();var auth=require(_0xbc29('0x5'));var interaction=require(_0xbc29('0x6'));var config=require(_0xbc29('0x7'));var controller=require(_0xbc29('0x8'));router[_0xbc29('0x9')]('/',auth[_0xbc29('0xa')](),controller['index']);router[_0xbc29('0x9')](_0xbc29('0xb'),auth[_0xbc29('0xa')](),controller[_0xbc29('0xc')]);router['get'](_0xbc29('0xd'),auth['isAuthenticated'](),controller[_0xbc29('0xe')]);router[_0xbc29('0x9')](_0xbc29('0xf'),auth['isAuthenticated'](),controller[_0xbc29('0x10')]);router[_0xbc29('0x9')](_0xbc29('0x11'),auth[_0xbc29('0xa')](),controller[_0xbc29('0x12')]);router[_0xbc29('0x9')]('/:id/tags',auth[_0xbc29('0xa')](),controller[_0xbc29('0x13')]);router[_0xbc29('0x14')]('/',auth[_0xbc29('0xa')](),controller[_0xbc29('0x15')]);router[_0xbc29('0x14')](_0xbc29('0x16'),auth[_0xbc29('0xa')](),controller[_0xbc29('0x17')]);router[_0xbc29('0x18')](_0xbc29('0xb'),auth[_0xbc29('0xa')](),controller[_0xbc29('0x19')]);router['delete'](_0xbc29('0xb'),auth[_0xbc29('0xa')](),controller[_0xbc29('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 62980da..986302f 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x293f=['sequelize','exports'];(function(_0x20f806,_0xa10306){var _0x3ede8c=function(_0x5496d6){while(--_0x5496d6){_0x20f806['push'](_0x20f806['shift']());}};_0x3ede8c(++_0xa10306);}(_0x293f,0xd6));var _0xf293=function(_0x58fa86,_0x3002a1){_0x58fa86=_0x58fa86-0x0;var _0x337fa4=_0x293f[_0x58fa86];return _0x337fa4;};'use strict';var Sequelize=require(_0xf293('0x0'));module[_0xf293('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9157=['STRING','exports'];(function(_0x4039e7,_0x1dbd5a){var _0x2a2a4f=function(_0x3bf453){while(--_0x3bf453){_0x4039e7['push'](_0x4039e7['shift']());}};_0x2a2a4f(++_0x1dbd5a);}(_0x9157,0x8b));var _0x7915=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x9157[_0x4b7b62];return _0x2280df;};'use strict';var Sequelize=require('sequelize');module[_0x7915('0x0')]={'name':{'type':Sequelize[_0x7915('0x1')]},'description':{'type':Sequelize[_0x7915('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 82c2827..a2e34b3 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f5f=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','then','info','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','destroy','stack','name','send','index','rawAttributes','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','FreshdeskConfiguration','includeAll','include','rows','catch','params','length','find','body','update','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x2f5f,0x1de));var _0xf2f5=function(_0x2eaf96,_0x16c887){_0x2eaf96=_0x2eaf96-0x0;var _0x661af3=_0x2f5f[_0x2eaf96];return _0x661af3;};'use strict';var pdf=require(_0xf2f5('0x0'));var emlformat=require(_0xf2f5('0x1'));var rimraf=require(_0xf2f5('0x2'));var zipdir=require(_0xf2f5('0x3'));var jsonpatch=require(_0xf2f5('0x4'));var rp=require(_0xf2f5('0x5'));var moment=require(_0xf2f5('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf2f5('0x7'));var util=require(_0xf2f5('0x8'));var path=require(_0xf2f5('0x9'));var sox=require(_0xf2f5('0xa'));var csv=require(_0xf2f5('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf2f5('0xc'));var squel=require(_0xf2f5('0xd'));var crypto=require(_0xf2f5('0xe'));var jsforce=require(_0xf2f5('0xf'));var deskjs=require(_0xf2f5('0x10'));var toCsv=require(_0xf2f5('0xb'));var querystring=require(_0xf2f5('0x11'));var Papa=require(_0xf2f5('0x12'));var Redis=require('ioredis');var authService=require(_0xf2f5('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf2f5('0x14'));var logger=require(_0xf2f5('0x15'))(_0xf2f5('0x16'));var utils=require(_0xf2f5('0x17'));var config=require(_0xf2f5('0x18'));var db=require(_0xf2f5('0x19'))['db'];var jayson=require(_0xf2f5('0x1a'));var client=jayson[_0xf2f5('0x1b')][_0xf2f5('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x26a40c,_0x376d59,_0x3cd79d){if(_0x3cd79d){var _0x379003=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x379003[_0xf2f5('0x1d')](_0x376d59)){return _0x26a40c;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x26a40c;}}function respondWithRpcPromise(_0xe832c6,_0x21b43a,_0x479794,_0x68ae80){return new BPromise(function(_0x4c997d,_0x4f2bbb){var _0x3f6948=_0x68ae80||client;return _0x3f6948['request'](_0xe832c6,_0x479794)[_0xf2f5('0x1e')](function(_0x3f3613){logger[_0xf2f5('0x1f')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x21b43a,'request\x20sent');logger[_0xf2f5('0x20')](_0xf2f5('0x21'),_0x21b43a,_0xf2f5('0x22'),JSON[_0xf2f5('0x23')](_0x3f3613));if(_0x3f3613[_0xf2f5('0x24')]){if(_0x3f3613[_0xf2f5('0x24')][_0xf2f5('0x25')]===0x1f4){logger['error'](_0xf2f5('0x26'),_0x21b43a,_0x3f3613[_0xf2f5('0x24')][_0xf2f5('0x27')]);return _0x4f2bbb(_0x3f3613[_0xf2f5('0x24')][_0xf2f5('0x27')]);}logger[_0xf2f5('0x24')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x21b43a,_0x3f3613[_0xf2f5('0x24')][_0xf2f5('0x27')]);return _0x4c997d(_0x3f3613[_0xf2f5('0x24')][_0xf2f5('0x27')]);}else{logger[_0xf2f5('0x1f')](_0xf2f5('0x26'),_0x21b43a,_0xf2f5('0x22'));_0x4c997d(_0x3f3613[_0xf2f5('0x28')][_0xf2f5('0x27')]);}})['catch'](function(_0x492d36){logger[_0xf2f5('0x24')](_0xf2f5('0x26'),_0x21b43a,_0x492d36);_0x4f2bbb(_0x492d36);});});}function respondWithStatusCode(_0x5ede8b,_0x414a38){_0x414a38=_0x414a38||0xcc;return function(_0x4f4cfb){if(_0x4f4cfb){return _0x5ede8b[_0xf2f5('0x29')](_0x414a38);}return _0x5ede8b[_0xf2f5('0x2a')](_0x414a38)[_0xf2f5('0x2b')]();};}function respondWithResult(_0x16c36d,_0x770a8b){_0x770a8b=_0x770a8b||0xc8;return function(_0x59d007){if(_0x59d007){return _0x16c36d[_0xf2f5('0x2a')](_0x770a8b)[_0xf2f5('0x2c')](_0x59d007);}};}function respondWithFilteredResult(_0x332ac7,_0x1d0a3f){return function(_0x5e9aec){if(_0x5e9aec){var _0x3fed93=_0x5e9aec[_0xf2f5('0x2d')],_0x499b51=_0x1d0a3f[_0xf2f5('0x2e')],_0xd8b9b9=_0x1d0a3f['offset']+_0x1d0a3f[_0xf2f5('0x2f')],_0x230e9f;if(_0xd8b9b9>=_0x3fed93){_0xd8b9b9=_0x3fed93;_0x230e9f=0xc8;}else{_0x230e9f=0xce;}_0x332ac7[_0xf2f5('0x2a')](_0x230e9f);return _0x332ac7[_0xf2f5('0x30')](_0xf2f5('0x31'),_0x499b51+'-'+_0xd8b9b9+'/'+_0x3fed93)['json'](_0x5e9aec);}return null;};}function patchUpdates(_0x37b5a2){return function(_0x577328){try{jsonpatch['apply'](_0x577328,_0x37b5a2,!![]);}catch(_0x4a766e){return BPromise['reject'](_0x4a766e);}return _0x577328[_0xf2f5('0x32')]();};}function saveUpdates(_0x4284d5,_0x295b2a){return function(_0x4294b9){if(_0x4294b9){return _0x4294b9['update'](_0x4284d5)['then'](function(_0x2c591f){return _0x2c591f;});}return null;};}function removeEntity(_0x21fd45,_0x226f27){return function(_0x2f659d){if(_0x2f659d){return _0x2f659d[_0xf2f5('0x33')]()[_0xf2f5('0x1e')](function(){_0x21fd45[_0xf2f5('0x2a')](0xcc)[_0xf2f5('0x2b')]();});}};}function handleEntityNotFound(_0x25ae51,_0x1f0185){return function(_0x195280){if(!_0x195280){_0x25ae51['sendStatus'](0x194);}return _0x195280;};}function handleError(_0xce0d38,_0x40b883){_0x40b883=_0x40b883||0x1f4;return function(_0x4145b6){logger[_0xf2f5('0x24')](_0x4145b6[_0xf2f5('0x34')]);if(_0x4145b6['name']){delete _0x4145b6[_0xf2f5('0x35')];}_0xce0d38[_0xf2f5('0x2a')](_0x40b883)[_0xf2f5('0x36')](_0x4145b6);};}exports[_0xf2f5('0x37')]=function(_0x31959c,_0x102c15){var _0x35613a={},_0x565944={},_0x84dd2b={'count':0x0,'rows':[]};var _0x424347=db['FreshdeskConfiguration'][_0xf2f5('0x38')];_0x565944[_0xf2f5('0x39')]=_['keys'](_0x424347);_0x565944[_0xf2f5('0x3a')]=_[_0xf2f5('0x3b')](_0x31959c['query']);_0x565944[_0xf2f5('0x3c')]=_['intersection'](_0x565944[_0xf2f5('0x39')],_0x565944[_0xf2f5('0x3a')]);_0x35613a[_0xf2f5('0x3d')]=_[_0xf2f5('0x3e')](_0x565944[_0xf2f5('0x39')],qs[_0xf2f5('0x3f')](_0x31959c['query'][_0xf2f5('0x3f')]));_0x35613a[_0xf2f5('0x3d')]=_0x35613a[_0xf2f5('0x3d')]['length']?_0x35613a[_0xf2f5('0x3d')]:_0x565944['model'];if(!_0x31959c[_0xf2f5('0x3a')]['hasOwnProperty'](_0xf2f5('0x40'))){_0x35613a[_0xf2f5('0x2f')]=qs[_0xf2f5('0x2f')](_0x31959c[_0xf2f5('0x3a')][_0xf2f5('0x2f')]);_0x35613a['offset']=qs[_0xf2f5('0x2e')](_0x31959c[_0xf2f5('0x3a')]['offset']);}_0x35613a[_0xf2f5('0x41')]=qs[_0xf2f5('0x42')](_0x31959c[_0xf2f5('0x3a')]['sort']);_0x35613a[_0xf2f5('0x43')]=qs[_0xf2f5('0x3c')](_[_0xf2f5('0x44')](_0x31959c[_0xf2f5('0x3a')],_0x565944[_0xf2f5('0x3c')]));if(_0x31959c[_0xf2f5('0x3a')][_0xf2f5('0x45')]){_0x35613a[_0xf2f5('0x43')]=_[_0xf2f5('0x46')](_0x35613a[_0xf2f5('0x43')],{'$or':_[_0xf2f5('0x47')](_0x424347,function(_0x1c96ee){if(_0x1c96ee['type'][_0xf2f5('0x48')]!==_0xf2f5('0x49')){var _0x29258a={};_0x29258a[_0x1c96ee[_0xf2f5('0x4a')]]={'$like':'%'+_0x31959c['query'][_0xf2f5('0x45')]+'%'};return _0x29258a;}})});}_0x35613a=_[_0xf2f5('0x46')]({},_0x35613a,_0x31959c[_0xf2f5('0x4b')]);var _0x55fdac={'where':_0x35613a[_0xf2f5('0x43')]};return db[_0xf2f5('0x4c')][_0xf2f5('0x2d')](_0x55fdac)[_0xf2f5('0x1e')](function(_0x42eaa8){_0x84dd2b['count']=_0x42eaa8;if(_0x31959c['query'][_0xf2f5('0x4d')]){_0x35613a[_0xf2f5('0x4e')]=[{'all':!![]}];}return db[_0xf2f5('0x4c')]['findAll'](_0x35613a);})[_0xf2f5('0x1e')](function(_0x431cf7){_0x84dd2b[_0xf2f5('0x4f')]=_0x431cf7;return _0x84dd2b;})['then'](respondWithFilteredResult(_0x102c15,_0x35613a))[_0xf2f5('0x50')](handleError(_0x102c15,null));};exports['show']=function(_0xf076ad,_0x29f3b4){var _0x498c60={'raw':![],'where':{'id':_0xf076ad[_0xf2f5('0x51')]['id']}},_0x317d76={};_0x317d76[_0xf2f5('0x39')]=_[_0xf2f5('0x3b')](db[_0xf2f5('0x4c')][_0xf2f5('0x38')]);_0x317d76[_0xf2f5('0x3a')]=_[_0xf2f5('0x3b')](_0xf076ad[_0xf2f5('0x3a')]);_0x317d76[_0xf2f5('0x3c')]=_['intersection'](_0x317d76['model'],_0x317d76[_0xf2f5('0x3a')]);_0x498c60[_0xf2f5('0x3d')]=_['intersection'](_0x317d76['model'],qs[_0xf2f5('0x3f')](_0xf076ad[_0xf2f5('0x3a')][_0xf2f5('0x3f')]));_0x498c60[_0xf2f5('0x3d')]=_0x498c60[_0xf2f5('0x3d')][_0xf2f5('0x52')]?_0x498c60['attributes']:_0x317d76[_0xf2f5('0x39')];if(_0xf076ad['query']['includeAll']){_0x498c60[_0xf2f5('0x4e')]=[{'all':!![]}];}_0x498c60=_[_0xf2f5('0x46')]({},_0x498c60,_0xf076ad[_0xf2f5('0x4b')]);return db[_0xf2f5('0x4c')][_0xf2f5('0x53')](_0x498c60)[_0xf2f5('0x1e')](handleEntityNotFound(_0x29f3b4,null))['then'](respondWithResult(_0x29f3b4,null))['catch'](handleError(_0x29f3b4,null));};exports['create']=function(_0x512e28,_0x21077e){return db['FreshdeskConfiguration']['create'](_0x512e28[_0xf2f5('0x54')],{})['then'](respondWithResult(_0x21077e,0xc9))[_0xf2f5('0x50')](handleError(_0x21077e,null));};exports[_0xf2f5('0x55')]=function(_0x1b6b79,_0x3b299d){if(_0x1b6b79[_0xf2f5('0x54')]['id']){delete _0x1b6b79[_0xf2f5('0x54')]['id'];}return db[_0xf2f5('0x4c')]['find']({'where':{'id':_0x1b6b79[_0xf2f5('0x51')]['id']}})[_0xf2f5('0x1e')](handleEntityNotFound(_0x3b299d,null))[_0xf2f5('0x1e')](saveUpdates(_0x1b6b79[_0xf2f5('0x54')],null))['then'](respondWithResult(_0x3b299d,null))[_0xf2f5('0x50')](handleError(_0x3b299d,null));};exports[_0xf2f5('0x33')]=function(_0x31f85c,_0x471bfb){return db[_0xf2f5('0x4c')]['find']({'where':{'id':_0x31f85c[_0xf2f5('0x51')]['id']}})[_0xf2f5('0x1e')](handleEntityNotFound(_0x471bfb,null))['then'](removeEntity(_0x471bfb,null))[_0xf2f5('0x50')](handleError(_0x471bfb,null));};exports[_0xf2f5('0x56')]=function(_0x57a135,_0x438227,_0x90b687){var _0x190a1d={};var _0x1815e2={};var _0x52f02d;var _0x57db57;return db['FreshdeskConfiguration'][_0xf2f5('0x57')]({'where':{'id':_0x57a135['params']['id']}})[_0xf2f5('0x1e')](handleEntityNotFound(_0x438227,null))[_0xf2f5('0x1e')](function(_0x39b142){if(_0x39b142){_0x52f02d=_0x39b142;_0x1815e2[_0xf2f5('0x39')]=_[_0xf2f5('0x3b')](db[_0xf2f5('0x58')]['rawAttributes']);_0x1815e2['query']=_[_0xf2f5('0x3b')](_0x57a135[_0xf2f5('0x3a')]);_0x1815e2[_0xf2f5('0x3c')]=_[_0xf2f5('0x3e')](_0x1815e2[_0xf2f5('0x39')],_0x1815e2['query']);_0x190a1d['attributes']=_[_0xf2f5('0x3e')](_0x1815e2[_0xf2f5('0x39')],qs[_0xf2f5('0x3f')](_0x57a135['query'][_0xf2f5('0x3f')]));_0x190a1d['attributes']=_0x190a1d[_0xf2f5('0x3d')][_0xf2f5('0x52')]?_0x190a1d[_0xf2f5('0x3d')]:_0x1815e2[_0xf2f5('0x39')];_0x190a1d[_0xf2f5('0x41')]=qs[_0xf2f5('0x42')](_0x57a135['query'][_0xf2f5('0x42')]);_0x190a1d[_0xf2f5('0x43')]=qs[_0xf2f5('0x3c')](_[_0xf2f5('0x44')](_0x57a135[_0xf2f5('0x3a')],_0x1815e2[_0xf2f5('0x3c')]));if(_0x57a135[_0xf2f5('0x3a')][_0xf2f5('0x45')]){_0x190a1d[_0xf2f5('0x43')]=_[_0xf2f5('0x46')](_0x190a1d[_0xf2f5('0x43')],{'$or':_['map'](_0x190a1d[_0xf2f5('0x3d')],function(_0x2a930e){var _0x251565={};_0x251565[_0x2a930e]={'$like':'%'+_0x57a135['query'][_0xf2f5('0x45')]+'%'};return _0x251565;})});}_0x190a1d=_[_0xf2f5('0x46')]({},_0x190a1d,_0x57a135[_0xf2f5('0x4b')]);return _0x52f02d['getFields'](_0x190a1d);}})[_0xf2f5('0x1e')](function(_0x4cee3c){if(_0x4cee3c){_0x57db57=_0x4cee3c[_0xf2f5('0x52')];if(!_0x57a135[_0xf2f5('0x3a')][_0xf2f5('0x59')](_0xf2f5('0x40'))){_0x190a1d[_0xf2f5('0x2f')]=qs[_0xf2f5('0x2f')](_0x57a135['query'][_0xf2f5('0x2f')]);_0x190a1d['offset']=qs[_0xf2f5('0x2e')](_0x57a135[_0xf2f5('0x3a')][_0xf2f5('0x2e')]);}return _0x52f02d[_0xf2f5('0x56')](_0x190a1d);}})['then'](function(_0x27c1a7){if(_0x27c1a7){return _0x27c1a7?{'count':_0x57db57,'rows':_0x27c1a7}:null;}})[_0xf2f5('0x1e')](respondWithResult(_0x438227,null))['catch'](handleError(_0x438227,null));};exports[_0xf2f5('0x5a')]=function(_0x447837,_0x35c8ff,_0xf7f41d){var _0x4be523={};var _0x4020f2={};var _0x550f07;var _0xd5774a;return db[_0xf2f5('0x4c')]['findOne']({'where':{'id':_0x447837[_0xf2f5('0x51')]['id']}})[_0xf2f5('0x1e')](handleEntityNotFound(_0x35c8ff,null))[_0xf2f5('0x1e')](function(_0x2956be){if(_0x2956be){_0x550f07=_0x2956be;_0x4020f2['model']=_[_0xf2f5('0x3b')](db[_0xf2f5('0x58')][_0xf2f5('0x38')]);_0x4020f2['query']=_['keys'](_0x447837[_0xf2f5('0x3a')]);_0x4020f2[_0xf2f5('0x3c')]=_['intersection'](_0x4020f2[_0xf2f5('0x39')],_0x4020f2[_0xf2f5('0x3a')]);_0x4be523[_0xf2f5('0x3d')]=_[_0xf2f5('0x3e')](_0x4020f2[_0xf2f5('0x39')],qs['fields'](_0x447837[_0xf2f5('0x3a')][_0xf2f5('0x3f')]));_0x4be523['attributes']=_0x4be523[_0xf2f5('0x3d')][_0xf2f5('0x52')]?_0x4be523[_0xf2f5('0x3d')]:_0x4020f2['model'];_0x4be523['order']=qs[_0xf2f5('0x42')](_0x447837[_0xf2f5('0x3a')][_0xf2f5('0x42')]);_0x4be523[_0xf2f5('0x43')]=qs[_0xf2f5('0x3c')](_[_0xf2f5('0x44')](_0x447837[_0xf2f5('0x3a')],_0x4020f2[_0xf2f5('0x3c')]));if(_0x447837[_0xf2f5('0x3a')][_0xf2f5('0x45')]){_0x4be523[_0xf2f5('0x43')]=_[_0xf2f5('0x46')](_0x4be523[_0xf2f5('0x43')],{'$or':_[_0xf2f5('0x47')](_0x4be523[_0xf2f5('0x3d')],function(_0x384279){var _0x665015={};_0x665015[_0x384279]={'$like':'%'+_0x447837['query'][_0xf2f5('0x45')]+'%'};return _0x665015;})});}_0x4be523=_['merge']({},_0x4be523,_0x447837[_0xf2f5('0x4b')]);return _0x550f07['getSubjects'](_0x4be523);}})[_0xf2f5('0x1e')](function(_0x28680c){if(_0x28680c){_0xd5774a=_0x28680c[_0xf2f5('0x52')];if(!_0x447837[_0xf2f5('0x3a')]['hasOwnProperty'](_0xf2f5('0x40'))){_0x4be523[_0xf2f5('0x2f')]=qs[_0xf2f5('0x2f')](_0x447837[_0xf2f5('0x3a')][_0xf2f5('0x2f')]);_0x4be523[_0xf2f5('0x2e')]=qs[_0xf2f5('0x2e')](_0x447837[_0xf2f5('0x3a')][_0xf2f5('0x2e')]);}return _0x550f07['getSubjects'](_0x4be523);}})['then'](function(_0x3ff0fa){if(_0x3ff0fa){return _0x3ff0fa?{'count':_0xd5774a,'rows':_0x3ff0fa}:null;}})[_0xf2f5('0x1e')](respondWithResult(_0x35c8ff,null))[_0xf2f5('0x50')](handleError(_0x35c8ff,null));};exports['getDescriptions']=function(_0x4ef38f,_0x35d048,_0x473f85){var _0x45728d={};var _0x2ade9e={};var _0x318c4a;var _0xcaab48;return db[_0xf2f5('0x4c')][_0xf2f5('0x57')]({'where':{'id':_0x4ef38f[_0xf2f5('0x51')]['id']}})[_0xf2f5('0x1e')](handleEntityNotFound(_0x35d048,null))[_0xf2f5('0x1e')](function(_0x22186b){if(_0x22186b){_0x318c4a=_0x22186b;_0x2ade9e['model']=_[_0xf2f5('0x3b')](db['FreshdeskField'][_0xf2f5('0x38')]);_0x2ade9e[_0xf2f5('0x3a')]=_[_0xf2f5('0x3b')](_0x4ef38f['query']);_0x2ade9e[_0xf2f5('0x3c')]=_['intersection'](_0x2ade9e['model'],_0x2ade9e[_0xf2f5('0x3a')]);_0x45728d[_0xf2f5('0x3d')]=_[_0xf2f5('0x3e')](_0x2ade9e[_0xf2f5('0x39')],qs[_0xf2f5('0x3f')](_0x4ef38f[_0xf2f5('0x3a')][_0xf2f5('0x3f')]));_0x45728d[_0xf2f5('0x3d')]=_0x45728d['attributes']['length']?_0x45728d[_0xf2f5('0x3d')]:_0x2ade9e[_0xf2f5('0x39')];_0x45728d['order']=qs[_0xf2f5('0x42')](_0x4ef38f[_0xf2f5('0x3a')][_0xf2f5('0x42')]);_0x45728d['where']=qs['filters'](_[_0xf2f5('0x44')](_0x4ef38f['query'],_0x2ade9e['filters']));if(_0x4ef38f[_0xf2f5('0x3a')][_0xf2f5('0x45')]){_0x45728d[_0xf2f5('0x43')]=_[_0xf2f5('0x46')](_0x45728d[_0xf2f5('0x43')],{'$or':_[_0xf2f5('0x47')](_0x45728d[_0xf2f5('0x3d')],function(_0x6f9413){var _0x5bd93c={};_0x5bd93c[_0x6f9413]={'$like':'%'+_0x4ef38f[_0xf2f5('0x3a')][_0xf2f5('0x45')]+'%'};return _0x5bd93c;})});}_0x45728d=_[_0xf2f5('0x46')]({},_0x45728d,_0x4ef38f[_0xf2f5('0x4b')]);return _0x318c4a[_0xf2f5('0x5b')](_0x45728d);}})['then'](function(_0x1a4c20){if(_0x1a4c20){_0xcaab48=_0x1a4c20['length'];if(!_0x4ef38f[_0xf2f5('0x3a')][_0xf2f5('0x59')](_0xf2f5('0x40'))){_0x45728d[_0xf2f5('0x2f')]=qs[_0xf2f5('0x2f')](_0x4ef38f[_0xf2f5('0x3a')][_0xf2f5('0x2f')]);_0x45728d[_0xf2f5('0x2e')]=qs[_0xf2f5('0x2e')](_0x4ef38f['query'][_0xf2f5('0x2e')]);}return _0x318c4a['getDescriptions'](_0x45728d);}})['then'](function(_0x24da5d){if(_0x24da5d){return _0x24da5d?{'count':_0xcaab48,'rows':_0x24da5d}:null;}})['then'](respondWithResult(_0x35d048,null))[_0xf2f5('0x50')](handleError(_0x35d048,null));};exports[_0xf2f5('0x5c')]=function(_0x30c267,_0x2fbe67,_0x482d6c){var _0x30400b={};var _0x2931bc={};var _0x479068;var _0x399fa5;return db[_0xf2f5('0x4c')][_0xf2f5('0x57')]({'where':{'id':_0x30c267[_0xf2f5('0x51')]['id']}})[_0xf2f5('0x1e')](handleEntityNotFound(_0x2fbe67,null))[_0xf2f5('0x1e')](function(_0x1fd695){if(_0x1fd695){_0x479068=_0x1fd695;_0x2931bc[_0xf2f5('0x39')]=_[_0xf2f5('0x3b')](db[_0xf2f5('0x5d')]['rawAttributes']);_0x2931bc['query']=_[_0xf2f5('0x3b')](_0x30c267[_0xf2f5('0x3a')]);_0x2931bc['filters']=_['intersection'](_0x2931bc[_0xf2f5('0x39')],_0x2931bc['query']);_0x30400b[_0xf2f5('0x3d')]=_['intersection'](_0x2931bc[_0xf2f5('0x39')],qs[_0xf2f5('0x3f')](_0x30c267['query'][_0xf2f5('0x3f')]));_0x30400b[_0xf2f5('0x3d')]=_0x30400b[_0xf2f5('0x3d')][_0xf2f5('0x52')]?_0x30400b[_0xf2f5('0x3d')]:_0x2931bc[_0xf2f5('0x39')];_0x30400b[_0xf2f5('0x41')]=qs[_0xf2f5('0x42')](_0x30c267[_0xf2f5('0x3a')]['sort']);_0x30400b[_0xf2f5('0x43')]=qs[_0xf2f5('0x3c')](_[_0xf2f5('0x44')](_0x30c267['query'],_0x2931bc[_0xf2f5('0x3c')]));if(_0x30c267[_0xf2f5('0x3a')]['filter']){_0x30400b[_0xf2f5('0x43')]=_[_0xf2f5('0x46')](_0x30400b[_0xf2f5('0x43')],{'$or':_[_0xf2f5('0x47')](_0x30400b[_0xf2f5('0x3d')],function(_0x4b0a53){var _0x5acfd8={};_0x5acfd8[_0x4b0a53]={'$like':'%'+_0x30c267[_0xf2f5('0x3a')][_0xf2f5('0x45')]+'%'};return _0x5acfd8;})});}_0x30400b=_['merge']({},_0x30400b,_0x30c267['options']);return _0x479068[_0xf2f5('0x5c')](_0x30400b);}})[_0xf2f5('0x1e')](function(_0x3647b0){if(_0x3647b0){_0x399fa5=_0x3647b0[_0xf2f5('0x52')];if(!_0x30c267[_0xf2f5('0x3a')][_0xf2f5('0x59')](_0xf2f5('0x40'))){_0x30400b[_0xf2f5('0x2f')]=qs[_0xf2f5('0x2f')](_0x30c267[_0xf2f5('0x3a')]['limit']);_0x30400b[_0xf2f5('0x2e')]=qs['offset'](_0x30c267[_0xf2f5('0x3a')][_0xf2f5('0x2e')]);}return _0x479068[_0xf2f5('0x5c')](_0x30400b);}})[_0xf2f5('0x1e')](function(_0x573da0){if(_0x573da0){return _0x573da0?{'count':_0x399fa5,'rows':_0x573da0}:null;}})[_0xf2f5('0x1e')](respondWithResult(_0x2fbe67,null))[_0xf2f5('0x50')](handleError(_0x2fbe67,null));};exports[_0xf2f5('0x5e')]=function(_0xd356d1,_0x43b567,_0x5d39c1){if(_0xd356d1[_0xf2f5('0x54')]['id']){delete _0xd356d1[_0xf2f5('0x54')]['id'];}return db[_0xf2f5('0x4c')][_0xf2f5('0x57')]({'where':{'id':_0xd356d1['params']['id']}})[_0xf2f5('0x1e')](handleEntityNotFound(_0x43b567,null))[_0xf2f5('0x1e')](function(_0x58951a){if(_0x58951a){return _0x58951a[_0xf2f5('0x5e')](_0xd356d1[_0xf2f5('0x54')][_0xf2f5('0x5f')]||[]);}return null;})[_0xf2f5('0x1e')](respondWithResult(_0x43b567,null))[_0xf2f5('0x50')](handleError(_0x43b567,null));}; \ No newline at end of file +var _0x40ad=['http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','stack','name','send','index','FreshdeskConfiguration','rawAttributes','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','includeAll','include','findAll','show','find','create','body','params','destroy','getFields','findOne','FreshdeskField','options','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client'];(function(_0x252983,_0x6de0da){var _0x3df207=function(_0x53a003){while(--_0x53a003){_0x252983['push'](_0x252983['shift']());}};_0x3df207(++_0x6de0da);}(_0x40ad,0x158));var _0xd40a=function(_0x116ec2,_0x23b3d9){_0x116ec2=_0x116ec2-0x0;var _0x44c06e=_0x40ad[_0x116ec2];return _0x44c06e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd40a('0x0'));var rimraf=require(_0xd40a('0x1'));var zipdir=require(_0xd40a('0x2'));var jsonpatch=require(_0xd40a('0x3'));var rp=require(_0xd40a('0x4'));var moment=require(_0xd40a('0x5'));var BPromise=require(_0xd40a('0x6'));var Mustache=require(_0xd40a('0x7'));var util=require(_0xd40a('0x8'));var path=require('path');var sox=require(_0xd40a('0x9'));var csv=require('to-csv');var ejs=require(_0xd40a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd40a('0xb'));var crypto=require('crypto');var jsforce=require(_0xd40a('0xc'));var deskjs=require(_0xd40a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd40a('0xe'));var Papa=require(_0xd40a('0xf'));var Redis=require('ioredis');var authService=require(_0xd40a('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd40a('0x11'));var logger=require(_0xd40a('0x12'))(_0xd40a('0x13'));var utils=require(_0xd40a('0x14'));var config=require('../../config/environment');var db=require(_0xd40a('0x15'))['db'];var jayson=require(_0xd40a('0x16'));var client=jayson[_0xd40a('0x17')][_0xd40a('0x18')]({'port':0x232a});function checkPasswordPattern(_0x169101,_0x42e096,_0x3f0c8b){if(_0x3f0c8b){var _0x50f07a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x50f07a['test'](_0x42e096)){return _0x169101;}else{throw new Error(_0xd40a('0x19'));}}else{return _0x169101;}}function respondWithRpcPromise(_0x553be4,_0x17625e,_0x510d76,_0x4b8a3d){return new BPromise(function(_0x1f58ec,_0x45d14d){var _0x2639ad=_0x4b8a3d||client;return _0x2639ad[_0xd40a('0x1a')](_0x553be4,_0x510d76)[_0xd40a('0x1b')](function(_0x1b7b96){logger[_0xd40a('0x1c')](_0xd40a('0x1d'),_0x17625e,_0xd40a('0x1e'));logger[_0xd40a('0x1f')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x17625e,_0xd40a('0x1e'),JSON[_0xd40a('0x20')](_0x1b7b96));if(_0x1b7b96[_0xd40a('0x21')]){if(_0x1b7b96[_0xd40a('0x21')][_0xd40a('0x22')]===0x1f4){logger[_0xd40a('0x21')](_0xd40a('0x1d'),_0x17625e,_0x1b7b96[_0xd40a('0x21')][_0xd40a('0x23')]);return _0x45d14d(_0x1b7b96[_0xd40a('0x21')][_0xd40a('0x23')]);}logger[_0xd40a('0x21')](_0xd40a('0x1d'),_0x17625e,_0x1b7b96['error'][_0xd40a('0x23')]);return _0x1f58ec(_0x1b7b96[_0xd40a('0x21')]['message']);}else{logger['info'](_0xd40a('0x1d'),_0x17625e,_0xd40a('0x1e'));_0x1f58ec(_0x1b7b96[_0xd40a('0x24')][_0xd40a('0x23')]);}})[_0xd40a('0x25')](function(_0x4f4c35){logger[_0xd40a('0x21')](_0xd40a('0x1d'),_0x17625e,_0x4f4c35);_0x45d14d(_0x4f4c35);});});}function respondWithStatusCode(_0x489025,_0x3f7b26){_0x3f7b26=_0x3f7b26||0xcc;return function(_0x51516e){if(_0x51516e){return _0x489025[_0xd40a('0x26')](_0x3f7b26);}return _0x489025[_0xd40a('0x27')](_0x3f7b26)['end']();};}function respondWithResult(_0x301eba,_0xed8499){_0xed8499=_0xed8499||0xc8;return function(_0x3d6d73){if(_0x3d6d73){return _0x301eba[_0xd40a('0x27')](_0xed8499)[_0xd40a('0x28')](_0x3d6d73);}};}function respondWithFilteredResult(_0x50367f,_0x409217){return function(_0xa7f41f){if(_0xa7f41f){var _0x5e549b=_0xa7f41f[_0xd40a('0x29')],_0x443b3b=_0x409217[_0xd40a('0x2a')],_0x4d097e=_0x409217[_0xd40a('0x2a')]+_0x409217[_0xd40a('0x2b')],_0x15feba;if(_0x4d097e>=_0x5e549b){_0x4d097e=_0x5e549b;_0x15feba=0xc8;}else{_0x15feba=0xce;}_0x50367f['status'](_0x15feba);return _0x50367f['set'](_0xd40a('0x2c'),_0x443b3b+'-'+_0x4d097e+'/'+_0x5e549b)['json'](_0xa7f41f);}return null;};}function patchUpdates(_0x3853ad){return function(_0x373f17){try{jsonpatch['apply'](_0x373f17,_0x3853ad,!![]);}catch(_0x3c6de9){return BPromise[_0xd40a('0x2d')](_0x3c6de9);}return _0x373f17[_0xd40a('0x2e')]();};}function saveUpdates(_0x45039e,_0x505d40){return function(_0x3f7eab){if(_0x3f7eab){return _0x3f7eab[_0xd40a('0x2f')](_0x45039e)['then'](function(_0x7c3939){return _0x7c3939;});}return null;};}function removeEntity(_0xe81d21,_0x2ee327){return function(_0x1a5cd8){if(_0x1a5cd8){return _0x1a5cd8['destroy']()[_0xd40a('0x1b')](function(){_0xe81d21['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1554e4,_0xabed77){return function(_0x400069){if(!_0x400069){_0x1554e4['sendStatus'](0x194);}return _0x400069;};}function handleError(_0x1f6e35,_0x4d1952){_0x4d1952=_0x4d1952||0x1f4;return function(_0x4db359){logger[_0xd40a('0x21')](_0x4db359[_0xd40a('0x30')]);if(_0x4db359[_0xd40a('0x31')]){delete _0x4db359[_0xd40a('0x31')];}_0x1f6e35['status'](_0x4d1952)[_0xd40a('0x32')](_0x4db359);};}exports[_0xd40a('0x33')]=function(_0x162cf1,_0xcf354c){var _0x456a8b={},_0x262044={},_0x2696bb={'count':0x0,'rows':[]};var _0x9ccaea=db[_0xd40a('0x34')][_0xd40a('0x35')];_0x262044[_0xd40a('0x36')]=_[_0xd40a('0x37')](_0x9ccaea);_0x262044['query']=_[_0xd40a('0x37')](_0x162cf1['query']);_0x262044[_0xd40a('0x38')]=_['intersection'](_0x262044['model'],_0x262044[_0xd40a('0x39')]);_0x456a8b[_0xd40a('0x3a')]=_[_0xd40a('0x3b')](_0x262044[_0xd40a('0x36')],qs['fields'](_0x162cf1['query'][_0xd40a('0x3c')]));_0x456a8b[_0xd40a('0x3a')]=_0x456a8b[_0xd40a('0x3a')][_0xd40a('0x3d')]?_0x456a8b['attributes']:_0x262044[_0xd40a('0x36')];if(!_0x162cf1[_0xd40a('0x39')][_0xd40a('0x3e')](_0xd40a('0x3f'))){_0x456a8b[_0xd40a('0x2b')]=qs['limit'](_0x162cf1[_0xd40a('0x39')][_0xd40a('0x2b')]);_0x456a8b[_0xd40a('0x2a')]=qs[_0xd40a('0x2a')](_0x162cf1[_0xd40a('0x39')][_0xd40a('0x2a')]);}_0x456a8b[_0xd40a('0x40')]=qs[_0xd40a('0x41')](_0x162cf1['query']['sort']);_0x456a8b[_0xd40a('0x42')]=qs[_0xd40a('0x38')](_[_0xd40a('0x43')](_0x162cf1[_0xd40a('0x39')],_0x262044[_0xd40a('0x38')]));if(_0x162cf1[_0xd40a('0x39')][_0xd40a('0x44')]){_0x456a8b[_0xd40a('0x42')]=_[_0xd40a('0x45')](_0x456a8b[_0xd40a('0x42')],{'$or':_[_0xd40a('0x46')](_0x9ccaea,function(_0x21e9d0){if(_0x21e9d0[_0xd40a('0x47')]['key']!==_0xd40a('0x48')){var _0xddac83={};_0xddac83[_0x21e9d0[_0xd40a('0x49')]]={'$like':'%'+_0x162cf1[_0xd40a('0x39')][_0xd40a('0x44')]+'%'};return _0xddac83;}})});}_0x456a8b=_[_0xd40a('0x45')]({},_0x456a8b,_0x162cf1['options']);var _0x1b953e={'where':_0x456a8b[_0xd40a('0x42')]};return db['FreshdeskConfiguration']['count'](_0x1b953e)[_0xd40a('0x1b')](function(_0x87d5d5){_0x2696bb[_0xd40a('0x29')]=_0x87d5d5;if(_0x162cf1[_0xd40a('0x39')][_0xd40a('0x4a')]){_0x456a8b[_0xd40a('0x4b')]=[{'all':!![]}];}return db[_0xd40a('0x34')][_0xd40a('0x4c')](_0x456a8b);})[_0xd40a('0x1b')](function(_0x37ef02){_0x2696bb['rows']=_0x37ef02;return _0x2696bb;})[_0xd40a('0x1b')](respondWithFilteredResult(_0xcf354c,_0x456a8b))[_0xd40a('0x25')](handleError(_0xcf354c,null));};exports[_0xd40a('0x4d')]=function(_0x4407fd,_0x2b4a8e){var _0x413ccc={'raw':![],'where':{'id':_0x4407fd['params']['id']}},_0x413255={};_0x413255[_0xd40a('0x36')]=_[_0xd40a('0x37')](db['FreshdeskConfiguration'][_0xd40a('0x35')]);_0x413255[_0xd40a('0x39')]=_[_0xd40a('0x37')](_0x4407fd[_0xd40a('0x39')]);_0x413255['filters']=_['intersection'](_0x413255[_0xd40a('0x36')],_0x413255[_0xd40a('0x39')]);_0x413ccc[_0xd40a('0x3a')]=_['intersection'](_0x413255['model'],qs[_0xd40a('0x3c')](_0x4407fd[_0xd40a('0x39')][_0xd40a('0x3c')]));_0x413ccc[_0xd40a('0x3a')]=_0x413ccc['attributes']['length']?_0x413ccc[_0xd40a('0x3a')]:_0x413255[_0xd40a('0x36')];if(_0x4407fd[_0xd40a('0x39')][_0xd40a('0x4a')]){_0x413ccc['include']=[{'all':!![]}];}_0x413ccc=_['merge']({},_0x413ccc,_0x4407fd['options']);return db['FreshdeskConfiguration'][_0xd40a('0x4e')](_0x413ccc)[_0xd40a('0x1b')](handleEntityNotFound(_0x2b4a8e,null))['then'](respondWithResult(_0x2b4a8e,null))[_0xd40a('0x25')](handleError(_0x2b4a8e,null));};exports[_0xd40a('0x4f')]=function(_0x24553e,_0x450d75){return db[_0xd40a('0x34')][_0xd40a('0x4f')](_0x24553e[_0xd40a('0x50')],{})[_0xd40a('0x1b')](respondWithResult(_0x450d75,0xc9))[_0xd40a('0x25')](handleError(_0x450d75,null));};exports[_0xd40a('0x2f')]=function(_0x4f811e,_0x54706f){if(_0x4f811e[_0xd40a('0x50')]['id']){delete _0x4f811e[_0xd40a('0x50')]['id'];}return db[_0xd40a('0x34')][_0xd40a('0x4e')]({'where':{'id':_0x4f811e[_0xd40a('0x51')]['id']}})['then'](handleEntityNotFound(_0x54706f,null))[_0xd40a('0x1b')](saveUpdates(_0x4f811e[_0xd40a('0x50')],null))[_0xd40a('0x1b')](respondWithResult(_0x54706f,null))[_0xd40a('0x25')](handleError(_0x54706f,null));};exports[_0xd40a('0x52')]=function(_0x357d44,_0x3cb428){return db[_0xd40a('0x34')]['find']({'where':{'id':_0x357d44['params']['id']}})[_0xd40a('0x1b')](handleEntityNotFound(_0x3cb428,null))['then'](removeEntity(_0x3cb428,null))[_0xd40a('0x25')](handleError(_0x3cb428,null));};exports[_0xd40a('0x53')]=function(_0x28fd6b,_0x5c10ab,_0x402157){var _0x581623={};var _0x90e23a={};var _0x4e785f;var _0x349414;return db[_0xd40a('0x34')][_0xd40a('0x54')]({'where':{'id':_0x28fd6b[_0xd40a('0x51')]['id']}})[_0xd40a('0x1b')](handleEntityNotFound(_0x5c10ab,null))['then'](function(_0xff145b){if(_0xff145b){_0x4e785f=_0xff145b;_0x90e23a[_0xd40a('0x36')]=_[_0xd40a('0x37')](db[_0xd40a('0x55')]['rawAttributes']);_0x90e23a[_0xd40a('0x39')]=_[_0xd40a('0x37')](_0x28fd6b[_0xd40a('0x39')]);_0x90e23a['filters']=_['intersection'](_0x90e23a[_0xd40a('0x36')],_0x90e23a[_0xd40a('0x39')]);_0x581623[_0xd40a('0x3a')]=_[_0xd40a('0x3b')](_0x90e23a[_0xd40a('0x36')],qs['fields'](_0x28fd6b[_0xd40a('0x39')][_0xd40a('0x3c')]));_0x581623['attributes']=_0x581623[_0xd40a('0x3a')][_0xd40a('0x3d')]?_0x581623[_0xd40a('0x3a')]:_0x90e23a[_0xd40a('0x36')];_0x581623[_0xd40a('0x40')]=qs[_0xd40a('0x41')](_0x28fd6b['query']['sort']);_0x581623['where']=qs[_0xd40a('0x38')](_[_0xd40a('0x43')](_0x28fd6b['query'],_0x90e23a[_0xd40a('0x38')]));if(_0x28fd6b[_0xd40a('0x39')]['filter']){_0x581623[_0xd40a('0x42')]=_[_0xd40a('0x45')](_0x581623[_0xd40a('0x42')],{'$or':_[_0xd40a('0x46')](_0x581623[_0xd40a('0x3a')],function(_0x140f14){var _0x353165={};_0x353165[_0x140f14]={'$like':'%'+_0x28fd6b[_0xd40a('0x39')][_0xd40a('0x44')]+'%'};return _0x353165;})});}_0x581623=_[_0xd40a('0x45')]({},_0x581623,_0x28fd6b[_0xd40a('0x56')]);return _0x4e785f['getFields'](_0x581623);}})[_0xd40a('0x1b')](function(_0x36da59){if(_0x36da59){_0x349414=_0x36da59[_0xd40a('0x3d')];if(!_0x28fd6b['query'][_0xd40a('0x3e')]('nolimit')){_0x581623[_0xd40a('0x2b')]=qs[_0xd40a('0x2b')](_0x28fd6b['query'][_0xd40a('0x2b')]);_0x581623[_0xd40a('0x2a')]=qs[_0xd40a('0x2a')](_0x28fd6b['query']['offset']);}return _0x4e785f[_0xd40a('0x53')](_0x581623);}})[_0xd40a('0x1b')](function(_0x4d776e){if(_0x4d776e){return _0x4d776e?{'count':_0x349414,'rows':_0x4d776e}:null;}})[_0xd40a('0x1b')](respondWithResult(_0x5c10ab,null))[_0xd40a('0x25')](handleError(_0x5c10ab,null));};exports[_0xd40a('0x57')]=function(_0x36e9a3,_0x354144,_0x430030){var _0x5ef2e6={};var _0x2972e3={};var _0x481b14;var _0x29de30;return db[_0xd40a('0x34')][_0xd40a('0x54')]({'where':{'id':_0x36e9a3[_0xd40a('0x51')]['id']}})[_0xd40a('0x1b')](handleEntityNotFound(_0x354144,null))[_0xd40a('0x1b')](function(_0x14ce0c){if(_0x14ce0c){_0x481b14=_0x14ce0c;_0x2972e3[_0xd40a('0x36')]=_[_0xd40a('0x37')](db['FreshdeskField']['rawAttributes']);_0x2972e3[_0xd40a('0x39')]=_[_0xd40a('0x37')](_0x36e9a3['query']);_0x2972e3[_0xd40a('0x38')]=_[_0xd40a('0x3b')](_0x2972e3['model'],_0x2972e3['query']);_0x5ef2e6[_0xd40a('0x3a')]=_[_0xd40a('0x3b')](_0x2972e3['model'],qs[_0xd40a('0x3c')](_0x36e9a3[_0xd40a('0x39')]['fields']));_0x5ef2e6[_0xd40a('0x3a')]=_0x5ef2e6[_0xd40a('0x3a')][_0xd40a('0x3d')]?_0x5ef2e6[_0xd40a('0x3a')]:_0x2972e3['model'];_0x5ef2e6['order']=qs[_0xd40a('0x41')](_0x36e9a3[_0xd40a('0x39')][_0xd40a('0x41')]);_0x5ef2e6[_0xd40a('0x42')]=qs[_0xd40a('0x38')](_[_0xd40a('0x43')](_0x36e9a3[_0xd40a('0x39')],_0x2972e3[_0xd40a('0x38')]));if(_0x36e9a3[_0xd40a('0x39')][_0xd40a('0x44')]){_0x5ef2e6[_0xd40a('0x42')]=_[_0xd40a('0x45')](_0x5ef2e6[_0xd40a('0x42')],{'$or':_['map'](_0x5ef2e6['attributes'],function(_0x105017){var _0x4b9b82={};_0x4b9b82[_0x105017]={'$like':'%'+_0x36e9a3[_0xd40a('0x39')][_0xd40a('0x44')]+'%'};return _0x4b9b82;})});}_0x5ef2e6=_['merge']({},_0x5ef2e6,_0x36e9a3[_0xd40a('0x56')]);return _0x481b14[_0xd40a('0x57')](_0x5ef2e6);}})[_0xd40a('0x1b')](function(_0x5af4d0){if(_0x5af4d0){_0x29de30=_0x5af4d0['length'];if(!_0x36e9a3['query'][_0xd40a('0x3e')](_0xd40a('0x3f'))){_0x5ef2e6[_0xd40a('0x2b')]=qs['limit'](_0x36e9a3[_0xd40a('0x39')][_0xd40a('0x2b')]);_0x5ef2e6[_0xd40a('0x2a')]=qs[_0xd40a('0x2a')](_0x36e9a3[_0xd40a('0x39')][_0xd40a('0x2a')]);}return _0x481b14[_0xd40a('0x57')](_0x5ef2e6);}})[_0xd40a('0x1b')](function(_0x24df9b){if(_0x24df9b){return _0x24df9b?{'count':_0x29de30,'rows':_0x24df9b}:null;}})[_0xd40a('0x1b')](respondWithResult(_0x354144,null))['catch'](handleError(_0x354144,null));};exports[_0xd40a('0x58')]=function(_0x3d085a,_0x59a83f,_0x161494){var _0x53fd1c={};var _0x5d73de={};var _0x3e5728;var _0x4ef934;return db['FreshdeskConfiguration'][_0xd40a('0x54')]({'where':{'id':_0x3d085a[_0xd40a('0x51')]['id']}})['then'](handleEntityNotFound(_0x59a83f,null))[_0xd40a('0x1b')](function(_0x29da64){if(_0x29da64){_0x3e5728=_0x29da64;_0x5d73de['model']=_[_0xd40a('0x37')](db[_0xd40a('0x55')]['rawAttributes']);_0x5d73de['query']=_[_0xd40a('0x37')](_0x3d085a[_0xd40a('0x39')]);_0x5d73de[_0xd40a('0x38')]=_['intersection'](_0x5d73de[_0xd40a('0x36')],_0x5d73de[_0xd40a('0x39')]);_0x53fd1c[_0xd40a('0x3a')]=_[_0xd40a('0x3b')](_0x5d73de['model'],qs[_0xd40a('0x3c')](_0x3d085a[_0xd40a('0x39')][_0xd40a('0x3c')]));_0x53fd1c['attributes']=_0x53fd1c[_0xd40a('0x3a')]['length']?_0x53fd1c[_0xd40a('0x3a')]:_0x5d73de[_0xd40a('0x36')];_0x53fd1c[_0xd40a('0x40')]=qs[_0xd40a('0x41')](_0x3d085a['query'][_0xd40a('0x41')]);_0x53fd1c[_0xd40a('0x42')]=qs['filters'](_[_0xd40a('0x43')](_0x3d085a[_0xd40a('0x39')],_0x5d73de[_0xd40a('0x38')]));if(_0x3d085a['query']['filter']){_0x53fd1c['where']=_[_0xd40a('0x45')](_0x53fd1c[_0xd40a('0x42')],{'$or':_[_0xd40a('0x46')](_0x53fd1c[_0xd40a('0x3a')],function(_0x1b5985){var _0x1d21c7={};_0x1d21c7[_0x1b5985]={'$like':'%'+_0x3d085a[_0xd40a('0x39')][_0xd40a('0x44')]+'%'};return _0x1d21c7;})});}_0x53fd1c=_['merge']({},_0x53fd1c,_0x3d085a['options']);return _0x3e5728[_0xd40a('0x58')](_0x53fd1c);}})[_0xd40a('0x1b')](function(_0x1222a4){if(_0x1222a4){_0x4ef934=_0x1222a4['length'];if(!_0x3d085a[_0xd40a('0x39')][_0xd40a('0x3e')](_0xd40a('0x3f'))){_0x53fd1c['limit']=qs[_0xd40a('0x2b')](_0x3d085a[_0xd40a('0x39')][_0xd40a('0x2b')]);_0x53fd1c['offset']=qs['offset'](_0x3d085a['query'][_0xd40a('0x2a')]);}return _0x3e5728[_0xd40a('0x58')](_0x53fd1c);}})['then'](function(_0x556ac8){if(_0x556ac8){return _0x556ac8?{'count':_0x4ef934,'rows':_0x556ac8}:null;}})[_0xd40a('0x1b')](respondWithResult(_0x59a83f,null))['catch'](handleError(_0x59a83f,null));};exports[_0xd40a('0x59')]=function(_0x1b70dd,_0x4e3b44,_0x5ed80b){var _0x43e05e={};var _0x56be62={};var _0xdde87b;var _0x3b0e24;return db[_0xd40a('0x34')][_0xd40a('0x54')]({'where':{'id':_0x1b70dd[_0xd40a('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e3b44,null))[_0xd40a('0x1b')](function(_0x103db0){if(_0x103db0){_0xdde87b=_0x103db0;_0x56be62[_0xd40a('0x36')]=_[_0xd40a('0x37')](db[_0xd40a('0x5a')]['rawAttributes']);_0x56be62[_0xd40a('0x39')]=_['keys'](_0x1b70dd[_0xd40a('0x39')]);_0x56be62[_0xd40a('0x38')]=_[_0xd40a('0x3b')](_0x56be62[_0xd40a('0x36')],_0x56be62[_0xd40a('0x39')]);_0x43e05e[_0xd40a('0x3a')]=_[_0xd40a('0x3b')](_0x56be62[_0xd40a('0x36')],qs[_0xd40a('0x3c')](_0x1b70dd['query'][_0xd40a('0x3c')]));_0x43e05e['attributes']=_0x43e05e[_0xd40a('0x3a')]['length']?_0x43e05e[_0xd40a('0x3a')]:_0x56be62[_0xd40a('0x36')];_0x43e05e[_0xd40a('0x40')]=qs[_0xd40a('0x41')](_0x1b70dd[_0xd40a('0x39')][_0xd40a('0x41')]);_0x43e05e['where']=qs[_0xd40a('0x38')](_[_0xd40a('0x43')](_0x1b70dd[_0xd40a('0x39')],_0x56be62[_0xd40a('0x38')]));if(_0x1b70dd[_0xd40a('0x39')][_0xd40a('0x44')]){_0x43e05e[_0xd40a('0x42')]=_['merge'](_0x43e05e[_0xd40a('0x42')],{'$or':_[_0xd40a('0x46')](_0x43e05e[_0xd40a('0x3a')],function(_0xe92b80){var _0x1ba437={};_0x1ba437[_0xe92b80]={'$like':'%'+_0x1b70dd[_0xd40a('0x39')][_0xd40a('0x44')]+'%'};return _0x1ba437;})});}_0x43e05e=_[_0xd40a('0x45')]({},_0x43e05e,_0x1b70dd[_0xd40a('0x56')]);return _0xdde87b[_0xd40a('0x59')](_0x43e05e);}})[_0xd40a('0x1b')](function(_0x4bcb25){if(_0x4bcb25){_0x3b0e24=_0x4bcb25[_0xd40a('0x3d')];if(!_0x1b70dd[_0xd40a('0x39')][_0xd40a('0x3e')]('nolimit')){_0x43e05e[_0xd40a('0x2b')]=qs[_0xd40a('0x2b')](_0x1b70dd[_0xd40a('0x39')][_0xd40a('0x2b')]);_0x43e05e[_0xd40a('0x2a')]=qs[_0xd40a('0x2a')](_0x1b70dd[_0xd40a('0x39')]['offset']);}return _0xdde87b[_0xd40a('0x59')](_0x43e05e);}})[_0xd40a('0x1b')](function(_0x56b179){if(_0x56b179){return _0x56b179?{'count':_0x3b0e24,'rows':_0x56b179}:null;}})[_0xd40a('0x1b')](respondWithResult(_0x4e3b44,null))[_0xd40a('0x25')](handleError(_0x4e3b44,null));};exports[_0xd40a('0x5b')]=function(_0x25013a,_0x36ef01,_0x34b718){if(_0x25013a['body']['id']){delete _0x25013a[_0xd40a('0x50')]['id'];}return db[_0xd40a('0x34')][_0xd40a('0x54')]({'where':{'id':_0x25013a['params']['id']}})[_0xd40a('0x1b')](handleEntityNotFound(_0x36ef01,null))['then'](function(_0x53c420){if(_0x53c420){return _0x53c420[_0xd40a('0x5b')](_0x25013a[_0xd40a('0x50')]['ids']||[]);}return null;})[_0xd40a('0x1b')](respondWithResult(_0x36ef01,null))[_0xd40a('0x25')](handleError(_0x36ef01,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 2fba5d3..401d7d7 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2386=['../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','moment','request-promise','path'];(function(_0x3c6dce,_0x5424dd){var _0x1450e9=function(_0xd51b5c){while(--_0xd51b5c){_0x3c6dce['push'](_0x3c6dce['shift']());}};_0x1450e9(++_0x5424dd);}(_0x2386,0x1d1));var _0x6238=function(_0xfd3d87,_0x10aa44){_0xfd3d87=_0xfd3d87-0x0;var _0x21fc4a=_0x2386[_0xfd3d87];return _0x21fc4a;};'use strict';var _=require(_0x6238('0x0'));var util=require('util');var logger=require(_0x6238('0x1'))('api');var moment=require(_0x6238('0x2'));var BPromise=require('bluebird');var rp=require(_0x6238('0x3'));var fs=require('fs');var path=require(_0x6238('0x4'));var rimraf=require('rimraf');var config=require(_0x6238('0x5'));var attributes=require(_0x6238('0x6'));module['exports']=function(_0x49d4d6,_0x68a0c4){return _0x49d4d6[_0x6238('0x7')](_0x6238('0x8'),attributes,{'tableName':_0x6238('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed77=['api','moment','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','util','../../config/logger'];(function(_0x4f6d17,_0x1daf72){var _0x174a2c=function(_0x416c84){while(--_0x416c84){_0x4f6d17['push'](_0x4f6d17['shift']());}};_0x174a2c(++_0x1daf72);}(_0xed77,0x6c));var _0x7ed7=function(_0x3d7f5e,_0x46a791){_0x3d7f5e=_0x3d7f5e-0x0;var _0x44557f=_0xed77[_0x3d7f5e];return _0x44557f;};'use strict';var _=require('lodash');var util=require(_0x7ed7('0x0'));var logger=require(_0x7ed7('0x1'))(_0x7ed7('0x2'));var moment=require(_0x7ed7('0x3'));var BPromise=require('bluebird');var rp=require(_0x7ed7('0x4'));var fs=require('fs');var path=require(_0x7ed7('0x5'));var rimraf=require('rimraf');var config=require(_0x7ed7('0x6'));var attributes=require(_0x7ed7('0x7'));module[_0x7ed7('0x8')]=function(_0x390964,_0x8446d5){return _0x390964[_0x7ed7('0x9')]('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 4d8dd2e..416ffd4 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4bc=['ioredis','../../mysqldb','jayson/promise','client','http','then','info','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4bc,0x19e));var _0xcd4b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd4bc[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xcd4b('0x0'));var util=require(_0xcd4b('0x1'));var moment=require('moment');var BPromise=require(_0xcd4b('0x2'));var rs=require(_0xcd4b('0x3'));var fs=require('fs');var Redis=require(_0xcd4b('0x4'));var db=require(_0xcd4b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcd4b('0x6'));var client=jayson[_0xcd4b('0x7')][_0xcd4b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4606ff,_0x585ec9,_0x5e0697){return new BPromise(function(_0x4de668,_0x3c908e){return client['request'](_0x4606ff,_0x5e0697)[_0xcd4b('0x9')](function(_0x52f68c){logger[_0xcd4b('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x585ec9,'request\x20sent');logger[_0xcd4b('0xb')](_0xcd4b('0xc'),_0x585ec9,'request\x20sent',JSON['stringify'](_0x52f68c));if(_0x52f68c[_0xcd4b('0xd')]){if(_0x52f68c[_0xcd4b('0xd')][_0xcd4b('0xe')]===0x1f4){logger[_0xcd4b('0xd')](_0xcd4b('0xf'),_0x585ec9,_0x52f68c[_0xcd4b('0xd')][_0xcd4b('0x10')]);return _0x3c908e(_0x52f68c[_0xcd4b('0xd')][_0xcd4b('0x10')]);}logger[_0xcd4b('0xd')](_0xcd4b('0xf'),_0x585ec9,_0x52f68c[_0xcd4b('0xd')][_0xcd4b('0x10')]);return _0x4de668(_0x52f68c['error'][_0xcd4b('0x10')]);}else{logger['info'](_0xcd4b('0xf'),_0x585ec9,_0xcd4b('0x11'));_0x4de668(_0x52f68c[_0xcd4b('0x12')][_0xcd4b('0x10')]);}})['catch'](function(_0x1a0a59){logger[_0xcd4b('0xd')](_0xcd4b('0xf'),_0x585ec9,_0x1a0a59);_0x3c908e(_0x1a0a59);});});} \ No newline at end of file +var _0x52cc=['rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x52cc,0x119));var _0xc52c=function(_0x4c5619,_0x6f37d6){_0x4c5619=_0x4c5619-0x0;var _0x50ec6a=_0x52cc[_0x4c5619];return _0x50ec6a;};'use strict';var _=require(_0xc52c('0x0'));var util=require(_0xc52c('0x1'));var moment=require(_0xc52c('0x2'));var BPromise=require(_0xc52c('0x3'));var rs=require(_0xc52c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc52c('0x5'));var logger=require(_0xc52c('0x6'))(_0xc52c('0x7'));var config=require(_0xc52c('0x8'));var jayson=require(_0xc52c('0x9'));var client=jayson[_0xc52c('0xa')][_0xc52c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22ef4d,_0x1b9a30,_0x5a9c5e){return new BPromise(function(_0x2070e5,_0x3ebd7e){return client[_0xc52c('0xc')](_0x22ef4d,_0x5a9c5e)[_0xc52c('0xd')](function(_0x5a0557){logger['info'](_0xc52c('0xe'),_0x1b9a30,_0xc52c('0xf'));logger[_0xc52c('0x10')](_0xc52c('0x11'),_0x1b9a30,_0xc52c('0xf'),JSON[_0xc52c('0x12')](_0x5a0557));if(_0x5a0557[_0xc52c('0x13')]){if(_0x5a0557[_0xc52c('0x13')][_0xc52c('0x14')]===0x1f4){logger[_0xc52c('0x13')](_0xc52c('0xe'),_0x1b9a30,_0x5a0557[_0xc52c('0x13')]['message']);return _0x3ebd7e(_0x5a0557[_0xc52c('0x13')][_0xc52c('0x15')]);}logger[_0xc52c('0x13')](_0xc52c('0xe'),_0x1b9a30,_0x5a0557[_0xc52c('0x13')]['message']);return _0x2070e5(_0x5a0557[_0xc52c('0x13')][_0xc52c('0x15')]);}else{logger[_0xc52c('0x16')](_0xc52c('0xe'),_0x1b9a30,_0xc52c('0xf'));_0x2070e5(_0x5a0557[_0xc52c('0x17')][_0xc52c('0x15')]);}})['catch'](function(_0x5b612d){logger[_0xc52c('0x13')](_0xc52c('0xe'),_0x1b9a30,_0x5b612d);_0x3ebd7e(_0x5b612d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index d81d0cc..666cbca 100644 --- a/server/api/intFreshdeskField/index.js +++ b/server/api/intFreshdeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['connect-timeout','express','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','multer','path'];(function(_0xb084c7,_0x4303c8){var _0x293ad8=function(_0x29ccd7){while(--_0x29ccd7){_0xb084c7['push'](_0xb084c7['shift']());}};_0x293ad8(++_0x4303c8);}(_0x3e74,0x175));var _0x43e7=function(_0x59c57e,_0xa6e158){_0x59c57e=_0x59c57e-0x0;var _0x3c3c25=_0x3e74[_0x59c57e];return _0x3c3c25;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0xa')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0xb')]);router['put'](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0xd')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);module['exports']=router; \ No newline at end of file +var _0x3e74=['connect-timeout','express','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','multer','path'];(function(_0x59a3b8,_0x3ce69b){var _0x44e0da=function(_0xfe40c9){while(--_0xfe40c9){_0x59a3b8['push'](_0x59a3b8['shift']());}};_0x44e0da(++_0x3ce69b);}(_0x3e74,0x175));var _0x43e7=function(_0x233bc0,_0x2aece1){_0x233bc0=_0x233bc0-0x0;var _0x58f07d=_0x3e74[_0x233bc0];return _0x58f07d;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0xa')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0xb')]);router['put'](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0xd')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 08aaa9a..519dbf4 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.attributes.js +++ b/server/api/intFreshdeskField/intFreshdeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5bc=['variable','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x3b411f,_0x4b55e8){var _0x236803=function(_0x584d18){while(--_0x584d18){_0x3b411f['push'](_0x3b411f['shift']());}};_0x236803(++_0x4b55e8);}(_0xe5bc,0x8c));var _0xce5b=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0xe5bc[_0x137d1d];return _0x485108;};'use strict';var Sequelize=require(_0xce5b('0x0'));module[_0xce5b('0x1')]={'type':{'type':Sequelize[_0xce5b('0x2')](_0xce5b('0x3'),_0xce5b('0x4'),_0xce5b('0x5'),'keyValue'),'defaultValue':_0xce5b('0x3')},'content':{'type':Sequelize[_0xce5b('0x6')]},'key':{'type':Sequelize[_0xce5b('0x6')]},'keyType':{'type':Sequelize[_0xce5b('0x2')](_0xce5b('0x3'),_0xce5b('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xce5b('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xce5b('0x6')]},'customField':{'type':Sequelize[_0xce5b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x32ef=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','STRING'];(function(_0x337504,_0x5bbbdd){var _0x34be76=function(_0x5afd0a){while(--_0x5afd0a){_0x337504['push'](_0x337504['shift']());}};_0x34be76(++_0x5bbbdd);}(_0x32ef,0xf9));var _0xf32e=function(_0x240f66,_0x54cfb5){_0x240f66=_0x240f66-0x0;var _0x5983eb=_0x32ef[_0x240f66];return _0x5983eb;};'use strict';var Sequelize=require(_0xf32e('0x0'));module[_0xf32e('0x1')]={'type':{'type':Sequelize[_0xf32e('0x2')](_0xf32e('0x3'),_0xf32e('0x4'),_0xf32e('0x5'),'keyValue'),'defaultValue':_0xf32e('0x3')},'content':{'type':Sequelize[_0xf32e('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf32e('0x2')](_0xf32e('0x3'),_0xf32e('0x4'),_0xf32e('0x5'))},'keyContent':{'type':Sequelize[_0xf32e('0x6')]},'idField':{'type':Sequelize[_0xf32e('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf32e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 7778fb2..0803cf9 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.controller.js +++ b/server/api/intFreshdeskField/intFreshdeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadd7=['fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','FreshdeskField','keys','query','filters','intersection','model'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0xadd7,0x132));var _0x7add=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xadd7[_0x57b54c];return _0x59cc19;};'use strict';var pdf=require(_0x7add('0x0'));var emlformat=require(_0x7add('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7add('0x2'));var jsonpatch=require(_0x7add('0x3'));var rp=require(_0x7add('0x4'));var moment=require(_0x7add('0x5'));var BPromise=require(_0x7add('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7add('0x7'));var ejs=require(_0x7add('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7add('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7add('0xa'));var toCsv=require(_0x7add('0x7'));var querystring=require(_0x7add('0xb'));var Papa=require('papaparse');var Redis=require(_0x7add('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x7add('0xd'));var hardwareService=require(_0x7add('0xe'));var logger=require(_0x7add('0xf'))(_0x7add('0x10'));var utils=require(_0x7add('0x11'));var config=require(_0x7add('0x12'));var db=require(_0x7add('0x13'))['db'];function respondWithStatusCode(_0x52e96b,_0x513dce){_0x513dce=_0x513dce||0xcc;return function(_0x47da76){if(_0x47da76){return _0x52e96b['sendStatus'](_0x513dce);}return _0x52e96b[_0x7add('0x14')](_0x513dce)[_0x7add('0x15')]();};}function respondWithResult(_0x3807e8,_0x592595){_0x592595=_0x592595||0xc8;return function(_0x35b4db){if(_0x35b4db){return _0x3807e8[_0x7add('0x14')](_0x592595)[_0x7add('0x16')](_0x35b4db);}};}function respondWithFilteredResult(_0x32f999,_0xc0fd4d){return function(_0x4cad15){if(_0x4cad15){var _0x33700e=_0x4cad15[_0x7add('0x17')],_0x549c20=_0xc0fd4d[_0x7add('0x18')],_0x35e1cb=_0xc0fd4d['offset']+_0xc0fd4d[_0x7add('0x19')],_0x37220d;if(_0x35e1cb>=_0x33700e){_0x35e1cb=_0x33700e;_0x37220d=0xc8;}else{_0x37220d=0xce;}_0x32f999['status'](_0x37220d);return _0x32f999[_0x7add('0x1a')]('Content-Range',_0x549c20+'-'+_0x35e1cb+'/'+_0x33700e)[_0x7add('0x16')](_0x4cad15);}return null;};}function patchUpdates(_0x592d46){return function(_0xca831c){try{jsonpatch[_0x7add('0x1b')](_0xca831c,_0x592d46,!![]);}catch(_0xa9e760){return BPromise[_0x7add('0x1c')](_0xa9e760);}return _0xca831c['save']();};}function saveUpdates(_0x1172fb,_0x57e9fc){return function(_0x2faa4a){if(_0x2faa4a){return _0x2faa4a[_0x7add('0x1d')](_0x1172fb)['then'](function(_0xd6d037){return _0xd6d037;});}return null;};}function removeEntity(_0x462af8,_0x14d678){return function(_0x5a5c4d){if(_0x5a5c4d){return _0x5a5c4d[_0x7add('0x1e')]()[_0x7add('0x1f')](function(){_0x462af8[_0x7add('0x14')](0xcc)[_0x7add('0x15')]();});}};}function handleEntityNotFound(_0x5c3f9e,_0x9dc655){return function(_0x2ba6b5){if(!_0x2ba6b5){_0x5c3f9e[_0x7add('0x20')](0x194);}return _0x2ba6b5;};}function handleError(_0x2a5091,_0x12f180){_0x12f180=_0x12f180||0x1f4;return function(_0x2d5c2c){logger[_0x7add('0x21')](_0x2d5c2c[_0x7add('0x22')]);if(_0x2d5c2c['name']){delete _0x2d5c2c[_0x7add('0x23')];}_0x2a5091['status'](_0x12f180)[_0x7add('0x24')](_0x2d5c2c);};}exports[_0x7add('0x25')]=function(_0x8d07ea,_0x5dd51a){var _0x1a16fa={},_0x50977f={},_0x3d3f7a={'count':0x0,'rows':[]};var _0x555b6a=db[_0x7add('0x26')]['rawAttributes'];_0x50977f['model']=_[_0x7add('0x27')](_0x555b6a);_0x50977f[_0x7add('0x28')]=_['keys'](_0x8d07ea[_0x7add('0x28')]);_0x50977f[_0x7add('0x29')]=_[_0x7add('0x2a')](_0x50977f['model'],_0x50977f[_0x7add('0x28')]);_0x1a16fa['attributes']=_['intersection'](_0x50977f[_0x7add('0x2b')],qs[_0x7add('0x2c')](_0x8d07ea['query'][_0x7add('0x2c')]));_0x1a16fa[_0x7add('0x2d')]=_0x1a16fa[_0x7add('0x2d')][_0x7add('0x2e')]?_0x1a16fa[_0x7add('0x2d')]:_0x50977f[_0x7add('0x2b')];if(!_0x8d07ea[_0x7add('0x28')][_0x7add('0x2f')](_0x7add('0x30'))){_0x1a16fa[_0x7add('0x19')]=qs['limit'](_0x8d07ea[_0x7add('0x28')]['limit']);_0x1a16fa[_0x7add('0x18')]=qs['offset'](_0x8d07ea[_0x7add('0x28')][_0x7add('0x18')]);}_0x1a16fa['order']=qs[_0x7add('0x31')](_0x8d07ea[_0x7add('0x28')][_0x7add('0x31')]);_0x1a16fa[_0x7add('0x32')]=qs['filters'](_[_0x7add('0x33')](_0x8d07ea[_0x7add('0x28')],_0x50977f[_0x7add('0x29')]));if(_0x8d07ea[_0x7add('0x28')][_0x7add('0x34')]){_0x1a16fa['where']=_[_0x7add('0x35')](_0x1a16fa[_0x7add('0x32')],{'$or':_[_0x7add('0x36')](_0x555b6a,function(_0x336797){if(_0x336797[_0x7add('0x37')][_0x7add('0x38')]!==_0x7add('0x39')){var _0x277a90={};_0x277a90[_0x336797[_0x7add('0x3a')]]={'$like':'%'+_0x8d07ea[_0x7add('0x28')][_0x7add('0x34')]+'%'};return _0x277a90;}})});}_0x1a16fa=_['merge']({},_0x1a16fa,_0x8d07ea['options']);var _0x54fc00={'where':_0x1a16fa[_0x7add('0x32')]};return db[_0x7add('0x26')][_0x7add('0x17')](_0x54fc00)[_0x7add('0x1f')](function(_0x3e495e){_0x3d3f7a[_0x7add('0x17')]=_0x3e495e;if(_0x8d07ea['query'][_0x7add('0x3b')]){_0x1a16fa[_0x7add('0x3c')]=[{'all':!![]}];}return db[_0x7add('0x26')][_0x7add('0x3d')](_0x1a16fa);})['then'](function(_0x2430fa){_0x3d3f7a[_0x7add('0x3e')]=_0x2430fa;return _0x3d3f7a;})['then'](respondWithFilteredResult(_0x5dd51a,_0x1a16fa))[_0x7add('0x3f')](handleError(_0x5dd51a,null));};exports[_0x7add('0x40')]=function(_0x315dcd,_0x422f92){var _0xd18eb4={'raw':!![],'where':{'id':_0x315dcd[_0x7add('0x41')]['id']}},_0x273852={};_0x273852[_0x7add('0x2b')]=_[_0x7add('0x27')](db['FreshdeskField']['rawAttributes']);_0x273852[_0x7add('0x28')]=_[_0x7add('0x27')](_0x315dcd[_0x7add('0x28')]);_0x273852[_0x7add('0x29')]=_[_0x7add('0x2a')](_0x273852[_0x7add('0x2b')],_0x273852[_0x7add('0x28')]);_0xd18eb4['attributes']=_['intersection'](_0x273852['model'],qs[_0x7add('0x2c')](_0x315dcd[_0x7add('0x28')][_0x7add('0x2c')]));_0xd18eb4[_0x7add('0x2d')]=_0xd18eb4[_0x7add('0x2d')][_0x7add('0x2e')]?_0xd18eb4[_0x7add('0x2d')]:_0x273852[_0x7add('0x2b')];if(_0x315dcd[_0x7add('0x28')][_0x7add('0x3b')]){_0xd18eb4[_0x7add('0x3c')]=[{'all':!![]}];}_0xd18eb4=_[_0x7add('0x35')]({},_0xd18eb4,_0x315dcd[_0x7add('0x42')]);return db[_0x7add('0x26')][_0x7add('0x43')](_0xd18eb4)['then'](handleEntityNotFound(_0x422f92,null))['then'](respondWithResult(_0x422f92,null))[_0x7add('0x3f')](handleError(_0x422f92,null));};exports[_0x7add('0x44')]=function(_0x10d81c,_0x6ada5){return db[_0x7add('0x26')][_0x7add('0x44')](_0x10d81c['body'],{})[_0x7add('0x1f')](respondWithResult(_0x6ada5,0xc9))[_0x7add('0x3f')](handleError(_0x6ada5,null));};exports[_0x7add('0x1d')]=function(_0x153f1b,_0x31e60c){if(_0x153f1b[_0x7add('0x45')]['id']){delete _0x153f1b['body']['id'];}return db[_0x7add('0x26')]['find']({'where':{'id':_0x153f1b[_0x7add('0x41')]['id']}})[_0x7add('0x1f')](handleEntityNotFound(_0x31e60c,null))['then'](saveUpdates(_0x153f1b['body'],null))[_0x7add('0x1f')](respondWithResult(_0x31e60c,null))['catch'](handleError(_0x31e60c,null));};exports[_0x7add('0x1e')]=function(_0x4f1103,_0x824d6a){return db[_0x7add('0x26')][_0x7add('0x43')]({'where':{'id':_0x4f1103[_0x7add('0x41')]['id']}})[_0x7add('0x1f')](handleEntityNotFound(_0x824d6a,null))[_0x7add('0x1f')](removeEntity(_0x824d6a,null))[_0x7add('0x3f')](handleError(_0x824d6a,null));}; \ No newline at end of file +var _0xa1a0=['lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','FreshdeskField','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','then','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa1a0,0x1f0));var _0x0a1a=function(_0x65d13d,_0x49e929){_0x65d13d=_0x65d13d-0x0;var _0x309bb3=_0xa1a0[_0x65d13d];return _0x309bb3;};'use strict';var pdf=require(_0x0a1a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0a1a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a1a('0x2'));var rp=require(_0x0a1a('0x3'));var moment=require('moment');var BPromise=require(_0x0a1a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0a1a('0x5'));var sox=require(_0x0a1a('0x6'));var csv=require(_0x0a1a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0a1a('0x8'));var squel=require(_0x0a1a('0x9'));var crypto=require(_0x0a1a('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0a1a('0x7'));var querystring=require('querystring');var Papa=require(_0x0a1a('0xb'));var Redis=require(_0x0a1a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x0a1a('0xd'));var hardwareService=require(_0x0a1a('0xe'));var logger=require(_0x0a1a('0xf'))(_0x0a1a('0x10'));var utils=require(_0x0a1a('0x11'));var config=require(_0x0a1a('0x12'));var db=require(_0x0a1a('0x13'))['db'];function respondWithStatusCode(_0x2ac49b,_0x3dd3d4){_0x3dd3d4=_0x3dd3d4||0xcc;return function(_0x438365){if(_0x438365){return _0x2ac49b[_0x0a1a('0x14')](_0x3dd3d4);}return _0x2ac49b[_0x0a1a('0x15')](_0x3dd3d4)['end']();};}function respondWithResult(_0x1d442c,_0x9a6d24){_0x9a6d24=_0x9a6d24||0xc8;return function(_0x4bec8f){if(_0x4bec8f){return _0x1d442c[_0x0a1a('0x15')](_0x9a6d24)[_0x0a1a('0x16')](_0x4bec8f);}};}function respondWithFilteredResult(_0x452453,_0x5bf46b){return function(_0x5da85b){if(_0x5da85b){var _0x16c368=_0x5da85b[_0x0a1a('0x17')],_0x4f1756=_0x5bf46b[_0x0a1a('0x18')],_0x228692=_0x5bf46b[_0x0a1a('0x18')]+_0x5bf46b[_0x0a1a('0x19')],_0x5495cf;if(_0x228692>=_0x16c368){_0x228692=_0x16c368;_0x5495cf=0xc8;}else{_0x5495cf=0xce;}_0x452453[_0x0a1a('0x15')](_0x5495cf);return _0x452453[_0x0a1a('0x1a')](_0x0a1a('0x1b'),_0x4f1756+'-'+_0x228692+'/'+_0x16c368)[_0x0a1a('0x16')](_0x5da85b);}return null;};}function patchUpdates(_0x2c33cd){return function(_0x1a1ca8){try{jsonpatch[_0x0a1a('0x1c')](_0x1a1ca8,_0x2c33cd,!![]);}catch(_0x316522){return BPromise[_0x0a1a('0x1d')](_0x316522);}return _0x1a1ca8[_0x0a1a('0x1e')]();};}function saveUpdates(_0x17ad84,_0x346648){return function(_0x420725){if(_0x420725){return _0x420725[_0x0a1a('0x1f')](_0x17ad84)['then'](function(_0x182bf2){return _0x182bf2;});}return null;};}function removeEntity(_0x2e21ed,_0x4f3923){return function(_0x464cf2){if(_0x464cf2){return _0x464cf2[_0x0a1a('0x20')]()['then'](function(){_0x2e21ed[_0x0a1a('0x15')](0xcc)[_0x0a1a('0x21')]();});}};}function handleEntityNotFound(_0x2a4488,_0x468f43){return function(_0x47ab17){if(!_0x47ab17){_0x2a4488[_0x0a1a('0x14')](0x194);}return _0x47ab17;};}function handleError(_0x6196ac,_0x2cb40d){_0x2cb40d=_0x2cb40d||0x1f4;return function(_0x46d75d){logger[_0x0a1a('0x22')](_0x46d75d[_0x0a1a('0x23')]);if(_0x46d75d[_0x0a1a('0x24')]){delete _0x46d75d['name'];}_0x6196ac['status'](_0x2cb40d)[_0x0a1a('0x25')](_0x46d75d);};}exports[_0x0a1a('0x26')]=function(_0xef817f,_0x4ef32f){var _0x50c44c={},_0x1b5f62={},_0x3034f4={'count':0x0,'rows':[]};var _0x446209=db[_0x0a1a('0x27')]['rawAttributes'];_0x1b5f62[_0x0a1a('0x28')]=_[_0x0a1a('0x29')](_0x446209);_0x1b5f62['query']=_[_0x0a1a('0x29')](_0xef817f[_0x0a1a('0x2a')]);_0x1b5f62[_0x0a1a('0x2b')]=_['intersection'](_0x1b5f62[_0x0a1a('0x28')],_0x1b5f62[_0x0a1a('0x2a')]);_0x50c44c[_0x0a1a('0x2c')]=_[_0x0a1a('0x2d')](_0x1b5f62[_0x0a1a('0x28')],qs[_0x0a1a('0x2e')](_0xef817f['query'][_0x0a1a('0x2e')]));_0x50c44c['attributes']=_0x50c44c[_0x0a1a('0x2c')]['length']?_0x50c44c[_0x0a1a('0x2c')]:_0x1b5f62[_0x0a1a('0x28')];if(!_0xef817f[_0x0a1a('0x2a')][_0x0a1a('0x2f')](_0x0a1a('0x30'))){_0x50c44c[_0x0a1a('0x19')]=qs['limit'](_0xef817f[_0x0a1a('0x2a')][_0x0a1a('0x19')]);_0x50c44c[_0x0a1a('0x18')]=qs[_0x0a1a('0x18')](_0xef817f[_0x0a1a('0x2a')]['offset']);}_0x50c44c[_0x0a1a('0x31')]=qs[_0x0a1a('0x32')](_0xef817f[_0x0a1a('0x2a')][_0x0a1a('0x32')]);_0x50c44c[_0x0a1a('0x33')]=qs[_0x0a1a('0x2b')](_[_0x0a1a('0x34')](_0xef817f[_0x0a1a('0x2a')],_0x1b5f62[_0x0a1a('0x2b')]));if(_0xef817f[_0x0a1a('0x2a')][_0x0a1a('0x35')]){_0x50c44c[_0x0a1a('0x33')]=_['merge'](_0x50c44c[_0x0a1a('0x33')],{'$or':_[_0x0a1a('0x36')](_0x446209,function(_0x57927d){if(_0x57927d['type'][_0x0a1a('0x37')]!==_0x0a1a('0x38')){var _0x2ffc86={};_0x2ffc86[_0x57927d[_0x0a1a('0x39')]]={'$like':'%'+_0xef817f[_0x0a1a('0x2a')][_0x0a1a('0x35')]+'%'};return _0x2ffc86;}})});}_0x50c44c=_[_0x0a1a('0x3a')]({},_0x50c44c,_0xef817f[_0x0a1a('0x3b')]);var _0x8a819a={'where':_0x50c44c[_0x0a1a('0x33')]};return db[_0x0a1a('0x27')][_0x0a1a('0x17')](_0x8a819a)[_0x0a1a('0x3c')](function(_0xbb10fc){_0x3034f4[_0x0a1a('0x17')]=_0xbb10fc;if(_0xef817f[_0x0a1a('0x2a')]['includeAll']){_0x50c44c[_0x0a1a('0x3d')]=[{'all':!![]}];}return db[_0x0a1a('0x27')][_0x0a1a('0x3e')](_0x50c44c);})[_0x0a1a('0x3c')](function(_0x5e6185){_0x3034f4[_0x0a1a('0x3f')]=_0x5e6185;return _0x3034f4;})[_0x0a1a('0x3c')](respondWithFilteredResult(_0x4ef32f,_0x50c44c))[_0x0a1a('0x40')](handleError(_0x4ef32f,null));};exports[_0x0a1a('0x41')]=function(_0x452009,_0x548ebc){var _0x592563={'raw':!![],'where':{'id':_0x452009[_0x0a1a('0x42')]['id']}},_0x3f54ab={};_0x3f54ab['model']=_['keys'](db[_0x0a1a('0x27')]['rawAttributes']);_0x3f54ab[_0x0a1a('0x2a')]=_['keys'](_0x452009[_0x0a1a('0x2a')]);_0x3f54ab[_0x0a1a('0x2b')]=_[_0x0a1a('0x2d')](_0x3f54ab[_0x0a1a('0x28')],_0x3f54ab[_0x0a1a('0x2a')]);_0x592563[_0x0a1a('0x2c')]=_[_0x0a1a('0x2d')](_0x3f54ab['model'],qs[_0x0a1a('0x2e')](_0x452009[_0x0a1a('0x2a')][_0x0a1a('0x2e')]));_0x592563['attributes']=_0x592563['attributes'][_0x0a1a('0x43')]?_0x592563[_0x0a1a('0x2c')]:_0x3f54ab[_0x0a1a('0x28')];if(_0x452009['query'][_0x0a1a('0x44')]){_0x592563[_0x0a1a('0x3d')]=[{'all':!![]}];}_0x592563=_['merge']({},_0x592563,_0x452009[_0x0a1a('0x3b')]);return db[_0x0a1a('0x27')][_0x0a1a('0x45')](_0x592563)[_0x0a1a('0x3c')](handleEntityNotFound(_0x548ebc,null))[_0x0a1a('0x3c')](respondWithResult(_0x548ebc,null))[_0x0a1a('0x40')](handleError(_0x548ebc,null));};exports[_0x0a1a('0x46')]=function(_0x5de318,_0x5d7f9d){return db[_0x0a1a('0x27')][_0x0a1a('0x46')](_0x5de318['body'],{})[_0x0a1a('0x3c')](respondWithResult(_0x5d7f9d,0xc9))[_0x0a1a('0x40')](handleError(_0x5d7f9d,null));};exports[_0x0a1a('0x1f')]=function(_0x1e3af4,_0x5b6495){if(_0x1e3af4['body']['id']){delete _0x1e3af4['body']['id'];}return db[_0x0a1a('0x27')]['find']({'where':{'id':_0x1e3af4[_0x0a1a('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b6495,null))[_0x0a1a('0x3c')](saveUpdates(_0x1e3af4[_0x0a1a('0x47')],null))[_0x0a1a('0x3c')](respondWithResult(_0x5b6495,null))['catch'](handleError(_0x5b6495,null));};exports[_0x0a1a('0x20')]=function(_0x1e2ef0,_0x2675be){return db['FreshdeskField']['find']({'where':{'id':_0x1e2ef0['params']['id']}})[_0x0a1a('0x3c')](handleEntityNotFound(_0x2675be,null))[_0x0a1a('0x3c')](removeEntity(_0x2675be,null))[_0x0a1a('0x40')](handleError(_0x2675be,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 56b88d6..19ee700 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.model.js +++ b/server/api/intFreshdeskField/intFreshdeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62bc=['exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x4e4901,_0x40e165){var _0x5bbfe7=function(_0xccf26c){while(--_0xccf26c){_0x4e4901['push'](_0x4e4901['shift']());}};_0x5bbfe7(++_0x40e165);}(_0x62bc,0xba));var _0xc62b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc62b('0x0'));var util=require(_0xc62b('0x1'));var logger=require(_0xc62b('0x2'))('api');var moment=require(_0xc62b('0x3'));var BPromise=require('bluebird');var rp=require(_0xc62b('0x4'));var fs=require('fs');var path=require(_0xc62b('0x5'));var rimraf=require(_0xc62b('0x6'));var config=require(_0xc62b('0x7'));var attributes=require(_0xc62b('0x8'));module[_0xc62b('0x9')]=function(_0x47175b,_0x1d38e1){return _0x47175b[_0xc62b('0xa')](_0xc62b('0xb'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xc62b('0xc'),'fields':[_0xc62b('0xd'),_0xc62b('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9684=['moment','bluebird','request-promise','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x51bad6,_0x49005c){var _0x1ece20=function(_0xb4a1e5){while(--_0xb4a1e5){_0x51bad6['push'](_0x51bad6['shift']());}};_0x1ece20(++_0x49005c);}(_0x9684,0xdd));var _0x4968=function(_0x3b57df,_0x543096){_0x3b57df=_0x3b57df-0x0;var _0x50ccdd=_0x9684[_0x3b57df];return _0x50ccdd;};'use strict';var _=require(_0x4968('0x0'));var util=require(_0x4968('0x1'));var logger=require(_0x4968('0x2'))(_0x4968('0x3'));var moment=require(_0x4968('0x4'));var BPromise=require(_0x4968('0x5'));var rp=require(_0x4968('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4968('0x7'));var attributes=require(_0x4968('0x8'));module[_0x4968('0x9')]=function(_0x29a8c7,_0x7d362d){return _0x29a8c7[_0x4968('0xa')](_0x4968('0xb'),attributes,{'tableName':_0x4968('0xc'),'paranoid':![],'indexes':[{'name':_0x4968('0xd'),'fields':[_0x4968('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 6294978..e3468cb 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js +++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x260013,_0x9ae162){var _0x12ba4d=function(_0x2338aa){while(--_0x2338aa){_0x260013['push'](_0x260013['shift']());}};_0x12ba4d(++_0x9ae162);}(_0xb10b,0x12a));var _0xbb10=function(_0x30bdff,_0x308063){_0x30bdff=_0x30bdff-0x0;var _0x1e7ca9=_0xb10b[_0x30bdff];return _0x1e7ca9;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x190985,_0x1803a0){var _0x3fbad0=function(_0x565246){while(--_0x565246){_0x190985['push'](_0x190985['shift']());}};_0x3fbad0(++_0x1803a0);}(_0xb10b,0x12a));var _0xbb10=function(_0x529a72,_0x3a841b){_0x529a72=_0x529a72-0x0;var _0x5f0d01=_0xb10b[_0x529a72];return _0x5f0d01;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index de07220..8409457 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa17=['put','update','delete','destroy','exports','connect-timeout','Router','../../components/auth/service','../../config/environment','./intSalesforceAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','post','addConfiguration'];(function(_0x1dcbdc,_0xf70a58){var _0x505e3a=function(_0x88e4b1){while(--_0x88e4b1){_0x1dcbdc['push'](_0x1dcbdc['shift']());}};_0x505e3a(++_0xf70a58);}(_0xaa17,0xc3));var _0x7aa1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa17[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7aa1('0x0'));var express=require('express');var router=express[_0x7aa1('0x1')]();var auth=require(_0x7aa1('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x7aa1('0x3'));var controller=require(_0x7aa1('0x4'));router['get']('/',auth[_0x7aa1('0x5')](),controller[_0x7aa1('0x6')]);router[_0x7aa1('0x7')](_0x7aa1('0x8'),auth[_0x7aa1('0x5')](),controller[_0x7aa1('0x9')]);router[_0x7aa1('0x7')](_0x7aa1('0xa'),auth[_0x7aa1('0x5')](),controller[_0x7aa1('0xb')]);router[_0x7aa1('0x7')]('/:id/fields',auth[_0x7aa1('0x5')](),controller['getFields']);router[_0x7aa1('0xc')]('/',auth[_0x7aa1('0x5')](),controller['create']);router[_0x7aa1('0xc')](_0x7aa1('0xa'),auth[_0x7aa1('0x5')](),controller[_0x7aa1('0xd')]);router[_0x7aa1('0xe')]('/:id',auth[_0x7aa1('0x5')](),controller[_0x7aa1('0xf')]);router[_0x7aa1('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7aa1('0x11')]);module[_0x7aa1('0x12')]=router; \ No newline at end of file +var _0x7eab=['delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','get','index','isAuthenticated','show','/:id/configurations','/:id/fields','post','put','/:id','update'];(function(_0x2bbdc4,_0x2cb88e){var _0x482d0c=function(_0x4da8ce){while(--_0x4da8ce){_0x2bbdc4['push'](_0x2bbdc4['shift']());}};_0x482d0c(++_0x2cb88e);}(_0x7eab,0x1d7));var _0xb7ea=function(_0x54782d,_0x26618c){_0x54782d=_0x54782d-0x0;var _0x3f3631=_0x7eab[_0x54782d];return _0x3f3631;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb7ea('0x0'));var timeout=require(_0xb7ea('0x1'));var express=require(_0xb7ea('0x2'));var router=express[_0xb7ea('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb7ea('0x4'));var config=require('../../config/environment');var controller=require('./intSalesforceAccount.controller');router[_0xb7ea('0x5')]('/',auth['isAuthenticated'](),controller[_0xb7ea('0x6')]);router[_0xb7ea('0x5')]('/:id',auth[_0xb7ea('0x7')](),controller[_0xb7ea('0x8')]);router['get'](_0xb7ea('0x9'),auth[_0xb7ea('0x7')](),controller['getConfigurations']);router[_0xb7ea('0x5')](_0xb7ea('0xa'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xb7ea('0x7')](),controller['create']);router[_0xb7ea('0xb')]('/:id/configurations',auth[_0xb7ea('0x7')](),controller['addConfiguration']);router[_0xb7ea('0xc')](_0xb7ea('0xd'),auth[_0xb7ea('0x7')](),controller[_0xb7ea('0xe')]);router[_0xb7ea('0xf')]('/:id',auth[_0xb7ea('0x7')](),controller[_0xb7ea('0x10')]);module[_0xb7ea('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 631de7b..22e7546 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['STRING','username','integrationTab','newTab','exports'];(function(_0x346dba,_0x4301dd){var _0x3fafe1=function(_0x27bc63){while(--_0x27bc63){_0x346dba['push'](_0x346dba['shift']());}};_0x3fafe1(++_0x4301dd);}(_0x1261,0x144));var _0x1126=function(_0x1ad5a2,_0x45632b){_0x1ad5a2=_0x1ad5a2-0x0;var _0x51eba3=_0x1261[_0x1ad5a2];return _0x51eba3;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'name':{'type':Sequelize[_0x1126('0x1')]},'description':{'type':Sequelize[_0x1126('0x1')]},'username':{'type':Sequelize[_0x1126('0x1')],'unique':_0x1126('0x2')},'remoteUri':{'type':Sequelize[_0x1126('0x1')]},'password':{'type':Sequelize[_0x1126('0x1')]},'clientId':{'type':Sequelize[_0x1126('0x1')]},'clientSecret':{'type':Sequelize[_0x1126('0x1')]},'securityToken':{'type':Sequelize[_0x1126('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1126('0x3'),_0x1126('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x7fbe=['integrationTab','newTab','STRING','username','ENUM'];(function(_0x5d9963,_0x29d23a){var _0x5cb2f3=function(_0x3228ce){while(--_0x3228ce){_0x5d9963['push'](_0x5d9963['shift']());}};_0x5cb2f3(++_0x29d23a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x19c5dd,_0x2a35f5){_0x19c5dd=_0x19c5dd-0x0;var _0x40218d=_0x7fbe[_0x19c5dd];return _0x40218d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'username':{'type':Sequelize[_0xe7fb('0x0')],'unique':_0xe7fb('0x1')},'remoteUri':{'type':Sequelize[_0xe7fb('0x0')]},'password':{'type':Sequelize[_0xe7fb('0x0')]},'clientId':{'type':Sequelize[_0xe7fb('0x0')]},'clientSecret':{'type':Sequelize[_0xe7fb('0x0')]},'securityToken':{'type':Sequelize[_0xe7fb('0x0')]},'serverUrl':{'type':Sequelize[_0xe7fb('0x0')]},'type':{'type':Sequelize[_0xe7fb('0x2')](_0xe7fb('0x3'),_0xe7fb('0x4')),'defaultValue':_0xe7fb('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index b556dee..bf9a702 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a31=['filters','intersection','attributes','nolimit','sort','pick','filter','where','merge','map','type','key','options','includeAll','include','findAll','show','fields','length','find','create','body','params','getConfigurations','findOne','SalesforceConfiguration','order','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','password','slice','substring','lastIndexOf','Connection','username','concat','securityToken','isNil','ticketType','describe','CallObject','CallType','Priority','Status','Type','Case','Reason','SuppliedName','remove','custom','includes','label','picklistValues','value','boolean','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','zip-dir','request-promise','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','stack','name','send','SalesforceAccount','rawAttributes','model','keys','query'];(function(_0x5d95ea,_0x1925c4){var _0x1b0162=function(_0x51fd94){while(--_0x51fd94){_0x5d95ea['push'](_0x5d95ea['shift']());}};_0x1b0162(++_0x1925c4);}(_0x9a31,0xc8));var _0x19a3=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0x9a31[_0x2de0a7];return _0x429437;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x19a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x19a3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x19a3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x19a3('0x3'));var path=require(_0x19a3('0x4'));var sox=require(_0x19a3('0x5'));var csv=require(_0x19a3('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x19a3('0x7'));var crypto=require(_0x19a3('0x8'));var jsforce=require(_0x19a3('0x9'));var deskjs=require(_0x19a3('0xa'));var toCsv=require(_0x19a3('0x6'));var querystring=require(_0x19a3('0xb'));var Papa=require('papaparse');var Redis=require(_0x19a3('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x19a3('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x19a3('0xe'))(_0x19a3('0xf'));var utils=require(_0x19a3('0x10'));var config=require(_0x19a3('0x11'));var db=require(_0x19a3('0x12'))['db'];var integrations=require(_0x19a3('0x13'));var jayson=require(_0x19a3('0x14'));var client=jayson['client'][_0x19a3('0x15')]({'port':0x232a});function checkPasswordPattern(_0x7cc92,_0x51ec41,_0x273b34){if(_0x273b34){var _0x3251e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3251e8['test'](_0x51ec41)){return _0x7cc92;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x7cc92;}}function respondWithRpcPromise(_0x567d40,_0x2e15f1,_0x30e88d,_0x5206b1){return new BPromise(function(_0x3c82a6,_0x46f398){var _0x16528e=_0x5206b1||client;return _0x16528e[_0x19a3('0x16')](_0x567d40,_0x30e88d)[_0x19a3('0x17')](function(_0x33db31){logger[_0x19a3('0x18')](_0x19a3('0x19'),_0x2e15f1,_0x19a3('0x1a'));logger['debug'](_0x19a3('0x1b'),_0x2e15f1,_0x19a3('0x1a'),JSON[_0x19a3('0x1c')](_0x33db31));if(_0x33db31['error']){if(_0x33db31[_0x19a3('0x1d')]['code']===0x1f4){logger[_0x19a3('0x1d')](_0x19a3('0x19'),_0x2e15f1,_0x33db31[_0x19a3('0x1d')]['message']);return _0x46f398(_0x33db31[_0x19a3('0x1d')][_0x19a3('0x1e')]);}logger[_0x19a3('0x1d')](_0x19a3('0x19'),_0x2e15f1,_0x33db31[_0x19a3('0x1d')]['message']);return _0x3c82a6(_0x33db31[_0x19a3('0x1d')][_0x19a3('0x1e')]);}else{logger[_0x19a3('0x18')](_0x19a3('0x19'),_0x2e15f1,'request\x20sent');_0x3c82a6(_0x33db31[_0x19a3('0x1f')][_0x19a3('0x1e')]);}})[_0x19a3('0x20')](function(_0x3f5a93){logger['error'](_0x19a3('0x19'),_0x2e15f1,_0x3f5a93);_0x46f398(_0x3f5a93);});});}function respondWithStatusCode(_0x58e5cb,_0x17ba96){_0x17ba96=_0x17ba96||0xcc;return function(_0x52cef6){if(_0x52cef6){return _0x58e5cb[_0x19a3('0x21')](_0x17ba96);}return _0x58e5cb[_0x19a3('0x22')](_0x17ba96)[_0x19a3('0x23')]();};}function respondWithResult(_0x1ae40b,_0x24374a){_0x24374a=_0x24374a||0xc8;return function(_0x4b1fa5){if(_0x4b1fa5){return _0x1ae40b[_0x19a3('0x22')](_0x24374a)['json'](_0x4b1fa5);}};}function respondWithFilteredResult(_0x330fff,_0x254e36){return function(_0x339fb6){if(_0x339fb6){var _0x2af127=_0x339fb6[_0x19a3('0x24')],_0x51bdf8=_0x254e36[_0x19a3('0x25')],_0x361bcc=_0x254e36[_0x19a3('0x25')]+_0x254e36[_0x19a3('0x26')],_0x31205d;if(_0x361bcc>=_0x2af127){_0x361bcc=_0x2af127;_0x31205d=0xc8;}else{_0x31205d=0xce;}_0x330fff[_0x19a3('0x22')](_0x31205d);return _0x330fff[_0x19a3('0x27')](_0x19a3('0x28'),_0x51bdf8+'-'+_0x361bcc+'/'+_0x2af127)[_0x19a3('0x29')](_0x339fb6);}return null;};}function patchUpdates(_0x9d82f3){return function(_0x5de078){try{jsonpatch[_0x19a3('0x2a')](_0x5de078,_0x9d82f3,!![]);}catch(_0x446dd4){return BPromise['reject'](_0x446dd4);}return _0x5de078[_0x19a3('0x2b')]();};}function saveUpdates(_0x34011d,_0x41c1c9){return function(_0x70dc84){if(_0x70dc84){return _0x70dc84[_0x19a3('0x2c')](_0x34011d)[_0x19a3('0x17')](function(_0x380ac5){return _0x380ac5;});}return null;};}function removeEntity(_0x22917e,_0x59875b){return function(_0x483b39){if(_0x483b39){return _0x483b39[_0x19a3('0x2d')]()[_0x19a3('0x17')](function(){_0x22917e[_0x19a3('0x22')](0xcc)[_0x19a3('0x23')]();});}};}function handleEntityNotFound(_0x4037e5,_0x50df1f){return function(_0x142321){if(!_0x142321){_0x4037e5[_0x19a3('0x21')](0x194);}return _0x142321;};}function handleError(_0x19a540,_0x5d1910){_0x5d1910=_0x5d1910||0x1f4;return function(_0x46ff38){logger['error'](_0x46ff38[_0x19a3('0x2e')]);if(_0x46ff38[_0x19a3('0x2f')]){delete _0x46ff38[_0x19a3('0x2f')];}_0x19a540[_0x19a3('0x22')](_0x5d1910)[_0x19a3('0x30')](_0x46ff38);};}exports['index']=function(_0xf030f5,_0x19601a){var _0x40c7ca={},_0x2941a9={},_0x392be8={'count':0x0,'rows':[]};var _0x4a80e4=db[_0x19a3('0x31')][_0x19a3('0x32')];_0x2941a9[_0x19a3('0x33')]=_[_0x19a3('0x34')](_0x4a80e4);_0x2941a9[_0x19a3('0x35')]=_[_0x19a3('0x34')](_0xf030f5[_0x19a3('0x35')]);_0x2941a9[_0x19a3('0x36')]=_[_0x19a3('0x37')](_0x2941a9['model'],_0x2941a9[_0x19a3('0x35')]);_0x40c7ca[_0x19a3('0x38')]=_[_0x19a3('0x37')](_0x2941a9[_0x19a3('0x33')],qs['fields'](_0xf030f5['query']['fields']));_0x40c7ca[_0x19a3('0x38')]=_0x40c7ca[_0x19a3('0x38')]['length']?_0x40c7ca[_0x19a3('0x38')]:_0x2941a9[_0x19a3('0x33')];if(!_0xf030f5[_0x19a3('0x35')]['hasOwnProperty'](_0x19a3('0x39'))){_0x40c7ca[_0x19a3('0x26')]=qs[_0x19a3('0x26')](_0xf030f5[_0x19a3('0x35')][_0x19a3('0x26')]);_0x40c7ca[_0x19a3('0x25')]=qs[_0x19a3('0x25')](_0xf030f5['query']['offset']);}_0x40c7ca['order']=qs[_0x19a3('0x3a')](_0xf030f5[_0x19a3('0x35')][_0x19a3('0x3a')]);_0x40c7ca['where']=qs[_0x19a3('0x36')](_[_0x19a3('0x3b')](_0xf030f5[_0x19a3('0x35')],_0x2941a9[_0x19a3('0x36')]));if(_0xf030f5[_0x19a3('0x35')][_0x19a3('0x3c')]){_0x40c7ca[_0x19a3('0x3d')]=_[_0x19a3('0x3e')](_0x40c7ca[_0x19a3('0x3d')],{'$or':_[_0x19a3('0x3f')](_0x4a80e4,function(_0x3f385b){if(_0x3f385b[_0x19a3('0x40')][_0x19a3('0x41')]!=='VIRTUAL'){var _0x52089c={};_0x52089c[_0x3f385b['field']]={'$like':'%'+_0xf030f5[_0x19a3('0x35')][_0x19a3('0x3c')]+'%'};return _0x52089c;}})});}_0x40c7ca=_['merge']({},_0x40c7ca,_0xf030f5[_0x19a3('0x42')]);var _0x166c73={'where':_0x40c7ca['where']};return db[_0x19a3('0x31')][_0x19a3('0x24')](_0x166c73)[_0x19a3('0x17')](function(_0x2aff1f){_0x392be8[_0x19a3('0x24')]=_0x2aff1f;if(_0xf030f5[_0x19a3('0x35')][_0x19a3('0x43')]){_0x40c7ca[_0x19a3('0x44')]=[{'all':!![]}];}return db[_0x19a3('0x31')][_0x19a3('0x45')](_0x40c7ca);})[_0x19a3('0x17')](function(_0x1299e7){_0x392be8['rows']=_0x1299e7;return _0x392be8;})[_0x19a3('0x17')](respondWithFilteredResult(_0x19601a,_0x40c7ca))[_0x19a3('0x20')](handleError(_0x19601a,null));};exports[_0x19a3('0x46')]=function(_0x507a1d,_0x11c00f){var _0x2671bd={'raw':![],'where':{'id':_0x507a1d['params']['id']}},_0x45a6da={};_0x45a6da[_0x19a3('0x33')]=_[_0x19a3('0x34')](db[_0x19a3('0x31')][_0x19a3('0x32')]);_0x45a6da['query']=_[_0x19a3('0x34')](_0x507a1d[_0x19a3('0x35')]);_0x45a6da[_0x19a3('0x36')]=_['intersection'](_0x45a6da[_0x19a3('0x33')],_0x45a6da[_0x19a3('0x35')]);_0x2671bd[_0x19a3('0x38')]=_[_0x19a3('0x37')](_0x45a6da[_0x19a3('0x33')],qs['fields'](_0x507a1d[_0x19a3('0x35')][_0x19a3('0x47')]));_0x2671bd['attributes']=_0x2671bd[_0x19a3('0x38')][_0x19a3('0x48')]?_0x2671bd[_0x19a3('0x38')]:_0x45a6da[_0x19a3('0x33')];if(_0x507a1d[_0x19a3('0x35')][_0x19a3('0x43')]){_0x2671bd[_0x19a3('0x44')]=[{'all':!![]}];}_0x2671bd=_['merge']({},_0x2671bd,_0x507a1d[_0x19a3('0x42')]);return db[_0x19a3('0x31')][_0x19a3('0x49')](_0x2671bd)['then'](handleEntityNotFound(_0x11c00f,null))[_0x19a3('0x17')](respondWithResult(_0x11c00f,null))['catch'](handleError(_0x11c00f,null));};exports[_0x19a3('0x4a')]=function(_0xd149fb,_0x5c6ba5){return db[_0x19a3('0x31')][_0x19a3('0x4a')](_0xd149fb[_0x19a3('0x4b')],{})[_0x19a3('0x17')](respondWithResult(_0x5c6ba5,0xc9))[_0x19a3('0x20')](handleError(_0x5c6ba5,null));};exports['update']=function(_0x4cb520,_0x18a8a3){if(_0x4cb520[_0x19a3('0x4b')]['id']){delete _0x4cb520['body']['id'];}return db[_0x19a3('0x31')][_0x19a3('0x49')]({'where':{'id':_0x4cb520[_0x19a3('0x4c')]['id']}})[_0x19a3('0x17')](handleEntityNotFound(_0x18a8a3,null))[_0x19a3('0x17')](saveUpdates(_0x4cb520[_0x19a3('0x4b')],null))[_0x19a3('0x17')](respondWithResult(_0x18a8a3,null))[_0x19a3('0x20')](handleError(_0x18a8a3,null));};exports[_0x19a3('0x2d')]=function(_0x5a5a61,_0x45a837){return db[_0x19a3('0x31')][_0x19a3('0x49')]({'where':{'id':_0x5a5a61[_0x19a3('0x4c')]['id']}})[_0x19a3('0x17')](handleEntityNotFound(_0x45a837,null))['then'](removeEntity(_0x45a837,null))[_0x19a3('0x20')](handleError(_0x45a837,null));};exports[_0x19a3('0x4d')]=function(_0x1e53c0,_0x4377bf,_0x453b94){var _0x42efdd={};var _0x5a2f89={};var _0x36a371;var _0x17b959;return db[_0x19a3('0x31')][_0x19a3('0x4e')]({'where':{'id':_0x1e53c0[_0x19a3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4377bf,null))['then'](function(_0x5a2728){if(_0x5a2728){_0x36a371=_0x5a2728;_0x5a2f89[_0x19a3('0x33')]=_[_0x19a3('0x34')](db[_0x19a3('0x4f')][_0x19a3('0x32')]);_0x5a2f89[_0x19a3('0x35')]=_[_0x19a3('0x34')](_0x1e53c0[_0x19a3('0x35')]);_0x5a2f89[_0x19a3('0x36')]=_[_0x19a3('0x37')](_0x5a2f89[_0x19a3('0x33')],_0x5a2f89[_0x19a3('0x35')]);_0x42efdd[_0x19a3('0x38')]=_['intersection'](_0x5a2f89[_0x19a3('0x33')],qs[_0x19a3('0x47')](_0x1e53c0[_0x19a3('0x35')][_0x19a3('0x47')]));_0x42efdd[_0x19a3('0x38')]=_0x42efdd[_0x19a3('0x38')][_0x19a3('0x48')]?_0x42efdd[_0x19a3('0x38')]:_0x5a2f89[_0x19a3('0x33')];_0x42efdd[_0x19a3('0x50')]=qs[_0x19a3('0x3a')](_0x1e53c0[_0x19a3('0x35')][_0x19a3('0x3a')]);_0x42efdd['where']=qs[_0x19a3('0x36')](_[_0x19a3('0x3b')](_0x1e53c0[_0x19a3('0x35')],_0x5a2f89[_0x19a3('0x36')]));if(_0x1e53c0['query'][_0x19a3('0x3c')]){_0x42efdd[_0x19a3('0x3d')]=_['merge'](_0x42efdd['where'],{'$or':_['map'](_0x42efdd[_0x19a3('0x38')],function(_0x103a46){var _0x58995d={};_0x58995d[_0x103a46]={'$like':'%'+_0x1e53c0[_0x19a3('0x35')][_0x19a3('0x3c')]+'%'};return _0x58995d;})});}_0x42efdd=_[_0x19a3('0x3e')]({},_0x42efdd,_0x1e53c0[_0x19a3('0x42')]);return _0x36a371[_0x19a3('0x4d')](_0x42efdd);}})[_0x19a3('0x17')](function(_0x238ba6){if(_0x238ba6){_0x17b959=_0x238ba6[_0x19a3('0x48')];if(!_0x1e53c0[_0x19a3('0x35')][_0x19a3('0x51')](_0x19a3('0x39'))){_0x42efdd[_0x19a3('0x26')]=qs['limit'](_0x1e53c0[_0x19a3('0x35')][_0x19a3('0x26')]);_0x42efdd[_0x19a3('0x25')]=qs[_0x19a3('0x25')](_0x1e53c0['query'][_0x19a3('0x25')]);}return _0x36a371['getConfigurations'](_0x42efdd);}})[_0x19a3('0x17')](function(_0x1a6483){if(_0x1a6483){return _0x1a6483?{'count':_0x17b959,'rows':_0x1a6483}:null;}})[_0x19a3('0x17')](respondWithResult(_0x4377bf,null))['catch'](handleError(_0x4377bf,null));};exports[_0x19a3('0x52')]=function(_0x22aa87,_0x1ef2dc,_0x8ce7d0){if(_0x22aa87[_0x19a3('0x4b')]['id']){delete _0x22aa87[_0x19a3('0x4b')]['id'];}return db[_0x19a3('0x31')][_0x19a3('0x4e')]({'where':{'id':_0x22aa87[_0x19a3('0x4c')]['id']}})[_0x19a3('0x17')](handleEntityNotFound(_0x1ef2dc,null))[_0x19a3('0x17')](function(_0x1a2e71){if(_0x1a2e71){_0x22aa87[_0x19a3('0x4b')]['AccountId']=_0x1a2e71['id'];_0x22aa87[_0x19a3('0x4b')][_0x19a3('0x53')]=integrations[_0x19a3('0x54')](_0x22aa87[_0x19a3('0x4b')][_0x19a3('0x55')],_0x22aa87[_0x19a3('0x4b')][_0x19a3('0x40')]);_0x22aa87[_0x19a3('0x4b')][_0x19a3('0x56')]=integrations[_0x19a3('0x57')](_0x22aa87[_0x19a3('0x4b')]['channel'],_0x22aa87[_0x19a3('0x4b')][_0x19a3('0x40')]);return db[_0x19a3('0x4f')][_0x19a3('0x4a')](_0x22aa87[_0x19a3('0x4b')],{'include':[{'model':db[_0x19a3('0x58')],'as':'Subjects'},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1ef2dc,null))[_0x19a3('0x20')](handleError(_0x1ef2dc,null));};exports['getFields']=function(_0x1bc81a,_0x1b85db,_0x3bf589){var _0x230897;var _0xd41d57='';var _0x38a498=_0x19a3('0x59');return db['SalesforceAccount'][_0x19a3('0x4e')]({'where':{'id':_0x1bc81a[_0x19a3('0x4c')]['id']},'attributes':['id',_0x19a3('0x5a'),_0x19a3('0x5b'),_0x19a3('0x5c'),'username',_0x19a3('0x5d'),'securityToken']})[_0x19a3('0x17')](handleEntityNotFound(_0x1b85db,null))[_0x19a3('0x17')](function(_0x165243){if(_0x165243){_0xd41d57=_0x165243[_0x19a3('0x5a')];var _0x22dc66=_0xd41d57[_0x19a3('0x5e')](-0x1);if(_0x22dc66==='/'){_0xd41d57=_0xd41d57[_0x19a3('0x5f')](0x0,_0xd41d57[_0x19a3('0x60')](_0x22dc66));}_0x230897=new jsforce[(_0x19a3('0x61'))]({'oauth2':{'loginUrl':_0xd41d57,'clientId':_0x165243[_0x19a3('0x5b')],'clientSecret':_0x165243['clientSecret']}});return _0x230897['login'](_0x165243[_0x19a3('0x62')],_0x165243[_0x19a3('0x5d')][_0x19a3('0x63')](_0x165243[_0x19a3('0x64')]));}})[_0x19a3('0x17')](function(_0x205602){if(_0x205602){if(!_[_0x19a3('0x65')](_0x1bc81a['query'][_0x19a3('0x66')])){_0x38a498=_0x1bc81a[_0x19a3('0x35')][_0x19a3('0x66')];}return _0x230897['sobject'](_0x38a498)[_0x19a3('0x67')]();}})['then'](function(_0xcc6342){var _0x4f7a2f=['CallDisposition','CallDurationInSeconds',_0x19a3('0x68'),_0x19a3('0x69'),'IsArchived',_0x19a3('0x6a'),_0x19a3('0x6b'),_0x19a3('0x6c')];if(!_[_0x19a3('0x65')](_0x1bc81a[_0x19a3('0x35')][_0x19a3('0x66')])&&_0x1bc81a[_0x19a3('0x35')][_0x19a3('0x66')]===_0x19a3('0x6d')){_0x4f7a2f=[_0x19a3('0x6c'),'Origin',_0x19a3('0x6e'),_0x19a3('0x6b'),_0x19a3('0x6a'),'IsEscalated',_0x19a3('0x6f'),'SuppliedCompany'];}if(_0xcc6342){_[_0x19a3('0x70')](_0xcc6342[_0x19a3('0x47')],function(_0x2896f9){return _0x2896f9[_0x19a3('0x71')]===![]&&!_0x4f7a2f[_0x19a3('0x72')](_0x2896f9[_0x19a3('0x2f')]);});return{'count':_0xcc6342[_0x19a3('0x47')]['length'],'rows':_['map'](_0xcc6342[_0x19a3('0x47')],function(_0x16e4e8){return{'id':_0x16e4e8['name'],'name':_0x16e4e8[_0x19a3('0x73')],'custom':_0x16e4e8[_0x19a3('0x71')],'options':_0x16e4e8[_0x19a3('0x74')][_0x19a3('0x48')]>0x0?_[_0x19a3('0x3f')](_0x16e4e8[_0x19a3('0x74')],function(_0x73e274){return{'name':_0x73e274['label'],'value':_0x73e274[_0x19a3('0x75')]};}):_0x16e4e8[_0x19a3('0x40')]==_0x19a3('0x76')?[{'name':_0x19a3('0x77'),'value':_0x19a3('0x78')},{'name':_0x19a3('0x79'),'value':_0x19a3('0x7a')}]:[]};})};}})[_0x19a3('0x17')](respondWithResult(_0x1b85db,null))[_0x19a3('0x20')](function(_0x504b20){var _0x86ae61=_0x1bc81a['query'][_0x19a3('0x7b')]?0x1f4:_0x504b20[_0x19a3('0x7c')]||0x1f4;logger['error'](_0x19a3('0x7d'),_0x19a3('0x7e'),_0x86ae61,JSON['stringify'](_0x504b20));delete _0x504b20[_0x19a3('0x2f')];if(_0x86ae61===0x191){_0x86ae61=0x190;}_0x1b85db[_0x19a3('0x22')](_0x86ae61)['send'](_0x1bc81a[_0x19a3('0x35')][_0x19a3('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x504b20[_0x19a3('0x7c')]}:_0x504b20);});}; \ No newline at end of file +var _0x7a2a=['Origin','Reason','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','length','label','value','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','end','status','json','set','Content-Range','apply','reject','save','update','destroy','name','send','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','SalesforceAccount','findAll','rows','show','params','create','body','find','getConfigurations','SalesforceConfiguration','nolimit','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','password','securityToken','slice','substring','Connection','clientSecret','username','isNil','sobject','CallDisposition','CallDurationInSeconds','IsArchived','Priority','Status','Type','ticketType'];(function(_0x364b32,_0x4dec35){var _0x3f3ea0=function(_0x1911a8){while(--_0x1911a8){_0x364b32['push'](_0x364b32['shift']());}};_0x3f3ea0(++_0x4dec35);}(_0x7a2a,0x19e));var _0xa7a2=function(_0x41fa90,_0x77bb2c){_0x41fa90=_0x41fa90-0x0;var _0x2fb26a=_0x7a2a[_0x41fa90];return _0x2fb26a;};'use strict';var pdf=require(_0xa7a2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa7a2('0x1'));var zipdir=require(_0xa7a2('0x2'));var jsonpatch=require(_0xa7a2('0x3'));var rp=require('request-promise');var moment=require(_0xa7a2('0x4'));var BPromise=require(_0xa7a2('0x5'));var Mustache=require('mustache');var util=require(_0xa7a2('0x6'));var path=require(_0xa7a2('0x7'));var sox=require(_0xa7a2('0x8'));var csv=require(_0xa7a2('0x9'));var ejs=require(_0xa7a2('0xa'));var fs=require('fs');var _=require(_0xa7a2('0xb'));var squel=require(_0xa7a2('0xc'));var crypto=require(_0xa7a2('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa7a2('0x9'));var querystring=require(_0xa7a2('0xe'));var Papa=require(_0xa7a2('0xf'));var Redis=require(_0xa7a2('0x10'));var authService=require(_0xa7a2('0x11'));var qs=require(_0xa7a2('0x12'));var hardwareService=require(_0xa7a2('0x13'));var logger=require(_0xa7a2('0x14'))(_0xa7a2('0x15'));var utils=require(_0xa7a2('0x16'));var config=require(_0xa7a2('0x17'));var db=require(_0xa7a2('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xa7a2('0x19'));var client=jayson[_0xa7a2('0x1a')][_0xa7a2('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x197637,_0x43581e,_0x38f923){if(_0x38f923){var _0x313381=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x313381[_0xa7a2('0x1c')](_0x43581e)){return _0x197637;}else{throw new Error(_0xa7a2('0x1d'));}}else{return _0x197637;}}function respondWithRpcPromise(_0xc80654,_0x54774f,_0x329247,_0x5e4428){return new BPromise(function(_0x349d4f,_0x12d9ed){var _0x3f3354=_0x5e4428||client;return _0x3f3354[_0xa7a2('0x1e')](_0xc80654,_0x329247)[_0xa7a2('0x1f')](function(_0x349d24){logger[_0xa7a2('0x20')](_0xa7a2('0x21'),_0x54774f,_0xa7a2('0x22'));logger[_0xa7a2('0x23')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x54774f,'request\x20sent',JSON[_0xa7a2('0x24')](_0x349d24));if(_0x349d24[_0xa7a2('0x25')]){if(_0x349d24['error'][_0xa7a2('0x26')]===0x1f4){logger[_0xa7a2('0x25')](_0xa7a2('0x21'),_0x54774f,_0x349d24[_0xa7a2('0x25')][_0xa7a2('0x27')]);return _0x12d9ed(_0x349d24[_0xa7a2('0x25')][_0xa7a2('0x27')]);}logger[_0xa7a2('0x25')]('SalesforceAccount,\x20%s,\x20%s',_0x54774f,_0x349d24['error']['message']);return _0x349d4f(_0x349d24[_0xa7a2('0x25')]['message']);}else{logger[_0xa7a2('0x20')](_0xa7a2('0x21'),_0x54774f,_0xa7a2('0x22'));_0x349d4f(_0x349d24['result'][_0xa7a2('0x27')]);}})[_0xa7a2('0x28')](function(_0x21ad43){logger[_0xa7a2('0x25')]('SalesforceAccount,\x20%s,\x20%s',_0x54774f,_0x21ad43);_0x12d9ed(_0x21ad43);});});}function respondWithStatusCode(_0x5536a7,_0x5d5ddb){_0x5d5ddb=_0x5d5ddb||0xcc;return function(_0xae4939){if(_0xae4939){return _0x5536a7[_0xa7a2('0x29')](_0x5d5ddb);}return _0x5536a7['status'](_0x5d5ddb)[_0xa7a2('0x2a')]();};}function respondWithResult(_0x594705,_0x3cfba2){_0x3cfba2=_0x3cfba2||0xc8;return function(_0x5cce07){if(_0x5cce07){return _0x594705[_0xa7a2('0x2b')](_0x3cfba2)[_0xa7a2('0x2c')](_0x5cce07);}};}function respondWithFilteredResult(_0x327383,_0x38bef8){return function(_0x57c487){if(_0x57c487){var _0x3ad581=_0x57c487['count'],_0x12f6d6=_0x38bef8['offset'],_0x3a4147=_0x38bef8['offset']+_0x38bef8['limit'],_0x557f07;if(_0x3a4147>=_0x3ad581){_0x3a4147=_0x3ad581;_0x557f07=0xc8;}else{_0x557f07=0xce;}_0x327383[_0xa7a2('0x2b')](_0x557f07);return _0x327383[_0xa7a2('0x2d')](_0xa7a2('0x2e'),_0x12f6d6+'-'+_0x3a4147+'/'+_0x3ad581)[_0xa7a2('0x2c')](_0x57c487);}return null;};}function patchUpdates(_0x53e08e){return function(_0x26c18b){try{jsonpatch[_0xa7a2('0x2f')](_0x26c18b,_0x53e08e,!![]);}catch(_0x5cab44){return BPromise[_0xa7a2('0x30')](_0x5cab44);}return _0x26c18b[_0xa7a2('0x31')]();};}function saveUpdates(_0x4edc3b,_0x17f025){return function(_0x3c8539){if(_0x3c8539){return _0x3c8539[_0xa7a2('0x32')](_0x4edc3b)[_0xa7a2('0x1f')](function(_0x234917){return _0x234917;});}return null;};}function removeEntity(_0x1875c2,_0x32a150){return function(_0x3d7779){if(_0x3d7779){return _0x3d7779[_0xa7a2('0x33')]()[_0xa7a2('0x1f')](function(){_0x1875c2[_0xa7a2('0x2b')](0xcc)[_0xa7a2('0x2a')]();});}};}function handleEntityNotFound(_0x456f24,_0x4efeff){return function(_0x261219){if(!_0x261219){_0x456f24[_0xa7a2('0x29')](0x194);}return _0x261219;};}function handleError(_0x38b672,_0x45d335){_0x45d335=_0x45d335||0x1f4;return function(_0x189d25){logger[_0xa7a2('0x25')](_0x189d25['stack']);if(_0x189d25[_0xa7a2('0x34')]){delete _0x189d25['name'];}_0x38b672[_0xa7a2('0x2b')](_0x45d335)[_0xa7a2('0x35')](_0x189d25);};}exports['index']=function(_0x427edd,_0x67963){var _0x595d1e={},_0x289fe3={},_0x20bec9={'count':0x0,'rows':[]};var _0x28e6f0=db['SalesforceAccount'][_0xa7a2('0x36')];_0x289fe3[_0xa7a2('0x37')]=_['keys'](_0x28e6f0);_0x289fe3[_0xa7a2('0x38')]=_[_0xa7a2('0x39')](_0x427edd[_0xa7a2('0x38')]);_0x289fe3[_0xa7a2('0x3a')]=_[_0xa7a2('0x3b')](_0x289fe3[_0xa7a2('0x37')],_0x289fe3[_0xa7a2('0x38')]);_0x595d1e[_0xa7a2('0x3c')]=_[_0xa7a2('0x3b')](_0x289fe3[_0xa7a2('0x37')],qs[_0xa7a2('0x3d')](_0x427edd['query']['fields']));_0x595d1e[_0xa7a2('0x3c')]=_0x595d1e[_0xa7a2('0x3c')]['length']?_0x595d1e[_0xa7a2('0x3c')]:_0x289fe3['model'];if(!_0x427edd[_0xa7a2('0x38')][_0xa7a2('0x3e')]('nolimit')){_0x595d1e[_0xa7a2('0x3f')]=qs[_0xa7a2('0x3f')](_0x427edd[_0xa7a2('0x38')][_0xa7a2('0x3f')]);_0x595d1e[_0xa7a2('0x40')]=qs[_0xa7a2('0x40')](_0x427edd['query']['offset']);}_0x595d1e[_0xa7a2('0x41')]=qs[_0xa7a2('0x42')](_0x427edd[_0xa7a2('0x38')]['sort']);_0x595d1e[_0xa7a2('0x43')]=qs[_0xa7a2('0x3a')](_[_0xa7a2('0x44')](_0x427edd['query'],_0x289fe3[_0xa7a2('0x3a')]));if(_0x427edd[_0xa7a2('0x38')][_0xa7a2('0x45')]){_0x595d1e['where']=_[_0xa7a2('0x46')](_0x595d1e[_0xa7a2('0x43')],{'$or':_[_0xa7a2('0x47')](_0x28e6f0,function(_0x3d163c){if(_0x3d163c[_0xa7a2('0x48')][_0xa7a2('0x49')]!==_0xa7a2('0x4a')){var _0x13e82c={};_0x13e82c[_0x3d163c[_0xa7a2('0x4b')]]={'$like':'%'+_0x427edd[_0xa7a2('0x38')][_0xa7a2('0x45')]+'%'};return _0x13e82c;}})});}_0x595d1e=_[_0xa7a2('0x46')]({},_0x595d1e,_0x427edd[_0xa7a2('0x4c')]);var _0x31d812={'where':_0x595d1e[_0xa7a2('0x43')]};return db['SalesforceAccount'][_0xa7a2('0x4d')](_0x31d812)[_0xa7a2('0x1f')](function(_0xf3d934){_0x20bec9[_0xa7a2('0x4d')]=_0xf3d934;if(_0x427edd[_0xa7a2('0x38')][_0xa7a2('0x4e')]){_0x595d1e[_0xa7a2('0x4f')]=[{'all':!![]}];}return db[_0xa7a2('0x50')][_0xa7a2('0x51')](_0x595d1e);})[_0xa7a2('0x1f')](function(_0x180060){_0x20bec9[_0xa7a2('0x52')]=_0x180060;return _0x20bec9;})[_0xa7a2('0x1f')](respondWithFilteredResult(_0x67963,_0x595d1e))[_0xa7a2('0x28')](handleError(_0x67963,null));};exports[_0xa7a2('0x53')]=function(_0x5a2b7d,_0x7bcce2){var _0x2ee991={'raw':![],'where':{'id':_0x5a2b7d[_0xa7a2('0x54')]['id']}},_0x240b60={};_0x240b60[_0xa7a2('0x37')]=_['keys'](db[_0xa7a2('0x50')][_0xa7a2('0x36')]);_0x240b60[_0xa7a2('0x38')]=_[_0xa7a2('0x39')](_0x5a2b7d[_0xa7a2('0x38')]);_0x240b60[_0xa7a2('0x3a')]=_[_0xa7a2('0x3b')](_0x240b60[_0xa7a2('0x37')],_0x240b60[_0xa7a2('0x38')]);_0x2ee991[_0xa7a2('0x3c')]=_['intersection'](_0x240b60[_0xa7a2('0x37')],qs['fields'](_0x5a2b7d['query'][_0xa7a2('0x3d')]));_0x2ee991['attributes']=_0x2ee991[_0xa7a2('0x3c')]['length']?_0x2ee991[_0xa7a2('0x3c')]:_0x240b60['model'];if(_0x5a2b7d['query'][_0xa7a2('0x4e')]){_0x2ee991[_0xa7a2('0x4f')]=[{'all':!![]}];}_0x2ee991=_[_0xa7a2('0x46')]({},_0x2ee991,_0x5a2b7d[_0xa7a2('0x4c')]);return db[_0xa7a2('0x50')]['find'](_0x2ee991)[_0xa7a2('0x1f')](handleEntityNotFound(_0x7bcce2,null))[_0xa7a2('0x1f')](respondWithResult(_0x7bcce2,null))[_0xa7a2('0x28')](handleError(_0x7bcce2,null));};exports[_0xa7a2('0x55')]=function(_0x254e13,_0x32fa9d){return db[_0xa7a2('0x50')][_0xa7a2('0x55')](_0x254e13[_0xa7a2('0x56')],{})['then'](respondWithResult(_0x32fa9d,0xc9))[_0xa7a2('0x28')](handleError(_0x32fa9d,null));};exports[_0xa7a2('0x32')]=function(_0x381e38,_0x27843e){if(_0x381e38[_0xa7a2('0x56')]['id']){delete _0x381e38[_0xa7a2('0x56')]['id'];}return db[_0xa7a2('0x50')][_0xa7a2('0x57')]({'where':{'id':_0x381e38[_0xa7a2('0x54')]['id']}})[_0xa7a2('0x1f')](handleEntityNotFound(_0x27843e,null))[_0xa7a2('0x1f')](saveUpdates(_0x381e38[_0xa7a2('0x56')],null))['then'](respondWithResult(_0x27843e,null))[_0xa7a2('0x28')](handleError(_0x27843e,null));};exports[_0xa7a2('0x33')]=function(_0x5e6b0f,_0x2dbed8){return db[_0xa7a2('0x50')]['find']({'where':{'id':_0x5e6b0f[_0xa7a2('0x54')]['id']}})[_0xa7a2('0x1f')](handleEntityNotFound(_0x2dbed8,null))[_0xa7a2('0x1f')](removeEntity(_0x2dbed8,null))[_0xa7a2('0x28')](handleError(_0x2dbed8,null));};exports[_0xa7a2('0x58')]=function(_0x1232ac,_0x5b128f,_0x25f5e9){var _0x4b8420={};var _0x1786e1={};var _0x51ead3;var _0x1c4932;return db[_0xa7a2('0x50')]['findOne']({'where':{'id':_0x1232ac[_0xa7a2('0x54')]['id']}})[_0xa7a2('0x1f')](handleEntityNotFound(_0x5b128f,null))[_0xa7a2('0x1f')](function(_0x7f8be8){if(_0x7f8be8){_0x51ead3=_0x7f8be8;_0x1786e1[_0xa7a2('0x37')]=_[_0xa7a2('0x39')](db[_0xa7a2('0x59')]['rawAttributes']);_0x1786e1['query']=_['keys'](_0x1232ac[_0xa7a2('0x38')]);_0x1786e1[_0xa7a2('0x3a')]=_[_0xa7a2('0x3b')](_0x1786e1[_0xa7a2('0x37')],_0x1786e1[_0xa7a2('0x38')]);_0x4b8420[_0xa7a2('0x3c')]=_['intersection'](_0x1786e1['model'],qs[_0xa7a2('0x3d')](_0x1232ac[_0xa7a2('0x38')][_0xa7a2('0x3d')]));_0x4b8420[_0xa7a2('0x3c')]=_0x4b8420['attributes']['length']?_0x4b8420[_0xa7a2('0x3c')]:_0x1786e1[_0xa7a2('0x37')];_0x4b8420[_0xa7a2('0x41')]=qs[_0xa7a2('0x42')](_0x1232ac[_0xa7a2('0x38')][_0xa7a2('0x42')]);_0x4b8420[_0xa7a2('0x43')]=qs['filters'](_[_0xa7a2('0x44')](_0x1232ac[_0xa7a2('0x38')],_0x1786e1[_0xa7a2('0x3a')]));if(_0x1232ac[_0xa7a2('0x38')]['filter']){_0x4b8420[_0xa7a2('0x43')]=_[_0xa7a2('0x46')](_0x4b8420[_0xa7a2('0x43')],{'$or':_['map'](_0x4b8420[_0xa7a2('0x3c')],function(_0x14d76b){var _0x939c29={};_0x939c29[_0x14d76b]={'$like':'%'+_0x1232ac[_0xa7a2('0x38')][_0xa7a2('0x45')]+'%'};return _0x939c29;})});}_0x4b8420=_['merge']({},_0x4b8420,_0x1232ac['options']);return _0x51ead3['getConfigurations'](_0x4b8420);}})[_0xa7a2('0x1f')](function(_0x3b041d){if(_0x3b041d){_0x1c4932=_0x3b041d['length'];if(!_0x1232ac['query'][_0xa7a2('0x3e')](_0xa7a2('0x5a'))){_0x4b8420[_0xa7a2('0x3f')]=qs[_0xa7a2('0x3f')](_0x1232ac['query'][_0xa7a2('0x3f')]);_0x4b8420['offset']=qs[_0xa7a2('0x40')](_0x1232ac[_0xa7a2('0x38')][_0xa7a2('0x40')]);}return _0x51ead3['getConfigurations'](_0x4b8420);}})[_0xa7a2('0x1f')](function(_0x3fab25){if(_0x3fab25){return _0x3fab25?{'count':_0x1c4932,'rows':_0x3fab25}:null;}})[_0xa7a2('0x1f')](respondWithResult(_0x5b128f,null))[_0xa7a2('0x28')](handleError(_0x5b128f,null));};exports[_0xa7a2('0x5b')]=function(_0x4a3ed2,_0x41e8a4,_0x163469){if(_0x4a3ed2['body']['id']){delete _0x4a3ed2[_0xa7a2('0x56')]['id'];}return db[_0xa7a2('0x50')][_0xa7a2('0x5c')]({'where':{'id':_0x4a3ed2[_0xa7a2('0x54')]['id']}})[_0xa7a2('0x1f')](handleEntityNotFound(_0x41e8a4,null))[_0xa7a2('0x1f')](function(_0x4f4ce9){if(_0x4f4ce9){_0x4a3ed2[_0xa7a2('0x56')]['AccountId']=_0x4f4ce9['id'];_0x4a3ed2[_0xa7a2('0x56')][_0xa7a2('0x5d')]=integrations[_0xa7a2('0x5e')](_0x4a3ed2[_0xa7a2('0x56')][_0xa7a2('0x5f')],_0x4a3ed2['body'][_0xa7a2('0x48')]);_0x4a3ed2[_0xa7a2('0x56')][_0xa7a2('0x60')]=integrations[_0xa7a2('0x61')](_0x4a3ed2[_0xa7a2('0x56')][_0xa7a2('0x5f')],_0x4a3ed2[_0xa7a2('0x56')][_0xa7a2('0x48')]);return db['SalesforceConfiguration'][_0xa7a2('0x55')](_0x4a3ed2['body'],{'include':[{'model':db[_0xa7a2('0x62')],'as':'Subjects'},{'model':db[_0xa7a2('0x62')],'as':_0xa7a2('0x60')}]});}return null;})[_0xa7a2('0x1f')](respondWithResult(_0x41e8a4,null))[_0xa7a2('0x28')](handleError(_0x41e8a4,null));};exports[_0xa7a2('0x63')]=function(_0x380308,_0x1523d9,_0x3ef0a8){var _0x256ed0;var _0x494f31='';var _0x7203b8='Task';return db[_0xa7a2('0x50')][_0xa7a2('0x5c')]({'where':{'id':_0x380308[_0xa7a2('0x54')]['id']},'attributes':['id',_0xa7a2('0x64'),_0xa7a2('0x65'),'clientSecret','username',_0xa7a2('0x66'),_0xa7a2('0x67')]})[_0xa7a2('0x1f')](handleEntityNotFound(_0x1523d9,null))[_0xa7a2('0x1f')](function(_0x5a6247){if(_0x5a6247){_0x494f31=_0x5a6247[_0xa7a2('0x64')];var _0x29811f=_0x494f31[_0xa7a2('0x68')](-0x1);if(_0x29811f==='/'){_0x494f31=_0x494f31[_0xa7a2('0x69')](0x0,_0x494f31['lastIndexOf'](_0x29811f));}_0x256ed0=new jsforce[(_0xa7a2('0x6a'))]({'oauth2':{'loginUrl':_0x494f31,'clientId':_0x5a6247[_0xa7a2('0x65')],'clientSecret':_0x5a6247[_0xa7a2('0x6b')]}});return _0x256ed0['login'](_0x5a6247[_0xa7a2('0x6c')],_0x5a6247['password']['concat'](_0x5a6247[_0xa7a2('0x67')]));}})['then'](function(_0x18da84){if(_0x18da84){if(!_[_0xa7a2('0x6d')](_0x380308['query']['ticketType'])){_0x7203b8=_0x380308['query']['ticketType'];}return _0x256ed0[_0xa7a2('0x6e')](_0x7203b8)['describe']();}})['then'](function(_0x4424f8){var _0x979d15=[_0xa7a2('0x6f'),_0xa7a2('0x70'),'CallObject','CallType',_0xa7a2('0x71'),_0xa7a2('0x72'),_0xa7a2('0x73'),_0xa7a2('0x74')];if(!_['isNil'](_0x380308[_0xa7a2('0x38')][_0xa7a2('0x75')])&&_0x380308[_0xa7a2('0x38')][_0xa7a2('0x75')]==='Case'){_0x979d15=[_0xa7a2('0x74'),_0xa7a2('0x76'),_0xa7a2('0x77'),_0xa7a2('0x73'),_0xa7a2('0x72'),_0xa7a2('0x78'),_0xa7a2('0x79'),_0xa7a2('0x7a')];}if(_0x4424f8){_[_0xa7a2('0x7b')](_0x4424f8['fields'],function(_0x521dbf){return _0x521dbf[_0xa7a2('0x7c')]===![]&&!_0x979d15[_0xa7a2('0x7d')](_0x521dbf['name']);});return{'count':_0x4424f8[_0xa7a2('0x3d')][_0xa7a2('0x7e')],'rows':_[_0xa7a2('0x47')](_0x4424f8[_0xa7a2('0x3d')],function(_0x83e334){return{'id':_0x83e334[_0xa7a2('0x34')],'name':_0x83e334[_0xa7a2('0x7f')],'custom':_0x83e334[_0xa7a2('0x7c')],'options':_0x83e334['picklistValues'][_0xa7a2('0x7e')]>0x0?_[_0xa7a2('0x47')](_0x83e334['picklistValues'],function(_0x7e6271){return{'name':_0x7e6271[_0xa7a2('0x7f')],'value':_0x7e6271[_0xa7a2('0x80')]};}):_0x83e334[_0xa7a2('0x48')]=='boolean'?[{'name':'True','value':'true'},{'name':'False','value':_0xa7a2('0x81')}]:[]};})};}})[_0xa7a2('0x1f')](respondWithResult(_0x1523d9,null))['catch'](function(_0x5934e5){var _0x49cea5=_0x380308[_0xa7a2('0x38')][_0xa7a2('0x1c')]?0x1f4:_0x5934e5[_0xa7a2('0x82')]||0x1f4;logger[_0xa7a2('0x25')](_0xa7a2('0x83'),_0xa7a2('0x63'),_0x49cea5,JSON[_0xa7a2('0x24')](_0x5934e5));delete _0x5934e5[_0xa7a2('0x34')];if(_0x49cea5===0x191){_0x49cea5=0x190;}_0x1523d9['status'](_0x49cea5)[_0xa7a2('0x35')](_0x380308[_0xa7a2('0x38')][_0xa7a2('0x1c')]?{'message':_0xa7a2('0x84'),'statusCode':_0x5934e5[_0xa7a2('0x82')]}:_0x5934e5);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index e5a0a32..1093596 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.model.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x665f=['path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x3c610b,_0x52ba8d){var _0x54cc4d=function(_0x5b4e9a){while(--_0x5b4e9a){_0x3c610b['push'](_0x3c610b['shift']());}};_0x54cc4d(++_0x52ba8d);}(_0x665f,0x19f));var _0xf665=function(_0x7d7742,_0x1791c7){_0x7d7742=_0x7d7742-0x0;var _0x1fa903=_0x665f[_0x7d7742];return _0x1fa903;};'use strict';var _=require(_0xf665('0x0'));var util=require(_0xf665('0x1'));var logger=require(_0xf665('0x2'))(_0xf665('0x3'));var moment=require(_0xf665('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf665('0x5'));var rimraf=require(_0xf665('0x6'));var config=require(_0xf665('0x7'));var attributes=require(_0xf665('0x8'));var integrations=require(_0xf665('0x9'));module['exports']=function(_0x29f5ce,_0x5beddf){return _0x29f5ce['define'](_0xf665('0xa'),attributes,{'tableName':_0xf665('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae1c=['../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x18f3bf,_0x2f81f0){var _0x88488a=function(_0x501968){while(--_0x501968){_0x18f3bf['push'](_0x18f3bf['shift']());}};_0x88488a(++_0x2f81f0);}(_0xae1c,0x1d2));var _0xcae1=function(_0x2a5698,_0x1f82c8){_0x2a5698=_0x2a5698-0x0;var _0xa039ad=_0xae1c[_0x2a5698];return _0xa039ad;};'use strict';var _=require(_0xcae1('0x0'));var util=require(_0xcae1('0x1'));var logger=require(_0xcae1('0x2'))(_0xcae1('0x3'));var moment=require(_0xcae1('0x4'));var BPromise=require(_0xcae1('0x5'));var rp=require(_0xcae1('0x6'));var fs=require('fs');var path=require(_0xcae1('0x7'));var rimraf=require(_0xcae1('0x8'));var config=require(_0xcae1('0x9'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xcae1('0xa'));module['exports']=function(_0x46a8c1,_0x20ad0d){return _0x46a8c1[_0xcae1('0xb')](_0xcae1('0xc'),attributes,{'tableName':_0xcae1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 306cd91..9efed9c 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4e6=['findAll','options','raw','where','limit','include','map','model','attributes','ShowSalesforceAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount'];(function(_0x460f73,_0x318524){var _0x1a592b=function(_0x48a85a){while(--_0x48a85a){_0x460f73['push'](_0x460f73['shift']());}};_0x1a592b(++_0x318524);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x2984d0,_0x1a7211){_0x2984d0=_0x2984d0-0x0;var _0x2885f2=_0xb4e6[_0x2984d0];return _0x2885f2;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var moment=require(_0x6b4e('0x1'));var BPromise=require(_0x6b4e('0x2'));var rs=require(_0x6b4e('0x3'));var fs=require('fs');var Redis=require(_0x6b4e('0x4'));var db=require(_0x6b4e('0x5'))['db'];var utils=require(_0x6b4e('0x6'));var logger=require(_0x6b4e('0x7'))('rpc');var config=require(_0x6b4e('0x8'));var jayson=require(_0x6b4e('0x9'));var client=jayson[_0x6b4e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd3138f,_0x570346,_0x4f00be){return new BPromise(function(_0x2311d9,_0x48c870){return client['request'](_0xd3138f,_0x4f00be)[_0x6b4e('0xb')](function(_0x2bd576){logger[_0x6b4e('0xc')](_0x6b4e('0xd'),_0x570346,_0x6b4e('0xe'));logger[_0x6b4e('0xf')](_0x6b4e('0x10'),_0x570346,'request\x20sent',JSON[_0x6b4e('0x11')](_0x2bd576));if(_0x2bd576[_0x6b4e('0x12')]){if(_0x2bd576['error'][_0x6b4e('0x13')]===0x1f4){logger[_0x6b4e('0x12')](_0x6b4e('0xd'),_0x570346,_0x2bd576[_0x6b4e('0x12')][_0x6b4e('0x14')]);return _0x48c870(_0x2bd576[_0x6b4e('0x12')][_0x6b4e('0x14')]);}logger['error'](_0x6b4e('0xd'),_0x570346,_0x2bd576[_0x6b4e('0x12')]['message']);return _0x2311d9(_0x2bd576[_0x6b4e('0x12')]['message']);}else{logger[_0x6b4e('0xc')](_0x6b4e('0xd'),_0x570346,_0x6b4e('0xe'));_0x2311d9(_0x2bd576[_0x6b4e('0x15')][_0x6b4e('0x14')]);}})[_0x6b4e('0x16')](function(_0x53a934){logger['error'](_0x6b4e('0xd'),_0x570346,_0x53a934);_0x48c870(_0x53a934);});});}exports[_0x6b4e('0x17')]=function(_0x10d2b1){var _0x39c1b8=this;return new Promise(function(_0x101d0a,_0x1a585d){return db[_0x6b4e('0x18')][_0x6b4e('0x19')]({'raw':_0x10d2b1[_0x6b4e('0x1a')]?_0x10d2b1[_0x6b4e('0x1a')][_0x6b4e('0x1b')]===undefined?!![]:![]:!![],'where':_0x10d2b1['options']?_0x10d2b1[_0x6b4e('0x1a')][_0x6b4e('0x1c')]||null:null,'attributes':_0x10d2b1[_0x6b4e('0x1a')]?_0x10d2b1[_0x6b4e('0x1a')]['attributes']||null:null,'limit':_0x10d2b1[_0x6b4e('0x1a')]?_0x10d2b1['options'][_0x6b4e('0x1d')]||null:null,'include':_0x10d2b1[_0x6b4e('0x1a')]?_0x10d2b1[_0x6b4e('0x1a')][_0x6b4e('0x1e')]?_[_0x6b4e('0x1f')](_0x10d2b1[_0x6b4e('0x1a')][_0x6b4e('0x1e')],function(_0x5c33be){return{'model':db[_0x5c33be[_0x6b4e('0x20')]],'as':_0x5c33be['as'],'attributes':_0x5c33be['attributes'],'include':_0x5c33be[_0x6b4e('0x1e')]?_[_0x6b4e('0x1f')](_0x5c33be[_0x6b4e('0x1e')],function(_0xdba4fe){return{'model':db[_0xdba4fe['model']],'as':_0xdba4fe['as'],'attributes':_0xdba4fe[_0x6b4e('0x21')],'include':_0xdba4fe[_0x6b4e('0x1e')]?_['map'](_0xdba4fe[_0x6b4e('0x1e')],function(_0x381ff0){return{'model':db[_0x381ff0[_0x6b4e('0x20')]],'as':_0x381ff0['as'],'attributes':_0x381ff0[_0x6b4e('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d42be){logger[_0x6b4e('0xc')]('GetSalesforceAccount',_0x10d2b1);logger[_0x6b4e('0xf')](_0x6b4e('0x17'),_0x10d2b1,JSON[_0x6b4e('0x11')](_0x2d42be));_0x101d0a(_0x2d42be);})[_0x6b4e('0x16')](function(_0x4a6c90){logger[_0x6b4e('0x12')](_0x6b4e('0x17'),_0x4a6c90['message'],_0x10d2b1);_0x1a585d(_0x39c1b8[_0x6b4e('0x12')](0x1f4,_0x4a6c90[_0x6b4e('0x14')]));});});};exports[_0x6b4e('0x22')]=function(_0x53c242){var _0x5c2200=this;return new Promise(function(_0x11156e,_0x2e6414){return db[_0x6b4e('0x18')]['find']({'raw':_0x53c242[_0x6b4e('0x1a')]?_0x53c242[_0x6b4e('0x1a')][_0x6b4e('0x1b')]===undefined?!![]:![]:!![],'where':_0x53c242['options']?_0x53c242['options'][_0x6b4e('0x1c')]||null:null,'attributes':_0x53c242['options']?_0x53c242[_0x6b4e('0x1a')][_0x6b4e('0x21')]||null:null,'include':_0x53c242['options']?_0x53c242[_0x6b4e('0x1a')][_0x6b4e('0x1e')]?_[_0x6b4e('0x1f')](_0x53c242[_0x6b4e('0x1a')]['include'],function(_0x4ea04e){return{'model':db[_0x4ea04e[_0x6b4e('0x20')]],'as':_0x4ea04e['as'],'attributes':_0x4ea04e[_0x6b4e('0x21')],'include':_0x4ea04e[_0x6b4e('0x1e')]?_[_0x6b4e('0x1f')](_0x4ea04e[_0x6b4e('0x1e')],function(_0x229484){return{'model':db[_0x229484[_0x6b4e('0x20')]],'as':_0x229484['as'],'attributes':_0x229484[_0x6b4e('0x21')],'include':_0x229484[_0x6b4e('0x1e')]?_[_0x6b4e('0x1f')](_0x229484[_0x6b4e('0x1e')],function(_0x42eca4){return{'model':db[_0x42eca4[_0x6b4e('0x20')]],'as':_0x42eca4['as'],'attributes':_0x42eca4['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b4e('0xb')](function(_0x1926e2){logger[_0x6b4e('0xc')]('ShowSalesforceAccount',_0x53c242);logger[_0x6b4e('0xf')]('ShowSalesforceAccount',_0x53c242,JSON[_0x6b4e('0x11')](_0x1926e2));_0x11156e(_0x1926e2);})[_0x6b4e('0x16')](function(_0x38687f){logger['error']('ShowSalesforceAccount',_0x38687f[_0x6b4e('0x14')],_0x53c242);_0x2e6414(_0x5c2200[_0x6b4e('0x12')](0x1f4,_0x38687f['message']));});});}; \ No newline at end of file +var _0x2f68=['info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','attributes','limit','include','map','model','ShowSalesforceAccount','find','where','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0xa75875,_0x520561){var _0x48df25=function(_0x2aec58){while(--_0x2aec58){_0xa75875['push'](_0xa75875['shift']());}};_0x48df25(++_0x520561);}(_0x2f68,0x9a));var _0x82f6=function(_0x2de7c4,_0x5666a2){_0x2de7c4=_0x2de7c4-0x0;var _0x1fffbd=_0x2f68[_0x2de7c4];return _0x1fffbd;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82f6('0x5'))(_0x82f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x82f6('0x7'));var client=jayson[_0x82f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8089,_0x1bc0be,_0x5660bf){return new BPromise(function(_0x5daa3c,_0x864400){return client[_0x82f6('0x9')](_0x5a8089,_0x5660bf)[_0x82f6('0xa')](function(_0x5ee0e5){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');logger[_0x82f6('0xd')](_0x82f6('0xe'),_0x1bc0be,_0x82f6('0xf'),JSON[_0x82f6('0x10')](_0x5ee0e5));if(_0x5ee0e5[_0x82f6('0x11')]){if(_0x5ee0e5[_0x82f6('0x11')]['code']===0x1f4){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5['error'][_0x82f6('0x12')]);return _0x864400(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);return _0x5daa3c(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}else{logger['info'](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');_0x5daa3c(_0x5ee0e5[_0x82f6('0x13')][_0x82f6('0x12')]);}})[_0x82f6('0x14')](function(_0x1033d3){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x1033d3);_0x864400(_0x1033d3);});});}exports[_0x82f6('0x15')]=function(_0xcbc95f){var _0x4072f0=this;return new Promise(function(_0x2bfd57,_0x1c79f9){return db[_0x82f6('0x16')][_0x82f6('0x17')]({'raw':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')]['where']||null:null,'attributes':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')][_0x82f6('0x19')]||null:null,'limit':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f['options'][_0x82f6('0x1a')]||null:null,'include':_0xcbc95f['options']?_0xcbc95f[_0x82f6('0x18')][_0x82f6('0x1b')]?_['map'](_0xcbc95f['options'][_0x82f6('0x1b')],function(_0x1d96d5){return{'model':db[_0x1d96d5['model']],'as':_0x1d96d5['as'],'attributes':_0x1d96d5['attributes'],'include':_0x1d96d5[_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x1d96d5['include'],function(_0xfd8b68){return{'model':db[_0xfd8b68[_0x82f6('0x1d')]],'as':_0xfd8b68['as'],'attributes':_0xfd8b68['attributes'],'include':_0xfd8b68['include']?_[_0x82f6('0x1c')](_0xfd8b68['include'],function(_0x469b6b){return{'model':db[_0x469b6b[_0x82f6('0x1d')]],'as':_0x469b6b['as'],'attributes':_0x469b6b['attributes']};}):[]};}):[]};}):[]:[]})[_0x82f6('0xa')](function(_0x15c9b7){logger[_0x82f6('0xb')](_0x82f6('0x15'),_0xcbc95f);logger['debug'](_0x82f6('0x15'),_0xcbc95f,JSON[_0x82f6('0x10')](_0x15c9b7));_0x2bfd57(_0x15c9b7);})[_0x82f6('0x14')](function(_0x400137){logger[_0x82f6('0x11')](_0x82f6('0x15'),_0x400137[_0x82f6('0x12')],_0xcbc95f);_0x1c79f9(_0x4072f0[_0x82f6('0x11')](0x1f4,_0x400137[_0x82f6('0x12')]));});});};exports[_0x82f6('0x1e')]=function(_0x3c9419){var _0x20d1c5=this;return new Promise(function(_0x6ce179,_0x91117b){return db['SalesforceAccount'][_0x82f6('0x1f')]({'raw':_0x3c9419[_0x82f6('0x18')]?_0x3c9419[_0x82f6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3c9419[_0x82f6('0x18')]?_0x3c9419[_0x82f6('0x18')][_0x82f6('0x20')]||null:null,'attributes':_0x3c9419[_0x82f6('0x18')]?_0x3c9419[_0x82f6('0x18')][_0x82f6('0x19')]||null:null,'include':_0x3c9419[_0x82f6('0x18')]?_0x3c9419[_0x82f6('0x18')][_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x3c9419[_0x82f6('0x18')][_0x82f6('0x1b')],function(_0x1e028a){return{'model':db[_0x1e028a[_0x82f6('0x1d')]],'as':_0x1e028a['as'],'attributes':_0x1e028a['attributes'],'include':_0x1e028a[_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x1e028a[_0x82f6('0x1b')],function(_0x276451){return{'model':db[_0x276451[_0x82f6('0x1d')]],'as':_0x276451['as'],'attributes':_0x276451[_0x82f6('0x19')],'include':_0x276451[_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x276451[_0x82f6('0x1b')],function(_0x30c6f8){return{'model':db[_0x30c6f8[_0x82f6('0x1d')]],'as':_0x30c6f8['as'],'attributes':_0x30c6f8[_0x82f6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x82f6('0xa')](function(_0x34665a){logger['info'](_0x82f6('0x1e'),_0x3c9419);logger['debug']('ShowSalesforceAccount',_0x3c9419,JSON[_0x82f6('0x10')](_0x34665a));_0x6ce179(_0x34665a);})[_0x82f6('0x14')](function(_0x5e8828){logger[_0x82f6('0x11')](_0x82f6('0x1e'),_0x5e8828[_0x82f6('0x12')],_0x3c9419);_0x91117b(_0x20d1c5['error'](0x1f4,_0x5e8828[_0x82f6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 3e0bfed..da03d77 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09b9=['update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id'];(function(_0x1b72c7,_0x42aeeb){var _0x279fd5=function(_0x531727){while(--_0x531727){_0x1b72c7['push'](_0x1b72c7['shift']());}};_0x279fd5(++_0x42aeeb);}(_0x09b9,0x7b));var _0x909b=function(_0x1c33f9,_0x290e7e){_0x1c33f9=_0x1c33f9-0x0;var _0x58f360=_0x09b9[_0x1c33f9];return _0x58f360;};'use strict';var multer=require(_0x909b('0x0'));var util=require(_0x909b('0x1'));var path=require(_0x909b('0x2'));var timeout=require(_0x909b('0x3'));var express=require('express');var router=express[_0x909b('0x4')]();var auth=require(_0x909b('0x5'));var interaction=require(_0x909b('0x6'));var config=require('../../config/environment');var controller=require(_0x909b('0x7'));router[_0x909b('0x8')]('/',auth[_0x909b('0x9')](),controller[_0x909b('0xa')]);router[_0x909b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x909b('0xb')]);router[_0x909b('0x8')](_0x909b('0xc'),auth[_0x909b('0x9')](),controller['getFields']);router[_0x909b('0x8')](_0x909b('0xd'),auth[_0x909b('0x9')](),controller[_0x909b('0xe')]);router[_0x909b('0x8')](_0x909b('0xf'),auth[_0x909b('0x9')](),controller[_0x909b('0x10')]);router[_0x909b('0x11')]('/',auth[_0x909b('0x9')](),controller[_0x909b('0x12')]);router[_0x909b('0x13')](_0x909b('0x14'),auth[_0x909b('0x9')](),controller[_0x909b('0x15')]);router[_0x909b('0x16')](_0x909b('0x14'),auth[_0x909b('0x9')](),controller['destroy']);module[_0x909b('0x17')]=router; \ No newline at end of file +var _0x35fc=['./intSalesforceConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x48f4c5,_0x56e4c3){var _0x40ab65=function(_0x27426b){while(--_0x27426b){_0x48f4c5['push'](_0x48f4c5['shift']());}};_0x40ab65(++_0x56e4c3);}(_0x35fc,0x66));var _0xc35f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x35fc[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xc35f('0x0'));var util=require(_0xc35f('0x1'));var path=require(_0xc35f('0x2'));var timeout=require('connect-timeout');var express=require(_0xc35f('0x3'));var router=express[_0xc35f('0x4')]();var auth=require(_0xc35f('0x5'));var interaction=require(_0xc35f('0x6'));var config=require(_0xc35f('0x7'));var controller=require(_0xc35f('0x8'));router[_0xc35f('0x9')]('/',auth[_0xc35f('0xa')](),controller['index']);router['get'](_0xc35f('0xb'),auth['isAuthenticated'](),controller[_0xc35f('0xc')]);router[_0xc35f('0x9')](_0xc35f('0xd'),auth[_0xc35f('0xa')](),controller['getFields']);router['get'](_0xc35f('0xe'),auth[_0xc35f('0xa')](),controller['getSubjects']);router[_0xc35f('0x9')](_0xc35f('0xf'),auth['isAuthenticated'](),controller[_0xc35f('0x10')]);router[_0xc35f('0x11')]('/',auth['isAuthenticated'](),controller[_0xc35f('0x12')]);router['put'](_0xc35f('0xb'),auth[_0xc35f('0xa')](),controller[_0xc35f('0x13')]);router['delete']('/:id',auth[_0xc35f('0xa')](),controller[_0xc35f('0x14')]);module[_0xc35f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index abd9f1c..9bd400a 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae71=['sequelize','exports','STRING','ENUM','Task','contact_lead','contact','lead','nothing'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0xae71,0xcf));var _0x1ae7=function(_0x12e747,_0x55ddca){_0x12e747=_0x12e747-0x0;var _0x39d4f2=_0xae71[_0x12e747];return _0x39d4f2;};'use strict';var Sequelize=require(_0x1ae7('0x0'));module[_0x1ae7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1ae7('0x2')]},'ticketType':{'type':Sequelize[_0x1ae7('0x3')](_0x1ae7('0x4'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x1ae7('0x3')](_0x1ae7('0x5'),_0x1ae7('0x6'),_0x1ae7('0x7')),'defaultValue':_0x1ae7('0x5')},'moduleCreate':{'type':Sequelize['ENUM'](_0x1ae7('0x8'),_0x1ae7('0x6'),'lead'),'defaultValue':_0x1ae7('0x7')}}; \ No newline at end of file +var _0x00a6=['contact_lead','contact','lead','nothing','sequelize','exports','STRING','ENUM','Task','Case'];(function(_0x20ffe0,_0x4176dd){var _0x26e338=function(_0x3b247e){while(--_0x3b247e){_0x20ffe0['push'](_0x20ffe0['shift']());}};_0x26e338(++_0x4176dd);}(_0x00a6,0x194));var _0x600a=function(_0x526a30,_0x563de0){_0x526a30=_0x526a30-0x0;var _0x3761e3=_0x00a6[_0x526a30];return _0x3761e3;};'use strict';var Sequelize=require(_0x600a('0x0'));module[_0x600a('0x1')]={'name':{'type':Sequelize[_0x600a('0x2')]},'description':{'type':Sequelize[_0x600a('0x2')]},'ticketType':{'type':Sequelize[_0x600a('0x3')](_0x600a('0x4'),_0x600a('0x5')),'defaultValue':_0x600a('0x4')},'moduleSearch':{'type':Sequelize[_0x600a('0x3')](_0x600a('0x6'),_0x600a('0x7'),_0x600a('0x8')),'defaultValue':_0x600a('0x6')},'moduleCreate':{'type':Sequelize[_0x600a('0x3')](_0x600a('0x9'),'contact',_0x600a('0x8')),'defaultValue':_0x600a('0x8')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index c05ed22..5486476 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6d6=['SalesforceField','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','pick','filter','where','map','type','key','field','merge','options','SalesforceConfiguration','includeAll','include','rows','show','create','body','find','params','destroy','getFields','findOne'];(function(_0x233cb1,_0x8ca9a2){var _0x29ee7e=function(_0x20e277){while(--_0x20e277){_0x233cb1['push'](_0x233cb1['shift']());}};_0x29ee7e(++_0x8ca9a2);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x2f9e99,_0xac118b){_0x2f9e99=_0x2f9e99-0x0;var _0x4682d1=_0xd6d6[_0x2f9e99];return _0x4682d1;};'use strict';var pdf=require(_0x6d6d('0x0'));var emlformat=require(_0x6d6d('0x1'));var rimraf=require(_0x6d6d('0x2'));var zipdir=require(_0x6d6d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d6d('0x4'));var moment=require(_0x6d6d('0x5'));var BPromise=require(_0x6d6d('0x6'));var Mustache=require(_0x6d6d('0x7'));var util=require(_0x6d6d('0x8'));var path=require(_0x6d6d('0x9'));var sox=require(_0x6d6d('0xa'));var csv=require('to-csv');var ejs=require(_0x6d6d('0xb'));var fs=require('fs');var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x12'));var authService=require(_0x6d6d('0x13'));var qs=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require(_0x6d6d('0x16'))('api');var utils=require(_0x6d6d('0x17'));var config=require(_0x6d6d('0x18'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x6d6d('0x19')][_0x6d6d('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xe61c36,_0x3f8542,_0x2b74ed){if(_0x2b74ed){var _0x41fbdf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41fbdf[_0x6d6d('0x1b')](_0x3f8542)){return _0xe61c36;}else{throw new Error(_0x6d6d('0x1c'));}}else{return _0xe61c36;}}function respondWithRpcPromise(_0x5f4154,_0xd09ea7,_0x3dd4b3,_0x1f2aac){return new BPromise(function(_0xa3b05d,_0x29cbd8){var _0x5d80c0=_0x1f2aac||client;return _0x5d80c0[_0x6d6d('0x1d')](_0x5f4154,_0x3dd4b3)['then'](function(_0x27830d){logger[_0x6d6d('0x1e')](_0x6d6d('0x1f'),_0xd09ea7,'request\x20sent');logger['debug'](_0x6d6d('0x20'),_0xd09ea7,_0x6d6d('0x21'),JSON[_0x6d6d('0x22')](_0x27830d));if(_0x27830d[_0x6d6d('0x23')]){if(_0x27830d['error']['code']===0x1f4){logger[_0x6d6d('0x23')]('SalesforceConfiguration,\x20%s,\x20%s',_0xd09ea7,_0x27830d[_0x6d6d('0x23')][_0x6d6d('0x24')]);return _0x29cbd8(_0x27830d[_0x6d6d('0x23')][_0x6d6d('0x24')]);}logger[_0x6d6d('0x23')](_0x6d6d('0x1f'),_0xd09ea7,_0x27830d[_0x6d6d('0x23')][_0x6d6d('0x24')]);return _0xa3b05d(_0x27830d[_0x6d6d('0x23')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x1e')](_0x6d6d('0x1f'),_0xd09ea7,_0x6d6d('0x21'));_0xa3b05d(_0x27830d[_0x6d6d('0x25')][_0x6d6d('0x24')]);}})[_0x6d6d('0x26')](function(_0xced622){logger['error'](_0x6d6d('0x1f'),_0xd09ea7,_0xced622);_0x29cbd8(_0xced622);});});}function respondWithStatusCode(_0x2dcb9c,_0x99f7d6){_0x99f7d6=_0x99f7d6||0xcc;return function(_0x97ec9e){if(_0x97ec9e){return _0x2dcb9c[_0x6d6d('0x27')](_0x99f7d6);}return _0x2dcb9c[_0x6d6d('0x28')](_0x99f7d6)['end']();};}function respondWithResult(_0x2851dd,_0x2b5e31){_0x2b5e31=_0x2b5e31||0xc8;return function(_0x235451){if(_0x235451){return _0x2851dd[_0x6d6d('0x28')](_0x2b5e31)[_0x6d6d('0x29')](_0x235451);}};}function respondWithFilteredResult(_0x408f98,_0x3641fc){return function(_0x4a57a1){if(_0x4a57a1){var _0x298408=_0x4a57a1[_0x6d6d('0x2a')],_0x9595d8=_0x3641fc[_0x6d6d('0x2b')],_0x51bd68=_0x3641fc[_0x6d6d('0x2b')]+_0x3641fc['limit'],_0x553645;if(_0x51bd68>=_0x298408){_0x51bd68=_0x298408;_0x553645=0xc8;}else{_0x553645=0xce;}_0x408f98[_0x6d6d('0x28')](_0x553645);return _0x408f98[_0x6d6d('0x2c')](_0x6d6d('0x2d'),_0x9595d8+'-'+_0x51bd68+'/'+_0x298408)[_0x6d6d('0x29')](_0x4a57a1);}return null;};}function patchUpdates(_0x64d1f7){return function(_0x428c17){try{jsonpatch[_0x6d6d('0x2e')](_0x428c17,_0x64d1f7,!![]);}catch(_0x359cfd){return BPromise[_0x6d6d('0x2f')](_0x359cfd);}return _0x428c17[_0x6d6d('0x30')]();};}function saveUpdates(_0x5a67ca,_0x1f9469){return function(_0x4f1fc5){if(_0x4f1fc5){return _0x4f1fc5[_0x6d6d('0x31')](_0x5a67ca)[_0x6d6d('0x32')](function(_0xf527da){return _0xf527da;});}return null;};}function removeEntity(_0x2814ed,_0x5c6248){return function(_0x182441){if(_0x182441){return _0x182441['destroy']()[_0x6d6d('0x32')](function(){_0x2814ed[_0x6d6d('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37993f,_0x278116){return function(_0x37ac94){if(!_0x37ac94){_0x37993f[_0x6d6d('0x27')](0x194);}return _0x37ac94;};}function handleError(_0x34c390,_0x486183){_0x486183=_0x486183||0x1f4;return function(_0x8dd021){logger[_0x6d6d('0x23')](_0x8dd021[_0x6d6d('0x33')]);if(_0x8dd021[_0x6d6d('0x34')]){delete _0x8dd021[_0x6d6d('0x34')];}_0x34c390[_0x6d6d('0x28')](_0x486183)[_0x6d6d('0x35')](_0x8dd021);};}exports[_0x6d6d('0x36')]=function(_0x5a2397,_0x1335ef){var _0xf98bfa={},_0x3e2415={},_0x5e4f38={'count':0x0,'rows':[]};var _0x4acf0f=db['SalesforceConfiguration'][_0x6d6d('0x37')];_0x3e2415[_0x6d6d('0x38')]=_[_0x6d6d('0x39')](_0x4acf0f);_0x3e2415['query']=_[_0x6d6d('0x39')](_0x5a2397[_0x6d6d('0x3a')]);_0x3e2415[_0x6d6d('0x3b')]=_[_0x6d6d('0x3c')](_0x3e2415['model'],_0x3e2415['query']);_0xf98bfa['attributes']=_[_0x6d6d('0x3c')](_0x3e2415[_0x6d6d('0x38')],qs[_0x6d6d('0x3d')](_0x5a2397[_0x6d6d('0x3a')]['fields']));_0xf98bfa[_0x6d6d('0x3e')]=_0xf98bfa[_0x6d6d('0x3e')][_0x6d6d('0x3f')]?_0xf98bfa[_0x6d6d('0x3e')]:_0x3e2415[_0x6d6d('0x38')];if(!_0x5a2397[_0x6d6d('0x3a')]['hasOwnProperty'](_0x6d6d('0x40'))){_0xf98bfa[_0x6d6d('0x41')]=qs[_0x6d6d('0x41')](_0x5a2397[_0x6d6d('0x3a')][_0x6d6d('0x41')]);_0xf98bfa[_0x6d6d('0x2b')]=qs[_0x6d6d('0x2b')](_0x5a2397['query'][_0x6d6d('0x2b')]);}_0xf98bfa[_0x6d6d('0x42')]=qs[_0x6d6d('0x43')](_0x5a2397[_0x6d6d('0x3a')][_0x6d6d('0x43')]);_0xf98bfa['where']=qs[_0x6d6d('0x3b')](_[_0x6d6d('0x44')](_0x5a2397['query'],_0x3e2415[_0x6d6d('0x3b')]));if(_0x5a2397['query'][_0x6d6d('0x45')]){_0xf98bfa[_0x6d6d('0x46')]=_['merge'](_0xf98bfa[_0x6d6d('0x46')],{'$or':_[_0x6d6d('0x47')](_0x4acf0f,function(_0x252cbe){if(_0x252cbe[_0x6d6d('0x48')][_0x6d6d('0x49')]!=='VIRTUAL'){var _0x4ea238={};_0x4ea238[_0x252cbe[_0x6d6d('0x4a')]]={'$like':'%'+_0x5a2397['query']['filter']+'%'};return _0x4ea238;}})});}_0xf98bfa=_[_0x6d6d('0x4b')]({},_0xf98bfa,_0x5a2397[_0x6d6d('0x4c')]);var _0x2f236a={'where':_0xf98bfa['where']};return db[_0x6d6d('0x4d')]['count'](_0x2f236a)[_0x6d6d('0x32')](function(_0x26fc7c){_0x5e4f38[_0x6d6d('0x2a')]=_0x26fc7c;if(_0x5a2397[_0x6d6d('0x3a')][_0x6d6d('0x4e')]){_0xf98bfa[_0x6d6d('0x4f')]=[{'all':!![]}];}return db[_0x6d6d('0x4d')]['findAll'](_0xf98bfa);})[_0x6d6d('0x32')](function(_0x150479){_0x5e4f38[_0x6d6d('0x50')]=_0x150479;return _0x5e4f38;})[_0x6d6d('0x32')](respondWithFilteredResult(_0x1335ef,_0xf98bfa))[_0x6d6d('0x26')](handleError(_0x1335ef,null));};exports[_0x6d6d('0x51')]=function(_0x429a27,_0x1d2b20){var _0x24cec2={'raw':![],'where':{'id':_0x429a27['params']['id']}},_0x5e4c04={};_0x5e4c04[_0x6d6d('0x38')]=_[_0x6d6d('0x39')](db[_0x6d6d('0x4d')][_0x6d6d('0x37')]);_0x5e4c04[_0x6d6d('0x3a')]=_['keys'](_0x429a27[_0x6d6d('0x3a')]);_0x5e4c04[_0x6d6d('0x3b')]=_[_0x6d6d('0x3c')](_0x5e4c04[_0x6d6d('0x38')],_0x5e4c04[_0x6d6d('0x3a')]);_0x24cec2[_0x6d6d('0x3e')]=_[_0x6d6d('0x3c')](_0x5e4c04[_0x6d6d('0x38')],qs[_0x6d6d('0x3d')](_0x429a27[_0x6d6d('0x3a')][_0x6d6d('0x3d')]));_0x24cec2[_0x6d6d('0x3e')]=_0x24cec2['attributes'][_0x6d6d('0x3f')]?_0x24cec2[_0x6d6d('0x3e')]:_0x5e4c04[_0x6d6d('0x38')];if(_0x429a27[_0x6d6d('0x3a')][_0x6d6d('0x4e')]){_0x24cec2['include']=[{'all':!![]}];}_0x24cec2=_[_0x6d6d('0x4b')]({},_0x24cec2,_0x429a27[_0x6d6d('0x4c')]);return db[_0x6d6d('0x4d')]['find'](_0x24cec2)['then'](handleEntityNotFound(_0x1d2b20,null))[_0x6d6d('0x32')](respondWithResult(_0x1d2b20,null))['catch'](handleError(_0x1d2b20,null));};exports[_0x6d6d('0x52')]=function(_0x995fe2,_0x32aaae){return db[_0x6d6d('0x4d')][_0x6d6d('0x52')](_0x995fe2[_0x6d6d('0x53')],{})[_0x6d6d('0x32')](respondWithResult(_0x32aaae,0xc9))[_0x6d6d('0x26')](handleError(_0x32aaae,null));};exports[_0x6d6d('0x31')]=function(_0x24c9a3,_0x583d1a){if(_0x24c9a3[_0x6d6d('0x53')]['id']){delete _0x24c9a3[_0x6d6d('0x53')]['id'];}return db[_0x6d6d('0x4d')][_0x6d6d('0x54')]({'where':{'id':_0x24c9a3[_0x6d6d('0x55')]['id']}})[_0x6d6d('0x32')](handleEntityNotFound(_0x583d1a,null))[_0x6d6d('0x32')](saveUpdates(_0x24c9a3['body'],null))['then'](respondWithResult(_0x583d1a,null))[_0x6d6d('0x26')](handleError(_0x583d1a,null));};exports[_0x6d6d('0x56')]=function(_0x5cc644,_0x3e98a0){return db[_0x6d6d('0x4d')][_0x6d6d('0x54')]({'where':{'id':_0x5cc644[_0x6d6d('0x55')]['id']}})[_0x6d6d('0x32')](handleEntityNotFound(_0x3e98a0,null))[_0x6d6d('0x32')](removeEntity(_0x3e98a0,null))[_0x6d6d('0x26')](handleError(_0x3e98a0,null));};exports[_0x6d6d('0x57')]=function(_0x2abd8c,_0x36f37a,_0x444f6a){var _0x36548e={};var _0x213a00={};var _0x2671ec;var _0x3065ea;return db['SalesforceConfiguration'][_0x6d6d('0x58')]({'where':{'id':_0x2abd8c[_0x6d6d('0x55')]['id']}})['then'](handleEntityNotFound(_0x36f37a,null))[_0x6d6d('0x32')](function(_0x466778){if(_0x466778){_0x2671ec=_0x466778;_0x213a00[_0x6d6d('0x38')]=_[_0x6d6d('0x39')](db[_0x6d6d('0x59')][_0x6d6d('0x37')]);_0x213a00[_0x6d6d('0x3a')]=_[_0x6d6d('0x39')](_0x2abd8c[_0x6d6d('0x3a')]);_0x213a00['filters']=_['intersection'](_0x213a00[_0x6d6d('0x38')],_0x213a00[_0x6d6d('0x3a')]);_0x36548e[_0x6d6d('0x3e')]=_['intersection'](_0x213a00['model'],qs[_0x6d6d('0x3d')](_0x2abd8c['query'][_0x6d6d('0x3d')]));_0x36548e['attributes']=_0x36548e[_0x6d6d('0x3e')][_0x6d6d('0x3f')]?_0x36548e[_0x6d6d('0x3e')]:_0x213a00[_0x6d6d('0x38')];_0x36548e[_0x6d6d('0x42')]=qs[_0x6d6d('0x43')](_0x2abd8c['query'][_0x6d6d('0x43')]);_0x36548e['where']=qs[_0x6d6d('0x3b')](_['pick'](_0x2abd8c[_0x6d6d('0x3a')],_0x213a00[_0x6d6d('0x3b')]));if(_0x2abd8c[_0x6d6d('0x3a')][_0x6d6d('0x45')]){_0x36548e[_0x6d6d('0x46')]=_[_0x6d6d('0x4b')](_0x36548e[_0x6d6d('0x46')],{'$or':_['map'](_0x36548e['attributes'],function(_0x466a15){var _0x582380={};_0x582380[_0x466a15]={'$like':'%'+_0x2abd8c[_0x6d6d('0x3a')]['filter']+'%'};return _0x582380;})});}_0x36548e=_[_0x6d6d('0x4b')]({},_0x36548e,_0x2abd8c[_0x6d6d('0x4c')]);return _0x2671ec[_0x6d6d('0x57')](_0x36548e);}})[_0x6d6d('0x32')](function(_0x423198){if(_0x423198){_0x3065ea=_0x423198[_0x6d6d('0x3f')];if(!_0x2abd8c['query'][_0x6d6d('0x5a')](_0x6d6d('0x40'))){_0x36548e[_0x6d6d('0x41')]=qs[_0x6d6d('0x41')](_0x2abd8c[_0x6d6d('0x3a')][_0x6d6d('0x41')]);_0x36548e[_0x6d6d('0x2b')]=qs['offset'](_0x2abd8c[_0x6d6d('0x3a')][_0x6d6d('0x2b')]);}return _0x2671ec[_0x6d6d('0x57')](_0x36548e);}})[_0x6d6d('0x32')](function(_0x1aa25d){if(_0x1aa25d){return _0x1aa25d?{'count':_0x3065ea,'rows':_0x1aa25d}:null;}})[_0x6d6d('0x32')](respondWithResult(_0x36f37a,null))[_0x6d6d('0x26')](handleError(_0x36f37a,null));};exports[_0x6d6d('0x5b')]=function(_0x56feda,_0x32e3bb,_0x1efc55){var _0x4ea594={};var _0x488b2f={};var _0x3e0e8c;var _0x5779b4;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x56feda[_0x6d6d('0x55')]['id']}})[_0x6d6d('0x32')](handleEntityNotFound(_0x32e3bb,null))[_0x6d6d('0x32')](function(_0x9f2647){if(_0x9f2647){_0x3e0e8c=_0x9f2647;_0x488b2f[_0x6d6d('0x38')]=_[_0x6d6d('0x39')](db['SalesforceField']['rawAttributes']);_0x488b2f[_0x6d6d('0x3a')]=_['keys'](_0x56feda['query']);_0x488b2f['filters']=_[_0x6d6d('0x3c')](_0x488b2f['model'],_0x488b2f[_0x6d6d('0x3a')]);_0x4ea594['attributes']=_[_0x6d6d('0x3c')](_0x488b2f[_0x6d6d('0x38')],qs['fields'](_0x56feda['query'][_0x6d6d('0x3d')]));_0x4ea594[_0x6d6d('0x3e')]=_0x4ea594[_0x6d6d('0x3e')][_0x6d6d('0x3f')]?_0x4ea594['attributes']:_0x488b2f[_0x6d6d('0x38')];_0x4ea594[_0x6d6d('0x42')]=qs[_0x6d6d('0x43')](_0x56feda[_0x6d6d('0x3a')]['sort']);_0x4ea594[_0x6d6d('0x46')]=qs['filters'](_['pick'](_0x56feda['query'],_0x488b2f[_0x6d6d('0x3b')]));if(_0x56feda['query'][_0x6d6d('0x45')]){_0x4ea594[_0x6d6d('0x46')]=_[_0x6d6d('0x4b')](_0x4ea594['where'],{'$or':_['map'](_0x4ea594[_0x6d6d('0x3e')],function(_0xcba8dd){var _0x542386={};_0x542386[_0xcba8dd]={'$like':'%'+_0x56feda['query'][_0x6d6d('0x45')]+'%'};return _0x542386;})});}_0x4ea594=_[_0x6d6d('0x4b')]({},_0x4ea594,_0x56feda[_0x6d6d('0x4c')]);return _0x3e0e8c[_0x6d6d('0x5b')](_0x4ea594);}})[_0x6d6d('0x32')](function(_0x1e03a4){if(_0x1e03a4){_0x5779b4=_0x1e03a4[_0x6d6d('0x3f')];if(!_0x56feda['query']['hasOwnProperty']('nolimit')){_0x4ea594['limit']=qs['limit'](_0x56feda['query'][_0x6d6d('0x41')]);_0x4ea594[_0x6d6d('0x2b')]=qs[_0x6d6d('0x2b')](_0x56feda[_0x6d6d('0x3a')]['offset']);}return _0x3e0e8c['getSubjects'](_0x4ea594);}})['then'](function(_0x39b34e){if(_0x39b34e){return _0x39b34e?{'count':_0x5779b4,'rows':_0x39b34e}:null;}})[_0x6d6d('0x32')](respondWithResult(_0x32e3bb,null))[_0x6d6d('0x26')](handleError(_0x32e3bb,null));};exports[_0x6d6d('0x5c')]=function(_0x58157a,_0x494fbc,_0x217a69){var _0x1e1c4e={};var _0x478ed4={};var _0x32ab0f;var _0x2efab5;return db[_0x6d6d('0x4d')][_0x6d6d('0x58')]({'where':{'id':_0x58157a[_0x6d6d('0x55')]['id']}})['then'](handleEntityNotFound(_0x494fbc,null))[_0x6d6d('0x32')](function(_0x50eea6){if(_0x50eea6){_0x32ab0f=_0x50eea6;_0x478ed4[_0x6d6d('0x38')]=_['keys'](db[_0x6d6d('0x59')]['rawAttributes']);_0x478ed4[_0x6d6d('0x3a')]=_[_0x6d6d('0x39')](_0x58157a[_0x6d6d('0x3a')]);_0x478ed4[_0x6d6d('0x3b')]=_[_0x6d6d('0x3c')](_0x478ed4[_0x6d6d('0x38')],_0x478ed4[_0x6d6d('0x3a')]);_0x1e1c4e[_0x6d6d('0x3e')]=_[_0x6d6d('0x3c')](_0x478ed4[_0x6d6d('0x38')],qs[_0x6d6d('0x3d')](_0x58157a[_0x6d6d('0x3a')][_0x6d6d('0x3d')]));_0x1e1c4e[_0x6d6d('0x3e')]=_0x1e1c4e[_0x6d6d('0x3e')][_0x6d6d('0x3f')]?_0x1e1c4e['attributes']:_0x478ed4['model'];_0x1e1c4e[_0x6d6d('0x42')]=qs['sort'](_0x58157a[_0x6d6d('0x3a')][_0x6d6d('0x43')]);_0x1e1c4e['where']=qs['filters'](_[_0x6d6d('0x44')](_0x58157a['query'],_0x478ed4[_0x6d6d('0x3b')]));if(_0x58157a[_0x6d6d('0x3a')][_0x6d6d('0x45')]){_0x1e1c4e[_0x6d6d('0x46')]=_[_0x6d6d('0x4b')](_0x1e1c4e[_0x6d6d('0x46')],{'$or':_[_0x6d6d('0x47')](_0x1e1c4e[_0x6d6d('0x3e')],function(_0x4c59b5){var _0x363cfd={};_0x363cfd[_0x4c59b5]={'$like':'%'+_0x58157a[_0x6d6d('0x3a')][_0x6d6d('0x45')]+'%'};return _0x363cfd;})});}_0x1e1c4e=_['merge']({},_0x1e1c4e,_0x58157a['options']);return _0x32ab0f[_0x6d6d('0x5c')](_0x1e1c4e);}})[_0x6d6d('0x32')](function(_0x367b64){if(_0x367b64){_0x2efab5=_0x367b64['length'];if(!_0x58157a[_0x6d6d('0x3a')][_0x6d6d('0x5a')]('nolimit')){_0x1e1c4e[_0x6d6d('0x41')]=qs[_0x6d6d('0x41')](_0x58157a[_0x6d6d('0x3a')][_0x6d6d('0x41')]);_0x1e1c4e[_0x6d6d('0x2b')]=qs['offset'](_0x58157a[_0x6d6d('0x3a')][_0x6d6d('0x2b')]);}return _0x32ab0f['getDescriptions'](_0x1e1c4e);}})['then'](function(_0x282ba2){if(_0x282ba2){return _0x282ba2?{'count':_0x2efab5,'rows':_0x282ba2}:null;}})[_0x6d6d('0x32')](respondWithResult(_0x494fbc,null))[_0x6d6d('0x26')](handleError(_0x494fbc,null));}; \ No newline at end of file +var _0xed1f=['count','includeAll','findAll','rows','show','params','include','find','create','body','findOne','order','pick','getFields','hasOwnProperty','getSubjects','SalesforceField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','jayson/promise','client','test','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','sendStatus','end','status','json','offset','limit','Content-Range','apply','save','update','destroy','stack','name','index','SalesforceConfiguration','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','sort','filters','filter','where','merge','map','key','VIRTUAL','options'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xed1f,0x6a));var _0xfed1=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xed1f[_0xb24a3e];return _0x4038d7;};'use strict';var pdf=require(_0xfed1('0x0'));var emlformat=require(_0xfed1('0x1'));var rimraf=require(_0xfed1('0x2'));var zipdir=require(_0xfed1('0x3'));var jsonpatch=require(_0xfed1('0x4'));var rp=require(_0xfed1('0x5'));var moment=require(_0xfed1('0x6'));var BPromise=require(_0xfed1('0x7'));var Mustache=require(_0xfed1('0x8'));var util=require(_0xfed1('0x9'));var path=require(_0xfed1('0xa'));var sox=require(_0xfed1('0xb'));var csv=require(_0xfed1('0xc'));var ejs=require(_0xfed1('0xd'));var fs=require('fs');var _=require(_0xfed1('0xe'));var squel=require(_0xfed1('0xf'));var crypto=require(_0xfed1('0x10'));var jsforce=require(_0xfed1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0xc'));var querystring=require(_0xfed1('0x12'));var Papa=require('papaparse');var Redis=require(_0xfed1('0x13'));var authService=require(_0xfed1('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfed1('0x15'));var logger=require('../../config/logger')(_0xfed1('0x16'));var utils=require(_0xfed1('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0xfed1('0x18'));var client=jayson[_0xfed1('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x17f4fe,_0x5a3469,_0x529b3d){if(_0x529b3d){var _0x3f6555=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f6555[_0xfed1('0x1a')](_0x5a3469)){return _0x17f4fe;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x17f4fe;}}function respondWithRpcPromise(_0x2dde3a,_0x5b9455,_0x4cd9d1,_0xde25db){return new BPromise(function(_0x39aa0c,_0x1fbb7a){var _0x123c46=_0xde25db||client;return _0x123c46['request'](_0x2dde3a,_0x4cd9d1)[_0xfed1('0x1b')](function(_0x4af928){logger[_0xfed1('0x1c')](_0xfed1('0x1d'),_0x5b9455,'request\x20sent');logger[_0xfed1('0x1e')](_0xfed1('0x1f'),_0x5b9455,'request\x20sent',JSON['stringify'](_0x4af928));if(_0x4af928['error']){if(_0x4af928[_0xfed1('0x20')]['code']===0x1f4){logger[_0xfed1('0x20')](_0xfed1('0x1d'),_0x5b9455,_0x4af928['error'][_0xfed1('0x21')]);return _0x1fbb7a(_0x4af928[_0xfed1('0x20')]['message']);}logger[_0xfed1('0x20')](_0xfed1('0x1d'),_0x5b9455,_0x4af928[_0xfed1('0x20')][_0xfed1('0x21')]);return _0x39aa0c(_0x4af928['error'][_0xfed1('0x21')]);}else{logger['info'](_0xfed1('0x1d'),_0x5b9455,_0xfed1('0x22'));_0x39aa0c(_0x4af928[_0xfed1('0x23')]['message']);}})[_0xfed1('0x24')](function(_0x594917){logger[_0xfed1('0x20')](_0xfed1('0x1d'),_0x5b9455,_0x594917);_0x1fbb7a(_0x594917);});});}function respondWithStatusCode(_0x1b7b22,_0x365bae){_0x365bae=_0x365bae||0xcc;return function(_0x186ecc){if(_0x186ecc){return _0x1b7b22[_0xfed1('0x25')](_0x365bae);}return _0x1b7b22['status'](_0x365bae)[_0xfed1('0x26')]();};}function respondWithResult(_0xcb1cdc,_0x49072b){_0x49072b=_0x49072b||0xc8;return function(_0x1d6c72){if(_0x1d6c72){return _0xcb1cdc[_0xfed1('0x27')](_0x49072b)[_0xfed1('0x28')](_0x1d6c72);}};}function respondWithFilteredResult(_0x1d62c5,_0x3b9122){return function(_0x1761d1){if(_0x1761d1){var _0x583953=_0x1761d1['count'],_0x4607e9=_0x3b9122['offset'],_0x5a4451=_0x3b9122[_0xfed1('0x29')]+_0x3b9122[_0xfed1('0x2a')],_0x3106ee;if(_0x5a4451>=_0x583953){_0x5a4451=_0x583953;_0x3106ee=0xc8;}else{_0x3106ee=0xce;}_0x1d62c5[_0xfed1('0x27')](_0x3106ee);return _0x1d62c5['set'](_0xfed1('0x2b'),_0x4607e9+'-'+_0x5a4451+'/'+_0x583953)[_0xfed1('0x28')](_0x1761d1);}return null;};}function patchUpdates(_0x13f414){return function(_0x383955){try{jsonpatch[_0xfed1('0x2c')](_0x383955,_0x13f414,!![]);}catch(_0x30272b){return BPromise['reject'](_0x30272b);}return _0x383955[_0xfed1('0x2d')]();};}function saveUpdates(_0x16ca13,_0x4fc309){return function(_0x47a90c){if(_0x47a90c){return _0x47a90c[_0xfed1('0x2e')](_0x16ca13)[_0xfed1('0x1b')](function(_0x2def09){return _0x2def09;});}return null;};}function removeEntity(_0x71147f,_0x44c24a){return function(_0x57ca74){if(_0x57ca74){return _0x57ca74[_0xfed1('0x2f')]()[_0xfed1('0x1b')](function(){_0x71147f[_0xfed1('0x27')](0xcc)[_0xfed1('0x26')]();});}};}function handleEntityNotFound(_0xa4c53c,_0x4fde94){return function(_0x1da4b7){if(!_0x1da4b7){_0xa4c53c['sendStatus'](0x194);}return _0x1da4b7;};}function handleError(_0x11c5bd,_0x2bea11){_0x2bea11=_0x2bea11||0x1f4;return function(_0x17554f){logger[_0xfed1('0x20')](_0x17554f[_0xfed1('0x30')]);if(_0x17554f[_0xfed1('0x31')]){delete _0x17554f[_0xfed1('0x31')];}_0x11c5bd[_0xfed1('0x27')](_0x2bea11)['send'](_0x17554f);};}exports[_0xfed1('0x32')]=function(_0x46268a,_0x45f106){var _0x28adfc={},_0x57da75={},_0x4b1d7b={'count':0x0,'rows':[]};var _0x42d5df=db[_0xfed1('0x33')][_0xfed1('0x34')];_0x57da75[_0xfed1('0x35')]=_[_0xfed1('0x36')](_0x42d5df);_0x57da75[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x46268a[_0xfed1('0x37')]);_0x57da75['filters']=_['intersection'](_0x57da75[_0xfed1('0x35')],_0x57da75[_0xfed1('0x37')]);_0x28adfc['attributes']=_[_0xfed1('0x38')](_0x57da75[_0xfed1('0x35')],qs[_0xfed1('0x39')](_0x46268a[_0xfed1('0x37')][_0xfed1('0x39')]));_0x28adfc[_0xfed1('0x3a')]=_0x28adfc[_0xfed1('0x3a')][_0xfed1('0x3b')]?_0x28adfc[_0xfed1('0x3a')]:_0x57da75['model'];if(!_0x46268a['query']['hasOwnProperty'](_0xfed1('0x3c'))){_0x28adfc[_0xfed1('0x2a')]=qs[_0xfed1('0x2a')](_0x46268a['query'][_0xfed1('0x2a')]);_0x28adfc['offset']=qs[_0xfed1('0x29')](_0x46268a[_0xfed1('0x37')][_0xfed1('0x29')]);}_0x28adfc['order']=qs[_0xfed1('0x3d')](_0x46268a[_0xfed1('0x37')][_0xfed1('0x3d')]);_0x28adfc['where']=qs[_0xfed1('0x3e')](_['pick'](_0x46268a[_0xfed1('0x37')],_0x57da75[_0xfed1('0x3e')]));if(_0x46268a[_0xfed1('0x37')][_0xfed1('0x3f')]){_0x28adfc[_0xfed1('0x40')]=_[_0xfed1('0x41')](_0x28adfc[_0xfed1('0x40')],{'$or':_[_0xfed1('0x42')](_0x42d5df,function(_0x2e6e6d){if(_0x2e6e6d['type'][_0xfed1('0x43')]!==_0xfed1('0x44')){var _0x41c7c3={};_0x41c7c3[_0x2e6e6d['field']]={'$like':'%'+_0x46268a['query'][_0xfed1('0x3f')]+'%'};return _0x41c7c3;}})});}_0x28adfc=_[_0xfed1('0x41')]({},_0x28adfc,_0x46268a[_0xfed1('0x45')]);var _0xf39b8c={'where':_0x28adfc[_0xfed1('0x40')]};return db[_0xfed1('0x33')][_0xfed1('0x46')](_0xf39b8c)[_0xfed1('0x1b')](function(_0x221763){_0x4b1d7b[_0xfed1('0x46')]=_0x221763;if(_0x46268a[_0xfed1('0x37')][_0xfed1('0x47')]){_0x28adfc['include']=[{'all':!![]}];}return db[_0xfed1('0x33')][_0xfed1('0x48')](_0x28adfc);})[_0xfed1('0x1b')](function(_0x24c786){_0x4b1d7b[_0xfed1('0x49')]=_0x24c786;return _0x4b1d7b;})[_0xfed1('0x1b')](respondWithFilteredResult(_0x45f106,_0x28adfc))['catch'](handleError(_0x45f106,null));};exports[_0xfed1('0x4a')]=function(_0x11991d,_0x35e83d){var _0x4afcc1={'raw':![],'where':{'id':_0x11991d[_0xfed1('0x4b')]['id']}},_0x22874a={};_0x22874a[_0xfed1('0x35')]=_[_0xfed1('0x36')](db['SalesforceConfiguration'][_0xfed1('0x34')]);_0x22874a[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x11991d[_0xfed1('0x37')]);_0x22874a[_0xfed1('0x3e')]=_[_0xfed1('0x38')](_0x22874a[_0xfed1('0x35')],_0x22874a[_0xfed1('0x37')]);_0x4afcc1[_0xfed1('0x3a')]=_[_0xfed1('0x38')](_0x22874a[_0xfed1('0x35')],qs[_0xfed1('0x39')](_0x11991d[_0xfed1('0x37')][_0xfed1('0x39')]));_0x4afcc1[_0xfed1('0x3a')]=_0x4afcc1[_0xfed1('0x3a')][_0xfed1('0x3b')]?_0x4afcc1[_0xfed1('0x3a')]:_0x22874a['model'];if(_0x11991d['query'][_0xfed1('0x47')]){_0x4afcc1[_0xfed1('0x4c')]=[{'all':!![]}];}_0x4afcc1=_[_0xfed1('0x41')]({},_0x4afcc1,_0x11991d[_0xfed1('0x45')]);return db['SalesforceConfiguration'][_0xfed1('0x4d')](_0x4afcc1)[_0xfed1('0x1b')](handleEntityNotFound(_0x35e83d,null))['then'](respondWithResult(_0x35e83d,null))['catch'](handleError(_0x35e83d,null));};exports['create']=function(_0x2376b3,_0x1aaa3d){return db[_0xfed1('0x33')][_0xfed1('0x4e')](_0x2376b3[_0xfed1('0x4f')],{})[_0xfed1('0x1b')](respondWithResult(_0x1aaa3d,0xc9))[_0xfed1('0x24')](handleError(_0x1aaa3d,null));};exports[_0xfed1('0x2e')]=function(_0x116a76,_0x38dd0b){if(_0x116a76['body']['id']){delete _0x116a76['body']['id'];}return db[_0xfed1('0x33')][_0xfed1('0x4d')]({'where':{'id':_0x116a76[_0xfed1('0x4b')]['id']}})[_0xfed1('0x1b')](handleEntityNotFound(_0x38dd0b,null))[_0xfed1('0x1b')](saveUpdates(_0x116a76[_0xfed1('0x4f')],null))[_0xfed1('0x1b')](respondWithResult(_0x38dd0b,null))[_0xfed1('0x24')](handleError(_0x38dd0b,null));};exports[_0xfed1('0x2f')]=function(_0x427fa6,_0xbd49dc){return db[_0xfed1('0x33')][_0xfed1('0x4d')]({'where':{'id':_0x427fa6[_0xfed1('0x4b')]['id']}})[_0xfed1('0x1b')](handleEntityNotFound(_0xbd49dc,null))[_0xfed1('0x1b')](removeEntity(_0xbd49dc,null))[_0xfed1('0x24')](handleError(_0xbd49dc,null));};exports['getFields']=function(_0x5b167b,_0x2fe019,_0x10d831){var _0x3d2cc4={};var _0x19b1e7={};var _0x23a4f0;var _0x41a22a;return db[_0xfed1('0x33')][_0xfed1('0x50')]({'where':{'id':_0x5b167b[_0xfed1('0x4b')]['id']}})[_0xfed1('0x1b')](handleEntityNotFound(_0x2fe019,null))[_0xfed1('0x1b')](function(_0x3fdab3){if(_0x3fdab3){_0x23a4f0=_0x3fdab3;_0x19b1e7[_0xfed1('0x35')]=_[_0xfed1('0x36')](db['SalesforceField'][_0xfed1('0x34')]);_0x19b1e7['query']=_['keys'](_0x5b167b[_0xfed1('0x37')]);_0x19b1e7['filters']=_[_0xfed1('0x38')](_0x19b1e7['model'],_0x19b1e7[_0xfed1('0x37')]);_0x3d2cc4[_0xfed1('0x3a')]=_['intersection'](_0x19b1e7[_0xfed1('0x35')],qs[_0xfed1('0x39')](_0x5b167b['query'][_0xfed1('0x39')]));_0x3d2cc4[_0xfed1('0x3a')]=_0x3d2cc4[_0xfed1('0x3a')][_0xfed1('0x3b')]?_0x3d2cc4['attributes']:_0x19b1e7[_0xfed1('0x35')];_0x3d2cc4[_0xfed1('0x51')]=qs[_0xfed1('0x3d')](_0x5b167b[_0xfed1('0x37')][_0xfed1('0x3d')]);_0x3d2cc4[_0xfed1('0x40')]=qs[_0xfed1('0x3e')](_[_0xfed1('0x52')](_0x5b167b['query'],_0x19b1e7[_0xfed1('0x3e')]));if(_0x5b167b[_0xfed1('0x37')][_0xfed1('0x3f')]){_0x3d2cc4[_0xfed1('0x40')]=_[_0xfed1('0x41')](_0x3d2cc4[_0xfed1('0x40')],{'$or':_['map'](_0x3d2cc4['attributes'],function(_0x55d280){var _0x33a479={};_0x33a479[_0x55d280]={'$like':'%'+_0x5b167b[_0xfed1('0x37')][_0xfed1('0x3f')]+'%'};return _0x33a479;})});}_0x3d2cc4=_[_0xfed1('0x41')]({},_0x3d2cc4,_0x5b167b['options']);return _0x23a4f0[_0xfed1('0x53')](_0x3d2cc4);}})['then'](function(_0x3747cd){if(_0x3747cd){_0x41a22a=_0x3747cd[_0xfed1('0x3b')];if(!_0x5b167b[_0xfed1('0x37')][_0xfed1('0x54')](_0xfed1('0x3c'))){_0x3d2cc4['limit']=qs[_0xfed1('0x2a')](_0x5b167b[_0xfed1('0x37')][_0xfed1('0x2a')]);_0x3d2cc4['offset']=qs[_0xfed1('0x29')](_0x5b167b[_0xfed1('0x37')][_0xfed1('0x29')]);}return _0x23a4f0[_0xfed1('0x53')](_0x3d2cc4);}})['then'](function(_0x286e3d){if(_0x286e3d){return _0x286e3d?{'count':_0x41a22a,'rows':_0x286e3d}:null;}})['then'](respondWithResult(_0x2fe019,null))[_0xfed1('0x24')](handleError(_0x2fe019,null));};exports[_0xfed1('0x55')]=function(_0x4b685b,_0x480c52,_0x43b172){var _0x340ba3={};var _0x1dc791={};var _0x2ee25f;var _0x4f3a4b;return db[_0xfed1('0x33')][_0xfed1('0x50')]({'where':{'id':_0x4b685b[_0xfed1('0x4b')]['id']}})[_0xfed1('0x1b')](handleEntityNotFound(_0x480c52,null))[_0xfed1('0x1b')](function(_0x1cb73e){if(_0x1cb73e){_0x2ee25f=_0x1cb73e;_0x1dc791['model']=_[_0xfed1('0x36')](db[_0xfed1('0x56')]['rawAttributes']);_0x1dc791[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x4b685b[_0xfed1('0x37')]);_0x1dc791[_0xfed1('0x3e')]=_[_0xfed1('0x38')](_0x1dc791[_0xfed1('0x35')],_0x1dc791['query']);_0x340ba3['attributes']=_[_0xfed1('0x38')](_0x1dc791['model'],qs[_0xfed1('0x39')](_0x4b685b[_0xfed1('0x37')][_0xfed1('0x39')]));_0x340ba3[_0xfed1('0x3a')]=_0x340ba3[_0xfed1('0x3a')][_0xfed1('0x3b')]?_0x340ba3[_0xfed1('0x3a')]:_0x1dc791[_0xfed1('0x35')];_0x340ba3[_0xfed1('0x51')]=qs[_0xfed1('0x3d')](_0x4b685b['query'][_0xfed1('0x3d')]);_0x340ba3[_0xfed1('0x40')]=qs['filters'](_['pick'](_0x4b685b[_0xfed1('0x37')],_0x1dc791['filters']));if(_0x4b685b[_0xfed1('0x37')][_0xfed1('0x3f')]){_0x340ba3[_0xfed1('0x40')]=_['merge'](_0x340ba3[_0xfed1('0x40')],{'$or':_[_0xfed1('0x42')](_0x340ba3[_0xfed1('0x3a')],function(_0x29bd5d){var _0x38751e={};_0x38751e[_0x29bd5d]={'$like':'%'+_0x4b685b['query'][_0xfed1('0x3f')]+'%'};return _0x38751e;})});}_0x340ba3=_[_0xfed1('0x41')]({},_0x340ba3,_0x4b685b[_0xfed1('0x45')]);return _0x2ee25f[_0xfed1('0x55')](_0x340ba3);}})[_0xfed1('0x1b')](function(_0x5b1ab9){if(_0x5b1ab9){_0x4f3a4b=_0x5b1ab9[_0xfed1('0x3b')];if(!_0x4b685b[_0xfed1('0x37')][_0xfed1('0x54')](_0xfed1('0x3c'))){_0x340ba3[_0xfed1('0x2a')]=qs[_0xfed1('0x2a')](_0x4b685b[_0xfed1('0x37')][_0xfed1('0x2a')]);_0x340ba3[_0xfed1('0x29')]=qs[_0xfed1('0x29')](_0x4b685b['query'][_0xfed1('0x29')]);}return _0x2ee25f[_0xfed1('0x55')](_0x340ba3);}})[_0xfed1('0x1b')](function(_0x383d34){if(_0x383d34){return _0x383d34?{'count':_0x4f3a4b,'rows':_0x383d34}:null;}})[_0xfed1('0x1b')](respondWithResult(_0x480c52,null))['catch'](handleError(_0x480c52,null));};exports[_0xfed1('0x57')]=function(_0x36c99e,_0x46e1dc,_0x3c490d){var _0x221ed8={};var _0xb76860={};var _0x46409b;var _0x11f2bd;return db[_0xfed1('0x33')]['findOne']({'where':{'id':_0x36c99e['params']['id']}})[_0xfed1('0x1b')](handleEntityNotFound(_0x46e1dc,null))['then'](function(_0x25cebc){if(_0x25cebc){_0x46409b=_0x25cebc;_0xb76860[_0xfed1('0x35')]=_[_0xfed1('0x36')](db['SalesforceField']['rawAttributes']);_0xb76860[_0xfed1('0x37')]=_['keys'](_0x36c99e[_0xfed1('0x37')]);_0xb76860['filters']=_[_0xfed1('0x38')](_0xb76860[_0xfed1('0x35')],_0xb76860[_0xfed1('0x37')]);_0x221ed8[_0xfed1('0x3a')]=_[_0xfed1('0x38')](_0xb76860['model'],qs[_0xfed1('0x39')](_0x36c99e[_0xfed1('0x37')]['fields']));_0x221ed8[_0xfed1('0x3a')]=_0x221ed8[_0xfed1('0x3a')]['length']?_0x221ed8[_0xfed1('0x3a')]:_0xb76860[_0xfed1('0x35')];_0x221ed8[_0xfed1('0x51')]=qs['sort'](_0x36c99e[_0xfed1('0x37')][_0xfed1('0x3d')]);_0x221ed8['where']=qs[_0xfed1('0x3e')](_[_0xfed1('0x52')](_0x36c99e[_0xfed1('0x37')],_0xb76860['filters']));if(_0x36c99e[_0xfed1('0x37')][_0xfed1('0x3f')]){_0x221ed8['where']=_['merge'](_0x221ed8[_0xfed1('0x40')],{'$or':_[_0xfed1('0x42')](_0x221ed8[_0xfed1('0x3a')],function(_0x42b246){var _0x1fefdb={};_0x1fefdb[_0x42b246]={'$like':'%'+_0x36c99e[_0xfed1('0x37')][_0xfed1('0x3f')]+'%'};return _0x1fefdb;})});}_0x221ed8=_[_0xfed1('0x41')]({},_0x221ed8,_0x36c99e[_0xfed1('0x45')]);return _0x46409b[_0xfed1('0x57')](_0x221ed8);}})[_0xfed1('0x1b')](function(_0x1cc77b){if(_0x1cc77b){_0x11f2bd=_0x1cc77b['length'];if(!_0x36c99e[_0xfed1('0x37')][_0xfed1('0x54')]('nolimit')){_0x221ed8[_0xfed1('0x2a')]=qs[_0xfed1('0x2a')](_0x36c99e['query'][_0xfed1('0x2a')]);_0x221ed8[_0xfed1('0x29')]=qs[_0xfed1('0x29')](_0x36c99e[_0xfed1('0x37')]['offset']);}return _0x46409b[_0xfed1('0x57')](_0x221ed8);}})[_0xfed1('0x1b')](function(_0x6a45ec){if(_0x6a45ec){return _0x6a45ec?{'count':_0x11f2bd,'rows':_0x6a45ec}:null;}})[_0xfed1('0x1b')](respondWithResult(_0x46e1dc,null))[_0xfed1('0x24')](handleError(_0x46e1dc,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index d97952f..6543127 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x23fc=['SalesforceConfiguration','int_salesforce_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define'];(function(_0x4d03ca,_0x3f4059){var _0x2b444d=function(_0x47e6d9){while(--_0x47e6d9){_0x4d03ca['push'](_0x4d03ca['shift']());}};_0x2b444d(++_0x3f4059);}(_0x23fc,0x13a));var _0xc23f=function(_0x55c00d,_0x520cb6){_0x55c00d=_0x55c00d-0x0;var _0x254a8f=_0x23fc[_0x55c00d];return _0x254a8f;};'use strict';var _=require(_0xc23f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc23f('0x1'));var moment=require(_0xc23f('0x2'));var BPromise=require(_0xc23f('0x3'));var rp=require(_0xc23f('0x4'));var fs=require('fs');var path=require(_0xc23f('0x5'));var rimraf=require(_0xc23f('0x6'));var config=require(_0xc23f('0x7'));var attributes=require(_0xc23f('0x8'));module[_0xc23f('0x9')]=function(_0x44b563,_0x263372){return _0x44b563[_0xc23f('0xa')](_0xc23f('0xb'),attributes,{'tableName':_0xc23f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8934=['path','../../config/environment','exports','define','int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise'];(function(_0x297694,_0x2558cf){var _0xd55342=function(_0x257e40){while(--_0x257e40){_0x297694['push'](_0x297694['shift']());}};_0xd55342(++_0x2558cf);}(_0x8934,0x1c8));var _0x4893=function(_0x215747,_0x470f96){_0x215747=_0x215747-0x0;var _0x4992b9=_0x8934[_0x215747];return _0x4992b9;};'use strict';var _=require(_0x4893('0x0'));var util=require(_0x4893('0x1'));var logger=require('../../config/logger')(_0x4893('0x2'));var moment=require(_0x4893('0x3'));var BPromise=require(_0x4893('0x4'));var rp=require(_0x4893('0x5'));var fs=require('fs');var path=require(_0x4893('0x6'));var rimraf=require('rimraf');var config=require(_0x4893('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x4893('0x8')]=function(_0x2f6dad,_0x4d3920){return _0x2f6dad[_0x4893('0x9')]('SalesforceConfiguration',attributes,{'tableName':_0x4893('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index be3a5a5..2a7959e 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8c1=['info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','rpc','jayson/promise','client','http','request','then'];(function(_0xdec14e,_0x378789){var _0x93aa28=function(_0x1a38c9){while(--_0x1a38c9){_0xdec14e['push'](_0xdec14e['shift']());}};_0x93aa28(++_0x378789);}(_0xb8c1,0x1af));var _0x1b8c=function(_0x56175c,_0x4456d0){_0x56175c=_0x56175c-0x0;var _0x133123=_0xb8c1[_0x56175c];return _0x133123;};'use strict';var _=require(_0x1b8c('0x0'));var util=require('util');var moment=require(_0x1b8c('0x1'));var BPromise=require(_0x1b8c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b8c('0x3'));var config=require('../../config/environment');var jayson=require(_0x1b8c('0x4'));var client=jayson[_0x1b8c('0x5')][_0x1b8c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1753ce,_0x39b2b1,_0x216b23){return new BPromise(function(_0x5ea522,_0x4173ac){return client[_0x1b8c('0x7')](_0x1753ce,_0x216b23)[_0x1b8c('0x8')](function(_0x11a84c){logger[_0x1b8c('0x9')](_0x1b8c('0xa'),_0x39b2b1,'request\x20sent');logger[_0x1b8c('0xb')](_0x1b8c('0xc'),_0x39b2b1,_0x1b8c('0xd'),JSON[_0x1b8c('0xe')](_0x11a84c));if(_0x11a84c[_0x1b8c('0xf')]){if(_0x11a84c['error'][_0x1b8c('0x10')]===0x1f4){logger[_0x1b8c('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x39b2b1,_0x11a84c[_0x1b8c('0xf')]['message']);return _0x4173ac(_0x11a84c['error']['message']);}logger[_0x1b8c('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x39b2b1,_0x11a84c[_0x1b8c('0xf')][_0x1b8c('0x11')]);return _0x5ea522(_0x11a84c[_0x1b8c('0xf')][_0x1b8c('0x11')]);}else{logger[_0x1b8c('0x9')](_0x1b8c('0xa'),_0x39b2b1,_0x1b8c('0xd'));_0x5ea522(_0x11a84c[_0x1b8c('0x12')][_0x1b8c('0x11')]);}})[_0x1b8c('0x13')](function(_0x56b6b8){logger[_0x1b8c('0xf')](_0x1b8c('0xa'),_0x39b2b1,_0x56b6b8);_0x4173ac(_0x56b6b8);});});} \ No newline at end of file +var _0x2134=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x76a45d,_0x375af7){var _0x33b927=function(_0xcddd3a){while(--_0xcddd3a){_0x76a45d['push'](_0x76a45d['shift']());}};_0x33b927(++_0x375af7);}(_0x2134,0xbc));var _0x4213=function(_0x886f43,_0x1e9d1f){_0x886f43=_0x886f43-0x0;var _0x584e70=_0x2134[_0x886f43];return _0x584e70;};'use strict';var _=require(_0x4213('0x0'));var util=require('util');var moment=require(_0x4213('0x1'));var BPromise=require(_0x4213('0x2'));var rs=require(_0x4213('0x3'));var fs=require('fs');var Redis=require(_0x4213('0x4'));var db=require(_0x4213('0x5'))['db'];var utils=require(_0x4213('0x6'));var logger=require(_0x4213('0x7'))('rpc');var config=require(_0x4213('0x8'));var jayson=require(_0x4213('0x9'));var client=jayson[_0x4213('0xa')][_0x4213('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8bd251,_0x1d04ef,_0x331d51){return new BPromise(function(_0x53310a,_0x176c91){return client[_0x4213('0xc')](_0x8bd251,_0x331d51)['then'](function(_0x113dd8){logger[_0x4213('0xd')](_0x4213('0xe'),_0x1d04ef,_0x4213('0xf'));logger[_0x4213('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x1d04ef,'request\x20sent',JSON[_0x4213('0x11')](_0x113dd8));if(_0x113dd8[_0x4213('0x12')]){if(_0x113dd8['error'][_0x4213('0x13')]===0x1f4){logger[_0x4213('0x12')](_0x4213('0xe'),_0x1d04ef,_0x113dd8[_0x4213('0x12')][_0x4213('0x14')]);return _0x176c91(_0x113dd8[_0x4213('0x12')]['message']);}logger[_0x4213('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1d04ef,_0x113dd8['error']['message']);return _0x53310a(_0x113dd8[_0x4213('0x12')][_0x4213('0x14')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x1d04ef,_0x4213('0xf'));_0x53310a(_0x113dd8[_0x4213('0x15')][_0x4213('0x14')]);}})[_0x4213('0x16')](function(_0x1a1804){logger[_0x4213('0x12')](_0x4213('0xe'),_0x1d04ef,_0x1a1804);_0x176c91(_0x1a1804);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 3bef042..07b864f 100644 --- a/server/api/intSalesforceField/index.js +++ b/server/api/intSalesforceField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01d9=['../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x366e51,_0x3a0178){var _0x4e23e3=function(_0x7ecebe){while(--_0x7ecebe){_0x366e51['push'](_0x366e51['shift']());}};_0x4e23e3(++_0x3a0178);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var auth=require(_0x901d('0x5'));var interaction=require(_0x901d('0x6'));var config=require(_0x901d('0x7'));var controller=require(_0x901d('0x8'));router[_0x901d('0x9')]('/',auth[_0x901d('0xa')](),controller['index']);router[_0x901d('0x9')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0xc')]);router[_0x901d('0xd')]('/',auth[_0x901d('0xa')](),controller[_0x901d('0xe')]);router[_0x901d('0xf')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')](_0x901d('0xb'),auth['isAuthenticated'](),controller[_0x901d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0309=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','/:id','show','isAuthenticated','create','put','update','delete','destroy','exports','multer','path','express'];(function(_0x18e269,_0x44ac8b){var _0x3a3f03=function(_0x1c695a){while(--_0x1c695a){_0x18e269['push'](_0x18e269['shift']());}};_0x3a3f03(++_0x44ac8b);}(_0x0309,0x165));var _0x9030=function(_0x1bffe2,_0xcef363){_0x1bffe2=_0x1bffe2-0x0;var _0x52ca14=_0x0309[_0x1bffe2];return _0x52ca14;};'use strict';var multer=require(_0x9030('0x0'));var util=require('util');var path=require(_0x9030('0x1'));var timeout=require('connect-timeout');var express=require(_0x9030('0x2'));var router=express[_0x9030('0x3')]();var auth=require(_0x9030('0x4'));var interaction=require(_0x9030('0x5'));var config=require(_0x9030('0x6'));var controller=require(_0x9030('0x7'));router[_0x9030('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9030('0x8')](_0x9030('0x9'),auth['isAuthenticated'](),controller[_0x9030('0xa')]);router['post']('/',auth[_0x9030('0xb')](),controller[_0x9030('0xc')]);router[_0x9030('0xd')]('/:id',auth[_0x9030('0xb')](),controller[_0x9030('0xe')]);router[_0x9030('0xf')]('/:id',auth[_0x9030('0xb')](),controller[_0x9030('0x10')]);module[_0x9030('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 8b53efe..28bf02d 100644 --- a/server/api/intSalesforceField/intSalesforceField.attributes.js +++ b/server/api/intSalesforceField/intSalesforceField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7aca=['variable','customVariable','string','STRING','sequelize','ENUM'];(function(_0x390ee5,_0x21504b){var _0xf36bc8=function(_0x473c9b){while(--_0x473c9b){_0x390ee5['push'](_0x390ee5['shift']());}};_0xf36bc8(++_0x21504b);}(_0x7aca,0x130));var _0xa7ac=function(_0x5dbb2,_0x1e3317){_0x5dbb2=_0x5dbb2-0x0;var _0x4ba922=_0x7aca[_0x5dbb2];return _0x4ba922;};'use strict';var Sequelize=require(_0xa7ac('0x0'));module['exports']={'type':{'type':Sequelize[_0xa7ac('0x1')]('string',_0xa7ac('0x2'),_0xa7ac('0x3'),'keyValue'),'defaultValue':_0xa7ac('0x4')},'content':{'type':Sequelize[_0xa7ac('0x5')]},'key':{'type':Sequelize[_0xa7ac('0x5')]},'keyType':{'type':Sequelize[_0xa7ac('0x1')]('string',_0xa7ac('0x2'),_0xa7ac('0x3'))},'keyContent':{'type':Sequelize[_0xa7ac('0x5')]},'idField':{'type':Sequelize[_0xa7ac('0x5')]},'variableName':{'type':Sequelize[_0xa7ac('0x5')]}}; \ No newline at end of file +var _0xe6b8=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0xe6b8,0x181));var _0x8e6b=function(_0x39e7bb,_0x481377){_0x39e7bb=_0x39e7bb-0x0;var _0x554a07=_0xe6b8[_0x39e7bb];return _0x554a07;};'use strict';var Sequelize=require(_0x8e6b('0x0'));module[_0x8e6b('0x1')]={'type':{'type':Sequelize[_0x8e6b('0x2')](_0x8e6b('0x3'),_0x8e6b('0x4'),_0x8e6b('0x5'),_0x8e6b('0x6')),'defaultValue':_0x8e6b('0x3')},'content':{'type':Sequelize[_0x8e6b('0x7')]},'key':{'type':Sequelize[_0x8e6b('0x7')]},'keyType':{'type':Sequelize[_0x8e6b('0x2')](_0x8e6b('0x3'),'variable',_0x8e6b('0x5'))},'keyContent':{'type':Sequelize[_0x8e6b('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x8e6b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 1876811..ee36e34 100644 --- a/server/api/intSalesforceField/intSalesforceField.controller.js +++ b/server/api/intSalesforceField/intSalesforceField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa91a=['VIRTUAL','merge','options','include','findAll','rows','catch','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','apply','reject','destroy','then','error','name','send','index','SalesforceField','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','key'];(function(_0x21acea,_0x32d99e){var _0x480568=function(_0x2882bf){while(--_0x2882bf){_0x21acea['push'](_0x21acea['shift']());}};_0x480568(++_0x32d99e);}(_0xa91a,0x15a));var _0xaa91=function(_0x31912,_0x49628b){_0x31912=_0x31912-0x0;var _0x3042a8=_0xa91a[_0x31912];return _0x3042a8;};'use strict';var pdf=require(_0xaa91('0x0'));var emlformat=require(_0xaa91('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaa91('0x2'));var jsonpatch=require(_0xaa91('0x3'));var rp=require(_0xaa91('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaa91('0x5'));var util=require(_0xaa91('0x6'));var path=require('path');var sox=require(_0xaa91('0x7'));var csv=require(_0xaa91('0x8'));var ejs=require(_0xaa91('0x9'));var fs=require('fs');var _=require(_0xaa91('0xa'));var squel=require('squel');var crypto=require(_0xaa91('0xb'));var jsforce=require(_0xaa91('0xc'));var deskjs=require(_0xaa91('0xd'));var toCsv=require(_0xaa91('0x8'));var querystring=require(_0xaa91('0xe'));var Papa=require(_0xaa91('0xf'));var Redis=require(_0xaa91('0x10'));var authService=require(_0xaa91('0x11'));var qs=require(_0xaa91('0x12'));var hardwareService=require(_0xaa91('0x13'));var logger=require(_0xaa91('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xaa91('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x534ac1,_0x517fbb){_0x517fbb=_0x517fbb||0xcc;return function(_0x31190b){if(_0x31190b){return _0x534ac1[_0xaa91('0x16')](_0x517fbb);}return _0x534ac1['status'](_0x517fbb)[_0xaa91('0x17')]();};}function respondWithResult(_0x18a26d,_0x758cb7){_0x758cb7=_0x758cb7||0xc8;return function(_0x1c8e3){if(_0x1c8e3){return _0x18a26d[_0xaa91('0x18')](_0x758cb7)[_0xaa91('0x19')](_0x1c8e3);}};}function respondWithFilteredResult(_0x30515b,_0x8b4d33){return function(_0x31be58){if(_0x31be58){var _0x1dc51d=_0x31be58[_0xaa91('0x1a')],_0x87c254=_0x8b4d33[_0xaa91('0x1b')],_0x19bfa4=_0x8b4d33[_0xaa91('0x1b')]+_0x8b4d33[_0xaa91('0x1c')],_0x8f2ef4;if(_0x19bfa4>=_0x1dc51d){_0x19bfa4=_0x1dc51d;_0x8f2ef4=0xc8;}else{_0x8f2ef4=0xce;}_0x30515b['status'](_0x8f2ef4);return _0x30515b[_0xaa91('0x1d')]('Content-Range',_0x87c254+'-'+_0x19bfa4+'/'+_0x1dc51d)[_0xaa91('0x19')](_0x31be58);}return null;};}function patchUpdates(_0x41f05d){return function(_0x206587){try{jsonpatch[_0xaa91('0x1e')](_0x206587,_0x41f05d,!![]);}catch(_0x47cc13){return BPromise[_0xaa91('0x1f')](_0x47cc13);}return _0x206587['save']();};}function saveUpdates(_0x38302d,_0x314b6a){return function(_0x2315a8){if(_0x2315a8){return _0x2315a8['update'](_0x38302d)['then'](function(_0x6ccfbd){return _0x6ccfbd;});}return null;};}function removeEntity(_0x7c4e84,_0x5f2125){return function(_0x28d84d){if(_0x28d84d){return _0x28d84d[_0xaa91('0x20')]()[_0xaa91('0x21')](function(){_0x7c4e84[_0xaa91('0x18')](0xcc)[_0xaa91('0x17')]();});}};}function handleEntityNotFound(_0xc87067,_0xcb0d12){return function(_0x46c68c){if(!_0x46c68c){_0xc87067[_0xaa91('0x16')](0x194);}return _0x46c68c;};}function handleError(_0x1149a9,_0xe65796){_0xe65796=_0xe65796||0x1f4;return function(_0x5d2fa3){logger[_0xaa91('0x22')](_0x5d2fa3['stack']);if(_0x5d2fa3['name']){delete _0x5d2fa3[_0xaa91('0x23')];}_0x1149a9[_0xaa91('0x18')](_0xe65796)[_0xaa91('0x24')](_0x5d2fa3);};}exports[_0xaa91('0x25')]=function(_0x178172,_0x34108c){var _0x4b8f69={},_0x1477fc={},_0x40f09d={'count':0x0,'rows':[]};var _0x4d07f4=db[_0xaa91('0x26')][_0xaa91('0x27')];_0x1477fc[_0xaa91('0x28')]=_['keys'](_0x4d07f4);_0x1477fc[_0xaa91('0x29')]=_[_0xaa91('0x2a')](_0x178172['query']);_0x1477fc[_0xaa91('0x2b')]=_[_0xaa91('0x2c')](_0x1477fc[_0xaa91('0x28')],_0x1477fc['query']);_0x4b8f69[_0xaa91('0x2d')]=_[_0xaa91('0x2c')](_0x1477fc[_0xaa91('0x28')],qs[_0xaa91('0x2e')](_0x178172[_0xaa91('0x29')][_0xaa91('0x2e')]));_0x4b8f69['attributes']=_0x4b8f69['attributes'][_0xaa91('0x2f')]?_0x4b8f69[_0xaa91('0x2d')]:_0x1477fc['model'];if(!_0x178172[_0xaa91('0x29')][_0xaa91('0x30')](_0xaa91('0x31'))){_0x4b8f69[_0xaa91('0x1c')]=qs[_0xaa91('0x1c')](_0x178172[_0xaa91('0x29')]['limit']);_0x4b8f69['offset']=qs[_0xaa91('0x1b')](_0x178172['query']['offset']);}_0x4b8f69['order']=qs[_0xaa91('0x32')](_0x178172['query']['sort']);_0x4b8f69[_0xaa91('0x33')]=qs['filters'](_[_0xaa91('0x34')](_0x178172['query'],_0x1477fc[_0xaa91('0x2b')]));if(_0x178172[_0xaa91('0x29')][_0xaa91('0x35')]){_0x4b8f69[_0xaa91('0x33')]=_['merge'](_0x4b8f69[_0xaa91('0x33')],{'$or':_['map'](_0x4d07f4,function(_0x128365){if(_0x128365[_0xaa91('0x36')][_0xaa91('0x37')]!==_0xaa91('0x38')){var _0x585bf5={};_0x585bf5[_0x128365['field']]={'$like':'%'+_0x178172['query'][_0xaa91('0x35')]+'%'};return _0x585bf5;}})});}_0x4b8f69=_[_0xaa91('0x39')]({},_0x4b8f69,_0x178172[_0xaa91('0x3a')]);var _0x567efd={'where':_0x4b8f69['where']};return db[_0xaa91('0x26')][_0xaa91('0x1a')](_0x567efd)['then'](function(_0x34f208){_0x40f09d[_0xaa91('0x1a')]=_0x34f208;if(_0x178172['query']['includeAll']){_0x4b8f69[_0xaa91('0x3b')]=[{'all':!![]}];}return db[_0xaa91('0x26')][_0xaa91('0x3c')](_0x4b8f69);})[_0xaa91('0x21')](function(_0x5ed7fe){_0x40f09d[_0xaa91('0x3d')]=_0x5ed7fe;return _0x40f09d;})[_0xaa91('0x21')](respondWithFilteredResult(_0x34108c,_0x4b8f69))[_0xaa91('0x3e')](handleError(_0x34108c,null));};exports['show']=function(_0x293786,_0x2d3f40){var _0x1771e8={'raw':!![],'where':{'id':_0x293786['params']['id']}},_0x626453={};_0x626453['model']=_[_0xaa91('0x2a')](db[_0xaa91('0x26')][_0xaa91('0x27')]);_0x626453[_0xaa91('0x29')]=_[_0xaa91('0x2a')](_0x293786[_0xaa91('0x29')]);_0x626453[_0xaa91('0x2b')]=_[_0xaa91('0x2c')](_0x626453[_0xaa91('0x28')],_0x626453[_0xaa91('0x29')]);_0x1771e8[_0xaa91('0x2d')]=_['intersection'](_0x626453[_0xaa91('0x28')],qs[_0xaa91('0x2e')](_0x293786[_0xaa91('0x29')][_0xaa91('0x2e')]));_0x1771e8[_0xaa91('0x2d')]=_0x1771e8[_0xaa91('0x2d')][_0xaa91('0x2f')]?_0x1771e8[_0xaa91('0x2d')]:_0x626453[_0xaa91('0x28')];if(_0x293786[_0xaa91('0x29')]['includeAll']){_0x1771e8[_0xaa91('0x3b')]=[{'all':!![]}];}_0x1771e8=_[_0xaa91('0x39')]({},_0x1771e8,_0x293786[_0xaa91('0x3a')]);return db[_0xaa91('0x26')][_0xaa91('0x3f')](_0x1771e8)[_0xaa91('0x21')](handleEntityNotFound(_0x2d3f40,null))[_0xaa91('0x21')](respondWithResult(_0x2d3f40,null))[_0xaa91('0x3e')](handleError(_0x2d3f40,null));};exports[_0xaa91('0x40')]=function(_0x5241c2,_0x3d19d1){return db[_0xaa91('0x26')][_0xaa91('0x40')](_0x5241c2[_0xaa91('0x41')],{})[_0xaa91('0x21')](respondWithResult(_0x3d19d1,0xc9))[_0xaa91('0x3e')](handleError(_0x3d19d1,null));};exports['update']=function(_0x539bc5,_0x22cf94){if(_0x539bc5['body']['id']){delete _0x539bc5[_0xaa91('0x41')]['id'];}return db[_0xaa91('0x26')][_0xaa91('0x3f')]({'where':{'id':_0x539bc5[_0xaa91('0x42')]['id']}})[_0xaa91('0x21')](handleEntityNotFound(_0x22cf94,null))[_0xaa91('0x21')](saveUpdates(_0x539bc5[_0xaa91('0x41')],null))[_0xaa91('0x21')](respondWithResult(_0x22cf94,null))[_0xaa91('0x3e')](handleError(_0x22cf94,null));};exports['destroy']=function(_0x2608e1,_0x1e61cc){return db[_0xaa91('0x26')][_0xaa91('0x3f')]({'where':{'id':_0x2608e1['params']['id']}})[_0xaa91('0x21')](handleEntityNotFound(_0x1e61cc,null))[_0xaa91('0x21')](removeEntity(_0x1e61cc,null))[_0xaa91('0x3e')](handleError(_0x1e61cc,null));}; \ No newline at end of file +var _0x421e=['end','error','stack','name','send','index','SalesforceField','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','set','Content-Range','apply','then','destroy'];(function(_0x2b18f2,_0x432bd4){var _0x30ef50=function(_0x844d23){while(--_0x844d23){_0x2b18f2['push'](_0x2b18f2['shift']());}};_0x30ef50(++_0x432bd4);}(_0x421e,0x1cd));var _0xe421=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0x421e[_0x45ee03];return _0x13d535;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe421('0x0'));var jsonpatch=require(_0xe421('0x1'));var rp=require('request-promise');var moment=require(_0xe421('0x2'));var BPromise=require(_0xe421('0x3'));var Mustache=require(_0xe421('0x4'));var util=require(_0xe421('0x5'));var path=require(_0xe421('0x6'));var sox=require(_0xe421('0x7'));var csv=require(_0xe421('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe421('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe421('0xa'));var Papa=require('papaparse');var Redis=require(_0xe421('0xb'));var authService=require(_0xe421('0xc'));var qs=require(_0xe421('0xd'));var hardwareService=require(_0xe421('0xe'));var logger=require(_0xe421('0xf'))(_0xe421('0x10'));var utils=require(_0xe421('0x11'));var config=require(_0xe421('0x12'));var db=require(_0xe421('0x13'))['db'];function respondWithStatusCode(_0x2a94b7,_0x1dc227){_0x1dc227=_0x1dc227||0xcc;return function(_0x20c913){if(_0x20c913){return _0x2a94b7[_0xe421('0x14')](_0x1dc227);}return _0x2a94b7[_0xe421('0x15')](_0x1dc227)['end']();};}function respondWithResult(_0x154ee2,_0x1b43ba){_0x1b43ba=_0x1b43ba||0xc8;return function(_0x44b9dd){if(_0x44b9dd){return _0x154ee2['status'](_0x1b43ba)['json'](_0x44b9dd);}};}function respondWithFilteredResult(_0x2a2a35,_0x30cb9d){return function(_0x45f5e8){if(_0x45f5e8){var _0x104535=_0x45f5e8['count'],_0x999416=_0x30cb9d[_0xe421('0x16')],_0x3d2ee0=_0x30cb9d[_0xe421('0x16')]+_0x30cb9d[_0xe421('0x17')],_0x4ad408;if(_0x3d2ee0>=_0x104535){_0x3d2ee0=_0x104535;_0x4ad408=0xc8;}else{_0x4ad408=0xce;}_0x2a2a35[_0xe421('0x15')](_0x4ad408);return _0x2a2a35[_0xe421('0x18')](_0xe421('0x19'),_0x999416+'-'+_0x3d2ee0+'/'+_0x104535)['json'](_0x45f5e8);}return null;};}function patchUpdates(_0x34ec16){return function(_0x5edb0c){try{jsonpatch[_0xe421('0x1a')](_0x5edb0c,_0x34ec16,!![]);}catch(_0x5f3783){return BPromise['reject'](_0x5f3783);}return _0x5edb0c['save']();};}function saveUpdates(_0x3585ff,_0x35ae51){return function(_0x4f6378){if(_0x4f6378){return _0x4f6378['update'](_0x3585ff)[_0xe421('0x1b')](function(_0x36dc2d){return _0x36dc2d;});}return null;};}function removeEntity(_0x123cab,_0x5a4a7b){return function(_0xa887e1){if(_0xa887e1){return _0xa887e1[_0xe421('0x1c')]()[_0xe421('0x1b')](function(){_0x123cab[_0xe421('0x15')](0xcc)[_0xe421('0x1d')]();});}};}function handleEntityNotFound(_0x111273,_0x5d095c){return function(_0x169754){if(!_0x169754){_0x111273[_0xe421('0x14')](0x194);}return _0x169754;};}function handleError(_0x170198,_0x8bfffa){_0x8bfffa=_0x8bfffa||0x1f4;return function(_0x471eee){logger[_0xe421('0x1e')](_0x471eee[_0xe421('0x1f')]);if(_0x471eee[_0xe421('0x20')]){delete _0x471eee[_0xe421('0x20')];}_0x170198[_0xe421('0x15')](_0x8bfffa)[_0xe421('0x21')](_0x471eee);};}exports[_0xe421('0x22')]=function(_0x2c92b1,_0x1152ac){var _0x36a31e={},_0x31b580={},_0x14fbb6={'count':0x0,'rows':[]};var _0x528e15=db[_0xe421('0x23')]['rawAttributes'];_0x31b580[_0xe421('0x24')]=_[_0xe421('0x25')](_0x528e15);_0x31b580[_0xe421('0x26')]=_[_0xe421('0x25')](_0x2c92b1[_0xe421('0x26')]);_0x31b580[_0xe421('0x27')]=_[_0xe421('0x28')](_0x31b580[_0xe421('0x24')],_0x31b580['query']);_0x36a31e[_0xe421('0x29')]=_[_0xe421('0x28')](_0x31b580['model'],qs[_0xe421('0x2a')](_0x2c92b1[_0xe421('0x26')]['fields']));_0x36a31e[_0xe421('0x29')]=_0x36a31e['attributes']['length']?_0x36a31e[_0xe421('0x29')]:_0x31b580[_0xe421('0x24')];if(!_0x2c92b1[_0xe421('0x26')][_0xe421('0x2b')](_0xe421('0x2c'))){_0x36a31e['limit']=qs[_0xe421('0x17')](_0x2c92b1['query'][_0xe421('0x17')]);_0x36a31e[_0xe421('0x16')]=qs[_0xe421('0x16')](_0x2c92b1[_0xe421('0x26')][_0xe421('0x16')]);}_0x36a31e[_0xe421('0x2d')]=qs[_0xe421('0x2e')](_0x2c92b1[_0xe421('0x26')][_0xe421('0x2e')]);_0x36a31e[_0xe421('0x2f')]=qs[_0xe421('0x27')](_[_0xe421('0x30')](_0x2c92b1['query'],_0x31b580['filters']));if(_0x2c92b1[_0xe421('0x26')][_0xe421('0x31')]){_0x36a31e[_0xe421('0x2f')]=_[_0xe421('0x32')](_0x36a31e['where'],{'$or':_[_0xe421('0x33')](_0x528e15,function(_0x336e3b){if(_0x336e3b[_0xe421('0x34')][_0xe421('0x35')]!==_0xe421('0x36')){var _0x5bd145={};_0x5bd145[_0x336e3b[_0xe421('0x37')]]={'$like':'%'+_0x2c92b1[_0xe421('0x26')][_0xe421('0x31')]+'%'};return _0x5bd145;}})});}_0x36a31e=_['merge']({},_0x36a31e,_0x2c92b1[_0xe421('0x38')]);var _0x3f7c6e={'where':_0x36a31e['where']};return db['SalesforceField'][_0xe421('0x39')](_0x3f7c6e)[_0xe421('0x1b')](function(_0x127f4b){_0x14fbb6[_0xe421('0x39')]=_0x127f4b;if(_0x2c92b1[_0xe421('0x26')][_0xe421('0x3a')]){_0x36a31e[_0xe421('0x3b')]=[{'all':!![]}];}return db[_0xe421('0x23')][_0xe421('0x3c')](_0x36a31e);})[_0xe421('0x1b')](function(_0x2acf75){_0x14fbb6[_0xe421('0x3d')]=_0x2acf75;return _0x14fbb6;})[_0xe421('0x1b')](respondWithFilteredResult(_0x1152ac,_0x36a31e))[_0xe421('0x3e')](handleError(_0x1152ac,null));};exports[_0xe421('0x3f')]=function(_0x1b3cb2,_0x30e53e){var _0x36a88a={'raw':!![],'where':{'id':_0x1b3cb2[_0xe421('0x40')]['id']}},_0x2090f5={};_0x2090f5[_0xe421('0x24')]=_[_0xe421('0x25')](db['SalesforceField']['rawAttributes']);_0x2090f5[_0xe421('0x26')]=_[_0xe421('0x25')](_0x1b3cb2[_0xe421('0x26')]);_0x2090f5[_0xe421('0x27')]=_[_0xe421('0x28')](_0x2090f5[_0xe421('0x24')],_0x2090f5[_0xe421('0x26')]);_0x36a88a[_0xe421('0x29')]=_['intersection'](_0x2090f5[_0xe421('0x24')],qs[_0xe421('0x2a')](_0x1b3cb2[_0xe421('0x26')][_0xe421('0x2a')]));_0x36a88a['attributes']=_0x36a88a[_0xe421('0x29')][_0xe421('0x41')]?_0x36a88a[_0xe421('0x29')]:_0x2090f5[_0xe421('0x24')];if(_0x1b3cb2[_0xe421('0x26')][_0xe421('0x3a')]){_0x36a88a[_0xe421('0x3b')]=[{'all':!![]}];}_0x36a88a=_[_0xe421('0x32')]({},_0x36a88a,_0x1b3cb2[_0xe421('0x38')]);return db[_0xe421('0x23')]['find'](_0x36a88a)[_0xe421('0x1b')](handleEntityNotFound(_0x30e53e,null))[_0xe421('0x1b')](respondWithResult(_0x30e53e,null))[_0xe421('0x3e')](handleError(_0x30e53e,null));};exports[_0xe421('0x42')]=function(_0x3bcc33,_0x3fb601){return db[_0xe421('0x23')][_0xe421('0x42')](_0x3bcc33[_0xe421('0x43')],{})['then'](respondWithResult(_0x3fb601,0xc9))[_0xe421('0x3e')](handleError(_0x3fb601,null));};exports[_0xe421('0x44')]=function(_0x538a36,_0x4d594d){if(_0x538a36[_0xe421('0x43')]['id']){delete _0x538a36[_0xe421('0x43')]['id'];}return db['SalesforceField'][_0xe421('0x45')]({'where':{'id':_0x538a36[_0xe421('0x40')]['id']}})[_0xe421('0x1b')](handleEntityNotFound(_0x4d594d,null))[_0xe421('0x1b')](saveUpdates(_0x538a36[_0xe421('0x43')],null))[_0xe421('0x1b')](respondWithResult(_0x4d594d,null))['catch'](handleError(_0x4d594d,null));};exports[_0xe421('0x1c')]=function(_0x3e2397,_0x2b564e){return db['SalesforceField'][_0xe421('0x45')]({'where':{'id':_0x3e2397[_0xe421('0x40')]['id']}})['then'](handleEntityNotFound(_0x2b564e,null))[_0xe421('0x1b')](removeEntity(_0x2b564e,null))['catch'](handleError(_0x2b564e,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 6fb3511..ffddad5 100644 --- a/server/api/intSalesforceField/intSalesforceField.model.js +++ b/server/api/intSalesforceField/intSalesforceField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47e6=['exports','SalesforceField','int_salesforce_fields','FieldId','util','moment','path','rimraf','../../config/environment'];(function(_0x1505e5,_0x5cc291){var _0x5b1dcd=function(_0x18bfe5){while(--_0x18bfe5){_0x1505e5['push'](_0x1505e5['shift']());}};_0x5b1dcd(++_0x5cc291);}(_0x47e6,0xe5));var _0x647e=function(_0xc9e56c,_0x803795){_0xc9e56c=_0xc9e56c-0x0;var _0x696fa7=_0x47e6[_0xc9e56c];return _0x696fa7;};'use strict';var _=require('lodash');var util=require(_0x647e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x647e('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x647e('0x2'));var rimraf=require(_0x647e('0x3'));var config=require(_0x647e('0x4'));var attributes=require('./intSalesforceField.attributes');module[_0x647e('0x5')]=function(_0x337e6f,_0x21e5ef){return _0x337e6f['define'](_0x647e('0x6'),attributes,{'tableName':_0x647e('0x7'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0x647e('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6068=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SalesforceField','idField','FieldId'];(function(_0xe0fca1,_0xf4e2b){var _0x15b20f=function(_0x227ed3){while(--_0x227ed3){_0xe0fca1['push'](_0xe0fca1['shift']());}};_0x15b20f(++_0xf4e2b);}(_0x6068,0x134));var _0x8606=function(_0x2461ad,_0xaa5161){_0x2461ad=_0x2461ad-0x0;var _0x1e795e=_0x6068[_0x2461ad];return _0x1e795e;};'use strict';var _=require('lodash');var util=require(_0x8606('0x0'));var logger=require(_0x8606('0x1'))(_0x8606('0x2'));var moment=require(_0x8606('0x3'));var BPromise=require(_0x8606('0x4'));var rp=require(_0x8606('0x5'));var fs=require('fs');var path=require(_0x8606('0x6'));var rimraf=require(_0x8606('0x7'));var config=require(_0x8606('0x8'));var attributes=require('./intSalesforceField.attributes');module[_0x8606('0x9')]=function(_0x25341a,_0x2784da){return _0x25341a[_0x8606('0xa')](_0x8606('0xb'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x8606('0xc'),_0x8606('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 4f73959..2893ca5 100644 --- a/server/api/intSalesforceField/intSalesforceField.rpc.js +++ b/server/api/intSalesforceField/intSalesforceField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c00=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x5c00,0x17e));var _0x05c0=function(_0x903e7f,_0x3a8c45){_0x903e7f=_0x903e7f-0x0;var _0x2411f3=_0x5c00[_0x903e7f];return _0x2411f3;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var moment=require(_0x05c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05c0('0x4'))['db'];var utils=require(_0x05c0('0x5'));var logger=require(_0x05c0('0x6'))(_0x05c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x05c0('0x8'));var client=jayson[_0x05c0('0x9')][_0x05c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27dc10,_0x5b9f09,_0x3a3b1b){return new BPromise(function(_0x34eb5f,_0x3ad5b7){return client['request'](_0x27dc10,_0x3a3b1b)[_0x05c0('0xb')](function(_0x32cdfa){logger[_0x05c0('0xc')](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));logger[_0x05c0('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x5b9f09,'request\x20sent',JSON[_0x05c0('0x10')](_0x32cdfa));if(_0x32cdfa['error']){if(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x12')]===0x1f4){logger[_0x05c0('0x11')]('SalesforceField,\x20%s,\x20%s',_0x5b9f09,_0x32cdfa[_0x05c0('0x11')]['message']);return _0x3ad5b7(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);return _0x34eb5f(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}else{logger['info'](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));_0x34eb5f(_0x32cdfa[_0x05c0('0x14')][_0x05c0('0x13')]);}})[_0x05c0('0x15')](function(_0x40153e){logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x40153e);_0x3ad5b7(_0x40153e);});});} \ No newline at end of file +var _0x9bde=['code','message','SalesforceField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x10a5e9,_0x5235be){var _0x284aaa=function(_0xea26a2){while(--_0xea26a2){_0x10a5e9['push'](_0x10a5e9['shift']());}};_0x284aaa(++_0x5235be);}(_0x9bde,0xe1));var _0xe9bd=function(_0x407ffc,_0x1912bf){_0x407ffc=_0x407ffc-0x0;var _0x4dedef=_0x9bde[_0x407ffc];return _0x4dedef;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('SalesforceField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('SalesforceField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('SalesforceField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('SalesforceField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index e330bc1..8090adb 100644 --- a/server/api/intServicenowAccount/index.js +++ b/server/api/intServicenowAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5900=['delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update'];(function(_0x1d6013,_0x4b8e2d){var _0x7b35aa=function(_0x16d5fc){while(--_0x16d5fc){_0x1d6013['push'](_0x1d6013['shift']());}};_0x7b35aa(++_0x4b8e2d);}(_0x5900,0xd2));var _0x0590=function(_0x55bd12,_0x4dbbb9){_0x55bd12=_0x55bd12-0x0;var _0x5990f4=_0x5900[_0x55bd12];return _0x5990f4;};'use strict';var multer=require('multer');var util=require(_0x0590('0x0'));var path=require(_0x0590('0x1'));var timeout=require('connect-timeout');var express=require(_0x0590('0x2'));var router=express[_0x0590('0x3')]();var auth=require(_0x0590('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0590('0x5'));var controller=require(_0x0590('0x6'));router['get']('/',auth[_0x0590('0x7')](),controller[_0x0590('0x8')]);router['get'](_0x0590('0x9'),auth[_0x0590('0x7')](),controller[_0x0590('0xa')]);router[_0x0590('0xb')](_0x0590('0xc'),auth[_0x0590('0x7')](),controller[_0x0590('0xd')]);router[_0x0590('0xb')](_0x0590('0xe'),auth['isAuthenticated'](),controller[_0x0590('0xf')]);router[_0x0590('0x10')]('/',auth['isAuthenticated'](),controller[_0x0590('0x11')]);router[_0x0590('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0590('0x12')]);router['put'](_0x0590('0x9'),auth[_0x0590('0x7')](),controller[_0x0590('0x13')]);router[_0x0590('0x14')](_0x0590('0x9'),auth['isAuthenticated'](),controller[_0x0590('0x15')]);module[_0x0590('0x16')]=router; \ No newline at end of file +var _0x615a=['getConfigurations','/:id/fields','post','create','put','update','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x615a,0x119));var _0xa615=function(_0x163f94,_0x1d0c28){_0x163f94=_0x163f94-0x0;var _0x3a7506=_0x615a[_0x163f94];return _0x3a7506;};'use strict';var multer=require(_0xa615('0x0'));var util=require('util');var path=require(_0xa615('0x1'));var timeout=require('connect-timeout');var express=require(_0xa615('0x2'));var router=express[_0xa615('0x3')]();var auth=require(_0xa615('0x4'));var interaction=require(_0xa615('0x5'));var config=require('../../config/environment');var controller=require(_0xa615('0x6'));router[_0xa615('0x7')]('/',auth['isAuthenticated'](),controller[_0xa615('0x8')]);router['get'](_0xa615('0x9'),auth[_0xa615('0xa')](),controller[_0xa615('0xb')]);router[_0xa615('0x7')](_0xa615('0xc'),auth['isAuthenticated'](),controller[_0xa615('0xd')]);router['get'](_0xa615('0xe'),auth[_0xa615('0xa')](),controller['getFields']);router[_0xa615('0xf')]('/',auth[_0xa615('0xa')](),controller[_0xa615('0x10')]);router[_0xa615('0xf')](_0xa615('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xa615('0x11')]('/:id',auth[_0xa615('0xa')](),controller[_0xa615('0x12')]);router[_0xa615('0x13')](_0xa615('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xa615('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 654fc89..7de8288 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.attributes.js +++ b/server/api/intServicenowAccount/intServicenowAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab8f=['STRING','username','remoteUri'];(function(_0x2cf7c3,_0x2f662f){var _0x17271d=function(_0x517e5f){while(--_0x517e5f){_0x2cf7c3['push'](_0x2cf7c3['shift']());}};_0x17271d(++_0x2f662f);}(_0xab8f,0x10b));var _0xfab8=function(_0x4446a7,_0x107a2b){_0x4446a7=_0x4446a7-0x0;var _0x2b30be=_0xab8f[_0x4446a7];return _0x2b30be;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfab8('0x0')]},'description':{'type':Sequelize[_0xfab8('0x0')]},'username':{'type':Sequelize['STRING'],'unique':_0xfab8('0x1')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xfab8('0x0')]},'remoteUri':{'type':Sequelize[_0xfab8('0x0')],'unique':_0xfab8('0x2')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaf41=['sequelize','exports','STRING','username','remoteUri'];(function(_0x1ee611,_0x377a3a){var _0x3bce0a=function(_0x5357c6){while(--_0x5357c6){_0x1ee611['push'](_0x1ee611['shift']());}};_0x3bce0a(++_0x377a3a);}(_0xaf41,0x1a9));var _0x1af4=function(_0xe8fbbb,_0x14db5b){_0xe8fbbb=_0xe8fbbb-0x0;var _0x4a2b63=_0xaf41[_0xe8fbbb];return _0x4a2b63;};'use strict';var Sequelize=require(_0x1af4('0x0'));module[_0x1af4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1af4('0x2')]},'username':{'type':Sequelize[_0x1af4('0x2')],'unique':_0x1af4('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1af4('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x1af4('0x4')},'serverUrl':{'type':Sequelize[_0x1af4('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 6932b24..81264a9 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.controller.js +++ b/server/api/intServicenowAccount/intServicenowAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x69a2=['caller_id','approval_set','subcategory','short_description','close_code','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','close_notes','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','password','email','remoteUri','slice','lastIndexOf','format','%s/api/now/table/','username','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','True','true','False','GET','inactive','false','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','ServicenowAccount','includeAll','include','findAll','show','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','pick','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','hold_reason','knowledge','notify','incident_state','severity','category','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','closed_at','delivery_plan','impact','active','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','resolved_at'];(function(_0x3efa7f,_0x3d2f6d){var _0x4a80a9=function(_0x192835){while(--_0x192835){_0x3efa7f['push'](_0x3efa7f['shift']());}};_0x4a80a9(++_0x3d2f6d);}(_0x69a2,0x106));var _0x269a=function(_0x5765d3,_0xf2af87){_0x5765d3=_0x5765d3-0x0;var _0x30dcf0=_0x69a2[_0x5765d3];return _0x30dcf0;};'use strict';var pdf=require(_0x269a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x269a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x269a('0x2'));var rp=require(_0x269a('0x3'));var moment=require(_0x269a('0x4'));var BPromise=require(_0x269a('0x5'));var Mustache=require(_0x269a('0x6'));var util=require(_0x269a('0x7'));var path=require(_0x269a('0x8'));var sox=require(_0x269a('0x9'));var csv=require('to-csv');var ejs=require(_0x269a('0xa'));var fs=require('fs');var _=require(_0x269a('0xb'));var squel=require('squel');var crypto=require(_0x269a('0xc'));var jsforce=require(_0x269a('0xd'));var deskjs=require(_0x269a('0xe'));var toCsv=require(_0x269a('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x269a('0x10'));var authService=require(_0x269a('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x269a('0x12'));var logger=require(_0x269a('0x13'))(_0x269a('0x14'));var utils=require(_0x269a('0x15'));var config=require(_0x269a('0x16'));var db=require(_0x269a('0x17'))['db'];var integrations=require(_0x269a('0x18'));var jayson=require(_0x269a('0x19'));var client=jayson[_0x269a('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x4bc32f,_0x33616b,_0x31693b){if(_0x31693b){var _0x28ce8f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28ce8f['test'](_0x33616b)){return _0x4bc32f;}else{throw new Error(_0x269a('0x1b'));}}else{return _0x4bc32f;}}function respondWithRpcPromise(_0x29ba66,_0x50b489,_0x24ee5e,_0x3f7bd8){return new BPromise(function(_0x21cacb,_0x14a518){var _0x346d82=_0x3f7bd8||client;return _0x346d82[_0x269a('0x1c')](_0x29ba66,_0x24ee5e)['then'](function(_0x260858){logger[_0x269a('0x1d')]('ServicenowAccount,\x20%s,\x20%s',_0x50b489,_0x269a('0x1e'));logger['debug'](_0x269a('0x1f'),_0x50b489,'request\x20sent',JSON[_0x269a('0x20')](_0x260858));if(_0x260858[_0x269a('0x21')]){if(_0x260858[_0x269a('0x21')][_0x269a('0x22')]===0x1f4){logger[_0x269a('0x21')](_0x269a('0x23'),_0x50b489,_0x260858['error']['message']);return _0x14a518(_0x260858[_0x269a('0x21')][_0x269a('0x24')]);}logger[_0x269a('0x21')]('ServicenowAccount,\x20%s,\x20%s',_0x50b489,_0x260858[_0x269a('0x21')][_0x269a('0x24')]);return _0x21cacb(_0x260858[_0x269a('0x21')][_0x269a('0x24')]);}else{logger[_0x269a('0x1d')](_0x269a('0x23'),_0x50b489,'request\x20sent');_0x21cacb(_0x260858[_0x269a('0x25')][_0x269a('0x24')]);}})[_0x269a('0x26')](function(_0x1b14cf){logger[_0x269a('0x21')](_0x269a('0x23'),_0x50b489,_0x1b14cf);_0x14a518(_0x1b14cf);});});}function respondWithStatusCode(_0x1c85f8,_0x5d6ea5){_0x5d6ea5=_0x5d6ea5||0xcc;return function(_0x3438c4){if(_0x3438c4){return _0x1c85f8[_0x269a('0x27')](_0x5d6ea5);}return _0x1c85f8[_0x269a('0x28')](_0x5d6ea5)[_0x269a('0x29')]();};}function respondWithResult(_0x1349e9,_0x2c6f20){_0x2c6f20=_0x2c6f20||0xc8;return function(_0x119304){if(_0x119304){return _0x1349e9[_0x269a('0x28')](_0x2c6f20)[_0x269a('0x2a')](_0x119304);}};}function respondWithFilteredResult(_0x27c0d0,_0x242b62){return function(_0x45a550){if(_0x45a550){var _0x3617c8=_0x45a550[_0x269a('0x2b')],_0x17e8b5=_0x242b62[_0x269a('0x2c')],_0x71f27e=_0x242b62[_0x269a('0x2c')]+_0x242b62[_0x269a('0x2d')],_0x1fbb67;if(_0x71f27e>=_0x3617c8){_0x71f27e=_0x3617c8;_0x1fbb67=0xc8;}else{_0x1fbb67=0xce;}_0x27c0d0[_0x269a('0x28')](_0x1fbb67);return _0x27c0d0[_0x269a('0x2e')](_0x269a('0x2f'),_0x17e8b5+'-'+_0x71f27e+'/'+_0x3617c8)[_0x269a('0x2a')](_0x45a550);}return null;};}function patchUpdates(_0x2644a6){return function(_0x57170b){try{jsonpatch[_0x269a('0x30')](_0x57170b,_0x2644a6,!![]);}catch(_0x2e5568){return BPromise[_0x269a('0x31')](_0x2e5568);}return _0x57170b[_0x269a('0x32')]();};}function saveUpdates(_0x3d9a5a,_0xb01200){return function(_0x3b067a){if(_0x3b067a){return _0x3b067a['update'](_0x3d9a5a)[_0x269a('0x33')](function(_0xb085fb){return _0xb085fb;});}return null;};}function removeEntity(_0xe5b90a,_0x4184b7){return function(_0x15d7b5){if(_0x15d7b5){return _0x15d7b5[_0x269a('0x34')]()[_0x269a('0x33')](function(){_0xe5b90a[_0x269a('0x28')](0xcc)[_0x269a('0x29')]();});}};}function handleEntityNotFound(_0x3fdd7c,_0x443dd4){return function(_0x42a67d){if(!_0x42a67d){_0x3fdd7c[_0x269a('0x27')](0x194);}return _0x42a67d;};}function handleError(_0x517575,_0x566f81){_0x566f81=_0x566f81||0x1f4;return function(_0x44fc61){logger[_0x269a('0x21')](_0x44fc61[_0x269a('0x35')]);if(_0x44fc61[_0x269a('0x36')]){delete _0x44fc61['name'];}_0x517575['status'](_0x566f81)[_0x269a('0x37')](_0x44fc61);};}exports[_0x269a('0x38')]=function(_0x813cc0,_0x369c92){var _0x3420a5={},_0x5bc6e9={},_0x2c008e={'count':0x0,'rows':[]};var _0x318ec1=db['ServicenowAccount'][_0x269a('0x39')];_0x5bc6e9[_0x269a('0x3a')]=_[_0x269a('0x3b')](_0x318ec1);_0x5bc6e9[_0x269a('0x3c')]=_[_0x269a('0x3b')](_0x813cc0[_0x269a('0x3c')]);_0x5bc6e9[_0x269a('0x3d')]=_[_0x269a('0x3e')](_0x5bc6e9[_0x269a('0x3a')],_0x5bc6e9[_0x269a('0x3c')]);_0x3420a5['attributes']=_[_0x269a('0x3e')](_0x5bc6e9[_0x269a('0x3a')],qs['fields'](_0x813cc0[_0x269a('0x3c')][_0x269a('0x3f')]));_0x3420a5[_0x269a('0x40')]=_0x3420a5['attributes'][_0x269a('0x41')]?_0x3420a5['attributes']:_0x5bc6e9[_0x269a('0x3a')];if(!_0x813cc0[_0x269a('0x3c')][_0x269a('0x42')]('nolimit')){_0x3420a5[_0x269a('0x2d')]=qs[_0x269a('0x2d')](_0x813cc0[_0x269a('0x3c')][_0x269a('0x2d')]);_0x3420a5[_0x269a('0x2c')]=qs[_0x269a('0x2c')](_0x813cc0[_0x269a('0x3c')][_0x269a('0x2c')]);}_0x3420a5[_0x269a('0x43')]=qs[_0x269a('0x44')](_0x813cc0[_0x269a('0x3c')]['sort']);_0x3420a5[_0x269a('0x45')]=qs[_0x269a('0x3d')](_['pick'](_0x813cc0[_0x269a('0x3c')],_0x5bc6e9[_0x269a('0x3d')]));if(_0x813cc0[_0x269a('0x3c')][_0x269a('0x46')]){_0x3420a5[_0x269a('0x45')]=_[_0x269a('0x47')](_0x3420a5[_0x269a('0x45')],{'$or':_[_0x269a('0x48')](_0x318ec1,function(_0x1ca05c){if(_0x1ca05c[_0x269a('0x49')][_0x269a('0x4a')]!==_0x269a('0x4b')){var _0x4474cb={};_0x4474cb[_0x1ca05c[_0x269a('0x4c')]]={'$like':'%'+_0x813cc0['query'][_0x269a('0x46')]+'%'};return _0x4474cb;}})});}_0x3420a5=_[_0x269a('0x47')]({},_0x3420a5,_0x813cc0[_0x269a('0x4d')]);var _0x2c344b={'where':_0x3420a5[_0x269a('0x45')]};return db[_0x269a('0x4e')][_0x269a('0x2b')](_0x2c344b)[_0x269a('0x33')](function(_0x2c98f0){_0x2c008e['count']=_0x2c98f0;if(_0x813cc0[_0x269a('0x3c')][_0x269a('0x4f')]){_0x3420a5[_0x269a('0x50')]=[{'all':!![]}];}return db[_0x269a('0x4e')][_0x269a('0x51')](_0x3420a5);})[_0x269a('0x33')](function(_0x4951d9){_0x2c008e['rows']=_0x4951d9;return _0x2c008e;})[_0x269a('0x33')](respondWithFilteredResult(_0x369c92,_0x3420a5))['catch'](handleError(_0x369c92,null));};exports[_0x269a('0x52')]=function(_0x23de49,_0x5ba30f){var _0x497677={'raw':![],'where':{'id':_0x23de49['params']['id']}},_0x88ce12={};_0x88ce12['model']=_[_0x269a('0x3b')](db[_0x269a('0x4e')][_0x269a('0x39')]);_0x88ce12[_0x269a('0x3c')]=_['keys'](_0x23de49[_0x269a('0x3c')]);_0x88ce12['filters']=_[_0x269a('0x3e')](_0x88ce12['model'],_0x88ce12[_0x269a('0x3c')]);_0x497677['attributes']=_[_0x269a('0x3e')](_0x88ce12['model'],qs[_0x269a('0x3f')](_0x23de49[_0x269a('0x3c')]['fields']));_0x497677[_0x269a('0x40')]=_0x497677['attributes']['length']?_0x497677[_0x269a('0x40')]:_0x88ce12[_0x269a('0x3a')];if(_0x23de49[_0x269a('0x3c')][_0x269a('0x4f')]){_0x497677[_0x269a('0x50')]=[{'all':!![]}];}_0x497677=_[_0x269a('0x47')]({},_0x497677,_0x23de49[_0x269a('0x4d')]);return db[_0x269a('0x4e')][_0x269a('0x53')](_0x497677)[_0x269a('0x33')](handleEntityNotFound(_0x5ba30f,null))[_0x269a('0x33')](respondWithResult(_0x5ba30f,null))[_0x269a('0x26')](handleError(_0x5ba30f,null));};exports[_0x269a('0x54')]=function(_0x157f55,_0x47ef4f){return db[_0x269a('0x4e')][_0x269a('0x54')](_0x157f55[_0x269a('0x55')],{})[_0x269a('0x33')](respondWithResult(_0x47ef4f,0xc9))[_0x269a('0x26')](handleError(_0x47ef4f,null));};exports['update']=function(_0x25030a,_0x2e90f1){if(_0x25030a[_0x269a('0x55')]['id']){delete _0x25030a[_0x269a('0x55')]['id'];}return db['ServicenowAccount'][_0x269a('0x53')]({'where':{'id':_0x25030a[_0x269a('0x56')]['id']}})[_0x269a('0x33')](handleEntityNotFound(_0x2e90f1,null))[_0x269a('0x33')](saveUpdates(_0x25030a['body'],null))[_0x269a('0x33')](respondWithResult(_0x2e90f1,null))[_0x269a('0x26')](handleError(_0x2e90f1,null));};exports[_0x269a('0x34')]=function(_0x530985,_0x4ffa2a){return db[_0x269a('0x4e')][_0x269a('0x53')]({'where':{'id':_0x530985[_0x269a('0x56')]['id']}})[_0x269a('0x33')](handleEntityNotFound(_0x4ffa2a,null))[_0x269a('0x33')](removeEntity(_0x4ffa2a,null))['catch'](handleError(_0x4ffa2a,null));};exports[_0x269a('0x57')]=function(_0x439342,_0x7a0579,_0x201930){var _0x1d2c06={};var _0x297882={};var _0x39ba75;var _0x29be54;return db[_0x269a('0x4e')][_0x269a('0x58')]({'where':{'id':_0x439342[_0x269a('0x56')]['id']}})[_0x269a('0x33')](handleEntityNotFound(_0x7a0579,null))[_0x269a('0x33')](function(_0x58f844){if(_0x58f844){_0x39ba75=_0x58f844;_0x297882[_0x269a('0x3a')]=_[_0x269a('0x3b')](db[_0x269a('0x59')]['rawAttributes']);_0x297882[_0x269a('0x3c')]=_['keys'](_0x439342[_0x269a('0x3c')]);_0x297882[_0x269a('0x3d')]=_[_0x269a('0x3e')](_0x297882['model'],_0x297882[_0x269a('0x3c')]);_0x1d2c06[_0x269a('0x40')]=_[_0x269a('0x3e')](_0x297882[_0x269a('0x3a')],qs[_0x269a('0x3f')](_0x439342[_0x269a('0x3c')][_0x269a('0x3f')]));_0x1d2c06[_0x269a('0x40')]=_0x1d2c06[_0x269a('0x40')][_0x269a('0x41')]?_0x1d2c06['attributes']:_0x297882['model'];_0x1d2c06[_0x269a('0x43')]=qs[_0x269a('0x44')](_0x439342[_0x269a('0x3c')][_0x269a('0x44')]);_0x1d2c06[_0x269a('0x45')]=qs[_0x269a('0x3d')](_[_0x269a('0x5a')](_0x439342[_0x269a('0x3c')],_0x297882[_0x269a('0x3d')]));if(_0x439342[_0x269a('0x3c')][_0x269a('0x46')]){_0x1d2c06['where']=_[_0x269a('0x47')](_0x1d2c06[_0x269a('0x45')],{'$or':_[_0x269a('0x48')](_0x1d2c06[_0x269a('0x40')],function(_0x3e5800){var _0x506b81={};_0x506b81[_0x3e5800]={'$like':'%'+_0x439342['query'][_0x269a('0x46')]+'%'};return _0x506b81;})});}_0x1d2c06=_[_0x269a('0x47')]({},_0x1d2c06,_0x439342['options']);return _0x39ba75[_0x269a('0x57')](_0x1d2c06);}})[_0x269a('0x33')](function(_0x8f633e){if(_0x8f633e){_0x29be54=_0x8f633e[_0x269a('0x41')];if(!_0x439342['query'][_0x269a('0x42')](_0x269a('0x5b'))){_0x1d2c06[_0x269a('0x2d')]=qs[_0x269a('0x2d')](_0x439342[_0x269a('0x3c')]['limit']);_0x1d2c06[_0x269a('0x2c')]=qs['offset'](_0x439342[_0x269a('0x3c')]['offset']);}return _0x39ba75['getConfigurations'](_0x1d2c06);}})[_0x269a('0x33')](function(_0x436952){if(_0x436952){return _0x436952?{'count':_0x29be54,'rows':_0x436952}:null;}})[_0x269a('0x33')](respondWithResult(_0x7a0579,null))['catch'](handleError(_0x7a0579,null));};exports[_0x269a('0x5c')]=function(_0x99180a,_0x4969d9,_0x203d7b){if(_0x99180a[_0x269a('0x55')]['id']){delete _0x99180a[_0x269a('0x55')]['id'];}return db[_0x269a('0x4e')][_0x269a('0x58')]({'where':{'id':_0x99180a[_0x269a('0x56')]['id']}})[_0x269a('0x33')](handleEntityNotFound(_0x4969d9,null))[_0x269a('0x33')](function(_0x405d55){if(_0x405d55){_0x99180a[_0x269a('0x55')][_0x269a('0x5d')]=_0x405d55['id'];_0x99180a['body'][_0x269a('0x5e')]=integrations['getSubjects'](_0x99180a['body'][_0x269a('0x5f')],_0x99180a[_0x269a('0x55')][_0x269a('0x49')]);_0x99180a['body'][_0x269a('0x60')]=integrations[_0x269a('0x61')](_0x99180a[_0x269a('0x55')][_0x269a('0x5f')],_0x99180a[_0x269a('0x55')]['type']);return db['ServicenowConfiguration'][_0x269a('0x54')](_0x99180a[_0x269a('0x55')],{'include':[{'model':db['ServicenowField'],'as':_0x269a('0x5e')},{'model':db[_0x269a('0x62')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4969d9,null))[_0x269a('0x26')](handleError(_0x4969d9,null));};exports['getFields']=function(_0x32267d,_0x288694,_0x3e16a9){var _0x216c6a=['made_sla',_0x269a('0x63'),_0x269a('0x64'),'subcategory','close_code',_0x269a('0x65'),_0x269a('0x66'),_0x269a('0x67'),_0x269a('0x68')];var _0xaffebd=['parent',_0x269a('0x69'),_0x269a('0x6a'),_0x269a('0x6b'),_0x269a('0x6c'),_0x269a('0x6d'),_0x269a('0x6e'),_0x269a('0x63'),'approval_history',_0x269a('0x6f'),_0x269a('0x70'),_0x269a('0x71'),_0x269a('0x72'),_0x269a('0x73'),_0x269a('0x74'),_0x269a('0x75'),'state',_0x269a('0x76'),_0x269a('0x64'),'order','calendar_stc',_0x269a('0x77'),'cmdb_ci',_0x269a('0x78'),_0x269a('0x79'),_0x269a('0x7a'),'work_notes_list','business_service',_0x269a('0x7b'),_0x269a('0x7c'),_0x269a('0x7d'),_0x269a('0x7e'),_0x269a('0x7f'),_0x269a('0x80'),_0x269a('0x81'),_0x269a('0x82'),'work_end','reopened_time',_0x269a('0x83'),_0x269a('0x84'),_0x269a('0x85'),_0x269a('0x86'),'work_notes',_0x269a('0x87'),_0x269a('0x88'),'correlation_display',_0x269a('0x89'),_0x269a('0x8a'),_0x269a('0x8b'),_0x269a('0x8c'),_0x269a('0x8d'),_0x269a('0x8e'),'calendar_duration',_0x269a('0x65'),'sys_class_name',_0x269a('0x8f'),'closed_by','follow_up',_0x269a('0x90'),_0x269a('0x91'),_0x269a('0x92'),_0x269a('0x93'),'incident_state',_0x269a('0x94'),'problem_id',_0x269a('0x95'),_0x269a('0x96'),_0x269a('0x97'),_0x269a('0x98'),_0x269a('0x67'),_0x269a('0x99'),_0x269a('0x9a'),_0x269a('0x9b'),_0x269a('0x9c'),_0x269a('0x9d'),_0x269a('0x9e'),_0x269a('0x9f'),_0x269a('0xa0'),_0x269a('0xa1'),_0x269a('0xa2'),_0x269a('0xa3'),_0x269a('0xa4'),_0x269a('0x68')];var _0xa5e1ce='';var _0xff8711='';var _0x1bcc38=[];var _0x14a4c0='';var _0x26a940='';var _0x37f498=[];var _0x3f989b='';var _0x2a3b7b='';var _0x3573e5={};var _0x446096='';return db[_0x269a('0x4e')][_0x269a('0x58')]({'where':{'id':_0x32267d[_0x269a('0x56')]['id']},'attributes':['id','username',_0x269a('0xa5'),_0x269a('0xa6'),_0x269a('0xa7'),'serverUrl']})['then'](handleEntityNotFound(_0x288694,null))[_0x269a('0x33')](function(_0x242e0f){if(_0x242e0f){_0x446096=_0x242e0f['remoteUri'];var _0x36c11e=_0x446096[_0x269a('0xa8')](-0x1);if(_0x36c11e==='/'){_0x446096=_0x446096['substring'](0x0,_0x446096[_0x269a('0xa9')](_0x36c11e));}_0x2a3b7b=util['format']('%s/api/now/doc/table/schema/',_0x446096);_0x3f989b=util[_0x269a('0xaa')](_0x269a('0xab'),_0x446096);_0x3573e5={'user':_0x242e0f[_0x269a('0xac')],'pass':_0x242e0f['password']};var _0x5da183={'method':'GET','uri':_0x2a3b7b+_0x269a('0xad'),'auth':_0x3573e5,'json':!![]};return rp(_0x5da183);}})[_0x269a('0x33')](function(_0x229991){if(_0x229991[_0x269a('0x25')][_0x269a('0x41')]>0x0){_0xa5e1ce=_0x229991[_0x269a('0x25')];}console[_0x269a('0xae')](_0x269a('0xaf'),_0xa5e1ce);_0x37f498=[];_0xff8711=Object[_0x269a('0xb0')]([],_0xa5e1ce);_[_0x269a('0xb1')](_0xff8711,function(_0x328537){return!_0x216c6a[_0x269a('0xb2')](_0x328537['name']);});_0xff8711[_0x269a('0xb3')](function(_0x75349c){var _0x6bf444=createFieldObject(_0x3f989b,_0x3573e5,_0x75349c[_0x269a('0xb4')],_0x75349c[_0x269a('0x36')],_0x75349c[_0x269a('0xb5')],![]);_0x37f498[_0x269a('0xb6')](_0x6bf444);});return Promise['all'](_0x37f498);})['then'](function(_0x51bbe0){_0x1bcc38=_0x51bbe0;_0x14a4c0=Object[_0x269a('0xb0')]([],_0xa5e1ce);console['log'](_0x269a('0xb7'),_0xa5e1ce);_[_0x269a('0xb1')](_0x14a4c0,function(_0x39cadb){return _0xaffebd['includes'](_0x39cadb[_0x269a('0x36')]);});console['log'](_0x269a('0xb8'),_0x14a4c0);_0x37f498=[];_0x14a4c0[_0x269a('0xb3')](function(_0x5512a1){var _0x396f05=createFieldObject(_0x3f989b,_0x3573e5,_0x5512a1[_0x269a('0xb4')],_0x5512a1[_0x269a('0x36')],_0x5512a1[_0x269a('0xb5')],!![]);_0x37f498[_0x269a('0xb6')](_0x396f05);});return Promise[_0x269a('0xb9')](_0x37f498);})[_0x269a('0x33')](function(_0x2698dd){_0x26a940=_0x2698dd;var _0x1ab321=_0x1bcc38[_0x269a('0xba')](_0x26a940);return{'count':_0x1ab321[_0x269a('0x41')],'rows':_0x1ab321};})[_0x269a('0x33')](respondWithResult(_0x288694,null))[_0x269a('0x26')](function(_0x802a7){console[_0x269a('0xae')](_0x269a('0xbb')+_0x802a7);var _0x512946=_0x32267d[_0x269a('0x3c')][_0x269a('0xbc')]?0x1f4:_0x802a7['statusCode']||0x1f4;logger[_0x269a('0x21')](_0x802a7[_0x269a('0x35')]);delete _0x802a7[_0x269a('0x36')];if(_0x512946===0x191){_0x512946=0x190;}_0x288694['status'](_0x512946)[_0x269a('0x37')](_0x32267d[_0x269a('0x3c')][_0x269a('0xbc')]?{'message':_0x269a('0xbd'),'statusCode':_0x802a7[_0x269a('0xbe')]}:_0x802a7);});};function createFieldObject(_0x3aec39,_0x5ce116,_0x3c1c06,_0x55e5ef,_0x2db944,_0x9bb880){return new Promise(function(_0x2b66df,_0x7dd186){var _0x5ed993={'id':_0x55e5ef,'name':_0x2db944,'custom':_0x9bb880};if(_0x3c1c06==='boolean'){_0x5ed993[_0x269a('0x4d')]=[{'name':_0x269a('0xbf'),'value':_0x269a('0xc0')},{'name':_0x269a('0xc1'),'value':'false'}];_0x2b66df(_0x5ed993);}else{var _0x19fab8={'method':_0x269a('0xc2'),'uri':_0x3aec39+'sys_choice?sysparm_query=name=incident^element='+_0x55e5ef,'auth':_0x5ce116,'json':!![]};return rp(_0x19fab8)[_0x269a('0x33')](function(_0xf3734c){var _0x28239b=[];if(_0xf3734c[_0x269a('0x25')]['length']>0x0){_0xf3734c[_0x269a('0x25')][_0x269a('0xb3')](function(_0x2c86cf){if(_0x2c86cf[_0x269a('0xc3')]===_0x269a('0xc4')){var _0x2af63f={'name':_0x2c86cf['label'],'value':_0x2c86cf['value']};_0x28239b['push'](_0x2af63f);}});}_0x5ed993[_0x269a('0x4d')]=_0x28239b;if(_0x5ed993[_0x269a('0x4d')]['length']>0x0){_0x2b66df(_0x5ed993);}else{if(_0x9bb880==![]){_0x2b66df();}else{_0x2b66df(_0x5ed993);}}});}});} \ No newline at end of file +var _0x5bba=['result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','destroy','stack','name','send','index','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','field','options','ServicenowAccount','include','findAll','rows','show','params','rawAttributes','includeAll','merge','find','create','body','update','getConfigurations','findOne','ServicenowConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','child_incidents','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','knowledge','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','rfc','expected_start','business_duration','group_list','work_end','resolved_at','caller_id','subcategory','short_description','delivery_task','work_start','assignment_group','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','correlation_id','location','password','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','internalType','label','push','all','includes','forEach','concat','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message'];(function(_0x2b737c,_0x274adf){var _0x466ed5=function(_0x593124){while(--_0x593124){_0x2b737c['push'](_0x2b737c['shift']());}};_0x466ed5(++_0x274adf);}(_0x5bba,0x9b));var _0xa5bb=function(_0x1bcd5b,_0x38f1c6){_0x1bcd5b=_0x1bcd5b-0x0;var _0x465097=_0x5bba[_0x1bcd5b];return _0x465097;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa5bb('0x0'));var rimraf=require(_0xa5bb('0x1'));var zipdir=require(_0xa5bb('0x2'));var jsonpatch=require(_0xa5bb('0x3'));var rp=require('request-promise');var moment=require(_0xa5bb('0x4'));var BPromise=require(_0xa5bb('0x5'));var Mustache=require(_0xa5bb('0x6'));var util=require(_0xa5bb('0x7'));var path=require(_0xa5bb('0x8'));var sox=require(_0xa5bb('0x9'));var csv=require(_0xa5bb('0xa'));var ejs=require(_0xa5bb('0xb'));var fs=require('fs');var _=require(_0xa5bb('0xc'));var squel=require(_0xa5bb('0xd'));var crypto=require(_0xa5bb('0xe'));var jsforce=require(_0xa5bb('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa5bb('0xa'));var querystring=require(_0xa5bb('0x10'));var Papa=require(_0xa5bb('0x11'));var Redis=require(_0xa5bb('0x12'));var authService=require(_0xa5bb('0x13'));var qs=require(_0xa5bb('0x14'));var hardwareService=require(_0xa5bb('0x15'));var logger=require('../../config/logger')(_0xa5bb('0x16'));var utils=require(_0xa5bb('0x17'));var config=require(_0xa5bb('0x18'));var db=require(_0xa5bb('0x19'))['db'];var integrations=require(_0xa5bb('0x1a'));var jayson=require(_0xa5bb('0x1b'));var client=jayson['client'][_0xa5bb('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x706ebe,_0xb5570b,_0x2fcbc3){if(_0x2fcbc3){var _0x7d4d50=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7d4d50[_0xa5bb('0x1d')](_0xb5570b)){return _0x706ebe;}else{throw new Error(_0xa5bb('0x1e'));}}else{return _0x706ebe;}}function respondWithRpcPromise(_0x2126c7,_0x5873b2,_0x18891b,_0x26b42c){return new BPromise(function(_0x4bac0e,_0x6207ce){var _0x260a8f=_0x26b42c||client;return _0x260a8f['request'](_0x2126c7,_0x18891b)[_0xa5bb('0x1f')](function(_0x246191){logger[_0xa5bb('0x20')]('ServicenowAccount,\x20%s,\x20%s',_0x5873b2,'request\x20sent');logger['debug'](_0xa5bb('0x21'),_0x5873b2,_0xa5bb('0x22'),JSON[_0xa5bb('0x23')](_0x246191));if(_0x246191['error']){if(_0x246191[_0xa5bb('0x24')][_0xa5bb('0x25')]===0x1f4){logger[_0xa5bb('0x24')](_0xa5bb('0x26'),_0x5873b2,_0x246191['error'][_0xa5bb('0x27')]);return _0x6207ce(_0x246191[_0xa5bb('0x24')][_0xa5bb('0x27')]);}logger[_0xa5bb('0x24')]('ServicenowAccount,\x20%s,\x20%s',_0x5873b2,_0x246191[_0xa5bb('0x24')]['message']);return _0x4bac0e(_0x246191[_0xa5bb('0x24')][_0xa5bb('0x27')]);}else{logger[_0xa5bb('0x20')](_0xa5bb('0x26'),_0x5873b2,_0xa5bb('0x22'));_0x4bac0e(_0x246191[_0xa5bb('0x28')][_0xa5bb('0x27')]);}})[_0xa5bb('0x29')](function(_0x2d30ef){logger[_0xa5bb('0x24')](_0xa5bb('0x26'),_0x5873b2,_0x2d30ef);_0x6207ce(_0x2d30ef);});});}function respondWithStatusCode(_0x3967f5,_0x598ee2){_0x598ee2=_0x598ee2||0xcc;return function(_0x3ec290){if(_0x3ec290){return _0x3967f5[_0xa5bb('0x2a')](_0x598ee2);}return _0x3967f5[_0xa5bb('0x2b')](_0x598ee2)[_0xa5bb('0x2c')]();};}function respondWithResult(_0x33e33f,_0x4d2e29){_0x4d2e29=_0x4d2e29||0xc8;return function(_0x284ba5){if(_0x284ba5){return _0x33e33f[_0xa5bb('0x2b')](_0x4d2e29)['json'](_0x284ba5);}};}function respondWithFilteredResult(_0x5af286,_0x4e0c3a){return function(_0x54e11d){if(_0x54e11d){var _0x4c965d=_0x54e11d[_0xa5bb('0x2d')],_0x2d0378=_0x4e0c3a[_0xa5bb('0x2e')],_0x36086d=_0x4e0c3a[_0xa5bb('0x2e')]+_0x4e0c3a[_0xa5bb('0x2f')],_0x2d2866;if(_0x36086d>=_0x4c965d){_0x36086d=_0x4c965d;_0x2d2866=0xc8;}else{_0x2d2866=0xce;}_0x5af286[_0xa5bb('0x2b')](_0x2d2866);return _0x5af286[_0xa5bb('0x30')](_0xa5bb('0x31'),_0x2d0378+'-'+_0x36086d+'/'+_0x4c965d)[_0xa5bb('0x32')](_0x54e11d);}return null;};}function patchUpdates(_0x4d4a1c){return function(_0x5b00a6){try{jsonpatch['apply'](_0x5b00a6,_0x4d4a1c,!![]);}catch(_0x12b06e){return BPromise['reject'](_0x12b06e);}return _0x5b00a6[_0xa5bb('0x33')]();};}function saveUpdates(_0x121f4d,_0x4a6f87){return function(_0x216ba2){if(_0x216ba2){return _0x216ba2['update'](_0x121f4d)[_0xa5bb('0x1f')](function(_0x383275){return _0x383275;});}return null;};}function removeEntity(_0x2bcedf,_0x2f5ff4){return function(_0x179b7e){if(_0x179b7e){return _0x179b7e[_0xa5bb('0x34')]()[_0xa5bb('0x1f')](function(){_0x2bcedf['status'](0xcc)[_0xa5bb('0x2c')]();});}};}function handleEntityNotFound(_0x108298,_0x19a8c2){return function(_0x521fe3){if(!_0x521fe3){_0x108298['sendStatus'](0x194);}return _0x521fe3;};}function handleError(_0x483ee9,_0x15c151){_0x15c151=_0x15c151||0x1f4;return function(_0x1f5ecd){logger[_0xa5bb('0x24')](_0x1f5ecd[_0xa5bb('0x35')]);if(_0x1f5ecd[_0xa5bb('0x36')]){delete _0x1f5ecd[_0xa5bb('0x36')];}_0x483ee9[_0xa5bb('0x2b')](_0x15c151)[_0xa5bb('0x37')](_0x1f5ecd);};}exports[_0xa5bb('0x38')]=function(_0x2b9bab,_0x14497e){var _0x133337={},_0x390737={},_0x2d7dbc={'count':0x0,'rows':[]};var _0x3692ef=db['ServicenowAccount']['rawAttributes'];_0x390737[_0xa5bb('0x39')]=_[_0xa5bb('0x3a')](_0x3692ef);_0x390737[_0xa5bb('0x3b')]=_[_0xa5bb('0x3a')](_0x2b9bab[_0xa5bb('0x3b')]);_0x390737[_0xa5bb('0x3c')]=_[_0xa5bb('0x3d')](_0x390737[_0xa5bb('0x39')],_0x390737[_0xa5bb('0x3b')]);_0x133337['attributes']=_[_0xa5bb('0x3d')](_0x390737[_0xa5bb('0x39')],qs[_0xa5bb('0x3e')](_0x2b9bab[_0xa5bb('0x3b')][_0xa5bb('0x3e')]));_0x133337[_0xa5bb('0x3f')]=_0x133337[_0xa5bb('0x3f')][_0xa5bb('0x40')]?_0x133337[_0xa5bb('0x3f')]:_0x390737['model'];if(!_0x2b9bab[_0xa5bb('0x3b')]['hasOwnProperty'](_0xa5bb('0x41'))){_0x133337[_0xa5bb('0x2f')]=qs['limit'](_0x2b9bab[_0xa5bb('0x3b')][_0xa5bb('0x2f')]);_0x133337['offset']=qs[_0xa5bb('0x2e')](_0x2b9bab[_0xa5bb('0x3b')][_0xa5bb('0x2e')]);}_0x133337[_0xa5bb('0x42')]=qs[_0xa5bb('0x43')](_0x2b9bab[_0xa5bb('0x3b')][_0xa5bb('0x43')]);_0x133337[_0xa5bb('0x44')]=qs[_0xa5bb('0x3c')](_[_0xa5bb('0x45')](_0x2b9bab[_0xa5bb('0x3b')],_0x390737[_0xa5bb('0x3c')]));if(_0x2b9bab[_0xa5bb('0x3b')][_0xa5bb('0x46')]){_0x133337['where']=_['merge'](_0x133337[_0xa5bb('0x44')],{'$or':_[_0xa5bb('0x47')](_0x3692ef,function(_0x43b3e5){if(_0x43b3e5[_0xa5bb('0x48')]['key']!==_0xa5bb('0x49')){var _0x1844e6={};_0x1844e6[_0x43b3e5[_0xa5bb('0x4a')]]={'$like':'%'+_0x2b9bab[_0xa5bb('0x3b')][_0xa5bb('0x46')]+'%'};return _0x1844e6;}})});}_0x133337=_['merge']({},_0x133337,_0x2b9bab[_0xa5bb('0x4b')]);var _0x1cb847={'where':_0x133337['where']};return db[_0xa5bb('0x4c')][_0xa5bb('0x2d')](_0x1cb847)[_0xa5bb('0x1f')](function(_0x20e3d6){_0x2d7dbc[_0xa5bb('0x2d')]=_0x20e3d6;if(_0x2b9bab[_0xa5bb('0x3b')]['includeAll']){_0x133337[_0xa5bb('0x4d')]=[{'all':!![]}];}return db[_0xa5bb('0x4c')][_0xa5bb('0x4e')](_0x133337);})[_0xa5bb('0x1f')](function(_0x962849){_0x2d7dbc[_0xa5bb('0x4f')]=_0x962849;return _0x2d7dbc;})['then'](respondWithFilteredResult(_0x14497e,_0x133337))[_0xa5bb('0x29')](handleError(_0x14497e,null));};exports[_0xa5bb('0x50')]=function(_0x18f573,_0x351937){var _0x39354d={'raw':![],'where':{'id':_0x18f573[_0xa5bb('0x51')]['id']}},_0x274195={};_0x274195[_0xa5bb('0x39')]=_['keys'](db['ServicenowAccount'][_0xa5bb('0x52')]);_0x274195[_0xa5bb('0x3b')]=_[_0xa5bb('0x3a')](_0x18f573[_0xa5bb('0x3b')]);_0x274195[_0xa5bb('0x3c')]=_['intersection'](_0x274195[_0xa5bb('0x39')],_0x274195['query']);_0x39354d[_0xa5bb('0x3f')]=_[_0xa5bb('0x3d')](_0x274195[_0xa5bb('0x39')],qs[_0xa5bb('0x3e')](_0x18f573[_0xa5bb('0x3b')][_0xa5bb('0x3e')]));_0x39354d[_0xa5bb('0x3f')]=_0x39354d[_0xa5bb('0x3f')]['length']?_0x39354d[_0xa5bb('0x3f')]:_0x274195[_0xa5bb('0x39')];if(_0x18f573[_0xa5bb('0x3b')][_0xa5bb('0x53')]){_0x39354d['include']=[{'all':!![]}];}_0x39354d=_[_0xa5bb('0x54')]({},_0x39354d,_0x18f573['options']);return db[_0xa5bb('0x4c')][_0xa5bb('0x55')](_0x39354d)[_0xa5bb('0x1f')](handleEntityNotFound(_0x351937,null))[_0xa5bb('0x1f')](respondWithResult(_0x351937,null))[_0xa5bb('0x29')](handleError(_0x351937,null));};exports[_0xa5bb('0x56')]=function(_0x278095,_0x9cdf71){return db[_0xa5bb('0x4c')]['create'](_0x278095[_0xa5bb('0x57')],{})['then'](respondWithResult(_0x9cdf71,0xc9))['catch'](handleError(_0x9cdf71,null));};exports[_0xa5bb('0x58')]=function(_0x3aae2d,_0x460d29){if(_0x3aae2d[_0xa5bb('0x57')]['id']){delete _0x3aae2d[_0xa5bb('0x57')]['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x3aae2d[_0xa5bb('0x51')]['id']}})[_0xa5bb('0x1f')](handleEntityNotFound(_0x460d29,null))['then'](saveUpdates(_0x3aae2d[_0xa5bb('0x57')],null))['then'](respondWithResult(_0x460d29,null))[_0xa5bb('0x29')](handleError(_0x460d29,null));};exports[_0xa5bb('0x34')]=function(_0x26b7d4,_0x1cd55f){return db[_0xa5bb('0x4c')][_0xa5bb('0x55')]({'where':{'id':_0x26b7d4[_0xa5bb('0x51')]['id']}})[_0xa5bb('0x1f')](handleEntityNotFound(_0x1cd55f,null))[_0xa5bb('0x1f')](removeEntity(_0x1cd55f,null))['catch'](handleError(_0x1cd55f,null));};exports[_0xa5bb('0x59')]=function(_0x2b54ab,_0x267a35,_0x5cfcb4){var _0x84d173={};var _0x131247={};var _0x35d58a;var _0x3adba2;return db[_0xa5bb('0x4c')][_0xa5bb('0x5a')]({'where':{'id':_0x2b54ab[_0xa5bb('0x51')]['id']}})['then'](handleEntityNotFound(_0x267a35,null))[_0xa5bb('0x1f')](function(_0x503580){if(_0x503580){_0x35d58a=_0x503580;_0x131247[_0xa5bb('0x39')]=_[_0xa5bb('0x3a')](db[_0xa5bb('0x5b')][_0xa5bb('0x52')]);_0x131247[_0xa5bb('0x3b')]=_[_0xa5bb('0x3a')](_0x2b54ab[_0xa5bb('0x3b')]);_0x131247['filters']=_[_0xa5bb('0x3d')](_0x131247[_0xa5bb('0x39')],_0x131247[_0xa5bb('0x3b')]);_0x84d173[_0xa5bb('0x3f')]=_['intersection'](_0x131247[_0xa5bb('0x39')],qs[_0xa5bb('0x3e')](_0x2b54ab[_0xa5bb('0x3b')][_0xa5bb('0x3e')]));_0x84d173[_0xa5bb('0x3f')]=_0x84d173['attributes'][_0xa5bb('0x40')]?_0x84d173[_0xa5bb('0x3f')]:_0x131247[_0xa5bb('0x39')];_0x84d173['order']=qs[_0xa5bb('0x43')](_0x2b54ab[_0xa5bb('0x3b')][_0xa5bb('0x43')]);_0x84d173[_0xa5bb('0x44')]=qs[_0xa5bb('0x3c')](_['pick'](_0x2b54ab[_0xa5bb('0x3b')],_0x131247[_0xa5bb('0x3c')]));if(_0x2b54ab[_0xa5bb('0x3b')]['filter']){_0x84d173[_0xa5bb('0x44')]=_[_0xa5bb('0x54')](_0x84d173[_0xa5bb('0x44')],{'$or':_[_0xa5bb('0x47')](_0x84d173[_0xa5bb('0x3f')],function(_0x250037){var _0x2e8bdb={};_0x2e8bdb[_0x250037]={'$like':'%'+_0x2b54ab[_0xa5bb('0x3b')][_0xa5bb('0x46')]+'%'};return _0x2e8bdb;})});}_0x84d173=_[_0xa5bb('0x54')]({},_0x84d173,_0x2b54ab[_0xa5bb('0x4b')]);return _0x35d58a[_0xa5bb('0x59')](_0x84d173);}})[_0xa5bb('0x1f')](function(_0x3a1607){if(_0x3a1607){_0x3adba2=_0x3a1607[_0xa5bb('0x40')];if(!_0x2b54ab[_0xa5bb('0x3b')][_0xa5bb('0x5c')](_0xa5bb('0x41'))){_0x84d173['limit']=qs[_0xa5bb('0x2f')](_0x2b54ab[_0xa5bb('0x3b')][_0xa5bb('0x2f')]);_0x84d173[_0xa5bb('0x2e')]=qs['offset'](_0x2b54ab[_0xa5bb('0x3b')][_0xa5bb('0x2e')]);}return _0x35d58a[_0xa5bb('0x59')](_0x84d173);}})[_0xa5bb('0x1f')](function(_0xf5f58){if(_0xf5f58){return _0xf5f58?{'count':_0x3adba2,'rows':_0xf5f58}:null;}})['then'](respondWithResult(_0x267a35,null))['catch'](handleError(_0x267a35,null));};exports[_0xa5bb('0x5d')]=function(_0x433aab,_0x5b631f,_0x35f2a8){if(_0x433aab[_0xa5bb('0x57')]['id']){delete _0x433aab[_0xa5bb('0x57')]['id'];}return db['ServicenowAccount'][_0xa5bb('0x5a')]({'where':{'id':_0x433aab[_0xa5bb('0x51')]['id']}})[_0xa5bb('0x1f')](handleEntityNotFound(_0x5b631f,null))[_0xa5bb('0x1f')](function(_0x522aa6){if(_0x522aa6){_0x433aab['body'][_0xa5bb('0x5e')]=_0x522aa6['id'];_0x433aab[_0xa5bb('0x57')][_0xa5bb('0x5f')]=integrations[_0xa5bb('0x60')](_0x433aab[_0xa5bb('0x57')][_0xa5bb('0x61')],_0x433aab['body'][_0xa5bb('0x48')]);_0x433aab[_0xa5bb('0x57')][_0xa5bb('0x62')]=integrations[_0xa5bb('0x63')](_0x433aab['body'][_0xa5bb('0x61')],_0x433aab['body']['type']);return db[_0xa5bb('0x5b')][_0xa5bb('0x56')](_0x433aab[_0xa5bb('0x57')],{'include':[{'model':db['ServicenowField'],'as':_0xa5bb('0x5f')},{'model':db[_0xa5bb('0x64')],'as':_0xa5bb('0x62')}]});}return null;})[_0xa5bb('0x1f')](respondWithResult(_0x5b631f,null))[_0xa5bb('0x29')](handleError(_0x5b631f,null));};exports['getFields']=function(_0x485cd9,_0x2dcfbf,_0x3b3727){var _0x49bc79=[_0xa5bb('0x65'),_0xa5bb('0x66'),'knowledge','subcategory','close_code',_0xa5bb('0x67'),_0xa5bb('0x68'),_0xa5bb('0x69'),_0xa5bb('0x6a')];var _0x148c47=[_0xa5bb('0x6b'),_0xa5bb('0x65'),_0xa5bb('0x6c'),_0xa5bb('0x6d'),_0xa5bb('0x6e'),'sys_updated_on',_0xa5bb('0x6f'),_0xa5bb('0x66'),'approval_history',_0xa5bb('0x70'),_0xa5bb('0x71'),'sys_updated_by',_0xa5bb('0x72'),_0xa5bb('0x73'),_0xa5bb('0x74'),_0xa5bb('0x75'),_0xa5bb('0x76'),'sys_created_by',_0xa5bb('0x77'),'order','calendar_stc',_0xa5bb('0x78'),_0xa5bb('0x79'),_0xa5bb('0x7a'),'impact',_0xa5bb('0x7b'),_0xa5bb('0x7c'),_0xa5bb('0x7d'),'priority','sys_domain_path',_0xa5bb('0x7e'),'time_worked',_0xa5bb('0x7f'),'opened_at',_0xa5bb('0x80'),_0xa5bb('0x81'),_0xa5bb('0x82'),'reopened_time',_0xa5bb('0x83'),_0xa5bb('0x84'),'approval_set',_0xa5bb('0x85'),'work_notes',_0xa5bb('0x86'),'close_code','correlation_display',_0xa5bb('0x87'),_0xa5bb('0x88'),_0xa5bb('0x89'),'business_stc',_0xa5bb('0x8a'),'description',_0xa5bb('0x8b'),_0xa5bb('0x67'),_0xa5bb('0x8c'),_0xa5bb('0x8d'),_0xa5bb('0x8e'),_0xa5bb('0x8f'),_0xa5bb('0x90'),'sys_id','contact_type',_0xa5bb('0x91'),'incident_state',_0xa5bb('0x92'),_0xa5bb('0x93'),_0xa5bb('0x94'),_0xa5bb('0x95'),_0xa5bb('0x96'),_0xa5bb('0x97'),'severity',_0xa5bb('0x98'),_0xa5bb('0x99'),_0xa5bb('0x9a'),_0xa5bb('0x9b'),_0xa5bb('0x9c'),'sys_mod_count',_0xa5bb('0x9d'),_0xa5bb('0x9e'),_0xa5bb('0x9f'),'upon_approval',_0xa5bb('0xa0'),_0xa5bb('0xa1'),_0xa5bb('0x6a')];var _0x5043b2='';var _0x3a9e7b='';var _0x80d157=[];var _0x91f1bb='';var _0x3aee0d='';var _0x175762=[];var _0x524649='';var _0xa9b96a='';var _0x1d05cd={};var _0x365a7e='';return db[_0xa5bb('0x4c')][_0xa5bb('0x5a')]({'where':{'id':_0x485cd9[_0xa5bb('0x51')]['id']},'attributes':['id','username',_0xa5bb('0xa2'),'email',_0xa5bb('0xa3'),_0xa5bb('0xa4')]})[_0xa5bb('0x1f')](handleEntityNotFound(_0x2dcfbf,null))[_0xa5bb('0x1f')](function(_0xe883ff){if(_0xe883ff){_0x365a7e=_0xe883ff[_0xa5bb('0xa3')];var _0x37cf52=_0x365a7e[_0xa5bb('0xa5')](-0x1);if(_0x37cf52==='/'){_0x365a7e=_0x365a7e[_0xa5bb('0xa6')](0x0,_0x365a7e[_0xa5bb('0xa7')](_0x37cf52));}_0xa9b96a=util['format'](_0xa5bb('0xa8'),_0x365a7e);_0x524649=util['format'](_0xa5bb('0xa9'),_0x365a7e);_0x1d05cd={'user':_0xe883ff[_0xa5bb('0xaa')],'pass':_0xe883ff[_0xa5bb('0xa2')]};var _0x252989={'method':_0xa5bb('0xab'),'uri':_0xa9b96a+_0xa5bb('0xac'),'auth':_0x1d05cd,'json':!![]};return rp(_0x252989);}})[_0xa5bb('0x1f')](function(_0x5aaa16){if(_0x5aaa16[_0xa5bb('0x28')]['length']>0x0){_0x5043b2=_0x5aaa16[_0xa5bb('0x28')];}console[_0xa5bb('0xad')](_0xa5bb('0xae'),_0x5043b2);_0x175762=[];_0x3a9e7b=Object[_0xa5bb('0xaf')]([],_0x5043b2);_[_0xa5bb('0xb0')](_0x3a9e7b,function(_0x3a6498){return!_0x49bc79['includes'](_0x3a6498[_0xa5bb('0x36')]);});_0x3a9e7b['forEach'](function(_0x829732){var _0x3ee500=createFieldObject(_0x524649,_0x1d05cd,_0x829732[_0xa5bb('0xb1')],_0x829732[_0xa5bb('0x36')],_0x829732[_0xa5bb('0xb2')],![]);_0x175762[_0xa5bb('0xb3')](_0x3ee500);});return Promise[_0xa5bb('0xb4')](_0x175762);})[_0xa5bb('0x1f')](function(_0x5a7f4b){_0x80d157=_0x5a7f4b;_0x91f1bb=Object[_0xa5bb('0xaf')]([],_0x5043b2);console[_0xa5bb('0xad')]('TCL:\x20_object',_0x5043b2);_[_0xa5bb('0xb0')](_0x91f1bb,function(_0x4cabfa){return _0x148c47[_0xa5bb('0xb5')](_0x4cabfa['name']);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x91f1bb);_0x175762=[];_0x91f1bb[_0xa5bb('0xb6')](function(_0xcdbd6d){var _0x574b1e=createFieldObject(_0x524649,_0x1d05cd,_0xcdbd6d[_0xa5bb('0xb1')],_0xcdbd6d[_0xa5bb('0x36')],_0xcdbd6d[_0xa5bb('0xb2')],!![]);_0x175762[_0xa5bb('0xb3')](_0x574b1e);});return Promise[_0xa5bb('0xb4')](_0x175762);})[_0xa5bb('0x1f')](function(_0x314949){_0x3aee0d=_0x314949;var _0x1a981d=_0x80d157[_0xa5bb('0xb7')](_0x3aee0d);return{'count':_0x1a981d['length'],'rows':_0x1a981d};})[_0xa5bb('0x1f')](respondWithResult(_0x2dcfbf,null))[_0xa5bb('0x29')](function(_0x49535d){console[_0xa5bb('0xad')](_0xa5bb('0xb8')+_0x49535d);var _0xf01a08=_0x485cd9[_0xa5bb('0x3b')]['test']?0x1f4:_0x49535d[_0xa5bb('0xb9')]||0x1f4;logger[_0xa5bb('0x24')](_0x49535d[_0xa5bb('0x35')]);delete _0x49535d['name'];if(_0xf01a08===0x191){_0xf01a08=0x190;}_0x2dcfbf[_0xa5bb('0x2b')](_0xf01a08)[_0xa5bb('0x37')](_0x485cd9['query'][_0xa5bb('0x1d')]?{'message':_0xa5bb('0xba'),'statusCode':_0x49535d[_0xa5bb('0xb9')]}:_0x49535d);});};function createFieldObject(_0x5ad58e,_0x370210,_0x24da43,_0x4d66da,_0x5123b8,_0x424136){return new Promise(function(_0x44969e,_0x564209){var _0xa377ea={'id':_0x4d66da,'name':_0x5123b8,'custom':_0x424136};if(_0x24da43===_0xa5bb('0xbb')){_0xa377ea[_0xa5bb('0x4b')]=[{'name':_0xa5bb('0xbc'),'value':_0xa5bb('0xbd')},{'name':_0xa5bb('0xbe'),'value':_0xa5bb('0xbf')}];_0x44969e(_0xa377ea);}else{var _0x10aa3b={'method':_0xa5bb('0xab'),'uri':_0x5ad58e+_0xa5bb('0xc0')+_0x4d66da,'auth':_0x370210,'json':!![]};return rp(_0x10aa3b)[_0xa5bb('0x1f')](function(_0x56b7af){var _0x483bba=[];if(_0x56b7af[_0xa5bb('0x28')][_0xa5bb('0x40')]>0x0){_0x56b7af['result']['forEach'](function(_0x23e74d){if(_0x23e74d[_0xa5bb('0xc1')]===_0xa5bb('0xbf')){var _0x6b9083={'name':_0x23e74d['label'],'value':_0x23e74d[_0xa5bb('0xc2')]};_0x483bba[_0xa5bb('0xb3')](_0x6b9083);}});}_0xa377ea[_0xa5bb('0x4b')]=_0x483bba;if(_0xa377ea[_0xa5bb('0x4b')][_0xa5bb('0x40')]>0x0){_0x44969e(_0xa377ea);}else{if(_0x424136==![]){_0x44969e();}else{_0x44969e(_0xa377ea);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 62be0e6..48779ec 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.model.js +++ b/server/api/intServicenowAccount/intServicenowAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['api','moment','bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','../../config/logger'];(function(_0x164ef5,_0xba6238){var _0x2d60c5=function(_0x34deca){while(--_0x34deca){_0x164ef5['push'](_0x164ef5['shift']());}};_0x2d60c5(++_0xba6238);}(_0x1cb9,0x14e));var _0x91cb=function(_0xd659af,_0x4ffab6){_0xd659af=_0xd659af-0x0;var _0x28ee95=_0x1cb9[_0xd659af];return _0x28ee95;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));var integrations=require(_0x91cb('0x8'));module[_0x91cb('0x9')]=function(_0x28543e,_0x3b9d98){return _0x28543e[_0x91cb('0xa')]('ServicenowAccount',attributes,{'tableName':_0x91cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd59=['bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment'];(function(_0x32fc14,_0x20cd7b){var _0x434767=function(_0x572e14){while(--_0x572e14){_0x32fc14['push'](_0x32fc14['shift']());}};_0x434767(++_0x20cd7b);}(_0xcd59,0x14b));var _0x9cd5=function(_0x293a6b,_0x3b9ede){_0x293a6b=_0x293a6b-0x0;var _0x2d371c=_0xcd59[_0x293a6b];return _0x2d371c;};'use strict';var _=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var logger=require(_0x9cd5('0x2'))(_0x9cd5('0x3'));var moment=require(_0x9cd5('0x4'));var BPromise=require(_0x9cd5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cd5('0x6'));var rimraf=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var attributes=require(_0x9cd5('0x9'));var integrations=require(_0x9cd5('0xa'));module[_0x9cd5('0xb')]=function(_0x46277c,_0x2cd19a){return _0x46277c[_0x9cd5('0xc')](_0x9cd5('0xd'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index bed7ecc..c842f59 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.rpc.js +++ b/server/api/intServicenowAccount/intServicenowAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1608=['../../mysqldb','../../config/logger','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','attributes','limit','include','model','map','ShowServicenowAccount','find','where','stringify','util','randomstring','ioredis'];(function(_0x19e950,_0x2d4134){var _0x3b3b6f=function(_0x4f6f3d){while(--_0x4f6f3d){_0x19e950['push'](_0x19e950['shift']());}};_0x3b3b6f(++_0x2d4134);}(_0x1608,0x1ed));var _0x8160=function(_0x2380ce,_0xed627){_0x2380ce=_0x2380ce-0x0;var _0x1d91dd=_0x1608[_0x2380ce];return _0x1d91dd;};'use strict';var _=require('lodash');var util=require(_0x8160('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8160('0x1'));var fs=require('fs');var Redis=require(_0x8160('0x2'));var db=require(_0x8160('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8160('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8160('0x5')][_0x8160('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x27e580,_0x78bff,_0x4c0921){return new BPromise(function(_0x2c0880,_0x2c4cd2){return client['request'](_0x27e580,_0x4c0921)[_0x8160('0x7')](function(_0x44a1bd){logger[_0x8160('0x8')](_0x8160('0x9'),_0x78bff,'request\x20sent');logger[_0x8160('0xa')](_0x8160('0xb'),_0x78bff,_0x8160('0xc'),JSON['stringify'](_0x44a1bd));if(_0x44a1bd[_0x8160('0xd')]){if(_0x44a1bd[_0x8160('0xd')][_0x8160('0xe')]===0x1f4){logger[_0x8160('0xd')](_0x8160('0x9'),_0x78bff,_0x44a1bd[_0x8160('0xd')][_0x8160('0xf')]);return _0x2c4cd2(_0x44a1bd[_0x8160('0xd')][_0x8160('0xf')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x78bff,_0x44a1bd[_0x8160('0xd')][_0x8160('0xf')]);return _0x2c0880(_0x44a1bd[_0x8160('0xd')][_0x8160('0xf')]);}else{logger[_0x8160('0x8')](_0x8160('0x9'),_0x78bff,_0x8160('0xc'));_0x2c0880(_0x44a1bd[_0x8160('0x10')][_0x8160('0xf')]);}})[_0x8160('0x11')](function(_0x38099e){logger[_0x8160('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x78bff,_0x38099e);_0x2c4cd2(_0x38099e);});});}exports[_0x8160('0x12')]=function(_0x59a649){var _0xe5b9d3=this;return new Promise(function(_0x39cc32,_0x3eae63){return db[_0x8160('0x13')]['findAll']({'raw':_0x59a649[_0x8160('0x14')]?_0x59a649[_0x8160('0x14')][_0x8160('0x15')]===undefined?!![]:![]:!![],'where':_0x59a649[_0x8160('0x14')]?_0x59a649[_0x8160('0x14')]['where']||null:null,'attributes':_0x59a649[_0x8160('0x14')]?_0x59a649[_0x8160('0x14')][_0x8160('0x16')]||null:null,'limit':_0x59a649[_0x8160('0x14')]?_0x59a649[_0x8160('0x14')][_0x8160('0x17')]||null:null,'include':_0x59a649['options']?_0x59a649['options']['include']?_['map'](_0x59a649[_0x8160('0x14')][_0x8160('0x18')],function(_0x395141){return{'model':db[_0x395141[_0x8160('0x19')]],'as':_0x395141['as'],'attributes':_0x395141[_0x8160('0x16')],'include':_0x395141[_0x8160('0x18')]?_['map'](_0x395141['include'],function(_0x1596bd){return{'model':db[_0x1596bd[_0x8160('0x19')]],'as':_0x1596bd['as'],'attributes':_0x1596bd[_0x8160('0x16')],'include':_0x1596bd['include']?_[_0x8160('0x1a')](_0x1596bd[_0x8160('0x18')],function(_0x477182){return{'model':db[_0x477182[_0x8160('0x19')]],'as':_0x477182['as'],'attributes':_0x477182[_0x8160('0x16')]};}):[]};}):[]};}):[]:[]})[_0x8160('0x7')](function(_0x5b13ac){logger[_0x8160('0x8')](_0x8160('0x12'),_0x59a649);logger['debug']('GetServicenowAccount',_0x59a649,JSON['stringify'](_0x5b13ac));_0x39cc32(_0x5b13ac);})[_0x8160('0x11')](function(_0x24055e){logger[_0x8160('0xd')](_0x8160('0x12'),_0x24055e[_0x8160('0xf')],_0x59a649);_0x3eae63(_0xe5b9d3[_0x8160('0xd')](0x1f4,_0x24055e['message']));});});};exports[_0x8160('0x1b')]=function(_0x1c14b0){var _0x1d3fe8=this;return new Promise(function(_0x503855,_0x5ce142){return db[_0x8160('0x13')][_0x8160('0x1c')]({'raw':_0x1c14b0['options']?_0x1c14b0[_0x8160('0x14')][_0x8160('0x15')]===undefined?!![]:![]:!![],'where':_0x1c14b0[_0x8160('0x14')]?_0x1c14b0[_0x8160('0x14')][_0x8160('0x1d')]||null:null,'attributes':_0x1c14b0['options']?_0x1c14b0[_0x8160('0x14')][_0x8160('0x16')]||null:null,'include':_0x1c14b0[_0x8160('0x14')]?_0x1c14b0[_0x8160('0x14')][_0x8160('0x18')]?_[_0x8160('0x1a')](_0x1c14b0[_0x8160('0x14')][_0x8160('0x18')],function(_0x47bdbe){return{'model':db[_0x47bdbe['model']],'as':_0x47bdbe['as'],'attributes':_0x47bdbe[_0x8160('0x16')],'include':_0x47bdbe[_0x8160('0x18')]?_['map'](_0x47bdbe[_0x8160('0x18')],function(_0x2d918f){return{'model':db[_0x2d918f[_0x8160('0x19')]],'as':_0x2d918f['as'],'attributes':_0x2d918f[_0x8160('0x16')],'include':_0x2d918f[_0x8160('0x18')]?_[_0x8160('0x1a')](_0x2d918f['include'],function(_0x498410){return{'model':db[_0x498410[_0x8160('0x19')]],'as':_0x498410['as'],'attributes':_0x498410[_0x8160('0x16')]};}):[]};}):[]};}):[]:[]})[_0x8160('0x7')](function(_0x449377){logger[_0x8160('0x8')](_0x8160('0x1b'),_0x1c14b0);logger[_0x8160('0xa')](_0x8160('0x1b'),_0x1c14b0,JSON[_0x8160('0x1e')](_0x449377));_0x503855(_0x449377);})[_0x8160('0x11')](function(_0x499dab){logger[_0x8160('0xd')](_0x8160('0x1b'),_0x499dab[_0x8160('0xf')],_0x1c14b0);_0x5ce142(_0x1d3fe8['error'](0x1f4,_0x499dab[_0x8160('0xf')]));});});}; \ No newline at end of file +var _0xccd9=['info','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','include','map','model','ShowServicenowAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x338334,_0x3c48a4){var _0x247637=function(_0x5d6016){while(--_0x5d6016){_0x338334['push'](_0x338334['shift']());}};_0x247637(++_0x3c48a4);}(_0xccd9,0xb3));var _0x9ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9ccd('0x0'));var util=require('util');var moment=require(_0x9ccd('0x1'));var BPromise=require(_0x9ccd('0x2'));var rs=require(_0x9ccd('0x3'));var fs=require('fs');var Redis=require(_0x9ccd('0x4'));var db=require(_0x9ccd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ccd('0x6'))(_0x9ccd('0x7'));var config=require('../../config/environment');var jayson=require(_0x9ccd('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x481692,_0xa7e6e0,_0x766620){return new BPromise(function(_0x25b34c,_0x363ba1){return client[_0x9ccd('0x9')](_0x481692,_0x766620)[_0x9ccd('0xa')](function(_0x575394){logger['info'](_0x9ccd('0xb'),_0xa7e6e0,'request\x20sent');logger[_0x9ccd('0xc')](_0x9ccd('0xd'),_0xa7e6e0,_0x9ccd('0xe'),JSON[_0x9ccd('0xf')](_0x575394));if(_0x575394[_0x9ccd('0x10')]){if(_0x575394[_0x9ccd('0x10')][_0x9ccd('0x11')]===0x1f4){logger[_0x9ccd('0x10')](_0x9ccd('0xb'),_0xa7e6e0,_0x575394['error'][_0x9ccd('0x12')]);return _0x363ba1(_0x575394[_0x9ccd('0x10')][_0x9ccd('0x12')]);}logger[_0x9ccd('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0xa7e6e0,_0x575394[_0x9ccd('0x10')][_0x9ccd('0x12')]);return _0x25b34c(_0x575394[_0x9ccd('0x10')][_0x9ccd('0x12')]);}else{logger[_0x9ccd('0x13')](_0x9ccd('0xb'),_0xa7e6e0,'request\x20sent');_0x25b34c(_0x575394[_0x9ccd('0x14')][_0x9ccd('0x12')]);}})[_0x9ccd('0x15')](function(_0x2cc95f){logger[_0x9ccd('0x10')](_0x9ccd('0xb'),_0xa7e6e0,_0x2cc95f);_0x363ba1(_0x2cc95f);});});}exports[_0x9ccd('0x16')]=function(_0x3d03e5){var _0x59ca39=this;return new Promise(function(_0x4db61b,_0x2fd269){return db[_0x9ccd('0x17')]['findAll']({'raw':_0x3d03e5[_0x9ccd('0x18')]?_0x3d03e5[_0x9ccd('0x18')][_0x9ccd('0x19')]===undefined?!![]:![]:!![],'where':_0x3d03e5[_0x9ccd('0x18')]?_0x3d03e5[_0x9ccd('0x18')][_0x9ccd('0x1a')]||null:null,'attributes':_0x3d03e5[_0x9ccd('0x18')]?_0x3d03e5[_0x9ccd('0x18')][_0x9ccd('0x1b')]||null:null,'limit':_0x3d03e5[_0x9ccd('0x18')]?_0x3d03e5[_0x9ccd('0x18')]['limit']||null:null,'include':_0x3d03e5[_0x9ccd('0x18')]?_0x3d03e5[_0x9ccd('0x18')][_0x9ccd('0x1c')]?_[_0x9ccd('0x1d')](_0x3d03e5[_0x9ccd('0x18')][_0x9ccd('0x1c')],function(_0x5d224b){return{'model':db[_0x5d224b['model']],'as':_0x5d224b['as'],'attributes':_0x5d224b['attributes'],'include':_0x5d224b['include']?_[_0x9ccd('0x1d')](_0x5d224b[_0x9ccd('0x1c')],function(_0x3c1455){return{'model':db[_0x3c1455[_0x9ccd('0x1e')]],'as':_0x3c1455['as'],'attributes':_0x3c1455[_0x9ccd('0x1b')],'include':_0x3c1455[_0x9ccd('0x1c')]?_[_0x9ccd('0x1d')](_0x3c1455[_0x9ccd('0x1c')],function(_0xf2769d){return{'model':db[_0xf2769d['model']],'as':_0xf2769d['as'],'attributes':_0xf2769d[_0x9ccd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9ccd('0xa')](function(_0x289777){logger[_0x9ccd('0x13')](_0x9ccd('0x16'),_0x3d03e5);logger[_0x9ccd('0xc')](_0x9ccd('0x16'),_0x3d03e5,JSON[_0x9ccd('0xf')](_0x289777));_0x4db61b(_0x289777);})[_0x9ccd('0x15')](function(_0x5aec4f){logger[_0x9ccd('0x10')](_0x9ccd('0x16'),_0x5aec4f[_0x9ccd('0x12')],_0x3d03e5);_0x2fd269(_0x59ca39['error'](0x1f4,_0x5aec4f['message']));});});};exports[_0x9ccd('0x1f')]=function(_0x418028){var _0xf7ac53=this;return new Promise(function(_0x12fa4c,_0x368a24){return db[_0x9ccd('0x17')][_0x9ccd('0x20')]({'raw':_0x418028[_0x9ccd('0x18')]?_0x418028[_0x9ccd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x418028[_0x9ccd('0x18')]?_0x418028[_0x9ccd('0x18')][_0x9ccd('0x1a')]||null:null,'attributes':_0x418028[_0x9ccd('0x18')]?_0x418028['options'][_0x9ccd('0x1b')]||null:null,'include':_0x418028[_0x9ccd('0x18')]?_0x418028[_0x9ccd('0x18')]['include']?_[_0x9ccd('0x1d')](_0x418028['options']['include'],function(_0x3ed8f3){return{'model':db[_0x3ed8f3['model']],'as':_0x3ed8f3['as'],'attributes':_0x3ed8f3[_0x9ccd('0x1b')],'include':_0x3ed8f3['include']?_['map'](_0x3ed8f3[_0x9ccd('0x1c')],function(_0xd97146){return{'model':db[_0xd97146['model']],'as':_0xd97146['as'],'attributes':_0xd97146[_0x9ccd('0x1b')],'include':_0xd97146[_0x9ccd('0x1c')]?_[_0x9ccd('0x1d')](_0xd97146[_0x9ccd('0x1c')],function(_0x3b1324){return{'model':db[_0x3b1324[_0x9ccd('0x1e')]],'as':_0x3b1324['as'],'attributes':_0x3b1324['attributes']};}):[]};}):[]};}):[]:[]})[_0x9ccd('0xa')](function(_0x15e0a4){logger[_0x9ccd('0x13')]('ShowServicenowAccount',_0x418028);logger[_0x9ccd('0xc')](_0x9ccd('0x1f'),_0x418028,JSON[_0x9ccd('0xf')](_0x15e0a4));_0x12fa4c(_0x15e0a4);})[_0x9ccd('0x15')](function(_0x1482cd){logger[_0x9ccd('0x10')](_0x9ccd('0x1f'),_0x1482cd[_0x9ccd('0x12')],_0x418028);_0x368a24(_0xf7ac53[_0x9ccd('0x10')](0x1f4,_0x1482cd['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index ebf58a9..024814b 100644 --- a/server/api/intServicenowConfiguration/index.js +++ b/server/api/intServicenowConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x751e=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','isAuthenticated','getSubjects','getDescriptions','post','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0x9e708d,_0x31a917){var _0x399fb2=function(_0x1b5228){while(--_0x1b5228){_0x9e708d['push'](_0x9e708d['shift']());}};_0x399fb2(++_0x31a917);}(_0x751e,0x13f));var _0xe751=function(_0x3f3eec,_0x1dd43f){_0x3f3eec=_0x3f3eec-0x0;var _0x53ca01=_0x751e[_0x3f3eec];return _0x53ca01;};'use strict';var multer=require(_0xe751('0x0'));var util=require(_0xe751('0x1'));var path=require('path');var timeout=require(_0xe751('0x2'));var express=require(_0xe751('0x3'));var router=express['Router']();var auth=require(_0xe751('0x4'));var interaction=require(_0xe751('0x5'));var config=require(_0xe751('0x6'));var controller=require(_0xe751('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe751('0x8')]);router[_0xe751('0x9')](_0xe751('0xa'),auth['isAuthenticated'](),controller[_0xe751('0xb')]);router[_0xe751('0x9')](_0xe751('0xc'),auth['isAuthenticated'](),controller[_0xe751('0xd')]);router[_0xe751('0x9')](_0xe751('0xe'),auth[_0xe751('0xf')](),controller[_0xe751('0x10')]);router[_0xe751('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe751('0x11')]);router[_0xe751('0x12')]('/',auth[_0xe751('0xf')](),controller['create']);router[_0xe751('0x13')]('/:id',auth[_0xe751('0xf')](),controller[_0xe751('0x14')]);router['delete'](_0xe751('0xa'),auth[_0xe751('0xf')](),controller[_0xe751('0x15')]);module[_0xe751('0x16')]=router; \ No newline at end of file +var _0x1ee9=['destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/descriptions','getDescriptions','post','create','put','update','delete'];(function(_0xf3a2b5,_0x3a103b){var _0x201d0f=function(_0x547ac3){while(--_0x547ac3){_0xf3a2b5['push'](_0xf3a2b5['shift']());}};_0x201d0f(++_0x3a103b);}(_0x1ee9,0xd4));var _0x91ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ee9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x91ee('0x0'));var util=require(_0x91ee('0x1'));var path=require(_0x91ee('0x2'));var timeout=require('connect-timeout');var express=require(_0x91ee('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x91ee('0x4'));var config=require(_0x91ee('0x5'));var controller=require('./intServicenowConfiguration.controller');router[_0x91ee('0x6')]('/',auth[_0x91ee('0x7')](),controller[_0x91ee('0x8')]);router[_0x91ee('0x6')](_0x91ee('0x9'),auth[_0x91ee('0x7')](),controller[_0x91ee('0xa')]);router['get'](_0x91ee('0xb'),auth[_0x91ee('0x7')](),controller['getFields']);router[_0x91ee('0x6')]('/:id/subjects',auth[_0x91ee('0x7')](),controller['getSubjects']);router['get'](_0x91ee('0xc'),auth[_0x91ee('0x7')](),controller[_0x91ee('0xd')]);router[_0x91ee('0xe')]('/',auth[_0x91ee('0x7')](),controller[_0x91ee('0xf')]);router[_0x91ee('0x10')](_0x91ee('0x9'),auth[_0x91ee('0x7')](),controller[_0x91ee('0x11')]);router[_0x91ee('0x12')](_0x91ee('0x9'),auth['isAuthenticated'](),controller[_0x91ee('0x13')]);module[_0x91ee('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 46de9a7..ff85626 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc06=['STRING','exports'];(function(_0x375072,_0x1ad2ed){var _0x3e82e7=function(_0x2a03ec){while(--_0x2a03ec){_0x375072['push'](_0x375072['shift']());}};_0x3e82e7(++_0x1ad2ed);}(_0xcc06,0x1cd));var _0x6cc0=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xcc06[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require('sequelize');module[_0x6cc0('0x0')]={'name':{'type':Sequelize[_0x6cc0('0x1')]},'description':{'type':Sequelize[_0x6cc0('0x1')]}}; \ No newline at end of file +var _0x2a95=['STRING','sequelize','exports'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x2a95,0x121));var _0x52a9=function(_0x1cf930,_0x31ce7e){_0x1cf930=_0x1cf930-0x0;var _0xa0b3c4=_0x2a95[_0x1cf930];return _0xa0b3c4;};'use strict';var Sequelize=require(_0x52a9('0x0'));module[_0x52a9('0x1')]={'name':{'type':Sequelize[_0x52a9('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 4e0748c..cd331a9 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5eb4=['test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','sendStatus','stack','name','index','rawAttributes','model','keys','query','filters','attributes','intersection','length','nolimit','order','sort','pick','filter','where','map','type','key','field','merge','options','ServicenowConfiguration','includeAll','include','findAll','rows','show','params','fields','find','create','body','getFields','findOne','ServicenowField','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','http'];(function(_0x15fab0,_0x416c7d){var _0x1b41a8=function(_0x30d165){while(--_0x30d165){_0x15fab0['push'](_0x15fab0['shift']());}};_0x1b41a8(++_0x416c7d);}(_0x5eb4,0x149));var _0x45eb=function(_0x179a60,_0x4eeb8a){_0x179a60=_0x179a60-0x0;var _0x5106a5=_0x5eb4[_0x179a60];return _0x5106a5;};'use strict';var pdf=require(_0x45eb('0x0'));var emlformat=require(_0x45eb('0x1'));var rimraf=require(_0x45eb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x45eb('0x3'));var rp=require('request-promise');var moment=require(_0x45eb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x45eb('0x5'));var util=require(_0x45eb('0x6'));var path=require(_0x45eb('0x7'));var sox=require(_0x45eb('0x8'));var csv=require(_0x45eb('0x9'));var ejs=require(_0x45eb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x45eb('0xb'));var crypto=require(_0x45eb('0xc'));var jsforce=require(_0x45eb('0xd'));var deskjs=require(_0x45eb('0xe'));var toCsv=require(_0x45eb('0x9'));var querystring=require(_0x45eb('0xf'));var Papa=require('papaparse');var Redis=require(_0x45eb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x45eb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x45eb('0x12'))('api');var utils=require(_0x45eb('0x13'));var config=require('../../config/environment');var db=require(_0x45eb('0x14'))['db'];var jayson=require(_0x45eb('0x15'));var client=jayson['client'][_0x45eb('0x16')]({'port':0x232a});function checkPasswordPattern(_0x24feaa,_0x1d636f,_0x305c27){if(_0x305c27){var _0x4ca9bd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ca9bd[_0x45eb('0x17')](_0x1d636f)){return _0x24feaa;}else{throw new Error(_0x45eb('0x18'));}}else{return _0x24feaa;}}function respondWithRpcPromise(_0x51445c,_0x43d6c7,_0x4cd2b0,_0x8182f1){return new BPromise(function(_0x340f22,_0x6c5052){var _0x35d88b=_0x8182f1||client;return _0x35d88b[_0x45eb('0x19')](_0x51445c,_0x4cd2b0)['then'](function(_0x1af619){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x43d6c7,'request\x20sent');logger[_0x45eb('0x1a')](_0x45eb('0x1b'),_0x43d6c7,_0x45eb('0x1c'),JSON[_0x45eb('0x1d')](_0x1af619));if(_0x1af619[_0x45eb('0x1e')]){if(_0x1af619[_0x45eb('0x1e')]['code']===0x1f4){logger[_0x45eb('0x1e')](_0x45eb('0x1f'),_0x43d6c7,_0x1af619[_0x45eb('0x1e')][_0x45eb('0x20')]);return _0x6c5052(_0x1af619[_0x45eb('0x1e')]['message']);}logger[_0x45eb('0x1e')](_0x45eb('0x1f'),_0x43d6c7,_0x1af619['error'][_0x45eb('0x20')]);return _0x340f22(_0x1af619['error'][_0x45eb('0x20')]);}else{logger[_0x45eb('0x21')]('ServicenowConfiguration,\x20%s,\x20%s',_0x43d6c7,_0x45eb('0x1c'));_0x340f22(_0x1af619[_0x45eb('0x22')][_0x45eb('0x20')]);}})[_0x45eb('0x23')](function(_0x2d9314){logger[_0x45eb('0x1e')](_0x45eb('0x1f'),_0x43d6c7,_0x2d9314);_0x6c5052(_0x2d9314);});});}function respondWithStatusCode(_0x4bca1e,_0x4353f9){_0x4353f9=_0x4353f9||0xcc;return function(_0x53eead){if(_0x53eead){return _0x4bca1e['sendStatus'](_0x4353f9);}return _0x4bca1e[_0x45eb('0x24')](_0x4353f9)[_0x45eb('0x25')]();};}function respondWithResult(_0x55b829,_0x4781d6){_0x4781d6=_0x4781d6||0xc8;return function(_0x26b9f2){if(_0x26b9f2){return _0x55b829[_0x45eb('0x24')](_0x4781d6)[_0x45eb('0x26')](_0x26b9f2);}};}function respondWithFilteredResult(_0x40ff11,_0xdf7103){return function(_0x2f8808){if(_0x2f8808){var _0x367dc4=_0x2f8808[_0x45eb('0x27')],_0x4dea61=_0xdf7103[_0x45eb('0x28')],_0x5df96f=_0xdf7103['offset']+_0xdf7103[_0x45eb('0x29')],_0x26b0c2;if(_0x5df96f>=_0x367dc4){_0x5df96f=_0x367dc4;_0x26b0c2=0xc8;}else{_0x26b0c2=0xce;}_0x40ff11['status'](_0x26b0c2);return _0x40ff11['set'](_0x45eb('0x2a'),_0x4dea61+'-'+_0x5df96f+'/'+_0x367dc4)[_0x45eb('0x26')](_0x2f8808);}return null;};}function patchUpdates(_0x85c9d){return function(_0x2d4ff0){try{jsonpatch[_0x45eb('0x2b')](_0x2d4ff0,_0x85c9d,!![]);}catch(_0xe67764){return BPromise[_0x45eb('0x2c')](_0xe67764);}return _0x2d4ff0[_0x45eb('0x2d')]();};}function saveUpdates(_0x47aade,_0xefec46){return function(_0x475ebd){if(_0x475ebd){return _0x475ebd['update'](_0x47aade)[_0x45eb('0x2e')](function(_0x25fc2c){return _0x25fc2c;});}return null;};}function removeEntity(_0x353aae,_0x3dee25){return function(_0x38f594){if(_0x38f594){return _0x38f594['destroy']()[_0x45eb('0x2e')](function(){_0x353aae['status'](0xcc)[_0x45eb('0x25')]();});}};}function handleEntityNotFound(_0xfaf621,_0x2d5d5b){return function(_0x2cd930){if(!_0x2cd930){_0xfaf621[_0x45eb('0x2f')](0x194);}return _0x2cd930;};}function handleError(_0x1d3c8c,_0x2e4267){_0x2e4267=_0x2e4267||0x1f4;return function(_0x502250){logger['error'](_0x502250[_0x45eb('0x30')]);if(_0x502250[_0x45eb('0x31')]){delete _0x502250['name'];}_0x1d3c8c[_0x45eb('0x24')](_0x2e4267)['send'](_0x502250);};}exports[_0x45eb('0x32')]=function(_0x373477,_0x202425){var _0x4de040={},_0x11680a={},_0x548ac4={'count':0x0,'rows':[]};var _0x39d2e3=db['ServicenowConfiguration'][_0x45eb('0x33')];_0x11680a[_0x45eb('0x34')]=_[_0x45eb('0x35')](_0x39d2e3);_0x11680a['query']=_[_0x45eb('0x35')](_0x373477[_0x45eb('0x36')]);_0x11680a[_0x45eb('0x37')]=_['intersection'](_0x11680a['model'],_0x11680a[_0x45eb('0x36')]);_0x4de040[_0x45eb('0x38')]=_[_0x45eb('0x39')](_0x11680a[_0x45eb('0x34')],qs['fields'](_0x373477['query']['fields']));_0x4de040[_0x45eb('0x38')]=_0x4de040[_0x45eb('0x38')][_0x45eb('0x3a')]?_0x4de040[_0x45eb('0x38')]:_0x11680a[_0x45eb('0x34')];if(!_0x373477[_0x45eb('0x36')]['hasOwnProperty'](_0x45eb('0x3b'))){_0x4de040['limit']=qs[_0x45eb('0x29')](_0x373477[_0x45eb('0x36')][_0x45eb('0x29')]);_0x4de040[_0x45eb('0x28')]=qs[_0x45eb('0x28')](_0x373477['query'][_0x45eb('0x28')]);}_0x4de040[_0x45eb('0x3c')]=qs[_0x45eb('0x3d')](_0x373477[_0x45eb('0x36')]['sort']);_0x4de040['where']=qs['filters'](_[_0x45eb('0x3e')](_0x373477[_0x45eb('0x36')],_0x11680a[_0x45eb('0x37')]));if(_0x373477[_0x45eb('0x36')][_0x45eb('0x3f')]){_0x4de040[_0x45eb('0x40')]=_['merge'](_0x4de040[_0x45eb('0x40')],{'$or':_[_0x45eb('0x41')](_0x39d2e3,function(_0x134117){if(_0x134117[_0x45eb('0x42')][_0x45eb('0x43')]!=='VIRTUAL'){var _0x520642={};_0x520642[_0x134117[_0x45eb('0x44')]]={'$like':'%'+_0x373477['query'][_0x45eb('0x3f')]+'%'};return _0x520642;}})});}_0x4de040=_[_0x45eb('0x45')]({},_0x4de040,_0x373477[_0x45eb('0x46')]);var _0x401b43={'where':_0x4de040[_0x45eb('0x40')]};return db[_0x45eb('0x47')][_0x45eb('0x27')](_0x401b43)['then'](function(_0x18aaa6){_0x548ac4['count']=_0x18aaa6;if(_0x373477[_0x45eb('0x36')][_0x45eb('0x48')]){_0x4de040[_0x45eb('0x49')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x45eb('0x4a')](_0x4de040);})[_0x45eb('0x2e')](function(_0x3e8ea2){_0x548ac4[_0x45eb('0x4b')]=_0x3e8ea2;return _0x548ac4;})[_0x45eb('0x2e')](respondWithFilteredResult(_0x202425,_0x4de040))[_0x45eb('0x23')](handleError(_0x202425,null));};exports[_0x45eb('0x4c')]=function(_0x55d51b,_0x4ff69e){var _0x1e7842={'raw':![],'where':{'id':_0x55d51b[_0x45eb('0x4d')]['id']}},_0x33daa8={};_0x33daa8[_0x45eb('0x34')]=_['keys'](db[_0x45eb('0x47')][_0x45eb('0x33')]);_0x33daa8['query']=_['keys'](_0x55d51b[_0x45eb('0x36')]);_0x33daa8['filters']=_[_0x45eb('0x39')](_0x33daa8[_0x45eb('0x34')],_0x33daa8[_0x45eb('0x36')]);_0x1e7842[_0x45eb('0x38')]=_['intersection'](_0x33daa8[_0x45eb('0x34')],qs[_0x45eb('0x4e')](_0x55d51b['query'][_0x45eb('0x4e')]));_0x1e7842[_0x45eb('0x38')]=_0x1e7842[_0x45eb('0x38')][_0x45eb('0x3a')]?_0x1e7842[_0x45eb('0x38')]:_0x33daa8[_0x45eb('0x34')];if(_0x55d51b[_0x45eb('0x36')][_0x45eb('0x48')]){_0x1e7842['include']=[{'all':!![]}];}_0x1e7842=_[_0x45eb('0x45')]({},_0x1e7842,_0x55d51b[_0x45eb('0x46')]);return db[_0x45eb('0x47')][_0x45eb('0x4f')](_0x1e7842)[_0x45eb('0x2e')](handleEntityNotFound(_0x4ff69e,null))[_0x45eb('0x2e')](respondWithResult(_0x4ff69e,null))[_0x45eb('0x23')](handleError(_0x4ff69e,null));};exports[_0x45eb('0x50')]=function(_0x12545e,_0x282934){return db[_0x45eb('0x47')][_0x45eb('0x50')](_0x12545e[_0x45eb('0x51')],{})['then'](respondWithResult(_0x282934,0xc9))[_0x45eb('0x23')](handleError(_0x282934,null));};exports['update']=function(_0x1d7c54,_0x23927f){if(_0x1d7c54['body']['id']){delete _0x1d7c54[_0x45eb('0x51')]['id'];}return db[_0x45eb('0x47')][_0x45eb('0x4f')]({'where':{'id':_0x1d7c54[_0x45eb('0x4d')]['id']}})[_0x45eb('0x2e')](handleEntityNotFound(_0x23927f,null))[_0x45eb('0x2e')](saveUpdates(_0x1d7c54[_0x45eb('0x51')],null))[_0x45eb('0x2e')](respondWithResult(_0x23927f,null))[_0x45eb('0x23')](handleError(_0x23927f,null));};exports['destroy']=function(_0xff3e61,_0x1342bc){return db[_0x45eb('0x47')][_0x45eb('0x4f')]({'where':{'id':_0xff3e61['params']['id']}})[_0x45eb('0x2e')](handleEntityNotFound(_0x1342bc,null))[_0x45eb('0x2e')](removeEntity(_0x1342bc,null))[_0x45eb('0x23')](handleError(_0x1342bc,null));};exports[_0x45eb('0x52')]=function(_0x1279a1,_0xea30f5,_0x555c6f){var _0x2d4463={};var _0x56bea4={};var _0x2bf301;var _0x132ed4;return db[_0x45eb('0x47')][_0x45eb('0x53')]({'where':{'id':_0x1279a1[_0x45eb('0x4d')]['id']}})['then'](handleEntityNotFound(_0xea30f5,null))[_0x45eb('0x2e')](function(_0x2ec0cd){if(_0x2ec0cd){_0x2bf301=_0x2ec0cd;_0x56bea4[_0x45eb('0x34')]=_[_0x45eb('0x35')](db[_0x45eb('0x54')][_0x45eb('0x33')]);_0x56bea4[_0x45eb('0x36')]=_[_0x45eb('0x35')](_0x1279a1['query']);_0x56bea4[_0x45eb('0x37')]=_[_0x45eb('0x39')](_0x56bea4[_0x45eb('0x34')],_0x56bea4[_0x45eb('0x36')]);_0x2d4463['attributes']=_['intersection'](_0x56bea4[_0x45eb('0x34')],qs[_0x45eb('0x4e')](_0x1279a1[_0x45eb('0x36')]['fields']));_0x2d4463[_0x45eb('0x38')]=_0x2d4463['attributes'][_0x45eb('0x3a')]?_0x2d4463[_0x45eb('0x38')]:_0x56bea4[_0x45eb('0x34')];_0x2d4463[_0x45eb('0x3c')]=qs[_0x45eb('0x3d')](_0x1279a1[_0x45eb('0x36')]['sort']);_0x2d4463[_0x45eb('0x40')]=qs[_0x45eb('0x37')](_[_0x45eb('0x3e')](_0x1279a1['query'],_0x56bea4['filters']));if(_0x1279a1[_0x45eb('0x36')][_0x45eb('0x3f')]){_0x2d4463[_0x45eb('0x40')]=_[_0x45eb('0x45')](_0x2d4463[_0x45eb('0x40')],{'$or':_[_0x45eb('0x41')](_0x2d4463[_0x45eb('0x38')],function(_0x5a8162){var _0x2d31fd={};_0x2d31fd[_0x5a8162]={'$like':'%'+_0x1279a1['query'][_0x45eb('0x3f')]+'%'};return _0x2d31fd;})});}_0x2d4463=_['merge']({},_0x2d4463,_0x1279a1[_0x45eb('0x46')]);return _0x2bf301[_0x45eb('0x52')](_0x2d4463);}})[_0x45eb('0x2e')](function(_0xd4e51f){if(_0xd4e51f){_0x132ed4=_0xd4e51f[_0x45eb('0x3a')];if(!_0x1279a1[_0x45eb('0x36')][_0x45eb('0x55')](_0x45eb('0x3b'))){_0x2d4463[_0x45eb('0x29')]=qs['limit'](_0x1279a1[_0x45eb('0x36')]['limit']);_0x2d4463['offset']=qs['offset'](_0x1279a1[_0x45eb('0x36')][_0x45eb('0x28')]);}return _0x2bf301['getFields'](_0x2d4463);}})[_0x45eb('0x2e')](function(_0x7619b4){if(_0x7619b4){return _0x7619b4?{'count':_0x132ed4,'rows':_0x7619b4}:null;}})[_0x45eb('0x2e')](respondWithResult(_0xea30f5,null))[_0x45eb('0x23')](handleError(_0xea30f5,null));};exports[_0x45eb('0x56')]=function(_0x546fd7,_0x9759d7,_0x53da56){var _0x103fba={};var _0x1adb53={};var _0x83d028;var _0x26a059;return db[_0x45eb('0x47')][_0x45eb('0x53')]({'where':{'id':_0x546fd7[_0x45eb('0x4d')]['id']}})[_0x45eb('0x2e')](handleEntityNotFound(_0x9759d7,null))['then'](function(_0x127f74){if(_0x127f74){_0x83d028=_0x127f74;_0x1adb53[_0x45eb('0x34')]=_[_0x45eb('0x35')](db[_0x45eb('0x54')][_0x45eb('0x33')]);_0x1adb53['query']=_[_0x45eb('0x35')](_0x546fd7['query']);_0x1adb53[_0x45eb('0x37')]=_[_0x45eb('0x39')](_0x1adb53['model'],_0x1adb53[_0x45eb('0x36')]);_0x103fba[_0x45eb('0x38')]=_[_0x45eb('0x39')](_0x1adb53[_0x45eb('0x34')],qs[_0x45eb('0x4e')](_0x546fd7[_0x45eb('0x36')][_0x45eb('0x4e')]));_0x103fba[_0x45eb('0x38')]=_0x103fba[_0x45eb('0x38')][_0x45eb('0x3a')]?_0x103fba[_0x45eb('0x38')]:_0x1adb53[_0x45eb('0x34')];_0x103fba[_0x45eb('0x3c')]=qs[_0x45eb('0x3d')](_0x546fd7['query']['sort']);_0x103fba['where']=qs[_0x45eb('0x37')](_['pick'](_0x546fd7[_0x45eb('0x36')],_0x1adb53[_0x45eb('0x37')]));if(_0x546fd7['query'][_0x45eb('0x3f')]){_0x103fba['where']=_[_0x45eb('0x45')](_0x103fba[_0x45eb('0x40')],{'$or':_[_0x45eb('0x41')](_0x103fba[_0x45eb('0x38')],function(_0x5aae9f){var _0xd3222c={};_0xd3222c[_0x5aae9f]={'$like':'%'+_0x546fd7[_0x45eb('0x36')][_0x45eb('0x3f')]+'%'};return _0xd3222c;})});}_0x103fba=_['merge']({},_0x103fba,_0x546fd7[_0x45eb('0x46')]);return _0x83d028[_0x45eb('0x56')](_0x103fba);}})['then'](function(_0x32eab6){if(_0x32eab6){_0x26a059=_0x32eab6['length'];if(!_0x546fd7[_0x45eb('0x36')]['hasOwnProperty'](_0x45eb('0x3b'))){_0x103fba['limit']=qs['limit'](_0x546fd7['query']['limit']);_0x103fba[_0x45eb('0x28')]=qs['offset'](_0x546fd7[_0x45eb('0x36')][_0x45eb('0x28')]);}return _0x83d028[_0x45eb('0x56')](_0x103fba);}})[_0x45eb('0x2e')](function(_0x196238){if(_0x196238){return _0x196238?{'count':_0x26a059,'rows':_0x196238}:null;}})[_0x45eb('0x2e')](respondWithResult(_0x9759d7,null))[_0x45eb('0x23')](handleError(_0x9759d7,null));};exports[_0x45eb('0x57')]=function(_0x2b2fa2,_0x31474f,_0x4667d8){var _0x315b0={};var _0x3cd82a={};var _0x5125b3;var _0x5a5857;return db[_0x45eb('0x47')][_0x45eb('0x53')]({'where':{'id':_0x2b2fa2[_0x45eb('0x4d')]['id']}})[_0x45eb('0x2e')](handleEntityNotFound(_0x31474f,null))[_0x45eb('0x2e')](function(_0x48cc6b){if(_0x48cc6b){_0x5125b3=_0x48cc6b;_0x3cd82a[_0x45eb('0x34')]=_[_0x45eb('0x35')](db['ServicenowField']['rawAttributes']);_0x3cd82a[_0x45eb('0x36')]=_['keys'](_0x2b2fa2[_0x45eb('0x36')]);_0x3cd82a[_0x45eb('0x37')]=_[_0x45eb('0x39')](_0x3cd82a[_0x45eb('0x34')],_0x3cd82a[_0x45eb('0x36')]);_0x315b0[_0x45eb('0x38')]=_[_0x45eb('0x39')](_0x3cd82a[_0x45eb('0x34')],qs[_0x45eb('0x4e')](_0x2b2fa2[_0x45eb('0x36')][_0x45eb('0x4e')]));_0x315b0['attributes']=_0x315b0[_0x45eb('0x38')]['length']?_0x315b0[_0x45eb('0x38')]:_0x3cd82a['model'];_0x315b0[_0x45eb('0x3c')]=qs[_0x45eb('0x3d')](_0x2b2fa2[_0x45eb('0x36')]['sort']);_0x315b0[_0x45eb('0x40')]=qs[_0x45eb('0x37')](_[_0x45eb('0x3e')](_0x2b2fa2[_0x45eb('0x36')],_0x3cd82a[_0x45eb('0x37')]));if(_0x2b2fa2[_0x45eb('0x36')][_0x45eb('0x3f')]){_0x315b0[_0x45eb('0x40')]=_[_0x45eb('0x45')](_0x315b0['where'],{'$or':_['map'](_0x315b0[_0x45eb('0x38')],function(_0x52a308){var _0x577d58={};_0x577d58[_0x52a308]={'$like':'%'+_0x2b2fa2[_0x45eb('0x36')][_0x45eb('0x3f')]+'%'};return _0x577d58;})});}_0x315b0=_['merge']({},_0x315b0,_0x2b2fa2[_0x45eb('0x46')]);return _0x5125b3[_0x45eb('0x57')](_0x315b0);}})[_0x45eb('0x2e')](function(_0x14bcb2){if(_0x14bcb2){_0x5a5857=_0x14bcb2['length'];if(!_0x2b2fa2[_0x45eb('0x36')]['hasOwnProperty']('nolimit')){_0x315b0[_0x45eb('0x29')]=qs[_0x45eb('0x29')](_0x2b2fa2[_0x45eb('0x36')]['limit']);_0x315b0[_0x45eb('0x28')]=qs[_0x45eb('0x28')](_0x2b2fa2['query'][_0x45eb('0x28')]);}return _0x5125b3[_0x45eb('0x57')](_0x315b0);}})['then'](function(_0x2280c8){if(_0x2280c8){return _0x2280c8?{'count':_0x5a5857,'rows':_0x2280c8}:null;}})[_0x45eb('0x2e')](respondWithResult(_0x31474f,null))['catch'](handleError(_0x31474f,null));}; \ No newline at end of file +var _0x050f=['status','end','json','offset','set','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','ServicenowConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','show','create','body','find','params','getFields','findOne','ServicenowField','length','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x2e8f46,_0x152ad2){var _0x3523e7=function(_0x1db5d0){while(--_0x1db5d0){_0x2e8f46['push'](_0x2e8f46['shift']());}};_0x3523e7(++_0x152ad2);}(_0x050f,0x191));var _0xf050=function(_0x3e9809,_0x5574ff){_0x3e9809=_0x3e9809-0x0;var _0x209966=_0x050f[_0x3e9809];return _0x209966;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf050('0x0'));var rimraf=require(_0xf050('0x1'));var zipdir=require(_0xf050('0x2'));var jsonpatch=require(_0xf050('0x3'));var rp=require(_0xf050('0x4'));var moment=require('moment');var BPromise=require(_0xf050('0x5'));var Mustache=require(_0xf050('0x6'));var util=require(_0xf050('0x7'));var path=require('path');var sox=require(_0xf050('0x8'));var csv=require(_0xf050('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf050('0xa'));var crypto=require('crypto');var jsforce=require(_0xf050('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf050('0x9'));var querystring=require(_0xf050('0xc'));var Papa=require(_0xf050('0xd'));var Redis=require('ioredis');var authService=require(_0xf050('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf050('0xf'));var logger=require(_0xf050('0x10'))(_0xf050('0x11'));var utils=require(_0xf050('0x12'));var config=require(_0xf050('0x13'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xf050('0x14')]['http']({'port':0x232a});function checkPasswordPattern(_0x440927,_0x299ebe,_0x4ad6e8){if(_0x4ad6e8){var _0x38f980=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x38f980[_0xf050('0x15')](_0x299ebe)){return _0x440927;}else{throw new Error(_0xf050('0x16'));}}else{return _0x440927;}}function respondWithRpcPromise(_0x4f5c16,_0x467d31,_0x20e82a,_0x2aff1c){return new BPromise(function(_0x32fe34,_0x1dec32){var _0x55f20a=_0x2aff1c||client;return _0x55f20a[_0xf050('0x17')](_0x4f5c16,_0x20e82a)[_0xf050('0x18')](function(_0x22c312){logger[_0xf050('0x19')](_0xf050('0x1a'),_0x467d31,_0xf050('0x1b'));logger[_0xf050('0x1c')](_0xf050('0x1d'),_0x467d31,_0xf050('0x1b'),JSON['stringify'](_0x22c312));if(_0x22c312[_0xf050('0x1e')]){if(_0x22c312['error'][_0xf050('0x1f')]===0x1f4){logger['error'](_0xf050('0x1a'),_0x467d31,_0x22c312[_0xf050('0x1e')][_0xf050('0x20')]);return _0x1dec32(_0x22c312[_0xf050('0x1e')][_0xf050('0x20')]);}logger[_0xf050('0x1e')](_0xf050('0x1a'),_0x467d31,_0x22c312[_0xf050('0x1e')][_0xf050('0x20')]);return _0x32fe34(_0x22c312['error'][_0xf050('0x20')]);}else{logger[_0xf050('0x19')]('ServicenowConfiguration,\x20%s,\x20%s',_0x467d31,_0xf050('0x1b'));_0x32fe34(_0x22c312['result']['message']);}})[_0xf050('0x21')](function(_0x1a835d){logger[_0xf050('0x1e')](_0xf050('0x1a'),_0x467d31,_0x1a835d);_0x1dec32(_0x1a835d);});});}function respondWithStatusCode(_0x38353b,_0x4eb9d0){_0x4eb9d0=_0x4eb9d0||0xcc;return function(_0x48c661){if(_0x48c661){return _0x38353b['sendStatus'](_0x4eb9d0);}return _0x38353b[_0xf050('0x22')](_0x4eb9d0)[_0xf050('0x23')]();};}function respondWithResult(_0x16b39d,_0x17677d){_0x17677d=_0x17677d||0xc8;return function(_0x4a7c56){if(_0x4a7c56){return _0x16b39d[_0xf050('0x22')](_0x17677d)[_0xf050('0x24')](_0x4a7c56);}};}function respondWithFilteredResult(_0x3ef697,_0x43eab5){return function(_0x4ff396){if(_0x4ff396){var _0x33ed7d=_0x4ff396['count'],_0x3e74be=_0x43eab5[_0xf050('0x25')],_0xe34de4=_0x43eab5[_0xf050('0x25')]+_0x43eab5['limit'],_0x57432b;if(_0xe34de4>=_0x33ed7d){_0xe34de4=_0x33ed7d;_0x57432b=0xc8;}else{_0x57432b=0xce;}_0x3ef697['status'](_0x57432b);return _0x3ef697[_0xf050('0x26')]('Content-Range',_0x3e74be+'-'+_0xe34de4+'/'+_0x33ed7d)[_0xf050('0x24')](_0x4ff396);}return null;};}function patchUpdates(_0x40c2ad){return function(_0x4822d8){try{jsonpatch[_0xf050('0x27')](_0x4822d8,_0x40c2ad,!![]);}catch(_0x4d34fb){return BPromise[_0xf050('0x28')](_0x4d34fb);}return _0x4822d8[_0xf050('0x29')]();};}function saveUpdates(_0x3f87fd,_0x4dfc84){return function(_0x58ede0){if(_0x58ede0){return _0x58ede0[_0xf050('0x2a')](_0x3f87fd)['then'](function(_0x5dc4b4){return _0x5dc4b4;});}return null;};}function removeEntity(_0x12a37b,_0xaf3f8e){return function(_0x1327f2){if(_0x1327f2){return _0x1327f2[_0xf050('0x2b')]()[_0xf050('0x18')](function(){_0x12a37b[_0xf050('0x22')](0xcc)[_0xf050('0x23')]();});}};}function handleEntityNotFound(_0x12fcfc,_0x4b968c){return function(_0x145dda){if(!_0x145dda){_0x12fcfc[_0xf050('0x2c')](0x194);}return _0x145dda;};}function handleError(_0x440982,_0x1146af){_0x1146af=_0x1146af||0x1f4;return function(_0xe02097){logger['error'](_0xe02097[_0xf050('0x2d')]);if(_0xe02097[_0xf050('0x2e')]){delete _0xe02097[_0xf050('0x2e')];}_0x440982[_0xf050('0x22')](_0x1146af)[_0xf050('0x2f')](_0xe02097);};}exports[_0xf050('0x30')]=function(_0x472473,_0x1a3d6a){var _0x481236={},_0x4eedec={},_0x16d970={'count':0x0,'rows':[]};var _0x156264=db[_0xf050('0x31')][_0xf050('0x32')];_0x4eedec[_0xf050('0x33')]=_[_0xf050('0x34')](_0x156264);_0x4eedec[_0xf050('0x35')]=_[_0xf050('0x34')](_0x472473['query']);_0x4eedec[_0xf050('0x36')]=_[_0xf050('0x37')](_0x4eedec['model'],_0x4eedec['query']);_0x481236[_0xf050('0x38')]=_['intersection'](_0x4eedec['model'],qs[_0xf050('0x39')](_0x472473[_0xf050('0x35')][_0xf050('0x39')]));_0x481236[_0xf050('0x38')]=_0x481236[_0xf050('0x38')]['length']?_0x481236[_0xf050('0x38')]:_0x4eedec[_0xf050('0x33')];if(!_0x472473['query']['hasOwnProperty'](_0xf050('0x3a'))){_0x481236[_0xf050('0x3b')]=qs[_0xf050('0x3b')](_0x472473[_0xf050('0x35')][_0xf050('0x3b')]);_0x481236[_0xf050('0x25')]=qs['offset'](_0x472473[_0xf050('0x35')][_0xf050('0x25')]);}_0x481236[_0xf050('0x3c')]=qs['sort'](_0x472473[_0xf050('0x35')][_0xf050('0x3d')]);_0x481236[_0xf050('0x3e')]=qs[_0xf050('0x36')](_[_0xf050('0x3f')](_0x472473['query'],_0x4eedec[_0xf050('0x36')]));if(_0x472473[_0xf050('0x35')]['filter']){_0x481236['where']=_['merge'](_0x481236['where'],{'$or':_[_0xf050('0x40')](_0x156264,function(_0x51a116){if(_0x51a116[_0xf050('0x41')][_0xf050('0x42')]!==_0xf050('0x43')){var _0x48baa9={};_0x48baa9[_0x51a116[_0xf050('0x44')]]={'$like':'%'+_0x472473[_0xf050('0x35')][_0xf050('0x45')]+'%'};return _0x48baa9;}})});}_0x481236=_[_0xf050('0x46')]({},_0x481236,_0x472473[_0xf050('0x47')]);var _0x101e0e={'where':_0x481236[_0xf050('0x3e')]};return db[_0xf050('0x31')]['count'](_0x101e0e)[_0xf050('0x18')](function(_0x522bc7){_0x16d970['count']=_0x522bc7;if(_0x472473[_0xf050('0x35')][_0xf050('0x48')]){_0x481236[_0xf050('0x49')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xf050('0x4a')](_0x481236);})[_0xf050('0x18')](function(_0x5dfd06){_0x16d970['rows']=_0x5dfd06;return _0x16d970;})[_0xf050('0x18')](respondWithFilteredResult(_0x1a3d6a,_0x481236))['catch'](handleError(_0x1a3d6a,null));};exports[_0xf050('0x4b')]=function(_0x1b7541,_0x4fde03){var _0x42df04={'raw':![],'where':{'id':_0x1b7541['params']['id']}},_0x3480e6={};_0x3480e6[_0xf050('0x33')]=_[_0xf050('0x34')](db[_0xf050('0x31')][_0xf050('0x32')]);_0x3480e6['query']=_[_0xf050('0x34')](_0x1b7541[_0xf050('0x35')]);_0x3480e6['filters']=_[_0xf050('0x37')](_0x3480e6['model'],_0x3480e6[_0xf050('0x35')]);_0x42df04[_0xf050('0x38')]=_['intersection'](_0x3480e6[_0xf050('0x33')],qs[_0xf050('0x39')](_0x1b7541[_0xf050('0x35')]['fields']));_0x42df04[_0xf050('0x38')]=_0x42df04['attributes']['length']?_0x42df04[_0xf050('0x38')]:_0x3480e6['model'];if(_0x1b7541['query'][_0xf050('0x48')]){_0x42df04[_0xf050('0x49')]=[{'all':!![]}];}_0x42df04=_[_0xf050('0x46')]({},_0x42df04,_0x1b7541['options']);return db['ServicenowConfiguration']['find'](_0x42df04)['then'](handleEntityNotFound(_0x4fde03,null))[_0xf050('0x18')](respondWithResult(_0x4fde03,null))['catch'](handleError(_0x4fde03,null));};exports[_0xf050('0x4c')]=function(_0x1de57b,_0x38339d){return db[_0xf050('0x31')]['create'](_0x1de57b[_0xf050('0x4d')],{})[_0xf050('0x18')](respondWithResult(_0x38339d,0xc9))[_0xf050('0x21')](handleError(_0x38339d,null));};exports[_0xf050('0x2a')]=function(_0x3d6a4b,_0x15a616){if(_0x3d6a4b[_0xf050('0x4d')]['id']){delete _0x3d6a4b[_0xf050('0x4d')]['id'];}return db['ServicenowConfiguration'][_0xf050('0x4e')]({'where':{'id':_0x3d6a4b['params']['id']}})[_0xf050('0x18')](handleEntityNotFound(_0x15a616,null))[_0xf050('0x18')](saveUpdates(_0x3d6a4b[_0xf050('0x4d')],null))['then'](respondWithResult(_0x15a616,null))['catch'](handleError(_0x15a616,null));};exports[_0xf050('0x2b')]=function(_0x3ef427,_0x1536d0){return db[_0xf050('0x31')]['find']({'where':{'id':_0x3ef427[_0xf050('0x4f')]['id']}})[_0xf050('0x18')](handleEntityNotFound(_0x1536d0,null))[_0xf050('0x18')](removeEntity(_0x1536d0,null))['catch'](handleError(_0x1536d0,null));};exports[_0xf050('0x50')]=function(_0x398db3,_0x3a9805,_0x1265c5){var _0x48a13f={};var _0x1268d2={};var _0x21986c;var _0x544ada;return db['ServicenowConfiguration'][_0xf050('0x51')]({'where':{'id':_0x398db3['params']['id']}})['then'](handleEntityNotFound(_0x3a9805,null))['then'](function(_0x5d9675){if(_0x5d9675){_0x21986c=_0x5d9675;_0x1268d2['model']=_[_0xf050('0x34')](db[_0xf050('0x52')][_0xf050('0x32')]);_0x1268d2[_0xf050('0x35')]=_[_0xf050('0x34')](_0x398db3[_0xf050('0x35')]);_0x1268d2[_0xf050('0x36')]=_['intersection'](_0x1268d2['model'],_0x1268d2['query']);_0x48a13f[_0xf050('0x38')]=_['intersection'](_0x1268d2[_0xf050('0x33')],qs[_0xf050('0x39')](_0x398db3[_0xf050('0x35')]['fields']));_0x48a13f[_0xf050('0x38')]=_0x48a13f['attributes'][_0xf050('0x53')]?_0x48a13f[_0xf050('0x38')]:_0x1268d2['model'];_0x48a13f[_0xf050('0x3c')]=qs[_0xf050('0x3d')](_0x398db3['query']['sort']);_0x48a13f[_0xf050('0x3e')]=qs[_0xf050('0x36')](_[_0xf050('0x3f')](_0x398db3[_0xf050('0x35')],_0x1268d2['filters']));if(_0x398db3[_0xf050('0x35')][_0xf050('0x45')]){_0x48a13f[_0xf050('0x3e')]=_[_0xf050('0x46')](_0x48a13f[_0xf050('0x3e')],{'$or':_[_0xf050('0x40')](_0x48a13f[_0xf050('0x38')],function(_0x3516a4){var _0xafc0dc={};_0xafc0dc[_0x3516a4]={'$like':'%'+_0x398db3[_0xf050('0x35')]['filter']+'%'};return _0xafc0dc;})});}_0x48a13f=_[_0xf050('0x46')]({},_0x48a13f,_0x398db3[_0xf050('0x47')]);return _0x21986c[_0xf050('0x50')](_0x48a13f);}})['then'](function(_0x3f3131){if(_0x3f3131){_0x544ada=_0x3f3131[_0xf050('0x53')];if(!_0x398db3[_0xf050('0x35')]['hasOwnProperty'](_0xf050('0x3a'))){_0x48a13f['limit']=qs['limit'](_0x398db3['query'][_0xf050('0x3b')]);_0x48a13f['offset']=qs[_0xf050('0x25')](_0x398db3[_0xf050('0x35')]['offset']);}return _0x21986c[_0xf050('0x50')](_0x48a13f);}})[_0xf050('0x18')](function(_0x29dba0){if(_0x29dba0){return _0x29dba0?{'count':_0x544ada,'rows':_0x29dba0}:null;}})[_0xf050('0x18')](respondWithResult(_0x3a9805,null))[_0xf050('0x21')](handleError(_0x3a9805,null));};exports[_0xf050('0x54')]=function(_0x4b8a60,_0x2ecfae,_0x57ab66){var _0x3928ad={};var _0x180a22={};var _0x3e0966;var _0x3dcce5;return db[_0xf050('0x31')][_0xf050('0x51')]({'where':{'id':_0x4b8a60['params']['id']}})[_0xf050('0x18')](handleEntityNotFound(_0x2ecfae,null))[_0xf050('0x18')](function(_0x1a193c){if(_0x1a193c){_0x3e0966=_0x1a193c;_0x180a22['model']=_['keys'](db['ServicenowField']['rawAttributes']);_0x180a22[_0xf050('0x35')]=_[_0xf050('0x34')](_0x4b8a60[_0xf050('0x35')]);_0x180a22['filters']=_['intersection'](_0x180a22[_0xf050('0x33')],_0x180a22[_0xf050('0x35')]);_0x3928ad[_0xf050('0x38')]=_[_0xf050('0x37')](_0x180a22[_0xf050('0x33')],qs['fields'](_0x4b8a60[_0xf050('0x35')][_0xf050('0x39')]));_0x3928ad[_0xf050('0x38')]=_0x3928ad[_0xf050('0x38')][_0xf050('0x53')]?_0x3928ad[_0xf050('0x38')]:_0x180a22['model'];_0x3928ad['order']=qs[_0xf050('0x3d')](_0x4b8a60['query']['sort']);_0x3928ad[_0xf050('0x3e')]=qs[_0xf050('0x36')](_[_0xf050('0x3f')](_0x4b8a60[_0xf050('0x35')],_0x180a22['filters']));if(_0x4b8a60[_0xf050('0x35')][_0xf050('0x45')]){_0x3928ad[_0xf050('0x3e')]=_[_0xf050('0x46')](_0x3928ad['where'],{'$or':_[_0xf050('0x40')](_0x3928ad[_0xf050('0x38')],function(_0xd57a06){var _0x1f95a3={};_0x1f95a3[_0xd57a06]={'$like':'%'+_0x4b8a60[_0xf050('0x35')]['filter']+'%'};return _0x1f95a3;})});}_0x3928ad=_[_0xf050('0x46')]({},_0x3928ad,_0x4b8a60[_0xf050('0x47')]);return _0x3e0966[_0xf050('0x54')](_0x3928ad);}})[_0xf050('0x18')](function(_0x56b0a7){if(_0x56b0a7){_0x3dcce5=_0x56b0a7[_0xf050('0x53')];if(!_0x4b8a60[_0xf050('0x35')][_0xf050('0x55')]('nolimit')){_0x3928ad[_0xf050('0x3b')]=qs[_0xf050('0x3b')](_0x4b8a60[_0xf050('0x35')]['limit']);_0x3928ad[_0xf050('0x25')]=qs[_0xf050('0x25')](_0x4b8a60[_0xf050('0x35')][_0xf050('0x25')]);}return _0x3e0966[_0xf050('0x54')](_0x3928ad);}})[_0xf050('0x18')](function(_0x4b6af1){if(_0x4b6af1){return _0x4b6af1?{'count':_0x3dcce5,'rows':_0x4b6af1}:null;}})[_0xf050('0x18')](respondWithResult(_0x2ecfae,null))['catch'](handleError(_0x2ecfae,null));};exports[_0xf050('0x56')]=function(_0x2c9d44,_0x1eb8e8,_0x53085a){var _0x245f78={};var _0x122362={};var _0x2c3601;var _0x33f7eb;return db[_0xf050('0x31')][_0xf050('0x51')]({'where':{'id':_0x2c9d44[_0xf050('0x4f')]['id']}})[_0xf050('0x18')](handleEntityNotFound(_0x1eb8e8,null))[_0xf050('0x18')](function(_0x543383){if(_0x543383){_0x2c3601=_0x543383;_0x122362['model']=_['keys'](db[_0xf050('0x52')]['rawAttributes']);_0x122362['query']=_['keys'](_0x2c9d44[_0xf050('0x35')]);_0x122362[_0xf050('0x36')]=_[_0xf050('0x37')](_0x122362[_0xf050('0x33')],_0x122362[_0xf050('0x35')]);_0x245f78[_0xf050('0x38')]=_[_0xf050('0x37')](_0x122362['model'],qs[_0xf050('0x39')](_0x2c9d44[_0xf050('0x35')][_0xf050('0x39')]));_0x245f78[_0xf050('0x38')]=_0x245f78[_0xf050('0x38')][_0xf050('0x53')]?_0x245f78[_0xf050('0x38')]:_0x122362[_0xf050('0x33')];_0x245f78[_0xf050('0x3c')]=qs[_0xf050('0x3d')](_0x2c9d44[_0xf050('0x35')]['sort']);_0x245f78[_0xf050('0x3e')]=qs[_0xf050('0x36')](_[_0xf050('0x3f')](_0x2c9d44[_0xf050('0x35')],_0x122362[_0xf050('0x36')]));if(_0x2c9d44[_0xf050('0x35')]['filter']){_0x245f78['where']=_['merge'](_0x245f78['where'],{'$or':_[_0xf050('0x40')](_0x245f78[_0xf050('0x38')],function(_0x44b06a){var _0x20c721={};_0x20c721[_0x44b06a]={'$like':'%'+_0x2c9d44[_0xf050('0x35')][_0xf050('0x45')]+'%'};return _0x20c721;})});}_0x245f78=_[_0xf050('0x46')]({},_0x245f78,_0x2c9d44[_0xf050('0x47')]);return _0x2c3601[_0xf050('0x56')](_0x245f78);}})[_0xf050('0x18')](function(_0x2508a4){if(_0x2508a4){_0x33f7eb=_0x2508a4[_0xf050('0x53')];if(!_0x2c9d44[_0xf050('0x35')][_0xf050('0x55')]('nolimit')){_0x245f78[_0xf050('0x3b')]=qs['limit'](_0x2c9d44['query'][_0xf050('0x3b')]);_0x245f78[_0xf050('0x25')]=qs[_0xf050('0x25')](_0x2c9d44[_0xf050('0x35')]['offset']);}return _0x2c3601[_0xf050('0x56')](_0x245f78);}})['then'](function(_0x3d87dc){if(_0x3d87dc){return _0x3d87dc?{'count':_0x33f7eb,'rows':_0x3d87dc}:null;}})[_0xf050('0x18')](respondWithResult(_0x1eb8e8,null))[_0xf050('0x21')](handleError(_0x1eb8e8,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 354b517..17a258b 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6842=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x1aab8d,_0x19623d){var _0x289048=function(_0x5ab3a6){while(--_0x5ab3a6){_0x1aab8d['push'](_0x1aab8d['shift']());}};_0x289048(++_0x19623d);}(_0x6842,0x6b));var _0x2684=function(_0x32b1f7,_0x25053f){_0x32b1f7=_0x32b1f7-0x0;var _0x5141a7=_0x6842[_0x32b1f7];return _0x5141a7;};'use strict';var _=require(_0x2684('0x0'));var util=require(_0x2684('0x1'));var logger=require(_0x2684('0x2'))(_0x2684('0x3'));var moment=require(_0x2684('0x4'));var BPromise=require(_0x2684('0x5'));var rp=require(_0x2684('0x6'));var fs=require('fs');var path=require(_0x2684('0x7'));var rimraf=require(_0x2684('0x8'));var config=require(_0x2684('0x9'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x2684('0xa')]=function(_0x4b68a2,_0x1b5076){return _0x4b68a2[_0x2684('0xb')](_0x2684('0xc'),attributes,{'tableName':_0x2684('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7060=['exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes'];(function(_0x1e0ee0,_0x5c387e){var _0x582995=function(_0x1928cf){while(--_0x1928cf){_0x1e0ee0['push'](_0x1e0ee0['shift']());}};_0x582995(++_0x5c387e);}(_0x7060,0xab));var _0x0706=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7060[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0706('0x0'));var util=require(_0x0706('0x1'));var logger=require(_0x0706('0x2'))('api');var moment=require(_0x0706('0x3'));var BPromise=require(_0x0706('0x4'));var rp=require(_0x0706('0x5'));var fs=require('fs');var path=require(_0x0706('0x6'));var rimraf=require(_0x0706('0x7'));var config=require('../../config/environment');var attributes=require(_0x0706('0x8'));module[_0x0706('0x9')]=function(_0x30483b,_0x2cf9e3){return _0x30483b['define'](_0x0706('0xa'),attributes,{'tableName':_0x0706('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 1ba736d..c0e278b 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6da2=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x2c3977,_0x5c5a9a){var _0x2c76e4=function(_0x2d692d){while(--_0x2d692d){_0x2c3977['push'](_0x2c3977['shift']());}};_0x2c76e4(++_0x5c5a9a);}(_0x6da2,0x1cf));var _0x26da=function(_0xc1a7d3,_0x6ac180){_0xc1a7d3=_0xc1a7d3-0x0;var _0x576e8d=_0x6da2[_0xc1a7d3];return _0x576e8d;};'use strict';var _=require(_0x26da('0x0'));var util=require(_0x26da('0x1'));var moment=require(_0x26da('0x2'));var BPromise=require(_0x26da('0x3'));var rs=require(_0x26da('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x26da('0x6'))(_0x26da('0x7'));var config=require(_0x26da('0x8'));var jayson=require(_0x26da('0x9'));var client=jayson[_0x26da('0xa')][_0x26da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16e604,_0x2b1668,_0x5264c8){return new BPromise(function(_0x403c87,_0x2f91f2){return client[_0x26da('0xc')](_0x16e604,_0x5264c8)[_0x26da('0xd')](function(_0x389b13){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x2b1668,_0x26da('0xe'));logger[_0x26da('0xf')](_0x26da('0x10'),_0x2b1668,_0x26da('0xe'),JSON[_0x26da('0x11')](_0x389b13));if(_0x389b13[_0x26da('0x12')]){if(_0x389b13['error'][_0x26da('0x13')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x2b1668,_0x389b13['error']['message']);return _0x2f91f2(_0x389b13['error']['message']);}logger[_0x26da('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2b1668,_0x389b13[_0x26da('0x12')][_0x26da('0x14')]);return _0x403c87(_0x389b13[_0x26da('0x12')][_0x26da('0x14')]);}else{logger[_0x26da('0x15')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2b1668,_0x26da('0xe'));_0x403c87(_0x389b13[_0x26da('0x16')][_0x26da('0x14')]);}})[_0x26da('0x17')](function(_0x2e717f){logger[_0x26da('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2b1668,_0x2e717f);_0x2f91f2(_0x2e717f);});});} \ No newline at end of file +var _0x74ff=['then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','stringify','error','code','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request'];(function(_0x4e340b,_0x1cf8a3){var _0x3b78da=function(_0x587048){while(--_0x587048){_0x4e340b['push'](_0x4e340b['shift']());}};_0x3b78da(++_0x1cf8a3);}(_0x74ff,0x106));var _0xf74f=function(_0x1fe7ab,_0x530342){_0x1fe7ab=_0x1fe7ab-0x0;var _0x2571f4=_0x74ff[_0x1fe7ab];return _0x2571f4;};'use strict';var _=require(_0xf74f('0x0'));var util=require(_0xf74f('0x1'));var moment=require(_0xf74f('0x2'));var BPromise=require(_0xf74f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf74f('0x4'));var db=require(_0xf74f('0x5'))['db'];var utils=require(_0xf74f('0x6'));var logger=require(_0xf74f('0x7'))('rpc');var config=require(_0xf74f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf74f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a564e,_0x883b82,_0xb8364a){return new BPromise(function(_0x521363,_0x259e61){return client[_0xf74f('0xa')](_0x1a564e,_0xb8364a)[_0xf74f('0xb')](function(_0x542dbd){logger[_0xf74f('0xc')](_0xf74f('0xd'),_0x883b82,'request\x20sent');logger[_0xf74f('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x883b82,'request\x20sent',JSON[_0xf74f('0xf')](_0x542dbd));if(_0x542dbd[_0xf74f('0x10')]){if(_0x542dbd[_0xf74f('0x10')][_0xf74f('0x11')]===0x1f4){logger[_0xf74f('0x10')](_0xf74f('0xd'),_0x883b82,_0x542dbd['error']['message']);return _0x259e61(_0x542dbd[_0xf74f('0x10')]['message']);}logger[_0xf74f('0x10')](_0xf74f('0xd'),_0x883b82,_0x542dbd[_0xf74f('0x10')]['message']);return _0x521363(_0x542dbd[_0xf74f('0x10')]['message']);}else{logger[_0xf74f('0xc')](_0xf74f('0xd'),_0x883b82,_0xf74f('0x12'));_0x521363(_0x542dbd[_0xf74f('0x13')]['message']);}})[_0xf74f('0x14')](function(_0x205e8d){logger[_0xf74f('0x10')](_0xf74f('0xd'),_0x883b82,_0x205e8d);_0x259e61(_0x205e8d);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 7afb85c..b4a268b 100644 --- a/server/api/intServicenowField/index.js +++ b/server/api/intServicenowField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc822=['express','Router','../../components/auth/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','update','destroy','exports','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc822,0x197));var _0x2c82=function(_0x39ea42,_0x3c1f50){_0x39ea42=_0x39ea42-0x0;var _0x33f5b7=_0xc822[_0x39ea42];return _0x33f5b7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2c82('0x0'));var timeout=require('connect-timeout');var express=require(_0x2c82('0x1'));var router=express[_0x2c82('0x2')]();var auth=require(_0x2c82('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2c82('0x4'));router[_0x2c82('0x5')]('/',auth[_0x2c82('0x6')](),controller[_0x2c82('0x7')]);router[_0x2c82('0x5')](_0x2c82('0x8'),auth[_0x2c82('0x6')](),controller['show']);router['post']('/',auth[_0x2c82('0x6')](),controller['create']);router['put'](_0x2c82('0x8'),auth[_0x2c82('0x6')](),controller[_0x2c82('0x9')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2c82('0xa')]);module[_0x2c82('0xb')]=router; \ No newline at end of file +var _0xa2e9=['./intServicenowField.controller','get','isAuthenticated','index','/:id','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x22ac5b,_0x2ef85c){var _0x4b5cc4=function(_0x58cf23){while(--_0x58cf23){_0x22ac5b['push'](_0x22ac5b['shift']());}};_0x4b5cc4(++_0x2ef85c);}(_0xa2e9,0xb4));var _0x9a2e=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0xa2e9[_0x1e6659];return _0x4d16e4;};'use strict';var multer=require(_0x9a2e('0x0'));var util=require(_0x9a2e('0x1'));var path=require(_0x9a2e('0x2'));var timeout=require(_0x9a2e('0x3'));var express=require('express');var router=express[_0x9a2e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9a2e('0x5'));var config=require(_0x9a2e('0x6'));var controller=require(_0x9a2e('0x7'));router[_0x9a2e('0x8')]('/',auth[_0x9a2e('0x9')](),controller[_0x9a2e('0xa')]);router['get'](_0x9a2e('0xb'),auth[_0x9a2e('0x9')](),controller['show']);router['post']('/',auth[_0x9a2e('0x9')](),controller[_0x9a2e('0xc')]);router[_0x9a2e('0xd')]('/:id',auth[_0x9a2e('0x9')](),controller[_0x9a2e('0xe')]);router[_0x9a2e('0xf')](_0x9a2e('0xb'),auth[_0x9a2e('0x9')](),controller['destroy']);module[_0x9a2e('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 64e5b06..dece19a 100644 --- a/server/api/intServicenowField/intServicenowField.attributes.js +++ b/server/api/intServicenowField/intServicenowField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4f5=['customVariable','keyValue','string','STRING','BOOLEAN','ENUM','variable'];(function(_0x26d7aa,_0x4bdb79){var _0x9c1d38=function(_0x10d36b){while(--_0x10d36b){_0x26d7aa['push'](_0x26d7aa['shift']());}};_0x9c1d38(++_0x4bdb79);}(_0xc4f5,0x75));var _0x5c4f=function(_0x57ac3b,_0x32e884){_0x57ac3b=_0x57ac3b-0x0;var _0x4204c9=_0xc4f5[_0x57ac3b];return _0x4204c9;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x5c4f('0x0')]('string',_0x5c4f('0x1'),_0x5c4f('0x2'),_0x5c4f('0x3')),'defaultValue':_0x5c4f('0x4')},'content':{'type':Sequelize[_0x5c4f('0x5')]},'key':{'type':Sequelize[_0x5c4f('0x5')]},'keyType':{'type':Sequelize[_0x5c4f('0x0')](_0x5c4f('0x4'),_0x5c4f('0x1'),'customVariable')},'keyContent':{'type':Sequelize[_0x5c4f('0x5')]},'idField':{'type':Sequelize[_0x5c4f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5c4f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5c4f('0x5')]}}; \ No newline at end of file +var _0xd69c=['ENUM','string','variable','STRING','BOOLEAN','sequelize','exports'];(function(_0x545e05,_0x3954fa){var _0x57a676=function(_0x283cc6){while(--_0x283cc6){_0x545e05['push'](_0x545e05['shift']());}};_0x57a676(++_0x3954fa);}(_0xd69c,0x15c));var _0xcd69=function(_0x5cfcf3,_0x28965f){_0x5cfcf3=_0x5cfcf3-0x0;var _0x5b2acf=_0xd69c[_0x5cfcf3];return _0x5b2acf;};'use strict';var Sequelize=require(_0xcd69('0x0'));module[_0xcd69('0x1')]={'type':{'type':Sequelize[_0xcd69('0x2')](_0xcd69('0x3'),_0xcd69('0x4'),'customVariable','keyValue'),'defaultValue':_0xcd69('0x3')},'content':{'type':Sequelize[_0xcd69('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xcd69('0x2')](_0xcd69('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xcd69('0x5')]},'idField':{'type':Sequelize[_0xcd69('0x5')]},'nameField':{'type':Sequelize[_0xcd69('0x5')]},'customField':{'type':Sequelize[_0xcd69('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcd69('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 16d14d6..d905ad8 100644 --- a/server/api/intServicenowField/intServicenowField.controller.js +++ b/server/api/intServicenowField/intServicenowField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66af=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','ServicenowField','rawAttributes','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','type','VIRTUAL','field','filter','options','count','findAll','then','catch','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0x66af,0x86));var _0xf66a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x66af[_0x13d07a];return _0x5ee0ee;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf66a('0x0'));var rimraf=require(_0xf66a('0x1'));var zipdir=require(_0xf66a('0x2'));var jsonpatch=require(_0xf66a('0x3'));var rp=require(_0xf66a('0x4'));var moment=require(_0xf66a('0x5'));var BPromise=require(_0xf66a('0x6'));var Mustache=require(_0xf66a('0x7'));var util=require(_0xf66a('0x8'));var path=require('path');var sox=require(_0xf66a('0x9'));var csv=require(_0xf66a('0xa'));var ejs=require(_0xf66a('0xb'));var fs=require('fs');var _=require(_0xf66a('0xc'));var squel=require('squel');var crypto=require(_0xf66a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf66a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf66a('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf66a('0x10'));var qs=require(_0xf66a('0x11'));var hardwareService=require(_0xf66a('0x12'));var logger=require(_0xf66a('0x13'))(_0xf66a('0x14'));var utils=require('../../config/utils');var config=require(_0xf66a('0x15'));var db=require(_0xf66a('0x16'))['db'];function respondWithStatusCode(_0x33ed99,_0x434b4d){_0x434b4d=_0x434b4d||0xcc;return function(_0x119bdb){if(_0x119bdb){return _0x33ed99['sendStatus'](_0x434b4d);}return _0x33ed99[_0xf66a('0x17')](_0x434b4d)[_0xf66a('0x18')]();};}function respondWithResult(_0x49d09e,_0x499962){_0x499962=_0x499962||0xc8;return function(_0x2e0e76){if(_0x2e0e76){return _0x49d09e['status'](_0x499962)[_0xf66a('0x19')](_0x2e0e76);}};}function respondWithFilteredResult(_0x1e26ed,_0x5c1d33){return function(_0x35bd84){if(_0x35bd84){var _0x5d741e=_0x35bd84['count'],_0x44355c=_0x5c1d33[_0xf66a('0x1a')],_0x19e92e=_0x5c1d33['offset']+_0x5c1d33[_0xf66a('0x1b')],_0x2d93c0;if(_0x19e92e>=_0x5d741e){_0x19e92e=_0x5d741e;_0x2d93c0=0xc8;}else{_0x2d93c0=0xce;}_0x1e26ed[_0xf66a('0x17')](_0x2d93c0);return _0x1e26ed[_0xf66a('0x1c')](_0xf66a('0x1d'),_0x44355c+'-'+_0x19e92e+'/'+_0x5d741e)['json'](_0x35bd84);}return null;};}function patchUpdates(_0x2792ec){return function(_0x53f21b){try{jsonpatch[_0xf66a('0x1e')](_0x53f21b,_0x2792ec,!![]);}catch(_0xf47e5f){return BPromise[_0xf66a('0x1f')](_0xf47e5f);}return _0x53f21b[_0xf66a('0x20')]();};}function saveUpdates(_0x420f8b,_0x2e5b23){return function(_0x268281){if(_0x268281){return _0x268281[_0xf66a('0x21')](_0x420f8b)['then'](function(_0x440e76){return _0x440e76;});}return null;};}function removeEntity(_0x17e5be,_0x1a5a4f){return function(_0x1d67d2){if(_0x1d67d2){return _0x1d67d2[_0xf66a('0x22')]()['then'](function(){_0x17e5be['status'](0xcc)[_0xf66a('0x18')]();});}};}function handleEntityNotFound(_0x3c99ce,_0x3b7d7a){return function(_0x793b8e){if(!_0x793b8e){_0x3c99ce['sendStatus'](0x194);}return _0x793b8e;};}function handleError(_0x55529a,_0x3d811e){_0x3d811e=_0x3d811e||0x1f4;return function(_0x588d4c){logger[_0xf66a('0x23')](_0x588d4c[_0xf66a('0x24')]);if(_0x588d4c['name']){delete _0x588d4c[_0xf66a('0x25')];}_0x55529a[_0xf66a('0x17')](_0x3d811e)['send'](_0x588d4c);};}exports[_0xf66a('0x26')]=function(_0x51d878,_0x449e75){var _0x32f416={},_0xb02288={},_0x515c07={'count':0x0,'rows':[]};var _0x11fa3f=db[_0xf66a('0x27')][_0xf66a('0x28')];_0xb02288['model']=_[_0xf66a('0x29')](_0x11fa3f);_0xb02288['query']=_[_0xf66a('0x29')](_0x51d878['query']);_0xb02288[_0xf66a('0x2a')]=_[_0xf66a('0x2b')](_0xb02288[_0xf66a('0x2c')],_0xb02288[_0xf66a('0x2d')]);_0x32f416[_0xf66a('0x2e')]=_[_0xf66a('0x2b')](_0xb02288['model'],qs[_0xf66a('0x2f')](_0x51d878[_0xf66a('0x2d')][_0xf66a('0x2f')]));_0x32f416[_0xf66a('0x2e')]=_0x32f416[_0xf66a('0x2e')][_0xf66a('0x30')]?_0x32f416[_0xf66a('0x2e')]:_0xb02288['model'];if(!_0x51d878[_0xf66a('0x2d')][_0xf66a('0x31')](_0xf66a('0x32'))){_0x32f416[_0xf66a('0x1b')]=qs['limit'](_0x51d878[_0xf66a('0x2d')][_0xf66a('0x1b')]);_0x32f416['offset']=qs['offset'](_0x51d878[_0xf66a('0x2d')][_0xf66a('0x1a')]);}_0x32f416['order']=qs[_0xf66a('0x33')](_0x51d878[_0xf66a('0x2d')][_0xf66a('0x33')]);_0x32f416['where']=qs[_0xf66a('0x2a')](_[_0xf66a('0x34')](_0x51d878['query'],_0xb02288[_0xf66a('0x2a')]));if(_0x51d878[_0xf66a('0x2d')]['filter']){_0x32f416['where']=_[_0xf66a('0x35')](_0x32f416[_0xf66a('0x36')],{'$or':_['map'](_0x11fa3f,function(_0x43788b){if(_0x43788b[_0xf66a('0x37')]['key']!==_0xf66a('0x38')){var _0x2b9911={};_0x2b9911[_0x43788b[_0xf66a('0x39')]]={'$like':'%'+_0x51d878[_0xf66a('0x2d')][_0xf66a('0x3a')]+'%'};return _0x2b9911;}})});}_0x32f416=_[_0xf66a('0x35')]({},_0x32f416,_0x51d878[_0xf66a('0x3b')]);var _0x27d414={'where':_0x32f416[_0xf66a('0x36')]};return db[_0xf66a('0x27')]['count'](_0x27d414)['then'](function(_0x1b6396){_0x515c07[_0xf66a('0x3c')]=_0x1b6396;if(_0x51d878[_0xf66a('0x2d')]['includeAll']){_0x32f416['include']=[{'all':!![]}];}return db['ServicenowField'][_0xf66a('0x3d')](_0x32f416);})['then'](function(_0x2a67d8){_0x515c07['rows']=_0x2a67d8;return _0x515c07;})[_0xf66a('0x3e')](respondWithFilteredResult(_0x449e75,_0x32f416))[_0xf66a('0x3f')](handleError(_0x449e75,null));};exports['show']=function(_0x2b04ed,_0x5f3ada){var _0x5342e1={'raw':!![],'where':{'id':_0x2b04ed['params']['id']}},_0x44b2c7={};_0x44b2c7['model']=_[_0xf66a('0x29')](db[_0xf66a('0x27')][_0xf66a('0x28')]);_0x44b2c7[_0xf66a('0x2d')]=_[_0xf66a('0x29')](_0x2b04ed[_0xf66a('0x2d')]);_0x44b2c7['filters']=_[_0xf66a('0x2b')](_0x44b2c7[_0xf66a('0x2c')],_0x44b2c7[_0xf66a('0x2d')]);_0x5342e1[_0xf66a('0x2e')]=_[_0xf66a('0x2b')](_0x44b2c7[_0xf66a('0x2c')],qs[_0xf66a('0x2f')](_0x2b04ed[_0xf66a('0x2d')]['fields']));_0x5342e1[_0xf66a('0x2e')]=_0x5342e1[_0xf66a('0x2e')][_0xf66a('0x30')]?_0x5342e1[_0xf66a('0x2e')]:_0x44b2c7[_0xf66a('0x2c')];if(_0x2b04ed[_0xf66a('0x2d')]['includeAll']){_0x5342e1[_0xf66a('0x40')]=[{'all':!![]}];}_0x5342e1=_['merge']({},_0x5342e1,_0x2b04ed[_0xf66a('0x3b')]);return db[_0xf66a('0x27')][_0xf66a('0x41')](_0x5342e1)['then'](handleEntityNotFound(_0x5f3ada,null))[_0xf66a('0x3e')](respondWithResult(_0x5f3ada,null))[_0xf66a('0x3f')](handleError(_0x5f3ada,null));};exports[_0xf66a('0x42')]=function(_0x420237,_0x248dde){return db[_0xf66a('0x27')][_0xf66a('0x42')](_0x420237['body'],{})['then'](respondWithResult(_0x248dde,0xc9))[_0xf66a('0x3f')](handleError(_0x248dde,null));};exports[_0xf66a('0x21')]=function(_0x189ce4,_0x2a301b){if(_0x189ce4[_0xf66a('0x43')]['id']){delete _0x189ce4['body']['id'];}return db['ServicenowField'][_0xf66a('0x41')]({'where':{'id':_0x189ce4[_0xf66a('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a301b,null))[_0xf66a('0x3e')](saveUpdates(_0x189ce4['body'],null))[_0xf66a('0x3e')](respondWithResult(_0x2a301b,null))['catch'](handleError(_0x2a301b,null));};exports['destroy']=function(_0x2f757e,_0x45b7d2){return db['ServicenowField'][_0xf66a('0x41')]({'where':{'id':_0x2f757e[_0xf66a('0x44')]['id']}})[_0xf66a('0x3e')](handleEntityNotFound(_0x45b7d2,null))[_0xf66a('0x3e')](removeEntity(_0x45b7d2,null))[_0xf66a('0x3f')](handleError(_0x45b7d2,null));}; \ No newline at end of file +var _0x0368=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','filter','where','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','limit','set','Content-Range','reject','save','destroy','then','end','error','stack','name','ServicenowField'];(function(_0x2d9888,_0x13e73b){var _0x534a4a=function(_0x519345){while(--_0x519345){_0x2d9888['push'](_0x2d9888['shift']());}};_0x534a4a(++_0x13e73b);}(_0x0368,0x18d));var _0x8036=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0x0368[_0x366388];return _0x41c97e;};'use strict';var pdf=require(_0x8036('0x0'));var emlformat=require(_0x8036('0x1'));var rimraf=require(_0x8036('0x2'));var zipdir=require(_0x8036('0x3'));var jsonpatch=require(_0x8036('0x4'));var rp=require(_0x8036('0x5'));var moment=require(_0x8036('0x6'));var BPromise=require(_0x8036('0x7'));var Mustache=require(_0x8036('0x8'));var util=require('util');var path=require(_0x8036('0x9'));var sox=require(_0x8036('0xa'));var csv=require(_0x8036('0xb'));var ejs=require(_0x8036('0xc'));var fs=require('fs');var _=require(_0x8036('0xd'));var squel=require(_0x8036('0xe'));var crypto=require(_0x8036('0xf'));var jsforce=require(_0x8036('0x10'));var deskjs=require(_0x8036('0x11'));var toCsv=require(_0x8036('0xb'));var querystring=require('querystring');var Papa=require(_0x8036('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8036('0x13'));var hardwareService=require(_0x8036('0x14'));var logger=require(_0x8036('0x15'))(_0x8036('0x16'));var utils=require(_0x8036('0x17'));var config=require(_0x8036('0x18'));var db=require(_0x8036('0x19'))['db'];function respondWithStatusCode(_0x139956,_0x2b75e8){_0x2b75e8=_0x2b75e8||0xcc;return function(_0x345a43){if(_0x345a43){return _0x139956['sendStatus'](_0x2b75e8);}return _0x139956[_0x8036('0x1a')](_0x2b75e8)['end']();};}function respondWithResult(_0x43e35d,_0x10d2c3){_0x10d2c3=_0x10d2c3||0xc8;return function(_0xe39d34){if(_0xe39d34){return _0x43e35d['status'](_0x10d2c3)[_0x8036('0x1b')](_0xe39d34);}};}function respondWithFilteredResult(_0x533051,_0x24539b){return function(_0xf7d6c){if(_0xf7d6c){var _0x166fd8=_0xf7d6c[_0x8036('0x1c')],_0x405587=_0x24539b['offset'],_0x4c4a4f=_0x24539b['offset']+_0x24539b[_0x8036('0x1d')],_0x48befe;if(_0x4c4a4f>=_0x166fd8){_0x4c4a4f=_0x166fd8;_0x48befe=0xc8;}else{_0x48befe=0xce;}_0x533051[_0x8036('0x1a')](_0x48befe);return _0x533051[_0x8036('0x1e')](_0x8036('0x1f'),_0x405587+'-'+_0x4c4a4f+'/'+_0x166fd8)['json'](_0xf7d6c);}return null;};}function patchUpdates(_0x6cb53b){return function(_0x223077){try{jsonpatch['apply'](_0x223077,_0x6cb53b,!![]);}catch(_0x292e02){return BPromise[_0x8036('0x20')](_0x292e02);}return _0x223077[_0x8036('0x21')]();};}function saveUpdates(_0x5120a4,_0xed12b8){return function(_0x253a84){if(_0x253a84){return _0x253a84['update'](_0x5120a4)['then'](function(_0x2af173){return _0x2af173;});}return null;};}function removeEntity(_0x5be0d6,_0x48e81d){return function(_0x3984db){if(_0x3984db){return _0x3984db[_0x8036('0x22')]()[_0x8036('0x23')](function(){_0x5be0d6[_0x8036('0x1a')](0xcc)[_0x8036('0x24')]();});}};}function handleEntityNotFound(_0x38d993,_0x45b90f){return function(_0xcb73d9){if(!_0xcb73d9){_0x38d993['sendStatus'](0x194);}return _0xcb73d9;};}function handleError(_0x4e9c32,_0x18fb3a){_0x18fb3a=_0x18fb3a||0x1f4;return function(_0x3b91eb){logger[_0x8036('0x25')](_0x3b91eb[_0x8036('0x26')]);if(_0x3b91eb['name']){delete _0x3b91eb[_0x8036('0x27')];}_0x4e9c32[_0x8036('0x1a')](_0x18fb3a)['send'](_0x3b91eb);};}exports['index']=function(_0x5f17d9,_0x19e36d){var _0x5baa30={},_0x48fe81={},_0xfe9d24={'count':0x0,'rows':[]};var _0xa5bae6=db[_0x8036('0x28')]['rawAttributes'];_0x48fe81[_0x8036('0x29')]=_['keys'](_0xa5bae6);_0x48fe81[_0x8036('0x2a')]=_['keys'](_0x5f17d9[_0x8036('0x2a')]);_0x48fe81[_0x8036('0x2b')]=_[_0x8036('0x2c')](_0x48fe81['model'],_0x48fe81[_0x8036('0x2a')]);_0x5baa30[_0x8036('0x2d')]=_['intersection'](_0x48fe81[_0x8036('0x29')],qs[_0x8036('0x2e')](_0x5f17d9[_0x8036('0x2a')][_0x8036('0x2e')]));_0x5baa30['attributes']=_0x5baa30[_0x8036('0x2d')][_0x8036('0x2f')]?_0x5baa30[_0x8036('0x2d')]:_0x48fe81[_0x8036('0x29')];if(!_0x5f17d9[_0x8036('0x2a')][_0x8036('0x30')]('nolimit')){_0x5baa30[_0x8036('0x1d')]=qs[_0x8036('0x1d')](_0x5f17d9['query'][_0x8036('0x1d')]);_0x5baa30[_0x8036('0x31')]=qs[_0x8036('0x31')](_0x5f17d9[_0x8036('0x2a')][_0x8036('0x31')]);}_0x5baa30[_0x8036('0x32')]=qs[_0x8036('0x33')](_0x5f17d9['query'][_0x8036('0x33')]);_0x5baa30['where']=qs[_0x8036('0x2b')](_['pick'](_0x5f17d9[_0x8036('0x2a')],_0x48fe81[_0x8036('0x2b')]));if(_0x5f17d9[_0x8036('0x2a')][_0x8036('0x34')]){_0x5baa30[_0x8036('0x35')]=_[_0x8036('0x36')](_0x5baa30[_0x8036('0x35')],{'$or':_[_0x8036('0x37')](_0xa5bae6,function(_0x261f2a){if(_0x261f2a['type'][_0x8036('0x38')]!==_0x8036('0x39')){var _0x323ff2={};_0x323ff2[_0x261f2a[_0x8036('0x3a')]]={'$like':'%'+_0x5f17d9[_0x8036('0x2a')]['filter']+'%'};return _0x323ff2;}})});}_0x5baa30=_[_0x8036('0x36')]({},_0x5baa30,_0x5f17d9[_0x8036('0x3b')]);var _0x4b1381={'where':_0x5baa30[_0x8036('0x35')]};return db['ServicenowField'][_0x8036('0x1c')](_0x4b1381)['then'](function(_0x4e6744){_0xfe9d24[_0x8036('0x1c')]=_0x4e6744;if(_0x5f17d9[_0x8036('0x2a')][_0x8036('0x3c')]){_0x5baa30[_0x8036('0x3d')]=[{'all':!![]}];}return db[_0x8036('0x28')][_0x8036('0x3e')](_0x5baa30);})[_0x8036('0x23')](function(_0xf7083){_0xfe9d24[_0x8036('0x3f')]=_0xf7083;return _0xfe9d24;})['then'](respondWithFilteredResult(_0x19e36d,_0x5baa30))[_0x8036('0x40')](handleError(_0x19e36d,null));};exports[_0x8036('0x41')]=function(_0x1a548f,_0x3e3bcf){var _0x1b0187={'raw':!![],'where':{'id':_0x1a548f[_0x8036('0x42')]['id']}},_0x134d7f={};_0x134d7f[_0x8036('0x29')]=_[_0x8036('0x43')](db[_0x8036('0x28')][_0x8036('0x44')]);_0x134d7f[_0x8036('0x2a')]=_[_0x8036('0x43')](_0x1a548f[_0x8036('0x2a')]);_0x134d7f[_0x8036('0x2b')]=_['intersection'](_0x134d7f[_0x8036('0x29')],_0x134d7f['query']);_0x1b0187[_0x8036('0x2d')]=_[_0x8036('0x2c')](_0x134d7f[_0x8036('0x29')],qs['fields'](_0x1a548f[_0x8036('0x2a')][_0x8036('0x2e')]));_0x1b0187['attributes']=_0x1b0187[_0x8036('0x2d')][_0x8036('0x2f')]?_0x1b0187[_0x8036('0x2d')]:_0x134d7f[_0x8036('0x29')];if(_0x1a548f[_0x8036('0x2a')][_0x8036('0x3c')]){_0x1b0187['include']=[{'all':!![]}];}_0x1b0187=_['merge']({},_0x1b0187,_0x1a548f[_0x8036('0x3b')]);return db['ServicenowField'][_0x8036('0x45')](_0x1b0187)[_0x8036('0x23')](handleEntityNotFound(_0x3e3bcf,null))[_0x8036('0x23')](respondWithResult(_0x3e3bcf,null))[_0x8036('0x40')](handleError(_0x3e3bcf,null));};exports[_0x8036('0x46')]=function(_0x4c6597,_0x2e9e12){return db[_0x8036('0x28')][_0x8036('0x46')](_0x4c6597[_0x8036('0x47')],{})['then'](respondWithResult(_0x2e9e12,0xc9))[_0x8036('0x40')](handleError(_0x2e9e12,null));};exports[_0x8036('0x48')]=function(_0x34873a,_0x562266){if(_0x34873a['body']['id']){delete _0x34873a['body']['id'];}return db['ServicenowField'][_0x8036('0x45')]({'where':{'id':_0x34873a[_0x8036('0x42')]['id']}})[_0x8036('0x23')](handleEntityNotFound(_0x562266,null))['then'](saveUpdates(_0x34873a[_0x8036('0x47')],null))[_0x8036('0x23')](respondWithResult(_0x562266,null))[_0x8036('0x40')](handleError(_0x562266,null));};exports[_0x8036('0x22')]=function(_0x38ffe2,_0x12adbe){return db['ServicenowField'][_0x8036('0x45')]({'where':{'id':_0x38ffe2['params']['id']}})['then'](handleEntityNotFound(_0x12adbe,null))[_0x8036('0x23')](removeEntity(_0x12adbe,null))[_0x8036('0x40')](handleError(_0x12adbe,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 30cd5d9..4aaa4eb 100644 --- a/server/api/intServicenowField/intServicenowField.model.js +++ b/server/api/intServicenowField/intServicenowField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd180=['define','ServicenowField','idField','FieldId','lodash','api','moment','request-promise','path','rimraf','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd180,0xca));var _0x0d18=function(_0x39c545,_0x4a7b5c){_0x39c545=_0x39c545-0x0;var _0x2ceed9=_0xd180[_0x39c545];return _0x2ceed9;};'use strict';var _=require(_0x0d18('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0d18('0x1'));var moment=require(_0x0d18('0x2'));var BPromise=require('bluebird');var rp=require(_0x0d18('0x3'));var fs=require('fs');var path=require(_0x0d18('0x4'));var rimraf=require(_0x0d18('0x5'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x0d18('0x6')]=function(_0x315056,_0x4ab28c){return _0x315056[_0x0d18('0x7')](_0x0d18('0x8'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x0d18('0x9'),_0x0d18('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa4e2=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash'];(function(_0x415c15,_0x198cb9){var _0x273a1e=function(_0x23e91d){while(--_0x23e91d){_0x415c15['push'](_0x415c15['shift']());}};_0x273a1e(++_0x198cb9);}(_0xa4e2,0xe0));var _0x2a4e=function(_0x43f945,_0xd18dca){_0x43f945=_0x43f945-0x0;var _0x51521e=_0xa4e2[_0x43f945];return _0x51521e;};'use strict';var _=require(_0x2a4e('0x0'));var util=require(_0x2a4e('0x1'));var logger=require(_0x2a4e('0x2'))(_0x2a4e('0x3'));var moment=require(_0x2a4e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a4e('0x5'));var rimraf=require(_0x2a4e('0x6'));var config=require(_0x2a4e('0x7'));var attributes=require(_0x2a4e('0x8'));module[_0x2a4e('0x9')]=function(_0x5e2a1f,_0x15f436){return _0x5e2a1f['define'](_0x2a4e('0xa'),attributes,{'tableName':_0x2a4e('0xb'),'paranoid':![],'indexes':[{'name':_0x2a4e('0xc'),'fields':[_0x2a4e('0xd'),_0x2a4e('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 9b27393..b2749bc 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8dc=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0xc8dc,0x111));var _0xcc8d=function(_0x3ad6bd,_0x4aef2c){_0x3ad6bd=_0x3ad6bd-0x0;var _0x27f188=_0xc8dc[_0x3ad6bd];return _0x27f188;};'use strict';var _=require('lodash');var util=require(_0xcc8d('0x0'));var moment=require(_0xcc8d('0x1'));var BPromise=require(_0xcc8d('0x2'));var rs=require(_0xcc8d('0x3'));var fs=require('fs');var Redis=require(_0xcc8d('0x4'));var db=require(_0xcc8d('0x5'))['db'];var utils=require(_0xcc8d('0x6'));var logger=require(_0xcc8d('0x7'))('rpc');var config=require(_0xcc8d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcc8d('0x9')][_0xcc8d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b7ae0,_0x51bfd6,_0x31bb08){return new BPromise(function(_0x2b298b,_0x9cd17){return client[_0xcc8d('0xb')](_0x1b7ae0,_0x31bb08)[_0xcc8d('0xc')](function(_0x1c9ec9){logger['info']('ServicenowField,\x20%s,\x20%s',_0x51bfd6,_0xcc8d('0xd'));logger[_0xcc8d('0xe')](_0xcc8d('0xf'),_0x51bfd6,'request\x20sent',JSON['stringify'](_0x1c9ec9));if(_0x1c9ec9[_0xcc8d('0x10')]){if(_0x1c9ec9['error'][_0xcc8d('0x11')]===0x1f4){logger[_0xcc8d('0x10')]('ServicenowField,\x20%s,\x20%s',_0x51bfd6,_0x1c9ec9[_0xcc8d('0x10')][_0xcc8d('0x12')]);return _0x9cd17(_0x1c9ec9['error'][_0xcc8d('0x12')]);}logger['error'](_0xcc8d('0x13'),_0x51bfd6,_0x1c9ec9[_0xcc8d('0x10')][_0xcc8d('0x12')]);return _0x2b298b(_0x1c9ec9[_0xcc8d('0x10')][_0xcc8d('0x12')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x51bfd6,_0xcc8d('0xd'));_0x2b298b(_0x1c9ec9[_0xcc8d('0x14')]['message']);}})[_0xcc8d('0x15')](function(_0x304d97){logger[_0xcc8d('0x10')](_0xcc8d('0x13'),_0x51bfd6,_0x304d97);_0x9cd17(_0x304d97);});});} \ No newline at end of file +var _0xc210=['http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xe8e0c8,_0x57c0aa){var _0xcf3101=function(_0x4621c6){while(--_0x4621c6){_0xe8e0c8['push'](_0xe8e0c8['shift']());}};_0xcf3101(++_0x57c0aa);}(_0xc210,0x198));var _0x0c21=function(_0x43a5cd,_0x1bf484){_0x43a5cd=_0x43a5cd-0x0;var _0x10d186=_0xc210[_0x43a5cd];return _0x10d186;};'use strict';var _=require(_0x0c21('0x0'));var util=require('util');var moment=require(_0x0c21('0x1'));var BPromise=require(_0x0c21('0x2'));var rs=require(_0x0c21('0x3'));var fs=require('fs');var Redis=require(_0x0c21('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c21('0x5'));var logger=require(_0x0c21('0x6'))(_0x0c21('0x7'));var config=require(_0x0c21('0x8'));var jayson=require(_0x0c21('0x9'));var client=jayson['client'][_0x0c21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x466659,_0x1a0b98,_0x2ed34d){return new BPromise(function(_0xa8d4c0,_0x144586){return client['request'](_0x466659,_0x2ed34d)[_0x0c21('0xb')](function(_0x4fce79){logger[_0x0c21('0xc')](_0x0c21('0xd'),_0x1a0b98,_0x0c21('0xe'));logger[_0x0c21('0xf')](_0x0c21('0x10'),_0x1a0b98,_0x0c21('0xe'),JSON['stringify'](_0x4fce79));if(_0x4fce79['error']){if(_0x4fce79[_0x0c21('0x11')][_0x0c21('0x12')]===0x1f4){logger[_0x0c21('0x11')](_0x0c21('0xd'),_0x1a0b98,_0x4fce79[_0x0c21('0x11')][_0x0c21('0x13')]);return _0x144586(_0x4fce79['error'][_0x0c21('0x13')]);}logger[_0x0c21('0x11')](_0x0c21('0xd'),_0x1a0b98,_0x4fce79[_0x0c21('0x11')][_0x0c21('0x13')]);return _0xa8d4c0(_0x4fce79[_0x0c21('0x11')][_0x0c21('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x1a0b98,_0x0c21('0xe'));_0xa8d4c0(_0x4fce79[_0x0c21('0x14')][_0x0c21('0x13')]);}})[_0x0c21('0x15')](function(_0x27b67f){logger[_0x0c21('0x11')]('ServicenowField,\x20%s,\x20%s',_0x1a0b98,_0x27b67f);_0x144586(_0x27b67f);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 54451b9..2036ff2 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb1d=['../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x1ee8b7,_0x5bc82a){var _0x14c299=function(_0x37ad59){while(--_0x37ad59){_0x1ee8b7['push'](_0x1ee8b7['shift']());}};_0x14c299(++_0x5bc82a);}(_0xcb1d,0x18a));var _0xdcb1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcb1d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdcb1('0x0'));var util=require(_0xdcb1('0x1'));var path=require(_0xdcb1('0x2'));var timeout=require(_0xdcb1('0x3'));var express=require('express');var router=express[_0xdcb1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xdcb1('0x5'));var config=require(_0xdcb1('0x6'));var controller=require(_0xdcb1('0x7'));router[_0xdcb1('0x8')]('/',auth[_0xdcb1('0x9')](),controller[_0xdcb1('0xa')]);router[_0xdcb1('0x8')](_0xdcb1('0xb'),auth[_0xdcb1('0x9')](),controller['show']);router[_0xdcb1('0x8')]('/:id/configurations',auth[_0xdcb1('0x9')](),controller['getConfigurations']);router[_0xdcb1('0x8')](_0xdcb1('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xdcb1('0xd')]('/',auth[_0xdcb1('0x9')](),controller[_0xdcb1('0xe')]);router['post'](_0xdcb1('0xf'),auth[_0xdcb1('0x9')](),controller[_0xdcb1('0x10')]);router[_0xdcb1('0x11')](_0xdcb1('0xb'),auth[_0xdcb1('0x9')](),controller[_0xdcb1('0x12')]);router['delete'](_0xdcb1('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xdcb1('0x13')]=router; \ No newline at end of file +var _0x528e=['index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','isAuthenticated'];(function(_0x4dbb84,_0x5707b8){var _0x21f6f5=function(_0x158901){while(--_0x158901){_0x4dbb84['push'](_0x4dbb84['shift']());}};_0x21f6f5(++_0x5707b8);}(_0x528e,0xae));var _0xe528=function(_0x21851b,_0x1461eb){_0x21851b=_0x21851b-0x0;var _0x27c333=_0x528e[_0x21851b];return _0x27c333;};'use strict';var multer=require(_0xe528('0x0'));var util=require(_0xe528('0x1'));var path=require(_0xe528('0x2'));var timeout=require('connect-timeout');var express=require(_0xe528('0x3'));var router=express[_0xe528('0x4')]();var auth=require(_0xe528('0x5'));var interaction=require(_0xe528('0x6'));var config=require(_0xe528('0x7'));var controller=require(_0xe528('0x8'));router['get']('/',auth[_0xe528('0x9')](),controller[_0xe528('0xa')]);router[_0xe528('0xb')](_0xe528('0xc'),auth[_0xe528('0x9')](),controller['show']);router['get'](_0xe528('0xd'),auth[_0xe528('0x9')](),controller[_0xe528('0xe')]);router['get'](_0xe528('0xf'),auth[_0xe528('0x9')](),controller[_0xe528('0x10')]);router[_0xe528('0x11')]('/',auth[_0xe528('0x9')](),controller[_0xe528('0x12')]);router[_0xe528('0x11')](_0xe528('0xd'),auth[_0xe528('0x9')](),controller[_0xe528('0x13')]);router['put'](_0xe528('0xc'),auth['isAuthenticated'](),controller[_0xe528('0x14')]);router[_0xe528('0x15')](_0xe528('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xe528('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index d2567e0..31b8cd1 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27bd=['username','remoteUri','sequelize','STRING'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0x27bd,0x11e));var _0xd27b=function(_0x1ac705,_0x178818){_0x1ac705=_0x1ac705-0x0;var _0x1ec220=_0x27bd[_0x1ac705];return _0x1ec220;};'use strict';var Sequelize=require(_0xd27b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd27b('0x1')],'unique':_0xd27b('0x2')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xd27b('0x3')},'serverUrl':{'type':Sequelize[_0xd27b('0x1')]}}; \ No newline at end of file +var _0x2ac4=['STRING','username','exports'];(function(_0x51670d,_0x4fbde2){var _0x4c036b=function(_0x4d115e){while(--_0x4d115e){_0x51670d['push'](_0x51670d['shift']());}};_0x4c036b(++_0x4fbde2);}(_0x2ac4,0x68));var _0x42ac=function(_0x845505,_0x19e5f3){_0x845505=_0x845505-0x0;var _0x2513b9=_0x2ac4[_0x845505];return _0x2513b9;};'use strict';var Sequelize=require('sequelize');module[_0x42ac('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x42ac('0x1')]},'username':{'type':Sequelize[_0x42ac('0x1')],'unique':_0x42ac('0x2')},'password':{'type':Sequelize[_0x42ac('0x1')]},'remoteUri':{'type':Sequelize[_0x42ac('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x42ac('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 43281b8..fad4a4f 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x243f=['util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','then','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','save','destroy','stack','name','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','SugarcrmAccount','includeAll','include','findAll','rows','show','rawAttributes','options','create','body','find','params','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','date_start','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','stringify','Calls','values','remove','label','endsWith','value','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x42a198,_0x54c3c4){var _0x4c95cf=function(_0x5bc2e0){while(--_0x5bc2e0){_0x42a198['push'](_0x42a198['shift']());}};_0x4c95cf(++_0x54c3c4);}(_0x243f,0x1eb));var _0xf243=function(_0x11bc40,_0x537bbc){_0x11bc40=_0x11bc40-0x0;var _0x2b7a99=_0x243f[_0x11bc40];return _0x2b7a99;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf243('0x0'));var zipdir=require(_0xf243('0x1'));var jsonpatch=require(_0xf243('0x2'));var rp=require(_0xf243('0x3'));var moment=require('moment');var BPromise=require(_0xf243('0x4'));var Mustache=require('mustache');var util=require(_0xf243('0x5'));var path=require(_0xf243('0x6'));var sox=require(_0xf243('0x7'));var csv=require(_0xf243('0x8'));var ejs=require(_0xf243('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf243('0xa'));var crypto=require(_0xf243('0xb'));var jsforce=require(_0xf243('0xc'));var deskjs=require(_0xf243('0xd'));var toCsv=require(_0xf243('0x8'));var querystring=require('querystring');var Papa=require(_0xf243('0xe'));var Redis=require('ioredis');var authService=require(_0xf243('0xf'));var qs=require(_0xf243('0x10'));var hardwareService=require(_0xf243('0x11'));var logger=require(_0xf243('0x12'))(_0xf243('0x13'));var utils=require(_0xf243('0x14'));var config=require(_0xf243('0x15'));var db=require(_0xf243('0x16'))['db'];var integrations=require(_0xf243('0x17'));var jayson=require(_0xf243('0x18'));var client=jayson[_0xf243('0x19')][_0xf243('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xa6e65e,_0x5303a9,_0x1f6f87){if(_0x1f6f87){var _0x2984f2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2984f2[_0xf243('0x1b')](_0x5303a9)){return _0xa6e65e;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xa6e65e;}}function respondWithRpcPromise(_0x4f002c,_0x4d910e,_0x6caf5a,_0x156f70){return new BPromise(function(_0x2c39f9,_0x2a34b4){var _0x2f99e0=_0x156f70||client;return _0x2f99e0['request'](_0x4f002c,_0x6caf5a)[_0xf243('0x1c')](function(_0x365f49){logger['info'](_0xf243('0x1d'),_0x4d910e,'request\x20sent');logger[_0xf243('0x1e')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x4d910e,_0xf243('0x1f'),JSON['stringify'](_0x365f49));if(_0x365f49[_0xf243('0x20')]){if(_0x365f49[_0xf243('0x20')]['code']===0x1f4){logger['error'](_0xf243('0x1d'),_0x4d910e,_0x365f49[_0xf243('0x20')][_0xf243('0x21')]);return _0x2a34b4(_0x365f49[_0xf243('0x20')]['message']);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x4d910e,_0x365f49[_0xf243('0x20')][_0xf243('0x21')]);return _0x2c39f9(_0x365f49[_0xf243('0x20')][_0xf243('0x21')]);}else{logger[_0xf243('0x22')](_0xf243('0x1d'),_0x4d910e,'request\x20sent');_0x2c39f9(_0x365f49[_0xf243('0x23')][_0xf243('0x21')]);}})[_0xf243('0x24')](function(_0x2c7a8c){logger[_0xf243('0x20')](_0xf243('0x1d'),_0x4d910e,_0x2c7a8c);_0x2a34b4(_0x2c7a8c);});});}function respondWithStatusCode(_0x211cf3,_0x3a0347){_0x3a0347=_0x3a0347||0xcc;return function(_0x32a50d){if(_0x32a50d){return _0x211cf3[_0xf243('0x25')](_0x3a0347);}return _0x211cf3[_0xf243('0x26')](_0x3a0347)[_0xf243('0x27')]();};}function respondWithResult(_0x54849d,_0x1bc228){_0x1bc228=_0x1bc228||0xc8;return function(_0x1de000){if(_0x1de000){return _0x54849d[_0xf243('0x26')](_0x1bc228)[_0xf243('0x28')](_0x1de000);}};}function respondWithFilteredResult(_0x593937,_0x9d06b2){return function(_0x422c99){if(_0x422c99){var _0x103e7a=_0x422c99[_0xf243('0x29')],_0x203987=_0x9d06b2[_0xf243('0x2a')],_0x3ad7c9=_0x9d06b2[_0xf243('0x2a')]+_0x9d06b2[_0xf243('0x2b')],_0x179b12;if(_0x3ad7c9>=_0x103e7a){_0x3ad7c9=_0x103e7a;_0x179b12=0xc8;}else{_0x179b12=0xce;}_0x593937[_0xf243('0x26')](_0x179b12);return _0x593937['set'](_0xf243('0x2c'),_0x203987+'-'+_0x3ad7c9+'/'+_0x103e7a)[_0xf243('0x28')](_0x422c99);}return null;};}function patchUpdates(_0x396a17){return function(_0x240ba1){try{jsonpatch['apply'](_0x240ba1,_0x396a17,!![]);}catch(_0x59b4c1){return BPromise['reject'](_0x59b4c1);}return _0x240ba1[_0xf243('0x2d')]();};}function saveUpdates(_0x53d5d1,_0x3eadab){return function(_0x521d09){if(_0x521d09){return _0x521d09['update'](_0x53d5d1)['then'](function(_0x5e7216){return _0x5e7216;});}return null;};}function removeEntity(_0x22b631,_0xfb740d){return function(_0x4f874d){if(_0x4f874d){return _0x4f874d[_0xf243('0x2e')]()[_0xf243('0x1c')](function(){_0x22b631[_0xf243('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ab570,_0x41427a){return function(_0x565f3f){if(!_0x565f3f){_0x1ab570[_0xf243('0x25')](0x194);}return _0x565f3f;};}function handleError(_0x18bc08,_0x36f811){_0x36f811=_0x36f811||0x1f4;return function(_0x3c80b5){logger[_0xf243('0x20')](_0x3c80b5[_0xf243('0x2f')]);if(_0x3c80b5[_0xf243('0x30')]){delete _0x3c80b5[_0xf243('0x30')];}_0x18bc08[_0xf243('0x26')](_0x36f811)['send'](_0x3c80b5);};}exports['index']=function(_0x44ac5a,_0x423671){var _0xf6be54={},_0x4d68bb={},_0x41dd71={'count':0x0,'rows':[]};var _0x4655be=db['SugarcrmAccount']['rawAttributes'];_0x4d68bb[_0xf243('0x31')]=_[_0xf243('0x32')](_0x4655be);_0x4d68bb[_0xf243('0x33')]=_[_0xf243('0x32')](_0x44ac5a['query']);_0x4d68bb['filters']=_[_0xf243('0x34')](_0x4d68bb[_0xf243('0x31')],_0x4d68bb[_0xf243('0x33')]);_0xf6be54[_0xf243('0x35')]=_[_0xf243('0x34')](_0x4d68bb['model'],qs[_0xf243('0x36')](_0x44ac5a[_0xf243('0x33')][_0xf243('0x36')]));_0xf6be54[_0xf243('0x35')]=_0xf6be54[_0xf243('0x35')][_0xf243('0x37')]?_0xf6be54[_0xf243('0x35')]:_0x4d68bb[_0xf243('0x31')];if(!_0x44ac5a['query'][_0xf243('0x38')]('nolimit')){_0xf6be54['limit']=qs[_0xf243('0x2b')](_0x44ac5a[_0xf243('0x33')]['limit']);_0xf6be54[_0xf243('0x2a')]=qs[_0xf243('0x2a')](_0x44ac5a[_0xf243('0x33')]['offset']);}_0xf6be54[_0xf243('0x39')]=qs[_0xf243('0x3a')](_0x44ac5a[_0xf243('0x33')]['sort']);_0xf6be54[_0xf243('0x3b')]=qs[_0xf243('0x3c')](_[_0xf243('0x3d')](_0x44ac5a[_0xf243('0x33')],_0x4d68bb[_0xf243('0x3c')]));if(_0x44ac5a[_0xf243('0x33')][_0xf243('0x3e')]){_0xf6be54[_0xf243('0x3b')]=_[_0xf243('0x3f')](_0xf6be54[_0xf243('0x3b')],{'$or':_[_0xf243('0x40')](_0x4655be,function(_0x2a9c1f){if(_0x2a9c1f[_0xf243('0x41')][_0xf243('0x42')]!==_0xf243('0x43')){var _0x15cde3={};_0x15cde3[_0x2a9c1f[_0xf243('0x44')]]={'$like':'%'+_0x44ac5a[_0xf243('0x33')][_0xf243('0x3e')]+'%'};return _0x15cde3;}})});}_0xf6be54=_[_0xf243('0x3f')]({},_0xf6be54,_0x44ac5a['options']);var _0x3dfd69={'where':_0xf6be54[_0xf243('0x3b')]};return db[_0xf243('0x45')][_0xf243('0x29')](_0x3dfd69)[_0xf243('0x1c')](function(_0x2a617e){_0x41dd71[_0xf243('0x29')]=_0x2a617e;if(_0x44ac5a['query'][_0xf243('0x46')]){_0xf6be54[_0xf243('0x47')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xf243('0x48')](_0xf6be54);})[_0xf243('0x1c')](function(_0x4d09fe){_0x41dd71[_0xf243('0x49')]=_0x4d09fe;return _0x41dd71;})['then'](respondWithFilteredResult(_0x423671,_0xf6be54))['catch'](handleError(_0x423671,null));};exports[_0xf243('0x4a')]=function(_0x20fa7c,_0x3ac66c){var _0x27fd8d={'raw':![],'where':{'id':_0x20fa7c['params']['id']}},_0x57b3cb={};_0x57b3cb[_0xf243('0x31')]=_[_0xf243('0x32')](db[_0xf243('0x45')][_0xf243('0x4b')]);_0x57b3cb[_0xf243('0x33')]=_['keys'](_0x20fa7c[_0xf243('0x33')]);_0x57b3cb[_0xf243('0x3c')]=_[_0xf243('0x34')](_0x57b3cb[_0xf243('0x31')],_0x57b3cb[_0xf243('0x33')]);_0x27fd8d['attributes']=_['intersection'](_0x57b3cb['model'],qs[_0xf243('0x36')](_0x20fa7c['query'][_0xf243('0x36')]));_0x27fd8d[_0xf243('0x35')]=_0x27fd8d[_0xf243('0x35')][_0xf243('0x37')]?_0x27fd8d['attributes']:_0x57b3cb[_0xf243('0x31')];if(_0x20fa7c[_0xf243('0x33')][_0xf243('0x46')]){_0x27fd8d[_0xf243('0x47')]=[{'all':!![]}];}_0x27fd8d=_[_0xf243('0x3f')]({},_0x27fd8d,_0x20fa7c[_0xf243('0x4c')]);return db['SugarcrmAccount']['find'](_0x27fd8d)[_0xf243('0x1c')](handleEntityNotFound(_0x3ac66c,null))['then'](respondWithResult(_0x3ac66c,null))[_0xf243('0x24')](handleError(_0x3ac66c,null));};exports[_0xf243('0x4d')]=function(_0xad3a9e,_0x376a4a){return db[_0xf243('0x45')][_0xf243('0x4d')](_0xad3a9e[_0xf243('0x4e')],{})[_0xf243('0x1c')](respondWithResult(_0x376a4a,0xc9))[_0xf243('0x24')](handleError(_0x376a4a,null));};exports['update']=function(_0x1e2e96,_0x226fcd){if(_0x1e2e96[_0xf243('0x4e')]['id']){delete _0x1e2e96[_0xf243('0x4e')]['id'];}return db[_0xf243('0x45')][_0xf243('0x4f')]({'where':{'id':_0x1e2e96['params']['id']}})[_0xf243('0x1c')](handleEntityNotFound(_0x226fcd,null))[_0xf243('0x1c')](saveUpdates(_0x1e2e96[_0xf243('0x4e')],null))[_0xf243('0x1c')](respondWithResult(_0x226fcd,null))['catch'](handleError(_0x226fcd,null));};exports[_0xf243('0x2e')]=function(_0x2eedbf,_0x1cb981){return db[_0xf243('0x45')][_0xf243('0x4f')]({'where':{'id':_0x2eedbf[_0xf243('0x50')]['id']}})['then'](handleEntityNotFound(_0x1cb981,null))[_0xf243('0x1c')](removeEntity(_0x1cb981,null))[_0xf243('0x24')](handleError(_0x1cb981,null));};exports[_0xf243('0x51')]=function(_0x54b001,_0x15e8c3,_0x7985e8){var _0x21b919={};var _0x543e02={};var _0x6ec5cb;var _0x3886d9;return db['SugarcrmAccount'][_0xf243('0x52')]({'where':{'id':_0x54b001[_0xf243('0x50')]['id']}})[_0xf243('0x1c')](handleEntityNotFound(_0x15e8c3,null))[_0xf243('0x1c')](function(_0x5b8d27){if(_0x5b8d27){_0x6ec5cb=_0x5b8d27;_0x543e02[_0xf243('0x31')]=_['keys'](db[_0xf243('0x53')][_0xf243('0x4b')]);_0x543e02[_0xf243('0x33')]=_[_0xf243('0x32')](_0x54b001[_0xf243('0x33')]);_0x543e02[_0xf243('0x3c')]=_[_0xf243('0x34')](_0x543e02[_0xf243('0x31')],_0x543e02[_0xf243('0x33')]);_0x21b919['attributes']=_['intersection'](_0x543e02[_0xf243('0x31')],qs[_0xf243('0x36')](_0x54b001[_0xf243('0x33')][_0xf243('0x36')]));_0x21b919[_0xf243('0x35')]=_0x21b919[_0xf243('0x35')][_0xf243('0x37')]?_0x21b919[_0xf243('0x35')]:_0x543e02[_0xf243('0x31')];_0x21b919[_0xf243('0x39')]=qs[_0xf243('0x3a')](_0x54b001['query'][_0xf243('0x3a')]);_0x21b919[_0xf243('0x3b')]=qs[_0xf243('0x3c')](_[_0xf243('0x3d')](_0x54b001[_0xf243('0x33')],_0x543e02[_0xf243('0x3c')]));if(_0x54b001['query'][_0xf243('0x3e')]){_0x21b919['where']=_[_0xf243('0x3f')](_0x21b919[_0xf243('0x3b')],{'$or':_[_0xf243('0x40')](_0x21b919[_0xf243('0x35')],function(_0x440cb2){var _0x391164={};_0x391164[_0x440cb2]={'$like':'%'+_0x54b001[_0xf243('0x33')]['filter']+'%'};return _0x391164;})});}_0x21b919=_['merge']({},_0x21b919,_0x54b001[_0xf243('0x4c')]);return _0x6ec5cb['getConfigurations'](_0x21b919);}})[_0xf243('0x1c')](function(_0x394f6f){if(_0x394f6f){_0x3886d9=_0x394f6f['length'];if(!_0x54b001[_0xf243('0x33')][_0xf243('0x38')]('nolimit')){_0x21b919[_0xf243('0x2b')]=qs['limit'](_0x54b001[_0xf243('0x33')][_0xf243('0x2b')]);_0x21b919['offset']=qs[_0xf243('0x2a')](_0x54b001[_0xf243('0x33')][_0xf243('0x2a')]);}return _0x6ec5cb[_0xf243('0x51')](_0x21b919);}})[_0xf243('0x1c')](function(_0x2f47cd){if(_0x2f47cd){return _0x2f47cd?{'count':_0x3886d9,'rows':_0x2f47cd}:null;}})['then'](respondWithResult(_0x15e8c3,null))['catch'](handleError(_0x15e8c3,null));};exports[_0xf243('0x54')]=function(_0x1322b0,_0x56c5f2,_0x336f85){if(_0x1322b0[_0xf243('0x4e')]['id']){delete _0x1322b0['body']['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x1322b0['params']['id']}})[_0xf243('0x1c')](handleEntityNotFound(_0x56c5f2,null))[_0xf243('0x1c')](function(_0x22e481){if(_0x22e481){_0x1322b0['body']['AccountId']=_0x22e481['id'];_0x1322b0[_0xf243('0x4e')][_0xf243('0x55')]=integrations['getSubjects'](_0x1322b0['body'][_0xf243('0x56')],_0x1322b0['body'][_0xf243('0x41')]);_0x1322b0[_0xf243('0x4e')][_0xf243('0x57')]=integrations[_0xf243('0x58')](_0x1322b0['body'][_0xf243('0x56')],_0x1322b0[_0xf243('0x4e')][_0xf243('0x41')]);return db[_0xf243('0x53')][_0xf243('0x4d')](_0x1322b0['body'],{'include':[{'model':db[_0xf243('0x59')],'as':_0xf243('0x55')},{'model':db[_0xf243('0x59')],'as':_0xf243('0x57')}]});}return null;})[_0xf243('0x1c')](respondWithResult(_0x56c5f2,null))[_0xf243('0x24')](handleError(_0x56c5f2,null));};exports['getFields']=function(_0x400d69,_0x87b4c1,_0x588ca3){var _0x2399d1='';var _0x38f505=['id','name',_0xf243('0x5a'),_0xf243('0x5b'),'description',_0xf243('0x5c'),'duration_hours','duration_minutes',_0xf243('0x5d'),_0xf243('0x5e'),_0xf243('0x5f'),_0xf243('0x60')];return db[_0xf243('0x45')][_0xf243('0x52')]({'where':{'id':_0x400d69[_0xf243('0x50')]['id']},'attributes':['id',_0xf243('0x61'),_0xf243('0x62'),_0xf243('0x63')]})[_0xf243('0x1c')](handleEntityNotFound(_0x87b4c1,null))[_0xf243('0x1c')](function(_0xec0623){if(_0xec0623){_0x2399d1=_0xec0623[_0xf243('0x63')];var _0x19db25=_0x2399d1[_0xf243('0x64')](-0x1);if(_0x19db25==='/'){_0x2399d1=_0x2399d1['substring'](0x0,_0x2399d1[_0xf243('0x65')](_0x19db25));}return rp({'method':_0xf243('0x66'),'uri':util[_0xf243('0x67')](_0xf243('0x68'),_0x2399d1,_0xf243('0x69')),'json':!![],'form':{'method':_0xf243('0x6a'),'input_type':'JSON','response_type':_0xf243('0x6b'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xec0623[_0xf243('0x61')],'password':_0xec0623[_0xf243('0x62')],'encryption':_0xf243('0x6c')},'application':_0xf243('0x6d')})}});}})[_0xf243('0x1c')](function(_0x46948a){if(_0x46948a&&_0x46948a[_0xf243('0x30')]!==_0xf243('0x6e')&&_0x46948a['name']!=='Password\x20Expired'){return rp({'method':_0xf243('0x66'),'uri':util[_0xf243('0x67')](_0xf243('0x68'),_0x2399d1,_0xf243('0x69')),'json':!![],'form':{'method':_0xf243('0x6f'),'input_type':_0xf243('0x6b'),'response_type':_0xf243('0x6b'),'rest_data':JSON[_0xf243('0x70')]({'session':_0x46948a['id'],'module_name':_0xf243('0x71')})}})[_0xf243('0x1c')](function(_0x2c3619){if(_0x2c3619){var _0x51c4f6=_[_0xf243('0x72')](_0x2c3619['module_fields']);_[_0xf243('0x73')](_0x51c4f6,function(_0x3c7119){return _0x38f505['includes'](_0x3c7119[_0xf243('0x30')]);});return{'count':_0x51c4f6[_0xf243('0x37')],'rows':_[_0xf243('0x40')](_0x51c4f6,function(_0x1bc6ba){return{'id':_0x1bc6ba['name'],'name':_0x1bc6ba[_0xf243('0x74')],'custom':_[_0xf243('0x75')](_0x1bc6ba[_0xf243('0x30')],'_c')?!![]:![],'options':_0x1bc6ba[_0xf243('0x4c')]?_['map'](_[_0xf243('0x72')](_0x1bc6ba[_0xf243('0x4c')]),function(_0x995564){return{'name':_0x995564[_0xf243('0x76')],'value':_0x995564[_0xf243('0x30')]};}):[]};})};}})[_0xf243('0x1c')](respondWithResult(_0x87b4c1,null))[_0xf243('0x24')](function(_0x472cdd){var _0x12e8b5=_0x400d69['query'][_0xf243('0x1b')]?0x1f4:_0x472cdd['statusCode']||0x1f4;logger[_0xf243('0x20')](_0xf243('0x77'),_0xf243('0x78'),_0x12e8b5,JSON['stringify'](_0x472cdd));delete _0x472cdd['name'];if(_0x12e8b5===0x191){_0x12e8b5=0x190;}_0x87b4c1[_0xf243('0x26')](_0x12e8b5)[_0xf243('0x79')](_0x400d69['query'][_0xf243('0x1b')]?{'message':_0xf243('0x7a'),'statusCode':_0x472cdd[_0xf243('0x7b')]}:_0x472cdd);});}else{var _0x4f3c0f=0x1f4;_0x87b4c1['status'](_0x4f3c0f)[_0xf243('0x79')]({'message':_0xf243('0x7a'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x63b6=['rows','show','find','body','getConfigurations','findOne','params','SugarcrmConfiguration','Subjects','channel','Descriptions','getDescriptions','create','SugarcrmField','assigned_user_id','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','username','remoteUri','slice','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','password','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','values','remove','includes','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','reject','save','update','destroy','name','send','index','SugarcrmAccount','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll'];(function(_0x49fcfb,_0x504dec){var _0x964926=function(_0x327977){while(--_0x327977){_0x49fcfb['push'](_0x49fcfb['shift']());}};_0x964926(++_0x504dec);}(_0x63b6,0x127));var _0x663b=function(_0x4b52b4,_0x35a1fd){_0x4b52b4=_0x4b52b4-0x0;var _0x3b4dd7=_0x63b6[_0x4b52b4];return _0x3b4dd7;};'use strict';var pdf=require(_0x663b('0x0'));var emlformat=require(_0x663b('0x1'));var rimraf=require(_0x663b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x663b('0x3'));var rp=require('request-promise');var moment=require(_0x663b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x663b('0x5'));var util=require(_0x663b('0x6'));var path=require(_0x663b('0x7'));var sox=require('sox');var csv=require(_0x663b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x663b('0x9'));var squel=require('squel');var crypto=require(_0x663b('0xa'));var jsforce=require(_0x663b('0xb'));var deskjs=require(_0x663b('0xc'));var toCsv=require(_0x663b('0x8'));var querystring=require(_0x663b('0xd'));var Papa=require(_0x663b('0xe'));var Redis=require('ioredis');var authService=require(_0x663b('0xf'));var qs=require(_0x663b('0x10'));var hardwareService=require(_0x663b('0x11'));var logger=require(_0x663b('0x12'))(_0x663b('0x13'));var utils=require(_0x663b('0x14'));var config=require(_0x663b('0x15'));var db=require(_0x663b('0x16'))['db'];var integrations=require(_0x663b('0x17'));var jayson=require(_0x663b('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x1ef28c,_0xa5b910,_0x3baf10){if(_0x3baf10){var _0x9d2c68=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9d2c68[_0x663b('0x19')](_0xa5b910)){return _0x1ef28c;}else{throw new Error(_0x663b('0x1a'));}}else{return _0x1ef28c;}}function respondWithRpcPromise(_0x4e263a,_0x18a6da,_0x2ed216,_0x4738e2){return new BPromise(function(_0x1f8238,_0x343eac){var _0x46db68=_0x4738e2||client;return _0x46db68[_0x663b('0x1b')](_0x4e263a,_0x2ed216)[_0x663b('0x1c')](function(_0x63443b){logger[_0x663b('0x1d')](_0x663b('0x1e'),_0x18a6da,_0x663b('0x1f'));logger[_0x663b('0x20')](_0x663b('0x21'),_0x18a6da,'request\x20sent',JSON[_0x663b('0x22')](_0x63443b));if(_0x63443b[_0x663b('0x23')]){if(_0x63443b['error'][_0x663b('0x24')]===0x1f4){logger[_0x663b('0x23')]('SugarcrmAccount,\x20%s,\x20%s',_0x18a6da,_0x63443b['error'][_0x663b('0x25')]);return _0x343eac(_0x63443b[_0x663b('0x23')][_0x663b('0x25')]);}logger[_0x663b('0x23')]('SugarcrmAccount,\x20%s,\x20%s',_0x18a6da,_0x63443b[_0x663b('0x23')][_0x663b('0x25')]);return _0x1f8238(_0x63443b['error']['message']);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x18a6da,_0x663b('0x1f'));_0x1f8238(_0x63443b[_0x663b('0x26')][_0x663b('0x25')]);}})[_0x663b('0x27')](function(_0x25c295){logger[_0x663b('0x23')](_0x663b('0x1e'),_0x18a6da,_0x25c295);_0x343eac(_0x25c295);});});}function respondWithStatusCode(_0x30bd5c,_0x3eab48){_0x3eab48=_0x3eab48||0xcc;return function(_0x5063b2){if(_0x5063b2){return _0x30bd5c[_0x663b('0x28')](_0x3eab48);}return _0x30bd5c[_0x663b('0x29')](_0x3eab48)['end']();};}function respondWithResult(_0x37a5f4,_0x54bb0d){_0x54bb0d=_0x54bb0d||0xc8;return function(_0x1e4e97){if(_0x1e4e97){return _0x37a5f4[_0x663b('0x29')](_0x54bb0d)[_0x663b('0x2a')](_0x1e4e97);}};}function respondWithFilteredResult(_0x513bdd,_0x397e4b){return function(_0x10f2e0){if(_0x10f2e0){var _0x3a3ebc=_0x10f2e0['count'],_0x439fc6=_0x397e4b[_0x663b('0x2b')],_0x5a1580=_0x397e4b[_0x663b('0x2b')]+_0x397e4b['limit'],_0x4ef875;if(_0x5a1580>=_0x3a3ebc){_0x5a1580=_0x3a3ebc;_0x4ef875=0xc8;}else{_0x4ef875=0xce;}_0x513bdd[_0x663b('0x29')](_0x4ef875);return _0x513bdd['set']('Content-Range',_0x439fc6+'-'+_0x5a1580+'/'+_0x3a3ebc)[_0x663b('0x2a')](_0x10f2e0);}return null;};}function patchUpdates(_0x42dd16){return function(_0x31ca2e){try{jsonpatch['apply'](_0x31ca2e,_0x42dd16,!![]);}catch(_0x4a165a){return BPromise[_0x663b('0x2c')](_0x4a165a);}return _0x31ca2e[_0x663b('0x2d')]();};}function saveUpdates(_0x2e4c3c,_0x38aeb3){return function(_0x429f56){if(_0x429f56){return _0x429f56[_0x663b('0x2e')](_0x2e4c3c)[_0x663b('0x1c')](function(_0x40cb7f){return _0x40cb7f;});}return null;};}function removeEntity(_0x168298,_0x28f000){return function(_0x6e7795){if(_0x6e7795){return _0x6e7795[_0x663b('0x2f')]()[_0x663b('0x1c')](function(){_0x168298[_0x663b('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bece6,_0xa1dedc){return function(_0x2740d2){if(!_0x2740d2){_0x4bece6[_0x663b('0x28')](0x194);}return _0x2740d2;};}function handleError(_0x48c9d1,_0x494e36){_0x494e36=_0x494e36||0x1f4;return function(_0x507b20){logger['error'](_0x507b20['stack']);if(_0x507b20[_0x663b('0x30')]){delete _0x507b20[_0x663b('0x30')];}_0x48c9d1[_0x663b('0x29')](_0x494e36)[_0x663b('0x31')](_0x507b20);};}exports[_0x663b('0x32')]=function(_0xa5a801,_0x48e9a2){var _0x744be={},_0x4635db={},_0x4f8a95={'count':0x0,'rows':[]};var _0x4a411f=db[_0x663b('0x33')][_0x663b('0x34')];_0x4635db[_0x663b('0x35')]=_['keys'](_0x4a411f);_0x4635db['query']=_[_0x663b('0x36')](_0xa5a801[_0x663b('0x37')]);_0x4635db['filters']=_[_0x663b('0x38')](_0x4635db[_0x663b('0x35')],_0x4635db[_0x663b('0x37')]);_0x744be['attributes']=_[_0x663b('0x38')](_0x4635db[_0x663b('0x35')],qs['fields'](_0xa5a801[_0x663b('0x37')][_0x663b('0x39')]));_0x744be[_0x663b('0x3a')]=_0x744be['attributes'][_0x663b('0x3b')]?_0x744be[_0x663b('0x3a')]:_0x4635db[_0x663b('0x35')];if(!_0xa5a801['query'][_0x663b('0x3c')](_0x663b('0x3d'))){_0x744be['limit']=qs[_0x663b('0x3e')](_0xa5a801['query'][_0x663b('0x3e')]);_0x744be[_0x663b('0x2b')]=qs[_0x663b('0x2b')](_0xa5a801[_0x663b('0x37')]['offset']);}_0x744be[_0x663b('0x3f')]=qs[_0x663b('0x40')](_0xa5a801['query'][_0x663b('0x40')]);_0x744be[_0x663b('0x41')]=qs[_0x663b('0x42')](_[_0x663b('0x43')](_0xa5a801[_0x663b('0x37')],_0x4635db['filters']));if(_0xa5a801[_0x663b('0x37')][_0x663b('0x44')]){_0x744be[_0x663b('0x41')]=_[_0x663b('0x45')](_0x744be[_0x663b('0x41')],{'$or':_[_0x663b('0x46')](_0x4a411f,function(_0x4cff90){if(_0x4cff90[_0x663b('0x47')][_0x663b('0x48')]!==_0x663b('0x49')){var _0x3f6362={};_0x3f6362[_0x4cff90[_0x663b('0x4a')]]={'$like':'%'+_0xa5a801[_0x663b('0x37')][_0x663b('0x44')]+'%'};return _0x3f6362;}})});}_0x744be=_[_0x663b('0x45')]({},_0x744be,_0xa5a801[_0x663b('0x4b')]);var _0x2ef284={'where':_0x744be[_0x663b('0x41')]};return db['SugarcrmAccount'][_0x663b('0x4c')](_0x2ef284)[_0x663b('0x1c')](function(_0x336aee){_0x4f8a95[_0x663b('0x4c')]=_0x336aee;if(_0xa5a801[_0x663b('0x37')][_0x663b('0x4d')]){_0x744be[_0x663b('0x4e')]=[{'all':!![]}];}return db[_0x663b('0x33')][_0x663b('0x4f')](_0x744be);})[_0x663b('0x1c')](function(_0x57bcc9){_0x4f8a95[_0x663b('0x50')]=_0x57bcc9;return _0x4f8a95;})[_0x663b('0x1c')](respondWithFilteredResult(_0x48e9a2,_0x744be))['catch'](handleError(_0x48e9a2,null));};exports[_0x663b('0x51')]=function(_0x2a9847,_0x10ae27){var _0x4a4ff5={'raw':![],'where':{'id':_0x2a9847['params']['id']}},_0x51f206={};_0x51f206[_0x663b('0x35')]=_['keys'](db[_0x663b('0x33')][_0x663b('0x34')]);_0x51f206['query']=_[_0x663b('0x36')](_0x2a9847[_0x663b('0x37')]);_0x51f206[_0x663b('0x42')]=_[_0x663b('0x38')](_0x51f206[_0x663b('0x35')],_0x51f206['query']);_0x4a4ff5[_0x663b('0x3a')]=_[_0x663b('0x38')](_0x51f206['model'],qs['fields'](_0x2a9847[_0x663b('0x37')][_0x663b('0x39')]));_0x4a4ff5[_0x663b('0x3a')]=_0x4a4ff5[_0x663b('0x3a')][_0x663b('0x3b')]?_0x4a4ff5[_0x663b('0x3a')]:_0x51f206['model'];if(_0x2a9847[_0x663b('0x37')][_0x663b('0x4d')]){_0x4a4ff5[_0x663b('0x4e')]=[{'all':!![]}];}_0x4a4ff5=_[_0x663b('0x45')]({},_0x4a4ff5,_0x2a9847[_0x663b('0x4b')]);return db[_0x663b('0x33')][_0x663b('0x52')](_0x4a4ff5)[_0x663b('0x1c')](handleEntityNotFound(_0x10ae27,null))[_0x663b('0x1c')](respondWithResult(_0x10ae27,null))[_0x663b('0x27')](handleError(_0x10ae27,null));};exports['create']=function(_0x325ccc,_0x1984d3){return db[_0x663b('0x33')]['create'](_0x325ccc[_0x663b('0x53')],{})[_0x663b('0x1c')](respondWithResult(_0x1984d3,0xc9))[_0x663b('0x27')](handleError(_0x1984d3,null));};exports[_0x663b('0x2e')]=function(_0x5cc317,_0x14e079){if(_0x5cc317[_0x663b('0x53')]['id']){delete _0x5cc317[_0x663b('0x53')]['id'];}return db['SugarcrmAccount'][_0x663b('0x52')]({'where':{'id':_0x5cc317['params']['id']}})['then'](handleEntityNotFound(_0x14e079,null))[_0x663b('0x1c')](saveUpdates(_0x5cc317['body'],null))[_0x663b('0x1c')](respondWithResult(_0x14e079,null))[_0x663b('0x27')](handleError(_0x14e079,null));};exports[_0x663b('0x2f')]=function(_0x5ceda3,_0x57b0cb){return db[_0x663b('0x33')][_0x663b('0x52')]({'where':{'id':_0x5ceda3['params']['id']}})['then'](handleEntityNotFound(_0x57b0cb,null))[_0x663b('0x1c')](removeEntity(_0x57b0cb,null))[_0x663b('0x27')](handleError(_0x57b0cb,null));};exports[_0x663b('0x54')]=function(_0x25b2bf,_0xc08425,_0xece6d6){var _0x4d8427={};var _0x3c6067={};var _0x25fb0f;var _0x36d90c;return db['SugarcrmAccount'][_0x663b('0x55')]({'where':{'id':_0x25b2bf[_0x663b('0x56')]['id']}})[_0x663b('0x1c')](handleEntityNotFound(_0xc08425,null))[_0x663b('0x1c')](function(_0x562c5f){if(_0x562c5f){_0x25fb0f=_0x562c5f;_0x3c6067[_0x663b('0x35')]=_['keys'](db[_0x663b('0x57')][_0x663b('0x34')]);_0x3c6067['query']=_[_0x663b('0x36')](_0x25b2bf[_0x663b('0x37')]);_0x3c6067[_0x663b('0x42')]=_[_0x663b('0x38')](_0x3c6067[_0x663b('0x35')],_0x3c6067[_0x663b('0x37')]);_0x4d8427[_0x663b('0x3a')]=_[_0x663b('0x38')](_0x3c6067[_0x663b('0x35')],qs['fields'](_0x25b2bf[_0x663b('0x37')]['fields']));_0x4d8427[_0x663b('0x3a')]=_0x4d8427[_0x663b('0x3a')][_0x663b('0x3b')]?_0x4d8427[_0x663b('0x3a')]:_0x3c6067['model'];_0x4d8427[_0x663b('0x3f')]=qs[_0x663b('0x40')](_0x25b2bf[_0x663b('0x37')][_0x663b('0x40')]);_0x4d8427['where']=qs[_0x663b('0x42')](_[_0x663b('0x43')](_0x25b2bf['query'],_0x3c6067['filters']));if(_0x25b2bf[_0x663b('0x37')][_0x663b('0x44')]){_0x4d8427[_0x663b('0x41')]=_['merge'](_0x4d8427['where'],{'$or':_[_0x663b('0x46')](_0x4d8427[_0x663b('0x3a')],function(_0x24d5ba){var _0x2c1114={};_0x2c1114[_0x24d5ba]={'$like':'%'+_0x25b2bf[_0x663b('0x37')]['filter']+'%'};return _0x2c1114;})});}_0x4d8427=_['merge']({},_0x4d8427,_0x25b2bf[_0x663b('0x4b')]);return _0x25fb0f[_0x663b('0x54')](_0x4d8427);}})[_0x663b('0x1c')](function(_0x3a9816){if(_0x3a9816){_0x36d90c=_0x3a9816[_0x663b('0x3b')];if(!_0x25b2bf['query'][_0x663b('0x3c')](_0x663b('0x3d'))){_0x4d8427['limit']=qs[_0x663b('0x3e')](_0x25b2bf['query'][_0x663b('0x3e')]);_0x4d8427[_0x663b('0x2b')]=qs[_0x663b('0x2b')](_0x25b2bf['query']['offset']);}return _0x25fb0f[_0x663b('0x54')](_0x4d8427);}})['then'](function(_0x359a50){if(_0x359a50){return _0x359a50?{'count':_0x36d90c,'rows':_0x359a50}:null;}})[_0x663b('0x1c')](respondWithResult(_0xc08425,null))[_0x663b('0x27')](handleError(_0xc08425,null));};exports['addConfiguration']=function(_0x2bb032,_0x3d5996,_0x3faacf){if(_0x2bb032[_0x663b('0x53')]['id']){delete _0x2bb032['body']['id'];}return db[_0x663b('0x33')][_0x663b('0x55')]({'where':{'id':_0x2bb032[_0x663b('0x56')]['id']}})[_0x663b('0x1c')](handleEntityNotFound(_0x3d5996,null))[_0x663b('0x1c')](function(_0x280c57){if(_0x280c57){_0x2bb032[_0x663b('0x53')]['AccountId']=_0x280c57['id'];_0x2bb032[_0x663b('0x53')][_0x663b('0x58')]=integrations['getSubjects'](_0x2bb032[_0x663b('0x53')][_0x663b('0x59')],_0x2bb032['body'][_0x663b('0x47')]);_0x2bb032[_0x663b('0x53')][_0x663b('0x5a')]=integrations[_0x663b('0x5b')](_0x2bb032['body'][_0x663b('0x59')],_0x2bb032[_0x663b('0x53')][_0x663b('0x47')]);return db[_0x663b('0x57')][_0x663b('0x5c')](_0x2bb032['body'],{'include':[{'model':db[_0x663b('0x5d')],'as':_0x663b('0x58')},{'model':db[_0x663b('0x5d')],'as':_0x663b('0x5a')}]});}return null;})[_0x663b('0x1c')](respondWithResult(_0x3d5996,null))[_0x663b('0x27')](handleError(_0x3d5996,null));};exports['getFields']=function(_0x31d31a,_0x6c875a,_0x3890c7){var _0x19ff57='';var _0x45997b=['id','name',_0x663b('0x5e'),'created_by',_0x663b('0x5f'),'date_start',_0x663b('0x60'),_0x663b('0x61'),_0x663b('0x62'),_0x663b('0x63'),_0x663b('0x64'),'direction'];return db['SugarcrmAccount'][_0x663b('0x55')]({'where':{'id':_0x31d31a['params']['id']},'attributes':['id',_0x663b('0x65'),'password',_0x663b('0x66')]})['then'](handleEntityNotFound(_0x6c875a,null))[_0x663b('0x1c')](function(_0xa9342){if(_0xa9342){_0x19ff57=_0xa9342['remoteUri'];var _0x246a24=_0x19ff57[_0x663b('0x67')](-0x1);if(_0x246a24==='/'){_0x19ff57=_0x19ff57['substring'](0x0,_0x19ff57[_0x663b('0x68')](_0x246a24));}return rp({'method':_0x663b('0x69'),'uri':util['format'](_0x663b('0x6a'),_0x19ff57,_0x663b('0x6b')),'json':!![],'form':{'method':_0x663b('0x6c'),'input_type':_0x663b('0x6d'),'response_type':_0x663b('0x6d'),'rest_data':JSON[_0x663b('0x22')]({'user_auth':{'user_name':_0xa9342[_0x663b('0x65')],'password':_0xa9342[_0x663b('0x6e')],'encryption':'PLAIN'},'application':_0x663b('0x6f')})}});}})[_0x663b('0x1c')](function(_0x3aca8e){if(_0x3aca8e&&_0x3aca8e[_0x663b('0x30')]!==_0x663b('0x70')&&_0x3aca8e['name']!==_0x663b('0x71')){return rp({'method':_0x663b('0x69'),'uri':util[_0x663b('0x72')](_0x663b('0x6a'),_0x19ff57,_0x663b('0x6b')),'json':!![],'form':{'method':_0x663b('0x73'),'input_type':_0x663b('0x6d'),'response_type':'JSON','rest_data':JSON[_0x663b('0x22')]({'session':_0x3aca8e['id'],'module_name':'Calls'})}})[_0x663b('0x1c')](function(_0xa3214b){if(_0xa3214b){var _0x32b75f=_[_0x663b('0x74')](_0xa3214b['module_fields']);_[_0x663b('0x75')](_0x32b75f,function(_0x1171af){return _0x45997b[_0x663b('0x76')](_0x1171af[_0x663b('0x30')]);});return{'count':_0x32b75f[_0x663b('0x3b')],'rows':_[_0x663b('0x46')](_0x32b75f,function(_0x52cc2d){return{'id':_0x52cc2d[_0x663b('0x30')],'name':_0x52cc2d['label'],'custom':_[_0x663b('0x77')](_0x52cc2d[_0x663b('0x30')],'_c')?!![]:![],'options':_0x52cc2d[_0x663b('0x4b')]?_[_0x663b('0x46')](_[_0x663b('0x74')](_0x52cc2d[_0x663b('0x4b')]),function(_0x37fcb7){return{'name':_0x37fcb7[_0x663b('0x78')],'value':_0x37fcb7[_0x663b('0x30')]};}):[]};})};}})[_0x663b('0x1c')](respondWithResult(_0x6c875a,null))['catch'](function(_0x478410){var _0x34bfc4=_0x31d31a[_0x663b('0x37')][_0x663b('0x19')]?0x1f4:_0x478410[_0x663b('0x79')]||0x1f4;logger['error'](_0x663b('0x7a'),_0x663b('0x7b'),_0x34bfc4,JSON['stringify'](_0x478410));delete _0x478410[_0x663b('0x30')];if(_0x34bfc4===0x191){_0x34bfc4=0x190;}_0x6c875a[_0x663b('0x29')](_0x34bfc4)['send'](_0x31d31a[_0x663b('0x37')][_0x663b('0x19')]?{'message':_0x663b('0x7c'),'statusCode':_0x478410[_0x663b('0x79')]}:_0x478410);});}else{var _0x5bb820=0x1f4;_0x6c875a[_0x663b('0x29')](_0x5bb820)['send']({'message':_0x663b('0x7c'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index bfb87bd..d0a7499 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bc7=['int_sugarcrm_accounts','../../config/logger','moment','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount'];(function(_0x4bb5d5,_0x36e798){var _0x3f7c4d=function(_0x204545){while(--_0x204545){_0x4bb5d5['push'](_0x4bb5d5['shift']());}};_0x3f7c4d(++_0x36e798);}(_0x8bc7,0x145));var _0x78bc=function(_0x5aeee3,_0x1794f4){_0x5aeee3=_0x5aeee3-0x0;var _0x8f9067=_0x8bc7[_0x5aeee3];return _0x8f9067;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x78bc('0x0'))('api');var moment=require(_0x78bc('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x78bc('0x2'));var rimraf=require('rimraf');var config=require(_0x78bc('0x3'));var attributes=require(_0x78bc('0x4'));var integrations=require(_0x78bc('0x5'));module['exports']=function(_0x3916c7,_0x12febb){return _0x3916c7[_0x78bc('0x6')](_0x78bc('0x7'),attributes,{'tableName':_0x78bc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x098d=['util','../../config/logger','bluebird','request-promise','path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x098d,0x1e0));var _0xd098=function(_0x566bdf,_0x1f4861){_0x566bdf=_0x566bdf-0x0;var _0x331215=_0x098d[_0x566bdf];return _0x331215;};'use strict';var _=require(_0xd098('0x0'));var util=require(_0xd098('0x1'));var logger=require(_0xd098('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd098('0x3'));var rp=require(_0xd098('0x4'));var fs=require('fs');var path=require(_0xd098('0x5'));var rimraf=require(_0xd098('0x6'));var config=require('../../config/environment');var attributes=require(_0xd098('0x7'));var integrations=require(_0xd098('0x8'));module[_0xd098('0x9')]=function(_0x351e1c,_0x528170){return _0x351e1c[_0xd098('0xa')](_0xd098('0xb'),attributes,{'tableName':_0xd098('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index edd616d..d2aba45 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa53b=['SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','GetSugarcrmAccount','ShowSugarcrmAccount','lodash','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x2fb3d9,_0x453475){var _0x4048d5=function(_0x3bda9){while(--_0x3bda9){_0x2fb3d9['push'](_0x2fb3d9['shift']());}};_0x4048d5(++_0x453475);}(_0xa53b,0xcd));var _0xba53=function(_0x4c0a37,_0x2efb71){_0x4c0a37=_0x4c0a37-0x0;var _0x814ee2=_0xa53b[_0x4c0a37];return _0x814ee2;};'use strict';var _=require(_0xba53('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xba53('0x1'));var rs=require(_0xba53('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba53('0x3'))(_0xba53('0x4'));var config=require(_0xba53('0x5'));var jayson=require(_0xba53('0x6'));var client=jayson[_0xba53('0x7')][_0xba53('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5bff9a,_0x5cc5bd,_0x2781f6){return new BPromise(function(_0xc8acc1,_0x483811){return client['request'](_0x5bff9a,_0x2781f6)['then'](function(_0x1d0fd2){logger[_0xba53('0x9')](_0xba53('0xa'),_0x5cc5bd,'request\x20sent');logger[_0xba53('0xb')](_0xba53('0xc'),_0x5cc5bd,_0xba53('0xd'),JSON[_0xba53('0xe')](_0x1d0fd2));if(_0x1d0fd2[_0xba53('0xf')]){if(_0x1d0fd2[_0xba53('0xf')]['code']===0x1f4){logger[_0xba53('0xf')](_0xba53('0xa'),_0x5cc5bd,_0x1d0fd2[_0xba53('0xf')][_0xba53('0x10')]);return _0x483811(_0x1d0fd2[_0xba53('0xf')]['message']);}logger['error'](_0xba53('0xa'),_0x5cc5bd,_0x1d0fd2[_0xba53('0xf')][_0xba53('0x10')]);return _0xc8acc1(_0x1d0fd2['error'][_0xba53('0x10')]);}else{logger[_0xba53('0x9')](_0xba53('0xa'),_0x5cc5bd,_0xba53('0xd'));_0xc8acc1(_0x1d0fd2[_0xba53('0x11')][_0xba53('0x10')]);}})[_0xba53('0x12')](function(_0x38dd2b){logger[_0xba53('0xf')](_0xba53('0xa'),_0x5cc5bd,_0x38dd2b);_0x483811(_0x38dd2b);});});}exports['GetSugarcrmAccount']=function(_0x2889be){var _0x6524c0=this;return new Promise(function(_0x39cbb5,_0x38d6a0){return db[_0xba53('0x13')][_0xba53('0x14')]({'raw':_0x2889be[_0xba53('0x15')]?_0x2889be[_0xba53('0x15')][_0xba53('0x16')]===undefined?!![]:![]:!![],'where':_0x2889be[_0xba53('0x15')]?_0x2889be[_0xba53('0x15')][_0xba53('0x17')]||null:null,'attributes':_0x2889be[_0xba53('0x15')]?_0x2889be[_0xba53('0x15')][_0xba53('0x18')]||null:null,'limit':_0x2889be['options']?_0x2889be['options'][_0xba53('0x19')]||null:null,'include':_0x2889be[_0xba53('0x15')]?_0x2889be['options'][_0xba53('0x1a')]?_['map'](_0x2889be[_0xba53('0x15')][_0xba53('0x1a')],function(_0x2ff8e6){return{'model':db[_0x2ff8e6['model']],'as':_0x2ff8e6['as'],'attributes':_0x2ff8e6[_0xba53('0x18')],'include':_0x2ff8e6[_0xba53('0x1a')]?_[_0xba53('0x1b')](_0x2ff8e6[_0xba53('0x1a')],function(_0x23c266){return{'model':db[_0x23c266[_0xba53('0x1c')]],'as':_0x23c266['as'],'attributes':_0x23c266[_0xba53('0x18')],'include':_0x23c266['include']?_[_0xba53('0x1b')](_0x23c266[_0xba53('0x1a')],function(_0x3ef609){return{'model':db[_0x3ef609[_0xba53('0x1c')]],'as':_0x3ef609['as'],'attributes':_0x3ef609[_0xba53('0x18')]};}):[]};}):[]};}):[]:[]})[_0xba53('0x1d')](function(_0x1c90f0){logger[_0xba53('0x9')](_0xba53('0x1e'),_0x2889be);logger[_0xba53('0xb')](_0xba53('0x1e'),_0x2889be,JSON[_0xba53('0xe')](_0x1c90f0));_0x39cbb5(_0x1c90f0);})[_0xba53('0x12')](function(_0x19d7ba){logger[_0xba53('0xf')]('GetSugarcrmAccount',_0x19d7ba[_0xba53('0x10')],_0x2889be);_0x38d6a0(_0x6524c0['error'](0x1f4,_0x19d7ba['message']));});});};exports[_0xba53('0x1f')]=function(_0x12b40f){var _0x1e0a32=this;return new Promise(function(_0x4e0709,_0xaabf17){return db['SugarcrmAccount']['find']({'raw':_0x12b40f['options']?_0x12b40f[_0xba53('0x15')][_0xba53('0x16')]===undefined?!![]:![]:!![],'where':_0x12b40f[_0xba53('0x15')]?_0x12b40f[_0xba53('0x15')][_0xba53('0x17')]||null:null,'attributes':_0x12b40f['options']?_0x12b40f[_0xba53('0x15')]['attributes']||null:null,'include':_0x12b40f['options']?_0x12b40f[_0xba53('0x15')]['include']?_[_0xba53('0x1b')](_0x12b40f[_0xba53('0x15')][_0xba53('0x1a')],function(_0x11d2b5){return{'model':db[_0x11d2b5[_0xba53('0x1c')]],'as':_0x11d2b5['as'],'attributes':_0x11d2b5[_0xba53('0x18')],'include':_0x11d2b5['include']?_['map'](_0x11d2b5['include'],function(_0x51b8a8){return{'model':db[_0x51b8a8[_0xba53('0x1c')]],'as':_0x51b8a8['as'],'attributes':_0x51b8a8[_0xba53('0x18')],'include':_0x51b8a8[_0xba53('0x1a')]?_[_0xba53('0x1b')](_0x51b8a8['include'],function(_0x440639){return{'model':db[_0x440639['model']],'as':_0x440639['as'],'attributes':_0x440639['attributes']};}):[]};}):[]};}):[]:[]})[_0xba53('0x1d')](function(_0x208b4f){logger['info'](_0xba53('0x1f'),_0x12b40f);logger[_0xba53('0xb')](_0xba53('0x1f'),_0x12b40f,JSON[_0xba53('0xe')](_0x208b4f));_0x4e0709(_0x208b4f);})[_0xba53('0x12')](function(_0x4b7da6){logger[_0xba53('0xf')](_0xba53('0x1f'),_0x4b7da6[_0xba53('0x10')],_0x12b40f);_0xaabf17(_0x1e0a32[_0xba53('0xf')](0x1f4,_0x4b7da6[_0xba53('0x10')]));});});}; \ No newline at end of file +var _0xc57c=['model','GetSugarcrmAccount','find','ShowSugarcrmAccount','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xc57c,0x1b5));var _0xcc57=function(_0x3eb4bb,_0x3729af){_0x3eb4bb=_0x3eb4bb-0x0;var _0xae45d2=_0xc57c[_0x3eb4bb];return _0xae45d2;};'use strict';var _=require('lodash');var util=require(_0xcc57('0x0'));var moment=require(_0xcc57('0x1'));var BPromise=require(_0xcc57('0x2'));var rs=require(_0xcc57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc57('0x4'))['db'];var utils=require(_0xcc57('0x5'));var logger=require(_0xcc57('0x6'))('rpc');var config=require(_0xcc57('0x7'));var jayson=require(_0xcc57('0x8'));var client=jayson[_0xcc57('0x9')][_0xcc57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fc52f,_0x4ba103,_0x4892c1){return new BPromise(function(_0x18bdcb,_0x51a958){return client[_0xcc57('0xb')](_0x4fc52f,_0x4892c1)[_0xcc57('0xc')](function(_0x34e5b3){logger[_0xcc57('0xd')](_0xcc57('0xe'),_0x4ba103,'request\x20sent');logger[_0xcc57('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x4ba103,_0xcc57('0x10'),JSON[_0xcc57('0x11')](_0x34e5b3));if(_0x34e5b3[_0xcc57('0x12')]){if(_0x34e5b3[_0xcc57('0x12')][_0xcc57('0x13')]===0x1f4){logger[_0xcc57('0x12')](_0xcc57('0xe'),_0x4ba103,_0x34e5b3[_0xcc57('0x12')][_0xcc57('0x14')]);return _0x51a958(_0x34e5b3[_0xcc57('0x12')][_0xcc57('0x14')]);}logger[_0xcc57('0x12')](_0xcc57('0xe'),_0x4ba103,_0x34e5b3['error'][_0xcc57('0x14')]);return _0x18bdcb(_0x34e5b3['error'][_0xcc57('0x14')]);}else{logger[_0xcc57('0xd')](_0xcc57('0xe'),_0x4ba103,_0xcc57('0x10'));_0x18bdcb(_0x34e5b3[_0xcc57('0x15')][_0xcc57('0x14')]);}})['catch'](function(_0x1b3333){logger['error'](_0xcc57('0xe'),_0x4ba103,_0x1b3333);_0x51a958(_0x1b3333);});});}exports['GetSugarcrmAccount']=function(_0x4565e8){var _0x25c10a=this;return new Promise(function(_0x13dea6,_0x910c04){return db[_0xcc57('0x16')][_0xcc57('0x17')]({'raw':_0x4565e8[_0xcc57('0x18')]?_0x4565e8['options'][_0xcc57('0x19')]===undefined?!![]:![]:!![],'where':_0x4565e8[_0xcc57('0x18')]?_0x4565e8[_0xcc57('0x18')][_0xcc57('0x1a')]||null:null,'attributes':_0x4565e8['options']?_0x4565e8['options'][_0xcc57('0x1b')]||null:null,'limit':_0x4565e8[_0xcc57('0x18')]?_0x4565e8[_0xcc57('0x18')][_0xcc57('0x1c')]||null:null,'include':_0x4565e8[_0xcc57('0x18')]?_0x4565e8['options'][_0xcc57('0x1d')]?_[_0xcc57('0x1e')](_0x4565e8[_0xcc57('0x18')]['include'],function(_0x549140){return{'model':db[_0x549140[_0xcc57('0x1f')]],'as':_0x549140['as'],'attributes':_0x549140[_0xcc57('0x1b')],'include':_0x549140[_0xcc57('0x1d')]?_['map'](_0x549140['include'],function(_0x15390f){return{'model':db[_0x15390f[_0xcc57('0x1f')]],'as':_0x15390f['as'],'attributes':_0x15390f['attributes'],'include':_0x15390f[_0xcc57('0x1d')]?_[_0xcc57('0x1e')](_0x15390f[_0xcc57('0x1d')],function(_0x4ead61){return{'model':db[_0x4ead61['model']],'as':_0x4ead61['as'],'attributes':_0x4ead61[_0xcc57('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcc57('0xc')](function(_0x2a97e7){logger['info'](_0xcc57('0x20'),_0x4565e8);logger[_0xcc57('0xf')](_0xcc57('0x20'),_0x4565e8,JSON[_0xcc57('0x11')](_0x2a97e7));_0x13dea6(_0x2a97e7);})['catch'](function(_0x1675f8){logger[_0xcc57('0x12')]('GetSugarcrmAccount',_0x1675f8[_0xcc57('0x14')],_0x4565e8);_0x910c04(_0x25c10a[_0xcc57('0x12')](0x1f4,_0x1675f8[_0xcc57('0x14')]));});});};exports['ShowSugarcrmAccount']=function(_0x783b34){var _0x3d790f=this;return new Promise(function(_0x2076cd,_0x49c3d6){return db[_0xcc57('0x16')][_0xcc57('0x21')]({'raw':_0x783b34[_0xcc57('0x18')]?_0x783b34['options'][_0xcc57('0x19')]===undefined?!![]:![]:!![],'where':_0x783b34[_0xcc57('0x18')]?_0x783b34[_0xcc57('0x18')]['where']||null:null,'attributes':_0x783b34[_0xcc57('0x18')]?_0x783b34[_0xcc57('0x18')]['attributes']||null:null,'include':_0x783b34[_0xcc57('0x18')]?_0x783b34[_0xcc57('0x18')]['include']?_['map'](_0x783b34[_0xcc57('0x18')][_0xcc57('0x1d')],function(_0x271688){return{'model':db[_0x271688[_0xcc57('0x1f')]],'as':_0x271688['as'],'attributes':_0x271688['attributes'],'include':_0x271688['include']?_['map'](_0x271688[_0xcc57('0x1d')],function(_0x454bb0){return{'model':db[_0x454bb0[_0xcc57('0x1f')]],'as':_0x454bb0['as'],'attributes':_0x454bb0[_0xcc57('0x1b')],'include':_0x454bb0['include']?_[_0xcc57('0x1e')](_0x454bb0[_0xcc57('0x1d')],function(_0x2bbff8){return{'model':db[_0x2bbff8[_0xcc57('0x1f')]],'as':_0x2bbff8['as'],'attributes':_0x2bbff8[_0xcc57('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcc57('0xc')](function(_0x1c75a4){logger[_0xcc57('0xd')](_0xcc57('0x22'),_0x783b34);logger[_0xcc57('0xf')](_0xcc57('0x22'),_0x783b34,JSON[_0xcc57('0x11')](_0x1c75a4));_0x2076cd(_0x1c75a4);})[_0xcc57('0x23')](function(_0x3e9307){logger[_0xcc57('0x12')](_0xcc57('0x22'),_0x3e9307['message'],_0x783b34);_0x49c3d6(_0x3d790f['error'](0x1f4,_0x3e9307['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 5f5732d..a5c98cd 100644 --- a/server/api/intSugarcrmConfiguration/index.js +++ b/server/api/intSugarcrmConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9fc=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xb9fc,0x150));var _0xcb9f=function(_0x1458c9,_0x270260){_0x1458c9=_0x1458c9-0x0;var _0xb59fd5=_0xb9fc[_0x1458c9];return _0xb59fd5;};'use strict';var multer=require(_0xcb9f('0x0'));var util=require(_0xcb9f('0x1'));var path=require(_0xcb9f('0x2'));var timeout=require('connect-timeout');var express=require(_0xcb9f('0x3'));var router=express[_0xcb9f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xcb9f('0x5'));var config=require(_0xcb9f('0x6'));var controller=require(_0xcb9f('0x7'));router['get']('/',auth[_0xcb9f('0x8')](),controller[_0xcb9f('0x9')]);router[_0xcb9f('0xa')](_0xcb9f('0xb'),auth[_0xcb9f('0x8')](),controller[_0xcb9f('0xc')]);router[_0xcb9f('0xa')](_0xcb9f('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xcb9f('0xa')](_0xcb9f('0xe'),auth[_0xcb9f('0x8')](),controller[_0xcb9f('0xf')]);router[_0xcb9f('0xa')](_0xcb9f('0x10'),auth[_0xcb9f('0x8')](),controller[_0xcb9f('0x11')]);router[_0xcb9f('0x12')]('/',auth['isAuthenticated'](),controller[_0xcb9f('0x13')]);router[_0xcb9f('0x14')]('/:id',auth[_0xcb9f('0x8')](),controller[_0xcb9f('0x15')]);router[_0xcb9f('0x16')]('/:id',auth[_0xcb9f('0x8')](),controller[_0xcb9f('0x17')]);module[_0xcb9f('0x18')]=router; \ No newline at end of file +var _0x064c=['../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','delete','destroy','util','path','Router','../../components/auth/service'];(function(_0x3bc011,_0x3b0c93){var _0x2b59c8=function(_0x569117){while(--_0x569117){_0x3bc011['push'](_0x3bc011['shift']());}};_0x2b59c8(++_0x3b0c93);}(_0x064c,0xf3));var _0xc064=function(_0x43e4b3,_0x1444de){_0x43e4b3=_0x43e4b3-0x0;var _0x10c655=_0x064c[_0x43e4b3];return _0x10c655;};'use strict';var multer=require('multer');var util=require(_0xc064('0x0'));var path=require(_0xc064('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc064('0x2')]();var auth=require(_0xc064('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc064('0x4'));var controller=require(_0xc064('0x5'));router[_0xc064('0x6')]('/',auth['isAuthenticated'](),controller[_0xc064('0x7')]);router['get'](_0xc064('0x8'),auth[_0xc064('0x9')](),controller[_0xc064('0xa')]);router['get'](_0xc064('0xb'),auth[_0xc064('0x9')](),controller['getFields']);router[_0xc064('0x6')](_0xc064('0xc'),auth[_0xc064('0x9')](),controller[_0xc064('0xd')]);router['get'](_0xc064('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xc064('0xf')]('/',auth['isAuthenticated'](),controller[_0xc064('0x10')]);router['put'](_0xc064('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xc064('0x11')](_0xc064('0x8'),auth[_0xc064('0x9')](),controller[_0xc064('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 304ba7d..d3a985d 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb129=['STRING','sequelize','exports'];(function(_0x4ec36a,_0x3126b6){var _0x26988d=function(_0x42a0c6){while(--_0x42a0c6){_0x4ec36a['push'](_0x4ec36a['shift']());}};_0x26988d(++_0x3126b6);}(_0xb129,0xb2));var _0x9b12=function(_0x1edce7,_0x1bdd0a){_0x1edce7=_0x1edce7-0x0;var _0x115073=_0xb129[_0x1edce7];return _0x115073;};'use strict';var Sequelize=require(_0x9b12('0x0'));module[_0x9b12('0x1')]={'name':{'type':Sequelize[_0x9b12('0x2')]},'description':{'type':Sequelize[_0x9b12('0x2')]}}; \ No newline at end of file +var _0xa3a4=['STRING','exports'];(function(_0x88e1c5,_0x838675){var _0xcab58e=function(_0x43295c){while(--_0x43295c){_0x88e1c5['push'](_0x88e1c5['shift']());}};_0xcab58e(++_0x838675);}(_0xa3a4,0x1ef));var _0x4a3a=function(_0x356b19,_0x29281e){_0x356b19=_0x356b19-0x0;var _0x6d9b84=_0xa3a4[_0x356b19];return _0x6d9b84;};'use strict';var Sequelize=require('sequelize');module[_0x4a3a('0x0')]={'name':{'type':Sequelize[_0x4a3a('0x1')]},'description':{'type':Sequelize[_0x4a3a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index b270610..0c5fbca 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6f2=['findAll','rows','catch','show','length','includeAll','include','find','create','body','params','getFields','findOne','SugarcrmField','rawAttributes','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','name','send','index','model','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','key','options','SugarcrmConfiguration'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xc6f2,0x1ce));var _0x2c6f=function(_0x3f3838,_0x17ccdb){_0x3f3838=_0x3f3838-0x0;var _0x2acaf7=_0xc6f2[_0x3f3838];return _0x2acaf7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2c6f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c6f('0x1'));var jsonpatch=require(_0x2c6f('0x2'));var rp=require(_0x2c6f('0x3'));var moment=require(_0x2c6f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2c6f('0x5'));var util=require(_0x2c6f('0x6'));var path=require(_0x2c6f('0x7'));var sox=require(_0x2c6f('0x8'));var csv=require(_0x2c6f('0x9'));var ejs=require(_0x2c6f('0xa'));var fs=require('fs');var _=require(_0x2c6f('0xb'));var squel=require(_0x2c6f('0xc'));var crypto=require(_0x2c6f('0xd'));var jsforce=require(_0x2c6f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2c6f('0xf'));var Papa=require(_0x2c6f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2c6f('0x11'));var hardwareService=require(_0x2c6f('0x12'));var logger=require(_0x2c6f('0x13'))(_0x2c6f('0x14'));var utils=require(_0x2c6f('0x15'));var config=require(_0x2c6f('0x16'));var db=require(_0x2c6f('0x17'))['db'];var jayson=require(_0x2c6f('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x2fd3c2,_0x44b64b,_0x546495){if(_0x546495){var _0x4547df=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4547df[_0x2c6f('0x19')](_0x44b64b)){return _0x2fd3c2;}else{throw new Error(_0x2c6f('0x1a'));}}else{return _0x2fd3c2;}}function respondWithRpcPromise(_0x2fda24,_0x32193a,_0xffaa99,_0x1e8457){return new BPromise(function(_0x329133,_0x374e5e){var _0x14d58e=_0x1e8457||client;return _0x14d58e[_0x2c6f('0x1b')](_0x2fda24,_0xffaa99)[_0x2c6f('0x1c')](function(_0x1d0264){logger[_0x2c6f('0x1d')](_0x2c6f('0x1e'),_0x32193a,_0x2c6f('0x1f'));logger[_0x2c6f('0x20')](_0x2c6f('0x21'),_0x32193a,_0x2c6f('0x1f'),JSON['stringify'](_0x1d0264));if(_0x1d0264[_0x2c6f('0x22')]){if(_0x1d0264[_0x2c6f('0x22')][_0x2c6f('0x23')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x32193a,_0x1d0264[_0x2c6f('0x22')][_0x2c6f('0x24')]);return _0x374e5e(_0x1d0264[_0x2c6f('0x22')][_0x2c6f('0x24')]);}logger[_0x2c6f('0x22')](_0x2c6f('0x1e'),_0x32193a,_0x1d0264[_0x2c6f('0x22')]['message']);return _0x329133(_0x1d0264['error'][_0x2c6f('0x24')]);}else{logger[_0x2c6f('0x1d')](_0x2c6f('0x1e'),_0x32193a,'request\x20sent');_0x329133(_0x1d0264[_0x2c6f('0x25')][_0x2c6f('0x24')]);}})['catch'](function(_0x3aca35){logger[_0x2c6f('0x22')](_0x2c6f('0x1e'),_0x32193a,_0x3aca35);_0x374e5e(_0x3aca35);});});}function respondWithStatusCode(_0x159376,_0x2c1273){_0x2c1273=_0x2c1273||0xcc;return function(_0x4ce732){if(_0x4ce732){return _0x159376[_0x2c6f('0x26')](_0x2c1273);}return _0x159376[_0x2c6f('0x27')](_0x2c1273)[_0x2c6f('0x28')]();};}function respondWithResult(_0x445d09,_0x1ee140){_0x1ee140=_0x1ee140||0xc8;return function(_0x124832){if(_0x124832){return _0x445d09['status'](_0x1ee140)[_0x2c6f('0x29')](_0x124832);}};}function respondWithFilteredResult(_0x29c402,_0x2f8dcf){return function(_0x35cbea){if(_0x35cbea){var _0x1a8a6b=_0x35cbea[_0x2c6f('0x2a')],_0x2899ea=_0x2f8dcf[_0x2c6f('0x2b')],_0x422ba8=_0x2f8dcf[_0x2c6f('0x2b')]+_0x2f8dcf[_0x2c6f('0x2c')],_0x4a4087;if(_0x422ba8>=_0x1a8a6b){_0x422ba8=_0x1a8a6b;_0x4a4087=0xc8;}else{_0x4a4087=0xce;}_0x29c402[_0x2c6f('0x27')](_0x4a4087);return _0x29c402[_0x2c6f('0x2d')]('Content-Range',_0x2899ea+'-'+_0x422ba8+'/'+_0x1a8a6b)[_0x2c6f('0x29')](_0x35cbea);}return null;};}function patchUpdates(_0x2ad80a){return function(_0x523178){try{jsonpatch[_0x2c6f('0x2e')](_0x523178,_0x2ad80a,!![]);}catch(_0x3eda1a){return BPromise[_0x2c6f('0x2f')](_0x3eda1a);}return _0x523178[_0x2c6f('0x30')]();};}function saveUpdates(_0x58699f,_0x57ef13){return function(_0x529951){if(_0x529951){return _0x529951[_0x2c6f('0x31')](_0x58699f)[_0x2c6f('0x1c')](function(_0x37306f){return _0x37306f;});}return null;};}function removeEntity(_0x1ff6f5,_0x869949){return function(_0x334548){if(_0x334548){return _0x334548['destroy']()[_0x2c6f('0x1c')](function(){_0x1ff6f5[_0x2c6f('0x27')](0xcc)[_0x2c6f('0x28')]();});}};}function handleEntityNotFound(_0x5bcd23,_0x2ff1dc){return function(_0x13029b){if(!_0x13029b){_0x5bcd23[_0x2c6f('0x26')](0x194);}return _0x13029b;};}function handleError(_0x71d6fb,_0x165071){_0x165071=_0x165071||0x1f4;return function(_0x55bb49){logger['error'](_0x55bb49['stack']);if(_0x55bb49[_0x2c6f('0x32')]){delete _0x55bb49['name'];}_0x71d6fb[_0x2c6f('0x27')](_0x165071)[_0x2c6f('0x33')](_0x55bb49);};}exports[_0x2c6f('0x34')]=function(_0x1a51d6,_0x121cee){var _0x2fbcb1={},_0x191f05={},_0x226a63={'count':0x0,'rows':[]};var _0x4d307a=db['SugarcrmConfiguration']['rawAttributes'];_0x191f05[_0x2c6f('0x35')]=_[_0x2c6f('0x36')](_0x4d307a);_0x191f05['query']=_['keys'](_0x1a51d6['query']);_0x191f05['filters']=_[_0x2c6f('0x37')](_0x191f05[_0x2c6f('0x35')],_0x191f05[_0x2c6f('0x38')]);_0x2fbcb1[_0x2c6f('0x39')]=_[_0x2c6f('0x37')](_0x191f05[_0x2c6f('0x35')],qs[_0x2c6f('0x3a')](_0x1a51d6['query'][_0x2c6f('0x3a')]));_0x2fbcb1[_0x2c6f('0x39')]=_0x2fbcb1[_0x2c6f('0x39')]['length']?_0x2fbcb1['attributes']:_0x191f05[_0x2c6f('0x35')];if(!_0x1a51d6[_0x2c6f('0x38')][_0x2c6f('0x3b')](_0x2c6f('0x3c'))){_0x2fbcb1['limit']=qs[_0x2c6f('0x2c')](_0x1a51d6[_0x2c6f('0x38')]['limit']);_0x2fbcb1[_0x2c6f('0x2b')]=qs['offset'](_0x1a51d6['query'][_0x2c6f('0x2b')]);}_0x2fbcb1[_0x2c6f('0x3d')]=qs[_0x2c6f('0x3e')](_0x1a51d6['query'][_0x2c6f('0x3e')]);_0x2fbcb1[_0x2c6f('0x3f')]=qs['filters'](_[_0x2c6f('0x40')](_0x1a51d6[_0x2c6f('0x38')],_0x191f05[_0x2c6f('0x41')]));if(_0x1a51d6[_0x2c6f('0x38')][_0x2c6f('0x42')]){_0x2fbcb1[_0x2c6f('0x3f')]=_[_0x2c6f('0x43')](_0x2fbcb1[_0x2c6f('0x3f')],{'$or':_[_0x2c6f('0x44')](_0x4d307a,function(_0x5a2fba){if(_0x5a2fba['type'][_0x2c6f('0x45')]!=='VIRTUAL'){var _0x7aec8c={};_0x7aec8c[_0x5a2fba['field']]={'$like':'%'+_0x1a51d6[_0x2c6f('0x38')]['filter']+'%'};return _0x7aec8c;}})});}_0x2fbcb1=_[_0x2c6f('0x43')]({},_0x2fbcb1,_0x1a51d6[_0x2c6f('0x46')]);var _0x6a70e={'where':_0x2fbcb1[_0x2c6f('0x3f')]};return db['SugarcrmConfiguration'][_0x2c6f('0x2a')](_0x6a70e)[_0x2c6f('0x1c')](function(_0x54a1a5){_0x226a63[_0x2c6f('0x2a')]=_0x54a1a5;if(_0x1a51d6['query']['includeAll']){_0x2fbcb1['include']=[{'all':!![]}];}return db[_0x2c6f('0x47')][_0x2c6f('0x48')](_0x2fbcb1);})[_0x2c6f('0x1c')](function(_0x5567e8){_0x226a63[_0x2c6f('0x49')]=_0x5567e8;return _0x226a63;})[_0x2c6f('0x1c')](respondWithFilteredResult(_0x121cee,_0x2fbcb1))[_0x2c6f('0x4a')](handleError(_0x121cee,null));};exports[_0x2c6f('0x4b')]=function(_0x1d8732,_0x5f3477){var _0x5746f5={'raw':![],'where':{'id':_0x1d8732['params']['id']}},_0xfbe88b={};_0xfbe88b['model']=_['keys'](db['SugarcrmConfiguration']['rawAttributes']);_0xfbe88b[_0x2c6f('0x38')]=_[_0x2c6f('0x36')](_0x1d8732[_0x2c6f('0x38')]);_0xfbe88b[_0x2c6f('0x41')]=_[_0x2c6f('0x37')](_0xfbe88b[_0x2c6f('0x35')],_0xfbe88b['query']);_0x5746f5[_0x2c6f('0x39')]=_['intersection'](_0xfbe88b[_0x2c6f('0x35')],qs['fields'](_0x1d8732[_0x2c6f('0x38')][_0x2c6f('0x3a')]));_0x5746f5['attributes']=_0x5746f5[_0x2c6f('0x39')][_0x2c6f('0x4c')]?_0x5746f5[_0x2c6f('0x39')]:_0xfbe88b[_0x2c6f('0x35')];if(_0x1d8732[_0x2c6f('0x38')][_0x2c6f('0x4d')]){_0x5746f5[_0x2c6f('0x4e')]=[{'all':!![]}];}_0x5746f5=_[_0x2c6f('0x43')]({},_0x5746f5,_0x1d8732[_0x2c6f('0x46')]);return db[_0x2c6f('0x47')][_0x2c6f('0x4f')](_0x5746f5)['then'](handleEntityNotFound(_0x5f3477,null))[_0x2c6f('0x1c')](respondWithResult(_0x5f3477,null))[_0x2c6f('0x4a')](handleError(_0x5f3477,null));};exports[_0x2c6f('0x50')]=function(_0xa01811,_0x412917){return db[_0x2c6f('0x47')][_0x2c6f('0x50')](_0xa01811[_0x2c6f('0x51')],{})['then'](respondWithResult(_0x412917,0xc9))[_0x2c6f('0x4a')](handleError(_0x412917,null));};exports[_0x2c6f('0x31')]=function(_0x261278,_0x25078b){if(_0x261278[_0x2c6f('0x51')]['id']){delete _0x261278[_0x2c6f('0x51')]['id'];}return db[_0x2c6f('0x47')][_0x2c6f('0x4f')]({'where':{'id':_0x261278[_0x2c6f('0x52')]['id']}})[_0x2c6f('0x1c')](handleEntityNotFound(_0x25078b,null))[_0x2c6f('0x1c')](saveUpdates(_0x261278[_0x2c6f('0x51')],null))['then'](respondWithResult(_0x25078b,null))['catch'](handleError(_0x25078b,null));};exports['destroy']=function(_0x193f48,_0x11d772){return db[_0x2c6f('0x47')]['find']({'where':{'id':_0x193f48[_0x2c6f('0x52')]['id']}})[_0x2c6f('0x1c')](handleEntityNotFound(_0x11d772,null))[_0x2c6f('0x1c')](removeEntity(_0x11d772,null))['catch'](handleError(_0x11d772,null));};exports[_0x2c6f('0x53')]=function(_0x17123c,_0x38b4e4,_0x39747f){var _0x4def73={};var _0x2a3bf2={};var _0x37f9bb;var _0x5a1110;return db[_0x2c6f('0x47')][_0x2c6f('0x54')]({'where':{'id':_0x17123c['params']['id']}})['then'](handleEntityNotFound(_0x38b4e4,null))['then'](function(_0x1659a0){if(_0x1659a0){_0x37f9bb=_0x1659a0;_0x2a3bf2[_0x2c6f('0x35')]=_[_0x2c6f('0x36')](db[_0x2c6f('0x55')][_0x2c6f('0x56')]);_0x2a3bf2[_0x2c6f('0x38')]=_[_0x2c6f('0x36')](_0x17123c[_0x2c6f('0x38')]);_0x2a3bf2[_0x2c6f('0x41')]=_['intersection'](_0x2a3bf2[_0x2c6f('0x35')],_0x2a3bf2['query']);_0x4def73[_0x2c6f('0x39')]=_[_0x2c6f('0x37')](_0x2a3bf2['model'],qs[_0x2c6f('0x3a')](_0x17123c[_0x2c6f('0x38')]['fields']));_0x4def73[_0x2c6f('0x39')]=_0x4def73[_0x2c6f('0x39')]['length']?_0x4def73[_0x2c6f('0x39')]:_0x2a3bf2[_0x2c6f('0x35')];_0x4def73[_0x2c6f('0x3d')]=qs['sort'](_0x17123c[_0x2c6f('0x38')][_0x2c6f('0x3e')]);_0x4def73[_0x2c6f('0x3f')]=qs[_0x2c6f('0x41')](_[_0x2c6f('0x40')](_0x17123c[_0x2c6f('0x38')],_0x2a3bf2[_0x2c6f('0x41')]));if(_0x17123c[_0x2c6f('0x38')][_0x2c6f('0x42')]){_0x4def73[_0x2c6f('0x3f')]=_[_0x2c6f('0x43')](_0x4def73[_0x2c6f('0x3f')],{'$or':_[_0x2c6f('0x44')](_0x4def73[_0x2c6f('0x39')],function(_0x527a0c){var _0xfa44b7={};_0xfa44b7[_0x527a0c]={'$like':'%'+_0x17123c[_0x2c6f('0x38')]['filter']+'%'};return _0xfa44b7;})});}_0x4def73=_[_0x2c6f('0x43')]({},_0x4def73,_0x17123c[_0x2c6f('0x46')]);return _0x37f9bb['getFields'](_0x4def73);}})['then'](function(_0x39786a){if(_0x39786a){_0x5a1110=_0x39786a[_0x2c6f('0x4c')];if(!_0x17123c['query']['hasOwnProperty']('nolimit')){_0x4def73[_0x2c6f('0x2c')]=qs[_0x2c6f('0x2c')](_0x17123c[_0x2c6f('0x38')][_0x2c6f('0x2c')]);_0x4def73['offset']=qs[_0x2c6f('0x2b')](_0x17123c[_0x2c6f('0x38')][_0x2c6f('0x2b')]);}return _0x37f9bb['getFields'](_0x4def73);}})[_0x2c6f('0x1c')](function(_0x312b5d){if(_0x312b5d){return _0x312b5d?{'count':_0x5a1110,'rows':_0x312b5d}:null;}})[_0x2c6f('0x1c')](respondWithResult(_0x38b4e4,null))['catch'](handleError(_0x38b4e4,null));};exports[_0x2c6f('0x57')]=function(_0x216991,_0x2a493e,_0x26824e){var _0x4865f6={};var _0x44c21b={};var _0x542d0e;var _0x58ac1f;return db[_0x2c6f('0x47')][_0x2c6f('0x54')]({'where':{'id':_0x216991['params']['id']}})[_0x2c6f('0x1c')](handleEntityNotFound(_0x2a493e,null))[_0x2c6f('0x1c')](function(_0x27ead4){if(_0x27ead4){_0x542d0e=_0x27ead4;_0x44c21b[_0x2c6f('0x35')]=_[_0x2c6f('0x36')](db[_0x2c6f('0x55')]['rawAttributes']);_0x44c21b[_0x2c6f('0x38')]=_[_0x2c6f('0x36')](_0x216991[_0x2c6f('0x38')]);_0x44c21b[_0x2c6f('0x41')]=_[_0x2c6f('0x37')](_0x44c21b[_0x2c6f('0x35')],_0x44c21b['query']);_0x4865f6[_0x2c6f('0x39')]=_['intersection'](_0x44c21b[_0x2c6f('0x35')],qs['fields'](_0x216991[_0x2c6f('0x38')][_0x2c6f('0x3a')]));_0x4865f6[_0x2c6f('0x39')]=_0x4865f6[_0x2c6f('0x39')][_0x2c6f('0x4c')]?_0x4865f6[_0x2c6f('0x39')]:_0x44c21b[_0x2c6f('0x35')];_0x4865f6['order']=qs[_0x2c6f('0x3e')](_0x216991[_0x2c6f('0x38')][_0x2c6f('0x3e')]);_0x4865f6[_0x2c6f('0x3f')]=qs[_0x2c6f('0x41')](_[_0x2c6f('0x40')](_0x216991['query'],_0x44c21b[_0x2c6f('0x41')]));if(_0x216991[_0x2c6f('0x38')]['filter']){_0x4865f6[_0x2c6f('0x3f')]=_['merge'](_0x4865f6['where'],{'$or':_['map'](_0x4865f6[_0x2c6f('0x39')],function(_0xc18c1c){var _0x1bbd58={};_0x1bbd58[_0xc18c1c]={'$like':'%'+_0x216991[_0x2c6f('0x38')][_0x2c6f('0x42')]+'%'};return _0x1bbd58;})});}_0x4865f6=_['merge']({},_0x4865f6,_0x216991[_0x2c6f('0x46')]);return _0x542d0e[_0x2c6f('0x57')](_0x4865f6);}})[_0x2c6f('0x1c')](function(_0x110f52){if(_0x110f52){_0x58ac1f=_0x110f52[_0x2c6f('0x4c')];if(!_0x216991['query'][_0x2c6f('0x3b')]('nolimit')){_0x4865f6[_0x2c6f('0x2c')]=qs[_0x2c6f('0x2c')](_0x216991[_0x2c6f('0x38')][_0x2c6f('0x2c')]);_0x4865f6[_0x2c6f('0x2b')]=qs[_0x2c6f('0x2b')](_0x216991['query'][_0x2c6f('0x2b')]);}return _0x542d0e[_0x2c6f('0x57')](_0x4865f6);}})[_0x2c6f('0x1c')](function(_0x56861f){if(_0x56861f){return _0x56861f?{'count':_0x58ac1f,'rows':_0x56861f}:null;}})[_0x2c6f('0x1c')](respondWithResult(_0x2a493e,null))['catch'](handleError(_0x2a493e,null));};exports['getDescriptions']=function(_0x2f6f7f,_0x260540,_0x3a504c){var _0x40f96a={};var _0x4a67d4={};var _0x1bd8c9;var _0x162f83;return db[_0x2c6f('0x47')][_0x2c6f('0x54')]({'where':{'id':_0x2f6f7f[_0x2c6f('0x52')]['id']}})[_0x2c6f('0x1c')](handleEntityNotFound(_0x260540,null))[_0x2c6f('0x1c')](function(_0x51f667){if(_0x51f667){_0x1bd8c9=_0x51f667;_0x4a67d4[_0x2c6f('0x35')]=_[_0x2c6f('0x36')](db[_0x2c6f('0x55')][_0x2c6f('0x56')]);_0x4a67d4[_0x2c6f('0x38')]=_[_0x2c6f('0x36')](_0x2f6f7f['query']);_0x4a67d4[_0x2c6f('0x41')]=_[_0x2c6f('0x37')](_0x4a67d4[_0x2c6f('0x35')],_0x4a67d4[_0x2c6f('0x38')]);_0x40f96a[_0x2c6f('0x39')]=_['intersection'](_0x4a67d4['model'],qs['fields'](_0x2f6f7f[_0x2c6f('0x38')]['fields']));_0x40f96a['attributes']=_0x40f96a[_0x2c6f('0x39')][_0x2c6f('0x4c')]?_0x40f96a[_0x2c6f('0x39')]:_0x4a67d4[_0x2c6f('0x35')];_0x40f96a[_0x2c6f('0x3d')]=qs[_0x2c6f('0x3e')](_0x2f6f7f[_0x2c6f('0x38')]['sort']);_0x40f96a[_0x2c6f('0x3f')]=qs[_0x2c6f('0x41')](_[_0x2c6f('0x40')](_0x2f6f7f[_0x2c6f('0x38')],_0x4a67d4[_0x2c6f('0x41')]));if(_0x2f6f7f[_0x2c6f('0x38')]['filter']){_0x40f96a['where']=_[_0x2c6f('0x43')](_0x40f96a['where'],{'$or':_[_0x2c6f('0x44')](_0x40f96a[_0x2c6f('0x39')],function(_0x3828bb){var _0x5755d4={};_0x5755d4[_0x3828bb]={'$like':'%'+_0x2f6f7f[_0x2c6f('0x38')][_0x2c6f('0x42')]+'%'};return _0x5755d4;})});}_0x40f96a=_[_0x2c6f('0x43')]({},_0x40f96a,_0x2f6f7f[_0x2c6f('0x46')]);return _0x1bd8c9['getDescriptions'](_0x40f96a);}})[_0x2c6f('0x1c')](function(_0x443a03){if(_0x443a03){_0x162f83=_0x443a03['length'];if(!_0x2f6f7f[_0x2c6f('0x38')]['hasOwnProperty'](_0x2c6f('0x3c'))){_0x40f96a['limit']=qs['limit'](_0x2f6f7f[_0x2c6f('0x38')]['limit']);_0x40f96a[_0x2c6f('0x2b')]=qs['offset'](_0x2f6f7f[_0x2c6f('0x38')][_0x2c6f('0x2b')]);}return _0x1bd8c9[_0x2c6f('0x58')](_0x40f96a);}})[_0x2c6f('0x1c')](function(_0x3899d1){if(_0x3899d1){return _0x3899d1?{'count':_0x162f83,'rows':_0x3899d1}:null;}})[_0x2c6f('0x1c')](respondWithResult(_0x260540,null))[_0x2c6f('0x4a')](handleError(_0x260540,null));}; \ No newline at end of file +var _0x4dc4=['attributes','length','hasOwnProperty','order','sort','where','filters','type','key','field','filter','merge','SugarcrmConfiguration','include','findAll','show','params','fields','includeAll','find','create','body','getFields','findOne','pick','options','nolimit','getSubjects','SugarcrmField','rawAttributes','map','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','keys','query','intersection','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4dc4,0x7e));var _0x44dc=function(_0x24fe3c,_0x1c5c8e){_0x24fe3c=_0x24fe3c-0x0;var _0xcfbbbf=_0x4dc4[_0x24fe3c];return _0xcfbbbf;};'use strict';var pdf=require(_0x44dc('0x0'));var emlformat=require(_0x44dc('0x1'));var rimraf=require(_0x44dc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x44dc('0x3'));var rp=require(_0x44dc('0x4'));var moment=require(_0x44dc('0x5'));var BPromise=require(_0x44dc('0x6'));var Mustache=require(_0x44dc('0x7'));var util=require('util');var path=require(_0x44dc('0x8'));var sox=require(_0x44dc('0x9'));var csv=require(_0x44dc('0xa'));var ejs=require(_0x44dc('0xb'));var fs=require('fs');var _=require(_0x44dc('0xc'));var squel=require(_0x44dc('0xd'));var crypto=require(_0x44dc('0xe'));var jsforce=require(_0x44dc('0xf'));var deskjs=require(_0x44dc('0x10'));var toCsv=require(_0x44dc('0xa'));var querystring=require(_0x44dc('0x11'));var Papa=require(_0x44dc('0x12'));var Redis=require(_0x44dc('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x44dc('0x14'));var hardwareService=require(_0x44dc('0x15'));var logger=require(_0x44dc('0x16'))(_0x44dc('0x17'));var utils=require(_0x44dc('0x18'));var config=require(_0x44dc('0x19'));var db=require(_0x44dc('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x44dc('0x1b')][_0x44dc('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x20736,_0x582ed7,_0xc0a605){if(_0xc0a605){var _0x4e1eab=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4e1eab[_0x44dc('0x1d')](_0x582ed7)){return _0x20736;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x20736;}}function respondWithRpcPromise(_0x502254,_0x3a006e,_0x4ed21e,_0x49d57f){return new BPromise(function(_0x4143f9,_0x4b4438){var _0x99c62f=_0x49d57f||client;return _0x99c62f['request'](_0x502254,_0x4ed21e)[_0x44dc('0x1e')](function(_0xb72b0e){logger[_0x44dc('0x1f')](_0x44dc('0x20'),_0x3a006e,'request\x20sent');logger['debug'](_0x44dc('0x21'),_0x3a006e,_0x44dc('0x22'),JSON[_0x44dc('0x23')](_0xb72b0e));if(_0xb72b0e[_0x44dc('0x24')]){if(_0xb72b0e[_0x44dc('0x24')][_0x44dc('0x25')]===0x1f4){logger[_0x44dc('0x24')](_0x44dc('0x20'),_0x3a006e,_0xb72b0e['error']['message']);return _0x4b4438(_0xb72b0e[_0x44dc('0x24')]['message']);}logger[_0x44dc('0x24')](_0x44dc('0x20'),_0x3a006e,_0xb72b0e[_0x44dc('0x24')][_0x44dc('0x26')]);return _0x4143f9(_0xb72b0e[_0x44dc('0x24')]['message']);}else{logger[_0x44dc('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3a006e,'request\x20sent');_0x4143f9(_0xb72b0e[_0x44dc('0x27')][_0x44dc('0x26')]);}})[_0x44dc('0x28')](function(_0x5e60ad){logger[_0x44dc('0x24')](_0x44dc('0x20'),_0x3a006e,_0x5e60ad);_0x4b4438(_0x5e60ad);});});}function respondWithStatusCode(_0x536b95,_0x5ec5cb){_0x5ec5cb=_0x5ec5cb||0xcc;return function(_0x5a8e6a){if(_0x5a8e6a){return _0x536b95[_0x44dc('0x29')](_0x5ec5cb);}return _0x536b95[_0x44dc('0x2a')](_0x5ec5cb)[_0x44dc('0x2b')]();};}function respondWithResult(_0x4877fc,_0x34032c){_0x34032c=_0x34032c||0xc8;return function(_0x5e8c9a){if(_0x5e8c9a){return _0x4877fc[_0x44dc('0x2a')](_0x34032c)[_0x44dc('0x2c')](_0x5e8c9a);}};}function respondWithFilteredResult(_0x1c06a6,_0x50aa04){return function(_0x34e5a2){if(_0x34e5a2){var _0x41b3f5=_0x34e5a2[_0x44dc('0x2d')],_0x3b5352=_0x50aa04['offset'],_0x1ef7a0=_0x50aa04[_0x44dc('0x2e')]+_0x50aa04[_0x44dc('0x2f')],_0x4c4d8d;if(_0x1ef7a0>=_0x41b3f5){_0x1ef7a0=_0x41b3f5;_0x4c4d8d=0xc8;}else{_0x4c4d8d=0xce;}_0x1c06a6[_0x44dc('0x2a')](_0x4c4d8d);return _0x1c06a6['set'](_0x44dc('0x30'),_0x3b5352+'-'+_0x1ef7a0+'/'+_0x41b3f5)[_0x44dc('0x2c')](_0x34e5a2);}return null;};}function patchUpdates(_0x222b48){return function(_0x31f433){try{jsonpatch[_0x44dc('0x31')](_0x31f433,_0x222b48,!![]);}catch(_0x5e3532){return BPromise[_0x44dc('0x32')](_0x5e3532);}return _0x31f433[_0x44dc('0x33')]();};}function saveUpdates(_0x9f6047,_0x50a407){return function(_0x10be40){if(_0x10be40){return _0x10be40[_0x44dc('0x34')](_0x9f6047)[_0x44dc('0x1e')](function(_0x55e205){return _0x55e205;});}return null;};}function removeEntity(_0xb0dda7,_0x470ac4){return function(_0x4147c8){if(_0x4147c8){return _0x4147c8[_0x44dc('0x35')]()[_0x44dc('0x1e')](function(){_0xb0dda7[_0x44dc('0x2a')](0xcc)[_0x44dc('0x2b')]();});}};}function handleEntityNotFound(_0xfbc922,_0x4efa65){return function(_0x202978){if(!_0x202978){_0xfbc922[_0x44dc('0x29')](0x194);}return _0x202978;};}function handleError(_0xaa9275,_0x2cab97){_0x2cab97=_0x2cab97||0x1f4;return function(_0x586fa0){logger['error'](_0x586fa0[_0x44dc('0x36')]);if(_0x586fa0['name']){delete _0x586fa0[_0x44dc('0x37')];}_0xaa9275[_0x44dc('0x2a')](_0x2cab97)[_0x44dc('0x38')](_0x586fa0);};}exports[_0x44dc('0x39')]=function(_0x330487,_0x46a13b){var _0x10b653={},_0x561ec5={},_0x5583ef={'count':0x0,'rows':[]};var _0x8f540c=db['SugarcrmConfiguration']['rawAttributes'];_0x561ec5['model']=_[_0x44dc('0x3a')](_0x8f540c);_0x561ec5[_0x44dc('0x3b')]=_['keys'](_0x330487['query']);_0x561ec5['filters']=_[_0x44dc('0x3c')](_0x561ec5[_0x44dc('0x3d')],_0x561ec5['query']);_0x10b653[_0x44dc('0x3e')]=_['intersection'](_0x561ec5[_0x44dc('0x3d')],qs['fields'](_0x330487[_0x44dc('0x3b')]['fields']));_0x10b653['attributes']=_0x10b653[_0x44dc('0x3e')][_0x44dc('0x3f')]?_0x10b653[_0x44dc('0x3e')]:_0x561ec5['model'];if(!_0x330487[_0x44dc('0x3b')][_0x44dc('0x40')]('nolimit')){_0x10b653[_0x44dc('0x2f')]=qs[_0x44dc('0x2f')](_0x330487[_0x44dc('0x3b')][_0x44dc('0x2f')]);_0x10b653[_0x44dc('0x2e')]=qs[_0x44dc('0x2e')](_0x330487[_0x44dc('0x3b')][_0x44dc('0x2e')]);}_0x10b653[_0x44dc('0x41')]=qs[_0x44dc('0x42')](_0x330487[_0x44dc('0x3b')][_0x44dc('0x42')]);_0x10b653[_0x44dc('0x43')]=qs[_0x44dc('0x44')](_['pick'](_0x330487['query'],_0x561ec5['filters']));if(_0x330487[_0x44dc('0x3b')]['filter']){_0x10b653[_0x44dc('0x43')]=_['merge'](_0x10b653['where'],{'$or':_['map'](_0x8f540c,function(_0x70fc36){if(_0x70fc36[_0x44dc('0x45')][_0x44dc('0x46')]!=='VIRTUAL'){var _0x5af9d7={};_0x5af9d7[_0x70fc36[_0x44dc('0x47')]]={'$like':'%'+_0x330487[_0x44dc('0x3b')][_0x44dc('0x48')]+'%'};return _0x5af9d7;}})});}_0x10b653=_[_0x44dc('0x49')]({},_0x10b653,_0x330487['options']);var _0x55c8f8={'where':_0x10b653[_0x44dc('0x43')]};return db[_0x44dc('0x4a')][_0x44dc('0x2d')](_0x55c8f8)[_0x44dc('0x1e')](function(_0x4da250){_0x5583ef[_0x44dc('0x2d')]=_0x4da250;if(_0x330487['query']['includeAll']){_0x10b653[_0x44dc('0x4b')]=[{'all':!![]}];}return db[_0x44dc('0x4a')][_0x44dc('0x4c')](_0x10b653);})[_0x44dc('0x1e')](function(_0x2eb3a9){_0x5583ef['rows']=_0x2eb3a9;return _0x5583ef;})[_0x44dc('0x1e')](respondWithFilteredResult(_0x46a13b,_0x10b653))[_0x44dc('0x28')](handleError(_0x46a13b,null));};exports[_0x44dc('0x4d')]=function(_0x2a7d62,_0x4a1090){var _0x19f644={'raw':![],'where':{'id':_0x2a7d62[_0x44dc('0x4e')]['id']}},_0x56af3f={};_0x56af3f[_0x44dc('0x3d')]=_['keys'](db[_0x44dc('0x4a')]['rawAttributes']);_0x56af3f[_0x44dc('0x3b')]=_['keys'](_0x2a7d62[_0x44dc('0x3b')]);_0x56af3f[_0x44dc('0x44')]=_[_0x44dc('0x3c')](_0x56af3f[_0x44dc('0x3d')],_0x56af3f['query']);_0x19f644[_0x44dc('0x3e')]=_['intersection'](_0x56af3f['model'],qs['fields'](_0x2a7d62['query'][_0x44dc('0x4f')]));_0x19f644[_0x44dc('0x3e')]=_0x19f644[_0x44dc('0x3e')][_0x44dc('0x3f')]?_0x19f644[_0x44dc('0x3e')]:_0x56af3f['model'];if(_0x2a7d62[_0x44dc('0x3b')][_0x44dc('0x50')]){_0x19f644[_0x44dc('0x4b')]=[{'all':!![]}];}_0x19f644=_[_0x44dc('0x49')]({},_0x19f644,_0x2a7d62['options']);return db[_0x44dc('0x4a')][_0x44dc('0x51')](_0x19f644)[_0x44dc('0x1e')](handleEntityNotFound(_0x4a1090,null))[_0x44dc('0x1e')](respondWithResult(_0x4a1090,null))[_0x44dc('0x28')](handleError(_0x4a1090,null));};exports[_0x44dc('0x52')]=function(_0x76a5b6,_0x5e84b0){return db['SugarcrmConfiguration'][_0x44dc('0x52')](_0x76a5b6[_0x44dc('0x53')],{})['then'](respondWithResult(_0x5e84b0,0xc9))['catch'](handleError(_0x5e84b0,null));};exports[_0x44dc('0x34')]=function(_0x567a40,_0xb39460){if(_0x567a40[_0x44dc('0x53')]['id']){delete _0x567a40['body']['id'];}return db[_0x44dc('0x4a')]['find']({'where':{'id':_0x567a40[_0x44dc('0x4e')]['id']}})[_0x44dc('0x1e')](handleEntityNotFound(_0xb39460,null))[_0x44dc('0x1e')](saveUpdates(_0x567a40[_0x44dc('0x53')],null))[_0x44dc('0x1e')](respondWithResult(_0xb39460,null))[_0x44dc('0x28')](handleError(_0xb39460,null));};exports[_0x44dc('0x35')]=function(_0x5ad08e,_0x4f98f0){return db[_0x44dc('0x4a')][_0x44dc('0x51')]({'where':{'id':_0x5ad08e[_0x44dc('0x4e')]['id']}})[_0x44dc('0x1e')](handleEntityNotFound(_0x4f98f0,null))[_0x44dc('0x1e')](removeEntity(_0x4f98f0,null))[_0x44dc('0x28')](handleError(_0x4f98f0,null));};exports[_0x44dc('0x54')]=function(_0x42155f,_0x90b89f,_0x1816ce){var _0x2f524e={};var _0x3bc597={};var _0x106468;var _0xf0aa2e;return db[_0x44dc('0x4a')][_0x44dc('0x55')]({'where':{'id':_0x42155f[_0x44dc('0x4e')]['id']}})[_0x44dc('0x1e')](handleEntityNotFound(_0x90b89f,null))[_0x44dc('0x1e')](function(_0x4a2e9d){if(_0x4a2e9d){_0x106468=_0x4a2e9d;_0x3bc597[_0x44dc('0x3d')]=_[_0x44dc('0x3a')](db['SugarcrmField']['rawAttributes']);_0x3bc597[_0x44dc('0x3b')]=_[_0x44dc('0x3a')](_0x42155f[_0x44dc('0x3b')]);_0x3bc597[_0x44dc('0x44')]=_[_0x44dc('0x3c')](_0x3bc597['model'],_0x3bc597[_0x44dc('0x3b')]);_0x2f524e['attributes']=_[_0x44dc('0x3c')](_0x3bc597[_0x44dc('0x3d')],qs[_0x44dc('0x4f')](_0x42155f[_0x44dc('0x3b')]['fields']));_0x2f524e[_0x44dc('0x3e')]=_0x2f524e[_0x44dc('0x3e')][_0x44dc('0x3f')]?_0x2f524e['attributes']:_0x3bc597[_0x44dc('0x3d')];_0x2f524e[_0x44dc('0x41')]=qs[_0x44dc('0x42')](_0x42155f[_0x44dc('0x3b')][_0x44dc('0x42')]);_0x2f524e[_0x44dc('0x43')]=qs[_0x44dc('0x44')](_[_0x44dc('0x56')](_0x42155f[_0x44dc('0x3b')],_0x3bc597[_0x44dc('0x44')]));if(_0x42155f[_0x44dc('0x3b')]['filter']){_0x2f524e[_0x44dc('0x43')]=_['merge'](_0x2f524e[_0x44dc('0x43')],{'$or':_['map'](_0x2f524e[_0x44dc('0x3e')],function(_0x5c112b){var _0x460147={};_0x460147[_0x5c112b]={'$like':'%'+_0x42155f[_0x44dc('0x3b')]['filter']+'%'};return _0x460147;})});}_0x2f524e=_[_0x44dc('0x49')]({},_0x2f524e,_0x42155f[_0x44dc('0x57')]);return _0x106468['getFields'](_0x2f524e);}})[_0x44dc('0x1e')](function(_0x3cc99b){if(_0x3cc99b){_0xf0aa2e=_0x3cc99b['length'];if(!_0x42155f[_0x44dc('0x3b')][_0x44dc('0x40')](_0x44dc('0x58'))){_0x2f524e[_0x44dc('0x2f')]=qs[_0x44dc('0x2f')](_0x42155f[_0x44dc('0x3b')]['limit']);_0x2f524e[_0x44dc('0x2e')]=qs[_0x44dc('0x2e')](_0x42155f[_0x44dc('0x3b')][_0x44dc('0x2e')]);}return _0x106468['getFields'](_0x2f524e);}})[_0x44dc('0x1e')](function(_0x25f4d0){if(_0x25f4d0){return _0x25f4d0?{'count':_0xf0aa2e,'rows':_0x25f4d0}:null;}})[_0x44dc('0x1e')](respondWithResult(_0x90b89f,null))[_0x44dc('0x28')](handleError(_0x90b89f,null));};exports[_0x44dc('0x59')]=function(_0x126359,_0xe376ff,_0x4cf964){var _0x35f783={};var _0x311db7={};var _0x2ac3e9;var _0x5c4126;return db[_0x44dc('0x4a')][_0x44dc('0x55')]({'where':{'id':_0x126359[_0x44dc('0x4e')]['id']}})[_0x44dc('0x1e')](handleEntityNotFound(_0xe376ff,null))['then'](function(_0x12bfc1){if(_0x12bfc1){_0x2ac3e9=_0x12bfc1;_0x311db7[_0x44dc('0x3d')]=_[_0x44dc('0x3a')](db[_0x44dc('0x5a')][_0x44dc('0x5b')]);_0x311db7[_0x44dc('0x3b')]=_['keys'](_0x126359[_0x44dc('0x3b')]);_0x311db7[_0x44dc('0x44')]=_[_0x44dc('0x3c')](_0x311db7[_0x44dc('0x3d')],_0x311db7[_0x44dc('0x3b')]);_0x35f783[_0x44dc('0x3e')]=_['intersection'](_0x311db7[_0x44dc('0x3d')],qs['fields'](_0x126359['query'][_0x44dc('0x4f')]));_0x35f783[_0x44dc('0x3e')]=_0x35f783[_0x44dc('0x3e')]['length']?_0x35f783[_0x44dc('0x3e')]:_0x311db7[_0x44dc('0x3d')];_0x35f783['order']=qs[_0x44dc('0x42')](_0x126359[_0x44dc('0x3b')][_0x44dc('0x42')]);_0x35f783[_0x44dc('0x43')]=qs[_0x44dc('0x44')](_[_0x44dc('0x56')](_0x126359['query'],_0x311db7[_0x44dc('0x44')]));if(_0x126359[_0x44dc('0x3b')][_0x44dc('0x48')]){_0x35f783[_0x44dc('0x43')]=_[_0x44dc('0x49')](_0x35f783[_0x44dc('0x43')],{'$or':_[_0x44dc('0x5c')](_0x35f783['attributes'],function(_0x5cbcc6){var _0x526ad9={};_0x526ad9[_0x5cbcc6]={'$like':'%'+_0x126359[_0x44dc('0x3b')][_0x44dc('0x48')]+'%'};return _0x526ad9;})});}_0x35f783=_[_0x44dc('0x49')]({},_0x35f783,_0x126359[_0x44dc('0x57')]);return _0x2ac3e9[_0x44dc('0x59')](_0x35f783);}})[_0x44dc('0x1e')](function(_0x4a3f36){if(_0x4a3f36){_0x5c4126=_0x4a3f36[_0x44dc('0x3f')];if(!_0x126359[_0x44dc('0x3b')]['hasOwnProperty'](_0x44dc('0x58'))){_0x35f783[_0x44dc('0x2f')]=qs[_0x44dc('0x2f')](_0x126359[_0x44dc('0x3b')][_0x44dc('0x2f')]);_0x35f783[_0x44dc('0x2e')]=qs[_0x44dc('0x2e')](_0x126359[_0x44dc('0x3b')][_0x44dc('0x2e')]);}return _0x2ac3e9['getSubjects'](_0x35f783);}})[_0x44dc('0x1e')](function(_0x2a3f2c){if(_0x2a3f2c){return _0x2a3f2c?{'count':_0x5c4126,'rows':_0x2a3f2c}:null;}})[_0x44dc('0x1e')](respondWithResult(_0xe376ff,null))['catch'](handleError(_0xe376ff,null));};exports['getDescriptions']=function(_0x5dcb0f,_0x14892e,_0x3ea75c){var _0x17e09c={};var _0x4d88e8={};var _0x48266c;var _0x1aab68;return db[_0x44dc('0x4a')][_0x44dc('0x55')]({'where':{'id':_0x5dcb0f[_0x44dc('0x4e')]['id']}})[_0x44dc('0x1e')](handleEntityNotFound(_0x14892e,null))[_0x44dc('0x1e')](function(_0xca4c90){if(_0xca4c90){_0x48266c=_0xca4c90;_0x4d88e8['model']=_[_0x44dc('0x3a')](db['SugarcrmField'][_0x44dc('0x5b')]);_0x4d88e8[_0x44dc('0x3b')]=_[_0x44dc('0x3a')](_0x5dcb0f[_0x44dc('0x3b')]);_0x4d88e8['filters']=_[_0x44dc('0x3c')](_0x4d88e8[_0x44dc('0x3d')],_0x4d88e8['query']);_0x17e09c['attributes']=_[_0x44dc('0x3c')](_0x4d88e8[_0x44dc('0x3d')],qs[_0x44dc('0x4f')](_0x5dcb0f[_0x44dc('0x3b')][_0x44dc('0x4f')]));_0x17e09c['attributes']=_0x17e09c['attributes'][_0x44dc('0x3f')]?_0x17e09c[_0x44dc('0x3e')]:_0x4d88e8[_0x44dc('0x3d')];_0x17e09c['order']=qs[_0x44dc('0x42')](_0x5dcb0f[_0x44dc('0x3b')]['sort']);_0x17e09c[_0x44dc('0x43')]=qs[_0x44dc('0x44')](_[_0x44dc('0x56')](_0x5dcb0f[_0x44dc('0x3b')],_0x4d88e8[_0x44dc('0x44')]));if(_0x5dcb0f[_0x44dc('0x3b')]['filter']){_0x17e09c[_0x44dc('0x43')]=_['merge'](_0x17e09c[_0x44dc('0x43')],{'$or':_[_0x44dc('0x5c')](_0x17e09c[_0x44dc('0x3e')],function(_0xa9ee3d){var _0x5d7b20={};_0x5d7b20[_0xa9ee3d]={'$like':'%'+_0x5dcb0f['query'][_0x44dc('0x48')]+'%'};return _0x5d7b20;})});}_0x17e09c=_[_0x44dc('0x49')]({},_0x17e09c,_0x5dcb0f[_0x44dc('0x57')]);return _0x48266c[_0x44dc('0x5d')](_0x17e09c);}})['then'](function(_0x564b2d){if(_0x564b2d){_0x1aab68=_0x564b2d[_0x44dc('0x3f')];if(!_0x5dcb0f[_0x44dc('0x3b')][_0x44dc('0x40')]('nolimit')){_0x17e09c[_0x44dc('0x2f')]=qs[_0x44dc('0x2f')](_0x5dcb0f[_0x44dc('0x3b')]['limit']);_0x17e09c[_0x44dc('0x2e')]=qs['offset'](_0x5dcb0f[_0x44dc('0x3b')][_0x44dc('0x2e')]);}return _0x48266c[_0x44dc('0x5d')](_0x17e09c);}})[_0x44dc('0x1e')](function(_0x49c8d6){if(_0x49c8d6){return _0x49c8d6?{'count':_0x1aab68,'rows':_0x49c8d6}:null;}})[_0x44dc('0x1e')](respondWithResult(_0x14892e,null))[_0x44dc('0x28')](handleError(_0x14892e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 88e0e22..347ca9c 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf665=['./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf665,0x9f));var _0x5f66=function(_0x2ec53e,_0x59038e){_0x2ec53e=_0x2ec53e-0x0;var _0x3a42d0=_0xf665[_0x2ec53e];return _0x3a42d0;};'use strict';var _=require(_0x5f66('0x0'));var util=require(_0x5f66('0x1'));var logger=require(_0x5f66('0x2'))(_0x5f66('0x3'));var moment=require('moment');var BPromise=require(_0x5f66('0x4'));var rp=require(_0x5f66('0x5'));var fs=require('fs');var path=require(_0x5f66('0x6'));var rimraf=require(_0x5f66('0x7'));var config=require(_0x5f66('0x8'));var attributes=require(_0x5f66('0x9'));module[_0x5f66('0xa')]=function(_0x234e32,_0x24bdcc){return _0x234e32[_0x5f66('0xb')](_0x5f66('0xc'),attributes,{'tableName':_0x5f66('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6c8=['path','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x5a77fc,_0x25c8e1){var _0x592781=function(_0xf4b442){while(--_0xf4b442){_0x5a77fc['push'](_0x5a77fc['shift']());}};_0x592781(++_0x25c8e1);}(_0xe6c8,0xaf));var _0x8e6c=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xe6c8[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x8e6c('0x0'));var util=require('util');var logger=require(_0x8e6c('0x1'))(_0x8e6c('0x2'));var moment=require('moment');var BPromise=require(_0x8e6c('0x3'));var rp=require(_0x8e6c('0x4'));var fs=require('fs');var path=require(_0x8e6c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8e6c('0x6'));module[_0x8e6c('0x7')]=function(_0x399338,_0x5d4271){return _0x399338['define'](_0x8e6c('0x8'),attributes,{'tableName':_0x8e6c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 6a87ac7..83f247a 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd046=['error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5285d9,_0x235120){var _0x5ec001=function(_0x211d49){while(--_0x211d49){_0x5285d9['push'](_0x5285d9['shift']());}};_0x5ec001(++_0x235120);}(_0xd046,0xb8));var _0x6d04=function(_0x30fce2,_0x303310){_0x30fce2=_0x30fce2-0x0;var _0x14be4f=_0xd046[_0x30fce2];return _0x14be4f;};'use strict';var _=require(_0x6d04('0x0'));var util=require(_0x6d04('0x1'));var moment=require(_0x6d04('0x2'));var BPromise=require(_0x6d04('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d04('0x4'));var db=require(_0x6d04('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d04('0x6'))(_0x6d04('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6d04('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a69f9,_0x205796,_0x37577a){return new BPromise(function(_0x5ab1ae,_0x3adcbd){return client['request'](_0x4a69f9,_0x37577a)['then'](function(_0x1af06a){logger[_0x6d04('0x9')](_0x6d04('0xa'),_0x205796,_0x6d04('0xb'));logger[_0x6d04('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x205796,_0x6d04('0xb'),JSON[_0x6d04('0xd')](_0x1af06a));if(_0x1af06a[_0x6d04('0xe')]){if(_0x1af06a['error']['code']===0x1f4){logger[_0x6d04('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x205796,_0x1af06a[_0x6d04('0xe')]['message']);return _0x3adcbd(_0x1af06a[_0x6d04('0xe')]['message']);}logger[_0x6d04('0xe')](_0x6d04('0xa'),_0x205796,_0x1af06a['error'][_0x6d04('0xf')]);return _0x5ab1ae(_0x1af06a[_0x6d04('0xe')][_0x6d04('0xf')]);}else{logger[_0x6d04('0x9')](_0x6d04('0xa'),_0x205796,_0x6d04('0xb'));_0x5ab1ae(_0x1af06a[_0x6d04('0x10')][_0x6d04('0xf')]);}})[_0x6d04('0x11')](function(_0x25c15b){logger[_0x6d04('0xe')](_0x6d04('0xa'),_0x205796,_0x25c15b);_0x3adcbd(_0x25c15b);});});} \ No newline at end of file +var _0xe482=['message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x544006,_0x53a47d){var _0x34a964=function(_0x1e9c59){while(--_0x1e9c59){_0x544006['push'](_0x544006['shift']());}};_0x34a964(++_0x53a47d);}(_0xe482,0xdb));var _0x2e48=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xe482[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0x2e48('0x0'));var util=require(_0x2e48('0x1'));var moment=require(_0x2e48('0x2'));var BPromise=require(_0x2e48('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2e48('0x4'));var logger=require(_0x2e48('0x5'))(_0x2e48('0x6'));var config=require(_0x2e48('0x7'));var jayson=require(_0x2e48('0x8'));var client=jayson[_0x2e48('0x9')][_0x2e48('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb1c97b,_0x28e11a,_0x1962a3){return new BPromise(function(_0x794e0f,_0x8fa6b2){return client[_0x2e48('0xb')](_0xb1c97b,_0x1962a3)[_0x2e48('0xc')](function(_0x4327c9){logger[_0x2e48('0xd')](_0x2e48('0xe'),_0x28e11a,_0x2e48('0xf'));logger[_0x2e48('0x10')](_0x2e48('0x11'),_0x28e11a,_0x2e48('0xf'),JSON[_0x2e48('0x12')](_0x4327c9));if(_0x4327c9[_0x2e48('0x13')]){if(_0x4327c9[_0x2e48('0x13')][_0x2e48('0x14')]===0x1f4){logger[_0x2e48('0x13')](_0x2e48('0xe'),_0x28e11a,_0x4327c9[_0x2e48('0x13')][_0x2e48('0x15')]);return _0x8fa6b2(_0x4327c9[_0x2e48('0x13')][_0x2e48('0x15')]);}logger['error'](_0x2e48('0xe'),_0x28e11a,_0x4327c9[_0x2e48('0x13')][_0x2e48('0x15')]);return _0x794e0f(_0x4327c9[_0x2e48('0x13')][_0x2e48('0x15')]);}else{logger[_0x2e48('0xd')](_0x2e48('0xe'),_0x28e11a,_0x2e48('0xf'));_0x794e0f(_0x4327c9[_0x2e48('0x16')][_0x2e48('0x15')]);}})[_0x2e48('0x17')](function(_0x532ee9){logger[_0x2e48('0x13')](_0x2e48('0xe'),_0x28e11a,_0x532ee9);_0x8fa6b2(_0x532ee9);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index b2a9b47..535cd6e 100644 --- a/server/api/intSugarcrmField/index.js +++ b/server/api/intSugarcrmField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0ef=['Router','../../components/auth/service','./intSugarcrmField.controller','isAuthenticated','get','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xf0ef,0xa1));var _0xff0e=function(_0x3f22e8,_0x37732a){_0x3f22e8=_0x3f22e8-0x0;var _0x368a7e=_0xf0ef[_0x3f22e8];return _0x368a7e;};'use strict';var multer=require('multer');var util=require(_0xff0e('0x0'));var path=require(_0xff0e('0x1'));var timeout=require(_0xff0e('0x2'));var express=require(_0xff0e('0x3'));var router=express[_0xff0e('0x4')]();var auth=require(_0xff0e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xff0e('0x6'));router['get']('/',auth[_0xff0e('0x7')](),controller['index']);router[_0xff0e('0x8')]('/:id',auth[_0xff0e('0x7')](),controller['show']);router['post']('/',auth[_0xff0e('0x7')](),controller[_0xff0e('0x9')]);router[_0xff0e('0xa')](_0xff0e('0xb'),auth[_0xff0e('0x7')](),controller[_0xff0e('0xc')]);router[_0xff0e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xff0e('0xe')]);module['exports']=router; \ No newline at end of file +var _0x7f31=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','/:id','show','post','put','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x4f65a6,_0x1f5636){var _0x2d0893=function(_0x32fb36){while(--_0x32fb36){_0x4f65a6['push'](_0x4f65a6['shift']());}};_0x2d0893(++_0x1f5636);}(_0x7f31,0x137));var _0x17f3=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x7f31[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require('multer');var util=require(_0x17f3('0x0'));var path=require(_0x17f3('0x1'));var timeout=require(_0x17f3('0x2'));var express=require(_0x17f3('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x17f3('0x4'));var config=require(_0x17f3('0x5'));var controller=require(_0x17f3('0x6'));router['get']('/',auth[_0x17f3('0x7')](),controller['index']);router['get'](_0x17f3('0x8'),auth[_0x17f3('0x7')](),controller[_0x17f3('0x9')]);router[_0x17f3('0xa')]('/',auth[_0x17f3('0x7')](),controller['create']);router[_0x17f3('0xb')](_0x17f3('0x8'),auth[_0x17f3('0x7')](),controller[_0x17f3('0xc')]);router['delete'](_0x17f3('0x8'),auth[_0x17f3('0x7')](),controller[_0x17f3('0xd')]);module[_0x17f3('0xe')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index caa45ca..707631d 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.attributes.js +++ b/server/api/intSugarcrmField/intSugarcrmField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd41=['STRING','variable','sequelize','exports','ENUM','string','customVariable','keyValue'];(function(_0x3db791,_0xc96e9b){var _0x4d4eb0=function(_0x1e3dcf){while(--_0x1e3dcf){_0x3db791['push'](_0x3db791['shift']());}};_0x4d4eb0(++_0xc96e9b);}(_0xdd41,0x1f2));var _0x1dd4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd41[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1dd4('0x0'));module[_0x1dd4('0x1')]={'type':{'type':Sequelize[_0x1dd4('0x2')](_0x1dd4('0x3'),'variable',_0x1dd4('0x4'),_0x1dd4('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1dd4('0x6')]},'keyType':{'type':Sequelize[_0x1dd4('0x2')]('string',_0x1dd4('0x7'),_0x1dd4('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1dd4('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4b0c=['sequelize','ENUM','string','customVariable','keyValue','STRING','variable','BOOLEAN'];(function(_0x5be0cf,_0x4cfe44){var _0xecd17a=function(_0x2f3182){while(--_0x2f3182){_0x5be0cf['push'](_0x5be0cf['shift']());}};_0xecd17a(++_0x4cfe44);}(_0x4b0c,0x138));var _0xc4b0=function(_0xc59746,_0x1e64f2){_0xc59746=_0xc59746-0x0;var _0x3f02a5=_0x4b0c[_0xc59746];return _0x3f02a5;};'use strict';var Sequelize=require(_0xc4b0('0x0'));module['exports']={'type':{'type':Sequelize[_0xc4b0('0x1')](_0xc4b0('0x2'),'variable',_0xc4b0('0x3'),_0xc4b0('0x4')),'defaultValue':_0xc4b0('0x2')},'content':{'type':Sequelize[_0xc4b0('0x5')]},'key':{'type':Sequelize[_0xc4b0('0x5')]},'keyType':{'type':Sequelize[_0xc4b0('0x1')](_0xc4b0('0x2'),_0xc4b0('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xc4b0('0x5')]},'idField':{'type':Sequelize[_0xc4b0('0x5')]},'nameField':{'type':Sequelize[_0xc4b0('0x5')]},'customField':{'type':Sequelize[_0xc4b0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index f36e9e5..52bc590 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.controller.js +++ b/server/api/intSugarcrmField/intSugarcrmField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb898=['intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','rows','show','params','length','catch','create','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','SugarcrmField','rawAttributes','model','keys','query','filters'];(function(_0x1d6f45,_0x3db8e8){var _0x30f5b7=function(_0x3f0deb){while(--_0x3f0deb){_0x1d6f45['push'](_0x1d6f45['shift']());}};_0x30f5b7(++_0x3db8e8);}(_0xb898,0xa9));var _0x8b89=function(_0x2f32c4,_0x2597ba){_0x2f32c4=_0x2f32c4-0x0;var _0x95b5dc=_0xb898[_0x2f32c4];return _0x95b5dc;};'use strict';var pdf=require(_0x8b89('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8b89('0x1'));var zipdir=require(_0x8b89('0x2'));var jsonpatch=require(_0x8b89('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8b89('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8b89('0x5'));var csv=require('to-csv');var ejs=require(_0x8b89('0x6'));var fs=require('fs');var _=require(_0x8b89('0x7'));var squel=require('squel');var crypto=require(_0x8b89('0x8'));var jsforce=require(_0x8b89('0x9'));var deskjs=require(_0x8b89('0xa'));var toCsv=require(_0x8b89('0xb'));var querystring=require(_0x8b89('0xc'));var Papa=require('papaparse');var Redis=require(_0x8b89('0xd'));var authService=require(_0x8b89('0xe'));var qs=require(_0x8b89('0xf'));var hardwareService=require(_0x8b89('0x10'));var logger=require(_0x8b89('0x11'))(_0x8b89('0x12'));var utils=require('../../config/utils');var config=require(_0x8b89('0x13'));var db=require(_0x8b89('0x14'))['db'];function respondWithStatusCode(_0x4d3e81,_0x48dd55){_0x48dd55=_0x48dd55||0xcc;return function(_0x11a2c0){if(_0x11a2c0){return _0x4d3e81[_0x8b89('0x15')](_0x48dd55);}return _0x4d3e81['status'](_0x48dd55)['end']();};}function respondWithResult(_0xcb825d,_0x5e88cb){_0x5e88cb=_0x5e88cb||0xc8;return function(_0x5282e4){if(_0x5282e4){return _0xcb825d[_0x8b89('0x16')](_0x5e88cb)[_0x8b89('0x17')](_0x5282e4);}};}function respondWithFilteredResult(_0x559c75,_0x55504a){return function(_0x2cfa57){if(_0x2cfa57){var _0x4efeaa=_0x2cfa57[_0x8b89('0x18')],_0x167fd9=_0x55504a[_0x8b89('0x19')],_0x447c43=_0x55504a[_0x8b89('0x19')]+_0x55504a[_0x8b89('0x1a')],_0x23b392;if(_0x447c43>=_0x4efeaa){_0x447c43=_0x4efeaa;_0x23b392=0xc8;}else{_0x23b392=0xce;}_0x559c75['status'](_0x23b392);return _0x559c75[_0x8b89('0x1b')](_0x8b89('0x1c'),_0x167fd9+'-'+_0x447c43+'/'+_0x4efeaa)['json'](_0x2cfa57);}return null;};}function patchUpdates(_0x3bc4ee){return function(_0x374059){try{jsonpatch[_0x8b89('0x1d')](_0x374059,_0x3bc4ee,!![]);}catch(_0x5c26db){return BPromise[_0x8b89('0x1e')](_0x5c26db);}return _0x374059[_0x8b89('0x1f')]();};}function saveUpdates(_0x26490c,_0x5e0c71){return function(_0x51fd6d){if(_0x51fd6d){return _0x51fd6d[_0x8b89('0x20')](_0x26490c)[_0x8b89('0x21')](function(_0x54ce17){return _0x54ce17;});}return null;};}function removeEntity(_0x197c9e,_0x242544){return function(_0x296573){if(_0x296573){return _0x296573[_0x8b89('0x22')]()[_0x8b89('0x21')](function(){_0x197c9e[_0x8b89('0x16')](0xcc)[_0x8b89('0x23')]();});}};}function handleEntityNotFound(_0x3f7931,_0x51d20a){return function(_0x30a606){if(!_0x30a606){_0x3f7931[_0x8b89('0x15')](0x194);}return _0x30a606;};}function handleError(_0x1f4895,_0x2b33b2){_0x2b33b2=_0x2b33b2||0x1f4;return function(_0x1b7094){logger[_0x8b89('0x24')](_0x1b7094[_0x8b89('0x25')]);if(_0x1b7094['name']){delete _0x1b7094[_0x8b89('0x26')];}_0x1f4895['status'](_0x2b33b2)[_0x8b89('0x27')](_0x1b7094);};}exports[_0x8b89('0x28')]=function(_0x370635,_0x286614){var _0x276cf1={},_0x38851f={},_0x42dde6={'count':0x0,'rows':[]};var _0x3b38a3=db[_0x8b89('0x29')][_0x8b89('0x2a')];_0x38851f[_0x8b89('0x2b')]=_[_0x8b89('0x2c')](_0x3b38a3);_0x38851f[_0x8b89('0x2d')]=_[_0x8b89('0x2c')](_0x370635[_0x8b89('0x2d')]);_0x38851f[_0x8b89('0x2e')]=_[_0x8b89('0x2f')](_0x38851f['model'],_0x38851f['query']);_0x276cf1[_0x8b89('0x30')]=_[_0x8b89('0x2f')](_0x38851f['model'],qs[_0x8b89('0x31')](_0x370635[_0x8b89('0x2d')][_0x8b89('0x31')]));_0x276cf1[_0x8b89('0x30')]=_0x276cf1[_0x8b89('0x30')]['length']?_0x276cf1[_0x8b89('0x30')]:_0x38851f['model'];if(!_0x370635['query'][_0x8b89('0x32')](_0x8b89('0x33'))){_0x276cf1[_0x8b89('0x1a')]=qs[_0x8b89('0x1a')](_0x370635['query']['limit']);_0x276cf1[_0x8b89('0x19')]=qs[_0x8b89('0x19')](_0x370635[_0x8b89('0x2d')]['offset']);}_0x276cf1['order']=qs[_0x8b89('0x34')](_0x370635['query'][_0x8b89('0x34')]);_0x276cf1[_0x8b89('0x35')]=qs[_0x8b89('0x2e')](_[_0x8b89('0x36')](_0x370635['query'],_0x38851f['filters']));if(_0x370635['query'][_0x8b89('0x37')]){_0x276cf1[_0x8b89('0x35')]=_[_0x8b89('0x38')](_0x276cf1[_0x8b89('0x35')],{'$or':_[_0x8b89('0x39')](_0x3b38a3,function(_0x2dcffa){if(_0x2dcffa[_0x8b89('0x3a')][_0x8b89('0x3b')]!=='VIRTUAL'){var _0x398e98={};_0x398e98[_0x2dcffa[_0x8b89('0x3c')]]={'$like':'%'+_0x370635[_0x8b89('0x2d')][_0x8b89('0x37')]+'%'};return _0x398e98;}})});}_0x276cf1=_[_0x8b89('0x38')]({},_0x276cf1,_0x370635[_0x8b89('0x3d')]);var _0x32c819={'where':_0x276cf1[_0x8b89('0x35')]};return db[_0x8b89('0x29')]['count'](_0x32c819)['then'](function(_0x1d92fd){_0x42dde6[_0x8b89('0x18')]=_0x1d92fd;if(_0x370635['query'][_0x8b89('0x3e')]){_0x276cf1[_0x8b89('0x3f')]=[{'all':!![]}];}return db[_0x8b89('0x29')]['findAll'](_0x276cf1);})['then'](function(_0x229c27){_0x42dde6[_0x8b89('0x40')]=_0x229c27;return _0x42dde6;})[_0x8b89('0x21')](respondWithFilteredResult(_0x286614,_0x276cf1))['catch'](handleError(_0x286614,null));};exports[_0x8b89('0x41')]=function(_0x5355ad,_0x3ed300){var _0x331c19={'raw':!![],'where':{'id':_0x5355ad[_0x8b89('0x42')]['id']}},_0x4e2f2b={};_0x4e2f2b[_0x8b89('0x2b')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x4e2f2b[_0x8b89('0x2d')]=_[_0x8b89('0x2c')](_0x5355ad[_0x8b89('0x2d')]);_0x4e2f2b[_0x8b89('0x2e')]=_['intersection'](_0x4e2f2b[_0x8b89('0x2b')],_0x4e2f2b[_0x8b89('0x2d')]);_0x331c19[_0x8b89('0x30')]=_[_0x8b89('0x2f')](_0x4e2f2b[_0x8b89('0x2b')],qs[_0x8b89('0x31')](_0x5355ad[_0x8b89('0x2d')][_0x8b89('0x31')]));_0x331c19[_0x8b89('0x30')]=_0x331c19['attributes'][_0x8b89('0x43')]?_0x331c19['attributes']:_0x4e2f2b[_0x8b89('0x2b')];if(_0x5355ad['query'][_0x8b89('0x3e')]){_0x331c19[_0x8b89('0x3f')]=[{'all':!![]}];}_0x331c19=_[_0x8b89('0x38')]({},_0x331c19,_0x5355ad[_0x8b89('0x3d')]);return db[_0x8b89('0x29')]['find'](_0x331c19)[_0x8b89('0x21')](handleEntityNotFound(_0x3ed300,null))[_0x8b89('0x21')](respondWithResult(_0x3ed300,null))[_0x8b89('0x44')](handleError(_0x3ed300,null));};exports[_0x8b89('0x45')]=function(_0x1c1c1c,_0x2e1002){return db[_0x8b89('0x29')][_0x8b89('0x45')](_0x1c1c1c[_0x8b89('0x46')],{})[_0x8b89('0x21')](respondWithResult(_0x2e1002,0xc9))[_0x8b89('0x44')](handleError(_0x2e1002,null));};exports[_0x8b89('0x20')]=function(_0x241107,_0x142ab6){if(_0x241107['body']['id']){delete _0x241107[_0x8b89('0x46')]['id'];}return db['SugarcrmField'][_0x8b89('0x47')]({'where':{'id':_0x241107[_0x8b89('0x42')]['id']}})[_0x8b89('0x21')](handleEntityNotFound(_0x142ab6,null))['then'](saveUpdates(_0x241107[_0x8b89('0x46')],null))[_0x8b89('0x21')](respondWithResult(_0x142ab6,null))['catch'](handleError(_0x142ab6,null));};exports['destroy']=function(_0x54ad41,_0x4b8da1){return db[_0x8b89('0x29')][_0x8b89('0x47')]({'where':{'id':_0x54ad41['params']['id']}})['then'](handleEntityNotFound(_0x4b8da1,null))['then'](removeEntity(_0x4b8da1,null))[_0x8b89('0x44')](handleError(_0x4b8da1,null));}; \ No newline at end of file +var _0xdb6e=['type','key','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge'];(function(_0x5e80f0,_0x588f3c){var _0x308c2=function(_0x12af7a){while(--_0x12af7a){_0x5e80f0['push'](_0x5e80f0['shift']());}};_0x308c2(++_0x588f3c);}(_0xdb6e,0x179));var _0xedb6=function(_0xaeedca,_0x170237){_0xaeedca=_0xaeedca-0x0;var _0x562b76=_0xdb6e[_0xaeedca];return _0x562b76;};'use strict';var pdf=require(_0xedb6('0x0'));var emlformat=require(_0xedb6('0x1'));var rimraf=require(_0xedb6('0x2'));var zipdir=require(_0xedb6('0x3'));var jsonpatch=require(_0xedb6('0x4'));var rp=require(_0xedb6('0x5'));var moment=require('moment');var BPromise=require(_0xedb6('0x6'));var Mustache=require(_0xedb6('0x7'));var util=require(_0xedb6('0x8'));var path=require(_0xedb6('0x9'));var sox=require(_0xedb6('0xa'));var csv=require(_0xedb6('0xb'));var ejs=require(_0xedb6('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xedb6('0xd'));var crypto=require(_0xedb6('0xe'));var jsforce=require(_0xedb6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xedb6('0xb'));var querystring=require('querystring');var Papa=require(_0xedb6('0x10'));var Redis=require(_0xedb6('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xedb6('0x12'));var logger=require('../../config/logger')(_0xedb6('0x13'));var utils=require(_0xedb6('0x14'));var config=require(_0xedb6('0x15'));var db=require(_0xedb6('0x16'))['db'];function respondWithStatusCode(_0xe244f4,_0x51ffe2){_0x51ffe2=_0x51ffe2||0xcc;return function(_0x55df82){if(_0x55df82){return _0xe244f4['sendStatus'](_0x51ffe2);}return _0xe244f4['status'](_0x51ffe2)[_0xedb6('0x17')]();};}function respondWithResult(_0x568ed4,_0x1742d5){_0x1742d5=_0x1742d5||0xc8;return function(_0x51b011){if(_0x51b011){return _0x568ed4[_0xedb6('0x18')](_0x1742d5)[_0xedb6('0x19')](_0x51b011);}};}function respondWithFilteredResult(_0x1b00ef,_0x505665){return function(_0x5ef6a0){if(_0x5ef6a0){var _0xedbdf4=_0x5ef6a0['count'],_0x3db1d8=_0x505665[_0xedb6('0x1a')],_0x2e9df3=_0x505665[_0xedb6('0x1a')]+_0x505665['limit'],_0x46848f;if(_0x2e9df3>=_0xedbdf4){_0x2e9df3=_0xedbdf4;_0x46848f=0xc8;}else{_0x46848f=0xce;}_0x1b00ef[_0xedb6('0x18')](_0x46848f);return _0x1b00ef['set'](_0xedb6('0x1b'),_0x3db1d8+'-'+_0x2e9df3+'/'+_0xedbdf4)['json'](_0x5ef6a0);}return null;};}function patchUpdates(_0x21d1cf){return function(_0x5c43f9){try{jsonpatch[_0xedb6('0x1c')](_0x5c43f9,_0x21d1cf,!![]);}catch(_0x435d60){return BPromise[_0xedb6('0x1d')](_0x435d60);}return _0x5c43f9[_0xedb6('0x1e')]();};}function saveUpdates(_0x2a9289,_0x3ee4ee){return function(_0x1510fa){if(_0x1510fa){return _0x1510fa['update'](_0x2a9289)[_0xedb6('0x1f')](function(_0x152c8a){return _0x152c8a;});}return null;};}function removeEntity(_0x233d5a,_0x5491ef){return function(_0x1ef823){if(_0x1ef823){return _0x1ef823[_0xedb6('0x20')]()[_0xedb6('0x1f')](function(){_0x233d5a[_0xedb6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cab57,_0x26e209){return function(_0x106585){if(!_0x106585){_0x5cab57['sendStatus'](0x194);}return _0x106585;};}function handleError(_0x4f03f9,_0x3b9c76){_0x3b9c76=_0x3b9c76||0x1f4;return function(_0x144fa7){logger[_0xedb6('0x21')](_0x144fa7[_0xedb6('0x22')]);if(_0x144fa7[_0xedb6('0x23')]){delete _0x144fa7['name'];}_0x4f03f9[_0xedb6('0x18')](_0x3b9c76)[_0xedb6('0x24')](_0x144fa7);};}exports[_0xedb6('0x25')]=function(_0x3114a7,_0xf948e0){var _0x16ef2b={},_0x45111b={},_0x37bc8d={'count':0x0,'rows':[]};var _0x55cd41=db[_0xedb6('0x26')][_0xedb6('0x27')];_0x45111b[_0xedb6('0x28')]=_['keys'](_0x55cd41);_0x45111b[_0xedb6('0x29')]=_[_0xedb6('0x2a')](_0x3114a7[_0xedb6('0x29')]);_0x45111b['filters']=_['intersection'](_0x45111b['model'],_0x45111b[_0xedb6('0x29')]);_0x16ef2b[_0xedb6('0x2b')]=_[_0xedb6('0x2c')](_0x45111b['model'],qs[_0xedb6('0x2d')](_0x3114a7[_0xedb6('0x29')][_0xedb6('0x2d')]));_0x16ef2b['attributes']=_0x16ef2b[_0xedb6('0x2b')]['length']?_0x16ef2b[_0xedb6('0x2b')]:_0x45111b[_0xedb6('0x28')];if(!_0x3114a7[_0xedb6('0x29')][_0xedb6('0x2e')](_0xedb6('0x2f'))){_0x16ef2b[_0xedb6('0x30')]=qs['limit'](_0x3114a7[_0xedb6('0x29')][_0xedb6('0x30')]);_0x16ef2b['offset']=qs['offset'](_0x3114a7[_0xedb6('0x29')][_0xedb6('0x1a')]);}_0x16ef2b[_0xedb6('0x31')]=qs[_0xedb6('0x32')](_0x3114a7[_0xedb6('0x29')][_0xedb6('0x32')]);_0x16ef2b[_0xedb6('0x33')]=qs[_0xedb6('0x34')](_[_0xedb6('0x35')](_0x3114a7[_0xedb6('0x29')],_0x45111b[_0xedb6('0x34')]));if(_0x3114a7['query']['filter']){_0x16ef2b[_0xedb6('0x33')]=_[_0xedb6('0x36')](_0x16ef2b[_0xedb6('0x33')],{'$or':_['map'](_0x55cd41,function(_0x330644){if(_0x330644[_0xedb6('0x37')][_0xedb6('0x38')]!==_0xedb6('0x39')){var _0x598ad8={};_0x598ad8[_0x330644[_0xedb6('0x3a')]]={'$like':'%'+_0x3114a7[_0xedb6('0x29')][_0xedb6('0x3b')]+'%'};return _0x598ad8;}})});}_0x16ef2b=_[_0xedb6('0x36')]({},_0x16ef2b,_0x3114a7['options']);var _0x17ee61={'where':_0x16ef2b['where']};return db[_0xedb6('0x26')][_0xedb6('0x3c')](_0x17ee61)[_0xedb6('0x1f')](function(_0x4a7376){_0x37bc8d[_0xedb6('0x3c')]=_0x4a7376;if(_0x3114a7[_0xedb6('0x29')][_0xedb6('0x3d')]){_0x16ef2b[_0xedb6('0x3e')]=[{'all':!![]}];}return db[_0xedb6('0x26')][_0xedb6('0x3f')](_0x16ef2b);})[_0xedb6('0x1f')](function(_0x3e6468){_0x37bc8d[_0xedb6('0x40')]=_0x3e6468;return _0x37bc8d;})['then'](respondWithFilteredResult(_0xf948e0,_0x16ef2b))['catch'](handleError(_0xf948e0,null));};exports[_0xedb6('0x41')]=function(_0x395384,_0x4f1ec1){var _0x25d208={'raw':!![],'where':{'id':_0x395384[_0xedb6('0x42')]['id']}},_0x3ae730={};_0x3ae730[_0xedb6('0x28')]=_[_0xedb6('0x2a')](db[_0xedb6('0x26')][_0xedb6('0x27')]);_0x3ae730[_0xedb6('0x29')]=_[_0xedb6('0x2a')](_0x395384[_0xedb6('0x29')]);_0x3ae730['filters']=_[_0xedb6('0x2c')](_0x3ae730[_0xedb6('0x28')],_0x3ae730[_0xedb6('0x29')]);_0x25d208[_0xedb6('0x2b')]=_['intersection'](_0x3ae730[_0xedb6('0x28')],qs[_0xedb6('0x2d')](_0x395384['query'][_0xedb6('0x2d')]));_0x25d208[_0xedb6('0x2b')]=_0x25d208[_0xedb6('0x2b')][_0xedb6('0x43')]?_0x25d208[_0xedb6('0x2b')]:_0x3ae730[_0xedb6('0x28')];if(_0x395384[_0xedb6('0x29')][_0xedb6('0x3d')]){_0x25d208[_0xedb6('0x3e')]=[{'all':!![]}];}_0x25d208=_[_0xedb6('0x36')]({},_0x25d208,_0x395384['options']);return db[_0xedb6('0x26')][_0xedb6('0x44')](_0x25d208)['then'](handleEntityNotFound(_0x4f1ec1,null))[_0xedb6('0x1f')](respondWithResult(_0x4f1ec1,null))[_0xedb6('0x45')](handleError(_0x4f1ec1,null));};exports[_0xedb6('0x46')]=function(_0x12b0d0,_0x3b783e){return db[_0xedb6('0x26')]['create'](_0x12b0d0['body'],{})[_0xedb6('0x1f')](respondWithResult(_0x3b783e,0xc9))['catch'](handleError(_0x3b783e,null));};exports['update']=function(_0xef264a,_0x12588b){if(_0xef264a[_0xedb6('0x47')]['id']){delete _0xef264a[_0xedb6('0x47')]['id'];}return db['SugarcrmField'][_0xedb6('0x44')]({'where':{'id':_0xef264a[_0xedb6('0x42')]['id']}})['then'](handleEntityNotFound(_0x12588b,null))[_0xedb6('0x1f')](saveUpdates(_0xef264a['body'],null))[_0xedb6('0x1f')](respondWithResult(_0x12588b,null))['catch'](handleError(_0x12588b,null));};exports[_0xedb6('0x20')]=function(_0x457542,_0x4a43bd){return db['SugarcrmField']['find']({'where':{'id':_0x457542[_0xedb6('0x42')]['id']}})[_0xedb6('0x1f')](handleEntityNotFound(_0x4a43bd,null))[_0xedb6('0x1f')](removeEntity(_0x4a43bd,null))[_0xedb6('0x45')](handleError(_0x4a43bd,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 1ddd9c1..32c0a08 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.model.js +++ b/server/api/intSugarcrmField/intSugarcrmField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x075e=['int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','exports','define','SugarcrmField'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x075e,0x9f));var _0xe075=function(_0x1c0f58,_0x5aea12){_0x1c0f58=_0x1c0f58-0x0;var _0x2d0ead=_0x075e[_0x1c0f58];return _0x2d0ead;};'use strict';var _=require(_0xe075('0x0'));var util=require(_0xe075('0x1'));var logger=require(_0xe075('0x2'))('api');var moment=require(_0xe075('0x3'));var BPromise=require('bluebird');var rp=require(_0xe075('0x4'));var fs=require('fs');var path=require(_0xe075('0x5'));var rimraf=require('rimraf');var config=require(_0xe075('0x6'));var attributes=require('./intSugarcrmField.attributes');module[_0xe075('0x7')]=function(_0x257eb4,_0x4fd673){return _0x257eb4[_0xe075('0x8')](_0xe075('0x9'),attributes,{'tableName':_0xe075('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xe075('0xb'),_0xe075('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a80=['./intSugarcrmField.attributes','exports','define','SugarcrmField','idField','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x804935,_0x768ab){var _0x465f18=function(_0x317234){while(--_0x317234){_0x804935['push'](_0x804935['shift']());}};_0x465f18(++_0x768ab);}(_0x9a80,0x7a));var _0x09a8=function(_0x4a5eb3,_0x549c26){_0x4a5eb3=_0x4a5eb3-0x0;var _0x3dcfa9=_0x9a80[_0x4a5eb3];return _0x3dcfa9;};'use strict';var _=require('lodash');var util=require(_0x09a8('0x0'));var logger=require(_0x09a8('0x1'))(_0x09a8('0x2'));var moment=require(_0x09a8('0x3'));var BPromise=require(_0x09a8('0x4'));var rp=require(_0x09a8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09a8('0x6'));var config=require(_0x09a8('0x7'));var attributes=require(_0x09a8('0x8'));module[_0x09a8('0x9')]=function(_0x332d85,_0x348cbf){return _0x332d85[_0x09a8('0xa')](_0x09a8('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x09a8('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 4ba2d27..21a01ed 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.rpc.js +++ b/server/api/intSugarcrmField/intSugarcrmField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffd=['SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SugarcrmField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x21287a,_0x1166ef){var _0x5b8fbc=function(_0x3c98ca){while(--_0x3c98ca){_0x21287a['push'](_0x21287a['shift']());}};_0x5b8fbc(++_0x1166ef);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x29a2d8,_0x13726b){_0x29a2d8=_0x29a2d8-0x0;var _0x20e825=_0x9ffd[_0x29a2d8];return _0x20e825;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('SugarcrmField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file +var _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x6de9f6,_0x42178a){var _0x156549=function(_0x3a24c2){while(--_0x3a24c2){_0x6de9f6['push'](_0x6de9f6['shift']());}};_0x156549(++_0x42178a);}(_0x14a0,0x8e));var _0x014a=function(_0x5f36b9,_0x10e3f8){_0x5f36b9=_0x5f36b9-0x0;var _0x354876=_0x14a0[_0x5f36b9];return _0x354876;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index fdf3c1a..6a7d31d 100644 --- a/server/api/intVtigerAccount/index.js +++ b/server/api/intVtigerAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb306=['/:id','show','post','create','/:id/configurations','addConfiguration','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get'];(function(_0x5c846d,_0x5c02ce){var _0xd064e4=function(_0x5631f3){while(--_0x5631f3){_0x5c846d['push'](_0x5c846d['shift']());}};_0xd064e4(++_0x5c02ce);}(_0xb306,0x1ae));var _0x6b30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb306[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x6b30('0x0'));var path=require(_0x6b30('0x1'));var timeout=require(_0x6b30('0x2'));var express=require(_0x6b30('0x3'));var router=express[_0x6b30('0x4')]();var auth=require(_0x6b30('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6b30('0x6'));var controller=require(_0x6b30('0x7'));router['get']('/',auth[_0x6b30('0x8')](),controller[_0x6b30('0x9')]);router[_0x6b30('0xa')](_0x6b30('0xb'),auth['isAuthenticated'](),controller[_0x6b30('0xc')]);router[_0x6b30('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x6b30('0xa')]('/:id/fields',auth[_0x6b30('0x8')](),controller['getFields']);router[_0x6b30('0xd')]('/',auth[_0x6b30('0x8')](),controller[_0x6b30('0xe')]);router[_0x6b30('0xd')](_0x6b30('0xf'),auth[_0x6b30('0x8')](),controller[_0x6b30('0x10')]);router[_0x6b30('0x11')](_0x6b30('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6b30('0x12')]('/:id',auth[_0x6b30('0x8')](),controller[_0x6b30('0x13')]);module[_0x6b30('0x14')]=router; \ No newline at end of file +var _0x10df=['../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4e1f63,_0x50a800){var _0x5f5231=function(_0x4eb045){while(--_0x4eb045){_0x4e1f63['push'](_0x4e1f63['shift']());}};_0x5f5231(++_0x50a800);}(_0x10df,0x84));var _0xf10d=function(_0x39106d,_0x4d5fef){_0x39106d=_0x39106d-0x0;var _0x42d497=_0x10df[_0x39106d];return _0x42d497;};'use strict';var multer=require('multer');var util=require(_0xf10d('0x0'));var path=require(_0xf10d('0x1'));var timeout=require(_0xf10d('0x2'));var express=require(_0xf10d('0x3'));var router=express[_0xf10d('0x4')]();var auth=require(_0xf10d('0x5'));var interaction=require(_0xf10d('0x6'));var config=require(_0xf10d('0x7'));var controller=require(_0xf10d('0x8'));router[_0xf10d('0x9')]('/',auth[_0xf10d('0xa')](),controller['index']);router[_0xf10d('0x9')](_0xf10d('0xb'),auth[_0xf10d('0xa')](),controller[_0xf10d('0xc')]);router[_0xf10d('0x9')](_0xf10d('0xd'),auth[_0xf10d('0xa')](),controller['getConfigurations']);router[_0xf10d('0x9')](_0xf10d('0xe'),auth[_0xf10d('0xa')](),controller[_0xf10d('0xf')]);router[_0xf10d('0x10')]('/',auth[_0xf10d('0xa')](),controller[_0xf10d('0x11')]);router[_0xf10d('0x10')](_0xf10d('0xd'),auth[_0xf10d('0xa')](),controller[_0xf10d('0x12')]);router[_0xf10d('0x13')](_0xf10d('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf10d('0x14')](_0xf10d('0xb'),auth['isAuthenticated'](),controller[_0xf10d('0x15')]);module[_0xf10d('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 17b7844..c5ea969 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.attributes.js +++ b/server/api/intVtigerAccount/intVtigerAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c9c=['HelpDesk','sequelize','exports','STRING'];(function(_0x25d092,_0x469bd3){var _0x3d20e5=function(_0x2afa1a){while(--_0x2afa1a){_0x25d092['push'](_0x25d092['shift']());}};_0x3d20e5(++_0x469bd3);}(_0x0c9c,0x159));var _0xc0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc0c9('0x0'));module[_0xc0c9('0x1')]={'name':{'type':Sequelize[_0xc0c9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc0c9('0x2')]},'username':{'type':Sequelize[_0xc0c9('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xc0c9('0x2')],'allowNull':![],'defaultValue':_0xc0c9('0x3')},'remoteUri':{'type':Sequelize[_0xc0c9('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xc0c9('0x2')]},'accessKey':{'type':Sequelize[_0xc0c9('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4e1f=['STRING','HelpDesk','sequelize','exports'];(function(_0x4aa71a,_0x58800f){var _0x17bb3=function(_0x157183){while(--_0x157183){_0x4aa71a['push'](_0x4aa71a['shift']());}};_0x17bb3(++_0x58800f);}(_0x4e1f,0x86));var _0xf4e1=function(_0x17a743,_0x108a32){_0x17a743=_0x17a743-0x0;var _0x2a27a9=_0x4e1f[_0x17a743];return _0x2a27a9;};'use strict';var Sequelize=require(_0xf4e1('0x0'));module[_0xf4e1('0x1')]={'name':{'type':Sequelize[_0xf4e1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf4e1('0x2')]},'username':{'type':Sequelize[_0xf4e1('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf4e1('0x2')],'allowNull':![],'defaultValue':_0xf4e1('0x3')},'remoteUri':{'type':Sequelize[_0xf4e1('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize[_0xf4e1('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 5abd684..485eb65 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.controller.js +++ b/server/api/intVtigerAccount/intVtigerAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc960=['serverUrl','accessKey','slice','substring','%s/webservice.php','GET','success','POST','login','describe','sessionName','autogenerated','owner','editable','false','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','name','send','VtigerAccount','rawAttributes','model','keys','query','intersection','fields','attributes','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','show','params','length','include','find','create','catch','body','getConfigurations','VtigerConfiguration','sort','map','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc960,0x114));var _0x0c96=function(_0x3e7172,_0x18973e){_0x3e7172=_0x3e7172-0x0;var _0x2289d7=_0xc960[_0x3e7172];return _0x2289d7;};'use strict';var pdf=require(_0x0c96('0x0'));var emlformat=require(_0x0c96('0x1'));var rimraf=require(_0x0c96('0x2'));var zipdir=require(_0x0c96('0x3'));var jsonpatch=require(_0x0c96('0x4'));var rp=require(_0x0c96('0x5'));var moment=require(_0x0c96('0x6'));var BPromise=require(_0x0c96('0x7'));var Mustache=require(_0x0c96('0x8'));var util=require('util');var path=require('path');var sox=require(_0x0c96('0x9'));var csv=require(_0x0c96('0xa'));var ejs=require(_0x0c96('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0c96('0xc'));var crypto=require(_0x0c96('0xd'));var jsforce=require(_0x0c96('0xe'));var deskjs=require(_0x0c96('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0c96('0x10'));var Papa=require(_0x0c96('0x11'));var Redis=require(_0x0c96('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0c96('0x13'));var hardwareService=require(_0x0c96('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x0c96('0x15'));var config=require(_0x0c96('0x16'));var db=require(_0x0c96('0x17'))['db'];var integrations=require(_0x0c96('0x18'));var jayson=require(_0x0c96('0x19'));var client=jayson[_0x0c96('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x15fbe4,_0x1da84a,_0x4f4482){if(_0x4f4482){var _0x23885e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x23885e[_0x0c96('0x1b')](_0x1da84a)){return _0x15fbe4;}else{throw new Error(_0x0c96('0x1c'));}}else{return _0x15fbe4;}}function respondWithRpcPromise(_0xf883a4,_0x234abd,_0x361f56,_0x27419f){return new BPromise(function(_0x1e8511,_0x386b72){var _0x482ebc=_0x27419f||client;return _0x482ebc[_0x0c96('0x1d')](_0xf883a4,_0x361f56)[_0x0c96('0x1e')](function(_0x1e6579){logger[_0x0c96('0x1f')]('VtigerAccount,\x20%s,\x20%s',_0x234abd,_0x0c96('0x20'));logger[_0x0c96('0x21')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x234abd,_0x0c96('0x20'),JSON[_0x0c96('0x22')](_0x1e6579));if(_0x1e6579[_0x0c96('0x23')]){if(_0x1e6579[_0x0c96('0x23')][_0x0c96('0x24')]===0x1f4){logger[_0x0c96('0x23')](_0x0c96('0x25'),_0x234abd,_0x1e6579[_0x0c96('0x23')][_0x0c96('0x26')]);return _0x386b72(_0x1e6579[_0x0c96('0x23')][_0x0c96('0x26')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x234abd,_0x1e6579[_0x0c96('0x23')]['message']);return _0x1e8511(_0x1e6579[_0x0c96('0x23')][_0x0c96('0x26')]);}else{logger[_0x0c96('0x1f')]('VtigerAccount,\x20%s,\x20%s',_0x234abd,_0x0c96('0x20'));_0x1e8511(_0x1e6579[_0x0c96('0x27')][_0x0c96('0x26')]);}})['catch'](function(_0x47fd38){logger[_0x0c96('0x23')](_0x0c96('0x25'),_0x234abd,_0x47fd38);_0x386b72(_0x47fd38);});});}function respondWithStatusCode(_0x35570e,_0x51f058){_0x51f058=_0x51f058||0xcc;return function(_0xd4896){if(_0xd4896){return _0x35570e[_0x0c96('0x28')](_0x51f058);}return _0x35570e[_0x0c96('0x29')](_0x51f058)['end']();};}function respondWithResult(_0x2a38a7,_0x17b9f5){_0x17b9f5=_0x17b9f5||0xc8;return function(_0x1c7c15){if(_0x1c7c15){return _0x2a38a7['status'](_0x17b9f5)[_0x0c96('0x2a')](_0x1c7c15);}};}function respondWithFilteredResult(_0x480e6a,_0x50b66d){return function(_0x1a84f4){if(_0x1a84f4){var _0x45e98b=_0x1a84f4['count'],_0x3ed708=_0x50b66d[_0x0c96('0x2b')],_0x273d33=_0x50b66d[_0x0c96('0x2b')]+_0x50b66d[_0x0c96('0x2c')],_0x51f774;if(_0x273d33>=_0x45e98b){_0x273d33=_0x45e98b;_0x51f774=0xc8;}else{_0x51f774=0xce;}_0x480e6a[_0x0c96('0x29')](_0x51f774);return _0x480e6a[_0x0c96('0x2d')](_0x0c96('0x2e'),_0x3ed708+'-'+_0x273d33+'/'+_0x45e98b)[_0x0c96('0x2a')](_0x1a84f4);}return null;};}function patchUpdates(_0x86e392){return function(_0x451c67){try{jsonpatch[_0x0c96('0x2f')](_0x451c67,_0x86e392,!![]);}catch(_0x49677a){return BPromise[_0x0c96('0x30')](_0x49677a);}return _0x451c67[_0x0c96('0x31')]();};}function saveUpdates(_0x20cfd4,_0x477ecc){return function(_0x329304){if(_0x329304){return _0x329304[_0x0c96('0x32')](_0x20cfd4)[_0x0c96('0x1e')](function(_0xb8416f){return _0xb8416f;});}return null;};}function removeEntity(_0xfd25b5,_0x2733fe){return function(_0x59fc9c){if(_0x59fc9c){return _0x59fc9c[_0x0c96('0x33')]()[_0x0c96('0x1e')](function(){_0xfd25b5['status'](0xcc)[_0x0c96('0x34')]();});}};}function handleEntityNotFound(_0x59a519,_0x40df30){return function(_0x4a39a4){if(!_0x4a39a4){_0x59a519[_0x0c96('0x28')](0x194);}return _0x4a39a4;};}function handleError(_0x2d1f70,_0x50b731){_0x50b731=_0x50b731||0x1f4;return function(_0x3f84c6){logger['error'](_0x3f84c6['stack']);if(_0x3f84c6[_0x0c96('0x35')]){delete _0x3f84c6[_0x0c96('0x35')];}_0x2d1f70[_0x0c96('0x29')](_0x50b731)[_0x0c96('0x36')](_0x3f84c6);};}exports['index']=function(_0x3c7d9b,_0x2e6db4){var _0x1c181c={},_0x48e3fb={},_0x57187e={'count':0x0,'rows':[]};var _0x3acabf=db[_0x0c96('0x37')][_0x0c96('0x38')];_0x48e3fb[_0x0c96('0x39')]=_[_0x0c96('0x3a')](_0x3acabf);_0x48e3fb['query']=_[_0x0c96('0x3a')](_0x3c7d9b[_0x0c96('0x3b')]);_0x48e3fb['filters']=_[_0x0c96('0x3c')](_0x48e3fb[_0x0c96('0x39')],_0x48e3fb[_0x0c96('0x3b')]);_0x1c181c['attributes']=_[_0x0c96('0x3c')](_0x48e3fb[_0x0c96('0x39')],qs[_0x0c96('0x3d')](_0x3c7d9b[_0x0c96('0x3b')]['fields']));_0x1c181c[_0x0c96('0x3e')]=_0x1c181c[_0x0c96('0x3e')]['length']?_0x1c181c[_0x0c96('0x3e')]:_0x48e3fb[_0x0c96('0x39')];if(!_0x3c7d9b[_0x0c96('0x3b')]['hasOwnProperty'](_0x0c96('0x3f'))){_0x1c181c[_0x0c96('0x2c')]=qs[_0x0c96('0x2c')](_0x3c7d9b[_0x0c96('0x3b')][_0x0c96('0x2c')]);_0x1c181c[_0x0c96('0x2b')]=qs[_0x0c96('0x2b')](_0x3c7d9b[_0x0c96('0x3b')][_0x0c96('0x2b')]);}_0x1c181c[_0x0c96('0x40')]=qs['sort'](_0x3c7d9b[_0x0c96('0x3b')]['sort']);_0x1c181c[_0x0c96('0x41')]=qs[_0x0c96('0x42')](_[_0x0c96('0x43')](_0x3c7d9b[_0x0c96('0x3b')],_0x48e3fb[_0x0c96('0x42')]));if(_0x3c7d9b[_0x0c96('0x3b')][_0x0c96('0x44')]){_0x1c181c['where']=_[_0x0c96('0x45')](_0x1c181c['where'],{'$or':_['map'](_0x3acabf,function(_0x27d597){if(_0x27d597[_0x0c96('0x46')]['key']!==_0x0c96('0x47')){var _0x105a3f={};_0x105a3f[_0x27d597['field']]={'$like':'%'+_0x3c7d9b['query'][_0x0c96('0x44')]+'%'};return _0x105a3f;}})});}_0x1c181c=_[_0x0c96('0x45')]({},_0x1c181c,_0x3c7d9b[_0x0c96('0x48')]);var _0x63b862={'where':_0x1c181c[_0x0c96('0x41')]};return db['VtigerAccount']['count'](_0x63b862)[_0x0c96('0x1e')](function(_0x5d0d82){_0x57187e['count']=_0x5d0d82;if(_0x3c7d9b[_0x0c96('0x3b')][_0x0c96('0x49')]){_0x1c181c['include']=[{'all':!![]}];}return db[_0x0c96('0x37')]['findAll'](_0x1c181c);})[_0x0c96('0x1e')](function(_0x4ece03){_0x57187e[_0x0c96('0x4a')]=_0x4ece03;return _0x57187e;})[_0x0c96('0x1e')](respondWithFilteredResult(_0x2e6db4,_0x1c181c))['catch'](handleError(_0x2e6db4,null));};exports[_0x0c96('0x4b')]=function(_0x512940,_0x38e2c7){var _0x411637={'raw':![],'where':{'id':_0x512940[_0x0c96('0x4c')]['id']}},_0x50e6e2={};_0x50e6e2['model']=_[_0x0c96('0x3a')](db[_0x0c96('0x37')][_0x0c96('0x38')]);_0x50e6e2[_0x0c96('0x3b')]=_[_0x0c96('0x3a')](_0x512940[_0x0c96('0x3b')]);_0x50e6e2[_0x0c96('0x42')]=_[_0x0c96('0x3c')](_0x50e6e2[_0x0c96('0x39')],_0x50e6e2['query']);_0x411637[_0x0c96('0x3e')]=_[_0x0c96('0x3c')](_0x50e6e2['model'],qs[_0x0c96('0x3d')](_0x512940[_0x0c96('0x3b')][_0x0c96('0x3d')]));_0x411637[_0x0c96('0x3e')]=_0x411637[_0x0c96('0x3e')][_0x0c96('0x4d')]?_0x411637[_0x0c96('0x3e')]:_0x50e6e2[_0x0c96('0x39')];if(_0x512940[_0x0c96('0x3b')]['includeAll']){_0x411637[_0x0c96('0x4e')]=[{'all':!![]}];}_0x411637=_[_0x0c96('0x45')]({},_0x411637,_0x512940[_0x0c96('0x48')]);return db[_0x0c96('0x37')][_0x0c96('0x4f')](_0x411637)[_0x0c96('0x1e')](handleEntityNotFound(_0x38e2c7,null))[_0x0c96('0x1e')](respondWithResult(_0x38e2c7,null))['catch'](handleError(_0x38e2c7,null));};exports[_0x0c96('0x50')]=function(_0x2f29ed,_0x54f092){return db['VtigerAccount'][_0x0c96('0x50')](_0x2f29ed['body'],{})[_0x0c96('0x1e')](respondWithResult(_0x54f092,0xc9))[_0x0c96('0x51')](handleError(_0x54f092,null));};exports[_0x0c96('0x32')]=function(_0x5b405,_0x4bb794){if(_0x5b405[_0x0c96('0x52')]['id']){delete _0x5b405[_0x0c96('0x52')]['id'];}return db[_0x0c96('0x37')][_0x0c96('0x4f')]({'where':{'id':_0x5b405[_0x0c96('0x4c')]['id']}})[_0x0c96('0x1e')](handleEntityNotFound(_0x4bb794,null))[_0x0c96('0x1e')](saveUpdates(_0x5b405['body'],null))[_0x0c96('0x1e')](respondWithResult(_0x4bb794,null))[_0x0c96('0x51')](handleError(_0x4bb794,null));};exports['destroy']=function(_0x47a69a,_0x24e1de){return db[_0x0c96('0x37')][_0x0c96('0x4f')]({'where':{'id':_0x47a69a[_0x0c96('0x4c')]['id']}})[_0x0c96('0x1e')](handleEntityNotFound(_0x24e1de,null))[_0x0c96('0x1e')](removeEntity(_0x24e1de,null))[_0x0c96('0x51')](handleError(_0x24e1de,null));};exports[_0x0c96('0x53')]=function(_0xa35c9a,_0xd951a0,_0x492d70){var _0x1df330={};var _0x2757c9={};var _0x431f38;var _0x430f6c;return db[_0x0c96('0x37')]['findOne']({'where':{'id':_0xa35c9a[_0x0c96('0x4c')]['id']}})[_0x0c96('0x1e')](handleEntityNotFound(_0xd951a0,null))['then'](function(_0x1b7a38){if(_0x1b7a38){_0x431f38=_0x1b7a38;_0x2757c9[_0x0c96('0x39')]=_[_0x0c96('0x3a')](db[_0x0c96('0x54')]['rawAttributes']);_0x2757c9['query']=_[_0x0c96('0x3a')](_0xa35c9a[_0x0c96('0x3b')]);_0x2757c9[_0x0c96('0x42')]=_[_0x0c96('0x3c')](_0x2757c9['model'],_0x2757c9['query']);_0x1df330[_0x0c96('0x3e')]=_['intersection'](_0x2757c9[_0x0c96('0x39')],qs[_0x0c96('0x3d')](_0xa35c9a[_0x0c96('0x3b')][_0x0c96('0x3d')]));_0x1df330[_0x0c96('0x3e')]=_0x1df330[_0x0c96('0x3e')]['length']?_0x1df330[_0x0c96('0x3e')]:_0x2757c9['model'];_0x1df330[_0x0c96('0x40')]=qs[_0x0c96('0x55')](_0xa35c9a[_0x0c96('0x3b')][_0x0c96('0x55')]);_0x1df330[_0x0c96('0x41')]=qs[_0x0c96('0x42')](_['pick'](_0xa35c9a[_0x0c96('0x3b')],_0x2757c9[_0x0c96('0x42')]));if(_0xa35c9a[_0x0c96('0x3b')][_0x0c96('0x44')]){_0x1df330['where']=_[_0x0c96('0x45')](_0x1df330['where'],{'$or':_[_0x0c96('0x56')](_0x1df330[_0x0c96('0x3e')],function(_0x512192){var _0x530fc6={};_0x530fc6[_0x512192]={'$like':'%'+_0xa35c9a[_0x0c96('0x3b')]['filter']+'%'};return _0x530fc6;})});}_0x1df330=_[_0x0c96('0x45')]({},_0x1df330,_0xa35c9a[_0x0c96('0x48')]);return _0x431f38[_0x0c96('0x53')](_0x1df330);}})[_0x0c96('0x1e')](function(_0x9f04bd){if(_0x9f04bd){_0x430f6c=_0x9f04bd[_0x0c96('0x4d')];if(!_0xa35c9a[_0x0c96('0x3b')]['hasOwnProperty'](_0x0c96('0x3f'))){_0x1df330[_0x0c96('0x2c')]=qs[_0x0c96('0x2c')](_0xa35c9a[_0x0c96('0x3b')][_0x0c96('0x2c')]);_0x1df330[_0x0c96('0x2b')]=qs[_0x0c96('0x2b')](_0xa35c9a['query'][_0x0c96('0x2b')]);}return _0x431f38['getConfigurations'](_0x1df330);}})[_0x0c96('0x1e')](function(_0x38a19e){if(_0x38a19e){return _0x38a19e?{'count':_0x430f6c,'rows':_0x38a19e}:null;}})[_0x0c96('0x1e')](respondWithResult(_0xd951a0,null))[_0x0c96('0x51')](handleError(_0xd951a0,null));};exports[_0x0c96('0x57')]=function(_0x2f6fc1,_0x3a1c47,_0x4c7317){if(_0x2f6fc1[_0x0c96('0x52')]['id']){delete _0x2f6fc1[_0x0c96('0x52')]['id'];}return db[_0x0c96('0x37')][_0x0c96('0x58')]({'where':{'id':_0x2f6fc1[_0x0c96('0x4c')]['id']}})[_0x0c96('0x1e')](handleEntityNotFound(_0x3a1c47,null))[_0x0c96('0x1e')](function(_0x1999a7){if(_0x1999a7){_0x2f6fc1[_0x0c96('0x52')][_0x0c96('0x59')]=_0x1999a7['id'];_0x2f6fc1[_0x0c96('0x52')][_0x0c96('0x5a')]=integrations[_0x0c96('0x5b')](_0x2f6fc1['body'][_0x0c96('0x5c')],_0x2f6fc1['body']['type']);_0x2f6fc1[_0x0c96('0x52')][_0x0c96('0x5d')]=integrations[_0x0c96('0x5e')](_0x2f6fc1[_0x0c96('0x52')][_0x0c96('0x5c')],_0x2f6fc1[_0x0c96('0x52')]['type']);return db[_0x0c96('0x54')][_0x0c96('0x50')](_0x2f6fc1[_0x0c96('0x52')],{'include':[{'model':db['VtigerField'],'as':_0x0c96('0x5a')},{'model':db[_0x0c96('0x5f')],'as':'Descriptions'}]});}return null;})[_0x0c96('0x1e')](respondWithResult(_0x3a1c47,null))[_0x0c96('0x51')](handleError(_0x3a1c47,null));};var md5=require(_0x0c96('0x60'));exports[_0x0c96('0x61')]=function(_0x4c196c,_0x309610,_0x3ea8bf){var _0x317194=null;var _0x1a6250=null;var _0x22b961=null;var _0x3d9f74=null;var _0x1ec2b0='';return db[_0x0c96('0x37')][_0x0c96('0x58')]({'where':{'id':_0x4c196c[_0x0c96('0x4c')]['id']},'attributes':['id',_0x0c96('0x35'),_0x0c96('0x62'),_0x0c96('0x63'),_0x0c96('0x64'),_0x0c96('0x65'),_0x0c96('0x66'),'accessKey']})[_0x0c96('0x1e')](handleEntityNotFound(_0x309610,null))[_0x0c96('0x1e')](function(_0x248e82){if(_0x248e82){_0x317194=_0x248e82[_0x0c96('0x62')];_0x1a6250=_0x248e82[_0x0c96('0x67')];_0x22b961=_0x248e82[_0x0c96('0x64')];_0x1ec2b0=_0x248e82[_0x0c96('0x65')];var _0x3313b4=_0x1ec2b0[_0x0c96('0x68')](-0x1);if(_0x3313b4==='/'){_0x1ec2b0=_0x1ec2b0[_0x0c96('0x69')](0x0,_0x1ec2b0['lastIndexOf'](_0x3313b4));}_0x3d9f74=util['format'](_0x0c96('0x6a'),_0x1ec2b0);var _0x5e3b3d={'method':_0x0c96('0x6b'),'uri':_0x3d9f74,'qs':{'operation':'getchallenge','username':_0x248e82[_0x0c96('0x62')]},'json':!![]};return rp(_0x5e3b3d);}})[_0x0c96('0x1e')](function(_0x5ef536){if(_0x5ef536[_0x0c96('0x6c')]){var _0x28a90a={'method':_0x0c96('0x6d'),'uri':_0x3d9f74,'form':{'operation':_0x0c96('0x6e'),'username':_0x317194,'accessKey':md5(_0x5ef536[_0x0c96('0x27')]['token']+_0x1a6250)},'json':!![]};return rp(_0x28a90a);}})[_0x0c96('0x1e')](function(_0x2098d9){if(_0x2098d9[_0x0c96('0x6c')]){var _0x482e31={'method':_0x0c96('0x6b'),'uri':_0x3d9f74,'qs':{'operation':_0x0c96('0x6f'),'username':_0x317194,'sessionName':_0x2098d9[_0x0c96('0x27')][_0x0c96('0x70')],'elementType':_0x22b961},'json':!![]};return rp(_0x482e31);}})['then'](function(_0x33324f){if(_0x33324f[_0x0c96('0x6c')]){var _0x5320e1=[_0x0c96('0x71'),'reference',_0x0c96('0x72')];_['remove'](_0x33324f[_0x0c96('0x27')]['fields'],function(_0x14d102){return _0x5320e1['includes'](_0x14d102[_0x0c96('0x46')][_0x0c96('0x35')]);});_['remove'](_0x33324f[_0x0c96('0x27')][_0x0c96('0x3d')],function(_0x27109e){return _0x27109e[_0x0c96('0x73')]===_0x0c96('0x74');});return{'count':_0x33324f['result'][_0x0c96('0x3d')][_0x0c96('0x4d')],'rows':_['map'](_0x33324f[_0x0c96('0x27')][_0x0c96('0x3d')],function(_0x147a46){return{'id':_0x147a46[_0x0c96('0x35')],'name':_0x147a46[_0x0c96('0x75')],'custom':_[_0x0c96('0x76')](_0x147a46[_0x0c96('0x35')],_0x0c96('0x77'))?!![]:![],'options':_0x147a46[_0x0c96('0x46')]['name']===_0x0c96('0x78')&&_0x147a46['type'][_0x0c96('0x79')][_0x0c96('0x4d')]>0x0?_['map'](_0x147a46[_0x0c96('0x46')][_0x0c96('0x79')],function(_0x23239e){return{'name':_0x23239e['label'],'value':_0x23239e[_0x0c96('0x7a')]};}):[]};})};}})[_0x0c96('0x1e')](respondWithResult(_0x309610,null))[_0x0c96('0x51')](function(_0x50762){console['log'](_0x0c96('0x7b')+_0x50762);var _0x306087=_0x4c196c['query'][_0x0c96('0x1b')]?0x1f4:_0x50762[_0x0c96('0x7c')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x306087,JSON[_0x0c96('0x22')](_0x50762));delete _0x50762[_0x0c96('0x35')];if(_0x306087===0x191){_0x306087=0x190;}_0x309610[_0x0c96('0x29')](_0x306087)[_0x0c96('0x36')](_0x4c196c[_0x0c96('0x3b')][_0x0c96('0x1b')]?{'message':_0x0c96('0x7d'),'statusCode':_0x50762['statusCode']}:_0x50762);});}; \ No newline at end of file +var _0xd8b3=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','status','end','count','offset','limit','set','Content-Range','json','apply','save','then','destroy','sendStatus','stack','name','index','VtigerAccount','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','includeAll','include','findAll','rows','show','options','find','create','body','update','params','getConfigurations','findOne','AccountId','channel','getDescriptions','VtigerField','Subjects','Descriptions','md5','getFields','username','remoteUri','accessKey','moduleName','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','POST','result','describe','sessionName','autogenerated','reference','owner','remove','editable','false','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','statusCode','stringify','send','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xd8b3,0x6c));var _0x3d8b=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0xd8b3[_0x400b43];return _0x3c330f;};'use strict';var pdf=require(_0x3d8b('0x0'));var emlformat=require(_0x3d8b('0x1'));var rimraf=require(_0x3d8b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d8b('0x3'));var rp=require('request-promise');var moment=require(_0x3d8b('0x4'));var BPromise=require(_0x3d8b('0x5'));var Mustache=require(_0x3d8b('0x6'));var util=require(_0x3d8b('0x7'));var path=require(_0x3d8b('0x8'));var sox=require('sox');var csv=require(_0x3d8b('0x9'));var ejs=require(_0x3d8b('0xa'));var fs=require('fs');var _=require(_0x3d8b('0xb'));var squel=require(_0x3d8b('0xc'));var crypto=require(_0x3d8b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3d8b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3d8b('0xf'));var Papa=require(_0x3d8b('0x10'));var Redis=require(_0x3d8b('0x11'));var authService=require(_0x3d8b('0x12'));var qs=require(_0x3d8b('0x13'));var hardwareService=require(_0x3d8b('0x14'));var logger=require(_0x3d8b('0x15'))(_0x3d8b('0x16'));var utils=require(_0x3d8b('0x17'));var config=require(_0x3d8b('0x18'));var db=require(_0x3d8b('0x19'))['db'];var integrations=require(_0x3d8b('0x1a'));var jayson=require('jayson/promise');var client=jayson[_0x3d8b('0x1b')][_0x3d8b('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3ee5ca,_0x3b5dc,_0x4d0029){if(_0x4d0029){var _0x18e1b6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18e1b6[_0x3d8b('0x1d')](_0x3b5dc)){return _0x3ee5ca;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3ee5ca;}}function respondWithRpcPromise(_0x46b445,_0x4fd03d,_0x3bc8bf,_0x234705){return new BPromise(function(_0x200b1d,_0x57e520){var _0x5e6a6c=_0x234705||client;return _0x5e6a6c[_0x3d8b('0x1e')](_0x46b445,_0x3bc8bf)['then'](function(_0x3da21c){logger[_0x3d8b('0x1f')](_0x3d8b('0x20'),_0x4fd03d,_0x3d8b('0x21'));logger[_0x3d8b('0x22')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4fd03d,_0x3d8b('0x21'),JSON['stringify'](_0x3da21c));if(_0x3da21c['error']){if(_0x3da21c[_0x3d8b('0x23')][_0x3d8b('0x24')]===0x1f4){logger['error'](_0x3d8b('0x20'),_0x4fd03d,_0x3da21c['error'][_0x3d8b('0x25')]);return _0x57e520(_0x3da21c[_0x3d8b('0x23')][_0x3d8b('0x25')]);}logger[_0x3d8b('0x23')](_0x3d8b('0x20'),_0x4fd03d,_0x3da21c[_0x3d8b('0x23')]['message']);return _0x200b1d(_0x3da21c[_0x3d8b('0x23')]['message']);}else{logger[_0x3d8b('0x1f')](_0x3d8b('0x20'),_0x4fd03d,_0x3d8b('0x21'));_0x200b1d(_0x3da21c['result'][_0x3d8b('0x25')]);}})[_0x3d8b('0x26')](function(_0x3b9e2f){logger[_0x3d8b('0x23')](_0x3d8b('0x20'),_0x4fd03d,_0x3b9e2f);_0x57e520(_0x3b9e2f);});});}function respondWithStatusCode(_0x28fcc3,_0xbb4254){_0xbb4254=_0xbb4254||0xcc;return function(_0x46a635){if(_0x46a635){return _0x28fcc3['sendStatus'](_0xbb4254);}return _0x28fcc3[_0x3d8b('0x27')](_0xbb4254)[_0x3d8b('0x28')]();};}function respondWithResult(_0x50a669,_0x5aabb6){_0x5aabb6=_0x5aabb6||0xc8;return function(_0x4acc93){if(_0x4acc93){return _0x50a669[_0x3d8b('0x27')](_0x5aabb6)['json'](_0x4acc93);}};}function respondWithFilteredResult(_0x2b86c3,_0x5b2b3f){return function(_0x505098){if(_0x505098){var _0x1a83ca=_0x505098[_0x3d8b('0x29')],_0x50a00b=_0x5b2b3f[_0x3d8b('0x2a')],_0x3e7a7a=_0x5b2b3f[_0x3d8b('0x2a')]+_0x5b2b3f[_0x3d8b('0x2b')],_0x4fb9e1;if(_0x3e7a7a>=_0x1a83ca){_0x3e7a7a=_0x1a83ca;_0x4fb9e1=0xc8;}else{_0x4fb9e1=0xce;}_0x2b86c3[_0x3d8b('0x27')](_0x4fb9e1);return _0x2b86c3[_0x3d8b('0x2c')](_0x3d8b('0x2d'),_0x50a00b+'-'+_0x3e7a7a+'/'+_0x1a83ca)[_0x3d8b('0x2e')](_0x505098);}return null;};}function patchUpdates(_0x23cacd){return function(_0x6eeef4){try{jsonpatch[_0x3d8b('0x2f')](_0x6eeef4,_0x23cacd,!![]);}catch(_0x3e2ad9){return BPromise['reject'](_0x3e2ad9);}return _0x6eeef4[_0x3d8b('0x30')]();};}function saveUpdates(_0x42d09a,_0x5e605d){return function(_0x311e14){if(_0x311e14){return _0x311e14['update'](_0x42d09a)[_0x3d8b('0x31')](function(_0x3ae43c){return _0x3ae43c;});}return null;};}function removeEntity(_0x5c816d,_0x33e73f){return function(_0x3b4ec2){if(_0x3b4ec2){return _0x3b4ec2[_0x3d8b('0x32')]()[_0x3d8b('0x31')](function(){_0x5c816d[_0x3d8b('0x27')](0xcc)[_0x3d8b('0x28')]();});}};}function handleEntityNotFound(_0x310bd1,_0x51502e){return function(_0x25a716){if(!_0x25a716){_0x310bd1[_0x3d8b('0x33')](0x194);}return _0x25a716;};}function handleError(_0x596bf3,_0x1bf846){_0x1bf846=_0x1bf846||0x1f4;return function(_0x1cccae){logger['error'](_0x1cccae[_0x3d8b('0x34')]);if(_0x1cccae[_0x3d8b('0x35')]){delete _0x1cccae[_0x3d8b('0x35')];}_0x596bf3[_0x3d8b('0x27')](_0x1bf846)['send'](_0x1cccae);};}exports[_0x3d8b('0x36')]=function(_0x11daaf,_0x236bed){var _0x297000={},_0x516f47={},_0x3ddb01={'count':0x0,'rows':[]};var _0x367c91=db[_0x3d8b('0x37')][_0x3d8b('0x38')];_0x516f47[_0x3d8b('0x39')]=_['keys'](_0x367c91);_0x516f47[_0x3d8b('0x3a')]=_[_0x3d8b('0x3b')](_0x11daaf['query']);_0x516f47[_0x3d8b('0x3c')]=_[_0x3d8b('0x3d')](_0x516f47[_0x3d8b('0x39')],_0x516f47['query']);_0x297000[_0x3d8b('0x3e')]=_[_0x3d8b('0x3d')](_0x516f47[_0x3d8b('0x39')],qs[_0x3d8b('0x3f')](_0x11daaf[_0x3d8b('0x3a')][_0x3d8b('0x3f')]));_0x297000[_0x3d8b('0x3e')]=_0x297000[_0x3d8b('0x3e')][_0x3d8b('0x40')]?_0x297000[_0x3d8b('0x3e')]:_0x516f47[_0x3d8b('0x39')];if(!_0x11daaf[_0x3d8b('0x3a')][_0x3d8b('0x41')](_0x3d8b('0x42'))){_0x297000[_0x3d8b('0x2b')]=qs[_0x3d8b('0x2b')](_0x11daaf[_0x3d8b('0x3a')][_0x3d8b('0x2b')]);_0x297000[_0x3d8b('0x2a')]=qs[_0x3d8b('0x2a')](_0x11daaf[_0x3d8b('0x3a')]['offset']);}_0x297000[_0x3d8b('0x43')]=qs[_0x3d8b('0x44')](_0x11daaf[_0x3d8b('0x3a')]['sort']);_0x297000[_0x3d8b('0x45')]=qs[_0x3d8b('0x3c')](_[_0x3d8b('0x46')](_0x11daaf[_0x3d8b('0x3a')],_0x516f47[_0x3d8b('0x3c')]));if(_0x11daaf['query'][_0x3d8b('0x47')]){_0x297000[_0x3d8b('0x45')]=_[_0x3d8b('0x48')](_0x297000['where'],{'$or':_[_0x3d8b('0x49')](_0x367c91,function(_0x17b2b8){if(_0x17b2b8[_0x3d8b('0x4a')]['key']!=='VIRTUAL'){var _0x5807c5={};_0x5807c5[_0x17b2b8[_0x3d8b('0x4b')]]={'$like':'%'+_0x11daaf[_0x3d8b('0x3a')]['filter']+'%'};return _0x5807c5;}})});}_0x297000=_[_0x3d8b('0x48')]({},_0x297000,_0x11daaf['options']);var _0x397bde={'where':_0x297000['where']};return db[_0x3d8b('0x37')]['count'](_0x397bde)[_0x3d8b('0x31')](function(_0x151f76){_0x3ddb01['count']=_0x151f76;if(_0x11daaf['query'][_0x3d8b('0x4c')]){_0x297000[_0x3d8b('0x4d')]=[{'all':!![]}];}return db[_0x3d8b('0x37')][_0x3d8b('0x4e')](_0x297000);})[_0x3d8b('0x31')](function(_0x4eb799){_0x3ddb01[_0x3d8b('0x4f')]=_0x4eb799;return _0x3ddb01;})['then'](respondWithFilteredResult(_0x236bed,_0x297000))[_0x3d8b('0x26')](handleError(_0x236bed,null));};exports[_0x3d8b('0x50')]=function(_0x389df1,_0x3e7eb0){var _0x3f0436={'raw':![],'where':{'id':_0x389df1['params']['id']}},_0x15e808={};_0x15e808['model']=_[_0x3d8b('0x3b')](db[_0x3d8b('0x37')]['rawAttributes']);_0x15e808[_0x3d8b('0x3a')]=_[_0x3d8b('0x3b')](_0x389df1[_0x3d8b('0x3a')]);_0x15e808['filters']=_[_0x3d8b('0x3d')](_0x15e808[_0x3d8b('0x39')],_0x15e808['query']);_0x3f0436['attributes']=_[_0x3d8b('0x3d')](_0x15e808['model'],qs[_0x3d8b('0x3f')](_0x389df1['query'][_0x3d8b('0x3f')]));_0x3f0436[_0x3d8b('0x3e')]=_0x3f0436[_0x3d8b('0x3e')][_0x3d8b('0x40')]?_0x3f0436[_0x3d8b('0x3e')]:_0x15e808[_0x3d8b('0x39')];if(_0x389df1[_0x3d8b('0x3a')][_0x3d8b('0x4c')]){_0x3f0436[_0x3d8b('0x4d')]=[{'all':!![]}];}_0x3f0436=_[_0x3d8b('0x48')]({},_0x3f0436,_0x389df1[_0x3d8b('0x51')]);return db[_0x3d8b('0x37')][_0x3d8b('0x52')](_0x3f0436)[_0x3d8b('0x31')](handleEntityNotFound(_0x3e7eb0,null))[_0x3d8b('0x31')](respondWithResult(_0x3e7eb0,null))[_0x3d8b('0x26')](handleError(_0x3e7eb0,null));};exports[_0x3d8b('0x53')]=function(_0x25c103,_0x5d8a1c){return db[_0x3d8b('0x37')][_0x3d8b('0x53')](_0x25c103[_0x3d8b('0x54')],{})[_0x3d8b('0x31')](respondWithResult(_0x5d8a1c,0xc9))[_0x3d8b('0x26')](handleError(_0x5d8a1c,null));};exports[_0x3d8b('0x55')]=function(_0x5c11da,_0x359e37){if(_0x5c11da[_0x3d8b('0x54')]['id']){delete _0x5c11da[_0x3d8b('0x54')]['id'];}return db[_0x3d8b('0x37')][_0x3d8b('0x52')]({'where':{'id':_0x5c11da[_0x3d8b('0x56')]['id']}})[_0x3d8b('0x31')](handleEntityNotFound(_0x359e37,null))[_0x3d8b('0x31')](saveUpdates(_0x5c11da['body'],null))['then'](respondWithResult(_0x359e37,null))['catch'](handleError(_0x359e37,null));};exports[_0x3d8b('0x32')]=function(_0x5f4445,_0x24ef40){return db['VtigerAccount']['find']({'where':{'id':_0x5f4445[_0x3d8b('0x56')]['id']}})[_0x3d8b('0x31')](handleEntityNotFound(_0x24ef40,null))[_0x3d8b('0x31')](removeEntity(_0x24ef40,null))[_0x3d8b('0x26')](handleError(_0x24ef40,null));};exports[_0x3d8b('0x57')]=function(_0xc4a33a,_0xeb8539,_0x5b869e){var _0x78cae0={};var _0x3a8611={};var _0x48701e;var _0x457c5e;return db[_0x3d8b('0x37')][_0x3d8b('0x58')]({'where':{'id':_0xc4a33a[_0x3d8b('0x56')]['id']}})[_0x3d8b('0x31')](handleEntityNotFound(_0xeb8539,null))['then'](function(_0x12df24){if(_0x12df24){_0x48701e=_0x12df24;_0x3a8611[_0x3d8b('0x39')]=_[_0x3d8b('0x3b')](db['VtigerConfiguration'][_0x3d8b('0x38')]);_0x3a8611[_0x3d8b('0x3a')]=_[_0x3d8b('0x3b')](_0xc4a33a[_0x3d8b('0x3a')]);_0x3a8611[_0x3d8b('0x3c')]=_[_0x3d8b('0x3d')](_0x3a8611[_0x3d8b('0x39')],_0x3a8611[_0x3d8b('0x3a')]);_0x78cae0[_0x3d8b('0x3e')]=_[_0x3d8b('0x3d')](_0x3a8611[_0x3d8b('0x39')],qs[_0x3d8b('0x3f')](_0xc4a33a['query'][_0x3d8b('0x3f')]));_0x78cae0[_0x3d8b('0x3e')]=_0x78cae0[_0x3d8b('0x3e')][_0x3d8b('0x40')]?_0x78cae0['attributes']:_0x3a8611[_0x3d8b('0x39')];_0x78cae0[_0x3d8b('0x43')]=qs[_0x3d8b('0x44')](_0xc4a33a[_0x3d8b('0x3a')][_0x3d8b('0x44')]);_0x78cae0[_0x3d8b('0x45')]=qs[_0x3d8b('0x3c')](_[_0x3d8b('0x46')](_0xc4a33a['query'],_0x3a8611[_0x3d8b('0x3c')]));if(_0xc4a33a[_0x3d8b('0x3a')][_0x3d8b('0x47')]){_0x78cae0[_0x3d8b('0x45')]=_['merge'](_0x78cae0['where'],{'$or':_[_0x3d8b('0x49')](_0x78cae0[_0x3d8b('0x3e')],function(_0x379481){var _0x17c627={};_0x17c627[_0x379481]={'$like':'%'+_0xc4a33a[_0x3d8b('0x3a')][_0x3d8b('0x47')]+'%'};return _0x17c627;})});}_0x78cae0=_[_0x3d8b('0x48')]({},_0x78cae0,_0xc4a33a[_0x3d8b('0x51')]);return _0x48701e[_0x3d8b('0x57')](_0x78cae0);}})[_0x3d8b('0x31')](function(_0x3097e1){if(_0x3097e1){_0x457c5e=_0x3097e1['length'];if(!_0xc4a33a[_0x3d8b('0x3a')][_0x3d8b('0x41')](_0x3d8b('0x42'))){_0x78cae0['limit']=qs[_0x3d8b('0x2b')](_0xc4a33a['query'][_0x3d8b('0x2b')]);_0x78cae0['offset']=qs[_0x3d8b('0x2a')](_0xc4a33a[_0x3d8b('0x3a')]['offset']);}return _0x48701e[_0x3d8b('0x57')](_0x78cae0);}})[_0x3d8b('0x31')](function(_0x4eeddd){if(_0x4eeddd){return _0x4eeddd?{'count':_0x457c5e,'rows':_0x4eeddd}:null;}})[_0x3d8b('0x31')](respondWithResult(_0xeb8539,null))['catch'](handleError(_0xeb8539,null));};exports['addConfiguration']=function(_0x2808b7,_0x197333,_0x45299f){if(_0x2808b7[_0x3d8b('0x54')]['id']){delete _0x2808b7[_0x3d8b('0x54')]['id'];}return db[_0x3d8b('0x37')][_0x3d8b('0x58')]({'where':{'id':_0x2808b7[_0x3d8b('0x56')]['id']}})[_0x3d8b('0x31')](handleEntityNotFound(_0x197333,null))[_0x3d8b('0x31')](function(_0x24a080){if(_0x24a080){_0x2808b7[_0x3d8b('0x54')][_0x3d8b('0x59')]=_0x24a080['id'];_0x2808b7[_0x3d8b('0x54')]['Subjects']=integrations['getSubjects'](_0x2808b7[_0x3d8b('0x54')][_0x3d8b('0x5a')],_0x2808b7[_0x3d8b('0x54')][_0x3d8b('0x4a')]);_0x2808b7[_0x3d8b('0x54')]['Descriptions']=integrations[_0x3d8b('0x5b')](_0x2808b7[_0x3d8b('0x54')][_0x3d8b('0x5a')],_0x2808b7['body'][_0x3d8b('0x4a')]);return db['VtigerConfiguration'][_0x3d8b('0x53')](_0x2808b7[_0x3d8b('0x54')],{'include':[{'model':db[_0x3d8b('0x5c')],'as':_0x3d8b('0x5d')},{'model':db[_0x3d8b('0x5c')],'as':_0x3d8b('0x5e')}]});}return null;})['then'](respondWithResult(_0x197333,null))['catch'](handleError(_0x197333,null));};var md5=require(_0x3d8b('0x5f'));exports[_0x3d8b('0x60')]=function(_0x5165b9,_0x458dd1,_0x47756c){var _0x458dc8=null;var _0xdcd629=null;var _0x75b458=null;var _0x11516=null;var _0x48d350='';return db[_0x3d8b('0x37')][_0x3d8b('0x58')]({'where':{'id':_0x5165b9[_0x3d8b('0x56')]['id']},'attributes':['id',_0x3d8b('0x35'),_0x3d8b('0x61'),'description','moduleName',_0x3d8b('0x62'),'serverUrl',_0x3d8b('0x63')]})[_0x3d8b('0x31')](handleEntityNotFound(_0x458dd1,null))[_0x3d8b('0x31')](function(_0x1a4f51){if(_0x1a4f51){_0x458dc8=_0x1a4f51[_0x3d8b('0x61')];_0xdcd629=_0x1a4f51[_0x3d8b('0x63')];_0x75b458=_0x1a4f51[_0x3d8b('0x64')];_0x48d350=_0x1a4f51[_0x3d8b('0x62')];var _0x126686=_0x48d350[_0x3d8b('0x65')](-0x1);if(_0x126686==='/'){_0x48d350=_0x48d350[_0x3d8b('0x66')](0x0,_0x48d350[_0x3d8b('0x67')](_0x126686));}_0x11516=util[_0x3d8b('0x68')](_0x3d8b('0x69'),_0x48d350);var _0x5752a7={'method':_0x3d8b('0x6a'),'uri':_0x11516,'qs':{'operation':'getchallenge','username':_0x1a4f51[_0x3d8b('0x61')]},'json':!![]};return rp(_0x5752a7);}})[_0x3d8b('0x31')](function(_0x505ef7){if(_0x505ef7[_0x3d8b('0x6b')]){var _0x2c1e5a={'method':_0x3d8b('0x6c'),'uri':_0x11516,'form':{'operation':'login','username':_0x458dc8,'accessKey':md5(_0x505ef7[_0x3d8b('0x6d')]['token']+_0xdcd629)},'json':!![]};return rp(_0x2c1e5a);}})[_0x3d8b('0x31')](function(_0x99ec21){if(_0x99ec21['success']){var _0x347388={'method':'GET','uri':_0x11516,'qs':{'operation':_0x3d8b('0x6e'),'username':_0x458dc8,'sessionName':_0x99ec21[_0x3d8b('0x6d')][_0x3d8b('0x6f')],'elementType':_0x75b458},'json':!![]};return rp(_0x347388);}})['then'](function(_0x1015d9){if(_0x1015d9['success']){var _0x5e2093=[_0x3d8b('0x70'),_0x3d8b('0x71'),_0x3d8b('0x72')];_[_0x3d8b('0x73')](_0x1015d9[_0x3d8b('0x6d')][_0x3d8b('0x3f')],function(_0x249928){return _0x5e2093['includes'](_0x249928[_0x3d8b('0x4a')][_0x3d8b('0x35')]);});_['remove'](_0x1015d9['result']['fields'],function(_0x4755b0){return _0x4755b0[_0x3d8b('0x74')]===_0x3d8b('0x75');});return{'count':_0x1015d9[_0x3d8b('0x6d')][_0x3d8b('0x3f')][_0x3d8b('0x40')],'rows':_[_0x3d8b('0x49')](_0x1015d9['result']['fields'],function(_0x1c124a){return{'id':_0x1c124a[_0x3d8b('0x35')],'name':_0x1c124a[_0x3d8b('0x76')],'custom':_[_0x3d8b('0x77')](_0x1c124a[_0x3d8b('0x35')],_0x3d8b('0x78'))?!![]:![],'options':_0x1c124a['type'][_0x3d8b('0x35')]===_0x3d8b('0x79')&&_0x1c124a[_0x3d8b('0x4a')][_0x3d8b('0x7a')][_0x3d8b('0x40')]>0x0?_[_0x3d8b('0x49')](_0x1c124a[_0x3d8b('0x4a')]['picklistValues'],function(_0x399c4a){return{'name':_0x399c4a[_0x3d8b('0x76')],'value':_0x399c4a[_0x3d8b('0x7b')]};}):[]};})};}})[_0x3d8b('0x31')](respondWithResult(_0x458dd1,null))['catch'](function(_0x500d93){console['log'](_0x3d8b('0x7c')+_0x500d93);var _0x460ac1=_0x5165b9[_0x3d8b('0x3a')][_0x3d8b('0x1d')]?0x1f4:_0x500d93[_0x3d8b('0x7d')]||0x1f4;logger[_0x3d8b('0x23')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x460ac1,JSON[_0x3d8b('0x7e')](_0x500d93));delete _0x500d93[_0x3d8b('0x35')];if(_0x460ac1===0x191){_0x460ac1=0x190;}_0x458dd1['status'](_0x460ac1)[_0x3d8b('0x7f')](_0x5165b9[_0x3d8b('0x3a')][_0x3d8b('0x1d')]?{'message':'Wrong\x20credentials','statusCode':_0x500d93[_0x3d8b('0x7d')]}:_0x500d93);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 140ffa0..afdc205 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.model.js +++ b/server/api/intVtigerAccount/intVtigerAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb074=['bluebird','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x33aa18,_0x493fe5){var _0x29e1f2=function(_0x452908){while(--_0x452908){_0x33aa18['push'](_0x33aa18['shift']());}};_0x29e1f2(++_0x493fe5);}(_0xb074,0x87));var _0x4b07=function(_0x4b98e1,_0x205a7b){_0x4b98e1=_0x4b98e1-0x0;var _0x5de964=_0xb074[_0x4b98e1];return _0x5de964;};'use strict';var _=require(_0x4b07('0x0'));var util=require(_0x4b07('0x1'));var logger=require(_0x4b07('0x2'))(_0x4b07('0x3'));var moment=require(_0x4b07('0x4'));var BPromise=require(_0x4b07('0x5'));var rp=require(_0x4b07('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b07('0x7'));var config=require(_0x4b07('0x8'));var attributes=require(_0x4b07('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x4b07('0xa')]=function(_0x36e1af,_0x131673){return _0x36e1af[_0x4b07('0xb')](_0x4b07('0xc'),attributes,{'tableName':_0x4b07('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e2b=['int_vtiger_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount'];(function(_0x53db92,_0x17df9c){var _0x53c621=function(_0x47ecb1){while(--_0x47ecb1){_0x53db92['push'](_0x53db92['shift']());}};_0x53c621(++_0x17df9c);}(_0x4e2b,0x9d));var _0xb4e2=function(_0x1279b8,_0x1532bd){_0x1279b8=_0x1279b8-0x0;var _0x53f686=_0x4e2b[_0x1279b8];return _0x53f686;};'use strict';var _=require(_0xb4e2('0x0'));var util=require(_0xb4e2('0x1'));var logger=require(_0xb4e2('0x2'))(_0xb4e2('0x3'));var moment=require('moment');var BPromise=require(_0xb4e2('0x4'));var rp=require(_0xb4e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4e2('0x6'));var config=require('../../config/environment');var attributes=require(_0xb4e2('0x7'));var integrations=require(_0xb4e2('0x8'));module[_0xb4e2('0x9')]=function(_0x4aadcd,_0x448397){return _0x4aadcd[_0xb4e2('0xa')](_0xb4e2('0xb'),attributes,{'tableName':_0xb4e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 0710330..079f138 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js +++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13ba=['findAll','options','raw','where','attributes','limit','include','map','model','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetVtigerAccount','VtigerAccount'];(function(_0x1904d5,_0x3c9b12){var _0x83368e=function(_0x568fdd){while(--_0x568fdd){_0x1904d5['push'](_0x1904d5['shift']());}};_0x83368e(++_0x3c9b12);}(_0x13ba,0x1a2));var _0xa13b=function(_0x9efe0,_0x1e7272){_0x9efe0=_0x9efe0-0x0;var _0x232a0f=_0x13ba[_0x9efe0];return _0x232a0f;};'use strict';var _=require(_0xa13b('0x0'));var util=require(_0xa13b('0x1'));var moment=require(_0xa13b('0x2'));var BPromise=require(_0xa13b('0x3'));var rs=require(_0xa13b('0x4'));var fs=require('fs');var Redis=require(_0xa13b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa13b('0x6'));var logger=require('../../config/logger')(_0xa13b('0x7'));var config=require(_0xa13b('0x8'));var jayson=require(_0xa13b('0x9'));var client=jayson['client'][_0xa13b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10d1ff,_0x8d4e39,_0x56dc6c){return new BPromise(function(_0x1dc7d5,_0x4efca5){return client[_0xa13b('0xb')](_0x10d1ff,_0x56dc6c)[_0xa13b('0xc')](function(_0x4451b5){logger[_0xa13b('0xd')](_0xa13b('0xe'),_0x8d4e39,_0xa13b('0xf'));logger[_0xa13b('0x10')](_0xa13b('0x11'),_0x8d4e39,_0xa13b('0xf'),JSON[_0xa13b('0x12')](_0x4451b5));if(_0x4451b5['error']){if(_0x4451b5['error'][_0xa13b('0x13')]===0x1f4){logger[_0xa13b('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x8d4e39,_0x4451b5[_0xa13b('0x14')]['message']);return _0x4efca5(_0x4451b5[_0xa13b('0x14')][_0xa13b('0x15')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x8d4e39,_0x4451b5[_0xa13b('0x14')][_0xa13b('0x15')]);return _0x1dc7d5(_0x4451b5[_0xa13b('0x14')][_0xa13b('0x15')]);}else{logger[_0xa13b('0xd')](_0xa13b('0xe'),_0x8d4e39,_0xa13b('0xf'));_0x1dc7d5(_0x4451b5[_0xa13b('0x16')][_0xa13b('0x15')]);}})[_0xa13b('0x17')](function(_0x39a6a3){logger[_0xa13b('0x14')](_0xa13b('0xe'),_0x8d4e39,_0x39a6a3);_0x4efca5(_0x39a6a3);});});}exports[_0xa13b('0x18')]=function(_0x218b2c){var _0x41fed7=this;return new Promise(function(_0x3bfdee,_0x2292ca){return db[_0xa13b('0x19')][_0xa13b('0x1a')]({'raw':_0x218b2c[_0xa13b('0x1b')]?_0x218b2c['options'][_0xa13b('0x1c')]===undefined?!![]:![]:!![],'where':_0x218b2c[_0xa13b('0x1b')]?_0x218b2c[_0xa13b('0x1b')][_0xa13b('0x1d')]||null:null,'attributes':_0x218b2c[_0xa13b('0x1b')]?_0x218b2c[_0xa13b('0x1b')][_0xa13b('0x1e')]||null:null,'limit':_0x218b2c['options']?_0x218b2c['options'][_0xa13b('0x1f')]||null:null,'include':_0x218b2c['options']?_0x218b2c['options'][_0xa13b('0x20')]?_[_0xa13b('0x21')](_0x218b2c[_0xa13b('0x1b')][_0xa13b('0x20')],function(_0x1a19e3){return{'model':db[_0x1a19e3[_0xa13b('0x22')]],'as':_0x1a19e3['as'],'attributes':_0x1a19e3[_0xa13b('0x1e')],'include':_0x1a19e3[_0xa13b('0x20')]?_[_0xa13b('0x21')](_0x1a19e3[_0xa13b('0x20')],function(_0x2798af){return{'model':db[_0x2798af[_0xa13b('0x22')]],'as':_0x2798af['as'],'attributes':_0x2798af['attributes'],'include':_0x2798af[_0xa13b('0x20')]?_[_0xa13b('0x21')](_0x2798af[_0xa13b('0x20')],function(_0x2144c6){return{'model':db[_0x2144c6[_0xa13b('0x22')]],'as':_0x2144c6['as'],'attributes':_0x2144c6['attributes']};}):[]};}):[]};}):[]:[]})[_0xa13b('0xc')](function(_0x15a169){logger[_0xa13b('0xd')](_0xa13b('0x18'),_0x218b2c);logger[_0xa13b('0x10')](_0xa13b('0x18'),_0x218b2c,JSON[_0xa13b('0x12')](_0x15a169));_0x3bfdee(_0x15a169);})[_0xa13b('0x17')](function(_0x354935){logger['error'](_0xa13b('0x18'),_0x354935['message'],_0x218b2c);_0x2292ca(_0x41fed7[_0xa13b('0x14')](0x1f4,_0x354935[_0xa13b('0x15')]));});});};exports[_0xa13b('0x23')]=function(_0x2a0b45){var _0xbf80e7=this;return new Promise(function(_0x12348c,_0x2ce17d){return db[_0xa13b('0x19')][_0xa13b('0x24')]({'raw':_0x2a0b45['options']?_0x2a0b45[_0xa13b('0x1b')][_0xa13b('0x1c')]===undefined?!![]:![]:!![],'where':_0x2a0b45[_0xa13b('0x1b')]?_0x2a0b45[_0xa13b('0x1b')][_0xa13b('0x1d')]||null:null,'attributes':_0x2a0b45[_0xa13b('0x1b')]?_0x2a0b45[_0xa13b('0x1b')][_0xa13b('0x1e')]||null:null,'include':_0x2a0b45['options']?_0x2a0b45[_0xa13b('0x1b')][_0xa13b('0x20')]?_[_0xa13b('0x21')](_0x2a0b45[_0xa13b('0x1b')][_0xa13b('0x20')],function(_0x32a417){return{'model':db[_0x32a417[_0xa13b('0x22')]],'as':_0x32a417['as'],'attributes':_0x32a417[_0xa13b('0x1e')],'include':_0x32a417['include']?_[_0xa13b('0x21')](_0x32a417['include'],function(_0x3100c6){return{'model':db[_0x3100c6[_0xa13b('0x22')]],'as':_0x3100c6['as'],'attributes':_0x3100c6[_0xa13b('0x1e')],'include':_0x3100c6[_0xa13b('0x20')]?_[_0xa13b('0x21')](_0x3100c6[_0xa13b('0x20')],function(_0x3ac80e){return{'model':db[_0x3ac80e[_0xa13b('0x22')]],'as':_0x3ac80e['as'],'attributes':_0x3ac80e[_0xa13b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa13b('0xc')](function(_0x308fb5){logger[_0xa13b('0xd')]('ShowVtigerAccount',_0x2a0b45);logger[_0xa13b('0x10')](_0xa13b('0x23'),_0x2a0b45,JSON[_0xa13b('0x12')](_0x308fb5));_0x12348c(_0x308fb5);})[_0xa13b('0x17')](function(_0x8670b7){logger[_0xa13b('0x14')](_0xa13b('0x23'),_0x8670b7[_0xa13b('0x15')],_0x2a0b45);_0x2ce17d(_0xbf80e7['error'](0x1f4,_0x8670b7[_0xa13b('0x15')]));});});}; \ No newline at end of file +var _0xec57=['client','request','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetVtigerAccount','options','raw','attributes','limit','include','map','model','then','debug','ShowVtigerAccount','VtigerAccount','find','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x519052,_0x568ce1){var _0x12fccb=function(_0x55f45e){while(--_0x55f45e){_0x519052['push'](_0x519052['shift']());}};_0x12fccb(++_0x568ce1);}(_0xec57,0x130));var _0x7ec5=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0xec57[_0x5b7788];return _0x573871;};'use strict';var _=require(_0x7ec5('0x0'));var util=require(_0x7ec5('0x1'));var moment=require('moment');var BPromise=require(_0x7ec5('0x2'));var rs=require(_0x7ec5('0x3'));var fs=require('fs');var Redis=require(_0x7ec5('0x4'));var db=require(_0x7ec5('0x5'))['db'];var utils=require(_0x7ec5('0x6'));var logger=require(_0x7ec5('0x7'))(_0x7ec5('0x8'));var config=require(_0x7ec5('0x9'));var jayson=require(_0x7ec5('0xa'));var client=jayson[_0x7ec5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53755a,_0x3ca397,_0x125f9b){return new BPromise(function(_0x1075fa,_0x53c2b6){return client[_0x7ec5('0xc')](_0x53755a,_0x125f9b)['then'](function(_0x3cebae){logger[_0x7ec5('0xd')](_0x7ec5('0xe'),_0x3ca397,'request\x20sent');logger['debug'](_0x7ec5('0xf'),_0x3ca397,_0x7ec5('0x10'),JSON['stringify'](_0x3cebae));if(_0x3cebae[_0x7ec5('0x11')]){if(_0x3cebae['error']['code']===0x1f4){logger[_0x7ec5('0x11')](_0x7ec5('0xe'),_0x3ca397,_0x3cebae[_0x7ec5('0x11')][_0x7ec5('0x12')]);return _0x53c2b6(_0x3cebae['error'][_0x7ec5('0x12')]);}logger[_0x7ec5('0x11')](_0x7ec5('0xe'),_0x3ca397,_0x3cebae[_0x7ec5('0x11')][_0x7ec5('0x12')]);return _0x1075fa(_0x3cebae['error']['message']);}else{logger[_0x7ec5('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x3ca397,_0x7ec5('0x10'));_0x1075fa(_0x3cebae[_0x7ec5('0x13')]['message']);}})[_0x7ec5('0x14')](function(_0x3659cf){logger[_0x7ec5('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x3ca397,_0x3659cf);_0x53c2b6(_0x3659cf);});});}exports[_0x7ec5('0x15')]=function(_0x37896c){var _0x2240c7=this;return new Promise(function(_0x516722,_0x14d94d){return db['VtigerAccount']['findAll']({'raw':_0x37896c[_0x7ec5('0x16')]?_0x37896c['options'][_0x7ec5('0x17')]===undefined?!![]:![]:!![],'where':_0x37896c[_0x7ec5('0x16')]?_0x37896c[_0x7ec5('0x16')]['where']||null:null,'attributes':_0x37896c['options']?_0x37896c['options'][_0x7ec5('0x18')]||null:null,'limit':_0x37896c[_0x7ec5('0x16')]?_0x37896c[_0x7ec5('0x16')][_0x7ec5('0x19')]||null:null,'include':_0x37896c['options']?_0x37896c[_0x7ec5('0x16')][_0x7ec5('0x1a')]?_[_0x7ec5('0x1b')](_0x37896c[_0x7ec5('0x16')]['include'],function(_0x17c7ce){return{'model':db[_0x17c7ce['model']],'as':_0x17c7ce['as'],'attributes':_0x17c7ce[_0x7ec5('0x18')],'include':_0x17c7ce[_0x7ec5('0x1a')]?_[_0x7ec5('0x1b')](_0x17c7ce[_0x7ec5('0x1a')],function(_0x2dcfbb){return{'model':db[_0x2dcfbb[_0x7ec5('0x1c')]],'as':_0x2dcfbb['as'],'attributes':_0x2dcfbb[_0x7ec5('0x18')],'include':_0x2dcfbb[_0x7ec5('0x1a')]?_[_0x7ec5('0x1b')](_0x2dcfbb[_0x7ec5('0x1a')],function(_0x16b1e6){return{'model':db[_0x16b1e6[_0x7ec5('0x1c')]],'as':_0x16b1e6['as'],'attributes':_0x16b1e6[_0x7ec5('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7ec5('0x1d')](function(_0x86eb6f){logger[_0x7ec5('0xd')](_0x7ec5('0x15'),_0x37896c);logger[_0x7ec5('0x1e')](_0x7ec5('0x15'),_0x37896c,JSON['stringify'](_0x86eb6f));_0x516722(_0x86eb6f);})[_0x7ec5('0x14')](function(_0x5eba67){logger['error'](_0x7ec5('0x15'),_0x5eba67[_0x7ec5('0x12')],_0x37896c);_0x14d94d(_0x2240c7[_0x7ec5('0x11')](0x1f4,_0x5eba67['message']));});});};exports[_0x7ec5('0x1f')]=function(_0x2d4354){var _0x5a9364=this;return new Promise(function(_0x17ac5b,_0x2f4518){return db[_0x7ec5('0x20')][_0x7ec5('0x21')]({'raw':_0x2d4354[_0x7ec5('0x16')]?_0x2d4354[_0x7ec5('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2d4354['options']?_0x2d4354['options']['where']||null:null,'attributes':_0x2d4354['options']?_0x2d4354['options'][_0x7ec5('0x18')]||null:null,'include':_0x2d4354[_0x7ec5('0x16')]?_0x2d4354[_0x7ec5('0x16')][_0x7ec5('0x1a')]?_['map'](_0x2d4354[_0x7ec5('0x16')][_0x7ec5('0x1a')],function(_0x193956){return{'model':db[_0x193956[_0x7ec5('0x1c')]],'as':_0x193956['as'],'attributes':_0x193956[_0x7ec5('0x18')],'include':_0x193956['include']?_['map'](_0x193956[_0x7ec5('0x1a')],function(_0x4879fe){return{'model':db[_0x4879fe[_0x7ec5('0x1c')]],'as':_0x4879fe['as'],'attributes':_0x4879fe[_0x7ec5('0x18')],'include':_0x4879fe[_0x7ec5('0x1a')]?_[_0x7ec5('0x1b')](_0x4879fe[_0x7ec5('0x1a')],function(_0x530e8f){return{'model':db[_0x530e8f['model']],'as':_0x530e8f['as'],'attributes':_0x530e8f[_0x7ec5('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7ec5('0x1d')](function(_0x47e2ed){logger[_0x7ec5('0xd')](_0x7ec5('0x1f'),_0x2d4354);logger[_0x7ec5('0x1e')](_0x7ec5('0x1f'),_0x2d4354,JSON[_0x7ec5('0x22')](_0x47e2ed));_0x17ac5b(_0x47e2ed);})[_0x7ec5('0x14')](function(_0x4677ce){logger[_0x7ec5('0x11')](_0x7ec5('0x1f'),_0x4677ce[_0x7ec5('0x12')],_0x2d4354);_0x2f4518(_0x5a9364[_0x7ec5('0x11')](0x1f4,_0x4677ce['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 227f652..8c39089 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x500fca,_0x9c772f){var _0x1e1aeb=function(_0xc8ea28){while(--_0xc8ea28){_0x500fca['push'](_0x500fca['shift']());}};_0x1e1aeb(++_0x9c772f);}(_0xb10b,0x12a));var _0xbb10=function(_0x16e5b3,_0x30d91d){_0x16e5b3=_0x16e5b3-0x0;var _0x4d6874=_0xb10b[_0x16e5b3];return _0x4d6874;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file +var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getDescriptions','post','create'];(function(_0x270dbb,_0x13de5d){var _0x4f98fe=function(_0xda5b95){while(--_0xda5b95){_0x270dbb['push'](_0x270dbb['shift']());}};_0x4f98fe(++_0x13de5d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1df9f4,_0x27c693){_0x1df9f4=_0x1df9f4-0x0;var _0x29f9c5=_0x5f2f[_0x1df9f4];return _0x29f9c5;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['getFields']);router[_0xf5f2('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['getSubjects']);router[_0xf5f2('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0xf')]('/',auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router[_0xf5f2('0x11')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index dcc2b63..f0c26cd 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x616f=['STRING'];(function(_0x55c484,_0x44b6ef){var _0x5f1b71=function(_0x524293){while(--_0x524293){_0x55c484['push'](_0x55c484['shift']());}};_0x5f1b71(++_0x44b6ef);}(_0x616f,0x186));var _0xf616=function(_0x326c47,_0x8dca2){_0x326c47=_0x326c47-0x0;var _0x564786=_0x616f[_0x326c47];return _0x564786;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf616('0x0')]}}; \ No newline at end of file +var _0x1f43=['STRING','sequelize'];(function(_0x536068,_0x3de52c){var _0x4a5db2=function(_0x1a8091){while(--_0x1a8091){_0x536068['push'](_0x536068['shift']());}};_0x4a5db2(++_0x3de52c);}(_0x1f43,0x145));var _0x31f4=function(_0x3d1cf4,_0x20b00f){_0x3d1cf4=_0x3d1cf4-0x0;var _0x5bfdf4=_0x1f43[_0x3d1cf4];return _0x5bfdf4;};'use strict';var Sequelize=require(_0x31f4('0x0'));module['exports']={'name':{'type':Sequelize[_0x31f4('0x1')]},'description':{'type':Sequelize[_0x31f4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 23ee936..e5d8c11 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd7b=['set','Content-Range','save','update','destroy','stack','send','index','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','type','key','VIRTUAL','merge','VtigerConfiguration','include','rows','catch','includeAll','options','find','create','body','params','getFields','VtigerField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','count','offset','limit'];(function(_0xfe2e93,_0x9eceee){var _0x259227=function(_0x38d8bd){while(--_0x38d8bd){_0xfe2e93['push'](_0xfe2e93['shift']());}};_0x259227(++_0x9eceee);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xfd7b[_0x2555d0];return _0x3bb486;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbfd7('0x0'));var rimraf=require(_0xbfd7('0x1'));var zipdir=require(_0xbfd7('0x2'));var jsonpatch=require(_0xbfd7('0x3'));var rp=require(_0xbfd7('0x4'));var moment=require(_0xbfd7('0x5'));var BPromise=require(_0xbfd7('0x6'));var Mustache=require(_0xbfd7('0x7'));var util=require(_0xbfd7('0x8'));var path=require(_0xbfd7('0x9'));var sox=require(_0xbfd7('0xa'));var csv=require(_0xbfd7('0xb'));var ejs=require(_0xbfd7('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbfd7('0xd'));var crypto=require('crypto');var jsforce=require(_0xbfd7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbfd7('0xb'));var querystring=require(_0xbfd7('0xf'));var Papa=require(_0xbfd7('0x10'));var Redis=require(_0xbfd7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbfd7('0x12'));var hardwareService=require(_0xbfd7('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xbfd7('0x14'));var config=require(_0xbfd7('0x15'));var db=require(_0xbfd7('0x16'))['db'];var jayson=require(_0xbfd7('0x17'));var client=jayson[_0xbfd7('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x46feae,_0x534d66,_0x28566c){if(_0x28566c){var _0x4e9bd7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4e9bd7['test'](_0x534d66)){return _0x46feae;}else{throw new Error(_0xbfd7('0x19'));}}else{return _0x46feae;}}function respondWithRpcPromise(_0x4fec16,_0x3789b7,_0x371592,_0x5abca0){return new BPromise(function(_0x5efd54,_0x48f4a4){var _0x37e777=_0x5abca0||client;return _0x37e777[_0xbfd7('0x1a')](_0x4fec16,_0x371592)[_0xbfd7('0x1b')](function(_0x3e8754){logger[_0xbfd7('0x1c')](_0xbfd7('0x1d'),_0x3789b7,_0xbfd7('0x1e'));logger[_0xbfd7('0x1f')](_0xbfd7('0x20'),_0x3789b7,'request\x20sent',JSON['stringify'](_0x3e8754));if(_0x3e8754[_0xbfd7('0x21')]){if(_0x3e8754[_0xbfd7('0x21')]['code']===0x1f4){logger['error'](_0xbfd7('0x1d'),_0x3789b7,_0x3e8754['error']['message']);return _0x48f4a4(_0x3e8754[_0xbfd7('0x21')]['message']);}logger[_0xbfd7('0x21')](_0xbfd7('0x1d'),_0x3789b7,_0x3e8754[_0xbfd7('0x21')][_0xbfd7('0x22')]);return _0x5efd54(_0x3e8754['error'][_0xbfd7('0x22')]);}else{logger[_0xbfd7('0x1c')](_0xbfd7('0x1d'),_0x3789b7,_0xbfd7('0x1e'));_0x5efd54(_0x3e8754[_0xbfd7('0x23')][_0xbfd7('0x22')]);}})['catch'](function(_0x2402fb){logger[_0xbfd7('0x21')](_0xbfd7('0x1d'),_0x3789b7,_0x2402fb);_0x48f4a4(_0x2402fb);});});}function respondWithStatusCode(_0x5c920e,_0x301b51){_0x301b51=_0x301b51||0xcc;return function(_0x2ca62a){if(_0x2ca62a){return _0x5c920e[_0xbfd7('0x24')](_0x301b51);}return _0x5c920e[_0xbfd7('0x25')](_0x301b51)[_0xbfd7('0x26')]();};}function respondWithResult(_0x585e60,_0x2a7749){_0x2a7749=_0x2a7749||0xc8;return function(_0x6ef5aa){if(_0x6ef5aa){return _0x585e60[_0xbfd7('0x25')](_0x2a7749)[_0xbfd7('0x27')](_0x6ef5aa);}};}function respondWithFilteredResult(_0x37ade5,_0x303060){return function(_0x378428){if(_0x378428){var _0x55b2c8=_0x378428[_0xbfd7('0x28')],_0x164383=_0x303060[_0xbfd7('0x29')],_0x2f83a0=_0x303060[_0xbfd7('0x29')]+_0x303060[_0xbfd7('0x2a')],_0x4d7ef4;if(_0x2f83a0>=_0x55b2c8){_0x2f83a0=_0x55b2c8;_0x4d7ef4=0xc8;}else{_0x4d7ef4=0xce;}_0x37ade5['status'](_0x4d7ef4);return _0x37ade5[_0xbfd7('0x2b')](_0xbfd7('0x2c'),_0x164383+'-'+_0x2f83a0+'/'+_0x55b2c8)[_0xbfd7('0x27')](_0x378428);}return null;};}function patchUpdates(_0x489365){return function(_0xd5c121){try{jsonpatch['apply'](_0xd5c121,_0x489365,!![]);}catch(_0x108f65){return BPromise['reject'](_0x108f65);}return _0xd5c121[_0xbfd7('0x2d')]();};}function saveUpdates(_0x1804a5,_0x532c5f){return function(_0x57d919){if(_0x57d919){return _0x57d919[_0xbfd7('0x2e')](_0x1804a5)['then'](function(_0x2e7111){return _0x2e7111;});}return null;};}function removeEntity(_0x40fef6,_0x990abe){return function(_0x5d08fe){if(_0x5d08fe){return _0x5d08fe[_0xbfd7('0x2f')]()[_0xbfd7('0x1b')](function(){_0x40fef6[_0xbfd7('0x25')](0xcc)[_0xbfd7('0x26')]();});}};}function handleEntityNotFound(_0x20fc00,_0x3af799){return function(_0x11e58b){if(!_0x11e58b){_0x20fc00[_0xbfd7('0x24')](0x194);}return _0x11e58b;};}function handleError(_0x418994,_0x14b17){_0x14b17=_0x14b17||0x1f4;return function(_0x26802b){logger['error'](_0x26802b[_0xbfd7('0x30')]);if(_0x26802b['name']){delete _0x26802b['name'];}_0x418994[_0xbfd7('0x25')](_0x14b17)[_0xbfd7('0x31')](_0x26802b);};}exports[_0xbfd7('0x32')]=function(_0x6d440c,_0xc51f8b){var _0x403bf5={},_0x25d050={},_0x373c4a={'count':0x0,'rows':[]};var _0x5d4928=db['VtigerConfiguration'][_0xbfd7('0x33')];_0x25d050[_0xbfd7('0x34')]=_['keys'](_0x5d4928);_0x25d050[_0xbfd7('0x35')]=_[_0xbfd7('0x36')](_0x6d440c['query']);_0x25d050['filters']=_[_0xbfd7('0x37')](_0x25d050[_0xbfd7('0x34')],_0x25d050['query']);_0x403bf5[_0xbfd7('0x38')]=_[_0xbfd7('0x37')](_0x25d050[_0xbfd7('0x34')],qs[_0xbfd7('0x39')](_0x6d440c[_0xbfd7('0x35')]['fields']));_0x403bf5[_0xbfd7('0x38')]=_0x403bf5[_0xbfd7('0x38')][_0xbfd7('0x3a')]?_0x403bf5[_0xbfd7('0x38')]:_0x25d050[_0xbfd7('0x34')];if(!_0x6d440c[_0xbfd7('0x35')][_0xbfd7('0x3b')](_0xbfd7('0x3c'))){_0x403bf5['limit']=qs[_0xbfd7('0x2a')](_0x6d440c['query']['limit']);_0x403bf5[_0xbfd7('0x29')]=qs[_0xbfd7('0x29')](_0x6d440c[_0xbfd7('0x35')][_0xbfd7('0x29')]);}_0x403bf5[_0xbfd7('0x3d')]=qs[_0xbfd7('0x3e')](_0x6d440c['query'][_0xbfd7('0x3e')]);_0x403bf5['where']=qs[_0xbfd7('0x3f')](_[_0xbfd7('0x40')](_0x6d440c[_0xbfd7('0x35')],_0x25d050[_0xbfd7('0x3f')]));if(_0x6d440c[_0xbfd7('0x35')][_0xbfd7('0x41')]){_0x403bf5[_0xbfd7('0x42')]=_['merge'](_0x403bf5[_0xbfd7('0x42')],{'$or':_[_0xbfd7('0x43')](_0x5d4928,function(_0x160ea6){if(_0x160ea6[_0xbfd7('0x44')][_0xbfd7('0x45')]!==_0xbfd7('0x46')){var _0xa76c58={};_0xa76c58[_0x160ea6['field']]={'$like':'%'+_0x6d440c[_0xbfd7('0x35')][_0xbfd7('0x41')]+'%'};return _0xa76c58;}})});}_0x403bf5=_[_0xbfd7('0x47')]({},_0x403bf5,_0x6d440c['options']);var _0x5ba1ff={'where':_0x403bf5['where']};return db[_0xbfd7('0x48')][_0xbfd7('0x28')](_0x5ba1ff)[_0xbfd7('0x1b')](function(_0x14a30b){_0x373c4a['count']=_0x14a30b;if(_0x6d440c[_0xbfd7('0x35')]['includeAll']){_0x403bf5[_0xbfd7('0x49')]=[{'all':!![]}];}return db[_0xbfd7('0x48')]['findAll'](_0x403bf5);})[_0xbfd7('0x1b')](function(_0x4cbb49){_0x373c4a[_0xbfd7('0x4a')]=_0x4cbb49;return _0x373c4a;})[_0xbfd7('0x1b')](respondWithFilteredResult(_0xc51f8b,_0x403bf5))[_0xbfd7('0x4b')](handleError(_0xc51f8b,null));};exports['show']=function(_0x47d774,_0x356f58){var _0xb8b319={'raw':![],'where':{'id':_0x47d774['params']['id']}},_0x4d700e={};_0x4d700e[_0xbfd7('0x34')]=_[_0xbfd7('0x36')](db[_0xbfd7('0x48')][_0xbfd7('0x33')]);_0x4d700e[_0xbfd7('0x35')]=_[_0xbfd7('0x36')](_0x47d774[_0xbfd7('0x35')]);_0x4d700e['filters']=_['intersection'](_0x4d700e['model'],_0x4d700e[_0xbfd7('0x35')]);_0xb8b319[_0xbfd7('0x38')]=_[_0xbfd7('0x37')](_0x4d700e['model'],qs[_0xbfd7('0x39')](_0x47d774[_0xbfd7('0x35')]['fields']));_0xb8b319['attributes']=_0xb8b319[_0xbfd7('0x38')][_0xbfd7('0x3a')]?_0xb8b319[_0xbfd7('0x38')]:_0x4d700e['model'];if(_0x47d774[_0xbfd7('0x35')][_0xbfd7('0x4c')]){_0xb8b319[_0xbfd7('0x49')]=[{'all':!![]}];}_0xb8b319=_['merge']({},_0xb8b319,_0x47d774[_0xbfd7('0x4d')]);return db[_0xbfd7('0x48')][_0xbfd7('0x4e')](_0xb8b319)[_0xbfd7('0x1b')](handleEntityNotFound(_0x356f58,null))['then'](respondWithResult(_0x356f58,null))[_0xbfd7('0x4b')](handleError(_0x356f58,null));};exports[_0xbfd7('0x4f')]=function(_0x11388e,_0x5b2caa){return db[_0xbfd7('0x48')]['create'](_0x11388e[_0xbfd7('0x50')],{})[_0xbfd7('0x1b')](respondWithResult(_0x5b2caa,0xc9))[_0xbfd7('0x4b')](handleError(_0x5b2caa,null));};exports[_0xbfd7('0x2e')]=function(_0x56d96c,_0x3bce53){if(_0x56d96c[_0xbfd7('0x50')]['id']){delete _0x56d96c[_0xbfd7('0x50')]['id'];}return db[_0xbfd7('0x48')][_0xbfd7('0x4e')]({'where':{'id':_0x56d96c[_0xbfd7('0x51')]['id']}})[_0xbfd7('0x1b')](handleEntityNotFound(_0x3bce53,null))[_0xbfd7('0x1b')](saveUpdates(_0x56d96c[_0xbfd7('0x50')],null))[_0xbfd7('0x1b')](respondWithResult(_0x3bce53,null))[_0xbfd7('0x4b')](handleError(_0x3bce53,null));};exports[_0xbfd7('0x2f')]=function(_0x1732f9,_0x27d33b){return db['VtigerConfiguration']['find']({'where':{'id':_0x1732f9[_0xbfd7('0x51')]['id']}})[_0xbfd7('0x1b')](handleEntityNotFound(_0x27d33b,null))[_0xbfd7('0x1b')](removeEntity(_0x27d33b,null))[_0xbfd7('0x4b')](handleError(_0x27d33b,null));};exports[_0xbfd7('0x52')]=function(_0x3245d8,_0x5de3f3,_0x2fd34e){var _0x56f62f={};var _0x5b5ea0={};var _0x583846;var _0x2ce454;return db[_0xbfd7('0x48')]['findOne']({'where':{'id':_0x3245d8[_0xbfd7('0x51')]['id']}})[_0xbfd7('0x1b')](handleEntityNotFound(_0x5de3f3,null))[_0xbfd7('0x1b')](function(_0xdd157a){if(_0xdd157a){_0x583846=_0xdd157a;_0x5b5ea0[_0xbfd7('0x34')]=_[_0xbfd7('0x36')](db[_0xbfd7('0x53')][_0xbfd7('0x33')]);_0x5b5ea0[_0xbfd7('0x35')]=_['keys'](_0x3245d8[_0xbfd7('0x35')]);_0x5b5ea0[_0xbfd7('0x3f')]=_[_0xbfd7('0x37')](_0x5b5ea0['model'],_0x5b5ea0['query']);_0x56f62f[_0xbfd7('0x38')]=_[_0xbfd7('0x37')](_0x5b5ea0[_0xbfd7('0x34')],qs[_0xbfd7('0x39')](_0x3245d8['query'][_0xbfd7('0x39')]));_0x56f62f[_0xbfd7('0x38')]=_0x56f62f[_0xbfd7('0x38')][_0xbfd7('0x3a')]?_0x56f62f[_0xbfd7('0x38')]:_0x5b5ea0[_0xbfd7('0x34')];_0x56f62f[_0xbfd7('0x3d')]=qs[_0xbfd7('0x3e')](_0x3245d8[_0xbfd7('0x35')][_0xbfd7('0x3e')]);_0x56f62f[_0xbfd7('0x42')]=qs[_0xbfd7('0x3f')](_[_0xbfd7('0x40')](_0x3245d8['query'],_0x5b5ea0[_0xbfd7('0x3f')]));if(_0x3245d8[_0xbfd7('0x35')][_0xbfd7('0x41')]){_0x56f62f['where']=_[_0xbfd7('0x47')](_0x56f62f[_0xbfd7('0x42')],{'$or':_[_0xbfd7('0x43')](_0x56f62f[_0xbfd7('0x38')],function(_0x7c5723){var _0x569612={};_0x569612[_0x7c5723]={'$like':'%'+_0x3245d8[_0xbfd7('0x35')][_0xbfd7('0x41')]+'%'};return _0x569612;})});}_0x56f62f=_[_0xbfd7('0x47')]({},_0x56f62f,_0x3245d8[_0xbfd7('0x4d')]);return _0x583846[_0xbfd7('0x52')](_0x56f62f);}})[_0xbfd7('0x1b')](function(_0x35b346){if(_0x35b346){_0x2ce454=_0x35b346[_0xbfd7('0x3a')];if(!_0x3245d8[_0xbfd7('0x35')][_0xbfd7('0x3b')](_0xbfd7('0x3c'))){_0x56f62f[_0xbfd7('0x2a')]=qs['limit'](_0x3245d8['query'][_0xbfd7('0x2a')]);_0x56f62f[_0xbfd7('0x29')]=qs[_0xbfd7('0x29')](_0x3245d8[_0xbfd7('0x35')]['offset']);}return _0x583846['getFields'](_0x56f62f);}})[_0xbfd7('0x1b')](function(_0x127fcd){if(_0x127fcd){return _0x127fcd?{'count':_0x2ce454,'rows':_0x127fcd}:null;}})['then'](respondWithResult(_0x5de3f3,null))[_0xbfd7('0x4b')](handleError(_0x5de3f3,null));};exports[_0xbfd7('0x54')]=function(_0x4c1670,_0x3ca88c,_0x29c568){var _0x11cf3b={};var _0x5ad203={};var _0x93f60;var _0x57473b;return db[_0xbfd7('0x48')][_0xbfd7('0x55')]({'where':{'id':_0x4c1670[_0xbfd7('0x51')]['id']}})[_0xbfd7('0x1b')](handleEntityNotFound(_0x3ca88c,null))[_0xbfd7('0x1b')](function(_0x12b55c){if(_0x12b55c){_0x93f60=_0x12b55c;_0x5ad203[_0xbfd7('0x34')]=_[_0xbfd7('0x36')](db[_0xbfd7('0x53')]['rawAttributes']);_0x5ad203[_0xbfd7('0x35')]=_[_0xbfd7('0x36')](_0x4c1670[_0xbfd7('0x35')]);_0x5ad203[_0xbfd7('0x3f')]=_[_0xbfd7('0x37')](_0x5ad203[_0xbfd7('0x34')],_0x5ad203[_0xbfd7('0x35')]);_0x11cf3b[_0xbfd7('0x38')]=_['intersection'](_0x5ad203[_0xbfd7('0x34')],qs[_0xbfd7('0x39')](_0x4c1670['query']['fields']));_0x11cf3b[_0xbfd7('0x38')]=_0x11cf3b[_0xbfd7('0x38')][_0xbfd7('0x3a')]?_0x11cf3b[_0xbfd7('0x38')]:_0x5ad203[_0xbfd7('0x34')];_0x11cf3b[_0xbfd7('0x3d')]=qs[_0xbfd7('0x3e')](_0x4c1670[_0xbfd7('0x35')]['sort']);_0x11cf3b[_0xbfd7('0x42')]=qs[_0xbfd7('0x3f')](_[_0xbfd7('0x40')](_0x4c1670[_0xbfd7('0x35')],_0x5ad203[_0xbfd7('0x3f')]));if(_0x4c1670['query'][_0xbfd7('0x41')]){_0x11cf3b['where']=_['merge'](_0x11cf3b[_0xbfd7('0x42')],{'$or':_[_0xbfd7('0x43')](_0x11cf3b[_0xbfd7('0x38')],function(_0x27ee52){var _0x4d4d34={};_0x4d4d34[_0x27ee52]={'$like':'%'+_0x4c1670[_0xbfd7('0x35')][_0xbfd7('0x41')]+'%'};return _0x4d4d34;})});}_0x11cf3b=_[_0xbfd7('0x47')]({},_0x11cf3b,_0x4c1670[_0xbfd7('0x4d')]);return _0x93f60[_0xbfd7('0x54')](_0x11cf3b);}})[_0xbfd7('0x1b')](function(_0x17a50e){if(_0x17a50e){_0x57473b=_0x17a50e[_0xbfd7('0x3a')];if(!_0x4c1670[_0xbfd7('0x35')]['hasOwnProperty']('nolimit')){_0x11cf3b[_0xbfd7('0x2a')]=qs[_0xbfd7('0x2a')](_0x4c1670['query'][_0xbfd7('0x2a')]);_0x11cf3b[_0xbfd7('0x29')]=qs[_0xbfd7('0x29')](_0x4c1670[_0xbfd7('0x35')][_0xbfd7('0x29')]);}return _0x93f60[_0xbfd7('0x54')](_0x11cf3b);}})[_0xbfd7('0x1b')](function(_0x3790bb){if(_0x3790bb){return _0x3790bb?{'count':_0x57473b,'rows':_0x3790bb}:null;}})[_0xbfd7('0x1b')](respondWithResult(_0x3ca88c,null))[_0xbfd7('0x4b')](handleError(_0x3ca88c,null));};exports[_0xbfd7('0x56')]=function(_0x10aded,_0x2d3cc,_0x49b4a3){var _0x39ee78={};var _0x1086df={};var _0x1b4d74;var _0x2346b1;return db[_0xbfd7('0x48')][_0xbfd7('0x55')]({'where':{'id':_0x10aded[_0xbfd7('0x51')]['id']}})['then'](handleEntityNotFound(_0x2d3cc,null))[_0xbfd7('0x1b')](function(_0x29143b){if(_0x29143b){_0x1b4d74=_0x29143b;_0x1086df['model']=_[_0xbfd7('0x36')](db[_0xbfd7('0x53')][_0xbfd7('0x33')]);_0x1086df['query']=_[_0xbfd7('0x36')](_0x10aded[_0xbfd7('0x35')]);_0x1086df[_0xbfd7('0x3f')]=_['intersection'](_0x1086df[_0xbfd7('0x34')],_0x1086df[_0xbfd7('0x35')]);_0x39ee78[_0xbfd7('0x38')]=_[_0xbfd7('0x37')](_0x1086df[_0xbfd7('0x34')],qs[_0xbfd7('0x39')](_0x10aded['query'][_0xbfd7('0x39')]));_0x39ee78['attributes']=_0x39ee78[_0xbfd7('0x38')][_0xbfd7('0x3a')]?_0x39ee78['attributes']:_0x1086df[_0xbfd7('0x34')];_0x39ee78[_0xbfd7('0x3d')]=qs[_0xbfd7('0x3e')](_0x10aded[_0xbfd7('0x35')]['sort']);_0x39ee78[_0xbfd7('0x42')]=qs[_0xbfd7('0x3f')](_[_0xbfd7('0x40')](_0x10aded[_0xbfd7('0x35')],_0x1086df['filters']));if(_0x10aded[_0xbfd7('0x35')]['filter']){_0x39ee78[_0xbfd7('0x42')]=_['merge'](_0x39ee78['where'],{'$or':_['map'](_0x39ee78[_0xbfd7('0x38')],function(_0x5131a3){var _0xe3e06={};_0xe3e06[_0x5131a3]={'$like':'%'+_0x10aded[_0xbfd7('0x35')][_0xbfd7('0x41')]+'%'};return _0xe3e06;})});}_0x39ee78=_[_0xbfd7('0x47')]({},_0x39ee78,_0x10aded[_0xbfd7('0x4d')]);return _0x1b4d74[_0xbfd7('0x56')](_0x39ee78);}})[_0xbfd7('0x1b')](function(_0x31a2c7){if(_0x31a2c7){_0x2346b1=_0x31a2c7[_0xbfd7('0x3a')];if(!_0x10aded[_0xbfd7('0x35')][_0xbfd7('0x3b')](_0xbfd7('0x3c'))){_0x39ee78[_0xbfd7('0x2a')]=qs['limit'](_0x10aded['query'][_0xbfd7('0x2a')]);_0x39ee78['offset']=qs['offset'](_0x10aded[_0xbfd7('0x35')][_0xbfd7('0x29')]);}return _0x1b4d74['getDescriptions'](_0x39ee78);}})[_0xbfd7('0x1b')](function(_0x131c4e){if(_0x131c4e){return _0x131c4e?{'count':_0x2346b1,'rows':_0x131c4e}:null;}})[_0xbfd7('0x1b')](respondWithResult(_0x2d3cc,null))[_0xbfd7('0x4b')](handleError(_0x2d3cc,null));}; \ No newline at end of file +var _0x92e0=['squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','client','test','request','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','map','type','VIRTUAL','field','filter','options','includeAll','include','VtigerConfiguration','findAll','rows','catch','show','params','create','body','find','getFields','findOne','VtigerField','hasOwnProperty','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x92e0,0x154));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x092e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x092e('0x1'));var zipdir=require(_0x092e('0x2'));var jsonpatch=require(_0x092e('0x3'));var rp=require(_0x092e('0x4'));var moment=require(_0x092e('0x5'));var BPromise=require(_0x092e('0x6'));var Mustache=require(_0x092e('0x7'));var util=require(_0x092e('0x8'));var path=require(_0x092e('0x9'));var sox=require(_0x092e('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x092e('0xb'));var squel=require(_0x092e('0xc'));var crypto=require(_0x092e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x092e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x092e('0xf'));var Redis=require(_0x092e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x092e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x092e('0x12'));var utils=require('../../config/utils');var config=require(_0x092e('0x13'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x092e('0x14')]['http']({'port':0x232a});function checkPasswordPattern(_0x431fc4,_0x3e9fe0,_0x14b96f){if(_0x14b96f){var _0xcfb407=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xcfb407[_0x092e('0x15')](_0x3e9fe0)){return _0x431fc4;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x431fc4;}}function respondWithRpcPromise(_0x49e9d1,_0x254911,_0xc7e05a,_0x484ce8){return new BPromise(function(_0x311622,_0x26906c){var _0x24507d=_0x484ce8||client;return _0x24507d[_0x092e('0x16')](_0x49e9d1,_0xc7e05a)['then'](function(_0x355124){logger[_0x092e('0x17')](_0x092e('0x18'),_0x254911,'request\x20sent');logger[_0x092e('0x19')](_0x092e('0x1a'),_0x254911,_0x092e('0x1b'),JSON[_0x092e('0x1c')](_0x355124));if(_0x355124[_0x092e('0x1d')]){if(_0x355124['error'][_0x092e('0x1e')]===0x1f4){logger[_0x092e('0x1d')]('VtigerConfiguration,\x20%s,\x20%s',_0x254911,_0x355124[_0x092e('0x1d')]['message']);return _0x26906c(_0x355124[_0x092e('0x1d')]['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x254911,_0x355124[_0x092e('0x1d')][_0x092e('0x1f')]);return _0x311622(_0x355124['error']['message']);}else{logger[_0x092e('0x17')](_0x092e('0x18'),_0x254911,_0x092e('0x1b'));_0x311622(_0x355124[_0x092e('0x20')][_0x092e('0x1f')]);}})['catch'](function(_0x4895cb){logger['error'](_0x092e('0x18'),_0x254911,_0x4895cb);_0x26906c(_0x4895cb);});});}function respondWithStatusCode(_0x251d02,_0x584879){_0x584879=_0x584879||0xcc;return function(_0x1ccdb6){if(_0x1ccdb6){return _0x251d02[_0x092e('0x21')](_0x584879);}return _0x251d02[_0x092e('0x22')](_0x584879)['end']();};}function respondWithResult(_0x3db567,_0x3ba4a6){_0x3ba4a6=_0x3ba4a6||0xc8;return function(_0x3da347){if(_0x3da347){return _0x3db567['status'](_0x3ba4a6)[_0x092e('0x23')](_0x3da347);}};}function respondWithFilteredResult(_0x46073d,_0x155987){return function(_0x3e13d5){if(_0x3e13d5){var _0x5d3880=_0x3e13d5[_0x092e('0x24')],_0x2b5896=_0x155987[_0x092e('0x25')],_0x17061e=_0x155987[_0x092e('0x25')]+_0x155987[_0x092e('0x26')],_0x505add;if(_0x17061e>=_0x5d3880){_0x17061e=_0x5d3880;_0x505add=0xc8;}else{_0x505add=0xce;}_0x46073d[_0x092e('0x22')](_0x505add);return _0x46073d[_0x092e('0x27')](_0x092e('0x28'),_0x2b5896+'-'+_0x17061e+'/'+_0x5d3880)[_0x092e('0x23')](_0x3e13d5);}return null;};}function patchUpdates(_0x5082cb){return function(_0xf5df9d){try{jsonpatch[_0x092e('0x29')](_0xf5df9d,_0x5082cb,!![]);}catch(_0x1b1cba){return BPromise[_0x092e('0x2a')](_0x1b1cba);}return _0xf5df9d[_0x092e('0x2b')]();};}function saveUpdates(_0x2f90a2,_0xd10f61){return function(_0x24be9b){if(_0x24be9b){return _0x24be9b[_0x092e('0x2c')](_0x2f90a2)[_0x092e('0x2d')](function(_0x5f16a9){return _0x5f16a9;});}return null;};}function removeEntity(_0x26dd8e,_0x5a2193){return function(_0xc88cc8){if(_0xc88cc8){return _0xc88cc8[_0x092e('0x2e')]()[_0x092e('0x2d')](function(){_0x26dd8e[_0x092e('0x22')](0xcc)[_0x092e('0x2f')]();});}};}function handleEntityNotFound(_0x35d0dd,_0x1bb1c8){return function(_0x1a8625){if(!_0x1a8625){_0x35d0dd[_0x092e('0x21')](0x194);}return _0x1a8625;};}function handleError(_0x51d05a,_0x5504ad){_0x5504ad=_0x5504ad||0x1f4;return function(_0x31a24c){logger[_0x092e('0x1d')](_0x31a24c['stack']);if(_0x31a24c[_0x092e('0x30')]){delete _0x31a24c[_0x092e('0x30')];}_0x51d05a[_0x092e('0x22')](_0x5504ad)['send'](_0x31a24c);};}exports[_0x092e('0x31')]=function(_0x5e0770,_0x3a8625){var _0x4eec2d={},_0x1488a4={},_0x5ca906={'count':0x0,'rows':[]};var _0xdd1c14=db['VtigerConfiguration'][_0x092e('0x32')];_0x1488a4[_0x092e('0x33')]=_[_0x092e('0x34')](_0xdd1c14);_0x1488a4[_0x092e('0x35')]=_[_0x092e('0x34')](_0x5e0770[_0x092e('0x35')]);_0x1488a4[_0x092e('0x36')]=_[_0x092e('0x37')](_0x1488a4[_0x092e('0x33')],_0x1488a4[_0x092e('0x35')]);_0x4eec2d[_0x092e('0x38')]=_['intersection'](_0x1488a4[_0x092e('0x33')],qs[_0x092e('0x39')](_0x5e0770[_0x092e('0x35')][_0x092e('0x39')]));_0x4eec2d[_0x092e('0x38')]=_0x4eec2d['attributes'][_0x092e('0x3a')]?_0x4eec2d[_0x092e('0x38')]:_0x1488a4['model'];if(!_0x5e0770[_0x092e('0x35')]['hasOwnProperty'](_0x092e('0x3b'))){_0x4eec2d[_0x092e('0x26')]=qs[_0x092e('0x26')](_0x5e0770['query'][_0x092e('0x26')]);_0x4eec2d[_0x092e('0x25')]=qs[_0x092e('0x25')](_0x5e0770['query'][_0x092e('0x25')]);}_0x4eec2d[_0x092e('0x3c')]=qs[_0x092e('0x3d')](_0x5e0770[_0x092e('0x35')][_0x092e('0x3d')]);_0x4eec2d['where']=qs[_0x092e('0x36')](_[_0x092e('0x3e')](_0x5e0770['query'],_0x1488a4[_0x092e('0x36')]));if(_0x5e0770[_0x092e('0x35')]['filter']){_0x4eec2d[_0x092e('0x3f')]=_[_0x092e('0x40')](_0x4eec2d[_0x092e('0x3f')],{'$or':_[_0x092e('0x41')](_0xdd1c14,function(_0x18425c){if(_0x18425c[_0x092e('0x42')]['key']!==_0x092e('0x43')){var _0x4285b3={};_0x4285b3[_0x18425c[_0x092e('0x44')]]={'$like':'%'+_0x5e0770[_0x092e('0x35')][_0x092e('0x45')]+'%'};return _0x4285b3;}})});}_0x4eec2d=_[_0x092e('0x40')]({},_0x4eec2d,_0x5e0770[_0x092e('0x46')]);var _0x12f5fb={'where':_0x4eec2d['where']};return db['VtigerConfiguration']['count'](_0x12f5fb)[_0x092e('0x2d')](function(_0x4bbe70){_0x5ca906[_0x092e('0x24')]=_0x4bbe70;if(_0x5e0770['query'][_0x092e('0x47')]){_0x4eec2d[_0x092e('0x48')]=[{'all':!![]}];}return db[_0x092e('0x49')][_0x092e('0x4a')](_0x4eec2d);})[_0x092e('0x2d')](function(_0x537a47){_0x5ca906[_0x092e('0x4b')]=_0x537a47;return _0x5ca906;})[_0x092e('0x2d')](respondWithFilteredResult(_0x3a8625,_0x4eec2d))[_0x092e('0x4c')](handleError(_0x3a8625,null));};exports[_0x092e('0x4d')]=function(_0x35c4ff,_0x190530){var _0x96b0ee={'raw':![],'where':{'id':_0x35c4ff[_0x092e('0x4e')]['id']}},_0x428fb2={};_0x428fb2[_0x092e('0x33')]=_[_0x092e('0x34')](db['VtigerConfiguration'][_0x092e('0x32')]);_0x428fb2['query']=_[_0x092e('0x34')](_0x35c4ff['query']);_0x428fb2[_0x092e('0x36')]=_[_0x092e('0x37')](_0x428fb2[_0x092e('0x33')],_0x428fb2[_0x092e('0x35')]);_0x96b0ee[_0x092e('0x38')]=_[_0x092e('0x37')](_0x428fb2[_0x092e('0x33')],qs[_0x092e('0x39')](_0x35c4ff[_0x092e('0x35')][_0x092e('0x39')]));_0x96b0ee[_0x092e('0x38')]=_0x96b0ee['attributes'][_0x092e('0x3a')]?_0x96b0ee[_0x092e('0x38')]:_0x428fb2[_0x092e('0x33')];if(_0x35c4ff[_0x092e('0x35')]['includeAll']){_0x96b0ee[_0x092e('0x48')]=[{'all':!![]}];}_0x96b0ee=_[_0x092e('0x40')]({},_0x96b0ee,_0x35c4ff[_0x092e('0x46')]);return db[_0x092e('0x49')]['find'](_0x96b0ee)[_0x092e('0x2d')](handleEntityNotFound(_0x190530,null))[_0x092e('0x2d')](respondWithResult(_0x190530,null))[_0x092e('0x4c')](handleError(_0x190530,null));};exports[_0x092e('0x4f')]=function(_0x31b829,_0x19b420){return db[_0x092e('0x49')][_0x092e('0x4f')](_0x31b829[_0x092e('0x50')],{})[_0x092e('0x2d')](respondWithResult(_0x19b420,0xc9))[_0x092e('0x4c')](handleError(_0x19b420,null));};exports[_0x092e('0x2c')]=function(_0x5f0622,_0x225237){if(_0x5f0622[_0x092e('0x50')]['id']){delete _0x5f0622[_0x092e('0x50')]['id'];}return db[_0x092e('0x49')][_0x092e('0x51')]({'where':{'id':_0x5f0622[_0x092e('0x4e')]['id']}})[_0x092e('0x2d')](handleEntityNotFound(_0x225237,null))[_0x092e('0x2d')](saveUpdates(_0x5f0622[_0x092e('0x50')],null))[_0x092e('0x2d')](respondWithResult(_0x225237,null))['catch'](handleError(_0x225237,null));};exports[_0x092e('0x2e')]=function(_0x331dfb,_0x29e799){return db[_0x092e('0x49')][_0x092e('0x51')]({'where':{'id':_0x331dfb['params']['id']}})[_0x092e('0x2d')](handleEntityNotFound(_0x29e799,null))[_0x092e('0x2d')](removeEntity(_0x29e799,null))[_0x092e('0x4c')](handleError(_0x29e799,null));};exports[_0x092e('0x52')]=function(_0x2988d0,_0xa78536,_0x251f22){var _0x31d6d8={};var _0x3c46d7={};var _0x2ea291;var _0x104202;return db[_0x092e('0x49')][_0x092e('0x53')]({'where':{'id':_0x2988d0[_0x092e('0x4e')]['id']}})[_0x092e('0x2d')](handleEntityNotFound(_0xa78536,null))[_0x092e('0x2d')](function(_0x3e2abe){if(_0x3e2abe){_0x2ea291=_0x3e2abe;_0x3c46d7['model']=_[_0x092e('0x34')](db[_0x092e('0x54')][_0x092e('0x32')]);_0x3c46d7[_0x092e('0x35')]=_[_0x092e('0x34')](_0x2988d0[_0x092e('0x35')]);_0x3c46d7[_0x092e('0x36')]=_[_0x092e('0x37')](_0x3c46d7[_0x092e('0x33')],_0x3c46d7[_0x092e('0x35')]);_0x31d6d8[_0x092e('0x38')]=_['intersection'](_0x3c46d7[_0x092e('0x33')],qs[_0x092e('0x39')](_0x2988d0['query'][_0x092e('0x39')]));_0x31d6d8[_0x092e('0x38')]=_0x31d6d8[_0x092e('0x38')][_0x092e('0x3a')]?_0x31d6d8[_0x092e('0x38')]:_0x3c46d7['model'];_0x31d6d8[_0x092e('0x3c')]=qs['sort'](_0x2988d0['query']['sort']);_0x31d6d8[_0x092e('0x3f')]=qs[_0x092e('0x36')](_[_0x092e('0x3e')](_0x2988d0[_0x092e('0x35')],_0x3c46d7[_0x092e('0x36')]));if(_0x2988d0[_0x092e('0x35')]['filter']){_0x31d6d8[_0x092e('0x3f')]=_['merge'](_0x31d6d8[_0x092e('0x3f')],{'$or':_[_0x092e('0x41')](_0x31d6d8[_0x092e('0x38')],function(_0x2732a6){var _0xa15f7b={};_0xa15f7b[_0x2732a6]={'$like':'%'+_0x2988d0[_0x092e('0x35')][_0x092e('0x45')]+'%'};return _0xa15f7b;})});}_0x31d6d8=_[_0x092e('0x40')]({},_0x31d6d8,_0x2988d0['options']);return _0x2ea291[_0x092e('0x52')](_0x31d6d8);}})[_0x092e('0x2d')](function(_0x8e5ed3){if(_0x8e5ed3){_0x104202=_0x8e5ed3[_0x092e('0x3a')];if(!_0x2988d0[_0x092e('0x35')][_0x092e('0x55')](_0x092e('0x3b'))){_0x31d6d8[_0x092e('0x26')]=qs['limit'](_0x2988d0[_0x092e('0x35')][_0x092e('0x26')]);_0x31d6d8['offset']=qs[_0x092e('0x25')](_0x2988d0[_0x092e('0x35')][_0x092e('0x25')]);}return _0x2ea291[_0x092e('0x52')](_0x31d6d8);}})['then'](function(_0x15c477){if(_0x15c477){return _0x15c477?{'count':_0x104202,'rows':_0x15c477}:null;}})[_0x092e('0x2d')](respondWithResult(_0xa78536,null))[_0x092e('0x4c')](handleError(_0xa78536,null));};exports[_0x092e('0x56')]=function(_0x200169,_0x438114,_0x1048a3){var _0x4cb243={};var _0x1394fc={};var _0x3c09c7;var _0x528e15;return db[_0x092e('0x49')][_0x092e('0x53')]({'where':{'id':_0x200169['params']['id']}})['then'](handleEntityNotFound(_0x438114,null))[_0x092e('0x2d')](function(_0x12d9bd){if(_0x12d9bd){_0x3c09c7=_0x12d9bd;_0x1394fc[_0x092e('0x33')]=_['keys'](db[_0x092e('0x54')][_0x092e('0x32')]);_0x1394fc[_0x092e('0x35')]=_['keys'](_0x200169[_0x092e('0x35')]);_0x1394fc[_0x092e('0x36')]=_['intersection'](_0x1394fc['model'],_0x1394fc[_0x092e('0x35')]);_0x4cb243[_0x092e('0x38')]=_['intersection'](_0x1394fc[_0x092e('0x33')],qs[_0x092e('0x39')](_0x200169[_0x092e('0x35')][_0x092e('0x39')]));_0x4cb243['attributes']=_0x4cb243[_0x092e('0x38')]['length']?_0x4cb243['attributes']:_0x1394fc[_0x092e('0x33')];_0x4cb243['order']=qs['sort'](_0x200169[_0x092e('0x35')][_0x092e('0x3d')]);_0x4cb243[_0x092e('0x3f')]=qs[_0x092e('0x36')](_[_0x092e('0x3e')](_0x200169[_0x092e('0x35')],_0x1394fc[_0x092e('0x36')]));if(_0x200169[_0x092e('0x35')][_0x092e('0x45')]){_0x4cb243[_0x092e('0x3f')]=_['merge'](_0x4cb243[_0x092e('0x3f')],{'$or':_[_0x092e('0x41')](_0x4cb243['attributes'],function(_0x5ead10){var _0x28663e={};_0x28663e[_0x5ead10]={'$like':'%'+_0x200169['query']['filter']+'%'};return _0x28663e;})});}_0x4cb243=_[_0x092e('0x40')]({},_0x4cb243,_0x200169[_0x092e('0x46')]);return _0x3c09c7[_0x092e('0x56')](_0x4cb243);}})[_0x092e('0x2d')](function(_0x1ca376){if(_0x1ca376){_0x528e15=_0x1ca376[_0x092e('0x3a')];if(!_0x200169['query'][_0x092e('0x55')](_0x092e('0x3b'))){_0x4cb243[_0x092e('0x26')]=qs[_0x092e('0x26')](_0x200169[_0x092e('0x35')][_0x092e('0x26')]);_0x4cb243[_0x092e('0x25')]=qs[_0x092e('0x25')](_0x200169[_0x092e('0x35')]['offset']);}return _0x3c09c7[_0x092e('0x56')](_0x4cb243);}})['then'](function(_0x27c6f9){if(_0x27c6f9){return _0x27c6f9?{'count':_0x528e15,'rows':_0x27c6f9}:null;}})['then'](respondWithResult(_0x438114,null))[_0x092e('0x4c')](handleError(_0x438114,null));};exports['getDescriptions']=function(_0x518f24,_0x3a0944,_0x19b204){var _0x4c0823={};var _0x4f64dd={};var _0x556ddc;var _0x3519d3;return db[_0x092e('0x49')][_0x092e('0x53')]({'where':{'id':_0x518f24[_0x092e('0x4e')]['id']}})[_0x092e('0x2d')](handleEntityNotFound(_0x3a0944,null))['then'](function(_0x31c956){if(_0x31c956){_0x556ddc=_0x31c956;_0x4f64dd[_0x092e('0x33')]=_[_0x092e('0x34')](db['VtigerField'][_0x092e('0x32')]);_0x4f64dd['query']=_['keys'](_0x518f24[_0x092e('0x35')]);_0x4f64dd[_0x092e('0x36')]=_['intersection'](_0x4f64dd[_0x092e('0x33')],_0x4f64dd[_0x092e('0x35')]);_0x4c0823['attributes']=_[_0x092e('0x37')](_0x4f64dd[_0x092e('0x33')],qs['fields'](_0x518f24[_0x092e('0x35')]['fields']));_0x4c0823[_0x092e('0x38')]=_0x4c0823[_0x092e('0x38')][_0x092e('0x3a')]?_0x4c0823[_0x092e('0x38')]:_0x4f64dd['model'];_0x4c0823['order']=qs[_0x092e('0x3d')](_0x518f24['query'][_0x092e('0x3d')]);_0x4c0823[_0x092e('0x3f')]=qs[_0x092e('0x36')](_[_0x092e('0x3e')](_0x518f24['query'],_0x4f64dd[_0x092e('0x36')]));if(_0x518f24[_0x092e('0x35')][_0x092e('0x45')]){_0x4c0823[_0x092e('0x3f')]=_[_0x092e('0x40')](_0x4c0823['where'],{'$or':_[_0x092e('0x41')](_0x4c0823['attributes'],function(_0x9cb5f2){var _0x30bc46={};_0x30bc46[_0x9cb5f2]={'$like':'%'+_0x518f24[_0x092e('0x35')]['filter']+'%'};return _0x30bc46;})});}_0x4c0823=_[_0x092e('0x40')]({},_0x4c0823,_0x518f24['options']);return _0x556ddc[_0x092e('0x57')](_0x4c0823);}})['then'](function(_0x4d234a){if(_0x4d234a){_0x3519d3=_0x4d234a[_0x092e('0x3a')];if(!_0x518f24[_0x092e('0x35')][_0x092e('0x55')]('nolimit')){_0x4c0823[_0x092e('0x26')]=qs[_0x092e('0x26')](_0x518f24['query'][_0x092e('0x26')]);_0x4c0823['offset']=qs[_0x092e('0x25')](_0x518f24[_0x092e('0x35')][_0x092e('0x25')]);}return _0x556ddc[_0x092e('0x57')](_0x4c0823);}})[_0x092e('0x2d')](function(_0x2e40e8){if(_0x2e40e8){return _0x2e40e8?{'count':_0x3519d3,'rows':_0x2e40e8}:null;}})['then'](respondWithResult(_0x3a0944,null))[_0x092e('0x4c')](handleError(_0x3a0944,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 3e549bf..5a5543d 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21ca=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','lodash','api','moment'];(function(_0xa7662e,_0x22304d){var _0x425053=function(_0x3e24a6){while(--_0x3e24a6){_0xa7662e['push'](_0xa7662e['shift']());}};_0x425053(++_0x22304d);}(_0x21ca,0xd5));var _0xa21c=function(_0x2ae9fe,_0x31ecfe){_0x2ae9fe=_0x2ae9fe-0x0;var _0x2331e1=_0x21ca[_0x2ae9fe];return _0x2331e1;};'use strict';var _=require(_0xa21c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa21c('0x1'));var moment=require(_0xa21c('0x2'));var BPromise=require(_0xa21c('0x3'));var rp=require(_0xa21c('0x4'));var fs=require('fs');var path=require(_0xa21c('0x5'));var rimraf=require(_0xa21c('0x6'));var config=require(_0xa21c('0x7'));var attributes=require(_0xa21c('0x8'));module[_0xa21c('0x9')]=function(_0x2019e1,_0x1fe4af){return _0x2019e1['define'](_0xa21c('0xa'),attributes,{'tableName':_0xa21c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8458=['api','request-promise','path','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8458,0xbb));var _0x8845=function(_0x56e888,_0x11f910){_0x56e888=_0x56e888-0x0;var _0x4e1b0f=_0x8458[_0x56e888];return _0x4e1b0f;};'use strict';var _=require(_0x8845('0x0'));var util=require(_0x8845('0x1'));var logger=require(_0x8845('0x2'))(_0x8845('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8845('0x4'));var fs=require('fs');var path=require(_0x8845('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8845('0x6'));module[_0x8845('0x7')]=function(_0x1dc046,_0x4fbe6d){return _0x1dc046[_0x8845('0x8')](_0x8845('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index f46ad51..f680c7f 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4715=['then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x3f852d,_0x3345d5){var _0x421240=function(_0x52bc56){while(--_0x52bc56){_0x3f852d['push'](_0x3f852d['shift']());}};_0x421240(++_0x3345d5);}(_0x4715,0x1f0));var _0x5471=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x4715[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x5471('0x0'));var util=require(_0x5471('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5471('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5471('0x3'))['db'];var utils=require(_0x5471('0x4'));var logger=require(_0x5471('0x5'))(_0x5471('0x6'));var config=require(_0x5471('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5471('0x8')][_0x5471('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39e130,_0x5ebee6,_0x5cc9fa){return new BPromise(function(_0x4b14d4,_0x49df99){return client['request'](_0x39e130,_0x5cc9fa)[_0x5471('0xa')](function(_0x4d224f){logger[_0x5471('0xb')](_0x5471('0xc'),_0x5ebee6,_0x5471('0xd'));logger[_0x5471('0xe')](_0x5471('0xf'),_0x5ebee6,_0x5471('0xd'),JSON[_0x5471('0x10')](_0x4d224f));if(_0x4d224f[_0x5471('0x11')]){if(_0x4d224f[_0x5471('0x11')][_0x5471('0x12')]===0x1f4){logger[_0x5471('0x11')](_0x5471('0xc'),_0x5ebee6,_0x4d224f[_0x5471('0x11')][_0x5471('0x13')]);return _0x49df99(_0x4d224f[_0x5471('0x11')][_0x5471('0x13')]);}logger[_0x5471('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x5ebee6,_0x4d224f[_0x5471('0x11')][_0x5471('0x13')]);return _0x4b14d4(_0x4d224f[_0x5471('0x11')][_0x5471('0x13')]);}else{logger[_0x5471('0xb')](_0x5471('0xc'),_0x5ebee6,'request\x20sent');_0x4b14d4(_0x4d224f[_0x5471('0x14')][_0x5471('0x13')]);}})[_0x5471('0x15')](function(_0x19a00b){logger[_0x5471('0x11')](_0x5471('0xc'),_0x5ebee6,_0x19a00b);_0x49df99(_0x19a00b);});});} \ No newline at end of file +var _0x11ef=['stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x608485,_0x3e2ca8){var _0x5b30a2=function(_0x4fa5c7){while(--_0x4fa5c7){_0x608485['push'](_0x608485['shift']());}};_0x5b30a2(++_0x3e2ca8);}(_0x11ef,0x6a));var _0xf11e=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x11ef[_0x2dadb9];return _0x2f0097;};'use strict';var _=require('lodash');var util=require(_0xf11e('0x0'));var moment=require('moment');var BPromise=require(_0xf11e('0x1'));var rs=require(_0xf11e('0x2'));var fs=require('fs');var Redis=require(_0xf11e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf11e('0x4'))(_0xf11e('0x5'));var config=require(_0xf11e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf11e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ca991,_0x4d6806,_0xe71d74){return new BPromise(function(_0x598a6a,_0x5f3f61){return client['request'](_0x4ca991,_0xe71d74)[_0xf11e('0x8')](function(_0x13346e){logger[_0xf11e('0x9')](_0xf11e('0xa'),_0x4d6806,_0xf11e('0xb'));logger[_0xf11e('0xc')](_0xf11e('0xd'),_0x4d6806,_0xf11e('0xb'),JSON[_0xf11e('0xe')](_0x13346e));if(_0x13346e[_0xf11e('0xf')]){if(_0x13346e[_0xf11e('0xf')][_0xf11e('0x10')]===0x1f4){logger[_0xf11e('0xf')](_0xf11e('0xa'),_0x4d6806,_0x13346e[_0xf11e('0xf')][_0xf11e('0x11')]);return _0x5f3f61(_0x13346e['error'][_0xf11e('0x11')]);}logger['error'](_0xf11e('0xa'),_0x4d6806,_0x13346e['error'][_0xf11e('0x11')]);return _0x598a6a(_0x13346e[_0xf11e('0xf')][_0xf11e('0x11')]);}else{logger[_0xf11e('0x9')]('VtigerConfiguration,\x20%s,\x20%s',_0x4d6806,_0xf11e('0xb'));_0x598a6a(_0x13346e[_0xf11e('0x12')][_0xf11e('0x11')]);}})[_0xf11e('0x13')](function(_0x517178){logger[_0xf11e('0xf')](_0xf11e('0xa'),_0x4d6806,_0x517178);_0x5f3f61(_0x517178);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 6928c1c..9b27b5c 100644 --- a/server/api/intVtigerField/index.js +++ b/server/api/intVtigerField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd77b=['index','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated'];(function(_0x481ca4,_0x4ab968){var _0x44b23d=function(_0x50d26f){while(--_0x50d26f){_0x481ca4['push'](_0x481ca4['shift']());}};_0x44b23d(++_0x4ab968);}(_0xd77b,0x98));var _0xbd77=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xd77b[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0xbd77('0x0'));var util=require('util');var path=require(_0xbd77('0x1'));var timeout=require(_0xbd77('0x2'));var express=require(_0xbd77('0x3'));var router=express['Router']();var auth=require(_0xbd77('0x4'));var interaction=require(_0xbd77('0x5'));var config=require(_0xbd77('0x6'));var controller=require(_0xbd77('0x7'));router[_0xbd77('0x8')]('/',auth[_0xbd77('0x9')](),controller[_0xbd77('0xa')]);router[_0xbd77('0x8')](_0xbd77('0xb'),auth[_0xbd77('0x9')](),controller['show']);router[_0xbd77('0xc')]('/',auth['isAuthenticated'](),controller[_0xbd77('0xd')]);router[_0xbd77('0xe')](_0xbd77('0xb'),auth[_0xbd77('0x9')](),controller[_0xbd77('0xf')]);router['delete'](_0xbd77('0xb'),auth[_0xbd77('0x9')](),controller[_0xbd77('0x10')]);module[_0xbd77('0x11')]=router; \ No newline at end of file +var _0xe647=['get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller'];(function(_0x3d1ef3,_0x5dd67c){var _0x329935=function(_0x3eb759){while(--_0x3eb759){_0x3d1ef3['push'](_0x3d1ef3['shift']());}};_0x329935(++_0x5dd67c);}(_0xe647,0x1d6));var _0x7e64=function(_0x15f8a5,_0x54b1d7){_0x15f8a5=_0x15f8a5-0x0;var _0x220012=_0xe647[_0x15f8a5];return _0x220012;};'use strict';var multer=require(_0x7e64('0x0'));var util=require('util');var path=require(_0x7e64('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x7e64('0x2'));var interaction=require(_0x7e64('0x3'));var config=require(_0x7e64('0x4'));var controller=require(_0x7e64('0x5'));router[_0x7e64('0x6')]('/',auth[_0x7e64('0x7')](),controller[_0x7e64('0x8')]);router[_0x7e64('0x6')](_0x7e64('0x9'),auth['isAuthenticated'](),controller[_0x7e64('0xa')]);router['post']('/',auth[_0x7e64('0x7')](),controller[_0x7e64('0xb')]);router[_0x7e64('0xc')](_0x7e64('0x9'),auth['isAuthenticated'](),controller[_0x7e64('0xd')]);router[_0x7e64('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7e64('0xf')]);module[_0x7e64('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index f3d7f89..44a1d2c 100644 --- a/server/api/intVtigerField/intVtigerField.attributes.js +++ b/server/api/intVtigerField/intVtigerField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c22=['keyValue','ENUM','STRING','BOOLEAN','sequelize','exports','string','variable'];(function(_0x396576,_0x4542e3){var _0x23288c=function(_0x151892){while(--_0x151892){_0x396576['push'](_0x396576['shift']());}};_0x23288c(++_0x4542e3);}(_0x7c22,0x6c));var _0x27c2=function(_0x1be96f,_0x6cf028){_0x1be96f=_0x1be96f-0x0;var _0x56019f=_0x7c22[_0x1be96f];return _0x56019f;};'use strict';var Sequelize=require(_0x27c2('0x0'));module[_0x27c2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x27c2('0x2'),_0x27c2('0x3'),'customVariable',_0x27c2('0x4')),'defaultValue':_0x27c2('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x27c2('0x5')]('string',_0x27c2('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x27c2('0x6')]},'idField':{'type':Sequelize[_0x27c2('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x27c2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x27c2('0x6')]}}; \ No newline at end of file +var _0x93eb=['string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x4b56fe,_0x30c4ee){var _0x52bc92=function(_0x5b7529){while(--_0x5b7529){_0x4b56fe['push'](_0x4b56fe['shift']());}};_0x52bc92(++_0x30c4ee);}(_0x93eb,0x7d));var _0xb93e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x93eb[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require('sequelize');module[_0xb93e('0x0')]={'type':{'type':Sequelize['ENUM'](_0xb93e('0x1'),_0xb93e('0x2'),_0xb93e('0x3'),_0xb93e('0x4')),'defaultValue':_0xb93e('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb93e('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xb93e('0x1'),_0xb93e('0x2'),_0xb93e('0x3'))},'keyContent':{'type':Sequelize[_0xb93e('0x5')]},'idField':{'type':Sequelize[_0xb93e('0x5')]},'nameField':{'type':Sequelize[_0xb93e('0x5')]},'customField':{'type':Sequelize[_0xb93e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb93e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index d690e27..1015e35 100644 --- a/server/api/intVtigerField/intVtigerField.controller.js +++ b/server/api/intVtigerField/intVtigerField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07bd=['error','stack','name','send','index','VtigerField','rawAttributes','keys','query','intersection','model','attributes','fields','length','nolimit','offset','order','sort','filters','pick','filter','where','type','key','VIRTUAL','merge','count','includeAll','include','rows','catch','params','options','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','limit','set','reject','save','update','then','destroy'];(function(_0x8cd6a9,_0x20159a){var _0x120da0=function(_0x46f11f){while(--_0x46f11f){_0x8cd6a9['push'](_0x8cd6a9['shift']());}};_0x120da0(++_0x20159a);}(_0x07bd,0x140));var _0xd07b=function(_0x1d3d8a,_0x497ecf){_0x1d3d8a=_0x1d3d8a-0x0;var _0x524568=_0x07bd[_0x1d3d8a];return _0x524568;};'use strict';var pdf=require(_0xd07b('0x0'));var emlformat=require(_0xd07b('0x1'));var rimraf=require(_0xd07b('0x2'));var zipdir=require(_0xd07b('0x3'));var jsonpatch=require(_0xd07b('0x4'));var rp=require(_0xd07b('0x5'));var moment=require(_0xd07b('0x6'));var BPromise=require(_0xd07b('0x7'));var Mustache=require(_0xd07b('0x8'));var util=require('util');var path=require(_0xd07b('0x9'));var sox=require('sox');var csv=require(_0xd07b('0xa'));var ejs=require(_0xd07b('0xb'));var fs=require('fs');var _=require(_0xd07b('0xc'));var squel=require(_0xd07b('0xd'));var crypto=require(_0xd07b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd07b('0xa'));var querystring=require(_0xd07b('0xf'));var Papa=require(_0xd07b('0x10'));var Redis=require(_0xd07b('0x11'));var authService=require(_0xd07b('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd07b('0x13'));var logger=require(_0xd07b('0x14'))(_0xd07b('0x15'));var utils=require(_0xd07b('0x16'));var config=require(_0xd07b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27c63b,_0x54df6d){_0x54df6d=_0x54df6d||0xcc;return function(_0xb5937b){if(_0xb5937b){return _0x27c63b[_0xd07b('0x18')](_0x54df6d);}return _0x27c63b['status'](_0x54df6d)[_0xd07b('0x19')]();};}function respondWithResult(_0x19393b,_0x382d52){_0x382d52=_0x382d52||0xc8;return function(_0x48cdb3){if(_0x48cdb3){return _0x19393b[_0xd07b('0x1a')](_0x382d52)[_0xd07b('0x1b')](_0x48cdb3);}};}function respondWithFilteredResult(_0x1de836,_0x11d49a){return function(_0xa9cd8d){if(_0xa9cd8d){var _0x1c5dc9=_0xa9cd8d['count'],_0xb8b2c3=_0x11d49a['offset'],_0x32f83f=_0x11d49a['offset']+_0x11d49a[_0xd07b('0x1c')],_0x26afbc;if(_0x32f83f>=_0x1c5dc9){_0x32f83f=_0x1c5dc9;_0x26afbc=0xc8;}else{_0x26afbc=0xce;}_0x1de836['status'](_0x26afbc);return _0x1de836[_0xd07b('0x1d')]('Content-Range',_0xb8b2c3+'-'+_0x32f83f+'/'+_0x1c5dc9)[_0xd07b('0x1b')](_0xa9cd8d);}return null;};}function patchUpdates(_0x5e34e){return function(_0x575930){try{jsonpatch['apply'](_0x575930,_0x5e34e,!![]);}catch(_0x147f8a){return BPromise[_0xd07b('0x1e')](_0x147f8a);}return _0x575930[_0xd07b('0x1f')]();};}function saveUpdates(_0x4d1268,_0x43e85b){return function(_0x335ade){if(_0x335ade){return _0x335ade[_0xd07b('0x20')](_0x4d1268)[_0xd07b('0x21')](function(_0x527b1c){return _0x527b1c;});}return null;};}function removeEntity(_0xa60c1b,_0x2966a5){return function(_0x423cc4){if(_0x423cc4){return _0x423cc4[_0xd07b('0x22')]()[_0xd07b('0x21')](function(){_0xa60c1b[_0xd07b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d2d3a,_0x138a2b){return function(_0x560982){if(!_0x560982){_0x9d2d3a['sendStatus'](0x194);}return _0x560982;};}function handleError(_0x1675bf,_0x376518){_0x376518=_0x376518||0x1f4;return function(_0x34394e){logger[_0xd07b('0x23')](_0x34394e[_0xd07b('0x24')]);if(_0x34394e[_0xd07b('0x25')]){delete _0x34394e[_0xd07b('0x25')];}_0x1675bf['status'](_0x376518)[_0xd07b('0x26')](_0x34394e);};}exports[_0xd07b('0x27')]=function(_0x24ab74,_0x26aef3){var _0x3a75a6={},_0x157aad={},_0x182fd1={'count':0x0,'rows':[]};var _0x54fadd=db[_0xd07b('0x28')][_0xd07b('0x29')];_0x157aad['model']=_[_0xd07b('0x2a')](_0x54fadd);_0x157aad['query']=_[_0xd07b('0x2a')](_0x24ab74[_0xd07b('0x2b')]);_0x157aad['filters']=_[_0xd07b('0x2c')](_0x157aad[_0xd07b('0x2d')],_0x157aad['query']);_0x3a75a6[_0xd07b('0x2e')]=_[_0xd07b('0x2c')](_0x157aad[_0xd07b('0x2d')],qs[_0xd07b('0x2f')](_0x24ab74[_0xd07b('0x2b')]['fields']));_0x3a75a6[_0xd07b('0x2e')]=_0x3a75a6[_0xd07b('0x2e')][_0xd07b('0x30')]?_0x3a75a6[_0xd07b('0x2e')]:_0x157aad[_0xd07b('0x2d')];if(!_0x24ab74[_0xd07b('0x2b')]['hasOwnProperty'](_0xd07b('0x31'))){_0x3a75a6['limit']=qs[_0xd07b('0x1c')](_0x24ab74['query'][_0xd07b('0x1c')]);_0x3a75a6[_0xd07b('0x32')]=qs[_0xd07b('0x32')](_0x24ab74[_0xd07b('0x2b')]['offset']);}_0x3a75a6[_0xd07b('0x33')]=qs[_0xd07b('0x34')](_0x24ab74[_0xd07b('0x2b')][_0xd07b('0x34')]);_0x3a75a6['where']=qs[_0xd07b('0x35')](_[_0xd07b('0x36')](_0x24ab74[_0xd07b('0x2b')],_0x157aad[_0xd07b('0x35')]));if(_0x24ab74[_0xd07b('0x2b')][_0xd07b('0x37')]){_0x3a75a6[_0xd07b('0x38')]=_['merge'](_0x3a75a6[_0xd07b('0x38')],{'$or':_['map'](_0x54fadd,function(_0x13920b){if(_0x13920b[_0xd07b('0x39')][_0xd07b('0x3a')]!==_0xd07b('0x3b')){var _0x25e1c5={};_0x25e1c5[_0x13920b['field']]={'$like':'%'+_0x24ab74[_0xd07b('0x2b')][_0xd07b('0x37')]+'%'};return _0x25e1c5;}})});}_0x3a75a6=_[_0xd07b('0x3c')]({},_0x3a75a6,_0x24ab74['options']);var _0x1a8a83={'where':_0x3a75a6[_0xd07b('0x38')]};return db[_0xd07b('0x28')][_0xd07b('0x3d')](_0x1a8a83)['then'](function(_0x15f1d2){_0x182fd1[_0xd07b('0x3d')]=_0x15f1d2;if(_0x24ab74[_0xd07b('0x2b')][_0xd07b('0x3e')]){_0x3a75a6[_0xd07b('0x3f')]=[{'all':!![]}];}return db[_0xd07b('0x28')]['findAll'](_0x3a75a6);})[_0xd07b('0x21')](function(_0xa6774e){_0x182fd1[_0xd07b('0x40')]=_0xa6774e;return _0x182fd1;})['then'](respondWithFilteredResult(_0x26aef3,_0x3a75a6))[_0xd07b('0x41')](handleError(_0x26aef3,null));};exports['show']=function(_0x477400,_0x490fc7){var _0x4001b5={'raw':!![],'where':{'id':_0x477400[_0xd07b('0x42')]['id']}},_0x7b19cb={};_0x7b19cb['model']=_['keys'](db['VtigerField'][_0xd07b('0x29')]);_0x7b19cb[_0xd07b('0x2b')]=_[_0xd07b('0x2a')](_0x477400[_0xd07b('0x2b')]);_0x7b19cb['filters']=_['intersection'](_0x7b19cb['model'],_0x7b19cb[_0xd07b('0x2b')]);_0x4001b5[_0xd07b('0x2e')]=_[_0xd07b('0x2c')](_0x7b19cb[_0xd07b('0x2d')],qs[_0xd07b('0x2f')](_0x477400['query'][_0xd07b('0x2f')]));_0x4001b5['attributes']=_0x4001b5[_0xd07b('0x2e')][_0xd07b('0x30')]?_0x4001b5['attributes']:_0x7b19cb[_0xd07b('0x2d')];if(_0x477400[_0xd07b('0x2b')][_0xd07b('0x3e')]){_0x4001b5['include']=[{'all':!![]}];}_0x4001b5=_['merge']({},_0x4001b5,_0x477400[_0xd07b('0x43')]);return db[_0xd07b('0x28')]['find'](_0x4001b5)['then'](handleEntityNotFound(_0x490fc7,null))[_0xd07b('0x21')](respondWithResult(_0x490fc7,null))[_0xd07b('0x41')](handleError(_0x490fc7,null));};exports[_0xd07b('0x44')]=function(_0x5e08ef,_0x5f3495){return db['VtigerField'][_0xd07b('0x44')](_0x5e08ef[_0xd07b('0x45')],{})[_0xd07b('0x21')](respondWithResult(_0x5f3495,0xc9))[_0xd07b('0x41')](handleError(_0x5f3495,null));};exports[_0xd07b('0x20')]=function(_0x19feaf,_0x81b159){if(_0x19feaf[_0xd07b('0x45')]['id']){delete _0x19feaf['body']['id'];}return db['VtigerField'][_0xd07b('0x46')]({'where':{'id':_0x19feaf[_0xd07b('0x42')]['id']}})['then'](handleEntityNotFound(_0x81b159,null))[_0xd07b('0x21')](saveUpdates(_0x19feaf[_0xd07b('0x45')],null))['then'](respondWithResult(_0x81b159,null))[_0xd07b('0x41')](handleError(_0x81b159,null));};exports[_0xd07b('0x22')]=function(_0xbd3a5d,_0x7d0341){return db[_0xd07b('0x28')][_0xd07b('0x46')]({'where':{'id':_0xbd3a5d[_0xd07b('0x42')]['id']}})[_0xd07b('0x21')](handleEntityNotFound(_0x7d0341,null))['then'](removeEntity(_0x7d0341,null))[_0xd07b('0x41')](handleError(_0x7d0341,null));}; \ No newline at end of file +var _0xf52e=['bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','update','destroy','then','stack','name','send','index','VtigerField','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','limit','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','count','includeAll','rows','show','params','include','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x26380b,_0x26df92){var _0x52a64c=function(_0x2a0253){while(--_0x2a0253){_0x26380b['push'](_0x26380b['shift']());}};_0x52a64c(++_0x26df92);}(_0xf52e,0x159));var _0xef52=function(_0x5da8c9,_0x3a9db2){_0x5da8c9=_0x5da8c9-0x0;var _0x4ca475=_0xf52e[_0x5da8c9];return _0x4ca475;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xef52('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef52('0x1'));var jsonpatch=require(_0xef52('0x2'));var rp=require(_0xef52('0x3'));var moment=require(_0xef52('0x4'));var BPromise=require(_0xef52('0x5'));var Mustache=require(_0xef52('0x6'));var util=require(_0xef52('0x7'));var path=require('path');var sox=require(_0xef52('0x8'));var csv=require(_0xef52('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xef52('0xa'));var squel=require(_0xef52('0xb'));var crypto=require(_0xef52('0xc'));var jsforce=require(_0xef52('0xd'));var deskjs=require(_0xef52('0xe'));var toCsv=require(_0xef52('0x9'));var querystring=require(_0xef52('0xf'));var Papa=require(_0xef52('0x10'));var Redis=require(_0xef52('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xef52('0x12'));var hardwareService=require(_0xef52('0x13'));var logger=require(_0xef52('0x14'))(_0xef52('0x15'));var utils=require(_0xef52('0x16'));var config=require(_0xef52('0x17'));var db=require(_0xef52('0x18'))['db'];function respondWithStatusCode(_0x5d5abf,_0x330309){_0x330309=_0x330309||0xcc;return function(_0x184743){if(_0x184743){return _0x5d5abf['sendStatus'](_0x330309);}return _0x5d5abf[_0xef52('0x19')](_0x330309)[_0xef52('0x1a')]();};}function respondWithResult(_0x1ab77b,_0x263bc3){_0x263bc3=_0x263bc3||0xc8;return function(_0x168d01){if(_0x168d01){return _0x1ab77b[_0xef52('0x19')](_0x263bc3)[_0xef52('0x1b')](_0x168d01);}};}function respondWithFilteredResult(_0x4eeb35,_0x11da5e){return function(_0x21e6b1){if(_0x21e6b1){var _0x455967=_0x21e6b1['count'],_0x58bd83=_0x11da5e[_0xef52('0x1c')],_0x3b1daa=_0x11da5e[_0xef52('0x1c')]+_0x11da5e['limit'],_0x4417d5;if(_0x3b1daa>=_0x455967){_0x3b1daa=_0x455967;_0x4417d5=0xc8;}else{_0x4417d5=0xce;}_0x4eeb35[_0xef52('0x19')](_0x4417d5);return _0x4eeb35[_0xef52('0x1d')](_0xef52('0x1e'),_0x58bd83+'-'+_0x3b1daa+'/'+_0x455967)[_0xef52('0x1b')](_0x21e6b1);}return null;};}function patchUpdates(_0x543cb9){return function(_0x27cd01){try{jsonpatch[_0xef52('0x1f')](_0x27cd01,_0x543cb9,!![]);}catch(_0x375378){return BPromise['reject'](_0x375378);}return _0x27cd01['save']();};}function saveUpdates(_0x21ce9a,_0x4bf20c){return function(_0x4f9d59){if(_0x4f9d59){return _0x4f9d59[_0xef52('0x20')](_0x21ce9a)['then'](function(_0x5a5c2d){return _0x5a5c2d;});}return null;};}function removeEntity(_0x480bf2,_0x5605a0){return function(_0x65cb79){if(_0x65cb79){return _0x65cb79[_0xef52('0x21')]()[_0xef52('0x22')](function(){_0x480bf2[_0xef52('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16c8bc,_0x3008ca){return function(_0x46ed36){if(!_0x46ed36){_0x16c8bc['sendStatus'](0x194);}return _0x46ed36;};}function handleError(_0x574857,_0x34a916){_0x34a916=_0x34a916||0x1f4;return function(_0x57227f){logger['error'](_0x57227f[_0xef52('0x23')]);if(_0x57227f[_0xef52('0x24')]){delete _0x57227f['name'];}_0x574857[_0xef52('0x19')](_0x34a916)[_0xef52('0x25')](_0x57227f);};}exports[_0xef52('0x26')]=function(_0x4b3f99,_0xdad4fc){var _0x212c62={},_0x5023ec={},_0x40dcf0={'count':0x0,'rows':[]};var _0x5454fb=db[_0xef52('0x27')][_0xef52('0x28')];_0x5023ec[_0xef52('0x29')]=_['keys'](_0x5454fb);_0x5023ec[_0xef52('0x2a')]=_[_0xef52('0x2b')](_0x4b3f99['query']);_0x5023ec[_0xef52('0x2c')]=_[_0xef52('0x2d')](_0x5023ec['model'],_0x5023ec[_0xef52('0x2a')]);_0x212c62[_0xef52('0x2e')]=_[_0xef52('0x2d')](_0x5023ec['model'],qs[_0xef52('0x2f')](_0x4b3f99[_0xef52('0x2a')][_0xef52('0x2f')]));_0x212c62['attributes']=_0x212c62[_0xef52('0x2e')][_0xef52('0x30')]?_0x212c62[_0xef52('0x2e')]:_0x5023ec['model'];if(!_0x4b3f99[_0xef52('0x2a')]['hasOwnProperty']('nolimit')){_0x212c62['limit']=qs[_0xef52('0x31')](_0x4b3f99[_0xef52('0x2a')]['limit']);_0x212c62['offset']=qs[_0xef52('0x1c')](_0x4b3f99[_0xef52('0x2a')]['offset']);}_0x212c62['order']=qs[_0xef52('0x32')](_0x4b3f99[_0xef52('0x2a')]['sort']);_0x212c62['where']=qs[_0xef52('0x2c')](_[_0xef52('0x33')](_0x4b3f99[_0xef52('0x2a')],_0x5023ec['filters']));if(_0x4b3f99[_0xef52('0x2a')][_0xef52('0x34')]){_0x212c62[_0xef52('0x35')]=_[_0xef52('0x36')](_0x212c62[_0xef52('0x35')],{'$or':_[_0xef52('0x37')](_0x5454fb,function(_0x353730){if(_0x353730['type'][_0xef52('0x38')]!==_0xef52('0x39')){var _0x2042c4={};_0x2042c4[_0x353730[_0xef52('0x3a')]]={'$like':'%'+_0x4b3f99[_0xef52('0x2a')][_0xef52('0x34')]+'%'};return _0x2042c4;}})});}_0x212c62=_['merge']({},_0x212c62,_0x4b3f99[_0xef52('0x3b')]);var _0x4dbcc9={'where':_0x212c62[_0xef52('0x35')]};return db[_0xef52('0x27')][_0xef52('0x3c')](_0x4dbcc9)[_0xef52('0x22')](function(_0x22eac4){_0x40dcf0[_0xef52('0x3c')]=_0x22eac4;if(_0x4b3f99['query'][_0xef52('0x3d')]){_0x212c62['include']=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x212c62);})[_0xef52('0x22')](function(_0x503e2c){_0x40dcf0[_0xef52('0x3e')]=_0x503e2c;return _0x40dcf0;})[_0xef52('0x22')](respondWithFilteredResult(_0xdad4fc,_0x212c62))['catch'](handleError(_0xdad4fc,null));};exports[_0xef52('0x3f')]=function(_0x2ddf30,_0x19d5ab){var _0xc705ce={'raw':!![],'where':{'id':_0x2ddf30[_0xef52('0x40')]['id']}},_0x9b22d6={};_0x9b22d6[_0xef52('0x29')]=_[_0xef52('0x2b')](db[_0xef52('0x27')][_0xef52('0x28')]);_0x9b22d6['query']=_[_0xef52('0x2b')](_0x2ddf30[_0xef52('0x2a')]);_0x9b22d6[_0xef52('0x2c')]=_[_0xef52('0x2d')](_0x9b22d6[_0xef52('0x29')],_0x9b22d6[_0xef52('0x2a')]);_0xc705ce[_0xef52('0x2e')]=_[_0xef52('0x2d')](_0x9b22d6[_0xef52('0x29')],qs['fields'](_0x2ddf30[_0xef52('0x2a')]['fields']));_0xc705ce[_0xef52('0x2e')]=_0xc705ce['attributes']['length']?_0xc705ce[_0xef52('0x2e')]:_0x9b22d6[_0xef52('0x29')];if(_0x2ddf30[_0xef52('0x2a')]['includeAll']){_0xc705ce[_0xef52('0x41')]=[{'all':!![]}];}_0xc705ce=_[_0xef52('0x36')]({},_0xc705ce,_0x2ddf30[_0xef52('0x3b')]);return db[_0xef52('0x27')][_0xef52('0x42')](_0xc705ce)[_0xef52('0x22')](handleEntityNotFound(_0x19d5ab,null))[_0xef52('0x22')](respondWithResult(_0x19d5ab,null))[_0xef52('0x43')](handleError(_0x19d5ab,null));};exports['create']=function(_0x4cdfd3,_0x1a881c){return db[_0xef52('0x27')][_0xef52('0x44')](_0x4cdfd3[_0xef52('0x45')],{})[_0xef52('0x22')](respondWithResult(_0x1a881c,0xc9))[_0xef52('0x43')](handleError(_0x1a881c,null));};exports['update']=function(_0x16db24,_0x44634b){if(_0x16db24[_0xef52('0x45')]['id']){delete _0x16db24[_0xef52('0x45')]['id'];}return db[_0xef52('0x27')][_0xef52('0x42')]({'where':{'id':_0x16db24[_0xef52('0x40')]['id']}})['then'](handleEntityNotFound(_0x44634b,null))[_0xef52('0x22')](saveUpdates(_0x16db24[_0xef52('0x45')],null))[_0xef52('0x22')](respondWithResult(_0x44634b,null))[_0xef52('0x43')](handleError(_0x44634b,null));};exports['destroy']=function(_0x3dcf0d,_0x32ef05){return db['VtigerField'][_0xef52('0x42')]({'where':{'id':_0x3dcf0d[_0xef52('0x40')]['id']}})[_0xef52('0x22')](handleEntityNotFound(_0x32ef05,null))['then'](removeEntity(_0x32ef05,null))['catch'](handleError(_0x32ef05,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 2d559da..0376e46 100644 --- a/server/api/intVtigerField/intVtigerField.model.js +++ b/server/api/intVtigerField/intVtigerField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x2f2437,_0x2ae1d){var _0x41f8d8=function(_0x39e895){while(--_0x39e895){_0x2f2437['push'](_0x2f2437['shift']());}};_0x41f8d8(++_0x2ae1d);}(_0x7a54,0x106));var _0x47a5=function(_0x20805d,_0x44f23d){_0x20805d=_0x20805d-0x0;var _0x47e7f2=_0x7a54[_0x20805d];return _0x47e7f2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['rimraf','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 28477e2..66a278b 100644 --- a/server/api/intVtigerField/intVtigerField.rpc.js +++ b/server/api/intVtigerField/intVtigerField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35ff=['request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4d2661,_0x29c0e0){var _0x166e39=function(_0x355e4d){while(--_0x355e4d){_0x4d2661['push'](_0x4d2661['shift']());}};_0x166e39(++_0x29c0e0);}(_0x35ff,0xb3));var _0xf35f=function(_0x512827,_0x4d112b){_0x512827=_0x512827-0x0;var _0x9053b=_0x35ff[_0x512827];return _0x9053b;};'use strict';var _=require('lodash');var util=require(_0xf35f('0x0'));var moment=require(_0xf35f('0x1'));var BPromise=require('bluebird');var rs=require(_0xf35f('0x2'));var fs=require('fs');var Redis=require(_0xf35f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf35f('0x4'));var logger=require('../../config/logger')(_0xf35f('0x5'));var config=require(_0xf35f('0x6'));var jayson=require(_0xf35f('0x7'));var client=jayson[_0xf35f('0x8')][_0xf35f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4321e9,_0x58144a,_0x3e3aaa){return new BPromise(function(_0x1922af,_0x37df94){return client[_0xf35f('0xa')](_0x4321e9,_0x3e3aaa)['then'](function(_0x406771){logger[_0xf35f('0xb')](_0xf35f('0xc'),_0x58144a,_0xf35f('0xd'));logger[_0xf35f('0xe')](_0xf35f('0xf'),_0x58144a,_0xf35f('0xd'),JSON['stringify'](_0x406771));if(_0x406771[_0xf35f('0x10')]){if(_0x406771[_0xf35f('0x10')][_0xf35f('0x11')]===0x1f4){logger[_0xf35f('0x10')](_0xf35f('0xc'),_0x58144a,_0x406771[_0xf35f('0x10')][_0xf35f('0x12')]);return _0x37df94(_0x406771[_0xf35f('0x10')]['message']);}logger[_0xf35f('0x10')]('VtigerField,\x20%s,\x20%s',_0x58144a,_0x406771[_0xf35f('0x10')][_0xf35f('0x12')]);return _0x1922af(_0x406771['error'][_0xf35f('0x12')]);}else{logger[_0xf35f('0xb')](_0xf35f('0xc'),_0x58144a,_0xf35f('0xd'));_0x1922af(_0x406771[_0xf35f('0x13')]['message']);}})[_0xf35f('0x14')](function(_0x3e400b){logger[_0xf35f('0x10')](_0xf35f('0xc'),_0x58144a,_0x3e400b);_0x37df94(_0x3e400b);});});} \ No newline at end of file +var _0xb78e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0x2ecbfd,_0x5bacbc){var _0x2c65a2=function(_0x569338){while(--_0x569338){_0x2ecbfd['push'](_0x2ecbfd['shift']());}};_0x2c65a2(++_0x5bacbc);}(_0xb78e,0x1c9));var _0xeb78=function(_0x631c77,_0xa33205){_0x631c77=_0x631c77-0x0;var _0x4314fe=_0xb78e[_0x631c77];return _0x4314fe;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var moment=require('moment');var BPromise=require(_0xeb78('0x2'));var rs=require(_0xeb78('0x3'));var fs=require('fs');var Redis=require(_0xeb78('0x4'));var db=require(_0xeb78('0x5'))['db'];var utils=require(_0xeb78('0x6'));var logger=require(_0xeb78('0x7'))(_0xeb78('0x8'));var config=require(_0xeb78('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb78('0xa')][_0xeb78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ccc2f,_0x30c884,_0x2b7925){return new BPromise(function(_0x36963f,_0x5259aa){return client['request'](_0x1ccc2f,_0x2b7925)[_0xeb78('0xc')](function(_0x1c941d){logger[_0xeb78('0xd')](_0xeb78('0xe'),_0x30c884,_0xeb78('0xf'));logger[_0xeb78('0x10')](_0xeb78('0x11'),_0x30c884,_0xeb78('0xf'),JSON[_0xeb78('0x12')](_0x1c941d));if(_0x1c941d['error']){if(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x14')]===0x1f4){logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);return _0x5259aa(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);}logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d['error'][_0xeb78('0x15')]);return _0x36963f(_0x1c941d[_0xeb78('0x13')]['message']);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x30c884,_0xeb78('0xf'));_0x36963f(_0x1c941d['result'][_0xeb78('0x15')]);}})[_0xeb78('0x16')](function(_0x49123d){logger[_0xeb78('0x13')]('VtigerField,\x20%s,\x20%s',_0x30c884,_0x49123d);_0x5259aa(_0x49123d);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index f1189a1..2b4ab0d 100644 --- a/server/api/intZendeskAccount/index.js +++ b/server/api/intZendeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d5c=['update','delete','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x19a8e3,_0xa889b3){var _0x18fa6e=function(_0x58b5aa){while(--_0x58b5aa){_0x19a8e3['push'](_0x19a8e3['shift']());}};_0x18fa6e(++_0xa889b3);}(_0x6d5c,0x114));var _0xc6d5=function(_0x3f91af,_0x436220){_0x3f91af=_0x3f91af-0x0;var _0xd6cc77=_0x6d5c[_0x3f91af];return _0xd6cc77;};'use strict';var multer=require('multer');var util=require(_0xc6d5('0x0'));var path=require(_0xc6d5('0x1'));var timeout=require(_0xc6d5('0x2'));var express=require('express');var router=express[_0xc6d5('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc6d5('0x4'));var config=require(_0xc6d5('0x5'));var controller=require(_0xc6d5('0x6'));router[_0xc6d5('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc6d5('0x7')](_0xc6d5('0x8'),auth[_0xc6d5('0x9')](),controller[_0xc6d5('0xa')]);router['get'](_0xc6d5('0xb'),auth[_0xc6d5('0x9')](),controller[_0xc6d5('0xc')]);router['get'](_0xc6d5('0xd'),auth[_0xc6d5('0x9')](),controller[_0xc6d5('0xe')]);router[_0xc6d5('0xf')]('/',auth['isAuthenticated'](),controller[_0xc6d5('0x10')]);router[_0xc6d5('0xf')](_0xc6d5('0xb'),auth[_0xc6d5('0x9')](),controller[_0xc6d5('0x11')]);router['put'](_0xc6d5('0x8'),auth[_0xc6d5('0x9')](),controller[_0xc6d5('0x12')]);router[_0xc6d5('0x13')](_0xc6d5('0x8'),auth[_0xc6d5('0x9')](),controller['destroy']);module[_0xc6d5('0x14')]=router; \ No newline at end of file +var _0xc54e=['update','delete','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','put'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0xc54e,0x18f));var _0xec54=function(_0x4d89fd,_0x411fe1){_0x4d89fd=_0x4d89fd-0x0;var _0x3262a6=_0xc54e[_0x4d89fd];return _0x3262a6;};'use strict';var multer=require('multer');var util=require(_0xec54('0x0'));var path=require(_0xec54('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xec54('0x2')]();var auth=require(_0xec54('0x3'));var interaction=require(_0xec54('0x4'));var config=require(_0xec54('0x5'));var controller=require('./intZendeskAccount.controller');router[_0xec54('0x6')]('/',auth['isAuthenticated'](),controller[_0xec54('0x7')]);router[_0xec54('0x6')](_0xec54('0x8'),auth[_0xec54('0x9')](),controller['show']);router[_0xec54('0x6')](_0xec54('0xa'),auth[_0xec54('0x9')](),controller[_0xec54('0xb')]);router['get'](_0xec54('0xc'),auth[_0xec54('0x9')](),controller['getFields']);router[_0xec54('0xd')]('/',auth[_0xec54('0x9')](),controller['create']);router[_0xec54('0xd')](_0xec54('0xa'),auth[_0xec54('0x9')](),controller['addConfiguration']);router[_0xec54('0xe')](_0xec54('0x8'),auth[_0xec54('0x9')](),controller[_0xec54('0xf')]);router[_0xec54('0x10')]('/:id',auth[_0xec54('0x9')](),controller['destroy']);module[_0xec54('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 570df1f..a5c2f8c 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.attributes.js +++ b/server/api/intZendeskAccount/intZendeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x708c=['ENUM','password','token','integrationTab','newTab','sequelize','STRING','username','remoteUri'];(function(_0x521ae8,_0x5d1b55){var _0x8c44a4=function(_0x1f602c){while(--_0x1f602c){_0x521ae8['push'](_0x521ae8['shift']());}};_0x8c44a4(++_0x5d1b55);}(_0x708c,0x9e));var _0xc708=function(_0x256901,_0x27e8ef){_0x256901=_0x256901-0x0;var _0x2621c4=_0x708c[_0x256901];return _0x2621c4;};'use strict';var Sequelize=require(_0xc708('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc708('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xc708('0x2')},'password':{'type':Sequelize[_0xc708('0x1')]},'token':{'type':Sequelize[_0xc708('0x1')]},'remoteUri':{'type':Sequelize[_0xc708('0x1')],'unique':_0xc708('0x3')},'authType':{'type':Sequelize[_0xc708('0x4')](_0xc708('0x5'),_0xc708('0x6')),'defaultValue':_0xc708('0x5')},'serverUrl':{'type':Sequelize[_0xc708('0x1')]},'type':{'type':Sequelize[_0xc708('0x4')](_0xc708('0x7'),_0xc708('0x8')),'defaultValue':_0xc708('0x7')}}; \ No newline at end of file +var _0x0459=['exports','STRING','username','remoteUri','ENUM','token','integrationTab','newTab','sequelize'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x0459,0x1c1));var _0x9045=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x0459[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0x9045('0x0'));module[_0x9045('0x1')]={'name':{'type':Sequelize[_0x9045('0x2')]},'description':{'type':Sequelize[_0x9045('0x2')]},'username':{'type':Sequelize[_0x9045('0x2')],'unique':_0x9045('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x9045('0x4')},'authType':{'type':Sequelize[_0x9045('0x5')]('password',_0x9045('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x9045('0x2')]},'type':{'type':Sequelize['ENUM'](_0x9045('0x7'),_0x9045('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 615ea19..d35f82b 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.controller.js +++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50ea=['ticket_fields','includes','position','system_field_options','custom_field_options','statusCode','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','request','then','info','request\x20sent','debug','stringify','error','message','ZendeskAccount,\x20%s,\x20%s','result','catch','status','end','count','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','field','ZendeskAccount','includeAll','include','findAll','rows','params','options','find','create','body','getConfigurations','findOne','ZendeskConfiguration','map','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','remoteUri','substring','GET','%s/%s','authType','headers','format','%s:%s','toString','Basic\x20%s','%s/token:%s','Sequelize','subject','description','group','assignee','remove'];(function(_0x4f9f80,_0x10d203){var _0x57131a=function(_0x411c0f){while(--_0x411c0f){_0x4f9f80['push'](_0x4f9f80['shift']());}};_0x57131a(++_0x10d203);}(_0x50ea,0xf7));var _0xa50e=function(_0xf2e4f3,_0x9773ba){_0xf2e4f3=_0xf2e4f3-0x0;var _0x294398=_0x50ea[_0xf2e4f3];return _0x294398;};'use strict';var pdf=require(_0xa50e('0x0'));var emlformat=require(_0xa50e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa50e('0x2'));var jsonpatch=require(_0xa50e('0x3'));var rp=require(_0xa50e('0x4'));var moment=require(_0xa50e('0x5'));var BPromise=require(_0xa50e('0x6'));var Mustache=require(_0xa50e('0x7'));var util=require(_0xa50e('0x8'));var path=require('path');var sox=require(_0xa50e('0x9'));var csv=require(_0xa50e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa50e('0xb'));var squel=require('squel');var crypto=require(_0xa50e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa50e('0xd'));var toCsv=require(_0xa50e('0xa'));var querystring=require('querystring');var Papa=require(_0xa50e('0xe'));var Redis=require(_0xa50e('0xf'));var authService=require(_0xa50e('0x10'));var qs=require(_0xa50e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa50e('0x12'));var config=require(_0xa50e('0x13'));var db=require(_0xa50e('0x14'))['db'];var integrations=require(_0xa50e('0x15'));var jayson=require(_0xa50e('0x16'));var client=jayson[_0xa50e('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x22e506,_0x4e975c,_0x10a03a){if(_0x10a03a){var _0x225963=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x225963[_0xa50e('0x18')](_0x4e975c)){return _0x22e506;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x22e506;}}function respondWithRpcPromise(_0x65545,_0x26540b,_0x37a23a,_0x10c56d){return new BPromise(function(_0x5dbdfc,_0x1c7bcb){var _0x21058c=_0x10c56d||client;return _0x21058c[_0xa50e('0x19')](_0x65545,_0x37a23a)[_0xa50e('0x1a')](function(_0x37f794){logger[_0xa50e('0x1b')]('ZendeskAccount,\x20%s,\x20%s',_0x26540b,_0xa50e('0x1c'));logger[_0xa50e('0x1d')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x26540b,_0xa50e('0x1c'),JSON[_0xa50e('0x1e')](_0x37f794));if(_0x37f794[_0xa50e('0x1f')]){if(_0x37f794[_0xa50e('0x1f')]['code']===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x26540b,_0x37f794[_0xa50e('0x1f')]['message']);return _0x1c7bcb(_0x37f794[_0xa50e('0x1f')][_0xa50e('0x20')]);}logger['error'](_0xa50e('0x21'),_0x26540b,_0x37f794[_0xa50e('0x1f')]['message']);return _0x5dbdfc(_0x37f794['error'][_0xa50e('0x20')]);}else{logger[_0xa50e('0x1b')](_0xa50e('0x21'),_0x26540b,_0xa50e('0x1c'));_0x5dbdfc(_0x37f794[_0xa50e('0x22')]['message']);}})[_0xa50e('0x23')](function(_0x226fe2){logger['error'](_0xa50e('0x21'),_0x26540b,_0x226fe2);_0x1c7bcb(_0x226fe2);});});}function respondWithStatusCode(_0x3f27d9,_0xba2b60){_0xba2b60=_0xba2b60||0xcc;return function(_0x3c4c0b){if(_0x3c4c0b){return _0x3f27d9['sendStatus'](_0xba2b60);}return _0x3f27d9[_0xa50e('0x24')](_0xba2b60)[_0xa50e('0x25')]();};}function respondWithResult(_0x194936,_0x5132d8){_0x5132d8=_0x5132d8||0xc8;return function(_0x219a55){if(_0x219a55){return _0x194936['status'](_0x5132d8)['json'](_0x219a55);}};}function respondWithFilteredResult(_0x410bdf,_0xa5d46b){return function(_0x3ec56b){if(_0x3ec56b){var _0x238c37=_0x3ec56b[_0xa50e('0x26')],_0x3b25dc=_0xa5d46b['offset'],_0x728637=_0xa5d46b[_0xa50e('0x27')]+_0xa5d46b['limit'],_0x338779;if(_0x728637>=_0x238c37){_0x728637=_0x238c37;_0x338779=0xc8;}else{_0x338779=0xce;}_0x410bdf[_0xa50e('0x24')](_0x338779);return _0x410bdf[_0xa50e('0x28')](_0xa50e('0x29'),_0x3b25dc+'-'+_0x728637+'/'+_0x238c37)['json'](_0x3ec56b);}return null;};}function patchUpdates(_0x2ed8ac){return function(_0x42fa76){try{jsonpatch[_0xa50e('0x2a')](_0x42fa76,_0x2ed8ac,!![]);}catch(_0x27db42){return BPromise[_0xa50e('0x2b')](_0x27db42);}return _0x42fa76[_0xa50e('0x2c')]();};}function saveUpdates(_0x4b40f5,_0x7cb384){return function(_0x46de0e){if(_0x46de0e){return _0x46de0e[_0xa50e('0x2d')](_0x4b40f5)['then'](function(_0xc122a5){return _0xc122a5;});}return null;};}function removeEntity(_0x5db5ac,_0xa7bbb5){return function(_0x4ad5a7){if(_0x4ad5a7){return _0x4ad5a7[_0xa50e('0x2e')]()[_0xa50e('0x1a')](function(){_0x5db5ac[_0xa50e('0x24')](0xcc)[_0xa50e('0x25')]();});}};}function handleEntityNotFound(_0x12501e,_0x2d4032){return function(_0x3aaad1){if(!_0x3aaad1){_0x12501e[_0xa50e('0x2f')](0x194);}return _0x3aaad1;};}function handleError(_0x58f361,_0x30f0ff){_0x30f0ff=_0x30f0ff||0x1f4;return function(_0x237165){logger[_0xa50e('0x1f')](_0x237165['stack']);if(_0x237165[_0xa50e('0x30')]){delete _0x237165['name'];}_0x58f361[_0xa50e('0x24')](_0x30f0ff)[_0xa50e('0x31')](_0x237165);};}exports[_0xa50e('0x32')]=function(_0x4230c5,_0x325d7f){var _0x24c472={},_0x59d93e={},_0x1e7a3b={'count':0x0,'rows':[]};var _0x3aa9c5=db['ZendeskAccount'][_0xa50e('0x33')];_0x59d93e[_0xa50e('0x34')]=_[_0xa50e('0x35')](_0x3aa9c5);_0x59d93e[_0xa50e('0x36')]=_['keys'](_0x4230c5[_0xa50e('0x36')]);_0x59d93e[_0xa50e('0x37')]=_[_0xa50e('0x38')](_0x59d93e[_0xa50e('0x34')],_0x59d93e[_0xa50e('0x36')]);_0x24c472['attributes']=_['intersection'](_0x59d93e[_0xa50e('0x34')],qs['fields'](_0x4230c5[_0xa50e('0x36')][_0xa50e('0x39')]));_0x24c472['attributes']=_0x24c472[_0xa50e('0x3a')][_0xa50e('0x3b')]?_0x24c472[_0xa50e('0x3a')]:_0x59d93e[_0xa50e('0x34')];if(!_0x4230c5[_0xa50e('0x36')][_0xa50e('0x3c')]('nolimit')){_0x24c472['limit']=qs[_0xa50e('0x3d')](_0x4230c5[_0xa50e('0x36')][_0xa50e('0x3d')]);_0x24c472[_0xa50e('0x27')]=qs[_0xa50e('0x27')](_0x4230c5['query'][_0xa50e('0x27')]);}_0x24c472[_0xa50e('0x3e')]=qs[_0xa50e('0x3f')](_0x4230c5[_0xa50e('0x36')][_0xa50e('0x3f')]);_0x24c472['where']=qs[_0xa50e('0x37')](_[_0xa50e('0x40')](_0x4230c5[_0xa50e('0x36')],_0x59d93e[_0xa50e('0x37')]));if(_0x4230c5[_0xa50e('0x36')][_0xa50e('0x41')]){_0x24c472[_0xa50e('0x42')]=_[_0xa50e('0x43')](_0x24c472[_0xa50e('0x42')],{'$or':_['map'](_0x3aa9c5,function(_0x274cc5){if(_0x274cc5[_0xa50e('0x44')]['key']!==_0xa50e('0x45')){var _0x58628f={};_0x58628f[_0x274cc5[_0xa50e('0x46')]]={'$like':'%'+_0x4230c5[_0xa50e('0x36')][_0xa50e('0x41')]+'%'};return _0x58628f;}})});}_0x24c472=_[_0xa50e('0x43')]({},_0x24c472,_0x4230c5['options']);var _0x2c2da4={'where':_0x24c472[_0xa50e('0x42')]};return db[_0xa50e('0x47')][_0xa50e('0x26')](_0x2c2da4)[_0xa50e('0x1a')](function(_0x493ad6){_0x1e7a3b[_0xa50e('0x26')]=_0x493ad6;if(_0x4230c5[_0xa50e('0x36')][_0xa50e('0x48')]){_0x24c472[_0xa50e('0x49')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xa50e('0x4a')](_0x24c472);})[_0xa50e('0x1a')](function(_0x41da63){_0x1e7a3b[_0xa50e('0x4b')]=_0x41da63;return _0x1e7a3b;})['then'](respondWithFilteredResult(_0x325d7f,_0x24c472))['catch'](handleError(_0x325d7f,null));};exports['show']=function(_0x2e16fd,_0x2cf2e0){var _0x244be3={'raw':![],'where':{'id':_0x2e16fd[_0xa50e('0x4c')]['id']}},_0x4750c6={};_0x4750c6['model']=_[_0xa50e('0x35')](db['ZendeskAccount'][_0xa50e('0x33')]);_0x4750c6[_0xa50e('0x36')]=_['keys'](_0x2e16fd[_0xa50e('0x36')]);_0x4750c6[_0xa50e('0x37')]=_['intersection'](_0x4750c6['model'],_0x4750c6[_0xa50e('0x36')]);_0x244be3[_0xa50e('0x3a')]=_[_0xa50e('0x38')](_0x4750c6[_0xa50e('0x34')],qs[_0xa50e('0x39')](_0x2e16fd[_0xa50e('0x36')]['fields']));_0x244be3['attributes']=_0x244be3[_0xa50e('0x3a')]['length']?_0x244be3['attributes']:_0x4750c6[_0xa50e('0x34')];if(_0x2e16fd[_0xa50e('0x36')][_0xa50e('0x48')]){_0x244be3['include']=[{'all':!![]}];}_0x244be3=_[_0xa50e('0x43')]({},_0x244be3,_0x2e16fd[_0xa50e('0x4d')]);return db['ZendeskAccount'][_0xa50e('0x4e')](_0x244be3)[_0xa50e('0x1a')](handleEntityNotFound(_0x2cf2e0,null))['then'](respondWithResult(_0x2cf2e0,null))[_0xa50e('0x23')](handleError(_0x2cf2e0,null));};exports[_0xa50e('0x4f')]=function(_0x508ae0,_0x4cbb1d){return db[_0xa50e('0x47')][_0xa50e('0x4f')](_0x508ae0[_0xa50e('0x50')],{})[_0xa50e('0x1a')](respondWithResult(_0x4cbb1d,0xc9))[_0xa50e('0x23')](handleError(_0x4cbb1d,null));};exports[_0xa50e('0x2d')]=function(_0x36fc75,_0xc60460){if(_0x36fc75[_0xa50e('0x50')]['id']){delete _0x36fc75[_0xa50e('0x50')]['id'];}return db[_0xa50e('0x47')]['find']({'where':{'id':_0x36fc75['params']['id']}})[_0xa50e('0x1a')](handleEntityNotFound(_0xc60460,null))[_0xa50e('0x1a')](saveUpdates(_0x36fc75[_0xa50e('0x50')],null))[_0xa50e('0x1a')](respondWithResult(_0xc60460,null))['catch'](handleError(_0xc60460,null));};exports[_0xa50e('0x2e')]=function(_0x4f2185,_0x2829b9){return db[_0xa50e('0x47')][_0xa50e('0x4e')]({'where':{'id':_0x4f2185[_0xa50e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2829b9,null))[_0xa50e('0x1a')](removeEntity(_0x2829b9,null))[_0xa50e('0x23')](handleError(_0x2829b9,null));};exports[_0xa50e('0x51')]=function(_0x25c923,_0x2669a3,_0x5756d0){var _0x46e894={};var _0x1e85f9={};var _0x1afc57;var _0x393adf;return db['ZendeskAccount'][_0xa50e('0x52')]({'where':{'id':_0x25c923[_0xa50e('0x4c')]['id']}})[_0xa50e('0x1a')](handleEntityNotFound(_0x2669a3,null))['then'](function(_0xde7d14){if(_0xde7d14){_0x1afc57=_0xde7d14;_0x1e85f9[_0xa50e('0x34')]=_['keys'](db[_0xa50e('0x53')][_0xa50e('0x33')]);_0x1e85f9[_0xa50e('0x36')]=_[_0xa50e('0x35')](_0x25c923[_0xa50e('0x36')]);_0x1e85f9[_0xa50e('0x37')]=_[_0xa50e('0x38')](_0x1e85f9[_0xa50e('0x34')],_0x1e85f9['query']);_0x46e894[_0xa50e('0x3a')]=_[_0xa50e('0x38')](_0x1e85f9[_0xa50e('0x34')],qs[_0xa50e('0x39')](_0x25c923[_0xa50e('0x36')][_0xa50e('0x39')]));_0x46e894[_0xa50e('0x3a')]=_0x46e894[_0xa50e('0x3a')][_0xa50e('0x3b')]?_0x46e894[_0xa50e('0x3a')]:_0x1e85f9[_0xa50e('0x34')];_0x46e894[_0xa50e('0x3e')]=qs[_0xa50e('0x3f')](_0x25c923['query'][_0xa50e('0x3f')]);_0x46e894[_0xa50e('0x42')]=qs['filters'](_[_0xa50e('0x40')](_0x25c923[_0xa50e('0x36')],_0x1e85f9['filters']));if(_0x25c923[_0xa50e('0x36')][_0xa50e('0x41')]){_0x46e894[_0xa50e('0x42')]=_[_0xa50e('0x43')](_0x46e894[_0xa50e('0x42')],{'$or':_[_0xa50e('0x54')](_0x46e894[_0xa50e('0x3a')],function(_0x5c56d0){var _0x55145f={};_0x55145f[_0x5c56d0]={'$like':'%'+_0x25c923[_0xa50e('0x36')][_0xa50e('0x41')]+'%'};return _0x55145f;})});}_0x46e894=_[_0xa50e('0x43')]({},_0x46e894,_0x25c923[_0xa50e('0x4d')]);return _0x1afc57['getConfigurations'](_0x46e894);}})[_0xa50e('0x1a')](function(_0x1b23a4){if(_0x1b23a4){_0x393adf=_0x1b23a4[_0xa50e('0x3b')];if(!_0x25c923[_0xa50e('0x36')][_0xa50e('0x3c')]('nolimit')){_0x46e894[_0xa50e('0x3d')]=qs[_0xa50e('0x3d')](_0x25c923[_0xa50e('0x36')]['limit']);_0x46e894[_0xa50e('0x27')]=qs[_0xa50e('0x27')](_0x25c923[_0xa50e('0x36')][_0xa50e('0x27')]);}return _0x1afc57[_0xa50e('0x51')](_0x46e894);}})[_0xa50e('0x1a')](function(_0x49d7f2){if(_0x49d7f2){return _0x49d7f2?{'count':_0x393adf,'rows':_0x49d7f2}:null;}})[_0xa50e('0x1a')](respondWithResult(_0x2669a3,null))['catch'](handleError(_0x2669a3,null));};exports[_0xa50e('0x55')]=function(_0x2c38d0,_0x884428,_0x5042a4){if(_0x2c38d0['body']['id']){delete _0x2c38d0[_0xa50e('0x50')]['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0x2c38d0[_0xa50e('0x4c')]['id']}})[_0xa50e('0x1a')](handleEntityNotFound(_0x884428,null))[_0xa50e('0x1a')](function(_0x3cfb5b){if(_0x3cfb5b){_0x2c38d0[_0xa50e('0x50')][_0xa50e('0x56')]=_0x3cfb5b['id'];_0x2c38d0[_0xa50e('0x50')][_0xa50e('0x57')]=integrations['getSubjects'](_0x2c38d0['body'][_0xa50e('0x58')],_0x2c38d0[_0xa50e('0x50')][_0xa50e('0x44')]);_0x2c38d0['body'][_0xa50e('0x59')]=integrations[_0xa50e('0x5a')](_0x2c38d0[_0xa50e('0x50')]['channel'],_0x2c38d0[_0xa50e('0x50')][_0xa50e('0x44')]);return db[_0xa50e('0x53')]['create'](_0x2c38d0['body'],{'include':[{'model':db[_0xa50e('0x5b')],'as':_0xa50e('0x57')},{'model':db[_0xa50e('0x5b')],'as':'Descriptions'}]});}return null;})[_0xa50e('0x1a')](respondWithResult(_0x884428,null))[_0xa50e('0x23')](handleError(_0x884428,null));};exports[_0xa50e('0x5c')]=function(_0x1acb17,_0x2fe7ea,_0x419b91){var _0x5886df='';return db[_0xa50e('0x47')][_0xa50e('0x52')]({'where':{'id':_0x1acb17[_0xa50e('0x4c')]['id']},'attributes':['id',_0xa50e('0x5d'),_0xa50e('0x5e'),_0xa50e('0x5f'),'authType',_0xa50e('0x60')]})[_0xa50e('0x1a')](handleEntityNotFound(_0x2fe7ea,null))[_0xa50e('0x1a')](function(_0x2aaaf4){if(_0x2aaaf4){_0x5886df=_0x2aaaf4[_0xa50e('0x60')];var _0x3f0c99=_0x5886df['slice'](-0x1);if(_0x3f0c99==='/'){_0x5886df=_0x5886df[_0xa50e('0x61')](0x0,_0x5886df['lastIndexOf'](_0x3f0c99));}var _0x5b3670={'method':_0xa50e('0x62'),'uri':util['format'](_0xa50e('0x63'),_0x5886df,'ticket_fields'),'json':!![]};switch(_0x2aaaf4[_0xa50e('0x64')]){case _0xa50e('0x5e'):_0x5b3670[_0xa50e('0x65')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xa50e('0x66')](_0xa50e('0x67'),_0x2aaaf4[_0xa50e('0x5d')],_0x2aaaf4[_0xa50e('0x5e')]))[_0xa50e('0x68')]('base64'))};break;case _0xa50e('0x5f'):_0x5b3670[_0xa50e('0x65')]={'Authorization':util[_0xa50e('0x66')](_0xa50e('0x69'),new Buffer(util[_0xa50e('0x66')](_0xa50e('0x6a'),_0x2aaaf4[_0xa50e('0x5d')],_0x2aaaf4[_0xa50e('0x5f')]))[_0xa50e('0x68')]('base64'))};break;default:throw new db[(_0xa50e('0x6b'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x5b3670);}})[_0xa50e('0x1a')](function(_0x4ff9cc){if(_0x4ff9cc){var _0x5d661a=[_0xa50e('0x6c'),_0xa50e('0x6d'),_0xa50e('0x6e'),_0xa50e('0x6f')];_[_0xa50e('0x70')](_0x4ff9cc[_0xa50e('0x71')],function(_0x535b86){return _0x5d661a[_0xa50e('0x72')](_0x535b86[_0xa50e('0x44')]);});return{'count':_0x4ff9cc[_0xa50e('0x71')]['length'],'rows':_['map'](_0x4ff9cc[_0xa50e('0x71')],function(_0x2c2130){return{'id':_0x2c2130['id'],'name':_0x2c2130[_0xa50e('0x73')]>0x7?_0x2c2130['title']:_0x2c2130[_0xa50e('0x44')],'custom':_0x2c2130[_0xa50e('0x73')]>0x7?!![]:![],'options':_0x2c2130[_0xa50e('0x74')]?_0x2c2130['system_field_options']:_0x2c2130[_0xa50e('0x75')]?_0x2c2130[_0xa50e('0x75')]:[]};})};}})[_0xa50e('0x1a')](respondWithResult(_0x2fe7ea,null))['catch'](function(_0xa6ee86){var _0x43b601=_0x1acb17['query'][_0xa50e('0x18')]?0x1f4:_0xa6ee86[_0xa50e('0x76')]||0x1f4;logger[_0xa50e('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0xa50e('0x5c'),_0x43b601,JSON[_0xa50e('0x1e')](_0xa6ee86));delete _0xa6ee86['name'];if(_0x43b601===0x191){_0x43b601=0x190;}_0x2fe7ea['status'](_0x43b601)[_0xa50e('0x31')](_0x1acb17[_0xa50e('0x36')][_0xa50e('0x18')]?{'message':_0xa50e('0x77'),'statusCode':_0xa6ee86['statusCode']}:_0xa6ee86);});}; \ No newline at end of file +var _0xf13a=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','map','type','VIRTUAL','field','filter','options','include','ZendeskAccount','findAll','rows','params','rawAttributes','includeAll','merge','find','create','body','getConfigurations','findOne','ZendeskConfiguration','order','addConfiguration','AccountId','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','authType','remoteUri','substring','lastIndexOf','GET','%s/%s','ticket_fields','password','headers','format','Basic\x20%s','%s:%s','toString','base64','token','%s/token:%s','Sequelize','ValidationError','subject','description','group','remove','includes','position','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','send','statusCode','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','index'];(function(_0x2679b0,_0x2a1a6f){var _0x192302=function(_0x258202){while(--_0x258202){_0x2679b0['push'](_0x2679b0['shift']());}};_0x192302(++_0x2a1a6f);}(_0xf13a,0x142));var _0xaf13=function(_0x3e2489,_0x41d9dd){_0x3e2489=_0x3e2489-0x0;var _0x2254ce=_0xf13a[_0x3e2489];return _0x2254ce;};'use strict';var pdf=require(_0xaf13('0x0'));var emlformat=require(_0xaf13('0x1'));var rimraf=require(_0xaf13('0x2'));var zipdir=require(_0xaf13('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf13('0x4'));var moment=require(_0xaf13('0x5'));var BPromise=require(_0xaf13('0x6'));var Mustache=require(_0xaf13('0x7'));var util=require('util');var path=require(_0xaf13('0x8'));var sox=require('sox');var csv=require(_0xaf13('0x9'));var ejs=require(_0xaf13('0xa'));var fs=require('fs');var _=require(_0xaf13('0xb'));var squel=require('squel');var crypto=require(_0xaf13('0xc'));var jsforce=require(_0xaf13('0xd'));var deskjs=require(_0xaf13('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaf13('0xf'));var Redis=require('ioredis');var authService=require(_0xaf13('0x10'));var qs=require(_0xaf13('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf13('0x12'))(_0xaf13('0x13'));var utils=require(_0xaf13('0x14'));var config=require(_0xaf13('0x15'));var db=require(_0xaf13('0x16'))['db'];var integrations=require(_0xaf13('0x17'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaf13('0x18')]({'port':0x232a});function checkPasswordPattern(_0x3b4a02,_0x34e8a1,_0xaeb191){if(_0xaeb191){var _0x43af38=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x43af38['test'](_0x34e8a1)){return _0x3b4a02;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3b4a02;}}function respondWithRpcPromise(_0x526306,_0x549b46,_0x5ead93,_0x2a69a6){return new BPromise(function(_0x20e5c9,_0x1d6451){var _0x5dea94=_0x2a69a6||client;return _0x5dea94[_0xaf13('0x19')](_0x526306,_0x5ead93)[_0xaf13('0x1a')](function(_0x2e6cde){logger[_0xaf13('0x1b')](_0xaf13('0x1c'),_0x549b46,_0xaf13('0x1d'));logger[_0xaf13('0x1e')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x549b46,_0xaf13('0x1d'),JSON[_0xaf13('0x1f')](_0x2e6cde));if(_0x2e6cde[_0xaf13('0x20')]){if(_0x2e6cde[_0xaf13('0x20')][_0xaf13('0x21')]===0x1f4){logger[_0xaf13('0x20')](_0xaf13('0x1c'),_0x549b46,_0x2e6cde[_0xaf13('0x20')][_0xaf13('0x22')]);return _0x1d6451(_0x2e6cde[_0xaf13('0x20')][_0xaf13('0x22')]);}logger['error'](_0xaf13('0x1c'),_0x549b46,_0x2e6cde[_0xaf13('0x20')][_0xaf13('0x22')]);return _0x20e5c9(_0x2e6cde[_0xaf13('0x20')][_0xaf13('0x22')]);}else{logger['info'](_0xaf13('0x1c'),_0x549b46,_0xaf13('0x1d'));_0x20e5c9(_0x2e6cde[_0xaf13('0x23')]['message']);}})[_0xaf13('0x24')](function(_0x3783b8){logger[_0xaf13('0x20')](_0xaf13('0x1c'),_0x549b46,_0x3783b8);_0x1d6451(_0x3783b8);});});}function respondWithStatusCode(_0x509960,_0xec13b0){_0xec13b0=_0xec13b0||0xcc;return function(_0x515a78){if(_0x515a78){return _0x509960[_0xaf13('0x25')](_0xec13b0);}return _0x509960['status'](_0xec13b0)[_0xaf13('0x26')]();};}function respondWithResult(_0x2ae7f9,_0x26a8ac){_0x26a8ac=_0x26a8ac||0xc8;return function(_0x596fd5){if(_0x596fd5){return _0x2ae7f9[_0xaf13('0x27')](_0x26a8ac)[_0xaf13('0x28')](_0x596fd5);}};}function respondWithFilteredResult(_0x4fad7f,_0x583e26){return function(_0x323827){if(_0x323827){var _0x237ebf=_0x323827[_0xaf13('0x29')],_0x28bef9=_0x583e26[_0xaf13('0x2a')],_0x451577=_0x583e26['offset']+_0x583e26[_0xaf13('0x2b')],_0x4a4946;if(_0x451577>=_0x237ebf){_0x451577=_0x237ebf;_0x4a4946=0xc8;}else{_0x4a4946=0xce;}_0x4fad7f['status'](_0x4a4946);return _0x4fad7f[_0xaf13('0x2c')](_0xaf13('0x2d'),_0x28bef9+'-'+_0x451577+'/'+_0x237ebf)['json'](_0x323827);}return null;};}function patchUpdates(_0x58b497){return function(_0x5aa5ad){try{jsonpatch[_0xaf13('0x2e')](_0x5aa5ad,_0x58b497,!![]);}catch(_0x38e664){return BPromise[_0xaf13('0x2f')](_0x38e664);}return _0x5aa5ad['save']();};}function saveUpdates(_0x1b215f,_0x58930d){return function(_0x2fdf57){if(_0x2fdf57){return _0x2fdf57[_0xaf13('0x30')](_0x1b215f)[_0xaf13('0x1a')](function(_0x47504b){return _0x47504b;});}return null;};}function removeEntity(_0x15a5c5,_0x425b14){return function(_0x4e6dd0){if(_0x4e6dd0){return _0x4e6dd0[_0xaf13('0x31')]()[_0xaf13('0x1a')](function(){_0x15a5c5[_0xaf13('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e9a98,_0x4fdee1){return function(_0x2f7c6a){if(!_0x2f7c6a){_0x4e9a98[_0xaf13('0x25')](0x194);}return _0x2f7c6a;};}function handleError(_0x4aa4df,_0x4786f8){_0x4786f8=_0x4786f8||0x1f4;return function(_0x5e7cb3){logger[_0xaf13('0x20')](_0x5e7cb3[_0xaf13('0x32')]);if(_0x5e7cb3[_0xaf13('0x33')]){delete _0x5e7cb3[_0xaf13('0x33')];}_0x4aa4df[_0xaf13('0x27')](_0x4786f8)['send'](_0x5e7cb3);};}exports[_0xaf13('0x34')]=function(_0x289041,_0x4532b1){var _0x9213c4={},_0xbea199={},_0x4437ff={'count':0x0,'rows':[]};var _0x29d3a2=db['ZendeskAccount']['rawAttributes'];_0xbea199[_0xaf13('0x35')]=_['keys'](_0x29d3a2);_0xbea199[_0xaf13('0x36')]=_[_0xaf13('0x37')](_0x289041[_0xaf13('0x36')]);_0xbea199[_0xaf13('0x38')]=_[_0xaf13('0x39')](_0xbea199[_0xaf13('0x35')],_0xbea199[_0xaf13('0x36')]);_0x9213c4['attributes']=_['intersection'](_0xbea199[_0xaf13('0x35')],qs[_0xaf13('0x3a')](_0x289041[_0xaf13('0x36')]['fields']));_0x9213c4[_0xaf13('0x3b')]=_0x9213c4['attributes'][_0xaf13('0x3c')]?_0x9213c4['attributes']:_0xbea199[_0xaf13('0x35')];if(!_0x289041[_0xaf13('0x36')][_0xaf13('0x3d')](_0xaf13('0x3e'))){_0x9213c4[_0xaf13('0x2b')]=qs[_0xaf13('0x2b')](_0x289041['query'][_0xaf13('0x2b')]);_0x9213c4[_0xaf13('0x2a')]=qs['offset'](_0x289041[_0xaf13('0x36')]['offset']);}_0x9213c4['order']=qs[_0xaf13('0x3f')](_0x289041[_0xaf13('0x36')]['sort']);_0x9213c4[_0xaf13('0x40')]=qs[_0xaf13('0x38')](_[_0xaf13('0x41')](_0x289041[_0xaf13('0x36')],_0xbea199['filters']));if(_0x289041[_0xaf13('0x36')]['filter']){_0x9213c4[_0xaf13('0x40')]=_['merge'](_0x9213c4[_0xaf13('0x40')],{'$or':_[_0xaf13('0x42')](_0x29d3a2,function(_0x4511fd){if(_0x4511fd[_0xaf13('0x43')]['key']!==_0xaf13('0x44')){var _0x2e77f1={};_0x2e77f1[_0x4511fd[_0xaf13('0x45')]]={'$like':'%'+_0x289041[_0xaf13('0x36')][_0xaf13('0x46')]+'%'};return _0x2e77f1;}})});}_0x9213c4=_['merge']({},_0x9213c4,_0x289041[_0xaf13('0x47')]);var _0xba6e19={'where':_0x9213c4['where']};return db['ZendeskAccount'][_0xaf13('0x29')](_0xba6e19)['then'](function(_0x553c02){_0x4437ff[_0xaf13('0x29')]=_0x553c02;if(_0x289041[_0xaf13('0x36')]['includeAll']){_0x9213c4[_0xaf13('0x48')]=[{'all':!![]}];}return db[_0xaf13('0x49')][_0xaf13('0x4a')](_0x9213c4);})[_0xaf13('0x1a')](function(_0x32c13b){_0x4437ff[_0xaf13('0x4b')]=_0x32c13b;return _0x4437ff;})[_0xaf13('0x1a')](respondWithFilteredResult(_0x4532b1,_0x9213c4))[_0xaf13('0x24')](handleError(_0x4532b1,null));};exports['show']=function(_0x5f0d46,_0x4b1527){var _0x47596d={'raw':![],'where':{'id':_0x5f0d46[_0xaf13('0x4c')]['id']}},_0xfafd44={};_0xfafd44[_0xaf13('0x35')]=_['keys'](db[_0xaf13('0x49')][_0xaf13('0x4d')]);_0xfafd44[_0xaf13('0x36')]=_['keys'](_0x5f0d46[_0xaf13('0x36')]);_0xfafd44['filters']=_[_0xaf13('0x39')](_0xfafd44[_0xaf13('0x35')],_0xfafd44['query']);_0x47596d[_0xaf13('0x3b')]=_[_0xaf13('0x39')](_0xfafd44[_0xaf13('0x35')],qs[_0xaf13('0x3a')](_0x5f0d46[_0xaf13('0x36')][_0xaf13('0x3a')]));_0x47596d[_0xaf13('0x3b')]=_0x47596d[_0xaf13('0x3b')][_0xaf13('0x3c')]?_0x47596d[_0xaf13('0x3b')]:_0xfafd44['model'];if(_0x5f0d46[_0xaf13('0x36')][_0xaf13('0x4e')]){_0x47596d['include']=[{'all':!![]}];}_0x47596d=_[_0xaf13('0x4f')]({},_0x47596d,_0x5f0d46['options']);return db[_0xaf13('0x49')][_0xaf13('0x50')](_0x47596d)[_0xaf13('0x1a')](handleEntityNotFound(_0x4b1527,null))['then'](respondWithResult(_0x4b1527,null))[_0xaf13('0x24')](handleError(_0x4b1527,null));};exports[_0xaf13('0x51')]=function(_0x23ff81,_0x143889){return db[_0xaf13('0x49')][_0xaf13('0x51')](_0x23ff81['body'],{})[_0xaf13('0x1a')](respondWithResult(_0x143889,0xc9))[_0xaf13('0x24')](handleError(_0x143889,null));};exports[_0xaf13('0x30')]=function(_0x4dee6c,_0x5c00aa){if(_0x4dee6c[_0xaf13('0x52')]['id']){delete _0x4dee6c[_0xaf13('0x52')]['id'];}return db['ZendeskAccount'][_0xaf13('0x50')]({'where':{'id':_0x4dee6c['params']['id']}})['then'](handleEntityNotFound(_0x5c00aa,null))[_0xaf13('0x1a')](saveUpdates(_0x4dee6c[_0xaf13('0x52')],null))[_0xaf13('0x1a')](respondWithResult(_0x5c00aa,null))[_0xaf13('0x24')](handleError(_0x5c00aa,null));};exports[_0xaf13('0x31')]=function(_0x3227bc,_0x6270cd){return db[_0xaf13('0x49')][_0xaf13('0x50')]({'where':{'id':_0x3227bc[_0xaf13('0x4c')]['id']}})['then'](handleEntityNotFound(_0x6270cd,null))[_0xaf13('0x1a')](removeEntity(_0x6270cd,null))[_0xaf13('0x24')](handleError(_0x6270cd,null));};exports[_0xaf13('0x53')]=function(_0x457e82,_0x3eac58,_0x140fdb){var _0x1c2f4f={};var _0x13cabd={};var _0x73798b;var _0x4d376c;return db[_0xaf13('0x49')][_0xaf13('0x54')]({'where':{'id':_0x457e82[_0xaf13('0x4c')]['id']}})[_0xaf13('0x1a')](handleEntityNotFound(_0x3eac58,null))[_0xaf13('0x1a')](function(_0x331d30){if(_0x331d30){_0x73798b=_0x331d30;_0x13cabd[_0xaf13('0x35')]=_[_0xaf13('0x37')](db[_0xaf13('0x55')]['rawAttributes']);_0x13cabd[_0xaf13('0x36')]=_[_0xaf13('0x37')](_0x457e82['query']);_0x13cabd[_0xaf13('0x38')]=_['intersection'](_0x13cabd[_0xaf13('0x35')],_0x13cabd['query']);_0x1c2f4f[_0xaf13('0x3b')]=_[_0xaf13('0x39')](_0x13cabd[_0xaf13('0x35')],qs[_0xaf13('0x3a')](_0x457e82[_0xaf13('0x36')][_0xaf13('0x3a')]));_0x1c2f4f[_0xaf13('0x3b')]=_0x1c2f4f[_0xaf13('0x3b')][_0xaf13('0x3c')]?_0x1c2f4f[_0xaf13('0x3b')]:_0x13cabd[_0xaf13('0x35')];_0x1c2f4f[_0xaf13('0x56')]=qs[_0xaf13('0x3f')](_0x457e82[_0xaf13('0x36')][_0xaf13('0x3f')]);_0x1c2f4f[_0xaf13('0x40')]=qs['filters'](_['pick'](_0x457e82[_0xaf13('0x36')],_0x13cabd[_0xaf13('0x38')]));if(_0x457e82['query']['filter']){_0x1c2f4f[_0xaf13('0x40')]=_['merge'](_0x1c2f4f[_0xaf13('0x40')],{'$or':_['map'](_0x1c2f4f[_0xaf13('0x3b')],function(_0x414d72){var _0x5de4b6={};_0x5de4b6[_0x414d72]={'$like':'%'+_0x457e82[_0xaf13('0x36')][_0xaf13('0x46')]+'%'};return _0x5de4b6;})});}_0x1c2f4f=_['merge']({},_0x1c2f4f,_0x457e82[_0xaf13('0x47')]);return _0x73798b[_0xaf13('0x53')](_0x1c2f4f);}})[_0xaf13('0x1a')](function(_0x3d4ef4){if(_0x3d4ef4){_0x4d376c=_0x3d4ef4[_0xaf13('0x3c')];if(!_0x457e82[_0xaf13('0x36')]['hasOwnProperty'](_0xaf13('0x3e'))){_0x1c2f4f[_0xaf13('0x2b')]=qs[_0xaf13('0x2b')](_0x457e82[_0xaf13('0x36')][_0xaf13('0x2b')]);_0x1c2f4f['offset']=qs['offset'](_0x457e82[_0xaf13('0x36')][_0xaf13('0x2a')]);}return _0x73798b[_0xaf13('0x53')](_0x1c2f4f);}})['then'](function(_0x453137){if(_0x453137){return _0x453137?{'count':_0x4d376c,'rows':_0x453137}:null;}})[_0xaf13('0x1a')](respondWithResult(_0x3eac58,null))['catch'](handleError(_0x3eac58,null));};exports[_0xaf13('0x57')]=function(_0xbf1e32,_0x4b3ff7,_0x4434f7){if(_0xbf1e32['body']['id']){delete _0xbf1e32[_0xaf13('0x52')]['id'];}return db[_0xaf13('0x49')]['findOne']({'where':{'id':_0xbf1e32[_0xaf13('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4b3ff7,null))[_0xaf13('0x1a')](function(_0xf203a1){if(_0xf203a1){_0xbf1e32['body'][_0xaf13('0x58')]=_0xf203a1['id'];_0xbf1e32[_0xaf13('0x52')]['Subjects']=integrations['getSubjects'](_0xbf1e32[_0xaf13('0x52')][_0xaf13('0x59')],_0xbf1e32[_0xaf13('0x52')][_0xaf13('0x43')]);_0xbf1e32[_0xaf13('0x52')][_0xaf13('0x5a')]=integrations[_0xaf13('0x5b')](_0xbf1e32[_0xaf13('0x52')][_0xaf13('0x59')],_0xbf1e32[_0xaf13('0x52')][_0xaf13('0x43')]);return db[_0xaf13('0x55')][_0xaf13('0x51')](_0xbf1e32[_0xaf13('0x52')],{'include':[{'model':db[_0xaf13('0x5c')],'as':'Subjects'},{'model':db[_0xaf13('0x5c')],'as':_0xaf13('0x5a')}]});}return null;})[_0xaf13('0x1a')](respondWithResult(_0x4b3ff7,null))['catch'](handleError(_0x4b3ff7,null));};exports[_0xaf13('0x5d')]=function(_0x348ebb,_0x5352d1,_0x101fa9){var _0x3849a0='';return db[_0xaf13('0x49')][_0xaf13('0x54')]({'where':{'id':_0x348ebb[_0xaf13('0x4c')]['id']},'attributes':['id',_0xaf13('0x5e'),'password','token',_0xaf13('0x5f'),_0xaf13('0x60')]})[_0xaf13('0x1a')](handleEntityNotFound(_0x5352d1,null))[_0xaf13('0x1a')](function(_0x210604){if(_0x210604){_0x3849a0=_0x210604[_0xaf13('0x60')];var _0x34902e=_0x3849a0['slice'](-0x1);if(_0x34902e==='/'){_0x3849a0=_0x3849a0[_0xaf13('0x61')](0x0,_0x3849a0[_0xaf13('0x62')](_0x34902e));}var _0x268e95={'method':_0xaf13('0x63'),'uri':util['format'](_0xaf13('0x64'),_0x3849a0,_0xaf13('0x65')),'json':!![]};switch(_0x210604[_0xaf13('0x5f')]){case _0xaf13('0x66'):_0x268e95[_0xaf13('0x67')]={'Authorization':util[_0xaf13('0x68')](_0xaf13('0x69'),new Buffer(util[_0xaf13('0x68')](_0xaf13('0x6a'),_0x210604[_0xaf13('0x5e')],_0x210604['password']))[_0xaf13('0x6b')](_0xaf13('0x6c')))};break;case _0xaf13('0x6d'):_0x268e95[_0xaf13('0x67')]={'Authorization':util[_0xaf13('0x68')](_0xaf13('0x69'),new Buffer(util[_0xaf13('0x68')](_0xaf13('0x6e'),_0x210604[_0xaf13('0x5e')],_0x210604[_0xaf13('0x6d')]))[_0xaf13('0x6b')](_0xaf13('0x6c')))};break;default:throw new db[(_0xaf13('0x6f'))][(_0xaf13('0x70'))]('Unknown\x20authentication\x20type');}return rp(_0x268e95);}})['then'](function(_0x45dcc2){if(_0x45dcc2){var _0xdec166=[_0xaf13('0x71'),_0xaf13('0x72'),_0xaf13('0x73'),'assignee'];_[_0xaf13('0x74')](_0x45dcc2[_0xaf13('0x65')],function(_0xf5635){return _0xdec166[_0xaf13('0x75')](_0xf5635[_0xaf13('0x43')]);});return{'count':_0x45dcc2[_0xaf13('0x65')][_0xaf13('0x3c')],'rows':_['map'](_0x45dcc2[_0xaf13('0x65')],function(_0xb8db51){return{'id':_0xb8db51['id'],'name':_0xb8db51[_0xaf13('0x76')]>0x7?_0xb8db51['title']:_0xb8db51[_0xaf13('0x43')],'custom':_0xb8db51['position']>0x7?!![]:![],'options':_0xb8db51[_0xaf13('0x77')]?_0xb8db51[_0xaf13('0x77')]:_0xb8db51[_0xaf13('0x78')]?_0xb8db51[_0xaf13('0x78')]:[]};})};}})[_0xaf13('0x1a')](respondWithResult(_0x5352d1,null))[_0xaf13('0x24')](function(_0x42bf79){var _0x1ee5e5=_0x348ebb[_0xaf13('0x36')][_0xaf13('0x79')]?0x1f4:_0x42bf79['statusCode']||0x1f4;logger['error'](_0xaf13('0x7a'),_0xaf13('0x5d'),_0x1ee5e5,JSON['stringify'](_0x42bf79));delete _0x42bf79[_0xaf13('0x33')];if(_0x1ee5e5===0x191){_0x1ee5e5=0x190;}_0x5352d1['status'](_0x1ee5e5)[_0xaf13('0x7b')](_0x348ebb['query'][_0xaf13('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x42bf79[_0xaf13('0x7c')]}:_0x42bf79);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index d10171d..5e13b66 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.model.js +++ b/server/api/intZendeskAccount/intZendeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed17=['../../config/environment','./intZendeskAccount.attributes','define','int_zendesk_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x94e417,_0x469020){var _0x271fec=function(_0x1c2152){while(--_0x1c2152){_0x94e417['push'](_0x94e417['shift']());}};_0x271fec(++_0x469020);}(_0xed17,0x122));var _0x7ed1=function(_0x245d40,_0x455ece){_0x245d40=_0x245d40-0x0;var _0x245534=_0xed17[_0x245d40];return _0x245534;};'use strict';var _=require(_0x7ed1('0x0'));var util=require(_0x7ed1('0x1'));var logger=require(_0x7ed1('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7ed1('0x3'));var rp=require(_0x7ed1('0x4'));var fs=require('fs');var path=require(_0x7ed1('0x5'));var rimraf=require(_0x7ed1('0x6'));var config=require(_0x7ed1('0x7'));var attributes=require(_0x7ed1('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x121661,_0x26eb43){return _0x121661[_0x7ed1('0x9')]('ZendeskAccount',attributes,{'tableName':_0x7ed1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x395d=['ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intZendeskAccount.attributes'];(function(_0x6d3600,_0xd2b6a6){var _0x5a0da3=function(_0x42bc31){while(--_0x42bc31){_0x6d3600['push'](_0x6d3600['shift']());}};_0x5a0da3(++_0xd2b6a6);}(_0x395d,0x115));var _0xd395=function(_0x2f578b,_0x2da002){_0x2f578b=_0x2f578b-0x0;var _0x2f0224=_0x395d[_0x2f578b];return _0x2f0224;};'use strict';var _=require(_0xd395('0x0'));var util=require(_0xd395('0x1'));var logger=require(_0xd395('0x2'))(_0xd395('0x3'));var moment=require(_0xd395('0x4'));var BPromise=require(_0xd395('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd395('0x6'));var rimraf=require(_0xd395('0x7'));var config=require('../../config/environment');var attributes=require(_0xd395('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x174806,_0x1873ee){return _0x174806['define'](_0xd395('0x9'),attributes,{'tableName':_0xd395('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 4861924..9e3e997 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js +++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['raw','where','include','map','model','attributes','ShowZendeskAccount','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','options'];(function(_0x582df0,_0x82017b){var _0x410fb7=function(_0x4ef699){while(--_0x4ef699){_0x582df0['push'](_0x582df0['shift']());}};_0x410fb7(++_0x82017b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['findAll']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'limit':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['limit']||null:null,'include':_0x5fecbd['options']?_0x5fecbd['options'][_0x0d8b('0x1b')]?_[_0x0d8b('0x1c')](_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1b')],function(_0x221071){return{'model':db[_0x221071[_0x0d8b('0x1d')]],'as':_0x221071['as'],'attributes':_0x221071[_0x0d8b('0x1e')],'include':_0x221071[_0x0d8b('0x1b')]?_[_0x0d8b('0x1c')](_0x221071['include'],function(_0xe8bbee){return{'model':db[_0xe8bbee[_0x0d8b('0x1d')]],'as':_0xe8bbee['as'],'attributes':_0xe8bbee['attributes'],'include':_0xe8bbee[_0x0d8b('0x1b')]?_['map'](_0xe8bbee[_0x0d8b('0x1b')],function(_0x234bdd){return{'model':db[_0x234bdd[_0x0d8b('0x1d')]],'as':_0x234bdd['as'],'attributes':_0x234bdd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x28f639){logger[_0x0d8b('0xb')]('GetZendeskAccount',_0x5fecbd);logger[_0x0d8b('0xe')]('GetZendeskAccount',_0x5fecbd,JSON[_0x0d8b('0x10')](_0x28f639));_0x18dd2d(_0x28f639);})['catch'](function(_0x97050a){logger['error'](_0x0d8b('0x16'),_0x97050a['message'],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x97050a['message']));});});};exports[_0x0d8b('0x1f')]=function(_0x106e4c){var _0x2c058d=this;return new Promise(function(_0x56120a,_0x4c80a2){return db['ZendeskAccount'][_0x0d8b('0x20')]({'raw':_0x106e4c['options']?_0x106e4c[_0x0d8b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x106e4c['options']?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x106e4c[_0x0d8b('0x18')]?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1e')]||null:null,'include':_0x106e4c[_0x0d8b('0x18')]?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1b')]?_['map'](_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1b')],function(_0x4b3ea0){return{'model':db[_0x4b3ea0[_0x0d8b('0x1d')]],'as':_0x4b3ea0['as'],'attributes':_0x4b3ea0[_0x0d8b('0x1e')],'include':_0x4b3ea0[_0x0d8b('0x1b')]?_['map'](_0x4b3ea0[_0x0d8b('0x1b')],function(_0x2c507e){return{'model':db[_0x2c507e[_0x0d8b('0x1d')]],'as':_0x2c507e['as'],'attributes':_0x2c507e[_0x0d8b('0x1e')],'include':_0x2c507e[_0x0d8b('0x1b')]?_['map'](_0x2c507e[_0x0d8b('0x1b')],function(_0x1649fc){return{'model':db[_0x1649fc['model']],'as':_0x1649fc['as'],'attributes':_0x1649fc[_0x0d8b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0x188af2){logger[_0x0d8b('0xb')](_0x0d8b('0x1f'),_0x106e4c);logger['debug']('ShowZendeskAccount',_0x106e4c,JSON[_0x0d8b('0x10')](_0x188af2));_0x56120a(_0x188af2);})['catch'](function(_0x531c55){logger[_0x0d8b('0x11')](_0x0d8b('0x1f'),_0x531c55[_0x0d8b('0x13')],_0x106e4c);_0x4c80a2(_0x2c058d[_0x0d8b('0x11')](0x1f4,_0x531c55[_0x0d8b('0x13')]));});});}; \ No newline at end of file +var _0xbaf0=['ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','model','map','ShowZendeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')]({'raw':_0x53c338[_0x0baf('0x19')]?_0x53c338['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'limit':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1c')]||null:null,'include':_0x53c338[_0x0baf('0x19')]?_0x53c338['options'][_0x0baf('0x1d')]?_['map'](_0x53c338[_0x0baf('0x19')]['include'],function(_0x4de74c){return{'model':db[_0x4de74c[_0x0baf('0x1e')]],'as':_0x4de74c['as'],'attributes':_0x4de74c['attributes'],'include':_0x4de74c['include']?_[_0x0baf('0x1f')](_0x4de74c[_0x0baf('0x1d')],function(_0x34e264){return{'model':db[_0x34e264[_0x0baf('0x1e')]],'as':_0x34e264['as'],'attributes':_0x34e264[_0x0baf('0x1b')],'include':_0x34e264['include']?_[_0x0baf('0x1f')](_0x34e264[_0x0baf('0x1d')],function(_0x1ca35a){return{'model':db[_0x1ca35a[_0x0baf('0x1e')]],'as':_0x1ca35a['as'],'attributes':_0x1ca35a[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x453525){logger['info'](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x453525));_0xfbecec(_0x453525);})['catch'](function(_0x29dbdf){logger[_0x0baf('0x13')]('GetZendeskAccount',_0x29dbdf[_0x0baf('0x14')],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x29dbdf[_0x0baf('0x14')]));});});};exports[_0x0baf('0x20')]=function(_0xd14f0f){var _0x366924=this;return new Promise(function(_0x213a6a,_0x57476f){return db[_0x0baf('0x17')][_0x0baf('0x21')]({'raw':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x22')]===undefined?!![]:![]:!![],'where':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'include':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1d')]?_['map'](_0xd14f0f[_0x0baf('0x19')]['include'],function(_0x1aa474){return{'model':db[_0x1aa474[_0x0baf('0x1e')]],'as':_0x1aa474['as'],'attributes':_0x1aa474[_0x0baf('0x1b')],'include':_0x1aa474[_0x0baf('0x1d')]?_['map'](_0x1aa474[_0x0baf('0x1d')],function(_0x1d6575){return{'model':db[_0x1d6575['model']],'as':_0x1d6575['as'],'attributes':_0x1d6575[_0x0baf('0x1b')],'include':_0x1d6575[_0x0baf('0x1d')]?_[_0x0baf('0x1f')](_0x1d6575[_0x0baf('0x1d')],function(_0x1f60bd){return{'model':db[_0x1f60bd[_0x0baf('0x1e')]],'as':_0x1f60bd['as'],'attributes':_0x1f60bd[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x4aa6ed){logger[_0x0baf('0xd')](_0x0baf('0x20'),_0xd14f0f);logger['debug'](_0x0baf('0x20'),_0xd14f0f,JSON['stringify'](_0x4aa6ed));_0x213a6a(_0x4aa6ed);})['catch'](function(_0x11bc49){logger[_0x0baf('0x13')]('ShowZendeskAccount',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 6045d38..80afbd0 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b6b=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','show','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','multer','util'];(function(_0x384d0b,_0x595399){var _0x246b6f=function(_0x21ec54){while(--_0x21ec54){_0x384d0b['push'](_0x384d0b['shift']());}};_0x246b6f(++_0x595399);}(_0x5b6b,0x127));var _0xb5b6=function(_0x161c97,_0x1775cb){_0x161c97=_0x161c97-0x0;var _0x305962=_0x5b6b[_0x161c97];return _0x305962;};'use strict';var multer=require(_0xb5b6('0x0'));var util=require(_0xb5b6('0x1'));var path=require(_0xb5b6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb5b6('0x3')]();var auth=require(_0xb5b6('0x4'));var interaction=require(_0xb5b6('0x5'));var config=require(_0xb5b6('0x6'));var controller=require(_0xb5b6('0x7'));router[_0xb5b6('0x8')]('/',auth['isAuthenticated'](),controller[_0xb5b6('0x9')]);router[_0xb5b6('0x8')](_0xb5b6('0xa'),auth['isAuthenticated'](),controller[_0xb5b6('0xb')]);router[_0xb5b6('0x8')]('/:id/fields',auth[_0xb5b6('0xc')](),controller[_0xb5b6('0xd')]);router[_0xb5b6('0x8')](_0xb5b6('0xe'),auth[_0xb5b6('0xc')](),controller[_0xb5b6('0xf')]);router[_0xb5b6('0x8')](_0xb5b6('0x10'),auth[_0xb5b6('0xc')](),controller[_0xb5b6('0x11')]);router[_0xb5b6('0x8')](_0xb5b6('0x12'),auth[_0xb5b6('0xc')](),controller[_0xb5b6('0x13')]);router[_0xb5b6('0x14')]('/',auth[_0xb5b6('0xc')](),controller[_0xb5b6('0x15')]);router['post'](_0xb5b6('0x12'),auth[_0xb5b6('0xc')](),controller[_0xb5b6('0x16')]);router[_0xb5b6('0x17')](_0xb5b6('0xa'),auth[_0xb5b6('0xc')](),controller[_0xb5b6('0x18')]);router[_0xb5b6('0x19')]('/:id',auth[_0xb5b6('0xc')](),controller[_0xb5b6('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x029a=['delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','/:id','isAuthenticated','show','get','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update'];(function(_0x321467,_0x33bdec){var _0x68c483=function(_0x2a1171){while(--_0x2a1171){_0x321467['push'](_0x321467['shift']());}};_0x68c483(++_0x33bdec);}(_0x029a,0xa2));var _0xa029=function(_0x4fa40c,_0xfde1e3){_0x4fa40c=_0x4fa40c-0x0;var _0x54697f=_0x029a[_0x4fa40c];return _0x54697f;};'use strict';var multer=require('multer');var util=require(_0xa029('0x0'));var path=require(_0xa029('0x1'));var timeout=require('connect-timeout');var express=require(_0xa029('0x2'));var router=express[_0xa029('0x3')]();var auth=require(_0xa029('0x4'));var interaction=require(_0xa029('0x5'));var config=require('../../config/environment');var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa029('0x6'),auth[_0xa029('0x7')](),controller[_0xa029('0x8')]);router[_0xa029('0x9')]('/:id/fields',auth[_0xa029('0x7')](),controller[_0xa029('0xa')]);router[_0xa029('0x9')](_0xa029('0xb'),auth[_0xa029('0x7')](),controller[_0xa029('0xc')]);router[_0xa029('0x9')]('/:id/descriptions',auth[_0xa029('0x7')](),controller[_0xa029('0xd')]);router[_0xa029('0x9')]('/:id/tags',auth[_0xa029('0x7')](),controller['getTags']);router[_0xa029('0xe')]('/',auth['isAuthenticated'](),controller[_0xa029('0xf')]);router[_0xa029('0xe')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xa029('0x10')](_0xa029('0x6'),auth[_0xa029('0x7')](),controller[_0xa029('0x11')]);router[_0xa029('0x12')](_0xa029('0x6'),auth['isAuthenticated'](),controller['destroy']);module[_0xa029('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index e3f99a4..412cb2a 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60ce=['STRING'];(function(_0x5acb98,_0x296209){var _0x5684ce=function(_0x3e57ee){while(--_0x3e57ee){_0x5acb98['push'](_0x5acb98['shift']());}};_0x5684ce(++_0x296209);}(_0x60ce,0xa9));var _0xe60c=function(_0x4bd235,_0x3bd415){_0x4bd235=_0x4bd235-0x0;var _0x630937=_0x60ce[_0x4bd235];return _0x630937;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe60c('0x0')]},'description':{'type':Sequelize[_0xe60c('0x0')]}}; \ No newline at end of file +var _0xd17b=['sequelize','exports','STRING'];(function(_0xa622be,_0x2ec405){var _0x281996=function(_0x5a7852){while(--_0x5a7852){_0xa622be['push'](_0xa622be['shift']());}};_0x281996(++_0x2ec405);}(_0xd17b,0x1d4));var _0xbd17=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0xd17b[_0x1d9163];return _0xb42197;};'use strict';var Sequelize=require(_0xbd17('0x0'));module[_0xbd17('0x1')]={'name':{'type':Sequelize[_0xbd17('0x2')]},'description':{'type':Sequelize[_0xbd17('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 7c481db..8c029db 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9348=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','stack','name','send','index','ZendeskConfiguration','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','show','params','options','find','create','body','destroy','getFields','findOne','ZendeskField','getSubjects','order','nolimit','getDescriptions','getTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js'];(function(_0x188648,_0x4aeb20){var _0x3d017a=function(_0x178dee){while(--_0x178dee){_0x188648['push'](_0x188648['shift']());}};_0x3d017a(++_0x4aeb20);}(_0x9348,0x10d));var _0x8934=function(_0xda8a,_0x564081){_0xda8a=_0xda8a-0x0;var _0x4ad481=_0x9348[_0xda8a];return _0x4ad481;};'use strict';var pdf=require(_0x8934('0x0'));var emlformat=require(_0x8934('0x1'));var rimraf=require(_0x8934('0x2'));var zipdir=require(_0x8934('0x3'));var jsonpatch=require(_0x8934('0x4'));var rp=require('request-promise');var moment=require(_0x8934('0x5'));var BPromise=require(_0x8934('0x6'));var Mustache=require('mustache');var util=require(_0x8934('0x7'));var path=require(_0x8934('0x8'));var sox=require(_0x8934('0x9'));var csv=require(_0x8934('0xa'));var ejs=require(_0x8934('0xb'));var fs=require('fs');var _=require(_0x8934('0xc'));var squel=require('squel');var crypto=require(_0x8934('0xd'));var jsforce=require(_0x8934('0xe'));var deskjs=require(_0x8934('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8934('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8934('0x11'));var logger=require(_0x8934('0x12'))(_0x8934('0x13'));var utils=require(_0x8934('0x14'));var config=require(_0x8934('0x15'));var db=require(_0x8934('0x16'))['db'];var jayson=require(_0x8934('0x17'));var client=jayson[_0x8934('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x68427d,_0x108eab,_0x46bca5){if(_0x46bca5){var _0x1906d0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1906d0[_0x8934('0x19')](_0x108eab)){return _0x68427d;}else{throw new Error(_0x8934('0x1a'));}}else{return _0x68427d;}}function respondWithRpcPromise(_0x5b560f,_0x254720,_0x38230a,_0xdfc97c){return new BPromise(function(_0x94b948,_0x34d4dc){var _0x41e6a9=_0xdfc97c||client;return _0x41e6a9[_0x8934('0x1b')](_0x5b560f,_0x38230a)[_0x8934('0x1c')](function(_0x52de6a){logger[_0x8934('0x1d')](_0x8934('0x1e'),_0x254720,_0x8934('0x1f'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x254720,'request\x20sent',JSON[_0x8934('0x20')](_0x52de6a));if(_0x52de6a['error']){if(_0x52de6a[_0x8934('0x21')][_0x8934('0x22')]===0x1f4){logger[_0x8934('0x21')](_0x8934('0x1e'),_0x254720,_0x52de6a[_0x8934('0x21')]['message']);return _0x34d4dc(_0x52de6a[_0x8934('0x21')]['message']);}logger[_0x8934('0x21')](_0x8934('0x1e'),_0x254720,_0x52de6a[_0x8934('0x21')][_0x8934('0x23')]);return _0x94b948(_0x52de6a[_0x8934('0x21')][_0x8934('0x23')]);}else{logger[_0x8934('0x1d')]('ZendeskConfiguration,\x20%s,\x20%s',_0x254720,_0x8934('0x1f'));_0x94b948(_0x52de6a[_0x8934('0x24')][_0x8934('0x23')]);}})[_0x8934('0x25')](function(_0x43b89a){logger['error'](_0x8934('0x1e'),_0x254720,_0x43b89a);_0x34d4dc(_0x43b89a);});});}function respondWithStatusCode(_0x1c15c5,_0x1b5775){_0x1b5775=_0x1b5775||0xcc;return function(_0x50ceda){if(_0x50ceda){return _0x1c15c5[_0x8934('0x26')](_0x1b5775);}return _0x1c15c5['status'](_0x1b5775)[_0x8934('0x27')]();};}function respondWithResult(_0x1783ce,_0x110f7f){_0x110f7f=_0x110f7f||0xc8;return function(_0x5ef0ed){if(_0x5ef0ed){return _0x1783ce[_0x8934('0x28')](_0x110f7f)[_0x8934('0x29')](_0x5ef0ed);}};}function respondWithFilteredResult(_0x310454,_0x50b89e){return function(_0x4b5780){if(_0x4b5780){var _0x3db790=_0x4b5780[_0x8934('0x2a')],_0x249031=_0x50b89e[_0x8934('0x2b')],_0x358445=_0x50b89e[_0x8934('0x2b')]+_0x50b89e[_0x8934('0x2c')],_0x3d93c7;if(_0x358445>=_0x3db790){_0x358445=_0x3db790;_0x3d93c7=0xc8;}else{_0x3d93c7=0xce;}_0x310454[_0x8934('0x28')](_0x3d93c7);return _0x310454[_0x8934('0x2d')]('Content-Range',_0x249031+'-'+_0x358445+'/'+_0x3db790)[_0x8934('0x29')](_0x4b5780);}return null;};}function patchUpdates(_0x3e973e){return function(_0x54d28d){try{jsonpatch[_0x8934('0x2e')](_0x54d28d,_0x3e973e,!![]);}catch(_0x3d60f9){return BPromise[_0x8934('0x2f')](_0x3d60f9);}return _0x54d28d[_0x8934('0x30')]();};}function saveUpdates(_0x4b3cb9,_0x78b2c){return function(_0x18e881){if(_0x18e881){return _0x18e881[_0x8934('0x31')](_0x4b3cb9)[_0x8934('0x1c')](function(_0x382d81){return _0x382d81;});}return null;};}function removeEntity(_0x49c5e2,_0x15c40c){return function(_0x59a6bf){if(_0x59a6bf){return _0x59a6bf['destroy']()[_0x8934('0x1c')](function(){_0x49c5e2[_0x8934('0x28')](0xcc)[_0x8934('0x27')]();});}};}function handleEntityNotFound(_0x126ffe,_0x50bbb4){return function(_0x2b4db6){if(!_0x2b4db6){_0x126ffe[_0x8934('0x26')](0x194);}return _0x2b4db6;};}function handleError(_0x380d47,_0x1439ef){_0x1439ef=_0x1439ef||0x1f4;return function(_0x7b2a1c){logger['error'](_0x7b2a1c[_0x8934('0x32')]);if(_0x7b2a1c[_0x8934('0x33')]){delete _0x7b2a1c['name'];}_0x380d47['status'](_0x1439ef)[_0x8934('0x34')](_0x7b2a1c);};}exports[_0x8934('0x35')]=function(_0x4a4a50,_0x519273){var _0x1a30c1={},_0x177a57={},_0x2f710a={'count':0x0,'rows':[]};var _0x207ad4=db[_0x8934('0x36')][_0x8934('0x37')];_0x177a57[_0x8934('0x38')]=_[_0x8934('0x39')](_0x207ad4);_0x177a57[_0x8934('0x3a')]=_[_0x8934('0x39')](_0x4a4a50[_0x8934('0x3a')]);_0x177a57['filters']=_[_0x8934('0x3b')](_0x177a57[_0x8934('0x38')],_0x177a57['query']);_0x1a30c1[_0x8934('0x3c')]=_[_0x8934('0x3b')](_0x177a57[_0x8934('0x38')],qs[_0x8934('0x3d')](_0x4a4a50[_0x8934('0x3a')]['fields']));_0x1a30c1['attributes']=_0x1a30c1['attributes'][_0x8934('0x3e')]?_0x1a30c1[_0x8934('0x3c')]:_0x177a57[_0x8934('0x38')];if(!_0x4a4a50['query'][_0x8934('0x3f')]('nolimit')){_0x1a30c1['limit']=qs[_0x8934('0x2c')](_0x4a4a50[_0x8934('0x3a')]['limit']);_0x1a30c1['offset']=qs[_0x8934('0x2b')](_0x4a4a50[_0x8934('0x3a')][_0x8934('0x2b')]);}_0x1a30c1['order']=qs[_0x8934('0x40')](_0x4a4a50['query'][_0x8934('0x40')]);_0x1a30c1['where']=qs[_0x8934('0x41')](_[_0x8934('0x42')](_0x4a4a50[_0x8934('0x3a')],_0x177a57['filters']));if(_0x4a4a50[_0x8934('0x3a')][_0x8934('0x43')]){_0x1a30c1[_0x8934('0x44')]=_[_0x8934('0x45')](_0x1a30c1['where'],{'$or':_[_0x8934('0x46')](_0x207ad4,function(_0x2ec412){if(_0x2ec412[_0x8934('0x47')][_0x8934('0x48')]!==_0x8934('0x49')){var _0x28771e={};_0x28771e[_0x2ec412[_0x8934('0x4a')]]={'$like':'%'+_0x4a4a50[_0x8934('0x3a')]['filter']+'%'};return _0x28771e;}})});}_0x1a30c1=_['merge']({},_0x1a30c1,_0x4a4a50['options']);var _0x1daae2={'where':_0x1a30c1[_0x8934('0x44')]};return db['ZendeskConfiguration'][_0x8934('0x2a')](_0x1daae2)['then'](function(_0xa69bec){_0x2f710a[_0x8934('0x2a')]=_0xa69bec;if(_0x4a4a50['query'][_0x8934('0x4b')]){_0x1a30c1[_0x8934('0x4c')]=[{'all':!![]}];}return db[_0x8934('0x36')][_0x8934('0x4d')](_0x1a30c1);})['then'](function(_0x2adb63){_0x2f710a[_0x8934('0x4e')]=_0x2adb63;return _0x2f710a;})['then'](respondWithFilteredResult(_0x519273,_0x1a30c1))[_0x8934('0x25')](handleError(_0x519273,null));};exports[_0x8934('0x4f')]=function(_0x27a98c,_0x2d5c6a){var _0x406d0a={'raw':![],'where':{'id':_0x27a98c[_0x8934('0x50')]['id']}},_0x419e30={};_0x419e30[_0x8934('0x38')]=_[_0x8934('0x39')](db[_0x8934('0x36')][_0x8934('0x37')]);_0x419e30[_0x8934('0x3a')]=_[_0x8934('0x39')](_0x27a98c[_0x8934('0x3a')]);_0x419e30[_0x8934('0x41')]=_[_0x8934('0x3b')](_0x419e30[_0x8934('0x38')],_0x419e30[_0x8934('0x3a')]);_0x406d0a['attributes']=_[_0x8934('0x3b')](_0x419e30[_0x8934('0x38')],qs['fields'](_0x27a98c['query']['fields']));_0x406d0a['attributes']=_0x406d0a[_0x8934('0x3c')][_0x8934('0x3e')]?_0x406d0a[_0x8934('0x3c')]:_0x419e30['model'];if(_0x27a98c['query'][_0x8934('0x4b')]){_0x406d0a['include']=[{'all':!![]}];}_0x406d0a=_['merge']({},_0x406d0a,_0x27a98c[_0x8934('0x51')]);return db[_0x8934('0x36')][_0x8934('0x52')](_0x406d0a)[_0x8934('0x1c')](handleEntityNotFound(_0x2d5c6a,null))[_0x8934('0x1c')](respondWithResult(_0x2d5c6a,null))[_0x8934('0x25')](handleError(_0x2d5c6a,null));};exports[_0x8934('0x53')]=function(_0x575bd7,_0x390306){return db['ZendeskConfiguration'][_0x8934('0x53')](_0x575bd7[_0x8934('0x54')],{})[_0x8934('0x1c')](respondWithResult(_0x390306,0xc9))[_0x8934('0x25')](handleError(_0x390306,null));};exports[_0x8934('0x31')]=function(_0x265b0a,_0x1f6c5f){if(_0x265b0a[_0x8934('0x54')]['id']){delete _0x265b0a['body']['id'];}return db[_0x8934('0x36')][_0x8934('0x52')]({'where':{'id':_0x265b0a[_0x8934('0x50')]['id']}})[_0x8934('0x1c')](handleEntityNotFound(_0x1f6c5f,null))[_0x8934('0x1c')](saveUpdates(_0x265b0a['body'],null))[_0x8934('0x1c')](respondWithResult(_0x1f6c5f,null))[_0x8934('0x25')](handleError(_0x1f6c5f,null));};exports[_0x8934('0x55')]=function(_0x4c2a52,_0x447110){return db[_0x8934('0x36')][_0x8934('0x52')]({'where':{'id':_0x4c2a52['params']['id']}})['then'](handleEntityNotFound(_0x447110,null))['then'](removeEntity(_0x447110,null))[_0x8934('0x25')](handleError(_0x447110,null));};exports[_0x8934('0x56')]=function(_0x3aab00,_0x4ceb9b,_0x280809){var _0x10ff96={};var _0x5f447c={};var _0x5157d7;var _0xf993d2;return db[_0x8934('0x36')][_0x8934('0x57')]({'where':{'id':_0x3aab00[_0x8934('0x50')]['id']}})['then'](handleEntityNotFound(_0x4ceb9b,null))['then'](function(_0x4ea19e){if(_0x4ea19e){_0x5157d7=_0x4ea19e;_0x5f447c['model']=_[_0x8934('0x39')](db[_0x8934('0x58')][_0x8934('0x37')]);_0x5f447c[_0x8934('0x3a')]=_[_0x8934('0x39')](_0x3aab00[_0x8934('0x3a')]);_0x5f447c['filters']=_[_0x8934('0x3b')](_0x5f447c[_0x8934('0x38')],_0x5f447c['query']);_0x10ff96[_0x8934('0x3c')]=_['intersection'](_0x5f447c[_0x8934('0x38')],qs['fields'](_0x3aab00[_0x8934('0x3a')][_0x8934('0x3d')]));_0x10ff96[_0x8934('0x3c')]=_0x10ff96[_0x8934('0x3c')][_0x8934('0x3e')]?_0x10ff96[_0x8934('0x3c')]:_0x5f447c[_0x8934('0x38')];_0x10ff96['order']=qs['sort'](_0x3aab00[_0x8934('0x3a')][_0x8934('0x40')]);_0x10ff96[_0x8934('0x44')]=qs[_0x8934('0x41')](_[_0x8934('0x42')](_0x3aab00[_0x8934('0x3a')],_0x5f447c[_0x8934('0x41')]));if(_0x3aab00[_0x8934('0x3a')][_0x8934('0x43')]){_0x10ff96[_0x8934('0x44')]=_[_0x8934('0x45')](_0x10ff96[_0x8934('0x44')],{'$or':_[_0x8934('0x46')](_0x10ff96[_0x8934('0x3c')],function(_0x5c7b96){var _0x5c2819={};_0x5c2819[_0x5c7b96]={'$like':'%'+_0x3aab00[_0x8934('0x3a')][_0x8934('0x43')]+'%'};return _0x5c2819;})});}_0x10ff96=_[_0x8934('0x45')]({},_0x10ff96,_0x3aab00[_0x8934('0x51')]);return _0x5157d7[_0x8934('0x56')](_0x10ff96);}})[_0x8934('0x1c')](function(_0x2f8318){if(_0x2f8318){_0xf993d2=_0x2f8318['length'];if(!_0x3aab00[_0x8934('0x3a')][_0x8934('0x3f')]('nolimit')){_0x10ff96[_0x8934('0x2c')]=qs['limit'](_0x3aab00[_0x8934('0x3a')][_0x8934('0x2c')]);_0x10ff96[_0x8934('0x2b')]=qs['offset'](_0x3aab00[_0x8934('0x3a')][_0x8934('0x2b')]);}return _0x5157d7['getFields'](_0x10ff96);}})[_0x8934('0x1c')](function(_0x558f93){if(_0x558f93){return _0x558f93?{'count':_0xf993d2,'rows':_0x558f93}:null;}})[_0x8934('0x1c')](respondWithResult(_0x4ceb9b,null))['catch'](handleError(_0x4ceb9b,null));};exports[_0x8934('0x59')]=function(_0x6b3376,_0x24b0ce,_0x5ea4fe){var _0x196372={};var _0xfbad9={};var _0x349c88;var _0x5e0631;return db['ZendeskConfiguration'][_0x8934('0x57')]({'where':{'id':_0x6b3376['params']['id']}})[_0x8934('0x1c')](handleEntityNotFound(_0x24b0ce,null))[_0x8934('0x1c')](function(_0x14992b){if(_0x14992b){_0x349c88=_0x14992b;_0xfbad9[_0x8934('0x38')]=_['keys'](db[_0x8934('0x58')][_0x8934('0x37')]);_0xfbad9[_0x8934('0x3a')]=_['keys'](_0x6b3376[_0x8934('0x3a')]);_0xfbad9[_0x8934('0x41')]=_[_0x8934('0x3b')](_0xfbad9['model'],_0xfbad9['query']);_0x196372[_0x8934('0x3c')]=_[_0x8934('0x3b')](_0xfbad9[_0x8934('0x38')],qs[_0x8934('0x3d')](_0x6b3376[_0x8934('0x3a')][_0x8934('0x3d')]));_0x196372[_0x8934('0x3c')]=_0x196372[_0x8934('0x3c')][_0x8934('0x3e')]?_0x196372['attributes']:_0xfbad9[_0x8934('0x38')];_0x196372[_0x8934('0x5a')]=qs[_0x8934('0x40')](_0x6b3376[_0x8934('0x3a')][_0x8934('0x40')]);_0x196372['where']=qs[_0x8934('0x41')](_[_0x8934('0x42')](_0x6b3376['query'],_0xfbad9[_0x8934('0x41')]));if(_0x6b3376['query']['filter']){_0x196372['where']=_[_0x8934('0x45')](_0x196372[_0x8934('0x44')],{'$or':_[_0x8934('0x46')](_0x196372['attributes'],function(_0x2c289b){var _0x1d3372={};_0x1d3372[_0x2c289b]={'$like':'%'+_0x6b3376['query'][_0x8934('0x43')]+'%'};return _0x1d3372;})});}_0x196372=_[_0x8934('0x45')]({},_0x196372,_0x6b3376[_0x8934('0x51')]);return _0x349c88[_0x8934('0x59')](_0x196372);}})[_0x8934('0x1c')](function(_0x324722){if(_0x324722){_0x5e0631=_0x324722[_0x8934('0x3e')];if(!_0x6b3376[_0x8934('0x3a')][_0x8934('0x3f')](_0x8934('0x5b'))){_0x196372['limit']=qs[_0x8934('0x2c')](_0x6b3376[_0x8934('0x3a')][_0x8934('0x2c')]);_0x196372[_0x8934('0x2b')]=qs[_0x8934('0x2b')](_0x6b3376[_0x8934('0x3a')][_0x8934('0x2b')]);}return _0x349c88['getSubjects'](_0x196372);}})[_0x8934('0x1c')](function(_0x230b36){if(_0x230b36){return _0x230b36?{'count':_0x5e0631,'rows':_0x230b36}:null;}})[_0x8934('0x1c')](respondWithResult(_0x24b0ce,null))[_0x8934('0x25')](handleError(_0x24b0ce,null));};exports[_0x8934('0x5c')]=function(_0xdf0ab2,_0x91d79f,_0x4080ec){var _0x194e5a={};var _0x52b25e={};var _0x4ef5eb;var _0x1d1590;return db[_0x8934('0x36')]['findOne']({'where':{'id':_0xdf0ab2[_0x8934('0x50')]['id']}})[_0x8934('0x1c')](handleEntityNotFound(_0x91d79f,null))[_0x8934('0x1c')](function(_0xba3619){if(_0xba3619){_0x4ef5eb=_0xba3619;_0x52b25e[_0x8934('0x38')]=_[_0x8934('0x39')](db[_0x8934('0x58')][_0x8934('0x37')]);_0x52b25e[_0x8934('0x3a')]=_[_0x8934('0x39')](_0xdf0ab2[_0x8934('0x3a')]);_0x52b25e['filters']=_[_0x8934('0x3b')](_0x52b25e[_0x8934('0x38')],_0x52b25e[_0x8934('0x3a')]);_0x194e5a['attributes']=_[_0x8934('0x3b')](_0x52b25e['model'],qs[_0x8934('0x3d')](_0xdf0ab2[_0x8934('0x3a')][_0x8934('0x3d')]));_0x194e5a[_0x8934('0x3c')]=_0x194e5a['attributes']['length']?_0x194e5a[_0x8934('0x3c')]:_0x52b25e['model'];_0x194e5a[_0x8934('0x5a')]=qs[_0x8934('0x40')](_0xdf0ab2[_0x8934('0x3a')][_0x8934('0x40')]);_0x194e5a['where']=qs[_0x8934('0x41')](_['pick'](_0xdf0ab2['query'],_0x52b25e['filters']));if(_0xdf0ab2['query'][_0x8934('0x43')]){_0x194e5a[_0x8934('0x44')]=_[_0x8934('0x45')](_0x194e5a[_0x8934('0x44')],{'$or':_[_0x8934('0x46')](_0x194e5a['attributes'],function(_0x4913e0){var _0x28dfb7={};_0x28dfb7[_0x4913e0]={'$like':'%'+_0xdf0ab2[_0x8934('0x3a')][_0x8934('0x43')]+'%'};return _0x28dfb7;})});}_0x194e5a=_[_0x8934('0x45')]({},_0x194e5a,_0xdf0ab2[_0x8934('0x51')]);return _0x4ef5eb[_0x8934('0x5c')](_0x194e5a);}})[_0x8934('0x1c')](function(_0x2839dd){if(_0x2839dd){_0x1d1590=_0x2839dd[_0x8934('0x3e')];if(!_0xdf0ab2[_0x8934('0x3a')][_0x8934('0x3f')](_0x8934('0x5b'))){_0x194e5a[_0x8934('0x2c')]=qs[_0x8934('0x2c')](_0xdf0ab2[_0x8934('0x3a')][_0x8934('0x2c')]);_0x194e5a['offset']=qs['offset'](_0xdf0ab2[_0x8934('0x3a')][_0x8934('0x2b')]);}return _0x4ef5eb['getDescriptions'](_0x194e5a);}})[_0x8934('0x1c')](function(_0x13d088){if(_0x13d088){return _0x13d088?{'count':_0x1d1590,'rows':_0x13d088}:null;}})[_0x8934('0x1c')](respondWithResult(_0x91d79f,null))[_0x8934('0x25')](handleError(_0x91d79f,null));};exports[_0x8934('0x5d')]=function(_0x33958e,_0x113e0f,_0x4e55fb){var _0x12fd3c={};var _0x5aab65={};var _0x43f760;var _0xab515e;return db[_0x8934('0x36')][_0x8934('0x57')]({'where':{'id':_0x33958e['params']['id']}})[_0x8934('0x1c')](handleEntityNotFound(_0x113e0f,null))['then'](function(_0x591eb7){if(_0x591eb7){_0x43f760=_0x591eb7;_0x5aab65[_0x8934('0x38')]=_[_0x8934('0x39')](db['Tag']['rawAttributes']);_0x5aab65[_0x8934('0x3a')]=_['keys'](_0x33958e[_0x8934('0x3a')]);_0x5aab65[_0x8934('0x41')]=_[_0x8934('0x3b')](_0x5aab65[_0x8934('0x38')],_0x5aab65[_0x8934('0x3a')]);_0x12fd3c[_0x8934('0x3c')]=_['intersection'](_0x5aab65[_0x8934('0x38')],qs[_0x8934('0x3d')](_0x33958e['query']['fields']));_0x12fd3c[_0x8934('0x3c')]=_0x12fd3c[_0x8934('0x3c')][_0x8934('0x3e')]?_0x12fd3c['attributes']:_0x5aab65['model'];_0x12fd3c[_0x8934('0x5a')]=qs['sort'](_0x33958e[_0x8934('0x3a')][_0x8934('0x40')]);_0x12fd3c[_0x8934('0x44')]=qs[_0x8934('0x41')](_[_0x8934('0x42')](_0x33958e[_0x8934('0x3a')],_0x5aab65[_0x8934('0x41')]));if(_0x33958e[_0x8934('0x3a')]['filter']){_0x12fd3c[_0x8934('0x44')]=_[_0x8934('0x45')](_0x12fd3c['where'],{'$or':_['map'](_0x12fd3c[_0x8934('0x3c')],function(_0x53f5de){var _0x2b7294={};_0x2b7294[_0x53f5de]={'$like':'%'+_0x33958e[_0x8934('0x3a')]['filter']+'%'};return _0x2b7294;})});}_0x12fd3c=_[_0x8934('0x45')]({},_0x12fd3c,_0x33958e[_0x8934('0x51')]);return _0x43f760[_0x8934('0x5d')](_0x12fd3c);}})[_0x8934('0x1c')](function(_0x517dee){if(_0x517dee){_0xab515e=_0x517dee[_0x8934('0x3e')];if(!_0x33958e[_0x8934('0x3a')][_0x8934('0x3f')](_0x8934('0x5b'))){_0x12fd3c['limit']=qs[_0x8934('0x2c')](_0x33958e[_0x8934('0x3a')][_0x8934('0x2c')]);_0x12fd3c[_0x8934('0x2b')]=qs[_0x8934('0x2b')](_0x33958e[_0x8934('0x3a')]['offset']);}return _0x43f760[_0x8934('0x5d')](_0x12fd3c);}})['then'](function(_0x32501c){if(_0x32501c){return _0x32501c?{'count':_0xab515e,'rows':_0x32501c}:null;}})[_0x8934('0x1c')](respondWithResult(_0x113e0f,null))[_0x8934('0x25')](handleError(_0x113e0f,null));};exports['setTags']=function(_0xf8b851,_0x13905f,_0x27de9a){if(_0xf8b851[_0x8934('0x54')]['id']){delete _0xf8b851['body']['id'];}return db[_0x8934('0x36')][_0x8934('0x57')]({'where':{'id':_0xf8b851[_0x8934('0x50')]['id']}})['then'](handleEntityNotFound(_0x13905f,null))['then'](function(_0x4f4ca8){if(_0x4f4ca8){return _0x4f4ca8['setTags'](_0xf8b851[_0x8934('0x54')][_0x8934('0x5e')]||[]);}return null;})['then'](respondWithResult(_0x13905f,null))['catch'](handleError(_0x13905f,null));}; \ No newline at end of file +var _0x9348=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','stack','name','send','index','ZendeskConfiguration','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','show','params','options','find','create','body','destroy','getFields','findOne','ZendeskField','getSubjects','order','nolimit','getDescriptions','getTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js'];(function(_0x37a6ae,_0x43559d){var _0x309039=function(_0xd0623c){while(--_0xd0623c){_0x37a6ae['push'](_0x37a6ae['shift']());}};_0x309039(++_0x43559d);}(_0x9348,0x10d));var _0x8934=function(_0x4419f2,_0x1e2605){_0x4419f2=_0x4419f2-0x0;var _0x52f685=_0x9348[_0x4419f2];return _0x52f685;};'use strict';var pdf=require(_0x8934('0x0'));var emlformat=require(_0x8934('0x1'));var rimraf=require(_0x8934('0x2'));var zipdir=require(_0x8934('0x3'));var jsonpatch=require(_0x8934('0x4'));var rp=require('request-promise');var moment=require(_0x8934('0x5'));var BPromise=require(_0x8934('0x6'));var Mustache=require('mustache');var util=require(_0x8934('0x7'));var path=require(_0x8934('0x8'));var sox=require(_0x8934('0x9'));var csv=require(_0x8934('0xa'));var ejs=require(_0x8934('0xb'));var fs=require('fs');var _=require(_0x8934('0xc'));var squel=require('squel');var crypto=require(_0x8934('0xd'));var jsforce=require(_0x8934('0xe'));var deskjs=require(_0x8934('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8934('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8934('0x11'));var logger=require(_0x8934('0x12'))(_0x8934('0x13'));var utils=require(_0x8934('0x14'));var config=require(_0x8934('0x15'));var db=require(_0x8934('0x16'))['db'];var jayson=require(_0x8934('0x17'));var client=jayson[_0x8934('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x68427d,_0x108eab,_0x46bca5){if(_0x46bca5){var _0x1906d0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1906d0[_0x8934('0x19')](_0x108eab)){return _0x68427d;}else{throw new Error(_0x8934('0x1a'));}}else{return _0x68427d;}}function respondWithRpcPromise(_0x5b560f,_0x254720,_0x38230a,_0xdfc97c){return new BPromise(function(_0x94b948,_0x34d4dc){var _0x41e6a9=_0xdfc97c||client;return _0x41e6a9[_0x8934('0x1b')](_0x5b560f,_0x38230a)[_0x8934('0x1c')](function(_0x52de6a){logger[_0x8934('0x1d')](_0x8934('0x1e'),_0x254720,_0x8934('0x1f'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x254720,'request\x20sent',JSON[_0x8934('0x20')](_0x52de6a));if(_0x52de6a['error']){if(_0x52de6a[_0x8934('0x21')][_0x8934('0x22')]===0x1f4){logger[_0x8934('0x21')](_0x8934('0x1e'),_0x254720,_0x52de6a[_0x8934('0x21')]['message']);return _0x34d4dc(_0x52de6a[_0x8934('0x21')]['message']);}logger[_0x8934('0x21')](_0x8934('0x1e'),_0x254720,_0x52de6a[_0x8934('0x21')][_0x8934('0x23')]);return _0x94b948(_0x52de6a[_0x8934('0x21')][_0x8934('0x23')]);}else{logger[_0x8934('0x1d')]('ZendeskConfiguration,\x20%s,\x20%s',_0x254720,_0x8934('0x1f'));_0x94b948(_0x52de6a[_0x8934('0x24')][_0x8934('0x23')]);}})[_0x8934('0x25')](function(_0x43b89a){logger['error'](_0x8934('0x1e'),_0x254720,_0x43b89a);_0x34d4dc(_0x43b89a);});});}function respondWithStatusCode(_0x1c15c5,_0x1b5775){_0x1b5775=_0x1b5775||0xcc;return function(_0x50ceda){if(_0x50ceda){return _0x1c15c5[_0x8934('0x26')](_0x1b5775);}return _0x1c15c5['status'](_0x1b5775)[_0x8934('0x27')]();};}function respondWithResult(_0x1783ce,_0x110f7f){_0x110f7f=_0x110f7f||0xc8;return function(_0x5ef0ed){if(_0x5ef0ed){return _0x1783ce[_0x8934('0x28')](_0x110f7f)[_0x8934('0x29')](_0x5ef0ed);}};}function respondWithFilteredResult(_0x310454,_0x50b89e){return function(_0x4b5780){if(_0x4b5780){var _0x3db790=_0x4b5780[_0x8934('0x2a')],_0x249031=_0x50b89e[_0x8934('0x2b')],_0x358445=_0x50b89e[_0x8934('0x2b')]+_0x50b89e[_0x8934('0x2c')],_0x3d93c7;if(_0x358445>=_0x3db790){_0x358445=_0x3db790;_0x3d93c7=0xc8;}else{_0x3d93c7=0xce;}_0x310454[_0x8934('0x28')](_0x3d93c7);return _0x310454[_0x8934('0x2d')]('Content-Range',_0x249031+'-'+_0x358445+'/'+_0x3db790)[_0x8934('0x29')](_0x4b5780);}return null;};}function patchUpdates(_0x3e973e){return function(_0x54d28d){try{jsonpatch[_0x8934('0x2e')](_0x54d28d,_0x3e973e,!![]);}catch(_0x3d60f9){return BPromise[_0x8934('0x2f')](_0x3d60f9);}return _0x54d28d[_0x8934('0x30')]();};}function saveUpdates(_0x4b3cb9,_0x78b2c){return function(_0x18e881){if(_0x18e881){return _0x18e881[_0x8934('0x31')](_0x4b3cb9)[_0x8934('0x1c')](function(_0x382d81){return _0x382d81;});}return null;};}function removeEntity(_0x49c5e2,_0x15c40c){return function(_0x59a6bf){if(_0x59a6bf){return _0x59a6bf['destroy']()[_0x8934('0x1c')](function(){_0x49c5e2[_0x8934('0x28')](0xcc)[_0x8934('0x27')]();});}};}function handleEntityNotFound(_0x126ffe,_0x50bbb4){return function(_0x2b4db6){if(!_0x2b4db6){_0x126ffe[_0x8934('0x26')](0x194);}return _0x2b4db6;};}function handleError(_0x380d47,_0x1439ef){_0x1439ef=_0x1439ef||0x1f4;return function(_0x7b2a1c){logger['error'](_0x7b2a1c[_0x8934('0x32')]);if(_0x7b2a1c[_0x8934('0x33')]){delete _0x7b2a1c['name'];}_0x380d47['status'](_0x1439ef)[_0x8934('0x34')](_0x7b2a1c);};}exports[_0x8934('0x35')]=function(_0x4a4a50,_0x519273){var _0x1a30c1={},_0x177a57={},_0x2f710a={'count':0x0,'rows':[]};var _0x207ad4=db[_0x8934('0x36')][_0x8934('0x37')];_0x177a57[_0x8934('0x38')]=_[_0x8934('0x39')](_0x207ad4);_0x177a57[_0x8934('0x3a')]=_[_0x8934('0x39')](_0x4a4a50[_0x8934('0x3a')]);_0x177a57['filters']=_[_0x8934('0x3b')](_0x177a57[_0x8934('0x38')],_0x177a57['query']);_0x1a30c1[_0x8934('0x3c')]=_[_0x8934('0x3b')](_0x177a57[_0x8934('0x38')],qs[_0x8934('0x3d')](_0x4a4a50[_0x8934('0x3a')]['fields']));_0x1a30c1['attributes']=_0x1a30c1['attributes'][_0x8934('0x3e')]?_0x1a30c1[_0x8934('0x3c')]:_0x177a57[_0x8934('0x38')];if(!_0x4a4a50['query'][_0x8934('0x3f')]('nolimit')){_0x1a30c1['limit']=qs[_0x8934('0x2c')](_0x4a4a50[_0x8934('0x3a')]['limit']);_0x1a30c1['offset']=qs[_0x8934('0x2b')](_0x4a4a50[_0x8934('0x3a')][_0x8934('0x2b')]);}_0x1a30c1['order']=qs[_0x8934('0x40')](_0x4a4a50['query'][_0x8934('0x40')]);_0x1a30c1['where']=qs[_0x8934('0x41')](_[_0x8934('0x42')](_0x4a4a50[_0x8934('0x3a')],_0x177a57['filters']));if(_0x4a4a50[_0x8934('0x3a')][_0x8934('0x43')]){_0x1a30c1[_0x8934('0x44')]=_[_0x8934('0x45')](_0x1a30c1['where'],{'$or':_[_0x8934('0x46')](_0x207ad4,function(_0x2ec412){if(_0x2ec412[_0x8934('0x47')][_0x8934('0x48')]!==_0x8934('0x49')){var _0x28771e={};_0x28771e[_0x2ec412[_0x8934('0x4a')]]={'$like':'%'+_0x4a4a50[_0x8934('0x3a')]['filter']+'%'};return _0x28771e;}})});}_0x1a30c1=_['merge']({},_0x1a30c1,_0x4a4a50['options']);var _0x1daae2={'where':_0x1a30c1[_0x8934('0x44')]};return db['ZendeskConfiguration'][_0x8934('0x2a')](_0x1daae2)['then'](function(_0xa69bec){_0x2f710a[_0x8934('0x2a')]=_0xa69bec;if(_0x4a4a50['query'][_0x8934('0x4b')]){_0x1a30c1[_0x8934('0x4c')]=[{'all':!![]}];}return db[_0x8934('0x36')][_0x8934('0x4d')](_0x1a30c1);})['then'](function(_0x2adb63){_0x2f710a[_0x8934('0x4e')]=_0x2adb63;return _0x2f710a;})['then'](respondWithFilteredResult(_0x519273,_0x1a30c1))[_0x8934('0x25')](handleError(_0x519273,null));};exports[_0x8934('0x4f')]=function(_0x27a98c,_0x2d5c6a){var _0x406d0a={'raw':![],'where':{'id':_0x27a98c[_0x8934('0x50')]['id']}},_0x419e30={};_0x419e30[_0x8934('0x38')]=_[_0x8934('0x39')](db[_0x8934('0x36')][_0x8934('0x37')]);_0x419e30[_0x8934('0x3a')]=_[_0x8934('0x39')](_0x27a98c[_0x8934('0x3a')]);_0x419e30[_0x8934('0x41')]=_[_0x8934('0x3b')](_0x419e30[_0x8934('0x38')],_0x419e30[_0x8934('0x3a')]);_0x406d0a['attributes']=_[_0x8934('0x3b')](_0x419e30[_0x8934('0x38')],qs['fields'](_0x27a98c['query']['fields']));_0x406d0a['attributes']=_0x406d0a[_0x8934('0x3c')][_0x8934('0x3e')]?_0x406d0a[_0x8934('0x3c')]:_0x419e30['model'];if(_0x27a98c['query'][_0x8934('0x4b')]){_0x406d0a['include']=[{'all':!![]}];}_0x406d0a=_['merge']({},_0x406d0a,_0x27a98c[_0x8934('0x51')]);return db[_0x8934('0x36')][_0x8934('0x52')](_0x406d0a)[_0x8934('0x1c')](handleEntityNotFound(_0x2d5c6a,null))[_0x8934('0x1c')](respondWithResult(_0x2d5c6a,null))[_0x8934('0x25')](handleError(_0x2d5c6a,null));};exports[_0x8934('0x53')]=function(_0x575bd7,_0x390306){return db['ZendeskConfiguration'][_0x8934('0x53')](_0x575bd7[_0x8934('0x54')],{})[_0x8934('0x1c')](respondWithResult(_0x390306,0xc9))[_0x8934('0x25')](handleError(_0x390306,null));};exports[_0x8934('0x31')]=function(_0x265b0a,_0x1f6c5f){if(_0x265b0a[_0x8934('0x54')]['id']){delete _0x265b0a['body']['id'];}return db[_0x8934('0x36')][_0x8934('0x52')]({'where':{'id':_0x265b0a[_0x8934('0x50')]['id']}})[_0x8934('0x1c')](handleEntityNotFound(_0x1f6c5f,null))[_0x8934('0x1c')](saveUpdates(_0x265b0a['body'],null))[_0x8934('0x1c')](respondWithResult(_0x1f6c5f,null))[_0x8934('0x25')](handleError(_0x1f6c5f,null));};exports[_0x8934('0x55')]=function(_0x4c2a52,_0x447110){return db[_0x8934('0x36')][_0x8934('0x52')]({'where':{'id':_0x4c2a52['params']['id']}})['then'](handleEntityNotFound(_0x447110,null))['then'](removeEntity(_0x447110,null))[_0x8934('0x25')](handleError(_0x447110,null));};exports[_0x8934('0x56')]=function(_0x3aab00,_0x4ceb9b,_0x280809){var _0x10ff96={};var _0x5f447c={};var _0x5157d7;var _0xf993d2;return db[_0x8934('0x36')][_0x8934('0x57')]({'where':{'id':_0x3aab00[_0x8934('0x50')]['id']}})['then'](handleEntityNotFound(_0x4ceb9b,null))['then'](function(_0x4ea19e){if(_0x4ea19e){_0x5157d7=_0x4ea19e;_0x5f447c['model']=_[_0x8934('0x39')](db[_0x8934('0x58')][_0x8934('0x37')]);_0x5f447c[_0x8934('0x3a')]=_[_0x8934('0x39')](_0x3aab00[_0x8934('0x3a')]);_0x5f447c['filters']=_[_0x8934('0x3b')](_0x5f447c[_0x8934('0x38')],_0x5f447c['query']);_0x10ff96[_0x8934('0x3c')]=_['intersection'](_0x5f447c[_0x8934('0x38')],qs['fields'](_0x3aab00[_0x8934('0x3a')][_0x8934('0x3d')]));_0x10ff96[_0x8934('0x3c')]=_0x10ff96[_0x8934('0x3c')][_0x8934('0x3e')]?_0x10ff96[_0x8934('0x3c')]:_0x5f447c[_0x8934('0x38')];_0x10ff96['order']=qs['sort'](_0x3aab00[_0x8934('0x3a')][_0x8934('0x40')]);_0x10ff96[_0x8934('0x44')]=qs[_0x8934('0x41')](_[_0x8934('0x42')](_0x3aab00[_0x8934('0x3a')],_0x5f447c[_0x8934('0x41')]));if(_0x3aab00[_0x8934('0x3a')][_0x8934('0x43')]){_0x10ff96[_0x8934('0x44')]=_[_0x8934('0x45')](_0x10ff96[_0x8934('0x44')],{'$or':_[_0x8934('0x46')](_0x10ff96[_0x8934('0x3c')],function(_0x5c7b96){var _0x5c2819={};_0x5c2819[_0x5c7b96]={'$like':'%'+_0x3aab00[_0x8934('0x3a')][_0x8934('0x43')]+'%'};return _0x5c2819;})});}_0x10ff96=_[_0x8934('0x45')]({},_0x10ff96,_0x3aab00[_0x8934('0x51')]);return _0x5157d7[_0x8934('0x56')](_0x10ff96);}})[_0x8934('0x1c')](function(_0x2f8318){if(_0x2f8318){_0xf993d2=_0x2f8318['length'];if(!_0x3aab00[_0x8934('0x3a')][_0x8934('0x3f')]('nolimit')){_0x10ff96[_0x8934('0x2c')]=qs['limit'](_0x3aab00[_0x8934('0x3a')][_0x8934('0x2c')]);_0x10ff96[_0x8934('0x2b')]=qs['offset'](_0x3aab00[_0x8934('0x3a')][_0x8934('0x2b')]);}return _0x5157d7['getFields'](_0x10ff96);}})[_0x8934('0x1c')](function(_0x558f93){if(_0x558f93){return _0x558f93?{'count':_0xf993d2,'rows':_0x558f93}:null;}})[_0x8934('0x1c')](respondWithResult(_0x4ceb9b,null))['catch'](handleError(_0x4ceb9b,null));};exports[_0x8934('0x59')]=function(_0x6b3376,_0x24b0ce,_0x5ea4fe){var _0x196372={};var _0xfbad9={};var _0x349c88;var _0x5e0631;return db['ZendeskConfiguration'][_0x8934('0x57')]({'where':{'id':_0x6b3376['params']['id']}})[_0x8934('0x1c')](handleEntityNotFound(_0x24b0ce,null))[_0x8934('0x1c')](function(_0x14992b){if(_0x14992b){_0x349c88=_0x14992b;_0xfbad9[_0x8934('0x38')]=_['keys'](db[_0x8934('0x58')][_0x8934('0x37')]);_0xfbad9[_0x8934('0x3a')]=_['keys'](_0x6b3376[_0x8934('0x3a')]);_0xfbad9[_0x8934('0x41')]=_[_0x8934('0x3b')](_0xfbad9['model'],_0xfbad9['query']);_0x196372[_0x8934('0x3c')]=_[_0x8934('0x3b')](_0xfbad9[_0x8934('0x38')],qs[_0x8934('0x3d')](_0x6b3376[_0x8934('0x3a')][_0x8934('0x3d')]));_0x196372[_0x8934('0x3c')]=_0x196372[_0x8934('0x3c')][_0x8934('0x3e')]?_0x196372['attributes']:_0xfbad9[_0x8934('0x38')];_0x196372[_0x8934('0x5a')]=qs[_0x8934('0x40')](_0x6b3376[_0x8934('0x3a')][_0x8934('0x40')]);_0x196372['where']=qs[_0x8934('0x41')](_[_0x8934('0x42')](_0x6b3376['query'],_0xfbad9[_0x8934('0x41')]));if(_0x6b3376['query']['filter']){_0x196372['where']=_[_0x8934('0x45')](_0x196372[_0x8934('0x44')],{'$or':_[_0x8934('0x46')](_0x196372['attributes'],function(_0x2c289b){var _0x1d3372={};_0x1d3372[_0x2c289b]={'$like':'%'+_0x6b3376['query'][_0x8934('0x43')]+'%'};return _0x1d3372;})});}_0x196372=_[_0x8934('0x45')]({},_0x196372,_0x6b3376[_0x8934('0x51')]);return _0x349c88[_0x8934('0x59')](_0x196372);}})[_0x8934('0x1c')](function(_0x324722){if(_0x324722){_0x5e0631=_0x324722[_0x8934('0x3e')];if(!_0x6b3376[_0x8934('0x3a')][_0x8934('0x3f')](_0x8934('0x5b'))){_0x196372['limit']=qs[_0x8934('0x2c')](_0x6b3376[_0x8934('0x3a')][_0x8934('0x2c')]);_0x196372[_0x8934('0x2b')]=qs[_0x8934('0x2b')](_0x6b3376[_0x8934('0x3a')][_0x8934('0x2b')]);}return _0x349c88['getSubjects'](_0x196372);}})[_0x8934('0x1c')](function(_0x230b36){if(_0x230b36){return _0x230b36?{'count':_0x5e0631,'rows':_0x230b36}:null;}})[_0x8934('0x1c')](respondWithResult(_0x24b0ce,null))[_0x8934('0x25')](handleError(_0x24b0ce,null));};exports[_0x8934('0x5c')]=function(_0xdf0ab2,_0x91d79f,_0x4080ec){var _0x194e5a={};var _0x52b25e={};var _0x4ef5eb;var _0x1d1590;return db[_0x8934('0x36')]['findOne']({'where':{'id':_0xdf0ab2[_0x8934('0x50')]['id']}})[_0x8934('0x1c')](handleEntityNotFound(_0x91d79f,null))[_0x8934('0x1c')](function(_0xba3619){if(_0xba3619){_0x4ef5eb=_0xba3619;_0x52b25e[_0x8934('0x38')]=_[_0x8934('0x39')](db[_0x8934('0x58')][_0x8934('0x37')]);_0x52b25e[_0x8934('0x3a')]=_[_0x8934('0x39')](_0xdf0ab2[_0x8934('0x3a')]);_0x52b25e['filters']=_[_0x8934('0x3b')](_0x52b25e[_0x8934('0x38')],_0x52b25e[_0x8934('0x3a')]);_0x194e5a['attributes']=_[_0x8934('0x3b')](_0x52b25e['model'],qs[_0x8934('0x3d')](_0xdf0ab2[_0x8934('0x3a')][_0x8934('0x3d')]));_0x194e5a[_0x8934('0x3c')]=_0x194e5a['attributes']['length']?_0x194e5a[_0x8934('0x3c')]:_0x52b25e['model'];_0x194e5a[_0x8934('0x5a')]=qs[_0x8934('0x40')](_0xdf0ab2[_0x8934('0x3a')][_0x8934('0x40')]);_0x194e5a['where']=qs[_0x8934('0x41')](_['pick'](_0xdf0ab2['query'],_0x52b25e['filters']));if(_0xdf0ab2['query'][_0x8934('0x43')]){_0x194e5a[_0x8934('0x44')]=_[_0x8934('0x45')](_0x194e5a[_0x8934('0x44')],{'$or':_[_0x8934('0x46')](_0x194e5a['attributes'],function(_0x4913e0){var _0x28dfb7={};_0x28dfb7[_0x4913e0]={'$like':'%'+_0xdf0ab2[_0x8934('0x3a')][_0x8934('0x43')]+'%'};return _0x28dfb7;})});}_0x194e5a=_[_0x8934('0x45')]({},_0x194e5a,_0xdf0ab2[_0x8934('0x51')]);return _0x4ef5eb[_0x8934('0x5c')](_0x194e5a);}})[_0x8934('0x1c')](function(_0x2839dd){if(_0x2839dd){_0x1d1590=_0x2839dd[_0x8934('0x3e')];if(!_0xdf0ab2[_0x8934('0x3a')][_0x8934('0x3f')](_0x8934('0x5b'))){_0x194e5a[_0x8934('0x2c')]=qs[_0x8934('0x2c')](_0xdf0ab2[_0x8934('0x3a')][_0x8934('0x2c')]);_0x194e5a['offset']=qs['offset'](_0xdf0ab2[_0x8934('0x3a')][_0x8934('0x2b')]);}return _0x4ef5eb['getDescriptions'](_0x194e5a);}})[_0x8934('0x1c')](function(_0x13d088){if(_0x13d088){return _0x13d088?{'count':_0x1d1590,'rows':_0x13d088}:null;}})[_0x8934('0x1c')](respondWithResult(_0x91d79f,null))[_0x8934('0x25')](handleError(_0x91d79f,null));};exports[_0x8934('0x5d')]=function(_0x33958e,_0x113e0f,_0x4e55fb){var _0x12fd3c={};var _0x5aab65={};var _0x43f760;var _0xab515e;return db[_0x8934('0x36')][_0x8934('0x57')]({'where':{'id':_0x33958e['params']['id']}})[_0x8934('0x1c')](handleEntityNotFound(_0x113e0f,null))['then'](function(_0x591eb7){if(_0x591eb7){_0x43f760=_0x591eb7;_0x5aab65[_0x8934('0x38')]=_[_0x8934('0x39')](db['Tag']['rawAttributes']);_0x5aab65[_0x8934('0x3a')]=_['keys'](_0x33958e[_0x8934('0x3a')]);_0x5aab65[_0x8934('0x41')]=_[_0x8934('0x3b')](_0x5aab65[_0x8934('0x38')],_0x5aab65[_0x8934('0x3a')]);_0x12fd3c[_0x8934('0x3c')]=_['intersection'](_0x5aab65[_0x8934('0x38')],qs[_0x8934('0x3d')](_0x33958e['query']['fields']));_0x12fd3c[_0x8934('0x3c')]=_0x12fd3c[_0x8934('0x3c')][_0x8934('0x3e')]?_0x12fd3c['attributes']:_0x5aab65['model'];_0x12fd3c[_0x8934('0x5a')]=qs['sort'](_0x33958e[_0x8934('0x3a')][_0x8934('0x40')]);_0x12fd3c[_0x8934('0x44')]=qs[_0x8934('0x41')](_[_0x8934('0x42')](_0x33958e[_0x8934('0x3a')],_0x5aab65[_0x8934('0x41')]));if(_0x33958e[_0x8934('0x3a')]['filter']){_0x12fd3c[_0x8934('0x44')]=_[_0x8934('0x45')](_0x12fd3c['where'],{'$or':_['map'](_0x12fd3c[_0x8934('0x3c')],function(_0x53f5de){var _0x2b7294={};_0x2b7294[_0x53f5de]={'$like':'%'+_0x33958e[_0x8934('0x3a')]['filter']+'%'};return _0x2b7294;})});}_0x12fd3c=_[_0x8934('0x45')]({},_0x12fd3c,_0x33958e[_0x8934('0x51')]);return _0x43f760[_0x8934('0x5d')](_0x12fd3c);}})[_0x8934('0x1c')](function(_0x517dee){if(_0x517dee){_0xab515e=_0x517dee[_0x8934('0x3e')];if(!_0x33958e[_0x8934('0x3a')][_0x8934('0x3f')](_0x8934('0x5b'))){_0x12fd3c['limit']=qs[_0x8934('0x2c')](_0x33958e[_0x8934('0x3a')][_0x8934('0x2c')]);_0x12fd3c[_0x8934('0x2b')]=qs[_0x8934('0x2b')](_0x33958e[_0x8934('0x3a')]['offset']);}return _0x43f760[_0x8934('0x5d')](_0x12fd3c);}})['then'](function(_0x32501c){if(_0x32501c){return _0x32501c?{'count':_0xab515e,'rows':_0x32501c}:null;}})[_0x8934('0x1c')](respondWithResult(_0x113e0f,null))[_0x8934('0x25')](handleError(_0x113e0f,null));};exports['setTags']=function(_0xf8b851,_0x13905f,_0x27de9a){if(_0xf8b851[_0x8934('0x54')]['id']){delete _0xf8b851['body']['id'];}return db[_0x8934('0x36')][_0x8934('0x57')]({'where':{'id':_0xf8b851[_0x8934('0x50')]['id']}})['then'](handleEntityNotFound(_0x13905f,null))['then'](function(_0x4f4ca8){if(_0x4f4ca8){return _0x4f4ca8['setTags'](_0xf8b851[_0x8934('0x54')][_0x8934('0x5e')]||[]);}return null;})['then'](respondWithResult(_0x13905f,null))['catch'](handleError(_0x13905f,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 93bfdce..050e7e6 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5dce=['exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','./intZendeskConfiguration.attributes'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x5dce,0x154));var _0xe5dc=function(_0x50e6f8,_0x571bd2){_0x50e6f8=_0x50e6f8-0x0;var _0xf7fd5=_0x5dce[_0x50e6f8];return _0xf7fd5;};'use strict';var _=require(_0xe5dc('0x0'));var util=require(_0xe5dc('0x1'));var logger=require(_0xe5dc('0x2'))(_0xe5dc('0x3'));var moment=require('moment');var BPromise=require(_0xe5dc('0x4'));var rp=require(_0xe5dc('0x5'));var fs=require('fs');var path=require(_0xe5dc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe5dc('0x7'));module[_0xe5dc('0x8')]=function(_0x5205c9,_0x27db5f){return _0x5205c9[_0xe5dc('0x9')](_0xe5dc('0xa'),attributes,{'tableName':_0xe5dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ed6=['path','../../config/environment','./intZendeskConfiguration.attributes','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2fd709,_0x28b02a){var _0x4ce4d3=function(_0x56c09c){while(--_0x56c09c){_0x2fd709['push'](_0x2fd709['shift']());}};_0x4ce4d3(++_0x28b02a);}(_0x2ed6,0x1c1));var _0x62ed=function(_0x559e00,_0x24bfec){_0x559e00=_0x559e00-0x0;var _0x44dfb7=_0x2ed6[_0x559e00];return _0x44dfb7;};'use strict';var _=require(_0x62ed('0x0'));var util=require(_0x62ed('0x1'));var logger=require(_0x62ed('0x2'))(_0x62ed('0x3'));var moment=require(_0x62ed('0x4'));var BPromise=require(_0x62ed('0x5'));var rp=require(_0x62ed('0x6'));var fs=require('fs');var path=require(_0x62ed('0x7'));var rimraf=require('rimraf');var config=require(_0x62ed('0x8'));var attributes=require(_0x62ed('0x9'));module['exports']=function(_0x2380b5,_0x56c62c){return _0x2380b5['define'](_0x62ed('0xa'),attributes,{'tableName':_0x62ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 9650af5..24b678f 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x351d=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x1432a0,_0xe9af2){var _0x282c95=function(_0x14f3fb){while(--_0x14f3fb){_0x1432a0['push'](_0x1432a0['shift']());}};_0x282c95(++_0xe9af2);}(_0x351d,0xb9));var _0xd351=function(_0x17dfa7,_0x2fea10){_0x17dfa7=_0x17dfa7-0x0;var _0xf593cf=_0x351d[_0x17dfa7];return _0xf593cf;};'use strict';var _=require('lodash');var util=require(_0xd351('0x0'));var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require(_0xd351('0x4'));var db=require(_0xd351('0x5'))['db'];var utils=require(_0xd351('0x6'));var logger=require(_0xd351('0x7'))(_0xd351('0x8'));var config=require(_0xd351('0x9'));var jayson=require(_0xd351('0xa'));var client=jayson[_0xd351('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22d76,_0x1fc789,_0x976377){return new BPromise(function(_0x18016d,_0x25e9a1){return client[_0xd351('0xc')](_0x22d76,_0x976377)[_0xd351('0xd')](function(_0xac3467){logger[_0xd351('0xe')](_0xd351('0xf'),_0x1fc789,'request\x20sent');logger['debug'](_0xd351('0x10'),_0x1fc789,'request\x20sent',JSON[_0xd351('0x11')](_0xac3467));if(_0xac3467['error']){if(_0xac3467[_0xd351('0x12')][_0xd351('0x13')]===0x1f4){logger['error'](_0xd351('0xf'),_0x1fc789,_0xac3467[_0xd351('0x12')][_0xd351('0x14')]);return _0x25e9a1(_0xac3467[_0xd351('0x12')][_0xd351('0x14')]);}logger['error'](_0xd351('0xf'),_0x1fc789,_0xac3467['error'][_0xd351('0x14')]);return _0x18016d(_0xac3467[_0xd351('0x12')][_0xd351('0x14')]);}else{logger['info'](_0xd351('0xf'),_0x1fc789,_0xd351('0x15'));_0x18016d(_0xac3467['result'][_0xd351('0x14')]);}})[_0xd351('0x16')](function(_0x15a5f0){logger[_0xd351('0x12')](_0xd351('0xf'),_0x1fc789,_0x15a5f0);_0x25e9a1(_0x15a5f0);});});} \ No newline at end of file +var _0xa41e=['moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util'];(function(_0x2fd693,_0x506cb8){var _0x944a4e=function(_0x45f7da){while(--_0x45f7da){_0x2fd693['push'](_0x2fd693['shift']());}};_0x944a4e(++_0x506cb8);}(_0xa41e,0x142));var _0xea41=function(_0x1dd470,_0x50193b){_0x1dd470=_0x1dd470-0x0;var _0x23f747=_0xa41e[_0x1dd470];return _0x23f747;};'use strict';var _=require('lodash');var util=require(_0xea41('0x0'));var moment=require(_0xea41('0x1'));var BPromise=require(_0xea41('0x2'));var rs=require(_0xea41('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xea41('0x4'));var logger=require(_0xea41('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xea41('0x6'));var client=jayson[_0xea41('0x7')][_0xea41('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59a869,_0x35a89c,_0x55c28f){return new BPromise(function(_0x230b22,_0xb188c0){return client['request'](_0x59a869,_0x55c28f)['then'](function(_0x479d1b){logger[_0xea41('0x9')](_0xea41('0xa'),_0x35a89c,_0xea41('0xb'));logger[_0xea41('0xc')](_0xea41('0xd'),_0x35a89c,_0xea41('0xb'),JSON[_0xea41('0xe')](_0x479d1b));if(_0x479d1b['error']){if(_0x479d1b[_0xea41('0xf')][_0xea41('0x10')]===0x1f4){logger[_0xea41('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x35a89c,_0x479d1b[_0xea41('0xf')][_0xea41('0x11')]);return _0xb188c0(_0x479d1b[_0xea41('0xf')]['message']);}logger[_0xea41('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x35a89c,_0x479d1b['error'][_0xea41('0x11')]);return _0x230b22(_0x479d1b['error'][_0xea41('0x11')]);}else{logger[_0xea41('0x9')](_0xea41('0xa'),_0x35a89c,'request\x20sent');_0x230b22(_0x479d1b[_0xea41('0x12')][_0xea41('0x11')]);}})['catch'](function(_0x5e1b9f){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x35a89c,_0x5e1b9f);_0xb188c0(_0x5e1b9f);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 18362f6..42ddc1f 100644 --- a/server/api/intZendeskField/index.js +++ b/server/api/intZendeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8347=['show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id'];(function(_0x45bc22,_0x211186){var _0x2c76ef=function(_0x437ee0){while(--_0x437ee0){_0x45bc22['push'](_0x45bc22['shift']());}};_0x2c76ef(++_0x211186);}(_0x8347,0xa9));var _0x7834=function(_0x34f167,_0x2fa3d0){_0x34f167=_0x34f167-0x0;var _0x2faa72=_0x8347[_0x34f167];return _0x2faa72;};'use strict';var multer=require(_0x7834('0x0'));var util=require(_0x7834('0x1'));var path=require('path');var timeout=require(_0x7834('0x2'));var express=require(_0x7834('0x3'));var router=express[_0x7834('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7834('0x5'));var config=require(_0x7834('0x6'));var controller=require(_0x7834('0x7'));router[_0x7834('0x8')]('/',auth[_0x7834('0x9')](),controller['index']);router['get'](_0x7834('0xa'),auth[_0x7834('0x9')](),controller[_0x7834('0xb')]);router[_0x7834('0xc')]('/',auth[_0x7834('0x9')](),controller['create']);router[_0x7834('0xd')](_0x7834('0xa'),auth['isAuthenticated'](),controller[_0x7834('0xe')]);router[_0x7834('0xf')](_0x7834('0xa'),auth[_0x7834('0x9')](),controller[_0x7834('0x10')]);module[_0x7834('0x11')]=router; \ No newline at end of file +var _0xe42c=['index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe42c,0x149));var _0xce42=function(_0x4f548b,_0x1177b9){_0x4f548b=_0x4f548b-0x0;var _0x57a83f=_0xe42c[_0x4f548b];return _0x57a83f;};'use strict';var multer=require(_0xce42('0x0'));var util=require(_0xce42('0x1'));var path=require(_0xce42('0x2'));var timeout=require(_0xce42('0x3'));var express=require(_0xce42('0x4'));var router=express[_0xce42('0x5')]();var auth=require(_0xce42('0x6'));var interaction=require(_0xce42('0x7'));var config=require(_0xce42('0x8'));var controller=require('./intZendeskField.controller');router[_0xce42('0x9')]('/',auth[_0xce42('0xa')](),controller[_0xce42('0xb')]);router[_0xce42('0x9')](_0xce42('0xc'),auth[_0xce42('0xa')](),controller[_0xce42('0xd')]);router[_0xce42('0xe')]('/',auth[_0xce42('0xa')](),controller[_0xce42('0xf')]);router[_0xce42('0x10')](_0xce42('0xc'),auth[_0xce42('0xa')](),controller[_0xce42('0x11')]);router[_0xce42('0x12')](_0xce42('0xc'),auth['isAuthenticated'](),controller[_0xce42('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 2c75e6a..940126c 100644 --- a/server/api/intZendeskField/intZendeskField.attributes.js +++ b/server/api/intZendeskField/intZendeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61a5=['sequelize','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x2485f1,_0x126dc4){var _0x3fc3e3=function(_0x26ac45){while(--_0x26ac45){_0x2485f1['push'](_0x2485f1['shift']());}};_0x3fc3e3(++_0x126dc4);}(_0x61a5,0xf0));var _0x561a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x61a5[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x561a('0x0'));module['exports']={'type':{'type':Sequelize[_0x561a('0x1')](_0x561a('0x2'),_0x561a('0x3'),_0x561a('0x4'),_0x561a('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x561a('0x6')]},'key':{'type':Sequelize[_0x561a('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x561a('0x2'),_0x561a('0x3'),_0x561a('0x4'))},'keyContent':{'type':Sequelize[_0x561a('0x6')]},'idField':{'type':Sequelize[_0x561a('0x6')]},'nameField':{'type':Sequelize[_0x561a('0x6')]},'customField':{'type':Sequelize[_0x561a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7ee4=['keyValue','STRING','customVariable','BOOLEAN','sequelize','exports','string','variable'];(function(_0x1402ce,_0x809504){var _0x30b3ce=function(_0xc50a42){while(--_0xc50a42){_0x1402ce['push'](_0x1402ce['shift']());}};_0x30b3ce(++_0x809504);}(_0x7ee4,0xbc));var _0x47ee=function(_0x4054e2,_0x31572a){_0x4054e2=_0x4054e2-0x0;var _0x54ebdf=_0x7ee4[_0x4054e2];return _0x54ebdf;};'use strict';var Sequelize=require(_0x47ee('0x0'));module[_0x47ee('0x1')]={'type':{'type':Sequelize['ENUM'](_0x47ee('0x2'),_0x47ee('0x3'),'customVariable',_0x47ee('0x4')),'defaultValue':_0x47ee('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x47ee('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x47ee('0x2'),_0x47ee('0x3'),_0x47ee('0x6'))},'keyContent':{'type':Sequelize[_0x47ee('0x5')]},'idField':{'type':Sequelize[_0x47ee('0x5')]},'nameField':{'type':Sequelize[_0x47ee('0x5')]},'customField':{'type':Sequelize[_0x47ee('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x47ee('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 2eb4793..4adaeee 100644 --- a/server/api/intZendeskField/intZendeskField.controller.js +++ b/server/api/intZendeskField/intZendeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c9d=['offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ZendeskField','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','field','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','end','status','count'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x5c9d,0x1d2));var _0xd5c9=function(_0x239632,_0x472e6a){_0x239632=_0x239632-0x0;var _0x2fad25=_0x5c9d[_0x239632];return _0x2fad25;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd5c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd5c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd5c9('0x2'));var moment=require(_0xd5c9('0x3'));var BPromise=require(_0xd5c9('0x4'));var Mustache=require('mustache');var util=require(_0xd5c9('0x5'));var path=require(_0xd5c9('0x6'));var sox=require(_0xd5c9('0x7'));var csv=require(_0xd5c9('0x8'));var ejs=require(_0xd5c9('0x9'));var fs=require('fs');var _=require(_0xd5c9('0xa'));var squel=require(_0xd5c9('0xb'));var crypto=require(_0xd5c9('0xc'));var jsforce=require(_0xd5c9('0xd'));var deskjs=require(_0xd5c9('0xe'));var toCsv=require(_0xd5c9('0x8'));var querystring=require(_0xd5c9('0xf'));var Papa=require(_0xd5c9('0x10'));var Redis=require(_0xd5c9('0x11'));var authService=require(_0xd5c9('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd5c9('0x13'));var utils=require(_0xd5c9('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d448f,_0x344233){_0x344233=_0x344233||0xcc;return function(_0x2f9045){if(_0x2f9045){return _0x1d448f['sendStatus'](_0x344233);}return _0x1d448f['status'](_0x344233)[_0xd5c9('0x15')]();};}function respondWithResult(_0x2e013a,_0x5a27be){_0x5a27be=_0x5a27be||0xc8;return function(_0x1f9231){if(_0x1f9231){return _0x2e013a[_0xd5c9('0x16')](_0x5a27be)['json'](_0x1f9231);}};}function respondWithFilteredResult(_0x4bec51,_0x214207){return function(_0x3b80da){if(_0x3b80da){var _0x491fdf=_0x3b80da[_0xd5c9('0x17')],_0x3609fe=_0x214207[_0xd5c9('0x18')],_0x35683c=_0x214207[_0xd5c9('0x18')]+_0x214207[_0xd5c9('0x19')],_0x1c5f4e;if(_0x35683c>=_0x491fdf){_0x35683c=_0x491fdf;_0x1c5f4e=0xc8;}else{_0x1c5f4e=0xce;}_0x4bec51['status'](_0x1c5f4e);return _0x4bec51['set'](_0xd5c9('0x1a'),_0x3609fe+'-'+_0x35683c+'/'+_0x491fdf)[_0xd5c9('0x1b')](_0x3b80da);}return null;};}function patchUpdates(_0x36e83d){return function(_0x2da940){try{jsonpatch[_0xd5c9('0x1c')](_0x2da940,_0x36e83d,!![]);}catch(_0x3c1dcf){return BPromise[_0xd5c9('0x1d')](_0x3c1dcf);}return _0x2da940[_0xd5c9('0x1e')]();};}function saveUpdates(_0x5706a3,_0x94a91e){return function(_0x153543){if(_0x153543){return _0x153543[_0xd5c9('0x1f')](_0x5706a3)[_0xd5c9('0x20')](function(_0x66a48e){return _0x66a48e;});}return null;};}function removeEntity(_0x116a4d,_0x894e40){return function(_0x426ad9){if(_0x426ad9){return _0x426ad9[_0xd5c9('0x21')]()[_0xd5c9('0x20')](function(){_0x116a4d[_0xd5c9('0x16')](0xcc)[_0xd5c9('0x15')]();});}};}function handleEntityNotFound(_0x3b1e30,_0x3a2bc5){return function(_0x1d55f1){if(!_0x1d55f1){_0x3b1e30[_0xd5c9('0x22')](0x194);}return _0x1d55f1;};}function handleError(_0x38d729,_0x4f28c7){_0x4f28c7=_0x4f28c7||0x1f4;return function(_0x7371ae){logger[_0xd5c9('0x23')](_0x7371ae[_0xd5c9('0x24')]);if(_0x7371ae[_0xd5c9('0x25')]){delete _0x7371ae[_0xd5c9('0x25')];}_0x38d729[_0xd5c9('0x16')](_0x4f28c7)[_0xd5c9('0x26')](_0x7371ae);};}exports[_0xd5c9('0x27')]=function(_0x22dc03,_0x339ddf){var _0x14326a={},_0x2ab091={},_0x11c4f3={'count':0x0,'rows':[]};var _0x14dc46=db[_0xd5c9('0x28')][_0xd5c9('0x29')];_0x2ab091[_0xd5c9('0x2a')]=_['keys'](_0x14dc46);_0x2ab091['query']=_[_0xd5c9('0x2b')](_0x22dc03[_0xd5c9('0x2c')]);_0x2ab091[_0xd5c9('0x2d')]=_['intersection'](_0x2ab091[_0xd5c9('0x2a')],_0x2ab091[_0xd5c9('0x2c')]);_0x14326a[_0xd5c9('0x2e')]=_[_0xd5c9('0x2f')](_0x2ab091[_0xd5c9('0x2a')],qs[_0xd5c9('0x30')](_0x22dc03[_0xd5c9('0x2c')][_0xd5c9('0x30')]));_0x14326a['attributes']=_0x14326a['attributes']['length']?_0x14326a['attributes']:_0x2ab091[_0xd5c9('0x2a')];if(!_0x22dc03['query'][_0xd5c9('0x31')](_0xd5c9('0x32'))){_0x14326a[_0xd5c9('0x19')]=qs[_0xd5c9('0x19')](_0x22dc03[_0xd5c9('0x2c')]['limit']);_0x14326a['offset']=qs[_0xd5c9('0x18')](_0x22dc03[_0xd5c9('0x2c')][_0xd5c9('0x18')]);}_0x14326a['order']=qs[_0xd5c9('0x33')](_0x22dc03[_0xd5c9('0x2c')][_0xd5c9('0x33')]);_0x14326a[_0xd5c9('0x34')]=qs[_0xd5c9('0x2d')](_[_0xd5c9('0x35')](_0x22dc03['query'],_0x2ab091[_0xd5c9('0x2d')]));if(_0x22dc03[_0xd5c9('0x2c')][_0xd5c9('0x36')]){_0x14326a[_0xd5c9('0x34')]=_[_0xd5c9('0x37')](_0x14326a['where'],{'$or':_[_0xd5c9('0x38')](_0x14dc46,function(_0x2f8724){if(_0x2f8724[_0xd5c9('0x39')]['key']!=='VIRTUAL'){var _0x35d88b={};_0x35d88b[_0x2f8724[_0xd5c9('0x3a')]]={'$like':'%'+_0x22dc03[_0xd5c9('0x2c')]['filter']+'%'};return _0x35d88b;}})});}_0x14326a=_[_0xd5c9('0x37')]({},_0x14326a,_0x22dc03[_0xd5c9('0x3b')]);var _0x470782={'where':_0x14326a[_0xd5c9('0x34')]};return db[_0xd5c9('0x28')][_0xd5c9('0x17')](_0x470782)[_0xd5c9('0x20')](function(_0x2d08a3){_0x11c4f3[_0xd5c9('0x17')]=_0x2d08a3;if(_0x22dc03['query'][_0xd5c9('0x3c')]){_0x14326a[_0xd5c9('0x3d')]=[{'all':!![]}];}return db[_0xd5c9('0x28')][_0xd5c9('0x3e')](_0x14326a);})[_0xd5c9('0x20')](function(_0x550ebe){_0x11c4f3[_0xd5c9('0x3f')]=_0x550ebe;return _0x11c4f3;})['then'](respondWithFilteredResult(_0x339ddf,_0x14326a))[_0xd5c9('0x40')](handleError(_0x339ddf,null));};exports['show']=function(_0x49d2d8,_0x399532){var _0x30c256={'raw':!![],'where':{'id':_0x49d2d8[_0xd5c9('0x41')]['id']}},_0x813f8d={};_0x813f8d[_0xd5c9('0x2a')]=_[_0xd5c9('0x2b')](db[_0xd5c9('0x28')][_0xd5c9('0x29')]);_0x813f8d[_0xd5c9('0x2c')]=_[_0xd5c9('0x2b')](_0x49d2d8[_0xd5c9('0x2c')]);_0x813f8d[_0xd5c9('0x2d')]=_['intersection'](_0x813f8d[_0xd5c9('0x2a')],_0x813f8d[_0xd5c9('0x2c')]);_0x30c256[_0xd5c9('0x2e')]=_['intersection'](_0x813f8d['model'],qs['fields'](_0x49d2d8[_0xd5c9('0x2c')][_0xd5c9('0x30')]));_0x30c256[_0xd5c9('0x2e')]=_0x30c256[_0xd5c9('0x2e')][_0xd5c9('0x42')]?_0x30c256[_0xd5c9('0x2e')]:_0x813f8d[_0xd5c9('0x2a')];if(_0x49d2d8[_0xd5c9('0x2c')][_0xd5c9('0x3c')]){_0x30c256[_0xd5c9('0x3d')]=[{'all':!![]}];}_0x30c256=_[_0xd5c9('0x37')]({},_0x30c256,_0x49d2d8['options']);return db[_0xd5c9('0x28')][_0xd5c9('0x43')](_0x30c256)[_0xd5c9('0x20')](handleEntityNotFound(_0x399532,null))[_0xd5c9('0x20')](respondWithResult(_0x399532,null))[_0xd5c9('0x40')](handleError(_0x399532,null));};exports[_0xd5c9('0x44')]=function(_0x39ea11,_0x4a896c){return db[_0xd5c9('0x28')]['create'](_0x39ea11['body'],{})['then'](respondWithResult(_0x4a896c,0xc9))[_0xd5c9('0x40')](handleError(_0x4a896c,null));};exports[_0xd5c9('0x1f')]=function(_0x46a2f2,_0x56048b){if(_0x46a2f2[_0xd5c9('0x45')]['id']){delete _0x46a2f2['body']['id'];}return db['ZendeskField']['find']({'where':{'id':_0x46a2f2['params']['id']}})[_0xd5c9('0x20')](handleEntityNotFound(_0x56048b,null))[_0xd5c9('0x20')](saveUpdates(_0x46a2f2['body'],null))[_0xd5c9('0x20')](respondWithResult(_0x56048b,null))[_0xd5c9('0x40')](handleError(_0x56048b,null));};exports['destroy']=function(_0x1c4dd8,_0x3eb422){return db[_0xd5c9('0x28')]['find']({'where':{'id':_0x1c4dd8['params']['id']}})[_0xd5c9('0x20')](handleEntityNotFound(_0x3eb422,null))[_0xd5c9('0x20')](removeEntity(_0x3eb422,null))[_0xd5c9('0x40')](handleError(_0x3eb422,null));}; \ No newline at end of file +var _0x632c=['then','destroy','sendStatus','stack','name','index','ZendeskField','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','type','key','VIRTUAL','field','filter','merge','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x441290,_0x2e409b){var _0x44cf85=function(_0x5bc013){while(--_0x5bc013){_0x441290['push'](_0x441290['shift']());}};_0x44cf85(++_0x2e409b);}(_0x632c,0x109));var _0xc632=function(_0x2d8352,_0xbc0e33){_0x2d8352=_0x2d8352-0x0;var _0x478851=_0x632c[_0x2d8352];return _0x478851;};'use strict';var pdf=require(_0xc632('0x0'));var emlformat=require(_0xc632('0x1'));var rimraf=require(_0xc632('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc632('0x3'));var rp=require(_0xc632('0x4'));var moment=require('moment');var BPromise=require(_0xc632('0x5'));var Mustache=require(_0xc632('0x6'));var util=require(_0xc632('0x7'));var path=require(_0xc632('0x8'));var sox=require(_0xc632('0x9'));var csv=require(_0xc632('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc632('0xb'));var squel=require('squel');var crypto=require(_0xc632('0xc'));var jsforce=require(_0xc632('0xd'));var deskjs=require(_0xc632('0xe'));var toCsv=require(_0xc632('0xa'));var querystring=require(_0xc632('0xf'));var Papa=require(_0xc632('0x10'));var Redis=require(_0xc632('0x11'));var authService=require(_0xc632('0x12'));var qs=require(_0xc632('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc632('0x14'))('api');var utils=require(_0xc632('0x15'));var config=require(_0xc632('0x16'));var db=require(_0xc632('0x17'))['db'];function respondWithStatusCode(_0x4256b7,_0x4251c8){_0x4251c8=_0x4251c8||0xcc;return function(_0x15913b){if(_0x15913b){return _0x4256b7['sendStatus'](_0x4251c8);}return _0x4256b7[_0xc632('0x18')](_0x4251c8)[_0xc632('0x19')]();};}function respondWithResult(_0x346bf9,_0x1e2595){_0x1e2595=_0x1e2595||0xc8;return function(_0x5a09a2){if(_0x5a09a2){return _0x346bf9[_0xc632('0x18')](_0x1e2595)[_0xc632('0x1a')](_0x5a09a2);}};}function respondWithFilteredResult(_0xe5c6d,_0x45cb84){return function(_0xa3416f){if(_0xa3416f){var _0x4f4e2b=_0xa3416f['count'],_0xaa07ff=_0x45cb84[_0xc632('0x1b')],_0x4b247b=_0x45cb84[_0xc632('0x1b')]+_0x45cb84[_0xc632('0x1c')],_0x190603;if(_0x4b247b>=_0x4f4e2b){_0x4b247b=_0x4f4e2b;_0x190603=0xc8;}else{_0x190603=0xce;}_0xe5c6d[_0xc632('0x18')](_0x190603);return _0xe5c6d[_0xc632('0x1d')](_0xc632('0x1e'),_0xaa07ff+'-'+_0x4b247b+'/'+_0x4f4e2b)[_0xc632('0x1a')](_0xa3416f);}return null;};}function patchUpdates(_0x23beaf){return function(_0x5359f9){try{jsonpatch[_0xc632('0x1f')](_0x5359f9,_0x23beaf,!![]);}catch(_0x53bc2d){return BPromise[_0xc632('0x20')](_0x53bc2d);}return _0x5359f9[_0xc632('0x21')]();};}function saveUpdates(_0x3074b5,_0x4243b9){return function(_0x5bd43e){if(_0x5bd43e){return _0x5bd43e[_0xc632('0x22')](_0x3074b5)[_0xc632('0x23')](function(_0x229479){return _0x229479;});}return null;};}function removeEntity(_0x59f114,_0x13e934){return function(_0x3528bb){if(_0x3528bb){return _0x3528bb[_0xc632('0x24')]()[_0xc632('0x23')](function(){_0x59f114[_0xc632('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1757ed,_0x4b18ca){return function(_0x555161){if(!_0x555161){_0x1757ed[_0xc632('0x25')](0x194);}return _0x555161;};}function handleError(_0x57f3d7,_0x4c4c00){_0x4c4c00=_0x4c4c00||0x1f4;return function(_0x3dc739){logger['error'](_0x3dc739[_0xc632('0x26')]);if(_0x3dc739[_0xc632('0x27')]){delete _0x3dc739[_0xc632('0x27')];}_0x57f3d7[_0xc632('0x18')](_0x4c4c00)['send'](_0x3dc739);};}exports[_0xc632('0x28')]=function(_0xf6f8b8,_0x137f3f){var _0x4f5048={},_0x5815ba={},_0x320161={'count':0x0,'rows':[]};var _0x4a4dd0=db[_0xc632('0x29')]['rawAttributes'];_0x5815ba['model']=_[_0xc632('0x2a')](_0x4a4dd0);_0x5815ba[_0xc632('0x2b')]=_[_0xc632('0x2a')](_0xf6f8b8[_0xc632('0x2b')]);_0x5815ba['filters']=_[_0xc632('0x2c')](_0x5815ba[_0xc632('0x2d')],_0x5815ba['query']);_0x4f5048[_0xc632('0x2e')]=_[_0xc632('0x2c')](_0x5815ba['model'],qs[_0xc632('0x2f')](_0xf6f8b8[_0xc632('0x2b')][_0xc632('0x2f')]));_0x4f5048[_0xc632('0x2e')]=_0x4f5048[_0xc632('0x2e')][_0xc632('0x30')]?_0x4f5048[_0xc632('0x2e')]:_0x5815ba['model'];if(!_0xf6f8b8[_0xc632('0x2b')][_0xc632('0x31')](_0xc632('0x32'))){_0x4f5048[_0xc632('0x1c')]=qs['limit'](_0xf6f8b8['query'][_0xc632('0x1c')]);_0x4f5048[_0xc632('0x1b')]=qs[_0xc632('0x1b')](_0xf6f8b8[_0xc632('0x2b')]['offset']);}_0x4f5048[_0xc632('0x33')]=qs[_0xc632('0x34')](_0xf6f8b8[_0xc632('0x2b')][_0xc632('0x34')]);_0x4f5048['where']=qs[_0xc632('0x35')](_[_0xc632('0x36')](_0xf6f8b8[_0xc632('0x2b')],_0x5815ba[_0xc632('0x35')]));if(_0xf6f8b8['query']['filter']){_0x4f5048[_0xc632('0x37')]=_['merge'](_0x4f5048[_0xc632('0x37')],{'$or':_['map'](_0x4a4dd0,function(_0x35b7f6){if(_0x35b7f6[_0xc632('0x38')][_0xc632('0x39')]!==_0xc632('0x3a')){var _0x4ac714={};_0x4ac714[_0x35b7f6[_0xc632('0x3b')]]={'$like':'%'+_0xf6f8b8[_0xc632('0x2b')][_0xc632('0x3c')]+'%'};return _0x4ac714;}})});}_0x4f5048=_[_0xc632('0x3d')]({},_0x4f5048,_0xf6f8b8[_0xc632('0x3e')]);var _0x582dfe={'where':_0x4f5048[_0xc632('0x37')]};return db['ZendeskField'][_0xc632('0x3f')](_0x582dfe)[_0xc632('0x23')](function(_0x22f535){_0x320161[_0xc632('0x3f')]=_0x22f535;if(_0xf6f8b8['query'][_0xc632('0x40')]){_0x4f5048[_0xc632('0x41')]=[{'all':!![]}];}return db[_0xc632('0x29')][_0xc632('0x42')](_0x4f5048);})['then'](function(_0x38d0c5){_0x320161[_0xc632('0x43')]=_0x38d0c5;return _0x320161;})[_0xc632('0x23')](respondWithFilteredResult(_0x137f3f,_0x4f5048))['catch'](handleError(_0x137f3f,null));};exports[_0xc632('0x44')]=function(_0x24050a,_0x4f3421){var _0x169d11={'raw':!![],'where':{'id':_0x24050a[_0xc632('0x45')]['id']}},_0x4fbb5c={};_0x4fbb5c['model']=_[_0xc632('0x2a')](db['ZendeskField'][_0xc632('0x46')]);_0x4fbb5c[_0xc632('0x2b')]=_[_0xc632('0x2a')](_0x24050a['query']);_0x4fbb5c[_0xc632('0x35')]=_[_0xc632('0x2c')](_0x4fbb5c[_0xc632('0x2d')],_0x4fbb5c[_0xc632('0x2b')]);_0x169d11[_0xc632('0x2e')]=_[_0xc632('0x2c')](_0x4fbb5c[_0xc632('0x2d')],qs['fields'](_0x24050a[_0xc632('0x2b')][_0xc632('0x2f')]));_0x169d11[_0xc632('0x2e')]=_0x169d11['attributes'][_0xc632('0x30')]?_0x169d11[_0xc632('0x2e')]:_0x4fbb5c['model'];if(_0x24050a[_0xc632('0x2b')][_0xc632('0x40')]){_0x169d11[_0xc632('0x41')]=[{'all':!![]}];}_0x169d11=_[_0xc632('0x3d')]({},_0x169d11,_0x24050a[_0xc632('0x3e')]);return db[_0xc632('0x29')][_0xc632('0x47')](_0x169d11)[_0xc632('0x23')](handleEntityNotFound(_0x4f3421,null))[_0xc632('0x23')](respondWithResult(_0x4f3421,null))[_0xc632('0x48')](handleError(_0x4f3421,null));};exports[_0xc632('0x49')]=function(_0x3f57c1,_0x42dc9a){return db[_0xc632('0x29')]['create'](_0x3f57c1[_0xc632('0x4a')],{})[_0xc632('0x23')](respondWithResult(_0x42dc9a,0xc9))[_0xc632('0x48')](handleError(_0x42dc9a,null));};exports['update']=function(_0x477aa3,_0xd679b9){if(_0x477aa3[_0xc632('0x4a')]['id']){delete _0x477aa3['body']['id'];}return db['ZendeskField'][_0xc632('0x47')]({'where':{'id':_0x477aa3[_0xc632('0x45')]['id']}})['then'](handleEntityNotFound(_0xd679b9,null))['then'](saveUpdates(_0x477aa3[_0xc632('0x4a')],null))[_0xc632('0x23')](respondWithResult(_0xd679b9,null))[_0xc632('0x48')](handleError(_0xd679b9,null));};exports[_0xc632('0x24')]=function(_0x289e95,_0x1e62b9){return db[_0xc632('0x29')]['find']({'where':{'id':_0x289e95['params']['id']}})[_0xc632('0x23')](handleEntityNotFound(_0x1e62b9,null))[_0xc632('0x23')](removeEntity(_0x1e62b9,null))[_0xc632('0x48')](handleError(_0x1e62b9,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 2145883..bddacaa 100644 --- a/server/api/intZendeskField/intZendeskField.model.js +++ b/server/api/intZendeskField/intZendeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bb4=['ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','exports'];(function(_0x29fbca,_0x3c714d){var _0x47e6ab=function(_0x155541){while(--_0x155541){_0x29fbca['push'](_0x29fbca['shift']());}};_0x47e6ab(++_0x3c714d);}(_0x9bb4,0xd5));var _0x49bb=function(_0x37bf00,_0x283950){_0x37bf00=_0x37bf00-0x0;var _0x3ef385=_0x9bb4[_0x37bf00];return _0x3ef385;};'use strict';var _=require(_0x49bb('0x0'));var util=require(_0x49bb('0x1'));var logger=require(_0x49bb('0x2'))(_0x49bb('0x3'));var moment=require(_0x49bb('0x4'));var BPromise=require(_0x49bb('0x5'));var rp=require(_0x49bb('0x6'));var fs=require('fs');var path=require(_0x49bb('0x7'));var rimraf=require(_0x49bb('0x8'));var config=require('../../config/environment');var attributes=require(_0x49bb('0x9'));module[_0x49bb('0xa')]=function(_0xbe290c,_0x2375ac){return _0xbe290c['define'](_0x49bb('0xb'),attributes,{'tableName':_0x49bb('0xc'),'paranoid':![],'indexes':[{'name':_0x49bb('0xd'),'fields':[_0x49bb('0xe'),_0x49bb('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x97a2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','../../config/logger'];(function(_0x5507a0,_0x38ee40){var _0x7a96f1=function(_0x2b3df5){while(--_0x2b3df5){_0x5507a0['push'](_0x5507a0['shift']());}};_0x7a96f1(++_0x38ee40);}(_0x97a2,0x1b1));var _0x297a=function(_0x364e1f,_0x439899){_0x364e1f=_0x364e1f-0x0;var _0x4f9ceb=_0x97a2[_0x364e1f];return _0x4f9ceb;};'use strict';var _=require(_0x297a('0x0'));var util=require('util');var logger=require(_0x297a('0x1'))(_0x297a('0x2'));var moment=require(_0x297a('0x3'));var BPromise=require(_0x297a('0x4'));var rp=require(_0x297a('0x5'));var fs=require('fs');var path=require(_0x297a('0x6'));var rimraf=require(_0x297a('0x7'));var config=require(_0x297a('0x8'));var attributes=require('./intZendeskField.attributes');module[_0x297a('0x9')]=function(_0x2a420b,_0x2c1f41){return _0x2a420b[_0x297a('0xa')](_0x297a('0xb'),attributes,{'tableName':_0x297a('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x297a('0xd'),_0x297a('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 2f70d6b..4007477 100644 --- a/server/api/intZendeskField/intZendeskField.rpc.js +++ b/server/api/intZendeskField/intZendeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9050=['code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9050,0xea));var _0x0905=function(_0x49c40c,_0x57c5aa){_0x49c40c=_0x49c40c-0x0;var _0x4d29c0=_0x9050[_0x49c40c];return _0x4d29c0;};'use strict';var _=require(_0x0905('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0905('0x1'));var rs=require(_0x0905('0x2'));var fs=require('fs');var Redis=require(_0x0905('0x3'));var db=require(_0x0905('0x4'))['db'];var utils=require(_0x0905('0x5'));var logger=require(_0x0905('0x6'))(_0x0905('0x7'));var config=require('../../config/environment');var jayson=require(_0x0905('0x8'));var client=jayson[_0x0905('0x9')][_0x0905('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e65ee,_0x3907d5,_0x27eb02){return new BPromise(function(_0x100754,_0x4b825e){return client['request'](_0x5e65ee,_0x27eb02)[_0x0905('0xb')](function(_0xb387d0){logger[_0x0905('0xc')](_0x0905('0xd'),_0x3907d5,_0x0905('0xe'));logger[_0x0905('0xf')](_0x0905('0x10'),_0x3907d5,_0x0905('0xe'),JSON[_0x0905('0x11')](_0xb387d0));if(_0xb387d0['error']){if(_0xb387d0[_0x0905('0x12')][_0x0905('0x13')]===0x1f4){logger[_0x0905('0x12')](_0x0905('0xd'),_0x3907d5,_0xb387d0[_0x0905('0x12')][_0x0905('0x14')]);return _0x4b825e(_0xb387d0['error'][_0x0905('0x14')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x3907d5,_0xb387d0['error'][_0x0905('0x14')]);return _0x100754(_0xb387d0['error'][_0x0905('0x14')]);}else{logger['info'](_0x0905('0xd'),_0x3907d5,_0x0905('0xe'));_0x100754(_0xb387d0[_0x0905('0x15')][_0x0905('0x14')]);}})[_0x0905('0x16')](function(_0x8ae5f3){logger[_0x0905('0x12')]('ZendeskField,\x20%s,\x20%s',_0x3907d5,_0x8ae5f3);_0x4b825e(_0x8ae5f3);});});} \ No newline at end of file +var _0x4118=['info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then'];(function(_0x1c31ff,_0x4d7927){var _0x1c657a=function(_0x46a4e8){while(--_0x46a4e8){_0x1c31ff['push'](_0x1c31ff['shift']());}};_0x1c657a(++_0x4d7927);}(_0x4118,0x127));var _0x8411=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4118[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x8411('0x0'));var util=require('util');var moment=require(_0x8411('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8411('0x2'));var db=require(_0x8411('0x3'))['db'];var utils=require(_0x8411('0x4'));var logger=require(_0x8411('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8411('0x6'));var client=jayson['client'][_0x8411('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4fae3b,_0x34c832,_0x307904){return new BPromise(function(_0x384575,_0x1cb5a2){return client['request'](_0x4fae3b,_0x307904)[_0x8411('0x8')](function(_0x32c897){logger[_0x8411('0x9')](_0x8411('0xa'),_0x34c832,_0x8411('0xb'));logger[_0x8411('0xc')](_0x8411('0xd'),_0x34c832,'request\x20sent',JSON[_0x8411('0xe')](_0x32c897));if(_0x32c897[_0x8411('0xf')]){if(_0x32c897['error'][_0x8411('0x10')]===0x1f4){logger[_0x8411('0xf')](_0x8411('0xa'),_0x34c832,_0x32c897[_0x8411('0xf')][_0x8411('0x11')]);return _0x1cb5a2(_0x32c897[_0x8411('0xf')][_0x8411('0x11')]);}logger[_0x8411('0xf')](_0x8411('0xa'),_0x34c832,_0x32c897[_0x8411('0xf')][_0x8411('0x11')]);return _0x384575(_0x32c897['error'][_0x8411('0x11')]);}else{logger[_0x8411('0x9')](_0x8411('0xa'),_0x34c832,_0x8411('0xb'));_0x384575(_0x32c897[_0x8411('0x12')][_0x8411('0x11')]);}})['catch'](function(_0x4e93c5){logger[_0x8411('0xf')](_0x8411('0xa'),_0x34c832,_0x4e93c5);_0x1cb5a2(_0x4e93c5);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index ec5b899..af50893 100644 --- a/server/api/intZohoAccount/index.js +++ b/server/api/intZohoAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6840=['/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x6840,0xc3));var _0x0684=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6840[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x0684('0x0'));var util=require(_0x0684('0x1'));var path=require(_0x0684('0x2'));var timeout=require('connect-timeout');var express=require(_0x0684('0x3'));var router=express[_0x0684('0x4')]();var auth=require(_0x0684('0x5'));var interaction=require(_0x0684('0x6'));var config=require(_0x0684('0x7'));var controller=require(_0x0684('0x8'));router[_0x0684('0x9')]('/',auth[_0x0684('0xa')](),controller[_0x0684('0xb')]);router[_0x0684('0x9')](_0x0684('0xc'),auth[_0x0684('0xa')](),controller['show']);router['get'](_0x0684('0xd'),auth[_0x0684('0xa')](),controller[_0x0684('0xe')]);router[_0x0684('0x9')]('/:id/fields',auth[_0x0684('0xa')](),controller[_0x0684('0xf')]);router[_0x0684('0x10')]('/',auth[_0x0684('0xa')](),controller[_0x0684('0x11')]);router[_0x0684('0x10')](_0x0684('0xd'),auth['isAuthenticated'](),controller[_0x0684('0x12')]);router['put'](_0x0684('0xc'),auth[_0x0684('0xa')](),controller[_0x0684('0x13')]);router[_0x0684('0x14')]('/:id',auth[_0x0684('0xa')](),controller[_0x0684('0x15')]);module[_0x0684('0x16')]=router; \ No newline at end of file +var _0x93fc=['../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x48af6c,_0xd7fcfa){var _0x1d2b12=function(_0x37e299){while(--_0x37e299){_0x48af6c['push'](_0x48af6c['shift']());}};_0x1d2b12(++_0xd7fcfa);}(_0x93fc,0xee));var _0xc93f=function(_0x3ae4ed,_0x49ce9a){_0x3ae4ed=_0x3ae4ed-0x0;var _0x3cd425=_0x93fc[_0x3ae4ed];return _0x3cd425;};'use strict';var multer=require(_0xc93f('0x0'));var util=require(_0xc93f('0x1'));var path=require(_0xc93f('0x2'));var timeout=require(_0xc93f('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xc93f('0x4'));var interaction=require(_0xc93f('0x5'));var config=require('../../config/environment');var controller=require(_0xc93f('0x6'));router[_0xc93f('0x7')]('/',auth['isAuthenticated'](),controller[_0xc93f('0x8')]);router['get'](_0xc93f('0x9'),auth[_0xc93f('0xa')](),controller[_0xc93f('0xb')]);router[_0xc93f('0x7')]('/:id/configurations',auth[_0xc93f('0xa')](),controller['getConfigurations']);router[_0xc93f('0x7')](_0xc93f('0xc'),auth[_0xc93f('0xa')](),controller[_0xc93f('0xd')]);router['post']('/',auth[_0xc93f('0xa')](),controller[_0xc93f('0xe')]);router[_0xc93f('0xf')](_0xc93f('0x10'),auth[_0xc93f('0xa')](),controller[_0xc93f('0x11')]);router[_0xc93f('0x12')](_0xc93f('0x9'),auth[_0xc93f('0xa')](),controller[_0xc93f('0x13')]);router[_0xc93f('0x14')](_0xc93f('0x9'),auth[_0xc93f('0xa')](),controller['destroy']);module[_0xc93f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 545e125..1d02315 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a10=['sequelize','exports','STRING'];(function(_0x57c7bf,_0x3329fe){var _0x14ee23=function(_0x11867a){while(--_0x11867a){_0x57c7bf['push'](_0x57c7bf['shift']());}};_0x14ee23(++_0x3329fe);}(_0x6a10,0x174));var _0x06a1=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x6a10[_0x11ce46];return _0x368a1e;};'use strict';var Sequelize=require(_0x06a1('0x0'));module[_0x06a1('0x1')]={'name':{'type':Sequelize[_0x06a1('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x06a1('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x06a1('0x2')]},'clientSecret':{'type':Sequelize[_0x06a1('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0x06a1('0x2')]},'refreshToken':{'type':Sequelize[_0x06a1('0x2')]}}; \ No newline at end of file +var _0x529d=['exports','STRING','sequelize'];(function(_0x2d9142,_0x179010){var _0x4156d1=function(_0x3f30c8){while(--_0x3f30c8){_0x2d9142['push'](_0x2d9142['shift']());}};_0x4156d1(++_0x179010);}(_0x529d,0xe0));var _0xd529=function(_0x5ca134,_0x23b060){_0x5ca134=_0x5ca134-0x0;var _0x2714e9=_0x529d[_0x5ca134];return _0x2714e9;};'use strict';var Sequelize=require(_0xd529('0x0'));module[_0xd529('0x1')]={'name':{'type':Sequelize[_0xd529('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xd529('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd529('0x2')]},'clientSecret':{'type':Sequelize[_0xd529('0x2')]},'serverUrl':{'type':Sequelize[_0xd529('0x2')]},'code':{'type':Sequelize[_0xd529('0x2')]},'refreshToken':{'type':Sequelize[_0xd529('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 0f36e31..7480b26 100644 --- a/server/api/intZohoAccount/intZohoAccount.controller.js +++ b/server/api/intZohoAccount/intZohoAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4507=['reject','save','update','stack','name','send','index','ZohoAccount','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','show','params','length','find','body','getConfigurations','findOne','ZohoConfiguration','filter','addConfiguration','channel','getDescriptions','create','Subjects','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','getFields','host','serverUrl','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','api_name','push','custom_field','data_type','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range'];(function(_0x2e9fbc,_0x4ed831){var _0x4b8a8b=function(_0x49a2e7){while(--_0x49a2e7){_0x2e9fbc['push'](_0x2e9fbc['shift']());}};_0x4b8a8b(++_0x4ed831);}(_0x4507,0x15a));var _0x7450=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4507[_0x178e48];return _0x440d7e;};'use strict';var pdf=require(_0x7450('0x0'));var emlformat=require(_0x7450('0x1'));var rimraf=require(_0x7450('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7450('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7450('0x4'));var Mustache=require(_0x7450('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7450('0x6'));var csv=require(_0x7450('0x7'));var ejs=require(_0x7450('0x8'));var fs=require('fs');var _=require(_0x7450('0x9'));var squel=require(_0x7450('0xa'));var crypto=require(_0x7450('0xb'));var jsforce=require(_0x7450('0xc'));var deskjs=require(_0x7450('0xd'));var toCsv=require(_0x7450('0x7'));var querystring=require('querystring');var Papa=require(_0x7450('0xe'));var Redis=require(_0x7450('0xf'));var authService=require(_0x7450('0x10'));var qs=require(_0x7450('0x11'));var hardwareService=require(_0x7450('0x12'));var logger=require(_0x7450('0x13'))('api');var utils=require(_0x7450('0x14'));var config=require('../../config/environment');var db=require(_0x7450('0x15'))['db'];var integrations=require(_0x7450('0x16'));var jayson=require(_0x7450('0x17'));var client=jayson['client'][_0x7450('0x18')]({'port':0x232a});function checkPasswordPattern(_0x26b5df,_0x5cdaa1,_0x118d41){if(_0x118d41){var _0x4d26c3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4d26c3[_0x7450('0x19')](_0x5cdaa1)){return _0x26b5df;}else{throw new Error(_0x7450('0x1a'));}}else{return _0x26b5df;}}function respondWithRpcPromise(_0x532c91,_0xf510e7,_0x319169,_0x282933){return new BPromise(function(_0x5db730,_0x5c7461){var _0x4f793c=_0x282933||client;return _0x4f793c[_0x7450('0x1b')](_0x532c91,_0x319169)[_0x7450('0x1c')](function(_0x18da52){logger['info'](_0x7450('0x1d'),_0xf510e7,_0x7450('0x1e'));logger['debug'](_0x7450('0x1f'),_0xf510e7,_0x7450('0x1e'),JSON[_0x7450('0x20')](_0x18da52));if(_0x18da52[_0x7450('0x21')]){if(_0x18da52['error'][_0x7450('0x22')]===0x1f4){logger[_0x7450('0x21')](_0x7450('0x1d'),_0xf510e7,_0x18da52['error'][_0x7450('0x23')]);return _0x5c7461(_0x18da52[_0x7450('0x21')][_0x7450('0x23')]);}logger[_0x7450('0x21')](_0x7450('0x1d'),_0xf510e7,_0x18da52[_0x7450('0x21')][_0x7450('0x23')]);return _0x5db730(_0x18da52[_0x7450('0x21')][_0x7450('0x23')]);}else{logger[_0x7450('0x24')](_0x7450('0x1d'),_0xf510e7,'request\x20sent');_0x5db730(_0x18da52[_0x7450('0x25')]['message']);}})[_0x7450('0x26')](function(_0x25bea6){logger['error']('ZohoAccount,\x20%s,\x20%s',_0xf510e7,_0x25bea6);_0x5c7461(_0x25bea6);});});}function respondWithStatusCode(_0x1162ed,_0x2cbfcb){_0x2cbfcb=_0x2cbfcb||0xcc;return function(_0x341942){if(_0x341942){return _0x1162ed[_0x7450('0x27')](_0x2cbfcb);}return _0x1162ed[_0x7450('0x28')](_0x2cbfcb)[_0x7450('0x29')]();};}function respondWithResult(_0x48e1d8,_0x357d23){_0x357d23=_0x357d23||0xc8;return function(_0x357687){if(_0x357687){return _0x48e1d8[_0x7450('0x28')](_0x357d23)[_0x7450('0x2a')](_0x357687);}};}function respondWithFilteredResult(_0x2ac456,_0xf484df){return function(_0x61b12d){if(_0x61b12d){var _0x3e56ba=_0x61b12d[_0x7450('0x2b')],_0x4c5696=_0xf484df[_0x7450('0x2c')],_0x47bb37=_0xf484df['offset']+_0xf484df[_0x7450('0x2d')],_0x4f9ea3;if(_0x47bb37>=_0x3e56ba){_0x47bb37=_0x3e56ba;_0x4f9ea3=0xc8;}else{_0x4f9ea3=0xce;}_0x2ac456[_0x7450('0x28')](_0x4f9ea3);return _0x2ac456['set'](_0x7450('0x2e'),_0x4c5696+'-'+_0x47bb37+'/'+_0x3e56ba)['json'](_0x61b12d);}return null;};}function patchUpdates(_0x555161){return function(_0x37afab){try{jsonpatch['apply'](_0x37afab,_0x555161,!![]);}catch(_0x34eb62){return BPromise[_0x7450('0x2f')](_0x34eb62);}return _0x37afab[_0x7450('0x30')]();};}function saveUpdates(_0x42c28d,_0x24134f){return function(_0x4c4ef8){if(_0x4c4ef8){return _0x4c4ef8[_0x7450('0x31')](_0x42c28d)['then'](function(_0x1c0f4c){return _0x1c0f4c;});}return null;};}function removeEntity(_0x4c5c3f,_0x592b4f){return function(_0x2da9ea){if(_0x2da9ea){return _0x2da9ea['destroy']()[_0x7450('0x1c')](function(){_0x4c5c3f[_0x7450('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cad3a,_0x49868c){return function(_0x1ef8cb){if(!_0x1ef8cb){_0x4cad3a[_0x7450('0x27')](0x194);}return _0x1ef8cb;};}function handleError(_0x28bcc4,_0x9aa55a){_0x9aa55a=_0x9aa55a||0x1f4;return function(_0x5a35d9){logger[_0x7450('0x21')](_0x5a35d9[_0x7450('0x32')]);if(_0x5a35d9[_0x7450('0x33')]){delete _0x5a35d9['name'];}_0x28bcc4[_0x7450('0x28')](_0x9aa55a)[_0x7450('0x34')](_0x5a35d9);};}exports[_0x7450('0x35')]=function(_0x405811,_0x1995e7){var _0x28aa50={},_0x38136c={},_0x10bde9={'count':0x0,'rows':[]};var _0x5318a7=db[_0x7450('0x36')][_0x7450('0x37')];_0x38136c[_0x7450('0x38')]=_[_0x7450('0x39')](_0x5318a7);_0x38136c[_0x7450('0x3a')]=_[_0x7450('0x39')](_0x405811['query']);_0x38136c[_0x7450('0x3b')]=_['intersection'](_0x38136c[_0x7450('0x38')],_0x38136c[_0x7450('0x3a')]);_0x28aa50[_0x7450('0x3c')]=_[_0x7450('0x3d')](_0x38136c['model'],qs['fields'](_0x405811[_0x7450('0x3a')][_0x7450('0x3e')]));_0x28aa50[_0x7450('0x3c')]=_0x28aa50[_0x7450('0x3c')]['length']?_0x28aa50[_0x7450('0x3c')]:_0x38136c['model'];if(!_0x405811[_0x7450('0x3a')][_0x7450('0x3f')](_0x7450('0x40'))){_0x28aa50[_0x7450('0x2d')]=qs['limit'](_0x405811[_0x7450('0x3a')][_0x7450('0x2d')]);_0x28aa50[_0x7450('0x2c')]=qs[_0x7450('0x2c')](_0x405811[_0x7450('0x3a')][_0x7450('0x2c')]);}_0x28aa50[_0x7450('0x41')]=qs['sort'](_0x405811[_0x7450('0x3a')][_0x7450('0x42')]);_0x28aa50[_0x7450('0x43')]=qs[_0x7450('0x3b')](_[_0x7450('0x44')](_0x405811[_0x7450('0x3a')],_0x38136c[_0x7450('0x3b')]));if(_0x405811['query']['filter']){_0x28aa50[_0x7450('0x43')]=_[_0x7450('0x45')](_0x28aa50[_0x7450('0x43')],{'$or':_[_0x7450('0x46')](_0x5318a7,function(_0x36a7e4){if(_0x36a7e4[_0x7450('0x47')][_0x7450('0x48')]!==_0x7450('0x49')){var _0x2bbdbf={};_0x2bbdbf[_0x36a7e4['field']]={'$like':'%'+_0x405811['query']['filter']+'%'};return _0x2bbdbf;}})});}_0x28aa50=_[_0x7450('0x45')]({},_0x28aa50,_0x405811[_0x7450('0x4a')]);var _0xac87c0={'where':_0x28aa50['where']};return db[_0x7450('0x36')][_0x7450('0x2b')](_0xac87c0)[_0x7450('0x1c')](function(_0x5463a6){_0x10bde9[_0x7450('0x2b')]=_0x5463a6;if(_0x405811['query'][_0x7450('0x4b')]){_0x28aa50[_0x7450('0x4c')]=[{'all':!![]}];}return db['ZohoAccount'][_0x7450('0x4d')](_0x28aa50);})[_0x7450('0x1c')](function(_0x9aa3fb){_0x10bde9['rows']=_0x9aa3fb;return _0x10bde9;})[_0x7450('0x1c')](respondWithFilteredResult(_0x1995e7,_0x28aa50))[_0x7450('0x26')](handleError(_0x1995e7,null));};exports[_0x7450('0x4e')]=function(_0x4c61c5,_0x2bbb09){var _0x585956={'raw':![],'where':{'id':_0x4c61c5[_0x7450('0x4f')]['id']}},_0xf64b27={};_0xf64b27[_0x7450('0x38')]=_['keys'](db[_0x7450('0x36')][_0x7450('0x37')]);_0xf64b27[_0x7450('0x3a')]=_[_0x7450('0x39')](_0x4c61c5[_0x7450('0x3a')]);_0xf64b27['filters']=_[_0x7450('0x3d')](_0xf64b27[_0x7450('0x38')],_0xf64b27[_0x7450('0x3a')]);_0x585956['attributes']=_[_0x7450('0x3d')](_0xf64b27['model'],qs['fields'](_0x4c61c5['query'][_0x7450('0x3e')]));_0x585956[_0x7450('0x3c')]=_0x585956[_0x7450('0x3c')][_0x7450('0x50')]?_0x585956[_0x7450('0x3c')]:_0xf64b27['model'];if(_0x4c61c5[_0x7450('0x3a')][_0x7450('0x4b')]){_0x585956[_0x7450('0x4c')]=[{'all':!![]}];}_0x585956=_['merge']({},_0x585956,_0x4c61c5[_0x7450('0x4a')]);return db['ZohoAccount'][_0x7450('0x51')](_0x585956)[_0x7450('0x1c')](handleEntityNotFound(_0x2bbb09,null))['then'](respondWithResult(_0x2bbb09,null))[_0x7450('0x26')](handleError(_0x2bbb09,null));};exports['create']=function(_0x32fb42,_0x830986){return db[_0x7450('0x36')]['create'](_0x32fb42['body'],{})['then'](respondWithResult(_0x830986,0xc9))[_0x7450('0x26')](handleError(_0x830986,null));};exports['update']=function(_0x7e8d1f,_0x1e027e){if(_0x7e8d1f['body']['id']){delete _0x7e8d1f['body']['id'];}return db[_0x7450('0x36')][_0x7450('0x51')]({'where':{'id':_0x7e8d1f[_0x7450('0x4f')]['id']}})[_0x7450('0x1c')](handleEntityNotFound(_0x1e027e,null))[_0x7450('0x1c')](saveUpdates(_0x7e8d1f[_0x7450('0x52')],null))[_0x7450('0x1c')](respondWithResult(_0x1e027e,null))['catch'](handleError(_0x1e027e,null));};exports['destroy']=function(_0x427349,_0x438ad2){return db[_0x7450('0x36')][_0x7450('0x51')]({'where':{'id':_0x427349[_0x7450('0x4f')]['id']}})['then'](handleEntityNotFound(_0x438ad2,null))[_0x7450('0x1c')](removeEntity(_0x438ad2,null))[_0x7450('0x26')](handleError(_0x438ad2,null));};exports[_0x7450('0x53')]=function(_0x10fc5a,_0x240ffc,_0xbe57af){var _0x4ab6e3={};var _0xddecd1={};var _0x2dad25;var _0x3a6bf0;return db['ZohoAccount'][_0x7450('0x54')]({'where':{'id':_0x10fc5a[_0x7450('0x4f')]['id']}})['then'](handleEntityNotFound(_0x240ffc,null))[_0x7450('0x1c')](function(_0x2ca721){if(_0x2ca721){_0x2dad25=_0x2ca721;_0xddecd1[_0x7450('0x38')]=_[_0x7450('0x39')](db[_0x7450('0x55')]['rawAttributes']);_0xddecd1[_0x7450('0x3a')]=_['keys'](_0x10fc5a[_0x7450('0x3a')]);_0xddecd1[_0x7450('0x3b')]=_[_0x7450('0x3d')](_0xddecd1[_0x7450('0x38')],_0xddecd1[_0x7450('0x3a')]);_0x4ab6e3[_0x7450('0x3c')]=_['intersection'](_0xddecd1[_0x7450('0x38')],qs['fields'](_0x10fc5a[_0x7450('0x3a')]['fields']));_0x4ab6e3[_0x7450('0x3c')]=_0x4ab6e3[_0x7450('0x3c')]['length']?_0x4ab6e3[_0x7450('0x3c')]:_0xddecd1[_0x7450('0x38')];_0x4ab6e3['order']=qs['sort'](_0x10fc5a[_0x7450('0x3a')][_0x7450('0x42')]);_0x4ab6e3[_0x7450('0x43')]=qs['filters'](_[_0x7450('0x44')](_0x10fc5a[_0x7450('0x3a')],_0xddecd1[_0x7450('0x3b')]));if(_0x10fc5a['query'][_0x7450('0x56')]){_0x4ab6e3[_0x7450('0x43')]=_[_0x7450('0x45')](_0x4ab6e3['where'],{'$or':_[_0x7450('0x46')](_0x4ab6e3[_0x7450('0x3c')],function(_0x1f0160){var _0xf7aba9={};_0xf7aba9[_0x1f0160]={'$like':'%'+_0x10fc5a['query'][_0x7450('0x56')]+'%'};return _0xf7aba9;})});}_0x4ab6e3=_[_0x7450('0x45')]({},_0x4ab6e3,_0x10fc5a[_0x7450('0x4a')]);return _0x2dad25[_0x7450('0x53')](_0x4ab6e3);}})[_0x7450('0x1c')](function(_0x1374af){if(_0x1374af){_0x3a6bf0=_0x1374af[_0x7450('0x50')];if(!_0x10fc5a['query']['hasOwnProperty'](_0x7450('0x40'))){_0x4ab6e3['limit']=qs[_0x7450('0x2d')](_0x10fc5a['query'][_0x7450('0x2d')]);_0x4ab6e3[_0x7450('0x2c')]=qs[_0x7450('0x2c')](_0x10fc5a[_0x7450('0x3a')]['offset']);}return _0x2dad25[_0x7450('0x53')](_0x4ab6e3);}})['then'](function(_0x296fd6){if(_0x296fd6){return _0x296fd6?{'count':_0x3a6bf0,'rows':_0x296fd6}:null;}})[_0x7450('0x1c')](respondWithResult(_0x240ffc,null))[_0x7450('0x26')](handleError(_0x240ffc,null));};exports[_0x7450('0x57')]=function(_0xcde00d,_0x2a2477,_0x3b22b7){if(_0xcde00d[_0x7450('0x52')]['id']){delete _0xcde00d[_0x7450('0x52')]['id'];}return db[_0x7450('0x36')]['findOne']({'where':{'id':_0xcde00d[_0x7450('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2a2477,null))[_0x7450('0x1c')](function(_0x2018e5){if(_0x2018e5){_0xcde00d[_0x7450('0x52')]['AccountId']=_0x2018e5['id'];_0xcde00d[_0x7450('0x52')]['Subjects']=integrations['getSubjects'](_0xcde00d[_0x7450('0x52')][_0x7450('0x58')],_0xcde00d[_0x7450('0x52')][_0x7450('0x47')]);_0xcde00d['body']['Descriptions']=integrations[_0x7450('0x59')](_0xcde00d[_0x7450('0x52')][_0x7450('0x58')],_0xcde00d['body']['type']);return db[_0x7450('0x55')][_0x7450('0x5a')](_0xcde00d[_0x7450('0x52')],{'include':[{'model':db['ZohoField'],'as':_0x7450('0x5b')},{'model':db[_0x7450('0x5c')],'as':_0x7450('0x5d')}]});}return null;})[_0x7450('0x1c')](respondWithResult(_0x2a2477,null))[_0x7450('0x26')](handleError(_0x2a2477,null));};function getAccessToken(_0x1296ac){return new Promise(function(_0xeef050,_0x33b194){var _0x5cc992;switch(_0x1296ac[_0x7450('0x5e')]){case'US':_0x5cc992=_0x7450('0x5f');break;case'AU':_0x5cc992='https://accounts.zoho.com.au';break;case'EU':_0x5cc992=_0x7450('0x60');break;case'IN':_0x5cc992='https://accounts.zoho.in';break;case'CN':_0x5cc992=_0x7450('0x61');break;default:_0x5cc992='https://accounts.zoho.eu';break;}var _0x1ce37c={'method':_0x7450('0x62'),'uri':_0x5cc992+_0x7450('0x63'),'qs':{'refresh_token':_0x1296ac[_0x7450('0x64')],'client_id':_0x1296ac[_0x7450('0x65')],'client_secret':_0x1296ac[_0x7450('0x66')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1ce37c)['then'](function(_0x5f3c17){if(_0x5f3c17[_0x7450('0x67')]){_0xeef050(_0x5f3c17[_0x7450('0x67')]);}else{_0x33b194('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x47827f){_0x33b194(_0x47827f);});});}exports[_0x7450('0x68')]=function(_0x1dfdf3,_0x568285,_0x38b992){var _0x34ad69,_0x1bf474,_0x10973a,_0x156749,_0x309bc9;return db[_0x7450('0x36')][_0x7450('0x54')]({'where':{'id':_0x1dfdf3[_0x7450('0x4f')]['id']},'attributes':['id',_0x7450('0x69'),_0x7450('0x5e'),'clientId',_0x7450('0x66'),_0x7450('0x6a'),_0x7450('0x22'),'refreshToken']})[_0x7450('0x1c')](handleEntityNotFound(_0x568285,null))[_0x7450('0x1c')](function(_0xeacb94){_0x309bc9=_0xeacb94;_0x34ad69=_0x309bc9[_0x7450('0x69')];_0x1bf474=_0x34ad69===_0x7450('0x6b')?'eu':_0x7450('0x6c');_0x10973a=_0x309bc9['serverUrl'];var _0x57440c=_0x10973a['slice'](-0x1);if(_0x57440c==='/'||_0x57440c==='\x5c'||_0x57440c===':'){_0x10973a=_0x10973a[_0x7450('0x6d')](0x0,_0x10973a[_0x7450('0x6e')](_0x57440c));}if(!_0x309bc9[_0x7450('0x64')]){throw new Error(_0x7450('0x6f'));}return getAccessToken(_0x309bc9);})[_0x7450('0x1c')](function(_0x2b0f68){if(_0x2b0f68){return rp({'method':_0x7450('0x70'),'uri':util[_0x7450('0x71')](_0x7450('0x72'),_0x1bf474),'qs':{'module':_0x7450('0x73')},'headers':{'Authorization':_0x7450('0x74')+_0x2b0f68},'json':!![]});}})[_0x7450('0x1c')](function(_0x589f6e){if(_0x589f6e){if(_0x589f6e[_0x7450('0x75')]&&_0x589f6e[_0x7450('0x75')][_0x7450('0x21')]){throw new Error(_0x589f6e[_0x7450('0x75')]['error']['message']);}var _0x2d460d=[];var _0xfe4e0b=[];var _0x2dd174=['Owner',_0x7450('0x76'),'Description',_0x7450('0x77'),_0x7450('0x78'),_0x7450('0x79'),_0x7450('0x7a'),_0x7450('0x7b')];_0xfe4e0b=_[_0x7450('0x7c')](_0x589f6e['fields'],function(_0x2e75b5){return _0x2dd174['includes'](_0x2e75b5[_0x7450('0x7d')]);});for(var _0x5d923b=0x0;_0x5d923b<_0xfe4e0b['length'];_0x5d923b++){if(_0xfe4e0b[_0x5d923b]['system_mandatory']===![]){_0x2d460d[_0x7450('0x7e')]({'id':_0xfe4e0b[_0x5d923b]['id'],'name':_0xfe4e0b[_0x5d923b]['display_label'],'custom':_0xfe4e0b[_0x5d923b][_0x7450('0x7f')],'options':_0xfe4e0b[_0x5d923b][_0x7450('0x80')]==='picklist'&&_0xfe4e0b[_0x5d923b][_0x7450('0x81')][_0x7450('0x50')]>-0x1?_['map'](_0xfe4e0b[_0x5d923b]['pick_list_values'],function(_0x3e2542){return{'name':_0x3e2542,'value':_0x3e2542};}):[]});}}return{'count':_0x2d460d[_0x7450('0x50')],'rows':_0x2d460d};}else{return{'count':0x0,'rows':[]};}})[_0x7450('0x1c')](respondWithResult(_0x568285,null))[_0x7450('0x26')](function(_0x1da875){var _0x45b9bc=_0x1dfdf3[_0x7450('0x3a')]['test']?0x1f4:_0x1da875['statusCode']||0x1f4;logger['error'](_0x7450('0x82'),_0x7450('0x68'),_0x45b9bc,JSON[_0x7450('0x20')](_0x1da875));delete _0x1da875[_0x7450('0x33')];if(_0x45b9bc===0x191){_0x45b9bc=0x190;}_0x568285[_0x7450('0x28')](_0x45b9bc)[_0x7450('0x34')](_0x1dfdf3[_0x7450('0x3a')][_0x7450('0x19')]?{'message':'Wrong\x20credentials','statusCode':_0x1da875['statusCode']}:_0x1da875);});}; \ No newline at end of file +var _0x43c2=['https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','getFields','clientId','serverUrl','host','zoho.eu','com','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','ZohoAccount','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','filter','map','type','key','merge','options','includeAll','show','length','include','find','create','body','getConfigurations','ZohoConfiguration','pick','nolimit','findOne','params','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu'];(function(_0x586be5,_0x3dc802){var _0x478c7d=function(_0x51823b){while(--_0x51823b){_0x586be5['push'](_0x586be5['shift']());}};_0x478c7d(++_0x3dc802);}(_0x43c2,0x13c));var _0x243c=function(_0x472b92,_0x4e0c69){_0x472b92=_0x472b92-0x0;var _0x4fb14d=_0x43c2[_0x472b92];return _0x4fb14d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x243c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x243c('0x1'));var rp=require(_0x243c('0x2'));var moment=require(_0x243c('0x3'));var BPromise=require(_0x243c('0x4'));var Mustache=require(_0x243c('0x5'));var util=require(_0x243c('0x6'));var path=require(_0x243c('0x7'));var sox=require('sox');var csv=require(_0x243c('0x8'));var ejs=require(_0x243c('0x9'));var fs=require('fs');var _=require(_0x243c('0xa'));var squel=require(_0x243c('0xb'));var crypto=require(_0x243c('0xc'));var jsforce=require(_0x243c('0xd'));var deskjs=require(_0x243c('0xe'));var toCsv=require(_0x243c('0x8'));var querystring=require(_0x243c('0xf'));var Papa=require(_0x243c('0x10'));var Redis=require(_0x243c('0x11'));var authService=require(_0x243c('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x243c('0x13'));var logger=require('../../config/logger')(_0x243c('0x14'));var utils=require(_0x243c('0x15'));var config=require(_0x243c('0x16'));var db=require(_0x243c('0x17'))['db'];var integrations=require(_0x243c('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x243c('0x19')][_0x243c('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x41c1ec,_0x4d911e,_0x5d3ae0){if(_0x5d3ae0){var _0x16c6ca=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16c6ca[_0x243c('0x1b')](_0x4d911e)){return _0x41c1ec;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x41c1ec;}}function respondWithRpcPromise(_0x100068,_0x13f23a,_0x457483,_0x2b7572){return new BPromise(function(_0x548385,_0x26a9ba){var _0x2f79e6=_0x2b7572||client;return _0x2f79e6[_0x243c('0x1c')](_0x100068,_0x457483)['then'](function(_0x373fe4){logger[_0x243c('0x1d')](_0x243c('0x1e'),_0x13f23a,_0x243c('0x1f'));logger[_0x243c('0x20')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x13f23a,_0x243c('0x1f'),JSON[_0x243c('0x21')](_0x373fe4));if(_0x373fe4[_0x243c('0x22')]){if(_0x373fe4[_0x243c('0x22')][_0x243c('0x23')]===0x1f4){logger['error'](_0x243c('0x1e'),_0x13f23a,_0x373fe4['error']['message']);return _0x26a9ba(_0x373fe4[_0x243c('0x22')][_0x243c('0x24')]);}logger['error'](_0x243c('0x1e'),_0x13f23a,_0x373fe4[_0x243c('0x22')][_0x243c('0x24')]);return _0x548385(_0x373fe4['error'][_0x243c('0x24')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x13f23a,_0x243c('0x1f'));_0x548385(_0x373fe4[_0x243c('0x25')][_0x243c('0x24')]);}})[_0x243c('0x26')](function(_0x10b695){logger[_0x243c('0x22')](_0x243c('0x1e'),_0x13f23a,_0x10b695);_0x26a9ba(_0x10b695);});});}function respondWithStatusCode(_0x3390d6,_0x3a053a){_0x3a053a=_0x3a053a||0xcc;return function(_0x3b9086){if(_0x3b9086){return _0x3390d6[_0x243c('0x27')](_0x3a053a);}return _0x3390d6[_0x243c('0x28')](_0x3a053a)[_0x243c('0x29')]();};}function respondWithResult(_0xb4a952,_0x703d82){_0x703d82=_0x703d82||0xc8;return function(_0x23afe0){if(_0x23afe0){return _0xb4a952[_0x243c('0x28')](_0x703d82)[_0x243c('0x2a')](_0x23afe0);}};}function respondWithFilteredResult(_0xedfef6,_0xc2593a){return function(_0x2d5581){if(_0x2d5581){var _0x44b9b5=_0x2d5581[_0x243c('0x2b')],_0x314636=_0xc2593a[_0x243c('0x2c')],_0xfa9b0e=_0xc2593a[_0x243c('0x2c')]+_0xc2593a['limit'],_0x2b4a04;if(_0xfa9b0e>=_0x44b9b5){_0xfa9b0e=_0x44b9b5;_0x2b4a04=0xc8;}else{_0x2b4a04=0xce;}_0xedfef6[_0x243c('0x28')](_0x2b4a04);return _0xedfef6[_0x243c('0x2d')](_0x243c('0x2e'),_0x314636+'-'+_0xfa9b0e+'/'+_0x44b9b5)[_0x243c('0x2a')](_0x2d5581);}return null;};}function patchUpdates(_0xf11bfb){return function(_0x1778cf){try{jsonpatch[_0x243c('0x2f')](_0x1778cf,_0xf11bfb,!![]);}catch(_0x22eebc){return BPromise['reject'](_0x22eebc);}return _0x1778cf[_0x243c('0x30')]();};}function saveUpdates(_0x3026e4,_0x4e60e1){return function(_0x470ea2){if(_0x470ea2){return _0x470ea2[_0x243c('0x31')](_0x3026e4)[_0x243c('0x32')](function(_0x92c804){return _0x92c804;});}return null;};}function removeEntity(_0x335d1a,_0x4b370e){return function(_0x13b1ac){if(_0x13b1ac){return _0x13b1ac[_0x243c('0x33')]()[_0x243c('0x32')](function(){_0x335d1a[_0x243c('0x28')](0xcc)[_0x243c('0x29')]();});}};}function handleEntityNotFound(_0x1eccdd,_0x2108cb){return function(_0x46c6f3){if(!_0x46c6f3){_0x1eccdd[_0x243c('0x27')](0x194);}return _0x46c6f3;};}function handleError(_0x35d032,_0x5ca576){_0x5ca576=_0x5ca576||0x1f4;return function(_0x573584){logger['error'](_0x573584[_0x243c('0x34')]);if(_0x573584[_0x243c('0x35')]){delete _0x573584['name'];}_0x35d032['status'](_0x5ca576)[_0x243c('0x36')](_0x573584);};}exports[_0x243c('0x37')]=function(_0x1e5b9d,_0x2dbe8f){var _0xed3786={},_0x56d755={},_0x11ebc4={'count':0x0,'rows':[]};var _0x883f7a=db[_0x243c('0x38')][_0x243c('0x39')];_0x56d755[_0x243c('0x3a')]=_['keys'](_0x883f7a);_0x56d755[_0x243c('0x3b')]=_[_0x243c('0x3c')](_0x1e5b9d[_0x243c('0x3b')]);_0x56d755[_0x243c('0x3d')]=_[_0x243c('0x3e')](_0x56d755[_0x243c('0x3a')],_0x56d755[_0x243c('0x3b')]);_0xed3786['attributes']=_[_0x243c('0x3e')](_0x56d755['model'],qs[_0x243c('0x3f')](_0x1e5b9d['query'][_0x243c('0x3f')]));_0xed3786[_0x243c('0x40')]=_0xed3786[_0x243c('0x40')]['length']?_0xed3786[_0x243c('0x40')]:_0x56d755[_0x243c('0x3a')];if(!_0x1e5b9d['query'][_0x243c('0x41')]('nolimit')){_0xed3786['limit']=qs[_0x243c('0x42')](_0x1e5b9d[_0x243c('0x3b')][_0x243c('0x42')]);_0xed3786['offset']=qs[_0x243c('0x2c')](_0x1e5b9d['query']['offset']);}_0xed3786[_0x243c('0x43')]=qs[_0x243c('0x44')](_0x1e5b9d[_0x243c('0x3b')][_0x243c('0x44')]);_0xed3786[_0x243c('0x45')]=qs['filters'](_['pick'](_0x1e5b9d[_0x243c('0x3b')],_0x56d755[_0x243c('0x3d')]));if(_0x1e5b9d[_0x243c('0x3b')][_0x243c('0x46')]){_0xed3786['where']=_['merge'](_0xed3786[_0x243c('0x45')],{'$or':_[_0x243c('0x47')](_0x883f7a,function(_0x5ee9c5){if(_0x5ee9c5[_0x243c('0x48')][_0x243c('0x49')]!=='VIRTUAL'){var _0x4bb89e={};_0x4bb89e[_0x5ee9c5['field']]={'$like':'%'+_0x1e5b9d['query'][_0x243c('0x46')]+'%'};return _0x4bb89e;}})});}_0xed3786=_[_0x243c('0x4a')]({},_0xed3786,_0x1e5b9d[_0x243c('0x4b')]);var _0x97b7c2={'where':_0xed3786[_0x243c('0x45')]};return db[_0x243c('0x38')][_0x243c('0x2b')](_0x97b7c2)[_0x243c('0x32')](function(_0x413020){_0x11ebc4[_0x243c('0x2b')]=_0x413020;if(_0x1e5b9d[_0x243c('0x3b')][_0x243c('0x4c')]){_0xed3786['include']=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0xed3786);})[_0x243c('0x32')](function(_0x26d487){_0x11ebc4['rows']=_0x26d487;return _0x11ebc4;})[_0x243c('0x32')](respondWithFilteredResult(_0x2dbe8f,_0xed3786))[_0x243c('0x26')](handleError(_0x2dbe8f,null));};exports[_0x243c('0x4d')]=function(_0x2efa5c,_0x35b7cc){var _0x26a4eb={'raw':![],'where':{'id':_0x2efa5c['params']['id']}},_0x1a0389={};_0x1a0389[_0x243c('0x3a')]=_[_0x243c('0x3c')](db['ZohoAccount'][_0x243c('0x39')]);_0x1a0389['query']=_['keys'](_0x2efa5c[_0x243c('0x3b')]);_0x1a0389[_0x243c('0x3d')]=_['intersection'](_0x1a0389[_0x243c('0x3a')],_0x1a0389['query']);_0x26a4eb['attributes']=_[_0x243c('0x3e')](_0x1a0389[_0x243c('0x3a')],qs[_0x243c('0x3f')](_0x2efa5c[_0x243c('0x3b')][_0x243c('0x3f')]));_0x26a4eb[_0x243c('0x40')]=_0x26a4eb[_0x243c('0x40')][_0x243c('0x4e')]?_0x26a4eb[_0x243c('0x40')]:_0x1a0389['model'];if(_0x2efa5c[_0x243c('0x3b')][_0x243c('0x4c')]){_0x26a4eb[_0x243c('0x4f')]=[{'all':!![]}];}_0x26a4eb=_[_0x243c('0x4a')]({},_0x26a4eb,_0x2efa5c[_0x243c('0x4b')]);return db[_0x243c('0x38')][_0x243c('0x50')](_0x26a4eb)[_0x243c('0x32')](handleEntityNotFound(_0x35b7cc,null))['then'](respondWithResult(_0x35b7cc,null))[_0x243c('0x26')](handleError(_0x35b7cc,null));};exports[_0x243c('0x51')]=function(_0x5335a4,_0x250ba4){return db[_0x243c('0x38')][_0x243c('0x51')](_0x5335a4[_0x243c('0x52')],{})[_0x243c('0x32')](respondWithResult(_0x250ba4,0xc9))[_0x243c('0x26')](handleError(_0x250ba4,null));};exports['update']=function(_0x11c831,_0x578541){if(_0x11c831[_0x243c('0x52')]['id']){delete _0x11c831[_0x243c('0x52')]['id'];}return db[_0x243c('0x38')][_0x243c('0x50')]({'where':{'id':_0x11c831['params']['id']}})['then'](handleEntityNotFound(_0x578541,null))[_0x243c('0x32')](saveUpdates(_0x11c831[_0x243c('0x52')],null))[_0x243c('0x32')](respondWithResult(_0x578541,null))[_0x243c('0x26')](handleError(_0x578541,null));};exports[_0x243c('0x33')]=function(_0x14d1f2,_0xcd7903){return db[_0x243c('0x38')][_0x243c('0x50')]({'where':{'id':_0x14d1f2['params']['id']}})[_0x243c('0x32')](handleEntityNotFound(_0xcd7903,null))[_0x243c('0x32')](removeEntity(_0xcd7903,null))[_0x243c('0x26')](handleError(_0xcd7903,null));};exports[_0x243c('0x53')]=function(_0x1bc048,_0xb70d18,_0x3d7a3a){var _0x326dbd={};var _0x430948={};var _0x7df618;var _0x177279;return db[_0x243c('0x38')]['findOne']({'where':{'id':_0x1bc048['params']['id']}})[_0x243c('0x32')](handleEntityNotFound(_0xb70d18,null))[_0x243c('0x32')](function(_0x495f22){if(_0x495f22){_0x7df618=_0x495f22;_0x430948[_0x243c('0x3a')]=_[_0x243c('0x3c')](db[_0x243c('0x54')]['rawAttributes']);_0x430948[_0x243c('0x3b')]=_[_0x243c('0x3c')](_0x1bc048[_0x243c('0x3b')]);_0x430948[_0x243c('0x3d')]=_['intersection'](_0x430948[_0x243c('0x3a')],_0x430948['query']);_0x326dbd[_0x243c('0x40')]=_['intersection'](_0x430948[_0x243c('0x3a')],qs[_0x243c('0x3f')](_0x1bc048[_0x243c('0x3b')][_0x243c('0x3f')]));_0x326dbd[_0x243c('0x40')]=_0x326dbd[_0x243c('0x40')][_0x243c('0x4e')]?_0x326dbd[_0x243c('0x40')]:_0x430948['model'];_0x326dbd['order']=qs[_0x243c('0x44')](_0x1bc048[_0x243c('0x3b')][_0x243c('0x44')]);_0x326dbd[_0x243c('0x45')]=qs[_0x243c('0x3d')](_[_0x243c('0x55')](_0x1bc048[_0x243c('0x3b')],_0x430948[_0x243c('0x3d')]));if(_0x1bc048['query'][_0x243c('0x46')]){_0x326dbd[_0x243c('0x45')]=_[_0x243c('0x4a')](_0x326dbd[_0x243c('0x45')],{'$or':_[_0x243c('0x47')](_0x326dbd[_0x243c('0x40')],function(_0x515614){var _0xeb9eef={};_0xeb9eef[_0x515614]={'$like':'%'+_0x1bc048[_0x243c('0x3b')]['filter']+'%'};return _0xeb9eef;})});}_0x326dbd=_[_0x243c('0x4a')]({},_0x326dbd,_0x1bc048[_0x243c('0x4b')]);return _0x7df618['getConfigurations'](_0x326dbd);}})[_0x243c('0x32')](function(_0x377963){if(_0x377963){_0x177279=_0x377963['length'];if(!_0x1bc048['query'][_0x243c('0x41')](_0x243c('0x56'))){_0x326dbd[_0x243c('0x42')]=qs[_0x243c('0x42')](_0x1bc048[_0x243c('0x3b')][_0x243c('0x42')]);_0x326dbd[_0x243c('0x2c')]=qs[_0x243c('0x2c')](_0x1bc048[_0x243c('0x3b')][_0x243c('0x2c')]);}return _0x7df618['getConfigurations'](_0x326dbd);}})['then'](function(_0x2bf3d1){if(_0x2bf3d1){return _0x2bf3d1?{'count':_0x177279,'rows':_0x2bf3d1}:null;}})[_0x243c('0x32')](respondWithResult(_0xb70d18,null))[_0x243c('0x26')](handleError(_0xb70d18,null));};exports['addConfiguration']=function(_0x16bf04,_0x220390,_0x1d12e0){if(_0x16bf04[_0x243c('0x52')]['id']){delete _0x16bf04['body']['id'];}return db['ZohoAccount'][_0x243c('0x57')]({'where':{'id':_0x16bf04[_0x243c('0x58')]['id']}})['then'](handleEntityNotFound(_0x220390,null))[_0x243c('0x32')](function(_0x13c440){if(_0x13c440){_0x16bf04['body']['AccountId']=_0x13c440['id'];_0x16bf04['body'][_0x243c('0x59')]=integrations[_0x243c('0x5a')](_0x16bf04[_0x243c('0x52')][_0x243c('0x5b')],_0x16bf04[_0x243c('0x52')][_0x243c('0x48')]);_0x16bf04[_0x243c('0x52')][_0x243c('0x5c')]=integrations[_0x243c('0x5d')](_0x16bf04['body']['channel'],_0x16bf04[_0x243c('0x52')][_0x243c('0x48')]);return db[_0x243c('0x54')]['create'](_0x16bf04[_0x243c('0x52')],{'include':[{'model':db[_0x243c('0x5e')],'as':_0x243c('0x59')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x220390,null))[_0x243c('0x26')](handleError(_0x220390,null));};function getAccessToken(_0x10229d){return new Promise(function(_0x1ca088,_0x5dfcea){var _0x8046a;switch(_0x10229d[_0x243c('0x5f')]){case'US':_0x8046a='https://accounts.zoho.com';break;case'AU':_0x8046a=_0x243c('0x60');break;case'EU':_0x8046a=_0x243c('0x61');break;case'IN':_0x8046a=_0x243c('0x62');break;case'CN':_0x8046a=_0x243c('0x63');break;default:_0x8046a=_0x243c('0x61');break;}var _0x4b6031={'method':_0x243c('0x64'),'uri':_0x8046a+_0x243c('0x65'),'qs':{'refresh_token':_0x10229d[_0x243c('0x66')],'client_id':_0x10229d['clientId'],'client_secret':_0x10229d[_0x243c('0x67')],'grant_type':_0x243c('0x68')},'json':!![]};return rp(_0x4b6031)[_0x243c('0x32')](function(_0x339ec6){if(_0x339ec6['access_token']){_0x1ca088(_0x339ec6[_0x243c('0x69')]);}else{_0x5dfcea('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x243c('0x26')](function(_0x146061){_0x5dfcea(_0x146061);});});}exports[_0x243c('0x6a')]=function(_0x505665,_0x171b2d,_0x46d7ce){var _0x24baa7,_0x2b27cc,_0x1eaee5,_0x2543aa,_0xfd4c8b;return db['ZohoAccount'][_0x243c('0x57')]({'where':{'id':_0x505665[_0x243c('0x58')]['id']},'attributes':['id','host',_0x243c('0x5f'),_0x243c('0x6b'),_0x243c('0x67'),_0x243c('0x6c'),_0x243c('0x23'),'refreshToken']})[_0x243c('0x32')](handleEntityNotFound(_0x171b2d,null))[_0x243c('0x32')](function(_0xfc3588){_0xfd4c8b=_0xfc3588;_0x24baa7=_0xfd4c8b[_0x243c('0x6d')];_0x2b27cc=_0x24baa7===_0x243c('0x6e')?'eu':_0x243c('0x6f');_0x1eaee5=_0xfd4c8b[_0x243c('0x6c')];var _0x1bbe59=_0x1eaee5['slice'](-0x1);if(_0x1bbe59==='/'||_0x1bbe59==='\x5c'||_0x1bbe59===':'){_0x1eaee5=_0x1eaee5[_0x243c('0x70')](0x0,_0x1eaee5[_0x243c('0x71')](_0x1bbe59));}if(!_0xfd4c8b[_0x243c('0x66')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0xfd4c8b);})['then'](function(_0x59b60f){if(_0x59b60f){return rp({'method':_0x243c('0x72'),'uri':util[_0x243c('0x73')](_0x243c('0x74'),_0x2b27cc),'qs':{'module':_0x243c('0x75')},'headers':{'Authorization':_0x243c('0x76')+_0x59b60f},'json':!![]});}})[_0x243c('0x32')](function(_0x375ace){if(_0x375ace){if(_0x375ace['response']&&_0x375ace[_0x243c('0x77')]['error']){throw new Error(_0x375ace[_0x243c('0x77')][_0x243c('0x22')]['message']);}var _0x37acb4=[];var _0x1d3084=[];var _0x3e5481=['Owner',_0x243c('0x78'),_0x243c('0x79'),_0x243c('0x7a'),_0x243c('0x7b'),'Call_Result',_0x243c('0x7c'),_0x243c('0x7d')];_0x1d3084=_[_0x243c('0x7e')](_0x375ace['fields'],function(_0x1f256b){return _0x3e5481['includes'](_0x1f256b[_0x243c('0x7f')]);});for(var _0xfb9657=0x0;_0xfb9657<_0x1d3084['length'];_0xfb9657++){if(_0x1d3084[_0xfb9657][_0x243c('0x80')]===![]){_0x37acb4[_0x243c('0x81')]({'id':_0x1d3084[_0xfb9657]['id'],'name':_0x1d3084[_0xfb9657][_0x243c('0x82')],'custom':_0x1d3084[_0xfb9657][_0x243c('0x83')],'options':_0x1d3084[_0xfb9657][_0x243c('0x84')]===_0x243c('0x85')&&_0x1d3084[_0xfb9657][_0x243c('0x86')][_0x243c('0x4e')]>-0x1?_[_0x243c('0x47')](_0x1d3084[_0xfb9657][_0x243c('0x86')],function(_0x4aff88){return{'name':_0x4aff88,'value':_0x4aff88};}):[]});}}return{'count':_0x37acb4[_0x243c('0x4e')],'rows':_0x37acb4};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x171b2d,null))[_0x243c('0x26')](function(_0x499d60){var _0x930a4e=_0x505665[_0x243c('0x3b')]['test']?0x1f4:_0x499d60[_0x243c('0x87')]||0x1f4;logger[_0x243c('0x22')](_0x243c('0x88'),_0x243c('0x6a'),_0x930a4e,JSON[_0x243c('0x21')](_0x499d60));delete _0x499d60[_0x243c('0x35')];if(_0x930a4e===0x191){_0x930a4e=0x190;}_0x171b2d['status'](_0x930a4e)[_0x243c('0x36')](_0x505665[_0x243c('0x3b')]['test']?{'message':_0x243c('0x89'),'statusCode':_0x499d60[_0x243c('0x87')]}:_0x499d60);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 36d50c3..77a4458 100644 --- a/server/api/intZohoAccount/intZohoAccount.model.js +++ b/server/api/intZohoAccount/intZohoAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa640=['int_zoho_accounts','changed','zone','serverUrl','clientId','code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','error','clientSecret','https://accounts.zoho.com.cn','refresh_token','catch','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','exports','ZohoAccount'];(function(_0x2b97cd,_0x382e7f){var _0x1b4698=function(_0x31b83c){while(--_0x31b83c){_0x2b97cd['push'](_0x2b97cd['shift']());}};_0x1b4698(++_0x382e7f);}(_0xa640,0xbd));var _0x0a64=function(_0x2d4342,_0x1acd23){_0x2d4342=_0x2d4342-0x0;var _0x9eb780=_0xa640[_0x2d4342];return _0x9eb780;};'use strict';var _=require(_0x0a64('0x0'));var util=require(_0x0a64('0x1'));var logger=require(_0x0a64('0x2'))('api');var moment=require(_0x0a64('0x3'));var BPromise=require(_0x0a64('0x4'));var rp=require(_0x0a64('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a64('0x6'));var config=require(_0x0a64('0x7'));var attributes=require(_0x0a64('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x0a64('0x9')]=function(_0x261f8b,_0xd031f){return _0x261f8b['define'](_0x0a64('0xa'),attributes,{'tableName':_0x0a64('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x399e3a,_0x14b99a,_0x191e3b){if(_0x399e3a[_0x0a64('0xc')](_0x0a64('0xd'))||_0x399e3a['changed'](_0x0a64('0xe'))||_0x399e3a[_0x0a64('0xc')](_0x0a64('0xf'))||_0x399e3a[_0x0a64('0xc')]('clientSecret')||_0x399e3a[_0x0a64('0xc')](_0x0a64('0x10'))||_0x399e3a['changed'](_0x0a64('0x11'))){var _0x47cf67,_0x218874;_0x47cf67=_0x399e3a[_0x0a64('0xe')];var _0x254045=_0x47cf67['slice'](-0x1);if(_0x254045==='/'||_0x254045==='\x5c'||_0x254045===':'){_0x47cf67=_0x47cf67[_0x0a64('0x12')](0x0,_0x47cf67[_0x0a64('0x13')](_0x254045));}switch(_0x399e3a['zone']){case'US':_0x218874=_0x0a64('0x14');break;case'AU':_0x218874=_0x0a64('0x15');break;case'IN':_0x218874=_0x0a64('0x16');break;case'CN':_0x218874='https://accounts.zoho.com.cn';break;default:_0x218874=_0x0a64('0x17');break;}var _0x2d1711={'method':_0x0a64('0x18'),'uri':_0x218874+_0x0a64('0x19'),'form':{'grant_type':_0x0a64('0x1a'),'client_id':_0x399e3a[_0x0a64('0xf')],'client_secret':_0x399e3a['clientSecret'],'redirect_uri':_0x399e3a[_0x0a64('0xe')],'code':_0x399e3a[_0x0a64('0x10')]},'headers':{'Content-Type':_0x0a64('0x1b')}};return rp(_0x2d1711)[_0x0a64('0x1c')](function(_0x36fed6){var _0x595da5=JSON['parse'](_0x36fed6);if(_0x595da5['refresh_token']){_0x399e3a['refreshToken']=_0x595da5['refresh_token'];logger[_0x0a64('0x1d')](util[_0x0a64('0x1e')](_0x0a64('0x1f'),_0x399e3a[_0x0a64('0x20')],_0x399e3a['id']));}else{logger['error'](util[_0x0a64('0x1e')](_0x0a64('0x21'),_0x399e3a[_0x0a64('0x20')],_0x399e3a['id']),util[_0x0a64('0x22')](_0x595da5,{'showHidden':![],'depth':null}));}return _0x191e3b(null,_0x14b99a);})['catch'](function(_0x871a9a){logger[_0x0a64('0x23')](util['format'](_0x0a64('0x21'),_0x399e3a[_0x0a64('0x20')],_0x399e3a['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x191e3b(_0x871a9a);});}else{return _0x191e3b(null,_0x14b99a);}},'beforeUpdate':function(_0x1562e5,_0x3aa863,_0x387f86){if(_0x1562e5['changed'](_0x0a64('0xd'))||_0x1562e5['changed']('serverUrl')||_0x1562e5[_0x0a64('0xc')](_0x0a64('0xf'))||_0x1562e5[_0x0a64('0xc')](_0x0a64('0x24'))||_0x1562e5[_0x0a64('0xc')]('code')||_0x1562e5['changed'](_0x0a64('0x11'))){var _0x5206a9,_0x40f9e4;_0x5206a9=_0x1562e5['serverUrl'];var _0x3c452b=_0x5206a9['slice'](-0x1);if(_0x3c452b==='/'||_0x3c452b==='\x5c'||_0x3c452b===':'){_0x5206a9=_0x5206a9[_0x0a64('0x12')](0x0,_0x5206a9['lastIndexOf'](_0x3c452b));}switch(_0x1562e5['zone']){case'US':_0x40f9e4=_0x0a64('0x14');break;case'AU':_0x40f9e4=_0x0a64('0x15');break;case'IN':_0x40f9e4=_0x0a64('0x16');break;case'CN':_0x40f9e4=_0x0a64('0x25');break;default:_0x40f9e4=_0x0a64('0x17');break;}var _0x3e96be={'method':_0x0a64('0x18'),'uri':_0x40f9e4+_0x0a64('0x19'),'form':{'grant_type':_0x0a64('0x1a'),'client_id':_0x1562e5[_0x0a64('0xf')],'client_secret':_0x1562e5[_0x0a64('0x24')],'redirect_uri':_0x1562e5[_0x0a64('0xe')],'code':_0x1562e5['code']},'headers':{'Content-Type':_0x0a64('0x1b')}};return rp(_0x3e96be)[_0x0a64('0x1c')](function(_0x167647){var _0x32b91f=JSON['parse'](_0x167647);if(_0x32b91f[_0x0a64('0x26')]){_0x1562e5['refreshToken']=_0x32b91f[_0x0a64('0x26')];logger['info'](util[_0x0a64('0x1e')](_0x0a64('0x1f'),_0x1562e5[_0x0a64('0x20')],_0x1562e5['id']));}else{logger[_0x0a64('0x23')](util[_0x0a64('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1562e5[_0x0a64('0x20')],_0x1562e5['id']),util[_0x0a64('0x22')](_0x32b91f,{'showHidden':![],'depth':null}));}return _0x387f86(null,_0x3aa863);})[_0x0a64('0x27')](function(_0x14a7b4){logger['error'](util[_0x0a64('0x1e')](_0x0a64('0x21'),_0x1562e5[_0x0a64('0x20')],_0x1562e5['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x387f86(_0x14a7b4);});}else{return _0x387f86(null,_0x3aa863);}}}});}; \ No newline at end of file +var _0x318a=['parse','refresh_token','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host','lastIndexOf','refreshToken','inspect','catch','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientSecret','slice','substring','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','clientId','code','application/x-www-form-urlencoded','then'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0x318a,0xa8));var _0xa318=function(_0x208f8e,_0x22b464){_0x208f8e=_0x208f8e-0x0;var _0x3f7666=_0x318a[_0x208f8e];return _0x3f7666;};'use strict';var _=require(_0xa318('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa318('0x1'));var moment=require(_0xa318('0x2'));var BPromise=require(_0xa318('0x3'));var rp=require(_0xa318('0x4'));var fs=require('fs');var path=require(_0xa318('0x5'));var rimraf=require('rimraf');var config=require(_0xa318('0x6'));var attributes=require(_0xa318('0x7'));var integrations=require(_0xa318('0x8'));module['exports']=function(_0x4d983c,_0x4efd78){return _0x4d983c['define'](_0xa318('0x9'),attributes,{'tableName':_0xa318('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x41b3b3,_0x141dfe,_0x1e77ac){if(_0x41b3b3['changed'](_0xa318('0xb'))||_0x41b3b3[_0xa318('0xc')](_0xa318('0xd'))||_0x41b3b3[_0xa318('0xc')]('clientId')||_0x41b3b3['changed'](_0xa318('0xe'))||_0x41b3b3[_0xa318('0xc')]('code')||_0x41b3b3['changed']('host')){var _0x4a4e06,_0x473f44;_0x4a4e06=_0x41b3b3['serverUrl'];var _0x4ade6f=_0x4a4e06[_0xa318('0xf')](-0x1);if(_0x4ade6f==='/'||_0x4ade6f==='\x5c'||_0x4ade6f===':'){_0x4a4e06=_0x4a4e06[_0xa318('0x10')](0x0,_0x4a4e06['lastIndexOf'](_0x4ade6f));}switch(_0x41b3b3['zone']){case'US':_0x473f44='https://accounts.zoho.com';break;case'AU':_0x473f44=_0xa318('0x11');break;case'IN':_0x473f44=_0xa318('0x12');break;case'CN':_0x473f44=_0xa318('0x13');break;default:_0x473f44=_0xa318('0x14');break;}var _0x3baffa={'method':'POST','uri':_0x473f44+_0xa318('0x15'),'form':{'grant_type':_0xa318('0x16'),'client_id':_0x41b3b3[_0xa318('0x17')],'client_secret':_0x41b3b3[_0xa318('0xe')],'redirect_uri':_0x41b3b3[_0xa318('0xd')],'code':_0x41b3b3[_0xa318('0x18')]},'headers':{'Content-Type':_0xa318('0x19')}};return rp(_0x3baffa)[_0xa318('0x1a')](function(_0x469e6b){var _0x23571c=JSON[_0xa318('0x1b')](_0x469e6b);if(_0x23571c[_0xa318('0x1c')]){_0x41b3b3['refreshToken']=_0x23571c['refresh_token'];logger['info'](util[_0xa318('0x1d')](_0xa318('0x1e'),_0x41b3b3[_0xa318('0x1f')],_0x41b3b3['id']));}else{logger[_0xa318('0x20')](util[_0xa318('0x1d')](_0xa318('0x21'),_0x41b3b3[_0xa318('0x1f')],_0x41b3b3['id']),util['inspect'](_0x23571c,{'showHidden':![],'depth':null}));}return _0x1e77ac(null,_0x141dfe);})['catch'](function(_0x27c682){logger[_0xa318('0x20')](util['format'](_0xa318('0x21'),_0x41b3b3['name'],_0x41b3b3['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1e77ac(_0x27c682);});}else{return _0x1e77ac(null,_0x141dfe);}},'beforeUpdate':function(_0x5492bc,_0x47824f,_0x5d7d61){if(_0x5492bc[_0xa318('0xc')](_0xa318('0xb'))||_0x5492bc[_0xa318('0xc')](_0xa318('0xd'))||_0x5492bc[_0xa318('0xc')]('clientId')||_0x5492bc['changed'](_0xa318('0xe'))||_0x5492bc[_0xa318('0xc')]('code')||_0x5492bc[_0xa318('0xc')](_0xa318('0x22'))){var _0x337b2d,_0x1214dd;_0x337b2d=_0x5492bc[_0xa318('0xd')];var _0x588578=_0x337b2d['slice'](-0x1);if(_0x588578==='/'||_0x588578==='\x5c'||_0x588578===':'){_0x337b2d=_0x337b2d[_0xa318('0x10')](0x0,_0x337b2d[_0xa318('0x23')](_0x588578));}switch(_0x5492bc[_0xa318('0xb')]){case'US':_0x1214dd='https://accounts.zoho.com';break;case'AU':_0x1214dd=_0xa318('0x11');break;case'IN':_0x1214dd=_0xa318('0x12');break;case'CN':_0x1214dd=_0xa318('0x13');break;default:_0x1214dd=_0xa318('0x14');break;}var _0x2d0cf9={'method':'POST','uri':_0x1214dd+_0xa318('0x15'),'form':{'grant_type':_0xa318('0x16'),'client_id':_0x5492bc[_0xa318('0x17')],'client_secret':_0x5492bc[_0xa318('0xe')],'redirect_uri':_0x5492bc[_0xa318('0xd')],'code':_0x5492bc[_0xa318('0x18')]},'headers':{'Content-Type':_0xa318('0x19')}};return rp(_0x2d0cf9)[_0xa318('0x1a')](function(_0x425857){var _0xdbf9ae=JSON[_0xa318('0x1b')](_0x425857);if(_0xdbf9ae['refresh_token']){_0x5492bc[_0xa318('0x24')]=_0xdbf9ae[_0xa318('0x1c')];logger['info'](util[_0xa318('0x1d')](_0xa318('0x1e'),_0x5492bc[_0xa318('0x1f')],_0x5492bc['id']));}else{logger[_0xa318('0x20')](util[_0xa318('0x1d')](_0xa318('0x21'),_0x5492bc['name'],_0x5492bc['id']),util[_0xa318('0x25')](_0xdbf9ae,{'showHidden':![],'depth':null}));}return _0x5d7d61(null,_0x47824f);})[_0xa318('0x26')](function(_0x1f6134){logger[_0xa318('0x20')](util[_0xa318('0x1d')](_0xa318('0x21'),_0x5492bc[_0xa318('0x1f')],_0x5492bc['id']),util[_0xa318('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x5d7d61(_0x1f6134);});}else{return _0x5d7d61(null,_0x47824f);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 7b3719a..28504f5 100644 --- a/server/api/intZohoAccount/intZohoAccount.rpc.js +++ b/server/api/intZohoAccount/intZohoAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa860=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','debug','request\x20sent','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','attributes','include','map','model','ShowZohoAccount','find'];(function(_0x3deec3,_0x3c2deb){var _0x47a2d6=function(_0x56921e){while(--_0x56921e){_0x3deec3['push'](_0x3deec3['shift']());}};_0x47a2d6(++_0x3c2deb);}(_0xa860,0x9b));var _0x0a86=function(_0x46306d,_0x36b152){_0x46306d=_0x46306d-0x0;var _0x2d4c55=_0xa860[_0x46306d];return _0x2d4c55;};'use strict';var _=require(_0x0a86('0x0'));var util=require(_0x0a86('0x1'));var moment=require(_0x0a86('0x2'));var BPromise=require(_0x0a86('0x3'));var rs=require(_0x0a86('0x4'));var fs=require('fs');var Redis=require(_0x0a86('0x5'));var db=require(_0x0a86('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a86('0x7'))(_0x0a86('0x8'));var config=require('../../config/environment');var jayson=require(_0x0a86('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2aacf5,_0x27e421,_0xcbe78d){return new BPromise(function(_0x30ef6f,_0x540708){return client[_0x0a86('0xa')](_0x2aacf5,_0xcbe78d)[_0x0a86('0xb')](function(_0x522e48){logger[_0x0a86('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x27e421,'request\x20sent');logger[_0x0a86('0xd')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x27e421,_0x0a86('0xe'),JSON[_0x0a86('0xf')](_0x522e48));if(_0x522e48['error']){if(_0x522e48['error']['code']===0x1f4){logger[_0x0a86('0x10')](_0x0a86('0x11'),_0x27e421,_0x522e48[_0x0a86('0x10')][_0x0a86('0x12')]);return _0x540708(_0x522e48['error'][_0x0a86('0x12')]);}logger['error'](_0x0a86('0x11'),_0x27e421,_0x522e48['error'][_0x0a86('0x12')]);return _0x30ef6f(_0x522e48[_0x0a86('0x10')][_0x0a86('0x12')]);}else{logger[_0x0a86('0xc')](_0x0a86('0x11'),_0x27e421,'request\x20sent');_0x30ef6f(_0x522e48[_0x0a86('0x13')][_0x0a86('0x12')]);}})[_0x0a86('0x14')](function(_0x4ba54f){logger['error'](_0x0a86('0x11'),_0x27e421,_0x4ba54f);_0x540708(_0x4ba54f);});});}exports[_0x0a86('0x15')]=function(_0x3dfb5d){var _0x37342a=this;return new Promise(function(_0x1f5530,_0x1e8a4d){return db[_0x0a86('0x16')]['findAll']({'raw':_0x3dfb5d[_0x0a86('0x17')]?_0x3dfb5d[_0x0a86('0x17')][_0x0a86('0x18')]===undefined?!![]:![]:!![],'where':_0x3dfb5d[_0x0a86('0x17')]?_0x3dfb5d['options']['where']||null:null,'attributes':_0x3dfb5d[_0x0a86('0x17')]?_0x3dfb5d[_0x0a86('0x17')][_0x0a86('0x19')]||null:null,'limit':_0x3dfb5d[_0x0a86('0x17')]?_0x3dfb5d[_0x0a86('0x17')]['limit']||null:null,'include':_0x3dfb5d['options']?_0x3dfb5d[_0x0a86('0x17')][_0x0a86('0x1a')]?_[_0x0a86('0x1b')](_0x3dfb5d[_0x0a86('0x17')][_0x0a86('0x1a')],function(_0x289cb9){return{'model':db[_0x289cb9[_0x0a86('0x1c')]],'as':_0x289cb9['as'],'attributes':_0x289cb9[_0x0a86('0x19')],'include':_0x289cb9[_0x0a86('0x1a')]?_['map'](_0x289cb9[_0x0a86('0x1a')],function(_0x23974f){return{'model':db[_0x23974f['model']],'as':_0x23974f['as'],'attributes':_0x23974f[_0x0a86('0x19')],'include':_0x23974f[_0x0a86('0x1a')]?_[_0x0a86('0x1b')](_0x23974f[_0x0a86('0x1a')],function(_0x10f8c8){return{'model':db[_0x10f8c8[_0x0a86('0x1c')]],'as':_0x10f8c8['as'],'attributes':_0x10f8c8[_0x0a86('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a86('0xb')](function(_0x539c03){logger['info']('GetZohoAccount',_0x3dfb5d);logger[_0x0a86('0xd')]('GetZohoAccount',_0x3dfb5d,JSON[_0x0a86('0xf')](_0x539c03));_0x1f5530(_0x539c03);})[_0x0a86('0x14')](function(_0x451d84){logger[_0x0a86('0x10')]('GetZohoAccount',_0x451d84[_0x0a86('0x12')],_0x3dfb5d);_0x1e8a4d(_0x37342a['error'](0x1f4,_0x451d84[_0x0a86('0x12')]));});});};exports[_0x0a86('0x1d')]=function(_0x9cc95){var _0x4d9bb8=this;return new Promise(function(_0x1de571,_0x1ddbd9){return db[_0x0a86('0x16')][_0x0a86('0x1e')]({'raw':_0x9cc95['options']?_0x9cc95[_0x0a86('0x17')][_0x0a86('0x18')]===undefined?!![]:![]:!![],'where':_0x9cc95[_0x0a86('0x17')]?_0x9cc95[_0x0a86('0x17')]['where']||null:null,'attributes':_0x9cc95[_0x0a86('0x17')]?_0x9cc95[_0x0a86('0x17')][_0x0a86('0x19')]||null:null,'include':_0x9cc95[_0x0a86('0x17')]?_0x9cc95['options'][_0x0a86('0x1a')]?_[_0x0a86('0x1b')](_0x9cc95[_0x0a86('0x17')][_0x0a86('0x1a')],function(_0x1e2488){return{'model':db[_0x1e2488[_0x0a86('0x1c')]],'as':_0x1e2488['as'],'attributes':_0x1e2488[_0x0a86('0x19')],'include':_0x1e2488[_0x0a86('0x1a')]?_[_0x0a86('0x1b')](_0x1e2488[_0x0a86('0x1a')],function(_0x3b89de){return{'model':db[_0x3b89de['model']],'as':_0x3b89de['as'],'attributes':_0x3b89de['attributes'],'include':_0x3b89de['include']?_[_0x0a86('0x1b')](_0x3b89de[_0x0a86('0x1a')],function(_0x4fd246){return{'model':db[_0x4fd246[_0x0a86('0x1c')]],'as':_0x4fd246['as'],'attributes':_0x4fd246[_0x0a86('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a86('0xb')](function(_0x33eec7){logger[_0x0a86('0xc')](_0x0a86('0x1d'),_0x9cc95);logger['debug'](_0x0a86('0x1d'),_0x9cc95,JSON[_0x0a86('0xf')](_0x33eec7));_0x1de571(_0x33eec7);})['catch'](function(_0x28c710){logger[_0x0a86('0x10')]('ShowZohoAccount',_0x28c710[_0x0a86('0x12')],_0x9cc95);_0x1ddbd9(_0x4d9bb8[_0x0a86('0x10')](0x1f4,_0x28c710[_0x0a86('0x12')]));});});}; \ No newline at end of file +var _0xc542=['model','debug','GetZohoAccount','find','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','request','then','info','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xc542,0xd1));var _0x2c54=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xc542[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x2c54('0x0'));var util=require(_0x2c54('0x1'));var moment=require(_0x2c54('0x2'));var BPromise=require(_0x2c54('0x3'));var rs=require(_0x2c54('0x4'));var fs=require('fs');var Redis=require(_0x2c54('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2c54('0x6'));var config=require(_0x2c54('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2c54('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15e650,_0x64344a,_0x2a738c){return new BPromise(function(_0x2f4c54,_0x5b6566){return client[_0x2c54('0x9')](_0x15e650,_0x2a738c)[_0x2c54('0xa')](function(_0x6e9224){logger[_0x2c54('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x64344a,_0x2c54('0xc'));logger['debug'](_0x2c54('0xd'),_0x64344a,'request\x20sent',JSON[_0x2c54('0xe')](_0x6e9224));if(_0x6e9224[_0x2c54('0xf')]){if(_0x6e9224[_0x2c54('0xf')]['code']===0x1f4){logger[_0x2c54('0xf')](_0x2c54('0x10'),_0x64344a,_0x6e9224[_0x2c54('0xf')][_0x2c54('0x11')]);return _0x5b6566(_0x6e9224[_0x2c54('0xf')][_0x2c54('0x11')]);}logger[_0x2c54('0xf')](_0x2c54('0x10'),_0x64344a,_0x6e9224[_0x2c54('0xf')][_0x2c54('0x11')]);return _0x2f4c54(_0x6e9224[_0x2c54('0xf')][_0x2c54('0x11')]);}else{logger[_0x2c54('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x64344a,_0x2c54('0xc'));_0x2f4c54(_0x6e9224[_0x2c54('0x12')][_0x2c54('0x11')]);}})[_0x2c54('0x13')](function(_0x568b60){logger[_0x2c54('0xf')](_0x2c54('0x10'),_0x64344a,_0x568b60);_0x5b6566(_0x568b60);});});}exports['GetZohoAccount']=function(_0x41bc83){var _0x4012ea=this;return new Promise(function(_0x4950d0,_0x3eede2){return db[_0x2c54('0x14')][_0x2c54('0x15')]({'raw':_0x41bc83[_0x2c54('0x16')]?_0x41bc83[_0x2c54('0x16')][_0x2c54('0x17')]===undefined?!![]:![]:!![],'where':_0x41bc83['options']?_0x41bc83[_0x2c54('0x16')][_0x2c54('0x18')]||null:null,'attributes':_0x41bc83['options']?_0x41bc83[_0x2c54('0x16')][_0x2c54('0x19')]||null:null,'limit':_0x41bc83[_0x2c54('0x16')]?_0x41bc83[_0x2c54('0x16')][_0x2c54('0x1a')]||null:null,'include':_0x41bc83['options']?_0x41bc83[_0x2c54('0x16')][_0x2c54('0x1b')]?_[_0x2c54('0x1c')](_0x41bc83['options'][_0x2c54('0x1b')],function(_0x1da46a){return{'model':db[_0x1da46a[_0x2c54('0x1d')]],'as':_0x1da46a['as'],'attributes':_0x1da46a['attributes'],'include':_0x1da46a[_0x2c54('0x1b')]?_[_0x2c54('0x1c')](_0x1da46a['include'],function(_0x5b3b21){return{'model':db[_0x5b3b21[_0x2c54('0x1d')]],'as':_0x5b3b21['as'],'attributes':_0x5b3b21[_0x2c54('0x19')],'include':_0x5b3b21[_0x2c54('0x1b')]?_[_0x2c54('0x1c')](_0x5b3b21[_0x2c54('0x1b')],function(_0x39c3d2){return{'model':db[_0x39c3d2['model']],'as':_0x39c3d2['as'],'attributes':_0x39c3d2[_0x2c54('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2c54('0xa')](function(_0x427c0a){logger['info']('GetZohoAccount',_0x41bc83);logger[_0x2c54('0x1e')](_0x2c54('0x1f'),_0x41bc83,JSON[_0x2c54('0xe')](_0x427c0a));_0x4950d0(_0x427c0a);})[_0x2c54('0x13')](function(_0x282bb5){logger[_0x2c54('0xf')](_0x2c54('0x1f'),_0x282bb5['message'],_0x41bc83);_0x3eede2(_0x4012ea[_0x2c54('0xf')](0x1f4,_0x282bb5['message']));});});};exports['ShowZohoAccount']=function(_0x268f3e){var _0x20b43e=this;return new Promise(function(_0x9a822f,_0x34897e){return db[_0x2c54('0x14')][_0x2c54('0x20')]({'raw':_0x268f3e[_0x2c54('0x16')]?_0x268f3e[_0x2c54('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x268f3e['options']?_0x268f3e['options'][_0x2c54('0x18')]||null:null,'attributes':_0x268f3e[_0x2c54('0x16')]?_0x268f3e[_0x2c54('0x16')][_0x2c54('0x19')]||null:null,'include':_0x268f3e['options']?_0x268f3e[_0x2c54('0x16')]['include']?_[_0x2c54('0x1c')](_0x268f3e['options'][_0x2c54('0x1b')],function(_0x1cf975){return{'model':db[_0x1cf975[_0x2c54('0x1d')]],'as':_0x1cf975['as'],'attributes':_0x1cf975[_0x2c54('0x19')],'include':_0x1cf975[_0x2c54('0x1b')]?_[_0x2c54('0x1c')](_0x1cf975[_0x2c54('0x1b')],function(_0x5892ac){return{'model':db[_0x5892ac[_0x2c54('0x1d')]],'as':_0x5892ac['as'],'attributes':_0x5892ac['attributes'],'include':_0x5892ac[_0x2c54('0x1b')]?_[_0x2c54('0x1c')](_0x5892ac[_0x2c54('0x1b')],function(_0x31e3e0){return{'model':db[_0x31e3e0['model']],'as':_0x31e3e0['as'],'attributes':_0x31e3e0[_0x2c54('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xae2581){logger['info'](_0x2c54('0x21'),_0x268f3e);logger[_0x2c54('0x1e')](_0x2c54('0x21'),_0x268f3e,JSON[_0x2c54('0xe')](_0xae2581));_0x9a822f(_0xae2581);})[_0x2c54('0x13')](function(_0x2c32f9){logger[_0x2c54('0xf')](_0x2c54('0x21'),_0x2c32f9['message'],_0x268f3e);_0x34897e(_0x20b43e['error'](0x1f4,_0x2c32f9[_0x2c54('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index cd2b03e..213ae43 100644 --- a/server/api/intZohoConfiguration/index.js +++ b/server/api/intZohoConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcc9=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put','update','delete','destroy','exports','multer'];(function(_0x40ab0c,_0x3ad21b){var _0x2c6e84=function(_0x2b85a6){while(--_0x2b85a6){_0x40ab0c['push'](_0x40ab0c['shift']());}};_0x2c6e84(++_0x3ad21b);}(_0xbcc9,0x1e2));var _0x9bcc=function(_0x2e0ce0,_0x1f23eb){_0x2e0ce0=_0x2e0ce0-0x0;var _0x2f3dd7=_0xbcc9[_0x2e0ce0];return _0x2f3dd7;};'use strict';var multer=require(_0x9bcc('0x0'));var util=require(_0x9bcc('0x1'));var path=require(_0x9bcc('0x2'));var timeout=require(_0x9bcc('0x3'));var express=require('express');var router=express[_0x9bcc('0x4')]();var auth=require(_0x9bcc('0x5'));var interaction=require(_0x9bcc('0x6'));var config=require('../../config/environment');var controller=require(_0x9bcc('0x7'));router[_0x9bcc('0x8')]('/',auth[_0x9bcc('0x9')](),controller[_0x9bcc('0xa')]);router[_0x9bcc('0x8')](_0x9bcc('0xb'),auth[_0x9bcc('0x9')](),controller[_0x9bcc('0xc')]);router[_0x9bcc('0x8')]('/:id/fields',auth[_0x9bcc('0x9')](),controller[_0x9bcc('0xd')]);router[_0x9bcc('0x8')](_0x9bcc('0xe'),auth['isAuthenticated'](),controller[_0x9bcc('0xf')]);router['get'](_0x9bcc('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x9bcc('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9bcc('0x12')](_0x9bcc('0xb'),auth[_0x9bcc('0x9')](),controller[_0x9bcc('0x13')]);router[_0x9bcc('0x14')](_0x9bcc('0xb'),auth[_0x9bcc('0x9')](),controller[_0x9bcc('0x15')]);module[_0x9bcc('0x16')]=router; \ No newline at end of file +var _0xec15=['isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x5765c9,_0x4a544c){var _0x181efc=function(_0x2e7de4){while(--_0x2e7de4){_0x5765c9['push'](_0x5765c9['shift']());}};_0x181efc(++_0x4a544c);}(_0xec15,0x1c5));var _0x5ec1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xec15[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x5ec1('0x0'));var util=require(_0x5ec1('0x1'));var path=require(_0x5ec1('0x2'));var timeout=require(_0x5ec1('0x3'));var express=require('express');var router=express[_0x5ec1('0x4')]();var auth=require(_0x5ec1('0x5'));var interaction=require(_0x5ec1('0x6'));var config=require(_0x5ec1('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x5ec1('0x8')]('/',auth[_0x5ec1('0x9')](),controller[_0x5ec1('0xa')]);router['get'](_0x5ec1('0xb'),auth['isAuthenticated'](),controller[_0x5ec1('0xc')]);router[_0x5ec1('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x5ec1('0xd')]);router[_0x5ec1('0x8')](_0x5ec1('0xe'),auth[_0x5ec1('0x9')](),controller[_0x5ec1('0xf')]);router[_0x5ec1('0x8')]('/:id/descriptions',auth[_0x5ec1('0x9')](),controller[_0x5ec1('0x10')]);router[_0x5ec1('0x11')]('/',auth[_0x5ec1('0x9')](),controller[_0x5ec1('0x12')]);router['put'](_0x5ec1('0xb'),auth[_0x5ec1('0x9')](),controller['update']);router['delete'](_0x5ec1('0xb'),auth[_0x5ec1('0x9')](),controller[_0x5ec1('0x13')]);module[_0x5ec1('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 68f3aaf..edc9e18 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x496a=['STRING','ENUM','Leads','Contacts','sequelize','exports'];(function(_0x2ddfd9,_0x5877d0){var _0x2668f0=function(_0x70ad6f){while(--_0x70ad6f){_0x2ddfd9['push'](_0x2ddfd9['shift']());}};_0x2668f0(++_0x5877d0);}(_0x496a,0x1ba));var _0xa496=function(_0x43b71c,_0x4c7ed7){_0x43b71c=_0x43b71c-0x0;var _0x16d5e3=_0x496a[_0x43b71c];return _0x16d5e3;};'use strict';var Sequelize=require(_0xa496('0x0'));module[_0xa496('0x1')]={'name':{'type':Sequelize[_0xa496('0x2')]},'moduleCreate':{'type':Sequelize[_0xa496('0x3')](_0xa496('0x4'),_0xa496('0x5')),'defaultValue':_0xa496('0x4')},'description':{'type':Sequelize[_0xa496('0x2')]}}; \ No newline at end of file +var _0xb4f7=['exports','STRING','Leads'];(function(_0x3a5e50,_0x30e50b){var _0x226020=function(_0x517840){while(--_0x517840){_0x3a5e50['push'](_0x3a5e50['shift']());}};_0x226020(++_0x30e50b);}(_0xb4f7,0x195));var _0x7b4f=function(_0x27b53e,_0x25858a){_0x27b53e=_0x27b53e-0x0;var _0x48ed0f=_0xb4f7[_0x27b53e];return _0x48ed0f;};'use strict';var Sequelize=require('sequelize');module[_0x7b4f('0x0')]={'name':{'type':Sequelize[_0x7b4f('0x1')]},'moduleCreate':{'type':Sequelize['ENUM']('Leads','Contacts'),'defaultValue':_0x7b4f('0x2')},'description':{'type':Sequelize[_0x7b4f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 892e33d..395dd34 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fb0=['filters','intersection','attributes','fields','length','limit','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','include','find','create','body','getFields','findOne','ZohoField','order','pick','hasOwnProperty','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','http','test','then','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','status','json','count','offset','set','Content-Range','reject','save','update','destroy','stack','name','index','ZohoConfiguration','rawAttributes','model','query','keys'];(function(_0x20d562,_0x232f40){var _0x5233b2=function(_0x8ef599){while(--_0x8ef599){_0x20d562['push'](_0x20d562['shift']());}};_0x5233b2(++_0x232f40);}(_0x3fb0,0x127));var _0x03fb=function(_0x5d3920,_0x1b4004){_0x5d3920=_0x5d3920-0x0;var _0x5ee3b0=_0x3fb0[_0x5d3920];return _0x5ee3b0;};'use strict';var pdf=require(_0x03fb('0x0'));var emlformat=require(_0x03fb('0x1'));var rimraf=require(_0x03fb('0x2'));var zipdir=require(_0x03fb('0x3'));var jsonpatch=require(_0x03fb('0x4'));var rp=require('request-promise');var moment=require(_0x03fb('0x5'));var BPromise=require(_0x03fb('0x6'));var Mustache=require(_0x03fb('0x7'));var util=require(_0x03fb('0x8'));var path=require(_0x03fb('0x9'));var sox=require(_0x03fb('0xa'));var csv=require(_0x03fb('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x03fb('0xc'));var jsforce=require(_0x03fb('0xd'));var deskjs=require(_0x03fb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x03fb('0xf'));var authService=require(_0x03fb('0x10'));var qs=require(_0x03fb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03fb('0x12'))(_0x03fb('0x13'));var utils=require(_0x03fb('0x14'));var config=require(_0x03fb('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x03fb('0x16')]({'port':0x232a});function checkPasswordPattern(_0x5e15bf,_0x25b1e3,_0x2da015){if(_0x2da015){var _0xb76a7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb76a7[_0x03fb('0x17')](_0x25b1e3)){return _0x5e15bf;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5e15bf;}}function respondWithRpcPromise(_0x2e5f75,_0x2b5bc5,_0x5abb9b,_0x39f469){return new BPromise(function(_0x34d287,_0x178c7c){var _0x31beac=_0x39f469||client;return _0x31beac['request'](_0x2e5f75,_0x5abb9b)[_0x03fb('0x18')](function(_0x5cb54c){logger['info'](_0x03fb('0x19'),_0x2b5bc5,'request\x20sent');logger['debug'](_0x03fb('0x1a'),_0x2b5bc5,'request\x20sent',JSON[_0x03fb('0x1b')](_0x5cb54c));if(_0x5cb54c[_0x03fb('0x1c')]){if(_0x5cb54c['error'][_0x03fb('0x1d')]===0x1f4){logger[_0x03fb('0x1c')]('ZohoConfiguration,\x20%s,\x20%s',_0x2b5bc5,_0x5cb54c[_0x03fb('0x1c')][_0x03fb('0x1e')]);return _0x178c7c(_0x5cb54c[_0x03fb('0x1c')][_0x03fb('0x1e')]);}logger[_0x03fb('0x1c')](_0x03fb('0x19'),_0x2b5bc5,_0x5cb54c[_0x03fb('0x1c')][_0x03fb('0x1e')]);return _0x34d287(_0x5cb54c['error']['message']);}else{logger[_0x03fb('0x1f')](_0x03fb('0x19'),_0x2b5bc5,'request\x20sent');_0x34d287(_0x5cb54c[_0x03fb('0x20')][_0x03fb('0x1e')]);}})['catch'](function(_0xc0421d){logger[_0x03fb('0x1c')]('ZohoConfiguration,\x20%s,\x20%s',_0x2b5bc5,_0xc0421d);_0x178c7c(_0xc0421d);});});}function respondWithStatusCode(_0x110f84,_0x475312){_0x475312=_0x475312||0xcc;return function(_0x55ca3a){if(_0x55ca3a){return _0x110f84[_0x03fb('0x21')](_0x475312);}return _0x110f84['status'](_0x475312)[_0x03fb('0x22')]();};}function respondWithResult(_0x2c5abd,_0x52ee49){_0x52ee49=_0x52ee49||0xc8;return function(_0x1fb86f){if(_0x1fb86f){return _0x2c5abd[_0x03fb('0x23')](_0x52ee49)[_0x03fb('0x24')](_0x1fb86f);}};}function respondWithFilteredResult(_0x6aa409,_0x21588d){return function(_0x30ba87){if(_0x30ba87){var _0xaa14f=_0x30ba87[_0x03fb('0x25')],_0x1e1bad=_0x21588d[_0x03fb('0x26')],_0x4d29c8=_0x21588d[_0x03fb('0x26')]+_0x21588d['limit'],_0x4bc0d1;if(_0x4d29c8>=_0xaa14f){_0x4d29c8=_0xaa14f;_0x4bc0d1=0xc8;}else{_0x4bc0d1=0xce;}_0x6aa409[_0x03fb('0x23')](_0x4bc0d1);return _0x6aa409[_0x03fb('0x27')](_0x03fb('0x28'),_0x1e1bad+'-'+_0x4d29c8+'/'+_0xaa14f)['json'](_0x30ba87);}return null;};}function patchUpdates(_0x31df9c){return function(_0x549629){try{jsonpatch['apply'](_0x549629,_0x31df9c,!![]);}catch(_0x2a1c57){return BPromise[_0x03fb('0x29')](_0x2a1c57);}return _0x549629[_0x03fb('0x2a')]();};}function saveUpdates(_0x2d0b79,_0x9da2bf){return function(_0x4d107e){if(_0x4d107e){return _0x4d107e[_0x03fb('0x2b')](_0x2d0b79)[_0x03fb('0x18')](function(_0x5c7fc2){return _0x5c7fc2;});}return null;};}function removeEntity(_0x492d60,_0x52019e){return function(_0x55d387){if(_0x55d387){return _0x55d387[_0x03fb('0x2c')]()[_0x03fb('0x18')](function(){_0x492d60[_0x03fb('0x23')](0xcc)[_0x03fb('0x22')]();});}};}function handleEntityNotFound(_0x846484,_0x453c26){return function(_0x6d3e39){if(!_0x6d3e39){_0x846484[_0x03fb('0x21')](0x194);}return _0x6d3e39;};}function handleError(_0x29ee46,_0x2b35ad){_0x2b35ad=_0x2b35ad||0x1f4;return function(_0x203625){logger['error'](_0x203625[_0x03fb('0x2d')]);if(_0x203625[_0x03fb('0x2e')]){delete _0x203625[_0x03fb('0x2e')];}_0x29ee46[_0x03fb('0x23')](_0x2b35ad)['send'](_0x203625);};}exports[_0x03fb('0x2f')]=function(_0x1fff34,_0x867c4a){var _0x2a379a={},_0x38f4ea={},_0x25a158={'count':0x0,'rows':[]};var _0x42cd95=db[_0x03fb('0x30')][_0x03fb('0x31')];_0x38f4ea[_0x03fb('0x32')]=_['keys'](_0x42cd95);_0x38f4ea[_0x03fb('0x33')]=_[_0x03fb('0x34')](_0x1fff34[_0x03fb('0x33')]);_0x38f4ea[_0x03fb('0x35')]=_[_0x03fb('0x36')](_0x38f4ea[_0x03fb('0x32')],_0x38f4ea['query']);_0x2a379a[_0x03fb('0x37')]=_['intersection'](_0x38f4ea[_0x03fb('0x32')],qs[_0x03fb('0x38')](_0x1fff34[_0x03fb('0x33')][_0x03fb('0x38')]));_0x2a379a[_0x03fb('0x37')]=_0x2a379a[_0x03fb('0x37')][_0x03fb('0x39')]?_0x2a379a[_0x03fb('0x37')]:_0x38f4ea[_0x03fb('0x32')];if(!_0x1fff34[_0x03fb('0x33')]['hasOwnProperty']('nolimit')){_0x2a379a[_0x03fb('0x3a')]=qs[_0x03fb('0x3a')](_0x1fff34[_0x03fb('0x33')]['limit']);_0x2a379a['offset']=qs[_0x03fb('0x26')](_0x1fff34[_0x03fb('0x33')]['offset']);}_0x2a379a['order']=qs[_0x03fb('0x3b')](_0x1fff34[_0x03fb('0x33')][_0x03fb('0x3b')]);_0x2a379a[_0x03fb('0x3c')]=qs[_0x03fb('0x35')](_['pick'](_0x1fff34['query'],_0x38f4ea[_0x03fb('0x35')]));if(_0x1fff34[_0x03fb('0x33')][_0x03fb('0x3d')]){_0x2a379a[_0x03fb('0x3c')]=_[_0x03fb('0x3e')](_0x2a379a[_0x03fb('0x3c')],{'$or':_[_0x03fb('0x3f')](_0x42cd95,function(_0x53fbb3){if(_0x53fbb3[_0x03fb('0x40')][_0x03fb('0x41')]!==_0x03fb('0x42')){var _0x20100f={};_0x20100f[_0x53fbb3[_0x03fb('0x43')]]={'$like':'%'+_0x1fff34[_0x03fb('0x33')][_0x03fb('0x3d')]+'%'};return _0x20100f;}})});}_0x2a379a=_[_0x03fb('0x3e')]({},_0x2a379a,_0x1fff34[_0x03fb('0x44')]);var _0x3a7029={'where':_0x2a379a['where']};return db[_0x03fb('0x30')][_0x03fb('0x25')](_0x3a7029)[_0x03fb('0x18')](function(_0x55bfd7){_0x25a158[_0x03fb('0x25')]=_0x55bfd7;if(_0x1fff34[_0x03fb('0x33')][_0x03fb('0x45')]){_0x2a379a['include']=[{'all':!![]}];}return db[_0x03fb('0x30')][_0x03fb('0x46')](_0x2a379a);})[_0x03fb('0x18')](function(_0x5b1109){_0x25a158[_0x03fb('0x47')]=_0x5b1109;return _0x25a158;})[_0x03fb('0x18')](respondWithFilteredResult(_0x867c4a,_0x2a379a))[_0x03fb('0x48')](handleError(_0x867c4a,null));};exports['show']=function(_0x424fa3,_0x31f10a){var _0x3241b4={'raw':![],'where':{'id':_0x424fa3[_0x03fb('0x49')]['id']}},_0x9c51e7={};_0x9c51e7[_0x03fb('0x32')]=_[_0x03fb('0x34')](db['ZohoConfiguration'][_0x03fb('0x31')]);_0x9c51e7['query']=_[_0x03fb('0x34')](_0x424fa3[_0x03fb('0x33')]);_0x9c51e7[_0x03fb('0x35')]=_[_0x03fb('0x36')](_0x9c51e7[_0x03fb('0x32')],_0x9c51e7[_0x03fb('0x33')]);_0x3241b4['attributes']=_[_0x03fb('0x36')](_0x9c51e7['model'],qs[_0x03fb('0x38')](_0x424fa3[_0x03fb('0x33')][_0x03fb('0x38')]));_0x3241b4[_0x03fb('0x37')]=_0x3241b4['attributes'][_0x03fb('0x39')]?_0x3241b4['attributes']:_0x9c51e7[_0x03fb('0x32')];if(_0x424fa3[_0x03fb('0x33')][_0x03fb('0x45')]){_0x3241b4[_0x03fb('0x4a')]=[{'all':!![]}];}_0x3241b4=_[_0x03fb('0x3e')]({},_0x3241b4,_0x424fa3['options']);return db[_0x03fb('0x30')][_0x03fb('0x4b')](_0x3241b4)[_0x03fb('0x18')](handleEntityNotFound(_0x31f10a,null))[_0x03fb('0x18')](respondWithResult(_0x31f10a,null))[_0x03fb('0x48')](handleError(_0x31f10a,null));};exports[_0x03fb('0x4c')]=function(_0x393c61,_0x2b732d){return db[_0x03fb('0x30')][_0x03fb('0x4c')](_0x393c61['body'],{})[_0x03fb('0x18')](respondWithResult(_0x2b732d,0xc9))[_0x03fb('0x48')](handleError(_0x2b732d,null));};exports[_0x03fb('0x2b')]=function(_0x2b4e32,_0x489347){if(_0x2b4e32[_0x03fb('0x4d')]['id']){delete _0x2b4e32[_0x03fb('0x4d')]['id'];}return db['ZohoConfiguration'][_0x03fb('0x4b')]({'where':{'id':_0x2b4e32[_0x03fb('0x49')]['id']}})[_0x03fb('0x18')](handleEntityNotFound(_0x489347,null))[_0x03fb('0x18')](saveUpdates(_0x2b4e32[_0x03fb('0x4d')],null))[_0x03fb('0x18')](respondWithResult(_0x489347,null))[_0x03fb('0x48')](handleError(_0x489347,null));};exports[_0x03fb('0x2c')]=function(_0x1b648b,_0x1ba859){return db[_0x03fb('0x30')][_0x03fb('0x4b')]({'where':{'id':_0x1b648b['params']['id']}})[_0x03fb('0x18')](handleEntityNotFound(_0x1ba859,null))[_0x03fb('0x18')](removeEntity(_0x1ba859,null))[_0x03fb('0x48')](handleError(_0x1ba859,null));};exports[_0x03fb('0x4e')]=function(_0x2937a4,_0x5a53ee,_0x12bfb9){var _0x3e4b96={};var _0x52a681={};var _0x460eb1;var _0x5eb511;return db['ZohoConfiguration'][_0x03fb('0x4f')]({'where':{'id':_0x2937a4['params']['id']}})[_0x03fb('0x18')](handleEntityNotFound(_0x5a53ee,null))[_0x03fb('0x18')](function(_0x4b13d2){if(_0x4b13d2){_0x460eb1=_0x4b13d2;_0x52a681['model']=_[_0x03fb('0x34')](db[_0x03fb('0x50')][_0x03fb('0x31')]);_0x52a681[_0x03fb('0x33')]=_[_0x03fb('0x34')](_0x2937a4['query']);_0x52a681[_0x03fb('0x35')]=_[_0x03fb('0x36')](_0x52a681[_0x03fb('0x32')],_0x52a681[_0x03fb('0x33')]);_0x3e4b96[_0x03fb('0x37')]=_[_0x03fb('0x36')](_0x52a681[_0x03fb('0x32')],qs[_0x03fb('0x38')](_0x2937a4[_0x03fb('0x33')][_0x03fb('0x38')]));_0x3e4b96[_0x03fb('0x37')]=_0x3e4b96[_0x03fb('0x37')]['length']?_0x3e4b96[_0x03fb('0x37')]:_0x52a681[_0x03fb('0x32')];_0x3e4b96[_0x03fb('0x51')]=qs[_0x03fb('0x3b')](_0x2937a4[_0x03fb('0x33')][_0x03fb('0x3b')]);_0x3e4b96['where']=qs[_0x03fb('0x35')](_[_0x03fb('0x52')](_0x2937a4['query'],_0x52a681[_0x03fb('0x35')]));if(_0x2937a4[_0x03fb('0x33')]['filter']){_0x3e4b96[_0x03fb('0x3c')]=_[_0x03fb('0x3e')](_0x3e4b96[_0x03fb('0x3c')],{'$or':_[_0x03fb('0x3f')](_0x3e4b96[_0x03fb('0x37')],function(_0x4899c6){var _0x4b90b5={};_0x4b90b5[_0x4899c6]={'$like':'%'+_0x2937a4[_0x03fb('0x33')]['filter']+'%'};return _0x4b90b5;})});}_0x3e4b96=_[_0x03fb('0x3e')]({},_0x3e4b96,_0x2937a4[_0x03fb('0x44')]);return _0x460eb1['getFields'](_0x3e4b96);}})['then'](function(_0x2880af){if(_0x2880af){_0x5eb511=_0x2880af[_0x03fb('0x39')];if(!_0x2937a4['query'][_0x03fb('0x53')](_0x03fb('0x54'))){_0x3e4b96[_0x03fb('0x3a')]=qs[_0x03fb('0x3a')](_0x2937a4[_0x03fb('0x33')][_0x03fb('0x3a')]);_0x3e4b96[_0x03fb('0x26')]=qs['offset'](_0x2937a4[_0x03fb('0x33')][_0x03fb('0x26')]);}return _0x460eb1[_0x03fb('0x4e')](_0x3e4b96);}})[_0x03fb('0x18')](function(_0x190885){if(_0x190885){return _0x190885?{'count':_0x5eb511,'rows':_0x190885}:null;}})['then'](respondWithResult(_0x5a53ee,null))[_0x03fb('0x48')](handleError(_0x5a53ee,null));};exports[_0x03fb('0x55')]=function(_0x2425a8,_0x270c0a,_0x6d7413){var _0x3605fd={};var _0x33de7e={};var _0x4895c6;var _0x1e81c4;return db[_0x03fb('0x30')][_0x03fb('0x4f')]({'where':{'id':_0x2425a8['params']['id']}})['then'](handleEntityNotFound(_0x270c0a,null))[_0x03fb('0x18')](function(_0x5e7dc1){if(_0x5e7dc1){_0x4895c6=_0x5e7dc1;_0x33de7e['model']=_[_0x03fb('0x34')](db['ZohoField'][_0x03fb('0x31')]);_0x33de7e['query']=_[_0x03fb('0x34')](_0x2425a8[_0x03fb('0x33')]);_0x33de7e[_0x03fb('0x35')]=_[_0x03fb('0x36')](_0x33de7e[_0x03fb('0x32')],_0x33de7e['query']);_0x3605fd['attributes']=_[_0x03fb('0x36')](_0x33de7e[_0x03fb('0x32')],qs[_0x03fb('0x38')](_0x2425a8[_0x03fb('0x33')][_0x03fb('0x38')]));_0x3605fd[_0x03fb('0x37')]=_0x3605fd['attributes'][_0x03fb('0x39')]?_0x3605fd[_0x03fb('0x37')]:_0x33de7e[_0x03fb('0x32')];_0x3605fd[_0x03fb('0x51')]=qs[_0x03fb('0x3b')](_0x2425a8['query'][_0x03fb('0x3b')]);_0x3605fd[_0x03fb('0x3c')]=qs['filters'](_['pick'](_0x2425a8['query'],_0x33de7e['filters']));if(_0x2425a8[_0x03fb('0x33')][_0x03fb('0x3d')]){_0x3605fd[_0x03fb('0x3c')]=_[_0x03fb('0x3e')](_0x3605fd[_0x03fb('0x3c')],{'$or':_['map'](_0x3605fd['attributes'],function(_0x546545){var _0x2d5c01={};_0x2d5c01[_0x546545]={'$like':'%'+_0x2425a8[_0x03fb('0x33')]['filter']+'%'};return _0x2d5c01;})});}_0x3605fd=_[_0x03fb('0x3e')]({},_0x3605fd,_0x2425a8[_0x03fb('0x44')]);return _0x4895c6[_0x03fb('0x55')](_0x3605fd);}})[_0x03fb('0x18')](function(_0x254390){if(_0x254390){_0x1e81c4=_0x254390['length'];if(!_0x2425a8['query'][_0x03fb('0x53')](_0x03fb('0x54'))){_0x3605fd[_0x03fb('0x3a')]=qs[_0x03fb('0x3a')](_0x2425a8[_0x03fb('0x33')][_0x03fb('0x3a')]);_0x3605fd['offset']=qs['offset'](_0x2425a8[_0x03fb('0x33')][_0x03fb('0x26')]);}return _0x4895c6[_0x03fb('0x55')](_0x3605fd);}})[_0x03fb('0x18')](function(_0x4ef6c5){if(_0x4ef6c5){return _0x4ef6c5?{'count':_0x1e81c4,'rows':_0x4ef6c5}:null;}})[_0x03fb('0x18')](respondWithResult(_0x270c0a,null))[_0x03fb('0x48')](handleError(_0x270c0a,null));};exports['getDescriptions']=function(_0x391fbe,_0x1b8a29,_0xb17d36){var _0x56fc7a={};var _0x5d19fe={};var _0x111286;var _0x1d09a3;return db[_0x03fb('0x30')]['findOne']({'where':{'id':_0x391fbe[_0x03fb('0x49')]['id']}})[_0x03fb('0x18')](handleEntityNotFound(_0x1b8a29,null))[_0x03fb('0x18')](function(_0x213354){if(_0x213354){_0x111286=_0x213354;_0x5d19fe[_0x03fb('0x32')]=_['keys'](db[_0x03fb('0x50')][_0x03fb('0x31')]);_0x5d19fe['query']=_[_0x03fb('0x34')](_0x391fbe['query']);_0x5d19fe['filters']=_[_0x03fb('0x36')](_0x5d19fe['model'],_0x5d19fe[_0x03fb('0x33')]);_0x56fc7a[_0x03fb('0x37')]=_['intersection'](_0x5d19fe[_0x03fb('0x32')],qs[_0x03fb('0x38')](_0x391fbe['query'][_0x03fb('0x38')]));_0x56fc7a['attributes']=_0x56fc7a['attributes'][_0x03fb('0x39')]?_0x56fc7a['attributes']:_0x5d19fe['model'];_0x56fc7a[_0x03fb('0x51')]=qs[_0x03fb('0x3b')](_0x391fbe['query'][_0x03fb('0x3b')]);_0x56fc7a[_0x03fb('0x3c')]=qs[_0x03fb('0x35')](_[_0x03fb('0x52')](_0x391fbe[_0x03fb('0x33')],_0x5d19fe['filters']));if(_0x391fbe[_0x03fb('0x33')][_0x03fb('0x3d')]){_0x56fc7a[_0x03fb('0x3c')]=_[_0x03fb('0x3e')](_0x56fc7a[_0x03fb('0x3c')],{'$or':_[_0x03fb('0x3f')](_0x56fc7a[_0x03fb('0x37')],function(_0x121480){var _0x9cd303={};_0x9cd303[_0x121480]={'$like':'%'+_0x391fbe['query'][_0x03fb('0x3d')]+'%'};return _0x9cd303;})});}_0x56fc7a=_[_0x03fb('0x3e')]({},_0x56fc7a,_0x391fbe[_0x03fb('0x44')]);return _0x111286[_0x03fb('0x56')](_0x56fc7a);}})[_0x03fb('0x18')](function(_0x376f95){if(_0x376f95){_0x1d09a3=_0x376f95[_0x03fb('0x39')];if(!_0x391fbe[_0x03fb('0x33')]['hasOwnProperty'](_0x03fb('0x54'))){_0x56fc7a[_0x03fb('0x3a')]=qs['limit'](_0x391fbe['query'][_0x03fb('0x3a')]);_0x56fc7a[_0x03fb('0x26')]=qs[_0x03fb('0x26')](_0x391fbe[_0x03fb('0x33')][_0x03fb('0x26')]);}return _0x111286['getDescriptions'](_0x56fc7a);}})[_0x03fb('0x18')](function(_0x1593cc){if(_0x1593cc){return _0x1593cc?{'count':_0x1d09a3,'rows':_0x1593cc}:null;}})[_0x03fb('0x18')](respondWithResult(_0x1b8a29,null))[_0x03fb('0x48')](handleError(_0x1b8a29,null));}; \ No newline at end of file +var _0x85e9=['merge','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','create','body','find','getFields','findOne','ZohoField','rawAttributes','order','map','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','test','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','set','apply','update','destroy','index','ZohoConfiguration','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter'];(function(_0x56aab0,_0x4afd25){var _0xa15bf4=function(_0x499049){while(--_0x499049){_0x56aab0['push'](_0x56aab0['shift']());}};_0xa15bf4(++_0x4afd25);}(_0x85e9,0xc2));var _0x985e=function(_0x2869b9,_0x577880){_0x2869b9=_0x2869b9-0x0;var _0x153c0c=_0x85e9[_0x2869b9];return _0x153c0c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x985e('0x0'));var zipdir=require(_0x985e('0x1'));var jsonpatch=require(_0x985e('0x2'));var rp=require(_0x985e('0x3'));var moment=require(_0x985e('0x4'));var BPromise=require(_0x985e('0x5'));var Mustache=require(_0x985e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x985e('0x7'));var csv=require(_0x985e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x985e('0x9'));var squel=require(_0x985e('0xa'));var crypto=require(_0x985e('0xb'));var jsforce=require(_0x985e('0xc'));var deskjs=require(_0x985e('0xd'));var toCsv=require(_0x985e('0x8'));var querystring=require(_0x985e('0xe'));var Papa=require(_0x985e('0xf'));var Redis=require(_0x985e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x985e('0x11'));var hardwareService=require(_0x985e('0x12'));var logger=require(_0x985e('0x13'))(_0x985e('0x14'));var utils=require('../../config/utils');var config=require(_0x985e('0x15'));var db=require(_0x985e('0x16'))['db'];var jayson=require(_0x985e('0x17'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x5ef601,_0x5c35c4,_0x1cc1be){if(_0x1cc1be){var _0x2bb059=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2bb059[_0x985e('0x18')](_0x5c35c4)){return _0x5ef601;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5ef601;}}function respondWithRpcPromise(_0x4f0423,_0x11fa37,_0x521dc4,_0x44d76f){return new BPromise(function(_0x16673a,_0x129b0e){var _0x374060=_0x44d76f||client;return _0x374060['request'](_0x4f0423,_0x521dc4)[_0x985e('0x19')](function(_0x3f5594){logger['info'](_0x985e('0x1a'),_0x11fa37,_0x985e('0x1b'));logger[_0x985e('0x1c')](_0x985e('0x1d'),_0x11fa37,_0x985e('0x1b'),JSON[_0x985e('0x1e')](_0x3f5594));if(_0x3f5594[_0x985e('0x1f')]){if(_0x3f5594[_0x985e('0x1f')][_0x985e('0x20')]===0x1f4){logger[_0x985e('0x1f')](_0x985e('0x1a'),_0x11fa37,_0x3f5594[_0x985e('0x1f')]['message']);return _0x129b0e(_0x3f5594[_0x985e('0x1f')][_0x985e('0x21')]);}logger[_0x985e('0x1f')](_0x985e('0x1a'),_0x11fa37,_0x3f5594[_0x985e('0x1f')]['message']);return _0x16673a(_0x3f5594[_0x985e('0x1f')][_0x985e('0x21')]);}else{logger['info'](_0x985e('0x1a'),_0x11fa37,_0x985e('0x1b'));_0x16673a(_0x3f5594[_0x985e('0x22')][_0x985e('0x21')]);}})['catch'](function(_0x316243){logger[_0x985e('0x1f')](_0x985e('0x1a'),_0x11fa37,_0x316243);_0x129b0e(_0x316243);});});}function respondWithStatusCode(_0x33def7,_0x3758e4){_0x3758e4=_0x3758e4||0xcc;return function(_0x1ee183){if(_0x1ee183){return _0x33def7[_0x985e('0x23')](_0x3758e4);}return _0x33def7['status'](_0x3758e4)[_0x985e('0x24')]();};}function respondWithResult(_0x75fb50,_0x684f13){_0x684f13=_0x684f13||0xc8;return function(_0x35ebea){if(_0x35ebea){return _0x75fb50[_0x985e('0x25')](_0x684f13)[_0x985e('0x26')](_0x35ebea);}};}function respondWithFilteredResult(_0x47cd1b,_0x2feece){return function(_0x115a2d){if(_0x115a2d){var _0x59f28c=_0x115a2d['count'],_0x6301e4=_0x2feece[_0x985e('0x27')],_0xc4b830=_0x2feece[_0x985e('0x27')]+_0x2feece['limit'],_0x2c6a8f;if(_0xc4b830>=_0x59f28c){_0xc4b830=_0x59f28c;_0x2c6a8f=0xc8;}else{_0x2c6a8f=0xce;}_0x47cd1b[_0x985e('0x25')](_0x2c6a8f);return _0x47cd1b[_0x985e('0x28')]('Content-Range',_0x6301e4+'-'+_0xc4b830+'/'+_0x59f28c)['json'](_0x115a2d);}return null;};}function patchUpdates(_0xa7f32c){return function(_0x344c9a){try{jsonpatch[_0x985e('0x29')](_0x344c9a,_0xa7f32c,!![]);}catch(_0x2c4346){return BPromise['reject'](_0x2c4346);}return _0x344c9a['save']();};}function saveUpdates(_0x252e62,_0x3b9070){return function(_0x1fdce9){if(_0x1fdce9){return _0x1fdce9[_0x985e('0x2a')](_0x252e62)[_0x985e('0x19')](function(_0xef837b){return _0xef837b;});}return null;};}function removeEntity(_0x360e77,_0x38367c){return function(_0x9ea4d6){if(_0x9ea4d6){return _0x9ea4d6[_0x985e('0x2b')]()[_0x985e('0x19')](function(){_0x360e77['status'](0xcc)[_0x985e('0x24')]();});}};}function handleEntityNotFound(_0x9af664,_0xb2a16d){return function(_0x1e3cbe){if(!_0x1e3cbe){_0x9af664['sendStatus'](0x194);}return _0x1e3cbe;};}function handleError(_0x4f7635,_0x13545a){_0x13545a=_0x13545a||0x1f4;return function(_0x25b162){logger[_0x985e('0x1f')](_0x25b162['stack']);if(_0x25b162['name']){delete _0x25b162['name'];}_0x4f7635[_0x985e('0x25')](_0x13545a)['send'](_0x25b162);};}exports[_0x985e('0x2c')]=function(_0x169842,_0x1ed45b){var _0xdcf7e7={},_0x581b96={},_0x52b1c8={'count':0x0,'rows':[]};var _0x57f27d=db[_0x985e('0x2d')]['rawAttributes'];_0x581b96[_0x985e('0x2e')]=_[_0x985e('0x2f')](_0x57f27d);_0x581b96[_0x985e('0x30')]=_[_0x985e('0x2f')](_0x169842[_0x985e('0x30')]);_0x581b96[_0x985e('0x31')]=_[_0x985e('0x32')](_0x581b96[_0x985e('0x2e')],_0x581b96[_0x985e('0x30')]);_0xdcf7e7[_0x985e('0x33')]=_[_0x985e('0x32')](_0x581b96[_0x985e('0x2e')],qs[_0x985e('0x34')](_0x169842[_0x985e('0x30')][_0x985e('0x34')]));_0xdcf7e7[_0x985e('0x33')]=_0xdcf7e7[_0x985e('0x33')][_0x985e('0x35')]?_0xdcf7e7[_0x985e('0x33')]:_0x581b96[_0x985e('0x2e')];if(!_0x169842[_0x985e('0x30')][_0x985e('0x36')](_0x985e('0x37'))){_0xdcf7e7[_0x985e('0x38')]=qs[_0x985e('0x38')](_0x169842['query']['limit']);_0xdcf7e7[_0x985e('0x27')]=qs[_0x985e('0x27')](_0x169842[_0x985e('0x30')][_0x985e('0x27')]);}_0xdcf7e7['order']=qs[_0x985e('0x39')](_0x169842[_0x985e('0x30')][_0x985e('0x39')]);_0xdcf7e7[_0x985e('0x3a')]=qs[_0x985e('0x31')](_[_0x985e('0x3b')](_0x169842[_0x985e('0x30')],_0x581b96[_0x985e('0x31')]));if(_0x169842['query'][_0x985e('0x3c')]){_0xdcf7e7['where']=_[_0x985e('0x3d')](_0xdcf7e7['where'],{'$or':_['map'](_0x57f27d,function(_0x10335c){if(_0x10335c[_0x985e('0x3e')][_0x985e('0x3f')]!==_0x985e('0x40')){var _0x141b98={};_0x141b98[_0x10335c[_0x985e('0x41')]]={'$like':'%'+_0x169842['query'][_0x985e('0x3c')]+'%'};return _0x141b98;}})});}_0xdcf7e7=_[_0x985e('0x3d')]({},_0xdcf7e7,_0x169842[_0x985e('0x42')]);var _0x48e077={'where':_0xdcf7e7[_0x985e('0x3a')]};return db[_0x985e('0x2d')]['count'](_0x48e077)[_0x985e('0x19')](function(_0x422d4f){_0x52b1c8[_0x985e('0x43')]=_0x422d4f;if(_0x169842[_0x985e('0x30')][_0x985e('0x44')]){_0xdcf7e7[_0x985e('0x45')]=[{'all':!![]}];}return db[_0x985e('0x2d')][_0x985e('0x46')](_0xdcf7e7);})['then'](function(_0x34d9f1){_0x52b1c8[_0x985e('0x47')]=_0x34d9f1;return _0x52b1c8;})[_0x985e('0x19')](respondWithFilteredResult(_0x1ed45b,_0xdcf7e7))[_0x985e('0x48')](handleError(_0x1ed45b,null));};exports['show']=function(_0x55e270,_0x293c8d){var _0x44eac6={'raw':![],'where':{'id':_0x55e270[_0x985e('0x49')]['id']}},_0x3c9179={};_0x3c9179[_0x985e('0x2e')]=_['keys'](db['ZohoConfiguration']['rawAttributes']);_0x3c9179[_0x985e('0x30')]=_[_0x985e('0x2f')](_0x55e270['query']);_0x3c9179[_0x985e('0x31')]=_[_0x985e('0x32')](_0x3c9179[_0x985e('0x2e')],_0x3c9179[_0x985e('0x30')]);_0x44eac6[_0x985e('0x33')]=_[_0x985e('0x32')](_0x3c9179[_0x985e('0x2e')],qs['fields'](_0x55e270['query'][_0x985e('0x34')]));_0x44eac6[_0x985e('0x33')]=_0x44eac6['attributes']['length']?_0x44eac6['attributes']:_0x3c9179['model'];if(_0x55e270[_0x985e('0x30')]['includeAll']){_0x44eac6[_0x985e('0x45')]=[{'all':!![]}];}_0x44eac6=_[_0x985e('0x3d')]({},_0x44eac6,_0x55e270[_0x985e('0x42')]);return db[_0x985e('0x2d')]['find'](_0x44eac6)[_0x985e('0x19')](handleEntityNotFound(_0x293c8d,null))[_0x985e('0x19')](respondWithResult(_0x293c8d,null))['catch'](handleError(_0x293c8d,null));};exports[_0x985e('0x4a')]=function(_0x739938,_0x28fd85){return db[_0x985e('0x2d')][_0x985e('0x4a')](_0x739938[_0x985e('0x4b')],{})[_0x985e('0x19')](respondWithResult(_0x28fd85,0xc9))[_0x985e('0x48')](handleError(_0x28fd85,null));};exports[_0x985e('0x2a')]=function(_0x40b114,_0x39d436){if(_0x40b114[_0x985e('0x4b')]['id']){delete _0x40b114[_0x985e('0x4b')]['id'];}return db[_0x985e('0x2d')][_0x985e('0x4c')]({'where':{'id':_0x40b114[_0x985e('0x49')]['id']}})[_0x985e('0x19')](handleEntityNotFound(_0x39d436,null))['then'](saveUpdates(_0x40b114[_0x985e('0x4b')],null))[_0x985e('0x19')](respondWithResult(_0x39d436,null))[_0x985e('0x48')](handleError(_0x39d436,null));};exports['destroy']=function(_0x2284b1,_0x2386ff){return db[_0x985e('0x2d')][_0x985e('0x4c')]({'where':{'id':_0x2284b1[_0x985e('0x49')]['id']}})[_0x985e('0x19')](handleEntityNotFound(_0x2386ff,null))[_0x985e('0x19')](removeEntity(_0x2386ff,null))[_0x985e('0x48')](handleError(_0x2386ff,null));};exports[_0x985e('0x4d')]=function(_0xdcb27f,_0x3f034c,_0x3e8332){var _0x148d86={};var _0x4f27c6={};var _0x3a8114;var _0x20fc09;return db['ZohoConfiguration'][_0x985e('0x4e')]({'where':{'id':_0xdcb27f[_0x985e('0x49')]['id']}})[_0x985e('0x19')](handleEntityNotFound(_0x3f034c,null))[_0x985e('0x19')](function(_0x1f8fb0){if(_0x1f8fb0){_0x3a8114=_0x1f8fb0;_0x4f27c6[_0x985e('0x2e')]=_[_0x985e('0x2f')](db[_0x985e('0x4f')][_0x985e('0x50')]);_0x4f27c6[_0x985e('0x30')]=_[_0x985e('0x2f')](_0xdcb27f['query']);_0x4f27c6[_0x985e('0x31')]=_['intersection'](_0x4f27c6[_0x985e('0x2e')],_0x4f27c6[_0x985e('0x30')]);_0x148d86[_0x985e('0x33')]=_[_0x985e('0x32')](_0x4f27c6[_0x985e('0x2e')],qs['fields'](_0xdcb27f['query']['fields']));_0x148d86['attributes']=_0x148d86['attributes'][_0x985e('0x35')]?_0x148d86[_0x985e('0x33')]:_0x4f27c6[_0x985e('0x2e')];_0x148d86[_0x985e('0x51')]=qs[_0x985e('0x39')](_0xdcb27f[_0x985e('0x30')][_0x985e('0x39')]);_0x148d86[_0x985e('0x3a')]=qs[_0x985e('0x31')](_[_0x985e('0x3b')](_0xdcb27f[_0x985e('0x30')],_0x4f27c6[_0x985e('0x31')]));if(_0xdcb27f[_0x985e('0x30')][_0x985e('0x3c')]){_0x148d86[_0x985e('0x3a')]=_['merge'](_0x148d86[_0x985e('0x3a')],{'$or':_[_0x985e('0x52')](_0x148d86[_0x985e('0x33')],function(_0x5ea74e){var _0x8dce5a={};_0x8dce5a[_0x5ea74e]={'$like':'%'+_0xdcb27f['query'][_0x985e('0x3c')]+'%'};return _0x8dce5a;})});}_0x148d86=_[_0x985e('0x3d')]({},_0x148d86,_0xdcb27f[_0x985e('0x42')]);return _0x3a8114[_0x985e('0x4d')](_0x148d86);}})[_0x985e('0x19')](function(_0x3fc062){if(_0x3fc062){_0x20fc09=_0x3fc062['length'];if(!_0xdcb27f[_0x985e('0x30')][_0x985e('0x36')]('nolimit')){_0x148d86[_0x985e('0x38')]=qs['limit'](_0xdcb27f['query'][_0x985e('0x38')]);_0x148d86[_0x985e('0x27')]=qs[_0x985e('0x27')](_0xdcb27f[_0x985e('0x30')][_0x985e('0x27')]);}return _0x3a8114[_0x985e('0x4d')](_0x148d86);}})[_0x985e('0x19')](function(_0xd6b0a3){if(_0xd6b0a3){return _0xd6b0a3?{'count':_0x20fc09,'rows':_0xd6b0a3}:null;}})[_0x985e('0x19')](respondWithResult(_0x3f034c,null))[_0x985e('0x48')](handleError(_0x3f034c,null));};exports[_0x985e('0x53')]=function(_0x6c285a,_0x6ad4d4,_0x5666f0){var _0x5176e3={};var _0x14e21f={};var _0x199fe6;var _0x1df68f;return db['ZohoConfiguration'][_0x985e('0x4e')]({'where':{'id':_0x6c285a[_0x985e('0x49')]['id']}})[_0x985e('0x19')](handleEntityNotFound(_0x6ad4d4,null))[_0x985e('0x19')](function(_0x4cfb81){if(_0x4cfb81){_0x199fe6=_0x4cfb81;_0x14e21f[_0x985e('0x2e')]=_[_0x985e('0x2f')](db[_0x985e('0x4f')]['rawAttributes']);_0x14e21f[_0x985e('0x30')]=_[_0x985e('0x2f')](_0x6c285a[_0x985e('0x30')]);_0x14e21f[_0x985e('0x31')]=_[_0x985e('0x32')](_0x14e21f[_0x985e('0x2e')],_0x14e21f['query']);_0x5176e3['attributes']=_['intersection'](_0x14e21f[_0x985e('0x2e')],qs['fields'](_0x6c285a[_0x985e('0x30')][_0x985e('0x34')]));_0x5176e3[_0x985e('0x33')]=_0x5176e3[_0x985e('0x33')]['length']?_0x5176e3[_0x985e('0x33')]:_0x14e21f[_0x985e('0x2e')];_0x5176e3[_0x985e('0x51')]=qs[_0x985e('0x39')](_0x6c285a[_0x985e('0x30')]['sort']);_0x5176e3[_0x985e('0x3a')]=qs[_0x985e('0x31')](_[_0x985e('0x3b')](_0x6c285a['query'],_0x14e21f[_0x985e('0x31')]));if(_0x6c285a[_0x985e('0x30')][_0x985e('0x3c')]){_0x5176e3[_0x985e('0x3a')]=_['merge'](_0x5176e3[_0x985e('0x3a')],{'$or':_[_0x985e('0x52')](_0x5176e3[_0x985e('0x33')],function(_0x5afa74){var _0x2337bf={};_0x2337bf[_0x5afa74]={'$like':'%'+_0x6c285a[_0x985e('0x30')][_0x985e('0x3c')]+'%'};return _0x2337bf;})});}_0x5176e3=_[_0x985e('0x3d')]({},_0x5176e3,_0x6c285a[_0x985e('0x42')]);return _0x199fe6[_0x985e('0x53')](_0x5176e3);}})['then'](function(_0xa4ce0a){if(_0xa4ce0a){_0x1df68f=_0xa4ce0a[_0x985e('0x35')];if(!_0x6c285a['query'][_0x985e('0x36')](_0x985e('0x37'))){_0x5176e3[_0x985e('0x38')]=qs[_0x985e('0x38')](_0x6c285a[_0x985e('0x30')][_0x985e('0x38')]);_0x5176e3['offset']=qs[_0x985e('0x27')](_0x6c285a[_0x985e('0x30')]['offset']);}return _0x199fe6[_0x985e('0x53')](_0x5176e3);}})[_0x985e('0x19')](function(_0x4b7554){if(_0x4b7554){return _0x4b7554?{'count':_0x1df68f,'rows':_0x4b7554}:null;}})[_0x985e('0x19')](respondWithResult(_0x6ad4d4,null))[_0x985e('0x48')](handleError(_0x6ad4d4,null));};exports[_0x985e('0x54')]=function(_0x69ade5,_0x2cdf18,_0xd20c4a){var _0x45dc1c={};var _0x1c0762={};var _0x10d165;var _0x489d79;return db['ZohoConfiguration'][_0x985e('0x4e')]({'where':{'id':_0x69ade5['params']['id']}})['then'](handleEntityNotFound(_0x2cdf18,null))[_0x985e('0x19')](function(_0xfdac78){if(_0xfdac78){_0x10d165=_0xfdac78;_0x1c0762['model']=_[_0x985e('0x2f')](db[_0x985e('0x4f')][_0x985e('0x50')]);_0x1c0762[_0x985e('0x30')]=_[_0x985e('0x2f')](_0x69ade5[_0x985e('0x30')]);_0x1c0762[_0x985e('0x31')]=_[_0x985e('0x32')](_0x1c0762[_0x985e('0x2e')],_0x1c0762[_0x985e('0x30')]);_0x45dc1c[_0x985e('0x33')]=_[_0x985e('0x32')](_0x1c0762[_0x985e('0x2e')],qs[_0x985e('0x34')](_0x69ade5['query'][_0x985e('0x34')]));_0x45dc1c[_0x985e('0x33')]=_0x45dc1c[_0x985e('0x33')]['length']?_0x45dc1c[_0x985e('0x33')]:_0x1c0762[_0x985e('0x2e')];_0x45dc1c['order']=qs['sort'](_0x69ade5[_0x985e('0x30')][_0x985e('0x39')]);_0x45dc1c[_0x985e('0x3a')]=qs[_0x985e('0x31')](_[_0x985e('0x3b')](_0x69ade5[_0x985e('0x30')],_0x1c0762[_0x985e('0x31')]));if(_0x69ade5[_0x985e('0x30')][_0x985e('0x3c')]){_0x45dc1c['where']=_['merge'](_0x45dc1c[_0x985e('0x3a')],{'$or':_[_0x985e('0x52')](_0x45dc1c[_0x985e('0x33')],function(_0x1251d9){var _0x30527e={};_0x30527e[_0x1251d9]={'$like':'%'+_0x69ade5[_0x985e('0x30')][_0x985e('0x3c')]+'%'};return _0x30527e;})});}_0x45dc1c=_[_0x985e('0x3d')]({},_0x45dc1c,_0x69ade5[_0x985e('0x42')]);return _0x10d165[_0x985e('0x54')](_0x45dc1c);}})[_0x985e('0x19')](function(_0x90aabd){if(_0x90aabd){_0x489d79=_0x90aabd[_0x985e('0x35')];if(!_0x69ade5['query'][_0x985e('0x36')](_0x985e('0x37'))){_0x45dc1c[_0x985e('0x38')]=qs[_0x985e('0x38')](_0x69ade5[_0x985e('0x30')][_0x985e('0x38')]);_0x45dc1c[_0x985e('0x27')]=qs[_0x985e('0x27')](_0x69ade5[_0x985e('0x30')][_0x985e('0x27')]);}return _0x10d165[_0x985e('0x54')](_0x45dc1c);}})[_0x985e('0x19')](function(_0x18ccea){if(_0x18ccea){return _0x18ccea?{'count':_0x489d79,'rows':_0x18ccea}:null;}})['then'](respondWithResult(_0x2cdf18,null))['catch'](handleError(_0x2cdf18,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index efb4857..c7689f1 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.model.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c7c=['../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1e8f9e,_0x148061){var _0x2cec83=function(_0x55d9ee){while(--_0x55d9ee){_0x1e8f9e['push'](_0x1e8f9e['shift']());}};_0x2cec83(++_0x148061);}(_0x0c7c,0x1e5));var _0xc0c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0c7c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc0c7('0x0'));var util=require('util');var logger=require(_0xc0c7('0x1'))(_0xc0c7('0x2'));var moment=require(_0xc0c7('0x3'));var BPromise=require(_0xc0c7('0x4'));var rp=require(_0xc0c7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0c7('0x6'));var config=require(_0xc0c7('0x7'));var attributes=require(_0xc0c7('0x8'));module[_0xc0c7('0x9')]=function(_0x10ebe7,_0x2ce9b1){return _0x10ebe7['define'](_0xc0c7('0xa'),attributes,{'tableName':_0xc0c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf557=['./intZohoConfiguration.attributes','define','int_zoho_configurations','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x31456b,_0x1609a8){var _0xcc072b=function(_0x59a056){while(--_0x59a056){_0x31456b['push'](_0x31456b['shift']());}};_0xcc072b(++_0x1609a8);}(_0xf557,0x1dc));var _0x7f55=function(_0x31fbeb,_0x51eb69){_0x31fbeb=_0x31fbeb-0x0;var _0x1845a8=_0xf557[_0x31fbeb];return _0x1845a8;};'use strict';var _=require(_0x7f55('0x0'));var util=require(_0x7f55('0x1'));var logger=require(_0x7f55('0x2'))(_0x7f55('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7f55('0x4'));var fs=require('fs');var path=require(_0x7f55('0x5'));var rimraf=require(_0x7f55('0x6'));var config=require(_0x7f55('0x7'));var attributes=require(_0x7f55('0x8'));module['exports']=function(_0x2c18f2,_0x5827da){return _0x2c18f2[_0x7f55('0x9')]('ZohoConfiguration',attributes,{'tableName':_0x7f55('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index fa0dd85..e41ab24 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb1e=['rpc','../../config/environment','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xe8e008,_0x12b95c){var _0x5a9083=function(_0x303067){while(--_0x303067){_0xe8e008['push'](_0xe8e008['shift']());}};_0x5a9083(++_0x12b95c);}(_0xeb1e,0x159));var _0xeeb1=function(_0x470cde,_0x4b547d){_0x470cde=_0x470cde-0x0;var _0x57a279=_0xeb1e[_0x470cde];return _0x57a279;};'use strict';var _=require(_0xeeb1('0x0'));var util=require(_0xeeb1('0x1'));var moment=require(_0xeeb1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeeb1('0x3'));var db=require(_0xeeb1('0x4'))['db'];var utils=require(_0xeeb1('0x5'));var logger=require(_0xeeb1('0x6'))(_0xeeb1('0x7'));var config=require(_0xeeb1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xeeb1('0x9')][_0xeeb1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45bd0c,_0x93fe96,_0x42e91e){return new BPromise(function(_0x486f42,_0x368197){return client[_0xeeb1('0xb')](_0x45bd0c,_0x42e91e)['then'](function(_0x2858a8){logger[_0xeeb1('0xc')](_0xeeb1('0xd'),_0x93fe96,_0xeeb1('0xe'));logger[_0xeeb1('0xf')](_0xeeb1('0x10'),_0x93fe96,_0xeeb1('0xe'),JSON[_0xeeb1('0x11')](_0x2858a8));if(_0x2858a8[_0xeeb1('0x12')]){if(_0x2858a8[_0xeeb1('0x12')][_0xeeb1('0x13')]===0x1f4){logger[_0xeeb1('0x12')](_0xeeb1('0xd'),_0x93fe96,_0x2858a8[_0xeeb1('0x12')][_0xeeb1('0x14')]);return _0x368197(_0x2858a8['error'][_0xeeb1('0x14')]);}logger['error'](_0xeeb1('0xd'),_0x93fe96,_0x2858a8[_0xeeb1('0x12')][_0xeeb1('0x14')]);return _0x486f42(_0x2858a8[_0xeeb1('0x12')][_0xeeb1('0x14')]);}else{logger[_0xeeb1('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x93fe96,'request\x20sent');_0x486f42(_0x2858a8[_0xeeb1('0x15')][_0xeeb1('0x14')]);}})['catch'](function(_0x5cf603){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x93fe96,_0x5cf603);_0x368197(_0x5cf603);});});} \ No newline at end of file +var _0xae9d=['../../mysqldb','../../config/utils','jayson/promise','request','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','ioredis'];(function(_0x3c4062,_0x3767fc){var _0x3f5bf3=function(_0x105e55){while(--_0x105e55){_0x3c4062['push'](_0x3c4062['shift']());}};_0x3f5bf3(++_0x3767fc);}(_0xae9d,0x9e));var _0xdae9=function(_0x48fb10,_0xa50a89){_0x48fb10=_0x48fb10-0x0;var _0x534251=_0xae9d[_0x48fb10];return _0x534251;};'use strict';var _=require(_0xdae9('0x0'));var util=require(_0xdae9('0x1'));var moment=require('moment');var BPromise=require(_0xdae9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdae9('0x3'));var db=require(_0xdae9('0x4'))['db'];var utils=require(_0xdae9('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdae9('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x414140,_0x26b8e3,_0x2d5e07){return new BPromise(function(_0x4b2380,_0x57629d){return client[_0xdae9('0x7')](_0x414140,_0x2d5e07)['then'](function(_0x5e6a90){logger[_0xdae9('0x8')]('ZohoConfiguration,\x20%s,\x20%s',_0x26b8e3,_0xdae9('0x9'));logger[_0xdae9('0xa')](_0xdae9('0xb'),_0x26b8e3,_0xdae9('0x9'),JSON[_0xdae9('0xc')](_0x5e6a90));if(_0x5e6a90['error']){if(_0x5e6a90[_0xdae9('0xd')][_0xdae9('0xe')]===0x1f4){logger[_0xdae9('0xd')](_0xdae9('0xf'),_0x26b8e3,_0x5e6a90[_0xdae9('0xd')][_0xdae9('0x10')]);return _0x57629d(_0x5e6a90[_0xdae9('0xd')][_0xdae9('0x10')]);}logger[_0xdae9('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x26b8e3,_0x5e6a90[_0xdae9('0xd')]['message']);return _0x4b2380(_0x5e6a90[_0xdae9('0xd')][_0xdae9('0x10')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x26b8e3,_0xdae9('0x9'));_0x4b2380(_0x5e6a90['result'][_0xdae9('0x10')]);}})[_0xdae9('0x11')](function(_0x3e392e){logger['error'](_0xdae9('0xf'),_0x26b8e3,_0x3e392e);_0x57629d(_0x3e392e);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index db71caf..d7c948c 100644 --- a/server/api/intZohoField/index.js +++ b/server/api/intZohoField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4888=['../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x56dd50,_0x3ae844){var _0x2aeed5=function(_0x401365){while(--_0x401365){_0x56dd50['push'](_0x56dd50['shift']());}};_0x2aeed5(++_0x3ae844);}(_0x4888,0x198));var _0x8488=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0x4888[_0x2136d5];return _0x3bee2e;};'use strict';var multer=require('multer');var util=require(_0x8488('0x0'));var path=require(_0x8488('0x1'));var timeout=require(_0x8488('0x2'));var express=require(_0x8488('0x3'));var router=express[_0x8488('0x4')]();var auth=require(_0x8488('0x5'));var interaction=require(_0x8488('0x6'));var config=require('../../config/environment');var controller=require(_0x8488('0x7'));router[_0x8488('0x8')]('/',auth[_0x8488('0x9')](),controller[_0x8488('0xa')]);router[_0x8488('0x8')](_0x8488('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x8488('0xc')]);router[_0x8488('0xd')]('/:id',auth[_0x8488('0x9')](),controller[_0x8488('0xe')]);router[_0x8488('0xf')](_0x8488('0xb'),auth['isAuthenticated'](),controller[_0x8488('0x10')]);module[_0x8488('0x11')]=router; \ No newline at end of file +var _0x7880=['Router','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x57d740,_0x50be99){var _0x6607ef=function(_0x908bd0){while(--_0x908bd0){_0x57d740['push'](_0x57d740['shift']());}};_0x6607ef(++_0x50be99);}(_0x7880,0x1f4));var _0x0788=function(_0x2a2766,_0x475265){_0x2a2766=_0x2a2766-0x0;var _0x30a56c=_0x7880[_0x2a2766];return _0x30a56c;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var auth=require(_0x0788('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0788('0x6'));var controller=require(_0x0788('0x7'));router[_0x0788('0x8')]('/',auth[_0x0788('0x9')](),controller[_0x0788('0xa')]);router[_0x0788('0x8')](_0x0788('0xb'),auth[_0x0788('0x9')](),controller[_0x0788('0xc')]);router[_0x0788('0xd')]('/',auth['isAuthenticated'](),controller[_0x0788('0xe')]);router['put'](_0x0788('0xb'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router[_0x0788('0x10')](_0x0788('0xb'),auth[_0x0788('0x9')](),controller[_0x0788('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 2761a50..33c0d12 100644 --- a/server/api/intZohoField/intZohoField.attributes.js +++ b/server/api/intZohoField/intZohoField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf62=['customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x295a3d,_0x56d487){var _0x23a732=function(_0x15cfc2){while(--_0x15cfc2){_0x295a3d['push'](_0x295a3d['shift']());}};_0x23a732(++_0x56d487);}(_0xcf62,0x71));var _0x2cf6=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xcf62[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require(_0x2cf6('0x0'));module[_0x2cf6('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2cf6('0x2'),_0x2cf6('0x3'),_0x2cf6('0x4'),_0x2cf6('0x5')),'defaultValue':_0x2cf6('0x2')},'content':{'type':Sequelize[_0x2cf6('0x6')]},'key':{'type':Sequelize[_0x2cf6('0x6')]},'keyType':{'type':Sequelize[_0x2cf6('0x7')]('string',_0x2cf6('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x2cf6('0x6')]},'idField':{'type':Sequelize[_0x2cf6('0x6')]},'nameField':{'type':Sequelize[_0x2cf6('0x6')]},'customField':{'type':Sequelize[_0x2cf6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3a32=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x76c355,_0x25fe90){var _0x1c1885=function(_0x26eb50){while(--_0x26eb50){_0x76c355['push'](_0x76c355['shift']());}};_0x1c1885(++_0x25fe90);}(_0x3a32,0x9b));var _0x23a3=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x3a32[_0x363ef8];return _0x148822;};'use strict';var Sequelize=require(_0x23a3('0x0'));module[_0x23a3('0x1')]={'type':{'type':Sequelize[_0x23a3('0x2')](_0x23a3('0x3'),_0x23a3('0x4'),_0x23a3('0x5'),_0x23a3('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x23a3('0x7')]},'keyType':{'type':Sequelize[_0x23a3('0x2')]('string',_0x23a3('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x23a3('0x7')]},'idField':{'type':Sequelize[_0x23a3('0x7')]},'nameField':{'type':Sequelize[_0x23a3('0x7')]},'customField':{'type':Sequelize[_0x23a3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x23a3('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 2cbfdf2..bb08162 100644 --- a/server/api/intZohoField/intZohoField.controller.js +++ b/server/api/intZohoField/intZohoField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc756=['field','options','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','ZohoField','rawAttributes','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL'];(function(_0x4453c5,_0x38c544){var _0xb3d57f=function(_0x444d54){while(--_0x444d54){_0x4453c5['push'](_0x4453c5['shift']());}};_0xb3d57f(++_0x38c544);}(_0xc756,0x9d));var _0x6c75=function(_0x30b0d5,_0x1b85fc){_0x30b0d5=_0x30b0d5-0x0;var _0x38ccbd=_0xc756[_0x30b0d5];return _0x38ccbd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6c75('0x0'));var rimraf=require(_0x6c75('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c75('0x2'));var rp=require(_0x6c75('0x3'));var moment=require(_0x6c75('0x4'));var BPromise=require(_0x6c75('0x5'));var Mustache=require(_0x6c75('0x6'));var util=require(_0x6c75('0x7'));var path=require(_0x6c75('0x8'));var sox=require(_0x6c75('0x9'));var csv=require('to-csv');var ejs=require(_0x6c75('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6c75('0xb'));var crypto=require('crypto');var jsforce=require(_0x6c75('0xc'));var deskjs=require(_0x6c75('0xd'));var toCsv=require(_0x6c75('0xe'));var querystring=require(_0x6c75('0xf'));var Papa=require(_0x6c75('0x10'));var Redis=require('ioredis');var authService=require(_0x6c75('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6c75('0x12'));var logger=require(_0x6c75('0x13'))(_0x6c75('0x14'));var utils=require(_0x6c75('0x15'));var config=require('../../config/environment');var db=require(_0x6c75('0x16'))['db'];function respondWithStatusCode(_0x5186c8,_0x1480b0){_0x1480b0=_0x1480b0||0xcc;return function(_0x2903b1){if(_0x2903b1){return _0x5186c8[_0x6c75('0x17')](_0x1480b0);}return _0x5186c8[_0x6c75('0x18')](_0x1480b0)[_0x6c75('0x19')]();};}function respondWithResult(_0x429ccb,_0x484f34){_0x484f34=_0x484f34||0xc8;return function(_0x35de0f){if(_0x35de0f){return _0x429ccb['status'](_0x484f34)[_0x6c75('0x1a')](_0x35de0f);}};}function respondWithFilteredResult(_0x4345d5,_0x4b7b0b){return function(_0x3fcd29){if(_0x3fcd29){var _0xfca11a=_0x3fcd29[_0x6c75('0x1b')],_0x40e735=_0x4b7b0b['offset'],_0x3d4965=_0x4b7b0b['offset']+_0x4b7b0b[_0x6c75('0x1c')],_0x4cd181;if(_0x3d4965>=_0xfca11a){_0x3d4965=_0xfca11a;_0x4cd181=0xc8;}else{_0x4cd181=0xce;}_0x4345d5[_0x6c75('0x18')](_0x4cd181);return _0x4345d5[_0x6c75('0x1d')](_0x6c75('0x1e'),_0x40e735+'-'+_0x3d4965+'/'+_0xfca11a)['json'](_0x3fcd29);}return null;};}function patchUpdates(_0x47495c){return function(_0xf085be){try{jsonpatch[_0x6c75('0x1f')](_0xf085be,_0x47495c,!![]);}catch(_0x23f9bf){return BPromise[_0x6c75('0x20')](_0x23f9bf);}return _0xf085be[_0x6c75('0x21')]();};}function saveUpdates(_0x26ef5f,_0x52500d){return function(_0x557bd2){if(_0x557bd2){return _0x557bd2['update'](_0x26ef5f)[_0x6c75('0x22')](function(_0x52e7d7){return _0x52e7d7;});}return null;};}function removeEntity(_0x2d4c5d,_0x5ca1be){return function(_0x8b6fd6){if(_0x8b6fd6){return _0x8b6fd6[_0x6c75('0x23')]()['then'](function(){_0x2d4c5d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xea6f96,_0x495e9a){return function(_0x43efe4){if(!_0x43efe4){_0xea6f96[_0x6c75('0x17')](0x194);}return _0x43efe4;};}function handleError(_0x52ecbb,_0x1d01ab){_0x1d01ab=_0x1d01ab||0x1f4;return function(_0x2e8cfc){logger[_0x6c75('0x24')](_0x2e8cfc['stack']);if(_0x2e8cfc[_0x6c75('0x25')]){delete _0x2e8cfc[_0x6c75('0x25')];}_0x52ecbb['status'](_0x1d01ab)[_0x6c75('0x26')](_0x2e8cfc);};}exports[_0x6c75('0x27')]=function(_0x5499df,_0x4e789f){var _0x287db7={},_0x4dcf99={},_0xe20370={'count':0x0,'rows':[]};var _0x525062=db[_0x6c75('0x28')][_0x6c75('0x29')];_0x4dcf99['model']=_[_0x6c75('0x2a')](_0x525062);_0x4dcf99[_0x6c75('0x2b')]=_[_0x6c75('0x2a')](_0x5499df['query']);_0x4dcf99['filters']=_['intersection'](_0x4dcf99[_0x6c75('0x2c')],_0x4dcf99[_0x6c75('0x2b')]);_0x287db7[_0x6c75('0x2d')]=_[_0x6c75('0x2e')](_0x4dcf99['model'],qs[_0x6c75('0x2f')](_0x5499df[_0x6c75('0x2b')][_0x6c75('0x2f')]));_0x287db7[_0x6c75('0x2d')]=_0x287db7[_0x6c75('0x2d')][_0x6c75('0x30')]?_0x287db7['attributes']:_0x4dcf99[_0x6c75('0x2c')];if(!_0x5499df[_0x6c75('0x2b')][_0x6c75('0x31')](_0x6c75('0x32'))){_0x287db7['limit']=qs[_0x6c75('0x1c')](_0x5499df[_0x6c75('0x2b')]['limit']);_0x287db7[_0x6c75('0x33')]=qs['offset'](_0x5499df[_0x6c75('0x2b')][_0x6c75('0x33')]);}_0x287db7[_0x6c75('0x34')]=qs[_0x6c75('0x35')](_0x5499df[_0x6c75('0x2b')][_0x6c75('0x35')]);_0x287db7[_0x6c75('0x36')]=qs[_0x6c75('0x37')](_[_0x6c75('0x38')](_0x5499df['query'],_0x4dcf99['filters']));if(_0x5499df['query'][_0x6c75('0x39')]){_0x287db7[_0x6c75('0x36')]=_[_0x6c75('0x3a')](_0x287db7[_0x6c75('0x36')],{'$or':_[_0x6c75('0x3b')](_0x525062,function(_0x4bbd22){if(_0x4bbd22['type'][_0x6c75('0x3c')]!==_0x6c75('0x3d')){var _0x22ffc6={};_0x22ffc6[_0x4bbd22[_0x6c75('0x3e')]]={'$like':'%'+_0x5499df[_0x6c75('0x2b')]['filter']+'%'};return _0x22ffc6;}})});}_0x287db7=_[_0x6c75('0x3a')]({},_0x287db7,_0x5499df[_0x6c75('0x3f')]);var _0x5b8a08={'where':_0x287db7[_0x6c75('0x36')]};return db[_0x6c75('0x28')][_0x6c75('0x1b')](_0x5b8a08)[_0x6c75('0x22')](function(_0x509b91){_0xe20370[_0x6c75('0x1b')]=_0x509b91;if(_0x5499df[_0x6c75('0x2b')]['includeAll']){_0x287db7[_0x6c75('0x40')]=[{'all':!![]}];}return db[_0x6c75('0x28')][_0x6c75('0x41')](_0x287db7);})['then'](function(_0x1a4552){_0xe20370[_0x6c75('0x42')]=_0x1a4552;return _0xe20370;})[_0x6c75('0x22')](respondWithFilteredResult(_0x4e789f,_0x287db7))[_0x6c75('0x43')](handleError(_0x4e789f,null));};exports[_0x6c75('0x44')]=function(_0x303a78,_0x42b3b8){var _0x12346d={'raw':!![],'where':{'id':_0x303a78[_0x6c75('0x45')]['id']}},_0x594193={};_0x594193[_0x6c75('0x2c')]=_[_0x6c75('0x2a')](db[_0x6c75('0x28')][_0x6c75('0x29')]);_0x594193[_0x6c75('0x2b')]=_[_0x6c75('0x2a')](_0x303a78['query']);_0x594193[_0x6c75('0x37')]=_[_0x6c75('0x2e')](_0x594193['model'],_0x594193['query']);_0x12346d[_0x6c75('0x2d')]=_[_0x6c75('0x2e')](_0x594193[_0x6c75('0x2c')],qs[_0x6c75('0x2f')](_0x303a78['query']['fields']));_0x12346d['attributes']=_0x12346d['attributes'][_0x6c75('0x30')]?_0x12346d[_0x6c75('0x2d')]:_0x594193[_0x6c75('0x2c')];if(_0x303a78[_0x6c75('0x2b')]['includeAll']){_0x12346d['include']=[{'all':!![]}];}_0x12346d=_['merge']({},_0x12346d,_0x303a78[_0x6c75('0x3f')]);return db[_0x6c75('0x28')]['find'](_0x12346d)[_0x6c75('0x22')](handleEntityNotFound(_0x42b3b8,null))[_0x6c75('0x22')](respondWithResult(_0x42b3b8,null))['catch'](handleError(_0x42b3b8,null));};exports[_0x6c75('0x46')]=function(_0x1b8684,_0x4d7d52){return db['ZohoField'][_0x6c75('0x46')](_0x1b8684[_0x6c75('0x47')],{})['then'](respondWithResult(_0x4d7d52,0xc9))[_0x6c75('0x43')](handleError(_0x4d7d52,null));};exports['update']=function(_0x5fe263,_0x2f8063){if(_0x5fe263[_0x6c75('0x47')]['id']){delete _0x5fe263[_0x6c75('0x47')]['id'];}return db['ZohoField'][_0x6c75('0x48')]({'where':{'id':_0x5fe263['params']['id']}})['then'](handleEntityNotFound(_0x2f8063,null))[_0x6c75('0x22')](saveUpdates(_0x5fe263[_0x6c75('0x47')],null))[_0x6c75('0x22')](respondWithResult(_0x2f8063,null))[_0x6c75('0x43')](handleError(_0x2f8063,null));};exports[_0x6c75('0x23')]=function(_0x305d7e,_0x24986a){return db[_0x6c75('0x28')]['find']({'where':{'id':_0x305d7e['params']['id']}})['then'](handleEntityNotFound(_0x24986a,null))[_0x6c75('0x22')](removeEntity(_0x24986a,null))['catch'](handleError(_0x24986a,null));}; \ No newline at end of file +var _0x0d20=['query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','intersection','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','ZohoField','rawAttributes','keys'];(function(_0x4b3f04,_0x18ef21){var _0xb45f4a=function(_0x3b76a5){while(--_0x3b76a5){_0x4b3f04['push'](_0x4b3f04['shift']());}};_0xb45f4a(++_0x18ef21);}(_0x0d20,0xf5));var _0x00d2=function(_0x4a4288,_0x2bdff4){_0x4a4288=_0x4a4288-0x0;var _0x574a1a=_0x0d20[_0x4a4288];return _0x574a1a;};'use strict';var pdf=require(_0x00d2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x00d2('0x1'));var zipdir=require(_0x00d2('0x2'));var jsonpatch=require(_0x00d2('0x3'));var rp=require(_0x00d2('0x4'));var moment=require('moment');var BPromise=require(_0x00d2('0x5'));var Mustache=require('mustache');var util=require(_0x00d2('0x6'));var path=require(_0x00d2('0x7'));var sox=require(_0x00d2('0x8'));var csv=require(_0x00d2('0x9'));var ejs=require(_0x00d2('0xa'));var fs=require('fs');var _=require(_0x00d2('0xb'));var squel=require(_0x00d2('0xc'));var crypto=require(_0x00d2('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x00d2('0xe'));var Redis=require(_0x00d2('0xf'));var authService=require(_0x00d2('0x10'));var qs=require(_0x00d2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x00d2('0x12'))('api');var utils=require(_0x00d2('0x13'));var config=require(_0x00d2('0x14'));var db=require(_0x00d2('0x15'))['db'];function respondWithStatusCode(_0x13db6b,_0x1b734e){_0x1b734e=_0x1b734e||0xcc;return function(_0x1eb244){if(_0x1eb244){return _0x13db6b[_0x00d2('0x16')](_0x1b734e);}return _0x13db6b[_0x00d2('0x17')](_0x1b734e)['end']();};}function respondWithResult(_0x395a3d,_0x4f3688){_0x4f3688=_0x4f3688||0xc8;return function(_0x18a0bb){if(_0x18a0bb){return _0x395a3d[_0x00d2('0x17')](_0x4f3688)[_0x00d2('0x18')](_0x18a0bb);}};}function respondWithFilteredResult(_0x4464cd,_0x157b9b){return function(_0x7913e){if(_0x7913e){var _0x47b6dd=_0x7913e[_0x00d2('0x19')],_0x8c176d=_0x157b9b[_0x00d2('0x1a')],_0x316501=_0x157b9b['offset']+_0x157b9b[_0x00d2('0x1b')],_0x1da841;if(_0x316501>=_0x47b6dd){_0x316501=_0x47b6dd;_0x1da841=0xc8;}else{_0x1da841=0xce;}_0x4464cd['status'](_0x1da841);return _0x4464cd[_0x00d2('0x1c')](_0x00d2('0x1d'),_0x8c176d+'-'+_0x316501+'/'+_0x47b6dd)['json'](_0x7913e);}return null;};}function patchUpdates(_0x2d4654){return function(_0x45ec4f){try{jsonpatch['apply'](_0x45ec4f,_0x2d4654,!![]);}catch(_0x1df8a7){return BPromise[_0x00d2('0x1e')](_0x1df8a7);}return _0x45ec4f[_0x00d2('0x1f')]();};}function saveUpdates(_0xbf9f8d,_0x4b613e){return function(_0x360938){if(_0x360938){return _0x360938[_0x00d2('0x20')](_0xbf9f8d)[_0x00d2('0x21')](function(_0x251c61){return _0x251c61;});}return null;};}function removeEntity(_0xab25c7,_0x193412){return function(_0xecf451){if(_0xecf451){return _0xecf451[_0x00d2('0x22')]()['then'](function(){_0xab25c7['status'](0xcc)[_0x00d2('0x23')]();});}};}function handleEntityNotFound(_0xd2fb41,_0x3ee5b2){return function(_0x2b80c4){if(!_0x2b80c4){_0xd2fb41[_0x00d2('0x16')](0x194);}return _0x2b80c4;};}function handleError(_0x2b2685,_0x4e3072){_0x4e3072=_0x4e3072||0x1f4;return function(_0x502ed4){logger[_0x00d2('0x24')](_0x502ed4['stack']);if(_0x502ed4[_0x00d2('0x25')]){delete _0x502ed4['name'];}_0x2b2685['status'](_0x4e3072)[_0x00d2('0x26')](_0x502ed4);};}exports[_0x00d2('0x27')]=function(_0x197030,_0x2e81e4){var _0x439a55={},_0x407143={},_0x2aa37a={'count':0x0,'rows':[]};var _0x1d69f9=db[_0x00d2('0x28')][_0x00d2('0x29')];_0x407143['model']=_[_0x00d2('0x2a')](_0x1d69f9);_0x407143['query']=_[_0x00d2('0x2a')](_0x197030[_0x00d2('0x2b')]);_0x407143[_0x00d2('0x2c')]=_['intersection'](_0x407143[_0x00d2('0x2d')],_0x407143[_0x00d2('0x2b')]);_0x439a55[_0x00d2('0x2e')]=_['intersection'](_0x407143[_0x00d2('0x2d')],qs['fields'](_0x197030['query'][_0x00d2('0x2f')]));_0x439a55[_0x00d2('0x2e')]=_0x439a55[_0x00d2('0x2e')][_0x00d2('0x30')]?_0x439a55[_0x00d2('0x2e')]:_0x407143[_0x00d2('0x2d')];if(!_0x197030['query'][_0x00d2('0x31')](_0x00d2('0x32'))){_0x439a55['limit']=qs['limit'](_0x197030[_0x00d2('0x2b')][_0x00d2('0x1b')]);_0x439a55[_0x00d2('0x1a')]=qs[_0x00d2('0x1a')](_0x197030[_0x00d2('0x2b')][_0x00d2('0x1a')]);}_0x439a55['order']=qs[_0x00d2('0x33')](_0x197030[_0x00d2('0x2b')]['sort']);_0x439a55[_0x00d2('0x34')]=qs[_0x00d2('0x2c')](_['pick'](_0x197030[_0x00d2('0x2b')],_0x407143[_0x00d2('0x2c')]));if(_0x197030['query'][_0x00d2('0x35')]){_0x439a55[_0x00d2('0x34')]=_[_0x00d2('0x36')](_0x439a55['where'],{'$or':_[_0x00d2('0x37')](_0x1d69f9,function(_0x20fc84){if(_0x20fc84[_0x00d2('0x38')][_0x00d2('0x39')]!==_0x00d2('0x3a')){var _0x378ae8={};_0x378ae8[_0x20fc84[_0x00d2('0x3b')]]={'$like':'%'+_0x197030[_0x00d2('0x2b')]['filter']+'%'};return _0x378ae8;}})});}_0x439a55=_[_0x00d2('0x36')]({},_0x439a55,_0x197030[_0x00d2('0x3c')]);var _0x483ac4={'where':_0x439a55[_0x00d2('0x34')]};return db['ZohoField'][_0x00d2('0x19')](_0x483ac4)[_0x00d2('0x21')](function(_0x146890){_0x2aa37a['count']=_0x146890;if(_0x197030[_0x00d2('0x2b')][_0x00d2('0x3d')]){_0x439a55[_0x00d2('0x3e')]=[{'all':!![]}];}return db[_0x00d2('0x28')][_0x00d2('0x3f')](_0x439a55);})[_0x00d2('0x21')](function(_0x1051d6){_0x2aa37a[_0x00d2('0x40')]=_0x1051d6;return _0x2aa37a;})['then'](respondWithFilteredResult(_0x2e81e4,_0x439a55))[_0x00d2('0x41')](handleError(_0x2e81e4,null));};exports[_0x00d2('0x42')]=function(_0x8f4a6c,_0x395ade){var _0x895009={'raw':!![],'where':{'id':_0x8f4a6c['params']['id']}},_0x3274b5={};_0x3274b5[_0x00d2('0x2d')]=_['keys'](db[_0x00d2('0x28')][_0x00d2('0x29')]);_0x3274b5[_0x00d2('0x2b')]=_[_0x00d2('0x2a')](_0x8f4a6c[_0x00d2('0x2b')]);_0x3274b5[_0x00d2('0x2c')]=_[_0x00d2('0x43')](_0x3274b5[_0x00d2('0x2d')],_0x3274b5['query']);_0x895009[_0x00d2('0x2e')]=_[_0x00d2('0x43')](_0x3274b5['model'],qs[_0x00d2('0x2f')](_0x8f4a6c['query'][_0x00d2('0x2f')]));_0x895009[_0x00d2('0x2e')]=_0x895009[_0x00d2('0x2e')][_0x00d2('0x30')]?_0x895009[_0x00d2('0x2e')]:_0x3274b5['model'];if(_0x8f4a6c[_0x00d2('0x2b')][_0x00d2('0x3d')]){_0x895009[_0x00d2('0x3e')]=[{'all':!![]}];}_0x895009=_['merge']({},_0x895009,_0x8f4a6c['options']);return db[_0x00d2('0x28')][_0x00d2('0x44')](_0x895009)['then'](handleEntityNotFound(_0x395ade,null))['then'](respondWithResult(_0x395ade,null))[_0x00d2('0x41')](handleError(_0x395ade,null));};exports[_0x00d2('0x45')]=function(_0x137a26,_0x5e3645){return db['ZohoField'][_0x00d2('0x45')](_0x137a26[_0x00d2('0x46')],{})['then'](respondWithResult(_0x5e3645,0xc9))[_0x00d2('0x41')](handleError(_0x5e3645,null));};exports[_0x00d2('0x20')]=function(_0x242345,_0xaea067){if(_0x242345[_0x00d2('0x46')]['id']){delete _0x242345[_0x00d2('0x46')]['id'];}return db[_0x00d2('0x28')][_0x00d2('0x44')]({'where':{'id':_0x242345[_0x00d2('0x47')]['id']}})[_0x00d2('0x21')](handleEntityNotFound(_0xaea067,null))[_0x00d2('0x21')](saveUpdates(_0x242345['body'],null))['then'](respondWithResult(_0xaea067,null))[_0x00d2('0x41')](handleError(_0xaea067,null));};exports[_0x00d2('0x22')]=function(_0x5b7504,_0x577e55){return db[_0x00d2('0x28')][_0x00d2('0x44')]({'where':{'id':_0x5b7504[_0x00d2('0x47')]['id']}})[_0x00d2('0x21')](handleEntityNotFound(_0x577e55,null))[_0x00d2('0x21')](removeEntity(_0x577e55,null))[_0x00d2('0x41')](handleError(_0x577e55,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 38e14b7..1846767 100644 --- a/server/api/intZohoField/intZohoField.model.js +++ b/server/api/intZohoField/intZohoField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79a2=['bluebird','path','rimraf','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0xed4881,_0x45771c){var _0x7fcbd5=function(_0x36b960){while(--_0x36b960){_0xed4881['push'](_0xed4881['shift']());}};_0x7fcbd5(++_0x45771c);}(_0x79a2,0x82));var _0x279a=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x79a2[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x279a('0x0'));var util=require(_0x279a('0x1'));var logger=require(_0x279a('0x2'))(_0x279a('0x3'));var moment=require(_0x279a('0x4'));var BPromise=require(_0x279a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x279a('0x6'));var rimraf=require(_0x279a('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x279a('0x8')]=function(_0x148fed,_0x5ea1ff){return _0x148fed[_0x279a('0x9')](_0x279a('0xa'),attributes,{'tableName':_0x279a('0xb'),'paranoid':![],'indexes':[{'name':_0x279a('0xc'),'fields':[_0x279a('0xd'),_0x279a('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3a8a=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x3a8a,0x91));var _0xa3a8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3a8a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa3a8('0x0'));var util=require(_0xa3a8('0x1'));var logger=require(_0xa3a8('0x2'))(_0xa3a8('0x3'));var moment=require(_0xa3a8('0x4'));var BPromise=require(_0xa3a8('0x5'));var rp=require(_0xa3a8('0x6'));var fs=require('fs');var path=require(_0xa3a8('0x7'));var rimraf=require('rimraf');var config=require(_0xa3a8('0x8'));var attributes=require(_0xa3a8('0x9'));module[_0xa3a8('0xa')]=function(_0x561ec8,_0x55b8d4){return _0x561ec8[_0xa3a8('0xb')](_0xa3a8('0xc'),attributes,{'tableName':_0xa3a8('0xd'),'paranoid':![],'indexes':[{'name':_0xa3a8('0xe'),'fields':['idField',_0xa3a8('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index fef069e..ec14061 100644 --- a/server/api/intZohoField/intZohoField.rpc.js +++ b/server/api/intZohoField/intZohoField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x45284d,_0x5c5a22){var _0x30471f=function(_0x611f71){while(--_0x611f71){_0x45284d['push'](_0x45284d['shift']());}};_0x30471f(++_0x5c5a22);}(_0x55ca,0x126));var _0xa55c=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x55ca[_0x585d81];return _0x1aca0d;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('ZohoField,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('ZohoField,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x7217,0x19e));var _0x7721=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x7217[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('ZohoField,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 2aef93d..34b8641 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb64=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x3015f9,_0x6eeb0d){var _0x3390b6=function(_0x4cff57){while(--_0x4cff57){_0x3015f9['push'](_0x3015f9['shift']());}};_0x3390b6(++_0x6eeb0d);}(_0xfb64,0x17b));var _0x4fb6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfb64[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x4fb6('0x0'));var util=require(_0x4fb6('0x1'));var path=require(_0x4fb6('0x2'));var timeout=require(_0x4fb6('0x3'));var express=require(_0x4fb6('0x4'));var router=express[_0x4fb6('0x5')]();var auth=require(_0x4fb6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4fb6('0x7'));module[_0x4fb6('0x8')]=router; \ No newline at end of file +var _0x83fe=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports'];(function(_0x5cefdc,_0x291298){var _0x5e0d1b=function(_0x4ed94e){while(--_0x4ed94e){_0x5cefdc['push'](_0x5cefdc['shift']());}};_0x5e0d1b(++_0x291298);}(_0x83fe,0x117));var _0xe83f=function(_0x5e34b0,_0x287527){_0x5e34b0=_0x5e34b0-0x0;var _0x4e67c6=_0x83fe[_0x5e34b0];return _0x4e67c6;};'use strict';var multer=require(_0xe83f('0x0'));var util=require(_0xe83f('0x1'));var path=require(_0xe83f('0x2'));var timeout=require(_0xe83f('0x3'));var express=require(_0xe83f('0x4'));var router=express[_0xe83f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe83f('0x6'));var config=require(_0xe83f('0x7'));module[_0xe83f('0x8')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 7a5c228..0d8ee94 100644 --- a/server/api/integration/integration.attributes.js +++ b/server/api/integration/integration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf9f=['unique_name_and_version','BOOLEAN','state','sequelize','STRING'];(function(_0x13693a,_0x5a1d3e){var _0x57985f=function(_0x400efb){while(--_0x400efb){_0x13693a['push'](_0x13693a['shift']());}};_0x57985f(++_0x5a1d3e);}(_0xcf9f,0xf3));var _0xfcf9=function(_0x4fb23a,_0x254132){_0x4fb23a=_0x4fb23a-0x0;var _0x544630=_0xcf9f[_0x4fb23a];return _0x544630;};'use strict';var Sequelize=require(_0xfcf9('0x0'));module['exports']={'name':{'type':Sequelize[_0xfcf9('0x1')],'allowNull':![],'unique':_0xfcf9('0x2')},'version':{'type':Sequelize[_0xfcf9('0x1')],'allowNull':![],'unique':_0xfcf9('0x2')},'main':{'type':Sequelize[_0xfcf9('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xfcf9('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfcf9('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xfcf9('0x3')],'defaultValue':![]},'author':{'type':Sequelize[_0xfcf9('0x1')]},'logo':{'type':Sequelize[_0xfcf9('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0xfcf9('0x4')},'description':{'type':Sequelize[_0xfcf9('0x1')]},'title':{'type':Sequelize[_0xfcf9('0x1')]},'remoteUri':{'type':Sequelize[_0xfcf9('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x70d1=['BOOLEAN','exports','STRING','unique_name_and_version','app.js'];(function(_0x1e04bd,_0x1d2849){var _0x5d7143=function(_0x57347e){while(--_0x57347e){_0x1e04bd['push'](_0x1e04bd['shift']());}};_0x5d7143(++_0x1d2849);}(_0x70d1,0x11e));var _0x170d=function(_0x56ea12,_0x304238){_0x56ea12=_0x56ea12-0x0;var _0x4b9883=_0x70d1[_0x56ea12];return _0x4b9883;};'use strict';var Sequelize=require('sequelize');module[_0x170d('0x0')]={'name':{'type':Sequelize[_0x170d('0x1')],'allowNull':![],'unique':_0x170d('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x170d('0x2')},'main':{'type':Sequelize[_0x170d('0x1')],'defaultValue':_0x170d('0x3')},'filename':{'type':Sequelize[_0x170d('0x1')]},'path':{'type':Sequelize[_0x170d('0x1')]},'type':{'type':Sequelize[_0x170d('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x170d('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x170d('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x170d('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x170d('0x1')]},'title':{'type':Sequelize[_0x170d('0x1')]},'remoteUri':{'type':Sequelize[_0x170d('0x1')]},'link':{'type':Sequelize[_0x170d('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 2e7ca2c..b3d7bac 100644 --- a/server/api/integration/integration.controller.js +++ b/server/api/integration/integration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e90=['then','destroy','error','stack','name','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','field','Integration','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','crypto','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update'];(function(_0x33824c,_0x1a4a56){var _0x2370e8=function(_0x58553d){while(--_0x58553d){_0x33824c['push'](_0x33824c['shift']());}};_0x2370e8(++_0x1a4a56);}(_0x8e90,0x65));var _0x08e9=function(_0x32fab5,_0x1c3ea6){_0x32fab5=_0x32fab5-0x0;var _0x1983ea=_0x8e90[_0x32fab5];return _0x1983ea;};'use strict';var pdf=require(_0x08e9('0x0'));var emlformat=require(_0x08e9('0x1'));var rimraf=require(_0x08e9('0x2'));var zipdir=require(_0x08e9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x08e9('0x4'));var moment=require(_0x08e9('0x5'));var BPromise=require(_0x08e9('0x6'));var Mustache=require(_0x08e9('0x7'));var util=require(_0x08e9('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x08e9('0x9'));var ejs=require(_0x08e9('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x08e9('0xb'));var jsforce=require(_0x08e9('0xc'));var deskjs=require(_0x08e9('0xd'));var toCsv=require(_0x08e9('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x08e9('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x08e9('0xf'));var logger=require(_0x08e9('0x10'))('api');var utils=require(_0x08e9('0x11'));var config=require(_0x08e9('0x12'));var db=require(_0x08e9('0x13'))['db'];function respondWithStatusCode(_0x4c500d,_0x1f048a){_0x1f048a=_0x1f048a||0xcc;return function(_0x2d5a26){if(_0x2d5a26){return _0x4c500d[_0x08e9('0x14')](_0x1f048a);}return _0x4c500d[_0x08e9('0x15')](_0x1f048a)[_0x08e9('0x16')]();};}function respondWithResult(_0x2aa51f,_0x67e5d6){_0x67e5d6=_0x67e5d6||0xc8;return function(_0x62fe8b){if(_0x62fe8b){return _0x2aa51f[_0x08e9('0x15')](_0x67e5d6)[_0x08e9('0x17')](_0x62fe8b);}};}function respondWithFilteredResult(_0x314fdb,_0x52530b){return function(_0x3fdcf2){if(_0x3fdcf2){var _0x113097=_0x3fdcf2[_0x08e9('0x18')],_0x65976b=_0x52530b[_0x08e9('0x19')],_0x1c951b=_0x52530b[_0x08e9('0x19')]+_0x52530b[_0x08e9('0x1a')],_0x5a8b01;if(_0x1c951b>=_0x113097){_0x1c951b=_0x113097;_0x5a8b01=0xc8;}else{_0x5a8b01=0xce;}_0x314fdb['status'](_0x5a8b01);return _0x314fdb[_0x08e9('0x1b')](_0x08e9('0x1c'),_0x65976b+'-'+_0x1c951b+'/'+_0x113097)[_0x08e9('0x17')](_0x3fdcf2);}return null;};}function patchUpdates(_0x9b6499){return function(_0x24337d){try{jsonpatch[_0x08e9('0x1d')](_0x24337d,_0x9b6499,!![]);}catch(_0x4063e3){return BPromise['reject'](_0x4063e3);}return _0x24337d['save']();};}function saveUpdates(_0x10b267,_0x7f47a9){return function(_0x102fe7){if(_0x102fe7){return _0x102fe7[_0x08e9('0x1e')](_0x10b267)[_0x08e9('0x1f')](function(_0x3049b0){return _0x3049b0;});}return null;};}function removeEntity(_0x494f40,_0x419670){return function(_0x7625e6){if(_0x7625e6){return _0x7625e6[_0x08e9('0x20')]()[_0x08e9('0x1f')](function(){_0x494f40[_0x08e9('0x15')](0xcc)[_0x08e9('0x16')]();});}};}function handleEntityNotFound(_0x20df1d,_0x1c86d9){return function(_0x19502d){if(!_0x19502d){_0x20df1d[_0x08e9('0x14')](0x194);}return _0x19502d;};}function handleError(_0x39a58e,_0x52b3ae){_0x52b3ae=_0x52b3ae||0x1f4;return function(_0x3c7643){logger[_0x08e9('0x21')](_0x3c7643[_0x08e9('0x22')]);if(_0x3c7643['name']){delete _0x3c7643[_0x08e9('0x23')];}_0x39a58e[_0x08e9('0x15')](_0x52b3ae)['send'](_0x3c7643);};}exports['index']=function(_0x440454,_0x3def39){var _0x2845cd={},_0x1c65ea={},_0x3a3157={'count':0x0,'rows':[]};var _0x225873=db['Integration'][_0x08e9('0x24')];_0x1c65ea[_0x08e9('0x25')]=_[_0x08e9('0x26')](_0x225873);_0x1c65ea[_0x08e9('0x27')]=_[_0x08e9('0x26')](_0x440454['query']);_0x1c65ea[_0x08e9('0x28')]=_[_0x08e9('0x29')](_0x1c65ea[_0x08e9('0x25')],_0x1c65ea[_0x08e9('0x27')]);_0x2845cd[_0x08e9('0x2a')]=_[_0x08e9('0x29')](_0x1c65ea[_0x08e9('0x25')],qs['fields'](_0x440454[_0x08e9('0x27')][_0x08e9('0x2b')]));_0x2845cd[_0x08e9('0x2a')]=_0x2845cd[_0x08e9('0x2a')][_0x08e9('0x2c')]?_0x2845cd[_0x08e9('0x2a')]:_0x1c65ea[_0x08e9('0x25')];if(!_0x440454['query'][_0x08e9('0x2d')](_0x08e9('0x2e'))){_0x2845cd[_0x08e9('0x1a')]=qs[_0x08e9('0x1a')](_0x440454[_0x08e9('0x27')]['limit']);_0x2845cd['offset']=qs[_0x08e9('0x19')](_0x440454[_0x08e9('0x27')]['offset']);}_0x2845cd['order']=qs[_0x08e9('0x2f')](_0x440454[_0x08e9('0x27')][_0x08e9('0x2f')]);_0x2845cd[_0x08e9('0x30')]=qs[_0x08e9('0x28')](_['pick'](_0x440454[_0x08e9('0x27')],_0x1c65ea[_0x08e9('0x28')]));if(_0x440454['query'][_0x08e9('0x31')]){_0x2845cd['where']=_[_0x08e9('0x32')](_0x2845cd[_0x08e9('0x30')],{'$or':_[_0x08e9('0x33')](_0x225873,function(_0xb60670){if(_0xb60670[_0x08e9('0x34')][_0x08e9('0x35')]!=='VIRTUAL'){var _0x264989={};_0x264989[_0xb60670[_0x08e9('0x36')]]={'$like':'%'+_0x440454['query'][_0x08e9('0x31')]+'%'};return _0x264989;}})});}_0x2845cd=_[_0x08e9('0x32')]({},_0x2845cd,_0x440454['options']);var _0x5b7568={'where':_0x2845cd[_0x08e9('0x30')]};return db[_0x08e9('0x37')][_0x08e9('0x18')](_0x5b7568)['then'](function(_0x5f0b87){_0x3a3157[_0x08e9('0x18')]=_0x5f0b87;if(_0x440454['query'][_0x08e9('0x38')]){_0x2845cd[_0x08e9('0x39')]=[{'all':!![]}];}return db[_0x08e9('0x37')][_0x08e9('0x3a')](_0x2845cd);})[_0x08e9('0x1f')](function(_0x3c66c7){_0x3a3157[_0x08e9('0x3b')]=_0x3c66c7;return _0x3a3157;})[_0x08e9('0x1f')](respondWithFilteredResult(_0x3def39,_0x2845cd))[_0x08e9('0x3c')](handleError(_0x3def39,null));};exports[_0x08e9('0x3d')]=function(_0xfac379,_0x571553){var _0x5b4908={'raw':![],'where':{'id':_0xfac379[_0x08e9('0x3e')]['id']}},_0x377311={};_0x377311[_0x08e9('0x25')]=_['keys'](db[_0x08e9('0x37')][_0x08e9('0x24')]);_0x377311['query']=_['keys'](_0xfac379[_0x08e9('0x27')]);_0x377311[_0x08e9('0x28')]=_['intersection'](_0x377311['model'],_0x377311[_0x08e9('0x27')]);_0x5b4908[_0x08e9('0x2a')]=_['intersection'](_0x377311[_0x08e9('0x25')],qs[_0x08e9('0x2b')](_0xfac379[_0x08e9('0x27')]['fields']));_0x5b4908[_0x08e9('0x2a')]=_0x5b4908[_0x08e9('0x2a')]['length']?_0x5b4908[_0x08e9('0x2a')]:_0x377311[_0x08e9('0x25')];if(_0xfac379[_0x08e9('0x27')]['includeAll']){_0x5b4908['include']=[{'all':!![]}];}_0x5b4908=_['merge']({},_0x5b4908,_0xfac379['options']);return db[_0x08e9('0x37')][_0x08e9('0x3f')](_0x5b4908)[_0x08e9('0x1f')](handleEntityNotFound(_0x571553,null))[_0x08e9('0x1f')](respondWithResult(_0x571553,null))[_0x08e9('0x3c')](handleError(_0x571553,null));};exports[_0x08e9('0x40')]=function(_0xd32c4c,_0x27bd14){return db['Integration'][_0x08e9('0x40')](_0xd32c4c[_0x08e9('0x41')],{})[_0x08e9('0x1f')](respondWithResult(_0x27bd14,0xc9))['catch'](handleError(_0x27bd14,null));};exports['update']=function(_0x4029d8,_0x3ab057){if(_0x4029d8[_0x08e9('0x41')]['id']){delete _0x4029d8[_0x08e9('0x41')]['id'];}return db[_0x08e9('0x37')][_0x08e9('0x3f')]({'where':{'id':_0x4029d8[_0x08e9('0x3e')]['id']}})[_0x08e9('0x1f')](handleEntityNotFound(_0x3ab057,null))[_0x08e9('0x1f')](saveUpdates(_0x4029d8[_0x08e9('0x41')],null))['then'](respondWithResult(_0x3ab057,null))[_0x08e9('0x3c')](handleError(_0x3ab057,null));};exports['destroy']=function(_0x57a9c1,_0x10af9c){return db[_0x08e9('0x37')][_0x08e9('0x3f')]({'where':{'id':_0x57a9c1[_0x08e9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x10af9c,null))['then'](removeEntity(_0x10af9c,null))['catch'](handleError(_0x10af9c,null));}; \ No newline at end of file +var _0x1f0b=['order','sort','pick','filter','where','map','type','key','merge','options','includeAll','include','rows','catch','show','create','body','find','params','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','count','limit','set','Content-Range','json','apply','save','update','then','destroy','end','stack','name','status','index','Integration','rawAttributes','model','keys','query','filters','attributes','intersection','fields','nolimit','offset'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x1f0b,0x1ab));var _0xb1f0=function(_0x47838c,_0xfaa376){_0x47838c=_0x47838c-0x0;var _0xd8e38f=_0x1f0b[_0x47838c];return _0xd8e38f;};'use strict';var pdf=require(_0xb1f0('0x0'));var emlformat=require(_0xb1f0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb1f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1f0('0x3'));var moment=require(_0xb1f0('0x4'));var BPromise=require(_0xb1f0('0x5'));var Mustache=require(_0xb1f0('0x6'));var util=require(_0xb1f0('0x7'));var path=require('path');var sox=require(_0xb1f0('0x8'));var csv=require(_0xb1f0('0x9'));var ejs=require(_0xb1f0('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb1f0('0xb'));var crypto=require(_0xb1f0('0xc'));var jsforce=require(_0xb1f0('0xd'));var deskjs=require(_0xb1f0('0xe'));var toCsv=require(_0xb1f0('0x9'));var querystring=require(_0xb1f0('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb1f0('0x10'));var qs=require(_0xb1f0('0x11'));var hardwareService=require(_0xb1f0('0x12'));var logger=require(_0xb1f0('0x13'))(_0xb1f0('0x14'));var utils=require(_0xb1f0('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36fcef,_0xb16b31){_0xb16b31=_0xb16b31||0xcc;return function(_0x2be795){if(_0x2be795){return _0x36fcef[_0xb1f0('0x16')](_0xb16b31);}return _0x36fcef['status'](_0xb16b31)['end']();};}function respondWithResult(_0x507133,_0x6dfcc9){_0x6dfcc9=_0x6dfcc9||0xc8;return function(_0x49af0c){if(_0x49af0c){return _0x507133['status'](_0x6dfcc9)['json'](_0x49af0c);}};}function respondWithFilteredResult(_0x1f88ab,_0x1fdf93){return function(_0x594316){if(_0x594316){var _0x3af91b=_0x594316[_0xb1f0('0x17')],_0x35c1c3=_0x1fdf93['offset'],_0x128d31=_0x1fdf93['offset']+_0x1fdf93[_0xb1f0('0x18')],_0x493cf8;if(_0x128d31>=_0x3af91b){_0x128d31=_0x3af91b;_0x493cf8=0xc8;}else{_0x493cf8=0xce;}_0x1f88ab['status'](_0x493cf8);return _0x1f88ab[_0xb1f0('0x19')](_0xb1f0('0x1a'),_0x35c1c3+'-'+_0x128d31+'/'+_0x3af91b)[_0xb1f0('0x1b')](_0x594316);}return null;};}function patchUpdates(_0x5dd7dd){return function(_0x44453d){try{jsonpatch[_0xb1f0('0x1c')](_0x44453d,_0x5dd7dd,!![]);}catch(_0x3e5d3b){return BPromise['reject'](_0x3e5d3b);}return _0x44453d[_0xb1f0('0x1d')]();};}function saveUpdates(_0xa3b22a,_0x5779fa){return function(_0x4ad670){if(_0x4ad670){return _0x4ad670[_0xb1f0('0x1e')](_0xa3b22a)[_0xb1f0('0x1f')](function(_0x38c8f7){return _0x38c8f7;});}return null;};}function removeEntity(_0x5ba6a2,_0xba6ff5){return function(_0x59fda8){if(_0x59fda8){return _0x59fda8[_0xb1f0('0x20')]()[_0xb1f0('0x1f')](function(){_0x5ba6a2['status'](0xcc)[_0xb1f0('0x21')]();});}};}function handleEntityNotFound(_0x134934,_0x3b4f4f){return function(_0x2ce9e6){if(!_0x2ce9e6){_0x134934[_0xb1f0('0x16')](0x194);}return _0x2ce9e6;};}function handleError(_0x34c45b,_0x29698f){_0x29698f=_0x29698f||0x1f4;return function(_0x319c25){logger['error'](_0x319c25[_0xb1f0('0x22')]);if(_0x319c25[_0xb1f0('0x23')]){delete _0x319c25['name'];}_0x34c45b[_0xb1f0('0x24')](_0x29698f)['send'](_0x319c25);};}exports[_0xb1f0('0x25')]=function(_0x318e8c,_0x25ec40){var _0x579a30={},_0x193a2c={},_0x2a4808={'count':0x0,'rows':[]};var _0x3b2b92=db[_0xb1f0('0x26')][_0xb1f0('0x27')];_0x193a2c[_0xb1f0('0x28')]=_[_0xb1f0('0x29')](_0x3b2b92);_0x193a2c[_0xb1f0('0x2a')]=_[_0xb1f0('0x29')](_0x318e8c[_0xb1f0('0x2a')]);_0x193a2c[_0xb1f0('0x2b')]=_['intersection'](_0x193a2c['model'],_0x193a2c[_0xb1f0('0x2a')]);_0x579a30[_0xb1f0('0x2c')]=_[_0xb1f0('0x2d')](_0x193a2c['model'],qs[_0xb1f0('0x2e')](_0x318e8c[_0xb1f0('0x2a')][_0xb1f0('0x2e')]));_0x579a30[_0xb1f0('0x2c')]=_0x579a30[_0xb1f0('0x2c')]['length']?_0x579a30[_0xb1f0('0x2c')]:_0x193a2c[_0xb1f0('0x28')];if(!_0x318e8c[_0xb1f0('0x2a')]['hasOwnProperty'](_0xb1f0('0x2f'))){_0x579a30[_0xb1f0('0x18')]=qs['limit'](_0x318e8c[_0xb1f0('0x2a')][_0xb1f0('0x18')]);_0x579a30[_0xb1f0('0x30')]=qs['offset'](_0x318e8c[_0xb1f0('0x2a')]['offset']);}_0x579a30[_0xb1f0('0x31')]=qs[_0xb1f0('0x32')](_0x318e8c[_0xb1f0('0x2a')][_0xb1f0('0x32')]);_0x579a30['where']=qs[_0xb1f0('0x2b')](_[_0xb1f0('0x33')](_0x318e8c[_0xb1f0('0x2a')],_0x193a2c[_0xb1f0('0x2b')]));if(_0x318e8c['query'][_0xb1f0('0x34')]){_0x579a30[_0xb1f0('0x35')]=_['merge'](_0x579a30['where'],{'$or':_[_0xb1f0('0x36')](_0x3b2b92,function(_0xe263df){if(_0xe263df[_0xb1f0('0x37')][_0xb1f0('0x38')]!=='VIRTUAL'){var _0x2a2f6e={};_0x2a2f6e[_0xe263df['field']]={'$like':'%'+_0x318e8c['query']['filter']+'%'};return _0x2a2f6e;}})});}_0x579a30=_[_0xb1f0('0x39')]({},_0x579a30,_0x318e8c[_0xb1f0('0x3a')]);var _0x1879d3={'where':_0x579a30[_0xb1f0('0x35')]};return db['Integration'][_0xb1f0('0x17')](_0x1879d3)['then'](function(_0x2bf428){_0x2a4808[_0xb1f0('0x17')]=_0x2bf428;if(_0x318e8c[_0xb1f0('0x2a')][_0xb1f0('0x3b')]){_0x579a30[_0xb1f0('0x3c')]=[{'all':!![]}];}return db[_0xb1f0('0x26')]['findAll'](_0x579a30);})['then'](function(_0x3e7769){_0x2a4808[_0xb1f0('0x3d')]=_0x3e7769;return _0x2a4808;})[_0xb1f0('0x1f')](respondWithFilteredResult(_0x25ec40,_0x579a30))[_0xb1f0('0x3e')](handleError(_0x25ec40,null));};exports[_0xb1f0('0x3f')]=function(_0x488f8c,_0x30749f){var _0x2d16a9={'raw':![],'where':{'id':_0x488f8c['params']['id']}},_0x29e65b={};_0x29e65b[_0xb1f0('0x28')]=_[_0xb1f0('0x29')](db[_0xb1f0('0x26')][_0xb1f0('0x27')]);_0x29e65b[_0xb1f0('0x2a')]=_[_0xb1f0('0x29')](_0x488f8c[_0xb1f0('0x2a')]);_0x29e65b[_0xb1f0('0x2b')]=_[_0xb1f0('0x2d')](_0x29e65b[_0xb1f0('0x28')],_0x29e65b['query']);_0x2d16a9['attributes']=_[_0xb1f0('0x2d')](_0x29e65b['model'],qs['fields'](_0x488f8c[_0xb1f0('0x2a')]['fields']));_0x2d16a9[_0xb1f0('0x2c')]=_0x2d16a9[_0xb1f0('0x2c')]['length']?_0x2d16a9[_0xb1f0('0x2c')]:_0x29e65b[_0xb1f0('0x28')];if(_0x488f8c[_0xb1f0('0x2a')][_0xb1f0('0x3b')]){_0x2d16a9[_0xb1f0('0x3c')]=[{'all':!![]}];}_0x2d16a9=_[_0xb1f0('0x39')]({},_0x2d16a9,_0x488f8c[_0xb1f0('0x3a')]);return db[_0xb1f0('0x26')]['find'](_0x2d16a9)[_0xb1f0('0x1f')](handleEntityNotFound(_0x30749f,null))[_0xb1f0('0x1f')](respondWithResult(_0x30749f,null))[_0xb1f0('0x3e')](handleError(_0x30749f,null));};exports['create']=function(_0x5a6867,_0x52ff48){return db[_0xb1f0('0x26')][_0xb1f0('0x40')](_0x5a6867['body'],{})[_0xb1f0('0x1f')](respondWithResult(_0x52ff48,0xc9))[_0xb1f0('0x3e')](handleError(_0x52ff48,null));};exports[_0xb1f0('0x1e')]=function(_0x3fedaa,_0x1b874b){if(_0x3fedaa[_0xb1f0('0x41')]['id']){delete _0x3fedaa['body']['id'];}return db[_0xb1f0('0x26')][_0xb1f0('0x42')]({'where':{'id':_0x3fedaa[_0xb1f0('0x43')]['id']}})[_0xb1f0('0x1f')](handleEntityNotFound(_0x1b874b,null))[_0xb1f0('0x1f')](saveUpdates(_0x3fedaa['body'],null))['then'](respondWithResult(_0x1b874b,null))['catch'](handleError(_0x1b874b,null));};exports[_0xb1f0('0x20')]=function(_0x197739,_0x3a1461){return db[_0xb1f0('0x26')]['find']({'where':{'id':_0x197739[_0xb1f0('0x43')]['id']}})[_0xb1f0('0x1f')](handleEntityNotFound(_0x3a1461,null))[_0xb1f0('0x1f')](removeEntity(_0x3a1461,null))['catch'](handleError(_0x3a1461,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 1dde1f6..88094f8 100644 --- a/server/api/integration/integration.model.js +++ b/server/api/integration/integration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfac4=['exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0xfac4,0x74));var _0x4fac=function(_0x220d0e,_0x6b8f76){_0x220d0e=_0x220d0e-0x0;var _0x11b2dc=_0xfac4[_0x220d0e];return _0x11b2dc;};'use strict';var _=require(_0x4fac('0x0'));var util=require(_0x4fac('0x1'));var logger=require(_0x4fac('0x2'))(_0x4fac('0x3'));var moment=require(_0x4fac('0x4'));var BPromise=require('bluebird');var rp=require(_0x4fac('0x5'));var fs=require('fs');var path=require(_0x4fac('0x6'));var rimraf=require(_0x4fac('0x7'));var config=require(_0x4fac('0x8'));var attributes=require(_0x4fac('0x9'));module[_0x4fac('0xa')]=function(_0x3c0643,_0x39055d){return _0x3c0643[_0x4fac('0xb')](_0x4fac('0xc'),attributes,{'tableName':_0x4fac('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86f1=['define','lodash','api','moment','bluebird','path','rimraf','./integration.attributes','exports'];(function(_0x339c23,_0x541ff6){var _0x5bf134=function(_0x46c91d){while(--_0x46c91d){_0x339c23['push'](_0x339c23['shift']());}};_0x5bf134(++_0x541ff6);}(_0x86f1,0xb5));var _0x186f=function(_0xd75678,_0xa35584){_0xd75678=_0xd75678-0x0;var _0x36602b=_0x86f1[_0xd75678];return _0x36602b;};'use strict';var _=require(_0x186f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x186f('0x1'));var moment=require(_0x186f('0x2'));var BPromise=require(_0x186f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x186f('0x4'));var rimraf=require(_0x186f('0x5'));var config=require('../../config/environment');var attributes=require(_0x186f('0x6'));module[_0x186f('0x7')]=function(_0x111100,_0x5bf40e){return _0x111100[_0x186f('0x8')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 2fc6ac5..4853223 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x367c=['info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','Integration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x46ece8,_0xdeee64){var _0x46701b=function(_0x2bd109){while(--_0x2bd109){_0x46ece8['push'](_0x46ece8['shift']());}};_0x46701b(++_0xdeee64);}(_0x367c,0x1b4));var _0xc367=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x367c[_0x1da04e];return _0xdd8c41;};'use strict';var _=require('lodash');var util=require(_0xc367('0x0'));var moment=require(_0xc367('0x1'));var BPromise=require(_0xc367('0x2'));var rs=require(_0xc367('0x3'));var fs=require('fs');var Redis=require(_0xc367('0x4'));var db=require(_0xc367('0x5'))['db'];var utils=require(_0xc367('0x6'));var logger=require(_0xc367('0x7'))(_0xc367('0x8'));var config=require(_0xc367('0x9'));var jayson=require(_0xc367('0xa'));var client=jayson[_0xc367('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53153c,_0x422a99,_0x42c2d2){return new BPromise(function(_0x18abbd,_0x255302){return client[_0xc367('0xc')](_0x53153c,_0x42c2d2)[_0xc367('0xd')](function(_0x16493c){logger[_0xc367('0xe')]('Integration,\x20%s,\x20%s',_0x422a99,_0xc367('0xf'));logger[_0xc367('0x10')](_0xc367('0x11'),_0x422a99,_0xc367('0xf'),JSON[_0xc367('0x12')](_0x16493c));if(_0x16493c[_0xc367('0x13')]){if(_0x16493c[_0xc367('0x13')][_0xc367('0x14')]===0x1f4){logger['error'](_0xc367('0x15'),_0x422a99,_0x16493c['error'][_0xc367('0x16')]);return _0x255302(_0x16493c[_0xc367('0x13')]['message']);}logger[_0xc367('0x13')](_0xc367('0x15'),_0x422a99,_0x16493c[_0xc367('0x13')][_0xc367('0x16')]);return _0x18abbd(_0x16493c['error'][_0xc367('0x16')]);}else{logger['info'](_0xc367('0x15'),_0x422a99,_0xc367('0xf'));_0x18abbd(_0x16493c[_0xc367('0x17')][_0xc367('0x16')]);}})[_0xc367('0x18')](function(_0x2b6368){logger[_0xc367('0x13')](_0xc367('0x15'),_0x422a99,_0x2b6368);_0x255302(_0x2b6368);});});} \ No newline at end of file +var _0xef35=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x431124,_0x5d803b){var _0x74b35f=function(_0x368d57){while(--_0x368d57){_0x431124['push'](_0x431124['shift']());}};_0x74b35f(++_0x5d803b);}(_0xef35,0x95));var _0x5ef3=function(_0x2637ac,_0x377857){_0x2637ac=_0x2637ac-0x0;var _0x4a5758=_0xef35[_0x2637ac];return _0x4a5758;};'use strict';var _=require(_0x5ef3('0x0'));var util=require('util');var moment=require(_0x5ef3('0x1'));var BPromise=require(_0x5ef3('0x2'));var rs=require(_0x5ef3('0x3'));var fs=require('fs');var Redis=require(_0x5ef3('0x4'));var db=require(_0x5ef3('0x5'))['db'];var utils=require(_0x5ef3('0x6'));var logger=require(_0x5ef3('0x7'))('rpc');var config=require(_0x5ef3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5ef3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d8b97,_0x25d306,_0x384e03){return new BPromise(function(_0x1904d9,_0x2abcbe){return client[_0x5ef3('0xa')](_0x1d8b97,_0x384e03)['then'](function(_0x173577){logger['info'](_0x5ef3('0xb'),_0x25d306,_0x5ef3('0xc'));logger['debug'](_0x5ef3('0xd'),_0x25d306,'request\x20sent',JSON['stringify'](_0x173577));if(_0x173577['error']){if(_0x173577[_0x5ef3('0xe')][_0x5ef3('0xf')]===0x1f4){logger[_0x5ef3('0xe')](_0x5ef3('0xb'),_0x25d306,_0x173577[_0x5ef3('0xe')]['message']);return _0x2abcbe(_0x173577[_0x5ef3('0xe')][_0x5ef3('0x10')]);}logger[_0x5ef3('0xe')](_0x5ef3('0xb'),_0x25d306,_0x173577[_0x5ef3('0xe')][_0x5ef3('0x10')]);return _0x1904d9(_0x173577[_0x5ef3('0xe')][_0x5ef3('0x10')]);}else{logger['info']('Integration,\x20%s,\x20%s',_0x25d306,_0x5ef3('0xc'));_0x1904d9(_0x173577[_0x5ef3('0x11')][_0x5ef3('0x10')]);}})[_0x5ef3('0x12')](function(_0x1d89e0){logger['error']('Integration,\x20%s,\x20%s',_0x25d306,_0x1d89e0);_0x2abcbe(_0x1d89e0);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index e2dab03..f72ce77 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f44=['/:id','update','delete','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','show','post','create','put'];(function(_0x27a7d7,_0x339460){var _0x1baa19=function(_0x32eddd){while(--_0x32eddd){_0x27a7d7['push'](_0x27a7d7['shift']());}};_0x1baa19(++_0x339460);}(_0x7f44,0xa6));var _0x47f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7f44[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x47f4('0x0'));var path=require(_0x47f4('0x1'));var timeout=require(_0x47f4('0x2'));var express=require(_0x47f4('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x47f4('0x4'));var config=require(_0x47f4('0x5'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x47f4('0x6')](),controller['index']);router[_0x47f4('0x7')](_0x47f4('0x8'),auth[_0x47f4('0x6')](),controller[_0x47f4('0x9')]);router[_0x47f4('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x47f4('0xa')]);router[_0x47f4('0xb')]('/',auth[_0x47f4('0x6')](),controller[_0x47f4('0xc')]);router[_0x47f4('0xd')](_0x47f4('0xe'),auth[_0x47f4('0x6')](),controller[_0x47f4('0xf')]);router[_0x47f4('0x10')](_0x47f4('0xe'),auth[_0x47f4('0x6')](),controller['destroy']);module[_0x47f4('0x11')]=router; \ No newline at end of file +var _0x0aae=['../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0aae,0x1dd));var _0xe0aa=function(_0x3d5fd2,_0x3af05b){_0x3d5fd2=_0x3d5fd2-0x0;var _0x14404c=_0x0aae[_0x3d5fd2];return _0x14404c;};'use strict';var multer=require(_0xe0aa('0x0'));var util=require(_0xe0aa('0x1'));var path=require(_0xe0aa('0x2'));var timeout=require(_0xe0aa('0x3'));var express=require(_0xe0aa('0x4'));var router=express[_0xe0aa('0x5')]();var auth=require(_0xe0aa('0x6'));var interaction=require(_0xe0aa('0x7'));var config=require(_0xe0aa('0x8'));var controller=require(_0xe0aa('0x9'));router[_0xe0aa('0xa')]('/',auth[_0xe0aa('0xb')](),controller[_0xe0aa('0xc')]);router['get'](_0xe0aa('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xe0aa('0xa')]('/:id',auth[_0xe0aa('0xb')](),controller[_0xe0aa('0xe')]);router[_0xe0aa('0xf')]('/',auth[_0xe0aa('0xb')](),controller[_0xe0aa('0x10')]);router[_0xe0aa('0x11')]('/:id',auth[_0xe0aa('0xb')](),controller[_0xe0aa('0x12')]);router[_0xe0aa('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xe0aa('0x14')]);module[_0xe0aa('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index a31ff15..52d9814 100644 --- a/server/api/integrationReport/integrationReport.attributes.js +++ b/server/api/integrationReport/integrationReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa785=['DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER'];(function(_0x5e8602,_0x2ce012){var _0x4434fb=function(_0x5ea1cb){while(--_0x5ea1cb){_0x5e8602['push'](_0x5e8602['shift']());}};_0x4434fb(++_0x2ce012);}(_0xa785,0xcd));var _0x5a78=function(_0x102f97,_0x5bda2f){_0x102f97=_0x102f97-0x0;var _0xd22058=_0xa785[_0x102f97];return _0xd22058;};'use strict';var Sequelize=require(_0x5a78('0x0'));module[_0x5a78('0x1')]={'integration':{'type':Sequelize[_0x5a78('0x2')]},'eventChannel':{'type':Sequelize[_0x5a78('0x2')]},'exitStatus':{'type':Sequelize[_0x5a78('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x5a78('0x3')]},'contacts':{'type':Sequelize[_0x5a78('0x2')]},'uniqueid':{'type':Sequelize[_0x5a78('0x2')]},'calleridnum':{'type':Sequelize[_0x5a78('0x2')]},'calleridname':{'type':Sequelize[_0x5a78('0x2')]},'queue':{'type':Sequelize[_0x5a78('0x2')]},'interface':{'type':Sequelize[_0x5a78('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x5a78('0x4')]},'agentconnectAt':{'type':Sequelize[_0x5a78('0x4')]},'holdtime':{'type':Sequelize[_0x5a78('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5a78('0x4')]},'talktime':{'type':Sequelize[_0x5a78('0x3')]},'agentacw':{'type':Sequelize[_0x5a78('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5a78('0x3')]},'reason':{'type':Sequelize[_0x5a78('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5a78('0x4')]},'agentdump':{'type':Sequelize[_0x5a78('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x5a78('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5a78('0x2')]},'channelstate':{'type':Sequelize[_0x5a78('0x3')]},'channelstatedesc':{'type':Sequelize[_0x5a78('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x5a78('0x2')]},'language':{'type':Sequelize[_0x5a78('0x2')]},'accountcode':{'type':Sequelize[_0x5a78('0x2')]},'context':{'type':Sequelize[_0x5a78('0x2')]},'exten':{'type':Sequelize[_0x5a78('0x2')]},'priority':{'type':Sequelize[_0x5a78('0x2')]},'destchannel':{'type':Sequelize[_0x5a78('0x2')]},'destchannelstate':{'type':Sequelize[_0x5a78('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x5a78('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5a78('0x2')]},'destcalleridname':{'type':Sequelize[_0x5a78('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5a78('0x2')]},'destaccountcode':{'type':Sequelize[_0x5a78('0x2')]},'destcontext':{'type':Sequelize[_0x5a78('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5a78('0x2')]},'destuniqueid':{'type':Sequelize[_0x5a78('0x2')]},'messageId':{'type':Sequelize[_0x5a78('0x2')]},'inReplyTo':{'type':Sequelize[_0x5a78('0x2')]},'subject':{'type':Sequelize[_0x5a78('0x2')]},'from':{'type':Sequelize[_0x5a78('0x2')]},'to':{'type':Sequelize[_0x5a78('0x2')]},'cc':{'type':Sequelize[_0x5a78('0x2')]},'attachment':{'type':Sequelize[_0x5a78('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x5a78('0x6')]},'status':{'type':Sequelize[_0x5a78('0x7')]('SENT',_0x5a78('0x8'),_0x5a78('0x9'),_0x5a78('0xa'))},'url':{'type':Sequelize[_0x5a78('0x2')]},'app':{'type':Sequelize[_0x5a78('0x2')]},'appdata':{'type':Sequelize[_0x5a78('0x2')]},'projectId':{'type':Sequelize[_0x5a78('0x3')]}}; \ No newline at end of file +var _0x56e5=['DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','FAILED','sequelize','exports','STRING','INTEGER'];(function(_0x1ac77b,_0x10ee7a){var _0x161584=function(_0x5a810d){while(--_0x5a810d){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x161584(++_0x10ee7a);}(_0x56e5,0x130));var _0x556e=function(_0x3a712c,_0x4571ec){_0x3a712c=_0x3a712c-0x0;var _0x3ae099=_0x56e5[_0x3a712c];return _0x3ae099;};'use strict';var Sequelize=require(_0x556e('0x0'));module[_0x556e('0x1')]={'integration':{'type':Sequelize[_0x556e('0x2')]},'eventChannel':{'type':Sequelize[_0x556e('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x556e('0x2')]},'integrationId':{'type':Sequelize[_0x556e('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x556e('0x2')]},'queue':{'type':Sequelize[_0x556e('0x2')]},'interface':{'type':Sequelize[_0x556e('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x556e('0x4')]},'agentconnectAt':{'type':Sequelize[_0x556e('0x4')]},'holdtime':{'type':Sequelize[_0x556e('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x556e('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x556e('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x556e('0x3')]},'reason':{'type':Sequelize[_0x556e('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x556e('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x556e('0x2')]},'channel':{'type':Sequelize[_0x556e('0x2')]},'channelstate':{'type':Sequelize[_0x556e('0x3')]},'channelstatedesc':{'type':Sequelize[_0x556e('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x556e('0x2')]},'language':{'type':Sequelize[_0x556e('0x2')]},'accountcode':{'type':Sequelize[_0x556e('0x2')]},'context':{'type':Sequelize[_0x556e('0x2')]},'exten':{'type':Sequelize[_0x556e('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x556e('0x2')]},'destchannelstate':{'type':Sequelize[_0x556e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x556e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x556e('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x556e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x556e('0x2')]},'destlanguage':{'type':Sequelize[_0x556e('0x2')]},'destaccountcode':{'type':Sequelize[_0x556e('0x2')]},'destcontext':{'type':Sequelize[_0x556e('0x2')]},'destexten':{'type':Sequelize[_0x556e('0x2')]},'destpriority':{'type':Sequelize[_0x556e('0x2')]},'destuniqueid':{'type':Sequelize[_0x556e('0x2')]},'messageId':{'type':Sequelize[_0x556e('0x2')]},'inReplyTo':{'type':Sequelize[_0x556e('0x2')]},'subject':{'type':Sequelize[_0x556e('0x2')]},'from':{'type':Sequelize[_0x556e('0x2')]},'to':{'type':Sequelize[_0x556e('0x2')]},'cc':{'type':Sequelize[_0x556e('0x2')]},'attachment':{'type':Sequelize[_0x556e('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x556e('0x7')](_0x556e('0x8'),_0x556e('0x9'),'RECEIVED',_0x556e('0xa'))},'url':{'type':Sequelize[_0x556e('0x2')]},'app':{'type':Sequelize[_0x556e('0x2')]},'appdata':{'type':Sequelize[_0x556e('0x2')]},'projectId':{'type':Sequelize[_0x556e('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 5f61929..158cf7a 100644 --- a/server/api/integrationReport/integrationReport.controller.js +++ b/server/api/integrationReport/integrationReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b60=['limit','Content-Range','json','apply','save','then','destroy','error','stack','name','IntegrationReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','offset','sort','filter','merge','where','type','VIRTUAL','field','options','includeAll','include','catch','show','find','create','body','update','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','count'];(function(_0x47f5e8,_0x29b2b7){var _0x573a92=function(_0x5d42f6){while(--_0x5d42f6){_0x47f5e8['push'](_0x47f5e8['shift']());}};_0x573a92(++_0x29b2b7);}(_0x3b60,0x1a2));var _0x03b6=function(_0x3221b2,_0x589df3){_0x3221b2=_0x3221b2-0x0;var _0x27f044=_0x3b60[_0x3221b2];return _0x27f044;};'use strict';var pdf=require(_0x03b6('0x0'));var emlformat=require(_0x03b6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x03b6('0x2'));var jsonpatch=require(_0x03b6('0x3'));var rp=require(_0x03b6('0x4'));var moment=require('moment');var BPromise=require(_0x03b6('0x5'));var Mustache=require(_0x03b6('0x6'));var util=require(_0x03b6('0x7'));var path=require(_0x03b6('0x8'));var sox=require(_0x03b6('0x9'));var csv=require(_0x03b6('0xa'));var ejs=require(_0x03b6('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x03b6('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x03b6('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x03b6('0xd'));var authService=require(_0x03b6('0xe'));var qs=require(_0x03b6('0xf'));var hardwareService=require(_0x03b6('0x10'));var logger=require('../../config/logger')(_0x03b6('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x03b6('0x12'))['db'];function respondWithStatusCode(_0xe958a6,_0x1e6fdf){_0x1e6fdf=_0x1e6fdf||0xcc;return function(_0xfc616f){if(_0xfc616f){return _0xe958a6[_0x03b6('0x13')](_0x1e6fdf);}return _0xe958a6[_0x03b6('0x14')](_0x1e6fdf)[_0x03b6('0x15')]();};}function respondWithResult(_0x40e81a,_0x1f466f){_0x1f466f=_0x1f466f||0xc8;return function(_0x55bcde){if(_0x55bcde){return _0x40e81a[_0x03b6('0x14')](_0x1f466f)['json'](_0x55bcde);}};}function respondWithFilteredResult(_0x2974b1,_0x1202c1){return function(_0x22d4ed){if(_0x22d4ed){var _0x2ec537=_0x22d4ed[_0x03b6('0x16')],_0x3ef7ac=_0x1202c1['offset'],_0x5e944b=_0x1202c1['offset']+_0x1202c1[_0x03b6('0x17')],_0x120dfc;if(_0x5e944b>=_0x2ec537){_0x5e944b=_0x2ec537;_0x120dfc=0xc8;}else{_0x120dfc=0xce;}_0x2974b1[_0x03b6('0x14')](_0x120dfc);return _0x2974b1['set'](_0x03b6('0x18'),_0x3ef7ac+'-'+_0x5e944b+'/'+_0x2ec537)[_0x03b6('0x19')](_0x22d4ed);}return null;};}function patchUpdates(_0x3013d5){return function(_0x435145){try{jsonpatch[_0x03b6('0x1a')](_0x435145,_0x3013d5,!![]);}catch(_0x2d6ecb){return BPromise['reject'](_0x2d6ecb);}return _0x435145[_0x03b6('0x1b')]();};}function saveUpdates(_0x24d3c9,_0x5da91b){return function(_0x214236){if(_0x214236){return _0x214236['update'](_0x24d3c9)[_0x03b6('0x1c')](function(_0x32b126){return _0x32b126;});}return null;};}function removeEntity(_0x79cf18,_0x262130){return function(_0x52ce32){if(_0x52ce32){return _0x52ce32[_0x03b6('0x1d')]()['then'](function(){_0x79cf18['status'](0xcc)[_0x03b6('0x15')]();});}};}function handleEntityNotFound(_0xdde03,_0x5b16fc){return function(_0x39f17f){if(!_0x39f17f){_0xdde03[_0x03b6('0x13')](0x194);}return _0x39f17f;};}function handleError(_0x16ad77,_0x209365){_0x209365=_0x209365||0x1f4;return function(_0x17e3b0){logger[_0x03b6('0x1e')](_0x17e3b0[_0x03b6('0x1f')]);if(_0x17e3b0[_0x03b6('0x20')]){delete _0x17e3b0['name'];}_0x16ad77[_0x03b6('0x14')](_0x209365)['send'](_0x17e3b0);};}exports['index']=function(_0x4e0bae,_0x1901a1){var _0xa9912a={},_0x20b118={},_0x5de060={'count':0x0,'rows':[]};var _0x4922aa=db[_0x03b6('0x21')][_0x03b6('0x22')];_0x20b118['model']=_[_0x03b6('0x23')](_0x4922aa);_0x20b118[_0x03b6('0x24')]=_[_0x03b6('0x23')](_0x4e0bae['query']);_0x20b118[_0x03b6('0x25')]=_[_0x03b6('0x26')](_0x20b118[_0x03b6('0x27')],_0x20b118[_0x03b6('0x24')]);_0xa9912a[_0x03b6('0x28')]=_[_0x03b6('0x26')](_0x20b118[_0x03b6('0x27')],qs[_0x03b6('0x29')](_0x4e0bae[_0x03b6('0x24')][_0x03b6('0x29')]));_0xa9912a[_0x03b6('0x28')]=_0xa9912a['attributes'][_0x03b6('0x2a')]?_0xa9912a[_0x03b6('0x28')]:_0x20b118[_0x03b6('0x27')];if(!_0x4e0bae[_0x03b6('0x24')]['hasOwnProperty'](_0x03b6('0x2b'))){_0xa9912a[_0x03b6('0x17')]=qs[_0x03b6('0x17')](_0x4e0bae['query'][_0x03b6('0x17')]);_0xa9912a[_0x03b6('0x2c')]=qs[_0x03b6('0x2c')](_0x4e0bae[_0x03b6('0x24')][_0x03b6('0x2c')]);}_0xa9912a['order']=qs['sort'](_0x4e0bae[_0x03b6('0x24')][_0x03b6('0x2d')]);_0xa9912a['where']=qs['filters'](_['pick'](_0x4e0bae[_0x03b6('0x24')],_0x20b118['filters']));if(_0x4e0bae[_0x03b6('0x24')][_0x03b6('0x2e')]){_0xa9912a['where']=_[_0x03b6('0x2f')](_0xa9912a[_0x03b6('0x30')],{'$or':_['map'](_0x4922aa,function(_0x189179){if(_0x189179[_0x03b6('0x31')]['key']!==_0x03b6('0x32')){var _0x5c43cf={};_0x5c43cf[_0x189179[_0x03b6('0x33')]]={'$like':'%'+_0x4e0bae[_0x03b6('0x24')][_0x03b6('0x2e')]+'%'};return _0x5c43cf;}})});}_0xa9912a=_[_0x03b6('0x2f')]({},_0xa9912a,_0x4e0bae[_0x03b6('0x34')]);var _0x39c87c={'where':_0xa9912a['where']};return db[_0x03b6('0x21')][_0x03b6('0x16')](_0x39c87c)[_0x03b6('0x1c')](function(_0xa1be86){_0x5de060[_0x03b6('0x16')]=_0xa1be86;if(_0x4e0bae[_0x03b6('0x24')][_0x03b6('0x35')]){_0xa9912a[_0x03b6('0x36')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0xa9912a);})[_0x03b6('0x1c')](function(_0x1b6f2a){_0x5de060['rows']=_0x1b6f2a;return _0x5de060;})[_0x03b6('0x1c')](respondWithFilteredResult(_0x1901a1,_0xa9912a))[_0x03b6('0x37')](handleError(_0x1901a1,null));};exports[_0x03b6('0x38')]=function(_0x42568d,_0x35ef59){var _0x3cd617={'raw':![],'where':{'id':_0x42568d['params']['id']}},_0x1c1cfc={};_0x1c1cfc[_0x03b6('0x27')]=_[_0x03b6('0x23')](db[_0x03b6('0x21')][_0x03b6('0x22')]);_0x1c1cfc['query']=_[_0x03b6('0x23')](_0x42568d['query']);_0x1c1cfc[_0x03b6('0x25')]=_['intersection'](_0x1c1cfc[_0x03b6('0x27')],_0x1c1cfc[_0x03b6('0x24')]);_0x3cd617['attributes']=_[_0x03b6('0x26')](_0x1c1cfc[_0x03b6('0x27')],qs[_0x03b6('0x29')](_0x42568d['query'][_0x03b6('0x29')]));_0x3cd617[_0x03b6('0x28')]=_0x3cd617['attributes'][_0x03b6('0x2a')]?_0x3cd617['attributes']:_0x1c1cfc['model'];if(_0x42568d[_0x03b6('0x24')][_0x03b6('0x35')]){_0x3cd617[_0x03b6('0x36')]=[{'all':!![]}];}_0x3cd617=_[_0x03b6('0x2f')]({},_0x3cd617,_0x42568d[_0x03b6('0x34')]);return db[_0x03b6('0x21')][_0x03b6('0x39')](_0x3cd617)[_0x03b6('0x1c')](handleEntityNotFound(_0x35ef59,null))[_0x03b6('0x1c')](respondWithResult(_0x35ef59,null))[_0x03b6('0x37')](handleError(_0x35ef59,null));};exports[_0x03b6('0x3a')]=function(_0x25b740,_0x1f9ac3){return db[_0x03b6('0x21')][_0x03b6('0x3a')](_0x25b740[_0x03b6('0x3b')],{})[_0x03b6('0x1c')](respondWithResult(_0x1f9ac3,0xc9))['catch'](handleError(_0x1f9ac3,null));};exports[_0x03b6('0x3c')]=function(_0x309e06,_0x23f923){if(_0x309e06['body']['id']){delete _0x309e06[_0x03b6('0x3b')]['id'];}return db[_0x03b6('0x21')][_0x03b6('0x39')]({'where':{'id':_0x309e06[_0x03b6('0x3d')]['id']}})[_0x03b6('0x1c')](handleEntityNotFound(_0x23f923,null))[_0x03b6('0x1c')](saveUpdates(_0x309e06['body'],null))['then'](respondWithResult(_0x23f923,null))[_0x03b6('0x37')](handleError(_0x23f923,null));};exports[_0x03b6('0x1d')]=function(_0x218aaa,_0x33b9ba){return db[_0x03b6('0x21')]['find']({'where':{'id':_0x218aaa[_0x03b6('0x3d')]['id']}})[_0x03b6('0x1c')](handleEntityNotFound(_0x33b9ba,null))[_0x03b6('0x1c')](removeEntity(_0x33b9ba,null))[_0x03b6('0x37')](handleError(_0x33b9ba,null));};exports[_0x03b6('0x3e')]=function(_0x14c1fa,_0x23441d){return db['IntegrationReport'][_0x03b6('0x3e')]()['then'](respondWithResult(_0x23441d,null))[_0x03b6('0x37')](handleError(_0x23441d,null));}; \ No newline at end of file +var _0xb8b5=['html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','then','end','name','send','index','IntegrationReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','order','sort','pick','filter','where','map','type','key','field','merge','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','update','destroy','params','describe'];(function(_0x438a5d,_0x5ef674){var _0x346ae5=function(_0x260afe){while(--_0x260afe){_0x438a5d['push'](_0x438a5d['shift']());}};_0x346ae5(++_0x5ef674);}(_0xb8b5,0x168));var _0x5b8b=function(_0x597e73,_0x3533a3){_0x597e73=_0x597e73-0x0;var _0x556208=_0xb8b5[_0x597e73];return _0x556208;};'use strict';var pdf=require(_0x5b8b('0x0'));var emlformat=require(_0x5b8b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5b8b('0x2'));var jsonpatch=require(_0x5b8b('0x3'));var rp=require(_0x5b8b('0x4'));var moment=require('moment');var BPromise=require(_0x5b8b('0x5'));var Mustache=require(_0x5b8b('0x6'));var util=require(_0x5b8b('0x7'));var path=require(_0x5b8b('0x8'));var sox=require(_0x5b8b('0x9'));var csv=require(_0x5b8b('0xa'));var ejs=require(_0x5b8b('0xb'));var fs=require('fs');var _=require(_0x5b8b('0xc'));var squel=require(_0x5b8b('0xd'));var crypto=require(_0x5b8b('0xe'));var jsforce=require(_0x5b8b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5b8b('0xa'));var querystring=require(_0x5b8b('0x10'));var Papa=require(_0x5b8b('0x11'));var Redis=require('ioredis');var authService=require(_0x5b8b('0x12'));var qs=require(_0x5b8b('0x13'));var hardwareService=require(_0x5b8b('0x14'));var logger=require(_0x5b8b('0x15'))('api');var utils=require(_0x5b8b('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d3c80,_0x1b36fb){_0x1b36fb=_0x1b36fb||0xcc;return function(_0x29aa30){if(_0x29aa30){return _0x3d3c80[_0x5b8b('0x17')](_0x1b36fb);}return _0x3d3c80[_0x5b8b('0x18')](_0x1b36fb)['end']();};}function respondWithResult(_0x3b7a2e,_0x2c2cd8){_0x2c2cd8=_0x2c2cd8||0xc8;return function(_0x33ad1f){if(_0x33ad1f){return _0x3b7a2e[_0x5b8b('0x18')](_0x2c2cd8)[_0x5b8b('0x19')](_0x33ad1f);}};}function respondWithFilteredResult(_0x26f1ce,_0x3e95e4){return function(_0x208dfe){if(_0x208dfe){var _0x51ef79=_0x208dfe['count'],_0x4becf1=_0x3e95e4['offset'],_0xc72af8=_0x3e95e4[_0x5b8b('0x1a')]+_0x3e95e4[_0x5b8b('0x1b')],_0x54652f;if(_0xc72af8>=_0x51ef79){_0xc72af8=_0x51ef79;_0x54652f=0xc8;}else{_0x54652f=0xce;}_0x26f1ce[_0x5b8b('0x18')](_0x54652f);return _0x26f1ce[_0x5b8b('0x1c')](_0x5b8b('0x1d'),_0x4becf1+'-'+_0xc72af8+'/'+_0x51ef79)[_0x5b8b('0x19')](_0x208dfe);}return null;};}function patchUpdates(_0x56735a){return function(_0xc58bc2){try{jsonpatch[_0x5b8b('0x1e')](_0xc58bc2,_0x56735a,!![]);}catch(_0x396752){return BPromise[_0x5b8b('0x1f')](_0x396752);}return _0xc58bc2['save']();};}function saveUpdates(_0x5740a4,_0x5778c6){return function(_0x44bd69){if(_0x44bd69){return _0x44bd69['update'](_0x5740a4)[_0x5b8b('0x20')](function(_0x1871e6){return _0x1871e6;});}return null;};}function removeEntity(_0x4ddbe5,_0x11518d){return function(_0x360869){if(_0x360869){return _0x360869['destroy']()[_0x5b8b('0x20')](function(){_0x4ddbe5['status'](0xcc)[_0x5b8b('0x21')]();});}};}function handleEntityNotFound(_0x3c32b,_0x4a8678){return function(_0x444c2d){if(!_0x444c2d){_0x3c32b[_0x5b8b('0x17')](0x194);}return _0x444c2d;};}function handleError(_0x31af6a,_0xcd55f7){_0xcd55f7=_0xcd55f7||0x1f4;return function(_0x5080d3){logger['error'](_0x5080d3['stack']);if(_0x5080d3[_0x5b8b('0x22')]){delete _0x5080d3[_0x5b8b('0x22')];}_0x31af6a[_0x5b8b('0x18')](_0xcd55f7)[_0x5b8b('0x23')](_0x5080d3);};}exports[_0x5b8b('0x24')]=function(_0x3fa8c4,_0x14ba65){var _0x94a2e2={},_0x5e3a05={},_0x5c50e4={'count':0x0,'rows':[]};var _0x565758=db[_0x5b8b('0x25')][_0x5b8b('0x26')];_0x5e3a05[_0x5b8b('0x27')]=_[_0x5b8b('0x28')](_0x565758);_0x5e3a05[_0x5b8b('0x29')]=_[_0x5b8b('0x28')](_0x3fa8c4[_0x5b8b('0x29')]);_0x5e3a05[_0x5b8b('0x2a')]=_['intersection'](_0x5e3a05[_0x5b8b('0x27')],_0x5e3a05[_0x5b8b('0x29')]);_0x94a2e2[_0x5b8b('0x2b')]=_[_0x5b8b('0x2c')](_0x5e3a05[_0x5b8b('0x27')],qs[_0x5b8b('0x2d')](_0x3fa8c4[_0x5b8b('0x29')][_0x5b8b('0x2d')]));_0x94a2e2[_0x5b8b('0x2b')]=_0x94a2e2['attributes'][_0x5b8b('0x2e')]?_0x94a2e2[_0x5b8b('0x2b')]:_0x5e3a05['model'];if(!_0x3fa8c4[_0x5b8b('0x29')]['hasOwnProperty']('nolimit')){_0x94a2e2[_0x5b8b('0x1b')]=qs['limit'](_0x3fa8c4['query'][_0x5b8b('0x1b')]);_0x94a2e2[_0x5b8b('0x1a')]=qs[_0x5b8b('0x1a')](_0x3fa8c4['query'][_0x5b8b('0x1a')]);}_0x94a2e2[_0x5b8b('0x2f')]=qs[_0x5b8b('0x30')](_0x3fa8c4[_0x5b8b('0x29')]['sort']);_0x94a2e2['where']=qs[_0x5b8b('0x2a')](_[_0x5b8b('0x31')](_0x3fa8c4[_0x5b8b('0x29')],_0x5e3a05[_0x5b8b('0x2a')]));if(_0x3fa8c4[_0x5b8b('0x29')][_0x5b8b('0x32')]){_0x94a2e2[_0x5b8b('0x33')]=_['merge'](_0x94a2e2[_0x5b8b('0x33')],{'$or':_[_0x5b8b('0x34')](_0x565758,function(_0xdd0293){if(_0xdd0293[_0x5b8b('0x35')][_0x5b8b('0x36')]!=='VIRTUAL'){var _0x3ec847={};_0x3ec847[_0xdd0293[_0x5b8b('0x37')]]={'$like':'%'+_0x3fa8c4['query'][_0x5b8b('0x32')]+'%'};return _0x3ec847;}})});}_0x94a2e2=_[_0x5b8b('0x38')]({},_0x94a2e2,_0x3fa8c4[_0x5b8b('0x39')]);var _0x16eb90={'where':_0x94a2e2['where']};return db[_0x5b8b('0x25')][_0x5b8b('0x3a')](_0x16eb90)[_0x5b8b('0x20')](function(_0xb5d611){_0x5c50e4[_0x5b8b('0x3a')]=_0xb5d611;if(_0x3fa8c4[_0x5b8b('0x29')][_0x5b8b('0x3b')]){_0x94a2e2['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x5b8b('0x3c')](_0x94a2e2);})[_0x5b8b('0x20')](function(_0x92c2ac){_0x5c50e4[_0x5b8b('0x3d')]=_0x92c2ac;return _0x5c50e4;})[_0x5b8b('0x20')](respondWithFilteredResult(_0x14ba65,_0x94a2e2))[_0x5b8b('0x3e')](handleError(_0x14ba65,null));};exports[_0x5b8b('0x3f')]=function(_0x33af4a,_0x417e29){var _0x914d85={'raw':![],'where':{'id':_0x33af4a['params']['id']}},_0x4c7b36={};_0x4c7b36[_0x5b8b('0x27')]=_[_0x5b8b('0x28')](db[_0x5b8b('0x25')][_0x5b8b('0x26')]);_0x4c7b36[_0x5b8b('0x29')]=_[_0x5b8b('0x28')](_0x33af4a[_0x5b8b('0x29')]);_0x4c7b36[_0x5b8b('0x2a')]=_[_0x5b8b('0x2c')](_0x4c7b36[_0x5b8b('0x27')],_0x4c7b36['query']);_0x914d85[_0x5b8b('0x2b')]=_['intersection'](_0x4c7b36[_0x5b8b('0x27')],qs[_0x5b8b('0x2d')](_0x33af4a[_0x5b8b('0x29')][_0x5b8b('0x2d')]));_0x914d85[_0x5b8b('0x2b')]=_0x914d85[_0x5b8b('0x2b')][_0x5b8b('0x2e')]?_0x914d85[_0x5b8b('0x2b')]:_0x4c7b36[_0x5b8b('0x27')];if(_0x33af4a['query'][_0x5b8b('0x3b')]){_0x914d85[_0x5b8b('0x40')]=[{'all':!![]}];}_0x914d85=_[_0x5b8b('0x38')]({},_0x914d85,_0x33af4a[_0x5b8b('0x39')]);return db[_0x5b8b('0x25')][_0x5b8b('0x41')](_0x914d85)[_0x5b8b('0x20')](handleEntityNotFound(_0x417e29,null))[_0x5b8b('0x20')](respondWithResult(_0x417e29,null))[_0x5b8b('0x3e')](handleError(_0x417e29,null));};exports[_0x5b8b('0x42')]=function(_0x23bd97,_0x595ad3){return db[_0x5b8b('0x25')]['create'](_0x23bd97[_0x5b8b('0x43')],{})[_0x5b8b('0x20')](respondWithResult(_0x595ad3,0xc9))['catch'](handleError(_0x595ad3,null));};exports[_0x5b8b('0x44')]=function(_0xad24b9,_0x13e7b0){if(_0xad24b9['body']['id']){delete _0xad24b9[_0x5b8b('0x43')]['id'];}return db[_0x5b8b('0x25')][_0x5b8b('0x41')]({'where':{'id':_0xad24b9['params']['id']}})[_0x5b8b('0x20')](handleEntityNotFound(_0x13e7b0,null))['then'](saveUpdates(_0xad24b9['body'],null))['then'](respondWithResult(_0x13e7b0,null))[_0x5b8b('0x3e')](handleError(_0x13e7b0,null));};exports[_0x5b8b('0x45')]=function(_0x2020d6,_0x71662d){return db['IntegrationReport'][_0x5b8b('0x41')]({'where':{'id':_0x2020d6[_0x5b8b('0x46')]['id']}})['then'](handleEntityNotFound(_0x71662d,null))[_0x5b8b('0x20')](removeEntity(_0x71662d,null))[_0x5b8b('0x3e')](handleError(_0x71662d,null));};exports[_0x5b8b('0x47')]=function(_0x4d007b,_0x5940ec){return db[_0x5b8b('0x25')]['describe']()['then'](respondWithResult(_0x5940ec,null))[_0x5b8b('0x3e')](handleError(_0x5940ec,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index d25f425..0e882b5 100644 --- a/server/api/integrationReport/integrationReport.model.js +++ b/server/api/integrationReport/integrationReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10a8=['bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','../../config/logger'];(function(_0x59abb0,_0x2fb2b0){var _0x5290f7=function(_0x4b7a37){while(--_0x4b7a37){_0x59abb0['push'](_0x59abb0['shift']());}};_0x5290f7(++_0x2fb2b0);}(_0x10a8,0x8e));var _0x810a=function(_0xa55e00,_0x31414f){_0xa55e00=_0xa55e00-0x0;var _0x4a9760=_0x10a8[_0xa55e00];return _0x4a9760;};'use strict';var _=require('lodash');var util=require(_0x810a('0x0'));var logger=require(_0x810a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x810a('0x2'));var rp=require(_0x810a('0x3'));var fs=require('fs');var path=require(_0x810a('0x4'));var rimraf=require(_0x810a('0x5'));var config=require(_0x810a('0x6'));var attributes=require(_0x810a('0x7'));module[_0x810a('0x8')]=function(_0x2faba2,_0x502019){return _0x2faba2[_0x810a('0x9')](_0x810a('0xa'),attributes,{'tableName':_0x810a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0144=['request-promise','rimraf','../../config/environment','exports','define','IntegrationReport','lodash','util','../../config/logger','api','moment'];(function(_0x4f2c4c,_0x16e6ef){var _0x20ba37=function(_0x222096){while(--_0x222096){_0x4f2c4c['push'](_0x4f2c4c['shift']());}};_0x20ba37(++_0x16e6ef);}(_0x0144,0xb6));var _0x4014=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0x0144[_0xa9a245];return _0x2d0eaa;};'use strict';var _=require(_0x4014('0x0'));var util=require(_0x4014('0x1'));var logger=require(_0x4014('0x2'))(_0x4014('0x3'));var moment=require(_0x4014('0x4'));var BPromise=require('bluebird');var rp=require(_0x4014('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4014('0x6'));var config=require(_0x4014('0x7'));var attributes=require('./integrationReport.attributes');module[_0x4014('0x8')]=function(_0x1a8fe6,_0x466648){return _0x1a8fe6[_0x4014('0x9')](_0x4014('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index c986f03..6acb240 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x50250b,_0x4e2618){var _0x14fedb=function(_0x48f173){while(--_0x48f173){_0x50250b['push'](_0x50250b['shift']());}};_0x14fedb(++_0x4e2618);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xb7e7[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('IntegrationReport,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file +var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x354ab1,_0xec5b21){var _0x9918a1=function(_0x1becca){while(--_0x1becca){_0x354ab1['push'](_0x354ab1['shift']());}};_0x9918a1(++_0xec5b21);}(_0xda2d,0x102));var _0xdda2=function(_0xf4b0b2,_0x230299){_0xf4b0b2=_0xf4b0b2-0x0;var _0x1a1b6d=_0xda2d[_0xf4b0b2];return _0x1a1b6d;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('IntegrationReport,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 072facb..e0172d8 100644 --- a/server/api/interval/index.js +++ b/server/api/interval/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0x2c5b74,_0x5aac6c){var _0x3e109d=function(_0x3ffdf4){while(--_0x3ffdf4){_0x2c5b74['push'](_0x2c5b74['shift']());}};_0x3e109d(++_0x5aac6c);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49c4('0xd')](_0x49c4('0xb'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);router[_0x49c4('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0x11')]);router['delete'](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x12')]);module[_0x49c4('0x13')]=router; \ No newline at end of file +var _0x3e74=['isAuthenticated','index','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./interval.controller','get'];(function(_0x22e8e1,_0x1ab69e){var _0xb156b=function(_0x1790c4){while(--_0x1790c4){_0x22e8e1['push'](_0x22e8e1['shift']());}};_0xb156b(++_0x1ab69e);}(_0x3e74,0x175));var _0x43e7=function(_0x18b36b,_0xb5d7ef){_0x18b36b=_0x18b36b-0x0;var _0x1a0d92=_0x3e74[_0x18b36b];return _0x1a0d92;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['getIntervals']);router[_0x43e7('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x43e7('0xb')](_0x43e7('0xa'),auth['isAuthenticated'](),controller[_0x43e7('0xc')]);router['post'](_0x43e7('0xd'),auth[_0x43e7('0x7')](),controller['addIntervals']);router[_0x43e7('0xe')](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);module[_0x43e7('0x12')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index f9869c2..846e449 100644 --- a/server/api/interval/interval.attributes.js +++ b/server/api/interval/interval.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc2c=['STRING','sequelize','exports'];(function(_0x2cd469,_0x1178ef){var _0x4dbf6=function(_0x4c200f){while(--_0x4c200f){_0x2cd469['push'](_0x2cd469['shift']());}};_0x4dbf6(++_0x1178ef);}(_0xcc2c,0xb2));var _0xccc2=function(_0x1ba60c,_0x3b10a3){_0x1ba60c=_0x1ba60c-0x0;var _0x43bb82=_0xcc2c[_0x1ba60c];return _0x43bb82;};'use strict';var Sequelize=require(_0xccc2('0x0'));module[_0xccc2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xccc2('0x2')]},'interval':{'type':Sequelize[_0xccc2('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xa8fd=['exports','STRING','sequelize'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0xa8fd,0x16d));var _0xda8f=function(_0x1bb4a3,_0x171605){_0x1bb4a3=_0x1bb4a3-0x0;var _0x3f146e=_0xa8fd[_0x1bb4a3];return _0x3f146e;};'use strict';var Sequelize=require(_0xda8f('0x0'));module[_0xda8f('0x1')]={'name':{'type':Sequelize[_0xda8f('0x2')]},'description':{'type':Sequelize[_0xda8f('0x2')]},'interval':{'type':Sequelize[_0xda8f('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index ea44369..7245324 100644 --- a/server/api/interval/interval.controller.js +++ b/server/api/interval/interval.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b31=['catch','params','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','getIntervals','findOne','sequelize','transaction','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../components/extensions/rewrite','sendStatus','status','json','offset','limit','set','apply','reject','save','destroy','get','Intervals','UserProfileResource','then','end','name','send','index','rawAttributes','model','keys','query','intersection','attributes','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options','Interval','count','includeAll','findAll','rows'];(function(_0x1eda88,_0x555454){var _0x2eb594=function(_0x250216){while(--_0x250216){_0x1eda88['push'](_0x1eda88['shift']());}};_0x2eb594(++_0x555454);}(_0x3b31,0x1c0));var _0x13b3=function(_0x52ced8,_0x4b5c48){_0x52ced8=_0x52ced8-0x0;var _0x3329b4=_0x3b31[_0x52ced8];return _0x3329b4;};'use strict';var pdf=require(_0x13b3('0x0'));var emlformat=require(_0x13b3('0x1'));var rimraf=require(_0x13b3('0x2'));var zipdir=require(_0x13b3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x13b3('0x4'));var moment=require(_0x13b3('0x5'));var BPromise=require(_0x13b3('0x6'));var Mustache=require('mustache');var util=require(_0x13b3('0x7'));var path=require(_0x13b3('0x8'));var sox=require(_0x13b3('0x9'));var csv=require(_0x13b3('0xa'));var ejs=require(_0x13b3('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x13b3('0xc'));var crypto=require(_0x13b3('0xd'));var jsforce=require(_0x13b3('0xe'));var deskjs=require(_0x13b3('0xf'));var toCsv=require(_0x13b3('0xa'));var querystring=require('querystring');var Papa=require(_0x13b3('0x10'));var Redis=require('ioredis');var authService=require(_0x13b3('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x13b3('0x12'));var logger=require(_0x13b3('0x13'))('api');var utils=require(_0x13b3('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var extensions=require(_0x13b3('0x15'));function respondWithStatusCode(_0x246199,_0x5dc2a1){_0x5dc2a1=_0x5dc2a1||0xcc;return function(_0xdd1d1d){if(_0xdd1d1d){return _0x246199[_0x13b3('0x16')](_0x5dc2a1);}return _0x246199[_0x13b3('0x17')](_0x5dc2a1)['end']();};}function respondWithResult(_0x386c1e,_0xa5bcd1){_0xa5bcd1=_0xa5bcd1||0xc8;return function(_0x4f7633){if(_0x4f7633){return _0x386c1e[_0x13b3('0x17')](_0xa5bcd1)[_0x13b3('0x18')](_0x4f7633);}};}function respondWithFilteredResult(_0x38d786,_0x5d0eeb){return function(_0x414779){if(_0x414779){var _0x1672c3=_0x414779['count'],_0x4c4cda=_0x5d0eeb[_0x13b3('0x19')],_0x35a917=_0x5d0eeb[_0x13b3('0x19')]+_0x5d0eeb[_0x13b3('0x1a')],_0x2539b9;if(_0x35a917>=_0x1672c3){_0x35a917=_0x1672c3;_0x2539b9=0xc8;}else{_0x2539b9=0xce;}_0x38d786[_0x13b3('0x17')](_0x2539b9);return _0x38d786[_0x13b3('0x1b')]('Content-Range',_0x4c4cda+'-'+_0x35a917+'/'+_0x1672c3)[_0x13b3('0x18')](_0x414779);}return null;};}function patchUpdates(_0x1a34eb){return function(_0x88aaa1){try{jsonpatch[_0x13b3('0x1c')](_0x88aaa1,_0x1a34eb,!![]);}catch(_0x1bd98b){return BPromise[_0x13b3('0x1d')](_0x1bd98b);}return _0x88aaa1[_0x13b3('0x1e')]();};}function saveUpdates(_0x35024a,_0x57c25c){return function(_0x31d907){if(_0x31d907){return _0x31d907['update'](_0x35024a)['then'](function(_0x1afa8f){return _0x1afa8f;});}return null;};}function removeEntity(_0x5b8ef7,_0x56a86a){return function(_0x42958f){if(_0x42958f){return _0x42958f[_0x13b3('0x1f')]()['then'](function(){var _0x106d3f=_0x42958f[_0x13b3('0x20')]({'plain':!![]});var _0x4f4d97=_0x13b3('0x21');return db[_0x13b3('0x22')][_0x13b3('0x1f')]({'where':{'type':_0x4f4d97,'resourceId':_0x106d3f['id']}})[_0x13b3('0x23')](function(){return _0x42958f;});})['then'](function(){_0x5b8ef7[_0x13b3('0x17')](0xcc)[_0x13b3('0x24')]();});}};}function handleEntityNotFound(_0x149b50,_0x2255b5){return function(_0x3d6e61){if(!_0x3d6e61){_0x149b50[_0x13b3('0x16')](0x194);}return _0x3d6e61;};}function handleError(_0x496bee,_0x45f2a3){_0x45f2a3=_0x45f2a3||0x1f4;return function(_0x4d5cc3){logger['error'](_0x4d5cc3['stack']);if(_0x4d5cc3[_0x13b3('0x25')]){delete _0x4d5cc3['name'];}_0x496bee['status'](_0x45f2a3)[_0x13b3('0x26')](_0x4d5cc3);};}exports[_0x13b3('0x27')]=function(_0x53199c,_0x101c5b){var _0x505ab6={},_0x32daed={},_0x3a970c={'count':0x0,'rows':[]};var _0x531fde=db['Interval'][_0x13b3('0x28')];_0x32daed[_0x13b3('0x29')]=_[_0x13b3('0x2a')](_0x531fde);_0x32daed[_0x13b3('0x2b')]=_[_0x13b3('0x2a')](_0x53199c[_0x13b3('0x2b')]);_0x32daed['filters']=_[_0x13b3('0x2c')](_0x32daed['model'],_0x32daed[_0x13b3('0x2b')]);_0x505ab6[_0x13b3('0x2d')]=_['intersection'](_0x32daed[_0x13b3('0x29')],qs['fields'](_0x53199c[_0x13b3('0x2b')]['fields']));_0x505ab6[_0x13b3('0x2d')]=_0x505ab6[_0x13b3('0x2d')]['length']?_0x505ab6[_0x13b3('0x2d')]:_0x32daed['model'];if(!_0x53199c[_0x13b3('0x2b')]['hasOwnProperty']('nolimit')){_0x505ab6['limit']=qs[_0x13b3('0x1a')](_0x53199c[_0x13b3('0x2b')]['limit']);_0x505ab6[_0x13b3('0x19')]=qs['offset'](_0x53199c[_0x13b3('0x2b')][_0x13b3('0x19')]);}_0x505ab6[_0x13b3('0x2e')]=qs[_0x13b3('0x2f')](_0x53199c[_0x13b3('0x2b')][_0x13b3('0x2f')]);_0x505ab6[_0x13b3('0x30')]=qs[_0x13b3('0x31')](_[_0x13b3('0x32')](_0x53199c[_0x13b3('0x2b')],_0x32daed[_0x13b3('0x31')]));if(_0x53199c[_0x13b3('0x2b')][_0x13b3('0x33')]){_0x505ab6[_0x13b3('0x30')]=_[_0x13b3('0x34')](_0x505ab6[_0x13b3('0x30')],{'$or':_[_0x13b3('0x35')](_0x531fde,function(_0x5b0c4f){if(_0x5b0c4f[_0x13b3('0x36')]['key']!==_0x13b3('0x37')){var _0x2b8154={};_0x2b8154[_0x5b0c4f['field']]={'$like':'%'+_0x53199c[_0x13b3('0x2b')][_0x13b3('0x33')]+'%'};return _0x2b8154;}})});}_0x505ab6=_[_0x13b3('0x34')]({},_0x505ab6,_0x53199c[_0x13b3('0x38')]);var _0xa03440={'where':_0x505ab6[_0x13b3('0x30')]};return db[_0x13b3('0x39')][_0x13b3('0x3a')](_0xa03440)[_0x13b3('0x23')](function(_0x7c3c17){_0x3a970c[_0x13b3('0x3a')]=_0x7c3c17;if(_0x53199c[_0x13b3('0x2b')][_0x13b3('0x3b')]){_0x505ab6['include']=[{'all':!![]}];}return db[_0x13b3('0x39')][_0x13b3('0x3c')](_0x505ab6);})[_0x13b3('0x23')](function(_0x43d53b){_0x3a970c[_0x13b3('0x3d')]=_0x43d53b;return _0x3a970c;})[_0x13b3('0x23')](respondWithFilteredResult(_0x101c5b,_0x505ab6))[_0x13b3('0x3e')](handleError(_0x101c5b,null));};exports['show']=function(_0x43d28e,_0x523903){var _0x133162={'raw':!![],'where':{'id':_0x43d28e[_0x13b3('0x3f')]['id']}},_0x5dec74={};_0x5dec74['model']=_['keys'](db[_0x13b3('0x39')][_0x13b3('0x28')]);_0x5dec74[_0x13b3('0x2b')]=_['keys'](_0x43d28e['query']);_0x5dec74[_0x13b3('0x31')]=_[_0x13b3('0x2c')](_0x5dec74[_0x13b3('0x29')],_0x5dec74[_0x13b3('0x2b')]);_0x133162[_0x13b3('0x2d')]=_[_0x13b3('0x2c')](_0x5dec74['model'],qs[_0x13b3('0x40')](_0x43d28e[_0x13b3('0x2b')][_0x13b3('0x40')]));_0x133162[_0x13b3('0x2d')]=_0x133162[_0x13b3('0x2d')][_0x13b3('0x41')]?_0x133162[_0x13b3('0x2d')]:_0x5dec74[_0x13b3('0x29')];if(_0x43d28e['query'][_0x13b3('0x3b')]){_0x133162['include']=[{'all':!![]}];}_0x133162=_[_0x13b3('0x34')]({},_0x133162,_0x43d28e[_0x13b3('0x38')]);return db[_0x13b3('0x39')][_0x13b3('0x42')](_0x133162)[_0x13b3('0x23')](handleEntityNotFound(_0x523903,null))[_0x13b3('0x23')](respondWithResult(_0x523903,null))['catch'](handleError(_0x523903,null));};exports['create']=function(_0x56cdc9,_0x34713b){return db[_0x13b3('0x39')][_0x13b3('0x43')](_0x56cdc9[_0x13b3('0x44')],{})[_0x13b3('0x23')](function(_0x1518a2){var _0x4e85d2=_0x56cdc9[_0x13b3('0x45')][_0x13b3('0x20')]({'plain':!![]});if(!_0x4e85d2)throw new Error(_0x13b3('0x46'));if(_0x4e85d2[_0x13b3('0x47')]===_0x13b3('0x45')){var _0x21717e=_0x1518a2[_0x13b3('0x20')]({'plain':!![]});var _0x38bf71='Intervals';return db[_0x13b3('0x48')][_0x13b3('0x42')]({'where':{'name':_0x38bf71,'userProfileId':_0x4e85d2[_0x13b3('0x49')]},'raw':!![]})[_0x13b3('0x23')](function(_0x47b97b){if(_0x47b97b&&_0x47b97b[_0x13b3('0x4a')]===0x0){return db[_0x13b3('0x22')][_0x13b3('0x43')]({'name':_0x21717e[_0x13b3('0x25')],'resourceId':_0x21717e['id'],'type':_0x47b97b[_0x13b3('0x25')],'sectionId':_0x47b97b['id']},{})[_0x13b3('0x23')](function(){return _0x1518a2;});}else{return _0x1518a2;}})[_0x13b3('0x3e')](function(_0x57f12f){logger[_0x13b3('0x4b')](_0x13b3('0x4c'),_0x57f12f);throw _0x57f12f;});}return _0x1518a2;})[_0x13b3('0x23')](respondWithResult(_0x34713b,0xc9))[_0x13b3('0x3e')](handleError(_0x34713b,null));};exports[_0x13b3('0x4d')]=function(_0xf58de2,_0x31b743){if(_0xf58de2[_0x13b3('0x44')]['id']){delete _0xf58de2['body']['id'];}return db[_0x13b3('0x39')][_0x13b3('0x42')]({'where':{'id':_0xf58de2['params']['id']}})[_0x13b3('0x23')](handleEntityNotFound(_0x31b743,null))[_0x13b3('0x23')](saveUpdates(_0xf58de2[_0x13b3('0x44')],null))[_0x13b3('0x23')](respondWithResult(_0x31b743,null))['catch'](handleError(_0x31b743,null));};exports[_0x13b3('0x1f')]=function(_0x58fb68,_0x1fbb25){return db['Interval']['find']({'where':{'id':_0x58fb68['params']['id']}})[_0x13b3('0x23')](handleEntityNotFound(_0x1fbb25,null))['then'](removeEntity(_0x1fbb25,null))[_0x13b3('0x3e')](handleError(_0x1fbb25,null));};exports[_0x13b3('0x4e')]=function(_0x19185d,_0x23349a,_0x2cc7ba){if(_0x19185d[_0x13b3('0x44')]['id']){delete _0x19185d[_0x13b3('0x44')]['id'];}return db[_0x13b3('0x39')][_0x13b3('0x42')]({'where':{'id':_0x19185d['params']['id']}})[_0x13b3('0x23')](handleEntityNotFound(_0x23349a,null))[_0x13b3('0x23')](function(_0x510785){if(_0x510785){_0x19185d['body'][_0x13b3('0x4f')]=_0x510785['id'];return db[_0x13b3('0x39')][_0x13b3('0x43')](_0x19185d['body']);}})['then'](respondWithResult(_0x23349a,null))[_0x13b3('0x3e')](handleError(_0x23349a,null));};exports[_0x13b3('0x50')]=function(_0x3ced9,_0x554969,_0x137f45){var _0x5ec0ce={};var _0x16cc10={};var _0x5b23c0;var _0x28ee7d;return db[_0x13b3('0x39')]['findOne']({'where':{'id':_0x3ced9[_0x13b3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x554969,null))[_0x13b3('0x23')](function(_0x333fd7){if(_0x333fd7){_0x5b23c0=_0x333fd7;_0x16cc10[_0x13b3('0x29')]=_['keys'](db['Interval'][_0x13b3('0x28')]);_0x16cc10[_0x13b3('0x2b')]=_['keys'](_0x3ced9[_0x13b3('0x2b')]);_0x16cc10[_0x13b3('0x31')]=_[_0x13b3('0x2c')](_0x16cc10[_0x13b3('0x29')],_0x16cc10[_0x13b3('0x2b')]);_0x5ec0ce[_0x13b3('0x2d')]=_[_0x13b3('0x2c')](_0x16cc10[_0x13b3('0x29')],qs['fields'](_0x3ced9[_0x13b3('0x2b')][_0x13b3('0x40')]));_0x5ec0ce[_0x13b3('0x2d')]=_0x5ec0ce[_0x13b3('0x2d')][_0x13b3('0x41')]?_0x5ec0ce[_0x13b3('0x2d')]:_0x16cc10[_0x13b3('0x29')];_0x5ec0ce[_0x13b3('0x2e')]=qs[_0x13b3('0x2f')](_0x3ced9[_0x13b3('0x2b')]['sort']);_0x5ec0ce[_0x13b3('0x30')]=qs[_0x13b3('0x31')](_[_0x13b3('0x32')](_0x3ced9[_0x13b3('0x2b')],_0x16cc10[_0x13b3('0x31')]));if(_0x3ced9[_0x13b3('0x2b')]['filter']){_0x5ec0ce['where']=_[_0x13b3('0x34')](_0x5ec0ce[_0x13b3('0x30')],{'$or':_[_0x13b3('0x35')](_0x5ec0ce['attributes'],function(_0x19a03a){var _0x20ad16={};_0x20ad16[_0x19a03a]={'$like':'%'+_0x3ced9[_0x13b3('0x2b')][_0x13b3('0x33')]+'%'};return _0x20ad16;})});}_0x5ec0ce=_['merge']({},_0x5ec0ce,_0x3ced9[_0x13b3('0x38')]);return _0x5b23c0[_0x13b3('0x50')](_0x5ec0ce);}})['then'](function(_0x2ffc67){if(_0x2ffc67){_0x28ee7d=_0x2ffc67[_0x13b3('0x41')];if(!_0x3ced9[_0x13b3('0x2b')]['hasOwnProperty']('nolimit')){_0x5ec0ce[_0x13b3('0x1a')]=qs[_0x13b3('0x1a')](_0x3ced9[_0x13b3('0x2b')][_0x13b3('0x1a')]);_0x5ec0ce[_0x13b3('0x19')]=qs[_0x13b3('0x19')](_0x3ced9['query'][_0x13b3('0x19')]);}return _0x5b23c0[_0x13b3('0x50')](_0x5ec0ce);}})[_0x13b3('0x23')](function(_0x533ce3){if(_0x533ce3){return _0x533ce3?{'count':_0x28ee7d,'rows':_0x533ce3}:null;}})[_0x13b3('0x23')](respondWithResult(_0x554969,null))[_0x13b3('0x3e')](handleError(_0x554969,null));};exports['addIntervals']=function(_0x5bbfa5,_0x360941,_0x2de7a7){return db[_0x13b3('0x39')][_0x13b3('0x51')]({'where':{'id':_0x5bbfa5[_0x13b3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x360941,null))[_0x13b3('0x23')](function(_0x49d801){if(_0x49d801){return db[_0x13b3('0x52')][_0x13b3('0x53')](function(_0x40c1d7){return db['Interval']['destroy']({'where':{'IntervalId':_0x5bbfa5[_0x13b3('0x3f')]['id']},'transaction':_0x40c1d7})[_0x13b3('0x23')](function(_0x1daf5e){var _0x37a29d=_['map'](_0x5bbfa5[_0x13b3('0x44')],function(_0x469e46){delete _0x469e46['id'];_0x469e46[_0x13b3('0x4f')]=_0x5bbfa5[_0x13b3('0x3f')]['id'];return _0x469e46;});return db['Interval'][_0x13b3('0x54')](_0x37a29d,{'transaction':_0x40c1d7});});})['then'](function(){return db[_0x13b3('0x39')][_0x13b3('0x3c')]({'where':{'IntervalId':_0x5bbfa5[_0x13b3('0x3f')]['id']}});});}})[_0x13b3('0x23')](respondWithResult(_0x360941,null))['catch'](handleError(_0x360941,null));}; \ No newline at end of file +var _0x3b23=['end','status','json','count','offset','limit','set','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','Interval','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','rawAttributes','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','params','addInterval','IntervalId','getIntervals','findOne','sort','addIntervals','transaction','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus'];(function(_0x2d3ab3,_0x47d90b){var _0x321f9e=function(_0x50a53d){while(--_0x50a53d){_0x2d3ab3['push'](_0x2d3ab3['shift']());}};_0x321f9e(++_0x47d90b);}(_0x3b23,0x99));var _0x33b2=function(_0x3ba367,_0x2ed555){_0x3ba367=_0x3ba367-0x0;var _0x3d7f4b=_0x3b23[_0x3ba367];return _0x3d7f4b;};'use strict';var pdf=require(_0x33b2('0x0'));var emlformat=require(_0x33b2('0x1'));var rimraf=require(_0x33b2('0x2'));var zipdir=require(_0x33b2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x33b2('0x4'));var moment=require(_0x33b2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x33b2('0x6'));var path=require(_0x33b2('0x7'));var sox=require(_0x33b2('0x8'));var csv=require(_0x33b2('0x9'));var ejs=require(_0x33b2('0xa'));var fs=require('fs');var _=require(_0x33b2('0xb'));var squel=require(_0x33b2('0xc'));var crypto=require(_0x33b2('0xd'));var jsforce=require(_0x33b2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x33b2('0x9'));var querystring=require('querystring');var Papa=require(_0x33b2('0xf'));var Redis=require(_0x33b2('0x10'));var authService=require(_0x33b2('0x11'));var qs=require(_0x33b2('0x12'));var hardwareService=require(_0x33b2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x33b2('0x14'));var config=require(_0x33b2('0x15'));var db=require(_0x33b2('0x16'))['db'];var extensions=require(_0x33b2('0x17'));function respondWithStatusCode(_0x509e18,_0x44d23e){_0x44d23e=_0x44d23e||0xcc;return function(_0x52baa2){if(_0x52baa2){return _0x509e18[_0x33b2('0x18')](_0x44d23e);}return _0x509e18['status'](_0x44d23e)[_0x33b2('0x19')]();};}function respondWithResult(_0x4e14f0,_0x416331){_0x416331=_0x416331||0xc8;return function(_0x55fc91){if(_0x55fc91){return _0x4e14f0[_0x33b2('0x1a')](_0x416331)[_0x33b2('0x1b')](_0x55fc91);}};}function respondWithFilteredResult(_0xd9ae93,_0x47de80){return function(_0x9ba04d){if(_0x9ba04d){var _0x4bc518=_0x9ba04d[_0x33b2('0x1c')],_0x2759c8=_0x47de80['offset'],_0x4747ef=_0x47de80[_0x33b2('0x1d')]+_0x47de80[_0x33b2('0x1e')],_0xdc0546;if(_0x4747ef>=_0x4bc518){_0x4747ef=_0x4bc518;_0xdc0546=0xc8;}else{_0xdc0546=0xce;}_0xd9ae93[_0x33b2('0x1a')](_0xdc0546);return _0xd9ae93[_0x33b2('0x1f')]('Content-Range',_0x2759c8+'-'+_0x4747ef+'/'+_0x4bc518)['json'](_0x9ba04d);}return null;};}function patchUpdates(_0x3effc7){return function(_0x1e200d){try{jsonpatch[_0x33b2('0x20')](_0x1e200d,_0x3effc7,!![]);}catch(_0x5bf4c0){return BPromise[_0x33b2('0x21')](_0x5bf4c0);}return _0x1e200d[_0x33b2('0x22')]();};}function saveUpdates(_0x4f2a5e,_0x34cf53){return function(_0xb42c71){if(_0xb42c71){return _0xb42c71['update'](_0x4f2a5e)[_0x33b2('0x23')](function(_0x5a5560){return _0x5a5560;});}return null;};}function removeEntity(_0x5d84e3,_0x3918a9){return function(_0x2df294){if(_0x2df294){return _0x2df294[_0x33b2('0x24')]()[_0x33b2('0x23')](function(){var _0x150e67=_0x2df294[_0x33b2('0x25')]({'plain':!![]});var _0x1a4e1b='Intervals';return db[_0x33b2('0x26')][_0x33b2('0x24')]({'where':{'type':_0x1a4e1b,'resourceId':_0x150e67['id']}})['then'](function(){return _0x2df294;});})[_0x33b2('0x23')](function(){_0x5d84e3['status'](0xcc)[_0x33b2('0x19')]();});}};}function handleEntityNotFound(_0x26bab7,_0x372565){return function(_0x2b652a){if(!_0x2b652a){_0x26bab7['sendStatus'](0x194);}return _0x2b652a;};}function handleError(_0x230b3b,_0x3e6a3a){_0x3e6a3a=_0x3e6a3a||0x1f4;return function(_0x1f46ef){logger[_0x33b2('0x27')](_0x1f46ef[_0x33b2('0x28')]);if(_0x1f46ef[_0x33b2('0x29')]){delete _0x1f46ef[_0x33b2('0x29')];}_0x230b3b[_0x33b2('0x1a')](_0x3e6a3a)['send'](_0x1f46ef);};}exports['index']=function(_0x4980ee,_0x141708){var _0x59eea0={},_0x409d50={},_0x28bbc2={'count':0x0,'rows':[]};var _0x46319f=db[_0x33b2('0x2a')]['rawAttributes'];_0x409d50[_0x33b2('0x2b')]=_[_0x33b2('0x2c')](_0x46319f);_0x409d50[_0x33b2('0x2d')]=_['keys'](_0x4980ee['query']);_0x409d50[_0x33b2('0x2e')]=_[_0x33b2('0x2f')](_0x409d50[_0x33b2('0x2b')],_0x409d50[_0x33b2('0x2d')]);_0x59eea0[_0x33b2('0x30')]=_[_0x33b2('0x2f')](_0x409d50[_0x33b2('0x2b')],qs[_0x33b2('0x31')](_0x4980ee[_0x33b2('0x2d')][_0x33b2('0x31')]));_0x59eea0[_0x33b2('0x30')]=_0x59eea0[_0x33b2('0x30')][_0x33b2('0x32')]?_0x59eea0['attributes']:_0x409d50[_0x33b2('0x2b')];if(!_0x4980ee[_0x33b2('0x2d')][_0x33b2('0x33')](_0x33b2('0x34'))){_0x59eea0['limit']=qs[_0x33b2('0x1e')](_0x4980ee['query']['limit']);_0x59eea0[_0x33b2('0x1d')]=qs[_0x33b2('0x1d')](_0x4980ee[_0x33b2('0x2d')]['offset']);}_0x59eea0[_0x33b2('0x35')]=qs['sort'](_0x4980ee['query']['sort']);_0x59eea0['where']=qs[_0x33b2('0x2e')](_[_0x33b2('0x36')](_0x4980ee[_0x33b2('0x2d')],_0x409d50[_0x33b2('0x2e')]));if(_0x4980ee[_0x33b2('0x2d')][_0x33b2('0x37')]){_0x59eea0[_0x33b2('0x38')]=_[_0x33b2('0x39')](_0x59eea0['where'],{'$or':_[_0x33b2('0x3a')](_0x46319f,function(_0x372456){if(_0x372456[_0x33b2('0x3b')][_0x33b2('0x3c')]!==_0x33b2('0x3d')){var _0x5e5042={};_0x5e5042[_0x372456[_0x33b2('0x3e')]]={'$like':'%'+_0x4980ee[_0x33b2('0x2d')][_0x33b2('0x37')]+'%'};return _0x5e5042;}})});}_0x59eea0=_[_0x33b2('0x39')]({},_0x59eea0,_0x4980ee[_0x33b2('0x3f')]);var _0x4b7de9={'where':_0x59eea0['where']};return db[_0x33b2('0x2a')][_0x33b2('0x1c')](_0x4b7de9)[_0x33b2('0x23')](function(_0x56f337){_0x28bbc2[_0x33b2('0x1c')]=_0x56f337;if(_0x4980ee['query'][_0x33b2('0x40')]){_0x59eea0[_0x33b2('0x41')]=[{'all':!![]}];}return db[_0x33b2('0x2a')][_0x33b2('0x42')](_0x59eea0);})[_0x33b2('0x23')](function(_0x5250ee){_0x28bbc2[_0x33b2('0x43')]=_0x5250ee;return _0x28bbc2;})[_0x33b2('0x23')](respondWithFilteredResult(_0x141708,_0x59eea0))['catch'](handleError(_0x141708,null));};exports['show']=function(_0x501144,_0x3376ba){var _0x4752f9={'raw':!![],'where':{'id':_0x501144['params']['id']}},_0x2ac6cd={};_0x2ac6cd['model']=_['keys'](db[_0x33b2('0x2a')][_0x33b2('0x44')]);_0x2ac6cd[_0x33b2('0x2d')]=_[_0x33b2('0x2c')](_0x501144[_0x33b2('0x2d')]);_0x2ac6cd[_0x33b2('0x2e')]=_['intersection'](_0x2ac6cd[_0x33b2('0x2b')],_0x2ac6cd[_0x33b2('0x2d')]);_0x4752f9[_0x33b2('0x30')]=_[_0x33b2('0x2f')](_0x2ac6cd['model'],qs['fields'](_0x501144[_0x33b2('0x2d')][_0x33b2('0x31')]));_0x4752f9[_0x33b2('0x30')]=_0x4752f9[_0x33b2('0x30')][_0x33b2('0x32')]?_0x4752f9[_0x33b2('0x30')]:_0x2ac6cd['model'];if(_0x501144[_0x33b2('0x2d')][_0x33b2('0x40')]){_0x4752f9[_0x33b2('0x41')]=[{'all':!![]}];}_0x4752f9=_[_0x33b2('0x39')]({},_0x4752f9,_0x501144[_0x33b2('0x3f')]);return db['Interval'][_0x33b2('0x45')](_0x4752f9)[_0x33b2('0x23')](handleEntityNotFound(_0x3376ba,null))[_0x33b2('0x23')](respondWithResult(_0x3376ba,null))[_0x33b2('0x46')](handleError(_0x3376ba,null));};exports['create']=function(_0x25cb9d,_0x3827ea){return db[_0x33b2('0x2a')][_0x33b2('0x47')](_0x25cb9d['body'],{})[_0x33b2('0x23')](function(_0x4e3a27){var _0x45f584=_0x25cb9d[_0x33b2('0x48')][_0x33b2('0x25')]({'plain':!![]});if(!_0x45f584)throw new Error(_0x33b2('0x49'));if(_0x45f584[_0x33b2('0x4a')]===_0x33b2('0x48')){var _0x4d7089=_0x4e3a27[_0x33b2('0x25')]({'plain':!![]});var _0x9f4d71='Intervals';return db[_0x33b2('0x4b')][_0x33b2('0x45')]({'where':{'name':_0x9f4d71,'userProfileId':_0x45f584[_0x33b2('0x4c')]},'raw':!![]})[_0x33b2('0x23')](function(_0x309aac){if(_0x309aac&&_0x309aac[_0x33b2('0x4d')]===0x0){return db[_0x33b2('0x26')][_0x33b2('0x47')]({'name':_0x4d7089[_0x33b2('0x29')],'resourceId':_0x4d7089['id'],'type':_0x309aac[_0x33b2('0x29')],'sectionId':_0x309aac['id']},{})[_0x33b2('0x23')](function(){return _0x4e3a27;});}else{return _0x4e3a27;}})['catch'](function(_0xde548f){logger[_0x33b2('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xde548f);throw _0xde548f;});}return _0x4e3a27;})[_0x33b2('0x23')](respondWithResult(_0x3827ea,0xc9))[_0x33b2('0x46')](handleError(_0x3827ea,null));};exports[_0x33b2('0x4e')]=function(_0x3e1ce2,_0x1a14a3){if(_0x3e1ce2[_0x33b2('0x4f')]['id']){delete _0x3e1ce2[_0x33b2('0x4f')]['id'];}return db[_0x33b2('0x2a')]['find']({'where':{'id':_0x3e1ce2[_0x33b2('0x50')]['id']}})[_0x33b2('0x23')](handleEntityNotFound(_0x1a14a3,null))['then'](saveUpdates(_0x3e1ce2['body'],null))['then'](respondWithResult(_0x1a14a3,null))[_0x33b2('0x46')](handleError(_0x1a14a3,null));};exports[_0x33b2('0x24')]=function(_0x5d388b,_0x29e6a8){return db[_0x33b2('0x2a')][_0x33b2('0x45')]({'where':{'id':_0x5d388b[_0x33b2('0x50')]['id']}})['then'](handleEntityNotFound(_0x29e6a8,null))[_0x33b2('0x23')](removeEntity(_0x29e6a8,null))[_0x33b2('0x46')](handleError(_0x29e6a8,null));};exports[_0x33b2('0x51')]=function(_0x14d351,_0x4595a2,_0x2cbf34){if(_0x14d351[_0x33b2('0x4f')]['id']){delete _0x14d351['body']['id'];}return db[_0x33b2('0x2a')]['find']({'where':{'id':_0x14d351[_0x33b2('0x50')]['id']}})['then'](handleEntityNotFound(_0x4595a2,null))[_0x33b2('0x23')](function(_0x25226f){if(_0x25226f){_0x14d351[_0x33b2('0x4f')][_0x33b2('0x52')]=_0x25226f['id'];return db[_0x33b2('0x2a')]['create'](_0x14d351[_0x33b2('0x4f')]);}})[_0x33b2('0x23')](respondWithResult(_0x4595a2,null))[_0x33b2('0x46')](handleError(_0x4595a2,null));};exports[_0x33b2('0x53')]=function(_0x2da35e,_0x9888d4,_0x1d7603){var _0x3f88df={};var _0x2634de={};var _0x41b4d8;var _0x4e9c6e;return db[_0x33b2('0x2a')][_0x33b2('0x54')]({'where':{'id':_0x2da35e[_0x33b2('0x50')]['id']}})[_0x33b2('0x23')](handleEntityNotFound(_0x9888d4,null))[_0x33b2('0x23')](function(_0x10013b){if(_0x10013b){_0x41b4d8=_0x10013b;_0x2634de[_0x33b2('0x2b')]=_[_0x33b2('0x2c')](db[_0x33b2('0x2a')][_0x33b2('0x44')]);_0x2634de[_0x33b2('0x2d')]=_[_0x33b2('0x2c')](_0x2da35e[_0x33b2('0x2d')]);_0x2634de[_0x33b2('0x2e')]=_[_0x33b2('0x2f')](_0x2634de[_0x33b2('0x2b')],_0x2634de[_0x33b2('0x2d')]);_0x3f88df['attributes']=_['intersection'](_0x2634de[_0x33b2('0x2b')],qs[_0x33b2('0x31')](_0x2da35e['query'][_0x33b2('0x31')]));_0x3f88df['attributes']=_0x3f88df[_0x33b2('0x30')][_0x33b2('0x32')]?_0x3f88df[_0x33b2('0x30')]:_0x2634de['model'];_0x3f88df[_0x33b2('0x35')]=qs[_0x33b2('0x55')](_0x2da35e[_0x33b2('0x2d')][_0x33b2('0x55')]);_0x3f88df[_0x33b2('0x38')]=qs['filters'](_[_0x33b2('0x36')](_0x2da35e[_0x33b2('0x2d')],_0x2634de['filters']));if(_0x2da35e[_0x33b2('0x2d')]['filter']){_0x3f88df[_0x33b2('0x38')]=_[_0x33b2('0x39')](_0x3f88df[_0x33b2('0x38')],{'$or':_[_0x33b2('0x3a')](_0x3f88df[_0x33b2('0x30')],function(_0x1ed300){var _0x33d74e={};_0x33d74e[_0x1ed300]={'$like':'%'+_0x2da35e[_0x33b2('0x2d')]['filter']+'%'};return _0x33d74e;})});}_0x3f88df=_['merge']({},_0x3f88df,_0x2da35e[_0x33b2('0x3f')]);return _0x41b4d8['getIntervals'](_0x3f88df);}})[_0x33b2('0x23')](function(_0x45c2e1){if(_0x45c2e1){_0x4e9c6e=_0x45c2e1[_0x33b2('0x32')];if(!_0x2da35e['query'][_0x33b2('0x33')](_0x33b2('0x34'))){_0x3f88df[_0x33b2('0x1e')]=qs[_0x33b2('0x1e')](_0x2da35e[_0x33b2('0x2d')]['limit']);_0x3f88df['offset']=qs[_0x33b2('0x1d')](_0x2da35e[_0x33b2('0x2d')][_0x33b2('0x1d')]);}return _0x41b4d8[_0x33b2('0x53')](_0x3f88df);}})[_0x33b2('0x23')](function(_0x39b21c){if(_0x39b21c){return _0x39b21c?{'count':_0x4e9c6e,'rows':_0x39b21c}:null;}})[_0x33b2('0x23')](respondWithResult(_0x9888d4,null))[_0x33b2('0x46')](handleError(_0x9888d4,null));};exports[_0x33b2('0x56')]=function(_0x50eb04,_0x22463e,_0x4da987){return db[_0x33b2('0x2a')][_0x33b2('0x54')]({'where':{'id':_0x50eb04[_0x33b2('0x50')]['id']}})['then'](handleEntityNotFound(_0x22463e,null))[_0x33b2('0x23')](function(_0x4790f2){if(_0x4790f2){return db['sequelize'][_0x33b2('0x57')](function(_0x5458ea){return db[_0x33b2('0x2a')]['destroy']({'where':{'IntervalId':_0x50eb04[_0x33b2('0x50')]['id']},'transaction':_0x5458ea})[_0x33b2('0x23')](function(_0x44409e){var _0x239df2=_[_0x33b2('0x3a')](_0x50eb04['body'],function(_0x366188){delete _0x366188['id'];_0x366188[_0x33b2('0x52')]=_0x50eb04[_0x33b2('0x50')]['id'];return _0x366188;});return db[_0x33b2('0x2a')][_0x33b2('0x58')](_0x239df2,{'transaction':_0x5458ea});});})[_0x33b2('0x23')](function(){return db[_0x33b2('0x2a')][_0x33b2('0x42')]({'where':{'IntervalId':_0x50eb04[_0x33b2('0x50')]['id']}});});}})[_0x33b2('0x23')](respondWithResult(_0x22463e,null))[_0x33b2('0x46')](handleError(_0x22463e,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 00f33db..29808a6 100644 --- a/server/api/interval/interval.model.js +++ b/server/api/interval/interval.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb3e=['tools_intervals','rewrite','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/extensions/rewrite','define','Interval'];(function(_0x562456,_0x9ad741){var _0x46d4a9=function(_0x3e9f18){while(--_0x3e9f18){_0x562456['push'](_0x562456['shift']());}};_0x46d4a9(++_0x9ad741);}(_0xeb3e,0x106));var _0xeeb3=function(_0x1565a0,_0x34fca3){_0x1565a0=_0x1565a0-0x0;var _0x15271b=_0xeb3e[_0x1565a0];return _0x15271b;};'use strict';var _=require('lodash');var util=require(_0xeeb3('0x0'));var logger=require(_0xeeb3('0x1'))(_0xeeb3('0x2'));var moment=require(_0xeeb3('0x3'));var BPromise=require(_0xeeb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeeb3('0x5'));var rimraf=require(_0xeeb3('0x6'));var config=require(_0xeeb3('0x7'));var attributes=require('./interval.attributes');var extensions=require(_0xeeb3('0x8'));module['exports']=function(_0x19005a,_0x93c82b){return _0x19005a[_0xeeb3('0x9')](_0xeeb3('0xa'),attributes,{'tableName':_0xeeb3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x959ad3,_0x44b46b){extensions['rewrite'](_0x19005a,_0x959ad3);},'afterBulkCreate':function(_0x5b751a,_0x289444,_0x3a9542){_0x3a9542();extensions[_0xeeb3('0xc')](_0x19005a,_0x5b751a[0x0]);},'afterUpdate':function(_0x5b885a,_0x3e8d18){extensions['rewrite'](_0x19005a,_0x5b885a);},'afterDestroy':function(_0x485272,_0x79d78a){extensions[_0xeeb3('0xc')](_0x19005a,_0x485272);}}});}; \ No newline at end of file +var _0x9234=['define','Interval','rewrite','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./interval.attributes','../../components/extensions/rewrite','exports'];(function(_0x39fccf,_0x2367ba){var _0x5d89e7=function(_0x197b0a){while(--_0x197b0a){_0x39fccf['push'](_0x39fccf['shift']());}};_0x5d89e7(++_0x2367ba);}(_0x9234,0x1bd));var _0x4923=function(_0xea6018,_0x4cf082){_0xea6018=_0xea6018-0x0;var _0x57b54d=_0x9234[_0xea6018];return _0x57b54d;};'use strict';var _=require(_0x4923('0x0'));var util=require('util');var logger=require(_0x4923('0x1'))(_0x4923('0x2'));var moment=require(_0x4923('0x3'));var BPromise=require(_0x4923('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4923('0x5'));var rimraf=require(_0x4923('0x6'));var config=require('../../config/environment');var attributes=require(_0x4923('0x7'));var extensions=require(_0x4923('0x8'));module[_0x4923('0x9')]=function(_0x3c5e3f,_0x17b854){return _0x3c5e3f[_0x4923('0xa')](_0x4923('0xb'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fffc2,_0x590bb6){extensions[_0x4923('0xc')](_0x3c5e3f,_0x1fffc2);},'afterBulkCreate':function(_0x2c4057,_0x5acc16,_0x57a571){_0x57a571();extensions[_0x4923('0xc')](_0x3c5e3f,_0x2c4057[0x0]);},'afterUpdate':function(_0x45493c,_0x4281c5){extensions[_0x4923('0xc')](_0x3c5e3f,_0x45493c);},'afterDestroy':function(_0x35d9a8,_0x3047a4){extensions[_0x4923('0xc')](_0x3c5e3f,_0x35d9a8);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index f929d22..7289aa7 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca6d=['../../config/environment','jayson/promise','client','http','request','then','Interval,\x20%s,\x20%s','Interval,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetInterval','Interval','findAll','options','raw','limit','include','map','model','attributes','catch','ShowInterval','find','where','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x289393,_0x527132){var _0x9ee814=function(_0x257750){while(--_0x257750){_0x289393['push'](_0x289393['shift']());}};_0x9ee814(++_0x527132);}(_0xca6d,0x102));var _0xdca6=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0xca6d[_0x2891d1];return _0x486948;};'use strict';var _=require(_0xdca6('0x0'));var util=require(_0xdca6('0x1'));var moment=require('moment');var BPromise=require(_0xdca6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdca6('0x3'));var db=require(_0xdca6('0x4'))['db'];var utils=require(_0xdca6('0x5'));var logger=require(_0xdca6('0x6'))(_0xdca6('0x7'));var config=require(_0xdca6('0x8'));var jayson=require(_0xdca6('0x9'));var client=jayson[_0xdca6('0xa')][_0xdca6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24f669,_0x2de012,_0x59b6e7){return new BPromise(function(_0x31f10a,_0xafd5fa){return client[_0xdca6('0xc')](_0x24f669,_0x59b6e7)[_0xdca6('0xd')](function(_0x5ff2c){logger['info'](_0xdca6('0xe'),_0x2de012,'request\x20sent');logger['debug'](_0xdca6('0xf'),_0x2de012,_0xdca6('0x10'),JSON[_0xdca6('0x11')](_0x5ff2c));if(_0x5ff2c[_0xdca6('0x12')]){if(_0x5ff2c['error'][_0xdca6('0x13')]===0x1f4){logger[_0xdca6('0x12')](_0xdca6('0xe'),_0x2de012,_0x5ff2c[_0xdca6('0x12')]['message']);return _0xafd5fa(_0x5ff2c[_0xdca6('0x12')]['message']);}logger[_0xdca6('0x12')](_0xdca6('0xe'),_0x2de012,_0x5ff2c[_0xdca6('0x12')]['message']);return _0x31f10a(_0x5ff2c[_0xdca6('0x12')][_0xdca6('0x14')]);}else{logger[_0xdca6('0x15')](_0xdca6('0xe'),_0x2de012,_0xdca6('0x10'));_0x31f10a(_0x5ff2c[_0xdca6('0x16')][_0xdca6('0x14')]);}})['catch'](function(_0x4b9219){logger[_0xdca6('0x12')]('Interval,\x20%s,\x20%s',_0x2de012,_0x4b9219);_0xafd5fa(_0x4b9219);});});}exports[_0xdca6('0x17')]=function(_0x70b42a){var _0x48564a=this;return new Promise(function(_0xb85176,_0x527a95){return db[_0xdca6('0x18')][_0xdca6('0x19')]({'raw':_0x70b42a[_0xdca6('0x1a')]?_0x70b42a[_0xdca6('0x1a')][_0xdca6('0x1b')]===undefined?!![]:![]:!![],'where':_0x70b42a[_0xdca6('0x1a')]?_0x70b42a['options']['where']||null:null,'attributes':_0x70b42a[_0xdca6('0x1a')]?_0x70b42a[_0xdca6('0x1a')]['attributes']||null:null,'limit':_0x70b42a[_0xdca6('0x1a')]?_0x70b42a[_0xdca6('0x1a')][_0xdca6('0x1c')]||null:null,'include':_0x70b42a[_0xdca6('0x1a')]?_0x70b42a[_0xdca6('0x1a')][_0xdca6('0x1d')]?_[_0xdca6('0x1e')](_0x70b42a[_0xdca6('0x1a')][_0xdca6('0x1d')],function(_0x593288){return{'model':db[_0x593288[_0xdca6('0x1f')]],'as':_0x593288['as'],'attributes':_0x593288[_0xdca6('0x20')],'include':_0x593288[_0xdca6('0x1d')]?_[_0xdca6('0x1e')](_0x593288['include'],function(_0x2fddab){return{'model':db[_0x2fddab[_0xdca6('0x1f')]],'as':_0x2fddab['as'],'attributes':_0x2fddab[_0xdca6('0x20')],'include':_0x2fddab[_0xdca6('0x1d')]?_['map'](_0x2fddab[_0xdca6('0x1d')],function(_0x1c2562){return{'model':db[_0x1c2562['model']],'as':_0x1c2562['as'],'attributes':_0x1c2562[_0xdca6('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdca6('0xd')](function(_0x5319ba){logger[_0xdca6('0x15')](_0xdca6('0x17'),_0x70b42a);logger['debug'](_0xdca6('0x17'),_0x70b42a,JSON[_0xdca6('0x11')](_0x5319ba));_0xb85176(_0x5319ba);})[_0xdca6('0x21')](function(_0x30ca92){logger[_0xdca6('0x12')](_0xdca6('0x17'),_0x30ca92['message'],_0x70b42a);_0x527a95(_0x48564a[_0xdca6('0x12')](0x1f4,_0x30ca92[_0xdca6('0x14')]));});});};exports[_0xdca6('0x22')]=function(_0x41129a){var _0x2e67a1=this;return new Promise(function(_0x3a70a6,_0x4b55a3){return db[_0xdca6('0x18')][_0xdca6('0x23')]({'raw':_0x41129a['options']?_0x41129a[_0xdca6('0x1a')][_0xdca6('0x1b')]===undefined?!![]:![]:!![],'where':_0x41129a[_0xdca6('0x1a')]?_0x41129a[_0xdca6('0x1a')][_0xdca6('0x24')]||null:null,'attributes':_0x41129a[_0xdca6('0x1a')]?_0x41129a[_0xdca6('0x1a')][_0xdca6('0x20')]||null:null,'include':_0x41129a['options']?_0x41129a[_0xdca6('0x1a')]['include']?_['map'](_0x41129a[_0xdca6('0x1a')]['include'],function(_0x4a651c){return{'model':db[_0x4a651c[_0xdca6('0x1f')]],'as':_0x4a651c['as'],'attributes':_0x4a651c[_0xdca6('0x20')],'include':_0x4a651c['include']?_['map'](_0x4a651c[_0xdca6('0x1d')],function(_0x39b094){return{'model':db[_0x39b094['model']],'as':_0x39b094['as'],'attributes':_0x39b094[_0xdca6('0x20')],'include':_0x39b094[_0xdca6('0x1d')]?_[_0xdca6('0x1e')](_0x39b094[_0xdca6('0x1d')],function(_0xc8915e){return{'model':db[_0xc8915e[_0xdca6('0x1f')]],'as':_0xc8915e['as'],'attributes':_0xc8915e[_0xdca6('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e0414){logger['info'](_0xdca6('0x22'),_0x41129a);logger[_0xdca6('0x25')](_0xdca6('0x22'),_0x41129a,JSON[_0xdca6('0x11')](_0x4e0414));_0x3a70a6(_0x4e0414);})['catch'](function(_0x4177b8){logger[_0xdca6('0x12')](_0xdca6('0x22'),_0x4177b8[_0xdca6('0x14')],_0x41129a);_0x4b55a3(_0x2e67a1[_0xdca6('0x12')](0x1f4,_0x4177b8['message']));});});}; \ No newline at end of file +var _0x4c45=['stringify','find','where','then','ShowInterval','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','client','http','request','Interval,\x20%s,\x20%s','request\x20sent','Interval,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','Interval','findAll','options','raw','limit','include','map','model','attributes','debug'];(function(_0xc6b104,_0x1d805a){var _0x1c6fce=function(_0x1bfb3f){while(--_0x1bfb3f){_0xc6b104['push'](_0xc6b104['shift']());}};_0x1c6fce(++_0x1d805a);}(_0x4c45,0x68));var _0x54c4=function(_0x2833fd,_0x28c021){_0x2833fd=_0x2833fd-0x0;var _0x3331a0=_0x4c45[_0x2833fd];return _0x3331a0;};'use strict';var _=require(_0x54c4('0x0'));var util=require(_0x54c4('0x1'));var moment=require('moment');var BPromise=require(_0x54c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54c4('0x3'));var db=require(_0x54c4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x54c4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x54c4('0x6')][_0x54c4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2c7b33,_0x147076,_0x27e097){return new BPromise(function(_0x419335,_0x551434){return client[_0x54c4('0x8')](_0x2c7b33,_0x27e097)['then'](function(_0x3ec659){logger['info'](_0x54c4('0x9'),_0x147076,_0x54c4('0xa'));logger['debug'](_0x54c4('0xb'),_0x147076,_0x54c4('0xa'),JSON['stringify'](_0x3ec659));if(_0x3ec659['error']){if(_0x3ec659[_0x54c4('0xc')][_0x54c4('0xd')]===0x1f4){logger[_0x54c4('0xc')]('Interval,\x20%s,\x20%s',_0x147076,_0x3ec659[_0x54c4('0xc')][_0x54c4('0xe')]);return _0x551434(_0x3ec659['error']['message']);}logger['error'](_0x54c4('0x9'),_0x147076,_0x3ec659[_0x54c4('0xc')]['message']);return _0x419335(_0x3ec659[_0x54c4('0xc')][_0x54c4('0xe')]);}else{logger[_0x54c4('0xf')]('Interval,\x20%s,\x20%s',_0x147076,_0x54c4('0xa'));_0x419335(_0x3ec659[_0x54c4('0x10')]['message']);}})[_0x54c4('0x11')](function(_0x30985a){logger[_0x54c4('0xc')](_0x54c4('0x9'),_0x147076,_0x30985a);_0x551434(_0x30985a);});});}exports['GetInterval']=function(_0x557a3a){var _0x5cbb1f=this;return new Promise(function(_0x3c18b2,_0x5e2480){return db[_0x54c4('0x12')][_0x54c4('0x13')]({'raw':_0x557a3a[_0x54c4('0x14')]?_0x557a3a[_0x54c4('0x14')][_0x54c4('0x15')]===undefined?!![]:![]:!![],'where':_0x557a3a[_0x54c4('0x14')]?_0x557a3a[_0x54c4('0x14')]['where']||null:null,'attributes':_0x557a3a[_0x54c4('0x14')]?_0x557a3a['options']['attributes']||null:null,'limit':_0x557a3a[_0x54c4('0x14')]?_0x557a3a[_0x54c4('0x14')][_0x54c4('0x16')]||null:null,'include':_0x557a3a[_0x54c4('0x14')]?_0x557a3a[_0x54c4('0x14')][_0x54c4('0x17')]?_[_0x54c4('0x18')](_0x557a3a[_0x54c4('0x14')][_0x54c4('0x17')],function(_0x3446bb){return{'model':db[_0x3446bb[_0x54c4('0x19')]],'as':_0x3446bb['as'],'attributes':_0x3446bb[_0x54c4('0x1a')],'include':_0x3446bb[_0x54c4('0x17')]?_['map'](_0x3446bb[_0x54c4('0x17')],function(_0x318137){return{'model':db[_0x318137[_0x54c4('0x19')]],'as':_0x318137['as'],'attributes':_0x318137[_0x54c4('0x1a')],'include':_0x318137[_0x54c4('0x17')]?_[_0x54c4('0x18')](_0x318137[_0x54c4('0x17')],function(_0x1d9385){return{'model':db[_0x1d9385['model']],'as':_0x1d9385['as'],'attributes':_0x1d9385[_0x54c4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x549180){logger[_0x54c4('0xf')]('GetInterval',_0x557a3a);logger[_0x54c4('0x1b')]('GetInterval',_0x557a3a,JSON[_0x54c4('0x1c')](_0x549180));_0x3c18b2(_0x549180);})[_0x54c4('0x11')](function(_0x48fe55){logger[_0x54c4('0xc')]('GetInterval',_0x48fe55[_0x54c4('0xe')],_0x557a3a);_0x5e2480(_0x5cbb1f[_0x54c4('0xc')](0x1f4,_0x48fe55['message']));});});};exports['ShowInterval']=function(_0x15cde0){var _0xacf248=this;return new Promise(function(_0x20cb8b,_0x21981e){return db['Interval'][_0x54c4('0x1d')]({'raw':_0x15cde0[_0x54c4('0x14')]?_0x15cde0[_0x54c4('0x14')][_0x54c4('0x15')]===undefined?!![]:![]:!![],'where':_0x15cde0[_0x54c4('0x14')]?_0x15cde0[_0x54c4('0x14')][_0x54c4('0x1e')]||null:null,'attributes':_0x15cde0[_0x54c4('0x14')]?_0x15cde0['options'][_0x54c4('0x1a')]||null:null,'include':_0x15cde0[_0x54c4('0x14')]?_0x15cde0[_0x54c4('0x14')][_0x54c4('0x17')]?_[_0x54c4('0x18')](_0x15cde0[_0x54c4('0x14')]['include'],function(_0x36837e){return{'model':db[_0x36837e['model']],'as':_0x36837e['as'],'attributes':_0x36837e[_0x54c4('0x1a')],'include':_0x36837e[_0x54c4('0x17')]?_['map'](_0x36837e['include'],function(_0xd66215){return{'model':db[_0xd66215['model']],'as':_0xd66215['as'],'attributes':_0xd66215[_0x54c4('0x1a')],'include':_0xd66215['include']?_['map'](_0xd66215[_0x54c4('0x17')],function(_0xa95b8b){return{'model':db[_0xa95b8b[_0x54c4('0x19')]],'as':_0xa95b8b['as'],'attributes':_0xa95b8b[_0x54c4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x54c4('0x1f')](function(_0x1614b8){logger[_0x54c4('0xf')](_0x54c4('0x20'),_0x15cde0);logger['debug'](_0x54c4('0x20'),_0x15cde0,JSON[_0x54c4('0x1c')](_0x1614b8));_0x20cb8b(_0x1614b8);})[_0x54c4('0x11')](function(_0x13e645){logger[_0x54c4('0xc')]('ShowInterval',_0x13e645['message'],_0x15cde0);_0x21981e(_0xacf248[_0x54c4('0xc')](0x1f4,_0x13e645[_0x54c4('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 529ea12..5608abd 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf64b=['send','exports','express','Router','./jira.controller','isAuthenticated'];(function(_0x2a863f,_0x3e7a74){var _0x525dac=function(_0x476b9f){while(--_0x476b9f){_0x2a863f['push'](_0x2a863f['shift']());}};_0x525dac(++_0x3e7a74);}(_0xf64b,0x188));var _0xbf64=function(_0x414655,_0x79d916){_0x414655=_0x414655-0x0;var _0x237884=_0xf64b[_0x414655];return _0x237884;};'use strict';var express=require(_0xbf64('0x0'));var router=express[_0xbf64('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbf64('0x2'));router['post']('/',auth[_0xbf64('0x3')](),controller[_0xbf64('0x4')]);module[_0xbf64('0x5')]=router; \ No newline at end of file +var _0x1156=['exports','express','../../components/auth/service','isAuthenticated','send'];(function(_0x2a67d7,_0x4f8880){var _0xc3719a=function(_0x3b94f6){while(--_0x3b94f6){_0x2a67d7['push'](_0x2a67d7['shift']());}};_0xc3719a(++_0x4f8880);}(_0x1156,0x178));var _0x6115=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x1156[_0x373dee];return _0x46798f;};'use strict';var express=require(_0x6115('0x0'));var router=express['Router']();var auth=require(_0x6115('0x1'));var controller=require('./jira.controller');router['post']('/',auth[_0x6115('0x2')](),controller[_0x6115('0x3')]);module[_0x6115('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 2aafe63..044d721 100644 --- a/server/api/jira/jira.controller.js +++ b/server/api/jira/jira.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7971=['customfield_11501','newToken','customfield_11503','name','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','stringify','setEncoding','utf8','data','end','status','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','x-forwarded-for','remoteAddress','socket','connection','bluebird','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','issuetype','fields','customfield_11500'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7971,0x1cc));var _0x1797=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x7971[_0x26462c];return _0x509a42;};'use strict';var BPromise=require(_0x1797('0x0'));var https=require('https');var logger=require(_0x1797('0x1'))(_0x1797('0x2'));var USERNAME=_0x1797('0x3');var PASSWORD=_0x1797('0x4');function openIssue(_0x109f2a,_0x420060){var _0xbd098c={'fields':{'project':{'key':_0x109f2a[_0x1797('0x5')]||_0x1797('0x6')},'summary':(_0x109f2a['summary']||_0x1797('0x7'))+_0x1797('0x8')+_0x109f2a['ip'],'description':_0x109f2a[_0x1797('0x9')]||JSON['stringify'](_0x109f2a),'issuetype':{'name':_0x109f2a[_0x1797('0xa')]||'Bug'}}};_0xbd098c[_0x1797('0xb')][_0x1797('0xc')]=_0x109f2a['email'];_0xbd098c['fields'][_0x1797('0xd')]=_0x109f2a['oldToken'];_0xbd098c[_0x1797('0xb')]['customfield_11502']=_0x109f2a[_0x1797('0xe')];_0xbd098c['fields'][_0x1797('0xf')]=_0x109f2a[_0x1797('0x10')];_0xbd098c[_0x1797('0xb')]['customfield_11504']=_0x109f2a[_0x1797('0x11')];_0xbd098c[_0x1797('0xb')][_0x1797('0x12')]=_0x109f2a['ip'];var _0x11b8eb={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x1797('0x13'),'method':_0x1797('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x1797('0x15'),'Authorization':_0x1797('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x1797('0x17')](_0x1797('0x18'))}};var _0xa8e5fc=JSON[_0x1797('0x19')](_0xbd098c);var _0x6099a8=https['request'](_0x11b8eb,function(_0x5e0b92){_0x5e0b92[_0x1797('0x1a')](_0x1797('0x1b'));var _0x53a533='';_0x5e0b92['on'](_0x1797('0x1c'),function(_0x2d9957){_0x53a533+=_0x2d9957;});_0x5e0b92['on'](_0x1797('0x1d'),function(){if(_0x420060){return _0x420060[_0x1797('0x1e')](_0x5e0b92['statusCode'])[_0x1797('0x1f')](JSON[_0x1797('0x20')](_0x53a533));}});});_0x6099a8['on']('error',function(_0x5cbb85){if(_0x420060){return _0x420060[_0x1797('0x1e')](0x1f4)[_0x1797('0x1f')]({'errors':[{'message':_0x1797('0x21'),'type':_0x1797('0x22')}]});}});_0x6099a8[_0x1797('0x23')](_0xa8e5fc);_0x6099a8['end']();}exports[_0x1797('0x24')]=openIssue;exports[_0x1797('0x25')]=function(_0x4af746,_0x4c1055){_0x4af746[_0x1797('0x26')]['ip']=_0x4af746['headers'][_0x1797('0x27')]||_0x4af746['connection'][_0x1797('0x28')]||_0x4af746[_0x1797('0x29')][_0x1797('0x28')]||_0x4af746[_0x1797('0x2a')][_0x1797('0x29')][_0x1797('0x28')];return openIssue(_0x4af746[_0x1797('0x26')],_0x4c1055);}; \ No newline at end of file +var _0xbb18=['api','key','summary','\x20from\x20','description','issuetype','customfield_11500','fields','customfield_11502','newToken','name','customfield_11504','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','stringify','request','utf8','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xbb18,0x146));var _0x8bb1=function(_0x3296c3,_0xc96c4a){_0x3296c3=_0x3296c3-0x0;var _0x1fb66a=_0xbb18[_0x3296c3];return _0x1fb66a;};'use strict';var BPromise=require(_0x8bb1('0x0'));var https=require(_0x8bb1('0x1'));var logger=require('../../config/logger')(_0x8bb1('0x2'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x270161,_0x40423d){var _0x592dd3={'fields':{'project':{'key':_0x270161[_0x8bb1('0x3')]||'MOTGUI'},'summary':(_0x270161[_0x8bb1('0x4')]||'Report')+_0x8bb1('0x5')+_0x270161['ip'],'description':_0x270161[_0x8bb1('0x6')]||JSON['stringify'](_0x270161),'issuetype':{'name':_0x270161[_0x8bb1('0x7')]||'Bug'}}};_0x592dd3['fields'][_0x8bb1('0x8')]=_0x270161['email'];_0x592dd3[_0x8bb1('0x9')]['customfield_11501']=_0x270161['oldToken'];_0x592dd3[_0x8bb1('0x9')][_0x8bb1('0xa')]=_0x270161[_0x8bb1('0xb')];_0x592dd3['fields']['customfield_11503']=_0x270161[_0x8bb1('0xc')];_0x592dd3[_0x8bb1('0x9')][_0x8bb1('0xd')]=_0x270161['reason'];_0x592dd3[_0x8bb1('0x9')][_0x8bb1('0xe')]=_0x270161['ip'];var _0x3d2bb3={'host':_0x8bb1('0xf'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x8bb1('0x10'),'timeout':0x4e20,'headers':{'Content-Type':_0x8bb1('0x11'),'Authorization':_0x8bb1('0x12')+new Buffer(USERNAME+':'+PASSWORD)[_0x8bb1('0x13')](_0x8bb1('0x14'))}};var _0x108396=JSON[_0x8bb1('0x15')](_0x592dd3);var _0x3a79d5=https[_0x8bb1('0x16')](_0x3d2bb3,function(_0x1aaf71){_0x1aaf71['setEncoding'](_0x8bb1('0x17'));var _0x30e030='';_0x1aaf71['on']('data',function(_0x5ac92e){_0x30e030+=_0x5ac92e;});_0x1aaf71['on'](_0x8bb1('0x18'),function(){if(_0x40423d){return _0x40423d[_0x8bb1('0x19')](_0x1aaf71[_0x8bb1('0x1a')])[_0x8bb1('0x1b')](JSON[_0x8bb1('0x1c')](_0x30e030));}});});_0x3a79d5['on'](_0x8bb1('0x1d'),function(_0x4b6dd7){if(_0x40423d){return _0x40423d[_0x8bb1('0x19')](0x1f4)[_0x8bb1('0x1b')]({'errors':[{'message':_0x8bb1('0x1e'),'type':_0x8bb1('0x1f')}]});}});_0x3a79d5[_0x8bb1('0x20')](_0x108396);_0x3a79d5[_0x8bb1('0x18')]();}exports[_0x8bb1('0x21')]=openIssue;exports[_0x8bb1('0x22')]=function(_0xa9249,_0x37c405){_0xa9249[_0x8bb1('0x23')]['ip']=_0xa9249[_0x8bb1('0x24')][_0x8bb1('0x25')]||_0xa9249[_0x8bb1('0x26')][_0x8bb1('0x27')]||_0xa9249[_0x8bb1('0x28')]['remoteAddress']||_0xa9249[_0x8bb1('0x26')]['socket'][_0x8bb1('0x27')];return openIssue(_0xa9249[_0x8bb1('0x23')],_0x37c405);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 549fb0e..5fc0dd5 100644 --- a/server/api/jscriptyAnswerReport/index.js +++ b/server/api/jscriptyAnswerReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa561=['multer','util','path','Router','../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','exports'];(function(_0x11aa6f,_0x8be349){var _0x159a5d=function(_0x568b24){while(--_0x568b24){_0x11aa6f['push'](_0x11aa6f['shift']());}};_0x159a5d(++_0x8be349);}(_0xa561,0x10e));var _0x1a56=function(_0x5a5611,_0x940e56){_0x5a5611=_0x5a5611-0x0;var _0xf17a2d=_0xa561[_0x5a5611];return _0xf17a2d;};'use strict';var multer=require(_0x1a56('0x0'));var util=require(_0x1a56('0x1'));var path=require(_0x1a56('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1a56('0x3')]();var auth=require(_0x1a56('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1a56('0x5'));var controller=require(_0x1a56('0x6'));router[_0x1a56('0x7')]('/',auth[_0x1a56('0x8')](),controller[_0x1a56('0x9')]);router[_0x1a56('0x7')](_0x1a56('0xa'),auth[_0x1a56('0x8')](),controller[_0x1a56('0xb')]);router[_0x1a56('0x7')](_0x1a56('0xc'),auth[_0x1a56('0x8')](),controller[_0x1a56('0xd')]);router[_0x1a56('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1a56('0xc'),auth[_0x1a56('0x8')](),controller[_0x1a56('0xf')]);router[_0x1a56('0x10')](_0x1a56('0xc'),auth[_0x1a56('0x8')](),controller['destroy']);module[_0x1a56('0x11')]=router; \ No newline at end of file +var _0x3e16=['exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','show','create','/:id','update','delete','destroy'];(function(_0x2547be,_0x31e9be){var _0x56b8bf=function(_0x2b1731){while(--_0x2b1731){_0x2547be['push'](_0x2547be['shift']());}};_0x56b8bf(++_0x31e9be);}(_0x3e16,0xd9));var _0x63e1=function(_0x3d55f8,_0x596693){_0x3d55f8=_0x3d55f8-0x0;var _0xb1b2af=_0x3e16[_0x3d55f8];return _0xb1b2af;};'use strict';var multer=require(_0x63e1('0x0'));var util=require(_0x63e1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x63e1('0x2'));var router=express[_0x63e1('0x3')]();var auth=require(_0x63e1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x63e1('0x5'));var controller=require(_0x63e1('0x6'));router['get']('/',auth[_0x63e1('0x7')](),controller[_0x63e1('0x8')]);router[_0x63e1('0x9')](_0x63e1('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x63e1('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x63e1('0xc')]);router['put'](_0x63e1('0xd'),auth[_0x63e1('0x7')](),controller[_0x63e1('0xe')]);router[_0x63e1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x63e1('0x10')]);module[_0x63e1('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index a8c07c5..3aeb451 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80f1=['long','STRING','TEXT'];(function(_0x5b406e,_0xcd06bc){var _0xe7d242=function(_0x3fc6cc){while(--_0x3fc6cc){_0x5b406e['push'](_0x5b406e['shift']());}};_0xe7d242(++_0xcd06bc);}(_0x80f1,0x1a8));var _0x180f=function(_0x148277,_0x149516){_0x148277=_0x148277-0x0;var _0x3f3bbc=_0x80f1[_0x148277];return _0x3f3bbc;};'use strict';var Sequelize=require('sequelize');module['exports']={'question':{'type':Sequelize[_0x180f('0x0')]},'answer':{'type':Sequelize[_0x180f('0x1')](_0x180f('0x2'))},'membername':{'type':Sequelize[_0x180f('0x0')]},'projectname':{'type':Sequelize[_0x180f('0x0')]},'queue':{'type':Sequelize[_0x180f('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x180f('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2a3d=['exports','TEXT','long','STRING','sequelize'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x2a3d,0x1a3));var _0xd2a3=function(_0x3bc8f9,_0x1afad5){_0x3bc8f9=_0x3bc8f9-0x0;var _0x1f7b8a=_0x2a3d[_0x3bc8f9];return _0x1f7b8a;};'use strict';var Sequelize=require(_0xd2a3('0x0'));module[_0xd2a3('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0xd2a3('0x2')](_0xd2a3('0x3'))},'membername':{'type':Sequelize[_0xd2a3('0x4')]},'projectname':{'type':Sequelize[_0xd2a3('0x4')]},'queue':{'type':Sequelize[_0xd2a3('0x4')]},'uniqueid':{'type':Sequelize[_0xd2a3('0x4')]},'calleridname':{'type':Sequelize[_0xd2a3('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0xd2a3('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 4341ac2..b59fc26 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c15=['findAll','rows','catch','params','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','type','key','field','options','JscriptyAnswerReport','includeAll','include'];(function(_0x8b4b58,_0x583504){var _0xb3982a=function(_0x590bc8){while(--_0x590bc8){_0x8b4b58['push'](_0x8b4b58['shift']());}};_0xb3982a(++_0x583504);}(_0x3c15,0x170));var _0x53c1=function(_0x15d21f,_0x10997d){_0x15d21f=_0x15d21f-0x0;var _0x50b48d=_0x3c15[_0x15d21f];return _0x50b48d;};'use strict';var pdf=require(_0x53c1('0x0'));var emlformat=require(_0x53c1('0x1'));var rimraf=require(_0x53c1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53c1('0x3'));var rp=require(_0x53c1('0x4'));var moment=require(_0x53c1('0x5'));var BPromise=require(_0x53c1('0x6'));var Mustache=require(_0x53c1('0x7'));var util=require(_0x53c1('0x8'));var path=require('path');var sox=require(_0x53c1('0x9'));var csv=require(_0x53c1('0xa'));var ejs=require(_0x53c1('0xb'));var fs=require('fs');var _=require(_0x53c1('0xc'));var squel=require('squel');var crypto=require(_0x53c1('0xd'));var jsforce=require(_0x53c1('0xe'));var deskjs=require(_0x53c1('0xf'));var toCsv=require(_0x53c1('0xa'));var querystring=require(_0x53c1('0x10'));var Papa=require(_0x53c1('0x11'));var Redis=require(_0x53c1('0x12'));var authService=require(_0x53c1('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x53c1('0x14'));var logger=require('../../config/logger')(_0x53c1('0x15'));var utils=require(_0x53c1('0x16'));var config=require(_0x53c1('0x17'));var db=require(_0x53c1('0x18'))['db'];function respondWithStatusCode(_0x59594f,_0x4ad7bc){_0x4ad7bc=_0x4ad7bc||0xcc;return function(_0x177ad7){if(_0x177ad7){return _0x59594f['sendStatus'](_0x4ad7bc);}return _0x59594f[_0x53c1('0x19')](_0x4ad7bc)[_0x53c1('0x1a')]();};}function respondWithResult(_0x22e864,_0x2907b1){_0x2907b1=_0x2907b1||0xc8;return function(_0x1877a4){if(_0x1877a4){return _0x22e864[_0x53c1('0x19')](_0x2907b1)[_0x53c1('0x1b')](_0x1877a4);}};}function respondWithFilteredResult(_0x3ec1ab,_0x205f46){return function(_0x25dbd6){if(_0x25dbd6){var _0x42953f=_0x25dbd6[_0x53c1('0x1c')],_0x1b7332=_0x205f46[_0x53c1('0x1d')],_0x158e6=_0x205f46[_0x53c1('0x1d')]+_0x205f46[_0x53c1('0x1e')],_0x5283f8;if(_0x158e6>=_0x42953f){_0x158e6=_0x42953f;_0x5283f8=0xc8;}else{_0x5283f8=0xce;}_0x3ec1ab[_0x53c1('0x19')](_0x5283f8);return _0x3ec1ab[_0x53c1('0x1f')]('Content-Range',_0x1b7332+'-'+_0x158e6+'/'+_0x42953f)[_0x53c1('0x1b')](_0x25dbd6);}return null;};}function patchUpdates(_0x2cc895){return function(_0x6e10f4){try{jsonpatch[_0x53c1('0x20')](_0x6e10f4,_0x2cc895,!![]);}catch(_0x52510b){return BPromise[_0x53c1('0x21')](_0x52510b);}return _0x6e10f4[_0x53c1('0x22')]();};}function saveUpdates(_0x3ee426,_0x336bf0){return function(_0x104a4f){if(_0x104a4f){return _0x104a4f[_0x53c1('0x23')](_0x3ee426)[_0x53c1('0x24')](function(_0x1ff050){return _0x1ff050;});}return null;};}function removeEntity(_0x241f47,_0xb9ed0b){return function(_0x164160){if(_0x164160){return _0x164160[_0x53c1('0x25')]()[_0x53c1('0x24')](function(){_0x241f47[_0x53c1('0x19')](0xcc)[_0x53c1('0x1a')]();});}};}function handleEntityNotFound(_0x54ab90,_0x426a1c){return function(_0x2f86c6){if(!_0x2f86c6){_0x54ab90[_0x53c1('0x26')](0x194);}return _0x2f86c6;};}function handleError(_0x2ef661,_0x38e73f){_0x38e73f=_0x38e73f||0x1f4;return function(_0x4b7fab){logger[_0x53c1('0x27')](_0x4b7fab['stack']);if(_0x4b7fab[_0x53c1('0x28')]){delete _0x4b7fab[_0x53c1('0x28')];}_0x2ef661[_0x53c1('0x19')](_0x38e73f)[_0x53c1('0x29')](_0x4b7fab);};}exports['index']=function(_0x4f6af9,_0x461486){var _0x365f25={},_0x1e00ea={},_0x556645={'count':0x0,'rows':[]};var _0x15b333=db['JscriptyAnswerReport'][_0x53c1('0x2a')];_0x1e00ea[_0x53c1('0x2b')]=_[_0x53c1('0x2c')](_0x15b333);_0x1e00ea[_0x53c1('0x2d')]=_[_0x53c1('0x2c')](_0x4f6af9['query']);_0x1e00ea['filters']=_[_0x53c1('0x2e')](_0x1e00ea[_0x53c1('0x2b')],_0x1e00ea['query']);_0x365f25[_0x53c1('0x2f')]=_[_0x53c1('0x2e')](_0x1e00ea[_0x53c1('0x2b')],qs[_0x53c1('0x30')](_0x4f6af9['query'][_0x53c1('0x30')]));_0x365f25[_0x53c1('0x2f')]=_0x365f25[_0x53c1('0x2f')][_0x53c1('0x31')]?_0x365f25[_0x53c1('0x2f')]:_0x1e00ea['model'];if(!_0x4f6af9['query'][_0x53c1('0x32')](_0x53c1('0x33'))){_0x365f25[_0x53c1('0x1e')]=qs[_0x53c1('0x1e')](_0x4f6af9[_0x53c1('0x2d')][_0x53c1('0x1e')]);_0x365f25['offset']=qs[_0x53c1('0x1d')](_0x4f6af9[_0x53c1('0x2d')][_0x53c1('0x1d')]);}_0x365f25[_0x53c1('0x34')]=qs['sort'](_0x4f6af9[_0x53c1('0x2d')]['sort']);_0x365f25[_0x53c1('0x35')]=qs[_0x53c1('0x36')](_['pick'](_0x4f6af9[_0x53c1('0x2d')],_0x1e00ea[_0x53c1('0x36')]));if(_0x4f6af9[_0x53c1('0x2d')][_0x53c1('0x37')]){_0x365f25[_0x53c1('0x35')]=_[_0x53c1('0x38')](_0x365f25['where'],{'$or':_['map'](_0x15b333,function(_0x422c79){if(_0x422c79[_0x53c1('0x39')][_0x53c1('0x3a')]!=='VIRTUAL'){var _0x2d0b43={};_0x2d0b43[_0x422c79[_0x53c1('0x3b')]]={'$like':'%'+_0x4f6af9[_0x53c1('0x2d')][_0x53c1('0x37')]+'%'};return _0x2d0b43;}})});}_0x365f25=_[_0x53c1('0x38')]({},_0x365f25,_0x4f6af9[_0x53c1('0x3c')]);var _0x374243={'where':_0x365f25[_0x53c1('0x35')]};return db[_0x53c1('0x3d')][_0x53c1('0x1c')](_0x374243)['then'](function(_0x3b4e4d){_0x556645[_0x53c1('0x1c')]=_0x3b4e4d;if(_0x4f6af9[_0x53c1('0x2d')][_0x53c1('0x3e')]){_0x365f25[_0x53c1('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x53c1('0x40')](_0x365f25);})['then'](function(_0x1e809e){_0x556645[_0x53c1('0x41')]=_0x1e809e;return _0x556645;})['then'](respondWithFilteredResult(_0x461486,_0x365f25))[_0x53c1('0x42')](handleError(_0x461486,null));};exports['show']=function(_0x4ce39b,_0x36c0b7){var _0x10ee6f={'raw':!![],'where':{'id':_0x4ce39b[_0x53c1('0x43')]['id']}},_0x2cbd8b={};_0x2cbd8b['model']=_['keys'](db[_0x53c1('0x3d')][_0x53c1('0x2a')]);_0x2cbd8b['query']=_[_0x53c1('0x2c')](_0x4ce39b[_0x53c1('0x2d')]);_0x2cbd8b[_0x53c1('0x36')]=_['intersection'](_0x2cbd8b[_0x53c1('0x2b')],_0x2cbd8b['query']);_0x10ee6f[_0x53c1('0x2f')]=_['intersection'](_0x2cbd8b[_0x53c1('0x2b')],qs[_0x53c1('0x30')](_0x4ce39b[_0x53c1('0x2d')][_0x53c1('0x30')]));_0x10ee6f[_0x53c1('0x2f')]=_0x10ee6f[_0x53c1('0x2f')][_0x53c1('0x31')]?_0x10ee6f['attributes']:_0x2cbd8b[_0x53c1('0x2b')];if(_0x4ce39b[_0x53c1('0x2d')][_0x53c1('0x3e')]){_0x10ee6f[_0x53c1('0x3f')]=[{'all':!![]}];}_0x10ee6f=_[_0x53c1('0x38')]({},_0x10ee6f,_0x4ce39b[_0x53c1('0x3c')]);return db[_0x53c1('0x3d')][_0x53c1('0x44')](_0x10ee6f)['then'](handleEntityNotFound(_0x36c0b7,null))['then'](respondWithResult(_0x36c0b7,null))['catch'](handleError(_0x36c0b7,null));};exports[_0x53c1('0x45')]=function(_0x45da92,_0x285829){return db[_0x53c1('0x3d')]['create'](_0x45da92['body'],{})['then'](respondWithResult(_0x285829,0xc9))['catch'](handleError(_0x285829,null));};exports[_0x53c1('0x23')]=function(_0x3b4640,_0x392a8a){if(_0x3b4640[_0x53c1('0x46')]['id']){delete _0x3b4640[_0x53c1('0x46')]['id'];}return db[_0x53c1('0x3d')]['find']({'where':{'id':_0x3b4640[_0x53c1('0x43')]['id']}})[_0x53c1('0x24')](handleEntityNotFound(_0x392a8a,null))['then'](saveUpdates(_0x3b4640[_0x53c1('0x46')],null))[_0x53c1('0x24')](respondWithResult(_0x392a8a,null))[_0x53c1('0x42')](handleError(_0x392a8a,null));};exports['destroy']=function(_0x2894fd,_0xb69bab){return db[_0x53c1('0x3d')]['find']({'where':{'id':_0x2894fd[_0x53c1('0x43')]['id']}})[_0x53c1('0x24')](handleEntityNotFound(_0xb69bab,null))[_0x53c1('0x24')](removeEntity(_0xb69bab,null))[_0x53c1('0x42')](handleError(_0xb69bab,null));};exports[_0x53c1('0x47')]=function(_0x3922ef,_0x18a2fb){return db[_0x53c1('0x3d')][_0x53c1('0x47')]()[_0x53c1('0x24')](respondWithResult(_0x18a2fb,null))[_0x53c1('0x42')](handleError(_0x18a2fb,null));}; \ No newline at end of file +var _0x11e1=['filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','key','VIRTUAL','field','count','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','JscriptyAnswerReport','rawAttributes','keys','query'];(function(_0x156b8b,_0x58e55a){var _0x112918=function(_0x6f64d2){while(--_0x6f64d2){_0x156b8b['push'](_0x156b8b['shift']());}};_0x112918(++_0x58e55a);}(_0x11e1,0x66));var _0x111e=function(_0x780423,_0x2711c2){_0x780423=_0x780423-0x0;var _0x5292e2=_0x11e1[_0x780423];return _0x5292e2;};'use strict';var pdf=require(_0x111e('0x0'));var emlformat=require(_0x111e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x111e('0x2'));var jsonpatch=require(_0x111e('0x3'));var rp=require(_0x111e('0x4'));var moment=require('moment');var BPromise=require(_0x111e('0x5'));var Mustache=require(_0x111e('0x6'));var util=require(_0x111e('0x7'));var path=require(_0x111e('0x8'));var sox=require(_0x111e('0x9'));var csv=require(_0x111e('0xa'));var ejs=require(_0x111e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x111e('0xc'));var crypto=require(_0x111e('0xd'));var jsforce=require(_0x111e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x111e('0xa'));var querystring=require('querystring');var Papa=require(_0x111e('0xf'));var Redis=require(_0x111e('0x10'));var authService=require(_0x111e('0x11'));var qs=require(_0x111e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x111e('0x13'))(_0x111e('0x14'));var utils=require(_0x111e('0x15'));var config=require(_0x111e('0x16'));var db=require(_0x111e('0x17'))['db'];function respondWithStatusCode(_0x3dc76e,_0x1d8375){_0x1d8375=_0x1d8375||0xcc;return function(_0x53dbd7){if(_0x53dbd7){return _0x3dc76e['sendStatus'](_0x1d8375);}return _0x3dc76e[_0x111e('0x18')](_0x1d8375)[_0x111e('0x19')]();};}function respondWithResult(_0x33b940,_0x3e28a3){_0x3e28a3=_0x3e28a3||0xc8;return function(_0x4553b4){if(_0x4553b4){return _0x33b940[_0x111e('0x18')](_0x3e28a3)['json'](_0x4553b4);}};}function respondWithFilteredResult(_0x4b6815,_0x558c51){return function(_0x54543a){if(_0x54543a){var _0x2dfed1=_0x54543a['count'],_0x5bacc4=_0x558c51['offset'],_0x8b426a=_0x558c51[_0x111e('0x1a')]+_0x558c51[_0x111e('0x1b')],_0x5e535c;if(_0x8b426a>=_0x2dfed1){_0x8b426a=_0x2dfed1;_0x5e535c=0xc8;}else{_0x5e535c=0xce;}_0x4b6815[_0x111e('0x18')](_0x5e535c);return _0x4b6815[_0x111e('0x1c')](_0x111e('0x1d'),_0x5bacc4+'-'+_0x8b426a+'/'+_0x2dfed1)[_0x111e('0x1e')](_0x54543a);}return null;};}function patchUpdates(_0x29f506){return function(_0x12a43a){try{jsonpatch[_0x111e('0x1f')](_0x12a43a,_0x29f506,!![]);}catch(_0x52466b){return BPromise[_0x111e('0x20')](_0x52466b);}return _0x12a43a[_0x111e('0x21')]();};}function saveUpdates(_0x36a70c,_0x100ed4){return function(_0x369223){if(_0x369223){return _0x369223[_0x111e('0x22')](_0x36a70c)[_0x111e('0x23')](function(_0x31194f){return _0x31194f;});}return null;};}function removeEntity(_0x29aedc,_0x31f4a6){return function(_0x54f312){if(_0x54f312){return _0x54f312[_0x111e('0x24')]()['then'](function(){_0x29aedc[_0x111e('0x18')](0xcc)[_0x111e('0x19')]();});}};}function handleEntityNotFound(_0x406db8,_0x25070a){return function(_0x377147){if(!_0x377147){_0x406db8[_0x111e('0x25')](0x194);}return _0x377147;};}function handleError(_0x2d1749,_0x5b3668){_0x5b3668=_0x5b3668||0x1f4;return function(_0x2a2425){logger[_0x111e('0x26')](_0x2a2425[_0x111e('0x27')]);if(_0x2a2425[_0x111e('0x28')]){delete _0x2a2425[_0x111e('0x28')];}_0x2d1749[_0x111e('0x18')](_0x5b3668)['send'](_0x2a2425);};}exports[_0x111e('0x29')]=function(_0x1057b0,_0x2e043c){var _0x532f95={},_0x451a00={},_0x141010={'count':0x0,'rows':[]};var _0x4ba3b9=db[_0x111e('0x2a')][_0x111e('0x2b')];_0x451a00['model']=_[_0x111e('0x2c')](_0x4ba3b9);_0x451a00[_0x111e('0x2d')]=_[_0x111e('0x2c')](_0x1057b0[_0x111e('0x2d')]);_0x451a00[_0x111e('0x2e')]=_[_0x111e('0x2f')](_0x451a00[_0x111e('0x30')],_0x451a00[_0x111e('0x2d')]);_0x532f95[_0x111e('0x31')]=_['intersection'](_0x451a00[_0x111e('0x30')],qs[_0x111e('0x32')](_0x1057b0['query'][_0x111e('0x32')]));_0x532f95['attributes']=_0x532f95[_0x111e('0x31')][_0x111e('0x33')]?_0x532f95[_0x111e('0x31')]:_0x451a00[_0x111e('0x30')];if(!_0x1057b0[_0x111e('0x2d')][_0x111e('0x34')]('nolimit')){_0x532f95[_0x111e('0x1b')]=qs[_0x111e('0x1b')](_0x1057b0[_0x111e('0x2d')][_0x111e('0x1b')]);_0x532f95[_0x111e('0x1a')]=qs[_0x111e('0x1a')](_0x1057b0[_0x111e('0x2d')][_0x111e('0x1a')]);}_0x532f95[_0x111e('0x35')]=qs[_0x111e('0x36')](_0x1057b0[_0x111e('0x2d')]['sort']);_0x532f95[_0x111e('0x37')]=qs[_0x111e('0x2e')](_['pick'](_0x1057b0['query'],_0x451a00[_0x111e('0x2e')]));if(_0x1057b0['query'][_0x111e('0x38')]){_0x532f95[_0x111e('0x37')]=_[_0x111e('0x39')](_0x532f95[_0x111e('0x37')],{'$or':_['map'](_0x4ba3b9,function(_0x1997ed){if(_0x1997ed[_0x111e('0x3a')][_0x111e('0x3b')]!==_0x111e('0x3c')){var _0x1fb21d={};_0x1fb21d[_0x1997ed[_0x111e('0x3d')]]={'$like':'%'+_0x1057b0['query']['filter']+'%'};return _0x1fb21d;}})});}_0x532f95=_['merge']({},_0x532f95,_0x1057b0['options']);var _0x5f3634={'where':_0x532f95[_0x111e('0x37')]};return db[_0x111e('0x2a')][_0x111e('0x3e')](_0x5f3634)['then'](function(_0x8c546f){_0x141010[_0x111e('0x3e')]=_0x8c546f;if(_0x1057b0[_0x111e('0x2d')]['includeAll']){_0x532f95[_0x111e('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x111e('0x40')](_0x532f95);})[_0x111e('0x23')](function(_0x192074){_0x141010[_0x111e('0x41')]=_0x192074;return _0x141010;})['then'](respondWithFilteredResult(_0x2e043c,_0x532f95))[_0x111e('0x42')](handleError(_0x2e043c,null));};exports[_0x111e('0x43')]=function(_0x3054fa,_0x26861d){var _0x4a4aac={'raw':!![],'where':{'id':_0x3054fa[_0x111e('0x44')]['id']}},_0xef3a46={};_0xef3a46[_0x111e('0x30')]=_[_0x111e('0x2c')](db[_0x111e('0x2a')][_0x111e('0x2b')]);_0xef3a46[_0x111e('0x2d')]=_[_0x111e('0x2c')](_0x3054fa[_0x111e('0x2d')]);_0xef3a46[_0x111e('0x2e')]=_[_0x111e('0x2f')](_0xef3a46['model'],_0xef3a46[_0x111e('0x2d')]);_0x4a4aac[_0x111e('0x31')]=_[_0x111e('0x2f')](_0xef3a46[_0x111e('0x30')],qs[_0x111e('0x32')](_0x3054fa[_0x111e('0x2d')][_0x111e('0x32')]));_0x4a4aac[_0x111e('0x31')]=_0x4a4aac['attributes'][_0x111e('0x33')]?_0x4a4aac[_0x111e('0x31')]:_0xef3a46[_0x111e('0x30')];if(_0x3054fa[_0x111e('0x2d')][_0x111e('0x45')]){_0x4a4aac['include']=[{'all':!![]}];}_0x4a4aac=_['merge']({},_0x4a4aac,_0x3054fa['options']);return db[_0x111e('0x2a')]['find'](_0x4a4aac)['then'](handleEntityNotFound(_0x26861d,null))['then'](respondWithResult(_0x26861d,null))[_0x111e('0x42')](handleError(_0x26861d,null));};exports[_0x111e('0x46')]=function(_0x4b12b1,_0x1a9a7a){return db[_0x111e('0x2a')][_0x111e('0x46')](_0x4b12b1[_0x111e('0x47')],{})[_0x111e('0x23')](respondWithResult(_0x1a9a7a,0xc9))[_0x111e('0x42')](handleError(_0x1a9a7a,null));};exports[_0x111e('0x22')]=function(_0x4a7674,_0xf06315){if(_0x4a7674[_0x111e('0x47')]['id']){delete _0x4a7674['body']['id'];}return db[_0x111e('0x2a')][_0x111e('0x48')]({'where':{'id':_0x4a7674[_0x111e('0x44')]['id']}})[_0x111e('0x23')](handleEntityNotFound(_0xf06315,null))[_0x111e('0x23')](saveUpdates(_0x4a7674['body'],null))[_0x111e('0x23')](respondWithResult(_0xf06315,null))[_0x111e('0x42')](handleError(_0xf06315,null));};exports[_0x111e('0x24')]=function(_0x276d5d,_0x1fcb65){return db[_0x111e('0x2a')][_0x111e('0x48')]({'where':{'id':_0x276d5d[_0x111e('0x44')]['id']}})['then'](handleEntityNotFound(_0x1fcb65,null))['then'](removeEntity(_0x1fcb65,null))[_0x111e('0x42')](handleError(_0x1fcb65,null));};exports[_0x111e('0x49')]=function(_0x57bcaa,_0x375d43){return db[_0x111e('0x2a')][_0x111e('0x49')]()[_0x111e('0x23')](respondWithResult(_0x375d43,null))[_0x111e('0x42')](handleError(_0x375d43,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 6b666df..ed6ebd0 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8eea=['lodash','util','moment','request-promise','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x8eea,0x7e));var _0xa8ee=function(_0x57da0a,_0x284aed){_0x57da0a=_0x57da0a-0x0;var _0x3145d5=_0x8eea[_0x57da0a];return _0x3145d5;};'use strict';var _=require(_0xa8ee('0x0'));var util=require(_0xa8ee('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa8ee('0x2'));var BPromise=require('bluebird');var rp=require(_0xa8ee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa8ee('0x4'));var attributes=require(_0xa8ee('0x5'));module[_0xa8ee('0x6')]=function(_0x34a9e5,_0x474894){return _0x34a9e5[_0xa8ee('0x7')](_0xa8ee('0x8'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6a6=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x46249d,_0x14bab4){var _0x3db381=function(_0x7101b){while(--_0x7101b){_0x46249d['push'](_0x46249d['shift']());}};_0x3db381(++_0x14bab4);}(_0xf6a6,0x1d4));var _0x6f6a=function(_0x41f4e5,_0x1efed7){_0x41f4e5=_0x41f4e5-0x0;var _0x9fa453=_0xf6a6[_0x41f4e5];return _0x9fa453;};'use strict';var _=require(_0x6f6a('0x0'));var util=require('util');var logger=require(_0x6f6a('0x1'))(_0x6f6a('0x2'));var moment=require(_0x6f6a('0x3'));var BPromise=require(_0x6f6a('0x4'));var rp=require(_0x6f6a('0x5'));var fs=require('fs');var path=require(_0x6f6a('0x6'));var rimraf=require(_0x6f6a('0x7'));var config=require('../../config/environment');var attributes=require(_0x6f6a('0x8'));module['exports']=function(_0x219cd3,_0x48fc3f){return _0x219cd3[_0x6f6a('0x9')](_0x6f6a('0xa'),attributes,{'tableName':_0x6f6a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index de449d6..75f3a7e 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8dc=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x238b0f,_0x732d2f){var _0x35a38f=function(_0x46b841){while(--_0x46b841){_0x238b0f['push'](_0x238b0f['shift']());}};_0x35a38f(++_0x732d2f);}(_0xa8dc,0x1f1));var _0xca8d=function(_0x52f8a3,_0x207aa4){_0x52f8a3=_0x52f8a3-0x0;var _0x5bb341=_0xa8dc[_0x52f8a3];return _0x5bb341;};'use strict';var _=require(_0xca8d('0x0'));var util=require(_0xca8d('0x1'));var moment=require('moment');var BPromise=require(_0xca8d('0x2'));var rs=require(_0xca8d('0x3'));var fs=require('fs');var Redis=require(_0xca8d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xca8d('0x5'));var logger=require(_0xca8d('0x6'))(_0xca8d('0x7'));var config=require(_0xca8d('0x8'));var jayson=require(_0xca8d('0x9'));var client=jayson[_0xca8d('0xa')][_0xca8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c7b2d,_0x4691fa,_0x5acbd7){return new BPromise(function(_0x2b65a8,_0xb4d190){return client[_0xca8d('0xc')](_0x2c7b2d,_0x5acbd7)[_0xca8d('0xd')](function(_0x1efa19){logger[_0xca8d('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4691fa,_0xca8d('0xf'));logger[_0xca8d('0x10')](_0xca8d('0x11'),_0x4691fa,_0xca8d('0xf'),JSON[_0xca8d('0x12')](_0x1efa19));if(_0x1efa19[_0xca8d('0x13')]){if(_0x1efa19[_0xca8d('0x13')][_0xca8d('0x14')]===0x1f4){logger[_0xca8d('0x13')](_0xca8d('0x15'),_0x4691fa,_0x1efa19[_0xca8d('0x13')][_0xca8d('0x16')]);return _0xb4d190(_0x1efa19[_0xca8d('0x13')]['message']);}logger['error'](_0xca8d('0x15'),_0x4691fa,_0x1efa19['error'][_0xca8d('0x16')]);return _0x2b65a8(_0x1efa19['error']['message']);}else{logger[_0xca8d('0xe')](_0xca8d('0x15'),_0x4691fa,'request\x20sent');_0x2b65a8(_0x1efa19[_0xca8d('0x17')][_0xca8d('0x16')]);}})[_0xca8d('0x18')](function(_0x3ceaa8){logger['error'](_0xca8d('0x15'),_0x4691fa,_0x3ceaa8);_0xb4d190(_0x3ceaa8);});});} \ No newline at end of file +var _0x38c0=['request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x35a2e2,_0xba6fcb){var _0x4058ba=function(_0x5971b9){while(--_0x5971b9){_0x35a2e2['push'](_0x35a2e2['shift']());}};_0x4058ba(++_0xba6fcb);}(_0x38c0,0x106));var _0x038c=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x38c0[_0x59befa];return _0x1dd63d;};'use strict';var _=require(_0x038c('0x0'));var util=require(_0x038c('0x1'));var moment=require('moment');var BPromise=require(_0x038c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x038c('0x3'));var db=require(_0x038c('0x4'))['db'];var utils=require(_0x038c('0x5'));var logger=require(_0x038c('0x6'))(_0x038c('0x7'));var config=require(_0x038c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x038c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x475cad,_0x37a5e7,_0x5654de){return new BPromise(function(_0x33f7ce,_0xf15d4a){return client[_0x038c('0xa')](_0x475cad,_0x5654de)[_0x038c('0xb')](function(_0x5dcb6d){logger[_0x038c('0xc')](_0x038c('0xd'),_0x37a5e7,_0x038c('0xe'));logger[_0x038c('0xf')](_0x038c('0x10'),_0x37a5e7,'request\x20sent',JSON[_0x038c('0x11')](_0x5dcb6d));if(_0x5dcb6d[_0x038c('0x12')]){if(_0x5dcb6d[_0x038c('0x12')][_0x038c('0x13')]===0x1f4){logger[_0x038c('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x37a5e7,_0x5dcb6d[_0x038c('0x12')]['message']);return _0xf15d4a(_0x5dcb6d[_0x038c('0x12')]['message']);}logger['error'](_0x038c('0xd'),_0x37a5e7,_0x5dcb6d['error'][_0x038c('0x14')]);return _0x33f7ce(_0x5dcb6d[_0x038c('0x12')][_0x038c('0x14')]);}else{logger[_0x038c('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x37a5e7,_0x038c('0xe'));_0x33f7ce(_0x5dcb6d[_0x038c('0x15')]['message']);}})[_0x038c('0x16')](function(_0x4f580e){logger[_0x038c('0x12')](_0x038c('0xd'),_0x37a5e7,_0x4f580e);_0xf15d4a(_0x4f580e);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index ef41e3f..140ea0a 100644 --- a/server/api/jscriptyProject/index.js +++ b/server/api/jscriptyProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0702=['path','connect-timeout','express','Router','../../components/auth/service','./jscriptyProject.controller','get','index','/:id','show','/:id/sessions','isAuthenticated','/:id/answers','getAnswers','/:id/summary','getSummary','post','/:id/clone','clone','put','delete','exports','multer','util'];(function(_0x22a90a,_0x461cdd){var _0x511604=function(_0x273219){while(--_0x273219){_0x22a90a['push'](_0x22a90a['shift']());}};_0x511604(++_0x461cdd);}(_0x0702,0x8e));var _0x2070=function(_0x44fcb8,_0x254dcf){_0x44fcb8=_0x44fcb8-0x0;var _0x12905b=_0x0702[_0x44fcb8];return _0x12905b;};'use strict';var multer=require(_0x2070('0x0'));var util=require(_0x2070('0x1'));var path=require(_0x2070('0x2'));var timeout=require(_0x2070('0x3'));var express=require(_0x2070('0x4'));var router=express[_0x2070('0x5')]();var auth=require(_0x2070('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2070('0x7'));router[_0x2070('0x8')]('/',auth['isAuthenticated'](),controller[_0x2070('0x9')]);router[_0x2070('0x8')](_0x2070('0xa'),auth['isAuthenticated'](),controller[_0x2070('0xb')]);router[_0x2070('0x8')](_0x2070('0xc'),auth[_0x2070('0xd')](),controller['getSessions']);router[_0x2070('0x8')](_0x2070('0xe'),auth[_0x2070('0xd')](),controller[_0x2070('0xf')]);router[_0x2070('0x8')](_0x2070('0x10'),auth['isAuthenticated'](),timeout('30s'),controller[_0x2070('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2070('0x12')](_0x2070('0x13'),auth[_0x2070('0xd')](),controller[_0x2070('0x14')]);router[_0x2070('0x15')](_0x2070('0xa'),auth[_0x2070('0xd')](),controller['update']);router[_0x2070('0x16')](_0x2070('0xa'),auth[_0x2070('0xd')](),controller['destroy']);module[_0x2070('0x17')]=router; \ No newline at end of file +var _0x4f88=['/:id','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get'];(function(_0x376760,_0x1ba7a0){var _0xbc326d=function(_0x39cc04){while(--_0x39cc04){_0x376760['push'](_0x376760['shift']());}};_0xbc326d(++_0x1ba7a0);}(_0x4f88,0x67));var _0x84f8=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x4f88[_0x5627e1];return _0x2f013f;};'use strict';var multer=require(_0x84f8('0x0'));var util=require(_0x84f8('0x1'));var path=require(_0x84f8('0x2'));var timeout=require(_0x84f8('0x3'));var express=require(_0x84f8('0x4'));var router=express[_0x84f8('0x5')]();var auth=require(_0x84f8('0x6'));var interaction=require(_0x84f8('0x7'));var config=require(_0x84f8('0x8'));var controller=require(_0x84f8('0x9'));router['get']('/',auth[_0x84f8('0xa')](),controller[_0x84f8('0xb')]);router[_0x84f8('0xc')](_0x84f8('0xd'),auth['isAuthenticated'](),controller[_0x84f8('0xe')]);router[_0x84f8('0xc')](_0x84f8('0xf'),auth['isAuthenticated'](),controller[_0x84f8('0x10')]);router[_0x84f8('0xc')](_0x84f8('0x11'),auth[_0x84f8('0xa')](),controller['getAnswers']);router['get'](_0x84f8('0x12'),auth[_0x84f8('0xa')](),timeout(_0x84f8('0x13')),controller['getSummary']);router[_0x84f8('0x14')]('/',auth[_0x84f8('0xa')](),controller[_0x84f8('0x15')]);router[_0x84f8('0x14')](_0x84f8('0x16'),auth[_0x84f8('0xa')](),controller[_0x84f8('0x17')]);router[_0x84f8('0x18')](_0x84f8('0xd'),auth[_0x84f8('0xa')](),controller[_0x84f8('0x19')]);router[_0x84f8('0x1a')](_0x84f8('0xd'),auth[_0x84f8('0xa')](),controller[_0x84f8('0x1b')]);module[_0x84f8('0x1c')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 382113e..582ff5e 100644 --- a/server/api/jscriptyProject/jscriptyProject.attributes.js +++ b/server/api/jscriptyProject/jscriptyProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cd3=['util','exports','STRING','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','getDataValue','name','description','BOOLEAN','sequelize','lodash'];(function(_0x217523,_0x5d793a){var _0x43e3e1=function(_0x477f77){while(--_0x477f77){_0x217523['push'](_0x217523['shift']());}};_0x43e3e1(++_0x5d793a);}(_0x1cd3,0x1de));var _0x31cd=function(_0x3aa3fc,_0x44c55d){_0x3aa3fc=_0x3aa3fc-0x0;var _0x2a71f4=_0x1cd3[_0x3aa3fc];return _0x2a71f4;};'use strict';var Sequelize=require(_0x31cd('0x0'));var _=require(_0x31cd('0x1'));var util=require(_0x31cd('0x2'));module[_0x31cd('0x3')]={'name':{'type':Sequelize[_0x31cd('0x4')],'unique':'name'},'description':{'type':Sequelize[_0x31cd('0x4')]},'formData':{'type':Sequelize[_0x31cd('0x5')](_0x31cd('0x6')),'set':function(_0x594be5){if(_[_0x31cd('0x7')](_0x594be5)){this[_0x31cd('0x8')]('formData',JSON[_0x31cd('0x9')](_0x594be5));}else if(_[_0x31cd('0xa')](_0x594be5)){this['setDataValue'](_0x31cd('0xb'),_0x594be5);}else{this[_0x31cd('0x8')](_0x31cd('0xb'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x31cd('0xc')](_0x31cd('0xd'))||'',this[_0x31cd('0xc')](_0x31cd('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x31cd('0xf')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa29c=['util','STRING','name','TEXT','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash'];(function(_0x5557e5,_0x3b6b23){var _0x5cdadc=function(_0xf23b5f){while(--_0xf23b5f){_0x5557e5['push'](_0x5557e5['shift']());}};_0x5cdadc(++_0x3b6b23);}(_0xa29c,0x15e));var _0xca29=function(_0x6303df,_0x16761e){_0x6303df=_0x6303df-0x0;var _0x4a34c7=_0xa29c[_0x6303df];return _0x4a34c7;};'use strict';var Sequelize=require(_0xca29('0x0'));var _=require(_0xca29('0x1'));var util=require(_0xca29('0x2'));module['exports']={'name':{'type':Sequelize[_0xca29('0x3')],'unique':_0xca29('0x4')},'description':{'type':Sequelize[_0xca29('0x3')]},'formData':{'type':Sequelize[_0xca29('0x5')]('long'),'set':function(_0x1e3fe5){if(_[_0xca29('0x6')](_0x1e3fe5)){this[_0xca29('0x7')](_0xca29('0x8'),JSON[_0xca29('0x9')](_0x1e3fe5));}else if(_[_0xca29('0xa')](_0x1e3fe5)){this[_0xca29('0x7')](_0xca29('0x8'),_0x1e3fe5);}else{this[_0xca29('0x7')](_0xca29('0x8'),util[_0xca29('0xb')](_0xca29('0xc'),this[_0xca29('0xd')](_0xca29('0x4'))||'',this[_0xca29('0xd')](_0xca29('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xca29('0xf')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 98fc5e9..5af10ce 100644 --- a/server/api/jscriptyProject/jscriptyProject.controller.js +++ b/server/api/jscriptyProject/jscriptyProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['filter','merge','map','field','options','count','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','findOne','rawAttributes','pick','ProjectId','JscriptySessionReport','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','error','stack','name','send','index','JscriptyProject','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x44fd81,_0x4003db){var _0x32d50c=function(_0x41ab3e){while(--_0x41ab3e){_0x44fd81['push'](_0x44fd81['shift']());}};_0x32d50c(++_0x4003db);}(_0xb10b,0x12a));var _0xbb10=function(_0x41598b,_0x897d53){_0x41598b=_0x41598b-0x0;var _0x2cb5e5=_0xb10b[_0x41598b];return _0x2cb5e5;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xcc;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x18')](_0x44fb19);}return _0x5be7e0[_0xbb10('0x19')](_0x44fb19)[_0xbb10('0x1a')]();};}function respondWithResult(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xc8;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x19')](_0x58a612)[_0xbb10('0x1b')](_0x26e021);}};}function respondWithFilteredResult(_0x17fd46,_0x3df17b){return function(_0x2f2ebf){if(_0x2f2ebf){var _0x24a57b=_0x2f2ebf['count'],_0x36b5e8=_0x3df17b[_0xbb10('0x1c')],_0x3e26f4=_0x3df17b[_0xbb10('0x1c')]+_0x3df17b[_0xbb10('0x1d')],_0x2b184e;if(_0x3e26f4>=_0x24a57b){_0x3e26f4=_0x24a57b;_0x2b184e=0xc8;}else{_0x2b184e=0xce;}_0x17fd46[_0xbb10('0x19')](_0x2b184e);return _0x17fd46[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x36b5e8+'-'+_0x3e26f4+'/'+_0x24a57b)[_0xbb10('0x1b')](_0x2f2ebf);}return null;};}function patchUpdates(_0x30efc6){return function(_0xbf2906){try{jsonpatch[_0xbb10('0x20')](_0xbf2906,_0x30efc6,!![]);}catch(_0x48b6e9){return BPromise[_0xbb10('0x21')](_0x48b6e9);}return _0xbf2906[_0xbb10('0x22')]();};}function saveUpdates(_0x388fab,_0x109908){return function(_0xdf237d){if(_0xdf237d){return _0xdf237d[_0xbb10('0x23')](_0x388fab)['then'](function(_0x12f888){return _0x12f888;});}return null;};}function removeEntity(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x24')]()[_0xbb10('0x25')](function(){var _0x2e911d=_0x4c4b0d[_0xbb10('0x26')]({'plain':!![]});var _0x445761=_0xbb10('0x27');return db[_0xbb10('0x28')][_0xbb10('0x24')]({'where':{'type':_0x445761,'resourceId':_0x2e911d['id']}})[_0xbb10('0x25')](function(){return _0x4c4b0d;});})[_0xbb10('0x25')](function(){_0x12ef77[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x29')](_0x4e25ff[_0xbb10('0x2a')]);if(_0x4e25ff[_0xbb10('0x2b')]){delete _0x4e25ff[_0xbb10('0x2b')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x2c')](_0x4e25ff);};}exports[_0xbb10('0x2d')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=db[_0xbb10('0x2e')]['rawAttributes'];_0xfc3595[_0xbb10('0x2f')]=_['keys'](_0x1d30aa);_0xfc3595[_0xbb10('0x30')]=_['keys'](_0x4aabb9[_0xbb10('0x30')]);_0xfc3595[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0xfc3595['model'],_0xfc3595['query']);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595['model'],qs[_0xbb10('0x34')](_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595['model'];if(!_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x1d')]);_0x21ac54[_0xbb10('0x1c')]=qs[_0xbb10('0x1c')](_0x4aabb9['query'][_0xbb10('0x1c')]);}_0x21ac54[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x4aabb9[_0xbb10('0x30')]['sort']);_0x21ac54[_0xbb10('0x3a')]=qs['filters'](_['pick'](_0x4aabb9[_0xbb10('0x30')],_0xfc3595[_0xbb10('0x31')]));if(_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x3b')]){_0x21ac54[_0xbb10('0x3a')]=_[_0xbb10('0x3c')](_0x21ac54['where'],{'$or':_[_0xbb10('0x3d')](_0x1d30aa,function(_0x25d72f){if(_0x25d72f['type']['key']!=='VIRTUAL'){var _0x31bee3={};_0x31bee3[_0x25d72f[_0xbb10('0x3e')]]={'$like':'%'+_0x4aabb9[_0xbb10('0x30')]['filter']+'%'};return _0x31bee3;}})});}_0x21ac54=_[_0xbb10('0x3c')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x4345f3={'where':_0x21ac54['where']};return db[_0xbb10('0x2e')][_0xbb10('0x40')](_0x4345f3)[_0xbb10('0x25')](function(_0x446f49){_0x2e0249['count']=_0x446f49;if(_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x41')]){_0x21ac54['include']=[{'all':!![]}];}return db[_0xbb10('0x2e')][_0xbb10('0x42')](_0x21ac54);})[_0xbb10('0x25')](function(_0x3a9934){_0x2e0249[_0xbb10('0x43')]=_0x3a9934;return _0x2e0249;})[_0xbb10('0x25')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x44')]=function(_0x1c7fae,_0x3e7b4c){var _0x3d3c41={'raw':![],'where':{'id':_0x1c7fae[_0xbb10('0x45')]['id']}},_0x4943d9={};_0x4943d9[_0xbb10('0x2f')]=_[_0xbb10('0x46')](db[_0xbb10('0x2e')]['rawAttributes']);_0x4943d9[_0xbb10('0x30')]=_[_0xbb10('0x46')](_0x1c7fae['query']);_0x4943d9['filters']=_[_0xbb10('0x32')](_0x4943d9['model'],_0x4943d9[_0xbb10('0x30')]);_0x3d3c41[_0xbb10('0x33')]=_['intersection'](_0x4943d9[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x1c7fae[_0xbb10('0x30')]['fields']));_0x3d3c41[_0xbb10('0x33')]=_0x3d3c41[_0xbb10('0x33')][_0xbb10('0x35')]?_0x3d3c41[_0xbb10('0x33')]:_0x4943d9[_0xbb10('0x2f')];if(_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x41')]){_0x3d3c41[_0xbb10('0x47')]=[{'all':!![]}];}_0x3d3c41=_[_0xbb10('0x3c')]({},_0x3d3c41,_0x1c7fae[_0xbb10('0x3f')]);return db[_0xbb10('0x2e')][_0xbb10('0x48')](_0x3d3c41)['then'](handleEntityNotFound(_0x3e7b4c,null))[_0xbb10('0x25')](respondWithResult(_0x3e7b4c,null))[_0xbb10('0x49')](handleError(_0x3e7b4c,null));};exports['create']=function(_0x14e1cb,_0x2f5027){return db[_0xbb10('0x2e')][_0xbb10('0x4a')](_0x14e1cb[_0xbb10('0x4b')],{})[_0xbb10('0x25')](function(_0x3e06b0){var _0x5be85e=_0x14e1cb['user'][_0xbb10('0x26')]({'plain':!![]});if(!_0x5be85e)throw new Error(_0xbb10('0x4c'));if(_0x5be85e[_0xbb10('0x4d')]==='user'){var _0x5f0c12=_0x3e06b0[_0xbb10('0x26')]({'plain':!![]});var _0x34cf4e=_0xbb10('0x27');return db[_0xbb10('0x4e')][_0xbb10('0x48')]({'where':{'name':_0x34cf4e,'userProfileId':_0x5be85e[_0xbb10('0x4f')]},'raw':!![]})[_0xbb10('0x25')](function(_0x460788){if(_0x460788&&_0x460788[_0xbb10('0x50')]===0x0){return db[_0xbb10('0x28')]['create']({'name':_0x5f0c12['name'],'resourceId':_0x5f0c12['id'],'type':_0x460788[_0xbb10('0x2b')],'sectionId':_0x460788['id']},{})[_0xbb10('0x25')](function(){return _0x3e06b0;});}else{return _0x3e06b0;}})[_0xbb10('0x49')](function(_0xb014b0){logger[_0xbb10('0x29')](_0xbb10('0x51'),_0xb014b0);throw _0xb014b0;});}return _0x3e06b0;})[_0xbb10('0x25')](respondWithResult(_0x2f5027,0xc9))[_0xbb10('0x49')](handleError(_0x2f5027,null));};exports[_0xbb10('0x52')]=function(_0x1214f7,_0x19ca3e){var _0x20e18a={'raw':![],'where':{'id':_0x1214f7[_0xbb10('0x45')]['id']}},_0x61e689={};_0x61e689[_0xbb10('0x2f')]=_['keys'](db[_0xbb10('0x2e')]['rawAttributes']);_0x20e18a[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x61e689[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x1214f7[_0xbb10('0x30')][_0xbb10('0x34')]));_0x20e18a[_0xbb10('0x33')]=_0x20e18a[_0xbb10('0x33')][_0xbb10('0x35')]?_0x20e18a[_0xbb10('0x33')]:_0x61e689[_0xbb10('0x2f')];if(_0x1214f7[_0xbb10('0x30')][_0xbb10('0x41')]){_0x20e18a[_0xbb10('0x47')]=[{'all':!![]}];}_0x20e18a=_[_0xbb10('0x3c')]({},_0x20e18a,_0x1214f7['options']);return db[_0xbb10('0x2e')][_0xbb10('0x48')](_0x20e18a)[_0xbb10('0x25')](handleEntityNotFound(_0x19ca3e,null))[_0xbb10('0x25')](function(_0xbffa3c){if(_0xbffa3c){var _0x379d8c=_0xbffa3c['get']({'plain':!![]});_0x379d8c=qs[_0xbb10('0x53')](_0x379d8c,['id',_0xbb10('0x54'),_0xbb10('0x55')]);_0x1214f7[_0xbb10('0x4b')]=_[_0xbb10('0x53')](_0x1214f7[_0xbb10('0x4b')],['id',_0xbb10('0x54'),_0xbb10('0x55')]);return db[_0xbb10('0x2e')][_0xbb10('0x4a')](_[_0xbb10('0x3c')](_0x379d8c,_0x1214f7[_0xbb10('0x4b')]),{'include':_0x1214f7[_0xbb10('0x30')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x16272d){var _0x3e6338=_0x1214f7[_0xbb10('0x56')][_0xbb10('0x26')]({'plain':!![]});if(!_0x3e6338)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e6338['role']===_0xbb10('0x56')){var _0xaf2cc3=_0x16272d[_0xbb10('0x26')]({'plain':!![]});var _0x2dd150=_0xbb10('0x27');return db[_0xbb10('0x4e')][_0xbb10('0x48')]({'where':{'name':_0x2dd150,'userProfileId':_0x3e6338['userProfileId']},'raw':!![]})[_0xbb10('0x25')](function(_0x216cff){if(_0x216cff&&_0x216cff['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xaf2cc3[_0xbb10('0x2b')],'resourceId':_0xaf2cc3['id'],'type':_0x216cff[_0xbb10('0x2b')],'sectionId':_0x216cff['id']},{})[_0xbb10('0x25')](function(){return _0x16272d;});}else{return _0x16272d;}})['catch'](function(_0x4e6e7c){logger['error'](_0xbb10('0x51'),_0x4e6e7c);throw _0x4e6e7c;});}return _0x16272d;});}})[_0xbb10('0x25')](respondWithResult(_0x19ca3e,0xc9))[_0xbb10('0x49')](handleError(_0x19ca3e,null));};exports['update']=function(_0xa1bbd9,_0x13131c){if(_0xa1bbd9['body']['id']){delete _0xa1bbd9['body']['id'];}return db[_0xbb10('0x2e')][_0xbb10('0x48')]({'where':{'id':_0xa1bbd9[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x13131c,null))['then'](saveUpdates(_0xa1bbd9[_0xbb10('0x4b')],null))[_0xbb10('0x25')](respondWithResult(_0x13131c,null))[_0xbb10('0x49')](handleError(_0x13131c,null));};exports['destroy']=function(_0x402a01,_0x2f05bc){return db[_0xbb10('0x2e')]['find']({'where':{'id':_0x402a01[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x2f05bc,null))[_0xbb10('0x25')](removeEntity(_0x2f05bc,null))[_0xbb10('0x49')](handleError(_0x2f05bc,null));};exports['getSessions']=function(_0x251417,_0x258e55,_0x108e5b){var _0x2d0f4b={'raw':!![],'where':{}};var _0x56b3a3={};var _0x354ea7={'count':0x0,'rows':[]};return db[_0xbb10('0x2e')][_0xbb10('0x57')]({'where':{'id':_0x251417[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x258e55,null))[_0xbb10('0x25')](function(_0x1e4694){if(_0x1e4694){_0x56b3a3['model']=_['keys'](db['JscriptySessionReport'][_0xbb10('0x58')]);_0x56b3a3[_0xbb10('0x30')]=_[_0xbb10('0x46')](_0x251417['query']);_0x56b3a3['filters']=_[_0xbb10('0x32')](_0x56b3a3[_0xbb10('0x2f')],_0x56b3a3[_0xbb10('0x30')]);_0x2d0f4b[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x56b3a3[_0xbb10('0x2f')],qs['fields'](_0x251417[_0xbb10('0x30')][_0xbb10('0x34')]));_0x2d0f4b[_0xbb10('0x33')]=_0x2d0f4b[_0xbb10('0x33')][_0xbb10('0x35')]?_0x2d0f4b['attributes']:_0x56b3a3['model'];if(!_0x251417['query'][_0xbb10('0x36')](_0xbb10('0x37'))){_0x2d0f4b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x251417[_0xbb10('0x30')][_0xbb10('0x1d')]);_0x2d0f4b['offset']=qs[_0xbb10('0x1c')](_0x251417['query']['offset']);}_0x2d0f4b['order']=qs[_0xbb10('0x39')](_0x251417[_0xbb10('0x30')][_0xbb10('0x39')]);_0x2d0f4b[_0xbb10('0x3a')]=qs['filters'](_[_0xbb10('0x59')](_0x251417['query'],_0x56b3a3['filters']));_0x2d0f4b[_0xbb10('0x3a')][_0xbb10('0x5a')]=_0x1e4694['id'];if(_0x251417[_0xbb10('0x30')][_0xbb10('0x3b')]){_0x2d0f4b[_0xbb10('0x3a')]=_['merge'](_0x2d0f4b[_0xbb10('0x3a')],{'$or':_[_0xbb10('0x3d')](_0x2d0f4b[_0xbb10('0x33')],function(_0x3f3d38){var _0x43cdb7={};_0x43cdb7[_0x3f3d38]={'$like':'%'+_0x251417[_0xbb10('0x30')][_0xbb10('0x3b')]+'%'};return _0x43cdb7;})});}_0x2d0f4b=_['merge']({},_0x2d0f4b,_0x251417[_0xbb10('0x3f')]);return db[_0xbb10('0x5b')][_0xbb10('0x40')]({'where':_0x2d0f4b[_0xbb10('0x3a')]})[_0xbb10('0x25')](function(_0x172be3){_0x354ea7[_0xbb10('0x40')]=_0x172be3;if(_0x251417[_0xbb10('0x30')]['includeAll']){_0x2d0f4b[_0xbb10('0x47')]=[{'all':!![]}];}return db[_0xbb10('0x5b')][_0xbb10('0x42')](_0x2d0f4b);})['then'](function(_0x4ee101){_0x354ea7['rows']=_0x4ee101;return _0x354ea7;});}})[_0xbb10('0x25')](respondWithFilteredResult(_0x258e55,_0x2d0f4b))['catch'](handleError(_0x258e55,null));};exports['getAnswers']=function(_0x1701c5,_0x3ee56b,_0x33ff06){var _0x12ed63={'raw':!![],'where':{}};var _0x32ec27={};var _0x24dca6={'count':0x0,'rows':[]};return db[_0xbb10('0x2e')][_0xbb10('0x57')]({'where':{'id':_0x1701c5[_0xbb10('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ee56b,null))[_0xbb10('0x25')](function(_0x1351eb){if(_0x1351eb){_0x32ec27[_0xbb10('0x2f')]=_[_0xbb10('0x46')](db['JscriptyAnswerReport']['rawAttributes']);_0x32ec27[_0xbb10('0x30')]=_[_0xbb10('0x46')](_0x1701c5[_0xbb10('0x30')]);_0x32ec27[_0xbb10('0x31')]=_['intersection'](_0x32ec27[_0xbb10('0x2f')],_0x32ec27[_0xbb10('0x30')]);_0x12ed63[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x32ec27[_0xbb10('0x2f')],qs['fields'](_0x1701c5['query'][_0xbb10('0x34')]));_0x12ed63[_0xbb10('0x33')]=_0x12ed63[_0xbb10('0x33')]['length']?_0x12ed63[_0xbb10('0x33')]:_0x32ec27[_0xbb10('0x2f')];if(!_0x1701c5['query']['hasOwnProperty'](_0xbb10('0x37'))){_0x12ed63[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x1701c5['query'][_0xbb10('0x1d')]);_0x12ed63[_0xbb10('0x1c')]=qs[_0xbb10('0x1c')](_0x1701c5[_0xbb10('0x30')][_0xbb10('0x1c')]);}_0x12ed63[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x1701c5[_0xbb10('0x30')][_0xbb10('0x39')]);_0x12ed63['where']=qs[_0xbb10('0x31')](_[_0xbb10('0x59')](_0x1701c5[_0xbb10('0x30')],_0x32ec27[_0xbb10('0x31')]));_0x12ed63[_0xbb10('0x3a')][_0xbb10('0x5a')]=_0x1351eb['id'];if(_0x1701c5[_0xbb10('0x30')][_0xbb10('0x3b')]){_0x12ed63[_0xbb10('0x3a')]=_[_0xbb10('0x3c')](_0x12ed63[_0xbb10('0x3a')],{'$or':_[_0xbb10('0x3d')](_0x12ed63['attributes'],function(_0x51f106){var _0xe1fc51={};_0xe1fc51[_0x51f106]={'$like':'%'+_0x1701c5[_0xbb10('0x30')][_0xbb10('0x3b')]+'%'};return _0xe1fc51;})});}_0x12ed63=_[_0xbb10('0x3c')]({},_0x12ed63,_0x1701c5[_0xbb10('0x3f')]);return db['JscriptyAnswerReport'][_0xbb10('0x40')]({'where':_0x12ed63[_0xbb10('0x3a')]})[_0xbb10('0x25')](function(_0x1a51d3){_0x24dca6[_0xbb10('0x40')]=_0x1a51d3;if(_0x1701c5[_0xbb10('0x30')]['includeAll']){_0x12ed63[_0xbb10('0x47')]=[{'all':!![]}];}return db[_0xbb10('0x5c')]['findAll'](_0x12ed63);})[_0xbb10('0x25')](function(_0x55e58b){_0x24dca6[_0xbb10('0x43')]=_0x55e58b;return _0x24dca6;});}})[_0xbb10('0x25')](respondWithFilteredResult(_0x3ee56b,_0x12ed63))[_0xbb10('0x49')](handleError(_0x3ee56b,null));};function char(_0xa99bf5){return _0xbb10('0x5d')===typeof _0xa99bf5?String['fromCharCode'][_0xbb10('0x20')](null,arguments):_0xa99bf5;}function needsEncapsulation(_0x5238bc){return!!_0x5238bc&&(_0x5238bc[_0xbb10('0x5e')]()[_0xbb10('0x5f')](char(0xd))>=0x0||_0x5238bc['toString']()['indexOf'](char(0xa))>=0x0||_0x5238bc[_0xbb10('0x5e')]()[_0xbb10('0x5f')](char(0x2c))>=0x0||_0x5238bc[_0xbb10('0x5e')]()[_0xbb10('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x18d18d){var _0x1cb22f=char(0x22),_0x1b6ebc='\x5c'+char(0x22),_0x25b4ef=_0x18d18d[_0xbb10('0x5e')]()[_0xbb10('0x60')](new RegExp(_0x1cb22f,'g'),_0x1b6ebc);return _0x1cb22f+_0x25b4ef+_0x1cb22f;}exports[_0xbb10('0x61')]=function(_0x4c0b83,_0x2b9a50,_0x3eeceb){var _0x1b0a6c,_0xcd5d35;var _0xfe02f5={'where':{'ProjectId':_0x4c0b83[_0xbb10('0x45')]['id']}};if(_0x4c0b83[_0xbb10('0x30')][_0xbb10('0x62')]){_0xfe02f5[_0xbb10('0x3a')][_0xbb10('0x63')]=JSON[_0xbb10('0x64')](_0x4c0b83[_0xbb10('0x30')]['startTime']);}return db[_0xbb10('0x5b')]['findAll'](_0xfe02f5)[_0xbb10('0x25')](handleEntityNotFound(_0x2b9a50,null))[_0xbb10('0x25')](function(_0x3b2b54){if(_0x3b2b54){_0x1b0a6c=_0x3b2b54;return db[_0xbb10('0x65')][_0xbb10('0x42')]({'where':{'SessionId':{'$in':_['map'](_0x1b0a6c,'id')},'ProjectId':_0x4c0b83[_0xbb10('0x45')]['id']},'order':_0xbb10('0x66')});}})[_0xbb10('0x25')](handleEntityNotFound(_0x2b9a50,null))[_0xbb10('0x25')](function(_0x315b55){if(_0x315b55){_0xcd5d35=_0x315b55;var _0x41380b={};for(var _0x4970fe=0x0,_0x4bd470=_0xcd5d35[_0xbb10('0x35')];_0x4970fe<_0x4bd470;_0x4970fe++){if(!_0x41380b[_0xbb10('0x36')](_0xcd5d35[_0x4970fe][_0xbb10('0x67')])){_0x41380b[_0xcd5d35[_0x4970fe]['questionId']]=needsEncapsulation(_0xcd5d35[_0x4970fe][_0xbb10('0x68')])?encapsulate(_0xcd5d35[_0x4970fe][_0xbb10('0x68')]):_0xcd5d35[_0x4970fe]['question'];}}var _0x2831de=[],_0xaede56={};for(var _0x5642c3=0x0,_0xdd3c7e=_0x1b0a6c['length'];_0x5642c3<_0xdd3c7e;_0x5642c3++){_0xaede56={'ProjectId':_0x4c0b83[_0xbb10('0x45')]['id'],'SessionId':_0x1b0a6c[_0x5642c3]['id'],'StartTime':moment(_0x1b0a6c[_0x5642c3][_0xbb10('0x63')])['format'](_0xbb10('0x69'))};for(var _0x28cc74=0x0,_0x4bac29=_0xcd5d35['length'];_0x28cc74<_0x4bac29;_0x28cc74++){if(_0xcd5d35[_0x28cc74][_0xbb10('0x6a')]==_0x1b0a6c[_0x5642c3]['id']&&_0x41380b[_0xbb10('0x36')](_0xcd5d35[_0x28cc74][_0xbb10('0x67')])){_0xaede56[_0x41380b[_0xcd5d35[_0x28cc74][_0xbb10('0x67')]]]=_0xcd5d35[_0x28cc74][_0xbb10('0x6b')];}}for(var _0x4c3bdc in _0x41380b){if(!_0xaede56[_0xbb10('0x36')](_0x41380b[_0x4c3bdc])){_0xaede56[_0x41380b[_0x4c3bdc]]=null;}}_0x2831de[_0xbb10('0x6c')](_0xaede56);}return _0x2831de;}})[_0xbb10('0x25')](function(_0x59e020){if(!_[_0xbb10('0x6d')](_0x59e020)){var _0x4f90e6=toCsv(_0x59e020);var _0x248887=Date[_0xbb10('0x6e')]();fs[_0xbb10('0x6f')](util[_0xbb10('0x70')](_0xbb10('0x71'),_0x4c0b83[_0xbb10('0x45')]['id'],_0x248887),_0x4f90e6);_0x2b9a50[_0xbb10('0x72')]('Content-disposition','attachment;\x20filename='+util[_0xbb10('0x70')](_0xbb10('0x73'),_0x4c0b83[_0xbb10('0x45')]['id'],_0x248887));_0x2b9a50[_0xbb10('0x72')](_0xbb10('0x74'),_0xbb10('0x75'));return _0x2b9a50[_0xbb10('0x76')](util[_0xbb10('0x70')](_0xbb10('0x71'),_0x4c0b83[_0xbb10('0x45')]['id'],_0x248887));}else{return _0x2b9a50[_0xbb10('0x18')](0xcc);}})[_0xbb10('0x49')](handleError(_0x2b9a50,null));}; \ No newline at end of file +var _0x7a54=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','nolimit','order','sort','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','getSummary','starttime','parse','startTime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Content-type','text/csv','download','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','offset','where','pick','filter','merge','map','type','key','field','options','JscriptyProject','includeAll','include','findAll','rows','catch','show','params','length','find','create','role','user','UserProfileSection'];(function(_0x342886,_0x305f72){var _0xce7b0f=function(_0x4a82a6){while(--_0x4a82a6){_0x342886['push'](_0x342886['shift']());}};_0xce7b0f(++_0x305f72);}(_0x7a54,0x106));var _0x47a5=function(_0x48dccc,_0x5604a2){_0x48dccc=_0x48dccc-0x0;var _0x27d14f=_0x7a54[_0x48dccc];return _0x27d14f;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];function respondWithStatusCode(_0x250fad,_0xd612dd){_0xd612dd=_0xd612dd||0xcc;return function(_0xd308b8){if(_0xd308b8){return _0x250fad[_0x47a5('0x14')](_0xd612dd);}return _0x250fad['status'](_0xd612dd)[_0x47a5('0x15')]();};}function respondWithResult(_0x221b54,_0x1cf309){_0x1cf309=_0x1cf309||0xc8;return function(_0x711793){if(_0x711793){return _0x221b54[_0x47a5('0x16')](_0x1cf309)[_0x47a5('0x17')](_0x711793);}};}function respondWithFilteredResult(_0x3c6c46,_0x190faa){return function(_0x4e99a8){if(_0x4e99a8){var _0x362359=_0x4e99a8[_0x47a5('0x18')],_0x11faf5=_0x190faa['offset'],_0x3b001e=_0x190faa['offset']+_0x190faa[_0x47a5('0x19')],_0x2a2cbb;if(_0x3b001e>=_0x362359){_0x3b001e=_0x362359;_0x2a2cbb=0xc8;}else{_0x2a2cbb=0xce;}_0x3c6c46['status'](_0x2a2cbb);return _0x3c6c46['set'](_0x47a5('0x1a'),_0x11faf5+'-'+_0x3b001e+'/'+_0x362359)[_0x47a5('0x17')](_0x4e99a8);}return null;};}function patchUpdates(_0x2ce454){return function(_0x1ef371){try{jsonpatch[_0x47a5('0x1b')](_0x1ef371,_0x2ce454,!![]);}catch(_0x12b98e){return BPromise[_0x47a5('0x1c')](_0x12b98e);}return _0x1ef371[_0x47a5('0x1d')]();};}function saveUpdates(_0x3aed38,_0x4a9fcb){return function(_0x1570bc){if(_0x1570bc){return _0x1570bc[_0x47a5('0x1e')](_0x3aed38)['then'](function(_0x2b0360){return _0x2b0360;});}return null;};}function removeEntity(_0x1f03f7,_0x36874d){return function(_0x4c5910){if(_0x4c5910){return _0x4c5910[_0x47a5('0x1f')]()[_0x47a5('0x20')](function(){var _0x23db32=_0x4c5910[_0x47a5('0x21')]({'plain':!![]});var _0x5ef1b1=_0x47a5('0x22');return db[_0x47a5('0x23')]['destroy']({'where':{'type':_0x5ef1b1,'resourceId':_0x23db32['id']}})[_0x47a5('0x20')](function(){return _0x4c5910;});})[_0x47a5('0x20')](function(){_0x1f03f7[_0x47a5('0x16')](0xcc)[_0x47a5('0x15')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x14')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x24')](_0x5b6c4e[_0x47a5('0x25')]);if(_0x5b6c4e[_0x47a5('0x26')]){delete _0x5b6c4e[_0x47a5('0x26')];}_0x5686db[_0x47a5('0x16')](_0x1ea9c8)[_0x47a5('0x27')](_0x5b6c4e);};}exports[_0x47a5('0x28')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=db['JscriptyProject'][_0x47a5('0x29')];_0x1127f8['model']=_[_0x47a5('0x2a')](_0x3ad507);_0x1127f8[_0x47a5('0x2b')]=_[_0x47a5('0x2a')](_0x136b14['query']);_0x1127f8[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x1127f8[_0x47a5('0x2e')],_0x1127f8[_0x47a5('0x2b')]);_0x361bfa['attributes']=_['intersection'](_0x1127f8[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x136b14['query']['fields']));_0x361bfa[_0x47a5('0x30')]=_0x361bfa[_0x47a5('0x30')]['length']?_0x361bfa[_0x47a5('0x30')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2b')][_0x47a5('0x31')]('nolimit')){_0x361bfa['limit']=qs[_0x47a5('0x19')](_0x136b14['query'][_0x47a5('0x19')]);_0x361bfa[_0x47a5('0x32')]=qs[_0x47a5('0x32')](_0x136b14['query'][_0x47a5('0x32')]);}_0x361bfa['order']=qs['sort'](_0x136b14[_0x47a5('0x2b')]['sort']);_0x361bfa[_0x47a5('0x33')]=qs['filters'](_[_0x47a5('0x34')](_0x136b14[_0x47a5('0x2b')],_0x1127f8[_0x47a5('0x2c')]));if(_0x136b14[_0x47a5('0x2b')][_0x47a5('0x35')]){_0x361bfa[_0x47a5('0x33')]=_[_0x47a5('0x36')](_0x361bfa[_0x47a5('0x33')],{'$or':_[_0x47a5('0x37')](_0x3ad507,function(_0x4caed5){if(_0x4caed5[_0x47a5('0x38')][_0x47a5('0x39')]!=='VIRTUAL'){var _0x2c50d6={};_0x2c50d6[_0x4caed5[_0x47a5('0x3a')]]={'$like':'%'+_0x136b14[_0x47a5('0x2b')]['filter']+'%'};return _0x2c50d6;}})});}_0x361bfa=_[_0x47a5('0x36')]({},_0x361bfa,_0x136b14[_0x47a5('0x3b')]);var _0x596097={'where':_0x361bfa[_0x47a5('0x33')]};return db[_0x47a5('0x3c')]['count'](_0x596097)['then'](function(_0x5ebd8c){_0x11a4fa[_0x47a5('0x18')]=_0x5ebd8c;if(_0x136b14['query'][_0x47a5('0x3d')]){_0x361bfa[_0x47a5('0x3e')]=[{'all':!![]}];}return db[_0x47a5('0x3c')][_0x47a5('0x3f')](_0x361bfa);})[_0x47a5('0x20')](function(_0xcb5243){_0x11a4fa[_0x47a5('0x40')]=_0xcb5243;return _0x11a4fa;})[_0x47a5('0x20')](respondWithFilteredResult(_0x16631f,_0x361bfa))[_0x47a5('0x41')](handleError(_0x16631f,null));};exports[_0x47a5('0x42')]=function(_0x280500,_0x1658e8){var _0x23d6d8={'raw':![],'where':{'id':_0x280500[_0x47a5('0x43')]['id']}},_0x56dbbd={};_0x56dbbd[_0x47a5('0x2e')]=_[_0x47a5('0x2a')](db[_0x47a5('0x3c')]['rawAttributes']);_0x56dbbd[_0x47a5('0x2b')]=_['keys'](_0x280500['query']);_0x56dbbd['filters']=_['intersection'](_0x56dbbd[_0x47a5('0x2e')],_0x56dbbd['query']);_0x23d6d8[_0x47a5('0x30')]=_[_0x47a5('0x2d')](_0x56dbbd[_0x47a5('0x2e')],qs['fields'](_0x280500[_0x47a5('0x2b')][_0x47a5('0x2f')]));_0x23d6d8['attributes']=_0x23d6d8['attributes'][_0x47a5('0x44')]?_0x23d6d8['attributes']:_0x56dbbd[_0x47a5('0x2e')];if(_0x280500[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x23d6d8[_0x47a5('0x3e')]=[{'all':!![]}];}_0x23d6d8=_[_0x47a5('0x36')]({},_0x23d6d8,_0x280500[_0x47a5('0x3b')]);return db[_0x47a5('0x3c')][_0x47a5('0x45')](_0x23d6d8)[_0x47a5('0x20')](handleEntityNotFound(_0x1658e8,null))[_0x47a5('0x20')](respondWithResult(_0x1658e8,null))[_0x47a5('0x41')](handleError(_0x1658e8,null));};exports[_0x47a5('0x46')]=function(_0xe28d76,_0x3574d4){return db[_0x47a5('0x3c')][_0x47a5('0x46')](_0xe28d76['body'],{})[_0x47a5('0x20')](function(_0x23bb04){var _0x49eab1=_0xe28d76['user'][_0x47a5('0x21')]({'plain':!![]});if(!_0x49eab1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49eab1[_0x47a5('0x47')]===_0x47a5('0x48')){var _0x54c35f=_0x23bb04['get']({'plain':!![]});var _0x3d85cc='Projects';return db[_0x47a5('0x49')][_0x47a5('0x45')]({'where':{'name':_0x3d85cc,'userProfileId':_0x49eab1[_0x47a5('0x4a')]},'raw':!![]})[_0x47a5('0x20')](function(_0x44fe8a){if(_0x44fe8a&&_0x44fe8a[_0x47a5('0x4b')]===0x0){return db[_0x47a5('0x23')]['create']({'name':_0x54c35f['name'],'resourceId':_0x54c35f['id'],'type':_0x44fe8a[_0x47a5('0x26')],'sectionId':_0x44fe8a['id']},{})[_0x47a5('0x20')](function(){return _0x23bb04;});}else{return _0x23bb04;}})[_0x47a5('0x41')](function(_0x9ea93e){logger[_0x47a5('0x24')](_0x47a5('0x4c'),_0x9ea93e);throw _0x9ea93e;});}return _0x23bb04;})[_0x47a5('0x20')](respondWithResult(_0x3574d4,0xc9))['catch'](handleError(_0x3574d4,null));};exports[_0x47a5('0x4d')]=function(_0x1c9a62,_0x5f6a){var _0x5c3c75={'raw':![],'where':{'id':_0x1c9a62['params']['id']}},_0x12ca40={};_0x12ca40[_0x47a5('0x2e')]=_[_0x47a5('0x2a')](db[_0x47a5('0x3c')][_0x47a5('0x29')]);_0x5c3c75['attributes']=_[_0x47a5('0x2d')](_0x12ca40[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x1c9a62[_0x47a5('0x2b')][_0x47a5('0x2f')]));_0x5c3c75[_0x47a5('0x30')]=_0x5c3c75[_0x47a5('0x30')]['length']?_0x5c3c75[_0x47a5('0x30')]:_0x12ca40[_0x47a5('0x2e')];if(_0x1c9a62[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x5c3c75[_0x47a5('0x3e')]=[{'all':!![]}];}_0x5c3c75=_[_0x47a5('0x36')]({},_0x5c3c75,_0x1c9a62['options']);return db[_0x47a5('0x3c')][_0x47a5('0x45')](_0x5c3c75)[_0x47a5('0x20')](handleEntityNotFound(_0x5f6a,null))['then'](function(_0x4c5ed){if(_0x4c5ed){var _0x3c78b7=_0x4c5ed[_0x47a5('0x21')]({'plain':!![]});_0x3c78b7=qs['omit'](_0x3c78b7,['id','createdAt',_0x47a5('0x4e')]);_0x1c9a62[_0x47a5('0x4f')]=_['omit'](_0x1c9a62['body'],['id',_0x47a5('0x50'),'updatedAt']);return db[_0x47a5('0x3c')]['create'](_['merge'](_0x3c78b7,_0x1c9a62[_0x47a5('0x4f')]),{'include':_0x1c9a62[_0x47a5('0x2b')]['includeAll']?[{'all':!![]}]:undefined})[_0x47a5('0x20')](function(_0x72fe){var _0x4b706a=_0x1c9a62['user'][_0x47a5('0x21')]({'plain':!![]});if(!_0x4b706a)throw new Error(_0x47a5('0x51'));if(_0x4b706a[_0x47a5('0x47')]===_0x47a5('0x48')){var _0x5996c4=_0x72fe[_0x47a5('0x21')]({'plain':!![]});var _0x2b4255=_0x47a5('0x22');return db['UserProfileSection'][_0x47a5('0x45')]({'where':{'name':_0x2b4255,'userProfileId':_0x4b706a['userProfileId']},'raw':!![]})[_0x47a5('0x20')](function(_0x470da6){if(_0x470da6&&_0x470da6[_0x47a5('0x4b')]===0x0){return db[_0x47a5('0x23')][_0x47a5('0x46')]({'name':_0x5996c4['name'],'resourceId':_0x5996c4['id'],'type':_0x470da6[_0x47a5('0x26')],'sectionId':_0x470da6['id']},{})['then'](function(){return _0x72fe;});}else{return _0x72fe;}})['catch'](function(_0x5eb150){logger['error'](_0x47a5('0x4c'),_0x5eb150);throw _0x5eb150;});}return _0x72fe;});}})[_0x47a5('0x20')](respondWithResult(_0x5f6a,0xc9))[_0x47a5('0x41')](handleError(_0x5f6a,null));};exports['update']=function(_0x4d3db1,_0x139229){if(_0x4d3db1[_0x47a5('0x4f')]['id']){delete _0x4d3db1[_0x47a5('0x4f')]['id'];}return db[_0x47a5('0x3c')][_0x47a5('0x45')]({'where':{'id':_0x4d3db1['params']['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x139229,null))['then'](saveUpdates(_0x4d3db1[_0x47a5('0x4f')],null))[_0x47a5('0x20')](respondWithResult(_0x139229,null))['catch'](handleError(_0x139229,null));};exports[_0x47a5('0x1f')]=function(_0x345104,_0x132854){return db[_0x47a5('0x3c')][_0x47a5('0x45')]({'where':{'id':_0x345104[_0x47a5('0x43')]['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x132854,null))[_0x47a5('0x20')](removeEntity(_0x132854,null))['catch'](handleError(_0x132854,null));};exports[_0x47a5('0x52')]=function(_0x2a3a57,_0x3c75c6,_0x26e7fc){var _0x396cb0={'raw':!![],'where':{}};var _0x4bbe14={};var _0xbec033={'count':0x0,'rows':[]};return db[_0x47a5('0x3c')][_0x47a5('0x53')]({'where':{'id':_0x2a3a57[_0x47a5('0x43')]['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x3c75c6,null))[_0x47a5('0x20')](function(_0x453191){if(_0x453191){_0x4bbe14[_0x47a5('0x2e')]=_[_0x47a5('0x2a')](db[_0x47a5('0x54')][_0x47a5('0x29')]);_0x4bbe14[_0x47a5('0x2b')]=_[_0x47a5('0x2a')](_0x2a3a57[_0x47a5('0x2b')]);_0x4bbe14[_0x47a5('0x2c')]=_['intersection'](_0x4bbe14[_0x47a5('0x2e')],_0x4bbe14[_0x47a5('0x2b')]);_0x396cb0[_0x47a5('0x30')]=_['intersection'](_0x4bbe14[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x2f')]));_0x396cb0['attributes']=_0x396cb0[_0x47a5('0x30')]['length']?_0x396cb0[_0x47a5('0x30')]:_0x4bbe14['model'];if(!_0x2a3a57[_0x47a5('0x2b')]['hasOwnProperty'](_0x47a5('0x55'))){_0x396cb0[_0x47a5('0x19')]=qs[_0x47a5('0x19')](_0x2a3a57['query']['limit']);_0x396cb0['offset']=qs[_0x47a5('0x32')](_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x32')]);}_0x396cb0[_0x47a5('0x56')]=qs['sort'](_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x57')]);_0x396cb0[_0x47a5('0x33')]=qs[_0x47a5('0x2c')](_[_0x47a5('0x34')](_0x2a3a57[_0x47a5('0x2b')],_0x4bbe14[_0x47a5('0x2c')]));_0x396cb0[_0x47a5('0x33')][_0x47a5('0x58')]=_0x453191['id'];if(_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x35')]){_0x396cb0[_0x47a5('0x33')]=_['merge'](_0x396cb0[_0x47a5('0x33')],{'$or':_['map'](_0x396cb0[_0x47a5('0x30')],function(_0x2ac30f){var _0x281e5f={};_0x281e5f[_0x2ac30f]={'$like':'%'+_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x281e5f;})});}_0x396cb0=_[_0x47a5('0x36')]({},_0x396cb0,_0x2a3a57[_0x47a5('0x3b')]);return db[_0x47a5('0x54')][_0x47a5('0x18')]({'where':_0x396cb0[_0x47a5('0x33')]})[_0x47a5('0x20')](function(_0x1f07ac){_0xbec033[_0x47a5('0x18')]=_0x1f07ac;if(_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x396cb0['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x396cb0);})['then'](function(_0x490e28){_0xbec033[_0x47a5('0x40')]=_0x490e28;return _0xbec033;});}})['then'](respondWithFilteredResult(_0x3c75c6,_0x396cb0))[_0x47a5('0x41')](handleError(_0x3c75c6,null));};exports[_0x47a5('0x59')]=function(_0x1baa5a,_0x396102,_0x3cd335){var _0x930d25={'raw':!![],'where':{}};var _0x218dfa={};var _0x1c7302={'count':0x0,'rows':[]};return db[_0x47a5('0x3c')][_0x47a5('0x53')]({'where':{'id':_0x1baa5a[_0x47a5('0x43')]['id']}})['then'](handleEntityNotFound(_0x396102,null))[_0x47a5('0x20')](function(_0x1fbd42){if(_0x1fbd42){_0x218dfa[_0x47a5('0x2e')]=_['keys'](db[_0x47a5('0x5a')][_0x47a5('0x29')]);_0x218dfa[_0x47a5('0x2b')]=_['keys'](_0x1baa5a[_0x47a5('0x2b')]);_0x218dfa['filters']=_['intersection'](_0x218dfa[_0x47a5('0x2e')],_0x218dfa[_0x47a5('0x2b')]);_0x930d25[_0x47a5('0x30')]=_[_0x47a5('0x2d')](_0x218dfa[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x1baa5a['query']['fields']));_0x930d25[_0x47a5('0x30')]=_0x930d25['attributes'][_0x47a5('0x44')]?_0x930d25[_0x47a5('0x30')]:_0x218dfa[_0x47a5('0x2e')];if(!_0x1baa5a[_0x47a5('0x2b')]['hasOwnProperty'](_0x47a5('0x55'))){_0x930d25['limit']=qs['limit'](_0x1baa5a[_0x47a5('0x2b')][_0x47a5('0x19')]);_0x930d25['offset']=qs[_0x47a5('0x32')](_0x1baa5a[_0x47a5('0x2b')][_0x47a5('0x32')]);}_0x930d25['order']=qs[_0x47a5('0x57')](_0x1baa5a['query'][_0x47a5('0x57')]);_0x930d25[_0x47a5('0x33')]=qs[_0x47a5('0x2c')](_['pick'](_0x1baa5a[_0x47a5('0x2b')],_0x218dfa[_0x47a5('0x2c')]));_0x930d25[_0x47a5('0x33')]['ProjectId']=_0x1fbd42['id'];if(_0x1baa5a[_0x47a5('0x2b')]['filter']){_0x930d25[_0x47a5('0x33')]=_['merge'](_0x930d25[_0x47a5('0x33')],{'$or':_[_0x47a5('0x37')](_0x930d25[_0x47a5('0x30')],function(_0x211fbf){var _0x51738b={};_0x51738b[_0x211fbf]={'$like':'%'+_0x1baa5a[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x51738b;})});}_0x930d25=_[_0x47a5('0x36')]({},_0x930d25,_0x1baa5a[_0x47a5('0x3b')]);return db[_0x47a5('0x5a')]['count']({'where':_0x930d25['where']})[_0x47a5('0x20')](function(_0x4ab01f){_0x1c7302[_0x47a5('0x18')]=_0x4ab01f;if(_0x1baa5a[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x930d25['include']=[{'all':!![]}];}return db[_0x47a5('0x5a')][_0x47a5('0x3f')](_0x930d25);})['then'](function(_0xf7fc4e){_0x1c7302[_0x47a5('0x40')]=_0xf7fc4e;return _0x1c7302;});}})[_0x47a5('0x20')](respondWithFilteredResult(_0x396102,_0x930d25))[_0x47a5('0x41')](handleError(_0x396102,null));};function char(_0x58dacd){return'number'===typeof _0x58dacd?String[_0x47a5('0x5b')][_0x47a5('0x1b')](null,arguments):_0x58dacd;}function needsEncapsulation(_0x48e7f3){return!!_0x48e7f3&&(_0x48e7f3[_0x47a5('0x5c')]()[_0x47a5('0x5d')](char(0xd))>=0x0||_0x48e7f3['toString']()[_0x47a5('0x5d')](char(0xa))>=0x0||_0x48e7f3[_0x47a5('0x5c')]()[_0x47a5('0x5d')](char(0x2c))>=0x0||_0x48e7f3['toString']()[_0x47a5('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x59b4a5){var _0x663778=char(0x22),_0x5e2946='\x5c'+char(0x22),_0x243c8b=_0x59b4a5[_0x47a5('0x5c')]()['replace'](new RegExp(_0x663778,'g'),_0x5e2946);return _0x663778+_0x243c8b+_0x663778;}exports[_0x47a5('0x5e')]=function(_0x597cb2,_0x1eabef,_0x36f619){var _0x37e045,_0x2be771;var _0x49b76a={'where':{'ProjectId':_0x597cb2[_0x47a5('0x43')]['id']}};if(_0x597cb2['query']['startTime']){_0x49b76a[_0x47a5('0x33')][_0x47a5('0x5f')]=JSON[_0x47a5('0x60')](_0x597cb2[_0x47a5('0x2b')][_0x47a5('0x61')]);}return db['JscriptySessionReport'][_0x47a5('0x3f')](_0x49b76a)[_0x47a5('0x20')](handleEntityNotFound(_0x1eabef,null))[_0x47a5('0x20')](function(_0x11b68b){if(_0x11b68b){_0x37e045=_0x11b68b;return db['JscriptyQuestionReport'][_0x47a5('0x3f')]({'where':{'SessionId':{'$in':_['map'](_0x37e045,'id')},'ProjectId':_0x597cb2[_0x47a5('0x43')]['id']},'order':_0x47a5('0x62')});}})[_0x47a5('0x20')](handleEntityNotFound(_0x1eabef,null))[_0x47a5('0x20')](function(_0x29a1cf){if(_0x29a1cf){_0x2be771=_0x29a1cf;var _0x3ec264={};for(var _0x92bfd7=0x0,_0x1fec11=_0x2be771[_0x47a5('0x44')];_0x92bfd7<_0x1fec11;_0x92bfd7++){if(!_0x3ec264['hasOwnProperty'](_0x2be771[_0x92bfd7][_0x47a5('0x63')])){_0x3ec264[_0x2be771[_0x92bfd7][_0x47a5('0x63')]]=needsEncapsulation(_0x2be771[_0x92bfd7]['question'])?encapsulate(_0x2be771[_0x92bfd7][_0x47a5('0x64')]):_0x2be771[_0x92bfd7][_0x47a5('0x64')];}}var _0x6d6a5=[],_0x5b85cd={};for(var _0x4bf1f5=0x0,_0x126bb1=_0x37e045[_0x47a5('0x44')];_0x4bf1f5<_0x126bb1;_0x4bf1f5++){_0x5b85cd={'ProjectId':_0x597cb2['params']['id'],'SessionId':_0x37e045[_0x4bf1f5]['id'],'StartTime':moment(_0x37e045[_0x4bf1f5]['starttime'])[_0x47a5('0x65')](_0x47a5('0x66'))};for(var _0x54eab1=0x0,_0x29e384=_0x2be771[_0x47a5('0x44')];_0x54eab1<_0x29e384;_0x54eab1++){if(_0x2be771[_0x54eab1]['SessionId']==_0x37e045[_0x4bf1f5]['id']&&_0x3ec264[_0x47a5('0x31')](_0x2be771[_0x54eab1][_0x47a5('0x63')])){_0x5b85cd[_0x3ec264[_0x2be771[_0x54eab1][_0x47a5('0x63')]]]=_0x2be771[_0x54eab1][_0x47a5('0x67')];}}for(var _0x364bb0 in _0x3ec264){if(!_0x5b85cd[_0x47a5('0x31')](_0x3ec264[_0x364bb0])){_0x5b85cd[_0x3ec264[_0x364bb0]]=null;}}_0x6d6a5['push'](_0x5b85cd);}return _0x6d6a5;}})['then'](function(_0x5bd86e){if(!_[_0x47a5('0x68')](_0x5bd86e)){var _0xce5ada=toCsv(_0x5bd86e);var _0x4e0f2b=Date[_0x47a5('0x69')]();fs[_0x47a5('0x6a')](util[_0x47a5('0x65')](_0x47a5('0x6b'),_0x597cb2[_0x47a5('0x43')]['id'],_0x4e0f2b),_0xce5ada);_0x1eabef['setHeader'](_0x47a5('0x6c'),'attachment;\x20filename='+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x597cb2[_0x47a5('0x43')]['id'],_0x4e0f2b));_0x1eabef['setHeader'](_0x47a5('0x6d'),_0x47a5('0x6e'));return _0x1eabef[_0x47a5('0x6f')](util['format'](_0x47a5('0x6b'),_0x597cb2[_0x47a5('0x43')]['id'],_0x4e0f2b));}else{return _0x1eabef[_0x47a5('0x14')](0xcc);}})[_0x47a5('0x41')](handleError(_0x1eabef,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index dbd960f..12632a2 100644 --- a/server/api/jscriptyProject/jscriptyProject.model.js +++ b/server/api/jscriptyProject/jscriptyProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbce7=['rimraf','../../config/environment','./jscriptyProject.attributes','define','jscripty_projects','lodash','util','api','bluebird','request-promise'];(function(_0x384b80,_0x27b27a){var _0x242748=function(_0xb14236){while(--_0xb14236){_0x384b80['push'](_0x384b80['shift']());}};_0x242748(++_0x27b27a);}(_0xbce7,0x163));var _0x7bce=function(_0x155f24,_0x12c03a){_0x155f24=_0x155f24-0x0;var _0x5173b4=_0xbce7[_0x155f24];return _0x5173b4;};'use strict';var _=require(_0x7bce('0x0'));var util=require(_0x7bce('0x1'));var logger=require('../../config/logger')(_0x7bce('0x2'));var moment=require('moment');var BPromise=require(_0x7bce('0x3'));var rp=require(_0x7bce('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7bce('0x5'));var config=require(_0x7bce('0x6'));var attributes=require(_0x7bce('0x7'));module['exports']=function(_0x5dcf17,_0x353c9b){return _0x5dcf17[_0x7bce('0x8')]('JscriptyProject',attributes,{'tableName':_0x7bce('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0762=['moment','bluebird','request-promise','path','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api'];(function(_0x14abdb,_0x29825e){var _0x356b02=function(_0x389f99){while(--_0x389f99){_0x14abdb['push'](_0x14abdb['shift']());}};_0x356b02(++_0x29825e);}(_0x0762,0x1b7));var _0x2076=function(_0x455d02,_0x51dfb1){_0x455d02=_0x455d02-0x0;var _0x1fa776=_0x0762[_0x455d02];return _0x1fa776;};'use strict';var _=require(_0x2076('0x0'));var util=require('util');var logger=require(_0x2076('0x1'))(_0x2076('0x2'));var moment=require(_0x2076('0x3'));var BPromise=require(_0x2076('0x4'));var rp=require(_0x2076('0x5'));var fs=require('fs');var path=require(_0x2076('0x6'));var rimraf=require('rimraf');var config=require(_0x2076('0x7'));var attributes=require(_0x2076('0x8'));module[_0x2076('0x9')]=function(_0x19af92,_0x1f8041){return _0x19af92[_0x2076('0xa')](_0x2076('0xb'),attributes,{'tableName':_0x2076('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 59eb662..06de191 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4f5=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4f5,0x94));var _0x5d4f=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xd4f5[_0x111e94];return _0x3de107;};'use strict';var _=require(_0x5d4f('0x0'));var util=require(_0x5d4f('0x1'));var moment=require(_0x5d4f('0x2'));var BPromise=require('bluebird');var rs=require(_0x5d4f('0x3'));var fs=require('fs');var Redis=require(_0x5d4f('0x4'));var db=require(_0x5d4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5d4f('0x6'));var config=require(_0x5d4f('0x7'));var jayson=require(_0x5d4f('0x8'));var client=jayson[_0x5d4f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fbae0,_0x1ccdfc,_0x3be073){return new BPromise(function(_0x9b4af6,_0x427d5d){return client['request'](_0x2fbae0,_0x3be073)[_0x5d4f('0xa')](function(_0x4a686c){logger[_0x5d4f('0xb')](_0x5d4f('0xc'),_0x1ccdfc,_0x5d4f('0xd'));logger['debug'](_0x5d4f('0xe'),_0x1ccdfc,_0x5d4f('0xd'),JSON['stringify'](_0x4a686c));if(_0x4a686c[_0x5d4f('0xf')]){if(_0x4a686c['error'][_0x5d4f('0x10')]===0x1f4){logger[_0x5d4f('0xf')](_0x5d4f('0xc'),_0x1ccdfc,_0x4a686c[_0x5d4f('0xf')]['message']);return _0x427d5d(_0x4a686c[_0x5d4f('0xf')][_0x5d4f('0x11')]);}logger[_0x5d4f('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x1ccdfc,_0x4a686c[_0x5d4f('0xf')][_0x5d4f('0x11')]);return _0x9b4af6(_0x4a686c[_0x5d4f('0xf')][_0x5d4f('0x11')]);}else{logger[_0x5d4f('0xb')](_0x5d4f('0xc'),_0x1ccdfc,_0x5d4f('0xd'));_0x9b4af6(_0x4a686c['result'][_0x5d4f('0x11')]);}})[_0x5d4f('0x12')](function(_0xfdbe0){logger['error'](_0x5d4f('0xc'),_0x1ccdfc,_0xfdbe0);_0x427d5d(_0xfdbe0);});});} \ No newline at end of file +var _0xb783=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','code','JscriptyProject,\x20%s,\x20%s'];(function(_0x521270,_0x59fcac){var _0x11c23c=function(_0x4a6852){while(--_0x4a6852){_0x521270['push'](_0x521270['shift']());}};_0x11c23c(++_0x59fcac);}(_0xb783,0xde));var _0x3b78=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xb783[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0x3b78('0x0'));var util=require(_0x3b78('0x1'));var moment=require(_0x3b78('0x2'));var BPromise=require(_0x3b78('0x3'));var rs=require(_0x3b78('0x4'));var fs=require('fs');var Redis=require(_0x3b78('0x5'));var db=require(_0x3b78('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b78('0x7'))(_0x3b78('0x8'));var config=require(_0x3b78('0x9'));var jayson=require(_0x3b78('0xa'));var client=jayson[_0x3b78('0xb')][_0x3b78('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x703a2e,_0x84c59e,_0x25ff04){return new BPromise(function(_0x246946,_0x4b3723){return client[_0x3b78('0xd')](_0x703a2e,_0x25ff04)['then'](function(_0x379627){logger[_0x3b78('0xe')]('JscriptyProject,\x20%s,\x20%s',_0x84c59e,_0x3b78('0xf'));logger[_0x3b78('0x10')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x84c59e,_0x3b78('0xf'),JSON['stringify'](_0x379627));if(_0x379627[_0x3b78('0x11')]){if(_0x379627[_0x3b78('0x11')][_0x3b78('0x12')]===0x1f4){logger['error'](_0x3b78('0x13'),_0x84c59e,_0x379627[_0x3b78('0x11')][_0x3b78('0x14')]);return _0x4b3723(_0x379627[_0x3b78('0x11')][_0x3b78('0x14')]);}logger[_0x3b78('0x11')](_0x3b78('0x13'),_0x84c59e,_0x379627[_0x3b78('0x11')]['message']);return _0x246946(_0x379627['error'][_0x3b78('0x14')]);}else{logger[_0x3b78('0xe')](_0x3b78('0x13'),_0x84c59e,_0x3b78('0xf'));_0x246946(_0x379627['result']['message']);}})[_0x3b78('0x15')](function(_0x3c325c){logger['error'](_0x3b78('0x13'),_0x84c59e,_0x3c325c);_0x4b3723(_0x3c325c);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 9558197..86a4aa4 100644 --- a/server/api/jscriptyQuestionReport/index.js +++ b/server/api/jscriptyQuestionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b13=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x24837b,_0xeb167a){var _0xdeabe9=function(_0x199364){while(--_0x199364){_0x24837b['push'](_0x24837b['shift']());}};_0xdeabe9(++_0xeb167a);}(_0x2b13,0x7e));var _0x32b1=function(_0x1216cf,_0x4032c9){_0x1216cf=_0x1216cf-0x0;var _0xf846f6=_0x2b13[_0x1216cf];return _0xf846f6;};'use strict';var multer=require(_0x32b1('0x0'));var util=require(_0x32b1('0x1'));var path=require(_0x32b1('0x2'));var timeout=require(_0x32b1('0x3'));var express=require(_0x32b1('0x4'));var router=express[_0x32b1('0x5')]();var auth=require(_0x32b1('0x6'));var interaction=require(_0x32b1('0x7'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0x32b1('0x8')](),controller[_0x32b1('0x9')]);router[_0x32b1('0xa')](_0x32b1('0xb'),auth[_0x32b1('0x8')](),controller[_0x32b1('0xc')]);router[_0x32b1('0xa')](_0x32b1('0xd'),auth[_0x32b1('0x8')](),controller[_0x32b1('0xe')]);router[_0x32b1('0xf')]('/',auth['isAuthenticated'](),controller[_0x32b1('0x10')]);router['put'](_0x32b1('0xd'),auth['isAuthenticated'](),controller[_0x32b1('0x11')]);router[_0x32b1('0x12')](_0x32b1('0xd'),auth['isAuthenticated'](),controller[_0x32b1('0x13')]);module[_0x32b1('0x14')]=router; \ No newline at end of file +var _0x7cd7=['./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','put','update','delete','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x571929,_0xa4fae3){var _0x915d33=function(_0x3e8e0d){while(--_0x3e8e0d){_0x571929['push'](_0x571929['shift']());}};_0x915d33(++_0xa4fae3);}(_0x7cd7,0x171));var _0x77cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cd7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x77cd('0x0'));var util=require(_0x77cd('0x1'));var path=require(_0x77cd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77cd('0x3')]();var auth=require(_0x77cd('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x77cd('0x5'));router[_0x77cd('0x6')]('/',auth['isAuthenticated'](),controller[_0x77cd('0x7')]);router[_0x77cd('0x6')](_0x77cd('0x8'),auth[_0x77cd('0x9')](),controller[_0x77cd('0xa')]);router[_0x77cd('0x6')](_0x77cd('0xb'),auth[_0x77cd('0x9')](),controller['show']);router[_0x77cd('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x77cd('0xd')](_0x77cd('0xb'),auth[_0x77cd('0x9')](),controller[_0x77cd('0xe')]);router[_0x77cd('0xf')](_0x77cd('0xb'),auth[_0x77cd('0x9')](),controller['destroy']);module[_0x77cd('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index cf6bf12..8d14d16 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x375b=['sequelize','exports','STRING','long'];(function(_0x2c9d22,_0x28f65a){var _0x160346=function(_0x14e429){while(--_0x14e429){_0x2c9d22['push'](_0x2c9d22['shift']());}};_0x160346(++_0x28f65a);}(_0x375b,0x140));var _0xb375=function(_0xffc670,_0x499185){_0xffc670=_0xffc670-0x0;var _0x4db333=_0x375b[_0xffc670];return _0x4db333;};'use strict';var Sequelize=require(_0xb375('0x0'));module[_0xb375('0x1')]={'question':{'type':Sequelize[_0xb375('0x2')]},'answer':{'type':Sequelize['TEXT'](_0xb375('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xb375('0x2')]},'queue':{'type':Sequelize[_0xb375('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb375('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0xb375('0x2')]}}; \ No newline at end of file +var _0x6c65=['STRING','long','sequelize'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0x6c65,0x19d));var _0x56c6=function(_0x260478,_0x2040a1){_0x260478=_0x260478-0x0;var _0x4048fb=_0x6c65[_0x260478];return _0x4048fb;};'use strict';var Sequelize=require(_0x56c6('0x0'));module['exports']={'question':{'type':Sequelize[_0x56c6('0x1')]},'answer':{'type':Sequelize['TEXT'](_0x56c6('0x2'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x56c6('0x1')]},'uniqueid':{'type':Sequelize[_0x56c6('0x1')]},'calleridname':{'type':Sequelize[_0x56c6('0x1')]},'calleridnum':{'type':Sequelize[_0x56c6('0x1')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 23d62d5..502af13 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb98e=['filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','key','VIRTUAL','field'];(function(_0xb77f,_0x28d10c){var _0x4be5ee=function(_0x4abb0a){while(--_0x4abb0a){_0xb77f['push'](_0xb77f['shift']());}};_0x4be5ee(++_0x28d10c);}(_0xb98e,0x184));var _0xeb98=function(_0x10d238,_0x59c9c2){_0x10d238=_0x10d238-0x0;var _0x5acb0b=_0xb98e[_0x10d238];return _0x5acb0b;};'use strict';var pdf=require(_0xeb98('0x0'));var emlformat=require(_0xeb98('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeb98('0x2'));var rp=require(_0xeb98('0x3'));var moment=require(_0xeb98('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeb98('0x5'));var util=require(_0xeb98('0x6'));var path=require(_0xeb98('0x7'));var sox=require('sox');var csv=require(_0xeb98('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeb98('0x9'));var squel=require('squel');var crypto=require(_0xeb98('0xa'));var jsforce=require(_0xeb98('0xb'));var deskjs=require(_0xeb98('0xc'));var toCsv=require(_0xeb98('0x8'));var querystring=require(_0xeb98('0xd'));var Papa=require(_0xeb98('0xe'));var Redis=require(_0xeb98('0xf'));var authService=require(_0xeb98('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xeb98('0x11'));var logger=require(_0xeb98('0x12'))(_0xeb98('0x13'));var utils=require(_0xeb98('0x14'));var config=require(_0xeb98('0x15'));var db=require(_0xeb98('0x16'))['db'];function respondWithStatusCode(_0x15372d,_0x30cf5b){_0x30cf5b=_0x30cf5b||0xcc;return function(_0x2b3f9f){if(_0x2b3f9f){return _0x15372d[_0xeb98('0x17')](_0x30cf5b);}return _0x15372d[_0xeb98('0x18')](_0x30cf5b)['end']();};}function respondWithResult(_0x30c28d,_0x3ee150){_0x3ee150=_0x3ee150||0xc8;return function(_0x55164a){if(_0x55164a){return _0x30c28d['status'](_0x3ee150)[_0xeb98('0x19')](_0x55164a);}};}function respondWithFilteredResult(_0x2df629,_0x3bb77a){return function(_0x31ff03){if(_0x31ff03){var _0xac14bc=_0x31ff03[_0xeb98('0x1a')],_0x29117b=_0x3bb77a[_0xeb98('0x1b')],_0x33de7f=_0x3bb77a[_0xeb98('0x1b')]+_0x3bb77a[_0xeb98('0x1c')],_0x47a3ad;if(_0x33de7f>=_0xac14bc){_0x33de7f=_0xac14bc;_0x47a3ad=0xc8;}else{_0x47a3ad=0xce;}_0x2df629[_0xeb98('0x18')](_0x47a3ad);return _0x2df629[_0xeb98('0x1d')](_0xeb98('0x1e'),_0x29117b+'-'+_0x33de7f+'/'+_0xac14bc)[_0xeb98('0x19')](_0x31ff03);}return null;};}function patchUpdates(_0x38b7be){return function(_0x25a13d){try{jsonpatch[_0xeb98('0x1f')](_0x25a13d,_0x38b7be,!![]);}catch(_0x1785fc){return BPromise['reject'](_0x1785fc);}return _0x25a13d[_0xeb98('0x20')]();};}function saveUpdates(_0x396419,_0x4f5267){return function(_0x56b018){if(_0x56b018){return _0x56b018[_0xeb98('0x21')](_0x396419)[_0xeb98('0x22')](function(_0x5261b0){return _0x5261b0;});}return null;};}function removeEntity(_0x5c35e7,_0x2ab831){return function(_0x4e34fc){if(_0x4e34fc){return _0x4e34fc[_0xeb98('0x23')]()[_0xeb98('0x22')](function(){_0x5c35e7['status'](0xcc)[_0xeb98('0x24')]();});}};}function handleEntityNotFound(_0xb561eb,_0x3a3566){return function(_0x131128){if(!_0x131128){_0xb561eb[_0xeb98('0x17')](0x194);}return _0x131128;};}function handleError(_0x1fa721,_0x685a8f){_0x685a8f=_0x685a8f||0x1f4;return function(_0x31928e){logger[_0xeb98('0x25')](_0x31928e[_0xeb98('0x26')]);if(_0x31928e[_0xeb98('0x27')]){delete _0x31928e['name'];}_0x1fa721[_0xeb98('0x18')](_0x685a8f)[_0xeb98('0x28')](_0x31928e);};}exports[_0xeb98('0x29')]=function(_0x1c1ace,_0x296f65){var _0x175a0f={},_0x49ca11={},_0x151d9c={'count':0x0,'rows':[]};var _0x4077d7=db[_0xeb98('0x2a')][_0xeb98('0x2b')];_0x49ca11[_0xeb98('0x2c')]=_['keys'](_0x4077d7);_0x49ca11[_0xeb98('0x2d')]=_[_0xeb98('0x2e')](_0x1c1ace[_0xeb98('0x2d')]);_0x49ca11[_0xeb98('0x2f')]=_['intersection'](_0x49ca11[_0xeb98('0x2c')],_0x49ca11[_0xeb98('0x2d')]);_0x175a0f[_0xeb98('0x30')]=_[_0xeb98('0x31')](_0x49ca11[_0xeb98('0x2c')],qs[_0xeb98('0x32')](_0x1c1ace['query']['fields']));_0x175a0f[_0xeb98('0x30')]=_0x175a0f[_0xeb98('0x30')][_0xeb98('0x33')]?_0x175a0f[_0xeb98('0x30')]:_0x49ca11[_0xeb98('0x2c')];if(!_0x1c1ace[_0xeb98('0x2d')][_0xeb98('0x34')](_0xeb98('0x35'))){_0x175a0f[_0xeb98('0x1c')]=qs[_0xeb98('0x1c')](_0x1c1ace[_0xeb98('0x2d')][_0xeb98('0x1c')]);_0x175a0f[_0xeb98('0x1b')]=qs[_0xeb98('0x1b')](_0x1c1ace[_0xeb98('0x2d')]['offset']);}_0x175a0f[_0xeb98('0x36')]=qs[_0xeb98('0x37')](_0x1c1ace[_0xeb98('0x2d')]['sort']);_0x175a0f[_0xeb98('0x38')]=qs[_0xeb98('0x2f')](_['pick'](_0x1c1ace[_0xeb98('0x2d')],_0x49ca11[_0xeb98('0x2f')]));if(_0x1c1ace[_0xeb98('0x2d')]['filter']){_0x175a0f['where']=_[_0xeb98('0x39')](_0x175a0f[_0xeb98('0x38')],{'$or':_[_0xeb98('0x3a')](_0x4077d7,function(_0x2d7b34){if(_0x2d7b34['type'][_0xeb98('0x3b')]!==_0xeb98('0x3c')){var _0x5b6693={};_0x5b6693[_0x2d7b34[_0xeb98('0x3d')]]={'$like':'%'+_0x1c1ace['query'][_0xeb98('0x3e')]+'%'};return _0x5b6693;}})});}_0x175a0f=_[_0xeb98('0x39')]({},_0x175a0f,_0x1c1ace[_0xeb98('0x3f')]);var _0xcd1930={'where':_0x175a0f[_0xeb98('0x38')]};return db['JscriptyQuestionReport']['count'](_0xcd1930)[_0xeb98('0x22')](function(_0x2e1492){_0x151d9c[_0xeb98('0x1a')]=_0x2e1492;if(_0x1c1ace[_0xeb98('0x2d')][_0xeb98('0x40')]){_0x175a0f[_0xeb98('0x41')]=[{'all':!![]}];}return db[_0xeb98('0x2a')][_0xeb98('0x42')](_0x175a0f);})[_0xeb98('0x22')](function(_0x341f50){_0x151d9c[_0xeb98('0x43')]=_0x341f50;return _0x151d9c;})[_0xeb98('0x22')](respondWithFilteredResult(_0x296f65,_0x175a0f))[_0xeb98('0x44')](handleError(_0x296f65,null));};exports[_0xeb98('0x45')]=function(_0xba4fa7,_0x4abc57){var _0x195c7b={'raw':!![],'where':{'id':_0xba4fa7['params']['id']}},_0x226c79={};_0x226c79[_0xeb98('0x2c')]=_[_0xeb98('0x2e')](db[_0xeb98('0x2a')][_0xeb98('0x2b')]);_0x226c79[_0xeb98('0x2d')]=_[_0xeb98('0x2e')](_0xba4fa7['query']);_0x226c79['filters']=_[_0xeb98('0x31')](_0x226c79[_0xeb98('0x2c')],_0x226c79[_0xeb98('0x2d')]);_0x195c7b['attributes']=_[_0xeb98('0x31')](_0x226c79[_0xeb98('0x2c')],qs['fields'](_0xba4fa7['query'][_0xeb98('0x32')]));_0x195c7b[_0xeb98('0x30')]=_0x195c7b[_0xeb98('0x30')][_0xeb98('0x33')]?_0x195c7b[_0xeb98('0x30')]:_0x226c79['model'];if(_0xba4fa7[_0xeb98('0x2d')][_0xeb98('0x40')]){_0x195c7b[_0xeb98('0x41')]=[{'all':!![]}];}_0x195c7b=_[_0xeb98('0x39')]({},_0x195c7b,_0xba4fa7[_0xeb98('0x3f')]);return db[_0xeb98('0x2a')][_0xeb98('0x46')](_0x195c7b)[_0xeb98('0x22')](handleEntityNotFound(_0x4abc57,null))[_0xeb98('0x22')](respondWithResult(_0x4abc57,null))[_0xeb98('0x44')](handleError(_0x4abc57,null));};exports[_0xeb98('0x47')]=function(_0x14dcd3,_0x3158d3){return db[_0xeb98('0x2a')][_0xeb98('0x47')](_0x14dcd3[_0xeb98('0x48')],{})[_0xeb98('0x22')](respondWithResult(_0x3158d3,0xc9))['catch'](handleError(_0x3158d3,null));};exports[_0xeb98('0x21')]=function(_0xcd65d1,_0x5ed941){if(_0xcd65d1['body']['id']){delete _0xcd65d1[_0xeb98('0x48')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0xcd65d1['params']['id']}})['then'](handleEntityNotFound(_0x5ed941,null))[_0xeb98('0x22')](saveUpdates(_0xcd65d1[_0xeb98('0x48')],null))[_0xeb98('0x22')](respondWithResult(_0x5ed941,null))[_0xeb98('0x44')](handleError(_0x5ed941,null));};exports[_0xeb98('0x23')]=function(_0x23f0c2,_0x34c3ff){return db[_0xeb98('0x2a')][_0xeb98('0x46')]({'where':{'id':_0x23f0c2[_0xeb98('0x49')]['id']}})[_0xeb98('0x22')](handleEntityNotFound(_0x34c3ff,null))[_0xeb98('0x22')](removeEntity(_0x34c3ff,null))[_0xeb98('0x44')](handleError(_0x34c3ff,null));};exports[_0xeb98('0x4a')]=function(_0x3d678c,_0x5a7858){return db[_0xeb98('0x2a')][_0xeb98('0x4a')]()[_0xeb98('0x22')](respondWithResult(_0x5a7858,null))[_0xeb98('0x44')](handleError(_0x5a7858,null));}; \ No newline at end of file +var _0x323f=['error','stack','name','index','JscriptyQuestionReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','map','type','key','VIRTUAL','options','where','count','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','reject','update','destroy','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x323f,0x1ee));var _0xf323=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x323f[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf323('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf323('0x1'));var jsonpatch=require(_0xf323('0x2'));var rp=require(_0xf323('0x3'));var moment=require(_0xf323('0x4'));var BPromise=require(_0xf323('0x5'));var Mustache=require(_0xf323('0x6'));var util=require(_0xf323('0x7'));var path=require(_0xf323('0x8'));var sox=require(_0xf323('0x9'));var csv=require(_0xf323('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf323('0xb'));var squel=require(_0xf323('0xc'));var crypto=require(_0xf323('0xd'));var jsforce=require(_0xf323('0xe'));var deskjs=require(_0xf323('0xf'));var toCsv=require(_0xf323('0xa'));var querystring=require(_0xf323('0x10'));var Papa=require(_0xf323('0x11'));var Redis=require(_0xf323('0x12'));var authService=require(_0xf323('0x13'));var qs=require(_0xf323('0x14'));var hardwareService=require(_0xf323('0x15'));var logger=require(_0xf323('0x16'))(_0xf323('0x17'));var utils=require(_0xf323('0x18'));var config=require(_0xf323('0x19'));var db=require(_0xf323('0x1a'))['db'];function respondWithStatusCode(_0x4e4ec3,_0x1b6a09){_0x1b6a09=_0x1b6a09||0xcc;return function(_0x7dbd26){if(_0x7dbd26){return _0x4e4ec3[_0xf323('0x1b')](_0x1b6a09);}return _0x4e4ec3['status'](_0x1b6a09)[_0xf323('0x1c')]();};}function respondWithResult(_0x46e0cc,_0x367db4){_0x367db4=_0x367db4||0xc8;return function(_0x3a829f){if(_0x3a829f){return _0x46e0cc[_0xf323('0x1d')](_0x367db4)[_0xf323('0x1e')](_0x3a829f);}};}function respondWithFilteredResult(_0x59ffbc,_0x4cc3ce){return function(_0x874219){if(_0x874219){var _0x447517=_0x874219['count'],_0x38fd4c=_0x4cc3ce[_0xf323('0x1f')],_0x3858ee=_0x4cc3ce[_0xf323('0x1f')]+_0x4cc3ce[_0xf323('0x20')],_0x3db58a;if(_0x3858ee>=_0x447517){_0x3858ee=_0x447517;_0x3db58a=0xc8;}else{_0x3db58a=0xce;}_0x59ffbc[_0xf323('0x1d')](_0x3db58a);return _0x59ffbc['set'](_0xf323('0x21'),_0x38fd4c+'-'+_0x3858ee+'/'+_0x447517)[_0xf323('0x1e')](_0x874219);}return null;};}function patchUpdates(_0x1a459d){return function(_0x41b2cb){try{jsonpatch['apply'](_0x41b2cb,_0x1a459d,!![]);}catch(_0x409b16){return BPromise[_0xf323('0x22')](_0x409b16);}return _0x41b2cb['save']();};}function saveUpdates(_0x32d7b0,_0x44378e){return function(_0x32a942){if(_0x32a942){return _0x32a942[_0xf323('0x23')](_0x32d7b0)['then'](function(_0xdc7891){return _0xdc7891;});}return null;};}function removeEntity(_0x1831bd,_0x1c29d9){return function(_0x52305d){if(_0x52305d){return _0x52305d[_0xf323('0x24')]()[_0xf323('0x25')](function(){_0x1831bd[_0xf323('0x1d')](0xcc)[_0xf323('0x1c')]();});}};}function handleEntityNotFound(_0x13ec1f,_0xa3362c){return function(_0x189b23){if(!_0x189b23){_0x13ec1f[_0xf323('0x1b')](0x194);}return _0x189b23;};}function handleError(_0x44d324,_0x47fb15){_0x47fb15=_0x47fb15||0x1f4;return function(_0xf85efe){logger[_0xf323('0x26')](_0xf85efe[_0xf323('0x27')]);if(_0xf85efe[_0xf323('0x28')]){delete _0xf85efe[_0xf323('0x28')];}_0x44d324[_0xf323('0x1d')](_0x47fb15)['send'](_0xf85efe);};}exports[_0xf323('0x29')]=function(_0x56ce33,_0x1570d4){var _0x3902eb={},_0x56be0c={},_0x46663b={'count':0x0,'rows':[]};var _0x3c95ce=db[_0xf323('0x2a')][_0xf323('0x2b')];_0x56be0c[_0xf323('0x2c')]=_['keys'](_0x3c95ce);_0x56be0c[_0xf323('0x2d')]=_[_0xf323('0x2e')](_0x56ce33[_0xf323('0x2d')]);_0x56be0c[_0xf323('0x2f')]=_[_0xf323('0x30')](_0x56be0c[_0xf323('0x2c')],_0x56be0c[_0xf323('0x2d')]);_0x3902eb[_0xf323('0x31')]=_[_0xf323('0x30')](_0x56be0c['model'],qs[_0xf323('0x32')](_0x56ce33[_0xf323('0x2d')][_0xf323('0x32')]));_0x3902eb[_0xf323('0x31')]=_0x3902eb[_0xf323('0x31')]['length']?_0x3902eb[_0xf323('0x31')]:_0x56be0c[_0xf323('0x2c')];if(!_0x56ce33[_0xf323('0x2d')][_0xf323('0x33')](_0xf323('0x34'))){_0x3902eb['limit']=qs[_0xf323('0x20')](_0x56ce33[_0xf323('0x2d')][_0xf323('0x20')]);_0x3902eb[_0xf323('0x1f')]=qs['offset'](_0x56ce33[_0xf323('0x2d')]['offset']);}_0x3902eb[_0xf323('0x35')]=qs[_0xf323('0x36')](_0x56ce33['query'][_0xf323('0x36')]);_0x3902eb['where']=qs[_0xf323('0x2f')](_['pick'](_0x56ce33[_0xf323('0x2d')],_0x56be0c['filters']));if(_0x56ce33[_0xf323('0x2d')][_0xf323('0x37')]){_0x3902eb['where']=_['merge'](_0x3902eb['where'],{'$or':_[_0xf323('0x38')](_0x3c95ce,function(_0x277a6c){if(_0x277a6c[_0xf323('0x39')][_0xf323('0x3a')]!==_0xf323('0x3b')){var _0x49e458={};_0x49e458[_0x277a6c['field']]={'$like':'%'+_0x56ce33['query'][_0xf323('0x37')]+'%'};return _0x49e458;}})});}_0x3902eb=_['merge']({},_0x3902eb,_0x56ce33[_0xf323('0x3c')]);var _0x47e7a2={'where':_0x3902eb[_0xf323('0x3d')]};return db[_0xf323('0x2a')][_0xf323('0x3e')](_0x47e7a2)[_0xf323('0x25')](function(_0x325248){_0x46663b['count']=_0x325248;if(_0x56ce33[_0xf323('0x2d')][_0xf323('0x3f')]){_0x3902eb[_0xf323('0x40')]=[{'all':!![]}];}return db[_0xf323('0x2a')][_0xf323('0x41')](_0x3902eb);})[_0xf323('0x25')](function(_0x288428){_0x46663b[_0xf323('0x42')]=_0x288428;return _0x46663b;})[_0xf323('0x25')](respondWithFilteredResult(_0x1570d4,_0x3902eb))[_0xf323('0x43')](handleError(_0x1570d4,null));};exports[_0xf323('0x44')]=function(_0x45287b,_0xc48a6e){var _0x388d80={'raw':!![],'where':{'id':_0x45287b[_0xf323('0x45')]['id']}},_0x2c89dd={};_0x2c89dd['model']=_['keys'](db[_0xf323('0x2a')][_0xf323('0x2b')]);_0x2c89dd[_0xf323('0x2d')]=_[_0xf323('0x2e')](_0x45287b[_0xf323('0x2d')]);_0x2c89dd[_0xf323('0x2f')]=_[_0xf323('0x30')](_0x2c89dd[_0xf323('0x2c')],_0x2c89dd[_0xf323('0x2d')]);_0x388d80[_0xf323('0x31')]=_[_0xf323('0x30')](_0x2c89dd[_0xf323('0x2c')],qs[_0xf323('0x32')](_0x45287b['query'][_0xf323('0x32')]));_0x388d80['attributes']=_0x388d80['attributes'][_0xf323('0x46')]?_0x388d80['attributes']:_0x2c89dd['model'];if(_0x45287b[_0xf323('0x2d')][_0xf323('0x3f')]){_0x388d80[_0xf323('0x40')]=[{'all':!![]}];}_0x388d80=_[_0xf323('0x47')]({},_0x388d80,_0x45287b[_0xf323('0x3c')]);return db[_0xf323('0x2a')][_0xf323('0x48')](_0x388d80)[_0xf323('0x25')](handleEntityNotFound(_0xc48a6e,null))[_0xf323('0x25')](respondWithResult(_0xc48a6e,null))[_0xf323('0x43')](handleError(_0xc48a6e,null));};exports[_0xf323('0x49')]=function(_0x5f5d14,_0x323445){return db['JscriptyQuestionReport'][_0xf323('0x49')](_0x5f5d14[_0xf323('0x4a')],{})[_0xf323('0x25')](respondWithResult(_0x323445,0xc9))[_0xf323('0x43')](handleError(_0x323445,null));};exports['update']=function(_0x57dbe2,_0x36b688){if(_0x57dbe2['body']['id']){delete _0x57dbe2[_0xf323('0x4a')]['id'];}return db['JscriptyQuestionReport'][_0xf323('0x48')]({'where':{'id':_0x57dbe2[_0xf323('0x45')]['id']}})['then'](handleEntityNotFound(_0x36b688,null))[_0xf323('0x25')](saveUpdates(_0x57dbe2[_0xf323('0x4a')],null))[_0xf323('0x25')](respondWithResult(_0x36b688,null))[_0xf323('0x43')](handleError(_0x36b688,null));};exports[_0xf323('0x24')]=function(_0x950009,_0x34268e){return db[_0xf323('0x2a')][_0xf323('0x48')]({'where':{'id':_0x950009[_0xf323('0x45')]['id']}})[_0xf323('0x25')](handleEntityNotFound(_0x34268e,null))[_0xf323('0x25')](removeEntity(_0x34268e,null))[_0xf323('0x43')](handleError(_0x34268e,null));};exports['describe']=function(_0x108ec1,_0x18ad3e){return db[_0xf323('0x2a')][_0xf323('0x4b')]()[_0xf323('0x25')](respondWithResult(_0x18ad3e,null))[_0xf323('0x43')](handleError(_0x18ad3e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 5e1be45..6cfea84 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3965=['lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3965,0xe7));var _0x5396=function(_0x495f0b,_0x499f83){_0x495f0b=_0x495f0b-0x0;var _0xef44be=_0x3965[_0x495f0b];return _0xef44be;};'use strict';var _=require(_0x5396('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5396('0x1'));var moment=require(_0x5396('0x2'));var BPromise=require(_0x5396('0x3'));var rp=require(_0x5396('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5396('0x5'));var config=require(_0x5396('0x6'));var attributes=require(_0x5396('0x7'));module['exports']=function(_0x3457f4,_0x3222a4){return _0x3457f4[_0x5396('0x8')](_0x5396('0x9'),attributes,{'tableName':_0x5396('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb67c=['path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb67c,0x19a));var _0xcb67=function(_0x2a3746,_0x4a8a46){_0x2a3746=_0x2a3746-0x0;var _0x1d7e9a=_0xb67c[_0x2a3746];return _0x1d7e9a;};'use strict';var _=require(_0xcb67('0x0'));var util=require('util');var logger=require(_0xcb67('0x1'))(_0xcb67('0x2'));var moment=require(_0xcb67('0x3'));var BPromise=require(_0xcb67('0x4'));var rp=require(_0xcb67('0x5'));var fs=require('fs');var path=require(_0xcb67('0x6'));var rimraf=require(_0xcb67('0x7'));var config=require(_0xcb67('0x8'));var attributes=require(_0xcb67('0x9'));module[_0xcb67('0xa')]=function(_0x242b5c,_0x116e22){return _0x242b5c['define'](_0xcb67('0xb'),attributes,{'tableName':_0xcb67('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index cf9232a..904a079 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a70=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a70,0xf4));var _0x06a7=function(_0x9a5380,_0x566c40){_0x9a5380=_0x9a5380-0x0;var _0xae8b00=_0x6a70[_0x9a5380];return _0xae8b00;};'use strict';var _=require('lodash');var util=require(_0x06a7('0x0'));var moment=require(_0x06a7('0x1'));var BPromise=require(_0x06a7('0x2'));var rs=require(_0x06a7('0x3'));var fs=require('fs');var Redis=require(_0x06a7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x06a7('0x5'));var logger=require(_0x06a7('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x06a7('0x7'));var client=jayson[_0x06a7('0x8')][_0x06a7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x132c29,_0x4b10e7,_0x2459bc){return new BPromise(function(_0x5d9584,_0x33ca82){return client[_0x06a7('0xa')](_0x132c29,_0x2459bc)[_0x06a7('0xb')](function(_0x1f31b2){logger['info'](_0x06a7('0xc'),_0x4b10e7,_0x06a7('0xd'));logger['debug'](_0x06a7('0xe'),_0x4b10e7,_0x06a7('0xd'),JSON[_0x06a7('0xf')](_0x1f31b2));if(_0x1f31b2[_0x06a7('0x10')]){if(_0x1f31b2[_0x06a7('0x10')]['code']===0x1f4){logger[_0x06a7('0x10')](_0x06a7('0xc'),_0x4b10e7,_0x1f31b2[_0x06a7('0x10')][_0x06a7('0x11')]);return _0x33ca82(_0x1f31b2[_0x06a7('0x10')][_0x06a7('0x11')]);}logger['error'](_0x06a7('0xc'),_0x4b10e7,_0x1f31b2['error'][_0x06a7('0x11')]);return _0x5d9584(_0x1f31b2['error']['message']);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x4b10e7,_0x06a7('0xd'));_0x5d9584(_0x1f31b2['result'][_0x06a7('0x11')]);}})[_0x06a7('0x12')](function(_0x7ff47c){logger['error'](_0x06a7('0xc'),_0x4b10e7,_0x7ff47c);_0x33ca82(_0x7ff47c);});});} \ No newline at end of file +var _0x3653=['info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','message','JscriptyQuestionReport,\x20%s,\x20%s','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','then'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x3653,0x119));var _0x3365=function(_0x70be91,_0x3cd470){_0x70be91=_0x70be91-0x0;var _0x2ef932=_0x3653[_0x70be91];return _0x2ef932;};'use strict';var _=require(_0x3365('0x0'));var util=require(_0x3365('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3365('0x2'));var db=require(_0x3365('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3365('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3365('0x5'));var client=jayson['client'][_0x3365('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x11f48c,_0x1f204d,_0x13c53c){return new BPromise(function(_0x253f25,_0x226b36){return client['request'](_0x11f48c,_0x13c53c)[_0x3365('0x7')](function(_0x3316c6){logger[_0x3365('0x8')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1f204d,_0x3365('0x9'));logger[_0x3365('0xa')](_0x3365('0xb'),_0x1f204d,'request\x20sent',JSON['stringify'](_0x3316c6));if(_0x3316c6['error']){if(_0x3316c6[_0x3365('0xc')]['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1f204d,_0x3316c6[_0x3365('0xc')][_0x3365('0xd')]);return _0x226b36(_0x3316c6[_0x3365('0xc')]['message']);}logger[_0x3365('0xc')](_0x3365('0xe'),_0x1f204d,_0x3316c6['error'][_0x3365('0xd')]);return _0x253f25(_0x3316c6[_0x3365('0xc')][_0x3365('0xd')]);}else{logger[_0x3365('0x8')](_0x3365('0xe'),_0x1f204d,_0x3365('0x9'));_0x253f25(_0x3316c6[_0x3365('0xf')][_0x3365('0xd')]);}})[_0x3365('0x10')](function(_0xfa6aef){logger[_0x3365('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1f204d,_0xfa6aef);_0x226b36(_0xfa6aef);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index df9a8a5..ebea700 100644 --- a/server/api/jscriptySessionReport/index.js +++ b/server/api/jscriptySessionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1501=['../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/questions','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5e371a,_0x44e793){var _0x39585e=function(_0x18a1b2){while(--_0x18a1b2){_0x5e371a['push'](_0x5e371a['shift']());}};_0x39585e(++_0x44e793);}(_0x1501,0x126));var _0x1150=function(_0x127db5,_0x3649a8){_0x127db5=_0x127db5-0x0;var _0x5ab2a6=_0x1501[_0x127db5];return _0x5ab2a6;};'use strict';var multer=require('multer');var util=require(_0x1150('0x0'));var path=require(_0x1150('0x1'));var timeout=require(_0x1150('0x2'));var express=require('express');var router=express[_0x1150('0x3')]();var auth=require(_0x1150('0x4'));var interaction=require(_0x1150('0x5'));var config=require(_0x1150('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0x1150('0x7')]('/',auth['isAuthenticated'](),controller[_0x1150('0x8')]);router[_0x1150('0x7')](_0x1150('0x9'),auth[_0x1150('0xa')](),controller[_0x1150('0xb')]);router[_0x1150('0x7')](_0x1150('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x1150('0x7')](_0x1150('0xd'),auth['isAuthenticated'](),controller['getQuestions']);router[_0x1150('0xe')]('/',auth[_0x1150('0xa')](),controller[_0x1150('0xf')]);router[_0x1150('0x10')]('/:id',auth[_0x1150('0xa')](),controller[_0x1150('0x11')]);router['delete'](_0x1150('0xc'),auth['isAuthenticated'](),controller[_0x1150('0x12')]);module[_0x1150('0x13')]=router; \ No newline at end of file +var _0xea81=['./jscriptySessionReport.controller','get','/describe','isAuthenticated','describe','show','/:id/questions','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1b261c,_0xa00940){var _0x4dbc58=function(_0x525982){while(--_0x525982){_0x1b261c['push'](_0x1b261c['shift']());}};_0x4dbc58(++_0xa00940);}(_0xea81,0x1ed));var _0x1ea8=function(_0x3167de,_0x4ab6cf){_0x3167de=_0x3167de-0x0;var _0x13736b=_0xea81[_0x3167de];return _0x13736b;};'use strict';var multer=require(_0x1ea8('0x0'));var util=require(_0x1ea8('0x1'));var path=require(_0x1ea8('0x2'));var timeout=require(_0x1ea8('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x1ea8('0x4'));var interaction=require(_0x1ea8('0x5'));var config=require(_0x1ea8('0x6'));var controller=require(_0x1ea8('0x7'));router[_0x1ea8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1ea8('0x9'),auth[_0x1ea8('0xa')](),controller[_0x1ea8('0xb')]);router[_0x1ea8('0x8')]('/:id',auth[_0x1ea8('0xa')](),controller[_0x1ea8('0xc')]);router[_0x1ea8('0x8')](_0x1ea8('0xd'),auth[_0x1ea8('0xa')](),controller['getQuestions']);router[_0x1ea8('0xe')]('/',auth['isAuthenticated'](),controller[_0x1ea8('0xf')]);router[_0x1ea8('0x10')](_0x1ea8('0x11'),auth[_0x1ea8('0xa')](),controller[_0x1ea8('0x12')]);router['delete']('/:id',auth[_0x1ea8('0xa')](),controller[_0x1ea8('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 08f064e..aa0ef86 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f73=['sequelize','exports','starttime','setDataValue','endtime','format','DATE','STRING','moment'];(function(_0x3b49fc,_0x5e1023){var _0x2652d8=function(_0x500d58){while(--_0x500d58){_0x3b49fc['push'](_0x3b49fc['shift']());}};_0x2652d8(++_0x5e1023);}(_0x3f73,0xb3));var _0x33f7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3f73[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x33f7('0x0'));var Sequelize=require(_0x33f7('0x1'));module[_0x33f7('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x234be1){this['setDataValue'](_0x33f7('0x3'),_0x234be1);this[_0x33f7('0x4')](_0x33f7('0x5'),moment()[_0x33f7('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x33f7('0x7')]},'membername':{'type':Sequelize[_0x33f7('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x33f7('0x8')]},'uniqueid':{'type':Sequelize[_0x33f7('0x8')]},'calleridname':{'type':Sequelize[_0x33f7('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9bcc=['STRING','moment','sequelize','DATE','starttime','endtime','format'];(function(_0x34481d,_0x5c18c6){var _0x5517e0=function(_0x47d5f6){while(--_0x47d5f6){_0x34481d['push'](_0x34481d['shift']());}};_0x5517e0(++_0x5c18c6);}(_0x9bcc,0x86));var _0xc9bc=function(_0x498bce,_0x4efe77){_0x498bce=_0x498bce-0x0;var _0xff9248=_0x9bcc[_0x498bce];return _0xff9248;};'use strict';var moment=require(_0xc9bc('0x0'));var Sequelize=require(_0xc9bc('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xc9bc('0x2')],'set':function(_0x5884ce){this['setDataValue'](_0xc9bc('0x3'),_0x5884ce);this['setDataValue'](_0xc9bc('0x4'),moment()[_0xc9bc('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xc9bc('0x2')]},'membername':{'type':Sequelize[_0xc9bc('0x6')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc9bc('0x6')]},'calleridname':{'type':Sequelize[_0xc9bc('0x6')]},'calleridnum':{'type':Sequelize[_0xc9bc('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index a093f5b..0c24916 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d0b=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','reject','then','error','stack','name','index','JscriptySessionReport','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','sort','where','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','update','describe','findOne','JscriptyQuestionReport','hasOwnProperty','order','pick','SessionId','findAll','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0x0d0b,0x86));var _0xb0d0=function(_0x4ebce7,_0x44fbaf){_0x4ebce7=_0x4ebce7-0x0;var _0x8a07c9=_0x0d0b[_0x4ebce7];return _0x8a07c9;};'use strict';var pdf=require(_0xb0d0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb0d0('0x1'));var zipdir=require(_0xb0d0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0d0('0x3'));var moment=require('moment');var BPromise=require(_0xb0d0('0x4'));var Mustache=require(_0xb0d0('0x5'));var util=require(_0xb0d0('0x6'));var path=require(_0xb0d0('0x7'));var sox=require(_0xb0d0('0x8'));var csv=require('to-csv');var ejs=require(_0xb0d0('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb0d0('0xa'));var crypto=require(_0xb0d0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb0d0('0xc'));var toCsv=require(_0xb0d0('0xd'));var querystring=require(_0xb0d0('0xe'));var Papa=require(_0xb0d0('0xf'));var Redis=require(_0xb0d0('0x10'));var authService=require(_0xb0d0('0x11'));var qs=require(_0xb0d0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0d0('0x13'))(_0xb0d0('0x14'));var utils=require(_0xb0d0('0x15'));var config=require(_0xb0d0('0x16'));var db=require(_0xb0d0('0x17'))['db'];function respondWithStatusCode(_0x5a89aa,_0x54dcb0){_0x54dcb0=_0x54dcb0||0xcc;return function(_0x3bb89c){if(_0x3bb89c){return _0x5a89aa[_0xb0d0('0x18')](_0x54dcb0);}return _0x5a89aa['status'](_0x54dcb0)[_0xb0d0('0x19')]();};}function respondWithResult(_0x50f8a6,_0x18c3ba){_0x18c3ba=_0x18c3ba||0xc8;return function(_0x2a7332){if(_0x2a7332){return _0x50f8a6[_0xb0d0('0x1a')](_0x18c3ba)[_0xb0d0('0x1b')](_0x2a7332);}};}function respondWithFilteredResult(_0x463a7f,_0x432d9c){return function(_0x24cbec){if(_0x24cbec){var _0x696144=_0x24cbec[_0xb0d0('0x1c')],_0x2f6de3=_0x432d9c[_0xb0d0('0x1d')],_0x3afa95=_0x432d9c['offset']+_0x432d9c['limit'],_0x29cd49;if(_0x3afa95>=_0x696144){_0x3afa95=_0x696144;_0x29cd49=0xc8;}else{_0x29cd49=0xce;}_0x463a7f[_0xb0d0('0x1a')](_0x29cd49);return _0x463a7f[_0xb0d0('0x1e')]('Content-Range',_0x2f6de3+'-'+_0x3afa95+'/'+_0x696144)[_0xb0d0('0x1b')](_0x24cbec);}return null;};}function patchUpdates(_0x15a7ff){return function(_0x3145d4){try{jsonpatch['apply'](_0x3145d4,_0x15a7ff,!![]);}catch(_0x19140f){return BPromise[_0xb0d0('0x1f')](_0x19140f);}return _0x3145d4['save']();};}function saveUpdates(_0x3ab773,_0x3b1551){return function(_0x517006){if(_0x517006){return _0x517006['update'](_0x3ab773)[_0xb0d0('0x20')](function(_0x265f0a){return _0x265f0a;});}return null;};}function removeEntity(_0x4f87e8,_0x39d27f){return function(_0x241278){if(_0x241278){return _0x241278['destroy']()[_0xb0d0('0x20')](function(){_0x4f87e8[_0xb0d0('0x1a')](0xcc)[_0xb0d0('0x19')]();});}};}function handleEntityNotFound(_0x1ca40e,_0x4202c9){return function(_0x4174eb){if(!_0x4174eb){_0x1ca40e['sendStatus'](0x194);}return _0x4174eb;};}function handleError(_0x35f6ef,_0x3c970d){_0x3c970d=_0x3c970d||0x1f4;return function(_0x56ee48){logger[_0xb0d0('0x21')](_0x56ee48[_0xb0d0('0x22')]);if(_0x56ee48[_0xb0d0('0x23')]){delete _0x56ee48['name'];}_0x35f6ef[_0xb0d0('0x1a')](_0x3c970d)['send'](_0x56ee48);};}exports[_0xb0d0('0x24')]=function(_0x567bbd,_0x28db04){var _0x3be682={},_0x9c5e5b={},_0x36197c={'count':0x0,'rows':[]};var _0x861b7a=db[_0xb0d0('0x25')]['rawAttributes'];_0x9c5e5b[_0xb0d0('0x26')]=_[_0xb0d0('0x27')](_0x861b7a);_0x9c5e5b[_0xb0d0('0x28')]=_['keys'](_0x567bbd[_0xb0d0('0x28')]);_0x9c5e5b[_0xb0d0('0x29')]=_[_0xb0d0('0x2a')](_0x9c5e5b['model'],_0x9c5e5b[_0xb0d0('0x28')]);_0x3be682['attributes']=_['intersection'](_0x9c5e5b[_0xb0d0('0x26')],qs[_0xb0d0('0x2b')](_0x567bbd[_0xb0d0('0x28')][_0xb0d0('0x2b')]));_0x3be682[_0xb0d0('0x2c')]=_0x3be682['attributes'][_0xb0d0('0x2d')]?_0x3be682[_0xb0d0('0x2c')]:_0x9c5e5b[_0xb0d0('0x26')];if(!_0x567bbd[_0xb0d0('0x28')]['hasOwnProperty'](_0xb0d0('0x2e'))){_0x3be682[_0xb0d0('0x2f')]=qs[_0xb0d0('0x2f')](_0x567bbd[_0xb0d0('0x28')][_0xb0d0('0x2f')]);_0x3be682[_0xb0d0('0x1d')]=qs[_0xb0d0('0x1d')](_0x567bbd[_0xb0d0('0x28')][_0xb0d0('0x1d')]);}_0x3be682['order']=qs['sort'](_0x567bbd[_0xb0d0('0x28')][_0xb0d0('0x30')]);_0x3be682[_0xb0d0('0x31')]=qs['filters'](_['pick'](_0x567bbd[_0xb0d0('0x28')],_0x9c5e5b[_0xb0d0('0x29')]));if(_0x567bbd[_0xb0d0('0x28')][_0xb0d0('0x32')]){_0x3be682[_0xb0d0('0x31')]=_[_0xb0d0('0x33')](_0x3be682[_0xb0d0('0x31')],{'$or':_['map'](_0x861b7a,function(_0x395d44){if(_0x395d44[_0xb0d0('0x34')]['key']!==_0xb0d0('0x35')){var _0x397925={};_0x397925[_0x395d44['field']]={'$like':'%'+_0x567bbd[_0xb0d0('0x28')][_0xb0d0('0x32')]+'%'};return _0x397925;}})});}_0x3be682=_[_0xb0d0('0x33')]({},_0x3be682,_0x567bbd['options']);var _0x121c40={'where':_0x3be682[_0xb0d0('0x31')]};return db[_0xb0d0('0x25')][_0xb0d0('0x1c')](_0x121c40)[_0xb0d0('0x20')](function(_0x4fccfa){_0x36197c[_0xb0d0('0x1c')]=_0x4fccfa;if(_0x567bbd[_0xb0d0('0x28')][_0xb0d0('0x36')]){_0x3be682[_0xb0d0('0x37')]=[{'all':!![]}];}return db[_0xb0d0('0x25')]['findAll'](_0x3be682);})[_0xb0d0('0x20')](function(_0x4dc479){_0x36197c[_0xb0d0('0x38')]=_0x4dc479;return _0x36197c;})['then'](respondWithFilteredResult(_0x28db04,_0x3be682))[_0xb0d0('0x39')](handleError(_0x28db04,null));};exports[_0xb0d0('0x3a')]=function(_0x2b174c,_0xb15f21){var _0x2728b8={'raw':!![],'where':{'id':_0x2b174c[_0xb0d0('0x3b')]['id']}},_0x3c9eb1={};_0x3c9eb1[_0xb0d0('0x26')]=_['keys'](db[_0xb0d0('0x25')][_0xb0d0('0x3c')]);_0x3c9eb1[_0xb0d0('0x28')]=_[_0xb0d0('0x27')](_0x2b174c['query']);_0x3c9eb1['filters']=_['intersection'](_0x3c9eb1[_0xb0d0('0x26')],_0x3c9eb1[_0xb0d0('0x28')]);_0x2728b8['attributes']=_[_0xb0d0('0x2a')](_0x3c9eb1[_0xb0d0('0x26')],qs[_0xb0d0('0x2b')](_0x2b174c['query']['fields']));_0x2728b8[_0xb0d0('0x2c')]=_0x2728b8['attributes'][_0xb0d0('0x2d')]?_0x2728b8['attributes']:_0x3c9eb1['model'];if(_0x2b174c[_0xb0d0('0x28')][_0xb0d0('0x36')]){_0x2728b8[_0xb0d0('0x37')]=[{'all':!![]}];}_0x2728b8=_[_0xb0d0('0x33')]({},_0x2728b8,_0x2b174c[_0xb0d0('0x3d')]);return db[_0xb0d0('0x25')][_0xb0d0('0x3e')](_0x2728b8)[_0xb0d0('0x20')](handleEntityNotFound(_0xb15f21,null))[_0xb0d0('0x20')](respondWithResult(_0xb15f21,null))[_0xb0d0('0x39')](handleError(_0xb15f21,null));};exports['create']=function(_0x5a4210,_0x1ba18b){return db[_0xb0d0('0x25')][_0xb0d0('0x3f')](_0x5a4210[_0xb0d0('0x40')],{})[_0xb0d0('0x20')](respondWithResult(_0x1ba18b,0xc9))['catch'](handleError(_0x1ba18b,null));};exports[_0xb0d0('0x41')]=function(_0x353b4a,_0x17558e){if(_0x353b4a[_0xb0d0('0x40')]['id']){delete _0x353b4a[_0xb0d0('0x40')]['id'];}return db[_0xb0d0('0x25')]['find']({'where':{'id':_0x353b4a[_0xb0d0('0x3b')]['id']}})[_0xb0d0('0x20')](handleEntityNotFound(_0x17558e,null))[_0xb0d0('0x20')](saveUpdates(_0x353b4a[_0xb0d0('0x40')],null))[_0xb0d0('0x20')](respondWithResult(_0x17558e,null))[_0xb0d0('0x39')](handleError(_0x17558e,null));};exports['destroy']=function(_0x3aa6d2,_0x34293f){return db[_0xb0d0('0x25')][_0xb0d0('0x3e')]({'where':{'id':_0x3aa6d2[_0xb0d0('0x3b')]['id']}})[_0xb0d0('0x20')](handleEntityNotFound(_0x34293f,null))['then'](removeEntity(_0x34293f,null))[_0xb0d0('0x39')](handleError(_0x34293f,null));};exports[_0xb0d0('0x42')]=function(_0x314830,_0x113510){return db[_0xb0d0('0x25')]['describe']()[_0xb0d0('0x20')](respondWithResult(_0x113510,null))[_0xb0d0('0x39')](handleError(_0x113510,null));};exports['getQuestions']=function(_0x12d8e6,_0x5cb37a,_0x16aa63){var _0x528cbe={'raw':!![],'where':{}};var _0x557b29={};var _0xa7fb87={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xb0d0('0x43')]({'where':{'id':_0x12d8e6[_0xb0d0('0x3b')]['id']}})[_0xb0d0('0x20')](handleEntityNotFound(_0x5cb37a,null))[_0xb0d0('0x20')](function(_0x5970ac){if(_0x5970ac){_0x557b29[_0xb0d0('0x26')]=_[_0xb0d0('0x27')](db[_0xb0d0('0x44')][_0xb0d0('0x3c')]);_0x557b29[_0xb0d0('0x28')]=_[_0xb0d0('0x27')](_0x12d8e6[_0xb0d0('0x28')]);_0x557b29[_0xb0d0('0x29')]=_['intersection'](_0x557b29[_0xb0d0('0x26')],_0x557b29['query']);_0x528cbe[_0xb0d0('0x2c')]=_['intersection'](_0x557b29[_0xb0d0('0x26')],qs[_0xb0d0('0x2b')](_0x12d8e6['query'][_0xb0d0('0x2b')]));_0x528cbe[_0xb0d0('0x2c')]=_0x528cbe[_0xb0d0('0x2c')][_0xb0d0('0x2d')]?_0x528cbe[_0xb0d0('0x2c')]:_0x557b29[_0xb0d0('0x26')];if(!_0x12d8e6[_0xb0d0('0x28')][_0xb0d0('0x45')](_0xb0d0('0x2e'))){_0x528cbe[_0xb0d0('0x2f')]=qs[_0xb0d0('0x2f')](_0x12d8e6[_0xb0d0('0x28')][_0xb0d0('0x2f')]);_0x528cbe[_0xb0d0('0x1d')]=qs[_0xb0d0('0x1d')](_0x12d8e6[_0xb0d0('0x28')]['offset']);}_0x528cbe[_0xb0d0('0x46')]=qs[_0xb0d0('0x30')](_0x12d8e6['query']['sort']);_0x528cbe[_0xb0d0('0x31')]=qs['filters'](_[_0xb0d0('0x47')](_0x12d8e6[_0xb0d0('0x28')],_0x557b29['filters']));_0x528cbe[_0xb0d0('0x31')][_0xb0d0('0x48')]=_0x5970ac['id'];if(_0x12d8e6[_0xb0d0('0x28')]['filter']){_0x528cbe[_0xb0d0('0x31')]=_[_0xb0d0('0x33')](_0x528cbe[_0xb0d0('0x31')],{'$or':_['map'](_0x528cbe[_0xb0d0('0x2c')],function(_0x1630f6){var _0x1f189b={};_0x1f189b[_0x1630f6]={'$like':'%'+_0x12d8e6[_0xb0d0('0x28')][_0xb0d0('0x32')]+'%'};return _0x1f189b;})});}_0x528cbe=_[_0xb0d0('0x33')]({},_0x528cbe,_0x12d8e6['options']);return db[_0xb0d0('0x44')][_0xb0d0('0x1c')]({'where':_0x528cbe[_0xb0d0('0x31')]})[_0xb0d0('0x20')](function(_0x4adbcf){_0xa7fb87[_0xb0d0('0x1c')]=_0x4adbcf;if(_0x12d8e6[_0xb0d0('0x28')]['includeAll']){_0x528cbe['include']=[{'all':!![]}];}return db[_0xb0d0('0x44')][_0xb0d0('0x49')](_0x528cbe);})['then'](function(_0x1e5e02){_0xa7fb87[_0xb0d0('0x38')]=_0x1e5e02;return _0xa7fb87;});}})[_0xb0d0('0x20')](respondWithFilteredResult(_0x5cb37a,_0x528cbe))[_0xb0d0('0x39')](handleError(_0x5cb37a,null));}; \ No newline at end of file +var _0x3432=['count','offset','limit','apply','reject','save','update','then','end','error','stack','name','send','index','JscriptySessionReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','findOne','JscriptyQuestionReport','SessionId','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x37f85a,_0x240e20){var _0x190eeb=function(_0x2ae374){while(--_0x2ae374){_0x37f85a['push'](_0x37f85a['shift']());}};_0x190eeb(++_0x240e20);}(_0x3432,0x124));var _0x2343=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3432[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x2343('0x0'));var emlformat=require(_0x2343('0x1'));var rimraf=require(_0x2343('0x2'));var zipdir=require(_0x2343('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2343('0x4'));var moment=require(_0x2343('0x5'));var BPromise=require(_0x2343('0x6'));var Mustache=require(_0x2343('0x7'));var util=require(_0x2343('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x2343('0x9'));var ejs=require(_0x2343('0xa'));var fs=require('fs');var _=require(_0x2343('0xb'));var squel=require(_0x2343('0xc'));var crypto=require(_0x2343('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2343('0xe'));var toCsv=require(_0x2343('0x9'));var querystring=require(_0x2343('0xf'));var Papa=require(_0x2343('0x10'));var Redis=require(_0x2343('0x11'));var authService=require(_0x2343('0x12'));var qs=require(_0x2343('0x13'));var hardwareService=require(_0x2343('0x14'));var logger=require(_0x2343('0x15'))(_0x2343('0x16'));var utils=require('../../config/utils');var config=require(_0x2343('0x17'));var db=require(_0x2343('0x18'))['db'];function respondWithStatusCode(_0x4b26ce,_0x3cbdc9){_0x3cbdc9=_0x3cbdc9||0xcc;return function(_0x47fbc1){if(_0x47fbc1){return _0x4b26ce[_0x2343('0x19')](_0x3cbdc9);}return _0x4b26ce[_0x2343('0x1a')](_0x3cbdc9)['end']();};}function respondWithResult(_0x4bd31c,_0x1ccbdd){_0x1ccbdd=_0x1ccbdd||0xc8;return function(_0x6adfee){if(_0x6adfee){return _0x4bd31c['status'](_0x1ccbdd)[_0x2343('0x1b')](_0x6adfee);}};}function respondWithFilteredResult(_0x4ed85b,_0x1160fa){return function(_0x9c3220){if(_0x9c3220){var _0x404974=_0x9c3220[_0x2343('0x1c')],_0x450dba=_0x1160fa[_0x2343('0x1d')],_0x34b28c=_0x1160fa['offset']+_0x1160fa[_0x2343('0x1e')],_0x875599;if(_0x34b28c>=_0x404974){_0x34b28c=_0x404974;_0x875599=0xc8;}else{_0x875599=0xce;}_0x4ed85b['status'](_0x875599);return _0x4ed85b['set']('Content-Range',_0x450dba+'-'+_0x34b28c+'/'+_0x404974)['json'](_0x9c3220);}return null;};}function patchUpdates(_0x1a642c){return function(_0x5eef4f){try{jsonpatch[_0x2343('0x1f')](_0x5eef4f,_0x1a642c,!![]);}catch(_0x96e7e3){return BPromise[_0x2343('0x20')](_0x96e7e3);}return _0x5eef4f[_0x2343('0x21')]();};}function saveUpdates(_0x4c4b27,_0x52f2f1){return function(_0x47b7e3){if(_0x47b7e3){return _0x47b7e3[_0x2343('0x22')](_0x4c4b27)['then'](function(_0x35ef6b){return _0x35ef6b;});}return null;};}function removeEntity(_0x28f892,_0x4750e8){return function(_0xd24792){if(_0xd24792){return _0xd24792['destroy']()[_0x2343('0x23')](function(){_0x28f892[_0x2343('0x1a')](0xcc)[_0x2343('0x24')]();});}};}function handleEntityNotFound(_0x58a47b,_0x4e67f0){return function(_0x25eb79){if(!_0x25eb79){_0x58a47b[_0x2343('0x19')](0x194);}return _0x25eb79;};}function handleError(_0xb8cf67,_0x2bbde7){_0x2bbde7=_0x2bbde7||0x1f4;return function(_0x537200){logger[_0x2343('0x25')](_0x537200[_0x2343('0x26')]);if(_0x537200[_0x2343('0x27')]){delete _0x537200[_0x2343('0x27')];}_0xb8cf67[_0x2343('0x1a')](_0x2bbde7)[_0x2343('0x28')](_0x537200);};}exports[_0x2343('0x29')]=function(_0x244e77,_0x52d8a5){var _0x5acf2e={},_0x103a69={},_0x8f52b={'count':0x0,'rows':[]};var _0x562fcb=db[_0x2343('0x2a')][_0x2343('0x2b')];_0x103a69[_0x2343('0x2c')]=_[_0x2343('0x2d')](_0x562fcb);_0x103a69[_0x2343('0x2e')]=_[_0x2343('0x2d')](_0x244e77[_0x2343('0x2e')]);_0x103a69[_0x2343('0x2f')]=_[_0x2343('0x30')](_0x103a69['model'],_0x103a69['query']);_0x5acf2e[_0x2343('0x31')]=_[_0x2343('0x30')](_0x103a69['model'],qs['fields'](_0x244e77[_0x2343('0x2e')][_0x2343('0x32')]));_0x5acf2e['attributes']=_0x5acf2e[_0x2343('0x31')][_0x2343('0x33')]?_0x5acf2e['attributes']:_0x103a69[_0x2343('0x2c')];if(!_0x244e77[_0x2343('0x2e')][_0x2343('0x34')](_0x2343('0x35'))){_0x5acf2e[_0x2343('0x1e')]=qs['limit'](_0x244e77[_0x2343('0x2e')][_0x2343('0x1e')]);_0x5acf2e[_0x2343('0x1d')]=qs[_0x2343('0x1d')](_0x244e77['query']['offset']);}_0x5acf2e[_0x2343('0x36')]=qs[_0x2343('0x37')](_0x244e77[_0x2343('0x2e')][_0x2343('0x37')]);_0x5acf2e['where']=qs[_0x2343('0x2f')](_[_0x2343('0x38')](_0x244e77['query'],_0x103a69[_0x2343('0x2f')]));if(_0x244e77[_0x2343('0x2e')][_0x2343('0x39')]){_0x5acf2e[_0x2343('0x3a')]=_[_0x2343('0x3b')](_0x5acf2e[_0x2343('0x3a')],{'$or':_[_0x2343('0x3c')](_0x562fcb,function(_0x1f874b){if(_0x1f874b[_0x2343('0x3d')][_0x2343('0x3e')]!==_0x2343('0x3f')){var _0x427c9e={};_0x427c9e[_0x1f874b[_0x2343('0x40')]]={'$like':'%'+_0x244e77[_0x2343('0x2e')][_0x2343('0x39')]+'%'};return _0x427c9e;}})});}_0x5acf2e=_[_0x2343('0x3b')]({},_0x5acf2e,_0x244e77[_0x2343('0x41')]);var _0x5c6766={'where':_0x5acf2e[_0x2343('0x3a')]};return db[_0x2343('0x2a')][_0x2343('0x1c')](_0x5c6766)['then'](function(_0x58a08c){_0x8f52b[_0x2343('0x1c')]=_0x58a08c;if(_0x244e77['query'][_0x2343('0x42')]){_0x5acf2e[_0x2343('0x43')]=[{'all':!![]}];}return db[_0x2343('0x2a')][_0x2343('0x44')](_0x5acf2e);})[_0x2343('0x23')](function(_0x371c37){_0x8f52b[_0x2343('0x45')]=_0x371c37;return _0x8f52b;})[_0x2343('0x23')](respondWithFilteredResult(_0x52d8a5,_0x5acf2e))[_0x2343('0x46')](handleError(_0x52d8a5,null));};exports[_0x2343('0x47')]=function(_0x402d39,_0xc9129a){var _0x8fde9f={'raw':!![],'where':{'id':_0x402d39[_0x2343('0x48')]['id']}},_0x3462e3={};_0x3462e3[_0x2343('0x2c')]=_[_0x2343('0x2d')](db[_0x2343('0x2a')]['rawAttributes']);_0x3462e3['query']=_[_0x2343('0x2d')](_0x402d39[_0x2343('0x2e')]);_0x3462e3['filters']=_[_0x2343('0x30')](_0x3462e3[_0x2343('0x2c')],_0x3462e3[_0x2343('0x2e')]);_0x8fde9f[_0x2343('0x31')]=_[_0x2343('0x30')](_0x3462e3[_0x2343('0x2c')],qs['fields'](_0x402d39['query'][_0x2343('0x32')]));_0x8fde9f[_0x2343('0x31')]=_0x8fde9f[_0x2343('0x31')][_0x2343('0x33')]?_0x8fde9f[_0x2343('0x31')]:_0x3462e3['model'];if(_0x402d39[_0x2343('0x2e')]['includeAll']){_0x8fde9f[_0x2343('0x43')]=[{'all':!![]}];}_0x8fde9f=_[_0x2343('0x3b')]({},_0x8fde9f,_0x402d39[_0x2343('0x41')]);return db[_0x2343('0x2a')][_0x2343('0x49')](_0x8fde9f)['then'](handleEntityNotFound(_0xc9129a,null))[_0x2343('0x23')](respondWithResult(_0xc9129a,null))[_0x2343('0x46')](handleError(_0xc9129a,null));};exports[_0x2343('0x4a')]=function(_0x551fe2,_0xb5fbba){return db['JscriptySessionReport'][_0x2343('0x4a')](_0x551fe2[_0x2343('0x4b')],{})['then'](respondWithResult(_0xb5fbba,0xc9))[_0x2343('0x46')](handleError(_0xb5fbba,null));};exports[_0x2343('0x22')]=function(_0x41584f,_0x4561a1){if(_0x41584f[_0x2343('0x4b')]['id']){delete _0x41584f[_0x2343('0x4b')]['id'];}return db[_0x2343('0x2a')][_0x2343('0x49')]({'where':{'id':_0x41584f[_0x2343('0x48')]['id']}})[_0x2343('0x23')](handleEntityNotFound(_0x4561a1,null))[_0x2343('0x23')](saveUpdates(_0x41584f[_0x2343('0x4b')],null))[_0x2343('0x23')](respondWithResult(_0x4561a1,null))[_0x2343('0x46')](handleError(_0x4561a1,null));};exports['destroy']=function(_0x3de706,_0x2f94d6){return db['JscriptySessionReport'][_0x2343('0x49')]({'where':{'id':_0x3de706[_0x2343('0x48')]['id']}})[_0x2343('0x23')](handleEntityNotFound(_0x2f94d6,null))[_0x2343('0x23')](removeEntity(_0x2f94d6,null))['catch'](handleError(_0x2f94d6,null));};exports[_0x2343('0x4c')]=function(_0x457d24,_0x81bfe6){return db[_0x2343('0x2a')][_0x2343('0x4c')]()[_0x2343('0x23')](respondWithResult(_0x81bfe6,null))['catch'](handleError(_0x81bfe6,null));};exports['getQuestions']=function(_0x196afc,_0xfe80e0,_0x2afb62){var _0x4a9560={'raw':!![],'where':{}};var _0x54ac85={};var _0x5468c3={'count':0x0,'rows':[]};return db[_0x2343('0x2a')][_0x2343('0x4d')]({'where':{'id':_0x196afc[_0x2343('0x48')]['id']}})['then'](handleEntityNotFound(_0xfe80e0,null))[_0x2343('0x23')](function(_0x10d35e){if(_0x10d35e){_0x54ac85[_0x2343('0x2c')]=_[_0x2343('0x2d')](db[_0x2343('0x4e')][_0x2343('0x2b')]);_0x54ac85['query']=_[_0x2343('0x2d')](_0x196afc[_0x2343('0x2e')]);_0x54ac85[_0x2343('0x2f')]=_[_0x2343('0x30')](_0x54ac85['model'],_0x54ac85[_0x2343('0x2e')]);_0x4a9560[_0x2343('0x31')]=_[_0x2343('0x30')](_0x54ac85[_0x2343('0x2c')],qs[_0x2343('0x32')](_0x196afc['query']['fields']));_0x4a9560[_0x2343('0x31')]=_0x4a9560[_0x2343('0x31')][_0x2343('0x33')]?_0x4a9560[_0x2343('0x31')]:_0x54ac85[_0x2343('0x2c')];if(!_0x196afc[_0x2343('0x2e')][_0x2343('0x34')](_0x2343('0x35'))){_0x4a9560[_0x2343('0x1e')]=qs[_0x2343('0x1e')](_0x196afc[_0x2343('0x2e')][_0x2343('0x1e')]);_0x4a9560[_0x2343('0x1d')]=qs['offset'](_0x196afc[_0x2343('0x2e')][_0x2343('0x1d')]);}_0x4a9560['order']=qs[_0x2343('0x37')](_0x196afc[_0x2343('0x2e')][_0x2343('0x37')]);_0x4a9560[_0x2343('0x3a')]=qs[_0x2343('0x2f')](_[_0x2343('0x38')](_0x196afc[_0x2343('0x2e')],_0x54ac85[_0x2343('0x2f')]));_0x4a9560[_0x2343('0x3a')][_0x2343('0x4f')]=_0x10d35e['id'];if(_0x196afc[_0x2343('0x2e')][_0x2343('0x39')]){_0x4a9560[_0x2343('0x3a')]=_[_0x2343('0x3b')](_0x4a9560[_0x2343('0x3a')],{'$or':_[_0x2343('0x3c')](_0x4a9560[_0x2343('0x31')],function(_0x351e8b){var _0x2d23b3={};_0x2d23b3[_0x351e8b]={'$like':'%'+_0x196afc[_0x2343('0x2e')][_0x2343('0x39')]+'%'};return _0x2d23b3;})});}_0x4a9560=_[_0x2343('0x3b')]({},_0x4a9560,_0x196afc['options']);return db[_0x2343('0x4e')]['count']({'where':_0x4a9560['where']})['then'](function(_0x20eaaf){_0x5468c3[_0x2343('0x1c')]=_0x20eaaf;if(_0x196afc[_0x2343('0x2e')]['includeAll']){_0x4a9560[_0x2343('0x43')]=[{'all':!![]}];}return db[_0x2343('0x4e')][_0x2343('0x44')](_0x4a9560);})['then'](function(_0x20fc41){_0x5468c3[_0x2343('0x45')]=_0x20fc41;return _0x5468c3;});}})[_0x2343('0x23')](respondWithFilteredResult(_0xfe80e0,_0x4a9560))[_0x2343('0x46')](handleError(_0xfe80e0,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index f6d0ee8..dd36b6c 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.model.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b64=['../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','moment','request-promise','path','rimraf'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x2b64,0x7f));var _0x42b6=function(_0x539849,_0x4030df){_0x539849=_0x539849-0x0;var _0x5f6894=_0x2b64[_0x539849];return _0x5f6894;};'use strict';var _=require(_0x42b6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x42b6('0x1'));var BPromise=require('bluebird');var rp=require(_0x42b6('0x2'));var fs=require('fs');var path=require(_0x42b6('0x3'));var rimraf=require(_0x42b6('0x4'));var config=require(_0x42b6('0x5'));var attributes=require(_0x42b6('0x6'));module[_0x42b6('0x7')]=function(_0x2826a2,_0xd0a7dd){return _0x2826a2[_0x42b6('0x8')](_0x42b6('0x9'),attributes,{'tableName':_0x42b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb83a=['JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','./jscriptySessionReport.attributes','exports','define'];(function(_0x1500b0,_0x38492a){var _0x5dfa8f=function(_0x192925){while(--_0x192925){_0x1500b0['push'](_0x1500b0['shift']());}};_0x5dfa8f(++_0x38492a);}(_0xb83a,0xe9));var _0xab83=function(_0x16f778,_0x3981b7){_0x16f778=_0x16f778-0x0;var _0x1fbdca=_0xb83a[_0x16f778];return _0x1fbdca;};'use strict';var _=require(_0xab83('0x0'));var util=require('util');var logger=require(_0xab83('0x1'))(_0xab83('0x2'));var moment=require(_0xab83('0x3'));var BPromise=require(_0xab83('0x4'));var rp=require(_0xab83('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xab83('0x6'));module[_0xab83('0x7')]=function(_0x3d72c3,_0x278e6c){return _0x3d72c3[_0xab83('0x8')](_0xab83('0x9'),attributes,{'tableName':_0xab83('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index f61fcd4..a9f7102 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ca2=['client','http','request','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3b4a96,_0x16d385){var _0x839176=function(_0x63c47b){while(--_0x63c47b){_0x3b4a96['push'](_0x3b4a96['shift']());}};_0x839176(++_0x16d385);}(_0x8ca2,0x109));var _0x28ca=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x8ca2[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x28ca('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x28ca('0x1'));var rs=require(_0x28ca('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x28ca('0x3'));var logger=require(_0x28ca('0x4'))(_0x28ca('0x5'));var config=require(_0x28ca('0x6'));var jayson=require(_0x28ca('0x7'));var client=jayson[_0x28ca('0x8')][_0x28ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ef56a,_0x1fd8b0,_0x182639){return new BPromise(function(_0x2edcf6,_0x2127b2){return client[_0x28ca('0xa')](_0x5ef56a,_0x182639)['then'](function(_0x4a9f8d){logger['info'](_0x28ca('0xb'),_0x1fd8b0,'request\x20sent');logger[_0x28ca('0xc')](_0x28ca('0xd'),_0x1fd8b0,_0x28ca('0xe'),JSON[_0x28ca('0xf')](_0x4a9f8d));if(_0x4a9f8d['error']){if(_0x4a9f8d['error'][_0x28ca('0x10')]===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x1fd8b0,_0x4a9f8d[_0x28ca('0x11')][_0x28ca('0x12')]);return _0x2127b2(_0x4a9f8d[_0x28ca('0x11')]['message']);}logger[_0x28ca('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x1fd8b0,_0x4a9f8d[_0x28ca('0x11')]['message']);return _0x2edcf6(_0x4a9f8d[_0x28ca('0x11')][_0x28ca('0x12')]);}else{logger[_0x28ca('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x1fd8b0,_0x28ca('0xe'));_0x2edcf6(_0x4a9f8d[_0x28ca('0x14')][_0x28ca('0x12')]);}})['catch'](function(_0x3d2840){logger[_0x28ca('0x11')](_0x28ca('0xb'),_0x1fd8b0,_0x3d2840);_0x2127b2(_0x3d2840);});});} \ No newline at end of file +var _0xcb6f=['info','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x440340,_0x44717b){var _0x3614f7=function(_0x5dd3a3){while(--_0x5dd3a3){_0x440340['push'](_0x440340['shift']());}};_0x3614f7(++_0x44717b);}(_0xcb6f,0x13d));var _0xfcb6=function(_0x11b571,_0x450b84){_0x11b571=_0x11b571-0x0;var _0x59576c=_0xcb6f[_0x11b571];return _0x59576c;};'use strict';var _=require(_0xfcb6('0x0'));var util=require(_0xfcb6('0x1'));var moment=require('moment');var BPromise=require(_0xfcb6('0x2'));var rs=require(_0xfcb6('0x3'));var fs=require('fs');var Redis=require(_0xfcb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfcb6('0x5'));var logger=require(_0xfcb6('0x6'))(_0xfcb6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfcb6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7fed7,_0xc629de,_0x36e252){return new BPromise(function(_0x5ac13d,_0x197dd6){return client[_0xfcb6('0x9')](_0x7fed7,_0x36e252)[_0xfcb6('0xa')](function(_0x52cf82){logger['info'](_0xfcb6('0xb'),_0xc629de,_0xfcb6('0xc'));logger[_0xfcb6('0xd')](_0xfcb6('0xe'),_0xc629de,_0xfcb6('0xc'),JSON[_0xfcb6('0xf')](_0x52cf82));if(_0x52cf82[_0xfcb6('0x10')]){if(_0x52cf82['error'][_0xfcb6('0x11')]===0x1f4){logger[_0xfcb6('0x10')](_0xfcb6('0xb'),_0xc629de,_0x52cf82[_0xfcb6('0x10')][_0xfcb6('0x12')]);return _0x197dd6(_0x52cf82[_0xfcb6('0x10')][_0xfcb6('0x12')]);}logger[_0xfcb6('0x10')](_0xfcb6('0xb'),_0xc629de,_0x52cf82['error'][_0xfcb6('0x12')]);return _0x5ac13d(_0x52cf82['error'][_0xfcb6('0x12')]);}else{logger[_0xfcb6('0x13')](_0xfcb6('0xb'),_0xc629de,_0xfcb6('0xc'));_0x5ac13d(_0x52cf82['result'][_0xfcb6('0x12')]);}})[_0xfcb6('0x14')](function(_0x5d2284){logger[_0xfcb6('0x10')](_0xfcb6('0xb'),_0xc629de,_0x5d2284);_0x197dd6(_0x5d2284);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 065aa7a..72c3f07 100644 --- a/server/api/license/index.js +++ b/server/api/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4578=['express','Router','./license.controller','get','index','put','update','multer','util','path'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0x4578,0x165));var _0x8457=function(_0x2b04bf,_0x4703ae){_0x2b04bf=_0x2b04bf-0x0;var _0x176f42=_0x4578[_0x2b04bf];return _0x176f42;};'use strict';var multer=require(_0x8457('0x0'));var util=require(_0x8457('0x1'));var path=require(_0x8457('0x2'));var timeout=require('connect-timeout');var express=require(_0x8457('0x3'));var router=express[_0x8457('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8457('0x5'));router[_0x8457('0x6')]('/',controller[_0x8457('0x7')]);router[_0x8457('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8457('0x9')]);module['exports']=router; \ No newline at end of file +var _0x739c=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','put','isAuthenticated','update','multer','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x739c,0x1b0));var _0xc739=function(_0x1cce60,_0xb7eac7){_0x1cce60=_0x1cce60-0x0;var _0x33b7ed=_0x739c[_0x1cce60];return _0x33b7ed;};'use strict';var multer=require(_0xc739('0x0'));var util=require(_0xc739('0x1'));var path=require(_0xc739('0x2'));var timeout=require(_0xc739('0x3'));var express=require(_0xc739('0x4'));var router=express[_0xc739('0x5')]();var auth=require(_0xc739('0x6'));var interaction=require(_0xc739('0x7'));var config=require(_0xc739('0x8'));var controller=require('./license.controller');router[_0xc739('0x9')]('/',controller[_0xc739('0xa')]);router[_0xc739('0xb')]('/:id',auth[_0xc739('0xc')](),controller[_0xc739('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 54dbbe9..1379b35 100644 --- a/server/api/license/license.attributes.js +++ b/server/api/license/license.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['exports','STRING','INTEGER','sequelize'];(function(_0x143167,_0x26e488){var _0x8d5ebf=function(_0x1cffd4){while(--_0x1cffd4){_0x143167['push'](_0x143167['shift']());}};_0x8d5ebf(++_0x26e488);}(_0x5fab,0x177));var _0xb5fa=function(_0x35d568,_0x4d47ae){_0x35d568=_0x35d568-0x0;var _0x5dac84=_0x5fab[_0x35d568];return _0x5dac84;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xb5fa('0x2')]},'data2':{'type':Sequelize[_0xb5fa('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xb5fa('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1cb9=['STRING','INTEGER','sequelize','TEXT'];(function(_0x3fc143,_0x32b9ed){var _0x2c0380=function(_0x23e845){while(--_0x23e845){_0x3fc143['push'](_0x3fc143['shift']());}};_0x2c0380(++_0x32b9ed);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2c243f,_0xa4bdc2){_0x2c243f=_0x2c243f-0x0;var _0x32c5a6=_0x1cb9[_0x2c243f];return _0x32c5a6;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'license':{'type':Sequelize[_0x91cb('0x1')]},'data1':{'type':Sequelize[_0x91cb('0x2')]},'data2':{'type':Sequelize[_0x91cb('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x91cb('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 226f503..1a5e016 100644 --- a/server/api/license/license.controller.js +++ b/server/api/license/license.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce0a=['lodash','squel','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','set','Content-Range','apply','save','update','then','destroy','error','name','send','../../config/license/util','index','model','keys','rawAttributes','query','intersection','attributes','merge','options','body','License','find','get','checkLicense','key','catch','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xce0a,0x98));var _0xace0=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xce0a[_0x2be8c2];return _0x97f531;};'use strict';var pdf=require(_0xace0('0x0'));var emlformat=require(_0xace0('0x1'));var rimraf=require(_0xace0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xace0('0x3'));var BPromise=require(_0xace0('0x4'));var Mustache=require(_0xace0('0x5'));var util=require(_0xace0('0x6'));var path=require(_0xace0('0x7'));var sox=require(_0xace0('0x8'));var csv=require('to-csv');var ejs=require(_0xace0('0x9'));var fs=require('fs');var _=require(_0xace0('0xa'));var squel=require(_0xace0('0xb'));var crypto=require('crypto');var jsforce=require(_0xace0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xace0('0xd'));var querystring=require(_0xace0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xace0('0xf'));var qs=require(_0xace0('0x10'));var hardwareService=require(_0xace0('0x11'));var logger=require(_0xace0('0x12'))(_0xace0('0x13'));var utils=require(_0xace0('0x14'));var config=require(_0xace0('0x15'));var db=require(_0xace0('0x16'))['db'];function respondWithStatusCode(_0x2b73cc,_0x4d1c67){_0x4d1c67=_0x4d1c67||0xcc;return function(_0x35467d){if(_0x35467d){return _0x2b73cc[_0xace0('0x17')](_0x4d1c67);}return _0x2b73cc[_0xace0('0x18')](_0x4d1c67)[_0xace0('0x19')]();};}function respondWithResult(_0x9f3f73,_0x3e7d41){_0x3e7d41=_0x3e7d41||0xc8;return function(_0xaae402){if(_0xaae402){return _0x9f3f73[_0xace0('0x18')](_0x3e7d41)[_0xace0('0x1a')](_0xaae402);}};}function respondWithFilteredResult(_0x14c78a,_0x44c07a){return function(_0x4f5bb0){if(_0x4f5bb0){var _0x47d6e0=_0x4f5bb0['count'],_0x9ece47=_0x44c07a['offset'],_0x2d1d0e=_0x44c07a['offset']+_0x44c07a['limit'],_0x3af1be;if(_0x2d1d0e>=_0x47d6e0){_0x2d1d0e=_0x47d6e0;_0x3af1be=0xc8;}else{_0x3af1be=0xce;}_0x14c78a['status'](_0x3af1be);return _0x14c78a[_0xace0('0x1b')](_0xace0('0x1c'),_0x9ece47+'-'+_0x2d1d0e+'/'+_0x47d6e0)[_0xace0('0x1a')](_0x4f5bb0);}return null;};}function patchUpdates(_0xe49fc6){return function(_0x370d29){try{jsonpatch[_0xace0('0x1d')](_0x370d29,_0xe49fc6,!![]);}catch(_0x1e30dc){return BPromise['reject'](_0x1e30dc);}return _0x370d29[_0xace0('0x1e')]();};}function saveUpdates(_0x14d0f6,_0x2041cf){return function(_0x49f390){if(_0x49f390){return _0x49f390[_0xace0('0x1f')](_0x14d0f6)[_0xace0('0x20')](function(_0x22bdbb){return _0x22bdbb;});}return null;};}function removeEntity(_0x2dc211,_0x3bf72e){return function(_0xd0c348){if(_0xd0c348){return _0xd0c348[_0xace0('0x21')]()[_0xace0('0x20')](function(){_0x2dc211[_0xace0('0x18')](0xcc)[_0xace0('0x19')]();});}};}function handleEntityNotFound(_0x1e1d3b,_0x5b843c){return function(_0x46a246){if(!_0x46a246){_0x1e1d3b[_0xace0('0x17')](0x194);}return _0x46a246;};}function handleError(_0x108d59,_0x374bba){_0x374bba=_0x374bba||0x1f4;return function(_0x36ed77){logger[_0xace0('0x22')](_0x36ed77['stack']);if(_0x36ed77[_0xace0('0x23')]){delete _0x36ed77[_0xace0('0x23')];}_0x108d59[_0xace0('0x18')](_0x374bba)[_0xace0('0x24')](_0x36ed77);};}var utilLicense=require(_0xace0('0x25'));exports[_0xace0('0x26')]=function(_0x1a0ae1,_0x39186f){var _0x54bb62={'raw':!![],'where':{'id':0x1}},_0x5be34a={};_0x5be34a[_0xace0('0x27')]=_[_0xace0('0x28')](db['License'][_0xace0('0x29')]);_0x5be34a[_0xace0('0x2a')]=_[_0xace0('0x28')](_0x1a0ae1['query']);_0x5be34a['filters']=_[_0xace0('0x2b')](_0x5be34a[_0xace0('0x27')],_0x5be34a[_0xace0('0x2a')]);_0x54bb62[_0xace0('0x2c')]=_[_0xace0('0x2b')](_0x5be34a[_0xace0('0x27')],qs['fields'](_0x1a0ae1[_0xace0('0x2a')]['fields']));_0x54bb62[_0xace0('0x2c')]=_0x54bb62[_0xace0('0x2c')]['length']?_0x54bb62['attributes']:_0x5be34a[_0xace0('0x27')];_0x54bb62=_[_0xace0('0x2d')]({},_0x54bb62,_0x1a0ae1[_0xace0('0x2e')]);return utilLicense['getLicense'](_0x54bb62)[_0xace0('0x20')](respondWithResult(_0x39186f,null))['catch'](handleError(_0x39186f,null));};exports['update']=function(_0x427a10,_0x5b5ea4){if(_0x427a10[_0xace0('0x2f')]['id']){delete _0x427a10['body']['id'];}return db[_0xace0('0x30')][_0xace0('0x31')]({'where':{'id':_0x427a10['params']['id']}})['then'](handleEntityNotFound(_0x5b5ea4,null))[_0xace0('0x20')](function(_0x382658){var _0x549539=_0x382658[_0xace0('0x32')]({'plain':!![]});return utilLicense[_0xace0('0x33')](_0x549539,_0x427a10[_0xace0('0x2f')][_0xace0('0x34')]);})['then'](function(_0x47b018){if(!_0x47b018['demo']){return saveUpdates(_0x427a10[_0xace0('0x2f')],null);}return _0x47b018;})[_0xace0('0x20')](respondWithResult(_0x5b5ea4,null))[_0xace0('0x35')](handleError(_0x5b5ea4,null));}; \ No newline at end of file +var _0x567c=['find','get','key','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','../../config/license/util','index','model','keys','License','rawAttributes','query','intersection','attributes','fields','merge','options','catch','body'];(function(_0x36e918,_0x1f5a3d){var _0x1db4fc=function(_0x27d73c){while(--_0x27d73c){_0x36e918['push'](_0x36e918['shift']());}};_0x1db4fc(++_0x1f5a3d);}(_0x567c,0x15f));var _0xc567=function(_0x513d34,_0x5e0efc){_0x513d34=_0x513d34-0x0;var _0x5816dd=_0x567c[_0x513d34];return _0x5816dd;};'use strict';var pdf=require(_0xc567('0x0'));var emlformat=require(_0xc567('0x1'));var rimraf=require(_0xc567('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc567('0x3'));var rp=require(_0xc567('0x4'));var moment=require('moment');var BPromise=require(_0xc567('0x5'));var Mustache=require(_0xc567('0x6'));var util=require(_0xc567('0x7'));var path=require(_0xc567('0x8'));var sox=require('sox');var csv=require(_0xc567('0x9'));var ejs=require(_0xc567('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc567('0xb'));var crypto=require(_0xc567('0xc'));var jsforce=require(_0xc567('0xd'));var deskjs=require(_0xc567('0xe'));var toCsv=require(_0xc567('0x9'));var querystring=require(_0xc567('0xf'));var Papa=require(_0xc567('0x10'));var Redis=require(_0xc567('0x11'));var authService=require(_0xc567('0x12'));var qs=require(_0xc567('0x13'));var hardwareService=require(_0xc567('0x14'));var logger=require(_0xc567('0x15'))(_0xc567('0x16'));var utils=require(_0xc567('0x17'));var config=require(_0xc567('0x18'));var db=require(_0xc567('0x19'))['db'];function respondWithStatusCode(_0x352b77,_0x41237e){_0x41237e=_0x41237e||0xcc;return function(_0x315329){if(_0x315329){return _0x352b77[_0xc567('0x1a')](_0x41237e);}return _0x352b77[_0xc567('0x1b')](_0x41237e)[_0xc567('0x1c')]();};}function respondWithResult(_0x18cd4a,_0x1a9deb){_0x1a9deb=_0x1a9deb||0xc8;return function(_0x1b3f2b){if(_0x1b3f2b){return _0x18cd4a['status'](_0x1a9deb)[_0xc567('0x1d')](_0x1b3f2b);}};}function respondWithFilteredResult(_0x4b6f3e,_0xef2a86){return function(_0xa4dec6){if(_0xa4dec6){var _0x319774=_0xa4dec6[_0xc567('0x1e')],_0x314712=_0xef2a86[_0xc567('0x1f')],_0x3a5688=_0xef2a86['offset']+_0xef2a86['limit'],_0x5eaf62;if(_0x3a5688>=_0x319774){_0x3a5688=_0x319774;_0x5eaf62=0xc8;}else{_0x5eaf62=0xce;}_0x4b6f3e[_0xc567('0x1b')](_0x5eaf62);return _0x4b6f3e[_0xc567('0x20')](_0xc567('0x21'),_0x314712+'-'+_0x3a5688+'/'+_0x319774)[_0xc567('0x1d')](_0xa4dec6);}return null;};}function patchUpdates(_0x15fc37){return function(_0x79a37f){try{jsonpatch[_0xc567('0x22')](_0x79a37f,_0x15fc37,!![]);}catch(_0x299742){return BPromise['reject'](_0x299742);}return _0x79a37f[_0xc567('0x23')]();};}function saveUpdates(_0x5f4e9d,_0x501256){return function(_0x46c0e6){if(_0x46c0e6){return _0x46c0e6[_0xc567('0x24')](_0x5f4e9d)[_0xc567('0x25')](function(_0x5188b6){return _0x5188b6;});}return null;};}function removeEntity(_0x20c3d2,_0x52cbee){return function(_0x55d5a1){if(_0x55d5a1){return _0x55d5a1['destroy']()[_0xc567('0x25')](function(){_0x20c3d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a6a20,_0x2b0c14){return function(_0x59448e){if(!_0x59448e){_0x6a6a20[_0xc567('0x1a')](0x194);}return _0x59448e;};}function handleError(_0x23e6da,_0xb65630){_0xb65630=_0xb65630||0x1f4;return function(_0x203548){logger[_0xc567('0x26')](_0x203548[_0xc567('0x27')]);if(_0x203548['name']){delete _0x203548[_0xc567('0x28')];}_0x23e6da[_0xc567('0x1b')](_0xb65630)['send'](_0x203548);};}var utilLicense=require(_0xc567('0x29'));exports[_0xc567('0x2a')]=function(_0x33c805,_0x4932b1){var _0x1ef6f1={'raw':!![],'where':{'id':0x1}},_0x335d12={};_0x335d12[_0xc567('0x2b')]=_[_0xc567('0x2c')](db[_0xc567('0x2d')][_0xc567('0x2e')]);_0x335d12[_0xc567('0x2f')]=_[_0xc567('0x2c')](_0x33c805[_0xc567('0x2f')]);_0x335d12['filters']=_[_0xc567('0x30')](_0x335d12[_0xc567('0x2b')],_0x335d12[_0xc567('0x2f')]);_0x1ef6f1[_0xc567('0x31')]=_['intersection'](_0x335d12[_0xc567('0x2b')],qs[_0xc567('0x32')](_0x33c805['query'][_0xc567('0x32')]));_0x1ef6f1[_0xc567('0x31')]=_0x1ef6f1[_0xc567('0x31')]['length']?_0x1ef6f1[_0xc567('0x31')]:_0x335d12[_0xc567('0x2b')];_0x1ef6f1=_[_0xc567('0x33')]({},_0x1ef6f1,_0x33c805[_0xc567('0x34')]);return utilLicense['getLicense'](_0x1ef6f1)['then'](respondWithResult(_0x4932b1,null))[_0xc567('0x35')](handleError(_0x4932b1,null));};exports[_0xc567('0x24')]=function(_0x1c71be,_0x47c53e){if(_0x1c71be[_0xc567('0x36')]['id']){delete _0x1c71be[_0xc567('0x36')]['id'];}return db['License'][_0xc567('0x37')]({'where':{'id':_0x1c71be['params']['id']}})[_0xc567('0x25')](handleEntityNotFound(_0x47c53e,null))['then'](function(_0x5991bb){var _0x13f467=_0x5991bb[_0xc567('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0x13f467,_0x1c71be['body'][_0xc567('0x39')]);})[_0xc567('0x25')](function(_0x553534){if(!_0x553534['demo']){return saveUpdates(_0x1c71be[_0xc567('0x36')],null);}return _0x553534;})['then'](respondWithResult(_0x47c53e,null))[_0xc567('0x35')](handleError(_0x47c53e,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 2117b35..0df41c2 100644 --- a/server/api/license/license.model.js +++ b/server/api/license/license.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1921=['api','bluebird','request-promise','path','define','License','lodash','util','../../config/logger'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0x1921,0xb1));var _0x1192=function(_0x3a329e,_0x3291dc){_0x3a329e=_0x3a329e-0x0;var _0x5a334d=_0x1921[_0x3a329e];return _0x5a334d;};'use strict';var _=require(_0x1192('0x0'));var util=require(_0x1192('0x1'));var logger=require(_0x1192('0x2'))(_0x1192('0x3'));var moment=require('moment');var BPromise=require(_0x1192('0x4'));var rp=require(_0x1192('0x5'));var fs=require('fs');var path=require(_0x1192('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./license.attributes');module['exports']=function(_0x24b46d,_0x2c12ea){return _0x24b46d[_0x1192('0x7')](_0x1192('0x8'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa169=['moment','bluebird','../../config/environment','./license.attributes','define','License','license','lodash','util'];(function(_0x1f3597,_0x1a44e7){var _0x420f83=function(_0x1ef56e){while(--_0x1ef56e){_0x1f3597['push'](_0x1f3597['shift']());}};_0x420f83(++_0x1a44e7);}(_0xa169,0x1ed));var _0x9a16=function(_0x354c87,_0x31f7c2){_0x354c87=_0x354c87-0x0;var _0x399e79=_0xa169[_0x354c87];return _0x399e79;};'use strict';var _=require(_0x9a16('0x0'));var util=require(_0x9a16('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9a16('0x2'));var BPromise=require(_0x9a16('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9a16('0x4'));var attributes=require(_0x9a16('0x5'));module['exports']=function(_0x3c775f,_0x515526){return _0x3c775f[_0x9a16('0x6')](_0x9a16('0x7'),attributes,{'tableName':_0x9a16('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 590ef5b..83a687a 100644 --- a/server/api/license/license.rpc.js +++ b/server/api/license/license.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94d2=['request\x20sent','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5d49ad,_0x4ea9be){var _0x2e080d=function(_0x29fbc4){while(--_0x29fbc4){_0x5d49ad['push'](_0x5d49ad['shift']());}};_0x2e080d(++_0x4ea9be);}(_0x94d2,0x1cd));var _0x294d=function(_0x3b4b1d,_0x15029e){_0x3b4b1d=_0x3b4b1d-0x0;var _0x488c36=_0x94d2[_0x3b4b1d];return _0x488c36;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x294d('0x0'));var BPromise=require(_0x294d('0x1'));var rs=require(_0x294d('0x2'));var fs=require('fs');var Redis=require(_0x294d('0x3'));var db=require(_0x294d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x294d('0x5'));var config=require(_0x294d('0x6'));var jayson=require(_0x294d('0x7'));var client=jayson[_0x294d('0x8')][_0x294d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e023f,_0x5c3d7c,_0x2cf111){return new BPromise(function(_0x6653fc,_0x1cd249){return client[_0x294d('0xa')](_0x5e023f,_0x2cf111)[_0x294d('0xb')](function(_0x49923f){logger[_0x294d('0xc')](_0x294d('0xd'),_0x5c3d7c,'request\x20sent');logger[_0x294d('0xe')](_0x294d('0xf'),_0x5c3d7c,'request\x20sent',JSON['stringify'](_0x49923f));if(_0x49923f[_0x294d('0x10')]){if(_0x49923f[_0x294d('0x10')][_0x294d('0x11')]===0x1f4){logger['error'](_0x294d('0xd'),_0x5c3d7c,_0x49923f[_0x294d('0x10')][_0x294d('0x12')]);return _0x1cd249(_0x49923f[_0x294d('0x10')]['message']);}logger[_0x294d('0x10')]('License,\x20%s,\x20%s',_0x5c3d7c,_0x49923f['error'][_0x294d('0x12')]);return _0x6653fc(_0x49923f[_0x294d('0x10')][_0x294d('0x12')]);}else{logger[_0x294d('0xc')]('License,\x20%s,\x20%s',_0x5c3d7c,_0x294d('0x13'));_0x6653fc(_0x49923f['result']['message']);}})['catch'](function(_0x4f2436){logger[_0x294d('0x10')](_0x294d('0xd'),_0x5c3d7c,_0x4f2436);_0x1cd249(_0x4f2436);});});} \ No newline at end of file +var _0xd957=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x33643f,_0x5b32af){var _0x30a486=function(_0x4fd4d5){while(--_0x4fd4d5){_0x33643f['push'](_0x33643f['shift']());}};_0x30a486(++_0x5b32af);}(_0xd957,0x153));var _0x7d95=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd957[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7d95('0x0'));var util=require(_0x7d95('0x1'));var moment=require('moment');var BPromise=require(_0x7d95('0x2'));var rs=require(_0x7d95('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d95('0x4'))['db'];var utils=require(_0x7d95('0x5'));var logger=require(_0x7d95('0x6'))(_0x7d95('0x7'));var config=require(_0x7d95('0x8'));var jayson=require(_0x7d95('0x9'));var client=jayson[_0x7d95('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x181ca5,_0x11bb29,_0x4f10ec){return new BPromise(function(_0xfd14f6,_0x399d23){return client[_0x7d95('0xb')](_0x181ca5,_0x4f10ec)[_0x7d95('0xc')](function(_0x173838){logger['info'](_0x7d95('0xd'),_0x11bb29,_0x7d95('0xe'));logger[_0x7d95('0xf')](_0x7d95('0x10'),_0x11bb29,_0x7d95('0xe'),JSON['stringify'](_0x173838));if(_0x173838['error']){if(_0x173838[_0x7d95('0x11')][_0x7d95('0x12')]===0x1f4){logger['error'](_0x7d95('0xd'),_0x11bb29,_0x173838[_0x7d95('0x11')][_0x7d95('0x13')]);return _0x399d23(_0x173838[_0x7d95('0x11')][_0x7d95('0x13')]);}logger[_0x7d95('0x11')]('License,\x20%s,\x20%s',_0x11bb29,_0x173838[_0x7d95('0x11')]['message']);return _0xfd14f6(_0x173838[_0x7d95('0x11')]['message']);}else{logger[_0x7d95('0x14')]('License,\x20%s,\x20%s',_0x11bb29,_0x7d95('0xe'));_0xfd14f6(_0x173838[_0x7d95('0x15')][_0x7d95('0x13')]);}})[_0x7d95('0x16')](function(_0x5ab72e){logger['error'](_0x7d95('0xd'),_0x11bb29,_0x5ab72e);_0x399d23(_0x5ab72e);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index d8bc98d..93c880f 100644 --- a/server/api/mailAccount/index.js +++ b/server/api/mailAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61a3=['destroy','/:id/users','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getImap','/:id/interactions','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','create','/:id/in_servers','addImap','addSmtp','addInteraction','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','/:id/out_servers','removeSmtp'];(function(_0x3b15b6,_0x45dd78){var _0x1d16eb=function(_0xc7e874){while(--_0xc7e874){_0x3b15b6['push'](_0x3b15b6['shift']());}};_0x1d16eb(++_0x45dd78);}(_0x61a3,0x8a));var _0x361a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x61a3[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x361a('0x0'));var util=require(_0x361a('0x1'));var path=require(_0x361a('0x2'));var timeout=require(_0x361a('0x3'));var express=require(_0x361a('0x4'));var router=express[_0x361a('0x5')]();var auth=require(_0x361a('0x6'));var interaction=require(_0x361a('0x7'));var config=require(_0x361a('0x8'));var controller=require(_0x361a('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x361a('0xa')]);router['get'](_0x361a('0xb'),auth[_0x361a('0xc')](),controller[_0x361a('0xd')]);router[_0x361a('0xe')](_0x361a('0xf'),auth[_0x361a('0xc')](),controller[_0x361a('0x10')]);router[_0x361a('0xe')](_0x361a('0x11'),auth[_0x361a('0xc')](),controller[_0x361a('0x12')]);router['get'](_0x361a('0x13'),auth[_0x361a('0xc')](),controller['getAnswers']);router[_0x361a('0xe')]('/:id/in_servers',auth[_0x361a('0xc')](),controller[_0x361a('0x14')]);router[_0x361a('0xe')]('/:id/out_servers',auth['isAuthenticated'](),controller['getSmtp']);router[_0x361a('0xe')](_0x361a('0x15'),auth[_0x361a('0xc')](),controller['getInteractions']);router[_0x361a('0xe')]('/:id/applications',auth[_0x361a('0xc')](),controller['getApplications']);router[_0x361a('0xe')](_0x361a('0x16'),auth['isAuthenticated'](),controller[_0x361a('0x17')]);router[_0x361a('0xe')](_0x361a('0x18'),auth[_0x361a('0xc')](),controller[_0x361a('0x19')]);router[_0x361a('0xe')]('/:id/users',auth['isAuthenticated'](),controller[_0x361a('0x1a')]);router[_0x361a('0x1b')](_0x361a('0x11'),auth[_0x361a('0xc')](),controller[_0x361a('0x1c')]);router[_0x361a('0x1b')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0x361a('0x1b')]('/',auth[_0x361a('0xc')](),controller[_0x361a('0x1d')]);router['post'](_0x361a('0x1e'),auth[_0x361a('0xc')](),controller[_0x361a('0x1f')]);router[_0x361a('0x1b')]('/:id/out_servers',auth[_0x361a('0xc')](),controller[_0x361a('0x20')]);router[_0x361a('0x1b')](_0x361a('0x15'),auth['isAuthenticated'](),controller[_0x361a('0x21')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0x361a('0x1b')]('/:id/send',auth[_0x361a('0xc')](),controller['send']);router[_0x361a('0x1b')]('/:id/users',auth[_0x361a('0xc')](),controller[_0x361a('0x22')]);router[_0x361a('0x23')]('/:id',auth[_0x361a('0xc')](),controller['update']);router[_0x361a('0x24')](_0x361a('0x11'),auth[_0x361a('0xc')](),controller[_0x361a('0x25')]);router[_0x361a('0x24')](_0x361a('0x13'),auth[_0x361a('0xc')](),controller[_0x361a('0x26')]);router[_0x361a('0x24')](_0x361a('0x1e'),auth[_0x361a('0xc')](),controller[_0x361a('0x27')]);router[_0x361a('0x24')](_0x361a('0x28'),auth['isAuthenticated'](),controller[_0x361a('0x29')]);router[_0x361a('0x24')](_0x361a('0xf'),auth['isAuthenticated'](),controller[_0x361a('0x2a')]);router[_0x361a('0x24')](_0x361a('0x2b'),auth[_0x361a('0xc')](),controller[_0x361a('0x2c')]);module['exports']=router; \ No newline at end of file +var _0x3368=['/:id/verify','verifySmtp','/:id/users','getAgents','/:id/dispositions','post','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','addAgents','update','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','getMessages'];(function(_0x6eb02d,_0x20bdf5){var _0xb756de=function(_0x18fef2){while(--_0x18fef2){_0x6eb02d['push'](_0x6eb02d['shift']());}};_0xb756de(++_0x20bdf5);}(_0x3368,0x76));var _0x8336=function(_0xdf845c,_0x4e30e3){_0xdf845c=_0xdf845c-0x0;var _0x3c3fc0=_0x3368[_0xdf845c];return _0x3c3fc0;};'use strict';var multer=require('multer');var util=require(_0x8336('0x0'));var path=require(_0x8336('0x1'));var timeout=require(_0x8336('0x2'));var express=require(_0x8336('0x3'));var router=express[_0x8336('0x4')]();var auth=require(_0x8336('0x5'));var interaction=require(_0x8336('0x6'));var config=require(_0x8336('0x7'));var controller=require(_0x8336('0x8'));router[_0x8336('0x9')]('/',auth[_0x8336('0xa')](),controller[_0x8336('0xb')]);router[_0x8336('0x9')](_0x8336('0xc'),auth[_0x8336('0xa')](),controller[_0x8336('0xd')]);router[_0x8336('0x9')](_0x8336('0xe'),auth[_0x8336('0xa')](),controller['show']);router[_0x8336('0x9')]('/:id/dispositions',auth[_0x8336('0xa')](),controller[_0x8336('0xf')]);router[_0x8336('0x9')](_0x8336('0x10'),auth[_0x8336('0xa')](),controller[_0x8336('0x11')]);router['get'](_0x8336('0x12'),auth['isAuthenticated'](),controller[_0x8336('0x13')]);router['get'](_0x8336('0x14'),auth[_0x8336('0xa')](),controller[_0x8336('0x15')]);router['get'](_0x8336('0x16'),auth['isAuthenticated'](),controller[_0x8336('0x17')]);router[_0x8336('0x9')]('/:id/applications',auth[_0x8336('0xa')](),controller[_0x8336('0x18')]);router[_0x8336('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x8336('0x19')]);router[_0x8336('0x9')](_0x8336('0x1a'),auth[_0x8336('0xa')](),controller[_0x8336('0x1b')]);router[_0x8336('0x9')](_0x8336('0x1c'),auth[_0x8336('0xa')](),controller[_0x8336('0x1d')]);router['post'](_0x8336('0x1e'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x8336('0x1f')]('/:id/canned_answers',auth[_0x8336('0xa')](),controller[_0x8336('0x20')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8336('0x21')]);router[_0x8336('0x1f')](_0x8336('0x12'),auth[_0x8336('0xa')](),controller[_0x8336('0x22')]);router[_0x8336('0x1f')]('/:id/out_servers',auth[_0x8336('0xa')](),controller[_0x8336('0x23')]);router[_0x8336('0x1f')](_0x8336('0x16'),auth[_0x8336('0xa')](),controller[_0x8336('0x24')]);router[_0x8336('0x1f')]('/:id/applications',auth['isAuthenticated'](),controller[_0x8336('0x25')]);router[_0x8336('0x1f')](_0x8336('0x26'),auth[_0x8336('0xa')](),controller['send']);router[_0x8336('0x1f')]('/:id/users',auth[_0x8336('0xa')](),controller[_0x8336('0x27')]);router['put'](_0x8336('0xe'),auth['isAuthenticated'](),controller[_0x8336('0x28')]);router[_0x8336('0x29')]('/:id/dispositions',auth[_0x8336('0xa')](),controller[_0x8336('0x2a')]);router[_0x8336('0x29')](_0x8336('0x10'),auth[_0x8336('0xa')](),controller[_0x8336('0x2b')]);router['delete'](_0x8336('0x12'),auth[_0x8336('0xa')](),controller['removeImap']);router[_0x8336('0x29')](_0x8336('0x14'),auth[_0x8336('0xa')](),controller[_0x8336('0x2c')]);router[_0x8336('0x29')](_0x8336('0xe'),auth['isAuthenticated'](),controller[_0x8336('0x2d')]);router[_0x8336('0x29')](_0x8336('0x1c'),auth['isAuthenticated'](),controller[_0x8336('0x2e')]);module[_0x8336('0x2f')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 11da71e..f6a6761 100644 --- a/server/api/mailAccount/mailAccount.attributes.js +++ b/server/api/mailAccount/mailAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5aa1=['TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','BOOLEAN'];(function(_0x37fdf6,_0x582f86){var _0x544cc8=function(_0x29d8ac){while(--_0x29d8ac){_0x37fdf6['push'](_0x37fdf6['shift']());}};_0x544cc8(++_0x582f86);}(_0x5aa1,0x99));var _0x15aa=function(_0x26edbd,_0x5ba29d){_0x26edbd=_0x26edbd-0x0;var _0x4178ad=_0x5aa1[_0x26edbd];return _0x4178ad;};'use strict';var Sequelize=require(_0x15aa('0x0'));module['exports']={'description':{'type':Sequelize[_0x15aa('0x1')]},'name':{'type':Sequelize[_0x15aa('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x15aa('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x15aa('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x15aa('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x15aa('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x15aa('0x3')]},'markAsUnread':{'type':Sequelize[_0x15aa('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x15aa('0x4')},'fontSize':{'type':Sequelize[_0x15aa('0x5')](0x2)[_0x15aa('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x15aa('0x3')],'defaultValue':function(){return _0x15aa('0x7');}},'notificationSound':{'type':Sequelize[_0x15aa('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x15aa('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x15aa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x15aa('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x15aa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x15aa('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x15aa('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x15aa('0x2')],'defaultValue':![],'comment':_0x15aa('0x9'),'set':function(_0x7c259f){if(!_0x7c259f)this[_0x15aa('0xa')](_0x15aa('0xb'),null);this[_0x15aa('0xa')](_0x15aa('0xc'),_0x7c259f);}}}; \ No newline at end of file +var _0xc65d=['STRING','BOOLEAN','TEXT','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','exports'];(function(_0x2b4451,_0x1725b1){var _0x4751a6=function(_0x2be311){while(--_0x2be311){_0x2b4451['push'](_0x2b4451['shift']());}};_0x4751a6(++_0x1725b1);}(_0xc65d,0x95));var _0xdc65=function(_0x469f86,_0x376c14){_0x469f86=_0x469f86-0x0;var _0x437829=_0xc65d[_0x469f86];return _0x437829;};'use strict';var Sequelize=require('sequelize');module[_0xdc65('0x0')]={'description':{'type':Sequelize[_0xdc65('0x1')]},'name':{'type':Sequelize[_0xdc65('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xdc65('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xdc65('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xdc65('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xdc65('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xdc65('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xdc65('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xdc65('0x3')],'defaultValue':function(){return _0xdc65('0x5');}},'notificationSound':{'type':Sequelize[_0xdc65('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdc65('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdc65('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdc65('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdc65('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdc65('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdc65('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdc65('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xdc65('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xdc65('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x229a68){if(!_0x229a68)this[_0xdc65('0x8')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xdc65('0x9'),_0x229a68);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 2013081..a0154cf 100644 --- a/server/api/mailAccount/mailAccount.controller.js +++ b/server/api/mailAccount/mailAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['password','pass','cpassword','authentication','port','host','service','cuser','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','from','format','email','attachments','join','server/files/attachments','auth','secure','SendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','apply','update','destroy','get','UserProfileResource','stack','name','send','MailServerIn','MailServerOut','Smtp','MailAccount','model','keys','query','filters','intersection','attributes','fields','length','limit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','include','findAll','rows','params','Imap','Pause','mandatoryDispositionPause','rawAttributes','includeAll','find','body','catch','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','nolimit','options','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','hasOwnProperty','removeAnswers','ListId','isNil','active','description','cservice','cauthentication','user'];(function(_0x248c42,_0x1d02de){var _0x4a343c=function(_0x4fc8e2){while(--_0x4fc8e2){_0x248c42['push'](_0x248c42['shift']());}};_0x4a343c(++_0x1d02de);}(_0x7a54,0x106));var _0x47a5=function(_0x344ac4,_0x17db6b){_0x344ac4=_0x344ac4-0x0;var _0x2b60e2=_0x7a54[_0x344ac4];return _0x2b60e2;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];config[_0x47a5('0x14')]=_[_0x47a5('0x15')](config[_0x47a5('0x14')],{'host':_0x47a5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x14')]));require(_0x47a5('0x17'))[_0x47a5('0x18')](socket);var jayson=require(_0x47a5('0x19'));var client=jayson[_0x47a5('0x1a')][_0x47a5('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x3c6c46,_0x190faa,_0x4e99a8){if(_0x4e99a8){var _0x362359=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x362359[_0x47a5('0x1c')](_0x190faa)){return _0x3c6c46;}else{throw new Error(_0x47a5('0x1d'));}}else{return _0x3c6c46;}}function respondWithRpcPromise(_0x2a2cbb,_0x1ef44c,_0x574af6,_0x549de3){return new BPromise(function(_0x138bc0,_0x4b966e){var _0x5247fd=_0x549de3||client;return _0x5247fd[_0x47a5('0x1e')](_0x2a2cbb,_0x574af6)[_0x47a5('0x1f')](function(_0x2ce454){logger[_0x47a5('0x20')](_0x47a5('0x21'),_0x1ef44c,_0x47a5('0x22'));logger[_0x47a5('0x23')](_0x47a5('0x24'),_0x1ef44c,_0x47a5('0x22'),JSON['stringify'](_0x2ce454));if(_0x2ce454[_0x47a5('0x25')]){if(_0x2ce454[_0x47a5('0x25')]['code']===0x1f4){logger[_0x47a5('0x25')](_0x47a5('0x21'),_0x1ef44c,_0x2ce454[_0x47a5('0x25')]['message']);return _0x4b966e(_0x2ce454[_0x47a5('0x25')][_0x47a5('0x26')]);}logger[_0x47a5('0x25')](_0x47a5('0x21'),_0x1ef44c,_0x2ce454['error'][_0x47a5('0x26')]);return _0x138bc0(_0x2ce454[_0x47a5('0x25')]['message']);}else{logger[_0x47a5('0x20')](_0x47a5('0x21'),_0x1ef44c,_0x47a5('0x22'));_0x138bc0(_0x2ce454[_0x47a5('0x27')][_0x47a5('0x26')]);}})['catch'](function(_0x53078a){logger[_0x47a5('0x25')]('MailAccount,\x20%s,\x20%s',_0x1ef44c,_0x53078a);_0x4b966e(_0x53078a);});});}function respondWithStatusCode(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0xcc;return function(_0x23cb77){if(_0x23cb77){return _0x1ea9c8[_0x47a5('0x28')](_0x5b6c4e);}return _0x1ea9c8[_0x47a5('0x29')](_0x5b6c4e)[_0x47a5('0x2a')]();};}function respondWithResult(_0x21f296,_0x3ba0b7){_0x3ba0b7=_0x3ba0b7||0xc8;return function(_0x24b162){if(_0x24b162){return _0x21f296[_0x47a5('0x29')](_0x3ba0b7)[_0x47a5('0x2b')](_0x24b162);}};}function respondWithFilteredResult(_0x361bfa,_0x1127f8){return function(_0x11a4fa){if(_0x11a4fa){var _0x3ad507=_0x11a4fa[_0x47a5('0x2c')],_0x528582=_0x1127f8[_0x47a5('0x2d')],_0x243210=_0x1127f8[_0x47a5('0x2d')]+_0x1127f8['limit'],_0x51833b;if(_0x243210>=_0x3ad507){_0x243210=_0x3ad507;_0x51833b=0xc8;}else{_0x51833b=0xce;}_0x361bfa[_0x47a5('0x29')](_0x51833b);return _0x361bfa[_0x47a5('0x2e')](_0x47a5('0x2f'),_0x528582+'-'+_0x243210+'/'+_0x3ad507)[_0x47a5('0x2b')](_0x11a4fa);}return null;};}function patchUpdates(_0x51cc81){return function(_0x50d875){try{jsonpatch[_0x47a5('0x30')](_0x50d875,_0x51cc81,!![]);}catch(_0xfb5ddb){return BPromise['reject'](_0xfb5ddb);}return _0x50d875['save']();};}function saveUpdates(_0x836303,_0x51544e){return function(_0x57bff6){if(_0x57bff6){return _0x57bff6[_0x47a5('0x31')](_0x836303)['then'](function(_0x122ed6){return _0x122ed6;});}return null;};}function removeEntity(_0xd972c,_0x5c5162){return function(_0x4843c0){if(_0x4843c0){return _0x4843c0[_0x47a5('0x32')]()['then'](function(){var _0x403028=_0x4843c0[_0x47a5('0x33')]({'plain':!![]});var _0xf269a8='MailAccounts';return db[_0x47a5('0x34')]['destroy']({'where':{'type':_0xf269a8,'resourceId':_0x403028['id']}})['then'](function(){return _0x4843c0;});})[_0x47a5('0x1f')](function(){_0xd972c['status'](0xcc)[_0x47a5('0x2a')]();});}};}function handleEntityNotFound(_0x5ef577,_0x21ad34){return function(_0x3534cb){if(!_0x3534cb){_0x5ef577[_0x47a5('0x28')](0x194);}return _0x3534cb;};}function handleError(_0x199698,_0x36add5){_0x36add5=_0x36add5||0x1f4;return function(_0xed6320){logger[_0x47a5('0x25')](_0xed6320[_0x47a5('0x35')]);if(_0xed6320[_0x47a5('0x36')]){delete _0xed6320['name'];}_0x199698[_0x47a5('0x29')](_0x36add5)[_0x47a5('0x37')](_0xed6320);};}exports['index']=function(_0x2c50d6,_0x2bf53d){var _0x1d4348={'include':[{'model':db[_0x47a5('0x38')],'as':'Imap'},{'model':db[_0x47a5('0x39')],'as':_0x47a5('0x3a')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x49c4b5={},_0x101f70={'count':0x0,'rows':[]};var _0x5ebd8c=db[_0x47a5('0x3b')]['rawAttributes'];_0x49c4b5[_0x47a5('0x3c')]=_[_0x47a5('0x3d')](_0x5ebd8c);_0x49c4b5[_0x47a5('0x3e')]=_[_0x47a5('0x3d')](_0x2c50d6[_0x47a5('0x3e')]);_0x49c4b5[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x49c4b5[_0x47a5('0x3c')],_0x49c4b5[_0x47a5('0x3e')]);_0x1d4348[_0x47a5('0x41')]=_[_0x47a5('0x40')](_0x49c4b5[_0x47a5('0x3c')],qs[_0x47a5('0x42')](_0x2c50d6['query'][_0x47a5('0x42')]));_0x1d4348[_0x47a5('0x41')]=_0x1d4348[_0x47a5('0x41')][_0x47a5('0x43')]?_0x1d4348['attributes']:_0x49c4b5[_0x47a5('0x3c')];if(!_0x2c50d6['query']['hasOwnProperty']('nolimit')){_0x1d4348['limit']=qs[_0x47a5('0x44')](_0x2c50d6['query'][_0x47a5('0x44')]);_0x1d4348[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x2c50d6['query'][_0x47a5('0x2d')]);}_0x1d4348[_0x47a5('0x45')]=qs['sort'](_0x2c50d6['query'][_0x47a5('0x46')]);_0x1d4348['where']=qs[_0x47a5('0x3f')](_[_0x47a5('0x47')](_0x2c50d6[_0x47a5('0x3e')],_0x49c4b5[_0x47a5('0x3f')]));if(_0x2c50d6[_0x47a5('0x3e')][_0x47a5('0x48')]){_0x1d4348[_0x47a5('0x49')]=_[_0x47a5('0x4a')](_0x1d4348[_0x47a5('0x49')],{'$or':_[_0x47a5('0x4b')](_0x5ebd8c,function(_0x24ecb1){if(_0x24ecb1[_0x47a5('0x4c')][_0x47a5('0x4d')]!==_0x47a5('0x4e')){var _0x4e5e7={};_0x4e5e7[_0x24ecb1[_0x47a5('0x4f')]]={'$like':'%'+_0x2c50d6['query'][_0x47a5('0x48')]+'%'};return _0x4e5e7;}})});}_0x1d4348=_[_0x47a5('0x4a')]({},_0x1d4348,_0x2c50d6['options']);var _0x52b3a8={'where':_0x1d4348[_0x47a5('0x49')]};return db['MailAccount'][_0x47a5('0x2c')](_0x52b3a8)[_0x47a5('0x1f')](function(_0x54c35f){_0x101f70['count']=_0x54c35f;if(_0x2c50d6[_0x47a5('0x3e')]['includeAll']){_0x1d4348[_0x47a5('0x50')]=[{'all':!![]}];}return db[_0x47a5('0x3b')][_0x47a5('0x51')](_0x1d4348);})[_0x47a5('0x1f')](function(_0x44fe8a){_0x101f70[_0x47a5('0x52')]=_0x44fe8a;return _0x101f70;})[_0x47a5('0x1f')](respondWithFilteredResult(_0x2bf53d,_0x1d4348))['catch'](handleError(_0x2bf53d,null));};exports['show']=function(_0x2dd1db,_0x411230){var _0x1163e3={'raw':![],'where':{'id':_0x2dd1db[_0x47a5('0x53')]['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x54')},{'model':db['MailServerOut'],'as':_0x47a5('0x3a')},{'model':db[_0x47a5('0x55')],'as':_0x47a5('0x56')}]},_0x9ea93e={};_0x9ea93e['model']=_[_0x47a5('0x3d')](db['MailAccount'][_0x47a5('0x57')]);_0x9ea93e[_0x47a5('0x3e')]=_[_0x47a5('0x3d')](_0x2dd1db[_0x47a5('0x3e')]);_0x9ea93e['filters']=_[_0x47a5('0x40')](_0x9ea93e[_0x47a5('0x3c')],_0x9ea93e[_0x47a5('0x3e')]);_0x1163e3[_0x47a5('0x41')]=_[_0x47a5('0x40')](_0x9ea93e[_0x47a5('0x3c')],qs[_0x47a5('0x42')](_0x2dd1db['query'][_0x47a5('0x42')]));_0x1163e3[_0x47a5('0x41')]=_0x1163e3[_0x47a5('0x41')][_0x47a5('0x43')]?_0x1163e3[_0x47a5('0x41')]:_0x9ea93e[_0x47a5('0x3c')];if(_0x2dd1db['query'][_0x47a5('0x58')]){_0x1163e3[_0x47a5('0x50')]=[{'all':!![]}];}_0x1163e3=_[_0x47a5('0x4a')]({},_0x1163e3,_0x2dd1db['options']);return db[_0x47a5('0x3b')][_0x47a5('0x59')](_0x1163e3)[_0x47a5('0x1f')](handleEntityNotFound(_0x411230,null))['then'](respondWithResult(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x31')]=function(_0x376e1d,_0x4fa1da){if(_0x376e1d['body']['id']){delete _0x376e1d[_0x47a5('0x5a')]['id'];}return db['MailAccount'][_0x47a5('0x59')]({'where':{'id':_0x376e1d['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x47a5('0x54')},{'model':db[_0x47a5('0x39')],'as':'Smtp'},{'model':db[_0x47a5('0x55')],'as':_0x47a5('0x56')}]})['then'](handleEntityNotFound(_0x4fa1da,null))['then'](saveUpdates(_0x376e1d[_0x47a5('0x5a')],null))[_0x47a5('0x1f')](function(_0x867da0){if(_0x867da0&&_0x376e1d[_0x47a5('0x5a')]['Imap']){return db[_0x47a5('0x38')][_0x47a5('0x31')](_0x376e1d[_0x47a5('0x5a')]['Imap'],{'where':{'MailAccountId':_0x867da0['id']}})[_0x47a5('0x1f')](function(){return _0x867da0;});}return _0x867da0;})['then'](function(_0x485e3c){if(_0x485e3c&&_0x376e1d[_0x47a5('0x5a')][_0x47a5('0x3a')]){return db[_0x47a5('0x39')][_0x47a5('0x31')](_0x376e1d['body'][_0x47a5('0x3a')],{'where':{'MailAccountId':_0x485e3c['id']}})['then'](function(){return _0x485e3c;});}return _0x485e3c;})['then'](respondWithResult(_0x4fa1da,null))['catch'](handleError(_0x4fa1da,null));};exports['describe']=function(_0x212d92,_0x6cd4ea){return db[_0x47a5('0x3b')]['describe']()['then'](respondWithResult(_0x6cd4ea,null))[_0x47a5('0x5b')](handleError(_0x6cd4ea,null));};exports[_0x47a5('0x5c')]=function(_0x45d4b6,_0x3c2b46,_0xc45e25){if(_0x45d4b6['body']['id']){delete _0x45d4b6[_0x47a5('0x5a')]['id'];}return db['MailAccount'][_0x47a5('0x59')]({'where':{'id':_0x45d4b6[_0x47a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x3c2b46,null))[_0x47a5('0x1f')](function(_0x345104){if(_0x345104){_0x45d4b6[_0x47a5('0x5a')][_0x47a5('0x5d')]=_0x345104['id'];return db[_0x47a5('0x5e')][_0x47a5('0x5f')](_0x45d4b6[_0x47a5('0x5a')]);}})[_0x47a5('0x1f')](respondWithResult(_0x3c2b46,null))['catch'](handleError(_0x3c2b46,null));};exports[_0x47a5('0x60')]=function(_0x2a3a57,_0x3c75c6,_0x26e7fc){var _0x396cb0={'raw':![],'where':{}};var _0x4bbe14={};var _0xbec033={'count':0x0,'rows':[]};return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0x2a3a57[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x3c75c6,null))[_0x47a5('0x1f')](function(_0x453191){if(_0x453191){_0x4bbe14[_0x47a5('0x3c')]=_[_0x47a5('0x3d')](db[_0x47a5('0x5e')][_0x47a5('0x57')]);_0x4bbe14[_0x47a5('0x3e')]=_[_0x47a5('0x3d')](_0x2a3a57[_0x47a5('0x3e')]);_0x4bbe14[_0x47a5('0x3f')]=_['intersection'](_0x4bbe14[_0x47a5('0x3c')],_0x4bbe14[_0x47a5('0x3e')]);_0x396cb0[_0x47a5('0x41')]=_['intersection'](_0x4bbe14[_0x47a5('0x3c')],qs[_0x47a5('0x42')](_0x2a3a57[_0x47a5('0x3e')][_0x47a5('0x42')]));_0x396cb0['attributes']=_0x396cb0[_0x47a5('0x41')]['length']?_0x396cb0[_0x47a5('0x41')]:_0x4bbe14['model'];if(!_0x2a3a57[_0x47a5('0x3e')]['hasOwnProperty'](_0x47a5('0x62'))){_0x396cb0[_0x47a5('0x44')]=qs[_0x47a5('0x44')](_0x2a3a57['query']['limit']);_0x396cb0['offset']=qs[_0x47a5('0x2d')](_0x2a3a57[_0x47a5('0x3e')][_0x47a5('0x2d')]);}_0x396cb0[_0x47a5('0x45')]=qs['sort'](_0x2a3a57[_0x47a5('0x3e')][_0x47a5('0x46')]);_0x396cb0[_0x47a5('0x49')]=qs[_0x47a5('0x3f')](_[_0x47a5('0x47')](_0x2a3a57[_0x47a5('0x3e')],_0x4bbe14[_0x47a5('0x3f')]));_0x396cb0[_0x47a5('0x49')][_0x47a5('0x5d')]=_0x453191['id'];if(_0x2a3a57[_0x47a5('0x3e')][_0x47a5('0x48')]){_0x396cb0[_0x47a5('0x49')]=_['merge'](_0x396cb0[_0x47a5('0x49')],{'$or':_['map'](_0x396cb0[_0x47a5('0x41')],function(_0x2ac30f){var _0x281e5f={};_0x281e5f[_0x2ac30f]={'$like':'%'+_0x2a3a57[_0x47a5('0x3e')][_0x47a5('0x48')]+'%'};return _0x281e5f;})});}_0x396cb0=_[_0x47a5('0x4a')]({},_0x396cb0,_0x2a3a57[_0x47a5('0x63')]);return db[_0x47a5('0x5e')][_0x47a5('0x2c')]({'where':_0x396cb0[_0x47a5('0x49')]})[_0x47a5('0x1f')](function(_0x1f07ac){_0xbec033[_0x47a5('0x2c')]=_0x1f07ac;if(_0x2a3a57[_0x47a5('0x3e')][_0x47a5('0x58')]){_0x396cb0['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x396cb0);})['then'](function(_0x490e28){_0xbec033[_0x47a5('0x52')]=_0x490e28;return _0xbec033;});}})['then'](respondWithFilteredResult(_0x3c75c6,_0x396cb0))[_0x47a5('0x5b')](handleError(_0x3c75c6,null));};exports[_0x47a5('0x64')]=function(_0x1baa5a,_0x396102,_0x3cd335){return db[_0x47a5('0x3b')][_0x47a5('0x59')]({'where':{'id':_0x1baa5a[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x396102,null))[_0x47a5('0x1f')](function(_0x24a6c1){if(_0x24a6c1){return _0x24a6c1['removeDispositions'](_0x1baa5a[_0x47a5('0x3e')][_0x47a5('0x65')]);}})[_0x47a5('0x1f')](respondWithStatusCode(_0x396102,null))['catch'](handleError(_0x396102,null));};exports[_0x47a5('0x66')]=function(_0x32f393,_0x17b61d,_0x5d41d8){if(_0x32f393[_0x47a5('0x5a')]['id']){delete _0x32f393['body']['id'];}return db['MailAccount'][_0x47a5('0x59')]({'where':{'id':_0x32f393[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x17b61d,null))[_0x47a5('0x1f')](function(_0x164d42){if(_0x164d42){_0x32f393[_0x47a5('0x5a')]['MailAccountId']=_0x164d42['id'];return db['CannedAnswer'][_0x47a5('0x5f')](_0x32f393['body']);}})[_0x47a5('0x1f')](respondWithResult(_0x17b61d,null))[_0x47a5('0x5b')](handleError(_0x17b61d,null));};exports[_0x47a5('0x67')]=function(_0xb16bdd,_0x53ea2b,_0x3c66e3){var _0x550bde={'raw':![],'where':{}};var _0x5f3a04={};var _0x139c79={'count':0x0,'rows':[]};return db[_0x47a5('0x3b')]['findOne']({'where':{'id':_0xb16bdd[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x53ea2b,null))[_0x47a5('0x1f')](function(_0x4c25ec){if(_0x4c25ec){_0x5f3a04[_0x47a5('0x3c')]=_['keys'](db[_0x47a5('0x68')][_0x47a5('0x57')]);_0x5f3a04[_0x47a5('0x3e')]=_['keys'](_0xb16bdd[_0x47a5('0x3e')]);_0x5f3a04[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x5f3a04['model'],_0x5f3a04[_0x47a5('0x3e')]);_0x550bde['attributes']=_[_0x47a5('0x40')](_0x5f3a04['model'],qs[_0x47a5('0x42')](_0xb16bdd[_0x47a5('0x3e')][_0x47a5('0x42')]));_0x550bde[_0x47a5('0x41')]=_0x550bde['attributes'][_0x47a5('0x43')]?_0x550bde[_0x47a5('0x41')]:_0x5f3a04[_0x47a5('0x3c')];if(!_0xb16bdd[_0x47a5('0x3e')][_0x47a5('0x69')]('nolimit')){_0x550bde['limit']=qs[_0x47a5('0x44')](_0xb16bdd['query'][_0x47a5('0x44')]);_0x550bde[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0xb16bdd['query'][_0x47a5('0x2d')]);}_0x550bde[_0x47a5('0x45')]=qs['sort'](_0xb16bdd[_0x47a5('0x3e')][_0x47a5('0x46')]);_0x550bde[_0x47a5('0x49')]=qs[_0x47a5('0x3f')](_['pick'](_0xb16bdd['query'],_0x5f3a04[_0x47a5('0x3f')]));_0x550bde[_0x47a5('0x49')]['MailAccountId']=_0x4c25ec['id'];if(_0xb16bdd[_0x47a5('0x3e')][_0x47a5('0x48')]){_0x550bde['where']=_[_0x47a5('0x4a')](_0x550bde[_0x47a5('0x49')],{'$or':_[_0x47a5('0x4b')](_0x550bde['attributes'],function(_0x3f2ad9){var _0x59b4a5={};_0x59b4a5[_0x3f2ad9]={'$like':'%'+_0xb16bdd[_0x47a5('0x3e')]['filter']+'%'};return _0x59b4a5;})});}_0x550bde=_[_0x47a5('0x4a')]({},_0x550bde,_0xb16bdd[_0x47a5('0x63')]);return db['CannedAnswer'][_0x47a5('0x2c')]({'where':_0x550bde['where']})[_0x47a5('0x1f')](function(_0x36f619){_0x139c79[_0x47a5('0x2c')]=_0x36f619;if(_0xb16bdd[_0x47a5('0x3e')]['includeAll']){_0x550bde[_0x47a5('0x50')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x550bde);})[_0x47a5('0x1f')](function(_0x46bdb1){_0x139c79[_0x47a5('0x52')]=_0x46bdb1;return _0x139c79;});}})[_0x47a5('0x1f')](respondWithFilteredResult(_0x53ea2b,_0x550bde))[_0x47a5('0x5b')](handleError(_0x53ea2b,null));};exports['removeAnswers']=function(_0x1522a6,_0x8be6a2,_0x241e1d){return db[_0x47a5('0x3b')]['find']({'where':{'id':_0x1522a6[_0x47a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x8be6a2,null))[_0x47a5('0x1f')](function(_0x13b958){if(_0x13b958){return _0x13b958[_0x47a5('0x6a')](_0x1522a6[_0x47a5('0x3e')][_0x47a5('0x65')]);}})[_0x47a5('0x1f')](respondWithStatusCode(_0x8be6a2,null))[_0x47a5('0x5b')](handleError(_0x8be6a2,null));};exports[_0x47a5('0x5f')]=function(_0x11eaf7,_0x583746){var _0x36796e={'name':_0x11eaf7[_0x47a5('0x5a')]['name'],'key':_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x4d')],'email':_0x11eaf7[_0x47a5('0x5a')]['email'],'ListId':_0x11eaf7['body'][_0x47a5('0x6b')],'active':!_[_0x47a5('0x6c')](_0x11eaf7['body']['active'])?_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x6d')]:!![],'description':_0x11eaf7['body'][_0x47a5('0x6e')]||null,'Imap':{},'Smtp':{}};if(_[_0x47a5('0x6c')](_0x11eaf7['body'][_0x47a5('0x6f')])){if(_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x70')]){_0x36796e[_0x47a5('0x54')][_0x47a5('0x71')]=_0x36796e[_0x47a5('0x3a')]['user']=_0x11eaf7['body']['cuser'];_0x36796e[_0x47a5('0x54')][_0x47a5('0x72')]=_0x36796e['Smtp'][_0x47a5('0x73')]=_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x74')];}else{_0x36796e[_0x47a5('0x54')][_0x47a5('0x75')]=_0x36796e['Smtp'][_0x47a5('0x75')]=![];}_0x36796e['Imap']['host']=_0x11eaf7['body'][_0x47a5('0x54')]['host'];_0x36796e[_0x47a5('0x54')][_0x47a5('0x76')]=_0x11eaf7[_0x47a5('0x5a')]['Imap'][_0x47a5('0x76')];_0x36796e[_0x47a5('0x3a')][_0x47a5('0x77')]=_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x3a')]['host'];_0x36796e[_0x47a5('0x3a')][_0x47a5('0x76')]=_0x11eaf7['body'][_0x47a5('0x3a')][_0x47a5('0x76')];}else{_0x36796e[_0x47a5('0x54')][_0x47a5('0x78')]=_0x36796e[_0x47a5('0x3a')][_0x47a5('0x78')]=_0x11eaf7['body'][_0x47a5('0x6f')];_0x36796e[_0x47a5('0x54')]['user']=_0x36796e[_0x47a5('0x3a')][_0x47a5('0x71')]=_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x79')];_0x36796e['Imap']['password']=_0x36796e['Smtp']['pass']=_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x74')];}return db[_0x47a5('0x3b')][_0x47a5('0x5f')](_0x36796e,{'include':[{'model':db[_0x47a5('0x39')],'as':_0x47a5('0x3a')},{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x54')}]})['then'](function(_0x272b10){var _0x24e39a=_0x11eaf7[_0x47a5('0x71')][_0x47a5('0x33')]({'plain':!![]});if(!_0x24e39a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24e39a['role']===_0x47a5('0x71')){var _0x54ae9a=_0x272b10['get']({'plain':!![]});return db[_0x47a5('0x7a')][_0x47a5('0x59')]({'where':{'name':'MailAccounts','userProfileId':_0x24e39a[_0x47a5('0x7b')]},'raw':!![]})[_0x47a5('0x1f')](function(_0x2beda0){if(_0x2beda0&&_0x2beda0['autoAssociation']===0x0){return db[_0x47a5('0x34')][_0x47a5('0x5f')]({'name':_0x54ae9a['name'],'resourceId':_0x54ae9a['id'],'type':_0x2beda0[_0x47a5('0x36')],'sectionId':_0x2beda0['id']},{})[_0x47a5('0x1f')](function(){return _0x272b10;});}else{return _0x272b10;}})[_0x47a5('0x5b')](function(_0x311109){logger[_0x47a5('0x25')](_0x47a5('0x7c'),_0x311109);throw _0x311109;});}return _0x272b10;})['then'](respondWithResult(_0x583746,0xc9))[_0x47a5('0x5b')](handleError(_0x583746,null));};exports['getImap']=function(_0x2a3f32,_0x3ab7ac,_0xe3f69f){return db[_0x47a5('0x3b')]['findOne']({'where':{'id':_0x2a3f32[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x3ab7ac,null))[_0x47a5('0x1f')](function(_0x27baad){if(_0x27baad){return _0x27baad[_0x47a5('0x7d')]();}return null;})[_0x47a5('0x1f')](respondWithResult(_0x3ab7ac,null))[_0x47a5('0x5b')](handleError(_0x3ab7ac,null));};exports[_0x47a5('0x7e')]=function(_0x1b3e82,_0xa2045c,_0x109738){if(_0x1b3e82[_0x47a5('0x5a')]['id']){delete _0x1b3e82['body']['id'];}return db[_0x47a5('0x3b')][_0x47a5('0x59')]({'where':{'id':_0x1b3e82['params']['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0xa2045c,null))[_0x47a5('0x1f')](function(_0x390123){if(_0x390123){_0x1b3e82[_0x47a5('0x5a')][_0x47a5('0x5d')]=_0x390123['id'];return db['MailServerIn'][_0x47a5('0x5f')](_0x1b3e82[_0x47a5('0x5a')]);}})[_0x47a5('0x1f')](respondWithResult(_0xa2045c,null))[_0x47a5('0x5b')](handleError(_0xa2045c,null));};exports[_0x47a5('0x7f')]=function(_0x363077,_0x29c205,_0x5e4387){return db['MailAccount'][_0x47a5('0x61')]({'where':{'id':_0x363077['params']['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x29c205,null))['then'](function(_0x12572f){if(_0x12572f){return _0x12572f[_0x47a5('0x80')](null);}return null;})[_0x47a5('0x1f')](respondWithStatusCode(_0x29c205,null))[_0x47a5('0x5b')](handleError(_0x29c205,null));};exports['getSmtp']=function(_0x220557,_0x11f07b,_0xaca12c){return db['MailAccount']['findOne']({'where':{'id':_0x220557[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x11f07b,null))[_0x47a5('0x1f')](function(_0xfccf9c){if(_0xfccf9c){return _0xfccf9c[_0x47a5('0x81')]();}return null;})[_0x47a5('0x1f')](respondWithResult(_0x11f07b,null))[_0x47a5('0x5b')](handleError(_0x11f07b,null));};exports[_0x47a5('0x82')]=function(_0x566630,_0x38d101,_0x4d333b){if(_0x566630[_0x47a5('0x5a')]['id']){delete _0x566630[_0x47a5('0x5a')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x566630[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x38d101,null))['then'](function(_0x4420fa){if(_0x4420fa){_0x566630[_0x47a5('0x5a')][_0x47a5('0x5d')]=_0x4420fa['id'];return db[_0x47a5('0x39')]['create'](_0x566630[_0x47a5('0x5a')]);}})['then'](respondWithResult(_0x38d101,null))['catch'](handleError(_0x38d101,null));};exports['removeSmtp']=function(_0x1e0171,_0x5a975d,_0x16bf1a){return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0x1e0171[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x5a975d,null))[_0x47a5('0x1f')](function(_0x6cd737){if(_0x6cd737){return _0x6cd737[_0x47a5('0x83')](null);}return null;})[_0x47a5('0x1f')](respondWithStatusCode(_0x5a975d,null))[_0x47a5('0x5b')](handleError(_0x5a975d,null));};exports[_0x47a5('0x84')]=function(_0xf05c39,_0x328faa,_0x1bfa3b){return db[_0x47a5('0x85')]['find']({'where':{'id':_0xf05c39[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x328faa,null))[_0x47a5('0x1f')](function(_0x2fa5e3){if(_0x2fa5e3){return _0x2fa5e3['addInteraction'](_0xf05c39[_0x47a5('0x5a')]['ids'],_[_0x47a5('0x86')](_0xf05c39['body'],[_0x47a5('0x65'),'id'])||{});}})[_0x47a5('0x1f')](respondWithResult(_0x328faa,null))[_0x47a5('0x5b')](handleError(_0x328faa,null));};exports['getInteractions']=function(_0x35f735,_0x217e04,_0x14771b){var _0x4ac804={'raw':![],'where':{}};var _0x52798d={};var _0x20f320={'count':0x0,'rows':[]};return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0x35f735[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x217e04,null))['then'](function(_0x1196a0){if(_0x1196a0){_0x52798d['model']=_[_0x47a5('0x3d')](db[_0x47a5('0x85')][_0x47a5('0x57')]);_0x52798d[_0x47a5('0x3e')]=_['keys'](_0x35f735['query']);_0x52798d[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x52798d[_0x47a5('0x3c')],_0x52798d[_0x47a5('0x3e')]);_0x4ac804[_0x47a5('0x41')]=_[_0x47a5('0x40')](_0x52798d[_0x47a5('0x3c')],qs[_0x47a5('0x42')](_0x35f735[_0x47a5('0x3e')]['fields']));_0x4ac804['attributes']=_0x4ac804[_0x47a5('0x41')]['length']?_0x4ac804[_0x47a5('0x41')]:_0x52798d[_0x47a5('0x3c')];if(!_0x35f735[_0x47a5('0x3e')]['hasOwnProperty'](_0x47a5('0x62'))){_0x4ac804[_0x47a5('0x44')]=qs['limit'](_0x35f735[_0x47a5('0x3e')]['limit']);_0x4ac804[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x35f735[_0x47a5('0x3e')]['offset']);}_0x4ac804['order']=qs['sort'](_0x35f735['query']['sort']);_0x4ac804[_0x47a5('0x49')]=qs['filters'](_[_0x47a5('0x47')](_0x35f735[_0x47a5('0x3e')],_0x52798d['filters']));_0x4ac804['where']['MailAccountId']=_0x1196a0['id'];if(_0x35f735[_0x47a5('0x3e')]['filter']){_0x4ac804['where']=_['merge'](_0x4ac804[_0x47a5('0x49')],{'$or':_[_0x47a5('0x4b')](_0x4ac804[_0x47a5('0x41')],function(_0xdb9128){var _0x513d6f={};_0x513d6f[_0xdb9128]={'$like':'%'+_0x35f735[_0x47a5('0x3e')]['filter']+'%'};return _0x513d6f;})});}_0x4ac804=_[_0x47a5('0x4a')]({},_0x4ac804,_0x35f735['options']);return db[_0x47a5('0x85')][_0x47a5('0x2c')]({'where':_0x4ac804[_0x47a5('0x49')]})['then'](function(_0x106bbe){_0x20f320[_0x47a5('0x2c')]=_0x106bbe;if(_0x35f735[_0x47a5('0x3e')][_0x47a5('0x58')]){_0x4ac804['include']=[{'model':db[_0x47a5('0x87')],'as':_0x47a5('0x88'),'required':![]},{'model':db[_0x47a5('0x89')],'as':_0x47a5('0x8a'),'attributes':[_0x47a5('0x36'),_0x47a5('0x8b'),'internal'],'required':![]},{'model':db[_0x47a5('0x8c')],'as':_0x47a5('0x8d'),'attributes':['id',_0x47a5('0x36'),_0x47a5('0x8e')],'where':_0x35f735[_0x47a5('0x3e')][_0x47a5('0x8f')]?{'id':_0x35f735[_0x47a5('0x3e')][_0x47a5('0x8f')]}:undefined,'required':_0x35f735[_0x47a5('0x3e')][_0x47a5('0x8f')]?!![]:![]}];}return db[_0x47a5('0x85')][_0x47a5('0x51')](_0x4ac804);})[_0x47a5('0x1f')](function(_0x106b70){_0x20f320[_0x47a5('0x52')]=_0x106b70;return _0x20f320;});}})[_0x47a5('0x1f')](respondWithFilteredResult(_0x217e04,_0x4ac804))[_0x47a5('0x5b')](handleError(_0x217e04,null));};exports['addApplications']=function(_0xe0376c,_0x5ee5c5,_0x51bfb8){return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0xe0376c[_0x47a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x5ee5c5,null))[_0x47a5('0x1f')](function(_0xd8381b){if(_0xd8381b){return db[_0x47a5('0x90')][_0x47a5('0x91')](function(_0x30e5fb){return db[_0x47a5('0x92')][_0x47a5('0x32')]({'where':{'MailAccountId':_0xe0376c[_0x47a5('0x53')]['id']},'transaction':_0x30e5fb})[_0x47a5('0x1f')](function(_0x15f273){var _0x10952f=_[_0x47a5('0x4b')](_0xe0376c[_0x47a5('0x5a')],function(_0x4d7fd4){_0x4d7fd4['MailAccountId']=_0xe0376c[_0x47a5('0x53')]['id'];return _0x4d7fd4;});return db['MailApplication'][_0x47a5('0x93')](_0x10952f,{'transaction':_0x30e5fb});});})[_0x47a5('0x1f')](function(){return db[_0x47a5('0x92')][_0x47a5('0x94')]({'where':{'MailAccountId':_0xe0376c[_0x47a5('0x53')]['id']},'order':_0x47a5('0x95')});});}})['then'](respondWithResult(_0x5ee5c5,null))[_0x47a5('0x5b')](handleError(_0x5ee5c5,null));};exports[_0x47a5('0x96')]=function(_0x380eca,_0x5ca5bc,_0x19c94a){var _0x439f60={};var _0x3ecc41={};var _0x3e4148;var _0x4c46ea;return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0x380eca[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x5ca5bc,null))[_0x47a5('0x1f')](function(_0x1b91ad){if(_0x1b91ad){_0x3e4148=_0x1b91ad;_0x3ecc41[_0x47a5('0x3c')]=_[_0x47a5('0x3d')](db[_0x47a5('0x92')][_0x47a5('0x57')]);_0x3ecc41[_0x47a5('0x3e')]=_[_0x47a5('0x3d')](_0x380eca[_0x47a5('0x3e')]);_0x3ecc41[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x3ecc41[_0x47a5('0x3c')],_0x3ecc41[_0x47a5('0x3e')]);_0x439f60['attributes']=_[_0x47a5('0x40')](_0x3ecc41['model'],qs[_0x47a5('0x42')](_0x380eca[_0x47a5('0x3e')][_0x47a5('0x42')]));_0x439f60[_0x47a5('0x41')]=_0x439f60[_0x47a5('0x41')][_0x47a5('0x43')]?_0x439f60[_0x47a5('0x41')]:_0x3ecc41[_0x47a5('0x3c')];_0x439f60['order']=qs[_0x47a5('0x46')](_0x380eca[_0x47a5('0x3e')][_0x47a5('0x46')]);_0x439f60['where']=qs[_0x47a5('0x3f')](_[_0x47a5('0x47')](_0x380eca[_0x47a5('0x3e')],_0x3ecc41[_0x47a5('0x3f')]));if(_0x380eca['query'][_0x47a5('0x48')]){_0x439f60[_0x47a5('0x49')]=_[_0x47a5('0x4a')](_0x439f60[_0x47a5('0x49')],{'$or':_['map'](_0x439f60[_0x47a5('0x41')],function(_0x57ee4c){var _0x5be91a={};_0x5be91a[_0x57ee4c]={'$like':'%'+_0x380eca[_0x47a5('0x3e')][_0x47a5('0x48')]+'%'};return _0x5be91a;})});}_0x439f60=_[_0x47a5('0x4a')]({},_0x439f60,_0x380eca[_0x47a5('0x63')]);return _0x3e4148['getApplications'](_0x439f60);}})[_0x47a5('0x1f')](function(_0xe3f0d7){if(_0xe3f0d7){_0x4c46ea=_0xe3f0d7[_0x47a5('0x43')];if(!_0x380eca[_0x47a5('0x3e')][_0x47a5('0x69')](_0x47a5('0x62'))){_0x439f60['limit']=qs[_0x47a5('0x44')](_0x380eca[_0x47a5('0x3e')][_0x47a5('0x44')]);_0x439f60[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x380eca['query'][_0x47a5('0x2d')]);}return _0x3e4148['getApplications'](_0x439f60);}})[_0x47a5('0x1f')](function(_0x56010f){if(_0x56010f){return _0x56010f?{'count':_0x4c46ea,'rows':_0x56010f}:null;}})[_0x47a5('0x1f')](respondWithResult(_0x5ca5bc,null))['catch'](handleError(_0x5ca5bc,null));};exports['getMessages']=function(_0x2a4e69,_0x445fc8,_0x488a4c){var _0xa07bc6={'raw':!![],'where':{}};var _0x2d7e13={};var _0x530542={'count':0x0,'rows':[]};return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0x2a4e69[_0x47a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x445fc8,null))[_0x47a5('0x1f')](function(_0x3b83ec){if(_0x3b83ec){_0x2d7e13[_0x47a5('0x3c')]=_[_0x47a5('0x3d')](db[_0x47a5('0x97')]['rawAttributes']);_0x2d7e13['query']=_[_0x47a5('0x3d')](_0x2a4e69['query']);_0x2d7e13[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x2d7e13['model'],_0x2d7e13['query']);_0xa07bc6[_0x47a5('0x41')]=_['intersection'](_0x2d7e13[_0x47a5('0x3c')],qs[_0x47a5('0x42')](_0x2a4e69[_0x47a5('0x3e')][_0x47a5('0x42')]));_0xa07bc6[_0x47a5('0x41')]=_0xa07bc6[_0x47a5('0x41')][_0x47a5('0x43')]?_0xa07bc6['attributes']:_0x2d7e13[_0x47a5('0x3c')];if(!_0x2a4e69['query'][_0x47a5('0x69')](_0x47a5('0x62'))){_0xa07bc6[_0x47a5('0x44')]=qs[_0x47a5('0x44')](_0x2a4e69[_0x47a5('0x3e')][_0x47a5('0x44')]);_0xa07bc6[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x2a4e69[_0x47a5('0x3e')][_0x47a5('0x2d')]);}_0xa07bc6[_0x47a5('0x45')]=qs[_0x47a5('0x46')](_0x2a4e69['query'][_0x47a5('0x46')]);_0xa07bc6[_0x47a5('0x49')]=qs[_0x47a5('0x3f')](_['pick'](_0x2a4e69[_0x47a5('0x3e')],_0x2d7e13[_0x47a5('0x3f')]));_0xa07bc6[_0x47a5('0x49')][_0x47a5('0x5d')]=_0x3b83ec['id'];if(_0x2a4e69[_0x47a5('0x3e')][_0x47a5('0x48')]){_0xa07bc6['where']=_[_0x47a5('0x4a')](_0xa07bc6[_0x47a5('0x49')],{'$or':_[_0x47a5('0x4b')](_0xa07bc6[_0x47a5('0x41')],function(_0x30dcbf){var _0x3c80d7={};_0x3c80d7[_0x30dcbf]={'$like':'%'+_0x2a4e69[_0x47a5('0x3e')][_0x47a5('0x48')]+'%'};return _0x3c80d7;})});}if(_0x2a4e69[_0x47a5('0x3e')][_0x47a5('0x98')]){var _0x4817f8=_0x2a4e69['query'][_0x47a5('0x98')][_0x47a5('0x99')](',');var _0x3f1d5a={};_0x3f1d5a[_0x4817f8[0x0]]={'$gte':moment(_0x4817f8[0x1])['format'](_0x47a5('0x9a'))};_0xa07bc6['where']=_['merge'](_0xa07bc6[_0x47a5('0x49')],_0x3f1d5a);}_0xa07bc6=_[_0x47a5('0x4a')]({},_0xa07bc6,_0x2a4e69[_0x47a5('0x63')]);return db[_0x47a5('0x97')]['count']({'where':_0xa07bc6[_0x47a5('0x49')]})[_0x47a5('0x1f')](function(_0x4ff2a5){_0x530542['count']=_0x4ff2a5;if(_0x2a4e69['query'][_0x47a5('0x58')]){_0xa07bc6[_0x47a5('0x50')]=[{'all':!![]}];}return db[_0x47a5('0x97')][_0x47a5('0x51')](_0xa07bc6);})[_0x47a5('0x1f')](function(_0x4c555c){_0x530542['rows']=_0x4c555c;return _0x530542;});}})[_0x47a5('0x1f')](respondWithFilteredResult(_0x445fc8,_0xa07bc6))[_0x47a5('0x5b')](handleError(_0x445fc8,null));};exports[_0x47a5('0x37')]=function(_0x1ca53c,_0x4d26f4,_0x873e26){var _0x392e23,_0x17253b={},_0x57a70d;if(_0x1ca53c['body']['to']){_0x57a70d=_0x1ca53c['body']['to']['split'](',')[0x0];}return db[_0x47a5('0x3b')][_0x47a5('0x59')]({'where':{'id':_0x1ca53c[_0x47a5('0x53')]['id']},'include':[{'model':db[_0x47a5('0x9b')],'as':_0x47a5('0x9c'),'include':[{'model':db[_0x47a5('0x87')],'as':_0x47a5('0x9d'),'where':{'email':_0x57a70d},'limit':0x1,'order':[[_0x47a5('0x9e'),_0x47a5('0x9f')]]}]},{'model':db['MailServerOut'],'as':_0x47a5('0x3a'),'raw':!![]}]})[_0x47a5('0x1f')](handleEntityNotFound(_0x4d26f4,null))['then'](function(_0x34ff37){if(_0x34ff37){_0x392e23=_0x34ff37;if(_0x34ff37[_0x47a5('0x3a')]){if(_[_0x47a5('0x6c')](_0x1ca53c[_0x47a5('0x5a')]['from'])){_0x1ca53c[_0x47a5('0x5a')][_0x47a5('0xa0')]=util[_0x47a5('0xa1')]('%s\x20<%s>',_0x34ff37['name'],_0x34ff37[_0x47a5('0xa2')]||_0x34ff37['Smtp'][_0x47a5('0x71')]);}if(_0x1ca53c['body'][_0x47a5('0xa3')]&&_0x1ca53c[_0x47a5('0x5a')][_0x47a5('0xa3')][_0x47a5('0x43')]){for(var _0x1cef82=0x0;_0x1cef82<_0x1ca53c['body']['attachments'][_0x47a5('0x43')];_0x1cef82+=0x1){_0x1ca53c[_0x47a5('0x5a')][_0x47a5('0xa3')][_0x1cef82]={'filename':_0x1ca53c[_0x47a5('0x5a')]['attachments'][_0x1cef82]['name'],'path':path[_0x47a5('0xa4')](config['root'],_0x47a5('0xa5'),_0x1ca53c['body'][_0x47a5('0xa3')][_0x1cef82]['basename'])};}}var _0x41bbe6={'tls':{'rejectUnauthorized':![]}};if(_[_0x47a5('0x6c')](_0x34ff37[_0x47a5('0x3a')][_0x47a5('0x78')])){if(_0x34ff37[_0x47a5('0x3a')][_0x47a5('0x75')]){_0x41bbe6[_0x47a5('0xa6')]={'user':_0x34ff37[_0x47a5('0x3a')]['user'],'pass':_0x34ff37[_0x47a5('0x3a')][_0x47a5('0x73')]};}_0x41bbe6['host']=_0x34ff37[_0x47a5('0x3a')][_0x47a5('0x77')];_0x41bbe6['port']=_0x34ff37['Smtp'][_0x47a5('0x76')];_0x41bbe6['secure']=_0x34ff37[_0x47a5('0x3a')][_0x47a5('0xa7')];}else{_0x41bbe6[_0x47a5('0x78')]=_0x34ff37['Smtp'][_0x47a5('0x78')];_0x41bbe6[_0x47a5('0xa6')]={'user':_0x34ff37[_0x47a5('0x3a')][_0x47a5('0x71')],'pass':_0x34ff37[_0x47a5('0x3a')][_0x47a5('0x73')]};}return respondWithRpcPromise(_0x47a5('0xa8'),'sendMail',{'account':_0x41bbe6,'message':_0x1ca53c[_0x47a5('0x5a')]});}else{throw new Error(_0x47a5('0xa9'));}}})[_0x47a5('0x1f')](function(_0xa6c86e){if(_0xa6c86e){_0x17253b=_0xa6c86e;if(_0x392e23[_0x47a5('0x9c')]){if(_0x392e23[_0x47a5('0x9c')][_0x47a5('0x9d')]['length']){return _0x392e23['List'][_0x47a5('0x9d')][0x0];}else{return db[_0x47a5('0x87')][_0x47a5('0x5f')](_['defaults'](_0x1ca53c['body'],{'firstName':_0x1ca53c[_0x47a5('0x5a')]['to'],'email':_0x1ca53c[_0x47a5('0x5a')]['to'],'phone':_0x1ca53c[_0x47a5('0x5a')]['to'],'ListId':_0x392e23[_0x47a5('0x6b')]}));}}else{throw new Error(_0x47a5('0xa9'));}}})[_0x47a5('0x1f')](function(_0x2e0add){if(_0x2e0add){var _0x58e85b={'UserId':_0x1ca53c[_0x47a5('0x71')]['id'],'ContactId':_0x2e0add['id'],'MailAccountId':_0x392e23['id'],'inReplyTo':_0x17253b[_0x47a5('0xaa')],'to':_0x1ca53c[_0x47a5('0x5a')]['from'],'cc':_0x1ca53c[_0x47a5('0x5a')]['cc'],'subject':_0x1ca53c[_0x47a5('0x5a')][_0x47a5('0xab')],'attach':_0x1ca53c[_0x47a5('0x5a')][_0x47a5('0xac')],'firstMsgDirection':_0x47a5('0xad'),'lastMsgAt':moment()[_0x47a5('0xa1')](_0x47a5('0x9a')),'lastMsgDirection':_0x47a5('0xad'),'lastMsgBody':_0x1ca53c[_0x47a5('0x5a')][_0x47a5('0x5a')],'Messages':[_[_0x47a5('0x4a')](_0x1ca53c[_0x47a5('0x5a')],{'messageId':_0x17253b['messageId'],'sentAt':moment()[_0x47a5('0xa1')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x392e23['id'],'UserId':_0x1ca53c[_0x47a5('0x71')]['id'],'ContactId':_0x2e0add['id']})]};if(_0x1ca53c['body'][_0x47a5('0xae')]){_0x58e85b=_[_0x47a5('0x4a')](_0x58e85b,_0x1ca53c[_0x47a5('0x5a')]['Interaction']);}return db[_0x47a5('0x85')]['create'](_0x58e85b,{'include':[{'model':db[_0x47a5('0x97')],'as':_0x47a5('0xaf')}]});}})[_0x47a5('0x1f')](respondWithResult(_0x4d26f4,null))[_0x47a5('0x5b')](handleError(_0x4d26f4,null));};exports['verifySmtp']=function(_0x265f50,_0x512607,_0x5cabb3){return db[_0x47a5('0x3b')][_0x47a5('0x59')]({'where':{'id':_0x265f50[_0x47a5('0x53')]['id']},'include':[{'model':db[_0x47a5('0x39')],'as':_0x47a5('0x3a'),'raw':!![]}]})[_0x47a5('0x1f')](handleEntityNotFound(_0x512607,null))[_0x47a5('0x1f')](function(_0x33ac8b){if(_0x33ac8b&&_0x33ac8b[_0x47a5('0x3a')]){var _0x598c19={'id':_0x33ac8b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x33ac8b['Smtp'][_0x47a5('0x78')]){_0x598c19[_0x47a5('0x78')]=_0x33ac8b[_0x47a5('0x3a')][_0x47a5('0x78')];}else{_0x598c19[_0x47a5('0x77')]=_0x33ac8b['Smtp'][_0x47a5('0x77')];_0x598c19[_0x47a5('0x76')]=_0x33ac8b[_0x47a5('0x3a')]['port'];_0x598c19['secure']=_0x33ac8b[_0x47a5('0x3a')][_0x47a5('0xa7')];}if(_0x33ac8b['Smtp'][_0x47a5('0x75')]){_0x598c19[_0x47a5('0xa6')]={'user':_0x33ac8b[_0x47a5('0x3a')]['user'],'pass':_0x33ac8b[_0x47a5('0x3a')][_0x47a5('0x73')]};}return respondWithRpcPromise(_0x47a5('0xb0'),_0x47a5('0xb1'),{'account':_0x598c19});}})[_0x47a5('0x1f')](respondWithResult(_0x512607,null))['catch'](handleError(_0x512607,null));};exports[_0x47a5('0x32')]=function(_0x38accb,_0x245e90){return db[_0x47a5('0x3b')]['find']({'where':{'id':_0x38accb['params']['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x245e90,null))['then'](function(_0x200742){if(_0x200742&&_0x200742[_0x47a5('0x78')]){throw new db[(_0x47a5('0xb2'))][(_0x47a5('0xb3'))](_0x47a5('0xb4'));}return _0x200742;})[_0x47a5('0x1f')](removeEntity(_0x245e90,null))['catch'](handleError(_0x245e90,null));};exports[_0x47a5('0xb5')]=function(_0x4035c6,_0x32143a,_0x52864b){return db['MailAccount'][_0x47a5('0x59')]({'where':{'id':_0x4035c6['params']['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x32143a,null))[_0x47a5('0x1f')](function(_0x3641f8){if(_0x3641f8){return _0x3641f8[_0x47a5('0xb5')](_0x4035c6[_0x47a5('0x5a')]['ids'],_['omit'](_0x4035c6[_0x47a5('0x5a')],[_0x47a5('0x65'),'id'])||{})[_0x47a5('0xb6')](function(_0x9fdee1){for(var _0x358d0b=0x0;_0x358d0b<_0x4035c6['body'][_0x47a5('0x65')][_0x47a5('0x43')];_0x358d0b+=0x1){socket[_0x47a5('0xb7')](_0x47a5('0xb8'),{'UserId':_0x4035c6[_0x47a5('0x5a')]['ids'][_0x358d0b],'MailAccountId':_0x4035c6[_0x47a5('0x53')]['id']});}return _0x9fdee1;});}})[_0x47a5('0x1f')](respondWithResult(_0x32143a,null))[_0x47a5('0x5b')](handleError(_0x32143a,null));};exports[_0x47a5('0xb9')]=function(_0x231977,_0x3eec46,_0x3e994b){return db[_0x47a5('0x3b')][_0x47a5('0x59')]({'where':{'id':_0x231977[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x3eec46,null))['then'](function(_0x39786a){if(_0x39786a){return _0x39786a[_0x47a5('0xb9')](_0x231977[_0x47a5('0x3e')][_0x47a5('0x65')])['then'](function(){if(_['isArray'](_0x231977['query'][_0x47a5('0x65')])){for(var _0x52e921=0x0;_0x52e921<_0x231977[_0x47a5('0x3e')][_0x47a5('0x65')]['length'];_0x52e921+=0x1){socket[_0x47a5('0xb7')](_0x47a5('0xba'),{'UserId':Number(_0x231977[_0x47a5('0x3e')]['ids'][_0x52e921]),'MailAccountId':Number(_0x231977[_0x47a5('0x53')]['id'])});}}else{socket['emit'](_0x47a5('0xba'),{'UserId':Number(_0x231977[_0x47a5('0x3e')][_0x47a5('0x65')]),'MailAccountId':Number(_0x231977[_0x47a5('0x53')]['id'])});}});}})[_0x47a5('0x1f')](respondWithStatusCode(_0x3eec46,null))[_0x47a5('0x5b')](handleError(_0x3eec46,null));};exports['getAgents']=function(_0x5709f8,_0x4ebc5c,_0x2647c3){var _0x2da818={};var _0x1d6349={};var _0x9d1a3b;var _0x28bf10;return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0x5709f8[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x4ebc5c,null))[_0x47a5('0x1f')](function(_0x277061){if(_0x277061){_0x9d1a3b=_0x277061;_0x1d6349[_0x47a5('0x3c')]=_[_0x47a5('0x3d')](db[_0x47a5('0x89')][_0x47a5('0x57')]);_0x1d6349[_0x47a5('0x3e')]=_['keys'](_0x5709f8[_0x47a5('0x3e')]);_0x1d6349[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x1d6349[_0x47a5('0x3c')],_0x1d6349[_0x47a5('0x3e')]);_0x2da818[_0x47a5('0x41')]=_[_0x47a5('0x40')](_0x1d6349[_0x47a5('0x3c')],qs['fields'](_0x5709f8[_0x47a5('0x3e')]['fields']));_0x2da818[_0x47a5('0x41')]=_0x2da818[_0x47a5('0x41')]['length']?_0x2da818[_0x47a5('0x41')]:_0x1d6349['model'];_0x2da818[_0x47a5('0x45')]=qs[_0x47a5('0x46')](_0x5709f8[_0x47a5('0x3e')][_0x47a5('0x46')]);_0x2da818[_0x47a5('0x49')]=qs['filters'](_[_0x47a5('0x47')](_0x5709f8[_0x47a5('0x3e')],_0x1d6349[_0x47a5('0x3f')]));if(_0x5709f8['query']['filter']){_0x2da818[_0x47a5('0x49')]=_[_0x47a5('0x4a')](_0x2da818[_0x47a5('0x49')],{'$or':_['map'](_0x2da818[_0x47a5('0x41')],function(_0x18f6d1){var _0x312ac7={};_0x312ac7[_0x18f6d1]={'$like':'%'+_0x5709f8['query'][_0x47a5('0x48')]+'%'};return _0x312ac7;})});}_0x2da818=_[_0x47a5('0x4a')]({},_0x2da818,_0x5709f8[_0x47a5('0x63')]);return _0x9d1a3b[_0x47a5('0xbb')](_0x2da818);}})['then'](function(_0x1a1be9){if(_0x1a1be9){_0x28bf10=_0x1a1be9['length'];if(!_0x5709f8[_0x47a5('0x3e')][_0x47a5('0x69')](_0x47a5('0x62'))){_0x2da818[_0x47a5('0x44')]=qs['limit'](_0x5709f8[_0x47a5('0x3e')][_0x47a5('0x44')]);_0x2da818[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x5709f8[_0x47a5('0x3e')]['offset']);}return _0x9d1a3b[_0x47a5('0xbb')](_0x2da818);}})[_0x47a5('0x1f')](function(_0xc46ed6){if(_0xc46ed6){return _0xc46ed6?{'count':_0x28bf10,'rows':_0xc46ed6}:null;}})[_0x47a5('0x1f')](respondWithResult(_0x4ebc5c,null))[_0x47a5('0x5b')](handleError(_0x4ebc5c,null));}; \ No newline at end of file +var _0xc4aa=['host','port','service','cservice','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','User','Owner','internal','color','tag','transaction','MailApplication','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','basename','authentication','secure','auth','SendMail','List\x20not\x20found','messageId','subject','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','redis','defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','options','count','include','findAll','rows','show','params','MailServerIn','MailServerOut','Smtp','includeAll','body','find','Imap','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','getAnswers','CannedAnswer','order','removeAnswers','key','email','ListId','isNil','active','description','cauthentication','user','cuser','password','pass','cpassword'];(function(_0x5ec17d,_0x41a8a1){var _0x253527=function(_0xd99fd3){while(--_0xd99fd3){_0x5ec17d['push'](_0x5ec17d['shift']());}};_0x253527(++_0x41a8a1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var hardwareService=require(_0xac4a('0x12'));var logger=require('../../config/logger')(_0xac4a('0x13'));var utils=require('../../config/utils');var config=require(_0xac4a('0x14'));var db=require('../../mysqldb')['db'];config[_0xac4a('0x15')]=_[_0xac4a('0x16')](config[_0xac4a('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xac4a('0x17'))(new Redis(config[_0xac4a('0x15')]));require(_0xac4a('0x18'))[_0xac4a('0x19')](socket);var jayson=require(_0xac4a('0x1a'));var client=jayson[_0xac4a('0x1b')][_0xac4a('0x1c')]({'port':0x232b});function checkPasswordPattern(_0x33c287,_0x190418,_0x42c7fc){if(_0x42c7fc){var _0x11e101=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11e101[_0xac4a('0x1d')](_0x190418)){return _0x33c287;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x33c287;}}function respondWithRpcPromise(_0x402fff,_0x34d797,_0x23eb66,_0x144553){return new BPromise(function(_0x3e88e3,_0x387a54){var _0x28e304=_0x144553||client;return _0x28e304[_0xac4a('0x1e')](_0x402fff,_0x23eb66)['then'](function(_0x5ac21e){logger[_0xac4a('0x1f')](_0xac4a('0x20'),_0x34d797,_0xac4a('0x21'));logger['debug'](_0xac4a('0x22'),_0x34d797,_0xac4a('0x21'),JSON[_0xac4a('0x23')](_0x5ac21e));if(_0x5ac21e[_0xac4a('0x24')]){if(_0x5ac21e[_0xac4a('0x24')][_0xac4a('0x25')]===0x1f4){logger[_0xac4a('0x24')](_0xac4a('0x20'),_0x34d797,_0x5ac21e['error'][_0xac4a('0x26')]);return _0x387a54(_0x5ac21e[_0xac4a('0x24')]['message']);}logger[_0xac4a('0x24')](_0xac4a('0x20'),_0x34d797,_0x5ac21e[_0xac4a('0x24')][_0xac4a('0x26')]);return _0x3e88e3(_0x5ac21e['error'][_0xac4a('0x26')]);}else{logger[_0xac4a('0x1f')](_0xac4a('0x20'),_0x34d797,_0xac4a('0x21'));_0x3e88e3(_0x5ac21e[_0xac4a('0x27')][_0xac4a('0x26')]);}})[_0xac4a('0x28')](function(_0x36054a){logger[_0xac4a('0x24')](_0xac4a('0x20'),_0x34d797,_0x36054a);_0x387a54(_0x36054a);});});}function respondWithStatusCode(_0x1d0539,_0x215a31){_0x215a31=_0x215a31||0xcc;return function(_0x14832b){if(_0x14832b){return _0x1d0539[_0xac4a('0x29')](_0x215a31);}return _0x1d0539[_0xac4a('0x2a')](_0x215a31)[_0xac4a('0x2b')]();};}function respondWithResult(_0x4e17ce,_0x23b061){_0x23b061=_0x23b061||0xc8;return function(_0x267a22){if(_0x267a22){return _0x4e17ce[_0xac4a('0x2a')](_0x23b061)[_0xac4a('0x2c')](_0x267a22);}};}function respondWithFilteredResult(_0x116700,_0x4a5a9e){return function(_0x47f49c){if(_0x47f49c){var _0xdb7e=_0x47f49c['count'],_0x7a948b=_0x4a5a9e[_0xac4a('0x2d')],_0x1f12d5=_0x4a5a9e[_0xac4a('0x2d')]+_0x4a5a9e[_0xac4a('0x2e')],_0x546b65;if(_0x1f12d5>=_0xdb7e){_0x1f12d5=_0xdb7e;_0x546b65=0xc8;}else{_0x546b65=0xce;}_0x116700[_0xac4a('0x2a')](_0x546b65);return _0x116700[_0xac4a('0x2f')]('Content-Range',_0x7a948b+'-'+_0x1f12d5+'/'+_0xdb7e)[_0xac4a('0x2c')](_0x47f49c);}return null;};}function patchUpdates(_0x482afc){return function(_0x30364b){try{jsonpatch['apply'](_0x30364b,_0x482afc,!![]);}catch(_0x17e6de){return BPromise[_0xac4a('0x30')](_0x17e6de);}return _0x30364b[_0xac4a('0x31')]();};}function saveUpdates(_0x228aa7,_0x34577f){return function(_0x61e552){if(_0x61e552){return _0x61e552[_0xac4a('0x32')](_0x228aa7)[_0xac4a('0x33')](function(_0x29fb3b){return _0x29fb3b;});}return null;};}function removeEntity(_0xfd7c16,_0x36ab49){return function(_0x1634df){if(_0x1634df){return _0x1634df[_0xac4a('0x34')]()[_0xac4a('0x33')](function(){var _0x5634e2=_0x1634df[_0xac4a('0x35')]({'plain':!![]});var _0x1c41fb='MailAccounts';return db[_0xac4a('0x36')][_0xac4a('0x34')]({'where':{'type':_0x1c41fb,'resourceId':_0x5634e2['id']}})['then'](function(){return _0x1634df;});})['then'](function(){_0xfd7c16[_0xac4a('0x2a')](0xcc)[_0xac4a('0x2b')]();});}};}function handleEntityNotFound(_0x1b42b6,_0x3de9e2){return function(_0x4f5986){if(!_0x4f5986){_0x1b42b6[_0xac4a('0x29')](0x194);}return _0x4f5986;};}function handleError(_0x2e56c6,_0x4e7630){_0x4e7630=_0x4e7630||0x1f4;return function(_0x37f2ee){logger[_0xac4a('0x24')](_0x37f2ee[_0xac4a('0x37')]);if(_0x37f2ee['name']){delete _0x37f2ee[_0xac4a('0x38')];}_0x2e56c6[_0xac4a('0x2a')](_0x4e7630)[_0xac4a('0x39')](_0x37f2ee);};}exports['index']=function(_0x35bc94,_0x2e76e3){var _0x4b9faf={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xac4a('0x3a')],'as':_0xac4a('0x3b')}]},_0x59bebf={},_0x4319a1={'count':0x0,'rows':[]};var _0x37834b=db[_0xac4a('0x3c')][_0xac4a('0x3d')];_0x59bebf[_0xac4a('0x3e')]=_[_0xac4a('0x3f')](_0x37834b);_0x59bebf[_0xac4a('0x40')]=_[_0xac4a('0x3f')](_0x35bc94[_0xac4a('0x40')]);_0x59bebf[_0xac4a('0x41')]=_[_0xac4a('0x42')](_0x59bebf['model'],_0x59bebf['query']);_0x4b9faf['attributes']=_[_0xac4a('0x42')](_0x59bebf[_0xac4a('0x3e')],qs[_0xac4a('0x43')](_0x35bc94[_0xac4a('0x40')][_0xac4a('0x43')]));_0x4b9faf[_0xac4a('0x44')]=_0x4b9faf[_0xac4a('0x44')][_0xac4a('0x45')]?_0x4b9faf[_0xac4a('0x44')]:_0x59bebf[_0xac4a('0x3e')];if(!_0x35bc94['query'][_0xac4a('0x46')](_0xac4a('0x47'))){_0x4b9faf[_0xac4a('0x2e')]=qs[_0xac4a('0x2e')](_0x35bc94[_0xac4a('0x40')]['limit']);_0x4b9faf[_0xac4a('0x2d')]=qs[_0xac4a('0x2d')](_0x35bc94['query'][_0xac4a('0x2d')]);}_0x4b9faf['order']=qs[_0xac4a('0x48')](_0x35bc94[_0xac4a('0x40')][_0xac4a('0x48')]);_0x4b9faf[_0xac4a('0x49')]=qs[_0xac4a('0x41')](_[_0xac4a('0x4a')](_0x35bc94[_0xac4a('0x40')],_0x59bebf[_0xac4a('0x41')]));if(_0x35bc94[_0xac4a('0x40')][_0xac4a('0x4b')]){_0x4b9faf[_0xac4a('0x49')]=_[_0xac4a('0x4c')](_0x4b9faf['where'],{'$or':_[_0xac4a('0x4d')](_0x37834b,function(_0x41d11d){if(_0x41d11d[_0xac4a('0x4e')]['key']!==_0xac4a('0x4f')){var _0x19276e={};_0x19276e[_0x41d11d['field']]={'$like':'%'+_0x35bc94[_0xac4a('0x40')]['filter']+'%'};return _0x19276e;}})});}_0x4b9faf=_[_0xac4a('0x4c')]({},_0x4b9faf,_0x35bc94[_0xac4a('0x50')]);var _0x136a65={'where':_0x4b9faf['where']};return db['MailAccount'][_0xac4a('0x51')](_0x136a65)['then'](function(_0x18ae96){_0x4319a1['count']=_0x18ae96;if(_0x35bc94[_0xac4a('0x40')]['includeAll']){_0x4b9faf[_0xac4a('0x52')]=[{'all':!![]}];}return db[_0xac4a('0x3c')][_0xac4a('0x53')](_0x4b9faf);})[_0xac4a('0x33')](function(_0x54782f){_0x4319a1[_0xac4a('0x54')]=_0x54782f;return _0x4319a1;})[_0xac4a('0x33')](respondWithFilteredResult(_0x2e76e3,_0x4b9faf))[_0xac4a('0x28')](handleError(_0x2e76e3,null));};exports[_0xac4a('0x55')]=function(_0x2f30e2,_0x138876){var _0x187306={'raw':![],'where':{'id':_0x2f30e2[_0xac4a('0x56')]['id']},'include':[{'model':db[_0xac4a('0x57')],'as':'Imap'},{'model':db[_0xac4a('0x58')],'as':_0xac4a('0x59')},{'model':db[_0xac4a('0x3a')],'as':_0xac4a('0x3b')}]},_0x4e6e19={};_0x4e6e19['model']=_[_0xac4a('0x3f')](db[_0xac4a('0x3c')][_0xac4a('0x3d')]);_0x4e6e19[_0xac4a('0x40')]=_[_0xac4a('0x3f')](_0x2f30e2['query']);_0x4e6e19[_0xac4a('0x41')]=_['intersection'](_0x4e6e19[_0xac4a('0x3e')],_0x4e6e19[_0xac4a('0x40')]);_0x187306['attributes']=_['intersection'](_0x4e6e19[_0xac4a('0x3e')],qs[_0xac4a('0x43')](_0x2f30e2['query'][_0xac4a('0x43')]));_0x187306[_0xac4a('0x44')]=_0x187306[_0xac4a('0x44')][_0xac4a('0x45')]?_0x187306['attributes']:_0x4e6e19[_0xac4a('0x3e')];if(_0x2f30e2[_0xac4a('0x40')][_0xac4a('0x5a')]){_0x187306[_0xac4a('0x52')]=[{'all':!![]}];}_0x187306=_[_0xac4a('0x4c')]({},_0x187306,_0x2f30e2[_0xac4a('0x50')]);return db[_0xac4a('0x3c')]['find'](_0x187306)[_0xac4a('0x33')](handleEntityNotFound(_0x138876,null))[_0xac4a('0x33')](respondWithResult(_0x138876,null))[_0xac4a('0x28')](handleError(_0x138876,null));};exports[_0xac4a('0x32')]=function(_0x1b7231,_0x2ac1e9){if(_0x1b7231[_0xac4a('0x5b')]['id']){delete _0x1b7231[_0xac4a('0x5b')]['id'];}return db[_0xac4a('0x3c')][_0xac4a('0x5c')]({'where':{'id':_0x1b7231[_0xac4a('0x56')]['id']},'include':[{'model':db[_0xac4a('0x57')],'as':_0xac4a('0x5d')},{'model':db[_0xac4a('0x58')],'as':_0xac4a('0x59')},{'model':db[_0xac4a('0x3a')],'as':'mandatoryDispositionPause'}]})[_0xac4a('0x33')](handleEntityNotFound(_0x2ac1e9,null))['then'](saveUpdates(_0x1b7231[_0xac4a('0x5b')],null))['then'](function(_0x2a30e8){if(_0x2a30e8&&_0x1b7231['body'][_0xac4a('0x5d')]){return db['MailServerIn']['update'](_0x1b7231[_0xac4a('0x5b')][_0xac4a('0x5d')],{'where':{'MailAccountId':_0x2a30e8['id']}})[_0xac4a('0x33')](function(){return _0x2a30e8;});}return _0x2a30e8;})[_0xac4a('0x33')](function(_0x2f9940){if(_0x2f9940&&_0x1b7231[_0xac4a('0x5b')]['Smtp']){return db[_0xac4a('0x58')]['update'](_0x1b7231[_0xac4a('0x5b')]['Smtp'],{'where':{'MailAccountId':_0x2f9940['id']}})[_0xac4a('0x33')](function(){return _0x2f9940;});}return _0x2f9940;})[_0xac4a('0x33')](respondWithResult(_0x2ac1e9,null))[_0xac4a('0x28')](handleError(_0x2ac1e9,null));};exports[_0xac4a('0x5e')]=function(_0x429273,_0x2bc39a){return db[_0xac4a('0x3c')][_0xac4a('0x5e')]()[_0xac4a('0x33')](respondWithResult(_0x2bc39a,null))[_0xac4a('0x28')](handleError(_0x2bc39a,null));};exports[_0xac4a('0x5f')]=function(_0x2498ad,_0x1fe05a,_0x2cc410){if(_0x2498ad[_0xac4a('0x5b')]['id']){delete _0x2498ad[_0xac4a('0x5b')]['id'];}return db[_0xac4a('0x3c')]['find']({'where':{'id':_0x2498ad[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x1fe05a,null))['then'](function(_0x3c3576){if(_0x3c3576){_0x2498ad[_0xac4a('0x5b')][_0xac4a('0x60')]=_0x3c3576['id'];return db[_0xac4a('0x61')][_0xac4a('0x62')](_0x2498ad['body']);}})['then'](respondWithResult(_0x1fe05a,null))[_0xac4a('0x28')](handleError(_0x1fe05a,null));};exports[_0xac4a('0x63')]=function(_0x158223,_0x148288,_0x1db1be){var _0x21ef8b={'raw':![],'where':{}};var _0x24b059={};var _0x2988d7={'count':0x0,'rows':[]};return db[_0xac4a('0x3c')][_0xac4a('0x64')]({'where':{'id':_0x158223[_0xac4a('0x56')]['id']}})['then'](handleEntityNotFound(_0x148288,null))['then'](function(_0x1ee825){if(_0x1ee825){_0x24b059[_0xac4a('0x3e')]=_[_0xac4a('0x3f')](db[_0xac4a('0x61')][_0xac4a('0x3d')]);_0x24b059[_0xac4a('0x40')]=_[_0xac4a('0x3f')](_0x158223[_0xac4a('0x40')]);_0x24b059[_0xac4a('0x41')]=_[_0xac4a('0x42')](_0x24b059[_0xac4a('0x3e')],_0x24b059[_0xac4a('0x40')]);_0x21ef8b['attributes']=_[_0xac4a('0x42')](_0x24b059[_0xac4a('0x3e')],qs[_0xac4a('0x43')](_0x158223[_0xac4a('0x40')]['fields']));_0x21ef8b[_0xac4a('0x44')]=_0x21ef8b['attributes'][_0xac4a('0x45')]?_0x21ef8b[_0xac4a('0x44')]:_0x24b059['model'];if(!_0x158223['query'][_0xac4a('0x46')](_0xac4a('0x47'))){_0x21ef8b[_0xac4a('0x2e')]=qs['limit'](_0x158223[_0xac4a('0x40')]['limit']);_0x21ef8b[_0xac4a('0x2d')]=qs['offset'](_0x158223['query'][_0xac4a('0x2d')]);}_0x21ef8b['order']=qs[_0xac4a('0x48')](_0x158223['query'][_0xac4a('0x48')]);_0x21ef8b[_0xac4a('0x49')]=qs['filters'](_[_0xac4a('0x4a')](_0x158223['query'],_0x24b059[_0xac4a('0x41')]));_0x21ef8b[_0xac4a('0x49')]['MailAccountId']=_0x1ee825['id'];if(_0x158223[_0xac4a('0x40')]['filter']){_0x21ef8b['where']=_[_0xac4a('0x4c')](_0x21ef8b['where'],{'$or':_[_0xac4a('0x4d')](_0x21ef8b['attributes'],function(_0x4ccd67){var _0x1588e2={};_0x1588e2[_0x4ccd67]={'$like':'%'+_0x158223[_0xac4a('0x40')][_0xac4a('0x4b')]+'%'};return _0x1588e2;})});}_0x21ef8b=_['merge']({},_0x21ef8b,_0x158223['options']);return db[_0xac4a('0x61')][_0xac4a('0x51')]({'where':_0x21ef8b['where']})['then'](function(_0x3824a2){_0x2988d7[_0xac4a('0x51')]=_0x3824a2;if(_0x158223[_0xac4a('0x40')][_0xac4a('0x5a')]){_0x21ef8b[_0xac4a('0x52')]=[{'all':!![]}];}return db[_0xac4a('0x61')][_0xac4a('0x53')](_0x21ef8b);})[_0xac4a('0x33')](function(_0x26bf73){_0x2988d7['rows']=_0x26bf73;return _0x2988d7;});}})[_0xac4a('0x33')](respondWithFilteredResult(_0x148288,_0x21ef8b))[_0xac4a('0x28')](handleError(_0x148288,null));};exports[_0xac4a('0x65')]=function(_0x582e1e,_0x1d310c,_0x46211a){return db[_0xac4a('0x3c')][_0xac4a('0x5c')]({'where':{'id':_0x582e1e[_0xac4a('0x56')]['id']}})['then'](handleEntityNotFound(_0x1d310c,null))[_0xac4a('0x33')](function(_0x19ce24){if(_0x19ce24){return _0x19ce24[_0xac4a('0x65')](_0x582e1e[_0xac4a('0x40')][_0xac4a('0x66')]);}})[_0xac4a('0x33')](respondWithStatusCode(_0x1d310c,null))[_0xac4a('0x28')](handleError(_0x1d310c,null));};exports['addAnswer']=function(_0x2e3bb7,_0x2be178,_0x19bd6f){if(_0x2e3bb7[_0xac4a('0x5b')]['id']){delete _0x2e3bb7[_0xac4a('0x5b')]['id'];}return db[_0xac4a('0x3c')]['find']({'where':{'id':_0x2e3bb7[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x2be178,null))[_0xac4a('0x33')](function(_0x284bbf){if(_0x284bbf){_0x2e3bb7['body'][_0xac4a('0x60')]=_0x284bbf['id'];return db['CannedAnswer'][_0xac4a('0x62')](_0x2e3bb7[_0xac4a('0x5b')]);}})['then'](respondWithResult(_0x2be178,null))['catch'](handleError(_0x2be178,null));};exports[_0xac4a('0x67')]=function(_0x212a22,_0x1fe86a,_0x4bb03d){var _0x1f3f1c={'raw':![],'where':{}};var _0x4814a3={};var _0x2fd565={'count':0x0,'rows':[]};return db[_0xac4a('0x3c')][_0xac4a('0x64')]({'where':{'id':_0x212a22[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x1fe86a,null))['then'](function(_0x50f471){if(_0x50f471){_0x4814a3[_0xac4a('0x3e')]=_[_0xac4a('0x3f')](db[_0xac4a('0x68')][_0xac4a('0x3d')]);_0x4814a3[_0xac4a('0x40')]=_[_0xac4a('0x3f')](_0x212a22[_0xac4a('0x40')]);_0x4814a3[_0xac4a('0x41')]=_['intersection'](_0x4814a3['model'],_0x4814a3[_0xac4a('0x40')]);_0x1f3f1c[_0xac4a('0x44')]=_[_0xac4a('0x42')](_0x4814a3[_0xac4a('0x3e')],qs[_0xac4a('0x43')](_0x212a22[_0xac4a('0x40')][_0xac4a('0x43')]));_0x1f3f1c[_0xac4a('0x44')]=_0x1f3f1c['attributes']['length']?_0x1f3f1c[_0xac4a('0x44')]:_0x4814a3[_0xac4a('0x3e')];if(!_0x212a22[_0xac4a('0x40')][_0xac4a('0x46')](_0xac4a('0x47'))){_0x1f3f1c[_0xac4a('0x2e')]=qs[_0xac4a('0x2e')](_0x212a22['query'][_0xac4a('0x2e')]);_0x1f3f1c[_0xac4a('0x2d')]=qs[_0xac4a('0x2d')](_0x212a22['query'][_0xac4a('0x2d')]);}_0x1f3f1c[_0xac4a('0x69')]=qs[_0xac4a('0x48')](_0x212a22[_0xac4a('0x40')][_0xac4a('0x48')]);_0x1f3f1c[_0xac4a('0x49')]=qs[_0xac4a('0x41')](_[_0xac4a('0x4a')](_0x212a22[_0xac4a('0x40')],_0x4814a3['filters']));_0x1f3f1c[_0xac4a('0x49')]['MailAccountId']=_0x50f471['id'];if(_0x212a22[_0xac4a('0x40')][_0xac4a('0x4b')]){_0x1f3f1c[_0xac4a('0x49')]=_[_0xac4a('0x4c')](_0x1f3f1c[_0xac4a('0x49')],{'$or':_[_0xac4a('0x4d')](_0x1f3f1c[_0xac4a('0x44')],function(_0x5266d3){var _0x2b883a={};_0x2b883a[_0x5266d3]={'$like':'%'+_0x212a22[_0xac4a('0x40')][_0xac4a('0x4b')]+'%'};return _0x2b883a;})});}_0x1f3f1c=_[_0xac4a('0x4c')]({},_0x1f3f1c,_0x212a22[_0xac4a('0x50')]);return db['CannedAnswer'][_0xac4a('0x51')]({'where':_0x1f3f1c[_0xac4a('0x49')]})['then'](function(_0x55af32){_0x2fd565[_0xac4a('0x51')]=_0x55af32;if(_0x212a22[_0xac4a('0x40')]['includeAll']){_0x1f3f1c[_0xac4a('0x52')]=[{'all':!![]}];}return db[_0xac4a('0x68')][_0xac4a('0x53')](_0x1f3f1c);})[_0xac4a('0x33')](function(_0x31df2d){_0x2fd565[_0xac4a('0x54')]=_0x31df2d;return _0x2fd565;});}})['then'](respondWithFilteredResult(_0x1fe86a,_0x1f3f1c))[_0xac4a('0x28')](handleError(_0x1fe86a,null));};exports[_0xac4a('0x6a')]=function(_0xcc495e,_0x4ba1bb,_0x2c90c9){return db[_0xac4a('0x3c')][_0xac4a('0x5c')]({'where':{'id':_0xcc495e[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x4ba1bb,null))[_0xac4a('0x33')](function(_0x5d6ef3){if(_0x5d6ef3){return _0x5d6ef3[_0xac4a('0x6a')](_0xcc495e[_0xac4a('0x40')]['ids']);}})[_0xac4a('0x33')](respondWithStatusCode(_0x4ba1bb,null))['catch'](handleError(_0x4ba1bb,null));};exports[_0xac4a('0x62')]=function(_0x388ed7,_0x534f9e){var _0x471c44={'name':_0x388ed7['body'][_0xac4a('0x38')],'key':_0x388ed7['body'][_0xac4a('0x6b')],'email':_0x388ed7[_0xac4a('0x5b')][_0xac4a('0x6c')],'ListId':_0x388ed7[_0xac4a('0x5b')][_0xac4a('0x6d')],'active':!_[_0xac4a('0x6e')](_0x388ed7[_0xac4a('0x5b')][_0xac4a('0x6f')])?_0x388ed7[_0xac4a('0x5b')][_0xac4a('0x6f')]:!![],'description':_0x388ed7[_0xac4a('0x5b')][_0xac4a('0x70')]||null,'Imap':{},'Smtp':{}};if(_[_0xac4a('0x6e')](_0x388ed7[_0xac4a('0x5b')]['cservice'])){if(_0x388ed7[_0xac4a('0x5b')][_0xac4a('0x71')]){_0x471c44['Imap'][_0xac4a('0x72')]=_0x471c44[_0xac4a('0x59')][_0xac4a('0x72')]=_0x388ed7[_0xac4a('0x5b')][_0xac4a('0x73')];_0x471c44['Imap'][_0xac4a('0x74')]=_0x471c44['Smtp'][_0xac4a('0x75')]=_0x388ed7[_0xac4a('0x5b')][_0xac4a('0x76')];}else{_0x471c44[_0xac4a('0x5d')]['authentication']=_0x471c44[_0xac4a('0x59')]['authentication']=![];}_0x471c44[_0xac4a('0x5d')][_0xac4a('0x77')]=_0x388ed7[_0xac4a('0x5b')]['Imap'][_0xac4a('0x77')];_0x471c44[_0xac4a('0x5d')][_0xac4a('0x78')]=_0x388ed7['body'][_0xac4a('0x5d')][_0xac4a('0x78')];_0x471c44[_0xac4a('0x59')][_0xac4a('0x77')]=_0x388ed7[_0xac4a('0x5b')][_0xac4a('0x59')][_0xac4a('0x77')];_0x471c44[_0xac4a('0x59')]['port']=_0x388ed7[_0xac4a('0x5b')]['Smtp']['port'];}else{_0x471c44['Imap']['service']=_0x471c44['Smtp'][_0xac4a('0x79')]=_0x388ed7[_0xac4a('0x5b')][_0xac4a('0x7a')];_0x471c44[_0xac4a('0x5d')][_0xac4a('0x72')]=_0x471c44['Smtp'][_0xac4a('0x72')]=_0x388ed7[_0xac4a('0x5b')][_0xac4a('0x73')];_0x471c44[_0xac4a('0x5d')][_0xac4a('0x74')]=_0x471c44[_0xac4a('0x59')][_0xac4a('0x75')]=_0x388ed7[_0xac4a('0x5b')]['cpassword'];}return db[_0xac4a('0x3c')][_0xac4a('0x62')](_0x471c44,{'include':[{'model':db[_0xac4a('0x58')],'as':_0xac4a('0x59')},{'model':db[_0xac4a('0x57')],'as':_0xac4a('0x5d')}]})[_0xac4a('0x33')](function(_0x5c2ce1){var _0x5c823e=_0x388ed7[_0xac4a('0x72')][_0xac4a('0x35')]({'plain':!![]});if(!_0x5c823e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c823e[_0xac4a('0x7b')]===_0xac4a('0x72')){var _0x503880=_0x5c2ce1['get']({'plain':!![]});return db[_0xac4a('0x7c')][_0xac4a('0x5c')]({'where':{'name':_0xac4a('0x7d'),'userProfileId':_0x5c823e[_0xac4a('0x7e')]},'raw':!![]})[_0xac4a('0x33')](function(_0x4ab840){if(_0x4ab840&&_0x4ab840[_0xac4a('0x7f')]===0x0){return db['UserProfileResource']['create']({'name':_0x503880['name'],'resourceId':_0x503880['id'],'type':_0x4ab840[_0xac4a('0x38')],'sectionId':_0x4ab840['id']},{})[_0xac4a('0x33')](function(){return _0x5c2ce1;});}else{return _0x5c2ce1;}})[_0xac4a('0x28')](function(_0x3b47ff){logger[_0xac4a('0x24')](_0xac4a('0x80'),_0x3b47ff);throw _0x3b47ff;});}return _0x5c2ce1;})[_0xac4a('0x33')](respondWithResult(_0x534f9e,0xc9))[_0xac4a('0x28')](handleError(_0x534f9e,null));};exports['getImap']=function(_0x5e1662,_0x53bcbc,_0x3305a5){return db[_0xac4a('0x3c')][_0xac4a('0x64')]({'where':{'id':_0x5e1662[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x53bcbc,null))[_0xac4a('0x33')](function(_0x12ce9c){if(_0x12ce9c){return _0x12ce9c[_0xac4a('0x81')]();}return null;})[_0xac4a('0x33')](respondWithResult(_0x53bcbc,null))[_0xac4a('0x28')](handleError(_0x53bcbc,null));};exports[_0xac4a('0x82')]=function(_0x37cb49,_0xe0fd57,_0x32b013){if(_0x37cb49[_0xac4a('0x5b')]['id']){delete _0x37cb49[_0xac4a('0x5b')]['id'];}return db[_0xac4a('0x3c')][_0xac4a('0x5c')]({'where':{'id':_0x37cb49[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0xe0fd57,null))[_0xac4a('0x33')](function(_0x17a1d8){if(_0x17a1d8){_0x37cb49[_0xac4a('0x5b')]['MailAccountId']=_0x17a1d8['id'];return db[_0xac4a('0x57')][_0xac4a('0x62')](_0x37cb49[_0xac4a('0x5b')]);}})[_0xac4a('0x33')](respondWithResult(_0xe0fd57,null))[_0xac4a('0x28')](handleError(_0xe0fd57,null));};exports[_0xac4a('0x83')]=function(_0x2652f5,_0x2f108d,_0x58b69f){return db['MailAccount'][_0xac4a('0x64')]({'where':{'id':_0x2652f5[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x2f108d,null))['then'](function(_0x4e0eeb){if(_0x4e0eeb){return _0x4e0eeb['setImap'](null);}return null;})[_0xac4a('0x33')](respondWithStatusCode(_0x2f108d,null))['catch'](handleError(_0x2f108d,null));};exports[_0xac4a('0x84')]=function(_0x216055,_0x52963c,_0x30490f){return db['MailAccount'][_0xac4a('0x64')]({'where':{'id':_0x216055[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x52963c,null))[_0xac4a('0x33')](function(_0x403a16){if(_0x403a16){return _0x403a16[_0xac4a('0x84')]();}return null;})['then'](respondWithResult(_0x52963c,null))[_0xac4a('0x28')](handleError(_0x52963c,null));};exports[_0xac4a('0x85')]=function(_0x2c03a1,_0x516499,_0x7fce12){if(_0x2c03a1[_0xac4a('0x5b')]['id']){delete _0x2c03a1[_0xac4a('0x5b')]['id'];}return db[_0xac4a('0x3c')]['find']({'where':{'id':_0x2c03a1[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x516499,null))[_0xac4a('0x33')](function(_0x59d982){if(_0x59d982){_0x2c03a1[_0xac4a('0x5b')][_0xac4a('0x60')]=_0x59d982['id'];return db['MailServerOut']['create'](_0x2c03a1[_0xac4a('0x5b')]);}})[_0xac4a('0x33')](respondWithResult(_0x516499,null))[_0xac4a('0x28')](handleError(_0x516499,null));};exports[_0xac4a('0x86')]=function(_0x2c594b,_0x1a12a2,_0x4bb704){return db[_0xac4a('0x3c')]['findOne']({'where':{'id':_0x2c594b[_0xac4a('0x56')]['id']}})['then'](handleEntityNotFound(_0x1a12a2,null))[_0xac4a('0x33')](function(_0x13b938){if(_0x13b938){return _0x13b938[_0xac4a('0x87')](null);}return null;})[_0xac4a('0x33')](respondWithStatusCode(_0x1a12a2,null))['catch'](handleError(_0x1a12a2,null));};exports[_0xac4a('0x88')]=function(_0x1954fe,_0x7a25b0,_0x45dff4){return db[_0xac4a('0x89')]['find']({'where':{'id':_0x1954fe[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x7a25b0,null))[_0xac4a('0x33')](function(_0x33a9b7){if(_0x33a9b7){return _0x33a9b7[_0xac4a('0x88')](_0x1954fe['body'][_0xac4a('0x66')],_[_0xac4a('0x8a')](_0x1954fe[_0xac4a('0x5b')],[_0xac4a('0x66'),'id'])||{});}})[_0xac4a('0x33')](respondWithResult(_0x7a25b0,null))['catch'](handleError(_0x7a25b0,null));};exports['getInteractions']=function(_0x47d4ef,_0x50d438,_0x271e7e){var _0x9e3c9f={'raw':![],'where':{}};var _0x17f815={};var _0x3062b9={'count':0x0,'rows':[]};return db[_0xac4a('0x3c')]['findOne']({'where':{'id':_0x47d4ef[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x50d438,null))['then'](function(_0x3b1533){if(_0x3b1533){_0x17f815[_0xac4a('0x3e')]=_[_0xac4a('0x3f')](db['MailInteraction'][_0xac4a('0x3d')]);_0x17f815[_0xac4a('0x40')]=_[_0xac4a('0x3f')](_0x47d4ef[_0xac4a('0x40')]);_0x17f815[_0xac4a('0x41')]=_[_0xac4a('0x42')](_0x17f815[_0xac4a('0x3e')],_0x17f815[_0xac4a('0x40')]);_0x9e3c9f[_0xac4a('0x44')]=_['intersection'](_0x17f815[_0xac4a('0x3e')],qs[_0xac4a('0x43')](_0x47d4ef['query'][_0xac4a('0x43')]));_0x9e3c9f['attributes']=_0x9e3c9f[_0xac4a('0x44')][_0xac4a('0x45')]?_0x9e3c9f['attributes']:_0x17f815[_0xac4a('0x3e')];if(!_0x47d4ef[_0xac4a('0x40')][_0xac4a('0x46')](_0xac4a('0x47'))){_0x9e3c9f[_0xac4a('0x2e')]=qs[_0xac4a('0x2e')](_0x47d4ef[_0xac4a('0x40')][_0xac4a('0x2e')]);_0x9e3c9f['offset']=qs['offset'](_0x47d4ef[_0xac4a('0x40')]['offset']);}_0x9e3c9f['order']=qs[_0xac4a('0x48')](_0x47d4ef[_0xac4a('0x40')][_0xac4a('0x48')]);_0x9e3c9f['where']=qs[_0xac4a('0x41')](_[_0xac4a('0x4a')](_0x47d4ef['query'],_0x17f815['filters']));_0x9e3c9f[_0xac4a('0x49')][_0xac4a('0x60')]=_0x3b1533['id'];if(_0x47d4ef[_0xac4a('0x40')][_0xac4a('0x4b')]){_0x9e3c9f['where']=_[_0xac4a('0x4c')](_0x9e3c9f[_0xac4a('0x49')],{'$or':_[_0xac4a('0x4d')](_0x9e3c9f['attributes'],function(_0x3d9ddc){var _0x3d5bc2={};_0x3d5bc2[_0x3d9ddc]={'$like':'%'+_0x47d4ef[_0xac4a('0x40')][_0xac4a('0x4b')]+'%'};return _0x3d5bc2;})});}_0x9e3c9f=_[_0xac4a('0x4c')]({},_0x9e3c9f,_0x47d4ef['options']);return db['MailInteraction'][_0xac4a('0x51')]({'where':_0x9e3c9f[_0xac4a('0x49')]})[_0xac4a('0x33')](function(_0x110e16){_0x3062b9[_0xac4a('0x51')]=_0x110e16;if(_0x47d4ef[_0xac4a('0x40')][_0xac4a('0x5a')]){_0x9e3c9f[_0xac4a('0x52')]=[{'model':db[_0xac4a('0x8b')],'as':_0xac4a('0x8c'),'required':![]},{'model':db[_0xac4a('0x8d')],'as':_0xac4a('0x8e'),'attributes':[_0xac4a('0x38'),'fullname',_0xac4a('0x8f')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xac4a('0x38'),_0xac4a('0x90')],'where':_0x47d4ef[_0xac4a('0x40')][_0xac4a('0x91')]?{'id':_0x47d4ef[_0xac4a('0x40')][_0xac4a('0x91')]}:undefined,'required':_0x47d4ef[_0xac4a('0x40')][_0xac4a('0x91')]?!![]:![]}];}return db[_0xac4a('0x89')]['findAll'](_0x9e3c9f);})[_0xac4a('0x33')](function(_0x24b1e7){_0x3062b9[_0xac4a('0x54')]=_0x24b1e7;return _0x3062b9;});}})[_0xac4a('0x33')](respondWithFilteredResult(_0x50d438,_0x9e3c9f))['catch'](handleError(_0x50d438,null));};exports['addApplications']=function(_0xf95ce1,_0x1da257,_0x20da5e){return db[_0xac4a('0x3c')][_0xac4a('0x64')]({'where':{'id':_0xf95ce1[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x1da257,null))[_0xac4a('0x33')](function(_0x1cde3d){if(_0x1cde3d){return db['sequelize'][_0xac4a('0x92')](function(_0x3b23b2){return db[_0xac4a('0x93')][_0xac4a('0x34')]({'where':{'MailAccountId':_0xf95ce1[_0xac4a('0x56')]['id']},'transaction':_0x3b23b2})[_0xac4a('0x33')](function(_0x5c67ad){var _0x4a1133=_['map'](_0xf95ce1[_0xac4a('0x5b')],function(_0x321072){_0x321072['MailAccountId']=_0xf95ce1['params']['id'];return _0x321072;});return db[_0xac4a('0x93')]['bulkCreate'](_0x4a1133,{'transaction':_0x3b23b2});});})[_0xac4a('0x33')](function(){return db['MailApplication'][_0xac4a('0x94')]({'where':{'MailAccountId':_0xf95ce1[_0xac4a('0x56')]['id']},'order':_0xac4a('0x95')});});}})['then'](respondWithResult(_0x1da257,null))[_0xac4a('0x28')](handleError(_0x1da257,null));};exports[_0xac4a('0x96')]=function(_0x5be4bb,_0x208f15,_0x1ae287){var _0x5888d8={};var _0x48a75c={};var _0x4514a5;var _0x45f6a3;return db[_0xac4a('0x3c')][_0xac4a('0x64')]({'where':{'id':_0x5be4bb[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x208f15,null))[_0xac4a('0x33')](function(_0x1ea4ef){if(_0x1ea4ef){_0x4514a5=_0x1ea4ef;_0x48a75c[_0xac4a('0x3e')]=_[_0xac4a('0x3f')](db[_0xac4a('0x93')][_0xac4a('0x3d')]);_0x48a75c[_0xac4a('0x40')]=_[_0xac4a('0x3f')](_0x5be4bb[_0xac4a('0x40')]);_0x48a75c[_0xac4a('0x41')]=_[_0xac4a('0x42')](_0x48a75c['model'],_0x48a75c[_0xac4a('0x40')]);_0x5888d8['attributes']=_[_0xac4a('0x42')](_0x48a75c[_0xac4a('0x3e')],qs[_0xac4a('0x43')](_0x5be4bb[_0xac4a('0x40')][_0xac4a('0x43')]));_0x5888d8[_0xac4a('0x44')]=_0x5888d8[_0xac4a('0x44')]['length']?_0x5888d8[_0xac4a('0x44')]:_0x48a75c['model'];_0x5888d8[_0xac4a('0x69')]=qs[_0xac4a('0x48')](_0x5be4bb[_0xac4a('0x40')][_0xac4a('0x48')]);_0x5888d8[_0xac4a('0x49')]=qs[_0xac4a('0x41')](_[_0xac4a('0x4a')](_0x5be4bb[_0xac4a('0x40')],_0x48a75c['filters']));if(_0x5be4bb[_0xac4a('0x40')][_0xac4a('0x4b')]){_0x5888d8[_0xac4a('0x49')]=_[_0xac4a('0x4c')](_0x5888d8['where'],{'$or':_[_0xac4a('0x4d')](_0x5888d8[_0xac4a('0x44')],function(_0x38ecd8){var _0x53ce1f={};_0x53ce1f[_0x38ecd8]={'$like':'%'+_0x5be4bb['query'][_0xac4a('0x4b')]+'%'};return _0x53ce1f;})});}_0x5888d8=_['merge']({},_0x5888d8,_0x5be4bb[_0xac4a('0x50')]);return _0x4514a5['getApplications'](_0x5888d8);}})['then'](function(_0x337608){if(_0x337608){_0x45f6a3=_0x337608[_0xac4a('0x45')];if(!_0x5be4bb[_0xac4a('0x40')]['hasOwnProperty'](_0xac4a('0x47'))){_0x5888d8[_0xac4a('0x2e')]=qs['limit'](_0x5be4bb[_0xac4a('0x40')][_0xac4a('0x2e')]);_0x5888d8['offset']=qs[_0xac4a('0x2d')](_0x5be4bb[_0xac4a('0x40')][_0xac4a('0x2d')]);}return _0x4514a5[_0xac4a('0x96')](_0x5888d8);}})[_0xac4a('0x33')](function(_0xf88cb9){if(_0xf88cb9){return _0xf88cb9?{'count':_0x45f6a3,'rows':_0xf88cb9}:null;}})[_0xac4a('0x33')](respondWithResult(_0x208f15,null))[_0xac4a('0x28')](handleError(_0x208f15,null));};exports['getMessages']=function(_0x8f5e42,_0x53efb5,_0x49d5cd){var _0x40ed20={'raw':!![],'where':{}};var _0x208d85={};var _0x13201f={'count':0x0,'rows':[]};return db[_0xac4a('0x3c')][_0xac4a('0x64')]({'where':{'id':_0x8f5e42['params']['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x53efb5,null))[_0xac4a('0x33')](function(_0x44e239){if(_0x44e239){_0x208d85[_0xac4a('0x3e')]=_[_0xac4a('0x3f')](db[_0xac4a('0x97')][_0xac4a('0x3d')]);_0x208d85[_0xac4a('0x40')]=_['keys'](_0x8f5e42[_0xac4a('0x40')]);_0x208d85['filters']=_[_0xac4a('0x42')](_0x208d85[_0xac4a('0x3e')],_0x208d85[_0xac4a('0x40')]);_0x40ed20[_0xac4a('0x44')]=_['intersection'](_0x208d85['model'],qs[_0xac4a('0x43')](_0x8f5e42[_0xac4a('0x40')][_0xac4a('0x43')]));_0x40ed20[_0xac4a('0x44')]=_0x40ed20[_0xac4a('0x44')][_0xac4a('0x45')]?_0x40ed20['attributes']:_0x208d85[_0xac4a('0x3e')];if(!_0x8f5e42[_0xac4a('0x40')][_0xac4a('0x46')]('nolimit')){_0x40ed20[_0xac4a('0x2e')]=qs[_0xac4a('0x2e')](_0x8f5e42[_0xac4a('0x40')]['limit']);_0x40ed20['offset']=qs[_0xac4a('0x2d')](_0x8f5e42[_0xac4a('0x40')][_0xac4a('0x2d')]);}_0x40ed20[_0xac4a('0x69')]=qs[_0xac4a('0x48')](_0x8f5e42[_0xac4a('0x40')][_0xac4a('0x48')]);_0x40ed20[_0xac4a('0x49')]=qs[_0xac4a('0x41')](_['pick'](_0x8f5e42['query'],_0x208d85[_0xac4a('0x41')]));_0x40ed20[_0xac4a('0x49')][_0xac4a('0x60')]=_0x44e239['id'];if(_0x8f5e42['query'][_0xac4a('0x4b')]){_0x40ed20[_0xac4a('0x49')]=_[_0xac4a('0x4c')](_0x40ed20['where'],{'$or':_['map'](_0x40ed20[_0xac4a('0x44')],function(_0x56e3c4){var _0x12b470={};_0x12b470[_0x56e3c4]={'$like':'%'+_0x8f5e42[_0xac4a('0x40')]['filter']+'%'};return _0x12b470;})});}if(_0x8f5e42[_0xac4a('0x40')][_0xac4a('0x98')]){var _0x4cc6b7=_0x8f5e42[_0xac4a('0x40')][_0xac4a('0x98')][_0xac4a('0x99')](',');var _0x304f70={};_0x304f70[_0x4cc6b7[0x0]]={'$gte':moment(_0x4cc6b7[0x1])[_0xac4a('0x9a')](_0xac4a('0x9b'))};_0x40ed20[_0xac4a('0x49')]=_[_0xac4a('0x4c')](_0x40ed20[_0xac4a('0x49')],_0x304f70);}_0x40ed20=_['merge']({},_0x40ed20,_0x8f5e42[_0xac4a('0x50')]);return db[_0xac4a('0x97')]['count']({'where':_0x40ed20['where']})['then'](function(_0x12fec5){_0x13201f[_0xac4a('0x51')]=_0x12fec5;if(_0x8f5e42[_0xac4a('0x40')][_0xac4a('0x5a')]){_0x40ed20[_0xac4a('0x52')]=[{'all':!![]}];}return db[_0xac4a('0x97')][_0xac4a('0x53')](_0x40ed20);})[_0xac4a('0x33')](function(_0x53831f){_0x13201f['rows']=_0x53831f;return _0x13201f;});}})['then'](respondWithFilteredResult(_0x53efb5,_0x40ed20))[_0xac4a('0x28')](handleError(_0x53efb5,null));};exports['send']=function(_0x53306c,_0x41fe6a,_0x51e282){var _0x5e7995,_0x5b5a41={},_0x1df306;if(_0x53306c[_0xac4a('0x5b')]['to']){_0x1df306=_0x53306c[_0xac4a('0x5b')]['to'][_0xac4a('0x99')](',')[0x0];}return db[_0xac4a('0x3c')][_0xac4a('0x5c')]({'where':{'id':_0x53306c[_0xac4a('0x56')]['id']},'include':[{'model':db[_0xac4a('0x9c')],'as':_0xac4a('0x9d'),'include':[{'model':db[_0xac4a('0x8b')],'as':_0xac4a('0x9e'),'where':{'email':_0x1df306},'limit':0x1,'order':[[_0xac4a('0x9f'),_0xac4a('0xa0')]]}]},{'model':db['MailServerOut'],'as':_0xac4a('0x59'),'raw':!![]}]})['then'](handleEntityNotFound(_0x41fe6a,null))[_0xac4a('0x33')](function(_0x28140b){if(_0x28140b){_0x5e7995=_0x28140b;if(_0x28140b[_0xac4a('0x59')]){if(_[_0xac4a('0x6e')](_0x53306c[_0xac4a('0x5b')][_0xac4a('0xa1')])){_0x53306c['body'][_0xac4a('0xa1')]=util[_0xac4a('0x9a')](_0xac4a('0xa2'),_0x28140b['name'],_0x28140b[_0xac4a('0x6c')]||_0x28140b['Smtp'][_0xac4a('0x72')]);}if(_0x53306c[_0xac4a('0x5b')][_0xac4a('0xa3')]&&_0x53306c['body'][_0xac4a('0xa3')][_0xac4a('0x45')]){for(var _0x526df2=0x0;_0x526df2<_0x53306c[_0xac4a('0x5b')][_0xac4a('0xa3')]['length'];_0x526df2+=0x1){_0x53306c[_0xac4a('0x5b')]['attachments'][_0x526df2]={'filename':_0x53306c[_0xac4a('0x5b')][_0xac4a('0xa3')][_0x526df2]['name'],'path':path['join'](config['root'],'server/files/attachments',_0x53306c[_0xac4a('0x5b')]['attachments'][_0x526df2][_0xac4a('0xa4')])};}}var _0x3f83dc={'tls':{'rejectUnauthorized':![]}};if(_[_0xac4a('0x6e')](_0x28140b['Smtp'][_0xac4a('0x79')])){if(_0x28140b[_0xac4a('0x59')][_0xac4a('0xa5')]){_0x3f83dc['auth']={'user':_0x28140b[_0xac4a('0x59')]['user'],'pass':_0x28140b[_0xac4a('0x59')][_0xac4a('0x75')]};}_0x3f83dc['host']=_0x28140b[_0xac4a('0x59')][_0xac4a('0x77')];_0x3f83dc[_0xac4a('0x78')]=_0x28140b[_0xac4a('0x59')]['port'];_0x3f83dc[_0xac4a('0xa6')]=_0x28140b[_0xac4a('0x59')][_0xac4a('0xa6')];}else{_0x3f83dc[_0xac4a('0x79')]=_0x28140b[_0xac4a('0x59')][_0xac4a('0x79')];_0x3f83dc[_0xac4a('0xa7')]={'user':_0x28140b['Smtp']['user'],'pass':_0x28140b['Smtp'][_0xac4a('0x75')]};}return respondWithRpcPromise(_0xac4a('0xa8'),'sendMail',{'account':_0x3f83dc,'message':_0x53306c[_0xac4a('0x5b')]});}else{throw new Error(_0xac4a('0xa9'));}}})[_0xac4a('0x33')](function(_0xfe4e8f){if(_0xfe4e8f){_0x5b5a41=_0xfe4e8f;if(_0x5e7995['List']){if(_0x5e7995[_0xac4a('0x9d')]['Contacts'][_0xac4a('0x45')]){return _0x5e7995[_0xac4a('0x9d')]['Contacts'][0x0];}else{return db[_0xac4a('0x8b')]['create'](_['defaults'](_0x53306c['body'],{'firstName':_0x53306c[_0xac4a('0x5b')]['to'],'email':_0x53306c[_0xac4a('0x5b')]['to'],'phone':_0x53306c['body']['to'],'ListId':_0x5e7995[_0xac4a('0x6d')]}));}}else{throw new Error(_0xac4a('0xa9'));}}})[_0xac4a('0x33')](function(_0x209fa5){if(_0x209fa5){var _0x280793={'UserId':_0x53306c[_0xac4a('0x72')]['id'],'ContactId':_0x209fa5['id'],'MailAccountId':_0x5e7995['id'],'inReplyTo':_0x5b5a41[_0xac4a('0xaa')],'to':_0x53306c[_0xac4a('0x5b')][_0xac4a('0xa1')],'cc':_0x53306c[_0xac4a('0x5b')]['cc'],'subject':_0x53306c[_0xac4a('0x5b')][_0xac4a('0xab')],'attach':_0x53306c['body']['attach'],'firstMsgDirection':_0xac4a('0xac'),'lastMsgAt':moment()[_0xac4a('0x9a')](_0xac4a('0x9b')),'lastMsgDirection':_0xac4a('0xac'),'lastMsgBody':_0x53306c[_0xac4a('0x5b')]['body'],'Messages':[_[_0xac4a('0x4c')](_0x53306c['body'],{'messageId':_0x5b5a41['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x5e7995['id'],'UserId':_0x53306c[_0xac4a('0x72')]['id'],'ContactId':_0x209fa5['id']})]};if(_0x53306c[_0xac4a('0x5b')]['Interaction']){_0x280793=_[_0xac4a('0x4c')](_0x280793,_0x53306c['body'][_0xac4a('0xad')]);}return db[_0xac4a('0x89')][_0xac4a('0x62')](_0x280793,{'include':[{'model':db['MailMessage'],'as':_0xac4a('0xae')}]});}})[_0xac4a('0x33')](respondWithResult(_0x41fe6a,null))['catch'](handleError(_0x41fe6a,null));};exports[_0xac4a('0xaf')]=function(_0xa6ba37,_0x59ec2d,_0x333d3a){return db[_0xac4a('0x3c')][_0xac4a('0x5c')]({'where':{'id':_0xa6ba37[_0xac4a('0x56')]['id']},'include':[{'model':db[_0xac4a('0x58')],'as':_0xac4a('0x59'),'raw':!![]}]})['then'](handleEntityNotFound(_0x59ec2d,null))[_0xac4a('0x33')](function(_0x3618ec){if(_0x3618ec&&_0x3618ec[_0xac4a('0x59')]){var _0x21a22f={'id':_0x3618ec['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3618ec['Smtp'][_0xac4a('0x79')]){_0x21a22f['service']=_0x3618ec[_0xac4a('0x59')][_0xac4a('0x79')];}else{_0x21a22f[_0xac4a('0x77')]=_0x3618ec[_0xac4a('0x59')][_0xac4a('0x77')];_0x21a22f[_0xac4a('0x78')]=_0x3618ec[_0xac4a('0x59')][_0xac4a('0x78')];_0x21a22f['secure']=_0x3618ec['Smtp'][_0xac4a('0xa6')];}if(_0x3618ec[_0xac4a('0x59')][_0xac4a('0xa5')]){_0x21a22f[_0xac4a('0xa7')]={'user':_0x3618ec['Smtp'][_0xac4a('0x72')],'pass':_0x3618ec[_0xac4a('0x59')][_0xac4a('0x75')]};}return respondWithRpcPromise(_0xac4a('0xb0'),_0xac4a('0xaf'),{'account':_0x21a22f});}})[_0xac4a('0x33')](respondWithResult(_0x59ec2d,null))[_0xac4a('0x28')](handleError(_0x59ec2d,null));};exports[_0xac4a('0x34')]=function(_0x445733,_0x5c00da){return db[_0xac4a('0x3c')]['find']({'where':{'id':_0x445733[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x5c00da,null))[_0xac4a('0x33')](function(_0x331247){if(_0x331247&&_0x331247[_0xac4a('0x79')]){throw new db[(_0xac4a('0xb1'))][(_0xac4a('0xb2'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x331247;})[_0xac4a('0x33')](removeEntity(_0x5c00da,null))[_0xac4a('0x28')](handleError(_0x5c00da,null));};exports['addAgents']=function(_0x39dc87,_0x41c5f9,_0x327420){return db[_0xac4a('0x3c')][_0xac4a('0x5c')]({'where':{'id':_0x39dc87['params']['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x41c5f9,null))[_0xac4a('0x33')](function(_0x1e7fd8){if(_0x1e7fd8){return _0x1e7fd8[_0xac4a('0xb3')](_0x39dc87['body']['ids'],_[_0xac4a('0x8a')](_0x39dc87['body'],[_0xac4a('0x66'),'id'])||{})[_0xac4a('0xb4')](function(_0x2840cf){for(var _0x186db8=0x0;_0x186db8<_0x39dc87[_0xac4a('0x5b')][_0xac4a('0x66')][_0xac4a('0x45')];_0x186db8+=0x1){socket[_0xac4a('0xb5')](_0xac4a('0xb6'),{'UserId':_0x39dc87[_0xac4a('0x5b')][_0xac4a('0x66')][_0x186db8],'MailAccountId':_0x39dc87['params']['id']});}return _0x2840cf;});}})['then'](respondWithResult(_0x41c5f9,null))[_0xac4a('0x28')](handleError(_0x41c5f9,null));};exports[_0xac4a('0xb7')]=function(_0x21dda5,_0x482c0e,_0x548b76){return db[_0xac4a('0x3c')][_0xac4a('0x5c')]({'where':{'id':_0x21dda5['params']['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x482c0e,null))[_0xac4a('0x33')](function(_0x48cef4){if(_0x48cef4){return _0x48cef4[_0xac4a('0xb7')](_0x21dda5[_0xac4a('0x40')]['ids'])[_0xac4a('0x33')](function(){if(_['isArray'](_0x21dda5[_0xac4a('0x40')][_0xac4a('0x66')])){for(var _0x35c58e=0x0;_0x35c58e<_0x21dda5['query'][_0xac4a('0x66')][_0xac4a('0x45')];_0x35c58e+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x21dda5[_0xac4a('0x40')][_0xac4a('0x66')][_0x35c58e]),'MailAccountId':Number(_0x21dda5[_0xac4a('0x56')]['id'])});}}else{socket['emit'](_0xac4a('0xb8'),{'UserId':Number(_0x21dda5[_0xac4a('0x40')][_0xac4a('0x66')]),'MailAccountId':Number(_0x21dda5[_0xac4a('0x56')]['id'])});}});}})[_0xac4a('0x33')](respondWithStatusCode(_0x482c0e,null))[_0xac4a('0x28')](handleError(_0x482c0e,null));};exports[_0xac4a('0xb9')]=function(_0x3f4f8e,_0x1a3563,_0x45a61d){var _0x1caa69={};var _0x54a5a1={};var _0x5bec66;var _0x578d0d;return db[_0xac4a('0x3c')][_0xac4a('0x64')]({'where':{'id':_0x3f4f8e[_0xac4a('0x56')]['id']}})[_0xac4a('0x33')](handleEntityNotFound(_0x1a3563,null))[_0xac4a('0x33')](function(_0x578002){if(_0x578002){_0x5bec66=_0x578002;_0x54a5a1[_0xac4a('0x3e')]=_['keys'](db[_0xac4a('0x8d')][_0xac4a('0x3d')]);_0x54a5a1['query']=_[_0xac4a('0x3f')](_0x3f4f8e['query']);_0x54a5a1[_0xac4a('0x41')]=_[_0xac4a('0x42')](_0x54a5a1[_0xac4a('0x3e')],_0x54a5a1[_0xac4a('0x40')]);_0x1caa69['attributes']=_[_0xac4a('0x42')](_0x54a5a1[_0xac4a('0x3e')],qs['fields'](_0x3f4f8e[_0xac4a('0x40')]['fields']));_0x1caa69[_0xac4a('0x44')]=_0x1caa69[_0xac4a('0x44')][_0xac4a('0x45')]?_0x1caa69['attributes']:_0x54a5a1[_0xac4a('0x3e')];_0x1caa69[_0xac4a('0x69')]=qs[_0xac4a('0x48')](_0x3f4f8e['query'][_0xac4a('0x48')]);_0x1caa69['where']=qs[_0xac4a('0x41')](_[_0xac4a('0x4a')](_0x3f4f8e[_0xac4a('0x40')],_0x54a5a1[_0xac4a('0x41')]));if(_0x3f4f8e[_0xac4a('0x40')][_0xac4a('0x4b')]){_0x1caa69[_0xac4a('0x49')]=_[_0xac4a('0x4c')](_0x1caa69['where'],{'$or':_[_0xac4a('0x4d')](_0x1caa69[_0xac4a('0x44')],function(_0x2e7a80){var _0x4a9ed9={};_0x4a9ed9[_0x2e7a80]={'$like':'%'+_0x3f4f8e[_0xac4a('0x40')]['filter']+'%'};return _0x4a9ed9;})});}_0x1caa69=_[_0xac4a('0x4c')]({},_0x1caa69,_0x3f4f8e[_0xac4a('0x50')]);return _0x5bec66[_0xac4a('0xb9')](_0x1caa69);}})[_0xac4a('0x33')](function(_0xe863b3){if(_0xe863b3){_0x578d0d=_0xe863b3[_0xac4a('0x45')];if(!_0x3f4f8e['query'][_0xac4a('0x46')](_0xac4a('0x47'))){_0x1caa69[_0xac4a('0x2e')]=qs[_0xac4a('0x2e')](_0x3f4f8e[_0xac4a('0x40')]['limit']);_0x1caa69[_0xac4a('0x2d')]=qs['offset'](_0x3f4f8e[_0xac4a('0x40')][_0xac4a('0x2d')]);}return _0x5bec66['getAgents'](_0x1caa69);}})[_0xac4a('0x33')](function(_0x5da07c){if(_0x5da07c){return _0x5da07c?{'count':_0x578d0d,'rows':_0x5da07c}:null;}})[_0xac4a('0x33')](respondWithResult(_0x1a3563,null))['catch'](handleError(_0x1a3563,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index b8f069e..8ae1f73 100644 --- a/server/api/mailAccount/mailAccount.events.js +++ b/server/api/mailAccount/mailAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf539=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','update','remove'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf539,0x180));var _0x9f53=function(_0x13c748,_0x40f675){_0x13c748=_0x13c748-0x0;var _0x33e0e0=_0xf539[_0x13c748];return _0x33e0e0;};'use strict';var EventEmitter=require(_0x9f53('0x0'));var MailAccount=require(_0x9f53('0x1'))['db'][_0x9f53('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x9f53('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9f53('0x4'),'afterDestroy':_0x9f53('0x5')};function emitEvent(_0x5ee652){return function(_0x12c0c4,_0x3d0247,_0x24f43d){MailAccountEvents['emit'](_0x5ee652+':'+_0x12c0c4['id'],_0x12c0c4);MailAccountEvents[_0x9f53('0x6')](_0x5ee652,_0x12c0c4);_0x24f43d(null);};}for(var e in events){if(events[_0x9f53('0x7')](e)){var event=events[e];MailAccount[_0x9f53('0x8')](e,emitEvent(event));}}module[_0x9f53('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x7605=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7605,0x185));var _0x5760=function(_0x401ead,_0x3183cf){_0x401ead=_0x401ead-0x0;var _0x7b7a69=_0x7605[_0x401ead];return _0x7b7a69;};'use strict';var EventEmitter=require(_0x5760('0x0'));var MailAccount=require(_0x5760('0x1'))['db'][_0x5760('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x5760('0x3')](0x0);var events={'afterCreate':_0x5760('0x4'),'afterUpdate':_0x5760('0x5'),'afterDestroy':_0x5760('0x6')};function emitEvent(_0x50be83){return function(_0x55fd42,_0x1e167c,_0x4e8a7e){MailAccountEvents['emit'](_0x50be83+':'+_0x55fd42['id'],_0x55fd42);MailAccountEvents[_0x5760('0x7')](_0x50be83,_0x55fd42);_0x4e8a7e(null);};}for(var e in events){if(events[_0x5760('0x8')](e)){var event=events[e];MailAccount[_0x5760('0x9')](e,emitEvent(event));}}module[_0x5760('0xa')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index bb1db79..20f27c5 100644 --- a/server/api/mailAccount/mailAccount.model.js +++ b/server/api/mailAccount/mailAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb49=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','MailAccount','mail_accounts'];(function(_0x55d24c,_0x5a0c49){var _0x5baea6=function(_0x3fa87f){while(--_0x3fa87f){_0x55d24c['push'](_0x55d24c['shift']());}};_0x5baea6(++_0x5a0c49);}(_0xdb49,0x1c8));var _0x9db4=function(_0x4f0c15,_0x3d1795){_0x4f0c15=_0x4f0c15-0x0;var _0x2f9e14=_0xdb49[_0x4f0c15];return _0x2f9e14;};'use strict';var _=require(_0x9db4('0x0'));var util=require(_0x9db4('0x1'));var logger=require(_0x9db4('0x2'))(_0x9db4('0x3'));var moment=require(_0x9db4('0x4'));var BPromise=require(_0x9db4('0x5'));var rp=require(_0x9db4('0x6'));var fs=require('fs');var path=require(_0x9db4('0x7'));var rimraf=require(_0x9db4('0x8'));var config=require('../../config/environment');var attributes=require('./mailAccount.attributes');module[_0x9db4('0x9')]=function(_0x13ccd4,_0x55d77d){return _0x13ccd4['define'](_0x9db4('0xa'),attributes,{'tableName':_0x9db4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1874=['rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x548261,_0x2bff36){var _0x3b7d9c=function(_0x223a60){while(--_0x223a60){_0x548261['push'](_0x548261['shift']());}};_0x3b7d9c(++_0x2bff36);}(_0x1874,0x10b));var _0x4187=function(_0x5ec827,_0x45bac2){_0x5ec827=_0x5ec827-0x0;var _0x437c60=_0x1874[_0x5ec827];return _0x437c60;};'use strict';var _=require(_0x4187('0x0'));var util=require(_0x4187('0x1'));var logger=require(_0x4187('0x2'))(_0x4187('0x3'));var moment=require(_0x4187('0x4'));var BPromise=require('bluebird');var rp=require(_0x4187('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4187('0x6'));var config=require(_0x4187('0x7'));var attributes=require(_0x4187('0x8'));module[_0x4187('0x9')]=function(_0x3a46b7,_0x1826a0){return _0x3a46b7[_0x4187('0xa')](_0x4187('0xb'),attributes,{'tableName':_0x4187('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 7c4431c..3686637 100644 --- a/server/api/mailAccount/mailAccount.rpc.js +++ b/server/api/mailAccount/mailAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55e0=['update','format','interaction','get','created','contact','attachments','originTo','originCc','bcc','Attachments','UserId','User','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./mailAccount.socket','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','map','model','then','ShowMailAccount','find','NotifyMailAccount','mail','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','MailApplication','MailServerOut','account','omit','Applications','applications','list','priority','asc','push','close','*,*,*,*','length','defaults','create','List\x20not\x20found','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Contact\x20not\x20found','spread'];(function(_0x4428f5,_0x5630ec){var _0x1f8d32=function(_0x1b215a){while(--_0x1b215a){_0x4428f5['push'](_0x4428f5['shift']());}};_0x1f8d32(++_0x5630ec);}(_0x55e0,0xdc));var _0x055e=function(_0x298c85,_0x1c06e0){_0x298c85=_0x298c85-0x0;var _0x58664f=_0x55e0[_0x298c85];return _0x58664f;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232c});config[_0x055e('0xa')]=_['defaults'](config[_0x055e('0xa')],{'host':_0x055e('0xb'),'port':0x18eb});var socket=require(_0x055e('0xc'))(new Redis(config[_0x055e('0xa')]));require(_0x055e('0xd'))['register'](socket);function respondWithRpcPromise(_0x40779c,_0xd67814,_0xb816c){return new BPromise(function(_0xa0d384,_0x238068){return client['request'](_0x40779c,_0xb816c)['then'](function(_0x187cce){logger['info'](_0x055e('0xe'),_0xd67814,_0x055e('0xf'));logger[_0x055e('0x10')](_0x055e('0x11'),_0xd67814,_0x055e('0xf'),JSON[_0x055e('0x12')](_0x187cce));if(_0x187cce[_0x055e('0x13')]){if(_0x187cce['error'][_0x055e('0x14')]===0x1f4){logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);return _0x238068(_0x187cce['error'][_0x055e('0x15')]);}logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce['error'][_0x055e('0x15')]);return _0xa0d384(_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);}else{logger[_0x055e('0x16')](_0x055e('0xe'),_0xd67814,'request\x20sent');_0xa0d384(_0x187cce[_0x055e('0x17')][_0x055e('0x15')]);}})[_0x055e('0x18')](function(_0x2ed6fb){logger['error'](_0x055e('0xe'),_0xd67814,_0x2ed6fb);_0x238068(_0x2ed6fb);});});}exports[_0x055e('0x19')]=function(_0x58e44a){var _0xe2b7b5=this;return new Promise(function(_0x4412f9,_0x10258f){return db[_0x055e('0x1a')][_0x055e('0x1b')]({'raw':_0x58e44a[_0x055e('0x1c')]?_0x58e44a['options'][_0x055e('0x1d')]===undefined?!![]:![]:!![],'where':_0x58e44a[_0x055e('0x1c')]?_0x58e44a[_0x055e('0x1c')]['where']||null:null,'attributes':_0x58e44a[_0x055e('0x1c')]?_0x58e44a[_0x055e('0x1c')][_0x055e('0x1e')]||null:null,'limit':_0x58e44a[_0x055e('0x1c')]?_0x58e44a['options'][_0x055e('0x1f')]||null:null,'include':_0x58e44a['options']?_0x58e44a[_0x055e('0x1c')][_0x055e('0x20')]?_[_0x055e('0x21')](_0x58e44a[_0x055e('0x1c')][_0x055e('0x20')],function(_0x4c653c){return{'model':db[_0x4c653c['model']],'as':_0x4c653c['as'],'attributes':_0x4c653c[_0x055e('0x1e')],'include':_0x4c653c[_0x055e('0x20')]?_[_0x055e('0x21')](_0x4c653c['include'],function(_0x408e38){return{'model':db[_0x408e38[_0x055e('0x22')]],'as':_0x408e38['as'],'attributes':_0x408e38[_0x055e('0x1e')],'include':_0x408e38[_0x055e('0x20')]?_['map'](_0x408e38[_0x055e('0x20')],function(_0x5958ef){return{'model':db[_0x5958ef[_0x055e('0x22')]],'as':_0x5958ef['as'],'attributes':_0x5958ef[_0x055e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x055e('0x23')](function(_0x7822db){logger[_0x055e('0x16')]('GetMailAccount',_0x58e44a);logger[_0x055e('0x10')](_0x055e('0x19'),_0x58e44a,JSON[_0x055e('0x12')](_0x7822db));_0x4412f9(_0x7822db);})[_0x055e('0x18')](function(_0x36abb2){logger[_0x055e('0x13')](_0x055e('0x19'),_0x36abb2[_0x055e('0x15')],_0x58e44a);_0x10258f(_0xe2b7b5['error'](0x1f4,_0x36abb2[_0x055e('0x15')]));});});};exports[_0x055e('0x24')]=function(_0x5cfeea){var _0xd9298d=this;return new Promise(function(_0x1319bd,_0x524344){return db[_0x055e('0x1a')][_0x055e('0x25')]({'raw':_0x5cfeea[_0x055e('0x1c')]?_0x5cfeea['options']['raw']===undefined?!![]:![]:!![],'where':_0x5cfeea[_0x055e('0x1c')]?_0x5cfeea['options']['where']||null:null,'attributes':_0x5cfeea['options']?_0x5cfeea[_0x055e('0x1c')][_0x055e('0x1e')]||null:null,'include':_0x5cfeea[_0x055e('0x1c')]?_0x5cfeea[_0x055e('0x1c')][_0x055e('0x20')]?_[_0x055e('0x21')](_0x5cfeea[_0x055e('0x1c')][_0x055e('0x20')],function(_0x42a33e){return{'model':db[_0x42a33e[_0x055e('0x22')]],'as':_0x42a33e['as'],'attributes':_0x42a33e[_0x055e('0x1e')],'include':_0x42a33e[_0x055e('0x20')]?_['map'](_0x42a33e['include'],function(_0x44fda3){return{'model':db[_0x44fda3[_0x055e('0x22')]],'as':_0x44fda3['as'],'attributes':_0x44fda3[_0x055e('0x1e')],'include':_0x44fda3[_0x055e('0x20')]?_[_0x055e('0x21')](_0x44fda3[_0x055e('0x20')],function(_0xb08e29){return{'model':db[_0xb08e29['model']],'as':_0xb08e29['as'],'attributes':_0xb08e29[_0x055e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x055e('0x23')](function(_0x3e9d25){logger[_0x055e('0x16')](_0x055e('0x24'),_0x5cfeea);logger['debug'](_0x055e('0x24'),_0x5cfeea,JSON[_0x055e('0x12')](_0x3e9d25));_0x1319bd(_0x3e9d25);})['catch'](function(_0x39ecd7){logger[_0x055e('0x13')]('ShowMailAccount',_0x39ecd7[_0x055e('0x15')],_0x5cfeea);_0x524344(_0xd9298d[_0x055e('0x13')](0x1f4,_0x39ecd7['message']));});});};exports[_0x055e('0x26')]=function(_0x233423){var _0x49c3e1=this;return new Promise(function(_0x1012a4,_0x12699a){var _0x1478c2={'body':_0x233423['body'],'channel':_0x055e('0x27')};var _0x1dd07b=_['difference'](_[_0x055e('0x28')](db[_0x055e('0x29')][_0x055e('0x2a')]),['createdAt',_0x055e('0x2b'),_0x055e('0x2c'),_0x055e('0x2d')]);var _0x4fa534=![];if(_0x233423['body']['id']){delete _0x233423[_0x055e('0x2e')]['id'];}if(_[_0x055e('0x2f')](_0x233423['body'][_0x055e('0x30')])){return _0x12699a(_0x49c3e1['error'](0x1f4,_0x055e('0x31')));}if(_['isNil'](_0x233423[_0x055e('0x2e')][_0x055e('0x2e')])||_0x233423[_0x055e('0x2e')]['body']===''){return _0x12699a(_0x49c3e1['error'](0x1f4,_0x055e('0x32')));}if(_[_0x055e('0x2f')](_0x233423[_0x055e('0x2e')][_0x055e('0x33')])){return _0x12699a(_0x49c3e1['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1dd07b));}if(!_[_0x055e('0x34')](_0x1dd07b,_0x233423[_0x055e('0x2e')]['mapKey'])){return _0x12699a(_0x49c3e1[_0x055e('0x13')](0x1f4,_0x055e('0x35')+_0x1dd07b));}var _0xcb7d81={};_0xcb7d81[_0x233423[_0x055e('0x2e')][_0x055e('0x33')]]=_0x233423[_0x055e('0x2e')]['from'];return db[_0x055e('0x1a')][_0x055e('0x25')]({'where':{'id':_0x233423['account']['id']},'include':[{'model':db[_0x055e('0x36')],'as':_0x055e('0x37'),'include':[{'model':db[_0x055e('0x29')],'as':_0x055e('0x38'),'where':_0xcb7d81,'limit':0x1,'order':[[_0x055e('0x2b'),_0x055e('0x39')]]}]},{'model':db[_0x055e('0x3a')],'as':'Applications'},{'model':db[_0x055e('0x3b')],'as':'Smtp'}]})[_0x055e('0x23')](function(_0xed7611){if(_0xed7611&&_0xed7611[_0x055e('0x37')]){var _0x5d3e2a=_0xed7611['get']({'plain':!![]});_0x1478c2[_0x055e('0x3c')]=_[_0x055e('0x3d')](_0x5d3e2a,[_0x055e('0x3e'),_0x055e('0x37')]);_0x1478c2[_0x055e('0x3f')]=_0x5d3e2a[_0x055e('0x3e')];_0x1478c2[_0x055e('0x40')]=_0x5d3e2a[_0x055e('0x37')];_0x1478c2[_0x055e('0x3f')]=_['orderBy'](_0x1478c2[_0x055e('0x3f')],[_0x055e('0x41')],[_0x055e('0x42')]);if(_0x1478c2[_0x055e('0x3c')]&&_0x1478c2[_0x055e('0x3c')]['autoclose']){_0x1478c2[_0x055e('0x3f')][_0x055e('0x43')]({'id':0x0,'priority':_0x1478c2[_0x055e('0x3f')]['length']+0x1,'app':_0x055e('0x44'),'appdata':'autoclose','interval':_0x055e('0x45')});}if(_0x1478c2[_0x055e('0x3c')]['Applications']){delete _0x1478c2[_0x055e('0x3c')][_0x055e('0x3e')];}if(_0x1478c2[_0x055e('0x3c')]['List']){delete _0x1478c2['account'][_0x055e('0x37')];}if(_0x5d3e2a[_0x055e('0x37')][_0x055e('0x38')][_0x055e('0x46')]){return _0x5d3e2a[_0x055e('0x37')][_0x055e('0x38')][0x0];}var _0x473e7a=_[_0x055e('0x47')](_0x233423[_0x055e('0x2e')],{'firstName':_0x233423[_0x055e('0x2e')]['from'],'ListId':_0x5d3e2a[_0x055e('0x2d')]});_0x473e7a[_0x233423[_0x055e('0x2e')][_0x055e('0x33')]]=_0x233423[_0x055e('0x2e')]['from'];return db[_0x055e('0x29')][_0x055e('0x48')](_0x473e7a);}else{throw new Error(_0x055e('0x49'));}})[_0x055e('0x23')](function(_0x59fe11){_0x1478c2['contact']=_0x59fe11;if(_0x59fe11){if(!_0x233423[_0x055e('0x2e')][_0x055e('0x15')][_0x055e('0x4a')]){_0x233423[_0x055e('0x2e')][_0x055e('0x15')][_0x055e('0x4a')]=rs[_0x055e('0x4b')]()+'\x20'+_0x233423[_0x055e('0x2e')]['message']['from'];}var _0x1df839={'ContactId':_0x59fe11['id'],'MailAccountId':_0x233423[_0x055e('0x3c')]['id'],'inReplyTo':_0x233423['body'][_0x055e('0x15')][_0x055e('0x4a')],'to':_0x233423[_0x055e('0x2e')][_0x055e('0x15')]['from'],'cc':_0x233423[_0x055e('0x2e')][_0x055e('0x15')]['cc'],'subject':_0x233423[_0x055e('0x2e')][_0x055e('0x15')][_0x055e('0x4c')],'attach':_0x233423[_0x055e('0x2e')][_0x055e('0x15')][_0x055e('0x4d')],'lastMsgAt':moment()['format'](_0x055e('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x233423[_0x055e('0x2e')]['body']};return db[_0x055e('0x4f')][_0x055e('0x25')]({'where':{'closed':![],'MailAccountId':_0x233423[_0x055e('0x3c')]['id']},'include':[{'model':db[_0x055e('0x50')],'as':'Messages','attributes':[_0x055e('0x4a')],'where':{'messageId':_0x233423[_0x055e('0x2e')][_0x055e('0x15')]['inReplyTo']}}]})[_0x055e('0x23')](function(_0x4337c7){if(_0x4337c7){return[_0x4337c7,![]];}return db[_0x055e('0x4f')][_0x055e('0x48')](_0x1df839)[_0x055e('0x23')](function(_0x584e60){return[_0x584e60,!![]];});});}else{throw new Error(_0x055e('0x51'));}})[_0x055e('0x52')](function(_0x1166b5,_0x2934bf){if(_0x1166b5){_0x4fa534=_0x2934bf;if(!_0x2934bf){return _0x1166b5[_0x055e('0x53')]({'inReplyTo':_0x233423['body'][_0x055e('0x15')][_0x055e('0x4a')],'to':_0x233423[_0x055e('0x2e')]['message'][_0x055e('0x30')],'cc':_0x233423[_0x055e('0x2e')][_0x055e('0x15')]['cc'],'subject':_0x233423[_0x055e('0x2e')][_0x055e('0x15')]['subject'],'attach':_0x1166b5[_0x055e('0x4d')]?_0x1166b5['attach']:_0x233423[_0x055e('0x2e')][_0x055e('0x15')]['attach'],'substatus':null,'substatusAt':moment()[_0x055e('0x54')](_0x055e('0x4e')),'lastMsgAt':moment()[_0x055e('0x54')](_0x055e('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x233423['body']['body']});}else{return _0x1166b5;}}})[_0x055e('0x23')](function(_0x5e4f42){_0x1478c2[_0x055e('0x55')]=_0x5e4f42[_0x055e('0x56')]({'plain':!![]});_0x1478c2[_0x055e('0x55')][_0x055e('0x57')]=_0x4fa534;return db[_0x055e('0x50')][_0x055e('0x48')]({'body':_0x233423[_0x055e('0x2e')][_0x055e('0x2e')],'MailAccountId':_0x233423[_0x055e('0x3c')]['id'],'MailInteractionId':_0x5e4f42['id'],'direction':'in','ContactId':_0x1478c2[_0x055e('0x58')]['id'],'messageId':_0x233423['body']['message'][_0x055e('0x4a')],'from':_0x233423[_0x055e('0x2e')]['message'][_0x055e('0x30')],'to':_0x233423['body'][_0x055e('0x15')]['to'],'cc':_0x233423[_0x055e('0x2e')][_0x055e('0x15')]['cc'],'subject':_0x233423[_0x055e('0x2e')][_0x055e('0x15')][_0x055e('0x4c')],'attach':_0x233423[_0x055e('0x2e')][_0x055e('0x15')]['attach'],'Attachments':_0x233423[_0x055e('0x2e')][_0x055e('0x15')][_0x055e('0x59')],'originTo':_0x233423[_0x055e('0x2e')][_0x055e('0x15')][_0x055e('0x5a')],'originCc':_0x233423[_0x055e('0x2e')][_0x055e('0x15')][_0x055e('0x5b')],'bcc':_0x233423['body'][_0x055e('0x15')][_0x055e('0x5c')]},{'include':[{'model':db['Attachment'],'as':_0x055e('0x5d')}]});})[_0x055e('0x23')](function(_0x200ed2){_0x1478c2[_0x055e('0x15')]=_0x200ed2;if(_0x1478c2['interaction'][_0x055e('0x5e')]){return db[_0x055e('0x5f')][_0x055e('0x25')]({'attributes':['id',_0x055e('0x60')],'where':{'id':_0x1478c2[_0x055e('0x55')]['UserId']}})[_0x055e('0x23')](function(_0x93b842){if(_0x93b842){_0x1478c2[_0x055e('0x3f')][_0x055e('0x61')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x93b842[_0x055e('0x60')]+','+(_0x1478c2[_0x055e('0x3c')][_0x055e('0x62')]||0xa),'interval':_0x055e('0x45')});}return respondWithRpcPromise(_0x055e('0x63'),'startRouting',_0x1478c2);});}return respondWithRpcPromise(_0x055e('0x63'),_0x055e('0x64'),_0x1478c2);})[_0x055e('0x23')](function(_0x1f3ba4){_0x1012a4(_0x1f3ba4);})['catch'](function(_0x20daf0){_0x12699a(_0x49c3e1[_0x055e('0x13')](0x1f4,_0x20daf0[_0x055e('0x15')]));});});}; \ No newline at end of file +var _0x2356=['includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','account','CmList','List','Contacts','DESC','Applications','Smtp','get','omit','applications','orderBy','priority','push','length','close','autoclose','*,*,*,*','create','List\x20not\x20found','contact','generate','messageId','subject','attach','format','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','MailMessage','attachments','originCc','bcc','Attachments','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','ioredis','../../mysqldb','rpc','client','http','redis','socket.io-emitter','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailAccount','options','raw','where','attributes','limit','include','model','map','ShowMailAccount','find','body','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x22b883,_0x3a60fe){var _0x4b5ed6=function(_0x1a4aa8){while(--_0x1a4aa8){_0x22b883['push'](_0x22b883['shift']());}};_0x4b5ed6(++_0x3a60fe);}(_0x2356,0x14f));var _0x6235=function(_0x52d231,_0x37bc71){_0x52d231=_0x52d231-0x0;var _0x550ac5=_0x2356[_0x52d231];return _0x550ac5;};'use strict';var _=require('lodash');var util=require(_0x6235('0x0'));var moment=require(_0x6235('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6235('0x2'));var db=require(_0x6235('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6235('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6235('0x5')][_0x6235('0x6')]({'port':0x232c});config[_0x6235('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6235('0x8'))(new Redis(config['redis']));require(_0x6235('0x9'))[_0x6235('0xa')](socket);function respondWithRpcPromise(_0x3e0f96,_0x31fc6e,_0x5de19a){return new BPromise(function(_0x46fecf,_0x1b34a5){return client[_0x6235('0xb')](_0x3e0f96,_0x5de19a)[_0x6235('0xc')](function(_0x14342d){logger['info'](_0x6235('0xd'),_0x31fc6e,_0x6235('0xe'));logger[_0x6235('0xf')](_0x6235('0x10'),_0x31fc6e,'request\x20sent',JSON[_0x6235('0x11')](_0x14342d));if(_0x14342d[_0x6235('0x12')]){if(_0x14342d['error'][_0x6235('0x13')]===0x1f4){logger['error'](_0x6235('0xd'),_0x31fc6e,_0x14342d[_0x6235('0x12')]['message']);return _0x1b34a5(_0x14342d[_0x6235('0x12')][_0x6235('0x14')]);}logger[_0x6235('0x12')](_0x6235('0xd'),_0x31fc6e,_0x14342d['error'][_0x6235('0x14')]);return _0x46fecf(_0x14342d[_0x6235('0x12')][_0x6235('0x14')]);}else{logger[_0x6235('0x15')](_0x6235('0xd'),_0x31fc6e,_0x6235('0xe'));_0x46fecf(_0x14342d[_0x6235('0x16')][_0x6235('0x14')]);}})[_0x6235('0x17')](function(_0x1f8cd3){logger['error'](_0x6235('0xd'),_0x31fc6e,_0x1f8cd3);_0x1b34a5(_0x1f8cd3);});});}exports[_0x6235('0x18')]=function(_0x4a9846){var _0x534dab=this;return new Promise(function(_0x19075e,_0x4f0aa2){return db['MailAccount']['findAll']({'raw':_0x4a9846[_0x6235('0x19')]?_0x4a9846[_0x6235('0x19')][_0x6235('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a9846[_0x6235('0x19')]?_0x4a9846[_0x6235('0x19')][_0x6235('0x1b')]||null:null,'attributes':_0x4a9846['options']?_0x4a9846['options'][_0x6235('0x1c')]||null:null,'limit':_0x4a9846['options']?_0x4a9846[_0x6235('0x19')][_0x6235('0x1d')]||null:null,'include':_0x4a9846[_0x6235('0x19')]?_0x4a9846[_0x6235('0x19')][_0x6235('0x1e')]?_['map'](_0x4a9846[_0x6235('0x19')][_0x6235('0x1e')],function(_0x168b01){return{'model':db[_0x168b01[_0x6235('0x1f')]],'as':_0x168b01['as'],'attributes':_0x168b01[_0x6235('0x1c')],'include':_0x168b01['include']?_['map'](_0x168b01['include'],function(_0x4f28f2){return{'model':db[_0x4f28f2[_0x6235('0x1f')]],'as':_0x4f28f2['as'],'attributes':_0x4f28f2[_0x6235('0x1c')],'include':_0x4f28f2[_0x6235('0x1e')]?_[_0x6235('0x20')](_0x4f28f2[_0x6235('0x1e')],function(_0x2acc8c){return{'model':db[_0x2acc8c['model']],'as':_0x2acc8c['as'],'attributes':_0x2acc8c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x94db3c){logger['info'](_0x6235('0x18'),_0x4a9846);logger[_0x6235('0xf')]('GetMailAccount',_0x4a9846,JSON[_0x6235('0x11')](_0x94db3c));_0x19075e(_0x94db3c);})[_0x6235('0x17')](function(_0x5bb691){logger[_0x6235('0x12')](_0x6235('0x18'),_0x5bb691[_0x6235('0x14')],_0x4a9846);_0x4f0aa2(_0x534dab[_0x6235('0x12')](0x1f4,_0x5bb691[_0x6235('0x14')]));});});};exports[_0x6235('0x21')]=function(_0x281e01){var _0x43a430=this;return new Promise(function(_0x2bdeda,_0x2e233d){return db['MailAccount'][_0x6235('0x22')]({'raw':_0x281e01['options']?_0x281e01['options'][_0x6235('0x1a')]===undefined?!![]:![]:!![],'where':_0x281e01['options']?_0x281e01['options'][_0x6235('0x1b')]||null:null,'attributes':_0x281e01['options']?_0x281e01['options'][_0x6235('0x1c')]||null:null,'include':_0x281e01[_0x6235('0x19')]?_0x281e01[_0x6235('0x19')]['include']?_[_0x6235('0x20')](_0x281e01[_0x6235('0x19')][_0x6235('0x1e')],function(_0x4db26d){return{'model':db[_0x4db26d[_0x6235('0x1f')]],'as':_0x4db26d['as'],'attributes':_0x4db26d['attributes'],'include':_0x4db26d[_0x6235('0x1e')]?_[_0x6235('0x20')](_0x4db26d[_0x6235('0x1e')],function(_0xcb0901){return{'model':db[_0xcb0901[_0x6235('0x1f')]],'as':_0xcb0901['as'],'attributes':_0xcb0901['attributes'],'include':_0xcb0901[_0x6235('0x1e')]?_['map'](_0xcb0901[_0x6235('0x1e')],function(_0x706301){return{'model':db[_0x706301[_0x6235('0x1f')]],'as':_0x706301['as'],'attributes':_0x706301[_0x6235('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6235('0xc')](function(_0x4f0461){logger['info'](_0x6235('0x21'),_0x281e01);logger[_0x6235('0xf')](_0x6235('0x21'),_0x281e01,JSON[_0x6235('0x11')](_0x4f0461));_0x2bdeda(_0x4f0461);})[_0x6235('0x17')](function(_0x4057aa){logger[_0x6235('0x12')](_0x6235('0x21'),_0x4057aa[_0x6235('0x14')],_0x281e01);_0x2e233d(_0x43a430[_0x6235('0x12')](0x1f4,_0x4057aa['message']));});});};exports['NotifyMailAccount']=function(_0x4d1cac){var _0x50537b=this;return new Promise(function(_0x585744,_0x1f32ed){var _0x3c2935={'body':_0x4d1cac[_0x6235('0x23')],'channel':'mail'};var _0x4054fe=_['difference'](_[_0x6235('0x24')](db[_0x6235('0x25')][_0x6235('0x26')]),[_0x6235('0x27'),_0x6235('0x28'),_0x6235('0x29'),_0x6235('0x2a')]);var _0x13f974=![];if(_0x4d1cac['body']['id']){delete _0x4d1cac['body']['id'];}if(_[_0x6235('0x2b')](_0x4d1cac['body'][_0x6235('0x2c')])){return _0x1f32ed(_0x50537b[_0x6235('0x12')](0x1f4,_0x6235('0x2d')));}if(_[_0x6235('0x2b')](_0x4d1cac[_0x6235('0x23')][_0x6235('0x23')])||_0x4d1cac[_0x6235('0x23')]['body']===''){return _0x1f32ed(_0x50537b[_0x6235('0x12')](0x1f4,_0x6235('0x2e')));}if(_[_0x6235('0x2b')](_0x4d1cac['body'][_0x6235('0x2f')])){return _0x1f32ed(_0x50537b[_0x6235('0x12')](0x1f4,_0x6235('0x30')+_0x4054fe));}if(!_[_0x6235('0x31')](_0x4054fe,_0x4d1cac[_0x6235('0x23')][_0x6235('0x2f')])){return _0x1f32ed(_0x50537b[_0x6235('0x12')](0x1f4,_0x6235('0x32')+_0x4054fe));}var _0x596f24={};_0x596f24[_0x4d1cac[_0x6235('0x23')][_0x6235('0x2f')]]=_0x4d1cac[_0x6235('0x23')]['from'];return db[_0x6235('0x33')][_0x6235('0x22')]({'where':{'id':_0x4d1cac[_0x6235('0x34')]['id']},'include':[{'model':db[_0x6235('0x35')],'as':_0x6235('0x36'),'include':[{'model':db[_0x6235('0x25')],'as':_0x6235('0x37'),'where':_0x596f24,'limit':0x1,'order':[[_0x6235('0x28'),_0x6235('0x38')]]}]},{'model':db['MailApplication'],'as':_0x6235('0x39')},{'model':db['MailServerOut'],'as':_0x6235('0x3a')}]})[_0x6235('0xc')](function(_0xe997ab){if(_0xe997ab&&_0xe997ab['List']){var _0x53c398=_0xe997ab[_0x6235('0x3b')]({'plain':!![]});_0x3c2935[_0x6235('0x34')]=_[_0x6235('0x3c')](_0x53c398,[_0x6235('0x39'),'List']);_0x3c2935[_0x6235('0x3d')]=_0x53c398[_0x6235('0x39')];_0x3c2935['list']=_0x53c398[_0x6235('0x36')];_0x3c2935['applications']=_[_0x6235('0x3e')](_0x3c2935[_0x6235('0x3d')],[_0x6235('0x3f')],['asc']);if(_0x3c2935[_0x6235('0x34')]&&_0x3c2935['account']['autoclose']){_0x3c2935['applications'][_0x6235('0x40')]({'id':0x0,'priority':_0x3c2935[_0x6235('0x3d')][_0x6235('0x41')]+0x1,'app':_0x6235('0x42'),'appdata':_0x6235('0x43'),'interval':_0x6235('0x44')});}if(_0x3c2935[_0x6235('0x34')]['Applications']){delete _0x3c2935[_0x6235('0x34')][_0x6235('0x39')];}if(_0x3c2935[_0x6235('0x34')][_0x6235('0x36')]){delete _0x3c2935['account'][_0x6235('0x36')];}if(_0x53c398[_0x6235('0x36')][_0x6235('0x37')]['length']){return _0x53c398[_0x6235('0x36')]['Contacts'][0x0];}var _0x4a4ad3=_['defaults'](_0x4d1cac[_0x6235('0x23')],{'firstName':_0x4d1cac['body'][_0x6235('0x2c')],'ListId':_0x53c398[_0x6235('0x2a')]});_0x4a4ad3[_0x4d1cac[_0x6235('0x23')]['mapKey']]=_0x4d1cac[_0x6235('0x23')]['from'];return db[_0x6235('0x25')][_0x6235('0x45')](_0x4a4ad3);}else{throw new Error(_0x6235('0x46'));}})[_0x6235('0xc')](function(_0x76bd9e){_0x3c2935[_0x6235('0x47')]=_0x76bd9e;if(_0x76bd9e){if(!_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')]['messageId']){_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')]['messageId']=rs[_0x6235('0x48')]()+'\x20'+_0x4d1cac['body']['message'][_0x6235('0x2c')];}var _0x5d3dd2={'ContactId':_0x76bd9e['id'],'MailAccountId':_0x4d1cac[_0x6235('0x34')]['id'],'inReplyTo':_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')][_0x6235('0x49')],'to':_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')][_0x6235('0x2c')],'cc':_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')]['cc'],'subject':_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')][_0x6235('0x4a')],'attach':_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')][_0x6235('0x4b')],'lastMsgAt':moment()[_0x6235('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x4d1cac[_0x6235('0x23')][_0x6235('0x23')]};return db['MailInteraction'][_0x6235('0x22')]({'where':{'closed':![],'MailAccountId':_0x4d1cac[_0x6235('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0x6235('0x4d'),'attributes':[_0x6235('0x49')],'where':{'messageId':_0x4d1cac['body'][_0x6235('0x14')][_0x6235('0x4e')]}}]})[_0x6235('0xc')](function(_0x557496){if(_0x557496){return[_0x557496,![]];}return db[_0x6235('0x4f')][_0x6235('0x45')](_0x5d3dd2)['then'](function(_0x5169f3){return[_0x5169f3,!![]];});});}else{throw new Error(_0x6235('0x50'));}})[_0x6235('0x51')](function(_0x39fab0,_0xcd5157){if(_0x39fab0){_0x13f974=_0xcd5157;if(!_0xcd5157){return _0x39fab0[_0x6235('0x52')]({'inReplyTo':_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')][_0x6235('0x49')],'to':_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')][_0x6235('0x2c')],'cc':_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')]['cc'],'subject':_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')][_0x6235('0x4a')],'attach':_0x39fab0[_0x6235('0x4b')]?_0x39fab0[_0x6235('0x4b')]:_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')]['attach'],'substatus':null,'substatusAt':moment()[_0x6235('0x4c')](_0x6235('0x53')),'lastMsgAt':moment()[_0x6235('0x4c')](_0x6235('0x53')),'lastMsgDirection':'in','lastMsgBody':_0x4d1cac[_0x6235('0x23')][_0x6235('0x23')]});}else{return _0x39fab0;}}})['then'](function(_0x8943b1){_0x3c2935['interaction']=_0x8943b1[_0x6235('0x3b')]({'plain':!![]});_0x3c2935['interaction']['created']=_0x13f974;return db[_0x6235('0x54')][_0x6235('0x45')]({'body':_0x4d1cac[_0x6235('0x23')][_0x6235('0x23')],'MailAccountId':_0x4d1cac[_0x6235('0x34')]['id'],'MailInteractionId':_0x8943b1['id'],'direction':'in','ContactId':_0x3c2935[_0x6235('0x47')]['id'],'messageId':_0x4d1cac[_0x6235('0x23')]['message'][_0x6235('0x49')],'from':_0x4d1cac[_0x6235('0x23')]['message'][_0x6235('0x2c')],'to':_0x4d1cac[_0x6235('0x23')]['message']['to'],'cc':_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')]['cc'],'subject':_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')][_0x6235('0x4a')],'attach':_0x4d1cac['body'][_0x6235('0x14')][_0x6235('0x4b')],'Attachments':_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')][_0x6235('0x55')],'originTo':_0x4d1cac[_0x6235('0x23')]['message']['originTo'],'originCc':_0x4d1cac[_0x6235('0x23')][_0x6235('0x14')][_0x6235('0x56')],'bcc':_0x4d1cac['body'][_0x6235('0x14')][_0x6235('0x57')]},{'include':[{'model':db['Attachment'],'as':_0x6235('0x58')}]});})[_0x6235('0xc')](function(_0x563d20){_0x3c2935[_0x6235('0x14')]=_0x563d20;if(_0x3c2935['interaction'][_0x6235('0x59')]){return db['User'][_0x6235('0x22')]({'attributes':['id',_0x6235('0x5a')],'where':{'id':_0x3c2935['interaction'][_0x6235('0x59')]}})[_0x6235('0xc')](function(_0x2d669e){if(_0x2d669e){_0x3c2935[_0x6235('0x3d')][_0x6235('0x5b')]({'id':0x0,'priority':0x0,'app':_0x6235('0x5c'),'appdata':_0x2d669e[_0x6235('0x5a')]+','+(_0x3c2935[_0x6235('0x34')][_0x6235('0x5d')]||0xa),'interval':_0x6235('0x44')});}return respondWithRpcPromise(_0x6235('0x5e'),_0x6235('0x5f'),_0x3c2935);});}return respondWithRpcPromise(_0x6235('0x5e'),_0x6235('0x5f'),_0x3c2935);})[_0x6235('0xc')](function(_0x4b5e71){_0x585744(_0x4b5e71);})['catch'](function(_0x56273b){_0x1f32ed(_0x50537b[_0x6235('0x12')](0x1f4,_0x56273b['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index ee2daa0..8f57595 100644 --- a/server/api/mailAccount/mailAccount.socket.js +++ b/server/api/mailAccount/mailAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcde7=['update','emit','removeListener','register','mailAccount:','remove'];(function(_0x4f26ca,_0x3edbd9){var _0x3a495e=function(_0x8728c7){while(--_0x8728c7){_0x4f26ca['push'](_0x4f26ca['shift']());}};_0x3a495e(++_0x3edbd9);}(_0xcde7,0x65));var _0x7cde=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xcde7[_0x4a9fb1];return _0x348672;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0x7cde('0x0'),_0x7cde('0x1')];function createListener(_0x28e237,_0x4bafa8){return function(_0x50169b){_0x4bafa8[_0x7cde('0x2')](_0x28e237,_0x50169b);};}function removeListener(_0x47962e,_0x23ec50){return function(){MailAccountEvents[_0x7cde('0x3')](_0x47962e,_0x23ec50);};}exports[_0x7cde('0x4')]=function(_0x293f70){for(var _0xbaa4b3=0x0,_0x15b9ec=events['length'];_0xbaa4b3<_0x15b9ec;_0xbaa4b3++){var _0x20e8cd=events[_0xbaa4b3];var _0x512fae=createListener(_0x7cde('0x5')+_0x20e8cd,_0x293f70);MailAccountEvents['on'](_0x20e8cd,_0x512fae);}}; \ No newline at end of file +var _0x4672=['length','mailAccount:','./mailAccount.events','remove','update','emit','removeListener'];(function(_0x1ee89b,_0x406bab){var _0xb257d7=function(_0x502915){while(--_0x502915){_0x1ee89b['push'](_0x1ee89b['shift']());}};_0xb257d7(++_0x406bab);}(_0x4672,0x18a));var _0x2467=function(_0xdd9a5f,_0x3ced93){_0xdd9a5f=_0xdd9a5f-0x0;var _0x3464b7=_0x4672[_0xdd9a5f];return _0x3464b7;};'use strict';var MailAccountEvents=require(_0x2467('0x0'));var events=['save',_0x2467('0x1'),_0x2467('0x2')];function createListener(_0x57972f,_0x3d4246){return function(_0x56aa2b){_0x3d4246[_0x2467('0x3')](_0x57972f,_0x56aa2b);};}function removeListener(_0x228e2f,_0x1368f7){return function(){MailAccountEvents[_0x2467('0x4')](_0x228e2f,_0x1368f7);};}exports['register']=function(_0x19e085){for(var _0x48674e=0x0,_0x741c4d=events[_0x2467('0x5')];_0x48674e<_0x741c4d;_0x48674e++){var _0x1e91f3=events[_0x48674e];var _0x19e43a=createListener(_0x2467('0x6')+_0x1e91f3,_0x19e085);MailAccountEvents['on'](_0x1e91f3,_0x19e43a);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 51ce285..f06e819 100644 --- a/server/api/mailApplication/index.js +++ b/server/api/mailApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa74f=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','show','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x1c7f13,_0x1a5fff){var _0x5739d2=function(_0x6c0e9f){while(--_0x6c0e9f){_0x1c7f13['push'](_0x1c7f13['shift']());}};_0x5739d2(++_0x1a5fff);}(_0xa74f,0x9a));var _0xfa74=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0xa74f[_0x5235dd];return _0x13059d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa74('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa74('0x1')]();var auth=require(_0xfa74('0x2'));var interaction=require(_0xfa74('0x3'));var config=require(_0xfa74('0x4'));var controller=require('./mailApplication.controller');router[_0xfa74('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xfa74('0x6')]);router[_0xfa74('0x7')](_0xfa74('0x8'),auth[_0xfa74('0x9')](),controller[_0xfa74('0xa')]);router[_0xfa74('0xb')]('/:id',auth[_0xfa74('0x9')](),controller[_0xfa74('0xc')]);module[_0xfa74('0xd')]=router; \ No newline at end of file +var _0x153f=['isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','/:id'];(function(_0x2a3232,_0x4001de){var _0x53ff1f=function(_0x5cbd22){while(--_0x5cbd22){_0x2a3232['push'](_0x2a3232['shift']());}};_0x53ff1f(++_0x4001de);}(_0x153f,0x15b));var _0xf153=function(_0x22811e,_0x20b881){_0x22811e=_0x22811e-0x0;var _0x2ffc2a=_0x153f[_0x22811e];return _0x2ffc2a;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var auth=require(_0xf153('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf153('0x7'));var controller=require('./mailApplication.controller');router[_0xf153('0x8')](_0xf153('0x9'),auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0xc')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0xd')]);router[_0xf153('0xe')](_0xf153('0x9'),auth[_0xf153('0xa')](),controller[_0xf153('0xf')]);module[_0xf153('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index de6d583..ce37ecc 100644 --- a/server/api/mailApplication/mailApplication.attributes.js +++ b/server/api/mailApplication/mailApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f8f=['STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0xda1be3,_0x64e291){var _0x184853=function(_0x35a607){while(--_0x35a607){_0xda1be3['push'](_0xda1be3['shift']());}};_0x184853(++_0x64e291);}(_0x6f8f,0x89));var _0xf6f8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f8f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf6f8('0x0'));module[_0xf6f8('0x1')]={'priority':{'type':Sequelize[_0xf6f8('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf6f8('0x3')],'defaultValue':_0xf6f8('0x4')}}; \ No newline at end of file +var _0xf251=['sequelize','INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf251,0xf0));var _0x1f25=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0xf251[_0x10f6e8];return _0x35bb3c;};'use strict';var Sequelize=require(_0x1f25('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1f25('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x1f25('0x2')]()},'description':{'type':Sequelize[_0x1f25('0x3')]},'interval':{'type':Sequelize[_0x1f25('0x3')],'defaultValue':_0x1f25('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 02dbabc..d6ebecd 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x68fc=['sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','MailApplication','catch','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','path'];(function(_0x2bd1f5,_0x8db4ec){var _0x43a4b3=function(_0x41cdf6){while(--_0x41cdf6){_0x2bd1f5['push'](_0x2bd1f5['shift']());}};_0x43a4b3(++_0x8db4ec);}(_0x68fc,0xa5));var _0xc68f=function(_0x56552d,_0x533e1b){_0x56552d=_0x56552d-0x0;var _0xaf71fb=_0x68fc[_0x56552d];return _0xaf71fb;};'use strict';var pdf=require(_0xc68f('0x0'));var emlformat=require(_0xc68f('0x1'));var rimraf=require(_0xc68f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc68f('0x3'));var moment=require('moment');var BPromise=require(_0xc68f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc68f('0x5'));var sox=require(_0xc68f('0x6'));var csv=require(_0xc68f('0x7'));var ejs=require(_0xc68f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc68f('0x9'));var jsforce=require(_0xc68f('0xa'));var deskjs=require(_0xc68f('0xb'));var toCsv=require(_0xc68f('0x7'));var querystring=require(_0xc68f('0xc'));var Papa=require(_0xc68f('0xd'));var Redis=require(_0xc68f('0xe'));var authService=require(_0xc68f('0xf'));var qs=require(_0xc68f('0x10'));var hardwareService=require(_0xc68f('0x11'));var logger=require('../../config/logger')(_0xc68f('0x12'));var utils=require(_0xc68f('0x13'));var config=require(_0xc68f('0x14'));var db=require(_0xc68f('0x15'))['db'];function respondWithStatusCode(_0x2f0694,_0x2a0a52){_0x2a0a52=_0x2a0a52||0xcc;return function(_0x3ccebe){if(_0x3ccebe){return _0x2f0694[_0xc68f('0x16')](_0x2a0a52);}return _0x2f0694[_0xc68f('0x17')](_0x2a0a52)[_0xc68f('0x18')]();};}function respondWithResult(_0x31fb86,_0x55b0a0){_0x55b0a0=_0x55b0a0||0xc8;return function(_0x2ea1c4){if(_0x2ea1c4){return _0x31fb86[_0xc68f('0x17')](_0x55b0a0)[_0xc68f('0x19')](_0x2ea1c4);}};}function respondWithFilteredResult(_0xe6e7db,_0x286ed4){return function(_0x2673b4){if(_0x2673b4){var _0x3d1406=_0x2673b4['count'],_0x209d16=_0x286ed4[_0xc68f('0x1a')],_0x4648c6=_0x286ed4[_0xc68f('0x1a')]+_0x286ed4[_0xc68f('0x1b')],_0x5e1e5b;if(_0x4648c6>=_0x3d1406){_0x4648c6=_0x3d1406;_0x5e1e5b=0xc8;}else{_0x5e1e5b=0xce;}_0xe6e7db[_0xc68f('0x17')](_0x5e1e5b);return _0xe6e7db[_0xc68f('0x1c')](_0xc68f('0x1d'),_0x209d16+'-'+_0x4648c6+'/'+_0x3d1406)['json'](_0x2673b4);}return null;};}function patchUpdates(_0x385dbe){return function(_0x398b35){try{jsonpatch[_0xc68f('0x1e')](_0x398b35,_0x385dbe,!![]);}catch(_0x2c058c){return BPromise[_0xc68f('0x1f')](_0x2c058c);}return _0x398b35[_0xc68f('0x20')]();};}function saveUpdates(_0xa58c8d,_0x3c32c8){return function(_0x582301){if(_0x582301){return _0x582301[_0xc68f('0x21')](_0xa58c8d)[_0xc68f('0x22')](function(_0x2e27b9){return _0x2e27b9;});}return null;};}function removeEntity(_0x540ef2,_0x1dad07){return function(_0x1daac5){if(_0x1daac5){return _0x1daac5[_0xc68f('0x23')]()[_0xc68f('0x22')](function(){_0x540ef2[_0xc68f('0x17')](0xcc)[_0xc68f('0x18')]();});}};}function handleEntityNotFound(_0x2412a9,_0x547d46){return function(_0x38c3a0){if(!_0x38c3a0){_0x2412a9[_0xc68f('0x16')](0x194);}return _0x38c3a0;};}function handleError(_0x512c9c,_0x13dd7c){_0x13dd7c=_0x13dd7c||0x1f4;return function(_0x8399e6){logger[_0xc68f('0x24')](_0x8399e6[_0xc68f('0x25')]);if(_0x8399e6[_0xc68f('0x26')]){delete _0x8399e6['name'];}_0x512c9c[_0xc68f('0x17')](_0x13dd7c)[_0xc68f('0x27')](_0x8399e6);};}exports['show']=function(_0x38b935,_0x27e5b8){var _0x4d26e3={'raw':!![],'where':{'id':_0x38b935[_0xc68f('0x28')]['id']}},_0x3f6c07={};_0x3f6c07[_0xc68f('0x29')]=_[_0xc68f('0x2a')](db['MailApplication'][_0xc68f('0x2b')]);_0x3f6c07[_0xc68f('0x2c')]=_[_0xc68f('0x2a')](_0x38b935[_0xc68f('0x2c')]);_0x3f6c07[_0xc68f('0x2d')]=_[_0xc68f('0x2e')](_0x3f6c07[_0xc68f('0x29')],_0x3f6c07[_0xc68f('0x2c')]);_0x4d26e3['attributes']=_[_0xc68f('0x2e')](_0x3f6c07[_0xc68f('0x29')],qs['fields'](_0x38b935[_0xc68f('0x2c')][_0xc68f('0x2f')]));_0x4d26e3[_0xc68f('0x30')]=_0x4d26e3[_0xc68f('0x30')]['length']?_0x4d26e3[_0xc68f('0x30')]:_0x3f6c07[_0xc68f('0x29')];if(_0x38b935['query'][_0xc68f('0x31')]){_0x4d26e3[_0xc68f('0x32')]=[{'all':!![]}];}_0x4d26e3=_[_0xc68f('0x33')]({},_0x4d26e3,_0x38b935[_0xc68f('0x34')]);return db[_0xc68f('0x35')]['find'](_0x4d26e3)['then'](handleEntityNotFound(_0x27e5b8,null))[_0xc68f('0x22')](respondWithResult(_0x27e5b8,null))[_0xc68f('0x36')](handleError(_0x27e5b8,null));};exports[_0xc68f('0x21')]=function(_0x1099fe,_0x1ca5ba){if(_0x1099fe['body']['id']){delete _0x1099fe['body']['id'];}return db[_0xc68f('0x35')]['find']({'where':{'id':_0x1099fe[_0xc68f('0x28')]['id']}})[_0xc68f('0x22')](handleEntityNotFound(_0x1ca5ba,null))[_0xc68f('0x22')](saveUpdates(_0x1099fe[_0xc68f('0x37')],null))[_0xc68f('0x22')](respondWithResult(_0x1ca5ba,null))[_0xc68f('0x36')](handleError(_0x1ca5ba,null));};exports[_0xc68f('0x23')]=function(_0x5f0f39,_0x4282b7){return db[_0xc68f('0x35')][_0xc68f('0x38')]({'where':{'id':_0x5f0f39[_0xc68f('0x28')]['id']}})[_0xc68f('0x22')](handleEntityNotFound(_0x4282b7,null))[_0xc68f('0x22')](removeEntity(_0x4282b7,null))[_0xc68f('0x36')](handleError(_0x4282b7,null));}; \ No newline at end of file +var _0x8ce3=['limit','set','Content-Range','apply','save','update','then','destroy','error','stack','send','show','params','model','keys','MailApplication','rawAttributes','query','intersection','attributes','fields','length','includeAll','options','find','body','catch','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x5d0609,_0x127562){var _0xaa3fd1=function(_0x47f457){while(--_0x47f457){_0x5d0609['push'](_0x5d0609['shift']());}};_0xaa3fd1(++_0x127562);}(_0x8ce3,0xc3));var _0x38ce=function(_0x24c178,_0x2e588b){_0x24c178=_0x24c178-0x0;var _0x35a2d8=_0x8ce3[_0x24c178];return _0x35a2d8;};'use strict';var pdf=require(_0x38ce('0x0'));var emlformat=require(_0x38ce('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x38ce('0x2'));var jsonpatch=require(_0x38ce('0x3'));var rp=require(_0x38ce('0x4'));var moment=require(_0x38ce('0x5'));var BPromise=require(_0x38ce('0x6'));var Mustache=require(_0x38ce('0x7'));var util=require(_0x38ce('0x8'));var path=require(_0x38ce('0x9'));var sox=require('sox');var csv=require(_0x38ce('0xa'));var ejs=require(_0x38ce('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x38ce('0xc'));var crypto=require(_0x38ce('0xd'));var jsforce=require(_0x38ce('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x38ce('0xa'));var querystring=require('querystring');var Papa=require(_0x38ce('0xf'));var Redis=require('ioredis');var authService=require(_0x38ce('0x10'));var qs=require(_0x38ce('0x11'));var hardwareService=require(_0x38ce('0x12'));var logger=require(_0x38ce('0x13'))(_0x38ce('0x14'));var utils=require(_0x38ce('0x15'));var config=require(_0x38ce('0x16'));var db=require(_0x38ce('0x17'))['db'];function respondWithStatusCode(_0x29bd3a,_0xe33aec){_0xe33aec=_0xe33aec||0xcc;return function(_0x42e234){if(_0x42e234){return _0x29bd3a[_0x38ce('0x18')](_0xe33aec);}return _0x29bd3a[_0x38ce('0x19')](_0xe33aec)[_0x38ce('0x1a')]();};}function respondWithResult(_0x2e661b,_0x2cf066){_0x2cf066=_0x2cf066||0xc8;return function(_0x56a09f){if(_0x56a09f){return _0x2e661b['status'](_0x2cf066)[_0x38ce('0x1b')](_0x56a09f);}};}function respondWithFilteredResult(_0x2aabd8,_0x2369f3){return function(_0x55be6a){if(_0x55be6a){var _0x2f3b99=_0x55be6a['count'],_0x54fcd3=_0x2369f3[_0x38ce('0x1c')],_0x2771ec=_0x2369f3[_0x38ce('0x1c')]+_0x2369f3[_0x38ce('0x1d')],_0xe858f0;if(_0x2771ec>=_0x2f3b99){_0x2771ec=_0x2f3b99;_0xe858f0=0xc8;}else{_0xe858f0=0xce;}_0x2aabd8['status'](_0xe858f0);return _0x2aabd8[_0x38ce('0x1e')](_0x38ce('0x1f'),_0x54fcd3+'-'+_0x2771ec+'/'+_0x2f3b99)[_0x38ce('0x1b')](_0x55be6a);}return null;};}function patchUpdates(_0x311734){return function(_0x3166ab){try{jsonpatch[_0x38ce('0x20')](_0x3166ab,_0x311734,!![]);}catch(_0x2d4218){return BPromise['reject'](_0x2d4218);}return _0x3166ab[_0x38ce('0x21')]();};}function saveUpdates(_0x34a8c7,_0x280586){return function(_0x303391){if(_0x303391){return _0x303391[_0x38ce('0x22')](_0x34a8c7)[_0x38ce('0x23')](function(_0x323490){return _0x323490;});}return null;};}function removeEntity(_0x42ec06,_0xe13739){return function(_0x3cf50b){if(_0x3cf50b){return _0x3cf50b[_0x38ce('0x24')]()['then'](function(){_0x42ec06[_0x38ce('0x19')](0xcc)[_0x38ce('0x1a')]();});}};}function handleEntityNotFound(_0xe40e9c,_0xcf5d9e){return function(_0x4a56b0){if(!_0x4a56b0){_0xe40e9c[_0x38ce('0x18')](0x194);}return _0x4a56b0;};}function handleError(_0x1d192d,_0x5ae8f8){_0x5ae8f8=_0x5ae8f8||0x1f4;return function(_0xe0af00){logger[_0x38ce('0x25')](_0xe0af00[_0x38ce('0x26')]);if(_0xe0af00['name']){delete _0xe0af00['name'];}_0x1d192d[_0x38ce('0x19')](_0x5ae8f8)[_0x38ce('0x27')](_0xe0af00);};}exports[_0x38ce('0x28')]=function(_0x21d4e7,_0x264cf0){var _0x2a59fe={'raw':!![],'where':{'id':_0x21d4e7[_0x38ce('0x29')]['id']}},_0x13e2fc={};_0x13e2fc[_0x38ce('0x2a')]=_[_0x38ce('0x2b')](db[_0x38ce('0x2c')][_0x38ce('0x2d')]);_0x13e2fc['query']=_[_0x38ce('0x2b')](_0x21d4e7[_0x38ce('0x2e')]);_0x13e2fc['filters']=_[_0x38ce('0x2f')](_0x13e2fc[_0x38ce('0x2a')],_0x13e2fc['query']);_0x2a59fe[_0x38ce('0x30')]=_[_0x38ce('0x2f')](_0x13e2fc['model'],qs[_0x38ce('0x31')](_0x21d4e7['query'][_0x38ce('0x31')]));_0x2a59fe[_0x38ce('0x30')]=_0x2a59fe[_0x38ce('0x30')][_0x38ce('0x32')]?_0x2a59fe[_0x38ce('0x30')]:_0x13e2fc[_0x38ce('0x2a')];if(_0x21d4e7[_0x38ce('0x2e')][_0x38ce('0x33')]){_0x2a59fe['include']=[{'all':!![]}];}_0x2a59fe=_['merge']({},_0x2a59fe,_0x21d4e7[_0x38ce('0x34')]);return db[_0x38ce('0x2c')][_0x38ce('0x35')](_0x2a59fe)[_0x38ce('0x23')](handleEntityNotFound(_0x264cf0,null))[_0x38ce('0x23')](respondWithResult(_0x264cf0,null))['catch'](handleError(_0x264cf0,null));};exports[_0x38ce('0x22')]=function(_0x12c68b,_0x37f696){if(_0x12c68b[_0x38ce('0x36')]['id']){delete _0x12c68b[_0x38ce('0x36')]['id'];}return db[_0x38ce('0x2c')][_0x38ce('0x35')]({'where':{'id':_0x12c68b['params']['id']}})[_0x38ce('0x23')](handleEntityNotFound(_0x37f696,null))[_0x38ce('0x23')](saveUpdates(_0x12c68b['body'],null))[_0x38ce('0x23')](respondWithResult(_0x37f696,null))[_0x38ce('0x37')](handleError(_0x37f696,null));};exports[_0x38ce('0x24')]=function(_0x3e236d,_0x1eb47e){return db[_0x38ce('0x2c')][_0x38ce('0x35')]({'where':{'id':_0x3e236d[_0x38ce('0x29')]['id']}})['then'](handleEntityNotFound(_0x1eb47e,null))[_0x38ce('0x23')](removeEntity(_0x1eb47e,null))[_0x38ce('0x37')](handleError(_0x1eb47e,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index a55cfd3..a13e92c 100644 --- a/server/api/mailApplication/mailApplication.model.js +++ b/server/api/mailApplication/mailApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3f9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x5e58d7,_0x231c0c){var _0x33af8c=function(_0x527859){while(--_0x527859){_0x5e58d7['push'](_0x5e58d7['shift']());}};_0x33af8c(++_0x231c0c);}(_0xf3f9,0x1de));var _0x9f3f=function(_0x52527f,_0x1bcd93){_0x52527f=_0x52527f-0x0;var _0x5047b1=_0xf3f9[_0x52527f];return _0x5047b1;};'use strict';var _=require(_0x9f3f('0x0'));var util=require(_0x9f3f('0x1'));var logger=require('../../config/logger')(_0x9f3f('0x2'));var moment=require(_0x9f3f('0x3'));var BPromise=require(_0x9f3f('0x4'));var rp=require(_0x9f3f('0x5'));var fs=require('fs');var path=require(_0x9f3f('0x6'));var rimraf=require(_0x9f3f('0x7'));var config=require(_0x9f3f('0x8'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0xc4516a,_0x566b08){return _0xc4516a[_0x9f3f('0x9')]('MailApplication',attributes,{'tableName':_0x9f3f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9f3f('0xb'),'collate':_0x9f3f('0xc')});}; \ No newline at end of file +var _0x97b2=['api','moment','bluebird','path','rimraf','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x23db6e,_0x117915){var _0x568413=function(_0x453c88){while(--_0x453c88){_0x23db6e['push'](_0x23db6e['shift']());}};_0x568413(++_0x117915);}(_0x97b2,0x1b7));var _0x297b=function(_0x705b98,_0x1c345b){_0x705b98=_0x705b98-0x0;var _0x47b72f=_0x97b2[_0x705b98];return _0x47b72f;};'use strict';var _=require(_0x297b('0x0'));var util=require(_0x297b('0x1'));var logger=require(_0x297b('0x2'))(_0x297b('0x3'));var moment=require(_0x297b('0x4'));var BPromise=require(_0x297b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x297b('0x6'));var rimraf=require(_0x297b('0x7'));var config=require('../../config/environment');var attributes=require(_0x297b('0x8'));module[_0x297b('0x9')]=function(_0x5ef74e,_0x596f9c){return _0x5ef74e['define'](_0x297b('0xa'),attributes,{'tableName':_0x297b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x297b('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 1373ba2..8149eaf 100644 --- a/server/api/mailApplication/mailApplication.rpc.js +++ b/server/api/mailApplication/mailApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1dfa=['message','UpdateMailApplication','MailApplication','update','body','options','limit','then','info','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0x1dfa,0xb8));var _0xa1df=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x1dfa[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0xa1df('0x0'));var util=require(_0xa1df('0x1'));var moment=require('moment');var BPromise=require(_0xa1df('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1df('0x3'));var db=require(_0xa1df('0x4'))['db'];var utils=require(_0xa1df('0x5'));var logger=require(_0xa1df('0x6'))(_0xa1df('0x7'));var config=require('../../config/environment');var jayson=require(_0xa1df('0x8'));var client=jayson[_0xa1df('0x9')][_0xa1df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b917,_0xf23632,_0x1435ec){return new BPromise(function(_0x4ee163,_0x417adf){return client[_0xa1df('0xb')](_0x37b917,_0x1435ec)['then'](function(_0x419909){logger['info'](_0xa1df('0xc'),_0xf23632,'request\x20sent');logger[_0xa1df('0xd')](_0xa1df('0xe'),_0xf23632,_0xa1df('0xf'),JSON[_0xa1df('0x10')](_0x419909));if(_0x419909['error']){if(_0x419909['error'][_0xa1df('0x11')]===0x1f4){logger[_0xa1df('0x12')](_0xa1df('0xc'),_0xf23632,_0x419909[_0xa1df('0x12')][_0xa1df('0x13')]);return _0x417adf(_0x419909['error'][_0xa1df('0x13')]);}logger[_0xa1df('0x12')](_0xa1df('0xc'),_0xf23632,_0x419909['error'][_0xa1df('0x13')]);return _0x4ee163(_0x419909[_0xa1df('0x12')][_0xa1df('0x13')]);}else{logger['info'](_0xa1df('0xc'),_0xf23632,_0xa1df('0xf'));_0x4ee163(_0x419909['result']['message']);}})['catch'](function(_0x3689e8){logger[_0xa1df('0x12')]('MailApplication,\x20%s,\x20%s',_0xf23632,_0x3689e8);_0x417adf(_0x3689e8);});});}exports[_0xa1df('0x14')]=function(_0x172315){var _0x4abc60=this;return new Promise(function(_0x2f7608,_0x4f2609){return db[_0xa1df('0x15')][_0xa1df('0x16')](_0x172315[_0xa1df('0x17')],{'raw':_0x172315['options']?_0x172315[_0xa1df('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x172315['options']?_0x172315[_0xa1df('0x18')]['where']||null:null,'attributes':_0x172315[_0xa1df('0x18')]?_0x172315[_0xa1df('0x18')]['attributes']||null:null,'limit':_0x172315[_0xa1df('0x18')]?_0x172315[_0xa1df('0x18')][_0xa1df('0x19')]||null:null})[_0xa1df('0x1a')](function(_0xe9f77c){logger[_0xa1df('0x1b')](_0xa1df('0x14'),_0x172315);logger[_0xa1df('0xd')](_0xa1df('0x14'),_0x172315,JSON['stringify'](_0xe9f77c));_0x2f7608(_0xe9f77c);})[_0xa1df('0x1c')](function(_0x482601){logger['error'](_0xa1df('0x14'),_0x482601[_0xa1df('0x13')],_0x172315);_0x4f2609(_0x4abc60[_0xa1df('0x12')](0x1f4,_0x482601[_0xa1df('0x13')]));});});}; \ No newline at end of file +var _0x2087=['http','request','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailApplication','update','options','raw','where','then','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3906de,_0x5bc7e1){var _0x5d69e7=function(_0x48d350){while(--_0x48d350){_0x3906de['push'](_0x3906de['shift']());}};_0x5d69e7(++_0x5bc7e1);}(_0x2087,0xfc));var _0x7208=function(_0x3f6f53,_0x56f3e4){_0x3f6f53=_0x3f6f53-0x0;var _0x5049e9=_0x2087[_0x3f6f53];return _0x5049e9;};'use strict';var _=require(_0x7208('0x0'));var util=require(_0x7208('0x1'));var moment=require(_0x7208('0x2'));var BPromise=require(_0x7208('0x3'));var rs=require(_0x7208('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7208('0x5'));var logger=require('../../config/logger')(_0x7208('0x6'));var config=require(_0x7208('0x7'));var jayson=require(_0x7208('0x8'));var client=jayson['client'][_0x7208('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x569081,_0x5c8a67,_0x53ea39){return new BPromise(function(_0x1291b3,_0x452705){return client[_0x7208('0xa')](_0x569081,_0x53ea39)['then'](function(_0x1913ef){logger[_0x7208('0xb')](_0x7208('0xc'),_0x5c8a67,'request\x20sent');logger[_0x7208('0xd')](_0x7208('0xe'),_0x5c8a67,_0x7208('0xf'),JSON[_0x7208('0x10')](_0x1913ef));if(_0x1913ef['error']){if(_0x1913ef[_0x7208('0x11')][_0x7208('0x12')]===0x1f4){logger[_0x7208('0x11')](_0x7208('0xc'),_0x5c8a67,_0x1913ef[_0x7208('0x11')][_0x7208('0x13')]);return _0x452705(_0x1913ef[_0x7208('0x11')]['message']);}logger[_0x7208('0x11')](_0x7208('0xc'),_0x5c8a67,_0x1913ef['error'][_0x7208('0x13')]);return _0x1291b3(_0x1913ef[_0x7208('0x11')][_0x7208('0x13')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x5c8a67,'request\x20sent');_0x1291b3(_0x1913ef[_0x7208('0x14')][_0x7208('0x13')]);}})[_0x7208('0x15')](function(_0x206d94){logger[_0x7208('0x11')]('MailApplication,\x20%s,\x20%s',_0x5c8a67,_0x206d94);_0x452705(_0x206d94);});});}exports['UpdateMailApplication']=function(_0x30a54f){var _0x15755c=this;return new Promise(function(_0x9a4a26,_0x3654bc){return db[_0x7208('0x16')][_0x7208('0x17')](_0x30a54f['body'],{'raw':_0x30a54f[_0x7208('0x18')]?_0x30a54f[_0x7208('0x18')][_0x7208('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30a54f[_0x7208('0x18')]?_0x30a54f['options'][_0x7208('0x1a')]||null:null,'attributes':_0x30a54f[_0x7208('0x18')]?_0x30a54f['options']['attributes']||null:null,'limit':_0x30a54f[_0x7208('0x18')]?_0x30a54f[_0x7208('0x18')]['limit']||null:null})[_0x7208('0x1b')](function(_0xa53d66){logger[_0x7208('0xb')](_0x7208('0x1c'),_0x30a54f);logger[_0x7208('0xd')]('UpdateMailApplication',_0x30a54f,JSON['stringify'](_0xa53d66));_0x9a4a26(_0xa53d66);})[_0x7208('0x15')](function(_0x156946){logger[_0x7208('0x11')](_0x7208('0x1c'),_0x156946['message'],_0x30a54f);_0x3654bc(_0x15755c[_0x7208('0x11')](0x1f4,_0x156946[_0x7208('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 94e01f0..487d48a 100644 --- a/server/api/mailInteraction/index.js +++ b/server/api/mailInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b5b=['tracked','mail','mailinteraction:addtags','put','mailinteraction:update','update','mailinteraction:destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x0b5b,0x147));var _0xb0b5=function(_0x473420,_0xd6a26c){_0x473420=_0x473420-0x0;var _0x58fe50=_0x0b5b[_0x473420];return _0x58fe50;};'use strict';var multer=require('multer');var util=require(_0xb0b5('0x0'));var path=require(_0xb0b5('0x1'));var timeout=require(_0xb0b5('0x2'));var express=require(_0xb0b5('0x3'));var router=express[_0xb0b5('0x4')]();var auth=require(_0xb0b5('0x5'));var interaction=require(_0xb0b5('0x6'));var config=require(_0xb0b5('0x7'));var controller=require(_0xb0b5('0x8'));router['get']('/',auth[_0xb0b5('0x9')](),controller[_0xb0b5('0xa')]);router[_0xb0b5('0xb')](_0xb0b5('0xc'),auth[_0xb0b5('0x9')](),controller['describe']);router[_0xb0b5('0xb')](_0xb0b5('0xd'),auth[_0xb0b5('0x9')](),controller[_0xb0b5('0xe')]);router['get'](_0xb0b5('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0xb0b5('0xb')](_0xb0b5('0x10'),auth[_0xb0b5('0x9')](),controller['download']);router[_0xb0b5('0x11')]('/',auth[_0xb0b5('0x9')](),controller[_0xb0b5('0x12')]);router[_0xb0b5('0x11')](_0xb0b5('0xf'),auth['isAuthenticated'](),controller[_0xb0b5('0x13')]);router[_0xb0b5('0x11')](_0xb0b5('0x14'),auth['isAuthenticated'](),interaction[_0xb0b5('0x15')](_0xb0b5('0x16'),_0xb0b5('0x17')),controller['addTags']);router[_0xb0b5('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0xb0b5('0x15')](_0xb0b5('0x16'),_0xb0b5('0x19')),controller[_0xb0b5('0x1a')]);router['delete'](_0xb0b5('0xd'),auth[_0xb0b5('0x9')](),interaction[_0xb0b5('0x15')](_0xb0b5('0x16'),_0xb0b5('0x1b')),controller['destroy']);router['delete'](_0xb0b5('0x14'),auth[_0xb0b5('0x9')](),controller['removeTags']);module[_0xb0b5('0x1c')]=router; \ No newline at end of file +var _0x84e1=['../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','tracked','mail','mailinteraction:addtags','addTags','put','update','delete','destroy','/:id/tags','removeTags','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x8dcfd8,_0x3dbc70){var _0x5d8fdd=function(_0x30a020){while(--_0x30a020){_0x8dcfd8['push'](_0x8dcfd8['shift']());}};_0x5d8fdd(++_0x3dbc70);}(_0x84e1,0x9f));var _0x184e=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x84e1[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0x184e('0x0'));var util=require(_0x184e('0x1'));var path=require('path');var timeout=require(_0x184e('0x2'));var express=require(_0x184e('0x3'));var router=express[_0x184e('0x4')]();var auth=require(_0x184e('0x5'));var interaction=require(_0x184e('0x6'));var config=require(_0x184e('0x7'));var controller=require(_0x184e('0x8'));router[_0x184e('0x9')]('/',auth[_0x184e('0xa')](),controller[_0x184e('0xb')]);router[_0x184e('0x9')](_0x184e('0xc'),auth[_0x184e('0xa')](),controller[_0x184e('0xd')]);router[_0x184e('0x9')](_0x184e('0xe'),auth[_0x184e('0xa')](),controller[_0x184e('0xf')]);router[_0x184e('0x9')](_0x184e('0x10'),auth['isAuthenticated'](),controller[_0x184e('0x11')]);router[_0x184e('0x9')](_0x184e('0x12'),auth[_0x184e('0xa')](),controller[_0x184e('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x184e('0x14')]);router['post'](_0x184e('0x10'),auth[_0x184e('0xa')](),controller[_0x184e('0x15')]);router[_0x184e('0x16')]('/:id/tags',auth[_0x184e('0xa')](),interaction[_0x184e('0x17')](_0x184e('0x18'),_0x184e('0x19')),controller[_0x184e('0x1a')]);router[_0x184e('0x1b')](_0x184e('0xe'),auth['isAuthenticated'](),interaction[_0x184e('0x17')]('mail','mailinteraction:update'),controller[_0x184e('0x1c')]);router[_0x184e('0x1d')](_0x184e('0xe'),auth['isAuthenticated'](),interaction[_0x184e('0x17')]('mail','mailinteraction:destroy'),controller[_0x184e('0x1e')]);router[_0x184e('0x1d')](_0x184e('0x1f'),auth['isAuthenticated'](),controller[_0x184e('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index eb0e5b9..d5d1de8 100644 --- a/server/api/mailInteraction/mailInteraction.attributes.js +++ b/server/api/mailInteraction/mailInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x405f=['exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x405f,0x182));var _0xf405=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x405f[_0x24259d];return _0x5a701;};'use strict';var Sequelize=require(_0xf405('0x0'));var iconv=require('iconv');module[_0xf405('0x1')]={'closed':{'type':Sequelize[_0xf405('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf405('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf405('0x4')]},'inReplyTo':{'type':Sequelize[_0xf405('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xf405('0x5')](_0xf405('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xf405('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf405('0x3')]},'substatus':{'type':Sequelize[_0xf405('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xf405('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf405('0x7')]('in',_0xf405('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf405('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf405('0x7')]('in',_0xf405('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xf405('0x5')](_0xf405('0x6'))},'lastMsgText':{'type':Sequelize[_0xf405('0x5')](_0xf405('0x6'))}}; \ No newline at end of file +var _0x45fc=['STRING','TEXT','ENUM','out','long','sequelize','exports','BOOLEAN','DATE'];(function(_0x5ed19b,_0x510d11){var _0x3419fd=function(_0x239be8){while(--_0x239be8){_0x5ed19b['push'](_0x5ed19b['shift']());}};_0x3419fd(++_0x510d11);}(_0x45fc,0x176));var _0xc45f=function(_0x5b623e,_0x5f5c3c){_0x5b623e=_0x5b623e-0x0;var _0x464dd1=_0x45fc[_0x5b623e];return _0x464dd1;};'use strict';var Sequelize=require(_0xc45f('0x0'));var iconv=require('iconv');module[_0xc45f('0x1')]={'closed':{'type':Sequelize[_0xc45f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc45f('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc45f('0x4')]},'inReplyTo':{'type':Sequelize[_0xc45f('0x4')](0x1fe)},'to':{'type':Sequelize[_0xc45f('0x4')]},'cc':{'type':Sequelize[_0xc45f('0x5')]('long')},'subject':{'type':Sequelize[_0xc45f('0x5')]()},'attach':{'type':Sequelize[_0xc45f('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xc45f('0x3')]},'substatus':{'type':Sequelize[_0xc45f('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xc45f('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xc45f('0x6')]('in',_0xc45f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc45f('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xc45f('0x5')](_0xc45f('0x8'))},'lastMsgText':{'type':Sequelize[_0xc45f('0x5')](_0xc45f('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 140a408..5e57730 100644 --- a/server/api/mailInteraction/mailInteraction.controller.js +++ b/server/api/mailInteraction/mailInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d0d=['setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','unix','root','server','files','attachments','tmp','interaction-%s.zip','bcc','subject','Attachment','Attachments','mkdirSync','each','headers','Bcc','basename','existsSync','type','readFileSync','build','writeFileSync','message%d.eml','download','log','err','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','TagIds','forEach','Tags','push','MailInteraction','findOne','lastMsgBody','lastMsgText','trimStart','fromString','catch','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','mail_messages','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','left_join','users','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','parse','advancedFilter','createdAt','value','dateStart','startOf','day','format','utc','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','ContactId','filter','isNil','concat','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','isEmail','c.email\x20LIKE\x20?','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','Sequelize','QueryTypes','SELECT','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','sequelize','toString','count','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.id','i.createdAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.UserId','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.fax','Contact.fax','groupBy','MailInteractionId','Setting','enableEmailPreview','rows','params','includeAll','include','merge','find','create','body','describe','addMessage','MailMessage','ids','omit','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','findAll'];(function(_0x5db666,_0x239940){var _0x42d839=function(_0x3ee479){while(--_0x3ee479){_0x5db666['push'](_0x5db666['shift']());}};_0x42d839(++_0x239940);}(_0x7d0d,0x1ed));var _0xd7d0=function(_0x37e767,_0x3902c4){_0x37e767=_0x37e767-0x0;var _0x4a6818=_0x7d0d[_0x37e767];return _0x4a6818;};'use strict';var pdf=require(_0xd7d0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd7d0('0x1'));var zipdir=require(_0xd7d0('0x2'));var jsonpatch=require(_0xd7d0('0x3'));var rp=require(_0xd7d0('0x4'));var moment=require('moment');var BPromise=require(_0xd7d0('0x5'));var Mustache=require(_0xd7d0('0x6'));var util=require(_0xd7d0('0x7'));var path=require(_0xd7d0('0x8'));var sox=require(_0xd7d0('0x9'));var csv=require(_0xd7d0('0xa'));var ejs=require(_0xd7d0('0xb'));var fs=require('fs');var _=require(_0xd7d0('0xc'));var squel=require(_0xd7d0('0xd'));var crypto=require(_0xd7d0('0xe'));var jsforce=require(_0xd7d0('0xf'));var deskjs=require(_0xd7d0('0x10'));var toCsv=require(_0xd7d0('0xa'));var querystring=require(_0xd7d0('0x11'));var Papa=require(_0xd7d0('0x12'));var htmlToText=require(_0xd7d0('0x13'));var Redis=require(_0xd7d0('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xd7d0('0x15'));var hardwareService=require(_0xd7d0('0x16'));var logger=require(_0xd7d0('0x17'))(_0xd7d0('0x18'));var utils=require(_0xd7d0('0x19'));var config=require(_0xd7d0('0x1a'));var db=require(_0xd7d0('0x1b'))['db'];config[_0xd7d0('0x1c')]=_[_0xd7d0('0x1d')](config[_0xd7d0('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xd7d0('0x1e'))(new Redis(config[_0xd7d0('0x1c')]));require(_0xd7d0('0x1f'))[_0xd7d0('0x20')](socket);function respondWithStatusCode(_0x1f6048,_0xc4638d){_0xc4638d=_0xc4638d||0xcc;return function(_0x25a59a){if(_0x25a59a){return _0x1f6048[_0xd7d0('0x21')](_0xc4638d);}return _0x1f6048[_0xd7d0('0x22')](_0xc4638d)[_0xd7d0('0x23')]();};}function respondWithResult(_0x3fd535,_0x7161be){_0x7161be=_0x7161be||0xc8;return function(_0x57172f){if(_0x57172f){return _0x3fd535[_0xd7d0('0x22')](_0x7161be)['json'](_0x57172f);}};}function respondWithFilteredResult(_0x3c6125,_0x83b8ce){return function(_0x47f075){if(_0x47f075){var _0x4b7a4f=_0x47f075['count'],_0x25318f=_0x83b8ce[_0xd7d0('0x24')],_0x43d97e=_0x83b8ce[_0xd7d0('0x24')]+_0x83b8ce[_0xd7d0('0x25')],_0x3a5eb7;if(_0x43d97e>=_0x4b7a4f){_0x43d97e=_0x4b7a4f;_0x3a5eb7=0xc8;}else{_0x3a5eb7=0xce;}_0x3c6125[_0xd7d0('0x22')](_0x3a5eb7);return _0x3c6125[_0xd7d0('0x26')](_0xd7d0('0x27'),_0x25318f+'-'+_0x43d97e+'/'+_0x4b7a4f)[_0xd7d0('0x28')](_0x47f075);}return null;};}function patchUpdates(_0x594cf1){return function(_0x401215){try{jsonpatch[_0xd7d0('0x29')](_0x401215,_0x594cf1,!![]);}catch(_0x4d77bc){return BPromise[_0xd7d0('0x2a')](_0x4d77bc);}return _0x401215[_0xd7d0('0x2b')]();};}function saveUpdates(_0xdc8aec,_0x1b8be3){return function(_0x1539eb){if(_0x1539eb){return _0x1539eb[_0xd7d0('0x2c')](_0xdc8aec)[_0xd7d0('0x2d')](function(_0x464790){return _0x464790;});}return null;};}function removeEntity(_0x28d4c4,_0x30af84){return function(_0x4c48db){if(_0x4c48db){return _0x4c48db[_0xd7d0('0x2e')]()['then'](function(){_0x28d4c4[_0xd7d0('0x22')](0xcc)[_0xd7d0('0x23')]();});}};}function handleEntityNotFound(_0x5dab03,_0x1953f8){return function(_0x33434c){if(!_0x33434c){_0x5dab03[_0xd7d0('0x21')](0x194);}return _0x33434c;};}function handleError(_0x5e5885,_0x4ba93b){_0x4ba93b=_0x4ba93b||0x1f4;return function(_0x325599){logger[_0xd7d0('0x2f')](_0x325599[_0xd7d0('0x30')]);if(_0x325599[_0xd7d0('0x31')]){delete _0x325599[_0xd7d0('0x31')];}_0x5e5885[_0xd7d0('0x22')](_0x4ba93b)[_0xd7d0('0x32')](_0x325599);};}function getInteractionUsers(_0x3d2ee3,_0x3ecd67){return new BPromise(function(_0x17e55c,_0x30f4d5){try{if(_0x3ecd67[_0x3d2ee3['id']]){_0x3d2ee3['Users']=_[_0xd7d0('0x33')](_0x3ecd67[_0x3d2ee3['id']],function(_0x33bcf4){return{'id':_0x33bcf4['id']};});}}catch(_0xf0f388){_0x30f4d5(_0xf0f388);}_0x17e55c(_0x3d2ee3);});}function getInteractionTags(_0x48c99f,_0x299d83){return new BPromise(function(_0x3629d5,_0x302447){try{if(_0x48c99f['TagIds']){_0x48c99f['Tags']=[];_0x48c99f[_0xd7d0('0x34')]['split'](',')[_0xd7d0('0x35')](function(_0xd3bc23){_0x48c99f[_0xd7d0('0x36')][_0xd7d0('0x37')](_0x299d83[_0xd3bc23]);});}delete _0x48c99f[_0xd7d0('0x34')];}catch(_0xf974ca){_0x302447(_0xf974ca);}_0x3629d5(_0x48c99f);});}function getLastMessageText(_0x465916){return new BPromise(function(_0x43e86e,_0x43638c){return db[_0xd7d0('0x38')][_0xd7d0('0x39')]({'where':{'id':_0x465916['id']},'attributes':[_0xd7d0('0x3a'),'lastMsgText'],'raw':!![]})[_0xd7d0('0x2d')](function(_0x983b27){if(!_0x983b27['lastMsgText']){_0x465916[_0xd7d0('0x3b')]=_[_0xd7d0('0x3c')](htmlToText[_0xd7d0('0x3d')](_0x983b27[_0xd7d0('0x3a')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x465916[_0xd7d0('0x3b')]=_0x983b27[_0xd7d0('0x3b')];}_0x43e86e(_0x465916);})['catch'](function(_0x50e0c4){_0x43638c(_0x50e0c4);});});}function updateMailInteraction(_0x29779f,_0x4dab59,_0x420243,_0x2bc18a){return new BPromise(function(_0x306465,_0x4a6b54){return getInteractionUsers(_0x29779f,_0x420243)[_0xd7d0('0x2d')](function(_0x8c3357){return getInteractionTags(_0x8c3357,_0x4dab59);})['then'](function(_0x593271){if(_0x2bc18a){_0x306465(getLastMessageText(_0x593271));}else{_0x306465(_0x593271);}})[_0xd7d0('0x3e')](function(_0x290c63){_0x4a6b54(_0x290c63);});});}exports[_0xd7d0('0x3f')]=function(_0x420a5b,_0x1505c6){var _0x211d96={},_0x3e66b5={},_0x3b5d65={'count':0x0,'rows':[]};var _0x59b564=db[_0xd7d0('0x38')][_0xd7d0('0x40')];_0x3e66b5[_0xd7d0('0x41')]=_[_0xd7d0('0x42')](_0x59b564);_0x3e66b5['query']=_[_0xd7d0('0x42')](_0x420a5b[_0xd7d0('0x43')]);_0x3e66b5[_0xd7d0('0x44')]=_[_0xd7d0('0x45')](_0x3e66b5[_0xd7d0('0x41')],_0x3e66b5['query']);_0x211d96[_0xd7d0('0x46')]=_[_0xd7d0('0x45')](_0x3e66b5[_0xd7d0('0x41')],qs[_0xd7d0('0x47')](_0x420a5b['query']['fields']));_0x211d96[_0xd7d0('0x46')]=_0x211d96[_0xd7d0('0x46')][_0xd7d0('0x48')]?_0x211d96[_0xd7d0('0x46')]:_0x3e66b5[_0xd7d0('0x41')];if(!_0x420a5b[_0xd7d0('0x43')][_0xd7d0('0x49')](_0xd7d0('0x4a'))){_0x211d96[_0xd7d0('0x25')]=qs[_0xd7d0('0x25')](_0x420a5b[_0xd7d0('0x43')][_0xd7d0('0x25')]);_0x211d96['offset']=qs['offset'](_0x420a5b[_0xd7d0('0x43')]['offset']);}_0x211d96[_0xd7d0('0x4b')]=qs[_0xd7d0('0x4c')](_0x420a5b[_0xd7d0('0x43')][_0xd7d0('0x4c')]);_0x211d96[_0xd7d0('0x4d')]=qs['filters'](_[_0xd7d0('0x4e')](_0x420a5b[_0xd7d0('0x43')],_0x3e66b5[_0xd7d0('0x44')]));var _0x54c2cf=[];var _0x5c9e63=squel[_0xd7d0('0x4f')]()[_0xd7d0('0x50')]('id')[_0xd7d0('0x50')]('name')[_0xd7d0('0x50')](_0xd7d0('0x51'))[_0xd7d0('0x52')](_0xd7d0('0x53'));var _0x2a1587=squel[_0xd7d0('0x4f')]()[_0xd7d0('0x50')](_0xd7d0('0x54'))['from'](_0xd7d0('0x55'),'me')[_0xd7d0('0x4d')](_0xd7d0('0x56'))[_0xd7d0('0x4d')](_0xd7d0('0x57'))['where'](_0xd7d0('0x58'));var _0x16b8ce=squel[_0xd7d0('0x4f')]()[_0xd7d0('0x50')](_0xd7d0('0x59'))[_0xd7d0('0x50')](_0xd7d0('0x5a'))[_0xd7d0('0x52')]('user_has_mail_interactions','ui')[_0xd7d0('0x5b')](_0xd7d0('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x4d080e=squel[_0xd7d0('0x4f')]()[_0xd7d0('0x52')](_0xd7d0('0x5d'),'i')['left_join'](_0xd7d0('0x5e'),'c',_0xd7d0('0x5f'))[_0xd7d0('0x5b')](_0xd7d0('0x5c'),'o',_0xd7d0('0x60'))[_0xd7d0('0x5b')](_0xd7d0('0x61'),'a',_0xd7d0('0x62'))['left_join'](_0xd7d0('0x55'),'me',_0xd7d0('0x63'));var _0x5bee28=squel['expr']();if(_0x420a5b[_0xd7d0('0x43')]['advancedFilter']){var _0x14505b=JSON[_0xd7d0('0x64')](_0x420a5b[_0xd7d0('0x43')][_0xd7d0('0x65')]);_[_0xd7d0('0x42')](_0x14505b)[_0xd7d0('0x35')](function(_0x3f0bdf){var _0x4f852b=_0x14505b[_0x3f0bdf];if(_0x3f0bdf===_0xd7d0('0x66')){var _0x211e3b=moment(_0x4f852b[_0xd7d0('0x67')][_0xd7d0('0x68')])[_0xd7d0('0x69')](_0xd7d0('0x6a'))['utc']()[_0xd7d0('0x6b')]();var _0x3ca713=moment(_0x3ca713)[_0xd7d0('0x6c')]()[_0xd7d0('0x6d')](_0xd7d0('0x6a'))[_0xd7d0('0x6b')]();_0x5bee28[_0xd7d0('0x6e')](_0xd7d0('0x6f'),_0x211e3b,_0x3ca713);}else{if(_[_0xd7d0('0x70')](_0x4f852b[_0xd7d0('0x71')])){_0x4f852b[_0xd7d0('0x71')][_0xd7d0('0x35')](function(_0x1a8151){switch(_0x4f852b[_0xd7d0('0x71')][_0xd7d0('0x67')]){case'IS':if(_0x3f0bdf!==_0xd7d0('0x72')&&_0x3f0bdf!==_0xd7d0('0x73')){if(_['isArray'](_0x4f852b['value'])&&_0x4f852b[_0xd7d0('0x67')][_0xd7d0('0x48')]>0x1){_0x5bee28[_0xd7d0('0x6e')](_0x4f852b[_0xd7d0('0x74')]+'.'+_0x3f0bdf+_0xd7d0('0x75'),_0x4f852b[_0xd7d0('0x67')]);}else{_0x5bee28[_0xd7d0('0x6e')](_0x4f852b[_0xd7d0('0x74')]+'.'+_0x3f0bdf+_0xd7d0('0x76'),_0x4f852b[_0xd7d0('0x67')][0x0]);}}break;case'=':_0x5bee28[_0xd7d0('0x6e')](_0x4f852b[_0xd7d0('0x74')]+'.'+_0x3f0bdf+_0xd7d0('0x76'),_0x4f852b[_0xd7d0('0x67')]);break;case _0xd7d0('0x77'):if(_0x3f0bdf==='ContactId'){_0x5bee28['and'](_0xd7d0('0x78')+'\x20LIKE\x20?','%'+_0x4f852b[_0xd7d0('0x67')]+'%');_0x5bee28['or'](_0xd7d0('0x79')+_0xd7d0('0x7a'),'%'+_0x4f852b[_0xd7d0('0x67')]+'%');_0x5bee28['or'](_0xd7d0('0x7b')+_0xd7d0('0x7a'),'%'+_0x4f852b[_0xd7d0('0x67')]+'%');}else{_0x5bee28[_0xd7d0('0x6e')](_0x4f852b[_0xd7d0('0x74')]+'.'+_0x3f0bdf+'\x20LIKE\x20?','%'+_0x4f852b[_0xd7d0('0x67')]+'%');}break;case'>':_0x5bee28[_0xd7d0('0x6e')](_0x4f852b[_0xd7d0('0x74')]+'.'+_0x3f0bdf+_0xd7d0('0x7c'),_0x4f852b[_0xd7d0('0x67')]);break;case'<':_0x5bee28[_0xd7d0('0x6e')](_0x4f852b[_0xd7d0('0x74')]+'.'+_0x3f0bdf+'\x20<\x20?',_0x4f852b[_0xd7d0('0x67')]);break;}});}else{switch(_0x4f852b[_0xd7d0('0x71')][_0xd7d0('0x67')]){case'IS':if(_0x3f0bdf!==_0xd7d0('0x72')&&_0x3f0bdf!==_0xd7d0('0x73')){if(_[_0xd7d0('0x70')](_0x4f852b[_0xd7d0('0x67')])&&_0x4f852b['value']['length']>0x1){_0x5bee28[_0xd7d0('0x6e')](_0x4f852b['tableAlias']+'.'+_0x3f0bdf+_0xd7d0('0x75'),_0x4f852b[_0xd7d0('0x67')]);}else{_0x5bee28[_0xd7d0('0x6e')](_0x4f852b[_0xd7d0('0x74')]+'.'+_0x3f0bdf+_0xd7d0('0x76'),_0x4f852b[_0xd7d0('0x67')][0x0]);}}break;case'=':_0x5bee28[_0xd7d0('0x6e')](_0x4f852b[_0xd7d0('0x74')]+'.'+_0x3f0bdf+_0xd7d0('0x76'),_0x4f852b[_0xd7d0('0x67')]);break;case _0xd7d0('0x77'):if(_0x3f0bdf===_0xd7d0('0x7d')){_0x5bee28['and']('c.firstName'+_0xd7d0('0x7a'),'%'+_0x4f852b[_0xd7d0('0x67')]+'%');_0x5bee28['or'](_0xd7d0('0x79')+_0xd7d0('0x7a'),'%'+_0x4f852b[_0xd7d0('0x67')]+'%');_0x5bee28['or'](_0xd7d0('0x7b')+_0xd7d0('0x7a'),'%'+_0x4f852b[_0xd7d0('0x67')]+'%');}else{_0x5bee28[_0xd7d0('0x6e')](_0x4f852b['tableAlias']+'.'+_0x3f0bdf+_0xd7d0('0x7a'),'%'+_0x4f852b['value']+'%');}break;case'>':_0x5bee28['and'](_0x4f852b[_0xd7d0('0x74')]+'.'+_0x3f0bdf+_0xd7d0('0x7c'),_0x4f852b[_0xd7d0('0x67')]);break;case'<':_0x5bee28[_0xd7d0('0x6e')](_0x4f852b[_0xd7d0('0x74')]+'.'+_0x3f0bdf+'\x20<\x20?',_0x4f852b[_0xd7d0('0x67')]);break;}}}});}else{var _0x580e92=_(Object['keys'](_0x420a5b[_0xd7d0('0x43')]))[_0xd7d0('0x33')](function(_0x214da9){return _0x59b564[_0xd7d0('0x49')](_0x214da9)?_0x214da9:undefined;})[_0xd7d0('0x7e')](function(_0x2059a2){return!_[_0xd7d0('0x7f')](_0x2059a2);})[_0xd7d0('0x67')]();if(!_['isEmpty'](_0x580e92)){_0x580e92[_0xd7d0('0x35')](function(_0x443f7f){if(_0x443f7f==='MailAccountId'){_0x4d080e[_0xd7d0('0x4d')]('i.MailAccountId\x20IN\x20?',[][_0xd7d0('0x80')](_0x420a5b['query'][_0x443f7f]));}else if(_0x443f7f===_0xd7d0('0x66')){var _0x4f568b=JSON['parse'](_0x420a5b[_0xd7d0('0x43')][_0x443f7f])['$gte'];var _0x1547aa=JSON['parse'](_0x420a5b[_0xd7d0('0x43')][_0x443f7f])['$lte'];_0x4d080e[_0xd7d0('0x4d')](_0xd7d0('0x6f'),_0x4f568b,_0x1547aa);}else{if(_0x420a5b[_0xd7d0('0x43')][_0x443f7f]===_0xd7d0('0x81')){_0x4d080e[_0xd7d0('0x4d')]('i.'+_0x443f7f+_0xd7d0('0x82'));}else{_0x4d080e['where']('i.'+_0x443f7f+_0xd7d0('0x76'),_0x420a5b[_0xd7d0('0x43')][_0x443f7f]);}}});}if(_0x420a5b[_0xd7d0('0x43')][_0xd7d0('0x7e')]){var _0x11ff18=_0x420a5b[_0xd7d0('0x43')][_0xd7d0('0x7e')]['replace']('\x5c','\x5c\x5c')[_0xd7d0('0x83')]('\x27\x27',_0xd7d0('0x84'));if(qs[_0xd7d0('0x85')](_0x11ff18)){_0x5bee28['or']('i.id\x20LIKE\x20?',_0x11ff18+'%');}else if(qs[_0xd7d0('0x86')](_0x11ff18)){_0x5bee28['or'](_0xd7d0('0x87'),_0x11ff18+'%');}else{var _0x14c53e=[];_0x11ff18['split']('\x20')[_0xd7d0('0x35')](function(_0x167fd9){_0x14c53e[_0xd7d0('0x37')]('+'+_0x167fd9['toString']());});var _0x440860=_0x14c53e[_0xd7d0('0x88')]('\x20');_0x5bee28['or'](_0xd7d0('0x89'),_0x440860)['or'](_0xd7d0('0x8a'),_0x440860);}}}_0x4d080e['where'](_0x5bee28);if(_0x211d96[_0xd7d0('0x4b')]){_0x211d96[_0xd7d0('0x4b')][_0xd7d0('0x35')](function(_0x1b5250){_0x4d080e['order']('i.'+_0x1b5250[0x0],_0x1b5250[0x1]===_0xd7d0('0x8b')?![]:!![]);});}_0x4d080e['group']('i.id');var _0x549990={'type':db[_0xd7d0('0x8c')][_0xd7d0('0x8d')][_0xd7d0('0x8e')],'raw':!![]};var _0x3ee990=_0x4d080e[_0xd7d0('0x8f')]()[_0xd7d0('0x50')]('COUNT(*)')[_0xd7d0('0x50')](_0xd7d0('0x90'),_0xd7d0('0x73'));if(!_0x420a5b[_0xd7d0('0x43')]['advancedFilter']){if(_0x420a5b['query'][_0xd7d0('0x91')]){if(_0x420a5b[_0xd7d0('0x43')][_0xd7d0('0x91')]==0x1){_0x3ee990[_0xd7d0('0x92')](_0xd7d0('0x93'));_0x4d080e[_0xd7d0('0x92')](_0xd7d0('0x93'));}else{_0x3ee990[_0xd7d0('0x92')](_0xd7d0('0x94'));_0x4d080e[_0xd7d0('0x92')]('`unreadMessages`\x20>\x200');}}if(_0x420a5b[_0xd7d0('0x43')]['tag']){var _0x20e32d=_[_0xd7d0('0x70')](_0x420a5b[_0xd7d0('0x43')][_0xd7d0('0x95')])?_0x420a5b['query']['tag']:new Array(_0x420a5b['query'][_0xd7d0('0x95')]);var _0x4d7ed9=squel[_0xd7d0('0x96')]();_0x20e32d[_0xd7d0('0x35')](function(_0x320156){_0x4d7ed9['or'](_0xd7d0('0x97'),'%,'+_0x320156+',%');});_0x4d080e['having'](_0x4d7ed9);_0x3ee990[_0xd7d0('0x5b')](_0xd7d0('0x98'),'it',_0xd7d0('0x99'));_0x3ee990[_0xd7d0('0x5b')](_0xd7d0('0x53'),'t',_0xd7d0('0x9a'));_0x3ee990[_0xd7d0('0x4d')](_0xd7d0('0x9b'),_0x20e32d);}}else{var _0x14505b=JSON[_0xd7d0('0x64')](_0x420a5b[_0xd7d0('0x43')][_0xd7d0('0x65')]);_['keys'](_0x14505b)['forEach'](function(_0x36484a){var _0x51132d=_0x14505b[_0x36484a];if(_0x36484a===_0xd7d0('0x72')){var _0x3f958d=_0x51132d[_0xd7d0('0x67')];var _0x1094ad=squel[_0xd7d0('0x96')]();_0x3f958d[_0xd7d0('0x35')](function(_0x568b93){_0x1094ad['or'](_0xd7d0('0x97'),'%,'+_0x568b93+',%');});_0x4d080e['having'](_0x1094ad);_0x3ee990[_0xd7d0('0x5b')]('mail_interaction_has_tags','it',_0xd7d0('0x99'));_0x3ee990[_0xd7d0('0x5b')](_0xd7d0('0x53'),'t','t.id\x20=\x20it.TagId');_0x3ee990[_0xd7d0('0x4d')]('t.id\x20IN\x20?',_0x3f958d);}else if(_0x36484a===_0xd7d0('0x73')){if(_0x51132d[_0xd7d0('0x67')]['length']===0x1){if(_0x51132d['value'][0x0]===0x1){_0x3ee990[_0xd7d0('0x92')]('`unreadMessages`\x20=\x200');_0x4d080e['having'](_0xd7d0('0x93'));}else{_0x3ee990[_0xd7d0('0x92')](_0xd7d0('0x94'));_0x4d080e['having'](_0xd7d0('0x94'));}}}});}db[_0xd7d0('0x9c')][_0xd7d0('0x43')](_0x3ee990[_0xd7d0('0x9d')](),_0x549990)['then'](function(_0x3711c0){_0x3b5d65[_0xd7d0('0x9e')]=_0x3711c0[_0xd7d0('0x48')];if(_0x3b5d65[_0xd7d0('0x9e')]===0x0)return[];return db['sequelize'][_0xd7d0('0x43')](_0x5c9e63[_0xd7d0('0x9d')](),_0x549990)[_0xd7d0('0x2d')](function(_0x33d58a){_0x54c2cf=_['keyBy'](_0x33d58a,'id');_0x549990=_['merge'](_0x549990,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4d080e[_0xd7d0('0x50')](_0xd7d0('0x90'),_0xd7d0('0x73'));_0x4d080e[_0xd7d0('0x50')]('a.key',_0xd7d0('0x9f'));_0x4d080e[_0xd7d0('0x50')](_0xd7d0('0xa0'),_0xd7d0('0xa1'));_0x4d080e[_0xd7d0('0x50')](_0xd7d0('0xa2'));_0x4d080e[_0xd7d0('0x50')](_0xd7d0('0xa3'));_0x4d080e[_0xd7d0('0x50')]('i.updatedAt');_0x4d080e[_0xd7d0('0x50')]('i.closed');_0x4d080e[_0xd7d0('0x50')]('i.closedAt');_0x4d080e['field']('i.attach');_0x4d080e[_0xd7d0('0x50')](_0xd7d0('0xa4'));_0x4d080e[_0xd7d0('0x50')](_0xd7d0('0xa5'));_0x4d080e['field'](_0xd7d0('0xa6'));_0x4d080e[_0xd7d0('0x50')](_0xd7d0('0xa7'));_0x4d080e['field'](_0xd7d0('0xa8'));_0x4d080e[_0xd7d0('0x50')](_0xd7d0('0xa9'));_0x4d080e[_0xd7d0('0x50')]('i.ContactId');_0x4d080e[_0xd7d0('0x50')]('i.MailAccountId');_0x4d080e[_0xd7d0('0x50')](_0xd7d0('0xaa'));_0x4d080e[_0xd7d0('0x50')](_0xd7d0('0x78'),_0xd7d0('0xab'));_0x4d080e[_0xd7d0('0x50')](_0xd7d0('0x79'),_0xd7d0('0xac'));_0x4d080e['field'](_0xd7d0('0x7b'),_0xd7d0('0xad'));_0x4d080e['field']('c.phone',_0xd7d0('0xae'));_0x4d080e[_0xd7d0('0x50')]('c.mobile','Contact.mobile');_0x4d080e[_0xd7d0('0x50')](_0xd7d0('0xaf'),_0xd7d0('0xb0'));_0x4d080e[_0xd7d0('0x50')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xd7d0('0x34'));_0x4d080e[_0xd7d0('0x5b')](_0xd7d0('0x98'),'it',_0xd7d0('0x99'));_0x4d080e['left_join'](_0xd7d0('0x53'),'t',_0xd7d0('0x9a'));_0x4d080e[_0xd7d0('0x25')](_0x211d96[_0xd7d0('0x25')]);_0x4d080e[_0xd7d0('0x24')](_0x211d96[_0xd7d0('0x24')]);return db[_0xd7d0('0x9c')][_0xd7d0('0x43')](_0x4d080e['toString'](),_0x549990);})['then'](function(_0x28302f){_0x16b8ce['where']('ui.MailInteractionId\x20IN\x20?',_[_0xd7d0('0x33')](_0x28302f,'id'));return db[_0xd7d0('0x9c')][_0xd7d0('0x43')](_0x16b8ce['toString'](),_0x549990)[_0xd7d0('0x2d')](function(_0x1ec1c9){var _0x26d37d=_[_0xd7d0('0xb1')](_0x1ec1c9,_0xd7d0('0xb2'));var _0x134f35=[];return db[_0xd7d0('0xb3')][_0xd7d0('0x39')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xd7d0('0x2d')](function(_0x3e3b2e){var _0x40f390=_0x3e3b2e[_0xd7d0('0xb4')];_0x28302f[_0xd7d0('0x35')](function(_0x506775){_0x134f35[_0xd7d0('0x37')](updateMailInteraction(_0x506775,_0x54c2cf,_0x26d37d,_0x40f390));});return BPromise['all'](_0x134f35);});});});})[_0xd7d0('0x2d')](function(_0x2aec67){_0x3b5d65[_0xd7d0('0xb5')]=_0x2aec67;return _0x3b5d65;})[_0xd7d0('0x2d')](respondWithFilteredResult(_0x1505c6,_0x211d96))[_0xd7d0('0x3e')](handleError(_0x1505c6,null));};exports['show']=function(_0x2d39f2,_0x10d7b8){var _0x1e6d40={'raw':![],'where':{'id':_0x2d39f2[_0xd7d0('0xb6')]['id']}},_0x4eac55={};_0x4eac55[_0xd7d0('0x41')]=_[_0xd7d0('0x42')](db[_0xd7d0('0x38')]['rawAttributes']);_0x4eac55[_0xd7d0('0x43')]=_[_0xd7d0('0x42')](_0x2d39f2[_0xd7d0('0x43')]);_0x4eac55[_0xd7d0('0x44')]=_[_0xd7d0('0x45')](_0x4eac55[_0xd7d0('0x41')],_0x4eac55[_0xd7d0('0x43')]);_0x1e6d40[_0xd7d0('0x46')]=_[_0xd7d0('0x45')](_0x4eac55['model'],qs['fields'](_0x2d39f2[_0xd7d0('0x43')][_0xd7d0('0x47')]));_0x1e6d40[_0xd7d0('0x46')]=_0x1e6d40['attributes'][_0xd7d0('0x48')]?_0x1e6d40[_0xd7d0('0x46')]:_0x4eac55['model'];if(_0x2d39f2[_0xd7d0('0x43')][_0xd7d0('0xb7')]){_0x1e6d40[_0xd7d0('0xb8')]=[{'all':!![]}];}_0x1e6d40=_[_0xd7d0('0xb9')]({},_0x1e6d40,_0x2d39f2['options']);return db[_0xd7d0('0x38')][_0xd7d0('0xba')](_0x1e6d40)[_0xd7d0('0x2d')](handleEntityNotFound(_0x10d7b8,null))[_0xd7d0('0x2d')](respondWithResult(_0x10d7b8,null))[_0xd7d0('0x3e')](handleError(_0x10d7b8,null));};exports[_0xd7d0('0xbb')]=function(_0x2728d9,_0x292490){return db[_0xd7d0('0x38')][_0xd7d0('0xbb')](_0x2728d9[_0xd7d0('0xbc')],{})['then'](respondWithResult(_0x292490,0xc9))[_0xd7d0('0x3e')](handleError(_0x292490,null));};exports[_0xd7d0('0x2c')]=function(_0x151788,_0x24cdc3){if(_0x151788[_0xd7d0('0xbc')]['id']){delete _0x151788[_0xd7d0('0xbc')]['id'];}return db[_0xd7d0('0x38')][_0xd7d0('0xba')]({'where':{'id':_0x151788[_0xd7d0('0xb6')]['id']}})[_0xd7d0('0x2d')](handleEntityNotFound(_0x24cdc3,null))[_0xd7d0('0x2d')](saveUpdates(_0x151788[_0xd7d0('0xbc')],null))[_0xd7d0('0x2d')](respondWithResult(_0x24cdc3,null))['catch'](handleError(_0x24cdc3,null));};exports[_0xd7d0('0x2e')]=function(_0x566092,_0x1cc064){return db[_0xd7d0('0x38')][_0xd7d0('0xba')]({'where':{'id':_0x566092[_0xd7d0('0xb6')]['id']}})[_0xd7d0('0x2d')](handleEntityNotFound(_0x1cc064,null))[_0xd7d0('0x2d')](removeEntity(_0x1cc064,null))[_0xd7d0('0x3e')](handleError(_0x1cc064,null));};exports[_0xd7d0('0xbd')]=function(_0x524c2c,_0x54c772){return db[_0xd7d0('0x38')][_0xd7d0('0xbd')]()[_0xd7d0('0x2d')](respondWithResult(_0x54c772,null))[_0xd7d0('0x3e')](handleError(_0x54c772,null));};exports[_0xd7d0('0xbe')]=function(_0x3d9fb9,_0xce54d5,_0x113f6a){return db[_0xd7d0('0xbf')][_0xd7d0('0xba')]({'where':{'id':_0x3d9fb9[_0xd7d0('0xb6')]['id']}})[_0xd7d0('0x2d')](handleEntityNotFound(_0xce54d5,null))[_0xd7d0('0x2d')](function(_0x203c65){if(_0x203c65){return _0x203c65['addMessage'](_0x3d9fb9[_0xd7d0('0xbc')][_0xd7d0('0xc0')],_[_0xd7d0('0xc1')](_0x3d9fb9[_0xd7d0('0xbc')],[_0xd7d0('0xc0'),'id'])||{});}})[_0xd7d0('0x2d')](respondWithResult(_0xce54d5,null))[_0xd7d0('0x3e')](handleError(_0xce54d5,null));};exports[_0xd7d0('0xc2')]=function(_0x184efa,_0x17d814,_0x301fc4){var _0x15286f={'raw':![],'where':{}};var _0x1791cd={};var _0x457b91={'count':0x0,'rows':[]};return db[_0xd7d0('0x38')]['findOne']({'where':{'id':_0x184efa[_0xd7d0('0xb6')]['id']}})[_0xd7d0('0x2d')](handleEntityNotFound(_0x17d814,null))['then'](function(_0xf5ba4e){if(_0xf5ba4e){_0x1791cd['model']=_[_0xd7d0('0x42')](db[_0xd7d0('0xbf')][_0xd7d0('0x40')]);_0x1791cd[_0xd7d0('0x43')]=_[_0xd7d0('0x42')](_0x184efa[_0xd7d0('0x43')]);_0x1791cd[_0xd7d0('0x44')]=_['intersection'](_0x1791cd['model'],_0x1791cd['query']);_0x15286f['attributes']=_[_0xd7d0('0x45')](_0x1791cd[_0xd7d0('0x41')],qs[_0xd7d0('0x47')](_0x184efa[_0xd7d0('0x43')][_0xd7d0('0x47')]));_0x15286f[_0xd7d0('0x46')]=_0x15286f[_0xd7d0('0x46')][_0xd7d0('0x48')]?_0x15286f[_0xd7d0('0x46')]:_0x1791cd[_0xd7d0('0x41')];if(!_0x184efa[_0xd7d0('0x43')][_0xd7d0('0x49')](_0xd7d0('0x4a'))){_0x15286f[_0xd7d0('0x25')]=qs[_0xd7d0('0x25')](_0x184efa['query'][_0xd7d0('0x25')]);_0x15286f[_0xd7d0('0x24')]=qs[_0xd7d0('0x24')](_0x184efa[_0xd7d0('0x43')][_0xd7d0('0x24')]);}_0x15286f['order']=qs[_0xd7d0('0x4c')](_0x184efa[_0xd7d0('0x43')][_0xd7d0('0x4c')]);_0x15286f[_0xd7d0('0x4d')]=qs[_0xd7d0('0x44')](_[_0xd7d0('0x4e')](_0x184efa['query'],_0x1791cd[_0xd7d0('0x44')]));_0x15286f['where'][_0xd7d0('0xb2')]=_0xf5ba4e['id'];if(_0x184efa[_0xd7d0('0x43')][_0xd7d0('0x7e')]){_0x15286f[_0xd7d0('0x4d')]=_[_0xd7d0('0xb9')](_0x15286f[_0xd7d0('0x4d')],{'$or':_['map'](_0x15286f[_0xd7d0('0x46')],function(_0x2cbada){var _0x415bc1={};_0x415bc1[_0x2cbada]={'$like':'%'+_0x184efa[_0xd7d0('0x43')][_0xd7d0('0x7e')]+'%'};return _0x415bc1;})});}if(_0x184efa[_0xd7d0('0x43')][_0xd7d0('0xc3')]){var _0x4b483=_0x184efa[_0xd7d0('0x43')][_0xd7d0('0xc3')][_0xd7d0('0xc4')](',');var _0x5da12d={};_0x5da12d[_0x4b483[0x0]]={'$gte':moment(_0x4b483[0x1])[_0xd7d0('0x6b')](_0xd7d0('0xc5'))};_0x15286f[_0xd7d0('0x4d')]=_[_0xd7d0('0xb9')](_0x15286f[_0xd7d0('0x4d')],_0x5da12d);}_0x15286f=_['merge']({},_0x15286f,_0x184efa[_0xd7d0('0xc6')]);return db[_0xd7d0('0xbf')][_0xd7d0('0x9e')]({'where':_0x15286f['where']})['then'](function(_0x4a8767){_0x457b91[_0xd7d0('0x9e')]=_0x4a8767;if(_0x184efa['query'][_0xd7d0('0xb7')]){_0x15286f[_0xd7d0('0xb8')]=[{'all':!![]}];}return db[_0xd7d0('0xbf')][_0xd7d0('0xc7')](_0x15286f);})[_0xd7d0('0x2d')](function(_0x33f4b9){_0x457b91[_0xd7d0('0xb5')]=_0x33f4b9;return _0x457b91;});}})[_0xd7d0('0x2d')](respondWithFilteredResult(_0x17d814,_0x15286f))[_0xd7d0('0x3e')](handleError(_0x17d814,null));};exports['addTags']=function(_0x35828e,_0x3cc2d2,_0x2a7988){return db[_0xd7d0('0x38')][_0xd7d0('0xba')]({'where':{'id':_0x35828e['params']['id']}})['then'](handleEntityNotFound(_0x3cc2d2,null))[_0xd7d0('0x2d')](function(_0x196235){if(_0x196235){return _0x196235[_0xd7d0('0xc8')](_0x35828e[_0xd7d0('0xbc')][_0xd7d0('0xc0')],_[_0xd7d0('0xc1')](_0x35828e[_0xd7d0('0xbc')],['ids','id'])||{})[_0xd7d0('0xc9')](function(){return db[_0xd7d0('0xca')][_0xd7d0('0xc7')]({'attributes':['id',_0xd7d0('0x31'),_0xd7d0('0x51')],'where':{'id':_0x35828e[_0xd7d0('0xbc')]['ids']}});})['then'](function(_0xf30416){socket[_0xd7d0('0xcb')](_0xd7d0('0xcc'),{'id':Number(_0x35828e[_0xd7d0('0xb6')]['id']),'tags':_0xf30416||[]});return{'id':Number(_0x35828e['params']['id']),'tags':_0xf30416||[]};});}})['then'](respondWithResult(_0x3cc2d2,null))[_0xd7d0('0x3e')](handleError(_0x3cc2d2,null));};exports[_0xd7d0('0xcd')]=function(_0x926a35,_0x2466be,_0x4bb4ea){return db['MailInteraction'][_0xd7d0('0xba')]({'where':{'id':_0x926a35[_0xd7d0('0xb6')]['id']}})[_0xd7d0('0x2d')](handleEntityNotFound(_0x2466be,null))[_0xd7d0('0x2d')](function(_0x32654f){if(_0x32654f){return _0x32654f[_0xd7d0('0xcd')](_0x926a35[_0xd7d0('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x2466be,null))[_0xd7d0('0x3e')](handleError(_0x2466be,null));};exports['download']=function(_0x41c0e4,_0x33f69e){var _0x4a7801=moment()[_0xd7d0('0xce')]()[_0xd7d0('0x9d')]();var _0x401ded=path[_0xd7d0('0x88')](config[_0xd7d0('0xcf')],_0xd7d0('0xd0'),_0xd7d0('0xd1'),_0xd7d0('0xd2'));var _0x5b84dd=path[_0xd7d0('0x88')](config[_0xd7d0('0xcf')],_0xd7d0('0xd0'),_0xd7d0('0xd1'),_0xd7d0('0xd3'));var _0x262c8e=path[_0xd7d0('0x88')](_0x5b84dd,_0x4a7801);var _0x5ad877=util[_0xd7d0('0x6b')](_0xd7d0('0xd4'),_0x4a7801);var _0x3c8380=path[_0xd7d0('0x88')](_0x5b84dd,_0x5ad877);var _0x184c0a=![];return db[_0xd7d0('0x38')][_0xd7d0('0xba')]({'where':{'id':_0x41c0e4[_0xd7d0('0xb6')]['id']}})[_0xd7d0('0x2d')](handleEntityNotFound(_0x33f69e,null))[_0xd7d0('0x2d')](function(_0x5e482a){if(_0x5e482a){return _0x5e482a[_0xd7d0('0xc2')]({'attributes':['id',_0xd7d0('0xbc'),_0xd7d0('0x52'),'to','cc',_0xd7d0('0xd5'),_0xd7d0('0xd6'),_0xd7d0('0x66')],'where':{'secret':![]},'include':_0x41c0e4[_0xd7d0('0x43')][_0xd7d0('0xd2')]?[{'model':db[_0xd7d0('0xd7')],'as':_0xd7d0('0xd8')}]:undefined,'order':qs[_0xd7d0('0x4c')]('id')});}return[];})['then'](function(_0x81021){_0x184c0a=_0x81021[_0xd7d0('0x48')];if(_0x81021[_0xd7d0('0x48')]){fs[_0xd7d0('0xd9')](_0x262c8e);return BPromise[_0xd7d0('0xda')](_0x81021,function(_0x366c4e,_0x7ddc31){var _0xf50917=_0x366c4e;var _0x513833={'from':_0xf50917['from'],'to':_0xf50917['to'],'subject':_0xf50917['subject'],'html':_0xf50917[_0xd7d0('0xbc')],'headers':{'Date':moment(_0xf50917[_0xd7d0('0x66')])[_0xd7d0('0x6b')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x366c4e['cc']){_0x513833['headers']['Cc']=_0x366c4e['cc'];}if(_0x366c4e['bcc']){_0x513833[_0xd7d0('0xdb')][_0xd7d0('0xdc')]=_0x366c4e[_0xd7d0('0xd5')];}return new BPromise(function(_0x51a62b,_0x22a36b){if(_0x366c4e['Attachments']){for(var _0x262b91=0x0;_0x262b91<_0x366c4e[_0xd7d0('0xd8')]['length'];_0x262b91++){var _0xd67063=_0x366c4e[_0xd7d0('0xd8')][_0x262b91];var _0x3c46fd=path['join'](_0x401ded,_0xd67063[_0xd7d0('0xdd')]);if(fs[_0xd7d0('0xde')](_0x3c46fd)){_0x513833['attachments'][_0xd7d0('0x37')]({'name':_0xd67063[_0xd7d0('0x31')],'contentType':_0xd67063[_0xd7d0('0xdf')],'data':fs[_0xd7d0('0xe0')](_0x3c46fd)});}}}emlformat[_0xd7d0('0xe1')](_0x513833,function(_0x14ff0b,_0x27d6a4){if(_0x14ff0b)return _0x22a36b(_0x14ff0b);fs[_0xd7d0('0xe2')](path['join'](_0x262c8e,util[_0xd7d0('0x6b')](_0xd7d0('0xe3'),_0x7ddc31)),_0x27d6a4);return _0x51a62b(_0x27d6a4);});});});}})[_0xd7d0('0x2d')](function(){if(_0x184c0a){return new BPromise(function(_0x2493d7,_0x113bf9){zipdir(_0x262c8e,{'saveTo':_0x3c8380},function(_0x24ebc1,_0x4d6c9a){if(_0x24ebc1)return _0x113bf9(_0x24ebc1);return _0x2493d7(_0x4d6c9a);});});}})[_0xd7d0('0x2d')](function(){if(_0x184c0a){return new BPromise(function(_0x29de49,_0x259ddc){rimraf(_0x262c8e,function(_0x4958aa){if(_0x4958aa)_0x259ddc(_0x4958aa);return _0x29de49();});});}})[_0xd7d0('0x2d')](function(){if(_0x184c0a){return _0x33f69e[_0xd7d0('0xe4')](_0x3c8380,_0x5ad877,function(_0xf3d2dd){if(_0xf3d2dd){console[_0xd7d0('0xe5')](_0xd7d0('0xe6'),_0xf3d2dd);}else{fs['unlinkSync'](_0x3c8380);}});}else{return _0x33f69e[_0xd7d0('0x21')](0xc8);}})[_0xd7d0('0x3e')](handleError(_0x33f69e,null));}; \ No newline at end of file +var _0x46a6=['each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','type','readFileSync','build','message%d.eml','log','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','html-to-text','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','error','name','send','Users','Tags','TagIds','split','forEach','MailInteraction','findOne','lastMsgBody','lastMsgText','trimStart','fromString','catch','index','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','select','field','color','COUNT(*)','mail_messages','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','me.MailInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','createdAt','value','startOf','day','utc','format','endOf','and','condition','TagId','unreadMessages','isArray','\x20IN\x20?','tableAlias','ContactId','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20=\x20?','LIKE','\x20<\x20?','hasOwnProperty','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','order','DESC','group','Sequelize','QueryTypes','SELECT','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','tools_tags','t.id\x20IN\x20?','sequelize','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.lastName','Contact.email','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','ui.MailInteractionId\x20IN\x20?','map','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','find','create','body','destroy','describe','addMessage','MailMessage','ids','rawAttributes','filter','findAll','addTags','spread','Tag','removeTags','unix','server','files','attachments','root','tmp','interaction-%s.zip','getMessages','bcc','subject','Attachment','Attachments','mkdirSync'];(function(_0x2ae73f,_0x2ed220){var _0x40a44a=function(_0x3a2508){while(--_0x3a2508){_0x2ae73f['push'](_0x2ae73f['shift']());}};_0x40a44a(++_0x2ed220);}(_0x46a6,0xef));var _0x646a=function(_0x36b037,_0x2b234e){_0x36b037=_0x36b037-0x0;var _0x409194=_0x46a6[_0x36b037];return _0x409194;};'use strict';var pdf=require(_0x646a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x646a('0x1'));var zipdir=require(_0x646a('0x2'));var jsonpatch=require(_0x646a('0x3'));var rp=require(_0x646a('0x4'));var moment=require(_0x646a('0x5'));var BPromise=require(_0x646a('0x6'));var Mustache=require(_0x646a('0x7'));var util=require('util');var path=require(_0x646a('0x8'));var sox=require(_0x646a('0x9'));var csv=require(_0x646a('0xa'));var ejs=require(_0x646a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x646a('0xc'));var crypto=require(_0x646a('0xd'));var jsforce=require(_0x646a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x646a('0xf'));var Papa=require(_0x646a('0x10'));var htmlToText=require(_0x646a('0x11'));var Redis=require('ioredis');var authService=require(_0x646a('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x646a('0x13'));var logger=require(_0x646a('0x14'))('api');var utils=require(_0x646a('0x15'));var config=require(_0x646a('0x16'));var db=require(_0x646a('0x17'))['db'];config[_0x646a('0x18')]=_[_0x646a('0x19')](config[_0x646a('0x18')],{'host':_0x646a('0x1a'),'port':0x18eb});var socket=require(_0x646a('0x1b'))(new Redis(config[_0x646a('0x18')]));require('./mailInteraction.socket')[_0x646a('0x1c')](socket);function respondWithStatusCode(_0x1e5a36,_0x310a4f){_0x310a4f=_0x310a4f||0xcc;return function(_0x226b46){if(_0x226b46){return _0x1e5a36[_0x646a('0x1d')](_0x310a4f);}return _0x1e5a36[_0x646a('0x1e')](_0x310a4f)[_0x646a('0x1f')]();};}function respondWithResult(_0x88729b,_0x4ff49e){_0x4ff49e=_0x4ff49e||0xc8;return function(_0x4cc02c){if(_0x4cc02c){return _0x88729b['status'](_0x4ff49e)['json'](_0x4cc02c);}};}function respondWithFilteredResult(_0x6a434b,_0x2ef6a4){return function(_0x3216a3){if(_0x3216a3){var _0x2fad21=_0x3216a3[_0x646a('0x20')],_0x12a456=_0x2ef6a4[_0x646a('0x21')],_0x48ec47=_0x2ef6a4['offset']+_0x2ef6a4[_0x646a('0x22')],_0x5c9b44;if(_0x48ec47>=_0x2fad21){_0x48ec47=_0x2fad21;_0x5c9b44=0xc8;}else{_0x5c9b44=0xce;}_0x6a434b[_0x646a('0x1e')](_0x5c9b44);return _0x6a434b['set'](_0x646a('0x23'),_0x12a456+'-'+_0x48ec47+'/'+_0x2fad21)[_0x646a('0x24')](_0x3216a3);}return null;};}function patchUpdates(_0x4067a2){return function(_0x4d7a75){try{jsonpatch[_0x646a('0x25')](_0x4d7a75,_0x4067a2,!![]);}catch(_0x446ff9){return BPromise[_0x646a('0x26')](_0x446ff9);}return _0x4d7a75[_0x646a('0x27')]();};}function saveUpdates(_0x5cb053,_0x243583){return function(_0x484fcc){if(_0x484fcc){return _0x484fcc[_0x646a('0x28')](_0x5cb053)[_0x646a('0x29')](function(_0x3dba8f){return _0x3dba8f;});}return null;};}function removeEntity(_0x137c59,_0x59c8bd){return function(_0x1d4a86){if(_0x1d4a86){return _0x1d4a86['destroy']()[_0x646a('0x29')](function(){_0x137c59[_0x646a('0x1e')](0xcc)[_0x646a('0x1f')]();});}};}function handleEntityNotFound(_0x179e49,_0x7591eb){return function(_0x40f462){if(!_0x40f462){_0x179e49[_0x646a('0x1d')](0x194);}return _0x40f462;};}function handleError(_0x3ca03c,_0x5a5d8d){_0x5a5d8d=_0x5a5d8d||0x1f4;return function(_0x402c9e){logger[_0x646a('0x2a')](_0x402c9e['stack']);if(_0x402c9e[_0x646a('0x2b')]){delete _0x402c9e['name'];}_0x3ca03c[_0x646a('0x1e')](_0x5a5d8d)[_0x646a('0x2c')](_0x402c9e);};}function getInteractionUsers(_0xc8cba1,_0x45a398){return new BPromise(function(_0xb6f5f,_0x11092c){try{if(_0x45a398[_0xc8cba1['id']]){_0xc8cba1[_0x646a('0x2d')]=_['map'](_0x45a398[_0xc8cba1['id']],function(_0xa1e8d5){return{'id':_0xa1e8d5['id']};});}}catch(_0x3440b9){_0x11092c(_0x3440b9);}_0xb6f5f(_0xc8cba1);});}function getInteractionTags(_0x561dd9,_0x1a740a){return new BPromise(function(_0x2302e3,_0x5dae26){try{if(_0x561dd9['TagIds']){_0x561dd9[_0x646a('0x2e')]=[];_0x561dd9[_0x646a('0x2f')][_0x646a('0x30')](',')[_0x646a('0x31')](function(_0x50d696){_0x561dd9['Tags']['push'](_0x1a740a[_0x50d696]);});}delete _0x561dd9[_0x646a('0x2f')];}catch(_0x475418){_0x5dae26(_0x475418);}_0x2302e3(_0x561dd9);});}function getLastMessageText(_0x52e05c){return new BPromise(function(_0x2dff3a,_0x11ce9b){return db[_0x646a('0x32')][_0x646a('0x33')]({'where':{'id':_0x52e05c['id']},'attributes':[_0x646a('0x34'),_0x646a('0x35')],'raw':!![]})[_0x646a('0x29')](function(_0x5cd795){if(!_0x5cd795['lastMsgText']){_0x52e05c[_0x646a('0x35')]=_[_0x646a('0x36')](htmlToText[_0x646a('0x37')](_0x5cd795['lastMsgBody'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x52e05c['lastMsgText']=_0x5cd795[_0x646a('0x35')];}_0x2dff3a(_0x52e05c);})[_0x646a('0x38')](function(_0x97929){_0x11ce9b(_0x97929);});});}function updateMailInteraction(_0x1879da,_0x1fb00c,_0x315f20,_0x2681f0){return new BPromise(function(_0xaca38d,_0x4f1e27){return getInteractionUsers(_0x1879da,_0x315f20)[_0x646a('0x29')](function(_0x2b767b){return getInteractionTags(_0x2b767b,_0x1fb00c);})[_0x646a('0x29')](function(_0x1e5b8a){if(_0x2681f0){_0xaca38d(getLastMessageText(_0x1e5b8a));}else{_0xaca38d(_0x1e5b8a);}})[_0x646a('0x38')](function(_0x4398dd){_0x4f1e27(_0x4398dd);});});}exports[_0x646a('0x39')]=function(_0x160be4,_0x135035){var _0x3b04e7={},_0x265b10={},_0x2040f5={'count':0x0,'rows':[]};var _0x21b85b=db['MailInteraction']['rawAttributes'];_0x265b10[_0x646a('0x3a')]=_[_0x646a('0x3b')](_0x21b85b);_0x265b10[_0x646a('0x3c')]=_[_0x646a('0x3b')](_0x160be4[_0x646a('0x3c')]);_0x265b10['filters']=_[_0x646a('0x3d')](_0x265b10[_0x646a('0x3a')],_0x265b10[_0x646a('0x3c')]);_0x3b04e7[_0x646a('0x3e')]=_[_0x646a('0x3d')](_0x265b10[_0x646a('0x3a')],qs[_0x646a('0x3f')](_0x160be4[_0x646a('0x3c')][_0x646a('0x3f')]));_0x3b04e7[_0x646a('0x3e')]=_0x3b04e7[_0x646a('0x3e')][_0x646a('0x40')]?_0x3b04e7['attributes']:_0x265b10[_0x646a('0x3a')];if(!_0x160be4[_0x646a('0x3c')]['hasOwnProperty'](_0x646a('0x41'))){_0x3b04e7[_0x646a('0x22')]=qs[_0x646a('0x22')](_0x160be4[_0x646a('0x3c')]['limit']);_0x3b04e7[_0x646a('0x21')]=qs['offset'](_0x160be4['query'][_0x646a('0x21')]);}_0x3b04e7['order']=qs[_0x646a('0x42')](_0x160be4['query']['sort']);_0x3b04e7[_0x646a('0x43')]=qs[_0x646a('0x44')](_['pick'](_0x160be4[_0x646a('0x3c')],_0x265b10[_0x646a('0x44')]));var _0x581b9a=[];var _0x114866=squel[_0x646a('0x45')]()[_0x646a('0x46')]('id')[_0x646a('0x46')](_0x646a('0x2b'))[_0x646a('0x46')](_0x646a('0x47'))['from']('tools_tags');var _0x3a0f75=squel[_0x646a('0x45')]()[_0x646a('0x46')](_0x646a('0x48'))['from'](_0x646a('0x49'),'me')[_0x646a('0x43')]('me.MailInteractionId\x20=\x20i.id')[_0x646a('0x43')](_0x646a('0x4a'))['where'](_0x646a('0x4b'));var _0x334653=squel[_0x646a('0x45')]()[_0x646a('0x46')](_0x646a('0x4c'))[_0x646a('0x46')](_0x646a('0x4d'))[_0x646a('0x4e')](_0x646a('0x4f'),'ui')[_0x646a('0x50')](_0x646a('0x51'),'u',_0x646a('0x52'));var _0x3fa076=squel['select']()[_0x646a('0x4e')](_0x646a('0x53'),'i')[_0x646a('0x50')](_0x646a('0x54'),'c',_0x646a('0x55'))['left_join'](_0x646a('0x51'),'o',_0x646a('0x56'))[_0x646a('0x50')](_0x646a('0x57'),'a','a.id\x20=\x20i.MailAccountId')['left_join']('mail_messages','me',_0x646a('0x58'));var _0x54562c=squel[_0x646a('0x59')]();if(_0x160be4[_0x646a('0x3c')][_0x646a('0x5a')]){var _0x154239=JSON[_0x646a('0x5b')](_0x160be4[_0x646a('0x3c')]['advancedFilter']);_['keys'](_0x154239)[_0x646a('0x31')](function(_0x59fe3f){var _0x3a1e79=_0x154239[_0x59fe3f];if(_0x59fe3f===_0x646a('0x5c')){var _0x53be57=moment(_0x3a1e79[_0x646a('0x5d')]['dateStart'])[_0x646a('0x5e')](_0x646a('0x5f'))[_0x646a('0x60')]()[_0x646a('0x61')]();var _0x429aed=moment(_0x429aed)['utc']()[_0x646a('0x62')](_0x646a('0x5f'))['format']();_0x54562c[_0x646a('0x63')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x53be57,_0x429aed);}else{if(_['isArray'](_0x3a1e79['condition'])){_0x3a1e79['condition'][_0x646a('0x31')](function(_0x2f4190){switch(_0x3a1e79[_0x646a('0x64')][_0x646a('0x5d')]){case'IS':if(_0x59fe3f!==_0x646a('0x65')&&_0x59fe3f!==_0x646a('0x66')){if(_[_0x646a('0x67')](_0x3a1e79[_0x646a('0x5d')])&&_0x3a1e79[_0x646a('0x5d')][_0x646a('0x40')]>0x1){_0x54562c['and'](_0x3a1e79['tableAlias']+'.'+_0x59fe3f+_0x646a('0x68'),_0x3a1e79['value']);}else{_0x54562c[_0x646a('0x63')](_0x3a1e79[_0x646a('0x69')]+'.'+_0x59fe3f+'\x20=\x20?',_0x3a1e79['value'][0x0]);}}break;case'=':_0x54562c[_0x646a('0x63')](_0x3a1e79['tableAlias']+'.'+_0x59fe3f+'\x20=\x20?',_0x3a1e79[_0x646a('0x5d')]);break;case'LIKE':if(_0x59fe3f===_0x646a('0x6a')){_0x54562c[_0x646a('0x63')](_0x646a('0x6b')+'\x20LIKE\x20?','%'+_0x3a1e79[_0x646a('0x5d')]+'%');_0x54562c['or'](_0x646a('0x6c')+_0x646a('0x6d'),'%'+_0x3a1e79[_0x646a('0x5d')]+'%');_0x54562c['or'](_0x646a('0x6e')+_0x646a('0x6d'),'%'+_0x3a1e79['value']+'%');}else{_0x54562c[_0x646a('0x63')](_0x3a1e79[_0x646a('0x69')]+'.'+_0x59fe3f+'\x20LIKE\x20?','%'+_0x3a1e79[_0x646a('0x5d')]+'%');}break;case'>':_0x54562c[_0x646a('0x63')](_0x3a1e79[_0x646a('0x69')]+'.'+_0x59fe3f+_0x646a('0x6f'),_0x3a1e79[_0x646a('0x5d')]);break;case'<':_0x54562c['and'](_0x3a1e79[_0x646a('0x69')]+'.'+_0x59fe3f+'\x20<\x20?',_0x3a1e79['value']);break;}});}else{switch(_0x3a1e79['condition']['value']){case'IS':if(_0x59fe3f!==_0x646a('0x65')&&_0x59fe3f!==_0x646a('0x66')){if(_['isArray'](_0x3a1e79[_0x646a('0x5d')])&&_0x3a1e79[_0x646a('0x5d')][_0x646a('0x40')]>0x1){_0x54562c[_0x646a('0x63')](_0x3a1e79[_0x646a('0x69')]+'.'+_0x59fe3f+_0x646a('0x68'),_0x3a1e79[_0x646a('0x5d')]);}else{_0x54562c[_0x646a('0x63')](_0x3a1e79[_0x646a('0x69')]+'.'+_0x59fe3f+_0x646a('0x70'),_0x3a1e79[_0x646a('0x5d')][0x0]);}}break;case'=':_0x54562c['and'](_0x3a1e79['tableAlias']+'.'+_0x59fe3f+_0x646a('0x70'),_0x3a1e79[_0x646a('0x5d')]);break;case _0x646a('0x71'):if(_0x59fe3f===_0x646a('0x6a')){_0x54562c['and'](_0x646a('0x6b')+'\x20LIKE\x20?','%'+_0x3a1e79[_0x646a('0x5d')]+'%');_0x54562c['or'](_0x646a('0x6c')+_0x646a('0x6d'),'%'+_0x3a1e79[_0x646a('0x5d')]+'%');_0x54562c['or'](_0x646a('0x6e')+'\x20LIKE\x20?','%'+_0x3a1e79[_0x646a('0x5d')]+'%');}else{_0x54562c[_0x646a('0x63')](_0x3a1e79[_0x646a('0x69')]+'.'+_0x59fe3f+'\x20LIKE\x20?','%'+_0x3a1e79[_0x646a('0x5d')]+'%');}break;case'>':_0x54562c['and'](_0x3a1e79['tableAlias']+'.'+_0x59fe3f+'\x20>\x20?',_0x3a1e79['value']);break;case'<':_0x54562c[_0x646a('0x63')](_0x3a1e79[_0x646a('0x69')]+'.'+_0x59fe3f+_0x646a('0x72'),_0x3a1e79[_0x646a('0x5d')]);break;}}}});}else{var _0xa6d4f9=_(Object[_0x646a('0x3b')](_0x160be4[_0x646a('0x3c')]))['map'](function(_0x27113a){return _0x21b85b[_0x646a('0x73')](_0x27113a)?_0x27113a:undefined;})['filter'](function(_0x2044d3){return!_['isNil'](_0x2044d3);})['value']();if(!_[_0x646a('0x74')](_0xa6d4f9)){_0xa6d4f9[_0x646a('0x31')](function(_0x26e1fb){if(_0x26e1fb===_0x646a('0x75')){_0x3fa076[_0x646a('0x43')](_0x646a('0x76'),[][_0x646a('0x77')](_0x160be4[_0x646a('0x3c')][_0x26e1fb]));}else if(_0x26e1fb===_0x646a('0x5c')){var _0x39e458=JSON[_0x646a('0x5b')](_0x160be4['query'][_0x26e1fb])[_0x646a('0x78')];var _0x2df358=JSON['parse'](_0x160be4[_0x646a('0x3c')][_0x26e1fb])[_0x646a('0x79')];_0x3fa076['where'](_0x646a('0x7a'),_0x39e458,_0x2df358);}else{if(_0x160be4[_0x646a('0x3c')][_0x26e1fb]==='null'){_0x3fa076['where']('i.'+_0x26e1fb+'\x20IS\x20NULL');}else{_0x3fa076[_0x646a('0x43')]('i.'+_0x26e1fb+_0x646a('0x70'),_0x160be4[_0x646a('0x3c')][_0x26e1fb]);}}});}if(_0x160be4[_0x646a('0x3c')]['filter']){var _0x41e204=_0x160be4[_0x646a('0x3c')]['filter'][_0x646a('0x7b')]('\x5c','\x5c\x5c')[_0x646a('0x7b')]('\x27\x27',_0x646a('0x7c'));if(qs[_0x646a('0x7d')](_0x41e204)){_0x54562c['or'](_0x646a('0x7e'),_0x41e204+'%');}else if(qs['isEmail'](_0x41e204)){_0x54562c['or'](_0x646a('0x7f'),_0x41e204+'%');}else{var _0x4803fd=[];_0x41e204[_0x646a('0x30')]('\x20')[_0x646a('0x31')](function(_0xd5dc4e){_0x4803fd['push']('+'+_0xd5dc4e[_0x646a('0x80')]());});var _0xa15d64=_0x4803fd[_0x646a('0x81')]('\x20');_0x54562c['or'](_0x646a('0x82'),_0xa15d64)['or'](_0x646a('0x83'),_0xa15d64);}}}_0x3fa076[_0x646a('0x43')](_0x54562c);if(_0x3b04e7['order']){_0x3b04e7[_0x646a('0x84')][_0x646a('0x31')](function(_0x2739af){_0x3fa076[_0x646a('0x84')]('i.'+_0x2739af[0x0],_0x2739af[0x1]===_0x646a('0x85')?![]:!![]);});}_0x3fa076[_0x646a('0x86')]('i.id');var _0x271e48={'type':db[_0x646a('0x87')][_0x646a('0x88')][_0x646a('0x89')],'raw':!![]};var _0x4bdc49=_0x3fa076[_0x646a('0x8a')]()[_0x646a('0x46')](_0x646a('0x48'))['field'](_0x646a('0x8b'),_0x646a('0x66'));if(!_0x160be4[_0x646a('0x3c')][_0x646a('0x5a')]){if(_0x160be4['query'][_0x646a('0x8c')]){if(_0x160be4[_0x646a('0x3c')][_0x646a('0x8c')]==0x1){_0x4bdc49[_0x646a('0x8d')](_0x646a('0x8e'));_0x3fa076[_0x646a('0x8d')]('`unreadMessages`\x20=\x200');}else{_0x4bdc49[_0x646a('0x8d')](_0x646a('0x8f'));_0x3fa076[_0x646a('0x8d')](_0x646a('0x8f'));}}if(_0x160be4['query'][_0x646a('0x90')]){var _0x59139a=_['isArray'](_0x160be4[_0x646a('0x3c')][_0x646a('0x90')])?_0x160be4[_0x646a('0x3c')]['tag']:new Array(_0x160be4[_0x646a('0x3c')][_0x646a('0x90')]);var _0x4677eb=squel[_0x646a('0x59')]();_0x59139a[_0x646a('0x31')](function(_0xcf030c){_0x4677eb['or'](_0x646a('0x91'),'%,'+_0xcf030c+',%');});_0x3fa076[_0x646a('0x8d')](_0x4677eb);_0x4bdc49['left_join'](_0x646a('0x92'),'it','it.MailInteractionId\x20=\x20i.id');_0x4bdc49['left_join'](_0x646a('0x93'),'t','t.id\x20=\x20it.TagId');_0x4bdc49[_0x646a('0x43')](_0x646a('0x94'),_0x59139a);}}else{var _0x154239=JSON[_0x646a('0x5b')](_0x160be4[_0x646a('0x3c')][_0x646a('0x5a')]);_[_0x646a('0x3b')](_0x154239)[_0x646a('0x31')](function(_0x1116f8){var _0x5a8e38=_0x154239[_0x1116f8];if(_0x1116f8===_0x646a('0x65')){var _0x30b5ad=_0x5a8e38['value'];var _0x440adf=squel[_0x646a('0x59')]();_0x30b5ad[_0x646a('0x31')](function(_0x1f311d){_0x440adf['or'](_0x646a('0x91'),'%,'+_0x1f311d+',%');});_0x3fa076[_0x646a('0x8d')](_0x440adf);_0x4bdc49[_0x646a('0x50')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x4bdc49[_0x646a('0x50')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x4bdc49[_0x646a('0x43')](_0x646a('0x94'),_0x30b5ad);}else if(_0x1116f8===_0x646a('0x66')){if(_0x5a8e38['value'][_0x646a('0x40')]===0x1){if(_0x5a8e38[_0x646a('0x5d')][0x0]===0x1){_0x4bdc49[_0x646a('0x8d')]('`unreadMessages`\x20=\x200');_0x3fa076[_0x646a('0x8d')](_0x646a('0x8e'));}else{_0x4bdc49['having'](_0x646a('0x8f'));_0x3fa076[_0x646a('0x8d')](_0x646a('0x8f'));}}}});}db['sequelize']['query'](_0x4bdc49[_0x646a('0x80')](),_0x271e48)[_0x646a('0x29')](function(_0x1d72e4){_0x2040f5[_0x646a('0x20')]=_0x1d72e4[_0x646a('0x40')];if(_0x2040f5['count']===0x0)return[];return db[_0x646a('0x95')]['query'](_0x114866['toString'](),_0x271e48)[_0x646a('0x29')](function(_0x12d3d9){_0x581b9a=_['keyBy'](_0x12d3d9,'id');_0x271e48=_[_0x646a('0x96')](_0x271e48,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x3fa076[_0x646a('0x46')](_0x646a('0x8b'),_0x646a('0x66'));_0x3fa076[_0x646a('0x46')](_0x646a('0x97'),_0x646a('0x98'));_0x3fa076['field'](_0x646a('0x99'),_0x646a('0x9a'));_0x3fa076['field'](_0x646a('0x9b'));_0x3fa076[_0x646a('0x46')](_0x646a('0x9c'));_0x3fa076[_0x646a('0x46')](_0x646a('0x9d'));_0x3fa076[_0x646a('0x46')](_0x646a('0x9e'));_0x3fa076[_0x646a('0x46')](_0x646a('0x9f'));_0x3fa076[_0x646a('0x46')](_0x646a('0xa0'));_0x3fa076['field']('i.lastMsgAt');_0x3fa076['field'](_0x646a('0xa1'));_0x3fa076['field'](_0x646a('0xa2'));_0x3fa076[_0x646a('0x46')](_0x646a('0xa3'));_0x3fa076[_0x646a('0x46')](_0x646a('0xa4'));_0x3fa076[_0x646a('0x46')](_0x646a('0xa5'));_0x3fa076['field'](_0x646a('0xa6'));_0x3fa076[_0x646a('0x46')](_0x646a('0xa7'));_0x3fa076['field'](_0x646a('0xa8'));_0x3fa076[_0x646a('0x46')](_0x646a('0x6b'),'Contact.firstName');_0x3fa076[_0x646a('0x46')]('c.lastName',_0x646a('0xa9'));_0x3fa076['field'](_0x646a('0x6e'),_0x646a('0xaa'));_0x3fa076[_0x646a('0x46')]('c.phone','Contact.phone');_0x3fa076[_0x646a('0x46')]('c.mobile','Contact.mobile');_0x3fa076[_0x646a('0x46')](_0x646a('0xab'),_0x646a('0xac'));_0x3fa076[_0x646a('0x46')](_0x646a('0xad'),_0x646a('0x2f'));_0x3fa076[_0x646a('0x50')](_0x646a('0x92'),'it',_0x646a('0xae'));_0x3fa076['left_join']('tools_tags','t',_0x646a('0xaf'));_0x3fa076[_0x646a('0x22')](_0x3b04e7['limit']);_0x3fa076[_0x646a('0x21')](_0x3b04e7[_0x646a('0x21')]);return db[_0x646a('0x95')][_0x646a('0x3c')](_0x3fa076[_0x646a('0x80')](),_0x271e48);})[_0x646a('0x29')](function(_0x22985a){_0x334653[_0x646a('0x43')](_0x646a('0xb0'),_[_0x646a('0xb1')](_0x22985a,'id'));return db['sequelize']['query'](_0x334653[_0x646a('0x80')](),_0x271e48)[_0x646a('0x29')](function(_0x1be71f){var _0x43b74d=_[_0x646a('0xb2')](_0x1be71f,_0x646a('0xb3'));var _0x4ed5c2=[];return db[_0x646a('0xb4')]['findOne']({'attributes':[_0x646a('0xb5')],'raw':!![]})[_0x646a('0x29')](function(_0x3266a3){var _0x47f439=_0x3266a3[_0x646a('0xb5')];_0x22985a[_0x646a('0x31')](function(_0x28602f){_0x4ed5c2['push'](updateMailInteraction(_0x28602f,_0x581b9a,_0x43b74d,_0x47f439));});return BPromise[_0x646a('0xb6')](_0x4ed5c2);});});});})[_0x646a('0x29')](function(_0x5c4586){_0x2040f5[_0x646a('0xb7')]=_0x5c4586;return _0x2040f5;})[_0x646a('0x29')](respondWithFilteredResult(_0x135035,_0x3b04e7))['catch'](handleError(_0x135035,null));};exports[_0x646a('0xb8')]=function(_0x4d2a1a,_0x636edb){var _0x7774ad={'raw':![],'where':{'id':_0x4d2a1a[_0x646a('0xb9')]['id']}},_0x12f100={};_0x12f100[_0x646a('0x3a')]=_['keys'](db[_0x646a('0x32')]['rawAttributes']);_0x12f100[_0x646a('0x3c')]=_[_0x646a('0x3b')](_0x4d2a1a[_0x646a('0x3c')]);_0x12f100[_0x646a('0x44')]=_[_0x646a('0x3d')](_0x12f100['model'],_0x12f100[_0x646a('0x3c')]);_0x7774ad['attributes']=_[_0x646a('0x3d')](_0x12f100['model'],qs[_0x646a('0x3f')](_0x4d2a1a['query'][_0x646a('0x3f')]));_0x7774ad[_0x646a('0x3e')]=_0x7774ad[_0x646a('0x3e')]['length']?_0x7774ad[_0x646a('0x3e')]:_0x12f100['model'];if(_0x4d2a1a[_0x646a('0x3c')][_0x646a('0xba')]){_0x7774ad[_0x646a('0xbb')]=[{'all':!![]}];}_0x7774ad=_[_0x646a('0x96')]({},_0x7774ad,_0x4d2a1a[_0x646a('0xbc')]);return db[_0x646a('0x32')][_0x646a('0xbd')](_0x7774ad)[_0x646a('0x29')](handleEntityNotFound(_0x636edb,null))['then'](respondWithResult(_0x636edb,null))[_0x646a('0x38')](handleError(_0x636edb,null));};exports[_0x646a('0xbe')]=function(_0x194e95,_0x45c405){return db['MailInteraction'][_0x646a('0xbe')](_0x194e95[_0x646a('0xbf')],{})[_0x646a('0x29')](respondWithResult(_0x45c405,0xc9))['catch'](handleError(_0x45c405,null));};exports[_0x646a('0x28')]=function(_0x3fafee,_0x27e8dc){if(_0x3fafee['body']['id']){delete _0x3fafee[_0x646a('0xbf')]['id'];}return db[_0x646a('0x32')]['find']({'where':{'id':_0x3fafee[_0x646a('0xb9')]['id']}})[_0x646a('0x29')](handleEntityNotFound(_0x27e8dc,null))[_0x646a('0x29')](saveUpdates(_0x3fafee[_0x646a('0xbf')],null))['then'](respondWithResult(_0x27e8dc,null))[_0x646a('0x38')](handleError(_0x27e8dc,null));};exports[_0x646a('0xc0')]=function(_0x5c2bd2,_0x1fca2d){return db['MailInteraction'][_0x646a('0xbd')]({'where':{'id':_0x5c2bd2['params']['id']}})[_0x646a('0x29')](handleEntityNotFound(_0x1fca2d,null))[_0x646a('0x29')](removeEntity(_0x1fca2d,null))[_0x646a('0x38')](handleError(_0x1fca2d,null));};exports[_0x646a('0xc1')]=function(_0x372c98,_0x5a622f){return db[_0x646a('0x32')]['describe']()[_0x646a('0x29')](respondWithResult(_0x5a622f,null))[_0x646a('0x38')](handleError(_0x5a622f,null));};exports[_0x646a('0xc2')]=function(_0x8a550,_0x40d962,_0x56144e){return db[_0x646a('0xc3')][_0x646a('0xbd')]({'where':{'id':_0x8a550[_0x646a('0xb9')]['id']}})[_0x646a('0x29')](handleEntityNotFound(_0x40d962,null))[_0x646a('0x29')](function(_0x2fbcab){if(_0x2fbcab){return _0x2fbcab['addMessage'](_0x8a550[_0x646a('0xbf')][_0x646a('0xc4')],_['omit'](_0x8a550['body'],[_0x646a('0xc4'),'id'])||{});}})[_0x646a('0x29')](respondWithResult(_0x40d962,null))[_0x646a('0x38')](handleError(_0x40d962,null));};exports['getMessages']=function(_0x34b03c,_0x3cc758,_0x2b78ad){var _0x61f7b={'raw':![],'where':{}};var _0x59eb9a={};var _0x9d205e={'count':0x0,'rows':[]};return db[_0x646a('0x32')][_0x646a('0x33')]({'where':{'id':_0x34b03c['params']['id']}})[_0x646a('0x29')](handleEntityNotFound(_0x3cc758,null))[_0x646a('0x29')](function(_0x245675){if(_0x245675){_0x59eb9a['model']=_[_0x646a('0x3b')](db['MailMessage'][_0x646a('0xc5')]);_0x59eb9a['query']=_[_0x646a('0x3b')](_0x34b03c[_0x646a('0x3c')]);_0x59eb9a[_0x646a('0x44')]=_[_0x646a('0x3d')](_0x59eb9a[_0x646a('0x3a')],_0x59eb9a[_0x646a('0x3c')]);_0x61f7b[_0x646a('0x3e')]=_[_0x646a('0x3d')](_0x59eb9a[_0x646a('0x3a')],qs['fields'](_0x34b03c[_0x646a('0x3c')][_0x646a('0x3f')]));_0x61f7b['attributes']=_0x61f7b['attributes'][_0x646a('0x40')]?_0x61f7b[_0x646a('0x3e')]:_0x59eb9a[_0x646a('0x3a')];if(!_0x34b03c['query'][_0x646a('0x73')]('nolimit')){_0x61f7b[_0x646a('0x22')]=qs['limit'](_0x34b03c['query'][_0x646a('0x22')]);_0x61f7b[_0x646a('0x21')]=qs['offset'](_0x34b03c[_0x646a('0x3c')][_0x646a('0x21')]);}_0x61f7b['order']=qs[_0x646a('0x42')](_0x34b03c[_0x646a('0x3c')]['sort']);_0x61f7b['where']=qs[_0x646a('0x44')](_['pick'](_0x34b03c[_0x646a('0x3c')],_0x59eb9a[_0x646a('0x44')]));_0x61f7b[_0x646a('0x43')][_0x646a('0xb3')]=_0x245675['id'];if(_0x34b03c[_0x646a('0x3c')][_0x646a('0xc6')]){_0x61f7b[_0x646a('0x43')]=_[_0x646a('0x96')](_0x61f7b[_0x646a('0x43')],{'$or':_['map'](_0x61f7b[_0x646a('0x3e')],function(_0x56ead7){var _0x5a7350={};_0x5a7350[_0x56ead7]={'$like':'%'+_0x34b03c[_0x646a('0x3c')]['filter']+'%'};return _0x5a7350;})});}if(_0x34b03c[_0x646a('0x3c')]['$gte']){var _0x3b79b7=_0x34b03c['query'][_0x646a('0x78')][_0x646a('0x30')](',');var _0x131ff4={};_0x131ff4[_0x3b79b7[0x0]]={'$gte':moment(_0x3b79b7[0x1])[_0x646a('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x61f7b[_0x646a('0x43')]=_['merge'](_0x61f7b[_0x646a('0x43')],_0x131ff4);}_0x61f7b=_[_0x646a('0x96')]({},_0x61f7b,_0x34b03c['options']);return db[_0x646a('0xc3')][_0x646a('0x20')]({'where':_0x61f7b[_0x646a('0x43')]})[_0x646a('0x29')](function(_0x126156){_0x9d205e[_0x646a('0x20')]=_0x126156;if(_0x34b03c['query'][_0x646a('0xba')]){_0x61f7b['include']=[{'all':!![]}];}return db[_0x646a('0xc3')][_0x646a('0xc7')](_0x61f7b);})[_0x646a('0x29')](function(_0x478fde){_0x9d205e[_0x646a('0xb7')]=_0x478fde;return _0x9d205e;});}})['then'](respondWithFilteredResult(_0x3cc758,_0x61f7b))['catch'](handleError(_0x3cc758,null));};exports[_0x646a('0xc8')]=function(_0x1747b5,_0x5a4494,_0x36b8ea){return db['MailInteraction'][_0x646a('0xbd')]({'where':{'id':_0x1747b5[_0x646a('0xb9')]['id']}})['then'](handleEntityNotFound(_0x5a4494,null))[_0x646a('0x29')](function(_0x2e0ba9){if(_0x2e0ba9){return _0x2e0ba9['setTags'](_0x1747b5[_0x646a('0xbf')][_0x646a('0xc4')],_['omit'](_0x1747b5[_0x646a('0xbf')],[_0x646a('0xc4'),'id'])||{})[_0x646a('0xc9')](function(){return db[_0x646a('0xca')][_0x646a('0xc7')]({'attributes':['id',_0x646a('0x2b'),_0x646a('0x47')],'where':{'id':_0x1747b5['body'][_0x646a('0xc4')]}});})[_0x646a('0x29')](function(_0x714d9a){socket['emit']('mailInteractionTags:save',{'id':Number(_0x1747b5[_0x646a('0xb9')]['id']),'tags':_0x714d9a||[]});return{'id':Number(_0x1747b5[_0x646a('0xb9')]['id']),'tags':_0x714d9a||[]};});}})[_0x646a('0x29')](respondWithResult(_0x5a4494,null))[_0x646a('0x38')](handleError(_0x5a4494,null));};exports['removeTags']=function(_0x4d2c9c,_0x1d78d5,_0x5039cb){return db[_0x646a('0x32')][_0x646a('0xbd')]({'where':{'id':_0x4d2c9c[_0x646a('0xb9')]['id']}})['then'](handleEntityNotFound(_0x1d78d5,null))[_0x646a('0x29')](function(_0x6c7148){if(_0x6c7148){return _0x6c7148[_0x646a('0xcb')](_0x4d2c9c[_0x646a('0x3c')]['ids']);}})['then'](respondWithStatusCode(_0x1d78d5,null))[_0x646a('0x38')](handleError(_0x1d78d5,null));};exports['download']=function(_0x552f6a,_0x13a83a){var _0x56b41d=moment()[_0x646a('0xcc')]()['toString']();var _0x58ebc4=path['join'](config['root'],_0x646a('0xcd'),_0x646a('0xce'),_0x646a('0xcf'));var _0x536984=path[_0x646a('0x81')](config[_0x646a('0xd0')],_0x646a('0xcd'),'files',_0x646a('0xd1'));var _0x379b91=path[_0x646a('0x81')](_0x536984,_0x56b41d);var _0x205fcb=util['format'](_0x646a('0xd2'),_0x56b41d);var _0x5a504f=path[_0x646a('0x81')](_0x536984,_0x205fcb);var _0x165863=![];return db[_0x646a('0x32')][_0x646a('0xbd')]({'where':{'id':_0x552f6a[_0x646a('0xb9')]['id']}})[_0x646a('0x29')](handleEntityNotFound(_0x13a83a,null))['then'](function(_0xc5527a){if(_0xc5527a){return _0xc5527a[_0x646a('0xd3')]({'attributes':['id',_0x646a('0xbf'),_0x646a('0x4e'),'to','cc',_0x646a('0xd4'),_0x646a('0xd5'),_0x646a('0x5c')],'where':{'secret':![]},'include':_0x552f6a[_0x646a('0x3c')]['attachments']?[{'model':db[_0x646a('0xd6')],'as':_0x646a('0xd7')}]:undefined,'order':qs[_0x646a('0x42')]('id')});}return[];})['then'](function(_0x1e13de){_0x165863=_0x1e13de[_0x646a('0x40')];if(_0x1e13de[_0x646a('0x40')]){fs[_0x646a('0xd8')](_0x379b91);return BPromise[_0x646a('0xd9')](_0x1e13de,function(_0x33317e,_0x383259){var _0x3c3895=_0x33317e;var _0x114f7e={'from':_0x3c3895[_0x646a('0x4e')],'to':_0x3c3895['to'],'subject':_0x3c3895['subject'],'html':_0x3c3895[_0x646a('0xbf')],'headers':{'Date':moment(_0x3c3895[_0x646a('0x5c')])[_0x646a('0x61')](_0x646a('0xda'))},'attachments':[]};if(_0x33317e['cc']){_0x114f7e[_0x646a('0xdb')]['Cc']=_0x33317e['cc'];}if(_0x33317e[_0x646a('0xd4')]){_0x114f7e[_0x646a('0xdb')][_0x646a('0xdc')]=_0x33317e[_0x646a('0xd4')];}return new BPromise(function(_0x123d9f,_0x555e0a){if(_0x33317e[_0x646a('0xd7')]){for(var _0x5f4e11=0x0;_0x5f4e11<_0x33317e[_0x646a('0xd7')][_0x646a('0x40')];_0x5f4e11++){var _0x275e43=_0x33317e['Attachments'][_0x5f4e11];var _0x22b74a=path[_0x646a('0x81')](_0x58ebc4,_0x275e43[_0x646a('0xdd')]);if(fs['existsSync'](_0x22b74a)){_0x114f7e[_0x646a('0xcf')]['push']({'name':_0x275e43[_0x646a('0x2b')],'contentType':_0x275e43[_0x646a('0xde')],'data':fs[_0x646a('0xdf')](_0x22b74a)});}}}emlformat[_0x646a('0xe0')](_0x114f7e,function(_0x47b141,_0x3274f3){if(_0x47b141)return _0x555e0a(_0x47b141);fs['writeFileSync'](path[_0x646a('0x81')](_0x379b91,util[_0x646a('0x61')](_0x646a('0xe1'),_0x383259)),_0x3274f3);return _0x123d9f(_0x3274f3);});});});}})[_0x646a('0x29')](function(){if(_0x165863){return new BPromise(function(_0x1d63a4,_0x34ecf2){zipdir(_0x379b91,{'saveTo':_0x5a504f},function(_0x4962ab,_0x2bdbc2){if(_0x4962ab)return _0x34ecf2(_0x4962ab);return _0x1d63a4(_0x2bdbc2);});});}})[_0x646a('0x29')](function(){if(_0x165863){return new BPromise(function(_0x3e6939,_0x167d76){rimraf(_0x379b91,function(_0x4931ce){if(_0x4931ce)_0x167d76(_0x4931ce);return _0x3e6939();});});}})[_0x646a('0x29')](function(){if(_0x165863){return _0x13a83a['download'](_0x5a504f,_0x205fcb,function(_0x190d7b){if(_0x190d7b){console[_0x646a('0xe2')]('err',_0x190d7b);}else{fs[_0x646a('0xe3')](_0x5a504f);}});}else{return _0x13a83a['sendStatus'](0xc8);}})[_0x646a('0x38')](handleError(_0x13a83a,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 123886c..dd6a7c2 100644 --- a/server/api/mailInteraction/mailInteraction.events.js +++ b/server/api/mailInteraction/mailInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x384a=['then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','remove','getUsers'];(function(_0x3250f7,_0x1c2afc){var _0xdb6ac4=function(_0x5a23f8){while(--_0x5a23f8){_0x3250f7['push'](_0x3250f7['shift']());}};_0xdb6ac4(++_0x1c2afc);}(_0x384a,0x192));var _0xa384=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x384a[_0x5447fd];return _0x15b28a;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0xa384('0x0'))['db'][_0xa384('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xa384('0x2')](0x0);var events={'afterCreate':_0xa384('0x3'),'afterUpdate':'update','afterDestroy':_0xa384('0x4')};function emitEvent(_0x4911ea){return function(_0x32288e,_0x29d2f6,_0x19d23b){_0x32288e[_0xa384('0x5')]({'attributes':['id'],'raw':!![]})[_0xa384('0x6')](function(_0x5ec7bc){_0x32288e[_0xa384('0x7')](_0xa384('0x8'),_0x5ec7bc['map'](function(_0x4690b4){return{'id':_0x4690b4['id']};}));return MailMessage[_0xa384('0x9')]({'where':{'MailInteractionId':_0x32288e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa384('0x6')](function(_0x3d5dfd){_0x32288e['setDataValue'](_0xa384('0xa'),_0x3d5dfd[_0xa384('0xb')]);MailInteractionEvents[_0xa384('0xc')](_0x4911ea+':'+_0x32288e['id'],_0x32288e);MailInteractionEvents[_0xa384('0xc')](_0x4911ea,_0x32288e);_0x19d23b(null);})[_0xa384('0xd')](_0x19d23b(null));};}for(var e in events){if(events[_0xa384('0xe')](e)){var event=events[e];MailInteraction[_0xa384('0xf')](e,emitEvent(event));}}module[_0xa384('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x8a48=['unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll'];(function(_0x21b61d,_0x2946a1){var _0x168d2f=function(_0xe5c0ac){while(--_0xe5c0ac){_0x21b61d['push'](_0x21b61d['shift']());}};_0x168d2f(++_0x2946a1);}(_0x8a48,0x149));var _0x88a4=function(_0x845400,_0x41edc0){_0x845400=_0x845400-0x0;var _0x2445f7=_0x8a48[_0x845400];return _0x2445f7;};'use strict';var EventEmitter=require(_0x88a4('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x88a4('0x1')];var MailMessage=require(_0x88a4('0x2'))['db'][_0x88a4('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x88a4('0x4')](0x0);var events={'afterCreate':_0x88a4('0x5'),'afterUpdate':_0x88a4('0x6'),'afterDestroy':_0x88a4('0x7')};function emitEvent(_0x44d796){return function(_0x5b80d2,_0x1e41ec,_0x3a85a2){_0x5b80d2['getUsers']({'attributes':['id'],'raw':!![]})[_0x88a4('0x8')](function(_0x41610f){_0x5b80d2[_0x88a4('0x9')](_0x88a4('0xa'),_0x41610f[_0x88a4('0xb')](function(_0x36e507){return{'id':_0x36e507['id']};}));return MailMessage[_0x88a4('0xc')]({'where':{'MailInteractionId':_0x5b80d2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x88a4('0x8')](function(_0x3e57fe){_0x5b80d2['setDataValue'](_0x88a4('0xd'),_0x3e57fe['length']);MailInteractionEvents[_0x88a4('0xe')](_0x44d796+':'+_0x5b80d2['id'],_0x5b80d2);MailInteractionEvents[_0x88a4('0xe')](_0x44d796,_0x5b80d2);_0x3a85a2(null);})[_0x88a4('0xf')](_0x3a85a2(null));};}for(var e in events){if(events[_0x88a4('0x10')](e)){var event=events[e];MailInteraction[_0x88a4('0x11')](e,emitEvent(event));}}module[_0x88a4('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 12e1469..de9ce8b 100644 --- a/server/api/mailInteraction/mailInteraction.model.js +++ b/server/api/mailInteraction/mailInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c11=['closed','closedAt','changed','models','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4c11,0x91));var _0x14c1=function(_0x30ba61,_0x48b905){_0x30ba61=_0x30ba61-0x0;var _0x7300ad=_0x4c11[_0x30ba61];return _0x7300ad;};'use strict';var _=require(_0x14c1('0x0'));var util=require('util');var logger=require(_0x14c1('0x1'))('api');var moment=require(_0x14c1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x14c1('0x3'));var rimraf=require(_0x14c1('0x4'));var config=require(_0x14c1('0x5'));var attributes=require(_0x14c1('0x6'));module[_0x14c1('0x7')]=function(_0x4dc5ea,_0xa1012b){return _0x4dc5ea['define'](_0x14c1('0x8'),attributes,{'tableName':_0x14c1('0x9'),'paranoid':![],'indexes':[{'name':_0x14c1('0xa'),'fields':[_0x14c1('0xb'),'to'],'type':_0x14c1('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x31753d,_0x17eb28,_0x2d7919){if(_0x31753d[_0x14c1('0xd')]){_0x31753d[_0x14c1('0xe')]=moment()[_0x14c1('0xf')](_0x14c1('0x10'));}if(_0x31753d[_0x14c1('0x11')]){_0x31753d[_0x14c1('0x12')]=moment()[_0x14c1('0xf')](_0x14c1('0x10'));}_0x2d7919(null,_0x17eb28);},'beforeUpdate':function(_0x496899,_0x32a520,_0x57d88a){if(_0x496899['changed'](_0x14c1('0xd'))){_0x496899['substatusAt']=moment()[_0x14c1('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x496899[_0x14c1('0x13')](_0x14c1('0x11'))){_0x496899[_0x14c1('0x12')]=moment()[_0x14c1('0xf')](_0x14c1('0x10'));}_0x57d88a(null,_0x496899);},'afterUpdate':function(_0x21fb8f,_0x11cb42,_0x50c967){var _0x524291=_0x4dc5ea[_0x14c1('0x14')];var _0x4c65b3=_0x21fb8f[_0x14c1('0x15')]({'plain':!![]});if(_0x4c65b3['closed']){return _0x524291[_0x14c1('0x16')][_0x14c1('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x4c65b3['id']}})['then'](function(){_0x50c967();})[_0x14c1('0x18')](function(_0x48e51e){_0x50c967(_0x48e51e);});}else{_0x50c967();}}},'charset':_0x14c1('0x19'),'collate':_0x14c1('0x1a')});}; \ No newline at end of file +var _0xf691=['utf8mb4','api','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','MailInteraction','mail_interactions','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','models','get','MailMessage','update','then','catch'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xf691,0x143));var _0x1f69=function(_0x285c71,_0x172e2c){_0x285c71=_0x285c71-0x0;var _0x488315=_0xf691[_0x285c71];return _0x488315;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1f69('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1f69('0x1'));var fs=require('fs');var path=require(_0x1f69('0x2'));var rimraf=require(_0x1f69('0x3'));var config=require(_0x1f69('0x4'));var attributes=require(_0x1f69('0x5'));module['exports']=function(_0x435719,_0x3d8a8b){return _0x435719['define'](_0x1f69('0x6'),attributes,{'tableName':_0x1f69('0x7'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x1f69('0x8')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x319a31,_0x1446da,_0x404c99){if(_0x319a31['substatus']){_0x319a31[_0x1f69('0x9')]=moment()[_0x1f69('0xa')](_0x1f69('0xb'));}if(_0x319a31[_0x1f69('0xc')]){_0x319a31[_0x1f69('0xd')]=moment()[_0x1f69('0xa')](_0x1f69('0xb'));}_0x404c99(null,_0x1446da);},'beforeUpdate':function(_0x1022cb,_0x56cd4b,_0x1fbd3f){if(_0x1022cb[_0x1f69('0xe')](_0x1f69('0xf'))){_0x1022cb[_0x1f69('0x9')]=moment()[_0x1f69('0xa')](_0x1f69('0xb'));}if(_0x1022cb[_0x1f69('0xe')](_0x1f69('0xc'))){_0x1022cb[_0x1f69('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1fbd3f(null,_0x1022cb);},'afterUpdate':function(_0x54371b,_0x289d63,_0x2d425c){var _0x545ad8=_0x435719[_0x1f69('0x10')];var _0x56fdc3=_0x54371b[_0x1f69('0x11')]({'plain':!![]});if(_0x56fdc3[_0x1f69('0xc')]){return _0x545ad8[_0x1f69('0x12')][_0x1f69('0x13')]({'read':!![]},{'where':{'MailInteractionId':_0x56fdc3['id']}})[_0x1f69('0x14')](function(){_0x2d425c();})[_0x1f69('0x15')](function(_0x3ac07a){_0x2d425c(_0x3ac07a);});}else{_0x2d425c();}}},'charset':_0x1f69('0x16'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index bf1eb34..fbed108 100644 --- a/server/api/mailInteraction/mailInteraction.rpc.js +++ b/server/api/mailInteraction/mailInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1df5=['./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailInteraction','MailInteraction','body','options','where','attributes','limit','catch','AddTagsToMailInteraction','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis'];(function(_0x774575,_0x189c9a){var _0x4b03ea=function(_0x2df665){while(--_0x2df665){_0x774575['push'](_0x774575['shift']());}};_0x4b03ea(++_0x189c9a);}(_0x1df5,0xfd));var _0x51df=function(_0x39b8b4,_0x5cbb09){_0x39b8b4=_0x39b8b4-0x0;var _0x2d2100=_0x1df5[_0x39b8b4];return _0x2d2100;};'use strict';var _=require(_0x51df('0x0'));var util=require(_0x51df('0x1'));var moment=require(_0x51df('0x2'));var BPromise=require(_0x51df('0x3'));var rs=require(_0x51df('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51df('0x5'))['db'];var utils=require(_0x51df('0x6'));var logger=require(_0x51df('0x7'))(_0x51df('0x8'));var config=require(_0x51df('0x9'));var jayson=require(_0x51df('0xa'));var client=jayson[_0x51df('0xb')][_0x51df('0xc')]({'port':0x232a});config['redis']=_[_0x51df('0xd')](config['redis'],{'host':_0x51df('0xe'),'port':0x18eb});var socket=require(_0x51df('0xf'))(new Redis(config[_0x51df('0x10')]));require(_0x51df('0x11'))[_0x51df('0x12')](socket);function respondWithRpcPromise(_0x130cd5,_0x6ebea,_0x45c6f5){return new BPromise(function(_0x5f0736,_0x3b2224){return client[_0x51df('0x13')](_0x130cd5,_0x45c6f5)[_0x51df('0x14')](function(_0x26e508){logger[_0x51df('0x15')](_0x51df('0x16'),_0x6ebea,_0x51df('0x17'));logger[_0x51df('0x18')](_0x51df('0x19'),_0x6ebea,_0x51df('0x17'),JSON[_0x51df('0x1a')](_0x26e508));if(_0x26e508[_0x51df('0x1b')]){if(_0x26e508[_0x51df('0x1b')][_0x51df('0x1c')]===0x1f4){logger[_0x51df('0x1b')]('MailInteraction,\x20%s,\x20%s',_0x6ebea,_0x26e508[_0x51df('0x1b')][_0x51df('0x1d')]);return _0x3b2224(_0x26e508['error'][_0x51df('0x1d')]);}logger[_0x51df('0x1b')](_0x51df('0x16'),_0x6ebea,_0x26e508['error'][_0x51df('0x1d')]);return _0x5f0736(_0x26e508[_0x51df('0x1b')][_0x51df('0x1d')]);}else{logger[_0x51df('0x15')]('MailInteraction,\x20%s,\x20%s',_0x6ebea,_0x51df('0x17'));_0x5f0736(_0x26e508[_0x51df('0x1e')][_0x51df('0x1d')]);}})['catch'](function(_0x39f373){logger['error'](_0x51df('0x16'),_0x6ebea,_0x39f373);_0x3b2224(_0x39f373);});});}exports[_0x51df('0x1f')]=function(_0x38f08a){var _0x23d4e0=this;return new Promise(function(_0x560466,_0xfba51f){return db[_0x51df('0x20')]['update'](_0x38f08a[_0x51df('0x21')],{'raw':_0x38f08a['options']?_0x38f08a[_0x51df('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38f08a['options']?_0x38f08a[_0x51df('0x22')][_0x51df('0x23')]||null:null,'attributes':_0x38f08a[_0x51df('0x22')]?_0x38f08a[_0x51df('0x22')][_0x51df('0x24')]||null:null,'limit':_0x38f08a[_0x51df('0x22')]?_0x38f08a[_0x51df('0x22')][_0x51df('0x25')]||null:null})[_0x51df('0x14')](function(_0x40b6c7){logger[_0x51df('0x15')](_0x51df('0x1f'),_0x38f08a);logger[_0x51df('0x18')](_0x51df('0x1f'),_0x38f08a,JSON[_0x51df('0x1a')](_0x40b6c7));_0x560466(_0x40b6c7);})[_0x51df('0x26')](function(_0x1ee6e2){logger[_0x51df('0x1b')](_0x51df('0x1f'),_0x1ee6e2[_0x51df('0x1d')],_0x38f08a);_0xfba51f(_0x23d4e0['error'](0x1f4,_0x1ee6e2['message']));});});};exports[_0x51df('0x27')]=function(_0x3889cd){return new Promise(function(_0x1c961c,_0x12b16a){return db[_0x51df('0x20')]['find']({'where':_0x3889cd['options']?_0x3889cd[_0x51df('0x22')][_0x51df('0x23')]||null:null})[_0x51df('0x14')](function(_0x464dfc){if(_0x464dfc){return _0x464dfc[_0x51df('0x28')](_0x3889cd[_0x51df('0x21')]['ids'],_[_0x51df('0x29')](_0x3889cd[_0x51df('0x21')],[_0x51df('0x2a'),'id'])||{});}})[_0x51df('0x2b')](function(_0x3a391c){logger[_0x51df('0x15')](_0x51df('0x2c'),_0x3889cd);logger[_0x51df('0x18')](_0x51df('0x2c'),_0x3889cd,JSON['stringify'](_0x3a391c));_0x1c961c(_0x3a391c);})[_0x51df('0x26')](function(_0x2cefcc){logger[_0x51df('0x1b')]('AddTags',_0x2cefcc[_0x51df('0x1d')],_0x3889cd);_0x12b16a(_this[_0x51df('0x1b')](0x1f4,_0x2cefcc['message']));});});}; \ No newline at end of file +var _0xe189=['result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','AddTagsToMailInteraction','where','ids','omit','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x5f0d7d,_0x459796){var _0x4b5459=function(_0x6e503b){while(--_0x6e503b){_0x5f0d7d['push'](_0x5f0d7d['shift']());}};_0x4b5459(++_0x459796);}(_0xe189,0x194));var _0x9e18=function(_0x2707dd,_0x4a9a4c){_0x2707dd=_0x2707dd-0x0;var _0x2c6934=_0xe189[_0x2707dd];return _0x2c6934;};'use strict';var _=require(_0x9e18('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9e18('0x1'));var rs=require(_0x9e18('0x2'));var fs=require('fs');var Redis=require(_0x9e18('0x3'));var db=require(_0x9e18('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e18('0x5'));var config=require(_0x9e18('0x6'));var jayson=require(_0x9e18('0x7'));var client=jayson[_0x9e18('0x8')][_0x9e18('0x9')]({'port':0x232a});config['redis']=_[_0x9e18('0xa')](config[_0x9e18('0xb')],{'host':_0x9e18('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9e18('0xb')]));require(_0x9e18('0xd'))[_0x9e18('0xe')](socket);function respondWithRpcPromise(_0x5dddd4,_0x9ee9df,_0x2933bc){return new BPromise(function(_0x46ba91,_0x25ca49){return client[_0x9e18('0xf')](_0x5dddd4,_0x2933bc)[_0x9e18('0x10')](function(_0x1cc018){logger[_0x9e18('0x11')](_0x9e18('0x12'),_0x9ee9df,'request\x20sent');logger[_0x9e18('0x13')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x9ee9df,_0x9e18('0x14'),JSON[_0x9e18('0x15')](_0x1cc018));if(_0x1cc018['error']){if(_0x1cc018[_0x9e18('0x16')][_0x9e18('0x17')]===0x1f4){logger[_0x9e18('0x16')](_0x9e18('0x12'),_0x9ee9df,_0x1cc018['error'][_0x9e18('0x18')]);return _0x25ca49(_0x1cc018['error']['message']);}logger[_0x9e18('0x16')]('MailInteraction,\x20%s,\x20%s',_0x9ee9df,_0x1cc018[_0x9e18('0x16')][_0x9e18('0x18')]);return _0x46ba91(_0x1cc018[_0x9e18('0x16')][_0x9e18('0x18')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x9ee9df,_0x9e18('0x14'));_0x46ba91(_0x1cc018[_0x9e18('0x19')]['message']);}})[_0x9e18('0x1a')](function(_0x523a4e){logger[_0x9e18('0x16')]('MailInteraction,\x20%s,\x20%s',_0x9ee9df,_0x523a4e);_0x25ca49(_0x523a4e);});});}exports[_0x9e18('0x1b')]=function(_0x3d83bb){var _0x20b492=this;return new Promise(function(_0x25b134,_0x1fb910){return db[_0x9e18('0x1c')][_0x9e18('0x1d')](_0x3d83bb[_0x9e18('0x1e')],{'raw':_0x3d83bb[_0x9e18('0x1f')]?_0x3d83bb['options'][_0x9e18('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d83bb[_0x9e18('0x1f')]?_0x3d83bb[_0x9e18('0x1f')]['where']||null:null,'attributes':_0x3d83bb[_0x9e18('0x1f')]?_0x3d83bb['options'][_0x9e18('0x21')]||null:null,'limit':_0x3d83bb['options']?_0x3d83bb[_0x9e18('0x1f')]['limit']||null:null})[_0x9e18('0x10')](function(_0x1bd289){logger['info'](_0x9e18('0x1b'),_0x3d83bb);logger['debug']('UpdateMailInteraction',_0x3d83bb,JSON[_0x9e18('0x15')](_0x1bd289));_0x25b134(_0x1bd289);})['catch'](function(_0x4513e7){logger['error'](_0x9e18('0x1b'),_0x4513e7[_0x9e18('0x18')],_0x3d83bb);_0x1fb910(_0x20b492[_0x9e18('0x16')](0x1f4,_0x4513e7[_0x9e18('0x18')]));});});};exports[_0x9e18('0x22')]=function(_0x13d3c2){return new Promise(function(_0x10c119,_0x3917fb){return db[_0x9e18('0x1c')]['find']({'where':_0x13d3c2[_0x9e18('0x1f')]?_0x13d3c2[_0x9e18('0x1f')][_0x9e18('0x23')]||null:null})[_0x9e18('0x10')](function(_0x493c05){if(_0x493c05){return _0x493c05['addTags'](_0x13d3c2[_0x9e18('0x1e')][_0x9e18('0x24')],_[_0x9e18('0x25')](_0x13d3c2[_0x9e18('0x1e')],[_0x9e18('0x24'),'id'])||{});}})['spread'](function(_0xa72999){logger[_0x9e18('0x11')](_0x9e18('0x26'),_0x13d3c2);logger[_0x9e18('0x13')](_0x9e18('0x26'),_0x13d3c2,JSON[_0x9e18('0x15')](_0xa72999));_0x10c119(_0xa72999);})['catch'](function(_0x1d0ca4){logger[_0x9e18('0x16')](_0x9e18('0x26'),_0x1d0ca4[_0x9e18('0x18')],_0x13d3c2);_0x3917fb(_this[_0x9e18('0x16')](0x1f4,_0x1d0ca4['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index eb8688a..ed647aa 100644 --- a/server/api/mailInteraction/mailInteraction.socket.js +++ b/server/api/mailInteraction/mailInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaaed=['./mailInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x14d3b5,_0x37d90a){var _0x366851=function(_0x2b1fcd){while(--_0x2b1fcd){_0x14d3b5['push'](_0x14d3b5['shift']());}};_0x366851(++_0x37d90a);}(_0xaaed,0x70));var _0xdaae=function(_0x3b7ec2,_0x1a63f1){_0x3b7ec2=_0x3b7ec2-0x0;var _0x144fbc=_0xaaed[_0x3b7ec2];return _0x144fbc;};'use strict';var MailInteractionEvents=require(_0xdaae('0x0'));var events=[_0xdaae('0x1'),_0xdaae('0x2'),_0xdaae('0x3')];function createListener(_0x41e02a,_0x50d133){return function(_0x1a8977){_0x50d133[_0xdaae('0x4')](_0x41e02a,_0x1a8977);};}function removeListener(_0x407e2b,_0x5b457f){return function(){MailInteractionEvents[_0xdaae('0x5')](_0x407e2b,_0x5b457f);};}exports[_0xdaae('0x6')]=function(_0x13e67c){for(var _0x5ac893=0x0,_0x51b911=events['length'];_0x5ac893<_0x51b911;_0x5ac893++){var _0x46480f=events[_0x5ac893];var _0x70280f=createListener('mailInteraction:'+_0x46480f,_0x13e67c);MailInteractionEvents['on'](_0x46480f,_0x70280f);}}; \ No newline at end of file +var _0x26c5=['emit','register','mailInteraction:','./mailInteraction.events','remove','update'];(function(_0x3168bf,_0x5bca73){var _0x134a83=function(_0x3d4a89){while(--_0x3d4a89){_0x3168bf['push'](_0x3168bf['shift']());}};_0x134a83(++_0x5bca73);}(_0x26c5,0x1b3));var _0x526c=function(_0xc1bc4b,_0x3b3d8e){_0xc1bc4b=_0xc1bc4b-0x0;var _0x599b84=_0x26c5[_0xc1bc4b];return _0x599b84;};'use strict';var MailInteractionEvents=require(_0x526c('0x0'));var events=['save',_0x526c('0x1'),_0x526c('0x2')];function createListener(_0x14b25f,_0x115a5f){return function(_0x551197){_0x115a5f[_0x526c('0x3')](_0x14b25f,_0x551197);};}function removeListener(_0x25bcfe,_0x381c85){return function(){MailInteractionEvents['removeListener'](_0x25bcfe,_0x381c85);};}exports[_0x526c('0x4')]=function(_0x4c09bb){for(var _0x8b4cf5=0x0,_0x524ad9=events['length'];_0x8b4cf5<_0x524ad9;_0x8b4cf5++){var _0x1e26e5=events[_0x8b4cf5];var _0x11304c=createListener(_0x526c('0x5')+_0x1e26e5,_0x4c09bb);MailInteractionEvents['on'](_0x1e26e5,_0x11304c);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index f9c70cf..eb78966 100644 --- a/server/api/mailMessage/index.js +++ b/server/api/mailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['mailmessage:create','create','put','update','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','tracked','mail'];(function(_0x2391f4,_0x4ca2a3){var _0xac5401=function(_0x2c7977){while(--_0x2c7977){_0x2391f4['push'](_0x2391f4['shift']());}};_0xac5401(++_0x4ca2a3);}(_0x7217,0x19e));var _0x7721=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x7217[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0x7')](_0x7721('0xc'),auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0x7')](_0x7721('0xe'),auth[_0x7721('0x8')](),controller['download']);router[_0x7721('0xf')]('/',auth[_0x7721('0x8')](),interaction[_0x7721('0x10')](_0x7721('0x11'),_0x7721('0x12')),controller[_0x7721('0x13')]);router[_0x7721('0x14')](_0x7721('0xc'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x14')]('/:id/accept',auth[_0x7721('0x8')](),controller[_0x7721('0x16')]);router[_0x7721('0x14')](_0x7721('0x17'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router[_0x7721('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7721('0x1a')]=router; \ No newline at end of file +var _0x9c5a=['isAuthenticated','get','/describe','/:id','show','download','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailMessage.controller'];(function(_0xfbba38,_0x651026){var _0x716876=function(_0x3d3f09){while(--_0x3d3f09){_0xfbba38['push'](_0xfbba38['shift']());}};_0x716876(++_0x651026);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x5d0806,_0x5daf1a){_0x5d0806=_0x5d0806-0x0;var _0x17de6f=_0x9c5a[_0x5d0806];return _0x17de6f;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var auth=require(_0xa9c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa9c5('0x6'));var controller=require(_0xa9c5('0x7'));router['get']('/',auth[_0xa9c5('0x8')](),controller['index']);router[_0xa9c5('0x9')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xa9c5('0x9')](_0xa9c5('0xb'),auth['isAuthenticated'](),controller[_0xa9c5('0xc')]);router[_0xa9c5('0x9')]('/:id/download',auth[_0xa9c5('0x8')](),controller[_0xa9c5('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xa9c5('0xe')](_0xa9c5('0xf'),_0xa9c5('0x10')),controller[_0xa9c5('0x11')]);router[_0xa9c5('0x12')](_0xa9c5('0xb'),auth[_0xa9c5('0x8')](),controller[_0xa9c5('0x13')]);router[_0xa9c5('0x12')](_0xa9c5('0x14'),auth['isAuthenticated'](),controller[_0xa9c5('0x15')]);router[_0xa9c5('0x12')](_0xa9c5('0x16'),auth[_0xa9c5('0x8')](),controller[_0xa9c5('0x17')]);router[_0xa9c5('0x18')](_0xa9c5('0xb'),auth[_0xa9c5('0x8')](),controller[_0xa9c5('0x19')]);module[_0xa9c5('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 6fae4b6..7a9c1a0 100644 --- a/server/api/mailMessage/mailMessage.attributes.js +++ b/server/api/mailMessage/mailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb145=['out','STRING','INTEGER','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM'];(function(_0x3f12fc,_0x28118a){var _0x25cd6a=function(_0x196e07){while(--_0x196e07){_0x3f12fc['push'](_0x3f12fc['shift']());}};_0x25cd6a(++_0x28118a);}(_0xb145,0xa3));var _0x5b14=function(_0x4a7068,_0x14bb90){_0x4a7068=_0x4a7068-0x0;var _0x30c63a=_0xb145[_0x4a7068];return _0x30c63a;};'use strict';var Sequelize=require('sequelize');var _=require(_0x5b14('0x0'));module[_0x5b14('0x1')]={'body':{'type':Sequelize[_0x5b14('0x2')](_0x5b14('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5b14('0x2')](_0x5b14('0x4'))},'read':{'type':Sequelize[_0x5b14('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5b14('0x6')]('in','out'),'defaultValue':_0x5b14('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5b14('0x8')](0x1fe)},'from':{'type':Sequelize[_0x5b14('0x8')]},'to':{'type':Sequelize[_0x5b14('0x2')]('long')},'cc':{'type':Sequelize[_0x5b14('0x2')](_0x5b14('0x3'))},'bcc':{'type':Sequelize[_0x5b14('0x2')](_0x5b14('0x3'))},'subject':{'type':Sequelize[_0x5b14('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x5b14('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x5b14('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x5b14('0x2')](_0x5b14('0x3'))},'originCc':{'type':Sequelize[_0x5b14('0x2')](_0x5b14('0x3'))}}; \ No newline at end of file +var _0x1267=['ENUM','out','STRING','INTEGER','DATE','sequelize','lodash','long','TEXT','medium','BOOLEAN'];(function(_0xe24812,_0x2f4b47){var _0x116e19=function(_0x19d364){while(--_0x19d364){_0xe24812['push'](_0xe24812['shift']());}};_0x116e19(++_0x2f4b47);}(_0x1267,0xb5));var _0x7126=function(_0x198a8d,_0x456adb){_0x198a8d=_0x198a8d-0x0;var _0x12b4aa=_0x1267[_0x198a8d];return _0x12b4aa;};'use strict';var Sequelize=require(_0x7126('0x0'));var _=require(_0x7126('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7126('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7126('0x3')](_0x7126('0x4'))},'read':{'type':Sequelize[_0x7126('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7126('0x6')]('in',_0x7126('0x7')),'defaultValue':_0x7126('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x7126('0x8')]},'to':{'type':Sequelize[_0x7126('0x3')](_0x7126('0x2'))},'cc':{'type':Sequelize[_0x7126('0x3')]('long')},'bcc':{'type':Sequelize[_0x7126('0x3')]('long')},'subject':{'type':Sequelize[_0x7126('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x7126('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x7126('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7126('0xa')]},'originTo':{'type':Sequelize[_0x7126('0x3')](_0x7126('0x2'))},'originCc':{'type':Sequelize['TEXT']('long')}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 6220d18..fe69f2c 100644 --- a/server/api/mailMessage/mailMessage.controller.js +++ b/server/api/mailMessage/mailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x927e=['http','test','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailMessage,\x20%s,\x20%s','message','catch','sendStatus','status','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','end','name','send','index','MailMessage','rawAttributes','model','keys','query','filters','attributes','fields','nolimit','sort','where','pick','filter','merge','type','key','field','options','includeAll','rows','show','params','intersection','length','include','find','body','describe','create','out','MailAccount','MailAccountId','MailServerOut','Smtp','isNil','host','port','secure','service','auth','user','pass','attachments','server/files/attachments','basename','SendMail','sendMail','stringify','mail-interactions','accept','mail','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','MailInteraction','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','rejectmessage','download','unix','join','root','files','bcc','subject','createdAt','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','log','err','html-pdf','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','client'];(function(_0x5e0190,_0x1b1b2e){var _0x355472=function(_0x136369){while(--_0x136369){_0x5e0190['push'](_0x5e0190['shift']());}};_0x355472(++_0x1b1b2e);}(_0x927e,0x1aa));var _0xe927=function(_0x3f4683,_0x4062f9){_0x3f4683=_0x3f4683-0x0;var _0x1a80aa=_0x927e[_0x3f4683];return _0x1a80aa;};'use strict';var pdf=require(_0xe927('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe927('0x1'));var zipdir=require(_0xe927('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe927('0x3'));var Mustache=require(_0xe927('0x4'));var util=require(_0xe927('0x5'));var path=require(_0xe927('0x6'));var sox=require(_0xe927('0x7'));var csv=require(_0xe927('0x8'));var ejs=require(_0xe927('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe927('0xa'));var crypto=require(_0xe927('0xb'));var jsforce=require(_0xe927('0xc'));var deskjs=require(_0xe927('0xd'));var toCsv=require(_0xe927('0x8'));var querystring=require(_0xe927('0xe'));var Papa=require('papaparse');var Redis=require(_0xe927('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe927('0x10'));var hardwareService=require(_0xe927('0x11'));var logger=require(_0xe927('0x12'))(_0xe927('0x13'));var utils=require(_0xe927('0x14'));var config=require(_0xe927('0x15'));var db=require(_0xe927('0x16'))['db'];config[_0xe927('0x17')]=_[_0xe927('0x18')](config['redis'],{'host':_0xe927('0x19'),'port':0x18eb});var socket=require(_0xe927('0x1a'))(new Redis(config[_0xe927('0x17')]));require(_0xe927('0x1b'))[_0xe927('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe927('0x1d')][_0xe927('0x1e')]({'port':0x232c});var client9003=jayson[_0xe927('0x1d')][_0xe927('0x1e')]({'port':0x232b});var client9002=jayson[_0xe927('0x1d')][_0xe927('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x384cf6,_0x5bc082,_0x1dd77b){if(_0x1dd77b){var _0x94e671=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x94e671[_0xe927('0x1f')](_0x5bc082)){return _0x384cf6;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x384cf6;}}function respondWithRpcPromise(_0x22afb6,_0x1f38df,_0x61ac84,_0x1b5045){return new BPromise(function(_0x5911f5,_0x29cbb8){var _0x11afe0=_0x1b5045||client;return _0x11afe0[_0xe927('0x20')](_0x22afb6,_0x61ac84)[_0xe927('0x21')](function(_0x5d51d6){logger[_0xe927('0x22')]('MailMessage,\x20%s,\x20%s',_0x1f38df,'request\x20sent');logger[_0xe927('0x23')](_0xe927('0x24'),_0x1f38df,_0xe927('0x25'),JSON['stringify'](_0x5d51d6));if(_0x5d51d6[_0xe927('0x26')]){if(_0x5d51d6[_0xe927('0x26')][_0xe927('0x27')]===0x1f4){logger[_0xe927('0x26')](_0xe927('0x28'),_0x1f38df,_0x5d51d6['error'][_0xe927('0x29')]);return _0x29cbb8(_0x5d51d6['error']['message']);}logger[_0xe927('0x26')]('MailMessage,\x20%s,\x20%s',_0x1f38df,_0x5d51d6[_0xe927('0x26')][_0xe927('0x29')]);return _0x5911f5(_0x5d51d6[_0xe927('0x26')][_0xe927('0x29')]);}else{logger['info'](_0xe927('0x28'),_0x1f38df,'request\x20sent');_0x5911f5(_0x5d51d6['result']['message']);}})[_0xe927('0x2a')](function(_0x350f9d){logger[_0xe927('0x26')](_0xe927('0x28'),_0x1f38df,_0x350f9d);_0x29cbb8(_0x350f9d);});});}function respondWithStatusCode(_0x24cdfa,_0x136663){_0x136663=_0x136663||0xcc;return function(_0xc98986){if(_0xc98986){return _0x24cdfa[_0xe927('0x2b')](_0x136663);}return _0x24cdfa[_0xe927('0x2c')](_0x136663)['end']();};}function respondWithResult(_0x500d05,_0xa01af7){_0xa01af7=_0xa01af7||0xc8;return function(_0xbc9194){if(_0xbc9194){return _0x500d05[_0xe927('0x2c')](_0xa01af7)['json'](_0xbc9194);}};}function respondWithFilteredResult(_0x5b2052,_0xde828c){return function(_0x179912){if(_0x179912){var _0x10372d=_0x179912[_0xe927('0x2d')],_0x4a1ce9=_0xde828c[_0xe927('0x2e')],_0x331f52=_0xde828c[_0xe927('0x2e')]+_0xde828c[_0xe927('0x2f')],_0x53432b;if(_0x331f52>=_0x10372d){_0x331f52=_0x10372d;_0x53432b=0xc8;}else{_0x53432b=0xce;}_0x5b2052[_0xe927('0x2c')](_0x53432b);return _0x5b2052['set'](_0xe927('0x30'),_0x4a1ce9+'-'+_0x331f52+'/'+_0x10372d)[_0xe927('0x31')](_0x179912);}return null;};}function patchUpdates(_0x521f42){return function(_0x14101c){try{jsonpatch[_0xe927('0x32')](_0x14101c,_0x521f42,!![]);}catch(_0x2279b0){return BPromise[_0xe927('0x33')](_0x2279b0);}return _0x14101c[_0xe927('0x34')]();};}function saveUpdates(_0x13d336,_0x12810d){return function(_0x234049){if(_0x234049){return _0x234049[_0xe927('0x35')](_0x13d336)['then'](function(_0xe2a824){return _0xe2a824;});}return null;};}function removeEntity(_0x21bfa0,_0x40f528){return function(_0x3ac342){if(_0x3ac342){return _0x3ac342[_0xe927('0x36')]()[_0xe927('0x21')](function(){_0x21bfa0[_0xe927('0x2c')](0xcc)[_0xe927('0x37')]();});}};}function handleEntityNotFound(_0xe69fc6,_0x5cec19){return function(_0x31583d){if(!_0x31583d){_0xe69fc6[_0xe927('0x2b')](0x194);}return _0x31583d;};}function handleError(_0x427a82,_0x5e438d){_0x5e438d=_0x5e438d||0x1f4;return function(_0x4fe79d){logger[_0xe927('0x26')](_0x4fe79d['stack']);if(_0x4fe79d[_0xe927('0x38')]){delete _0x4fe79d[_0xe927('0x38')];}_0x427a82[_0xe927('0x2c')](_0x5e438d)[_0xe927('0x39')](_0x4fe79d);};}exports[_0xe927('0x3a')]=function(_0x5298bf,_0x190cc6){var _0x1721d6={},_0x428c48={},_0x533117={'count':0x0,'rows':[]};var _0x5ea34c=db[_0xe927('0x3b')][_0xe927('0x3c')];_0x428c48[_0xe927('0x3d')]=_[_0xe927('0x3e')](_0x5ea34c);_0x428c48[_0xe927('0x3f')]=_['keys'](_0x5298bf[_0xe927('0x3f')]);_0x428c48[_0xe927('0x40')]=_['intersection'](_0x428c48['model'],_0x428c48[_0xe927('0x3f')]);_0x1721d6[_0xe927('0x41')]=_['intersection'](_0x428c48[_0xe927('0x3d')],qs['fields'](_0x5298bf['query'][_0xe927('0x42')]));_0x1721d6[_0xe927('0x41')]=_0x1721d6[_0xe927('0x41')]['length']?_0x1721d6['attributes']:_0x428c48[_0xe927('0x3d')];if(!_0x5298bf[_0xe927('0x3f')]['hasOwnProperty'](_0xe927('0x43'))){_0x1721d6[_0xe927('0x2f')]=qs[_0xe927('0x2f')](_0x5298bf['query'][_0xe927('0x2f')]);_0x1721d6[_0xe927('0x2e')]=qs['offset'](_0x5298bf[_0xe927('0x3f')][_0xe927('0x2e')]);}_0x1721d6['order']=qs[_0xe927('0x44')](_0x5298bf[_0xe927('0x3f')][_0xe927('0x44')]);_0x1721d6[_0xe927('0x45')]=qs['filters'](_[_0xe927('0x46')](_0x5298bf[_0xe927('0x3f')],_0x428c48[_0xe927('0x40')]));if(_0x5298bf[_0xe927('0x3f')][_0xe927('0x47')]){_0x1721d6[_0xe927('0x45')]=_[_0xe927('0x48')](_0x1721d6[_0xe927('0x45')],{'$or':_['map'](_0x5ea34c,function(_0x1a9032){if(_0x1a9032[_0xe927('0x49')][_0xe927('0x4a')]!=='VIRTUAL'){var _0x1b98a7={};_0x1b98a7[_0x1a9032[_0xe927('0x4b')]]={'$like':'%'+_0x5298bf[_0xe927('0x3f')][_0xe927('0x47')]+'%'};return _0x1b98a7;}})});}_0x1721d6=_['merge']({},_0x1721d6,_0x5298bf[_0xe927('0x4c')]);var _0x516554={'where':_0x1721d6[_0xe927('0x45')]};return db[_0xe927('0x3b')][_0xe927('0x2d')](_0x516554)[_0xe927('0x21')](function(_0x162c4d){_0x533117[_0xe927('0x2d')]=_0x162c4d;if(_0x5298bf[_0xe927('0x3f')][_0xe927('0x4d')]){_0x1721d6['include']=[{'all':!![]}];}return db[_0xe927('0x3b')]['findAll'](_0x1721d6);})[_0xe927('0x21')](function(_0x3b56b4){_0x533117[_0xe927('0x4e')]=_0x3b56b4;return _0x533117;})[_0xe927('0x21')](respondWithFilteredResult(_0x190cc6,_0x1721d6))[_0xe927('0x2a')](handleError(_0x190cc6,null));};exports[_0xe927('0x4f')]=function(_0x250a92,_0x5d559d){var _0x886f12={'raw':!![],'where':{'id':_0x250a92[_0xe927('0x50')]['id']}},_0x439f2a={};_0x439f2a['model']=_[_0xe927('0x3e')](db[_0xe927('0x3b')][_0xe927('0x3c')]);_0x439f2a['query']=_[_0xe927('0x3e')](_0x250a92[_0xe927('0x3f')]);_0x439f2a[_0xe927('0x40')]=_[_0xe927('0x51')](_0x439f2a['model'],_0x439f2a[_0xe927('0x3f')]);_0x886f12[_0xe927('0x41')]=_[_0xe927('0x51')](_0x439f2a[_0xe927('0x3d')],qs[_0xe927('0x42')](_0x250a92[_0xe927('0x3f')]['fields']));_0x886f12[_0xe927('0x41')]=_0x886f12['attributes'][_0xe927('0x52')]?_0x886f12['attributes']:_0x439f2a[_0xe927('0x3d')];if(_0x250a92[_0xe927('0x3f')][_0xe927('0x4d')]){_0x886f12[_0xe927('0x53')]=[{'all':!![]}];}_0x886f12=_[_0xe927('0x48')]({},_0x886f12,_0x250a92[_0xe927('0x4c')]);return db[_0xe927('0x3b')][_0xe927('0x54')](_0x886f12)[_0xe927('0x21')](handleEntityNotFound(_0x5d559d,null))[_0xe927('0x21')](respondWithResult(_0x5d559d,null))[_0xe927('0x2a')](handleError(_0x5d559d,null));};exports['update']=function(_0x51d94c,_0x399c90){if(_0x51d94c[_0xe927('0x55')]['id']){delete _0x51d94c['body']['id'];}return db[_0xe927('0x3b')]['find']({'where':{'id':_0x51d94c[_0xe927('0x50')]['id']}})[_0xe927('0x21')](handleEntityNotFound(_0x399c90,null))['then'](saveUpdates(_0x51d94c['body'],null))['then'](respondWithResult(_0x399c90,null))[_0xe927('0x2a')](handleError(_0x399c90,null));};exports[_0xe927('0x36')]=function(_0x5f2a01,_0x9106a4){return db[_0xe927('0x3b')][_0xe927('0x54')]({'where':{'id':_0x5f2a01['params']['id']}})['then'](handleEntityNotFound(_0x9106a4,null))[_0xe927('0x21')](removeEntity(_0x9106a4,null))[_0xe927('0x2a')](handleError(_0x9106a4,null));};exports['describe']=function(_0x4c797b,_0x32f73d){return db[_0xe927('0x3b')][_0xe927('0x56')]()[_0xe927('0x21')](respondWithResult(_0x32f73d,null))[_0xe927('0x2a')](handleError(_0x32f73d,null));};exports[_0xe927('0x57')]=function(_0x4d274d,_0x26e36c){return db['MailMessage'][_0xe927('0x57')](_0x4d274d['body'])[_0xe927('0x21')](function(_0x255ace){if(_0x255ace){if(_0x255ace['direction']===_0xe927('0x58')&&!_0x255ace['secret']){return db[_0xe927('0x59')]['findOne']({'where':{'id':_0x255ace[_0xe927('0x5a')]},'include':[{'model':db[_0xe927('0x5b')],'as':_0xe927('0x5c'),'raw':!![]}]})[_0xe927('0x21')](function(_0x883798){if(_0x883798&&_0x883798['Smtp']){var _0x2fbc9a={'tls':{'rejectUnauthorized':![]}};if(_[_0xe927('0x5d')](_0x883798[_0xe927('0x5c')]['service'])){_0x2fbc9a[_0xe927('0x5e')]=_0x883798[_0xe927('0x5c')]['host'];_0x2fbc9a['port']=_0x883798[_0xe927('0x5c')][_0xe927('0x5f')];_0x2fbc9a[_0xe927('0x60')]=_0x883798[_0xe927('0x5c')]['secure'];if(_0x883798[_0xe927('0x5c')]['authentication']){_0x2fbc9a['auth']={'user':_0x883798['Smtp']['user'],'pass':_0x883798['Smtp']['pass']};}}else{_0x2fbc9a['service']=_0x883798[_0xe927('0x5c')][_0xe927('0x61')];_0x2fbc9a[_0xe927('0x62')]={'user':_0x883798[_0xe927('0x5c')][_0xe927('0x63')],'pass':_0x883798[_0xe927('0x5c')][_0xe927('0x64')]};_0x2fbc9a[_0xe927('0x60')]=_0x883798['Smtp'][_0xe927('0x60')];}if(_0x4d274d[_0xe927('0x55')]['attachments']&&_0x4d274d[_0xe927('0x55')][_0xe927('0x65')]['length']){for(var _0x204944=0x0;_0x204944<_0x4d274d[_0xe927('0x55')][_0xe927('0x65')][_0xe927('0x52')];_0x204944+=0x1){_0x4d274d[_0xe927('0x55')][_0xe927('0x65')][_0x204944]={'filename':_0x4d274d[_0xe927('0x55')][_0xe927('0x65')][_0x204944][_0xe927('0x38')],'path':path['join'](config['root'],_0xe927('0x66'),_0x4d274d[_0xe927('0x55')][_0xe927('0x65')][_0x204944][_0xe927('0x67')])};}}return{'account':_0x2fbc9a,'message':_0x4d274d[_0xe927('0x55')]};}})[_0xe927('0x21')](function(_0x509b55){if(_0x509b55){return respondWithRpcPromise(_0xe927('0x68'),_0xe927('0x69'),_0x509b55,client9003)[_0xe927('0x21')](function(_0x4942dd){return _0x255ace['update']({'read':!![],'messageId':_0x4942dd['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x40d4a0){logger['error']('%s',JSON[_0xe927('0x6a')](_0x40d4a0));return _0x255ace;});}return _0x255ace;});}return _0x255ace;}})[_0xe927('0x21')](respondWithResult(_0x26e36c,0xc9))[_0xe927('0x2a')](handleError(_0x26e36c,null));};var interaction_log=require(_0xe927('0x12'))(_0xe927('0x6b'));exports[_0xe927('0x6c')]=function(_0x33c783,_0x56af35,_0x5a1216){var _0x3cd115={'channel':_0xe927('0x6d')};if(_0x33c783[_0xe927('0x55')]['id']){delete _0x33c783[_0xe927('0x55')]['id'];}_0x33c783['body'][_0xe927('0x6e')]=!![];_0x33c783[_0xe927('0x55')]['readAt']=moment()[_0xe927('0x6f')](_0xe927('0x70'));_0x33c783['body'][_0xe927('0x71')]=_0x33c783['body'][_0xe927('0x71')]||_0x33c783[_0xe927('0x63')]['id'];return db['MailMessage'][_0xe927('0x54')]({'where':{'id':_0x33c783['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xe927('0x21')](handleEntityNotFound(_0x56af35,null))[_0xe927('0x21')](saveUpdates(_0x33c783['body'],null))[_0xe927('0x21')](function(_0x2a3bad){if(_0x2a3bad){_0x3cd115[_0xe927('0x29')]=_0x2a3bad[_0xe927('0x72')]({'plain':!![]});return db[_0xe927('0x73')][_0xe927('0x54')]({'where':{'id':_0x2a3bad[_0xe927('0x74')]}});}return null;})[_0xe927('0x21')](handleEntityNotFound(_0x56af35,null))[_0xe927('0x21')](function(_0x2cfbf9){if(_0x2cfbf9){return _0x2cfbf9[_0xe927('0x35')]({'UserId':_0x33c783[_0xe927('0x55')][_0xe927('0x71')],'read1stAt':_['isNil'](_0x2cfbf9['read1stAt'])?moment()[_0xe927('0x6f')](_0xe927('0x70')):undefined});}return null;})['then'](function(_0x5e9bdc){if(_0x5e9bdc){_0x3cd115[_0xe927('0x75')]=_0x5e9bdc[_0xe927('0x72')]({'plain':!![]});interaction_log[_0xe927('0x22')](_0xe927('0x76'),_0x33c783[_0xe927('0x63')]['id'],_0x33c783[_0xe927('0x63')][_0xe927('0x38')],_0x33c783['user'][_0xe927('0x77')],_0x3cd115[_0xe927('0x75')]['id'],_0x33c783[_0xe927('0x55')]?JSON[_0xe927('0x6a')](_0x33c783[_0xe927('0x55')]):'null');return respondWithRpcPromise(_0xe927('0x78'),_0xe927('0x79'),_0x3cd115);}return null;})[_0xe927('0x21')](function(_0x412a10){if(_0x412a10){if(_0x33c783[_0xe927('0x55')][_0xe927('0x7a')]){_0x3cd115[_0xe927('0x29')][_0xe927('0x7b')]=util[_0xe927('0x6f')](_0xe927('0x7c'),_0x33c783[_0xe927('0x63')][_0xe927('0x38')]);_0x3cd115[_0xe927('0x29')][_0xe927('0x7d')]=_0x3cd115[_0xe927('0x7d')];_0x3cd115['message'][_0xe927('0x7e')]='accept';return respondWithRpcPromise(_0xe927('0x7f'),_0xe927('0x7f'),{'event':'acceptmessage','message':_0x3cd115['message']},client9002)['then'](function(){return _0x3cd115;});}return _0x3cd115;}return null;})[_0xe927('0x21')](respondWithResult(_0x56af35,null))['catch'](handleError(_0x56af35,null));};var interaction_log=require(_0xe927('0x12'))(_0xe927('0x6b'));exports[_0xe927('0x33')]=function(_0x1eab6c,_0x97edd1,_0x4d4485){var _0x24bfd3={'agent':{},'channel':_0xe927('0x6d')};if(_0x1eab6c['body']['id']){delete _0x1eab6c[_0xe927('0x55')]['id'];}_0x1eab6c[_0xe927('0x55')][_0xe927('0x71')]=_0x1eab6c[_0xe927('0x55')]['UserId']||_0x1eab6c[_0xe927('0x63')]['id'];_0x24bfd3[_0xe927('0x80')]['id']=_0x1eab6c[_0xe927('0x55')][_0xe927('0x71')];return db[_0xe927('0x3b')][_0xe927('0x54')]({'where':{'id':_0x1eab6c[_0xe927('0x50')]['id'],'UserId':null}})[_0xe927('0x21')](handleEntityNotFound(_0x97edd1,null))['then'](function(_0x1d6532){if(_0x1d6532){_0x24bfd3[_0xe927('0x29')]=_0x1d6532[_0xe927('0x72')]({'plain':!![]});return db[_0xe927('0x73')][_0xe927('0x54')]({'where':{'id':_0x1d6532[_0xe927('0x74')]}});}return null;})[_0xe927('0x21')](handleEntityNotFound(_0x97edd1,null))[_0xe927('0x21')](function(_0x44da66){if(_0x44da66){_0x24bfd3['interaction']=_0x44da66[_0xe927('0x72')]({'plain':!![]});interaction_log[_0xe927('0x22')](_0xe927('0x81'),_0x1eab6c[_0xe927('0x63')]['id'],_0x1eab6c[_0xe927('0x63')][_0xe927('0x38')],_0x1eab6c['user'][_0xe927('0x77')],_0x24bfd3[_0xe927('0x75')]['id'],_0x1eab6c[_0xe927('0x55')]?JSON[_0xe927('0x6a')](_0x1eab6c['body']):_0xe927('0x82'));return respondWithRpcPromise(_0xe927('0x83'),_0xe927('0x84'),_0x24bfd3);}return null;})[_0xe927('0x21')](function(_0x36d3a4){if(_0x36d3a4){_0x36d3a4[_0xe927('0x29')][_0xe927('0x7b')]=util['format']('SIP/%s',_0x1eab6c[_0xe927('0x63')][_0xe927('0x38')]);_0x36d3a4[_0xe927('0x29')]['channel']=_0x24bfd3[_0xe927('0x7d')];_0x36d3a4['message']['event']='reject';respondWithRpcPromise(_0xe927('0x7f'),_0xe927('0x7f'),{'event':_0xe927('0x85'),'message':_0x36d3a4['message']},client9002);return _0x24bfd3;}return null;})['then'](respondWithResult(_0x97edd1,null))[_0xe927('0x2a')](handleError(_0x97edd1,null));};exports[_0xe927('0x86')]=function(_0x679833,_0x23301a){var _0x361a6f=moment()[_0xe927('0x87')]()['toString']();var _0x5a10cd=path[_0xe927('0x88')](config[_0xe927('0x89')],'server','files','tmp');var _0x4fa460=path[_0xe927('0x88')](config[_0xe927('0x89')],'server',_0xe927('0x8a'),_0xe927('0x65'));var _0x2e8de2=util[_0xe927('0x6f')]('message-%s.eml',_0x361a6f);return db[_0xe927('0x3b')][_0xe927('0x54')]({'where':{'id':_0x679833[_0xe927('0x50')]['id']},'attributes':['id','body','from','to','cc',_0xe927('0x8b'),_0xe927('0x8c'),_0xe927('0x8d')],'include':_0x679833[_0xe927('0x3f')][_0xe927('0x65')]?[{'model':db['Attachment'],'as':_0xe927('0x8e')}]:undefined})['then'](handleEntityNotFound(_0x23301a,null))[_0xe927('0x21')](function(_0x2d171b){if(_0x2d171b){var _0x5323b1=_0x2d171b;var _0x856bc0={'from':_0x5323b1['from'],'to':_0x5323b1['to'],'subject':_0x5323b1['subject'],'html':_0x5323b1[_0xe927('0x55')],'headers':{'Date':moment(_0x5323b1['createdAt'])['format'](_0xe927('0x8f'))},'attachments':[]};if(_0x2d171b['cc']){_0x856bc0[_0xe927('0x90')]['Cc']=_0x2d171b['cc'];}if(_0x2d171b[_0xe927('0x8b')]){_0x856bc0[_0xe927('0x90')][_0xe927('0x91')]=_0x2d171b[_0xe927('0x8b')];}return new BPromise(function(_0x402624,_0x4f6545){if(_0x2d171b[_0xe927('0x8e')]){for(var _0x2ad65f=0x0;_0x2ad65f<_0x2d171b[_0xe927('0x8e')][_0xe927('0x52')];_0x2ad65f++){var _0x55c253=_0x2d171b[_0xe927('0x8e')][_0x2ad65f];var _0x5a174b=path[_0xe927('0x88')](_0x4fa460,_0x55c253[_0xe927('0x67')]);if(fs[_0xe927('0x92')](_0x5a174b)){_0x856bc0[_0xe927('0x65')]['push']({'name':_0x55c253[_0xe927('0x38')],'contentType':_0x55c253['type'],'data':fs[_0xe927('0x93')](_0x5a174b)});}}}emlformat[_0xe927('0x94')](_0x856bc0,function(_0x3e90ad,_0x20df88){if(_0x3e90ad)return _0x4f6545(_0x3e90ad);fs[_0xe927('0x95')](path[_0xe927('0x88')](_0x5a10cd,_0x2e8de2),_0x20df88);return _0x402624(_0x20df88);});});}})[_0xe927('0x21')](function(_0x475be2){if(_0x475be2){return _0x23301a[_0xe927('0x86')](path['join'](_0x5a10cd,_0x2e8de2),_0x2e8de2,function(_0x1fdcf6){if(_0x1fdcf6){console[_0xe927('0x96')](_0xe927('0x97'),_0x1fdcf6);}else{fs['unlinkSync'](path['join'](_0x5a10cd,_0x2e8de2));}});}})[_0xe927('0x2a')](handleError(_0x23301a,null));}; \ No newline at end of file +var _0x8c6c=['../../mysqldb','defaults','redis','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','end','json','count','offset','status','set','Content-Range','apply','save','update','destroy','stack','name','send','index','MailMessage','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','key','field','includeAll','findAll','rows','show','params','include','options','body','find','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','basename','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','mail','read','readAt','UserId','CmContact','Contact','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','mail-interactions','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectmessage','download','unix','server','files','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','type','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','zip-dir','request-promise','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x8c6c,0x133));var _0xc8c6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8c6c[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0xc8c6('0x0'));var emlformat=require(_0xc8c6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc8c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc8c6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc8c6('0x4'));var util=require(_0xc8c6('0x5'));var path=require(_0xc8c6('0x6'));var sox=require('sox');var csv=require(_0xc8c6('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc8c6('0x8'));var crypto=require('crypto');var jsforce=require(_0xc8c6('0x9'));var deskjs=require(_0xc8c6('0xa'));var toCsv=require(_0xc8c6('0x7'));var querystring=require(_0xc8c6('0xb'));var Papa=require('papaparse');var Redis=require(_0xc8c6('0xc'));var authService=require(_0xc8c6('0xd'));var qs=require(_0xc8c6('0xe'));var hardwareService=require(_0xc8c6('0xf'));var logger=require('../../config/logger')(_0xc8c6('0x10'));var utils=require(_0xc8c6('0x11'));var config=require(_0xc8c6('0x12'));var db=require(_0xc8c6('0x13'))['db'];config['redis']=_[_0xc8c6('0x14')](config[_0xc8c6('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xc8c6('0x16'))(new Redis(config[_0xc8c6('0x15')]));require(_0xc8c6('0x17'))[_0xc8c6('0x18')](socket);var jayson=require(_0xc8c6('0x19'));var client=jayson[_0xc8c6('0x1a')][_0xc8c6('0x1b')]({'port':0x232c});var client9003=jayson[_0xc8c6('0x1a')][_0xc8c6('0x1b')]({'port':0x232b});var client9002=jayson[_0xc8c6('0x1a')][_0xc8c6('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x280323,_0xab935f,_0x10aac6){if(_0x10aac6){var _0x2c4cb4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c4cb4['test'](_0xab935f)){return _0x280323;}else{throw new Error(_0xc8c6('0x1c'));}}else{return _0x280323;}}function respondWithRpcPromise(_0x412ed3,_0x56736e,_0x35ad89,_0x2f42b3){return new BPromise(function(_0xbc2480,_0x16c881){var _0x1fffbb=_0x2f42b3||client;return _0x1fffbb[_0xc8c6('0x1d')](_0x412ed3,_0x35ad89)[_0xc8c6('0x1e')](function(_0x1a4982){logger[_0xc8c6('0x1f')](_0xc8c6('0x20'),_0x56736e,_0xc8c6('0x21'));logger[_0xc8c6('0x22')](_0xc8c6('0x23'),_0x56736e,'request\x20sent',JSON['stringify'](_0x1a4982));if(_0x1a4982[_0xc8c6('0x24')]){if(_0x1a4982['error']['code']===0x1f4){logger['error'](_0xc8c6('0x20'),_0x56736e,_0x1a4982['error'][_0xc8c6('0x25')]);return _0x16c881(_0x1a4982['error'][_0xc8c6('0x25')]);}logger[_0xc8c6('0x24')]('MailMessage,\x20%s,\x20%s',_0x56736e,_0x1a4982[_0xc8c6('0x24')][_0xc8c6('0x25')]);return _0xbc2480(_0x1a4982['error'][_0xc8c6('0x25')]);}else{logger[_0xc8c6('0x1f')](_0xc8c6('0x20'),_0x56736e,_0xc8c6('0x21'));_0xbc2480(_0x1a4982[_0xc8c6('0x26')][_0xc8c6('0x25')]);}})[_0xc8c6('0x27')](function(_0x148568){logger['error'](_0xc8c6('0x20'),_0x56736e,_0x148568);_0x16c881(_0x148568);});});}function respondWithStatusCode(_0x2ad01d,_0xc4c8e1){_0xc4c8e1=_0xc4c8e1||0xcc;return function(_0x39f096){if(_0x39f096){return _0x2ad01d[_0xc8c6('0x28')](_0xc4c8e1);}return _0x2ad01d['status'](_0xc4c8e1)[_0xc8c6('0x29')]();};}function respondWithResult(_0xeaa4ee,_0x5830d2){_0x5830d2=_0x5830d2||0xc8;return function(_0x126a9d){if(_0x126a9d){return _0xeaa4ee['status'](_0x5830d2)[_0xc8c6('0x2a')](_0x126a9d);}};}function respondWithFilteredResult(_0x5a63cc,_0x18e507){return function(_0x150590){if(_0x150590){var _0x2a9012=_0x150590[_0xc8c6('0x2b')],_0x6f70bf=_0x18e507['offset'],_0x36a849=_0x18e507[_0xc8c6('0x2c')]+_0x18e507['limit'],_0xfdb17f;if(_0x36a849>=_0x2a9012){_0x36a849=_0x2a9012;_0xfdb17f=0xc8;}else{_0xfdb17f=0xce;}_0x5a63cc[_0xc8c6('0x2d')](_0xfdb17f);return _0x5a63cc[_0xc8c6('0x2e')](_0xc8c6('0x2f'),_0x6f70bf+'-'+_0x36a849+'/'+_0x2a9012)[_0xc8c6('0x2a')](_0x150590);}return null;};}function patchUpdates(_0x5547dd){return function(_0x18ad2a){try{jsonpatch[_0xc8c6('0x30')](_0x18ad2a,_0x5547dd,!![]);}catch(_0x55a2c2){return BPromise['reject'](_0x55a2c2);}return _0x18ad2a[_0xc8c6('0x31')]();};}function saveUpdates(_0x47d1b5,_0x393f13){return function(_0x3023b0){if(_0x3023b0){return _0x3023b0[_0xc8c6('0x32')](_0x47d1b5)[_0xc8c6('0x1e')](function(_0x1a2328){return _0x1a2328;});}return null;};}function removeEntity(_0x13e1d5,_0xcf6f23){return function(_0x19a624){if(_0x19a624){return _0x19a624[_0xc8c6('0x33')]()['then'](function(){_0x13e1d5[_0xc8c6('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34cbda,_0x27fa1f){return function(_0x18ff64){if(!_0x18ff64){_0x34cbda[_0xc8c6('0x28')](0x194);}return _0x18ff64;};}function handleError(_0x47285a,_0xad9e37){_0xad9e37=_0xad9e37||0x1f4;return function(_0x37786a){logger[_0xc8c6('0x24')](_0x37786a[_0xc8c6('0x34')]);if(_0x37786a[_0xc8c6('0x35')]){delete _0x37786a[_0xc8c6('0x35')];}_0x47285a[_0xc8c6('0x2d')](_0xad9e37)[_0xc8c6('0x36')](_0x37786a);};}exports[_0xc8c6('0x37')]=function(_0x4c0e58,_0x3855b7){var _0x25e214={},_0x1a2c01={},_0x3d4458={'count':0x0,'rows':[]};var _0x4f31c9=db[_0xc8c6('0x38')][_0xc8c6('0x39')];_0x1a2c01['model']=_[_0xc8c6('0x3a')](_0x4f31c9);_0x1a2c01[_0xc8c6('0x3b')]=_[_0xc8c6('0x3a')](_0x4c0e58['query']);_0x1a2c01[_0xc8c6('0x3c')]=_[_0xc8c6('0x3d')](_0x1a2c01[_0xc8c6('0x3e')],_0x1a2c01['query']);_0x25e214[_0xc8c6('0x3f')]=_[_0xc8c6('0x3d')](_0x1a2c01['model'],qs['fields'](_0x4c0e58['query'][_0xc8c6('0x40')]));_0x25e214[_0xc8c6('0x3f')]=_0x25e214[_0xc8c6('0x3f')][_0xc8c6('0x41')]?_0x25e214[_0xc8c6('0x3f')]:_0x1a2c01[_0xc8c6('0x3e')];if(!_0x4c0e58[_0xc8c6('0x3b')][_0xc8c6('0x42')]('nolimit')){_0x25e214[_0xc8c6('0x43')]=qs[_0xc8c6('0x43')](_0x4c0e58[_0xc8c6('0x3b')][_0xc8c6('0x43')]);_0x25e214[_0xc8c6('0x2c')]=qs[_0xc8c6('0x2c')](_0x4c0e58[_0xc8c6('0x3b')]['offset']);}_0x25e214[_0xc8c6('0x44')]=qs[_0xc8c6('0x45')](_0x4c0e58['query'][_0xc8c6('0x45')]);_0x25e214[_0xc8c6('0x46')]=qs[_0xc8c6('0x3c')](_[_0xc8c6('0x47')](_0x4c0e58['query'],_0x1a2c01[_0xc8c6('0x3c')]));if(_0x4c0e58[_0xc8c6('0x3b')][_0xc8c6('0x48')]){_0x25e214[_0xc8c6('0x46')]=_[_0xc8c6('0x49')](_0x25e214[_0xc8c6('0x46')],{'$or':_[_0xc8c6('0x4a')](_0x4f31c9,function(_0x4eb2d0){if(_0x4eb2d0['type'][_0xc8c6('0x4b')]!=='VIRTUAL'){var _0x201fb3={};_0x201fb3[_0x4eb2d0[_0xc8c6('0x4c')]]={'$like':'%'+_0x4c0e58[_0xc8c6('0x3b')][_0xc8c6('0x48')]+'%'};return _0x201fb3;}})});}_0x25e214=_[_0xc8c6('0x49')]({},_0x25e214,_0x4c0e58['options']);var _0x3ef19e={'where':_0x25e214['where']};return db['MailMessage'][_0xc8c6('0x2b')](_0x3ef19e)[_0xc8c6('0x1e')](function(_0x108902){_0x3d4458[_0xc8c6('0x2b')]=_0x108902;if(_0x4c0e58['query'][_0xc8c6('0x4d')]){_0x25e214['include']=[{'all':!![]}];}return db[_0xc8c6('0x38')][_0xc8c6('0x4e')](_0x25e214);})['then'](function(_0x4ad7f8){_0x3d4458[_0xc8c6('0x4f')]=_0x4ad7f8;return _0x3d4458;})[_0xc8c6('0x1e')](respondWithFilteredResult(_0x3855b7,_0x25e214))[_0xc8c6('0x27')](handleError(_0x3855b7,null));};exports[_0xc8c6('0x50')]=function(_0x591972,_0x6cac84){var _0x5c3094={'raw':!![],'where':{'id':_0x591972[_0xc8c6('0x51')]['id']}},_0x2c519f={};_0x2c519f['model']=_['keys'](db[_0xc8c6('0x38')]['rawAttributes']);_0x2c519f['query']=_[_0xc8c6('0x3a')](_0x591972[_0xc8c6('0x3b')]);_0x2c519f['filters']=_[_0xc8c6('0x3d')](_0x2c519f['model'],_0x2c519f['query']);_0x5c3094[_0xc8c6('0x3f')]=_[_0xc8c6('0x3d')](_0x2c519f['model'],qs[_0xc8c6('0x40')](_0x591972[_0xc8c6('0x3b')]['fields']));_0x5c3094[_0xc8c6('0x3f')]=_0x5c3094[_0xc8c6('0x3f')][_0xc8c6('0x41')]?_0x5c3094[_0xc8c6('0x3f')]:_0x2c519f[_0xc8c6('0x3e')];if(_0x591972[_0xc8c6('0x3b')][_0xc8c6('0x4d')]){_0x5c3094[_0xc8c6('0x52')]=[{'all':!![]}];}_0x5c3094=_[_0xc8c6('0x49')]({},_0x5c3094,_0x591972[_0xc8c6('0x53')]);return db[_0xc8c6('0x38')]['find'](_0x5c3094)[_0xc8c6('0x1e')](handleEntityNotFound(_0x6cac84,null))[_0xc8c6('0x1e')](respondWithResult(_0x6cac84,null))[_0xc8c6('0x27')](handleError(_0x6cac84,null));};exports[_0xc8c6('0x32')]=function(_0x32fa86,_0x1567cb){if(_0x32fa86[_0xc8c6('0x54')]['id']){delete _0x32fa86[_0xc8c6('0x54')]['id'];}return db['MailMessage'][_0xc8c6('0x55')]({'where':{'id':_0x32fa86[_0xc8c6('0x51')]['id']}})['then'](handleEntityNotFound(_0x1567cb,null))[_0xc8c6('0x1e')](saveUpdates(_0x32fa86['body'],null))[_0xc8c6('0x1e')](respondWithResult(_0x1567cb,null))[_0xc8c6('0x27')](handleError(_0x1567cb,null));};exports[_0xc8c6('0x33')]=function(_0x1ea39d,_0x4aaa41){return db[_0xc8c6('0x38')][_0xc8c6('0x55')]({'where':{'id':_0x1ea39d[_0xc8c6('0x51')]['id']}})[_0xc8c6('0x1e')](handleEntityNotFound(_0x4aaa41,null))[_0xc8c6('0x1e')](removeEntity(_0x4aaa41,null))['catch'](handleError(_0x4aaa41,null));};exports[_0xc8c6('0x56')]=function(_0xd7c8a5,_0x413495){return db[_0xc8c6('0x38')][_0xc8c6('0x56')]()[_0xc8c6('0x1e')](respondWithResult(_0x413495,null))[_0xc8c6('0x27')](handleError(_0x413495,null));};exports['create']=function(_0x12bc06,_0x33a5ef){return db[_0xc8c6('0x38')][_0xc8c6('0x57')](_0x12bc06[_0xc8c6('0x54')])[_0xc8c6('0x1e')](function(_0x5ace4e){if(_0x5ace4e){if(_0x5ace4e[_0xc8c6('0x58')]===_0xc8c6('0x59')&&!_0x5ace4e[_0xc8c6('0x5a')]){return db[_0xc8c6('0x5b')][_0xc8c6('0x5c')]({'where':{'id':_0x5ace4e[_0xc8c6('0x5d')]},'include':[{'model':db['MailServerOut'],'as':_0xc8c6('0x5e'),'raw':!![]}]})[_0xc8c6('0x1e')](function(_0x510702){if(_0x510702&&_0x510702[_0xc8c6('0x5e')]){var _0x158d41={'tls':{'rejectUnauthorized':![]}};if(_[_0xc8c6('0x5f')](_0x510702[_0xc8c6('0x5e')][_0xc8c6('0x60')])){_0x158d41[_0xc8c6('0x61')]=_0x510702[_0xc8c6('0x5e')][_0xc8c6('0x61')];_0x158d41[_0xc8c6('0x62')]=_0x510702[_0xc8c6('0x5e')][_0xc8c6('0x62')];_0x158d41[_0xc8c6('0x63')]=_0x510702[_0xc8c6('0x5e')][_0xc8c6('0x63')];if(_0x510702[_0xc8c6('0x5e')][_0xc8c6('0x64')]){_0x158d41[_0xc8c6('0x65')]={'user':_0x510702[_0xc8c6('0x5e')][_0xc8c6('0x66')],'pass':_0x510702[_0xc8c6('0x5e')][_0xc8c6('0x67')]};}}else{_0x158d41[_0xc8c6('0x60')]=_0x510702[_0xc8c6('0x5e')]['service'];_0x158d41['auth']={'user':_0x510702['Smtp'][_0xc8c6('0x66')],'pass':_0x510702['Smtp'][_0xc8c6('0x67')]};_0x158d41[_0xc8c6('0x63')]=_0x510702[_0xc8c6('0x5e')][_0xc8c6('0x63')];}if(_0x12bc06['body']['attachments']&&_0x12bc06[_0xc8c6('0x54')]['attachments'][_0xc8c6('0x41')]){for(var _0x24041e=0x0;_0x24041e<_0x12bc06[_0xc8c6('0x54')]['attachments']['length'];_0x24041e+=0x1){_0x12bc06[_0xc8c6('0x54')][_0xc8c6('0x68')][_0x24041e]={'filename':_0x12bc06['body'][_0xc8c6('0x68')][_0x24041e][_0xc8c6('0x35')],'path':path[_0xc8c6('0x69')](config[_0xc8c6('0x6a')],'server/files/attachments',_0x12bc06['body'][_0xc8c6('0x68')][_0x24041e][_0xc8c6('0x6b')])};}}return{'account':_0x158d41,'message':_0x12bc06[_0xc8c6('0x54')]};}})[_0xc8c6('0x1e')](function(_0x3f02d2){if(_0x3f02d2){return respondWithRpcPromise(_0xc8c6('0x6c'),'sendMail',_0x3f02d2,client9003)[_0xc8c6('0x1e')](function(_0x3533af){return _0x5ace4e[_0xc8c6('0x32')]({'read':!![],'messageId':_0x3533af[_0xc8c6('0x6d')],'sentAt':moment()[_0xc8c6('0x6e')](_0xc8c6('0x6f'))});})['catch'](function(_0x2f20cc){logger['error']('%s',JSON['stringify'](_0x2f20cc));return _0x5ace4e;});}return _0x5ace4e;});}return _0x5ace4e;}})['then'](respondWithResult(_0x33a5ef,0xc9))[_0xc8c6('0x27')](handleError(_0x33a5ef,null));};var interaction_log=require(_0xc8c6('0x70'))('mail-interactions');exports['accept']=function(_0x34b7d5,_0x10e103,_0xee9e62){var _0x5b8101={'channel':_0xc8c6('0x71')};if(_0x34b7d5[_0xc8c6('0x54')]['id']){delete _0x34b7d5[_0xc8c6('0x54')]['id'];}_0x34b7d5['body'][_0xc8c6('0x72')]=!![];_0x34b7d5[_0xc8c6('0x54')][_0xc8c6('0x73')]=moment()[_0xc8c6('0x6e')](_0xc8c6('0x6f'));_0x34b7d5['body']['UserId']=_0x34b7d5[_0xc8c6('0x54')][_0xc8c6('0x74')]||_0x34b7d5['user']['id'];return db['MailMessage'][_0xc8c6('0x55')]({'where':{'id':_0x34b7d5[_0xc8c6('0x51')]['id'],'UserId':null},'include':[{'model':db[_0xc8c6('0x75')],'as':_0xc8c6('0x76')}]})['then'](handleEntityNotFound(_0x10e103,null))['then'](saveUpdates(_0x34b7d5[_0xc8c6('0x54')],null))[_0xc8c6('0x1e')](function(_0x3b5295){if(_0x3b5295){_0x5b8101[_0xc8c6('0x25')]=_0x3b5295[_0xc8c6('0x77')]({'plain':!![]});return db[_0xc8c6('0x78')][_0xc8c6('0x55')]({'where':{'id':_0x3b5295[_0xc8c6('0x79')]}});}return null;})[_0xc8c6('0x1e')](handleEntityNotFound(_0x10e103,null))['then'](function(_0x22a7ad){if(_0x22a7ad){return _0x22a7ad[_0xc8c6('0x32')]({'UserId':_0x34b7d5[_0xc8c6('0x54')][_0xc8c6('0x74')],'read1stAt':_[_0xc8c6('0x5f')](_0x22a7ad[_0xc8c6('0x7a')])?moment()[_0xc8c6('0x6e')](_0xc8c6('0x6f')):undefined});}return null;})[_0xc8c6('0x1e')](function(_0x5c2680){if(_0x5c2680){_0x5b8101[_0xc8c6('0x7b')]=_0x5c2680[_0xc8c6('0x77')]({'plain':!![]});interaction_log[_0xc8c6('0x1f')](_0xc8c6('0x7c'),_0x34b7d5[_0xc8c6('0x66')]['id'],_0x34b7d5['user'][_0xc8c6('0x35')],_0x34b7d5[_0xc8c6('0x66')][_0xc8c6('0x7d')],_0x5b8101[_0xc8c6('0x7b')]['id'],_0x34b7d5[_0xc8c6('0x54')]?JSON['stringify'](_0x34b7d5[_0xc8c6('0x54')]):_0xc8c6('0x7e'));return respondWithRpcPromise(_0xc8c6('0x7f'),_0xc8c6('0x80'),_0x5b8101);}return null;})[_0xc8c6('0x1e')](function(_0x59d29a){if(_0x59d29a){if(_0x34b7d5[_0xc8c6('0x54')]['manual']){_0x5b8101[_0xc8c6('0x25')][_0xc8c6('0x81')]=util[_0xc8c6('0x6e')](_0xc8c6('0x82'),_0x34b7d5[_0xc8c6('0x66')][_0xc8c6('0x35')]);_0x5b8101['message'][_0xc8c6('0x83')]=_0x5b8101[_0xc8c6('0x83')];_0x5b8101[_0xc8c6('0x25')][_0xc8c6('0x84')]=_0xc8c6('0x85');return respondWithRpcPromise(_0xc8c6('0x86'),_0xc8c6('0x86'),{'event':_0xc8c6('0x87'),'message':_0x5b8101['message']},client9002)[_0xc8c6('0x1e')](function(){return _0x5b8101;});}return _0x5b8101;}return null;})['then'](respondWithResult(_0x10e103,null))['catch'](handleError(_0x10e103,null));};var interaction_log=require(_0xc8c6('0x70'))(_0xc8c6('0x88'));exports[_0xc8c6('0x89')]=function(_0x39222f,_0x31b950,_0x2153e8){var _0x4d28f6={'agent':{},'channel':_0xc8c6('0x71')};if(_0x39222f[_0xc8c6('0x54')]['id']){delete _0x39222f['body']['id'];}_0x39222f[_0xc8c6('0x54')][_0xc8c6('0x74')]=_0x39222f['body'][_0xc8c6('0x74')]||_0x39222f['user']['id'];_0x4d28f6['agent']['id']=_0x39222f[_0xc8c6('0x54')][_0xc8c6('0x74')];return db[_0xc8c6('0x38')][_0xc8c6('0x55')]({'where':{'id':_0x39222f['params']['id'],'UserId':null}})[_0xc8c6('0x1e')](handleEntityNotFound(_0x31b950,null))[_0xc8c6('0x1e')](function(_0x13dbd5){if(_0x13dbd5){_0x4d28f6['message']=_0x13dbd5[_0xc8c6('0x77')]({'plain':!![]});return db[_0xc8c6('0x78')][_0xc8c6('0x55')]({'where':{'id':_0x13dbd5['MailInteractionId']}});}return null;})[_0xc8c6('0x1e')](handleEntityNotFound(_0x31b950,null))[_0xc8c6('0x1e')](function(_0x4fbea8){if(_0x4fbea8){_0x4d28f6[_0xc8c6('0x7b')]=_0x4fbea8['get']({'plain':!![]});interaction_log[_0xc8c6('0x1f')](_0xc8c6('0x8a'),_0x39222f[_0xc8c6('0x66')]['id'],_0x39222f[_0xc8c6('0x66')][_0xc8c6('0x35')],_0x39222f[_0xc8c6('0x66')][_0xc8c6('0x7d')],_0x4d28f6[_0xc8c6('0x7b')]['id'],_0x39222f['body']?JSON[_0xc8c6('0x8b')](_0x39222f[_0xc8c6('0x54')]):_0xc8c6('0x7e'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x4d28f6);}return null;})[_0xc8c6('0x1e')](function(_0x3ecdb1){if(_0x3ecdb1){_0x3ecdb1[_0xc8c6('0x25')][_0xc8c6('0x81')]=util['format'](_0xc8c6('0x82'),_0x39222f['user'][_0xc8c6('0x35')]);_0x3ecdb1['message']['channel']=_0x4d28f6['channel'];_0x3ecdb1[_0xc8c6('0x25')][_0xc8c6('0x84')]=_0xc8c6('0x89');respondWithRpcPromise('EventManager',_0xc8c6('0x86'),{'event':_0xc8c6('0x8c'),'message':_0x3ecdb1[_0xc8c6('0x25')]},client9002);return _0x4d28f6;}return null;})[_0xc8c6('0x1e')](respondWithResult(_0x31b950,null))[_0xc8c6('0x27')](handleError(_0x31b950,null));};exports[_0xc8c6('0x8d')]=function(_0x3deb69,_0x2fd7e8){var _0x343bbf=moment()[_0xc8c6('0x8e')]()['toString']();var _0x5873e3=path[_0xc8c6('0x69')](config[_0xc8c6('0x6a')],_0xc8c6('0x8f'),'files','tmp');var _0x5de9e8=path[_0xc8c6('0x69')](config['root'],_0xc8c6('0x8f'),_0xc8c6('0x90'),_0xc8c6('0x68'));var _0x28c79d=util[_0xc8c6('0x6e')](_0xc8c6('0x91'),_0x343bbf);return db[_0xc8c6('0x38')][_0xc8c6('0x55')]({'where':{'id':_0x3deb69['params']['id']},'attributes':['id','body',_0xc8c6('0x92'),'to','cc',_0xc8c6('0x93'),'subject',_0xc8c6('0x94')],'include':_0x3deb69[_0xc8c6('0x3b')][_0xc8c6('0x68')]?[{'model':db[_0xc8c6('0x95')],'as':_0xc8c6('0x96')}]:undefined})[_0xc8c6('0x1e')](handleEntityNotFound(_0x2fd7e8,null))[_0xc8c6('0x1e')](function(_0x15b1d5){if(_0x15b1d5){var _0x5b0cd9=_0x15b1d5;var _0x3b87c2={'from':_0x5b0cd9['from'],'to':_0x5b0cd9['to'],'subject':_0x5b0cd9[_0xc8c6('0x97')],'html':_0x5b0cd9['body'],'headers':{'Date':moment(_0x5b0cd9[_0xc8c6('0x94')])[_0xc8c6('0x6e')](_0xc8c6('0x98'))},'attachments':[]};if(_0x15b1d5['cc']){_0x3b87c2['headers']['Cc']=_0x15b1d5['cc'];}if(_0x15b1d5[_0xc8c6('0x93')]){_0x3b87c2[_0xc8c6('0x99')]['Bcc']=_0x15b1d5[_0xc8c6('0x93')];}return new BPromise(function(_0x366c15,_0x4b5fae){if(_0x15b1d5['Attachments']){for(var _0x83066d=0x0;_0x83066d<_0x15b1d5[_0xc8c6('0x96')][_0xc8c6('0x41')];_0x83066d++){var _0x155d12=_0x15b1d5[_0xc8c6('0x96')][_0x83066d];var _0xc0db94=path[_0xc8c6('0x69')](_0x5de9e8,_0x155d12[_0xc8c6('0x6b')]);if(fs[_0xc8c6('0x9a')](_0xc0db94)){_0x3b87c2['attachments'][_0xc8c6('0x9b')]({'name':_0x155d12[_0xc8c6('0x35')],'contentType':_0x155d12[_0xc8c6('0x9c')],'data':fs[_0xc8c6('0x9d')](_0xc0db94)});}}}emlformat[_0xc8c6('0x9e')](_0x3b87c2,function(_0x5db043,_0x15fb01){if(_0x5db043)return _0x4b5fae(_0x5db043);fs[_0xc8c6('0x9f')](path[_0xc8c6('0x69')](_0x5873e3,_0x28c79d),_0x15fb01);return _0x366c15(_0x15fb01);});});}})['then'](function(_0x528a40){if(_0x528a40){return _0x2fd7e8[_0xc8c6('0x8d')](path[_0xc8c6('0x69')](_0x5873e3,_0x28c79d),_0x28c79d,function(_0x113921){if(_0x113921){console[_0xc8c6('0xa0')](_0xc8c6('0xa1'),_0x113921);}else{fs[_0xc8c6('0xa2')](path[_0xc8c6('0x69')](_0x5873e3,_0x28c79d));}});}})[_0xc8c6('0x27')](handleError(_0x2fd7e8,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 1128dee..6803ad3 100644 --- a/server/api/mailMessage/mailMessage.events.js +++ b/server/api/mailMessage/mailMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f93=['setMaxListeners','save','remove','emit','events','../../mysqldb','MailMessage'];(function(_0x323047,_0x29346f){var _0x557fe8=function(_0x303a5d){while(--_0x303a5d){_0x323047['push'](_0x323047['shift']());}};_0x557fe8(++_0x29346f);}(_0x6f93,0x6d));var _0x36f9=function(_0x28457d,_0x4ffd10){_0x28457d=_0x28457d-0x0;var _0x234c1c=_0x6f93[_0x28457d];return _0x234c1c;};'use strict';var EventEmitter=require(_0x36f9('0x0'));var MailMessage=require(_0x36f9('0x1'))['db'][_0x36f9('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x36f9('0x3')](0x0);var events={'afterCreate':_0x36f9('0x4'),'afterUpdate':'update','afterDestroy':_0x36f9('0x5')};function emitEvent(_0x100c2e){return function(_0x33e1f2,_0x3dd994,_0x531ff2){MailMessageEvents[_0x36f9('0x6')](_0x100c2e+':'+_0x33e1f2['id'],_0x33e1f2);MailMessageEvents[_0x36f9('0x6')](_0x100c2e,_0x33e1f2);_0x531ff2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xf99e=['events','../../mysqldb','MailMessage','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5204e7,_0x239f1){var _0x27361c=function(_0x5de96a){while(--_0x5de96a){_0x5204e7['push'](_0x5204e7['shift']());}};_0x27361c(++_0x239f1);}(_0xf99e,0x90));var _0xef99=function(_0x39ef0e,_0x1dd6b9){_0x39ef0e=_0x39ef0e-0x0;var _0x1b96e6=_0xf99e[_0x39ef0e];return _0x1b96e6;};'use strict';var EventEmitter=require(_0xef99('0x0'));var MailMessage=require(_0xef99('0x1'))['db'][_0xef99('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xef99('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xef99('0x4')};function emitEvent(_0xf56cb6){return function(_0x1554db,_0x2c4066,_0x187b73){MailMessageEvents[_0xef99('0x5')](_0xf56cb6+':'+_0x1554db['id'],_0x1554db);MailMessageEvents[_0xef99('0x5')](_0xf56cb6,_0x1554db);_0x187b73(null);};}for(var e in events){if(events[_0xef99('0x6')](e)){var event=events[e];MailMessage[_0xef99('0x7')](e,emitEvent(event));}}module[_0xef99('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 27f26ac..f7953cd 100644 --- a/server/api/mailMessage/mailMessage.model.js +++ b/server/api/mailMessage/mailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9671=['lodash','api','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','body','fromString','models','get','toLowerCase','direction','out','isNil','UserId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5b7feb,_0x26fd39){var _0x4d2861=function(_0x10c492){while(--_0x10c492){_0x5b7feb['push'](_0x5b7feb['shift']());}};_0x4d2861(++_0x26fd39);}(_0x9671,0x114));var _0x1967=function(_0x35303a,_0x529cb5){_0x35303a=_0x35303a-0x0;var _0x309b5d=_0x9671[_0x35303a];return _0x309b5d;};'use strict';var _=require(_0x1967('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1967('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x1967('0x2'));var rimraf=require(_0x1967('0x3'));var config=require(_0x1967('0x4'));var attributes=require('./mailMessage.attributes');module[_0x1967('0x5')]=function(_0x4e845a,_0x4457f2){return _0x4e845a[_0x1967('0x6')](_0x1967('0x7'),attributes,{'tableName':_0x1967('0x8'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_mail_messages','fields':['plainBody','subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3bddda,_0x43407b,_0xabcbc3){if(_0x3bddda[_0x1967('0x9')]){_0x3bddda['plainBody']=htmlToText[_0x1967('0xa')](_0x3bddda['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xabcbc3(null,_0x43407b);},'afterCreate':function(_0x423371,_0x664322,_0x3282b2){var _0x47263c=_0x4e845a[_0x1967('0xb')];var _0x2acc1c=_0x423371[_0x1967('0xc')]({'plain':!![]});if(_0x2acc1c['direction'][_0x1967('0xd')]()==='in'||_0x2acc1c[_0x1967('0xe')][_0x1967('0xd')]()===_0x1967('0xf')&&!_0x2acc1c['secret']&&!_[_0x1967('0x10')](_0x2acc1c[_0x1967('0x11')])){_0x47263c['MailInteraction']['findOne']({'where':{'id':_0x2acc1c['MailInteractionId']}})['then'](function(_0x2ccd96){if(_0x2ccd96){_0x2ccd96[_0x1967('0x12')]({'lastMsgAt':_0x2acc1c[_0x1967('0x13')],'lastMsgDirection':_0x2acc1c[_0x1967('0xe')][_0x1967('0xd')](),'lastMsgBody':_0x2acc1c['body']});}})[_0x1967('0x14')](function(_0x2c2a4c){console['error'](_0x2c2a4c);});}_0x3282b2();}},'charset':_0x1967('0x15'),'collate':_0x1967('0x16')});}; \ No newline at end of file +var _0xfe24=['subject','FULLTEXT','plainBody','fromString','body','models','get','direction','secret','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages'];(function(_0x134a92,_0x2a2c86){var _0x4a75ad=function(_0x1caa87){while(--_0x1caa87){_0x134a92['push'](_0x134a92['shift']());}};_0x4a75ad(++_0x2a2c86);}(_0xfe24,0x133));var _0x4fe2=function(_0x5ebf91,_0x1e1cc0){_0x5ebf91=_0x5ebf91-0x0;var _0x587e29=_0xfe24[_0x5ebf91];return _0x587e29;};'use strict';var _=require(_0x4fe2('0x0'));var util=require(_0x4fe2('0x1'));var logger=require(_0x4fe2('0x2'))('api');var moment=require(_0x4fe2('0x3'));var BPromise=require(_0x4fe2('0x4'));var rp=require(_0x4fe2('0x5'));var htmlToText=require(_0x4fe2('0x6'));var fs=require('fs');var path=require(_0x4fe2('0x7'));var rimraf=require(_0x4fe2('0x8'));var config=require(_0x4fe2('0x9'));var attributes=require(_0x4fe2('0xa'));module[_0x4fe2('0xb')]=function(_0x5bb284,_0x4c671a){return _0x5bb284[_0x4fe2('0xc')](_0x4fe2('0xd'),attributes,{'tableName':_0x4fe2('0xe'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x4fe2('0xf')]},{'name':_0x4fe2('0x10'),'fields':['plainBody',_0x4fe2('0x11')],'type':_0x4fe2('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x51a96b,_0x4dcb5e,_0x21091e){if(_0x51a96b['body']){_0x51a96b[_0x4fe2('0x13')]=htmlToText[_0x4fe2('0x14')](_0x51a96b[_0x4fe2('0x15')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x21091e(null,_0x4dcb5e);},'afterCreate':function(_0x184189,_0x5d7a75,_0x23a589){var _0x14af75=_0x5bb284[_0x4fe2('0x16')];var _0x151002=_0x184189[_0x4fe2('0x17')]({'plain':!![]});if(_0x151002[_0x4fe2('0x18')]['toLowerCase']()==='in'||_0x151002[_0x4fe2('0x18')]['toLowerCase']()==='out'&&!_0x151002[_0x4fe2('0x19')]&&!_['isNil'](_0x151002['UserId'])){_0x14af75[_0x4fe2('0x1a')][_0x4fe2('0x1b')]({'where':{'id':_0x151002[_0x4fe2('0x1c')]}})[_0x4fe2('0x1d')](function(_0x5bb4b5){if(_0x5bb4b5){_0x5bb4b5[_0x4fe2('0x1e')]({'lastMsgAt':_0x151002[_0x4fe2('0x1f')],'lastMsgDirection':_0x151002[_0x4fe2('0x18')]['toLowerCase'](),'lastMsgBody':_0x151002[_0x4fe2('0x15')]});}})[_0x4fe2('0x20')](function(_0x3bea7c){console[_0x4fe2('0x21')](_0x3bea7c);});}_0x23a589();}},'charset':_0x4fe2('0x22'),'collate':_0x4fe2('0x23')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index d7084bb..93155fc 100644 --- a/server/api/mailMessage/mailMessage.rpc.js +++ b/server/api/mailMessage/mailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8bb=['code','message','result','MailMessage','create','raw','CreateMailMessage','stringify','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x4bdb66,_0x5c9c4a){var _0x23ef04=function(_0x555694){while(--_0x555694){_0x4bdb66['push'](_0x4bdb66['shift']());}};_0x23ef04(++_0x5c9c4a);}(_0xf8bb,0x111));var _0xbf8b=function(_0x3dc3d7,_0x2f3691){_0x3dc3d7=_0x3dc3d7-0x0;var _0x52ef97=_0xf8bb[_0x3dc3d7];return _0x52ef97;};'use strict';var _=require(_0xbf8b('0x0'));var util=require(_0xbf8b('0x1'));var moment=require(_0xbf8b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf8b('0x3'));var fs=require('fs');var Redis=require(_0xbf8b('0x4'));var db=require(_0xbf8b('0x5'))['db'];var utils=require(_0xbf8b('0x6'));var logger=require(_0xbf8b('0x7'))(_0xbf8b('0x8'));var config=require(_0xbf8b('0x9'));var jayson=require(_0xbf8b('0xa'));var client=jayson[_0xbf8b('0xb')][_0xbf8b('0xc')]({'port':0x232a});config[_0xbf8b('0xd')]=_[_0xbf8b('0xe')](config[_0xbf8b('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xbf8b('0xf'))(new Redis(config['redis']));require('./mailMessage.socket')[_0xbf8b('0x10')](socket);function respondWithRpcPromise(_0x5450da,_0x20452b,_0x5c346c){return new BPromise(function(_0x228875,_0x3506d1){return client[_0xbf8b('0x11')](_0x5450da,_0x5c346c)[_0xbf8b('0x12')](function(_0x353274){logger[_0xbf8b('0x13')](_0xbf8b('0x14'),_0x20452b,_0xbf8b('0x15'));logger['debug'](_0xbf8b('0x16'),_0x20452b,_0xbf8b('0x15'),JSON['stringify'](_0x353274));if(_0x353274[_0xbf8b('0x17')]){if(_0x353274[_0xbf8b('0x17')][_0xbf8b('0x18')]===0x1f4){logger[_0xbf8b('0x17')](_0xbf8b('0x14'),_0x20452b,_0x353274[_0xbf8b('0x17')][_0xbf8b('0x19')]);return _0x3506d1(_0x353274[_0xbf8b('0x17')][_0xbf8b('0x19')]);}logger[_0xbf8b('0x17')]('MailMessage,\x20%s,\x20%s',_0x20452b,_0x353274[_0xbf8b('0x17')][_0xbf8b('0x19')]);return _0x228875(_0x353274[_0xbf8b('0x17')][_0xbf8b('0x19')]);}else{logger[_0xbf8b('0x13')]('MailMessage,\x20%s,\x20%s',_0x20452b,_0xbf8b('0x15'));_0x228875(_0x353274[_0xbf8b('0x1a')][_0xbf8b('0x19')]);}})['catch'](function(_0x17512d){logger[_0xbf8b('0x17')](_0xbf8b('0x14'),_0x20452b,_0x17512d);_0x3506d1(_0x17512d);});});}exports['CreateMailMessage']=function(_0x3d4bd7){var _0x49dcde=this;return new Promise(function(_0xaff93c,_0x461bb8){return db[_0xbf8b('0x1b')][_0xbf8b('0x1c')](_0x3d4bd7['body'],{'raw':_0x3d4bd7['options']?_0x3d4bd7['options'][_0xbf8b('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3d4b1a){logger['info'](_0xbf8b('0x1e'),_0x3d4bd7);logger['debug']('CreateMailMessage',_0x3d4bd7,JSON[_0xbf8b('0x1f')](_0x3d4b1a));_0xaff93c(_0x3d4b1a);})[_0xbf8b('0x20')](function(_0x1bbc58){logger[_0xbf8b('0x17')](_0xbf8b('0x1e'),_0x1bbc58[_0xbf8b('0x19')],_0x3d4bd7);_0x461bb8(_0x49dcde[_0xbf8b('0x17')](0x1f4,_0x1bbc58[_0xbf8b('0x19')]));});});}; \ No newline at end of file +var _0x4fb4=['MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','MailMessage','body','options','CreateMailMessage','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then'];(function(_0x3d0de1,_0x3b9b78){var _0xb4f66c=function(_0x25e5ea){while(--_0x25e5ea){_0x3d0de1['push'](_0x3d0de1['shift']());}};_0xb4f66c(++_0x3b9b78);}(_0x4fb4,0x190));var _0x44fb=function(_0x5cd94c,_0x44a5d8){_0x5cd94c=_0x5cd94c-0x0;var _0x48685b=_0x4fb4[_0x5cd94c];return _0x48685b;};'use strict';var _=require('lodash');var util=require(_0x44fb('0x0'));var moment=require(_0x44fb('0x1'));var BPromise=require(_0x44fb('0x2'));var rs=require(_0x44fb('0x3'));var fs=require('fs');var Redis=require(_0x44fb('0x4'));var db=require(_0x44fb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x44fb('0x6'))(_0x44fb('0x7'));var config=require(_0x44fb('0x8'));var jayson=require(_0x44fb('0x9'));var client=jayson[_0x44fb('0xa')][_0x44fb('0xb')]({'port':0x232a});config[_0x44fb('0xc')]=_[_0x44fb('0xd')](config['redis'],{'host':_0x44fb('0xe'),'port':0x18eb});var socket=require(_0x44fb('0xf'))(new Redis(config['redis']));require(_0x44fb('0x10'))[_0x44fb('0x11')](socket);function respondWithRpcPromise(_0x2a1cb7,_0x34444f,_0x211fa3){return new BPromise(function(_0x44c83b,_0x184039){return client[_0x44fb('0x12')](_0x2a1cb7,_0x211fa3)[_0x44fb('0x13')](function(_0x2ae684){logger['info'](_0x44fb('0x14'),_0x34444f,_0x44fb('0x15'));logger[_0x44fb('0x16')](_0x44fb('0x17'),_0x34444f,_0x44fb('0x15'),JSON['stringify'](_0x2ae684));if(_0x2ae684[_0x44fb('0x18')]){if(_0x2ae684[_0x44fb('0x18')][_0x44fb('0x19')]===0x1f4){logger[_0x44fb('0x18')](_0x44fb('0x14'),_0x34444f,_0x2ae684['error'][_0x44fb('0x1a')]);return _0x184039(_0x2ae684[_0x44fb('0x18')][_0x44fb('0x1a')]);}logger[_0x44fb('0x18')](_0x44fb('0x14'),_0x34444f,_0x2ae684[_0x44fb('0x18')][_0x44fb('0x1a')]);return _0x44c83b(_0x2ae684['error'][_0x44fb('0x1a')]);}else{logger[_0x44fb('0x1b')](_0x44fb('0x14'),_0x34444f,_0x44fb('0x15'));_0x44c83b(_0x2ae684[_0x44fb('0x1c')][_0x44fb('0x1a')]);}})[_0x44fb('0x1d')](function(_0x1074cd){logger[_0x44fb('0x18')](_0x44fb('0x14'),_0x34444f,_0x1074cd);_0x184039(_0x1074cd);});});}exports['CreateMailMessage']=function(_0x4bd157){var _0x4b50f5=this;return new Promise(function(_0x4188f9,_0xca80c){return db[_0x44fb('0x1e')]['create'](_0x4bd157[_0x44fb('0x1f')],{'raw':_0x4bd157[_0x44fb('0x20')]?_0x4bd157[_0x44fb('0x20')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x38e834){logger[_0x44fb('0x1b')](_0x44fb('0x21'),_0x4bd157);logger['debug'](_0x44fb('0x21'),_0x4bd157,JSON[_0x44fb('0x22')](_0x38e834));_0x4188f9(_0x38e834);})[_0x44fb('0x1d')](function(_0x4a27b6){logger['error'](_0x44fb('0x21'),_0x4a27b6[_0x44fb('0x1a')],_0x4bd157);_0xca80c(_0x4b50f5[_0x44fb('0x18')](0x1f4,_0x4a27b6[_0x44fb('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index b74934b..4af21ed 100644 --- a/server/api/mailMessage/mailMessage.socket.js +++ b/server/api/mailMessage/mailMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x542b=['removeListener','mailMessage:','./mailMessage.events','save','update','emit'];(function(_0x4f6ffd,_0x316dd8){var _0x34a32e=function(_0x386980){while(--_0x386980){_0x4f6ffd['push'](_0x4f6ffd['shift']());}};_0x34a32e(++_0x316dd8);}(_0x542b,0xec));var _0xb542=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x542b[_0x2064e5];return _0x21a233;};'use strict';var MailMessageEvents=require(_0xb542('0x0'));var events=[_0xb542('0x1'),'remove',_0xb542('0x2')];function createListener(_0x2a1562,_0x2d69e4){return function(_0x4cb46f){_0x2d69e4[_0xb542('0x3')](_0x2a1562,_0x4cb46f);};}function removeListener(_0x3d3e23,_0x4a13a4){return function(){MailMessageEvents[_0xb542('0x4')](_0x3d3e23,_0x4a13a4);};}exports['register']=function(_0x10cf5d){for(var _0x27a259=0x0,_0x3cdc2b=events['length'];_0x27a259<_0x3cdc2b;_0x27a259++){var _0x4a88fa=events[_0x27a259];var _0x3bfab5=createListener(_0xb542('0x5')+_0x4a88fa,_0x10cf5d);MailMessageEvents['on'](_0x4a88fa,_0x3bfab5);}}; \ No newline at end of file +var _0xf35b=['./mailMessage.events','save','emit','removeListener','length'];(function(_0x5cdfc5,_0x20ee37){var _0x3d5a7a=function(_0x2a4039){while(--_0x2a4039){_0x5cdfc5['push'](_0x5cdfc5['shift']());}};_0x3d5a7a(++_0x20ee37);}(_0xf35b,0x1e5));var _0xbf35=function(_0x4c296e,_0x2358e3){_0x4c296e=_0x4c296e-0x0;var _0x578eb3=_0xf35b[_0x4c296e];return _0x578eb3;};'use strict';var MailMessageEvents=require(_0xbf35('0x0'));var events=[_0xbf35('0x1'),'remove','update'];function createListener(_0x55ca7b,_0x11c18a){return function(_0x40b03f){_0x11c18a[_0xbf35('0x2')](_0x55ca7b,_0x40b03f);};}function removeListener(_0x1da3b9,_0x25e677){return function(){MailMessageEvents[_0xbf35('0x3')](_0x1da3b9,_0x25e677);};}exports['register']=function(_0x337846){for(var _0x4fe28b=0x0,_0x449ff5=events[_0xbf35('0x4')];_0x4fe28b<_0x449ff5;_0x4fe28b++){var _0x555460=events[_0x4fe28b];var _0x10b584=createListener('mailMessage:'+_0x555460,_0x337846);MailMessageEvents['on'](_0x555460,_0x10b584);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index c29feb9..21d5baa 100644 --- a/server/api/mailQueue/index.js +++ b/server/api/mailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x812e=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','delete','removeTeams','removeAgents'];(function(_0x47e8c9,_0x2e6edc){var _0x31ea20=function(_0x501ba0){while(--_0x501ba0){_0x47e8c9['push'](_0x47e8c9['shift']());}};_0x31ea20(++_0x2e6edc);}(_0x812e,0x6c));var _0xe812=function(_0x36df0d,_0x3def5a){_0x36df0d=_0x36df0d-0x0;var _0x57baa7=_0x812e[_0x36df0d];return _0x57baa7;};'use strict';var multer=require(_0xe812('0x0'));var util=require('util');var path=require(_0xe812('0x1'));var timeout=require(_0xe812('0x2'));var express=require(_0xe812('0x3'));var router=express['Router']();var auth=require(_0xe812('0x4'));var interaction=require(_0xe812('0x5'));var config=require(_0xe812('0x6'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0xe812('0x7')](),controller[_0xe812('0x8')]);router[_0xe812('0x9')](_0xe812('0xa'),auth[_0xe812('0x7')](),controller[_0xe812('0xb')]);router[_0xe812('0x9')](_0xe812('0xc'),auth['isAuthenticated'](),controller[_0xe812('0xd')]);router['get'](_0xe812('0xe'),auth['isAuthenticated'](),controller[_0xe812('0xf')]);router[_0xe812('0x9')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xe812('0x10'),auth[_0xe812('0x7')](),controller[_0xe812('0x11')]);router['post']('/',auth[_0xe812('0x7')](),controller[_0xe812('0x12')]);router[_0xe812('0x13')](_0xe812('0x14'),auth[_0xe812('0x7')](),controller[_0xe812('0x15')]);router[_0xe812('0x13')](_0xe812('0x10'),auth[_0xe812('0x7')](),controller[_0xe812('0x16')]);router[_0xe812('0x17')](_0xe812('0xc'),auth[_0xe812('0x7')](),controller['update']);router['delete'](_0xe812('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0xe812('0x18')]('/:id/teams',auth[_0xe812('0x7')](),controller[_0xe812('0x19')]);router[_0xe812('0x18')](_0xe812('0x10'),auth['isAuthenticated'](),controller[_0xe812('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xdafd=['addAgents','put','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/members','getMembers','getAgents','post','create','/:id/teams','addTeams'];(function(_0x5947f8,_0x305779){var _0x43888e=function(_0xa6aadc){while(--_0xa6aadc){_0x5947f8['push'](_0x5947f8['shift']());}};_0x43888e(++_0x305779);}(_0xdafd,0x1b9));var _0xddaf=function(_0x22b94c,_0x1001c5){_0x22b94c=_0x22b94c-0x0;var _0x2cbab6=_0xdafd[_0x22b94c];return _0x2cbab6;};'use strict';var multer=require(_0xddaf('0x0'));var util=require(_0xddaf('0x1'));var path=require('path');var timeout=require(_0xddaf('0x2'));var express=require('express');var router=express[_0xddaf('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xddaf('0x4'));var config=require(_0xddaf('0x5'));var controller=require('./mailQueue.controller');router[_0xddaf('0x6')]('/',auth[_0xddaf('0x7')](),controller['index']);router[_0xddaf('0x6')](_0xddaf('0x8'),auth[_0xddaf('0x7')](),controller[_0xddaf('0x9')]);router[_0xddaf('0x6')](_0xddaf('0xa'),auth[_0xddaf('0x7')](),controller['show']);router[_0xddaf('0x6')](_0xddaf('0xb'),auth[_0xddaf('0x7')](),controller[_0xddaf('0xc')]);router[_0xddaf('0x6')]('/:id/teams',auth[_0xddaf('0x7')](),controller['getTeams']);router[_0xddaf('0x6')]('/:id/users',auth[_0xddaf('0x7')](),controller[_0xddaf('0xd')]);router[_0xddaf('0xe')]('/',auth[_0xddaf('0x7')](),controller[_0xddaf('0xf')]);router[_0xddaf('0xe')](_0xddaf('0x10'),auth[_0xddaf('0x7')](),controller[_0xddaf('0x11')]);router[_0xddaf('0xe')]('/:id/users',auth['isAuthenticated'](),controller[_0xddaf('0x12')]);router[_0xddaf('0x13')](_0xddaf('0xa'),auth[_0xddaf('0x7')](),controller[_0xddaf('0x14')]);router[_0xddaf('0x15')](_0xddaf('0xa'),auth['isAuthenticated'](),controller[_0xddaf('0x16')]);router[_0xddaf('0x15')](_0xddaf('0x10'),auth[_0xddaf('0x7')](),controller[_0xddaf('0x17')]);router[_0xddaf('0x15')](_0xddaf('0x18'),auth[_0xddaf('0x7')](),controller[_0xddaf('0x19')]);module[_0xddaf('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 235027b..482bf88 100644 --- a/server/api/mailQueue/mailQueue.attributes.js +++ b/server/api/mailQueue/mailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2c4=['sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2c4,0x80));var _0x4c2c=function(_0x9257ef,_0x51dabc){_0x9257ef=_0x9257ef-0x0;var _0x1b1d11=_0xc2c4[_0x9257ef];return _0x1b1d11;};'use strict';var Sequelize=require(_0x4c2c('0x0'));module[_0x4c2c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4c2c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4c2c('0x3')]},'timeout':{'type':Sequelize[_0x4c2c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4c2c('0x5')](_0x4c2c('0x6'),_0x4c2c('0x7'),'roundrobin')}}; \ No newline at end of file +var _0xfb05=['name','INTEGER','ENUM','sequelize','exports','STRING'];(function(_0x2c2ac5,_0x46dd26){var _0x3bbc5e=function(_0x46c3ed){while(--_0x46c3ed){_0x2c2ac5['push'](_0x2c2ac5['shift']());}};_0x3bbc5e(++_0x46dd26);}(_0xfb05,0x1b3));var _0x5fb0=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfb05[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x5fb0('0x0'));module[_0x5fb0('0x1')]={'name':{'type':Sequelize[_0x5fb0('0x2')],'unique':_0x5fb0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5fb0('0x2')]},'timeout':{'type':Sequelize[_0x5fb0('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5fb0('0x5')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index adec22f..4d8b7a0 100644 --- a/server/api/mailQueue/mailQueue.controller.js +++ b/server/api/mailQueue/mailQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90b5=['mailPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','Agents','voicePause','interface','transaction','each','emit','userMailQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','limit','set','apply','reject','then','destroy','error','stack','name','index','MailQueue','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','get','MailQueues','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','MailQueueId','map','UserMailQueue','User','agent'];(function(_0x2cc2af,_0xae52b1){var _0x35ca79=function(_0x1ffa64){while(--_0x1ffa64){_0x2cc2af['push'](_0x2cc2af['shift']());}};_0x35ca79(++_0xae52b1);}(_0x90b5,0x139));var _0x590b=function(_0xd9f8be,_0x34b8a9){_0xd9f8be=_0xd9f8be-0x0;var _0x496027=_0x90b5[_0xd9f8be];return _0x496027;};'use strict';var pdf=require(_0x590b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x590b('0x1'));var zipdir=require(_0x590b('0x2'));var jsonpatch=require(_0x590b('0x3'));var rp=require(_0x590b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x590b('0x5'));var util=require(_0x590b('0x6'));var path=require('path');var sox=require(_0x590b('0x7'));var csv=require(_0x590b('0x8'));var ejs=require(_0x590b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x590b('0xa'));var crypto=require(_0x590b('0xb'));var jsforce=require(_0x590b('0xc'));var deskjs=require(_0x590b('0xd'));var toCsv=require(_0x590b('0x8'));var querystring=require(_0x590b('0xe'));var Papa=require(_0x590b('0xf'));var Redis=require(_0x590b('0x10'));var authService=require(_0x590b('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x590b('0x12'));var logger=require(_0x590b('0x13'))('api');var utils=require(_0x590b('0x14'));var config=require('../../config/environment');var db=require(_0x590b('0x15'))['db'];config[_0x590b('0x16')]=_[_0x590b('0x17')](config[_0x590b('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x590b('0x18'))(new Redis(config[_0x590b('0x16')]));require(_0x590b('0x19'))[_0x590b('0x1a')](socket);function respondWithStatusCode(_0x2e85b1,_0x6ad7e7){_0x6ad7e7=_0x6ad7e7||0xcc;return function(_0x45ac04){if(_0x45ac04){return _0x2e85b1[_0x590b('0x1b')](_0x6ad7e7);}return _0x2e85b1[_0x590b('0x1c')](_0x6ad7e7)[_0x590b('0x1d')]();};}function respondWithResult(_0x3fc5ca,_0x260f47){_0x260f47=_0x260f47||0xc8;return function(_0x3e4723){if(_0x3e4723){return _0x3fc5ca[_0x590b('0x1c')](_0x260f47)[_0x590b('0x1e')](_0x3e4723);}};}function respondWithFilteredResult(_0x4f2512,_0x1ec65a){return function(_0x530e24){if(_0x530e24){var _0x5c788=_0x530e24['count'],_0x115309=_0x1ec65a[_0x590b('0x1f')],_0xf05b00=_0x1ec65a['offset']+_0x1ec65a[_0x590b('0x20')],_0x53337c;if(_0xf05b00>=_0x5c788){_0xf05b00=_0x5c788;_0x53337c=0xc8;}else{_0x53337c=0xce;}_0x4f2512[_0x590b('0x1c')](_0x53337c);return _0x4f2512[_0x590b('0x21')]('Content-Range',_0x115309+'-'+_0xf05b00+'/'+_0x5c788)[_0x590b('0x1e')](_0x530e24);}return null;};}function patchUpdates(_0x8ab843){return function(_0x2b8ea0){try{jsonpatch[_0x590b('0x22')](_0x2b8ea0,_0x8ab843,!![]);}catch(_0x4990ba){return BPromise[_0x590b('0x23')](_0x4990ba);}return _0x2b8ea0['save']();};}function saveUpdates(_0x10a339,_0x30dc9f){return function(_0x5bdaba){if(_0x5bdaba){return _0x5bdaba['update'](_0x10a339)[_0x590b('0x24')](function(_0x2bcfca){return _0x2bcfca;});}return null;};}function removeEntity(_0x52bdad,_0x21638c){return function(_0x1045d5){if(_0x1045d5){return _0x1045d5['destroy']()['then'](function(){var _0x26f073=_0x1045d5['get']({'plain':!![]});var _0x39fead='MailQueues';return db['UserProfileResource'][_0x590b('0x25')]({'where':{'type':_0x39fead,'resourceId':_0x26f073['id']}})[_0x590b('0x24')](function(){return _0x1045d5;});})['then'](function(){_0x52bdad[_0x590b('0x1c')](0xcc)[_0x590b('0x1d')]();});}};}function handleEntityNotFound(_0x91e491,_0x2914dd){return function(_0x320a45){if(!_0x320a45){_0x91e491['sendStatus'](0x194);}return _0x320a45;};}function handleError(_0x32d355,_0xd96ca3){_0xd96ca3=_0xd96ca3||0x1f4;return function(_0x333af8){logger[_0x590b('0x26')](_0x333af8[_0x590b('0x27')]);if(_0x333af8[_0x590b('0x28')]){delete _0x333af8['name'];}_0x32d355[_0x590b('0x1c')](_0xd96ca3)['send'](_0x333af8);};}exports[_0x590b('0x29')]=function(_0x3f9fd0,_0x448ab3){var _0x33931e={},_0x53a751={},_0x1041e5={'count':0x0,'rows':[]};var _0x4ef071=db[_0x590b('0x2a')][_0x590b('0x2b')];_0x53a751[_0x590b('0x2c')]=_[_0x590b('0x2d')](_0x4ef071);_0x53a751[_0x590b('0x2e')]=_['keys'](_0x3f9fd0[_0x590b('0x2e')]);_0x53a751[_0x590b('0x2f')]=_[_0x590b('0x30')](_0x53a751[_0x590b('0x2c')],_0x53a751['query']);_0x33931e['attributes']=_[_0x590b('0x30')](_0x53a751[_0x590b('0x2c')],qs[_0x590b('0x31')](_0x3f9fd0[_0x590b('0x2e')]['fields']));_0x33931e['attributes']=_0x33931e[_0x590b('0x32')]['length']?_0x33931e[_0x590b('0x32')]:_0x53a751[_0x590b('0x2c')];if(!_0x3f9fd0[_0x590b('0x2e')][_0x590b('0x33')](_0x590b('0x34'))){_0x33931e[_0x590b('0x20')]=qs[_0x590b('0x20')](_0x3f9fd0[_0x590b('0x2e')][_0x590b('0x20')]);_0x33931e[_0x590b('0x1f')]=qs['offset'](_0x3f9fd0['query'][_0x590b('0x1f')]);}_0x33931e[_0x590b('0x35')]=qs[_0x590b('0x36')](_0x3f9fd0[_0x590b('0x2e')][_0x590b('0x36')]);_0x33931e['where']=qs[_0x590b('0x2f')](_[_0x590b('0x37')](_0x3f9fd0[_0x590b('0x2e')],_0x53a751[_0x590b('0x2f')]));if(_0x3f9fd0[_0x590b('0x2e')]['filter']){_0x33931e[_0x590b('0x38')]=_[_0x590b('0x39')](_0x33931e['where'],{'$or':_['map'](_0x4ef071,function(_0x46dbf3){if(_0x46dbf3['type'][_0x590b('0x3a')]!==_0x590b('0x3b')){var _0x3e83da={};_0x3e83da[_0x46dbf3[_0x590b('0x3c')]]={'$like':'%'+_0x3f9fd0[_0x590b('0x2e')][_0x590b('0x3d')]+'%'};return _0x3e83da;}})});}_0x33931e=_[_0x590b('0x39')]({},_0x33931e,_0x3f9fd0[_0x590b('0x3e')]);var _0x16fdec={'where':_0x33931e[_0x590b('0x38')]};return db['MailQueue'][_0x590b('0x3f')](_0x16fdec)[_0x590b('0x24')](function(_0x2efaab){_0x1041e5['count']=_0x2efaab;if(_0x3f9fd0[_0x590b('0x2e')][_0x590b('0x40')]){_0x33931e[_0x590b('0x41')]=[{'all':!![]}];}return db[_0x590b('0x2a')][_0x590b('0x42')](_0x33931e);})[_0x590b('0x24')](function(_0x2a8684){_0x1041e5[_0x590b('0x43')]=_0x2a8684;return _0x1041e5;})['then'](respondWithFilteredResult(_0x448ab3,_0x33931e))[_0x590b('0x44')](handleError(_0x448ab3,null));};exports['show']=function(_0xb345c0,_0x32c1cd){var _0x125b1a={'raw':!![],'where':{'id':_0xb345c0[_0x590b('0x45')]['id']}},_0x4a41b1={};_0x4a41b1[_0x590b('0x2c')]=_[_0x590b('0x2d')](db[_0x590b('0x2a')]['rawAttributes']);_0x4a41b1[_0x590b('0x2e')]=_[_0x590b('0x2d')](_0xb345c0['query']);_0x4a41b1['filters']=_['intersection'](_0x4a41b1[_0x590b('0x2c')],_0x4a41b1[_0x590b('0x2e')]);_0x125b1a[_0x590b('0x32')]=_['intersection'](_0x4a41b1['model'],qs[_0x590b('0x31')](_0xb345c0[_0x590b('0x2e')]['fields']));_0x125b1a[_0x590b('0x32')]=_0x125b1a[_0x590b('0x32')][_0x590b('0x46')]?_0x125b1a[_0x590b('0x32')]:_0x4a41b1[_0x590b('0x2c')];if(_0xb345c0[_0x590b('0x2e')][_0x590b('0x40')]){_0x125b1a[_0x590b('0x41')]=[{'all':!![]}];}_0x125b1a=_[_0x590b('0x39')]({},_0x125b1a,_0xb345c0[_0x590b('0x3e')]);return db[_0x590b('0x2a')][_0x590b('0x47')](_0x125b1a)[_0x590b('0x24')](handleEntityNotFound(_0x32c1cd,null))['then'](respondWithResult(_0x32c1cd,null))['catch'](handleError(_0x32c1cd,null));};exports[_0x590b('0x48')]=function(_0x1c1e35,_0x1ce21e){return db[_0x590b('0x2a')]['create'](_0x1c1e35[_0x590b('0x49')],{})[_0x590b('0x24')](function(_0x2f492a){var _0x5cc53f=_0x1c1e35[_0x590b('0x4a')][_0x590b('0x4b')]({'plain':!![]});if(!_0x5cc53f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cc53f['role']===_0x590b('0x4a')){var _0x224a9b=_0x2f492a['get']({'plain':!![]});var _0x218c86=_0x590b('0x4c');return db['UserProfileSection'][_0x590b('0x47')]({'where':{'name':_0x218c86,'userProfileId':_0x5cc53f[_0x590b('0x4d')]},'raw':!![]})[_0x590b('0x24')](function(_0x525b35){if(_0x525b35&&_0x525b35['autoAssociation']===0x0){return db[_0x590b('0x4e')][_0x590b('0x48')]({'name':_0x224a9b['name'],'resourceId':_0x224a9b['id'],'type':_0x525b35[_0x590b('0x28')],'sectionId':_0x525b35['id']},{})[_0x590b('0x24')](function(){return _0x2f492a;});}else{return _0x2f492a;}})[_0x590b('0x44')](function(_0x1b7ceb){logger[_0x590b('0x26')](_0x590b('0x4f'),_0x1b7ceb);throw _0x1b7ceb;});}return _0x2f492a;})[_0x590b('0x24')](respondWithResult(_0x1ce21e,0xc9))['catch'](handleError(_0x1ce21e,null));};exports[_0x590b('0x50')]=function(_0x539d49,_0x1a6e6f){if(_0x539d49[_0x590b('0x49')]['id']){delete _0x539d49[_0x590b('0x49')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x539d49[_0x590b('0x45')]['id']}})[_0x590b('0x24')](handleEntityNotFound(_0x1a6e6f,null))[_0x590b('0x24')](saveUpdates(_0x539d49[_0x590b('0x49')],null))['then'](respondWithResult(_0x1a6e6f,null))[_0x590b('0x44')](handleError(_0x1a6e6f,null));};exports['destroy']=function(_0x5497a5,_0xa69039){return db['MailQueue'][_0x590b('0x47')]({'where':{'id':_0x5497a5['params']['id']}})[_0x590b('0x24')](handleEntityNotFound(_0xa69039,null))['then'](removeEntity(_0xa69039,null))[_0x590b('0x44')](handleError(_0xa69039,null));};exports[_0x590b('0x51')]=function(_0x41594d,_0x2d8309){return db[_0x590b('0x2a')][_0x590b('0x51')]()[_0x590b('0x24')](respondWithResult(_0x2d8309,null))[_0x590b('0x44')](handleError(_0x2d8309,null));};exports[_0x590b('0x52')]=function(_0x493b12,_0x3ec016,_0x41c20c){var _0x53b76b={'raw':!![],'where':{}},_0x5937d7={},_0x1bf216;return db[_0x590b('0x2a')][_0x590b('0x53')]({'where':{'id':_0x493b12['params']['id']}})[_0x590b('0x24')](handleEntityNotFound(_0x3ec016,null))[_0x590b('0x24')](function(_0x7a8153){if(_0x7a8153){_0x1bf216=_0x7a8153[_0x590b('0x4b')]({'plain':!![]});_0x5937d7['model']=_[_0x590b('0x2d')](db['UserMailQueue'][_0x590b('0x2b')]);_0x5937d7[_0x590b('0x2e')]=_[_0x590b('0x2d')](_0x493b12[_0x590b('0x2e')]);_0x5937d7['filters']=_[_0x590b('0x30')](_0x5937d7['model'],_0x5937d7[_0x590b('0x2e')]);_0x53b76b[_0x590b('0x32')]=_[_0x590b('0x30')](_0x5937d7['model'],qs[_0x590b('0x31')](_0x493b12['query'][_0x590b('0x31')]));_0x53b76b['attributes']=_0x53b76b[_0x590b('0x32')][_0x590b('0x46')]?_0x53b76b[_0x590b('0x32')]:_0x5937d7['model'];if(!_0x493b12['query'][_0x590b('0x33')](_0x590b('0x34'))){_0x53b76b[_0x590b('0x20')]=qs[_0x590b('0x20')](_0x493b12['query'][_0x590b('0x20')]);_0x53b76b['offset']=qs[_0x590b('0x1f')](_0x493b12[_0x590b('0x2e')][_0x590b('0x1f')]);}_0x53b76b[_0x590b('0x35')]=qs[_0x590b('0x36')](_0x493b12['query']['sort']);_0x53b76b[_0x590b('0x38')]=qs['filters'](_['pick'](_0x493b12[_0x590b('0x2e')],_0x5937d7[_0x590b('0x2f')]));_0x53b76b['where'][_0x590b('0x54')]=_0x7a8153['id'];if(_0x493b12[_0x590b('0x2e')]['filter']){_0x53b76b[_0x590b('0x38')]=_[_0x590b('0x39')](_0x53b76b['where'],{'$or':_[_0x590b('0x55')](_0x53b76b['attributes'],function(_0x26de32){var _0xa506e2={};_0xa506e2[_0x26de32]={'$like':'%'+_0x493b12[_0x590b('0x2e')]['filter']+'%'};return _0xa506e2;})});}_0x53b76b=_[_0x590b('0x39')]({},_0x53b76b,_0x493b12[_0x590b('0x3e')]);return db[_0x590b('0x56')][_0x590b('0x42')](_0x53b76b);}})['then'](function(_0x3b713b){if(_0x3b713b){return db[_0x590b('0x57')]['findAndCountAll']({'where':{'id':_[_0x590b('0x55')](_0x3b713b,'UserId'),'role':_0x590b('0x58')},'attributes':['id',_0x590b('0x28'),_0x590b('0x59'),_0x590b('0x5a'),_0x590b('0x5b')]});}})[_0x590b('0x24')](function(_0x2c210c){if(_0x2c210c){return{'count':_0x2c210c[_0x590b('0x3f')],'rows':_['map'](_0x2c210c[_0x590b('0x43')],function(_0x257a22){return{'membername':_0x257a22[_0x590b('0x28')],'UserId':_0x257a22['id'],'queue_name':_0x1bf216[_0x590b('0x28')],'MailQueueId':_0x1bf216['id'],'interface':util['format']('%s/%s',_0x590b('0x5c'),_0x257a22[_0x590b('0x28')]),'penalty':0x0,'paused':_0x257a22['mailPause'],'createdAt':_0x257a22[_0x590b('0x5b')],'updatedAt':_0x257a22[_0x590b('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x590b('0x24')](respondWithFilteredResult(_0x3ec016,_0x53b76b))['catch'](handleError(_0x3ec016,null));};exports[_0x590b('0x5d')]=function(_0x5207af,_0x43dedf,_0x4b7d4b){var _0x4a46fc={};var _0x2ad737={};var _0x1407cf;var _0x5bb083;return db[_0x590b('0x2a')][_0x590b('0x53')]({'where':{'id':_0x5207af[_0x590b('0x45')]['id']}})[_0x590b('0x24')](handleEntityNotFound(_0x43dedf,null))['then'](function(_0x1675bd){if(_0x1675bd){_0x1407cf=_0x1675bd;_0x2ad737[_0x590b('0x2c')]=_[_0x590b('0x2d')](db[_0x590b('0x5e')][_0x590b('0x2b')]);_0x2ad737[_0x590b('0x2e')]=_[_0x590b('0x2d')](_0x5207af[_0x590b('0x2e')]);_0x2ad737[_0x590b('0x2f')]=_['intersection'](_0x2ad737[_0x590b('0x2c')],_0x2ad737['query']);_0x4a46fc[_0x590b('0x32')]=_[_0x590b('0x30')](_0x2ad737[_0x590b('0x2c')],qs[_0x590b('0x31')](_0x5207af['query'][_0x590b('0x31')]));_0x4a46fc[_0x590b('0x32')]=_0x4a46fc[_0x590b('0x32')]['length']?_0x4a46fc[_0x590b('0x32')]:_0x2ad737[_0x590b('0x2c')];_0x4a46fc[_0x590b('0x35')]=qs[_0x590b('0x36')](_0x5207af[_0x590b('0x2e')]['sort']);_0x4a46fc[_0x590b('0x38')]=qs[_0x590b('0x2f')](_['pick'](_0x5207af['query'],_0x2ad737['filters']));if(_0x5207af[_0x590b('0x2e')][_0x590b('0x3d')]){_0x4a46fc['where']=_['merge'](_0x4a46fc[_0x590b('0x38')],{'$or':_['map'](_0x4a46fc[_0x590b('0x32')],function(_0x2acd6f){var _0x21be96={};_0x21be96[_0x2acd6f]={'$like':'%'+_0x5207af['query'][_0x590b('0x3d')]+'%'};return _0x21be96;})});}_0x4a46fc=_[_0x590b('0x39')]({},_0x4a46fc,_0x5207af[_0x590b('0x3e')]);return _0x1407cf['getTeams'](_0x4a46fc);}})[_0x590b('0x24')](function(_0x3d1617){if(_0x3d1617){_0x5bb083=_0x3d1617[_0x590b('0x46')];if(!_0x5207af['query'][_0x590b('0x33')](_0x590b('0x34'))){_0x4a46fc[_0x590b('0x20')]=qs[_0x590b('0x20')](_0x5207af['query'][_0x590b('0x20')]);_0x4a46fc[_0x590b('0x1f')]=qs[_0x590b('0x1f')](_0x5207af[_0x590b('0x2e')][_0x590b('0x1f')]);}return _0x1407cf[_0x590b('0x5d')](_0x4a46fc);}})['then'](function(_0x20baa9){if(_0x20baa9){return _0x20baa9?{'count':_0x5bb083,'rows':_0x20baa9}:null;}})[_0x590b('0x24')](respondWithResult(_0x43dedf,null))[_0x590b('0x44')](handleError(_0x43dedf,null));};exports[_0x590b('0x5f')]=function(_0x15b162,_0x570b2e,_0x1da0af){var _0x191aeb=_0x15b162[_0x590b('0x49')]['teams'];return db['Team'][_0x590b('0x42')]({'where':{'id':_[_0x590b('0x55')](_0x191aeb,'id')},'attributes':['id'],'include':[{'model':db[_0x590b('0x57')],'as':_0x590b('0x60'),'attributes':['id',_0x590b('0x28'),'online',_0x590b('0x61'),_0x590b('0x62')],'raw':!![]}]})['then'](function(_0xa3f06f){if(_0xa3f06f){var _0xd24046=_['flatMap'](_0xa3f06f,function(_0x2b1337){var _0x2cf317=_0x2b1337[_0x590b('0x4b')]({'plain':!![]});return _0x2cf317[_0x590b('0x60')];});return db[_0x590b('0x2a')][_0x590b('0x47')]({'where':{'id':_0x15b162['params']['id']}})[_0x590b('0x24')](function(_0x44c344){return db['sequelize'][_0x590b('0x63')](function(_0xc222ba){return _0x44c344[_0x590b('0x5f')](_['map'](_0x191aeb,'id'),{'transaction':_0xc222ba})[_0x590b('0x24')](function(){return BPromise[_0x590b('0x64')](_0xd24046,function(_0x524a65){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x524a65['id'],'MailQueueId':_0x15b162[_0x590b('0x45')]['id']},'transaction':_0xc222ba});});})[_0x590b('0x24')](function(){_0xd24046['forEach'](function(_0x21bebd){socket[_0x590b('0x65')](_0x590b('0x66'),{'UserId':_0x21bebd['id'],'MailQueueId':_0x44c344['id']});});});});});}})[_0x590b('0x24')](respondWithStatusCode(_0x570b2e,null))[_0x590b('0x44')](handleError(_0x570b2e,null));};exports[_0x590b('0x67')]=function(_0x2a595c,_0x32e2de,_0x188bef){return db[_0x590b('0x5e')]['findAll']({'where':{'id':_0x2a595c[_0x590b('0x2e')][_0x590b('0x68')]},'attributes':['id'],'include':[{'model':db[_0x590b('0x57')],'as':_0x590b('0x60'),'attributes':['id'],'raw':!![]}]})[_0x590b('0x24')](handleEntityNotFound(_0x32e2de,null))[_0x590b('0x24')](function(_0x15b8cb){var _0x319e9f=_[_0x590b('0x55')](_0x15b8cb,'id');var _0x28d964=[];var _0x5a8893=[];var _0x4d19de=squel[_0x590b('0x69')]();_0x4d19de[_0x590b('0x3c')](_0x590b('0x6a'))[_0x590b('0x6b')](_0x590b('0x6c'),'tq')[_0x590b('0x6d')](_0x590b('0x6e'),'ut',_0x590b('0x6f'))[_0x590b('0x38')]('MailQueueId\x20=\x20?',_0x2a595c[_0x590b('0x45')]['id']);for(var _0x137f08=0x0;_0x137f08<_0x15b8cb[_0x590b('0x46')];_0x137f08+=0x1){let _0x2fa0ef=_0x15b8cb[_0x137f08];for(var _0x388b80=0x0;_0x388b80<_0x2fa0ef['Agents'][_0x590b('0x46')];_0x388b80+=0x1){let _0x6fea48=_0x2fa0ef[_0x590b('0x60')][_0x388b80];var _0x4f2a39=_0x4d19de['clone']();_0x4f2a39[_0x590b('0x38')](_0x590b('0x70'),_0x6fea48['id']);_0x5a8893[_0x590b('0x71')](db[_0x590b('0x72')][_0x590b('0x2e')](_0x4f2a39[_0x590b('0x73')](),{'type':db[_0x590b('0x72')][_0x590b('0x74')][_0x590b('0x75')]})['then'](function(_0x5c414e){if(_0x5c414e[_0x590b('0x46')]===0x1){return _0x6fea48['id'];}else{var _0x487c60=_[_0x590b('0x76')](_[_0x590b('0x55')](_0x5c414e,_0x590b('0x77')),function(_0x4c8f56){return _[_0x590b('0x78')](_0x319e9f,_0x4c8f56);});if(_0x487c60){return _0x6fea48['id'];}}}));}}return BPromise[_0x590b('0x79')](_0x5a8893)[_0x590b('0x24')](function(_0x4edbb2){_0x28d964=_(_0x28d964)[_0x590b('0x7a')](_0x4edbb2)[_0x590b('0x7b')]()[_0x590b('0x7c')]();return db['MailQueue'][_0x590b('0x47')]({'where':{'id':_0x2a595c[_0x590b('0x45')]['id']}})[_0x590b('0x24')](function(_0x253e8e){return db[_0x590b('0x72')]['transaction'](function(_0x55aea7){return _0x253e8e[_0x590b('0x67')](_0x2a595c[_0x590b('0x2e')]['ids'],{'transaction':_0x55aea7})[_0x590b('0x24')](function(){if(!_[_0x590b('0x7d')](_0x28d964)){return _0x253e8e[_0x590b('0x7e')](_0x28d964,{'transaction':_0x55aea7});}})[_0x590b('0x24')](function(){_0x28d964[_0x590b('0x7f')](function(_0x302c27){socket[_0x590b('0x65')](_0x590b('0x80'),{'UserId':_0x302c27,'MailQueueId':_0x253e8e['id']});});});});});});})[_0x590b('0x24')](respondWithStatusCode(_0x32e2de,null))[_0x590b('0x44')](handleError(_0x32e2de,null));};exports[_0x590b('0x81')]=function(_0x18e041,_0x2a33ce,_0x1c4c7d){return db[_0x590b('0x2a')][_0x590b('0x47')]({'where':{'id':_0x18e041['params']['id']}})['then'](handleEntityNotFound(_0x2a33ce,null))[_0x590b('0x24')](function(_0x536687){if(_0x536687){return _0x536687[_0x590b('0x81')](_0x18e041[_0x590b('0x49')][_0x590b('0x68')],_[_0x590b('0x82')](_0x18e041[_0x590b('0x49')],['ids','id'])||{})[_0x590b('0x83')](function(_0x3232cd){for(var _0x39c690=0x0;_0x39c690<_0x18e041[_0x590b('0x49')][_0x590b('0x68')][_0x590b('0x46')];_0x39c690+=0x1){socket[_0x590b('0x65')](_0x590b('0x66'),{'UserId':_0x18e041[_0x590b('0x49')][_0x590b('0x68')][_0x39c690],'MailQueueId':_0x18e041[_0x590b('0x45')]['id']});}return _0x3232cd;});}})['then'](respondWithResult(_0x2a33ce,null))[_0x590b('0x44')](handleError(_0x2a33ce,null));};exports[_0x590b('0x7e')]=function(_0xc3374c,_0x4d8d39,_0x1b7313){return db[_0x590b('0x2a')][_0x590b('0x47')]({'where':{'id':_0xc3374c[_0x590b('0x45')]['id']}})[_0x590b('0x24')](handleEntityNotFound(_0x4d8d39,null))[_0x590b('0x24')](function(_0x196ce6){if(_0x196ce6){return _0x196ce6[_0x590b('0x7e')](_0xc3374c[_0x590b('0x2e')]['ids'])[_0x590b('0x24')](function(){if(_[_0x590b('0x84')](_0xc3374c[_0x590b('0x2e')][_0x590b('0x68')])){for(var _0x438a9b=0x0;_0x438a9b<_0xc3374c[_0x590b('0x2e')][_0x590b('0x68')][_0x590b('0x46')];_0x438a9b+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0xc3374c[_0x590b('0x2e')]['ids'][_0x438a9b]),'MailQueueId':Number(_0xc3374c[_0x590b('0x45')]['id'])});}}else{socket[_0x590b('0x65')]('userMailQueue:remove',{'UserId':Number(_0xc3374c[_0x590b('0x2e')][_0x590b('0x68')]),'MailQueueId':Number(_0xc3374c[_0x590b('0x45')]['id'])});}});}})[_0x590b('0x24')](respondWithStatusCode(_0x4d8d39,null))['catch'](handleError(_0x4d8d39,null));};exports[_0x590b('0x85')]=function(_0x58d88d,_0x5c0878,_0xb08dd9){var _0x5cf908={};var _0x5d7aed={};var _0x1bb2d0;var _0x5b1497;return db[_0x590b('0x2a')][_0x590b('0x53')]({'where':{'id':_0x58d88d[_0x590b('0x45')]['id']}})['then'](handleEntityNotFound(_0x5c0878,null))[_0x590b('0x24')](function(_0x3c0828){if(_0x3c0828){_0x1bb2d0=_0x3c0828;_0x5d7aed[_0x590b('0x2c')]=_[_0x590b('0x2d')](db[_0x590b('0x57')]['rawAttributes']);_0x5d7aed['query']=_[_0x590b('0x2d')](_0x58d88d['query']);_0x5d7aed['filters']=_[_0x590b('0x30')](_0x5d7aed[_0x590b('0x2c')],_0x5d7aed[_0x590b('0x2e')]);_0x5cf908['attributes']=_[_0x590b('0x30')](_0x5d7aed[_0x590b('0x2c')],qs['fields'](_0x58d88d[_0x590b('0x2e')][_0x590b('0x31')]));_0x5cf908[_0x590b('0x32')]=_0x5cf908[_0x590b('0x32')][_0x590b('0x46')]?_0x5cf908[_0x590b('0x32')]:_0x5d7aed[_0x590b('0x2c')];_0x5cf908['order']=qs[_0x590b('0x36')](_0x58d88d[_0x590b('0x2e')][_0x590b('0x36')]);_0x5cf908[_0x590b('0x38')]=qs[_0x590b('0x2f')](_[_0x590b('0x37')](_0x58d88d[_0x590b('0x2e')],_0x5d7aed[_0x590b('0x2f')]));if(_0x58d88d['query']['filter']){_0x5cf908[_0x590b('0x38')]=_[_0x590b('0x39')](_0x5cf908[_0x590b('0x38')],{'$or':_[_0x590b('0x55')](_0x5cf908['attributes'],function(_0xec303e){var _0x2ec3ad={};_0x2ec3ad[_0xec303e]={'$like':'%'+_0x58d88d[_0x590b('0x2e')]['filter']+'%'};return _0x2ec3ad;})});}_0x5cf908=_['merge']({},_0x5cf908,_0x58d88d[_0x590b('0x3e')]);return _0x1bb2d0[_0x590b('0x85')](_0x5cf908);}})['then'](function(_0xc92d0){if(_0xc92d0){_0x5b1497=_0xc92d0[_0x590b('0x46')];if(!_0x58d88d[_0x590b('0x2e')][_0x590b('0x33')](_0x590b('0x34'))){_0x5cf908['limit']=qs[_0x590b('0x20')](_0x58d88d['query']['limit']);_0x5cf908[_0x590b('0x1f')]=qs[_0x590b('0x1f')](_0x58d88d[_0x590b('0x2e')]['offset']);}return _0x1bb2d0[_0x590b('0x85')](_0x5cf908);}})[_0x590b('0x24')](function(_0x1ba2c3){if(_0x1ba2c3){return _0x1ba2c3?{'count':_0x5b1497,'rows':_0x1ba2c3}:null;}})[_0x590b('0x24')](respondWithResult(_0x5c0878,null))['catch'](handleError(_0x5c0878,null));}; \ No newline at end of file +var _0xd8b1=['moment','bluebird','util','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','index','MailQueue','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','body','params','describe','getMembers','findOne','UserMailQueue','MailQueueId','map','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','Agents','select','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','all','compact','value','transaction','addAgents','omit','removeAgents','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x9fb4ee,_0x7b5cf0){var _0x242dcd=function(_0x322677){while(--_0x322677){_0x9fb4ee['push'](_0x9fb4ee['shift']());}};_0x242dcd(++_0x7b5cf0);}(_0xd8b1,0x105));var _0x1d8b=function(_0x28dca3,_0x2aa605){_0x28dca3=_0x28dca3-0x0;var _0x13236e=_0xd8b1[_0x28dca3];return _0x13236e;};'use strict';var pdf=require(_0x1d8b('0x0'));var emlformat=require(_0x1d8b('0x1'));var rimraf=require(_0x1d8b('0x2'));var zipdir=require(_0x1d8b('0x3'));var jsonpatch=require(_0x1d8b('0x4'));var rp=require('request-promise');var moment=require(_0x1d8b('0x5'));var BPromise=require(_0x1d8b('0x6'));var Mustache=require('mustache');var util=require(_0x1d8b('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1d8b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1d8b('0x9'));var crypto=require(_0x1d8b('0xa'));var jsforce=require(_0x1d8b('0xb'));var deskjs=require(_0x1d8b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1d8b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1d8b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d8b('0xf'))('api');var utils=require(_0x1d8b('0x10'));var config=require(_0x1d8b('0x11'));var db=require(_0x1d8b('0x12'))['db'];config[_0x1d8b('0x13')]=_[_0x1d8b('0x14')](config[_0x1d8b('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x1d8b('0x15'))(new Redis(config[_0x1d8b('0x13')]));require(_0x1d8b('0x16'))[_0x1d8b('0x17')](socket);function respondWithStatusCode(_0x4486a8,_0x3a23d0){_0x3a23d0=_0x3a23d0||0xcc;return function(_0x46bd8c){if(_0x46bd8c){return _0x4486a8[_0x1d8b('0x18')](_0x3a23d0);}return _0x4486a8['status'](_0x3a23d0)[_0x1d8b('0x19')]();};}function respondWithResult(_0x3d54d3,_0x3f31a4){_0x3f31a4=_0x3f31a4||0xc8;return function(_0x44ebbe){if(_0x44ebbe){return _0x3d54d3[_0x1d8b('0x1a')](_0x3f31a4)[_0x1d8b('0x1b')](_0x44ebbe);}};}function respondWithFilteredResult(_0x144556,_0x52f6bf){return function(_0x5aeef3){if(_0x5aeef3){var _0x3380d6=_0x5aeef3[_0x1d8b('0x1c')],_0x100a9b=_0x52f6bf['offset'],_0x3710b2=_0x52f6bf[_0x1d8b('0x1d')]+_0x52f6bf[_0x1d8b('0x1e')],_0x1b6440;if(_0x3710b2>=_0x3380d6){_0x3710b2=_0x3380d6;_0x1b6440=0xc8;}else{_0x1b6440=0xce;}_0x144556['status'](_0x1b6440);return _0x144556[_0x1d8b('0x1f')](_0x1d8b('0x20'),_0x100a9b+'-'+_0x3710b2+'/'+_0x3380d6)[_0x1d8b('0x1b')](_0x5aeef3);}return null;};}function patchUpdates(_0x4f3342){return function(_0x2274c5){try{jsonpatch[_0x1d8b('0x21')](_0x2274c5,_0x4f3342,!![]);}catch(_0x3cdf3b){return BPromise[_0x1d8b('0x22')](_0x3cdf3b);}return _0x2274c5[_0x1d8b('0x23')]();};}function saveUpdates(_0x130c00,_0x3c2c78){return function(_0x4d5ea8){if(_0x4d5ea8){return _0x4d5ea8[_0x1d8b('0x24')](_0x130c00)[_0x1d8b('0x25')](function(_0x3d8fcb){return _0x3d8fcb;});}return null;};}function removeEntity(_0x308b89,_0x5235b6){return function(_0x5bee29){if(_0x5bee29){return _0x5bee29[_0x1d8b('0x26')]()[_0x1d8b('0x25')](function(){var _0x49cc58=_0x5bee29[_0x1d8b('0x27')]({'plain':!![]});var _0x461405='MailQueues';return db['UserProfileResource'][_0x1d8b('0x26')]({'where':{'type':_0x461405,'resourceId':_0x49cc58['id']}})[_0x1d8b('0x25')](function(){return _0x5bee29;});})[_0x1d8b('0x25')](function(){_0x308b89[_0x1d8b('0x1a')](0xcc)[_0x1d8b('0x19')]();});}};}function handleEntityNotFound(_0x2e6249,_0x1d525f){return function(_0x59d3bf){if(!_0x59d3bf){_0x2e6249[_0x1d8b('0x18')](0x194);}return _0x59d3bf;};}function handleError(_0x4e03da,_0x4b3a64){_0x4b3a64=_0x4b3a64||0x1f4;return function(_0x4ccfa9){logger[_0x1d8b('0x28')](_0x4ccfa9[_0x1d8b('0x29')]);if(_0x4ccfa9[_0x1d8b('0x2a')]){delete _0x4ccfa9[_0x1d8b('0x2a')];}_0x4e03da['status'](_0x4b3a64)['send'](_0x4ccfa9);};}exports[_0x1d8b('0x2b')]=function(_0x2f754d,_0x35efca){var _0xb8a9d={},_0x2305d8={},_0x38a747={'count':0x0,'rows':[]};var _0x505435=db[_0x1d8b('0x2c')][_0x1d8b('0x2d')];_0x2305d8[_0x1d8b('0x2e')]=_[_0x1d8b('0x2f')](_0x505435);_0x2305d8[_0x1d8b('0x30')]=_[_0x1d8b('0x2f')](_0x2f754d[_0x1d8b('0x30')]);_0x2305d8[_0x1d8b('0x31')]=_[_0x1d8b('0x32')](_0x2305d8['model'],_0x2305d8[_0x1d8b('0x30')]);_0xb8a9d['attributes']=_['intersection'](_0x2305d8['model'],qs[_0x1d8b('0x33')](_0x2f754d[_0x1d8b('0x30')][_0x1d8b('0x33')]));_0xb8a9d[_0x1d8b('0x34')]=_0xb8a9d[_0x1d8b('0x34')]['length']?_0xb8a9d[_0x1d8b('0x34')]:_0x2305d8[_0x1d8b('0x2e')];if(!_0x2f754d[_0x1d8b('0x30')][_0x1d8b('0x35')](_0x1d8b('0x36'))){_0xb8a9d[_0x1d8b('0x1e')]=qs[_0x1d8b('0x1e')](_0x2f754d[_0x1d8b('0x30')]['limit']);_0xb8a9d[_0x1d8b('0x1d')]=qs['offset'](_0x2f754d[_0x1d8b('0x30')]['offset']);}_0xb8a9d[_0x1d8b('0x37')]=qs[_0x1d8b('0x38')](_0x2f754d[_0x1d8b('0x30')]['sort']);_0xb8a9d[_0x1d8b('0x39')]=qs[_0x1d8b('0x31')](_[_0x1d8b('0x3a')](_0x2f754d[_0x1d8b('0x30')],_0x2305d8['filters']));if(_0x2f754d[_0x1d8b('0x30')][_0x1d8b('0x3b')]){_0xb8a9d['where']=_[_0x1d8b('0x3c')](_0xb8a9d['where'],{'$or':_['map'](_0x505435,function(_0x59b7ee){if(_0x59b7ee[_0x1d8b('0x3d')][_0x1d8b('0x3e')]!==_0x1d8b('0x3f')){var _0x2fce1d={};_0x2fce1d[_0x59b7ee[_0x1d8b('0x40')]]={'$like':'%'+_0x2f754d[_0x1d8b('0x30')][_0x1d8b('0x3b')]+'%'};return _0x2fce1d;}})});}_0xb8a9d=_['merge']({},_0xb8a9d,_0x2f754d[_0x1d8b('0x41')]);var _0x5ef77f={'where':_0xb8a9d[_0x1d8b('0x39')]};return db['MailQueue'][_0x1d8b('0x1c')](_0x5ef77f)[_0x1d8b('0x25')](function(_0x474a57){_0x38a747[_0x1d8b('0x1c')]=_0x474a57;if(_0x2f754d[_0x1d8b('0x30')][_0x1d8b('0x42')]){_0xb8a9d[_0x1d8b('0x43')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0xb8a9d);})[_0x1d8b('0x25')](function(_0x384c18){_0x38a747[_0x1d8b('0x44')]=_0x384c18;return _0x38a747;})[_0x1d8b('0x25')](respondWithFilteredResult(_0x35efca,_0xb8a9d))[_0x1d8b('0x45')](handleError(_0x35efca,null));};exports['show']=function(_0x280775,_0x206223){var _0x4d7249={'raw':!![],'where':{'id':_0x280775['params']['id']}},_0x5c0af0={};_0x5c0af0[_0x1d8b('0x2e')]=_['keys'](db[_0x1d8b('0x2c')][_0x1d8b('0x2d')]);_0x5c0af0['query']=_[_0x1d8b('0x2f')](_0x280775[_0x1d8b('0x30')]);_0x5c0af0[_0x1d8b('0x31')]=_[_0x1d8b('0x32')](_0x5c0af0[_0x1d8b('0x2e')],_0x5c0af0['query']);_0x4d7249['attributes']=_[_0x1d8b('0x32')](_0x5c0af0[_0x1d8b('0x2e')],qs[_0x1d8b('0x33')](_0x280775['query'][_0x1d8b('0x33')]));_0x4d7249[_0x1d8b('0x34')]=_0x4d7249[_0x1d8b('0x34')][_0x1d8b('0x46')]?_0x4d7249[_0x1d8b('0x34')]:_0x5c0af0[_0x1d8b('0x2e')];if(_0x280775[_0x1d8b('0x30')][_0x1d8b('0x42')]){_0x4d7249['include']=[{'all':!![]}];}_0x4d7249=_[_0x1d8b('0x3c')]({},_0x4d7249,_0x280775[_0x1d8b('0x41')]);return db[_0x1d8b('0x2c')][_0x1d8b('0x47')](_0x4d7249)[_0x1d8b('0x25')](handleEntityNotFound(_0x206223,null))[_0x1d8b('0x25')](respondWithResult(_0x206223,null))[_0x1d8b('0x45')](handleError(_0x206223,null));};exports[_0x1d8b('0x48')]=function(_0x57d494,_0x92e4ec){return db[_0x1d8b('0x2c')]['create'](_0x57d494['body'],{})[_0x1d8b('0x25')](function(_0x51584d){var _0x36635f=_0x57d494[_0x1d8b('0x49')][_0x1d8b('0x27')]({'plain':!![]});if(!_0x36635f)throw new Error(_0x1d8b('0x4a'));if(_0x36635f[_0x1d8b('0x4b')]===_0x1d8b('0x49')){var _0x644520=_0x51584d[_0x1d8b('0x27')]({'plain':!![]});var _0x280c02=_0x1d8b('0x4c');return db[_0x1d8b('0x4d')][_0x1d8b('0x47')]({'where':{'name':_0x280c02,'userProfileId':_0x36635f[_0x1d8b('0x4e')]},'raw':!![]})[_0x1d8b('0x25')](function(_0x256ce8){if(_0x256ce8&&_0x256ce8[_0x1d8b('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x644520[_0x1d8b('0x2a')],'resourceId':_0x644520['id'],'type':_0x256ce8[_0x1d8b('0x2a')],'sectionId':_0x256ce8['id']},{})['then'](function(){return _0x51584d;});}else{return _0x51584d;}})[_0x1d8b('0x45')](function(_0x5a7e1c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a7e1c);throw _0x5a7e1c;});}return _0x51584d;})[_0x1d8b('0x25')](respondWithResult(_0x92e4ec,0xc9))[_0x1d8b('0x45')](handleError(_0x92e4ec,null));};exports[_0x1d8b('0x24')]=function(_0x2e7b40,_0x5b2893){if(_0x2e7b40[_0x1d8b('0x50')]['id']){delete _0x2e7b40[_0x1d8b('0x50')]['id'];}return db[_0x1d8b('0x2c')][_0x1d8b('0x47')]({'where':{'id':_0x2e7b40[_0x1d8b('0x51')]['id']}})['then'](handleEntityNotFound(_0x5b2893,null))[_0x1d8b('0x25')](saveUpdates(_0x2e7b40[_0x1d8b('0x50')],null))[_0x1d8b('0x25')](respondWithResult(_0x5b2893,null))['catch'](handleError(_0x5b2893,null));};exports[_0x1d8b('0x26')]=function(_0x191a37,_0x1ed7ae){return db['MailQueue'][_0x1d8b('0x47')]({'where':{'id':_0x191a37[_0x1d8b('0x51')]['id']}})['then'](handleEntityNotFound(_0x1ed7ae,null))['then'](removeEntity(_0x1ed7ae,null))[_0x1d8b('0x45')](handleError(_0x1ed7ae,null));};exports[_0x1d8b('0x52')]=function(_0x3e7e67,_0x45f76e){return db[_0x1d8b('0x2c')][_0x1d8b('0x52')]()[_0x1d8b('0x25')](respondWithResult(_0x45f76e,null))[_0x1d8b('0x45')](handleError(_0x45f76e,null));};exports[_0x1d8b('0x53')]=function(_0x1bb91c,_0x461ace,_0x4aa70a){var _0x16fe7a={'raw':!![],'where':{}},_0x295b1f={},_0x58b0ae;return db[_0x1d8b('0x2c')][_0x1d8b('0x54')]({'where':{'id':_0x1bb91c[_0x1d8b('0x51')]['id']}})['then'](handleEntityNotFound(_0x461ace,null))['then'](function(_0x3919bd){if(_0x3919bd){_0x58b0ae=_0x3919bd[_0x1d8b('0x27')]({'plain':!![]});_0x295b1f['model']=_[_0x1d8b('0x2f')](db[_0x1d8b('0x55')]['rawAttributes']);_0x295b1f[_0x1d8b('0x30')]=_[_0x1d8b('0x2f')](_0x1bb91c['query']);_0x295b1f[_0x1d8b('0x31')]=_[_0x1d8b('0x32')](_0x295b1f[_0x1d8b('0x2e')],_0x295b1f[_0x1d8b('0x30')]);_0x16fe7a[_0x1d8b('0x34')]=_[_0x1d8b('0x32')](_0x295b1f['model'],qs[_0x1d8b('0x33')](_0x1bb91c[_0x1d8b('0x30')]['fields']));_0x16fe7a[_0x1d8b('0x34')]=_0x16fe7a[_0x1d8b('0x34')][_0x1d8b('0x46')]?_0x16fe7a[_0x1d8b('0x34')]:_0x295b1f[_0x1d8b('0x2e')];if(!_0x1bb91c['query'][_0x1d8b('0x35')](_0x1d8b('0x36'))){_0x16fe7a[_0x1d8b('0x1e')]=qs[_0x1d8b('0x1e')](_0x1bb91c['query']['limit']);_0x16fe7a[_0x1d8b('0x1d')]=qs[_0x1d8b('0x1d')](_0x1bb91c[_0x1d8b('0x30')]['offset']);}_0x16fe7a['order']=qs['sort'](_0x1bb91c[_0x1d8b('0x30')][_0x1d8b('0x38')]);_0x16fe7a['where']=qs[_0x1d8b('0x31')](_['pick'](_0x1bb91c[_0x1d8b('0x30')],_0x295b1f[_0x1d8b('0x31')]));_0x16fe7a[_0x1d8b('0x39')][_0x1d8b('0x56')]=_0x3919bd['id'];if(_0x1bb91c[_0x1d8b('0x30')][_0x1d8b('0x3b')]){_0x16fe7a[_0x1d8b('0x39')]=_[_0x1d8b('0x3c')](_0x16fe7a[_0x1d8b('0x39')],{'$or':_[_0x1d8b('0x57')](_0x16fe7a[_0x1d8b('0x34')],function(_0x4895c6){var _0x12f6d6={};_0x12f6d6[_0x4895c6]={'$like':'%'+_0x1bb91c[_0x1d8b('0x30')][_0x1d8b('0x3b')]+'%'};return _0x12f6d6;})});}_0x16fe7a=_[_0x1d8b('0x3c')]({},_0x16fe7a,_0x1bb91c[_0x1d8b('0x41')]);return db[_0x1d8b('0x55')][_0x1d8b('0x58')](_0x16fe7a);}})[_0x1d8b('0x25')](function(_0x1d119c){if(_0x1d119c){return db[_0x1d8b('0x59')][_0x1d8b('0x5a')]({'where':{'id':_[_0x1d8b('0x57')](_0x1d119c,_0x1d8b('0x5b')),'role':_0x1d8b('0x5c')},'attributes':['id',_0x1d8b('0x2a'),_0x1d8b('0x5d'),_0x1d8b('0x5e'),_0x1d8b('0x5f')]});}})[_0x1d8b('0x25')](function(_0x221308){if(_0x221308){return{'count':_0x221308[_0x1d8b('0x1c')],'rows':_[_0x1d8b('0x57')](_0x221308[_0x1d8b('0x44')],function(_0x4fd733){return{'membername':_0x4fd733[_0x1d8b('0x2a')],'UserId':_0x4fd733['id'],'queue_name':_0x58b0ae[_0x1d8b('0x2a')],'MailQueueId':_0x58b0ae['id'],'interface':util['format'](_0x1d8b('0x60'),_0x1d8b('0x61'),_0x4fd733['name']),'penalty':0x0,'paused':_0x4fd733[_0x1d8b('0x5d')],'createdAt':_0x4fd733[_0x1d8b('0x5f')],'updatedAt':_0x4fd733[_0x1d8b('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1d8b('0x25')](respondWithFilteredResult(_0x461ace,_0x16fe7a))['catch'](handleError(_0x461ace,null));};exports[_0x1d8b('0x62')]=function(_0x5e2cc4,_0x1d0e4e,_0x388f78){var _0xa324a2={};var _0x1d6c61={};var _0x4204eb;var _0x570118;return db['MailQueue']['findOne']({'where':{'id':_0x5e2cc4[_0x1d8b('0x51')]['id']}})[_0x1d8b('0x25')](handleEntityNotFound(_0x1d0e4e,null))[_0x1d8b('0x25')](function(_0x12814d){if(_0x12814d){_0x4204eb=_0x12814d;_0x1d6c61[_0x1d8b('0x2e')]=_[_0x1d8b('0x2f')](db[_0x1d8b('0x63')]['rawAttributes']);_0x1d6c61[_0x1d8b('0x30')]=_[_0x1d8b('0x2f')](_0x5e2cc4['query']);_0x1d6c61[_0x1d8b('0x31')]=_[_0x1d8b('0x32')](_0x1d6c61[_0x1d8b('0x2e')],_0x1d6c61['query']);_0xa324a2[_0x1d8b('0x34')]=_[_0x1d8b('0x32')](_0x1d6c61['model'],qs[_0x1d8b('0x33')](_0x5e2cc4[_0x1d8b('0x30')][_0x1d8b('0x33')]));_0xa324a2['attributes']=_0xa324a2[_0x1d8b('0x34')][_0x1d8b('0x46')]?_0xa324a2[_0x1d8b('0x34')]:_0x1d6c61[_0x1d8b('0x2e')];_0xa324a2[_0x1d8b('0x37')]=qs[_0x1d8b('0x38')](_0x5e2cc4[_0x1d8b('0x30')][_0x1d8b('0x38')]);_0xa324a2[_0x1d8b('0x39')]=qs['filters'](_[_0x1d8b('0x3a')](_0x5e2cc4['query'],_0x1d6c61[_0x1d8b('0x31')]));if(_0x5e2cc4[_0x1d8b('0x30')][_0x1d8b('0x3b')]){_0xa324a2['where']=_['merge'](_0xa324a2[_0x1d8b('0x39')],{'$or':_['map'](_0xa324a2[_0x1d8b('0x34')],function(_0x3cd144){var _0x6f5c0d={};_0x6f5c0d[_0x3cd144]={'$like':'%'+_0x5e2cc4[_0x1d8b('0x30')][_0x1d8b('0x3b')]+'%'};return _0x6f5c0d;})});}_0xa324a2=_[_0x1d8b('0x3c')]({},_0xa324a2,_0x5e2cc4[_0x1d8b('0x41')]);return _0x4204eb['getTeams'](_0xa324a2);}})['then'](function(_0x383fe3){if(_0x383fe3){_0x570118=_0x383fe3[_0x1d8b('0x46')];if(!_0x5e2cc4['query'][_0x1d8b('0x35')](_0x1d8b('0x36'))){_0xa324a2['limit']=qs[_0x1d8b('0x1e')](_0x5e2cc4[_0x1d8b('0x30')][_0x1d8b('0x1e')]);_0xa324a2[_0x1d8b('0x1d')]=qs[_0x1d8b('0x1d')](_0x5e2cc4[_0x1d8b('0x30')][_0x1d8b('0x1d')]);}return _0x4204eb[_0x1d8b('0x62')](_0xa324a2);}})[_0x1d8b('0x25')](function(_0x3e2f6f){if(_0x3e2f6f){return _0x3e2f6f?{'count':_0x570118,'rows':_0x3e2f6f}:null;}})[_0x1d8b('0x25')](respondWithResult(_0x1d0e4e,null))[_0x1d8b('0x45')](handleError(_0x1d0e4e,null));};exports[_0x1d8b('0x64')]=function(_0x57f4ef,_0x3060ff,_0x519788){var _0x4f1275=_0x57f4ef[_0x1d8b('0x50')]['teams'];return db['Team'][_0x1d8b('0x58')]({'where':{'id':_[_0x1d8b('0x57')](_0x4f1275,'id')},'attributes':['id'],'include':[{'model':db[_0x1d8b('0x59')],'as':'Agents','attributes':['id',_0x1d8b('0x2a'),_0x1d8b('0x65'),_0x1d8b('0x66'),_0x1d8b('0x67')],'raw':!![]}]})[_0x1d8b('0x25')](function(_0x126f5a){if(_0x126f5a){var _0xef3943=_[_0x1d8b('0x68')](_0x126f5a,function(_0x484e5d){var _0x367d2f=_0x484e5d['get']({'plain':!![]});return _0x367d2f['Agents'];});return db[_0x1d8b('0x2c')][_0x1d8b('0x47')]({'where':{'id':_0x57f4ef[_0x1d8b('0x51')]['id']}})['then'](function(_0x44c0bf){return db[_0x1d8b('0x69')]['transaction'](function(_0x50a368){return _0x44c0bf[_0x1d8b('0x64')](_[_0x1d8b('0x57')](_0x4f1275,'id'),{'transaction':_0x50a368})['then'](function(){return BPromise[_0x1d8b('0x6a')](_0xef3943,function(_0x26c732){return db[_0x1d8b('0x55')][_0x1d8b('0x6b')]({'where':{'UserId':_0x26c732['id'],'MailQueueId':_0x57f4ef[_0x1d8b('0x51')]['id']},'transaction':_0x50a368});});})[_0x1d8b('0x25')](function(){_0xef3943[_0x1d8b('0x6c')](function(_0x959365){socket[_0x1d8b('0x6d')](_0x1d8b('0x6e'),{'UserId':_0x959365['id'],'MailQueueId':_0x44c0bf['id']});});});});});}})[_0x1d8b('0x25')](respondWithStatusCode(_0x3060ff,null))[_0x1d8b('0x45')](handleError(_0x3060ff,null));};exports[_0x1d8b('0x6f')]=function(_0x419811,_0x2bfc2d,_0x4f0f73){return db[_0x1d8b('0x63')][_0x1d8b('0x58')]({'where':{'id':_0x419811['query'][_0x1d8b('0x70')]},'attributes':['id'],'include':[{'model':db[_0x1d8b('0x59')],'as':_0x1d8b('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2bfc2d,null))[_0x1d8b('0x25')](function(_0x473f61){var _0x1a019a=_[_0x1d8b('0x57')](_0x473f61,'id');var _0x4b25f8=[];var _0x1f7d75=[];var _0x444002=squel[_0x1d8b('0x72')]();_0x444002['field']('tq.TeamId')[_0x1d8b('0x73')](_0x1d8b('0x74'),'tq')[_0x1d8b('0x75')]('user_has_teams','ut',_0x1d8b('0x76'))['where'](_0x1d8b('0x77'),_0x419811['params']['id']);for(var _0x43e398=0x0;_0x43e398<_0x473f61[_0x1d8b('0x46')];_0x43e398+=0x1){let _0xb0706b=_0x473f61[_0x43e398];for(var _0x393c93=0x0;_0x393c93<_0xb0706b[_0x1d8b('0x71')]['length'];_0x393c93+=0x1){let _0x4a4f3d=_0xb0706b['Agents'][_0x393c93];var _0x45a608=_0x444002[_0x1d8b('0x78')]();_0x45a608[_0x1d8b('0x39')](_0x1d8b('0x79'),_0x4a4f3d['id']);_0x1f7d75['push'](db[_0x1d8b('0x69')][_0x1d8b('0x30')](_0x45a608[_0x1d8b('0x7a')](),{'type':db[_0x1d8b('0x69')]['QueryTypes'][_0x1d8b('0x7b')]})[_0x1d8b('0x25')](function(_0x22cb04){if(_0x22cb04[_0x1d8b('0x46')]===0x1){return _0x4a4f3d['id'];}else{var _0x56b1c5=_[_0x1d8b('0x7c')](_['map'](_0x22cb04,'TeamId'),function(_0x5bd309){return _['includes'](_0x1a019a,_0x5bd309);});if(_0x56b1c5){return _0x4a4f3d['id'];}}}));}}return BPromise[_0x1d8b('0x7d')](_0x1f7d75)[_0x1d8b('0x25')](function(_0x414e8e){_0x4b25f8=_(_0x4b25f8)['union'](_0x414e8e)[_0x1d8b('0x7e')]()[_0x1d8b('0x7f')]();return db[_0x1d8b('0x2c')][_0x1d8b('0x47')]({'where':{'id':_0x419811[_0x1d8b('0x51')]['id']}})[_0x1d8b('0x25')](function(_0x413b7d){return db[_0x1d8b('0x69')][_0x1d8b('0x80')](function(_0x6a3f64){return _0x413b7d['removeTeams'](_0x419811['query'][_0x1d8b('0x70')],{'transaction':_0x6a3f64})[_0x1d8b('0x25')](function(){if(!_['isEmpty'](_0x4b25f8)){return _0x413b7d['removeAgents'](_0x4b25f8,{'transaction':_0x6a3f64});}})[_0x1d8b('0x25')](function(){_0x4b25f8['forEach'](function(_0x1e3920){socket['emit']('userMailQueue:remove',{'UserId':_0x1e3920,'MailQueueId':_0x413b7d['id']});});});});});});})['then'](respondWithStatusCode(_0x2bfc2d,null))['catch'](handleError(_0x2bfc2d,null));};exports[_0x1d8b('0x81')]=function(_0x58a0e0,_0x53d726,_0x18f292){return db[_0x1d8b('0x2c')]['find']({'where':{'id':_0x58a0e0[_0x1d8b('0x51')]['id']}})[_0x1d8b('0x25')](handleEntityNotFound(_0x53d726,null))[_0x1d8b('0x25')](function(_0xe420e7){if(_0xe420e7){return _0xe420e7[_0x1d8b('0x81')](_0x58a0e0[_0x1d8b('0x50')][_0x1d8b('0x70')],_[_0x1d8b('0x82')](_0x58a0e0[_0x1d8b('0x50')],[_0x1d8b('0x70'),'id'])||{})['spread'](function(_0x5d4cf1){for(var _0x81dc85=0x0;_0x81dc85<_0x58a0e0[_0x1d8b('0x50')][_0x1d8b('0x70')][_0x1d8b('0x46')];_0x81dc85+=0x1){socket[_0x1d8b('0x6d')]('userMailQueue:save',{'UserId':_0x58a0e0[_0x1d8b('0x50')][_0x1d8b('0x70')][_0x81dc85],'MailQueueId':_0x58a0e0['params']['id']});}return _0x5d4cf1;});}})[_0x1d8b('0x25')](respondWithResult(_0x53d726,null))[_0x1d8b('0x45')](handleError(_0x53d726,null));};exports['removeAgents']=function(_0x3c194f,_0x5a4452,_0x10b0fc){return db[_0x1d8b('0x2c')][_0x1d8b('0x47')]({'where':{'id':_0x3c194f[_0x1d8b('0x51')]['id']}})['then'](handleEntityNotFound(_0x5a4452,null))[_0x1d8b('0x25')](function(_0x35a1c5){if(_0x35a1c5){return _0x35a1c5[_0x1d8b('0x83')](_0x3c194f[_0x1d8b('0x30')][_0x1d8b('0x70')])[_0x1d8b('0x25')](function(){if(_['isArray'](_0x3c194f['query'][_0x1d8b('0x70')])){for(var _0x35ef66=0x0;_0x35ef66<_0x3c194f['query'][_0x1d8b('0x70')][_0x1d8b('0x46')];_0x35ef66+=0x1){socket[_0x1d8b('0x6d')]('userMailQueue:remove',{'UserId':Number(_0x3c194f[_0x1d8b('0x30')][_0x1d8b('0x70')][_0x35ef66]),'MailQueueId':Number(_0x3c194f[_0x1d8b('0x51')]['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x3c194f[_0x1d8b('0x30')][_0x1d8b('0x70')]),'MailQueueId':Number(_0x3c194f['params']['id'])});}});}})[_0x1d8b('0x25')](respondWithStatusCode(_0x5a4452,null))[_0x1d8b('0x45')](handleError(_0x5a4452,null));};exports[_0x1d8b('0x84')]=function(_0x3a7187,_0x5db800,_0x40aea2){var _0x5765aa={};var _0x211575={};var _0x35925e;var _0x1209cf;return db['MailQueue']['findOne']({'where':{'id':_0x3a7187[_0x1d8b('0x51')]['id']}})['then'](handleEntityNotFound(_0x5db800,null))['then'](function(_0x10ff18){if(_0x10ff18){_0x35925e=_0x10ff18;_0x211575['model']=_[_0x1d8b('0x2f')](db[_0x1d8b('0x59')]['rawAttributes']);_0x211575[_0x1d8b('0x30')]=_['keys'](_0x3a7187['query']);_0x211575['filters']=_[_0x1d8b('0x32')](_0x211575['model'],_0x211575['query']);_0x5765aa[_0x1d8b('0x34')]=_[_0x1d8b('0x32')](_0x211575[_0x1d8b('0x2e')],qs[_0x1d8b('0x33')](_0x3a7187['query'][_0x1d8b('0x33')]));_0x5765aa[_0x1d8b('0x34')]=_0x5765aa[_0x1d8b('0x34')]['length']?_0x5765aa[_0x1d8b('0x34')]:_0x211575[_0x1d8b('0x2e')];_0x5765aa[_0x1d8b('0x37')]=qs[_0x1d8b('0x38')](_0x3a7187[_0x1d8b('0x30')][_0x1d8b('0x38')]);_0x5765aa[_0x1d8b('0x39')]=qs[_0x1d8b('0x31')](_['pick'](_0x3a7187[_0x1d8b('0x30')],_0x211575[_0x1d8b('0x31')]));if(_0x3a7187['query'][_0x1d8b('0x3b')]){_0x5765aa[_0x1d8b('0x39')]=_[_0x1d8b('0x3c')](_0x5765aa[_0x1d8b('0x39')],{'$or':_['map'](_0x5765aa[_0x1d8b('0x34')],function(_0x48c156){var _0x2d0c56={};_0x2d0c56[_0x48c156]={'$like':'%'+_0x3a7187[_0x1d8b('0x30')][_0x1d8b('0x3b')]+'%'};return _0x2d0c56;})});}_0x5765aa=_[_0x1d8b('0x3c')]({},_0x5765aa,_0x3a7187[_0x1d8b('0x41')]);return _0x35925e[_0x1d8b('0x84')](_0x5765aa);}})[_0x1d8b('0x25')](function(_0x5c2e6c){if(_0x5c2e6c){_0x1209cf=_0x5c2e6c['length'];if(!_0x3a7187[_0x1d8b('0x30')][_0x1d8b('0x35')]('nolimit')){_0x5765aa[_0x1d8b('0x1e')]=qs[_0x1d8b('0x1e')](_0x3a7187['query'][_0x1d8b('0x1e')]);_0x5765aa[_0x1d8b('0x1d')]=qs[_0x1d8b('0x1d')](_0x3a7187['query'][_0x1d8b('0x1d')]);}return _0x35925e[_0x1d8b('0x84')](_0x5765aa);}})[_0x1d8b('0x25')](function(_0x438d6e){if(_0x438d6e){return _0x438d6e?{'count':_0x1209cf,'rows':_0x438d6e}:null;}})['then'](respondWithResult(_0x5db800,null))[_0x1d8b('0x45')](handleError(_0x5db800,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index b88aedf..47b1770 100644 --- a/server/api/mailQueue/mailQueue.events.js +++ b/server/api/mailQueue/mailQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3296=['hook','events','MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x2d0b2b,_0x3b2821){var _0x5b31ed=function(_0x55877f){while(--_0x55877f){_0x2d0b2b['push'](_0x2d0b2b['shift']());}};_0x5b31ed(++_0x3b2821);}(_0x3296,0x191));var _0x6329=function(_0x4a5356,_0x20f134){_0x4a5356=_0x4a5356-0x0;var _0x4beb93=_0x3296[_0x4a5356];return _0x4beb93;};'use strict';var EventEmitter=require(_0x6329('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x6329('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6329('0x2')](0x0);var events={'afterCreate':_0x6329('0x3'),'afterUpdate':'update','afterDestroy':_0x6329('0x4')};function emitEvent(_0x5caa66){return function(_0x16133c,_0x49f8bf,_0xf7cdd3){MailQueueEvents[_0x6329('0x5')](_0x5caa66+':'+_0x16133c['id'],_0x16133c);MailQueueEvents['emit'](_0x5caa66,_0x16133c);_0xf7cdd3(null);};}for(var e in events){if(events[_0x6329('0x6')](e)){var event=events[e];MailQueue[_0x6329('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x3b39=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','MailQueue'];(function(_0x76262,_0x31ba9e){var _0x2f0900=function(_0x1758b8){while(--_0x1758b8){_0x76262['push'](_0x76262['shift']());}};_0x2f0900(++_0x31ba9e);}(_0x3b39,0x167));var _0x93b3=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0x3b39[_0x3bf925];return _0x2128a1;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0x93b3('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x93b3('0x1')](0x0);var events={'afterCreate':_0x93b3('0x2'),'afterUpdate':_0x93b3('0x3'),'afterDestroy':_0x93b3('0x4')};function emitEvent(_0x30297c){return function(_0x35e66c,_0x25dccc,_0x2c7623){MailQueueEvents[_0x93b3('0x5')](_0x30297c+':'+_0x35e66c['id'],_0x35e66c);MailQueueEvents[_0x93b3('0x5')](_0x30297c,_0x35e66c);_0x2c7623(null);};}for(var e in events){if(events[_0x93b3('0x6')](e)){var event=events[e];MailQueue[_0x93b3('0x7')](e,emitEvent(event));}}module[_0x93b3('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index ca32daa..ed3a344 100644 --- a/server/api/mailQueue/mailQueue.model.js +++ b/server/api/mailQueue/mailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6187=['exports','mail_queues','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x1e9bae,_0x5dae36){var _0x923834=function(_0xfd1408){while(--_0xfd1408){_0x1e9bae['push'](_0x1e9bae['shift']());}};_0x923834(++_0x5dae36);}(_0x6187,0x174));var _0x7618=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x6187[_0x1ae5ab];return _0x1ce001;};'use strict';var _=require('lodash');var util=require(_0x7618('0x0'));var logger=require(_0x7618('0x1'))('api');var moment=require(_0x7618('0x2'));var BPromise=require(_0x7618('0x3'));var rp=require(_0x7618('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7618('0x5'));var config=require(_0x7618('0x6'));var attributes=require(_0x7618('0x7'));module[_0x7618('0x8')]=function(_0x4cf318,_0x155249){return _0x4cf318['define']('MailQueue',attributes,{'tableName':_0x7618('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3386=['define','MailQueue','mail_queues','lodash','util','api','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports'];(function(_0x59c5b7,_0x4fb175){var _0x1a79ff=function(_0x419869){while(--_0x419869){_0x59c5b7['push'](_0x59c5b7['shift']());}};_0x1a79ff(++_0x4fb175);}(_0x3386,0x1ef));var _0x6338=function(_0x4af42d,_0x226c6d){_0x4af42d=_0x4af42d-0x0;var _0x14b54f=_0x3386[_0x4af42d];return _0x14b54f;};'use strict';var _=require(_0x6338('0x0'));var util=require(_0x6338('0x1'));var logger=require('../../config/logger')(_0x6338('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6338('0x3'));var fs=require('fs');var path=require(_0x6338('0x4'));var rimraf=require(_0x6338('0x5'));var config=require(_0x6338('0x6'));var attributes=require(_0x6338('0x7'));module[_0x6338('0x8')]=function(_0x43dcaf,_0x5d0805){return _0x43dcaf[_0x6338('0x9')](_0x6338('0xa'),attributes,{'tableName':_0x6338('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 28e4ea3..ac6daf5 100644 --- a/server/api/mailQueue/mailQueue.rpc.js +++ b/server/api/mailQueue/mailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1e1=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','map','include','model','stringify','ShowMailQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1e1,0x130));var _0x1c1e=function(_0x1c4aa8,_0x4ba3b6){_0x1c4aa8=_0x1c4aa8-0x0;var _0x5aa435=_0xc1e1[_0x1c4aa8];return _0x5aa435;};'use strict';var _=require('lodash');var util=require(_0x1c1e('0x0'));var moment=require(_0x1c1e('0x1'));var BPromise=require(_0x1c1e('0x2'));var rs=require(_0x1c1e('0x3'));var fs=require('fs');var Redis=require(_0x1c1e('0x4'));var db=require(_0x1c1e('0x5'))['db'];var utils=require(_0x1c1e('0x6'));var logger=require(_0x1c1e('0x7'))('rpc');var config=require(_0x1c1e('0x8'));var jayson=require(_0x1c1e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x1c1e('0xa')]=_[_0x1c1e('0xb')](config['redis'],{'host':_0x1c1e('0xc'),'port':0x18eb});var socket=require(_0x1c1e('0xd'))(new Redis(config['redis']));require(_0x1c1e('0xe'))['register'](socket);function respondWithRpcPromise(_0x3d9d2a,_0x537e46,_0x148996){return new BPromise(function(_0x451771,_0x1bbb2e){return client['request'](_0x3d9d2a,_0x148996)[_0x1c1e('0xf')](function(_0x9ef529){logger[_0x1c1e('0x10')](_0x1c1e('0x11'),_0x537e46,_0x1c1e('0x12'));logger[_0x1c1e('0x13')](_0x1c1e('0x14'),_0x537e46,_0x1c1e('0x12'),JSON['stringify'](_0x9ef529));if(_0x9ef529[_0x1c1e('0x15')]){if(_0x9ef529[_0x1c1e('0x15')]['code']===0x1f4){logger[_0x1c1e('0x15')](_0x1c1e('0x11'),_0x537e46,_0x9ef529['error'][_0x1c1e('0x16')]);return _0x1bbb2e(_0x9ef529[_0x1c1e('0x15')]['message']);}logger[_0x1c1e('0x15')](_0x1c1e('0x11'),_0x537e46,_0x9ef529[_0x1c1e('0x15')][_0x1c1e('0x16')]);return _0x451771(_0x9ef529[_0x1c1e('0x15')][_0x1c1e('0x16')]);}else{logger[_0x1c1e('0x10')](_0x1c1e('0x11'),_0x537e46,'request\x20sent');_0x451771(_0x9ef529[_0x1c1e('0x17')]['message']);}})[_0x1c1e('0x18')](function(_0x578c62){logger[_0x1c1e('0x15')](_0x1c1e('0x11'),_0x537e46,_0x578c62);_0x1bbb2e(_0x578c62);});});}exports[_0x1c1e('0x19')]=function(_0x960c6e){var _0x3d4890=this;return new Promise(function(_0x4c8160,_0x25dbcf){return db[_0x1c1e('0x1a')][_0x1c1e('0x1b')]({'raw':_0x960c6e[_0x1c1e('0x1c')]?_0x960c6e[_0x1c1e('0x1c')][_0x1c1e('0x1d')]===undefined?!![]:![]:!![],'where':_0x960c6e['options']?_0x960c6e[_0x1c1e('0x1c')][_0x1c1e('0x1e')]||null:null,'attributes':_0x960c6e[_0x1c1e('0x1c')]?_0x960c6e[_0x1c1e('0x1c')][_0x1c1e('0x1f')]||null:null,'limit':_0x960c6e[_0x1c1e('0x1c')]?_0x960c6e[_0x1c1e('0x1c')][_0x1c1e('0x20')]||null:null,'include':_0x960c6e[_0x1c1e('0x1c')]?_0x960c6e[_0x1c1e('0x1c')]['include']?_[_0x1c1e('0x21')](_0x960c6e[_0x1c1e('0x1c')][_0x1c1e('0x22')],function(_0x39fc60){return{'model':db[_0x39fc60[_0x1c1e('0x23')]],'as':_0x39fc60['as'],'attributes':_0x39fc60[_0x1c1e('0x1f')],'include':_0x39fc60[_0x1c1e('0x22')]?_[_0x1c1e('0x21')](_0x39fc60[_0x1c1e('0x22')],function(_0x503edd){return{'model':db[_0x503edd[_0x1c1e('0x23')]],'as':_0x503edd['as'],'attributes':_0x503edd[_0x1c1e('0x1f')],'include':_0x503edd[_0x1c1e('0x22')]?_[_0x1c1e('0x21')](_0x503edd[_0x1c1e('0x22')],function(_0x4aef35){return{'model':db[_0x4aef35['model']],'as':_0x4aef35['as'],'attributes':_0x4aef35['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c1e('0xf')](function(_0x4201ed){logger[_0x1c1e('0x10')](_0x1c1e('0x19'),_0x960c6e);logger[_0x1c1e('0x13')](_0x1c1e('0x19'),_0x960c6e,JSON[_0x1c1e('0x24')](_0x4201ed));_0x4c8160(_0x4201ed);})[_0x1c1e('0x18')](function(_0x7f4f69){logger['error']('GetMailQueue',_0x7f4f69[_0x1c1e('0x16')],_0x960c6e);_0x25dbcf(_0x3d4890[_0x1c1e('0x15')](0x1f4,_0x7f4f69['message']));});});};exports['ShowMailQueue']=function(_0x15389e){var _0x2b8e22=this;return new Promise(function(_0x574331,_0x2fd029){return db[_0x1c1e('0x1a')]['find']({'raw':_0x15389e['options']?_0x15389e[_0x1c1e('0x1c')][_0x1c1e('0x1d')]===undefined?!![]:![]:!![],'where':_0x15389e[_0x1c1e('0x1c')]?_0x15389e[_0x1c1e('0x1c')]['where']||null:null,'attributes':_0x15389e[_0x1c1e('0x1c')]?_0x15389e[_0x1c1e('0x1c')][_0x1c1e('0x1f')]||null:null,'include':_0x15389e['options']?_0x15389e[_0x1c1e('0x1c')][_0x1c1e('0x22')]?_[_0x1c1e('0x21')](_0x15389e['options'][_0x1c1e('0x22')],function(_0x2b1d6f){return{'model':db[_0x2b1d6f[_0x1c1e('0x23')]],'as':_0x2b1d6f['as'],'attributes':_0x2b1d6f['attributes'],'include':_0x2b1d6f['include']?_[_0x1c1e('0x21')](_0x2b1d6f[_0x1c1e('0x22')],function(_0x32eeba){return{'model':db[_0x32eeba[_0x1c1e('0x23')]],'as':_0x32eeba['as'],'attributes':_0x32eeba[_0x1c1e('0x1f')],'include':_0x32eeba[_0x1c1e('0x22')]?_[_0x1c1e('0x21')](_0x32eeba[_0x1c1e('0x22')],function(_0x52a823){return{'model':db[_0x52a823[_0x1c1e('0x23')]],'as':_0x52a823['as'],'attributes':_0x52a823[_0x1c1e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1c1e('0xf')](function(_0x56a4e9){logger[_0x1c1e('0x10')](_0x1c1e('0x25'),_0x15389e);logger[_0x1c1e('0x13')](_0x1c1e('0x25'),_0x15389e,JSON[_0x1c1e('0x24')](_0x56a4e9));_0x574331(_0x56a4e9);})[_0x1c1e('0x18')](function(_0x398d88){logger[_0x1c1e('0x15')](_0x1c1e('0x25'),_0x398d88[_0x1c1e('0x16')],_0x15389e);_0x2fd029(_0x2b8e22[_0x1c1e('0x15')](0x1f4,_0x398d88[_0x1c1e('0x16')]));});});}; \ No newline at end of file +var _0x7d73=['redis','defaults','localhost','register','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','include','map','model','ShowMailQueue','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xb78e44,_0x41eb5a){var _0x4f74aa=function(_0x22d4d4){while(--_0x22d4d4){_0xb78e44['push'](_0xb78e44['shift']());}};_0x4f74aa(++_0x41eb5a);}(_0x7d73,0xe3));var _0x37d7=function(_0xdefbc3,_0x1ea49a){_0xdefbc3=_0xdefbc3-0x0;var _0x367798=_0x7d73[_0xdefbc3];return _0x367798;};'use strict';var _=require(_0x37d7('0x0'));var util=require(_0x37d7('0x1'));var moment=require(_0x37d7('0x2'));var BPromise=require(_0x37d7('0x3'));var rs=require(_0x37d7('0x4'));var fs=require('fs');var Redis=require(_0x37d7('0x5'));var db=require(_0x37d7('0x6'))['db'];var utils=require(_0x37d7('0x7'));var logger=require(_0x37d7('0x8'))(_0x37d7('0x9'));var config=require(_0x37d7('0xa'));var jayson=require(_0x37d7('0xb'));var client=jayson[_0x37d7('0xc')]['http']({'port':0x232a});config[_0x37d7('0xd')]=_[_0x37d7('0xe')](config[_0x37d7('0xd')],{'host':_0x37d7('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37d7('0xd')]));require('./mailQueue.socket')[_0x37d7('0x10')](socket);function respondWithRpcPromise(_0x5297a2,_0x612f0e,_0x1b953a){return new BPromise(function(_0x2ee785,_0xc41270){return client['request'](_0x5297a2,_0x1b953a)[_0x37d7('0x11')](function(_0x5a5c89){logger[_0x37d7('0x12')](_0x37d7('0x13'),_0x612f0e,'request\x20sent');logger[_0x37d7('0x14')](_0x37d7('0x15'),_0x612f0e,'request\x20sent',JSON[_0x37d7('0x16')](_0x5a5c89));if(_0x5a5c89[_0x37d7('0x17')]){if(_0x5a5c89[_0x37d7('0x17')]['code']===0x1f4){logger[_0x37d7('0x17')](_0x37d7('0x13'),_0x612f0e,_0x5a5c89[_0x37d7('0x17')][_0x37d7('0x18')]);return _0xc41270(_0x5a5c89[_0x37d7('0x17')]['message']);}logger[_0x37d7('0x17')](_0x37d7('0x13'),_0x612f0e,_0x5a5c89[_0x37d7('0x17')][_0x37d7('0x18')]);return _0x2ee785(_0x5a5c89[_0x37d7('0x17')][_0x37d7('0x18')]);}else{logger[_0x37d7('0x12')](_0x37d7('0x13'),_0x612f0e,_0x37d7('0x19'));_0x2ee785(_0x5a5c89[_0x37d7('0x1a')][_0x37d7('0x18')]);}})[_0x37d7('0x1b')](function(_0x5c5bb2){logger[_0x37d7('0x17')](_0x37d7('0x13'),_0x612f0e,_0x5c5bb2);_0xc41270(_0x5c5bb2);});});}exports[_0x37d7('0x1c')]=function(_0x45e653){var _0x5aa59c=this;return new Promise(function(_0x2f5bfa,_0x43fabb){return db[_0x37d7('0x1d')][_0x37d7('0x1e')]({'raw':_0x45e653[_0x37d7('0x1f')]?_0x45e653['options'][_0x37d7('0x20')]===undefined?!![]:![]:!![],'where':_0x45e653[_0x37d7('0x1f')]?_0x45e653[_0x37d7('0x1f')]['where']||null:null,'attributes':_0x45e653['options']?_0x45e653[_0x37d7('0x1f')][_0x37d7('0x21')]||null:null,'limit':_0x45e653[_0x37d7('0x1f')]?_0x45e653[_0x37d7('0x1f')][_0x37d7('0x22')]||null:null,'include':_0x45e653[_0x37d7('0x1f')]?_0x45e653[_0x37d7('0x1f')][_0x37d7('0x23')]?_[_0x37d7('0x24')](_0x45e653[_0x37d7('0x1f')][_0x37d7('0x23')],function(_0x105f6c){return{'model':db[_0x105f6c[_0x37d7('0x25')]],'as':_0x105f6c['as'],'attributes':_0x105f6c[_0x37d7('0x21')],'include':_0x105f6c['include']?_[_0x37d7('0x24')](_0x105f6c[_0x37d7('0x23')],function(_0x436c98){return{'model':db[_0x436c98['model']],'as':_0x436c98['as'],'attributes':_0x436c98[_0x37d7('0x21')],'include':_0x436c98[_0x37d7('0x23')]?_[_0x37d7('0x24')](_0x436c98[_0x37d7('0x23')],function(_0x1003d3){return{'model':db[_0x1003d3[_0x37d7('0x25')]],'as':_0x1003d3['as'],'attributes':_0x1003d3[_0x37d7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x37d7('0x11')](function(_0x5a0b4e){logger['info'](_0x37d7('0x1c'),_0x45e653);logger[_0x37d7('0x14')](_0x37d7('0x1c'),_0x45e653,JSON[_0x37d7('0x16')](_0x5a0b4e));_0x2f5bfa(_0x5a0b4e);})[_0x37d7('0x1b')](function(_0x402b70){logger[_0x37d7('0x17')]('GetMailQueue',_0x402b70[_0x37d7('0x18')],_0x45e653);_0x43fabb(_0x5aa59c[_0x37d7('0x17')](0x1f4,_0x402b70['message']));});});};exports[_0x37d7('0x26')]=function(_0x54db1a){var _0x1a05af=this;return new Promise(function(_0x1642ca,_0x429f15){return db[_0x37d7('0x1d')]['find']({'raw':_0x54db1a[_0x37d7('0x1f')]?_0x54db1a[_0x37d7('0x1f')][_0x37d7('0x20')]===undefined?!![]:![]:!![],'where':_0x54db1a['options']?_0x54db1a[_0x37d7('0x1f')][_0x37d7('0x27')]||null:null,'attributes':_0x54db1a[_0x37d7('0x1f')]?_0x54db1a['options'][_0x37d7('0x21')]||null:null,'include':_0x54db1a[_0x37d7('0x1f')]?_0x54db1a[_0x37d7('0x1f')][_0x37d7('0x23')]?_[_0x37d7('0x24')](_0x54db1a[_0x37d7('0x1f')][_0x37d7('0x23')],function(_0x1fb86c){return{'model':db[_0x1fb86c[_0x37d7('0x25')]],'as':_0x1fb86c['as'],'attributes':_0x1fb86c['attributes'],'include':_0x1fb86c[_0x37d7('0x23')]?_[_0x37d7('0x24')](_0x1fb86c['include'],function(_0x5ca6e2){return{'model':db[_0x5ca6e2[_0x37d7('0x25')]],'as':_0x5ca6e2['as'],'attributes':_0x5ca6e2[_0x37d7('0x21')],'include':_0x5ca6e2['include']?_['map'](_0x5ca6e2['include'],function(_0x361a87){return{'model':db[_0x361a87['model']],'as':_0x361a87['as'],'attributes':_0x361a87['attributes']};}):[]};}):[]};}):[]:[]})[_0x37d7('0x11')](function(_0x29de7c){logger['info'](_0x37d7('0x26'),_0x54db1a);logger[_0x37d7('0x14')](_0x37d7('0x26'),_0x54db1a,JSON['stringify'](_0x29de7c));_0x1642ca(_0x29de7c);})[_0x37d7('0x1b')](function(_0x473a32){logger[_0x37d7('0x17')](_0x37d7('0x26'),_0x473a32[_0x37d7('0x18')],_0x54db1a);_0x429f15(_0x1a05af[_0x37d7('0x17')](0x1f4,_0x473a32[_0x37d7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 8d14f3f..7e0a5cd 100644 --- a/server/api/mailQueue/mailQueue.socket.js +++ b/server/api/mailQueue/mailQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8f5=['save','emit','length','mailQueue:','./mailQueue.events'];(function(_0x3b34d2,_0x8a4fe2){var _0x53a368=function(_0x205411){while(--_0x205411){_0x3b34d2['push'](_0x3b34d2['shift']());}};_0x53a368(++_0x8a4fe2);}(_0xe8f5,0xb3));var _0x5e8f=function(_0x26cb01,_0x3ab8a7){_0x26cb01=_0x26cb01-0x0;var _0xe49a17=_0xe8f5[_0x26cb01];return _0xe49a17;};'use strict';var MailQueueEvents=require(_0x5e8f('0x0'));var events=[_0x5e8f('0x1'),'remove','update'];function createListener(_0x34bd9a,_0x3da3c8){return function(_0x625ffe){_0x3da3c8[_0x5e8f('0x2')](_0x34bd9a,_0x625ffe);};}function removeListener(_0x39c284,_0x287a39){return function(){MailQueueEvents['removeListener'](_0x39c284,_0x287a39);};}exports['register']=function(_0x478ad1){for(var _0x20e9f=0x0,_0x1afd14=events[_0x5e8f('0x3')];_0x20e9f<_0x1afd14;_0x20e9f++){var _0x132990=events[_0x20e9f];var _0x20ecd9=createListener(_0x5e8f('0x4')+_0x132990,_0x478ad1);MailQueueEvents['on'](_0x132990,_0x20ecd9);}}; \ No newline at end of file +var _0x04c9=['emit','removeListener','register','length','./mailQueue.events','remove'];(function(_0x56ac97,_0x2fc64a){var _0x14ef2f=function(_0x51cd13){while(--_0x51cd13){_0x56ac97['push'](_0x56ac97['shift']());}};_0x14ef2f(++_0x2fc64a);}(_0x04c9,0x11e));var _0x904c=function(_0x18eb30,_0x235ba6){_0x18eb30=_0x18eb30-0x0;var _0x484c01=_0x04c9[_0x18eb30];return _0x484c01;};'use strict';var MailQueueEvents=require(_0x904c('0x0'));var events=['save',_0x904c('0x1'),'update'];function createListener(_0x3c1ee1,_0x110dea){return function(_0x24e64b){_0x110dea[_0x904c('0x2')](_0x3c1ee1,_0x24e64b);};}function removeListener(_0x5defbd,_0xa4c911){return function(){MailQueueEvents[_0x904c('0x3')](_0x5defbd,_0xa4c911);};}exports[_0x904c('0x4')]=function(_0x19fc74){for(var _0x38db20=0x0,_0x3d738a=events[_0x904c('0x5')];_0x38db20<_0x3d738a;_0x38db20++){var _0xe50cc4=events[_0x38db20];var _0x2d1d65=createListener('mailQueue:'+_0xe50cc4,_0x19fc74);MailQueueEvents['on'](_0xe50cc4,_0x2d1d65);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index f1f7abf..c317cc1 100644 --- a/server/api/mailQueueReport/index.js +++ b/server/api/mailQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda60=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','destroy','exports','multer'];(function(_0xffa060,_0x58cc0b){var _0x2a35a4=function(_0x257d94){while(--_0x257d94){_0xffa060['push'](_0xffa060['shift']());}};_0x2a35a4(++_0x58cc0b);}(_0xda60,0xe3));var _0x0da6=function(_0x191f9d,_0x21976f){_0x191f9d=_0x191f9d-0x0;var _0x58e60d=_0xda60[_0x191f9d];return _0x58e60d;};'use strict';var multer=require(_0x0da6('0x0'));var util=require(_0x0da6('0x1'));var path=require(_0x0da6('0x2'));var timeout=require(_0x0da6('0x3'));var express=require(_0x0da6('0x4'));var router=express['Router']();var auth=require(_0x0da6('0x5'));var interaction=require(_0x0da6('0x6'));var config=require('../../config/environment');var controller=require(_0x0da6('0x7'));router[_0x0da6('0x8')]('/',auth[_0x0da6('0x9')](),controller['index']);router['get'](_0x0da6('0xa'),auth['isAuthenticated'](),controller[_0x0da6('0xb')]);router[_0x0da6('0x8')](_0x0da6('0xc'),auth[_0x0da6('0x9')](),controller[_0x0da6('0xd')]);router[_0x0da6('0xe')]('/',auth[_0x0da6('0x9')](),controller['create']);router[_0x0da6('0xf')](_0x0da6('0xc'),auth['isAuthenticated'](),controller[_0x0da6('0x10')]);router['delete'](_0x0da6('0xc'),auth[_0x0da6('0x9')](),controller[_0x0da6('0x11')]);module[_0x0da6('0x12')]=router; \ No newline at end of file +var _0x5a34=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./mailQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','post','create'];(function(_0x25b444,_0x20da5e){var _0x425f88=function(_0xe4183e){while(--_0xe4183e){_0x25b444['push'](_0x25b444['shift']());}};_0x425f88(++_0x20da5e);}(_0x5a34,0x148));var _0x45a3=function(_0xc02c3e,_0xe9d90c){_0xc02c3e=_0xc02c3e-0x0;var _0x1a4e57=_0x5a34[_0xc02c3e];return _0x1a4e57;};'use strict';var multer=require(_0x45a3('0x0'));var util=require(_0x45a3('0x1'));var path=require(_0x45a3('0x2'));var timeout=require(_0x45a3('0x3'));var express=require(_0x45a3('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x45a3('0x5'));var config=require('../../config/environment');var controller=require(_0x45a3('0x6'));router['get']('/',auth[_0x45a3('0x7')](),controller['index']);router[_0x45a3('0x8')](_0x45a3('0x9'),auth[_0x45a3('0x7')](),controller[_0x45a3('0xa')]);router[_0x45a3('0x8')](_0x45a3('0xb'),auth[_0x45a3('0x7')](),controller['show']);router[_0x45a3('0xc')]('/',auth[_0x45a3('0x7')](),controller[_0x45a3('0xd')]);router[_0x45a3('0xe')](_0x45a3('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x45a3('0xf')]('/:id',auth[_0x45a3('0x7')](),controller[_0x45a3('0x10')]);module[_0x45a3('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 5bf59bb..befcc00 100644 --- a/server/api/mailQueueReport/mailQueueReport.attributes.js +++ b/server/api/mailQueueReport/mailQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c91=['STRING','DATE','moment','exports'];(function(_0x26b9a8,_0x1d4fb0){var _0x41071e=function(_0x2a95d5){while(--_0x2a95d5){_0x26b9a8['push'](_0x26b9a8['shift']());}};_0x41071e(++_0x1d4fb0);}(_0x4c91,0xa2));var _0x14c9=function(_0x1a120c,_0x2ae99b){_0x1a120c=_0x1a120c-0x0;var _0x3f7bd3=_0x4c91[_0x1a120c];return _0x3f7bd3;};'use strict';var moment=require(_0x14c9('0x0'));var Sequelize=require('sequelize');module[_0x14c9('0x1')]={'uniqueid':{'type':Sequelize[_0x14c9('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x14c9('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x14c9('0x3')]},'exitAt':{'type':Sequelize[_0x14c9('0x3')]},'reason':{'type':Sequelize[_0x14c9('0x2')]}}; \ No newline at end of file +var _0x8b69=['DATE','sequelize','STRING'];(function(_0x27999e,_0x1cbbd2){var _0x19498d=function(_0x2bd9ab){while(--_0x2bd9ab){_0x27999e['push'](_0x27999e['shift']());}};_0x19498d(++_0x1cbbd2);}(_0x8b69,0x1db));var _0x98b6=function(_0xc7c50e,_0x23b280){_0xc7c50e=_0xc7c50e-0x0;var _0x37e612=_0x8b69[_0xc7c50e];return _0x37e612;};'use strict';var moment=require('moment');var Sequelize=require(_0x98b6('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x98b6('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x98b6('0x1')]},'joinAt':{'type':Sequelize[_0x98b6('0x2')]},'leaveAt':{'type':Sequelize[_0x98b6('0x2')]},'acceptAt':{'type':Sequelize[_0x98b6('0x2')]},'exitAt':{'type':Sequelize[_0x98b6('0x2')]},'reason':{'type':Sequelize[_0x98b6('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 5249cba..8edf5c1 100644 --- a/server/api/mailQueueReport/mailQueueReport.controller.js +++ b/server/api/mailQueueReport/mailQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0228=['attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','type','key','field','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','model','keys','query','filters','intersection'];(function(_0x444c93,_0x5ef63f){var _0x8fa12d=function(_0x4bbc00){while(--_0x4bbc00){_0x444c93['push'](_0x444c93['shift']());}};_0x8fa12d(++_0x5ef63f);}(_0x0228,0x1c3));var _0x8022=function(_0x34e79d,_0x1fb826){_0x34e79d=_0x34e79d-0x0;var _0x56afa8=_0x0228[_0x34e79d];return _0x56afa8;};'use strict';var pdf=require(_0x8022('0x0'));var emlformat=require(_0x8022('0x1'));var rimraf=require(_0x8022('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8022('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8022('0x4'));var Mustache=require(_0x8022('0x5'));var util=require('util');var path=require(_0x8022('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8022('0x7'));var fs=require('fs');var _=require(_0x8022('0x8'));var squel=require(_0x8022('0x9'));var crypto=require(_0x8022('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8022('0xb'));var toCsv=require(_0x8022('0xc'));var querystring=require('querystring');var Papa=require(_0x8022('0xd'));var Redis=require(_0x8022('0xe'));var authService=require(_0x8022('0xf'));var qs=require(_0x8022('0x10'));var hardwareService=require(_0x8022('0x11'));var logger=require(_0x8022('0x12'))(_0x8022('0x13'));var utils=require(_0x8022('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41df56,_0x9e169e){_0x9e169e=_0x9e169e||0xcc;return function(_0x59a7f0){if(_0x59a7f0){return _0x41df56[_0x8022('0x15')](_0x9e169e);}return _0x41df56[_0x8022('0x16')](_0x9e169e)[_0x8022('0x17')]();};}function respondWithResult(_0x8f6d21,_0x57945f){_0x57945f=_0x57945f||0xc8;return function(_0x4912f6){if(_0x4912f6){return _0x8f6d21[_0x8022('0x16')](_0x57945f)['json'](_0x4912f6);}};}function respondWithFilteredResult(_0x1ada03,_0x581f34){return function(_0x3d1e83){if(_0x3d1e83){var _0x48ad21=_0x3d1e83[_0x8022('0x18')],_0x385188=_0x581f34[_0x8022('0x19')],_0x13de90=_0x581f34[_0x8022('0x19')]+_0x581f34[_0x8022('0x1a')],_0x3a5d64;if(_0x13de90>=_0x48ad21){_0x13de90=_0x48ad21;_0x3a5d64=0xc8;}else{_0x3a5d64=0xce;}_0x1ada03[_0x8022('0x16')](_0x3a5d64);return _0x1ada03[_0x8022('0x1b')](_0x8022('0x1c'),_0x385188+'-'+_0x13de90+'/'+_0x48ad21)[_0x8022('0x1d')](_0x3d1e83);}return null;};}function patchUpdates(_0x35f27f){return function(_0x2b9e6b){try{jsonpatch[_0x8022('0x1e')](_0x2b9e6b,_0x35f27f,!![]);}catch(_0x35c90b){return BPromise['reject'](_0x35c90b);}return _0x2b9e6b['save']();};}function saveUpdates(_0x380c39,_0x54df2f){return function(_0x531802){if(_0x531802){return _0x531802[_0x8022('0x1f')](_0x380c39)[_0x8022('0x20')](function(_0x7b19f1){return _0x7b19f1;});}return null;};}function removeEntity(_0x21bcf0,_0x8f889){return function(_0xf9c570){if(_0xf9c570){return _0xf9c570[_0x8022('0x21')]()[_0x8022('0x20')](function(){_0x21bcf0[_0x8022('0x16')](0xcc)[_0x8022('0x17')]();});}};}function handleEntityNotFound(_0xf40865,_0x4da09d){return function(_0x10ce34){if(!_0x10ce34){_0xf40865['sendStatus'](0x194);}return _0x10ce34;};}function handleError(_0x2afd30,_0x19c407){_0x19c407=_0x19c407||0x1f4;return function(_0x56eee3){logger[_0x8022('0x22')](_0x56eee3[_0x8022('0x23')]);if(_0x56eee3['name']){delete _0x56eee3[_0x8022('0x24')];}_0x2afd30[_0x8022('0x16')](_0x19c407)[_0x8022('0x25')](_0x56eee3);};}exports[_0x8022('0x26')]=function(_0xba81a4,_0x569927){var _0x4e917f={},_0xeca670={},_0x5cb5bd={'count':0x0,'rows':[]};var _0x1d1e9e=db[_0x8022('0x27')][_0x8022('0x28')];_0xeca670[_0x8022('0x29')]=_[_0x8022('0x2a')](_0x1d1e9e);_0xeca670['query']=_[_0x8022('0x2a')](_0xba81a4[_0x8022('0x2b')]);_0xeca670[_0x8022('0x2c')]=_[_0x8022('0x2d')](_0xeca670[_0x8022('0x29')],_0xeca670[_0x8022('0x2b')]);_0x4e917f[_0x8022('0x2e')]=_[_0x8022('0x2d')](_0xeca670[_0x8022('0x29')],qs[_0x8022('0x2f')](_0xba81a4[_0x8022('0x2b')][_0x8022('0x2f')]));_0x4e917f[_0x8022('0x2e')]=_0x4e917f[_0x8022('0x2e')][_0x8022('0x30')]?_0x4e917f[_0x8022('0x2e')]:_0xeca670[_0x8022('0x29')];if(!_0xba81a4[_0x8022('0x2b')]['hasOwnProperty'](_0x8022('0x31'))){_0x4e917f[_0x8022('0x1a')]=qs[_0x8022('0x1a')](_0xba81a4[_0x8022('0x2b')][_0x8022('0x1a')]);_0x4e917f['offset']=qs[_0x8022('0x19')](_0xba81a4[_0x8022('0x2b')]['offset']);}_0x4e917f[_0x8022('0x32')]=qs['sort'](_0xba81a4[_0x8022('0x2b')][_0x8022('0x33')]);_0x4e917f['where']=qs[_0x8022('0x2c')](_[_0x8022('0x34')](_0xba81a4[_0x8022('0x2b')],_0xeca670[_0x8022('0x2c')]));if(_0xba81a4[_0x8022('0x2b')][_0x8022('0x35')]){_0x4e917f[_0x8022('0x36')]=_[_0x8022('0x37')](_0x4e917f['where'],{'$or':_[_0x8022('0x38')](_0x1d1e9e,function(_0x286918){if(_0x286918[_0x8022('0x39')][_0x8022('0x3a')]!=='VIRTUAL'){var _0x14fa8c={};_0x14fa8c[_0x286918[_0x8022('0x3b')]]={'$like':'%'+_0xba81a4[_0x8022('0x2b')][_0x8022('0x35')]+'%'};return _0x14fa8c;}})});}_0x4e917f=_[_0x8022('0x37')]({},_0x4e917f,_0xba81a4[_0x8022('0x3c')]);var _0x53afa0={'where':_0x4e917f[_0x8022('0x36')]};return db[_0x8022('0x27')][_0x8022('0x18')](_0x53afa0)[_0x8022('0x20')](function(_0x201be7){_0x5cb5bd[_0x8022('0x18')]=_0x201be7;if(_0xba81a4[_0x8022('0x2b')][_0x8022('0x3d')]){_0x4e917f[_0x8022('0x3e')]=[{'all':!![]}];}return db['MailQueueReport'][_0x8022('0x3f')](_0x4e917f);})['then'](function(_0x514464){_0x5cb5bd[_0x8022('0x40')]=_0x514464;return _0x5cb5bd;})['then'](respondWithFilteredResult(_0x569927,_0x4e917f))['catch'](handleError(_0x569927,null));};exports['show']=function(_0x546a0c,_0x1cc4ca){var _0x230214={'raw':!![],'where':{'id':_0x546a0c[_0x8022('0x41')]['id']}},_0x4f113f={};_0x4f113f[_0x8022('0x29')]=_[_0x8022('0x2a')](db[_0x8022('0x27')][_0x8022('0x28')]);_0x4f113f[_0x8022('0x2b')]=_['keys'](_0x546a0c[_0x8022('0x2b')]);_0x4f113f[_0x8022('0x2c')]=_['intersection'](_0x4f113f[_0x8022('0x29')],_0x4f113f[_0x8022('0x2b')]);_0x230214['attributes']=_[_0x8022('0x2d')](_0x4f113f[_0x8022('0x29')],qs[_0x8022('0x2f')](_0x546a0c[_0x8022('0x2b')]['fields']));_0x230214['attributes']=_0x230214['attributes'][_0x8022('0x30')]?_0x230214[_0x8022('0x2e')]:_0x4f113f[_0x8022('0x29')];if(_0x546a0c['query'][_0x8022('0x3d')]){_0x230214[_0x8022('0x3e')]=[{'all':!![]}];}_0x230214=_[_0x8022('0x37')]({},_0x230214,_0x546a0c[_0x8022('0x3c')]);return db[_0x8022('0x27')][_0x8022('0x42')](_0x230214)[_0x8022('0x20')](handleEntityNotFound(_0x1cc4ca,null))[_0x8022('0x20')](respondWithResult(_0x1cc4ca,null))[_0x8022('0x43')](handleError(_0x1cc4ca,null));};exports[_0x8022('0x44')]=function(_0x941c3c,_0x56b1c5){return db[_0x8022('0x27')][_0x8022('0x44')](_0x941c3c[_0x8022('0x45')],{})[_0x8022('0x20')](respondWithResult(_0x56b1c5,0xc9))[_0x8022('0x43')](handleError(_0x56b1c5,null));};exports[_0x8022('0x1f')]=function(_0xc1a0d6,_0x40521b){if(_0xc1a0d6[_0x8022('0x45')]['id']){delete _0xc1a0d6[_0x8022('0x45')]['id'];}return db[_0x8022('0x27')][_0x8022('0x42')]({'where':{'id':_0xc1a0d6[_0x8022('0x41')]['id']}})['then'](handleEntityNotFound(_0x40521b,null))[_0x8022('0x20')](saveUpdates(_0xc1a0d6[_0x8022('0x45')],null))['then'](respondWithResult(_0x40521b,null))['catch'](handleError(_0x40521b,null));};exports[_0x8022('0x21')]=function(_0x22a3ac,_0x21c67c){return db['MailQueueReport'][_0x8022('0x42')]({'where':{'id':_0x22a3ac['params']['id']}})[_0x8022('0x20')](handleEntityNotFound(_0x21c67c,null))[_0x8022('0x20')](removeEntity(_0x21c67c,null))[_0x8022('0x43')](handleError(_0x21c67c,null));};exports[_0x8022('0x46')]=function(_0x1634a6,_0x25897d){return db[_0x8022('0x27')][_0x8022('0x46')]()[_0x8022('0x20')](respondWithResult(_0x25897d,null))['catch'](handleError(_0x25897d,null));}; \ No newline at end of file +var _0x2f83=['type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','MailQueueReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','sort','pick','filter','where','merge','map'];(function(_0x2c3a8f,_0x374e56){var _0x189412=function(_0x560055){while(--_0x560055){_0x2c3a8f['push'](_0x2c3a8f['shift']());}};_0x189412(++_0x374e56);}(_0x2f83,0xaa));var _0x32f8=function(_0x34ac64,_0x23f246){_0x34ac64=_0x34ac64-0x0;var _0xae8ae9=_0x2f83[_0x34ac64];return _0xae8ae9;};'use strict';var pdf=require(_0x32f8('0x0'));var emlformat=require(_0x32f8('0x1'));var rimraf=require(_0x32f8('0x2'));var zipdir=require(_0x32f8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32f8('0x4'));var moment=require(_0x32f8('0x5'));var BPromise=require(_0x32f8('0x6'));var Mustache=require(_0x32f8('0x7'));var util=require(_0x32f8('0x8'));var path=require('path');var sox=require(_0x32f8('0x9'));var csv=require(_0x32f8('0xa'));var ejs=require(_0x32f8('0xb'));var fs=require('fs');var _=require(_0x32f8('0xc'));var squel=require(_0x32f8('0xd'));var crypto=require(_0x32f8('0xe'));var jsforce=require(_0x32f8('0xf'));var deskjs=require(_0x32f8('0x10'));var toCsv=require(_0x32f8('0xa'));var querystring=require(_0x32f8('0x11'));var Papa=require(_0x32f8('0x12'));var Redis=require('ioredis');var authService=require(_0x32f8('0x13'));var qs=require(_0x32f8('0x14'));var hardwareService=require(_0x32f8('0x15'));var logger=require(_0x32f8('0x16'))(_0x32f8('0x17'));var utils=require(_0x32f8('0x18'));var config=require(_0x32f8('0x19'));var db=require(_0x32f8('0x1a'))['db'];function respondWithStatusCode(_0x26c3e3,_0x29dec4){_0x29dec4=_0x29dec4||0xcc;return function(_0x25b240){if(_0x25b240){return _0x26c3e3[_0x32f8('0x1b')](_0x29dec4);}return _0x26c3e3[_0x32f8('0x1c')](_0x29dec4)[_0x32f8('0x1d')]();};}function respondWithResult(_0x2e007f,_0x4a7aa5){_0x4a7aa5=_0x4a7aa5||0xc8;return function(_0x340051){if(_0x340051){return _0x2e007f[_0x32f8('0x1c')](_0x4a7aa5)[_0x32f8('0x1e')](_0x340051);}};}function respondWithFilteredResult(_0x306772,_0x4b092c){return function(_0x2bf091){if(_0x2bf091){var _0xaae15f=_0x2bf091[_0x32f8('0x1f')],_0x158520=_0x4b092c[_0x32f8('0x20')],_0x441384=_0x4b092c['offset']+_0x4b092c[_0x32f8('0x21')],_0x42649e;if(_0x441384>=_0xaae15f){_0x441384=_0xaae15f;_0x42649e=0xc8;}else{_0x42649e=0xce;}_0x306772[_0x32f8('0x1c')](_0x42649e);return _0x306772[_0x32f8('0x22')](_0x32f8('0x23'),_0x158520+'-'+_0x441384+'/'+_0xaae15f)[_0x32f8('0x1e')](_0x2bf091);}return null;};}function patchUpdates(_0x26fae8){return function(_0x45987f){try{jsonpatch['apply'](_0x45987f,_0x26fae8,!![]);}catch(_0x54f4ab){return BPromise[_0x32f8('0x24')](_0x54f4ab);}return _0x45987f[_0x32f8('0x25')]();};}function saveUpdates(_0x33f034,_0x503019){return function(_0xff716d){if(_0xff716d){return _0xff716d[_0x32f8('0x26')](_0x33f034)['then'](function(_0x1c956d){return _0x1c956d;});}return null;};}function removeEntity(_0x40fdee,_0x52c05b){return function(_0x4cb3eb){if(_0x4cb3eb){return _0x4cb3eb[_0x32f8('0x27')]()[_0x32f8('0x28')](function(){_0x40fdee[_0x32f8('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1abaef,_0x5e36d9){return function(_0x52647c){if(!_0x52647c){_0x1abaef['sendStatus'](0x194);}return _0x52647c;};}function handleError(_0x3ad3b4,_0x2abb11){_0x2abb11=_0x2abb11||0x1f4;return function(_0x11e1ed){logger[_0x32f8('0x29')](_0x11e1ed['stack']);if(_0x11e1ed[_0x32f8('0x2a')]){delete _0x11e1ed[_0x32f8('0x2a')];}_0x3ad3b4[_0x32f8('0x1c')](_0x2abb11)[_0x32f8('0x2b')](_0x11e1ed);};}exports[_0x32f8('0x2c')]=function(_0x1ec45d,_0x1fc0db){var _0x4fed33={},_0x1f594a={},_0x58c4bb={'count':0x0,'rows':[]};var _0x8caf6=db[_0x32f8('0x2d')][_0x32f8('0x2e')];_0x1f594a[_0x32f8('0x2f')]=_[_0x32f8('0x30')](_0x8caf6);_0x1f594a[_0x32f8('0x31')]=_[_0x32f8('0x30')](_0x1ec45d['query']);_0x1f594a[_0x32f8('0x32')]=_[_0x32f8('0x33')](_0x1f594a[_0x32f8('0x2f')],_0x1f594a[_0x32f8('0x31')]);_0x4fed33['attributes']=_[_0x32f8('0x33')](_0x1f594a['model'],qs[_0x32f8('0x34')](_0x1ec45d[_0x32f8('0x31')][_0x32f8('0x34')]));_0x4fed33[_0x32f8('0x35')]=_0x4fed33[_0x32f8('0x35')][_0x32f8('0x36')]?_0x4fed33[_0x32f8('0x35')]:_0x1f594a[_0x32f8('0x2f')];if(!_0x1ec45d[_0x32f8('0x31')]['hasOwnProperty']('nolimit')){_0x4fed33[_0x32f8('0x21')]=qs[_0x32f8('0x21')](_0x1ec45d[_0x32f8('0x31')][_0x32f8('0x21')]);_0x4fed33[_0x32f8('0x20')]=qs['offset'](_0x1ec45d[_0x32f8('0x31')]['offset']);}_0x4fed33['order']=qs['sort'](_0x1ec45d[_0x32f8('0x31')][_0x32f8('0x37')]);_0x4fed33['where']=qs[_0x32f8('0x32')](_[_0x32f8('0x38')](_0x1ec45d[_0x32f8('0x31')],_0x1f594a[_0x32f8('0x32')]));if(_0x1ec45d[_0x32f8('0x31')][_0x32f8('0x39')]){_0x4fed33[_0x32f8('0x3a')]=_[_0x32f8('0x3b')](_0x4fed33['where'],{'$or':_[_0x32f8('0x3c')](_0x8caf6,function(_0x1770a9){if(_0x1770a9[_0x32f8('0x3d')][_0x32f8('0x3e')]!==_0x32f8('0x3f')){var _0x5cb6d3={};_0x5cb6d3[_0x1770a9[_0x32f8('0x40')]]={'$like':'%'+_0x1ec45d[_0x32f8('0x31')][_0x32f8('0x39')]+'%'};return _0x5cb6d3;}})});}_0x4fed33=_[_0x32f8('0x3b')]({},_0x4fed33,_0x1ec45d[_0x32f8('0x41')]);var _0x165f45={'where':_0x4fed33[_0x32f8('0x3a')]};return db[_0x32f8('0x2d')][_0x32f8('0x1f')](_0x165f45)['then'](function(_0x5196e7){_0x58c4bb[_0x32f8('0x1f')]=_0x5196e7;if(_0x1ec45d[_0x32f8('0x31')][_0x32f8('0x42')]){_0x4fed33[_0x32f8('0x43')]=[{'all':!![]}];}return db[_0x32f8('0x2d')][_0x32f8('0x44')](_0x4fed33);})[_0x32f8('0x28')](function(_0x8a931f){_0x58c4bb[_0x32f8('0x45')]=_0x8a931f;return _0x58c4bb;})[_0x32f8('0x28')](respondWithFilteredResult(_0x1fc0db,_0x4fed33))['catch'](handleError(_0x1fc0db,null));};exports[_0x32f8('0x46')]=function(_0x68968f,_0x16feae){var _0x5c562b={'raw':!![],'where':{'id':_0x68968f['params']['id']}},_0x569a76={};_0x569a76['model']=_[_0x32f8('0x30')](db[_0x32f8('0x2d')][_0x32f8('0x2e')]);_0x569a76[_0x32f8('0x31')]=_[_0x32f8('0x30')](_0x68968f[_0x32f8('0x31')]);_0x569a76[_0x32f8('0x32')]=_[_0x32f8('0x33')](_0x569a76['model'],_0x569a76[_0x32f8('0x31')]);_0x5c562b[_0x32f8('0x35')]=_['intersection'](_0x569a76['model'],qs['fields'](_0x68968f[_0x32f8('0x31')][_0x32f8('0x34')]));_0x5c562b['attributes']=_0x5c562b[_0x32f8('0x35')][_0x32f8('0x36')]?_0x5c562b[_0x32f8('0x35')]:_0x569a76[_0x32f8('0x2f')];if(_0x68968f[_0x32f8('0x31')][_0x32f8('0x42')]){_0x5c562b[_0x32f8('0x43')]=[{'all':!![]}];}_0x5c562b=_[_0x32f8('0x3b')]({},_0x5c562b,_0x68968f[_0x32f8('0x41')]);return db[_0x32f8('0x2d')][_0x32f8('0x47')](_0x5c562b)['then'](handleEntityNotFound(_0x16feae,null))[_0x32f8('0x28')](respondWithResult(_0x16feae,null))[_0x32f8('0x48')](handleError(_0x16feae,null));};exports[_0x32f8('0x49')]=function(_0x1efde3,_0x1b7b3b){return db[_0x32f8('0x2d')][_0x32f8('0x49')](_0x1efde3[_0x32f8('0x4a')],{})['then'](respondWithResult(_0x1b7b3b,0xc9))[_0x32f8('0x48')](handleError(_0x1b7b3b,null));};exports[_0x32f8('0x26')]=function(_0x2f33f7,_0x234d27){if(_0x2f33f7['body']['id']){delete _0x2f33f7[_0x32f8('0x4a')]['id'];}return db[_0x32f8('0x2d')][_0x32f8('0x47')]({'where':{'id':_0x2f33f7[_0x32f8('0x4b')]['id']}})[_0x32f8('0x28')](handleEntityNotFound(_0x234d27,null))[_0x32f8('0x28')](saveUpdates(_0x2f33f7[_0x32f8('0x4a')],null))[_0x32f8('0x28')](respondWithResult(_0x234d27,null))['catch'](handleError(_0x234d27,null));};exports[_0x32f8('0x27')]=function(_0x5a87e6,_0x515961){return db[_0x32f8('0x2d')]['find']({'where':{'id':_0x5a87e6[_0x32f8('0x4b')]['id']}})[_0x32f8('0x28')](handleEntityNotFound(_0x515961,null))[_0x32f8('0x28')](removeEntity(_0x515961,null))[_0x32f8('0x48')](handleError(_0x515961,null));};exports['describe']=function(_0x2360df,_0x26678a){return db[_0x32f8('0x2d')][_0x32f8('0x4c')]()[_0x32f8('0x28')](respondWithResult(_0x26678a,null))[_0x32f8('0x48')](handleError(_0x26678a,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index cd602d8..641dcd4 100644 --- a/server/api/mailQueueReport/mailQueueReport.model.js +++ b/server/api/mailQueueReport/mailQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x881e=['define','MailQueueReport','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0x881e,0x87));var _0xe881=function(_0x82d0c2,_0x7438ec){_0x82d0c2=_0x82d0c2-0x0;var _0xb07da2=_0x881e[_0x82d0c2];return _0xb07da2;};'use strict';var _=require(_0xe881('0x0'));var util=require(_0xe881('0x1'));var logger=require('../../config/logger')(_0xe881('0x2'));var moment=require(_0xe881('0x3'));var BPromise=require(_0xe881('0x4'));var rp=require(_0xe881('0x5'));var fs=require('fs');var path=require(_0xe881('0x6'));var rimraf=require(_0xe881('0x7'));var config=require('../../config/environment');var attributes=require(_0xe881('0x8'));module['exports']=function(_0x5a4f61,_0x4a6449){return _0x5a4f61[_0xe881('0x9')](_0xe881('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xe881('0xb'),'fields':[_0xe881('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3f2=['define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','./mailQueueReport.attributes'];(function(_0x2e0afd,_0x1a71f7){var _0x4cefad=function(_0x8f4720){while(--_0x8f4720){_0x2e0afd['push'](_0x2e0afd['shift']());}};_0x4cefad(++_0x1a71f7);}(_0xe3f2,0x101));var _0x2e3f=function(_0x2437fe,_0x42c381){_0x2437fe=_0x2437fe-0x0;var _0x346acd=_0xe3f2[_0x2437fe];return _0x346acd;};'use strict';var _=require(_0x2e3f('0x0'));var util=require(_0x2e3f('0x1'));var logger=require(_0x2e3f('0x2'))(_0x2e3f('0x3'));var moment=require('moment');var BPromise=require(_0x2e3f('0x4'));var rp=require(_0x2e3f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e3f('0x6'));module['exports']=function(_0x19756d,_0x101606){return _0x19756d[_0x2e3f('0x7')](_0x2e3f('0x8'),attributes,{'tableName':_0x2e3f('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2e3f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index a88a73d..1dfc1d1 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','update','where','attributes','debug','UpdateMailQueueReport','util','moment','bluebird'];(function(_0x2dc858,_0x2d1db2){var _0xc29ba4=function(_0x32a9f4){while(--_0x32a9f4){_0x2dc858['push'](_0x2dc858['shift']());}};_0xc29ba4(++_0x2d1db2);}(_0x1967,0x173));var _0x7196=function(_0x13a06f,_0x4018bb){_0x13a06f=_0x13a06f-0x0;var _0x450c92=_0x1967[_0x13a06f];return _0x450c92;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});}exports[_0x7196('0x18')]=function(_0x32fe2b){var _0x385f2d=this;return new Promise(function(_0x5b716a,_0x4c4f91){return db[_0x7196('0x19')][_0x7196('0x1a')](_0x32fe2b[_0x7196('0x1b')],{'raw':_0x32fe2b['options']?_0x32fe2b[_0x7196('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x296e07){logger[_0x7196('0xe')](_0x7196('0x18'),_0x32fe2b);logger['debug']('CreateMailQueueReport',_0x32fe2b,JSON[_0x7196('0x12')](_0x296e07));_0x5b716a(_0x296e07);})[_0x7196('0x17')](function(_0x598a26){logger[_0x7196('0x13')](_0x7196('0x18'),_0x598a26[_0x7196('0x15')],_0x32fe2b);_0x4c4f91(_0x385f2d[_0x7196('0x13')](0x1f4,_0x598a26[_0x7196('0x15')]));});});};exports['UpdateMailQueueReport']=function(_0x3f8178){var _0x520d01=this;return new Promise(function(_0x3ce9a0,_0x1b1f4b){return db[_0x7196('0x19')][_0x7196('0x1d')](_0x3f8178[_0x7196('0x1b')],{'raw':_0x3f8178[_0x7196('0x1c')]?_0x3f8178['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f8178[_0x7196('0x1c')]?_0x3f8178[_0x7196('0x1c')][_0x7196('0x1e')]||null:null,'attributes':_0x3f8178['options']?_0x3f8178['options'][_0x7196('0x1f')]||null:null,'limit':_0x3f8178[_0x7196('0x1c')]?_0x3f8178[_0x7196('0x1c')]['limit']||null:null})[_0x7196('0xd')](function(_0x4ecea1){logger[_0x7196('0xe')]('UpdateMailQueueReport',_0x3f8178);logger[_0x7196('0x20')](_0x7196('0x21'),_0x3f8178,JSON[_0x7196('0x12')](_0x4ecea1));_0x3ce9a0(_0x4ecea1);})['catch'](function(_0x35116f){logger[_0x7196('0x13')](_0x7196('0x21'),_0x35116f[_0x7196('0x15')],_0x3f8178);_0x1b1f4b(_0x520d01['error'](0x1f4,_0x35116f[_0x7196('0x15')]));});});}; \ No newline at end of file +var _0xb016=['jayson/promise','client','http','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','debug','update','where','attributes','limit','UpdateMailQueueReport','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5cef69,_0x530479){var _0x44774a=function(_0xfb3f86){while(--_0xfb3f86){_0x5cef69['push'](_0x5cef69['shift']());}};_0x44774a(++_0x530479);}(_0xb016,0x159));var _0x6b01=function(_0x8410d4,_0x319a02){_0x8410d4=_0x8410d4-0x0;var _0x3f87a9=_0xb016[_0x8410d4];return _0x3f87a9;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5759a1,_0x5c5bfb,_0x374aab){return new BPromise(function(_0x39f9fa,_0x526a7d){return client['request'](_0x5759a1,_0x374aab)[_0x6b01('0xa')](function(_0x1cb3a6){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x5c5bfb,_0x6b01('0xd'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'),JSON[_0x6b01('0xe')](_0x1cb3a6));if(_0x1cb3a6[_0x6b01('0xf')]){if(_0x1cb3a6['error'][_0x6b01('0x10')]===0x1f4){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x5c5bfb,_0x1cb3a6[_0x6b01('0xf')]['message']);return _0x526a7d(_0x1cb3a6[_0x6b01('0xf')][_0x6b01('0x11')]);}logger['error'](_0x6b01('0xc'),_0x5c5bfb,_0x1cb3a6['error']['message']);return _0x39f9fa(_0x1cb3a6['error'][_0x6b01('0x11')]);}else{logger['info']('MailQueueReport,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'));_0x39f9fa(_0x1cb3a6[_0x6b01('0x12')][_0x6b01('0x11')]);}})[_0x6b01('0x13')](function(_0x3d7045){logger[_0x6b01('0xf')](_0x6b01('0xc'),_0x5c5bfb,_0x3d7045);_0x526a7d(_0x3d7045);});});}exports[_0x6b01('0x14')]=function(_0x9c6571){var _0xc4e1b1=this;return new Promise(function(_0x18f336,_0x4f2d08){return db[_0x6b01('0x15')][_0x6b01('0x16')](_0x9c6571[_0x6b01('0x17')],{'raw':_0x9c6571[_0x6b01('0x18')]?_0x9c6571[_0x6b01('0x18')][_0x6b01('0x19')]===undefined?!![]:![]:!![]})[_0x6b01('0xa')](function(_0x3c0573){logger['info'](_0x6b01('0x14'),_0x9c6571);logger[_0x6b01('0x1a')](_0x6b01('0x14'),_0x9c6571,JSON[_0x6b01('0xe')](_0x3c0573));_0x18f336(_0x3c0573);})[_0x6b01('0x13')](function(_0x181b09){logger[_0x6b01('0xf')]('CreateMailQueueReport',_0x181b09[_0x6b01('0x11')],_0x9c6571);_0x4f2d08(_0xc4e1b1[_0x6b01('0xf')](0x1f4,_0x181b09[_0x6b01('0x11')]));});});};exports['UpdateMailQueueReport']=function(_0x399808){var _0x70a1c0=this;return new Promise(function(_0x304393,_0x2ae85e){return db[_0x6b01('0x15')][_0x6b01('0x1b')](_0x399808[_0x6b01('0x17')],{'raw':_0x399808[_0x6b01('0x18')]?_0x399808[_0x6b01('0x18')][_0x6b01('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x399808[_0x6b01('0x18')]?_0x399808[_0x6b01('0x18')][_0x6b01('0x1c')]||null:null,'attributes':_0x399808['options']?_0x399808[_0x6b01('0x18')][_0x6b01('0x1d')]||null:null,'limit':_0x399808[_0x6b01('0x18')]?_0x399808[_0x6b01('0x18')][_0x6b01('0x1e')]||null:null})['then'](function(_0x54f030){logger[_0x6b01('0xb')](_0x6b01('0x1f'),_0x399808);logger[_0x6b01('0x1a')](_0x6b01('0x1f'),_0x399808,JSON[_0x6b01('0xe')](_0x54f030));_0x304393(_0x54f030);})[_0x6b01('0x13')](function(_0x542ca0){logger[_0x6b01('0xf')]('UpdateMailQueueReport',_0x542ca0[_0x6b01('0x11')],_0x399808);_0x2ae85e(_0x70a1c0['error'](0x1f4,_0x542ca0[_0x6b01('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 6787cd5..7dfac80 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xada2=['../../config/environment','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xada2,0x12a));var _0x2ada=function(_0x20f1ef,_0x2c6b72){_0x20f1ef=_0x20f1ef-0x0;var _0x5d2ae8=_0xada2[_0x20f1ef];return _0x5d2ae8;};'use strict';var multer=require('multer');var util=require(_0x2ada('0x0'));var path=require('path');var timeout=require(_0x2ada('0x1'));var express=require(_0x2ada('0x2'));var router=express[_0x2ada('0x3')]();var auth=require(_0x2ada('0x4'));var interaction=require(_0x2ada('0x5'));var config=require(_0x2ada('0x6'));module[_0x2ada('0x7')]=router; \ No newline at end of file +var _0x4351=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1be871,_0x19b9e9){var _0x440d08=function(_0x20f88b){while(--_0x20f88b){_0x1be871['push'](_0x1be871['shift']());}};_0x440d08(++_0x19b9e9);}(_0x4351,0x119));var _0x1435=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x4351[_0x6cf19c];return _0xce14f3;};'use strict';var multer=require(_0x1435('0x0'));var util=require(_0x1435('0x1'));var path=require(_0x1435('0x2'));var timeout=require(_0x1435('0x3'));var express=require(_0x1435('0x4'));var router=express['Router']();var auth=require(_0x1435('0x5'));var interaction=require(_0x1435('0x6'));var config=require('../../config/environment');module[_0x1435('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index f315659..6d97795 100644 --- a/server/api/mailServerIn/mailServerIn.attributes.js +++ b/server/api/mailServerIn/mailServerIn.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35b7=['sequelize','exports','STRING','BOOLEAN','username','INTEGER','INBOX'];(function(_0x208a7c,_0x754b1e){var _0x3a3b54=function(_0x5eda68){while(--_0x5eda68){_0x208a7c['push'](_0x208a7c['shift']());}};_0x3a3b54(++_0x754b1e);}(_0x35b7,0x126));var _0x735b=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x35b7[_0x31a371];return _0x2a5bd6;};'use strict';var Sequelize=require(_0x735b('0x0'));module[_0x735b('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x735b('0x2')]},'authentication':{'type':Sequelize[_0x735b('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':_0x735b('0x4')},'password':{'type':Sequelize[_0x735b('0x2')]},'port':{'type':Sequelize[_0x735b('0x5')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x735b('0x2')],'defaultValue':_0x735b('0x6')},'connTimeout':{'type':Sequelize[_0x735b('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x735b('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x735b('0x2')]}}; \ No newline at end of file +var _0x9ab3=['sequelize','STRING','INTEGER','BOOLEAN','INBOX'];(function(_0x5ad44d,_0x30eee8){var _0x258cbd=function(_0x1b9c18){while(--_0x1b9c18){_0x5ad44d['push'](_0x5ad44d['shift']());}};_0x258cbd(++_0x30eee8);}(_0x9ab3,0x104));var _0x39ab=function(_0x1c8dee,_0x3f1ca1){_0x1c8dee=_0x1c8dee-0x0;var _0x2a88c3=_0x9ab3[_0x1c8dee];return _0x2a88c3;};'use strict';var Sequelize=require(_0x39ab('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x39ab('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x39ab('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x39ab('0x2')]},'tls':{'type':Sequelize[_0x39ab('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x39ab('0x1')],'defaultValue':_0x39ab('0x4')},'connTimeout':{'type':Sequelize[_0x39ab('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x39ab('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x39ab('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index bfe1008..032351f 100644 --- a/server/api/mailServerIn/mailServerIn.model.js +++ b/server/api/mailServerIn/mailServerIn.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d05=['./mailServerIn.attributes','MailServerIn','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x16a1f2,_0x31abcb){var _0x28b225=function(_0x3c7cac){while(--_0x3c7cac){_0x16a1f2['push'](_0x16a1f2['shift']());}};_0x28b225(++_0x31abcb);}(_0x8d05,0xe8));var _0x58d0=function(_0x167485,_0x8de1a8){_0x167485=_0x167485-0x0;var _0x49363b=_0x8d05[_0x167485];return _0x49363b;};'use strict';var _=require(_0x58d0('0x0'));var util=require(_0x58d0('0x1'));var logger=require(_0x58d0('0x2'))(_0x58d0('0x3'));var moment=require(_0x58d0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x58d0('0x5'));var rimraf=require(_0x58d0('0x6'));var config=require(_0x58d0('0x7'));var attributes=require(_0x58d0('0x8'));module['exports']=function(_0xdff7f2,_0xb300a9){return _0xdff7f2['define'](_0x58d0('0x9'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfcc=['bluebird','request-promise','exports','define','mail_servers_in','lodash','api','moment'];(function(_0x336ca2,_0x1a813a){var _0xda59a6=function(_0x47caa6){while(--_0x47caa6){_0x336ca2['push'](_0x336ca2['shift']());}};_0xda59a6(++_0x1a813a);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xbfcc[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcbfc('0x1'));var moment=require(_0xcbfc('0x2'));var BPromise=require(_0xcbfc('0x3'));var rp=require(_0xcbfc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0xcbfc('0x5')]=function(_0x2dbb05,_0x537813){return _0x2dbb05[_0xcbfc('0x6')]('MailServerIn',attributes,{'tableName':_0xcbfc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index a52b031..45e37c1 100644 --- a/server/api/mailServerIn/mailServerIn.rpc.js +++ b/server/api/mailServerIn/mailServerIn.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4850=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','error','code','MailServerIn,\x20%s,\x20%s','message','info','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','limit','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x80b502,_0xf96a78){var _0x13f868=function(_0x2d32e4){while(--_0x2d32e4){_0x80b502['push'](_0x80b502['shift']());}};_0x13f868(++_0xf96a78);}(_0x4850,0x7f));var _0x0485=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4850[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x0485('0x0'));var util=require(_0x0485('0x1'));var moment=require(_0x0485('0x2'));var BPromise=require(_0x0485('0x3'));var rs=require(_0x0485('0x4'));var fs=require('fs');var Redis=require(_0x0485('0x5'));var db=require(_0x0485('0x6'))['db'];var utils=require(_0x0485('0x7'));var logger=require(_0x0485('0x8'))('rpc');var config=require(_0x0485('0x9'));var jayson=require(_0x0485('0xa'));var client=jayson[_0x0485('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x319eba,_0x16f7c8,_0x202799){return new BPromise(function(_0x4cf479,_0x419ea1){return client[_0x0485('0xc')](_0x319eba,_0x202799)[_0x0485('0xd')](function(_0x42d438){logger['info']('MailServerIn,\x20%s,\x20%s',_0x16f7c8,_0x0485('0xe'));logger[_0x0485('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x16f7c8,_0x0485('0xe'),JSON['stringify'](_0x42d438));if(_0x42d438['error']){if(_0x42d438[_0x0485('0x10')][_0x0485('0x11')]===0x1f4){logger[_0x0485('0x10')](_0x0485('0x12'),_0x16f7c8,_0x42d438[_0x0485('0x10')]['message']);return _0x419ea1(_0x42d438[_0x0485('0x10')][_0x0485('0x13')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x16f7c8,_0x42d438[_0x0485('0x10')][_0x0485('0x13')]);return _0x4cf479(_0x42d438[_0x0485('0x10')][_0x0485('0x13')]);}else{logger[_0x0485('0x14')]('MailServerIn,\x20%s,\x20%s',_0x16f7c8,_0x0485('0xe'));_0x4cf479(_0x42d438[_0x0485('0x15')][_0x0485('0x13')]);}})[_0x0485('0x16')](function(_0x5f58cb){logger[_0x0485('0x10')](_0x0485('0x12'),_0x16f7c8,_0x5f58cb);_0x419ea1(_0x5f58cb);});});}exports[_0x0485('0x17')]=function(_0x9b83cd){var _0x5e3239=this;return new Promise(function(_0x32ef36,_0x21ad02){return db[_0x0485('0x18')]['findAll']({'raw':_0x9b83cd[_0x0485('0x19')]?_0x9b83cd[_0x0485('0x19')][_0x0485('0x1a')]===undefined?!![]:![]:!![],'where':_0x9b83cd['options']?_0x9b83cd[_0x0485('0x19')][_0x0485('0x1b')]||null:null,'attributes':_0x9b83cd['options']?_0x9b83cd[_0x0485('0x19')][_0x0485('0x1c')]||null:null,'limit':_0x9b83cd[_0x0485('0x19')]?_0x9b83cd[_0x0485('0x19')][_0x0485('0x1d')]||null:null,'include':_0x9b83cd['options']?_0x9b83cd[_0x0485('0x19')][_0x0485('0x1e')]?_[_0x0485('0x1f')](_0x9b83cd['options']['include'],function(_0x323c8e){return{'model':db[_0x323c8e['model']],'as':_0x323c8e['as'],'attributes':_0x323c8e['attributes'],'include':_0x323c8e[_0x0485('0x1e')]?_[_0x0485('0x1f')](_0x323c8e[_0x0485('0x1e')],function(_0x427651){return{'model':db[_0x427651[_0x0485('0x20')]],'as':_0x427651['as'],'attributes':_0x427651[_0x0485('0x1c')],'include':_0x427651['include']?_[_0x0485('0x1f')](_0x427651[_0x0485('0x1e')],function(_0x8ed79f){return{'model':db[_0x8ed79f['model']],'as':_0x8ed79f['as'],'attributes':_0x8ed79f[_0x0485('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xaf934b){logger[_0x0485('0x14')](_0x0485('0x17'),_0x9b83cd);logger[_0x0485('0xf')](_0x0485('0x17'),_0x9b83cd,JSON[_0x0485('0x21')](_0xaf934b));_0x32ef36(_0xaf934b);})[_0x0485('0x16')](function(_0xa87a6f){logger[_0x0485('0x10')]('GetMailServerIn',_0xa87a6f[_0x0485('0x13')],_0x9b83cd);_0x21ad02(_0x5e3239[_0x0485('0x10')](0x1f4,_0xa87a6f['message']));});});}; \ No newline at end of file +var _0x64ce=['rpc','../../config/environment','jayson/promise','client','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailServerIn','findAll','options','raw','where','attributes','include','model','map','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x36feb2,_0x53abef){var _0x292b43=function(_0x52a460){while(--_0x52a460){_0x36feb2['push'](_0x36feb2['shift']());}};_0x292b43(++_0x53abef);}(_0x64ce,0xf8));var _0xe64c=function(_0x358721,_0x7d7c70){_0x358721=_0x358721-0x0;var _0x58583b=_0x64ce[_0x358721];return _0x58583b;};'use strict';var _=require(_0xe64c('0x0'));var util=require(_0xe64c('0x1'));var moment=require(_0xe64c('0x2'));var BPromise=require(_0xe64c('0x3'));var rs=require(_0xe64c('0x4'));var fs=require('fs');var Redis=require(_0xe64c('0x5'));var db=require(_0xe64c('0x6'))['db'];var utils=require(_0xe64c('0x7'));var logger=require('../../config/logger')(_0xe64c('0x8'));var config=require(_0xe64c('0x9'));var jayson=require(_0xe64c('0xa'));var client=jayson[_0xe64c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b4b2e,_0x226b27,_0x1d488f){return new BPromise(function(_0x4b0d81,_0x30afec){return client['request'](_0x1b4b2e,_0x1d488f)[_0xe64c('0xc')](function(_0x3c5bdf){logger[_0xe64c('0xd')](_0xe64c('0xe'),_0x226b27,_0xe64c('0xf'));logger['debug'](_0xe64c('0x10'),_0x226b27,_0xe64c('0xf'),JSON[_0xe64c('0x11')](_0x3c5bdf));if(_0x3c5bdf[_0xe64c('0x12')]){if(_0x3c5bdf['error'][_0xe64c('0x13')]===0x1f4){logger[_0xe64c('0x12')]('MailServerIn,\x20%s,\x20%s',_0x226b27,_0x3c5bdf[_0xe64c('0x12')][_0xe64c('0x14')]);return _0x30afec(_0x3c5bdf[_0xe64c('0x12')][_0xe64c('0x14')]);}logger[_0xe64c('0x12')](_0xe64c('0xe'),_0x226b27,_0x3c5bdf[_0xe64c('0x12')][_0xe64c('0x14')]);return _0x4b0d81(_0x3c5bdf[_0xe64c('0x12')][_0xe64c('0x14')]);}else{logger[_0xe64c('0xd')](_0xe64c('0xe'),_0x226b27,_0xe64c('0xf'));_0x4b0d81(_0x3c5bdf['result'][_0xe64c('0x14')]);}})[_0xe64c('0x15')](function(_0x343a85){logger[_0xe64c('0x12')](_0xe64c('0xe'),_0x226b27,_0x343a85);_0x30afec(_0x343a85);});});}exports[_0xe64c('0x16')]=function(_0xfe88ff){var _0x5b51ba=this;return new Promise(function(_0x329744,_0x2854ff){return db['MailServerIn'][_0xe64c('0x17')]({'raw':_0xfe88ff[_0xe64c('0x18')]?_0xfe88ff[_0xe64c('0x18')][_0xe64c('0x19')]===undefined?!![]:![]:!![],'where':_0xfe88ff[_0xe64c('0x18')]?_0xfe88ff['options'][_0xe64c('0x1a')]||null:null,'attributes':_0xfe88ff['options']?_0xfe88ff['options'][_0xe64c('0x1b')]||null:null,'limit':_0xfe88ff[_0xe64c('0x18')]?_0xfe88ff['options']['limit']||null:null,'include':_0xfe88ff[_0xe64c('0x18')]?_0xfe88ff[_0xe64c('0x18')]['include']?_['map'](_0xfe88ff[_0xe64c('0x18')][_0xe64c('0x1c')],function(_0x5e62db){return{'model':db[_0x5e62db[_0xe64c('0x1d')]],'as':_0x5e62db['as'],'attributes':_0x5e62db[_0xe64c('0x1b')],'include':_0x5e62db[_0xe64c('0x1c')]?_['map'](_0x5e62db[_0xe64c('0x1c')],function(_0x3a3751){return{'model':db[_0x3a3751['model']],'as':_0x3a3751['as'],'attributes':_0x3a3751[_0xe64c('0x1b')],'include':_0x3a3751[_0xe64c('0x1c')]?_[_0xe64c('0x1e')](_0x3a3751[_0xe64c('0x1c')],function(_0x683364){return{'model':db[_0x683364[_0xe64c('0x1d')]],'as':_0x683364['as'],'attributes':_0x683364['attributes']};}):[]};}):[]};}):[]:[]})[_0xe64c('0xc')](function(_0x30ba53){logger['info'](_0xe64c('0x16'),_0xfe88ff);logger[_0xe64c('0x1f')]('GetMailServerIn',_0xfe88ff,JSON[_0xe64c('0x11')](_0x30ba53));_0x329744(_0x30ba53);})[_0xe64c('0x15')](function(_0x5681ca){logger[_0xe64c('0x12')](_0xe64c('0x16'),_0x5681ca[_0xe64c('0x14')],_0xfe88ff);_0x2854ff(_0x5b51ba[_0xe64c('0x12')](0x1f4,_0x5681ca[_0xe64c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index a3f8260..d1d5437 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f06=['isAuthenticated','index','get','show','put','/:id','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller'];(function(_0x2968cd,_0x39edf6){var _0x10c3e8=function(_0x1e2ca8){while(--_0x1e2ca8){_0x2968cd['push'](_0x2968cd['shift']());}};_0x10c3e8(++_0x39edf6);}(_0x1f06,0x106));var _0x61f0=function(_0x1274f0,_0x5389b0){_0x1274f0=_0x1274f0-0x0;var _0x5260c0=_0x1f06[_0x1274f0];return _0x5260c0;};'use strict';var multer=require(_0x61f0('0x0'));var util=require(_0x61f0('0x1'));var path=require(_0x61f0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x61f0('0x3')]();var auth=require(_0x61f0('0x4'));var interaction=require(_0x61f0('0x5'));var config=require(_0x61f0('0x6'));var controller=require(_0x61f0('0x7'));router['get']('/',auth[_0x61f0('0x8')](),controller[_0x61f0('0x9')]);router[_0x61f0('0xa')]('/:id',auth[_0x61f0('0x8')](),controller[_0x61f0('0xb')]);router['post']('/',auth[_0x61f0('0x8')](),controller['create']);router[_0x61f0('0xc')](_0x61f0('0xd'),auth[_0x61f0('0x8')](),controller[_0x61f0('0xe')]);router[_0x61f0('0xf')]('/:id',auth[_0x61f0('0x8')](),controller[_0x61f0('0x10')]);module[_0x61f0('0x11')]=router; \ No newline at end of file +var _0x347b=['get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2441d0,_0x76017){var _0x5d917f=function(_0x13cbe5){while(--_0x13cbe5){_0x2441d0['push'](_0x2441d0['shift']());}};_0x5d917f(++_0x76017);}(_0x347b,0x1ac));var _0xb347=function(_0x495f3c,_0x592bbe){_0x495f3c=_0x495f3c-0x0;var _0x4b97ee=_0x347b[_0x495f3c];return _0x4b97ee;};'use strict';var multer=require(_0xb347('0x0'));var util=require(_0xb347('0x1'));var path=require(_0xb347('0x2'));var timeout=require(_0xb347('0x3'));var express=require(_0xb347('0x4'));var router=express[_0xb347('0x5')]();var auth=require(_0xb347('0x6'));var interaction=require(_0xb347('0x7'));var config=require(_0xb347('0x8'));var controller=require('./mailServerOut.controller');router[_0xb347('0x9')]('/',auth[_0xb347('0xa')](),controller[_0xb347('0xb')]);router[_0xb347('0x9')](_0xb347('0xc'),auth[_0xb347('0xa')](),controller[_0xb347('0xd')]);router[_0xb347('0xe')]('/',auth[_0xb347('0xa')](),controller['create']);router[_0xb347('0xf')](_0xb347('0xc'),auth['isAuthenticated'](),controller[_0xb347('0x10')]);router[_0xb347('0x11')](_0xb347('0xc'),auth[_0xb347('0xa')](),controller[_0xb347('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index a6c2002..371e757 100644 --- a/server/api/mailServerOut/mailServerOut.attributes.js +++ b/server/api/mailServerOut/mailServerOut.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6003=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x150ed9,_0x4fb6c3){var _0x4a83b8=function(_0x31d011){while(--_0x31d011){_0x150ed9['push'](_0x150ed9['shift']());}};_0x4a83b8(++_0x4fb6c3);}(_0x6003,0xae));var _0x3600=function(_0x302bdc,_0x437984){_0x302bdc=_0x302bdc-0x0;var _0x20252d=_0x6003[_0x302bdc];return _0x20252d;};'use strict';var Sequelize=require(_0x3600('0x0'));module[_0x3600('0x1')]={'description':{'type':Sequelize[_0x3600('0x2')]},'host':{'type':Sequelize[_0x3600('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3600('0x3')]},'secure':{'type':Sequelize[_0x3600('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x3600('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x5549=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x4c43ab,_0x331ded){var _0x130139=function(_0x534574){while(--_0x534574){_0x4c43ab['push'](_0x4c43ab['shift']());}};_0x130139(++_0x331ded);}(_0x5549,0x1f4));var _0x9554=function(_0x2a4c95,_0x417d20){_0x2a4c95=_0x2a4c95-0x0;var _0x17d254=_0x5549[_0x2a4c95];return _0x17d254;};'use strict';var Sequelize=require(_0x9554('0x0'));module[_0x9554('0x1')]={'description':{'type':Sequelize[_0x9554('0x2')]},'host':{'type':Sequelize[_0x9554('0x2')]},'user':{'type':Sequelize[_0x9554('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x9554('0x3')]},'secure':{'type':Sequelize[_0x9554('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x9554('0x2')]},'authentication':{'type':Sequelize[_0x9554('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 311e5fb..a03a8b2 100644 --- a/server/api/mailServerOut/mailServerOut.controller.js +++ b/server/api/mailServerOut/mailServerOut.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x503b=['request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','MailServerOut','merge','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5a50a0,_0x22baf6){var _0x18bc1a=function(_0x27fca5){while(--_0x27fca5){_0x5a50a0['push'](_0x5a50a0['shift']());}};_0x18bc1a(++_0x22baf6);}(_0x503b,0xdf));var _0xb503=function(_0x18b764,_0x3f066c){_0x18b764=_0x18b764-0x0;var _0x58828a=_0x503b[_0x18b764];return _0x58828a;};'use strict';var pdf=require(_0xb503('0x0'));var emlformat=require(_0xb503('0x1'));var rimraf=require(_0xb503('0x2'));var zipdir=require(_0xb503('0x3'));var jsonpatch=require(_0xb503('0x4'));var rp=require(_0xb503('0x5'));var moment=require(_0xb503('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb503('0x7'));var util=require(_0xb503('0x8'));var path=require(_0xb503('0x9'));var sox=require(_0xb503('0xa'));var csv=require(_0xb503('0xb'));var ejs=require(_0xb503('0xc'));var fs=require('fs');var _=require(_0xb503('0xd'));var squel=require(_0xb503('0xe'));var crypto=require(_0xb503('0xf'));var jsforce=require(_0xb503('0x10'));var deskjs=require(_0xb503('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb503('0x12'));var Redis=require(_0xb503('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb503('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb503('0x15'))('api');var utils=require(_0xb503('0x16'));var config=require('../../config/environment');var db=require(_0xb503('0x17'))['db'];function respondWithStatusCode(_0x1ec79d,_0x50acb5){_0x50acb5=_0x50acb5||0xcc;return function(_0x31d2ed){if(_0x31d2ed){return _0x1ec79d[_0xb503('0x18')](_0x50acb5);}return _0x1ec79d['status'](_0x50acb5)[_0xb503('0x19')]();};}function respondWithResult(_0x2d3012,_0x36fbd7){_0x36fbd7=_0x36fbd7||0xc8;return function(_0x23a4b2){if(_0x23a4b2){return _0x2d3012[_0xb503('0x1a')](_0x36fbd7)[_0xb503('0x1b')](_0x23a4b2);}};}function respondWithFilteredResult(_0x4db791,_0x163287){return function(_0x2574bc){if(_0x2574bc){var _0x494aef=_0x2574bc[_0xb503('0x1c')],_0x28b0a0=_0x163287[_0xb503('0x1d')],_0x2a02ee=_0x163287[_0xb503('0x1d')]+_0x163287[_0xb503('0x1e')],_0x3e6beb;if(_0x2a02ee>=_0x494aef){_0x2a02ee=_0x494aef;_0x3e6beb=0xc8;}else{_0x3e6beb=0xce;}_0x4db791[_0xb503('0x1a')](_0x3e6beb);return _0x4db791[_0xb503('0x1f')](_0xb503('0x20'),_0x28b0a0+'-'+_0x2a02ee+'/'+_0x494aef)[_0xb503('0x1b')](_0x2574bc);}return null;};}function patchUpdates(_0xc433ec){return function(_0x5000b5){try{jsonpatch[_0xb503('0x21')](_0x5000b5,_0xc433ec,!![]);}catch(_0x58e77e){return BPromise[_0xb503('0x22')](_0x58e77e);}return _0x5000b5[_0xb503('0x23')]();};}function saveUpdates(_0x3cedba,_0x30864f){return function(_0x41b5f2){if(_0x41b5f2){return _0x41b5f2['update'](_0x3cedba)[_0xb503('0x24')](function(_0x50b989){return _0x50b989;});}return null;};}function removeEntity(_0x3103e6,_0x3e3d44){return function(_0x6bbafb){if(_0x6bbafb){return _0x6bbafb[_0xb503('0x25')]()['then'](function(){_0x3103e6['status'](0xcc)[_0xb503('0x19')]();});}};}function handleEntityNotFound(_0x44f4cb,_0x556008){return function(_0x2862f3){if(!_0x2862f3){_0x44f4cb[_0xb503('0x18')](0x194);}return _0x2862f3;};}function handleError(_0x453325,_0x47f772){_0x47f772=_0x47f772||0x1f4;return function(_0xd5b526){logger[_0xb503('0x26')](_0xd5b526[_0xb503('0x27')]);if(_0xd5b526[_0xb503('0x28')]){delete _0xd5b526[_0xb503('0x28')];}_0x453325[_0xb503('0x1a')](_0x47f772)[_0xb503('0x29')](_0xd5b526);};}exports[_0xb503('0x2a')]=function(_0x2b5596,_0x18f55b){var _0x153817={},_0x3a4560={},_0x426c0f={'count':0x0,'rows':[]};var _0x39c225=db['MailServerOut'][_0xb503('0x2b')];_0x3a4560['model']=_[_0xb503('0x2c')](_0x39c225);_0x3a4560[_0xb503('0x2d')]=_[_0xb503('0x2c')](_0x2b5596[_0xb503('0x2d')]);_0x3a4560[_0xb503('0x2e')]=_[_0xb503('0x2f')](_0x3a4560[_0xb503('0x30')],_0x3a4560['query']);_0x153817[_0xb503('0x31')]=_[_0xb503('0x2f')](_0x3a4560[_0xb503('0x30')],qs[_0xb503('0x32')](_0x2b5596[_0xb503('0x2d')][_0xb503('0x32')]));_0x153817[_0xb503('0x31')]=_0x153817[_0xb503('0x31')][_0xb503('0x33')]?_0x153817[_0xb503('0x31')]:_0x3a4560[_0xb503('0x30')];if(!_0x2b5596[_0xb503('0x2d')][_0xb503('0x34')]('nolimit')){_0x153817[_0xb503('0x1e')]=qs[_0xb503('0x1e')](_0x2b5596[_0xb503('0x2d')][_0xb503('0x1e')]);_0x153817[_0xb503('0x1d')]=qs[_0xb503('0x1d')](_0x2b5596['query']['offset']);}_0x153817[_0xb503('0x35')]=qs['sort'](_0x2b5596[_0xb503('0x2d')][_0xb503('0x36')]);_0x153817[_0xb503('0x37')]=qs[_0xb503('0x2e')](_[_0xb503('0x38')](_0x2b5596['query'],_0x3a4560[_0xb503('0x2e')]));if(_0x2b5596[_0xb503('0x2d')][_0xb503('0x39')]){_0x153817[_0xb503('0x37')]=_['merge'](_0x153817[_0xb503('0x37')],{'$or':_[_0xb503('0x3a')](_0x39c225,function(_0xa4fc3d){if(_0xa4fc3d['type'][_0xb503('0x3b')]!==_0xb503('0x3c')){var _0x40356c={};_0x40356c[_0xa4fc3d[_0xb503('0x3d')]]={'$like':'%'+_0x2b5596[_0xb503('0x2d')]['filter']+'%'};return _0x40356c;}})});}_0x153817=_['merge']({},_0x153817,_0x2b5596[_0xb503('0x3e')]);var _0x1bffc8={'where':_0x153817[_0xb503('0x37')]};return db['MailServerOut'][_0xb503('0x1c')](_0x1bffc8)[_0xb503('0x24')](function(_0x95a9bf){_0x426c0f[_0xb503('0x1c')]=_0x95a9bf;if(_0x2b5596[_0xb503('0x2d')][_0xb503('0x3f')]){_0x153817[_0xb503('0x40')]=[{'all':!![]}];}return db['MailServerOut'][_0xb503('0x41')](_0x153817);})['then'](function(_0x366b33){_0x426c0f[_0xb503('0x42')]=_0x366b33;return _0x426c0f;})[_0xb503('0x24')](respondWithFilteredResult(_0x18f55b,_0x153817))[_0xb503('0x43')](handleError(_0x18f55b,null));};exports[_0xb503('0x44')]=function(_0x3cfcbb,_0x2f11dd){var _0x6cef71={'raw':!![],'where':{'id':_0x3cfcbb[_0xb503('0x45')]['id']}},_0x5aafcc={};_0x5aafcc['model']=_[_0xb503('0x2c')](db[_0xb503('0x46')][_0xb503('0x2b')]);_0x5aafcc[_0xb503('0x2d')]=_[_0xb503('0x2c')](_0x3cfcbb['query']);_0x5aafcc[_0xb503('0x2e')]=_['intersection'](_0x5aafcc[_0xb503('0x30')],_0x5aafcc[_0xb503('0x2d')]);_0x6cef71[_0xb503('0x31')]=_['intersection'](_0x5aafcc['model'],qs[_0xb503('0x32')](_0x3cfcbb[_0xb503('0x2d')][_0xb503('0x32')]));_0x6cef71[_0xb503('0x31')]=_0x6cef71[_0xb503('0x31')]['length']?_0x6cef71[_0xb503('0x31')]:_0x5aafcc[_0xb503('0x30')];if(_0x3cfcbb[_0xb503('0x2d')][_0xb503('0x3f')]){_0x6cef71[_0xb503('0x40')]=[{'all':!![]}];}_0x6cef71=_[_0xb503('0x47')]({},_0x6cef71,_0x3cfcbb[_0xb503('0x3e')]);return db[_0xb503('0x46')][_0xb503('0x48')](_0x6cef71)[_0xb503('0x24')](handleEntityNotFound(_0x2f11dd,null))[_0xb503('0x24')](respondWithResult(_0x2f11dd,null))[_0xb503('0x43')](handleError(_0x2f11dd,null));};exports[_0xb503('0x49')]=function(_0x3ce898,_0x2fbf0a){return db['MailServerOut'][_0xb503('0x49')](_0x3ce898[_0xb503('0x4a')],{})[_0xb503('0x24')](respondWithResult(_0x2fbf0a,0xc9))['catch'](handleError(_0x2fbf0a,null));};exports[_0xb503('0x4b')]=function(_0xcfb789,_0x393767){if(_0xcfb789[_0xb503('0x4a')]['id']){delete _0xcfb789[_0xb503('0x4a')]['id'];}return db[_0xb503('0x46')][_0xb503('0x48')]({'where':{'id':_0xcfb789[_0xb503('0x45')]['id']}})[_0xb503('0x24')](handleEntityNotFound(_0x393767,null))[_0xb503('0x24')](saveUpdates(_0xcfb789[_0xb503('0x4a')],null))[_0xb503('0x24')](respondWithResult(_0x393767,null))[_0xb503('0x43')](handleError(_0x393767,null));};exports[_0xb503('0x25')]=function(_0x5e2e1e,_0x33464f){return db['MailServerOut'][_0xb503('0x48')]({'where':{'id':_0x5e2e1e[_0xb503('0x45')]['id']}})[_0xb503('0x24')](handleEntityNotFound(_0x33464f,null))['then'](removeEntity(_0x33464f,null))[_0xb503('0x43')](handleError(_0x33464f,null));}; \ No newline at end of file +var _0xb40b=['options','includeAll','include','findAll','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','fast-json-patch','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','MailServerOut','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','key','VIRTUAL','field'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xb40b,0x126));var _0xbb40=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xb40b[_0x3d42d8];return _0x27fc41;};'use strict';var pdf=require(_0xbb40('0x0'));var emlformat=require(_0xbb40('0x1'));var rimraf=require(_0xbb40('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb40('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbb40('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbb40('0x5'));var csv=require(_0xbb40('0x6'));var ejs=require(_0xbb40('0x7'));var fs=require('fs');var _=require(_0xbb40('0x8'));var squel=require(_0xbb40('0x9'));var crypto=require(_0xbb40('0xa'));var jsforce=require(_0xbb40('0xb'));var deskjs=require(_0xbb40('0xc'));var toCsv=require(_0xbb40('0x6'));var querystring=require(_0xbb40('0xd'));var Papa=require(_0xbb40('0xe'));var Redis=require(_0xbb40('0xf'));var authService=require(_0xbb40('0x10'));var qs=require(_0xbb40('0x11'));var hardwareService=require(_0xbb40('0x12'));var logger=require(_0xbb40('0x13'))(_0xbb40('0x14'));var utils=require(_0xbb40('0x15'));var config=require(_0xbb40('0x16'));var db=require(_0xbb40('0x17'))['db'];function respondWithStatusCode(_0x5857e0,_0x3052d0){_0x3052d0=_0x3052d0||0xcc;return function(_0x5931ac){if(_0x5931ac){return _0x5857e0['sendStatus'](_0x3052d0);}return _0x5857e0[_0xbb40('0x18')](_0x3052d0)[_0xbb40('0x19')]();};}function respondWithResult(_0x335f33,_0x229f13){_0x229f13=_0x229f13||0xc8;return function(_0x5d802c){if(_0x5d802c){return _0x335f33[_0xbb40('0x18')](_0x229f13)['json'](_0x5d802c);}};}function respondWithFilteredResult(_0x18b166,_0x44e9b8){return function(_0x3d5fad){if(_0x3d5fad){var _0x31ee42=_0x3d5fad[_0xbb40('0x1a')],_0x5e1bbc=_0x44e9b8['offset'],_0x588f4c=_0x44e9b8[_0xbb40('0x1b')]+_0x44e9b8[_0xbb40('0x1c')],_0x82729f;if(_0x588f4c>=_0x31ee42){_0x588f4c=_0x31ee42;_0x82729f=0xc8;}else{_0x82729f=0xce;}_0x18b166[_0xbb40('0x18')](_0x82729f);return _0x18b166[_0xbb40('0x1d')](_0xbb40('0x1e'),_0x5e1bbc+'-'+_0x588f4c+'/'+_0x31ee42)['json'](_0x3d5fad);}return null;};}function patchUpdates(_0x401e66){return function(_0x174eb3){try{jsonpatch[_0xbb40('0x1f')](_0x174eb3,_0x401e66,!![]);}catch(_0x39039f){return BPromise[_0xbb40('0x20')](_0x39039f);}return _0x174eb3[_0xbb40('0x21')]();};}function saveUpdates(_0x55cbb7,_0x5cefb2){return function(_0x2b8ed4){if(_0x2b8ed4){return _0x2b8ed4[_0xbb40('0x22')](_0x55cbb7)[_0xbb40('0x23')](function(_0x37b05d){return _0x37b05d;});}return null;};}function removeEntity(_0x185b67,_0x7bd89f){return function(_0x49493d){if(_0x49493d){return _0x49493d['destroy']()[_0xbb40('0x23')](function(){_0x185b67[_0xbb40('0x18')](0xcc)[_0xbb40('0x19')]();});}};}function handleEntityNotFound(_0x308025,_0x2edb40){return function(_0x15e4e8){if(!_0x15e4e8){_0x308025[_0xbb40('0x24')](0x194);}return _0x15e4e8;};}function handleError(_0x339330,_0xfd445e){_0xfd445e=_0xfd445e||0x1f4;return function(_0x273a88){logger[_0xbb40('0x25')](_0x273a88['stack']);if(_0x273a88[_0xbb40('0x26')]){delete _0x273a88[_0xbb40('0x26')];}_0x339330[_0xbb40('0x18')](_0xfd445e)[_0xbb40('0x27')](_0x273a88);};}exports[_0xbb40('0x28')]=function(_0xdba07a,_0x30acc7){var _0x2f6855={},_0x10d44c={},_0x240873={'count':0x0,'rows':[]};var _0x4b3b35=db[_0xbb40('0x29')][_0xbb40('0x2a')];_0x10d44c[_0xbb40('0x2b')]=_[_0xbb40('0x2c')](_0x4b3b35);_0x10d44c[_0xbb40('0x2d')]=_[_0xbb40('0x2c')](_0xdba07a[_0xbb40('0x2d')]);_0x10d44c[_0xbb40('0x2e')]=_[_0xbb40('0x2f')](_0x10d44c['model'],_0x10d44c[_0xbb40('0x2d')]);_0x2f6855[_0xbb40('0x30')]=_[_0xbb40('0x2f')](_0x10d44c[_0xbb40('0x2b')],qs[_0xbb40('0x31')](_0xdba07a['query'][_0xbb40('0x31')]));_0x2f6855[_0xbb40('0x30')]=_0x2f6855[_0xbb40('0x30')][_0xbb40('0x32')]?_0x2f6855['attributes']:_0x10d44c[_0xbb40('0x2b')];if(!_0xdba07a[_0xbb40('0x2d')][_0xbb40('0x33')]('nolimit')){_0x2f6855[_0xbb40('0x1c')]=qs[_0xbb40('0x1c')](_0xdba07a[_0xbb40('0x2d')][_0xbb40('0x1c')]);_0x2f6855[_0xbb40('0x1b')]=qs['offset'](_0xdba07a[_0xbb40('0x2d')]['offset']);}_0x2f6855[_0xbb40('0x34')]=qs[_0xbb40('0x35')](_0xdba07a[_0xbb40('0x2d')][_0xbb40('0x35')]);_0x2f6855[_0xbb40('0x36')]=qs[_0xbb40('0x2e')](_[_0xbb40('0x37')](_0xdba07a[_0xbb40('0x2d')],_0x10d44c[_0xbb40('0x2e')]));if(_0xdba07a[_0xbb40('0x2d')]['filter']){_0x2f6855[_0xbb40('0x36')]=_[_0xbb40('0x38')](_0x2f6855[_0xbb40('0x36')],{'$or':_[_0xbb40('0x39')](_0x4b3b35,function(_0x212a65){if(_0x212a65['type'][_0xbb40('0x3a')]!==_0xbb40('0x3b')){var _0x286b08={};_0x286b08[_0x212a65[_0xbb40('0x3c')]]={'$like':'%'+_0xdba07a[_0xbb40('0x2d')]['filter']+'%'};return _0x286b08;}})});}_0x2f6855=_['merge']({},_0x2f6855,_0xdba07a[_0xbb40('0x3d')]);var _0xc18171={'where':_0x2f6855[_0xbb40('0x36')]};return db[_0xbb40('0x29')]['count'](_0xc18171)[_0xbb40('0x23')](function(_0x3333e0){_0x240873[_0xbb40('0x1a')]=_0x3333e0;if(_0xdba07a[_0xbb40('0x2d')][_0xbb40('0x3e')]){_0x2f6855[_0xbb40('0x3f')]=[{'all':!![]}];}return db[_0xbb40('0x29')][_0xbb40('0x40')](_0x2f6855);})[_0xbb40('0x23')](function(_0x1c51df){_0x240873['rows']=_0x1c51df;return _0x240873;})[_0xbb40('0x23')](respondWithFilteredResult(_0x30acc7,_0x2f6855))[_0xbb40('0x41')](handleError(_0x30acc7,null));};exports[_0xbb40('0x42')]=function(_0x1dc877,_0x3ea595){var _0x2e4b01={'raw':!![],'where':{'id':_0x1dc877['params']['id']}},_0x189ddb={};_0x189ddb['model']=_[_0xbb40('0x2c')](db[_0xbb40('0x29')][_0xbb40('0x2a')]);_0x189ddb[_0xbb40('0x2d')]=_[_0xbb40('0x2c')](_0x1dc877[_0xbb40('0x2d')]);_0x189ddb['filters']=_['intersection'](_0x189ddb[_0xbb40('0x2b')],_0x189ddb[_0xbb40('0x2d')]);_0x2e4b01['attributes']=_['intersection'](_0x189ddb[_0xbb40('0x2b')],qs['fields'](_0x1dc877[_0xbb40('0x2d')][_0xbb40('0x31')]));_0x2e4b01[_0xbb40('0x30')]=_0x2e4b01[_0xbb40('0x30')][_0xbb40('0x32')]?_0x2e4b01['attributes']:_0x189ddb[_0xbb40('0x2b')];if(_0x1dc877[_0xbb40('0x2d')]['includeAll']){_0x2e4b01[_0xbb40('0x3f')]=[{'all':!![]}];}_0x2e4b01=_[_0xbb40('0x38')]({},_0x2e4b01,_0x1dc877[_0xbb40('0x3d')]);return db[_0xbb40('0x29')][_0xbb40('0x43')](_0x2e4b01)[_0xbb40('0x23')](handleEntityNotFound(_0x3ea595,null))[_0xbb40('0x23')](respondWithResult(_0x3ea595,null))[_0xbb40('0x41')](handleError(_0x3ea595,null));};exports[_0xbb40('0x44')]=function(_0x1beffa,_0x325207){return db[_0xbb40('0x29')][_0xbb40('0x44')](_0x1beffa[_0xbb40('0x45')],{})[_0xbb40('0x23')](respondWithResult(_0x325207,0xc9))['catch'](handleError(_0x325207,null));};exports[_0xbb40('0x22')]=function(_0x20d249,_0x2eafe7){if(_0x20d249[_0xbb40('0x45')]['id']){delete _0x20d249[_0xbb40('0x45')]['id'];}return db[_0xbb40('0x29')][_0xbb40('0x43')]({'where':{'id':_0x20d249[_0xbb40('0x46')]['id']}})[_0xbb40('0x23')](handleEntityNotFound(_0x2eafe7,null))[_0xbb40('0x23')](saveUpdates(_0x20d249[_0xbb40('0x45')],null))['then'](respondWithResult(_0x2eafe7,null))[_0xbb40('0x41')](handleError(_0x2eafe7,null));};exports['destroy']=function(_0x4215ba,_0x4d83e3){return db[_0xbb40('0x29')][_0xbb40('0x43')]({'where':{'id':_0x4215ba[_0xbb40('0x46')]['id']}})[_0xbb40('0x23')](handleEntityNotFound(_0x4d83e3,null))[_0xbb40('0x23')](removeEntity(_0x4d83e3,null))['catch'](handleError(_0x4d83e3,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index aed2bb9..f56c3ac 100644 --- a/server/api/mailServerOut/mailServerOut.model.js +++ b/server/api/mailServerOut/mailServerOut.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x7217,0x19e));var _0x7721=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7217[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0x7217,0x19e));var _0x7721=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x7217[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 38597ee..30e9fc5 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e2b=['catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailServerOut,\x20%s,\x20%s','result'];(function(_0x1e11c2,_0x1bcbca){var _0x4faa44=function(_0x4c3bf3){while(--_0x4c3bf3){_0x1e11c2['push'](_0x1e11c2['shift']());}};_0x4faa44(++_0x1bcbca);}(_0x4e2b,0xd9));var _0xb4e2=function(_0x53fd42,_0x44608b){_0x53fd42=_0x53fd42-0x0;var _0x41c1b5=_0x4e2b[_0x53fd42];return _0x41c1b5;};'use strict';var _=require('lodash');var util=require(_0xb4e2('0x0'));var moment=require('moment');var BPromise=require(_0xb4e2('0x1'));var rs=require(_0xb4e2('0x2'));var fs=require('fs');var Redis=require(_0xb4e2('0x3'));var db=require(_0xb4e2('0x4'))['db'];var utils=require(_0xb4e2('0x5'));var logger=require(_0xb4e2('0x6'))(_0xb4e2('0x7'));var config=require(_0xb4e2('0x8'));var jayson=require(_0xb4e2('0x9'));var client=jayson[_0xb4e2('0xa')][_0xb4e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc09e86,_0x2aabb7,_0x57bab2){return new BPromise(function(_0x2efd7e,_0x49d674){return client['request'](_0xc09e86,_0x57bab2)[_0xb4e2('0xc')](function(_0xb0d120){logger[_0xb4e2('0xd')]('MailServerOut,\x20%s,\x20%s',_0x2aabb7,_0xb4e2('0xe'));logger[_0xb4e2('0xf')](_0xb4e2('0x10'),_0x2aabb7,'request\x20sent',JSON[_0xb4e2('0x11')](_0xb0d120));if(_0xb0d120[_0xb4e2('0x12')]){if(_0xb0d120[_0xb4e2('0x12')][_0xb4e2('0x13')]===0x1f4){logger['error']('MailServerOut,\x20%s,\x20%s',_0x2aabb7,_0xb0d120[_0xb4e2('0x12')]['message']);return _0x49d674(_0xb0d120[_0xb4e2('0x12')][_0xb4e2('0x14')]);}logger[_0xb4e2('0x12')](_0xb4e2('0x15'),_0x2aabb7,_0xb0d120['error'][_0xb4e2('0x14')]);return _0x2efd7e(_0xb0d120[_0xb4e2('0x12')][_0xb4e2('0x14')]);}else{logger['info']('MailServerOut,\x20%s,\x20%s',_0x2aabb7,'request\x20sent');_0x2efd7e(_0xb0d120[_0xb4e2('0x16')][_0xb4e2('0x14')]);}})[_0xb4e2('0x17')](function(_0x31c209){logger[_0xb4e2('0x12')]('MailServerOut,\x20%s,\x20%s',_0x2aabb7,_0x31c209);_0x49d674(_0x31c209);});});} \ No newline at end of file +var _0xd297=['stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1deba7,_0x30f270){var _0x2dcc31=function(_0x57a708){while(--_0x57a708){_0x1deba7['push'](_0x1deba7['shift']());}};_0x2dcc31(++_0x30f270);}(_0xd297,0x18d));var _0x7d29=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd297[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x7d29('0x0'));var moment=require(_0x7d29('0x1'));var BPromise=require(_0x7d29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d29('0x3'));var db=require(_0x7d29('0x4'))['db'];var utils=require(_0x7d29('0x5'));var logger=require(_0x7d29('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7d29('0x7'));var client=jayson[_0x7d29('0x8')][_0x7d29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41f773,_0x5ae77d,_0x5a9562){return new BPromise(function(_0x25fbaf,_0x2e7fe4){return client[_0x7d29('0xa')](_0x41f773,_0x5a9562)[_0x7d29('0xb')](function(_0x356145){logger[_0x7d29('0xc')](_0x7d29('0xd'),_0x5ae77d,'request\x20sent');logger[_0x7d29('0xe')](_0x7d29('0xf'),_0x5ae77d,_0x7d29('0x10'),JSON[_0x7d29('0x11')](_0x356145));if(_0x356145[_0x7d29('0x12')]){if(_0x356145[_0x7d29('0x12')][_0x7d29('0x13')]===0x1f4){logger['error'](_0x7d29('0xd'),_0x5ae77d,_0x356145[_0x7d29('0x12')][_0x7d29('0x14')]);return _0x2e7fe4(_0x356145[_0x7d29('0x12')][_0x7d29('0x14')]);}logger[_0x7d29('0x12')](_0x7d29('0xd'),_0x5ae77d,_0x356145[_0x7d29('0x12')][_0x7d29('0x14')]);return _0x25fbaf(_0x356145[_0x7d29('0x12')]['message']);}else{logger[_0x7d29('0xc')](_0x7d29('0xd'),_0x5ae77d,_0x7d29('0x10'));_0x25fbaf(_0x356145[_0x7d29('0x15')][_0x7d29('0x14')]);}})[_0x7d29('0x16')](function(_0x1974a6){logger[_0x7d29('0x12')](_0x7d29('0xd'),_0x5ae77d,_0x1974a6);_0x2e7fe4(_0x1974a6);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 9c8ed3a..091adf6 100644 --- a/server/api/mailSubstatus/index.js +++ b/server/api/mailSubstatus/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa38=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./mailSubstatus.controller','index','get','isAuthenticated'];(function(_0x35640f,_0x3351bb){var _0x508de1=function(_0x4efcbf){while(--_0x4efcbf){_0x35640f['push'](_0x35640f['shift']());}};_0x508de1(++_0x3351bb);}(_0xfa38,0x139));var _0x8fa3=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xfa38[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x8fa3('0x0'));var util=require(_0x8fa3('0x1'));var path=require('path');var timeout=require(_0x8fa3('0x2'));var express=require(_0x8fa3('0x3'));var router=express['Router']();var auth=require(_0x8fa3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8fa3('0x5'));var controller=require(_0x8fa3('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x8fa3('0x7')]);router[_0x8fa3('0x8')]('/describe',auth[_0x8fa3('0x9')](),controller[_0x8fa3('0xa')]);router['get'](_0x8fa3('0xb'),auth[_0x8fa3('0x9')](),controller['show']);router[_0x8fa3('0xc')]('/',auth[_0x8fa3('0x9')](),controller[_0x8fa3('0xd')]);router[_0x8fa3('0xe')](_0x8fa3('0xb'),auth['isAuthenticated'](),controller[_0x8fa3('0xf')]);router[_0x8fa3('0x10')]('/:id',auth[_0x8fa3('0x9')](),controller[_0x8fa3('0x11')]);module[_0x8fa3('0x12')]=router; \ No newline at end of file +var _0x8506=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','post','create','put','update','delete','/:id','destroy','exports','multer','util','path'];(function(_0x466b8f,_0x1369d1){var _0x376acd=function(_0x4508f3){while(--_0x4508f3){_0x466b8f['push'](_0x466b8f['shift']());}};_0x376acd(++_0x1369d1);}(_0x8506,0x13f));var _0x6850=function(_0x215b73,_0x4802fa){_0x215b73=_0x215b73-0x0;var _0x265aae=_0x8506[_0x215b73];return _0x265aae;};'use strict';var multer=require(_0x6850('0x0'));var util=require(_0x6850('0x1'));var path=require(_0x6850('0x2'));var timeout=require(_0x6850('0x3'));var express=require(_0x6850('0x4'));var router=express[_0x6850('0x5')]();var auth=require(_0x6850('0x6'));var interaction=require(_0x6850('0x7'));var config=require(_0x6850('0x8'));var controller=require(_0x6850('0x9'));router[_0x6850('0xa')]('/',auth[_0x6850('0xb')](),controller[_0x6850('0xc')]);router[_0x6850('0xa')](_0x6850('0xd'),auth[_0x6850('0xb')](),controller[_0x6850('0xe')]);router[_0x6850('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6850('0xf')]('/',auth[_0x6850('0xb')](),controller[_0x6850('0x10')]);router[_0x6850('0x11')]('/:id',auth[_0x6850('0xb')](),controller[_0x6850('0x12')]);router[_0x6850('0x13')](_0x6850('0x14'),auth[_0x6850('0xb')](),controller[_0x6850('0x15')]);module[_0x6850('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 05be13f..0c20e45 100644 --- a/server/api/mailSubstatus/mailSubstatus.attributes.js +++ b/server/api/mailSubstatus/mailSubstatus.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x110e=['sequelize','exports','name','STRING'];(function(_0x2e20e8,_0x4ee108){var _0x5149e0=function(_0x34aec5){while(--_0x34aec5){_0x2e20e8['push'](_0x2e20e8['shift']());}};_0x5149e0(++_0x4ee108);}(_0x110e,0x68));var _0xe110=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x110e[_0x26462c];return _0x509a42;};'use strict';var Sequelize=require(_0xe110('0x0'));module[_0xe110('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe110('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe110('0x3')]}}; \ No newline at end of file +var _0xc0d7=['STRING','name'];(function(_0x22cd54,_0x780d19){var _0x504a58=function(_0x1fa28a){while(--_0x1fa28a){_0x22cd54['push'](_0x22cd54['shift']());}};_0x504a58(++_0x780d19);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x50bd27,_0x381715){_0x50bd27=_0x50bd27-0x0;var _0x18eda3=_0xc0d7[_0x50bd27];return _0x18eda3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7c0d('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7c0d('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 898ad39..4d1e6ab 100644 --- a/server/api/mailSubstatus/mailSubstatus.controller.js +++ b/server/api/mailSubstatus/mailSubstatus.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc93=['apply','reject','save','update','destroy','then','error','stack','MailSubstatus','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','params','rawAttributes','create','body','catch','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range'];(function(_0x1ca9a9,_0x2c8aa1){var _0x3f6eb0=function(_0x5871e6){while(--_0x5871e6){_0x1ca9a9['push'](_0x1ca9a9['shift']());}};_0x3f6eb0(++_0x2c8aa1);}(_0xdc93,0x6e));var _0x3dc9=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xdc93[_0x22f8ab];return _0x2a70e5;};'use strict';var pdf=require(_0x3dc9('0x0'));var emlformat=require(_0x3dc9('0x1'));var rimraf=require(_0x3dc9('0x2'));var zipdir=require(_0x3dc9('0x3'));var jsonpatch=require(_0x3dc9('0x4'));var rp=require(_0x3dc9('0x5'));var moment=require('moment');var BPromise=require(_0x3dc9('0x6'));var Mustache=require('mustache');var util=require(_0x3dc9('0x7'));var path=require(_0x3dc9('0x8'));var sox=require(_0x3dc9('0x9'));var csv=require(_0x3dc9('0xa'));var ejs=require(_0x3dc9('0xb'));var fs=require('fs');var _=require(_0x3dc9('0xc'));var squel=require(_0x3dc9('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3dc9('0xe'));var Papa=require(_0x3dc9('0xf'));var Redis=require('ioredis');var authService=require(_0x3dc9('0x10'));var qs=require(_0x3dc9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3dc9('0x12'))(_0x3dc9('0x13'));var utils=require(_0x3dc9('0x14'));var config=require(_0x3dc9('0x15'));var db=require(_0x3dc9('0x16'))['db'];function respondWithStatusCode(_0x6c6c48,_0xd66c11){_0xd66c11=_0xd66c11||0xcc;return function(_0x559fe0){if(_0x559fe0){return _0x6c6c48[_0x3dc9('0x17')](_0xd66c11);}return _0x6c6c48[_0x3dc9('0x18')](_0xd66c11)[_0x3dc9('0x19')]();};}function respondWithResult(_0x1db771,_0x109f9d){_0x109f9d=_0x109f9d||0xc8;return function(_0x8547c7){if(_0x8547c7){return _0x1db771[_0x3dc9('0x18')](_0x109f9d)[_0x3dc9('0x1a')](_0x8547c7);}};}function respondWithFilteredResult(_0x286fe1,_0x27622e){return function(_0x4a2bb2){if(_0x4a2bb2){var _0x2073c7=_0x4a2bb2[_0x3dc9('0x1b')],_0x311173=_0x27622e[_0x3dc9('0x1c')],_0x50ae75=_0x27622e[_0x3dc9('0x1c')]+_0x27622e[_0x3dc9('0x1d')],_0x3d7ef4;if(_0x50ae75>=_0x2073c7){_0x50ae75=_0x2073c7;_0x3d7ef4=0xc8;}else{_0x3d7ef4=0xce;}_0x286fe1[_0x3dc9('0x18')](_0x3d7ef4);return _0x286fe1[_0x3dc9('0x1e')](_0x3dc9('0x1f'),_0x311173+'-'+_0x50ae75+'/'+_0x2073c7)[_0x3dc9('0x1a')](_0x4a2bb2);}return null;};}function patchUpdates(_0x3b93a8){return function(_0xdc11a1){try{jsonpatch[_0x3dc9('0x20')](_0xdc11a1,_0x3b93a8,!![]);}catch(_0x2b0d2f){return BPromise[_0x3dc9('0x21')](_0x2b0d2f);}return _0xdc11a1[_0x3dc9('0x22')]();};}function saveUpdates(_0x2a5d3e,_0x16e3bb){return function(_0x41b4c2){if(_0x41b4c2){return _0x41b4c2[_0x3dc9('0x23')](_0x2a5d3e)['then'](function(_0x503c9b){return _0x503c9b;});}return null;};}function removeEntity(_0x1cbb60,_0x52af6d){return function(_0x29fba8){if(_0x29fba8){return _0x29fba8[_0x3dc9('0x24')]()[_0x3dc9('0x25')](function(){_0x1cbb60[_0x3dc9('0x18')](0xcc)[_0x3dc9('0x19')]();});}};}function handleEntityNotFound(_0x148702,_0x42e2d1){return function(_0x1d3670){if(!_0x1d3670){_0x148702[_0x3dc9('0x17')](0x194);}return _0x1d3670;};}function handleError(_0x5e573b,_0x402d3d){_0x402d3d=_0x402d3d||0x1f4;return function(_0x4d1aee){logger[_0x3dc9('0x26')](_0x4d1aee[_0x3dc9('0x27')]);if(_0x4d1aee['name']){delete _0x4d1aee['name'];}_0x5e573b[_0x3dc9('0x18')](_0x402d3d)['send'](_0x4d1aee);};}exports['index']=function(_0xfa7e8c,_0x11961e){var _0x3b88be={},_0x2fc073={},_0x456689={'count':0x0,'rows':[]};var _0x1c98ac=db[_0x3dc9('0x28')]['rawAttributes'];_0x2fc073['model']=_['keys'](_0x1c98ac);_0x2fc073[_0x3dc9('0x29')]=_[_0x3dc9('0x2a')](_0xfa7e8c['query']);_0x2fc073[_0x3dc9('0x2b')]=_[_0x3dc9('0x2c')](_0x2fc073[_0x3dc9('0x2d')],_0x2fc073[_0x3dc9('0x29')]);_0x3b88be[_0x3dc9('0x2e')]=_[_0x3dc9('0x2c')](_0x2fc073[_0x3dc9('0x2d')],qs[_0x3dc9('0x2f')](_0xfa7e8c['query'][_0x3dc9('0x2f')]));_0x3b88be[_0x3dc9('0x2e')]=_0x3b88be[_0x3dc9('0x2e')][_0x3dc9('0x30')]?_0x3b88be['attributes']:_0x2fc073[_0x3dc9('0x2d')];if(!_0xfa7e8c[_0x3dc9('0x29')]['hasOwnProperty'](_0x3dc9('0x31'))){_0x3b88be['limit']=qs[_0x3dc9('0x1d')](_0xfa7e8c['query'][_0x3dc9('0x1d')]);_0x3b88be[_0x3dc9('0x1c')]=qs['offset'](_0xfa7e8c[_0x3dc9('0x29')][_0x3dc9('0x1c')]);}_0x3b88be[_0x3dc9('0x32')]=qs[_0x3dc9('0x33')](_0xfa7e8c[_0x3dc9('0x29')][_0x3dc9('0x33')]);_0x3b88be['where']=qs[_0x3dc9('0x2b')](_[_0x3dc9('0x34')](_0xfa7e8c[_0x3dc9('0x29')],_0x2fc073[_0x3dc9('0x2b')]));if(_0xfa7e8c['query'][_0x3dc9('0x35')]){_0x3b88be[_0x3dc9('0x36')]=_[_0x3dc9('0x37')](_0x3b88be[_0x3dc9('0x36')],{'$or':_[_0x3dc9('0x38')](_0x1c98ac,function(_0x4f0912){if(_0x4f0912[_0x3dc9('0x39')]['key']!==_0x3dc9('0x3a')){var _0x31bcc3={};_0x31bcc3[_0x4f0912[_0x3dc9('0x3b')]]={'$like':'%'+_0xfa7e8c[_0x3dc9('0x29')][_0x3dc9('0x35')]+'%'};return _0x31bcc3;}})});}_0x3b88be=_['merge']({},_0x3b88be,_0xfa7e8c[_0x3dc9('0x3c')]);var _0x717022={'where':_0x3b88be['where']};return db[_0x3dc9('0x28')][_0x3dc9('0x1b')](_0x717022)[_0x3dc9('0x25')](function(_0x527a40){_0x456689['count']=_0x527a40;if(_0xfa7e8c[_0x3dc9('0x29')][_0x3dc9('0x3d')]){_0x3b88be[_0x3dc9('0x3e')]=[{'all':!![]}];}return db[_0x3dc9('0x28')][_0x3dc9('0x3f')](_0x3b88be);})['then'](function(_0x16fac5){_0x456689['rows']=_0x16fac5;return _0x456689;})[_0x3dc9('0x25')](respondWithFilteredResult(_0x11961e,_0x3b88be))['catch'](handleError(_0x11961e,null));};exports['show']=function(_0xd8466d,_0xdb1073){var _0x409840={'raw':!![],'where':{'id':_0xd8466d[_0x3dc9('0x40')]['id']}},_0x4161c1={};_0x4161c1[_0x3dc9('0x2d')]=_[_0x3dc9('0x2a')](db['MailSubstatus'][_0x3dc9('0x41')]);_0x4161c1[_0x3dc9('0x29')]=_['keys'](_0xd8466d[_0x3dc9('0x29')]);_0x4161c1['filters']=_[_0x3dc9('0x2c')](_0x4161c1['model'],_0x4161c1[_0x3dc9('0x29')]);_0x409840[_0x3dc9('0x2e')]=_['intersection'](_0x4161c1[_0x3dc9('0x2d')],qs[_0x3dc9('0x2f')](_0xd8466d['query']['fields']));_0x409840[_0x3dc9('0x2e')]=_0x409840[_0x3dc9('0x2e')][_0x3dc9('0x30')]?_0x409840['attributes']:_0x4161c1[_0x3dc9('0x2d')];if(_0xd8466d[_0x3dc9('0x29')][_0x3dc9('0x3d')]){_0x409840['include']=[{'all':!![]}];}_0x409840=_['merge']({},_0x409840,_0xd8466d['options']);return db[_0x3dc9('0x28')]['find'](_0x409840)[_0x3dc9('0x25')](handleEntityNotFound(_0xdb1073,null))[_0x3dc9('0x25')](respondWithResult(_0xdb1073,null))['catch'](handleError(_0xdb1073,null));};exports['create']=function(_0x50a127,_0x238ac4){return db['MailSubstatus'][_0x3dc9('0x42')](_0x50a127[_0x3dc9('0x43')],{})[_0x3dc9('0x25')](respondWithResult(_0x238ac4,0xc9))[_0x3dc9('0x44')](handleError(_0x238ac4,null));};exports[_0x3dc9('0x23')]=function(_0x50a24f,_0x371554){if(_0x50a24f['body']['id']){delete _0x50a24f['body']['id'];}return db['MailSubstatus'][_0x3dc9('0x45')]({'where':{'id':_0x50a24f[_0x3dc9('0x40')]['id']}})[_0x3dc9('0x25')](handleEntityNotFound(_0x371554,null))['then'](saveUpdates(_0x50a24f['body'],null))['then'](respondWithResult(_0x371554,null))[_0x3dc9('0x44')](handleError(_0x371554,null));};exports[_0x3dc9('0x24')]=function(_0x368b6c,_0x3f0d23){return db[_0x3dc9('0x28')][_0x3dc9('0x45')]({'where':{'id':_0x368b6c[_0x3dc9('0x40')]['id']}})[_0x3dc9('0x25')](handleEntityNotFound(_0x3f0d23,null))[_0x3dc9('0x25')](removeEntity(_0x3f0d23,null))['catch'](handleError(_0x3f0d23,null));};exports[_0x3dc9('0x46')]=function(_0x2063d5,_0x435ce7){return db[_0x3dc9('0x28')][_0x3dc9('0x46')]()[_0x3dc9('0x25')](respondWithResult(_0x435ce7,null))[_0x3dc9('0x44')](handleError(_0x435ce7,null));}; \ No newline at end of file +var _0x93d8=['nolimit','limit','order','sort','where','pick','merge','map','key','VIRTUAL','field','include','findAll','rows','params','fields','includeAll','options','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','MailSubstatus','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty'];(function(_0x14c75b,_0xa93b14){var _0x310e96=function(_0x5b5f3f){while(--_0x5b5f3f){_0x14c75b['push'](_0x14c75b['shift']());}};_0x310e96(++_0xa93b14);}(_0x93d8,0x1d2));var _0x893d=function(_0x35b6be,_0x2a373b){_0x35b6be=_0x35b6be-0x0;var _0x583a45=_0x93d8[_0x35b6be];return _0x583a45;};'use strict';var pdf=require(_0x893d('0x0'));var emlformat=require(_0x893d('0x1'));var rimraf=require(_0x893d('0x2'));var zipdir=require(_0x893d('0x3'));var jsonpatch=require(_0x893d('0x4'));var rp=require(_0x893d('0x5'));var moment=require(_0x893d('0x6'));var BPromise=require(_0x893d('0x7'));var Mustache=require('mustache');var util=require(_0x893d('0x8'));var path=require(_0x893d('0x9'));var sox=require(_0x893d('0xa'));var csv=require('to-csv');var ejs=require(_0x893d('0xb'));var fs=require('fs');var _=require(_0x893d('0xc'));var squel=require(_0x893d('0xd'));var crypto=require(_0x893d('0xe'));var jsforce=require(_0x893d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x893d('0x10'));var querystring=require(_0x893d('0x11'));var Papa=require(_0x893d('0x12'));var Redis=require(_0x893d('0x13'));var authService=require(_0x893d('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x893d('0x15'));var logger=require(_0x893d('0x16'))(_0x893d('0x17'));var utils=require('../../config/utils');var config=require(_0x893d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27e17d,_0x5aeacb){_0x5aeacb=_0x5aeacb||0xcc;return function(_0x2ae5f4){if(_0x2ae5f4){return _0x27e17d[_0x893d('0x19')](_0x5aeacb);}return _0x27e17d[_0x893d('0x1a')](_0x5aeacb)[_0x893d('0x1b')]();};}function respondWithResult(_0x1fa23d,_0x177d3b){_0x177d3b=_0x177d3b||0xc8;return function(_0x735b13){if(_0x735b13){return _0x1fa23d['status'](_0x177d3b)[_0x893d('0x1c')](_0x735b13);}};}function respondWithFilteredResult(_0x39e5f5,_0x104e2b){return function(_0x807d36){if(_0x807d36){var _0x29f1f4=_0x807d36[_0x893d('0x1d')],_0x206f3c=_0x104e2b[_0x893d('0x1e')],_0x1210c0=_0x104e2b[_0x893d('0x1e')]+_0x104e2b['limit'],_0x30562e;if(_0x1210c0>=_0x29f1f4){_0x1210c0=_0x29f1f4;_0x30562e=0xc8;}else{_0x30562e=0xce;}_0x39e5f5[_0x893d('0x1a')](_0x30562e);return _0x39e5f5[_0x893d('0x1f')](_0x893d('0x20'),_0x206f3c+'-'+_0x1210c0+'/'+_0x29f1f4)[_0x893d('0x1c')](_0x807d36);}return null;};}function patchUpdates(_0x4c5600){return function(_0x171269){try{jsonpatch['apply'](_0x171269,_0x4c5600,!![]);}catch(_0x4f87c9){return BPromise[_0x893d('0x21')](_0x4f87c9);}return _0x171269[_0x893d('0x22')]();};}function saveUpdates(_0x2a3cc2,_0x1ec2d9){return function(_0x5a8c2e){if(_0x5a8c2e){return _0x5a8c2e[_0x893d('0x23')](_0x2a3cc2)[_0x893d('0x24')](function(_0x200c0c){return _0x200c0c;});}return null;};}function removeEntity(_0x1f5c8c,_0x14bf88){return function(_0x120df8){if(_0x120df8){return _0x120df8[_0x893d('0x25')]()[_0x893d('0x24')](function(){_0x1f5c8c['status'](0xcc)[_0x893d('0x1b')]();});}};}function handleEntityNotFound(_0x2c91da,_0x5e350c){return function(_0x1e8973){if(!_0x1e8973){_0x2c91da[_0x893d('0x19')](0x194);}return _0x1e8973;};}function handleError(_0x38f93b,_0xc2fac9){_0xc2fac9=_0xc2fac9||0x1f4;return function(_0x5465a4){logger[_0x893d('0x26')](_0x5465a4[_0x893d('0x27')]);if(_0x5465a4[_0x893d('0x28')]){delete _0x5465a4[_0x893d('0x28')];}_0x38f93b[_0x893d('0x1a')](_0xc2fac9)[_0x893d('0x29')](_0x5465a4);};}exports['index']=function(_0x253c08,_0x2152db){var _0x2966d8={},_0x3d436f={},_0x5e53c5={'count':0x0,'rows':[]};var _0x3abe8e=db[_0x893d('0x2a')][_0x893d('0x2b')];_0x3d436f[_0x893d('0x2c')]=_[_0x893d('0x2d')](_0x3abe8e);_0x3d436f[_0x893d('0x2e')]=_['keys'](_0x253c08['query']);_0x3d436f[_0x893d('0x2f')]=_[_0x893d('0x30')](_0x3d436f['model'],_0x3d436f[_0x893d('0x2e')]);_0x2966d8[_0x893d('0x31')]=_[_0x893d('0x30')](_0x3d436f[_0x893d('0x2c')],qs['fields'](_0x253c08[_0x893d('0x2e')]['fields']));_0x2966d8[_0x893d('0x31')]=_0x2966d8[_0x893d('0x31')][_0x893d('0x32')]?_0x2966d8[_0x893d('0x31')]:_0x3d436f['model'];if(!_0x253c08[_0x893d('0x2e')][_0x893d('0x33')](_0x893d('0x34'))){_0x2966d8[_0x893d('0x35')]=qs[_0x893d('0x35')](_0x253c08[_0x893d('0x2e')][_0x893d('0x35')]);_0x2966d8['offset']=qs[_0x893d('0x1e')](_0x253c08['query'][_0x893d('0x1e')]);}_0x2966d8[_0x893d('0x36')]=qs['sort'](_0x253c08['query'][_0x893d('0x37')]);_0x2966d8[_0x893d('0x38')]=qs[_0x893d('0x2f')](_[_0x893d('0x39')](_0x253c08['query'],_0x3d436f[_0x893d('0x2f')]));if(_0x253c08['query']['filter']){_0x2966d8[_0x893d('0x38')]=_[_0x893d('0x3a')](_0x2966d8[_0x893d('0x38')],{'$or':_[_0x893d('0x3b')](_0x3abe8e,function(_0x4266ae){if(_0x4266ae['type'][_0x893d('0x3c')]!==_0x893d('0x3d')){var _0x4cb22b={};_0x4cb22b[_0x4266ae[_0x893d('0x3e')]]={'$like':'%'+_0x253c08[_0x893d('0x2e')]['filter']+'%'};return _0x4cb22b;}})});}_0x2966d8=_[_0x893d('0x3a')]({},_0x2966d8,_0x253c08['options']);var _0xd0d243={'where':_0x2966d8[_0x893d('0x38')]};return db[_0x893d('0x2a')][_0x893d('0x1d')](_0xd0d243)[_0x893d('0x24')](function(_0x17c566){_0x5e53c5['count']=_0x17c566;if(_0x253c08[_0x893d('0x2e')]['includeAll']){_0x2966d8[_0x893d('0x3f')]=[{'all':!![]}];}return db[_0x893d('0x2a')][_0x893d('0x40')](_0x2966d8);})[_0x893d('0x24')](function(_0x47a767){_0x5e53c5[_0x893d('0x41')]=_0x47a767;return _0x5e53c5;})[_0x893d('0x24')](respondWithFilteredResult(_0x2152db,_0x2966d8))['catch'](handleError(_0x2152db,null));};exports['show']=function(_0x191823,_0x518bb5){var _0x5200d4={'raw':!![],'where':{'id':_0x191823[_0x893d('0x42')]['id']}},_0x256c9d={};_0x256c9d['model']=_['keys'](db[_0x893d('0x2a')][_0x893d('0x2b')]);_0x256c9d[_0x893d('0x2e')]=_[_0x893d('0x2d')](_0x191823[_0x893d('0x2e')]);_0x256c9d[_0x893d('0x2f')]=_[_0x893d('0x30')](_0x256c9d[_0x893d('0x2c')],_0x256c9d[_0x893d('0x2e')]);_0x5200d4[_0x893d('0x31')]=_[_0x893d('0x30')](_0x256c9d[_0x893d('0x2c')],qs[_0x893d('0x43')](_0x191823[_0x893d('0x2e')][_0x893d('0x43')]));_0x5200d4[_0x893d('0x31')]=_0x5200d4[_0x893d('0x31')][_0x893d('0x32')]?_0x5200d4[_0x893d('0x31')]:_0x256c9d['model'];if(_0x191823[_0x893d('0x2e')][_0x893d('0x44')]){_0x5200d4['include']=[{'all':!![]}];}_0x5200d4=_[_0x893d('0x3a')]({},_0x5200d4,_0x191823[_0x893d('0x45')]);return db[_0x893d('0x2a')][_0x893d('0x46')](_0x5200d4)[_0x893d('0x24')](handleEntityNotFound(_0x518bb5,null))[_0x893d('0x24')](respondWithResult(_0x518bb5,null))[_0x893d('0x47')](handleError(_0x518bb5,null));};exports[_0x893d('0x48')]=function(_0x2b564c,_0x5b8f23){return db[_0x893d('0x2a')]['create'](_0x2b564c['body'],{})[_0x893d('0x24')](respondWithResult(_0x5b8f23,0xc9))['catch'](handleError(_0x5b8f23,null));};exports['update']=function(_0x231376,_0x182bc5){if(_0x231376[_0x893d('0x49')]['id']){delete _0x231376[_0x893d('0x49')]['id'];}return db[_0x893d('0x2a')][_0x893d('0x46')]({'where':{'id':_0x231376[_0x893d('0x42')]['id']}})[_0x893d('0x24')](handleEntityNotFound(_0x182bc5,null))[_0x893d('0x24')](saveUpdates(_0x231376['body'],null))['then'](respondWithResult(_0x182bc5,null))[_0x893d('0x47')](handleError(_0x182bc5,null));};exports['destroy']=function(_0x53b7ab,_0x421ad8){return db['MailSubstatus'][_0x893d('0x46')]({'where':{'id':_0x53b7ab[_0x893d('0x42')]['id']}})['then'](handleEntityNotFound(_0x421ad8,null))[_0x893d('0x24')](removeEntity(_0x421ad8,null))[_0x893d('0x47')](handleError(_0x421ad8,null));};exports['describe']=function(_0x3f3b90,_0x22163d){return db['MailSubstatus']['describe']()[_0x893d('0x24')](respondWithResult(_0x22163d,null))[_0x893d('0x47')](handleError(_0x22163d,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 369260d..8a208d8 100644 --- a/server/api/mailSubstatus/mailSubstatus.model.js +++ b/server/api/mailSubstatus/mailSubstatus.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd481=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','MailSubstatus','mail_substatuses'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0xd481,0x1e4));var _0x1d48=function(_0x3ec59a,_0x492d40){_0x3ec59a=_0x3ec59a-0x0;var _0x2f9feb=_0xd481[_0x3ec59a];return _0x2f9feb;};'use strict';var _=require(_0x1d48('0x0'));var util=require('util');var logger=require(_0x1d48('0x1'))(_0x1d48('0x2'));var moment=require('moment');var BPromise=require(_0x1d48('0x3'));var rp=require(_0x1d48('0x4'));var fs=require('fs');var path=require(_0x1d48('0x5'));var rimraf=require('rimraf');var config=require(_0x1d48('0x6'));var attributes=require('./mailSubstatus.attributes');module[_0x1d48('0x7')]=function(_0x2a4830,_0x5a0c28){return _0x2a4830[_0x1d48('0x8')](_0x1d48('0x9'),attributes,{'tableName':_0x1d48('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d11=['exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','moment','request-promise','path','./mailSubstatus.attributes'];(function(_0x3a827b,_0x47b7dd){var _0x4c215b=function(_0x26ec13){while(--_0x26ec13){_0x3a827b['push'](_0x3a827b['shift']());}};_0x4c215b(++_0x47b7dd);}(_0x6d11,0xbf));var _0x16d1=function(_0x2cae5e,_0x2fbbf2){_0x2cae5e=_0x2cae5e-0x0;var _0x380465=_0x6d11[_0x2cae5e];return _0x380465;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var logger=require(_0x16d1('0x2'))('api');var moment=require(_0x16d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x16d1('0x4'));var fs=require('fs');var path=require(_0x16d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x16d1('0x6'));module[_0x16d1('0x7')]=function(_0x3eb9e2,_0x38626d){return _0x3eb9e2[_0x16d1('0x8')](_0x16d1('0x9'),attributes,{'tableName':_0x16d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 5010dd1..7575630 100644 --- a/server/api/mailSubstatus/mailSubstatus.rpc.js +++ b/server/api/mailSubstatus/mailSubstatus.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x279769,_0x4eeb23){var _0x3b34c0=function(_0x4380a8){while(--_0x4380a8){_0x279769['push'](_0x279769['shift']());}};_0x3b34c0(++_0x4eeb23);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0x2750=['jayson/promise','http','request','then','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3825e6,_0xe169de){var _0xd75004=function(_0x4b1314){while(--_0x4b1314){_0x3825e6['push'](_0x3825e6['shift']());}};_0xd75004(++_0xe169de);}(_0x2750,0x13b));var _0x0275=function(_0x363678,_0x4ff6fe){_0x363678=_0x363678-0x0;var _0x684e35=_0x2750[_0x363678];return _0x684e35;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var moment=require(_0x0275('0x1'));var BPromise=require(_0x0275('0x2'));var rs=require(_0x0275('0x3'));var fs=require('fs');var Redis=require(_0x0275('0x4'));var db=require(_0x0275('0x5'))['db'];var utils=require(_0x0275('0x6'));var logger=require(_0x0275('0x7'))(_0x0275('0x8'));var config=require(_0x0275('0x9'));var jayson=require(_0x0275('0xa'));var client=jayson['client'][_0x0275('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2421fd,_0x2fa0eb,_0x2e4b5c){return new BPromise(function(_0x4dffd1,_0x1f7c4a){return client[_0x0275('0xc')](_0x2421fd,_0x2e4b5c)[_0x0275('0xd')](function(_0x5e0e4a){logger['info'](_0x0275('0xe'),_0x2fa0eb,'request\x20sent');logger[_0x0275('0xf')](_0x0275('0x10'),_0x2fa0eb,_0x0275('0x11'),JSON[_0x0275('0x12')](_0x5e0e4a));if(_0x5e0e4a[_0x0275('0x13')]){if(_0x5e0e4a['error'][_0x0275('0x14')]===0x1f4){logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a['error']['message']);return _0x1f7c4a(_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);}logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);return _0x4dffd1(_0x5e0e4a['error'][_0x0275('0x15')]);}else{logger[_0x0275('0x16')]('MailSubstatus,\x20%s,\x20%s',_0x2fa0eb,_0x0275('0x11'));_0x4dffd1(_0x5e0e4a[_0x0275('0x17')]['message']);}})[_0x0275('0x18')](function(_0x31c76b){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2fa0eb,_0x31c76b);_0x1f7c4a(_0x31c76b);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index c67dfdf..eac867a 100644 --- a/server/api/mailTransferReport/index.js +++ b/server/api/mailTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8a6=['/describe','/:id','show','post','create','delete','destroy','exports','util','connect-timeout','express','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index'];(function(_0x4c6ac5,_0x100cf8){var _0x4dbb92=function(_0x3dd3de){while(--_0x3dd3de){_0x4c6ac5['push'](_0x4c6ac5['shift']());}};_0x4dbb92(++_0x100cf8);}(_0xa8a6,0x68));var _0x6a8a=function(_0x1f2c26,_0x28db09){_0x1f2c26=_0x1f2c26-0x0;var _0x291a91=_0xa8a6[_0x1f2c26];return _0x291a91;};'use strict';var multer=require('multer');var util=require(_0x6a8a('0x0'));var path=require('path');var timeout=require(_0x6a8a('0x1'));var express=require(_0x6a8a('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6a8a('0x3'));var config=require('../../config/environment');var controller=require(_0x6a8a('0x4'));router[_0x6a8a('0x5')]('/',auth[_0x6a8a('0x6')](),controller[_0x6a8a('0x7')]);router[_0x6a8a('0x5')](_0x6a8a('0x8'),auth[_0x6a8a('0x6')](),controller['describe']);router[_0x6a8a('0x5')](_0x6a8a('0x9'),auth[_0x6a8a('0x6')](),controller[_0x6a8a('0xa')]);router[_0x6a8a('0xb')]('/',auth[_0x6a8a('0x6')](),controller[_0x6a8a('0xc')]);router['put'](_0x6a8a('0x9'),auth[_0x6a8a('0x6')](),controller['update']);router[_0x6a8a('0xd')](_0x6a8a('0x9'),auth[_0x6a8a('0x6')](),controller[_0x6a8a('0xe')]);module[_0x6a8a('0xf')]=router; \ No newline at end of file +var _0x7693=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','delete','destroy','exports','multer'];(function(_0x4f560d,_0x37d02b){var _0x20c7e5=function(_0x4b73a9){while(--_0x4b73a9){_0x4f560d['push'](_0x4f560d['shift']());}};_0x20c7e5(++_0x37d02b);}(_0x7693,0x1af));var _0x3769=function(_0x356a24,_0x32cf59){_0x356a24=_0x356a24-0x0;var _0x36fd16=_0x7693[_0x356a24];return _0x36fd16;};'use strict';var multer=require(_0x3769('0x0'));var util=require(_0x3769('0x1'));var path=require(_0x3769('0x2'));var timeout=require('connect-timeout');var express=require(_0x3769('0x3'));var router=express[_0x3769('0x4')]();var auth=require(_0x3769('0x5'));var interaction=require(_0x3769('0x6'));var config=require('../../config/environment');var controller=require(_0x3769('0x7'));router[_0x3769('0x8')]('/',auth[_0x3769('0x9')](),controller[_0x3769('0xa')]);router[_0x3769('0x8')](_0x3769('0xb'),auth[_0x3769('0x9')](),controller['describe']);router[_0x3769('0x8')](_0x3769('0xc'),auth[_0x3769('0x9')](),controller[_0x3769('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3769('0xe')]);router['put'](_0x3769('0xc'),auth[_0x3769('0x9')](),controller['update']);router[_0x3769('0xf')](_0x3769('0xc'),auth[_0x3769('0x9')](),controller[_0x3769('0x10')]);module[_0x3769('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 746a5f1..f3c2319 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b78=['agent','queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x7b78,0x1ab));var _0x87b7=function(_0x4d0ebc,_0x2cbac3){_0x4d0ebc=_0x4d0ebc-0x0;var _0x519e80=_0x7b78[_0x4d0ebc];return _0x519e80;};'use strict';var moment=require(_0x87b7('0x0'));var Sequelize=require(_0x87b7('0x1'));module[_0x87b7('0x2')]={'uniqueid':{'type':Sequelize[_0x87b7('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x87b7('0x4')]('account',_0x87b7('0x5'),_0x87b7('0x6')),'allowNull':![],'defaultValue':_0x87b7('0x6')},'transferredAt':{'type':Sequelize[_0x87b7('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x87b7('0x8')]}}; \ No newline at end of file +var _0xe87a=['sequelize','STRING','ENUM','account','agent','queue','DATE','moment'];(function(_0x372b9b,_0x252566){var _0xdac55e=function(_0x36fcdc){while(--_0x36fcdc){_0x372b9b['push'](_0x372b9b['shift']());}};_0xdac55e(++_0x252566);}(_0xe87a,0x11f));var _0xae87=function(_0x2894e4,_0x580b95){_0x2894e4=_0x2894e4-0x0;var _0x3b3dad=_0xe87a[_0x2894e4];return _0x3b3dad;};'use strict';var moment=require(_0xae87('0x0'));var Sequelize=require(_0xae87('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xae87('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xae87('0x3')](_0xae87('0x4'),_0xae87('0x5'),_0xae87('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xae87('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 801445c..4d18c58 100644 --- a/server/api/mailTransferReport/mailTransferReport.controller.js +++ b/server/api/mailTransferReport/mailTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b05=['merge','where','map','type','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','show','params','intersection','fields','include','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','then','destroy','name','send','index','MailTransferReport','rawAttributes','model','keys','query','filters','attributes','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x105717,_0x4add88){var _0x27b729=function(_0x5cef72){while(--_0x5cef72){_0x105717['push'](_0x105717['shift']());}};_0x27b729(++_0x4add88);}(_0x9b05,0x1ba));var _0x59b0=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0x9b05[_0x593564];return _0x211a89;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x59b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x59b0('0x1'));var jsonpatch=require(_0x59b0('0x2'));var rp=require(_0x59b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x59b0('0x4'));var util=require('util');var path=require('path');var sox=require(_0x59b0('0x5'));var csv=require(_0x59b0('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x59b0('0x7'));var crypto=require('crypto');var jsforce=require(_0x59b0('0x8'));var deskjs=require(_0x59b0('0x9'));var toCsv=require(_0x59b0('0x6'));var querystring=require('querystring');var Papa=require(_0x59b0('0xa'));var Redis=require(_0x59b0('0xb'));var authService=require(_0x59b0('0xc'));var qs=require(_0x59b0('0xd'));var hardwareService=require(_0x59b0('0xe'));var logger=require(_0x59b0('0xf'))(_0x59b0('0x10'));var utils=require(_0x59b0('0x11'));var config=require(_0x59b0('0x12'));var db=require(_0x59b0('0x13'))['db'];function respondWithStatusCode(_0x211b8c,_0x5dc9a6){_0x5dc9a6=_0x5dc9a6||0xcc;return function(_0x1383b9){if(_0x1383b9){return _0x211b8c[_0x59b0('0x14')](_0x5dc9a6);}return _0x211b8c[_0x59b0('0x15')](_0x5dc9a6)[_0x59b0('0x16')]();};}function respondWithResult(_0x103d0d,_0x1412fd){_0x1412fd=_0x1412fd||0xc8;return function(_0x4d3a25){if(_0x4d3a25){return _0x103d0d[_0x59b0('0x15')](_0x1412fd)[_0x59b0('0x17')](_0x4d3a25);}};}function respondWithFilteredResult(_0xf8f3cc,_0x15a283){return function(_0x1ca84b){if(_0x1ca84b){var _0x41a64e=_0x1ca84b['count'],_0xef611f=_0x15a283[_0x59b0('0x18')],_0x2525b7=_0x15a283['offset']+_0x15a283[_0x59b0('0x19')],_0x31b00f;if(_0x2525b7>=_0x41a64e){_0x2525b7=_0x41a64e;_0x31b00f=0xc8;}else{_0x31b00f=0xce;}_0xf8f3cc[_0x59b0('0x15')](_0x31b00f);return _0xf8f3cc[_0x59b0('0x1a')](_0x59b0('0x1b'),_0xef611f+'-'+_0x2525b7+'/'+_0x41a64e)[_0x59b0('0x17')](_0x1ca84b);}return null;};}function patchUpdates(_0x4ec89a){return function(_0x28c600){try{jsonpatch[_0x59b0('0x1c')](_0x28c600,_0x4ec89a,!![]);}catch(_0x1e9bc3){return BPromise[_0x59b0('0x1d')](_0x1e9bc3);}return _0x28c600['save']();};}function saveUpdates(_0x5efbc9,_0x5624a9){return function(_0x622d72){if(_0x622d72){return _0x622d72['update'](_0x5efbc9)[_0x59b0('0x1e')](function(_0x1e6a91){return _0x1e6a91;});}return null;};}function removeEntity(_0x8d1916,_0x1283c0){return function(_0x2d8b57){if(_0x2d8b57){return _0x2d8b57[_0x59b0('0x1f')]()[_0x59b0('0x1e')](function(){_0x8d1916['status'](0xcc)[_0x59b0('0x16')]();});}};}function handleEntityNotFound(_0xc8678f,_0x186260){return function(_0xbdbc2c){if(!_0xbdbc2c){_0xc8678f[_0x59b0('0x14')](0x194);}return _0xbdbc2c;};}function handleError(_0xe9c820,_0x53fbdf){_0x53fbdf=_0x53fbdf||0x1f4;return function(_0x250552){logger['error'](_0x250552['stack']);if(_0x250552[_0x59b0('0x20')]){delete _0x250552[_0x59b0('0x20')];}_0xe9c820[_0x59b0('0x15')](_0x53fbdf)[_0x59b0('0x21')](_0x250552);};}exports[_0x59b0('0x22')]=function(_0x52dd8d,_0x41d26f){var _0x3a3bf3={},_0x56cd93={},_0xe6bf5={'count':0x0,'rows':[]};var _0x364f97=db[_0x59b0('0x23')][_0x59b0('0x24')];_0x56cd93[_0x59b0('0x25')]=_[_0x59b0('0x26')](_0x364f97);_0x56cd93[_0x59b0('0x27')]=_[_0x59b0('0x26')](_0x52dd8d['query']);_0x56cd93[_0x59b0('0x28')]=_['intersection'](_0x56cd93['model'],_0x56cd93[_0x59b0('0x27')]);_0x3a3bf3[_0x59b0('0x29')]=_['intersection'](_0x56cd93['model'],qs['fields'](_0x52dd8d[_0x59b0('0x27')]['fields']));_0x3a3bf3[_0x59b0('0x29')]=_0x3a3bf3[_0x59b0('0x29')][_0x59b0('0x2a')]?_0x3a3bf3[_0x59b0('0x29')]:_0x56cd93[_0x59b0('0x25')];if(!_0x52dd8d['query'][_0x59b0('0x2b')](_0x59b0('0x2c'))){_0x3a3bf3[_0x59b0('0x19')]=qs[_0x59b0('0x19')](_0x52dd8d[_0x59b0('0x27')]['limit']);_0x3a3bf3[_0x59b0('0x18')]=qs[_0x59b0('0x18')](_0x52dd8d[_0x59b0('0x27')][_0x59b0('0x18')]);}_0x3a3bf3[_0x59b0('0x2d')]=qs[_0x59b0('0x2e')](_0x52dd8d[_0x59b0('0x27')][_0x59b0('0x2e')]);_0x3a3bf3['where']=qs['filters'](_['pick'](_0x52dd8d[_0x59b0('0x27')],_0x56cd93['filters']));if(_0x52dd8d[_0x59b0('0x27')][_0x59b0('0x2f')]){_0x3a3bf3['where']=_[_0x59b0('0x30')](_0x3a3bf3[_0x59b0('0x31')],{'$or':_[_0x59b0('0x32')](_0x364f97,function(_0x52b368){if(_0x52b368[_0x59b0('0x33')]['key']!==_0x59b0('0x34')){var _0x653e3f={};_0x653e3f[_0x52b368[_0x59b0('0x35')]]={'$like':'%'+_0x52dd8d['query'][_0x59b0('0x2f')]+'%'};return _0x653e3f;}})});}_0x3a3bf3=_[_0x59b0('0x30')]({},_0x3a3bf3,_0x52dd8d[_0x59b0('0x36')]);var _0xb6f302={'where':_0x3a3bf3[_0x59b0('0x31')]};return db[_0x59b0('0x23')][_0x59b0('0x37')](_0xb6f302)[_0x59b0('0x1e')](function(_0xfbf260){_0xe6bf5['count']=_0xfbf260;if(_0x52dd8d[_0x59b0('0x27')][_0x59b0('0x38')]){_0x3a3bf3['include']=[{'all':!![]}];}return db[_0x59b0('0x23')][_0x59b0('0x39')](_0x3a3bf3);})['then'](function(_0x49db15){_0xe6bf5[_0x59b0('0x3a')]=_0x49db15;return _0xe6bf5;})[_0x59b0('0x1e')](respondWithFilteredResult(_0x41d26f,_0x3a3bf3))[_0x59b0('0x3b')](handleError(_0x41d26f,null));};exports[_0x59b0('0x3c')]=function(_0x3f0301,_0x410d74){var _0x2d4812={'raw':!![],'where':{'id':_0x3f0301[_0x59b0('0x3d')]['id']}},_0x13aa4e={};_0x13aa4e[_0x59b0('0x25')]=_[_0x59b0('0x26')](db[_0x59b0('0x23')]['rawAttributes']);_0x13aa4e[_0x59b0('0x27')]=_[_0x59b0('0x26')](_0x3f0301[_0x59b0('0x27')]);_0x13aa4e[_0x59b0('0x28')]=_[_0x59b0('0x3e')](_0x13aa4e[_0x59b0('0x25')],_0x13aa4e[_0x59b0('0x27')]);_0x2d4812[_0x59b0('0x29')]=_['intersection'](_0x13aa4e[_0x59b0('0x25')],qs[_0x59b0('0x3f')](_0x3f0301[_0x59b0('0x27')][_0x59b0('0x3f')]));_0x2d4812[_0x59b0('0x29')]=_0x2d4812[_0x59b0('0x29')][_0x59b0('0x2a')]?_0x2d4812['attributes']:_0x13aa4e['model'];if(_0x3f0301[_0x59b0('0x27')][_0x59b0('0x38')]){_0x2d4812[_0x59b0('0x40')]=[{'all':!![]}];}_0x2d4812=_[_0x59b0('0x30')]({},_0x2d4812,_0x3f0301['options']);return db[_0x59b0('0x23')][_0x59b0('0x41')](_0x2d4812)[_0x59b0('0x1e')](handleEntityNotFound(_0x410d74,null))[_0x59b0('0x1e')](respondWithResult(_0x410d74,null))[_0x59b0('0x3b')](handleError(_0x410d74,null));};exports[_0x59b0('0x42')]=function(_0x4b9e31,_0x494c7f){return db['MailTransferReport'][_0x59b0('0x42')](_0x4b9e31[_0x59b0('0x43')],{})['then'](respondWithResult(_0x494c7f,0xc9))[_0x59b0('0x3b')](handleError(_0x494c7f,null));};exports[_0x59b0('0x44')]=function(_0x35fcf1,_0x7988d2){if(_0x35fcf1[_0x59b0('0x43')]['id']){delete _0x35fcf1[_0x59b0('0x43')]['id'];}return db[_0x59b0('0x23')][_0x59b0('0x41')]({'where':{'id':_0x35fcf1[_0x59b0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x7988d2,null))[_0x59b0('0x1e')](saveUpdates(_0x35fcf1['body'],null))['then'](respondWithResult(_0x7988d2,null))['catch'](handleError(_0x7988d2,null));};exports[_0x59b0('0x1f')]=function(_0x277806,_0x8ff156){return db[_0x59b0('0x23')][_0x59b0('0x41')]({'where':{'id':_0x277806['params']['id']}})['then'](handleEntityNotFound(_0x8ff156,null))[_0x59b0('0x1e')](removeEntity(_0x8ff156,null))[_0x59b0('0x3b')](handleError(_0x8ff156,null));};exports[_0x59b0('0x45')]=function(_0x88f59,_0x15be27){return db[_0x59b0('0x23')]['describe']()[_0x59b0('0x1e')](respondWithResult(_0x15be27,null))[_0x59b0('0x3b')](handleError(_0x15be27,null));}; \ No newline at end of file +var _0x6bf8=['MailTransferReport','count','includeAll','include','findAll','rows','catch','show','options','find','create','update','body','params','describe','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','apply','reject','save','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','key','field'];(function(_0x283514,_0x298c7e){var _0x62e175=function(_0x3823f6){while(--_0x3823f6){_0x283514['push'](_0x283514['shift']());}};_0x62e175(++_0x298c7e);}(_0x6bf8,0x177));var _0x86bf=function(_0x512ead,_0x1f8b25){_0x512ead=_0x512ead-0x0;var _0x250bb0=_0x6bf8[_0x512ead];return _0x250bb0;};'use strict';var pdf=require(_0x86bf('0x0'));var emlformat=require(_0x86bf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x86bf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86bf('0x3'));var moment=require(_0x86bf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x86bf('0x5'));var util=require('util');var path=require(_0x86bf('0x6'));var sox=require(_0x86bf('0x7'));var csv=require(_0x86bf('0x8'));var ejs=require(_0x86bf('0x9'));var fs=require('fs');var _=require(_0x86bf('0xa'));var squel=require(_0x86bf('0xb'));var crypto=require(_0x86bf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x86bf('0xd'));var toCsv=require(_0x86bf('0x8'));var querystring=require(_0x86bf('0xe'));var Papa=require(_0x86bf('0xf'));var Redis=require(_0x86bf('0x10'));var authService=require(_0x86bf('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x86bf('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x86bf('0x13'));var db=require(_0x86bf('0x14'))['db'];function respondWithStatusCode(_0x938af1,_0x125fd3){_0x125fd3=_0x125fd3||0xcc;return function(_0x88116b){if(_0x88116b){return _0x938af1[_0x86bf('0x15')](_0x125fd3);}return _0x938af1['status'](_0x125fd3)[_0x86bf('0x16')]();};}function respondWithResult(_0x3de5cc,_0x1b070f){_0x1b070f=_0x1b070f||0xc8;return function(_0x4a21ec){if(_0x4a21ec){return _0x3de5cc[_0x86bf('0x17')](_0x1b070f)[_0x86bf('0x18')](_0x4a21ec);}};}function respondWithFilteredResult(_0x5b1eac,_0x55b108){return function(_0x5e91ba){if(_0x5e91ba){var _0x20d402=_0x5e91ba['count'],_0x5aa8bc=_0x55b108[_0x86bf('0x19')],_0x1b17ac=_0x55b108[_0x86bf('0x19')]+_0x55b108['limit'],_0x1933c9;if(_0x1b17ac>=_0x20d402){_0x1b17ac=_0x20d402;_0x1933c9=0xc8;}else{_0x1933c9=0xce;}_0x5b1eac[_0x86bf('0x17')](_0x1933c9);return _0x5b1eac[_0x86bf('0x1a')]('Content-Range',_0x5aa8bc+'-'+_0x1b17ac+'/'+_0x20d402)['json'](_0x5e91ba);}return null;};}function patchUpdates(_0x213311){return function(_0x2d92eb){try{jsonpatch[_0x86bf('0x1b')](_0x2d92eb,_0x213311,!![]);}catch(_0x532da3){return BPromise[_0x86bf('0x1c')](_0x532da3);}return _0x2d92eb[_0x86bf('0x1d')]();};}function saveUpdates(_0x49b473,_0x205d6d){return function(_0x2cd432){if(_0x2cd432){return _0x2cd432['update'](_0x49b473)[_0x86bf('0x1e')](function(_0x3cb4cb){return _0x3cb4cb;});}return null;};}function removeEntity(_0x439561,_0x3c4442){return function(_0x19b116){if(_0x19b116){return _0x19b116[_0x86bf('0x1f')]()[_0x86bf('0x1e')](function(){_0x439561[_0x86bf('0x17')](0xcc)[_0x86bf('0x16')]();});}};}function handleEntityNotFound(_0x32aba3,_0x32a23e){return function(_0x53d103){if(!_0x53d103){_0x32aba3['sendStatus'](0x194);}return _0x53d103;};}function handleError(_0x6dd93e,_0x4b1525){_0x4b1525=_0x4b1525||0x1f4;return function(_0x49a766){logger['error'](_0x49a766[_0x86bf('0x20')]);if(_0x49a766[_0x86bf('0x21')]){delete _0x49a766[_0x86bf('0x21')];}_0x6dd93e[_0x86bf('0x17')](_0x4b1525)[_0x86bf('0x22')](_0x49a766);};}exports[_0x86bf('0x23')]=function(_0xeaa613,_0xdb1cd1){var _0x5eaf6b={},_0xcd5082={},_0x3c618b={'count':0x0,'rows':[]};var _0x3cb546=db['MailTransferReport'][_0x86bf('0x24')];_0xcd5082[_0x86bf('0x25')]=_[_0x86bf('0x26')](_0x3cb546);_0xcd5082[_0x86bf('0x27')]=_[_0x86bf('0x26')](_0xeaa613['query']);_0xcd5082[_0x86bf('0x28')]=_['intersection'](_0xcd5082[_0x86bf('0x25')],_0xcd5082[_0x86bf('0x27')]);_0x5eaf6b[_0x86bf('0x29')]=_[_0x86bf('0x2a')](_0xcd5082[_0x86bf('0x25')],qs[_0x86bf('0x2b')](_0xeaa613[_0x86bf('0x27')]['fields']));_0x5eaf6b[_0x86bf('0x29')]=_0x5eaf6b[_0x86bf('0x29')][_0x86bf('0x2c')]?_0x5eaf6b[_0x86bf('0x29')]:_0xcd5082[_0x86bf('0x25')];if(!_0xeaa613[_0x86bf('0x27')][_0x86bf('0x2d')](_0x86bf('0x2e'))){_0x5eaf6b['limit']=qs[_0x86bf('0x2f')](_0xeaa613[_0x86bf('0x27')][_0x86bf('0x2f')]);_0x5eaf6b[_0x86bf('0x19')]=qs[_0x86bf('0x19')](_0xeaa613['query'][_0x86bf('0x19')]);}_0x5eaf6b[_0x86bf('0x30')]=qs[_0x86bf('0x31')](_0xeaa613[_0x86bf('0x27')][_0x86bf('0x31')]);_0x5eaf6b[_0x86bf('0x32')]=qs[_0x86bf('0x28')](_[_0x86bf('0x33')](_0xeaa613[_0x86bf('0x27')],_0xcd5082[_0x86bf('0x28')]));if(_0xeaa613[_0x86bf('0x27')][_0x86bf('0x34')]){_0x5eaf6b['where']=_[_0x86bf('0x35')](_0x5eaf6b['where'],{'$or':_[_0x86bf('0x36')](_0x3cb546,function(_0x16d3b6){if(_0x16d3b6['type'][_0x86bf('0x37')]!=='VIRTUAL'){var _0x9e1e89={};_0x9e1e89[_0x16d3b6[_0x86bf('0x38')]]={'$like':'%'+_0xeaa613['query'][_0x86bf('0x34')]+'%'};return _0x9e1e89;}})});}_0x5eaf6b=_['merge']({},_0x5eaf6b,_0xeaa613['options']);var _0x14d3b9={'where':_0x5eaf6b[_0x86bf('0x32')]};return db[_0x86bf('0x39')][_0x86bf('0x3a')](_0x14d3b9)[_0x86bf('0x1e')](function(_0xec15fa){_0x3c618b[_0x86bf('0x3a')]=_0xec15fa;if(_0xeaa613[_0x86bf('0x27')][_0x86bf('0x3b')]){_0x5eaf6b[_0x86bf('0x3c')]=[{'all':!![]}];}return db['MailTransferReport'][_0x86bf('0x3d')](_0x5eaf6b);})[_0x86bf('0x1e')](function(_0x4ef6e8){_0x3c618b[_0x86bf('0x3e')]=_0x4ef6e8;return _0x3c618b;})[_0x86bf('0x1e')](respondWithFilteredResult(_0xdb1cd1,_0x5eaf6b))[_0x86bf('0x3f')](handleError(_0xdb1cd1,null));};exports[_0x86bf('0x40')]=function(_0x4d16aa,_0x13b597){var _0x4930bb={'raw':!![],'where':{'id':_0x4d16aa['params']['id']}},_0x326795={};_0x326795[_0x86bf('0x25')]=_['keys'](db['MailTransferReport']['rawAttributes']);_0x326795[_0x86bf('0x27')]=_[_0x86bf('0x26')](_0x4d16aa['query']);_0x326795[_0x86bf('0x28')]=_[_0x86bf('0x2a')](_0x326795[_0x86bf('0x25')],_0x326795[_0x86bf('0x27')]);_0x4930bb[_0x86bf('0x29')]=_['intersection'](_0x326795[_0x86bf('0x25')],qs['fields'](_0x4d16aa[_0x86bf('0x27')][_0x86bf('0x2b')]));_0x4930bb[_0x86bf('0x29')]=_0x4930bb[_0x86bf('0x29')]['length']?_0x4930bb[_0x86bf('0x29')]:_0x326795[_0x86bf('0x25')];if(_0x4d16aa[_0x86bf('0x27')]['includeAll']){_0x4930bb['include']=[{'all':!![]}];}_0x4930bb=_[_0x86bf('0x35')]({},_0x4930bb,_0x4d16aa[_0x86bf('0x41')]);return db['MailTransferReport'][_0x86bf('0x42')](_0x4930bb)['then'](handleEntityNotFound(_0x13b597,null))['then'](respondWithResult(_0x13b597,null))[_0x86bf('0x3f')](handleError(_0x13b597,null));};exports[_0x86bf('0x43')]=function(_0x2a9126,_0x5bccb2){return db['MailTransferReport'][_0x86bf('0x43')](_0x2a9126['body'],{})[_0x86bf('0x1e')](respondWithResult(_0x5bccb2,0xc9))[_0x86bf('0x3f')](handleError(_0x5bccb2,null));};exports[_0x86bf('0x44')]=function(_0x527d93,_0x375768){if(_0x527d93['body']['id']){delete _0x527d93[_0x86bf('0x45')]['id'];}return db[_0x86bf('0x39')][_0x86bf('0x42')]({'where':{'id':_0x527d93[_0x86bf('0x46')]['id']}})[_0x86bf('0x1e')](handleEntityNotFound(_0x375768,null))['then'](saveUpdates(_0x527d93['body'],null))['then'](respondWithResult(_0x375768,null))[_0x86bf('0x3f')](handleError(_0x375768,null));};exports[_0x86bf('0x1f')]=function(_0x311250,_0x55b59d){return db[_0x86bf('0x39')][_0x86bf('0x42')]({'where':{'id':_0x311250['params']['id']}})[_0x86bf('0x1e')](handleEntityNotFound(_0x55b59d,null))[_0x86bf('0x1e')](removeEntity(_0x55b59d,null))['catch'](handleError(_0x55b59d,null));};exports[_0x86bf('0x47')]=function(_0x4866be,_0x147b15){return db[_0x86bf('0x39')][_0x86bf('0x47')]()[_0x86bf('0x1e')](respondWithResult(_0x147b15,null))['catch'](handleError(_0x147b15,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 901531e..6928b1e 100644 --- a/server/api/mailTransferReport/mailTransferReport.model.js +++ b/server/api/mailTransferReport/mailTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20ea=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x2aaf44,_0x5c6452){var _0x34c391=function(_0xd8fde2){while(--_0xd8fde2){_0x2aaf44['push'](_0x2aaf44['shift']());}};_0x34c391(++_0x5c6452);}(_0x20ea,0x6c));var _0xa20e=function(_0x3ef6e3,_0x37f067){_0x3ef6e3=_0x3ef6e3-0x0;var _0x115b83=_0x20ea[_0x3ef6e3];return _0x115b83;};'use strict';var _=require('lodash');var util=require(_0xa20e('0x0'));var logger=require(_0xa20e('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa20e('0x2'));var rp=require(_0xa20e('0x3'));var fs=require('fs');var path=require(_0xa20e('0x4'));var rimraf=require(_0xa20e('0x5'));var config=require(_0xa20e('0x6'));var attributes=require(_0xa20e('0x7'));module['exports']=function(_0x1b85ae,_0x4165bb){return _0x1b85ae[_0xa20e('0x8')](_0xa20e('0x9'),attributes,{'tableName':_0xa20e('0xa'),'paranoid':![],'indexes':[{'name':_0xa20e('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x01d8=['rimraf','./mailTransferReport.attributes','define','uniqueid','lodash','../../config/logger','api','moment','request-promise'];(function(_0x151b2a,_0x2b88b8){var _0x5c2c04=function(_0x1786d0){while(--_0x1786d0){_0x151b2a['push'](_0x151b2a['shift']());}};_0x5c2c04(++_0x2b88b8);}(_0x01d8,0x163));var _0x801d=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0x01d8[_0x4849f6];return _0x1a3dcd;};'use strict';var _=require(_0x801d('0x0'));var util=require('util');var logger=require(_0x801d('0x1'))(_0x801d('0x2'));var moment=require(_0x801d('0x3'));var BPromise=require('bluebird');var rp=require(_0x801d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x801d('0x5'));var config=require('../../config/environment');var attributes=require(_0x801d('0x6'));module['exports']=function(_0x20236c,_0x28f556){return _0x20236c[_0x801d('0x7')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x801d('0x8'),'fields':[_0x801d('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 823649f..0ae34b0 100644 --- a/server/api/mailTransferReport/mailTransferReport.rpc.js +++ b/server/api/mailTransferReport/mailTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f7b=['info','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x6f7b,0x1e6));var _0xb6f7=function(_0x34f0fb,_0x2d70fa){_0x34f0fb=_0x34f0fb-0x0;var _0x3ae925=_0x6f7b[_0x34f0fb];return _0x3ae925;};'use strict';var _=require('lodash');var util=require(_0xb6f7('0x0'));var moment=require(_0xb6f7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6f7('0x2'));var db=require(_0xb6f7('0x3'))['db'];var utils=require(_0xb6f7('0x4'));var logger=require(_0xb6f7('0x5'))(_0xb6f7('0x6'));var config=require('../../config/environment');var jayson=require(_0xb6f7('0x7'));var client=jayson[_0xb6f7('0x8')][_0xb6f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43672e,_0xdd6bc1,_0x127bfa){return new BPromise(function(_0x289be4,_0x4b8c1b){return client[_0xb6f7('0xa')](_0x43672e,_0x127bfa)[_0xb6f7('0xb')](function(_0x4439ef){logger['info'](_0xb6f7('0xc'),_0xdd6bc1,_0xb6f7('0xd'));logger[_0xb6f7('0xe')](_0xb6f7('0xf'),_0xdd6bc1,_0xb6f7('0xd'),JSON[_0xb6f7('0x10')](_0x4439ef));if(_0x4439ef[_0xb6f7('0x11')]){if(_0x4439ef[_0xb6f7('0x11')][_0xb6f7('0x12')]===0x1f4){logger['error'](_0xb6f7('0xc'),_0xdd6bc1,_0x4439ef[_0xb6f7('0x11')][_0xb6f7('0x13')]);return _0x4b8c1b(_0x4439ef[_0xb6f7('0x11')][_0xb6f7('0x13')]);}logger[_0xb6f7('0x11')](_0xb6f7('0xc'),_0xdd6bc1,_0x4439ef[_0xb6f7('0x11')][_0xb6f7('0x13')]);return _0x289be4(_0x4439ef[_0xb6f7('0x11')][_0xb6f7('0x13')]);}else{logger[_0xb6f7('0x14')](_0xb6f7('0xc'),_0xdd6bc1,_0xb6f7('0xd'));_0x289be4(_0x4439ef['result'][_0xb6f7('0x13')]);}})[_0xb6f7('0x15')](function(_0x198701){logger[_0xb6f7('0x11')](_0xb6f7('0xc'),_0xdd6bc1,_0x198701);_0x4b8c1b(_0x198701);});});} \ No newline at end of file +var _0x060a=['stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd43db4,_0x182e37){var _0x1af2f5=function(_0x198358){while(--_0x198358){_0xd43db4['push'](_0xd43db4['shift']());}};_0x1af2f5(++_0x182e37);}(_0x060a,0x1d3));var _0xa060=function(_0x364674,_0x5c9ebe){_0x364674=_0x364674-0x0;var _0x57cadf=_0x060a[_0x364674];return _0x57cadf;};'use strict';var _=require('lodash');var util=require(_0xa060('0x0'));var moment=require(_0xa060('0x1'));var BPromise=require(_0xa060('0x2'));var rs=require(_0xa060('0x3'));var fs=require('fs');var Redis=require(_0xa060('0x4'));var db=require(_0xa060('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa060('0x6'))(_0xa060('0x7'));var config=require(_0xa060('0x8'));var jayson=require(_0xa060('0x9'));var client=jayson[_0xa060('0xa')][_0xa060('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49d4d1,_0xcb575b,_0x15f890){return new BPromise(function(_0x47eba2,_0xe19c05){return client['request'](_0x49d4d1,_0x15f890)[_0xa060('0xc')](function(_0x21d21d){logger['info'](_0xa060('0xd'),_0xcb575b,_0xa060('0xe'));logger[_0xa060('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xcb575b,_0xa060('0xe'),JSON[_0xa060('0x10')](_0x21d21d));if(_0x21d21d[_0xa060('0x11')]){if(_0x21d21d[_0xa060('0x11')][_0xa060('0x12')]===0x1f4){logger[_0xa060('0x11')](_0xa060('0xd'),_0xcb575b,_0x21d21d[_0xa060('0x11')][_0xa060('0x13')]);return _0xe19c05(_0x21d21d[_0xa060('0x11')][_0xa060('0x13')]);}logger[_0xa060('0x11')](_0xa060('0xd'),_0xcb575b,_0x21d21d[_0xa060('0x11')][_0xa060('0x13')]);return _0x47eba2(_0x21d21d[_0xa060('0x11')][_0xa060('0x13')]);}else{logger[_0xa060('0x14')](_0xa060('0xd'),_0xcb575b,_0xa060('0xe'));_0x47eba2(_0x21d21d[_0xa060('0x15')]['message']);}})[_0xa060('0x16')](function(_0x234a49){logger[_0xa060('0x11')](_0xa060('0xd'),_0xcb575b,_0x234a49);_0xe19c05(_0x234a49);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index de40a56..000d065 100644 --- a/server/api/memberReport/index.js +++ b/server/api/memberReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x92be=['describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x1049bd,_0x7bd55e){var _0x12fe2c=function(_0x4b975a){while(--_0x4b975a){_0x1049bd['push'](_0x1049bd['shift']());}};_0x12fe2c(++_0x7bd55e);}(_0x92be,0xa8));var _0xe92b=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x92be[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0xe92b('0x0'));var util=require(_0xe92b('0x1'));var path=require(_0xe92b('0x2'));var timeout=require(_0xe92b('0x3'));var express=require(_0xe92b('0x4'));var router=express[_0xe92b('0x5')]();var auth=require(_0xe92b('0x6'));var interaction=require(_0xe92b('0x7'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0xe92b('0x8')]('/',auth[_0xe92b('0x9')](),controller[_0xe92b('0xa')]);router['get'](_0xe92b('0xb'),auth[_0xe92b('0x9')](),controller[_0xe92b('0xc')]);router['get'](_0xe92b('0xd'),auth[_0xe92b('0x9')](),controller[_0xe92b('0xe')]);router[_0xe92b('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe92b('0xd'),auth[_0xe92b('0x9')](),controller[_0xe92b('0x10')]);router[_0xe92b('0x11')]('/:id',auth[_0xe92b('0x9')](),controller[_0xe92b('0x12')]);module[_0xe92b('0x13')]=router; \ No newline at end of file +var _0xc305=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','/describe','describe','/:id','put','update','delete','exports'];(function(_0x5cad35,_0x5a373c){var _0x55c5d3=function(_0x193f18){while(--_0x193f18){_0x5cad35['push'](_0x5cad35['shift']());}};_0x55c5d3(++_0x5a373c);}(_0xc305,0xa5));var _0x5c30=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc305[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0x5c30('0x0'));var util=require(_0x5c30('0x1'));var path=require(_0x5c30('0x2'));var timeout=require(_0x5c30('0x3'));var express=require(_0x5c30('0x4'));var router=express[_0x5c30('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5c30('0x6'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router['get']('/',auth[_0x5c30('0x7')](),controller['index']);router['get'](_0x5c30('0x8'),auth[_0x5c30('0x7')](),controller[_0x5c30('0x9')]);router['get'](_0x5c30('0xa'),auth[_0x5c30('0x7')](),controller['show']);router['post']('/',auth[_0x5c30('0x7')](),controller['create']);router[_0x5c30('0xb')]('/:id',auth[_0x5c30('0x7')](),controller[_0x5c30('0xc')]);router[_0x5c30('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5c30('0xe')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 2f34859..3ce62b6 100644 --- a/server/api/memberReport/memberReport.attributes.js +++ b/server/api/memberReport/memberReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1820=['INTEGER','DATE','diff','seconds','setDataValue','exitAt','talk:[start]','talk:[destination]','talk:[queue]','sequelize','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x536e49,_0x1f8bb9){var _0x3a2053=function(_0x2e6695){while(--_0x2e6695){_0x536e49['push'](_0x536e49['shift']());}};_0x3a2053(++_0x1f8bb9);}(_0x1820,0x71));var _0x0182=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x1820[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0x0182('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0x0182('0x1')]},'membername':{'type':Sequelize[_0x0182('0x1')]},'interface':{'type':Sequelize[_0x0182('0x1')]},'type':{'type':Sequelize[_0x0182('0x1')],'defaultValue':_0x0182('0x2'),'comment':_0x0182('0x3')},'duration':{'type':Sequelize[_0x0182('0x4')]},'enterAt':{'type':Sequelize[_0x0182('0x5')]},'exitAt':{'type':Sequelize[_0x0182('0x5')],'set':function(_0x52db5b){var _0xa6875c=moment(_0x52db5b);var _0x4b905d=moment(this['getDataValue']('enterAt'));var _0x5a1579=_0xa6875c[_0x0182('0x6')](_0x4b905d,_0x0182('0x7'));this[_0x0182('0x8')](_0x0182('0x9'),_0x52db5b);this[_0x0182('0x8')]('duration',_0x5a1579||null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x0182('0x1')],'comment':_0x0182('0xa')},'data3':{'type':Sequelize[_0x0182('0x1')],'comment':_0x0182('0xb')},'data4':{'type':Sequelize[_0x0182('0x1')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0x0182('0xc')},'role':{'type':Sequelize[_0x0182('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5d9e=['exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue'];(function(_0x2ae0dd,_0x296acb){var _0x2426a9=function(_0x6870b1){while(--_0x6870b1){_0x2ae0dd['push'](_0x2ae0dd['shift']());}};_0x2426a9(++_0x296acb);}(_0x5d9e,0xd6));var _0xe5d9=function(_0x3e24d3,_0x5e969f){_0x3e24d3=_0x3e24d3-0x0;var _0x104797=_0x5d9e[_0x3e24d3];return _0x104797;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe5d9('0x0'));module[_0xe5d9('0x1')]={'channel':{'type':Sequelize[_0xe5d9('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xe5d9('0x2')]},'type':{'type':Sequelize[_0xe5d9('0x2')],'defaultValue':_0xe5d9('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xe5d9('0x4')]},'enterAt':{'type':Sequelize[_0xe5d9('0x5')]},'exitAt':{'type':Sequelize[_0xe5d9('0x5')],'set':function(_0x56d875){var _0x31fa13=moment(_0x56d875);var _0x15783a=moment(this[_0xe5d9('0x6')](_0xe5d9('0x7')));var _0x5e7c8d=_0x31fa13[_0xe5d9('0x8')](_0x15783a,'seconds');this[_0xe5d9('0x9')](_0xe5d9('0xa'),_0x56d875);this[_0xe5d9('0x9')]('duration',_0x5e7c8d||null);}},'data1':{'type':Sequelize[_0xe5d9('0x2')],'comment':_0xe5d9('0xb')},'data2':{'type':Sequelize[_0xe5d9('0x2')],'comment':_0xe5d9('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0xe5d9('0xd')},'data4':{'type':Sequelize[_0xe5d9('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xe5d9('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xe5d9('0x2')]},'internal':{'type':Sequelize[_0xe5d9('0x4')]},'uniqueid':{'type':Sequelize[_0xe5d9('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 5bbad83..e8affd5 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','key','filter','merge','include','catch','show','params','includeAll','options','create','body','find','describe','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','reject','update','destroy','then','end','error','stack','name','send','index','MemberReport','rawAttributes','model','query','keys','filters','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55ca,0x126));var _0xa55c=function(_0x2f7d18,_0x44bea6){_0x2f7d18=_0x2f7d18-0x0;var _0x425175=_0x55ca[_0x2f7d18];return _0x425175;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var hardwareService=require(_0xa55c('0x10'));var logger=require(_0xa55c('0x11'))(_0xa55c('0x12'));var utils=require(_0xa55c('0x13'));var config=require(_0xa55c('0x14'));var db=require(_0xa55c('0x15'))['db'];function respondWithStatusCode(_0x3998f7,_0x15eec8){_0x15eec8=_0x15eec8||0xcc;return function(_0x5d47ff){if(_0x5d47ff){return _0x3998f7['sendStatus'](_0x15eec8);}return _0x3998f7[_0xa55c('0x16')](_0x15eec8)['end']();};}function respondWithResult(_0x5a3672,_0x59ea8d){_0x59ea8d=_0x59ea8d||0xc8;return function(_0x18ee85){if(_0x18ee85){return _0x5a3672[_0xa55c('0x16')](_0x59ea8d)[_0xa55c('0x17')](_0x18ee85);}};}function respondWithFilteredResult(_0x938bd6,_0x458480){return function(_0x247e77){if(_0x247e77){var _0x4e0b2f=_0x247e77[_0xa55c('0x18')],_0x3ccf65=_0x458480[_0xa55c('0x19')],_0x3dcf4f=_0x458480[_0xa55c('0x19')]+_0x458480[_0xa55c('0x1a')],_0x25934f;if(_0x3dcf4f>=_0x4e0b2f){_0x3dcf4f=_0x4e0b2f;_0x25934f=0xc8;}else{_0x25934f=0xce;}_0x938bd6[_0xa55c('0x16')](_0x25934f);return _0x938bd6[_0xa55c('0x1b')]('Content-Range',_0x3ccf65+'-'+_0x3dcf4f+'/'+_0x4e0b2f)[_0xa55c('0x17')](_0x247e77);}return null;};}function patchUpdates(_0x104a99){return function(_0x461284){try{jsonpatch[_0xa55c('0x1c')](_0x461284,_0x104a99,!![]);}catch(_0x23a1ae){return BPromise[_0xa55c('0x1d')](_0x23a1ae);}return _0x461284['save']();};}function saveUpdates(_0x5f5158,_0xd643cc){return function(_0x3776ac){if(_0x3776ac){return _0x3776ac[_0xa55c('0x1e')](_0x5f5158)['then'](function(_0x383d92){return _0x383d92;});}return null;};}function removeEntity(_0x2fcb90,_0x54945a){return function(_0x187a87){if(_0x187a87){return _0x187a87[_0xa55c('0x1f')]()[_0xa55c('0x20')](function(){_0x2fcb90[_0xa55c('0x16')](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x49ed04,_0x1fc828){return function(_0x504c24){if(!_0x504c24){_0x49ed04['sendStatus'](0x194);}return _0x504c24;};}function handleError(_0x59d89a,_0x19ae88){_0x19ae88=_0x19ae88||0x1f4;return function(_0x54b038){logger[_0xa55c('0x22')](_0x54b038[_0xa55c('0x23')]);if(_0x54b038[_0xa55c('0x24')]){delete _0x54b038[_0xa55c('0x24')];}_0x59d89a[_0xa55c('0x16')](_0x19ae88)[_0xa55c('0x25')](_0x54b038);};}exports[_0xa55c('0x26')]=function(_0x11e7f7,_0x192df2){var _0x3cd152={},_0x1273d7={},_0x57f271={'count':0x0,'rows':[]};var _0x430d55=db[_0xa55c('0x27')][_0xa55c('0x28')];_0x1273d7[_0xa55c('0x29')]=_['keys'](_0x430d55);_0x1273d7[_0xa55c('0x2a')]=_[_0xa55c('0x2b')](_0x11e7f7[_0xa55c('0x2a')]);_0x1273d7[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_0x1273d7[_0xa55c('0x29')],_0x1273d7['query']);_0x3cd152[_0xa55c('0x2e')]=_['intersection'](_0x1273d7[_0xa55c('0x29')],qs[_0xa55c('0x2f')](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x2f')]));_0x3cd152['attributes']=_0x3cd152[_0xa55c('0x2e')][_0xa55c('0x30')]?_0x3cd152[_0xa55c('0x2e')]:_0x1273d7[_0xa55c('0x29')];if(!_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x31')](_0xa55c('0x32'))){_0x3cd152[_0xa55c('0x1a')]=qs[_0xa55c('0x1a')](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x1a')]);_0x3cd152['offset']=qs['offset'](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x19')]);}_0x3cd152['order']=qs[_0xa55c('0x33')](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x33')]);_0x3cd152[_0xa55c('0x34')]=qs[_0xa55c('0x2c')](_[_0xa55c('0x35')](_0x11e7f7[_0xa55c('0x2a')],_0x1273d7[_0xa55c('0x2c')]));if(_0x11e7f7[_0xa55c('0x2a')]['filter']){_0x3cd152['where']=_['merge'](_0x3cd152[_0xa55c('0x34')],{'$or':_[_0xa55c('0x36')](_0x430d55,function(_0x2bb4f0){if(_0x2bb4f0['type'][_0xa55c('0x37')]!=='VIRTUAL'){var _0x119220={};_0x119220[_0x2bb4f0['field']]={'$like':'%'+_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x38')]+'%'};return _0x119220;}})});}_0x3cd152=_[_0xa55c('0x39')]({},_0x3cd152,_0x11e7f7['options']);var _0x7c4a47={'where':_0x3cd152[_0xa55c('0x34')]};return db['MemberReport'][_0xa55c('0x18')](_0x7c4a47)[_0xa55c('0x20')](function(_0x4d9083){_0x57f271['count']=_0x4d9083;if(_0x11e7f7[_0xa55c('0x2a')]['includeAll']){_0x3cd152[_0xa55c('0x3a')]=[{'all':!![]}];}return db[_0xa55c('0x27')]['findAll'](_0x3cd152);})['then'](function(_0x5e50b6){_0x57f271['rows']=_0x5e50b6;return _0x57f271;})[_0xa55c('0x20')](respondWithFilteredResult(_0x192df2,_0x3cd152))[_0xa55c('0x3b')](handleError(_0x192df2,null));};exports[_0xa55c('0x3c')]=function(_0x99c4f8,_0x2d8cbf){var _0x56d17c={'raw':!![],'where':{'id':_0x99c4f8[_0xa55c('0x3d')]['id']}},_0x3d52d8={};_0x3d52d8[_0xa55c('0x29')]=_[_0xa55c('0x2b')](db[_0xa55c('0x27')][_0xa55c('0x28')]);_0x3d52d8['query']=_[_0xa55c('0x2b')](_0x99c4f8['query']);_0x3d52d8['filters']=_[_0xa55c('0x2d')](_0x3d52d8[_0xa55c('0x29')],_0x3d52d8['query']);_0x56d17c[_0xa55c('0x2e')]=_['intersection'](_0x3d52d8['model'],qs[_0xa55c('0x2f')](_0x99c4f8[_0xa55c('0x2a')][_0xa55c('0x2f')]));_0x56d17c['attributes']=_0x56d17c[_0xa55c('0x2e')][_0xa55c('0x30')]?_0x56d17c['attributes']:_0x3d52d8[_0xa55c('0x29')];if(_0x99c4f8['query'][_0xa55c('0x3e')]){_0x56d17c[_0xa55c('0x3a')]=[{'all':!![]}];}_0x56d17c=_['merge']({},_0x56d17c,_0x99c4f8[_0xa55c('0x3f')]);return db[_0xa55c('0x27')]['find'](_0x56d17c)[_0xa55c('0x20')](handleEntityNotFound(_0x2d8cbf,null))[_0xa55c('0x20')](respondWithResult(_0x2d8cbf,null))[_0xa55c('0x3b')](handleError(_0x2d8cbf,null));};exports['create']=function(_0x334f52,_0x582901){return db[_0xa55c('0x27')][_0xa55c('0x40')](_0x334f52[_0xa55c('0x41')],{})['then'](respondWithResult(_0x582901,0xc9))[_0xa55c('0x3b')](handleError(_0x582901,null));};exports[_0xa55c('0x1e')]=function(_0x592429,_0x3d19f5){if(_0x592429[_0xa55c('0x41')]['id']){delete _0x592429['body']['id'];}return db[_0xa55c('0x27')][_0xa55c('0x42')]({'where':{'id':_0x592429['params']['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x3d19f5,null))[_0xa55c('0x20')](saveUpdates(_0x592429[_0xa55c('0x41')],null))[_0xa55c('0x20')](respondWithResult(_0x3d19f5,null))['catch'](handleError(_0x3d19f5,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x27')][_0xa55c('0x42')]({'where':{'id':_0x58a7ea['params']['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](removeEntity(_0x2157d6,null))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x43')]=function(_0x34de95,_0x3822b7){return db[_0xa55c('0x27')][_0xa55c('0x43')]()[_0xa55c('0x20')](respondWithResult(_0x3822b7,null))[_0xa55c('0x3b')](handleError(_0x3822b7,null));}; \ No newline at end of file +var _0x34e8=['util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','key','VIRTUAL','field','options','MemberReport','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x4d7241,_0x32aa1f){var _0x59d9e2=function(_0x30e273){while(--_0x30e273){_0x4d7241['push'](_0x4d7241['shift']());}};_0x59d9e2(++_0x32aa1f);}(_0x34e8,0x12c));var _0x834e=function(_0x3bff9f,_0x31ccbf){_0x3bff9f=_0x3bff9f-0x0;var _0x2ca408=_0x34e8[_0x3bff9f];return _0x2ca408;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var db=require(_0x834e('0x1b'))['db'];function respondWithStatusCode(_0x2fd95c,_0x538bb3){_0x538bb3=_0x538bb3||0xcc;return function(_0x5e5b6d){if(_0x5e5b6d){return _0x2fd95c[_0x834e('0x1c')](_0x538bb3);}return _0x2fd95c['status'](_0x538bb3)[_0x834e('0x1d')]();};}function respondWithResult(_0x2d95f2,_0x28e659){_0x28e659=_0x28e659||0xc8;return function(_0x21cc0a){if(_0x21cc0a){return _0x2d95f2['status'](_0x28e659)[_0x834e('0x1e')](_0x21cc0a);}};}function respondWithFilteredResult(_0x302cbd,_0x57274a){return function(_0x316205){if(_0x316205){var _0x4a9cdc=_0x316205[_0x834e('0x1f')],_0x38a8cd=_0x57274a[_0x834e('0x20')],_0x36d443=_0x57274a[_0x834e('0x20')]+_0x57274a['limit'],_0x478afe;if(_0x36d443>=_0x4a9cdc){_0x36d443=_0x4a9cdc;_0x478afe=0xc8;}else{_0x478afe=0xce;}_0x302cbd[_0x834e('0x21')](_0x478afe);return _0x302cbd[_0x834e('0x22')](_0x834e('0x23'),_0x38a8cd+'-'+_0x36d443+'/'+_0x4a9cdc)[_0x834e('0x1e')](_0x316205);}return null;};}function patchUpdates(_0x237947){return function(_0x254677){try{jsonpatch[_0x834e('0x24')](_0x254677,_0x237947,!![]);}catch(_0x595515){return BPromise[_0x834e('0x25')](_0x595515);}return _0x254677[_0x834e('0x26')]();};}function saveUpdates(_0x113ff4,_0x325a99){return function(_0x4ab05d){if(_0x4ab05d){return _0x4ab05d[_0x834e('0x27')](_0x113ff4)[_0x834e('0x28')](function(_0x5a05c0){return _0x5a05c0;});}return null;};}function removeEntity(_0x1b4bdf,_0x28d687){return function(_0x8d406e){if(_0x8d406e){return _0x8d406e['destroy']()['then'](function(){_0x1b4bdf[_0x834e('0x21')](0xcc)[_0x834e('0x1d')]();});}};}function handleEntityNotFound(_0x589dde,_0x25ee1d){return function(_0x1dc1e0){if(!_0x1dc1e0){_0x589dde['sendStatus'](0x194);}return _0x1dc1e0;};}function handleError(_0x3bc4f7,_0x2e1983){_0x2e1983=_0x2e1983||0x1f4;return function(_0x338636){logger['error'](_0x338636[_0x834e('0x29')]);if(_0x338636[_0x834e('0x2a')]){delete _0x338636['name'];}_0x3bc4f7['status'](_0x2e1983)[_0x834e('0x2b')](_0x338636);};}exports['index']=function(_0x2826ec,_0x3f1b0b){var _0x3db026={},_0x2cc2eb={},_0x3cd928={'count':0x0,'rows':[]};var _0x130cc5=db['MemberReport']['rawAttributes'];_0x2cc2eb['model']=_['keys'](_0x130cc5);_0x2cc2eb[_0x834e('0x2c')]=_[_0x834e('0x2d')](_0x2826ec[_0x834e('0x2c')]);_0x2cc2eb['filters']=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],_0x2cc2eb[_0x834e('0x2c')]);_0x3db026[_0x834e('0x30')]=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],qs[_0x834e('0x31')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x31')]));_0x3db026['attributes']=_0x3db026[_0x834e('0x30')]['length']?_0x3db026[_0x834e('0x30')]:_0x2cc2eb[_0x834e('0x2f')];if(!_0x2826ec[_0x834e('0x2c')][_0x834e('0x32')](_0x834e('0x33'))){_0x3db026[_0x834e('0x34')]=qs[_0x834e('0x34')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x34')]);_0x3db026[_0x834e('0x20')]=qs['offset'](_0x2826ec[_0x834e('0x2c')][_0x834e('0x20')]);}_0x3db026[_0x834e('0x35')]=qs[_0x834e('0x36')](_0x2826ec['query'][_0x834e('0x36')]);_0x3db026[_0x834e('0x37')]=qs['filters'](_['pick'](_0x2826ec['query'],_0x2cc2eb[_0x834e('0x38')]));if(_0x2826ec[_0x834e('0x2c')][_0x834e('0x39')]){_0x3db026[_0x834e('0x37')]=_[_0x834e('0x3a')](_0x3db026[_0x834e('0x37')],{'$or':_['map'](_0x130cc5,function(_0x2c2d94){if(_0x2c2d94['type'][_0x834e('0x3b')]!==_0x834e('0x3c')){var _0x47abed={};_0x47abed[_0x2c2d94[_0x834e('0x3d')]]={'$like':'%'+_0x2826ec[_0x834e('0x2c')]['filter']+'%'};return _0x47abed;}})});}_0x3db026=_['merge']({},_0x3db026,_0x2826ec[_0x834e('0x3e')]);var _0xd0d43a={'where':_0x3db026[_0x834e('0x37')]};return db[_0x834e('0x3f')][_0x834e('0x1f')](_0xd0d43a)['then'](function(_0x1c5ed6){_0x3cd928['count']=_0x1c5ed6;if(_0x2826ec['query'][_0x834e('0x40')]){_0x3db026['include']=[{'all':!![]}];}return db[_0x834e('0x3f')][_0x834e('0x41')](_0x3db026);})[_0x834e('0x28')](function(_0x3c59af){_0x3cd928[_0x834e('0x42')]=_0x3c59af;return _0x3cd928;})['then'](respondWithFilteredResult(_0x3f1b0b,_0x3db026))[_0x834e('0x43')](handleError(_0x3f1b0b,null));};exports[_0x834e('0x44')]=function(_0x38f266,_0x58c5fb){var _0x35380e={'raw':!![],'where':{'id':_0x38f266['params']['id']}},_0x16ac45={};_0x16ac45[_0x834e('0x2f')]=_['keys'](db[_0x834e('0x3f')][_0x834e('0x45')]);_0x16ac45['query']=_['keys'](_0x38f266[_0x834e('0x2c')]);_0x16ac45[_0x834e('0x38')]=_[_0x834e('0x2e')](_0x16ac45[_0x834e('0x2f')],_0x16ac45[_0x834e('0x2c')]);_0x35380e[_0x834e('0x30')]=_[_0x834e('0x2e')](_0x16ac45['model'],qs[_0x834e('0x31')](_0x38f266['query'][_0x834e('0x31')]));_0x35380e['attributes']=_0x35380e[_0x834e('0x30')]['length']?_0x35380e[_0x834e('0x30')]:_0x16ac45[_0x834e('0x2f')];if(_0x38f266['query'][_0x834e('0x40')]){_0x35380e[_0x834e('0x46')]=[{'all':!![]}];}_0x35380e=_[_0x834e('0x3a')]({},_0x35380e,_0x38f266[_0x834e('0x3e')]);return db[_0x834e('0x3f')][_0x834e('0x47')](_0x35380e)[_0x834e('0x28')](handleEntityNotFound(_0x58c5fb,null))[_0x834e('0x28')](respondWithResult(_0x58c5fb,null))[_0x834e('0x43')](handleError(_0x58c5fb,null));};exports[_0x834e('0x48')]=function(_0x5f3943,_0x3124be){return db[_0x834e('0x3f')]['create'](_0x5f3943[_0x834e('0x49')],{})[_0x834e('0x28')](respondWithResult(_0x3124be,0xc9))[_0x834e('0x43')](handleError(_0x3124be,null));};exports[_0x834e('0x27')]=function(_0x19b5ef,_0x4264b8){if(_0x19b5ef['body']['id']){delete _0x19b5ef['body']['id'];}return db[_0x834e('0x3f')][_0x834e('0x47')]({'where':{'id':_0x19b5ef[_0x834e('0x4a')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x4264b8,null))[_0x834e('0x28')](saveUpdates(_0x19b5ef[_0x834e('0x49')],null))[_0x834e('0x28')](respondWithResult(_0x4264b8,null))[_0x834e('0x43')](handleError(_0x4264b8,null));};exports[_0x834e('0x4b')]=function(_0x390c45,_0xf02f0d){return db[_0x834e('0x3f')][_0x834e('0x47')]({'where':{'id':_0x390c45[_0x834e('0x4a')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x28')](removeEntity(_0xf02f0d,null))[_0x834e('0x43')](handleError(_0xf02f0d,null));};exports[_0x834e('0x4c')]=function(_0x420841,_0x1adf86){return db['MemberReport'][_0x834e('0x4c')]()[_0x834e('0x28')](respondWithResult(_0x1adf86,null))['catch'](handleError(_0x1adf86,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 72b6c54..1354621 100644 --- a/server/api/memberReport/memberReport.model.js +++ b/server/api/memberReport/memberReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbce8=['request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','report_member','membername','interface','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbce8,0x8a));var _0x8bce=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0xbce8[_0xb66df];return _0x42a702;};'use strict';var _=require(_0x8bce('0x0'));var util=require(_0x8bce('0x1'));var logger=require(_0x8bce('0x2'))(_0x8bce('0x3'));var moment=require(_0x8bce('0x4'));var BPromise=require(_0x8bce('0x5'));var rp=require(_0x8bce('0x6'));var fs=require('fs');var path=require(_0x8bce('0x7'));var rimraf=require(_0x8bce('0x8'));var config=require(_0x8bce('0x9'));var attributes=require(_0x8bce('0xa'));module[_0x8bce('0xb')]=function(_0x221e16,_0x1e2212){return _0x221e16[_0x8bce('0xc')]('MemberReport',attributes,{'tableName':_0x8bce('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x8bce('0xe'),_0x8bce('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x393e=['./memberReport.attributes','exports','define','MemberReport','membername_interface','membername','lodash','util','../../config/logger','request-promise','rimraf','../../config/environment'];(function(_0x244a15,_0x4aed42){var _0xb98b29=function(_0x5ad218){while(--_0x5ad218){_0x244a15['push'](_0x244a15['shift']());}};_0xb98b29(++_0x4aed42);}(_0x393e,0xae));var _0xe393=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x393e[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xe393('0x0'));var util=require(_0xe393('0x1'));var logger=require(_0xe393('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe393('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe393('0x4'));var config=require(_0xe393('0x5'));var attributes=require(_0xe393('0x6'));module[_0xe393('0x7')]=function(_0x5e02f8,_0x3aaa1c){return _0x5e02f8[_0xe393('0x8')](_0xe393('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xe393('0xa'),'fields':[_0xe393('0xb'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 03c3965..69b63b9 100644 --- a/server/api/memberReport/memberReport.rpc.js +++ b/server/api/memberReport/memberReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf30a=['MemberReport','create','body','UpdateMemberReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetMemberReport','findAll','options','raw','where','limit','include','map','model','attributes','CreateMemberReport'];(function(_0x3eadef,_0x4eb7fc){var _0x4db5e2=function(_0x25a430){while(--_0x25a430){_0x3eadef['push'](_0x3eadef['shift']());}};_0x4db5e2(++_0x4eb7fc);}(_0xf30a,0x1a7));var _0xaf30=function(_0x1d12e2,_0x2aace0){_0x1d12e2=_0x1d12e2-0x0;var _0x55be3a=_0xf30a[_0x1d12e2];return _0x55be3a;};'use strict';var _=require(_0xaf30('0x0'));var util=require(_0xaf30('0x1'));var moment=require(_0xaf30('0x2'));var BPromise=require(_0xaf30('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf30('0x4'));var db=require(_0xaf30('0x5'))['db'];var utils=require(_0xaf30('0x6'));var logger=require(_0xaf30('0x7'))(_0xaf30('0x8'));var config=require(_0xaf30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaf30('0xa')][_0xaf30('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x244a8b,_0x5e6db8,_0x155e09){return new BPromise(function(_0x521854,_0x369036){return client['request'](_0x244a8b,_0x155e09)[_0xaf30('0xc')](function(_0x9b6ced){logger[_0xaf30('0xd')](_0xaf30('0xe'),_0x5e6db8,_0xaf30('0xf'));logger[_0xaf30('0x10')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x5e6db8,_0xaf30('0xf'),JSON[_0xaf30('0x11')](_0x9b6ced));if(_0x9b6ced[_0xaf30('0x12')]){if(_0x9b6ced[_0xaf30('0x12')][_0xaf30('0x13')]===0x1f4){logger[_0xaf30('0x12')]('MemberReport,\x20%s,\x20%s',_0x5e6db8,_0x9b6ced[_0xaf30('0x12')][_0xaf30('0x14')]);return _0x369036(_0x9b6ced[_0xaf30('0x12')][_0xaf30('0x14')]);}logger[_0xaf30('0x12')](_0xaf30('0xe'),_0x5e6db8,_0x9b6ced[_0xaf30('0x12')][_0xaf30('0x14')]);return _0x521854(_0x9b6ced[_0xaf30('0x12')][_0xaf30('0x14')]);}else{logger[_0xaf30('0xd')](_0xaf30('0xe'),_0x5e6db8,'request\x20sent');_0x521854(_0x9b6ced['result']['message']);}})[_0xaf30('0x15')](function(_0xcf4fcd){logger['error'](_0xaf30('0xe'),_0x5e6db8,_0xcf4fcd);_0x369036(_0xcf4fcd);});});}exports[_0xaf30('0x16')]=function(_0x55f2e6){var _0x370cd5=this;return new Promise(function(_0x351d39,_0x408b11){return db['MemberReport'][_0xaf30('0x17')]({'raw':_0x55f2e6[_0xaf30('0x18')]?_0x55f2e6[_0xaf30('0x18')][_0xaf30('0x19')]===undefined?!![]:![]:!![],'where':_0x55f2e6[_0xaf30('0x18')]?_0x55f2e6[_0xaf30('0x18')][_0xaf30('0x1a')]||null:null,'attributes':_0x55f2e6[_0xaf30('0x18')]?_0x55f2e6['options']['attributes']||null:null,'limit':_0x55f2e6['options']?_0x55f2e6[_0xaf30('0x18')][_0xaf30('0x1b')]||null:null,'include':_0x55f2e6[_0xaf30('0x18')]?_0x55f2e6['options'][_0xaf30('0x1c')]?_[_0xaf30('0x1d')](_0x55f2e6[_0xaf30('0x18')]['include'],function(_0x27d860){return{'model':db[_0x27d860[_0xaf30('0x1e')]],'as':_0x27d860['as'],'attributes':_0x27d860['attributes'],'include':_0x27d860['include']?_[_0xaf30('0x1d')](_0x27d860['include'],function(_0x60d366){return{'model':db[_0x60d366['model']],'as':_0x60d366['as'],'attributes':_0x60d366[_0xaf30('0x1f')],'include':_0x60d366[_0xaf30('0x1c')]?_[_0xaf30('0x1d')](_0x60d366['include'],function(_0x53fa0d){return{'model':db[_0x53fa0d[_0xaf30('0x1e')]],'as':_0x53fa0d['as'],'attributes':_0x53fa0d['attributes']};}):[]};}):[]};}):[]:[]})[_0xaf30('0xc')](function(_0x53f033){logger[_0xaf30('0xd')](_0xaf30('0x16'),_0x55f2e6);logger[_0xaf30('0x10')]('GetMemberReport',_0x55f2e6,JSON[_0xaf30('0x11')](_0x53f033));_0x351d39(_0x53f033);})[_0xaf30('0x15')](function(_0x54276a){logger[_0xaf30('0x12')]('GetMemberReport',_0x54276a[_0xaf30('0x14')],_0x55f2e6);_0x408b11(_0x370cd5[_0xaf30('0x12')](0x1f4,_0x54276a[_0xaf30('0x14')]));});});};exports[_0xaf30('0x20')]=function(_0x1d9c82){var _0x5e1b04=this;return new Promise(function(_0x132a52,_0x4f20ff){return db[_0xaf30('0x21')][_0xaf30('0x22')](_0x1d9c82[_0xaf30('0x23')],{'raw':_0x1d9c82[_0xaf30('0x18')]?_0x1d9c82[_0xaf30('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xaf30('0xc')](function(_0x3723ab){logger[_0xaf30('0xd')](_0xaf30('0x20'),_0x1d9c82);logger[_0xaf30('0x10')]('CreateMemberReport',_0x1d9c82,JSON[_0xaf30('0x11')](_0x3723ab));_0x132a52(_0x3723ab);})[_0xaf30('0x15')](function(_0x5c4034){logger[_0xaf30('0x12')](_0xaf30('0x20'),_0x5c4034[_0xaf30('0x14')],_0x1d9c82);_0x4f20ff(_0x5e1b04['error'](0x1f4,_0x5c4034['message']));});});};exports[_0xaf30('0x24')]=function(_0x4cba83){var _0x3fe12d=this;return new Promise(function(_0x171eef,_0x3550bc){return db[_0xaf30('0x21')][_0xaf30('0x25')](_0x4cba83['body'],{'raw':_0x4cba83[_0xaf30('0x18')]?_0x4cba83['options'][_0xaf30('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cba83[_0xaf30('0x18')]?_0x4cba83[_0xaf30('0x18')][_0xaf30('0x1a')]||null:null,'attributes':_0x4cba83['options']?_0x4cba83[_0xaf30('0x18')][_0xaf30('0x1f')]||null:null,'limit':_0x4cba83[_0xaf30('0x18')]?_0x4cba83[_0xaf30('0x18')][_0xaf30('0x1b')]||null:null})['then'](function(_0x2114b3){logger[_0xaf30('0xd')](_0xaf30('0x24'),_0x4cba83);logger[_0xaf30('0x10')](_0xaf30('0x24'),_0x4cba83,JSON[_0xaf30('0x11')](_0x2114b3));_0x171eef(_0x2114b3);})['catch'](function(_0x364ce5){logger[_0xaf30('0x12')](_0xaf30('0x24'),_0x364ce5['message'],_0x4cba83);_0x3550bc(_0x3fe12d['error'](0x1f4,_0x364ce5[_0xaf30('0x14')]));});});}; \ No newline at end of file +var _0x03e6=['MemberReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetMemberReport','findAll','options','attributes','include','map','model','stringify','CreateMemberReport','MemberReport','body','raw','update','where','limit','then','UpdateMemberReport','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x34e666,_0x4ee316){var _0x593b64=function(_0xf168e6){while(--_0xf168e6){_0x34e666['push'](_0x34e666['shift']());}};_0x593b64(++_0x4ee316);}(_0x03e6,0x17e));var _0x603e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x03e6[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x603e('0x0'));var BPromise=require('bluebird');var rs=require(_0x603e('0x1'));var fs=require('fs');var Redis=require(_0x603e('0x2'));var db=require(_0x603e('0x3'))['db'];var utils=require(_0x603e('0x4'));var logger=require(_0x603e('0x5'))(_0x603e('0x6'));var config=require(_0x603e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x603e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x274558,_0x1a6657,_0x2dd348){return new BPromise(function(_0x5e172b,_0x4cf008){return client[_0x603e('0x9')](_0x274558,_0x2dd348)['then'](function(_0xb12551){logger[_0x603e('0xa')](_0x603e('0xb'),_0x1a6657,_0x603e('0xc'));logger[_0x603e('0xd')](_0x603e('0xe'),_0x1a6657,_0x603e('0xc'),JSON['stringify'](_0xb12551));if(_0xb12551[_0x603e('0xf')]){if(_0xb12551['error']['code']===0x1f4){logger['error'](_0x603e('0xb'),_0x1a6657,_0xb12551[_0x603e('0xf')][_0x603e('0x10')]);return _0x4cf008(_0xb12551['error'][_0x603e('0x10')]);}logger['error'](_0x603e('0xb'),_0x1a6657,_0xb12551['error'][_0x603e('0x10')]);return _0x5e172b(_0xb12551[_0x603e('0xf')]['message']);}else{logger[_0x603e('0xa')]('MemberReport,\x20%s,\x20%s',_0x1a6657,_0x603e('0xc'));_0x5e172b(_0xb12551[_0x603e('0x11')]['message']);}})[_0x603e('0x12')](function(_0x2d45d4){logger[_0x603e('0xf')](_0x603e('0xb'),_0x1a6657,_0x2d45d4);_0x4cf008(_0x2d45d4);});});}exports[_0x603e('0x13')]=function(_0x190473){var _0x18bd46=this;return new Promise(function(_0x23c93d,_0x129623){return db['MemberReport'][_0x603e('0x14')]({'raw':_0x190473[_0x603e('0x15')]?_0x190473[_0x603e('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x190473[_0x603e('0x15')]?_0x190473[_0x603e('0x15')]['where']||null:null,'attributes':_0x190473[_0x603e('0x15')]?_0x190473[_0x603e('0x15')][_0x603e('0x16')]||null:null,'limit':_0x190473['options']?_0x190473['options']['limit']||null:null,'include':_0x190473[_0x603e('0x15')]?_0x190473['options'][_0x603e('0x17')]?_[_0x603e('0x18')](_0x190473[_0x603e('0x15')]['include'],function(_0x30a118){return{'model':db[_0x30a118[_0x603e('0x19')]],'as':_0x30a118['as'],'attributes':_0x30a118['attributes'],'include':_0x30a118[_0x603e('0x17')]?_[_0x603e('0x18')](_0x30a118[_0x603e('0x17')],function(_0x26b910){return{'model':db[_0x26b910[_0x603e('0x19')]],'as':_0x26b910['as'],'attributes':_0x26b910[_0x603e('0x16')],'include':_0x26b910[_0x603e('0x17')]?_[_0x603e('0x18')](_0x26b910['include'],function(_0x2580ef){return{'model':db[_0x2580ef[_0x603e('0x19')]],'as':_0x2580ef['as'],'attributes':_0x2580ef['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x56f126){logger[_0x603e('0xa')](_0x603e('0x13'),_0x190473);logger[_0x603e('0xd')](_0x603e('0x13'),_0x190473,JSON[_0x603e('0x1a')](_0x56f126));_0x23c93d(_0x56f126);})['catch'](function(_0x4a88c7){logger[_0x603e('0xf')](_0x603e('0x13'),_0x4a88c7['message'],_0x190473);_0x129623(_0x18bd46[_0x603e('0xf')](0x1f4,_0x4a88c7[_0x603e('0x10')]));});});};exports[_0x603e('0x1b')]=function(_0x1666ff){var _0x4080cd=this;return new Promise(function(_0x40eb10,_0x2b084b){return db[_0x603e('0x1c')]['create'](_0x1666ff[_0x603e('0x1d')],{'raw':_0x1666ff[_0x603e('0x15')]?_0x1666ff['options'][_0x603e('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x185f15){logger[_0x603e('0xa')]('CreateMemberReport',_0x1666ff);logger[_0x603e('0xd')](_0x603e('0x1b'),_0x1666ff,JSON[_0x603e('0x1a')](_0x185f15));_0x40eb10(_0x185f15);})[_0x603e('0x12')](function(_0x3176dd){logger[_0x603e('0xf')](_0x603e('0x1b'),_0x3176dd[_0x603e('0x10')],_0x1666ff);_0x2b084b(_0x4080cd[_0x603e('0xf')](0x1f4,_0x3176dd[_0x603e('0x10')]));});});};exports['UpdateMemberReport']=function(_0x1fa65b){var _0x1e1f81=this;return new Promise(function(_0x24c4fd,_0x65cb3d){return db['MemberReport'][_0x603e('0x1f')](_0x1fa65b[_0x603e('0x1d')],{'raw':_0x1fa65b[_0x603e('0x15')]?_0x1fa65b[_0x603e('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fa65b[_0x603e('0x15')]?_0x1fa65b[_0x603e('0x15')][_0x603e('0x20')]||null:null,'attributes':_0x1fa65b[_0x603e('0x15')]?_0x1fa65b[_0x603e('0x15')][_0x603e('0x16')]||null:null,'limit':_0x1fa65b[_0x603e('0x15')]?_0x1fa65b[_0x603e('0x15')][_0x603e('0x21')]||null:null})[_0x603e('0x22')](function(_0x5c0e0b){logger[_0x603e('0xa')](_0x603e('0x23'),_0x1fa65b);logger[_0x603e('0xd')](_0x603e('0x23'),_0x1fa65b,JSON['stringify'](_0x5c0e0b));_0x24c4fd(_0x5c0e0b);})[_0x603e('0x12')](function(_0x48f36b){logger[_0x603e('0xf')](_0x603e('0x23'),_0x48f36b[_0x603e('0x10')],_0x1fa65b);_0x65cb3d(_0x1e1f81[_0x603e('0xf')](0x1f4,_0x48f36b[_0x603e('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index b1649ca..76a6fb1 100644 --- a/server/api/migration/index.js +++ b/server/api/migration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb58b=['index','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x104ef0,_0x5bc45c){var _0x56c3be=function(_0x2b34ff){while(--_0x2b34ff){_0x104ef0['push'](_0x104ef0['shift']());}};_0x56c3be(++_0x5bc45c);}(_0xb58b,0x1f1));var _0xbb58=function(_0x456bcf,_0x1bd613){_0x456bcf=_0x456bcf-0x0;var _0x24fa15=_0xb58b[_0x456bcf];return _0x24fa15;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var auth=require(_0xbb58('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbb58('0x5'));var controller=require('./migration.controller');router[_0xbb58('0x6')]('/',controller[_0xbb58('0x7')]);module[_0xbb58('0x8')]=router; \ No newline at end of file +var _0x9354=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','./migration.controller','get','index','exports'];(function(_0x188c5f,_0x107313){var _0x42eca7=function(_0x13825f){while(--_0x13825f){_0x188c5f['push'](_0x188c5f['shift']());}};_0x42eca7(++_0x107313);}(_0x9354,0x96));var _0x4935=function(_0x2d3ab3,_0x47d90b){_0x2d3ab3=_0x2d3ab3-0x0;var _0x321f9e=_0x9354[_0x2d3ab3];return _0x321f9e;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var auth=require(_0x4935('0x4'));var interaction=require(_0x4935('0x5'));var config=require('../../config/environment');var controller=require(_0x4935('0x6'));router[_0x4935('0x7')]('/',controller[_0x4935('0x8')]);module[_0x4935('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index d02ef9a..d1e5b9a 100644 --- a/server/api/migration/migration.attributes.js +++ b/server/api/migration/migration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x769b=['version','sequelize'];(function(_0x423f26,_0x153cab){var _0x3ed60f=function(_0x3328bc){while(--_0x3328bc){_0x423f26['push'](_0x423f26['shift']());}};_0x3ed60f(++_0x153cab);}(_0x769b,0x1a9));var _0xb769=function(_0x305a55,_0x350bf0){_0x305a55=_0x305a55-0x0;var _0x2ac39a=_0x769b[_0x305a55];return _0x2ac39a;};'use strict';var Sequelize=require(_0xb769('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0xb769('0x1')}}; \ No newline at end of file +var _0x3628=['sequelize','STRING','version'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3628,0x78));var _0x8362=function(_0x91d019,_0x5223c4){_0x91d019=_0x91d019-0x0;var _0x19de1f=_0x3628[_0x91d019];return _0x19de1f;};'use strict';var Sequelize=require(_0x8362('0x0'));module['exports']={'version':{'type':Sequelize[_0x8362('0x1')],'unique':_0x8362('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index fe84394..04c8b15 100644 --- a/server/api/migration/migration.controller.js +++ b/server/api/migration/migration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3624=['model','keys','query','intersection','attributes','fields','hasOwnProperty','order','filters','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','then','error','stack','name','send','Migration','rawAttributes'];(function(_0x213a12,_0x235891){var _0x5cb408=function(_0x420c9e){while(--_0x420c9e){_0x213a12['push'](_0x213a12['shift']());}};_0x5cb408(++_0x235891);}(_0x3624,0x152));var _0x4362=function(_0x37e845,_0x219f9f){_0x37e845=_0x37e845-0x0;var _0x59e55b=_0x3624[_0x37e845];return _0x59e55b;};'use strict';var pdf=require(_0x4362('0x0'));var emlformat=require(_0x4362('0x1'));var rimraf=require(_0x4362('0x2'));var zipdir=require(_0x4362('0x3'));var jsonpatch=require(_0x4362('0x4'));var rp=require(_0x4362('0x5'));var moment=require('moment');var BPromise=require(_0x4362('0x6'));var Mustache=require(_0x4362('0x7'));var util=require(_0x4362('0x8'));var path=require(_0x4362('0x9'));var sox=require(_0x4362('0xa'));var csv=require(_0x4362('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4362('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4362('0xd'));var deskjs=require(_0x4362('0xe'));var toCsv=require(_0x4362('0xb'));var querystring=require('querystring');var Papa=require(_0x4362('0xf'));var Redis=require('ioredis');var authService=require(_0x4362('0x10'));var qs=require(_0x4362('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4362('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4362('0x13'))['db'];function respondWithStatusCode(_0xe2f813,_0xa881a){_0xa881a=_0xa881a||0xcc;return function(_0x47c174){if(_0x47c174){return _0xe2f813[_0x4362('0x14')](_0xa881a);}return _0xe2f813['status'](_0xa881a)[_0x4362('0x15')]();};}function respondWithResult(_0x37e29f,_0x4b4263){_0x4b4263=_0x4b4263||0xc8;return function(_0x3dcb54){if(_0x3dcb54){return _0x37e29f[_0x4362('0x16')](_0x4b4263)['json'](_0x3dcb54);}};}function respondWithFilteredResult(_0x11a5f5,_0x255581){return function(_0x13a3e1){if(_0x13a3e1){var _0x274459=_0x13a3e1[_0x4362('0x17')],_0x23d852=_0x255581[_0x4362('0x18')],_0x2795ea=_0x255581[_0x4362('0x18')]+_0x255581[_0x4362('0x19')],_0xb94747;if(_0x2795ea>=_0x274459){_0x2795ea=_0x274459;_0xb94747=0xc8;}else{_0xb94747=0xce;}_0x11a5f5[_0x4362('0x16')](_0xb94747);return _0x11a5f5[_0x4362('0x1a')](_0x4362('0x1b'),_0x23d852+'-'+_0x2795ea+'/'+_0x274459)[_0x4362('0x1c')](_0x13a3e1);}return null;};}function patchUpdates(_0x1e2eba){return function(_0x5849c7){try{jsonpatch[_0x4362('0x1d')](_0x5849c7,_0x1e2eba,!![]);}catch(_0x147b85){return BPromise['reject'](_0x147b85);}return _0x5849c7[_0x4362('0x1e')]();};}function saveUpdates(_0x16abb3,_0x9badc7){return function(_0x487327){if(_0x487327){return _0x487327[_0x4362('0x1f')](_0x16abb3)['then'](function(_0x588ef9){return _0x588ef9;});}return null;};}function removeEntity(_0x20791a,_0xfda184){return function(_0x493957){if(_0x493957){return _0x493957[_0x4362('0x20')]()[_0x4362('0x21')](function(){_0x20791a['status'](0xcc)[_0x4362('0x15')]();});}};}function handleEntityNotFound(_0x18bb98,_0x381c4f){return function(_0x57b115){if(!_0x57b115){_0x18bb98[_0x4362('0x14')](0x194);}return _0x57b115;};}function handleError(_0x2b898b,_0x1622bc){_0x1622bc=_0x1622bc||0x1f4;return function(_0x5c1d47){logger[_0x4362('0x22')](_0x5c1d47[_0x4362('0x23')]);if(_0x5c1d47[_0x4362('0x24')]){delete _0x5c1d47[_0x4362('0x24')];}_0x2b898b['status'](_0x1622bc)[_0x4362('0x25')](_0x5c1d47);};}exports['index']=function(_0x50cdfb,_0x2032ec){var _0x40ca97={},_0x4083e5={},_0x5791d3={'count':0x0,'rows':[]};var _0x3d4347=db[_0x4362('0x26')][_0x4362('0x27')];_0x4083e5[_0x4362('0x28')]=_[_0x4362('0x29')](_0x3d4347);_0x4083e5[_0x4362('0x2a')]=_[_0x4362('0x29')](_0x50cdfb[_0x4362('0x2a')]);_0x4083e5['filters']=_[_0x4362('0x2b')](_0x4083e5[_0x4362('0x28')],_0x4083e5[_0x4362('0x2a')]);_0x40ca97[_0x4362('0x2c')]=_[_0x4362('0x2b')](_0x4083e5['model'],qs[_0x4362('0x2d')](_0x50cdfb[_0x4362('0x2a')]['fields']));_0x40ca97[_0x4362('0x2c')]=_0x40ca97[_0x4362('0x2c')]['length']?_0x40ca97[_0x4362('0x2c')]:_0x4083e5[_0x4362('0x28')];if(!_0x50cdfb['query'][_0x4362('0x2e')]('nolimit')){_0x40ca97[_0x4362('0x19')]=qs['limit'](_0x50cdfb[_0x4362('0x2a')][_0x4362('0x19')]);_0x40ca97['offset']=qs[_0x4362('0x18')](_0x50cdfb[_0x4362('0x2a')]['offset']);}_0x40ca97[_0x4362('0x2f')]=qs['sort'](_0x50cdfb[_0x4362('0x2a')]['sort']);_0x40ca97['where']=qs[_0x4362('0x30')](_['pick'](_0x50cdfb[_0x4362('0x2a')],_0x4083e5[_0x4362('0x30')]));if(_0x50cdfb['query'][_0x4362('0x31')]){_0x40ca97[_0x4362('0x32')]=_[_0x4362('0x33')](_0x40ca97['where'],{'$or':_[_0x4362('0x34')](_0x3d4347,function(_0x451e9f){if(_0x451e9f[_0x4362('0x35')][_0x4362('0x36')]!==_0x4362('0x37')){var _0x570e9d={};_0x570e9d[_0x451e9f[_0x4362('0x38')]]={'$like':'%'+_0x50cdfb[_0x4362('0x2a')][_0x4362('0x31')]+'%'};return _0x570e9d;}})});}_0x40ca97=_[_0x4362('0x33')]({},_0x40ca97,_0x50cdfb[_0x4362('0x39')]);var _0x54d92b={'where':_0x40ca97[_0x4362('0x32')]};return db['Migration'][_0x4362('0x17')](_0x54d92b)['then'](function(_0x487295){_0x5791d3[_0x4362('0x17')]=_0x487295;if(_0x50cdfb[_0x4362('0x2a')][_0x4362('0x3a')]){_0x40ca97[_0x4362('0x3b')]=[{'all':!![]}];}return db[_0x4362('0x26')][_0x4362('0x3c')](_0x40ca97);})[_0x4362('0x21')](function(_0x2eb628){_0x5791d3[_0x4362('0x3d')]=_0x2eb628;return _0x5791d3;})['then'](respondWithFilteredResult(_0x2032ec,_0x40ca97))[_0x4362('0x3e')](handleError(_0x2032ec,null));}; \ No newline at end of file +var _0x6738=['sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','Migration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','map','key','VIRTUAL','field','options','findAll','rows','catch','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0xadf242,_0x1078e7){var _0x8cf5dc=function(_0x560194){while(--_0x560194){_0xadf242['push'](_0xadf242['shift']());}};_0x8cf5dc(++_0x1078e7);}(_0x6738,0x16f));var _0x8673=function(_0x5c3598,_0x16b3c0){_0x5c3598=_0x5c3598-0x0;var _0x17e099=_0x6738[_0x5c3598];return _0x17e099;};'use strict';var pdf=require(_0x8673('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8673('0x1'));var zipdir=require(_0x8673('0x2'));var jsonpatch=require(_0x8673('0x3'));var rp=require(_0x8673('0x4'));var moment=require(_0x8673('0x5'));var BPromise=require(_0x8673('0x6'));var Mustache=require(_0x8673('0x7'));var util=require(_0x8673('0x8'));var path=require(_0x8673('0x9'));var sox=require('sox');var csv=require(_0x8673('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8673('0xb'));var squel=require(_0x8673('0xc'));var crypto=require(_0x8673('0xd'));var jsforce=require(_0x8673('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8673('0xa'));var querystring=require('querystring');var Papa=require(_0x8673('0xf'));var Redis=require(_0x8673('0x10'));var authService=require(_0x8673('0x11'));var qs=require(_0x8673('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8673('0x13'));var utils=require(_0x8673('0x14'));var config=require(_0x8673('0x15'));var db=require(_0x8673('0x16'))['db'];function respondWithStatusCode(_0x40e9ea,_0x21415d){_0x21415d=_0x21415d||0xcc;return function(_0x3aea98){if(_0x3aea98){return _0x40e9ea[_0x8673('0x17')](_0x21415d);}return _0x40e9ea['status'](_0x21415d)[_0x8673('0x18')]();};}function respondWithResult(_0x417c54,_0xbe1468){_0xbe1468=_0xbe1468||0xc8;return function(_0x20dda6){if(_0x20dda6){return _0x417c54[_0x8673('0x19')](_0xbe1468)[_0x8673('0x1a')](_0x20dda6);}};}function respondWithFilteredResult(_0x5dad80,_0x57c03d){return function(_0xf3794e){if(_0xf3794e){var _0x1f60c6=_0xf3794e[_0x8673('0x1b')],_0x5c1190=_0x57c03d['offset'],_0x1f61af=_0x57c03d[_0x8673('0x1c')]+_0x57c03d['limit'],_0x5324bf;if(_0x1f61af>=_0x1f60c6){_0x1f61af=_0x1f60c6;_0x5324bf=0xc8;}else{_0x5324bf=0xce;}_0x5dad80[_0x8673('0x19')](_0x5324bf);return _0x5dad80[_0x8673('0x1d')](_0x8673('0x1e'),_0x5c1190+'-'+_0x1f61af+'/'+_0x1f60c6)[_0x8673('0x1a')](_0xf3794e);}return null;};}function patchUpdates(_0x1939fc){return function(_0x2dc92a){try{jsonpatch[_0x8673('0x1f')](_0x2dc92a,_0x1939fc,!![]);}catch(_0x74c85e){return BPromise[_0x8673('0x20')](_0x74c85e);}return _0x2dc92a['save']();};}function saveUpdates(_0x5c6e6c,_0x227335){return function(_0x34a51a){if(_0x34a51a){return _0x34a51a[_0x8673('0x21')](_0x5c6e6c)['then'](function(_0x1c956f){return _0x1c956f;});}return null;};}function removeEntity(_0x8138f0,_0x59d37e){return function(_0x3e06a1){if(_0x3e06a1){return _0x3e06a1[_0x8673('0x22')]()[_0x8673('0x23')](function(){_0x8138f0[_0x8673('0x19')](0xcc)[_0x8673('0x18')]();});}};}function handleEntityNotFound(_0x1ac5eb,_0x306792){return function(_0x5ebc41){if(!_0x5ebc41){_0x1ac5eb[_0x8673('0x17')](0x194);}return _0x5ebc41;};}function handleError(_0x1d7f07,_0x52afec){_0x52afec=_0x52afec||0x1f4;return function(_0x44e003){logger[_0x8673('0x24')](_0x44e003[_0x8673('0x25')]);if(_0x44e003[_0x8673('0x26')]){delete _0x44e003['name'];}_0x1d7f07[_0x8673('0x19')](_0x52afec)[_0x8673('0x27')](_0x44e003);};}exports['index']=function(_0x23c581,_0xe0c85c){var _0x2533be={},_0x44a297={},_0x1f72a6={'count':0x0,'rows':[]};var _0x4e834a=db[_0x8673('0x28')][_0x8673('0x29')];_0x44a297[_0x8673('0x2a')]=_[_0x8673('0x2b')](_0x4e834a);_0x44a297[_0x8673('0x2c')]=_[_0x8673('0x2b')](_0x23c581[_0x8673('0x2c')]);_0x44a297[_0x8673('0x2d')]=_[_0x8673('0x2e')](_0x44a297[_0x8673('0x2a')],_0x44a297[_0x8673('0x2c')]);_0x2533be['attributes']=_['intersection'](_0x44a297[_0x8673('0x2a')],qs[_0x8673('0x2f')](_0x23c581[_0x8673('0x2c')][_0x8673('0x2f')]));_0x2533be[_0x8673('0x30')]=_0x2533be[_0x8673('0x30')][_0x8673('0x31')]?_0x2533be[_0x8673('0x30')]:_0x44a297[_0x8673('0x2a')];if(!_0x23c581[_0x8673('0x2c')][_0x8673('0x32')](_0x8673('0x33'))){_0x2533be['limit']=qs[_0x8673('0x34')](_0x23c581['query'][_0x8673('0x34')]);_0x2533be[_0x8673('0x1c')]=qs[_0x8673('0x1c')](_0x23c581[_0x8673('0x2c')][_0x8673('0x1c')]);}_0x2533be['order']=qs['sort'](_0x23c581['query'][_0x8673('0x35')]);_0x2533be[_0x8673('0x36')]=qs[_0x8673('0x2d')](_[_0x8673('0x37')](_0x23c581['query'],_0x44a297[_0x8673('0x2d')]));if(_0x23c581['query'][_0x8673('0x38')]){_0x2533be[_0x8673('0x36')]=_['merge'](_0x2533be[_0x8673('0x36')],{'$or':_[_0x8673('0x39')](_0x4e834a,function(_0x211bb4){if(_0x211bb4['type'][_0x8673('0x3a')]!==_0x8673('0x3b')){var _0x447616={};_0x447616[_0x211bb4[_0x8673('0x3c')]]={'$like':'%'+_0x23c581[_0x8673('0x2c')][_0x8673('0x38')]+'%'};return _0x447616;}})});}_0x2533be=_['merge']({},_0x2533be,_0x23c581[_0x8673('0x3d')]);var _0x8f5e6={'where':_0x2533be['where']};return db[_0x8673('0x28')][_0x8673('0x1b')](_0x8f5e6)['then'](function(_0xcf13cf){_0x1f72a6[_0x8673('0x1b')]=_0xcf13cf;if(_0x23c581[_0x8673('0x2c')]['includeAll']){_0x2533be['include']=[{'all':!![]}];}return db[_0x8673('0x28')][_0x8673('0x3e')](_0x2533be);})[_0x8673('0x23')](function(_0x756359){_0x1f72a6[_0x8673('0x3f')]=_0x756359;return _0x1f72a6;})[_0x8673('0x23')](respondWithFilteredResult(_0xe0c85c,_0x2533be))[_0x8673('0x40')](handleError(_0xe0c85c,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 519d80a..d5daba9 100644 --- a/server/api/migration/migration.model.js +++ b/server/api/migration/migration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65df=['request-promise','path','rimraf','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api','bluebird'];(function(_0x49d40d,_0x30e0ea){var _0x5ec463=function(_0x11bab1){while(--_0x11bab1){_0x49d40d['push'](_0x49d40d['shift']());}};_0x5ec463(++_0x30e0ea);}(_0x65df,0x18e));var _0xf65d=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x65df[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xf65d('0x0'));var util=require(_0xf65d('0x1'));var logger=require(_0xf65d('0x2'))(_0xf65d('0x3'));var moment=require('moment');var BPromise=require(_0xf65d('0x4'));var rp=require(_0xf65d('0x5'));var fs=require('fs');var path=require(_0xf65d('0x6'));var rimraf=require(_0xf65d('0x7'));var config=require('../../config/environment');var attributes=require(_0xf65d('0x8'));module[_0xf65d('0x9')]=function(_0x4040cb,_0x45de8a){return _0x4040cb[_0xf65d('0xa')](_0xf65d('0xb'),attributes,{'tableName':_0xf65d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb27=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','lodash','util'];(function(_0xf18655,_0x55f5b9){var _0x53759e=function(_0x458a9e){while(--_0x458a9e){_0xf18655['push'](_0xf18655['shift']());}};_0x53759e(++_0x55f5b9);}(_0xcb27,0xe2));var _0x7cb2=function(_0x508669,_0x168539){_0x508669=_0x508669-0x0;var _0x12b610=_0xcb27[_0x508669];return _0x12b610;};'use strict';var _=require(_0x7cb2('0x0'));var util=require(_0x7cb2('0x1'));var logger=require(_0x7cb2('0x2'))('api');var moment=require(_0x7cb2('0x3'));var BPromise=require(_0x7cb2('0x4'));var rp=require(_0x7cb2('0x5'));var fs=require('fs');var path=require(_0x7cb2('0x6'));var rimraf=require(_0x7cb2('0x7'));var config=require(_0x7cb2('0x8'));var attributes=require(_0x7cb2('0x9'));module[_0x7cb2('0xa')]=function(_0x25d8c7,_0x527b05){return _0x25d8c7[_0x7cb2('0xb')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 7c5c45d..088d2c0 100644 --- a/server/api/migration/migration.rpc.js +++ b/server/api/migration/migration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf349=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s'];(function(_0xf589d9,_0x2bbcb7){var _0x5c52f7=function(_0xce08e7){while(--_0xce08e7){_0xf589d9['push'](_0xf589d9['shift']());}};_0x5c52f7(++_0x2bbcb7);}(_0xf349,0xab));var _0x9f34=function(_0x7cacf9,_0x6dac99){_0x7cacf9=_0x7cacf9-0x0;var _0xde6456=_0xf349[_0x7cacf9];return _0xde6456;};'use strict';var _=require(_0x9f34('0x0'));var util=require(_0x9f34('0x1'));var moment=require(_0x9f34('0x2'));var BPromise=require(_0x9f34('0x3'));var rs=require(_0x9f34('0x4'));var fs=require('fs');var Redis=require(_0x9f34('0x5'));var db=require(_0x9f34('0x6'))['db'];var utils=require(_0x9f34('0x7'));var logger=require(_0x9f34('0x8'))(_0x9f34('0x9'));var config=require(_0x9f34('0xa'));var jayson=require(_0x9f34('0xb'));var client=jayson[_0x9f34('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12ac82,_0x5ea61d,_0x591f9d){return new BPromise(function(_0x50dc34,_0x2903be){return client['request'](_0x12ac82,_0x591f9d)[_0x9f34('0xd')](function(_0x58fb27){logger[_0x9f34('0xe')]('Migration,\x20%s,\x20%s',_0x5ea61d,_0x9f34('0xf'));logger['debug'](_0x9f34('0x10'),_0x5ea61d,_0x9f34('0xf'),JSON[_0x9f34('0x11')](_0x58fb27));if(_0x58fb27['error']){if(_0x58fb27[_0x9f34('0x12')][_0x9f34('0x13')]===0x1f4){logger['error'](_0x9f34('0x14'),_0x5ea61d,_0x58fb27[_0x9f34('0x12')][_0x9f34('0x15')]);return _0x2903be(_0x58fb27['error'][_0x9f34('0x15')]);}logger[_0x9f34('0x12')](_0x9f34('0x14'),_0x5ea61d,_0x58fb27['error'][_0x9f34('0x15')]);return _0x50dc34(_0x58fb27[_0x9f34('0x12')][_0x9f34('0x15')]);}else{logger[_0x9f34('0xe')](_0x9f34('0x14'),_0x5ea61d,_0x9f34('0xf'));_0x50dc34(_0x58fb27[_0x9f34('0x16')]['message']);}})[_0x9f34('0x17')](function(_0x30423a){logger[_0x9f34('0x12')](_0x9f34('0x14'),_0x5ea61d,_0x30423a);_0x2903be(_0x30423a);});});} \ No newline at end of file +var _0xdade=['jayson/promise','client','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','code','error','message','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x3fe7bd,_0x7fd78e){var _0x4a7262=function(_0x16ea21){while(--_0x16ea21){_0x3fe7bd['push'](_0x3fe7bd['shift']());}};_0x4a7262(++_0x7fd78e);}(_0xdade,0x13a));var _0xedad=function(_0x47087,_0x24eadd){_0x47087=_0x47087-0x0;var _0x2fba8c=_0xdade[_0x47087];return _0x2fba8c;};'use strict';var _=require('lodash');var util=require(_0xedad('0x0'));var moment=require(_0xedad('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xedad('0x2'));var db=require(_0xedad('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xedad('0x4'))('rpc');var config=require(_0xedad('0x5'));var jayson=require(_0xedad('0x6'));var client=jayson[_0xedad('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41d9d2,_0xfbbda0,_0x2305dd){return new BPromise(function(_0xf3197,_0x49f230){return client['request'](_0x41d9d2,_0x2305dd)[_0xedad('0x8')](function(_0x1e138c){logger[_0xedad('0x9')](_0xedad('0xa'),_0xfbbda0,_0xedad('0xb'));logger[_0xedad('0xc')]('Migration,\x20%s,\x20%s,\x20%s',_0xfbbda0,_0xedad('0xb'),JSON['stringify'](_0x1e138c));if(_0x1e138c['error']){if(_0x1e138c['error'][_0xedad('0xd')]===0x1f4){logger[_0xedad('0xe')](_0xedad('0xa'),_0xfbbda0,_0x1e138c[_0xedad('0xe')][_0xedad('0xf')]);return _0x49f230(_0x1e138c[_0xedad('0xe')][_0xedad('0xf')]);}logger['error'](_0xedad('0xa'),_0xfbbda0,_0x1e138c[_0xedad('0xe')][_0xedad('0xf')]);return _0xf3197(_0x1e138c[_0xedad('0xe')]['message']);}else{logger[_0xedad('0x9')](_0xedad('0xa'),_0xfbbda0,_0xedad('0xb'));_0xf3197(_0x1e138c['result']['message']);}})['catch'](function(_0x50061){logger[_0xedad('0xe')](_0xedad('0xa'),_0xfbbda0,_0x50061);_0x49f230(_0x50061);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 6893870..d955deb 100644 --- a/server/api/network/index.js +++ b/server/api/network/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb67=['./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4d6f1f,_0x3b6fd4){var _0xc6e4c4=function(_0x149753){while(--_0x149753){_0x4d6f1f['push'](_0x4d6f1f['shift']());}};_0xc6e4c4(++_0x3b6fd4);}(_0xbb67,0x161));var _0x7bb6=function(_0x6d6e73,_0x566ee7){_0x6d6e73=_0x6d6e73-0x0;var _0x5d8e4a=_0xbb67[_0x6d6e73];return _0x5d8e4a;};'use strict';var multer=require('multer');var util=require(_0x7bb6('0x0'));var path=require(_0x7bb6('0x1'));var timeout=require(_0x7bb6('0x2'));var express=require(_0x7bb6('0x3'));var router=express[_0x7bb6('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7bb6('0x5'));var config=require(_0x7bb6('0x6'));var controller=require(_0x7bb6('0x7'));router[_0x7bb6('0x8')]('/',auth[_0x7bb6('0x9')](),controller[_0x7bb6('0xa')]);router[_0x7bb6('0x8')](_0x7bb6('0xb'),auth['isAuthenticated'](),controller[_0x7bb6('0xc')]);router[_0x7bb6('0xd')]('/',auth[_0x7bb6('0x9')](),controller[_0x7bb6('0xe')]);router[_0x7bb6('0xf')](_0x7bb6('0xb'),auth[_0x7bb6('0x9')](),controller[_0x7bb6('0x10')]);router[_0x7bb6('0x11')]('/:id',auth[_0x7bb6('0x9')](),controller[_0x7bb6('0x12')]);module[_0x7bb6('0x13')]=router; \ No newline at end of file +var _0x4301=['isAuthenticated','get','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x26275c,_0x5bc657){var _0xff4a43=function(_0x3222f9){while(--_0x3222f9){_0x26275c['push'](_0x26275c['shift']());}};_0xff4a43(++_0x5bc657);}(_0x4301,0x17a));var _0x1430=function(_0x13166e,_0x925da4){_0x13166e=_0x13166e-0x0;var _0x191f14=_0x4301[_0x13166e];return _0x191f14;};'use strict';var multer=require(_0x1430('0x0'));var util=require('util');var path=require(_0x1430('0x1'));var timeout=require(_0x1430('0x2'));var express=require(_0x1430('0x3'));var router=express[_0x1430('0x4')]();var auth=require(_0x1430('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./network.controller');router['get']('/',auth[_0x1430('0x6')](),controller['index']);router[_0x1430('0x7')](_0x1430('0x8'),auth[_0x1430('0x6')](),controller[_0x1430('0x9')]);router[_0x1430('0xa')]('/',auth[_0x1430('0x6')](),controller[_0x1430('0xb')]);router[_0x1430('0xc')](_0x1430('0x8'),auth[_0x1430('0x6')](),controller[_0x1430('0xd')]);router[_0x1430('0xe')](_0x1430('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x1430('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 30eb01b..7cc5e4b 100644 --- a/server/api/network/network.attributes.js +++ b/server/api/network/network.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f02=['sequelize','exports','STRING'];(function(_0x59145a,_0x1f60f1){var _0xf04d7=function(_0x247581){while(--_0x247581){_0x59145a['push'](_0x59145a['shift']());}};_0xf04d7(++_0x1f60f1);}(_0x1f02,0x78));var _0x21f0=function(_0x1eee19,_0x3e0fd2){_0x1eee19=_0x1eee19-0x0;var _0xda824b=_0x1f02[_0x1eee19];return _0xda824b;};'use strict';var Sequelize=require(_0x21f0('0x0'));module[_0x21f0('0x1')]={'type':{'type':Sequelize['ENUM']('localnet','externip')},'value':{'type':Sequelize[_0x21f0('0x2')]}}; \ No newline at end of file +var _0x530f=['STRING','sequelize','ENUM','localnet','externip'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x530f,0xe7));var _0xf530=function(_0x1bc2d6,_0x1257d3){_0x1bc2d6=_0x1bc2d6-0x0;var _0x559744=_0x530f[_0x1bc2d6];return _0x559744;};'use strict';var Sequelize=require(_0xf530('0x0'));module['exports']={'type':{'type':Sequelize[_0xf530('0x1')](_0xf530('0x2'),_0xf530('0x3'))},'value':{'type':Sequelize[_0xf530('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 4fdf45e..874d33e 100644 --- a/server/api/network/network.controller.js +++ b/server/api/network/network.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1475=['../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','field','Network','count','includeAll','include','rows','show','params','fields','length','options','find','create','sequelize','transaction','body','findAll','root','render','format','/etc/asterisk/sip_xcally_%s.conf','readFileSync','join','server/files/templates/network.ejs','utf8','writeFileSync','toLowerCase','Reload','chan_sip.so','eml-format','rimraf','fast-json-patch','moment','mustache','to-csv','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x439549,_0x2a4436){var _0x15f217=function(_0x19f2e8){while(--_0x19f2e8){_0x439549['push'](_0x439549['shift']());}};_0x15f217(++_0x2a4436);}(_0x1475,0xa8));var _0x5147=function(_0x2adfb1,_0x406e6e){_0x2adfb1=_0x2adfb1-0x0;var _0xa52d45=_0x1475[_0x2adfb1];return _0xa52d45;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5147('0x0'));var rimraf=require(_0x5147('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5147('0x2'));var rp=require('request-promise');var moment=require(_0x5147('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5147('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5147('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5147('0x6'));var squel=require(_0x5147('0x7'));var crypto=require('crypto');var jsforce=require(_0x5147('0x8'));var deskjs=require(_0x5147('0x9'));var toCsv=require(_0x5147('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5147('0xa'));var authService=require(_0x5147('0xb'));var qs=require(_0x5147('0xc'));var hardwareService=require(_0x5147('0xd'));var logger=require(_0x5147('0xe'))('api');var utils=require(_0x5147('0xf'));var config=require(_0x5147('0x10'));var db=require(_0x5147('0x11'))['db'];var jayson=require(_0x5147('0x12'));var client=jayson['client'][_0x5147('0x13')]({'port':0x232a});function checkPasswordPattern(_0x3d070e,_0x1a26a9,_0x4a1e70){if(_0x4a1e70){var _0x149068=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x149068[_0x5147('0x14')](_0x1a26a9)){return _0x3d070e;}else{throw new Error(_0x5147('0x15'));}}else{return _0x3d070e;}}function respondWithRpcPromise(_0xf40578,_0x5edaf1,_0x4d1a87,_0x366993){return new BPromise(function(_0x3e17da,_0x1b9f2b){var _0x3a7aca=_0x366993||client;return _0x3a7aca['request'](_0xf40578,_0x4d1a87)[_0x5147('0x16')](function(_0x76d834){logger['info'](_0x5147('0x17'),_0x5edaf1,_0x5147('0x18'));logger[_0x5147('0x19')](_0x5147('0x1a'),_0x5edaf1,_0x5147('0x18'),JSON[_0x5147('0x1b')](_0x76d834));if(_0x76d834[_0x5147('0x1c')]){if(_0x76d834['error']['code']===0x1f4){logger[_0x5147('0x1c')](_0x5147('0x17'),_0x5edaf1,_0x76d834[_0x5147('0x1c')]['message']);return _0x1b9f2b(_0x76d834[_0x5147('0x1c')][_0x5147('0x1d')]);}logger[_0x5147('0x1c')](_0x5147('0x17'),_0x5edaf1,_0x76d834[_0x5147('0x1c')]['message']);return _0x3e17da(_0x76d834[_0x5147('0x1c')][_0x5147('0x1d')]);}else{logger['info'](_0x5147('0x17'),_0x5edaf1,_0x5147('0x18'));_0x3e17da(_0x76d834[_0x5147('0x1e')]['message']);}})[_0x5147('0x1f')](function(_0x263998){logger[_0x5147('0x1c')](_0x5147('0x17'),_0x5edaf1,_0x263998);_0x1b9f2b(_0x263998);});});}function respondWithStatusCode(_0x200e9d,_0x510977){_0x510977=_0x510977||0xcc;return function(_0x3cbff4){if(_0x3cbff4){return _0x200e9d[_0x5147('0x20')](_0x510977);}return _0x200e9d[_0x5147('0x21')](_0x510977)['end']();};}function respondWithResult(_0x45680f,_0x323de6){_0x323de6=_0x323de6||0xc8;return function(_0x2d9ec2){if(_0x2d9ec2){return _0x45680f[_0x5147('0x21')](_0x323de6)[_0x5147('0x22')](_0x2d9ec2);}};}function respondWithFilteredResult(_0x137028,_0x134653){return function(_0x145cdc){if(_0x145cdc){var _0xe60a49=_0x145cdc['count'],_0x3c016e=_0x134653[_0x5147('0x23')],_0x3929bd=_0x134653['offset']+_0x134653[_0x5147('0x24')],_0x148f3b;if(_0x3929bd>=_0xe60a49){_0x3929bd=_0xe60a49;_0x148f3b=0xc8;}else{_0x148f3b=0xce;}_0x137028[_0x5147('0x21')](_0x148f3b);return _0x137028[_0x5147('0x25')](_0x5147('0x26'),_0x3c016e+'-'+_0x3929bd+'/'+_0xe60a49)['json'](_0x145cdc);}return null;};}function patchUpdates(_0x3e70ba){return function(_0x4bae84){try{jsonpatch['apply'](_0x4bae84,_0x3e70ba,!![]);}catch(_0xc881b4){return BPromise[_0x5147('0x27')](_0xc881b4);}return _0x4bae84[_0x5147('0x28')]();};}function saveUpdates(_0x1ed81b,_0x247e57){return function(_0x247b2e){if(_0x247b2e){return _0x247b2e[_0x5147('0x29')](_0x1ed81b)[_0x5147('0x16')](function(_0x34c72b){return _0x34c72b;});}return null;};}function removeEntity(_0x39d60a,_0x3455d4){return function(_0x57bc87){if(_0x57bc87){return _0x57bc87[_0x5147('0x2a')]()[_0x5147('0x16')](function(){_0x39d60a[_0x5147('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x289483,_0x16e671){return function(_0x30121a){if(!_0x30121a){_0x289483[_0x5147('0x20')](0x194);}return _0x30121a;};}function handleError(_0x1837c2,_0x5b8e02){_0x5b8e02=_0x5b8e02||0x1f4;return function(_0xa567ea){logger[_0x5147('0x1c')](_0xa567ea[_0x5147('0x2b')]);if(_0xa567ea['name']){delete _0xa567ea[_0x5147('0x2c')];}_0x1837c2[_0x5147('0x21')](_0x5b8e02)[_0x5147('0x2d')](_0xa567ea);};}exports[_0x5147('0x2e')]=function(_0x413899,_0x2c41d7){var _0x25cd9e={},_0xc54040={},_0xa5f448={'count':0x0,'rows':[]};var _0x537940=db['Network'][_0x5147('0x2f')];_0xc54040[_0x5147('0x30')]=_[_0x5147('0x31')](_0x537940);_0xc54040[_0x5147('0x32')]=_[_0x5147('0x31')](_0x413899['query']);_0xc54040[_0x5147('0x33')]=_[_0x5147('0x34')](_0xc54040[_0x5147('0x30')],_0xc54040[_0x5147('0x32')]);_0x25cd9e[_0x5147('0x35')]=_[_0x5147('0x34')](_0xc54040[_0x5147('0x30')],qs['fields'](_0x413899['query']['fields']));_0x25cd9e[_0x5147('0x35')]=_0x25cd9e['attributes']['length']?_0x25cd9e[_0x5147('0x35')]:_0xc54040['model'];if(!_0x413899[_0x5147('0x32')][_0x5147('0x36')](_0x5147('0x37'))){_0x25cd9e[_0x5147('0x24')]=qs['limit'](_0x413899['query'][_0x5147('0x24')]);_0x25cd9e[_0x5147('0x23')]=qs['offset'](_0x413899[_0x5147('0x32')][_0x5147('0x23')]);}_0x25cd9e['order']=qs[_0x5147('0x38')](_0x413899['query'][_0x5147('0x38')]);_0x25cd9e[_0x5147('0x39')]=qs[_0x5147('0x33')](_[_0x5147('0x3a')](_0x413899['query'],_0xc54040[_0x5147('0x33')]));if(_0x413899['query'][_0x5147('0x3b')]){_0x25cd9e[_0x5147('0x39')]=_[_0x5147('0x3c')](_0x25cd9e[_0x5147('0x39')],{'$or':_['map'](_0x537940,function(_0x6a1b87){if(_0x6a1b87[_0x5147('0x3d')]['key']!==_0x5147('0x3e')){var _0x137bd5={};_0x137bd5[_0x6a1b87[_0x5147('0x3f')]]={'$like':'%'+_0x413899[_0x5147('0x32')][_0x5147('0x3b')]+'%'};return _0x137bd5;}})});}_0x25cd9e=_[_0x5147('0x3c')]({},_0x25cd9e,_0x413899['options']);var _0x90eb18={'where':_0x25cd9e[_0x5147('0x39')]};return db[_0x5147('0x40')][_0x5147('0x41')](_0x90eb18)['then'](function(_0x5bd90d){_0xa5f448[_0x5147('0x41')]=_0x5bd90d;if(_0x413899[_0x5147('0x32')][_0x5147('0x42')]){_0x25cd9e[_0x5147('0x43')]=[{'all':!![]}];}return db[_0x5147('0x40')]['findAll'](_0x25cd9e);})[_0x5147('0x16')](function(_0x522bb1){_0xa5f448[_0x5147('0x44')]=_0x522bb1;return _0xa5f448;})[_0x5147('0x16')](respondWithFilteredResult(_0x2c41d7,_0x25cd9e))[_0x5147('0x1f')](handleError(_0x2c41d7,null));};exports[_0x5147('0x45')]=function(_0x260697,_0x8004ac){var _0x3a2b9f={'raw':!![],'where':{'id':_0x260697[_0x5147('0x46')]['id']}},_0x26e885={};_0x26e885[_0x5147('0x30')]=_[_0x5147('0x31')](db[_0x5147('0x40')][_0x5147('0x2f')]);_0x26e885[_0x5147('0x32')]=_['keys'](_0x260697[_0x5147('0x32')]);_0x26e885[_0x5147('0x33')]=_['intersection'](_0x26e885[_0x5147('0x30')],_0x26e885[_0x5147('0x32')]);_0x3a2b9f[_0x5147('0x35')]=_[_0x5147('0x34')](_0x26e885[_0x5147('0x30')],qs[_0x5147('0x47')](_0x260697[_0x5147('0x32')][_0x5147('0x47')]));_0x3a2b9f[_0x5147('0x35')]=_0x3a2b9f[_0x5147('0x35')][_0x5147('0x48')]?_0x3a2b9f[_0x5147('0x35')]:_0x26e885['model'];if(_0x260697[_0x5147('0x32')][_0x5147('0x42')]){_0x3a2b9f[_0x5147('0x43')]=[{'all':!![]}];}_0x3a2b9f=_[_0x5147('0x3c')]({},_0x3a2b9f,_0x260697[_0x5147('0x49')]);return db[_0x5147('0x40')][_0x5147('0x4a')](_0x3a2b9f)[_0x5147('0x16')](handleEntityNotFound(_0x8004ac,null))['then'](respondWithResult(_0x8004ac,null))[_0x5147('0x1f')](handleError(_0x8004ac,null));};exports[_0x5147('0x4b')]=function(_0x51faa4,_0x1c6d25,_0x143935){var _0x53d20e;return db[_0x5147('0x4c')][_0x5147('0x4d')](function(_0x3e1dbb){return db[_0x5147('0x40')][_0x5147('0x4b')](_0x51faa4[_0x5147('0x4e')],{'raw':!![]})[_0x5147('0x16')](function(_0x35d6b7){_0x53d20e=_0x35d6b7;return db[_0x5147('0x40')][_0x5147('0x4f')]({'where':{'type':_0x51faa4[_0x5147('0x4e')]['type']},'raw':!![]});})[_0x5147('0x16')](function(_0x2013ff){var _0x2b857f=fs['readFileSync'](path['join'](config[_0x5147('0x50')],'server/files/templates/network.ejs'),'utf8');var _0x287ee1=ejs[_0x5147('0x51')](_0x2b857f,{'networks':_0x2013ff||[]});fs['writeFileSync'](util[_0x5147('0x52')](_0x5147('0x53'),_0x51faa4[_0x5147('0x4e')][_0x5147('0x3d')]['toLowerCase']()),_0x287ee1);})[_0x5147('0x16')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x5147('0x16')](function(){return _0x53d20e;});})[_0x5147('0x16')](respondWithResult(_0x1c6d25,0xc9))[_0x5147('0x1f')](handleError(_0x1c6d25,null));};exports['update']=function(_0x3e277d,_0x3d754c,_0x141fa6){var _0x27c949;return db[_0x5147('0x4c')]['transaction'](function(_0x475f5f){return db[_0x5147('0x40')][_0x5147('0x4a')]({'where':{'id':_0x3e277d[_0x5147('0x46')]['id']}})[_0x5147('0x16')](handleEntityNotFound(_0x3d754c,null))['then'](saveUpdates(_0x3e277d[_0x5147('0x4e')],null))['then'](function(_0x4461f1){if(_0x4461f1){_0x27c949=_0x4461f1;return db[_0x5147('0x40')][_0x5147('0x4f')]({'where':{'type':_0x27c949[_0x5147('0x3d')]},'raw':!![]});}return null;})[_0x5147('0x16')](function(_0x52b107){if(_0x52b107){var _0x161bfb=fs[_0x5147('0x54')](path[_0x5147('0x55')](config[_0x5147('0x50')],_0x5147('0x56')),_0x5147('0x57'));var _0x236e82=ejs[_0x5147('0x51')](_0x161bfb,{'networks':_0x52b107||[]});fs[_0x5147('0x58')](util[_0x5147('0x52')](_0x5147('0x53'),_0x27c949[_0x5147('0x3d')][_0x5147('0x59')]()),_0x236e82);return respondWithRpcPromise(_0x5147('0x5a'),_0x5147('0x29'),{'module':_0x5147('0x5b')});}return null;})[_0x5147('0x16')](function(_0x662837){if(_0x662837){return _0x27c949;}return null;});})['then'](respondWithResult(_0x3d754c,null))[_0x5147('0x1f')](handleError(_0x3d754c,null));};exports[_0x5147('0x2a')]=function(_0x29a76d,_0x4fbe8b,_0x238c57){var _0x465196;return db['Network'][_0x5147('0x4a')]({'where':{'id':_0x29a76d[_0x5147('0x46')]['id']}})[_0x5147('0x16')](function(_0x3cd937){_0x465196=_0x3cd937;return _0x3cd937;})[_0x5147('0x16')](handleEntityNotFound(_0x4fbe8b,null))[_0x5147('0x16')](removeEntity(_0x4fbe8b,null))[_0x5147('0x16')](function(){if(_0x465196){return db['Network'][_0x5147('0x4f')]({'where':{'type':_0x465196[_0x5147('0x3d')]},'raw':!![]});}})[_0x5147('0x16')](function(_0x4c570d){if(_0x4c570d){var _0x480e44=fs['readFileSync'](path[_0x5147('0x55')](config['root'],'server/files/templates/network.ejs'),_0x5147('0x57'));var _0x44e85b=ejs[_0x5147('0x51')](_0x480e44,{'networks':_0x4c570d||[]});fs['writeFileSync'](util[_0x5147('0x52')](_0x5147('0x53'),_0x465196[_0x5147('0x3d')][_0x5147('0x59')]()),_0x44e85b);return respondWithRpcPromise('Reload','destroy',{'module':_0x5147('0x5b')});}})[_0x5147('0x1f')](handleError(_0x4fbe8b,null));}; \ No newline at end of file +var _0xf55c=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','count','offset','limit','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','Network','rawAttributes','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','key','VIRTUAL','field','findAll','rows','catch','show','fields','includeAll','options','find','create','sequelize','body','readFileSync','root','server/files/templates/network.ejs','utf8','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','params','join','render','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x3672bd,_0x45f5ba){var _0x35d08a=function(_0x3fc51f){while(--_0x3fc51f){_0x3672bd['push'](_0x3672bd['shift']());}};_0x35d08a(++_0x45f5ba);}(_0xf55c,0x1db));var _0xcf55=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xf55c[_0x3ce3c];return _0x55a2c9;};'use strict';var pdf=require(_0xcf55('0x0'));var emlformat=require(_0xcf55('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcf55('0x2'));var jsonpatch=require(_0xcf55('0x3'));var rp=require(_0xcf55('0x4'));var moment=require(_0xcf55('0x5'));var BPromise=require(_0xcf55('0x6'));var Mustache=require('mustache');var util=require(_0xcf55('0x7'));var path=require(_0xcf55('0x8'));var sox=require(_0xcf55('0x9'));var csv=require(_0xcf55('0xa'));var ejs=require(_0xcf55('0xb'));var fs=require('fs');var _=require(_0xcf55('0xc'));var squel=require('squel');var crypto=require(_0xcf55('0xd'));var jsforce=require(_0xcf55('0xe'));var deskjs=require(_0xcf55('0xf'));var toCsv=require(_0xcf55('0xa'));var querystring=require(_0xcf55('0x10'));var Papa=require(_0xcf55('0x11'));var Redis=require(_0xcf55('0x12'));var authService=require(_0xcf55('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcf55('0x14'));var utils=require(_0xcf55('0x15'));var config=require(_0xcf55('0x16'));var db=require(_0xcf55('0x17'))['db'];var jayson=require(_0xcf55('0x18'));var client=jayson['client'][_0xcf55('0x19')]({'port':0x232a});function checkPasswordPattern(_0x531433,_0x2e4a49,_0x20a3ab){if(_0x20a3ab){var _0xc11ef1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc11ef1[_0xcf55('0x1a')](_0x2e4a49)){return _0x531433;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x531433;}}function respondWithRpcPromise(_0x23eeca,_0x55c13a,_0x274cc5,_0x19e895){return new BPromise(function(_0x33aa49,_0x10e08c){var _0x58f1b8=_0x19e895||client;return _0x58f1b8[_0xcf55('0x1b')](_0x23eeca,_0x274cc5)['then'](function(_0x55b80a){logger[_0xcf55('0x1c')](_0xcf55('0x1d'),_0x55c13a,_0xcf55('0x1e'));logger[_0xcf55('0x1f')](_0xcf55('0x20'),_0x55c13a,'request\x20sent',JSON[_0xcf55('0x21')](_0x55b80a));if(_0x55b80a['error']){if(_0x55b80a[_0xcf55('0x22')][_0xcf55('0x23')]===0x1f4){logger[_0xcf55('0x22')](_0xcf55('0x1d'),_0x55c13a,_0x55b80a['error'][_0xcf55('0x24')]);return _0x10e08c(_0x55b80a[_0xcf55('0x22')][_0xcf55('0x24')]);}logger['error']('Network,\x20%s,\x20%s',_0x55c13a,_0x55b80a[_0xcf55('0x22')][_0xcf55('0x24')]);return _0x33aa49(_0x55b80a[_0xcf55('0x22')][_0xcf55('0x24')]);}else{logger[_0xcf55('0x1c')](_0xcf55('0x1d'),_0x55c13a,'request\x20sent');_0x33aa49(_0x55b80a['result']['message']);}})['catch'](function(_0x38a565){logger[_0xcf55('0x22')](_0xcf55('0x1d'),_0x55c13a,_0x38a565);_0x10e08c(_0x38a565);});});}function respondWithStatusCode(_0x11bbcd,_0x2f4df7){_0x2f4df7=_0x2f4df7||0xcc;return function(_0x2c5592){if(_0x2c5592){return _0x11bbcd[_0xcf55('0x25')](_0x2f4df7);}return _0x11bbcd[_0xcf55('0x26')](_0x2f4df7)['end']();};}function respondWithResult(_0x4cbaa2,_0x4f4a7c){_0x4f4a7c=_0x4f4a7c||0xc8;return function(_0x500dd1){if(_0x500dd1){return _0x4cbaa2['status'](_0x4f4a7c)['json'](_0x500dd1);}};}function respondWithFilteredResult(_0x5e2fbf,_0x513458){return function(_0x545aeb){if(_0x545aeb){var _0x540b85=_0x545aeb[_0xcf55('0x27')],_0x15234e=_0x513458[_0xcf55('0x28')],_0x15826b=_0x513458[_0xcf55('0x28')]+_0x513458[_0xcf55('0x29')],_0x3c748f;if(_0x15826b>=_0x540b85){_0x15826b=_0x540b85;_0x3c748f=0xc8;}else{_0x3c748f=0xce;}_0x5e2fbf[_0xcf55('0x26')](_0x3c748f);return _0x5e2fbf['set'](_0xcf55('0x2a'),_0x15234e+'-'+_0x15826b+'/'+_0x540b85)['json'](_0x545aeb);}return null;};}function patchUpdates(_0x4437db){return function(_0x4d8d90){try{jsonpatch[_0xcf55('0x2b')](_0x4d8d90,_0x4437db,!![]);}catch(_0x49db2d){return BPromise[_0xcf55('0x2c')](_0x49db2d);}return _0x4d8d90[_0xcf55('0x2d')]();};}function saveUpdates(_0x22199e,_0x3e5616){return function(_0x358d65){if(_0x358d65){return _0x358d65[_0xcf55('0x2e')](_0x22199e)[_0xcf55('0x2f')](function(_0x569b30){return _0x569b30;});}return null;};}function removeEntity(_0x3a11c7,_0x3d94c5){return function(_0x33b1a1){if(_0x33b1a1){return _0x33b1a1['destroy']()[_0xcf55('0x2f')](function(){_0x3a11c7[_0xcf55('0x26')](0xcc)[_0xcf55('0x30')]();});}};}function handleEntityNotFound(_0x2328f7,_0x5b0c9a){return function(_0x545169){if(!_0x545169){_0x2328f7[_0xcf55('0x25')](0x194);}return _0x545169;};}function handleError(_0x54e111,_0x4d83d7){_0x4d83d7=_0x4d83d7||0x1f4;return function(_0x161f9b){logger['error'](_0x161f9b[_0xcf55('0x31')]);if(_0x161f9b[_0xcf55('0x32')]){delete _0x161f9b[_0xcf55('0x32')];}_0x54e111['status'](_0x4d83d7)[_0xcf55('0x33')](_0x161f9b);};}exports[_0xcf55('0x34')]=function(_0x36504d,_0x39f840){var _0x539273={},_0xbf665a={},_0x3c11e3={'count':0x0,'rows':[]};var _0x3b2c93=db[_0xcf55('0x35')][_0xcf55('0x36')];_0xbf665a['model']=_[_0xcf55('0x37')](_0x3b2c93);_0xbf665a[_0xcf55('0x38')]=_[_0xcf55('0x37')](_0x36504d['query']);_0xbf665a[_0xcf55('0x39')]=_[_0xcf55('0x3a')](_0xbf665a[_0xcf55('0x3b')],_0xbf665a[_0xcf55('0x38')]);_0x539273[_0xcf55('0x3c')]=_[_0xcf55('0x3a')](_0xbf665a[_0xcf55('0x3b')],qs['fields'](_0x36504d[_0xcf55('0x38')]['fields']));_0x539273[_0xcf55('0x3c')]=_0x539273[_0xcf55('0x3c')][_0xcf55('0x3d')]?_0x539273[_0xcf55('0x3c')]:_0xbf665a['model'];if(!_0x36504d['query'][_0xcf55('0x3e')](_0xcf55('0x3f'))){_0x539273[_0xcf55('0x29')]=qs[_0xcf55('0x29')](_0x36504d[_0xcf55('0x38')][_0xcf55('0x29')]);_0x539273[_0xcf55('0x28')]=qs[_0xcf55('0x28')](_0x36504d['query']['offset']);}_0x539273['order']=qs[_0xcf55('0x40')](_0x36504d[_0xcf55('0x38')]['sort']);_0x539273['where']=qs[_0xcf55('0x39')](_[_0xcf55('0x41')](_0x36504d[_0xcf55('0x38')],_0xbf665a[_0xcf55('0x39')]));if(_0x36504d[_0xcf55('0x38')][_0xcf55('0x42')]){_0x539273[_0xcf55('0x43')]=_[_0xcf55('0x44')](_0x539273[_0xcf55('0x43')],{'$or':_['map'](_0x3b2c93,function(_0x389d8b){if(_0x389d8b[_0xcf55('0x45')][_0xcf55('0x46')]!==_0xcf55('0x47')){var _0x4fc583={};_0x4fc583[_0x389d8b[_0xcf55('0x48')]]={'$like':'%'+_0x36504d[_0xcf55('0x38')][_0xcf55('0x42')]+'%'};return _0x4fc583;}})});}_0x539273=_['merge']({},_0x539273,_0x36504d['options']);var _0x5159e1={'where':_0x539273[_0xcf55('0x43')]};return db[_0xcf55('0x35')][_0xcf55('0x27')](_0x5159e1)['then'](function(_0x2d3492){_0x3c11e3['count']=_0x2d3492;if(_0x36504d[_0xcf55('0x38')]['includeAll']){_0x539273['include']=[{'all':!![]}];}return db[_0xcf55('0x35')][_0xcf55('0x49')](_0x539273);})[_0xcf55('0x2f')](function(_0x13750c){_0x3c11e3[_0xcf55('0x4a')]=_0x13750c;return _0x3c11e3;})[_0xcf55('0x2f')](respondWithFilteredResult(_0x39f840,_0x539273))[_0xcf55('0x4b')](handleError(_0x39f840,null));};exports[_0xcf55('0x4c')]=function(_0x5a7bbf,_0x567f4d){var _0x334ee3={'raw':!![],'where':{'id':_0x5a7bbf['params']['id']}},_0x37a3e8={};_0x37a3e8[_0xcf55('0x3b')]=_[_0xcf55('0x37')](db['Network'][_0xcf55('0x36')]);_0x37a3e8[_0xcf55('0x38')]=_[_0xcf55('0x37')](_0x5a7bbf['query']);_0x37a3e8[_0xcf55('0x39')]=_[_0xcf55('0x3a')](_0x37a3e8[_0xcf55('0x3b')],_0x37a3e8[_0xcf55('0x38')]);_0x334ee3[_0xcf55('0x3c')]=_[_0xcf55('0x3a')](_0x37a3e8[_0xcf55('0x3b')],qs[_0xcf55('0x4d')](_0x5a7bbf[_0xcf55('0x38')]['fields']));_0x334ee3[_0xcf55('0x3c')]=_0x334ee3[_0xcf55('0x3c')][_0xcf55('0x3d')]?_0x334ee3['attributes']:_0x37a3e8[_0xcf55('0x3b')];if(_0x5a7bbf[_0xcf55('0x38')][_0xcf55('0x4e')]){_0x334ee3['include']=[{'all':!![]}];}_0x334ee3=_[_0xcf55('0x44')]({},_0x334ee3,_0x5a7bbf[_0xcf55('0x4f')]);return db['Network'][_0xcf55('0x50')](_0x334ee3)[_0xcf55('0x2f')](handleEntityNotFound(_0x567f4d,null))[_0xcf55('0x2f')](respondWithResult(_0x567f4d,null))['catch'](handleError(_0x567f4d,null));};exports[_0xcf55('0x51')]=function(_0x492d99,_0x41c3af,_0x33aa1f){var _0x2fb0d7;return db[_0xcf55('0x52')]['transaction'](function(_0x3e2af9){return db[_0xcf55('0x35')][_0xcf55('0x51')](_0x492d99[_0xcf55('0x53')],{'raw':!![]})[_0xcf55('0x2f')](function(_0x590f70){_0x2fb0d7=_0x590f70;return db[_0xcf55('0x35')][_0xcf55('0x49')]({'where':{'type':_0x492d99[_0xcf55('0x53')]['type']},'raw':!![]});})[_0xcf55('0x2f')](function(_0x528c56){var _0x3cac75=fs[_0xcf55('0x54')](path['join'](config[_0xcf55('0x55')],_0xcf55('0x56')),_0xcf55('0x57'));var _0x3b869a=ejs['render'](_0x3cac75,{'networks':_0x528c56||[]});fs[_0xcf55('0x58')](util[_0xcf55('0x59')](_0xcf55('0x5a'),_0x492d99[_0xcf55('0x53')][_0xcf55('0x45')][_0xcf55('0x5b')]()),_0x3b869a);})[_0xcf55('0x2f')](function(){return respondWithRpcPromise(_0xcf55('0x5c'),_0xcf55('0x51'),{'module':_0xcf55('0x5d')});})[_0xcf55('0x2f')](function(){return _0x2fb0d7;});})[_0xcf55('0x2f')](respondWithResult(_0x41c3af,0xc9))[_0xcf55('0x4b')](handleError(_0x41c3af,null));};exports[_0xcf55('0x2e')]=function(_0x22e2c4,_0xd451bc,_0x46792e){var _0x387de2;return db['sequelize']['transaction'](function(_0x426b64){return db[_0xcf55('0x35')][_0xcf55('0x50')]({'where':{'id':_0x22e2c4[_0xcf55('0x5e')]['id']}})[_0xcf55('0x2f')](handleEntityNotFound(_0xd451bc,null))['then'](saveUpdates(_0x22e2c4['body'],null))[_0xcf55('0x2f')](function(_0x1b79eb){if(_0x1b79eb){_0x387de2=_0x1b79eb;return db['Network']['findAll']({'where':{'type':_0x387de2[_0xcf55('0x45')]},'raw':!![]});}return null;})[_0xcf55('0x2f')](function(_0x18898d){if(_0x18898d){var _0x1ef21b=fs['readFileSync'](path[_0xcf55('0x5f')](config[_0xcf55('0x55')],_0xcf55('0x56')),'utf8');var _0x517412=ejs[_0xcf55('0x60')](_0x1ef21b,{'networks':_0x18898d||[]});fs[_0xcf55('0x58')](util[_0xcf55('0x59')](_0xcf55('0x5a'),_0x387de2[_0xcf55('0x45')][_0xcf55('0x5b')]()),_0x517412);return respondWithRpcPromise(_0xcf55('0x5c'),_0xcf55('0x2e'),{'module':_0xcf55('0x5d')});}return null;})[_0xcf55('0x2f')](function(_0x6b9253){if(_0x6b9253){return _0x387de2;}return null;});})[_0xcf55('0x2f')](respondWithResult(_0xd451bc,null))[_0xcf55('0x4b')](handleError(_0xd451bc,null));};exports[_0xcf55('0x61')]=function(_0x3af7c0,_0x40c782,_0x15f45b){var _0x31eee7;return db['Network'][_0xcf55('0x50')]({'where':{'id':_0x3af7c0[_0xcf55('0x5e')]['id']}})[_0xcf55('0x2f')](function(_0x19e908){_0x31eee7=_0x19e908;return _0x19e908;})['then'](handleEntityNotFound(_0x40c782,null))[_0xcf55('0x2f')](removeEntity(_0x40c782,null))[_0xcf55('0x2f')](function(){if(_0x31eee7){return db[_0xcf55('0x35')][_0xcf55('0x49')]({'where':{'type':_0x31eee7['type']},'raw':!![]});}})[_0xcf55('0x2f')](function(_0x5da0fe){if(_0x5da0fe){var _0x151753=fs[_0xcf55('0x54')](path[_0xcf55('0x5f')](config[_0xcf55('0x55')],_0xcf55('0x56')),_0xcf55('0x57'));var _0x56918b=ejs[_0xcf55('0x60')](_0x151753,{'networks':_0x5da0fe||[]});fs[_0xcf55('0x58')](util[_0xcf55('0x59')](_0xcf55('0x5a'),_0x31eee7[_0xcf55('0x45')]['toLowerCase']()),_0x56918b);return respondWithRpcPromise(_0xcf55('0x5c'),_0xcf55('0x61'),{'module':_0xcf55('0x5d')});}})[_0xcf55('0x4b')](handleError(_0x40c782,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 642adf0..d65413a 100644 --- a/server/api/network/network.model.js +++ b/server/api/network/network.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb422=['moment','bluebird','path','rimraf','../../config/environment','./network.attributes','exports','Network','lodash','util','../../config/logger','api'];(function(_0x41805d,_0xb1d38e){var _0x5eddda=function(_0x38e176){while(--_0x38e176){_0x41805d['push'](_0x41805d['shift']());}};_0x5eddda(++_0xb1d38e);}(_0xb422,0x80));var _0x2b42=function(_0x4400bf,_0x3dae8a){_0x4400bf=_0x4400bf-0x0;var _0x5aa062=_0xb422[_0x4400bf];return _0x5aa062;};'use strict';var _=require(_0x2b42('0x0'));var util=require(_0x2b42('0x1'));var logger=require(_0x2b42('0x2'))(_0x2b42('0x3'));var moment=require(_0x2b42('0x4'));var BPromise=require(_0x2b42('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b42('0x6'));var rimraf=require(_0x2b42('0x7'));var config=require(_0x2b42('0x8'));var attributes=require(_0x2b42('0x9'));module[_0x2b42('0xa')]=function(_0x485fd9,_0x1b00e5){return _0x485fd9['define'](_0x2b42('0xb'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2365=['path','../../config/environment','exports','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0x2365,0x1db));var _0x5236=function(_0x314815,_0x3c30ea){_0x314815=_0x314815-0x0;var _0x57e722=_0x2365[_0x314815];return _0x57e722;};'use strict';var _=require(_0x5236('0x0'));var util=require('util');var logger=require(_0x5236('0x1'))('api');var moment=require(_0x5236('0x2'));var BPromise=require(_0x5236('0x3'));var rp=require(_0x5236('0x4'));var fs=require('fs');var path=require(_0x5236('0x5'));var rimraf=require('rimraf');var config=require(_0x5236('0x6'));var attributes=require('./network.attributes');module[_0x5236('0x7')]=function(_0x270831,_0x3d4a38){return _0x270831['define']('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 1def8a5..0e362cc 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba90=['request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','code','error','Network,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','request','then','info'];(function(_0x189305,_0x46c43f){var _0xea3406=function(_0x2aa435){while(--_0x2aa435){_0x189305['push'](_0x189305['shift']());}};_0xea3406(++_0x46c43f);}(_0xba90,0x1ad));var _0x0ba9=function(_0x5b373d,_0x32fce3){_0x5b373d=_0x5b373d-0x0;var _0x1741b7=_0xba90[_0x5b373d];return _0x1741b7;};'use strict';var _=require('lodash');var util=require(_0x0ba9('0x0'));var moment=require(_0x0ba9('0x1'));var BPromise=require(_0x0ba9('0x2'));var rs=require(_0x0ba9('0x3'));var fs=require('fs');var Redis=require(_0x0ba9('0x4'));var db=require(_0x0ba9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0ba9('0x6'));var config=require(_0x0ba9('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cd24d,_0x16c925,_0xcc3a1b){return new BPromise(function(_0x3416ba,_0x34c1ec){return client[_0x0ba9('0x8')](_0x5cd24d,_0xcc3a1b)[_0x0ba9('0x9')](function(_0x246bcc){logger[_0x0ba9('0xa')]('Network,\x20%s,\x20%s',_0x16c925,_0x0ba9('0xb'));logger['debug'](_0x0ba9('0xc'),_0x16c925,_0x0ba9('0xb'),JSON[_0x0ba9('0xd')](_0x246bcc));if(_0x246bcc['error']){if(_0x246bcc['error'][_0x0ba9('0xe')]===0x1f4){logger[_0x0ba9('0xf')](_0x0ba9('0x10'),_0x16c925,_0x246bcc[_0x0ba9('0xf')][_0x0ba9('0x11')]);return _0x34c1ec(_0x246bcc[_0x0ba9('0xf')][_0x0ba9('0x11')]);}logger[_0x0ba9('0xf')]('Network,\x20%s,\x20%s',_0x16c925,_0x246bcc[_0x0ba9('0xf')][_0x0ba9('0x11')]);return _0x3416ba(_0x246bcc[_0x0ba9('0xf')][_0x0ba9('0x11')]);}else{logger[_0x0ba9('0xa')](_0x0ba9('0x10'),_0x16c925,_0x0ba9('0xb'));_0x3416ba(_0x246bcc[_0x0ba9('0x12')][_0x0ba9('0x11')]);}})[_0x0ba9('0x13')](function(_0x342bf0){logger['error'](_0x0ba9('0x10'),_0x16c925,_0x342bf0);_0x34c1ec(_0x342bf0);});});} \ No newline at end of file +var _0xe75e=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe75e,0x1e0));var _0xee75=function(_0x502953,_0x28de83){_0x502953=_0x502953-0x0;var _0x2fa32d=_0xe75e[_0x502953];return _0x2fa32d;};'use strict';var _=require(_0xee75('0x0'));var util=require(_0xee75('0x1'));var moment=require(_0xee75('0x2'));var BPromise=require(_0xee75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee75('0x4'));var db=require(_0xee75('0x5'))['db'];var utils=require(_0xee75('0x6'));var logger=require(_0xee75('0x7'))('rpc');var config=require(_0xee75('0x8'));var jayson=require(_0xee75('0x9'));var client=jayson[_0xee75('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd77847,_0xb19846,_0x21b967){return new BPromise(function(_0x552b04,_0x4c24b5){return client[_0xee75('0xb')](_0xd77847,_0x21b967)[_0xee75('0xc')](function(_0x4a12a4){logger[_0xee75('0xd')](_0xee75('0xe'),_0xb19846,_0xee75('0xf'));logger[_0xee75('0x10')](_0xee75('0x11'),_0xb19846,'request\x20sent',JSON[_0xee75('0x12')](_0x4a12a4));if(_0x4a12a4[_0xee75('0x13')]){if(_0x4a12a4[_0xee75('0x13')][_0xee75('0x14')]===0x1f4){logger[_0xee75('0x13')]('Network,\x20%s,\x20%s',_0xb19846,_0x4a12a4[_0xee75('0x13')][_0xee75('0x15')]);return _0x4c24b5(_0x4a12a4[_0xee75('0x13')][_0xee75('0x15')]);}logger['error'](_0xee75('0xe'),_0xb19846,_0x4a12a4['error'][_0xee75('0x15')]);return _0x552b04(_0x4a12a4['error'][_0xee75('0x15')]);}else{logger[_0xee75('0xd')](_0xee75('0xe'),_0xb19846,_0xee75('0xf'));_0x552b04(_0x4a12a4[_0xee75('0x16')][_0xee75('0x15')]);}})['catch'](function(_0x4e83f9){logger[_0xee75('0x13')](_0xee75('0xe'),_0xb19846,_0x4e83f9);_0x4c24b5(_0x4e83f9);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 2cd3caf..df01c35 100644 --- a/server/api/openchannelAccount/index.js +++ b/server/api/openchannelAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb550=['isAuthenticated','show','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','addApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','describe','/:id'];(function(_0xd056b7,_0x58005b){var _0x17ad2a=function(_0x54302e){while(--_0x54302e){_0xd056b7['push'](_0xd056b7['shift']());}};_0x17ad2a(++_0x58005b);}(_0xb550,0x159));var _0x0b55=function(_0x160178,_0x3a5313){_0x160178=_0x160178-0x0;var _0x8be38=_0xb550[_0x160178];return _0x8be38;};'use strict';var multer=require(_0x0b55('0x0'));var util=require(_0x0b55('0x1'));var path=require(_0x0b55('0x2'));var timeout=require(_0x0b55('0x3'));var express=require(_0x0b55('0x4'));var router=express[_0x0b55('0x5')]();var auth=require(_0x0b55('0x6'));var interaction=require(_0x0b55('0x7'));var config=require(_0x0b55('0x8'));var controller=require(_0x0b55('0x9'));router[_0x0b55('0xa')]('/',auth['isAuthenticated'](),controller[_0x0b55('0xb')]);router[_0x0b55('0xa')](_0x0b55('0xc'),auth['isAuthenticated'](),controller[_0x0b55('0xd')]);router[_0x0b55('0xa')](_0x0b55('0xe'),auth[_0x0b55('0xf')](),controller[_0x0b55('0x10')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x0b55('0x11'),auth[_0x0b55('0xf')](),controller[_0x0b55('0x12')]);router[_0x0b55('0xa')](_0x0b55('0x13'),auth[_0x0b55('0xf')](),controller[_0x0b55('0x14')]);router['get']('/:id/interactions',auth[_0x0b55('0xf')](),controller[_0x0b55('0x15')]);router[_0x0b55('0xa')](_0x0b55('0x16'),auth['isAuthenticated'](),controller[_0x0b55('0x17')]);router[_0x0b55('0x18')]('/',auth['isAuthenticated'](),controller[_0x0b55('0x19')]);router[_0x0b55('0x18')](_0x0b55('0x1a'),auth[_0x0b55('0xf')](),controller[_0x0b55('0x1b')]);router[_0x0b55('0x18')](_0x0b55('0x11'),auth['isAuthenticated'](),controller[_0x0b55('0x1c')]);router[_0x0b55('0x18')]('/:id/notify',controller['notify']);router[_0x0b55('0x18')](_0x0b55('0x13'),auth[_0x0b55('0xf')](),controller[_0x0b55('0x1d')]);router[_0x0b55('0x18')](_0x0b55('0x16'),auth[_0x0b55('0xf')](),controller['addAgents']);router[_0x0b55('0x18')](_0x0b55('0x1e'),auth[_0x0b55('0xf')](),controller[_0x0b55('0x1f')]);router[_0x0b55('0x20')](_0x0b55('0xe'),auth[_0x0b55('0xf')](),controller[_0x0b55('0x21')]);router[_0x0b55('0x22')](_0x0b55('0xe'),auth[_0x0b55('0xf')](),controller[_0x0b55('0x23')]);router[_0x0b55('0x22')](_0x0b55('0x1a'),auth[_0x0b55('0xf')](),controller[_0x0b55('0x24')]);router[_0x0b55('0x22')]('/:id/canned_answers',auth[_0x0b55('0xf')](),controller[_0x0b55('0x25')]);router[_0x0b55('0x22')](_0x0b55('0x16'),auth[_0x0b55('0xf')](),controller[_0x0b55('0x26')]);module[_0x0b55('0x27')]=router; \ No newline at end of file +var _0x2323=['/:id/notify','addAgents','/:id/send','send','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer'];(function(_0x54fbed,_0x3c77a7){var _0x333bbc=function(_0x53c015){while(--_0x53c015){_0x54fbed['push'](_0x54fbed['shift']());}};_0x333bbc(++_0x3c77a7);}(_0x2323,0x122));var _0x3232=function(_0x4ad148,_0x4c7d09){_0x4ad148=_0x4ad148-0x0;var _0x1597ea=_0x2323[_0x4ad148];return _0x1597ea;};'use strict';var multer=require(_0x3232('0x0'));var util=require(_0x3232('0x1'));var path=require(_0x3232('0x2'));var timeout=require('connect-timeout');var express=require(_0x3232('0x3'));var router=express[_0x3232('0x4')]();var auth=require(_0x3232('0x5'));var interaction=require(_0x3232('0x6'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0x3232('0x7')](),controller[_0x3232('0x8')]);router[_0x3232('0x9')](_0x3232('0xa'),auth[_0x3232('0x7')](),controller[_0x3232('0xb')]);router[_0x3232('0x9')](_0x3232('0xc'),auth[_0x3232('0x7')](),controller[_0x3232('0xd')]);router[_0x3232('0x9')]('/:id/dispositions',auth[_0x3232('0x7')](),controller[_0x3232('0xe')]);router[_0x3232('0x9')](_0x3232('0xf'),auth[_0x3232('0x7')](),controller['getAnswers']);router['get'](_0x3232('0x10'),auth[_0x3232('0x7')](),controller['getApplications']);router['get'](_0x3232('0x11'),auth[_0x3232('0x7')](),controller[_0x3232('0x12')]);router[_0x3232('0x9')](_0x3232('0x13'),auth[_0x3232('0x7')](),controller[_0x3232('0x14')]);router[_0x3232('0x15')]('/',auth[_0x3232('0x7')](),controller['create']);router[_0x3232('0x15')](_0x3232('0x16'),auth[_0x3232('0x7')](),controller[_0x3232('0x17')]);router[_0x3232('0x15')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3232('0x18')]);router[_0x3232('0x15')](_0x3232('0x19'),controller['notify']);router['post'](_0x3232('0x10'),auth[_0x3232('0x7')](),controller['addApplications']);router['post'](_0x3232('0x13'),auth[_0x3232('0x7')](),controller[_0x3232('0x1a')]);router[_0x3232('0x15')](_0x3232('0x1b'),auth[_0x3232('0x7')](),controller[_0x3232('0x1c')]);router['put'](_0x3232('0xc'),auth[_0x3232('0x7')](),controller[_0x3232('0x1d')]);router[_0x3232('0x1e')](_0x3232('0xc'),auth[_0x3232('0x7')](),controller[_0x3232('0x1f')]);router[_0x3232('0x1e')](_0x3232('0x16'),auth[_0x3232('0x7')](),controller[_0x3232('0x20')]);router[_0x3232('0x1e')](_0x3232('0xf'),auth[_0x3232('0x7')](),controller['removeAnswers']);router[_0x3232('0x1e')](_0x3232('0x13'),auth['isAuthenticated'](),controller[_0x3232('0x21')]);module[_0x3232('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 65ffcc7..7610784 100644 --- a/server/api/openchannelAccount/openchannelAccount.attributes.js +++ b/server/api/openchannelAccount/openchannelAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ef1=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0xa17b5,_0x45d2c9){var _0x2b954e=function(_0x2cc1dc){while(--_0x2cc1dc){_0xa17b5['push'](_0xa17b5['shift']());}};_0x2b954e(++_0x45d2c9);}(_0x4ef1,0x79));var _0x14ef=function(_0x5c21ea,_0x436c10){_0x5c21ea=_0x5c21ea-0x0;var _0x2d7455=_0x4ef1[_0x5c21ea];return _0x2d7455;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x14ef('0x0'));module[_0x14ef('0x1')]={'name':{'type':Sequelize[_0x14ef('0x2')],'unique':_0x14ef('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x14ef('0x4')]();}},'replyUri':{'type':Sequelize[_0x14ef('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x14ef('0x5')],'defaultValue':function(){return _0x14ef('0x6');}},'notificationSound':{'type':Sequelize[_0x14ef('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x14ef('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x14ef('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x14ef('0x2')]},'queueTransfer':{'type':Sequelize[_0x14ef('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x14ef('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x14ef('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x14ef('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x14ef('0x7')],'defaultValue':![],'comment':_0x14ef('0x9'),'set':function(_0x56ccaa){if(!_0x56ccaa)this[_0x14ef('0xa')](_0x14ef('0xb'),null);this[_0x14ef('0xa')](_0x14ef('0xc'),_0x56ccaa);}}}; \ No newline at end of file +var _0xe0a4=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','exports','STRING','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0xe0a4,0x1b1));var _0x4e0a=function(_0x1c3907,_0x2104dd){_0x1c3907=_0x1c3907-0x0;var _0x4de5ad=_0xe0a4[_0x1c3907];return _0x4de5ad;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x4e0a('0x0')]={'name':{'type':Sequelize[_0x4e0a('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4e0a('0x1')]},'token':{'type':Sequelize[_0x4e0a('0x1')],'defaultValue':function(){return rs[_0x4e0a('0x2')]();}},'replyUri':{'type':Sequelize[_0x4e0a('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x4e0a('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4e0a('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4e0a('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4e0a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x4e0a('0x1')]},'queueTransfer':{'type':Sequelize[_0x4e0a('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4e0a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4e0a('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4e0a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4e0a('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x4e0a('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x4e0a('0x4')],'defaultValue':![],'comment':_0x4e0a('0x7'),'set':function(_0x2f52b2){if(!_0x2f52b2)this['setDataValue'](_0x4e0a('0x8'),null);this[_0x4e0a('0x9')]('mandatoryDisposition',_0x2f52b2);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 7774185..820c43b 100644 --- a/server/api/openchannelAccount/openchannelAccount.controller.js +++ b/server/api/openchannelAccount/openchannelAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf59d=['filter','merge','map','type','VIRTUAL','include','findAll','show','mandatoryDispositionPause','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','OpnechannelAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','difference','updatedAt','createdAt','ListId','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey','includes','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','list','applications','priority','asc','defaults','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','transaction','OpenchannelAccountId','bulkCreate','findAndCountAll','getApplications','User','Owner','fullname','internal','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','OpenchannelMessage','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','redis','socket.io-emitter','register','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','destroy','stack','name','send','index','Pause','OpenchannelAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1463ab,_0x4689ff){var _0x3f1269=function(_0x67e64a){while(--_0x67e64a){_0x1463ab['push'](_0x1463ab['shift']());}};_0x3f1269(++_0x4689ff);}(_0xf59d,0x121));var _0xdf59=function(_0x380d66,_0x4f2eef){_0x380d66=_0x380d66-0x0;var _0x138bfe=_0xf59d[_0x380d66];return _0x138bfe;};'use strict';var pdf=require(_0xdf59('0x0'));var emlformat=require(_0xdf59('0x1'));var rimraf=require(_0xdf59('0x2'));var zipdir=require(_0xdf59('0x3'));var jsonpatch=require(_0xdf59('0x4'));var rp=require(_0xdf59('0x5'));var moment=require(_0xdf59('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xdf59('0x7'));var util=require(_0xdf59('0x8'));var path=require(_0xdf59('0x9'));var sox=require(_0xdf59('0xa'));var csv=require(_0xdf59('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdf59('0xc'));var squel=require(_0xdf59('0xd'));var crypto=require(_0xdf59('0xe'));var jsforce=require(_0xdf59('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdf59('0xb'));var querystring=require(_0xdf59('0x10'));var Papa=require(_0xdf59('0x11'));var Redis=require(_0xdf59('0x12'));var authService=require(_0xdf59('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xdf59('0x14'));var logger=require('../../config/logger')(_0xdf59('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xdf59('0x16')]=_['defaults'](config[_0xdf59('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf59('0x17'))(new Redis(config[_0xdf59('0x16')]));require('./openchannelAccount.socket')[_0xdf59('0x18')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xdf59('0x19')]({'port':0x232c});var client9002=jayson[_0xdf59('0x1a')][_0xdf59('0x19')]({'port':0x232a});function checkPasswordPattern(_0x124d04,_0x2599fe,_0x40bf85){if(_0x40bf85){var _0x274720=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x274720[_0xdf59('0x1b')](_0x2599fe)){return _0x124d04;}else{throw new Error(_0xdf59('0x1c'));}}else{return _0x124d04;}}function respondWithRpcPromise(_0x149811,_0x11aae2,_0x784cb1,_0xb9af7e){return new BPromise(function(_0x1aff46,_0x33ce1f){var _0x558f7b=_0xb9af7e||client;return _0x558f7b[_0xdf59('0x1d')](_0x149811,_0x784cb1)[_0xdf59('0x1e')](function(_0x11f93e){logger[_0xdf59('0x1f')](_0xdf59('0x20'),_0x11aae2,'request\x20sent');logger[_0xdf59('0x21')](_0xdf59('0x22'),_0x11aae2,_0xdf59('0x23'),JSON['stringify'](_0x11f93e));if(_0x11f93e[_0xdf59('0x24')]){if(_0x11f93e[_0xdf59('0x24')]['code']===0x1f4){logger[_0xdf59('0x24')](_0xdf59('0x20'),_0x11aae2,_0x11f93e[_0xdf59('0x24')][_0xdf59('0x25')]);return _0x33ce1f(_0x11f93e[_0xdf59('0x24')][_0xdf59('0x25')]);}logger[_0xdf59('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x11aae2,_0x11f93e[_0xdf59('0x24')][_0xdf59('0x25')]);return _0x1aff46(_0x11f93e[_0xdf59('0x24')][_0xdf59('0x25')]);}else{logger['info'](_0xdf59('0x20'),_0x11aae2,_0xdf59('0x23'));_0x1aff46(_0x11f93e[_0xdf59('0x26')]['message']);}})[_0xdf59('0x27')](function(_0x5ab005){logger[_0xdf59('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x11aae2,_0x5ab005);_0x33ce1f(_0x5ab005);});});}function respondWithStatusCode(_0x6b2ba4,_0x276539){_0x276539=_0x276539||0xcc;return function(_0x49135a){if(_0x49135a){return _0x6b2ba4[_0xdf59('0x28')](_0x276539);}return _0x6b2ba4[_0xdf59('0x29')](_0x276539)[_0xdf59('0x2a')]();};}function respondWithResult(_0xd4033c,_0x2ee9ba){_0x2ee9ba=_0x2ee9ba||0xc8;return function(_0x162f31){if(_0x162f31){return _0xd4033c[_0xdf59('0x29')](_0x2ee9ba)[_0xdf59('0x2b')](_0x162f31);}};}function respondWithFilteredResult(_0x33fddc,_0x54c516){return function(_0x4edb9b){if(_0x4edb9b){var _0x476e13=_0x4edb9b[_0xdf59('0x2c')],_0x2593ec=_0x54c516[_0xdf59('0x2d')],_0x2d5d0d=_0x54c516[_0xdf59('0x2d')]+_0x54c516[_0xdf59('0x2e')],_0x65bbdd;if(_0x2d5d0d>=_0x476e13){_0x2d5d0d=_0x476e13;_0x65bbdd=0xc8;}else{_0x65bbdd=0xce;}_0x33fddc[_0xdf59('0x29')](_0x65bbdd);return _0x33fddc[_0xdf59('0x2f')](_0xdf59('0x30'),_0x2593ec+'-'+_0x2d5d0d+'/'+_0x476e13)[_0xdf59('0x2b')](_0x4edb9b);}return null;};}function patchUpdates(_0x592ad2){return function(_0x5b1fff){try{jsonpatch['apply'](_0x5b1fff,_0x592ad2,!![]);}catch(_0xe06832){return BPromise[_0xdf59('0x31')](_0xe06832);}return _0x5b1fff['save']();};}function saveUpdates(_0x7bd18d,_0x343fa8){return function(_0x5e9190){if(_0x5e9190){return _0x5e9190[_0xdf59('0x32')](_0x7bd18d)['then'](function(_0x4c8a29){return _0x4c8a29;});}return null;};}function removeEntity(_0x26fbee,_0x202504){return function(_0x4aa358){if(_0x4aa358){return _0x4aa358[_0xdf59('0x33')]()[_0xdf59('0x1e')](function(){var _0x747051=_0x4aa358['get']({'plain':!![]});var _0x1693f8='OpenchannelAccounts';return db['UserProfileResource'][_0xdf59('0x33')]({'where':{'type':_0x1693f8,'resourceId':_0x747051['id']}})['then'](function(){return _0x4aa358;});})[_0xdf59('0x1e')](function(){_0x26fbee[_0xdf59('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3013b6,_0x25f693){return function(_0x51149f){if(!_0x51149f){_0x3013b6[_0xdf59('0x28')](0x194);}return _0x51149f;};}function handleError(_0x233d2f,_0x5d5256){_0x5d5256=_0x5d5256||0x1f4;return function(_0x1cc87a){logger[_0xdf59('0x24')](_0x1cc87a[_0xdf59('0x34')]);if(_0x1cc87a[_0xdf59('0x35')]){delete _0x1cc87a[_0xdf59('0x35')];}_0x233d2f[_0xdf59('0x29')](_0x5d5256)[_0xdf59('0x36')](_0x1cc87a);};}exports[_0xdf59('0x37')]=function(_0x474594,_0xf1096e){var _0x565b7e={'include':[{'model':db[_0xdf59('0x38')],'as':'mandatoryDispositionPause'}]},_0x2ebfa9={},_0x1b4376={'count':0x0,'rows':[]};var _0x18bdf0=db[_0xdf59('0x39')][_0xdf59('0x3a')];_0x2ebfa9[_0xdf59('0x3b')]=_[_0xdf59('0x3c')](_0x18bdf0);_0x2ebfa9[_0xdf59('0x3d')]=_[_0xdf59('0x3c')](_0x474594['query']);_0x2ebfa9[_0xdf59('0x3e')]=_[_0xdf59('0x3f')](_0x2ebfa9[_0xdf59('0x3b')],_0x2ebfa9[_0xdf59('0x3d')]);_0x565b7e['attributes']=_[_0xdf59('0x3f')](_0x2ebfa9[_0xdf59('0x3b')],qs[_0xdf59('0x40')](_0x474594['query'][_0xdf59('0x40')]));_0x565b7e[_0xdf59('0x41')]=_0x565b7e[_0xdf59('0x41')][_0xdf59('0x42')]?_0x565b7e[_0xdf59('0x41')]:_0x2ebfa9[_0xdf59('0x3b')];if(!_0x474594[_0xdf59('0x3d')][_0xdf59('0x43')](_0xdf59('0x44'))){_0x565b7e['limit']=qs[_0xdf59('0x2e')](_0x474594[_0xdf59('0x3d')]['limit']);_0x565b7e[_0xdf59('0x2d')]=qs[_0xdf59('0x2d')](_0x474594['query']['offset']);}_0x565b7e[_0xdf59('0x45')]=qs[_0xdf59('0x46')](_0x474594['query'][_0xdf59('0x46')]);_0x565b7e[_0xdf59('0x47')]=qs[_0xdf59('0x3e')](_[_0xdf59('0x48')](_0x474594[_0xdf59('0x3d')],_0x2ebfa9[_0xdf59('0x3e')]));if(_0x474594[_0xdf59('0x3d')][_0xdf59('0x49')]){_0x565b7e[_0xdf59('0x47')]=_[_0xdf59('0x4a')](_0x565b7e['where'],{'$or':_[_0xdf59('0x4b')](_0x18bdf0,function(_0x59b1d7){if(_0x59b1d7[_0xdf59('0x4c')]['key']!==_0xdf59('0x4d')){var _0x45a30a={};_0x45a30a[_0x59b1d7['field']]={'$like':'%'+_0x474594['query'][_0xdf59('0x49')]+'%'};return _0x45a30a;}})});}_0x565b7e=_['merge']({},_0x565b7e,_0x474594['options']);var _0xff274e={'where':_0x565b7e[_0xdf59('0x47')]};return db[_0xdf59('0x39')]['count'](_0xff274e)['then'](function(_0x529628){_0x1b4376[_0xdf59('0x2c')]=_0x529628;if(_0x474594[_0xdf59('0x3d')]['includeAll']){_0x565b7e[_0xdf59('0x4e')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xdf59('0x4f')](_0x565b7e);})[_0xdf59('0x1e')](function(_0x2beee5){_0x1b4376['rows']=_0x2beee5;return _0x1b4376;})[_0xdf59('0x1e')](respondWithFilteredResult(_0xf1096e,_0x565b7e))[_0xdf59('0x27')](handleError(_0xf1096e,null));};exports[_0xdf59('0x50')]=function(_0x4af3dc,_0x58af1a){var _0x43554c={'raw':![],'where':{'id':_0x4af3dc['params']['id']},'include':[{'model':db['Pause'],'as':_0xdf59('0x51')}]},_0x40c183={};_0x40c183['model']=_[_0xdf59('0x3c')](db[_0xdf59('0x39')]['rawAttributes']);_0x40c183[_0xdf59('0x3d')]=_[_0xdf59('0x3c')](_0x4af3dc[_0xdf59('0x3d')]);_0x40c183[_0xdf59('0x3e')]=_['intersection'](_0x40c183[_0xdf59('0x3b')],_0x40c183[_0xdf59('0x3d')]);_0x43554c[_0xdf59('0x41')]=_[_0xdf59('0x3f')](_0x40c183[_0xdf59('0x3b')],qs['fields'](_0x4af3dc[_0xdf59('0x3d')]['fields']));_0x43554c['attributes']=_0x43554c['attributes']['length']?_0x43554c[_0xdf59('0x41')]:_0x40c183[_0xdf59('0x3b')];if(_0x4af3dc[_0xdf59('0x3d')][_0xdf59('0x52')]){_0x43554c[_0xdf59('0x4e')]=[{'all':!![]}];}_0x43554c=_['merge']({},_0x43554c,_0x4af3dc[_0xdf59('0x53')]);return db['OpenchannelAccount'][_0xdf59('0x54')](_0x43554c)[_0xdf59('0x1e')](handleEntityNotFound(_0x58af1a,null))['then'](respondWithResult(_0x58af1a,null))[_0xdf59('0x27')](handleError(_0x58af1a,null));};exports['create']=function(_0x17238a,_0x1b510e){return db[_0xdf59('0x39')][_0xdf59('0x55')](_0x17238a[_0xdf59('0x56')],{})[_0xdf59('0x1e')](function(_0x2944ae){var _0x31dcfc=_0x17238a[_0xdf59('0x57')]['get']({'plain':!![]});if(!_0x31dcfc)throw new Error(_0xdf59('0x58'));if(_0x31dcfc[_0xdf59('0x59')]===_0xdf59('0x57')){var _0x243186=_0x2944ae[_0xdf59('0x5a')]({'plain':!![]});var _0x387c83='OpenchannelAccounts';return db[_0xdf59('0x5b')][_0xdf59('0x54')]({'where':{'name':_0x387c83,'userProfileId':_0x31dcfc[_0xdf59('0x5c')]},'raw':!![]})[_0xdf59('0x1e')](function(_0xe0585){if(_0xe0585&&_0xe0585[_0xdf59('0x5d')]===0x0){return db['UserProfileResource'][_0xdf59('0x55')]({'name':_0x243186[_0xdf59('0x35')],'resourceId':_0x243186['id'],'type':_0xe0585[_0xdf59('0x35')],'sectionId':_0xe0585['id']},{})[_0xdf59('0x1e')](function(){return _0x2944ae;});}else{return _0x2944ae;}})[_0xdf59('0x27')](function(_0x468703){logger[_0xdf59('0x24')](_0xdf59('0x5e'),_0x468703);throw _0x468703;});}return _0x2944ae;})[_0xdf59('0x1e')](respondWithResult(_0x1b510e,0xc9))[_0xdf59('0x27')](handleError(_0x1b510e,null));};exports[_0xdf59('0x32')]=function(_0x10a82e,_0x3bde07){if(_0x10a82e[_0xdf59('0x56')]['id']){delete _0x10a82e[_0xdf59('0x56')]['id'];}return db[_0xdf59('0x39')][_0xdf59('0x54')]({'where':{'id':_0x10a82e['params']['id']},'include':[{'model':db[_0xdf59('0x38')],'as':'mandatoryDispositionPause'}]})[_0xdf59('0x1e')](handleEntityNotFound(_0x3bde07,null))['then'](saveUpdates(_0x10a82e[_0xdf59('0x56')],null))[_0xdf59('0x1e')](respondWithResult(_0x3bde07,null))[_0xdf59('0x27')](handleError(_0x3bde07,null));};exports[_0xdf59('0x33')]=function(_0x2c3e93,_0x29e297){return db['OpenchannelAccount'][_0xdf59('0x54')]({'where':{'id':_0x2c3e93[_0xdf59('0x5f')]['id']}})['then'](handleEntityNotFound(_0x29e297,null))[_0xdf59('0x1e')](removeEntity(_0x29e297,null))[_0xdf59('0x27')](handleError(_0x29e297,null));};exports[_0xdf59('0x60')]=function(_0x1780ab,_0x4666f8){return db[_0xdf59('0x39')][_0xdf59('0x60')]()[_0xdf59('0x1e')](respondWithResult(_0x4666f8,null))[_0xdf59('0x27')](handleError(_0x4666f8,null));};exports['addDisposition']=function(_0x2f4396,_0x52a354,_0x4eb85){if(_0x2f4396['body']['id']){delete _0x2f4396['body']['id'];}return db[_0xdf59('0x39')][_0xdf59('0x54')]({'where':{'id':_0x2f4396[_0xdf59('0x5f')]['id']}})[_0xdf59('0x1e')](handleEntityNotFound(_0x52a354,null))['then'](function(_0x41369d){if(_0x41369d){_0x2f4396[_0xdf59('0x56')][_0xdf59('0x61')]=_0x41369d['id'];return db[_0xdf59('0x62')][_0xdf59('0x55')](_0x2f4396[_0xdf59('0x56')]);}})[_0xdf59('0x1e')](respondWithResult(_0x52a354,null))[_0xdf59('0x27')](handleError(_0x52a354,null));};exports[_0xdf59('0x63')]=function(_0x562bd2,_0x15536e,_0xd380c7){var _0x3317d7={'raw':![],'where':{}};var _0x5cea9a={};var _0x586bfd={'count':0x0,'rows':[]};return db[_0xdf59('0x39')][_0xdf59('0x64')]({'where':{'id':_0x562bd2['params']['id']}})[_0xdf59('0x1e')](handleEntityNotFound(_0x15536e,null))[_0xdf59('0x1e')](function(_0x624f96){if(_0x624f96){_0x5cea9a[_0xdf59('0x3b')]=_[_0xdf59('0x3c')](db['Disposition'][_0xdf59('0x3a')]);_0x5cea9a[_0xdf59('0x3d')]=_['keys'](_0x562bd2[_0xdf59('0x3d')]);_0x5cea9a[_0xdf59('0x3e')]=_['intersection'](_0x5cea9a['model'],_0x5cea9a[_0xdf59('0x3d')]);_0x3317d7[_0xdf59('0x41')]=_[_0xdf59('0x3f')](_0x5cea9a[_0xdf59('0x3b')],qs[_0xdf59('0x40')](_0x562bd2['query'][_0xdf59('0x40')]));_0x3317d7['attributes']=_0x3317d7[_0xdf59('0x41')][_0xdf59('0x42')]?_0x3317d7[_0xdf59('0x41')]:_0x5cea9a['model'];if(!_0x562bd2['query']['hasOwnProperty'](_0xdf59('0x44'))){_0x3317d7['limit']=qs['limit'](_0x562bd2['query'][_0xdf59('0x2e')]);_0x3317d7[_0xdf59('0x2d')]=qs[_0xdf59('0x2d')](_0x562bd2[_0xdf59('0x3d')][_0xdf59('0x2d')]);}_0x3317d7[_0xdf59('0x45')]=qs['sort'](_0x562bd2[_0xdf59('0x3d')][_0xdf59('0x46')]);_0x3317d7['where']=qs[_0xdf59('0x3e')](_[_0xdf59('0x48')](_0x562bd2[_0xdf59('0x3d')],_0x5cea9a['filters']));_0x3317d7['where']['OpenchannelAccountId']=_0x624f96['id'];if(_0x562bd2['query'][_0xdf59('0x49')]){_0x3317d7[_0xdf59('0x47')]=_[_0xdf59('0x4a')](_0x3317d7[_0xdf59('0x47')],{'$or':_[_0xdf59('0x4b')](_0x3317d7[_0xdf59('0x41')],function(_0x14caaf){var _0x44646b={};_0x44646b[_0x14caaf]={'$like':'%'+_0x562bd2['query'][_0xdf59('0x49')]+'%'};return _0x44646b;})});}_0x3317d7=_[_0xdf59('0x4a')]({},_0x3317d7,_0x562bd2[_0xdf59('0x53')]);return db[_0xdf59('0x62')][_0xdf59('0x2c')]({'where':_0x3317d7[_0xdf59('0x47')]})['then'](function(_0x103be7){_0x586bfd['count']=_0x103be7;if(_0x562bd2['query'][_0xdf59('0x52')]){_0x3317d7[_0xdf59('0x4e')]=[{'all':!![]}];}return db['Disposition'][_0xdf59('0x4f')](_0x3317d7);})[_0xdf59('0x1e')](function(_0x203eba){_0x586bfd[_0xdf59('0x65')]=_0x203eba;return _0x586bfd;});}})['then'](respondWithFilteredResult(_0x15536e,_0x3317d7))['catch'](handleError(_0x15536e,null));};exports[_0xdf59('0x66')]=function(_0x30e8ad,_0x416182,_0x4da39c){return db[_0xdf59('0x39')][_0xdf59('0x54')]({'where':{'id':_0x30e8ad[_0xdf59('0x5f')]['id']}})[_0xdf59('0x1e')](handleEntityNotFound(_0x416182,null))[_0xdf59('0x1e')](function(_0x5b6ab5){if(_0x5b6ab5){return _0x5b6ab5[_0xdf59('0x66')](_0x30e8ad[_0xdf59('0x3d')][_0xdf59('0x67')]);}})[_0xdf59('0x1e')](respondWithStatusCode(_0x416182,null))['catch'](handleError(_0x416182,null));};exports[_0xdf59('0x68')]=function(_0x12fd4f,_0xeaca65,_0x30de9c){if(_0x12fd4f[_0xdf59('0x56')]['id']){delete _0x12fd4f[_0xdf59('0x56')]['id'];}return db[_0xdf59('0x39')][_0xdf59('0x54')]({'where':{'id':_0x12fd4f[_0xdf59('0x5f')]['id']}})[_0xdf59('0x1e')](handleEntityNotFound(_0xeaca65,null))[_0xdf59('0x1e')](function(_0x2a6693){if(_0x2a6693){_0x12fd4f[_0xdf59('0x56')]['OpenchannelAccountId']=_0x2a6693['id'];return db[_0xdf59('0x69')][_0xdf59('0x55')](_0x12fd4f[_0xdf59('0x56')]);}})['then'](respondWithResult(_0xeaca65,null))['catch'](handleError(_0xeaca65,null));};exports[_0xdf59('0x6a')]=function(_0x4c4d5e,_0x25af7b,_0x33de6c){var _0x9ccc81={'raw':![],'where':{}};var _0x239e2a={};var _0x16dcd4={'count':0x0,'rows':[]};return db[_0xdf59('0x39')]['findOne']({'where':{'id':_0x4c4d5e[_0xdf59('0x5f')]['id']}})[_0xdf59('0x1e')](handleEntityNotFound(_0x25af7b,null))[_0xdf59('0x1e')](function(_0x526b39){if(_0x526b39){_0x239e2a[_0xdf59('0x3b')]=_[_0xdf59('0x3c')](db[_0xdf59('0x69')][_0xdf59('0x3a')]);_0x239e2a['query']=_[_0xdf59('0x3c')](_0x4c4d5e['query']);_0x239e2a[_0xdf59('0x3e')]=_[_0xdf59('0x3f')](_0x239e2a[_0xdf59('0x3b')],_0x239e2a[_0xdf59('0x3d')]);_0x9ccc81['attributes']=_[_0xdf59('0x3f')](_0x239e2a[_0xdf59('0x3b')],qs[_0xdf59('0x40')](_0x4c4d5e[_0xdf59('0x3d')][_0xdf59('0x40')]));_0x9ccc81[_0xdf59('0x41')]=_0x9ccc81[_0xdf59('0x41')][_0xdf59('0x42')]?_0x9ccc81[_0xdf59('0x41')]:_0x239e2a[_0xdf59('0x3b')];if(!_0x4c4d5e[_0xdf59('0x3d')][_0xdf59('0x43')](_0xdf59('0x44'))){_0x9ccc81[_0xdf59('0x2e')]=qs[_0xdf59('0x2e')](_0x4c4d5e[_0xdf59('0x3d')][_0xdf59('0x2e')]);_0x9ccc81[_0xdf59('0x2d')]=qs[_0xdf59('0x2d')](_0x4c4d5e['query'][_0xdf59('0x2d')]);}_0x9ccc81['order']=qs['sort'](_0x4c4d5e[_0xdf59('0x3d')][_0xdf59('0x46')]);_0x9ccc81[_0xdf59('0x47')]=qs[_0xdf59('0x3e')](_[_0xdf59('0x48')](_0x4c4d5e[_0xdf59('0x3d')],_0x239e2a[_0xdf59('0x3e')]));_0x9ccc81['where']['OpenchannelAccountId']=_0x526b39['id'];if(_0x4c4d5e[_0xdf59('0x3d')][_0xdf59('0x49')]){_0x9ccc81[_0xdf59('0x47')]=_[_0xdf59('0x4a')](_0x9ccc81[_0xdf59('0x47')],{'$or':_['map'](_0x9ccc81['attributes'],function(_0x51d127){var _0x5abb4c={};_0x5abb4c[_0x51d127]={'$like':'%'+_0x4c4d5e[_0xdf59('0x3d')][_0xdf59('0x49')]+'%'};return _0x5abb4c;})});}_0x9ccc81=_[_0xdf59('0x4a')]({},_0x9ccc81,_0x4c4d5e[_0xdf59('0x53')]);return db[_0xdf59('0x69')]['count']({'where':_0x9ccc81[_0xdf59('0x47')]})[_0xdf59('0x1e')](function(_0x39f1a4){_0x16dcd4['count']=_0x39f1a4;if(_0x4c4d5e[_0xdf59('0x3d')][_0xdf59('0x52')]){_0x9ccc81['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xdf59('0x4f')](_0x9ccc81);})['then'](function(_0x5b4ffc){_0x16dcd4[_0xdf59('0x65')]=_0x5b4ffc;return _0x16dcd4;});}})[_0xdf59('0x1e')](respondWithFilteredResult(_0x25af7b,_0x9ccc81))['catch'](handleError(_0x25af7b,null));};exports[_0xdf59('0x6b')]=function(_0x56e9b9,_0x5de9da,_0x4c5de3){return db[_0xdf59('0x39')]['find']({'where':{'id':_0x56e9b9[_0xdf59('0x5f')]['id']}})[_0xdf59('0x1e')](handleEntityNotFound(_0x5de9da,null))['then'](function(_0x50082d){if(_0x50082d){return _0x50082d['removeAnswers'](_0x56e9b9[_0xdf59('0x3d')][_0xdf59('0x67')]);}})['then'](respondWithStatusCode(_0x5de9da,null))['catch'](handleError(_0x5de9da,null));};exports[_0xdf59('0x6c')]=function(_0x198ba0,_0x3f74ef,_0x389597){var _0x1b6986={'body':_0x198ba0[_0xdf59('0x56')],'channel':'openchannel'};var _0x21376c=[];var _0x162a84=[];var _0xa0861b={};var _0x4bdec1=![];return db[_0xdf59('0x6d')][_0xdf59('0x60')]()[_0xdf59('0x1e')](function(_0x20ab92){if(!_0x20ab92){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x21376c=_[_0xdf59('0x6e')](_[_0xdf59('0x3c')](_0x20ab92),['createdAt',_0xdf59('0x6f')]);_0x162a84=_['difference'](_['keys'](_0x20ab92),[_0xdf59('0x70'),'updatedAt','CompanyId',_0xdf59('0x71')]);if(_0x198ba0[_0xdf59('0x56')]['id']){delete _0x198ba0[_0xdf59('0x56')]['id'];}if(_[_0xdf59('0x72')](_0x198ba0[_0xdf59('0x56')][_0xdf59('0x73')])){throw new db[(_0xdf59('0x74'))][(_0xdf59('0x75'))](_0xdf59('0x76'));}if(_[_0xdf59('0x72')](_0x198ba0['body'][_0xdf59('0x56')])||_0x198ba0['body'][_0xdf59('0x56')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x198ba0[_0xdf59('0x56')][_0xdf59('0x77')])){throw new db[(_0xdf59('0x74'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x162a84);}if(!_[_0xdf59('0x78')](_0x162a84,_0x198ba0[_0xdf59('0x56')][_0xdf59('0x77')])){throw new db[(_0xdf59('0x74'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x162a84);}_0xa0861b[_0x198ba0[_0xdf59('0x56')][_0xdf59('0x77')]]=_0x198ba0['body'][_0xdf59('0x73')];})[_0xdf59('0x1e')](function(){return db[_0xdf59('0x39')][_0xdf59('0x54')]({'where':{'id':_0x198ba0[_0xdf59('0x5f')]['id']},'include':[{'model':db[_0xdf59('0x79')],'as':_0xdf59('0x7a'),'include':[{'model':db[_0xdf59('0x6d')],'as':_0xdf59('0x7b'),'where':_0xa0861b,'limit':0x1,'order':[['updatedAt',_0xdf59('0x7c')]]}]},{'model':db[_0xdf59('0x7d')],'as':_0xdf59('0x7e')}]});})[_0xdf59('0x1e')](handleEntityNotFound(_0x3f74ef,null))[_0xdf59('0x1e')](function(_0x4e6b36){if(_0x4e6b36&&_0x4e6b36[_0xdf59('0x7a')]){_0x1b6986[_0xdf59('0x7f')]=_0x4e6b36;_0x1b6986['applications']=_0x4e6b36['Applications'];_0x1b6986[_0xdf59('0x80')]=_0x4e6b36[_0xdf59('0x7a')];_0x1b6986[_0xdf59('0x81')]=_['orderBy'](_0x1b6986['applications'],[_0xdf59('0x82')],[_0xdf59('0x83')]);if(_0x1b6986[_0xdf59('0x7f')][_0xdf59('0x7e')]){delete _0x1b6986[_0xdf59('0x7f')]['Applications'];}if(_0x1b6986['account'][_0xdf59('0x7a')]&&_0x1b6986[_0xdf59('0x7f')]['List'][_0xdf59('0x7b')][_0xdf59('0x42')]){return _0x1b6986[_0xdf59('0x7f')]['List']['Contacts'][0x0];}var _0x1cf688=_[_0xdf59('0x84')](_0x198ba0[_0xdf59('0x56')],{'firstName':_0x198ba0[_0xdf59('0x56')][_0xdf59('0x73')],'ListId':_0x4e6b36['ListId']});_0x1cf688[_0x198ba0[_0xdf59('0x56')][_0xdf59('0x77')]]=_0x198ba0[_0xdf59('0x56')][_0xdf59('0x73')];return db['CmContact'][_0xdf59('0x55')](_0x1cf688,{'fields':_0x21376c,'raw':!![]});}})[_0xdf59('0x1e')](handleEntityNotFound(_0x3f74ef,null))[_0xdf59('0x1e')](function(_0x3a886d){_0x1b6986[_0xdf59('0x85')]=_0x3a886d;if(_0x3a886d){var _0x545ecb={'ContactId':_0x3a886d['id'],'OpenchannelAccountId':_0x198ba0[_0xdf59('0x5f')]['id'],'from':(_0x3a886d['firstName']||'')+'\x20'+(_0x3a886d[_0xdf59('0x86')]||'')};var _0x438ec1={'OpenchannelAccountId':_0x198ba0['params']['id'],'closed':![]};if(_0x198ba0[_0xdf59('0x56')][_0xdf59('0x87')]){_0x438ec1[_0xdf59('0x87')]=_0x198ba0[_0xdf59('0x56')][_0xdf59('0x87')];return db[_0xdf59('0x88')][_0xdf59('0x54')]({'where':_0x438ec1})['then'](function(_0x27a6bd){if(_0x27a6bd){return[_0x27a6bd,![]];}_0x545ecb[_0xdf59('0x87')]=_0x198ba0[_0xdf59('0x56')]['threadId'];_0x545ecb[_0xdf59('0x89')]=_0x198ba0[_0xdf59('0x56')][_0xdf59('0x89')];return db[_0xdf59('0x88')]['create'](_0x545ecb)[_0xdf59('0x1e')](function(_0x470593){return[_0x470593,!![]];});});}else{_0x438ec1['threadId']=null;}_0x438ec1[_0xdf59('0x8a')]=_0x3a886d['id'];return db[_0xdf59('0x88')][_0xdf59('0x54')]({'where':_0x438ec1})[_0xdf59('0x1e')](function(_0x1943c1){if(_0x1943c1){return[_0x1943c1,![]];}return db[_0xdf59('0x88')][_0xdf59('0x55')](_0x545ecb)[_0xdf59('0x1e')](function(_0x465080){return[_0x465080,!![]];});});}})[_0xdf59('0x8b')](function(_0x4b4c6c,_0x414b7a){if(_0x4b4c6c){_0x4bdec1=_0x414b7a;if(!_0x414b7a){var _0x3e5438={'from':(_0x1b6986['contact']['firstName']||'')+'\x20'+(_0x1b6986[_0xdf59('0x85')][_0xdf59('0x86')]||'')};if(_0x198ba0['body']['threadId']&&_0x198ba0[_0xdf59('0x56')]['messageId']&&_0x198ba0['body'][_0xdf59('0x87')]!=_0x198ba0[_0xdf59('0x56')][_0xdf59('0x8c')]){_0x3e5438['threadId']=_0x198ba0[_0xdf59('0x56')]['messageId'];}return _0x4b4c6c[_0xdf59('0x32')](_0x3e5438);}else{return _0x4b4c6c;}}})[_0xdf59('0x1e')](function(_0x161bd7){_0x1b6986[_0xdf59('0x8d')]=_0x161bd7['get']({'plain':!![]});_0x1b6986[_0xdf59('0x8d')][_0xdf59('0x8e')]=_0x4bdec1;if(_0x1b6986[_0xdf59('0x8d')]['created']){if(_0x1b6986['account'][_0xdf59('0x8f')]){_0x1b6986[_0xdf59('0x81')][_0xdf59('0x90')]({'id':0x0,'priority':_0x1b6986['applications'][_0xdf59('0x42')]+0x1,'app':_0xdf59('0x91'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['OpenchannelMessage']['create']({'body':_0x198ba0[_0xdf59('0x56')][_0xdf59('0x56')],'OpenchannelAccountId':_0x198ba0[_0xdf59('0x5f')]['id'],'OpenchannelInteractionId':_0x161bd7['id'],'direction':'in','ContactId':_0x1b6986[_0xdf59('0x85')]['id'],'AttachmentId':_0x198ba0[_0xdf59('0x56')]['AttachmentId']});})[_0xdf59('0x1e')](function(_0x8fd72a){_0x1b6986['message']=_0x8fd72a;if(_0x1b6986['interaction'][_0xdf59('0x92')]){return db['User'][_0xdf59('0x54')]({'attributes':['id',_0xdf59('0x35')],'where':{'id':_0x1b6986[_0xdf59('0x8d')][_0xdf59('0x92')]}})['then'](function(_0x26b7b8){if(_0x26b7b8){_0x1b6986[_0xdf59('0x81')][_0xdf59('0x93')]({'id':0x0,'priority':0x0,'app':_0xdf59('0x94'),'appdata':_0x26b7b8[_0xdf59('0x35')]+','+(_0x1b6986[_0xdf59('0x7f')][_0xdf59('0x95')]||0xa),'interval':_0xdf59('0x96')});_0x1b6986[_0xdf59('0x97')]=![];}return respondWithRpcPromise(_0xdf59('0x98'),_0xdf59('0x99'),_0x1b6986);});}return respondWithRpcPromise('Start','startRouting',_0x1b6986);})['then'](function(_0x7ada){respondWithRpcPromise(_0xdf59('0x9a'),_0xdf59('0x9a'),{'event':_0xdf59('0x6c'),'message':_0x7ada},client9002);return _0x7ada;})[_0xdf59('0x1e')](respondWithResult(_0x3f74ef,null))[_0xdf59('0x27')](handleError(_0x3f74ef,null));};exports[_0xdf59('0x9b')]=function(_0x49f047,_0x49d380,_0x748225){return db[_0xdf59('0x39')][_0xdf59('0x64')]({'where':{'id':_0x49f047[_0xdf59('0x5f')]['id']}})[_0xdf59('0x1e')](handleEntityNotFound(_0x49d380,null))[_0xdf59('0x1e')](function(_0x23056a){if(_0x23056a){return db['sequelize'][_0xdf59('0x9c')](function(_0x444be5){return db[_0xdf59('0x7d')][_0xdf59('0x33')]({'where':{'OpenchannelAccountId':_0x49f047[_0xdf59('0x5f')]['id']},'transaction':_0x444be5})[_0xdf59('0x1e')](function(_0x4e3a28){var _0x21ff29=_[_0xdf59('0x4b')](_0x49f047['body'],function(_0x53a073){_0x53a073[_0xdf59('0x9d')]=_0x49f047['params']['id'];return _0x53a073;});return db['OpenchannelApplication'][_0xdf59('0x9e')](_0x21ff29,{'transaction':_0x444be5});});})[_0xdf59('0x1e')](function(){return db[_0xdf59('0x7d')][_0xdf59('0x9f')]({'where':{'OpenchannelAccountId':_0x49f047[_0xdf59('0x5f')]['id']},'order':_0xdf59('0x82')});});}})['then'](respondWithResult(_0x49d380,null))[_0xdf59('0x27')](handleError(_0x49d380,null));};exports[_0xdf59('0xa0')]=function(_0x3d46c1,_0x555de7,_0x51b544){var _0x22b58d={};var _0x57cccf={};var _0x6dcded;var _0x1d0102;return db[_0xdf59('0x39')][_0xdf59('0x64')]({'where':{'id':_0x3d46c1['params']['id']}})['then'](handleEntityNotFound(_0x555de7,null))[_0xdf59('0x1e')](function(_0x386465){if(_0x386465){_0x6dcded=_0x386465;_0x57cccf[_0xdf59('0x3b')]=_[_0xdf59('0x3c')](db[_0xdf59('0x7d')][_0xdf59('0x3a')]);_0x57cccf[_0xdf59('0x3d')]=_[_0xdf59('0x3c')](_0x3d46c1[_0xdf59('0x3d')]);_0x57cccf[_0xdf59('0x3e')]=_[_0xdf59('0x3f')](_0x57cccf[_0xdf59('0x3b')],_0x57cccf[_0xdf59('0x3d')]);_0x22b58d['attributes']=_['intersection'](_0x57cccf[_0xdf59('0x3b')],qs[_0xdf59('0x40')](_0x3d46c1[_0xdf59('0x3d')][_0xdf59('0x40')]));_0x22b58d['attributes']=_0x22b58d[_0xdf59('0x41')][_0xdf59('0x42')]?_0x22b58d['attributes']:_0x57cccf[_0xdf59('0x3b')];_0x22b58d[_0xdf59('0x45')]=qs[_0xdf59('0x46')](_0x3d46c1[_0xdf59('0x3d')][_0xdf59('0x46')]);_0x22b58d[_0xdf59('0x47')]=qs[_0xdf59('0x3e')](_[_0xdf59('0x48')](_0x3d46c1['query'],_0x57cccf[_0xdf59('0x3e')]));if(_0x3d46c1[_0xdf59('0x3d')]['filter']){_0x22b58d['where']=_[_0xdf59('0x4a')](_0x22b58d[_0xdf59('0x47')],{'$or':_[_0xdf59('0x4b')](_0x22b58d[_0xdf59('0x41')],function(_0x13bdcd){var _0x522653={};_0x522653[_0x13bdcd]={'$like':'%'+_0x3d46c1[_0xdf59('0x3d')][_0xdf59('0x49')]+'%'};return _0x522653;})});}_0x22b58d=_[_0xdf59('0x4a')]({},_0x22b58d,_0x3d46c1[_0xdf59('0x53')]);return _0x6dcded['getApplications'](_0x22b58d);}})[_0xdf59('0x1e')](function(_0xde0549){if(_0xde0549){_0x1d0102=_0xde0549['length'];if(!_0x3d46c1[_0xdf59('0x3d')]['hasOwnProperty'](_0xdf59('0x44'))){_0x22b58d[_0xdf59('0x2e')]=qs[_0xdf59('0x2e')](_0x3d46c1['query']['limit']);_0x22b58d[_0xdf59('0x2d')]=qs[_0xdf59('0x2d')](_0x3d46c1[_0xdf59('0x3d')]['offset']);}return _0x6dcded['getApplications'](_0x22b58d);}})[_0xdf59('0x1e')](function(_0x15455c){if(_0x15455c){return _0x15455c?{'count':_0x1d0102,'rows':_0x15455c}:null;}})[_0xdf59('0x1e')](respondWithResult(_0x555de7,null))['catch'](handleError(_0x555de7,null));};exports['getInteractions']=function(_0x5283da,_0x3eb735,_0x51db67){var _0x33744={'raw':![],'where':{}};var _0x37299d={};var _0x3fd436={'count':0x0,'rows':[]};return db[_0xdf59('0x39')]['findOne']({'where':{'id':_0x5283da[_0xdf59('0x5f')]['id']}})[_0xdf59('0x1e')](handleEntityNotFound(_0x3eb735,null))[_0xdf59('0x1e')](function(_0x36f6f6){if(_0x36f6f6){_0x37299d[_0xdf59('0x3b')]=_[_0xdf59('0x3c')](db[_0xdf59('0x88')]['rawAttributes']);_0x37299d[_0xdf59('0x3d')]=_['keys'](_0x5283da[_0xdf59('0x3d')]);_0x37299d[_0xdf59('0x3e')]=_[_0xdf59('0x3f')](_0x37299d[_0xdf59('0x3b')],_0x37299d[_0xdf59('0x3d')]);_0x33744[_0xdf59('0x41')]=_[_0xdf59('0x3f')](_0x37299d[_0xdf59('0x3b')],qs[_0xdf59('0x40')](_0x5283da['query']['fields']));_0x33744[_0xdf59('0x41')]=_0x33744[_0xdf59('0x41')][_0xdf59('0x42')]?_0x33744['attributes']:_0x37299d['model'];if(!_0x5283da['query'][_0xdf59('0x43')](_0xdf59('0x44'))){_0x33744[_0xdf59('0x2e')]=qs[_0xdf59('0x2e')](_0x5283da[_0xdf59('0x3d')][_0xdf59('0x2e')]);_0x33744[_0xdf59('0x2d')]=qs['offset'](_0x5283da['query'][_0xdf59('0x2d')]);}_0x33744['order']=qs[_0xdf59('0x46')](_0x5283da[_0xdf59('0x3d')][_0xdf59('0x46')]);_0x33744[_0xdf59('0x47')]=qs['filters'](_['pick'](_0x5283da[_0xdf59('0x3d')],_0x37299d[_0xdf59('0x3e')]));_0x33744[_0xdf59('0x47')]['OpenchannelAccountId']=_0x36f6f6['id'];if(_0x5283da[_0xdf59('0x3d')][_0xdf59('0x49')]){_0x33744['where']=_[_0xdf59('0x4a')](_0x33744[_0xdf59('0x47')],{'$or':_[_0xdf59('0x4b')](_0x33744[_0xdf59('0x41')],function(_0x40b307){var _0x5695b8={};_0x5695b8[_0x40b307]={'$like':'%'+_0x5283da['query'][_0xdf59('0x49')]+'%'};return _0x5695b8;})});}_0x33744=_[_0xdf59('0x4a')]({},_0x33744,_0x5283da['options']);return db[_0xdf59('0x88')][_0xdf59('0x2c')]({'where':_0x33744['where']})[_0xdf59('0x1e')](function(_0xb21697){_0x3fd436[_0xdf59('0x2c')]=_0xb21697;if(_0x5283da[_0xdf59('0x3d')][_0xdf59('0x52')]){_0x33744[_0xdf59('0x4e')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xdf59('0xa1')],'as':_0xdf59('0xa2'),'attributes':[_0xdf59('0x35'),_0xdf59('0xa3'),_0xdf59('0xa4')],'required':![]},{'model':db['Tag'],'as':_0xdf59('0xa5'),'attributes':['id',_0xdf59('0x35'),_0xdf59('0xa6')],'where':_0x5283da['query'][_0xdf59('0xa7')]?{'id':_0x5283da[_0xdf59('0x3d')]['tag']}:undefined,'required':_0x5283da['query']['tag']?!![]:![]}];}return db[_0xdf59('0x88')][_0xdf59('0x4f')](_0x33744);})[_0xdf59('0x1e')](function(_0x3bdcd6){_0x3fd436[_0xdf59('0x65')]=_0x3bdcd6;return _0x3fd436;});}})[_0xdf59('0x1e')](respondWithFilteredResult(_0x3eb735,_0x33744))[_0xdf59('0x27')](handleError(_0x3eb735,null));};exports[_0xdf59('0xa8')]=function(_0x3bc637,_0x1c8e58,_0x138200){return db[_0xdf59('0x39')]['find']({'where':{'id':_0x3bc637['params']['id']}})[_0xdf59('0x1e')](handleEntityNotFound(_0x1c8e58,null))[_0xdf59('0x1e')](function(_0x4c5777){if(_0x4c5777){return _0x4c5777[_0xdf59('0xa8')](_0x3bc637['body'][_0xdf59('0x67')],_[_0xdf59('0xa9')](_0x3bc637[_0xdf59('0x56')],[_0xdf59('0x67'),'id'])||{})[_0xdf59('0x8b')](function(_0x585604){for(var _0x26b7af=0x0;_0x26b7af<_0x3bc637[_0xdf59('0x56')]['ids'][_0xdf59('0x42')];_0x26b7af+=0x1){socket[_0xdf59('0xaa')](_0xdf59('0xab'),{'UserId':_0x3bc637[_0xdf59('0x56')][_0xdf59('0x67')][_0x26b7af],'OpenchannelAccountId':_0x3bc637[_0xdf59('0x5f')]['id']});}return _0x585604;});}})[_0xdf59('0x1e')](respondWithResult(_0x1c8e58,null))[_0xdf59('0x27')](handleError(_0x1c8e58,null));};exports[_0xdf59('0xac')]=function(_0x1020f8,_0x1bfb4c,_0x47314d){return db[_0xdf59('0x39')][_0xdf59('0x54')]({'where':{'id':_0x1020f8[_0xdf59('0x5f')]['id']}})[_0xdf59('0x1e')](handleEntityNotFound(_0x1bfb4c,null))['then'](function(_0xfa6d16){if(_0xfa6d16){return _0xfa6d16[_0xdf59('0xac')](_0x1020f8[_0xdf59('0x3d')][_0xdf59('0x67')])[_0xdf59('0x1e')](function(){if(_[_0xdf59('0xad')](_0x1020f8['query'][_0xdf59('0x67')])){for(var _0x2ea293=0x0;_0x2ea293<_0x1020f8[_0xdf59('0x3d')]['ids'][_0xdf59('0x42')];_0x2ea293+=0x1){socket[_0xdf59('0xaa')](_0xdf59('0xae'),{'UserId':Number(_0x1020f8['query'][_0xdf59('0x67')][_0x2ea293]),'OpenchannelAccountId':Number(_0x1020f8[_0xdf59('0x5f')]['id'])});}}else{socket[_0xdf59('0xaa')](_0xdf59('0xae'),{'UserId':Number(_0x1020f8['query']['ids']),'OpenchannelAccountId':Number(_0x1020f8[_0xdf59('0x5f')]['id'])});}});}})[_0xdf59('0x1e')](respondWithStatusCode(_0x1bfb4c,null))['catch'](handleError(_0x1bfb4c,null));};exports[_0xdf59('0xaf')]=function(_0x1ac2a8,_0x44a99e,_0x270ac2){var _0x4646c5={};var _0x192018={};var _0x5ed44a;var _0x12cd4d;return db[_0xdf59('0x39')][_0xdf59('0x64')]({'where':{'id':_0x1ac2a8[_0xdf59('0x5f')]['id']}})[_0xdf59('0x1e')](handleEntityNotFound(_0x44a99e,null))[_0xdf59('0x1e')](function(_0x219f73){if(_0x219f73){_0x5ed44a=_0x219f73;_0x192018[_0xdf59('0x3b')]=_[_0xdf59('0x3c')](db[_0xdf59('0xa1')][_0xdf59('0x3a')]);_0x192018[_0xdf59('0x3d')]=_[_0xdf59('0x3c')](_0x1ac2a8['query']);_0x192018[_0xdf59('0x3e')]=_['intersection'](_0x192018['model'],_0x192018['query']);_0x4646c5['attributes']=_['intersection'](_0x192018['model'],qs[_0xdf59('0x40')](_0x1ac2a8['query']['fields']));_0x4646c5[_0xdf59('0x41')]=_0x4646c5[_0xdf59('0x41')][_0xdf59('0x42')]?_0x4646c5[_0xdf59('0x41')]:_0x192018[_0xdf59('0x3b')];_0x4646c5[_0xdf59('0x45')]=qs[_0xdf59('0x46')](_0x1ac2a8[_0xdf59('0x3d')]['sort']);_0x4646c5[_0xdf59('0x47')]=qs['filters'](_[_0xdf59('0x48')](_0x1ac2a8[_0xdf59('0x3d')],_0x192018[_0xdf59('0x3e')]));if(_0x1ac2a8[_0xdf59('0x3d')]['filter']){_0x4646c5[_0xdf59('0x47')]=_[_0xdf59('0x4a')](_0x4646c5[_0xdf59('0x47')],{'$or':_[_0xdf59('0x4b')](_0x4646c5[_0xdf59('0x41')],function(_0x2f28dd){var _0x4ec755={};_0x4ec755[_0x2f28dd]={'$like':'%'+_0x1ac2a8[_0xdf59('0x3d')][_0xdf59('0x49')]+'%'};return _0x4ec755;})});}_0x4646c5=_[_0xdf59('0x4a')]({},_0x4646c5,_0x1ac2a8['options']);return _0x5ed44a[_0xdf59('0xaf')](_0x4646c5);}})[_0xdf59('0x1e')](function(_0x10ca3a){if(_0x10ca3a){_0x12cd4d=_0x10ca3a['length'];if(!_0x1ac2a8['query']['hasOwnProperty'](_0xdf59('0x44'))){_0x4646c5[_0xdf59('0x2e')]=qs['limit'](_0x1ac2a8['query'][_0xdf59('0x2e')]);_0x4646c5[_0xdf59('0x2d')]=qs[_0xdf59('0x2d')](_0x1ac2a8[_0xdf59('0x3d')][_0xdf59('0x2d')]);}return _0x5ed44a['getAgents'](_0x4646c5);}})[_0xdf59('0x1e')](function(_0x3d69a4){if(_0x3d69a4){return _0x3d69a4?{'count':_0x12cd4d,'rows':_0x3d69a4}:null;}})['then'](respondWithResult(_0x44a99e,null))[_0xdf59('0x27')](handleError(_0x44a99e,null));};exports['send']=function(_0x1f241d,_0x3b36bd,_0x4b0aeb){var _0x4748ff,_0x53fea4,_0x596928;if(_[_0xdf59('0x72')](_0x1f241d[_0xdf59('0x56')]['body'])||_0x1f241d[_0xdf59('0x56')][_0xdf59('0x56')]===''){throw new db[(_0xdf59('0x74'))][(_0xdf59('0x75'))](_0xdf59('0xb0'));}if(_['isNil'](_0x1f241d[_0xdf59('0x56')]['to'])){}_0x4748ff=_0x1f241d[_0xdf59('0x56')]['to'];return db['OpenchannelAccount'][_0xdf59('0x64')]({'where':{'id':_0x1f241d['params']['id']}})['then'](handleEntityNotFound(_0x3b36bd,null))[_0xdf59('0x1e')](function(_0x3d5e37){if(_0x3d5e37){return db[_0xdf59('0x39')][_0xdf59('0x54')]({'where':{'id':_0x3d5e37['id']},'include':[{'model':db['CmList'],'as':_0xdf59('0x7a'),'include':[{'model':db[_0xdf59('0x6d')],'as':_0xdf59('0x7b'),'where':{[_0x3d5e37['mapKey']]:_0x4748ff},'limit':0x1,'order':[[_0xdf59('0x6f'),_0xdf59('0x7c')]]}]}]})[_0xdf59('0x1e')](handleEntityNotFound(_0x3b36bd,null))[_0xdf59('0x1e')](function(_0x250c3b){if(_0x250c3b&&_0x250c3b[_0xdf59('0x7a')]){_0x53fea4=_0x250c3b['get']({'plain':!![]});if(_0x53fea4[_0xdf59('0x7a')]&&_0x53fea4[_0xdf59('0x7a')][_0xdf59('0x7b')][_0xdf59('0x42')]){return _0x53fea4[_0xdf59('0x7a')][_0xdf59('0x7b')][0x0];}return db[_0xdf59('0x6d')][_0xdf59('0x55')](_[_0xdf59('0x84')](_0x1f241d[_0xdf59('0x56')],{'firstName':_0x4748ff,[_0x250c3b[_0xdf59('0x77')]]:_0x4748ff,'phone':_0x4748ff,'ListId':_0x53fea4[_0xdf59('0x71')]}));}})[_0xdf59('0x1e')](handleEntityNotFound(_0x3b36bd,null))['then'](function(_0x102002){if(_0x102002){_0x596928=_0x102002;return db[_0xdf59('0x88')][_0xdf59('0x54')]({'where':{'ContactId':_0x596928['id'],'closed':![],'OpenchannelAccountId':_0x53fea4['id']}})[_0xdf59('0x1e')](function(_0x209214){if(_0x209214){return[_0x209214,![]];}return db[_0xdf59('0x88')][_0xdf59('0x55')]({'UserId':_0x1f241d['user']['id'],'ContactId':_0x596928['id'],'OpenchannelAccountId':_0x53fea4['id'],'lastMsgDirection':_0xdf59('0xb1'),'Messages':[_[_0xdf59('0x4a')](_0x1f241d[_0xdf59('0x56')],{'read':![],'body':_0x1f241d[_0xdf59('0x56')][_0xdf59('0x56')],'OpenchannelAccountId':_0x53fea4['id'],'UserId':_0x1f241d['user']['id'],'ContactId':_0x596928['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xdf59('0xb2')}]})[_0xdf59('0x1e')](function(_0x122b85){return[_0x122b85,!![]];});});}})[_0xdf59('0x8b')](function(_0x56b4cc,_0xa76685){if(_0xa76685){return _0x56b4cc;}return db[_0xdf59('0xb3')]['create'](_['merge'](_0x1f241d['body'],{'read':![],'body':_0x1f241d[_0xdf59('0x56')][_0xdf59('0x56')],'OpenchannelAccountId':_0x53fea4['id'],'OpenchannelInteractionId':_0x56b4cc['id'],'UserId':_0x1f241d[_0xdf59('0x57')]['id'],'ContactId':_0x596928['id']}))[_0xdf59('0x1e')](function(_0x5a3949){_0x56b4cc['dataValues'][_0xdf59('0xb2')]=[];_0x56b4cc['dataValues'][_0xdf59('0xb2')][_0xdf59('0x90')](_0x5a3949[_0xdf59('0xb4')]);return _0x56b4cc;});});}})[_0xdf59('0x1e')](respondWithResult(_0x3b36bd,null))['catch'](handleError(_0x3b36bd,null));}; \ No newline at end of file +var _0x2640=['then','destroy','OpenchannelAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','OpenchannelAccount','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','Pause','rawAttributes','find','body','user','get','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','findOne','notify','CmContact','Sequelize','createdAt','updatedAt','ListId','isNil','from','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','created','interaction','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','transaction','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','defaults','out','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','count','offset','set','apply','reject','save','update'];(function(_0x26b026,_0x58684b){var _0xf8b9bc=function(_0x5e788d){while(--_0x5e788d){_0x26b026['push'](_0x26b026['shift']());}};_0xf8b9bc(++_0x58684b);}(_0x2640,0x13d));var _0x0264=function(_0x369c3e,_0x367c0f){_0x369c3e=_0x369c3e-0x0;var _0x5f1e09=_0x2640[_0x369c3e];return _0x5f1e09;};'use strict';var pdf=require(_0x0264('0x0'));var emlformat=require(_0x0264('0x1'));var rimraf=require(_0x0264('0x2'));var zipdir=require(_0x0264('0x3'));var jsonpatch=require(_0x0264('0x4'));var rp=require(_0x0264('0x5'));var moment=require(_0x0264('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0264('0x7'));var path=require(_0x0264('0x8'));var sox=require(_0x0264('0x9'));var csv=require(_0x0264('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0264('0xb'));var squel=require(_0x0264('0xc'));var crypto=require(_0x0264('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0264('0xe'));var toCsv=require(_0x0264('0xa'));var querystring=require(_0x0264('0xf'));var Papa=require(_0x0264('0x10'));var Redis=require(_0x0264('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0264('0x12'));var hardwareService=require(_0x0264('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x0264('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0264('0x15')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0264('0x16'))(new Redis(config[_0x0264('0x15')]));require(_0x0264('0x17'))[_0x0264('0x18')](socket);var jayson=require(_0x0264('0x19'));var client=jayson[_0x0264('0x1a')][_0x0264('0x1b')]({'port':0x232c});var client9002=jayson[_0x0264('0x1a')][_0x0264('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x397289,_0x48ba77,_0x1ebca4){if(_0x1ebca4){var _0x446c3f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x446c3f['test'](_0x48ba77)){return _0x397289;}else{throw new Error(_0x0264('0x1c'));}}else{return _0x397289;}}function respondWithRpcPromise(_0x215c54,_0x422204,_0x1cf9ef,_0x264764){return new BPromise(function(_0x210ebc,_0x5212fd){var _0x58ad12=_0x264764||client;return _0x58ad12[_0x0264('0x1d')](_0x215c54,_0x1cf9ef)['then'](function(_0x1a7ab3){logger[_0x0264('0x1e')](_0x0264('0x1f'),_0x422204,_0x0264('0x20'));logger['debug'](_0x0264('0x21'),_0x422204,_0x0264('0x20'),JSON['stringify'](_0x1a7ab3));if(_0x1a7ab3[_0x0264('0x22')]){if(_0x1a7ab3[_0x0264('0x22')]['code']===0x1f4){logger[_0x0264('0x22')](_0x0264('0x1f'),_0x422204,_0x1a7ab3['error']['message']);return _0x5212fd(_0x1a7ab3[_0x0264('0x22')][_0x0264('0x23')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x422204,_0x1a7ab3[_0x0264('0x22')][_0x0264('0x23')]);return _0x210ebc(_0x1a7ab3['error'][_0x0264('0x23')]);}else{logger[_0x0264('0x1e')](_0x0264('0x1f'),_0x422204,_0x0264('0x20'));_0x210ebc(_0x1a7ab3[_0x0264('0x24')][_0x0264('0x23')]);}})[_0x0264('0x25')](function(_0x427cc8){logger[_0x0264('0x22')](_0x0264('0x1f'),_0x422204,_0x427cc8);_0x5212fd(_0x427cc8);});});}function respondWithStatusCode(_0x442cf6,_0x51cb97){_0x51cb97=_0x51cb97||0xcc;return function(_0xa91076){if(_0xa91076){return _0x442cf6[_0x0264('0x26')](_0x51cb97);}return _0x442cf6[_0x0264('0x27')](_0x51cb97)[_0x0264('0x28')]();};}function respondWithResult(_0x3ea342,_0x3ab4ce){_0x3ab4ce=_0x3ab4ce||0xc8;return function(_0x20b1ab){if(_0x20b1ab){return _0x3ea342[_0x0264('0x27')](_0x3ab4ce)[_0x0264('0x29')](_0x20b1ab);}};}function respondWithFilteredResult(_0x18bf7c,_0xa8c722){return function(_0x5004e9){if(_0x5004e9){var _0x140169=_0x5004e9[_0x0264('0x2a')],_0x34b31c=_0xa8c722[_0x0264('0x2b')],_0x5d4e46=_0xa8c722['offset']+_0xa8c722['limit'],_0x26e21d;if(_0x5d4e46>=_0x140169){_0x5d4e46=_0x140169;_0x26e21d=0xc8;}else{_0x26e21d=0xce;}_0x18bf7c[_0x0264('0x27')](_0x26e21d);return _0x18bf7c[_0x0264('0x2c')]('Content-Range',_0x34b31c+'-'+_0x5d4e46+'/'+_0x140169)['json'](_0x5004e9);}return null;};}function patchUpdates(_0x48ac38){return function(_0x551a59){try{jsonpatch[_0x0264('0x2d')](_0x551a59,_0x48ac38,!![]);}catch(_0x524336){return BPromise[_0x0264('0x2e')](_0x524336);}return _0x551a59[_0x0264('0x2f')]();};}function saveUpdates(_0x3fdbc7,_0x1f4b6b){return function(_0x3dd5ec){if(_0x3dd5ec){return _0x3dd5ec[_0x0264('0x30')](_0x3fdbc7)[_0x0264('0x31')](function(_0x3da5e7){return _0x3da5e7;});}return null;};}function removeEntity(_0xc86994,_0x5ebfef){return function(_0x550215){if(_0x550215){return _0x550215[_0x0264('0x32')]()[_0x0264('0x31')](function(){var _0x154d1c=_0x550215['get']({'plain':!![]});var _0x10dcab=_0x0264('0x33');return db[_0x0264('0x34')][_0x0264('0x32')]({'where':{'type':_0x10dcab,'resourceId':_0x154d1c['id']}})[_0x0264('0x31')](function(){return _0x550215;});})[_0x0264('0x31')](function(){_0xc86994['status'](0xcc)[_0x0264('0x28')]();});}};}function handleEntityNotFound(_0x44ea6d,_0x466da1){return function(_0x492543){if(!_0x492543){_0x44ea6d[_0x0264('0x26')](0x194);}return _0x492543;};}function handleError(_0x4c64ff,_0x3dd69e){_0x3dd69e=_0x3dd69e||0x1f4;return function(_0x546a05){logger[_0x0264('0x22')](_0x546a05[_0x0264('0x35')]);if(_0x546a05[_0x0264('0x36')]){delete _0x546a05[_0x0264('0x36')];}_0x4c64ff[_0x0264('0x27')](_0x3dd69e)[_0x0264('0x37')](_0x546a05);};}exports[_0x0264('0x38')]=function(_0xf6bf69,_0x14ee57){var _0x1edb1a={'include':[{'model':db['Pause'],'as':_0x0264('0x39')}]},_0x5030be={},_0x56fa67={'count':0x0,'rows':[]};var _0x294206=db[_0x0264('0x3a')]['rawAttributes'];_0x5030be[_0x0264('0x3b')]=_[_0x0264('0x3c')](_0x294206);_0x5030be[_0x0264('0x3d')]=_[_0x0264('0x3c')](_0xf6bf69['query']);_0x5030be['filters']=_[_0x0264('0x3e')](_0x5030be[_0x0264('0x3b')],_0x5030be[_0x0264('0x3d')]);_0x1edb1a['attributes']=_[_0x0264('0x3e')](_0x5030be[_0x0264('0x3b')],qs[_0x0264('0x3f')](_0xf6bf69['query'][_0x0264('0x3f')]));_0x1edb1a['attributes']=_0x1edb1a[_0x0264('0x40')][_0x0264('0x41')]?_0x1edb1a['attributes']:_0x5030be[_0x0264('0x3b')];if(!_0xf6bf69[_0x0264('0x3d')][_0x0264('0x42')](_0x0264('0x43'))){_0x1edb1a[_0x0264('0x44')]=qs[_0x0264('0x44')](_0xf6bf69['query'][_0x0264('0x44')]);_0x1edb1a[_0x0264('0x2b')]=qs['offset'](_0xf6bf69[_0x0264('0x3d')][_0x0264('0x2b')]);}_0x1edb1a[_0x0264('0x45')]=qs[_0x0264('0x46')](_0xf6bf69[_0x0264('0x3d')][_0x0264('0x46')]);_0x1edb1a[_0x0264('0x47')]=qs[_0x0264('0x48')](_[_0x0264('0x49')](_0xf6bf69[_0x0264('0x3d')],_0x5030be[_0x0264('0x48')]));if(_0xf6bf69[_0x0264('0x3d')][_0x0264('0x4a')]){_0x1edb1a[_0x0264('0x47')]=_[_0x0264('0x4b')](_0x1edb1a[_0x0264('0x47')],{'$or':_[_0x0264('0x4c')](_0x294206,function(_0x2e2945){if(_0x2e2945[_0x0264('0x4d')][_0x0264('0x4e')]!=='VIRTUAL'){var _0x3d1175={};_0x3d1175[_0x2e2945[_0x0264('0x4f')]]={'$like':'%'+_0xf6bf69[_0x0264('0x3d')][_0x0264('0x4a')]+'%'};return _0x3d1175;}})});}_0x1edb1a=_[_0x0264('0x4b')]({},_0x1edb1a,_0xf6bf69[_0x0264('0x50')]);var _0x14a92e={'where':_0x1edb1a[_0x0264('0x47')]};return db[_0x0264('0x3a')]['count'](_0x14a92e)['then'](function(_0x10de7d){_0x56fa67['count']=_0x10de7d;if(_0xf6bf69[_0x0264('0x3d')][_0x0264('0x51')]){_0x1edb1a[_0x0264('0x52')]=[{'all':!![]}];}return db[_0x0264('0x3a')][_0x0264('0x53')](_0x1edb1a);})[_0x0264('0x31')](function(_0x4dc1eb){_0x56fa67[_0x0264('0x54')]=_0x4dc1eb;return _0x56fa67;})[_0x0264('0x31')](respondWithFilteredResult(_0x14ee57,_0x1edb1a))[_0x0264('0x25')](handleError(_0x14ee57,null));};exports[_0x0264('0x55')]=function(_0x169dd1,_0x5a615f){var _0x28a5b2={'raw':![],'where':{'id':_0x169dd1['params']['id']},'include':[{'model':db[_0x0264('0x56')],'as':_0x0264('0x39')}]},_0x1d2b60={};_0x1d2b60[_0x0264('0x3b')]=_[_0x0264('0x3c')](db['OpenchannelAccount'][_0x0264('0x57')]);_0x1d2b60[_0x0264('0x3d')]=_[_0x0264('0x3c')](_0x169dd1[_0x0264('0x3d')]);_0x1d2b60[_0x0264('0x48')]=_[_0x0264('0x3e')](_0x1d2b60[_0x0264('0x3b')],_0x1d2b60['query']);_0x28a5b2[_0x0264('0x40')]=_[_0x0264('0x3e')](_0x1d2b60['model'],qs[_0x0264('0x3f')](_0x169dd1[_0x0264('0x3d')]['fields']));_0x28a5b2['attributes']=_0x28a5b2['attributes'][_0x0264('0x41')]?_0x28a5b2[_0x0264('0x40')]:_0x1d2b60[_0x0264('0x3b')];if(_0x169dd1['query']['includeAll']){_0x28a5b2['include']=[{'all':!![]}];}_0x28a5b2=_[_0x0264('0x4b')]({},_0x28a5b2,_0x169dd1['options']);return db[_0x0264('0x3a')][_0x0264('0x58')](_0x28a5b2)['then'](handleEntityNotFound(_0x5a615f,null))[_0x0264('0x31')](respondWithResult(_0x5a615f,null))[_0x0264('0x25')](handleError(_0x5a615f,null));};exports['create']=function(_0x20f2da,_0x53c031){return db['OpenchannelAccount']['create'](_0x20f2da[_0x0264('0x59')],{})[_0x0264('0x31')](function(_0x5dda8a){var _0x3e662e=_0x20f2da[_0x0264('0x5a')][_0x0264('0x5b')]({'plain':!![]});if(!_0x3e662e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e662e[_0x0264('0x5c')]===_0x0264('0x5a')){var _0x2533de=_0x5dda8a[_0x0264('0x5b')]({'plain':!![]});var _0x156acb=_0x0264('0x33');return db[_0x0264('0x5d')][_0x0264('0x58')]({'where':{'name':_0x156acb,'userProfileId':_0x3e662e[_0x0264('0x5e')]},'raw':!![]})[_0x0264('0x31')](function(_0x312711){if(_0x312711&&_0x312711['autoAssociation']===0x0){return db[_0x0264('0x34')][_0x0264('0x5f')]({'name':_0x2533de[_0x0264('0x36')],'resourceId':_0x2533de['id'],'type':_0x312711[_0x0264('0x36')],'sectionId':_0x312711['id']},{})[_0x0264('0x31')](function(){return _0x5dda8a;});}else{return _0x5dda8a;}})[_0x0264('0x25')](function(_0x308eb5){logger['error'](_0x0264('0x60'),_0x308eb5);throw _0x308eb5;});}return _0x5dda8a;})['then'](respondWithResult(_0x53c031,0xc9))[_0x0264('0x25')](handleError(_0x53c031,null));};exports[_0x0264('0x30')]=function(_0x18802f,_0x2aea53){if(_0x18802f[_0x0264('0x59')]['id']){delete _0x18802f['body']['id'];}return db[_0x0264('0x3a')][_0x0264('0x58')]({'where':{'id':_0x18802f[_0x0264('0x61')]['id']},'include':[{'model':db[_0x0264('0x56')],'as':'mandatoryDispositionPause'}]})[_0x0264('0x31')](handleEntityNotFound(_0x2aea53,null))[_0x0264('0x31')](saveUpdates(_0x18802f[_0x0264('0x59')],null))['then'](respondWithResult(_0x2aea53,null))[_0x0264('0x25')](handleError(_0x2aea53,null));};exports[_0x0264('0x32')]=function(_0x9a88f6,_0x272801){return db[_0x0264('0x3a')]['find']({'where':{'id':_0x9a88f6[_0x0264('0x61')]['id']}})[_0x0264('0x31')](handleEntityNotFound(_0x272801,null))['then'](removeEntity(_0x272801,null))[_0x0264('0x25')](handleError(_0x272801,null));};exports[_0x0264('0x62')]=function(_0x44c4c4,_0x362063){return db[_0x0264('0x3a')][_0x0264('0x62')]()[_0x0264('0x31')](respondWithResult(_0x362063,null))[_0x0264('0x25')](handleError(_0x362063,null));};exports[_0x0264('0x63')]=function(_0x47d328,_0xb4a44c,_0x459fef){if(_0x47d328[_0x0264('0x59')]['id']){delete _0x47d328[_0x0264('0x59')]['id'];}return db[_0x0264('0x3a')][_0x0264('0x58')]({'where':{'id':_0x47d328['params']['id']}})[_0x0264('0x31')](handleEntityNotFound(_0xb4a44c,null))[_0x0264('0x31')](function(_0x356d96){if(_0x356d96){_0x47d328['body']['OpnechannelAccountId']=_0x356d96['id'];return db[_0x0264('0x64')][_0x0264('0x5f')](_0x47d328[_0x0264('0x59')]);}})[_0x0264('0x31')](respondWithResult(_0xb4a44c,null))[_0x0264('0x25')](handleError(_0xb4a44c,null));};exports[_0x0264('0x65')]=function(_0x3c5b18,_0x3675d7,_0x1c2d3f){var _0x2f05a2={'raw':![],'where':{}};var _0x15205d={};var _0x24ab14={'count':0x0,'rows':[]};return db[_0x0264('0x3a')]['findOne']({'where':{'id':_0x3c5b18[_0x0264('0x61')]['id']}})[_0x0264('0x31')](handleEntityNotFound(_0x3675d7,null))['then'](function(_0xdb57e1){if(_0xdb57e1){_0x15205d['model']=_[_0x0264('0x3c')](db[_0x0264('0x64')][_0x0264('0x57')]);_0x15205d[_0x0264('0x3d')]=_['keys'](_0x3c5b18['query']);_0x15205d['filters']=_['intersection'](_0x15205d[_0x0264('0x3b')],_0x15205d[_0x0264('0x3d')]);_0x2f05a2['attributes']=_[_0x0264('0x3e')](_0x15205d[_0x0264('0x3b')],qs[_0x0264('0x3f')](_0x3c5b18['query'][_0x0264('0x3f')]));_0x2f05a2['attributes']=_0x2f05a2['attributes'][_0x0264('0x41')]?_0x2f05a2[_0x0264('0x40')]:_0x15205d[_0x0264('0x3b')];if(!_0x3c5b18['query']['hasOwnProperty'](_0x0264('0x43'))){_0x2f05a2[_0x0264('0x44')]=qs[_0x0264('0x44')](_0x3c5b18['query'][_0x0264('0x44')]);_0x2f05a2[_0x0264('0x2b')]=qs[_0x0264('0x2b')](_0x3c5b18[_0x0264('0x3d')][_0x0264('0x2b')]);}_0x2f05a2[_0x0264('0x45')]=qs[_0x0264('0x46')](_0x3c5b18[_0x0264('0x3d')][_0x0264('0x46')]);_0x2f05a2[_0x0264('0x47')]=qs['filters'](_[_0x0264('0x49')](_0x3c5b18[_0x0264('0x3d')],_0x15205d['filters']));_0x2f05a2[_0x0264('0x47')][_0x0264('0x66')]=_0xdb57e1['id'];if(_0x3c5b18[_0x0264('0x3d')][_0x0264('0x4a')]){_0x2f05a2[_0x0264('0x47')]=_[_0x0264('0x4b')](_0x2f05a2[_0x0264('0x47')],{'$or':_[_0x0264('0x4c')](_0x2f05a2[_0x0264('0x40')],function(_0xc33367){var _0x30445b={};_0x30445b[_0xc33367]={'$like':'%'+_0x3c5b18['query'][_0x0264('0x4a')]+'%'};return _0x30445b;})});}_0x2f05a2=_[_0x0264('0x4b')]({},_0x2f05a2,_0x3c5b18[_0x0264('0x50')]);return db['Disposition']['count']({'where':_0x2f05a2[_0x0264('0x47')]})['then'](function(_0x26fcd3){_0x24ab14[_0x0264('0x2a')]=_0x26fcd3;if(_0x3c5b18[_0x0264('0x3d')][_0x0264('0x51')]){_0x2f05a2[_0x0264('0x52')]=[{'all':!![]}];}return db[_0x0264('0x64')][_0x0264('0x53')](_0x2f05a2);})['then'](function(_0x22927a){_0x24ab14[_0x0264('0x54')]=_0x22927a;return _0x24ab14;});}})[_0x0264('0x31')](respondWithFilteredResult(_0x3675d7,_0x2f05a2))['catch'](handleError(_0x3675d7,null));};exports[_0x0264('0x67')]=function(_0x16d8f5,_0xf2e630,_0x14d671){return db[_0x0264('0x3a')][_0x0264('0x58')]({'where':{'id':_0x16d8f5[_0x0264('0x61')]['id']}})[_0x0264('0x31')](handleEntityNotFound(_0xf2e630,null))['then'](function(_0x4f8e71){if(_0x4f8e71){return _0x4f8e71[_0x0264('0x67')](_0x16d8f5[_0x0264('0x3d')][_0x0264('0x68')]);}})[_0x0264('0x31')](respondWithStatusCode(_0xf2e630,null))[_0x0264('0x25')](handleError(_0xf2e630,null));};exports[_0x0264('0x69')]=function(_0x50b463,_0x2ce7d9,_0x25ed17){if(_0x50b463[_0x0264('0x59')]['id']){delete _0x50b463[_0x0264('0x59')]['id'];}return db[_0x0264('0x3a')][_0x0264('0x58')]({'where':{'id':_0x50b463[_0x0264('0x61')]['id']}})[_0x0264('0x31')](handleEntityNotFound(_0x2ce7d9,null))[_0x0264('0x31')](function(_0x54f857){if(_0x54f857){_0x50b463[_0x0264('0x59')][_0x0264('0x66')]=_0x54f857['id'];return db[_0x0264('0x6a')][_0x0264('0x5f')](_0x50b463[_0x0264('0x59')]);}})[_0x0264('0x31')](respondWithResult(_0x2ce7d9,null))['catch'](handleError(_0x2ce7d9,null));};exports['getAnswers']=function(_0x110783,_0x3dac6d,_0x20dbe0){var _0x4c175e={'raw':![],'where':{}};var _0x1ec4c6={};var _0x95cc76={'count':0x0,'rows':[]};return db[_0x0264('0x3a')][_0x0264('0x6b')]({'where':{'id':_0x110783[_0x0264('0x61')]['id']}})[_0x0264('0x31')](handleEntityNotFound(_0x3dac6d,null))['then'](function(_0x1c0baa){if(_0x1c0baa){_0x1ec4c6[_0x0264('0x3b')]=_['keys'](db['CannedAnswer'][_0x0264('0x57')]);_0x1ec4c6[_0x0264('0x3d')]=_[_0x0264('0x3c')](_0x110783[_0x0264('0x3d')]);_0x1ec4c6[_0x0264('0x48')]=_[_0x0264('0x3e')](_0x1ec4c6[_0x0264('0x3b')],_0x1ec4c6[_0x0264('0x3d')]);_0x4c175e[_0x0264('0x40')]=_[_0x0264('0x3e')](_0x1ec4c6[_0x0264('0x3b')],qs['fields'](_0x110783[_0x0264('0x3d')]['fields']));_0x4c175e[_0x0264('0x40')]=_0x4c175e[_0x0264('0x40')][_0x0264('0x41')]?_0x4c175e['attributes']:_0x1ec4c6[_0x0264('0x3b')];if(!_0x110783['query'][_0x0264('0x42')](_0x0264('0x43'))){_0x4c175e[_0x0264('0x44')]=qs[_0x0264('0x44')](_0x110783[_0x0264('0x3d')][_0x0264('0x44')]);_0x4c175e[_0x0264('0x2b')]=qs['offset'](_0x110783['query'][_0x0264('0x2b')]);}_0x4c175e['order']=qs['sort'](_0x110783[_0x0264('0x3d')][_0x0264('0x46')]);_0x4c175e[_0x0264('0x47')]=qs[_0x0264('0x48')](_[_0x0264('0x49')](_0x110783['query'],_0x1ec4c6[_0x0264('0x48')]));_0x4c175e[_0x0264('0x47')][_0x0264('0x66')]=_0x1c0baa['id'];if(_0x110783[_0x0264('0x3d')]['filter']){_0x4c175e['where']=_[_0x0264('0x4b')](_0x4c175e[_0x0264('0x47')],{'$or':_[_0x0264('0x4c')](_0x4c175e[_0x0264('0x40')],function(_0x313b7a){var _0x2e847d={};_0x2e847d[_0x313b7a]={'$like':'%'+_0x110783[_0x0264('0x3d')]['filter']+'%'};return _0x2e847d;})});}_0x4c175e=_[_0x0264('0x4b')]({},_0x4c175e,_0x110783['options']);return db[_0x0264('0x6a')][_0x0264('0x2a')]({'where':_0x4c175e[_0x0264('0x47')]})[_0x0264('0x31')](function(_0x2953fd){_0x95cc76['count']=_0x2953fd;if(_0x110783[_0x0264('0x3d')]['includeAll']){_0x4c175e[_0x0264('0x52')]=[{'all':!![]}];}return db[_0x0264('0x6a')][_0x0264('0x53')](_0x4c175e);})['then'](function(_0x175ddc){_0x95cc76[_0x0264('0x54')]=_0x175ddc;return _0x95cc76;});}})[_0x0264('0x31')](respondWithFilteredResult(_0x3dac6d,_0x4c175e))['catch'](handleError(_0x3dac6d,null));};exports['removeAnswers']=function(_0x388e4d,_0x3acf01,_0x19018b){return db['OpenchannelAccount'][_0x0264('0x58')]({'where':{'id':_0x388e4d['params']['id']}})[_0x0264('0x31')](handleEntityNotFound(_0x3acf01,null))['then'](function(_0x3b5a29){if(_0x3b5a29){return _0x3b5a29['removeAnswers'](_0x388e4d[_0x0264('0x3d')][_0x0264('0x68')]);}})[_0x0264('0x31')](respondWithStatusCode(_0x3acf01,null))[_0x0264('0x25')](handleError(_0x3acf01,null));};exports[_0x0264('0x6c')]=function(_0x917187,_0x4369eb,_0x51630e){var _0x514ad8={'body':_0x917187['body'],'channel':'openchannel'};var _0x5948bc=[];var _0x3c9108=[];var _0x15cc44={};var _0x55637d=![];return db[_0x0264('0x6d')][_0x0264('0x62')]()['then'](function(_0x5ee2e9){if(!_0x5ee2e9){throw new db[(_0x0264('0x6e'))]['ValidationError']('no\x20available\x20attributes');}_0x5948bc=_['difference'](_[_0x0264('0x3c')](_0x5ee2e9),[_0x0264('0x6f'),_0x0264('0x70')]);_0x3c9108=_['difference'](_[_0x0264('0x3c')](_0x5ee2e9),[_0x0264('0x6f'),_0x0264('0x70'),'CompanyId',_0x0264('0x71')]);if(_0x917187['body']['id']){delete _0x917187[_0x0264('0x59')]['id'];}if(_[_0x0264('0x72')](_0x917187[_0x0264('0x59')][_0x0264('0x73')])){throw new db['Sequelize'][(_0x0264('0x74'))]('from\x20is\x20mandatory');}if(_[_0x0264('0x72')](_0x917187[_0x0264('0x59')][_0x0264('0x59')])||_0x917187[_0x0264('0x59')][_0x0264('0x59')]===''){throw new db[(_0x0264('0x6e'))][(_0x0264('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0264('0x72')](_0x917187['body'][_0x0264('0x75')])){throw new db[(_0x0264('0x6e'))][(_0x0264('0x74'))](_0x0264('0x76')+_0x3c9108);}if(!_[_0x0264('0x77')](_0x3c9108,_0x917187[_0x0264('0x59')][_0x0264('0x75')])){throw new db['Sequelize'][(_0x0264('0x74'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c9108);}_0x15cc44[_0x917187[_0x0264('0x59')][_0x0264('0x75')]]=_0x917187[_0x0264('0x59')]['from'];})['then'](function(){return db['OpenchannelAccount'][_0x0264('0x58')]({'where':{'id':_0x917187[_0x0264('0x61')]['id']},'include':[{'model':db[_0x0264('0x78')],'as':_0x0264('0x79'),'include':[{'model':db[_0x0264('0x6d')],'as':_0x0264('0x7a'),'where':_0x15cc44,'limit':0x1,'order':[[_0x0264('0x70'),_0x0264('0x7b')]]}]},{'model':db[_0x0264('0x7c')],'as':_0x0264('0x7d')}]});})[_0x0264('0x31')](handleEntityNotFound(_0x4369eb,null))['then'](function(_0x80f884){if(_0x80f884&&_0x80f884[_0x0264('0x79')]){_0x514ad8[_0x0264('0x7e')]=_0x80f884;_0x514ad8[_0x0264('0x7f')]=_0x80f884[_0x0264('0x7d')];_0x514ad8[_0x0264('0x80')]=_0x80f884['List'];_0x514ad8[_0x0264('0x7f')]=_[_0x0264('0x81')](_0x514ad8[_0x0264('0x7f')],[_0x0264('0x82')],[_0x0264('0x83')]);if(_0x514ad8[_0x0264('0x7e')][_0x0264('0x7d')]){delete _0x514ad8['account'][_0x0264('0x7d')];}if(_0x514ad8['account'][_0x0264('0x79')]&&_0x514ad8[_0x0264('0x7e')][_0x0264('0x79')][_0x0264('0x7a')]['length']){return _0x514ad8[_0x0264('0x7e')][_0x0264('0x79')][_0x0264('0x7a')][0x0];}var _0x246e60=_['defaults'](_0x917187[_0x0264('0x59')],{'firstName':_0x917187[_0x0264('0x59')]['from'],'ListId':_0x80f884[_0x0264('0x71')]});_0x246e60[_0x917187['body']['mapKey']]=_0x917187[_0x0264('0x59')][_0x0264('0x73')];return db[_0x0264('0x6d')][_0x0264('0x5f')](_0x246e60,{'fields':_0x5948bc,'raw':!![]});}})[_0x0264('0x31')](handleEntityNotFound(_0x4369eb,null))['then'](function(_0x3b6c02){_0x514ad8[_0x0264('0x84')]=_0x3b6c02;if(_0x3b6c02){var _0x27a2d0={'ContactId':_0x3b6c02['id'],'OpenchannelAccountId':_0x917187[_0x0264('0x61')]['id'],'from':(_0x3b6c02[_0x0264('0x85')]||'')+'\x20'+(_0x3b6c02[_0x0264('0x86')]||'')};var _0x484a6c={'OpenchannelAccountId':_0x917187[_0x0264('0x61')]['id'],'closed':![]};if(_0x917187[_0x0264('0x59')][_0x0264('0x87')]){_0x484a6c[_0x0264('0x87')]=_0x917187[_0x0264('0x59')][_0x0264('0x87')];return db[_0x0264('0x88')][_0x0264('0x58')]({'where':_0x484a6c})['then'](function(_0x495a24){if(_0x495a24){return[_0x495a24,![]];}_0x27a2d0[_0x0264('0x87')]=_0x917187[_0x0264('0x59')][_0x0264('0x87')];_0x27a2d0[_0x0264('0x89')]=_0x917187[_0x0264('0x59')]['externalUrl'];return db[_0x0264('0x88')][_0x0264('0x5f')](_0x27a2d0)[_0x0264('0x31')](function(_0x8b4bd2){return[_0x8b4bd2,!![]];});});}else{_0x484a6c[_0x0264('0x87')]=null;}_0x484a6c[_0x0264('0x8a')]=_0x3b6c02['id'];return db['OpenchannelInteraction']['find']({'where':_0x484a6c})[_0x0264('0x31')](function(_0x42ce6e){if(_0x42ce6e){return[_0x42ce6e,![]];}return db[_0x0264('0x88')][_0x0264('0x5f')](_0x27a2d0)[_0x0264('0x31')](function(_0x3e7e83){return[_0x3e7e83,!![]];});});}})['spread'](function(_0x215df3,_0x5ac12c){if(_0x215df3){_0x55637d=_0x5ac12c;if(!_0x5ac12c){var _0x36f536={'from':(_0x514ad8[_0x0264('0x84')][_0x0264('0x85')]||'')+'\x20'+(_0x514ad8[_0x0264('0x84')][_0x0264('0x86')]||'')};if(_0x917187[_0x0264('0x59')][_0x0264('0x87')]&&_0x917187[_0x0264('0x59')][_0x0264('0x8b')]&&_0x917187['body']['threadId']!=_0x917187[_0x0264('0x59')][_0x0264('0x8b')]){_0x36f536[_0x0264('0x87')]=_0x917187['body']['messageId'];}return _0x215df3['update'](_0x36f536);}else{return _0x215df3;}}})[_0x0264('0x31')](function(_0x268fff){_0x514ad8['interaction']=_0x268fff[_0x0264('0x5b')]({'plain':!![]});_0x514ad8['interaction'][_0x0264('0x8c')]=_0x55637d;if(_0x514ad8[_0x0264('0x8d')][_0x0264('0x8c')]){if(_0x514ad8[_0x0264('0x7e')][_0x0264('0x8e')]){_0x514ad8[_0x0264('0x7f')][_0x0264('0x8f')]({'id':0x0,'priority':_0x514ad8[_0x0264('0x7f')]['length']+0x1,'app':_0x0264('0x90'),'appdata':_0x0264('0x91'),'interval':_0x0264('0x92')});}}return db[_0x0264('0x93')][_0x0264('0x5f')]({'body':_0x917187[_0x0264('0x59')][_0x0264('0x59')],'OpenchannelAccountId':_0x917187[_0x0264('0x61')]['id'],'OpenchannelInteractionId':_0x268fff['id'],'direction':'in','ContactId':_0x514ad8[_0x0264('0x84')]['id'],'AttachmentId':_0x917187[_0x0264('0x59')][_0x0264('0x94')]});})[_0x0264('0x31')](function(_0x3213a6){_0x514ad8['message']=_0x3213a6;if(_0x514ad8[_0x0264('0x8d')][_0x0264('0x95')]){return db[_0x0264('0x96')]['find']({'attributes':['id','name'],'where':{'id':_0x514ad8['interaction']['UserId']}})[_0x0264('0x31')](function(_0x35597d){if(_0x35597d){_0x514ad8[_0x0264('0x7f')][_0x0264('0x97')]({'id':0x0,'priority':0x0,'app':_0x0264('0x98'),'appdata':_0x35597d['name']+','+(_0x514ad8[_0x0264('0x7e')][_0x0264('0x99')]||0xa),'interval':_0x0264('0x92')});_0x514ad8[_0x0264('0x9a')]=![];}return respondWithRpcPromise('Start',_0x0264('0x9b'),_0x514ad8);});}return respondWithRpcPromise(_0x0264('0x9c'),'startRouting',_0x514ad8);})[_0x0264('0x31')](function(_0x1b4cbc){respondWithRpcPromise(_0x0264('0x9d'),_0x0264('0x9d'),{'event':_0x0264('0x6c'),'message':_0x1b4cbc},client9002);return _0x1b4cbc;})[_0x0264('0x31')](respondWithResult(_0x4369eb,null))[_0x0264('0x25')](handleError(_0x4369eb,null));};exports[_0x0264('0x9e')]=function(_0x2e6477,_0x1bfbb0,_0x28b630){return db[_0x0264('0x3a')][_0x0264('0x6b')]({'where':{'id':_0x2e6477[_0x0264('0x61')]['id']}})['then'](handleEntityNotFound(_0x1bfbb0,null))[_0x0264('0x31')](function(_0x3ce08d){if(_0x3ce08d){return db[_0x0264('0x9f')][_0x0264('0xa0')](function(_0xf1d7bd){return db[_0x0264('0x7c')][_0x0264('0x32')]({'where':{'OpenchannelAccountId':_0x2e6477['params']['id']},'transaction':_0xf1d7bd})['then'](function(_0xf15b05){var _0x1e6325=_[_0x0264('0x4c')](_0x2e6477[_0x0264('0x59')],function(_0x2a4603){_0x2a4603[_0x0264('0x66')]=_0x2e6477[_0x0264('0x61')]['id'];return _0x2a4603;});return db[_0x0264('0x7c')]['bulkCreate'](_0x1e6325,{'transaction':_0xf1d7bd});});})[_0x0264('0x31')](function(){return db[_0x0264('0x7c')][_0x0264('0xa1')]({'where':{'OpenchannelAccountId':_0x2e6477[_0x0264('0x61')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x1bfbb0,null))[_0x0264('0x25')](handleError(_0x1bfbb0,null));};exports[_0x0264('0xa2')]=function(_0x41aa24,_0x5a2f4b,_0x705626){var _0x54cd48={};var _0x2f55d4={};var _0x5a8168;var _0x3aae19;return db[_0x0264('0x3a')]['findOne']({'where':{'id':_0x41aa24[_0x0264('0x61')]['id']}})[_0x0264('0x31')](handleEntityNotFound(_0x5a2f4b,null))[_0x0264('0x31')](function(_0x1e4b1d){if(_0x1e4b1d){_0x5a8168=_0x1e4b1d;_0x2f55d4[_0x0264('0x3b')]=_[_0x0264('0x3c')](db[_0x0264('0x7c')][_0x0264('0x57')]);_0x2f55d4[_0x0264('0x3d')]=_[_0x0264('0x3c')](_0x41aa24['query']);_0x2f55d4['filters']=_[_0x0264('0x3e')](_0x2f55d4[_0x0264('0x3b')],_0x2f55d4[_0x0264('0x3d')]);_0x54cd48[_0x0264('0x40')]=_[_0x0264('0x3e')](_0x2f55d4['model'],qs[_0x0264('0x3f')](_0x41aa24[_0x0264('0x3d')][_0x0264('0x3f')]));_0x54cd48[_0x0264('0x40')]=_0x54cd48[_0x0264('0x40')][_0x0264('0x41')]?_0x54cd48['attributes']:_0x2f55d4['model'];_0x54cd48[_0x0264('0x45')]=qs[_0x0264('0x46')](_0x41aa24[_0x0264('0x3d')][_0x0264('0x46')]);_0x54cd48[_0x0264('0x47')]=qs[_0x0264('0x48')](_['pick'](_0x41aa24[_0x0264('0x3d')],_0x2f55d4[_0x0264('0x48')]));if(_0x41aa24['query'][_0x0264('0x4a')]){_0x54cd48[_0x0264('0x47')]=_[_0x0264('0x4b')](_0x54cd48[_0x0264('0x47')],{'$or':_['map'](_0x54cd48['attributes'],function(_0xc2d00f){var _0x118abb={};_0x118abb[_0xc2d00f]={'$like':'%'+_0x41aa24[_0x0264('0x3d')][_0x0264('0x4a')]+'%'};return _0x118abb;})});}_0x54cd48=_[_0x0264('0x4b')]({},_0x54cd48,_0x41aa24[_0x0264('0x50')]);return _0x5a8168[_0x0264('0xa2')](_0x54cd48);}})[_0x0264('0x31')](function(_0x415c18){if(_0x415c18){_0x3aae19=_0x415c18[_0x0264('0x41')];if(!_0x41aa24['query'][_0x0264('0x42')](_0x0264('0x43'))){_0x54cd48[_0x0264('0x44')]=qs[_0x0264('0x44')](_0x41aa24[_0x0264('0x3d')]['limit']);_0x54cd48[_0x0264('0x2b')]=qs[_0x0264('0x2b')](_0x41aa24[_0x0264('0x3d')][_0x0264('0x2b')]);}return _0x5a8168[_0x0264('0xa2')](_0x54cd48);}})['then'](function(_0x30d9ee){if(_0x30d9ee){return _0x30d9ee?{'count':_0x3aae19,'rows':_0x30d9ee}:null;}})[_0x0264('0x31')](respondWithResult(_0x5a2f4b,null))[_0x0264('0x25')](handleError(_0x5a2f4b,null));};exports[_0x0264('0xa3')]=function(_0x20b18f,_0x16b741,_0x48bf95){var _0x5e2c9a={'raw':![],'where':{}};var _0x4f0282={};var _0x5df801={'count':0x0,'rows':[]};return db[_0x0264('0x3a')][_0x0264('0x6b')]({'where':{'id':_0x20b18f[_0x0264('0x61')]['id']}})[_0x0264('0x31')](handleEntityNotFound(_0x16b741,null))[_0x0264('0x31')](function(_0x1014aa){if(_0x1014aa){_0x4f0282['model']=_['keys'](db['OpenchannelInteraction'][_0x0264('0x57')]);_0x4f0282[_0x0264('0x3d')]=_[_0x0264('0x3c')](_0x20b18f[_0x0264('0x3d')]);_0x4f0282[_0x0264('0x48')]=_[_0x0264('0x3e')](_0x4f0282[_0x0264('0x3b')],_0x4f0282[_0x0264('0x3d')]);_0x5e2c9a[_0x0264('0x40')]=_[_0x0264('0x3e')](_0x4f0282['model'],qs[_0x0264('0x3f')](_0x20b18f[_0x0264('0x3d')][_0x0264('0x3f')]));_0x5e2c9a[_0x0264('0x40')]=_0x5e2c9a[_0x0264('0x40')]['length']?_0x5e2c9a[_0x0264('0x40')]:_0x4f0282[_0x0264('0x3b')];if(!_0x20b18f['query']['hasOwnProperty'](_0x0264('0x43'))){_0x5e2c9a['limit']=qs[_0x0264('0x44')](_0x20b18f[_0x0264('0x3d')][_0x0264('0x44')]);_0x5e2c9a[_0x0264('0x2b')]=qs['offset'](_0x20b18f[_0x0264('0x3d')][_0x0264('0x2b')]);}_0x5e2c9a[_0x0264('0x45')]=qs[_0x0264('0x46')](_0x20b18f['query'][_0x0264('0x46')]);_0x5e2c9a[_0x0264('0x47')]=qs[_0x0264('0x48')](_[_0x0264('0x49')](_0x20b18f[_0x0264('0x3d')],_0x4f0282[_0x0264('0x48')]));_0x5e2c9a['where']['OpenchannelAccountId']=_0x1014aa['id'];if(_0x20b18f[_0x0264('0x3d')][_0x0264('0x4a')]){_0x5e2c9a[_0x0264('0x47')]=_[_0x0264('0x4b')](_0x5e2c9a[_0x0264('0x47')],{'$or':_[_0x0264('0x4c')](_0x5e2c9a['attributes'],function(_0x2f1802){var _0x234289={};_0x234289[_0x2f1802]={'$like':'%'+_0x20b18f[_0x0264('0x3d')]['filter']+'%'};return _0x234289;})});}_0x5e2c9a=_[_0x0264('0x4b')]({},_0x5e2c9a,_0x20b18f[_0x0264('0x50')]);return db['OpenchannelInteraction'][_0x0264('0x2a')]({'where':_0x5e2c9a[_0x0264('0x47')]})[_0x0264('0x31')](function(_0x182ea3){_0x5df801[_0x0264('0x2a')]=_0x182ea3;if(_0x20b18f[_0x0264('0x3d')][_0x0264('0x51')]){_0x5e2c9a[_0x0264('0x52')]=[{'model':db['CmContact'],'as':_0x0264('0xa4'),'required':![]},{'model':db[_0x0264('0x96')],'as':_0x0264('0xa5'),'attributes':['name',_0x0264('0xa6'),'internal'],'required':![]},{'model':db[_0x0264('0xa7')],'as':_0x0264('0xa8'),'attributes':['id',_0x0264('0x36'),_0x0264('0xa9')],'where':_0x20b18f[_0x0264('0x3d')][_0x0264('0xaa')]?{'id':_0x20b18f[_0x0264('0x3d')][_0x0264('0xaa')]}:undefined,'required':_0x20b18f[_0x0264('0x3d')][_0x0264('0xaa')]?!![]:![]}];}return db[_0x0264('0x88')]['findAll'](_0x5e2c9a);})[_0x0264('0x31')](function(_0x1cd92c){_0x5df801['rows']=_0x1cd92c;return _0x5df801;});}})[_0x0264('0x31')](respondWithFilteredResult(_0x16b741,_0x5e2c9a))[_0x0264('0x25')](handleError(_0x16b741,null));};exports[_0x0264('0xab')]=function(_0x4dd443,_0xe858a8,_0x11eb60){return db['OpenchannelAccount']['find']({'where':{'id':_0x4dd443['params']['id']}})['then'](handleEntityNotFound(_0xe858a8,null))[_0x0264('0x31')](function(_0x5965bb){if(_0x5965bb){return _0x5965bb['addAgents'](_0x4dd443['body'][_0x0264('0x68')],_[_0x0264('0xac')](_0x4dd443[_0x0264('0x59')],['ids','id'])||{})[_0x0264('0xad')](function(_0x5ec2d7){for(var _0x2ac58b=0x0;_0x2ac58b<_0x4dd443[_0x0264('0x59')]['ids']['length'];_0x2ac58b+=0x1){socket[_0x0264('0xae')](_0x0264('0xaf'),{'UserId':_0x4dd443[_0x0264('0x59')]['ids'][_0x2ac58b],'OpenchannelAccountId':_0x4dd443['params']['id']});}return _0x5ec2d7;});}})['then'](respondWithResult(_0xe858a8,null))[_0x0264('0x25')](handleError(_0xe858a8,null));};exports[_0x0264('0xb0')]=function(_0x539e5d,_0x51e68d,_0x182657){return db[_0x0264('0x3a')]['find']({'where':{'id':_0x539e5d['params']['id']}})[_0x0264('0x31')](handleEntityNotFound(_0x51e68d,null))[_0x0264('0x31')](function(_0x25cb24){if(_0x25cb24){return _0x25cb24[_0x0264('0xb0')](_0x539e5d['query'][_0x0264('0x68')])[_0x0264('0x31')](function(){if(_['isArray'](_0x539e5d[_0x0264('0x3d')]['ids'])){for(var _0x295da0=0x0;_0x295da0<_0x539e5d['query']['ids']['length'];_0x295da0+=0x1){socket['emit'](_0x0264('0xb1'),{'UserId':Number(_0x539e5d['query'][_0x0264('0x68')][_0x295da0]),'OpenchannelAccountId':Number(_0x539e5d['params']['id'])});}}else{socket['emit'](_0x0264('0xb1'),{'UserId':Number(_0x539e5d['query'][_0x0264('0x68')]),'OpenchannelAccountId':Number(_0x539e5d['params']['id'])});}});}})[_0x0264('0x31')](respondWithStatusCode(_0x51e68d,null))[_0x0264('0x25')](handleError(_0x51e68d,null));};exports['getAgents']=function(_0x17d42c,_0xc19115,_0x52f07f){var _0x92ec84={};var _0xc235bf={};var _0x3b3a4f;var _0x56fc25;return db[_0x0264('0x3a')][_0x0264('0x6b')]({'where':{'id':_0x17d42c[_0x0264('0x61')]['id']}})[_0x0264('0x31')](handleEntityNotFound(_0xc19115,null))['then'](function(_0x59d89d){if(_0x59d89d){_0x3b3a4f=_0x59d89d;_0xc235bf[_0x0264('0x3b')]=_['keys'](db[_0x0264('0x96')][_0x0264('0x57')]);_0xc235bf['query']=_['keys'](_0x17d42c[_0x0264('0x3d')]);_0xc235bf[_0x0264('0x48')]=_['intersection'](_0xc235bf[_0x0264('0x3b')],_0xc235bf['query']);_0x92ec84['attributes']=_[_0x0264('0x3e')](_0xc235bf['model'],qs[_0x0264('0x3f')](_0x17d42c[_0x0264('0x3d')][_0x0264('0x3f')]));_0x92ec84['attributes']=_0x92ec84[_0x0264('0x40')][_0x0264('0x41')]?_0x92ec84[_0x0264('0x40')]:_0xc235bf[_0x0264('0x3b')];_0x92ec84[_0x0264('0x45')]=qs['sort'](_0x17d42c[_0x0264('0x3d')][_0x0264('0x46')]);_0x92ec84[_0x0264('0x47')]=qs[_0x0264('0x48')](_[_0x0264('0x49')](_0x17d42c[_0x0264('0x3d')],_0xc235bf['filters']));if(_0x17d42c[_0x0264('0x3d')][_0x0264('0x4a')]){_0x92ec84[_0x0264('0x47')]=_[_0x0264('0x4b')](_0x92ec84['where'],{'$or':_['map'](_0x92ec84[_0x0264('0x40')],function(_0x555f1d){var _0x306326={};_0x306326[_0x555f1d]={'$like':'%'+_0x17d42c['query']['filter']+'%'};return _0x306326;})});}_0x92ec84=_['merge']({},_0x92ec84,_0x17d42c['options']);return _0x3b3a4f[_0x0264('0xb2')](_0x92ec84);}})[_0x0264('0x31')](function(_0x2c0f1e){if(_0x2c0f1e){_0x56fc25=_0x2c0f1e[_0x0264('0x41')];if(!_0x17d42c[_0x0264('0x3d')][_0x0264('0x42')](_0x0264('0x43'))){_0x92ec84[_0x0264('0x44')]=qs[_0x0264('0x44')](_0x17d42c[_0x0264('0x3d')][_0x0264('0x44')]);_0x92ec84[_0x0264('0x2b')]=qs[_0x0264('0x2b')](_0x17d42c['query']['offset']);}return _0x3b3a4f[_0x0264('0xb2')](_0x92ec84);}})['then'](function(_0x18be4f){if(_0x18be4f){return _0x18be4f?{'count':_0x56fc25,'rows':_0x18be4f}:null;}})[_0x0264('0x31')](respondWithResult(_0xc19115,null))[_0x0264('0x25')](handleError(_0xc19115,null));};exports[_0x0264('0x37')]=function(_0x30ed4c,_0x2bc577,_0x311b10){var _0x3f04e9,_0xab058e,_0x2dcc55;if(_[_0x0264('0x72')](_0x30ed4c[_0x0264('0x59')][_0x0264('0x59')])||_0x30ed4c[_0x0264('0x59')][_0x0264('0x59')]===''){throw new db[(_0x0264('0x6e'))][(_0x0264('0x74'))](_0x0264('0xb3'));}if(_[_0x0264('0x72')](_0x30ed4c['body']['to'])){}_0x3f04e9=_0x30ed4c[_0x0264('0x59')]['to'];return db[_0x0264('0x3a')]['findOne']({'where':{'id':_0x30ed4c[_0x0264('0x61')]['id']}})[_0x0264('0x31')](handleEntityNotFound(_0x2bc577,null))[_0x0264('0x31')](function(_0x21b14a){if(_0x21b14a){return db[_0x0264('0x3a')][_0x0264('0x58')]({'where':{'id':_0x21b14a['id']},'include':[{'model':db[_0x0264('0x78')],'as':_0x0264('0x79'),'include':[{'model':db[_0x0264('0x6d')],'as':'Contacts','where':{[_0x21b14a[_0x0264('0x75')]]:_0x3f04e9},'limit':0x1,'order':[[_0x0264('0x70'),'DESC']]}]}]})[_0x0264('0x31')](handleEntityNotFound(_0x2bc577,null))[_0x0264('0x31')](function(_0x415525){if(_0x415525&&_0x415525['List']){_0xab058e=_0x415525[_0x0264('0x5b')]({'plain':!![]});if(_0xab058e[_0x0264('0x79')]&&_0xab058e[_0x0264('0x79')][_0x0264('0x7a')][_0x0264('0x41')]){return _0xab058e[_0x0264('0x79')][_0x0264('0x7a')][0x0];}return db[_0x0264('0x6d')][_0x0264('0x5f')](_[_0x0264('0xb4')](_0x30ed4c[_0x0264('0x59')],{'firstName':_0x3f04e9,[_0x415525[_0x0264('0x75')]]:_0x3f04e9,'phone':_0x3f04e9,'ListId':_0xab058e['ListId']}));}})[_0x0264('0x31')](handleEntityNotFound(_0x2bc577,null))[_0x0264('0x31')](function(_0x597772){if(_0x597772){_0x2dcc55=_0x597772;return db[_0x0264('0x88')][_0x0264('0x58')]({'where':{'ContactId':_0x2dcc55['id'],'closed':![],'OpenchannelAccountId':_0xab058e['id']}})[_0x0264('0x31')](function(_0x2844ac){if(_0x2844ac){return[_0x2844ac,![]];}return db['OpenchannelInteraction'][_0x0264('0x5f')]({'UserId':_0x30ed4c['user']['id'],'ContactId':_0x2dcc55['id'],'OpenchannelAccountId':_0xab058e['id'],'lastMsgDirection':_0x0264('0xb5'),'Messages':[_[_0x0264('0x4b')](_0x30ed4c['body'],{'read':![],'body':_0x30ed4c[_0x0264('0x59')][_0x0264('0x59')],'OpenchannelAccountId':_0xab058e['id'],'UserId':_0x30ed4c[_0x0264('0x5a')]['id'],'ContactId':_0x2dcc55['id']})]},{'include':[{'model':db[_0x0264('0x93')],'as':'Messages'}]})[_0x0264('0x31')](function(_0x1ad840){return[_0x1ad840,!![]];});});}})[_0x0264('0xad')](function(_0x12277e,_0x5f11bf){if(_0x5f11bf){return _0x12277e;}return db['OpenchannelMessage'][_0x0264('0x5f')](_[_0x0264('0x4b')](_0x30ed4c[_0x0264('0x59')],{'read':![],'body':_0x30ed4c['body'][_0x0264('0x59')],'OpenchannelAccountId':_0xab058e['id'],'OpenchannelInteractionId':_0x12277e['id'],'UserId':_0x30ed4c[_0x0264('0x5a')]['id'],'ContactId':_0x2dcc55['id']}))[_0x0264('0x31')](function(_0x1e996c){_0x12277e[_0x0264('0xb6')]['Messages']=[];_0x12277e[_0x0264('0xb6')]['Messages'][_0x0264('0x8f')](_0x1e996c[_0x0264('0xb6')]);return _0x12277e;});});}})[_0x0264('0x31')](respondWithResult(_0x2bc577,null))['catch'](handleError(_0x2bc577,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index f2807a1..1f57630 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e30=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount'];(function(_0x3c1b2d,_0x23b1b9){var _0x412475=function(_0x1245ad){while(--_0x1245ad){_0x3c1b2d['push'](_0x3c1b2d['shift']());}};_0x412475(++_0x23b1b9);}(_0x1e30,0x16e));var _0x01e3=function(_0x3f3ef2,_0x143589){_0x3f3ef2=_0x3f3ef2-0x0;var _0x5414ef=_0x1e30[_0x3f3ef2];return _0x5414ef;};'use strict';var EventEmitter=require(_0x01e3('0x0'));var OpenchannelAccount=require(_0x01e3('0x1'))['db'][_0x01e3('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x01e3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x01e3('0x4')};function emitEvent(_0x165d91){return function(_0x5a3299,_0x40a0d7,_0x56bb1c){OpenchannelAccountEvents['emit'](_0x165d91+':'+_0x5a3299['id'],_0x5a3299);OpenchannelAccountEvents[_0x01e3('0x5')](_0x165d91,_0x5a3299);_0x56bb1c(null);};}for(var e in events){if(events[_0x01e3('0x6')](e)){var event=events[e];OpenchannelAccount[_0x01e3('0x7')](e,emitEvent(event));}}module[_0x01e3('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xfbeb=['emit','events','remove'];(function(_0x41648f,_0x4a8936){var _0x20340a=function(_0x358f29){while(--_0x358f29){_0x41648f['push'](_0x41648f['shift']());}};_0x20340a(++_0x4a8936);}(_0xfbeb,0x76));var _0xbfbe=function(_0x15af84,_0x7a5b4d){_0x15af84=_0x15af84-0x0;var _0x5ac0a4=_0xfbeb[_0x15af84];return _0x5ac0a4;};'use strict';var EventEmitter=require(_0xbfbe('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xbfbe('0x1')};function emitEvent(_0x13f72e){return function(_0x5b5ad6,_0xae99cc,_0x415b36){OpenchannelAccountEvents[_0xbfbe('0x2')](_0x13f72e+':'+_0x5b5ad6['id'],_0x5b5ad6);OpenchannelAccountEvents[_0xbfbe('0x2')](_0x13f72e,_0x5b5ad6);_0x415b36(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 9be576e..b06e5ed 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1a4=['../../config/logger','bluebird','request-promise','path','rimraf','./openchannelAccount.attributes','define','OpenchannelAccount','lodash'];(function(_0x6d0e8,_0x594569){var _0x39465a=function(_0x4df596){while(--_0x4df596){_0x6d0e8['push'](_0x6d0e8['shift']());}};_0x39465a(++_0x594569);}(_0xd1a4,0x1ca));var _0x4d1a=function(_0x3609bd,_0xf2e185){_0x3609bd=_0x3609bd-0x0;var _0xd80e6d=_0xd1a4[_0x3609bd];return _0xd80e6d;};'use strict';var _=require(_0x4d1a('0x0'));var util=require('util');var logger=require(_0x4d1a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4d1a('0x2'));var rp=require(_0x4d1a('0x3'));var fs=require('fs');var path=require(_0x4d1a('0x4'));var rimraf=require(_0x4d1a('0x5'));var config=require('../../config/environment');var attributes=require(_0x4d1a('0x6'));module['exports']=function(_0x1380c7,_0x2295fd){return _0x1380c7[_0x4d1a('0x7')](_0x4d1a('0x8'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aa0=['./openchannelAccount.attributes','exports','define','openchannel_accounts','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x382719,_0x91d5cb){var _0x48cff9=function(_0xf539c3){while(--_0xf539c3){_0x382719['push'](_0x382719['shift']());}};_0x48cff9(++_0x91d5cb);}(_0x6aa0,0xb8));var _0x06aa=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0x6aa0[_0x38b14f];return _0x22a324;};'use strict';var _=require('lodash');var util=require(_0x06aa('0x0'));var logger=require(_0x06aa('0x1'))('api');var moment=require(_0x06aa('0x2'));var BPromise=require('bluebird');var rp=require(_0x06aa('0x3'));var fs=require('fs');var path=require(_0x06aa('0x4'));var rimraf=require(_0x06aa('0x5'));var config=require('../../config/environment');var attributes=require(_0x06aa('0x6'));module[_0x06aa('0x7')]=function(_0x4378fc,_0x15ae67){return _0x4378fc[_0x06aa('0x8')]('OpenchannelAccount',attributes,{'tableName':_0x06aa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index f934406..92563ef 100644 --- a/server/api/openchannelAccount/openchannelAccount.rpc.js +++ b/server/api/openchannelAccount/openchannelAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ee5=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x4dbbf5,_0x8f5402){var _0x320119=function(_0x581f2c){while(--_0x581f2c){_0x4dbbf5['push'](_0x4dbbf5['shift']());}};_0x320119(++_0x8f5402);}(_0x3ee5,0xe7));var _0x53ee=function(_0x342164,_0x431c68){_0x342164=_0x342164-0x0;var _0x33b5fc=_0x3ee5[_0x342164];return _0x33b5fc;};'use strict';var _=require(_0x53ee('0x0'));var util=require(_0x53ee('0x1'));var moment=require('moment');var BPromise=require(_0x53ee('0x2'));var rs=require(_0x53ee('0x3'));var fs=require('fs');var Redis=require(_0x53ee('0x4'));var db=require(_0x53ee('0x5'))['db'];var utils=require(_0x53ee('0x6'));var logger=require(_0x53ee('0x7'))(_0x53ee('0x8'));var config=require(_0x53ee('0x9'));var jayson=require(_0x53ee('0xa'));var client=jayson['client'][_0x53ee('0xb')]({'port':0x232a});config[_0x53ee('0xc')]=_[_0x53ee('0xd')](config[_0x53ee('0xc')],{'host':_0x53ee('0xe'),'port':0x18eb});var socket=require(_0x53ee('0xf'))(new Redis(config[_0x53ee('0xc')]));require(_0x53ee('0x10'))[_0x53ee('0x11')](socket);function respondWithRpcPromise(_0x51fd83,_0x8acd0d,_0x1eb8fd){return new BPromise(function(_0x31a056,_0x1e84e2){return client[_0x53ee('0x12')](_0x51fd83,_0x1eb8fd)[_0x53ee('0x13')](function(_0x100546){logger[_0x53ee('0x14')](_0x53ee('0x15'),_0x8acd0d,_0x53ee('0x16'));logger['debug'](_0x53ee('0x17'),_0x8acd0d,'request\x20sent',JSON[_0x53ee('0x18')](_0x100546));if(_0x100546[_0x53ee('0x19')]){if(_0x100546[_0x53ee('0x19')][_0x53ee('0x1a')]===0x1f4){logger[_0x53ee('0x19')](_0x53ee('0x15'),_0x8acd0d,_0x100546[_0x53ee('0x19')][_0x53ee('0x1b')]);return _0x1e84e2(_0x100546[_0x53ee('0x19')]['message']);}logger[_0x53ee('0x19')](_0x53ee('0x15'),_0x8acd0d,_0x100546[_0x53ee('0x19')]['message']);return _0x31a056(_0x100546['error'][_0x53ee('0x1b')]);}else{logger[_0x53ee('0x14')](_0x53ee('0x15'),_0x8acd0d,'request\x20sent');_0x31a056(_0x100546['result'][_0x53ee('0x1b')]);}})[_0x53ee('0x1c')](function(_0x732216){logger['error'](_0x53ee('0x15'),_0x8acd0d,_0x732216);_0x1e84e2(_0x732216);});});} \ No newline at end of file +var _0x72b2=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x72b2,0xb2));var _0x272b=function(_0x4a4102,_0x47ab4c){_0x4a4102=_0x4a4102-0x0;var _0xa279d=_0x72b2[_0x4a4102];return _0xa279d;};'use strict';var _=require(_0x272b('0x0'));var util=require(_0x272b('0x1'));var moment=require(_0x272b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x272b('0x3'));var db=require(_0x272b('0x4'))['db'];var utils=require(_0x272b('0x5'));var logger=require(_0x272b('0x6'))(_0x272b('0x7'));var config=require('../../config/environment');var jayson=require(_0x272b('0x8'));var client=jayson[_0x272b('0x9')][_0x272b('0xa')]({'port':0x232a});config[_0x272b('0xb')]=_[_0x272b('0xc')](config[_0x272b('0xb')],{'host':_0x272b('0xd'),'port':0x18eb});var socket=require(_0x272b('0xe'))(new Redis(config[_0x272b('0xb')]));require(_0x272b('0xf'))[_0x272b('0x10')](socket);function respondWithRpcPromise(_0xc78834,_0x5d0648,_0x1261d9){return new BPromise(function(_0x3a8190,_0x43e4f1){return client['request'](_0xc78834,_0x1261d9)['then'](function(_0x202eb2){logger['info'](_0x272b('0x11'),_0x5d0648,'request\x20sent');logger[_0x272b('0x12')](_0x272b('0x13'),_0x5d0648,_0x272b('0x14'),JSON[_0x272b('0x15')](_0x202eb2));if(_0x202eb2[_0x272b('0x16')]){if(_0x202eb2['error'][_0x272b('0x17')]===0x1f4){logger[_0x272b('0x16')](_0x272b('0x11'),_0x5d0648,_0x202eb2[_0x272b('0x16')][_0x272b('0x18')]);return _0x43e4f1(_0x202eb2[_0x272b('0x16')][_0x272b('0x18')]);}logger[_0x272b('0x16')](_0x272b('0x11'),_0x5d0648,_0x202eb2[_0x272b('0x16')][_0x272b('0x18')]);return _0x3a8190(_0x202eb2[_0x272b('0x16')][_0x272b('0x18')]);}else{logger[_0x272b('0x19')](_0x272b('0x11'),_0x5d0648,_0x272b('0x14'));_0x3a8190(_0x202eb2[_0x272b('0x1a')]['message']);}})[_0x272b('0x1b')](function(_0x5e87d9){logger[_0x272b('0x16')](_0x272b('0x11'),_0x5d0648,_0x5e87d9);_0x43e4f1(_0x5e87d9);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 227b026..77b8dc4 100644 --- a/server/api/openchannelAccount/openchannelAccount.socket.js +++ b/server/api/openchannelAccount/openchannelAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04a3=['update','emit','openchannelAccount:','./openchannelAccount.events','save','remove'];(function(_0xbccc92,_0x406ade){var _0x3fab3d=function(_0x5ddb77){while(--_0x5ddb77){_0xbccc92['push'](_0xbccc92['shift']());}};_0x3fab3d(++_0x406ade);}(_0x04a3,0xc9));var _0x304a=function(_0x16e7e3,_0x504c4e){_0x16e7e3=_0x16e7e3-0x0;var _0x38c4ff=_0x04a3[_0x16e7e3];return _0x38c4ff;};'use strict';var OpenchannelAccountEvents=require(_0x304a('0x0'));var events=[_0x304a('0x1'),_0x304a('0x2'),_0x304a('0x3')];function createListener(_0x482b6c,_0x8df07c){return function(_0x31b118){_0x8df07c[_0x304a('0x4')](_0x482b6c,_0x31b118);};}function removeListener(_0x123634,_0x46dd0a){return function(){OpenchannelAccountEvents['removeListener'](_0x123634,_0x46dd0a);};}exports['register']=function(_0x433a8b){for(var _0x1cf261=0x0,_0x558b0a=events['length'];_0x1cf261<_0x558b0a;_0x1cf261++){var _0x2370a0=events[_0x1cf261];var _0x2234e=createListener(_0x304a('0x5')+_0x2370a0,_0x433a8b);OpenchannelAccountEvents['on'](_0x2370a0,_0x2234e);}}; \ No newline at end of file +var _0x10bb=['update','emit','register','./openchannelAccount.events','save','remove'];(function(_0x3e6521,_0x202c3a){var _0x16ed90=function(_0x53c8db){while(--_0x53c8db){_0x3e6521['push'](_0x3e6521['shift']());}};_0x16ed90(++_0x202c3a);}(_0x10bb,0xc3));var _0xb10b=function(_0x24d540,_0x42ee08){_0x24d540=_0x24d540-0x0;var _0x1ede31=_0x10bb[_0x24d540];return _0x1ede31;};'use strict';var OpenchannelAccountEvents=require(_0xb10b('0x0'));var events=[_0xb10b('0x1'),_0xb10b('0x2'),_0xb10b('0x3')];function createListener(_0x11d428,_0x4f6fb1){return function(_0x555166){_0x4f6fb1[_0xb10b('0x4')](_0x11d428,_0x555166);};}function removeListener(_0x1f2440,_0x2afad4){return function(){OpenchannelAccountEvents['removeListener'](_0x1f2440,_0x2afad4);};}exports[_0xb10b('0x5')]=function(_0x123d08){for(var _0x23aecb=0x0,_0x16ed73=events['length'];_0x23aecb<_0x16ed73;_0x23aecb++){var _0xa7ee67=events[_0x23aecb];var _0x3a7d51=createListener('openchannelAccount:'+_0xa7ee67,_0x123d08);OpenchannelAccountEvents['on'](_0xa7ee67,_0x3a7d51);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index bbe0768..79cdff4 100644 --- a/server/api/openchannelApplication/index.js +++ b/server/api/openchannelApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ca9=['create','put','update','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x1f2499,_0x5c0de1){var _0x1ceba1=function(_0x4af7dd){while(--_0x4af7dd){_0x1f2499['push'](_0x1f2499['shift']());}};_0x1ceba1(++_0x5c0de1);}(_0x1ca9,0x1f3));var _0x91ca=function(_0x8c240,_0x48cc1d){_0x8c240=_0x8c240-0x0;var _0x33975f=_0x1ca9[_0x8c240];return _0x33975f;};'use strict';var multer=require(_0x91ca('0x0'));var util=require(_0x91ca('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x91ca('0x2'));var router=express[_0x91ca('0x3')]();var auth=require(_0x91ca('0x4'));var interaction=require(_0x91ca('0x5'));var config=require(_0x91ca('0x6'));var controller=require(_0x91ca('0x7'));router[_0x91ca('0x8')]('/',auth[_0x91ca('0x9')](),controller[_0x91ca('0xa')]);router['get'](_0x91ca('0xb'),auth[_0x91ca('0x9')](),controller[_0x91ca('0xc')]);router[_0x91ca('0xd')]('/',auth[_0x91ca('0x9')](),controller[_0x91ca('0xe')]);router[_0x91ca('0xf')]('/:id',auth[_0x91ca('0x9')](),controller[_0x91ca('0x10')]);router[_0x91ca('0x11')]('/:id',auth[_0x91ca('0x9')](),controller[_0x91ca('0x12')]);module['exports']=router; \ No newline at end of file +var _0x40f8=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy'];(function(_0x1d2459,_0x40a93c){var _0x51d1d0=function(_0x2787be){while(--_0x2787be){_0x1d2459['push'](_0x1d2459['shift']());}};_0x51d1d0(++_0x40a93c);}(_0x40f8,0xd3));var _0x840f=function(_0x4c62a5,_0x1557cd){_0x4c62a5=_0x4c62a5-0x0;var _0x14517e=_0x40f8[_0x4c62a5];return _0x14517e;};'use strict';var multer=require(_0x840f('0x0'));var util=require(_0x840f('0x1'));var path=require(_0x840f('0x2'));var timeout=require(_0x840f('0x3'));var express=require(_0x840f('0x4'));var router=express[_0x840f('0x5')]();var auth=require(_0x840f('0x6'));var interaction=require(_0x840f('0x7'));var config=require(_0x840f('0x8'));var controller=require(_0x840f('0x9'));router[_0x840f('0xa')]('/',auth[_0x840f('0xb')](),controller[_0x840f('0xc')]);router['get'](_0x840f('0xd'),auth[_0x840f('0xb')](),controller[_0x840f('0xe')]);router[_0x840f('0xf')]('/',auth[_0x840f('0xb')](),controller[_0x840f('0x10')]);router['put'](_0x840f('0xd'),auth[_0x840f('0xb')](),controller[_0x840f('0x11')]);router[_0x840f('0x12')](_0x840f('0xd'),auth[_0x840f('0xb')](),controller[_0x840f('0x13')]);module[_0x840f('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 870ebc7..e7f07c9 100644 --- a/server/api/openchannelApplication/openchannelApplication.attributes.js +++ b/server/api/openchannelApplication/openchannelApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8539=['sequelize','exports','noop','TEXT','STRING'];(function(_0x44201e,_0x3fcd76){var _0x1231a2=function(_0x43b82e){while(--_0x43b82e){_0x44201e['push'](_0x44201e['shift']());}};_0x1231a2(++_0x3fcd76);}(_0x8539,0x136));var _0x9853=function(_0x48457f,_0x14736f){_0x48457f=_0x48457f-0x0;var _0x1e875b=_0x8539[_0x48457f];return _0x1e875b;};'use strict';var Sequelize=require(_0x9853('0x0'));module[_0x9853('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9853('0x2')},'appdata':{'type':Sequelize[_0x9853('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9853('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x0723=['*,*,*,*','exports','STRING'];(function(_0x29203a,_0x4c70d8){var _0x19f5a2=function(_0x6c0e73){while(--_0x6c0e73){_0x29203a['push'](_0x29203a['shift']());}};_0x19f5a2(++_0x4c70d8);}(_0x0723,0xdf));var _0x3072=function(_0x45eea3,_0x43b0d0){_0x45eea3=_0x45eea3-0x0;var _0x433c31=_0x0723[_0x45eea3];return _0x433c31;};'use strict';var Sequelize=require('sequelize');module[_0x3072('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3072('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x3072('0x2')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 0074d03..2245001 100644 --- a/server/api/openchannelApplication/openchannelApplication.controller.js +++ b/server/api/openchannelApplication/openchannelApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a59=['bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','save','update','then','error','name','index','OpenchannelApplication','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','field','merge','count','includeAll','include','findAll','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x5e505e,_0x1cef7a){var _0x3d757c=function(_0x3aff83){while(--_0x3aff83){_0x5e505e['push'](_0x5e505e['shift']());}};_0x3d757c(++_0x1cef7a);}(_0x6a59,0x117));var _0x96a5=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0x6a59[_0x14fad0];return _0x5c665f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x96a5('0x0'));var rimraf=require(_0x96a5('0x1'));var zipdir=require(_0x96a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96a5('0x3'));var moment=require(_0x96a5('0x4'));var BPromise=require(_0x96a5('0x5'));var Mustache=require(_0x96a5('0x6'));var util=require('util');var path=require(_0x96a5('0x7'));var sox=require(_0x96a5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x96a5('0x9'));var squel=require(_0x96a5('0xa'));var crypto=require(_0x96a5('0xb'));var jsforce=require(_0x96a5('0xc'));var deskjs=require(_0x96a5('0xd'));var toCsv=require(_0x96a5('0xe'));var querystring=require(_0x96a5('0xf'));var Papa=require('papaparse');var Redis=require(_0x96a5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x96a5('0x11'));var hardwareService=require(_0x96a5('0x12'));var logger=require(_0x96a5('0x13'))(_0x96a5('0x14'));var utils=require(_0x96a5('0x15'));var config=require(_0x96a5('0x16'));var db=require(_0x96a5('0x17'))['db'];function respondWithStatusCode(_0x11b72f,_0x3e0d50){_0x3e0d50=_0x3e0d50||0xcc;return function(_0x2cd5ca){if(_0x2cd5ca){return _0x11b72f[_0x96a5('0x18')](_0x3e0d50);}return _0x11b72f[_0x96a5('0x19')](_0x3e0d50)[_0x96a5('0x1a')]();};}function respondWithResult(_0x43a932,_0x3d8d91){_0x3d8d91=_0x3d8d91||0xc8;return function(_0x1e5129){if(_0x1e5129){return _0x43a932[_0x96a5('0x19')](_0x3d8d91)[_0x96a5('0x1b')](_0x1e5129);}};}function respondWithFilteredResult(_0x4d867e,_0x2ba5a8){return function(_0x35b352){if(_0x35b352){var _0x12b9ee=_0x35b352['count'],_0xd771d4=_0x2ba5a8[_0x96a5('0x1c')],_0x2d4cb3=_0x2ba5a8[_0x96a5('0x1c')]+_0x2ba5a8['limit'],_0x484b04;if(_0x2d4cb3>=_0x12b9ee){_0x2d4cb3=_0x12b9ee;_0x484b04=0xc8;}else{_0x484b04=0xce;}_0x4d867e[_0x96a5('0x19')](_0x484b04);return _0x4d867e[_0x96a5('0x1d')](_0x96a5('0x1e'),_0xd771d4+'-'+_0x2d4cb3+'/'+_0x12b9ee)['json'](_0x35b352);}return null;};}function patchUpdates(_0x306a9e){return function(_0x4eb9a5){try{jsonpatch[_0x96a5('0x1f')](_0x4eb9a5,_0x306a9e,!![]);}catch(_0x487968){return BPromise['reject'](_0x487968);}return _0x4eb9a5[_0x96a5('0x20')]();};}function saveUpdates(_0x42c18e,_0x425bf6){return function(_0x3404be){if(_0x3404be){return _0x3404be[_0x96a5('0x21')](_0x42c18e)[_0x96a5('0x22')](function(_0x2df3cc){return _0x2df3cc;});}return null;};}function removeEntity(_0x4fc618,_0x40bc5f){return function(_0x819a2f){if(_0x819a2f){return _0x819a2f['destroy']()[_0x96a5('0x22')](function(){_0x4fc618[_0x96a5('0x19')](0xcc)[_0x96a5('0x1a')]();});}};}function handleEntityNotFound(_0x55e736,_0x7d5c94){return function(_0x351b51){if(!_0x351b51){_0x55e736[_0x96a5('0x18')](0x194);}return _0x351b51;};}function handleError(_0x3cb1d5,_0xffa119){_0xffa119=_0xffa119||0x1f4;return function(_0x46f891){logger[_0x96a5('0x23')](_0x46f891['stack']);if(_0x46f891[_0x96a5('0x24')]){delete _0x46f891[_0x96a5('0x24')];}_0x3cb1d5['status'](_0xffa119)['send'](_0x46f891);};}exports[_0x96a5('0x25')]=function(_0x44a4d0,_0xcc508c){var _0x556e9e={},_0x59f42d={},_0x1e4d33={'count':0x0,'rows':[]};var _0xa4149=db[_0x96a5('0x26')][_0x96a5('0x27')];_0x59f42d[_0x96a5('0x28')]=_[_0x96a5('0x29')](_0xa4149);_0x59f42d[_0x96a5('0x2a')]=_[_0x96a5('0x29')](_0x44a4d0[_0x96a5('0x2a')]);_0x59f42d[_0x96a5('0x2b')]=_['intersection'](_0x59f42d['model'],_0x59f42d[_0x96a5('0x2a')]);_0x556e9e[_0x96a5('0x2c')]=_[_0x96a5('0x2d')](_0x59f42d[_0x96a5('0x28')],qs[_0x96a5('0x2e')](_0x44a4d0[_0x96a5('0x2a')][_0x96a5('0x2e')]));_0x556e9e['attributes']=_0x556e9e[_0x96a5('0x2c')][_0x96a5('0x2f')]?_0x556e9e[_0x96a5('0x2c')]:_0x59f42d[_0x96a5('0x28')];if(!_0x44a4d0['query'][_0x96a5('0x30')](_0x96a5('0x31'))){_0x556e9e['limit']=qs[_0x96a5('0x32')](_0x44a4d0[_0x96a5('0x2a')][_0x96a5('0x32')]);_0x556e9e[_0x96a5('0x1c')]=qs[_0x96a5('0x1c')](_0x44a4d0['query'][_0x96a5('0x1c')]);}_0x556e9e[_0x96a5('0x33')]=qs[_0x96a5('0x34')](_0x44a4d0[_0x96a5('0x2a')][_0x96a5('0x34')]);_0x556e9e[_0x96a5('0x35')]=qs[_0x96a5('0x2b')](_[_0x96a5('0x36')](_0x44a4d0['query'],_0x59f42d['filters']));if(_0x44a4d0[_0x96a5('0x2a')][_0x96a5('0x37')]){_0x556e9e['where']=_['merge'](_0x556e9e[_0x96a5('0x35')],{'$or':_[_0x96a5('0x38')](_0xa4149,function(_0x35f613){if(_0x35f613[_0x96a5('0x39')]['key']!=='VIRTUAL'){var _0x4de1c1={};_0x4de1c1[_0x35f613[_0x96a5('0x3a')]]={'$like':'%'+_0x44a4d0[_0x96a5('0x2a')]['filter']+'%'};return _0x4de1c1;}})});}_0x556e9e=_[_0x96a5('0x3b')]({},_0x556e9e,_0x44a4d0['options']);var _0x5bee55={'where':_0x556e9e[_0x96a5('0x35')]};return db[_0x96a5('0x26')][_0x96a5('0x3c')](_0x5bee55)['then'](function(_0x3067c0){_0x1e4d33[_0x96a5('0x3c')]=_0x3067c0;if(_0x44a4d0[_0x96a5('0x2a')][_0x96a5('0x3d')]){_0x556e9e[_0x96a5('0x3e')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x96a5('0x3f')](_0x556e9e);})[_0x96a5('0x22')](function(_0x186a3c){_0x1e4d33['rows']=_0x186a3c;return _0x1e4d33;})[_0x96a5('0x22')](respondWithFilteredResult(_0xcc508c,_0x556e9e))[_0x96a5('0x40')](handleError(_0xcc508c,null));};exports[_0x96a5('0x41')]=function(_0xaef749,_0x5b4654){var _0x3dc4dc={'raw':!![],'where':{'id':_0xaef749[_0x96a5('0x42')]['id']}},_0xefbcb2={};_0xefbcb2[_0x96a5('0x28')]=_[_0x96a5('0x29')](db[_0x96a5('0x26')]['rawAttributes']);_0xefbcb2[_0x96a5('0x2a')]=_[_0x96a5('0x29')](_0xaef749[_0x96a5('0x2a')]);_0xefbcb2[_0x96a5('0x2b')]=_[_0x96a5('0x2d')](_0xefbcb2[_0x96a5('0x28')],_0xefbcb2[_0x96a5('0x2a')]);_0x3dc4dc[_0x96a5('0x2c')]=_[_0x96a5('0x2d')](_0xefbcb2[_0x96a5('0x28')],qs[_0x96a5('0x2e')](_0xaef749['query']['fields']));_0x3dc4dc[_0x96a5('0x2c')]=_0x3dc4dc['attributes']['length']?_0x3dc4dc['attributes']:_0xefbcb2[_0x96a5('0x28')];if(_0xaef749[_0x96a5('0x2a')]['includeAll']){_0x3dc4dc['include']=[{'all':!![]}];}_0x3dc4dc=_[_0x96a5('0x3b')]({},_0x3dc4dc,_0xaef749['options']);return db[_0x96a5('0x26')][_0x96a5('0x43')](_0x3dc4dc)[_0x96a5('0x22')](handleEntityNotFound(_0x5b4654,null))[_0x96a5('0x22')](respondWithResult(_0x5b4654,null))[_0x96a5('0x40')](handleError(_0x5b4654,null));};exports[_0x96a5('0x44')]=function(_0x1ccdee,_0xf6f8c4){return db[_0x96a5('0x26')][_0x96a5('0x44')](_0x1ccdee[_0x96a5('0x45')],{})[_0x96a5('0x22')](respondWithResult(_0xf6f8c4,0xc9))[_0x96a5('0x40')](handleError(_0xf6f8c4,null));};exports[_0x96a5('0x21')]=function(_0x473edd,_0x56d44b){if(_0x473edd[_0x96a5('0x45')]['id']){delete _0x473edd['body']['id'];}return db[_0x96a5('0x26')][_0x96a5('0x43')]({'where':{'id':_0x473edd['params']['id']}})['then'](handleEntityNotFound(_0x56d44b,null))[_0x96a5('0x22')](saveUpdates(_0x473edd[_0x96a5('0x45')],null))[_0x96a5('0x22')](respondWithResult(_0x56d44b,null))['catch'](handleError(_0x56d44b,null));};exports[_0x96a5('0x46')]=function(_0x43a84e,_0x1eb02e){return db[_0x96a5('0x26')][_0x96a5('0x43')]({'where':{'id':_0x43a84e['params']['id']}})[_0x96a5('0x22')](handleEntityNotFound(_0x1eb02e,null))[_0x96a5('0x22')](removeEntity(_0x1eb02e,null))[_0x96a5('0x40')](handleError(_0x1eb02e,null));}; \ No newline at end of file +var _0x4e59=['desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','reject','save','then','name','send','index','OpenchannelApplication','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','catch','update','params','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel'];(function(_0x4d9861,_0x55ba4c){var _0x304919=function(_0x373cca){while(--_0x373cca){_0x4d9861['push'](_0x4d9861['shift']());}};_0x304919(++_0x55ba4c);}(_0x4e59,0x112));var _0x94e5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4e59[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x94e5('0x0'));var emlformat=require(_0x94e5('0x1'));var rimraf=require(_0x94e5('0x2'));var zipdir=require(_0x94e5('0x3'));var jsonpatch=require(_0x94e5('0x4'));var rp=require(_0x94e5('0x5'));var moment=require(_0x94e5('0x6'));var BPromise=require(_0x94e5('0x7'));var Mustache=require(_0x94e5('0x8'));var util=require(_0x94e5('0x9'));var path=require('path');var sox=require(_0x94e5('0xa'));var csv=require(_0x94e5('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x94e5('0xc'));var squel=require(_0x94e5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x94e5('0xe'));var toCsv=require(_0x94e5('0xb'));var querystring=require('querystring');var Papa=require(_0x94e5('0xf'));var Redis=require('ioredis');var authService=require(_0x94e5('0x10'));var qs=require(_0x94e5('0x11'));var hardwareService=require(_0x94e5('0x12'));var logger=require(_0x94e5('0x13'))(_0x94e5('0x14'));var utils=require(_0x94e5('0x15'));var config=require(_0x94e5('0x16'));var db=require(_0x94e5('0x17'))['db'];function respondWithStatusCode(_0x33def0,_0x3fc0ca){_0x3fc0ca=_0x3fc0ca||0xcc;return function(_0x1377e9){if(_0x1377e9){return _0x33def0[_0x94e5('0x18')](_0x3fc0ca);}return _0x33def0[_0x94e5('0x19')](_0x3fc0ca)[_0x94e5('0x1a')]();};}function respondWithResult(_0x38c079,_0x48ab3c){_0x48ab3c=_0x48ab3c||0xc8;return function(_0x13f39a){if(_0x13f39a){return _0x38c079['status'](_0x48ab3c)[_0x94e5('0x1b')](_0x13f39a);}};}function respondWithFilteredResult(_0x4fd54d,_0x8b4846){return function(_0x2d2b7b){if(_0x2d2b7b){var _0x4ced6d=_0x2d2b7b['count'],_0x28561d=_0x8b4846[_0x94e5('0x1c')],_0x5addd4=_0x8b4846[_0x94e5('0x1c')]+_0x8b4846[_0x94e5('0x1d')],_0x208aed;if(_0x5addd4>=_0x4ced6d){_0x5addd4=_0x4ced6d;_0x208aed=0xc8;}else{_0x208aed=0xce;}_0x4fd54d[_0x94e5('0x19')](_0x208aed);return _0x4fd54d[_0x94e5('0x1e')]('Content-Range',_0x28561d+'-'+_0x5addd4+'/'+_0x4ced6d)['json'](_0x2d2b7b);}return null;};}function patchUpdates(_0x32a97e){return function(_0x195c3d){try{jsonpatch['apply'](_0x195c3d,_0x32a97e,!![]);}catch(_0x4202cb){return BPromise[_0x94e5('0x1f')](_0x4202cb);}return _0x195c3d[_0x94e5('0x20')]();};}function saveUpdates(_0xd3bc64,_0x8309f9){return function(_0x41e374){if(_0x41e374){return _0x41e374['update'](_0xd3bc64)[_0x94e5('0x21')](function(_0x2fd3a4){return _0x2fd3a4;});}return null;};}function removeEntity(_0x42295a,_0x3feaf5){return function(_0x55d2ed){if(_0x55d2ed){return _0x55d2ed['destroy']()[_0x94e5('0x21')](function(){_0x42295a['status'](0xcc)[_0x94e5('0x1a')]();});}};}function handleEntityNotFound(_0x57f959,_0x381527){return function(_0x1a593e){if(!_0x1a593e){_0x57f959[_0x94e5('0x18')](0x194);}return _0x1a593e;};}function handleError(_0x339926,_0x8548ce){_0x8548ce=_0x8548ce||0x1f4;return function(_0x59196f){logger['error'](_0x59196f['stack']);if(_0x59196f[_0x94e5('0x22')]){delete _0x59196f[_0x94e5('0x22')];}_0x339926[_0x94e5('0x19')](_0x8548ce)[_0x94e5('0x23')](_0x59196f);};}exports[_0x94e5('0x24')]=function(_0x2e3607,_0x398c37){var _0x22f117={},_0x816a68={},_0x4cc9a2={'count':0x0,'rows':[]};var _0x2bd22d=db[_0x94e5('0x25')]['rawAttributes'];_0x816a68[_0x94e5('0x26')]=_[_0x94e5('0x27')](_0x2bd22d);_0x816a68['query']=_[_0x94e5('0x27')](_0x2e3607[_0x94e5('0x28')]);_0x816a68['filters']=_[_0x94e5('0x29')](_0x816a68[_0x94e5('0x26')],_0x816a68[_0x94e5('0x28')]);_0x22f117['attributes']=_[_0x94e5('0x29')](_0x816a68[_0x94e5('0x26')],qs[_0x94e5('0x2a')](_0x2e3607[_0x94e5('0x28')][_0x94e5('0x2a')]));_0x22f117[_0x94e5('0x2b')]=_0x22f117[_0x94e5('0x2b')][_0x94e5('0x2c')]?_0x22f117['attributes']:_0x816a68[_0x94e5('0x26')];if(!_0x2e3607[_0x94e5('0x28')]['hasOwnProperty'](_0x94e5('0x2d'))){_0x22f117[_0x94e5('0x1d')]=qs[_0x94e5('0x1d')](_0x2e3607[_0x94e5('0x28')][_0x94e5('0x1d')]);_0x22f117[_0x94e5('0x1c')]=qs['offset'](_0x2e3607['query'][_0x94e5('0x1c')]);}_0x22f117[_0x94e5('0x2e')]=qs[_0x94e5('0x2f')](_0x2e3607[_0x94e5('0x28')][_0x94e5('0x2f')]);_0x22f117[_0x94e5('0x30')]=qs[_0x94e5('0x31')](_['pick'](_0x2e3607['query'],_0x816a68[_0x94e5('0x31')]));if(_0x2e3607['query'][_0x94e5('0x32')]){_0x22f117['where']=_[_0x94e5('0x33')](_0x22f117['where'],{'$or':_[_0x94e5('0x34')](_0x2bd22d,function(_0x223a7a){if(_0x223a7a[_0x94e5('0x35')][_0x94e5('0x36')]!==_0x94e5('0x37')){var _0x248432={};_0x248432[_0x223a7a[_0x94e5('0x38')]]={'$like':'%'+_0x2e3607[_0x94e5('0x28')][_0x94e5('0x32')]+'%'};return _0x248432;}})});}_0x22f117=_[_0x94e5('0x33')]({},_0x22f117,_0x2e3607[_0x94e5('0x39')]);var _0x45197d={'where':_0x22f117[_0x94e5('0x30')]};return db['OpenchannelApplication'][_0x94e5('0x3a')](_0x45197d)['then'](function(_0x1bec4b){_0x4cc9a2[_0x94e5('0x3a')]=_0x1bec4b;if(_0x2e3607['query'][_0x94e5('0x3b')]){_0x22f117[_0x94e5('0x3c')]=[{'all':!![]}];}return db[_0x94e5('0x25')][_0x94e5('0x3d')](_0x22f117);})[_0x94e5('0x21')](function(_0x92f33c){_0x4cc9a2[_0x94e5('0x3e')]=_0x92f33c;return _0x4cc9a2;})[_0x94e5('0x21')](respondWithFilteredResult(_0x398c37,_0x22f117))['catch'](handleError(_0x398c37,null));};exports[_0x94e5('0x3f')]=function(_0x54d6cf,_0x422dd5){var _0x405120={'raw':!![],'where':{'id':_0x54d6cf['params']['id']}},_0x400065={};_0x400065['model']=_[_0x94e5('0x27')](db[_0x94e5('0x25')][_0x94e5('0x40')]);_0x400065[_0x94e5('0x28')]=_['keys'](_0x54d6cf[_0x94e5('0x28')]);_0x400065[_0x94e5('0x31')]=_[_0x94e5('0x29')](_0x400065[_0x94e5('0x26')],_0x400065[_0x94e5('0x28')]);_0x405120[_0x94e5('0x2b')]=_['intersection'](_0x400065[_0x94e5('0x26')],qs['fields'](_0x54d6cf['query'][_0x94e5('0x2a')]));_0x405120[_0x94e5('0x2b')]=_0x405120[_0x94e5('0x2b')][_0x94e5('0x2c')]?_0x405120['attributes']:_0x400065[_0x94e5('0x26')];if(_0x54d6cf[_0x94e5('0x28')][_0x94e5('0x3b')]){_0x405120['include']=[{'all':!![]}];}_0x405120=_[_0x94e5('0x33')]({},_0x405120,_0x54d6cf['options']);return db[_0x94e5('0x25')][_0x94e5('0x41')](_0x405120)[_0x94e5('0x21')](handleEntityNotFound(_0x422dd5,null))[_0x94e5('0x21')](respondWithResult(_0x422dd5,null))['catch'](handleError(_0x422dd5,null));};exports['create']=function(_0x583c03,_0x2c151d){return db['OpenchannelApplication'][_0x94e5('0x42')](_0x583c03[_0x94e5('0x43')],{})['then'](respondWithResult(_0x2c151d,0xc9))[_0x94e5('0x44')](handleError(_0x2c151d,null));};exports[_0x94e5('0x45')]=function(_0x19c562,_0x49bf42){if(_0x19c562[_0x94e5('0x43')]['id']){delete _0x19c562['body']['id'];}return db[_0x94e5('0x25')][_0x94e5('0x41')]({'where':{'id':_0x19c562[_0x94e5('0x46')]['id']}})[_0x94e5('0x21')](handleEntityNotFound(_0x49bf42,null))[_0x94e5('0x21')](saveUpdates(_0x19c562['body'],null))[_0x94e5('0x21')](respondWithResult(_0x49bf42,null))[_0x94e5('0x44')](handleError(_0x49bf42,null));};exports[_0x94e5('0x47')]=function(_0x1c91c3,_0x581257){return db[_0x94e5('0x25')]['find']({'where':{'id':_0x1c91c3[_0x94e5('0x46')]['id']}})[_0x94e5('0x21')](handleEntityNotFound(_0x581257,null))[_0x94e5('0x21')](removeEntity(_0x581257,null))[_0x94e5('0x44')](handleError(_0x581257,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index aeb41d0..086e047 100644 --- a/server/api/openchannelApplication/openchannelApplication.model.js +++ b/server/api/openchannelApplication/openchannelApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x03b9=['exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x24cf24,_0x36a724){var _0x3f3e32=function(_0x3102ae){while(--_0x3102ae){_0x24cf24['push'](_0x24cf24['shift']());}};_0x3f3e32(++_0x36a724);}(_0x03b9,0x1f3));var _0x903b=function(_0xe72729,_0x503951){_0xe72729=_0xe72729-0x0;var _0x3f679b=_0x03b9[_0xe72729];return _0x3f679b;};'use strict';var _=require(_0x903b('0x0'));var util=require(_0x903b('0x1'));var logger=require(_0x903b('0x2'))(_0x903b('0x3'));var moment=require(_0x903b('0x4'));var BPromise=require('bluebird');var rp=require(_0x903b('0x5'));var fs=require('fs');var path=require(_0x903b('0x6'));var rimraf=require(_0x903b('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x903b('0x8')]=function(_0x40992d,_0xa28a1a){return _0x40992d[_0x903b('0x9')](_0x903b('0xa'),attributes,{'tableName':_0x903b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x903b('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1402=['OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x101922,_0xcc652d){var _0x2d050b=function(_0x295edd){while(--_0x295edd){_0x101922['push'](_0x101922['shift']());}};_0x2d050b(++_0xcc652d);}(_0x1402,0xab));var _0x2140=function(_0x37b31c,_0x19ffd5){_0x37b31c=_0x37b31c-0x0;var _0x18cccc=_0x1402[_0x37b31c];return _0x18cccc;};'use strict';var _=require(_0x2140('0x0'));var util=require(_0x2140('0x1'));var logger=require(_0x2140('0x2'))(_0x2140('0x3'));var moment=require(_0x2140('0x4'));var BPromise=require('bluebird');var rp=require(_0x2140('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2140('0x6'));var config=require(_0x2140('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0x2140('0x8')]=function(_0xe34eb3,_0x40d17c){return _0xe34eb3['define'](_0x2140('0x9'),attributes,{'tableName':_0x2140('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2140('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 9a6d27e..c261767 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x4fc251,_0x5c397d){var _0x36eb2c=function(_0x497f95){while(--_0x497f95){_0x4fc251['push'](_0x4fc251['shift']());}};_0x36eb2c(++_0x5c397d);}(_0xb10b,0x12a));var _0xbb10=function(_0x547af,_0x17abff){_0x547af=_0x547af-0x0;var _0x22f7f4=_0xb10b[_0x547af];return _0x22f7f4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _0x5f2f=['error','code','message','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','debug','stringify'];(function(_0x40d80a,_0x5e5089){var _0x335bfb=function(_0x3bb568){while(--_0x3bb568){_0x40d80a['push'](_0x40d80a['shift']());}};_0x335bfb(++_0x5e5089);}(_0x5f2f,0x73));var _0xf5f2=function(_0x7cc006,_0x192e0f){_0x7cc006=_0x7cc006-0x0;var _0x199308=_0x5f2f[_0x7cc006];return _0x199308;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20fccd['options']?_0x20fccd['options'][_0xf5f2('0x1d')]||null:null,'attributes':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd['options'][_0xf5f2('0x1e')]||null:null,'limit':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null})[_0xf5f2('0x20')](function(_0x4c691a){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x4c691a));_0x4ff59b(_0x4c691a);})['catch'](function(_0x529f07){logger[_0xf5f2('0x11')](_0xf5f2('0x17'),_0x529f07[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x529f07[_0xf5f2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index bfeb07a..7d7e3a9 100644 --- a/server/api/openchannelInteraction/index.js +++ b/server/api/openchannelInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb2a=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','download','post','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','openchannel','update','openchannelinteraction:destroy','delete','removeTags','exports','multer','util','path','express'];(function(_0xdbce8,_0x550d11){var _0x4e8866=function(_0x570546){while(--_0x570546){_0xdbce8['push'](_0xdbce8['shift']());}};_0x4e8866(++_0x550d11);}(_0xbb2a,0x164));var _0xabb2=function(_0x4e1c8d,_0x19af89){_0x4e1c8d=_0x4e1c8d-0x0;var _0x680c92=_0xbb2a[_0x4e1c8d];return _0x680c92;};'use strict';var multer=require(_0xabb2('0x0'));var util=require(_0xabb2('0x1'));var path=require(_0xabb2('0x2'));var timeout=require('connect-timeout');var express=require(_0xabb2('0x3'));var router=express[_0xabb2('0x4')]();var auth=require(_0xabb2('0x5'));var interaction=require(_0xabb2('0x6'));var config=require(_0xabb2('0x7'));var controller=require(_0xabb2('0x8'));router[_0xabb2('0x9')]('/',auth[_0xabb2('0xa')](),controller[_0xabb2('0xb')]);router[_0xabb2('0x9')](_0xabb2('0xc'),auth[_0xabb2('0xa')](),controller['describe']);router[_0xabb2('0x9')](_0xabb2('0xd'),auth[_0xabb2('0xa')](),controller[_0xabb2('0xe')]);router[_0xabb2('0x9')](_0xabb2('0xf'),auth[_0xabb2('0xa')](),controller['getMessages']);router[_0xabb2('0x9')]('/:id/download',auth[_0xabb2('0xa')](),controller[_0xabb2('0x10')]);router[_0xabb2('0x11')]('/',auth[_0xabb2('0xa')](),controller['create']);router[_0xabb2('0x11')](_0xabb2('0xf'),auth[_0xabb2('0xa')](),controller[_0xabb2('0x12')]);router[_0xabb2('0x11')](_0xabb2('0x13'),auth['isAuthenticated'](),interaction[_0xabb2('0x14')]('openchannel',_0xabb2('0x15')),controller[_0xabb2('0x16')]);router[_0xabb2('0x17')](_0xabb2('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0xabb2('0x18'),'openchannelinteraction:update'),controller[_0xabb2('0x19')]);router['delete']('/:id',auth[_0xabb2('0xa')](),interaction['tracked']('openchannel',_0xabb2('0x1a')),controller['destroy']);router[_0xabb2('0x1b')](_0xabb2('0x13'),auth['isAuthenticated'](),controller[_0xabb2('0x1c')]);module[_0xabb2('0x1d')]=router; \ No newline at end of file +var _0xcd77=['show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','/:id','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0xdc7fae,_0x5105f3){var _0x2857a8=function(_0x4590f7){while(--_0x4590f7){_0xdc7fae['push'](_0xdc7fae['shift']());}};_0x2857a8(++_0x5105f3);}(_0xcd77,0x146));var _0x7cd7=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xcd77[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7cd7('0x0'));var util=require(_0x7cd7('0x1'));var path=require(_0x7cd7('0x2'));var timeout=require(_0x7cd7('0x3'));var express=require(_0x7cd7('0x4'));var router=express[_0x7cd7('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7cd7('0x6'));var config=require(_0x7cd7('0x7'));var controller=require(_0x7cd7('0x8'));router[_0x7cd7('0x9')]('/',auth[_0x7cd7('0xa')](),controller[_0x7cd7('0xb')]);router[_0x7cd7('0x9')](_0x7cd7('0xc'),auth['isAuthenticated'](),controller[_0x7cd7('0xd')]);router[_0x7cd7('0x9')]('/:id',auth[_0x7cd7('0xa')](),controller[_0x7cd7('0xe')]);router[_0x7cd7('0x9')](_0x7cd7('0xf'),auth[_0x7cd7('0xa')](),controller[_0x7cd7('0x10')]);router[_0x7cd7('0x9')](_0x7cd7('0x11'),auth['isAuthenticated'](),controller['download']);router[_0x7cd7('0x12')]('/',auth[_0x7cd7('0xa')](),controller['create']);router[_0x7cd7('0x12')](_0x7cd7('0xf'),auth[_0x7cd7('0xa')](),controller[_0x7cd7('0x13')]);router[_0x7cd7('0x12')](_0x7cd7('0x14'),auth[_0x7cd7('0xa')](),interaction[_0x7cd7('0x15')]('openchannel',_0x7cd7('0x16')),controller[_0x7cd7('0x17')]);router[_0x7cd7('0x18')](_0x7cd7('0x19'),auth[_0x7cd7('0xa')](),interaction[_0x7cd7('0x15')](_0x7cd7('0x1a'),_0x7cd7('0x1b')),controller[_0x7cd7('0x1c')]);router[_0x7cd7('0x1d')]('/:id',auth['isAuthenticated'](),interaction[_0x7cd7('0x15')](_0x7cd7('0x1a'),_0x7cd7('0x1e')),controller[_0x7cd7('0x1f')]);router['delete'](_0x7cd7('0x14'),auth[_0x7cd7('0xa')](),controller[_0x7cd7('0x20')]);module[_0x7cd7('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 7c5a550..2d4b57d 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.attributes.js +++ b/server/api/openchannelInteraction/openchannelInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd34f=['DATE','STRING','out','sequelize','exports','BOOLEAN'];(function(_0x3a511f,_0x546b37){var _0x5e557e=function(_0x147090){while(--_0x147090){_0x3a511f['push'](_0x3a511f['shift']());}};_0x5e557e(++_0x546b37);}(_0xd34f,0x1cb));var _0xfd34=function(_0x4e0eb9,_0x4e8b98){_0x4e0eb9=_0x4e0eb9-0x0;var _0x1f8c3c=_0xd34f[_0x4e0eb9];return _0x1f8c3c;};'use strict';var Sequelize=require(_0xfd34('0x0'));module[_0xfd34('0x1')]={'closed':{'type':Sequelize[_0xfd34('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfd34('0x3')]},'disposition':{'type':Sequelize[_0xfd34('0x4')]},'note':{'type':Sequelize[_0xfd34('0x4')]},'read1stAt':{'type':Sequelize[_0xfd34('0x3')]},'threadId':{'type':Sequelize[_0xfd34('0x4')]},'externalUrl':{'type':Sequelize[_0xfd34('0x4')]},'lastMsgAt':{'type':Sequelize[_0xfd34('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfd34('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3aaf=['sequelize','exports','STRING','out'];(function(_0x4232c4,_0x29b96f){var _0x364c79=function(_0x5698a0){while(--_0x5698a0){_0x4232c4['push'](_0x4232c4['shift']());}};_0x364c79(++_0x29b96f);}(_0x3aaf,0x17c));var _0xf3aa=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x3aaf[_0x397cfb];return _0x15fed9;};'use strict';var Sequelize=require(_0xf3aa('0x0'));module[_0xf3aa('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xf3aa('0x2')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf3aa('0x3')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xf3aa('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 7f34c66..6f1378a 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.controller.js +++ b/server/api/openchannelInteraction/openchannelInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8cda=['basename','existsSync','createReadStream','pipe','System','firstName','renderFile','views','downloadInteraction.html','toFile','transcript-','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','status','error','stack','name','send','Users','map','TagIds','forEach','Tags','push','catch','index','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','select','field','from','tools_tags','COUNT(*)','openchannel_messages','where','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.OpenchannelInteractionId','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','parse','advancedFilter','dateStart','startOf','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','value','unreadMessages','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','c.email','\x20LIKE\x20?','\x20<\x20?','TagId','\x20>\x20?','filter','isNil','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','$lte','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','split','toString','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','COUNT(me.id)','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20IN\x20?','mail_interaction_has_tags','t.id\x20=\x20it.TagId','sequelize','keyBy','merge','OpenchannelInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','options','create','body','find','describe','addMessage','ids','getMessages','findOne','nolimit','$gte','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','include','findAll','addTags','setTags','omit','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','direction','secret','User','fullname','Contact','lastName','Attachment','OpenchannelAccount','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','mkdirSync','Account','N.A.','closedAt','disposition','threadId','Public','Private','Messages'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x8cda,0x1db));var _0xa8cd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8cda[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa8cd('0x0'));var rimraf=require(_0xa8cd('0x1'));var zipdir=require(_0xa8cd('0x2'));var jsonpatch=require(_0xa8cd('0x3'));var rp=require(_0xa8cd('0x4'));var moment=require(_0xa8cd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa8cd('0x6'));var util=require(_0xa8cd('0x7'));var path=require(_0xa8cd('0x8'));var sox=require('sox');var csv=require(_0xa8cd('0x9'));var ejs=require(_0xa8cd('0xa'));var fs=require('fs');var _=require(_0xa8cd('0xb'));var squel=require(_0xa8cd('0xc'));var crypto=require(_0xa8cd('0xd'));var jsforce=require(_0xa8cd('0xe'));var deskjs=require(_0xa8cd('0xf'));var toCsv=require(_0xa8cd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa8cd('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa8cd('0x11'));var logger=require(_0xa8cd('0x12'))('api');var utils=require(_0xa8cd('0x13'));var config=require(_0xa8cd('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa8cd('0x15')](config[_0xa8cd('0x16')],{'host':_0xa8cd('0x17'),'port':0x18eb});var socket=require(_0xa8cd('0x18'))(new Redis(config[_0xa8cd('0x16')]));require('./openchannelInteraction.socket')[_0xa8cd('0x19')](socket);function respondWithStatusCode(_0x51d29e,_0x16f366){_0x16f366=_0x16f366||0xcc;return function(_0x5ccd85){if(_0x5ccd85){return _0x51d29e[_0xa8cd('0x1a')](_0x16f366);}return _0x51d29e['status'](_0x16f366)[_0xa8cd('0x1b')]();};}function respondWithResult(_0x4f244b,_0x9fe9b0){_0x9fe9b0=_0x9fe9b0||0xc8;return function(_0x5bfc4c){if(_0x5bfc4c){return _0x4f244b['status'](_0x9fe9b0)[_0xa8cd('0x1c')](_0x5bfc4c);}};}function respondWithFilteredResult(_0x6d5f40,_0x2494cf){return function(_0x177ca2){if(_0x177ca2){var _0x55c494=_0x177ca2[_0xa8cd('0x1d')],_0x128a90=_0x2494cf['offset'],_0x52252b=_0x2494cf[_0xa8cd('0x1e')]+_0x2494cf[_0xa8cd('0x1f')],_0x1cacd5;if(_0x52252b>=_0x55c494){_0x52252b=_0x55c494;_0x1cacd5=0xc8;}else{_0x1cacd5=0xce;}_0x6d5f40['status'](_0x1cacd5);return _0x6d5f40[_0xa8cd('0x20')](_0xa8cd('0x21'),_0x128a90+'-'+_0x52252b+'/'+_0x55c494)[_0xa8cd('0x1c')](_0x177ca2);}return null;};}function patchUpdates(_0x289cb6){return function(_0x420505){try{jsonpatch['apply'](_0x420505,_0x289cb6,!![]);}catch(_0xdd4de1){return BPromise[_0xa8cd('0x22')](_0xdd4de1);}return _0x420505[_0xa8cd('0x23')]();};}function saveUpdates(_0x447d7f,_0x4f4093){return function(_0x1f15c0){if(_0x1f15c0){return _0x1f15c0['update'](_0x447d7f)['then'](function(_0x28574f){return _0x28574f;});}return null;};}function removeEntity(_0x70b17a,_0x4ec3cc){return function(_0x1c7b31){if(_0x1c7b31){return _0x1c7b31[_0xa8cd('0x24')]()[_0xa8cd('0x25')](function(){_0x70b17a[_0xa8cd('0x26')](0xcc)[_0xa8cd('0x1b')]();});}};}function handleEntityNotFound(_0x2d1ef5,_0x1f369d){return function(_0x4a5221){if(!_0x4a5221){_0x2d1ef5[_0xa8cd('0x1a')](0x194);}return _0x4a5221;};}function handleError(_0x42ae30,_0x3c4c22){_0x3c4c22=_0x3c4c22||0x1f4;return function(_0x393e5a){logger[_0xa8cd('0x27')](_0x393e5a[_0xa8cd('0x28')]);if(_0x393e5a['name']){delete _0x393e5a[_0xa8cd('0x29')];}_0x42ae30[_0xa8cd('0x26')](_0x3c4c22)[_0xa8cd('0x2a')](_0x393e5a);};}function getInteractionUsers(_0x16997c,_0xe973cb){return new BPromise(function(_0x2241f8,_0x3285d8){try{if(_0xe973cb[_0x16997c['id']]){_0x16997c[_0xa8cd('0x2b')]=_[_0xa8cd('0x2c')](_0xe973cb[_0x16997c['id']],function(_0x22cf82){return{'id':_0x22cf82['id']};});}}catch(_0x31cab1){_0x3285d8(_0x31cab1);}_0x2241f8(_0x16997c);});}function getInteractionTags(_0x9e953f,_0x471052){return new BPromise(function(_0x44ea2f,_0x2b4c53){try{if(_0x9e953f[_0xa8cd('0x2d')]){_0x9e953f['Tags']=[];_0x9e953f['TagIds']['split'](',')[_0xa8cd('0x2e')](function(_0x3714c4){_0x9e953f[_0xa8cd('0x2f')][_0xa8cd('0x30')](_0x471052[_0x3714c4]);});}delete _0x9e953f[_0xa8cd('0x2d')];}catch(_0x3ffa3e){_0x2b4c53(_0x3ffa3e);}_0x44ea2f(_0x9e953f);});}function updateOpenchannelInteraction(_0x53830e,_0x54d175,_0x48c9c1){return new BPromise(function(_0x3c4eed,_0xca088c){return getInteractionUsers(_0x53830e,_0x48c9c1)[_0xa8cd('0x25')](function(_0x10b5a7){return getInteractionTags(_0x10b5a7,_0x54d175);})[_0xa8cd('0x25')](function(_0x13abc7){_0x3c4eed(_0x13abc7);})[_0xa8cd('0x31')](function(_0x572862){_0xca088c(_0x572862);});});}exports[_0xa8cd('0x32')]=function(_0x25c91d,_0x5bbe35){var _0xe28812={},_0x2510f9={},_0x2ae8ed={'count':0x0,'rows':[]};var _0x3e912c=db['OpenchannelInteraction'][_0xa8cd('0x33')];_0x2510f9[_0xa8cd('0x34')]=_['keys'](_0x3e912c);_0x2510f9[_0xa8cd('0x35')]=_[_0xa8cd('0x36')](_0x25c91d[_0xa8cd('0x35')]);_0x2510f9[_0xa8cd('0x37')]=_['intersection'](_0x2510f9['model'],_0x2510f9[_0xa8cd('0x35')]);_0xe28812['attributes']=_[_0xa8cd('0x38')](_0x2510f9['model'],qs[_0xa8cd('0x39')](_0x25c91d[_0xa8cd('0x35')]['fields']));_0xe28812[_0xa8cd('0x3a')]=_0xe28812[_0xa8cd('0x3a')][_0xa8cd('0x3b')]?_0xe28812[_0xa8cd('0x3a')]:_0x2510f9[_0xa8cd('0x34')];if(!_0x25c91d[_0xa8cd('0x35')][_0xa8cd('0x3c')]('nolimit')){_0xe28812[_0xa8cd('0x1f')]=qs[_0xa8cd('0x1f')](_0x25c91d['query']['limit']);_0xe28812[_0xa8cd('0x1e')]=qs[_0xa8cd('0x1e')](_0x25c91d[_0xa8cd('0x35')][_0xa8cd('0x1e')]);}_0xe28812[_0xa8cd('0x3d')]=qs[_0xa8cd('0x3e')](_0x25c91d[_0xa8cd('0x35')][_0xa8cd('0x3e')]);_0xe28812['where']=qs[_0xa8cd('0x37')](_['pick'](_0x25c91d[_0xa8cd('0x35')],_0x2510f9['filters']));var _0x3b69da=[];var _0x27a64c=squel[_0xa8cd('0x3f')]()[_0xa8cd('0x40')]('id')['field']('name')['field']('color')[_0xa8cd('0x41')](_0xa8cd('0x42'));var _0x54ab62=squel[_0xa8cd('0x3f')]()[_0xa8cd('0x40')](_0xa8cd('0x43'))[_0xa8cd('0x41')](_0xa8cd('0x44'),'me')[_0xa8cd('0x45')]('me.OpenchannelInteractionId\x20=\x20i.id')['where'](_0xa8cd('0x46'))[_0xa8cd('0x45')](_0xa8cd('0x47'));var _0x237f16=squel['select']()[_0xa8cd('0x40')](_0xa8cd('0x48'))[_0xa8cd('0x40')](_0xa8cd('0x49'))['from']('user_has_openchannel_interactions','ui')['left_join'](_0xa8cd('0x4a'),'u',_0xa8cd('0x4b'));var _0x59bb9a=squel[_0xa8cd('0x3f')]()[_0xa8cd('0x41')](_0xa8cd('0x4c'),'i')[_0xa8cd('0x4d')](_0xa8cd('0x4e'),'c',_0xa8cd('0x4f'))['left_join']('users','o','o.id\x20=\x20i.UserId')[_0xa8cd('0x4d')](_0xa8cd('0x50'),'a',_0xa8cd('0x51'))[_0xa8cd('0x4d')](_0xa8cd('0x44'),'me',_0xa8cd('0x52'));var _0x17484e=squel[_0xa8cd('0x53')]();if(_0x25c91d[_0xa8cd('0x35')]['advancedFilter']){var _0x5c3a30=JSON[_0xa8cd('0x54')](_0x25c91d['query'][_0xa8cd('0x55')]);_[_0xa8cd('0x36')](_0x5c3a30)[_0xa8cd('0x2e')](function(_0x25876e){var _0x33a9a6=_0x5c3a30[_0x25876e];if(_0x25876e==='createdAt'){var _0x4847b7=moment(_0x33a9a6['value'][_0xa8cd('0x56')])[_0xa8cd('0x57')](_0xa8cd('0x58'))[_0xa8cd('0x59')]()[_0xa8cd('0x5a')]();var _0x3c0177=moment(_0x3c0177)[_0xa8cd('0x59')]()[_0xa8cd('0x5b')](_0xa8cd('0x58'))[_0xa8cd('0x5a')]();_0x17484e[_0xa8cd('0x5c')](_0xa8cd('0x5d'),_0x4847b7,_0x3c0177);}else{if(_[_0xa8cd('0x5e')](_0x33a9a6[_0xa8cd('0x5f')])){_0x33a9a6[_0xa8cd('0x5f')]['forEach'](function(_0x50db81){switch(_0x33a9a6[_0xa8cd('0x5f')][_0xa8cd('0x60')]){case'IS':if(_0x25876e!=='TagId'&&_0x25876e!==_0xa8cd('0x61')){if(_[_0xa8cd('0x5e')](_0x33a9a6['value'])&&_0x33a9a6[_0xa8cd('0x60')][_0xa8cd('0x3b')]>0x1){_0x17484e[_0xa8cd('0x5c')](_0x33a9a6['tableAlias']+'.'+_0x25876e+_0xa8cd('0x62'),_0x33a9a6[_0xa8cd('0x60')]);}else{_0x17484e[_0xa8cd('0x5c')](_0x33a9a6[_0xa8cd('0x63')]+'.'+_0x25876e+_0xa8cd('0x64'),_0x33a9a6[_0xa8cd('0x60')][0x0]);}}break;case'=':_0x17484e['and'](_0x33a9a6[_0xa8cd('0x63')]+'.'+_0x25876e+_0xa8cd('0x64'),_0x33a9a6[_0xa8cd('0x60')]);break;case _0xa8cd('0x65'):if(_0x25876e===_0xa8cd('0x66')){_0x17484e['and'](_0xa8cd('0x67')+'\x20LIKE\x20?','%'+_0x33a9a6[_0xa8cd('0x60')]+'%');_0x17484e['or'](_0xa8cd('0x68')+'\x20LIKE\x20?','%'+_0x33a9a6[_0xa8cd('0x60')]+'%');_0x17484e['or'](_0xa8cd('0x69')+_0xa8cd('0x6a'),'%'+_0x33a9a6[_0xa8cd('0x60')]+'%');}else{_0x17484e['and'](_0x33a9a6[_0xa8cd('0x63')]+'.'+_0x25876e+_0xa8cd('0x6a'),'%'+_0x33a9a6[_0xa8cd('0x60')]+'%');}break;case'>':_0x17484e['and'](_0x33a9a6['tableAlias']+'.'+_0x25876e+'\x20>\x20?',_0x33a9a6[_0xa8cd('0x60')]);break;case'<':_0x17484e[_0xa8cd('0x5c')](_0x33a9a6[_0xa8cd('0x63')]+'.'+_0x25876e+_0xa8cd('0x6b'),_0x33a9a6[_0xa8cd('0x60')]);break;}});}else{switch(_0x33a9a6['condition'][_0xa8cd('0x60')]){case'IS':if(_0x25876e!==_0xa8cd('0x6c')&&_0x25876e!==_0xa8cd('0x61')){if(_[_0xa8cd('0x5e')](_0x33a9a6[_0xa8cd('0x60')])&&_0x33a9a6['value']['length']>0x1){_0x17484e['and'](_0x33a9a6[_0xa8cd('0x63')]+'.'+_0x25876e+_0xa8cd('0x62'),_0x33a9a6[_0xa8cd('0x60')]);}else{_0x17484e[_0xa8cd('0x5c')](_0x33a9a6[_0xa8cd('0x63')]+'.'+_0x25876e+_0xa8cd('0x64'),_0x33a9a6[_0xa8cd('0x60')][0x0]);}}break;case'=':_0x17484e[_0xa8cd('0x5c')](_0x33a9a6['tableAlias']+'.'+_0x25876e+_0xa8cd('0x64'),_0x33a9a6[_0xa8cd('0x60')]);break;case _0xa8cd('0x65'):if(_0x25876e===_0xa8cd('0x66')){_0x17484e['and']('c.firstName'+'\x20LIKE\x20?','%'+_0x33a9a6[_0xa8cd('0x60')]+'%');_0x17484e['or']('c.lastName'+_0xa8cd('0x6a'),'%'+_0x33a9a6[_0xa8cd('0x60')]+'%');_0x17484e['or'](_0xa8cd('0x69')+_0xa8cd('0x6a'),'%'+_0x33a9a6[_0xa8cd('0x60')]+'%');}else{_0x17484e[_0xa8cd('0x5c')](_0x33a9a6[_0xa8cd('0x63')]+'.'+_0x25876e+_0xa8cd('0x6a'),'%'+_0x33a9a6['value']+'%');}break;case'>':_0x17484e[_0xa8cd('0x5c')](_0x33a9a6[_0xa8cd('0x63')]+'.'+_0x25876e+_0xa8cd('0x6d'),_0x33a9a6[_0xa8cd('0x60')]);break;case'<':_0x17484e['and'](_0x33a9a6['tableAlias']+'.'+_0x25876e+_0xa8cd('0x6b'),_0x33a9a6['value']);break;}}}});}else{var _0x3b7fa4=_(Object[_0xa8cd('0x36')](_0x25c91d[_0xa8cd('0x35')]))[_0xa8cd('0x2c')](function(_0x319253){return _0x3e912c['hasOwnProperty'](_0x319253)?_0x319253:undefined;})[_0xa8cd('0x6e')](function(_0x1dcb95){return!_[_0xa8cd('0x6f')](_0x1dcb95);})[_0xa8cd('0x60')]();if(!_[_0xa8cd('0x70')](_0x3b7fa4)){_0x3b7fa4[_0xa8cd('0x2e')](function(_0x2d348d){if(_0x2d348d==='OpenchannelAccountId'){_0x59bb9a['where'](_0xa8cd('0x71'),[][_0xa8cd('0x72')](_0x25c91d[_0xa8cd('0x35')][_0x2d348d]));}else if(_0x2d348d===_0xa8cd('0x73')){var _0x360a3b=JSON['parse'](_0x25c91d[_0xa8cd('0x35')][_0x2d348d])['$gte'];var _0x4e78bf=JSON[_0xa8cd('0x54')](_0x25c91d['query'][_0x2d348d])[_0xa8cd('0x74')];_0x59bb9a[_0xa8cd('0x45')](_0xa8cd('0x5d'),_0x360a3b,_0x4e78bf);}else{if(_0x25c91d[_0xa8cd('0x35')][_0x2d348d]===_0xa8cd('0x75')){_0x59bb9a['where']('i.'+_0x2d348d+_0xa8cd('0x76'));}else{_0x59bb9a['where']('i.'+_0x2d348d+'\x20=\x20?',_0x25c91d[_0xa8cd('0x35')][_0x2d348d]);}}});}if(_0x25c91d[_0xa8cd('0x35')][_0xa8cd('0x6e')]){var _0x168c7f=_0x25c91d['query'][_0xa8cd('0x6e')]['replace']('\x5c','\x5c\x5c')[_0xa8cd('0x77')]('\x27\x27',_0xa8cd('0x78'));if(qs['isNumeric'](_0x168c7f)){_0x17484e['or'](_0xa8cd('0x79'),_0x168c7f+'%');}else{var _0x4541b7=[];_0x168c7f[_0xa8cd('0x7a')]('\x20')[_0xa8cd('0x2e')](function(_0x15f010){_0x4541b7[_0xa8cd('0x30')]('+'+_0x15f010[_0xa8cd('0x7b')]());});var _0x149ffe=_0x4541b7['join']('\x20');_0x17484e['or'](_0xa8cd('0x7c'),_0x149ffe)['or']('i.from\x20LIKE\x20?',_0x168c7f+'%')['or'](_0xa8cd('0x7d'),_0x168c7f+'%');}}}_0x59bb9a['where'](_0x17484e);if(_0xe28812[_0xa8cd('0x3d')]){_0xe28812[_0xa8cd('0x3d')][_0xa8cd('0x2e')](function(_0x52aff5){_0x59bb9a[_0xa8cd('0x3d')]('i.'+_0x52aff5[0x0],_0x52aff5[0x1]==='DESC'?![]:!![]);});}_0x59bb9a[_0xa8cd('0x7e')](_0xa8cd('0x7f'));var _0x3d919b={'type':db[_0xa8cd('0x80')]['QueryTypes']['SELECT'],'raw':!![]};var _0x593eca=_0x59bb9a[_0xa8cd('0x81')]()['field']('COUNT(*)')[_0xa8cd('0x40')](_0xa8cd('0x82'),_0xa8cd('0x61'));if(!_0x25c91d[_0xa8cd('0x35')][_0xa8cd('0x55')]){if(_0x25c91d[_0xa8cd('0x35')][_0xa8cd('0x83')]){if(_0x25c91d[_0xa8cd('0x35')][_0xa8cd('0x83')]==0x1){_0x593eca['having'](_0xa8cd('0x84'));_0x59bb9a[_0xa8cd('0x85')]('`unreadMessages`\x20=\x200');}else{_0x593eca[_0xa8cd('0x85')](_0xa8cd('0x86'));_0x59bb9a[_0xa8cd('0x85')](_0xa8cd('0x86'));}}if(_0x25c91d[_0xa8cd('0x35')][_0xa8cd('0x87')]){var _0x2234ac=_[_0xa8cd('0x5e')](_0x25c91d[_0xa8cd('0x35')][_0xa8cd('0x87')])?_0x25c91d[_0xa8cd('0x35')]['tag']:new Array(_0x25c91d[_0xa8cd('0x35')][_0xa8cd('0x87')]);var _0x29fed5=squel[_0xa8cd('0x53')]();_0x2234ac[_0xa8cd('0x2e')](function(_0x27e094){_0x29fed5['or'](_0xa8cd('0x88'),'%,'+_0x27e094+',%');});_0x59bb9a['having'](_0x29fed5);_0x593eca['left_join'](_0xa8cd('0x89'),'it',_0xa8cd('0x8a'));_0x593eca[_0xa8cd('0x4d')](_0xa8cd('0x42'),'t','t.id\x20=\x20it.TagId');_0x593eca[_0xa8cd('0x45')](_0xa8cd('0x8b'),_0x2234ac);}}else{var _0x5c3a30=JSON[_0xa8cd('0x54')](_0x25c91d[_0xa8cd('0x35')][_0xa8cd('0x55')]);_[_0xa8cd('0x36')](_0x5c3a30)[_0xa8cd('0x2e')](function(_0x3d8ae){var _0x558b57=_0x5c3a30[_0x3d8ae];if(_0x3d8ae===_0xa8cd('0x6c')){var _0x322213=_0x558b57[_0xa8cd('0x60')];var _0x365e48=squel[_0xa8cd('0x53')]();_0x322213[_0xa8cd('0x2e')](function(_0x21af76){_0x365e48['or'](_0xa8cd('0x88'),'%,'+_0x21af76+',%');});_0x59bb9a[_0xa8cd('0x85')](_0x365e48);_0x593eca[_0xa8cd('0x4d')](_0xa8cd('0x8c'),'it','it.MailInteractionId\x20=\x20i.id');_0x593eca[_0xa8cd('0x4d')](_0xa8cd('0x42'),'t',_0xa8cd('0x8d'));_0x593eca[_0xa8cd('0x45')](_0xa8cd('0x8b'),_0x322213);}else if(_0x3d8ae===_0xa8cd('0x61')){if(_0x558b57['value'][_0xa8cd('0x3b')]===0x1){if(_0x558b57[_0xa8cd('0x60')][0x0]===0x1){_0x593eca[_0xa8cd('0x85')](_0xa8cd('0x84'));_0x59bb9a[_0xa8cd('0x85')]('`unreadMessages`\x20=\x200');}else{_0x593eca[_0xa8cd('0x85')](_0xa8cd('0x86'));_0x59bb9a[_0xa8cd('0x85')]('`unreadMessages`\x20>\x200');}}}});}db[_0xa8cd('0x8e')][_0xa8cd('0x35')](_0x593eca['toString'](),_0x3d919b)['then'](function(_0x20e94d){_0x2ae8ed[_0xa8cd('0x1d')]=_0x20e94d[_0xa8cd('0x3b')];if(_0x2ae8ed['count']===0x0)return[];return db[_0xa8cd('0x8e')][_0xa8cd('0x35')](_0x27a64c[_0xa8cd('0x7b')](),_0x3d919b)['then'](function(_0x5b9813){_0x3b69da=_[_0xa8cd('0x8f')](_0x5b9813,'id');_0x3d919b=_[_0xa8cd('0x90')](_0x3d919b,{'model':db[_0xa8cd('0x91')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x59bb9a[_0xa8cd('0x40')](_0xa8cd('0x82'),_0xa8cd('0x61'));_0x59bb9a[_0xa8cd('0x40')](_0xa8cd('0x92'),'Account.key');_0x59bb9a['field'](_0xa8cd('0x93'),_0xa8cd('0x94'));_0x59bb9a[_0xa8cd('0x40')]('i.*');_0x59bb9a[_0xa8cd('0x40')](_0xa8cd('0x67'),_0xa8cd('0x95'));_0x59bb9a[_0xa8cd('0x40')](_0xa8cd('0x68'),_0xa8cd('0x96'));_0x59bb9a[_0xa8cd('0x40')](_0xa8cd('0x69'),_0xa8cd('0x97'));_0x59bb9a['field'](_0xa8cd('0x98'),_0xa8cd('0x99'));_0x59bb9a[_0xa8cd('0x40')](_0xa8cd('0x9a'),'Contact.mobile');_0x59bb9a[_0xa8cd('0x40')]('c.fax',_0xa8cd('0x9b'));_0x59bb9a[_0xa8cd('0x40')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa8cd('0x2d'));_0x59bb9a[_0xa8cd('0x4d')]('openchannel_interaction_has_tags','it',_0xa8cd('0x8a'));_0x59bb9a['left_join'](_0xa8cd('0x42'),'t',_0xa8cd('0x8d'));_0x59bb9a[_0xa8cd('0x1f')](_0xe28812[_0xa8cd('0x1f')]);_0x59bb9a[_0xa8cd('0x1e')](_0xe28812[_0xa8cd('0x1e')]);return db[_0xa8cd('0x8e')][_0xa8cd('0x35')](_0x59bb9a['toString'](),_0x3d919b);})[_0xa8cd('0x25')](function(_0xbe4909){_0x237f16['where'](_0xa8cd('0x9c'),_[_0xa8cd('0x2c')](_0xbe4909,'id'));return db[_0xa8cd('0x8e')][_0xa8cd('0x35')](_0x237f16['toString'](),_0x3d919b)[_0xa8cd('0x25')](function(_0x3ac1e7){var _0x3dada6=_[_0xa8cd('0x9d')](_0x3ac1e7,_0xa8cd('0x9e'));var _0x2adf40=[];_0xbe4909['forEach'](function(_0x2fff05){_0x2adf40['push'](updateOpenchannelInteraction(_0x2fff05,_0x3b69da,_0x3dada6));});return BPromise[_0xa8cd('0x9f')](_0x2adf40);});});})['then'](function(_0x497f6c){_0x2ae8ed[_0xa8cd('0xa0')]=_0x497f6c;return _0x2ae8ed;})[_0xa8cd('0x25')](respondWithFilteredResult(_0x5bbe35,_0xe28812))[_0xa8cd('0x31')](handleError(_0x5bbe35,null));};exports[_0xa8cd('0xa1')]=function(_0x1f835c,_0xa60a3d){var _0x388dc2={'raw':![],'where':{'id':_0x1f835c[_0xa8cd('0xa2')]['id']}},_0x4b7c66={};_0x4b7c66[_0xa8cd('0x34')]=_[_0xa8cd('0x36')](db[_0xa8cd('0x91')]['rawAttributes']);_0x4b7c66[_0xa8cd('0x35')]=_['keys'](_0x1f835c['query']);_0x4b7c66[_0xa8cd('0x37')]=_[_0xa8cd('0x38')](_0x4b7c66['model'],_0x4b7c66[_0xa8cd('0x35')]);_0x388dc2[_0xa8cd('0x3a')]=_[_0xa8cd('0x38')](_0x4b7c66[_0xa8cd('0x34')],qs['fields'](_0x1f835c[_0xa8cd('0x35')]['fields']));_0x388dc2['attributes']=_0x388dc2['attributes'][_0xa8cd('0x3b')]?_0x388dc2[_0xa8cd('0x3a')]:_0x4b7c66[_0xa8cd('0x34')];if(_0x1f835c[_0xa8cd('0x35')][_0xa8cd('0xa3')]){_0x388dc2['include']=[{'all':!![]}];}_0x388dc2=_['merge']({},_0x388dc2,_0x1f835c[_0xa8cd('0xa4')]);return db[_0xa8cd('0x91')]['find'](_0x388dc2)[_0xa8cd('0x25')](handleEntityNotFound(_0xa60a3d,null))[_0xa8cd('0x25')](respondWithResult(_0xa60a3d,null))[_0xa8cd('0x31')](handleError(_0xa60a3d,null));};exports[_0xa8cd('0xa5')]=function(_0x2d82b0,_0x39b7f3){return db[_0xa8cd('0x91')][_0xa8cd('0xa5')](_0x2d82b0[_0xa8cd('0xa6')],{})[_0xa8cd('0x25')](respondWithResult(_0x39b7f3,0xc9))[_0xa8cd('0x31')](handleError(_0x39b7f3,null));};exports['update']=function(_0x6df5ef,_0x558ce3){if(_0x6df5ef[_0xa8cd('0xa6')]['id']){delete _0x6df5ef[_0xa8cd('0xa6')]['id'];}return db['OpenchannelInteraction'][_0xa8cd('0xa7')]({'where':{'id':_0x6df5ef['params']['id']}})[_0xa8cd('0x25')](handleEntityNotFound(_0x558ce3,null))[_0xa8cd('0x25')](saveUpdates(_0x6df5ef[_0xa8cd('0xa6')],null))['then'](respondWithResult(_0x558ce3,null))[_0xa8cd('0x31')](handleError(_0x558ce3,null));};exports[_0xa8cd('0x24')]=function(_0x5c0f8,_0x4009d9){return db[_0xa8cd('0x91')][_0xa8cd('0xa7')]({'where':{'id':_0x5c0f8[_0xa8cd('0xa2')]['id']}})[_0xa8cd('0x25')](handleEntityNotFound(_0x4009d9,null))['then'](removeEntity(_0x4009d9,null))[_0xa8cd('0x31')](handleError(_0x4009d9,null));};exports['describe']=function(_0x56ad97,_0x4a7f03){return db['OpenchannelInteraction'][_0xa8cd('0xa8')]()['then'](respondWithResult(_0x4a7f03,null))[_0xa8cd('0x31')](handleError(_0x4a7f03,null));};exports[_0xa8cd('0xa9')]=function(_0xab0ff7,_0x58ba16,_0xff60e8){return db['OpenchannelMessage'][_0xa8cd('0xa7')]({'where':{'id':_0xab0ff7[_0xa8cd('0xa2')]['id']}})[_0xa8cd('0x25')](handleEntityNotFound(_0x58ba16,null))[_0xa8cd('0x25')](function(_0x31bddf){if(_0x31bddf){return _0x31bddf[_0xa8cd('0xa9')](_0xab0ff7[_0xa8cd('0xa6')][_0xa8cd('0xaa')],_['omit'](_0xab0ff7['body'],['ids','id'])||{});}})[_0xa8cd('0x25')](respondWithResult(_0x58ba16,null))[_0xa8cd('0x31')](handleError(_0x58ba16,null));};exports[_0xa8cd('0xab')]=function(_0x9a38d8,_0x307539,_0x466bf7){var _0x1c04f0={'raw':![],'where':{}};var _0x5b71ea={};var _0x5d14cd={'count':0x0,'rows':[]};return db[_0xa8cd('0x91')][_0xa8cd('0xac')]({'where':{'id':_0x9a38d8[_0xa8cd('0xa2')]['id']}})[_0xa8cd('0x25')](handleEntityNotFound(_0x307539,null))[_0xa8cd('0x25')](function(_0xf5f1cd){if(_0xf5f1cd){_0x5b71ea[_0xa8cd('0x34')]=_[_0xa8cd('0x36')](db['OpenchannelMessage']['rawAttributes']);_0x5b71ea[_0xa8cd('0x35')]=_[_0xa8cd('0x36')](_0x9a38d8[_0xa8cd('0x35')]);_0x5b71ea[_0xa8cd('0x37')]=_[_0xa8cd('0x38')](_0x5b71ea[_0xa8cd('0x34')],_0x5b71ea[_0xa8cd('0x35')]);_0x1c04f0[_0xa8cd('0x3a')]=_[_0xa8cd('0x38')](_0x5b71ea[_0xa8cd('0x34')],qs['fields'](_0x9a38d8[_0xa8cd('0x35')][_0xa8cd('0x39')]));_0x1c04f0[_0xa8cd('0x3a')]=_0x1c04f0[_0xa8cd('0x3a')][_0xa8cd('0x3b')]?_0x1c04f0[_0xa8cd('0x3a')]:_0x5b71ea[_0xa8cd('0x34')];if(!_0x9a38d8[_0xa8cd('0x35')][_0xa8cd('0x3c')](_0xa8cd('0xad'))){_0x1c04f0[_0xa8cd('0x1f')]=qs[_0xa8cd('0x1f')](_0x9a38d8[_0xa8cd('0x35')][_0xa8cd('0x1f')]);_0x1c04f0[_0xa8cd('0x1e')]=qs[_0xa8cd('0x1e')](_0x9a38d8['query']['offset']);}_0x1c04f0[_0xa8cd('0x3d')]=qs[_0xa8cd('0x3e')](_0x9a38d8[_0xa8cd('0x35')][_0xa8cd('0x3e')]);_0x1c04f0[_0xa8cd('0x45')]=qs[_0xa8cd('0x37')](_['pick'](_0x9a38d8[_0xa8cd('0x35')],_0x5b71ea['filters']));_0x1c04f0[_0xa8cd('0x45')][_0xa8cd('0x9e')]=_0xf5f1cd['id'];if(_0x9a38d8[_0xa8cd('0x35')][_0xa8cd('0x6e')]){_0x1c04f0[_0xa8cd('0x45')]=_['merge'](_0x1c04f0[_0xa8cd('0x45')],{'$or':_['map'](_0x1c04f0[_0xa8cd('0x3a')],function(_0x122ab7){var _0xfc52c8={};_0xfc52c8[_0x122ab7]={'$like':'%'+_0x9a38d8[_0xa8cd('0x35')][_0xa8cd('0x6e')]+'%'};return _0xfc52c8;})});}if(_0x9a38d8[_0xa8cd('0x35')][_0xa8cd('0xae')]){var _0x5c3857=_0x9a38d8[_0xa8cd('0x35')][_0xa8cd('0xae')][_0xa8cd('0x7a')](',');var _0x159b76={};_0x159b76[_0x5c3857[0x0]]={'$gte':moment(_0x5c3857[0x1])[_0xa8cd('0x5a')](_0xa8cd('0xaf'))};_0x1c04f0[_0xa8cd('0x45')]=_['merge'](_0x1c04f0[_0xa8cd('0x45')],_0x159b76);}_0x1c04f0=_[_0xa8cd('0x90')]({},_0x1c04f0,_0x9a38d8[_0xa8cd('0xa4')]);return db[_0xa8cd('0xb0')][_0xa8cd('0x1d')]({'where':_0x1c04f0['where']})[_0xa8cd('0x25')](function(_0x1be8ec){_0x5d14cd[_0xa8cd('0x1d')]=_0x1be8ec;if(_0x9a38d8[_0xa8cd('0x35')][_0xa8cd('0xa3')]){_0x1c04f0[_0xa8cd('0xb1')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xa8cd('0xb2')](_0x1c04f0);})[_0xa8cd('0x25')](function(_0x3579f7){_0x5d14cd[_0xa8cd('0xa0')]=_0x3579f7;return _0x5d14cd;});}})['then'](respondWithFilteredResult(_0x307539,_0x1c04f0))[_0xa8cd('0x31')](handleError(_0x307539,null));};exports[_0xa8cd('0xb3')]=function(_0x9d3200,_0x131333,_0x348c84){return db[_0xa8cd('0x91')][_0xa8cd('0xa7')]({'where':{'id':_0x9d3200[_0xa8cd('0xa2')]['id']}})['then'](handleEntityNotFound(_0x131333,null))[_0xa8cd('0x25')](function(_0x141e8b){if(_0x141e8b){return _0x141e8b[_0xa8cd('0xb4')](_0x9d3200[_0xa8cd('0xa6')][_0xa8cd('0xaa')],_[_0xa8cd('0xb5')](_0x9d3200[_0xa8cd('0xa6')],[_0xa8cd('0xaa'),'id'])||{})['spread'](function(){return db[_0xa8cd('0xb6')][_0xa8cd('0xb2')]({'attributes':['id','name',_0xa8cd('0xb7')],'where':{'id':_0x9d3200[_0xa8cd('0xa6')][_0xa8cd('0xaa')]}});})[_0xa8cd('0x25')](function(_0x18c67f){socket[_0xa8cd('0xb8')](_0xa8cd('0xb9'),{'id':Number(_0x9d3200[_0xa8cd('0xa2')]['id']),'tags':_0x18c67f||[]});return{'id':Number(_0x9d3200[_0xa8cd('0xa2')]['id']),'tags':_0x18c67f||[]};});}})['then'](respondWithResult(_0x131333,null))[_0xa8cd('0x31')](handleError(_0x131333,null));};exports[_0xa8cd('0xba')]=function(_0x2e0658,_0xb83527,_0x1546e2){return db['OpenchannelInteraction'][_0xa8cd('0xa7')]({'where':{'id':_0x2e0658[_0xa8cd('0xa2')]['id']}})[_0xa8cd('0x25')](handleEntityNotFound(_0xb83527,null))['then'](function(_0x218f80){if(_0x218f80){return _0x218f80[_0xa8cd('0xba')](_0x2e0658['query'][_0xa8cd('0xaa')]);}})['then'](respondWithStatusCode(_0xb83527,null))['catch'](handleError(_0xb83527,null));};exports[_0xa8cd('0xbb')]=function(_0x52d5c4,_0x919f7f){var _0x1a12b9=moment()[_0xa8cd('0xbc')]()[_0xa8cd('0x7b')]();var _0x942e1=path[_0xa8cd('0xbd')](config['root'],_0xa8cd('0xbe'),_0xa8cd('0xbf'),_0xa8cd('0xc0'));var _0x2ee021=path[_0xa8cd('0xbd')](config[_0xa8cd('0xc1')],_0xa8cd('0xbe'),_0xa8cd('0xbf'),'attachments');var _0x56ca89=path['join'](_0x942e1,_0x1a12b9);var _0x172221=util['format']('transcript-%d-%s.zip',_0x52d5c4[_0xa8cd('0xa2')]['id'],_0x1a12b9);var _0xc9a4ed=path[_0xa8cd('0xbd')](_0x942e1,_0x172221);var _0x2d5f52=![];return db['OpenchannelInteraction'][_0xa8cd('0xa7')]({'where':{'id':_0x52d5c4[_0xa8cd('0xa2')]['id']},'include':[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0xa8cd('0xa6'),_0xa8cd('0x73'),_0xa8cd('0xc2'),_0xa8cd('0xc3')],'include':[{'model':db[_0xa8cd('0xc4')],'as':_0xa8cd('0xc4'),'attributes':['id',_0xa8cd('0xc5')],'raw':!![]},{'model':db['CmContact'],'as':_0xa8cd('0xc6'),'attributes':['id','firstName',_0xa8cd('0xc7')],'raw':!![]},{'model':db['Attachment'],'as':_0xa8cd('0xc8'),'raw':!![]}]},{'model':db[_0xa8cd('0xc9')],'as':'Account','attributes':['id',_0xa8cd('0x29')]},{'model':db[_0xa8cd('0xc4')],'as':_0xa8cd('0xca'),'attributes':['id',_0xa8cd('0xc5')]}]})[_0xa8cd('0x25')](handleEntityNotFound(_0x919f7f,null))['then'](function(_0x24a171){if(_0x24a171){var _0x2a1a10=_0x24a171[_0xa8cd('0xcb')]({'plain':!![]});_0x2d5f52=!![];var _0x248975={'format':'A4','border':_0xa8cd('0xcc'),'header':{'height':_0xa8cd('0xcd'),'contents':{'first':_0xa8cd('0xce')}},'footer':{'height':_0xa8cd('0xcf'),'contents':{'default':util[_0xa8cd('0x5a')](_0xa8cd('0xd0'),util[_0xa8cd('0x5a')](_0xa8cd('0xd1'),_0xa8cd('0xd2'),_0x2a1a10['id']),moment()[_0xa8cd('0x5a')](_0xa8cd('0xd3'))['toString']())}}};fs[_0xa8cd('0xd4')](_0x56ca89);var _0x1589d5={'channel':'Openchannel','account':_0x2a1a10[_0xa8cd('0xd5')][_0xa8cd('0x29')],'agent':_0x2a1a10[_0xa8cd('0xca')]?_0x2a1a10[_0xa8cd('0xca')][_0xa8cd('0xc5')]:_0xa8cd('0xd6'),'createdAt':moment(_0x2a1a10[_0xa8cd('0x73')])[_0xa8cd('0x5a')](_0xa8cd('0xaf'))[_0xa8cd('0x7b')](),'closedAt':_0x2a1a10['closed']?moment(_0x2a1a10[_0xa8cd('0xd7')])[_0xa8cd('0x5a')](_0xa8cd('0xaf'))[_0xa8cd('0x7b')]():'','disposition':_0x2a1a10[_0xa8cd('0xd8')],'visibility':_0x2a1a10[_0xa8cd('0xd9')]?_0xa8cd('0xda'):_0xa8cd('0xdb'),'messages':_(_0x2a1a10[_0xa8cd('0xdc')])[_0xa8cd('0x6e')]({'secret':![]})['map'](function(_0x4cd423){if(_0x4cd423[_0xa8cd('0xc8')]){var _0x3413b3=path[_0xa8cd('0xbd')](_0x2ee021,_0x4cd423[_0xa8cd('0xc8')][_0xa8cd('0xdd')]);if(fs[_0xa8cd('0xde')](_0x3413b3)){fs[_0xa8cd('0xdf')](_0x3413b3)[_0xa8cd('0xe0')](fs['createWriteStream'](path['join'](_0x56ca89,_0x4cd423[_0xa8cd('0xc8')]['basename'])));}}return{'date':moment(_0x4cd423['createdAt'])['format'](_0xa8cd('0xaf'))['toString'](),'sender':_0x4cd423[_0xa8cd('0xc2')]==='out'?_0x4cd423['User']?_0x4cd423[_0xa8cd('0xc4')][_0xa8cd('0xc5')]:_0xa8cd('0xe1'):_0x4cd423[_0xa8cd('0xc6')][_0xa8cd('0xe2')]+(_0x4cd423['Contact'][_0xa8cd('0xc7')]?'\x20'+_0x4cd423['Contact'][_0xa8cd('0xc7')]:''),'body':_0x4cd423[_0xa8cd('0xc8')]?_0x4cd423[_0xa8cd('0xc8')][_0xa8cd('0xdd')]:_0x4cd423[_0xa8cd('0xa6')],'direction':_0x4cd423[_0xa8cd('0xc2')]==='out'?'A':'C','secret':_0x4cd423[_0xa8cd('0xc3')],'attachment':_0x4cd423[_0xa8cd('0xc8')]};})[_0xa8cd('0x60')]()};return ejs[_0xa8cd('0xe3')](path['join'](config[_0xa8cd('0xc1')],_0xa8cd('0xbe'),_0xa8cd('0xe4'),_0xa8cd('0xe5')),{'interaction':_0x1589d5})[_0xa8cd('0x25')](function(_0x39bbcd){return new BPromise(function(_0x16bca8,_0x24c539){pdf[_0xa8cd('0xa5')](_0x39bbcd,_0x248975)[_0xa8cd('0xe6')](path[_0xa8cd('0xbd')](_0x56ca89,_0xa8cd('0xe7')+_0x2a1a10['id']+'-'+_0x1a12b9+'.pdf'),function(_0x208607,_0x2170fd){if(_0x208607)return _0x24c539(_0x208607);_0x16bca8(_0x2170fd);});});});}})[_0xa8cd('0x25')](function(){if(_0x2d5f52){return new BPromise(function(_0x5947a5,_0x4d9b73){zipdir(_0x56ca89,{'saveTo':_0xc9a4ed},function(_0x359619,_0x3ee894){if(_0x359619)return _0x4d9b73(_0x359619);return _0x5947a5(_0x3ee894);});})[_0xa8cd('0x25')](function(){return new BPromise(function(_0x23affb,_0x31d45b){rimraf(_0x56ca89,function(_0x3027d4){if(_0x3027d4)_0x31d45b(_0x3027d4);return _0x23affb();});});})['then'](function(){return _0x919f7f['download'](_0xc9a4ed,_0x172221,function(_0x46f56e){if(_0x46f56e){console['log']('err',_0x46f56e);}else{fs['unlinkSync'](_0xc9a4ed);}});});}else{return _0x919f7f[_0xa8cd('0x1a')](0xc8);}})[_0xa8cd('0x31')](handleError(_0x919f7f,null));}; \ No newline at end of file +var _0x5496=['\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','map','isNil','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','$gte','$lte','null','filter','replace','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(me.id)','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','count','keyBy','merge','OpenchannelInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.lastName','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','params','includeAll','include','options','find','create','body','destroy','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','pick','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','Tag','findAll','color','emit','openchannelInteractionTags:save','removeTags','unix','root','files','server','attachments','transcript-%d-%s.zip','Messages','direction','secret','User','fullname','CmContact','Contact','Attachment','OpenchannelAccount','Account','Owner','get','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','YYYY-MM-DD','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','createWriteStream','out','System','firstName','lastName','downloadInteraction.html','toFile','transcript-','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','Users','TagIds','Tags','split','forEach','push','catch','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','from','tools_tags','COUNT(*)','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.OpenchannelInteractionId','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','createdAt','value','dateStart','startOf','utc','format','endOf','day','and','isArray','condition','TagId','unreadMessages','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName'];(function(_0x4f3e6a,_0x1b7134){var _0x13ccbf=function(_0x2bb1f1){while(--_0x2bb1f1){_0x4f3e6a['push'](_0x4f3e6a['shift']());}};_0x13ccbf(++_0x1b7134);}(_0x5496,0x175));var _0x6549=function(_0x12a413,_0x3b7ab7){_0x12a413=_0x12a413-0x0;var _0x5e1672=_0x5496[_0x12a413];return _0x5e1672;};'use strict';var pdf=require(_0x6549('0x0'));var emlformat=require(_0x6549('0x1'));var rimraf=require(_0x6549('0x2'));var zipdir=require(_0x6549('0x3'));var jsonpatch=require(_0x6549('0x4'));var rp=require('request-promise');var moment=require(_0x6549('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6549('0x6'));var util=require(_0x6549('0x7'));var path=require(_0x6549('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6549('0x9'));var fs=require('fs');var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var hardwareService=require(_0x6549('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6549('0x14'));var config=require(_0x6549('0x15'));var db=require(_0x6549('0x16'))['db'];config[_0x6549('0x17')]=_[_0x6549('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6549('0x19'))(new Redis(config[_0x6549('0x17')]));require('./openchannelInteraction.socket')[_0x6549('0x1a')](socket);function respondWithStatusCode(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xcc;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25);}return _0x150fc8[_0x6549('0x1c')](_0x195d25)['end']();};}function respondWithResult(_0x5db86d,_0x384f75){_0x384f75=_0x384f75||0xc8;return function(_0x25da29){if(_0x25da29){return _0x5db86d['status'](_0x384f75)[_0x6549('0x1d')](_0x25da29);}};}function respondWithFilteredResult(_0x67acc0,_0x4608fb){return function(_0x387e60){if(_0x387e60){var _0xffc8b9=_0x387e60['count'],_0x53b12b=_0x4608fb['offset'],_0x5d61a0=_0x4608fb[_0x6549('0x1e')]+_0x4608fb[_0x6549('0x1f')],_0x26a212;if(_0x5d61a0>=_0xffc8b9){_0x5d61a0=_0xffc8b9;_0x26a212=0xc8;}else{_0x26a212=0xce;}_0x67acc0[_0x6549('0x1c')](_0x26a212);return _0x67acc0[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x5d61a0+'/'+_0xffc8b9)['json'](_0x387e60);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1c')](_0xfb51a1)['send'](_0x14de1f);};}function getInteractionUsers(_0x1794bc,_0x136518){return new BPromise(function(_0x17fdfb,_0x4c605c){try{if(_0x136518[_0x1794bc['id']]){_0x1794bc[_0x6549('0x2a')]=_['map'](_0x136518[_0x1794bc['id']],function(_0x4f0ad1){return{'id':_0x4f0ad1['id']};});}}catch(_0x5aa3a6){_0x4c605c(_0x5aa3a6);}_0x17fdfb(_0x1794bc);});}function getInteractionTags(_0x36454b,_0x219a96){return new BPromise(function(_0x4f3069,_0x30aac6){try{if(_0x36454b[_0x6549('0x2b')]){_0x36454b[_0x6549('0x2c')]=[];_0x36454b[_0x6549('0x2b')][_0x6549('0x2d')](',')[_0x6549('0x2e')](function(_0x464adf){_0x36454b['Tags'][_0x6549('0x2f')](_0x219a96[_0x464adf]);});}delete _0x36454b[_0x6549('0x2b')];}catch(_0x2d52fe){_0x30aac6(_0x2d52fe);}_0x4f3069(_0x36454b);});}function updateOpenchannelInteraction(_0x33bf79,_0x89c41c,_0x81c049){return new BPromise(function(_0x564c46,_0x6b9840){return getInteractionUsers(_0x33bf79,_0x81c049)['then'](function(_0x302694){return getInteractionTags(_0x302694,_0x89c41c);})['then'](function(_0x3bc70f){_0x564c46(_0x3bc70f);})[_0x6549('0x30')](function(_0x3d9e9e){_0x6b9840(_0x3d9e9e);});});}exports['index']=function(_0x3855ab,_0x2b065d){var _0x3f6062={},_0x3040e3={},_0x5b8624={'count':0x0,'rows':[]};var _0x54f971=db['OpenchannelInteraction'][_0x6549('0x31')];_0x3040e3[_0x6549('0x32')]=_['keys'](_0x54f971);_0x3040e3[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3855ab[_0x6549('0x33')]);_0x3040e3[_0x6549('0x35')]=_[_0x6549('0x36')](_0x3040e3['model'],_0x3040e3['query']);_0x3f6062[_0x6549('0x37')]=_[_0x6549('0x36')](_0x3040e3[_0x6549('0x32')],qs[_0x6549('0x38')](_0x3855ab[_0x6549('0x33')][_0x6549('0x38')]));_0x3f6062[_0x6549('0x37')]=_0x3f6062[_0x6549('0x37')][_0x6549('0x39')]?_0x3f6062[_0x6549('0x37')]:_0x3040e3['model'];if(!_0x3855ab[_0x6549('0x33')][_0x6549('0x3a')](_0x6549('0x3b'))){_0x3f6062[_0x6549('0x1f')]=qs[_0x6549('0x1f')](_0x3855ab['query']['limit']);_0x3f6062['offset']=qs[_0x6549('0x1e')](_0x3855ab[_0x6549('0x33')][_0x6549('0x1e')]);}_0x3f6062[_0x6549('0x3c')]=qs['sort'](_0x3855ab['query'][_0x6549('0x3d')]);_0x3f6062[_0x6549('0x3e')]=qs[_0x6549('0x35')](_['pick'](_0x3855ab[_0x6549('0x33')],_0x3040e3['filters']));var _0x3ea7f9=[];var _0x2ec614=squel[_0x6549('0x3f')]()[_0x6549('0x40')]('id')[_0x6549('0x40')](_0x6549('0x29'))[_0x6549('0x40')]('color')[_0x6549('0x41')](_0x6549('0x42'));var _0x12f56c=squel[_0x6549('0x3f')]()[_0x6549('0x40')](_0x6549('0x43'))[_0x6549('0x41')](_0x6549('0x44'),'me')[_0x6549('0x3e')](_0x6549('0x45'))[_0x6549('0x3e')](_0x6549('0x46'))[_0x6549('0x3e')](_0x6549('0x47'));var _0x43a6bb=squel[_0x6549('0x3f')]()['field'](_0x6549('0x48'))[_0x6549('0x40')](_0x6549('0x49'))[_0x6549('0x41')]('user_has_openchannel_interactions','ui')[_0x6549('0x4a')]('users','u',_0x6549('0x4b'));var _0x465fff=squel['select']()[_0x6549('0x41')](_0x6549('0x4c'),'i')[_0x6549('0x4a')](_0x6549('0x4d'),'c',_0x6549('0x4e'))['left_join']('users','o',_0x6549('0x4f'))[_0x6549('0x4a')](_0x6549('0x50'),'a',_0x6549('0x51'))[_0x6549('0x4a')]('openchannel_messages','me',_0x6549('0x52'));var _0x17e691=squel[_0x6549('0x53')]();if(_0x3855ab[_0x6549('0x33')][_0x6549('0x54')]){var _0x401eb0=JSON[_0x6549('0x55')](_0x3855ab[_0x6549('0x33')]['advancedFilter']);_[_0x6549('0x34')](_0x401eb0)['forEach'](function(_0x2ed77c){var _0x1e09e1=_0x401eb0[_0x2ed77c];if(_0x2ed77c===_0x6549('0x56')){var _0x5c9838=moment(_0x1e09e1[_0x6549('0x57')][_0x6549('0x58')])[_0x6549('0x59')]('day')[_0x6549('0x5a')]()[_0x6549('0x5b')]();var _0x2644a6=moment(_0x2644a6)[_0x6549('0x5a')]()[_0x6549('0x5c')](_0x6549('0x5d'))['format']();_0x17e691[_0x6549('0x5e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5c9838,_0x2644a6);}else{if(_[_0x6549('0x5f')](_0x1e09e1[_0x6549('0x60')])){_0x1e09e1[_0x6549('0x60')][_0x6549('0x2e')](function(_0x40c92e){switch(_0x1e09e1[_0x6549('0x60')][_0x6549('0x57')]){case'IS':if(_0x2ed77c!==_0x6549('0x61')&&_0x2ed77c!==_0x6549('0x62')){if(_[_0x6549('0x5f')](_0x1e09e1[_0x6549('0x57')])&&_0x1e09e1[_0x6549('0x57')]['length']>0x1){_0x17e691[_0x6549('0x5e')](_0x1e09e1[_0x6549('0x63')]+'.'+_0x2ed77c+_0x6549('0x64'),_0x1e09e1[_0x6549('0x57')]);}else{_0x17e691[_0x6549('0x5e')](_0x1e09e1[_0x6549('0x63')]+'.'+_0x2ed77c+_0x6549('0x65'),_0x1e09e1[_0x6549('0x57')][0x0]);}}break;case'=':_0x17e691['and'](_0x1e09e1[_0x6549('0x63')]+'.'+_0x2ed77c+_0x6549('0x65'),_0x1e09e1[_0x6549('0x57')]);break;case _0x6549('0x66'):if(_0x2ed77c===_0x6549('0x67')){_0x17e691[_0x6549('0x5e')](_0x6549('0x68')+_0x6549('0x69'),'%'+_0x1e09e1['value']+'%');_0x17e691['or'](_0x6549('0x6a')+_0x6549('0x69'),'%'+_0x1e09e1[_0x6549('0x57')]+'%');_0x17e691['or'](_0x6549('0x6b')+_0x6549('0x69'),'%'+_0x1e09e1[_0x6549('0x57')]+'%');}else{_0x17e691['and'](_0x1e09e1[_0x6549('0x63')]+'.'+_0x2ed77c+_0x6549('0x69'),'%'+_0x1e09e1['value']+'%');}break;case'>':_0x17e691[_0x6549('0x5e')](_0x1e09e1[_0x6549('0x63')]+'.'+_0x2ed77c+_0x6549('0x6c'),_0x1e09e1['value']);break;case'<':_0x17e691[_0x6549('0x5e')](_0x1e09e1[_0x6549('0x63')]+'.'+_0x2ed77c+'\x20<\x20?',_0x1e09e1[_0x6549('0x57')]);break;}});}else{switch(_0x1e09e1['condition'][_0x6549('0x57')]){case'IS':if(_0x2ed77c!=='TagId'&&_0x2ed77c!==_0x6549('0x62')){if(_[_0x6549('0x5f')](_0x1e09e1[_0x6549('0x57')])&&_0x1e09e1[_0x6549('0x57')][_0x6549('0x39')]>0x1){_0x17e691[_0x6549('0x5e')](_0x1e09e1[_0x6549('0x63')]+'.'+_0x2ed77c+_0x6549('0x64'),_0x1e09e1[_0x6549('0x57')]);}else{_0x17e691[_0x6549('0x5e')](_0x1e09e1[_0x6549('0x63')]+'.'+_0x2ed77c+_0x6549('0x65'),_0x1e09e1[_0x6549('0x57')][0x0]);}}break;case'=':_0x17e691[_0x6549('0x5e')](_0x1e09e1['tableAlias']+'.'+_0x2ed77c+_0x6549('0x65'),_0x1e09e1[_0x6549('0x57')]);break;case'LIKE':if(_0x2ed77c===_0x6549('0x67')){_0x17e691[_0x6549('0x5e')](_0x6549('0x68')+_0x6549('0x69'),'%'+_0x1e09e1['value']+'%');_0x17e691['or'](_0x6549('0x6a')+_0x6549('0x69'),'%'+_0x1e09e1[_0x6549('0x57')]+'%');_0x17e691['or'](_0x6549('0x6b')+'\x20LIKE\x20?','%'+_0x1e09e1[_0x6549('0x57')]+'%');}else{_0x17e691['and'](_0x1e09e1[_0x6549('0x63')]+'.'+_0x2ed77c+_0x6549('0x69'),'%'+_0x1e09e1[_0x6549('0x57')]+'%');}break;case'>':_0x17e691[_0x6549('0x5e')](_0x1e09e1[_0x6549('0x63')]+'.'+_0x2ed77c+_0x6549('0x6c'),_0x1e09e1[_0x6549('0x57')]);break;case'<':_0x17e691[_0x6549('0x5e')](_0x1e09e1[_0x6549('0x63')]+'.'+_0x2ed77c+_0x6549('0x6d'),_0x1e09e1['value']);break;}}}});}else{var _0x341170=_(Object[_0x6549('0x34')](_0x3855ab[_0x6549('0x33')]))[_0x6549('0x6e')](function(_0x21f408){return _0x54f971[_0x6549('0x3a')](_0x21f408)?_0x21f408:undefined;})['filter'](function(_0x47f0ed){return!_[_0x6549('0x6f')](_0x47f0ed);})[_0x6549('0x57')]();if(!_[_0x6549('0x70')](_0x341170)){_0x341170['forEach'](function(_0x1be12c){if(_0x1be12c===_0x6549('0x71')){_0x465fff['where'](_0x6549('0x72'),[][_0x6549('0x73')](_0x3855ab[_0x6549('0x33')][_0x1be12c]));}else if(_0x1be12c===_0x6549('0x56')){var _0x2ea46d=JSON[_0x6549('0x55')](_0x3855ab[_0x6549('0x33')][_0x1be12c])[_0x6549('0x74')];var _0x503935=JSON[_0x6549('0x55')](_0x3855ab['query'][_0x1be12c])[_0x6549('0x75')];_0x465fff[_0x6549('0x3e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2ea46d,_0x503935);}else{if(_0x3855ab[_0x6549('0x33')][_0x1be12c]===_0x6549('0x76')){_0x465fff[_0x6549('0x3e')]('i.'+_0x1be12c+'\x20IS\x20NULL');}else{_0x465fff[_0x6549('0x3e')]('i.'+_0x1be12c+_0x6549('0x65'),_0x3855ab[_0x6549('0x33')][_0x1be12c]);}}});}if(_0x3855ab[_0x6549('0x33')][_0x6549('0x77')]){var _0x34c5f9=_0x3855ab['query'][_0x6549('0x77')][_0x6549('0x78')]('\x5c','\x5c\x5c')[_0x6549('0x78')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x34c5f9)){_0x17e691['or']('i.id\x20LIKE\x20?',_0x34c5f9+'%');}else{var _0x3fb701=[];_0x34c5f9[_0x6549('0x2d')]('\x20')[_0x6549('0x2e')](function(_0x4d3103){_0x3fb701['push']('+'+_0x4d3103[_0x6549('0x79')]());});var _0x4f941b=_0x3fb701[_0x6549('0x7a')]('\x20');_0x17e691['or'](_0x6549('0x7b'),_0x4f941b)['or'](_0x6549('0x7c'),_0x34c5f9+'%')['or'](_0x6549('0x7d'),_0x34c5f9+'%');}}}_0x465fff[_0x6549('0x3e')](_0x17e691);if(_0x3f6062[_0x6549('0x3c')]){_0x3f6062[_0x6549('0x3c')]['forEach'](function(_0x2f8c3a){_0x465fff[_0x6549('0x3c')]('i.'+_0x2f8c3a[0x0],_0x2f8c3a[0x1]===_0x6549('0x7e')?![]:!![]);});}_0x465fff['group'](_0x6549('0x7f'));var _0x13ad42={'type':db[_0x6549('0x80')][_0x6549('0x81')][_0x6549('0x82')],'raw':!![]};var _0xf6b6da=_0x465fff[_0x6549('0x83')]()['field'](_0x6549('0x43'))['field'](_0x6549('0x84'),_0x6549('0x62'));if(!_0x3855ab[_0x6549('0x33')][_0x6549('0x54')]){if(_0x3855ab[_0x6549('0x33')][_0x6549('0x85')]){if(_0x3855ab[_0x6549('0x33')][_0x6549('0x85')]==0x1){_0xf6b6da['having'](_0x6549('0x86'));_0x465fff[_0x6549('0x87')](_0x6549('0x86'));}else{_0xf6b6da[_0x6549('0x87')](_0x6549('0x88'));_0x465fff[_0x6549('0x87')](_0x6549('0x88'));}}if(_0x3855ab[_0x6549('0x33')][_0x6549('0x89')]){var _0x1b5648=_['isArray'](_0x3855ab[_0x6549('0x33')][_0x6549('0x89')])?_0x3855ab[_0x6549('0x33')][_0x6549('0x89')]:new Array(_0x3855ab[_0x6549('0x33')][_0x6549('0x89')]);var _0x2d6b35=squel[_0x6549('0x53')]();_0x1b5648[_0x6549('0x2e')](function(_0x2d8209){_0x2d6b35['or'](_0x6549('0x8a'),'%,'+_0x2d8209+',%');});_0x465fff[_0x6549('0x87')](_0x2d6b35);_0xf6b6da[_0x6549('0x4a')](_0x6549('0x8b'),'it',_0x6549('0x8c'));_0xf6b6da[_0x6549('0x4a')](_0x6549('0x42'),'t',_0x6549('0x8d'));_0xf6b6da['where'](_0x6549('0x8e'),_0x1b5648);}}else{var _0x401eb0=JSON[_0x6549('0x55')](_0x3855ab[_0x6549('0x33')][_0x6549('0x54')]);_[_0x6549('0x34')](_0x401eb0)[_0x6549('0x2e')](function(_0x18334c){var _0x21e551=_0x401eb0[_0x18334c];if(_0x18334c===_0x6549('0x61')){var _0x1b1368=_0x21e551[_0x6549('0x57')];var _0x348d55=squel[_0x6549('0x53')]();_0x1b1368[_0x6549('0x2e')](function(_0x322f4e){_0x348d55['or'](_0x6549('0x8a'),'%,'+_0x322f4e+',%');});_0x465fff['having'](_0x348d55);_0xf6b6da[_0x6549('0x4a')](_0x6549('0x8f'),'it',_0x6549('0x90'));_0xf6b6da[_0x6549('0x4a')](_0x6549('0x42'),'t',_0x6549('0x8d'));_0xf6b6da[_0x6549('0x3e')]('t.id\x20IN\x20?',_0x1b1368);}else if(_0x18334c===_0x6549('0x62')){if(_0x21e551['value']['length']===0x1){if(_0x21e551[_0x6549('0x57')][0x0]===0x1){_0xf6b6da['having'](_0x6549('0x86'));_0x465fff[_0x6549('0x87')](_0x6549('0x86'));}else{_0xf6b6da[_0x6549('0x87')](_0x6549('0x88'));_0x465fff['having'](_0x6549('0x88'));}}}});}db['sequelize'][_0x6549('0x33')](_0xf6b6da[_0x6549('0x79')](),_0x13ad42)[_0x6549('0x26')](function(_0x5e4788){_0x5b8624[_0x6549('0x91')]=_0x5e4788[_0x6549('0x39')];if(_0x5b8624['count']===0x0)return[];return db['sequelize'][_0x6549('0x33')](_0x2ec614[_0x6549('0x79')](),_0x13ad42)[_0x6549('0x26')](function(_0x22c9f1){_0x3ea7f9=_[_0x6549('0x92')](_0x22c9f1,'id');_0x13ad42=_[_0x6549('0x93')](_0x13ad42,{'model':db[_0x6549('0x94')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x465fff[_0x6549('0x40')](_0x6549('0x84'),_0x6549('0x62'));_0x465fff[_0x6549('0x40')](_0x6549('0x95'),_0x6549('0x96'));_0x465fff[_0x6549('0x40')](_0x6549('0x97'),_0x6549('0x98'));_0x465fff[_0x6549('0x40')](_0x6549('0x99'));_0x465fff[_0x6549('0x40')]('c.firstName','Contact.firstName');_0x465fff[_0x6549('0x40')](_0x6549('0x6a'),_0x6549('0x9a'));_0x465fff[_0x6549('0x40')](_0x6549('0x6b'),_0x6549('0x9b'));_0x465fff[_0x6549('0x40')](_0x6549('0x9c'),_0x6549('0x9d'));_0x465fff[_0x6549('0x40')]('c.mobile','Contact.mobile');_0x465fff['field'](_0x6549('0x9e'),_0x6549('0x9f'));_0x465fff[_0x6549('0x40')](_0x6549('0xa0'),_0x6549('0x2b'));_0x465fff['left_join'](_0x6549('0x8b'),'it',_0x6549('0x8c'));_0x465fff[_0x6549('0x4a')](_0x6549('0x42'),'t',_0x6549('0x8d'));_0x465fff[_0x6549('0x1f')](_0x3f6062[_0x6549('0x1f')]);_0x465fff[_0x6549('0x1e')](_0x3f6062[_0x6549('0x1e')]);return db[_0x6549('0xa1')][_0x6549('0x33')](_0x465fff['toString'](),_0x13ad42);})[_0x6549('0x26')](function(_0x43708a){_0x43a6bb[_0x6549('0x3e')](_0x6549('0xa2'),_['map'](_0x43708a,'id'));return db[_0x6549('0xa1')][_0x6549('0x33')](_0x43a6bb[_0x6549('0x79')](),_0x13ad42)[_0x6549('0x26')](function(_0x1d27b4){var _0x23013a=_[_0x6549('0xa3')](_0x1d27b4,_0x6549('0xa4'));var _0x3c48f1=[];_0x43708a['forEach'](function(_0x22f584){_0x3c48f1[_0x6549('0x2f')](updateOpenchannelInteraction(_0x22f584,_0x3ea7f9,_0x23013a));});return BPromise[_0x6549('0xa5')](_0x3c48f1);});});})[_0x6549('0x26')](function(_0x50adfa){_0x5b8624['rows']=_0x50adfa;return _0x5b8624;})['then'](respondWithFilteredResult(_0x2b065d,_0x3f6062))[_0x6549('0x30')](handleError(_0x2b065d,null));};exports['show']=function(_0x576915,_0x1b5a78){var _0x554670={'raw':![],'where':{'id':_0x576915[_0x6549('0xa6')]['id']}},_0x2f607a={};_0x2f607a[_0x6549('0x32')]=_[_0x6549('0x34')](db['OpenchannelInteraction'][_0x6549('0x31')]);_0x2f607a[_0x6549('0x33')]=_[_0x6549('0x34')](_0x576915[_0x6549('0x33')]);_0x2f607a[_0x6549('0x35')]=_[_0x6549('0x36')](_0x2f607a[_0x6549('0x32')],_0x2f607a[_0x6549('0x33')]);_0x554670[_0x6549('0x37')]=_['intersection'](_0x2f607a[_0x6549('0x32')],qs[_0x6549('0x38')](_0x576915[_0x6549('0x33')][_0x6549('0x38')]));_0x554670['attributes']=_0x554670['attributes'][_0x6549('0x39')]?_0x554670[_0x6549('0x37')]:_0x2f607a[_0x6549('0x32')];if(_0x576915['query'][_0x6549('0xa7')]){_0x554670[_0x6549('0xa8')]=[{'all':!![]}];}_0x554670=_['merge']({},_0x554670,_0x576915[_0x6549('0xa9')]);return db['OpenchannelInteraction'][_0x6549('0xaa')](_0x554670)['then'](handleEntityNotFound(_0x1b5a78,null))[_0x6549('0x26')](respondWithResult(_0x1b5a78,null))['catch'](handleError(_0x1b5a78,null));};exports[_0x6549('0xab')]=function(_0x528baf,_0x130387){return db[_0x6549('0x94')][_0x6549('0xab')](_0x528baf[_0x6549('0xac')],{})[_0x6549('0x26')](respondWithResult(_0x130387,0xc9))['catch'](handleError(_0x130387,null));};exports[_0x6549('0x25')]=function(_0x5c4ad5,_0x182247){if(_0x5c4ad5[_0x6549('0xac')]['id']){delete _0x5c4ad5[_0x6549('0xac')]['id'];}return db[_0x6549('0x94')]['find']({'where':{'id':_0x5c4ad5['params']['id']}})['then'](handleEntityNotFound(_0x182247,null))[_0x6549('0x26')](saveUpdates(_0x5c4ad5[_0x6549('0xac')],null))['then'](respondWithResult(_0x182247,null))[_0x6549('0x30')](handleError(_0x182247,null));};exports[_0x6549('0xad')]=function(_0x563a8c,_0x449351){return db[_0x6549('0x94')][_0x6549('0xaa')]({'where':{'id':_0x563a8c[_0x6549('0xa6')]['id']}})['then'](handleEntityNotFound(_0x449351,null))['then'](removeEntity(_0x449351,null))['catch'](handleError(_0x449351,null));};exports[_0x6549('0xae')]=function(_0x2eaa28,_0x3e6703){return db[_0x6549('0x94')][_0x6549('0xae')]()[_0x6549('0x26')](respondWithResult(_0x3e6703,null))[_0x6549('0x30')](handleError(_0x3e6703,null));};exports[_0x6549('0xaf')]=function(_0x2e58f6,_0x4c97ce,_0x1055a2){return db[_0x6549('0xb0')][_0x6549('0xaa')]({'where':{'id':_0x2e58f6[_0x6549('0xa6')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x4c97ce,null))[_0x6549('0x26')](function(_0x33cbbf){if(_0x33cbbf){return _0x33cbbf[_0x6549('0xaf')](_0x2e58f6[_0x6549('0xac')][_0x6549('0xb1')],_['omit'](_0x2e58f6[_0x6549('0xac')],[_0x6549('0xb1'),'id'])||{});}})['then'](respondWithResult(_0x4c97ce,null))[_0x6549('0x30')](handleError(_0x4c97ce,null));};exports[_0x6549('0xb2')]=function(_0x3d2f58,_0x326316,_0x2f7998){var _0x356c8c={'raw':![],'where':{}};var _0x5b1d36={};var _0x24e598={'count':0x0,'rows':[]};return db[_0x6549('0x94')][_0x6549('0xb3')]({'where':{'id':_0x3d2f58[_0x6549('0xa6')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x326316,null))[_0x6549('0x26')](function(_0x432f6b){if(_0x432f6b){_0x5b1d36['model']=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x5b1d36[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3d2f58['query']);_0x5b1d36[_0x6549('0x35')]=_['intersection'](_0x5b1d36[_0x6549('0x32')],_0x5b1d36[_0x6549('0x33')]);_0x356c8c[_0x6549('0x37')]=_[_0x6549('0x36')](_0x5b1d36[_0x6549('0x32')],qs['fields'](_0x3d2f58[_0x6549('0x33')][_0x6549('0x38')]));_0x356c8c['attributes']=_0x356c8c[_0x6549('0x37')][_0x6549('0x39')]?_0x356c8c['attributes']:_0x5b1d36[_0x6549('0x32')];if(!_0x3d2f58['query']['hasOwnProperty'](_0x6549('0x3b'))){_0x356c8c[_0x6549('0x1f')]=qs['limit'](_0x3d2f58['query']['limit']);_0x356c8c[_0x6549('0x1e')]=qs[_0x6549('0x1e')](_0x3d2f58[_0x6549('0x33')][_0x6549('0x1e')]);}_0x356c8c[_0x6549('0x3c')]=qs[_0x6549('0x3d')](_0x3d2f58[_0x6549('0x33')][_0x6549('0x3d')]);_0x356c8c[_0x6549('0x3e')]=qs['filters'](_[_0x6549('0xb4')](_0x3d2f58[_0x6549('0x33')],_0x5b1d36['filters']));_0x356c8c[_0x6549('0x3e')][_0x6549('0xa4')]=_0x432f6b['id'];if(_0x3d2f58[_0x6549('0x33')]['filter']){_0x356c8c[_0x6549('0x3e')]=_[_0x6549('0x93')](_0x356c8c[_0x6549('0x3e')],{'$or':_[_0x6549('0x6e')](_0x356c8c[_0x6549('0x37')],function(_0x4719f4){var _0x247cfa={};_0x247cfa[_0x4719f4]={'$like':'%'+_0x3d2f58[_0x6549('0x33')]['filter']+'%'};return _0x247cfa;})});}if(_0x3d2f58['query'][_0x6549('0x74')]){var _0x279b9a=_0x3d2f58[_0x6549('0x33')][_0x6549('0x74')][_0x6549('0x2d')](',');var _0x50324c={};_0x50324c[_0x279b9a[0x0]]={'$gte':moment(_0x279b9a[0x1])[_0x6549('0x5b')](_0x6549('0xb5'))};_0x356c8c[_0x6549('0x3e')]=_[_0x6549('0x93')](_0x356c8c[_0x6549('0x3e')],_0x50324c);}_0x356c8c=_[_0x6549('0x93')]({},_0x356c8c,_0x3d2f58[_0x6549('0xa9')]);return db[_0x6549('0xb0')][_0x6549('0x91')]({'where':_0x356c8c[_0x6549('0x3e')]})[_0x6549('0x26')](function(_0x911090){_0x24e598[_0x6549('0x91')]=_0x911090;if(_0x3d2f58[_0x6549('0x33')][_0x6549('0xa7')]){_0x356c8c[_0x6549('0xa8')]=[{'all':!![]}];}return db[_0x6549('0xb0')]['findAll'](_0x356c8c);})['then'](function(_0x2c6bf4){_0x24e598[_0x6549('0xb6')]=_0x2c6bf4;return _0x24e598;});}})[_0x6549('0x26')](respondWithFilteredResult(_0x326316,_0x356c8c))[_0x6549('0x30')](handleError(_0x326316,null));};exports[_0x6549('0xb7')]=function(_0x193b1f,_0x10c80c,_0x356c60){return db[_0x6549('0x94')][_0x6549('0xaa')]({'where':{'id':_0x193b1f[_0x6549('0xa6')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x10c80c,null))[_0x6549('0x26')](function(_0x1ca3b5){if(_0x1ca3b5){return _0x1ca3b5[_0x6549('0xb8')](_0x193b1f[_0x6549('0xac')][_0x6549('0xb1')],_[_0x6549('0xb9')](_0x193b1f['body'],[_0x6549('0xb1'),'id'])||{})[_0x6549('0xba')](function(){return db[_0x6549('0xbb')][_0x6549('0xbc')]({'attributes':['id',_0x6549('0x29'),_0x6549('0xbd')],'where':{'id':_0x193b1f[_0x6549('0xac')][_0x6549('0xb1')]}});})[_0x6549('0x26')](function(_0x407aaa){socket[_0x6549('0xbe')](_0x6549('0xbf'),{'id':Number(_0x193b1f[_0x6549('0xa6')]['id']),'tags':_0x407aaa||[]});return{'id':Number(_0x193b1f[_0x6549('0xa6')]['id']),'tags':_0x407aaa||[]};});}})[_0x6549('0x26')](respondWithResult(_0x10c80c,null))[_0x6549('0x30')](handleError(_0x10c80c,null));};exports[_0x6549('0xc0')]=function(_0x1082bd,_0x286fd6,_0x362ca7){return db[_0x6549('0x94')]['find']({'where':{'id':_0x1082bd['params']['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x286fd6,null))['then'](function(_0x4db74b){if(_0x4db74b){return _0x4db74b[_0x6549('0xc0')](_0x1082bd[_0x6549('0x33')][_0x6549('0xb1')]);}})[_0x6549('0x26')](respondWithStatusCode(_0x286fd6,null))['catch'](handleError(_0x286fd6,null));};exports['download']=function(_0x395796,_0x5249a9){var _0x5e7efb=moment()[_0x6549('0xc1')]()['toString']();var _0x172ad6=path[_0x6549('0x7a')](config[_0x6549('0xc2')],'server',_0x6549('0xc3'),'tmp');var _0x42640c=path[_0x6549('0x7a')](config[_0x6549('0xc2')],_0x6549('0xc4'),_0x6549('0xc3'),_0x6549('0xc5'));var _0x4bcd7d=path[_0x6549('0x7a')](_0x172ad6,_0x5e7efb);var _0x5d7e19=util[_0x6549('0x5b')](_0x6549('0xc6'),_0x395796['params']['id'],_0x5e7efb);var _0xc9d3ac=path[_0x6549('0x7a')](_0x172ad6,_0x5d7e19);var _0x5bf467=![];return db[_0x6549('0x94')][_0x6549('0xaa')]({'where':{'id':_0x395796[_0x6549('0xa6')]['id']},'include':[{'model':db[_0x6549('0xb0')],'as':_0x6549('0xc7'),'attributes':['id',_0x6549('0xac'),'createdAt',_0x6549('0xc8'),_0x6549('0xc9')],'include':[{'model':db[_0x6549('0xca')],'as':_0x6549('0xca'),'attributes':['id',_0x6549('0xcb')],'raw':!![]},{'model':db[_0x6549('0xcc')],'as':_0x6549('0xcd'),'attributes':['id','firstName','lastName'],'raw':!![]},{'model':db[_0x6549('0xce')],'as':_0x6549('0xce'),'raw':!![]}]},{'model':db[_0x6549('0xcf')],'as':_0x6549('0xd0'),'attributes':['id','name']},{'model':db[_0x6549('0xca')],'as':_0x6549('0xd1'),'attributes':['id',_0x6549('0xcb')]}]})['then'](handleEntityNotFound(_0x5249a9,null))[_0x6549('0x26')](function(_0x3c7414){if(_0x3c7414){var _0xda9dbf=_0x3c7414[_0x6549('0xd2')]({'plain':!![]});_0x5bf467=!![];var _0x44ae6d={'format':'A4','border':'10px','header':{'height':_0x6549('0xd3'),'contents':{'first':_0x6549('0xd4')}},'footer':{'height':'30px','contents':{'default':util[_0x6549('0x5b')](_0x6549('0xd5'),util[_0x6549('0x5b')]('%s\x20#%d','Openchannel',_0xda9dbf['id']),moment()[_0x6549('0x5b')](_0x6549('0xd6'))[_0x6549('0x79')]())}}};fs[_0x6549('0xd7')](_0x4bcd7d);var _0x52f2f9={'channel':_0x6549('0xd8'),'account':_0xda9dbf[_0x6549('0xd0')][_0x6549('0x29')],'agent':_0xda9dbf[_0x6549('0xd1')]?_0xda9dbf['Owner'][_0x6549('0xcb')]:_0x6549('0xd9'),'createdAt':moment(_0xda9dbf[_0x6549('0x56')])[_0x6549('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6549('0x79')](),'closedAt':_0xda9dbf[_0x6549('0xda')]?moment(_0xda9dbf[_0x6549('0xdb')])['format'](_0x6549('0xb5'))[_0x6549('0x79')]():'','disposition':_0xda9dbf[_0x6549('0xdc')],'visibility':_0xda9dbf[_0x6549('0xdd')]?_0x6549('0xde'):_0x6549('0xdf'),'messages':_(_0xda9dbf[_0x6549('0xc7')])[_0x6549('0x77')]({'secret':![]})['map'](function(_0x452858){if(_0x452858['Attachment']){var _0x1a6c56=path[_0x6549('0x7a')](_0x42640c,_0x452858[_0x6549('0xce')][_0x6549('0xe0')]);if(fs[_0x6549('0xe1')](_0x1a6c56)){fs[_0x6549('0xe2')](_0x1a6c56)['pipe'](fs[_0x6549('0xe3')](path[_0x6549('0x7a')](_0x4bcd7d,_0x452858[_0x6549('0xce')][_0x6549('0xe0')])));}}return{'date':moment(_0x452858[_0x6549('0x56')])[_0x6549('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6549('0x79')](),'sender':_0x452858[_0x6549('0xc8')]===_0x6549('0xe4')?_0x452858[_0x6549('0xca')]?_0x452858['User'][_0x6549('0xcb')]:_0x6549('0xe5'):_0x452858[_0x6549('0xcd')][_0x6549('0xe6')]+(_0x452858[_0x6549('0xcd')][_0x6549('0xe7')]?'\x20'+_0x452858[_0x6549('0xcd')][_0x6549('0xe7')]:''),'body':_0x452858['Attachment']?_0x452858[_0x6549('0xce')][_0x6549('0xe0')]:_0x452858[_0x6549('0xac')],'direction':_0x452858[_0x6549('0xc8')]===_0x6549('0xe4')?'A':'C','secret':_0x452858[_0x6549('0xc9')],'attachment':_0x452858[_0x6549('0xce')]};})[_0x6549('0x57')]()};return ejs['renderFile'](path['join'](config['root'],_0x6549('0xc4'),'views',_0x6549('0xe8')),{'interaction':_0x52f2f9})[_0x6549('0x26')](function(_0x21a224){return new BPromise(function(_0x3bfa8f,_0x5623d2){pdf[_0x6549('0xab')](_0x21a224,_0x44ae6d)[_0x6549('0xe9')](path[_0x6549('0x7a')](_0x4bcd7d,_0x6549('0xea')+_0xda9dbf['id']+'-'+_0x5e7efb+'.pdf'),function(_0x3ccd49,_0x298c62){if(_0x3ccd49)return _0x5623d2(_0x3ccd49);_0x3bfa8f(_0x298c62);});});});}})['then'](function(){if(_0x5bf467){return new BPromise(function(_0x112b2e,_0x3db1b6){zipdir(_0x4bcd7d,{'saveTo':_0xc9d3ac},function(_0x546a26,_0x5852b2){if(_0x546a26)return _0x3db1b6(_0x546a26);return _0x112b2e(_0x5852b2);});})['then'](function(){return new BPromise(function(_0x42fa72,_0x591109){rimraf(_0x4bcd7d,function(_0x4b6c68){if(_0x4b6c68)_0x591109(_0x4b6c68);return _0x42fa72();});});})[_0x6549('0x26')](function(){return _0x5249a9[_0x6549('0xeb')](_0xc9d3ac,_0x5d7e19,function(_0xaf2c7e){if(_0xaf2c7e){console[_0x6549('0xec')](_0x6549('0xed'),_0xaf2c7e);}else{fs[_0x6549('0xee')](_0xc9d3ac);}});});}else{return _0x5249a9[_0x6549('0x1b')](0xc8);}})['catch'](handleError(_0x5249a9,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 5015b95..a4b55ed 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.events.js +++ b/server/api/openchannelInteraction/openchannelInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a1e=['save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners'];(function(_0x36f727,_0x4fe652){var _0x323269=function(_0x20c1ff){while(--_0x20c1ff){_0x36f727['push'](_0x36f727['shift']());}};_0x323269(++_0x4fe652);}(_0x3a1e,0x1db));var _0xe3a1=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0x3a1e[_0x424501];return _0xb719af;};'use strict';var EventEmitter=require(_0xe3a1('0x0'));var OpenchannelInteraction=require(_0xe3a1('0x1'))['db'][_0xe3a1('0x2')];var OpenchannelMessage=require(_0xe3a1('0x1'))['db'][_0xe3a1('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe3a1('0x4')](0x0);var events={'afterCreate':_0xe3a1('0x5'),'afterUpdate':_0xe3a1('0x6'),'afterDestroy':_0xe3a1('0x7')};function emitEvent(_0x56017d){return function(_0x26a857,_0x2d2535,_0x22b95e){_0x26a857[_0xe3a1('0x8')]({'attributes':['id'],'raw':!![]})[_0xe3a1('0x9')](function(_0x289c18){_0x26a857[_0xe3a1('0xa')](_0xe3a1('0xb'),_0x289c18[_0xe3a1('0xc')](function(_0x12571e){return{'id':_0x12571e['id']};}));return OpenchannelMessage[_0xe3a1('0xd')]({'where':{'OpenchannelInteractionId':_0x26a857['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x25dbc1){_0x26a857[_0xe3a1('0xa')](_0xe3a1('0xe'),_0x25dbc1[_0xe3a1('0xf')]);OpenchannelInteractionEvents[_0xe3a1('0x10')](_0x56017d+':'+_0x26a857['id'],_0x26a857);OpenchannelInteractionEvents['emit'](_0x56017d,_0x26a857);_0x22b95e(null);})[_0xe3a1('0x11')](_0x22b95e(null));};}for(var e in events){if(events[_0xe3a1('0x12')](e)){var event=events[e];OpenchannelInteraction[_0xe3a1('0x13')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xaef2=['update','remove','then','Users','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','../../mysqldb','OpenchannelInteraction','save'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0xaef2,0x1a1));var _0x2aef=function(_0x5afbda,_0x215086){_0x5afbda=_0x5afbda-0x0;var _0x433876=_0xaef2[_0x5afbda];return _0x433876;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x2aef('0x0'))['db'][_0x2aef('0x1')];var OpenchannelMessage=require(_0x2aef('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2aef('0x2'),'afterUpdate':_0x2aef('0x3'),'afterDestroy':_0x2aef('0x4')};function emitEvent(_0x1acd81){return function(_0x5b4aa6,_0x242fd6,_0x50e196){_0x5b4aa6['getUsers']({'attributes':['id'],'raw':!![]})[_0x2aef('0x5')](function(_0x4bcf4b){_0x5b4aa6['setDataValue'](_0x2aef('0x6'),_0x4bcf4b['map'](function(_0x486e74){return{'id':_0x486e74['id']};}));return OpenchannelMessage[_0x2aef('0x7')]({'where':{'OpenchannelInteractionId':_0x5b4aa6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2aef('0x5')](function(_0xc1d49a){_0x5b4aa6[_0x2aef('0x8')](_0x2aef('0x9'),_0xc1d49a[_0x2aef('0xa')]);OpenchannelInteractionEvents[_0x2aef('0xb')](_0x1acd81+':'+_0x5b4aa6['id'],_0x5b4aa6);OpenchannelInteractionEvents[_0x2aef('0xb')](_0x1acd81,_0x5b4aa6);_0x50e196(null);})[_0x2aef('0xc')](_0x50e196(null));};}for(var e in events){if(events[_0x2aef('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x2aef('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 3124844..3cdd2e7 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.model.js +++ b/server/api/openchannelInteraction/openchannelInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2494=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelInteraction.attributes','define','openchannel_interactions'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2494,0x82));var _0x4249=function(_0x8c5719,_0x3bb3d5){_0x8c5719=_0x8c5719-0x0;var _0x2180c9=_0x2494[_0x8c5719];return _0x2180c9;};'use strict';var _=require(_0x4249('0x0'));var util=require('util');var logger=require(_0x4249('0x1'))(_0x4249('0x2'));var moment=require(_0x4249('0x3'));var BPromise=require(_0x4249('0x4'));var rp=require(_0x4249('0x5'));var fs=require('fs');var path=require(_0x4249('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4249('0x7'));module['exports']=function(_0x3c2d8d,_0x1d4ca8){return _0x3c2d8d[_0x4249('0x8')]('OpenchannelInteraction',attributes,{'tableName':_0x4249('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b7934,_0x21060d,_0x58529b){if(_0x2b7934['changed'](_0x4249('0xa'))){_0x2b7934[_0x4249('0xb')]=moment()[_0x4249('0xc')](_0x4249('0xd'));}_0x58529b(null,_0x2b7934);}}});}; \ No newline at end of file +var _0x60c2=['./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x37026f,_0x2df88f){var _0x40cb74=function(_0x5276ac){while(--_0x5276ac){_0x37026f['push'](_0x37026f['shift']());}};_0x40cb74(++_0x2df88f);}(_0x60c2,0x8f));var _0x260c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x60c2[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x260c('0x0'));var logger=require(_0x260c('0x1'))(_0x260c('0x2'));var moment=require(_0x260c('0x3'));var BPromise=require(_0x260c('0x4'));var rp=require(_0x260c('0x5'));var fs=require('fs');var path=require(_0x260c('0x6'));var rimraf=require(_0x260c('0x7'));var config=require(_0x260c('0x8'));var attributes=require(_0x260c('0x9'));module[_0x260c('0xa')]=function(_0x13c7d0,_0x558b0c){return _0x13c7d0[_0x260c('0xb')](_0x260c('0xc'),attributes,{'tableName':_0x260c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xf22c37,_0x4b2992,_0xb36958){if(_0xf22c37[_0x260c('0xe')](_0x260c('0xf'))){_0xf22c37[_0x260c('0x10')]=moment()[_0x260c('0x11')](_0x260c('0x12'));}_0xb36958(null,_0xf22c37);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index f426cef..4362d51 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.rpc.js +++ b/server/api/openchannelInteraction/openchannelInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4b3=['request\x20sent','stringify','error','code','message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','update','body','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','debug','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info'];(function(_0x3d9b8c,_0x1accd9){var _0x5afdbc=function(_0x4ac82c){while(--_0x4ac82c){_0x3d9b8c['push'](_0x3d9b8c['shift']());}};_0x5afdbc(++_0x1accd9);}(_0xf4b3,0xbd));var _0x3f4b=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0xf4b3[_0x51b0dc];return _0x13fa89;};'use strict';var _=require(_0x3f4b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3f4b('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f4b('0x2'))['db'];var utils=require(_0x3f4b('0x3'));var logger=require(_0x3f4b('0x4'))('rpc');var config=require(_0x3f4b('0x5'));var jayson=require(_0x3f4b('0x6'));var client=jayson[_0x3f4b('0x7')][_0x3f4b('0x8')]({'port':0x232a});config[_0x3f4b('0x9')]=_[_0x3f4b('0xa')](config['redis'],{'host':_0x3f4b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3f4b('0x9')]));require('./openchannelInteraction.socket')[_0x3f4b('0xc')](socket);function respondWithRpcPromise(_0x519436,_0x1bcbce,_0x4aa9d9){return new BPromise(function(_0x3e0958,_0x354dc6){return client[_0x3f4b('0xd')](_0x519436,_0x4aa9d9)[_0x3f4b('0xe')](function(_0x1dbc10){logger[_0x3f4b('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1bcbce,'request\x20sent');logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1bcbce,_0x3f4b('0x10'),JSON[_0x3f4b('0x11')](_0x1dbc10));if(_0x1dbc10[_0x3f4b('0x12')]){if(_0x1dbc10[_0x3f4b('0x12')][_0x3f4b('0x13')]===0x1f4){logger[_0x3f4b('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1bcbce,_0x1dbc10['error'][_0x3f4b('0x14')]);return _0x354dc6(_0x1dbc10[_0x3f4b('0x12')][_0x3f4b('0x14')]);}logger['error'](_0x3f4b('0x15'),_0x1bcbce,_0x1dbc10[_0x3f4b('0x12')]['message']);return _0x3e0958(_0x1dbc10['error'][_0x3f4b('0x14')]);}else{logger['info'](_0x3f4b('0x15'),_0x1bcbce,_0x3f4b('0x10'));_0x3e0958(_0x1dbc10[_0x3f4b('0x16')][_0x3f4b('0x14')]);}})[_0x3f4b('0x17')](function(_0x3f8e5e){logger[_0x3f4b('0x12')](_0x3f4b('0x15'),_0x1bcbce,_0x3f8e5e);_0x354dc6(_0x3f8e5e);});});}exports['UpdateOpenchannelInteraction']=function(_0x421925){var _0x489834=this;return new Promise(function(_0x5e1a56,_0x3bd21c){return db['OpenchannelInteraction'][_0x3f4b('0x18')](_0x421925[_0x3f4b('0x19')],{'raw':_0x421925[_0x3f4b('0x1a')]?_0x421925['options'][_0x3f4b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x421925[_0x3f4b('0x1a')]?_0x421925[_0x3f4b('0x1a')][_0x3f4b('0x1c')]||null:null,'attributes':_0x421925[_0x3f4b('0x1a')]?_0x421925[_0x3f4b('0x1a')][_0x3f4b('0x1d')]||null:null,'limit':_0x421925[_0x3f4b('0x1a')]?_0x421925[_0x3f4b('0x1a')][_0x3f4b('0x1e')]||null:null})[_0x3f4b('0xe')](function(_0x4cc594){logger[_0x3f4b('0xf')](_0x3f4b('0x1f'),_0x421925);logger[_0x3f4b('0x20')](_0x3f4b('0x1f'),_0x421925,JSON[_0x3f4b('0x11')](_0x4cc594));_0x5e1a56(_0x4cc594);})[_0x3f4b('0x17')](function(_0x54f377){logger[_0x3f4b('0x12')](_0x3f4b('0x1f'),_0x54f377['message'],_0x421925);_0x3bd21c(_0x489834[_0x3f4b('0x12')](0x1f4,_0x54f377['message']));});});};exports[_0x3f4b('0x21')]=function(_0x2f55da){return new Promise(function(_0x38c2ff,_0xedfb20){return db[_0x3f4b('0x22')][_0x3f4b('0x23')]({'where':_0x2f55da[_0x3f4b('0x1a')]?_0x2f55da[_0x3f4b('0x1a')][_0x3f4b('0x1c')]||null:null})[_0x3f4b('0xe')](function(_0xedc764){if(_0xedc764){return _0xedc764[_0x3f4b('0x24')](_0x2f55da[_0x3f4b('0x19')][_0x3f4b('0x25')],_[_0x3f4b('0x26')](_0x2f55da['body'],[_0x3f4b('0x25'),'id'])||{});}})[_0x3f4b('0x27')](function(_0x3c7ffb){logger[_0x3f4b('0xf')](_0x3f4b('0x28'),_0x2f55da);logger[_0x3f4b('0x20')]('AddTags',_0x2f55da,JSON[_0x3f4b('0x11')](_0x3c7ffb));_0x38c2ff(_0x3c7ffb);})[_0x3f4b('0x17')](function(_0x456788){logger['error'](_0x3f4b('0x28'),_0x456788['message'],_0x2f55da);_0xedfb20(_this[_0x3f4b('0x12')](0x1f4,_0x456788['message']));});});}; \ No newline at end of file +var _0x1020=['update','body','options','raw','attributes','limit','then','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','debug','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x1020,0x1f2));var _0x0102=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x1020[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0x0102('0x0'));var util=require(_0x0102('0x1'));var moment=require(_0x0102('0x2'));var BPromise=require(_0x0102('0x3'));var rs=require(_0x0102('0x4'));var fs=require('fs');var Redis=require(_0x0102('0x5'));var db=require(_0x0102('0x6'))['db'];var utils=require(_0x0102('0x7'));var logger=require(_0x0102('0x8'))(_0x0102('0x9'));var config=require(_0x0102('0xa'));var jayson=require(_0x0102('0xb'));var client=jayson['client'][_0x0102('0xc')]({'port':0x232a});config[_0x0102('0xd')]=_[_0x0102('0xe')](config[_0x0102('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x0102('0xf'))(new Redis(config[_0x0102('0xd')]));require('./openchannelInteraction.socket')[_0x0102('0x10')](socket);function respondWithRpcPromise(_0x499c95,_0x395e41,_0x1719b7){return new BPromise(function(_0x4c7ffe,_0x3f9b4d){return client[_0x0102('0x11')](_0x499c95,_0x1719b7)['then'](function(_0x5ecaff){logger[_0x0102('0x12')](_0x0102('0x13'),_0x395e41,_0x0102('0x14'));logger['debug'](_0x0102('0x15'),_0x395e41,_0x0102('0x14'),JSON[_0x0102('0x16')](_0x5ecaff));if(_0x5ecaff['error']){if(_0x5ecaff[_0x0102('0x17')][_0x0102('0x18')]===0x1f4){logger[_0x0102('0x17')](_0x0102('0x13'),_0x395e41,_0x5ecaff[_0x0102('0x17')][_0x0102('0x19')]);return _0x3f9b4d(_0x5ecaff[_0x0102('0x17')][_0x0102('0x19')]);}logger[_0x0102('0x17')](_0x0102('0x13'),_0x395e41,_0x5ecaff[_0x0102('0x17')]['message']);return _0x4c7ffe(_0x5ecaff[_0x0102('0x17')][_0x0102('0x19')]);}else{logger[_0x0102('0x12')](_0x0102('0x13'),_0x395e41,_0x0102('0x14'));_0x4c7ffe(_0x5ecaff[_0x0102('0x1a')][_0x0102('0x19')]);}})[_0x0102('0x1b')](function(_0x400a86){logger[_0x0102('0x17')](_0x0102('0x13'),_0x395e41,_0x400a86);_0x3f9b4d(_0x400a86);});});}exports[_0x0102('0x1c')]=function(_0x4f67f9){var _0x69cd31=this;return new Promise(function(_0x123f6f,_0x2326b8){return db[_0x0102('0x1d')][_0x0102('0x1e')](_0x4f67f9[_0x0102('0x1f')],{'raw':_0x4f67f9[_0x0102('0x20')]?_0x4f67f9[_0x0102('0x20')][_0x0102('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f67f9[_0x0102('0x20')]?_0x4f67f9[_0x0102('0x20')]['where']||null:null,'attributes':_0x4f67f9[_0x0102('0x20')]?_0x4f67f9[_0x0102('0x20')][_0x0102('0x22')]||null:null,'limit':_0x4f67f9[_0x0102('0x20')]?_0x4f67f9['options'][_0x0102('0x23')]||null:null})[_0x0102('0x24')](function(_0x58796f){logger[_0x0102('0x12')]('UpdateOpenchannelInteraction',_0x4f67f9);logger['debug']('UpdateOpenchannelInteraction',_0x4f67f9,JSON['stringify'](_0x58796f));_0x123f6f(_0x58796f);})['catch'](function(_0x30ff04){logger[_0x0102('0x17')]('UpdateOpenchannelInteraction',_0x30ff04['message'],_0x4f67f9);_0x2326b8(_0x69cd31[_0x0102('0x17')](0x1f4,_0x30ff04['message']));});});};exports[_0x0102('0x25')]=function(_0x12f4c9){return new Promise(function(_0x4341ea,_0x7aa851){return db[_0x0102('0x1d')][_0x0102('0x26')]({'where':_0x12f4c9[_0x0102('0x20')]?_0x12f4c9['options']['where']||null:null})[_0x0102('0x24')](function(_0x5cfd69){if(_0x5cfd69){return _0x5cfd69[_0x0102('0x27')](_0x12f4c9[_0x0102('0x1f')][_0x0102('0x28')],_[_0x0102('0x29')](_0x12f4c9[_0x0102('0x1f')],[_0x0102('0x28'),'id'])||{});}})['spread'](function(_0x145422){logger[_0x0102('0x12')]('AddTags',_0x12f4c9);logger[_0x0102('0x2a')]('AddTags',_0x12f4c9,JSON[_0x0102('0x16')](_0x145422));_0x4341ea(_0x145422);})[_0x0102('0x1b')](function(_0x26fcf7){logger[_0x0102('0x17')](_0x0102('0x2b'),_0x26fcf7['message'],_0x12f4c9);_0x7aa851(_this[_0x0102('0x17')](0x1f4,_0x26fcf7[_0x0102('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 14f54f7..755d920 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.socket.js +++ b/server/api/openchannelInteraction/openchannelInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5130=['update','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0x5130,0x11c));var _0x0513=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0x5130[_0x43a1b8];return _0x324ecc;};'use strict';var OpenchannelInteractionEvents=require(_0x0513('0x0'));var events=[_0x0513('0x1'),_0x0513('0x2'),_0x0513('0x3')];function createListener(_0x435d92,_0x4adf97){return function(_0x4a08c4){_0x4adf97['emit'](_0x435d92,_0x4a08c4);};}function removeListener(_0xa3033a,_0x3d5b37){return function(){OpenchannelInteractionEvents['removeListener'](_0xa3033a,_0x3d5b37);};}exports[_0x0513('0x4')]=function(_0x3ec726){for(var _0x5b7537=0x0,_0x4bc5ce=events[_0x0513('0x5')];_0x5b7537<_0x4bc5ce;_0x5b7537++){var _0xdaa924=events[_0x5b7537];var _0x9a368=createListener(_0x0513('0x6')+_0xdaa924,_0x3ec726);OpenchannelInteractionEvents['on'](_0xdaa924,_0x9a368);}}; \ No newline at end of file +var _0xaf2c=['emit','removeListener','register','length','./openchannelInteraction.events','save','update'];(function(_0x473275,_0x38e69c){var _0x2fd6d3=function(_0x12622e){while(--_0x12622e){_0x473275['push'](_0x473275['shift']());}};_0x2fd6d3(++_0x38e69c);}(_0xaf2c,0x7b));var _0xcaf2=function(_0x1ecff4,_0xf76761){_0x1ecff4=_0x1ecff4-0x0;var _0x331cd0=_0xaf2c[_0x1ecff4];return _0x331cd0;};'use strict';var OpenchannelInteractionEvents=require(_0xcaf2('0x0'));var events=[_0xcaf2('0x1'),'remove',_0xcaf2('0x2')];function createListener(_0x31c36e,_0xfc5ece){return function(_0x5184f9){_0xfc5ece[_0xcaf2('0x3')](_0x31c36e,_0x5184f9);};}function removeListener(_0x8fbd68,_0x8fa7d1){return function(){OpenchannelInteractionEvents[_0xcaf2('0x4')](_0x8fbd68,_0x8fa7d1);};}exports[_0xcaf2('0x5')]=function(_0xf96d8d){for(var _0x212f5e=0x0,_0x15d82b=events[_0xcaf2('0x6')];_0x212f5e<_0x15d82b;_0x212f5e++){var _0x224a5f=events[_0x212f5e];var _0x5221e9=createListener('openchannelInteraction:'+_0x224a5f,_0xf96d8d);OpenchannelInteractionEvents['on'](_0x224a5f,_0x5221e9);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index a4fda53..6cdbe3e 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd28=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer'];(function(_0x178bf5,_0x22e980){var _0x45d274=function(_0x287d50){while(--_0x287d50){_0x178bf5['push'](_0x178bf5['shift']());}};_0x45d274(++_0x22e980);}(_0xfd28,0x19d));var _0x8fd2=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0xfd28[_0x4c4037];return _0x357862;};'use strict';var multer=require(_0x8fd2('0x0'));var util=require(_0x8fd2('0x1'));var path=require(_0x8fd2('0x2'));var timeout=require(_0x8fd2('0x3'));var express=require(_0x8fd2('0x4'));var router=express[_0x8fd2('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x8fd2('0x6'));var config=require(_0x8fd2('0x7'));var controller=require('./openchannelMessage.controller');router[_0x8fd2('0x8')]('/',auth[_0x8fd2('0x9')](),controller[_0x8fd2('0xa')]);router[_0x8fd2('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x8fd2('0xb')]);router['get'](_0x8fd2('0xc'),auth[_0x8fd2('0x9')](),controller[_0x8fd2('0xd')]);router[_0x8fd2('0xe')]('/',auth[_0x8fd2('0x9')](),interaction['tracked']('openchannel','openchannelmessage:create'),controller[_0x8fd2('0xf')]);router[_0x8fd2('0x10')](_0x8fd2('0xc'),auth[_0x8fd2('0x9')](),controller['update']);router['put'](_0x8fd2('0x11'),auth[_0x8fd2('0x9')](),controller[_0x8fd2('0x12')]);router[_0x8fd2('0x10')](_0x8fd2('0x13'),auth['isAuthenticated'](),controller['reject']);router[_0x8fd2('0x14')](_0x8fd2('0xc'),auth[_0x8fd2('0x9')](),controller[_0x8fd2('0x15')]);module[_0x8fd2('0x16')]=router; \ No newline at end of file +var _0x8d93=['/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','tracked','openchannel','openchannelmessage:create','create','put','update'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0x8d93,0xe6));var _0x38d9=function(_0x3d118a,_0xc2c0d7){_0x3d118a=_0x3d118a-0x0;var _0xbdfbf3=_0x8d93[_0x3d118a];return _0xbdfbf3;};'use strict';var multer=require(_0x38d9('0x0'));var util=require(_0x38d9('0x1'));var path=require(_0x38d9('0x2'));var timeout=require(_0x38d9('0x3'));var express=require(_0x38d9('0x4'));var router=express[_0x38d9('0x5')]();var auth=require(_0x38d9('0x6'));var interaction=require(_0x38d9('0x7'));var config=require(_0x38d9('0x8'));var controller=require(_0x38d9('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x38d9('0xa')]);router[_0x38d9('0xb')](_0x38d9('0xc'),auth[_0x38d9('0xd')](),controller[_0x38d9('0xe')]);router[_0x38d9('0xb')](_0x38d9('0xf'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x38d9('0xd')](),interaction[_0x38d9('0x10')](_0x38d9('0x11'),_0x38d9('0x12')),controller[_0x38d9('0x13')]);router[_0x38d9('0x14')](_0x38d9('0xf'),auth[_0x38d9('0xd')](),controller[_0x38d9('0x15')]);router['put'](_0x38d9('0x16'),auth[_0x38d9('0xd')](),controller[_0x38d9('0x17')]);router[_0x38d9('0x14')]('/:id/reject',auth[_0x38d9('0xd')](),controller[_0x38d9('0x18')]);router[_0x38d9('0x19')](_0x38d9('0xf'),auth['isAuthenticated'](),controller[_0x38d9('0x1a')]);module[_0x38d9('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 7347f79..bfe3259 100644 --- a/server/api/openchannelMessage/openchannelMessage.attributes.js +++ b/server/api/openchannelMessage/openchannelMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x660b=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x819e48,_0x430040){var _0x522d4a=function(_0x1bb24f){while(--_0x1bb24f){_0x819e48['push'](_0x819e48['shift']());}};_0x522d4a(++_0x430040);}(_0x660b,0x140));var _0xb660=function(_0x42018f,_0xb1a5fd){_0x42018f=_0x42018f-0x0;var _0x4f44f4=_0x660b[_0x42018f];return _0x4f44f4;};'use strict';var Sequelize=require(_0xb660('0x0'));module[_0xb660('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb660('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb660('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb660('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb660('0x4')]('in',_0xb660('0x5')),'defaultValue':_0xb660('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb660('0x6')]}}; \ No newline at end of file +var _0x2d1c=['sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x4a6f55,_0x41086b){var _0x1ee15a=function(_0x2d8851){while(--_0x2d8851){_0x4a6f55['push'](_0x4a6f55['shift']());}};_0x1ee15a(++_0x41086b);}(_0x2d1c,0x1dc));var _0xc2d1=function(_0xb4f979,_0x57ef4b){_0xb4f979=_0xb4f979-0x0;var _0x3e3bd8=_0x2d1c[_0xb4f979];return _0x3e3bd8;};'use strict';var Sequelize=require(_0xc2d1('0x0'));module[_0xc2d1('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc2d1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc2d1('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc2d1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc2d1('0x4')]('in',_0xc2d1('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xc2d1('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 44a4053..7da15cc 100644 --- a/server/api/openchannelMessage/openchannelMessage.controller.js +++ b/server/api/openchannelMessage/openchannelMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd08a=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelMessage.socket','register','jayson/promise','http','client','test','request','then','info','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','type','key','merge','options','include','rows','keys','create','body','params','find','describe','openchannel-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','OpenchannelInteraction','isNil','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','reject','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface'];(function(_0x5c6289,_0x4a6832){var _0x33fa33=function(_0x247d05){while(--_0x247d05){_0x5c6289['push'](_0x5c6289['shift']());}};_0x33fa33(++_0x4a6832);}(_0xd08a,0xea));var _0xad08=function(_0x30860a,_0x1b62ad){_0x30860a=_0x30860a-0x0;var _0x3a7edb=_0xd08a[_0x30860a];return _0x3a7edb;};'use strict';var pdf=require(_0xad08('0x0'));var emlformat=require(_0xad08('0x1'));var rimraf=require(_0xad08('0x2'));var zipdir=require(_0xad08('0x3'));var jsonpatch=require(_0xad08('0x4'));var rp=require(_0xad08('0x5'));var moment=require(_0xad08('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xad08('0x7'));var util=require(_0xad08('0x8'));var path=require(_0xad08('0x9'));var sox=require(_0xad08('0xa'));var csv=require(_0xad08('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xad08('0xc'));var squel=require(_0xad08('0xd'));var crypto=require(_0xad08('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xad08('0xf'));var toCsv=require(_0xad08('0xb'));var querystring=require(_0xad08('0x10'));var Papa=require(_0xad08('0x11'));var Redis=require(_0xad08('0x12'));var authService=require(_0xad08('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xad08('0x14'));var logger=require(_0xad08('0x15'))('api');var utils=require(_0xad08('0x16'));var config=require('../../config/environment');var db=require(_0xad08('0x17'))['db'];config['redis']=_[_0xad08('0x18')](config['redis'],{'host':_0xad08('0x19'),'port':0x18eb});var socket=require(_0xad08('0x1a'))(new Redis(config[_0xad08('0x1b')]));require(_0xad08('0x1c'))[_0xad08('0x1d')](socket);var jayson=require(_0xad08('0x1e'));var client=jayson['client'][_0xad08('0x1f')]({'port':0x232c});var client9002=jayson[_0xad08('0x20')][_0xad08('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x515f28,_0x4844cd,_0x418fc7){if(_0x418fc7){var _0x2ae586=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ae586[_0xad08('0x21')](_0x4844cd)){return _0x515f28;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x515f28;}}function respondWithRpcPromise(_0x22c017,_0x53ab25,_0x2dbb61,_0x466ed3){return new BPromise(function(_0x56da44,_0x2f292e){var _0xfac0=_0x466ed3||client;return _0xfac0[_0xad08('0x22')](_0x22c017,_0x2dbb61)[_0xad08('0x23')](function(_0x5af7da){logger[_0xad08('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x53ab25,_0xad08('0x25'));logger['debug'](_0xad08('0x26'),_0x53ab25,_0xad08('0x25'),JSON[_0xad08('0x27')](_0x5af7da));if(_0x5af7da['error']){if(_0x5af7da[_0xad08('0x28')][_0xad08('0x29')]===0x1f4){logger[_0xad08('0x28')](_0xad08('0x2a'),_0x53ab25,_0x5af7da[_0xad08('0x28')][_0xad08('0x2b')]);return _0x2f292e(_0x5af7da[_0xad08('0x28')][_0xad08('0x2b')]);}logger[_0xad08('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x53ab25,_0x5af7da[_0xad08('0x28')][_0xad08('0x2b')]);return _0x56da44(_0x5af7da['error'][_0xad08('0x2b')]);}else{logger['info'](_0xad08('0x2a'),_0x53ab25,_0xad08('0x25'));_0x56da44(_0x5af7da[_0xad08('0x2c')]['message']);}})[_0xad08('0x2d')](function(_0x465107){logger[_0xad08('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x53ab25,_0x465107);_0x2f292e(_0x465107);});});}function respondWithStatusCode(_0x2eec27,_0x57f57a){_0x57f57a=_0x57f57a||0xcc;return function(_0x50f1e1){if(_0x50f1e1){return _0x2eec27[_0xad08('0x2e')](_0x57f57a);}return _0x2eec27[_0xad08('0x2f')](_0x57f57a)[_0xad08('0x30')]();};}function respondWithResult(_0x2f0043,_0x355a4a){_0x355a4a=_0x355a4a||0xc8;return function(_0x5cb500){if(_0x5cb500){return _0x2f0043[_0xad08('0x2f')](_0x355a4a)[_0xad08('0x31')](_0x5cb500);}};}function respondWithFilteredResult(_0x539f51,_0x6e6ce0){return function(_0x50a960){if(_0x50a960){var _0x3eb44e=_0x50a960[_0xad08('0x32')],_0x3c241f=_0x6e6ce0[_0xad08('0x33')],_0x4e0512=_0x6e6ce0[_0xad08('0x33')]+_0x6e6ce0[_0xad08('0x34')],_0x1fde58;if(_0x4e0512>=_0x3eb44e){_0x4e0512=_0x3eb44e;_0x1fde58=0xc8;}else{_0x1fde58=0xce;}_0x539f51[_0xad08('0x2f')](_0x1fde58);return _0x539f51['set'](_0xad08('0x35'),_0x3c241f+'-'+_0x4e0512+'/'+_0x3eb44e)['json'](_0x50a960);}return null;};}function patchUpdates(_0x541219){return function(_0x3e1b6e){try{jsonpatch[_0xad08('0x36')](_0x3e1b6e,_0x541219,!![]);}catch(_0x1bbead){return BPromise['reject'](_0x1bbead);}return _0x3e1b6e[_0xad08('0x37')]();};}function saveUpdates(_0x3e1e70,_0x2a1631){return function(_0x21d606){if(_0x21d606){return _0x21d606[_0xad08('0x38')](_0x3e1e70)['then'](function(_0xbf8511){return _0xbf8511;});}return null;};}function removeEntity(_0x5d7a70,_0x530ca2){return function(_0x311836){if(_0x311836){return _0x311836[_0xad08('0x39')]()['then'](function(){_0x5d7a70[_0xad08('0x2f')](0xcc)[_0xad08('0x30')]();});}};}function handleEntityNotFound(_0x1bc01e,_0x2d95da){return function(_0x1680c3){if(!_0x1680c3){_0x1bc01e[_0xad08('0x2e')](0x194);}return _0x1680c3;};}function handleError(_0xfc4ae6,_0x3a284e){_0x3a284e=_0x3a284e||0x1f4;return function(_0x31b489){logger['error'](_0x31b489[_0xad08('0x3a')]);if(_0x31b489[_0xad08('0x3b')]){delete _0x31b489['name'];}_0xfc4ae6[_0xad08('0x2f')](_0x3a284e)[_0xad08('0x3c')](_0x31b489);};}exports[_0xad08('0x3d')]=function(_0x3a8920,_0x55e8dc){var _0x67c171={},_0x3f6aed={},_0x4ed9c3={'count':0x0,'rows':[]};var _0x1f6501=db[_0xad08('0x3e')][_0xad08('0x3f')];_0x3f6aed[_0xad08('0x40')]=_['keys'](_0x1f6501);_0x3f6aed[_0xad08('0x41')]=_['keys'](_0x3a8920['query']);_0x3f6aed[_0xad08('0x42')]=_['intersection'](_0x3f6aed[_0xad08('0x40')],_0x3f6aed[_0xad08('0x41')]);_0x67c171['attributes']=_[_0xad08('0x43')](_0x3f6aed[_0xad08('0x40')],qs[_0xad08('0x44')](_0x3a8920[_0xad08('0x41')][_0xad08('0x44')]));_0x67c171[_0xad08('0x45')]=_0x67c171[_0xad08('0x45')][_0xad08('0x46')]?_0x67c171['attributes']:_0x3f6aed['model'];if(!_0x3a8920[_0xad08('0x41')]['hasOwnProperty'](_0xad08('0x47'))){_0x67c171['limit']=qs[_0xad08('0x34')](_0x3a8920[_0xad08('0x41')]['limit']);_0x67c171['offset']=qs[_0xad08('0x33')](_0x3a8920[_0xad08('0x41')][_0xad08('0x33')]);}_0x67c171[_0xad08('0x48')]=qs[_0xad08('0x49')](_0x3a8920[_0xad08('0x41')]['sort']);_0x67c171['where']=qs['filters'](_[_0xad08('0x4a')](_0x3a8920[_0xad08('0x41')],_0x3f6aed['filters']));if(_0x3a8920[_0xad08('0x41')][_0xad08('0x4b')]){_0x67c171['where']=_['merge'](_0x67c171[_0xad08('0x4c')],{'$or':_['map'](_0x1f6501,function(_0x2d721d){if(_0x2d721d[_0xad08('0x4d')][_0xad08('0x4e')]!=='VIRTUAL'){var _0x23bf09={};_0x23bf09[_0x2d721d['field']]={'$like':'%'+_0x3a8920[_0xad08('0x41')]['filter']+'%'};return _0x23bf09;}})});}_0x67c171=_[_0xad08('0x4f')]({},_0x67c171,_0x3a8920[_0xad08('0x50')]);var _0x4da773={'where':_0x67c171['where']};return db[_0xad08('0x3e')][_0xad08('0x32')](_0x4da773)[_0xad08('0x23')](function(_0x3c069){_0x4ed9c3['count']=_0x3c069;if(_0x3a8920[_0xad08('0x41')]['includeAll']){_0x67c171[_0xad08('0x51')]=[{'all':!![]}];}return db[_0xad08('0x3e')]['findAll'](_0x67c171);})[_0xad08('0x23')](function(_0x49f53d){_0x4ed9c3[_0xad08('0x52')]=_0x49f53d;return _0x4ed9c3;})['then'](respondWithFilteredResult(_0x55e8dc,_0x67c171))[_0xad08('0x2d')](handleError(_0x55e8dc,null));};exports['show']=function(_0x3b6c1f,_0x113418){var _0x3cd7eb={'raw':!![],'where':{'id':_0x3b6c1f['params']['id']}},_0x2519e7={};_0x2519e7['model']=_[_0xad08('0x53')](db[_0xad08('0x3e')][_0xad08('0x3f')]);_0x2519e7[_0xad08('0x41')]=_[_0xad08('0x53')](_0x3b6c1f[_0xad08('0x41')]);_0x2519e7[_0xad08('0x42')]=_[_0xad08('0x43')](_0x2519e7[_0xad08('0x40')],_0x2519e7[_0xad08('0x41')]);_0x3cd7eb[_0xad08('0x45')]=_[_0xad08('0x43')](_0x2519e7[_0xad08('0x40')],qs['fields'](_0x3b6c1f[_0xad08('0x41')][_0xad08('0x44')]));_0x3cd7eb[_0xad08('0x45')]=_0x3cd7eb[_0xad08('0x45')][_0xad08('0x46')]?_0x3cd7eb['attributes']:_0x2519e7[_0xad08('0x40')];if(_0x3b6c1f[_0xad08('0x41')]['includeAll']){_0x3cd7eb[_0xad08('0x51')]=[{'all':!![]}];}_0x3cd7eb=_[_0xad08('0x4f')]({},_0x3cd7eb,_0x3b6c1f[_0xad08('0x50')]);return db[_0xad08('0x3e')]['find'](_0x3cd7eb)[_0xad08('0x23')](handleEntityNotFound(_0x113418,null))[_0xad08('0x23')](respondWithResult(_0x113418,null))['catch'](handleError(_0x113418,null));};exports[_0xad08('0x54')]=function(_0x10d215,_0x1531ce){return db['OpenchannelMessage'][_0xad08('0x54')](_0x10d215[_0xad08('0x55')],{})[_0xad08('0x23')](respondWithResult(_0x1531ce,0xc9))['catch'](handleError(_0x1531ce,null));};exports[_0xad08('0x38')]=function(_0x1a6b88,_0x14f32b){if(_0x1a6b88['body']['id']){delete _0x1a6b88['body']['id'];}return db[_0xad08('0x3e')]['find']({'where':{'id':_0x1a6b88[_0xad08('0x56')]['id']}})[_0xad08('0x23')](handleEntityNotFound(_0x14f32b,null))[_0xad08('0x23')](saveUpdates(_0x1a6b88[_0xad08('0x55')],null))[_0xad08('0x23')](respondWithResult(_0x14f32b,null))['catch'](handleError(_0x14f32b,null));};exports[_0xad08('0x39')]=function(_0x325560,_0x48e783){return db['OpenchannelMessage'][_0xad08('0x57')]({'where':{'id':_0x325560[_0xad08('0x56')]['id']}})['then'](handleEntityNotFound(_0x48e783,null))[_0xad08('0x23')](removeEntity(_0x48e783,null))['catch'](handleError(_0x48e783,null));};exports[_0xad08('0x58')]=function(_0x135e07,_0x53c50a){return db['OpenchannelMessage']['describe']()[_0xad08('0x23')](respondWithResult(_0x53c50a,null))[_0xad08('0x2d')](handleError(_0x53c50a,null));};var interaction_log=require('../../config/logger')(_0xad08('0x59'));exports['accept']=function(_0x1d2640,_0x2fe330,_0x105d24){var _0x4954fd={'channel':'openchannel'};if(_0x1d2640[_0xad08('0x55')]['id']){delete _0x1d2640[_0xad08('0x55')]['id'];}_0x1d2640[_0xad08('0x55')][_0xad08('0x5a')]=!![];_0x1d2640[_0xad08('0x55')][_0xad08('0x5b')]=moment()['format'](_0xad08('0x5c'));_0x1d2640[_0xad08('0x55')][_0xad08('0x5d')]=_0x1d2640[_0xad08('0x55')][_0xad08('0x5d')]||_0x1d2640['user']['id'];return db[_0xad08('0x3e')][_0xad08('0x57')]({'where':{'id':_0x1d2640[_0xad08('0x56')]['id'],'UserId':null},'include':[{'model':db[_0xad08('0x5e')],'as':_0xad08('0x5f')}]})[_0xad08('0x23')](handleEntityNotFound(_0x2fe330,null))[_0xad08('0x23')](saveUpdates(_0x1d2640['body'],null))[_0xad08('0x23')](function(_0x44c309){if(_0x44c309){_0x4954fd[_0xad08('0x2b')]=_0x44c309[_0xad08('0x60')]({'plain':!![]});return db[_0xad08('0x61')][_0xad08('0x57')]({'where':{'id':_0x44c309['OpenchannelInteractionId']}});}return null;})[_0xad08('0x23')](handleEntityNotFound(_0x2fe330,null))[_0xad08('0x23')](function(_0x12d862){if(_0x12d862){return _0x12d862[_0xad08('0x38')]({'UserId':_0x1d2640[_0xad08('0x55')][_0xad08('0x5d')],'read1stAt':_[_0xad08('0x62')](_0x12d862[_0xad08('0x63')])?moment()[_0xad08('0x64')](_0xad08('0x5c')):undefined});}return null;})[_0xad08('0x23')](function(_0xc02f6c){if(_0xc02f6c){_0x4954fd[_0xad08('0x65')]=_0xc02f6c[_0xad08('0x60')]({'plain':!![]});interaction_log[_0xad08('0x24')](_0xad08('0x66'),_0x1d2640[_0xad08('0x67')]['id'],_0x1d2640[_0xad08('0x67')]['name'],_0x1d2640[_0xad08('0x67')]['role'],_0x4954fd[_0xad08('0x65')]['id'],_0x1d2640['body']?JSON['stringify'](_0x1d2640[_0xad08('0x55')]):'null');return respondWithRpcPromise(_0xad08('0x68'),_0xad08('0x69'),_0x4954fd);}return null;})[_0xad08('0x23')](function(_0x42d2c8){if(_0x42d2c8){if(_0x1d2640[_0xad08('0x55')][_0xad08('0x6a')]){_0x4954fd[_0xad08('0x2b')]['interface']=util[_0xad08('0x64')](_0xad08('0x6b'),_0x1d2640[_0xad08('0x67')][_0xad08('0x3b')]);_0x4954fd[_0xad08('0x2b')][_0xad08('0x6c')]=_0x4954fd[_0xad08('0x6c')];_0x4954fd[_0xad08('0x2b')][_0xad08('0x6d')]='accept';return respondWithRpcPromise(_0xad08('0x6e'),_0xad08('0x6e'),{'event':'acceptmessage','message':_0x4954fd[_0xad08('0x2b')]},client9002)['then'](function(){return _0x4954fd;});}return _0x4954fd;}return null;})['then'](respondWithResult(_0x2fe330,null))[_0xad08('0x2d')](handleError(_0x2fe330,null));};var interaction_log=require('../../config/logger')(_0xad08('0x59'));exports[_0xad08('0x6f')]=function(_0x22a368,_0x313277,_0x57472f){var _0x458b95={'agent':{},'channel':'openchannel'};if(_0x22a368[_0xad08('0x55')]['id']){delete _0x22a368[_0xad08('0x55')]['id'];}_0x22a368[_0xad08('0x55')][_0xad08('0x5d')]=_0x22a368[_0xad08('0x55')][_0xad08('0x5d')]||_0x22a368['user']['id'];_0x458b95['agent']['id']=_0x22a368[_0xad08('0x55')][_0xad08('0x5d')];return db[_0xad08('0x3e')][_0xad08('0x57')]({'where':{'id':_0x22a368[_0xad08('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x313277,null))[_0xad08('0x23')](function(_0x263dc6){if(_0x263dc6){_0x458b95['message']=_0x263dc6[_0xad08('0x60')]({'plain':!![]});return db[_0xad08('0x61')][_0xad08('0x57')]({'where':{'id':_0x263dc6[_0xad08('0x70')]}});}return null;})['then'](handleEntityNotFound(_0x313277,null))[_0xad08('0x23')](function(_0xe8f7a){if(_0xe8f7a){_0x458b95['interaction']=_0xe8f7a['get']({'plain':!![]});interaction_log[_0xad08('0x24')](_0xad08('0x71'),_0x22a368[_0xad08('0x67')]['id'],_0x22a368['user'][_0xad08('0x3b')],_0x22a368['user']['role'],_0x458b95[_0xad08('0x65')]['id'],_0x22a368[_0xad08('0x55')]?JSON['stringify'](_0x22a368[_0xad08('0x55')]):'null');return respondWithRpcPromise(_0xad08('0x72'),_0xad08('0x73'),_0x458b95);}return null;})[_0xad08('0x23')](function(_0x23c362){if(_0x23c362){_0x23c362['message'][_0xad08('0x74')]=util[_0xad08('0x64')](_0xad08('0x6b'),_0x22a368['user'][_0xad08('0x3b')]);_0x23c362[_0xad08('0x2b')]['channel']=_0x458b95['channel'];_0x23c362[_0xad08('0x2b')][_0xad08('0x6d')]=_0xad08('0x6f');respondWithRpcPromise('EventManager',_0xad08('0x6e'),{'event':'rejectmessage','message':_0x23c362[_0xad08('0x2b')]},client9002);return _0x458b95;}return null;})[_0xad08('0x23')](respondWithResult(_0x313277,null))['catch'](handleError(_0x313277,null));}; \ No newline at end of file +var _0x5c68=['attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','findAll','rows','params','length','include','find','create','body','catch','update','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','rejectmessage','html-pdf','rimraf','zip-dir','request-promise','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','json','count','offset','set','Content-Range','reject','save','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','keys','query','filters','intersection'];(function(_0x3c062d,_0x2328a6){var _0x2552bb=function(_0x56e864){while(--_0x56e864){_0x3c062d['push'](_0x3c062d['shift']());}};_0x2552bb(++_0x2328a6);}(_0x5c68,0x133));var _0x85c6=function(_0x33c26b,_0x109f10){_0x33c26b=_0x33c26b-0x0;var _0x54a7a5=_0x5c68[_0x33c26b];return _0x54a7a5;};'use strict';var pdf=require(_0x85c6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x85c6('0x1'));var zipdir=require(_0x85c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x85c6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x85c6('0x4'));var path=require('path');var sox=require(_0x85c6('0x5'));var csv=require('to-csv');var ejs=require(_0x85c6('0x6'));var fs=require('fs');var _=require(_0x85c6('0x7'));var squel=require(_0x85c6('0x8'));var crypto=require(_0x85c6('0x9'));var jsforce=require(_0x85c6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x85c6('0xb'));var querystring=require(_0x85c6('0xc'));var Papa=require(_0x85c6('0xd'));var Redis=require(_0x85c6('0xe'));var authService=require(_0x85c6('0xf'));var qs=require(_0x85c6('0x10'));var hardwareService=require(_0x85c6('0x11'));var logger=require(_0x85c6('0x12'))(_0x85c6('0x13'));var utils=require('../../config/utils');var config=require(_0x85c6('0x14'));var db=require(_0x85c6('0x15'))['db'];config[_0x85c6('0x16')]=_[_0x85c6('0x17')](config[_0x85c6('0x16')],{'host':_0x85c6('0x18'),'port':0x18eb});var socket=require(_0x85c6('0x19'))(new Redis(config['redis']));require(_0x85c6('0x1a'))[_0x85c6('0x1b')](socket);var jayson=require(_0x85c6('0x1c'));var client=jayson[_0x85c6('0x1d')][_0x85c6('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x85c6('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x46955d,_0x4461aa,_0x12830d){if(_0x12830d){var _0x4b1743=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4b1743[_0x85c6('0x1f')](_0x4461aa)){return _0x46955d;}else{throw new Error(_0x85c6('0x20'));}}else{return _0x46955d;}}function respondWithRpcPromise(_0x48d083,_0x1c6dc4,_0x26a0a3,_0x4900a2){return new BPromise(function(_0x50df8c,_0x27a0b8){var _0x343642=_0x4900a2||client;return _0x343642[_0x85c6('0x21')](_0x48d083,_0x26a0a3)[_0x85c6('0x22')](function(_0x41847c){logger[_0x85c6('0x23')](_0x85c6('0x24'),_0x1c6dc4,_0x85c6('0x25'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x1c6dc4,_0x85c6('0x25'),JSON['stringify'](_0x41847c));if(_0x41847c[_0x85c6('0x26')]){if(_0x41847c[_0x85c6('0x26')][_0x85c6('0x27')]===0x1f4){logger[_0x85c6('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x1c6dc4,_0x41847c[_0x85c6('0x26')][_0x85c6('0x28')]);return _0x27a0b8(_0x41847c[_0x85c6('0x26')][_0x85c6('0x28')]);}logger[_0x85c6('0x26')](_0x85c6('0x24'),_0x1c6dc4,_0x41847c[_0x85c6('0x26')][_0x85c6('0x28')]);return _0x50df8c(_0x41847c[_0x85c6('0x26')][_0x85c6('0x28')]);}else{logger[_0x85c6('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x1c6dc4,'request\x20sent');_0x50df8c(_0x41847c[_0x85c6('0x29')][_0x85c6('0x28')]);}})['catch'](function(_0x604db0){logger[_0x85c6('0x26')](_0x85c6('0x24'),_0x1c6dc4,_0x604db0);_0x27a0b8(_0x604db0);});});}function respondWithStatusCode(_0x142997,_0x4c0508){_0x4c0508=_0x4c0508||0xcc;return function(_0x458579){if(_0x458579){return _0x142997[_0x85c6('0x2a')](_0x4c0508);}return _0x142997[_0x85c6('0x2b')](_0x4c0508)['end']();};}function respondWithResult(_0x49984d,_0x2963c1){_0x2963c1=_0x2963c1||0xc8;return function(_0x3a2216){if(_0x3a2216){return _0x49984d['status'](_0x2963c1)[_0x85c6('0x2c')](_0x3a2216);}};}function respondWithFilteredResult(_0x1c46ea,_0xc52c3d){return function(_0x121c3d){if(_0x121c3d){var _0x442319=_0x121c3d[_0x85c6('0x2d')],_0x313630=_0xc52c3d[_0x85c6('0x2e')],_0x442cf6=_0xc52c3d[_0x85c6('0x2e')]+_0xc52c3d['limit'],_0x3807ec;if(_0x442cf6>=_0x442319){_0x442cf6=_0x442319;_0x3807ec=0xc8;}else{_0x3807ec=0xce;}_0x1c46ea[_0x85c6('0x2b')](_0x3807ec);return _0x1c46ea[_0x85c6('0x2f')](_0x85c6('0x30'),_0x313630+'-'+_0x442cf6+'/'+_0x442319)['json'](_0x121c3d);}return null;};}function patchUpdates(_0x1cea9b){return function(_0x4c2015){try{jsonpatch['apply'](_0x4c2015,_0x1cea9b,!![]);}catch(_0x4ebe10){return BPromise[_0x85c6('0x31')](_0x4ebe10);}return _0x4c2015[_0x85c6('0x32')]();};}function saveUpdates(_0x4c39e2,_0xa3042c){return function(_0xb4e70a){if(_0xb4e70a){return _0xb4e70a['update'](_0x4c39e2)[_0x85c6('0x22')](function(_0x1309e4){return _0x1309e4;});}return null;};}function removeEntity(_0xfdc5b5,_0x132ef9){return function(_0x30e0fe){if(_0x30e0fe){return _0x30e0fe[_0x85c6('0x33')]()['then'](function(){_0xfdc5b5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x468c1a,_0x5b8eca){return function(_0x4fb7a0){if(!_0x4fb7a0){_0x468c1a[_0x85c6('0x2a')](0x194);}return _0x4fb7a0;};}function handleError(_0x5478c9,_0x61d96f){_0x61d96f=_0x61d96f||0x1f4;return function(_0x293ec2){logger[_0x85c6('0x26')](_0x293ec2[_0x85c6('0x34')]);if(_0x293ec2[_0x85c6('0x35')]){delete _0x293ec2['name'];}_0x5478c9[_0x85c6('0x2b')](_0x61d96f)[_0x85c6('0x36')](_0x293ec2);};}exports[_0x85c6('0x37')]=function(_0x169e88,_0x11dab2){var _0x42e538={},_0x4c6671={},_0x61084={'count':0x0,'rows':[]};var _0x542158=db[_0x85c6('0x38')][_0x85c6('0x39')];_0x4c6671['model']=_[_0x85c6('0x3a')](_0x542158);_0x4c6671[_0x85c6('0x3b')]=_[_0x85c6('0x3a')](_0x169e88[_0x85c6('0x3b')]);_0x4c6671[_0x85c6('0x3c')]=_[_0x85c6('0x3d')](_0x4c6671['model'],_0x4c6671[_0x85c6('0x3b')]);_0x42e538[_0x85c6('0x3e')]=_[_0x85c6('0x3d')](_0x4c6671[_0x85c6('0x3f')],qs[_0x85c6('0x40')](_0x169e88[_0x85c6('0x3b')]['fields']));_0x42e538[_0x85c6('0x3e')]=_0x42e538[_0x85c6('0x3e')]['length']?_0x42e538['attributes']:_0x4c6671[_0x85c6('0x3f')];if(!_0x169e88['query'][_0x85c6('0x41')](_0x85c6('0x42'))){_0x42e538['limit']=qs[_0x85c6('0x43')](_0x169e88[_0x85c6('0x3b')]['limit']);_0x42e538['offset']=qs['offset'](_0x169e88[_0x85c6('0x3b')][_0x85c6('0x2e')]);}_0x42e538[_0x85c6('0x44')]=qs[_0x85c6('0x45')](_0x169e88[_0x85c6('0x3b')][_0x85c6('0x45')]);_0x42e538['where']=qs[_0x85c6('0x3c')](_[_0x85c6('0x46')](_0x169e88[_0x85c6('0x3b')],_0x4c6671[_0x85c6('0x3c')]));if(_0x169e88['query'][_0x85c6('0x47')]){_0x42e538['where']=_[_0x85c6('0x48')](_0x42e538[_0x85c6('0x49')],{'$or':_[_0x85c6('0x4a')](_0x542158,function(_0x27e54a){if(_0x27e54a[_0x85c6('0x4b')][_0x85c6('0x4c')]!==_0x85c6('0x4d')){var _0x296abc={};_0x296abc[_0x27e54a['field']]={'$like':'%'+_0x169e88[_0x85c6('0x3b')][_0x85c6('0x47')]+'%'};return _0x296abc;}})});}_0x42e538=_[_0x85c6('0x48')]({},_0x42e538,_0x169e88[_0x85c6('0x4e')]);var _0x51babc={'where':_0x42e538[_0x85c6('0x49')]};return db['OpenchannelMessage'][_0x85c6('0x2d')](_0x51babc)[_0x85c6('0x22')](function(_0x2cbd0c){_0x61084[_0x85c6('0x2d')]=_0x2cbd0c;if(_0x169e88[_0x85c6('0x3b')][_0x85c6('0x4f')]){_0x42e538['include']=[{'all':!![]}];}return db[_0x85c6('0x38')][_0x85c6('0x50')](_0x42e538);})[_0x85c6('0x22')](function(_0x34a52f){_0x61084[_0x85c6('0x51')]=_0x34a52f;return _0x61084;})[_0x85c6('0x22')](respondWithFilteredResult(_0x11dab2,_0x42e538))['catch'](handleError(_0x11dab2,null));};exports['show']=function(_0x6a61ee,_0x2e9def){var _0x553b04={'raw':!![],'where':{'id':_0x6a61ee[_0x85c6('0x52')]['id']}},_0x3c70b3={};_0x3c70b3['model']=_[_0x85c6('0x3a')](db['OpenchannelMessage'][_0x85c6('0x39')]);_0x3c70b3[_0x85c6('0x3b')]=_['keys'](_0x6a61ee[_0x85c6('0x3b')]);_0x3c70b3[_0x85c6('0x3c')]=_[_0x85c6('0x3d')](_0x3c70b3['model'],_0x3c70b3[_0x85c6('0x3b')]);_0x553b04[_0x85c6('0x3e')]=_[_0x85c6('0x3d')](_0x3c70b3[_0x85c6('0x3f')],qs[_0x85c6('0x40')](_0x6a61ee[_0x85c6('0x3b')]['fields']));_0x553b04['attributes']=_0x553b04[_0x85c6('0x3e')][_0x85c6('0x53')]?_0x553b04['attributes']:_0x3c70b3[_0x85c6('0x3f')];if(_0x6a61ee[_0x85c6('0x3b')]['includeAll']){_0x553b04[_0x85c6('0x54')]=[{'all':!![]}];}_0x553b04=_[_0x85c6('0x48')]({},_0x553b04,_0x6a61ee[_0x85c6('0x4e')]);return db[_0x85c6('0x38')][_0x85c6('0x55')](_0x553b04)['then'](handleEntityNotFound(_0x2e9def,null))[_0x85c6('0x22')](respondWithResult(_0x2e9def,null))['catch'](handleError(_0x2e9def,null));};exports['create']=function(_0x41ec0b,_0x336d4c){return db[_0x85c6('0x38')][_0x85c6('0x56')](_0x41ec0b[_0x85c6('0x57')],{})[_0x85c6('0x22')](respondWithResult(_0x336d4c,0xc9))[_0x85c6('0x58')](handleError(_0x336d4c,null));};exports[_0x85c6('0x59')]=function(_0x4796b4,_0x11dbca){if(_0x4796b4[_0x85c6('0x57')]['id']){delete _0x4796b4[_0x85c6('0x57')]['id'];}return db[_0x85c6('0x38')][_0x85c6('0x55')]({'where':{'id':_0x4796b4['params']['id']}})[_0x85c6('0x22')](handleEntityNotFound(_0x11dbca,null))[_0x85c6('0x22')](saveUpdates(_0x4796b4[_0x85c6('0x57')],null))[_0x85c6('0x22')](respondWithResult(_0x11dbca,null))['catch'](handleError(_0x11dbca,null));};exports['destroy']=function(_0x2d7ad7,_0x5860fe){return db[_0x85c6('0x38')]['find']({'where':{'id':_0x2d7ad7[_0x85c6('0x52')]['id']}})[_0x85c6('0x22')](handleEntityNotFound(_0x5860fe,null))[_0x85c6('0x22')](removeEntity(_0x5860fe,null))[_0x85c6('0x58')](handleError(_0x5860fe,null));};exports[_0x85c6('0x5a')]=function(_0x145add,_0x18e2ae){return db[_0x85c6('0x38')][_0x85c6('0x5a')]()[_0x85c6('0x22')](respondWithResult(_0x18e2ae,null))[_0x85c6('0x58')](handleError(_0x18e2ae,null));};var interaction_log=require(_0x85c6('0x12'))(_0x85c6('0x5b'));exports[_0x85c6('0x5c')]=function(_0x53b86c,_0x3e677d,_0x4857e5){var _0x4b36bf={'channel':_0x85c6('0x5d')};if(_0x53b86c['body']['id']){delete _0x53b86c[_0x85c6('0x57')]['id'];}_0x53b86c[_0x85c6('0x57')][_0x85c6('0x5e')]=!![];_0x53b86c[_0x85c6('0x57')][_0x85c6('0x5f')]=moment()[_0x85c6('0x60')](_0x85c6('0x61'));_0x53b86c['body'][_0x85c6('0x62')]=_0x53b86c['body'][_0x85c6('0x62')]||_0x53b86c[_0x85c6('0x63')]['id'];return db[_0x85c6('0x38')][_0x85c6('0x55')]({'where':{'id':_0x53b86c[_0x85c6('0x52')]['id'],'UserId':null},'include':[{'model':db[_0x85c6('0x64')],'as':_0x85c6('0x65')}]})['then'](handleEntityNotFound(_0x3e677d,null))[_0x85c6('0x22')](saveUpdates(_0x53b86c[_0x85c6('0x57')],null))[_0x85c6('0x22')](function(_0x114c88){if(_0x114c88){_0x4b36bf['message']=_0x114c88[_0x85c6('0x66')]({'plain':!![]});return db[_0x85c6('0x67')]['find']({'where':{'id':_0x114c88[_0x85c6('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x3e677d,null))[_0x85c6('0x22')](function(_0x3263df){if(_0x3263df){return _0x3263df[_0x85c6('0x59')]({'UserId':_0x53b86c[_0x85c6('0x57')]['UserId'],'read1stAt':_['isNil'](_0x3263df[_0x85c6('0x69')])?moment()[_0x85c6('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x85c6('0x22')](function(_0x423b9f){if(_0x423b9f){_0x4b36bf[_0x85c6('0x6a')]=_0x423b9f[_0x85c6('0x66')]({'plain':!![]});interaction_log[_0x85c6('0x23')](_0x85c6('0x6b'),_0x53b86c['user']['id'],_0x53b86c[_0x85c6('0x63')][_0x85c6('0x35')],_0x53b86c[_0x85c6('0x63')][_0x85c6('0x6c')],_0x4b36bf[_0x85c6('0x6a')]['id'],_0x53b86c[_0x85c6('0x57')]?JSON['stringify'](_0x53b86c[_0x85c6('0x57')]):_0x85c6('0x6d'));return respondWithRpcPromise(_0x85c6('0x6e'),'acceptMessage',_0x4b36bf);}return null;})[_0x85c6('0x22')](function(_0x2a538f){if(_0x2a538f){if(_0x53b86c[_0x85c6('0x57')]['manual']){_0x4b36bf[_0x85c6('0x28')][_0x85c6('0x6f')]=util[_0x85c6('0x60')](_0x85c6('0x70'),_0x53b86c[_0x85c6('0x63')][_0x85c6('0x35')]);_0x4b36bf['message']['channel']=_0x4b36bf[_0x85c6('0x71')];_0x4b36bf[_0x85c6('0x28')][_0x85c6('0x72')]=_0x85c6('0x5c');return respondWithRpcPromise('EventManager',_0x85c6('0x73'),{'event':_0x85c6('0x74'),'message':_0x4b36bf[_0x85c6('0x28')]},client9002)['then'](function(){return _0x4b36bf;});}return _0x4b36bf;}return null;})[_0x85c6('0x22')](respondWithResult(_0x3e677d,null))[_0x85c6('0x58')](handleError(_0x3e677d,null));};var interaction_log=require(_0x85c6('0x12'))(_0x85c6('0x5b'));exports[_0x85c6('0x31')]=function(_0x2d5ca0,_0x2ba43a,_0xee1278){var _0x1db900={'agent':{},'channel':_0x85c6('0x5d')};if(_0x2d5ca0[_0x85c6('0x57')]['id']){delete _0x2d5ca0['body']['id'];}_0x2d5ca0[_0x85c6('0x57')]['UserId']=_0x2d5ca0[_0x85c6('0x57')][_0x85c6('0x62')]||_0x2d5ca0[_0x85c6('0x63')]['id'];_0x1db900[_0x85c6('0x75')]['id']=_0x2d5ca0[_0x85c6('0x57')][_0x85c6('0x62')];return db[_0x85c6('0x38')][_0x85c6('0x55')]({'where':{'id':_0x2d5ca0[_0x85c6('0x52')]['id'],'UserId':null}})[_0x85c6('0x22')](handleEntityNotFound(_0x2ba43a,null))[_0x85c6('0x22')](function(_0x58fb68){if(_0x58fb68){_0x1db900[_0x85c6('0x28')]=_0x58fb68[_0x85c6('0x66')]({'plain':!![]});return db[_0x85c6('0x67')]['find']({'where':{'id':_0x58fb68[_0x85c6('0x68')]}});}return null;})[_0x85c6('0x22')](handleEntityNotFound(_0x2ba43a,null))[_0x85c6('0x22')](function(_0x3dccec){if(_0x3dccec){_0x1db900['interaction']=_0x3dccec['get']({'plain':!![]});interaction_log[_0x85c6('0x23')](_0x85c6('0x76'),_0x2d5ca0[_0x85c6('0x63')]['id'],_0x2d5ca0[_0x85c6('0x63')]['name'],_0x2d5ca0['user']['role'],_0x1db900['interaction']['id'],_0x2d5ca0[_0x85c6('0x57')]?JSON[_0x85c6('0x77')](_0x2d5ca0[_0x85c6('0x57')]):_0x85c6('0x6d'));return respondWithRpcPromise(_0x85c6('0x78'),_0x85c6('0x79'),_0x1db900);}return null;})[_0x85c6('0x22')](function(_0x575965){if(_0x575965){_0x575965['message'][_0x85c6('0x6f')]=util['format']('SIP/%s',_0x2d5ca0[_0x85c6('0x63')][_0x85c6('0x35')]);_0x575965[_0x85c6('0x28')][_0x85c6('0x71')]=_0x1db900[_0x85c6('0x71')];_0x575965[_0x85c6('0x28')]['event']='reject';respondWithRpcPromise(_0x85c6('0x73'),_0x85c6('0x73'),{'event':_0x85c6('0x7a'),'message':_0x575965[_0x85c6('0x28')]},client9002);return _0x1db900;}return null;})[_0x85c6('0x22')](respondWithResult(_0x2ba43a,null))['catch'](handleError(_0x2ba43a,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 81c2d74..7b802a0 100644 --- a/server/api/openchannelMessage/openchannelMessage.events.js +++ b/server/api/openchannelMessage/openchannelMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f8b=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x2c5339,_0xaa98e5){var _0x985d7d=function(_0x55d5ed){while(--_0x55d5ed){_0x2c5339['push'](_0x2c5339['shift']());}};_0x985d7d(++_0xaa98e5);}(_0x1f8b,0x15a));var _0xb1f8=function(_0x5bb0c8,_0x5bbfd8){_0x5bb0c8=_0x5bb0c8-0x0;var _0x56c41c=_0x1f8b[_0x5bb0c8];return _0x56c41c;};'use strict';var EventEmitter=require(_0xb1f8('0x0'));var OpenchannelMessage=require(_0xb1f8('0x1'))['db'][_0xb1f8('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xb1f8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb1f8('0x4'),'afterDestroy':_0xb1f8('0x5')};function emitEvent(_0x26a495){return function(_0x173d1b,_0x1426fe,_0x54cc6a){OpenchannelMessageEvents[_0xb1f8('0x6')](_0x26a495+':'+_0x173d1b['id'],_0x173d1b);OpenchannelMessageEvents['emit'](_0x26a495,_0x173d1b);_0x54cc6a(null);};}for(var e in events){if(events[_0xb1f8('0x7')](e)){var event=events[e];OpenchannelMessage[_0xb1f8('0x8')](e,emitEvent(event));}}module[_0xb1f8('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x7348=['remove','emit','hasOwnProperty','hook','events','setMaxListeners','save','update'];(function(_0x4ac761,_0x228735){var _0x4de38d=function(_0x430d65){while(--_0x430d65){_0x4ac761['push'](_0x4ac761['shift']());}};_0x4de38d(++_0x228735);}(_0x7348,0x1b4));var _0x8734=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7348[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x8734('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8734('0x1')](0x0);var events={'afterCreate':_0x8734('0x2'),'afterUpdate':_0x8734('0x3'),'afterDestroy':_0x8734('0x4')};function emitEvent(_0x1c931b){return function(_0x429e2f,_0x5ce3b7,_0x6ceeb){OpenchannelMessageEvents[_0x8734('0x5')](_0x1c931b+':'+_0x429e2f['id'],_0x429e2f);OpenchannelMessageEvents[_0x8734('0x5')](_0x1c931b,_0x429e2f);_0x6ceeb(null);};}for(var e in events){if(events[_0x8734('0x6')](e)){var event=events[e];OpenchannelMessage[_0x8734('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index e151543..e72ac3d 100644 --- a/server/api/openchannelMessage/openchannelMessage.model.js +++ b/server/api/openchannelMessage/openchannelMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa195=['api','moment','bluebird','path','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','then','update','createdAt','error','secret','CmContact','find','Interactions','OpenchannelInteractionId','Contact','keys','get','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','threadId','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x308c6a,_0xe04d64){var _0x257b4d=function(_0x31125c){while(--_0x31125c){_0x308c6a['push'](_0x308c6a['shift']());}};_0x257b4d(++_0xe04d64);}(_0xa195,0x8a));var _0x5a19=function(_0x4a2686,_0x1babf1){_0x4a2686=_0x4a2686-0x0;var _0x4f7fba=_0xa195[_0x4a2686];return _0x4f7fba;};'use strict';var _=require(_0x5a19('0x0'));var util=require(_0x5a19('0x1'));var logger=require(_0x5a19('0x2'))(_0x5a19('0x3'));var moment=require(_0x5a19('0x4'));var BPromise=require(_0x5a19('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a19('0x6'));var rimraf=require('rimraf');var config=require(_0x5a19('0x7'));var attributes=require(_0x5a19('0x8'));module['exports']=function(_0x49d1d5,_0x3d0a3a){return _0x49d1d5[_0x5a19('0x9')](_0x5a19('0xa'),attributes,{'tableName':_0x5a19('0xb'),'paranoid':![],'indexes':[{'name':_0x5a19('0xc'),'fields':[_0x5a19('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf11f64,_0x3607c7,_0x460467){var _0x225eb0=_0x49d1d5['models'];var _0x4692c2=_0xf11f64['get']({'plain':!![]});if(_0x4692c2[_0x5a19('0xe')]['toLowerCase']()==='in'||_0x4692c2[_0x5a19('0xe')][_0x5a19('0xf')]()===_0x5a19('0x10')&&!_0x4692c2['secret']&&!_[_0x5a19('0x11')](_0x4692c2[_0x5a19('0x12')])){_0x225eb0[_0x5a19('0x13')]['findOne']({'where':{'id':_0x4692c2['OpenchannelInteractionId']}})[_0x5a19('0x14')](function(_0x33ed2e){if(_0x33ed2e){_0x33ed2e[_0x5a19('0x15')]({'lastMsgAt':_0x4692c2[_0x5a19('0x16')],'lastMsgDirection':_0x4692c2[_0x5a19('0xe')][_0x5a19('0xf')]()});}})['catch'](function(_0xe3fbd8){console[_0x5a19('0x17')](_0xe3fbd8);});}if(_0x4692c2[_0x5a19('0xe')]===_0x5a19('0x10')&&!_0x4692c2[_0x5a19('0x18')]){var _0x558305;_0x225eb0[_0x5a19('0x19')]['describe']()['then'](function(_0x376a3a){return _0x225eb0['OpenchannelAccount'][_0x5a19('0x1a')]({'where':{'id':_0x4692c2['OpenchannelAccountId']},'include':[{'model':_0x225eb0[_0x5a19('0x13')],'as':_0x5a19('0x1b'),'where':{'id':_0x4692c2[_0x5a19('0x1c')]},'limit':0x1,'include':[{'model':_0x225eb0[_0x5a19('0x19')],'as':_0x5a19('0x1d'),'attributes':_[_0x5a19('0x1e')](_0x376a3a)}]}]});})[_0x5a19('0x14')](function(_0xb6d906){_0x558305=_0xb6d906[_0x5a19('0x1f')]({'plain':!![]});if(_0x558305&&_0x558305[_0x5a19('0x20')]){logger['info'](_0x5a19('0x21'),_0x5a19('0x22'),util[_0x5a19('0x23')](_0x5a19('0x24'),_0x4692c2['id'],_0x558305[_0x5a19('0x20')]));if(_0x558305[_0x5a19('0x1b')]&&_0x558305[_0x5a19('0x1b')][_0x5a19('0x25')]){_0x4692c2[_0x5a19('0x26')]=_[_0x5a19('0x27')](_0x558305['Interactions'][0x0],_0x5a19('0x1d'));_0x4692c2[_0x5a19('0x1d')]=_0x558305[_0x5a19('0x1b')][0x0][_0x5a19('0x1d')];}var _0x3607c7={'method':_0x5a19('0x28'),'uri':encodeURI(_0x558305[_0x5a19('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3607c7[_0x5a19('0x29')]){case _0x5a19('0x2a'):_0x3607c7['qs']=_0x4692c2;break;case _0x5a19('0x28'):_0x3607c7[_0x5a19('0xd')]=_0x4692c2;break;}return rp(_0x3607c7)[_0x5a19('0x14')](function(_0x5a5113){logger['info'](_0x5a19('0x21'),'afterCreate',util[_0x5a19('0x23')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x4692c2['id'],_0x558305[_0x5a19('0x20')]));if(_0x5a5113['body'][_0x5a19('0x2b')]&&_0x5a5113[_0x5a19('0xd')][_0x5a19('0x2b')]!=_0x4692c2[_0x5a19('0x26')][_0x5a19('0x2b')]){return _0x225eb0[_0x5a19('0x13')][_0x5a19('0x15')]({'threadId':_0x5a5113[_0x5a19('0xd')][_0x5a19('0x2b')]},{'logging':!![],'where':{'id':_0x4692c2['Interaction']['id']}});}else{return;}})['then'](function(){return _0xf11f64['update']({'read':!![]});})['catch'](function(_0x52bd74){logger[_0x5a19('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0x5a19('0x22'),util['inspect'](_0x52bd74,{'showHidden':![],'depth':null}));_0x460467();});}else{_0x460467();}})[_0x5a19('0x2c')](function(){_0x460467();});}else{_0x460467();}}},'charset':_0x5a19('0x2d'),'collate':_0x5a19('0x2e')});}; \ No newline at end of file +var _0x7156=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','catch','error','CmContact','describe','find','OpenchannelAccountId','Contact','keys','get','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','POST','replyUri','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','OpenchannelInteraction','update','inspect'];(function(_0x29003b,_0x2cf488){var _0x117589=function(_0x254388){while(--_0x254388){_0x29003b['push'](_0x29003b['shift']());}};_0x117589(++_0x2cf488);}(_0x7156,0x8f));var _0x6715=function(_0x29ab7d,_0x4b9874){_0x29ab7d=_0x29ab7d-0x0;var _0xc62758=_0x7156[_0x29ab7d];return _0xc62758;};'use strict';var _=require(_0x6715('0x0'));var util=require('util');var logger=require(_0x6715('0x1'))(_0x6715('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6715('0x3'));var attributes=require(_0x6715('0x4'));module[_0x6715('0x5')]=function(_0x228b7c,_0x51c4ff){return _0x228b7c['define'](_0x6715('0x6'),attributes,{'tableName':_0x6715('0x7'),'paranoid':![],'indexes':[{'name':_0x6715('0x8'),'fields':[_0x6715('0x9')],'type':_0x6715('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28cc4e,_0x5805f4,_0x2f3a2c){var _0x1413fa=_0x228b7c[_0x6715('0xb')];var _0x466703=_0x28cc4e['get']({'plain':!![]});if(_0x466703[_0x6715('0xc')]['toLowerCase']()==='in'||_0x466703[_0x6715('0xc')][_0x6715('0xd')]()===_0x6715('0xe')&&!_0x466703[_0x6715('0xf')]&&!_[_0x6715('0x10')](_0x466703[_0x6715('0x11')])){_0x1413fa['OpenchannelInteraction'][_0x6715('0x12')]({'where':{'id':_0x466703[_0x6715('0x13')]}})[_0x6715('0x14')](function(_0x56abac){if(_0x56abac){_0x56abac['update']({'lastMsgAt':_0x466703['createdAt'],'lastMsgDirection':_0x466703[_0x6715('0xc')]['toLowerCase']()});}})[_0x6715('0x15')](function(_0x30ab08){console[_0x6715('0x16')](_0x30ab08);});}if(_0x466703[_0x6715('0xc')]===_0x6715('0xe')&&!_0x466703['secret']){var _0x3347f8;_0x1413fa[_0x6715('0x17')][_0x6715('0x18')]()[_0x6715('0x14')](function(_0x2b2c72){return _0x1413fa['OpenchannelAccount'][_0x6715('0x19')]({'where':{'id':_0x466703[_0x6715('0x1a')]},'include':[{'model':_0x1413fa['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x466703[_0x6715('0x13')]},'limit':0x1,'include':[{'model':_0x1413fa[_0x6715('0x17')],'as':_0x6715('0x1b'),'attributes':_[_0x6715('0x1c')](_0x2b2c72)}]}]});})[_0x6715('0x14')](function(_0x52db67){_0x3347f8=_0x52db67[_0x6715('0x1d')]({'plain':!![]});if(_0x3347f8&&_0x3347f8['replyUri']){logger[_0x6715('0x1e')](_0x6715('0x1f'),_0x6715('0x20'),util[_0x6715('0x21')](_0x6715('0x22'),_0x466703['id'],_0x3347f8['replyUri']));if(_0x3347f8[_0x6715('0x23')]&&_0x3347f8['Interactions']['length']){_0x466703['Interaction']=_[_0x6715('0x24')](_0x3347f8[_0x6715('0x23')][0x0],_0x6715('0x1b'));_0x466703[_0x6715('0x1b')]=_0x3347f8[_0x6715('0x23')][0x0][_0x6715('0x1b')];}var _0x5805f4={'method':_0x6715('0x25'),'uri':encodeURI(_0x3347f8[_0x6715('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5805f4['method']){case'GET':_0x5805f4['qs']=_0x466703;break;case _0x6715('0x25'):_0x5805f4[_0x6715('0x9')]=_0x466703;break;}return rp(_0x5805f4)['then'](function(_0x37c203){logger['info'](_0x6715('0x1f'),_0x6715('0x20'),util[_0x6715('0x21')](_0x6715('0x27'),_0x466703['id'],_0x3347f8[_0x6715('0x26')]));if(_0x37c203['body'][_0x6715('0x28')]&&_0x37c203[_0x6715('0x9')][_0x6715('0x28')]!=_0x466703[_0x6715('0x29')][_0x6715('0x28')]){return _0x1413fa[_0x6715('0x2a')][_0x6715('0x2b')]({'threadId':_0x37c203['body'][_0x6715('0x28')]},{'logging':!![],'where':{'id':_0x466703['Interaction']['id']}});}else{return;}})[_0x6715('0x14')](function(){return _0x28cc4e[_0x6715('0x2b')]({'read':!![]});})[_0x6715('0x15')](function(_0x54d8b7){logger[_0x6715('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x6715('0x20'),util[_0x6715('0x2c')](_0x54d8b7,{'showHidden':![],'depth':null}));_0x2f3a2c();});}else{_0x2f3a2c();}})['finally'](function(){_0x2f3a2c();});}else{_0x2f3a2c();}}},'charset':_0x6715('0x2d'),'collate':_0x6715('0x2e')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index bb53b40..b659db0 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f44=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','catch'];(function(_0x510c60,_0x50247e){var _0x49c4aa=function(_0x3149c7){while(--_0x3149c7){_0x510c60['push'](_0x510c60['shift']());}};_0x49c4aa(++_0x50247e);}(_0x6f44,0x1ea));var _0x46f4=function(_0x527588,_0x444a1f){_0x527588=_0x527588-0x0;var _0xdeb91b=_0x6f44[_0x527588];return _0xdeb91b;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var moment=require('moment');var BPromise=require(_0x46f4('0x2'));var rs=require(_0x46f4('0x3'));var fs=require('fs');var Redis=require(_0x46f4('0x4'));var db=require(_0x46f4('0x5'))['db'];var utils=require(_0x46f4('0x6'));var logger=require(_0x46f4('0x7'))(_0x46f4('0x8'));var config=require(_0x46f4('0x9'));var jayson=require(_0x46f4('0xa'));var client=jayson['client'][_0x46f4('0xb')]({'port':0x232a});config[_0x46f4('0xc')]=_[_0x46f4('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x46f4('0xe'))(new Redis(config[_0x46f4('0xc')]));require('./openchannelMessage.socket')[_0x46f4('0xf')](socket);function respondWithRpcPromise(_0x5662a3,_0x2064fd,_0x487ef8){return new BPromise(function(_0x14cc75,_0x1fe1a5){return client[_0x46f4('0x10')](_0x5662a3,_0x487ef8)[_0x46f4('0x11')](function(_0xbc1148){logger[_0x46f4('0x12')](_0x46f4('0x13'),_0x2064fd,_0x46f4('0x14'));logger[_0x46f4('0x15')](_0x46f4('0x16'),_0x2064fd,_0x46f4('0x14'),JSON[_0x46f4('0x17')](_0xbc1148));if(_0xbc1148['error']){if(_0xbc1148[_0x46f4('0x18')][_0x46f4('0x19')]===0x1f4){logger['error'](_0x46f4('0x13'),_0x2064fd,_0xbc1148[_0x46f4('0x18')][_0x46f4('0x1a')]);return _0x1fe1a5(_0xbc1148['error'][_0x46f4('0x1a')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2064fd,_0xbc1148[_0x46f4('0x18')][_0x46f4('0x1a')]);return _0x14cc75(_0xbc1148[_0x46f4('0x18')]['message']);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2064fd,'request\x20sent');_0x14cc75(_0xbc1148[_0x46f4('0x1b')][_0x46f4('0x1a')]);}})['catch'](function(_0x22209b){logger[_0x46f4('0x18')](_0x46f4('0x13'),_0x2064fd,_0x22209b);_0x1fe1a5(_0x22209b);});});}exports[_0x46f4('0x1c')]=function(_0x4b0650){var _0x1af169=this;return new Promise(function(_0x390137,_0x1627db){return db[_0x46f4('0x1d')][_0x46f4('0x1e')](_0x4b0650[_0x46f4('0x1f')],{'raw':_0x4b0650['options']?_0x4b0650[_0x46f4('0x20')][_0x46f4('0x21')]===undefined?!![]:![]:!![]})[_0x46f4('0x11')](function(_0x4ba21a){logger[_0x46f4('0x12')](_0x46f4('0x1c'),_0x4b0650);logger[_0x46f4('0x15')](_0x46f4('0x1c'),_0x4b0650,JSON[_0x46f4('0x17')](_0x4ba21a));_0x390137(_0x4ba21a);})[_0x46f4('0x22')](function(_0x204db6){logger[_0x46f4('0x18')](_0x46f4('0x1c'),_0x204db6[_0x46f4('0x1a')],_0x4b0650);_0x1627db(_0x1af169[_0x46f4('0x18')](0x1f4,_0x204db6[_0x46f4('0x1a')]));});});}; \ No newline at end of file +var _0xc00b=['defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x382a50,_0x2a14af){var _0x14e482=function(_0x11f228){while(--_0x11f228){_0x382a50['push'](_0x382a50['shift']());}};_0x14e482(++_0x2a14af);}(_0xc00b,0x1e5));var _0xbc00=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0xc00b[_0x59befa];return _0x1dd63d;};'use strict';var _=require(_0xbc00('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbc00('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc00('0x2'))['db'];var utils=require(_0xbc00('0x3'));var logger=require(_0xbc00('0x4'))(_0xbc00('0x5'));var config=require('../../config/environment');var jayson=require(_0xbc00('0x6'));var client=jayson['client'][_0xbc00('0x7')]({'port':0x232a});config['redis']=_[_0xbc00('0x8')](config[_0xbc00('0x9')],{'host':_0xbc00('0xa'),'port':0x18eb});var socket=require(_0xbc00('0xb'))(new Redis(config[_0xbc00('0x9')]));require(_0xbc00('0xc'))['register'](socket);function respondWithRpcPromise(_0x1a53a7,_0x57192a,_0x2219c6){return new BPromise(function(_0x3eefe9,_0x1e577f){return client['request'](_0x1a53a7,_0x2219c6)[_0xbc00('0xd')](function(_0x5191cf){logger[_0xbc00('0xe')]('OpenchannelMessage,\x20%s,\x20%s',_0x57192a,_0xbc00('0xf'));logger[_0xbc00('0x10')](_0xbc00('0x11'),_0x57192a,'request\x20sent',JSON[_0xbc00('0x12')](_0x5191cf));if(_0x5191cf[_0xbc00('0x13')]){if(_0x5191cf[_0xbc00('0x13')]['code']===0x1f4){logger[_0xbc00('0x13')](_0xbc00('0x14'),_0x57192a,_0x5191cf['error'][_0xbc00('0x15')]);return _0x1e577f(_0x5191cf[_0xbc00('0x13')][_0xbc00('0x15')]);}logger[_0xbc00('0x13')](_0xbc00('0x14'),_0x57192a,_0x5191cf[_0xbc00('0x13')][_0xbc00('0x15')]);return _0x3eefe9(_0x5191cf['error']['message']);}else{logger['info'](_0xbc00('0x14'),_0x57192a,'request\x20sent');_0x3eefe9(_0x5191cf[_0xbc00('0x16')]['message']);}})[_0xbc00('0x17')](function(_0x25e3d7){logger['error'](_0xbc00('0x14'),_0x57192a,_0x25e3d7);_0x1e577f(_0x25e3d7);});});}exports['CreateOpenchannelMessage']=function(_0x44590e){var _0x2189b6=this;return new Promise(function(_0x48b39b,_0x340f91){return db[_0xbc00('0x18')][_0xbc00('0x19')](_0x44590e[_0xbc00('0x1a')],{'raw':_0x44590e[_0xbc00('0x1b')]?_0x44590e[_0xbc00('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x39afdf){logger[_0xbc00('0xe')](_0xbc00('0x1c'),_0x44590e);logger['debug'](_0xbc00('0x1c'),_0x44590e,JSON[_0xbc00('0x12')](_0x39afdf));_0x48b39b(_0x39afdf);})['catch'](function(_0x5f05c7){logger[_0xbc00('0x13')](_0xbc00('0x1c'),_0x5f05c7[_0xbc00('0x15')],_0x44590e);_0x340f91(_0x2189b6['error'](0x1f4,_0x5f05c7['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index d037451..c53c698 100644 --- a/server/api/openchannelMessage/openchannelMessage.socket.js +++ b/server/api/openchannelMessage/openchannelMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['save','emit','./openchannelMessage.events'];(function(_0x125c0a,_0x58a8db){var _0x52dfca=function(_0x1fcb99){while(--_0x1fcb99){_0x125c0a['push'](_0x125c0a['shift']());}};_0x52dfca(++_0x58a8db);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var OpenchannelMessageEvents=require(_0x0d8b('0x0'));var events=[_0x0d8b('0x1'),'remove','update'];function createListener(_0x4b72b0,_0x3ff8df){return function(_0x5b9b89){_0x3ff8df[_0x0d8b('0x2')](_0x4b72b0,_0x5b9b89);};}function removeListener(_0x364286,_0x8196ed){return function(){OpenchannelMessageEvents['removeListener'](_0x364286,_0x8196ed);};}exports['register']=function(_0x3f8b6f){for(var _0x227c63=0x0,_0x39f43a=events['length'];_0x227c63<_0x39f43a;_0x227c63++){var _0x413284=events[_0x227c63];var _0x284169=createListener('openchannelMessage:'+_0x413284,_0x3f8b6f);OpenchannelMessageEvents['on'](_0x413284,_0x284169);}}; \ No newline at end of file +var _0x9c44=['emit','removeListener','length','openchannelMessage:','remove','update'];(function(_0x322b3d,_0x15ca3d){var _0x21e10f=function(_0x4cdda9){while(--_0x4cdda9){_0x322b3d['push'](_0x322b3d['shift']());}};_0x21e10f(++_0x15ca3d);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){OpenchannelMessageEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);OpenchannelMessageEvents['on'](_0x436234,_0x511d53);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 0da0f52..b2e6ba8 100644 --- a/server/api/openchannelQueue/index.js +++ b/server/api/openchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c52=['get','isAuthenticated','index','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x8c52,0x7e));var _0x28c5=function(_0x34ca5a,_0x2f14b1){_0x34ca5a=_0x34ca5a-0x0;var _0x38c2be=_0x8c52[_0x34ca5a];return _0x38c2be;};'use strict';var multer=require(_0x28c5('0x0'));var util=require('util');var path=require(_0x28c5('0x1'));var timeout=require(_0x28c5('0x2'));var express=require(_0x28c5('0x3'));var router=express[_0x28c5('0x4')]();var auth=require(_0x28c5('0x5'));var interaction=require(_0x28c5('0x6'));var config=require(_0x28c5('0x7'));var controller=require(_0x28c5('0x8'));router[_0x28c5('0x9')]('/',auth[_0x28c5('0xa')](),controller[_0x28c5('0xb')]);router[_0x28c5('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x28c5('0xc'),auth[_0x28c5('0xa')](),controller[_0x28c5('0xd')]);router['get'](_0x28c5('0xe'),auth[_0x28c5('0xa')](),controller['getMembers']);router[_0x28c5('0x9')](_0x28c5('0xf'),auth[_0x28c5('0xa')](),controller[_0x28c5('0x10')]);router[_0x28c5('0x9')](_0x28c5('0x11'),auth[_0x28c5('0xa')](),controller[_0x28c5('0x12')]);router[_0x28c5('0x13')]('/',auth[_0x28c5('0xa')](),controller['create']);router[_0x28c5('0x13')](_0x28c5('0xf'),auth[_0x28c5('0xa')](),controller[_0x28c5('0x14')]);router['post'](_0x28c5('0x11'),auth[_0x28c5('0xa')](),controller[_0x28c5('0x15')]);router[_0x28c5('0x16')](_0x28c5('0xc'),auth[_0x28c5('0xa')](),controller[_0x28c5('0x17')]);router[_0x28c5('0x18')]('/:id',auth[_0x28c5('0xa')](),controller[_0x28c5('0x19')]);router[_0x28c5('0x18')](_0x28c5('0xf'),auth[_0x28c5('0xa')](),controller['removeTeams']);router['delete'](_0x28c5('0x11'),auth[_0x28c5('0xa')](),controller['removeAgents']);module[_0x28c5('0x1a')]=router; \ No newline at end of file +var _0xcf12=['../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','update','delete','destroy','removeTeams','removeAgents','util','connect-timeout','express','Router'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xcf12,0x140));var _0x2cf1=function(_0x56a5a3,_0x59356d){_0x56a5a3=_0x56a5a3-0x0;var _0x1848ad=_0xcf12[_0x56a5a3];return _0x1848ad;};'use strict';var multer=require('multer');var util=require(_0x2cf1('0x0'));var path=require('path');var timeout=require(_0x2cf1('0x1'));var express=require(_0x2cf1('0x2'));var router=express[_0x2cf1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2cf1('0x4'));var config=require(_0x2cf1('0x5'));var controller=require(_0x2cf1('0x6'));router[_0x2cf1('0x7')]('/',auth[_0x2cf1('0x8')](),controller[_0x2cf1('0x9')]);router[_0x2cf1('0x7')](_0x2cf1('0xa'),auth[_0x2cf1('0x8')](),controller['describe']);router[_0x2cf1('0x7')](_0x2cf1('0xb'),auth[_0x2cf1('0x8')](),controller[_0x2cf1('0xc')]);router[_0x2cf1('0x7')](_0x2cf1('0xd'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x2cf1('0xe'),auth['isAuthenticated'](),controller[_0x2cf1('0xf')]);router[_0x2cf1('0x7')](_0x2cf1('0x10'),auth['isAuthenticated'](),controller[_0x2cf1('0x11')]);router['post']('/',auth[_0x2cf1('0x8')](),controller[_0x2cf1('0x12')]);router[_0x2cf1('0x13')](_0x2cf1('0xe'),auth[_0x2cf1('0x8')](),controller[_0x2cf1('0x14')]);router[_0x2cf1('0x13')](_0x2cf1('0x10'),auth[_0x2cf1('0x8')](),controller['addAgents']);router[_0x2cf1('0x15')](_0x2cf1('0xb'),auth['isAuthenticated'](),controller[_0x2cf1('0x16')]);router[_0x2cf1('0x17')](_0x2cf1('0xb'),auth[_0x2cf1('0x8')](),controller[_0x2cf1('0x18')]);router[_0x2cf1('0x17')](_0x2cf1('0xe'),auth[_0x2cf1('0x8')](),controller[_0x2cf1('0x19')]);router[_0x2cf1('0x17')](_0x2cf1('0x10'),auth['isAuthenticated'](),controller[_0x2cf1('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index f5a5a3b..d46a8cb 100644 --- a/server/api/openchannelQueue/openchannelQueue.attributes.js +++ b/server/api/openchannelQueue/openchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e9f=['exports','STRING','INTEGER','ENUM','beepall','sequelize'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0x9e9f,0x1cd));var _0xf9e9=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x9e9f[_0x1bbc08];return _0x5d825b;};'use strict';var Sequelize=require(_0xf9e9('0x0'));module[_0xf9e9('0x1')]={'name':{'type':Sequelize[_0xf9e9('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf9e9('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf9e9('0x4')]('rrmemory',_0xf9e9('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x8101=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x5c90b2,_0x4ebbfd){var _0x28e02e=function(_0x208779){while(--_0x208779){_0x5c90b2['push'](_0x5c90b2['shift']());}};_0x28e02e(++_0x4ebbfd);}(_0x8101,0xc0));var _0x1810=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0x8101[_0x225f50];return _0x19d003;};'use strict';var Sequelize=require(_0x1810('0x0'));module[_0x1810('0x1')]={'name':{'type':Sequelize[_0x1810('0x2')],'unique':_0x1810('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1810('0x2')]},'timeout':{'type':Sequelize[_0x1810('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1810('0x5')](_0x1810('0x6'),_0x1810('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 866355e..47696ac 100644 --- a/server/api/openchannelQueue/openchannelQueue.controller.js +++ b/server/api/openchannelQueue/openchannelQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7167=['rows','format','%s/%s','SIP','getTeams','addTeams','teams','Team','voicePause','flatMap','Agents','sequelize','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','SELECT','every','includes','all','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','redis','defaults','localhost','register','sendStatus','status','json','count','limit','set','Content-Range','apply','save','update','then','destroy','OpenchannelQueues','end','stack','name','send','index','OpenchannelQueue','rawAttributes','keys','query','model','attributes','intersection','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','catch','params','fields','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt'];(function(_0x40b707,_0x51b5ab){var _0x4b8edd=function(_0x2e1f2c){while(--_0x2e1f2c){_0x40b707['push'](_0x40b707['shift']());}};_0x4b8edd(++_0x51b5ab);}(_0x7167,0x1bd));var _0x7716=function(_0x3ead55,_0x22bc51){_0x3ead55=_0x3ead55-0x0;var _0x3ea16d=_0x7167[_0x3ead55];return _0x3ea16d;};'use strict';var pdf=require(_0x7716('0x0'));var emlformat=require(_0x7716('0x1'));var rimraf=require(_0x7716('0x2'));var zipdir=require(_0x7716('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7716('0x4'));var BPromise=require(_0x7716('0x5'));var Mustache=require(_0x7716('0x6'));var util=require('util');var path=require(_0x7716('0x7'));var sox=require(_0x7716('0x8'));var csv=require(_0x7716('0x9'));var ejs=require(_0x7716('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7716('0xb'));var jsforce=require(_0x7716('0xc'));var deskjs=require(_0x7716('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7716('0xe'));var Papa=require(_0x7716('0xf'));var Redis=require(_0x7716('0x10'));var authService=require(_0x7716('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7716('0x12'))(_0x7716('0x13'));var utils=require(_0x7716('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7716('0x15')]=_[_0x7716('0x16')](config[_0x7716('0x15')],{'host':_0x7716('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7716('0x15')]));require('./openchannelQueue.socket')[_0x7716('0x18')](socket);function respondWithStatusCode(_0x4dd0e4,_0x4dccbc){_0x4dccbc=_0x4dccbc||0xcc;return function(_0x180a12){if(_0x180a12){return _0x4dd0e4[_0x7716('0x19')](_0x4dccbc);}return _0x4dd0e4[_0x7716('0x1a')](_0x4dccbc)['end']();};}function respondWithResult(_0x3a605d,_0x1990ec){_0x1990ec=_0x1990ec||0xc8;return function(_0x591ba7){if(_0x591ba7){return _0x3a605d[_0x7716('0x1a')](_0x1990ec)[_0x7716('0x1b')](_0x591ba7);}};}function respondWithFilteredResult(_0x39b9c4,_0x1575a4){return function(_0x4e43dd){if(_0x4e43dd){var _0x3055a8=_0x4e43dd[_0x7716('0x1c')],_0x202f05=_0x1575a4['offset'],_0x3db8fd=_0x1575a4['offset']+_0x1575a4[_0x7716('0x1d')],_0x4ec275;if(_0x3db8fd>=_0x3055a8){_0x3db8fd=_0x3055a8;_0x4ec275=0xc8;}else{_0x4ec275=0xce;}_0x39b9c4['status'](_0x4ec275);return _0x39b9c4[_0x7716('0x1e')](_0x7716('0x1f'),_0x202f05+'-'+_0x3db8fd+'/'+_0x3055a8)[_0x7716('0x1b')](_0x4e43dd);}return null;};}function patchUpdates(_0x23d05d){return function(_0x337cc3){try{jsonpatch[_0x7716('0x20')](_0x337cc3,_0x23d05d,!![]);}catch(_0x2a4b7e){return BPromise['reject'](_0x2a4b7e);}return _0x337cc3[_0x7716('0x21')]();};}function saveUpdates(_0x2873d1,_0x137b02){return function(_0x501770){if(_0x501770){return _0x501770[_0x7716('0x22')](_0x2873d1)[_0x7716('0x23')](function(_0x1029be){return _0x1029be;});}return null;};}function removeEntity(_0x1902f2,_0x30b65f){return function(_0x380b9a){if(_0x380b9a){return _0x380b9a[_0x7716('0x24')]()[_0x7716('0x23')](function(){var _0x253117=_0x380b9a['get']({'plain':!![]});var _0x47abdc=_0x7716('0x25');return db['UserProfileResource'][_0x7716('0x24')]({'where':{'type':_0x47abdc,'resourceId':_0x253117['id']}})['then'](function(){return _0x380b9a;});})['then'](function(){_0x1902f2[_0x7716('0x1a')](0xcc)[_0x7716('0x26')]();});}};}function handleEntityNotFound(_0x3a3c33,_0x2e8602){return function(_0x15a586){if(!_0x15a586){_0x3a3c33[_0x7716('0x19')](0x194);}return _0x15a586;};}function handleError(_0x11ae4f,_0x487069){_0x487069=_0x487069||0x1f4;return function(_0x40365e){logger['error'](_0x40365e[_0x7716('0x27')]);if(_0x40365e['name']){delete _0x40365e[_0x7716('0x28')];}_0x11ae4f[_0x7716('0x1a')](_0x487069)[_0x7716('0x29')](_0x40365e);};}exports[_0x7716('0x2a')]=function(_0x1bbdfc,_0x457ebb){var _0x13eb04={},_0xf24442={},_0x275655={'count':0x0,'rows':[]};var _0xdcfbde=db[_0x7716('0x2b')][_0x7716('0x2c')];_0xf24442['model']=_[_0x7716('0x2d')](_0xdcfbde);_0xf24442[_0x7716('0x2e')]=_[_0x7716('0x2d')](_0x1bbdfc[_0x7716('0x2e')]);_0xf24442['filters']=_['intersection'](_0xf24442[_0x7716('0x2f')],_0xf24442[_0x7716('0x2e')]);_0x13eb04[_0x7716('0x30')]=_[_0x7716('0x31')](_0xf24442['model'],qs['fields'](_0x1bbdfc[_0x7716('0x2e')]['fields']));_0x13eb04['attributes']=_0x13eb04['attributes'][_0x7716('0x32')]?_0x13eb04[_0x7716('0x30')]:_0xf24442[_0x7716('0x2f')];if(!_0x1bbdfc[_0x7716('0x2e')][_0x7716('0x33')](_0x7716('0x34'))){_0x13eb04[_0x7716('0x1d')]=qs['limit'](_0x1bbdfc['query'][_0x7716('0x1d')]);_0x13eb04['offset']=qs[_0x7716('0x35')](_0x1bbdfc['query']['offset']);}_0x13eb04[_0x7716('0x36')]=qs[_0x7716('0x37')](_0x1bbdfc['query'][_0x7716('0x37')]);_0x13eb04[_0x7716('0x38')]=qs[_0x7716('0x39')](_[_0x7716('0x3a')](_0x1bbdfc[_0x7716('0x2e')],_0xf24442[_0x7716('0x39')]));if(_0x1bbdfc[_0x7716('0x2e')][_0x7716('0x3b')]){_0x13eb04['where']=_['merge'](_0x13eb04[_0x7716('0x38')],{'$or':_[_0x7716('0x3c')](_0xdcfbde,function(_0x21710c){if(_0x21710c[_0x7716('0x3d')][_0x7716('0x3e')]!==_0x7716('0x3f')){var _0x2e6f8b={};_0x2e6f8b[_0x21710c[_0x7716('0x40')]]={'$like':'%'+_0x1bbdfc[_0x7716('0x2e')][_0x7716('0x3b')]+'%'};return _0x2e6f8b;}})});}_0x13eb04=_[_0x7716('0x41')]({},_0x13eb04,_0x1bbdfc[_0x7716('0x42')]);var _0x3a0050={'where':_0x13eb04['where']};return db[_0x7716('0x2b')]['count'](_0x3a0050)['then'](function(_0xc2d3b6){_0x275655['count']=_0xc2d3b6;if(_0x1bbdfc[_0x7716('0x2e')][_0x7716('0x43')]){_0x13eb04[_0x7716('0x44')]=[{'all':!![]}];}return db[_0x7716('0x2b')]['findAll'](_0x13eb04);})[_0x7716('0x23')](function(_0x1b7bb2){_0x275655['rows']=_0x1b7bb2;return _0x275655;})[_0x7716('0x23')](respondWithFilteredResult(_0x457ebb,_0x13eb04))[_0x7716('0x45')](handleError(_0x457ebb,null));};exports['show']=function(_0x1bc58d,_0x12f3d8){var _0x1aeb1d={'raw':!![],'where':{'id':_0x1bc58d[_0x7716('0x46')]['id']}},_0x147729={};_0x147729[_0x7716('0x2f')]=_[_0x7716('0x2d')](db['OpenchannelQueue'][_0x7716('0x2c')]);_0x147729['query']=_[_0x7716('0x2d')](_0x1bc58d[_0x7716('0x2e')]);_0x147729[_0x7716('0x39')]=_[_0x7716('0x31')](_0x147729[_0x7716('0x2f')],_0x147729[_0x7716('0x2e')]);_0x1aeb1d['attributes']=_[_0x7716('0x31')](_0x147729[_0x7716('0x2f')],qs[_0x7716('0x47')](_0x1bc58d['query'][_0x7716('0x47')]));_0x1aeb1d[_0x7716('0x30')]=_0x1aeb1d[_0x7716('0x30')]['length']?_0x1aeb1d[_0x7716('0x30')]:_0x147729['model'];if(_0x1bc58d[_0x7716('0x2e')][_0x7716('0x43')]){_0x1aeb1d[_0x7716('0x44')]=[{'all':!![]}];}_0x1aeb1d=_[_0x7716('0x41')]({},_0x1aeb1d,_0x1bc58d['options']);return db[_0x7716('0x2b')][_0x7716('0x48')](_0x1aeb1d)[_0x7716('0x23')](handleEntityNotFound(_0x12f3d8,null))[_0x7716('0x23')](respondWithResult(_0x12f3d8,null))[_0x7716('0x45')](handleError(_0x12f3d8,null));};exports[_0x7716('0x49')]=function(_0x5c4bc2,_0x42cbe6){return db[_0x7716('0x2b')]['create'](_0x5c4bc2[_0x7716('0x4a')],{})[_0x7716('0x23')](function(_0x130308){var _0x31d497=_0x5c4bc2['user'][_0x7716('0x4b')]({'plain':!![]});if(!_0x31d497)throw new Error(_0x7716('0x4c'));if(_0x31d497[_0x7716('0x4d')]===_0x7716('0x4e')){var _0x50affe=_0x130308[_0x7716('0x4b')]({'plain':!![]});var _0x2b1e08='OpenchannelQueues';return db[_0x7716('0x4f')]['find']({'where':{'name':_0x2b1e08,'userProfileId':_0x31d497[_0x7716('0x50')]},'raw':!![]})[_0x7716('0x23')](function(_0x5984bd){if(_0x5984bd&&_0x5984bd['autoAssociation']===0x0){return db['UserProfileResource'][_0x7716('0x49')]({'name':_0x50affe['name'],'resourceId':_0x50affe['id'],'type':_0x5984bd['name'],'sectionId':_0x5984bd['id']},{})['then'](function(){return _0x130308;});}else{return _0x130308;}})['catch'](function(_0x1634f4){logger[_0x7716('0x51')](_0x7716('0x52'),_0x1634f4);throw _0x1634f4;});}return _0x130308;})[_0x7716('0x23')](respondWithResult(_0x42cbe6,0xc9))[_0x7716('0x45')](handleError(_0x42cbe6,null));};exports['update']=function(_0x5cc269,_0x2ad114){if(_0x5cc269[_0x7716('0x4a')]['id']){delete _0x5cc269[_0x7716('0x4a')]['id'];}return db[_0x7716('0x2b')]['find']({'where':{'id':_0x5cc269[_0x7716('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ad114,null))[_0x7716('0x23')](saveUpdates(_0x5cc269[_0x7716('0x4a')],null))['then'](respondWithResult(_0x2ad114,null))[_0x7716('0x45')](handleError(_0x2ad114,null));};exports['destroy']=function(_0x5e8ac3,_0x4c6309){return db['OpenchannelQueue'][_0x7716('0x48')]({'where':{'id':_0x5e8ac3['params']['id']}})[_0x7716('0x23')](handleEntityNotFound(_0x4c6309,null))[_0x7716('0x23')](removeEntity(_0x4c6309,null))[_0x7716('0x45')](handleError(_0x4c6309,null));};exports[_0x7716('0x53')]=function(_0x40d8c9,_0x230469){return db['OpenchannelQueue']['describe']()[_0x7716('0x23')](respondWithResult(_0x230469,null))['catch'](handleError(_0x230469,null));};exports[_0x7716('0x54')]=function(_0x2e7578,_0x459837,_0x50c542){var _0x532590={'raw':!![],'where':{}},_0x36233c={},_0x1a6ce3;return db[_0x7716('0x2b')][_0x7716('0x55')]({'where':{'id':_0x2e7578[_0x7716('0x46')]['id']}})[_0x7716('0x23')](handleEntityNotFound(_0x459837,null))['then'](function(_0x6bd46a){if(_0x6bd46a){_0x1a6ce3=_0x6bd46a['get']({'plain':!![]});_0x36233c[_0x7716('0x2f')]=_[_0x7716('0x2d')](db[_0x7716('0x56')][_0x7716('0x2c')]);_0x36233c['query']=_[_0x7716('0x2d')](_0x2e7578[_0x7716('0x2e')]);_0x36233c[_0x7716('0x39')]=_[_0x7716('0x31')](_0x36233c[_0x7716('0x2f')],_0x36233c['query']);_0x532590[_0x7716('0x30')]=_[_0x7716('0x31')](_0x36233c[_0x7716('0x2f')],qs[_0x7716('0x47')](_0x2e7578[_0x7716('0x2e')][_0x7716('0x47')]));_0x532590['attributes']=_0x532590[_0x7716('0x30')][_0x7716('0x32')]?_0x532590[_0x7716('0x30')]:_0x36233c[_0x7716('0x2f')];if(!_0x2e7578[_0x7716('0x2e')][_0x7716('0x33')]('nolimit')){_0x532590[_0x7716('0x1d')]=qs[_0x7716('0x1d')](_0x2e7578[_0x7716('0x2e')]['limit']);_0x532590['offset']=qs['offset'](_0x2e7578[_0x7716('0x2e')][_0x7716('0x35')]);}_0x532590[_0x7716('0x36')]=qs[_0x7716('0x37')](_0x2e7578[_0x7716('0x2e')][_0x7716('0x37')]);_0x532590['where']=qs[_0x7716('0x39')](_[_0x7716('0x3a')](_0x2e7578[_0x7716('0x2e')],_0x36233c[_0x7716('0x39')]));_0x532590[_0x7716('0x38')]['OpenchannelQueueId']=_0x6bd46a['id'];if(_0x2e7578[_0x7716('0x2e')][_0x7716('0x3b')]){_0x532590[_0x7716('0x38')]=_['merge'](_0x532590[_0x7716('0x38')],{'$or':_['map'](_0x532590[_0x7716('0x30')],function(_0x498903){var _0x45e3fe={};_0x45e3fe[_0x498903]={'$like':'%'+_0x2e7578[_0x7716('0x2e')][_0x7716('0x3b')]+'%'};return _0x45e3fe;})});}_0x532590=_[_0x7716('0x41')]({},_0x532590,_0x2e7578['options']);return db[_0x7716('0x56')][_0x7716('0x57')](_0x532590);}})[_0x7716('0x23')](function(_0xd91d5d){if(_0xd91d5d){return db[_0x7716('0x58')][_0x7716('0x59')]({'where':{'id':_['map'](_0xd91d5d,_0x7716('0x5a')),'role':_0x7716('0x5b')},'attributes':['id',_0x7716('0x28'),_0x7716('0x5c'),_0x7716('0x5d'),_0x7716('0x5e')]});}})['then'](function(_0x5498d6){if(_0x5498d6){return{'count':_0x5498d6['count'],'rows':_['map'](_0x5498d6[_0x7716('0x5f')],function(_0x568215){return{'membername':_0x568215[_0x7716('0x28')],'UserId':_0x568215['id'],'queue_name':_0x1a6ce3[_0x7716('0x28')],'OpenchannelQueueId':_0x1a6ce3['id'],'interface':util[_0x7716('0x60')](_0x7716('0x61'),_0x7716('0x62'),_0x568215[_0x7716('0x28')]),'penalty':0x0,'paused':_0x568215[_0x7716('0x5c')],'createdAt':_0x568215[_0x7716('0x5e')],'updatedAt':_0x568215[_0x7716('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7716('0x23')](respondWithFilteredResult(_0x459837,_0x532590))['catch'](handleError(_0x459837,null));};exports['getTeams']=function(_0x5b8181,_0x42fc5e,_0x5d9d72){var _0x2e2a00={};var _0x46ae8c={};var _0x48acd4;var _0x273c85;return db[_0x7716('0x2b')][_0x7716('0x55')]({'where':{'id':_0x5b8181[_0x7716('0x46')]['id']}})['then'](handleEntityNotFound(_0x42fc5e,null))[_0x7716('0x23')](function(_0x597756){if(_0x597756){_0x48acd4=_0x597756;_0x46ae8c[_0x7716('0x2f')]=_[_0x7716('0x2d')](db['Team'][_0x7716('0x2c')]);_0x46ae8c['query']=_[_0x7716('0x2d')](_0x5b8181[_0x7716('0x2e')]);_0x46ae8c['filters']=_['intersection'](_0x46ae8c['model'],_0x46ae8c[_0x7716('0x2e')]);_0x2e2a00[_0x7716('0x30')]=_['intersection'](_0x46ae8c['model'],qs['fields'](_0x5b8181[_0x7716('0x2e')][_0x7716('0x47')]));_0x2e2a00[_0x7716('0x30')]=_0x2e2a00['attributes']['length']?_0x2e2a00[_0x7716('0x30')]:_0x46ae8c[_0x7716('0x2f')];_0x2e2a00[_0x7716('0x36')]=qs[_0x7716('0x37')](_0x5b8181[_0x7716('0x2e')][_0x7716('0x37')]);_0x2e2a00[_0x7716('0x38')]=qs[_0x7716('0x39')](_[_0x7716('0x3a')](_0x5b8181[_0x7716('0x2e')],_0x46ae8c[_0x7716('0x39')]));if(_0x5b8181[_0x7716('0x2e')]['filter']){_0x2e2a00[_0x7716('0x38')]=_['merge'](_0x2e2a00[_0x7716('0x38')],{'$or':_[_0x7716('0x3c')](_0x2e2a00['attributes'],function(_0x3b3ba6){var _0x3c9ddc={};_0x3c9ddc[_0x3b3ba6]={'$like':'%'+_0x5b8181[_0x7716('0x2e')][_0x7716('0x3b')]+'%'};return _0x3c9ddc;})});}_0x2e2a00=_[_0x7716('0x41')]({},_0x2e2a00,_0x5b8181[_0x7716('0x42')]);return _0x48acd4[_0x7716('0x63')](_0x2e2a00);}})[_0x7716('0x23')](function(_0x568141){if(_0x568141){_0x273c85=_0x568141[_0x7716('0x32')];if(!_0x5b8181['query']['hasOwnProperty'](_0x7716('0x34'))){_0x2e2a00[_0x7716('0x1d')]=qs[_0x7716('0x1d')](_0x5b8181['query']['limit']);_0x2e2a00[_0x7716('0x35')]=qs[_0x7716('0x35')](_0x5b8181[_0x7716('0x2e')][_0x7716('0x35')]);}return _0x48acd4['getTeams'](_0x2e2a00);}})[_0x7716('0x23')](function(_0x6151a6){if(_0x6151a6){return _0x6151a6?{'count':_0x273c85,'rows':_0x6151a6}:null;}})[_0x7716('0x23')](respondWithResult(_0x42fc5e,null))[_0x7716('0x45')](handleError(_0x42fc5e,null));};exports[_0x7716('0x64')]=function(_0x180d18,_0x3f49ff,_0x49e490){var _0x126b62=_0x180d18[_0x7716('0x4a')][_0x7716('0x65')];return db[_0x7716('0x66')]['findAll']({'where':{'id':_['map'](_0x126b62,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x7716('0x28'),'online',_0x7716('0x67'),'interface'],'raw':!![]}]})[_0x7716('0x23')](function(_0x2c202c){if(_0x2c202c){var _0x130c72=_[_0x7716('0x68')](_0x2c202c,function(_0x5045b0){var _0x3ea336=_0x5045b0[_0x7716('0x4b')]({'plain':!![]});return _0x3ea336[_0x7716('0x69')];});return db[_0x7716('0x2b')][_0x7716('0x48')]({'where':{'id':_0x180d18[_0x7716('0x46')]['id']}})[_0x7716('0x23')](function(_0x4b09ed){return db[_0x7716('0x6a')]['transaction'](function(_0x498ac2){return _0x4b09ed[_0x7716('0x64')](_[_0x7716('0x3c')](_0x126b62,'id'),{'transaction':_0x498ac2})['then'](function(){return BPromise['each'](_0x130c72,function(_0x47ca32){return db['UserOpenchannelQueue'][_0x7716('0x6b')]({'where':{'UserId':_0x47ca32['id'],'OpenchannelQueueId':_0x180d18[_0x7716('0x46')]['id']},'transaction':_0x498ac2});});})[_0x7716('0x23')](function(){_0x130c72[_0x7716('0x6c')](function(_0x489e88){socket[_0x7716('0x6d')](_0x7716('0x6e'),{'UserId':_0x489e88['id'],'OpenchannelQueueId':_0x4b09ed['id']});});});});});}})['then'](respondWithStatusCode(_0x3f49ff,null))[_0x7716('0x45')](handleError(_0x3f49ff,null));};exports[_0x7716('0x6f')]=function(_0x189df0,_0x26605c,_0x35ead5){return db[_0x7716('0x66')][_0x7716('0x57')]({'where':{'id':_0x189df0[_0x7716('0x2e')][_0x7716('0x70')]},'attributes':['id'],'include':[{'model':db[_0x7716('0x58')],'as':_0x7716('0x69'),'attributes':['id'],'raw':!![]}]})[_0x7716('0x23')](handleEntityNotFound(_0x26605c,null))[_0x7716('0x23')](function(_0x276560){var _0x102e65=_[_0x7716('0x3c')](_0x276560,'id');var _0x4dce10=[];var _0x2998a6=[];var _0x29a133=squel[_0x7716('0x71')]();_0x29a133[_0x7716('0x40')](_0x7716('0x72'))[_0x7716('0x73')](_0x7716('0x74'),'tq')['join'](_0x7716('0x75'),'ut',_0x7716('0x76'))[_0x7716('0x38')](_0x7716('0x77'),_0x189df0[_0x7716('0x46')]['id']);for(var _0xbfb211=0x0;_0xbfb211<_0x276560[_0x7716('0x32')];_0xbfb211+=0x1){let _0x33e593=_0x276560[_0xbfb211];for(var _0x4718f6=0x0;_0x4718f6<_0x33e593['Agents'][_0x7716('0x32')];_0x4718f6+=0x1){let _0x48c8d3=_0x33e593[_0x7716('0x69')][_0x4718f6];var _0x2160f1=_0x29a133[_0x7716('0x78')]();_0x2160f1[_0x7716('0x38')]('ut.UserId\x20=\x20?',_0x48c8d3['id']);_0x2998a6[_0x7716('0x79')](db[_0x7716('0x6a')][_0x7716('0x2e')](_0x2160f1[_0x7716('0x7a')](),{'type':db[_0x7716('0x6a')]['QueryTypes'][_0x7716('0x7b')]})[_0x7716('0x23')](function(_0x42c23c){if(_0x42c23c[_0x7716('0x32')]===0x1){return _0x48c8d3['id'];}else{var _0xec7451=_[_0x7716('0x7c')](_['map'](_0x42c23c,'TeamId'),function(_0x2a49a9){return _[_0x7716('0x7d')](_0x102e65,_0x2a49a9);});if(_0xec7451){return _0x48c8d3['id'];}}}));}}return BPromise[_0x7716('0x7e')](_0x2998a6)[_0x7716('0x23')](function(_0x3dd20d){_0x4dce10=_(_0x4dce10)['union'](_0x3dd20d)[_0x7716('0x7f')]()[_0x7716('0x80')]();return db[_0x7716('0x2b')]['find']({'where':{'id':_0x189df0[_0x7716('0x46')]['id']}})['then'](function(_0x59aa4e){return db[_0x7716('0x6a')]['transaction'](function(_0x3837b1){return _0x59aa4e[_0x7716('0x6f')](_0x189df0['query'][_0x7716('0x70')],{'transaction':_0x3837b1})[_0x7716('0x23')](function(){if(!_[_0x7716('0x81')](_0x4dce10)){return _0x59aa4e[_0x7716('0x82')](_0x4dce10,{'transaction':_0x3837b1});}})['then'](function(){_0x4dce10['forEach'](function(_0x32ec61){socket['emit'](_0x7716('0x83'),{'UserId':_0x32ec61,'OpenchannelQueueId':_0x59aa4e['id']});});});});});});})[_0x7716('0x23')](respondWithStatusCode(_0x26605c,null))['catch'](handleError(_0x26605c,null));};exports[_0x7716('0x84')]=function(_0x5c5d71,_0x25350c,_0x219726){return db[_0x7716('0x2b')][_0x7716('0x48')]({'where':{'id':_0x5c5d71[_0x7716('0x46')]['id']}})[_0x7716('0x23')](handleEntityNotFound(_0x25350c,null))['then'](function(_0x463173){if(_0x463173){return _0x463173[_0x7716('0x84')](_0x5c5d71['body'][_0x7716('0x70')],_['omit'](_0x5c5d71[_0x7716('0x4a')],[_0x7716('0x70'),'id'])||{})['spread'](function(_0x3acef2){for(var _0x38d8d6=0x0;_0x38d8d6<_0x5c5d71[_0x7716('0x4a')][_0x7716('0x70')][_0x7716('0x32')];_0x38d8d6+=0x1){socket[_0x7716('0x6d')](_0x7716('0x6e'),{'UserId':_0x5c5d71[_0x7716('0x4a')]['ids'][_0x38d8d6],'OpenchannelQueueId':_0x5c5d71[_0x7716('0x46')]['id']});}return _0x3acef2;});}})[_0x7716('0x23')](respondWithResult(_0x25350c,null))[_0x7716('0x45')](handleError(_0x25350c,null));};exports[_0x7716('0x82')]=function(_0x4c9778,_0xce7361,_0x53abc2){return db['OpenchannelQueue']['find']({'where':{'id':_0x4c9778['params']['id']}})[_0x7716('0x23')](handleEntityNotFound(_0xce7361,null))[_0x7716('0x23')](function(_0x3f6c30){if(_0x3f6c30){return _0x3f6c30[_0x7716('0x82')](_0x4c9778['query'][_0x7716('0x70')])['then'](function(){if(_[_0x7716('0x85')](_0x4c9778[_0x7716('0x2e')][_0x7716('0x70')])){for(var _0x24d5fb=0x0;_0x24d5fb<_0x4c9778['query'][_0x7716('0x70')]['length'];_0x24d5fb+=0x1){socket[_0x7716('0x6d')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4c9778[_0x7716('0x2e')]['ids'][_0x24d5fb]),'OpenchannelQueueId':Number(_0x4c9778['params']['id'])});}}else{socket[_0x7716('0x6d')](_0x7716('0x83'),{'UserId':Number(_0x4c9778['query'][_0x7716('0x70')]),'OpenchannelQueueId':Number(_0x4c9778[_0x7716('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0xce7361,null))[_0x7716('0x45')](handleError(_0xce7361,null));};exports[_0x7716('0x86')]=function(_0x1e04d6,_0x18330b,_0x1b4850){var _0x30e1df={};var _0x45381d={};var _0x267d8a;var _0x29fe88;return db['OpenchannelQueue'][_0x7716('0x55')]({'where':{'id':_0x1e04d6[_0x7716('0x46')]['id']}})['then'](handleEntityNotFound(_0x18330b,null))[_0x7716('0x23')](function(_0x3854fd){if(_0x3854fd){_0x267d8a=_0x3854fd;_0x45381d[_0x7716('0x2f')]=_[_0x7716('0x2d')](db[_0x7716('0x58')][_0x7716('0x2c')]);_0x45381d[_0x7716('0x2e')]=_[_0x7716('0x2d')](_0x1e04d6['query']);_0x45381d[_0x7716('0x39')]=_[_0x7716('0x31')](_0x45381d[_0x7716('0x2f')],_0x45381d[_0x7716('0x2e')]);_0x30e1df[_0x7716('0x30')]=_['intersection'](_0x45381d[_0x7716('0x2f')],qs[_0x7716('0x47')](_0x1e04d6['query'][_0x7716('0x47')]));_0x30e1df[_0x7716('0x30')]=_0x30e1df[_0x7716('0x30')][_0x7716('0x32')]?_0x30e1df[_0x7716('0x30')]:_0x45381d[_0x7716('0x2f')];_0x30e1df[_0x7716('0x36')]=qs[_0x7716('0x37')](_0x1e04d6[_0x7716('0x2e')]['sort']);_0x30e1df['where']=qs['filters'](_[_0x7716('0x3a')](_0x1e04d6[_0x7716('0x2e')],_0x45381d[_0x7716('0x39')]));if(_0x1e04d6[_0x7716('0x2e')]['filter']){_0x30e1df['where']=_['merge'](_0x30e1df[_0x7716('0x38')],{'$or':_[_0x7716('0x3c')](_0x30e1df['attributes'],function(_0x9c4922){var _0x2f7be3={};_0x2f7be3[_0x9c4922]={'$like':'%'+_0x1e04d6[_0x7716('0x2e')][_0x7716('0x3b')]+'%'};return _0x2f7be3;})});}_0x30e1df=_[_0x7716('0x41')]({},_0x30e1df,_0x1e04d6[_0x7716('0x42')]);return _0x267d8a[_0x7716('0x86')](_0x30e1df);}})[_0x7716('0x23')](function(_0x4a9870){if(_0x4a9870){_0x29fe88=_0x4a9870[_0x7716('0x32')];if(!_0x1e04d6[_0x7716('0x2e')][_0x7716('0x33')](_0x7716('0x34'))){_0x30e1df[_0x7716('0x1d')]=qs[_0x7716('0x1d')](_0x1e04d6['query']['limit']);_0x30e1df[_0x7716('0x35')]=qs[_0x7716('0x35')](_0x1e04d6['query']['offset']);}return _0x267d8a[_0x7716('0x86')](_0x30e1df);}})[_0x7716('0x23')](function(_0x33ce02){if(_0x33ce02){return _0x33ce02?{'count':_0x29fe88,'rows':_0x33ce02}:null;}})[_0x7716('0x23')](respondWithResult(_0x18330b,null))[_0x7716('0x45')](handleError(_0x18330b,null));}; \ No newline at end of file +var _0x6ab4=['order','OpenchannelQueueId','merge','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','teams','Agents','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','TeamId','all','union','compact','emit','addAgents','spread','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','OpenchannelQueues','error','stack','name','send','index','OpenchannelQueue','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','key','VIRTUAL','options','includeAll','catch','show','rawAttributes','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','UserOpenchannelQueue'];(function(_0x295d1d,_0x39409f){var _0x327d2b=function(_0x4538f9){while(--_0x4538f9){_0x295d1d['push'](_0x295d1d['shift']());}};_0x327d2b(++_0x39409f);}(_0x6ab4,0x144));var _0x46ab=function(_0x116663,_0x3cb8b1){_0x116663=_0x116663-0x0;var _0x3f990=_0x6ab4[_0x116663];return _0x3f990;};'use strict';var pdf=require(_0x46ab('0x0'));var emlformat=require(_0x46ab('0x1'));var rimraf=require(_0x46ab('0x2'));var zipdir=require(_0x46ab('0x3'));var jsonpatch=require(_0x46ab('0x4'));var rp=require(_0x46ab('0x5'));var moment=require('moment');var BPromise=require(_0x46ab('0x6'));var Mustache=require(_0x46ab('0x7'));var util=require(_0x46ab('0x8'));var path=require(_0x46ab('0x9'));var sox=require(_0x46ab('0xa'));var csv=require(_0x46ab('0xb'));var ejs=require(_0x46ab('0xc'));var fs=require('fs');var _=require(_0x46ab('0xd'));var squel=require(_0x46ab('0xe'));var crypto=require('crypto');var jsforce=require(_0x46ab('0xf'));var deskjs=require(_0x46ab('0x10'));var toCsv=require(_0x46ab('0xb'));var querystring=require(_0x46ab('0x11'));var Papa=require(_0x46ab('0x12'));var Redis=require(_0x46ab('0x13'));var authService=require(_0x46ab('0x14'));var qs=require(_0x46ab('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46ab('0x16'))(_0x46ab('0x17'));var utils=require(_0x46ab('0x18'));var config=require(_0x46ab('0x19'));var db=require(_0x46ab('0x1a'))['db'];config[_0x46ab('0x1b')]=_[_0x46ab('0x1c')](config[_0x46ab('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x46ab('0x1d'))(new Redis(config['redis']));require(_0x46ab('0x1e'))[_0x46ab('0x1f')](socket);function respondWithStatusCode(_0xceb030,_0x3811ab){_0x3811ab=_0x3811ab||0xcc;return function(_0xfd82cd){if(_0xfd82cd){return _0xceb030[_0x46ab('0x20')](_0x3811ab);}return _0xceb030[_0x46ab('0x21')](_0x3811ab)[_0x46ab('0x22')]();};}function respondWithResult(_0x9a25f9,_0x41a22b){_0x41a22b=_0x41a22b||0xc8;return function(_0x5b28bd){if(_0x5b28bd){return _0x9a25f9['status'](_0x41a22b)[_0x46ab('0x23')](_0x5b28bd);}};}function respondWithFilteredResult(_0x1a8b6c,_0x358c63){return function(_0x2ef49){if(_0x2ef49){var _0x5a6a7e=_0x2ef49[_0x46ab('0x24')],_0x407af8=_0x358c63[_0x46ab('0x25')],_0x523dcf=_0x358c63['offset']+_0x358c63[_0x46ab('0x26')],_0x53ea92;if(_0x523dcf>=_0x5a6a7e){_0x523dcf=_0x5a6a7e;_0x53ea92=0xc8;}else{_0x53ea92=0xce;}_0x1a8b6c[_0x46ab('0x21')](_0x53ea92);return _0x1a8b6c['set'](_0x46ab('0x27'),_0x407af8+'-'+_0x523dcf+'/'+_0x5a6a7e)[_0x46ab('0x23')](_0x2ef49);}return null;};}function patchUpdates(_0x2b71f6){return function(_0x5c41cc){try{jsonpatch[_0x46ab('0x28')](_0x5c41cc,_0x2b71f6,!![]);}catch(_0x539b09){return BPromise[_0x46ab('0x29')](_0x539b09);}return _0x5c41cc[_0x46ab('0x2a')]();};}function saveUpdates(_0x360605,_0x125c45){return function(_0x43e7e3){if(_0x43e7e3){return _0x43e7e3['update'](_0x360605)[_0x46ab('0x2b')](function(_0x43c74d){return _0x43c74d;});}return null;};}function removeEntity(_0x19101e,_0x55c02e){return function(_0x409a29){if(_0x409a29){return _0x409a29[_0x46ab('0x2c')]()['then'](function(){var _0x16cbaf=_0x409a29[_0x46ab('0x2d')]({'plain':!![]});var _0x1a1b5b=_0x46ab('0x2e');return db['UserProfileResource'][_0x46ab('0x2c')]({'where':{'type':_0x1a1b5b,'resourceId':_0x16cbaf['id']}})[_0x46ab('0x2b')](function(){return _0x409a29;});})['then'](function(){_0x19101e['status'](0xcc)[_0x46ab('0x22')]();});}};}function handleEntityNotFound(_0x56c63c,_0x57638b){return function(_0xbaf106){if(!_0xbaf106){_0x56c63c[_0x46ab('0x20')](0x194);}return _0xbaf106;};}function handleError(_0x27e190,_0x2934c0){_0x2934c0=_0x2934c0||0x1f4;return function(_0x1e7bc9){logger[_0x46ab('0x2f')](_0x1e7bc9[_0x46ab('0x30')]);if(_0x1e7bc9['name']){delete _0x1e7bc9[_0x46ab('0x31')];}_0x27e190[_0x46ab('0x21')](_0x2934c0)[_0x46ab('0x32')](_0x1e7bc9);};}exports[_0x46ab('0x33')]=function(_0x11ddee,_0x2a5c1e){var _0x1a8698={},_0x4bc92f={},_0x5de4b9={'count':0x0,'rows':[]};var _0x4b2df0=db[_0x46ab('0x34')]['rawAttributes'];_0x4bc92f[_0x46ab('0x35')]=_['keys'](_0x4b2df0);_0x4bc92f[_0x46ab('0x36')]=_[_0x46ab('0x37')](_0x11ddee['query']);_0x4bc92f[_0x46ab('0x38')]=_[_0x46ab('0x39')](_0x4bc92f[_0x46ab('0x35')],_0x4bc92f[_0x46ab('0x36')]);_0x1a8698[_0x46ab('0x3a')]=_['intersection'](_0x4bc92f[_0x46ab('0x35')],qs[_0x46ab('0x3b')](_0x11ddee[_0x46ab('0x36')][_0x46ab('0x3b')]));_0x1a8698[_0x46ab('0x3a')]=_0x1a8698['attributes'][_0x46ab('0x3c')]?_0x1a8698['attributes']:_0x4bc92f['model'];if(!_0x11ddee[_0x46ab('0x36')][_0x46ab('0x3d')](_0x46ab('0x3e'))){_0x1a8698['limit']=qs['limit'](_0x11ddee[_0x46ab('0x36')]['limit']);_0x1a8698[_0x46ab('0x25')]=qs[_0x46ab('0x25')](_0x11ddee[_0x46ab('0x36')][_0x46ab('0x25')]);}_0x1a8698['order']=qs[_0x46ab('0x3f')](_0x11ddee[_0x46ab('0x36')][_0x46ab('0x3f')]);_0x1a8698[_0x46ab('0x40')]=qs['filters'](_[_0x46ab('0x41')](_0x11ddee[_0x46ab('0x36')],_0x4bc92f['filters']));if(_0x11ddee[_0x46ab('0x36')][_0x46ab('0x42')]){_0x1a8698[_0x46ab('0x40')]=_['merge'](_0x1a8698['where'],{'$or':_[_0x46ab('0x43')](_0x4b2df0,function(_0x1a7cc6){if(_0x1a7cc6['type'][_0x46ab('0x44')]!==_0x46ab('0x45')){var _0x62bfaa={};_0x62bfaa[_0x1a7cc6['field']]={'$like':'%'+_0x11ddee[_0x46ab('0x36')][_0x46ab('0x42')]+'%'};return _0x62bfaa;}})});}_0x1a8698=_['merge']({},_0x1a8698,_0x11ddee[_0x46ab('0x46')]);var _0x533327={'where':_0x1a8698[_0x46ab('0x40')]};return db['OpenchannelQueue'][_0x46ab('0x24')](_0x533327)[_0x46ab('0x2b')](function(_0x404e72){_0x5de4b9['count']=_0x404e72;if(_0x11ddee[_0x46ab('0x36')][_0x46ab('0x47')]){_0x1a8698['include']=[{'all':!![]}];}return db[_0x46ab('0x34')]['findAll'](_0x1a8698);})[_0x46ab('0x2b')](function(_0x3c18bb){_0x5de4b9['rows']=_0x3c18bb;return _0x5de4b9;})['then'](respondWithFilteredResult(_0x2a5c1e,_0x1a8698))[_0x46ab('0x48')](handleError(_0x2a5c1e,null));};exports[_0x46ab('0x49')]=function(_0x188b36,_0x34ff4a){var _0x33a4a7={'raw':!![],'where':{'id':_0x188b36['params']['id']}},_0x248aff={};_0x248aff[_0x46ab('0x35')]=_['keys'](db[_0x46ab('0x34')][_0x46ab('0x4a')]);_0x248aff[_0x46ab('0x36')]=_[_0x46ab('0x37')](_0x188b36[_0x46ab('0x36')]);_0x248aff[_0x46ab('0x38')]=_['intersection'](_0x248aff[_0x46ab('0x35')],_0x248aff[_0x46ab('0x36')]);_0x33a4a7['attributes']=_[_0x46ab('0x39')](_0x248aff['model'],qs[_0x46ab('0x3b')](_0x188b36[_0x46ab('0x36')][_0x46ab('0x3b')]));_0x33a4a7[_0x46ab('0x3a')]=_0x33a4a7['attributes'][_0x46ab('0x3c')]?_0x33a4a7[_0x46ab('0x3a')]:_0x248aff[_0x46ab('0x35')];if(_0x188b36[_0x46ab('0x36')]['includeAll']){_0x33a4a7[_0x46ab('0x4b')]=[{'all':!![]}];}_0x33a4a7=_['merge']({},_0x33a4a7,_0x188b36['options']);return db[_0x46ab('0x34')][_0x46ab('0x4c')](_0x33a4a7)[_0x46ab('0x2b')](handleEntityNotFound(_0x34ff4a,null))[_0x46ab('0x2b')](respondWithResult(_0x34ff4a,null))['catch'](handleError(_0x34ff4a,null));};exports[_0x46ab('0x4d')]=function(_0x1deacc,_0x5a07c1){return db[_0x46ab('0x34')][_0x46ab('0x4d')](_0x1deacc[_0x46ab('0x4e')],{})[_0x46ab('0x2b')](function(_0x108015){var _0x40a8cc=_0x1deacc[_0x46ab('0x4f')][_0x46ab('0x2d')]({'plain':!![]});if(!_0x40a8cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40a8cc[_0x46ab('0x50')]===_0x46ab('0x4f')){var _0x25ada8=_0x108015['get']({'plain':!![]});var _0x5ccf0b=_0x46ab('0x2e');return db[_0x46ab('0x51')][_0x46ab('0x4c')]({'where':{'name':_0x5ccf0b,'userProfileId':_0x40a8cc[_0x46ab('0x52')]},'raw':!![]})[_0x46ab('0x2b')](function(_0x40296f){if(_0x40296f&&_0x40296f[_0x46ab('0x53')]===0x0){return db['UserProfileResource'][_0x46ab('0x4d')]({'name':_0x25ada8[_0x46ab('0x31')],'resourceId':_0x25ada8['id'],'type':_0x40296f['name'],'sectionId':_0x40296f['id']},{})[_0x46ab('0x2b')](function(){return _0x108015;});}else{return _0x108015;}})[_0x46ab('0x48')](function(_0x53c6f2){logger[_0x46ab('0x2f')](_0x46ab('0x54'),_0x53c6f2);throw _0x53c6f2;});}return _0x108015;})['then'](respondWithResult(_0x5a07c1,0xc9))[_0x46ab('0x48')](handleError(_0x5a07c1,null));};exports[_0x46ab('0x55')]=function(_0x1281a8,_0x1c4d3c){if(_0x1281a8[_0x46ab('0x4e')]['id']){delete _0x1281a8['body']['id'];}return db[_0x46ab('0x34')]['find']({'where':{'id':_0x1281a8[_0x46ab('0x56')]['id']}})[_0x46ab('0x2b')](handleEntityNotFound(_0x1c4d3c,null))[_0x46ab('0x2b')](saveUpdates(_0x1281a8[_0x46ab('0x4e')],null))['then'](respondWithResult(_0x1c4d3c,null))['catch'](handleError(_0x1c4d3c,null));};exports[_0x46ab('0x2c')]=function(_0x33e44f,_0xd4ffc){return db['OpenchannelQueue']['find']({'where':{'id':_0x33e44f[_0x46ab('0x56')]['id']}})['then'](handleEntityNotFound(_0xd4ffc,null))[_0x46ab('0x2b')](removeEntity(_0xd4ffc,null))[_0x46ab('0x48')](handleError(_0xd4ffc,null));};exports[_0x46ab('0x57')]=function(_0x1fbc44,_0x2ee576){return db[_0x46ab('0x34')][_0x46ab('0x57')]()['then'](respondWithResult(_0x2ee576,null))[_0x46ab('0x48')](handleError(_0x2ee576,null));};exports['getMembers']=function(_0x45cd8d,_0x3d8eeb,_0x5c1661){var _0xd0d803={'raw':!![],'where':{}},_0x1e1226={},_0xf81d73;return db[_0x46ab('0x34')][_0x46ab('0x58')]({'where':{'id':_0x45cd8d[_0x46ab('0x56')]['id']}})['then'](handleEntityNotFound(_0x3d8eeb,null))[_0x46ab('0x2b')](function(_0x14d5f1){if(_0x14d5f1){_0xf81d73=_0x14d5f1['get']({'plain':!![]});_0x1e1226[_0x46ab('0x35')]=_[_0x46ab('0x37')](db[_0x46ab('0x59')]['rawAttributes']);_0x1e1226[_0x46ab('0x36')]=_[_0x46ab('0x37')](_0x45cd8d['query']);_0x1e1226['filters']=_[_0x46ab('0x39')](_0x1e1226[_0x46ab('0x35')],_0x1e1226['query']);_0xd0d803['attributes']=_[_0x46ab('0x39')](_0x1e1226[_0x46ab('0x35')],qs[_0x46ab('0x3b')](_0x45cd8d[_0x46ab('0x36')][_0x46ab('0x3b')]));_0xd0d803[_0x46ab('0x3a')]=_0xd0d803[_0x46ab('0x3a')]['length']?_0xd0d803['attributes']:_0x1e1226[_0x46ab('0x35')];if(!_0x45cd8d[_0x46ab('0x36')][_0x46ab('0x3d')]('nolimit')){_0xd0d803[_0x46ab('0x26')]=qs[_0x46ab('0x26')](_0x45cd8d[_0x46ab('0x36')]['limit']);_0xd0d803[_0x46ab('0x25')]=qs[_0x46ab('0x25')](_0x45cd8d['query'][_0x46ab('0x25')]);}_0xd0d803[_0x46ab('0x5a')]=qs[_0x46ab('0x3f')](_0x45cd8d[_0x46ab('0x36')][_0x46ab('0x3f')]);_0xd0d803['where']=qs['filters'](_[_0x46ab('0x41')](_0x45cd8d[_0x46ab('0x36')],_0x1e1226['filters']));_0xd0d803[_0x46ab('0x40')][_0x46ab('0x5b')]=_0x14d5f1['id'];if(_0x45cd8d[_0x46ab('0x36')][_0x46ab('0x42')]){_0xd0d803[_0x46ab('0x40')]=_[_0x46ab('0x5c')](_0xd0d803[_0x46ab('0x40')],{'$or':_[_0x46ab('0x43')](_0xd0d803[_0x46ab('0x3a')],function(_0x1b52df){var _0x7a3268={};_0x7a3268[_0x1b52df]={'$like':'%'+_0x45cd8d[_0x46ab('0x36')][_0x46ab('0x42')]+'%'};return _0x7a3268;})});}_0xd0d803=_['merge']({},_0xd0d803,_0x45cd8d[_0x46ab('0x46')]);return db[_0x46ab('0x59')][_0x46ab('0x5d')](_0xd0d803);}})[_0x46ab('0x2b')](function(_0x787716){if(_0x787716){return db[_0x46ab('0x5e')][_0x46ab('0x5f')]({'where':{'id':_[_0x46ab('0x43')](_0x787716,_0x46ab('0x60')),'role':_0x46ab('0x61')},'attributes':['id',_0x46ab('0x31'),_0x46ab('0x62'),_0x46ab('0x63'),_0x46ab('0x64')]});}})[_0x46ab('0x2b')](function(_0x98826){if(_0x98826){return{'count':_0x98826[_0x46ab('0x24')],'rows':_['map'](_0x98826['rows'],function(_0x12500c){return{'membername':_0x12500c[_0x46ab('0x31')],'UserId':_0x12500c['id'],'queue_name':_0xf81d73[_0x46ab('0x31')],'OpenchannelQueueId':_0xf81d73['id'],'interface':util['format']('%s/%s',_0x46ab('0x65'),_0x12500c[_0x46ab('0x31')]),'penalty':0x0,'paused':_0x12500c[_0x46ab('0x62')],'createdAt':_0x12500c[_0x46ab('0x64')],'updatedAt':_0x12500c[_0x46ab('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3d8eeb,_0xd0d803))[_0x46ab('0x48')](handleError(_0x3d8eeb,null));};exports[_0x46ab('0x66')]=function(_0x4eddd9,_0x377638,_0x1bfdc6){var _0x3a389d={};var _0x7f8f01={};var _0x2f47d4;var _0x2b18a0;return db[_0x46ab('0x34')][_0x46ab('0x58')]({'where':{'id':_0x4eddd9['params']['id']}})['then'](handleEntityNotFound(_0x377638,null))['then'](function(_0x152a67){if(_0x152a67){_0x2f47d4=_0x152a67;_0x7f8f01[_0x46ab('0x35')]=_[_0x46ab('0x37')](db[_0x46ab('0x67')][_0x46ab('0x4a')]);_0x7f8f01[_0x46ab('0x36')]=_[_0x46ab('0x37')](_0x4eddd9['query']);_0x7f8f01[_0x46ab('0x38')]=_[_0x46ab('0x39')](_0x7f8f01[_0x46ab('0x35')],_0x7f8f01['query']);_0x3a389d[_0x46ab('0x3a')]=_[_0x46ab('0x39')](_0x7f8f01[_0x46ab('0x35')],qs['fields'](_0x4eddd9[_0x46ab('0x36')][_0x46ab('0x3b')]));_0x3a389d['attributes']=_0x3a389d[_0x46ab('0x3a')][_0x46ab('0x3c')]?_0x3a389d[_0x46ab('0x3a')]:_0x7f8f01['model'];_0x3a389d[_0x46ab('0x5a')]=qs[_0x46ab('0x3f')](_0x4eddd9[_0x46ab('0x36')][_0x46ab('0x3f')]);_0x3a389d['where']=qs[_0x46ab('0x38')](_[_0x46ab('0x41')](_0x4eddd9['query'],_0x7f8f01[_0x46ab('0x38')]));if(_0x4eddd9['query'][_0x46ab('0x42')]){_0x3a389d[_0x46ab('0x40')]=_[_0x46ab('0x5c')](_0x3a389d['where'],{'$or':_[_0x46ab('0x43')](_0x3a389d[_0x46ab('0x3a')],function(_0x59c880){var _0x2daf09={};_0x2daf09[_0x59c880]={'$like':'%'+_0x4eddd9['query']['filter']+'%'};return _0x2daf09;})});}_0x3a389d=_[_0x46ab('0x5c')]({},_0x3a389d,_0x4eddd9['options']);return _0x2f47d4[_0x46ab('0x66')](_0x3a389d);}})[_0x46ab('0x2b')](function(_0x5ba2c5){if(_0x5ba2c5){_0x2b18a0=_0x5ba2c5['length'];if(!_0x4eddd9['query'][_0x46ab('0x3d')](_0x46ab('0x3e'))){_0x3a389d['limit']=qs[_0x46ab('0x26')](_0x4eddd9[_0x46ab('0x36')][_0x46ab('0x26')]);_0x3a389d[_0x46ab('0x25')]=qs[_0x46ab('0x25')](_0x4eddd9[_0x46ab('0x36')]['offset']);}return _0x2f47d4['getTeams'](_0x3a389d);}})[_0x46ab('0x2b')](function(_0x5d0eee){if(_0x5d0eee){return _0x5d0eee?{'count':_0x2b18a0,'rows':_0x5d0eee}:null;}})[_0x46ab('0x2b')](respondWithResult(_0x377638,null))[_0x46ab('0x48')](handleError(_0x377638,null));};exports[_0x46ab('0x68')]=function(_0x564b37,_0x447d40,_0x5a10eb){var _0x45d78d=_0x564b37[_0x46ab('0x4e')][_0x46ab('0x69')];return db[_0x46ab('0x67')][_0x46ab('0x5d')]({'where':{'id':_['map'](_0x45d78d,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x46ab('0x6a'),'attributes':['id','name','online','voicePause',_0x46ab('0x6b')],'raw':!![]}]})[_0x46ab('0x2b')](function(_0x6adf58){if(_0x6adf58){var _0x5849ab=_[_0x46ab('0x6c')](_0x6adf58,function(_0xb8861d){var _0x4043ca=_0xb8861d[_0x46ab('0x2d')]({'plain':!![]});return _0x4043ca[_0x46ab('0x6a')];});return db[_0x46ab('0x34')][_0x46ab('0x4c')]({'where':{'id':_0x564b37['params']['id']}})[_0x46ab('0x2b')](function(_0x365334){return db[_0x46ab('0x6d')][_0x46ab('0x6e')](function(_0x61692c){return _0x365334[_0x46ab('0x68')](_[_0x46ab('0x43')](_0x45d78d,'id'),{'transaction':_0x61692c})[_0x46ab('0x2b')](function(){return BPromise[_0x46ab('0x6f')](_0x5849ab,function(_0x24a9c7){return db[_0x46ab('0x59')][_0x46ab('0x70')]({'where':{'UserId':_0x24a9c7['id'],'OpenchannelQueueId':_0x564b37['params']['id']},'transaction':_0x61692c});});})['then'](function(){_0x5849ab[_0x46ab('0x71')](function(_0xdbde3c){socket['emit'](_0x46ab('0x72'),{'UserId':_0xdbde3c['id'],'OpenchannelQueueId':_0x365334['id']});});});});});}})['then'](respondWithStatusCode(_0x447d40,null))[_0x46ab('0x48')](handleError(_0x447d40,null));};exports[_0x46ab('0x73')]=function(_0xa095bb,_0x3e8c78,_0x168ebd){return db[_0x46ab('0x67')]['findAll']({'where':{'id':_0xa095bb[_0x46ab('0x36')][_0x46ab('0x74')]},'attributes':['id'],'include':[{'model':db[_0x46ab('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x46ab('0x2b')](handleEntityNotFound(_0x3e8c78,null))[_0x46ab('0x2b')](function(_0x9ea9af){var _0x4883ca=_['map'](_0x9ea9af,'id');var _0x467ed5=[];var _0x544234=[];var _0x2e1f92=squel[_0x46ab('0x75')]();_0x2e1f92[_0x46ab('0x76')](_0x46ab('0x77'))['from']('team_has_openchannel_queues','tq')['join'](_0x46ab('0x78'),'ut',_0x46ab('0x79'))['where'](_0x46ab('0x7a'),_0xa095bb[_0x46ab('0x56')]['id']);for(var _0x5ac30f=0x0;_0x5ac30f<_0x9ea9af['length'];_0x5ac30f+=0x1){let _0x4aa032=_0x9ea9af[_0x5ac30f];for(var _0x2d7bbb=0x0;_0x2d7bbb<_0x4aa032[_0x46ab('0x6a')][_0x46ab('0x3c')];_0x2d7bbb+=0x1){let _0x854e25=_0x4aa032['Agents'][_0x2d7bbb];var _0x5a5ca4=_0x2e1f92[_0x46ab('0x7b')]();_0x5a5ca4['where'](_0x46ab('0x7c'),_0x854e25['id']);_0x544234[_0x46ab('0x7d')](db[_0x46ab('0x6d')][_0x46ab('0x36')](_0x5a5ca4['toString'](),{'type':db[_0x46ab('0x6d')]['QueryTypes'][_0x46ab('0x7e')]})[_0x46ab('0x2b')](function(_0x1eeaa3){if(_0x1eeaa3[_0x46ab('0x3c')]===0x1){return _0x854e25['id'];}else{var _0x235eaa=_['every'](_[_0x46ab('0x43')](_0x1eeaa3,_0x46ab('0x7f')),function(_0x2caad9){return _['includes'](_0x4883ca,_0x2caad9);});if(_0x235eaa){return _0x854e25['id'];}}}));}}return BPromise[_0x46ab('0x80')](_0x544234)[_0x46ab('0x2b')](function(_0x4f0d8e){_0x467ed5=_(_0x467ed5)[_0x46ab('0x81')](_0x4f0d8e)[_0x46ab('0x82')]()['value']();return db[_0x46ab('0x34')][_0x46ab('0x4c')]({'where':{'id':_0xa095bb['params']['id']}})[_0x46ab('0x2b')](function(_0x2880eb){return db[_0x46ab('0x6d')][_0x46ab('0x6e')](function(_0x2f0c18){return _0x2880eb[_0x46ab('0x73')](_0xa095bb[_0x46ab('0x36')][_0x46ab('0x74')],{'transaction':_0x2f0c18})[_0x46ab('0x2b')](function(){if(!_['isEmpty'](_0x467ed5)){return _0x2880eb['removeAgents'](_0x467ed5,{'transaction':_0x2f0c18});}})['then'](function(){_0x467ed5[_0x46ab('0x71')](function(_0x2703e7){socket[_0x46ab('0x83')]('userOpenchannelQueue:remove',{'UserId':_0x2703e7,'OpenchannelQueueId':_0x2880eb['id']});});});});});});})[_0x46ab('0x2b')](respondWithStatusCode(_0x3e8c78,null))['catch'](handleError(_0x3e8c78,null));};exports[_0x46ab('0x84')]=function(_0x9375fb,_0x381ac4,_0x124d8a){return db[_0x46ab('0x34')]['find']({'where':{'id':_0x9375fb[_0x46ab('0x56')]['id']}})[_0x46ab('0x2b')](handleEntityNotFound(_0x381ac4,null))[_0x46ab('0x2b')](function(_0x2d4cdd){if(_0x2d4cdd){return _0x2d4cdd['addAgents'](_0x9375fb[_0x46ab('0x4e')][_0x46ab('0x74')],_['omit'](_0x9375fb[_0x46ab('0x4e')],[_0x46ab('0x74'),'id'])||{})[_0x46ab('0x85')](function(_0x4ab133){for(var _0x116f1e=0x0;_0x116f1e<_0x9375fb[_0x46ab('0x4e')][_0x46ab('0x74')][_0x46ab('0x3c')];_0x116f1e+=0x1){socket[_0x46ab('0x83')](_0x46ab('0x72'),{'UserId':_0x9375fb[_0x46ab('0x4e')][_0x46ab('0x74')][_0x116f1e],'OpenchannelQueueId':_0x9375fb[_0x46ab('0x56')]['id']});}return _0x4ab133;});}})[_0x46ab('0x2b')](respondWithResult(_0x381ac4,null))[_0x46ab('0x48')](handleError(_0x381ac4,null));};exports[_0x46ab('0x86')]=function(_0x385666,_0x4e180e,_0x267836){return db[_0x46ab('0x34')]['find']({'where':{'id':_0x385666[_0x46ab('0x56')]['id']}})[_0x46ab('0x2b')](handleEntityNotFound(_0x4e180e,null))[_0x46ab('0x2b')](function(_0xdc8e71){if(_0xdc8e71){return _0xdc8e71[_0x46ab('0x86')](_0x385666[_0x46ab('0x36')][_0x46ab('0x74')])['then'](function(){if(_[_0x46ab('0x87')](_0x385666[_0x46ab('0x36')][_0x46ab('0x74')])){for(var _0x169595=0x0;_0x169595<_0x385666[_0x46ab('0x36')][_0x46ab('0x74')][_0x46ab('0x3c')];_0x169595+=0x1){socket[_0x46ab('0x83')](_0x46ab('0x88'),{'UserId':Number(_0x385666[_0x46ab('0x36')][_0x46ab('0x74')][_0x169595]),'OpenchannelQueueId':Number(_0x385666['params']['id'])});}}else{socket[_0x46ab('0x83')](_0x46ab('0x88'),{'UserId':Number(_0x385666[_0x46ab('0x36')]['ids']),'OpenchannelQueueId':Number(_0x385666['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4e180e,null))['catch'](handleError(_0x4e180e,null));};exports[_0x46ab('0x89')]=function(_0x157e4c,_0x27ae88,_0x36d1f5){var _0x4d0236={};var _0x837840={};var _0x1eb36b;var _0x3dbb62;return db[_0x46ab('0x34')][_0x46ab('0x58')]({'where':{'id':_0x157e4c[_0x46ab('0x56')]['id']}})[_0x46ab('0x2b')](handleEntityNotFound(_0x27ae88,null))['then'](function(_0x1df49e){if(_0x1df49e){_0x1eb36b=_0x1df49e;_0x837840[_0x46ab('0x35')]=_[_0x46ab('0x37')](db[_0x46ab('0x5e')][_0x46ab('0x4a')]);_0x837840[_0x46ab('0x36')]=_[_0x46ab('0x37')](_0x157e4c[_0x46ab('0x36')]);_0x837840[_0x46ab('0x38')]=_[_0x46ab('0x39')](_0x837840['model'],_0x837840[_0x46ab('0x36')]);_0x4d0236[_0x46ab('0x3a')]=_['intersection'](_0x837840['model'],qs['fields'](_0x157e4c[_0x46ab('0x36')][_0x46ab('0x3b')]));_0x4d0236[_0x46ab('0x3a')]=_0x4d0236[_0x46ab('0x3a')][_0x46ab('0x3c')]?_0x4d0236[_0x46ab('0x3a')]:_0x837840[_0x46ab('0x35')];_0x4d0236[_0x46ab('0x5a')]=qs[_0x46ab('0x3f')](_0x157e4c[_0x46ab('0x36')]['sort']);_0x4d0236[_0x46ab('0x40')]=qs['filters'](_['pick'](_0x157e4c[_0x46ab('0x36')],_0x837840[_0x46ab('0x38')]));if(_0x157e4c[_0x46ab('0x36')][_0x46ab('0x42')]){_0x4d0236[_0x46ab('0x40')]=_[_0x46ab('0x5c')](_0x4d0236['where'],{'$or':_[_0x46ab('0x43')](_0x4d0236[_0x46ab('0x3a')],function(_0x10695e){var _0x368ed1={};_0x368ed1[_0x10695e]={'$like':'%'+_0x157e4c[_0x46ab('0x36')][_0x46ab('0x42')]+'%'};return _0x368ed1;})});}_0x4d0236=_['merge']({},_0x4d0236,_0x157e4c[_0x46ab('0x46')]);return _0x1eb36b[_0x46ab('0x89')](_0x4d0236);}})[_0x46ab('0x2b')](function(_0x1d9ad0){if(_0x1d9ad0){_0x3dbb62=_0x1d9ad0['length'];if(!_0x157e4c[_0x46ab('0x36')][_0x46ab('0x3d')](_0x46ab('0x3e'))){_0x4d0236['limit']=qs[_0x46ab('0x26')](_0x157e4c[_0x46ab('0x36')][_0x46ab('0x26')]);_0x4d0236[_0x46ab('0x25')]=qs['offset'](_0x157e4c[_0x46ab('0x36')][_0x46ab('0x25')]);}return _0x1eb36b[_0x46ab('0x89')](_0x4d0236);}})['then'](function(_0x433065){if(_0x433065){return _0x433065?{'count':_0x3dbb62,'rows':_0x433065}:null;}})['then'](respondWithResult(_0x27ae88,null))['catch'](handleError(_0x27ae88,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index f695bda..3c31783 100644 --- a/server/api/openchannelQueue/openchannelQueue.events.js +++ b/server/api/openchannelQueue/openchannelQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2c2=['emit','exports','events','OpenchannelQueue','setMaxListeners','save','update','remove'];(function(_0x180fb9,_0x5f0f97){var _0x2aa224=function(_0x43c6ee){while(--_0x43c6ee){_0x180fb9['push'](_0x180fb9['shift']());}};_0x2aa224(++_0x5f0f97);}(_0xe2c2,0x162));var _0x2e2c=function(_0x16509a,_0x297a3b){_0x16509a=_0x16509a-0x0;var _0x473323=_0xe2c2[_0x16509a];return _0x473323;};'use strict';var EventEmitter=require(_0x2e2c('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x2e2c('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2e2c('0x2')](0x0);var events={'afterCreate':_0x2e2c('0x3'),'afterUpdate':_0x2e2c('0x4'),'afterDestroy':_0x2e2c('0x5')};function emitEvent(_0x28fbf2){return function(_0x17930a,_0x575cb5,_0x4c7d79){OpenchannelQueueEvents[_0x2e2c('0x6')](_0x28fbf2+':'+_0x17930a['id'],_0x17930a);OpenchannelQueueEvents['emit'](_0x28fbf2,_0x17930a);_0x4c7d79(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x2e2c('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xf52d=['emit','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove'];(function(_0x1870dd,_0x2bf1a6){var _0x49eca2=function(_0x40f8a3){while(--_0x40f8a3){_0x1870dd['push'](_0x1870dd['shift']());}};_0x49eca2(++_0x2bf1a6);}(_0xf52d,0x1d9));var _0xdf52=function(_0x2c1ac6,_0x4b4741){_0x2c1ac6=_0x2c1ac6-0x0;var _0x18dc72=_0xf52d[_0x2c1ac6];return _0x18dc72;};'use strict';var EventEmitter=require(_0xdf52('0x0'));var OpenchannelQueue=require(_0xdf52('0x1'))['db'][_0xdf52('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xdf52('0x3')](0x0);var events={'afterCreate':_0xdf52('0x4'),'afterUpdate':_0xdf52('0x5'),'afterDestroy':_0xdf52('0x6')};function emitEvent(_0x21de95){return function(_0xf4df14,_0x37ff4b,_0x53f80b){OpenchannelQueueEvents['emit'](_0x21de95+':'+_0xf4df14['id'],_0xf4df14);OpenchannelQueueEvents[_0xdf52('0x7')](_0x21de95,_0xf4df14);_0x53f80b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xdf52('0x8')](e,emitEvent(event));}}module[_0xdf52('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 8bdbe5e..c52d9c8 100644 --- a/server/api/openchannelQueue/openchannelQueue.model.js +++ b/server/api/openchannelQueue/openchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29c1=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','util','../../config/logger','api'];(function(_0x22bf49,_0x14c5e3){var _0xea63b0=function(_0x386fc0){while(--_0x386fc0){_0x22bf49['push'](_0x22bf49['shift']());}};_0xea63b0(++_0x14c5e3);}(_0x29c1,0x72));var _0x129c=function(_0x883f74,_0xd2369b){_0x883f74=_0x883f74-0x0;var _0x1fe2ca=_0x29c1[_0x883f74];return _0x1fe2ca;};'use strict';var _=require('lodash');var util=require(_0x129c('0x0'));var logger=require(_0x129c('0x1'))(_0x129c('0x2'));var moment=require('moment');var BPromise=require(_0x129c('0x3'));var rp=require(_0x129c('0x4'));var fs=require('fs');var path=require(_0x129c('0x5'));var rimraf=require(_0x129c('0x6'));var config=require(_0x129c('0x7'));var attributes=require(_0x129c('0x8'));module[_0x129c('0x9')]=function(_0x4f4ab5,_0x3e241f){return _0x4f4ab5[_0x129c('0xa')](_0x129c('0xb'),attributes,{'tableName':_0x129c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x160b=['exports','define','OpenchannelQueue','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x47cce9,_0x2e0548){var _0x273252=function(_0x28ab75){while(--_0x28ab75){_0x47cce9['push'](_0x47cce9['shift']());}};_0x273252(++_0x2e0548);}(_0x160b,0xff));var _0xb160=function(_0x1a75ef,_0x30fb5f){_0x1a75ef=_0x1a75ef-0x0;var _0x323896=_0x160b[_0x1a75ef];return _0x323896;};'use strict';var _=require(_0xb160('0x0'));var util=require(_0xb160('0x1'));var logger=require(_0xb160('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb160('0x3'));var rp=require(_0xb160('0x4'));var fs=require('fs');var path=require(_0xb160('0x5'));var rimraf=require(_0xb160('0x6'));var config=require(_0xb160('0x7'));var attributes=require(_0xb160('0x8'));module[_0xb160('0x9')]=function(_0x42a9c4,_0x29248e){return _0x42a9c4[_0xb160('0xa')](_0xb160('0xb'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index e6047a7..9b64fef 100644 --- a/server/api/openchannelQueue/openchannelQueue.rpc.js +++ b/server/api/openchannelQueue/openchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b2b=['info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','stringify','catch','ShowOpenchannelQueue','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then'];(function(_0x18ebf5,_0x5889ea){var _0x302a3e=function(_0x3b725a){while(--_0x3b725a){_0x18ebf5['push'](_0x18ebf5['shift']());}};_0x302a3e(++_0x5889ea);}(_0x4b2b,0xb6));var _0xb4b2=function(_0xce56f2,_0x12aaef){_0xce56f2=_0xce56f2-0x0;var _0x3961f0=_0x4b2b[_0xce56f2];return _0x3961f0;};'use strict';var _=require(_0xb4b2('0x0'));var util=require(_0xb4b2('0x1'));var moment=require(_0xb4b2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4b2('0x3'));var db=require(_0xb4b2('0x4'))['db'];var utils=require(_0xb4b2('0x5'));var logger=require(_0xb4b2('0x6'))(_0xb4b2('0x7'));var config=require(_0xb4b2('0x8'));var jayson=require(_0xb4b2('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xb4b2('0xa')]=_[_0xb4b2('0xb')](config[_0xb4b2('0xa')],{'host':_0xb4b2('0xc'),'port':0x18eb});var socket=require(_0xb4b2('0xd'))(new Redis(config[_0xb4b2('0xa')]));require(_0xb4b2('0xe'))[_0xb4b2('0xf')](socket);function respondWithRpcPromise(_0x1deef7,_0x11da97,_0x1c4ad2){return new BPromise(function(_0x41aee8,_0x2dd117){return client[_0xb4b2('0x10')](_0x1deef7,_0x1c4ad2)[_0xb4b2('0x11')](function(_0x502359){logger[_0xb4b2('0x12')](_0xb4b2('0x13'),_0x11da97,_0xb4b2('0x14'));logger[_0xb4b2('0x15')](_0xb4b2('0x16'),_0x11da97,_0xb4b2('0x14'),JSON['stringify'](_0x502359));if(_0x502359[_0xb4b2('0x17')]){if(_0x502359[_0xb4b2('0x17')][_0xb4b2('0x18')]===0x1f4){logger[_0xb4b2('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x11da97,_0x502359[_0xb4b2('0x17')][_0xb4b2('0x19')]);return _0x2dd117(_0x502359[_0xb4b2('0x17')][_0xb4b2('0x19')]);}logger[_0xb4b2('0x17')](_0xb4b2('0x13'),_0x11da97,_0x502359[_0xb4b2('0x17')][_0xb4b2('0x19')]);return _0x41aee8(_0x502359['error'][_0xb4b2('0x19')]);}else{logger[_0xb4b2('0x12')](_0xb4b2('0x13'),_0x11da97,'request\x20sent');_0x41aee8(_0x502359['result'][_0xb4b2('0x19')]);}})['catch'](function(_0x5b1f46){logger['error'](_0xb4b2('0x13'),_0x11da97,_0x5b1f46);_0x2dd117(_0x5b1f46);});});}exports[_0xb4b2('0x1a')]=function(_0x31b867){var _0x909c8d=this;return new Promise(function(_0x2186e0,_0x30de03){return db[_0xb4b2('0x1b')][_0xb4b2('0x1c')]({'raw':_0x31b867[_0xb4b2('0x1d')]?_0x31b867[_0xb4b2('0x1d')][_0xb4b2('0x1e')]===undefined?!![]:![]:!![],'where':_0x31b867[_0xb4b2('0x1d')]?_0x31b867[_0xb4b2('0x1d')][_0xb4b2('0x1f')]||null:null,'attributes':_0x31b867['options']?_0x31b867[_0xb4b2('0x1d')][_0xb4b2('0x20')]||null:null,'limit':_0x31b867[_0xb4b2('0x1d')]?_0x31b867[_0xb4b2('0x1d')]['limit']||null:null,'include':_0x31b867[_0xb4b2('0x1d')]?_0x31b867[_0xb4b2('0x1d')][_0xb4b2('0x21')]?_[_0xb4b2('0x22')](_0x31b867['options']['include'],function(_0x55cd69){return{'model':db[_0x55cd69['model']],'as':_0x55cd69['as'],'attributes':_0x55cd69['attributes'],'include':_0x55cd69['include']?_[_0xb4b2('0x22')](_0x55cd69['include'],function(_0x271f8c){return{'model':db[_0x271f8c[_0xb4b2('0x23')]],'as':_0x271f8c['as'],'attributes':_0x271f8c[_0xb4b2('0x20')],'include':_0x271f8c['include']?_['map'](_0x271f8c[_0xb4b2('0x21')],function(_0x54cccb){return{'model':db[_0x54cccb[_0xb4b2('0x23')]],'as':_0x54cccb['as'],'attributes':_0x54cccb[_0xb4b2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb4b2('0x11')](function(_0x41a938){logger[_0xb4b2('0x12')](_0xb4b2('0x1a'),_0x31b867);logger['debug'](_0xb4b2('0x1a'),_0x31b867,JSON[_0xb4b2('0x24')](_0x41a938));_0x2186e0(_0x41a938);})[_0xb4b2('0x25')](function(_0x2317cc){logger['error'](_0xb4b2('0x1a'),_0x2317cc[_0xb4b2('0x19')],_0x31b867);_0x30de03(_0x909c8d[_0xb4b2('0x17')](0x1f4,_0x2317cc['message']));});});};exports[_0xb4b2('0x26')]=function(_0x3723a){var _0x5066d2=this;return new Promise(function(_0x17eec8,_0x153c8f){return db['OpenchannelQueue'][_0xb4b2('0x27')]({'raw':_0x3723a['options']?_0x3723a[_0xb4b2('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3723a[_0xb4b2('0x1d')]?_0x3723a[_0xb4b2('0x1d')][_0xb4b2('0x1f')]||null:null,'attributes':_0x3723a['options']?_0x3723a['options'][_0xb4b2('0x20')]||null:null,'include':_0x3723a[_0xb4b2('0x1d')]?_0x3723a[_0xb4b2('0x1d')][_0xb4b2('0x21')]?_[_0xb4b2('0x22')](_0x3723a[_0xb4b2('0x1d')][_0xb4b2('0x21')],function(_0x2ab706){return{'model':db[_0x2ab706[_0xb4b2('0x23')]],'as':_0x2ab706['as'],'attributes':_0x2ab706[_0xb4b2('0x20')],'include':_0x2ab706['include']?_[_0xb4b2('0x22')](_0x2ab706['include'],function(_0x104260){return{'model':db[_0x104260['model']],'as':_0x104260['as'],'attributes':_0x104260[_0xb4b2('0x20')],'include':_0x104260['include']?_[_0xb4b2('0x22')](_0x104260[_0xb4b2('0x21')],function(_0x36c453){return{'model':db[_0x36c453[_0xb4b2('0x23')]],'as':_0x36c453['as'],'attributes':_0x36c453[_0xb4b2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb4b2('0x11')](function(_0x15a705){logger[_0xb4b2('0x12')](_0xb4b2('0x26'),_0x3723a);logger[_0xb4b2('0x15')](_0xb4b2('0x26'),_0x3723a,JSON[_0xb4b2('0x24')](_0x15a705));_0x17eec8(_0x15a705);})[_0xb4b2('0x25')](function(_0x63c6df){logger['error']('ShowOpenchannelQueue',_0x63c6df['message'],_0x3723a);_0x153c8f(_0x5066d2[_0xb4b2('0x17')](0x1f4,_0x63c6df[_0xb4b2('0x19')]));});});}; \ No newline at end of file +var _0xb643=['error','code','OpenchannelQueue,\x20%s,\x20%s','message','info','result','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','include','model','map','then','catch','find','ShowOpenchannelQueue','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./openchannelQueue.socket','request\x20sent','stringify'];(function(_0x1b3e73,_0x4d5adc){var _0x42c9d5=function(_0x44a79d){while(--_0x44a79d){_0x1b3e73['push'](_0x1b3e73['shift']());}};_0x42c9d5(++_0x4d5adc);}(_0xb643,0x125));var _0x3b64=function(_0x1c09ba,_0x5eb0c0){_0x1c09ba=_0x1c09ba-0x0;var _0x4b3a39=_0xb643[_0x1c09ba];return _0x4b3a39;};'use strict';var _=require(_0x3b64('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3b64('0x1'));var rs=require(_0x3b64('0x2'));var fs=require('fs');var Redis=require(_0x3b64('0x3'));var db=require(_0x3b64('0x4'))['db'];var utils=require(_0x3b64('0x5'));var logger=require(_0x3b64('0x6'))(_0x3b64('0x7'));var config=require(_0x3b64('0x8'));var jayson=require(_0x3b64('0x9'));var client=jayson[_0x3b64('0xa')][_0x3b64('0xb')]({'port':0x232a});config['redis']=_[_0x3b64('0xc')](config['redis'],{'host':_0x3b64('0xd'),'port':0x18eb});var socket=require(_0x3b64('0xe'))(new Redis(config[_0x3b64('0xf')]));require(_0x3b64('0x10'))['register'](socket);function respondWithRpcPromise(_0x529f2a,_0x41f486,_0x2eac74){return new BPromise(function(_0x5456fd,_0x932609){return client['request'](_0x529f2a,_0x2eac74)['then'](function(_0x106080){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x41f486,_0x3b64('0x11'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x41f486,_0x3b64('0x11'),JSON[_0x3b64('0x12')](_0x106080));if(_0x106080[_0x3b64('0x13')]){if(_0x106080[_0x3b64('0x13')][_0x3b64('0x14')]===0x1f4){logger[_0x3b64('0x13')](_0x3b64('0x15'),_0x41f486,_0x106080[_0x3b64('0x13')][_0x3b64('0x16')]);return _0x932609(_0x106080[_0x3b64('0x13')]['message']);}logger[_0x3b64('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x41f486,_0x106080['error']['message']);return _0x5456fd(_0x106080[_0x3b64('0x13')]['message']);}else{logger[_0x3b64('0x17')](_0x3b64('0x15'),_0x41f486,'request\x20sent');_0x5456fd(_0x106080[_0x3b64('0x18')]['message']);}})['catch'](function(_0xf51c21){logger[_0x3b64('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x41f486,_0xf51c21);_0x932609(_0xf51c21);});});}exports[_0x3b64('0x19')]=function(_0x139d97){var _0xdad9c6=this;return new Promise(function(_0x1bf828,_0x5300c3){return db[_0x3b64('0x1a')]['findAll']({'raw':_0x139d97['options']?_0x139d97[_0x3b64('0x1b')][_0x3b64('0x1c')]===undefined?!![]:![]:!![],'where':_0x139d97['options']?_0x139d97[_0x3b64('0x1b')][_0x3b64('0x1d')]||null:null,'attributes':_0x139d97[_0x3b64('0x1b')]?_0x139d97[_0x3b64('0x1b')][_0x3b64('0x1e')]||null:null,'limit':_0x139d97[_0x3b64('0x1b')]?_0x139d97[_0x3b64('0x1b')]['limit']||null:null,'include':_0x139d97[_0x3b64('0x1b')]?_0x139d97['options'][_0x3b64('0x1f')]?_['map'](_0x139d97[_0x3b64('0x1b')][_0x3b64('0x1f')],function(_0x59eb23){return{'model':db[_0x59eb23[_0x3b64('0x20')]],'as':_0x59eb23['as'],'attributes':_0x59eb23['attributes'],'include':_0x59eb23[_0x3b64('0x1f')]?_[_0x3b64('0x21')](_0x59eb23['include'],function(_0x3428b3){return{'model':db[_0x3428b3[_0x3b64('0x20')]],'as':_0x3428b3['as'],'attributes':_0x3428b3[_0x3b64('0x1e')],'include':_0x3428b3[_0x3b64('0x1f')]?_[_0x3b64('0x21')](_0x3428b3[_0x3b64('0x1f')],function(_0x368656){return{'model':db[_0x368656[_0x3b64('0x20')]],'as':_0x368656['as'],'attributes':_0x368656[_0x3b64('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3b64('0x22')](function(_0x35179f){logger[_0x3b64('0x17')](_0x3b64('0x19'),_0x139d97);logger['debug'](_0x3b64('0x19'),_0x139d97,JSON[_0x3b64('0x12')](_0x35179f));_0x1bf828(_0x35179f);})[_0x3b64('0x23')](function(_0x514473){logger[_0x3b64('0x13')](_0x3b64('0x19'),_0x514473[_0x3b64('0x16')],_0x139d97);_0x5300c3(_0xdad9c6[_0x3b64('0x13')](0x1f4,_0x514473[_0x3b64('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x1f112c){var _0x7876fb=this;return new Promise(function(_0x3e3177,_0x3904d3){return db['OpenchannelQueue'][_0x3b64('0x24')]({'raw':_0x1f112c[_0x3b64('0x1b')]?_0x1f112c['options'][_0x3b64('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f112c[_0x3b64('0x1b')]?_0x1f112c[_0x3b64('0x1b')][_0x3b64('0x1d')]||null:null,'attributes':_0x1f112c[_0x3b64('0x1b')]?_0x1f112c[_0x3b64('0x1b')][_0x3b64('0x1e')]||null:null,'include':_0x1f112c[_0x3b64('0x1b')]?_0x1f112c[_0x3b64('0x1b')][_0x3b64('0x1f')]?_['map'](_0x1f112c[_0x3b64('0x1b')][_0x3b64('0x1f')],function(_0x419e46){return{'model':db[_0x419e46[_0x3b64('0x20')]],'as':_0x419e46['as'],'attributes':_0x419e46[_0x3b64('0x1e')],'include':_0x419e46[_0x3b64('0x1f')]?_['map'](_0x419e46[_0x3b64('0x1f')],function(_0x25a78c){return{'model':db[_0x25a78c['model']],'as':_0x25a78c['as'],'attributes':_0x25a78c[_0x3b64('0x1e')],'include':_0x25a78c['include']?_['map'](_0x25a78c['include'],function(_0x7ddbb1){return{'model':db[_0x7ddbb1['model']],'as':_0x7ddbb1['as'],'attributes':_0x7ddbb1[_0x3b64('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3b64('0x22')](function(_0x8519a8){logger[_0x3b64('0x17')](_0x3b64('0x25'),_0x1f112c);logger[_0x3b64('0x26')]('ShowOpenchannelQueue',_0x1f112c,JSON['stringify'](_0x8519a8));_0x3e3177(_0x8519a8);})[_0x3b64('0x23')](function(_0x33cf87){logger[_0x3b64('0x13')](_0x3b64('0x25'),_0x33cf87[_0x3b64('0x16')],_0x1f112c);_0x3904d3(_0x7876fb[_0x3b64('0x13')](0x1f4,_0x33cf87[_0x3b64('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 9db2d43..a91f0ba 100644 --- a/server/api/openchannelQueue/openchannelQueue.socket.js +++ b/server/api/openchannelQueue/openchannelQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7751=['removeListener','openchannelQueue:','./openchannelQueue.events','save','remove','emit'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x7751,0xf8));var _0x1775=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7751[_0x14add3];return _0x4a174f;};'use strict';var OpenchannelQueueEvents=require(_0x1775('0x0'));var events=[_0x1775('0x1'),_0x1775('0x2'),'update'];function createListener(_0x5d1454,_0x4a83d8){return function(_0x11d5fe){_0x4a83d8[_0x1775('0x3')](_0x5d1454,_0x11d5fe);};}function removeListener(_0x513cb4,_0x2732be){return function(){OpenchannelQueueEvents[_0x1775('0x4')](_0x513cb4,_0x2732be);};}exports['register']=function(_0x95bc85){for(var _0x276ccd=0x0,_0x3bcac8=events['length'];_0x276ccd<_0x3bcac8;_0x276ccd++){var _0x5d5b85=events[_0x276ccd];var _0x5c9fc0=createListener(_0x1775('0x5')+_0x5d5b85,_0x95bc85);OpenchannelQueueEvents['on'](_0x5d5b85,_0x5c9fc0);}}; \ No newline at end of file +var _0x085c=['removeListener','register','length','./openchannelQueue.events','remove','update','emit'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x085c,0x137));var _0xc085=function(_0x5e1e25,_0xdc1421){_0x5e1e25=_0x5e1e25-0x0;var _0x548e5f=_0x085c[_0x5e1e25];return _0x548e5f;};'use strict';var OpenchannelQueueEvents=require(_0xc085('0x0'));var events=['save',_0xc085('0x1'),_0xc085('0x2')];function createListener(_0x471c5a,_0x58ee20){return function(_0x21b5cd){_0x58ee20[_0xc085('0x3')](_0x471c5a,_0x21b5cd);};}function removeListener(_0x266d53,_0x303812){return function(){OpenchannelQueueEvents[_0xc085('0x4')](_0x266d53,_0x303812);};}exports[_0xc085('0x5')]=function(_0x23b2a5){for(var _0x1ec380=0x0,_0x489ac2=events[_0xc085('0x6')];_0x1ec380<_0x489ac2;_0x1ec380++){var _0x1eaf28=events[_0x1ec380];var _0x16a245=createListener('openchannelQueue:'+_0x1eaf28,_0x23b2a5);OpenchannelQueueEvents['on'](_0x1eaf28,_0x16a245);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index adbe970..31b6789 100644 --- a/server/api/openchannelQueueReport/index.js +++ b/server/api/openchannelQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9a8=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','show','create','put','/:id','update','destroy','exports','multer','util','path'];(function(_0x5df033,_0x29458b){var _0x445829=function(_0x2c795b){while(--_0x2c795b){_0x5df033['push'](_0x5df033['shift']());}};_0x445829(++_0x29458b);}(_0xf9a8,0xed));var _0x8f9a=function(_0x203497,_0xa582f8){_0x203497=_0x203497-0x0;var _0x1d4ed9=_0xf9a8[_0x203497];return _0x1d4ed9;};'use strict';var multer=require(_0x8f9a('0x0'));var util=require(_0x8f9a('0x1'));var path=require(_0x8f9a('0x2'));var timeout=require(_0x8f9a('0x3'));var express=require(_0x8f9a('0x4'));var router=express[_0x8f9a('0x5')]();var auth=require(_0x8f9a('0x6'));var interaction=require(_0x8f9a('0x7'));var config=require('../../config/environment');var controller=require(_0x8f9a('0x8'));router[_0x8f9a('0x9')]('/',auth[_0x8f9a('0xa')](),controller['index']);router[_0x8f9a('0x9')](_0x8f9a('0xb'),auth[_0x8f9a('0xa')](),controller[_0x8f9a('0xc')]);router[_0x8f9a('0x9')]('/:id',auth[_0x8f9a('0xa')](),controller[_0x8f9a('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8f9a('0xe')]);router[_0x8f9a('0xf')](_0x8f9a('0x10'),auth[_0x8f9a('0xa')](),controller[_0x8f9a('0x11')]);router['delete'](_0x8f9a('0x10'),auth[_0x8f9a('0xa')](),controller[_0x8f9a('0x12')]);module[_0x8f9a('0x13')]=router; \ No newline at end of file +var _0x0388=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated'];(function(_0x5e2e1b,_0x546d72){var _0x503b2f=function(_0x307a96){while(--_0x307a96){_0x5e2e1b['push'](_0x5e2e1b['shift']());}};_0x503b2f(++_0x546d72);}(_0x0388,0x7f));var _0x8038=function(_0x2b1b80,_0x536275){_0x2b1b80=_0x2b1b80-0x0;var _0x4c657e=_0x0388[_0x2b1b80];return _0x4c657e;};'use strict';var multer=require(_0x8038('0x0'));var util=require(_0x8038('0x1'));var path=require(_0x8038('0x2'));var timeout=require(_0x8038('0x3'));var express=require(_0x8038('0x4'));var router=express[_0x8038('0x5')]();var auth=require(_0x8038('0x6'));var interaction=require(_0x8038('0x7'));var config=require('../../config/environment');var controller=require(_0x8038('0x8'));router[_0x8038('0x9')]('/',auth[_0x8038('0xa')](),controller[_0x8038('0xb')]);router[_0x8038('0x9')](_0x8038('0xc'),auth[_0x8038('0xa')](),controller[_0x8038('0xd')]);router[_0x8038('0x9')](_0x8038('0xe'),auth[_0x8038('0xa')](),controller[_0x8038('0xf')]);router[_0x8038('0x10')]('/',auth['isAuthenticated'](),controller[_0x8038('0x11')]);router[_0x8038('0x12')](_0x8038('0xe'),auth[_0x8038('0xa')](),controller[_0x8038('0x13')]);router[_0x8038('0x14')](_0x8038('0xe'),auth[_0x8038('0xa')](),controller[_0x8038('0x15')]);module[_0x8038('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index ac3c14f..799de2f 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x760a=['exports','STRING','DATE','sequelize'];(function(_0x3e240c,_0x5db812){var _0x253d43=function(_0x40895f){while(--_0x40895f){_0x3e240c['push'](_0x3e240c['shift']());}};_0x253d43(++_0x5db812);}(_0x760a,0xf3));var _0xa760=function(_0x49ca25,_0x283d61){_0x49ca25=_0x49ca25-0x0;var _0x35dc97=_0x760a[_0x49ca25];return _0x35dc97;};'use strict';var moment=require('moment');var Sequelize=require(_0xa760('0x0'));module[_0xa760('0x1')]={'uniqueid':{'type':Sequelize[_0xa760('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa760('0x2')]},'joinAt':{'type':Sequelize[_0xa760('0x3')]},'leaveAt':{'type':Sequelize[_0xa760('0x3')]},'acceptAt':{'type':Sequelize[_0xa760('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa760('0x2')]}}; \ No newline at end of file +var _0xf7e5=['DATE','moment','sequelize','exports','STRING'];(function(_0x4c2a46,_0x568e1f){var _0x69ce24=function(_0x401def){while(--_0x401def){_0x4c2a46['push'](_0x4c2a46['shift']());}};_0x69ce24(++_0x568e1f);}(_0xf7e5,0x164));var _0x5f7e=function(_0x44d99f,_0x51b3a8){_0x44d99f=_0x44d99f-0x0;var _0x5ad611=_0xf7e5[_0x44d99f];return _0x5ad611;};'use strict';var moment=require(_0x5f7e('0x0'));var Sequelize=require(_0x5f7e('0x1'));module[_0x5f7e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5f7e('0x3')]},'joinAt':{'type':Sequelize[_0x5f7e('0x4')]},'leaveAt':{'type':Sequelize[_0x5f7e('0x4')]},'acceptAt':{'type':Sequelize[_0x5f7e('0x4')]},'exitAt':{'type':Sequelize[_0x5f7e('0x4')]},'reason':{'type':Sequelize[_0x5f7e('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 16bc3cc..9f68c6e 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x86c1=['create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','OpenchannelQueueReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','where','filter','merge','map','type','VIRTUAL','field','options','count','include','findAll','catch','show','params','includeAll','find'];(function(_0x44068d,_0x32310a){var _0x208dd7=function(_0x8f0c72){while(--_0x8f0c72){_0x44068d['push'](_0x44068d['shift']());}};_0x208dd7(++_0x32310a);}(_0x86c1,0x93));var _0x186c=function(_0x12fea8,_0x135417){_0x12fea8=_0x12fea8-0x0;var _0x44e20d=_0x86c1[_0x12fea8];return _0x44e20d;};'use strict';var pdf=require(_0x186c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x186c('0x1'));var zipdir=require(_0x186c('0x2'));var jsonpatch=require(_0x186c('0x3'));var rp=require(_0x186c('0x4'));var moment=require(_0x186c('0x5'));var BPromise=require(_0x186c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x186c('0x7'));var sox=require('sox');var csv=require(_0x186c('0x8'));var ejs=require(_0x186c('0x9'));var fs=require('fs');var _=require(_0x186c('0xa'));var squel=require(_0x186c('0xb'));var crypto=require(_0x186c('0xc'));var jsforce=require(_0x186c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x186c('0x8'));var querystring=require(_0x186c('0xe'));var Papa=require(_0x186c('0xf'));var Redis=require('ioredis');var authService=require(_0x186c('0x10'));var qs=require(_0x186c('0x11'));var hardwareService=require(_0x186c('0x12'));var logger=require('../../config/logger')(_0x186c('0x13'));var utils=require(_0x186c('0x14'));var config=require(_0x186c('0x15'));var db=require(_0x186c('0x16'))['db'];function respondWithStatusCode(_0x4da3ba,_0x1ef77f){_0x1ef77f=_0x1ef77f||0xcc;return function(_0x6d640){if(_0x6d640){return _0x4da3ba[_0x186c('0x17')](_0x1ef77f);}return _0x4da3ba[_0x186c('0x18')](_0x1ef77f)[_0x186c('0x19')]();};}function respondWithResult(_0x3f260b,_0x1e301b){_0x1e301b=_0x1e301b||0xc8;return function(_0x12a66d){if(_0x12a66d){return _0x3f260b[_0x186c('0x18')](_0x1e301b)[_0x186c('0x1a')](_0x12a66d);}};}function respondWithFilteredResult(_0x4bcaf0,_0x27fddc){return function(_0x3a462e){if(_0x3a462e){var _0x2ce133=_0x3a462e['count'],_0x32db5f=_0x27fddc[_0x186c('0x1b')],_0x773fb3=_0x27fddc[_0x186c('0x1b')]+_0x27fddc[_0x186c('0x1c')],_0x155bc4;if(_0x773fb3>=_0x2ce133){_0x773fb3=_0x2ce133;_0x155bc4=0xc8;}else{_0x155bc4=0xce;}_0x4bcaf0[_0x186c('0x18')](_0x155bc4);return _0x4bcaf0[_0x186c('0x1d')](_0x186c('0x1e'),_0x32db5f+'-'+_0x773fb3+'/'+_0x2ce133)[_0x186c('0x1a')](_0x3a462e);}return null;};}function patchUpdates(_0x415da2){return function(_0xb6ddab){try{jsonpatch[_0x186c('0x1f')](_0xb6ddab,_0x415da2,!![]);}catch(_0x33bc34){return BPromise['reject'](_0x33bc34);}return _0xb6ddab[_0x186c('0x20')]();};}function saveUpdates(_0x1a7ec7,_0x3313ab){return function(_0x3d4889){if(_0x3d4889){return _0x3d4889[_0x186c('0x21')](_0x1a7ec7)[_0x186c('0x22')](function(_0x3e4336){return _0x3e4336;});}return null;};}function removeEntity(_0x34c9e2,_0x52089e){return function(_0x58526c){if(_0x58526c){return _0x58526c[_0x186c('0x23')]()[_0x186c('0x22')](function(){_0x34c9e2['status'](0xcc)[_0x186c('0x19')]();});}};}function handleEntityNotFound(_0x51a674,_0x39c31e){return function(_0x4ee8cd){if(!_0x4ee8cd){_0x51a674[_0x186c('0x17')](0x194);}return _0x4ee8cd;};}function handleError(_0x273b46,_0x2c1334){_0x2c1334=_0x2c1334||0x1f4;return function(_0x428997){logger[_0x186c('0x24')](_0x428997[_0x186c('0x25')]);if(_0x428997[_0x186c('0x26')]){delete _0x428997[_0x186c('0x26')];}_0x273b46[_0x186c('0x18')](_0x2c1334)[_0x186c('0x27')](_0x428997);};}exports[_0x186c('0x28')]=function(_0x1b7b36,_0x323dff){var _0x11729e={},_0x3c9c22={},_0x54984b={'count':0x0,'rows':[]};var _0x29ed62=db[_0x186c('0x29')][_0x186c('0x2a')];_0x3c9c22[_0x186c('0x2b')]=_[_0x186c('0x2c')](_0x29ed62);_0x3c9c22[_0x186c('0x2d')]=_[_0x186c('0x2c')](_0x1b7b36[_0x186c('0x2d')]);_0x3c9c22[_0x186c('0x2e')]=_['intersection'](_0x3c9c22[_0x186c('0x2b')],_0x3c9c22[_0x186c('0x2d')]);_0x11729e['attributes']=_[_0x186c('0x2f')](_0x3c9c22[_0x186c('0x2b')],qs[_0x186c('0x30')](_0x1b7b36[_0x186c('0x2d')][_0x186c('0x30')]));_0x11729e['attributes']=_0x11729e[_0x186c('0x31')][_0x186c('0x32')]?_0x11729e[_0x186c('0x31')]:_0x3c9c22[_0x186c('0x2b')];if(!_0x1b7b36[_0x186c('0x2d')]['hasOwnProperty'](_0x186c('0x33'))){_0x11729e[_0x186c('0x1c')]=qs['limit'](_0x1b7b36[_0x186c('0x2d')][_0x186c('0x1c')]);_0x11729e[_0x186c('0x1b')]=qs['offset'](_0x1b7b36[_0x186c('0x2d')]['offset']);}_0x11729e[_0x186c('0x34')]=qs['sort'](_0x1b7b36[_0x186c('0x2d')]['sort']);_0x11729e[_0x186c('0x35')]=qs[_0x186c('0x2e')](_['pick'](_0x1b7b36[_0x186c('0x2d')],_0x3c9c22[_0x186c('0x2e')]));if(_0x1b7b36['query'][_0x186c('0x36')]){_0x11729e[_0x186c('0x35')]=_[_0x186c('0x37')](_0x11729e[_0x186c('0x35')],{'$or':_[_0x186c('0x38')](_0x29ed62,function(_0x122dd1){if(_0x122dd1[_0x186c('0x39')]['key']!==_0x186c('0x3a')){var _0x24e307={};_0x24e307[_0x122dd1[_0x186c('0x3b')]]={'$like':'%'+_0x1b7b36[_0x186c('0x2d')][_0x186c('0x36')]+'%'};return _0x24e307;}})});}_0x11729e=_[_0x186c('0x37')]({},_0x11729e,_0x1b7b36[_0x186c('0x3c')]);var _0x2a064c={'where':_0x11729e[_0x186c('0x35')]};return db[_0x186c('0x29')][_0x186c('0x3d')](_0x2a064c)[_0x186c('0x22')](function(_0x4bc79b){_0x54984b[_0x186c('0x3d')]=_0x4bc79b;if(_0x1b7b36['query']['includeAll']){_0x11729e[_0x186c('0x3e')]=[{'all':!![]}];}return db[_0x186c('0x29')][_0x186c('0x3f')](_0x11729e);})[_0x186c('0x22')](function(_0x1d08e9){_0x54984b['rows']=_0x1d08e9;return _0x54984b;})[_0x186c('0x22')](respondWithFilteredResult(_0x323dff,_0x11729e))[_0x186c('0x40')](handleError(_0x323dff,null));};exports[_0x186c('0x41')]=function(_0x1eff52,_0x536008){var _0x592b22={'raw':!![],'where':{'id':_0x1eff52[_0x186c('0x42')]['id']}},_0x27c8d5={};_0x27c8d5[_0x186c('0x2b')]=_[_0x186c('0x2c')](db[_0x186c('0x29')]['rawAttributes']);_0x27c8d5['query']=_[_0x186c('0x2c')](_0x1eff52['query']);_0x27c8d5[_0x186c('0x2e')]=_['intersection'](_0x27c8d5[_0x186c('0x2b')],_0x27c8d5['query']);_0x592b22[_0x186c('0x31')]=_[_0x186c('0x2f')](_0x27c8d5[_0x186c('0x2b')],qs[_0x186c('0x30')](_0x1eff52[_0x186c('0x2d')][_0x186c('0x30')]));_0x592b22[_0x186c('0x31')]=_0x592b22[_0x186c('0x31')][_0x186c('0x32')]?_0x592b22[_0x186c('0x31')]:_0x27c8d5[_0x186c('0x2b')];if(_0x1eff52[_0x186c('0x2d')][_0x186c('0x43')]){_0x592b22[_0x186c('0x3e')]=[{'all':!![]}];}_0x592b22=_[_0x186c('0x37')]({},_0x592b22,_0x1eff52[_0x186c('0x3c')]);return db[_0x186c('0x29')][_0x186c('0x44')](_0x592b22)[_0x186c('0x22')](handleEntityNotFound(_0x536008,null))[_0x186c('0x22')](respondWithResult(_0x536008,null))[_0x186c('0x40')](handleError(_0x536008,null));};exports['create']=function(_0x1e3e43,_0xa0bbf){return db['OpenchannelQueueReport'][_0x186c('0x45')](_0x1e3e43[_0x186c('0x46')],{})[_0x186c('0x22')](respondWithResult(_0xa0bbf,0xc9))['catch'](handleError(_0xa0bbf,null));};exports[_0x186c('0x21')]=function(_0x276bb6,_0x1d676b){if(_0x276bb6[_0x186c('0x46')]['id']){delete _0x276bb6['body']['id'];}return db[_0x186c('0x29')][_0x186c('0x44')]({'where':{'id':_0x276bb6[_0x186c('0x42')]['id']}})[_0x186c('0x22')](handleEntityNotFound(_0x1d676b,null))['then'](saveUpdates(_0x276bb6['body'],null))['then'](respondWithResult(_0x1d676b,null))[_0x186c('0x40')](handleError(_0x1d676b,null));};exports[_0x186c('0x23')]=function(_0xa93a23,_0x1f9bd8){return db[_0x186c('0x29')][_0x186c('0x44')]({'where':{'id':_0xa93a23['params']['id']}})[_0x186c('0x22')](handleEntityNotFound(_0x1f9bd8,null))[_0x186c('0x22')](removeEntity(_0x1f9bd8,null))[_0x186c('0x40')](handleError(_0x1f9bd8,null));};exports[_0x186c('0x47')]=function(_0x5df68d,_0x3ade3f){return db['OpenchannelQueueReport'][_0x186c('0x47')]()[_0x186c('0x22')](respondWithResult(_0x3ade3f,null))[_0x186c('0x40')](handleError(_0x3ade3f,null));}; \ No newline at end of file +var _0xbdd5=['show','params','rawAttributes','intersection','includeAll','find','create','body','describe','html-pdf','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','keys','query','filters','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','type','key','field','filter','options','OpenchannelQueueReport','catch'];(function(_0x485775,_0x81d4ec){var _0x382b5f=function(_0x5ddb16){while(--_0x5ddb16){_0x485775['push'](_0x485775['shift']());}};_0x382b5f(++_0x81d4ec);}(_0xbdd5,0xc9));var _0x5bdd=function(_0x5662c2,_0x2a9de8){_0x5662c2=_0x5662c2-0x0;var _0x5fd503=_0xbdd5[_0x5662c2];return _0x5fd503;};'use strict';var pdf=require(_0x5bdd('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5bdd('0x1'));var rp=require(_0x5bdd('0x2'));var moment=require(_0x5bdd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5bdd('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5bdd('0x5'));var ejs=require(_0x5bdd('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5bdd('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x5bdd('0x8'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5bdd('0x9'));var Redis=require(_0x5bdd('0xa'));var authService=require(_0x5bdd('0xb'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bdd('0xc'))(_0x5bdd('0xd'));var utils=require('../../config/utils');var config=require(_0x5bdd('0xe'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3094a8,_0x231681){_0x231681=_0x231681||0xcc;return function(_0x1cbc35){if(_0x1cbc35){return _0x3094a8[_0x5bdd('0xf')](_0x231681);}return _0x3094a8[_0x5bdd('0x10')](_0x231681)[_0x5bdd('0x11')]();};}function respondWithResult(_0x203c22,_0x5cd34c){_0x5cd34c=_0x5cd34c||0xc8;return function(_0x49cf20){if(_0x49cf20){return _0x203c22[_0x5bdd('0x10')](_0x5cd34c)[_0x5bdd('0x12')](_0x49cf20);}};}function respondWithFilteredResult(_0x4402a2,_0x48f866){return function(_0xd91054){if(_0xd91054){var _0x4ca94a=_0xd91054[_0x5bdd('0x13')],_0x4d911e=_0x48f866[_0x5bdd('0x14')],_0x28de22=_0x48f866[_0x5bdd('0x14')]+_0x48f866['limit'],_0x3bb1fe;if(_0x28de22>=_0x4ca94a){_0x28de22=_0x4ca94a;_0x3bb1fe=0xc8;}else{_0x3bb1fe=0xce;}_0x4402a2[_0x5bdd('0x10')](_0x3bb1fe);return _0x4402a2[_0x5bdd('0x15')](_0x5bdd('0x16'),_0x4d911e+'-'+_0x28de22+'/'+_0x4ca94a)['json'](_0xd91054);}return null;};}function patchUpdates(_0x67e8fa){return function(_0x10a22f){try{jsonpatch[_0x5bdd('0x17')](_0x10a22f,_0x67e8fa,!![]);}catch(_0x250656){return BPromise[_0x5bdd('0x18')](_0x250656);}return _0x10a22f[_0x5bdd('0x19')]();};}function saveUpdates(_0x374a9f,_0x3cd3bf){return function(_0x27cb5b){if(_0x27cb5b){return _0x27cb5b[_0x5bdd('0x1a')](_0x374a9f)['then'](function(_0x4585db){return _0x4585db;});}return null;};}function removeEntity(_0x172de2,_0x3a7759){return function(_0x371e28){if(_0x371e28){return _0x371e28[_0x5bdd('0x1b')]()[_0x5bdd('0x1c')](function(){_0x172de2[_0x5bdd('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2472a5,_0x27f45d){return function(_0x25abbe){if(!_0x25abbe){_0x2472a5[_0x5bdd('0xf')](0x194);}return _0x25abbe;};}function handleError(_0x5ea68b,_0x11f3a1){_0x11f3a1=_0x11f3a1||0x1f4;return function(_0x50b9a4){logger[_0x5bdd('0x1d')](_0x50b9a4[_0x5bdd('0x1e')]);if(_0x50b9a4[_0x5bdd('0x1f')]){delete _0x50b9a4[_0x5bdd('0x1f')];}_0x5ea68b['status'](_0x11f3a1)[_0x5bdd('0x20')](_0x50b9a4);};}exports[_0x5bdd('0x21')]=function(_0x440238,_0x3a7eb9){var _0x40bfd9={},_0x55bfd4={},_0x4b450c={'count':0x0,'rows':[]};var _0x5e767c=db['OpenchannelQueueReport']['rawAttributes'];_0x55bfd4['model']=_[_0x5bdd('0x22')](_0x5e767c);_0x55bfd4['query']=_[_0x5bdd('0x22')](_0x440238[_0x5bdd('0x23')]);_0x55bfd4[_0x5bdd('0x24')]=_['intersection'](_0x55bfd4[_0x5bdd('0x25')],_0x55bfd4[_0x5bdd('0x23')]);_0x40bfd9['attributes']=_['intersection'](_0x55bfd4['model'],qs[_0x5bdd('0x26')](_0x440238['query'][_0x5bdd('0x26')]));_0x40bfd9[_0x5bdd('0x27')]=_0x40bfd9[_0x5bdd('0x27')][_0x5bdd('0x28')]?_0x40bfd9[_0x5bdd('0x27')]:_0x55bfd4['model'];if(!_0x440238[_0x5bdd('0x23')][_0x5bdd('0x29')]('nolimit')){_0x40bfd9[_0x5bdd('0x2a')]=qs[_0x5bdd('0x2a')](_0x440238['query']['limit']);_0x40bfd9['offset']=qs[_0x5bdd('0x14')](_0x440238['query'][_0x5bdd('0x14')]);}_0x40bfd9[_0x5bdd('0x2b')]=qs['sort'](_0x440238[_0x5bdd('0x23')][_0x5bdd('0x2c')]);_0x40bfd9[_0x5bdd('0x2d')]=qs[_0x5bdd('0x24')](_[_0x5bdd('0x2e')](_0x440238[_0x5bdd('0x23')],_0x55bfd4[_0x5bdd('0x24')]));if(_0x440238[_0x5bdd('0x23')]['filter']){_0x40bfd9[_0x5bdd('0x2d')]=_[_0x5bdd('0x2f')](_0x40bfd9['where'],{'$or':_['map'](_0x5e767c,function(_0xbf5e0e){if(_0xbf5e0e[_0x5bdd('0x30')][_0x5bdd('0x31')]!=='VIRTUAL'){var _0x295aa9={};_0x295aa9[_0xbf5e0e[_0x5bdd('0x32')]]={'$like':'%'+_0x440238[_0x5bdd('0x23')][_0x5bdd('0x33')]+'%'};return _0x295aa9;}})});}_0x40bfd9=_[_0x5bdd('0x2f')]({},_0x40bfd9,_0x440238[_0x5bdd('0x34')]);var _0x5087f3={'where':_0x40bfd9[_0x5bdd('0x2d')]};return db[_0x5bdd('0x35')][_0x5bdd('0x13')](_0x5087f3)[_0x5bdd('0x1c')](function(_0x2654ff){_0x4b450c[_0x5bdd('0x13')]=_0x2654ff;if(_0x440238[_0x5bdd('0x23')]['includeAll']){_0x40bfd9['include']=[{'all':!![]}];}return db[_0x5bdd('0x35')]['findAll'](_0x40bfd9);})[_0x5bdd('0x1c')](function(_0x1bbf2c){_0x4b450c['rows']=_0x1bbf2c;return _0x4b450c;})[_0x5bdd('0x1c')](respondWithFilteredResult(_0x3a7eb9,_0x40bfd9))[_0x5bdd('0x36')](handleError(_0x3a7eb9,null));};exports[_0x5bdd('0x37')]=function(_0x1563df,_0x24ef1c){var _0x52a672={'raw':!![],'where':{'id':_0x1563df[_0x5bdd('0x38')]['id']}},_0x5b83c8={};_0x5b83c8[_0x5bdd('0x25')]=_['keys'](db[_0x5bdd('0x35')][_0x5bdd('0x39')]);_0x5b83c8[_0x5bdd('0x23')]=_[_0x5bdd('0x22')](_0x1563df[_0x5bdd('0x23')]);_0x5b83c8[_0x5bdd('0x24')]=_[_0x5bdd('0x3a')](_0x5b83c8[_0x5bdd('0x25')],_0x5b83c8[_0x5bdd('0x23')]);_0x52a672[_0x5bdd('0x27')]=_[_0x5bdd('0x3a')](_0x5b83c8[_0x5bdd('0x25')],qs[_0x5bdd('0x26')](_0x1563df['query'][_0x5bdd('0x26')]));_0x52a672['attributes']=_0x52a672['attributes']['length']?_0x52a672[_0x5bdd('0x27')]:_0x5b83c8[_0x5bdd('0x25')];if(_0x1563df[_0x5bdd('0x23')][_0x5bdd('0x3b')]){_0x52a672['include']=[{'all':!![]}];}_0x52a672=_[_0x5bdd('0x2f')]({},_0x52a672,_0x1563df[_0x5bdd('0x34')]);return db[_0x5bdd('0x35')][_0x5bdd('0x3c')](_0x52a672)[_0x5bdd('0x1c')](handleEntityNotFound(_0x24ef1c,null))['then'](respondWithResult(_0x24ef1c,null))[_0x5bdd('0x36')](handleError(_0x24ef1c,null));};exports['create']=function(_0x55afd0,_0x56bafa){return db[_0x5bdd('0x35')][_0x5bdd('0x3d')](_0x55afd0[_0x5bdd('0x3e')],{})['then'](respondWithResult(_0x56bafa,0xc9))['catch'](handleError(_0x56bafa,null));};exports[_0x5bdd('0x1a')]=function(_0x429cf5,_0x160b47){if(_0x429cf5[_0x5bdd('0x3e')]['id']){delete _0x429cf5[_0x5bdd('0x3e')]['id'];}return db[_0x5bdd('0x35')][_0x5bdd('0x3c')]({'where':{'id':_0x429cf5[_0x5bdd('0x38')]['id']}})[_0x5bdd('0x1c')](handleEntityNotFound(_0x160b47,null))[_0x5bdd('0x1c')](saveUpdates(_0x429cf5[_0x5bdd('0x3e')],null))[_0x5bdd('0x1c')](respondWithResult(_0x160b47,null))[_0x5bdd('0x36')](handleError(_0x160b47,null));};exports[_0x5bdd('0x1b')]=function(_0x2b2bf6,_0x358fba){return db[_0x5bdd('0x35')][_0x5bdd('0x3c')]({'where':{'id':_0x2b2bf6[_0x5bdd('0x38')]['id']}})[_0x5bdd('0x1c')](handleEntityNotFound(_0x358fba,null))[_0x5bdd('0x1c')](removeEntity(_0x358fba,null))['catch'](handleError(_0x358fba,null));};exports[_0x5bdd('0x3f')]=function(_0x44e956,_0x35c6d8){return db[_0x5bdd('0x35')][_0x5bdd('0x3f')]()['then'](respondWithResult(_0x35c6d8,null))['catch'](handleError(_0x35c6d8,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 23ed163..dff9ff9 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb205=['../../config/logger','api','moment','path','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','lodash','util'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xb205,0xf0));var _0x5b20=function(_0x2fba32,_0x118711){_0x2fba32=_0x2fba32-0x0;var _0x54fc43=_0xb205[_0x2fba32];return _0x54fc43;};'use strict';var _=require(_0x5b20('0x0'));var util=require(_0x5b20('0x1'));var logger=require(_0x5b20('0x2'))(_0x5b20('0x3'));var moment=require(_0x5b20('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b20('0x5'));var rimraf=require('rimraf');var config=require(_0x5b20('0x6'));var attributes=require(_0x5b20('0x7'));module['exports']=function(_0x3206cd,_0x29d926){return _0x3206cd[_0x5b20('0x8')]('OpenchannelQueueReport',attributes,{'tableName':_0x5b20('0x9'),'paranoid':![],'indexes':[{'name':_0x5b20('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9bb=['bluebird','request-promise','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','util','../../config/logger','api','moment'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0xa9bb,0x1bc));var _0xba9b=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xa9bb[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require('lodash');var util=require(_0xba9b('0x0'));var logger=require(_0xba9b('0x1'))(_0xba9b('0x2'));var moment=require(_0xba9b('0x3'));var BPromise=require(_0xba9b('0x4'));var rp=require(_0xba9b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba9b('0x6'));var config=require(_0xba9b('0x7'));var attributes=require(_0xba9b('0x8'));module[_0xba9b('0x9')]=function(_0x4e850a,_0x473d9e){return _0x4e850a[_0xba9b('0xa')](_0xba9b('0xb'),attributes,{'tableName':_0xba9b('0xc'),'paranoid':![],'indexes':[{'name':_0xba9b('0xd'),'fields':[_0xba9b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 205cb53..f2aaa9c 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5226=['limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','then','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','attributes'];(function(_0x5b9561,_0x4f80dc){var _0x49b8eb=function(_0x4d5942){while(--_0x4d5942){_0x5b9561['push'](_0x5b9561['shift']());}};_0x49b8eb(++_0x4f80dc);}(_0x5226,0x137));var _0x6522=function(_0x58f87d,_0x5d7ac8){_0x58f87d=_0x58f87d-0x0;var _0x549281=_0x5226[_0x58f87d];return _0x549281;};'use strict';var _=require(_0x6522('0x0'));var util=require(_0x6522('0x1'));var moment=require(_0x6522('0x2'));var BPromise=require(_0x6522('0x3'));var rs=require(_0x6522('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6522('0x5'))['db'];var utils=require(_0x6522('0x6'));var logger=require(_0x6522('0x7'))('rpc');var config=require(_0x6522('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6522('0x9')][_0x6522('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x183be8,_0x17c139,_0x6efdb7){return new BPromise(function(_0x2dbe49,_0x318dc1){return client['request'](_0x183be8,_0x6efdb7)['then'](function(_0x2ff0e0){logger[_0x6522('0xb')](_0x6522('0xc'),_0x17c139,_0x6522('0xd'));logger[_0x6522('0xe')](_0x6522('0xf'),_0x17c139,_0x6522('0xd'),JSON[_0x6522('0x10')](_0x2ff0e0));if(_0x2ff0e0[_0x6522('0x11')]){if(_0x2ff0e0[_0x6522('0x11')][_0x6522('0x12')]===0x1f4){logger[_0x6522('0x11')](_0x6522('0xc'),_0x17c139,_0x2ff0e0['error'][_0x6522('0x13')]);return _0x318dc1(_0x2ff0e0[_0x6522('0x11')][_0x6522('0x13')]);}logger[_0x6522('0x11')](_0x6522('0xc'),_0x17c139,_0x2ff0e0['error'][_0x6522('0x13')]);return _0x2dbe49(_0x2ff0e0[_0x6522('0x11')][_0x6522('0x13')]);}else{logger[_0x6522('0xb')](_0x6522('0xc'),_0x17c139,_0x6522('0xd'));_0x2dbe49(_0x2ff0e0[_0x6522('0x14')][_0x6522('0x13')]);}})[_0x6522('0x15')](function(_0x2de2e5){logger[_0x6522('0x11')](_0x6522('0xc'),_0x17c139,_0x2de2e5);_0x318dc1(_0x2de2e5);});});}exports['CreateOpenchannelQueueReport']=function(_0x6f0909){var _0x1edcb6=this;return new Promise(function(_0x2bb08c,_0x368dd1){return db['OpenchannelQueueReport'][_0x6522('0x16')](_0x6f0909[_0x6522('0x17')],{'raw':_0x6f0909['options']?_0x6f0909[_0x6522('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x6522('0x19')](function(_0xe419a9){logger[_0x6522('0xb')](_0x6522('0x1a'),_0x6f0909);logger[_0x6522('0xe')](_0x6522('0x1a'),_0x6f0909,JSON['stringify'](_0xe419a9));_0x2bb08c(_0xe419a9);})[_0x6522('0x15')](function(_0x174004){logger[_0x6522('0x11')](_0x6522('0x1a'),_0x174004[_0x6522('0x13')],_0x6f0909);_0x368dd1(_0x1edcb6[_0x6522('0x11')](0x1f4,_0x174004['message']));});});};exports[_0x6522('0x1b')]=function(_0x415f16){var _0xcb377c=this;return new Promise(function(_0x2c3269,_0x47d185){return db['OpenchannelQueueReport'][_0x6522('0x1c')](_0x415f16[_0x6522('0x17')],{'raw':_0x415f16[_0x6522('0x18')]?_0x415f16[_0x6522('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x415f16[_0x6522('0x18')]?_0x415f16[_0x6522('0x18')]['where']||null:null,'attributes':_0x415f16[_0x6522('0x18')]?_0x415f16[_0x6522('0x18')][_0x6522('0x1d')]||null:null,'limit':_0x415f16[_0x6522('0x18')]?_0x415f16['options'][_0x6522('0x1e')]||null:null})[_0x6522('0x19')](function(_0x1a46f6){logger[_0x6522('0xb')](_0x6522('0x1b'),_0x415f16);logger[_0x6522('0xe')](_0x6522('0x1b'),_0x415f16,JSON[_0x6522('0x10')](_0x1a46f6));_0x2c3269(_0x1a46f6);})[_0x6522('0x15')](function(_0x2c57f7){logger[_0x6522('0x11')](_0x6522('0x1b'),_0x2c57f7['message'],_0x415f16);_0x47d185(_0xcb377c[_0x6522('0x11')](0x1f4,_0x2c57f7[_0x6522('0x13')]));});});}; \ No newline at end of file +var _0x1c52=['options','where','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','raw','stringify','catch'];(function(_0x1802d9,_0x2224c6){var _0x537d5c=function(_0x46c47f){while(--_0x46c47f){_0x1802d9['push'](_0x1802d9['shift']());}};_0x537d5c(++_0x2224c6);}(_0x1c52,0x7c));var _0x21c5=function(_0x4c8b8b,_0x35e6a8){_0x4c8b8b=_0x4c8b8b-0x0;var _0x3230d3=_0x1c52[_0x4c8b8b];return _0x3230d3;};'use strict';var _=require(_0x21c5('0x0'));var util=require(_0x21c5('0x1'));var moment=require(_0x21c5('0x2'));var BPromise=require(_0x21c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x21c5('0x4'));var logger=require(_0x21c5('0x5'))('rpc');var config=require(_0x21c5('0x6'));var jayson=require(_0x21c5('0x7'));var client=jayson[_0x21c5('0x8')][_0x21c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b12d5,_0xed0195,_0xb4b1e4){return new BPromise(function(_0x4c5a4f,_0xd34da2){return client[_0x21c5('0xa')](_0x5b12d5,_0xb4b1e4)[_0x21c5('0xb')](function(_0x27389f){logger['info'](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));logger[_0x21c5('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0xed0195,_0x21c5('0xd'),JSON['stringify'](_0x27389f));if(_0x27389f[_0x21c5('0xf')]){if(_0x27389f[_0x21c5('0xf')][_0x21c5('0x10')]===0x1f4){logger[_0x21c5('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xed0195,_0x27389f[_0x21c5('0xf')]['message']);return _0xd34da2(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}logger['error'](_0x21c5('0xc'),_0xed0195,_0x27389f['error']['message']);return _0x4c5a4f(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}else{logger[_0x21c5('0x12')](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));_0x4c5a4f(_0x27389f[_0x21c5('0x13')][_0x21c5('0x11')]);}})['catch'](function(_0x331080){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xed0195,_0x331080);_0xd34da2(_0x331080);});});}exports[_0x21c5('0x14')]=function(_0x56696e){var _0x4daf4d=this;return new Promise(function(_0x1bc8a4,_0x4e630f){return db[_0x21c5('0x15')]['create'](_0x56696e[_0x21c5('0x16')],{'raw':_0x56696e['options']?_0x56696e['options'][_0x21c5('0x17')]===undefined?!![]:![]:!![]})[_0x21c5('0xb')](function(_0x2840b7){logger[_0x21c5('0x12')](_0x21c5('0x14'),_0x56696e);logger[_0x21c5('0xe')](_0x21c5('0x14'),_0x56696e,JSON[_0x21c5('0x18')](_0x2840b7));_0x1bc8a4(_0x2840b7);})[_0x21c5('0x19')](function(_0x493fbf){logger[_0x21c5('0xf')](_0x21c5('0x14'),_0x493fbf[_0x21c5('0x11')],_0x56696e);_0x4e630f(_0x4daf4d[_0x21c5('0xf')](0x1f4,_0x493fbf[_0x21c5('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x251c9d){var _0x63f5fc=this;return new Promise(function(_0x45e770,_0xa09223){return db[_0x21c5('0x15')]['update'](_0x251c9d['body'],{'raw':_0x251c9d[_0x21c5('0x1a')]?_0x251c9d[_0x21c5('0x1a')][_0x21c5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x251c9d[_0x21c5('0x1a')]?_0x251c9d[_0x21c5('0x1a')][_0x21c5('0x1b')]||null:null,'attributes':_0x251c9d['options']?_0x251c9d['options']['attributes']||null:null,'limit':_0x251c9d[_0x21c5('0x1a')]?_0x251c9d[_0x21c5('0x1a')][_0x21c5('0x1c')]||null:null})[_0x21c5('0xb')](function(_0x52d551){logger[_0x21c5('0x12')](_0x21c5('0x1d'),_0x251c9d);logger[_0x21c5('0xe')](_0x21c5('0x1d'),_0x251c9d,JSON[_0x21c5('0x18')](_0x52d551));_0x45e770(_0x52d551);})['catch'](function(_0x559012){logger[_0x21c5('0xf')](_0x21c5('0x1d'),_0x559012[_0x21c5('0x11')],_0x251c9d);_0xa09223(_0x63f5fc[_0x21c5('0xf')](0x1f4,_0x559012[_0x21c5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 0af243a..6a8541c 100644 --- a/server/api/openchannelTransferReport/index.js +++ b/server/api/openchannelTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 6038397..eab8083 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa50b=['queue','DATE','moment','exports','ENUM'];(function(_0x33c65a,_0x2fa474){var _0x55b76e=function(_0x5e23f7){while(--_0x5e23f7){_0x33c65a['push'](_0x33c65a['shift']());}};_0x55b76e(++_0x2fa474);}(_0xa50b,0x75));var _0xba50=function(_0x2542de,_0x499dfa){_0x2542de=_0x2542de-0x0;var _0x428a1b=_0xa50b[_0x2542de];return _0x428a1b;};'use strict';var moment=require(_0xba50('0x0'));var Sequelize=require('sequelize');module[_0xba50('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xba50('0x2')]('account','agent',_0xba50('0x3')),'allowNull':![],'defaultValue':_0xba50('0x3')},'transferredAt':{'type':Sequelize[_0xba50('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x6edb=['queue','sequelize','exports','STRING','ENUM','account'];(function(_0x16dda6,_0x540e04){var _0x4d35a0=function(_0x2d2cac){while(--_0x2d2cac){_0x16dda6['push'](_0x16dda6['shift']());}};_0x4d35a0(++_0x540e04);}(_0x6edb,0x109));var _0xb6ed=function(_0x3fadd1,_0x289fee){_0x3fadd1=_0x3fadd1-0x0;var _0x22cb57=_0x6edb[_0x3fadd1];return _0x22cb57;};'use strict';var moment=require('moment');var Sequelize=require(_0xb6ed('0x0'));module[_0xb6ed('0x1')]={'uniqueid':{'type':Sequelize[_0xb6ed('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb6ed('0x3')](_0xb6ed('0x4'),'agent',_0xb6ed('0x5')),'allowNull':![],'defaultValue':_0xb6ed('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 6765e4d..bd29f63 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf40b=['model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','key','field','filter','options','OpenchannelTransferReport','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection'];(function(_0x40ade2,_0x31f40f){var _0x4c91c6=function(_0x1ed73c){while(--_0x1ed73c){_0x40ade2['push'](_0x40ade2['shift']());}};_0x4c91c6(++_0x31f40f);}(_0xf40b,0xb0));var _0xbf40=function(_0x39580c,_0x22425c){_0x39580c=_0x39580c-0x0;var _0x1a4cd8=_0xf40b[_0x39580c];return _0x1a4cd8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbf40('0x0'));var rimraf=require(_0xbf40('0x1'));var zipdir=require(_0xbf40('0x2'));var jsonpatch=require(_0xbf40('0x3'));var rp=require('request-promise');var moment=require(_0xbf40('0x4'));var BPromise=require(_0xbf40('0x5'));var Mustache=require(_0xbf40('0x6'));var util=require(_0xbf40('0x7'));var path=require(_0xbf40('0x8'));var sox=require('sox');var csv=require(_0xbf40('0x9'));var ejs=require(_0xbf40('0xa'));var fs=require('fs');var _=require(_0xbf40('0xb'));var squel=require(_0xbf40('0xc'));var crypto=require(_0xbf40('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbf40('0xe'));var toCsv=require(_0xbf40('0x9'));var querystring=require(_0xbf40('0xf'));var Papa=require(_0xbf40('0x10'));var Redis=require(_0xbf40('0x11'));var authService=require(_0xbf40('0x12'));var qs=require(_0xbf40('0x13'));var hardwareService=require(_0xbf40('0x14'));var logger=require('../../config/logger')(_0xbf40('0x15'));var utils=require(_0xbf40('0x16'));var config=require(_0xbf40('0x17'));var db=require(_0xbf40('0x18'))['db'];function respondWithStatusCode(_0x380a1e,_0x1eef4c){_0x1eef4c=_0x1eef4c||0xcc;return function(_0x2417ae){if(_0x2417ae){return _0x380a1e[_0xbf40('0x19')](_0x1eef4c);}return _0x380a1e['status'](_0x1eef4c)['end']();};}function respondWithResult(_0x6e3496,_0x3f86b5){_0x3f86b5=_0x3f86b5||0xc8;return function(_0x2cecca){if(_0x2cecca){return _0x6e3496[_0xbf40('0x1a')](_0x3f86b5)['json'](_0x2cecca);}};}function respondWithFilteredResult(_0xb61909,_0x3c9329){return function(_0x3965f6){if(_0x3965f6){var _0x347473=_0x3965f6[_0xbf40('0x1b')],_0x39a323=_0x3c9329['offset'],_0x203056=_0x3c9329[_0xbf40('0x1c')]+_0x3c9329[_0xbf40('0x1d')],_0x128f7d;if(_0x203056>=_0x347473){_0x203056=_0x347473;_0x128f7d=0xc8;}else{_0x128f7d=0xce;}_0xb61909[_0xbf40('0x1a')](_0x128f7d);return _0xb61909[_0xbf40('0x1e')](_0xbf40('0x1f'),_0x39a323+'-'+_0x203056+'/'+_0x347473)[_0xbf40('0x20')](_0x3965f6);}return null;};}function patchUpdates(_0x325545){return function(_0x3cca3c){try{jsonpatch['apply'](_0x3cca3c,_0x325545,!![]);}catch(_0x2c8af5){return BPromise[_0xbf40('0x21')](_0x2c8af5);}return _0x3cca3c[_0xbf40('0x22')]();};}function saveUpdates(_0x2d6492,_0x5540a6){return function(_0x46a864){if(_0x46a864){return _0x46a864[_0xbf40('0x23')](_0x2d6492)[_0xbf40('0x24')](function(_0x1922c8){return _0x1922c8;});}return null;};}function removeEntity(_0x2db94f,_0x23fc5b){return function(_0x275ff1){if(_0x275ff1){return _0x275ff1[_0xbf40('0x25')]()[_0xbf40('0x24')](function(){_0x2db94f[_0xbf40('0x1a')](0xcc)[_0xbf40('0x26')]();});}};}function handleEntityNotFound(_0x1487d0,_0x17fa9a){return function(_0x1471ee){if(!_0x1471ee){_0x1487d0[_0xbf40('0x19')](0x194);}return _0x1471ee;};}function handleError(_0xadf34b,_0x5c5e6d){_0x5c5e6d=_0x5c5e6d||0x1f4;return function(_0x2df7a8){logger[_0xbf40('0x27')](_0x2df7a8[_0xbf40('0x28')]);if(_0x2df7a8[_0xbf40('0x29')]){delete _0x2df7a8[_0xbf40('0x29')];}_0xadf34b[_0xbf40('0x1a')](_0x5c5e6d)[_0xbf40('0x2a')](_0x2df7a8);};}exports[_0xbf40('0x2b')]=function(_0x40f563,_0x266468){var _0x2faef5={},_0x2528f2={},_0x2af9ce={'count':0x0,'rows':[]};var _0x3db5e7=db['OpenchannelTransferReport'][_0xbf40('0x2c')];_0x2528f2['model']=_[_0xbf40('0x2d')](_0x3db5e7);_0x2528f2[_0xbf40('0x2e')]=_[_0xbf40('0x2d')](_0x40f563['query']);_0x2528f2[_0xbf40('0x2f')]=_[_0xbf40('0x30')](_0x2528f2[_0xbf40('0x31')],_0x2528f2['query']);_0x2faef5[_0xbf40('0x32')]=_['intersection'](_0x2528f2[_0xbf40('0x31')],qs[_0xbf40('0x33')](_0x40f563[_0xbf40('0x2e')]['fields']));_0x2faef5[_0xbf40('0x32')]=_0x2faef5[_0xbf40('0x32')][_0xbf40('0x34')]?_0x2faef5[_0xbf40('0x32')]:_0x2528f2[_0xbf40('0x31')];if(!_0x40f563[_0xbf40('0x2e')][_0xbf40('0x35')](_0xbf40('0x36'))){_0x2faef5[_0xbf40('0x1d')]=qs['limit'](_0x40f563[_0xbf40('0x2e')][_0xbf40('0x1d')]);_0x2faef5[_0xbf40('0x1c')]=qs[_0xbf40('0x1c')](_0x40f563['query'][_0xbf40('0x1c')]);}_0x2faef5['order']=qs[_0xbf40('0x37')](_0x40f563[_0xbf40('0x2e')][_0xbf40('0x37')]);_0x2faef5['where']=qs[_0xbf40('0x2f')](_[_0xbf40('0x38')](_0x40f563[_0xbf40('0x2e')],_0x2528f2[_0xbf40('0x2f')]));if(_0x40f563[_0xbf40('0x2e')]['filter']){_0x2faef5[_0xbf40('0x39')]=_[_0xbf40('0x3a')](_0x2faef5[_0xbf40('0x39')],{'$or':_['map'](_0x3db5e7,function(_0x38511f){if(_0x38511f[_0xbf40('0x3b')][_0xbf40('0x3c')]!=='VIRTUAL'){var _0x408ec9={};_0x408ec9[_0x38511f[_0xbf40('0x3d')]]={'$like':'%'+_0x40f563[_0xbf40('0x2e')][_0xbf40('0x3e')]+'%'};return _0x408ec9;}})});}_0x2faef5=_[_0xbf40('0x3a')]({},_0x2faef5,_0x40f563[_0xbf40('0x3f')]);var _0xb24d88={'where':_0x2faef5[_0xbf40('0x39')]};return db[_0xbf40('0x40')][_0xbf40('0x1b')](_0xb24d88)[_0xbf40('0x24')](function(_0x41aaff){_0x2af9ce[_0xbf40('0x1b')]=_0x41aaff;if(_0x40f563[_0xbf40('0x2e')]['includeAll']){_0x2faef5[_0xbf40('0x41')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xbf40('0x42')](_0x2faef5);})[_0xbf40('0x24')](function(_0x322c32){_0x2af9ce[_0xbf40('0x43')]=_0x322c32;return _0x2af9ce;})[_0xbf40('0x24')](respondWithFilteredResult(_0x266468,_0x2faef5))['catch'](handleError(_0x266468,null));};exports[_0xbf40('0x44')]=function(_0xfd6710,_0x51aa33){var _0x14f87c={'raw':!![],'where':{'id':_0xfd6710[_0xbf40('0x45')]['id']}},_0x58bd28={};_0x58bd28[_0xbf40('0x31')]=_[_0xbf40('0x2d')](db[_0xbf40('0x40')][_0xbf40('0x2c')]);_0x58bd28[_0xbf40('0x2e')]=_[_0xbf40('0x2d')](_0xfd6710['query']);_0x58bd28[_0xbf40('0x2f')]=_[_0xbf40('0x30')](_0x58bd28[_0xbf40('0x31')],_0x58bd28[_0xbf40('0x2e')]);_0x14f87c[_0xbf40('0x32')]=_[_0xbf40('0x30')](_0x58bd28[_0xbf40('0x31')],qs[_0xbf40('0x33')](_0xfd6710['query'][_0xbf40('0x33')]));_0x14f87c['attributes']=_0x14f87c[_0xbf40('0x32')][_0xbf40('0x34')]?_0x14f87c[_0xbf40('0x32')]:_0x58bd28[_0xbf40('0x31')];if(_0xfd6710['query']['includeAll']){_0x14f87c[_0xbf40('0x41')]=[{'all':!![]}];}_0x14f87c=_[_0xbf40('0x3a')]({},_0x14f87c,_0xfd6710[_0xbf40('0x3f')]);return db['OpenchannelTransferReport']['find'](_0x14f87c)[_0xbf40('0x24')](handleEntityNotFound(_0x51aa33,null))['then'](respondWithResult(_0x51aa33,null))[_0xbf40('0x46')](handleError(_0x51aa33,null));};exports['create']=function(_0x18758d,_0x420cd9){return db['OpenchannelTransferReport'][_0xbf40('0x47')](_0x18758d[_0xbf40('0x48')],{})['then'](respondWithResult(_0x420cd9,0xc9))['catch'](handleError(_0x420cd9,null));};exports[_0xbf40('0x23')]=function(_0x17dc02,_0x518794){if(_0x17dc02[_0xbf40('0x48')]['id']){delete _0x17dc02[_0xbf40('0x48')]['id'];}return db[_0xbf40('0x40')][_0xbf40('0x49')]({'where':{'id':_0x17dc02[_0xbf40('0x45')]['id']}})['then'](handleEntityNotFound(_0x518794,null))[_0xbf40('0x24')](saveUpdates(_0x17dc02[_0xbf40('0x48')],null))[_0xbf40('0x24')](respondWithResult(_0x518794,null))[_0xbf40('0x46')](handleError(_0x518794,null));};exports[_0xbf40('0x25')]=function(_0x105387,_0x2d0a27){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x105387[_0xbf40('0x45')]['id']}})[_0xbf40('0x24')](handleEntityNotFound(_0x2d0a27,null))['then'](removeEntity(_0x2d0a27,null))[_0xbf40('0x46')](handleError(_0x2d0a27,null));};exports[_0xbf40('0x4a')]=function(_0xc10f3a,_0x51a8c3){return db[_0xbf40('0x40')][_0xbf40('0x4a')]()[_0xbf40('0x24')](respondWithResult(_0x51a8c3,null))['catch'](handleError(_0x51a8c3,null));}; \ No newline at end of file +var _0x7524=['to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','OpenchannelTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','show','params','includeAll','find','catch','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7524,0xce));var _0x4752=function(_0x7ed855,_0x191340){_0x7ed855=_0x7ed855-0x0;var _0x49af02=_0x7524[_0x7ed855];return _0x49af02;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4752('0x0'));var rimraf=require(_0x4752('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4752('0x2'));var rp=require(_0x4752('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4752('0x4'));var util=require('util');var path=require(_0x4752('0x5'));var sox=require(_0x4752('0x6'));var csv=require(_0x4752('0x7'));var ejs=require(_0x4752('0x8'));var fs=require('fs');var _=require(_0x4752('0x9'));var squel=require('squel');var crypto=require(_0x4752('0xa'));var jsforce=require(_0x4752('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4752('0xc'));var Papa=require(_0x4752('0xd'));var Redis=require(_0x4752('0xe'));var authService=require(_0x4752('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4752('0x10'));var logger=require(_0x4752('0x11'))(_0x4752('0x12'));var utils=require(_0x4752('0x13'));var config=require(_0x4752('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7d7cb2,_0x11d84e){_0x11d84e=_0x11d84e||0xcc;return function(_0x404e5a){if(_0x404e5a){return _0x7d7cb2[_0x4752('0x15')](_0x11d84e);}return _0x7d7cb2[_0x4752('0x16')](_0x11d84e)[_0x4752('0x17')]();};}function respondWithResult(_0xcee47,_0x505d48){_0x505d48=_0x505d48||0xc8;return function(_0xefacbb){if(_0xefacbb){return _0xcee47['status'](_0x505d48)[_0x4752('0x18')](_0xefacbb);}};}function respondWithFilteredResult(_0x32d837,_0x461f58){return function(_0x17a8b8){if(_0x17a8b8){var _0x2e53e4=_0x17a8b8[_0x4752('0x19')],_0x33131a=_0x461f58[_0x4752('0x1a')],_0x410f88=_0x461f58['offset']+_0x461f58[_0x4752('0x1b')],_0x552daf;if(_0x410f88>=_0x2e53e4){_0x410f88=_0x2e53e4;_0x552daf=0xc8;}else{_0x552daf=0xce;}_0x32d837['status'](_0x552daf);return _0x32d837[_0x4752('0x1c')](_0x4752('0x1d'),_0x33131a+'-'+_0x410f88+'/'+_0x2e53e4)['json'](_0x17a8b8);}return null;};}function patchUpdates(_0x2d7ab6){return function(_0x4b95f8){try{jsonpatch['apply'](_0x4b95f8,_0x2d7ab6,!![]);}catch(_0x285688){return BPromise[_0x4752('0x1e')](_0x285688);}return _0x4b95f8[_0x4752('0x1f')]();};}function saveUpdates(_0x384043,_0x285892){return function(_0x3142b){if(_0x3142b){return _0x3142b['update'](_0x384043)[_0x4752('0x20')](function(_0x2d2f9e){return _0x2d2f9e;});}return null;};}function removeEntity(_0x477050,_0x1cf5d6){return function(_0x3facf5){if(_0x3facf5){return _0x3facf5[_0x4752('0x21')]()['then'](function(){_0x477050[_0x4752('0x16')](0xcc)[_0x4752('0x17')]();});}};}function handleEntityNotFound(_0x54a0bd,_0x11725c){return function(_0x403005){if(!_0x403005){_0x54a0bd[_0x4752('0x15')](0x194);}return _0x403005;};}function handleError(_0x27a93a,_0x8e182f){_0x8e182f=_0x8e182f||0x1f4;return function(_0x26c332){logger[_0x4752('0x22')](_0x26c332[_0x4752('0x23')]);if(_0x26c332[_0x4752('0x24')]){delete _0x26c332[_0x4752('0x24')];}_0x27a93a['status'](_0x8e182f)[_0x4752('0x25')](_0x26c332);};}exports['index']=function(_0x4b2635,_0x52ccf9){var _0x1dcdcd={},_0x4618b0={},_0x1bc71b={'count':0x0,'rows':[]};var _0x1cb8e7=db[_0x4752('0x26')][_0x4752('0x27')];_0x4618b0[_0x4752('0x28')]=_[_0x4752('0x29')](_0x1cb8e7);_0x4618b0['query']=_['keys'](_0x4b2635[_0x4752('0x2a')]);_0x4618b0[_0x4752('0x2b')]=_[_0x4752('0x2c')](_0x4618b0[_0x4752('0x28')],_0x4618b0[_0x4752('0x2a')]);_0x1dcdcd[_0x4752('0x2d')]=_[_0x4752('0x2c')](_0x4618b0[_0x4752('0x28')],qs[_0x4752('0x2e')](_0x4b2635[_0x4752('0x2a')][_0x4752('0x2e')]));_0x1dcdcd[_0x4752('0x2d')]=_0x1dcdcd[_0x4752('0x2d')][_0x4752('0x2f')]?_0x1dcdcd[_0x4752('0x2d')]:_0x4618b0[_0x4752('0x28')];if(!_0x4b2635['query']['hasOwnProperty'](_0x4752('0x30'))){_0x1dcdcd[_0x4752('0x1b')]=qs[_0x4752('0x1b')](_0x4b2635[_0x4752('0x2a')][_0x4752('0x1b')]);_0x1dcdcd[_0x4752('0x1a')]=qs[_0x4752('0x1a')](_0x4b2635[_0x4752('0x2a')][_0x4752('0x1a')]);}_0x1dcdcd[_0x4752('0x31')]=qs['sort'](_0x4b2635[_0x4752('0x2a')]['sort']);_0x1dcdcd[_0x4752('0x32')]=qs[_0x4752('0x2b')](_[_0x4752('0x33')](_0x4b2635[_0x4752('0x2a')],_0x4618b0[_0x4752('0x2b')]));if(_0x4b2635['query'][_0x4752('0x34')]){_0x1dcdcd['where']=_[_0x4752('0x35')](_0x1dcdcd[_0x4752('0x32')],{'$or':_[_0x4752('0x36')](_0x1cb8e7,function(_0x1779a1){if(_0x1779a1[_0x4752('0x37')][_0x4752('0x38')]!==_0x4752('0x39')){var _0x1b8819={};_0x1b8819[_0x1779a1[_0x4752('0x3a')]]={'$like':'%'+_0x4b2635[_0x4752('0x2a')]['filter']+'%'};return _0x1b8819;}})});}_0x1dcdcd=_[_0x4752('0x35')]({},_0x1dcdcd,_0x4b2635[_0x4752('0x3b')]);var _0x6b655d={'where':_0x1dcdcd[_0x4752('0x32')]};return db[_0x4752('0x26')][_0x4752('0x19')](_0x6b655d)[_0x4752('0x20')](function(_0x617985){_0x1bc71b['count']=_0x617985;if(_0x4b2635[_0x4752('0x2a')]['includeAll']){_0x1dcdcd[_0x4752('0x3c')]=[{'all':!![]}];}return db[_0x4752('0x26')][_0x4752('0x3d')](_0x1dcdcd);})[_0x4752('0x20')](function(_0x5e32c4){_0x1bc71b['rows']=_0x5e32c4;return _0x1bc71b;})['then'](respondWithFilteredResult(_0x52ccf9,_0x1dcdcd))['catch'](handleError(_0x52ccf9,null));};exports[_0x4752('0x3e')]=function(_0x81303e,_0x58349e){var _0x2614bc={'raw':!![],'where':{'id':_0x81303e[_0x4752('0x3f')]['id']}},_0x45b80c={};_0x45b80c['model']=_[_0x4752('0x29')](db[_0x4752('0x26')][_0x4752('0x27')]);_0x45b80c[_0x4752('0x2a')]=_[_0x4752('0x29')](_0x81303e['query']);_0x45b80c['filters']=_[_0x4752('0x2c')](_0x45b80c[_0x4752('0x28')],_0x45b80c[_0x4752('0x2a')]);_0x2614bc[_0x4752('0x2d')]=_[_0x4752('0x2c')](_0x45b80c[_0x4752('0x28')],qs[_0x4752('0x2e')](_0x81303e[_0x4752('0x2a')][_0x4752('0x2e')]));_0x2614bc[_0x4752('0x2d')]=_0x2614bc[_0x4752('0x2d')][_0x4752('0x2f')]?_0x2614bc['attributes']:_0x45b80c[_0x4752('0x28')];if(_0x81303e['query'][_0x4752('0x40')]){_0x2614bc[_0x4752('0x3c')]=[{'all':!![]}];}_0x2614bc=_['merge']({},_0x2614bc,_0x81303e[_0x4752('0x3b')]);return db[_0x4752('0x26')][_0x4752('0x41')](_0x2614bc)[_0x4752('0x20')](handleEntityNotFound(_0x58349e,null))[_0x4752('0x20')](respondWithResult(_0x58349e,null))[_0x4752('0x42')](handleError(_0x58349e,null));};exports['create']=function(_0x1a3092,_0x198f9d){return db[_0x4752('0x26')][_0x4752('0x43')](_0x1a3092[_0x4752('0x44')],{})[_0x4752('0x20')](respondWithResult(_0x198f9d,0xc9))['catch'](handleError(_0x198f9d,null));};exports[_0x4752('0x45')]=function(_0x3b8ea4,_0xa03eff){if(_0x3b8ea4[_0x4752('0x44')]['id']){delete _0x3b8ea4[_0x4752('0x44')]['id'];}return db[_0x4752('0x26')]['find']({'where':{'id':_0x3b8ea4[_0x4752('0x3f')]['id']}})['then'](handleEntityNotFound(_0xa03eff,null))['then'](saveUpdates(_0x3b8ea4[_0x4752('0x44')],null))[_0x4752('0x20')](respondWithResult(_0xa03eff,null))[_0x4752('0x42')](handleError(_0xa03eff,null));};exports['destroy']=function(_0x1a92c6,_0x1ebb03){return db['OpenchannelTransferReport'][_0x4752('0x41')]({'where':{'id':_0x1a92c6[_0x4752('0x3f')]['id']}})[_0x4752('0x20')](handleEntityNotFound(_0x1ebb03,null))['then'](removeEntity(_0x1ebb03,null))[_0x4752('0x42')](handleError(_0x1ebb03,null));};exports[_0x4752('0x46')]=function(_0x2d461c,_0x3b3c64){return db[_0x4752('0x26')][_0x4752('0x46')]()['then'](respondWithResult(_0x3b3c64,null))[_0x4752('0x42')](handleError(_0x3b3c64,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 18fe430..2ee66fd 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.model.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec27=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0x2b83b6,_0x455723){var _0x1ca41c=function(_0x33b06c){while(--_0x33b06c){_0x2b83b6['push'](_0x2b83b6['shift']());}};_0x1ca41c(++_0x455723);}(_0xec27,0x8d));var _0x7ec2=function(_0x52089d,_0x407abf){_0x52089d=_0x52089d-0x0;var _0x33314c=_0xec27[_0x52089d];return _0x33314c;};'use strict';var _=require(_0x7ec2('0x0'));var util=require(_0x7ec2('0x1'));var logger=require(_0x7ec2('0x2'))(_0x7ec2('0x3'));var moment=require(_0x7ec2('0x4'));var BPromise=require(_0x7ec2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7ec2('0x6'));var config=require(_0x7ec2('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0x7ec2('0x8')]=function(_0x583da2,_0x40888f){return _0x583da2[_0x7ec2('0x9')](_0x7ec2('0xa'),attributes,{'tableName':_0x7ec2('0xb'),'paranoid':![],'indexes':[{'name':_0x7ec2('0xc'),'fields':[_0x7ec2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf08=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','uniqueid','../../config/logger'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xaf08,0x8f));var _0x8af0=function(_0x19409d,_0xf48905){_0x19409d=_0x19409d-0x0;var _0x5de146=_0xaf08[_0x19409d];return _0x5de146;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8af0('0x0'))(_0x8af0('0x1'));var moment=require(_0x8af0('0x2'));var BPromise=require(_0x8af0('0x3'));var rp=require(_0x8af0('0x4'));var fs=require('fs');var path=require(_0x8af0('0x5'));var rimraf=require(_0x8af0('0x6'));var config=require(_0x8af0('0x7'));var attributes=require(_0x8af0('0x8'));module['exports']=function(_0x18a252,_0x971289){return _0x18a252[_0x8af0('0x9')](_0x8af0('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x8af0('0xb'),'fields':[_0x8af0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index f3e18fe..a7485d1 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54e9=['message','catch','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','http','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x54e9,0xbd));var _0x954e=function(_0x12e47e,_0x40bcc4){_0x12e47e=_0x12e47e-0x0;var _0x39ce6d=_0x54e9[_0x12e47e];return _0x39ce6d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x954e('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x954e('0x1'));var db=require(_0x954e('0x2'))['db'];var utils=require(_0x954e('0x3'));var logger=require('../../config/logger')(_0x954e('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x954e('0x5')][_0x954e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4eedee,_0x41ebd2,_0x597013){return new BPromise(function(_0x11740c,_0x463f60){return client['request'](_0x4eedee,_0x597013)[_0x954e('0x7')](function(_0x131151){logger[_0x954e('0x8')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x41ebd2,_0x954e('0x9'));logger[_0x954e('0xa')](_0x954e('0xb'),_0x41ebd2,_0x954e('0x9'),JSON[_0x954e('0xc')](_0x131151));if(_0x131151[_0x954e('0xd')]){if(_0x131151[_0x954e('0xd')]['code']===0x1f4){logger[_0x954e('0xd')](_0x954e('0xe'),_0x41ebd2,_0x131151[_0x954e('0xd')]['message']);return _0x463f60(_0x131151['error'][_0x954e('0xf')]);}logger[_0x954e('0xd')](_0x954e('0xe'),_0x41ebd2,_0x131151[_0x954e('0xd')]['message']);return _0x11740c(_0x131151[_0x954e('0xd')][_0x954e('0xf')]);}else{logger[_0x954e('0x8')](_0x954e('0xe'),_0x41ebd2,_0x954e('0x9'));_0x11740c(_0x131151['result'][_0x954e('0xf')]);}})[_0x954e('0x10')](function(_0x2bfb19){logger[_0x954e('0xd')](_0x954e('0xe'),_0x41ebd2,_0x2bfb19);_0x463f60(_0x2bfb19);});});} \ No newline at end of file +var _0x8781=['debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x18bfdb,_0x241d43){var _0x44334c=function(_0x55e999){while(--_0x55e999){_0x18bfdb['push'](_0x18bfdb['shift']());}};_0x44334c(++_0x241d43);}(_0x8781,0x118));var _0x1878=function(_0x42be24,_0x4eaaff){_0x42be24=_0x42be24-0x0;var _0x553728=_0x8781[_0x42be24];return _0x553728;};'use strict';var _=require(_0x1878('0x0'));var util=require(_0x1878('0x1'));var moment=require('moment');var BPromise=require(_0x1878('0x2'));var rs=require(_0x1878('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1878('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1878('0x5'))(_0x1878('0x6'));var config=require(_0x1878('0x7'));var jayson=require(_0x1878('0x8'));var client=jayson[_0x1878('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17535c,_0x20b058,_0x3761ea){return new BPromise(function(_0x5af6ef,_0xa32647){return client['request'](_0x17535c,_0x3761ea)[_0x1878('0xa')](function(_0x1ec2f0){logger[_0x1878('0xb')](_0x1878('0xc'),_0x20b058,_0x1878('0xd'));logger[_0x1878('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x20b058,_0x1878('0xd'),JSON[_0x1878('0xf')](_0x1ec2f0));if(_0x1ec2f0[_0x1878('0x10')]){if(_0x1ec2f0[_0x1878('0x10')][_0x1878('0x11')]===0x1f4){logger[_0x1878('0x10')](_0x1878('0xc'),_0x20b058,_0x1ec2f0[_0x1878('0x10')]['message']);return _0xa32647(_0x1ec2f0[_0x1878('0x10')][_0x1878('0x12')]);}logger[_0x1878('0x10')](_0x1878('0xc'),_0x20b058,_0x1ec2f0[_0x1878('0x10')][_0x1878('0x12')]);return _0x5af6ef(_0x1ec2f0[_0x1878('0x10')][_0x1878('0x12')]);}else{logger['info'](_0x1878('0xc'),_0x20b058,'request\x20sent');_0x5af6ef(_0x1ec2f0[_0x1878('0x13')]['message']);}})[_0x1878('0x14')](function(_0x3066e8){logger[_0x1878('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x20b058,_0x3066e8);_0xa32647(_0x3066e8);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 0199e40..b93a2ed 100644 --- a/server/api/pause/index.js +++ b/server/api/pause/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x836e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','/:id','show','post','put','delete','exports','multer','util','path','express'];(function(_0x19867d,_0x554bb9){var _0x59e451=function(_0x444fd6){while(--_0x444fd6){_0x19867d['push'](_0x19867d['shift']());}};_0x59e451(++_0x554bb9);}(_0x836e,0x95));var _0xe836=function(_0x146dd7,_0x4d877d){_0x146dd7=_0x146dd7-0x0;var _0x2af0bb=_0x836e[_0x146dd7];return _0x2af0bb;};'use strict';var multer=require(_0xe836('0x0'));var util=require(_0xe836('0x1'));var path=require(_0xe836('0x2'));var timeout=require('connect-timeout');var express=require(_0xe836('0x3'));var router=express[_0xe836('0x4')]();var auth=require(_0xe836('0x5'));var interaction=require(_0xe836('0x6'));var config=require(_0xe836('0x7'));var controller=require(_0xe836('0x8'));router['get']('/',auth[_0xe836('0x9')](),controller[_0xe836('0xa')]);router['get'](_0xe836('0xb'),auth[_0xe836('0x9')](),controller[_0xe836('0xc')]);router[_0xe836('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe836('0xe')](_0xe836('0xb'),auth[_0xe836('0x9')](),controller['update']);router[_0xe836('0xf')](_0xe836('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xe836('0x10')]=router; \ No newline at end of file +var _0x5eb4=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','multer','path'];(function(_0x5a392a,_0x9c7206){var _0x297347=function(_0x2e564a){while(--_0x2e564a){_0x5a392a['push'](_0x5a392a['shift']());}};_0x297347(++_0x9c7206);}(_0x5eb4,0x1de));var _0x45eb=function(_0x323287,_0x55e92a){_0x323287=_0x323287-0x0;var _0x5c4abd=_0x5eb4[_0x323287];return _0x5c4abd;};'use strict';var multer=require(_0x45eb('0x0'));var util=require('util');var path=require(_0x45eb('0x1'));var timeout=require(_0x45eb('0x2'));var express=require(_0x45eb('0x3'));var router=express['Router']();var auth=require(_0x45eb('0x4'));var interaction=require(_0x45eb('0x5'));var config=require('../../config/environment');var controller=require(_0x45eb('0x6'));router[_0x45eb('0x7')]('/',auth[_0x45eb('0x8')](),controller[_0x45eb('0x9')]);router[_0x45eb('0x7')](_0x45eb('0xa'),auth[_0x45eb('0x8')](),controller[_0x45eb('0xb')]);router[_0x45eb('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x45eb('0xd')]('/:id',auth[_0x45eb('0x8')](),controller[_0x45eb('0xe')]);router['delete'](_0x45eb('0xa'),auth[_0x45eb('0x8')](),controller[_0x45eb('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 0fc344e..f6fa902 100644 --- a/server/api/pause/pause.attributes.js +++ b/server/api/pause/pause.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x458f=['sequelize','STRING'];(function(_0x51e7cc,_0x442fb6){var _0x3c9542=function(_0x1acf89){while(--_0x1acf89){_0x51e7cc['push'](_0x51e7cc['shift']());}};_0x3c9542(++_0x442fb6);}(_0x458f,0x196));var _0xf458=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x458f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf458('0x0'));module['exports']={'name':{'type':Sequelize[_0xf458('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xf458('0x1')]}}; \ No newline at end of file +var _0x872b=['exports','name','STRING','sequelize'];(function(_0x59dc55,_0x36b12b){var _0x4044a2=function(_0xceb51b){while(--_0xceb51b){_0x59dc55['push'](_0x59dc55['shift']());}};_0x4044a2(++_0x36b12b);}(_0x872b,0x18f));var _0xb872=function(_0x359ecf,_0x20a123){_0x359ecf=_0x359ecf-0x0;var _0x3ee937=_0x872b[_0x359ecf];return _0x3ee937;};'use strict';var Sequelize=require(_0xb872('0x0'));module[_0xb872('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb872('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xb872('0x3')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 8fff6e0..dd6b940 100644 --- a/server/api/pause/pause.controller.js +++ b/server/api/pause/pause.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3155=['key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','user','role','UserProfileSection','userProfileId','error','body','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','get','Pauses','UserProfileResource','stack','name','Pause','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0x3155,0x9d));var _0x5315=function(_0x51b51a,_0x2f156c){_0x51b51a=_0x51b51a-0x0;var _0x40bcd6=_0x3155[_0x51b51a];return _0x40bcd6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5315('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5315('0x1'));var moment=require('moment');var BPromise=require(_0x5315('0x2'));var Mustache=require(_0x5315('0x3'));var util=require('util');var path=require(_0x5315('0x4'));var sox=require(_0x5315('0x5'));var csv=require('to-csv');var ejs=require(_0x5315('0x6'));var fs=require('fs');var _=require(_0x5315('0x7'));var squel=require(_0x5315('0x8'));var crypto=require('crypto');var jsforce=require(_0x5315('0x9'));var deskjs=require(_0x5315('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5315('0xb'));var Papa=require(_0x5315('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5315('0xd'));var utils=require('../../config/utils');var config=require(_0x5315('0xe'));var db=require(_0x5315('0xf'))['db'];function respondWithStatusCode(_0x36ec9c,_0x400247){_0x400247=_0x400247||0xcc;return function(_0xe54f47){if(_0xe54f47){return _0x36ec9c[_0x5315('0x10')](_0x400247);}return _0x36ec9c[_0x5315('0x11')](_0x400247)[_0x5315('0x12')]();};}function respondWithResult(_0x277603,_0x491689){_0x491689=_0x491689||0xc8;return function(_0x24fccc){if(_0x24fccc){return _0x277603[_0x5315('0x11')](_0x491689)[_0x5315('0x13')](_0x24fccc);}};}function respondWithFilteredResult(_0x1b9016,_0x292d87){return function(_0x509f1d){if(_0x509f1d){var _0x57aa2b=_0x509f1d[_0x5315('0x14')],_0x29c102=_0x292d87[_0x5315('0x15')],_0x2f87e9=_0x292d87[_0x5315('0x15')]+_0x292d87[_0x5315('0x16')],_0x404880;if(_0x2f87e9>=_0x57aa2b){_0x2f87e9=_0x57aa2b;_0x404880=0xc8;}else{_0x404880=0xce;}_0x1b9016[_0x5315('0x11')](_0x404880);return _0x1b9016[_0x5315('0x17')]('Content-Range',_0x29c102+'-'+_0x2f87e9+'/'+_0x57aa2b)[_0x5315('0x13')](_0x509f1d);}return null;};}function patchUpdates(_0x29273e){return function(_0x9ab9f4){try{jsonpatch[_0x5315('0x18')](_0x9ab9f4,_0x29273e,!![]);}catch(_0x4f9cd9){return BPromise[_0x5315('0x19')](_0x4f9cd9);}return _0x9ab9f4['save']();};}function saveUpdates(_0x3f9241,_0x42f80a){return function(_0x462fc0){if(_0x462fc0){return _0x462fc0[_0x5315('0x1a')](_0x3f9241)[_0x5315('0x1b')](function(_0x2dd263){return _0x2dd263;});}return null;};}function removeEntity(_0x4803e2,_0x48efa7){return function(_0x25bf5f){if(_0x25bf5f){return _0x25bf5f[_0x5315('0x1c')]()[_0x5315('0x1b')](function(){var _0x17e037=_0x25bf5f[_0x5315('0x1d')]({'plain':!![]});var _0xfc4728=_0x5315('0x1e');return db[_0x5315('0x1f')][_0x5315('0x1c')]({'where':{'type':_0xfc4728,'resourceId':_0x17e037['id']}})[_0x5315('0x1b')](function(){return _0x25bf5f;});})[_0x5315('0x1b')](function(){_0x4803e2[_0x5315('0x11')](0xcc)[_0x5315('0x12')]();});}};}function handleEntityNotFound(_0x3cc52e,_0x2d2bcc){return function(_0x59cc29){if(!_0x59cc29){_0x3cc52e['sendStatus'](0x194);}return _0x59cc29;};}function handleError(_0x29fa66,_0x3d5b96){_0x3d5b96=_0x3d5b96||0x1f4;return function(_0x59de7d){logger['error'](_0x59de7d[_0x5315('0x20')]);if(_0x59de7d[_0x5315('0x21')]){delete _0x59de7d[_0x5315('0x21')];}_0x29fa66[_0x5315('0x11')](_0x3d5b96)['send'](_0x59de7d);};}exports['index']=function(_0x3aa7cf,_0x4ee6e7){var _0x17d255={},_0x6ac99={},_0xa57854={'count':0x0,'rows':[]};var _0x334588=db[_0x5315('0x22')]['rawAttributes'];_0x6ac99[_0x5315('0x23')]=_[_0x5315('0x24')](_0x334588);_0x6ac99[_0x5315('0x25')]=_[_0x5315('0x24')](_0x3aa7cf[_0x5315('0x25')]);_0x6ac99[_0x5315('0x26')]=_[_0x5315('0x27')](_0x6ac99[_0x5315('0x23')],_0x6ac99[_0x5315('0x25')]);_0x17d255[_0x5315('0x28')]=_[_0x5315('0x27')](_0x6ac99[_0x5315('0x23')],qs[_0x5315('0x29')](_0x3aa7cf[_0x5315('0x25')][_0x5315('0x29')]));_0x17d255[_0x5315('0x28')]=_0x17d255[_0x5315('0x28')][_0x5315('0x2a')]?_0x17d255[_0x5315('0x28')]:_0x6ac99[_0x5315('0x23')];if(!_0x3aa7cf[_0x5315('0x25')][_0x5315('0x2b')](_0x5315('0x2c'))){_0x17d255[_0x5315('0x16')]=qs[_0x5315('0x16')](_0x3aa7cf[_0x5315('0x25')][_0x5315('0x16')]);_0x17d255[_0x5315('0x15')]=qs[_0x5315('0x15')](_0x3aa7cf[_0x5315('0x25')][_0x5315('0x15')]);}_0x17d255['order']=qs[_0x5315('0x2d')](_0x3aa7cf[_0x5315('0x25')][_0x5315('0x2d')]);_0x17d255['where']=qs[_0x5315('0x26')](_[_0x5315('0x2e')](_0x3aa7cf[_0x5315('0x25')],_0x6ac99['filters']));if(_0x3aa7cf['query'][_0x5315('0x2f')]){_0x17d255[_0x5315('0x30')]=_[_0x5315('0x31')](_0x17d255[_0x5315('0x30')],{'$or':_['map'](_0x334588,function(_0x1bb1c8){if(_0x1bb1c8['type'][_0x5315('0x32')]!==_0x5315('0x33')){var _0x9dd57f={};_0x9dd57f[_0x1bb1c8[_0x5315('0x34')]]={'$like':'%'+_0x3aa7cf['query'][_0x5315('0x2f')]+'%'};return _0x9dd57f;}})});}_0x17d255=_[_0x5315('0x31')]({},_0x17d255,_0x3aa7cf[_0x5315('0x35')]);var _0x47d09c={'where':_0x17d255[_0x5315('0x30')]};return db[_0x5315('0x22')][_0x5315('0x14')](_0x47d09c)[_0x5315('0x1b')](function(_0x42508d){_0xa57854[_0x5315('0x14')]=_0x42508d;if(_0x3aa7cf['query'][_0x5315('0x36')]){_0x17d255[_0x5315('0x37')]=[{'all':!![]}];}return db[_0x5315('0x22')][_0x5315('0x38')](_0x17d255);})['then'](function(_0x53b007){_0xa57854[_0x5315('0x39')]=_0x53b007;return _0xa57854;})[_0x5315('0x1b')](respondWithFilteredResult(_0x4ee6e7,_0x17d255))[_0x5315('0x3a')](handleError(_0x4ee6e7,null));};exports['show']=function(_0x1a1c5e,_0x4c894b){var _0x591d21={'raw':!![],'where':{'id':_0x1a1c5e[_0x5315('0x3b')]['id']}},_0x89c91b={};_0x89c91b[_0x5315('0x23')]=_[_0x5315('0x24')](db[_0x5315('0x22')][_0x5315('0x3c')]);_0x89c91b['query']=_[_0x5315('0x24')](_0x1a1c5e[_0x5315('0x25')]);_0x89c91b[_0x5315('0x26')]=_[_0x5315('0x27')](_0x89c91b[_0x5315('0x23')],_0x89c91b[_0x5315('0x25')]);_0x591d21[_0x5315('0x28')]=_[_0x5315('0x27')](_0x89c91b[_0x5315('0x23')],qs[_0x5315('0x29')](_0x1a1c5e[_0x5315('0x25')]['fields']));_0x591d21[_0x5315('0x28')]=_0x591d21[_0x5315('0x28')][_0x5315('0x2a')]?_0x591d21[_0x5315('0x28')]:_0x89c91b[_0x5315('0x23')];if(_0x1a1c5e['query'][_0x5315('0x36')]){_0x591d21[_0x5315('0x37')]=[{'all':!![]}];}_0x591d21=_[_0x5315('0x31')]({},_0x591d21,_0x1a1c5e[_0x5315('0x35')]);return db['Pause'][_0x5315('0x3d')](_0x591d21)[_0x5315('0x1b')](handleEntityNotFound(_0x4c894b,null))[_0x5315('0x1b')](respondWithResult(_0x4c894b,null))[_0x5315('0x3a')](handleError(_0x4c894b,null));};exports['create']=function(_0x4315c8,_0x3e23da){return db[_0x5315('0x22')][_0x5315('0x3e')](_0x4315c8['body'],{})[_0x5315('0x1b')](function(_0x3eecf7){var _0x58adef=_0x4315c8[_0x5315('0x3f')]['get']({'plain':!![]});if(!_0x58adef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58adef[_0x5315('0x40')]===_0x5315('0x3f')){var _0x21525b=_0x3eecf7['get']({'plain':!![]});var _0x129fb6=_0x5315('0x1e');return db[_0x5315('0x41')][_0x5315('0x3d')]({'where':{'name':_0x129fb6,'userProfileId':_0x58adef[_0x5315('0x42')]},'raw':!![]})[_0x5315('0x1b')](function(_0x2fd494){if(_0x2fd494&&_0x2fd494['autoAssociation']===0x0){return db[_0x5315('0x1f')][_0x5315('0x3e')]({'name':_0x21525b[_0x5315('0x21')],'resourceId':_0x21525b['id'],'type':_0x2fd494[_0x5315('0x21')],'sectionId':_0x2fd494['id']},{})[_0x5315('0x1b')](function(){return _0x3eecf7;});}else{return _0x3eecf7;}})[_0x5315('0x3a')](function(_0x461062){logger[_0x5315('0x43')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x461062);throw _0x461062;});}return _0x3eecf7;})[_0x5315('0x1b')](respondWithResult(_0x3e23da,0xc9))['catch'](handleError(_0x3e23da,null));};exports['update']=function(_0x5bb83c,_0x39047a){if(_0x5bb83c[_0x5315('0x44')]['id']){delete _0x5bb83c[_0x5315('0x44')]['id'];}return db[_0x5315('0x22')][_0x5315('0x3d')]({'where':{'id':_0x5bb83c[_0x5315('0x3b')]['id']}})[_0x5315('0x1b')](handleEntityNotFound(_0x39047a,null))[_0x5315('0x1b')](saveUpdates(_0x5bb83c[_0x5315('0x44')],null))[_0x5315('0x1b')](respondWithResult(_0x39047a,null))[_0x5315('0x3a')](handleError(_0x39047a,null));};exports[_0x5315('0x1c')]=function(_0x6e4a91,_0x1e696c){return db[_0x5315('0x22')][_0x5315('0x3d')]({'where':{'id':_0x6e4a91[_0x5315('0x3b')]['id']}})[_0x5315('0x1b')](handleEntityNotFound(_0x1e696c,null))[_0x5315('0x1b')](removeEntity(_0x1e696c,null))[_0x5315('0x3a')](handleError(_0x1e696c,null));}; \ No newline at end of file +var _0x1a4e=['reject','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','Pause','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','map','type','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','show','params','fields','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','json'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x1a4e,0x1ca));var _0xe1a4=function(_0x5af305,_0xaf3cf8){_0x5af305=_0x5af305-0x0;var _0x4d9831=_0x1a4e[_0x5af305];return _0x4d9831;};'use strict';var pdf=require(_0xe1a4('0x0'));var emlformat=require(_0xe1a4('0x1'));var rimraf=require(_0xe1a4('0x2'));var zipdir=require(_0xe1a4('0x3'));var jsonpatch=require(_0xe1a4('0x4'));var rp=require('request-promise');var moment=require(_0xe1a4('0x5'));var BPromise=require(_0xe1a4('0x6'));var Mustache=require(_0xe1a4('0x7'));var util=require(_0xe1a4('0x8'));var path=require(_0xe1a4('0x9'));var sox=require('sox');var csv=require(_0xe1a4('0xa'));var ejs=require(_0xe1a4('0xb'));var fs=require('fs');var _=require(_0xe1a4('0xc'));var squel=require('squel');var crypto=require(_0xe1a4('0xd'));var jsforce=require(_0xe1a4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe1a4('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe1a4('0xf'));var authService=require(_0xe1a4('0x10'));var qs=require(_0xe1a4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe1a4('0x12'));var utils=require(_0xe1a4('0x13'));var config=require(_0xe1a4('0x14'));var db=require(_0xe1a4('0x15'))['db'];function respondWithStatusCode(_0x2e7b55,_0x2e9359){_0x2e9359=_0x2e9359||0xcc;return function(_0x46c696){if(_0x46c696){return _0x2e7b55[_0xe1a4('0x16')](_0x2e9359);}return _0x2e7b55[_0xe1a4('0x17')](_0x2e9359)[_0xe1a4('0x18')]();};}function respondWithResult(_0x15b4c5,_0x28e95b){_0x28e95b=_0x28e95b||0xc8;return function(_0x122653){if(_0x122653){return _0x15b4c5['status'](_0x28e95b)['json'](_0x122653);}};}function respondWithFilteredResult(_0x5ef3b1,_0x356dac){return function(_0x1bdb92){if(_0x1bdb92){var _0x55496f=_0x1bdb92['count'],_0x11effc=_0x356dac[_0xe1a4('0x19')],_0x148bb5=_0x356dac[_0xe1a4('0x19')]+_0x356dac['limit'],_0x36f12e;if(_0x148bb5>=_0x55496f){_0x148bb5=_0x55496f;_0x36f12e=0xc8;}else{_0x36f12e=0xce;}_0x5ef3b1[_0xe1a4('0x17')](_0x36f12e);return _0x5ef3b1[_0xe1a4('0x1a')]('Content-Range',_0x11effc+'-'+_0x148bb5+'/'+_0x55496f)[_0xe1a4('0x1b')](_0x1bdb92);}return null;};}function patchUpdates(_0x4b5e17){return function(_0x266498){try{jsonpatch['apply'](_0x266498,_0x4b5e17,!![]);}catch(_0x5e340f){return BPromise[_0xe1a4('0x1c')](_0x5e340f);}return _0x266498['save']();};}function saveUpdates(_0x17f290,_0x842243){return function(_0x22b88e){if(_0x22b88e){return _0x22b88e[_0xe1a4('0x1d')](_0x17f290)[_0xe1a4('0x1e')](function(_0x5531fa){return _0x5531fa;});}return null;};}function removeEntity(_0x266601,_0x19b7b3){return function(_0x23d86f){if(_0x23d86f){return _0x23d86f[_0xe1a4('0x1f')]()['then'](function(){var _0x3bae4c=_0x23d86f[_0xe1a4('0x20')]({'plain':!![]});var _0x3792c7=_0xe1a4('0x21');return db[_0xe1a4('0x22')][_0xe1a4('0x1f')]({'where':{'type':_0x3792c7,'resourceId':_0x3bae4c['id']}})[_0xe1a4('0x1e')](function(){return _0x23d86f;});})[_0xe1a4('0x1e')](function(){_0x266601[_0xe1a4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d44b1,_0x591a56){return function(_0x1e3afe){if(!_0x1e3afe){_0x5d44b1[_0xe1a4('0x16')](0x194);}return _0x1e3afe;};}function handleError(_0x194e62,_0x280604){_0x280604=_0x280604||0x1f4;return function(_0x2613be){logger[_0xe1a4('0x23')](_0x2613be[_0xe1a4('0x24')]);if(_0x2613be[_0xe1a4('0x25')]){delete _0x2613be[_0xe1a4('0x25')];}_0x194e62[_0xe1a4('0x17')](_0x280604)[_0xe1a4('0x26')](_0x2613be);};}exports[_0xe1a4('0x27')]=function(_0x5d3840,_0x316b44){var _0x2471fa={},_0x35d938={},_0x5bd961={'count':0x0,'rows':[]};var _0x4eeac4=db[_0xe1a4('0x28')][_0xe1a4('0x29')];_0x35d938[_0xe1a4('0x2a')]=_[_0xe1a4('0x2b')](_0x4eeac4);_0x35d938[_0xe1a4('0x2c')]=_[_0xe1a4('0x2b')](_0x5d3840[_0xe1a4('0x2c')]);_0x35d938[_0xe1a4('0x2d')]=_[_0xe1a4('0x2e')](_0x35d938[_0xe1a4('0x2a')],_0x35d938[_0xe1a4('0x2c')]);_0x2471fa[_0xe1a4('0x2f')]=_[_0xe1a4('0x2e')](_0x35d938[_0xe1a4('0x2a')],qs['fields'](_0x5d3840['query']['fields']));_0x2471fa['attributes']=_0x2471fa[_0xe1a4('0x2f')][_0xe1a4('0x30')]?_0x2471fa[_0xe1a4('0x2f')]:_0x35d938[_0xe1a4('0x2a')];if(!_0x5d3840[_0xe1a4('0x2c')][_0xe1a4('0x31')](_0xe1a4('0x32'))){_0x2471fa[_0xe1a4('0x33')]=qs[_0xe1a4('0x33')](_0x5d3840['query']['limit']);_0x2471fa[_0xe1a4('0x19')]=qs[_0xe1a4('0x19')](_0x5d3840[_0xe1a4('0x2c')][_0xe1a4('0x19')]);}_0x2471fa['order']=qs[_0xe1a4('0x34')](_0x5d3840['query'][_0xe1a4('0x34')]);_0x2471fa['where']=qs[_0xe1a4('0x2d')](_[_0xe1a4('0x35')](_0x5d3840['query'],_0x35d938[_0xe1a4('0x2d')]));if(_0x5d3840[_0xe1a4('0x2c')]['filter']){_0x2471fa[_0xe1a4('0x36')]=_[_0xe1a4('0x37')](_0x2471fa[_0xe1a4('0x36')],{'$or':_[_0xe1a4('0x38')](_0x4eeac4,function(_0x578803){if(_0x578803[_0xe1a4('0x39')][_0xe1a4('0x3a')]!==_0xe1a4('0x3b')){var _0x12f71f={};_0x12f71f[_0x578803[_0xe1a4('0x3c')]]={'$like':'%'+_0x5d3840[_0xe1a4('0x2c')][_0xe1a4('0x3d')]+'%'};return _0x12f71f;}})});}_0x2471fa=_[_0xe1a4('0x37')]({},_0x2471fa,_0x5d3840[_0xe1a4('0x3e')]);var _0x21b91f={'where':_0x2471fa[_0xe1a4('0x36')]};return db['Pause'][_0xe1a4('0x3f')](_0x21b91f)[_0xe1a4('0x1e')](function(_0x5731d8){_0x5bd961[_0xe1a4('0x3f')]=_0x5731d8;if(_0x5d3840['query'][_0xe1a4('0x40')]){_0x2471fa[_0xe1a4('0x41')]=[{'all':!![]}];}return db['Pause'][_0xe1a4('0x42')](_0x2471fa);})[_0xe1a4('0x1e')](function(_0x148e73){_0x5bd961['rows']=_0x148e73;return _0x5bd961;})[_0xe1a4('0x1e')](respondWithFilteredResult(_0x316b44,_0x2471fa))['catch'](handleError(_0x316b44,null));};exports[_0xe1a4('0x43')]=function(_0x304bef,_0x3d1085){var _0x14883e={'raw':!![],'where':{'id':_0x304bef[_0xe1a4('0x44')]['id']}},_0x23ed37={};_0x23ed37[_0xe1a4('0x2a')]=_[_0xe1a4('0x2b')](db[_0xe1a4('0x28')][_0xe1a4('0x29')]);_0x23ed37[_0xe1a4('0x2c')]=_['keys'](_0x304bef['query']);_0x23ed37[_0xe1a4('0x2d')]=_[_0xe1a4('0x2e')](_0x23ed37[_0xe1a4('0x2a')],_0x23ed37[_0xe1a4('0x2c')]);_0x14883e['attributes']=_[_0xe1a4('0x2e')](_0x23ed37[_0xe1a4('0x2a')],qs[_0xe1a4('0x45')](_0x304bef[_0xe1a4('0x2c')][_0xe1a4('0x45')]));_0x14883e['attributes']=_0x14883e[_0xe1a4('0x2f')]['length']?_0x14883e[_0xe1a4('0x2f')]:_0x23ed37['model'];if(_0x304bef[_0xe1a4('0x2c')]['includeAll']){_0x14883e['include']=[{'all':!![]}];}_0x14883e=_['merge']({},_0x14883e,_0x304bef[_0xe1a4('0x3e')]);return db[_0xe1a4('0x28')]['find'](_0x14883e)[_0xe1a4('0x1e')](handleEntityNotFound(_0x3d1085,null))['then'](respondWithResult(_0x3d1085,null))[_0xe1a4('0x46')](handleError(_0x3d1085,null));};exports[_0xe1a4('0x47')]=function(_0x36c84a,_0x2f4adf){return db[_0xe1a4('0x28')]['create'](_0x36c84a[_0xe1a4('0x48')],{})[_0xe1a4('0x1e')](function(_0x10cde9){var _0x570f6e=_0x36c84a['user'][_0xe1a4('0x20')]({'plain':!![]});if(!_0x570f6e)throw new Error(_0xe1a4('0x49'));if(_0x570f6e[_0xe1a4('0x4a')]===_0xe1a4('0x4b')){var _0x128db6=_0x10cde9[_0xe1a4('0x20')]({'plain':!![]});var _0x5559e8=_0xe1a4('0x21');return db[_0xe1a4('0x4c')][_0xe1a4('0x4d')]({'where':{'name':_0x5559e8,'userProfileId':_0x570f6e[_0xe1a4('0x4e')]},'raw':!![]})[_0xe1a4('0x1e')](function(_0x1bd489){if(_0x1bd489&&_0x1bd489[_0xe1a4('0x4f')]===0x0){return db[_0xe1a4('0x22')]['create']({'name':_0x128db6[_0xe1a4('0x25')],'resourceId':_0x128db6['id'],'type':_0x1bd489[_0xe1a4('0x25')],'sectionId':_0x1bd489['id']},{})['then'](function(){return _0x10cde9;});}else{return _0x10cde9;}})[_0xe1a4('0x46')](function(_0x1c8d7d){logger[_0xe1a4('0x23')](_0xe1a4('0x50'),_0x1c8d7d);throw _0x1c8d7d;});}return _0x10cde9;})[_0xe1a4('0x1e')](respondWithResult(_0x2f4adf,0xc9))[_0xe1a4('0x46')](handleError(_0x2f4adf,null));};exports[_0xe1a4('0x1d')]=function(_0x22c815,_0x15dce4){if(_0x22c815[_0xe1a4('0x48')]['id']){delete _0x22c815['body']['id'];}return db[_0xe1a4('0x28')][_0xe1a4('0x4d')]({'where':{'id':_0x22c815['params']['id']}})[_0xe1a4('0x1e')](handleEntityNotFound(_0x15dce4,null))['then'](saveUpdates(_0x22c815['body'],null))[_0xe1a4('0x1e')](respondWithResult(_0x15dce4,null))[_0xe1a4('0x46')](handleError(_0x15dce4,null));};exports[_0xe1a4('0x1f')]=function(_0x4d13bb,_0x2e6b8a){return db['Pause']['find']({'where':{'id':_0x4d13bb[_0xe1a4('0x44')]['id']}})[_0xe1a4('0x1e')](handleEntityNotFound(_0x2e6b8a,null))[_0xe1a4('0x1e')](removeEntity(_0x2e6b8a,null))[_0xe1a4('0x46')](handleError(_0x2e6b8a,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index c1c7f78..ff228c4 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd844=['Pause','lodash','util','api','moment','path','rimraf','../../config/environment','./pause.attributes'];(function(_0x35e534,_0x6337d9){var _0x1304e4=function(_0x2a6a4d){while(--_0x2a6a4d){_0x35e534['push'](_0x35e534['shift']());}};_0x1304e4(++_0x6337d9);}(_0xd844,0x6d));var _0x4d84=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd844[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x4d84('0x0'));var util=require(_0x4d84('0x1'));var logger=require('../../config/logger')(_0x4d84('0x2'));var moment=require(_0x4d84('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d84('0x4'));var rimraf=require(_0x4d84('0x5'));var config=require(_0x4d84('0x6'));var attributes=require(_0x4d84('0x7'));module['exports']=function(_0x14fbd4,_0x5e926e){return _0x14fbd4['define'](_0x4d84('0x8'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1e8=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','exports','define','tools_pauses'];(function(_0x552b70,_0x58daff){var _0x4f5618=function(_0x23934b){while(--_0x23934b){_0x552b70['push'](_0x552b70['shift']());}};_0x4f5618(++_0x58daff);}(_0xe1e8,0x1cb));var _0x8e1e=function(_0x2a91a2,_0x3a7285){_0x2a91a2=_0x2a91a2-0x0;var _0x52468d=_0xe1e8[_0x2a91a2];return _0x52468d;};'use strict';var _=require(_0x8e1e('0x0'));var util=require('util');var logger=require(_0x8e1e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8e1e('0x2'));var rp=require(_0x8e1e('0x3'));var fs=require('fs');var path=require(_0x8e1e('0x4'));var rimraf=require(_0x8e1e('0x5'));var config=require('../../config/environment');var attributes=require('./pause.attributes');module[_0x8e1e('0x6')]=function(_0xf371b5,_0x13c945){return _0xf371b5[_0x8e1e('0x7')]('Pause',attributes,{'tableName':_0x8e1e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 6615a75..c6dbae7 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e16=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','error','code','message','Pause,\x20%s,\x20%s','result','catch','options','raw','where','attributes','include','map','model','ShowPause','stringify','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x2b8388,_0x246b8f){var _0x3ba12a=function(_0x848995){while(--_0x848995){_0x2b8388['push'](_0x2b8388['shift']());}};_0x3ba12a(++_0x246b8f);}(_0x7e16,0x16f));var _0x67e1=function(_0x8014b0,_0x34788d){_0x8014b0=_0x8014b0-0x0;var _0xca8ee=_0x7e16[_0x8014b0];return _0xca8ee;};'use strict';var _=require(_0x67e1('0x0'));var util=require(_0x67e1('0x1'));var moment=require(_0x67e1('0x2'));var BPromise=require(_0x67e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67e1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x67e1('0x5'))(_0x67e1('0x6'));var config=require('../../config/environment');var jayson=require(_0x67e1('0x7'));var client=jayson[_0x67e1('0x8')][_0x67e1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x451c5f,_0x3728a8,_0x5736e2){return new BPromise(function(_0x5cd5f1,_0x5c7742){return client[_0x67e1('0xa')](_0x451c5f,_0x5736e2)[_0x67e1('0xb')](function(_0x29af76){logger[_0x67e1('0xc')]('Pause,\x20%s,\x20%s',_0x3728a8,_0x67e1('0xd'));logger[_0x67e1('0xe')](_0x67e1('0xf'),_0x3728a8,_0x67e1('0xd'),JSON['stringify'](_0x29af76));if(_0x29af76[_0x67e1('0x10')]){if(_0x29af76['error'][_0x67e1('0x11')]===0x1f4){logger['error']('Pause,\x20%s,\x20%s',_0x3728a8,_0x29af76[_0x67e1('0x10')][_0x67e1('0x12')]);return _0x5c7742(_0x29af76[_0x67e1('0x10')][_0x67e1('0x12')]);}logger['error'](_0x67e1('0x13'),_0x3728a8,_0x29af76[_0x67e1('0x10')][_0x67e1('0x12')]);return _0x5cd5f1(_0x29af76['error'][_0x67e1('0x12')]);}else{logger[_0x67e1('0xc')](_0x67e1('0x13'),_0x3728a8,_0x67e1('0xd'));_0x5cd5f1(_0x29af76[_0x67e1('0x14')][_0x67e1('0x12')]);}})[_0x67e1('0x15')](function(_0x406ffe){logger[_0x67e1('0x10')](_0x67e1('0x13'),_0x3728a8,_0x406ffe);_0x5c7742(_0x406ffe);});});}exports['ShowPause']=function(_0x14ab29){var _0x9e931d=this;return new Promise(function(_0x2c36b8,_0x4ffd00){return db['Pause']['find']({'raw':_0x14ab29[_0x67e1('0x16')]?_0x14ab29[_0x67e1('0x16')][_0x67e1('0x17')]===undefined?!![]:![]:!![],'where':_0x14ab29[_0x67e1('0x16')]?_0x14ab29['options'][_0x67e1('0x18')]||null:null,'attributes':_0x14ab29[_0x67e1('0x16')]?_0x14ab29[_0x67e1('0x16')][_0x67e1('0x19')]||null:null,'include':_0x14ab29['options']?_0x14ab29[_0x67e1('0x16')][_0x67e1('0x1a')]?_[_0x67e1('0x1b')](_0x14ab29[_0x67e1('0x16')][_0x67e1('0x1a')],function(_0x2a627d){return{'model':db[_0x2a627d[_0x67e1('0x1c')]],'as':_0x2a627d['as'],'attributes':_0x2a627d['attributes'],'include':_0x2a627d[_0x67e1('0x1a')]?_[_0x67e1('0x1b')](_0x2a627d[_0x67e1('0x1a')],function(_0x1cae53){return{'model':db[_0x1cae53[_0x67e1('0x1c')]],'as':_0x1cae53['as'],'attributes':_0x1cae53[_0x67e1('0x19')],'include':_0x1cae53[_0x67e1('0x1a')]?_[_0x67e1('0x1b')](_0x1cae53[_0x67e1('0x1a')],function(_0x2fc2be){return{'model':db[_0x2fc2be['model']],'as':_0x2fc2be['as'],'attributes':_0x2fc2be[_0x67e1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x67e1('0xb')](function(_0x205f7d){logger['info'](_0x67e1('0x1d'),_0x14ab29);logger['debug'](_0x67e1('0x1d'),_0x14ab29,JSON[_0x67e1('0x1e')](_0x205f7d));_0x2c36b8(_0x205f7d);})[_0x67e1('0x15')](function(_0x544371){logger[_0x67e1('0x10')]('ShowPause',_0x544371[_0x67e1('0x12')],_0x14ab29);_0x4ffd00(_0x9e931d[_0x67e1('0x10')](0x1f4,_0x544371['message']));});});}; \ No newline at end of file +var _0x0207=['rpc','../../config/environment','http','request','info','Pause,\x20%s,\x20%s','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','error','code','message','ShowPause','Pause','find','options','where','attributes','include','model','map','then','debug','stringify','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0207,0x162));var _0x7020=function(_0x30014e,_0x555f27){_0x30014e=_0x30014e-0x0;var _0x1e3be1=_0x0207[_0x30014e];return _0x1e3be1;};'use strict';var _=require('lodash');var util=require(_0x7020('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7020('0x1'));var fs=require('fs');var Redis=require(_0x7020('0x2'));var db=require(_0x7020('0x3'))['db'];var utils=require(_0x7020('0x4'));var logger=require(_0x7020('0x5'))(_0x7020('0x6'));var config=require(_0x7020('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7020('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39263c,_0x3c6c11,_0x17deac){return new BPromise(function(_0x42bc79,_0x22ba3e){return client[_0x7020('0x9')](_0x39263c,_0x17deac)['then'](function(_0x5e86b5){logger[_0x7020('0xa')](_0x7020('0xb'),_0x3c6c11,_0x7020('0xc'));logger['debug'](_0x7020('0xd'),_0x3c6c11,_0x7020('0xc'),JSON['stringify'](_0x5e86b5));if(_0x5e86b5[_0x7020('0xe')]){if(_0x5e86b5[_0x7020('0xe')][_0x7020('0xf')]===0x1f4){logger['error'](_0x7020('0xb'),_0x3c6c11,_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);return _0x22ba3e(_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);}logger['error'](_0x7020('0xb'),_0x3c6c11,_0x5e86b5['error'][_0x7020('0x10')]);return _0x42bc79(_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);}else{logger[_0x7020('0xa')](_0x7020('0xb'),_0x3c6c11,_0x7020('0xc'));_0x42bc79(_0x5e86b5['result'][_0x7020('0x10')]);}})['catch'](function(_0x2f4db5){logger[_0x7020('0xe')](_0x7020('0xb'),_0x3c6c11,_0x2f4db5);_0x22ba3e(_0x2f4db5);});});}exports[_0x7020('0x11')]=function(_0x4fe6f1){var _0x3d5d25=this;return new Promise(function(_0x3ac2f6,_0x33daae){return db[_0x7020('0x12')][_0x7020('0x13')]({'raw':_0x4fe6f1[_0x7020('0x14')]?_0x4fe6f1['options']['raw']===undefined?!![]:![]:!![],'where':_0x4fe6f1[_0x7020('0x14')]?_0x4fe6f1[_0x7020('0x14')][_0x7020('0x15')]||null:null,'attributes':_0x4fe6f1[_0x7020('0x14')]?_0x4fe6f1['options'][_0x7020('0x16')]||null:null,'include':_0x4fe6f1[_0x7020('0x14')]?_0x4fe6f1[_0x7020('0x14')][_0x7020('0x17')]?_['map'](_0x4fe6f1[_0x7020('0x14')][_0x7020('0x17')],function(_0x17beaf){return{'model':db[_0x17beaf[_0x7020('0x18')]],'as':_0x17beaf['as'],'attributes':_0x17beaf[_0x7020('0x16')],'include':_0x17beaf[_0x7020('0x17')]?_[_0x7020('0x19')](_0x17beaf[_0x7020('0x17')],function(_0x502923){return{'model':db[_0x502923[_0x7020('0x18')]],'as':_0x502923['as'],'attributes':_0x502923[_0x7020('0x16')],'include':_0x502923[_0x7020('0x17')]?_['map'](_0x502923[_0x7020('0x17')],function(_0x4ad761){return{'model':db[_0x4ad761['model']],'as':_0x4ad761['as'],'attributes':_0x4ad761['attributes']};}):[]};}):[]};}):[]:[]})[_0x7020('0x1a')](function(_0x55957e){logger[_0x7020('0xa')]('ShowPause',_0x4fe6f1);logger[_0x7020('0x1b')](_0x7020('0x11'),_0x4fe6f1,JSON[_0x7020('0x1c')](_0x55957e));_0x3ac2f6(_0x55957e);})[_0x7020('0x1d')](function(_0xb03bd6){logger[_0x7020('0xe')](_0x7020('0x11'),_0xb03bd6[_0x7020('0x10')],_0x4fe6f1);_0x33daae(_0x3d5d25[_0x7020('0xe')](0x1f4,_0xb03bd6[_0x7020('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index b694fba..efff9aa 100644 --- a/server/api/plugin/index.js +++ b/server/api/plugin/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0971=['get','/:id','/:id/download','download','diskStorage','join','root','originalname','format','%s-%s%s','basename','now','extname','post','single','file','/webhook','webhookPost','update','delete','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','webhookGet'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0971,0x1c7));var _0x1097=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0x0971[_0x53c256];return _0x25feb6;};'use strict';var multer=require(_0x1097('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1097('0x1'));var router=express[_0x1097('0x2')]();var auth=require(_0x1097('0x3'));var interaction=require(_0x1097('0x4'));var config=require(_0x1097('0x5'));var controller=require(_0x1097('0x6'));router['get']('/',auth[_0x1097('0x7')](),controller[_0x1097('0x8')]);router['get']('/webhook',controller[_0x1097('0x9')]);router[_0x1097('0xa')](_0x1097('0xb'),auth[_0x1097('0x7')](),controller['show']);router[_0x1097('0xa')](_0x1097('0xc'),auth[_0x1097('0x7')](),controller[_0x1097('0xd')]);var upload=multer({'storage':multer[_0x1097('0xe')]({'destination':function(_0x5a6633,_0x539592,_0x4a4b27){_0x4a4b27(null,path[_0x1097('0xf')](config[_0x1097('0x10')],'server/files/plugins'));},'filename':function(_0x1baa90,_0x397d44,_0x2167bf){_0x397d44[_0x1097('0x11')]=_0x397d44['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2167bf(null,util[_0x1097('0x12')](_0x1097('0x13'),path[_0x1097('0x14')](_0x397d44['originalname'],path['extname'](_0x397d44['originalname'])),Date[_0x1097('0x15')](),path[_0x1097('0x16')](_0x397d44['originalname'])));}})});router[_0x1097('0x17')]('/',upload[_0x1097('0x18')](_0x1097('0x19')),controller['upload']);router[_0x1097('0x17')](_0x1097('0x1a'),controller[_0x1097('0x1b')]);router['put'](_0x1097('0xb'),auth[_0x1097('0x7')](),controller[_0x1097('0x1c')]);router[_0x1097('0x1d')](_0x1097('0xb'),auth[_0x1097('0x7')](),controller[_0x1097('0x1d')]);module[_0x1097('0x1e')]=router; \ No newline at end of file +var _0x67c7=['update','delete','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','webhookGet','/:id','show','download','join','originalname','replace','basename','extname','post','file','/webhook','put'];(function(_0x7c1a5d,_0x4bcb22){var _0x1cceb3=function(_0x3b235d){while(--_0x3b235d){_0x7c1a5d['push'](_0x7c1a5d['shift']());}};_0x1cceb3(++_0x4bcb22);}(_0x67c7,0x19b));var _0x767c=function(_0x52c538,_0x48f45a){_0x52c538=_0x52c538-0x0;var _0x33cb72=_0x67c7[_0x52c538];return _0x33cb72;};'use strict';var multer=require(_0x767c('0x0'));var util=require(_0x767c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x767c('0x2')]();var auth=require(_0x767c('0x3'));var interaction=require(_0x767c('0x4'));var config=require('../../config/environment');var controller=require(_0x767c('0x5'));router[_0x767c('0x6')]('/',auth[_0x767c('0x7')](),controller['index']);router[_0x767c('0x6')]('/webhook',controller[_0x767c('0x8')]);router[_0x767c('0x6')](_0x767c('0x9'),auth['isAuthenticated'](),controller[_0x767c('0xa')]);router[_0x767c('0x6')]('/:id/download',auth[_0x767c('0x7')](),controller[_0x767c('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1e81ae,_0x24b38c,_0x5d6d47){_0x5d6d47(null,path[_0x767c('0xc')](config['root'],'server/files/plugins'));},'filename':function(_0x2ec829,_0x33ff85,_0x50429f){_0x33ff85[_0x767c('0xd')]=_0x33ff85[_0x767c('0xd')][_0x767c('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x50429f(null,util['format']('%s-%s%s',path[_0x767c('0xf')](_0x33ff85['originalname'],path[_0x767c('0x10')](_0x33ff85['originalname'])),Date['now'](),path[_0x767c('0x10')](_0x33ff85[_0x767c('0xd')])));}})});router[_0x767c('0x11')]('/',upload['single'](_0x767c('0x12')),controller['upload']);router[_0x767c('0x11')](_0x767c('0x13'),controller['webhookPost']);router[_0x767c('0x14')](_0x767c('0x9'),auth[_0x767c('0x7')](),controller[_0x767c('0x15')]);router['delete'](_0x767c('0x9'),auth[_0x767c('0x7')](),controller[_0x767c('0x16')]);module[_0x767c('0x17')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 1c81c38..6e13cf8 100644 --- a/server/api/plugin/plugin.attributes.js +++ b/server/api/plugin/plugin.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2507=['sequelize','exports','STRING','ENUM','html','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x1630d6,_0x5b3636){var _0x2f938a=function(_0x50aa30){while(--_0x50aa30){_0x1630d6['push'](_0x1630d6['shift']());}};_0x2f938a(++_0x5b3636);}(_0x2507,0xbb));var _0x7250=function(_0x4ef1cd,_0x2de03c){_0x4ef1cd=_0x4ef1cd-0x0;var _0x1cdd01=_0x2507[_0x4ef1cd];return _0x1cdd01;};'use strict';var Sequelize=require(_0x7250('0x0'));module[_0x7250('0x1')]={'name':{'type':Sequelize[_0x7250('0x2')]},'type':{'type':Sequelize[_0x7250('0x3')](_0x7250('0x4'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x7250('0x5')]},'path':{'type':Sequelize[_0x7250('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x7250('0x6')],'defaultValue':0x0,'comment':_0x7250('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x7250('0x8'),'agentOnly',_0x7250('0x9'),'never'),'defaultValue':'always','comment':_0x7250('0xa')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x7250('0x2')]},'agentUrl':{'type':Sequelize[_0x7250('0x2')]},'scriptName':{'type':Sequelize[_0x7250('0x2')]},'scriptPath':{'type':Sequelize[_0x7250('0x2')]}}; \ No newline at end of file +var _0x948d=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','exports','ENUM','html','script','TEXT'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x948d,0x1c9));var _0xd948=function(_0x2b14fb,_0x53440c){_0x2b14fb=_0x2b14fb-0x0;var _0xcbd492=_0x948d[_0x2b14fb];return _0xcbd492;};'use strict';var Sequelize=require('sequelize');module[_0xd948('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd948('0x1')](_0xd948('0x2'),_0xd948('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xd948('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0xd948('0x5')},'active':{'type':Sequelize[_0xd948('0x6')],'defaultValue':0x0,'comment':_0xd948('0x7')},'sidebar':{'type':Sequelize[_0xd948('0x1')](_0xd948('0x8'),_0xd948('0x9'),_0xd948('0xa'),_0xd948('0xb')),'defaultValue':_0xd948('0xa'),'comment':_0xd948('0xc')},'icon':{'type':Sequelize[_0xd948('0xd')]},'adminUrl':{'type':Sequelize[_0xd948('0xd')]},'agentUrl':{'type':Sequelize[_0xd948('0xd')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index f69379e..21a6bfc 100644 --- a/server/api/plugin/plugin.controller.js +++ b/server/api/plugin/plugin.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf52=['parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','create','Zip\x20archive\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','http://localhost:','method','%s%s','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','../../components/parsers/qs','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','limit','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','error','name','send','index','Plugin','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','key','VIRTUAL','options','count','includeAll','rows','catch','show','params','include','find','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','undefined','Invalid\x20manifest:\x20name\x20missing','type','version','Invalid\x20manifest:\x20version\x20not\x20specified'];(function(_0x5a80f7,_0x1c77bc){var _0x63aa78=function(_0x456898){while(--_0x456898){_0x5a80f7['push'](_0x5a80f7['shift']());}};_0x63aa78(++_0x1c77bc);}(_0xcf52,0x181));var _0x2cf5=function(_0x51ba06,_0x4ed036){_0x51ba06=_0x51ba06-0x0;var _0x32a797=_0xcf52[_0x51ba06];return _0x32a797;};'use strict';var pdf=require(_0x2cf5('0x0'));var emlformat=require(_0x2cf5('0x1'));var rimraf=require(_0x2cf5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2cf5('0x3'));var rp=require('request-promise');var moment=require(_0x2cf5('0x4'));var BPromise=require(_0x2cf5('0x5'));var Mustache=require('mustache');var util=require(_0x2cf5('0x6'));var path=require(_0x2cf5('0x7'));var sox=require('sox');var csv=require(_0x2cf5('0x8'));var ejs=require(_0x2cf5('0x9'));var fs=require('fs');var _=require(_0x2cf5('0xa'));var squel=require(_0x2cf5('0xb'));var crypto=require(_0x2cf5('0xc'));var jsforce=require(_0x2cf5('0xd'));var deskjs=require(_0x2cf5('0xe'));var toCsv=require(_0x2cf5('0x8'));var querystring=require(_0x2cf5('0xf'));var Papa=require(_0x2cf5('0x10'));var extract=require(_0x2cf5('0x11'));var rimraf=require(_0x2cf5('0x2'));var archiver=require(_0x2cf5('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2cf5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2cf5('0x14'));var utils=require(_0x2cf5('0x15'));var config=require(_0x2cf5('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2cf5('0x17')](config[_0x2cf5('0x18')],{'host':_0x2cf5('0x19'),'port':0x18eb});var socket=require(_0x2cf5('0x1a'))(new Redis(config[_0x2cf5('0x18')]));require(_0x2cf5('0x1b'))[_0x2cf5('0x1c')](socket);function respondWithStatusCode(_0x4e8b5f,_0x588a99){_0x588a99=_0x588a99||0xcc;return function(_0x360e9e){if(_0x360e9e){return _0x4e8b5f[_0x2cf5('0x1d')](_0x588a99);}return _0x4e8b5f[_0x2cf5('0x1e')](_0x588a99)[_0x2cf5('0x1f')]();};}function respondWithResult(_0x207104,_0x12d455){_0x12d455=_0x12d455||0xc8;return function(_0x2f6fe7){if(_0x2f6fe7){return _0x207104[_0x2cf5('0x1e')](_0x12d455)[_0x2cf5('0x20')](_0x2f6fe7);}};}function respondWithFilteredResult(_0x722297,_0x4f8a04){return function(_0x1885a0){if(_0x1885a0){var _0x2b2c27=_0x1885a0['count'],_0x1252fa=_0x4f8a04[_0x2cf5('0x21')],_0x3f9413=_0x4f8a04[_0x2cf5('0x21')]+_0x4f8a04[_0x2cf5('0x22')],_0x5607e2;if(_0x3f9413>=_0x2b2c27){_0x3f9413=_0x2b2c27;_0x5607e2=0xc8;}else{_0x5607e2=0xce;}_0x722297['status'](_0x5607e2);return _0x722297['set']('Content-Range',_0x1252fa+'-'+_0x3f9413+'/'+_0x2b2c27)[_0x2cf5('0x20')](_0x1885a0);}return null;};}function patchUpdates(_0x7146a7){return function(_0x476ee4){try{jsonpatch[_0x2cf5('0x23')](_0x476ee4,_0x7146a7,!![]);}catch(_0x336f5a){return BPromise[_0x2cf5('0x24')](_0x336f5a);}return _0x476ee4[_0x2cf5('0x25')]();};}function saveUpdates(_0x3b9c8a,_0x5390a2){return function(_0x3e5f65){if(_0x3e5f65){return _0x3e5f65[_0x2cf5('0x26')](_0x3b9c8a)['then'](function(_0x1f8569){return _0x1f8569;});}return null;};}function removeEntity(_0x1f80c0,_0x53f18b){return function(_0x2c4cf5){if(_0x2c4cf5){return _0x2c4cf5[_0x2cf5('0x27')]()[_0x2cf5('0x28')](function(){var _0x588f80=_0x2c4cf5[_0x2cf5('0x29')]({'plain':!![]});var _0x1dcb78=_0x2cf5('0x2a');return db[_0x2cf5('0x2b')][_0x2cf5('0x27')]({'where':{'type':_0x1dcb78,'resourceId':_0x588f80['id']}})[_0x2cf5('0x28')](function(){return _0x2c4cf5;});})[_0x2cf5('0x28')](function(){_0x1f80c0[_0x2cf5('0x1e')](0xcc)[_0x2cf5('0x1f')]();});}};}function handleEntityNotFound(_0x1336c5,_0x3999ba){return function(_0x1a5c23){if(!_0x1a5c23){_0x1336c5[_0x2cf5('0x1d')](0x194);}return _0x1a5c23;};}function handleError(_0x4938c2,_0x85b206){_0x85b206=_0x85b206||0x1f4;return function(_0x290fdb){logger[_0x2cf5('0x2c')](_0x290fdb['stack']);if(_0x290fdb[_0x2cf5('0x2d')]){delete _0x290fdb['name'];}_0x4938c2[_0x2cf5('0x1e')](_0x85b206)[_0x2cf5('0x2e')](_0x290fdb);};}exports[_0x2cf5('0x2f')]=function(_0x4d21cd,_0x45ca6d){var _0x46c112={},_0x47c728={},_0xbe3088={'count':0x0,'rows':[]};var _0xafc3f8=db[_0x2cf5('0x30')][_0x2cf5('0x31')];_0x47c728[_0x2cf5('0x32')]=_[_0x2cf5('0x33')](_0xafc3f8);_0x47c728['query']=_[_0x2cf5('0x33')](_0x4d21cd[_0x2cf5('0x34')]);_0x47c728[_0x2cf5('0x35')]=_['intersection'](_0x47c728['model'],_0x47c728[_0x2cf5('0x34')]);_0x46c112[_0x2cf5('0x36')]=_[_0x2cf5('0x37')](_0x47c728['model'],qs['fields'](_0x4d21cd[_0x2cf5('0x34')][_0x2cf5('0x38')]));_0x46c112[_0x2cf5('0x36')]=_0x46c112[_0x2cf5('0x36')][_0x2cf5('0x39')]?_0x46c112[_0x2cf5('0x36')]:_0x47c728['model'];if(!_0x4d21cd[_0x2cf5('0x34')][_0x2cf5('0x3a')](_0x2cf5('0x3b'))){_0x46c112[_0x2cf5('0x22')]=qs['limit'](_0x4d21cd[_0x2cf5('0x34')][_0x2cf5('0x22')]);_0x46c112[_0x2cf5('0x21')]=qs[_0x2cf5('0x21')](_0x4d21cd['query'][_0x2cf5('0x21')]);}_0x46c112['order']=qs[_0x2cf5('0x3c')](_0x4d21cd['query'][_0x2cf5('0x3c')]);_0x46c112[_0x2cf5('0x3d')]=qs[_0x2cf5('0x35')](_['pick'](_0x4d21cd[_0x2cf5('0x34')],_0x47c728[_0x2cf5('0x35')]));if(_0x4d21cd[_0x2cf5('0x34')][_0x2cf5('0x3e')]){_0x46c112['where']=_[_0x2cf5('0x3f')](_0x46c112[_0x2cf5('0x3d')],{'$or':_['map'](_0xafc3f8,function(_0xf7fa40){if(_0xf7fa40['type'][_0x2cf5('0x40')]!==_0x2cf5('0x41')){var _0xd0501c={};_0xd0501c[_0xf7fa40['field']]={'$like':'%'+_0x4d21cd['query']['filter']+'%'};return _0xd0501c;}})});}_0x46c112=_[_0x2cf5('0x3f')]({},_0x46c112,_0x4d21cd[_0x2cf5('0x42')]);var _0x340436={'where':_0x46c112[_0x2cf5('0x3d')]};return db['Plugin']['count'](_0x340436)[_0x2cf5('0x28')](function(_0x4f04a0){_0xbe3088[_0x2cf5('0x43')]=_0x4f04a0;if(_0x4d21cd[_0x2cf5('0x34')][_0x2cf5('0x44')]){_0x46c112['include']=[{'all':!![]}];}return db[_0x2cf5('0x30')]['findAll'](_0x46c112);})[_0x2cf5('0x28')](function(_0x152453){_0xbe3088[_0x2cf5('0x45')]=_0x152453;return _0xbe3088;})[_0x2cf5('0x28')](respondWithFilteredResult(_0x45ca6d,_0x46c112))[_0x2cf5('0x46')](handleError(_0x45ca6d,null));};exports[_0x2cf5('0x47')]=function(_0x3684fa,_0x576e74){var _0x50eddc={'raw':!![],'where':{'id':_0x3684fa[_0x2cf5('0x48')]['id']}},_0x2de921={};_0x2de921[_0x2cf5('0x32')]=_['keys'](db[_0x2cf5('0x30')][_0x2cf5('0x31')]);_0x2de921[_0x2cf5('0x34')]=_[_0x2cf5('0x33')](_0x3684fa[_0x2cf5('0x34')]);_0x2de921[_0x2cf5('0x35')]=_[_0x2cf5('0x37')](_0x2de921[_0x2cf5('0x32')],_0x2de921[_0x2cf5('0x34')]);_0x50eddc[_0x2cf5('0x36')]=_[_0x2cf5('0x37')](_0x2de921[_0x2cf5('0x32')],qs[_0x2cf5('0x38')](_0x3684fa[_0x2cf5('0x34')][_0x2cf5('0x38')]));_0x50eddc[_0x2cf5('0x36')]=_0x50eddc[_0x2cf5('0x36')][_0x2cf5('0x39')]?_0x50eddc[_0x2cf5('0x36')]:_0x2de921['model'];if(_0x3684fa['query'][_0x2cf5('0x44')]){_0x50eddc[_0x2cf5('0x49')]=[{'all':!![]}];}_0x50eddc=_['merge']({},_0x50eddc,_0x3684fa[_0x2cf5('0x42')]);return db['Plugin'][_0x2cf5('0x4a')](_0x50eddc)[_0x2cf5('0x28')](handleEntityNotFound(_0x576e74,null))['then'](respondWithResult(_0x576e74,null))[_0x2cf5('0x46')](handleError(_0x576e74,null));};exports[_0x2cf5('0x4b')]=function(_0xfe0dbe,_0xf0a97f,_0x566cc5){return db[_0x2cf5('0x30')]['find']({'where':{'id':_0xfe0dbe['params']['id']},'attributes':['name','path'],'raw':!![]})[_0x2cf5('0x28')](handleEntityNotFound(_0xf0a97f,null))['then'](function(_0x21167a){if(_0x21167a){var _0x54fec7=path[_0x2cf5('0x4c')](config[_0x2cf5('0x4d')],_0x2cf5('0x4e'),util[_0x2cf5('0x4f')](_0x2cf5('0x50'),path[_0x2cf5('0x51')](_0x21167a[_0x2cf5('0x7')])));var _0xdfb8b1=fs[_0x2cf5('0x52')](_0x54fec7);var _0x12d27a=archiver(_0x2cf5('0x53'),{'zlib':{'level':0x9}});_0x12d27a['on'](_0x2cf5('0x54'),function(_0x376bfa){if(_0x376bfa['code']===_0x2cf5('0x55')){logger['error'](_0x376bfa);}else{throw new db[(_0x2cf5('0x56'))][(_0x2cf5('0x57'))](_0x2cf5('0x58'));}});_0x12d27a['on'](_0x2cf5('0x2c'),function(_0x1d722e){throw new db['Sequelize'][(_0x2cf5('0x57'))](_0x2cf5('0x58'));});_0x12d27a[_0x2cf5('0x59')](_0xdfb8b1);_0x12d27a[_0x2cf5('0x5a')](_0x2cf5('0x5b'),{'cwd':path[_0x2cf5('0x4c')](config[_0x2cf5('0x4d')],_0x2cf5('0x4e'),path[_0x2cf5('0x5c')](_0x21167a[_0x2cf5('0x7')])),'ignore':[path[_0x2cf5('0x4c')](path[_0x2cf5('0x51')](_0x21167a[_0x2cf5('0x7')]),_0x2cf5('0x5d')),path[_0x2cf5('0x4c')](path[_0x2cf5('0x51')](_0x21167a[_0x2cf5('0x7')]),_0x2cf5('0x5e'))],'nodir':!![]})[_0x2cf5('0x5f')]();_0xdfb8b1['on']('close',function(){if(!fs[_0x2cf5('0x60')](_0x54fec7)){throw new db[(_0x2cf5('0x56'))][(_0x2cf5('0x57'))](_0x2cf5('0x61'));}return _0xf0a97f['download'](_0x54fec7,util[_0x2cf5('0x4f')]('%s.zip',path[_0x2cf5('0x51')](_0x21167a[_0x2cf5('0x7')])),function(_0x44293b){if(_0x44293b){throw new db[(_0x2cf5('0x56'))]['Error'](_0x2cf5('0x62'));}fs[_0x2cf5('0x63')](_0x54fec7);logger[_0x2cf5('0x64')]('Download\x20completed');logger[_0x2cf5('0x64')](_0x2cf5('0x65'));});});}return null;})[_0x2cf5('0x46')](handleError(_0xf0a97f,null));};exports[_0x2cf5('0x66')]=function(_0x57b9d0,_0x44255f,_0x106e70){var _0x46b1bc=path['basename'](_0x57b9d0[_0x2cf5('0x67')][_0x2cf5('0x68')],path['extname'](_0x57b9d0[_0x2cf5('0x67')][_0x2cf5('0x68')]));var _0x344657=path[_0x2cf5('0x4c')](config[_0x2cf5('0x4d')],_0x2cf5('0x4e'),_0x57b9d0[_0x2cf5('0x67')]['filename']);var _0x35c96f=path[_0x2cf5('0x4c')](config[_0x2cf5('0x4d')],_0x2cf5('0x4e'),_0x46b1bc);logger[_0x2cf5('0x64')](_0x2cf5('0x69'),_0x344657);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x35c96f);try{fs[_0x2cf5('0x6a')](_0x344657,parseInt(_0x2cf5('0x6b'),0x8));extract(_0x344657,{'dir':_0x35c96f},function(_0x242673){if(_0x242673){logger['error'](_0x242673);handleError(_0x242673,!![]);};var _0x3787f5=fs[_0x2cf5('0x6c')](_0x35c96f);if(_0x3787f5['length']>0x1){removeReferences(_0x344657,_0x35c96f);logger[_0x2cf5('0x2c')](_0x2cf5('0x6d'));return _0x106e70(new Error(_0x2cf5('0x6d')));}var _0x1e461a=fs[_0x2cf5('0x6e')](path[_0x2cf5('0x4c')](_0x35c96f,_0x3787f5[0x0]));if(_0x1e461a[_0x2cf5('0x6f')]()){removeReferences(_0x344657,_0x35c96f);logger[_0x2cf5('0x2c')](_0x2cf5('0x6d'));return _0x106e70(new Error(_0x2cf5('0x6d')));}if(_0x1e461a[_0x2cf5('0x70')]()){var _0xb7c531=fs[_0x2cf5('0x6c')](path[_0x2cf5('0x4c')](_0x35c96f,_0x3787f5[0x0]));if(_0xb7c531[_0x2cf5('0x39')]===0x0){removeReferences(_0x344657,_0x35c96f);logger[_0x2cf5('0x2c')](_0x2cf5('0x6d'));return _0x106e70(new Error(_0x2cf5('0x6d')));}var _0x2ec2f1=_0xb7c531[_0x2cf5('0x71')](function(_0x473f1f){return _0x473f1f===_0x2cf5('0x72');});if(!_0x2ec2f1){return _0x106e70(new Error(_0x2cf5('0x73')));}var _0x2a5fc5=fs[_0x2cf5('0x74')](path[_0x2cf5('0x4c')](_0x35c96f,_0x3787f5[0x0],'manifest.json'));var _0x413466=JSON['parse'](_0x2a5fc5);if(_0x2cf5('0x75')==typeof _0x413466['name']){return _0x106e70(new Error(_0x2cf5('0x76')));}if(_0x2cf5('0x75')==typeof _0x413466[_0x2cf5('0x77')]){return _0x106e70(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x2cf5('0x75')==typeof _0x413466[_0x2cf5('0x78')]){return _0x106e70(new Error(_0x2cf5('0x79')));}if(_0x2cf5('0x75')==typeof _0x413466[_0x2cf5('0x7a')]){return _0x106e70(new Error(_0x2cf5('0x7b')));}if(_0x413466[_0x2cf5('0x77')]===_0x2cf5('0x7c')){if(_0x2cf5('0x75')==typeof _0x413466[_0x2cf5('0x7a')][_0x2cf5('0x7d')]){return _0x106e70(new Error(_0x2cf5('0x7e')));}if(_0x2cf5('0x75')==typeof _0x413466[_0x2cf5('0x7a')]['views'][_0x2cf5('0x7f')]&&_0x2cf5('0x75')==typeof _0x413466['parameters'][_0x2cf5('0x7d')][_0x2cf5('0x80')]){return _0x106e70(new Error(_0x2cf5('0x81')));}}else if(_0x413466[_0x2cf5('0x77')]===_0x2cf5('0x82')){if('undefined'==typeof _0x413466[_0x2cf5('0x7a')][_0x2cf5('0x83')]){return _0x106e70(new Error(_0x2cf5('0x84')));}if('undefined'==typeof _0x413466[_0x2cf5('0x7a')][_0x2cf5('0x85')]){return _0x106e70(new Error(_0x2cf5('0x86')));}}else{return _0x106e70(new Error(_0x2cf5('0x87')));}var _0x16e53b=_0x413466['name'];var _0x31ac0b=_0x413466[_0x2cf5('0x88')];var _0x1cea12=_0x413466[_0x2cf5('0x77')];var _0x42d6ce=_0x413466[_0x2cf5('0x89')]?_0x413466[_0x2cf5('0x89')]:_0x2cf5('0x8a');var _0x1c19a0=_0x413466[_0x2cf5('0x8b')]?_0x413466[_0x2cf5('0x8b')]:_0x2cf5('0x8c');var _0x1f9dca='';var _0x3f3ed6='';var _0x5c7d2f='';var _0x331ac6='';var _0x2ab170=_0x413466[_0x2cf5('0x78')];if(_0x1cea12===_0x2cf5('0x7c')){if(_0x2cf5('0x75')!=typeof _0x413466[_0x2cf5('0x7a')][_0x2cf5('0x7d')][_0x2cf5('0x7f')]){var _0x54d6e8=_0x413466[_0x2cf5('0x7a')][_0x2cf5('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x54d6e8)){_0x1f9dca=path[_0x2cf5('0x4c')](_0x2cf5('0x8d'),_0x46b1bc,_0x3787f5[0x0],_0x54d6e8);}else{_0x1f9dca=_0x54d6e8;}}else{logger['info'](_0x2cf5('0x8e'));}if('undefined'!=typeof _0x413466[_0x2cf5('0x7a')][_0x2cf5('0x7d')]['agent']){var _0x497ff8=_0x413466[_0x2cf5('0x7a')][_0x2cf5('0x7d')][_0x2cf5('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x2cf5('0x8f')](_0x497ff8)){_0x3f3ed6=path['join']('plugins',_0x46b1bc,_0x3787f5[0x0],_0x497ff8);}else{_0x3f3ed6=_0x497ff8;}}else{logger[_0x2cf5('0x64')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x1cea12==='script'){_0x5c7d2f=_0x413466[_0x2cf5('0x7a')][_0x2cf5('0x83')];_0x331ac6=_0x413466['parameters']['scriptPath'];if(_0x2cf5('0x75')!=typeof _0x413466['parameters'][_0x2cf5('0x7d')]){if('undefined'!=typeof _0x413466[_0x2cf5('0x7a')][_0x2cf5('0x7d')][_0x2cf5('0x7f')]){var _0x54d6e8=_0x413466[_0x2cf5('0x7a')][_0x2cf5('0x7d')][_0x2cf5('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x2cf5('0x8f')](_0x54d6e8)){_0x1f9dca=path['join'](_0x2cf5('0x8d'),_0x46b1bc,_0x3787f5[0x0],_0x54d6e8);}else{_0x1f9dca=_0x54d6e8;}}if(_0x2cf5('0x75')!=typeof _0x413466['parameters'][_0x2cf5('0x7d')][_0x2cf5('0x80')]){var _0x497ff8=_0x413466[_0x2cf5('0x7a')][_0x2cf5('0x7d')][_0x2cf5('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x2cf5('0x8f')](_0x497ff8)){_0x3f3ed6=path[_0x2cf5('0x4c')](_0x2cf5('0x8d'),_0x46b1bc,_0x3787f5[0x0],_0x497ff8);}else{_0x3f3ed6=_0x497ff8;}}}}var _0x30cacd={'name':_0x16e53b,'description':_0x31ac0b,'path':path[_0x2cf5('0x4c')](_0x46b1bc,_0x3787f5[0x0]),'type':_0x1cea12,'sidebar':_0x42d6ce,'icon':_0x1c19a0,'adminUrl':_0x1f9dca,'agentUrl':_0x3f3ed6,'scriptName':_0x5c7d2f,'scriptPath':_0x331ac6,'version':_0x2ab170};removeReferences(_0x344657,null);return db['Plugin']['create'](_0x30cacd)[_0x2cf5('0x28')](function(_0x5228e7){var _0x33531f={'role':_0x57b9d0[_0x2cf5('0x90')]['role'],'userProfileId':_0x57b9d0[_0x2cf5('0x90')][_0x2cf5('0x91')]};if(!_0x33531f)throw new Error(_0x2cf5('0x92'));if(_0x33531f[_0x2cf5('0x93')]===_0x2cf5('0x94')){var _0xd951a6=_0x5228e7[_0x2cf5('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x2cf5('0x4a')]({'where':{'name':_0x2cf5('0x2a'),'userProfileId':_0x33531f[_0x2cf5('0x91')]},'raw':!![]})['then'](function(_0x20f0f3){if(_0x20f0f3&&_0x20f0f3['autoAssociation']===0x0){return db[_0x2cf5('0x2b')][_0x2cf5('0x95')]({'name':_0xd951a6['name'],'resourceId':_0xd951a6['id'],'type':_0x20f0f3[_0x2cf5('0x2d')],'sectionId':_0x20f0f3['id']},{})[_0x2cf5('0x28')](function(){return _0x5228e7;});}else{return _0x5228e7;}})[_0x2cf5('0x46')](function(_0x202e55){logger[_0x2cf5('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x202e55);throw _0x202e55;});}return _0x5228e7;})[_0x2cf5('0x28')](respondWithResult(_0x44255f,null))[_0x2cf5('0x46')](handleError(_0x44255f,null));}});}catch(_0x5ee138){_0x44255f[_0x2cf5('0x1e')](0x1f4)[_0x2cf5('0x2e')](_0x5ee138);}};function removeReferences(_0x9289bd,_0x185be0){try{if(_0x9289bd){fs['unlinkSync'](_0x9289bd);logger[_0x2cf5('0x64')](_0x2cf5('0x96'));}if(_0x185be0){rimraf(_0x185be0,function(){});logger[_0x2cf5('0x64')]('Extracted\x20folder\x20removed');}}catch(_0x149f5a){logger['error'](_0x149f5a);}}exports[_0x2cf5('0x26')]=function(_0x29c945,_0x56d9fc,_0x2d8266){return db[_0x2cf5('0x30')][_0x2cf5('0x4a')]({'where':{'id':_0x29c945[_0x2cf5('0x48')]['id']}})[_0x2cf5('0x28')](handleEntityNotFound(_0x56d9fc,null))[_0x2cf5('0x28')](saveUpdates(_0x29c945['body'],null))['then'](respondWithResult(_0x56d9fc,null))[_0x2cf5('0x46')](handleError(_0x56d9fc,null));};exports[_0x2cf5('0x97')]=function(_0x5b180b,_0x12ef6e,_0x58c321){return db['Plugin'][_0x2cf5('0x4a')]({'where':{'id':_0x5b180b['params']['id']}})['then'](function(_0x5a47cd){if(_0x5a47cd){return _0x5a47cd[_0x2cf5('0x27')]();}})[_0x2cf5('0x28')](function(_0x5d1d49){rimraf(path[_0x2cf5('0x4c')](config[_0x2cf5('0x4d')],_0x2cf5('0x4e'),path[_0x2cf5('0x5c')](_0x5d1d49[_0x2cf5('0x7')])),function(){});return _0x5d1d49;})['then'](handleEntityNotFound(_0x12ef6e,null))[_0x2cf5('0x28')](respondWithStatusCode(_0x12ef6e,null))['catch'](handleError(_0x12ef6e,null));};exports[_0x2cf5('0x98')]=function(_0x2c903f,_0x461d7d,_0x507a6e){return BPromise[_0x2cf5('0x99')]()[_0x2cf5('0x28')](function(){if(!_0x2c903f[_0x2cf5('0x34')][_0x2cf5('0x7')]){throw new Error(_0x2cf5('0x9a'));}if(!_0x2c903f['query'][_0x2cf5('0x9b')]){throw new Error(_0x2cf5('0x9c'));}var _0x4b868d=_0x2c903f['query']['hostname']?_0x2c903f['query'][_0x2cf5('0x9d')]+':'+_0x2c903f[_0x2cf5('0x34')][_0x2cf5('0x9b')]:'http://localhost:'+_0x2c903f[_0x2cf5('0x34')][_0x2cf5('0x9b')];var _0x451fda=_0x2c903f[_0x2cf5('0x34')][_0x2cf5('0x20')]?_0x2c903f[_0x2cf5('0x34')][_0x2cf5('0x20')]:!![];var _0x1d36fd=_0x2c903f[_0x2cf5('0x34')][_0x2cf5('0x9e')]?_0x2c903f[_0x2cf5('0x34')][_0x2cf5('0x9e')]:null;var _0x11702d={'method':_0x2c903f['method'],'uri':util['format']('%s%s',_0x4b868d,_0x2c903f[_0x2cf5('0x34')][_0x2cf5('0x7')]),'json':_0x451fda,'resolveWithFullResponse':!![],'encoding':_0x1d36fd,'qs':_0x2c903f[_0x2cf5('0x34')]};if(_0x2c903f[_0x2cf5('0x9f')]){_0x11702d[_0x2cf5('0x9f')]=_0x2c903f[_0x2cf5('0x9f')];if(_0x11702d[_0x2cf5('0x9f')]['content-length']){delete _0x11702d[_0x2cf5('0x9f')][_0x2cf5('0xa0')];}}if(_0x11702d[_0x2cf5('0x9f')][_0x2cf5('0xa1')]){delete _0x11702d[_0x2cf5('0x9f')][_0x2cf5('0xa1')];}return rp(_0x11702d);})[_0x2cf5('0x28')](function(_0x3b6078){if(_0x3b6078){_0x461d7d[_0x2cf5('0xa2')](_0x3b6078[_0x2cf5('0x9f')]);logger['info'](_0x3b6078['body']);if(_[_0x2cf5('0xa3')](_0x2c903f[_0x2cf5('0x34')][_0x2cf5('0x7')],'download')&&_0x3b6078[_0x2cf5('0xa4')]==0x1f4){return _0x461d7d['sendStatus'](_0x3b6078['statusCode']);}else{return _0x461d7d[_0x2cf5('0x1e')](_0x3b6078['statusCode'])[_0x2cf5('0x2e')](_0x3b6078[_0x2cf5('0x90')]);}}else{return _0x461d7d[_0x2cf5('0x1d')](0xc8);}})[_0x2cf5('0x46')](handleError(_0x461d7d,null));};exports[_0x2cf5('0xa5')]=function(_0x268eaa,_0x463417,_0x138dc6){return BPromise[_0x2cf5('0x99')]()['then'](function(){if(!_0x268eaa[_0x2cf5('0x34')][_0x2cf5('0x7')]){throw new Error(_0x2cf5('0x9a'));}if(!_0x268eaa[_0x2cf5('0x34')][_0x2cf5('0x9b')]){throw new Error(_0x2cf5('0x9c'));}var _0x4fd2ef=_0x268eaa[_0x2cf5('0x34')][_0x2cf5('0x9d')]?_0x268eaa[_0x2cf5('0x34')]['hostname']+':'+_0x268eaa[_0x2cf5('0x34')]['port']:_0x2cf5('0xa6')+_0x268eaa[_0x2cf5('0x34')][_0x2cf5('0x9b')];var _0x5b822d=_0x268eaa['query'][_0x2cf5('0x20')]?_0x268eaa[_0x2cf5('0x34')]['json']:!![];var _0x49361e=_0x268eaa[_0x2cf5('0x34')][_0x2cf5('0x9e')]?_0x268eaa[_0x2cf5('0x34')][_0x2cf5('0x9e')]:null;var _0x25160e={'method':_0x268eaa[_0x2cf5('0xa7')],'uri':util[_0x2cf5('0x4f')](_0x2cf5('0xa8'),_0x4fd2ef,_0x268eaa['query']['path']),'json':_0x5b822d,'resolveWithFullResponse':!![],'encoding':_0x49361e,'body':_0x268eaa[_0x2cf5('0x90')]};if(_0x268eaa[_0x2cf5('0x9f')]){_0x25160e['headers']=_0x268eaa[_0x2cf5('0x9f')];if(_0x25160e[_0x2cf5('0x9f')][_0x2cf5('0xa0')]){delete _0x25160e[_0x2cf5('0x9f')][_0x2cf5('0xa0')];}}if(_0x25160e[_0x2cf5('0x9f')][_0x2cf5('0xa1')]){delete _0x25160e[_0x2cf5('0x9f')][_0x2cf5('0xa1')];}return rp(_0x25160e);})[_0x2cf5('0x28')](function(_0x70b490){if(_0x70b490){_0x463417[_0x2cf5('0xa2')](_0x70b490[_0x2cf5('0x9f')]);logger[_0x2cf5('0x64')](_0x70b490['body']);return _0x463417[_0x2cf5('0x1e')](_0x70b490[_0x2cf5('0xa4')])[_0x2cf5('0x2e')](_0x70b490[_0x2cf5('0x90')]);}else{return _0x463417[_0x2cf5('0x1d')](0xc8);}})[_0x2cf5('0x46')](handleError(_0x463417,null));}; \ No newline at end of file +var _0xe54c=['error','name','send','Plugin','rawAttributes','model','keys','query','fields','attributes','length','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','catch','show','filters','intersection','find','download','params','path','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','isFile','isDirectory','readdirSync','some','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','undefined','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','method','set','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','sendStatus','status','count','offset','limit','Content-Range','json','apply','reject','update','then','Plugins','UserProfileResource','destroy','end'];(function(_0x1c9fba,_0x52db43){var _0x27687e=function(_0x368af0){while(--_0x368af0){_0x1c9fba['push'](_0x1c9fba['shift']());}};_0x27687e(++_0x52db43);}(_0xe54c,0x79));var _0xce54=function(_0x1d94b7,_0x5988e5){_0x1d94b7=_0x1d94b7-0x0;var _0x40a258=_0xe54c[_0x1d94b7];return _0x40a258;};'use strict';var pdf=require(_0xce54('0x0'));var emlformat=require(_0xce54('0x1'));var rimraf=require(_0xce54('0x2'));var zipdir=require(_0xce54('0x3'));var jsonpatch=require(_0xce54('0x4'));var rp=require(_0xce54('0x5'));var moment=require(_0xce54('0x6'));var BPromise=require(_0xce54('0x7'));var Mustache=require('mustache');var util=require(_0xce54('0x8'));var path=require('path');var sox=require(_0xce54('0x9'));var csv=require(_0xce54('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xce54('0xb'));var squel=require('squel');var crypto=require(_0xce54('0xc'));var jsforce=require(_0xce54('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xce54('0xa'));var querystring=require(_0xce54('0xe'));var Papa=require(_0xce54('0xf'));var extract=require(_0xce54('0x10'));var rimraf=require(_0xce54('0x2'));var archiver=require(_0xce54('0x11'));var Redis=require(_0xce54('0x12'));var authService=require(_0xce54('0x13'));var qs=require(_0xce54('0x14'));var hardwareService=require(_0xce54('0x15'));var logger=require(_0xce54('0x16'))(_0xce54('0x17'));var utils=require(_0xce54('0x18'));var config=require(_0xce54('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xce54('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xce54('0x1b'))(new Redis(config[_0xce54('0x1a')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x355e0f,_0x14befa){_0x14befa=_0x14befa||0xcc;return function(_0x14b863){if(_0x14b863){return _0x355e0f[_0xce54('0x1c')](_0x14befa);}return _0x355e0f[_0xce54('0x1d')](_0x14befa)['end']();};}function respondWithResult(_0x4fafc0,_0x3eee0d){_0x3eee0d=_0x3eee0d||0xc8;return function(_0x2a86b6){if(_0x2a86b6){return _0x4fafc0[_0xce54('0x1d')](_0x3eee0d)['json'](_0x2a86b6);}};}function respondWithFilteredResult(_0x305b2c,_0x4a670a){return function(_0x340e8e){if(_0x340e8e){var _0x523dc3=_0x340e8e[_0xce54('0x1e')],_0x79c355=_0x4a670a[_0xce54('0x1f')],_0x514739=_0x4a670a[_0xce54('0x1f')]+_0x4a670a[_0xce54('0x20')],_0x3c4e94;if(_0x514739>=_0x523dc3){_0x514739=_0x523dc3;_0x3c4e94=0xc8;}else{_0x3c4e94=0xce;}_0x305b2c['status'](_0x3c4e94);return _0x305b2c['set'](_0xce54('0x21'),_0x79c355+'-'+_0x514739+'/'+_0x523dc3)[_0xce54('0x22')](_0x340e8e);}return null;};}function patchUpdates(_0x217877){return function(_0x42b4c1){try{jsonpatch[_0xce54('0x23')](_0x42b4c1,_0x217877,!![]);}catch(_0x23caa8){return BPromise[_0xce54('0x24')](_0x23caa8);}return _0x42b4c1['save']();};}function saveUpdates(_0x5f46de,_0x2ffca8){return function(_0x58ee98){if(_0x58ee98){return _0x58ee98[_0xce54('0x25')](_0x5f46de)[_0xce54('0x26')](function(_0x3a96e6){return _0x3a96e6;});}return null;};}function removeEntity(_0xdde13e,_0x2057fa){return function(_0x2d83be){if(_0x2d83be){return _0x2d83be['destroy']()[_0xce54('0x26')](function(){var _0x12622e=_0x2d83be['get']({'plain':!![]});var _0x38cf3b=_0xce54('0x27');return db[_0xce54('0x28')][_0xce54('0x29')]({'where':{'type':_0x38cf3b,'resourceId':_0x12622e['id']}})[_0xce54('0x26')](function(){return _0x2d83be;});})[_0xce54('0x26')](function(){_0xdde13e['status'](0xcc)[_0xce54('0x2a')]();});}};}function handleEntityNotFound(_0x5e200f,_0x585ef3){return function(_0x1461c7){if(!_0x1461c7){_0x5e200f[_0xce54('0x1c')](0x194);}return _0x1461c7;};}function handleError(_0x2c7a7e,_0x4b94ca){_0x4b94ca=_0x4b94ca||0x1f4;return function(_0x2cd689){logger[_0xce54('0x2b')](_0x2cd689['stack']);if(_0x2cd689['name']){delete _0x2cd689[_0xce54('0x2c')];}_0x2c7a7e[_0xce54('0x1d')](_0x4b94ca)[_0xce54('0x2d')](_0x2cd689);};}exports['index']=function(_0xe660d2,_0x27a65e){var _0x3cbdab={},_0x14b534={},_0x42b272={'count':0x0,'rows':[]};var _0x1b9e07=db[_0xce54('0x2e')][_0xce54('0x2f')];_0x14b534[_0xce54('0x30')]=_[_0xce54('0x31')](_0x1b9e07);_0x14b534[_0xce54('0x32')]=_[_0xce54('0x31')](_0xe660d2['query']);_0x14b534['filters']=_['intersection'](_0x14b534[_0xce54('0x30')],_0x14b534[_0xce54('0x32')]);_0x3cbdab['attributes']=_['intersection'](_0x14b534[_0xce54('0x30')],qs[_0xce54('0x33')](_0xe660d2[_0xce54('0x32')][_0xce54('0x33')]));_0x3cbdab[_0xce54('0x34')]=_0x3cbdab[_0xce54('0x34')][_0xce54('0x35')]?_0x3cbdab[_0xce54('0x34')]:_0x14b534[_0xce54('0x30')];if(!_0xe660d2[_0xce54('0x32')]['hasOwnProperty']('nolimit')){_0x3cbdab['limit']=qs['limit'](_0xe660d2[_0xce54('0x32')][_0xce54('0x20')]);_0x3cbdab[_0xce54('0x1f')]=qs[_0xce54('0x1f')](_0xe660d2['query'][_0xce54('0x1f')]);}_0x3cbdab['order']=qs[_0xce54('0x36')](_0xe660d2[_0xce54('0x32')][_0xce54('0x36')]);_0x3cbdab['where']=qs['filters'](_[_0xce54('0x37')](_0xe660d2['query'],_0x14b534['filters']));if(_0xe660d2[_0xce54('0x32')][_0xce54('0x38')]){_0x3cbdab[_0xce54('0x39')]=_[_0xce54('0x3a')](_0x3cbdab[_0xce54('0x39')],{'$or':_[_0xce54('0x3b')](_0x1b9e07,function(_0x2fd684){if(_0x2fd684[_0xce54('0x3c')][_0xce54('0x3d')]!==_0xce54('0x3e')){var _0x188682={};_0x188682[_0x2fd684[_0xce54('0x3f')]]={'$like':'%'+_0xe660d2[_0xce54('0x32')][_0xce54('0x38')]+'%'};return _0x188682;}})});}_0x3cbdab=_[_0xce54('0x3a')]({},_0x3cbdab,_0xe660d2[_0xce54('0x40')]);var _0x48fb87={'where':_0x3cbdab[_0xce54('0x39')]};return db['Plugin']['count'](_0x48fb87)['then'](function(_0x3ad5e9){_0x42b272['count']=_0x3ad5e9;if(_0xe660d2['query'][_0xce54('0x41')]){_0x3cbdab[_0xce54('0x42')]=[{'all':!![]}];}return db[_0xce54('0x2e')]['findAll'](_0x3cbdab);})[_0xce54('0x26')](function(_0x11e240){_0x42b272['rows']=_0x11e240;return _0x42b272;})[_0xce54('0x26')](respondWithFilteredResult(_0x27a65e,_0x3cbdab))[_0xce54('0x43')](handleError(_0x27a65e,null));};exports[_0xce54('0x44')]=function(_0x1c9722,_0x53910f){var _0x413473={'raw':!![],'where':{'id':_0x1c9722['params']['id']}},_0x5a40be={};_0x5a40be[_0xce54('0x30')]=_[_0xce54('0x31')](db['Plugin']['rawAttributes']);_0x5a40be['query']=_[_0xce54('0x31')](_0x1c9722[_0xce54('0x32')]);_0x5a40be[_0xce54('0x45')]=_[_0xce54('0x46')](_0x5a40be[_0xce54('0x30')],_0x5a40be[_0xce54('0x32')]);_0x413473[_0xce54('0x34')]=_[_0xce54('0x46')](_0x5a40be[_0xce54('0x30')],qs[_0xce54('0x33')](_0x1c9722[_0xce54('0x32')][_0xce54('0x33')]));_0x413473['attributes']=_0x413473[_0xce54('0x34')][_0xce54('0x35')]?_0x413473[_0xce54('0x34')]:_0x5a40be['model'];if(_0x1c9722[_0xce54('0x32')][_0xce54('0x41')]){_0x413473[_0xce54('0x42')]=[{'all':!![]}];}_0x413473=_[_0xce54('0x3a')]({},_0x413473,_0x1c9722[_0xce54('0x40')]);return db[_0xce54('0x2e')][_0xce54('0x47')](_0x413473)[_0xce54('0x26')](handleEntityNotFound(_0x53910f,null))[_0xce54('0x26')](respondWithResult(_0x53910f,null))[_0xce54('0x43')](handleError(_0x53910f,null));};exports[_0xce54('0x48')]=function(_0x405b3f,_0x51814c,_0x4ec949){return db['Plugin']['find']({'where':{'id':_0x405b3f[_0xce54('0x49')]['id']},'attributes':[_0xce54('0x2c'),_0xce54('0x4a')],'raw':!![]})[_0xce54('0x26')](handleEntityNotFound(_0x51814c,null))[_0xce54('0x26')](function(_0x1a4bce){if(_0x1a4bce){var _0x4f5967=path[_0xce54('0x4b')](config[_0xce54('0x4c')],_0xce54('0x4d'),util[_0xce54('0x4e')](_0xce54('0x4f'),path[_0xce54('0x50')](_0x1a4bce['path'])));var _0x51cc34=fs[_0xce54('0x51')](_0x4f5967);var _0x354325=archiver('zip',{'zlib':{'level':0x9}});_0x354325['on'](_0xce54('0x52'),function(_0x53d950){if(_0x53d950[_0xce54('0x53')]===_0xce54('0x54')){logger[_0xce54('0x2b')](_0x53d950);}else{throw new db['Sequelize'][(_0xce54('0x55'))](_0xce54('0x56'));}});_0x354325['on'](_0xce54('0x2b'),function(_0x13f78b){throw new db[(_0xce54('0x57'))][(_0xce54('0x55'))](_0xce54('0x56'));});_0x354325['pipe'](_0x51cc34);_0x354325[_0xce54('0x58')](_0xce54('0x59'),{'cwd':path[_0xce54('0x4b')](config[_0xce54('0x4c')],_0xce54('0x4d'),path[_0xce54('0x5a')](_0x1a4bce['path'])),'ignore':[path[_0xce54('0x4b')](path[_0xce54('0x50')](_0x1a4bce['path']),_0xce54('0x5b')),path[_0xce54('0x4b')](path[_0xce54('0x50')](_0x1a4bce[_0xce54('0x4a')]),_0xce54('0x5c'))],'nodir':!![]})[_0xce54('0x5d')]();_0x51cc34['on'](_0xce54('0x5e'),function(){if(!fs['existsSync'](_0x4f5967)){throw new db[(_0xce54('0x57'))][(_0xce54('0x55'))](_0xce54('0x5f'));}return _0x51814c['download'](_0x4f5967,util['format'](_0xce54('0x4f'),path['basename'](_0x1a4bce[_0xce54('0x4a')])),function(_0x1950bc){if(_0x1950bc){throw new db[(_0xce54('0x57'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xce54('0x60')](_0x4f5967);logger[_0xce54('0x61')](_0xce54('0x62'));logger[_0xce54('0x61')](_0xce54('0x63'));});});}return null;})[_0xce54('0x43')](handleError(_0x51814c,null));};exports[_0xce54('0x64')]=function(_0x50db00,_0x17ccb1,_0x1cf25b){var _0x39d42f=path[_0xce54('0x50')](_0x50db00['file']['filename'],path['extname'](_0x50db00[_0xce54('0x65')][_0xce54('0x66')]));var _0x42fb15=path[_0xce54('0x4b')](config[_0xce54('0x4c')],'server/files/plugins',_0x50db00['file'][_0xce54('0x66')]);var _0x4e099b=path[_0xce54('0x4b')](config[_0xce54('0x4c')],_0xce54('0x4d'),_0x39d42f);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x42fb15);logger[_0xce54('0x61')](_0xce54('0x67'),_0x4e099b);try{fs[_0xce54('0x68')](_0x42fb15,parseInt(_0xce54('0x69'),0x8));extract(_0x42fb15,{'dir':_0x4e099b},function(_0x51a685){if(_0x51a685){logger['error'](_0x51a685);handleError(_0x51a685,!![]);};var _0x34361a=fs['readdirSync'](_0x4e099b);if(_0x34361a[_0xce54('0x35')]>0x1){removeReferences(_0x42fb15,_0x4e099b);logger[_0xce54('0x2b')](_0xce54('0x6a'));return _0x1cf25b(new Error(_0xce54('0x6a')));}var _0x2d888e=fs['lstatSync'](path[_0xce54('0x4b')](_0x4e099b,_0x34361a[0x0]));if(_0x2d888e[_0xce54('0x6b')]()){removeReferences(_0x42fb15,_0x4e099b);logger['error'](_0xce54('0x6a'));return _0x1cf25b(new Error(_0xce54('0x6a')));}if(_0x2d888e[_0xce54('0x6c')]()){var _0xd495a9=fs[_0xce54('0x6d')](path[_0xce54('0x4b')](_0x4e099b,_0x34361a[0x0]));if(_0xd495a9[_0xce54('0x35')]===0x0){removeReferences(_0x42fb15,_0x4e099b);logger[_0xce54('0x2b')](_0xce54('0x6a'));return _0x1cf25b(new Error(_0xce54('0x6a')));}var _0x20d33f=_0xd495a9[_0xce54('0x6e')](function(_0x3cc676){return _0x3cc676==='manifest.json';});if(!_0x20d33f){return _0x1cf25b(new Error(_0xce54('0x6f')));}var _0x1741e8=fs[_0xce54('0x70')](path['join'](_0x4e099b,_0x34361a[0x0],'manifest.json'));var _0x3bf603=JSON[_0xce54('0x71')](_0x1741e8);if('undefined'==typeof _0x3bf603[_0xce54('0x2c')]){return _0x1cf25b(new Error(_0xce54('0x72')));}if(_0xce54('0x73')==typeof _0x3bf603['type']){return _0x1cf25b(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x3bf603[_0xce54('0x74')]){return _0x1cf25b(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xce54('0x73')==typeof _0x3bf603[_0xce54('0x75')]){return _0x1cf25b(new Error(_0xce54('0x76')));}if(_0x3bf603[_0xce54('0x3c')]===_0xce54('0x77')){if(_0xce54('0x73')==typeof _0x3bf603[_0xce54('0x75')][_0xce54('0x78')]){return _0x1cf25b(new Error(_0xce54('0x79')));}if(_0xce54('0x73')==typeof _0x3bf603[_0xce54('0x75')][_0xce54('0x78')][_0xce54('0x7a')]&&'undefined'==typeof _0x3bf603['parameters']['views'][_0xce54('0x7b')]){return _0x1cf25b(new Error(_0xce54('0x7c')));}}else if(_0x3bf603[_0xce54('0x3c')]===_0xce54('0x7d')){if(_0xce54('0x73')==typeof _0x3bf603[_0xce54('0x75')][_0xce54('0x7e')]){return _0x1cf25b(new Error(_0xce54('0x7f')));}if(_0xce54('0x73')==typeof _0x3bf603[_0xce54('0x75')][_0xce54('0x80')]){return _0x1cf25b(new Error(_0xce54('0x81')));}}else{return _0x1cf25b(new Error(_0xce54('0x82')));}var _0x308077=_0x3bf603['name'];var _0x1dd073=_0x3bf603[_0xce54('0x83')];var _0x574945=_0x3bf603['type'];var _0x441b9f=_0x3bf603[_0xce54('0x84')]?_0x3bf603[_0xce54('0x84')]:_0xce54('0x85');var _0x3e218a=_0x3bf603['icon']?_0x3bf603['icon']:'icon-apps';var _0x45f06c='';var _0x39eb9a='';var _0x33227b='';var _0x1c41e4='';var _0x2beaef=_0x3bf603[_0xce54('0x74')];if(_0x574945===_0xce54('0x77')){if(_0xce54('0x73')!=typeof _0x3bf603[_0xce54('0x75')]['views'][_0xce54('0x7a')]){var _0x58129a=_0x3bf603['parameters'][_0xce54('0x78')][_0xce54('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xce54('0x86')](_0x58129a)){_0x45f06c=path[_0xce54('0x4b')](_0xce54('0x87'),_0x39d42f,_0x34361a[0x0],_0x58129a);}else{_0x45f06c=_0x58129a;}}else{logger[_0xce54('0x61')](_0xce54('0x88'));}if(_0xce54('0x73')!=typeof _0x3bf603[_0xce54('0x75')][_0xce54('0x78')][_0xce54('0x7b')]){var _0x252244=_0x3bf603[_0xce54('0x75')][_0xce54('0x78')][_0xce54('0x7b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x252244)){_0x39eb9a=path[_0xce54('0x4b')]('plugins',_0x39d42f,_0x34361a[0x0],_0x252244);}else{_0x39eb9a=_0x252244;}}else{logger[_0xce54('0x61')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x574945===_0xce54('0x7d')){_0x33227b=_0x3bf603['parameters'][_0xce54('0x7e')];_0x1c41e4=_0x3bf603['parameters'][_0xce54('0x80')];if(_0xce54('0x73')!=typeof _0x3bf603[_0xce54('0x75')][_0xce54('0x78')]){if(_0xce54('0x73')!=typeof _0x3bf603[_0xce54('0x75')][_0xce54('0x78')][_0xce54('0x7a')]){var _0x58129a=_0x3bf603[_0xce54('0x75')][_0xce54('0x78')][_0xce54('0x7a')];if(!/^(f|ht)tps?:\/\//i['test'](_0x58129a)){_0x45f06c=path['join']('plugins',_0x39d42f,_0x34361a[0x0],_0x58129a);}else{_0x45f06c=_0x58129a;}}if(_0xce54('0x73')!=typeof _0x3bf603[_0xce54('0x75')][_0xce54('0x78')][_0xce54('0x7b')]){var _0x252244=_0x3bf603['parameters']['views'][_0xce54('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xce54('0x86')](_0x252244)){_0x39eb9a=path[_0xce54('0x4b')](_0xce54('0x87'),_0x39d42f,_0x34361a[0x0],_0x252244);}else{_0x39eb9a=_0x252244;}}}}var _0x25f453={'name':_0x308077,'description':_0x1dd073,'path':path[_0xce54('0x4b')](_0x39d42f,_0x34361a[0x0]),'type':_0x574945,'sidebar':_0x441b9f,'icon':_0x3e218a,'adminUrl':_0x45f06c,'agentUrl':_0x39eb9a,'scriptName':_0x33227b,'scriptPath':_0x1c41e4,'version':_0x2beaef};removeReferences(_0x42fb15,null);return db[_0xce54('0x2e')][_0xce54('0x89')](_0x25f453)['then'](function(_0x1df373){var _0x5f2713={'role':_0x50db00[_0xce54('0x8a')][_0xce54('0x8b')],'userProfileId':_0x50db00['body'][_0xce54('0x8c')]};if(!_0x5f2713)throw new Error(_0xce54('0x8d'));if(_0x5f2713[_0xce54('0x8b')]===_0xce54('0x8e')){var _0x3b3253=_0x1df373[_0xce54('0x8f')]({'plain':!![]});return db['UserProfileSection'][_0xce54('0x47')]({'where':{'name':_0xce54('0x27'),'userProfileId':_0x5f2713[_0xce54('0x8c')]},'raw':!![]})['then'](function(_0x1a3a1f){if(_0x1a3a1f&&_0x1a3a1f[_0xce54('0x90')]===0x0){return db[_0xce54('0x28')]['create']({'name':_0x3b3253['name'],'resourceId':_0x3b3253['id'],'type':_0x1a3a1f[_0xce54('0x2c')],'sectionId':_0x1a3a1f['id']},{})[_0xce54('0x26')](function(){return _0x1df373;});}else{return _0x1df373;}})[_0xce54('0x43')](function(_0x159606){logger[_0xce54('0x2b')](_0xce54('0x91'),_0x159606);throw _0x159606;});}return _0x1df373;})[_0xce54('0x26')](respondWithResult(_0x17ccb1,null))[_0xce54('0x43')](handleError(_0x17ccb1,null));}});}catch(_0x4bcab2){_0x17ccb1['status'](0x1f4)['send'](_0x4bcab2);}};function removeReferences(_0x9869,_0xa13e0c){try{if(_0x9869){fs[_0xce54('0x60')](_0x9869);logger[_0xce54('0x61')]('Zip\x20archive\x20removed');}if(_0xa13e0c){rimraf(_0xa13e0c,function(){});logger[_0xce54('0x61')]('Extracted\x20folder\x20removed');}}catch(_0x1fee19){logger[_0xce54('0x2b')](_0x1fee19);}}exports[_0xce54('0x25')]=function(_0x514238,_0x3a54c3,_0x4fcc53){return db['Plugin']['find']({'where':{'id':_0x514238[_0xce54('0x49')]['id']}})[_0xce54('0x26')](handleEntityNotFound(_0x3a54c3,null))['then'](saveUpdates(_0x514238[_0xce54('0x8a')],null))[_0xce54('0x26')](respondWithResult(_0x3a54c3,null))[_0xce54('0x43')](handleError(_0x3a54c3,null));};exports[_0xce54('0x92')]=function(_0x3b0e8b,_0x3a62bc,_0x30668b){return db[_0xce54('0x2e')][_0xce54('0x47')]({'where':{'id':_0x3b0e8b[_0xce54('0x49')]['id']}})[_0xce54('0x26')](function(_0x4f7e83){if(_0x4f7e83){return _0x4f7e83[_0xce54('0x29')]();}})[_0xce54('0x26')](function(_0x5f19f9){rimraf(path[_0xce54('0x4b')](config[_0xce54('0x4c')],'server/files/plugins',path[_0xce54('0x5a')](_0x5f19f9[_0xce54('0x4a')])),function(){});return _0x5f19f9;})['then'](handleEntityNotFound(_0x3a62bc,null))[_0xce54('0x26')](respondWithStatusCode(_0x3a62bc,null))[_0xce54('0x43')](handleError(_0x3a62bc,null));};exports[_0xce54('0x93')]=function(_0x350010,_0x2bea25,_0x491491){return BPromise['resolve']()['then'](function(){if(!_0x350010[_0xce54('0x32')][_0xce54('0x4a')]){throw new Error(_0xce54('0x94'));}if(!_0x350010[_0xce54('0x32')][_0xce54('0x95')]){throw new Error(_0xce54('0x96'));}var _0x2a6604=_0x350010[_0xce54('0x32')]['hostname']?_0x350010[_0xce54('0x32')][_0xce54('0x97')]+':'+_0x350010['query'][_0xce54('0x95')]:_0xce54('0x98')+_0x350010[_0xce54('0x32')]['port'];var _0xbcb0fd=_0x350010[_0xce54('0x32')][_0xce54('0x22')]?_0x350010[_0xce54('0x32')][_0xce54('0x22')]:!![];var _0x48b65a=_0x350010[_0xce54('0x32')][_0xce54('0x99')]?_0x350010['query'][_0xce54('0x99')]:null;var _0x53245c={'method':_0x350010['method'],'uri':util[_0xce54('0x4e')](_0xce54('0x9a'),_0x2a6604,_0x350010[_0xce54('0x32')][_0xce54('0x4a')]),'json':_0xbcb0fd,'resolveWithFullResponse':!![],'encoding':_0x48b65a,'qs':_0x350010[_0xce54('0x32')]};if(_0x350010[_0xce54('0x9b')]){_0x53245c['headers']=_0x350010[_0xce54('0x9b')];if(_0x53245c[_0xce54('0x9b')][_0xce54('0x9c')]){delete _0x53245c[_0xce54('0x9b')][_0xce54('0x9c')];}}if(_0x53245c[_0xce54('0x9b')][_0xce54('0x9d')]){delete _0x53245c['headers'][_0xce54('0x9d')];}return rp(_0x53245c);})[_0xce54('0x26')](function(_0x594e05){if(_0x594e05){_0x2bea25['set'](_0x594e05[_0xce54('0x9b')]);logger[_0xce54('0x61')](_0x594e05['body']);if(_[_0xce54('0x9e')](_0x350010[_0xce54('0x32')][_0xce54('0x4a')],_0xce54('0x48'))&&_0x594e05['statusCode']==0x1f4){return _0x2bea25[_0xce54('0x1c')](_0x594e05[_0xce54('0x9f')]);}else{return _0x2bea25['status'](_0x594e05[_0xce54('0x9f')])[_0xce54('0x2d')](_0x594e05['body']);}}else{return _0x2bea25[_0xce54('0x1c')](0xc8);}})['catch'](handleError(_0x2bea25,null));};exports[_0xce54('0xa0')]=function(_0x127cf5,_0x43e5aa,_0x5d1da3){return BPromise[_0xce54('0xa1')]()[_0xce54('0x26')](function(){if(!_0x127cf5['query'][_0xce54('0x4a')]){throw new Error(_0xce54('0x94'));}if(!_0x127cf5['query']['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x43a2f1=_0x127cf5['query'][_0xce54('0x97')]?_0x127cf5[_0xce54('0x32')]['hostname']+':'+_0x127cf5[_0xce54('0x32')][_0xce54('0x95')]:_0xce54('0x98')+_0x127cf5[_0xce54('0x32')]['port'];var _0x4a3c9c=_0x127cf5['query'][_0xce54('0x22')]?_0x127cf5[_0xce54('0x32')][_0xce54('0x22')]:!![];var _0xd16a72=_0x127cf5[_0xce54('0x32')]['encoding']?_0x127cf5[_0xce54('0x32')]['encoding']:null;var _0x5b36fa={'method':_0x127cf5[_0xce54('0xa2')],'uri':util[_0xce54('0x4e')](_0xce54('0x9a'),_0x43a2f1,_0x127cf5['query'][_0xce54('0x4a')]),'json':_0x4a3c9c,'resolveWithFullResponse':!![],'encoding':_0xd16a72,'body':_0x127cf5[_0xce54('0x8a')]};if(_0x127cf5[_0xce54('0x9b')]){_0x5b36fa[_0xce54('0x9b')]=_0x127cf5[_0xce54('0x9b')];if(_0x5b36fa['headers']['content-length']){delete _0x5b36fa[_0xce54('0x9b')][_0xce54('0x9c')];}}if(_0x5b36fa[_0xce54('0x9b')][_0xce54('0x9d')]){delete _0x5b36fa[_0xce54('0x9b')][_0xce54('0x9d')];}return rp(_0x5b36fa);})[_0xce54('0x26')](function(_0x46b2bc){if(_0x46b2bc){_0x43e5aa[_0xce54('0xa3')](_0x46b2bc[_0xce54('0x9b')]);logger[_0xce54('0x61')](_0x46b2bc[_0xce54('0x8a')]);return _0x43e5aa['status'](_0x46b2bc[_0xce54('0x9f')])[_0xce54('0x2d')](_0x46b2bc[_0xce54('0x8a')]);}else{return _0x43e5aa[_0xce54('0x1c')](0xc8);}})['catch'](handleError(_0x43e5aa,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 9013482..7871d9c 100644 --- a/server/api/plugin/plugin.events.js +++ b/server/api/plugin/plugin.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4137=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0x4137,0xf8));var _0x7413=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4137[_0x1cc8fe];return _0x230054;};'use strict';var EventEmitter=require(_0x7413('0x0'));var Plugin=require(_0x7413('0x1'))['db'][_0x7413('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x7413('0x3')](0x0);var events={'afterCreate':_0x7413('0x4'),'afterUpdate':_0x7413('0x5'),'afterDestroy':_0x7413('0x6')};function emitEvent(_0x299eea){return function(_0x258255,_0x3dc48a,_0x451a96){PluginEvents[_0x7413('0x7')](_0x299eea+':'+_0x258255['id'],_0x258255);PluginEvents['emit'](_0x299eea,_0x258255);_0x451a96(null);};}for(var e in events){if(events[_0x7413('0x8')](e)){var event=events[e];Plugin[_0x7413('0x9')](e,emitEvent(event));}}module[_0x7413('0xa')]=PluginEvents; \ No newline at end of file +var _0xd4a2=['setMaxListeners','update','emit','hasOwnProperty','exports','events'];(function(_0x3cb57d,_0x5ac0a7){var _0x1d0176=function(_0x1fa63b){while(--_0x1fa63b){_0x3cb57d['push'](_0x3cb57d['shift']());}};_0x1d0176(++_0x5ac0a7);}(_0xd4a2,0x173));var _0x2d4a=function(_0x587dc2,_0xfae13b){_0x587dc2=_0x587dc2-0x0;var _0x1aaf13=_0xd4a2[_0x587dc2];return _0x1aaf13;};'use strict';var EventEmitter=require(_0x2d4a('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x2d4a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2d4a('0x2'),'afterDestroy':'remove'};function emitEvent(_0x24810d){return function(_0x5d435a,_0x32af9e,_0x40d744){PluginEvents[_0x2d4a('0x3')](_0x24810d+':'+_0x5d435a['id'],_0x5d435a);PluginEvents[_0x2d4a('0x3')](_0x24810d,_0x5d435a);_0x40d744(null);};}for(var e in events){if(events[_0x2d4a('0x4')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x2d4a('0x5')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 8a14a72..ce835af 100644 --- a/server/api/plugin/plugin.model.js +++ b/server/api/plugin/plugin.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0x7217,0x19e));var _0x7721=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x7217[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x038b=['plugins','util','../../config/logger','api','bluebird','path','rimraf','./plugin.attributes','exports','define','Plugin'];(function(_0x3d0f4f,_0x2e0e42){var _0x479820=function(_0x49b789){while(--_0x49b789){_0x3d0f4f['push'](_0x3d0f4f['shift']());}};_0x479820(++_0x2e0e42);}(_0x038b,0x114));var _0xb038=function(_0x12bb47,_0x1852f0){_0x12bb47=_0x12bb47-0x0;var _0xc1c8dc=_0x038b[_0x12bb47];return _0xc1c8dc;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 448479f..a9c1e80 100644 --- a/server/api/plugin/plugin.rpc.js +++ b/server/api/plugin/plugin.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa73a=['debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Plugin,\x20%s,\x20%s','Plugin','create','body','options','CreatePlugin','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent'];(function(_0x4a08dc,_0x1157b1){var _0x37cc84=function(_0x43f0fb){while(--_0x43f0fb){_0x4a08dc['push'](_0x4a08dc['shift']());}};_0x37cc84(++_0x1157b1);}(_0xa73a,0xa9));var _0xaa73=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0xa73a[_0x354164];return _0x5db9a8;};'use strict';var _=require(_0xaa73('0x0'));var util=require('util');var moment=require(_0xaa73('0x1'));var BPromise=require(_0xaa73('0x2'));var rs=require(_0xaa73('0x3'));var fs=require('fs');var Redis=require(_0xaa73('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaa73('0x5'))(_0xaa73('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaa73('0x7')]['http']({'port':0x232a});config['redis']=_[_0xaa73('0x8')](config['redis'],{'host':_0xaa73('0x9'),'port':0x18eb});var socket=require(_0xaa73('0xa'))(new Redis(config['redis']));require(_0xaa73('0xb'))[_0xaa73('0xc')](socket);function respondWithRpcPromise(_0x112ca7,_0x2a922a,_0x3bcb3d){return new BPromise(function(_0x5bd30c,_0x1bf033){return client[_0xaa73('0xd')](_0x112ca7,_0x3bcb3d)[_0xaa73('0xe')](function(_0x7fa4c){logger[_0xaa73('0xf')]('Plugin,\x20%s,\x20%s',_0x2a922a,_0xaa73('0x10'));logger[_0xaa73('0x11')](_0xaa73('0x12'),_0x2a922a,_0xaa73('0x10'),JSON[_0xaa73('0x13')](_0x7fa4c));if(_0x7fa4c['error']){if(_0x7fa4c[_0xaa73('0x14')][_0xaa73('0x15')]===0x1f4){logger[_0xaa73('0x14')]('Plugin,\x20%s,\x20%s',_0x2a922a,_0x7fa4c[_0xaa73('0x14')][_0xaa73('0x16')]);return _0x1bf033(_0x7fa4c[_0xaa73('0x14')][_0xaa73('0x16')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x2a922a,_0x7fa4c[_0xaa73('0x14')][_0xaa73('0x16')]);return _0x5bd30c(_0x7fa4c[_0xaa73('0x14')]['message']);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x2a922a,_0xaa73('0x10'));_0x5bd30c(_0x7fa4c[_0xaa73('0x17')][_0xaa73('0x16')]);}})[_0xaa73('0x18')](function(_0x758aa0){logger[_0xaa73('0x14')](_0xaa73('0x19'),_0x2a922a,_0x758aa0);_0x1bf033(_0x758aa0);});});}exports['CreatePlugin']=function(_0x5ef4b9){var _0x504ffc=this;return new Promise(function(_0x8dbe48,_0x121c75){return db[_0xaa73('0x1a')][_0xaa73('0x1b')](_0x5ef4b9[_0xaa73('0x1c')],{'raw':_0x5ef4b9[_0xaa73('0x1d')]?_0x5ef4b9[_0xaa73('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xaa73('0xe')](function(_0x337768){logger['info'](_0xaa73('0x1e'),_0x5ef4b9);logger[_0xaa73('0x11')](_0xaa73('0x1e'),_0x5ef4b9,JSON['stringify'](_0x337768));_0x8dbe48(_0x337768);})[_0xaa73('0x18')](function(_0x12fb7a){logger[_0xaa73('0x14')](_0xaa73('0x1e'),_0x12fb7a['message'],_0x5ef4b9);_0x121c75(_0x504ffc[_0xaa73('0x14')](0x1f4,_0x12fb7a[_0xaa73('0x16')]));});});}; \ No newline at end of file +var _0x3070=['info','result','catch','CreatePlugin','Plugin','create','body','options','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message'];(function(_0x2fda50,_0x42ae90){var _0x4169f6=function(_0x490f0b){while(--_0x490f0b){_0x2fda50['push'](_0x2fda50['shift']());}};_0x4169f6(++_0x42ae90);}(_0x3070,0x19b));var _0x0307=function(_0xbae34d,_0x4d3ee0){_0xbae34d=_0xbae34d-0x0;var _0x1df6ce=_0x3070[_0xbae34d];return _0x1df6ce;};'use strict';var _=require('lodash');var util=require(_0x0307('0x0'));var moment=require('moment');var BPromise=require(_0x0307('0x1'));var rs=require(_0x0307('0x2'));var fs=require('fs');var Redis=require(_0x0307('0x3'));var db=require(_0x0307('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0307('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0307('0x6')]['http']({'port':0x232a});config['redis']=_[_0x0307('0x7')](config[_0x0307('0x8')],{'host':_0x0307('0x9'),'port':0x18eb});var socket=require(_0x0307('0xa'))(new Redis(config[_0x0307('0x8')]));require(_0x0307('0xb'))[_0x0307('0xc')](socket);function respondWithRpcPromise(_0x545b9f,_0x2529ff,_0x39ffec){return new BPromise(function(_0x2b3427,_0x485e5e){return client[_0x0307('0xd')](_0x545b9f,_0x39ffec)[_0x0307('0xe')](function(_0x3f417f){logger['info']('Plugin,\x20%s,\x20%s',_0x2529ff,_0x0307('0xf'));logger[_0x0307('0x10')](_0x0307('0x11'),_0x2529ff,'request\x20sent',JSON[_0x0307('0x12')](_0x3f417f));if(_0x3f417f[_0x0307('0x13')]){if(_0x3f417f[_0x0307('0x13')][_0x0307('0x14')]===0x1f4){logger[_0x0307('0x13')](_0x0307('0x15'),_0x2529ff,_0x3f417f['error']['message']);return _0x485e5e(_0x3f417f[_0x0307('0x13')][_0x0307('0x16')]);}logger[_0x0307('0x13')](_0x0307('0x15'),_0x2529ff,_0x3f417f[_0x0307('0x13')]['message']);return _0x2b3427(_0x3f417f[_0x0307('0x13')][_0x0307('0x16')]);}else{logger[_0x0307('0x17')](_0x0307('0x15'),_0x2529ff,_0x0307('0xf'));_0x2b3427(_0x3f417f[_0x0307('0x18')][_0x0307('0x16')]);}})[_0x0307('0x19')](function(_0x287805){logger[_0x0307('0x13')]('Plugin,\x20%s,\x20%s',_0x2529ff,_0x287805);_0x485e5e(_0x287805);});});}exports[_0x0307('0x1a')]=function(_0x21237e){var _0x1c5941=this;return new Promise(function(_0x2a8689,_0x3c24fd){return db[_0x0307('0x1b')][_0x0307('0x1c')](_0x21237e[_0x0307('0x1d')],{'raw':_0x21237e[_0x0307('0x1e')]?_0x21237e[_0x0307('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x0307('0xe')](function(_0x1d40e8){logger['info'](_0x0307('0x1a'),_0x21237e);logger[_0x0307('0x10')]('CreatePlugin',_0x21237e,JSON[_0x0307('0x12')](_0x1d40e8));_0x2a8689(_0x1d40e8);})[_0x0307('0x19')](function(_0x6a9bd9){logger['error'](_0x0307('0x1a'),_0x6a9bd9['message'],_0x21237e);_0x3c24fd(_0x1c5941[_0x0307('0x13')](0x1f4,_0x6a9bd9[_0x0307('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 76635b5..a1a3870 100644 --- a/server/api/plugin/plugin.socket.js +++ b/server/api/plugin/plugin.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e3b=['register','length','./plugin.events','save','remove','update','removeListener'];(function(_0x263f9d,_0x3d854e){var _0x4c4efa=function(_0x48d506){while(--_0x48d506){_0x263f9d['push'](_0x263f9d['shift']());}};_0x4c4efa(++_0x3d854e);}(_0x5e3b,0x79));var _0xb5e3=function(_0x1b7801,_0x143390){_0x1b7801=_0x1b7801-0x0;var _0x555c71=_0x5e3b[_0x1b7801];return _0x555c71;};'use strict';var PluginEvents=require(_0xb5e3('0x0'));var events=[_0xb5e3('0x1'),_0xb5e3('0x2'),_0xb5e3('0x3')];function createListener(_0x516404,_0x54bd18){return function(_0x3efa9b){_0x54bd18['emit'](_0x516404,_0x3efa9b);};}function removeListener(_0x5e7e20,_0x1bd83d){return function(){PluginEvents[_0xb5e3('0x4')](_0x5e7e20,_0x1bd83d);};}exports[_0xb5e3('0x5')]=function(_0x663665){for(var _0x400973=0x0,_0x38a218=events[_0xb5e3('0x6')];_0x400973<_0x38a218;_0x400973++){var _0x3a33ee=events[_0x400973];var _0xb36ef3=createListener('plugin:'+_0x3a33ee,_0x663665);PluginEvents['on'](_0x3a33ee,_0xb36ef3);}}; \ No newline at end of file +var _0xd28c=['register','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x35b5ba,_0x31350a){var _0x477c16=function(_0x519842){while(--_0x519842){_0x35b5ba['push'](_0x35b5ba['shift']());}};_0x477c16(++_0x31350a);}(_0xd28c,0x1c9));var _0xcd28=function(_0x207cf8,_0x20c223){_0x207cf8=_0x207cf8-0x0;var _0x2d24fb=_0xd28c[_0x207cf8];return _0x2d24fb;};'use strict';var PluginEvents=require(_0xcd28('0x0'));var events=[_0xcd28('0x1'),_0xcd28('0x2'),_0xcd28('0x3')];function createListener(_0x5f1228,_0x24b8b5){return function(_0x2310ad){_0x24b8b5[_0xcd28('0x4')](_0x5f1228,_0x2310ad);};}function removeListener(_0x2b6c82,_0x234f09){return function(){PluginEvents['removeListener'](_0x2b6c82,_0x234f09);};}exports[_0xcd28('0x5')]=function(_0x21d563){for(var _0x3523f3=0x0,_0x559104=events['length'];_0x3523f3<_0x559104;_0x3523f3++){var _0xe46543=events[_0x3523f3];var _0x35c145=createListener(_0xcd28('0x6')+_0xe46543,_0x21d563);PluginEvents['on'](_0xe46543,_0x35c145);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 3b03191..4f966a4 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf97=['../../components/auth/service','./pm2.controller','get','isAuthenticated','index','/:id','put','update','delete','destroy','express','Router'];(function(_0x34572d,_0x13c189){var _0x168a7c=function(_0x1d93ac){while(--_0x1d93ac){_0x34572d['push'](_0x34572d['shift']());}};_0x168a7c(++_0x13c189);}(_0xaf97,0x166));var _0x7af9=function(_0x514cd5,_0x5a1ddd){_0x514cd5=_0x514cd5-0x0;var _0x28df30=_0xaf97[_0x514cd5];return _0x28df30;};'use strict';var express=require(_0x7af9('0x0'));var router=express[_0x7af9('0x1')]();var auth=require(_0x7af9('0x2'));var controller=require(_0x7af9('0x3'));router[_0x7af9('0x4')]('/',auth[_0x7af9('0x5')](),controller[_0x7af9('0x6')]);router[_0x7af9('0x4')](_0x7af9('0x7'),auth[_0x7af9('0x5')](),controller['show']);router['post']('/',auth[_0x7af9('0x5')](),controller['create']);router[_0x7af9('0x8')](_0x7af9('0x7'),auth['isAuthenticated'](),controller[_0x7af9('0x9')]);router[_0x7af9('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7af9('0xb')]);module['exports']=router; \ No newline at end of file +var _0x9ce8=['create','put','update','delete','destroy','express','Router','get','/:id','isAuthenticated','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ce8,0xd6));var _0x89ce=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x9ce8[_0x5b78e8];return _0xf2c321;};'use strict';var express=require(_0x89ce('0x0'));var router=express[_0x89ce('0x1')]();var auth=require('../../components/auth/service');var controller=require('./pm2.controller');router[_0x89ce('0x2')]('/',auth['isAuthenticated'](),controller['index']);router[_0x89ce('0x2')](_0x89ce('0x3'),auth[_0x89ce('0x4')](),controller['show']);router[_0x89ce('0x5')]('/',auth['isAuthenticated'](),controller[_0x89ce('0x6')]);router[_0x89ce('0x7')](_0x89ce('0x3'),auth[_0x89ce('0x4')](),controller[_0x89ce('0x8')]);router[_0x89ce('0x9')]('/:id',auth[_0x89ce('0x4')](),controller[_0x89ce('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index a3dd533..3f804e8 100644 --- a/server/api/pm2/pm2.controller.js +++ b/server/api/pm2/pm2.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c90=['catch','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','error','stack','name','send','info','list','then','reject','express','motion2','length','show','params','script','../../files/plugins','body','cwd','chdir','start','dump','update'];(function(_0x1f1825,_0x2c6acd){var _0x48ace8=function(_0x5c29b0){while(--_0x5c29b0){_0x1f1825['push'](_0x1f1825['shift']());}};_0x48ace8(++_0x2c6acd);}(_0x3c90,0xf9));var _0x03c9=function(_0xa4587f,_0x2227f9){_0xa4587f=_0xa4587f-0x0;var _0x375fd3=_0x3c90[_0xa4587f];return _0x375fd3;};'use strict';var _=require(_0x03c9('0x0'));var pm2=require(_0x03c9('0x1'));var logger=require(_0x03c9('0x2'))(_0x03c9('0x3'));var path=require(_0x03c9('0x4'));var exec=require(_0x03c9('0x5'))[_0x03c9('0x6')];var BPromise=require(_0x03c9('0x7'));function handleEntityNotFound(_0x1bbb6b,_0x45c1be){return function(_0x4034b5){if(!_0x4034b5){_0x1bbb6b[_0x03c9('0x8')](0x194);;}return _0x4034b5;};}function respondWithResult(_0x3ef93f,_0xe28b94){_0xe28b94=_0xe28b94||0xc8;return function(_0x2feaa9){if(_0x2feaa9){return _0x3ef93f[_0x03c9('0x9')](_0xe28b94)['json'](_0x2feaa9);}return null;};}function handleError(_0xd6531d,_0x3ce3bf){_0x3ce3bf=_0x3ce3bf||0x1f4;return function(_0x466a17){logger[_0x03c9('0xa')](_0x466a17[_0x03c9('0xb')]);if(_0x466a17[_0x03c9('0xc')]){delete _0x466a17[_0x03c9('0xc')];}_0xd6531d[_0x03c9('0x9')](_0x3ce3bf)[_0x03c9('0xd')](_0x466a17);};}function execChildProcess(){return new BPromise(function(_0x58c94d,_0x48e4e7){exec('npm\x20install',function(_0x4a9f14,_0x7fb0a5,_0xdafb08){logger['info'](_0x7fb0a5);logger[_0x03c9('0xe')](_0xdafb08);if(_0x4a9f14){logger[_0x03c9('0xa')](_0x4a9f14);return _0x48e4e7(_0x4a9f14);}return _0x58c94d(_0x7fb0a5);});});}exports['index']=function(_0x5b693f,_0x3139ca){return pm2[_0x03c9('0xf')]()[_0x03c9('0x10')](function(_0x2175e0){if(_0x2175e0){var _0x3c4f1d=_[_0x03c9('0x11')](_0x2175e0,function(_0x391fd0){return _0x391fd0[_0x03c9('0xc')]===_0x03c9('0x12')||_0x391fd0['name']===_0x03c9('0x13');});return{'rows':_0x3c4f1d,'count':_0x3c4f1d[_0x03c9('0x14')]};}return null;})[_0x03c9('0x10')](respondWithResult(_0x3139ca,null))['catch'](handleError(_0x3139ca,null));};exports[_0x03c9('0x15')]=function(_0x217b21,_0x34270d){return pm2['describe'](_0x217b21[_0x03c9('0x16')]['id'])[_0x03c9('0x10')](respondWithResult(_0x34270d,null))[_0x03c9('0x10')](handleEntityNotFound(_0x34270d,null))['catch'](handleError(_0x34270d,null));};exports['create']=function(_0x265c98,_0x266c9b){if(_0x265c98['body'][_0x03c9('0xc')]&&_0x265c98['body'][_0x03c9('0x17')]){var _0x27c9c6=path['join'](__dirname,_0x03c9('0x18'),_0x265c98[_0x03c9('0x19')][_0x03c9('0x17')]);var _0x566b22=process[_0x03c9('0x1a')]();process['chdir'](path['dirname'](_0x27c9c6));return execChildProcess()['then'](function(_0x2a282e){process[_0x03c9('0x1b')](_0x566b22);return pm2[_0x03c9('0x1c')]({'name':_0x265c98[_0x03c9('0x19')]['name'],'script':_0x27c9c6});})['then'](function(_0x148e44){pm2[_0x03c9('0x1d')]();return _0x148e44[0x0];})['then'](respondWithResult(_0x266c9b,0xc9))['catch'](handleError(_0x266c9b,null));}else{return _0x266c9b['status'](0x1f4)[_0x03c9('0xd')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x03c9('0x1e')]=function(_0x3830a5,_0x1d394e){if(_0x3830a5[_0x03c9('0x19')]['id']){delete _0x3830a5['body']['id'];}var _0x49503b={'online':'restart','stopped':'stop'};if(_0x49503b['hasOwnProperty'](_0x3830a5[_0x03c9('0x19')][_0x03c9('0x9')])){return pm2[_0x49503b[_0x3830a5[_0x03c9('0x19')][_0x03c9('0x9')]]](_0x3830a5[_0x03c9('0x16')]['id'])[_0x03c9('0x10')](respondWithResult(_0x1d394e,0xc8))[_0x03c9('0x1f')](handleError(_0x1d394e,null));}else{return _0x1d394e[_0x03c9('0x9')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0x03c9('0x20')]=function(_0x558dae,_0x56948f){if(_0x558dae[_0x03c9('0x19')]['id']){delete _0x558dae['body']['id'];}if(_0x558dae[_0x03c9('0x16')]['id']){return pm2[_0x03c9('0x21')](_0x558dae[_0x03c9('0x16')]['id'])['then'](function(_0x3231fb){pm2[_0x03c9('0x1d')]();return _0x3231fb[0x0];})[_0x03c9('0x10')](respondWithResult(_0x56948f,null))[_0x03c9('0x1f')](handleError(_0x56948f,null));}else{return _0x56948f['status'](0x1f4)[_0x03c9('0xd')]({'message':_0x03c9('0x22')});}}; \ No newline at end of file +var _0x0246=['body','script','join','../../files/plugins','cwd','chdir','dirname','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','status','Unknown\x20status','delete','dump','lodash','path','child_process','bluebird','json','name','send','info','error','index','reject','motion2','length','then','catch','show','describe','params','create'];(function(_0x4f253c,_0x23d530){var _0x2ccbea=function(_0x449309){while(--_0x449309){_0x4f253c['push'](_0x4f253c['shift']());}};_0x2ccbea(++_0x23d530);}(_0x0246,0x14b));var _0x6024=function(_0x522d4f,_0x29c22d){_0x522d4f=_0x522d4f-0x0;var _0x35fa94=_0x0246[_0x522d4f];return _0x35fa94;};'use strict';var _=require(_0x6024('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')('api');var path=require(_0x6024('0x1'));var exec=require(_0x6024('0x2'))['exec'];var BPromise=require(_0x6024('0x3'));function handleEntityNotFound(_0x29e409,_0x1cd236){return function(_0x5e2a58){if(!_0x5e2a58){_0x29e409['sendStatus'](0x194);;}return _0x5e2a58;};}function respondWithResult(_0x344cb4,_0x3d7580){_0x3d7580=_0x3d7580||0xc8;return function(_0x3fde8){if(_0x3fde8){return _0x344cb4['status'](_0x3d7580)[_0x6024('0x4')](_0x3fde8);}return null;};}function handleError(_0x29cb18,_0x47f512){_0x47f512=_0x47f512||0x1f4;return function(_0x249934){logger['error'](_0x249934['stack']);if(_0x249934[_0x6024('0x5')]){delete _0x249934['name'];}_0x29cb18['status'](_0x47f512)[_0x6024('0x6')](_0x249934);};}function execChildProcess(){return new BPromise(function(_0x37d17b,_0x5bd767){exec('npm\x20install',function(_0x12c22b,_0xc1364,_0x2623b2){logger[_0x6024('0x7')](_0xc1364);logger[_0x6024('0x7')](_0x2623b2);if(_0x12c22b){logger[_0x6024('0x8')](_0x12c22b);return _0x5bd767(_0x12c22b);}return _0x37d17b(_0xc1364);});});}exports[_0x6024('0x9')]=function(_0xc7b1c6,_0x327e7e){return pm2['list']()['then'](function(_0x2e7c06){if(_0x2e7c06){var _0x182230=_[_0x6024('0xa')](_0x2e7c06,function(_0x53f881){return _0x53f881[_0x6024('0x5')]==='express'||_0x53f881[_0x6024('0x5')]===_0x6024('0xb');});return{'rows':_0x182230,'count':_0x182230[_0x6024('0xc')]};}return null;})[_0x6024('0xd')](respondWithResult(_0x327e7e,null))[_0x6024('0xe')](handleError(_0x327e7e,null));};exports[_0x6024('0xf')]=function(_0x39d6e5,_0x225bd4){return pm2[_0x6024('0x10')](_0x39d6e5[_0x6024('0x11')]['id'])[_0x6024('0xd')](respondWithResult(_0x225bd4,null))['then'](handleEntityNotFound(_0x225bd4,null))['catch'](handleError(_0x225bd4,null));};exports[_0x6024('0x12')]=function(_0x58e5ad,_0x1707d1){if(_0x58e5ad[_0x6024('0x13')]['name']&&_0x58e5ad[_0x6024('0x13')][_0x6024('0x14')]){var _0x2caa1d=path[_0x6024('0x15')](__dirname,_0x6024('0x16'),_0x58e5ad[_0x6024('0x13')]['script']);var _0x301a5b=process[_0x6024('0x17')]();process[_0x6024('0x18')](path[_0x6024('0x19')](_0x2caa1d));return execChildProcess()['then'](function(_0x4f6fa8){process[_0x6024('0x18')](_0x301a5b);return pm2['start']({'name':_0x58e5ad[_0x6024('0x13')]['name'],'script':_0x2caa1d});})[_0x6024('0xd')](function(_0x46cbb6){pm2['dump']();return _0x46cbb6[0x0];})[_0x6024('0xd')](respondWithResult(_0x1707d1,0xc9))['catch'](handleError(_0x1707d1,null));}else{return _0x1707d1['status'](0x1f4)['send']({'message':_0x6024('0x1a')});}};exports[_0x6024('0x1b')]=function(_0xf83353,_0x2ec795){if(_0xf83353[_0x6024('0x13')]['id']){delete _0xf83353['body']['id'];}var _0x16a64e={'online':_0x6024('0x1c'),'stopped':_0x6024('0x1d')};if(_0x16a64e[_0x6024('0x1e')](_0xf83353[_0x6024('0x13')][_0x6024('0x1f')])){return pm2[_0x16a64e[_0xf83353['body']['status']]](_0xf83353['params']['id'])[_0x6024('0xd')](respondWithResult(_0x2ec795,0xc8))[_0x6024('0xe')](handleError(_0x2ec795,null));}else{return _0x2ec795[_0x6024('0x1f')](0x1f4)[_0x6024('0x6')]({'message':_0x6024('0x20')});}};exports['destroy']=function(_0x110f24,_0x326cca){if(_0x110f24['body']['id']){delete _0x110f24[_0x6024('0x13')]['id'];}if(_0x110f24[_0x6024('0x11')]['id']){return pm2[_0x6024('0x21')](_0x110f24[_0x6024('0x11')]['id'])[_0x6024('0xd')](function(_0x36d605){pm2[_0x6024('0x22')]();return _0x36d605[0x0];})[_0x6024('0xd')](respondWithResult(_0x326cca,null))['catch'](handleError(_0x326cca,null));}else{return _0x326cca[_0x6024('0x1f')](0x1f4)[_0x6024('0x6')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 65dda89..60e5898 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff0f=['connect-timeout','express','Router','../../config/environment','exports','multer','util','path'];(function(_0x25929a,_0xab64f1){var _0x3e5948=function(_0xf0f21f){while(--_0xf0f21f){_0x25929a['push'](_0x25929a['shift']());}};_0x3e5948(++_0xab64f1);}(_0xff0f,0x145));var _0xfff0=function(_0x1ccb71,_0x2dfb96){_0x1ccb71=_0x1ccb71-0x0;var _0x2c14b7=_0xff0f[_0x1ccb71];return _0x2c14b7;};'use strict';var multer=require(_0xfff0('0x0'));var util=require(_0xfff0('0x1'));var path=require(_0xfff0('0x2'));var timeout=require(_0xfff0('0x3'));var express=require(_0xfff0('0x4'));var router=express[_0xfff0('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfff0('0x6'));module[_0xfff0('0x7')]=router; \ No newline at end of file +var _0x9e0c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','util','path','connect-timeout','express'];(function(_0x3230ab,_0x46eac4){var _0x486975=function(_0x5b9129){while(--_0x5b9129){_0x3230ab['push'](_0x3230ab['shift']());}};_0x486975(++_0x46eac4);}(_0x9e0c,0xfc));var _0xc9e0=function(_0x75093a,_0x4909d2){_0x75093a=_0x75093a-0x0;var _0x56c84d=_0x9e0c[_0x75093a];return _0x56c84d;};'use strict';var multer=require('multer');var util=require(_0xc9e0('0x0'));var path=require(_0xc9e0('0x1'));var timeout=require(_0xc9e0('0x2'));var express=require(_0xc9e0('0x3'));var router=express[_0xc9e0('0x4')]();var auth=require(_0xc9e0('0x5'));var interaction=require(_0xc9e0('0x6'));var config=require(_0xc9e0('0x7'));module['exports']=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 753f0a6..02cf629 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.attributes.js +++ b/server/api/reportAgentPreview/reportAgentPreview.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc9cd=['STRING','DATE','INTEGER'];(function(_0x17c3f8,_0x26836c){var _0x48c4ec=function(_0x5eec37){while(--_0x5eec37){_0x17c3f8['push'](_0x17c3f8['shift']());}};_0x48c4ec(++_0x26836c);}(_0xc9cd,0x89));var _0xdc9c=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0xc9cd[_0x2c0be1];return _0x3d4bd2;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xdc9c('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xdc9c('0x1')]},'scheduledat':{'type':Sequelize[_0xdc9c('0x2')]},'uniqueid':{'type':Sequelize[_0xdc9c('0x1')]},'starttime':{'type':Sequelize[_0xdc9c('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xdc9c('0x1')]},'campaigntype':{'type':Sequelize[_0xdc9c('0x1')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf9c9=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x3ec6f1,_0x5e8d7b){var _0x424aa7=function(_0x5c9236){while(--_0x5c9236){_0x3ec6f1['push'](_0x3ec6f1['shift']());}};_0x424aa7(++_0x5e8d7b);}(_0xf9c9,0x1f3));var _0x9f9c=function(_0x536755,_0x3bfa50){_0x536755=_0x536755-0x0;var _0x2b9dde=_0xf9c9[_0x536755];return _0x2b9dde;};'use strict';var Sequelize=require(_0x9f9c('0x0'));module[_0x9f9c('0x1')]={'state':{'type':Sequelize[_0x9f9c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9f9c('0x3')]},'scheduledat':{'type':Sequelize[_0x9f9c('0x4')]},'uniqueid':{'type':Sequelize[_0x9f9c('0x3')]},'starttime':{'type':Sequelize[_0x9f9c('0x4')]},'responsetime':{'type':Sequelize[_0x9f9c('0x4')]},'ringtime':{'type':Sequelize[_0x9f9c('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x9f9c('0x3')]},'campaigntype':{'type':Sequelize[_0x9f9c('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 98cdfa0..358fb55 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.model.js +++ b/server/api/reportAgentPreview/reportAgentPreview.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e60=['request-promise','rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','moment'];(function(_0x1c0cb5,_0x3a26df){var _0x3020f0=function(_0x77358a){while(--_0x77358a){_0x1c0cb5['push'](_0x1c0cb5['shift']());}};_0x3020f0(++_0x3a26df);}(_0x5e60,0x1e7));var _0x05e6=function(_0x4f90ae,_0x40a212){_0x4f90ae=_0x4f90ae-0x0;var _0x23966a=_0x5e60[_0x4f90ae];return _0x23966a;};'use strict';var _=require(_0x05e6('0x0'));var util=require('util');var logger=require(_0x05e6('0x1'))('api');var moment=require(_0x05e6('0x2'));var BPromise=require('bluebird');var rp=require(_0x05e6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05e6('0x4'));var config=require('../../config/environment');var attributes=require(_0x05e6('0x5'));module[_0x05e6('0x6')]=function(_0x38706f,_0x5ebe14){return _0x38706f[_0x05e6('0x7')](_0x05e6('0x8'),attributes,{'tableName':_0x05e6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3397=['path','../../config/environment','exports','define','ReportAgentPreview','util','bluebird','request-promise'];(function(_0x5d391d,_0x54d49b){var _0x2ff71a=function(_0x7f0c2c){while(--_0x7f0c2c){_0x5d391d['push'](_0x5d391d['shift']());}};_0x2ff71a(++_0x54d49b);}(_0x3397,0xc5));var _0x7339=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0x3397[_0x506d83];return _0x335e8b;};'use strict';var _=require('lodash');var util=require(_0x7339('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7339('0x1'));var rp=require(_0x7339('0x2'));var fs=require('fs');var path=require(_0x7339('0x3'));var rimraf=require('rimraf');var config=require(_0x7339('0x4'));var attributes=require('./reportAgentPreview.attributes');module[_0x7339('0x5')]=function(_0x211423,_0x24a133){return _0x211423[_0x7339('0x6')](_0x7339('0x7'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 48048b4..f256652 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.rpc.js +++ b/server/api/reportAgentPreview/reportAgentPreview.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9eca=['debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview','body','options','CreateReportAgentPreview','catch','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x292dc5,_0x57a1e1){var _0x4cb70f=function(_0x1ea2cf){while(--_0x1ea2cf){_0x292dc5['push'](_0x292dc5['shift']());}};_0x4cb70f(++_0x57a1e1);}(_0x9eca,0x1e9));var _0xa9ec=function(_0x12f388,_0x5b54e5){_0x12f388=_0x12f388-0x0;var _0x398ad8=_0x9eca[_0x12f388];return _0x398ad8;};'use strict';var _=require(_0xa9ec('0x0'));var util=require(_0xa9ec('0x1'));var moment=require(_0xa9ec('0x2'));var BPromise=require(_0xa9ec('0x3'));var rs=require(_0xa9ec('0x4'));var fs=require('fs');var Redis=require(_0xa9ec('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9ec('0x6'));var logger=require(_0xa9ec('0x7'))(_0xa9ec('0x8'));var config=require(_0xa9ec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa9ec('0xa')][_0xa9ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x234a7c,_0xf6cf5f,_0x1beb5c){return new BPromise(function(_0x1e81d9,_0x1675df){return client[_0xa9ec('0xc')](_0x234a7c,_0x1beb5c)[_0xa9ec('0xd')](function(_0x1cd9b7){logger[_0xa9ec('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0xf6cf5f,'request\x20sent');logger[_0xa9ec('0xf')](_0xa9ec('0x10'),_0xf6cf5f,_0xa9ec('0x11'),JSON[_0xa9ec('0x12')](_0x1cd9b7));if(_0x1cd9b7[_0xa9ec('0x13')]){if(_0x1cd9b7[_0xa9ec('0x13')][_0xa9ec('0x14')]===0x1f4){logger[_0xa9ec('0x13')](_0xa9ec('0x15'),_0xf6cf5f,_0x1cd9b7[_0xa9ec('0x13')]['message']);return _0x1675df(_0x1cd9b7[_0xa9ec('0x13')]['message']);}logger[_0xa9ec('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0xf6cf5f,_0x1cd9b7[_0xa9ec('0x13')]['message']);return _0x1e81d9(_0x1cd9b7[_0xa9ec('0x13')]['message']);}else{logger[_0xa9ec('0xe')](_0xa9ec('0x15'),_0xf6cf5f,_0xa9ec('0x11'));_0x1e81d9(_0x1cd9b7['result']['message']);}})['catch'](function(_0x3c46e0){logger[_0xa9ec('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0xf6cf5f,_0x3c46e0);_0x1675df(_0x3c46e0);});});}exports['CreateReportAgentPreview']=function(_0x196d9a){var _0x244299=this;return new Promise(function(_0x13d671,_0x55af9f){return db[_0xa9ec('0x16')]['create'](_0x196d9a[_0xa9ec('0x17')],{'raw':_0x196d9a['options']?_0x196d9a[_0xa9ec('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xa9ec('0xd')](function(_0xeb6745){logger[_0xa9ec('0xe')](_0xa9ec('0x19'),_0x196d9a);logger[_0xa9ec('0xf')](_0xa9ec('0x19'),_0x196d9a,JSON[_0xa9ec('0x12')](_0xeb6745));_0x13d671(_0xeb6745);})[_0xa9ec('0x1a')](function(_0x1db7a4){logger['error'](_0xa9ec('0x19'),_0x1db7a4[_0xa9ec('0x1b')],_0x196d9a);_0x55af9f(_0x244299[_0xa9ec('0x13')](0x1f4,_0x1db7a4['message']));});});}; \ No newline at end of file +var _0xbfa9=['stringify','error','message','result','catch','ReportAgentPreview','create','options','raw','CreateReportAgentPreview','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s'];(function(_0x5a0c6e,_0x2ec3a5){var _0x26c757=function(_0x447b04){while(--_0x447b04){_0x5a0c6e['push'](_0x5a0c6e['shift']());}};_0x26c757(++_0x2ec3a5);}(_0xbfa9,0xea));var _0x9bfa=function(_0x285c85,_0x132c21){_0x285c85=_0x285c85-0x0;var _0x2f81cd=_0xbfa9[_0x285c85];return _0x2f81cd;};'use strict';var _=require(_0x9bfa('0x0'));var util=require('util');var moment=require(_0x9bfa('0x1'));var BPromise=require(_0x9bfa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bfa('0x3'));var db=require(_0x9bfa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9bfa('0x5'))(_0x9bfa('0x6'));var config=require(_0x9bfa('0x7'));var jayson=require(_0x9bfa('0x8'));var client=jayson[_0x9bfa('0x9')][_0x9bfa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b1e58,_0x39658c,_0x188f16){return new BPromise(function(_0x4eb932,_0x362d96){return client[_0x9bfa('0xb')](_0x2b1e58,_0x188f16)[_0x9bfa('0xc')](function(_0x2841b2){logger[_0x9bfa('0xd')](_0x9bfa('0xe'),_0x39658c,_0x9bfa('0xf'));logger[_0x9bfa('0x10')](_0x9bfa('0x11'),_0x39658c,'request\x20sent',JSON[_0x9bfa('0x12')](_0x2841b2));if(_0x2841b2[_0x9bfa('0x13')]){if(_0x2841b2[_0x9bfa('0x13')]['code']===0x1f4){logger[_0x9bfa('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x39658c,_0x2841b2[_0x9bfa('0x13')][_0x9bfa('0x14')]);return _0x362d96(_0x2841b2[_0x9bfa('0x13')][_0x9bfa('0x14')]);}logger[_0x9bfa('0x13')](_0x9bfa('0xe'),_0x39658c,_0x2841b2[_0x9bfa('0x13')][_0x9bfa('0x14')]);return _0x4eb932(_0x2841b2[_0x9bfa('0x13')][_0x9bfa('0x14')]);}else{logger['info'](_0x9bfa('0xe'),_0x39658c,_0x9bfa('0xf'));_0x4eb932(_0x2841b2[_0x9bfa('0x15')][_0x9bfa('0x14')]);}})[_0x9bfa('0x16')](function(_0x62975b){logger[_0x9bfa('0x13')](_0x9bfa('0xe'),_0x39658c,_0x62975b);_0x362d96(_0x62975b);});});}exports['CreateReportAgentPreview']=function(_0x4118e4){var _0x3a6fb5=this;return new Promise(function(_0x5193c9,_0x456f8f){return db[_0x9bfa('0x17')][_0x9bfa('0x18')](_0x4118e4['body'],{'raw':_0x4118e4[_0x9bfa('0x19')]?_0x4118e4[_0x9bfa('0x19')][_0x9bfa('0x1a')]===undefined?!![]:![]:!![]})[_0x9bfa('0xc')](function(_0x5996e6){logger[_0x9bfa('0xd')]('CreateReportAgentPreview',_0x4118e4);logger['debug'](_0x9bfa('0x1b'),_0x4118e4,JSON[_0x9bfa('0x12')](_0x5996e6));_0x5193c9(_0x5996e6);})[_0x9bfa('0x16')](function(_0x5a3f14){logger['error'](_0x9bfa('0x1b'),_0x5a3f14[_0x9bfa('0x14')],_0x4118e4);_0x456f8f(_0x3a6fb5[_0x9bfa('0x13')](0x1f4,_0x5a3f14['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 115223f..615ceee 100644 --- a/server/api/rpc/index.js +++ b/server/api/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ab2=['voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','get','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','outboundChannels','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','campaigns','/fax/accounts','faxAccounts','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','exports','multer','util','path','Router','../../components/auth/service','./rpc.controller','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor'];(function(_0x1763fb,_0x416d99){var _0x4ca7f8=function(_0x1ee513){while(--_0x1ee513){_0x1763fb['push'](_0x1763fb['shift']());}};_0x4ca7f8(++_0x416d99);}(_0x8ab2,0x89));var _0x28ab=function(_0x3d990c,_0x20c749){_0x3d990c=_0x3d990c-0x0;var _0xecbdc6=_0x8ab2[_0x3d990c];return _0xecbdc6;};'use strict';var multer=require(_0x28ab('0x0'));var util=require(_0x28ab('0x1'));var path=require(_0x28ab('0x2'));var express=require('express');var router=express[_0x28ab('0x3')]();var auth=require(_0x28ab('0x4'));var controller=require(_0x28ab('0x5'));router['get']('/voice/channels',auth[_0x28ab('0x6')](),controller[_0x28ab('0x7')]);router['get'](_0x28ab('0x8'),auth['isAuthenticated'](),controller[_0x28ab('0x9')]);router['get'](_0x28ab('0xa'),auth[_0x28ab('0x6')](),controller[_0x28ab('0xb')]);router[_0x28ab('0xc')]('/voice/queues',auth[_0x28ab('0x6')](),controller[_0x28ab('0xd')]);router['get'](_0x28ab('0xe'),auth[_0x28ab('0x6')](),controller[_0x28ab('0xf')]);router[_0x28ab('0xc')](_0x28ab('0x10'),auth[_0x28ab('0x6')](),controller[_0x28ab('0x11')]);router[_0x28ab('0xc')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x28ab('0x12')]);router[_0x28ab('0xc')]('/openchannel/queues',auth[_0x28ab('0x6')](),controller[_0x28ab('0x13')]);router['get'](_0x28ab('0x14'),auth['isAuthenticated'](),controller[_0x28ab('0x15')]);router['get'](_0x28ab('0x16'),auth['isAuthenticated'](),controller['faxQueues']);router[_0x28ab('0xc')](_0x28ab('0x17'),auth[_0x28ab('0x6')](),controller[_0x28ab('0x18')]);router['get'](_0x28ab('0x19'),auth[_0x28ab('0x6')](),controller['voiceQueuesChannels']);router[_0x28ab('0xc')](_0x28ab('0x1a'),auth['isAuthenticated'](),controller[_0x28ab('0x1b')]);router[_0x28ab('0xc')](_0x28ab('0x1c'),auth[_0x28ab('0x6')](),controller[_0x28ab('0x1d')]);router['get'](_0x28ab('0x1e'),auth[_0x28ab('0x6')](),controller['voiceQueuesChannelRedirect']);router[_0x28ab('0xc')](_0x28ab('0x1f'),auth[_0x28ab('0x6')](),controller[_0x28ab('0x20')]);router[_0x28ab('0xc')](_0x28ab('0x21'),auth[_0x28ab('0x6')](),controller[_0x28ab('0x22')]);router[_0x28ab('0xc')](_0x28ab('0x23'),auth['isAuthenticated'](),controller[_0x28ab('0x24')]);router['get']('/agents',auth[_0x28ab('0x6')](),controller[_0x28ab('0x25')]);router[_0x28ab('0x26')](_0x28ab('0x27'),auth['isAuthenticated'](),controller[_0x28ab('0x28')]);router[_0x28ab('0xc')](_0x28ab('0x29'),auth[_0x28ab('0x6')](),controller[_0x28ab('0x2a')]);router[_0x28ab('0xc')]('/trunks',auth['isAuthenticated'](),controller[_0x28ab('0x2b')]);router[_0x28ab('0xc')]('/campaigns',auth[_0x28ab('0x6')](),controller[_0x28ab('0x2c')]);router['get'](_0x28ab('0x2d'),auth[_0x28ab('0x6')](),controller[_0x28ab('0x2e')]);router['get']('/chat/queues/waitinginteractions',auth[_0x28ab('0x6')](),controller['chatQueuesWaitingInteractions']);router[_0x28ab('0xc')]('/mail/queues/waitinginteractions',auth[_0x28ab('0x6')](),controller[_0x28ab('0x2f')]);router[_0x28ab('0xc')](_0x28ab('0x30'),auth[_0x28ab('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0x28ab('0xc')]('/sms/queues/waitinginteractions',auth[_0x28ab('0x6')](),controller[_0x28ab('0x31')]);router[_0x28ab('0xc')](_0x28ab('0x32'),auth[_0x28ab('0x6')](),controller[_0x28ab('0x33')]);router[_0x28ab('0x34')](_0x28ab('0x35'),auth[_0x28ab('0x6')](),controller[_0x28ab('0x36')](_0x28ab('0x37')));router['get'](_0x28ab('0x38'),auth['isAuthenticated'](),controller[_0x28ab('0x39')]);router['post'](_0x28ab('0x3a'),auth[_0x28ab('0x6')](),controller['queueNotify'](_0x28ab('0x3b')));router[_0x28ab('0xc')](_0x28ab('0x3c'),auth[_0x28ab('0x6')](),controller[_0x28ab('0x3d')]);router[_0x28ab('0x34')](_0x28ab('0x3e'),auth[_0x28ab('0x6')](),controller['queueNotify']('fax'));router[_0x28ab('0xc')](_0x28ab('0x3f'),auth[_0x28ab('0x6')](),controller['showFaxQueues']);router[_0x28ab('0x34')](_0x28ab('0x40'),auth[_0x28ab('0x6')](),controller['queueNotify'](_0x28ab('0x41')));router[_0x28ab('0xc')](_0x28ab('0x42'),auth[_0x28ab('0x6')](),controller[_0x28ab('0x43')]);router['post']('/sms/queues/:id/notify',auth[_0x28ab('0x6')](),controller[_0x28ab('0x36')](_0x28ab('0x44')));router[_0x28ab('0xc')](_0x28ab('0x45'),auth[_0x28ab('0x6')](),controller[_0x28ab('0x46')]);router['post'](_0x28ab('0x47'),auth[_0x28ab('0x6')](),controller['agentNotify']);module[_0x28ab('0x48')]=router; \ No newline at end of file +var _0x813b=['/openchannel/queues/:id','showOpenchannelQueues','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','multer','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','chatQueues','/mail/queues','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','outbound','outboundChannels','/agents','agents','put','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel'];(function(_0x5dfadb,_0x931d96){var _0x3cab46=function(_0x141b56){while(--_0x141b56){_0x5dfadb['push'](_0x5dfadb['shift']());}};_0x3cab46(++_0x931d96);}(_0x813b,0x126));var _0xb813=function(_0x5c282b,_0x276169){_0x5c282b=_0x5c282b-0x0;var _0x2cb5e6=_0x813b[_0x5c282b];return _0x2cb5e6;};'use strict';var multer=require(_0xb813('0x0'));var util=require('util');var path=require(_0xb813('0x1'));var express=require(_0xb813('0x2'));var router=express[_0xb813('0x3')]();var auth=require(_0xb813('0x4'));var controller=require(_0xb813('0x5'));router['get'](_0xb813('0x6'),auth[_0xb813('0x7')](),controller[_0xb813('0x8')]);router[_0xb813('0x9')](_0xb813('0xa'),auth['isAuthenticated'](),controller[_0xb813('0xb')]);router[_0xb813('0x9')](_0xb813('0xc'),auth['isAuthenticated'](),controller[_0xb813('0xd')]);router[_0xb813('0x9')]('/voice/queues',auth[_0xb813('0x7')](),controller[_0xb813('0xe')]);router[_0xb813('0x9')]('/chat/queues',auth[_0xb813('0x7')](),controller[_0xb813('0xf')]);router[_0xb813('0x9')](_0xb813('0x10'),auth[_0xb813('0x7')](),controller['mailQueues']);router['get']('/mail/accounts',auth[_0xb813('0x7')](),controller[_0xb813('0x11')]);router[_0xb813('0x9')](_0xb813('0x12'),auth['isAuthenticated'](),controller['openchannelQueues']);router[_0xb813('0x9')](_0xb813('0x13'),auth[_0xb813('0x7')](),controller[_0xb813('0x14')]);router['get'](_0xb813('0x15'),auth[_0xb813('0x7')](),controller[_0xb813('0x16')]);router[_0xb813('0x9')]('/voice/queues/preview/:id',auth[_0xb813('0x7')](),controller[_0xb813('0x17')]);router['get'](_0xb813('0x18'),auth['isAuthenticated'](),controller[_0xb813('0x19')]);router[_0xb813('0x9')](_0xb813('0x1a'),auth['isAuthenticated'](),controller[_0xb813('0x1b')]);router[_0xb813('0x9')](_0xb813('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0xb813('0x9')](_0xb813('0x1d'),auth[_0xb813('0x7')](),controller[_0xb813('0x1e')]);router['get'](_0xb813('0x1f'),auth[_0xb813('0x7')](),controller['showVoiceQueues']);router['get']('/outbound',auth['isAuthenticated'](),controller[_0xb813('0x20')]);router[_0xb813('0x9')]('/outbound/channels',auth[_0xb813('0x7')](),controller[_0xb813('0x21')]);router['get'](_0xb813('0x22'),auth[_0xb813('0x7')](),controller[_0xb813('0x23')]);router[_0xb813('0x24')](_0xb813('0x25'),auth[_0xb813('0x7')](),controller['agentCapacity']);router['get'](_0xb813('0x26'),auth[_0xb813('0x7')](),controller[_0xb813('0x27')]);router[_0xb813('0x9')](_0xb813('0x28'),auth[_0xb813('0x7')](),controller[_0xb813('0x29')]);router[_0xb813('0x9')](_0xb813('0x2a'),auth[_0xb813('0x7')](),controller[_0xb813('0x2b')]);router[_0xb813('0x9')](_0xb813('0x2c'),auth[_0xb813('0x7')](),controller[_0xb813('0x2d')]);router[_0xb813('0x9')](_0xb813('0x2e'),auth[_0xb813('0x7')](),controller[_0xb813('0x2f')]);router['get'](_0xb813('0x30'),auth[_0xb813('0x7')](),controller[_0xb813('0x31')]);router[_0xb813('0x9')](_0xb813('0x32'),auth[_0xb813('0x7')](),controller[_0xb813('0x33')]);router['get']('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0xb813('0x9')](_0xb813('0x34'),auth[_0xb813('0x7')](),controller[_0xb813('0x35')]);router[_0xb813('0x36')]('/mail/queues/:id/notify',auth[_0xb813('0x7')](),controller['queueNotify'](_0xb813('0x37')));router[_0xb813('0x9')](_0xb813('0x38'),auth[_0xb813('0x7')](),controller[_0xb813('0x39')]);router[_0xb813('0x36')](_0xb813('0x3a'),auth[_0xb813('0x7')](),controller[_0xb813('0x3b')](_0xb813('0x3c')));router[_0xb813('0x9')](_0xb813('0x3d'),auth[_0xb813('0x7')](),controller['showChatQueues']);router[_0xb813('0x36')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0xb813('0x3b')](_0xb813('0x3e')));router['get']('/fax/queues/:id',auth[_0xb813('0x7')](),controller[_0xb813('0x3f')]);router[_0xb813('0x36')](_0xb813('0x40'),auth[_0xb813('0x7')](),controller[_0xb813('0x3b')](_0xb813('0x41')));router['get'](_0xb813('0x42'),auth['isAuthenticated'](),controller[_0xb813('0x43')]);router[_0xb813('0x36')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0xb813('0x3b')](_0xb813('0x44')));router[_0xb813('0x9')](_0xb813('0x45'),auth[_0xb813('0x7')](),controller[_0xb813('0x46')]);router['post'](_0xb813('0x47'),auth[_0xb813('0x7')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index efab561..c4e44ca 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5178=['queueNotify','capitalize','chat','Website','Account','Queue','findOne','Message','Interaction','update','MessageId','InteractionId','From','QueueId','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','messageId','queue','TransferReport','bluebird','lodash','util','../../config/logger','api','jayson/promise','client','http','error','code','message','result','status','json','sendStatus','stack','name','send','isNil','rows','voiceChannels','VoiceChannels','query','then','catch','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','format','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions'];(function(_0x3b6dc6,_0x2aede6){var _0x1ab065=function(_0x5d0e60){while(--_0x5d0e60){_0x3b6dc6['push'](_0x3b6dc6['shift']());}};_0x1ab065(++_0x2aede6);}(_0x5178,0x1ea));var _0x8517=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5178[_0xbca1b1];return _0x4e1686;};'use strict';var BPromise=require(_0x8517('0x0'));var moment=require('moment');var _=require(_0x8517('0x1'));var util=require(_0x8517('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x8517('0x3'))(_0x8517('0x4'));var jayson=require(_0x8517('0x5'));var amiClient=jayson[_0x8517('0x6')][_0x8517('0x7')]({'port':0x232a});var mailClient=jayson['client'][_0x8517('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0x8517('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x49db72,_0x5186ef,_0x49e2e5){return new BPromise(function(_0x5cf470,_0x10f08b){var _0x23dd76=_0x49e2e5?_0x49e2e5:amiClient;return _0x23dd76['request'](_0x49db72,_0x5186ef)['then'](function(_0x207322){if(_0x207322['error']){if(_0x207322[_0x8517('0x8')][_0x8517('0x9')]===0x1f4){return _0x10f08b(_0x207322[_0x8517('0x8')]['message']);}return _0x5cf470(_0x207322[_0x8517('0x8')][_0x8517('0xa')]);}else{_0x5cf470(_0x207322[_0x8517('0xb')]);}})['catch'](function(_0x4e2ca4){_0x10f08b(_0x4e2ca4);});});}function respondWithResult(_0x448202,_0x1fc74d){_0x1fc74d=_0x1fc74d||0xc8;return function(_0x233be1){if(_0x233be1){return _0x448202[_0x8517('0xc')](_0x1fc74d)[_0x8517('0xd')](_0x233be1);}return _0x448202[_0x8517('0xe')](0x194);};}function handleError(_0x4d949e,_0x4e0493){_0x4e0493=_0x4e0493||0x1f4;return function(_0x7073dd){logger[_0x8517('0x8')](_0x7073dd[_0x8517('0xf')]);if(_0x7073dd[_0x8517('0x10')]){delete _0x7073dd[_0x8517('0x10')];}_0x4d949e[_0x8517('0xc')](_0x4e0493)[_0x8517('0x11')](_0x7073dd);};}function findById(_0x1facea){return function(_0x3c0c43){if(!_[_0x8517('0x12')](_0x1facea)&&!_['isNil'](_0x3c0c43)&&!_[_0x8517('0x12')](_0x3c0c43[_0x8517('0x13')])){return _['find'](_0x3c0c43[_0x8517('0x13')],function(_0x45e8ac){return _0x45e8ac['id']==_0x1facea;});}return null;};}exports[_0x8517('0x14')]=function(_0x2d5f10,_0x480902){return respondWithRpcPromise(_0x8517('0x15'),_0x2d5f10[_0x8517('0x16')])[_0x8517('0x17')](respondWithResult(_0x480902,null))[_0x8517('0x18')](handleError(_0x480902,null));};exports['voiceChannelMixMonitor']=function(_0xc06450,_0x231efd){return respondWithRpcPromise(_0x8517('0x19'),_[_0x8517('0x1a')](_0xc06450[_0x8517('0x16')],_0xc06450[_0x8517('0x1b')]))['then'](respondWithResult(_0x231efd,null))['catch'](handleError(_0x231efd,null));};exports[_0x8517('0x1c')]=function(_0x35c00b,_0x1126ae){return respondWithRpcPromise(_0x8517('0x1d'),_[_0x8517('0x1a')](_0x35c00b['query'],_0x35c00b[_0x8517('0x1b')]))[_0x8517('0x17')](respondWithResult(_0x1126ae,null))['catch'](handleError(_0x1126ae,null));};exports[_0x8517('0x1e')]=function(_0x471ab5,_0x11b2d5){return respondWithRpcPromise(_0x8517('0x1f'),_0x471ab5[_0x8517('0x16')])[_0x8517('0x17')](respondWithResult(_0x11b2d5,null))['catch'](handleError(_0x11b2d5,null));};exports[_0x8517('0x20')]=function(_0x54af64,_0x5c8b10){return respondWithRpcPromise(_0x8517('0x1f'),_0x54af64[_0x8517('0x16')])[_0x8517('0x17')](findById(_0x54af64[_0x8517('0x1b')]['id']))['then'](respondWithResult(_0x5c8b10,null))['catch'](handleError(_0x5c8b10,null));};exports[_0x8517('0x21')]=function(_0x4d34f9,_0x451e5b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x8517('0x1a')](_0x4d34f9[_0x8517('0x16')],_0x4d34f9[_0x8517('0x1b')]))[_0x8517('0x17')](respondWithResult(_0x451e5b,null))[_0x8517('0x18')](handleError(_0x451e5b,null));};exports[_0x8517('0x22')]=function(_0x37b591,_0xf96561){return respondWithRpcPromise(_0x8517('0x23'),_0x37b591[_0x8517('0x16')])[_0x8517('0x17')](respondWithResult(_0xf96561,null))[_0x8517('0x18')](handleError(_0xf96561,null));};exports['voiceQueuesChannel']=function(_0x35ca7d,_0x53651f){return respondWithRpcPromise(_0x8517('0x24'),_[_0x8517('0x1a')](_0x35ca7d['query'],_0x35ca7d[_0x8517('0x1b')]))[_0x8517('0x17')](respondWithResult(_0x53651f,null))['catch'](handleError(_0x53651f,null));};exports['voiceQueuesChannelHangup']=function(_0x5d929,_0x1935fb){return respondWithRpcPromise(_0x8517('0x25'),_[_0x8517('0x1a')](_0x5d929[_0x8517('0x16')],_0x5d929[_0x8517('0x1b')]))['then'](respondWithResult(_0x1935fb,null))[_0x8517('0x18')](handleError(_0x1935fb,null));};exports[_0x8517('0x26')]=function(_0x26e4d0,_0x1f318d){return respondWithRpcPromise(_0x8517('0x27'),_[_0x8517('0x1a')](_0x26e4d0['query'],_0x26e4d0[_0x8517('0x1b')]))['then'](respondWithResult(_0x1f318d,null))[_0x8517('0x18')](handleError(_0x1f318d,null));};exports[_0x8517('0x28')]=function(_0x2fd17e,_0x24b5fc){return respondWithRpcPromise(_0x8517('0x29'),_0x2fd17e[_0x8517('0x16')])[_0x8517('0x17')](respondWithResult(_0x24b5fc,null))[_0x8517('0x18')](handleError(_0x24b5fc,null));};exports[_0x8517('0x2a')]=function(_0x19466d,_0x5e28f2){return respondWithRpcPromise(_0x8517('0x2b'),_0x19466d[_0x8517('0x16')])[_0x8517('0x17')](respondWithResult(_0x5e28f2,null))['catch'](handleError(_0x5e28f2,null));};exports[_0x8517('0x2c')]=function(_0x5df385,_0x5d5487){var _0x2edd95;return respondWithRpcPromise(_0x8517('0x2d'),_0x5df385[_0x8517('0x16')])[_0x8517('0x17')](function(_0x25792d){_0x2edd95=_0x25792d;return respondWithRpcPromise(_0x8517('0x2d'),_0x5df385[_0x8517('0x16')],routingClient);})[_0x8517('0x17')](function(_0x20f932){return _['merge']({},_0x20f932,_0x2edd95);})['then'](respondWithResult(_0x5d5487,null))[_0x8517('0x18')](handleError(_0x5d5487,null));};exports[_0x8517('0x2e')]=function(_0x3840a2,_0x43a00b){if(_0x3840a2[_0x8517('0x2f')]&&_0x3840a2[_0x8517('0x2f')]['interaction']&&_0x3840a2[_0x8517('0x30')]&&_0x3840a2[_0x8517('0x30')][_0x8517('0x10')]){for(var _0x507716 in _0x3840a2[_0x8517('0x2f')]['interaction']){if(_0x3840a2['body'][_0x8517('0x31')]['hasOwnProperty'](_0x507716)){db[_0x8517('0x32')][_0x8517('0x33')]({'where':{'channel':_0x507716,'membername':_0x3840a2['user'][_0x8517('0x10')],'type':_0x8517('0x34'),'exitAt':null,'uniqueid':_0x3840a2[_0x8517('0x2f')]['interaction'][_0x507716]&&_0x3840a2[_0x8517('0x2f')][_0x8517('0x31')][_0x507716][_0x8517('0x35')]?{'$notIn':_0x3840a2[_0x8517('0x2f')]['interaction'][_0x507716]}:{'$ne':null}}})['then'](function(_0x148742){var _0x483420=moment()['format'](_0x8517('0x36'));for(var _0x187018=0x0,_0xa11365=_0x148742['length'];_0x187018<_0xa11365;_0x187018+=0x1){_0x148742[_0x187018][_0x8517('0x37')]({'exitAt':_0x483420});}});for(var _0x2b71ec=0x0;_0x2b71ec<_0x3840a2[_0x8517('0x2f')][_0x8517('0x31')][_0x507716][_0x8517('0x35')];_0x2b71ec+=0x1){db[_0x8517('0x32')][_0x8517('0x38')]({'where':{'channel':_0x507716,'membername':_0x3840a2[_0x8517('0x30')]['name'],'type':_0x8517('0x34'),'uniqueid':_0x3840a2[_0x8517('0x2f')][_0x8517('0x31')][_0x507716][_0x2b71ec],'exitAt':null},'defaults':{'channel':_0x507716,'membername':_0x3840a2['user'][_0x8517('0x10')],'interface':_[_0x8517('0x12')](_0x3840a2['user'][_0x8517('0x39')])?util[_0x8517('0x3a')](_0x8517('0x3b'),_0x3840a2['user']['name']):_0x3840a2[_0x8517('0x30')][_0x8517('0x39')],'type':_0x8517('0x34'),'enterAt':moment()[_0x8517('0x3a')](_0x8517('0x36')),'role':_0x8517('0x3c'),'internal':_0x3840a2['user'][_0x8517('0x3d')],'uniqueid':_0x3840a2[_0x8517('0x2f')][_0x8517('0x31')][_0x507716][_0x2b71ec]}});}}}}return respondWithRpcPromise(_0x8517('0x3e'),{'id':_0x3840a2[_0x8517('0x1b')]['id'],'capacity':_0x3840a2[_0x8517('0x2f')]['capacity']},routingClient)['then'](respondWithResult(_0x43a00b,null))[_0x8517('0x18')](handleError(_0x43a00b,null));};exports[_0x8517('0x3f')]=function(_0xdef601,_0x375e35){return respondWithRpcPromise(_0x8517('0x40'),_0xdef601['query'])[_0x8517('0x17')](respondWithResult(_0x375e35,null))[_0x8517('0x18')](handleError(_0x375e35,null));};exports[_0x8517('0x41')]=function(_0x5ccd1c,_0x5b9456){return respondWithRpcPromise(_0x8517('0x42'),_0x5ccd1c[_0x8517('0x16')])['then'](respondWithResult(_0x5b9456,null))[_0x8517('0x18')](handleError(_0x5b9456,null));};exports[_0x8517('0x43')]=function(_0x4c30c5,_0x25696a){return respondWithRpcPromise(_0x8517('0x44'),_0x4c30c5[_0x8517('0x16')])[_0x8517('0x17')](respondWithResult(_0x25696a,null))[_0x8517('0x18')](handleError(_0x25696a,null));};exports[_0x8517('0x45')]=function(_0x5100c8,_0x393cea){return respondWithRpcPromise(_0x8517('0x46'),_0x5100c8[_0x8517('0x16')],routingClient)[_0x8517('0x17')](respondWithResult(_0x393cea,null))[_0x8517('0x18')](handleError(_0x393cea,null));};exports[_0x8517('0x47')]=function(_0x1b6102,_0x5cb70c){return respondWithRpcPromise(_0x8517('0x46'),_0x1b6102['query'],routingClient)[_0x8517('0x17')](findById(_0x1b6102['params']['id']))['then'](respondWithResult(_0x5cb70c,null))[_0x8517('0x18')](handleError(_0x5cb70c,null));};exports['mailQueues']=function(_0x3eb8a7,_0xe064d6){return respondWithRpcPromise(_0x8517('0x48'),_0x3eb8a7[_0x8517('0x16')],routingClient)[_0x8517('0x17')](respondWithResult(_0xe064d6,null))[_0x8517('0x18')](handleError(_0xe064d6,null));};exports[_0x8517('0x49')]=function(_0x1dc341,_0x16133f){return respondWithRpcPromise(_0x8517('0x48'),_0x1dc341[_0x8517('0x16')],routingClient)['then'](findById(_0x1dc341[_0x8517('0x1b')]['id']))[_0x8517('0x17')](respondWithResult(_0x16133f,null))['catch'](handleError(_0x16133f,null));};exports['mailAccounts']=function(_0x16745f,_0x32b791){return respondWithRpcPromise(_0x8517('0x4a'),_0x16745f[_0x8517('0x16')],mailClient)[_0x8517('0x17')](respondWithResult(_0x32b791,null))[_0x8517('0x18')](handleError(_0x32b791,null));};exports[_0x8517('0x4b')]=function(_0x51101,_0x482deb){return respondWithRpcPromise('OpenchannelQueues',_0x51101[_0x8517('0x16')],routingClient)['then'](respondWithResult(_0x482deb,null))[_0x8517('0x18')](handleError(_0x482deb,null));};exports[_0x8517('0x4c')]=function(_0x43d5bb,_0xd88df0){return respondWithRpcPromise('OpenchannelQueues',_0x43d5bb[_0x8517('0x16')],routingClient)['then'](findById(_0x43d5bb[_0x8517('0x1b')]['id']))[_0x8517('0x17')](respondWithResult(_0xd88df0,null))[_0x8517('0x18')](handleError(_0xd88df0,null));};exports[_0x8517('0x4d')]=function(_0x3e2919,_0x2a077d){return respondWithRpcPromise(_0x8517('0x4e'),_0x3e2919[_0x8517('0x16')],routingClient)['then'](respondWithResult(_0x2a077d,null))['catch'](handleError(_0x2a077d,null));};exports[_0x8517('0x4f')]=function(_0x36501d,_0x203649){return respondWithRpcPromise('SmsQueues',_0x36501d[_0x8517('0x16')],routingClient)['then'](findById(_0x36501d[_0x8517('0x1b')]['id']))['then'](respondWithResult(_0x203649,null))[_0x8517('0x18')](handleError(_0x203649,null));};exports['faxQueues']=function(_0x436a69,_0x584f48){return respondWithRpcPromise(_0x8517('0x50'),_0x436a69[_0x8517('0x16')],routingClient)['then'](respondWithResult(_0x584f48,null))[_0x8517('0x18')](handleError(_0x584f48,null));};exports[_0x8517('0x51')]=function(_0x31f130,_0x17be1c){return respondWithRpcPromise('FaxQueues',_0x31f130[_0x8517('0x16')],routingClient)[_0x8517('0x17')](findById(_0x31f130['params']['id']))[_0x8517('0x17')](respondWithResult(_0x17be1c,null))['catch'](handleError(_0x17be1c,null));};exports['faxAccounts']=function(_0x37db72,_0x55cfc3){return respondWithRpcPromise(_0x8517('0x52'),_0x37db72[_0x8517('0x16')])[_0x8517('0x17')](respondWithResult(_0x55cfc3,null))[_0x8517('0x18')](handleError(_0x55cfc3,null));};exports[_0x8517('0x53')]=function(_0xad0fa0,_0x34c0cb){return respondWithRpcPromise(_0x8517('0x54'),_0xad0fa0[_0x8517('0x16')],routingClient)[_0x8517('0x17')](respondWithResult(_0x34c0cb,null))[_0x8517('0x18')](handleError(_0x34c0cb,null));};exports[_0x8517('0x55')]=function(_0x30a546,_0x1daf9e){return respondWithRpcPromise(_0x8517('0x56'),_0x30a546['query'],routingClient)[_0x8517('0x17')](respondWithResult(_0x1daf9e,null))[_0x8517('0x18')](handleError(_0x1daf9e,null));};exports[_0x8517('0x57')]=function(_0x4a7ef9,_0x10df7f){return respondWithRpcPromise(_0x8517('0x58'),_0x4a7ef9[_0x8517('0x16')],routingClient)[_0x8517('0x17')](respondWithResult(_0x10df7f,null))['catch'](handleError(_0x10df7f,null));};exports['smsQueuesWaitingInteractions']=function(_0x595ef4,_0x976e90){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x595ef4[_0x8517('0x16')],routingClient)[_0x8517('0x17')](respondWithResult(_0x976e90,null))['catch'](handleError(_0x976e90,null));};exports[_0x8517('0x59')]=function(_0x41b420,_0x345e2b){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x41b420[_0x8517('0x16')],routingClient)[_0x8517('0x17')](respondWithResult(_0x345e2b,null))[_0x8517('0x18')](handleError(_0x345e2b,null));};exports[_0x8517('0x5a')]=function(_0x25f4a4){return function(_0x599193,_0x22ef7b){var _0x299311,_0x878aec;var _0x4a7cc1=_[_0x8517('0x5b')](_0x25f4a4);var _0x2c7901=_0x25f4a4===_0x8517('0x5c')?_0x8517('0x5d'):_0x8517('0x5e');return db[_0x4a7cc1+_0x8517('0x5f')][_0x8517('0x60')]({'raw':!![],'where':{'id':_0x599193[_0x8517('0x1b')]['id']}})[_0x8517('0x17')](function(_0x1b518d){if(_[_0x8517('0x12')](_0x1b518d)){throw new Error(_0x4a7cc1+'\x20Queue\x20not\x20found');}_0x299311=_0x1b518d;return db[_0x4a7cc1+_0x8517('0x61')][_0x8517('0x60')]({'where':{'id':_0x599193[_0x8517('0x2f')]['messageId']},'include':[{'model':db[_0x4a7cc1+_0x8517('0x62')],'as':'Interaction'},{'model':db[_0x4a7cc1+_0x2c7901],'as':_0x8517('0x5e')}]});})[_0x8517('0x17')](function(_0x3d1d79){if(_[_0x8517('0x12')](_0x3d1d79)){throw new Error(_0x4a7cc1+'\x20Message\x20not\x20found');}_0x878aec=_0x3d1d79;return _0x3d1d79[_0x8517('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8517('0x17')](function(){var _0x29c558={'uniqueid':_0x25f4a4+'.'+_0x878aec['id']+'.'+_0x878aec['Interaction']['id'],'FromUserId':_0x599193[_0x8517('0x30')]['id'],'type':'queue'};_0x29c558[_0x4a7cc1+_0x8517('0x64')]=_0x878aec['id'];_0x29c558[_0x4a7cc1+_0x8517('0x65')]=_0x878aec[_0x8517('0x62')]['id'];_0x29c558[_0x8517('0x66')+_0x4a7cc1+_0x2c7901+'Id']=_0x878aec['Account']['id'];_0x29c558['To'+_0x4a7cc1+_0x8517('0x67')]=_0x299311['id'];return db[_0x4a7cc1+'TransferReport'][_0x8517('0x68')](_0x29c558);})[_0x8517('0x17')](function(){return respondWithRpcPromise(_0x8517('0x69'),{'channel':_0x25f4a4,'interaction':_0x878aec[_0x8517('0x62')],'message':_0x878aec,'account':_0x878aec[_0x8517('0x5e')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x299311['name']+','+(_0x878aec['Account'][_0x8517('0x6a')]||0x12c),'interval':_0x8517('0x6b')}]},routingClient);})['then'](respondWithResult(_0x22ef7b,null))['catch'](handleError(_0x22ef7b,null));};};exports[_0x8517('0x6c')]=function(_0x12036c,_0x4483a2){var _0x43c8df,_0x47f3e0;if(_[_0x8517('0x12')](_0x12036c[_0x8517('0x2f')][_0x8517('0x6d')])){throw new Error(_0x8517('0x6e'));}var _0x2a12d1=_0x12036c[_0x8517('0x2f')][_0x8517('0x6d')];var _0xe351a2=_[_0x8517('0x5b')](_0x2a12d1);var _0x1d5537=_0x2a12d1===_0x8517('0x5c')?_0x8517('0x5d'):_0x8517('0x5e');return db[_0x8517('0x6f')][_0x8517('0x60')]({'raw':!![],'where':{'id':_0x12036c[_0x8517('0x1b')]['id'],'role':'agent'}})[_0x8517('0x17')](function(_0x2b6dea){if(_['isNil'](_0x2b6dea)){throw new Error(_0x8517('0x70'));}_0x43c8df=_0x2b6dea;return db[_0xe351a2+_0x8517('0x61')][_0x8517('0x60')]({'where':{'id':_0x12036c[_0x8517('0x2f')][_0x8517('0x71')]},'include':[{'model':db[_0xe351a2+_0x8517('0x62')],'as':_0x8517('0x62')},{'model':db[_0xe351a2+_0x1d5537],'as':_0x8517('0x5e')}]});})[_0x8517('0x17')](function(_0x29a241){if(_['isNil'](_0x29a241)){throw new Error(_0xe351a2+'\x20Message\x20not\x20found');}_0x47f3e0=_0x29a241;return _0x29a241[_0x8517('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8517('0x17')](function(){var _0x402805={'uniqueid':_0x2a12d1+'.'+_0x47f3e0['id']+'.'+_0x47f3e0['Interaction']['id'],'FromUserId':_0x12036c[_0x8517('0x30')]['id'],'type':_0x8517('0x72'),'ToUserId':_0x43c8df['id']};_0x402805[_0xe351a2+_0x8517('0x64')]=_0x47f3e0['id'];_0x402805[_0xe351a2+_0x8517('0x65')]=_0x47f3e0[_0x8517('0x62')]['id'];_0x402805[_0x8517('0x66')+_0xe351a2+_0x1d5537+'Id']=_0x47f3e0['Account']['id'];return db[_0xe351a2+_0x8517('0x73')][_0x8517('0x68')](_0x402805);})[_0x8517('0x17')](function(){return respondWithRpcPromise(_0x8517('0x69'),{'channel':_0x2a12d1,'interaction':_0x47f3e0[_0x8517('0x62')],'message':_0x47f3e0,'account':_0x47f3e0[_0x8517('0x5e')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8517('0x3c'),'appdata':_0x43c8df[_0x8517('0x10')]+','+(_0x47f3e0[_0x8517('0x5e')]['agentTransferTimeout']||0x12c),'interval':_0x8517('0x6b')}]},routingClient);})[_0x8517('0x17')](respondWithResult(_0x4483a2,null))[_0x8517('0x18')](handleError(_0x4483a2,null));}; \ No newline at end of file +var _0x0e89=['message','result','status','json','sendStatus','name','send','isNil','rows','voiceChannels','query','VoiceChannelMixMonitor','merge','params','catch','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','Agents','body','interaction','user','hasOwnProperty','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','agent','internal','AgentCapacity','capacity','telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','TransferReport','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','jayson/promise','http','client','request','then','code','error'];(function(_0x2bc936,_0x2fe881){var _0x572fe2=function(_0x1c6024){while(--_0x1c6024){_0x2bc936['push'](_0x2bc936['shift']());}};_0x572fe2(++_0x2fe881);}(_0x0e89,0xd8));var _0x90e8=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0e89[_0x432682];return _0x463d05;};'use strict';var BPromise=require(_0x90e8('0x0'));var moment=require(_0x90e8('0x1'));var _=require('lodash');var util=require(_0x90e8('0x2'));var db=require(_0x90e8('0x3'))['db'];var logger=require(_0x90e8('0x4'))('api');var jayson=require(_0x90e8('0x5'));var amiClient=jayson['client'][_0x90e8('0x6')]({'port':0x232a});var mailClient=jayson[_0x90e8('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x90e8('0x7')][_0x90e8('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x559c9d,_0x1a020f,_0x2e54ab){return new BPromise(function(_0x3f50d3,_0x559df7){var _0x1d6300=_0x2e54ab?_0x2e54ab:amiClient;return _0x1d6300[_0x90e8('0x8')](_0x559c9d,_0x1a020f)[_0x90e8('0x9')](function(_0x2020c3){if(_0x2020c3['error']){if(_0x2020c3['error'][_0x90e8('0xa')]===0x1f4){return _0x559df7(_0x2020c3[_0x90e8('0xb')]['message']);}return _0x3f50d3(_0x2020c3['error'][_0x90e8('0xc')]);}else{_0x3f50d3(_0x2020c3[_0x90e8('0xd')]);}})['catch'](function(_0x247862){_0x559df7(_0x247862);});});}function respondWithResult(_0xe21eb8,_0x4a13be){_0x4a13be=_0x4a13be||0xc8;return function(_0x2f882a){if(_0x2f882a){return _0xe21eb8[_0x90e8('0xe')](_0x4a13be)[_0x90e8('0xf')](_0x2f882a);}return _0xe21eb8[_0x90e8('0x10')](0x194);};}function handleError(_0x54d6fa,_0x386ee2){_0x386ee2=_0x386ee2||0x1f4;return function(_0x21c4b8){logger[_0x90e8('0xb')](_0x21c4b8['stack']);if(_0x21c4b8[_0x90e8('0x11')]){delete _0x21c4b8[_0x90e8('0x11')];}_0x54d6fa[_0x90e8('0xe')](_0x386ee2)[_0x90e8('0x12')](_0x21c4b8);};}function findById(_0x3c2c57){return function(_0x180fe2){if(!_[_0x90e8('0x13')](_0x3c2c57)&&!_[_0x90e8('0x13')](_0x180fe2)&&!_['isNil'](_0x180fe2[_0x90e8('0x14')])){return _['find'](_0x180fe2[_0x90e8('0x14')],function(_0x22ee68){return _0x22ee68['id']==_0x3c2c57;});}return null;};}exports[_0x90e8('0x15')]=function(_0x353646,_0x208ec2){return respondWithRpcPromise('VoiceChannels',_0x353646[_0x90e8('0x16')])[_0x90e8('0x9')](respondWithResult(_0x208ec2,null))['catch'](handleError(_0x208ec2,null));};exports['voiceChannelMixMonitor']=function(_0x263c20,_0x2ec6a0){return respondWithRpcPromise(_0x90e8('0x17'),_[_0x90e8('0x18')](_0x263c20[_0x90e8('0x16')],_0x263c20[_0x90e8('0x19')]))['then'](respondWithResult(_0x2ec6a0,null))[_0x90e8('0x1a')](handleError(_0x2ec6a0,null));};exports[_0x90e8('0x1b')]=function(_0x1c8b27,_0x3729fa){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x90e8('0x18')](_0x1c8b27[_0x90e8('0x16')],_0x1c8b27['params']))['then'](respondWithResult(_0x3729fa,null))[_0x90e8('0x1a')](handleError(_0x3729fa,null));};exports[_0x90e8('0x1c')]=function(_0x576053,_0x5e45f2){return respondWithRpcPromise(_0x90e8('0x1d'),_0x576053[_0x90e8('0x16')])[_0x90e8('0x9')](respondWithResult(_0x5e45f2,null))[_0x90e8('0x1a')](handleError(_0x5e45f2,null));};exports[_0x90e8('0x1e')]=function(_0x2edd70,_0x653dd8){return respondWithRpcPromise(_0x90e8('0x1d'),_0x2edd70[_0x90e8('0x16')])[_0x90e8('0x9')](findById(_0x2edd70[_0x90e8('0x19')]['id']))[_0x90e8('0x9')](respondWithResult(_0x653dd8,null))[_0x90e8('0x1a')](handleError(_0x653dd8,null));};exports[_0x90e8('0x1f')]=function(_0x12041f,_0x104a77){return respondWithRpcPromise(_0x90e8('0x20'),_[_0x90e8('0x18')](_0x12041f[_0x90e8('0x16')],_0x12041f[_0x90e8('0x19')]))['then'](respondWithResult(_0x104a77,null))[_0x90e8('0x1a')](handleError(_0x104a77,null));};exports['voiceQueuesChannels']=function(_0x16fa69,_0x547fe4){return respondWithRpcPromise(_0x90e8('0x21'),_0x16fa69['query'])[_0x90e8('0x9')](respondWithResult(_0x547fe4,null))[_0x90e8('0x1a')](handleError(_0x547fe4,null));};exports[_0x90e8('0x22')]=function(_0x48b4e1,_0x597d28){return respondWithRpcPromise(_0x90e8('0x23'),_[_0x90e8('0x18')](_0x48b4e1[_0x90e8('0x16')],_0x48b4e1[_0x90e8('0x19')]))[_0x90e8('0x9')](respondWithResult(_0x597d28,null))[_0x90e8('0x1a')](handleError(_0x597d28,null));};exports['voiceQueuesChannelHangup']=function(_0x1244ae,_0x1af588){return respondWithRpcPromise(_0x90e8('0x24'),_[_0x90e8('0x18')](_0x1244ae[_0x90e8('0x16')],_0x1244ae[_0x90e8('0x19')]))[_0x90e8('0x9')](respondWithResult(_0x1af588,null))['catch'](handleError(_0x1af588,null));};exports[_0x90e8('0x25')]=function(_0x3e2e39,_0x2c4e61){return respondWithRpcPromise(_0x90e8('0x26'),_[_0x90e8('0x18')](_0x3e2e39[_0x90e8('0x16')],_0x3e2e39[_0x90e8('0x19')]))[_0x90e8('0x9')](respondWithResult(_0x2c4e61,null))['catch'](handleError(_0x2c4e61,null));};exports[_0x90e8('0x27')]=function(_0x41f79a,_0x4a3d43){return respondWithRpcPromise(_0x90e8('0x28'),_0x41f79a[_0x90e8('0x16')])['then'](respondWithResult(_0x4a3d43,null))[_0x90e8('0x1a')](handleError(_0x4a3d43,null));};exports['outboundChannels']=function(_0x13ccff,_0x153b90){return respondWithRpcPromise('OutboundChannels',_0x13ccff['query'])[_0x90e8('0x9')](respondWithResult(_0x153b90,null))[_0x90e8('0x1a')](handleError(_0x153b90,null));};exports['agents']=function(_0x44adc9,_0x395cf3){var _0x21adf9;return respondWithRpcPromise(_0x90e8('0x29'),_0x44adc9[_0x90e8('0x16')])[_0x90e8('0x9')](function(_0x51636b){_0x21adf9=_0x51636b;return respondWithRpcPromise(_0x90e8('0x29'),_0x44adc9[_0x90e8('0x16')],routingClient);})[_0x90e8('0x9')](function(_0x176551){return _[_0x90e8('0x18')]({},_0x176551,_0x21adf9);})[_0x90e8('0x9')](respondWithResult(_0x395cf3,null))['catch'](handleError(_0x395cf3,null));};exports['agentCapacity']=function(_0x4fe93c,_0x28911a){if(_0x4fe93c[_0x90e8('0x2a')]&&_0x4fe93c[_0x90e8('0x2a')][_0x90e8('0x2b')]&&_0x4fe93c[_0x90e8('0x2c')]&&_0x4fe93c['user'][_0x90e8('0x11')]){for(var _0xb034d7 in _0x4fe93c[_0x90e8('0x2a')][_0x90e8('0x2b')]){if(_0x4fe93c[_0x90e8('0x2a')]['interaction'][_0x90e8('0x2d')](_0xb034d7)){db['MemberReport'][_0x90e8('0x2e')]({'where':{'channel':_0xb034d7,'membername':_0x4fe93c['user'][_0x90e8('0x11')],'type':_0x90e8('0x2f'),'exitAt':null,'uniqueid':_0x4fe93c['body'][_0x90e8('0x2b')][_0xb034d7]&&_0x4fe93c[_0x90e8('0x2a')][_0x90e8('0x2b')][_0xb034d7][_0x90e8('0x30')]?{'$notIn':_0x4fe93c[_0x90e8('0x2a')][_0x90e8('0x2b')][_0xb034d7]}:{'$ne':null}}})[_0x90e8('0x9')](function(_0x467ab6){var _0x6246b2=moment()[_0x90e8('0x31')](_0x90e8('0x32'));for(var _0x448217=0x0,_0x585c29=_0x467ab6[_0x90e8('0x30')];_0x448217<_0x585c29;_0x448217+=0x1){_0x467ab6[_0x448217]['updateAttributes']({'exitAt':_0x6246b2});}});for(var _0xf83cfa=0x0;_0xf83cfa<_0x4fe93c[_0x90e8('0x2a')][_0x90e8('0x2b')][_0xb034d7]['length'];_0xf83cfa+=0x1){db['MemberReport'][_0x90e8('0x33')]({'where':{'channel':_0xb034d7,'membername':_0x4fe93c[_0x90e8('0x2c')][_0x90e8('0x11')],'type':_0x90e8('0x2f'),'uniqueid':_0x4fe93c['body'][_0x90e8('0x2b')][_0xb034d7][_0xf83cfa],'exitAt':null},'defaults':{'channel':_0xb034d7,'membername':_0x4fe93c['user']['name'],'interface':_['isNil'](_0x4fe93c[_0x90e8('0x2c')]['interface'])?util[_0x90e8('0x31')]('SIP/%s',_0x4fe93c[_0x90e8('0x2c')][_0x90e8('0x11')]):_0x4fe93c['user']['interface'],'type':_0x90e8('0x2f'),'enterAt':moment()[_0x90e8('0x31')](_0x90e8('0x32')),'role':_0x90e8('0x34'),'internal':_0x4fe93c[_0x90e8('0x2c')][_0x90e8('0x35')],'uniqueid':_0x4fe93c[_0x90e8('0x2a')][_0x90e8('0x2b')][_0xb034d7][_0xf83cfa]}});}}}}return respondWithRpcPromise(_0x90e8('0x36'),{'id':_0x4fe93c['params']['id'],'capacity':_0x4fe93c['body'][_0x90e8('0x37')]},routingClient)[_0x90e8('0x9')](respondWithResult(_0x28911a,null))['catch'](handleError(_0x28911a,null));};exports[_0x90e8('0x38')]=function(_0x2c3924,_0xdf84df){return respondWithRpcPromise('Telephones',_0x2c3924[_0x90e8('0x16')])['then'](respondWithResult(_0xdf84df,null))['catch'](handleError(_0xdf84df,null));};exports[_0x90e8('0x39')]=function(_0x425f34,_0x24e9c3){return respondWithRpcPromise(_0x90e8('0x3a'),_0x425f34['query'])[_0x90e8('0x9')](respondWithResult(_0x24e9c3,null))[_0x90e8('0x1a')](handleError(_0x24e9c3,null));};exports[_0x90e8('0x3b')]=function(_0xe99da3,_0x316a72){return respondWithRpcPromise(_0x90e8('0x3c'),_0xe99da3[_0x90e8('0x16')])['then'](respondWithResult(_0x316a72,null))[_0x90e8('0x1a')](handleError(_0x316a72,null));};exports['chatQueues']=function(_0x561a6a,_0x1b052e){return respondWithRpcPromise(_0x90e8('0x3d'),_0x561a6a['query'],routingClient)['then'](respondWithResult(_0x1b052e,null))[_0x90e8('0x1a')](handleError(_0x1b052e,null));};exports[_0x90e8('0x3e')]=function(_0x56dc9d,_0x5671be){return respondWithRpcPromise(_0x90e8('0x3d'),_0x56dc9d[_0x90e8('0x16')],routingClient)['then'](findById(_0x56dc9d[_0x90e8('0x19')]['id']))['then'](respondWithResult(_0x5671be,null))['catch'](handleError(_0x5671be,null));};exports[_0x90e8('0x3f')]=function(_0x5420f0,_0x75a586){return respondWithRpcPromise(_0x90e8('0x40'),_0x5420f0[_0x90e8('0x16')],routingClient)[_0x90e8('0x9')](respondWithResult(_0x75a586,null))[_0x90e8('0x1a')](handleError(_0x75a586,null));};exports[_0x90e8('0x41')]=function(_0x5bfc59,_0x5182c2){return respondWithRpcPromise(_0x90e8('0x40'),_0x5bfc59[_0x90e8('0x16')],routingClient)['then'](findById(_0x5bfc59[_0x90e8('0x19')]['id']))[_0x90e8('0x9')](respondWithResult(_0x5182c2,null))['catch'](handleError(_0x5182c2,null));};exports[_0x90e8('0x42')]=function(_0x16b811,_0x3ad6f0){return respondWithRpcPromise(_0x90e8('0x43'),_0x16b811[_0x90e8('0x16')],mailClient)[_0x90e8('0x9')](respondWithResult(_0x3ad6f0,null))['catch'](handleError(_0x3ad6f0,null));};exports[_0x90e8('0x44')]=function(_0x13df82,_0x591931){return respondWithRpcPromise(_0x90e8('0x45'),_0x13df82[_0x90e8('0x16')],routingClient)['then'](respondWithResult(_0x591931,null))[_0x90e8('0x1a')](handleError(_0x591931,null));};exports[_0x90e8('0x46')]=function(_0x4472ce,_0x295af2){return respondWithRpcPromise('OpenchannelQueues',_0x4472ce[_0x90e8('0x16')],routingClient)[_0x90e8('0x9')](findById(_0x4472ce[_0x90e8('0x19')]['id']))[_0x90e8('0x9')](respondWithResult(_0x295af2,null))['catch'](handleError(_0x295af2,null));};exports['smsQueues']=function(_0x1025bf,_0x575449){return respondWithRpcPromise(_0x90e8('0x47'),_0x1025bf['query'],routingClient)['then'](respondWithResult(_0x575449,null))[_0x90e8('0x1a')](handleError(_0x575449,null));};exports[_0x90e8('0x48')]=function(_0x2c2fad,_0x1cd66d){return respondWithRpcPromise(_0x90e8('0x47'),_0x2c2fad[_0x90e8('0x16')],routingClient)[_0x90e8('0x9')](findById(_0x2c2fad[_0x90e8('0x19')]['id']))['then'](respondWithResult(_0x1cd66d,null))['catch'](handleError(_0x1cd66d,null));};exports[_0x90e8('0x49')]=function(_0x4dd12a,_0x55710b){return respondWithRpcPromise(_0x90e8('0x4a'),_0x4dd12a[_0x90e8('0x16')],routingClient)[_0x90e8('0x9')](respondWithResult(_0x55710b,null))[_0x90e8('0x1a')](handleError(_0x55710b,null));};exports[_0x90e8('0x4b')]=function(_0x1480a1,_0x5af3be){return respondWithRpcPromise(_0x90e8('0x4a'),_0x1480a1[_0x90e8('0x16')],routingClient)[_0x90e8('0x9')](findById(_0x1480a1[_0x90e8('0x19')]['id']))[_0x90e8('0x9')](respondWithResult(_0x5af3be,null))[_0x90e8('0x1a')](handleError(_0x5af3be,null));};exports[_0x90e8('0x4c')]=function(_0x2409d5,_0x5c74b5){return respondWithRpcPromise(_0x90e8('0x4d'),_0x2409d5[_0x90e8('0x16')])[_0x90e8('0x9')](respondWithResult(_0x5c74b5,null))[_0x90e8('0x1a')](handleError(_0x5c74b5,null));};exports[_0x90e8('0x4e')]=function(_0x599515,_0x41acd4){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x599515[_0x90e8('0x16')],routingClient)[_0x90e8('0x9')](respondWithResult(_0x41acd4,null))['catch'](handleError(_0x41acd4,null));};exports[_0x90e8('0x4f')]=function(_0x180b3a,_0x504875){return respondWithRpcPromise(_0x90e8('0x50'),_0x180b3a[_0x90e8('0x16')],routingClient)['then'](respondWithResult(_0x504875,null))[_0x90e8('0x1a')](handleError(_0x504875,null));};exports[_0x90e8('0x51')]=function(_0x4f93ad,_0xe8f8ce){return respondWithRpcPromise(_0x90e8('0x52'),_0x4f93ad[_0x90e8('0x16')],routingClient)[_0x90e8('0x9')](respondWithResult(_0xe8f8ce,null))[_0x90e8('0x1a')](handleError(_0xe8f8ce,null));};exports[_0x90e8('0x53')]=function(_0x1e2a1d,_0x5c3b52){return respondWithRpcPromise(_0x90e8('0x54'),_0x1e2a1d[_0x90e8('0x16')],routingClient)[_0x90e8('0x9')](respondWithResult(_0x5c3b52,null))[_0x90e8('0x1a')](handleError(_0x5c3b52,null));};exports[_0x90e8('0x55')]=function(_0x4578b6,_0x3b41ba){return respondWithRpcPromise(_0x90e8('0x56'),_0x4578b6[_0x90e8('0x16')],routingClient)[_0x90e8('0x9')](respondWithResult(_0x3b41ba,null))[_0x90e8('0x1a')](handleError(_0x3b41ba,null));};exports['queueNotify']=function(_0x44afde){return function(_0x26f2b5,_0x4bac7e){var _0x28c253,_0x18618d;var _0x472588=_[_0x90e8('0x57')](_0x44afde);var _0x1c8a1e=_0x44afde===_0x90e8('0x58')?_0x90e8('0x59'):_0x90e8('0x5a');return db[_0x472588+_0x90e8('0x5b')][_0x90e8('0x5c')]({'raw':!![],'where':{'id':_0x26f2b5[_0x90e8('0x19')]['id']}})[_0x90e8('0x9')](function(_0x534226){if(_[_0x90e8('0x13')](_0x534226)){throw new Error(_0x472588+_0x90e8('0x5d'));}_0x28c253=_0x534226;return db[_0x472588+_0x90e8('0x5e')]['findOne']({'where':{'id':_0x26f2b5[_0x90e8('0x2a')]['messageId']},'include':[{'model':db[_0x472588+'Interaction'],'as':_0x90e8('0x5f')},{'model':db[_0x472588+_0x1c8a1e],'as':'Account'}]});})[_0x90e8('0x9')](function(_0x56f2b9){if(_[_0x90e8('0x13')](_0x56f2b9)){throw new Error(_0x472588+_0x90e8('0x60'));}_0x18618d=_0x56f2b9;return _0x56f2b9[_0x90e8('0x61')]({'read':0x0,'readAt':null,'UserId':null});})[_0x90e8('0x9')](function(){var _0x569ad7={'uniqueid':_0x44afde+'.'+_0x18618d['id']+'.'+_0x18618d[_0x90e8('0x5f')]['id'],'FromUserId':_0x26f2b5[_0x90e8('0x2c')]['id'],'type':'queue'};_0x569ad7[_0x472588+_0x90e8('0x62')]=_0x18618d['id'];_0x569ad7[_0x472588+_0x90e8('0x63')]=_0x18618d[_0x90e8('0x5f')]['id'];_0x569ad7[_0x90e8('0x64')+_0x472588+_0x1c8a1e+'Id']=_0x18618d[_0x90e8('0x5a')]['id'];_0x569ad7['To'+_0x472588+_0x90e8('0x65')]=_0x28c253['id'];return db[_0x472588+'TransferReport'][_0x90e8('0x66')](_0x569ad7);})[_0x90e8('0x9')](function(){return respondWithRpcPromise(_0x90e8('0x67'),{'channel':_0x44afde,'interaction':_0x18618d[_0x90e8('0x5f')],'message':_0x18618d,'account':_0x18618d[_0x90e8('0x5a')],'applications':[{'id':0x0,'priority':0x1,'app':_0x90e8('0x68'),'appdata':_0x28c253['name']+','+(_0x18618d[_0x90e8('0x5a')][_0x90e8('0x69')]||0x12c),'interval':_0x90e8('0x6a')}]},routingClient);})[_0x90e8('0x9')](respondWithResult(_0x4bac7e,null))[_0x90e8('0x1a')](handleError(_0x4bac7e,null));};};exports[_0x90e8('0x6b')]=function(_0x22a71c,_0x288e6c){var _0x539e68,_0x12ba96;if(_[_0x90e8('0x13')](_0x22a71c[_0x90e8('0x2a')][_0x90e8('0x6c')])){throw new Error(_0x90e8('0x6d'));}var _0x140ef9=_0x22a71c[_0x90e8('0x2a')]['channel'];var _0xb4ddb9=_[_0x90e8('0x57')](_0x140ef9);var _0xb67ca=_0x140ef9===_0x90e8('0x58')?_0x90e8('0x59'):_0x90e8('0x5a');return db[_0x90e8('0x6e')][_0x90e8('0x5c')]({'raw':!![],'where':{'id':_0x22a71c[_0x90e8('0x19')]['id'],'role':_0x90e8('0x34')}})[_0x90e8('0x9')](function(_0x26881b){if(_['isNil'](_0x26881b)){throw new Error(_0x90e8('0x6f'));}_0x539e68=_0x26881b;return db[_0xb4ddb9+_0x90e8('0x5e')][_0x90e8('0x5c')]({'where':{'id':_0x22a71c[_0x90e8('0x2a')]['messageId']},'include':[{'model':db[_0xb4ddb9+'Interaction'],'as':_0x90e8('0x5f')},{'model':db[_0xb4ddb9+_0xb67ca],'as':_0x90e8('0x5a')}]});})[_0x90e8('0x9')](function(_0x2fa7ba){if(_['isNil'](_0x2fa7ba)){throw new Error(_0xb4ddb9+_0x90e8('0x60'));}_0x12ba96=_0x2fa7ba;return _0x2fa7ba[_0x90e8('0x61')]({'read':0x0,'readAt':null,'UserId':null});})[_0x90e8('0x9')](function(){var _0x2d590f={'uniqueid':_0x140ef9+'.'+_0x12ba96['id']+'.'+_0x12ba96['Interaction']['id'],'FromUserId':_0x22a71c[_0x90e8('0x2c')]['id'],'type':_0x90e8('0x68'),'ToUserId':_0x539e68['id']};_0x2d590f[_0xb4ddb9+_0x90e8('0x62')]=_0x12ba96['id'];_0x2d590f[_0xb4ddb9+_0x90e8('0x63')]=_0x12ba96[_0x90e8('0x5f')]['id'];_0x2d590f[_0x90e8('0x64')+_0xb4ddb9+_0xb67ca+'Id']=_0x12ba96['Account']['id'];return db[_0xb4ddb9+_0x90e8('0x70')]['create'](_0x2d590f);})[_0x90e8('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x140ef9,'interaction':_0x12ba96[_0x90e8('0x5f')],'message':_0x12ba96,'account':_0x12ba96[_0x90e8('0x5a')],'applications':[{'id':0x0,'priority':0x1,'app':_0x90e8('0x34'),'appdata':_0x539e68[_0x90e8('0x11')]+','+(_0x12ba96[_0x90e8('0x5a')][_0x90e8('0x71')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x90e8('0x9')](respondWithResult(_0x288e6c,null))[_0x90e8('0x1a')](handleError(_0x288e6c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index f15ba75..28f218f 100644 --- a/server/api/schedule/index.js +++ b/server/api/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1834=['isAuthenticated','show','/:id/run','run','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','get','/:id'];(function(_0x578d50,_0x196703){var _0x6c021b=function(_0x31fc04){while(--_0x31fc04){_0x578d50['push'](_0x578d50['shift']());}};_0x6c021b(++_0x196703);}(_0x1834,0x172));var _0x4183=function(_0x83420c,_0x50fd91){_0x83420c=_0x83420c-0x0;var _0x1057d7=_0x1834[_0x83420c];return _0x1057d7;};'use strict';var multer=require(_0x4183('0x0'));var util=require(_0x4183('0x1'));var path=require(_0x4183('0x2'));var timeout=require(_0x4183('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x4183('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4183('0x5'));var controller=require('./schedule.controller');router[_0x4183('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4183('0x7'),auth[_0x4183('0x8')](),controller[_0x4183('0x9')]);router[_0x4183('0x6')](_0x4183('0xa'),auth[_0x4183('0x8')](),controller[_0x4183('0xb')]);router[_0x4183('0xc')]('/',auth[_0x4183('0x8')](),controller[_0x4183('0xd')]);router['put']('/:id',auth[_0x4183('0x8')](),controller[_0x4183('0xe')]);router[_0x4183('0xf')]('/:id',auth[_0x4183('0x8')](),controller[_0x4183('0x10')]);module[_0x4183('0x11')]=router; \ No newline at end of file +var _0x2a0f=['get','isAuthenticated','index','run','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./schedule.controller'];(function(_0x27ffa0,_0x3e6c4a){var _0x37c18b=function(_0x3accb1){while(--_0x3accb1){_0x27ffa0['push'](_0x27ffa0['shift']());}};_0x37c18b(++_0x3e6c4a);}(_0x2a0f,0x8f));var _0xf2a0=function(_0xd46c03,_0x33bc0c){_0xd46c03=_0xd46c03-0x0;var _0x580ad0=_0x2a0f[_0xd46c03];return _0x580ad0;};'use strict';var multer=require(_0xf2a0('0x0'));var util=require(_0xf2a0('0x1'));var path=require(_0xf2a0('0x2'));var timeout=require(_0xf2a0('0x3'));var express=require(_0xf2a0('0x4'));var router=express[_0xf2a0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xf2a0('0x6'));var config=require(_0xf2a0('0x7'));var controller=require(_0xf2a0('0x8'));router[_0xf2a0('0x9')]('/',auth[_0xf2a0('0xa')](),controller[_0xf2a0('0xb')]);router[_0xf2a0('0x9')]('/:id',auth[_0xf2a0('0xa')](),controller['show']);router[_0xf2a0('0x9')]('/:id/run',auth[_0xf2a0('0xa')](),controller[_0xf2a0('0xc')]);router[_0xf2a0('0xd')]('/',auth[_0xf2a0('0xa')](),controller[_0xf2a0('0xe')]);router['put'](_0xf2a0('0xf'),auth[_0xf2a0('0xa')](),controller[_0xf2a0('0x10')]);router[_0xf2a0('0x11')](_0xf2a0('0xf'),auth[_0xf2a0('0xa')](),controller['destroy']);module[_0xf2a0('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index ce935ad..d1b928b 100644 --- a/server/api/schedule/schedule.attributes.js +++ b/server/api/schedule/schedule.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd819=['minutes','csv','pdf','xlsx','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','weeks','days','hours'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0xd819,0x181));var _0x9d81=function(_0xc4f7c0,_0x3d731b){_0xc4f7c0=_0xc4f7c0-0x0;var _0x479501=_0xd819[_0xc4f7c0];return _0x479501;};'use strict';var Sequelize=require('sequelize');module[_0x9d81('0x0')]={'name':{'type':Sequelize[_0x9d81('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9d81('0x1')]},'active':{'type':Sequelize[_0x9d81('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9d81('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x9d81('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9d81('0x5')](_0x9d81('0x6'),_0x9d81('0x7'),'months',_0x9d81('0x8'),_0x9d81('0x9'),_0x9d81('0xa'),_0x9d81('0xb')),'allowNull':![],'defaultValue':_0x9d81('0x9')},'output':{'type':Sequelize[_0x9d81('0x5')](_0x9d81('0xc'),_0x9d81('0xd'),_0x9d81('0xe')),'allowNull':![],'defaultValue':_0x9d81('0xc')},'type':{'type':Sequelize[_0x9d81('0x5')](_0x9d81('0xf'),_0x9d81('0x10')),'allowNull':![],'defaultValue':_0x9d81('0xf')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x9d81('0x1')]},'cc':{'type':Sequelize[_0x9d81('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x9d81('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb422=['csv','custom','default','BOOLEAN','TEXT','STRING','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','months','weeks','hours','minutes','days','pdf'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0xb422,0x85));var _0x2b42=function(_0x490772,_0x103e1b){_0x490772=_0x490772-0x0;var _0x2d828a=_0xb422[_0x490772];return _0x2d828a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x2b42('0x0')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2b42('0x1')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x2b42('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x2b42('0x3')]('years',_0x2b42('0x4'),_0x2b42('0x5'),_0x2b42('0x6'),'days',_0x2b42('0x7'),_0x2b42('0x8')),'allowNull':![],'defaultValue':_0x2b42('0x9')},'output':{'type':Sequelize['ENUM']('csv',_0x2b42('0xa'),'xlsx'),'allowNull':![],'defaultValue':_0x2b42('0xb')},'type':{'type':Sequelize[_0x2b42('0x3')](_0x2b42('0xc'),_0x2b42('0xd')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x2b42('0xe')],'defaultValue':![]},'email':{'type':Sequelize[_0x2b42('0x0')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x2b42('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x2b42('0xe')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index e6fd648..cac4cf6 100644 --- a/server/api/schedule/schedule.controller.js +++ b/server/api/schedule/schedule.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b9b=['to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','update','then','destroy','get','Scheduler','send','index','Schedule','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','catch','params','find','create','body','UserProfileSection','autoAssociation','UserProfileResource','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','html-pdf','eml-format','bluebird','mustache','util','path','sox'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0x7b9b,0xd1));var _0xb7b9=function(_0x4b6e05,_0x417fed){_0x4b6e05=_0x4b6e05-0x0;var _0x5396cb=_0x7b9b[_0x4b6e05];return _0x5396cb;};'use strict';var pdf=require(_0xb7b9('0x0'));var emlformat=require(_0xb7b9('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb7b9('0x2'));var Mustache=require(_0xb7b9('0x3'));var util=require(_0xb7b9('0x4'));var path=require(_0xb7b9('0x5'));var sox=require(_0xb7b9('0x6'));var csv=require(_0xb7b9('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb7b9('0x8'));var squel=require('squel');var crypto=require(_0xb7b9('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xb7b9('0xa'));var toCsv=require('to-csv');var querystring=require(_0xb7b9('0xb'));var Papa=require(_0xb7b9('0xc'));var Redis=require(_0xb7b9('0xd'));var authService=require(_0xb7b9('0xe'));var qs=require(_0xb7b9('0xf'));var hardwareService=require(_0xb7b9('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb7b9('0x11'));var db=require(_0xb7b9('0x12'))['db'];function respondWithStatusCode(_0x1ea791,_0x37d822){_0x37d822=_0x37d822||0xcc;return function(_0xdc9936){if(_0xdc9936){return _0x1ea791[_0xb7b9('0x13')](_0x37d822);}return _0x1ea791['status'](_0x37d822)[_0xb7b9('0x14')]();};}function respondWithResult(_0x5b0807,_0x38226a){_0x38226a=_0x38226a||0xc8;return function(_0x1e57ee){if(_0x1e57ee){return _0x5b0807[_0xb7b9('0x15')](_0x38226a)[_0xb7b9('0x16')](_0x1e57ee);}};}function respondWithFilteredResult(_0x971bd4,_0x50208c){return function(_0x1a5f5a){if(_0x1a5f5a){var _0x46bcc9=_0x1a5f5a[_0xb7b9('0x17')],_0x3e87aa=_0x50208c['offset'],_0xc1a51b=_0x50208c[_0xb7b9('0x18')]+_0x50208c[_0xb7b9('0x19')],_0x568774;if(_0xc1a51b>=_0x46bcc9){_0xc1a51b=_0x46bcc9;_0x568774=0xc8;}else{_0x568774=0xce;}_0x971bd4['status'](_0x568774);return _0x971bd4[_0xb7b9('0x1a')]('Content-Range',_0x3e87aa+'-'+_0xc1a51b+'/'+_0x46bcc9)[_0xb7b9('0x16')](_0x1a5f5a);}return null;};}function patchUpdates(_0x31bc43){return function(_0xdcc1bb){try{jsonpatch[_0xb7b9('0x1b')](_0xdcc1bb,_0x31bc43,!![]);}catch(_0x5d7903){return BPromise['reject'](_0x5d7903);}return _0xdcc1bb['save']();};}function saveUpdates(_0x46688c,_0x1c2dd9){return function(_0x4a31ac){if(_0x4a31ac){return _0x4a31ac[_0xb7b9('0x1c')](_0x46688c)[_0xb7b9('0x1d')](function(_0x303d75){return _0x303d75;});}return null;};}function removeEntity(_0x2cc02b,_0x359124){return function(_0x14bc1a){if(_0x14bc1a){return _0x14bc1a[_0xb7b9('0x1e')]()[_0xb7b9('0x1d')](function(){var _0xed81e6=_0x14bc1a[_0xb7b9('0x1f')]({'plain':!![]});var _0x2d07d3=_0xb7b9('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x2d07d3,'resourceId':_0xed81e6['id']}})[_0xb7b9('0x1d')](function(){return _0x14bc1a;});})[_0xb7b9('0x1d')](function(){_0x2cc02b[_0xb7b9('0x15')](0xcc)[_0xb7b9('0x14')]();});}};}function handleEntityNotFound(_0x12a962,_0x3d96f3){return function(_0x191136){if(!_0x191136){_0x12a962['sendStatus'](0x194);}return _0x191136;};}function handleError(_0x146576,_0x444c29){_0x444c29=_0x444c29||0x1f4;return function(_0x5e38aa){logger['error'](_0x5e38aa['stack']);if(_0x5e38aa['name']){delete _0x5e38aa['name'];}_0x146576[_0xb7b9('0x15')](_0x444c29)[_0xb7b9('0x21')](_0x5e38aa);};}exports[_0xb7b9('0x22')]=function(_0x39ca2b,_0x5a21ff){var _0x323aeb={},_0x555dea={},_0x4fac4b={'count':0x0,'rows':[]};var _0x2f995f=db[_0xb7b9('0x23')]['rawAttributes'];_0x555dea['model']=_[_0xb7b9('0x24')](_0x2f995f);_0x555dea[_0xb7b9('0x25')]=_[_0xb7b9('0x24')](_0x39ca2b[_0xb7b9('0x25')]);_0x555dea[_0xb7b9('0x26')]=_[_0xb7b9('0x27')](_0x555dea[_0xb7b9('0x28')],_0x555dea[_0xb7b9('0x25')]);_0x323aeb[_0xb7b9('0x29')]=_[_0xb7b9('0x27')](_0x555dea['model'],qs[_0xb7b9('0x2a')](_0x39ca2b[_0xb7b9('0x25')][_0xb7b9('0x2a')]));_0x323aeb['attributes']=_0x323aeb[_0xb7b9('0x29')][_0xb7b9('0x2b')]?_0x323aeb[_0xb7b9('0x29')]:_0x555dea[_0xb7b9('0x28')];if(!_0x39ca2b['query'][_0xb7b9('0x2c')]('nolimit')){_0x323aeb[_0xb7b9('0x19')]=qs[_0xb7b9('0x19')](_0x39ca2b[_0xb7b9('0x25')][_0xb7b9('0x19')]);_0x323aeb['offset']=qs[_0xb7b9('0x18')](_0x39ca2b[_0xb7b9('0x25')][_0xb7b9('0x18')]);}_0x323aeb[_0xb7b9('0x2d')]=qs[_0xb7b9('0x2e')](_0x39ca2b['query']['sort']);_0x323aeb[_0xb7b9('0x2f')]=qs['filters'](_[_0xb7b9('0x30')](_0x39ca2b[_0xb7b9('0x25')],_0x555dea[_0xb7b9('0x26')]));if(_0x39ca2b['query'][_0xb7b9('0x31')]){_0x323aeb['where']=_[_0xb7b9('0x32')](_0x323aeb[_0xb7b9('0x2f')],{'$or':_[_0xb7b9('0x33')](_0x2f995f,function(_0xf72c91){if(_0xf72c91[_0xb7b9('0x34')][_0xb7b9('0x35')]!==_0xb7b9('0x36')){var _0x4d66c9={};_0x4d66c9[_0xf72c91[_0xb7b9('0x37')]]={'$like':'%'+_0x39ca2b['query']['filter']+'%'};return _0x4d66c9;}})});}_0x323aeb=_[_0xb7b9('0x32')]({},_0x323aeb,_0x39ca2b[_0xb7b9('0x38')]);var _0x5b0fba={'where':_0x323aeb[_0xb7b9('0x2f')]};return db[_0xb7b9('0x23')][_0xb7b9('0x17')](_0x5b0fba)['then'](function(_0x2d05cc){_0x4fac4b['count']=_0x2d05cc;if(_0x39ca2b[_0xb7b9('0x25')][_0xb7b9('0x39')]){_0x323aeb[_0xb7b9('0x3a')]=[{'all':!![]}];}return db[_0xb7b9('0x23')][_0xb7b9('0x3b')](_0x323aeb);})['then'](function(_0x176864){_0x4fac4b['rows']=_0x176864;return _0x4fac4b;})['then'](respondWithFilteredResult(_0x5a21ff,_0x323aeb))[_0xb7b9('0x3c')](handleError(_0x5a21ff,null));};exports['show']=function(_0x4b6ec4,_0xc925c3){var _0x800a39={'raw':![],'where':{'id':_0x4b6ec4[_0xb7b9('0x3d')]['id']}},_0x278e72={};_0x278e72[_0xb7b9('0x28')]=_[_0xb7b9('0x24')](db['Schedule']['rawAttributes']);_0x278e72['query']=_['keys'](_0x4b6ec4[_0xb7b9('0x25')]);_0x278e72[_0xb7b9('0x26')]=_['intersection'](_0x278e72[_0xb7b9('0x28')],_0x278e72['query']);_0x800a39[_0xb7b9('0x29')]=_[_0xb7b9('0x27')](_0x278e72[_0xb7b9('0x28')],qs[_0xb7b9('0x2a')](_0x4b6ec4[_0xb7b9('0x25')][_0xb7b9('0x2a')]));_0x800a39[_0xb7b9('0x29')]=_0x800a39['attributes'][_0xb7b9('0x2b')]?_0x800a39[_0xb7b9('0x29')]:_0x278e72[_0xb7b9('0x28')];if(_0x4b6ec4[_0xb7b9('0x25')][_0xb7b9('0x39')]){_0x800a39[_0xb7b9('0x3a')]=[{'all':!![]}];}_0x800a39=_[_0xb7b9('0x32')]({},_0x800a39,_0x4b6ec4[_0xb7b9('0x38')]);return db[_0xb7b9('0x23')][_0xb7b9('0x3e')](_0x800a39)[_0xb7b9('0x1d')](handleEntityNotFound(_0xc925c3,null))[_0xb7b9('0x1d')](respondWithResult(_0xc925c3,null))[_0xb7b9('0x3c')](handleError(_0xc925c3,null));};exports[_0xb7b9('0x3f')]=function(_0x46b834,_0x317397){return db[_0xb7b9('0x23')]['create'](_0x46b834[_0xb7b9('0x40')],{})[_0xb7b9('0x1d')](function(_0x538ebe){var _0x1db2d4=_0x46b834['user'][_0xb7b9('0x1f')]({'plain':!![]});if(!_0x1db2d4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1db2d4['role']==='user'){var _0x1f241f=_0x538ebe[_0xb7b9('0x1f')]({'plain':!![]});var _0x1979aa='Scheduler';return db[_0xb7b9('0x41')][_0xb7b9('0x3e')]({'where':{'name':_0x1979aa,'userProfileId':_0x1db2d4['userProfileId']},'raw':!![]})['then'](function(_0x497c0a){if(_0x497c0a&&_0x497c0a[_0xb7b9('0x42')]===0x0){return db[_0xb7b9('0x43')][_0xb7b9('0x3f')]({'name':_0x1f241f[_0xb7b9('0x44')],'resourceId':_0x1f241f['id'],'type':_0x497c0a[_0xb7b9('0x44')],'sectionId':_0x497c0a['id']},{})[_0xb7b9('0x1d')](function(){return _0x538ebe;});}else{return _0x538ebe;}})[_0xb7b9('0x3c')](function(_0x478edd){logger[_0xb7b9('0x45')](_0xb7b9('0x46'),_0x478edd);throw _0x478edd;});}return _0x538ebe;})[_0xb7b9('0x1d')](respondWithResult(_0x317397,0xc9))['catch'](handleError(_0x317397,null));};exports['update']=function(_0x26ed19,_0x4c6400){if(_0x26ed19[_0xb7b9('0x40')]['id']){delete _0x26ed19['body']['id'];}return db[_0xb7b9('0x23')][_0xb7b9('0x3e')]({'where':{'id':_0x26ed19['params']['id']}})[_0xb7b9('0x1d')](handleEntityNotFound(_0x4c6400,null))['then'](saveUpdates(_0x26ed19[_0xb7b9('0x40')],null))[_0xb7b9('0x1d')](respondWithResult(_0x4c6400,null))[_0xb7b9('0x3c')](handleError(_0x4c6400,null));};exports['destroy']=function(_0x24dcb0,_0x437d66){return db[_0xb7b9('0x23')][_0xb7b9('0x3e')]({'where':{'id':_0x24dcb0[_0xb7b9('0x3d')]['id']}})['then'](handleEntityNotFound(_0x437d66,null))[_0xb7b9('0x1d')](removeEntity(_0x437d66,null))['catch'](handleError(_0x437d66,null));};exports[_0xb7b9('0x47')]=function(_0x2adc13,_0x1f1c0a,_0x4c7ffa){var _0x55ff5a=require('../../config/schedule');return db[_0xb7b9('0x23')][_0xb7b9('0x3e')]({'where':{'id':_0x2adc13[_0xb7b9('0x3d')]['id']},'raw':!![]})[_0xb7b9('0x1d')](handleEntityNotFound(_0x1f1c0a,null))[_0xb7b9('0x1d')](function(){_0x55ff5a[_0xb7b9('0x47')](_0x2adc13['params']['id']);})[_0xb7b9('0x1d')](respondWithStatusCode(_0x1f1c0a,null))[_0xb7b9('0x3c')](handleError(_0x1f1c0a,null));}; \ No newline at end of file +var _0x0adf=['to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','get','error','name','send','index','Schedule','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','run','../../config/schedule','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x0adf,0x181));var _0xf0ad=function(_0x1b8416,_0x2f8e5a){_0x1b8416=_0x1b8416-0x0;var _0x51ca82=_0x0adf[_0x1b8416];return _0x51ca82;};'use strict';var pdf=require(_0xf0ad('0x0'));var emlformat=require(_0xf0ad('0x1'));var rimraf=require(_0xf0ad('0x2'));var zipdir=require(_0xf0ad('0x3'));var jsonpatch=require(_0xf0ad('0x4'));var rp=require(_0xf0ad('0x5'));var moment=require(_0xf0ad('0x6'));var BPromise=require(_0xf0ad('0x7'));var Mustache=require(_0xf0ad('0x8'));var util=require(_0xf0ad('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xf0ad('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf0ad('0xb'));var squel=require(_0xf0ad('0xc'));var crypto=require(_0xf0ad('0xd'));var jsforce=require(_0xf0ad('0xe'));var deskjs=require(_0xf0ad('0xf'));var toCsv=require(_0xf0ad('0xa'));var querystring=require(_0xf0ad('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf0ad('0x11'));var hardwareService=require(_0xf0ad('0x12'));var logger=require(_0xf0ad('0x13'))(_0xf0ad('0x14'));var utils=require(_0xf0ad('0x15'));var config=require('../../config/environment');var db=require(_0xf0ad('0x16'))['db'];function respondWithStatusCode(_0x3561a1,_0x1d895f){_0x1d895f=_0x1d895f||0xcc;return function(_0x1dc88f){if(_0x1dc88f){return _0x3561a1[_0xf0ad('0x17')](_0x1d895f);}return _0x3561a1[_0xf0ad('0x18')](_0x1d895f)[_0xf0ad('0x19')]();};}function respondWithResult(_0x46c6e0,_0x5d10af){_0x5d10af=_0x5d10af||0xc8;return function(_0x3b18f6){if(_0x3b18f6){return _0x46c6e0[_0xf0ad('0x18')](_0x5d10af)[_0xf0ad('0x1a')](_0x3b18f6);}};}function respondWithFilteredResult(_0x48219b,_0x4a6e42){return function(_0x5f3da7){if(_0x5f3da7){var _0x9ff1a1=_0x5f3da7[_0xf0ad('0x1b')],_0x2a6fa0=_0x4a6e42[_0xf0ad('0x1c')],_0x247ab2=_0x4a6e42[_0xf0ad('0x1c')]+_0x4a6e42[_0xf0ad('0x1d')],_0x5588e2;if(_0x247ab2>=_0x9ff1a1){_0x247ab2=_0x9ff1a1;_0x5588e2=0xc8;}else{_0x5588e2=0xce;}_0x48219b[_0xf0ad('0x18')](_0x5588e2);return _0x48219b['set'](_0xf0ad('0x1e'),_0x2a6fa0+'-'+_0x247ab2+'/'+_0x9ff1a1)[_0xf0ad('0x1a')](_0x5f3da7);}return null;};}function patchUpdates(_0x224436){return function(_0x1f479d){try{jsonpatch[_0xf0ad('0x1f')](_0x1f479d,_0x224436,!![]);}catch(_0x5b5749){return BPromise['reject'](_0x5b5749);}return _0x1f479d[_0xf0ad('0x20')]();};}function saveUpdates(_0x1fa195,_0x16598a){return function(_0x38874a){if(_0x38874a){return _0x38874a[_0xf0ad('0x21')](_0x1fa195)['then'](function(_0x34ed69){return _0x34ed69;});}return null;};}function removeEntity(_0x45fcac,_0xaa9a24){return function(_0x5a34ae){if(_0x5a34ae){return _0x5a34ae['destroy']()[_0xf0ad('0x22')](function(){var _0x3024e2=_0x5a34ae[_0xf0ad('0x23')]({'plain':!![]});var _0x50e338='Scheduler';return db['UserProfileResource']['destroy']({'where':{'type':_0x50e338,'resourceId':_0x3024e2['id']}})[_0xf0ad('0x22')](function(){return _0x5a34ae;});})[_0xf0ad('0x22')](function(){_0x45fcac['status'](0xcc)[_0xf0ad('0x19')]();});}};}function handleEntityNotFound(_0x41acf9,_0x420f14){return function(_0x54ffc8){if(!_0x54ffc8){_0x41acf9[_0xf0ad('0x17')](0x194);}return _0x54ffc8;};}function handleError(_0x4c357f,_0x574e52){_0x574e52=_0x574e52||0x1f4;return function(_0x2adaa5){logger[_0xf0ad('0x24')](_0x2adaa5['stack']);if(_0x2adaa5[_0xf0ad('0x25')]){delete _0x2adaa5[_0xf0ad('0x25')];}_0x4c357f['status'](_0x574e52)[_0xf0ad('0x26')](_0x2adaa5);};}exports[_0xf0ad('0x27')]=function(_0x52fcaf,_0xc77264){var _0x2ac797={},_0x2c1eb3={},_0x55becb={'count':0x0,'rows':[]};var _0x2eef04=db[_0xf0ad('0x28')][_0xf0ad('0x29')];_0x2c1eb3[_0xf0ad('0x2a')]=_[_0xf0ad('0x2b')](_0x2eef04);_0x2c1eb3[_0xf0ad('0x2c')]=_[_0xf0ad('0x2b')](_0x52fcaf[_0xf0ad('0x2c')]);_0x2c1eb3['filters']=_[_0xf0ad('0x2d')](_0x2c1eb3[_0xf0ad('0x2a')],_0x2c1eb3[_0xf0ad('0x2c')]);_0x2ac797[_0xf0ad('0x2e')]=_[_0xf0ad('0x2d')](_0x2c1eb3['model'],qs[_0xf0ad('0x2f')](_0x52fcaf[_0xf0ad('0x2c')]['fields']));_0x2ac797['attributes']=_0x2ac797['attributes'][_0xf0ad('0x30')]?_0x2ac797[_0xf0ad('0x2e')]:_0x2c1eb3['model'];if(!_0x52fcaf[_0xf0ad('0x2c')]['hasOwnProperty'](_0xf0ad('0x31'))){_0x2ac797[_0xf0ad('0x1d')]=qs[_0xf0ad('0x1d')](_0x52fcaf['query']['limit']);_0x2ac797[_0xf0ad('0x1c')]=qs[_0xf0ad('0x1c')](_0x52fcaf[_0xf0ad('0x2c')][_0xf0ad('0x1c')]);}_0x2ac797['order']=qs[_0xf0ad('0x32')](_0x52fcaf[_0xf0ad('0x2c')][_0xf0ad('0x32')]);_0x2ac797[_0xf0ad('0x33')]=qs[_0xf0ad('0x34')](_['pick'](_0x52fcaf[_0xf0ad('0x2c')],_0x2c1eb3[_0xf0ad('0x34')]));if(_0x52fcaf[_0xf0ad('0x2c')][_0xf0ad('0x35')]){_0x2ac797[_0xf0ad('0x33')]=_[_0xf0ad('0x36')](_0x2ac797[_0xf0ad('0x33')],{'$or':_[_0xf0ad('0x37')](_0x2eef04,function(_0x21d9bd){if(_0x21d9bd[_0xf0ad('0x38')][_0xf0ad('0x39')]!==_0xf0ad('0x3a')){var _0x59bf56={};_0x59bf56[_0x21d9bd['field']]={'$like':'%'+_0x52fcaf[_0xf0ad('0x2c')]['filter']+'%'};return _0x59bf56;}})});}_0x2ac797=_[_0xf0ad('0x36')]({},_0x2ac797,_0x52fcaf[_0xf0ad('0x3b')]);var _0x581e6d={'where':_0x2ac797[_0xf0ad('0x33')]};return db[_0xf0ad('0x28')][_0xf0ad('0x1b')](_0x581e6d)[_0xf0ad('0x22')](function(_0x5cc1dd){_0x55becb[_0xf0ad('0x1b')]=_0x5cc1dd;if(_0x52fcaf[_0xf0ad('0x2c')][_0xf0ad('0x3c')]){_0x2ac797[_0xf0ad('0x3d')]=[{'all':!![]}];}return db[_0xf0ad('0x28')][_0xf0ad('0x3e')](_0x2ac797);})[_0xf0ad('0x22')](function(_0x5bf954){_0x55becb[_0xf0ad('0x3f')]=_0x5bf954;return _0x55becb;})['then'](respondWithFilteredResult(_0xc77264,_0x2ac797))[_0xf0ad('0x40')](handleError(_0xc77264,null));};exports['show']=function(_0x13daf1,_0x2f80eb){var _0x509850={'raw':![],'where':{'id':_0x13daf1[_0xf0ad('0x41')]['id']}},_0x4e5c9b={};_0x4e5c9b[_0xf0ad('0x2a')]=_[_0xf0ad('0x2b')](db[_0xf0ad('0x28')]['rawAttributes']);_0x4e5c9b[_0xf0ad('0x2c')]=_[_0xf0ad('0x2b')](_0x13daf1[_0xf0ad('0x2c')]);_0x4e5c9b[_0xf0ad('0x34')]=_[_0xf0ad('0x2d')](_0x4e5c9b[_0xf0ad('0x2a')],_0x4e5c9b[_0xf0ad('0x2c')]);_0x509850[_0xf0ad('0x2e')]=_[_0xf0ad('0x2d')](_0x4e5c9b[_0xf0ad('0x2a')],qs[_0xf0ad('0x2f')](_0x13daf1[_0xf0ad('0x2c')][_0xf0ad('0x2f')]));_0x509850[_0xf0ad('0x2e')]=_0x509850['attributes']['length']?_0x509850[_0xf0ad('0x2e')]:_0x4e5c9b['model'];if(_0x13daf1[_0xf0ad('0x2c')][_0xf0ad('0x3c')]){_0x509850[_0xf0ad('0x3d')]=[{'all':!![]}];}_0x509850=_[_0xf0ad('0x36')]({},_0x509850,_0x13daf1[_0xf0ad('0x3b')]);return db[_0xf0ad('0x28')][_0xf0ad('0x42')](_0x509850)[_0xf0ad('0x22')](handleEntityNotFound(_0x2f80eb,null))[_0xf0ad('0x22')](respondWithResult(_0x2f80eb,null))[_0xf0ad('0x40')](handleError(_0x2f80eb,null));};exports[_0xf0ad('0x43')]=function(_0x190acd,_0x134085){return db[_0xf0ad('0x28')][_0xf0ad('0x43')](_0x190acd[_0xf0ad('0x44')],{})[_0xf0ad('0x22')](function(_0x25c85f){var _0x282a9e=_0x190acd[_0xf0ad('0x45')][_0xf0ad('0x23')]({'plain':!![]});if(!_0x282a9e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x282a9e[_0xf0ad('0x46')]===_0xf0ad('0x45')){var _0x151aaa=_0x25c85f[_0xf0ad('0x23')]({'plain':!![]});var _0x1715f5='Scheduler';return db[_0xf0ad('0x47')]['find']({'where':{'name':_0x1715f5,'userProfileId':_0x282a9e[_0xf0ad('0x48')]},'raw':!![]})[_0xf0ad('0x22')](function(_0x4b166a){if(_0x4b166a&&_0x4b166a[_0xf0ad('0x49')]===0x0){return db[_0xf0ad('0x4a')][_0xf0ad('0x43')]({'name':_0x151aaa[_0xf0ad('0x25')],'resourceId':_0x151aaa['id'],'type':_0x4b166a[_0xf0ad('0x25')],'sectionId':_0x4b166a['id']},{})[_0xf0ad('0x22')](function(){return _0x25c85f;});}else{return _0x25c85f;}})[_0xf0ad('0x40')](function(_0x5e318d){logger[_0xf0ad('0x24')](_0xf0ad('0x4b'),_0x5e318d);throw _0x5e318d;});}return _0x25c85f;})[_0xf0ad('0x22')](respondWithResult(_0x134085,0xc9))[_0xf0ad('0x40')](handleError(_0x134085,null));};exports[_0xf0ad('0x21')]=function(_0x3811d4,_0x2fbd5a){if(_0x3811d4[_0xf0ad('0x44')]['id']){delete _0x3811d4['body']['id'];}return db[_0xf0ad('0x28')][_0xf0ad('0x42')]({'where':{'id':_0x3811d4[_0xf0ad('0x41')]['id']}})[_0xf0ad('0x22')](handleEntityNotFound(_0x2fbd5a,null))[_0xf0ad('0x22')](saveUpdates(_0x3811d4[_0xf0ad('0x44')],null))[_0xf0ad('0x22')](respondWithResult(_0x2fbd5a,null))['catch'](handleError(_0x2fbd5a,null));};exports[_0xf0ad('0x4c')]=function(_0x527f6c,_0x9d4580){return db[_0xf0ad('0x28')]['find']({'where':{'id':_0x527f6c['params']['id']}})[_0xf0ad('0x22')](handleEntityNotFound(_0x9d4580,null))[_0xf0ad('0x22')](removeEntity(_0x9d4580,null))[_0xf0ad('0x40')](handleError(_0x9d4580,null));};exports[_0xf0ad('0x4d')]=function(_0x7fdf43,_0x44b205,_0x434cce){var _0x98994e=require(_0xf0ad('0x4e'));return db[_0xf0ad('0x28')][_0xf0ad('0x42')]({'where':{'id':_0x7fdf43[_0xf0ad('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x44b205,null))[_0xf0ad('0x22')](function(){_0x98994e['run'](_0x7fdf43['params']['id']);})[_0xf0ad('0x22')](respondWithStatusCode(_0x44b205,null))[_0xf0ad('0x40')](handleError(_0x44b205,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index c9d5ffa..4a2fc30 100644 --- a/server/api/schedule/schedule.model.js +++ b/server/api/schedule/schedule.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x218b=['util','../../config/logger','api','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash'];(function(_0x9e7f3a,_0x37105f){var _0x5ab145=function(_0x5b3bad){while(--_0x5b3bad){_0x9e7f3a['push'](_0x9e7f3a['shift']());}};_0x5ab145(++_0x37105f);}(_0x218b,0x78));var _0xb218=function(_0x29990c,_0x21375d){_0x29990c=_0x29990c-0x0;var _0x31adfd=_0x218b[_0x29990c];return _0x31adfd;};'use strict';var _=require(_0xb218('0x0'));var util=require(_0xb218('0x1'));var logger=require(_0xb218('0x2'))(_0xb218('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb218('0x4'));var config=require(_0xb218('0x5'));var attributes=require(_0xb218('0x6'));module[_0xb218('0x7')]=function(_0x3331a2,_0x1974d9){return _0x3331a2[_0xb218('0x8')](_0xb218('0x9'),attributes,{'tableName':_0xb218('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4591=['request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','tools_schedules','lodash','util','../../config/logger','api'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x4591,0xa4));var _0x1459=function(_0x4e25ee,_0x5785d1){_0x4e25ee=_0x4e25ee-0x0;var _0x10a462=_0x4591[_0x4e25ee];return _0x10a462;};'use strict';var _=require(_0x1459('0x0'));var util=require(_0x1459('0x1'));var logger=require(_0x1459('0x2'))(_0x1459('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1459('0x4'));var fs=require('fs');var path=require(_0x1459('0x5'));var rimraf=require(_0x1459('0x6'));var config=require(_0x1459('0x7'));var attributes=require(_0x1459('0x8'));module[_0x1459('0x9')]=function(_0x391fcc,_0x45ff10){return _0x391fcc[_0x1459('0xa')]('Schedule',attributes,{'tableName':_0x1459('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 1d97c4d..1764505 100644 --- a/server/api/schedule/schedule.rpc.js +++ b/server/api/schedule/schedule.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8528=['rpc','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8528,0x1f2));var _0x8852=function(_0x5d293f,_0x21af52){_0x5d293f=_0x5d293f-0x0;var _0x2f87d7=_0x8528[_0x5d293f];return _0x2f87d7;};'use strict';var _=require(_0x8852('0x0'));var util=require(_0x8852('0x1'));var moment=require(_0x8852('0x2'));var BPromise=require('bluebird');var rs=require(_0x8852('0x3'));var fs=require('fs');var Redis=require(_0x8852('0x4'));var db=require(_0x8852('0x5'))['db'];var utils=require(_0x8852('0x6'));var logger=require(_0x8852('0x7'))(_0x8852('0x8'));var config=require(_0x8852('0x9'));var jayson=require(_0x8852('0xa'));var client=jayson[_0x8852('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3480d5,_0x4b9f09,_0x353d90){return new BPromise(function(_0x9a8438,_0x346ae8){return client[_0x8852('0xc')](_0x3480d5,_0x353d90)[_0x8852('0xd')](function(_0xc82f5f){logger[_0x8852('0xe')](_0x8852('0xf'),_0x4b9f09,'request\x20sent');logger[_0x8852('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4b9f09,_0x8852('0x11'),JSON[_0x8852('0x12')](_0xc82f5f));if(_0xc82f5f[_0x8852('0x13')]){if(_0xc82f5f[_0x8852('0x13')]['code']===0x1f4){logger[_0x8852('0x13')](_0x8852('0xf'),_0x4b9f09,_0xc82f5f['error'][_0x8852('0x14')]);return _0x346ae8(_0xc82f5f[_0x8852('0x13')][_0x8852('0x14')]);}logger['error'](_0x8852('0xf'),_0x4b9f09,_0xc82f5f[_0x8852('0x13')][_0x8852('0x14')]);return _0x9a8438(_0xc82f5f[_0x8852('0x13')]['message']);}else{logger[_0x8852('0xe')](_0x8852('0xf'),_0x4b9f09,_0x8852('0x11'));_0x9a8438(_0xc82f5f[_0x8852('0x15')][_0x8852('0x14')]);}})['catch'](function(_0x4a019c){logger[_0x8852('0x13')](_0x8852('0xf'),_0x4b9f09,_0x4a019c);_0x346ae8(_0x4a019c);});});} \ No newline at end of file +var _0xdd20=['http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xdd20,0xbc));var _0x0dd2=function(_0x545cb1,_0x5e73de){_0x545cb1=_0x545cb1-0x0;var _0x2343eb=_0xdd20[_0x545cb1];return _0x2343eb;};'use strict';var _=require(_0x0dd2('0x0'));var util=require(_0x0dd2('0x1'));var moment=require(_0x0dd2('0x2'));var BPromise=require(_0x0dd2('0x3'));var rs=require(_0x0dd2('0x4'));var fs=require('fs');var Redis=require(_0x0dd2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0dd2('0x6'))(_0x0dd2('0x7'));var config=require('../../config/environment');var jayson=require(_0x0dd2('0x8'));var client=jayson[_0x0dd2('0x9')][_0x0dd2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3deab8,_0x1b0eab,_0x164681){return new BPromise(function(_0x5beb00,_0x166ea7){return client[_0x0dd2('0xb')](_0x3deab8,_0x164681)[_0x0dd2('0xc')](function(_0x5df3ab){logger[_0x0dd2('0xd')](_0x0dd2('0xe'),_0x1b0eab,_0x0dd2('0xf'));logger['debug'](_0x0dd2('0x10'),_0x1b0eab,_0x0dd2('0xf'),JSON['stringify'](_0x5df3ab));if(_0x5df3ab[_0x0dd2('0x11')]){if(_0x5df3ab[_0x0dd2('0x11')][_0x0dd2('0x12')]===0x1f4){logger[_0x0dd2('0x11')](_0x0dd2('0xe'),_0x1b0eab,_0x5df3ab[_0x0dd2('0x11')][_0x0dd2('0x13')]);return _0x166ea7(_0x5df3ab[_0x0dd2('0x11')][_0x0dd2('0x13')]);}logger['error'](_0x0dd2('0xe'),_0x1b0eab,_0x5df3ab['error']['message']);return _0x5beb00(_0x5df3ab[_0x0dd2('0x11')][_0x0dd2('0x13')]);}else{logger[_0x0dd2('0xd')](_0x0dd2('0xe'),_0x1b0eab,_0x0dd2('0xf'));_0x5beb00(_0x5df3ab[_0x0dd2('0x14')]['message']);}})[_0x0dd2('0x15')](function(_0x171e37){logger[_0x0dd2('0x11')]('Schedule,\x20%s,\x20%s',_0x1b0eab,_0x171e37);_0x166ea7(_0x171e37);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 7df9a0b..cc43a8e 100644 --- a/server/api/screenRecording/index.js +++ b/server/api/screenRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd274=['../../config/environment','./screenRecording.controller','get','isAuthenticated','/describe','describe','show','/:id/download','download','post','create','put','update','delete','/:id','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1dd82f,_0x52acb7){var _0x353ca4=function(_0x5ee4c9){while(--_0x5ee4c9){_0x1dd82f['push'](_0x1dd82f['shift']());}};_0x353ca4(++_0x52acb7);}(_0xd274,0x170));var _0x4d27=function(_0x46216d,_0x100937){_0x46216d=_0x46216d-0x0;var _0x380f68=_0xd274[_0x46216d];return _0x380f68;};'use strict';var multer=require('multer');var util=require(_0x4d27('0x0'));var path=require(_0x4d27('0x1'));var timeout=require(_0x4d27('0x2'));var express=require(_0x4d27('0x3'));var router=express['Router']();var auth=require(_0x4d27('0x4'));var interaction=require(_0x4d27('0x5'));var config=require(_0x4d27('0x6'));var controller=require(_0x4d27('0x7'));router[_0x4d27('0x8')]('/',auth[_0x4d27('0x9')](),controller['index']);router[_0x4d27('0x8')](_0x4d27('0xa'),auth[_0x4d27('0x9')](),controller[_0x4d27('0xb')]);router[_0x4d27('0x8')]('/:id',auth[_0x4d27('0x9')](),controller[_0x4d27('0xc')]);router[_0x4d27('0x8')](_0x4d27('0xd'),auth[_0x4d27('0x9')](),controller[_0x4d27('0xe')]);router[_0x4d27('0xf')]('/',auth['isAuthenticated'](),controller[_0x4d27('0x10')]);router[_0x4d27('0x11')]('/:id',auth[_0x4d27('0x9')](),controller[_0x4d27('0x12')]);router[_0x4d27('0x13')](_0x4d27('0x14'),auth['isAuthenticated'](),controller[_0x4d27('0x15')]);module['exports']=router; \ No newline at end of file +var _0x15ce=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','/:id/download','download','post','create','put','update','exports','multer','util','path'];(function(_0x1aae67,_0x554c5f){var _0xdcfa99=function(_0x139fe9){while(--_0x139fe9){_0x1aae67['push'](_0x1aae67['shift']());}};_0xdcfa99(++_0x554c5f);}(_0x15ce,0xd5));var _0xe15c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x15ce[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xe15c('0x0'));var util=require(_0xe15c('0x1'));var path=require(_0xe15c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe15c('0x3')]();var auth=require(_0xe15c('0x4'));var interaction=require(_0xe15c('0x5'));var config=require(_0xe15c('0x6'));var controller=require('./screenRecording.controller');router[_0xe15c('0x7')]('/',auth[_0xe15c('0x8')](),controller['index']);router[_0xe15c('0x7')](_0xe15c('0x9'),auth[_0xe15c('0x8')](),controller['describe']);router[_0xe15c('0x7')](_0xe15c('0xa'),auth[_0xe15c('0x8')](),controller['show']);router[_0xe15c('0x7')](_0xe15c('0xb'),auth['isAuthenticated'](),controller[_0xe15c('0xc')]);router[_0xe15c('0xd')]('/',auth['isAuthenticated'](),controller[_0xe15c('0xe')]);router[_0xe15c('0xf')](_0xe15c('0xa'),auth['isAuthenticated'](),controller[_0xe15c('0x10')]);router['delete'](_0xe15c('0xa'),auth[_0xe15c('0x8')](),controller['destroy']);module[_0xe15c('0x11')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 0fa0492..c71795b 100644 --- a/server/api/screenRecording/screenRecording.attributes.js +++ b/server/api/screenRecording/screenRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f62=['exports','VIRTUAL','extname','getDataValue','value','STRING','replace','setDataValue','startedAt','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','moment','../../config/environment'];(function(_0x27a3d1,_0x243a34){var _0x23aeab=function(_0x2cfc5d){while(--_0x2cfc5d){_0x27a3d1['push'](_0x27a3d1['shift']());}};_0x23aeab(++_0x243a34);}(_0x9f62,0x154));var _0x29f6=function(_0x8b0c33,_0x1df11f){_0x8b0c33=_0x8b0c33-0x0;var _0x264587=_0x9f62[_0x8b0c33];return _0x264587;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x29f6('0x0'));var path=require('path');var config=require(_0x29f6('0x1'));module[_0x29f6('0x2')]={'format':{'type':Sequelize[_0x29f6('0x3')],'get':function(){return this['getDataValue']('value')?path[_0x29f6('0x4')](this[_0x29f6('0x5')](_0x29f6('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x29f6('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x29f6('0x7')],'set':function(_0x272876){var _0x9a43fe=_0x272876[_0x29f6('0x8')](/\\/g,'/');this[_0x29f6('0x9')]('value',_0x9a43fe);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x549f64){this[_0x29f6('0x9')](_0x29f6('0xa'),moment()['subtract'](_0x549f64,'ms'));this['setDataValue'](_0x29f6('0xb'),moment());this[_0x29f6('0x9')]('duration',_0x549f64);}},'startedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')]('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0xb')))[_0x29f6('0xd')](_0x29f6('0xe'))[_0x29f6('0xf')]();}},'createdAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0x10')))[_0x29f6('0xd')](_0x29f6('0xe'))[_0x29f6('0xf')]();}},'updatedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0x11')))[_0x29f6('0xd')](_0x29f6('0xe'))['toString']();}}}; \ No newline at end of file +var _0x5c12=['getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','moment','path','exports','VIRTUAL'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0x5c12,0x188));var _0x25c1=function(_0x318256,_0xa773f3){_0x318256=_0x318256-0x0;var _0xb1e352=_0x5c12[_0x318256];return _0xb1e352;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var config=require('../../config/environment');module[_0x25c1('0x2')]={'format':{'type':Sequelize[_0x25c1('0x3')],'get':function(){return this[_0x25c1('0x4')](_0x25c1('0x5'))?path[_0x25c1('0x6')](this[_0x25c1('0x4')](_0x25c1('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x25c1('0x7')]},'value':{'type':Sequelize[_0x25c1('0x7')],'set':function(_0x382922){var _0x4ab674=_0x382922['replace'](/\\/g,'/');this[_0x25c1('0x8')](_0x25c1('0x5'),_0x4ab674);}},'rating':{'type':Sequelize[_0x25c1('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x25c1('0x9')],'set':function(_0xf8363f){this['setDataValue'](_0x25c1('0xa'),moment()[_0x25c1('0xb')](_0xf8363f,'ms'));this[_0x25c1('0x8')](_0x25c1('0xc'),moment());this[_0x25c1('0x8')]('duration',_0xf8363f);}},'startedAt':{'type':Sequelize[_0x25c1('0xd')],'get':function(){return moment(this[_0x25c1('0x4')]('startedAt'))[_0x25c1('0xe')](_0x25c1('0xf'))[_0x25c1('0x10')]();}},'closedAt':{'type':Sequelize[_0x25c1('0xd')],'get':function(){return moment(this['getDataValue']('closedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0x25c1('0x10')]();}},'createdAt':{'type':Sequelize[_0x25c1('0xd')],'get':function(){return moment(this[_0x25c1('0x4')](_0x25c1('0x11')))[_0x25c1('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x25c1('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0x25c1('0xe')](_0x25c1('0xf'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 84711de..e78e4ef 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['params','includeAll','include','find','create','body','update','duration','createdAt','closedAt','value','destroy','describe','download','../../components/encryptor','uniqueid','server/files/screen_recordings','existsSync','secrets','join','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','ScreenRecording','rawAttributes','model','differenceBy','keys','format','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','type','merge','options','findAll','rows','catch'];(function(_0x86f3af,_0x2c079f){var _0x5508dd=function(_0x11e9fe){while(--_0x11e9fe){_0x86f3af['push'](_0x86f3af['shift']());}};_0x5508dd(++_0x2c079f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_[_0x0a9e('0x28')](_0x5bfb33),[_0x0a9e('0x29')]);_0x479bc4[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x33161b['query']);_0x479bc4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x2a')]);_0x384319['attributes']=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x384319[_0x0a9e('0x2e')]=_0x384319[_0x0a9e('0x2e')][_0x0a9e('0x2f')]?_0x384319[_0x0a9e('0x2e')]:_0x479bc4['model'];if(!_0x33161b[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x384319[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x384319['offset']=qs[_0x0a9e('0x18')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x384319[_0x0a9e('0x33')]=qs['filters'](_[_0x0a9e('0x34')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x2b')]));if(_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]){_0x384319[_0x0a9e('0x33')]=_['merge'](_0x384319[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x36')](_0x5bfb33,function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0x37')]['key']!=='VIRTUAL'){var _0x1e8694={};_0x1e8694[_0x1fa90d['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]+'%'};return _0x1e8694;}})});}_0x384319=_[_0x0a9e('0x38')]({},_0x384319,_0x33161b[_0x0a9e('0x39')]);var _0x4f41ae={'where':_0x384319[_0x0a9e('0x33')]};return db[_0x0a9e('0x24')][_0x0a9e('0x17')](_0x4f41ae)['then'](function(_0x1dbf74){_0x45a1e7[_0x0a9e('0x17')]=_0x1dbf74;if(_0x33161b[_0x0a9e('0x2a')]['includeAll']){_0x384319['include']=[{'all':!![]}];}return db[_0x0a9e('0x24')][_0x0a9e('0x3a')](_0x384319);})['then'](function(_0x2b814e){_0x45a1e7[_0x0a9e('0x3b')]=_0x2b814e;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3c')](handleError(_0x526cf3,null));};exports['show']=function(_0x5a594b,_0x15e37d){var _0x45b3d0={'raw':![],'where':{'id':_0x5a594b[_0x0a9e('0x3d')]['id']}},_0x53f3ee={};_0x53f3ee[_0x0a9e('0x26')]=_[_0x0a9e('0x28')](db['ScreenRecording'][_0x0a9e('0x25')]);_0x53f3ee[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x5a594b[_0x0a9e('0x2a')]);_0x53f3ee[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],_0x53f3ee[_0x0a9e('0x2a')]);_0x45b3d0[_0x0a9e('0x2e')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x45b3d0[_0x0a9e('0x2e')]=_0x45b3d0['attributes']['length']?_0x45b3d0[_0x0a9e('0x2e')]:_0x53f3ee[_0x0a9e('0x26')];if(_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x3e')]){_0x45b3d0[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x45b3d0=_[_0x0a9e('0x38')]({},_0x45b3d0,_0x5a594b[_0x0a9e('0x39')]);return db[_0x0a9e('0x24')][_0x0a9e('0x40')](_0x45b3d0)[_0x0a9e('0x1f')](handleEntityNotFound(_0x15e37d,null))[_0x0a9e('0x1f')](respondWithResult(_0x15e37d,null))[_0x0a9e('0x3c')](handleError(_0x15e37d,null));};exports['create']=function(_0x117c99,_0x138b8b){return db[_0x0a9e('0x24')][_0x0a9e('0x41')](_0x117c99[_0x0a9e('0x42')],{})[_0x0a9e('0x1f')](respondWithResult(_0x138b8b,0xc9))[_0x0a9e('0x3c')](handleError(_0x138b8b,null));};exports[_0x0a9e('0x43')]=function(_0x59afe8,_0x2e9d90){if(_0x59afe8['body']['id']){delete _0x59afe8[_0x0a9e('0x42')]['id'];}delete _0x59afe8[_0x0a9e('0x42')][_0x0a9e('0x44')];delete _0x59afe8['body'][_0x0a9e('0x45')];delete _0x59afe8[_0x0a9e('0x42')][_0x0a9e('0x46')];delete _0x59afe8[_0x0a9e('0x42')][_0x0a9e('0x47')];return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'id':_0x59afe8['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x2e9d90,null))[_0x0a9e('0x1f')](saveUpdates(_0x59afe8[_0x0a9e('0x42')],null))[_0x0a9e('0x1f')](respondWithResult(_0x2e9d90,null))[_0x0a9e('0x3c')](handleError(_0x2e9d90,null));};exports[_0x0a9e('0x48')]=function(_0x6054ee,_0x19383e){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x6054ee[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x19383e,null))['then'](removeEntity(_0x19383e,null))['catch'](handleError(_0x19383e,null));};exports['describe']=function(_0x1adfee,_0x4317e3){return db[_0x0a9e('0x24')][_0x0a9e('0x49')]()[_0x0a9e('0x1f')](respondWithResult(_0x4317e3,null))[_0x0a9e('0x3c')](handleError(_0x4317e3,null));};exports[_0x0a9e('0x4a')]=function(_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a=require(_0x0a9e('0x4b'));var _0x204173=![];var _0x14d602={};if(_0x375c18['query'][_0x0a9e('0x37')]&&_0x375c18[_0x0a9e('0x2a')]['type']==='uniqueid'){_0x14d602[_0x0a9e('0x4c')]=_0x375c18['params']['id'];}else{_0x14d602['id']=_0x375c18[_0x0a9e('0x3d')]['id'];}return db['ScreenRecording'][_0x0a9e('0x40')]({'where':_0x14d602,'attributes':['id',_0x0a9e('0x47')],'raw':!![]})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5d38ae,null))['then'](function(_0x2f82da){if(_0x2f82da){var _0x1bf38a=path['join'](config['root'],_0x0a9e('0x4d'),_0x2f82da[_0x0a9e('0x47')]);var _0x49c095=util[_0x0a9e('0x29')]('%s.cypher',_0x1bf38a);if(fs[_0x0a9e('0x4e')](_0x49c095)){_0x204173=!![];return _0x53975a['decryptFile'](_0x49c095,_0x1bf38a,config[_0x0a9e('0x4f')]['recording'])['then'](function(){return _0x2f82da;});}return _0x2f82da;}})['then'](function(_0x2da03c){if(_0x2da03c){var _0x47de4c=path[_0x0a9e('0x50')](config[_0x0a9e('0x51')],_0x0a9e('0x4d'),_0x2da03c[_0x0a9e('0x47')]);if(!fs[_0x0a9e('0x4e')](_0x47de4c)){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}if(_0x2da03c['filename']){return _0x5d38ae[_0x0a9e('0x4a')](_0x47de4c,_0x2da03c[_0x0a9e('0x55')]+path[_0x0a9e('0x56')](_0x47de4c),function(){if(_0x204173){fs[_0x0a9e('0x57')](_0x47de4c);}});}else{return _0x5d38ae[_0x0a9e('0x4a')](_0x47de4c,function(_0x156662){if(_0x204173){fs['unlink'](_0x47de4c);}});}}})[_0x0a9e('0x3c')](function(_0x26bc80){if(_0x26bc80['message']===_0x0a9e('0x54')){_0x5d38ae['status'](0x194)[_0x0a9e('0x22')]('Not\x20found');}else{return handleError(_0x5d38ae,null);}});}; \ No newline at end of file +var _0xa9e0=['params','includeAll','include','find','create','body','update','duration','createdAt','closedAt','value','destroy','describe','download','../../components/encryptor','uniqueid','server/files/screen_recordings','existsSync','secrets','join','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','ScreenRecording','rawAttributes','model','differenceBy','keys','format','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','type','merge','options','findAll','rows','catch'];(function(_0x282527,_0x38cc2d){var _0x1f27da=function(_0x46e340){while(--_0x46e340){_0x282527['push'](_0x282527['shift']());}};_0x1f27da(++_0x38cc2d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_[_0x0a9e('0x28')](_0x5bfb33),[_0x0a9e('0x29')]);_0x479bc4[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x33161b['query']);_0x479bc4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x2a')]);_0x384319['attributes']=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x384319[_0x0a9e('0x2e')]=_0x384319[_0x0a9e('0x2e')][_0x0a9e('0x2f')]?_0x384319[_0x0a9e('0x2e')]:_0x479bc4['model'];if(!_0x33161b[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x384319[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x384319['offset']=qs[_0x0a9e('0x18')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x384319[_0x0a9e('0x33')]=qs['filters'](_[_0x0a9e('0x34')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x2b')]));if(_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]){_0x384319[_0x0a9e('0x33')]=_['merge'](_0x384319[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x36')](_0x5bfb33,function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0x37')]['key']!=='VIRTUAL'){var _0x1e8694={};_0x1e8694[_0x1fa90d['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]+'%'};return _0x1e8694;}})});}_0x384319=_[_0x0a9e('0x38')]({},_0x384319,_0x33161b[_0x0a9e('0x39')]);var _0x4f41ae={'where':_0x384319[_0x0a9e('0x33')]};return db[_0x0a9e('0x24')][_0x0a9e('0x17')](_0x4f41ae)['then'](function(_0x1dbf74){_0x45a1e7[_0x0a9e('0x17')]=_0x1dbf74;if(_0x33161b[_0x0a9e('0x2a')]['includeAll']){_0x384319['include']=[{'all':!![]}];}return db[_0x0a9e('0x24')][_0x0a9e('0x3a')](_0x384319);})['then'](function(_0x2b814e){_0x45a1e7[_0x0a9e('0x3b')]=_0x2b814e;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3c')](handleError(_0x526cf3,null));};exports['show']=function(_0x5a594b,_0x15e37d){var _0x45b3d0={'raw':![],'where':{'id':_0x5a594b[_0x0a9e('0x3d')]['id']}},_0x53f3ee={};_0x53f3ee[_0x0a9e('0x26')]=_[_0x0a9e('0x28')](db['ScreenRecording'][_0x0a9e('0x25')]);_0x53f3ee[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x5a594b[_0x0a9e('0x2a')]);_0x53f3ee[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],_0x53f3ee[_0x0a9e('0x2a')]);_0x45b3d0[_0x0a9e('0x2e')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x45b3d0[_0x0a9e('0x2e')]=_0x45b3d0['attributes']['length']?_0x45b3d0[_0x0a9e('0x2e')]:_0x53f3ee[_0x0a9e('0x26')];if(_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x3e')]){_0x45b3d0[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x45b3d0=_[_0x0a9e('0x38')]({},_0x45b3d0,_0x5a594b[_0x0a9e('0x39')]);return db[_0x0a9e('0x24')][_0x0a9e('0x40')](_0x45b3d0)[_0x0a9e('0x1f')](handleEntityNotFound(_0x15e37d,null))[_0x0a9e('0x1f')](respondWithResult(_0x15e37d,null))[_0x0a9e('0x3c')](handleError(_0x15e37d,null));};exports['create']=function(_0x117c99,_0x138b8b){return db[_0x0a9e('0x24')][_0x0a9e('0x41')](_0x117c99[_0x0a9e('0x42')],{})[_0x0a9e('0x1f')](respondWithResult(_0x138b8b,0xc9))[_0x0a9e('0x3c')](handleError(_0x138b8b,null));};exports[_0x0a9e('0x43')]=function(_0x59afe8,_0x2e9d90){if(_0x59afe8['body']['id']){delete _0x59afe8[_0x0a9e('0x42')]['id'];}delete _0x59afe8[_0x0a9e('0x42')][_0x0a9e('0x44')];delete _0x59afe8['body'][_0x0a9e('0x45')];delete _0x59afe8[_0x0a9e('0x42')][_0x0a9e('0x46')];delete _0x59afe8[_0x0a9e('0x42')][_0x0a9e('0x47')];return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'id':_0x59afe8['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x2e9d90,null))[_0x0a9e('0x1f')](saveUpdates(_0x59afe8[_0x0a9e('0x42')],null))[_0x0a9e('0x1f')](respondWithResult(_0x2e9d90,null))[_0x0a9e('0x3c')](handleError(_0x2e9d90,null));};exports[_0x0a9e('0x48')]=function(_0x6054ee,_0x19383e){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x6054ee[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x19383e,null))['then'](removeEntity(_0x19383e,null))['catch'](handleError(_0x19383e,null));};exports['describe']=function(_0x1adfee,_0x4317e3){return db[_0x0a9e('0x24')][_0x0a9e('0x49')]()[_0x0a9e('0x1f')](respondWithResult(_0x4317e3,null))[_0x0a9e('0x3c')](handleError(_0x4317e3,null));};exports[_0x0a9e('0x4a')]=function(_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a=require(_0x0a9e('0x4b'));var _0x204173=![];var _0x14d602={};if(_0x375c18['query'][_0x0a9e('0x37')]&&_0x375c18[_0x0a9e('0x2a')]['type']==='uniqueid'){_0x14d602[_0x0a9e('0x4c')]=_0x375c18['params']['id'];}else{_0x14d602['id']=_0x375c18[_0x0a9e('0x3d')]['id'];}return db['ScreenRecording'][_0x0a9e('0x40')]({'where':_0x14d602,'attributes':['id',_0x0a9e('0x47')],'raw':!![]})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5d38ae,null))['then'](function(_0x2f82da){if(_0x2f82da){var _0x1bf38a=path['join'](config['root'],_0x0a9e('0x4d'),_0x2f82da[_0x0a9e('0x47')]);var _0x49c095=util[_0x0a9e('0x29')]('%s.cypher',_0x1bf38a);if(fs[_0x0a9e('0x4e')](_0x49c095)){_0x204173=!![];return _0x53975a['decryptFile'](_0x49c095,_0x1bf38a,config[_0x0a9e('0x4f')]['recording'])['then'](function(){return _0x2f82da;});}return _0x2f82da;}})['then'](function(_0x2da03c){if(_0x2da03c){var _0x47de4c=path[_0x0a9e('0x50')](config[_0x0a9e('0x51')],_0x0a9e('0x4d'),_0x2da03c[_0x0a9e('0x47')]);if(!fs[_0x0a9e('0x4e')](_0x47de4c)){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}if(_0x2da03c['filename']){return _0x5d38ae[_0x0a9e('0x4a')](_0x47de4c,_0x2da03c[_0x0a9e('0x55')]+path[_0x0a9e('0x56')](_0x47de4c),function(){if(_0x204173){fs[_0x0a9e('0x57')](_0x47de4c);}});}else{return _0x5d38ae[_0x0a9e('0x4a')](_0x47de4c,function(_0x156662){if(_0x204173){fs['unlink'](_0x47de4c);}});}}})[_0x0a9e('0x3c')](function(_0x26bc80){if(_0x26bc80['message']===_0x0a9e('0x54')){_0x5d38ae['status'](0x194)[_0x0a9e('0x22')]('Not\x20found');}else{return handleError(_0x5d38ae,null);}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 8e63c98..1138137 100644 --- a/server/api/screenRecording/screenRecording.model.js +++ b/server/api/screenRecording/screenRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bb3=['files','existsSync','log','catch','resolve','finally','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','screen_recordings','interactionid','isNil','value','root','server'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x9bb3,0x74));var _0x39bb=function(_0x2ffa78,_0x538f2b){_0x2ffa78=_0x2ffa78-0x0;var _0x278ae2=_0x9bb3[_0x2ffa78];return _0x278ae2;};'use strict';var _=require(_0x39bb('0x0'));var util=require(_0x39bb('0x1'));var logger=require(_0x39bb('0x2'))(_0x39bb('0x3'));var moment=require(_0x39bb('0x4'));var BPromise=require('bluebird');var rp=require(_0x39bb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39bb('0x6'));var config=require(_0x39bb('0x7'));var attributes=require(_0x39bb('0x8'));module[_0x39bb('0x9')]=function(_0x2c86b2,_0x2ecf58){return _0x2c86b2['define']('ScreenRecording',attributes,{'tableName':_0x39bb('0xa'),'paranoid':![],'indexes':[{'name':_0x39bb('0xb'),'fields':['interactionid']}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x242773,_0x1adae7,_0x23a227){return new BPromise(function(_0x16b768,_0x159c6b){if(!_[_0x39bb('0xc')](_0x242773[_0x39bb('0xd')])){var _0x14e865=path['join'](config[_0x39bb('0xe')],_0x39bb('0xf'),_0x39bb('0x10'),'screen_recordings',_0x242773[_0x39bb('0xd')]);if(fs[_0x39bb('0x11')](_0x14e865)){rimraf(_0x14e865,function(_0x1d05af){if(_0x1d05af){console[_0x39bb('0x12')](_0x1d05af);}});}}_0x16b768();})[_0x39bb('0x13')](function(_0x426ca9){BPromise[_0x39bb('0x14')]();})[_0x39bb('0x15')](function(){_0x23a227();});}}});}; \ No newline at end of file +var _0xe3b5=['catch','resolve','finally','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','define','interactionid','isNil','join','root','server','files','screen_recordings','value','existsSync'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3b5,0x1a1));var _0x5e3b=function(_0x5b07aa,_0x3a70d9){_0x5b07aa=_0x5b07aa-0x0;var _0x575340=_0xe3b5[_0x5b07aa];return _0x575340;};'use strict';var _=require('lodash');var util=require(_0x5e3b('0x0'));var logger=require(_0x5e3b('0x1'))(_0x5e3b('0x2'));var moment=require(_0x5e3b('0x3'));var BPromise=require(_0x5e3b('0x4'));var rp=require(_0x5e3b('0x5'));var fs=require('fs');var path=require(_0x5e3b('0x6'));var rimraf=require(_0x5e3b('0x7'));var config=require(_0x5e3b('0x8'));var attributes=require(_0x5e3b('0x9'));module['exports']=function(_0x242ff2,_0x44032d){return _0x242ff2[_0x5e3b('0xa')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x5e3b('0xb'),'fields':[_0x5e3b('0xb')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x415416,_0x380c9f,_0x2e2e11){return new BPromise(function(_0x3433a5,_0x110edb){if(!_[_0x5e3b('0xc')](_0x415416['value'])){var _0x58f516=path[_0x5e3b('0xd')](config[_0x5e3b('0xe')],_0x5e3b('0xf'),_0x5e3b('0x10'),_0x5e3b('0x11'),_0x415416[_0x5e3b('0x12')]);if(fs[_0x5e3b('0x13')](_0x58f516)){rimraf(_0x58f516,function(_0x4015a3){if(_0x4015a3){console['log'](_0x4015a3);}});}}_0x3433a5();})[_0x5e3b('0x14')](function(_0x48f8af){BPromise[_0x5e3b('0x15')]();})[_0x5e3b('0x16')](function(){_0x2e2e11();});}}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index e650af8..54ae0d1 100644 --- a/server/api/screenRecording/screenRecording.rpc.js +++ b/server/api/screenRecording/screenRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17e580,_0x5823b5){var _0x3a1542=function(_0x2887d3){while(--_0x2887d3){_0x17e580['push'](_0x17e580['shift']());}};_0x3a1542(++_0x5823b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xd87467,_0x11f0eb){var _0x2c897d=function(_0x59f683){while(--_0x59f683){_0xd87467['push'](_0xd87467['shift']());}};_0x2c897d(++_0x11f0eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 2759c12..54d8c7d 100644 --- a/server/api/setting/index.js +++ b/server/api/setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e32=['file','%s%s','addPreferred','favicon','addFavicon','put','isAuthenticated','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','/:id/logo','getLogo','get','/:id/logo_login','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','logo','extname','originalname','post','single','addLogo','join'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x3e32,0x139));var _0x23e3=function(_0x597c6b,_0xf4530d){_0x597c6b=_0x597c6b-0x0;var _0x5bf68a=_0x3e32[_0x597c6b];return _0x5bf68a;};'use strict';var multer=require('multer');var util=require(_0x23e3('0x0'));var path=require(_0x23e3('0x1'));var timeout=require(_0x23e3('0x2'));var express=require(_0x23e3('0x3'));var router=express[_0x23e3('0x4')]();var auth=require(_0x23e3('0x5'));var interaction=require(_0x23e3('0x6'));var config=require(_0x23e3('0x7'));var controller=require('./setting.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x23e3('0x8'),controller[_0x23e3('0x9')]);router['get'](_0x23e3('0xa'),controller[_0x23e3('0xb')]);router[_0x23e3('0xc')](_0x23e3('0xd'),controller['getLogoLogin']);router[_0x23e3('0xc')]('/:id/gdpr',controller['gdpr']);router[_0x23e3('0xc')](_0x23e3('0xe'),controller[_0x23e3('0xf')]);router[_0x23e3('0xc')](_0x23e3('0x10'),controller[_0x23e3('0x11')]);var upload=multer({'storage':multer[_0x23e3('0x12')]({'destination':function(_0x534095,_0x5509a9,_0x52c916){_0x52c916(null,path['join'](config[_0x23e3('0x13')],_0x23e3('0x14')));},'filename':function(_0x2177d6,_0x44c903,_0x112b66){_0x112b66(null,util[_0x23e3('0x15')]('%s%s',_0x23e3('0x16'),path[_0x23e3('0x17')](_0x44c903[_0x23e3('0x18')])));}})});router[_0x23e3('0x19')]('/:id/logo',upload[_0x23e3('0x1a')]('file'),controller[_0x23e3('0x1b')]);var upload=multer({'storage':multer[_0x23e3('0x12')]({'destination':function(_0x3ebe1b,_0x318f43,_0x43f0b8){_0x43f0b8(null,path[_0x23e3('0x1c')](config[_0x23e3('0x13')],_0x23e3('0x14')));},'filename':function(_0x32c2b3,_0x52a9ee,_0x439d0f){_0x439d0f(null,util['format']('%s%s','logologin',path['extname'](_0x52a9ee[_0x23e3('0x18')])));}})});router[_0x23e3('0x19')](_0x23e3('0xd'),upload[_0x23e3('0x1a')](_0x23e3('0x1d')),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x521889,_0x49f3d1,_0x2792da){_0x2792da(null,path[_0x23e3('0x1c')](config[_0x23e3('0x13')],_0x23e3('0x14')));},'filename':function(_0xc08b98,_0x13730d,_0x3ac84e){_0x3ac84e(null,util['format'](_0x23e3('0x1e'),'preferred',path[_0x23e3('0x17')](_0x13730d[_0x23e3('0x18')])));}})});router[_0x23e3('0x19')]('/:id/preferred',upload[_0x23e3('0x1a')](_0x23e3('0x1d')),controller[_0x23e3('0x1f')]);var upload=multer({'storage':multer[_0x23e3('0x12')]({'destination':function(_0xef861d,_0x21cc60,_0x5d3502){_0x5d3502(null,path[_0x23e3('0x1c')](config[_0x23e3('0x13')],_0x23e3('0x14')));},'filename':function(_0x364c9b,_0x581128,_0x525ee1){_0x525ee1(null,util[_0x23e3('0x15')](_0x23e3('0x1e'),_0x23e3('0x20'),path['extname'](_0x581128[_0x23e3('0x18')])));}})});router[_0x23e3('0x19')](_0x23e3('0x10'),upload[_0x23e3('0x1a')](_0x23e3('0x1d')),controller[_0x23e3('0x21')]);router[_0x23e3('0x22')]('/:id',auth[_0x23e3('0x23')](),controller[_0x23e3('0x24')]);module[_0x23e3('0x25')]=router; \ No newline at end of file +var _0xefc4=['isAuthenticated','index','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','file','post','addLogoLogin','preferred','addPreferred','addFavicon','update','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./setting.controller','get'];(function(_0x55fbb2,_0x2a7559){var _0x49612c=function(_0x3233ab){while(--_0x3233ab){_0x55fbb2['push'](_0x55fbb2['shift']());}};_0x49612c(++_0x2a7559);}(_0xefc4,0xe7));var _0x4efc=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0xefc4[_0x4defd6];return _0x4c9276;};'use strict';var multer=require(_0x4efc('0x0'));var util=require('util');var path=require(_0x4efc('0x1'));var timeout=require(_0x4efc('0x2'));var express=require(_0x4efc('0x3'));var router=express[_0x4efc('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4efc('0x5'));var config=require(_0x4efc('0x6'));var controller=require(_0x4efc('0x7'));router[_0x4efc('0x8')]('/',auth[_0x4efc('0x9')](),controller[_0x4efc('0xa')]);router[_0x4efc('0x8')](_0x4efc('0xb'),controller[_0x4efc('0xc')]);router[_0x4efc('0x8')](_0x4efc('0xd'),controller[_0x4efc('0xe')]);router['get'](_0x4efc('0xf'),controller[_0x4efc('0x10')]);router[_0x4efc('0x8')](_0x4efc('0x11'),controller[_0x4efc('0x12')]);router[_0x4efc('0x8')](_0x4efc('0x13'),controller[_0x4efc('0x14')]);router[_0x4efc('0x8')](_0x4efc('0x15'),controller['getFavicon']);var upload=multer({'storage':multer[_0x4efc('0x16')]({'destination':function(_0x89ac58,_0x519680,_0x4e7cc5){_0x4e7cc5(null,path[_0x4efc('0x17')](config[_0x4efc('0x18')],_0x4efc('0x19')));},'filename':function(_0x2a485d,_0x1d1534,_0x35edf5){_0x35edf5(null,util[_0x4efc('0x1a')](_0x4efc('0x1b'),_0x4efc('0x1c'),path[_0x4efc('0x1d')](_0x1d1534[_0x4efc('0x1e')])));}})});router['post']('/:id/logo',upload[_0x4efc('0x1f')](_0x4efc('0x20')),controller['addLogo']);var upload=multer({'storage':multer[_0x4efc('0x16')]({'destination':function(_0x1064ae,_0xa51953,_0x28a05b){_0x28a05b(null,path[_0x4efc('0x17')](config['root'],_0x4efc('0x19')));},'filename':function(_0x1da61b,_0x3f935e,_0xdc793d){_0xdc793d(null,util[_0x4efc('0x1a')](_0x4efc('0x1b'),'logologin',path['extname'](_0x3f935e[_0x4efc('0x1e')])));}})});router[_0x4efc('0x21')](_0x4efc('0xf'),upload[_0x4efc('0x1f')]('file'),controller[_0x4efc('0x22')]);var upload=multer({'storage':multer[_0x4efc('0x16')]({'destination':function(_0x404b4f,_0x3ebeaf,_0x1d1d06){_0x1d1d06(null,path['join'](config[_0x4efc('0x18')],_0x4efc('0x19')));},'filename':function(_0x2bc258,_0x172697,_0x1f209f){_0x1f209f(null,util['format'](_0x4efc('0x1b'),_0x4efc('0x23'),path[_0x4efc('0x1d')](_0x172697[_0x4efc('0x1e')])));}})});router[_0x4efc('0x21')]('/:id/preferred',upload[_0x4efc('0x1f')](_0x4efc('0x20')),controller[_0x4efc('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4a1051,_0x5cea29,_0x33cd2d){_0x33cd2d(null,path[_0x4efc('0x17')](config['root'],_0x4efc('0x19')));},'filename':function(_0x44a803,_0x158d86,_0xf40f89){_0xf40f89(null,util[_0x4efc('0x1a')](_0x4efc('0x1b'),'favicon',path[_0x4efc('0x1d')](_0x158d86[_0x4efc('0x1e')])));}})});router['post'](_0x4efc('0x15'),upload[_0x4efc('0x1f')](_0x4efc('0x20')),controller[_0x4efc('0x25')]);router['put'](_0x4efc('0xb'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x26')]);module[_0x4efc('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 5f954d0..120eb03 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9354=['exports','INTEGER','min_mailbox','STRING','BOOLEAN','alternate'];(function(_0x512d31,_0x4f9213){var _0x4bcf59=function(_0x428843){while(--_0x428843){_0x512d31['push'](_0x512d31['shift']());}};_0x4bcf59(++_0x4f9213);}(_0x9354,0x96));var _0x4935=function(_0x5df61d,_0x158640){_0x5df61d=_0x5df61d-0x0;var _0x24cc4c=_0x9354[_0x5df61d];return _0x24cc4c;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'min_internal':{'type':Sequelize[_0x4935('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x4935('0x1')](0xb),'unique':_0x4935('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x4935('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x4935('0x3')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x4935('0x3')]},'defaultLogo':{'type':Sequelize[_0x4935('0x4')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x4935('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0x4935('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x4935('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x4935('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x4935('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x4935('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x4935('0x3')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x4935('0x3')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x4935('0x3')]},'defaultPageTitle':{'type':Sequelize[_0x4935('0x4')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x4935('0x4')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x4935('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x4935('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x4935('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x4935('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x4935('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x4935('0x3')],'defaultValue':_0x4935('0x5')},'chatTimeout':{'type':Sequelize[_0x4935('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x4935('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x4935('0x3')]},'defaultPreferred':{'type':Sequelize[_0x4935('0x4')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x4935('0x4')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x4935('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0x4935('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x4935('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x4935('0x3')]},'defaultFavicon':{'type':Sequelize[_0x4935('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9c00=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x93df90,_0x50eb31){var _0x3fd97d=function(_0x2d92ea){while(--_0x2d92ea){_0x93df90['push'](_0x93df90['shift']());}};_0x3fd97d(++_0x50eb31);}(_0x9c00,0x1a0));var _0x09c0=function(_0x4c24d2,_0x33b0e3){_0x4c24d2=_0x4c24d2-0x0;var _0x26abf3=_0x9c00[_0x4c24d2];return _0x26abf3;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x09c0('0x2')](0xb),'unique':_0x09c0('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x09c0('0x4')],'defaultValue':_0x09c0('0x5')},'logo':{'type':Sequelize[_0x09c0('0x4')]},'defaultLogo':{'type':Sequelize[_0x09c0('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x09c0('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x09c0('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x09c0('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x09c0('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x09c0('0x4')]},'turnaddr':{'type':Sequelize[_0x09c0('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x09c0('0x4')]},'pageTitle':{'type':Sequelize[_0x09c0('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x09c0('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x09c0('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x09c0('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x09c0('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x09c0('0x4')],'defaultValue':_0x09c0('0x7')},'enableEmailPreview':{'type':Sequelize[_0x09c0('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x09c0('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x09c0('0x4')],'defaultValue':_0x09c0('0x8')},'chatTimeout':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x09c0('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x09c0('0x4')]},'defaultPreferred':{'type':Sequelize[_0x09c0('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x09c0('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x09c0('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x09c0('0x4')]},'defaultFavicon':{'type':Sequelize[_0x09c0('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 69b9864..0f9b673 100644 --- a/server/api/setting/setting.controller.js +++ b/server/api/setting/setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6be9=['VIRTUAL','field','includeAll','include','show','params','find','get','join','server/files/templates/stun.ejs','render','root','server/files/templates/turn.ejs','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','res_rtp_asterisk.so','addLogo','filename','body','logo','file','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','default_logo.png','default','upperFirst','custom','Sequelize','ValidationError','download','../../config/license/util','getLogoLogin','default_loginLogo.png','\x20not\x20found','gdpr','securePassword','addPreferred','defaultLogo','default_preferred.png','getFavicon','default_favicon.ico','html-pdf','eml-format','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','Setting','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type'];(function(_0x4ce1b9,_0x397a4b){var _0x2bb15d=function(_0x3790ad){while(--_0x3790ad){_0x4ce1b9['push'](_0x4ce1b9['shift']());}};_0x2bb15d(++_0x397a4b);}(_0x6be9,0x12f));var _0x96be=function(_0x59f531,_0x39d16a){_0x59f531=_0x59f531-0x0;var _0x1aef80=_0x6be9[_0x59f531];return _0x1aef80;};'use strict';var pdf=require(_0x96be('0x0'));var emlformat=require(_0x96be('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x96be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96be('0x3'));var moment=require('moment');var BPromise=require(_0x96be('0x4'));var Mustache=require('mustache');var util=require(_0x96be('0x5'));var path=require(_0x96be('0x6'));var sox=require('sox');var csv=require(_0x96be('0x7'));var ejs=require(_0x96be('0x8'));var fs=require('fs');var _=require(_0x96be('0x9'));var squel=require('squel');var crypto=require(_0x96be('0xa'));var jsforce=require(_0x96be('0xb'));var deskjs=require(_0x96be('0xc'));var toCsv=require(_0x96be('0x7'));var querystring=require(_0x96be('0xd'));var Papa=require(_0x96be('0xe'));var Redis=require(_0x96be('0xf'));var authService=require(_0x96be('0x10'));var qs=require(_0x96be('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x96be('0x12'));var config=require(_0x96be('0x13'));var db=require(_0x96be('0x14'))['db'];var jayson=require(_0x96be('0x15'));var client=jayson['client'][_0x96be('0x16')]({'port':0x232a});function checkPasswordPattern(_0x27ecc3,_0x5485bc,_0x3a46c1){if(_0x3a46c1){var _0x138070=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x138070[_0x96be('0x17')](_0x5485bc)){return _0x27ecc3;}else{throw new Error(_0x96be('0x18'));}}else{return _0x27ecc3;}}function respondWithRpcPromise(_0xb96493,_0x2cbe67,_0x4dd6de,_0x20deb){return new BPromise(function(_0x185041,_0x10fcee){var _0x51c109=_0x20deb||client;return _0x51c109[_0x96be('0x19')](_0xb96493,_0x4dd6de)[_0x96be('0x1a')](function(_0xa2e4df){logger[_0x96be('0x1b')](_0x96be('0x1c'),_0x2cbe67,'request\x20sent');logger['debug'](_0x96be('0x1d'),_0x2cbe67,_0x96be('0x1e'),JSON[_0x96be('0x1f')](_0xa2e4df));if(_0xa2e4df[_0x96be('0x20')]){if(_0xa2e4df[_0x96be('0x20')][_0x96be('0x21')]===0x1f4){logger[_0x96be('0x20')]('Setting,\x20%s,\x20%s',_0x2cbe67,_0xa2e4df[_0x96be('0x20')]['message']);return _0x10fcee(_0xa2e4df[_0x96be('0x20')]['message']);}logger[_0x96be('0x20')](_0x96be('0x1c'),_0x2cbe67,_0xa2e4df['error']['message']);return _0x185041(_0xa2e4df[_0x96be('0x20')][_0x96be('0x22')]);}else{logger[_0x96be('0x1b')](_0x96be('0x1c'),_0x2cbe67,'request\x20sent');_0x185041(_0xa2e4df['result'][_0x96be('0x22')]);}})[_0x96be('0x23')](function(_0x4d77f7){logger[_0x96be('0x20')](_0x96be('0x1c'),_0x2cbe67,_0x4d77f7);_0x10fcee(_0x4d77f7);});});}function respondWithStatusCode(_0x2a6f26,_0x4c2794){_0x4c2794=_0x4c2794||0xcc;return function(_0x2e4bf2){if(_0x2e4bf2){return _0x2a6f26[_0x96be('0x24')](_0x4c2794);}return _0x2a6f26[_0x96be('0x25')](_0x4c2794)[_0x96be('0x26')]();};}function respondWithResult(_0x29030a,_0x2197e0){_0x2197e0=_0x2197e0||0xc8;return function(_0x67ec14){if(_0x67ec14){return _0x29030a[_0x96be('0x25')](_0x2197e0)[_0x96be('0x27')](_0x67ec14);}};}function respondWithFilteredResult(_0x58e11c,_0x31a48c){return function(_0x5cb3ea){if(_0x5cb3ea){var _0x2264b5=_0x5cb3ea[_0x96be('0x28')],_0x289555=_0x31a48c[_0x96be('0x29')],_0x304706=_0x31a48c['offset']+_0x31a48c[_0x96be('0x2a')],_0x23e946;if(_0x304706>=_0x2264b5){_0x304706=_0x2264b5;_0x23e946=0xc8;}else{_0x23e946=0xce;}_0x58e11c['status'](_0x23e946);return _0x58e11c[_0x96be('0x2b')](_0x96be('0x2c'),_0x289555+'-'+_0x304706+'/'+_0x2264b5)['json'](_0x5cb3ea);}return null;};}function patchUpdates(_0x30d9d4){return function(_0x4be64d){try{jsonpatch[_0x96be('0x2d')](_0x4be64d,_0x30d9d4,!![]);}catch(_0x4b5a35){return BPromise[_0x96be('0x2e')](_0x4b5a35);}return _0x4be64d[_0x96be('0x2f')]();};}function saveUpdates(_0x37738e,_0x241864){return function(_0x11568e){if(_0x11568e){return _0x11568e[_0x96be('0x30')](_0x37738e)[_0x96be('0x1a')](function(_0x5e4c85){return _0x5e4c85;});}return null;};}function removeEntity(_0x391083,_0x58b751){return function(_0x540f84){if(_0x540f84){return _0x540f84[_0x96be('0x31')]()[_0x96be('0x1a')](function(){_0x391083[_0x96be('0x25')](0xcc)[_0x96be('0x26')]();});}};}function handleEntityNotFound(_0x2f71b8,_0x593be4){return function(_0x3ff6cb){if(!_0x3ff6cb){_0x2f71b8['sendStatus'](0x194);}return _0x3ff6cb;};}function handleError(_0x5e033d,_0x302d21){_0x302d21=_0x302d21||0x1f4;return function(_0x55b872){logger['error'](_0x55b872[_0x96be('0x32')]);if(_0x55b872[_0x96be('0x33')]){delete _0x55b872[_0x96be('0x33')];}_0x5e033d[_0x96be('0x25')](_0x302d21)[_0x96be('0x34')](_0x55b872);};}exports[_0x96be('0x35')]=function(_0x158c2d,_0x1afc83){var _0x4c0282={},_0x28b055={},_0x3dbe39={'count':0x0,'rows':[]};var _0x4f53b2=db[_0x96be('0x36')][_0x96be('0x37')];_0x28b055[_0x96be('0x38')]=_['keys'](_0x4f53b2);_0x28b055['query']=_[_0x96be('0x39')](_0x158c2d[_0x96be('0x3a')]);_0x28b055[_0x96be('0x3b')]=_[_0x96be('0x3c')](_0x28b055[_0x96be('0x38')],_0x28b055[_0x96be('0x3a')]);_0x4c0282['attributes']=_[_0x96be('0x3c')](_0x28b055[_0x96be('0x38')],qs['fields'](_0x158c2d['query'][_0x96be('0x3d')]));_0x4c0282[_0x96be('0x3e')]=_0x4c0282['attributes'][_0x96be('0x3f')]?_0x4c0282[_0x96be('0x3e')]:_0x28b055[_0x96be('0x38')];if(!_0x158c2d[_0x96be('0x3a')]['hasOwnProperty'](_0x96be('0x40'))){_0x4c0282[_0x96be('0x2a')]=qs['limit'](_0x158c2d[_0x96be('0x3a')][_0x96be('0x2a')]);_0x4c0282['offset']=qs['offset'](_0x158c2d['query'][_0x96be('0x29')]);}_0x4c0282[_0x96be('0x41')]=qs['sort'](_0x158c2d[_0x96be('0x3a')][_0x96be('0x42')]);_0x4c0282[_0x96be('0x43')]=qs['filters'](_[_0x96be('0x44')](_0x158c2d['query'],_0x28b055['filters']));if(_0x158c2d['query'][_0x96be('0x45')]){_0x4c0282['where']=_[_0x96be('0x46')](_0x4c0282['where'],{'$or':_['map'](_0x4f53b2,function(_0xa28e01){if(_0xa28e01[_0x96be('0x47')]['key']!==_0x96be('0x48')){var _0x18feed={};_0x18feed[_0xa28e01[_0x96be('0x49')]]={'$like':'%'+_0x158c2d[_0x96be('0x3a')][_0x96be('0x45')]+'%'};return _0x18feed;}})});}_0x4c0282=_['merge']({},_0x4c0282,_0x158c2d['options']);var _0x35e94a={'where':_0x4c0282[_0x96be('0x43')]};return db[_0x96be('0x36')][_0x96be('0x28')](_0x35e94a)[_0x96be('0x1a')](function(_0x39c1d4){_0x3dbe39['count']=_0x39c1d4;if(_0x158c2d[_0x96be('0x3a')][_0x96be('0x4a')]){_0x4c0282[_0x96be('0x4b')]=[{'all':!![]}];}return db[_0x96be('0x36')]['findAll'](_0x4c0282);})[_0x96be('0x1a')](function(_0x451ae8){_0x3dbe39['rows']=_0x451ae8;return _0x3dbe39;})[_0x96be('0x1a')](respondWithFilteredResult(_0x1afc83,_0x4c0282))['catch'](handleError(_0x1afc83,null));};exports[_0x96be('0x4c')]=function(_0x19214f,_0x4d8286){var _0x40f896={'raw':![],'where':{'id':_0x19214f[_0x96be('0x4d')]['id']}},_0x53305e={};_0x53305e[_0x96be('0x38')]=_[_0x96be('0x39')](db[_0x96be('0x36')][_0x96be('0x37')]);_0x53305e['query']=_['keys'](_0x19214f[_0x96be('0x3a')]);_0x53305e[_0x96be('0x3b')]=_['intersection'](_0x53305e[_0x96be('0x38')],_0x53305e[_0x96be('0x3a')]);_0x40f896[_0x96be('0x3e')]=_['intersection'](_0x53305e[_0x96be('0x38')],qs[_0x96be('0x3d')](_0x19214f['query'][_0x96be('0x3d')]));_0x40f896[_0x96be('0x3e')]=_0x40f896[_0x96be('0x3e')]['length']?_0x40f896[_0x96be('0x3e')]:_0x53305e[_0x96be('0x38')];if(_0x19214f[_0x96be('0x3a')][_0x96be('0x4a')]){_0x40f896[_0x96be('0x4b')]=[{'all':!![]}];}_0x40f896=_[_0x96be('0x46')]({},_0x40f896,_0x19214f['options']);return db[_0x96be('0x36')][_0x96be('0x4e')](_0x40f896)[_0x96be('0x1a')](handleEntityNotFound(_0x4d8286,null))[_0x96be('0x1a')](respondWithResult(_0x4d8286,null))[_0x96be('0x23')](handleError(_0x4d8286,null));};exports[_0x96be('0x30')]=function(_0x49aecb,_0x18b4b7,_0x27549d){var _0x2475bf;return db[_0x96be('0x36')][_0x96be('0x4e')]({'where':{'id':_0x49aecb['params']['id']}})[_0x96be('0x1a')](handleEntityNotFound(_0x18b4b7,null))[_0x96be('0x1a')](saveUpdates(_0x49aecb['body'],null))[_0x96be('0x1a')](function(_0x244a8c){if(_0x244a8c){_0x2475bf=_0x244a8c[_0x96be('0x4f')]({'plain':!![]});var _0x5812d3=fs['readFileSync'](path[_0x96be('0x50')](config['root'],_0x96be('0x51')),'utf8');var _0x3c4b04=ejs[_0x96be('0x52')](_0x5812d3,_0x2475bf);var _0x5d3571=fs['readFileSync'](path['join'](config[_0x96be('0x53')],_0x96be('0x54')),_0x96be('0x55'));var _0x76bd0c=ejs['render'](_0x5d3571,_0x2475bf);fs[_0x96be('0x56')]('/etc/asterisk/stun_xcally.conf',_0x3c4b04);fs[_0x96be('0x56')](_0x96be('0x57'),_0x76bd0c);return respondWithRpcPromise(_0x96be('0x58'),'update',{'module':'res_stun_monitor.so'});}})[_0x96be('0x1a')](function(){return respondWithRpcPromise('Reload',_0x96be('0x30'),{'module':_0x96be('0x59')});})['then'](function(){return _0x2475bf||null;})[_0x96be('0x1a')](respondWithResult(_0x18b4b7,null))[_0x96be('0x23')](handleError(_0x18b4b7,null));};exports[_0x96be('0x5a')]=function(_0x420856,_0x5b0cd1,_0x21a574){if(_0x420856['file']&&_0x420856['file'][_0x96be('0x5b')]){_0x420856[_0x96be('0x5c')][_0x96be('0x5d')]=_0x420856[_0x96be('0x5e')]['filename'];}return db[_0x96be('0x36')]['find']({'where':{'id':_0x420856[_0x96be('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5b0cd1,null))[_0x96be('0x1a')](saveUpdates(_0x420856[_0x96be('0x5c')],null))[_0x96be('0x1a')](respondWithResult(_0x5b0cd1,null))[_0x96be('0x23')](handleError(_0x5b0cd1,null));};exports[_0x96be('0x5f')]=function(_0x2863d8,_0x406777,_0x185372){if(_0x2863d8[_0x96be('0x5e')]&&_0x2863d8[_0x96be('0x5e')][_0x96be('0x5b')]){_0x2863d8[_0x96be('0x5c')][_0x96be('0x60')]=_0x2863d8[_0x96be('0x5e')][_0x96be('0x5b')];}return db[_0x96be('0x36')][_0x96be('0x4e')]({'where':{'id':_0x2863d8[_0x96be('0x4d')]['id']}})['then'](handleEntityNotFound(_0x406777,null))[_0x96be('0x1a')](saveUpdates(_0x2863d8[_0x96be('0x5c')],null))['then'](respondWithResult(_0x406777,null))[_0x96be('0x23')](handleError(_0x406777,null));};var utilLicense=require('../../config/license/util');exports[_0x96be('0x61')]=function(_0xd254eb,_0x3cbe95,_0x1b0cd1){var _0x5745e8=_0x96be('0x62');var _0x4f93ad={'custom':![]};return utilLicense[_0x96be('0x63')]()[_0x96be('0x1a')](function(_0x4ab122){if(_0x4ab122){_0x4f93ad=_0x4ab122;}return db[_0x96be('0x36')][_0x96be('0x4e')]({'where':{'id':_0xd254eb[_0x96be('0x4d')]['id']},'attributes':['logo',_0x96be('0x60'),_0x96be('0x64'),_0x96be('0x65'),'defaultLogo',_0x96be('0x66'),_0x96be('0x67'),_0x96be('0x68')],'raw':!![]});})[_0x96be('0x1a')](handleEntityNotFound(_0x3cbe95,null))['then'](function(_0x3b18ba){if(_0x3b18ba){var _0x1d6a79=_0x3b18ba['logo']&&fs[_0x96be('0x69')](path[_0x96be('0x50')](config[_0x96be('0x53')],_0x5745e8,_[_0x96be('0x6a')](_0x3b18ba[_0x96be('0x5d')])))?path['join'](config['root'],_0x5745e8,_[_0x96be('0x6a')](_0x3b18ba[_0x96be('0x5d')])):path[_0x96be('0x50')](config['root'],_0x5745e8,_[_0x96be('0x6a')](_0x96be('0x6b')));var _0x4a5926=_0x96be('0x6c')+_[_0x96be('0x6d')](_0x96be('0x5d'));if(_0x3b18ba[_0x4a5926]||!_0x4f93ad[_0x96be('0x6e')]){_0x1d6a79=path[_0x96be('0x50')](config['root'],_0x5745e8,_[_0x96be('0x6a')]('default_logo.png'));}if(!fs[_0x96be('0x69')](_0x1d6a79)){throw new db[(_0x96be('0x6f'))][(_0x96be('0x70'))](_[_0x96be('0x6d')](_0x96be('0x5d'))+'\x20not\x20found');}return _0x3cbe95[_0x96be('0x71')](_0x1d6a79);}})[_0x96be('0x23')](handleError(_0x3cbe95,null));};var utilLicense=require(_0x96be('0x72'));exports[_0x96be('0x73')]=function(_0x4c5c63,_0x4bf3b6,_0x4719a4){var _0x4868c3=_0x96be('0x62');var _0x56bebc={'custom':![]};return utilLicense[_0x96be('0x63')]()[_0x96be('0x1a')](function(_0x45b657){if(_0x45b657){_0x56bebc=_0x45b657;}return db[_0x96be('0x36')][_0x96be('0x4e')]({'where':{'id':_0x4c5c63[_0x96be('0x4d')]['id']},'attributes':['logo','loginLogo',_0x96be('0x64'),_0x96be('0x65'),'defaultLogo',_0x96be('0x66'),'defaultPreferred',_0x96be('0x68')],'raw':!![]});})[_0x96be('0x1a')](handleEntityNotFound(_0x4bf3b6,null))['then'](function(_0x16bdca){if(_0x16bdca){var _0x4e0995=_0x16bdca[_0x96be('0x60')]&&fs[_0x96be('0x69')](path['join'](config[_0x96be('0x53')],_0x4868c3,_[_0x96be('0x6a')](_0x16bdca['loginLogo'])))?path[_0x96be('0x50')](config[_0x96be('0x53')],_0x4868c3,_[_0x96be('0x6a')](_0x16bdca[_0x96be('0x60')])):path['join'](config[_0x96be('0x53')],_0x4868c3,_[_0x96be('0x6a')](_0x96be('0x74')));var _0x109281=_0x96be('0x6c')+_[_0x96be('0x6d')]('loginLogo');if(_0x16bdca[_0x109281]||!_0x56bebc[_0x96be('0x6e')]){_0x4e0995=path[_0x96be('0x50')](config[_0x96be('0x53')],_0x4868c3,_[_0x96be('0x6a')]('default_loginLogo.png'));}if(!fs['existsSync'](_0x4e0995)){throw new db[(_0x96be('0x6f'))][(_0x96be('0x70'))](_[_0x96be('0x6d')](_0x96be('0x60'))+_0x96be('0x75'));}return _0x4bf3b6[_0x96be('0x71')](_0x4e0995);}})[_0x96be('0x23')](handleError(_0x4bf3b6,null));};exports[_0x96be('0x76')]=function(_0x3afd72,_0x2e8d94){return db['Setting'][_0x96be('0x4e')]({'where':{'id':_0x3afd72['params']['id']},'attributes':[_0x96be('0x77')]})[_0x96be('0x1a')](respondWithResult(_0x2e8d94,null))[_0x96be('0x23')](handleError(_0x2e8d94,null));};exports[_0x96be('0x78')]=function(_0x5bd62e,_0x1b5a5a,_0x3b7f5f){if(_0x5bd62e[_0x96be('0x5e')]&&_0x5bd62e[_0x96be('0x5e')][_0x96be('0x5b')]){_0x5bd62e[_0x96be('0x5c')][_0x96be('0x64')]=_0x5bd62e[_0x96be('0x5e')][_0x96be('0x5b')];}return db['Setting'][_0x96be('0x4e')]({'where':{'id':_0x5bd62e[_0x96be('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1b5a5a,null))['then'](saveUpdates(_0x5bd62e[_0x96be('0x5c')],null))['then'](respondWithResult(_0x1b5a5a,null))[_0x96be('0x23')](handleError(_0x1b5a5a,null));};var utilLicense=require(_0x96be('0x72'));exports['getPreferred']=function(_0x4c442a,_0xe4825d,_0x2f1422){var _0x378f75=_0x96be('0x62');var _0x3f7005={'custom':![]};return utilLicense[_0x96be('0x63')]()[_0x96be('0x1a')](function(_0x7ac925){if(_0x7ac925){_0x3f7005=_0x7ac925;}return db[_0x96be('0x36')]['find']({'where':{'id':_0x4c442a[_0x96be('0x4d')]['id']},'attributes':[_0x96be('0x5d'),_0x96be('0x60'),_0x96be('0x64'),_0x96be('0x65'),_0x96be('0x79'),'defaultLoginLogo',_0x96be('0x67'),'defaultFavicon'],'raw':!![]});})[_0x96be('0x1a')](handleEntityNotFound(_0xe4825d,null))[_0x96be('0x1a')](function(_0xc32055){if(_0xc32055){var _0x24e036=_0xc32055[_0x96be('0x64')]&&fs['existsSync'](path[_0x96be('0x50')](config[_0x96be('0x53')],_0x378f75,_['toLower'](_0xc32055['preferred'])))?path[_0x96be('0x50')](config[_0x96be('0x53')],_0x378f75,_[_0x96be('0x6a')](_0xc32055[_0x96be('0x64')])):path[_0x96be('0x50')](config[_0x96be('0x53')],_0x378f75,_[_0x96be('0x6a')](_0x96be('0x7a')));var _0x435199=_0x96be('0x6c')+_[_0x96be('0x6d')]('preferred');if(_0xc32055[_0x435199]||!_0x3f7005[_0x96be('0x6e')]||!_0x3f7005[_0x96be('0x64')]){_0x24e036=path[_0x96be('0x50')](config[_0x96be('0x53')],_0x378f75,_[_0x96be('0x6a')](_0x96be('0x7a')));}if(!fs[_0x96be('0x69')](_0x24e036)){throw new db[(_0x96be('0x6f'))][(_0x96be('0x70'))](_[_0x96be('0x6d')](_0x96be('0x64'))+_0x96be('0x75'));}return _0xe4825d[_0x96be('0x71')](_0x24e036);}})[_0x96be('0x23')](handleError(_0xe4825d,null));};exports['addFavicon']=function(_0x14be2b,_0x5a902a,_0x1c8e89){if(_0x14be2b[_0x96be('0x5e')]&&_0x14be2b[_0x96be('0x5e')][_0x96be('0x5b')]){_0x14be2b[_0x96be('0x5c')][_0x96be('0x65')]=_0x14be2b[_0x96be('0x5e')][_0x96be('0x5b')];}return db[_0x96be('0x36')][_0x96be('0x4e')]({'where':{'id':_0x14be2b['params']['id']}})[_0x96be('0x1a')](handleEntityNotFound(_0x5a902a,null))['then'](saveUpdates(_0x14be2b[_0x96be('0x5c')],null))[_0x96be('0x1a')](respondWithResult(_0x5a902a,null))[_0x96be('0x23')](handleError(_0x5a902a,null));};var utilLicense=require(_0x96be('0x72'));exports[_0x96be('0x7b')]=function(_0x1af292,_0x387c88,_0x2e0577){var _0x4a1810='server/files/images/logos';var _0x358c15={'custom':![]};return utilLicense[_0x96be('0x63')]()[_0x96be('0x1a')](function(_0x31c794){if(_0x31c794){_0x358c15=_0x31c794;}return db['Setting'][_0x96be('0x4e')]({'where':{'id':_0x1af292[_0x96be('0x4d')]['id']},'attributes':['logo','loginLogo','preferred',_0x96be('0x65'),_0x96be('0x79'),'defaultLoginLogo',_0x96be('0x67'),_0x96be('0x68')],'raw':!![]});})['then'](handleEntityNotFound(_0x387c88,null))['then'](function(_0x27f801){if(_0x27f801){var _0x591247=_0x27f801['favicon']&&fs[_0x96be('0x69')](path[_0x96be('0x50')](config[_0x96be('0x53')],_0x4a1810,_[_0x96be('0x6a')](_0x27f801[_0x96be('0x65')])))?path['join'](config[_0x96be('0x53')],_0x4a1810,_[_0x96be('0x6a')](_0x27f801[_0x96be('0x65')])):path[_0x96be('0x50')](config[_0x96be('0x53')],_0x4a1810,_[_0x96be('0x6a')](_0x96be('0x7c')));var _0x13a906=_0x96be('0x6c')+_[_0x96be('0x6d')](_0x96be('0x65'));if(_0x27f801[_0x13a906]||!_0x358c15['custom']){_0x591247=path[_0x96be('0x50')](config[_0x96be('0x53')],_0x4a1810,_['toLower']('default_favicon.ico'));}if(!fs[_0x96be('0x69')](_0x591247)){throw new db[(_0x96be('0x6f'))]['ValidationError'](_[_0x96be('0x6d')]('favicon')+_0x96be('0x75'));}return _0x387c88['download'](_0x591247);}})['catch'](handleError(_0x387c88,null));}; \ No newline at end of file +var _0x71c0=['length','nolimit','limit','order','sort','where','filters','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','update','body','readFileSync','join','server/files/templates/stun.ejs','root','server/files/templates/turn.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultFavicon','existsSync','toLower','default_logo.png','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','defaultPreferred','default_loginLogo.png','default','download','securePassword','addPreferred','defaultLogo','default_preferred.png','addFavicon','default_favicon.ico','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','count','offset','json','apply','reject','save','destroy','then','name','send','Setting','rawAttributes','query','keys','intersection','model','attributes','fields'];(function(_0xc007e2,_0x388930){var _0x277763=function(_0x9b2045){while(--_0x9b2045){_0xc007e2['push'](_0xc007e2['shift']());}};_0x277763(++_0x388930);}(_0x71c0,0x145));var _0x071c=function(_0x50deff,_0x45d116){_0x50deff=_0x50deff-0x0;var _0x215a03=_0x71c0[_0x50deff];return _0x215a03;};'use strict';var pdf=require(_0x071c('0x0'));var emlformat=require(_0x071c('0x1'));var rimraf=require(_0x071c('0x2'));var zipdir=require(_0x071c('0x3'));var jsonpatch=require(_0x071c('0x4'));var rp=require(_0x071c('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x071c('0x6'));var path=require('path');var sox=require(_0x071c('0x7'));var csv=require(_0x071c('0x8'));var ejs=require(_0x071c('0x9'));var fs=require('fs');var _=require(_0x071c('0xa'));var squel=require(_0x071c('0xb'));var crypto=require(_0x071c('0xc'));var jsforce=require(_0x071c('0xd'));var deskjs=require(_0x071c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x071c('0xf'));var Redis=require(_0x071c('0x10'));var authService=require(_0x071c('0x11'));var qs=require(_0x071c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x071c('0x13'));var utils=require('../../config/utils');var config=require(_0x071c('0x14'));var db=require(_0x071c('0x15'))['db'];var jayson=require(_0x071c('0x16'));var client=jayson[_0x071c('0x17')][_0x071c('0x18')]({'port':0x232a});function checkPasswordPattern(_0x516f00,_0x1d347e,_0x11e0ea){if(_0x11e0ea){var _0x3d82af=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3d82af[_0x071c('0x19')](_0x1d347e)){return _0x516f00;}else{throw new Error(_0x071c('0x1a'));}}else{return _0x516f00;}}function respondWithRpcPromise(_0x52dcb1,_0x4fc2fd,_0x1e1906,_0x5474ed){return new BPromise(function(_0x38e43a,_0x13da5b){var _0x7c4281=_0x5474ed||client;return _0x7c4281[_0x071c('0x1b')](_0x52dcb1,_0x1e1906)['then'](function(_0x4d2f20){logger[_0x071c('0x1c')](_0x071c('0x1d'),_0x4fc2fd,_0x071c('0x1e'));logger[_0x071c('0x1f')](_0x071c('0x20'),_0x4fc2fd,_0x071c('0x1e'),JSON[_0x071c('0x21')](_0x4d2f20));if(_0x4d2f20['error']){if(_0x4d2f20[_0x071c('0x22')]['code']===0x1f4){logger['error'](_0x071c('0x1d'),_0x4fc2fd,_0x4d2f20['error']['message']);return _0x13da5b(_0x4d2f20['error'][_0x071c('0x23')]);}logger[_0x071c('0x22')](_0x071c('0x1d'),_0x4fc2fd,_0x4d2f20[_0x071c('0x22')][_0x071c('0x23')]);return _0x38e43a(_0x4d2f20[_0x071c('0x22')][_0x071c('0x23')]);}else{logger[_0x071c('0x1c')](_0x071c('0x1d'),_0x4fc2fd,_0x071c('0x1e'));_0x38e43a(_0x4d2f20[_0x071c('0x24')]['message']);}})[_0x071c('0x25')](function(_0x3b9f19){logger['error']('Setting,\x20%s,\x20%s',_0x4fc2fd,_0x3b9f19);_0x13da5b(_0x3b9f19);});});}function respondWithStatusCode(_0x3caa4c,_0x9b935b){_0x9b935b=_0x9b935b||0xcc;return function(_0x212812){if(_0x212812){return _0x3caa4c[_0x071c('0x26')](_0x9b935b);}return _0x3caa4c[_0x071c('0x27')](_0x9b935b)[_0x071c('0x28')]();};}function respondWithResult(_0x3c0f46,_0x34b3b7){_0x34b3b7=_0x34b3b7||0xc8;return function(_0x1a893d){if(_0x1a893d){return _0x3c0f46[_0x071c('0x27')](_0x34b3b7)['json'](_0x1a893d);}};}function respondWithFilteredResult(_0xed577e,_0x40265c){return function(_0x5c6886){if(_0x5c6886){var _0x47d981=_0x5c6886[_0x071c('0x29')],_0x1827e0=_0x40265c[_0x071c('0x2a')],_0x2fcaf9=_0x40265c['offset']+_0x40265c['limit'],_0x3eae57;if(_0x2fcaf9>=_0x47d981){_0x2fcaf9=_0x47d981;_0x3eae57=0xc8;}else{_0x3eae57=0xce;}_0xed577e[_0x071c('0x27')](_0x3eae57);return _0xed577e['set']('Content-Range',_0x1827e0+'-'+_0x2fcaf9+'/'+_0x47d981)[_0x071c('0x2b')](_0x5c6886);}return null;};}function patchUpdates(_0x48cd3d){return function(_0x36e067){try{jsonpatch[_0x071c('0x2c')](_0x36e067,_0x48cd3d,!![]);}catch(_0x296199){return BPromise[_0x071c('0x2d')](_0x296199);}return _0x36e067[_0x071c('0x2e')]();};}function saveUpdates(_0x407c43,_0x53563e){return function(_0x43592d){if(_0x43592d){return _0x43592d['update'](_0x407c43)['then'](function(_0x406445){return _0x406445;});}return null;};}function removeEntity(_0x4c8ea1,_0xaa9593){return function(_0x1e97be){if(_0x1e97be){return _0x1e97be[_0x071c('0x2f')]()[_0x071c('0x30')](function(){_0x4c8ea1[_0x071c('0x27')](0xcc)[_0x071c('0x28')]();});}};}function handleEntityNotFound(_0x1b25d8,_0x51b1c8){return function(_0x2a1af5){if(!_0x2a1af5){_0x1b25d8['sendStatus'](0x194);}return _0x2a1af5;};}function handleError(_0x589b09,_0x356708){_0x356708=_0x356708||0x1f4;return function(_0x340cc6){logger[_0x071c('0x22')](_0x340cc6['stack']);if(_0x340cc6['name']){delete _0x340cc6[_0x071c('0x31')];}_0x589b09[_0x071c('0x27')](_0x356708)[_0x071c('0x32')](_0x340cc6);};}exports['index']=function(_0x118290,_0x154dd0){var _0x3933db={},_0x2ff174={},_0x282368={'count':0x0,'rows':[]};var _0x494a00=db[_0x071c('0x33')][_0x071c('0x34')];_0x2ff174['model']=_['keys'](_0x494a00);_0x2ff174[_0x071c('0x35')]=_[_0x071c('0x36')](_0x118290['query']);_0x2ff174['filters']=_[_0x071c('0x37')](_0x2ff174[_0x071c('0x38')],_0x2ff174[_0x071c('0x35')]);_0x3933db[_0x071c('0x39')]=_[_0x071c('0x37')](_0x2ff174['model'],qs[_0x071c('0x3a')](_0x118290[_0x071c('0x35')][_0x071c('0x3a')]));_0x3933db[_0x071c('0x39')]=_0x3933db[_0x071c('0x39')][_0x071c('0x3b')]?_0x3933db[_0x071c('0x39')]:_0x2ff174['model'];if(!_0x118290[_0x071c('0x35')]['hasOwnProperty'](_0x071c('0x3c'))){_0x3933db[_0x071c('0x3d')]=qs[_0x071c('0x3d')](_0x118290[_0x071c('0x35')][_0x071c('0x3d')]);_0x3933db[_0x071c('0x2a')]=qs[_0x071c('0x2a')](_0x118290['query'][_0x071c('0x2a')]);}_0x3933db[_0x071c('0x3e')]=qs[_0x071c('0x3f')](_0x118290[_0x071c('0x35')][_0x071c('0x3f')]);_0x3933db[_0x071c('0x40')]=qs[_0x071c('0x41')](_['pick'](_0x118290['query'],_0x2ff174[_0x071c('0x41')]));if(_0x118290[_0x071c('0x35')][_0x071c('0x42')]){_0x3933db[_0x071c('0x40')]=_[_0x071c('0x43')](_0x3933db[_0x071c('0x40')],{'$or':_['map'](_0x494a00,function(_0x4699f6){if(_0x4699f6[_0x071c('0x44')][_0x071c('0x45')]!==_0x071c('0x46')){var _0x2c942d={};_0x2c942d[_0x4699f6[_0x071c('0x47')]]={'$like':'%'+_0x118290['query'][_0x071c('0x42')]+'%'};return _0x2c942d;}})});}_0x3933db=_[_0x071c('0x43')]({},_0x3933db,_0x118290[_0x071c('0x48')]);var _0x4f7e15={'where':_0x3933db[_0x071c('0x40')]};return db[_0x071c('0x33')]['count'](_0x4f7e15)[_0x071c('0x30')](function(_0x1fb8de){_0x282368['count']=_0x1fb8de;if(_0x118290['query'][_0x071c('0x49')]){_0x3933db[_0x071c('0x4a')]=[{'all':!![]}];}return db['Setting'][_0x071c('0x4b')](_0x3933db);})[_0x071c('0x30')](function(_0x5653ce){_0x282368[_0x071c('0x4c')]=_0x5653ce;return _0x282368;})['then'](respondWithFilteredResult(_0x154dd0,_0x3933db))[_0x071c('0x25')](handleError(_0x154dd0,null));};exports[_0x071c('0x4d')]=function(_0x3de869,_0x2aa296){var _0x26068e={'raw':![],'where':{'id':_0x3de869[_0x071c('0x4e')]['id']}},_0x265c10={};_0x265c10[_0x071c('0x38')]=_[_0x071c('0x36')](db['Setting']['rawAttributes']);_0x265c10[_0x071c('0x35')]=_[_0x071c('0x36')](_0x3de869['query']);_0x265c10[_0x071c('0x41')]=_[_0x071c('0x37')](_0x265c10[_0x071c('0x38')],_0x265c10[_0x071c('0x35')]);_0x26068e[_0x071c('0x39')]=_['intersection'](_0x265c10['model'],qs[_0x071c('0x3a')](_0x3de869[_0x071c('0x35')][_0x071c('0x3a')]));_0x26068e[_0x071c('0x39')]=_0x26068e[_0x071c('0x39')][_0x071c('0x3b')]?_0x26068e['attributes']:_0x265c10[_0x071c('0x38')];if(_0x3de869[_0x071c('0x35')][_0x071c('0x49')]){_0x26068e[_0x071c('0x4a')]=[{'all':!![]}];}_0x26068e=_['merge']({},_0x26068e,_0x3de869[_0x071c('0x48')]);return db[_0x071c('0x33')][_0x071c('0x4f')](_0x26068e)[_0x071c('0x30')](handleEntityNotFound(_0x2aa296,null))['then'](respondWithResult(_0x2aa296,null))['catch'](handleError(_0x2aa296,null));};exports[_0x071c('0x50')]=function(_0x62cf8a,_0x3845e1,_0x4adc8a){var _0x2c1184;return db[_0x071c('0x33')]['find']({'where':{'id':_0x62cf8a[_0x071c('0x4e')]['id']}})[_0x071c('0x30')](handleEntityNotFound(_0x3845e1,null))['then'](saveUpdates(_0x62cf8a[_0x071c('0x51')],null))[_0x071c('0x30')](function(_0x3c5787){if(_0x3c5787){_0x2c1184=_0x3c5787['get']({'plain':!![]});var _0x397d04=fs[_0x071c('0x52')](path[_0x071c('0x53')](config['root'],_0x071c('0x54')),'utf8');var _0x1cf7dc=ejs['render'](_0x397d04,_0x2c1184);var _0x45de3c=fs[_0x071c('0x52')](path[_0x071c('0x53')](config[_0x071c('0x55')],_0x071c('0x56')),_0x071c('0x57'));var _0x1b7755=ejs[_0x071c('0x58')](_0x45de3c,_0x2c1184);fs[_0x071c('0x59')](_0x071c('0x5a'),_0x1cf7dc);fs[_0x071c('0x59')](_0x071c('0x5b'),_0x1b7755);return respondWithRpcPromise(_0x071c('0x5c'),'update',{'module':_0x071c('0x5d')});}})[_0x071c('0x30')](function(){return respondWithRpcPromise(_0x071c('0x5c'),_0x071c('0x50'),{'module':_0x071c('0x5e')});})[_0x071c('0x30')](function(){return _0x2c1184||null;})[_0x071c('0x30')](respondWithResult(_0x3845e1,null))[_0x071c('0x25')](handleError(_0x3845e1,null));};exports[_0x071c('0x5f')]=function(_0x5d370a,_0x7581bf,_0x30d8ed){if(_0x5d370a[_0x071c('0x60')]&&_0x5d370a['file'][_0x071c('0x61')]){_0x5d370a[_0x071c('0x51')][_0x071c('0x62')]=_0x5d370a[_0x071c('0x60')][_0x071c('0x61')];}return db['Setting'][_0x071c('0x4f')]({'where':{'id':_0x5d370a['params']['id']}})['then'](handleEntityNotFound(_0x7581bf,null))[_0x071c('0x30')](saveUpdates(_0x5d370a['body'],null))[_0x071c('0x30')](respondWithResult(_0x7581bf,null))[_0x071c('0x25')](handleError(_0x7581bf,null));};exports[_0x071c('0x63')]=function(_0x2ac2a8,_0x25d54a,_0x368025){if(_0x2ac2a8[_0x071c('0x60')]&&_0x2ac2a8[_0x071c('0x60')]['filename']){_0x2ac2a8[_0x071c('0x51')][_0x071c('0x64')]=_0x2ac2a8[_0x071c('0x60')][_0x071c('0x61')];}return db[_0x071c('0x33')][_0x071c('0x4f')]({'where':{'id':_0x2ac2a8[_0x071c('0x4e')]['id']}})[_0x071c('0x30')](handleEntityNotFound(_0x25d54a,null))[_0x071c('0x30')](saveUpdates(_0x2ac2a8['body'],null))[_0x071c('0x30')](respondWithResult(_0x25d54a,null))[_0x071c('0x25')](handleError(_0x25d54a,null));};var utilLicense=require(_0x071c('0x65'));exports[_0x071c('0x66')]=function(_0x4dfcd0,_0x13d1c7,_0x392bdb){var _0x4261b2=_0x071c('0x67');var _0x20ba7a={'custom':![]};return utilLicense[_0x071c('0x68')]()[_0x071c('0x30')](function(_0x57eef9){if(_0x57eef9){_0x20ba7a=_0x57eef9;}return db[_0x071c('0x33')][_0x071c('0x4f')]({'where':{'id':_0x4dfcd0[_0x071c('0x4e')]['id']},'attributes':[_0x071c('0x62'),'loginLogo',_0x071c('0x69'),_0x071c('0x6a'),'defaultLogo',_0x071c('0x6b'),'defaultPreferred',_0x071c('0x6c')],'raw':!![]});})['then'](handleEntityNotFound(_0x13d1c7,null))[_0x071c('0x30')](function(_0xbd8851){if(_0xbd8851){var _0xb2342e=_0xbd8851[_0x071c('0x62')]&&fs[_0x071c('0x6d')](path[_0x071c('0x53')](config[_0x071c('0x55')],_0x4261b2,_[_0x071c('0x6e')](_0xbd8851[_0x071c('0x62')])))?path[_0x071c('0x53')](config[_0x071c('0x55')],_0x4261b2,_[_0x071c('0x6e')](_0xbd8851['logo'])):path['join'](config[_0x071c('0x55')],_0x4261b2,_['toLower'](_0x071c('0x6f')));var _0xf54bff='default'+_[_0x071c('0x70')]('logo');if(_0xbd8851[_0xf54bff]||!_0x20ba7a[_0x071c('0x71')]){_0xb2342e=path[_0x071c('0x53')](config['root'],_0x4261b2,_[_0x071c('0x6e')](_0x071c('0x6f')));}if(!fs[_0x071c('0x6d')](_0xb2342e)){throw new db[(_0x071c('0x72'))][(_0x071c('0x73'))](_[_0x071c('0x70')](_0x071c('0x62'))+_0x071c('0x74'));}return _0x13d1c7['download'](_0xb2342e);}})['catch'](handleError(_0x13d1c7,null));};var utilLicense=require(_0x071c('0x65'));exports[_0x071c('0x75')]=function(_0x344bc0,_0xc718d,_0x559b36){var _0x14cb84=_0x071c('0x67');var _0xd2c8c7={'custom':![]};return utilLicense['getLicense']()[_0x071c('0x30')](function(_0x92c089){if(_0x92c089){_0xd2c8c7=_0x92c089;}return db[_0x071c('0x33')]['find']({'where':{'id':_0x344bc0[_0x071c('0x4e')]['id']},'attributes':['logo',_0x071c('0x64'),'preferred',_0x071c('0x6a'),'defaultLogo',_0x071c('0x6b'),_0x071c('0x76'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0xc718d,null))[_0x071c('0x30')](function(_0x25da92){if(_0x25da92){var _0x2b7540=_0x25da92['loginLogo']&&fs[_0x071c('0x6d')](path[_0x071c('0x53')](config[_0x071c('0x55')],_0x14cb84,_[_0x071c('0x6e')](_0x25da92[_0x071c('0x64')])))?path['join'](config[_0x071c('0x55')],_0x14cb84,_[_0x071c('0x6e')](_0x25da92['loginLogo'])):path[_0x071c('0x53')](config[_0x071c('0x55')],_0x14cb84,_[_0x071c('0x6e')](_0x071c('0x77')));var _0x65f4f8=_0x071c('0x78')+_['upperFirst']('loginLogo');if(_0x25da92[_0x65f4f8]||!_0xd2c8c7[_0x071c('0x71')]){_0x2b7540=path[_0x071c('0x53')](config[_0x071c('0x55')],_0x14cb84,_['toLower'](_0x071c('0x77')));}if(!fs[_0x071c('0x6d')](_0x2b7540)){throw new db[(_0x071c('0x72'))][(_0x071c('0x73'))](_[_0x071c('0x70')](_0x071c('0x64'))+'\x20not\x20found');}return _0xc718d[_0x071c('0x79')](_0x2b7540);}})[_0x071c('0x25')](handleError(_0xc718d,null));};exports['gdpr']=function(_0x12e4e7,_0x3077b8){return db[_0x071c('0x33')][_0x071c('0x4f')]({'where':{'id':_0x12e4e7['params']['id']},'attributes':[_0x071c('0x7a')]})[_0x071c('0x30')](respondWithResult(_0x3077b8,null))[_0x071c('0x25')](handleError(_0x3077b8,null));};exports[_0x071c('0x7b')]=function(_0x5e65b3,_0x20eea0,_0x3c4512){if(_0x5e65b3[_0x071c('0x60')]&&_0x5e65b3[_0x071c('0x60')]['filename']){_0x5e65b3[_0x071c('0x51')][_0x071c('0x69')]=_0x5e65b3[_0x071c('0x60')][_0x071c('0x61')];}return db[_0x071c('0x33')][_0x071c('0x4f')]({'where':{'id':_0x5e65b3[_0x071c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x20eea0,null))['then'](saveUpdates(_0x5e65b3[_0x071c('0x51')],null))[_0x071c('0x30')](respondWithResult(_0x20eea0,null))[_0x071c('0x25')](handleError(_0x20eea0,null));};var utilLicense=require(_0x071c('0x65'));exports['getPreferred']=function(_0x405575,_0x2a9f97,_0x5f3dd5){var _0x552c2a=_0x071c('0x67');var _0x49e1b4={'custom':![]};return utilLicense[_0x071c('0x68')]()[_0x071c('0x30')](function(_0x2539fc){if(_0x2539fc){_0x49e1b4=_0x2539fc;}return db[_0x071c('0x33')]['find']({'where':{'id':_0x405575[_0x071c('0x4e')]['id']},'attributes':['logo','loginLogo',_0x071c('0x69'),_0x071c('0x6a'),_0x071c('0x7c'),_0x071c('0x6b'),_0x071c('0x76'),'defaultFavicon'],'raw':!![]});})[_0x071c('0x30')](handleEntityNotFound(_0x2a9f97,null))[_0x071c('0x30')](function(_0x4026f8){if(_0x4026f8){var _0xee3792=_0x4026f8[_0x071c('0x69')]&&fs[_0x071c('0x6d')](path[_0x071c('0x53')](config[_0x071c('0x55')],_0x552c2a,_['toLower'](_0x4026f8['preferred'])))?path[_0x071c('0x53')](config[_0x071c('0x55')],_0x552c2a,_[_0x071c('0x6e')](_0x4026f8[_0x071c('0x69')])):path[_0x071c('0x53')](config[_0x071c('0x55')],_0x552c2a,_['toLower'](_0x071c('0x7d')));var _0x12edde='default'+_[_0x071c('0x70')](_0x071c('0x69'));if(_0x4026f8[_0x12edde]||!_0x49e1b4[_0x071c('0x71')]||!_0x49e1b4[_0x071c('0x69')]){_0xee3792=path[_0x071c('0x53')](config[_0x071c('0x55')],_0x552c2a,_[_0x071c('0x6e')](_0x071c('0x7d')));}if(!fs[_0x071c('0x6d')](_0xee3792)){throw new db['Sequelize'][(_0x071c('0x73'))](_['upperFirst']('preferred')+_0x071c('0x74'));}return _0x2a9f97[_0x071c('0x79')](_0xee3792);}})[_0x071c('0x25')](handleError(_0x2a9f97,null));};exports[_0x071c('0x7e')]=function(_0x155936,_0x5b702f,_0x1d4bf4){if(_0x155936['file']&&_0x155936[_0x071c('0x60')][_0x071c('0x61')]){_0x155936[_0x071c('0x51')][_0x071c('0x6a')]=_0x155936[_0x071c('0x60')]['filename'];}return db[_0x071c('0x33')]['find']({'where':{'id':_0x155936['params']['id']}})['then'](handleEntityNotFound(_0x5b702f,null))[_0x071c('0x30')](saveUpdates(_0x155936[_0x071c('0x51')],null))[_0x071c('0x30')](respondWithResult(_0x5b702f,null))[_0x071c('0x25')](handleError(_0x5b702f,null));};var utilLicense=require(_0x071c('0x65'));exports['getFavicon']=function(_0x41e153,_0x2bdcc1,_0xca951){var _0x555a0e=_0x071c('0x67');var _0x472ef1={'custom':![]};return utilLicense[_0x071c('0x68')]()[_0x071c('0x30')](function(_0x2f6e19){if(_0x2f6e19){_0x472ef1=_0x2f6e19;}return db[_0x071c('0x33')][_0x071c('0x4f')]({'where':{'id':_0x41e153['params']['id']},'attributes':[_0x071c('0x62'),'loginLogo','preferred',_0x071c('0x6a'),'defaultLogo','defaultLoginLogo',_0x071c('0x76'),_0x071c('0x6c')],'raw':!![]});})[_0x071c('0x30')](handleEntityNotFound(_0x2bdcc1,null))[_0x071c('0x30')](function(_0x3040d0){if(_0x3040d0){var _0x499fb4=_0x3040d0[_0x071c('0x6a')]&&fs[_0x071c('0x6d')](path['join'](config[_0x071c('0x55')],_0x555a0e,_[_0x071c('0x6e')](_0x3040d0[_0x071c('0x6a')])))?path[_0x071c('0x53')](config[_0x071c('0x55')],_0x555a0e,_[_0x071c('0x6e')](_0x3040d0[_0x071c('0x6a')])):path[_0x071c('0x53')](config[_0x071c('0x55')],_0x555a0e,_[_0x071c('0x6e')](_0x071c('0x7f')));var _0x52b10a='default'+_[_0x071c('0x70')](_0x071c('0x6a'));if(_0x3040d0[_0x52b10a]||!_0x472ef1[_0x071c('0x71')]){_0x499fb4=path[_0x071c('0x53')](config[_0x071c('0x55')],_0x555a0e,_[_0x071c('0x6e')](_0x071c('0x7f')));}if(!fs['existsSync'](_0x499fb4)){throw new db[(_0x071c('0x72'))][(_0x071c('0x73'))](_['upperFirst'](_0x071c('0x6a'))+_0x071c('0x74'));}return _0x2bdcc1[_0x071c('0x79')](_0x499fb4);}})[_0x071c('0x25')](handleError(_0x2bdcc1,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index e547eec..971d9a5 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad94=['../../config/environment','exports','settings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1d05c2,_0x1a6c2d){var _0x4766f5=function(_0xa0df0){while(--_0xa0df0){_0x1d05c2['push'](_0x1d05c2['shift']());}};_0x4766f5(++_0x1a6c2d);}(_0xad94,0x1dc));var _0x4ad9=function(_0x31c436,_0x4c62ef){_0x31c436=_0x31c436-0x0;var _0x3e609c=_0xad94[_0x31c436];return _0x3e609c;};'use strict';var _=require(_0x4ad9('0x0'));var util=require(_0x4ad9('0x1'));var logger=require(_0x4ad9('0x2'))(_0x4ad9('0x3'));var moment=require(_0x4ad9('0x4'));var BPromise=require(_0x4ad9('0x5'));var rp=require(_0x4ad9('0x6'));var fs=require('fs');var path=require(_0x4ad9('0x7'));var rimraf=require('rimraf');var config=require(_0x4ad9('0x8'));var attributes=require('./setting.attributes');module[_0x4ad9('0x9')]=function(_0x2c4b41,_0x57c69b){return _0x2c4b41['define']('Setting',attributes,{'tableName':_0x4ad9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76c6=['../../config/environment','./setting.attributes','exports','define','settings','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x4c5772,_0x8ce964){var _0x3017eb=function(_0x184c08){while(--_0x184c08){_0x4c5772['push'](_0x4c5772['shift']());}};_0x3017eb(++_0x8ce964);}(_0x76c6,0x123));var _0x676c=function(_0x465a81,_0x1a5c09){_0x465a81=_0x465a81-0x0;var _0x451665=_0x76c6[_0x465a81];return _0x451665;};'use strict';var _=require('lodash');var util=require(_0x676c('0x0'));var logger=require(_0x676c('0x1'))('api');var moment=require(_0x676c('0x2'));var BPromise=require(_0x676c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x676c('0x4'));var rimraf=require(_0x676c('0x5'));var config=require(_0x676c('0x6'));var attributes=require(_0x676c('0x7'));module[_0x676c('0x8')]=function(_0x204ea5,_0x3b359a){return _0x204ea5[_0x676c('0x9')]('Setting',attributes,{'tableName':_0x676c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 6bb7221..6b2bac1 100644 --- a/server/api/setting/setting.rpc.js +++ b/server/api/setting/setting.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa956=['../../config/environment','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xa956,0x1f2));var _0x6a95=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xa956[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0x6a95('0x0'));var util=require(_0x6a95('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a95('0x2'));var db=require(_0x6a95('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a95('0x4'))(_0x6a95('0x5'));var config=require(_0x6a95('0x6'));var jayson=require(_0x6a95('0x7'));var client=jayson[_0x6a95('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x308e51,_0x4af884,_0x4cabc1){return new BPromise(function(_0x304d59,_0x5cc699){return client[_0x6a95('0x9')](_0x308e51,_0x4cabc1)[_0x6a95('0xa')](function(_0x7f0696){logger[_0x6a95('0xb')](_0x6a95('0xc'),_0x4af884,'request\x20sent');logger[_0x6a95('0xd')](_0x6a95('0xe'),_0x4af884,_0x6a95('0xf'),JSON['stringify'](_0x7f0696));if(_0x7f0696[_0x6a95('0x10')]){if(_0x7f0696['error'][_0x6a95('0x11')]===0x1f4){logger[_0x6a95('0x10')](_0x6a95('0xc'),_0x4af884,_0x7f0696[_0x6a95('0x10')]['message']);return _0x5cc699(_0x7f0696[_0x6a95('0x10')][_0x6a95('0x12')]);}logger[_0x6a95('0x10')](_0x6a95('0xc'),_0x4af884,_0x7f0696[_0x6a95('0x10')]['message']);return _0x304d59(_0x7f0696[_0x6a95('0x10')][_0x6a95('0x12')]);}else{logger[_0x6a95('0xb')](_0x6a95('0xc'),_0x4af884,_0x6a95('0xf'));_0x304d59(_0x7f0696[_0x6a95('0x13')][_0x6a95('0x12')]);}})[_0x6a95('0x14')](function(_0x54604c){logger[_0x6a95('0x10')](_0x6a95('0xc'),_0x4af884,_0x54604c);_0x5cc699(_0x54604c);});});} \ No newline at end of file +var _0xaa37=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird'];(function(_0x44e2aa,_0x212814){var _0x2d9c94=function(_0x1a1ad5){while(--_0x1a1ad5){_0x44e2aa['push'](_0x44e2aa['shift']());}};_0x2d9c94(++_0x212814);}(_0xaa37,0x1a1));var _0x7aa3=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xaa37[_0x1e7b16];return _0x37fadc;};'use strict';var _=require('lodash');var util=require(_0x7aa3('0x0'));var moment=require(_0x7aa3('0x1'));var BPromise=require(_0x7aa3('0x2'));var rs=require(_0x7aa3('0x3'));var fs=require('fs');var Redis=require(_0x7aa3('0x4'));var db=require(_0x7aa3('0x5'))['db'];var utils=require(_0x7aa3('0x6'));var logger=require(_0x7aa3('0x7'))(_0x7aa3('0x8'));var config=require(_0x7aa3('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7aa3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x201328,_0x12d057,_0x3a3126){return new BPromise(function(_0x361e85,_0x23ab26){return client[_0x7aa3('0xb')](_0x201328,_0x3a3126)['then'](function(_0x5294c0){logger[_0x7aa3('0xc')](_0x7aa3('0xd'),_0x12d057,_0x7aa3('0xe'));logger[_0x7aa3('0xf')](_0x7aa3('0x10'),_0x12d057,'request\x20sent',JSON['stringify'](_0x5294c0));if(_0x5294c0[_0x7aa3('0x11')]){if(_0x5294c0['error'][_0x7aa3('0x12')]===0x1f4){logger[_0x7aa3('0x11')](_0x7aa3('0xd'),_0x12d057,_0x5294c0[_0x7aa3('0x11')][_0x7aa3('0x13')]);return _0x23ab26(_0x5294c0[_0x7aa3('0x11')][_0x7aa3('0x13')]);}logger[_0x7aa3('0x11')]('Setting,\x20%s,\x20%s',_0x12d057,_0x5294c0[_0x7aa3('0x11')][_0x7aa3('0x13')]);return _0x361e85(_0x5294c0['error']['message']);}else{logger['info'](_0x7aa3('0xd'),_0x12d057,_0x7aa3('0xe'));_0x361e85(_0x5294c0['result']['message']);}})[_0x7aa3('0x14')](function(_0xb1776e){logger[_0x7aa3('0x11')](_0x7aa3('0xd'),_0x12d057,_0xb1776e);_0x23ab26(_0xb1776e);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index d8c0174..da96f3a 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcee=['notify','/:id/send','send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','/:id/notify'];(function(_0xba421b,_0x44a2ee){var _0x1aa0a8=function(_0x127525){while(--_0x127525){_0xba421b['push'](_0xba421b['shift']());}};_0x1aa0a8(++_0x44a2ee);}(_0xdcee,0x15b));var _0xedce=function(_0x187790,_0x2a083b){_0x187790=_0x187790-0x0;var _0x472705=_0xdcee[_0x187790];return _0x472705;};'use strict';var multer=require(_0xedce('0x0'));var util=require('util');var path=require(_0xedce('0x1'));var timeout=require(_0xedce('0x2'));var express=require(_0xedce('0x3'));var router=express[_0xedce('0x4')]();var auth=require(_0xedce('0x5'));var interaction=require(_0xedce('0x6'));var config=require(_0xedce('0x7'));var controller=require(_0xedce('0x8'));router['get']('/',auth[_0xedce('0x9')](),controller[_0xedce('0xa')]);router[_0xedce('0xb')](_0xedce('0xc'),auth[_0xedce('0x9')](),controller[_0xedce('0xd')]);router[_0xedce('0xb')](_0xedce('0xe'),auth['isAuthenticated'](),controller[_0xedce('0xf')]);router[_0xedce('0xb')](_0xedce('0x10'),auth[_0xedce('0x9')](),controller[_0xedce('0x11')]);router[_0xedce('0xb')](_0xedce('0x12'),auth[_0xedce('0x9')](),controller[_0xedce('0x13')]);router[_0xedce('0xb')](_0xedce('0x14'),auth[_0xedce('0x9')](),controller[_0xedce('0x15')]);router[_0xedce('0xb')](_0xedce('0x16'),auth[_0xedce('0x9')](),controller[_0xedce('0x17')]);router[_0xedce('0xb')](_0xedce('0x18'),controller[_0xedce('0x19')]);router[_0xedce('0xb')](_0xedce('0x1a'),auth[_0xedce('0x9')](),controller[_0xedce('0x1b')]);router[_0xedce('0x1c')]('/',auth[_0xedce('0x9')](),controller[_0xedce('0x1d')]);router[_0xedce('0x1c')](_0xedce('0x10'),auth[_0xedce('0x9')](),controller['addDisposition']);router[_0xedce('0x1c')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0xedce('0x1e'),controller[_0xedce('0x1f')]);router[_0xedce('0x1c')](_0xedce('0x14'),auth[_0xedce('0x9')](),controller['addApplications']);router[_0xedce('0x1c')](_0xedce('0x20'),auth[_0xedce('0x9')](),controller[_0xedce('0x21')]);router[_0xedce('0x1c')]('/:id/status',controller[_0xedce('0x22')]);router[_0xedce('0x1c')]('/:id/users',auth[_0xedce('0x9')](),controller[_0xedce('0x23')]);router[_0xedce('0x24')](_0xedce('0xe'),auth['isAuthenticated'](),controller[_0xedce('0x25')]);router['delete'](_0xedce('0xe'),auth['isAuthenticated'](),controller[_0xedce('0x26')]);router[_0xedce('0x27')](_0xedce('0x10'),auth[_0xedce('0x9')](),controller[_0xedce('0x28')]);router[_0xedce('0x27')](_0xedce('0x12'),auth[_0xedce('0x9')](),controller['removeAnswers']);router[_0xedce('0x27')]('/:id/users',auth[_0xedce('0x9')](),controller[_0xedce('0x29')]);module['exports']=router; \ No newline at end of file +var _0xca4b=['statusGet','/:id/users','getAgents','post','create','addDisposition','notify','addApplications','/:id/send','status','addAgents','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x364d33,_0x29f7ca){var _0x1b14be=function(_0x48ff5d){while(--_0x48ff5d){_0x364d33['push'](_0x364d33['shift']());}};_0x1b14be(++_0x29f7ca);}(_0xca4b,0x151));var _0xbca4=function(_0x582a8a,_0x115283){_0x582a8a=_0x582a8a-0x0;var _0x490a5f=_0xca4b[_0x582a8a];return _0x490a5f;};'use strict';var multer=require('multer');var util=require(_0xbca4('0x0'));var path=require(_0xbca4('0x1'));var timeout=require(_0xbca4('0x2'));var express=require(_0xbca4('0x3'));var router=express[_0xbca4('0x4')]();var auth=require(_0xbca4('0x5'));var interaction=require(_0xbca4('0x6'));var config=require(_0xbca4('0x7'));var controller=require('./smsAccount.controller');router[_0xbca4('0x8')]('/',auth['isAuthenticated'](),controller[_0xbca4('0x9')]);router['get'](_0xbca4('0xa'),auth[_0xbca4('0xb')](),controller['describe']);router[_0xbca4('0x8')](_0xbca4('0xc'),auth[_0xbca4('0xb')](),controller[_0xbca4('0xd')]);router[_0xbca4('0x8')](_0xbca4('0xe'),auth['isAuthenticated'](),controller[_0xbca4('0xf')]);router[_0xbca4('0x8')](_0xbca4('0x10'),auth[_0xbca4('0xb')](),controller[_0xbca4('0x11')]);router[_0xbca4('0x8')](_0xbca4('0x12'),auth[_0xbca4('0xb')](),controller[_0xbca4('0x13')]);router[_0xbca4('0x8')](_0xbca4('0x14'),auth[_0xbca4('0xb')](),controller[_0xbca4('0x15')]);router['get'](_0xbca4('0x16'),controller[_0xbca4('0x17')]);router[_0xbca4('0x8')](_0xbca4('0x18'),auth['isAuthenticated'](),controller[_0xbca4('0x19')]);router[_0xbca4('0x1a')]('/',auth[_0xbca4('0xb')](),controller[_0xbca4('0x1b')]);router[_0xbca4('0x1a')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xbca4('0x1c')]);router[_0xbca4('0x1a')](_0xbca4('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xbca4('0x1a')]('/:id/notify',controller[_0xbca4('0x1d')]);router[_0xbca4('0x1a')](_0xbca4('0x12'),auth[_0xbca4('0xb')](),controller[_0xbca4('0x1e')]);router[_0xbca4('0x1a')](_0xbca4('0x1f'),auth[_0xbca4('0xb')](),controller['send']);router[_0xbca4('0x1a')](_0xbca4('0x16'),controller[_0xbca4('0x20')]);router[_0xbca4('0x1a')](_0xbca4('0x18'),auth[_0xbca4('0xb')](),controller[_0xbca4('0x21')]);router['put'](_0xbca4('0xc'),auth[_0xbca4('0xb')](),controller['update']);router[_0xbca4('0x22')](_0xbca4('0xc'),auth[_0xbca4('0xb')](),controller[_0xbca4('0x23')]);router[_0xbca4('0x22')](_0xbca4('0xe'),auth[_0xbca4('0xb')](),controller[_0xbca4('0x24')]);router[_0xbca4('0x22')](_0xbca4('0x10'),auth['isAuthenticated'](),controller[_0xbca4('0x25')]);router[_0xbca4('0x22')](_0xbca4('0x18'),auth[_0xbca4('0xb')](),controller[_0xbca4('0x26')]);module[_0xbca4('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index ffbd132..6dfadee 100644 --- a/server/api/smsAccount/smsAccount.attributes.js +++ b/server/api/smsAccount/smsAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec5=['infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','ENUM','twilio','connectel','clicksend','plivo','clickatell','csc'];(function(_0x4e3f24,_0x461407){var _0x32ee16=function(_0xb3402){while(--_0xb3402){_0x4e3f24['push'](_0x4e3f24['shift']());}};_0x32ee16(++_0x461407);}(_0xbec5,0xe5));var _0x5bec=function(_0x44dba1,_0x270ad5){_0x44dba1=_0x44dba1-0x0;var _0x2fbd3f=_0xbec5[_0x44dba1];return _0x2fbd3f;};'use strict';var Sequelize=require(_0x5bec('0x0'));var rs=require(_0x5bec('0x1'));module['exports']={'name':{'type':Sequelize[_0x5bec('0x2')],'unique':_0x5bec('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x5bec('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x5bec('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x5bec('0x2')]},'type':{'type':Sequelize[_0x5bec('0x4')](_0x5bec('0x5'),'skebby',_0x5bec('0x6'),_0x5bec('0x7'),_0x5bec('0x8'),_0x5bec('0x9'),_0x5bec('0xa'),_0x5bec('0xb'),_0x5bec('0xc'))},'accountSid':{'type':Sequelize[_0x5bec('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x5bec('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x5bec('0x2')]},'password':{'type':Sequelize[_0x5bec('0x2')]},'apiKey':{'type':Sequelize[_0x5bec('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x5bec('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x5bec('0x2')]},'notificationTemplate':{'type':Sequelize[_0x5bec('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5bec('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5bec('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5bec('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5bec('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5bec('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5bec('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x5bec('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5bec('0xf')],'comment':_0x5bec('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x5bec('0xd')],'defaultValue':![],'comment':_0x5bec('0x11'),'set':function(_0x3ebc41){if(!_0x3ebc41)this[_0x5bec('0x12')](_0x5bec('0x13'),null);this[_0x5bec('0x12')]('mandatoryDisposition',_0x3ebc41);}}}; \ No newline at end of file +var _0x9a19=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x16acb7,_0x23f034){var _0x39bf39=function(_0x21281e){while(--_0x21281e){_0x16acb7['push'](_0x16acb7['shift']());}};_0x39bf39(++_0x23f034);}(_0x9a19,0x114));var _0x99a1=function(_0x51bda1,_0x44f80d){_0x51bda1=_0x51bda1-0x0;var _0x1ce08c=_0x9a19[_0x51bda1];return _0x1ce08c;};'use strict';var Sequelize=require(_0x99a1('0x0'));var rs=require(_0x99a1('0x1'));module[_0x99a1('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x99a1('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x99a1('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x99a1('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x99a1('0x4')],'defaultValue':function(){return rs[_0x99a1('0x5')]();}},'phone':{'type':Sequelize[_0x99a1('0x4')]},'type':{'type':Sequelize[_0x99a1('0x6')](_0x99a1('0x7'),_0x99a1('0x8'),_0x99a1('0x9'),_0x99a1('0xa'),'plivo','clickatell','csc',_0x99a1('0xb'),_0x99a1('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x99a1('0x4')]},'smsMethod':{'type':Sequelize[_0x99a1('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x99a1('0x4')]},'password':{'type':Sequelize[_0x99a1('0x4')]},'apiKey':{'type':Sequelize[_0x99a1('0x4')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x99a1('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x99a1('0x4')]},'notificationTemplate':{'type':Sequelize[_0x99a1('0xe')],'defaultValue':function(){return _0x99a1('0xf');}},'notificationSound':{'type':Sequelize[_0x99a1('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x99a1('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x99a1('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x99a1('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x99a1('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x99a1('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x99a1('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x99a1('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x99a1('0x10')],'comment':_0x99a1('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x99a1('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2d81ed){if(!_0x2d81ed)this[_0x99a1('0x12')](_0x99a1('0x13'),null);this[_0x99a1('0x12')](_0x99a1('0x14'),_0x2d81ed);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 70c8c1c..a111e55 100644 --- a/server/api/smsAccount/smsAccount.controller.js +++ b/server/api/smsAccount/smsAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9124=['addAnswer','CannedAnswer','order','map','rows','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','Body','messageId','skebby','sender','text','message_id','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','intelepeer','refid','ValidationError','from\x20is\x20mandatory','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','Owner','fullname','internal','Tag','Tags','color','tag','send','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','push','log','inspect','skebby_dispatch_id','connectel','requestid','statusInt','clicksend','status_code','infobip','groupName','redif','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','state','message-id','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','SmsAccount','includeAll','include','findAll','show','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','params','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x9124,0x167));var _0x4912=function(_0x2917c5,_0x4f2519){_0x2917c5=_0x2917c5-0x0;var _0x5d0ddb=_0x9124[_0x2917c5];return _0x5d0ddb;};'use strict';var pdf=require(_0x4912('0x0'));var emlformat=require(_0x4912('0x1'));var rimraf=require(_0x4912('0x2'));var zipdir=require(_0x4912('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4912('0x4'));var moment=require(_0x4912('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4912('0x6'));var util=require('util');var path=require(_0x4912('0x7'));var sox=require('sox');var csv=require(_0x4912('0x8'));var ejs=require(_0x4912('0x9'));var fs=require('fs');var _=require(_0x4912('0xa'));var squel=require(_0x4912('0xb'));var crypto=require(_0x4912('0xc'));var jsforce=require(_0x4912('0xd'));var deskjs=require(_0x4912('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4912('0xf'));var Papa=require(_0x4912('0x10'));var Redis=require(_0x4912('0x11'));var authService=require(_0x4912('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4912('0x13'));var logger=require(_0x4912('0x14'))(_0x4912('0x15'));var utils=require(_0x4912('0x16'));var config=require(_0x4912('0x17'));var db=require(_0x4912('0x18'))['db'];config[_0x4912('0x19')]=_['defaults'](config['redis'],{'host':_0x4912('0x1a'),'port':0x18eb});var socket=require(_0x4912('0x1b'))(new Redis(config['redis']));require(_0x4912('0x1c'))['register'](socket);var jayson=require(_0x4912('0x1d'));var client=jayson[_0x4912('0x1e')][_0x4912('0x1f')]({'port':0x232c});function checkPasswordPattern(_0x5d56a2,_0x540651,_0x25db45){if(_0x25db45){var _0x2d56b7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d56b7[_0x4912('0x20')](_0x540651)){return _0x5d56a2;}else{throw new Error(_0x4912('0x21'));}}else{return _0x5d56a2;}}function respondWithRpcPromise(_0x1dc44,_0x1db5f0,_0x3f81bf,_0x3a6d9f){return new BPromise(function(_0xfb9f9a,_0x4bec60){var _0xc943dc=_0x3a6d9f||client;return _0xc943dc[_0x4912('0x22')](_0x1dc44,_0x3f81bf)[_0x4912('0x23')](function(_0x174d21){logger[_0x4912('0x24')](_0x4912('0x25'),_0x1db5f0,'request\x20sent');logger[_0x4912('0x26')](_0x4912('0x27'),_0x1db5f0,_0x4912('0x28'),JSON[_0x4912('0x29')](_0x174d21));if(_0x174d21['error']){if(_0x174d21[_0x4912('0x2a')][_0x4912('0x2b')]===0x1f4){logger[_0x4912('0x2a')](_0x4912('0x25'),_0x1db5f0,_0x174d21[_0x4912('0x2a')][_0x4912('0x2c')]);return _0x4bec60(_0x174d21[_0x4912('0x2a')][_0x4912('0x2c')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x1db5f0,_0x174d21[_0x4912('0x2a')]['message']);return _0xfb9f9a(_0x174d21['error'][_0x4912('0x2c')]);}else{logger[_0x4912('0x24')](_0x4912('0x25'),_0x1db5f0,_0x4912('0x28'));_0xfb9f9a(_0x174d21[_0x4912('0x2d')][_0x4912('0x2c')]);}})[_0x4912('0x2e')](function(_0xb082c1){logger['error'](_0x4912('0x25'),_0x1db5f0,_0xb082c1);_0x4bec60(_0xb082c1);});});}function respondWithStatusCode(_0x37bb48,_0x52cc61){_0x52cc61=_0x52cc61||0xcc;return function(_0x2c304f){if(_0x2c304f){return _0x37bb48['sendStatus'](_0x52cc61);}return _0x37bb48[_0x4912('0x2f')](_0x52cc61)[_0x4912('0x30')]();};}function respondWithResult(_0x5705ff,_0x53c1e8){_0x53c1e8=_0x53c1e8||0xc8;return function(_0x1dd162){if(_0x1dd162){return _0x5705ff[_0x4912('0x2f')](_0x53c1e8)[_0x4912('0x31')](_0x1dd162);}};}function respondWithFilteredResult(_0x624d98,_0xe44b94){return function(_0x3c8c24){if(_0x3c8c24){var _0x160d81=_0x3c8c24[_0x4912('0x32')],_0x5d7dd7=_0xe44b94[_0x4912('0x33')],_0x4b4ea8=_0xe44b94[_0x4912('0x33')]+_0xe44b94['limit'],_0x4f49d9;if(_0x4b4ea8>=_0x160d81){_0x4b4ea8=_0x160d81;_0x4f49d9=0xc8;}else{_0x4f49d9=0xce;}_0x624d98[_0x4912('0x2f')](_0x4f49d9);return _0x624d98[_0x4912('0x34')](_0x4912('0x35'),_0x5d7dd7+'-'+_0x4b4ea8+'/'+_0x160d81)[_0x4912('0x31')](_0x3c8c24);}return null;};}function patchUpdates(_0x573a23){return function(_0x507a5a){try{jsonpatch[_0x4912('0x36')](_0x507a5a,_0x573a23,!![]);}catch(_0x3d030e){return BPromise[_0x4912('0x37')](_0x3d030e);}return _0x507a5a[_0x4912('0x38')]();};}function saveUpdates(_0x22b6f0,_0x4a9d3e){return function(_0x3e5ee3){if(_0x3e5ee3){return _0x3e5ee3[_0x4912('0x39')](_0x22b6f0)[_0x4912('0x23')](function(_0x4920c4){return _0x4920c4;});}return null;};}function removeEntity(_0x534981,_0x264571){return function(_0x5a0ead){if(_0x5a0ead){return _0x5a0ead[_0x4912('0x3a')]()[_0x4912('0x23')](function(){var _0x3e251b=_0x5a0ead[_0x4912('0x3b')]({'plain':!![]});var _0x4aed04=_0x4912('0x3c');return db[_0x4912('0x3d')][_0x4912('0x3a')]({'where':{'type':_0x4aed04,'resourceId':_0x3e251b['id']}})['then'](function(){return _0x5a0ead;});})[_0x4912('0x23')](function(){_0x534981[_0x4912('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b5a68,_0x46f496){return function(_0x2eecba){if(!_0x2eecba){_0x2b5a68[_0x4912('0x3e')](0x194);}return _0x2eecba;};}function handleError(_0x439aa7,_0x58c28a){_0x58c28a=_0x58c28a||0x1f4;return function(_0xa6d90b){logger['error'](_0xa6d90b[_0x4912('0x3f')]);if(_0xa6d90b[_0x4912('0x40')]){delete _0xa6d90b[_0x4912('0x40')];}_0x439aa7[_0x4912('0x2f')](_0x58c28a)['send'](_0xa6d90b);};}exports[_0x4912('0x41')]=function(_0x492ac1,_0x3e2472){var _0x339235={'include':[{'model':db[_0x4912('0x42')],'as':_0x4912('0x43')}]},_0x2583b1={},_0x1fdcf3={'count':0x0,'rows':[]};var _0x5ec997=db['SmsAccount'][_0x4912('0x44')];_0x2583b1[_0x4912('0x45')]=_['keys'](_0x5ec997);_0x2583b1[_0x4912('0x46')]=_[_0x4912('0x47')](_0x492ac1[_0x4912('0x46')]);_0x2583b1[_0x4912('0x48')]=_[_0x4912('0x49')](_0x2583b1[_0x4912('0x45')],_0x2583b1['query']);_0x339235[_0x4912('0x4a')]=_[_0x4912('0x49')](_0x2583b1[_0x4912('0x45')],qs[_0x4912('0x4b')](_0x492ac1[_0x4912('0x46')][_0x4912('0x4b')]));_0x339235[_0x4912('0x4a')]=_0x339235['attributes'][_0x4912('0x4c')]?_0x339235['attributes']:_0x2583b1[_0x4912('0x45')];if(!_0x492ac1['query'][_0x4912('0x4d')](_0x4912('0x4e'))){_0x339235[_0x4912('0x4f')]=qs[_0x4912('0x4f')](_0x492ac1[_0x4912('0x46')][_0x4912('0x4f')]);_0x339235['offset']=qs[_0x4912('0x33')](_0x492ac1[_0x4912('0x46')][_0x4912('0x33')]);}_0x339235['order']=qs[_0x4912('0x50')](_0x492ac1['query'][_0x4912('0x50')]);_0x339235[_0x4912('0x51')]=qs[_0x4912('0x48')](_[_0x4912('0x52')](_0x492ac1['query'],_0x2583b1['filters']));if(_0x492ac1[_0x4912('0x46')][_0x4912('0x53')]){_0x339235[_0x4912('0x51')]=_[_0x4912('0x54')](_0x339235[_0x4912('0x51')],{'$or':_['map'](_0x5ec997,function(_0x3d419a){if(_0x3d419a[_0x4912('0x55')][_0x4912('0x56')]!==_0x4912('0x57')){var _0x35f9b8={};_0x35f9b8[_0x3d419a[_0x4912('0x58')]]={'$like':'%'+_0x492ac1[_0x4912('0x46')]['filter']+'%'};return _0x35f9b8;}})});}_0x339235=_[_0x4912('0x54')]({},_0x339235,_0x492ac1[_0x4912('0x59')]);var _0x55c88a={'where':_0x339235[_0x4912('0x51')]};return db[_0x4912('0x5a')][_0x4912('0x32')](_0x55c88a)[_0x4912('0x23')](function(_0x2cecb0){_0x1fdcf3[_0x4912('0x32')]=_0x2cecb0;if(_0x492ac1[_0x4912('0x46')][_0x4912('0x5b')]){_0x339235[_0x4912('0x5c')]=[{'all':!![]}];}return db['SmsAccount'][_0x4912('0x5d')](_0x339235);})[_0x4912('0x23')](function(_0x346142){_0x1fdcf3['rows']=_0x346142;return _0x1fdcf3;})[_0x4912('0x23')](respondWithFilteredResult(_0x3e2472,_0x339235))[_0x4912('0x2e')](handleError(_0x3e2472,null));};exports[_0x4912('0x5e')]=function(_0xf0c86a,_0x29e781){var _0x147010={'raw':![],'where':{'id':_0xf0c86a['params']['id']},'include':[{'model':db[_0x4912('0x42')],'as':'mandatoryDispositionPause'}]},_0x26aaeb={};_0x26aaeb[_0x4912('0x45')]=_[_0x4912('0x47')](db[_0x4912('0x5a')][_0x4912('0x44')]);_0x26aaeb[_0x4912('0x46')]=_[_0x4912('0x47')](_0xf0c86a[_0x4912('0x46')]);_0x26aaeb[_0x4912('0x48')]=_[_0x4912('0x49')](_0x26aaeb['model'],_0x26aaeb['query']);_0x147010[_0x4912('0x4a')]=_['intersection'](_0x26aaeb[_0x4912('0x45')],qs[_0x4912('0x4b')](_0xf0c86a['query'][_0x4912('0x4b')]));_0x147010[_0x4912('0x4a')]=_0x147010[_0x4912('0x4a')][_0x4912('0x4c')]?_0x147010[_0x4912('0x4a')]:_0x26aaeb['model'];if(_0xf0c86a['query']['includeAll']){_0x147010[_0x4912('0x5c')]=[{'all':!![]}];}_0x147010=_[_0x4912('0x54')]({},_0x147010,_0xf0c86a[_0x4912('0x59')]);return db['SmsAccount'][_0x4912('0x5f')](_0x147010)['then'](handleEntityNotFound(_0x29e781,null))['then'](respondWithResult(_0x29e781,null))[_0x4912('0x2e')](handleError(_0x29e781,null));};exports[_0x4912('0x60')]=function(_0xe009b,_0x3c27fc){return db[_0x4912('0x5a')][_0x4912('0x60')](_0xe009b[_0x4912('0x61')],{})[_0x4912('0x23')](function(_0x539438){var _0x10517e=_0xe009b[_0x4912('0x62')][_0x4912('0x3b')]({'plain':!![]});if(!_0x10517e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10517e[_0x4912('0x63')]===_0x4912('0x62')){var _0x70b34b=_0x539438[_0x4912('0x3b')]({'plain':!![]});var _0x44c096='SmsAccounts';return db[_0x4912('0x64')][_0x4912('0x5f')]({'where':{'name':_0x44c096,'userProfileId':_0x10517e[_0x4912('0x65')]},'raw':!![]})[_0x4912('0x23')](function(_0x17b584){if(_0x17b584&&_0x17b584[_0x4912('0x66')]===0x0){return db[_0x4912('0x3d')][_0x4912('0x60')]({'name':_0x70b34b[_0x4912('0x40')],'resourceId':_0x70b34b['id'],'type':_0x17b584[_0x4912('0x40')],'sectionId':_0x17b584['id']},{})[_0x4912('0x23')](function(){return _0x539438;});}else{return _0x539438;}})['catch'](function(_0x4daa68){logger[_0x4912('0x2a')](_0x4912('0x67'),_0x4daa68);throw _0x4daa68;});}return _0x539438;})[_0x4912('0x23')](respondWithResult(_0x3c27fc,0xc9))[_0x4912('0x2e')](handleError(_0x3c27fc,null));};exports[_0x4912('0x39')]=function(_0x1f9a5f,_0x1ae13f){if(_0x1f9a5f[_0x4912('0x61')]['id']){delete _0x1f9a5f[_0x4912('0x61')]['id'];}return db[_0x4912('0x5a')][_0x4912('0x5f')]({'where':{'id':_0x1f9a5f['params']['id']},'include':[{'model':db['Pause'],'as':_0x4912('0x43')}]})[_0x4912('0x23')](handleEntityNotFound(_0x1ae13f,null))['then'](saveUpdates(_0x1f9a5f[_0x4912('0x61')],null))[_0x4912('0x23')](respondWithResult(_0x1ae13f,null))[_0x4912('0x2e')](handleError(_0x1ae13f,null));};exports['destroy']=function(_0x383665,_0x1b9db6){return db[_0x4912('0x5a')][_0x4912('0x5f')]({'where':{'id':_0x383665['params']['id']}})[_0x4912('0x23')](handleEntityNotFound(_0x1b9db6,null))[_0x4912('0x23')](removeEntity(_0x1b9db6,null))['catch'](handleError(_0x1b9db6,null));};exports[_0x4912('0x68')]=function(_0xccd78f,_0x36a142){return db[_0x4912('0x5a')][_0x4912('0x68')]()[_0x4912('0x23')](respondWithResult(_0x36a142,null))[_0x4912('0x2e')](handleError(_0x36a142,null));};exports[_0x4912('0x69')]=function(_0x48b8a0,_0x51aa79,_0x8ff8cb){if(_0x48b8a0[_0x4912('0x61')]['id']){delete _0x48b8a0[_0x4912('0x61')]['id'];}return db['SmsAccount'][_0x4912('0x5f')]({'where':{'id':_0x48b8a0[_0x4912('0x6a')]['id']}})[_0x4912('0x23')](handleEntityNotFound(_0x51aa79,null))['then'](function(_0x265c4d){if(_0x265c4d){_0x48b8a0[_0x4912('0x61')][_0x4912('0x6b')]=_0x265c4d['id'];return db[_0x4912('0x6c')]['create'](_0x48b8a0[_0x4912('0x61')]);}})['then'](respondWithResult(_0x51aa79,null))['catch'](handleError(_0x51aa79,null));};exports[_0x4912('0x6d')]=function(_0x344964,_0x447229,_0x282f1c){var _0x20c0dd={'raw':![],'where':{}};var _0x2dcb69={};var _0x25e550={'count':0x0,'rows':[]};return db['SmsAccount'][_0x4912('0x6e')]({'where':{'id':_0x344964[_0x4912('0x6a')]['id']}})[_0x4912('0x23')](handleEntityNotFound(_0x447229,null))['then'](function(_0x55c6b3){if(_0x55c6b3){_0x2dcb69[_0x4912('0x45')]=_[_0x4912('0x47')](db[_0x4912('0x6c')][_0x4912('0x44')]);_0x2dcb69[_0x4912('0x46')]=_[_0x4912('0x47')](_0x344964[_0x4912('0x46')]);_0x2dcb69[_0x4912('0x48')]=_['intersection'](_0x2dcb69[_0x4912('0x45')],_0x2dcb69[_0x4912('0x46')]);_0x20c0dd['attributes']=_[_0x4912('0x49')](_0x2dcb69[_0x4912('0x45')],qs[_0x4912('0x4b')](_0x344964[_0x4912('0x46')][_0x4912('0x4b')]));_0x20c0dd[_0x4912('0x4a')]=_0x20c0dd['attributes'][_0x4912('0x4c')]?_0x20c0dd[_0x4912('0x4a')]:_0x2dcb69[_0x4912('0x45')];if(!_0x344964[_0x4912('0x46')][_0x4912('0x4d')]('nolimit')){_0x20c0dd[_0x4912('0x4f')]=qs[_0x4912('0x4f')](_0x344964['query'][_0x4912('0x4f')]);_0x20c0dd[_0x4912('0x33')]=qs['offset'](_0x344964[_0x4912('0x46')][_0x4912('0x33')]);}_0x20c0dd['order']=qs[_0x4912('0x50')](_0x344964[_0x4912('0x46')][_0x4912('0x50')]);_0x20c0dd[_0x4912('0x51')]=qs[_0x4912('0x48')](_[_0x4912('0x52')](_0x344964['query'],_0x2dcb69['filters']));_0x20c0dd['where'][_0x4912('0x6b')]=_0x55c6b3['id'];if(_0x344964[_0x4912('0x46')][_0x4912('0x53')]){_0x20c0dd[_0x4912('0x51')]=_[_0x4912('0x54')](_0x20c0dd[_0x4912('0x51')],{'$or':_['map'](_0x20c0dd['attributes'],function(_0x13b419){var _0x2dc744={};_0x2dc744[_0x13b419]={'$like':'%'+_0x344964[_0x4912('0x46')][_0x4912('0x53')]+'%'};return _0x2dc744;})});}_0x20c0dd=_['merge']({},_0x20c0dd,_0x344964['options']);return db[_0x4912('0x6c')][_0x4912('0x32')]({'where':_0x20c0dd['where']})[_0x4912('0x23')](function(_0x1e94a4){_0x25e550[_0x4912('0x32')]=_0x1e94a4;if(_0x344964[_0x4912('0x46')][_0x4912('0x5b')]){_0x20c0dd[_0x4912('0x5c')]=[{'all':!![]}];}return db[_0x4912('0x6c')][_0x4912('0x5d')](_0x20c0dd);})[_0x4912('0x23')](function(_0x2909b8){_0x25e550['rows']=_0x2909b8;return _0x25e550;});}})[_0x4912('0x23')](respondWithFilteredResult(_0x447229,_0x20c0dd))[_0x4912('0x2e')](handleError(_0x447229,null));};exports[_0x4912('0x6f')]=function(_0x3cfa5d,_0x469e3c,_0x157953){return db[_0x4912('0x5a')][_0x4912('0x5f')]({'where':{'id':_0x3cfa5d[_0x4912('0x6a')]['id']}})[_0x4912('0x23')](handleEntityNotFound(_0x469e3c,null))[_0x4912('0x23')](function(_0x2e4490){if(_0x2e4490){return _0x2e4490['removeDispositions'](_0x3cfa5d[_0x4912('0x46')][_0x4912('0x70')]);}})[_0x4912('0x23')](respondWithStatusCode(_0x469e3c,null))[_0x4912('0x2e')](handleError(_0x469e3c,null));};exports[_0x4912('0x71')]=function(_0x1bcfcc,_0x56c934,_0x45ec47){if(_0x1bcfcc['body']['id']){delete _0x1bcfcc[_0x4912('0x61')]['id'];}return db[_0x4912('0x5a')]['find']({'where':{'id':_0x1bcfcc[_0x4912('0x6a')]['id']}})[_0x4912('0x23')](handleEntityNotFound(_0x56c934,null))[_0x4912('0x23')](function(_0x1ff53e){if(_0x1ff53e){_0x1bcfcc[_0x4912('0x61')][_0x4912('0x6b')]=_0x1ff53e['id'];return db['CannedAnswer'][_0x4912('0x60')](_0x1bcfcc[_0x4912('0x61')]);}})[_0x4912('0x23')](respondWithResult(_0x56c934,null))[_0x4912('0x2e')](handleError(_0x56c934,null));};exports['getAnswers']=function(_0x4b9f1c,_0x503030,_0x6fa49c){var _0x4b6f13={'raw':![],'where':{}};var _0x1ee456={};var _0x56141e={'count':0x0,'rows':[]};return db[_0x4912('0x5a')][_0x4912('0x6e')]({'where':{'id':_0x4b9f1c[_0x4912('0x6a')]['id']}})[_0x4912('0x23')](handleEntityNotFound(_0x503030,null))[_0x4912('0x23')](function(_0x1de2e3){if(_0x1de2e3){_0x1ee456[_0x4912('0x45')]=_[_0x4912('0x47')](db[_0x4912('0x72')][_0x4912('0x44')]);_0x1ee456[_0x4912('0x46')]=_[_0x4912('0x47')](_0x4b9f1c[_0x4912('0x46')]);_0x1ee456['filters']=_[_0x4912('0x49')](_0x1ee456[_0x4912('0x45')],_0x1ee456[_0x4912('0x46')]);_0x4b6f13['attributes']=_[_0x4912('0x49')](_0x1ee456[_0x4912('0x45')],qs['fields'](_0x4b9f1c[_0x4912('0x46')][_0x4912('0x4b')]));_0x4b6f13['attributes']=_0x4b6f13['attributes'][_0x4912('0x4c')]?_0x4b6f13[_0x4912('0x4a')]:_0x1ee456[_0x4912('0x45')];if(!_0x4b9f1c['query'][_0x4912('0x4d')](_0x4912('0x4e'))){_0x4b6f13[_0x4912('0x4f')]=qs[_0x4912('0x4f')](_0x4b9f1c['query'][_0x4912('0x4f')]);_0x4b6f13[_0x4912('0x33')]=qs[_0x4912('0x33')](_0x4b9f1c['query'][_0x4912('0x33')]);}_0x4b6f13[_0x4912('0x73')]=qs[_0x4912('0x50')](_0x4b9f1c[_0x4912('0x46')][_0x4912('0x50')]);_0x4b6f13[_0x4912('0x51')]=qs['filters'](_['pick'](_0x4b9f1c[_0x4912('0x46')],_0x1ee456['filters']));_0x4b6f13[_0x4912('0x51')]['SmsAccountId']=_0x1de2e3['id'];if(_0x4b9f1c['query']['filter']){_0x4b6f13[_0x4912('0x51')]=_[_0x4912('0x54')](_0x4b6f13[_0x4912('0x51')],{'$or':_[_0x4912('0x74')](_0x4b6f13[_0x4912('0x4a')],function(_0x43e1cd){var _0x345bb0={};_0x345bb0[_0x43e1cd]={'$like':'%'+_0x4b9f1c[_0x4912('0x46')][_0x4912('0x53')]+'%'};return _0x345bb0;})});}_0x4b6f13=_[_0x4912('0x54')]({},_0x4b6f13,_0x4b9f1c[_0x4912('0x59')]);return db[_0x4912('0x72')][_0x4912('0x32')]({'where':_0x4b6f13[_0x4912('0x51')]})[_0x4912('0x23')](function(_0x115e7a){_0x56141e[_0x4912('0x32')]=_0x115e7a;if(_0x4b9f1c[_0x4912('0x46')][_0x4912('0x5b')]){_0x4b6f13['include']=[{'all':!![]}];}return db[_0x4912('0x72')][_0x4912('0x5d')](_0x4b6f13);})[_0x4912('0x23')](function(_0x342cf5){_0x56141e[_0x4912('0x75')]=_0x342cf5;return _0x56141e;});}})[_0x4912('0x23')](respondWithFilteredResult(_0x503030,_0x4b6f13))[_0x4912('0x2e')](handleError(_0x503030,null));};exports[_0x4912('0x76')]=function(_0xd814d,_0x3e903d,_0x18ccac){return db['SmsAccount']['find']({'where':{'id':_0xd814d[_0x4912('0x6a')]['id']}})['then'](handleEntityNotFound(_0x3e903d,null))['then'](function(_0x1207a4){if(_0x1207a4){return _0x1207a4['removeAnswers'](_0xd814d[_0x4912('0x46')][_0x4912('0x70')]);}})['then'](respondWithStatusCode(_0x3e903d,null))[_0x4912('0x2e')](handleError(_0x3e903d,null));};exports[_0x4912('0x77')]=function(_0x46c747,_0x6d4ac4,_0x2275aa){var _0x3f918a={'channel':_0x4912('0x78')};var _0x23a4ea=[];var _0xf14b05=[];var _0x30ac6e={};return db[_0x4912('0x5a')][_0x4912('0x5f')]({'where':{'id':_0x46c747[_0x4912('0x6a')]['id']},'include':[{'model':db[_0x4912('0x79')],'as':_0x4912('0x7a')}]})[_0x4912('0x23')](handleEntityNotFound(_0x6d4ac4,null))[_0x4912('0x23')](function(_0x654f4e){_0x3f918a[_0x4912('0x7b')]=_0x654f4e;_0x3f918a[_0x4912('0x7c')]=_[_0x4912('0x7d')](_0x654f4e[_0x4912('0x7a')],[_0x4912('0x7e')],[_0x4912('0x7f')]);if(_0x3f918a[_0x4912('0x7b')]['Applications']){delete _0x3f918a[_0x4912('0x7b')][_0x4912('0x7a')];}return db[_0x4912('0x80')][_0x4912('0x68')]();})[_0x4912('0x23')](function(_0x353eef){if(!_0x353eef){throw new db[(_0x4912('0x81'))]['ValidationError']('no\x20available\x20attributes');}_0x23a4ea=_[_0x4912('0x82')](_[_0x4912('0x47')](_0x353eef),[_0x4912('0x83'),_0x4912('0x84')]);_0xf14b05=_['difference'](_[_0x4912('0x47')](_0x353eef),[_0x4912('0x83'),_0x4912('0x84'),'CompanyId',_0x4912('0x85')]);_0x3f918a['body']={'mapKey':_0x4912('0x86')};if(_0x3f918a['account']['type']){switch(_0x3f918a[_0x4912('0x7b')]['type']){case _0x4912('0x87'):_0x3f918a['body'][_0x4912('0x88')]=_0x46c747[_0x4912('0x61')][_0x4912('0x89')];_0x3f918a[_0x4912('0x61')]['body']=_0x46c747[_0x4912('0x61')][_0x4912('0x8a')];_0x3f918a[_0x4912('0x61')][_0x4912('0x8b')]=_0x46c747[_0x4912('0x61')]['MessageSid'];break;case _0x4912('0x8c'):_0x3f918a[_0x4912('0x61')][_0x4912('0x88')]='+'+_0x46c747[_0x4912('0x61')][_0x4912('0x8d')];_0x3f918a['body']['body']=_0x46c747['body'][_0x4912('0x8e')];break;case'connectel':_0x3f918a[_0x4912('0x61')][_0x4912('0x88')]=_0x46c747[_0x4912('0x61')][_0x4912('0x88')];_0x3f918a[_0x4912('0x61')][_0x4912('0x61')]=_0x46c747[_0x4912('0x61')][_0x4912('0x2c')];break;case'clicksend':_0x3f918a[_0x4912('0x61')][_0x4912('0x88')]=_0x46c747['body'][_0x4912('0x88')];_0x3f918a[_0x4912('0x61')]['body']=_0x46c747['body'][_0x4912('0x61')];_0x3f918a[_0x4912('0x61')][_0x4912('0x8b')]=_0x46c747['body'][_0x4912('0x8f')];break;case _0x4912('0x90'):_0x3f918a[_0x4912('0x61')][_0x4912('0x88')]=_0x46c747[_0x4912('0x61')]['From'];_0x3f918a[_0x4912('0x61')][_0x4912('0x61')]=_0x46c747[_0x4912('0x61')][_0x4912('0x91')];_0x3f918a[_0x4912('0x61')][_0x4912('0x8b')]=_0x46c747[_0x4912('0x61')][_0x4912('0x92')];break;case'infobip':_0x3f918a[_0x4912('0x61')][_0x4912('0x88')]='+'+_0x46c747[_0x4912('0x61')][_0x4912('0x93')][0x0][_0x4912('0x88')];_0x3f918a[_0x4912('0x61')][_0x4912('0x61')]=_0x46c747[_0x4912('0x61')][_0x4912('0x93')][0x0][_0x4912('0x8e')];_0x3f918a[_0x4912('0x61')]['messageId']=_0x46c747[_0x4912('0x61')][_0x4912('0x93')][0x0][_0x4912('0x8b')];break;case _0x4912('0x94'):_0x3f918a[_0x4912('0x61')]['from']=_0x46c747[_0x4912('0x61')][_0x4912('0x95')];_0x3f918a['body']['body']=_0x46c747[_0x4912('0x61')][_0x4912('0x96')][_0x4912('0x2c')];break;case _0x4912('0x97'):_0x3f918a['body'][_0x4912('0x88')]=_0x46c747[_0x4912('0x61')][_0x4912('0x98')];_0x3f918a['body']['body']=_0x46c747[_0x4912('0x61')][_0x4912('0x8e')];_0x3f918a[_0x4912('0x61')][_0x4912('0x8b')]=_0x46c747['body']['replyMessageId'];break;case _0x4912('0x99'):_0x3f918a[_0x4912('0x61')]['from']=_0x46c747[_0x4912('0x61')][_0x4912('0x88')];_0x3f918a[_0x4912('0x61')][_0x4912('0x61')]=_0x46c747[_0x4912('0x61')][_0x4912('0x2c')];_0x3f918a['body'][_0x4912('0x8b')]=_0x46c747[_0x4912('0x61')][_0x4912('0x9a')];break;}}if(_0x3f918a[_0x4912('0x61')]['id']){delete _0x3f918a[_0x4912('0x61')]['id'];}if(_['isNil'](_0x3f918a[_0x4912('0x61')]['from'])){throw new db[(_0x4912('0x81'))][(_0x4912('0x9b'))](_0x4912('0x9c'));}if(_['isNil'](_0x3f918a[_0x4912('0x61')]['body'])||_0x3f918a[_0x4912('0x61')][_0x4912('0x61')]===''){throw new db[(_0x4912('0x81'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4912('0x9d')](_0x3f918a[_0x4912('0x61')][_0x4912('0x9e')])){throw new db['Sequelize'][(_0x4912('0x9b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf14b05);}if(!_[_0x4912('0x9f')](_0xf14b05,_0x3f918a[_0x4912('0x61')]['mapKey'])){throw new db['Sequelize'][(_0x4912('0x9b'))](_0x4912('0xa0')+_0xf14b05);}_0x30ac6e[_0x3f918a[_0x4912('0x61')][_0x4912('0x9e')]]=_0x3f918a[_0x4912('0x61')][_0x4912('0x88')];return db[_0x4912('0xa1')][_0x4912('0x5f')]({'where':{'id':_0x3f918a[_0x4912('0x7b')][_0x4912('0x85')]},'include':[{'model':db[_0x4912('0x80')],'as':_0x4912('0xa2'),'where':_0x30ac6e,'limit':0x1,'order':[['updatedAt',_0x4912('0xa3')]]}]});})[_0x4912('0x23')](handleEntityNotFound(_0x6d4ac4,null))[_0x4912('0x23')](function(_0x44a27a){if(_0x44a27a){_0x3f918a[_0x4912('0xa4')]=_['omit'](_0x44a27a,[_0x4912('0xa2')]);if(_0x44a27a[_0x4912('0xa2')][_0x4912('0x4c')]){return _0x44a27a[_0x4912('0xa2')][0x0];}var _0x23e73b=_[_0x4912('0xa5')](_0x3f918a['body'],{'firstName':_0x3f918a['body'][_0x4912('0x88')],'ListId':_0x44a27a['id']});_0x23e73b[_0x3f918a[_0x4912('0x61')][_0x4912('0x9e')]]=_0x3f918a[_0x4912('0x61')]['from'];return db['CmContact'][_0x4912('0x60')](_0x23e73b,{'fields':_0x23a4ea,'raw':!![]});}})[_0x4912('0x23')](handleEntityNotFound(_0x6d4ac4,null))[_0x4912('0x23')](function(_0x32cdca){if(_0x32cdca){_0x3f918a[_0x4912('0xa6')]=_0x32cdca;var _0x556f31={'ContactId':_0x32cdca['id'],'phone':_0x3f918a[_0x4912('0x61')][_0x4912('0x88')],'SmsAccountId':_0x46c747['params']['id']};var _0x43d511={'ContactId':_0x32cdca['id'],'SmsAccountId':_0x46c747['params']['id'],'closed':![]};return db[_0x4912('0xa7')]['find']({'where':_0x43d511})['then'](function(_0x1cb604){if(_0x1cb604){return[_0x1cb604,![]];}return db[_0x4912('0xa7')][_0x4912('0x60')](_0x556f31)[_0x4912('0x23')](function(_0x2260aa){return[_0x2260aa,!![]];});});}})[_0x4912('0xa8')](function(_0x53df5d,_0x18f813){_0x3f918a['interaction']=_0x53df5d[_0x4912('0x3b')]({'plain':!![]});_0x3f918a[_0x4912('0xa9')][_0x4912('0xaa')]=![];if(_0x18f813){if(_0x3f918a['account'][_0x4912('0xab')]){_0x3f918a[_0x4912('0x7c')]['push']({'id':0x0,'priority':_0x3f918a[_0x4912('0x7c')][_0x4912('0x4c')]+0x1,'app':_0x4912('0xac'),'appdata':_0x4912('0xad'),'interval':_0x4912('0xae')});}_0x3f918a['interaction'][_0x4912('0xaa')]=!![];}return db[_0x4912('0xaf')][_0x4912('0x60')]({'phone':_0x3f918a[_0x4912('0x61')][_0x4912('0x88')],'messageId':_0x3f918a[_0x4912('0x61')]['messageId'],'body':_0x3f918a[_0x4912('0x61')][_0x4912('0x61')],'SmsAccountId':_0x46c747[_0x4912('0x6a')]['id'],'SmsInteractionId':_0x53df5d['id'],'direction':'in','ContactId':_0x53df5d[_0x4912('0xb0')],'AttachmentId':_0x3f918a['body'][_0x4912('0xb1')]});})[_0x4912('0x23')](function(_0x32ef16){_0x3f918a[_0x4912('0x2c')]=_0x32ef16;if(_0x3f918a['interaction'][_0x4912('0xb2')]){return db[_0x4912('0xb3')][_0x4912('0x5f')]({'attributes':['id',_0x4912('0x40')],'where':{'id':_0x3f918a['interaction'][_0x4912('0xb2')]}})[_0x4912('0x23')](function(_0x3f2d94){if(_0x3f2d94){_0x3f918a[_0x4912('0x7c')][_0x4912('0xb4')]({'id':0x0,'priority':0x0,'app':_0x4912('0xb5'),'appdata':_0x3f2d94[_0x4912('0x40')]+','+(_0x3f918a[_0x4912('0x7b')][_0x4912('0xb6')]||0xa),'interval':_0x4912('0xae')});}return respondWithRpcPromise('Start',_0x4912('0xb7'),_0x3f918a);});}return respondWithRpcPromise(_0x4912('0xb8'),_0x4912('0xb7'),_0x3f918a);})[_0x4912('0x23')](function(_0x5ed184){if(_0x5ed184){var _0x2c9714=0xc8;var _0x4a3751='receiveMessage';logger['info'](_0x4912('0x27'),_0x4a3751,_0x2c9714,_0x4912('0xb9'));logger[_0x4912('0x26')](_0x4912('0xba'),_0x4a3751,_0x2c9714,'entity\x20found',JSON[_0x4912('0x29')](_0x5ed184));if(_0x3f918a['account'][_0x4912('0x55')]===_0x4912('0x87')){return _0x6d4ac4[_0x4912('0x2f')](_0x2c9714)['set'](_0x4912('0xbb'),'text/xml')['send'](_0x4912('0xbc'));}else{return _0x6d4ac4[_0x4912('0x2f')](_0x2c9714)['json'](_0x5ed184);}}})[_0x4912('0x2e')](handleError(_0x6d4ac4,null));};exports[_0x4912('0xbd')]=function(_0x5454b2,_0x5c586a,_0x19735e){return db['SmsAccount']['findOne']({'where':{'id':_0x5454b2[_0x4912('0x6a')]['id']}})['then'](handleEntityNotFound(_0x5c586a,null))[_0x4912('0x23')](function(_0x5eb3b8){if(_0x5eb3b8){return db[_0x4912('0xbe')][_0x4912('0xbf')](function(_0x5cbeca){return db['SmsApplication'][_0x4912('0x3a')]({'where':{'SmsAccountId':_0x5454b2[_0x4912('0x6a')]['id']},'transaction':_0x5cbeca})[_0x4912('0x23')](function(_0x51e645){var _0x508939=_[_0x4912('0x74')](_0x5454b2[_0x4912('0x61')],function(_0x57df37){_0x57df37['SmsAccountId']=_0x5454b2[_0x4912('0x6a')]['id'];return _0x57df37;});return db[_0x4912('0x79')][_0x4912('0xc0')](_0x508939,{'transaction':_0x5cbeca});});})[_0x4912('0x23')](function(){return db['SmsApplication'][_0x4912('0xc1')]({'where':{'SmsAccountId':_0x5454b2[_0x4912('0x6a')]['id']},'order':_0x4912('0x7e')});});}})[_0x4912('0x23')](respondWithResult(_0x5c586a,null))['catch'](handleError(_0x5c586a,null));};exports[_0x4912('0xc2')]=function(_0x351e88,_0x23538f,_0xadfd22){var _0x54b963={};var _0x4ee954={};var _0x125c1d;var _0x556ec4;return db[_0x4912('0x5a')][_0x4912('0x6e')]({'where':{'id':_0x351e88[_0x4912('0x6a')]['id']}})[_0x4912('0x23')](handleEntityNotFound(_0x23538f,null))['then'](function(_0x3ab0ab){if(_0x3ab0ab){_0x125c1d=_0x3ab0ab;_0x4ee954[_0x4912('0x45')]=_[_0x4912('0x47')](db[_0x4912('0x79')][_0x4912('0x44')]);_0x4ee954[_0x4912('0x46')]=_[_0x4912('0x47')](_0x351e88[_0x4912('0x46')]);_0x4ee954['filters']=_[_0x4912('0x49')](_0x4ee954['model'],_0x4ee954['query']);_0x54b963['attributes']=_['intersection'](_0x4ee954[_0x4912('0x45')],qs[_0x4912('0x4b')](_0x351e88[_0x4912('0x46')][_0x4912('0x4b')]));_0x54b963[_0x4912('0x4a')]=_0x54b963[_0x4912('0x4a')]['length']?_0x54b963['attributes']:_0x4ee954['model'];_0x54b963[_0x4912('0x73')]=qs[_0x4912('0x50')](_0x351e88['query']['sort']);_0x54b963[_0x4912('0x51')]=qs[_0x4912('0x48')](_[_0x4912('0x52')](_0x351e88[_0x4912('0x46')],_0x4ee954[_0x4912('0x48')]));if(_0x351e88[_0x4912('0x46')][_0x4912('0x53')]){_0x54b963[_0x4912('0x51')]=_[_0x4912('0x54')](_0x54b963['where'],{'$or':_[_0x4912('0x74')](_0x54b963[_0x4912('0x4a')],function(_0x4afc8a){var _0x1c1ad7={};_0x1c1ad7[_0x4afc8a]={'$like':'%'+_0x351e88[_0x4912('0x46')][_0x4912('0x53')]+'%'};return _0x1c1ad7;})});}_0x54b963=_[_0x4912('0x54')]({},_0x54b963,_0x351e88[_0x4912('0x59')]);return _0x125c1d[_0x4912('0xc2')](_0x54b963);}})[_0x4912('0x23')](function(_0x4d14ef){if(_0x4d14ef){_0x556ec4=_0x4d14ef['length'];if(!_0x351e88[_0x4912('0x46')][_0x4912('0x4d')](_0x4912('0x4e'))){_0x54b963[_0x4912('0x4f')]=qs[_0x4912('0x4f')](_0x351e88[_0x4912('0x46')][_0x4912('0x4f')]);_0x54b963[_0x4912('0x33')]=qs[_0x4912('0x33')](_0x351e88[_0x4912('0x46')][_0x4912('0x33')]);}return _0x125c1d[_0x4912('0xc2')](_0x54b963);}})[_0x4912('0x23')](function(_0x2354f9){if(_0x2354f9){return _0x2354f9?{'count':_0x556ec4,'rows':_0x2354f9}:null;}})['then'](respondWithResult(_0x23538f,null))[_0x4912('0x2e')](handleError(_0x23538f,null));};exports['getInteractions']=function(_0x189659,_0x55cc68,_0x22da4c){var _0x3b9dd2={'raw':![],'where':{}};var _0x121799={};var _0x3d7577={'count':0x0,'rows':[]};return db[_0x4912('0x5a')][_0x4912('0x6e')]({'where':{'id':_0x189659['params']['id']}})[_0x4912('0x23')](handleEntityNotFound(_0x55cc68,null))[_0x4912('0x23')](function(_0x6a1168){if(_0x6a1168){_0x121799['model']=_[_0x4912('0x47')](db[_0x4912('0xa7')]['rawAttributes']);_0x121799[_0x4912('0x46')]=_['keys'](_0x189659[_0x4912('0x46')]);_0x121799['filters']=_[_0x4912('0x49')](_0x121799[_0x4912('0x45')],_0x121799['query']);_0x3b9dd2[_0x4912('0x4a')]=_[_0x4912('0x49')](_0x121799[_0x4912('0x45')],qs[_0x4912('0x4b')](_0x189659[_0x4912('0x46')][_0x4912('0x4b')]));_0x3b9dd2['attributes']=_0x3b9dd2[_0x4912('0x4a')][_0x4912('0x4c')]?_0x3b9dd2[_0x4912('0x4a')]:_0x121799[_0x4912('0x45')];if(!_0x189659['query']['hasOwnProperty']('nolimit')){_0x3b9dd2[_0x4912('0x4f')]=qs[_0x4912('0x4f')](_0x189659[_0x4912('0x46')]['limit']);_0x3b9dd2[_0x4912('0x33')]=qs[_0x4912('0x33')](_0x189659[_0x4912('0x46')][_0x4912('0x33')]);}_0x3b9dd2[_0x4912('0x73')]=qs[_0x4912('0x50')](_0x189659[_0x4912('0x46')][_0x4912('0x50')]);_0x3b9dd2[_0x4912('0x51')]=qs[_0x4912('0x48')](_[_0x4912('0x52')](_0x189659[_0x4912('0x46')],_0x121799[_0x4912('0x48')]));_0x3b9dd2['where'][_0x4912('0x6b')]=_0x6a1168['id'];if(_0x189659[_0x4912('0x46')]['filter']){_0x3b9dd2[_0x4912('0x51')]=_[_0x4912('0x54')](_0x3b9dd2[_0x4912('0x51')],{'$or':_[_0x4912('0x74')](_0x3b9dd2['attributes'],function(_0x2befff){var _0x2bfdc2={};_0x2bfdc2[_0x2befff]={'$like':'%'+_0x189659[_0x4912('0x46')]['filter']+'%'};return _0x2bfdc2;})});}_0x3b9dd2=_[_0x4912('0x54')]({},_0x3b9dd2,_0x189659[_0x4912('0x59')]);return db[_0x4912('0xa7')]['count']({'where':_0x3b9dd2[_0x4912('0x51')]})[_0x4912('0x23')](function(_0x40b56c){_0x3d7577[_0x4912('0x32')]=_0x40b56c;if(_0x189659['query']['includeAll']){_0x3b9dd2[_0x4912('0x5c')]=[{'model':db[_0x4912('0x80')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x4912('0xc3'),'attributes':[_0x4912('0x40'),_0x4912('0xc4'),_0x4912('0xc5')],'required':![]},{'model':db[_0x4912('0xc6')],'as':_0x4912('0xc7'),'attributes':['id','name',_0x4912('0xc8')],'where':_0x189659[_0x4912('0x46')][_0x4912('0xc9')]?{'id':_0x189659['query']['tag']}:undefined,'required':_0x189659['query']['tag']?!![]:![]}];}return db[_0x4912('0xa7')]['findAll'](_0x3b9dd2);})[_0x4912('0x23')](function(_0x2c2bae){_0x3d7577[_0x4912('0x75')]=_0x2c2bae;return _0x3d7577;});}})['then'](respondWithFilteredResult(_0x55cc68,_0x3b9dd2))[_0x4912('0x2e')](handleError(_0x55cc68,null));};exports[_0x4912('0xca')]=function(_0x5df5f4,_0x26bd78,_0x383712){var _0x824152,_0xc1c12a,_0x533345;if(_[_0x4912('0x9d')](_0x5df5f4[_0x4912('0x61')]['body'])||_0x5df5f4[_0x4912('0x61')][_0x4912('0x61')]===''){throw new db[(_0x4912('0x81'))][(_0x4912('0x9b'))](_0x4912('0xcb'));}if(_[_0x4912('0x9d')](_0x5df5f4[_0x4912('0x61')]['to'])){throw new db['Sequelize'][(_0x4912('0x9b'))](_0x4912('0xcc'));}_0x824152=_0x5df5f4['body']['to'];return db[_0x4912('0x5a')]['find']({'where':{'id':_0x5df5f4[_0x4912('0x6a')]['id']},'include':[{'model':db[_0x4912('0xa1')],'as':_0x4912('0xcd'),'include':[{'model':db['CmContact'],'as':_0x4912('0xa2'),'where':{'mobile':_0x824152},'limit':0x1,'order':[['updatedAt',_0x4912('0xa3')]]}]}]})[_0x4912('0x23')](handleEntityNotFound(_0x26bd78,null))[_0x4912('0x23')](function(_0x3a53b4){if(_0x3a53b4&&_0x3a53b4['List']){_0xc1c12a=_0x3a53b4['get']({'plain':!![]});if(_0xc1c12a[_0x4912('0xcd')]&&_0xc1c12a['List'][_0x4912('0xa2')]['length']){return _0xc1c12a[_0x4912('0xcd')][_0x4912('0xa2')][0x0];}return db['CmContact']['create'](_[_0x4912('0xa5')](_0x5df5f4[_0x4912('0x61')],{'firstName':_0x824152,'mobile':_0x824152,'phone':_0x824152,'ListId':_0xc1c12a['ListId']}));}})[_0x4912('0x23')](handleEntityNotFound(_0x26bd78,null))['then'](function(_0x4f6e8a){if(_0x4f6e8a){_0x533345=_0x4f6e8a;return db['SmsInteraction'][_0x4912('0x5f')]({'where':{'ContactId':_0x533345['id'],'closed':![],'SmsAccountId':_0xc1c12a['id']}})[_0x4912('0x23')](function(_0x590f8e){if(_0x590f8e){return[_0x590f8e,![]];}return db['SmsInteraction']['create']({'UserId':_0x5df5f4[_0x4912('0x62')]['id'],'ContactId':_0x533345['id'],'SmsAccountId':_0xc1c12a['id'],'phone':_0x824152,'firstMsgDirection':_0x4912('0xce'),'Messages':[_[_0x4912('0x54')](_0x5df5f4[_0x4912('0x61')],{'read':![],'body':_0x5df5f4[_0x4912('0x61')][_0x4912('0x61')],'phone':_0x824152,'SmsAccountId':_0xc1c12a['id'],'UserId':_0x5df5f4[_0x4912('0x62')]['id'],'ContactId':_0x533345['id']})]},{'include':[{'model':db[_0x4912('0xaf')],'as':_0x4912('0xcf')}]})[_0x4912('0x23')](function(_0x226243){return[_0x226243,!![]];});});}})['spread'](function(_0x16ee6e,_0x556f01){if(_0x556f01){return _0x16ee6e;}return db[_0x4912('0xaf')]['create'](_[_0x4912('0x54')](_0x5df5f4[_0x4912('0x61')],{'read':![],'body':_0x5df5f4['body'][_0x4912('0x61')],'phone':_0x824152,'SmsAccountId':_0xc1c12a['id'],'SmsInteractionId':_0x16ee6e['id'],'UserId':_0x5df5f4[_0x4912('0x62')]['id'],'ContactId':_0x533345['id']}))[_0x4912('0x23')](function(_0x584e35){_0x16ee6e[_0x4912('0xd0')][_0x4912('0xcf')]=[];_0x16ee6e[_0x4912('0xd0')]['Messages'][_0x4912('0xd1')](_0x584e35[_0x4912('0xd0')]);return _0x16ee6e;});})[_0x4912('0x23')](respondWithResult(_0x26bd78,null))[_0x4912('0x2e')](handleError(_0x26bd78,null));};exports[_0x4912('0x2f')]=function(_0x270fc3,_0x445a0c,_0x3805c8){if(_0x270fc3[_0x4912('0x61')]['id']){delete _0x270fc3[_0x4912('0x61')]['id'];}console[_0x4912('0xd2')]('endpoint\x20/status\x20POST\x20/',_0x270fc3[_0x4912('0x61')]);var _0x33247f,_0x52b909,_0x3b755e;return db[_0x4912('0x5a')][_0x4912('0x5f')]({'where':{'id':_0x270fc3[_0x4912('0x6a')]['id']}})[_0x4912('0x23')](handleEntityNotFound(_0x445a0c,null))[_0x4912('0x23')](function(_0x4b9005){if(_0x4b9005){_0x3b755e=_0x4b9005;logger[_0x4912('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x4b9005[_0x4912('0x55')],util[_0x4912('0xd3')](_0x270fc3[_0x4912('0x61')],{'showHidden':![],'depth':null}));switch(_0x4b9005[_0x4912('0x55')]){case'skebby':if(_0x270fc3['body']['skebby_dispatch_id']&&_0x270fc3[_0x4912('0x61')]['status']){_0x52b909=_0x270fc3[_0x4912('0x61')][_0x4912('0x2f')];return db['SmsMessage']['find']({'where':{'messageId':_0x270fc3[_0x4912('0x61')][_0x4912('0xd4')]}});}break;case _0x4912('0xd5'):if(_0x270fc3[_0x4912('0x61')][_0x4912('0xd6')]&&_0x270fc3[_0x4912('0x61')][_0x4912('0xd7')]){_0x52b909=_0x270fc3['body']['statusInt'];return db['SmsMessage'][_0x4912('0x5f')]({'where':{'messageId':_0x270fc3[_0x4912('0x61')][_0x4912('0xd6')]}});}break;case _0x4912('0xd8'):if(_0x270fc3[_0x4912('0x61')]['message_id']&&_0x270fc3[_0x4912('0x61')][_0x4912('0xd9')]){_0x52b909=_0x270fc3[_0x4912('0x61')][_0x4912('0xd9')];return db[_0x4912('0xaf')][_0x4912('0x5f')]({'where':{'messageId':_0x270fc3['body'][_0x4912('0x8f')]}});}break;case _0x4912('0xda'):var _0x27d2cf=_0x270fc3[_0x4912('0x61')][_0x4912('0x93')][0x0];if(_0x27d2cf['messageId']&&_0x27d2cf[_0x4912('0x2f')][_0x4912('0xdb')]==='DELIVERED'){_0x52b909=_0x27d2cf['status'][_0x4912('0xdb')];return db[_0x4912('0xaf')][_0x4912('0x5f')]({'where':{'messageId':_0x27d2cf[_0x4912('0x8b')]}});}break;case _0x4912('0x97'):if(_0x270fc3[_0x4912('0x61')][_0x4912('0x8b')]&&_0x270fc3['body'][_0x4912('0x2f')]){_0x52b909=_0x270fc3['body']['status'];return db[_0x4912('0xaf')][_0x4912('0x5f')]({'where':{'messageId':_0x270fc3['body'][_0x4912('0x8b')]}});}break;case _0x4912('0x99'):if(_0x270fc3[_0x4912('0x61')][_0x4912('0xdc')]&&_0x270fc3['body'][_0x4912('0x2f')]){_0x52b909=_0x270fc3[_0x4912('0x61')]['status'];return db[_0x4912('0xaf')][_0x4912('0x5f')]({'where':{'messageId':_0x270fc3['body'][_0x4912('0xdc')]}});}break;}}})[_0x4912('0x23')](handleEntityNotFound(_0x445a0c,null))[_0x4912('0x23')](function(_0xfd1f96){if(_0xfd1f96){_0x33247f=_0xfd1f96;switch(_0x3b755e[_0x4912('0x55')]){case'skebby':if(_0x52b909===_0x4912('0xdd')){return _0x33247f[_0x4912('0x39')]({'read':!![]});}else{logger['error'](_0x4912('0x27'),_0x4912('0x2f'),_0x4912('0x8c'),util['inspect'](_0x270fc3[_0x4912('0x61')],{'showHidden':![],'depth':null}));}break;case _0x4912('0xd5'):if(_0x52b909==='1'){return _0x33247f[_0x4912('0x39')]({'read':!![]});}else{logger[_0x4912('0x2a')](_0x4912('0x27'),'status',_0x4912('0x8c'),util['inspect'](_0x270fc3['body'],{'showHidden':![],'depth':null}));}break;case _0x4912('0xd8'):if(!_0x270fc3[_0x4912('0x61')]['error_code']&&_0x52b909>=0xc8&&_0x52b909<=0xce){return _0x33247f[_0x4912('0x39')]({'read':!![]});}else{logger[_0x4912('0x2a')](_0x4912('0x27'),'status',_0x4912('0xd8'),util[_0x4912('0xd3')](_0x270fc3[_0x4912('0x61')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1d9474=_0x270fc3['body']['results'][0x0];if(_0x1d9474[_0x4912('0x2f')]['groupName']===_0x4912('0xdd')){return _0x33247f[_0x4912('0x39')]({'read':!![]});}else{logger[_0x4912('0x2a')](_0x4912('0x27'),_0x4912('0x2f'),_0x4912('0xda'),util[_0x4912('0xd3')](_0x270fc3[_0x4912('0x61')],{'showHidden':![],'depth':null}));}break;case _0x4912('0x97'):if(_0x52b909==_0x4912('0xde')||_0x52b909==_0x4912('0xdf')){return _0x33247f[_0x4912('0x39')]({'read':!![]});}else{logger[_0x4912('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4912('0x97'),util[_0x4912('0xd3')](_0x270fc3['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x52b909===_0x4912('0xe0')||_0x52b909===_0x4912('0xe1')){return _0x33247f[_0x4912('0x39')]({'read':!![]});}else{logger['error'](_0x4912('0x27'),_0x4912('0x2f'),_0x4912('0x99'),util['inspect'](_0x270fc3[_0x4912('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x33247f;}})['then'](respondWithResult(_0x445a0c,null))['catch'](handleError(_0x445a0c,null));};exports['statusGet']=function(_0x59981e,_0x5b919e,_0xf1821f){var _0x322ecb,_0x396a76,_0x4ac960;return db[_0x4912('0x5a')]['find']({'where':{'id':_0x59981e[_0x4912('0x6a')]['id']}})[_0x4912('0x23')](handleEntityNotFound(_0x5b919e,null))[_0x4912('0x23')](function(_0xf6b099){if(_0xf6b099){_0x4ac960=_0xf6b099;logger['debug'](_0x4912('0x27'),_0x4912('0x2f'),'received\x20delivery\x20report\x20from',_0xf6b099[_0x4912('0x55')],util[_0x4912('0xd3')](_0x59981e[_0x4912('0x46')],{'showHidden':![],'depth':null}));switch(_0xf6b099['type']){case _0x4912('0x94'):if(_0x59981e[_0x4912('0x46')]['message-id']&&_0x59981e[_0x4912('0x46')][_0x4912('0xe2')]){_0x396a76=_0x59981e[_0x4912('0x46')]['state'];return db[_0x4912('0xaf')][_0x4912('0x5f')]({'where':{'messageId':_0x59981e[_0x4912('0x46')][_0x4912('0xe3')]}});}break;}}})[_0x4912('0x23')](handleEntityNotFound(_0x5b919e,null))['then'](function(_0x47529e){if(_0x47529e){_0x322ecb=_0x47529e;switch(_0x4ac960[_0x4912('0x55')]){case _0x4912('0x94'):if(_0x396a76==='2'||_0x396a76==='6'){return _0x322ecb[_0x4912('0x39')]({'read':!![]});}else{logger[_0x4912('0x2a')](_0x4912('0x27'),_0x4912('0x2f'),'csc',util[_0x4912('0xd3')](_0x59981e['query'],{'showHidden':![],'depth':null}));};break;}return _0x322ecb;}})[_0x4912('0x23')](respondWithResult(_0x5b919e,null))[_0x4912('0x2e')](handleError(_0x5b919e,null));};exports[_0x4912('0xe4')]=function(_0x4364a4,_0x3073d6,_0x1603f1){return db[_0x4912('0x5a')][_0x4912('0x5f')]({'where':{'id':_0x4364a4[_0x4912('0x6a')]['id']}})[_0x4912('0x23')](handleEntityNotFound(_0x3073d6,null))['then'](function(_0x309dfd){if(_0x309dfd){return _0x309dfd[_0x4912('0xe4')](_0x4364a4[_0x4912('0x61')][_0x4912('0x70')],_[_0x4912('0xe5')](_0x4364a4['body'],[_0x4912('0x70'),'id'])||{})[_0x4912('0xa8')](function(_0x25035d){for(var _0x139b5e=0x0;_0x139b5e<_0x4364a4[_0x4912('0x61')][_0x4912('0x70')][_0x4912('0x4c')];_0x139b5e+=0x1){socket[_0x4912('0xe6')](_0x4912('0xe7'),{'UserId':_0x4364a4[_0x4912('0x61')]['ids'][_0x139b5e],'SmsAccountId':_0x4364a4[_0x4912('0x6a')]['id']});}return _0x25035d;});}})[_0x4912('0x23')](respondWithResult(_0x3073d6,null))['catch'](handleError(_0x3073d6,null));};exports['removeAgents']=function(_0x186b06,_0x476081,_0x37e925){return db[_0x4912('0x5a')][_0x4912('0x5f')]({'where':{'id':_0x186b06[_0x4912('0x6a')]['id']}})[_0x4912('0x23')](handleEntityNotFound(_0x476081,null))[_0x4912('0x23')](function(_0xc3fabf){if(_0xc3fabf){return _0xc3fabf[_0x4912('0xe8')](_0x186b06[_0x4912('0x46')][_0x4912('0x70')])['then'](function(){if(_[_0x4912('0xe9')](_0x186b06['query'][_0x4912('0x70')])){for(var _0x14c093=0x0;_0x14c093<_0x186b06['query'][_0x4912('0x70')][_0x4912('0x4c')];_0x14c093+=0x1){socket[_0x4912('0xe6')](_0x4912('0xea'),{'UserId':Number(_0x186b06[_0x4912('0x46')][_0x4912('0x70')][_0x14c093]),'SmsAccountId':Number(_0x186b06[_0x4912('0x6a')]['id'])});}}else{socket[_0x4912('0xe6')](_0x4912('0xea'),{'UserId':Number(_0x186b06[_0x4912('0x46')][_0x4912('0x70')]),'SmsAccountId':Number(_0x186b06['params']['id'])});}});}})[_0x4912('0x23')](respondWithStatusCode(_0x476081,null))['catch'](handleError(_0x476081,null));};exports['getAgents']=function(_0x20660c,_0x3a5a7e,_0x505a09){var _0x4207bb={};var _0x1b7861={};var _0x3616f;var _0x50f570;return db[_0x4912('0x5a')][_0x4912('0x6e')]({'where':{'id':_0x20660c['params']['id']}})[_0x4912('0x23')](handleEntityNotFound(_0x3a5a7e,null))[_0x4912('0x23')](function(_0x1a1fb6){if(_0x1a1fb6){_0x3616f=_0x1a1fb6;_0x1b7861[_0x4912('0x45')]=_[_0x4912('0x47')](db[_0x4912('0xb3')][_0x4912('0x44')]);_0x1b7861[_0x4912('0x46')]=_['keys'](_0x20660c[_0x4912('0x46')]);_0x1b7861[_0x4912('0x48')]=_[_0x4912('0x49')](_0x1b7861[_0x4912('0x45')],_0x1b7861[_0x4912('0x46')]);_0x4207bb['attributes']=_['intersection'](_0x1b7861[_0x4912('0x45')],qs[_0x4912('0x4b')](_0x20660c[_0x4912('0x46')]['fields']));_0x4207bb[_0x4912('0x4a')]=_0x4207bb[_0x4912('0x4a')][_0x4912('0x4c')]?_0x4207bb['attributes']:_0x1b7861[_0x4912('0x45')];_0x4207bb['order']=qs[_0x4912('0x50')](_0x20660c[_0x4912('0x46')][_0x4912('0x50')]);_0x4207bb['where']=qs[_0x4912('0x48')](_['pick'](_0x20660c[_0x4912('0x46')],_0x1b7861['filters']));if(_0x20660c[_0x4912('0x46')]['filter']){_0x4207bb[_0x4912('0x51')]=_[_0x4912('0x54')](_0x4207bb[_0x4912('0x51')],{'$or':_[_0x4912('0x74')](_0x4207bb[_0x4912('0x4a')],function(_0x2c05bf){var _0x13616f={};_0x13616f[_0x2c05bf]={'$like':'%'+_0x20660c['query'][_0x4912('0x53')]+'%'};return _0x13616f;})});}_0x4207bb=_[_0x4912('0x54')]({},_0x4207bb,_0x20660c[_0x4912('0x59')]);return _0x3616f[_0x4912('0xeb')](_0x4207bb);}})[_0x4912('0x23')](function(_0x41dc5a){if(_0x41dc5a){_0x50f570=_0x41dc5a[_0x4912('0x4c')];if(!_0x20660c[_0x4912('0x46')][_0x4912('0x4d')](_0x4912('0x4e'))){_0x4207bb[_0x4912('0x4f')]=qs[_0x4912('0x4f')](_0x20660c[_0x4912('0x46')][_0x4912('0x4f')]);_0x4207bb[_0x4912('0x33')]=qs[_0x4912('0x33')](_0x20660c[_0x4912('0x46')]['offset']);}return _0x3616f['getAgents'](_0x4207bb);}})['then'](function(_0x44acd){if(_0x44acd){return _0x44acd?{'count':_0x50f570,'rows':_0x44acd}:null;}})[_0x4912('0x23')](respondWithResult(_0x3a5a7e,null))[_0x4912('0x2e')](handleError(_0x3a5a7e,null));}; \ No newline at end of file +var _0x67e5=['fullname','internal','Tag','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','message_id','status_code','groupName','DELIVERED','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','state','message-id','csc','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','localhost','./smsAccount.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','count','offset','limit','set','Content-Range','json','reject','destroy','get','SmsAccounts','end','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','model','keys','filters','intersection','query','attributes','fields','nolimit','order','sort','where','pick','filter','map','type','key','merge','includeAll','include','findAll','rows','show','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','options','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','SmsApplication','account','applications','Applications','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','from','messageId','sender','text','connectel','clicksend','plivo','Text','MessageUUID','infobip','results','clickatell','replyMessageId','intelepeer','refid','isNil','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','defaults','contact','SmsInteraction','spread','created','autoclose','push','unmanaged','*,*,*,*','interaction','SmsMessage','AttachmentId','UserId','User','startRouting','Start','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','hasOwnProperty','getInteractions','Contact','Owner'];(function(_0x26795a,_0x47eb4a){var _0x257b92=function(_0x37310c){while(--_0x37310c){_0x26795a['push'](_0x26795a['shift']());}};_0x257b92(++_0x47eb4a);}(_0x67e5,0xfd));var _0x567e=function(_0x4385d0,_0x49585b){_0x4385d0=_0x4385d0-0x0;var _0x30c9e7=_0x67e5[_0x4385d0];return _0x30c9e7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x567e('0x0'));var rimraf=require(_0x567e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x567e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x567e('0x3'));var Mustache=require(_0x567e('0x4'));var util=require(_0x567e('0x5'));var path=require('path');var sox=require(_0x567e('0x6'));var csv=require(_0x567e('0x7'));var ejs=require(_0x567e('0x8'));var fs=require('fs');var _=require(_0x567e('0x9'));var squel=require('squel');var crypto=require(_0x567e('0xa'));var jsforce=require(_0x567e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x567e('0x7'));var querystring=require('querystring');var Papa=require(_0x567e('0xc'));var Redis=require(_0x567e('0xd'));var authService=require(_0x567e('0xe'));var qs=require(_0x567e('0xf'));var hardwareService=require(_0x567e('0x10'));var logger=require('../../config/logger')(_0x567e('0x11'));var utils=require(_0x567e('0x12'));var config=require(_0x567e('0x13'));var db=require('../../mysqldb')['db'];config[_0x567e('0x14')]=_['defaults'](config[_0x567e('0x14')],{'host':_0x567e('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x567e('0x14')]));require(_0x567e('0x16'))['register'](socket);var jayson=require(_0x567e('0x17'));var client=jayson[_0x567e('0x18')][_0x567e('0x19')]({'port':0x232c});function checkPasswordPattern(_0x55cc27,_0x357576,_0x33afa0){if(_0x33afa0){var _0x2c5087=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c5087[_0x567e('0x1a')](_0x357576)){return _0x55cc27;}else{throw new Error(_0x567e('0x1b'));}}else{return _0x55cc27;}}function respondWithRpcPromise(_0x2285fa,_0x1165b4,_0x3ccff6,_0x32c368){return new BPromise(function(_0x331c18,_0x1a9f85){var _0x456dfd=_0x32c368||client;return _0x456dfd[_0x567e('0x1c')](_0x2285fa,_0x3ccff6)[_0x567e('0x1d')](function(_0x434556){logger['info'](_0x567e('0x1e'),_0x1165b4,_0x567e('0x1f'));logger[_0x567e('0x20')](_0x567e('0x21'),_0x1165b4,_0x567e('0x1f'),JSON[_0x567e('0x22')](_0x434556));if(_0x434556[_0x567e('0x23')]){if(_0x434556[_0x567e('0x23')][_0x567e('0x24')]===0x1f4){logger[_0x567e('0x23')](_0x567e('0x1e'),_0x1165b4,_0x434556['error'][_0x567e('0x25')]);return _0x1a9f85(_0x434556[_0x567e('0x23')]['message']);}logger['error'](_0x567e('0x1e'),_0x1165b4,_0x434556[_0x567e('0x23')][_0x567e('0x25')]);return _0x331c18(_0x434556[_0x567e('0x23')][_0x567e('0x25')]);}else{logger[_0x567e('0x26')]('SmsAccount,\x20%s,\x20%s',_0x1165b4,_0x567e('0x1f'));_0x331c18(_0x434556[_0x567e('0x27')]['message']);}})[_0x567e('0x28')](function(_0x31c9dc){logger['error'](_0x567e('0x1e'),_0x1165b4,_0x31c9dc);_0x1a9f85(_0x31c9dc);});});}function respondWithStatusCode(_0x1bdbe9,_0x26936f){_0x26936f=_0x26936f||0xcc;return function(_0x1a6fe5){if(_0x1a6fe5){return _0x1bdbe9['sendStatus'](_0x26936f);}return _0x1bdbe9[_0x567e('0x29')](_0x26936f)['end']();};}function respondWithResult(_0x1ffadc,_0x347b81){_0x347b81=_0x347b81||0xc8;return function(_0x16aa7c){if(_0x16aa7c){return _0x1ffadc[_0x567e('0x29')](_0x347b81)['json'](_0x16aa7c);}};}function respondWithFilteredResult(_0x45c045,_0x510753){return function(_0x5ab029){if(_0x5ab029){var _0x3a0b93=_0x5ab029[_0x567e('0x2a')],_0x484242=_0x510753[_0x567e('0x2b')],_0x43041f=_0x510753[_0x567e('0x2b')]+_0x510753[_0x567e('0x2c')],_0x16b12d;if(_0x43041f>=_0x3a0b93){_0x43041f=_0x3a0b93;_0x16b12d=0xc8;}else{_0x16b12d=0xce;}_0x45c045['status'](_0x16b12d);return _0x45c045[_0x567e('0x2d')](_0x567e('0x2e'),_0x484242+'-'+_0x43041f+'/'+_0x3a0b93)[_0x567e('0x2f')](_0x5ab029);}return null;};}function patchUpdates(_0x4430e4){return function(_0x4d85c4){try{jsonpatch['apply'](_0x4d85c4,_0x4430e4,!![]);}catch(_0x1d7b99){return BPromise[_0x567e('0x30')](_0x1d7b99);}return _0x4d85c4['save']();};}function saveUpdates(_0x42884d,_0xf99811){return function(_0x48c622){if(_0x48c622){return _0x48c622['update'](_0x42884d)[_0x567e('0x1d')](function(_0x365f10){return _0x365f10;});}return null;};}function removeEntity(_0x38c5f0,_0x430cdf){return function(_0x579747){if(_0x579747){return _0x579747[_0x567e('0x31')]()[_0x567e('0x1d')](function(){var _0x131d2e=_0x579747[_0x567e('0x32')]({'plain':!![]});var _0xe7624=_0x567e('0x33');return db['UserProfileResource'][_0x567e('0x31')]({'where':{'type':_0xe7624,'resourceId':_0x131d2e['id']}})[_0x567e('0x1d')](function(){return _0x579747;});})[_0x567e('0x1d')](function(){_0x38c5f0[_0x567e('0x29')](0xcc)[_0x567e('0x34')]();});}};}function handleEntityNotFound(_0x410599,_0xbd6977){return function(_0x54227c){if(!_0x54227c){_0x410599[_0x567e('0x35')](0x194);}return _0x54227c;};}function handleError(_0x49ca0c,_0x53ed2b){_0x53ed2b=_0x53ed2b||0x1f4;return function(_0x3cf308){logger[_0x567e('0x23')](_0x3cf308[_0x567e('0x36')]);if(_0x3cf308['name']){delete _0x3cf308[_0x567e('0x37')];}_0x49ca0c['status'](_0x53ed2b)[_0x567e('0x38')](_0x3cf308);};}exports[_0x567e('0x39')]=function(_0x35f413,_0x5adc5f){var _0x478a6e={'include':[{'model':db[_0x567e('0x3a')],'as':_0x567e('0x3b')}]},_0x9bd5cf={},_0x9717e9={'count':0x0,'rows':[]};var _0x13bcc6=db[_0x567e('0x3c')][_0x567e('0x3d')];_0x9bd5cf[_0x567e('0x3e')]=_[_0x567e('0x3f')](_0x13bcc6);_0x9bd5cf['query']=_[_0x567e('0x3f')](_0x35f413['query']);_0x9bd5cf[_0x567e('0x40')]=_[_0x567e('0x41')](_0x9bd5cf[_0x567e('0x3e')],_0x9bd5cf[_0x567e('0x42')]);_0x478a6e[_0x567e('0x43')]=_[_0x567e('0x41')](_0x9bd5cf[_0x567e('0x3e')],qs[_0x567e('0x44')](_0x35f413['query']['fields']));_0x478a6e[_0x567e('0x43')]=_0x478a6e['attributes']['length']?_0x478a6e[_0x567e('0x43')]:_0x9bd5cf[_0x567e('0x3e')];if(!_0x35f413[_0x567e('0x42')]['hasOwnProperty'](_0x567e('0x45'))){_0x478a6e['limit']=qs[_0x567e('0x2c')](_0x35f413[_0x567e('0x42')][_0x567e('0x2c')]);_0x478a6e[_0x567e('0x2b')]=qs[_0x567e('0x2b')](_0x35f413[_0x567e('0x42')]['offset']);}_0x478a6e[_0x567e('0x46')]=qs[_0x567e('0x47')](_0x35f413[_0x567e('0x42')]['sort']);_0x478a6e[_0x567e('0x48')]=qs['filters'](_[_0x567e('0x49')](_0x35f413[_0x567e('0x42')],_0x9bd5cf['filters']));if(_0x35f413[_0x567e('0x42')][_0x567e('0x4a')]){_0x478a6e[_0x567e('0x48')]=_['merge'](_0x478a6e['where'],{'$or':_[_0x567e('0x4b')](_0x13bcc6,function(_0x3d4fb1){if(_0x3d4fb1[_0x567e('0x4c')][_0x567e('0x4d')]!=='VIRTUAL'){var _0x18f1de={};_0x18f1de[_0x3d4fb1['field']]={'$like':'%'+_0x35f413[_0x567e('0x42')]['filter']+'%'};return _0x18f1de;}})});}_0x478a6e=_[_0x567e('0x4e')]({},_0x478a6e,_0x35f413['options']);var _0x32dd6d={'where':_0x478a6e['where']};return db[_0x567e('0x3c')][_0x567e('0x2a')](_0x32dd6d)['then'](function(_0x38fe3d){_0x9717e9[_0x567e('0x2a')]=_0x38fe3d;if(_0x35f413['query'][_0x567e('0x4f')]){_0x478a6e[_0x567e('0x50')]=[{'all':!![]}];}return db['SmsAccount'][_0x567e('0x51')](_0x478a6e);})[_0x567e('0x1d')](function(_0x436b1a){_0x9717e9[_0x567e('0x52')]=_0x436b1a;return _0x9717e9;})[_0x567e('0x1d')](respondWithFilteredResult(_0x5adc5f,_0x478a6e))[_0x567e('0x28')](handleError(_0x5adc5f,null));};exports[_0x567e('0x53')]=function(_0x23be5a,_0x2800d0){var _0x2d76b8={'raw':![],'where':{'id':_0x23be5a['params']['id']},'include':[{'model':db[_0x567e('0x3a')],'as':_0x567e('0x3b')}]},_0x32c12f={};_0x32c12f[_0x567e('0x3e')]=_[_0x567e('0x3f')](db[_0x567e('0x3c')][_0x567e('0x3d')]);_0x32c12f['query']=_[_0x567e('0x3f')](_0x23be5a[_0x567e('0x42')]);_0x32c12f[_0x567e('0x40')]=_[_0x567e('0x41')](_0x32c12f[_0x567e('0x3e')],_0x32c12f[_0x567e('0x42')]);_0x2d76b8[_0x567e('0x43')]=_[_0x567e('0x41')](_0x32c12f[_0x567e('0x3e')],qs['fields'](_0x23be5a[_0x567e('0x42')]['fields']));_0x2d76b8[_0x567e('0x43')]=_0x2d76b8[_0x567e('0x43')][_0x567e('0x54')]?_0x2d76b8[_0x567e('0x43')]:_0x32c12f[_0x567e('0x3e')];if(_0x23be5a[_0x567e('0x42')]['includeAll']){_0x2d76b8[_0x567e('0x50')]=[{'all':!![]}];}_0x2d76b8=_[_0x567e('0x4e')]({},_0x2d76b8,_0x23be5a['options']);return db[_0x567e('0x3c')][_0x567e('0x55')](_0x2d76b8)['then'](handleEntityNotFound(_0x2800d0,null))['then'](respondWithResult(_0x2800d0,null))[_0x567e('0x28')](handleError(_0x2800d0,null));};exports[_0x567e('0x56')]=function(_0x415ff2,_0x1bf8d0){return db[_0x567e('0x3c')][_0x567e('0x56')](_0x415ff2['body'],{})['then'](function(_0x17ac5d){var _0x2f3c5b=_0x415ff2[_0x567e('0x57')][_0x567e('0x32')]({'plain':!![]});if(!_0x2f3c5b)throw new Error(_0x567e('0x58'));if(_0x2f3c5b[_0x567e('0x59')]==='user'){var _0x3ff3e2=_0x17ac5d['get']({'plain':!![]});var _0x41a69a=_0x567e('0x33');return db['UserProfileSection'][_0x567e('0x55')]({'where':{'name':_0x41a69a,'userProfileId':_0x2f3c5b[_0x567e('0x5a')]},'raw':!![]})[_0x567e('0x1d')](function(_0xf00435){if(_0xf00435&&_0xf00435[_0x567e('0x5b')]===0x0){return db[_0x567e('0x5c')][_0x567e('0x56')]({'name':_0x3ff3e2[_0x567e('0x37')],'resourceId':_0x3ff3e2['id'],'type':_0xf00435[_0x567e('0x37')],'sectionId':_0xf00435['id']},{})[_0x567e('0x1d')](function(){return _0x17ac5d;});}else{return _0x17ac5d;}})[_0x567e('0x28')](function(_0x5bd071){logger[_0x567e('0x23')](_0x567e('0x5d'),_0x5bd071);throw _0x5bd071;});}return _0x17ac5d;})['then'](respondWithResult(_0x1bf8d0,0xc9))[_0x567e('0x28')](handleError(_0x1bf8d0,null));};exports[_0x567e('0x5e')]=function(_0x404d6a,_0x4098cc){if(_0x404d6a['body']['id']){delete _0x404d6a[_0x567e('0x5f')]['id'];}return db[_0x567e('0x3c')]['find']({'where':{'id':_0x404d6a[_0x567e('0x60')]['id']},'include':[{'model':db['Pause'],'as':_0x567e('0x3b')}]})[_0x567e('0x1d')](handleEntityNotFound(_0x4098cc,null))['then'](saveUpdates(_0x404d6a[_0x567e('0x5f')],null))['then'](respondWithResult(_0x4098cc,null))[_0x567e('0x28')](handleError(_0x4098cc,null));};exports[_0x567e('0x31')]=function(_0x4edc4d,_0x2d5d5c){return db['SmsAccount'][_0x567e('0x55')]({'where':{'id':_0x4edc4d[_0x567e('0x60')]['id']}})['then'](handleEntityNotFound(_0x2d5d5c,null))[_0x567e('0x1d')](removeEntity(_0x2d5d5c,null))[_0x567e('0x28')](handleError(_0x2d5d5c,null));};exports[_0x567e('0x61')]=function(_0x4e95d5,_0x4a5feb){return db[_0x567e('0x3c')][_0x567e('0x61')]()[_0x567e('0x1d')](respondWithResult(_0x4a5feb,null))[_0x567e('0x28')](handleError(_0x4a5feb,null));};exports[_0x567e('0x62')]=function(_0x5ca8d8,_0x27e680,_0x22fd48){if(_0x5ca8d8[_0x567e('0x5f')]['id']){delete _0x5ca8d8[_0x567e('0x5f')]['id'];}return db[_0x567e('0x3c')][_0x567e('0x55')]({'where':{'id':_0x5ca8d8[_0x567e('0x60')]['id']}})['then'](handleEntityNotFound(_0x27e680,null))[_0x567e('0x1d')](function(_0x309bc1){if(_0x309bc1){_0x5ca8d8[_0x567e('0x5f')][_0x567e('0x63')]=_0x309bc1['id'];return db[_0x567e('0x64')][_0x567e('0x56')](_0x5ca8d8['body']);}})[_0x567e('0x1d')](respondWithResult(_0x27e680,null))[_0x567e('0x28')](handleError(_0x27e680,null));};exports[_0x567e('0x65')]=function(_0x2b2244,_0x3a36fb,_0x21a95a){var _0x51682e={'raw':![],'where':{}};var _0xbde612={};var _0x418354={'count':0x0,'rows':[]};return db['SmsAccount'][_0x567e('0x66')]({'where':{'id':_0x2b2244['params']['id']}})[_0x567e('0x1d')](handleEntityNotFound(_0x3a36fb,null))[_0x567e('0x1d')](function(_0x5eafa9){if(_0x5eafa9){_0xbde612['model']=_[_0x567e('0x3f')](db['Disposition'][_0x567e('0x3d')]);_0xbde612['query']=_[_0x567e('0x3f')](_0x2b2244[_0x567e('0x42')]);_0xbde612[_0x567e('0x40')]=_[_0x567e('0x41')](_0xbde612['model'],_0xbde612['query']);_0x51682e[_0x567e('0x43')]=_[_0x567e('0x41')](_0xbde612[_0x567e('0x3e')],qs[_0x567e('0x44')](_0x2b2244[_0x567e('0x42')][_0x567e('0x44')]));_0x51682e['attributes']=_0x51682e[_0x567e('0x43')]['length']?_0x51682e[_0x567e('0x43')]:_0xbde612[_0x567e('0x3e')];if(!_0x2b2244[_0x567e('0x42')]['hasOwnProperty'](_0x567e('0x45'))){_0x51682e[_0x567e('0x2c')]=qs[_0x567e('0x2c')](_0x2b2244['query'][_0x567e('0x2c')]);_0x51682e[_0x567e('0x2b')]=qs[_0x567e('0x2b')](_0x2b2244[_0x567e('0x42')][_0x567e('0x2b')]);}_0x51682e['order']=qs[_0x567e('0x47')](_0x2b2244[_0x567e('0x42')][_0x567e('0x47')]);_0x51682e[_0x567e('0x48')]=qs[_0x567e('0x40')](_[_0x567e('0x49')](_0x2b2244['query'],_0xbde612['filters']));_0x51682e[_0x567e('0x48')][_0x567e('0x63')]=_0x5eafa9['id'];if(_0x2b2244[_0x567e('0x42')][_0x567e('0x4a')]){_0x51682e[_0x567e('0x48')]=_[_0x567e('0x4e')](_0x51682e[_0x567e('0x48')],{'$or':_[_0x567e('0x4b')](_0x51682e[_0x567e('0x43')],function(_0x1f3f08){var _0x58cec5={};_0x58cec5[_0x1f3f08]={'$like':'%'+_0x2b2244[_0x567e('0x42')][_0x567e('0x4a')]+'%'};return _0x58cec5;})});}_0x51682e=_['merge']({},_0x51682e,_0x2b2244[_0x567e('0x67')]);return db[_0x567e('0x64')][_0x567e('0x2a')]({'where':_0x51682e[_0x567e('0x48')]})[_0x567e('0x1d')](function(_0x428c09){_0x418354['count']=_0x428c09;if(_0x2b2244[_0x567e('0x42')][_0x567e('0x4f')]){_0x51682e[_0x567e('0x50')]=[{'all':!![]}];}return db[_0x567e('0x64')][_0x567e('0x51')](_0x51682e);})['then'](function(_0x26a935){_0x418354[_0x567e('0x52')]=_0x26a935;return _0x418354;});}})['then'](respondWithFilteredResult(_0x3a36fb,_0x51682e))[_0x567e('0x28')](handleError(_0x3a36fb,null));};exports[_0x567e('0x68')]=function(_0x141909,_0x2f9456,_0x3ba51c){return db[_0x567e('0x3c')][_0x567e('0x55')]({'where':{'id':_0x141909[_0x567e('0x60')]['id']}})[_0x567e('0x1d')](handleEntityNotFound(_0x2f9456,null))[_0x567e('0x1d')](function(_0x4c2909){if(_0x4c2909){return _0x4c2909[_0x567e('0x68')](_0x141909[_0x567e('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x2f9456,null))['catch'](handleError(_0x2f9456,null));};exports['addAnswer']=function(_0x3f398d,_0x2ebf68,_0x53a3c1){if(_0x3f398d[_0x567e('0x5f')]['id']){delete _0x3f398d['body']['id'];}return db[_0x567e('0x3c')][_0x567e('0x55')]({'where':{'id':_0x3f398d[_0x567e('0x60')]['id']}})[_0x567e('0x1d')](handleEntityNotFound(_0x2ebf68,null))[_0x567e('0x1d')](function(_0x1549bc){if(_0x1549bc){_0x3f398d[_0x567e('0x5f')][_0x567e('0x63')]=_0x1549bc['id'];return db[_0x567e('0x69')][_0x567e('0x56')](_0x3f398d['body']);}})[_0x567e('0x1d')](respondWithResult(_0x2ebf68,null))['catch'](handleError(_0x2ebf68,null));};exports[_0x567e('0x6a')]=function(_0x2fe597,_0x40c451,_0xf87aa6){var _0x4b33b8={'raw':![],'where':{}};var _0x5cf539={};var _0x28f8e0={'count':0x0,'rows':[]};return db[_0x567e('0x3c')][_0x567e('0x66')]({'where':{'id':_0x2fe597['params']['id']}})[_0x567e('0x1d')](handleEntityNotFound(_0x40c451,null))[_0x567e('0x1d')](function(_0x21df10){if(_0x21df10){_0x5cf539[_0x567e('0x3e')]=_['keys'](db['CannedAnswer'][_0x567e('0x3d')]);_0x5cf539[_0x567e('0x42')]=_[_0x567e('0x3f')](_0x2fe597[_0x567e('0x42')]);_0x5cf539[_0x567e('0x40')]=_[_0x567e('0x41')](_0x5cf539[_0x567e('0x3e')],_0x5cf539[_0x567e('0x42')]);_0x4b33b8['attributes']=_['intersection'](_0x5cf539[_0x567e('0x3e')],qs[_0x567e('0x44')](_0x2fe597[_0x567e('0x42')][_0x567e('0x44')]));_0x4b33b8['attributes']=_0x4b33b8[_0x567e('0x43')]['length']?_0x4b33b8[_0x567e('0x43')]:_0x5cf539[_0x567e('0x3e')];if(!_0x2fe597[_0x567e('0x42')]['hasOwnProperty'](_0x567e('0x45'))){_0x4b33b8[_0x567e('0x2c')]=qs[_0x567e('0x2c')](_0x2fe597[_0x567e('0x42')][_0x567e('0x2c')]);_0x4b33b8['offset']=qs[_0x567e('0x2b')](_0x2fe597['query'][_0x567e('0x2b')]);}_0x4b33b8[_0x567e('0x46')]=qs[_0x567e('0x47')](_0x2fe597['query']['sort']);_0x4b33b8[_0x567e('0x48')]=qs[_0x567e('0x40')](_[_0x567e('0x49')](_0x2fe597[_0x567e('0x42')],_0x5cf539[_0x567e('0x40')]));_0x4b33b8[_0x567e('0x48')][_0x567e('0x63')]=_0x21df10['id'];if(_0x2fe597[_0x567e('0x42')][_0x567e('0x4a')]){_0x4b33b8[_0x567e('0x48')]=_[_0x567e('0x4e')](_0x4b33b8[_0x567e('0x48')],{'$or':_[_0x567e('0x4b')](_0x4b33b8[_0x567e('0x43')],function(_0x70a825){var _0x428e88={};_0x428e88[_0x70a825]={'$like':'%'+_0x2fe597['query'][_0x567e('0x4a')]+'%'};return _0x428e88;})});}_0x4b33b8=_[_0x567e('0x4e')]({},_0x4b33b8,_0x2fe597[_0x567e('0x67')]);return db['CannedAnswer'][_0x567e('0x2a')]({'where':_0x4b33b8[_0x567e('0x48')]})[_0x567e('0x1d')](function(_0x121fd8){_0x28f8e0[_0x567e('0x2a')]=_0x121fd8;if(_0x2fe597[_0x567e('0x42')]['includeAll']){_0x4b33b8[_0x567e('0x50')]=[{'all':!![]}];}return db[_0x567e('0x69')][_0x567e('0x51')](_0x4b33b8);})[_0x567e('0x1d')](function(_0x5ed85e){_0x28f8e0[_0x567e('0x52')]=_0x5ed85e;return _0x28f8e0;});}})[_0x567e('0x1d')](respondWithFilteredResult(_0x40c451,_0x4b33b8))[_0x567e('0x28')](handleError(_0x40c451,null));};exports['removeAnswers']=function(_0x371b93,_0x345674,_0x24cbb8){return db[_0x567e('0x3c')][_0x567e('0x55')]({'where':{'id':_0x371b93[_0x567e('0x60')]['id']}})[_0x567e('0x1d')](handleEntityNotFound(_0x345674,null))['then'](function(_0x8ab0bd){if(_0x8ab0bd){return _0x8ab0bd[_0x567e('0x6b')](_0x371b93[_0x567e('0x42')][_0x567e('0x6c')]);}})[_0x567e('0x1d')](respondWithStatusCode(_0x345674,null))[_0x567e('0x28')](handleError(_0x345674,null));};exports[_0x567e('0x6d')]=function(_0x353ffe,_0x2dd177,_0x288b1e){var _0x1752d0={'channel':_0x567e('0x6e')};var _0x23eb29=[];var _0x2e877c=[];var _0x2489a0={};return db['SmsAccount'][_0x567e('0x55')]({'where':{'id':_0x353ffe[_0x567e('0x60')]['id']},'include':[{'model':db[_0x567e('0x6f')],'as':'Applications'}]})[_0x567e('0x1d')](handleEntityNotFound(_0x2dd177,null))[_0x567e('0x1d')](function(_0x2e9073){_0x1752d0[_0x567e('0x70')]=_0x2e9073;_0x1752d0[_0x567e('0x71')]=_['orderBy'](_0x2e9073[_0x567e('0x72')],[_0x567e('0x73')],[_0x567e('0x74')]);if(_0x1752d0['account'][_0x567e('0x72')]){delete _0x1752d0['account']['Applications'];}return db[_0x567e('0x75')][_0x567e('0x61')]();})[_0x567e('0x1d')](function(_0x4cf0fd){if(!_0x4cf0fd){throw new db[(_0x567e('0x76'))]['ValidationError'](_0x567e('0x77'));}_0x23eb29=_[_0x567e('0x78')](_[_0x567e('0x3f')](_0x4cf0fd),[_0x567e('0x79'),'updatedAt']);_0x2e877c=_[_0x567e('0x78')](_[_0x567e('0x3f')](_0x4cf0fd),[_0x567e('0x79'),_0x567e('0x7a'),'CompanyId',_0x567e('0x7b')]);_0x1752d0[_0x567e('0x5f')]={'mapKey':_0x567e('0x7c')};if(_0x1752d0[_0x567e('0x70')]['type']){switch(_0x1752d0[_0x567e('0x70')][_0x567e('0x4c')]){case'twilio':_0x1752d0['body'][_0x567e('0x7d')]=_0x353ffe[_0x567e('0x5f')]['From'];_0x1752d0[_0x567e('0x5f')][_0x567e('0x5f')]=_0x353ffe[_0x567e('0x5f')]['Body'];_0x1752d0[_0x567e('0x5f')][_0x567e('0x7e')]=_0x353ffe['body']['MessageSid'];break;case'skebby':_0x1752d0[_0x567e('0x5f')]['from']='+'+_0x353ffe[_0x567e('0x5f')][_0x567e('0x7f')];_0x1752d0[_0x567e('0x5f')]['body']=_0x353ffe[_0x567e('0x5f')][_0x567e('0x80')];break;case _0x567e('0x81'):_0x1752d0['body']['from']=_0x353ffe[_0x567e('0x5f')][_0x567e('0x7d')];_0x1752d0[_0x567e('0x5f')]['body']=_0x353ffe[_0x567e('0x5f')][_0x567e('0x25')];break;case _0x567e('0x82'):_0x1752d0[_0x567e('0x5f')][_0x567e('0x7d')]=_0x353ffe[_0x567e('0x5f')][_0x567e('0x7d')];_0x1752d0[_0x567e('0x5f')][_0x567e('0x5f')]=_0x353ffe[_0x567e('0x5f')]['body'];_0x1752d0['body']['messageId']=_0x353ffe[_0x567e('0x5f')]['message_id'];break;case _0x567e('0x83'):_0x1752d0[_0x567e('0x5f')][_0x567e('0x7d')]=_0x353ffe[_0x567e('0x5f')]['From'];_0x1752d0[_0x567e('0x5f')]['body']=_0x353ffe['body'][_0x567e('0x84')];_0x1752d0[_0x567e('0x5f')][_0x567e('0x7e')]=_0x353ffe[_0x567e('0x5f')][_0x567e('0x85')];break;case _0x567e('0x86'):_0x1752d0[_0x567e('0x5f')]['from']='+'+_0x353ffe[_0x567e('0x5f')][_0x567e('0x87')][0x0][_0x567e('0x7d')];_0x1752d0[_0x567e('0x5f')][_0x567e('0x5f')]=_0x353ffe['body']['results'][0x0][_0x567e('0x80')];_0x1752d0[_0x567e('0x5f')][_0x567e('0x7e')]=_0x353ffe['body']['results'][0x0][_0x567e('0x7e')];break;case'csc':_0x1752d0['body']['from']=_0x353ffe[_0x567e('0x5f')]['originatingAddress'];_0x1752d0['body'][_0x567e('0x5f')]=_0x353ffe[_0x567e('0x5f')]['segmentedMessage'][_0x567e('0x25')];break;case _0x567e('0x88'):_0x1752d0[_0x567e('0x5f')][_0x567e('0x7d')]=_0x353ffe[_0x567e('0x5f')]['fromNumber'];_0x1752d0[_0x567e('0x5f')][_0x567e('0x5f')]=_0x353ffe[_0x567e('0x5f')][_0x567e('0x80')];_0x1752d0[_0x567e('0x5f')][_0x567e('0x7e')]=_0x353ffe[_0x567e('0x5f')][_0x567e('0x89')];break;case _0x567e('0x8a'):_0x1752d0[_0x567e('0x5f')][_0x567e('0x7d')]=_0x353ffe['body']['from'];_0x1752d0['body']['body']=_0x353ffe[_0x567e('0x5f')][_0x567e('0x25')];_0x1752d0[_0x567e('0x5f')]['messageId']=_0x353ffe[_0x567e('0x5f')][_0x567e('0x8b')];break;}}if(_0x1752d0[_0x567e('0x5f')]['id']){delete _0x1752d0[_0x567e('0x5f')]['id'];}if(_[_0x567e('0x8c')](_0x1752d0[_0x567e('0x5f')][_0x567e('0x7d')])){throw new db[(_0x567e('0x76'))][(_0x567e('0x8d'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x1752d0[_0x567e('0x5f')][_0x567e('0x5f')])||_0x1752d0[_0x567e('0x5f')][_0x567e('0x5f')]===''){throw new db[(_0x567e('0x76'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x567e('0x8c')](_0x1752d0[_0x567e('0x5f')][_0x567e('0x8e')])){throw new db[(_0x567e('0x76'))][(_0x567e('0x8d'))](_0x567e('0x8f')+_0x2e877c);}if(!_[_0x567e('0x90')](_0x2e877c,_0x1752d0[_0x567e('0x5f')][_0x567e('0x8e')])){throw new db[(_0x567e('0x76'))]['ValidationError'](_0x567e('0x91')+_0x2e877c);}_0x2489a0[_0x1752d0[_0x567e('0x5f')][_0x567e('0x8e')]]=_0x1752d0[_0x567e('0x5f')]['from'];return db['CmList']['find']({'where':{'id':_0x1752d0[_0x567e('0x70')][_0x567e('0x7b')]},'include':[{'model':db[_0x567e('0x75')],'as':_0x567e('0x92'),'where':_0x2489a0,'limit':0x1,'order':[['updatedAt',_0x567e('0x93')]]}]});})[_0x567e('0x1d')](handleEntityNotFound(_0x2dd177,null))[_0x567e('0x1d')](function(_0x3ed8f8){if(_0x3ed8f8){_0x1752d0[_0x567e('0x94')]=_[_0x567e('0x95')](_0x3ed8f8,[_0x567e('0x92')]);if(_0x3ed8f8[_0x567e('0x92')][_0x567e('0x54')]){return _0x3ed8f8['Contacts'][0x0];}var _0x315246=_[_0x567e('0x96')](_0x1752d0[_0x567e('0x5f')],{'firstName':_0x1752d0['body'][_0x567e('0x7d')],'ListId':_0x3ed8f8['id']});_0x315246[_0x1752d0[_0x567e('0x5f')][_0x567e('0x8e')]]=_0x1752d0[_0x567e('0x5f')][_0x567e('0x7d')];return db[_0x567e('0x75')]['create'](_0x315246,{'fields':_0x23eb29,'raw':!![]});}})[_0x567e('0x1d')](handleEntityNotFound(_0x2dd177,null))[_0x567e('0x1d')](function(_0x479322){if(_0x479322){_0x1752d0[_0x567e('0x97')]=_0x479322;var _0x554185={'ContactId':_0x479322['id'],'phone':_0x1752d0[_0x567e('0x5f')][_0x567e('0x7d')],'SmsAccountId':_0x353ffe[_0x567e('0x60')]['id']};var _0x21b3b2={'ContactId':_0x479322['id'],'SmsAccountId':_0x353ffe['params']['id'],'closed':![]};return db[_0x567e('0x98')][_0x567e('0x55')]({'where':_0x21b3b2})['then'](function(_0x586e1e){if(_0x586e1e){return[_0x586e1e,![]];}return db[_0x567e('0x98')][_0x567e('0x56')](_0x554185)[_0x567e('0x1d')](function(_0x3d06dd){return[_0x3d06dd,!![]];});});}})[_0x567e('0x99')](function(_0x439dc6,_0x4bc89e){_0x1752d0['interaction']=_0x439dc6[_0x567e('0x32')]({'plain':!![]});_0x1752d0['interaction'][_0x567e('0x9a')]=![];if(_0x4bc89e){if(_0x1752d0['account'][_0x567e('0x9b')]){_0x1752d0[_0x567e('0x71')][_0x567e('0x9c')]({'id':0x0,'priority':_0x1752d0[_0x567e('0x71')][_0x567e('0x54')]+0x1,'app':'close','appdata':_0x567e('0x9d'),'interval':_0x567e('0x9e')});}_0x1752d0[_0x567e('0x9f')][_0x567e('0x9a')]=!![];}return db[_0x567e('0xa0')][_0x567e('0x56')]({'phone':_0x1752d0[_0x567e('0x5f')][_0x567e('0x7d')],'messageId':_0x1752d0[_0x567e('0x5f')]['messageId'],'body':_0x1752d0[_0x567e('0x5f')][_0x567e('0x5f')],'SmsAccountId':_0x353ffe[_0x567e('0x60')]['id'],'SmsInteractionId':_0x439dc6['id'],'direction':'in','ContactId':_0x439dc6['ContactId'],'AttachmentId':_0x1752d0[_0x567e('0x5f')][_0x567e('0xa1')]});})['then'](function(_0xc6e01a){_0x1752d0[_0x567e('0x25')]=_0xc6e01a;if(_0x1752d0[_0x567e('0x9f')][_0x567e('0xa2')]){return db[_0x567e('0xa3')][_0x567e('0x55')]({'attributes':['id',_0x567e('0x37')],'where':{'id':_0x1752d0[_0x567e('0x9f')][_0x567e('0xa2')]}})[_0x567e('0x1d')](function(_0x286f01){if(_0x286f01){_0x1752d0[_0x567e('0x71')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x286f01[_0x567e('0x37')]+','+(_0x1752d0[_0x567e('0x70')]['waitForTheAssignedAgent']||0xa),'interval':_0x567e('0x9e')});}return respondWithRpcPromise('Start',_0x567e('0xa4'),_0x1752d0);});}return respondWithRpcPromise(_0x567e('0xa5'),'startRouting',_0x1752d0);})['then'](function(_0x4ab5a9){if(_0x4ab5a9){var _0x265fff=0xc8;var _0xb88674='receiveMessage';logger[_0x567e('0x26')](_0x567e('0x21'),_0xb88674,_0x265fff,_0x567e('0xa6'));logger['debug'](_0x567e('0xa7'),_0xb88674,_0x265fff,_0x567e('0xa6'),JSON['stringify'](_0x4ab5a9));if(_0x1752d0[_0x567e('0x70')][_0x567e('0x4c')]===_0x567e('0xa8')){return _0x2dd177[_0x567e('0x29')](_0x265fff)[_0x567e('0x2d')](_0x567e('0xa9'),'text/xml')[_0x567e('0x38')](_0x567e('0xaa'));}else{return _0x2dd177[_0x567e('0x29')](_0x265fff)[_0x567e('0x2f')](_0x4ab5a9);}}})['catch'](handleError(_0x2dd177,null));};exports[_0x567e('0xab')]=function(_0x5d97d0,_0xcdea4e,_0x16004c){return db[_0x567e('0x3c')][_0x567e('0x66')]({'where':{'id':_0x5d97d0['params']['id']}})[_0x567e('0x1d')](handleEntityNotFound(_0xcdea4e,null))[_0x567e('0x1d')](function(_0x1b8381){if(_0x1b8381){return db[_0x567e('0xac')][_0x567e('0xad')](function(_0x46570a){return db[_0x567e('0x6f')]['destroy']({'where':{'SmsAccountId':_0x5d97d0[_0x567e('0x60')]['id']},'transaction':_0x46570a})[_0x567e('0x1d')](function(_0x1ea6f5){var _0x1587f1=_[_0x567e('0x4b')](_0x5d97d0[_0x567e('0x5f')],function(_0x5b4027){_0x5b4027[_0x567e('0x63')]=_0x5d97d0[_0x567e('0x60')]['id'];return _0x5b4027;});return db[_0x567e('0x6f')][_0x567e('0xae')](_0x1587f1,{'transaction':_0x46570a});});})['then'](function(){return db[_0x567e('0x6f')][_0x567e('0xaf')]({'where':{'SmsAccountId':_0x5d97d0[_0x567e('0x60')]['id']},'order':'priority'});});}})[_0x567e('0x1d')](respondWithResult(_0xcdea4e,null))[_0x567e('0x28')](handleError(_0xcdea4e,null));};exports[_0x567e('0xb0')]=function(_0xbd916e,_0xdaf334,_0x1720ef){var _0x39076b={};var _0x44b362={};var _0x1c741c;var _0x4dd93a;return db[_0x567e('0x3c')][_0x567e('0x66')]({'where':{'id':_0xbd916e[_0x567e('0x60')]['id']}})['then'](handleEntityNotFound(_0xdaf334,null))['then'](function(_0x2774ac){if(_0x2774ac){_0x1c741c=_0x2774ac;_0x44b362['model']=_[_0x567e('0x3f')](db[_0x567e('0x6f')]['rawAttributes']);_0x44b362[_0x567e('0x42')]=_[_0x567e('0x3f')](_0xbd916e[_0x567e('0x42')]);_0x44b362[_0x567e('0x40')]=_['intersection'](_0x44b362[_0x567e('0x3e')],_0x44b362[_0x567e('0x42')]);_0x39076b[_0x567e('0x43')]=_[_0x567e('0x41')](_0x44b362['model'],qs['fields'](_0xbd916e['query'][_0x567e('0x44')]));_0x39076b[_0x567e('0x43')]=_0x39076b[_0x567e('0x43')][_0x567e('0x54')]?_0x39076b[_0x567e('0x43')]:_0x44b362[_0x567e('0x3e')];_0x39076b[_0x567e('0x46')]=qs[_0x567e('0x47')](_0xbd916e['query'][_0x567e('0x47')]);_0x39076b[_0x567e('0x48')]=qs[_0x567e('0x40')](_['pick'](_0xbd916e['query'],_0x44b362[_0x567e('0x40')]));if(_0xbd916e[_0x567e('0x42')][_0x567e('0x4a')]){_0x39076b[_0x567e('0x48')]=_[_0x567e('0x4e')](_0x39076b[_0x567e('0x48')],{'$or':_['map'](_0x39076b[_0x567e('0x43')],function(_0x1efb09){var _0x126fd6={};_0x126fd6[_0x1efb09]={'$like':'%'+_0xbd916e[_0x567e('0x42')][_0x567e('0x4a')]+'%'};return _0x126fd6;})});}_0x39076b=_['merge']({},_0x39076b,_0xbd916e[_0x567e('0x67')]);return _0x1c741c[_0x567e('0xb0')](_0x39076b);}})[_0x567e('0x1d')](function(_0x2eb5ff){if(_0x2eb5ff){_0x4dd93a=_0x2eb5ff[_0x567e('0x54')];if(!_0xbd916e[_0x567e('0x42')][_0x567e('0xb1')](_0x567e('0x45'))){_0x39076b[_0x567e('0x2c')]=qs['limit'](_0xbd916e[_0x567e('0x42')][_0x567e('0x2c')]);_0x39076b['offset']=qs['offset'](_0xbd916e['query'][_0x567e('0x2b')]);}return _0x1c741c[_0x567e('0xb0')](_0x39076b);}})[_0x567e('0x1d')](function(_0x18c213){if(_0x18c213){return _0x18c213?{'count':_0x4dd93a,'rows':_0x18c213}:null;}})[_0x567e('0x1d')](respondWithResult(_0xdaf334,null))[_0x567e('0x28')](handleError(_0xdaf334,null));};exports[_0x567e('0xb2')]=function(_0x34c537,_0x283b04,_0x1f9953){var _0x453710={'raw':![],'where':{}};var _0x263d49={};var _0x5ced56={'count':0x0,'rows':[]};return db[_0x567e('0x3c')][_0x567e('0x66')]({'where':{'id':_0x34c537['params']['id']}})[_0x567e('0x1d')](handleEntityNotFound(_0x283b04,null))[_0x567e('0x1d')](function(_0xfc72be){if(_0xfc72be){_0x263d49[_0x567e('0x3e')]=_[_0x567e('0x3f')](db['SmsInteraction'][_0x567e('0x3d')]);_0x263d49[_0x567e('0x42')]=_[_0x567e('0x3f')](_0x34c537['query']);_0x263d49[_0x567e('0x40')]=_['intersection'](_0x263d49[_0x567e('0x3e')],_0x263d49['query']);_0x453710[_0x567e('0x43')]=_[_0x567e('0x41')](_0x263d49[_0x567e('0x3e')],qs['fields'](_0x34c537[_0x567e('0x42')][_0x567e('0x44')]));_0x453710[_0x567e('0x43')]=_0x453710['attributes']['length']?_0x453710[_0x567e('0x43')]:_0x263d49[_0x567e('0x3e')];if(!_0x34c537[_0x567e('0x42')][_0x567e('0xb1')](_0x567e('0x45'))){_0x453710[_0x567e('0x2c')]=qs['limit'](_0x34c537['query']['limit']);_0x453710[_0x567e('0x2b')]=qs[_0x567e('0x2b')](_0x34c537[_0x567e('0x42')][_0x567e('0x2b')]);}_0x453710[_0x567e('0x46')]=qs[_0x567e('0x47')](_0x34c537[_0x567e('0x42')][_0x567e('0x47')]);_0x453710[_0x567e('0x48')]=qs[_0x567e('0x40')](_[_0x567e('0x49')](_0x34c537[_0x567e('0x42')],_0x263d49[_0x567e('0x40')]));_0x453710[_0x567e('0x48')][_0x567e('0x63')]=_0xfc72be['id'];if(_0x34c537[_0x567e('0x42')][_0x567e('0x4a')]){_0x453710[_0x567e('0x48')]=_[_0x567e('0x4e')](_0x453710[_0x567e('0x48')],{'$or':_[_0x567e('0x4b')](_0x453710['attributes'],function(_0x363032){var _0x57be27={};_0x57be27[_0x363032]={'$like':'%'+_0x34c537[_0x567e('0x42')][_0x567e('0x4a')]+'%'};return _0x57be27;})});}_0x453710=_[_0x567e('0x4e')]({},_0x453710,_0x34c537['options']);return db['SmsInteraction'][_0x567e('0x2a')]({'where':_0x453710[_0x567e('0x48')]})['then'](function(_0x5e41e5){_0x5ced56[_0x567e('0x2a')]=_0x5e41e5;if(_0x34c537[_0x567e('0x42')][_0x567e('0x4f')]){_0x453710[_0x567e('0x50')]=[{'model':db['CmContact'],'as':_0x567e('0xb3'),'required':![]},{'model':db[_0x567e('0xa3')],'as':_0x567e('0xb4'),'attributes':['name',_0x567e('0xb5'),_0x567e('0xb6')],'required':![]},{'model':db[_0x567e('0xb7')],'as':'Tags','attributes':['id',_0x567e('0x37'),_0x567e('0xb8')],'where':_0x34c537['query'][_0x567e('0xb9')]?{'id':_0x34c537[_0x567e('0x42')][_0x567e('0xb9')]}:undefined,'required':_0x34c537[_0x567e('0x42')][_0x567e('0xb9')]?!![]:![]}];}return db[_0x567e('0x98')]['findAll'](_0x453710);})[_0x567e('0x1d')](function(_0x29d5af){_0x5ced56[_0x567e('0x52')]=_0x29d5af;return _0x5ced56;});}})['then'](respondWithFilteredResult(_0x283b04,_0x453710))['catch'](handleError(_0x283b04,null));};exports[_0x567e('0x38')]=function(_0x5c5ea7,_0xc6dcc1,_0x5351d8){var _0x1e144a,_0xfc4811,_0x62de90;if(_['isNil'](_0x5c5ea7[_0x567e('0x5f')]['body'])||_0x5c5ea7['body'][_0x567e('0x5f')]===''){throw new db[(_0x567e('0x76'))][(_0x567e('0x8d'))](_0x567e('0xba'));}if(_[_0x567e('0x8c')](_0x5c5ea7['body']['to'])){throw new db[(_0x567e('0x76'))]['ValidationError'](_0x567e('0xbb'));}_0x1e144a=_0x5c5ea7[_0x567e('0x5f')]['to'];return db[_0x567e('0x3c')][_0x567e('0x55')]({'where':{'id':_0x5c5ea7['params']['id']},'include':[{'model':db[_0x567e('0xbc')],'as':_0x567e('0xbd'),'include':[{'model':db[_0x567e('0x75')],'as':'Contacts','where':{'mobile':_0x1e144a},'limit':0x1,'order':[['updatedAt',_0x567e('0x93')]]}]}]})[_0x567e('0x1d')](handleEntityNotFound(_0xc6dcc1,null))[_0x567e('0x1d')](function(_0x1e5175){if(_0x1e5175&&_0x1e5175[_0x567e('0xbd')]){_0xfc4811=_0x1e5175['get']({'plain':!![]});if(_0xfc4811[_0x567e('0xbd')]&&_0xfc4811[_0x567e('0xbd')][_0x567e('0x92')]['length']){return _0xfc4811['List'][_0x567e('0x92')][0x0];}return db[_0x567e('0x75')]['create'](_[_0x567e('0x96')](_0x5c5ea7['body'],{'firstName':_0x1e144a,'mobile':_0x1e144a,'phone':_0x1e144a,'ListId':_0xfc4811[_0x567e('0x7b')]}));}})['then'](handleEntityNotFound(_0xc6dcc1,null))[_0x567e('0x1d')](function(_0x264b00){if(_0x264b00){_0x62de90=_0x264b00;return db[_0x567e('0x98')][_0x567e('0x55')]({'where':{'ContactId':_0x62de90['id'],'closed':![],'SmsAccountId':_0xfc4811['id']}})[_0x567e('0x1d')](function(_0x2faf66){if(_0x2faf66){return[_0x2faf66,![]];}return db[_0x567e('0x98')][_0x567e('0x56')]({'UserId':_0x5c5ea7[_0x567e('0x57')]['id'],'ContactId':_0x62de90['id'],'SmsAccountId':_0xfc4811['id'],'phone':_0x1e144a,'firstMsgDirection':_0x567e('0xbe'),'Messages':[_[_0x567e('0x4e')](_0x5c5ea7[_0x567e('0x5f')],{'read':![],'body':_0x5c5ea7[_0x567e('0x5f')]['body'],'phone':_0x1e144a,'SmsAccountId':_0xfc4811['id'],'UserId':_0x5c5ea7[_0x567e('0x57')]['id'],'ContactId':_0x62de90['id']})]},{'include':[{'model':db[_0x567e('0xa0')],'as':'Messages'}]})[_0x567e('0x1d')](function(_0x1b050a){return[_0x1b050a,!![]];});});}})[_0x567e('0x99')](function(_0x46320c,_0x2f3edb){if(_0x2f3edb){return _0x46320c;}return db[_0x567e('0xa0')][_0x567e('0x56')](_[_0x567e('0x4e')](_0x5c5ea7[_0x567e('0x5f')],{'read':![],'body':_0x5c5ea7['body'][_0x567e('0x5f')],'phone':_0x1e144a,'SmsAccountId':_0xfc4811['id'],'SmsInteractionId':_0x46320c['id'],'UserId':_0x5c5ea7[_0x567e('0x57')]['id'],'ContactId':_0x62de90['id']}))[_0x567e('0x1d')](function(_0x43b957){_0x46320c['dataValues']['Messages']=[];_0x46320c['dataValues'][_0x567e('0xbf')]['push'](_0x43b957[_0x567e('0xc0')]);return _0x46320c;});})[_0x567e('0x1d')](respondWithResult(_0xc6dcc1,null))['catch'](handleError(_0xc6dcc1,null));};exports['status']=function(_0x23aa12,_0x4d6697,_0x542410){if(_0x23aa12[_0x567e('0x5f')]['id']){delete _0x23aa12[_0x567e('0x5f')]['id'];}console['log']('endpoint\x20/status\x20POST\x20/',_0x23aa12[_0x567e('0x5f')]);var _0x47b395,_0x1e8f16,_0x46953c;return db[_0x567e('0x3c')][_0x567e('0x55')]({'where':{'id':_0x23aa12[_0x567e('0x60')]['id']}})[_0x567e('0x1d')](handleEntityNotFound(_0x4d6697,null))['then'](function(_0x3bc1ae){if(_0x3bc1ae){_0x46953c=_0x3bc1ae;logger[_0x567e('0x20')](_0x567e('0x21'),'status',_0x567e('0xc1'),_0x3bc1ae['type'],util[_0x567e('0xc2')](_0x23aa12[_0x567e('0x5f')],{'showHidden':![],'depth':null}));switch(_0x3bc1ae['type']){case _0x567e('0xc3'):if(_0x23aa12[_0x567e('0x5f')]['skebby_dispatch_id']&&_0x23aa12['body'][_0x567e('0x29')]){_0x1e8f16=_0x23aa12[_0x567e('0x5f')][_0x567e('0x29')];return db['SmsMessage'][_0x567e('0x55')]({'where':{'messageId':_0x23aa12[_0x567e('0x5f')][_0x567e('0xc4')]}});}break;case _0x567e('0x81'):if(_0x23aa12[_0x567e('0x5f')][_0x567e('0xc5')]&&_0x23aa12[_0x567e('0x5f')][_0x567e('0xc6')]){_0x1e8f16=_0x23aa12[_0x567e('0x5f')][_0x567e('0xc6')];return db[_0x567e('0xa0')][_0x567e('0x55')]({'where':{'messageId':_0x23aa12[_0x567e('0x5f')]['requestid']}});}break;case _0x567e('0x82'):if(_0x23aa12['body'][_0x567e('0xc7')]&&_0x23aa12[_0x567e('0x5f')]['status_code']){_0x1e8f16=_0x23aa12[_0x567e('0x5f')][_0x567e('0xc8')];return db['SmsMessage'][_0x567e('0x55')]({'where':{'messageId':_0x23aa12[_0x567e('0x5f')][_0x567e('0xc7')]}});}break;case _0x567e('0x86'):var _0x40a350=_0x23aa12['body'][_0x567e('0x87')][0x0];if(_0x40a350[_0x567e('0x7e')]&&_0x40a350['status'][_0x567e('0xc9')]===_0x567e('0xca')){_0x1e8f16=_0x40a350[_0x567e('0x29')][_0x567e('0xc9')];return db[_0x567e('0xa0')]['find']({'where':{'messageId':_0x40a350['messageId']}});}break;case _0x567e('0x88'):if(_0x23aa12[_0x567e('0x5f')]['messageId']&&_0x23aa12[_0x567e('0x5f')][_0x567e('0x29')]){_0x1e8f16=_0x23aa12[_0x567e('0x5f')][_0x567e('0x29')];return db['SmsMessage'][_0x567e('0x55')]({'where':{'messageId':_0x23aa12[_0x567e('0x5f')][_0x567e('0x7e')]}});}break;case _0x567e('0x8a'):if(_0x23aa12['body'][_0x567e('0xcb')]&&_0x23aa12['body'][_0x567e('0x29')]){_0x1e8f16=_0x23aa12['body'][_0x567e('0x29')];return db[_0x567e('0xa0')][_0x567e('0x55')]({'where':{'messageId':_0x23aa12['body']['redif']}});}break;}}})[_0x567e('0x1d')](handleEntityNotFound(_0x4d6697,null))[_0x567e('0x1d')](function(_0x1b445f){if(_0x1b445f){_0x47b395=_0x1b445f;switch(_0x46953c['type']){case _0x567e('0xc3'):if(_0x1e8f16==='DELIVERED'){return _0x47b395[_0x567e('0x5e')]({'read':!![]});}else{logger[_0x567e('0x23')](_0x567e('0x21'),_0x567e('0x29'),_0x567e('0xc3'),util[_0x567e('0xc2')](_0x23aa12[_0x567e('0x5f')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x1e8f16==='1'){return _0x47b395[_0x567e('0x5e')]({'read':!![]});}else{logger[_0x567e('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x567e('0x29'),_0x567e('0xc3'),util[_0x567e('0xc2')](_0x23aa12[_0x567e('0x5f')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x23aa12['body']['error_code']&&_0x1e8f16>=0xc8&&_0x1e8f16<=0xce){return _0x47b395[_0x567e('0x5e')]({'read':!![]});}else{logger[_0x567e('0x23')](_0x567e('0x21'),_0x567e('0x29'),_0x567e('0x82'),util[_0x567e('0xc2')](_0x23aa12['body'],{'showHidden':![],'depth':null}));}break;case _0x567e('0x86'):var _0x28fc3a=_0x23aa12[_0x567e('0x5f')]['results'][0x0];if(_0x28fc3a[_0x567e('0x29')][_0x567e('0xc9')]===_0x567e('0xca')){return _0x47b395[_0x567e('0x5e')]({'read':!![]});}else{logger[_0x567e('0x23')](_0x567e('0x21'),_0x567e('0x29'),_0x567e('0x86'),util[_0x567e('0xc2')](_0x23aa12[_0x567e('0x5f')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x1e8f16==_0x567e('0xcc')||_0x1e8f16==_0x567e('0xcd')){return _0x47b395[_0x567e('0x5e')]({'read':!![]});}else{logger[_0x567e('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x567e('0x29'),_0x567e('0x88'),util[_0x567e('0xc2')](_0x23aa12[_0x567e('0x5f')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x1e8f16===_0x567e('0xce')||_0x1e8f16==='ACCEPTD'){return _0x47b395[_0x567e('0x5e')]({'read':!![]});}else{logger[_0x567e('0x23')](_0x567e('0x21'),'status','intelepeer',util[_0x567e('0xc2')](_0x23aa12[_0x567e('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x47b395;}})['then'](respondWithResult(_0x4d6697,null))['catch'](handleError(_0x4d6697,null));};exports[_0x567e('0xcf')]=function(_0x65d0c9,_0x1603d2,_0x51d840){var _0x146a34,_0x531bfb,_0x3178ff;return db[_0x567e('0x3c')]['find']({'where':{'id':_0x65d0c9[_0x567e('0x60')]['id']}})[_0x567e('0x1d')](handleEntityNotFound(_0x1603d2,null))[_0x567e('0x1d')](function(_0x3bf093){if(_0x3bf093){_0x3178ff=_0x3bf093;logger[_0x567e('0x20')](_0x567e('0x21'),_0x567e('0x29'),_0x567e('0xc1'),_0x3bf093['type'],util[_0x567e('0xc2')](_0x65d0c9[_0x567e('0x42')],{'showHidden':![],'depth':null}));switch(_0x3bf093[_0x567e('0x4c')]){case'csc':if(_0x65d0c9['query']['message-id']&&_0x65d0c9[_0x567e('0x42')][_0x567e('0xd0')]){_0x531bfb=_0x65d0c9['query'][_0x567e('0xd0')];return db[_0x567e('0xa0')][_0x567e('0x55')]({'where':{'messageId':_0x65d0c9[_0x567e('0x42')][_0x567e('0xd1')]}});}break;}}})[_0x567e('0x1d')](handleEntityNotFound(_0x1603d2,null))[_0x567e('0x1d')](function(_0x4e4753){if(_0x4e4753){_0x146a34=_0x4e4753;switch(_0x3178ff[_0x567e('0x4c')]){case _0x567e('0xd2'):if(_0x531bfb==='2'||_0x531bfb==='6'){return _0x146a34[_0x567e('0x5e')]({'read':!![]});}else{logger[_0x567e('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x567e('0x29'),_0x567e('0xd2'),util[_0x567e('0xc2')](_0x65d0c9['query'],{'showHidden':![],'depth':null}));};break;}return _0x146a34;}})['then'](respondWithResult(_0x1603d2,null))['catch'](handleError(_0x1603d2,null));};exports['addAgents']=function(_0x4cb7ab,_0x350f08,_0x41914b){return db[_0x567e('0x3c')][_0x567e('0x55')]({'where':{'id':_0x4cb7ab[_0x567e('0x60')]['id']}})[_0x567e('0x1d')](handleEntityNotFound(_0x350f08,null))[_0x567e('0x1d')](function(_0x2e6857){if(_0x2e6857){return _0x2e6857['addAgents'](_0x4cb7ab[_0x567e('0x5f')][_0x567e('0x6c')],_[_0x567e('0x95')](_0x4cb7ab[_0x567e('0x5f')],[_0x567e('0x6c'),'id'])||{})['spread'](function(_0x4a609e){for(var _0x203734=0x0;_0x203734<_0x4cb7ab[_0x567e('0x5f')][_0x567e('0x6c')][_0x567e('0x54')];_0x203734+=0x1){socket['emit'](_0x567e('0xd3'),{'UserId':_0x4cb7ab[_0x567e('0x5f')][_0x567e('0x6c')][_0x203734],'SmsAccountId':_0x4cb7ab[_0x567e('0x60')]['id']});}return _0x4a609e;});}})['then'](respondWithResult(_0x350f08,null))[_0x567e('0x28')](handleError(_0x350f08,null));};exports[_0x567e('0xd4')]=function(_0x3be868,_0x504b16,_0x5e5208){return db[_0x567e('0x3c')][_0x567e('0x55')]({'where':{'id':_0x3be868['params']['id']}})[_0x567e('0x1d')](handleEntityNotFound(_0x504b16,null))[_0x567e('0x1d')](function(_0x3a87c7){if(_0x3a87c7){return _0x3a87c7[_0x567e('0xd4')](_0x3be868[_0x567e('0x42')][_0x567e('0x6c')])[_0x567e('0x1d')](function(){if(_[_0x567e('0xd5')](_0x3be868[_0x567e('0x42')][_0x567e('0x6c')])){for(var _0x13ec96=0x0;_0x13ec96<_0x3be868['query']['ids'][_0x567e('0x54')];_0x13ec96+=0x1){socket[_0x567e('0xd6')](_0x567e('0xd7'),{'UserId':Number(_0x3be868[_0x567e('0x42')][_0x567e('0x6c')][_0x13ec96]),'SmsAccountId':Number(_0x3be868['params']['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x3be868[_0x567e('0x42')]['ids']),'SmsAccountId':Number(_0x3be868[_0x567e('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x504b16,null))[_0x567e('0x28')](handleError(_0x504b16,null));};exports['getAgents']=function(_0x97d3d4,_0x2aee75,_0x16f24a){var _0x5f5264={};var _0x2ace81={};var _0x45d4cc;var _0x392e02;return db['SmsAccount'][_0x567e('0x66')]({'where':{'id':_0x97d3d4['params']['id']}})[_0x567e('0x1d')](handleEntityNotFound(_0x2aee75,null))[_0x567e('0x1d')](function(_0x3e44f4){if(_0x3e44f4){_0x45d4cc=_0x3e44f4;_0x2ace81['model']=_['keys'](db[_0x567e('0xa3')]['rawAttributes']);_0x2ace81['query']=_[_0x567e('0x3f')](_0x97d3d4['query']);_0x2ace81[_0x567e('0x40')]=_[_0x567e('0x41')](_0x2ace81[_0x567e('0x3e')],_0x2ace81[_0x567e('0x42')]);_0x5f5264[_0x567e('0x43')]=_[_0x567e('0x41')](_0x2ace81[_0x567e('0x3e')],qs[_0x567e('0x44')](_0x97d3d4[_0x567e('0x42')][_0x567e('0x44')]));_0x5f5264[_0x567e('0x43')]=_0x5f5264[_0x567e('0x43')][_0x567e('0x54')]?_0x5f5264[_0x567e('0x43')]:_0x2ace81['model'];_0x5f5264[_0x567e('0x46')]=qs[_0x567e('0x47')](_0x97d3d4[_0x567e('0x42')][_0x567e('0x47')]);_0x5f5264[_0x567e('0x48')]=qs[_0x567e('0x40')](_['pick'](_0x97d3d4[_0x567e('0x42')],_0x2ace81[_0x567e('0x40')]));if(_0x97d3d4[_0x567e('0x42')][_0x567e('0x4a')]){_0x5f5264['where']=_['merge'](_0x5f5264['where'],{'$or':_[_0x567e('0x4b')](_0x5f5264[_0x567e('0x43')],function(_0x273ef1){var _0x34a3cc={};_0x34a3cc[_0x273ef1]={'$like':'%'+_0x97d3d4['query'][_0x567e('0x4a')]+'%'};return _0x34a3cc;})});}_0x5f5264=_['merge']({},_0x5f5264,_0x97d3d4['options']);return _0x45d4cc['getAgents'](_0x5f5264);}})[_0x567e('0x1d')](function(_0x5044b2){if(_0x5044b2){_0x392e02=_0x5044b2['length'];if(!_0x97d3d4[_0x567e('0x42')][_0x567e('0xb1')](_0x567e('0x45'))){_0x5f5264[_0x567e('0x2c')]=qs[_0x567e('0x2c')](_0x97d3d4[_0x567e('0x42')][_0x567e('0x2c')]);_0x5f5264['offset']=qs['offset'](_0x97d3d4[_0x567e('0x42')][_0x567e('0x2b')]);}return _0x45d4cc[_0x567e('0xd8')](_0x5f5264);}})[_0x567e('0x1d')](function(_0x29820a){if(_0x29820a){return _0x29820a?{'count':_0x392e02,'rows':_0x29820a}:null;}})[_0x567e('0x1d')](respondWithResult(_0x2aee75,null))[_0x567e('0x28')](handleError(_0x2aee75,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 75b3ee6..82d3041 100644 --- a/server/api/smsAccount/smsAccount.events.js +++ b/server/api/smsAccount/smsAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4062=['SmsAccount','setMaxListeners','update','remove','emit','events','../../mysqldb'];(function(_0x2f1f7f,_0x297200){var _0x4e5bc0=function(_0x3a1a5d){while(--_0x3a1a5d){_0x2f1f7f['push'](_0x2f1f7f['shift']());}};_0x4e5bc0(++_0x297200);}(_0x4062,0x14e));var _0x2406=function(_0x206a42,_0x1cc9b7){_0x206a42=_0x206a42-0x0;var _0x5823dc=_0x4062[_0x206a42];return _0x5823dc;};'use strict';var EventEmitter=require(_0x2406('0x0'));var SmsAccount=require(_0x2406('0x1'))['db'][_0x2406('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x2406('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2406('0x4'),'afterDestroy':_0x2406('0x5')};function emitEvent(_0x14edd6){return function(_0x1aceaf,_0x5b4dea,_0x3e5815){SmsAccountEvents[_0x2406('0x6')](_0x14edd6+':'+_0x1aceaf['id'],_0x1aceaf);SmsAccountEvents[_0x2406('0x6')](_0x14edd6,_0x1aceaf);_0x3e5815(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x860a=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x7a2a2f,_0x26057a){var _0x4fbb2a=function(_0xd5e52f){while(--_0xd5e52f){_0x7a2a2f['push'](_0x7a2a2f['shift']());}};_0x4fbb2a(++_0x26057a);}(_0x860a,0x1ac));var _0xa860=function(_0x1d6b14,_0x3d4f42){_0x1d6b14=_0x1d6b14-0x0;var _0x2b90d6=_0x860a[_0x1d6b14];return _0x2b90d6;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xa860('0x0'))['db'][_0xa860('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xa860('0x2')](0x0);var events={'afterCreate':_0xa860('0x3'),'afterUpdate':_0xa860('0x4'),'afterDestroy':_0xa860('0x5')};function emitEvent(_0x1b18d8){return function(_0x626862,_0x92b927,_0x35096b){SmsAccountEvents[_0xa860('0x6')](_0x1b18d8+':'+_0x626862['id'],_0x626862);SmsAccountEvents[_0xa860('0x6')](_0x1b18d8,_0x626862);_0x35096b(null);};}for(var e in events){if(events[_0xa860('0x7')](e)){var event=events[e];SmsAccount[_0xa860('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 5fbd59d..b3c5ec1 100644 --- a/server/api/smsAccount/smsAccount.model.js +++ b/server/api/smsAccount/smsAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44be=['exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','./smsAccount.attributes'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x44be,0x190));var _0xe44b=function(_0x369a98,_0x32250c){_0x369a98=_0x369a98-0x0;var _0x29565c=_0x44be[_0x369a98];return _0x29565c;};'use strict';var _=require(_0xe44b('0x0'));var util=require(_0xe44b('0x1'));var logger=require(_0xe44b('0x2'))('api');var moment=require(_0xe44b('0x3'));var BPromise=require(_0xe44b('0x4'));var rp=require(_0xe44b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe44b('0x6'));module[_0xe44b('0x7')]=function(_0x28bd30,_0x3a1412){return _0x28bd30[_0xe44b('0x8')](_0xe44b('0x9'),attributes,{'tableName':_0xe44b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x510f=['lodash','moment','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x510f,0x17c));var _0xf510=function(_0x324b3f,_0x2776a3){_0x324b3f=_0x324b3f-0x0;var _0x1c5581=_0x510f[_0x324b3f];return _0x1c5581;};'use strict';var _=require(_0xf510('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf510('0x1'));var BPromise=require(_0xf510('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf510('0x3'));var rimraf=require(_0xf510('0x4'));var config=require(_0xf510('0x5'));var attributes=require(_0xf510('0x6'));module['exports']=function(_0x3cf4fe,_0x39792c){return _0x3cf4fe[_0xf510('0x7')](_0xf510('0x8'),attributes,{'tableName':_0xf510('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 34ff0e4..f46effa 100644 --- a/server/api/smsAccount/smsAccount.rpc.js +++ b/server/api/smsAccount/smsAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ad5=['http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ShowSmsAccount','find','options','raw','where','attributes','map','include','model','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x51057a,_0x2c8c27){var _0x3cbdaa=function(_0x168adf){while(--_0x168adf){_0x51057a['push'](_0x51057a['shift']());}};_0x3cbdaa(++_0x2c8c27);}(_0x0ad5,0x18d));var _0x50ad=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0ad5[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x50ad('0x0'));var util=require(_0x50ad('0x1'));var moment=require(_0x50ad('0x2'));var BPromise=require(_0x50ad('0x3'));var rs=require(_0x50ad('0x4'));var fs=require('fs');var Redis=require(_0x50ad('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x50ad('0x6'));var logger=require('../../config/logger')(_0x50ad('0x7'));var config=require('../../config/environment');var jayson=require(_0x50ad('0x8'));var client=jayson[_0x50ad('0x9')][_0x50ad('0xa')]({'port':0x232a});config[_0x50ad('0xb')]=_[_0x50ad('0xc')](config[_0x50ad('0xb')],{'host':_0x50ad('0xd'),'port':0x18eb});var socket=require(_0x50ad('0xe'))(new Redis(config[_0x50ad('0xb')]));require(_0x50ad('0xf'))['register'](socket);function respondWithRpcPromise(_0x21f633,_0x5857a6,_0x1968ab){return new BPromise(function(_0x551009,_0x50c9df){return client[_0x50ad('0x10')](_0x21f633,_0x1968ab)[_0x50ad('0x11')](function(_0x32c046){logger[_0x50ad('0x12')](_0x50ad('0x13'),_0x5857a6,'request\x20sent');logger['debug'](_0x50ad('0x14'),_0x5857a6,_0x50ad('0x15'),JSON['stringify'](_0x32c046));if(_0x32c046[_0x50ad('0x16')]){if(_0x32c046[_0x50ad('0x16')][_0x50ad('0x17')]===0x1f4){logger[_0x50ad('0x16')]('SmsAccount,\x20%s,\x20%s',_0x5857a6,_0x32c046[_0x50ad('0x16')][_0x50ad('0x18')]);return _0x50c9df(_0x32c046[_0x50ad('0x16')]['message']);}logger[_0x50ad('0x16')](_0x50ad('0x13'),_0x5857a6,_0x32c046['error'][_0x50ad('0x18')]);return _0x551009(_0x32c046[_0x50ad('0x16')][_0x50ad('0x18')]);}else{logger[_0x50ad('0x12')](_0x50ad('0x13'),_0x5857a6,_0x50ad('0x15'));_0x551009(_0x32c046['result'][_0x50ad('0x18')]);}})['catch'](function(_0x266cda){logger[_0x50ad('0x16')](_0x50ad('0x13'),_0x5857a6,_0x266cda);_0x50c9df(_0x266cda);});});}exports[_0x50ad('0x19')]=function(_0xdcf757){var _0x354c4b=this;return new Promise(function(_0x19bb3d,_0x33099d){return db['SmsAccount'][_0x50ad('0x1a')]({'raw':_0xdcf757[_0x50ad('0x1b')]?_0xdcf757[_0x50ad('0x1b')][_0x50ad('0x1c')]===undefined?!![]:![]:!![],'where':_0xdcf757[_0x50ad('0x1b')]?_0xdcf757[_0x50ad('0x1b')][_0x50ad('0x1d')]||null:null,'attributes':_0xdcf757[_0x50ad('0x1b')]?_0xdcf757[_0x50ad('0x1b')][_0x50ad('0x1e')]||null:null,'include':_0xdcf757[_0x50ad('0x1b')]?_0xdcf757[_0x50ad('0x1b')]['include']?_[_0x50ad('0x1f')](_0xdcf757[_0x50ad('0x1b')][_0x50ad('0x20')],function(_0x1f6637){return{'model':db[_0x1f6637[_0x50ad('0x21')]],'as':_0x1f6637['as'],'attributes':_0x1f6637[_0x50ad('0x1e')],'include':_0x1f6637[_0x50ad('0x20')]?_[_0x50ad('0x1f')](_0x1f6637[_0x50ad('0x20')],function(_0x3ebe33){return{'model':db[_0x3ebe33['model']],'as':_0x3ebe33['as'],'attributes':_0x3ebe33[_0x50ad('0x1e')],'include':_0x3ebe33[_0x50ad('0x20')]?_[_0x50ad('0x1f')](_0x3ebe33[_0x50ad('0x20')],function(_0x34bfaf){return{'model':db[_0x34bfaf[_0x50ad('0x21')]],'as':_0x34bfaf['as'],'attributes':_0x34bfaf['attributes']};}):[]};}):[]};}):[]:[]})[_0x50ad('0x11')](function(_0x4f542f){logger[_0x50ad('0x12')]('ShowSmsAccount',_0xdcf757);logger[_0x50ad('0x22')](_0x50ad('0x19'),_0xdcf757,JSON[_0x50ad('0x23')](_0x4f542f));_0x19bb3d(_0x4f542f);})[_0x50ad('0x24')](function(_0x37f4e9){logger['error'](_0x50ad('0x19'),_0x37f4e9[_0x50ad('0x18')],_0xdcf757);_0x33099d(_0x354c4b[_0x50ad('0x16')](0x1f4,_0x37f4e9[_0x50ad('0x18')]));});});}; \ No newline at end of file +var _0xbd1a=['register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SmsAccount','options','raw','attributes','include','model','map','ShowSmsAccount','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsAccount.socket'];(function(_0x4ea909,_0x334ac1){var _0x56e642=function(_0x59f60e){while(--_0x59f60e){_0x4ea909['push'](_0x4ea909['shift']());}};_0x56e642(++_0x334ac1);}(_0xbd1a,0x14e));var _0xabd1=function(_0x463e69,_0x4a6a51){_0x463e69=_0x463e69-0x0;var _0x272b8f=_0xbd1a[_0x463e69];return _0x272b8f;};'use strict';var _=require(_0xabd1('0x0'));var util=require(_0xabd1('0x1'));var moment=require(_0xabd1('0x2'));var BPromise=require(_0xabd1('0x3'));var rs=require(_0xabd1('0x4'));var fs=require('fs');var Redis=require(_0xabd1('0x5'));var db=require(_0xabd1('0x6'))['db'];var utils=require(_0xabd1('0x7'));var logger=require(_0xabd1('0x8'))(_0xabd1('0x9'));var config=require(_0xabd1('0xa'));var jayson=require(_0xabd1('0xb'));var client=jayson['client'][_0xabd1('0xc')]({'port':0x232a});config[_0xabd1('0xd')]=_['defaults'](config[_0xabd1('0xd')],{'host':_0xabd1('0xe'),'port':0x18eb});var socket=require(_0xabd1('0xf'))(new Redis(config[_0xabd1('0xd')]));require(_0xabd1('0x10'))[_0xabd1('0x11')](socket);function respondWithRpcPromise(_0x13a624,_0x32f5dd,_0x8202e4){return new BPromise(function(_0x2d3cb2,_0x5b9416){return client[_0xabd1('0x12')](_0x13a624,_0x8202e4)[_0xabd1('0x13')](function(_0x428822){logger[_0xabd1('0x14')](_0xabd1('0x15'),_0x32f5dd,_0xabd1('0x16'));logger['debug'](_0xabd1('0x17'),_0x32f5dd,'request\x20sent',JSON['stringify'](_0x428822));if(_0x428822[_0xabd1('0x18')]){if(_0x428822[_0xabd1('0x18')][_0xabd1('0x19')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x32f5dd,_0x428822[_0xabd1('0x18')]['message']);return _0x5b9416(_0x428822['error'][_0xabd1('0x1a')]);}logger['error'](_0xabd1('0x15'),_0x32f5dd,_0x428822[_0xabd1('0x18')][_0xabd1('0x1a')]);return _0x2d3cb2(_0x428822[_0xabd1('0x18')][_0xabd1('0x1a')]);}else{logger['info'](_0xabd1('0x15'),_0x32f5dd,_0xabd1('0x16'));_0x2d3cb2(_0x428822[_0xabd1('0x1b')][_0xabd1('0x1a')]);}})[_0xabd1('0x1c')](function(_0x340f9b){logger[_0xabd1('0x18')](_0xabd1('0x15'),_0x32f5dd,_0x340f9b);_0x5b9416(_0x340f9b);});});}exports['ShowSmsAccount']=function(_0x594ca1){var _0x58fcd0=this;return new Promise(function(_0x474165,_0x12fe38){return db[_0xabd1('0x1d')]['find']({'raw':_0x594ca1[_0xabd1('0x1e')]?_0x594ca1['options'][_0xabd1('0x1f')]===undefined?!![]:![]:!![],'where':_0x594ca1['options']?_0x594ca1['options']['where']||null:null,'attributes':_0x594ca1[_0xabd1('0x1e')]?_0x594ca1['options'][_0xabd1('0x20')]||null:null,'include':_0x594ca1[_0xabd1('0x1e')]?_0x594ca1[_0xabd1('0x1e')][_0xabd1('0x21')]?_['map'](_0x594ca1['options']['include'],function(_0xa24e9e){return{'model':db[_0xa24e9e['model']],'as':_0xa24e9e['as'],'attributes':_0xa24e9e['attributes'],'include':_0xa24e9e[_0xabd1('0x21')]?_['map'](_0xa24e9e[_0xabd1('0x21')],function(_0x1334d1){return{'model':db[_0x1334d1[_0xabd1('0x22')]],'as':_0x1334d1['as'],'attributes':_0x1334d1[_0xabd1('0x20')],'include':_0x1334d1['include']?_[_0xabd1('0x23')](_0x1334d1['include'],function(_0x4f4300){return{'model':db[_0x4f4300['model']],'as':_0x4f4300['as'],'attributes':_0x4f4300[_0xabd1('0x20')]};}):[]};}):[]};}):[]:[]})[_0xabd1('0x13')](function(_0x6f4f8d){logger[_0xabd1('0x14')](_0xabd1('0x24'),_0x594ca1);logger[_0xabd1('0x25')]('ShowSmsAccount',_0x594ca1,JSON[_0xabd1('0x26')](_0x6f4f8d));_0x474165(_0x6f4f8d);})[_0xabd1('0x1c')](function(_0x27cee1){logger[_0xabd1('0x18')]('ShowSmsAccount',_0x27cee1[_0xabd1('0x1a')],_0x594ca1);_0x12fe38(_0x58fcd0[_0xabd1('0x18')](0x1f4,_0x27cee1[_0xabd1('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index a29a020..9fec5f8 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8510=['length','remove','emit','removeListener'];(function(_0x563db8,_0xd567f9){var _0x5b79ec=function(_0x271553){while(--_0x271553){_0x563db8['push'](_0x563db8['shift']());}};_0x5b79ec(++_0xd567f9);}(_0x8510,0xd5));var _0x0851=function(_0x4d2552,_0x560684){_0x4d2552=_0x4d2552-0x0;var _0x56761b=_0x8510[_0x4d2552];return _0x56761b;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=['save',_0x0851('0x0'),'update'];function createListener(_0x5d3241,_0x3ef417){return function(_0x240e02){_0x3ef417[_0x0851('0x1')](_0x5d3241,_0x240e02);};}function removeListener(_0x4ee337,_0x34ac7e){return function(){SmsAccountEvents[_0x0851('0x2')](_0x4ee337,_0x34ac7e);};}exports['register']=function(_0x29caee){for(var _0x385d5f=0x0,_0x5a524b=events[_0x0851('0x3')];_0x385d5f<_0x5a524b;_0x385d5f++){var _0x540228=events[_0x385d5f];var _0x4f6b1a=createListener('smsAccount:'+_0x540228,_0x29caee);SmsAccountEvents['on'](_0x540228,_0x4f6b1a);}}; \ No newline at end of file +var _0x7757=['register','length','smsAccount:','save','remove','update','emit','removeListener'];(function(_0x42dda4,_0x3bffdd){var _0x579889=function(_0x386e16){while(--_0x386e16){_0x42dda4['push'](_0x42dda4['shift']());}};_0x579889(++_0x3bffdd);}(_0x7757,0x12b));var _0x7775=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7757[_0x40ac5e];return _0x2839d6;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x7775('0x0'),_0x7775('0x1'),_0x7775('0x2')];function createListener(_0x2086d0,_0xc64eb3){return function(_0x379690){_0xc64eb3[_0x7775('0x3')](_0x2086d0,_0x379690);};}function removeListener(_0x35b4fa,_0x4c27c0){return function(){SmsAccountEvents[_0x7775('0x4')](_0x35b4fa,_0x4c27c0);};}exports[_0x7775('0x5')]=function(_0x579aac){for(var _0x433ca8=0x0,_0xee7bdf=events[_0x7775('0x6')];_0x433ca8<_0xee7bdf;_0x433ca8++){var _0x6e26eb=events[_0x433ca8];var _0x14bfe3=createListener(_0x7775('0x7')+_0x6e26eb,_0x579aac);SmsAccountEvents['on'](_0x6e26eb,_0x14bfe3);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 3b3bf73..1811852 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a56=['index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a56,0x7d));var _0x68a5=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0x8a56[_0x3e0763];return _0x351ca2;};'use strict';var multer=require(_0x68a5('0x0'));var util=require(_0x68a5('0x1'));var path=require(_0x68a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x68a5('0x3'));var router=express[_0x68a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x68a5('0x5'));var config=require(_0x68a5('0x6'));var controller=require('./smsApplication.controller');router['get']('/',auth[_0x68a5('0x7')](),controller[_0x68a5('0x8')]);router[_0x68a5('0x9')](_0x68a5('0xa'),auth['isAuthenticated'](),controller[_0x68a5('0xb')]);router[_0x68a5('0xc')]('/',auth['isAuthenticated'](),controller[_0x68a5('0xd')]);router[_0x68a5('0xe')]('/:id',auth[_0x68a5('0x7')](),controller[_0x68a5('0xf')]);router[_0x68a5('0x10')]('/:id',auth[_0x68a5('0x7')](),controller[_0x68a5('0x11')]);module[_0x68a5('0x12')]=router; \ No newline at end of file +var _0x7c62=['get','isAuthenticated','index','/:id','show','create','update','delete','multer','util','connect-timeout','express','../../config/environment','./smsApplication.controller'];(function(_0x138dee,_0x4b6ca3){var _0x22d8a8=function(_0x3ac8a5){while(--_0x3ac8a5){_0x138dee['push'](_0x138dee['shift']());}};_0x22d8a8(++_0x4b6ca3);}(_0x7c62,0x1f2));var _0x27c6=function(_0x55bc47,_0x143f63){_0x55bc47=_0x55bc47-0x0;var _0x392f65=_0x7c62[_0x55bc47];return _0x392f65;};'use strict';var multer=require(_0x27c6('0x0'));var util=require(_0x27c6('0x1'));var path=require('path');var timeout=require(_0x27c6('0x2'));var express=require(_0x27c6('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x27c6('0x4'));var controller=require(_0x27c6('0x5'));router[_0x27c6('0x6')]('/',auth[_0x27c6('0x7')](),controller[_0x27c6('0x8')]);router[_0x27c6('0x6')](_0x27c6('0x9'),auth['isAuthenticated'](),controller[_0x27c6('0xa')]);router['post']('/',auth[_0x27c6('0x7')](),controller[_0x27c6('0xb')]);router['put'](_0x27c6('0x9'),auth[_0x27c6('0x7')](),controller[_0x27c6('0xc')]);router[_0x27c6('0xd')](_0x27c6('0x9'),auth[_0x27c6('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index d625829..98e7077 100644 --- a/server/api/smsApplication/smsApplication.attributes.js +++ b/server/api/smsApplication/smsApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdee3=['INTEGER','STRING','noop','sequelize','exports'];(function(_0x88bafc,_0x18c034){var _0x4056af=function(_0x4616e2){while(--_0x4616e2){_0x88bafc['push'](_0x88bafc['shift']());}};_0x4056af(++_0x18c034);}(_0xdee3,0x1c0));var _0x3dee=function(_0x24cf59,_0x5523e8){_0x24cf59=_0x24cf59-0x0;var _0x5205b6=_0xdee3[_0x24cf59];return _0x5205b6;};'use strict';var Sequelize=require(_0x3dee('0x0'));module[_0x3dee('0x1')]={'priority':{'type':Sequelize[_0x3dee('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3dee('0x3')],'allowNull':![],'defaultValue':_0x3dee('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3dee('0x3')]},'interval':{'type':Sequelize[_0x3dee('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x40c9=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x4a0dd8,_0x420d6b){var _0x101dcc=function(_0x12395e){while(--_0x12395e){_0x4a0dd8['push'](_0x4a0dd8['shift']());}};_0x101dcc(++_0x420d6b);}(_0x40c9,0x16c));var _0x940c=function(_0x55de41,_0x29e5d1){_0x55de41=_0x55de41-0x0;var _0x1117e3=_0x40c9[_0x55de41];return _0x1117e3;};'use strict';var Sequelize=require('sequelize');module[_0x940c('0x0')]={'priority':{'type':Sequelize[_0x940c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x940c('0x2')],'allowNull':![],'defaultValue':_0x940c('0x3')},'appdata':{'type':Sequelize[_0x940c('0x4')]()},'description':{'type':Sequelize[_0x940c('0x2')]},'interval':{'type':Sequelize[_0x940c('0x2')],'defaultValue':_0x940c('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 582cd5a..9750cde 100644 --- a/server/api/smsApplication/smsApplication.controller.js +++ b/server/api/smsApplication/smsApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc09=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','SmsApplication','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','key','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x1ced08,_0x68e19b){var _0x845ed5=function(_0x3eff94){while(--_0x3eff94){_0x1ced08['push'](_0x1ced08['shift']());}};_0x845ed5(++_0x68e19b);}(_0xfc09,0x150));var _0x9fc0=function(_0x2d6e43,_0x21ec16){_0x2d6e43=_0x2d6e43-0x0;var _0x40f421=_0xfc09[_0x2d6e43];return _0x40f421;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9fc0('0x0'));var rimraf=require(_0x9fc0('0x1'));var zipdir=require(_0x9fc0('0x2'));var jsonpatch=require(_0x9fc0('0x3'));var rp=require(_0x9fc0('0x4'));var moment=require(_0x9fc0('0x5'));var BPromise=require(_0x9fc0('0x6'));var Mustache=require(_0x9fc0('0x7'));var util=require(_0x9fc0('0x8'));var path=require(_0x9fc0('0x9'));var sox=require(_0x9fc0('0xa'));var csv=require('to-csv');var ejs=require(_0x9fc0('0xb'));var fs=require('fs');var _=require(_0x9fc0('0xc'));var squel=require('squel');var crypto=require(_0x9fc0('0xd'));var jsforce=require(_0x9fc0('0xe'));var deskjs=require(_0x9fc0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9fc0('0x10'));var Papa=require(_0x9fc0('0x11'));var Redis=require(_0x9fc0('0x12'));var authService=require(_0x9fc0('0x13'));var qs=require(_0x9fc0('0x14'));var hardwareService=require(_0x9fc0('0x15'));var logger=require(_0x9fc0('0x16'))(_0x9fc0('0x17'));var utils=require(_0x9fc0('0x18'));var config=require(_0x9fc0('0x19'));var db=require(_0x9fc0('0x1a'))['db'];function respondWithStatusCode(_0x2c8ee1,_0x5152cb){_0x5152cb=_0x5152cb||0xcc;return function(_0x44f7db){if(_0x44f7db){return _0x2c8ee1[_0x9fc0('0x1b')](_0x5152cb);}return _0x2c8ee1[_0x9fc0('0x1c')](_0x5152cb)[_0x9fc0('0x1d')]();};}function respondWithResult(_0x433fd9,_0x5ea160){_0x5ea160=_0x5ea160||0xc8;return function(_0x5ad778){if(_0x5ad778){return _0x433fd9['status'](_0x5ea160)['json'](_0x5ad778);}};}function respondWithFilteredResult(_0x9193c,_0x306e73){return function(_0x373aec){if(_0x373aec){var _0x58b397=_0x373aec[_0x9fc0('0x1e')],_0x24d9bf=_0x306e73[_0x9fc0('0x1f')],_0xaa1a2=_0x306e73[_0x9fc0('0x1f')]+_0x306e73[_0x9fc0('0x20')],_0x110449;if(_0xaa1a2>=_0x58b397){_0xaa1a2=_0x58b397;_0x110449=0xc8;}else{_0x110449=0xce;}_0x9193c[_0x9fc0('0x1c')](_0x110449);return _0x9193c[_0x9fc0('0x21')](_0x9fc0('0x22'),_0x24d9bf+'-'+_0xaa1a2+'/'+_0x58b397)['json'](_0x373aec);}return null;};}function patchUpdates(_0x28c49f){return function(_0x58bde1){try{jsonpatch[_0x9fc0('0x23')](_0x58bde1,_0x28c49f,!![]);}catch(_0x4c3bf4){return BPromise[_0x9fc0('0x24')](_0x4c3bf4);}return _0x58bde1['save']();};}function saveUpdates(_0x58bc66,_0x4cc829){return function(_0x4b1859){if(_0x4b1859){return _0x4b1859[_0x9fc0('0x25')](_0x58bc66)[_0x9fc0('0x26')](function(_0x167bc2){return _0x167bc2;});}return null;};}function removeEntity(_0x12cc23,_0x1a8a3f){return function(_0x10ecdd){if(_0x10ecdd){return _0x10ecdd[_0x9fc0('0x27')]()[_0x9fc0('0x26')](function(){_0x12cc23[_0x9fc0('0x1c')](0xcc)[_0x9fc0('0x1d')]();});}};}function handleEntityNotFound(_0x5c0832,_0x31b36f){return function(_0x7b8d73){if(!_0x7b8d73){_0x5c0832[_0x9fc0('0x1b')](0x194);}return _0x7b8d73;};}function handleError(_0x10f666,_0x194e7f){_0x194e7f=_0x194e7f||0x1f4;return function(_0x181e8b){logger['error'](_0x181e8b[_0x9fc0('0x28')]);if(_0x181e8b[_0x9fc0('0x29')]){delete _0x181e8b['name'];}_0x10f666[_0x9fc0('0x1c')](_0x194e7f)['send'](_0x181e8b);};}exports['index']=function(_0x29ff8c,_0x140e88){var _0x28edf7={},_0x3b68d0={},_0x778628={'count':0x0,'rows':[]};var _0x14c00d=db[_0x9fc0('0x2a')]['rawAttributes'];_0x3b68d0[_0x9fc0('0x2b')]=_[_0x9fc0('0x2c')](_0x14c00d);_0x3b68d0[_0x9fc0('0x2d')]=_[_0x9fc0('0x2c')](_0x29ff8c['query']);_0x3b68d0['filters']=_[_0x9fc0('0x2e')](_0x3b68d0[_0x9fc0('0x2b')],_0x3b68d0[_0x9fc0('0x2d')]);_0x28edf7['attributes']=_['intersection'](_0x3b68d0[_0x9fc0('0x2b')],qs['fields'](_0x29ff8c[_0x9fc0('0x2d')][_0x9fc0('0x2f')]));_0x28edf7['attributes']=_0x28edf7[_0x9fc0('0x30')][_0x9fc0('0x31')]?_0x28edf7['attributes']:_0x3b68d0['model'];if(!_0x29ff8c['query'][_0x9fc0('0x32')](_0x9fc0('0x33'))){_0x28edf7[_0x9fc0('0x20')]=qs[_0x9fc0('0x20')](_0x29ff8c[_0x9fc0('0x2d')][_0x9fc0('0x20')]);_0x28edf7[_0x9fc0('0x1f')]=qs[_0x9fc0('0x1f')](_0x29ff8c[_0x9fc0('0x2d')][_0x9fc0('0x1f')]);}_0x28edf7[_0x9fc0('0x34')]=qs[_0x9fc0('0x35')](_0x29ff8c[_0x9fc0('0x2d')]['sort']);_0x28edf7[_0x9fc0('0x36')]=qs[_0x9fc0('0x37')](_[_0x9fc0('0x38')](_0x29ff8c[_0x9fc0('0x2d')],_0x3b68d0[_0x9fc0('0x37')]));if(_0x29ff8c[_0x9fc0('0x2d')][_0x9fc0('0x39')]){_0x28edf7[_0x9fc0('0x36')]=_[_0x9fc0('0x3a')](_0x28edf7['where'],{'$or':_['map'](_0x14c00d,function(_0x412563){if(_0x412563[_0x9fc0('0x3b')][_0x9fc0('0x3c')]!=='VIRTUAL'){var _0x296c20={};_0x296c20[_0x412563['field']]={'$like':'%'+_0x29ff8c[_0x9fc0('0x2d')][_0x9fc0('0x39')]+'%'};return _0x296c20;}})});}_0x28edf7=_[_0x9fc0('0x3a')]({},_0x28edf7,_0x29ff8c[_0x9fc0('0x3d')]);var _0x1d9bba={'where':_0x28edf7[_0x9fc0('0x36')]};return db[_0x9fc0('0x2a')][_0x9fc0('0x1e')](_0x1d9bba)[_0x9fc0('0x26')](function(_0x42ccc0){_0x778628['count']=_0x42ccc0;if(_0x29ff8c[_0x9fc0('0x2d')]['includeAll']){_0x28edf7[_0x9fc0('0x3e')]=[{'all':!![]}];}return db[_0x9fc0('0x2a')][_0x9fc0('0x3f')](_0x28edf7);})[_0x9fc0('0x26')](function(_0x376b17){_0x778628[_0x9fc0('0x40')]=_0x376b17;return _0x778628;})['then'](respondWithFilteredResult(_0x140e88,_0x28edf7))[_0x9fc0('0x41')](handleError(_0x140e88,null));};exports['show']=function(_0x36a307,_0xc3c28a){var _0x3ce807={'raw':!![],'where':{'id':_0x36a307[_0x9fc0('0x42')]['id']}},_0x583f66={};_0x583f66[_0x9fc0('0x2b')]=_[_0x9fc0('0x2c')](db[_0x9fc0('0x2a')][_0x9fc0('0x43')]);_0x583f66[_0x9fc0('0x2d')]=_[_0x9fc0('0x2c')](_0x36a307['query']);_0x583f66['filters']=_[_0x9fc0('0x2e')](_0x583f66[_0x9fc0('0x2b')],_0x583f66[_0x9fc0('0x2d')]);_0x3ce807['attributes']=_[_0x9fc0('0x2e')](_0x583f66[_0x9fc0('0x2b')],qs[_0x9fc0('0x2f')](_0x36a307['query'][_0x9fc0('0x2f')]));_0x3ce807[_0x9fc0('0x30')]=_0x3ce807[_0x9fc0('0x30')]['length']?_0x3ce807[_0x9fc0('0x30')]:_0x583f66[_0x9fc0('0x2b')];if(_0x36a307[_0x9fc0('0x2d')][_0x9fc0('0x44')]){_0x3ce807[_0x9fc0('0x3e')]=[{'all':!![]}];}_0x3ce807=_['merge']({},_0x3ce807,_0x36a307['options']);return db[_0x9fc0('0x2a')][_0x9fc0('0x45')](_0x3ce807)[_0x9fc0('0x26')](handleEntityNotFound(_0xc3c28a,null))[_0x9fc0('0x26')](respondWithResult(_0xc3c28a,null))['catch'](handleError(_0xc3c28a,null));};exports[_0x9fc0('0x46')]=function(_0x2ea4c5,_0x446c1b){return db[_0x9fc0('0x2a')]['create'](_0x2ea4c5['body'],{})[_0x9fc0('0x26')](respondWithResult(_0x446c1b,0xc9))['catch'](handleError(_0x446c1b,null));};exports[_0x9fc0('0x25')]=function(_0x390bcf,_0x2d556a){if(_0x390bcf[_0x9fc0('0x47')]['id']){delete _0x390bcf[_0x9fc0('0x47')]['id'];}return db[_0x9fc0('0x2a')][_0x9fc0('0x45')]({'where':{'id':_0x390bcf[_0x9fc0('0x42')]['id']}})[_0x9fc0('0x26')](handleEntityNotFound(_0x2d556a,null))[_0x9fc0('0x26')](saveUpdates(_0x390bcf[_0x9fc0('0x47')],null))[_0x9fc0('0x26')](respondWithResult(_0x2d556a,null))['catch'](handleError(_0x2d556a,null));};exports[_0x9fc0('0x27')]=function(_0x5b2f86,_0x206a26){return db['SmsApplication'][_0x9fc0('0x45')]({'where':{'id':_0x5b2f86[_0x9fc0('0x42')]['id']}})['then'](handleEntityNotFound(_0x206a26,null))[_0x9fc0('0x26')](removeEntity(_0x206a26,null))[_0x9fc0('0x41')](handleError(_0x206a26,null));}; \ No newline at end of file +var _0x1280=['options','includeAll','include','findAll','rows','catch','show','rawAttributes','fields','length','create','body','params','find','html-pdf','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','SmsApplication','model','keys','filters','intersection','query','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field'];(function(_0x39a600,_0x59e732){var _0xf7edd2=function(_0x50bcb6){while(--_0x50bcb6){_0x39a600['push'](_0x39a600['shift']());}};_0xf7edd2(++_0x59e732);}(_0x1280,0x9a));var _0x0128=function(_0x57ac3b,_0x32e884){_0x57ac3b=_0x57ac3b-0x0;var _0x4204c9=_0x1280[_0x57ac3b];return _0x4204c9;};'use strict';var pdf=require(_0x0128('0x0'));var emlformat=require(_0x0128('0x1'));var rimraf=require(_0x0128('0x2'));var zipdir=require(_0x0128('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0128('0x4'));var Mustache=require('mustache');var util=require(_0x0128('0x5'));var path=require(_0x0128('0x6'));var sox=require(_0x0128('0x7'));var csv=require(_0x0128('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0128('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0128('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0128('0xb'));var Redis=require('ioredis');var authService=require(_0x0128('0xc'));var qs=require(_0x0128('0xd'));var hardwareService=require(_0x0128('0xe'));var logger=require(_0x0128('0xf'))(_0x0128('0x10'));var utils=require(_0x0128('0x11'));var config=require(_0x0128('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x455283,_0x44712d){_0x44712d=_0x44712d||0xcc;return function(_0x230d19){if(_0x230d19){return _0x455283[_0x0128('0x13')](_0x44712d);}return _0x455283[_0x0128('0x14')](_0x44712d)[_0x0128('0x15')]();};}function respondWithResult(_0x12f026,_0x14a514){_0x14a514=_0x14a514||0xc8;return function(_0x19d2dd){if(_0x19d2dd){return _0x12f026[_0x0128('0x14')](_0x14a514)[_0x0128('0x16')](_0x19d2dd);}};}function respondWithFilteredResult(_0x5b4106,_0x22a001){return function(_0x32abb5){if(_0x32abb5){var _0x2231dc=_0x32abb5[_0x0128('0x17')],_0xe83829=_0x22a001[_0x0128('0x18')],_0x3c1d8c=_0x22a001[_0x0128('0x18')]+_0x22a001[_0x0128('0x19')],_0x2c6401;if(_0x3c1d8c>=_0x2231dc){_0x3c1d8c=_0x2231dc;_0x2c6401=0xc8;}else{_0x2c6401=0xce;}_0x5b4106[_0x0128('0x14')](_0x2c6401);return _0x5b4106[_0x0128('0x1a')](_0x0128('0x1b'),_0xe83829+'-'+_0x3c1d8c+'/'+_0x2231dc)[_0x0128('0x16')](_0x32abb5);}return null;};}function patchUpdates(_0x5aa478){return function(_0x5629b4){try{jsonpatch[_0x0128('0x1c')](_0x5629b4,_0x5aa478,!![]);}catch(_0x49f6e2){return BPromise[_0x0128('0x1d')](_0x49f6e2);}return _0x5629b4[_0x0128('0x1e')]();};}function saveUpdates(_0x13ab16,_0x7fc836){return function(_0x2d3b06){if(_0x2d3b06){return _0x2d3b06[_0x0128('0x1f')](_0x13ab16)[_0x0128('0x20')](function(_0x31e850){return _0x31e850;});}return null;};}function removeEntity(_0xe9e226,_0xb024b5){return function(_0x216ced){if(_0x216ced){return _0x216ced[_0x0128('0x21')]()[_0x0128('0x20')](function(){_0xe9e226['status'](0xcc)[_0x0128('0x15')]();});}};}function handleEntityNotFound(_0x3a14a6,_0x1e7c83){return function(_0x195ef5){if(!_0x195ef5){_0x3a14a6[_0x0128('0x13')](0x194);}return _0x195ef5;};}function handleError(_0x2a7082,_0x4d0064){_0x4d0064=_0x4d0064||0x1f4;return function(_0x10517b){logger[_0x0128('0x22')](_0x10517b['stack']);if(_0x10517b[_0x0128('0x23')]){delete _0x10517b['name'];}_0x2a7082[_0x0128('0x14')](_0x4d0064)[_0x0128('0x24')](_0x10517b);};}exports['index']=function(_0x54c3da,_0x5f14bd){var _0x672323={},_0xd6365c={},_0x2aee10={'count':0x0,'rows':[]};var _0xaf5081=db[_0x0128('0x25')]['rawAttributes'];_0xd6365c[_0x0128('0x26')]=_[_0x0128('0x27')](_0xaf5081);_0xd6365c['query']=_['keys'](_0x54c3da['query']);_0xd6365c[_0x0128('0x28')]=_[_0x0128('0x29')](_0xd6365c[_0x0128('0x26')],_0xd6365c[_0x0128('0x2a')]);_0x672323[_0x0128('0x2b')]=_[_0x0128('0x29')](_0xd6365c[_0x0128('0x26')],qs['fields'](_0x54c3da[_0x0128('0x2a')]['fields']));_0x672323[_0x0128('0x2b')]=_0x672323[_0x0128('0x2b')]['length']?_0x672323[_0x0128('0x2b')]:_0xd6365c[_0x0128('0x26')];if(!_0x54c3da[_0x0128('0x2a')][_0x0128('0x2c')]('nolimit')){_0x672323['limit']=qs[_0x0128('0x19')](_0x54c3da[_0x0128('0x2a')]['limit']);_0x672323[_0x0128('0x18')]=qs[_0x0128('0x18')](_0x54c3da[_0x0128('0x2a')]['offset']);}_0x672323[_0x0128('0x2d')]=qs[_0x0128('0x2e')](_0x54c3da[_0x0128('0x2a')][_0x0128('0x2e')]);_0x672323[_0x0128('0x2f')]=qs[_0x0128('0x28')](_[_0x0128('0x30')](_0x54c3da[_0x0128('0x2a')],_0xd6365c['filters']));if(_0x54c3da['query'][_0x0128('0x31')]){_0x672323[_0x0128('0x2f')]=_[_0x0128('0x32')](_0x672323[_0x0128('0x2f')],{'$or':_[_0x0128('0x33')](_0xaf5081,function(_0x5e20ef){if(_0x5e20ef[_0x0128('0x34')][_0x0128('0x35')]!==_0x0128('0x36')){var _0x394837={};_0x394837[_0x5e20ef[_0x0128('0x37')]]={'$like':'%'+_0x54c3da['query'][_0x0128('0x31')]+'%'};return _0x394837;}})});}_0x672323=_[_0x0128('0x32')]({},_0x672323,_0x54c3da[_0x0128('0x38')]);var _0x4408e3={'where':_0x672323[_0x0128('0x2f')]};return db[_0x0128('0x25')][_0x0128('0x17')](_0x4408e3)[_0x0128('0x20')](function(_0x2fabc0){_0x2aee10[_0x0128('0x17')]=_0x2fabc0;if(_0x54c3da[_0x0128('0x2a')][_0x0128('0x39')]){_0x672323[_0x0128('0x3a')]=[{'all':!![]}];}return db[_0x0128('0x25')][_0x0128('0x3b')](_0x672323);})[_0x0128('0x20')](function(_0x591d6d){_0x2aee10[_0x0128('0x3c')]=_0x591d6d;return _0x2aee10;})[_0x0128('0x20')](respondWithFilteredResult(_0x5f14bd,_0x672323))[_0x0128('0x3d')](handleError(_0x5f14bd,null));};exports[_0x0128('0x3e')]=function(_0x470669,_0x445355){var _0xdcbccf={'raw':!![],'where':{'id':_0x470669['params']['id']}},_0x5d2260={};_0x5d2260['model']=_[_0x0128('0x27')](db[_0x0128('0x25')][_0x0128('0x3f')]);_0x5d2260[_0x0128('0x2a')]=_['keys'](_0x470669[_0x0128('0x2a')]);_0x5d2260['filters']=_['intersection'](_0x5d2260[_0x0128('0x26')],_0x5d2260[_0x0128('0x2a')]);_0xdcbccf[_0x0128('0x2b')]=_[_0x0128('0x29')](_0x5d2260[_0x0128('0x26')],qs[_0x0128('0x40')](_0x470669[_0x0128('0x2a')][_0x0128('0x40')]));_0xdcbccf[_0x0128('0x2b')]=_0xdcbccf[_0x0128('0x2b')][_0x0128('0x41')]?_0xdcbccf[_0x0128('0x2b')]:_0x5d2260[_0x0128('0x26')];if(_0x470669[_0x0128('0x2a')]['includeAll']){_0xdcbccf[_0x0128('0x3a')]=[{'all':!![]}];}_0xdcbccf=_[_0x0128('0x32')]({},_0xdcbccf,_0x470669[_0x0128('0x38')]);return db[_0x0128('0x25')]['find'](_0xdcbccf)[_0x0128('0x20')](handleEntityNotFound(_0x445355,null))[_0x0128('0x20')](respondWithResult(_0x445355,null))[_0x0128('0x3d')](handleError(_0x445355,null));};exports[_0x0128('0x42')]=function(_0x16de52,_0x5d85bc){return db[_0x0128('0x25')][_0x0128('0x42')](_0x16de52[_0x0128('0x43')],{})[_0x0128('0x20')](respondWithResult(_0x5d85bc,0xc9))[_0x0128('0x3d')](handleError(_0x5d85bc,null));};exports[_0x0128('0x1f')]=function(_0x42db63,_0x299194){if(_0x42db63[_0x0128('0x43')]['id']){delete _0x42db63['body']['id'];}return db[_0x0128('0x25')]['find']({'where':{'id':_0x42db63[_0x0128('0x44')]['id']}})[_0x0128('0x20')](handleEntityNotFound(_0x299194,null))[_0x0128('0x20')](saveUpdates(_0x42db63[_0x0128('0x43')],null))[_0x0128('0x20')](respondWithResult(_0x299194,null))[_0x0128('0x3d')](handleError(_0x299194,null));};exports[_0x0128('0x21')]=function(_0x390003,_0x351278){return db[_0x0128('0x25')][_0x0128('0x45')]({'where':{'id':_0x390003[_0x0128('0x44')]['id']}})[_0x0128('0x20')](handleEntityNotFound(_0x351278,null))[_0x0128('0x20')](removeEntity(_0x351278,null))[_0x0128('0x3d')](handleError(_0x351278,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 6789429..9eb521e 100644 --- a/server/api/smsApplication/smsApplication.model.js +++ b/server/api/smsApplication/smsApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd338=['utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication'];(function(_0x3767dd,_0x36eb18){var _0x4f2f8a=function(_0x360576){while(--_0x360576){_0x3767dd['push'](_0x3767dd['shift']());}};_0x4f2f8a(++_0x36eb18);}(_0xd338,0x69));var _0x8d33=function(_0x1529a3,_0x529f63){_0x1529a3=_0x1529a3-0x0;var _0x1a0d4b=_0xd338[_0x1529a3];return _0x1a0d4b;};'use strict';var _=require(_0x8d33('0x0'));var util=require(_0x8d33('0x1'));var logger=require(_0x8d33('0x2'))(_0x8d33('0x3'));var moment=require(_0x8d33('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d33('0x5'));var fs=require('fs');var path=require(_0x8d33('0x6'));var rimraf=require(_0x8d33('0x7'));var config=require(_0x8d33('0x8'));var attributes=require(_0x8d33('0x9'));module['exports']=function(_0x45f8fc,_0x57dd2d){return _0x45f8fc[_0x8d33('0xa')](_0x8d33('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8d33('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf2a4=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./smsApplication.attributes','define','SmsApplication','sms_applications'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0xf2a4,0x64));var _0x4f2a=function(_0xa930ca,_0x15ea90){_0xa930ca=_0xa930ca-0x0;var _0x43f592=_0xf2a4[_0xa930ca];return _0x43f592;};'use strict';var _=require(_0x4f2a('0x0'));var util=require(_0x4f2a('0x1'));var logger=require(_0x4f2a('0x2'))(_0x4f2a('0x3'));var moment=require(_0x4f2a('0x4'));var BPromise=require(_0x4f2a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f2a('0x6'));var rimraf=require(_0x4f2a('0x7'));var config=require('../../config/environment');var attributes=require(_0x4f2a('0x8'));module['exports']=function(_0x197081,_0x1ed740){return _0x197081[_0x4f2a('0x9')](_0x4f2a('0xa'),attributes,{'tableName':_0x4f2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4f2a('0xc'),'collate':_0x4f2a('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 45ae166..3e82253 100644 --- a/server/api/smsApplication/smsApplication.rpc.js +++ b/server/api/smsApplication/smsApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39c7=['stringify','error','code','SmsApplication,\x20%s,\x20%s','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x39c7,0x85));var _0x739c=function(_0x325398,_0x5caf8b){_0x325398=_0x325398-0x0;var _0x43df61=_0x39c7[_0x325398];return _0x43df61;};'use strict';var _=require('lodash');var util=require(_0x739c('0x0'));var moment=require(_0x739c('0x1'));var BPromise=require(_0x739c('0x2'));var rs=require(_0x739c('0x3'));var fs=require('fs');var Redis=require(_0x739c('0x4'));var db=require(_0x739c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x739c('0x6'))(_0x739c('0x7'));var config=require(_0x739c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x739c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c0af1,_0x5df5d3,_0x480159){return new BPromise(function(_0x27c5a4,_0x3475f2){return client['request'](_0x3c0af1,_0x480159)[_0x739c('0xa')](function(_0x277f61){logger['info']('SmsApplication,\x20%s,\x20%s',_0x5df5d3,_0x739c('0xb'));logger[_0x739c('0xc')](_0x739c('0xd'),_0x5df5d3,_0x739c('0xb'),JSON[_0x739c('0xe')](_0x277f61));if(_0x277f61[_0x739c('0xf')]){if(_0x277f61[_0x739c('0xf')][_0x739c('0x10')]===0x1f4){logger[_0x739c('0xf')](_0x739c('0x11'),_0x5df5d3,_0x277f61[_0x739c('0xf')][_0x739c('0x12')]);return _0x3475f2(_0x277f61['error'][_0x739c('0x12')]);}logger[_0x739c('0xf')](_0x739c('0x11'),_0x5df5d3,_0x277f61[_0x739c('0xf')][_0x739c('0x12')]);return _0x27c5a4(_0x277f61[_0x739c('0xf')][_0x739c('0x12')]);}else{logger[_0x739c('0x13')](_0x739c('0x11'),_0x5df5d3,_0x739c('0xb'));_0x27c5a4(_0x277f61['result']['message']);}})[_0x739c('0x14')](function(_0x23888d){logger[_0x739c('0xf')]('SmsApplication,\x20%s,\x20%s',_0x5df5d3,_0x23888d);_0x3475f2(_0x23888d);});});} \ No newline at end of file +var _0x86f4=['info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x2f0ae3,_0x4174fb){var _0xdf2bb1=function(_0x2e88b4){while(--_0x2e88b4){_0x2f0ae3['push'](_0x2f0ae3['shift']());}};_0xdf2bb1(++_0x4174fb);}(_0x86f4,0x18a));var _0x486f=function(_0x5301f5,_0x14d958){_0x5301f5=_0x5301f5-0x0;var _0x4792a7=_0x86f4[_0x5301f5];return _0x4792a7;};'use strict';var _=require(_0x486f('0x0'));var util=require(_0x486f('0x1'));var moment=require(_0x486f('0x2'));var BPromise=require(_0x486f('0x3'));var rs=require(_0x486f('0x4'));var fs=require('fs');var Redis=require(_0x486f('0x5'));var db=require(_0x486f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x486f('0x7'))(_0x486f('0x8'));var config=require('../../config/environment');var jayson=require(_0x486f('0x9'));var client=jayson[_0x486f('0xa')][_0x486f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x207201,_0x3c6469,_0x3a0791){return new BPromise(function(_0x5bfabc,_0x33363d){return client[_0x486f('0xc')](_0x207201,_0x3a0791)[_0x486f('0xd')](function(_0x468a82){logger[_0x486f('0xe')](_0x486f('0xf'),_0x3c6469,_0x486f('0x10'));logger[_0x486f('0x11')](_0x486f('0x12'),_0x3c6469,_0x486f('0x10'),JSON[_0x486f('0x13')](_0x468a82));if(_0x468a82[_0x486f('0x14')]){if(_0x468a82[_0x486f('0x14')][_0x486f('0x15')]===0x1f4){logger[_0x486f('0x14')](_0x486f('0xf'),_0x3c6469,_0x468a82[_0x486f('0x14')]['message']);return _0x33363d(_0x468a82[_0x486f('0x14')]['message']);}logger[_0x486f('0x14')](_0x486f('0xf'),_0x3c6469,_0x468a82[_0x486f('0x14')]['message']);return _0x5bfabc(_0x468a82['error'][_0x486f('0x16')]);}else{logger[_0x486f('0xe')]('SmsApplication,\x20%s,\x20%s',_0x3c6469,_0x486f('0x10'));_0x5bfabc(_0x468a82[_0x486f('0x17')][_0x486f('0x16')]);}})['catch'](function(_0x53561a){logger[_0x486f('0x14')](_0x486f('0xf'),_0x3c6469,_0x53561a);_0x33363d(_0x53561a);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index d8399d9..bd2f44c 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd6e=['get','isAuthenticated','describe','/:id','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xdd6e,0xa5));var _0xedd6=function(_0x1a9a6d,_0x206d13){_0x1a9a6d=_0x1a9a6d-0x0;var _0x517459=_0xdd6e[_0x1a9a6d];return _0x517459;};'use strict';var multer=require(_0xedd6('0x0'));var util=require(_0xedd6('0x1'));var path=require(_0xedd6('0x2'));var timeout=require(_0xedd6('0x3'));var express=require('express');var router=express[_0xedd6('0x4')]();var auth=require(_0xedd6('0x5'));var interaction=require(_0xedd6('0x6'));var config=require(_0xedd6('0x7'));var controller=require('./smsInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xedd6('0x8')]);router[_0xedd6('0x9')]('/describe',auth[_0xedd6('0xa')](),controller[_0xedd6('0xb')]);router[_0xedd6('0x9')](_0xedd6('0xc'),auth[_0xedd6('0xa')](),controller['show']);router['get'](_0xedd6('0xd'),auth[_0xedd6('0xa')](),controller['getMessages']);router[_0xedd6('0x9')](_0xedd6('0xe'),auth[_0xedd6('0xa')](),controller[_0xedd6('0xf')]);router['post']('/',auth[_0xedd6('0xa')](),controller['create']);router[_0xedd6('0x10')](_0xedd6('0xd'),auth[_0xedd6('0xa')](),controller[_0xedd6('0x11')]);router['post'](_0xedd6('0x12'),auth[_0xedd6('0xa')](),interaction[_0xedd6('0x13')](_0xedd6('0x14'),_0xedd6('0x15')),controller[_0xedd6('0x16')]);router[_0xedd6('0x17')](_0xedd6('0xc'),auth[_0xedd6('0xa')](),interaction[_0xedd6('0x13')](_0xedd6('0x14'),_0xedd6('0x18')),controller['update']);router[_0xedd6('0x19')](_0xedd6('0xc'),auth[_0xedd6('0xa')](),interaction[_0xedd6('0x13')]('sms','smsinteraction:destroy'),controller[_0xedd6('0x1a')]);router['delete'](_0xedd6('0x12'),auth[_0xedd6('0xa')](),controller[_0xedd6('0x1b')]);module[_0xedd6('0x1c')]=router; \ No newline at end of file +var _0xebc4=['put','smsinteraction:update','delete','smsinteraction:destroy','/:id/tags','removeTags','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','index','/describe','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','post','create','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x74745d,_0x177606){var _0x174ab3=function(_0x1c94e9){while(--_0x1c94e9){_0x74745d['push'](_0x74745d['shift']());}};_0x174ab3(++_0x177606);}(_0xebc4,0xf9));var _0x4ebc=function(_0x7c3d8e,_0xe8589e){_0x7c3d8e=_0x7c3d8e-0x0;var _0xb20a7f=_0xebc4[_0x7c3d8e];return _0xb20a7f;};'use strict';var multer=require('multer');var util=require(_0x4ebc('0x0'));var path=require(_0x4ebc('0x1'));var timeout=require(_0x4ebc('0x2'));var express=require(_0x4ebc('0x3'));var router=express['Router']();var auth=require(_0x4ebc('0x4'));var interaction=require(_0x4ebc('0x5'));var config=require('../../config/environment');var controller=require('./smsInteraction.controller');router[_0x4ebc('0x6')]('/',auth['isAuthenticated'](),controller[_0x4ebc('0x7')]);router['get'](_0x4ebc('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x4ebc('0x9'),auth[_0x4ebc('0xa')](),controller[_0x4ebc('0xb')]);router[_0x4ebc('0x6')](_0x4ebc('0xc'),auth[_0x4ebc('0xa')](),controller[_0x4ebc('0xd')]);router[_0x4ebc('0x6')](_0x4ebc('0xe'),auth[_0x4ebc('0xa')](),controller['download']);router[_0x4ebc('0xf')]('/',auth['isAuthenticated'](),controller[_0x4ebc('0x10')]);router[_0x4ebc('0xf')](_0x4ebc('0xc'),auth[_0x4ebc('0xa')](),controller['addMessage']);router[_0x4ebc('0xf')]('/:id/tags',auth[_0x4ebc('0xa')](),interaction[_0x4ebc('0x11')](_0x4ebc('0x12'),_0x4ebc('0x13')),controller[_0x4ebc('0x14')]);router[_0x4ebc('0x15')]('/:id',auth[_0x4ebc('0xa')](),interaction[_0x4ebc('0x11')](_0x4ebc('0x12'),_0x4ebc('0x16')),controller['update']);router[_0x4ebc('0x17')](_0x4ebc('0x9'),auth['isAuthenticated'](),interaction['tracked'](_0x4ebc('0x12'),_0x4ebc('0x18')),controller['destroy']);router[_0x4ebc('0x17')](_0x4ebc('0x19'),auth[_0x4ebc('0xa')](),controller[_0x4ebc('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 4330cd7..bdbbc58 100644 --- a/server/api/smsInteraction/smsInteraction.attributes.js +++ b/server/api/smsInteraction/smsInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['moment','exports','STRING','DATE','ENUM','out'];(function(_0x265e81,_0x514eff){var _0x55b6b7=function(_0x2e3207){while(--_0x2e3207){_0x265e81['push'](_0x265e81['shift']());}};_0x55b6b7(++_0x514eff);}(_0x757a,0xde));var _0xa757=function(_0x736ac,_0x229203){_0x736ac=_0x736ac-0x0;var _0x1d87ce=_0x757a[_0x736ac];return _0x1d87ce;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa757('0x0'));module[_0xa757('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa757('0x2')]},'phone':{'type':Sequelize[_0xa757('0x2')]},'read1stAt':{'type':Sequelize[_0xa757('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa757('0x4')]('in',_0xa757('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa757('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa757('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb10b=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x2f7c95,_0x1e9f24){var _0x3aeb2f=function(_0x4a8a36){while(--_0x4a8a36){_0x2f7c95['push'](_0x2f7c95['shift']());}};_0x3aeb2f(++_0x1e9f24);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b6420,_0x126201){_0x4b6420=_0x4b6420-0x0;var _0x37076f=_0xb10b[_0x4b6420];return _0x37076f;};'use strict';var Sequelize=require(_0xbb10('0x0'));var moment=require('moment');module[_0xbb10('0x1')]={'closed':{'type':Sequelize[_0xbb10('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbb10('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbb10('0x4')]},'phone':{'type':Sequelize[_0xbb10('0x4')]},'read1stAt':{'type':Sequelize[_0xbb10('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbb10('0x5')]('in',_0xbb10('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbb10('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbb10('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 1e8e321..49bcc93 100644 --- a/server/api/smsInteraction/smsInteraction.controller.js +++ b/server/api/smsInteraction/smsInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb49=['clone','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','sms_interaction_has_tags','t.id\x20=\x20it.TagId','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','sequelize','keyBy','merge','COUNT(me.id)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.lastName','c.phone','Contact.mobile','c.fax','Contact.fax','it.SmsInteractionId\x20=\x20i.id','all','rows','show','params','rawAttributes','includeAll','include','options','find','create','body','describe','addMessage','SmsMessage','ids','hasOwnProperty','SmsInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','omit','spread','emit','removeTags','download','unix','join','root','server','tmp','attachments','transcript-%d-%s.zip','secret','User','CmContact','Contact','firstName','SmsAccount','Owner','fullname','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','mkdirSync','Account','closed','closedAt','disposition','direction','System','lastName','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','map','TagIds','Tags','split','forEach','push','catch','SmsInteraction','model','keys','query','intersection','attributes','fields','nolimit','limit','sort','where','filters','pick','select','field','name','color','from','tools_tags','COUNT(*)','sms_messages','me.SmsInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','createdAt','value','dateStart','startOf','day','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','c.email','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','TagId','unreadMessages','length','\x20IN\x20?','filter','isNil','isEmpty','SmsAccountId','concat','$gte','$lte','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','toString','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','i.id','Sequelize','QueryTypes','SELECT'];(function(_0x3f511f,_0xcca84f){var _0x1047a6=function(_0x2aeac9){while(--_0x2aeac9){_0x3f511f['push'](_0x3f511f['shift']());}};_0x1047a6(++_0xcca84f);}(_0xfb49,0x140));var _0x9fb4=function(_0x36fe46,_0x40010c){_0x36fe46=_0x36fe46-0x0;var _0x4d2e9c=_0xfb49[_0x36fe46];return _0x4d2e9c;};'use strict';var pdf=require(_0x9fb4('0x0'));var emlformat=require(_0x9fb4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9fb4('0x2'));var jsonpatch=require(_0x9fb4('0x3'));var rp=require('request-promise');var moment=require(_0x9fb4('0x4'));var BPromise=require(_0x9fb4('0x5'));var Mustache=require(_0x9fb4('0x6'));var util=require('util');var path=require(_0x9fb4('0x7'));var sox=require('sox');var csv=require(_0x9fb4('0x8'));var ejs=require(_0x9fb4('0x9'));var fs=require('fs');var _=require(_0x9fb4('0xa'));var squel=require(_0x9fb4('0xb'));var crypto=require(_0x9fb4('0xc'));var jsforce=require(_0x9fb4('0xd'));var deskjs=require(_0x9fb4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9fb4('0xf'));var Papa=require(_0x9fb4('0x10'));var Redis=require(_0x9fb4('0x11'));var authService=require(_0x9fb4('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9fb4('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9fb4('0x14'));var db=require(_0x9fb4('0x15'))['db'];config[_0x9fb4('0x16')]=_[_0x9fb4('0x17')](config[_0x9fb4('0x16')],{'host':_0x9fb4('0x18'),'port':0x18eb});var socket=require(_0x9fb4('0x19'))(new Redis(config[_0x9fb4('0x16')]));require(_0x9fb4('0x1a'))[_0x9fb4('0x1b')](socket);function respondWithStatusCode(_0x5b76c5,_0x496dd2){_0x496dd2=_0x496dd2||0xcc;return function(_0xfe6c03){if(_0xfe6c03){return _0x5b76c5[_0x9fb4('0x1c')](_0x496dd2);}return _0x5b76c5[_0x9fb4('0x1d')](_0x496dd2)['end']();};}function respondWithResult(_0x338078,_0x44ebfb){_0x44ebfb=_0x44ebfb||0xc8;return function(_0x56cf2f){if(_0x56cf2f){return _0x338078[_0x9fb4('0x1d')](_0x44ebfb)[_0x9fb4('0x1e')](_0x56cf2f);}};}function respondWithFilteredResult(_0x574e0a,_0x38c46a){return function(_0x120b5f){if(_0x120b5f){var _0x4da483=_0x120b5f[_0x9fb4('0x1f')],_0x37cef1=_0x38c46a[_0x9fb4('0x20')],_0x288ad4=_0x38c46a[_0x9fb4('0x20')]+_0x38c46a['limit'],_0x581b99;if(_0x288ad4>=_0x4da483){_0x288ad4=_0x4da483;_0x581b99=0xc8;}else{_0x581b99=0xce;}_0x574e0a[_0x9fb4('0x1d')](_0x581b99);return _0x574e0a[_0x9fb4('0x21')](_0x9fb4('0x22'),_0x37cef1+'-'+_0x288ad4+'/'+_0x4da483)[_0x9fb4('0x1e')](_0x120b5f);}return null;};}function patchUpdates(_0x2abe87){return function(_0x5615de){try{jsonpatch[_0x9fb4('0x23')](_0x5615de,_0x2abe87,!![]);}catch(_0x464bec){return BPromise[_0x9fb4('0x24')](_0x464bec);}return _0x5615de[_0x9fb4('0x25')]();};}function saveUpdates(_0x5bee46,_0x3463dd){return function(_0x2d94b3){if(_0x2d94b3){return _0x2d94b3[_0x9fb4('0x26')](_0x5bee46)[_0x9fb4('0x27')](function(_0xf16708){return _0xf16708;});}return null;};}function removeEntity(_0xd92592,_0x4ac6cc){return function(_0x43b72f){if(_0x43b72f){return _0x43b72f[_0x9fb4('0x28')]()[_0x9fb4('0x27')](function(){_0xd92592[_0x9fb4('0x1d')](0xcc)[_0x9fb4('0x29')]();});}};}function handleEntityNotFound(_0x592aff,_0x5a3e61){return function(_0x49a801){if(!_0x49a801){_0x592aff['sendStatus'](0x194);}return _0x49a801;};}function handleError(_0x560c42,_0x4cac12){_0x4cac12=_0x4cac12||0x1f4;return function(_0x5789a8){logger[_0x9fb4('0x2a')](_0x5789a8[_0x9fb4('0x2b')]);if(_0x5789a8['name']){delete _0x5789a8['name'];}_0x560c42[_0x9fb4('0x1d')](_0x4cac12)['send'](_0x5789a8);};}function getInteractionUsers(_0x50faae,_0x3abe2e){return new BPromise(function(_0x1403b5,_0xb4cf4d){try{if(_0x3abe2e[_0x50faae['id']]){_0x50faae['Users']=_[_0x9fb4('0x2c')](_0x3abe2e[_0x50faae['id']],function(_0x516398){return{'id':_0x516398['id']};});}}catch(_0x4157a3){_0xb4cf4d(_0x4157a3);}_0x1403b5(_0x50faae);});}function getInteractionTags(_0x175349,_0x41e5e5){return new BPromise(function(_0xd02e39,_0x2e8915){try{if(_0x175349[_0x9fb4('0x2d')]){_0x175349[_0x9fb4('0x2e')]=[];_0x175349['TagIds'][_0x9fb4('0x2f')](',')[_0x9fb4('0x30')](function(_0x1c14dc){_0x175349[_0x9fb4('0x2e')][_0x9fb4('0x31')](_0x41e5e5[_0x1c14dc]);});}delete _0x175349[_0x9fb4('0x2d')];}catch(_0x2954e7){_0x2e8915(_0x2954e7);}_0xd02e39(_0x175349);});}function updateSmsInteraction(_0xa5e2a0,_0x34d5b5,_0x4daa9e){return new BPromise(function(_0x199d24,_0x5c2a12){return getInteractionUsers(_0xa5e2a0,_0x4daa9e)['then'](function(_0x1bacc5){return getInteractionTags(_0x1bacc5,_0x34d5b5);})['then'](function(_0x152119){_0x199d24(_0x152119);})[_0x9fb4('0x32')](function(_0x408519){_0x5c2a12(_0x408519);});});}exports['index']=function(_0x4ff352,_0x3c8f47){var _0x4a220e={},_0x50fbed={},_0x4cbcf9={'count':0x0,'rows':[]};var _0x190af4=db[_0x9fb4('0x33')]['rawAttributes'];_0x50fbed[_0x9fb4('0x34')]=_[_0x9fb4('0x35')](_0x190af4);_0x50fbed[_0x9fb4('0x36')]=_[_0x9fb4('0x35')](_0x4ff352['query']);_0x50fbed['filters']=_[_0x9fb4('0x37')](_0x50fbed[_0x9fb4('0x34')],_0x50fbed[_0x9fb4('0x36')]);_0x4a220e[_0x9fb4('0x38')]=_[_0x9fb4('0x37')](_0x50fbed['model'],qs[_0x9fb4('0x39')](_0x4ff352[_0x9fb4('0x36')][_0x9fb4('0x39')]));_0x4a220e['attributes']=_0x4a220e[_0x9fb4('0x38')]['length']?_0x4a220e[_0x9fb4('0x38')]:_0x50fbed['model'];if(!_0x4ff352[_0x9fb4('0x36')]['hasOwnProperty'](_0x9fb4('0x3a'))){_0x4a220e[_0x9fb4('0x3b')]=qs[_0x9fb4('0x3b')](_0x4ff352[_0x9fb4('0x36')][_0x9fb4('0x3b')]);_0x4a220e[_0x9fb4('0x20')]=qs[_0x9fb4('0x20')](_0x4ff352[_0x9fb4('0x36')][_0x9fb4('0x20')]);}_0x4a220e['order']=qs[_0x9fb4('0x3c')](_0x4ff352[_0x9fb4('0x36')][_0x9fb4('0x3c')]);_0x4a220e[_0x9fb4('0x3d')]=qs[_0x9fb4('0x3e')](_[_0x9fb4('0x3f')](_0x4ff352[_0x9fb4('0x36')],_0x50fbed[_0x9fb4('0x3e')]));var _0x3ea94c=[];var _0x210a0f=squel[_0x9fb4('0x40')]()[_0x9fb4('0x41')]('id')[_0x9fb4('0x41')](_0x9fb4('0x42'))['field'](_0x9fb4('0x43'))[_0x9fb4('0x44')](_0x9fb4('0x45'));var _0x424b44=squel[_0x9fb4('0x40')]()[_0x9fb4('0x41')](_0x9fb4('0x46'))[_0x9fb4('0x44')](_0x9fb4('0x47'),'me')['where'](_0x9fb4('0x48'))[_0x9fb4('0x3d')](_0x9fb4('0x49'))[_0x9fb4('0x3d')](_0x9fb4('0x4a'));var _0x13b50b=squel[_0x9fb4('0x40')]()[_0x9fb4('0x41')](_0x9fb4('0x4b'))[_0x9fb4('0x41')](_0x9fb4('0x4c'))['from'](_0x9fb4('0x4d'),'ui')['left_join'](_0x9fb4('0x4e'),'u',_0x9fb4('0x4f'));var _0xa07ce7=squel[_0x9fb4('0x40')]()[_0x9fb4('0x44')](_0x9fb4('0x50'),'i')[_0x9fb4('0x51')](_0x9fb4('0x52'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x9fb4('0x51')](_0x9fb4('0x4e'),'o','o.id\x20=\x20i.UserId')[_0x9fb4('0x51')](_0x9fb4('0x53'),'a',_0x9fb4('0x54'))['left_join'](_0x9fb4('0x47'),'me',_0x9fb4('0x55'));var _0x4e0702=squel[_0x9fb4('0x56')]();if(_0x4ff352[_0x9fb4('0x36')][_0x9fb4('0x57')]){var _0x38c482=JSON[_0x9fb4('0x58')](_0x4ff352[_0x9fb4('0x36')][_0x9fb4('0x57')]);_[_0x9fb4('0x35')](_0x38c482)[_0x9fb4('0x30')](function(_0x59c534){var _0x94e7bb=_0x38c482[_0x59c534];if(_0x59c534===_0x9fb4('0x59')){var _0xd7f5bf=moment(_0x94e7bb[_0x9fb4('0x5a')][_0x9fb4('0x5b')])[_0x9fb4('0x5c')](_0x9fb4('0x5d'))[_0x9fb4('0x5e')]()[_0x9fb4('0x5f')]();var _0x561c8f=moment(_0x561c8f)['utc']()['endOf'](_0x9fb4('0x5d'))[_0x9fb4('0x5f')]();_0x4e0702[_0x9fb4('0x60')](_0x9fb4('0x61'),_0xd7f5bf,_0x561c8f);}else{if(_[_0x9fb4('0x62')](_0x94e7bb[_0x9fb4('0x63')])){_0x94e7bb[_0x9fb4('0x63')][_0x9fb4('0x30')](function(_0x20c108){switch(_0x94e7bb[_0x9fb4('0x63')][_0x9fb4('0x5a')]){case'IS':if(_0x59c534!=='TagId'&&_0x59c534!=='unreadMessages'){if(_['isArray'](_0x94e7bb[_0x9fb4('0x5a')])&&_0x94e7bb['value']['length']>0x1){_0x4e0702[_0x9fb4('0x60')](_0x94e7bb[_0x9fb4('0x64')]+'.'+_0x59c534+'\x20IN\x20?',_0x94e7bb[_0x9fb4('0x5a')]);}else{_0x4e0702[_0x9fb4('0x60')](_0x94e7bb[_0x9fb4('0x64')]+'.'+_0x59c534+_0x9fb4('0x65'),_0x94e7bb[_0x9fb4('0x5a')][0x0]);}}break;case'=':_0x4e0702[_0x9fb4('0x60')](_0x94e7bb[_0x9fb4('0x64')]+'.'+_0x59c534+_0x9fb4('0x65'),_0x94e7bb[_0x9fb4('0x5a')]);break;case _0x9fb4('0x66'):if(_0x59c534===_0x9fb4('0x67')){_0x4e0702[_0x9fb4('0x60')](_0x9fb4('0x68')+'\x20LIKE\x20?','%'+_0x94e7bb['value']+'%');_0x4e0702['or'](_0x9fb4('0x69')+'\x20LIKE\x20?','%'+_0x94e7bb['value']+'%');_0x4e0702['or'](_0x9fb4('0x6a')+_0x9fb4('0x6b'),'%'+_0x94e7bb[_0x9fb4('0x5a')]+'%');}else{_0x4e0702[_0x9fb4('0x60')](_0x94e7bb[_0x9fb4('0x64')]+'.'+_0x59c534+_0x9fb4('0x6b'),'%'+_0x94e7bb['value']+'%');}break;case'>':_0x4e0702['and'](_0x94e7bb[_0x9fb4('0x64')]+'.'+_0x59c534+_0x9fb4('0x6c'),_0x94e7bb['value']);break;case'<':_0x4e0702[_0x9fb4('0x60')](_0x94e7bb['tableAlias']+'.'+_0x59c534+_0x9fb4('0x6d'),_0x94e7bb[_0x9fb4('0x5a')]);break;}});}else{switch(_0x94e7bb[_0x9fb4('0x63')]['value']){case'IS':if(_0x59c534!==_0x9fb4('0x6e')&&_0x59c534!==_0x9fb4('0x6f')){if(_[_0x9fb4('0x62')](_0x94e7bb[_0x9fb4('0x5a')])&&_0x94e7bb[_0x9fb4('0x5a')][_0x9fb4('0x70')]>0x1){_0x4e0702[_0x9fb4('0x60')](_0x94e7bb['tableAlias']+'.'+_0x59c534+_0x9fb4('0x71'),_0x94e7bb['value']);}else{_0x4e0702[_0x9fb4('0x60')](_0x94e7bb['tableAlias']+'.'+_0x59c534+_0x9fb4('0x65'),_0x94e7bb[_0x9fb4('0x5a')][0x0]);}}break;case'=':_0x4e0702[_0x9fb4('0x60')](_0x94e7bb[_0x9fb4('0x64')]+'.'+_0x59c534+_0x9fb4('0x65'),_0x94e7bb['value']);break;case _0x9fb4('0x66'):if(_0x59c534==='ContactId'){_0x4e0702[_0x9fb4('0x60')]('c.firstName'+'\x20LIKE\x20?','%'+_0x94e7bb[_0x9fb4('0x5a')]+'%');_0x4e0702['or'](_0x9fb4('0x69')+_0x9fb4('0x6b'),'%'+_0x94e7bb[_0x9fb4('0x5a')]+'%');_0x4e0702['or']('c.email'+'\x20LIKE\x20?','%'+_0x94e7bb[_0x9fb4('0x5a')]+'%');}else{_0x4e0702[_0x9fb4('0x60')](_0x94e7bb[_0x9fb4('0x64')]+'.'+_0x59c534+_0x9fb4('0x6b'),'%'+_0x94e7bb[_0x9fb4('0x5a')]+'%');}break;case'>':_0x4e0702[_0x9fb4('0x60')](_0x94e7bb['tableAlias']+'.'+_0x59c534+_0x9fb4('0x6c'),_0x94e7bb[_0x9fb4('0x5a')]);break;case'<':_0x4e0702[_0x9fb4('0x60')](_0x94e7bb[_0x9fb4('0x64')]+'.'+_0x59c534+_0x9fb4('0x6d'),_0x94e7bb[_0x9fb4('0x5a')]);break;}}}});}else{var _0x16540a=_(Object[_0x9fb4('0x35')](_0x4ff352['query']))[_0x9fb4('0x2c')](function(_0x173156){return _0x190af4['hasOwnProperty'](_0x173156)?_0x173156:undefined;})[_0x9fb4('0x72')](function(_0x47b651){return!_[_0x9fb4('0x73')](_0x47b651);})[_0x9fb4('0x5a')]();if(!_[_0x9fb4('0x74')](_0x16540a)){_0x16540a[_0x9fb4('0x30')](function(_0x41a6ad){if(_0x41a6ad===_0x9fb4('0x75')){_0xa07ce7[_0x9fb4('0x3d')]('i.SmsAccountId\x20IN\x20?',[][_0x9fb4('0x76')](_0x4ff352[_0x9fb4('0x36')][_0x41a6ad]));}else if(_0x41a6ad===_0x9fb4('0x59')){var _0x4e0a88=JSON[_0x9fb4('0x58')](_0x4ff352[_0x9fb4('0x36')][_0x41a6ad])[_0x9fb4('0x77')];var _0x56c100=JSON[_0x9fb4('0x58')](_0x4ff352[_0x9fb4('0x36')][_0x41a6ad])[_0x9fb4('0x78')];_0xa07ce7[_0x9fb4('0x3d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4e0a88,_0x56c100);}else{if(_0x4ff352[_0x9fb4('0x36')][_0x41a6ad]===_0x9fb4('0x79')){_0xa07ce7[_0x9fb4('0x3d')]('i.'+_0x41a6ad+_0x9fb4('0x7a'));}else{_0xa07ce7['where']('i.'+_0x41a6ad+_0x9fb4('0x65'),_0x4ff352[_0x9fb4('0x36')][_0x41a6ad]);}}});}if(_0x4ff352[_0x9fb4('0x36')]['filter']){var _0x45c871=_0x4ff352['query'][_0x9fb4('0x72')][_0x9fb4('0x7b')]('\x5c','\x5c\x5c')[_0x9fb4('0x7b')]('\x27\x27',_0x9fb4('0x7c'));if(qs[_0x9fb4('0x7d')](_0x45c871)){_0x4e0702['or'](_0x9fb4('0x7e'),_0x45c871+'%')['or']('i.phone\x20LIKE\x20?',_0x45c871+'%');}else{var _0x396f3e=[];_0x45c871[_0x9fb4('0x2f')]('\x20')['forEach'](function(_0x90acf9){_0x396f3e['push']('+'+_0x90acf9[_0x9fb4('0x7f')]());});var _0x20a708=_0x396f3e['join']('\x20');_0x4e0702['or'](_0x9fb4('0x80'),_0x20a708)['or'](_0x9fb4('0x81'),_0x45c871+'%');}}}_0xa07ce7[_0x9fb4('0x3d')](_0x4e0702);if(_0x4a220e[_0x9fb4('0x82')]){_0x4a220e[_0x9fb4('0x82')][_0x9fb4('0x30')](function(_0x577293){_0xa07ce7['order']('i.'+_0x577293[0x0],_0x577293[0x1]===_0x9fb4('0x83')?![]:!![]);});}_0xa07ce7['group'](_0x9fb4('0x84'));var _0x29a147={'type':db[_0x9fb4('0x85')][_0x9fb4('0x86')][_0x9fb4('0x87')],'raw':!![]};var _0xca431b=_0xa07ce7[_0x9fb4('0x88')]()['field'](_0x9fb4('0x46'))[_0x9fb4('0x41')]('COUNT(me.id)',_0x9fb4('0x6f'));if(!_0x4ff352[_0x9fb4('0x36')]['advancedFilter']){if(_0x4ff352[_0x9fb4('0x36')][_0x9fb4('0x89')]){if(_0x4ff352[_0x9fb4('0x36')]['read']==0x1){_0xca431b[_0x9fb4('0x8a')](_0x9fb4('0x8b'));_0xa07ce7['having'](_0x9fb4('0x8b'));}else{_0xca431b[_0x9fb4('0x8a')](_0x9fb4('0x8c'));_0xa07ce7['having'](_0x9fb4('0x8c'));}}if(_0x4ff352[_0x9fb4('0x36')]['tag']){var _0x4d0b3c=_[_0x9fb4('0x62')](_0x4ff352[_0x9fb4('0x36')][_0x9fb4('0x8d')])?_0x4ff352['query'][_0x9fb4('0x8d')]:new Array(_0x4ff352[_0x9fb4('0x36')]['tag']);var _0x42b34c=squel['expr']();_0x4d0b3c[_0x9fb4('0x30')](function(_0x1db60c){_0x42b34c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1db60c+',%');});_0xa07ce7['having'](_0x42b34c);_0xca431b[_0x9fb4('0x51')](_0x9fb4('0x8e'),'it','it.SmsInteractionId\x20=\x20i.id');_0xca431b[_0x9fb4('0x51')](_0x9fb4('0x45'),'t',_0x9fb4('0x8f'));_0xca431b[_0x9fb4('0x3d')]('t.id\x20IN\x20?',_0x4d0b3c);}}else{var _0x38c482=JSON['parse'](_0x4ff352[_0x9fb4('0x36')][_0x9fb4('0x57')]);_[_0x9fb4('0x35')](_0x38c482)['forEach'](function(_0x171f9a){var _0x5545cd=_0x38c482[_0x171f9a];if(_0x171f9a===_0x9fb4('0x6e')){var _0x5a8f0b=_0x5545cd[_0x9fb4('0x5a')];var _0x253253=squel['expr']();_0x5a8f0b['forEach'](function(_0x28bc5a){_0x253253['or'](_0x9fb4('0x90'),'%,'+_0x28bc5a+',%');});_0xa07ce7[_0x9fb4('0x8a')](_0x253253);_0xca431b[_0x9fb4('0x51')](_0x9fb4('0x91'),'it',_0x9fb4('0x92'));_0xca431b['left_join'](_0x9fb4('0x45'),'t',_0x9fb4('0x8f'));_0xca431b[_0x9fb4('0x3d')](_0x9fb4('0x93'),_0x5a8f0b);}else if(_0x171f9a==='unreadMessages'){if(_0x5545cd[_0x9fb4('0x5a')][_0x9fb4('0x70')]===0x1){if(_0x5545cd[_0x9fb4('0x5a')][0x0]===0x1){_0xca431b[_0x9fb4('0x8a')](_0x9fb4('0x8b'));_0xa07ce7[_0x9fb4('0x8a')](_0x9fb4('0x8b'));}else{_0xca431b['having'](_0x9fb4('0x8c'));_0xa07ce7[_0x9fb4('0x8a')]('`unreadMessages`\x20>\x200');}}}});}db[_0x9fb4('0x94')][_0x9fb4('0x36')](_0xca431b[_0x9fb4('0x7f')](),_0x29a147)['then'](function(_0x4fcb8f){_0x4cbcf9[_0x9fb4('0x1f')]=_0x4fcb8f[_0x9fb4('0x70')];if(_0x4cbcf9['count']===0x0)return[];return db[_0x9fb4('0x94')][_0x9fb4('0x36')](_0x210a0f[_0x9fb4('0x7f')](),_0x29a147)[_0x9fb4('0x27')](function(_0x2ebcbf){_0x3ea94c=_[_0x9fb4('0x95')](_0x2ebcbf,'id');_0x29a147=_[_0x9fb4('0x96')](_0x29a147,{'model':db[_0x9fb4('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xa07ce7['field'](_0x9fb4('0x97'),_0x9fb4('0x6f'));_0xa07ce7['field'](_0x9fb4('0x98'),_0x9fb4('0x99'));_0xa07ce7['field'](_0x9fb4('0x9a'),_0x9fb4('0x9b'));_0xa07ce7['field'](_0x9fb4('0x9c'));_0xa07ce7[_0x9fb4('0x41')]('c.firstName','Contact.firstName');_0xa07ce7[_0x9fb4('0x41')](_0x9fb4('0x69'),_0x9fb4('0x9d'));_0xa07ce7[_0x9fb4('0x41')]('c.email','Contact.email');_0xa07ce7[_0x9fb4('0x41')](_0x9fb4('0x9e'),'Contact.phone');_0xa07ce7['field']('c.mobile',_0x9fb4('0x9f'));_0xa07ce7[_0x9fb4('0x41')](_0x9fb4('0xa0'),_0x9fb4('0xa1'));_0xa07ce7['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9fb4('0x2d'));_0xa07ce7[_0x9fb4('0x51')](_0x9fb4('0x8e'),'it',_0x9fb4('0xa2'));_0xa07ce7['left_join'](_0x9fb4('0x45'),'t',_0x9fb4('0x8f'));_0xa07ce7['limit'](_0x4a220e[_0x9fb4('0x3b')]);_0xa07ce7[_0x9fb4('0x20')](_0x4a220e[_0x9fb4('0x20')]);return db['sequelize']['query'](_0xa07ce7['toString'](),_0x29a147);})['then'](function(_0x5b5934){_0x13b50b[_0x9fb4('0x3d')]('ui.SmsInteractionId\x20IN\x20?',_[_0x9fb4('0x2c')](_0x5b5934,'id'));return db[_0x9fb4('0x94')][_0x9fb4('0x36')](_0x13b50b['toString'](),_0x29a147)['then'](function(_0x50df25){var _0x16719b=_['groupBy'](_0x50df25,'SmsInteractionId');var _0x383aa3=[];_0x5b5934[_0x9fb4('0x30')](function(_0x449ec1){_0x383aa3[_0x9fb4('0x31')](updateSmsInteraction(_0x449ec1,_0x3ea94c,_0x16719b));});return BPromise[_0x9fb4('0xa3')](_0x383aa3);});});})[_0x9fb4('0x27')](function(_0x4ede16){_0x4cbcf9[_0x9fb4('0xa4')]=_0x4ede16;return _0x4cbcf9;})[_0x9fb4('0x27')](respondWithFilteredResult(_0x3c8f47,_0x4a220e))[_0x9fb4('0x32')](handleError(_0x3c8f47,null));};exports[_0x9fb4('0xa5')]=function(_0x13181f,_0x3cdb64){var _0x340e5f={'raw':![],'where':{'id':_0x13181f[_0x9fb4('0xa6')]['id']}},_0x1153b8={};_0x1153b8[_0x9fb4('0x34')]=_[_0x9fb4('0x35')](db['SmsInteraction'][_0x9fb4('0xa7')]);_0x1153b8[_0x9fb4('0x36')]=_[_0x9fb4('0x35')](_0x13181f[_0x9fb4('0x36')]);_0x1153b8[_0x9fb4('0x3e')]=_[_0x9fb4('0x37')](_0x1153b8[_0x9fb4('0x34')],_0x1153b8['query']);_0x340e5f['attributes']=_[_0x9fb4('0x37')](_0x1153b8[_0x9fb4('0x34')],qs['fields'](_0x13181f['query']['fields']));_0x340e5f[_0x9fb4('0x38')]=_0x340e5f[_0x9fb4('0x38')][_0x9fb4('0x70')]?_0x340e5f[_0x9fb4('0x38')]:_0x1153b8[_0x9fb4('0x34')];if(_0x13181f[_0x9fb4('0x36')][_0x9fb4('0xa8')]){_0x340e5f[_0x9fb4('0xa9')]=[{'all':!![]}];}_0x340e5f=_[_0x9fb4('0x96')]({},_0x340e5f,_0x13181f[_0x9fb4('0xaa')]);return db[_0x9fb4('0x33')][_0x9fb4('0xab')](_0x340e5f)[_0x9fb4('0x27')](handleEntityNotFound(_0x3cdb64,null))[_0x9fb4('0x27')](respondWithResult(_0x3cdb64,null))[_0x9fb4('0x32')](handleError(_0x3cdb64,null));};exports[_0x9fb4('0xac')]=function(_0x235100,_0x222192){return db['SmsInteraction'][_0x9fb4('0xac')](_0x235100['body'],{})['then'](respondWithResult(_0x222192,0xc9))[_0x9fb4('0x32')](handleError(_0x222192,null));};exports[_0x9fb4('0x26')]=function(_0x5c33c8,_0x5dac6e){if(_0x5c33c8[_0x9fb4('0xad')]['id']){delete _0x5c33c8[_0x9fb4('0xad')]['id'];}return db['SmsInteraction'][_0x9fb4('0xab')]({'where':{'id':_0x5c33c8['params']['id']}})[_0x9fb4('0x27')](handleEntityNotFound(_0x5dac6e,null))[_0x9fb4('0x27')](saveUpdates(_0x5c33c8[_0x9fb4('0xad')],null))[_0x9fb4('0x27')](respondWithResult(_0x5dac6e,null))[_0x9fb4('0x32')](handleError(_0x5dac6e,null));};exports[_0x9fb4('0x28')]=function(_0x183490,_0x13cbd1){return db[_0x9fb4('0x33')][_0x9fb4('0xab')]({'where':{'id':_0x183490[_0x9fb4('0xa6')]['id']}})['then'](handleEntityNotFound(_0x13cbd1,null))[_0x9fb4('0x27')](removeEntity(_0x13cbd1,null))[_0x9fb4('0x32')](handleError(_0x13cbd1,null));};exports[_0x9fb4('0xae')]=function(_0x51b70b,_0x32b1ca){return db[_0x9fb4('0x33')]['describe']()['then'](respondWithResult(_0x32b1ca,null))['catch'](handleError(_0x32b1ca,null));};exports[_0x9fb4('0xaf')]=function(_0xb9dcdd,_0x454239,_0x271c4a){return db[_0x9fb4('0xb0')]['find']({'where':{'id':_0xb9dcdd[_0x9fb4('0xa6')]['id']}})[_0x9fb4('0x27')](handleEntityNotFound(_0x454239,null))[_0x9fb4('0x27')](function(_0x3f2a11){if(_0x3f2a11){return _0x3f2a11[_0x9fb4('0xaf')](_0xb9dcdd[_0x9fb4('0xad')][_0x9fb4('0xb1')],_['omit'](_0xb9dcdd[_0x9fb4('0xad')],[_0x9fb4('0xb1'),'id'])||{});}})[_0x9fb4('0x27')](respondWithResult(_0x454239,null))[_0x9fb4('0x32')](handleError(_0x454239,null));};exports['getMessages']=function(_0x4582a0,_0x3b4302,_0x4f07bd){var _0x20ba43={'raw':![],'where':{}};var _0x1da1db={};var _0x3831b5={'count':0x0,'rows':[]};return db[_0x9fb4('0x33')]['findOne']({'where':{'id':_0x4582a0[_0x9fb4('0xa6')]['id']}})[_0x9fb4('0x27')](handleEntityNotFound(_0x3b4302,null))['then'](function(_0x379969){if(_0x379969){_0x1da1db['model']=_[_0x9fb4('0x35')](db[_0x9fb4('0xb0')][_0x9fb4('0xa7')]);_0x1da1db[_0x9fb4('0x36')]=_['keys'](_0x4582a0['query']);_0x1da1db['filters']=_['intersection'](_0x1da1db[_0x9fb4('0x34')],_0x1da1db[_0x9fb4('0x36')]);_0x20ba43[_0x9fb4('0x38')]=_['intersection'](_0x1da1db[_0x9fb4('0x34')],qs['fields'](_0x4582a0[_0x9fb4('0x36')][_0x9fb4('0x39')]));_0x20ba43['attributes']=_0x20ba43[_0x9fb4('0x38')][_0x9fb4('0x70')]?_0x20ba43[_0x9fb4('0x38')]:_0x1da1db[_0x9fb4('0x34')];if(!_0x4582a0[_0x9fb4('0x36')][_0x9fb4('0xb2')](_0x9fb4('0x3a'))){_0x20ba43[_0x9fb4('0x3b')]=qs['limit'](_0x4582a0[_0x9fb4('0x36')]['limit']);_0x20ba43[_0x9fb4('0x20')]=qs[_0x9fb4('0x20')](_0x4582a0[_0x9fb4('0x36')][_0x9fb4('0x20')]);}_0x20ba43[_0x9fb4('0x82')]=qs[_0x9fb4('0x3c')](_0x4582a0[_0x9fb4('0x36')][_0x9fb4('0x3c')]);_0x20ba43['where']=qs['filters'](_[_0x9fb4('0x3f')](_0x4582a0[_0x9fb4('0x36')],_0x1da1db['filters']));_0x20ba43[_0x9fb4('0x3d')][_0x9fb4('0xb3')]=_0x379969['id'];if(_0x4582a0['query'][_0x9fb4('0x72')]){_0x20ba43['where']=_[_0x9fb4('0x96')](_0x20ba43['where'],{'$or':_[_0x9fb4('0x2c')](_0x20ba43['attributes'],function(_0x5e4fcc){var _0x4baa22={};_0x4baa22[_0x5e4fcc]={'$like':'%'+_0x4582a0[_0x9fb4('0x36')][_0x9fb4('0x72')]+'%'};return _0x4baa22;})});}if(_0x4582a0[_0x9fb4('0x36')][_0x9fb4('0x77')]){var _0x34f377=_0x4582a0[_0x9fb4('0x36')][_0x9fb4('0x77')][_0x9fb4('0x2f')](',');var _0x512f23={};_0x512f23[_0x34f377[0x0]]={'$gte':moment(_0x34f377[0x1])['format'](_0x9fb4('0xb4'))};_0x20ba43['where']=_[_0x9fb4('0x96')](_0x20ba43[_0x9fb4('0x3d')],_0x512f23);}_0x20ba43=_[_0x9fb4('0x96')]({},_0x20ba43,_0x4582a0['options']);return db[_0x9fb4('0xb0')][_0x9fb4('0x1f')]({'where':_0x20ba43[_0x9fb4('0x3d')]})[_0x9fb4('0x27')](function(_0x41cb9f){_0x3831b5['count']=_0x41cb9f;if(_0x4582a0['query']['includeAll']){_0x20ba43[_0x9fb4('0xa9')]=[{'all':!![]}];}return db['SmsMessage'][_0x9fb4('0xb5')](_0x20ba43);})[_0x9fb4('0x27')](function(_0x1888f8){_0x3831b5['rows']=_0x1888f8;return _0x3831b5;});}})[_0x9fb4('0x27')](respondWithFilteredResult(_0x3b4302,_0x20ba43))[_0x9fb4('0x32')](handleError(_0x3b4302,null));};exports[_0x9fb4('0xb6')]=function(_0xf50dee,_0x5baf32,_0x4d887f){return db['SmsInteraction'][_0x9fb4('0xab')]({'where':{'id':_0xf50dee['params']['id']}})[_0x9fb4('0x27')](handleEntityNotFound(_0x5baf32,null))['then'](function(_0x132cf4){if(_0x132cf4){return _0x132cf4['setTags'](_0xf50dee['body'][_0x9fb4('0xb1')],_[_0x9fb4('0xb7')](_0xf50dee[_0x9fb4('0xad')],['ids','id'])||{})[_0x9fb4('0xb8')](function(){return db['Tag'][_0x9fb4('0xb5')]({'attributes':['id',_0x9fb4('0x42'),'color'],'where':{'id':_0xf50dee[_0x9fb4('0xad')][_0x9fb4('0xb1')]}});})[_0x9fb4('0x27')](function(_0x185253){socket[_0x9fb4('0xb9')]('smsInteractionTags:save',{'id':Number(_0xf50dee[_0x9fb4('0xa6')]['id']),'tags':_0x185253||[]});return{'id':Number(_0xf50dee[_0x9fb4('0xa6')]['id']),'tags':_0x185253||[]};});}})['then'](respondWithResult(_0x5baf32,null))[_0x9fb4('0x32')](handleError(_0x5baf32,null));};exports['removeTags']=function(_0x37208f,_0x3c88de,_0x22f057){return db[_0x9fb4('0x33')][_0x9fb4('0xab')]({'where':{'id':_0x37208f[_0x9fb4('0xa6')]['id']}})[_0x9fb4('0x27')](handleEntityNotFound(_0x3c88de,null))[_0x9fb4('0x27')](function(_0x4de7d9){if(_0x4de7d9){return _0x4de7d9[_0x9fb4('0xba')](_0x37208f[_0x9fb4('0x36')][_0x9fb4('0xb1')]);}})[_0x9fb4('0x27')](respondWithStatusCode(_0x3c88de,null))[_0x9fb4('0x32')](handleError(_0x3c88de,null));};exports[_0x9fb4('0xbb')]=function(_0x58c978,_0x435822){var _0x493676=moment()[_0x9fb4('0xbc')]()['toString']();var _0x3c4b52=path[_0x9fb4('0xbd')](config[_0x9fb4('0xbe')],_0x9fb4('0xbf'),'files',_0x9fb4('0xc0'));var _0x5d9894=path[_0x9fb4('0xbd')](config[_0x9fb4('0xbe')],_0x9fb4('0xbf'),'files',_0x9fb4('0xc1'));var _0x439457=path[_0x9fb4('0xbd')](_0x3c4b52,_0x493676);var _0x4fb1a0=util[_0x9fb4('0x5f')](_0x9fb4('0xc2'),_0x58c978[_0x9fb4('0xa6')]['id'],_0x493676);var _0x14fe5e=path[_0x9fb4('0xbd')](_0x3c4b52,_0x4fb1a0);var _0x54aa5e=![];return db[_0x9fb4('0x33')][_0x9fb4('0xab')]({'where':{'id':_0x58c978[_0x9fb4('0xa6')]['id']},'include':[{'model':db[_0x9fb4('0xb0')],'as':'Messages','attributes':['id',_0x9fb4('0xad'),_0x9fb4('0x59'),'direction',_0x9fb4('0xc3')],'include':[{'model':db[_0x9fb4('0xc4')],'as':_0x9fb4('0xc4'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x9fb4('0xc5')],'as':_0x9fb4('0xc6'),'attributes':['id',_0x9fb4('0xc7'),'lastName'],'raw':!![]}]},{'model':db[_0x9fb4('0xc8')],'as':'Account','attributes':['id',_0x9fb4('0x42')]},{'model':db[_0x9fb4('0xc4')],'as':_0x9fb4('0xc9'),'attributes':['id',_0x9fb4('0xca')]}]})['then'](handleEntityNotFound(_0x435822,null))['then'](function(_0x49dc9a){if(_0x49dc9a){var _0x45a91a=_0x49dc9a[_0x9fb4('0xcb')]({'plain':!![]});_0x54aa5e=!![];var _0x1027bc={'format':'A4','border':_0x9fb4('0xcc'),'header':{'height':_0x9fb4('0xcd'),'contents':{'first':_0x9fb4('0xce')}},'footer':{'height':_0x9fb4('0xcf'),'contents':{'default':util[_0x9fb4('0x5f')](_0x9fb4('0xd0'),util[_0x9fb4('0x5f')](_0x9fb4('0xd1'),_0x9fb4('0xd2'),_0x45a91a['id']),moment()['format'](_0x9fb4('0xd3'))['toString']())}}};fs[_0x9fb4('0xd4')](_0x439457);var _0x48ecec={'channel':_0x9fb4('0xd2'),'account':_0x45a91a[_0x9fb4('0xd5')]['name'],'agent':_0x45a91a[_0x9fb4('0xc9')]?_0x45a91a[_0x9fb4('0xc9')]['fullname']:'N.A.','createdAt':moment(_0x45a91a[_0x9fb4('0x59')])[_0x9fb4('0x5f')](_0x9fb4('0xb4'))[_0x9fb4('0x7f')](),'closedAt':_0x45a91a[_0x9fb4('0xd6')]?moment(_0x45a91a[_0x9fb4('0xd7')])[_0x9fb4('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x45a91a[_0x9fb4('0xd8')],'messages':_(_0x45a91a['Messages'])['filter']({'secret':![]})['map'](function(_0x1b62a4){return{'date':moment(_0x1b62a4[_0x9fb4('0x59')])['format'](_0x9fb4('0xb4'))[_0x9fb4('0x7f')](),'sender':_0x1b62a4[_0x9fb4('0xd9')]==='out'?_0x1b62a4[_0x9fb4('0xc4')]?_0x1b62a4[_0x9fb4('0xc4')][_0x9fb4('0xca')]:_0x9fb4('0xda'):_0x1b62a4['Contact'][_0x9fb4('0xc7')]+(_0x1b62a4[_0x9fb4('0xc6')][_0x9fb4('0xdb')]?'\x20'+_0x1b62a4['Contact'][_0x9fb4('0xdb')]:''),'body':_0x1b62a4[_0x9fb4('0xad')],'direction':_0x1b62a4[_0x9fb4('0xd9')]===_0x9fb4('0xdc')?'A':'C','secret':_0x1b62a4['secret']};})['value']()};return ejs[_0x9fb4('0xdd')](path[_0x9fb4('0xbd')](config[_0x9fb4('0xbe')],_0x9fb4('0xbf'),_0x9fb4('0xde'),_0x9fb4('0xdf')),{'interaction':_0x48ecec})[_0x9fb4('0x27')](function(_0x37ad8d){return new BPromise(function(_0x445bb5,_0x2ceb99){pdf[_0x9fb4('0xac')](_0x37ad8d,_0x1027bc)[_0x9fb4('0xe0')](path['join'](_0x439457,_0x9fb4('0xe1')+_0x45a91a['id']+'-'+_0x493676+_0x9fb4('0xe2')),function(_0x41652b,_0x500053){if(_0x41652b)return _0x2ceb99(_0x41652b);_0x445bb5(_0x500053);});});});}})[_0x9fb4('0x27')](function(){if(_0x54aa5e){return new BPromise(function(_0x50c4e2,_0x17e6d9){zipdir(_0x439457,{'saveTo':_0x14fe5e},function(_0x8e1a1d,_0x56402b){if(_0x8e1a1d)return _0x17e6d9(_0x8e1a1d);return _0x50c4e2(_0x56402b);});})[_0x9fb4('0x27')](function(){return new BPromise(function(_0x2dc3b5,_0x31185a){rimraf(_0x439457,function(_0x1202cc){if(_0x1202cc)_0x31185a(_0x1202cc);return _0x2dc3b5();});});})[_0x9fb4('0x27')](function(){return _0x435822[_0x9fb4('0xbb')](_0x14fe5e,_0x4fb1a0,function(_0xeee979){if(_0xeee979){console[_0x9fb4('0xe3')]('err',_0xeee979);}else{fs['unlinkSync'](_0x14fe5e);}});});}else{return _0x435822['sendStatus'](0xc8);}})['catch'](handleError(_0x435822,null));}; \ No newline at end of file +var _0xe11d=['me.SmsInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.SmsInteractionId','user_has_sms_interactions','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','sms_accounts','expr','advancedFilter','parse','forEach','createdAt','dateStart','startOf','day','format','utc','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','value','unreadMessages','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','TagId','isArray','c.firstName','hasOwnProperty','filter','isNil','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','$gte','$lte','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','i.id','Sequelize','SELECT','clone','read','having','`unreadMessages`\x20=\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','`unreadMessages`\x20>\x200','toString','sequelize','merge','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','sms_interaction_has_tags','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','rows','catch','show','params','includeAll','options','find','create','body','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','color','emit','removeTags','download','unix','root','tmp','server','files','join','transcript-%d-%s.zip','direction','secret','User','fullname','Contact','firstName','SmsAccount','Account','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','YYYY-MM-DD','mkdirSync','Sms','Owner','N.A.','closed','closedAt','disposition','out','System','lastName','toFile','transcript-','.pdf','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./smsInteraction.socket','register','status','end','count','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','stack','name','Users','map','Tags','split','push','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','offset','sort','where','pick','select','field','from','COUNT(*)','sms_messages'];(function(_0x48ff8c,_0x44bf06){var _0x1e0bd6=function(_0x31e89f){while(--_0x31e89f){_0x48ff8c['push'](_0x48ff8c['shift']());}};_0x1e0bd6(++_0x44bf06);}(_0xe11d,0x186));var _0xde11=function(_0xddb776,_0x2dd15b){_0xddb776=_0xddb776-0x0;var _0x4b9a63=_0xe11d[_0xddb776];return _0x4b9a63;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xde11('0x0'));var rimraf=require(_0xde11('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde11('0x2'));var rp=require(_0xde11('0x3'));var moment=require(_0xde11('0x4'));var BPromise=require(_0xde11('0x5'));var Mustache=require(_0xde11('0x6'));var util=require('util');var path=require(_0xde11('0x7'));var sox=require(_0xde11('0x8'));var csv=require(_0xde11('0x9'));var ejs=require(_0xde11('0xa'));var fs=require('fs');var _=require(_0xde11('0xb'));var squel=require(_0xde11('0xc'));var crypto=require('crypto');var jsforce=require(_0xde11('0xd'));var deskjs=require(_0xde11('0xe'));var toCsv=require(_0xde11('0x9'));var querystring=require(_0xde11('0xf'));var Papa=require(_0xde11('0x10'));var Redis=require(_0xde11('0x11'));var authService=require(_0xde11('0x12'));var qs=require(_0xde11('0x13'));var hardwareService=require(_0xde11('0x14'));var logger=require(_0xde11('0x15'))(_0xde11('0x16'));var utils=require(_0xde11('0x17'));var config=require(_0xde11('0x18'));var db=require(_0xde11('0x19'))['db'];config[_0xde11('0x1a')]=_[_0xde11('0x1b')](config[_0xde11('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde11('0x1a')]));require(_0xde11('0x1c'))[_0xde11('0x1d')](socket);function respondWithStatusCode(_0x485077,_0x269d11){_0x269d11=_0x269d11||0xcc;return function(_0x359254){if(_0x359254){return _0x485077['sendStatus'](_0x269d11);}return _0x485077[_0xde11('0x1e')](_0x269d11)[_0xde11('0x1f')]();};}function respondWithResult(_0x1a5830,_0x49ad7c){_0x49ad7c=_0x49ad7c||0xc8;return function(_0x367d36){if(_0x367d36){return _0x1a5830[_0xde11('0x1e')](_0x49ad7c)['json'](_0x367d36);}};}function respondWithFilteredResult(_0x549f61,_0x2a8700){return function(_0xb1c0fe){if(_0xb1c0fe){var _0xc6fb89=_0xb1c0fe[_0xde11('0x20')],_0x1d8adb=_0x2a8700['offset'],_0x149b51=_0x2a8700['offset']+_0x2a8700['limit'],_0x3a335f;if(_0x149b51>=_0xc6fb89){_0x149b51=_0xc6fb89;_0x3a335f=0xc8;}else{_0x3a335f=0xce;}_0x549f61[_0xde11('0x1e')](_0x3a335f);return _0x549f61[_0xde11('0x21')](_0xde11('0x22'),_0x1d8adb+'-'+_0x149b51+'/'+_0xc6fb89)[_0xde11('0x23')](_0xb1c0fe);}return null;};}function patchUpdates(_0x1c79cb){return function(_0x5b10eb){try{jsonpatch['apply'](_0x5b10eb,_0x1c79cb,!![]);}catch(_0x157404){return BPromise[_0xde11('0x24')](_0x157404);}return _0x5b10eb[_0xde11('0x25')]();};}function saveUpdates(_0x23aec4,_0x254325){return function(_0xc6a5e2){if(_0xc6a5e2){return _0xc6a5e2[_0xde11('0x26')](_0x23aec4)[_0xde11('0x27')](function(_0x53859c){return _0x53859c;});}return null;};}function removeEntity(_0x3e94f7,_0x45f6cd){return function(_0x104f18){if(_0x104f18){return _0x104f18[_0xde11('0x28')]()[_0xde11('0x27')](function(){_0x3e94f7[_0xde11('0x1e')](0xcc)[_0xde11('0x1f')]();});}};}function handleEntityNotFound(_0x5b918e,_0xe58fff){return function(_0x5b9bee){if(!_0x5b9bee){_0x5b918e[_0xde11('0x29')](0x194);}return _0x5b9bee;};}function handleError(_0x34422c,_0x1f74c8){_0x1f74c8=_0x1f74c8||0x1f4;return function(_0x3de43b){logger['error'](_0x3de43b[_0xde11('0x2a')]);if(_0x3de43b[_0xde11('0x2b')]){delete _0x3de43b[_0xde11('0x2b')];}_0x34422c[_0xde11('0x1e')](_0x1f74c8)['send'](_0x3de43b);};}function getInteractionUsers(_0xc09078,_0x3d5ced){return new BPromise(function(_0x1071e1,_0x36c847){try{if(_0x3d5ced[_0xc09078['id']]){_0xc09078[_0xde11('0x2c')]=_[_0xde11('0x2d')](_0x3d5ced[_0xc09078['id']],function(_0x3bfee6){return{'id':_0x3bfee6['id']};});}}catch(_0x3189ce){_0x36c847(_0x3189ce);}_0x1071e1(_0xc09078);});}function getInteractionTags(_0x54aff4,_0x5f31c1){return new BPromise(function(_0x256cdd,_0x561427){try{if(_0x54aff4['TagIds']){_0x54aff4[_0xde11('0x2e')]=[];_0x54aff4['TagIds'][_0xde11('0x2f')](',')['forEach'](function(_0x30ad69){_0x54aff4[_0xde11('0x2e')][_0xde11('0x30')](_0x5f31c1[_0x30ad69]);});}delete _0x54aff4['TagIds'];}catch(_0x224714){_0x561427(_0x224714);}_0x256cdd(_0x54aff4);});}function updateSmsInteraction(_0x404dac,_0x1f3034,_0x30c239){return new BPromise(function(_0x4a6dcf,_0x42e846){return getInteractionUsers(_0x404dac,_0x30c239)[_0xde11('0x27')](function(_0xadad43){return getInteractionTags(_0xadad43,_0x1f3034);})[_0xde11('0x27')](function(_0x4a0051){_0x4a6dcf(_0x4a0051);})['catch'](function(_0x2d56ec){_0x42e846(_0x2d56ec);});});}exports[_0xde11('0x31')]=function(_0x338c73,_0xd9961d){var _0x4a473c={},_0x17d710={},_0x5d3283={'count':0x0,'rows':[]};var _0x54285d=db['SmsInteraction'][_0xde11('0x32')];_0x17d710[_0xde11('0x33')]=_[_0xde11('0x34')](_0x54285d);_0x17d710['query']=_['keys'](_0x338c73[_0xde11('0x35')]);_0x17d710[_0xde11('0x36')]=_[_0xde11('0x37')](_0x17d710[_0xde11('0x33')],_0x17d710[_0xde11('0x35')]);_0x4a473c['attributes']=_[_0xde11('0x37')](_0x17d710['model'],qs[_0xde11('0x38')](_0x338c73[_0xde11('0x35')]['fields']));_0x4a473c[_0xde11('0x39')]=_0x4a473c['attributes'][_0xde11('0x3a')]?_0x4a473c[_0xde11('0x39')]:_0x17d710[_0xde11('0x33')];if(!_0x338c73['query']['hasOwnProperty'](_0xde11('0x3b'))){_0x4a473c[_0xde11('0x3c')]=qs['limit'](_0x338c73['query'][_0xde11('0x3c')]);_0x4a473c[_0xde11('0x3d')]=qs[_0xde11('0x3d')](_0x338c73['query'][_0xde11('0x3d')]);}_0x4a473c['order']=qs[_0xde11('0x3e')](_0x338c73['query'][_0xde11('0x3e')]);_0x4a473c[_0xde11('0x3f')]=qs['filters'](_[_0xde11('0x40')](_0x338c73['query'],_0x17d710[_0xde11('0x36')]));var _0x10ba1b=[];var _0x1c04ad=squel[_0xde11('0x41')]()['field']('id')[_0xde11('0x42')](_0xde11('0x2b'))['field']('color')[_0xde11('0x43')]('tools_tags');var _0x21908e=squel[_0xde11('0x41')]()[_0xde11('0x42')](_0xde11('0x44'))[_0xde11('0x43')](_0xde11('0x45'),'me')[_0xde11('0x3f')](_0xde11('0x46'))[_0xde11('0x3f')](_0xde11('0x47'))[_0xde11('0x3f')](_0xde11('0x48'));var _0x5e5015=squel['select']()[_0xde11('0x42')](_0xde11('0x49'))[_0xde11('0x42')](_0xde11('0x4a'))[_0xde11('0x43')](_0xde11('0x4b'),'ui')['left_join']('users','u',_0xde11('0x4c'));var _0x35a04a=squel[_0xde11('0x41')]()['from'](_0xde11('0x4d'),'i')[_0xde11('0x4e')](_0xde11('0x4f'),'c',_0xde11('0x50'))['left_join'](_0xde11('0x51'),'o','o.id\x20=\x20i.UserId')[_0xde11('0x4e')](_0xde11('0x52'),'a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0xde11('0x45'),'me','me.SmsInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0x109094=squel[_0xde11('0x53')]();if(_0x338c73[_0xde11('0x35')][_0xde11('0x54')]){var _0x2bb0d6=JSON[_0xde11('0x55')](_0x338c73['query'][_0xde11('0x54')]);_['keys'](_0x2bb0d6)[_0xde11('0x56')](function(_0x5a3546){var _0x217d44=_0x2bb0d6[_0x5a3546];if(_0x5a3546===_0xde11('0x57')){var _0x28c5cc=moment(_0x217d44['value'][_0xde11('0x58')])[_0xde11('0x59')](_0xde11('0x5a'))['utc']()[_0xde11('0x5b')]();var _0x349409=moment(_0x349409)[_0xde11('0x5c')]()['endOf'](_0xde11('0x5a'))[_0xde11('0x5b')]();_0x109094[_0xde11('0x5d')](_0xde11('0x5e'),_0x28c5cc,_0x349409);}else{if(_['isArray'](_0x217d44['condition'])){_0x217d44[_0xde11('0x5f')][_0xde11('0x56')](function(_0x37b1f0){switch(_0x217d44[_0xde11('0x5f')][_0xde11('0x60')]){case'IS':if(_0x5a3546!=='TagId'&&_0x5a3546!==_0xde11('0x61')){if(_['isArray'](_0x217d44[_0xde11('0x60')])&&_0x217d44[_0xde11('0x60')][_0xde11('0x3a')]>0x1){_0x109094[_0xde11('0x5d')](_0x217d44[_0xde11('0x62')]+'.'+_0x5a3546+_0xde11('0x63'),_0x217d44[_0xde11('0x60')]);}else{_0x109094['and'](_0x217d44['tableAlias']+'.'+_0x5a3546+_0xde11('0x64'),_0x217d44['value'][0x0]);}}break;case'=':_0x109094[_0xde11('0x5d')](_0x217d44[_0xde11('0x62')]+'.'+_0x5a3546+_0xde11('0x64'),_0x217d44['value']);break;case _0xde11('0x65'):if(_0x5a3546===_0xde11('0x66')){_0x109094[_0xde11('0x5d')]('c.firstName'+_0xde11('0x67'),'%'+_0x217d44[_0xde11('0x60')]+'%');_0x109094['or'](_0xde11('0x68')+_0xde11('0x67'),'%'+_0x217d44[_0xde11('0x60')]+'%');_0x109094['or'](_0xde11('0x69')+_0xde11('0x67'),'%'+_0x217d44[_0xde11('0x60')]+'%');}else{_0x109094[_0xde11('0x5d')](_0x217d44['tableAlias']+'.'+_0x5a3546+_0xde11('0x67'),'%'+_0x217d44[_0xde11('0x60')]+'%');}break;case'>':_0x109094['and'](_0x217d44[_0xde11('0x62')]+'.'+_0x5a3546+_0xde11('0x6a'),_0x217d44[_0xde11('0x60')]);break;case'<':_0x109094[_0xde11('0x5d')](_0x217d44[_0xde11('0x62')]+'.'+_0x5a3546+_0xde11('0x6b'),_0x217d44[_0xde11('0x60')]);break;}});}else{switch(_0x217d44[_0xde11('0x5f')][_0xde11('0x60')]){case'IS':if(_0x5a3546!==_0xde11('0x6c')&&_0x5a3546!==_0xde11('0x61')){if(_[_0xde11('0x6d')](_0x217d44[_0xde11('0x60')])&&_0x217d44[_0xde11('0x60')][_0xde11('0x3a')]>0x1){_0x109094[_0xde11('0x5d')](_0x217d44[_0xde11('0x62')]+'.'+_0x5a3546+_0xde11('0x63'),_0x217d44[_0xde11('0x60')]);}else{_0x109094[_0xde11('0x5d')](_0x217d44[_0xde11('0x62')]+'.'+_0x5a3546+_0xde11('0x64'),_0x217d44['value'][0x0]);}}break;case'=':_0x109094[_0xde11('0x5d')](_0x217d44[_0xde11('0x62')]+'.'+_0x5a3546+'\x20=\x20?',_0x217d44[_0xde11('0x60')]);break;case _0xde11('0x65'):if(_0x5a3546===_0xde11('0x66')){_0x109094[_0xde11('0x5d')](_0xde11('0x6e')+'\x20LIKE\x20?','%'+_0x217d44[_0xde11('0x60')]+'%');_0x109094['or']('c.lastName'+'\x20LIKE\x20?','%'+_0x217d44[_0xde11('0x60')]+'%');_0x109094['or']('c.email'+_0xde11('0x67'),'%'+_0x217d44[_0xde11('0x60')]+'%');}else{_0x109094[_0xde11('0x5d')](_0x217d44[_0xde11('0x62')]+'.'+_0x5a3546+_0xde11('0x67'),'%'+_0x217d44[_0xde11('0x60')]+'%');}break;case'>':_0x109094[_0xde11('0x5d')](_0x217d44[_0xde11('0x62')]+'.'+_0x5a3546+'\x20>\x20?',_0x217d44[_0xde11('0x60')]);break;case'<':_0x109094['and'](_0x217d44[_0xde11('0x62')]+'.'+_0x5a3546+_0xde11('0x6b'),_0x217d44[_0xde11('0x60')]);break;}}}});}else{var _0x2c0de5=_(Object[_0xde11('0x34')](_0x338c73[_0xde11('0x35')]))[_0xde11('0x2d')](function(_0x55a298){return _0x54285d[_0xde11('0x6f')](_0x55a298)?_0x55a298:undefined;})[_0xde11('0x70')](function(_0xde5edf){return!_[_0xde11('0x71')](_0xde5edf);})[_0xde11('0x60')]();if(!_['isEmpty'](_0x2c0de5)){_0x2c0de5[_0xde11('0x56')](function(_0x3d504e){if(_0x3d504e===_0xde11('0x72')){_0x35a04a[_0xde11('0x3f')](_0xde11('0x73'),[][_0xde11('0x74')](_0x338c73[_0xde11('0x35')][_0x3d504e]));}else if(_0x3d504e==='createdAt'){var _0x9a1e02=JSON[_0xde11('0x55')](_0x338c73['query'][_0x3d504e])[_0xde11('0x75')];var _0x378a87=JSON[_0xde11('0x55')](_0x338c73['query'][_0x3d504e])[_0xde11('0x76')];_0x35a04a[_0xde11('0x3f')](_0xde11('0x5e'),_0x9a1e02,_0x378a87);}else{if(_0x338c73['query'][_0x3d504e]==='null'){_0x35a04a['where']('i.'+_0x3d504e+_0xde11('0x77'));}else{_0x35a04a[_0xde11('0x3f')]('i.'+_0x3d504e+_0xde11('0x64'),_0x338c73[_0xde11('0x35')][_0x3d504e]);}}});}if(_0x338c73[_0xde11('0x35')][_0xde11('0x70')]){var _0x3135dc=_0x338c73[_0xde11('0x35')]['filter']['replace']('\x5c','\x5c\x5c')[_0xde11('0x78')]('\x27\x27',_0xde11('0x79'));if(qs[_0xde11('0x7a')](_0x3135dc)){_0x109094['or'](_0xde11('0x7b'),_0x3135dc+'%')['or'](_0xde11('0x7c'),_0x3135dc+'%');}else{var _0x61761a=[];_0x3135dc[_0xde11('0x2f')]('\x20')[_0xde11('0x56')](function(_0x2e4184){_0x61761a[_0xde11('0x30')]('+'+_0x2e4184['toString']());});var _0xcc264c=_0x61761a['join']('\x20');_0x109094['or'](_0xde11('0x7d'),_0xcc264c)['or'](_0xde11('0x7e'),_0x3135dc+'%');}}}_0x35a04a[_0xde11('0x3f')](_0x109094);if(_0x4a473c[_0xde11('0x7f')]){_0x4a473c[_0xde11('0x7f')][_0xde11('0x56')](function(_0x10f0f5){_0x35a04a[_0xde11('0x7f')]('i.'+_0x10f0f5[0x0],_0x10f0f5[0x1]===_0xde11('0x80')?![]:!![]);});}_0x35a04a[_0xde11('0x81')](_0xde11('0x82'));var _0x40bffb={'type':db[_0xde11('0x83')]['QueryTypes'][_0xde11('0x84')],'raw':!![]};var _0x38c20e=_0x35a04a[_0xde11('0x85')]()['field']('COUNT(*)')[_0xde11('0x42')]('COUNT(me.id)',_0xde11('0x61'));if(!_0x338c73[_0xde11('0x35')][_0xde11('0x54')]){if(_0x338c73[_0xde11('0x35')][_0xde11('0x86')]){if(_0x338c73[_0xde11('0x35')][_0xde11('0x86')]==0x1){_0x38c20e[_0xde11('0x87')](_0xde11('0x88'));_0x35a04a[_0xde11('0x87')](_0xde11('0x88'));}else{_0x38c20e[_0xde11('0x87')]('`unreadMessages`\x20>\x200');_0x35a04a[_0xde11('0x87')]('`unreadMessages`\x20>\x200');}}if(_0x338c73[_0xde11('0x35')]['tag']){var _0x4f2261=_['isArray'](_0x338c73['query'][_0xde11('0x89')])?_0x338c73[_0xde11('0x35')][_0xde11('0x89')]:new Array(_0x338c73['query'][_0xde11('0x89')]);var _0x10898b=squel[_0xde11('0x53')]();_0x4f2261[_0xde11('0x56')](function(_0x388312){_0x10898b['or'](_0xde11('0x8a'),'%,'+_0x388312+',%');});_0x35a04a[_0xde11('0x87')](_0x10898b);_0x38c20e[_0xde11('0x4e')]('sms_interaction_has_tags','it',_0xde11('0x8b'));_0x38c20e['left_join'](_0xde11('0x8c'),'t',_0xde11('0x8d'));_0x38c20e[_0xde11('0x3f')](_0xde11('0x8e'),_0x4f2261);}}else{var _0x2bb0d6=JSON[_0xde11('0x55')](_0x338c73[_0xde11('0x35')][_0xde11('0x54')]);_[_0xde11('0x34')](_0x2bb0d6)['forEach'](function(_0x1df2ca){var _0x1303dc=_0x2bb0d6[_0x1df2ca];if(_0x1df2ca===_0xde11('0x6c')){var _0x550efe=_0x1303dc[_0xde11('0x60')];var _0x29b4bc=squel[_0xde11('0x53')]();_0x550efe[_0xde11('0x56')](function(_0x5f5700){_0x29b4bc['or'](_0xde11('0x8a'),'%,'+_0x5f5700+',%');});_0x35a04a[_0xde11('0x87')](_0x29b4bc);_0x38c20e['left_join'](_0xde11('0x8f'),'it',_0xde11('0x90'));_0x38c20e[_0xde11('0x4e')](_0xde11('0x8c'),'t',_0xde11('0x8d'));_0x38c20e[_0xde11('0x3f')]('t.id\x20IN\x20?',_0x550efe);}else if(_0x1df2ca==='unreadMessages'){if(_0x1303dc[_0xde11('0x60')][_0xde11('0x3a')]===0x1){if(_0x1303dc[_0xde11('0x60')][0x0]===0x1){_0x38c20e[_0xde11('0x87')](_0xde11('0x88'));_0x35a04a[_0xde11('0x87')](_0xde11('0x88'));}else{_0x38c20e['having'](_0xde11('0x91'));_0x35a04a['having'](_0xde11('0x91'));}}}});}db['sequelize'][_0xde11('0x35')](_0x38c20e[_0xde11('0x92')](),_0x40bffb)[_0xde11('0x27')](function(_0x157d07){_0x5d3283['count']=_0x157d07['length'];if(_0x5d3283[_0xde11('0x20')]===0x0)return[];return db[_0xde11('0x93')][_0xde11('0x35')](_0x1c04ad[_0xde11('0x92')](),_0x40bffb)[_0xde11('0x27')](function(_0x51151b){_0x10ba1b=_['keyBy'](_0x51151b,'id');_0x40bffb=_[_0xde11('0x94')](_0x40bffb,{'model':db[_0xde11('0x95')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x35a04a[_0xde11('0x42')]('COUNT(me.id)','unreadMessages');_0x35a04a[_0xde11('0x42')](_0xde11('0x96'),_0xde11('0x97'));_0x35a04a[_0xde11('0x42')](_0xde11('0x98'),_0xde11('0x99'));_0x35a04a[_0xde11('0x42')](_0xde11('0x9a'));_0x35a04a['field'](_0xde11('0x6e'),_0xde11('0x9b'));_0x35a04a[_0xde11('0x42')](_0xde11('0x68'),_0xde11('0x9c'));_0x35a04a['field'](_0xde11('0x69'),_0xde11('0x9d'));_0x35a04a[_0xde11('0x42')](_0xde11('0x9e'),_0xde11('0x9f'));_0x35a04a[_0xde11('0x42')](_0xde11('0xa0'),'Contact.mobile');_0x35a04a[_0xde11('0x42')](_0xde11('0xa1'),_0xde11('0xa2'));_0x35a04a[_0xde11('0x42')](_0xde11('0xa3'),_0xde11('0xa4'));_0x35a04a[_0xde11('0x4e')](_0xde11('0xa5'),'it','it.SmsInteractionId\x20=\x20i.id');_0x35a04a['left_join'](_0xde11('0x8c'),'t',_0xde11('0x8d'));_0x35a04a[_0xde11('0x3c')](_0x4a473c['limit']);_0x35a04a[_0xde11('0x3d')](_0x4a473c[_0xde11('0x3d')]);return db['sequelize'][_0xde11('0x35')](_0x35a04a['toString'](),_0x40bffb);})[_0xde11('0x27')](function(_0x4ac4ee){_0x5e5015[_0xde11('0x3f')](_0xde11('0xa6'),_['map'](_0x4ac4ee,'id'));return db[_0xde11('0x93')][_0xde11('0x35')](_0x5e5015[_0xde11('0x92')](),_0x40bffb)[_0xde11('0x27')](function(_0x92219e){var _0x27305f=_['groupBy'](_0x92219e,_0xde11('0xa7'));var _0x22b9f8=[];_0x4ac4ee[_0xde11('0x56')](function(_0x3c4ac2){_0x22b9f8[_0xde11('0x30')](updateSmsInteraction(_0x3c4ac2,_0x10ba1b,_0x27305f));});return BPromise[_0xde11('0xa8')](_0x22b9f8);});});})[_0xde11('0x27')](function(_0x55278c){_0x5d3283[_0xde11('0xa9')]=_0x55278c;return _0x5d3283;})[_0xde11('0x27')](respondWithFilteredResult(_0xd9961d,_0x4a473c))[_0xde11('0xaa')](handleError(_0xd9961d,null));};exports[_0xde11('0xab')]=function(_0x23f7b3,_0x3317ab){var _0x97dd8e={'raw':![],'where':{'id':_0x23f7b3[_0xde11('0xac')]['id']}},_0x17685c={};_0x17685c[_0xde11('0x33')]=_[_0xde11('0x34')](db[_0xde11('0x95')][_0xde11('0x32')]);_0x17685c['query']=_[_0xde11('0x34')](_0x23f7b3['query']);_0x17685c[_0xde11('0x36')]=_[_0xde11('0x37')](_0x17685c[_0xde11('0x33')],_0x17685c[_0xde11('0x35')]);_0x97dd8e['attributes']=_['intersection'](_0x17685c[_0xde11('0x33')],qs[_0xde11('0x38')](_0x23f7b3[_0xde11('0x35')][_0xde11('0x38')]));_0x97dd8e[_0xde11('0x39')]=_0x97dd8e[_0xde11('0x39')][_0xde11('0x3a')]?_0x97dd8e[_0xde11('0x39')]:_0x17685c[_0xde11('0x33')];if(_0x23f7b3[_0xde11('0x35')][_0xde11('0xad')]){_0x97dd8e['include']=[{'all':!![]}];}_0x97dd8e=_[_0xde11('0x94')]({},_0x97dd8e,_0x23f7b3[_0xde11('0xae')]);return db['SmsInteraction'][_0xde11('0xaf')](_0x97dd8e)[_0xde11('0x27')](handleEntityNotFound(_0x3317ab,null))[_0xde11('0x27')](respondWithResult(_0x3317ab,null))[_0xde11('0xaa')](handleError(_0x3317ab,null));};exports[_0xde11('0xb0')]=function(_0xe60b5f,_0x2f7d75){return db[_0xde11('0x95')][_0xde11('0xb0')](_0xe60b5f[_0xde11('0xb1')],{})[_0xde11('0x27')](respondWithResult(_0x2f7d75,0xc9))[_0xde11('0xaa')](handleError(_0x2f7d75,null));};exports['update']=function(_0x28b481,_0x1ddf5c){if(_0x28b481[_0xde11('0xb1')]['id']){delete _0x28b481['body']['id'];}return db[_0xde11('0x95')][_0xde11('0xaf')]({'where':{'id':_0x28b481['params']['id']}})['then'](handleEntityNotFound(_0x1ddf5c,null))[_0xde11('0x27')](saveUpdates(_0x28b481['body'],null))[_0xde11('0x27')](respondWithResult(_0x1ddf5c,null))['catch'](handleError(_0x1ddf5c,null));};exports[_0xde11('0x28')]=function(_0x408b0d,_0x588445){return db[_0xde11('0x95')]['find']({'where':{'id':_0x408b0d[_0xde11('0xac')]['id']}})[_0xde11('0x27')](handleEntityNotFound(_0x588445,null))['then'](removeEntity(_0x588445,null))[_0xde11('0xaa')](handleError(_0x588445,null));};exports[_0xde11('0xb2')]=function(_0x1ba276,_0x3c9ae0){return db[_0xde11('0x95')][_0xde11('0xb2')]()[_0xde11('0x27')](respondWithResult(_0x3c9ae0,null))[_0xde11('0xaa')](handleError(_0x3c9ae0,null));};exports[_0xde11('0xb3')]=function(_0x33c708,_0x6de379,_0x4c0a6e){return db[_0xde11('0xb4')][_0xde11('0xaf')]({'where':{'id':_0x33c708[_0xde11('0xac')]['id']}})['then'](handleEntityNotFound(_0x6de379,null))[_0xde11('0x27')](function(_0x521b73){if(_0x521b73){return _0x521b73[_0xde11('0xb3')](_0x33c708['body'][_0xde11('0xb5')],_[_0xde11('0xb6')](_0x33c708['body'],[_0xde11('0xb5'),'id'])||{});}})[_0xde11('0x27')](respondWithResult(_0x6de379,null))[_0xde11('0xaa')](handleError(_0x6de379,null));};exports[_0xde11('0xb7')]=function(_0x495558,_0x42844f,_0x257557){var _0x5686e3={'raw':![],'where':{}};var _0x108f15={};var _0x50978c={'count':0x0,'rows':[]};return db[_0xde11('0x95')][_0xde11('0xb8')]({'where':{'id':_0x495558[_0xde11('0xac')]['id']}})[_0xde11('0x27')](handleEntityNotFound(_0x42844f,null))[_0xde11('0x27')](function(_0x30c40b){if(_0x30c40b){_0x108f15[_0xde11('0x33')]=_[_0xde11('0x34')](db[_0xde11('0xb4')][_0xde11('0x32')]);_0x108f15[_0xde11('0x35')]=_[_0xde11('0x34')](_0x495558[_0xde11('0x35')]);_0x108f15['filters']=_[_0xde11('0x37')](_0x108f15[_0xde11('0x33')],_0x108f15[_0xde11('0x35')]);_0x5686e3[_0xde11('0x39')]=_[_0xde11('0x37')](_0x108f15[_0xde11('0x33')],qs['fields'](_0x495558[_0xde11('0x35')][_0xde11('0x38')]));_0x5686e3[_0xde11('0x39')]=_0x5686e3[_0xde11('0x39')]['length']?_0x5686e3[_0xde11('0x39')]:_0x108f15[_0xde11('0x33')];if(!_0x495558[_0xde11('0x35')][_0xde11('0x6f')](_0xde11('0x3b'))){_0x5686e3[_0xde11('0x3c')]=qs[_0xde11('0x3c')](_0x495558[_0xde11('0x35')][_0xde11('0x3c')]);_0x5686e3[_0xde11('0x3d')]=qs[_0xde11('0x3d')](_0x495558['query'][_0xde11('0x3d')]);}_0x5686e3[_0xde11('0x7f')]=qs[_0xde11('0x3e')](_0x495558[_0xde11('0x35')][_0xde11('0x3e')]);_0x5686e3[_0xde11('0x3f')]=qs['filters'](_[_0xde11('0x40')](_0x495558['query'],_0x108f15[_0xde11('0x36')]));_0x5686e3[_0xde11('0x3f')]['SmsInteractionId']=_0x30c40b['id'];if(_0x495558[_0xde11('0x35')]['filter']){_0x5686e3[_0xde11('0x3f')]=_[_0xde11('0x94')](_0x5686e3['where'],{'$or':_[_0xde11('0x2d')](_0x5686e3[_0xde11('0x39')],function(_0x265427){var _0x1966b2={};_0x1966b2[_0x265427]={'$like':'%'+_0x495558[_0xde11('0x35')][_0xde11('0x70')]+'%'};return _0x1966b2;})});}if(_0x495558[_0xde11('0x35')][_0xde11('0x75')]){var _0xc9e595=_0x495558['query'][_0xde11('0x75')][_0xde11('0x2f')](',');var _0x394e4f={};_0x394e4f[_0xc9e595[0x0]]={'$gte':moment(_0xc9e595[0x1])[_0xde11('0x5b')](_0xde11('0xb9'))};_0x5686e3[_0xde11('0x3f')]=_['merge'](_0x5686e3[_0xde11('0x3f')],_0x394e4f);}_0x5686e3=_[_0xde11('0x94')]({},_0x5686e3,_0x495558[_0xde11('0xae')]);return db['SmsMessage'][_0xde11('0x20')]({'where':_0x5686e3[_0xde11('0x3f')]})[_0xde11('0x27')](function(_0x594af5){_0x50978c[_0xde11('0x20')]=_0x594af5;if(_0x495558[_0xde11('0x35')][_0xde11('0xad')]){_0x5686e3[_0xde11('0xba')]=[{'all':!![]}];}return db[_0xde11('0xb4')][_0xde11('0xbb')](_0x5686e3);})['then'](function(_0x2937f5){_0x50978c[_0xde11('0xa9')]=_0x2937f5;return _0x50978c;});}})['then'](respondWithFilteredResult(_0x42844f,_0x5686e3))['catch'](handleError(_0x42844f,null));};exports[_0xde11('0xbc')]=function(_0xe122bc,_0x43c652,_0x3e8f64){return db[_0xde11('0x95')]['find']({'where':{'id':_0xe122bc[_0xde11('0xac')]['id']}})[_0xde11('0x27')](handleEntityNotFound(_0x43c652,null))[_0xde11('0x27')](function(_0x74b6f0){if(_0x74b6f0){return _0x74b6f0['setTags'](_0xe122bc[_0xde11('0xb1')]['ids'],_[_0xde11('0xb6')](_0xe122bc['body'],['ids','id'])||{})['spread'](function(){return db['Tag'][_0xde11('0xbb')]({'attributes':['id','name',_0xde11('0xbd')],'where':{'id':_0xe122bc[_0xde11('0xb1')][_0xde11('0xb5')]}});})['then'](function(_0x2c6e4a){socket[_0xde11('0xbe')]('smsInteractionTags:save',{'id':Number(_0xe122bc[_0xde11('0xac')]['id']),'tags':_0x2c6e4a||[]});return{'id':Number(_0xe122bc['params']['id']),'tags':_0x2c6e4a||[]};});}})[_0xde11('0x27')](respondWithResult(_0x43c652,null))[_0xde11('0xaa')](handleError(_0x43c652,null));};exports[_0xde11('0xbf')]=function(_0x54d3c2,_0x3fca1c,_0x4b6681){return db[_0xde11('0x95')][_0xde11('0xaf')]({'where':{'id':_0x54d3c2[_0xde11('0xac')]['id']}})[_0xde11('0x27')](handleEntityNotFound(_0x3fca1c,null))['then'](function(_0xe1ccb6){if(_0xe1ccb6){return _0xe1ccb6[_0xde11('0xbf')](_0x54d3c2[_0xde11('0x35')][_0xde11('0xb5')]);}})[_0xde11('0x27')](respondWithStatusCode(_0x3fca1c,null))[_0xde11('0xaa')](handleError(_0x3fca1c,null));};exports[_0xde11('0xc0')]=function(_0x16c6ac,_0xa6abe){var _0x463941=moment()[_0xde11('0xc1')]()['toString']();var _0x3f474c=path['join'](config[_0xde11('0xc2')],'server','files',_0xde11('0xc3'));var _0x2a0824=path['join'](config[_0xde11('0xc2')],_0xde11('0xc4'),_0xde11('0xc5'),'attachments');var _0x19f331=path[_0xde11('0xc6')](_0x3f474c,_0x463941);var _0x20ab36=util[_0xde11('0x5b')](_0xde11('0xc7'),_0x16c6ac[_0xde11('0xac')]['id'],_0x463941);var _0x53a9e8=path[_0xde11('0xc6')](_0x3f474c,_0x20ab36);var _0x18d8f1=![];return db[_0xde11('0x95')][_0xde11('0xaf')]({'where':{'id':_0x16c6ac[_0xde11('0xac')]['id']},'include':[{'model':db[_0xde11('0xb4')],'as':'Messages','attributes':['id',_0xde11('0xb1'),_0xde11('0x57'),_0xde11('0xc8'),_0xde11('0xc9')],'include':[{'model':db[_0xde11('0xca')],'as':'User','attributes':['id',_0xde11('0xcb')],'raw':!![]},{'model':db['CmContact'],'as':_0xde11('0xcc'),'attributes':['id',_0xde11('0xcd'),'lastName'],'raw':!![]}]},{'model':db[_0xde11('0xce')],'as':_0xde11('0xcf'),'attributes':['id',_0xde11('0x2b')]},{'model':db[_0xde11('0xca')],'as':'Owner','attributes':['id','fullname']}]})['then'](handleEntityNotFound(_0xa6abe,null))[_0xde11('0x27')](function(_0x27cb75){if(_0x27cb75){var _0x3a5440=_0x27cb75[_0xde11('0xd0')]({'plain':!![]});_0x18d8f1=!![];var _0x580dbe={'format':'A4','border':_0xde11('0xd1'),'header':{'height':_0xde11('0xd2'),'contents':{'first':_0xde11('0xd3')}},'footer':{'height':_0xde11('0xd4'),'contents':{'default':util[_0xde11('0x5b')](_0xde11('0xd5'),util[_0xde11('0x5b')](_0xde11('0xd6'),'Sms',_0x3a5440['id']),moment()[_0xde11('0x5b')](_0xde11('0xd7'))[_0xde11('0x92')]())}}};fs[_0xde11('0xd8')](_0x19f331);var _0x4ee8d1={'channel':_0xde11('0xd9'),'account':_0x3a5440['Account'][_0xde11('0x2b')],'agent':_0x3a5440[_0xde11('0xda')]?_0x3a5440['Owner'][_0xde11('0xcb')]:_0xde11('0xdb'),'createdAt':moment(_0x3a5440[_0xde11('0x57')])[_0xde11('0x5b')](_0xde11('0xb9'))[_0xde11('0x92')](),'closedAt':_0x3a5440[_0xde11('0xdc')]?moment(_0x3a5440[_0xde11('0xdd')])[_0xde11('0x5b')](_0xde11('0xb9'))[_0xde11('0x92')]():'','disposition':_0x3a5440[_0xde11('0xde')],'messages':_(_0x3a5440['Messages'])['filter']({'secret':![]})[_0xde11('0x2d')](function(_0x48e884){return{'date':moment(_0x48e884[_0xde11('0x57')])['format'](_0xde11('0xb9'))[_0xde11('0x92')](),'sender':_0x48e884['direction']===_0xde11('0xdf')?_0x48e884[_0xde11('0xca')]?_0x48e884[_0xde11('0xca')][_0xde11('0xcb')]:_0xde11('0xe0'):_0x48e884['Contact'][_0xde11('0xcd')]+(_0x48e884[_0xde11('0xcc')][_0xde11('0xe1')]?'\x20'+_0x48e884['Contact']['lastName']:''),'body':_0x48e884[_0xde11('0xb1')],'direction':_0x48e884[_0xde11('0xc8')]===_0xde11('0xdf')?'A':'C','secret':_0x48e884[_0xde11('0xc9')]};})['value']()};return ejs['renderFile'](path['join'](config[_0xde11('0xc2')],_0xde11('0xc4'),'views','downloadInteraction.html'),{'interaction':_0x4ee8d1})['then'](function(_0x81453b){return new BPromise(function(_0x447de5,_0x2a6441){pdf[_0xde11('0xb0')](_0x81453b,_0x580dbe)[_0xde11('0xe2')](path['join'](_0x19f331,_0xde11('0xe3')+_0x3a5440['id']+'-'+_0x463941+_0xde11('0xe4')),function(_0x2cf3dc,_0x1911e6){if(_0x2cf3dc)return _0x2a6441(_0x2cf3dc);_0x447de5(_0x1911e6);});});});}})[_0xde11('0x27')](function(){if(_0x18d8f1){return new BPromise(function(_0x52b4de,_0x489482){zipdir(_0x19f331,{'saveTo':_0x53a9e8},function(_0x5a9567,_0xb98e41){if(_0x5a9567)return _0x489482(_0x5a9567);return _0x52b4de(_0xb98e41);});})[_0xde11('0x27')](function(){return new BPromise(function(_0xcac7fe,_0x27a1bb){rimraf(_0x19f331,function(_0x37cecd){if(_0x37cecd)_0x27a1bb(_0x37cecd);return _0xcac7fe();});});})['then'](function(){return _0xa6abe[_0xde11('0xc0')](_0x53a9e8,_0x20ab36,function(_0x3c5523){if(_0x3c5523){console['log']('err',_0x3c5523);}else{fs[_0xde11('0xe5')](_0x53a9e8);}});});}else{return _0xa6abe[_0xde11('0x29')](0xc8);}})[_0xde11('0xaa')](handleError(_0xa6abe,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 3abbe7e..ba8c8f1 100644 --- a/server/api/smsInteraction/smsInteraction.events.js +++ b/server/api/smsInteraction/smsInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbeea=['exports','events','SmsInteraction','../../mysqldb','SmsMessage','save','remove','setDataValue','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xbeea,0xb1));var _0xabee=function(_0x1f532c,_0x29d929){_0x1f532c=_0x1f532c-0x0;var _0x126690=_0xbeea[_0x1f532c];return _0x126690;};'use strict';var EventEmitter=require(_0xabee('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xabee('0x1')];var SmsMessage=require(_0xabee('0x2'))['db'][_0xabee('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xabee('0x4'),'afterUpdate':'update','afterDestroy':_0xabee('0x5')};function emitEvent(_0x33571e){return function(_0x2fb6d9,_0x49631e,_0x1ea258){_0x2fb6d9['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x238317){_0x2fb6d9[_0xabee('0x6')]('Users',_0x238317[_0xabee('0x7')](function(_0x507deb){return{'id':_0x507deb['id']};}));return SmsMessage[_0xabee('0x8')]({'where':{'SmsInteractionId':_0x2fb6d9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xabee('0x9')](function(_0x2a1c06){_0x2fb6d9[_0xabee('0x6')](_0xabee('0xa'),_0x2a1c06[_0xabee('0xb')]);SmsInteractionEvents['emit'](_0x33571e+':'+_0x2fb6d9['id'],_0x2fb6d9);SmsInteractionEvents[_0xabee('0xc')](_0x33571e,_0x2fb6d9);_0x1ea258(null);})[_0xabee('0xd')](_0x1ea258(null));};}for(var e in events){if(events[_0xabee('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xabee('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0x425d=['SmsMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','SmsInteraction','../../mysqldb'];(function(_0x55186e,_0xd9123e){var _0x32e59f=function(_0x2bb8f0){while(--_0x2bb8f0){_0x55186e['push'](_0x55186e['shift']());}};_0x32e59f(++_0xd9123e);}(_0x425d,0x1e0));var _0xd425=function(_0x1a5796,_0x38cfa6){_0x1a5796=_0x1a5796-0x0;var _0x1e45ca=_0x425d[_0x1a5796];return _0x1e45ca;};'use strict';var EventEmitter=require(_0xd425('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xd425('0x1')];var SmsMessage=require(_0xd425('0x2'))['db'][_0xd425('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xd425('0x4')](0x0);var events={'afterCreate':_0xd425('0x5'),'afterUpdate':_0xd425('0x6'),'afterDestroy':_0xd425('0x7')};function emitEvent(_0x596be7){return function(_0x2987c5,_0x454f2a,_0xc4e080){_0x2987c5[_0xd425('0x8')]({'attributes':['id'],'raw':!![]})[_0xd425('0x9')](function(_0x1d2ed0){_0x2987c5['setDataValue'](_0xd425('0xa'),_0x1d2ed0[_0xd425('0xb')](function(_0x262b02){return{'id':_0x262b02['id']};}));return SmsMessage[_0xd425('0xc')]({'where':{'SmsInteractionId':_0x2987c5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd425('0x9')](function(_0x2beb20){_0x2987c5[_0xd425('0xd')](_0xd425('0xe'),_0x2beb20[_0xd425('0xf')]);SmsInteractionEvents[_0xd425('0x10')](_0x596be7+':'+_0x2987c5['id'],_0x2987c5);SmsInteractionEvents[_0xd425('0x10')](_0x596be7,_0x2987c5);_0xc4e080(null);})[_0xd425('0x11')](_0xc4e080(null));};}for(var e in events){if(events[_0xd425('0x12')](e)){var event=events[e];SmsInteraction[_0xd425('0x13')](e,emitEvent(event));}}module[_0xd425('0x14')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 3beb3f4..39f59df 100644 --- a/server/api/smsInteraction/smsInteraction.model.js +++ b/server/api/smsInteraction/smsInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6b5=['path','rimraf','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x1d6d5f,_0x2ecd7e){var _0x2b10e8=function(_0xff43ea){while(--_0xff43ea){_0x1d6d5f['push'](_0x1d6d5f['shift']());}};_0x2b10e8(++_0x2ecd7e);}(_0xd6b5,0x1cb));var _0x5d6b=function(_0x3a4b7f,_0x5b9726){_0x3a4b7f=_0x3a4b7f-0x0;var _0x542e8a=_0xd6b5[_0x3a4b7f];return _0x542e8a;};'use strict';var _=require(_0x5d6b('0x0'));var util=require(_0x5d6b('0x1'));var logger=require(_0x5d6b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5d6b('0x3'));var rp=require(_0x5d6b('0x4'));var fs=require('fs');var path=require(_0x5d6b('0x5'));var rimraf=require(_0x5d6b('0x6'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0x5d6b('0x7')]=function(_0x56889f,_0x19f4c0){return _0x56889f[_0x5d6b('0x8')](_0x5d6b('0x9'),attributes,{'tableName':_0x5d6b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x413f73,_0x1a548c,_0x3a6530){if(_0x413f73[_0x5d6b('0xb')](_0x5d6b('0xc'))){_0x413f73[_0x5d6b('0xd')]=moment()[_0x5d6b('0xe')](_0x5d6b('0xf'));}_0x3a6530(null,_0x413f73);}}});}; \ No newline at end of file +var _0x7234=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','SmsInteraction','sms_interactions','changed','closedAt'];(function(_0x485d50,_0x39d09b){var _0x446ce6=function(_0x2641e2){while(--_0x2641e2){_0x485d50['push'](_0x485d50['shift']());}};_0x446ce6(++_0x39d09b);}(_0x7234,0x172));var _0x4723=function(_0x4a5246,_0x4c8890){_0x4a5246=_0x4a5246-0x0;var _0x55eaba=_0x7234[_0x4a5246];return _0x55eaba;};'use strict';var _=require(_0x4723('0x0'));var util=require(_0x4723('0x1'));var logger=require(_0x4723('0x2'))(_0x4723('0x3'));var moment=require(_0x4723('0x4'));var BPromise=require('bluebird');var rp=require(_0x4723('0x5'));var fs=require('fs');var path=require(_0x4723('0x6'));var rimraf=require(_0x4723('0x7'));var config=require(_0x4723('0x8'));var attributes=require('./smsInteraction.attributes');module[_0x4723('0x9')]=function(_0x2ae064,_0x84e6e3){return _0x2ae064['define'](_0x4723('0xa'),attributes,{'tableName':_0x4723('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x53826c,_0xc52cb3,_0x24c3e3){if(_0x53826c[_0x4723('0xc')]('closed')){_0x53826c[_0x4723('0xd')]=moment()[_0x4723('0xe')](_0x4723('0xf'));}_0x24c3e3(null,_0x53826c);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index e60334d..e5274b9 100644 --- a/server/api/smsInteraction/smsInteraction.rpc.js +++ b/server/api/smsInteraction/smsInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda42=['rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x38a76c,_0x33f538){var _0x4c863b=function(_0x2cca2b){while(--_0x2cca2b){_0x38a76c['push'](_0x38a76c['shift']());}};_0x4c863b(++_0x33f538);}(_0xda42,0x18d));var _0x2da4=function(_0x8e2e31,_0x57d256){_0x8e2e31=_0x8e2e31-0x0;var _0x4eada1=_0xda42[_0x8e2e31];return _0x4eada1;};'use strict';var _=require(_0x2da4('0x0'));var util=require(_0x2da4('0x1'));var moment=require('moment');var BPromise=require(_0x2da4('0x2'));var rs=require(_0x2da4('0x3'));var fs=require('fs');var Redis=require(_0x2da4('0x4'));var db=require(_0x2da4('0x5'))['db'];var utils=require(_0x2da4('0x6'));var logger=require(_0x2da4('0x7'))(_0x2da4('0x8'));var config=require('../../config/environment');var jayson=require(_0x2da4('0x9'));var client=jayson[_0x2da4('0xa')][_0x2da4('0xb')]({'port':0x232a});config['redis']=_[_0x2da4('0xc')](config[_0x2da4('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x2da4('0xe'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x2da4('0xf')](socket);function respondWithRpcPromise(_0x11e131,_0x1f534a,_0xb39225){return new BPromise(function(_0x560718,_0x1e8168){return client[_0x2da4('0x10')](_0x11e131,_0xb39225)['then'](function(_0x33fbb6){logger[_0x2da4('0x11')](_0x2da4('0x12'),_0x1f534a,_0x2da4('0x13'));logger[_0x2da4('0x14')](_0x2da4('0x15'),_0x1f534a,_0x2da4('0x13'),JSON[_0x2da4('0x16')](_0x33fbb6));if(_0x33fbb6[_0x2da4('0x17')]){if(_0x33fbb6[_0x2da4('0x17')][_0x2da4('0x18')]===0x1f4){logger[_0x2da4('0x17')](_0x2da4('0x12'),_0x1f534a,_0x33fbb6[_0x2da4('0x17')]['message']);return _0x1e8168(_0x33fbb6[_0x2da4('0x17')][_0x2da4('0x19')]);}logger[_0x2da4('0x17')](_0x2da4('0x12'),_0x1f534a,_0x33fbb6[_0x2da4('0x17')]['message']);return _0x560718(_0x33fbb6[_0x2da4('0x17')][_0x2da4('0x19')]);}else{logger[_0x2da4('0x11')](_0x2da4('0x12'),_0x1f534a,_0x2da4('0x13'));_0x560718(_0x33fbb6[_0x2da4('0x1a')][_0x2da4('0x19')]);}})[_0x2da4('0x1b')](function(_0x501303){logger[_0x2da4('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x1f534a,_0x501303);_0x1e8168(_0x501303);});});}exports[_0x2da4('0x1c')]=function(_0x2d7c31){var _0x4774e5=this;return new Promise(function(_0x334c40,_0x208e14){return db[_0x2da4('0x1d')][_0x2da4('0x1e')](_0x2d7c31[_0x2da4('0x1f')],{'raw':_0x2d7c31[_0x2da4('0x20')]?_0x2d7c31['options'][_0x2da4('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d7c31[_0x2da4('0x20')]?_0x2d7c31[_0x2da4('0x20')][_0x2da4('0x22')]||null:null,'attributes':_0x2d7c31[_0x2da4('0x20')]?_0x2d7c31[_0x2da4('0x20')][_0x2da4('0x23')]||null:null,'limit':_0x2d7c31[_0x2da4('0x20')]?_0x2d7c31[_0x2da4('0x20')][_0x2da4('0x24')]||null:null})[_0x2da4('0x25')](function(_0x3e63c4){logger[_0x2da4('0x11')]('UpdateSmsInteraction',_0x2d7c31);logger[_0x2da4('0x14')](_0x2da4('0x1c'),_0x2d7c31,JSON[_0x2da4('0x16')](_0x3e63c4));_0x334c40(_0x3e63c4);})[_0x2da4('0x1b')](function(_0x3e71af){logger[_0x2da4('0x17')](_0x2da4('0x1c'),_0x3e71af[_0x2da4('0x19')],_0x2d7c31);_0x208e14(_0x4774e5['error'](0x1f4,_0x3e71af['message']));});});};exports[_0x2da4('0x26')]=function(_0x219e1f){return new Promise(function(_0x5143b0,_0x2e1513){return db['SmsInteraction'][_0x2da4('0x27')]({'where':_0x219e1f[_0x2da4('0x20')]?_0x219e1f[_0x2da4('0x20')][_0x2da4('0x22')]||null:null})[_0x2da4('0x25')](function(_0x5aa209){if(_0x5aa209){return _0x5aa209[_0x2da4('0x28')](_0x219e1f[_0x2da4('0x1f')][_0x2da4('0x29')],_[_0x2da4('0x2a')](_0x219e1f[_0x2da4('0x1f')],['ids','id'])||{});}})[_0x2da4('0x2b')](function(_0x5574a3){logger[_0x2da4('0x11')](_0x2da4('0x2c'),_0x219e1f);logger['debug']('AddTags',_0x219e1f,JSON[_0x2da4('0x16')](_0x5574a3));_0x5143b0(_0x5574a3);})[_0x2da4('0x1b')](function(_0x353397){logger[_0x2da4('0x17')](_0x2da4('0x2c'),_0x353397['message'],_0x219e1f);_0x2e1513(_this['error'](0x1f4,_0x353397[_0x2da4('0x19')]));});});}; \ No newline at end of file +var _0xe79e=['SmsInteraction','update','body','options','raw','where','then','AddTagsToSmsInteraction','addTags','ids','omit','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','UpdateSmsInteraction'];(function(_0x3fccc3,_0x5aca80){var _0x1e4d94=function(_0x5cb768){while(--_0x5cb768){_0x3fccc3['push'](_0x3fccc3['shift']());}};_0x1e4d94(++_0x5aca80);}(_0xe79e,0x13b));var _0xee79=function(_0x49583d,_0x2e16f4){_0x49583d=_0x49583d-0x0;var _0x4bf479=_0xe79e[_0x49583d];return _0x4bf479;};'use strict';var _=require(_0xee79('0x0'));var util=require(_0xee79('0x1'));var moment=require(_0xee79('0x2'));var BPromise=require(_0xee79('0x3'));var rs=require(_0xee79('0x4'));var fs=require('fs');var Redis=require(_0xee79('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xee79('0x6'));var logger=require(_0xee79('0x7'))(_0xee79('0x8'));var config=require(_0xee79('0x9'));var jayson=require(_0xee79('0xa'));var client=jayson[_0xee79('0xb')][_0xee79('0xc')]({'port':0x232a});config[_0xee79('0xd')]=_['defaults'](config[_0xee79('0xd')],{'host':_0xee79('0xe'),'port':0x18eb});var socket=require(_0xee79('0xf'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xee79('0x10')](socket);function respondWithRpcPromise(_0x3a8770,_0x24e866,_0x40b7aa){return new BPromise(function(_0x1559d3,_0x727c7e){return client[_0xee79('0x11')](_0x3a8770,_0x40b7aa)['then'](function(_0x1c7247){logger[_0xee79('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x24e866,_0xee79('0x13'));logger[_0xee79('0x14')](_0xee79('0x15'),_0x24e866,_0xee79('0x13'),JSON[_0xee79('0x16')](_0x1c7247));if(_0x1c7247[_0xee79('0x17')]){if(_0x1c7247[_0xee79('0x17')][_0xee79('0x18')]===0x1f4){logger[_0xee79('0x17')](_0xee79('0x19'),_0x24e866,_0x1c7247[_0xee79('0x17')][_0xee79('0x1a')]);return _0x727c7e(_0x1c7247[_0xee79('0x17')][_0xee79('0x1a')]);}logger[_0xee79('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x24e866,_0x1c7247[_0xee79('0x17')][_0xee79('0x1a')]);return _0x1559d3(_0x1c7247[_0xee79('0x17')][_0xee79('0x1a')]);}else{logger[_0xee79('0x12')](_0xee79('0x19'),_0x24e866,_0xee79('0x13'));_0x1559d3(_0x1c7247[_0xee79('0x1b')][_0xee79('0x1a')]);}})['catch'](function(_0x8dc463){logger[_0xee79('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x24e866,_0x8dc463);_0x727c7e(_0x8dc463);});});}exports[_0xee79('0x1c')]=function(_0xa057a){var _0xfe8096=this;return new Promise(function(_0x5de943,_0x3ab51d){return db[_0xee79('0x1d')][_0xee79('0x1e')](_0xa057a[_0xee79('0x1f')],{'raw':_0xa057a[_0xee79('0x20')]?_0xa057a[_0xee79('0x20')][_0xee79('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa057a['options']?_0xa057a[_0xee79('0x20')][_0xee79('0x22')]||null:null,'attributes':_0xa057a['options']?_0xa057a[_0xee79('0x20')]['attributes']||null:null,'limit':_0xa057a[_0xee79('0x20')]?_0xa057a['options']['limit']||null:null})[_0xee79('0x23')](function(_0x51449f){logger['info'](_0xee79('0x1c'),_0xa057a);logger[_0xee79('0x14')](_0xee79('0x1c'),_0xa057a,JSON[_0xee79('0x16')](_0x51449f));_0x5de943(_0x51449f);})['catch'](function(_0x4896ce){logger[_0xee79('0x17')]('UpdateSmsInteraction',_0x4896ce['message'],_0xa057a);_0x3ab51d(_0xfe8096['error'](0x1f4,_0x4896ce['message']));});});};exports[_0xee79('0x24')]=function(_0x5f0cf9){return new Promise(function(_0x4df16f,_0x38ffc1){return db['SmsInteraction']['find']({'where':_0x5f0cf9[_0xee79('0x20')]?_0x5f0cf9[_0xee79('0x20')][_0xee79('0x22')]||null:null})[_0xee79('0x23')](function(_0x245597){if(_0x245597){return _0x245597[_0xee79('0x25')](_0x5f0cf9[_0xee79('0x1f')][_0xee79('0x26')],_[_0xee79('0x27')](_0x5f0cf9[_0xee79('0x1f')],['ids','id'])||{});}})[_0xee79('0x28')](function(_0x390e77){logger[_0xee79('0x12')](_0xee79('0x29'),_0x5f0cf9);logger[_0xee79('0x14')]('AddTags',_0x5f0cf9,JSON[_0xee79('0x16')](_0x390e77));_0x4df16f(_0x390e77);})[_0xee79('0x2a')](function(_0x53476b){logger['error'](_0xee79('0x29'),_0x53476b['message'],_0x5f0cf9);_0x38ffc1(_this[_0xee79('0x17')](0x1f4,_0x53476b[_0xee79('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 68c2e0b..e2cf01e 100644 --- a/server/api/smsInteraction/smsInteraction.socket.js +++ b/server/api/smsInteraction/smsInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['save','remove','emit','removeListener','register','smsInteraction:'];(function(_0xc2371e,_0x457fa6){var _0x18d6b3=function(_0x5b0822){while(--_0x5b0822){_0xc2371e['push'](_0xc2371e['shift']());}};_0x18d6b3(++_0x457fa6);}(_0x757a,0xde));var _0xa757=function(_0x504588,_0x256cf8){_0x504588=_0x504588-0x0;var _0x3a4c8e=_0x757a[_0x504588];return _0x3a4c8e;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xa757('0x0'),_0xa757('0x1'),'update'];function createListener(_0x5c03c3,_0x5709ed){return function(_0x32be3b){_0x5709ed[_0xa757('0x2')](_0x5c03c3,_0x32be3b);};}function removeListener(_0x1c2932,_0x453d07){return function(){SmsInteractionEvents[_0xa757('0x3')](_0x1c2932,_0x453d07);};}exports[_0xa757('0x4')]=function(_0x5edca8){for(var _0xae0e7c=0x0,_0x4343b6=events['length'];_0xae0e7c<_0x4343b6;_0xae0e7c++){var _0x2930fa=events[_0xae0e7c];var _0x2f7793=createListener(_0xa757('0x5')+_0x2930fa,_0x5edca8);SmsInteractionEvents['on'](_0x2930fa,_0x2f7793);}}; \ No newline at end of file +var _0xb7e7=['remove','removeListener','length','smsInteraction:','./smsInteraction.events'];(function(_0x5b053,_0x4c5e52){var _0x42695b=function(_0x828e05){while(--_0x828e05){_0x5b053['push'](_0x5b053['shift']());}};_0x42695b(++_0x4c5e52);}(_0xb7e7,0x121));var _0x7b7e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb7e7[_0x21a9d9];return _0x46adce;};'use strict';var SmsInteractionEvents=require(_0x7b7e('0x0'));var events=['save',_0x7b7e('0x1'),'update'];function createListener(_0x1b7cc7,_0x54a37f){return function(_0x3f5804){_0x54a37f['emit'](_0x1b7cc7,_0x3f5804);};}function removeListener(_0x31d0ed,_0x118577){return function(){SmsInteractionEvents[_0x7b7e('0x2')](_0x31d0ed,_0x118577);};}exports['register']=function(_0x53ed64){for(var _0x333fa4=0x0,_0x372bde=events[_0x7b7e('0x3')];_0x333fa4<_0x372bde;_0x333fa4++){var _0x55ce81=events[_0x333fa4];var _0x42b871=createListener(_0x7b7e('0x4')+_0x55ce81,_0x53ed64);SmsInteractionEvents['on'](_0x55ce81,_0x42b871);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 7c65a2e..341368b 100644 --- a/server/api/smsMessage/index.js +++ b/server/api/smsMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8df7=['Router','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','/:id','show','post','sms','smsmessage:create','/:id/status','status','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','path','express'];(function(_0x4fa964,_0x301f8b){var _0x3f27c1=function(_0x25de77){while(--_0x25de77){_0x4fa964['push'](_0x4fa964['shift']());}};_0x3f27c1(++_0x301f8b);}(_0x8df7,0x17d));var _0x78df=function(_0x14918b,_0x4660dd){_0x14918b=_0x14918b-0x0;var _0x1a34b2=_0x8df7[_0x14918b];return _0x1a34b2;};'use strict';var multer=require('multer');var util=require(_0x78df('0x0'));var path=require(_0x78df('0x1'));var timeout=require('connect-timeout');var express=require(_0x78df('0x2'));var router=express[_0x78df('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x78df('0x4'));var config=require(_0x78df('0x5'));var controller=require(_0x78df('0x6'));router[_0x78df('0x7')]('/',auth[_0x78df('0x8')](),controller['index']);router[_0x78df('0x7')](_0x78df('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x78df('0x7')](_0x78df('0xa'),auth[_0x78df('0x8')](),controller[_0x78df('0xb')]);router[_0x78df('0xc')]('/',auth[_0x78df('0x8')](),interaction['tracked'](_0x78df('0xd'),_0x78df('0xe')),controller['create']);router[_0x78df('0xc')](_0x78df('0xf'),controller[_0x78df('0x10')]);router[_0x78df('0x11')]('/:id',auth[_0x78df('0x8')](),controller['update']);router[_0x78df('0x11')](_0x78df('0x12'),auth[_0x78df('0x8')](),controller['accept']);router[_0x78df('0x11')](_0x78df('0x13'),auth['isAuthenticated'](),controller[_0x78df('0x14')]);router[_0x78df('0x15')]('/:id',auth[_0x78df('0x8')](),controller[_0x78df('0x16')]);module[_0x78df('0x17')]=router; \ No newline at end of file +var _0x840b=['./smsMessage.controller','get','isAuthenticated','index','/:id','show','smsmessage:create','create','post','/:id/status','status','put','update','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2ddb97,_0x53ec41){var _0x488a53=function(_0x4bd8c0){while(--_0x4bd8c0){_0x2ddb97['push'](_0x2ddb97['shift']());}};_0x488a53(++_0x53ec41);}(_0x840b,0x1a2));var _0xb840=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x840b[_0x166742];return _0xb7814a;};'use strict';var multer=require(_0xb840('0x0'));var util=require('util');var path=require(_0xb840('0x1'));var timeout=require(_0xb840('0x2'));var express=require(_0xb840('0x3'));var router=express['Router']();var auth=require(_0xb840('0x4'));var interaction=require(_0xb840('0x5'));var config=require(_0xb840('0x6'));var controller=require(_0xb840('0x7'));router[_0xb840('0x8')]('/',auth[_0xb840('0x9')](),controller[_0xb840('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xb840('0x8')](_0xb840('0xb'),auth[_0xb840('0x9')](),controller[_0xb840('0xc')]);router['post']('/',auth[_0xb840('0x9')](),interaction['tracked']('sms',_0xb840('0xd')),controller[_0xb840('0xe')]);router[_0xb840('0xf')](_0xb840('0x10'),controller[_0xb840('0x11')]);router[_0xb840('0x12')](_0xb840('0xb'),auth[_0xb840('0x9')](),controller[_0xb840('0x13')]);router[_0xb840('0x12')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router['put'](_0xb840('0x14'),auth['isAuthenticated'](),controller[_0xb840('0x15')]);router[_0xb840('0x16')]('/:id',auth[_0xb840('0x9')](),controller[_0xb840('0x17')]);module[_0xb840('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 45794cf..6352ef7 100644 --- a/server/api/smsMessage/smsMessage.attributes.js +++ b/server/api/smsMessage/smsMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xface=['exports','medium','out','STRING','DATE','BOOLEAN','sequelize'];(function(_0xa96842,_0x571f0e){var _0x187414=function(_0x540907){while(--_0x540907){_0xa96842['push'](_0xa96842['shift']());}};_0x187414(++_0x571f0e);}(_0xface,0x14f));var _0xefac=function(_0x16fc1a,_0x1cda31){_0x16fc1a=_0x16fc1a-0x0;var _0xbf1ee2=_0xface[_0x16fc1a];return _0xbf1ee2;};'use strict';var Sequelize=require(_0xefac('0x0'));module[_0xefac('0x1')]={'body':{'type':Sequelize['TEXT'](_0xefac('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xefac('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xefac('0x4')](0xbe)},'phone':{'type':Sequelize[_0xefac('0x4')]},'readAt':{'type':Sequelize[_0xefac('0x5')]},'secret':{'type':Sequelize[_0xefac('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x9f51=['BOOLEAN','out','STRING','DATE','exports','TEXT','medium'];(function(_0x10729e,_0x273b3d){var _0x57a4f8=function(_0x522036){while(--_0x522036){_0x10729e['push'](_0x10729e['shift']());}};_0x57a4f8(++_0x273b3d);}(_0x9f51,0x1af));var _0x19f5=function(_0x529abc,_0x17b97e){_0x529abc=_0x529abc-0x0;var _0x453afa=_0x9f51[_0x529abc];return _0x453afa;};'use strict';var Sequelize=require('sequelize');module[_0x19f5('0x0')]={'body':{'type':Sequelize[_0x19f5('0x1')](_0x19f5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x19f5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x19f5('0x4')),'defaultValue':_0x19f5('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x19f5('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x19f5('0x6')]},'secret':{'type':Sequelize[_0x19f5('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3910539..3732f33 100644 --- a/server/api/smsMessage/smsMessage.controller.js +++ b/server/api/smsMessage/smsMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','index','SmsMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','field','options','then','includeAll','include','findAll','rows','show','length','find','create','body','params','describe','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','SmsInteraction','isNil','interaction','get','role','null','AcceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','sms-interactions','reject','agent','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','interface','SmsAccount','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x152999,_0x1dd83b){var _0x32ef67=function(_0xe8dc18){while(--_0xe8dc18){_0x152999['push'](_0x152999['shift']());}};_0x32ef67(++_0x1dd83b);}(_0x6aa7,0x178));var _0x76aa=function(_0x27bf38,_0x1c6015){_0x27bf38=_0x27bf38-0x0;var _0x361534=_0x6aa7[_0x27bf38];return _0x361534;};'use strict';var pdf=require(_0x76aa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x76aa('0x1'));var zipdir=require(_0x76aa('0x2'));var jsonpatch=require(_0x76aa('0x3'));var rp=require(_0x76aa('0x4'));var moment=require('moment');var BPromise=require(_0x76aa('0x5'));var Mustache=require(_0x76aa('0x6'));var util=require(_0x76aa('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x76aa('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0x8'));var querystring=require(_0x76aa('0xd'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xe'));var authService=require(_0x76aa('0xf'));var qs=require(_0x76aa('0x10'));var hardwareService=require(_0x76aa('0x11'));var logger=require(_0x76aa('0x12'))(_0x76aa('0x13'));var utils=require(_0x76aa('0x14'));var config=require(_0x76aa('0x15'));var db=require(_0x76aa('0x16'))['db'];config[_0x76aa('0x17')]=_['defaults'](config[_0x76aa('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0x18'))(new Redis(config[_0x76aa('0x17')]));require(_0x76aa('0x19'))[_0x76aa('0x1a')](socket);var jayson=require(_0x76aa('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x76aa('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x180d92,_0x319bf1,_0x5cf594){if(_0x5cf594){var _0x2111c7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2111c7['test'](_0x319bf1)){return _0x180d92;}else{throw new Error(_0x76aa('0x1d'));}}else{return _0x180d92;}}function respondWithRpcPromise(_0x5181d2,_0x1515e9,_0x413cf6,_0x2ab30b){return new BPromise(function(_0x21c16d,_0xa1bc7){var _0x3ead3f=_0x2ab30b||client;return _0x3ead3f['request'](_0x5181d2,_0x413cf6)['then'](function(_0x256636){logger[_0x76aa('0x1e')](_0x76aa('0x1f'),_0x1515e9,_0x76aa('0x20'));logger[_0x76aa('0x21')](_0x76aa('0x22'),_0x1515e9,_0x76aa('0x20'),JSON[_0x76aa('0x23')](_0x256636));if(_0x256636[_0x76aa('0x24')]){if(_0x256636['error'][_0x76aa('0x25')]===0x1f4){logger[_0x76aa('0x24')](_0x76aa('0x1f'),_0x1515e9,_0x256636['error'][_0x76aa('0x26')]);return _0xa1bc7(_0x256636[_0x76aa('0x24')][_0x76aa('0x26')]);}logger[_0x76aa('0x24')](_0x76aa('0x1f'),_0x1515e9,_0x256636[_0x76aa('0x24')][_0x76aa('0x26')]);return _0x21c16d(_0x256636[_0x76aa('0x24')][_0x76aa('0x26')]);}else{logger[_0x76aa('0x1e')](_0x76aa('0x1f'),_0x1515e9,_0x76aa('0x20'));_0x21c16d(_0x256636[_0x76aa('0x27')]['message']);}})[_0x76aa('0x28')](function(_0x1d6d15){logger[_0x76aa('0x24')](_0x76aa('0x1f'),_0x1515e9,_0x1d6d15);_0xa1bc7(_0x1d6d15);});});}function respondWithStatusCode(_0xa1e6,_0x2f9316){_0x2f9316=_0x2f9316||0xcc;return function(_0x25a803){if(_0x25a803){return _0xa1e6[_0x76aa('0x29')](_0x2f9316);}return _0xa1e6[_0x76aa('0x2a')](_0x2f9316)[_0x76aa('0x2b')]();};}function respondWithResult(_0x545b06,_0x3fcb7f){_0x3fcb7f=_0x3fcb7f||0xc8;return function(_0x5a8030){if(_0x5a8030){return _0x545b06[_0x76aa('0x2a')](_0x3fcb7f)[_0x76aa('0x2c')](_0x5a8030);}};}function respondWithFilteredResult(_0x2dec94,_0x1e90b9){return function(_0x1eecd9){if(_0x1eecd9){var _0x2d6213=_0x1eecd9[_0x76aa('0x2d')],_0x2ee0f9=_0x1e90b9['offset'],_0x3827ec=_0x1e90b9[_0x76aa('0x2e')]+_0x1e90b9[_0x76aa('0x2f')],_0x19fd4f;if(_0x3827ec>=_0x2d6213){_0x3827ec=_0x2d6213;_0x19fd4f=0xc8;}else{_0x19fd4f=0xce;}_0x2dec94[_0x76aa('0x2a')](_0x19fd4f);return _0x2dec94[_0x76aa('0x30')](_0x76aa('0x31'),_0x2ee0f9+'-'+_0x3827ec+'/'+_0x2d6213)[_0x76aa('0x2c')](_0x1eecd9);}return null;};}function patchUpdates(_0x35a705){return function(_0x4eb57a){try{jsonpatch[_0x76aa('0x32')](_0x4eb57a,_0x35a705,!![]);}catch(_0x25a11f){return BPromise['reject'](_0x25a11f);}return _0x4eb57a[_0x76aa('0x33')]();};}function saveUpdates(_0x58d860,_0x2e2ba3){return function(_0x4c90b6){if(_0x4c90b6){return _0x4c90b6[_0x76aa('0x34')](_0x58d860)['then'](function(_0x58f135){return _0x58f135;});}return null;};}function removeEntity(_0x1aa182,_0x282c56){return function(_0x198fcb){if(_0x198fcb){return _0x198fcb[_0x76aa('0x35')]()['then'](function(){_0x1aa182['status'](0xcc)[_0x76aa('0x2b')]();});}};}function handleEntityNotFound(_0x1c7b6f,_0x58127c){return function(_0x23e2fd){if(!_0x23e2fd){_0x1c7b6f[_0x76aa('0x29')](0x194);}return _0x23e2fd;};}function handleError(_0x5b57d8,_0x9ce5f4){_0x9ce5f4=_0x9ce5f4||0x1f4;return function(_0x5c77f1){logger['error'](_0x5c77f1[_0x76aa('0x36')]);if(_0x5c77f1[_0x76aa('0x37')]){delete _0x5c77f1[_0x76aa('0x37')];}_0x5b57d8[_0x76aa('0x2a')](_0x9ce5f4)['send'](_0x5c77f1);};}exports[_0x76aa('0x38')]=function(_0x1c22f7,_0x2eea79){var _0x4e131a={},_0x113770={},_0x1638db={'count':0x0,'rows':[]};var _0x2f7726=db[_0x76aa('0x39')][_0x76aa('0x3a')];_0x113770[_0x76aa('0x3b')]=_[_0x76aa('0x3c')](_0x2f7726);_0x113770[_0x76aa('0x3d')]=_[_0x76aa('0x3c')](_0x1c22f7['query']);_0x113770[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x113770[_0x76aa('0x3b')],_0x113770[_0x76aa('0x3d')]);_0x4e131a[_0x76aa('0x40')]=_[_0x76aa('0x3f')](_0x113770['model'],qs['fields'](_0x1c22f7[_0x76aa('0x3d')][_0x76aa('0x41')]));_0x4e131a[_0x76aa('0x40')]=_0x4e131a[_0x76aa('0x40')]['length']?_0x4e131a[_0x76aa('0x40')]:_0x113770[_0x76aa('0x3b')];if(!_0x1c22f7[_0x76aa('0x3d')][_0x76aa('0x42')](_0x76aa('0x43'))){_0x4e131a['limit']=qs[_0x76aa('0x2f')](_0x1c22f7['query'][_0x76aa('0x2f')]);_0x4e131a['offset']=qs['offset'](_0x1c22f7['query'][_0x76aa('0x2e')]);}_0x4e131a['order']=qs['sort'](_0x1c22f7['query'][_0x76aa('0x44')]);_0x4e131a[_0x76aa('0x45')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x46')](_0x1c22f7[_0x76aa('0x3d')],_0x113770['filters']));if(_0x1c22f7[_0x76aa('0x3d')][_0x76aa('0x47')]){_0x4e131a[_0x76aa('0x45')]=_[_0x76aa('0x48')](_0x4e131a[_0x76aa('0x45')],{'$or':_['map'](_0x2f7726,function(_0x2f695c){if(_0x2f695c[_0x76aa('0x49')]['key']!==_0x76aa('0x4a')){var _0x5a984e={};_0x5a984e[_0x2f695c[_0x76aa('0x4b')]]={'$like':'%'+_0x1c22f7[_0x76aa('0x3d')][_0x76aa('0x47')]+'%'};return _0x5a984e;}})});}_0x4e131a=_[_0x76aa('0x48')]({},_0x4e131a,_0x1c22f7[_0x76aa('0x4c')]);var _0x3e0315={'where':_0x4e131a[_0x76aa('0x45')]};return db[_0x76aa('0x39')][_0x76aa('0x2d')](_0x3e0315)[_0x76aa('0x4d')](function(_0x5e4967){_0x1638db[_0x76aa('0x2d')]=_0x5e4967;if(_0x1c22f7['query'][_0x76aa('0x4e')]){_0x4e131a[_0x76aa('0x4f')]=[{'all':!![]}];}return db[_0x76aa('0x39')][_0x76aa('0x50')](_0x4e131a);})['then'](function(_0x5a3d9c){_0x1638db[_0x76aa('0x51')]=_0x5a3d9c;return _0x1638db;})['then'](respondWithFilteredResult(_0x2eea79,_0x4e131a))[_0x76aa('0x28')](handleError(_0x2eea79,null));};exports[_0x76aa('0x52')]=function(_0x4315b3,_0x2e5633){var _0x30c577={'raw':!![],'where':{'id':_0x4315b3['params']['id']}},_0x110f3c={};_0x110f3c['model']=_[_0x76aa('0x3c')](db[_0x76aa('0x39')][_0x76aa('0x3a')]);_0x110f3c[_0x76aa('0x3d')]=_[_0x76aa('0x3c')](_0x4315b3[_0x76aa('0x3d')]);_0x110f3c['filters']=_[_0x76aa('0x3f')](_0x110f3c[_0x76aa('0x3b')],_0x110f3c[_0x76aa('0x3d')]);_0x30c577['attributes']=_[_0x76aa('0x3f')](_0x110f3c['model'],qs[_0x76aa('0x41')](_0x4315b3['query'][_0x76aa('0x41')]));_0x30c577[_0x76aa('0x40')]=_0x30c577[_0x76aa('0x40')][_0x76aa('0x53')]?_0x30c577[_0x76aa('0x40')]:_0x110f3c[_0x76aa('0x3b')];if(_0x4315b3[_0x76aa('0x3d')]['includeAll']){_0x30c577[_0x76aa('0x4f')]=[{'all':!![]}];}_0x30c577=_['merge']({},_0x30c577,_0x4315b3[_0x76aa('0x4c')]);return db[_0x76aa('0x39')][_0x76aa('0x54')](_0x30c577)[_0x76aa('0x4d')](handleEntityNotFound(_0x2e5633,null))[_0x76aa('0x4d')](respondWithResult(_0x2e5633,null))[_0x76aa('0x28')](handleError(_0x2e5633,null));};exports[_0x76aa('0x55')]=function(_0x57941d,_0x333a3a){return db[_0x76aa('0x39')][_0x76aa('0x55')](_0x57941d[_0x76aa('0x56')],{})['then'](respondWithResult(_0x333a3a,0xc9))[_0x76aa('0x28')](handleError(_0x333a3a,null));};exports[_0x76aa('0x34')]=function(_0x8dc601,_0x410933){if(_0x8dc601[_0x76aa('0x56')]['id']){delete _0x8dc601[_0x76aa('0x56')]['id'];}return db['SmsMessage'][_0x76aa('0x54')]({'where':{'id':_0x8dc601[_0x76aa('0x57')]['id']}})[_0x76aa('0x4d')](handleEntityNotFound(_0x410933,null))[_0x76aa('0x4d')](saveUpdates(_0x8dc601[_0x76aa('0x56')],null))[_0x76aa('0x4d')](respondWithResult(_0x410933,null))[_0x76aa('0x28')](handleError(_0x410933,null));};exports['destroy']=function(_0x4910fb,_0x2c59a6){return db[_0x76aa('0x39')]['find']({'where':{'id':_0x4910fb[_0x76aa('0x57')]['id']}})[_0x76aa('0x4d')](handleEntityNotFound(_0x2c59a6,null))['then'](removeEntity(_0x2c59a6,null))[_0x76aa('0x28')](handleError(_0x2c59a6,null));};exports[_0x76aa('0x58')]=function(_0x1928c2,_0x22de7c){return db[_0x76aa('0x39')][_0x76aa('0x58')]()[_0x76aa('0x4d')](respondWithResult(_0x22de7c,null))[_0x76aa('0x28')](handleError(_0x22de7c,null));};var interaction_log=require(_0x76aa('0x12'))('sms-interactions');exports[_0x76aa('0x59')]=function(_0x49156c,_0x40e746,_0x46dbac){var _0x2fef92={'channel':_0x76aa('0x5a')};if(_0x49156c[_0x76aa('0x56')]['id']){delete _0x49156c[_0x76aa('0x56')]['id'];}_0x49156c[_0x76aa('0x56')][_0x76aa('0x5b')]=!![];_0x49156c[_0x76aa('0x56')]['readAt']=moment()[_0x76aa('0x5c')](_0x76aa('0x5d'));_0x49156c[_0x76aa('0x56')][_0x76aa('0x5e')]=_0x49156c[_0x76aa('0x56')][_0x76aa('0x5e')]||_0x49156c[_0x76aa('0x5f')]['id'];return db[_0x76aa('0x39')]['find']({'where':{'id':_0x49156c[_0x76aa('0x57')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x76aa('0x60')}]})[_0x76aa('0x4d')](handleEntityNotFound(_0x40e746,null))[_0x76aa('0x4d')](saveUpdates(_0x49156c[_0x76aa('0x56')],null))[_0x76aa('0x4d')](function(_0x234dc4){if(_0x234dc4){_0x2fef92[_0x76aa('0x26')]=_0x234dc4['get']({'plain':!![]});return db[_0x76aa('0x61')][_0x76aa('0x54')]({'where':{'id':_0x234dc4['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x40e746,null))[_0x76aa('0x4d')](function(_0x13389d){if(_0x13389d){return _0x13389d['update']({'UserId':_0x49156c[_0x76aa('0x56')][_0x76aa('0x5e')],'read1stAt':_[_0x76aa('0x62')](_0x13389d['read1stAt'])?moment()[_0x76aa('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x76aa('0x4d')](function(_0x1178e5){if(_0x1178e5){_0x2fef92[_0x76aa('0x63')]=_0x1178e5[_0x76aa('0x64')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x49156c[_0x76aa('0x5f')]['id'],_0x49156c['user'][_0x76aa('0x37')],_0x49156c[_0x76aa('0x5f')][_0x76aa('0x65')],_0x2fef92[_0x76aa('0x63')]['id'],_0x49156c[_0x76aa('0x56')]?JSON[_0x76aa('0x23')](_0x49156c[_0x76aa('0x56')]):_0x76aa('0x66'));return respondWithRpcPromise(_0x76aa('0x67'),'acceptMessage',_0x2fef92);}return null;})[_0x76aa('0x4d')](function(_0x1eadee){if(_0x1eadee){if(_0x49156c[_0x76aa('0x56')][_0x76aa('0x68')]){_0x2fef92['message']['interface']=util['format'](_0x76aa('0x69'),_0x49156c['user'][_0x76aa('0x37')]);_0x2fef92[_0x76aa('0x26')][_0x76aa('0x6a')]=_0x2fef92[_0x76aa('0x6a')];_0x2fef92['message'][_0x76aa('0x6b')]='accept';return respondWithRpcPromise(_0x76aa('0x6c'),_0x76aa('0x6c'),{'event':_0x76aa('0x6d'),'message':_0x2fef92[_0x76aa('0x26')]},client9002)[_0x76aa('0x4d')](function(){return _0x2fef92;});}return _0x2fef92;}return null;})['then'](respondWithResult(_0x40e746,null))[_0x76aa('0x28')](handleError(_0x40e746,null));};var interaction_log=require(_0x76aa('0x12'))(_0x76aa('0x6e'));exports[_0x76aa('0x6f')]=function(_0x32c1de,_0x22432d,_0x1d9c6e){var _0x18c88a={'agent':{},'channel':'sms'};if(_0x32c1de[_0x76aa('0x56')]['id']){delete _0x32c1de[_0x76aa('0x56')]['id'];}_0x32c1de['body'][_0x76aa('0x5e')]=_0x32c1de[_0x76aa('0x56')][_0x76aa('0x5e')]||_0x32c1de[_0x76aa('0x5f')]['id'];_0x18c88a[_0x76aa('0x70')]['id']=_0x32c1de[_0x76aa('0x56')][_0x76aa('0x5e')];return db['SmsMessage'][_0x76aa('0x54')]({'where':{'id':_0x32c1de['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x22432d,null))[_0x76aa('0x4d')](function(_0x98e574){if(_0x98e574){_0x18c88a['message']=_0x98e574['get']({'plain':!![]});return db[_0x76aa('0x61')][_0x76aa('0x54')]({'where':{'id':_0x98e574[_0x76aa('0x71')]}});}return null;})['then'](handleEntityNotFound(_0x22432d,null))['then'](function(_0x17efc6){if(_0x17efc6){_0x18c88a[_0x76aa('0x63')]=_0x17efc6[_0x76aa('0x64')]({'plain':!![]});interaction_log['info'](_0x76aa('0x72'),_0x32c1de['user']['id'],_0x32c1de[_0x76aa('0x5f')][_0x76aa('0x37')],_0x32c1de[_0x76aa('0x5f')][_0x76aa('0x65')],_0x18c88a[_0x76aa('0x63')]['id'],_0x32c1de['body']?JSON['stringify'](_0x32c1de[_0x76aa('0x56')]):_0x76aa('0x66'));return respondWithRpcPromise(_0x76aa('0x73'),'rejectMessage',_0x18c88a);}return null;})[_0x76aa('0x4d')](function(_0x3b6e44){if(_0x3b6e44){_0x3b6e44[_0x76aa('0x26')][_0x76aa('0x74')]=util[_0x76aa('0x5c')]('SIP/%s',_0x32c1de[_0x76aa('0x5f')]['name']);_0x3b6e44[_0x76aa('0x26')][_0x76aa('0x6a')]=_0x18c88a[_0x76aa('0x6a')];_0x3b6e44[_0x76aa('0x26')][_0x76aa('0x6b')]=_0x76aa('0x6f');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x3b6e44['message']},client9002);return _0x18c88a;}return null;})['then'](respondWithResult(_0x22432d,null))[_0x76aa('0x28')](handleError(_0x22432d,null));};exports[_0x76aa('0x2a')]=function(_0x52c5be,_0x5c2c91,_0x4f01e9){if(_0x52c5be[_0x76aa('0x56')]['id']){delete _0x52c5be[_0x76aa('0x56')]['id'];}var _0x161593;return db['SmsMessage']['find']({'where':{'id':_0x52c5be[_0x76aa('0x57')]['id']}})[_0x76aa('0x4d')](handleEntityNotFound(_0x5c2c91,null))[_0x76aa('0x4d')](function(_0x362b8e){if(_0x362b8e){_0x161593=_0x362b8e;return db[_0x76aa('0x75')]['find']({'where':{'id':_0x362b8e['SmsAccountId']}});}})[_0x76aa('0x4d')](handleEntityNotFound(_0x5c2c91,null))['then'](function(_0x5d9381){if(_0x5d9381){logger['debug'](_0x76aa('0x22'),_0x76aa('0x2a'),'received\x20delivery\x20report\x20from',_0x5d9381[_0x76aa('0x49')],util[_0x76aa('0x76')](_0x52c5be['body'],{'showHidden':![],'depth':null}));switch(_0x5d9381[_0x76aa('0x49')]){case _0x76aa('0x77'):if(_0x52c5be[_0x76aa('0x56')][_0x76aa('0x78')]&&_0x52c5be[_0x76aa('0x56')][_0x76aa('0x78')]===_0x161593[_0x76aa('0x79')]){return _0x161593[_0x76aa('0x34')]({'read':!![]});}else{logger[_0x76aa('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x76aa('0x2a'),_0x76aa('0x77'),util['inspect'](_0x52c5be[_0x76aa('0x56')],{'showHidden':![],'depth':null}));}break;case _0x76aa('0x7a'):if(_0x52c5be[_0x76aa('0x56')]['MessageUUID']&&_0x52c5be[_0x76aa('0x56')][_0x76aa('0x7b')]===_0x161593['messageId']&&_[_0x76aa('0x7c')]([_0x76aa('0x7d'),_0x76aa('0x7e')],_0x52c5be['body'][_0x76aa('0x7f')])>=0x0){return _0x161593[_0x76aa('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x76aa('0x80'),util[_0x76aa('0x76')](_0x52c5be[_0x76aa('0x56')],{'showHidden':![],'depth':null}));}break;case _0x76aa('0x81'):var _0x5d18b6=_0x52c5be['body']['results'][0x0];if(_0x5d18b6[_0x76aa('0x2a')]['groupName']===_0x76aa('0x82')){return _0x161593[_0x76aa('0x34')]({'read':!![]});}else{logger['error'](_0x76aa('0x83'),_0x76aa('0x2a'),'infobip',util[_0x76aa('0x76')](_0x52c5be[_0x76aa('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x161593;}})[_0x76aa('0x4d')](respondWithResult(_0x5c2c91,null))[_0x76aa('0x28')](handleError(_0x5c2c91,null));}; \ No newline at end of file +var _0xdb94=['code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','reject','destroy','stack','name','send','index','SmsMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','includeAll','include','findAll','rows','show','params','options','find','create','body','update','describe','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','interface','format','event','EventManager','acceptmessage','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SIP/%s','channel','rejectmessage','SmsAccount','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','messageId','sent','delivered','Status','infobip','results','groupName','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0xdb94,0xe5));var _0x4db9=function(_0x130d53,_0x26a186){_0x130d53=_0x130d53-0x0;var _0x2ff626=_0xdb94[_0x130d53];return _0x2ff626;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4db9('0x0'));var rimraf=require(_0x4db9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4db9('0x2'));var rp=require(_0x4db9('0x3'));var moment=require(_0x4db9('0x4'));var BPromise=require(_0x4db9('0x5'));var Mustache=require(_0x4db9('0x6'));var util=require('util');var path=require(_0x4db9('0x7'));var sox=require('sox');var csv=require(_0x4db9('0x8'));var ejs=require(_0x4db9('0x9'));var fs=require('fs');var _=require(_0x4db9('0xa'));var squel=require(_0x4db9('0xb'));var crypto=require(_0x4db9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4db9('0xd'));var toCsv=require(_0x4db9('0x8'));var querystring=require(_0x4db9('0xe'));var Papa=require(_0x4db9('0xf'));var Redis=require(_0x4db9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4db9('0x11'));var hardwareService=require(_0x4db9('0x12'));var logger=require(_0x4db9('0x13'))(_0x4db9('0x14'));var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var db=require('../../mysqldb')['db'];config[_0x4db9('0x17')]=_[_0x4db9('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4db9('0x19'))(new Redis(config[_0x4db9('0x17')]));require(_0x4db9('0x1a'))['register'](socket);var jayson=require(_0x4db9('0x1b'));var client=jayson[_0x4db9('0x1c')][_0x4db9('0x1d')]({'port':0x232c});var client9002=jayson[_0x4db9('0x1c')][_0x4db9('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x585230,_0x1b1062,_0x1a5a9c){if(_0x1a5a9c){var _0x5d4d70=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d4d70[_0x4db9('0x1e')](_0x1b1062)){return _0x585230;}else{throw new Error(_0x4db9('0x1f'));}}else{return _0x585230;}}function respondWithRpcPromise(_0x42fbb8,_0x481591,_0xedc513,_0x3b0863){return new BPromise(function(_0x4c5f4f,_0x50f685){var _0x493923=_0x3b0863||client;return _0x493923[_0x4db9('0x20')](_0x42fbb8,_0xedc513)[_0x4db9('0x21')](function(_0x48ff99){logger[_0x4db9('0x22')](_0x4db9('0x23'),_0x481591,_0x4db9('0x24'));logger[_0x4db9('0x25')](_0x4db9('0x26'),_0x481591,_0x4db9('0x24'),JSON[_0x4db9('0x27')](_0x48ff99));if(_0x48ff99[_0x4db9('0x28')]){if(_0x48ff99[_0x4db9('0x28')][_0x4db9('0x29')]===0x1f4){logger[_0x4db9('0x28')](_0x4db9('0x23'),_0x481591,_0x48ff99['error'][_0x4db9('0x2a')]);return _0x50f685(_0x48ff99[_0x4db9('0x28')]['message']);}logger[_0x4db9('0x28')](_0x4db9('0x23'),_0x481591,_0x48ff99[_0x4db9('0x28')][_0x4db9('0x2a')]);return _0x4c5f4f(_0x48ff99['error'][_0x4db9('0x2a')]);}else{logger['info'](_0x4db9('0x23'),_0x481591,_0x4db9('0x24'));_0x4c5f4f(_0x48ff99[_0x4db9('0x2b')][_0x4db9('0x2a')]);}})[_0x4db9('0x2c')](function(_0x622db6){logger[_0x4db9('0x28')]('SmsMessage,\x20%s,\x20%s',_0x481591,_0x622db6);_0x50f685(_0x622db6);});});}function respondWithStatusCode(_0x5f59be,_0x1b2647){_0x1b2647=_0x1b2647||0xcc;return function(_0x5ce6cc){if(_0x5ce6cc){return _0x5f59be[_0x4db9('0x2d')](_0x1b2647);}return _0x5f59be[_0x4db9('0x2e')](_0x1b2647)[_0x4db9('0x2f')]();};}function respondWithResult(_0x19e0be,_0x384df5){_0x384df5=_0x384df5||0xc8;return function(_0x3c3fcf){if(_0x3c3fcf){return _0x19e0be[_0x4db9('0x2e')](_0x384df5)[_0x4db9('0x30')](_0x3c3fcf);}};}function respondWithFilteredResult(_0x4c4a47,_0x35f757){return function(_0x57c1af){if(_0x57c1af){var _0x3b0663=_0x57c1af[_0x4db9('0x31')],_0x33eb9e=_0x35f757['offset'],_0x1e7840=_0x35f757[_0x4db9('0x32')]+_0x35f757[_0x4db9('0x33')],_0x314e64;if(_0x1e7840>=_0x3b0663){_0x1e7840=_0x3b0663;_0x314e64=0xc8;}else{_0x314e64=0xce;}_0x4c4a47[_0x4db9('0x2e')](_0x314e64);return _0x4c4a47[_0x4db9('0x34')]('Content-Range',_0x33eb9e+'-'+_0x1e7840+'/'+_0x3b0663)['json'](_0x57c1af);}return null;};}function patchUpdates(_0x15841b){return function(_0x39e528){try{jsonpatch['apply'](_0x39e528,_0x15841b,!![]);}catch(_0x5e93aa){return BPromise[_0x4db9('0x35')](_0x5e93aa);}return _0x39e528['save']();};}function saveUpdates(_0x4c2449,_0x356e29){return function(_0x83f4e8){if(_0x83f4e8){return _0x83f4e8['update'](_0x4c2449)[_0x4db9('0x21')](function(_0x11e27e){return _0x11e27e;});}return null;};}function removeEntity(_0x11d881,_0x28f48c){return function(_0x5ce0db){if(_0x5ce0db){return _0x5ce0db[_0x4db9('0x36')]()['then'](function(){_0x11d881['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bc7df,_0x281e15){return function(_0x5b863c){if(!_0x5b863c){_0x2bc7df[_0x4db9('0x2d')](0x194);}return _0x5b863c;};}function handleError(_0x19640d,_0x57b3fc){_0x57b3fc=_0x57b3fc||0x1f4;return function(_0x4c57c6){logger['error'](_0x4c57c6[_0x4db9('0x37')]);if(_0x4c57c6['name']){delete _0x4c57c6[_0x4db9('0x38')];}_0x19640d['status'](_0x57b3fc)[_0x4db9('0x39')](_0x4c57c6);};}exports[_0x4db9('0x3a')]=function(_0x1f026d,_0x10ccbc){var _0x27ef37={},_0x49a438={},_0x1cf917={'count':0x0,'rows':[]};var _0x54aa9f=db[_0x4db9('0x3b')][_0x4db9('0x3c')];_0x49a438[_0x4db9('0x3d')]=_[_0x4db9('0x3e')](_0x54aa9f);_0x49a438[_0x4db9('0x3f')]=_[_0x4db9('0x3e')](_0x1f026d['query']);_0x49a438[_0x4db9('0x40')]=_[_0x4db9('0x41')](_0x49a438['model'],_0x49a438['query']);_0x27ef37[_0x4db9('0x42')]=_[_0x4db9('0x41')](_0x49a438[_0x4db9('0x3d')],qs[_0x4db9('0x43')](_0x1f026d[_0x4db9('0x3f')][_0x4db9('0x43')]));_0x27ef37[_0x4db9('0x42')]=_0x27ef37[_0x4db9('0x42')][_0x4db9('0x44')]?_0x27ef37[_0x4db9('0x42')]:_0x49a438[_0x4db9('0x3d')];if(!_0x1f026d[_0x4db9('0x3f')]['hasOwnProperty'](_0x4db9('0x45'))){_0x27ef37[_0x4db9('0x33')]=qs[_0x4db9('0x33')](_0x1f026d[_0x4db9('0x3f')]['limit']);_0x27ef37['offset']=qs[_0x4db9('0x32')](_0x1f026d[_0x4db9('0x3f')][_0x4db9('0x32')]);}_0x27ef37['order']=qs[_0x4db9('0x46')](_0x1f026d['query'][_0x4db9('0x46')]);_0x27ef37[_0x4db9('0x47')]=qs[_0x4db9('0x40')](_[_0x4db9('0x48')](_0x1f026d[_0x4db9('0x3f')],_0x49a438['filters']));if(_0x1f026d[_0x4db9('0x3f')][_0x4db9('0x49')]){_0x27ef37[_0x4db9('0x47')]=_[_0x4db9('0x4a')](_0x27ef37[_0x4db9('0x47')],{'$or':_['map'](_0x54aa9f,function(_0x38d554){if(_0x38d554[_0x4db9('0x4b')][_0x4db9('0x4c')]!==_0x4db9('0x4d')){var _0x381384={};_0x381384[_0x38d554[_0x4db9('0x4e')]]={'$like':'%'+_0x1f026d[_0x4db9('0x3f')][_0x4db9('0x49')]+'%'};return _0x381384;}})});}_0x27ef37=_[_0x4db9('0x4a')]({},_0x27ef37,_0x1f026d['options']);var _0x10b1b0={'where':_0x27ef37['where']};return db['SmsMessage'][_0x4db9('0x31')](_0x10b1b0)[_0x4db9('0x21')](function(_0x4fb6f9){_0x1cf917['count']=_0x4fb6f9;if(_0x1f026d[_0x4db9('0x3f')][_0x4db9('0x4f')]){_0x27ef37[_0x4db9('0x50')]=[{'all':!![]}];}return db[_0x4db9('0x3b')][_0x4db9('0x51')](_0x27ef37);})[_0x4db9('0x21')](function(_0x22a428){_0x1cf917[_0x4db9('0x52')]=_0x22a428;return _0x1cf917;})[_0x4db9('0x21')](respondWithFilteredResult(_0x10ccbc,_0x27ef37))[_0x4db9('0x2c')](handleError(_0x10ccbc,null));};exports[_0x4db9('0x53')]=function(_0x5495de,_0x2fb812){var _0x1934fb={'raw':!![],'where':{'id':_0x5495de[_0x4db9('0x54')]['id']}},_0x50267d={};_0x50267d['model']=_[_0x4db9('0x3e')](db[_0x4db9('0x3b')][_0x4db9('0x3c')]);_0x50267d[_0x4db9('0x3f')]=_[_0x4db9('0x3e')](_0x5495de[_0x4db9('0x3f')]);_0x50267d[_0x4db9('0x40')]=_[_0x4db9('0x41')](_0x50267d[_0x4db9('0x3d')],_0x50267d[_0x4db9('0x3f')]);_0x1934fb[_0x4db9('0x42')]=_[_0x4db9('0x41')](_0x50267d[_0x4db9('0x3d')],qs['fields'](_0x5495de['query']['fields']));_0x1934fb[_0x4db9('0x42')]=_0x1934fb['attributes'][_0x4db9('0x44')]?_0x1934fb['attributes']:_0x50267d[_0x4db9('0x3d')];if(_0x5495de[_0x4db9('0x3f')]['includeAll']){_0x1934fb['include']=[{'all':!![]}];}_0x1934fb=_[_0x4db9('0x4a')]({},_0x1934fb,_0x5495de[_0x4db9('0x55')]);return db[_0x4db9('0x3b')][_0x4db9('0x56')](_0x1934fb)[_0x4db9('0x21')](handleEntityNotFound(_0x2fb812,null))[_0x4db9('0x21')](respondWithResult(_0x2fb812,null))[_0x4db9('0x2c')](handleError(_0x2fb812,null));};exports[_0x4db9('0x57')]=function(_0x562036,_0x129211){return db[_0x4db9('0x3b')][_0x4db9('0x57')](_0x562036[_0x4db9('0x58')],{})[_0x4db9('0x21')](respondWithResult(_0x129211,0xc9))['catch'](handleError(_0x129211,null));};exports[_0x4db9('0x59')]=function(_0x351b61,_0x204b92){if(_0x351b61['body']['id']){delete _0x351b61[_0x4db9('0x58')]['id'];}return db[_0x4db9('0x3b')][_0x4db9('0x56')]({'where':{'id':_0x351b61['params']['id']}})[_0x4db9('0x21')](handleEntityNotFound(_0x204b92,null))['then'](saveUpdates(_0x351b61[_0x4db9('0x58')],null))[_0x4db9('0x21')](respondWithResult(_0x204b92,null))[_0x4db9('0x2c')](handleError(_0x204b92,null));};exports['destroy']=function(_0x3544bf,_0x475ed6){return db['SmsMessage'][_0x4db9('0x56')]({'where':{'id':_0x3544bf[_0x4db9('0x54')]['id']}})[_0x4db9('0x21')](handleEntityNotFound(_0x475ed6,null))[_0x4db9('0x21')](removeEntity(_0x475ed6,null))[_0x4db9('0x2c')](handleError(_0x475ed6,null));};exports[_0x4db9('0x5a')]=function(_0x3b9297,_0x44465a){return db['SmsMessage'][_0x4db9('0x5a')]()[_0x4db9('0x21')](respondWithResult(_0x44465a,null))[_0x4db9('0x2c')](handleError(_0x44465a,null));};var interaction_log=require('../../config/logger')(_0x4db9('0x5b'));exports[_0x4db9('0x5c')]=function(_0x711775,_0x1e5922,_0x58cf13){var _0x1243d7={'channel':_0x4db9('0x5d')};if(_0x711775[_0x4db9('0x58')]['id']){delete _0x711775[_0x4db9('0x58')]['id'];}_0x711775[_0x4db9('0x58')][_0x4db9('0x5e')]=!![];_0x711775[_0x4db9('0x58')][_0x4db9('0x5f')]=moment()['format'](_0x4db9('0x60'));_0x711775[_0x4db9('0x58')][_0x4db9('0x61')]=_0x711775['body']['UserId']||_0x711775[_0x4db9('0x62')]['id'];return db[_0x4db9('0x3b')]['find']({'where':{'id':_0x711775[_0x4db9('0x54')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x4db9('0x63')}]})[_0x4db9('0x21')](handleEntityNotFound(_0x1e5922,null))[_0x4db9('0x21')](saveUpdates(_0x711775[_0x4db9('0x58')],null))[_0x4db9('0x21')](function(_0x2024ec){if(_0x2024ec){_0x1243d7[_0x4db9('0x2a')]=_0x2024ec[_0x4db9('0x64')]({'plain':!![]});return db['SmsInteraction'][_0x4db9('0x56')]({'where':{'id':_0x2024ec[_0x4db9('0x65')]}});}return null;})[_0x4db9('0x21')](handleEntityNotFound(_0x1e5922,null))[_0x4db9('0x21')](function(_0x21598f){if(_0x21598f){return _0x21598f[_0x4db9('0x59')]({'UserId':_0x711775[_0x4db9('0x58')][_0x4db9('0x61')],'read1stAt':_['isNil'](_0x21598f[_0x4db9('0x66')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x3bb18f){if(_0x3bb18f){_0x1243d7[_0x4db9('0x67')]=_0x3bb18f[_0x4db9('0x64')]({'plain':!![]});interaction_log[_0x4db9('0x22')](_0x4db9('0x68'),_0x711775[_0x4db9('0x62')]['id'],_0x711775[_0x4db9('0x62')][_0x4db9('0x38')],_0x711775['user']['role'],_0x1243d7['interaction']['id'],_0x711775['body']?JSON[_0x4db9('0x27')](_0x711775[_0x4db9('0x58')]):_0x4db9('0x69'));return respondWithRpcPromise(_0x4db9('0x6a'),_0x4db9('0x6b'),_0x1243d7);}return null;})[_0x4db9('0x21')](function(_0x3fe61c){if(_0x3fe61c){if(_0x711775[_0x4db9('0x58')]['manual']){_0x1243d7[_0x4db9('0x2a')][_0x4db9('0x6c')]=util[_0x4db9('0x6d')]('SIP/%s',_0x711775[_0x4db9('0x62')]['name']);_0x1243d7['message']['channel']=_0x1243d7['channel'];_0x1243d7[_0x4db9('0x2a')][_0x4db9('0x6e')]='accept';return respondWithRpcPromise(_0x4db9('0x6f'),_0x4db9('0x6f'),{'event':_0x4db9('0x70'),'message':_0x1243d7[_0x4db9('0x2a')]},client9002)[_0x4db9('0x21')](function(){return _0x1243d7;});}return _0x1243d7;}return null;})['then'](respondWithResult(_0x1e5922,null))['catch'](handleError(_0x1e5922,null));};var interaction_log=require('../../config/logger')(_0x4db9('0x5b'));exports['reject']=function(_0x319562,_0x4bd8c9,_0x3bc13f){var _0x13fa02={'agent':{},'channel':_0x4db9('0x5d')};if(_0x319562['body']['id']){delete _0x319562[_0x4db9('0x58')]['id'];}_0x319562['body']['UserId']=_0x319562[_0x4db9('0x58')][_0x4db9('0x61')]||_0x319562[_0x4db9('0x62')]['id'];_0x13fa02['agent']['id']=_0x319562[_0x4db9('0x58')]['UserId'];return db['SmsMessage'][_0x4db9('0x56')]({'where':{'id':_0x319562[_0x4db9('0x54')]['id'],'UserId':null}})[_0x4db9('0x21')](handleEntityNotFound(_0x4bd8c9,null))[_0x4db9('0x21')](function(_0x2dd788){if(_0x2dd788){_0x13fa02[_0x4db9('0x2a')]=_0x2dd788['get']({'plain':!![]});return db[_0x4db9('0x71')][_0x4db9('0x56')]({'where':{'id':_0x2dd788[_0x4db9('0x65')]}});}return null;})[_0x4db9('0x21')](handleEntityNotFound(_0x4bd8c9,null))['then'](function(_0x79177d){if(_0x79177d){_0x13fa02[_0x4db9('0x67')]=_0x79177d['get']({'plain':!![]});interaction_log[_0x4db9('0x22')](_0x4db9('0x72'),_0x319562['user']['id'],_0x319562[_0x4db9('0x62')][_0x4db9('0x38')],_0x319562[_0x4db9('0x62')][_0x4db9('0x73')],_0x13fa02['interaction']['id'],_0x319562[_0x4db9('0x58')]?JSON['stringify'](_0x319562[_0x4db9('0x58')]):_0x4db9('0x69'));return respondWithRpcPromise(_0x4db9('0x74'),_0x4db9('0x75'),_0x13fa02);}return null;})['then'](function(_0x4a7ab6){if(_0x4a7ab6){_0x4a7ab6[_0x4db9('0x2a')][_0x4db9('0x6c')]=util[_0x4db9('0x6d')](_0x4db9('0x76'),_0x319562[_0x4db9('0x62')][_0x4db9('0x38')]);_0x4a7ab6[_0x4db9('0x2a')]['channel']=_0x13fa02[_0x4db9('0x77')];_0x4a7ab6[_0x4db9('0x2a')][_0x4db9('0x6e')]=_0x4db9('0x35');respondWithRpcPromise('EventManager',_0x4db9('0x6f'),{'event':_0x4db9('0x78'),'message':_0x4a7ab6[_0x4db9('0x2a')]},client9002);return _0x13fa02;}return null;})[_0x4db9('0x21')](respondWithResult(_0x4bd8c9,null))[_0x4db9('0x2c')](handleError(_0x4bd8c9,null));};exports[_0x4db9('0x2e')]=function(_0x2b1c59,_0x3ef4cc,_0x1a95cd){if(_0x2b1c59[_0x4db9('0x58')]['id']){delete _0x2b1c59[_0x4db9('0x58')]['id'];}var _0xa41ff9;return db[_0x4db9('0x3b')][_0x4db9('0x56')]({'where':{'id':_0x2b1c59[_0x4db9('0x54')]['id']}})['then'](handleEntityNotFound(_0x3ef4cc,null))[_0x4db9('0x21')](function(_0x41341e){if(_0x41341e){_0xa41ff9=_0x41341e;return db[_0x4db9('0x79')]['find']({'where':{'id':_0x41341e['SmsAccountId']}});}})[_0x4db9('0x21')](handleEntityNotFound(_0x3ef4cc,null))['then'](function(_0x42d23d){if(_0x42d23d){logger['debug'](_0x4db9('0x26'),'status','received\x20delivery\x20report\x20from',_0x42d23d['type'],util['inspect'](_0x2b1c59[_0x4db9('0x58')],{'showHidden':![],'depth':null}));switch(_0x42d23d[_0x4db9('0x4b')]){case _0x4db9('0x7a'):if(_0x2b1c59['body'][_0x4db9('0x7b')]&&_0x2b1c59['body'][_0x4db9('0x7b')]===_0xa41ff9['messageId']){return _0xa41ff9['update']({'read':!![]});}else{logger[_0x4db9('0x28')](_0x4db9('0x7c'),'status','twilio',util[_0x4db9('0x7d')](_0x2b1c59[_0x4db9('0x58')],{'showHidden':![],'depth':null}));}break;case _0x4db9('0x7e'):if(_0x2b1c59[_0x4db9('0x58')]['MessageUUID']&&_0x2b1c59[_0x4db9('0x58')][_0x4db9('0x7f')]===_0xa41ff9[_0x4db9('0x80')]&&_['indexOf']([_0x4db9('0x81'),_0x4db9('0x82')],_0x2b1c59[_0x4db9('0x58')][_0x4db9('0x83')])>=0x0){return _0xa41ff9[_0x4db9('0x59')]({'read':!![]});}else{logger[_0x4db9('0x28')](_0x4db9('0x7c'),'status','plivio',util[_0x4db9('0x7d')](_0x2b1c59[_0x4db9('0x58')],{'showHidden':![],'depth':null}));}break;case _0x4db9('0x84'):var _0x2da6d3=_0x2b1c59[_0x4db9('0x58')][_0x4db9('0x85')][0x0];if(_0x2da6d3[_0x4db9('0x2e')][_0x4db9('0x86')]==='DELIVERED'){return _0xa41ff9[_0x4db9('0x59')]({'read':!![]});}else{logger[_0x4db9('0x28')](_0x4db9('0x7c'),_0x4db9('0x2e'),_0x4db9('0x84'),util['inspect'](_0x2b1c59['body'],{'showHidden':![],'depth':null}));}break;}return _0xa41ff9;}})[_0x4db9('0x21')](respondWithResult(_0x3ef4cc,null))[_0x4db9('0x2c')](handleError(_0x3ef4cc,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 6f840a5..74a8b31 100644 --- a/server/api/smsMessage/smsMessage.events.js +++ b/server/api/smsMessage/smsMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9f4=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage'];(function(_0x4b90e7,_0xdea526){var _0x53c0a4=function(_0x2c70f2){while(--_0x2c70f2){_0x4b90e7['push'](_0x4b90e7['shift']());}};_0x53c0a4(++_0xdea526);}(_0xd9f4,0x93));var _0x4d9f=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0xd9f4[_0x2df507];return _0x1f7167;};'use strict';var EventEmitter=require(_0x4d9f('0x0'));var SmsMessage=require(_0x4d9f('0x1'))['db'][_0x4d9f('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4d9f('0x3')](0x0);var events={'afterCreate':_0x4d9f('0x4'),'afterUpdate':_0x4d9f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x107a9b){return function(_0x2e148e,_0x14bd73,_0x311f68){SmsMessageEvents[_0x4d9f('0x6')](_0x107a9b+':'+_0x2e148e['id'],_0x2e148e);SmsMessageEvents[_0x4d9f('0x6')](_0x107a9b,_0x2e148e);_0x311f68(null);};}for(var e in events){if(events[_0x4d9f('0x7')](e)){var event=events[e];SmsMessage[_0x4d9f('0x8')](e,emitEvent(event));}}module[_0x4d9f('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xddf5=['setMaxListeners','save','remove','emit','exports','../../mysqldb'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xddf5,0xc5));var _0x5ddf=function(_0x3b1c02,_0x46a658){_0x3b1c02=_0x3b1c02-0x0;var _0x31c1bf=_0xddf5[_0x3b1c02];return _0x31c1bf;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x5ddf('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5ddf('0x1')](0x0);var events={'afterCreate':_0x5ddf('0x2'),'afterUpdate':'update','afterDestroy':_0x5ddf('0x3')};function emitEvent(_0x275d39){return function(_0x5031dd,_0xe8f5bc,_0x1f3acd){SmsMessageEvents[_0x5ddf('0x4')](_0x275d39+':'+_0x5031dd['id'],_0x5031dd);SmsMessageEvents[_0x5ddf('0x4')](_0x275d39,_0x5031dd);_0x1f3acd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x5ddf('0x5')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 11743a8..a5a6185 100644 --- a/server/api/smsMessage/smsMessage.model.js +++ b/server/api/smsMessage/smsMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29b6=['requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','username','Basic\x20%s','toString','http_code','queued_count','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','sender','text','timestamp','length','apiKey','createHash','md5','digest','signature=','keys','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','find','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','catch','error','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','login?username=','GET','sms','session_key','deliveryReport','skebby','connectel','senderString','POST','https://smsapi.connectel.se/api/send/'];(function(_0x354328,_0x33ecae){var _0x1f7e05=function(_0x4730af){while(--_0x4730af){_0x354328['push'](_0x354328['shift']());}};_0x1f7e05(++_0x33ecae);}(_0x29b6,0xa9));var _0x629b=function(_0x3ab47f,_0x441b32){_0x3ab47f=_0x3ab47f-0x0;var _0x1221fe=_0x29b6[_0x3ab47f];return _0x1221fe;};'use strict';var _=require(_0x629b('0x0'));var util=require(_0x629b('0x1'));var logger=require(_0x629b('0x2'))(_0x629b('0x3'));var moment=require(_0x629b('0x4'));var BPromise=require('bluebird');var rp=require(_0x629b('0x5'));var fs=require('fs');var path=require(_0x629b('0x6'));var rimraf=require('rimraf');var config=require(_0x629b('0x7'));var attributes=require(_0x629b('0x8'));module[_0x629b('0x9')]=function(_0x27b9b3,_0x27f4c2){return _0x27b9b3[_0x629b('0xa')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x629b('0xb'),'fields':[_0x629b('0xb')]},{'name':_0x629b('0xc'),'fields':[_0x629b('0xd')],'type':_0x629b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x40723e,_0x4cc72f,_0x211483){var _0x4d6b37=_0x27b9b3[_0x629b('0xf')];var _0x3688a7=_0x40723e[_0x629b('0x10')]({'plain':!![]});if(_0x3688a7[_0x629b('0x11')][_0x629b('0x12')]()==='in'||_0x3688a7[_0x629b('0x11')][_0x629b('0x12')]()===_0x629b('0x13')&&!_0x3688a7['secret']&&!_[_0x629b('0x14')](_0x3688a7[_0x629b('0x15')])){_0x4d6b37[_0x629b('0x16')][_0x629b('0x17')]({'where':{'id':_0x3688a7[_0x629b('0x18')]}})[_0x629b('0x19')](function(_0x4259f5){if(_0x4259f5){_0x4259f5[_0x629b('0x1a')]({'lastMsgAt':_0x3688a7[_0x629b('0x1b')],'lastMsgDirection':_0x3688a7[_0x629b('0x11')][_0x629b('0x12')]()});}})['catch'](function(_0x5909dd){console['error'](_0x5909dd);});}if(_0x3688a7[_0x629b('0x11')]==='out'&&!_0x3688a7['secret']){var _0xf6e4a9;_0x4d6b37['SmsAccount'][_0x629b('0x1c')]({'where':{'id':_0x3688a7[_0x629b('0x1d')]},'raw':!![]})[_0x629b('0x19')](function(_0x4a44d0){_0xf6e4a9=_0x4a44d0;if(_0xf6e4a9&&_0xf6e4a9[_0x629b('0x1e')]){switch(_0xf6e4a9['type']){case _0x629b('0x1f'):var _0xb49919=require(_0x629b('0x1f'));if(_0xf6e4a9[_0x629b('0x20')]&&_0xf6e4a9['authToken']&&_0xf6e4a9[_0x629b('0x21')]){var _0x69dc2f=new _0xb49919(_0xf6e4a9[_0x629b('0x20')],_0xf6e4a9[_0x629b('0x22')]);_0x69dc2f[_0x629b('0x23')][_0x629b('0x24')]({'body':_0x3688a7[_0x629b('0xd')],'to':_0x3688a7[_0x629b('0x21')],'from':_0xf6e4a9[_0x629b('0x21')],'statusCallback':_0xf6e4a9[_0x629b('0x25')]+_0x629b('0x26')+_0x3688a7['id']+_0x629b('0x27')+_0xf6e4a9[_0x629b('0x28')]})[_0x629b('0x19')](function(_0x1467a3){if(_0x1467a3[_0x629b('0x29')]){return _0x40723e[_0x629b('0x1a')]({'messageId':_0x1467a3['sid']});}})[_0x629b('0x2a')](function(_0x2f6e08){logger[_0x629b('0x2b')](_0x629b('0x2c'),'afterCreate',_0x629b('0x1f'),util[_0x629b('0x2d')](_0x2f6e08,{'showHidden':![],'depth':null}));});}else{logger[_0x629b('0x2b')](_0x629b('0x2c'),_0x629b('0x2e'),_0x629b('0x1f'),_0x629b('0x2f'));}break;case'skebby':var _0x2e6138=_0x629b('0x30');if(_0xf6e4a9['username']&&_0xf6e4a9[_0x629b('0x31')]){var _0x1a273c={'recipient':[_0x3688a7[_0x629b('0x21')]],'message':_0x3688a7[_0x629b('0xd')],'message_type':_0xf6e4a9[_0x629b('0x32')]};if(_0xf6e4a9['smsMethod']&&_0xf6e4a9[_0x629b('0x32')]!=='SI'){_0x1a273c['sender']=_0xf6e4a9[_0x629b('0x21')];}var _0x4320ac={'url':_0x2e6138+_0x629b('0x33')+_0xf6e4a9['username']+'&password='+_0xf6e4a9['password'],'method':_0x629b('0x34')};rp(_0x4320ac)[_0x629b('0x19')](function(_0x2514a6){var _0x4ac40f=_0x2514a6['split'](';');var _0x4e1f7a={'user_key':_0x4ac40f[0x0],'session_key':_0x4ac40f[0x1]};_0x4320ac={'url':_0x2e6138+_0x629b('0x35'),'method':'POST','headers':{'user_key':_0x4e1f7a['user_key'],'Session_key':_0x4e1f7a[_0x629b('0x36')]},'json':!![],'body':_0x1a273c};return rp(_0x4320ac);})[_0x629b('0x19')](function(_0x593bb0){if(_0x593bb0['total_sent']>=0x1){var _0x366886={'messageId':_0x593bb0['internal_order_id']};if(_0xf6e4a9['smsMethod']!=='GP'||!_0xf6e4a9[_0x629b('0x37')]){_0x366886['read']=!![];}return _0x40723e[_0x629b('0x1a')](_0x366886);}else{return logger[_0x629b('0x2b')](_0x629b('0x2c'),'afterCreate','skebby',util['inspect'](_0x593bb0,{'showHidden':![],'depth':null}));}})[_0x629b('0x2a')](function(_0x351ad1){return logger['error'](_0x629b('0x2c'),_0x629b('0x2e'),'skebby',util['inspect'](_0x351ad1,{'showHidden':![],'depth':null}));});}else{logger[_0x629b('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x629b('0x2e'),_0x629b('0x38'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x629b('0x39'):if(_0xf6e4a9[_0x629b('0x22')]){var _0x247772={'recipient':_0x3688a7[_0x629b('0x21')],'message':_0x3688a7[_0x629b('0xd')],'sender':_0xf6e4a9[_0x629b('0x3a')]||_0xf6e4a9[_0x629b('0x21')],'authorization':_0xf6e4a9[_0x629b('0x22')]};var _0x4cc72f={'method':_0x629b('0x3b'),'uri':_0x629b('0x3c'),'body':_0x247772,'json':!![]};rp(_0x4cc72f)[_0x629b('0x19')](function(_0xf61a7a){var _0x384884={'messageId':_0xf61a7a[_0x629b('0x3d')]};if(!_0xf6e4a9[_0x629b('0x37')]){_0x384884[_0x629b('0x3e')]=!![];}return _0x40723e[_0x629b('0x1a')](_0x384884);})[_0x629b('0x2a')](function(_0x52f5de){logger[_0x629b('0x2b')](_0x629b('0x2c'),_0x629b('0x2e'),'connectel',util['inspect'](_0x52f5de,{'showHidden':![],'depth':null}));});}else{logger[_0x629b('0x2b')](_0x629b('0x2c'),_0x629b('0x2e'),_0x629b('0x39'),_0x629b('0x3f'));}break;case _0x629b('0x40'):if(_0xf6e4a9['username']&&_0xf6e4a9[_0x629b('0x31')]){var _0x247772={'messages':[{'source':_0x629b('0x41'),'to':_0x3688a7['phone'],'body':_0x3688a7['body'],'from':_0xf6e4a9['senderString']||_0xf6e4a9[_0x629b('0x21')]}]};var _0x3d26f9=util[_0x629b('0x42')](_0x629b('0x43'),_0xf6e4a9[_0x629b('0x44')],_0xf6e4a9[_0x629b('0x31')]);var _0x4cc72f={'method':_0x629b('0x3b'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x247772,'headers':{'Authorization':util['format'](_0x629b('0x45'),new Buffer(_0x3d26f9)[_0x629b('0x46')]('base64'))},'json':!![]};rp(_0x4cc72f)[_0x629b('0x19')](function(_0x57d918){if(_0x57d918[_0x629b('0x47')]>=0xc8&&_0x57d918[_0x629b('0x47')]<=0xce){if(_0x57d918['data']&&_0x57d918['data'][_0x629b('0x48')]>0x0){var _0x2435a5=_[_0x629b('0x49')](_0x57d918['data'][_0x629b('0x23')]);var _0x1e204c={'messageId':_0x2435a5[_0x629b('0x4a')]};if(!_0xf6e4a9[_0x629b('0x37')]){_0x1e204c[_0x629b('0x3e')]=!![];}return _0x40723e['update'](_0x1e204c);}else{logger['error'](_0x629b('0x2c'),_0x629b('0x2e'),'clickSend',util[_0x629b('0x2d')](_0x57d918,{'showHidden':![],'depth':null}));}}else{logger[_0x629b('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x629b('0x2e'),'clickSend',util[_0x629b('0x2d')](_0x57d918,{'showHidden':![],'depth':null}));}})['catch'](function(_0x496a7e){logger['error'](_0x629b('0x2c'),_0x629b('0x2e'),_0x629b('0x4b'),util[_0x629b('0x2d')](_0x496a7e,{'showHidden':![],'depth':null}));});}else{logger[_0x629b('0x2b')](_0x629b('0x2c'),'afterCreate',_0x629b('0x4b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x629b('0x4c'):if(_0xf6e4a9[_0x629b('0x4d')]&&_0xf6e4a9[_0x629b('0x22')]){var _0x247772={'dst':_0x3688a7[_0x629b('0x21')],'text':_0x3688a7[_0x629b('0xd')],'src':_0xf6e4a9[_0x629b('0x3a')]||_0xf6e4a9[_0x629b('0x21')],'url':_0xf6e4a9[_0x629b('0x25')]+'/api/sms/messages/'+_0x3688a7['id']+'/status?token='+_0xf6e4a9[_0x629b('0x28')]};var _0x3d26f9=util[_0x629b('0x42')](_0x629b('0x43'),_0xf6e4a9[_0x629b('0x4d')],_0xf6e4a9[_0x629b('0x22')]);var _0x4cc72f={'method':_0x629b('0x3b'),'uri':util['format'](_0x629b('0x4e'),_0xf6e4a9['authId']),'body':_0x247772,'headers':{'Authorization':util[_0x629b('0x42')](_0x629b('0x45'),new Buffer(_0x3d26f9)[_0x629b('0x46')](_0x629b('0x4f')))},'json':!![]};rp(_0x4cc72f)[_0x629b('0x19')](function(_0x585f8a){var _0x275723={'messageId':_0x585f8a[_0x629b('0x50')][0x0]};return _0x40723e[_0x629b('0x1a')](_0x275723);})[_0x629b('0x2a')](function(_0x3bba45){logger[_0x629b('0x2b')](_0x629b('0x2c'),'afterCreate','plivo',util[_0x629b('0x2d')](_0x3bba45,{'showHidden':![],'depth':null}));});}else{logger[_0x629b('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x629b('0x2e'),_0x629b('0x4c'),_0x629b('0x51'));}break;case _0x629b('0x52'):if(_0xf6e4a9[_0x629b('0x44')]&&_0xf6e4a9[_0x629b('0x31')]){if(_0xf6e4a9[_0x629b('0x53')]){var _0x2b8f9a={'method':_0x629b('0x3b'),'uri':_0xf6e4a9[_0x629b('0x53')]+_0x629b('0x54'),'body':{'username':_0xf6e4a9['username'],'password':_0xf6e4a9[_0x629b('0x31')]},'json':!![]};return rp(_0x2b8f9a)['then'](function(_0x5e33b9){var _0x148273={'method':_0x629b('0x3b'),'uri':_0xf6e4a9['baseUrl']+_0x629b('0x55'),'body':{'messages':[{'from':_0xf6e4a9['phone'],'destinations':[{'to':_0x3688a7[_0x629b('0x21')]}],'text':_0x3688a7['body'],'notifyUrl':_0xf6e4a9[_0x629b('0x25')]+'/api/sms/messages/'+_0x3688a7['id']+_0x629b('0x27')+_0xf6e4a9['token'],'notifyContentType':_0x629b('0x56'),'callbackData':_0xf6e4a9['phone']+';'+_0x3688a7[_0x629b('0xd')]}]},'headers':{'Authorization':_0x629b('0x57')+_0x5e33b9[_0x629b('0x28')]},'json':!![]};return rp(_0x148273)[_0x629b('0x19')](function(_0x14b682){if(_0x14b682[_0x629b('0x23')]){var _0x52cab4={'messageId':_0x14b682[_0x629b('0x23')][0x0][_0x629b('0xb')]};if(!_0xf6e4a9[_0x629b('0x37')]){_0x52cab4[_0x629b('0x3e')]=!![];}return _0x40723e['update'](_0x52cab4);}else{return logger[_0x629b('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x629b('0x2e'),_0x629b('0x52'),util[_0x629b('0x2d')](_0x14b682,{'showHidden':![],'depth':null}));}});})[_0x629b('0x2a')](function(_0x3e7d11){return logger[_0x629b('0x2b')](_0x629b('0x2c'),_0x629b('0x2e'),'infobip',util['inspect'](_0x3e7d11,{'showHidden':![],'depth':null}));});}else{logger[_0x629b('0x2b')](_0x629b('0x2c'),_0x629b('0x2e'),'infobip',_0x629b('0x58'));}}else{logger[_0x629b('0x2b')](_0x629b('0x2c'),_0x629b('0x2e'),_0x629b('0x52'),_0x629b('0x59'));}break;case _0x629b('0x5a'):var _0x20bb9e=require('crypto');if(_0xf6e4a9['apiKey']){var _0x519c26={};_0x519c26['login']=_0xf6e4a9[_0x629b('0x44')];_0x519c26['phone']=_0x3688a7[_0x629b('0x21')];_0x519c26[_0x629b('0x5b')]=_0xf6e4a9[_0x629b('0x21')];_0x519c26[_0x629b('0x5c')]=_0x3688a7[_0x629b('0xd')];_0x519c26[_0x629b('0x5d')]=+new Date();var _0x32851d='';var _0x333449='';var _0x1248a7=Object['keys'](_0x519c26);_0x1248a7['sort']();for(var _0x5b5af6=0x0;_0x5b5af6<_0x1248a7[_0x629b('0x5e')];_0x5b5af6++){if(_0x32851d!=''){_0x32851d+='&';}_0x32851d+=_0x1248a7[_0x5b5af6]+'='+encodeURIComponent(_0x519c26[_0x1248a7[_0x5b5af6]]);_0x333449+=_0x519c26[_0x1248a7[_0x5b5af6]];}_0x333449+=_0xf6e4a9[_0x629b('0x5f')];_0x333449=_0x20bb9e[_0x629b('0x60')](_0x629b('0x61'))['update'](_0x333449)[_0x629b('0x62')]('hex');if(_0x32851d!==''){_0x32851d+='&';}_0x32851d+=_0x629b('0x63')+_0x333449;var _0x4320ac={'method':_0x629b('0x34'),'uri':'https://sms.csc.lv/external/get/send.php?'+_0x32851d,'json':!![]};return rp(_0x4320ac)[_0x629b('0x19')](function(_0x39eb70){var _0x4b2703=Object[_0x629b('0x64')](_0x39eb70);if(_0x39eb70[_0x4b2703[0x0]][_0x629b('0x2b')]&&parseInt(_0x39eb70[_0x4b2703[0x0]][_0x629b('0x2b')])===0x0){var _0x575b79={'messageId':_0x39eb70[_0x4b2703[0x0]][_0x629b('0x65')]};if(!_0xf6e4a9[_0x629b('0x37')]){_0x575b79[_0x629b('0x3e')]=!![];}return _0x40723e[_0x629b('0x1a')](_0x575b79);}else{return logger[_0x629b('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x629b('0x2e'),_0x629b('0x5a'),util[_0x629b('0x2d')](_0x39eb70[_0x629b('0x2b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x312a7b){return logger[_0x629b('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x629b('0x2e'),_0x629b('0x5a'),util['inspect'](_0x312a7b,{'showHidden':![],'depth':null}));});}else{logger[_0x629b('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc','Missing\x20parameters:\x20apiKey');}break;case _0x629b('0x66'):if(_0xf6e4a9[_0x629b('0x5f')]){var _0x491862={'method':_0x629b('0x3b'),'uri':_0x629b('0x67'),'headers':{'Authorization':_0xf6e4a9[_0x629b('0x5f')]},'body':{'content':_0x3688a7[_0x629b('0xd')],'to':[_0x3688a7['phone']],'from':_0xf6e4a9[_0x629b('0x21')],'binary':![],'clientMessageId':_0x629b('0x68'),'charset':'UTF-8'},'json':!![]};rp(_0x491862)[_0x629b('0x19')](function(_0x219a6e){if(!_0x219a6e['error']){var _0x46ef20={'messageId':_0x219a6e[_0x629b('0x23')][0x0]['apiMessageId']};if(!_0xf6e4a9['deliveryReport']){_0x46ef20[_0x629b('0x3e')]=!![];}return _0x40723e[_0x629b('0x1a')](_0x46ef20);}else{return logger[_0x629b('0x2b')](_0x629b('0x2c'),'afterCreate','clickatell',util['inspect'](_0x219a6e['error'],{'showHidden':![],'depth':null}));}})[_0x629b('0x2a')](function(_0x31e4af){return logger['error'](_0x629b('0x2c'),_0x629b('0x2e'),_0x629b('0x66'),util[_0x629b('0x2d')](_0x31e4af,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x629b('0x2c'),_0x629b('0x2e'),_0x629b('0x66'),'Missing\x20parameters:\x20apiKey');}break;case _0x629b('0x69'):if(_0xf6e4a9[_0x629b('0x5f')]){var _0x24c31e={};var _0x4320ac={'method':_0x629b('0x3b'),'uri':_0x629b('0x6a'),'headers':{'Authorization':_0x629b('0x6b')+_0xf6e4a9[_0x629b('0x5f')],'Content-Type':_0x629b('0x56')},'body':{'from':_0xf6e4a9[_0x629b('0x21')],'to':_0x3688a7[_0x629b('0x21')],'text':_0x3688a7[_0x629b('0xd')]},'json':!![]};return rp(_0x4320ac)[_0x629b('0x19')](function(_0x49f354){if(_0x49f354[_0x629b('0x6c')]==0xca){_0x24c31e[_0x629b('0x6d')]=_0x49f354;var _0x1ba0d7={'method':_0x629b('0x3b'),'uri':_0x629b('0x6e'),'headers':{'Authorization':_0x629b('0x6b')+_0xf6e4a9['apiKey'],'Content-Type':_0x629b('0x56')},'body':{'refid':_0x24c31e[_0x629b('0x6d')][_0x629b('0x6f')]},'json':!![]};return rp(_0x1ba0d7)['then'](function(_0x43be21){_0x24c31e[_0x629b('0x70')]=_0x43be21;var _0x14d7d5={'messageId':_0x24c31e['message']['refid'],'read':!![]};return _0x40723e[_0x629b('0x1a')](_0x14d7d5);});}else{return logger[_0x629b('0x2b')](_0x629b('0x2c'),_0x629b('0x2e'),_0x629b('0x69'),util[_0x629b('0x2d')](_0x49f354,{'showHidden':![],'depth':null}));}})[_0x629b('0x2a')](function(_0xe400ae){return logger[_0x629b('0x2b')](_0x629b('0x2c'),'afterCreate',_0x629b('0x69'),util[_0x629b('0x2d')](_0xe400ae,{'showHidden':![],'depth':null}));});}else{return logger[_0x629b('0x2b')](_0x629b('0x2c'),_0x629b('0x2e'),_0x629b('0x69'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x211483();});}else{_0x211483();}}},'charset':_0x629b('0x71'),'collate':_0x629b('0x72')});}; \ No newline at end of file +var _0x69e8=['create','/api/sms/messages/','/status?token=','token','then','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','smsMethod','login?username=','username','&password=','password','GET','split','sms','POST','user_key','session_key','internal_order_id','connectel','https://smsapi.connectel.se/api/send/','requestid','deliveryReport','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','Basic\x20%s','http_code','data','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','%s:%s','authId','toString','message_uuid','/auth/1/session','baseUrl','/sms/2/text/advanced','remote','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','length','createHash','md5','signature=','https://sms.csc.lv/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','path','../../config/environment','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','SmsInteractionId','update','createdAt','catch','error','out','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x69e8,0x1a2));var _0x869e=function(_0x49fac0,_0x39a9c3){_0x49fac0=_0x49fac0-0x0;var _0x387b0b=_0x69e8[_0x49fac0];return _0x387b0b;};'use strict';var _=require(_0x869e('0x0'));var util=require(_0x869e('0x1'));var logger=require('../../config/logger')(_0x869e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x869e('0x3'));var rimraf=require('rimraf');var config=require(_0x869e('0x4'));var attributes=require('./smsMessage.attributes');module[_0x869e('0x5')]=function(_0x4b7fb7,_0x24166d){return _0x4b7fb7[_0x869e('0x6')](_0x869e('0x7'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x869e('0x8'),'fields':['messageId']},{'name':_0x869e('0x9'),'fields':[_0x869e('0xa')],'type':_0x869e('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x44e41b,_0x42a4a8,_0x5d2a66){var _0x2ab724=_0x4b7fb7[_0x869e('0xc')];var _0x3e9b4a=_0x44e41b[_0x869e('0xd')]({'plain':!![]});if(_0x3e9b4a['direction']['toLowerCase']()==='in'||_0x3e9b4a[_0x869e('0xe')][_0x869e('0xf')]()==='out'&&!_0x3e9b4a[_0x869e('0x10')]&&!_[_0x869e('0x11')](_0x3e9b4a[_0x869e('0x12')])){_0x2ab724[_0x869e('0x13')]['findOne']({'where':{'id':_0x3e9b4a[_0x869e('0x14')]}})['then'](function(_0x41bfab){if(_0x41bfab){_0x41bfab[_0x869e('0x15')]({'lastMsgAt':_0x3e9b4a[_0x869e('0x16')],'lastMsgDirection':_0x3e9b4a['direction']['toLowerCase']()});}})[_0x869e('0x17')](function(_0x428a6f){console[_0x869e('0x18')](_0x428a6f);});}if(_0x3e9b4a[_0x869e('0xe')]===_0x869e('0x19')&&!_0x3e9b4a['secret']){var _0x1e7aa5;_0x2ab724['SmsAccount'][_0x869e('0x1a')]({'where':{'id':_0x3e9b4a[_0x869e('0x1b')]},'raw':!![]})['then'](function(_0x5eed8f){_0x1e7aa5=_0x5eed8f;if(_0x1e7aa5&&_0x1e7aa5[_0x869e('0x1c')]){switch(_0x1e7aa5['type']){case _0x869e('0x1d'):var _0x2fb525=require(_0x869e('0x1d'));if(_0x1e7aa5[_0x869e('0x1e')]&&_0x1e7aa5[_0x869e('0x1f')]&&_0x1e7aa5[_0x869e('0x20')]){var _0x8879b5=new _0x2fb525(_0x1e7aa5['accountSid'],_0x1e7aa5[_0x869e('0x1f')]);_0x8879b5[_0x869e('0x21')][_0x869e('0x22')]({'body':_0x3e9b4a[_0x869e('0xa')],'to':_0x3e9b4a['phone'],'from':_0x1e7aa5[_0x869e('0x20')],'statusCallback':_0x1e7aa5['remote']+_0x869e('0x23')+_0x3e9b4a['id']+_0x869e('0x24')+_0x1e7aa5[_0x869e('0x25')]})[_0x869e('0x26')](function(_0x3f78f3){if(_0x3f78f3['sid']){return _0x44e41b[_0x869e('0x15')]({'messageId':_0x3f78f3['sid']});}})[_0x869e('0x17')](function(_0x2860eb){logger[_0x869e('0x18')](_0x869e('0x27'),'afterCreate','twilio',util[_0x869e('0x28')](_0x2860eb,{'showHidden':![],'depth':null}));});}else{logger[_0x869e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x869e('0x29'),_0x869e('0x1d'),_0x869e('0x2a'));}break;case _0x869e('0x2b'):var _0x3c2eff=_0x869e('0x2c');if(_0x1e7aa5['username']&&_0x1e7aa5['password']){var _0x209a81={'recipient':[_0x3e9b4a['phone']],'message':_0x3e9b4a[_0x869e('0xa')],'message_type':_0x1e7aa5[_0x869e('0x2d')]};if(_0x1e7aa5[_0x869e('0x2d')]&&_0x1e7aa5[_0x869e('0x2d')]!=='SI'){_0x209a81['sender']=_0x1e7aa5[_0x869e('0x20')];}var _0x40fd54={'url':_0x3c2eff+_0x869e('0x2e')+_0x1e7aa5[_0x869e('0x2f')]+_0x869e('0x30')+_0x1e7aa5[_0x869e('0x31')],'method':_0x869e('0x32')};rp(_0x40fd54)[_0x869e('0x26')](function(_0x174aba){var _0x5aa807=_0x174aba[_0x869e('0x33')](';');var _0x4b16e8={'user_key':_0x5aa807[0x0],'session_key':_0x5aa807[0x1]};_0x40fd54={'url':_0x3c2eff+_0x869e('0x34'),'method':_0x869e('0x35'),'headers':{'user_key':_0x4b16e8[_0x869e('0x36')],'Session_key':_0x4b16e8[_0x869e('0x37')]},'json':!![],'body':_0x209a81};return rp(_0x40fd54);})[_0x869e('0x26')](function(_0x97f9fa){if(_0x97f9fa['total_sent']>=0x1){var _0x15c6a3={'messageId':_0x97f9fa[_0x869e('0x38')]};if(_0x1e7aa5[_0x869e('0x2d')]!=='GP'||!_0x1e7aa5['deliveryReport']){_0x15c6a3['read']=!![];}return _0x44e41b['update'](_0x15c6a3);}else{return logger[_0x869e('0x18')](_0x869e('0x27'),_0x869e('0x29'),_0x869e('0x2b'),util[_0x869e('0x28')](_0x97f9fa,{'showHidden':![],'depth':null}));}})[_0x869e('0x17')](function(_0x3e37ba){return logger[_0x869e('0x18')](_0x869e('0x27'),_0x869e('0x29'),_0x869e('0x2b'),util[_0x869e('0x28')](_0x3e37ba,{'showHidden':![],'depth':null}));});}else{logger[_0x869e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x869e('0x2b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x869e('0x39'):if(_0x1e7aa5[_0x869e('0x1f')]){var _0x541177={'recipient':_0x3e9b4a['phone'],'message':_0x3e9b4a[_0x869e('0xa')],'sender':_0x1e7aa5['senderString']||_0x1e7aa5[_0x869e('0x20')],'authorization':_0x1e7aa5[_0x869e('0x1f')]};var _0x42a4a8={'method':_0x869e('0x35'),'uri':_0x869e('0x3a'),'body':_0x541177,'json':!![]};rp(_0x42a4a8)[_0x869e('0x26')](function(_0x2a5199){var _0x2e7064={'messageId':_0x2a5199[_0x869e('0x3b')]};if(!_0x1e7aa5[_0x869e('0x3c')]){_0x2e7064[_0x869e('0x3d')]=!![];}return _0x44e41b[_0x869e('0x15')](_0x2e7064);})['catch'](function(_0x30de13){logger[_0x869e('0x18')](_0x869e('0x27'),_0x869e('0x29'),_0x869e('0x39'),util[_0x869e('0x28')](_0x30de13,{'showHidden':![],'depth':null}));});}else{logger[_0x869e('0x18')](_0x869e('0x27'),'afterCreate','connectel',_0x869e('0x3e'));}break;case _0x869e('0x3f'):if(_0x1e7aa5['username']&&_0x1e7aa5['password']){var _0x541177={'messages':[{'source':_0x869e('0x40'),'to':_0x3e9b4a[_0x869e('0x20')],'body':_0x3e9b4a[_0x869e('0xa')],'from':_0x1e7aa5[_0x869e('0x41')]||_0x1e7aa5['phone']}]};var _0x2031f0=util['format']('%s:%s',_0x1e7aa5[_0x869e('0x2f')],_0x1e7aa5[_0x869e('0x31')]);var _0x42a4a8={'method':_0x869e('0x35'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x541177,'headers':{'Authorization':util[_0x869e('0x42')](_0x869e('0x43'),new Buffer(_0x2031f0)['toString']('base64'))},'json':!![]};rp(_0x42a4a8)[_0x869e('0x26')](function(_0x44fd9e){if(_0x44fd9e['http_code']>=0xc8&&_0x44fd9e[_0x869e('0x44')]<=0xce){if(_0x44fd9e[_0x869e('0x45')]&&_0x44fd9e['data']['queued_count']>0x0){var _0xfe9c54=_[_0x869e('0x46')](_0x44fd9e[_0x869e('0x45')][_0x869e('0x21')]);var _0x85ccf2={'messageId':_0xfe9c54[_0x869e('0x47')]};if(!_0x1e7aa5[_0x869e('0x3c')]){_0x85ccf2['read']=!![];}return _0x44e41b[_0x869e('0x15')](_0x85ccf2);}else{logger[_0x869e('0x18')](_0x869e('0x27'),'afterCreate',_0x869e('0x48'),util[_0x869e('0x28')](_0x44fd9e,{'showHidden':![],'depth':null}));}}else{logger[_0x869e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x869e('0x29'),'clickSend',util[_0x869e('0x28')](_0x44fd9e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3c95b0){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x869e('0x48'),util[_0x869e('0x28')](_0x3c95b0,{'showHidden':![],'depth':null}));});}else{logger[_0x869e('0x18')](_0x869e('0x27'),_0x869e('0x29'),_0x869e('0x48'),_0x869e('0x49'));}break;case _0x869e('0x4a'):if(_0x1e7aa5['authId']&&_0x1e7aa5['authToken']){var _0x541177={'dst':_0x3e9b4a[_0x869e('0x20')],'text':_0x3e9b4a['body'],'src':_0x1e7aa5[_0x869e('0x41')]||_0x1e7aa5[_0x869e('0x20')],'url':_0x1e7aa5['remote']+'/api/sms/messages/'+_0x3e9b4a['id']+_0x869e('0x24')+_0x1e7aa5['token']};var _0x2031f0=util[_0x869e('0x42')](_0x869e('0x4b'),_0x1e7aa5[_0x869e('0x4c')],_0x1e7aa5[_0x869e('0x1f')]);var _0x42a4a8={'method':_0x869e('0x35'),'uri':util[_0x869e('0x42')]('https://api.plivo.com/v1/Account/%s/Message/',_0x1e7aa5[_0x869e('0x4c')]),'body':_0x541177,'headers':{'Authorization':util['format'](_0x869e('0x43'),new Buffer(_0x2031f0)[_0x869e('0x4d')]('base64'))},'json':!![]};rp(_0x42a4a8)[_0x869e('0x26')](function(_0x5ee6ff){var _0x543a49={'messageId':_0x5ee6ff[_0x869e('0x4e')][0x0]};return _0x44e41b[_0x869e('0x15')](_0x543a49);})[_0x869e('0x17')](function(_0x1c2972){logger['error'](_0x869e('0x27'),'afterCreate',_0x869e('0x4a'),util['inspect'](_0x1c2972,{'showHidden':![],'depth':null}));});}else{logger[_0x869e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x869e('0x29'),_0x869e('0x4a'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x1e7aa5[_0x869e('0x2f')]&&_0x1e7aa5['password']){if(_0x1e7aa5['baseUrl']){var _0x47aa7d={'method':'POST','uri':_0x1e7aa5['baseUrl']+_0x869e('0x4f'),'body':{'username':_0x1e7aa5[_0x869e('0x2f')],'password':_0x1e7aa5['password']},'json':!![]};return rp(_0x47aa7d)[_0x869e('0x26')](function(_0x447a0e){var _0x24bd8c={'method':_0x869e('0x35'),'uri':_0x1e7aa5[_0x869e('0x50')]+_0x869e('0x51'),'body':{'messages':[{'from':_0x1e7aa5[_0x869e('0x20')],'destinations':[{'to':_0x3e9b4a['phone']}],'text':_0x3e9b4a[_0x869e('0xa')],'notifyUrl':_0x1e7aa5[_0x869e('0x52')]+_0x869e('0x23')+_0x3e9b4a['id']+'/status?token='+_0x1e7aa5[_0x869e('0x25')],'notifyContentType':_0x869e('0x53'),'callbackData':_0x1e7aa5[_0x869e('0x20')]+';'+_0x3e9b4a[_0x869e('0xa')]}]},'headers':{'Authorization':_0x869e('0x54')+_0x447a0e[_0x869e('0x25')]},'json':!![]};return rp(_0x24bd8c)[_0x869e('0x26')](function(_0x414ea3){if(_0x414ea3['messages']){var _0x1beaaa={'messageId':_0x414ea3[_0x869e('0x21')][0x0][_0x869e('0x8')]};if(!_0x1e7aa5[_0x869e('0x3c')]){_0x1beaaa[_0x869e('0x3d')]=!![];}return _0x44e41b[_0x869e('0x15')](_0x1beaaa);}else{return logger[_0x869e('0x18')](_0x869e('0x27'),_0x869e('0x29'),_0x869e('0x55'),util[_0x869e('0x28')](_0x414ea3,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x46cd88){return logger['error'](_0x869e('0x27'),_0x869e('0x29'),_0x869e('0x55'),util[_0x869e('0x28')](_0x46cd88,{'showHidden':![],'depth':null}));});}else{logger[_0x869e('0x18')](_0x869e('0x27'),_0x869e('0x29'),_0x869e('0x55'),_0x869e('0x56'));}}else{logger[_0x869e('0x18')](_0x869e('0x27'),_0x869e('0x29'),_0x869e('0x55'),_0x869e('0x49'));}break;case _0x869e('0x57'):var _0x31912a=require(_0x869e('0x58'));if(_0x1e7aa5[_0x869e('0x59')]){var _0x563e77={};_0x563e77[_0x869e('0x5a')]=_0x1e7aa5[_0x869e('0x2f')];_0x563e77[_0x869e('0x20')]=_0x3e9b4a[_0x869e('0x20')];_0x563e77['sender']=_0x1e7aa5['phone'];_0x563e77[_0x869e('0x5b')]=_0x3e9b4a[_0x869e('0xa')];_0x563e77[_0x869e('0x5c')]=+new Date();var _0xd84ed1='';var _0x946f2b='';var _0x34b37e=Object[_0x869e('0x5d')](_0x563e77);_0x34b37e['sort']();for(var _0x187190=0x0;_0x187190<_0x34b37e[_0x869e('0x5e')];_0x187190++){if(_0xd84ed1!=''){_0xd84ed1+='&';}_0xd84ed1+=_0x34b37e[_0x187190]+'='+encodeURIComponent(_0x563e77[_0x34b37e[_0x187190]]);_0x946f2b+=_0x563e77[_0x34b37e[_0x187190]];}_0x946f2b+=_0x1e7aa5['apiKey'];_0x946f2b=_0x31912a[_0x869e('0x5f')](_0x869e('0x60'))[_0x869e('0x15')](_0x946f2b)['digest']('hex');if(_0xd84ed1!==''){_0xd84ed1+='&';}_0xd84ed1+=_0x869e('0x61')+_0x946f2b;var _0x40fd54={'method':'GET','uri':_0x869e('0x62')+_0xd84ed1,'json':!![]};return rp(_0x40fd54)[_0x869e('0x26')](function(_0x4605c8){var _0x1ed035=Object['keys'](_0x4605c8);if(_0x4605c8[_0x1ed035[0x0]][_0x869e('0x18')]&&parseInt(_0x4605c8[_0x1ed035[0x0]][_0x869e('0x18')])===0x0){var _0x127c6c={'messageId':_0x4605c8[_0x1ed035[0x0]][_0x869e('0x63')]};if(!_0x1e7aa5[_0x869e('0x3c')]){_0x127c6c[_0x869e('0x3d')]=!![];}return _0x44e41b['update'](_0x127c6c);}else{return logger[_0x869e('0x18')](_0x869e('0x27'),'afterCreate',_0x869e('0x57'),util[_0x869e('0x28')](_0x4605c8[_0x869e('0x18')],{'showHidden':![],'depth':null}));}})[_0x869e('0x17')](function(_0x206383){return logger[_0x869e('0x18')](_0x869e('0x27'),_0x869e('0x29'),_0x869e('0x57'),util[_0x869e('0x28')](_0x206383,{'showHidden':![],'depth':null}));});}else{logger[_0x869e('0x18')](_0x869e('0x27'),'afterCreate',_0x869e('0x57'),_0x869e('0x64'));}break;case _0x869e('0x65'):if(_0x1e7aa5['apiKey']){var _0x13a328={'method':_0x869e('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x1e7aa5[_0x869e('0x59')]},'body':{'content':_0x3e9b4a[_0x869e('0xa')],'to':[_0x3e9b4a['phone']],'from':_0x1e7aa5[_0x869e('0x20')],'binary':![],'clientMessageId':_0x869e('0x66'),'charset':_0x869e('0x67')},'json':!![]};rp(_0x13a328)[_0x869e('0x26')](function(_0x16f79a){if(!_0x16f79a['error']){var _0x44f542={'messageId':_0x16f79a[_0x869e('0x21')][0x0][_0x869e('0x68')]};if(!_0x1e7aa5['deliveryReport']){_0x44f542[_0x869e('0x3d')]=!![];}return _0x44e41b[_0x869e('0x15')](_0x44f542);}else{return logger[_0x869e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x869e('0x29'),'clickatell',util[_0x869e('0x28')](_0x16f79a[_0x869e('0x18')],{'showHidden':![],'depth':null}));}})[_0x869e('0x17')](function(_0x458b28){return logger['error'](_0x869e('0x27'),_0x869e('0x29'),_0x869e('0x65'),util[_0x869e('0x28')](_0x458b28,{'showHidden':![],'depth':null}));});}else{logger[_0x869e('0x18')](_0x869e('0x27'),_0x869e('0x29'),_0x869e('0x65'),_0x869e('0x64'));}break;case _0x869e('0x69'):if(_0x1e7aa5[_0x869e('0x59')]){var _0x1e640d={};var _0x40fd54={'method':_0x869e('0x35'),'uri':_0x869e('0x6a'),'headers':{'Authorization':_0x869e('0x6b')+_0x1e7aa5['apiKey'],'Content-Type':_0x869e('0x53')},'body':{'from':_0x1e7aa5[_0x869e('0x20')],'to':_0x3e9b4a['phone'],'text':_0x3e9b4a[_0x869e('0xa')]},'json':!![]};return rp(_0x40fd54)[_0x869e('0x26')](function(_0x366ff0){if(_0x366ff0['code']==0xca){_0x1e640d[_0x869e('0x6c')]=_0x366ff0;var _0x3110a8={'method':_0x869e('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x869e('0x6b')+_0x1e7aa5[_0x869e('0x59')],'Content-Type':_0x869e('0x53')},'body':{'refid':_0x1e640d[_0x869e('0x6c')][_0x869e('0x6d')]},'json':!![]};return rp(_0x3110a8)['then'](function(_0x125840){_0x1e640d['status']=_0x125840;var _0x4a3384={'messageId':_0x1e640d['message']['refid'],'read':!![]};return _0x44e41b[_0x869e('0x15')](_0x4a3384);});}else{return logger[_0x869e('0x18')](_0x869e('0x27'),_0x869e('0x29'),'intelepeer',util['inspect'](_0x366ff0,{'showHidden':![],'depth':null}));}})[_0x869e('0x17')](function(_0x4c4005){return logger[_0x869e('0x18')](_0x869e('0x27'),'afterCreate','intelepeer',util['inspect'](_0x4c4005,{'showHidden':![],'depth':null}));});}else{return logger[_0x869e('0x18')](_0x869e('0x27'),_0x869e('0x29'),_0x869e('0x69'),'Token\x20not\x20received');}break;}}})[_0x869e('0x6e')](function(){_0x5d2a66();});}else{_0x5d2a66();}}},'charset':_0x869e('0x6f'),'collate':_0x869e('0x70')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 8a9a42e..a24c3b3 100644 --- a/server/api/smsMessage/smsMessage.rpc.js +++ b/server/api/smsMessage/smsMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14a0=['code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','defaults','redis','localhost','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21b28b,_0x3dd754){var _0x117bc2=function(_0x1c5b4e){while(--_0x1c5b4e){_0x21b28b['push'](_0x21b28b['shift']());}};_0x117bc2(++_0x3dd754);}(_0x14a0,0x8e));var _0x014a=function(_0x2fb68e,_0x179697){_0x2fb68e=_0x2fb68e-0x0;var _0x4b33ef=_0x14a0[_0x2fb68e];return _0x4b33ef;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});config['redis']=_[_0x014a('0xa')](config[_0x014a('0xb')],{'host':_0x014a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x014a('0xd'))['register'](socket);function respondWithRpcPromise(_0x490ea2,_0x5aa52f,_0x4f3539){return new BPromise(function(_0x330469,_0x4c7418){return client[_0x014a('0xe')](_0x490ea2,_0x4f3539)[_0x014a('0xf')](function(_0x543bbf){logger[_0x014a('0x10')](_0x014a('0x11'),_0x5aa52f,_0x014a('0x12'));logger[_0x014a('0x13')](_0x014a('0x14'),_0x5aa52f,_0x014a('0x12'),JSON[_0x014a('0x15')](_0x543bbf));if(_0x543bbf[_0x014a('0x16')]){if(_0x543bbf[_0x014a('0x16')][_0x014a('0x17')]===0x1f4){logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x543bbf['error'][_0x014a('0x18')]);return _0x4c7418(_0x543bbf[_0x014a('0x16')]['message']);}logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x543bbf['error'][_0x014a('0x18')]);return _0x330469(_0x543bbf[_0x014a('0x16')][_0x014a('0x18')]);}else{logger[_0x014a('0x10')](_0x014a('0x11'),_0x5aa52f,_0x014a('0x12'));_0x330469(_0x543bbf[_0x014a('0x19')][_0x014a('0x18')]);}})[_0x014a('0x1a')](function(_0x3b9341){logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x3b9341);_0x4c7418(_0x3b9341);});});}exports[_0x014a('0x1b')]=function(_0x34e5c3){var _0x5c69c5=this;return new Promise(function(_0x359903,_0x109a9c){return db[_0x014a('0x1c')][_0x014a('0x1d')](_0x34e5c3[_0x014a('0x1e')],{'raw':_0x34e5c3[_0x014a('0x1f')]?_0x34e5c3[_0x014a('0x1f')][_0x014a('0x20')]===undefined?!![]:![]:!![]})[_0x014a('0xf')](function(_0x486e66){logger[_0x014a('0x10')]('CreateSmsMessage',_0x34e5c3);logger[_0x014a('0x13')](_0x014a('0x1b'),_0x34e5c3,JSON[_0x014a('0x15')](_0x486e66));_0x359903(_0x486e66);})[_0x014a('0x1a')](function(_0x2b3c10){logger[_0x014a('0x16')](_0x014a('0x1b'),_0x2b3c10[_0x014a('0x18')],_0x34e5c3);_0x109a9c(_0x5c69c5[_0x014a('0x16')](0x1f4,_0x2b3c10['message']));});});}; \ No newline at end of file +var _0x1a85=['info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','options','raw','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','socket.io-emitter','register','request','then'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x1a85,0x178));var _0x51a8=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0x1a85[_0x34ad72];return _0x5c9aa8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});config['redis']=_[_0x51a8('0x8')](config[_0x51a8('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x51a8('0xa'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x51a8('0xb')](socket);function respondWithRpcPromise(_0x2f276b,_0x1a476d,_0x45a3f4){return new BPromise(function(_0x418f06,_0x421fa4){return client[_0x51a8('0xc')](_0x2f276b,_0x45a3f4)[_0x51a8('0xd')](function(_0x34c887){logger[_0x51a8('0xe')](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));logger[_0x51a8('0x11')](_0x51a8('0x12'),_0x1a476d,_0x51a8('0x10'),JSON[_0x51a8('0x13')](_0x34c887));if(_0x34c887[_0x51a8('0x14')]){if(_0x34c887['error'][_0x51a8('0x15')]===0x1f4){logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887['error'][_0x51a8('0x16')]);return _0x421fa4(_0x34c887['error'][_0x51a8('0x16')]);}logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);return _0x418f06(_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);}else{logger['info'](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));_0x418f06(_0x34c887[_0x51a8('0x17')][_0x51a8('0x16')]);}})[_0x51a8('0x18')](function(_0x544886){logger['error'](_0x51a8('0xf'),_0x1a476d,_0x544886);_0x421fa4(_0x544886);});});}exports[_0x51a8('0x19')]=function(_0x2217ce){var _0x2f2681=this;return new Promise(function(_0x2a4c4c,_0x3bc044){return db[_0x51a8('0x1a')][_0x51a8('0x1b')](_0x2217ce['body'],{'raw':_0x2217ce[_0x51a8('0x1c')]?_0x2217ce['options'][_0x51a8('0x1d')]===undefined?!![]:![]:!![]})[_0x51a8('0xd')](function(_0x8bda40){logger[_0x51a8('0xe')]('CreateSmsMessage',_0x2217ce);logger[_0x51a8('0x11')]('CreateSmsMessage',_0x2217ce,JSON['stringify'](_0x8bda40));_0x2a4c4c(_0x8bda40);})[_0x51a8('0x18')](function(_0x52e503){logger[_0x51a8('0x14')](_0x51a8('0x19'),_0x52e503[_0x51a8('0x16')],_0x2217ce);_0x3bc044(_0x2f2681[_0x51a8('0x14')](0x1f4,_0x52e503[_0x51a8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 6c62956..71b3d6c 100644 --- a/server/api/smsMessage/smsMessage.socket.js +++ b/server/api/smsMessage/smsMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x857c=['remove','update','removeListener','smsMessage:','./smsMessage.events','save'];(function(_0x344a70,_0x1e584d){var _0x4b3a19=function(_0x305258){while(--_0x305258){_0x344a70['push'](_0x344a70['shift']());}};_0x4b3a19(++_0x1e584d);}(_0x857c,0xa6));var _0xc857=function(_0x5ad925,_0x4ff7c3){_0x5ad925=_0x5ad925-0x0;var _0x21277c=_0x857c[_0x5ad925];return _0x21277c;};'use strict';var SmsMessageEvents=require(_0xc857('0x0'));var events=[_0xc857('0x1'),_0xc857('0x2'),_0xc857('0x3')];function createListener(_0x5a87e9,_0x3e4905){return function(_0x171b6b){_0x3e4905['emit'](_0x5a87e9,_0x171b6b);};}function removeListener(_0x7f963a,_0x4ffb8a){return function(){SmsMessageEvents[_0xc857('0x4')](_0x7f963a,_0x4ffb8a);};}exports['register']=function(_0x52b190){for(var _0xd2c35f=0x0,_0x18802e=events['length'];_0xd2c35f<_0x18802e;_0xd2c35f++){var _0x10fb07=events[_0xd2c35f];var _0x5c4c7c=createListener(_0xc857('0x5')+_0x10fb07,_0x52b190);SmsMessageEvents['on'](_0x10fb07,_0x5c4c7c);}}; \ No newline at end of file +var _0x76b2=['save','remove','emit','length'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x76b2,0x108));var _0x276b=function(_0x53f636,_0x1d15f1){_0x53f636=_0x53f636-0x0;var _0x21678a=_0x76b2[_0x53f636];return _0x21678a;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x276b('0x0'),_0x276b('0x1'),'update'];function createListener(_0x121130,_0x484d90){return function(_0x5a9294){_0x484d90[_0x276b('0x2')](_0x121130,_0x5a9294);};}function removeListener(_0x5330ab,_0x78c1bf){return function(){SmsMessageEvents['removeListener'](_0x5330ab,_0x78c1bf);};}exports['register']=function(_0x4561da){for(var _0x76affe=0x0,_0x3a2c56=events[_0x276b('0x3')];_0x76affe<_0x3a2c56;_0x76affe++){var _0x44561f=events[_0x76affe];var _0x1a3bca=createListener('smsMessage:'+_0x44561f,_0x4561da);SmsMessageEvents['on'](_0x44561f,_0x1a3bca);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 85a9cfe..07fae17 100644 --- a/server/api/smsQueue/index.js +++ b/server/api/smsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ade=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','/describe','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','post','addTeams','addAgents','update','delete','removeTeams'];(function(_0x1e8269,_0x21d850){var _0x22e381=function(_0x36da00){while(--_0x36da00){_0x1e8269['push'](_0x1e8269['shift']());}};_0x22e381(++_0x21d850);}(_0x9ade,0x8e));var _0xe9ad=function(_0x11c331,_0x523ccf){_0x11c331=_0x11c331-0x0;var _0x1b89e1=_0x9ade[_0x11c331];return _0x1b89e1;};'use strict';var multer=require(_0xe9ad('0x0'));var util=require(_0xe9ad('0x1'));var path=require(_0xe9ad('0x2'));var timeout=require(_0xe9ad('0x3'));var express=require(_0xe9ad('0x4'));var router=express[_0xe9ad('0x5')]();var auth=require(_0xe9ad('0x6'));var interaction=require(_0xe9ad('0x7'));var config=require(_0xe9ad('0x8'));var controller=require(_0xe9ad('0x9'));router['get']('/',auth[_0xe9ad('0xa')](),controller['index']);router['get'](_0xe9ad('0xb'),auth[_0xe9ad('0xa')](),controller[_0xe9ad('0xc')]);router[_0xe9ad('0xd')](_0xe9ad('0xe'),auth[_0xe9ad('0xa')](),controller[_0xe9ad('0xf')]);router[_0xe9ad('0xd')](_0xe9ad('0x10'),auth[_0xe9ad('0xa')](),controller[_0xe9ad('0x11')]);router['get'](_0xe9ad('0x12'),auth[_0xe9ad('0xa')](),controller['getTeams']);router[_0xe9ad('0xd')](_0xe9ad('0x13'),auth[_0xe9ad('0xa')](),controller['getAgents']);router[_0xe9ad('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe9ad('0x14')](_0xe9ad('0x12'),auth[_0xe9ad('0xa')](),controller[_0xe9ad('0x15')]);router[_0xe9ad('0x14')](_0xe9ad('0x13'),auth[_0xe9ad('0xa')](),controller[_0xe9ad('0x16')]);router['put'](_0xe9ad('0xe'),auth[_0xe9ad('0xa')](),controller[_0xe9ad('0x17')]);router[_0xe9ad('0x18')](_0xe9ad('0xe'),auth[_0xe9ad('0xa')](),controller['destroy']);router[_0xe9ad('0x18')](_0xe9ad('0x12'),auth[_0xe9ad('0xa')](),controller[_0xe9ad('0x19')]);router[_0xe9ad('0x18')](_0xe9ad('0x13'),auth[_0xe9ad('0xa')](),controller[_0xe9ad('0x1a')]);module[_0xe9ad('0x1b')]=router; \ No newline at end of file +var _0xa1aa=['addAgents','delete','destroy','removeTeams','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams'];(function(_0x39010b,_0x17e844){var _0x3d8797=function(_0x33924a){while(--_0x33924a){_0x39010b['push'](_0x39010b['shift']());}};_0x3d8797(++_0x17e844);}(_0xa1aa,0x88));var _0xaa1a=function(_0x393099,_0x150b1c){_0x393099=_0x393099-0x0;var _0x277ca6=_0xa1aa[_0x393099];return _0x277ca6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaa1a('0x0'));var timeout=require(_0xaa1a('0x1'));var express=require(_0xaa1a('0x2'));var router=express[_0xaa1a('0x3')]();var auth=require(_0xaa1a('0x4'));var interaction=require(_0xaa1a('0x5'));var config=require(_0xaa1a('0x6'));var controller=require('./smsQueue.controller');router[_0xaa1a('0x7')]('/',auth[_0xaa1a('0x8')](),controller['index']);router[_0xaa1a('0x7')](_0xaa1a('0x9'),auth[_0xaa1a('0x8')](),controller[_0xaa1a('0xa')]);router[_0xaa1a('0x7')](_0xaa1a('0xb'),auth[_0xaa1a('0x8')](),controller[_0xaa1a('0xc')]);router[_0xaa1a('0x7')]('/:id/members',auth[_0xaa1a('0x8')](),controller['getMembers']);router[_0xaa1a('0x7')](_0xaa1a('0xd'),auth[_0xaa1a('0x8')](),controller[_0xaa1a('0xe')]);router[_0xaa1a('0x7')](_0xaa1a('0xf'),auth[_0xaa1a('0x8')](),controller[_0xaa1a('0x10')]);router[_0xaa1a('0x11')]('/',auth[_0xaa1a('0x8')](),controller[_0xaa1a('0x12')]);router['post']('/:id/teams',auth[_0xaa1a('0x8')](),controller[_0xaa1a('0x13')]);router[_0xaa1a('0x11')](_0xaa1a('0xf'),auth[_0xaa1a('0x8')](),controller[_0xaa1a('0x14')]);router['put'](_0xaa1a('0xb'),auth[_0xaa1a('0x8')](),controller['update']);router[_0xaa1a('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xaa1a('0x16')]);router[_0xaa1a('0x15')](_0xaa1a('0xd'),auth[_0xaa1a('0x8')](),controller[_0xaa1a('0x17')]);router[_0xaa1a('0x15')](_0xaa1a('0xf'),auth[_0xaa1a('0x8')](),controller[_0xaa1a('0x18')]);module[_0xaa1a('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index d9f9186..9b14ad7 100644 --- a/server/api/smsQueue/smsQueue.attributes.js +++ b/server/api/smsQueue/smsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6850=['name','beepall','roundrobin','STRING'];(function(_0x195a76,_0x39510b){var _0x56d47f=function(_0x484d8d){while(--_0x484d8d){_0x195a76['push'](_0x195a76['shift']());}};_0x56d47f(++_0x39510b);}(_0x6850,0x103));var _0x0685=function(_0x29b274,_0x100069){_0x29b274=_0x29b274-0x0;var _0x357a9e=_0x6850[_0x29b274];return _0x357a9e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0685('0x0')],'unique':_0x0685('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0685('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x0685('0x2'),_0x0685('0x3'))}}; \ No newline at end of file +var _0xe127=['STRING','INTEGER','rrmemory','roundrobin','sequelize','exports','name'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0xe127,0x82));var _0x7e12=function(_0x1316b1,_0x362a1a){_0x1316b1=_0x1316b1-0x0;var _0x159c93=_0xe127[_0x1316b1];return _0x159c93;};'use strict';var Sequelize=require(_0x7e12('0x0'));module[_0x7e12('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7e12('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7e12('0x3')]},'timeout':{'type':Sequelize[_0x7e12('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7e12('0x5'),'beepall',_0x7e12('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index b57f68c..ee33a62 100644 --- a/server/api/smsQueue/smsQueue.controller.js +++ b/server/api/smsQueue/smsQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21a3=['reject','save','then','destroy','get','SmsQueues','UserProfileResource','error','name','send','index','SmsQueue','rawAttributes','model','keys','query','filters','attributes','fields','length','order','sort','where','pick','merge','map','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','intersection','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','nolimit','SmsQueueId','UserSmsQueue','User','UserId','updatedAt','createdAt','format','%s/%s','smsPause','getTeams','Team','hasOwnProperty','teams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','userSmsQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_sms_queues','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','compact','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','set','Content-Range','json','apply'];(function(_0x35445f,_0x333f58){var _0x3e9875=function(_0x2b5007){while(--_0x2b5007){_0x35445f['push'](_0x35445f['shift']());}};_0x3e9875(++_0x333f58);}(_0x21a3,0x66));var _0x321a=function(_0x361078,_0x283dcb){_0x361078=_0x361078-0x0;var _0x22d9e8=_0x21a3[_0x361078];return _0x22d9e8;};'use strict';var pdf=require(_0x321a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x321a('0x1'));var zipdir=require(_0x321a('0x2'));var jsonpatch=require(_0x321a('0x3'));var rp=require(_0x321a('0x4'));var moment=require(_0x321a('0x5'));var BPromise=require(_0x321a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x321a('0x7'));var sox=require(_0x321a('0x8'));var csv=require(_0x321a('0x9'));var ejs=require(_0x321a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x321a('0xb'));var crypto=require(_0x321a('0xc'));var jsforce=require(_0x321a('0xd'));var deskjs=require(_0x321a('0xe'));var toCsv=require(_0x321a('0x9'));var querystring=require(_0x321a('0xf'));var Papa=require(_0x321a('0x10'));var Redis=require(_0x321a('0x11'));var authService=require(_0x321a('0x12'));var qs=require(_0x321a('0x13'));var hardwareService=require(_0x321a('0x14'));var logger=require(_0x321a('0x15'))('api');var utils=require(_0x321a('0x16'));var config=require(_0x321a('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x321a('0x18')](config['redis'],{'host':_0x321a('0x19'),'port':0x18eb});var socket=require(_0x321a('0x1a'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x321a('0x1b')](socket);function respondWithStatusCode(_0x123b53,_0x13a73b){_0x13a73b=_0x13a73b||0xcc;return function(_0x3677f9){if(_0x3677f9){return _0x123b53[_0x321a('0x1c')](_0x13a73b);}return _0x123b53[_0x321a('0x1d')](_0x13a73b)[_0x321a('0x1e')]();};}function respondWithResult(_0xfe6906,_0x5e0895){_0x5e0895=_0x5e0895||0xc8;return function(_0x11d623){if(_0x11d623){return _0xfe6906[_0x321a('0x1d')](_0x5e0895)['json'](_0x11d623);}};}function respondWithFilteredResult(_0x45ceb2,_0x24b120){return function(_0x460de1){if(_0x460de1){var _0x595c1e=_0x460de1['count'],_0x5b1810=_0x24b120[_0x321a('0x1f')],_0x464bd7=_0x24b120[_0x321a('0x1f')]+_0x24b120[_0x321a('0x20')],_0x35fd6f;if(_0x464bd7>=_0x595c1e){_0x464bd7=_0x595c1e;_0x35fd6f=0xc8;}else{_0x35fd6f=0xce;}_0x45ceb2['status'](_0x35fd6f);return _0x45ceb2[_0x321a('0x21')](_0x321a('0x22'),_0x5b1810+'-'+_0x464bd7+'/'+_0x595c1e)[_0x321a('0x23')](_0x460de1);}return null;};}function patchUpdates(_0x423cb8){return function(_0x2c3a70){try{jsonpatch[_0x321a('0x24')](_0x2c3a70,_0x423cb8,!![]);}catch(_0x16ad4b){return BPromise[_0x321a('0x25')](_0x16ad4b);}return _0x2c3a70[_0x321a('0x26')]();};}function saveUpdates(_0x2765e5,_0x1b94a1){return function(_0x225efb){if(_0x225efb){return _0x225efb['update'](_0x2765e5)[_0x321a('0x27')](function(_0x8a9206){return _0x8a9206;});}return null;};}function removeEntity(_0x1ad8b8,_0x5ae154){return function(_0x26da8e){if(_0x26da8e){return _0x26da8e[_0x321a('0x28')]()['then'](function(){var _0x51e7a8=_0x26da8e[_0x321a('0x29')]({'plain':!![]});var _0x5a66c2=_0x321a('0x2a');return db[_0x321a('0x2b')][_0x321a('0x28')]({'where':{'type':_0x5a66c2,'resourceId':_0x51e7a8['id']}})[_0x321a('0x27')](function(){return _0x26da8e;});})[_0x321a('0x27')](function(){_0x1ad8b8[_0x321a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x500e78,_0x2cb820){return function(_0x105216){if(!_0x105216){_0x500e78[_0x321a('0x1c')](0x194);}return _0x105216;};}function handleError(_0x4a25a9,_0x14b8e7){_0x14b8e7=_0x14b8e7||0x1f4;return function(_0x46eec2){logger[_0x321a('0x2c')](_0x46eec2['stack']);if(_0x46eec2[_0x321a('0x2d')]){delete _0x46eec2[_0x321a('0x2d')];}_0x4a25a9[_0x321a('0x1d')](_0x14b8e7)[_0x321a('0x2e')](_0x46eec2);};}exports[_0x321a('0x2f')]=function(_0x4ec4db,_0x363e40){var _0x2e17c6={},_0x3f0786={},_0x5eeb75={'count':0x0,'rows':[]};var _0x30908d=db[_0x321a('0x30')][_0x321a('0x31')];_0x3f0786[_0x321a('0x32')]=_[_0x321a('0x33')](_0x30908d);_0x3f0786[_0x321a('0x34')]=_['keys'](_0x4ec4db['query']);_0x3f0786[_0x321a('0x35')]=_['intersection'](_0x3f0786[_0x321a('0x32')],_0x3f0786[_0x321a('0x34')]);_0x2e17c6[_0x321a('0x36')]=_['intersection'](_0x3f0786['model'],qs[_0x321a('0x37')](_0x4ec4db['query'][_0x321a('0x37')]));_0x2e17c6['attributes']=_0x2e17c6['attributes'][_0x321a('0x38')]?_0x2e17c6[_0x321a('0x36')]:_0x3f0786[_0x321a('0x32')];if(!_0x4ec4db['query']['hasOwnProperty']('nolimit')){_0x2e17c6[_0x321a('0x20')]=qs[_0x321a('0x20')](_0x4ec4db['query']['limit']);_0x2e17c6[_0x321a('0x1f')]=qs[_0x321a('0x1f')](_0x4ec4db[_0x321a('0x34')][_0x321a('0x1f')]);}_0x2e17c6[_0x321a('0x39')]=qs[_0x321a('0x3a')](_0x4ec4db['query'][_0x321a('0x3a')]);_0x2e17c6[_0x321a('0x3b')]=qs[_0x321a('0x35')](_[_0x321a('0x3c')](_0x4ec4db['query'],_0x3f0786[_0x321a('0x35')]));if(_0x4ec4db['query']['filter']){_0x2e17c6[_0x321a('0x3b')]=_[_0x321a('0x3d')](_0x2e17c6['where'],{'$or':_[_0x321a('0x3e')](_0x30908d,function(_0x3b4db2){if(_0x3b4db2[_0x321a('0x3f')]['key']!==_0x321a('0x40')){var _0x1fa262={};_0x1fa262[_0x3b4db2['field']]={'$like':'%'+_0x4ec4db['query'][_0x321a('0x41')]+'%'};return _0x1fa262;}})});}_0x2e17c6=_[_0x321a('0x3d')]({},_0x2e17c6,_0x4ec4db[_0x321a('0x42')]);var _0x5d5392={'where':_0x2e17c6[_0x321a('0x3b')]};return db[_0x321a('0x30')][_0x321a('0x43')](_0x5d5392)[_0x321a('0x27')](function(_0x19fbbe){_0x5eeb75[_0x321a('0x43')]=_0x19fbbe;if(_0x4ec4db[_0x321a('0x34')][_0x321a('0x44')]){_0x2e17c6[_0x321a('0x45')]=[{'all':!![]}];}return db[_0x321a('0x30')][_0x321a('0x46')](_0x2e17c6);})[_0x321a('0x27')](function(_0x55c937){_0x5eeb75[_0x321a('0x47')]=_0x55c937;return _0x5eeb75;})[_0x321a('0x27')](respondWithFilteredResult(_0x363e40,_0x2e17c6))['catch'](handleError(_0x363e40,null));};exports[_0x321a('0x48')]=function(_0x450a15,_0x54d7f6){var _0x3fef37={'raw':!![],'where':{'id':_0x450a15[_0x321a('0x49')]['id']}},_0x13b557={};_0x13b557[_0x321a('0x32')]=_['keys'](db[_0x321a('0x30')][_0x321a('0x31')]);_0x13b557[_0x321a('0x34')]=_[_0x321a('0x33')](_0x450a15[_0x321a('0x34')]);_0x13b557[_0x321a('0x35')]=_[_0x321a('0x4a')](_0x13b557[_0x321a('0x32')],_0x13b557[_0x321a('0x34')]);_0x3fef37[_0x321a('0x36')]=_[_0x321a('0x4a')](_0x13b557[_0x321a('0x32')],qs['fields'](_0x450a15['query'][_0x321a('0x37')]));_0x3fef37[_0x321a('0x36')]=_0x3fef37[_0x321a('0x36')][_0x321a('0x38')]?_0x3fef37[_0x321a('0x36')]:_0x13b557['model'];if(_0x450a15[_0x321a('0x34')]['includeAll']){_0x3fef37[_0x321a('0x45')]=[{'all':!![]}];}_0x3fef37=_['merge']({},_0x3fef37,_0x450a15['options']);return db['SmsQueue'][_0x321a('0x4b')](_0x3fef37)[_0x321a('0x27')](handleEntityNotFound(_0x54d7f6,null))['then'](respondWithResult(_0x54d7f6,null))['catch'](handleError(_0x54d7f6,null));};exports[_0x321a('0x4c')]=function(_0x345484,_0x4bb7c9){return db['SmsQueue'][_0x321a('0x4c')](_0x345484[_0x321a('0x4d')],{})['then'](function(_0x2f3ca2){var _0x2c3fdc=_0x345484[_0x321a('0x4e')][_0x321a('0x29')]({'plain':!![]});if(!_0x2c3fdc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c3fdc[_0x321a('0x4f')]===_0x321a('0x4e')){var _0x11e02b=_0x2f3ca2['get']({'plain':!![]});var _0x3b7ef3=_0x321a('0x2a');return db[_0x321a('0x50')][_0x321a('0x4b')]({'where':{'name':_0x3b7ef3,'userProfileId':_0x2c3fdc['userProfileId']},'raw':!![]})[_0x321a('0x27')](function(_0x496573){if(_0x496573&&_0x496573[_0x321a('0x51')]===0x0){return db['UserProfileResource'][_0x321a('0x4c')]({'name':_0x11e02b[_0x321a('0x2d')],'resourceId':_0x11e02b['id'],'type':_0x496573['name'],'sectionId':_0x496573['id']},{})[_0x321a('0x27')](function(){return _0x2f3ca2;});}else{return _0x2f3ca2;}})[_0x321a('0x52')](function(_0x56010b){logger['error'](_0x321a('0x53'),_0x56010b);throw _0x56010b;});}return _0x2f3ca2;})[_0x321a('0x27')](respondWithResult(_0x4bb7c9,0xc9))['catch'](handleError(_0x4bb7c9,null));};exports[_0x321a('0x54')]=function(_0x5dcb98,_0x3cd07f){if(_0x5dcb98[_0x321a('0x4d')]['id']){delete _0x5dcb98['body']['id'];}return db[_0x321a('0x30')][_0x321a('0x4b')]({'where':{'id':_0x5dcb98[_0x321a('0x49')]['id']}})['then'](handleEntityNotFound(_0x3cd07f,null))['then'](saveUpdates(_0x5dcb98['body'],null))[_0x321a('0x27')](respondWithResult(_0x3cd07f,null))[_0x321a('0x52')](handleError(_0x3cd07f,null));};exports['destroy']=function(_0x35ed58,_0xf7b5cd){return db[_0x321a('0x30')][_0x321a('0x4b')]({'where':{'id':_0x35ed58[_0x321a('0x49')]['id']}})[_0x321a('0x27')](handleEntityNotFound(_0xf7b5cd,null))[_0x321a('0x27')](removeEntity(_0xf7b5cd,null))[_0x321a('0x52')](handleError(_0xf7b5cd,null));};exports['describe']=function(_0x28e90e,_0x2bcd23){return db[_0x321a('0x30')][_0x321a('0x55')]()[_0x321a('0x27')](respondWithResult(_0x2bcd23,null))[_0x321a('0x52')](handleError(_0x2bcd23,null));};exports[_0x321a('0x56')]=function(_0x5830a5,_0x374d5a,_0x1b01b2){var _0x5272e9={'raw':!![],'where':{}},_0x4ab140={},_0x277bc6;return db[_0x321a('0x30')]['findOne']({'where':{'id':_0x5830a5[_0x321a('0x49')]['id']}})[_0x321a('0x27')](handleEntityNotFound(_0x374d5a,null))[_0x321a('0x27')](function(_0x15d4de){if(_0x15d4de){_0x277bc6=_0x15d4de['get']({'plain':!![]});_0x4ab140['model']=_['keys'](db['UserSmsQueue'][_0x321a('0x31')]);_0x4ab140[_0x321a('0x34')]=_[_0x321a('0x33')](_0x5830a5[_0x321a('0x34')]);_0x4ab140[_0x321a('0x35')]=_[_0x321a('0x4a')](_0x4ab140[_0x321a('0x32')],_0x4ab140[_0x321a('0x34')]);_0x5272e9[_0x321a('0x36')]=_[_0x321a('0x4a')](_0x4ab140[_0x321a('0x32')],qs[_0x321a('0x37')](_0x5830a5[_0x321a('0x34')]['fields']));_0x5272e9['attributes']=_0x5272e9[_0x321a('0x36')][_0x321a('0x38')]?_0x5272e9[_0x321a('0x36')]:_0x4ab140[_0x321a('0x32')];if(!_0x5830a5[_0x321a('0x34')]['hasOwnProperty'](_0x321a('0x57'))){_0x5272e9[_0x321a('0x20')]=qs[_0x321a('0x20')](_0x5830a5[_0x321a('0x34')]['limit']);_0x5272e9[_0x321a('0x1f')]=qs['offset'](_0x5830a5[_0x321a('0x34')][_0x321a('0x1f')]);}_0x5272e9[_0x321a('0x39')]=qs[_0x321a('0x3a')](_0x5830a5[_0x321a('0x34')]['sort']);_0x5272e9['where']=qs[_0x321a('0x35')](_[_0x321a('0x3c')](_0x5830a5[_0x321a('0x34')],_0x4ab140[_0x321a('0x35')]));_0x5272e9['where'][_0x321a('0x58')]=_0x15d4de['id'];if(_0x5830a5['query']['filter']){_0x5272e9[_0x321a('0x3b')]=_[_0x321a('0x3d')](_0x5272e9[_0x321a('0x3b')],{'$or':_[_0x321a('0x3e')](_0x5272e9[_0x321a('0x36')],function(_0x1b204d){var _0x47f1e4={};_0x47f1e4[_0x1b204d]={'$like':'%'+_0x5830a5[_0x321a('0x34')][_0x321a('0x41')]+'%'};return _0x47f1e4;})});}_0x5272e9=_['merge']({},_0x5272e9,_0x5830a5[_0x321a('0x42')]);return db[_0x321a('0x59')][_0x321a('0x46')](_0x5272e9);}})[_0x321a('0x27')](function(_0x526497){if(_0x526497){return db[_0x321a('0x5a')]['findAndCountAll']({'where':{'id':_[_0x321a('0x3e')](_0x526497,_0x321a('0x5b')),'role':'agent'},'attributes':['id',_0x321a('0x2d'),'smsPause',_0x321a('0x5c'),_0x321a('0x5d')]});}})[_0x321a('0x27')](function(_0x16e202){if(_0x16e202){return{'count':_0x16e202['count'],'rows':_[_0x321a('0x3e')](_0x16e202[_0x321a('0x47')],function(_0xd537e6){return{'membername':_0xd537e6[_0x321a('0x2d')],'UserId':_0xd537e6['id'],'queue_name':_0x277bc6[_0x321a('0x2d')],'SmsQueueId':_0x277bc6['id'],'interface':util[_0x321a('0x5e')](_0x321a('0x5f'),'SIP',_0xd537e6[_0x321a('0x2d')]),'penalty':0x0,'paused':_0xd537e6[_0x321a('0x60')],'createdAt':_0xd537e6[_0x321a('0x5d')],'updatedAt':_0xd537e6[_0x321a('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x321a('0x27')](respondWithFilteredResult(_0x374d5a,_0x5272e9))[_0x321a('0x52')](handleError(_0x374d5a,null));};exports[_0x321a('0x61')]=function(_0x1b8bac,_0x938120,_0x4a22c6){var _0x546e8d={};var _0x4ccbb2={};var _0x1fba44;var _0x1f40d6;return db['SmsQueue']['findOne']({'where':{'id':_0x1b8bac['params']['id']}})['then'](handleEntityNotFound(_0x938120,null))['then'](function(_0x16d7b3){if(_0x16d7b3){_0x1fba44=_0x16d7b3;_0x4ccbb2[_0x321a('0x32')]=_['keys'](db[_0x321a('0x62')][_0x321a('0x31')]);_0x4ccbb2[_0x321a('0x34')]=_[_0x321a('0x33')](_0x1b8bac[_0x321a('0x34')]);_0x4ccbb2[_0x321a('0x35')]=_['intersection'](_0x4ccbb2[_0x321a('0x32')],_0x4ccbb2[_0x321a('0x34')]);_0x546e8d[_0x321a('0x36')]=_['intersection'](_0x4ccbb2[_0x321a('0x32')],qs[_0x321a('0x37')](_0x1b8bac[_0x321a('0x34')]['fields']));_0x546e8d['attributes']=_0x546e8d['attributes']['length']?_0x546e8d['attributes']:_0x4ccbb2[_0x321a('0x32')];_0x546e8d[_0x321a('0x39')]=qs[_0x321a('0x3a')](_0x1b8bac[_0x321a('0x34')][_0x321a('0x3a')]);_0x546e8d[_0x321a('0x3b')]=qs['filters'](_[_0x321a('0x3c')](_0x1b8bac[_0x321a('0x34')],_0x4ccbb2[_0x321a('0x35')]));if(_0x1b8bac['query']['filter']){_0x546e8d['where']=_[_0x321a('0x3d')](_0x546e8d[_0x321a('0x3b')],{'$or':_[_0x321a('0x3e')](_0x546e8d[_0x321a('0x36')],function(_0x1741c2){var _0x34a863={};_0x34a863[_0x1741c2]={'$like':'%'+_0x1b8bac[_0x321a('0x34')][_0x321a('0x41')]+'%'};return _0x34a863;})});}_0x546e8d=_[_0x321a('0x3d')]({},_0x546e8d,_0x1b8bac[_0x321a('0x42')]);return _0x1fba44[_0x321a('0x61')](_0x546e8d);}})[_0x321a('0x27')](function(_0x3147bd){if(_0x3147bd){_0x1f40d6=_0x3147bd['length'];if(!_0x1b8bac[_0x321a('0x34')][_0x321a('0x63')](_0x321a('0x57'))){_0x546e8d[_0x321a('0x20')]=qs[_0x321a('0x20')](_0x1b8bac[_0x321a('0x34')][_0x321a('0x20')]);_0x546e8d[_0x321a('0x1f')]=qs[_0x321a('0x1f')](_0x1b8bac[_0x321a('0x34')][_0x321a('0x1f')]);}return _0x1fba44[_0x321a('0x61')](_0x546e8d);}})['then'](function(_0x5c237e){if(_0x5c237e){return _0x5c237e?{'count':_0x1f40d6,'rows':_0x5c237e}:null;}})[_0x321a('0x27')](respondWithResult(_0x938120,null))[_0x321a('0x52')](handleError(_0x938120,null));};exports['addTeams']=function(_0x1636ce,_0x14791c,_0x780d7){var _0x41a241=_0x1636ce[_0x321a('0x4d')][_0x321a('0x64')];return db[_0x321a('0x62')]['findAll']({'where':{'id':_[_0x321a('0x3e')](_0x41a241,'id')},'attributes':['id'],'include':[{'model':db[_0x321a('0x5a')],'as':_0x321a('0x65'),'attributes':['id',_0x321a('0x2d'),_0x321a('0x66'),_0x321a('0x67'),_0x321a('0x68')],'raw':!![]}]})[_0x321a('0x27')](function(_0x98fc77){if(_0x98fc77){var _0x3f62fb=_[_0x321a('0x69')](_0x98fc77,function(_0x4ff5e0){var _0x394f11=_0x4ff5e0[_0x321a('0x29')]({'plain':!![]});return _0x394f11[_0x321a('0x65')];});return db[_0x321a('0x30')]['find']({'where':{'id':_0x1636ce[_0x321a('0x49')]['id']}})[_0x321a('0x27')](function(_0x30552f){return db[_0x321a('0x6a')][_0x321a('0x6b')](function(_0x4eeeac){return _0x30552f[_0x321a('0x6c')](_[_0x321a('0x3e')](_0x41a241,'id'),{'transaction':_0x4eeeac})[_0x321a('0x27')](function(){return BPromise[_0x321a('0x6d')](_0x3f62fb,function(_0x3841a0){return db[_0x321a('0x59')]['findOrCreate']({'where':{'UserId':_0x3841a0['id'],'SmsQueueId':_0x1636ce['params']['id']},'transaction':_0x4eeeac});});})[_0x321a('0x27')](function(){_0x3f62fb[_0x321a('0x6e')](function(_0x252d54){socket['emit'](_0x321a('0x6f'),{'UserId':_0x252d54['id'],'SmsQueueId':_0x30552f['id']});});});});});}})[_0x321a('0x27')](respondWithStatusCode(_0x14791c,null))[_0x321a('0x52')](handleError(_0x14791c,null));};exports[_0x321a('0x70')]=function(_0xd2d5,_0x13c4a5,_0x2ba433){return db[_0x321a('0x62')][_0x321a('0x46')]({'where':{'id':_0xd2d5[_0x321a('0x34')][_0x321a('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x321a('0x65'),'attributes':['id'],'raw':!![]}]})[_0x321a('0x27')](handleEntityNotFound(_0x13c4a5,null))['then'](function(_0x3172ce){var _0x2f21d6=_[_0x321a('0x3e')](_0x3172ce,'id');var _0x8a8585=[];var _0xe83b0a=[];var _0x1ea1e9=squel['select']();_0x1ea1e9[_0x321a('0x72')](_0x321a('0x73'))[_0x321a('0x74')](_0x321a('0x75'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x321a('0x3b')](_0x321a('0x76'),_0xd2d5[_0x321a('0x49')]['id']);for(var _0x3605f3=0x0;_0x3605f3<_0x3172ce[_0x321a('0x38')];_0x3605f3+=0x1){let _0x1d0599=_0x3172ce[_0x3605f3];for(var _0x37157e=0x0;_0x37157e<_0x1d0599[_0x321a('0x65')][_0x321a('0x38')];_0x37157e+=0x1){let _0x44b6a2=_0x1d0599[_0x321a('0x65')][_0x37157e];var _0x13cfe6=_0x1ea1e9[_0x321a('0x77')]();_0x13cfe6[_0x321a('0x3b')](_0x321a('0x78'),_0x44b6a2['id']);_0xe83b0a[_0x321a('0x79')](db[_0x321a('0x6a')][_0x321a('0x34')](_0x13cfe6[_0x321a('0x7a')](),{'type':db[_0x321a('0x6a')][_0x321a('0x7b')][_0x321a('0x7c')]})[_0x321a('0x27')](function(_0x5b0807){if(_0x5b0807[_0x321a('0x38')]===0x1){return _0x44b6a2['id'];}else{var _0xd2f48b=_['every'](_[_0x321a('0x3e')](_0x5b0807,_0x321a('0x7d')),function(_0x14c1f5){return _[_0x321a('0x7e')](_0x2f21d6,_0x14c1f5);});if(_0xd2f48b){return _0x44b6a2['id'];}}}));}}return BPromise['all'](_0xe83b0a)[_0x321a('0x27')](function(_0x2e7eb7){_0x8a8585=_(_0x8a8585)['union'](_0x2e7eb7)[_0x321a('0x7f')]()[_0x321a('0x80')]();return db['SmsQueue'][_0x321a('0x4b')]({'where':{'id':_0xd2d5[_0x321a('0x49')]['id']}})['then'](function(_0x1e627c){return db[_0x321a('0x6a')][_0x321a('0x6b')](function(_0x31a59d){return _0x1e627c['removeTeams'](_0xd2d5[_0x321a('0x34')][_0x321a('0x71')],{'transaction':_0x31a59d})[_0x321a('0x27')](function(){if(!_[_0x321a('0x81')](_0x8a8585)){return _0x1e627c[_0x321a('0x82')](_0x8a8585,{'transaction':_0x31a59d});}})[_0x321a('0x27')](function(){_0x8a8585['forEach'](function(_0x54314c){socket[_0x321a('0x83')](_0x321a('0x84'),{'UserId':_0x54314c,'SmsQueueId':_0x1e627c['id']});});});});});});})[_0x321a('0x27')](respondWithStatusCode(_0x13c4a5,null))[_0x321a('0x52')](handleError(_0x13c4a5,null));};exports[_0x321a('0x85')]=function(_0x4b0bb3,_0x1be9e5,_0x4ed165){return db[_0x321a('0x30')][_0x321a('0x4b')]({'where':{'id':_0x4b0bb3[_0x321a('0x49')]['id']}})[_0x321a('0x27')](handleEntityNotFound(_0x1be9e5,null))[_0x321a('0x27')](function(_0x89a39){if(_0x89a39){return _0x89a39[_0x321a('0x85')](_0x4b0bb3[_0x321a('0x4d')]['ids'],_[_0x321a('0x86')](_0x4b0bb3[_0x321a('0x4d')],[_0x321a('0x71'),'id'])||{})[_0x321a('0x87')](function(_0x4861ac){for(var _0x3ec5bc=0x0;_0x3ec5bc<_0x4b0bb3[_0x321a('0x4d')][_0x321a('0x71')][_0x321a('0x38')];_0x3ec5bc+=0x1){socket['emit'](_0x321a('0x6f'),{'UserId':_0x4b0bb3[_0x321a('0x4d')][_0x321a('0x71')][_0x3ec5bc],'SmsQueueId':_0x4b0bb3[_0x321a('0x49')]['id']});}return _0x4861ac;});}})[_0x321a('0x27')](respondWithResult(_0x1be9e5,null))['catch'](handleError(_0x1be9e5,null));};exports[_0x321a('0x82')]=function(_0x7a8367,_0x696e7f,_0xbf0a1a){return db[_0x321a('0x30')]['find']({'where':{'id':_0x7a8367[_0x321a('0x49')]['id']}})[_0x321a('0x27')](handleEntityNotFound(_0x696e7f,null))[_0x321a('0x27')](function(_0x2c22ad){if(_0x2c22ad){return _0x2c22ad[_0x321a('0x82')](_0x7a8367['query'][_0x321a('0x71')])[_0x321a('0x27')](function(){if(_[_0x321a('0x88')](_0x7a8367[_0x321a('0x34')][_0x321a('0x71')])){for(var _0xfd604b=0x0;_0xfd604b<_0x7a8367['query'][_0x321a('0x71')][_0x321a('0x38')];_0xfd604b+=0x1){socket[_0x321a('0x83')](_0x321a('0x84'),{'UserId':Number(_0x7a8367[_0x321a('0x34')][_0x321a('0x71')][_0xfd604b]),'SmsQueueId':Number(_0x7a8367['params']['id'])});}}else{socket['emit'](_0x321a('0x84'),{'UserId':Number(_0x7a8367[_0x321a('0x34')][_0x321a('0x71')]),'SmsQueueId':Number(_0x7a8367[_0x321a('0x49')]['id'])});}});}})[_0x321a('0x27')](respondWithStatusCode(_0x696e7f,null))[_0x321a('0x52')](handleError(_0x696e7f,null));};exports[_0x321a('0x89')]=function(_0x4bc689,_0x50c4ca,_0x2b4713){var _0x4bcd76={};var _0x2dd9e7={};var _0xc2d100;var _0x10f808;return db[_0x321a('0x30')][_0x321a('0x8a')]({'where':{'id':_0x4bc689[_0x321a('0x49')]['id']}})[_0x321a('0x27')](handleEntityNotFound(_0x50c4ca,null))['then'](function(_0x2f2fa1){if(_0x2f2fa1){_0xc2d100=_0x2f2fa1;_0x2dd9e7['model']=_[_0x321a('0x33')](db[_0x321a('0x5a')][_0x321a('0x31')]);_0x2dd9e7[_0x321a('0x34')]=_['keys'](_0x4bc689[_0x321a('0x34')]);_0x2dd9e7[_0x321a('0x35')]=_[_0x321a('0x4a')](_0x2dd9e7[_0x321a('0x32')],_0x2dd9e7['query']);_0x4bcd76[_0x321a('0x36')]=_[_0x321a('0x4a')](_0x2dd9e7[_0x321a('0x32')],qs[_0x321a('0x37')](_0x4bc689[_0x321a('0x34')]['fields']));_0x4bcd76[_0x321a('0x36')]=_0x4bcd76[_0x321a('0x36')][_0x321a('0x38')]?_0x4bcd76['attributes']:_0x2dd9e7[_0x321a('0x32')];_0x4bcd76[_0x321a('0x39')]=qs['sort'](_0x4bc689[_0x321a('0x34')][_0x321a('0x3a')]);_0x4bcd76['where']=qs['filters'](_[_0x321a('0x3c')](_0x4bc689[_0x321a('0x34')],_0x2dd9e7[_0x321a('0x35')]));if(_0x4bc689[_0x321a('0x34')][_0x321a('0x41')]){_0x4bcd76[_0x321a('0x3b')]=_[_0x321a('0x3d')](_0x4bcd76[_0x321a('0x3b')],{'$or':_[_0x321a('0x3e')](_0x4bcd76[_0x321a('0x36')],function(_0x258bc0){var _0x4ab9dc={};_0x4ab9dc[_0x258bc0]={'$like':'%'+_0x4bc689[_0x321a('0x34')]['filter']+'%'};return _0x4ab9dc;})});}_0x4bcd76=_[_0x321a('0x3d')]({},_0x4bcd76,_0x4bc689[_0x321a('0x42')]);return _0xc2d100[_0x321a('0x89')](_0x4bcd76);}})[_0x321a('0x27')](function(_0x5f1dd2){if(_0x5f1dd2){_0x10f808=_0x5f1dd2[_0x321a('0x38')];if(!_0x4bc689[_0x321a('0x34')][_0x321a('0x63')](_0x321a('0x57'))){_0x4bcd76['limit']=qs[_0x321a('0x20')](_0x4bc689[_0x321a('0x34')]['limit']);_0x4bcd76[_0x321a('0x1f')]=qs[_0x321a('0x1f')](_0x4bc689[_0x321a('0x34')]['offset']);}return _0xc2d100[_0x321a('0x89')](_0x4bcd76);}})[_0x321a('0x27')](function(_0x550f95){if(_0x550f95){return _0x550f95?{'count':_0x10f808,'rows':_0x550f95}:null;}})['then'](respondWithResult(_0x50c4ca,null))[_0x321a('0x52')](handleError(_0x50c4ca,null));}; \ No newline at end of file +var _0x823c=['flatMap','transaction','each','findOrCreate','emit','userSmsQueue:save','ids','select','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','json','count','offset','limit','status','Content-Range','apply','reject','save','update','destroy','then','get','SmsQueues','UserProfileResource','end','error','stack','name','send','index','SmsQueue','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','filter','merge','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','userProfileId','autoAssociation','describe','findOne','sort','SmsQueueId','map','UserSmsQueue','findAndCountAll','UserId','smsPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','pick','nolimit','addTeams','teams','User','Agents','online','voicePause','interface'];(function(_0x2974c5,_0x26baac){var _0x132418=function(_0x44c7a2){while(--_0x44c7a2){_0x2974c5['push'](_0x2974c5['shift']());}};_0x132418(++_0x26baac);}(_0x823c,0x143));var _0xc823=function(_0xedaaf2,_0x572d92){_0xedaaf2=_0xedaaf2-0x0;var _0x5c75b6=_0x823c[_0xedaaf2];return _0x5c75b6;};'use strict';var pdf=require(_0xc823('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc823('0x1'));var zipdir=require(_0xc823('0x2'));var jsonpatch=require(_0xc823('0x3'));var rp=require(_0xc823('0x4'));var moment=require(_0xc823('0x5'));var BPromise=require(_0xc823('0x6'));var Mustache=require('mustache');var util=require(_0xc823('0x7'));var path=require(_0xc823('0x8'));var sox=require(_0xc823('0x9'));var csv=require(_0xc823('0xa'));var ejs=require(_0xc823('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc823('0xc'));var crypto=require(_0xc823('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc823('0xa'));var querystring=require(_0xc823('0xe'));var Papa=require('papaparse');var Redis=require(_0xc823('0xf'));var authService=require(_0xc823('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc823('0x11'))(_0xc823('0x12'));var utils=require(_0xc823('0x13'));var config=require(_0xc823('0x14'));var db=require(_0xc823('0x15'))['db'];config['redis']=_[_0xc823('0x16')](config[_0xc823('0x17')],{'host':_0xc823('0x18'),'port':0x18eb});var socket=require(_0xc823('0x19'))(new Redis(config[_0xc823('0x17')]));require(_0xc823('0x1a'))['register'](socket);function respondWithStatusCode(_0x1e4425,_0xff0ec2){_0xff0ec2=_0xff0ec2||0xcc;return function(_0x4daac9){if(_0x4daac9){return _0x1e4425[_0xc823('0x1b')](_0xff0ec2);}return _0x1e4425['status'](_0xff0ec2)['end']();};}function respondWithResult(_0x59749d,_0x5bdfc9){_0x5bdfc9=_0x5bdfc9||0xc8;return function(_0x565aeb){if(_0x565aeb){return _0x59749d['status'](_0x5bdfc9)[_0xc823('0x1c')](_0x565aeb);}};}function respondWithFilteredResult(_0x122510,_0xff1753){return function(_0x2ff583){if(_0x2ff583){var _0x4417ee=_0x2ff583[_0xc823('0x1d')],_0x1aca6d=_0xff1753['offset'],_0xfedc1d=_0xff1753[_0xc823('0x1e')]+_0xff1753[_0xc823('0x1f')],_0x58b7c7;if(_0xfedc1d>=_0x4417ee){_0xfedc1d=_0x4417ee;_0x58b7c7=0xc8;}else{_0x58b7c7=0xce;}_0x122510[_0xc823('0x20')](_0x58b7c7);return _0x122510['set'](_0xc823('0x21'),_0x1aca6d+'-'+_0xfedc1d+'/'+_0x4417ee)[_0xc823('0x1c')](_0x2ff583);}return null;};}function patchUpdates(_0x3a3fcd){return function(_0x599e59){try{jsonpatch[_0xc823('0x22')](_0x599e59,_0x3a3fcd,!![]);}catch(_0x325c8a){return BPromise[_0xc823('0x23')](_0x325c8a);}return _0x599e59[_0xc823('0x24')]();};}function saveUpdates(_0x574c76,_0x414c86){return function(_0x5dcb4e){if(_0x5dcb4e){return _0x5dcb4e[_0xc823('0x25')](_0x574c76)['then'](function(_0x510460){return _0x510460;});}return null;};}function removeEntity(_0x3af14f,_0x3cead8){return function(_0x52c941){if(_0x52c941){return _0x52c941[_0xc823('0x26')]()[_0xc823('0x27')](function(){var _0x451f7a=_0x52c941[_0xc823('0x28')]({'plain':!![]});var _0x263865=_0xc823('0x29');return db[_0xc823('0x2a')][_0xc823('0x26')]({'where':{'type':_0x263865,'resourceId':_0x451f7a['id']}})[_0xc823('0x27')](function(){return _0x52c941;});})[_0xc823('0x27')](function(){_0x3af14f['status'](0xcc)[_0xc823('0x2b')]();});}};}function handleEntityNotFound(_0x533560,_0x54e956){return function(_0x15ac97){if(!_0x15ac97){_0x533560[_0xc823('0x1b')](0x194);}return _0x15ac97;};}function handleError(_0x1c79dd,_0x2d60ee){_0x2d60ee=_0x2d60ee||0x1f4;return function(_0x20d2b1){logger[_0xc823('0x2c')](_0x20d2b1[_0xc823('0x2d')]);if(_0x20d2b1[_0xc823('0x2e')]){delete _0x20d2b1[_0xc823('0x2e')];}_0x1c79dd[_0xc823('0x20')](_0x2d60ee)[_0xc823('0x2f')](_0x20d2b1);};}exports[_0xc823('0x30')]=function(_0x352b61,_0xda39a3){var _0x1c839f={},_0x52bd31={},_0x1b492a={'count':0x0,'rows':[]};var _0x34af84=db[_0xc823('0x31')][_0xc823('0x32')];_0x52bd31[_0xc823('0x33')]=_['keys'](_0x34af84);_0x52bd31['query']=_['keys'](_0x352b61[_0xc823('0x34')]);_0x52bd31[_0xc823('0x35')]=_[_0xc823('0x36')](_0x52bd31[_0xc823('0x33')],_0x52bd31['query']);_0x1c839f[_0xc823('0x37')]=_[_0xc823('0x36')](_0x52bd31[_0xc823('0x33')],qs[_0xc823('0x38')](_0x352b61[_0xc823('0x34')][_0xc823('0x38')]));_0x1c839f[_0xc823('0x37')]=_0x1c839f[_0xc823('0x37')][_0xc823('0x39')]?_0x1c839f[_0xc823('0x37')]:_0x52bd31[_0xc823('0x33')];if(!_0x352b61[_0xc823('0x34')][_0xc823('0x3a')]('nolimit')){_0x1c839f[_0xc823('0x1f')]=qs[_0xc823('0x1f')](_0x352b61[_0xc823('0x34')][_0xc823('0x1f')]);_0x1c839f[_0xc823('0x1e')]=qs[_0xc823('0x1e')](_0x352b61['query'][_0xc823('0x1e')]);}_0x1c839f[_0xc823('0x3b')]=qs['sort'](_0x352b61[_0xc823('0x34')]['sort']);_0x1c839f[_0xc823('0x3c')]=qs[_0xc823('0x35')](_['pick'](_0x352b61[_0xc823('0x34')],_0x52bd31[_0xc823('0x35')]));if(_0x352b61[_0xc823('0x34')][_0xc823('0x3d')]){_0x1c839f[_0xc823('0x3c')]=_[_0xc823('0x3e')](_0x1c839f[_0xc823('0x3c')],{'$or':_['map'](_0x34af84,function(_0x4e8ac9){if(_0x4e8ac9['type'][_0xc823('0x3f')]!==_0xc823('0x40')){var _0x357248={};_0x357248[_0x4e8ac9[_0xc823('0x41')]]={'$like':'%'+_0x352b61[_0xc823('0x34')]['filter']+'%'};return _0x357248;}})});}_0x1c839f=_[_0xc823('0x3e')]({},_0x1c839f,_0x352b61[_0xc823('0x42')]);var _0x1802d2={'where':_0x1c839f[_0xc823('0x3c')]};return db['SmsQueue']['count'](_0x1802d2)['then'](function(_0x3f72a4){_0x1b492a[_0xc823('0x1d')]=_0x3f72a4;if(_0x352b61[_0xc823('0x34')]['includeAll']){_0x1c839f[_0xc823('0x43')]=[{'all':!![]}];}return db['SmsQueue'][_0xc823('0x44')](_0x1c839f);})[_0xc823('0x27')](function(_0x3535b6){_0x1b492a[_0xc823('0x45')]=_0x3535b6;return _0x1b492a;})[_0xc823('0x27')](respondWithFilteredResult(_0xda39a3,_0x1c839f))[_0xc823('0x46')](handleError(_0xda39a3,null));};exports[_0xc823('0x47')]=function(_0x521e47,_0x1256b6){var _0x4d2100={'raw':!![],'where':{'id':_0x521e47[_0xc823('0x48')]['id']}},_0x4396ef={};_0x4396ef[_0xc823('0x33')]=_[_0xc823('0x49')](db[_0xc823('0x31')][_0xc823('0x32')]);_0x4396ef[_0xc823('0x34')]=_[_0xc823('0x49')](_0x521e47['query']);_0x4396ef[_0xc823('0x35')]=_[_0xc823('0x36')](_0x4396ef['model'],_0x4396ef[_0xc823('0x34')]);_0x4d2100[_0xc823('0x37')]=_[_0xc823('0x36')](_0x4396ef[_0xc823('0x33')],qs[_0xc823('0x38')](_0x521e47[_0xc823('0x34')][_0xc823('0x38')]));_0x4d2100[_0xc823('0x37')]=_0x4d2100[_0xc823('0x37')]['length']?_0x4d2100[_0xc823('0x37')]:_0x4396ef[_0xc823('0x33')];if(_0x521e47['query'][_0xc823('0x4a')]){_0x4d2100[_0xc823('0x43')]=[{'all':!![]}];}_0x4d2100=_['merge']({},_0x4d2100,_0x521e47[_0xc823('0x42')]);return db['SmsQueue'][_0xc823('0x4b')](_0x4d2100)[_0xc823('0x27')](handleEntityNotFound(_0x1256b6,null))['then'](respondWithResult(_0x1256b6,null))['catch'](handleError(_0x1256b6,null));};exports[_0xc823('0x4c')]=function(_0x4377ed,_0x3b10a0){return db[_0xc823('0x31')][_0xc823('0x4c')](_0x4377ed[_0xc823('0x4d')],{})[_0xc823('0x27')](function(_0x1ae82d){var _0x4a134e=_0x4377ed[_0xc823('0x4e')][_0xc823('0x28')]({'plain':!![]});if(!_0x4a134e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a134e['role']===_0xc823('0x4e')){var _0x4db975=_0x1ae82d['get']({'plain':!![]});var _0x5c3217='SmsQueues';return db['UserProfileSection']['find']({'where':{'name':_0x5c3217,'userProfileId':_0x4a134e[_0xc823('0x4f')]},'raw':!![]})['then'](function(_0x56dcaf){if(_0x56dcaf&&_0x56dcaf[_0xc823('0x50')]===0x0){return db['UserProfileResource'][_0xc823('0x4c')]({'name':_0x4db975[_0xc823('0x2e')],'resourceId':_0x4db975['id'],'type':_0x56dcaf['name'],'sectionId':_0x56dcaf['id']},{})[_0xc823('0x27')](function(){return _0x1ae82d;});}else{return _0x1ae82d;}})[_0xc823('0x46')](function(_0xb29171){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb29171);throw _0xb29171;});}return _0x1ae82d;})[_0xc823('0x27')](respondWithResult(_0x3b10a0,0xc9))[_0xc823('0x46')](handleError(_0x3b10a0,null));};exports['update']=function(_0x23a1aa,_0x2c9a53){if(_0x23a1aa[_0xc823('0x4d')]['id']){delete _0x23a1aa['body']['id'];}return db[_0xc823('0x31')][_0xc823('0x4b')]({'where':{'id':_0x23a1aa[_0xc823('0x48')]['id']}})[_0xc823('0x27')](handleEntityNotFound(_0x2c9a53,null))[_0xc823('0x27')](saveUpdates(_0x23a1aa[_0xc823('0x4d')],null))[_0xc823('0x27')](respondWithResult(_0x2c9a53,null))['catch'](handleError(_0x2c9a53,null));};exports[_0xc823('0x26')]=function(_0x182065,_0x3b690c){return db[_0xc823('0x31')][_0xc823('0x4b')]({'where':{'id':_0x182065[_0xc823('0x48')]['id']}})[_0xc823('0x27')](handleEntityNotFound(_0x3b690c,null))['then'](removeEntity(_0x3b690c,null))[_0xc823('0x46')](handleError(_0x3b690c,null));};exports[_0xc823('0x51')]=function(_0x1fe516,_0x991669){return db[_0xc823('0x31')][_0xc823('0x51')]()['then'](respondWithResult(_0x991669,null))[_0xc823('0x46')](handleError(_0x991669,null));};exports['getMembers']=function(_0x5dd8ad,_0x53e5b2,_0x421c36){var _0x53bf45={'raw':!![],'where':{}},_0x1abb36={},_0x4cddd6;return db[_0xc823('0x31')][_0xc823('0x52')]({'where':{'id':_0x5dd8ad['params']['id']}})[_0xc823('0x27')](handleEntityNotFound(_0x53e5b2,null))['then'](function(_0x514d75){if(_0x514d75){_0x4cddd6=_0x514d75[_0xc823('0x28')]({'plain':!![]});_0x1abb36['model']=_[_0xc823('0x49')](db['UserSmsQueue'][_0xc823('0x32')]);_0x1abb36[_0xc823('0x34')]=_['keys'](_0x5dd8ad[_0xc823('0x34')]);_0x1abb36[_0xc823('0x35')]=_[_0xc823('0x36')](_0x1abb36[_0xc823('0x33')],_0x1abb36['query']);_0x53bf45['attributes']=_[_0xc823('0x36')](_0x1abb36['model'],qs[_0xc823('0x38')](_0x5dd8ad[_0xc823('0x34')][_0xc823('0x38')]));_0x53bf45[_0xc823('0x37')]=_0x53bf45[_0xc823('0x37')]['length']?_0x53bf45[_0xc823('0x37')]:_0x1abb36['model'];if(!_0x5dd8ad[_0xc823('0x34')][_0xc823('0x3a')]('nolimit')){_0x53bf45[_0xc823('0x1f')]=qs['limit'](_0x5dd8ad[_0xc823('0x34')][_0xc823('0x1f')]);_0x53bf45[_0xc823('0x1e')]=qs[_0xc823('0x1e')](_0x5dd8ad['query']['offset']);}_0x53bf45['order']=qs['sort'](_0x5dd8ad['query'][_0xc823('0x53')]);_0x53bf45[_0xc823('0x3c')]=qs['filters'](_['pick'](_0x5dd8ad[_0xc823('0x34')],_0x1abb36[_0xc823('0x35')]));_0x53bf45[_0xc823('0x3c')][_0xc823('0x54')]=_0x514d75['id'];if(_0x5dd8ad[_0xc823('0x34')][_0xc823('0x3d')]){_0x53bf45[_0xc823('0x3c')]=_['merge'](_0x53bf45[_0xc823('0x3c')],{'$or':_[_0xc823('0x55')](_0x53bf45[_0xc823('0x37')],function(_0x4ac00f){var _0x544860={};_0x544860[_0x4ac00f]={'$like':'%'+_0x5dd8ad['query'][_0xc823('0x3d')]+'%'};return _0x544860;})});}_0x53bf45=_[_0xc823('0x3e')]({},_0x53bf45,_0x5dd8ad['options']);return db[_0xc823('0x56')][_0xc823('0x44')](_0x53bf45);}})[_0xc823('0x27')](function(_0x58919c){if(_0x58919c){return db['User'][_0xc823('0x57')]({'where':{'id':_[_0xc823('0x55')](_0x58919c,_0xc823('0x58')),'role':'agent'},'attributes':['id',_0xc823('0x2e'),_0xc823('0x59'),'updatedAt',_0xc823('0x5a')]});}})[_0xc823('0x27')](function(_0x505cce){if(_0x505cce){return{'count':_0x505cce['count'],'rows':_['map'](_0x505cce[_0xc823('0x45')],function(_0x3b68ce){return{'membername':_0x3b68ce['name'],'UserId':_0x3b68ce['id'],'queue_name':_0x4cddd6[_0xc823('0x2e')],'SmsQueueId':_0x4cddd6['id'],'interface':util[_0xc823('0x5b')](_0xc823('0x5c'),_0xc823('0x5d'),_0x3b68ce[_0xc823('0x2e')]),'penalty':0x0,'paused':_0x3b68ce[_0xc823('0x59')],'createdAt':_0x3b68ce['createdAt'],'updatedAt':_0x3b68ce[_0xc823('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x53e5b2,_0x53bf45))['catch'](handleError(_0x53e5b2,null));};exports[_0xc823('0x5f')]=function(_0x48c43f,_0x2ad8de,_0x18534b){var _0x2e0774={};var _0x1ae837={};var _0x1c198e;var _0x444f12;return db[_0xc823('0x31')]['findOne']({'where':{'id':_0x48c43f[_0xc823('0x48')]['id']}})[_0xc823('0x27')](handleEntityNotFound(_0x2ad8de,null))[_0xc823('0x27')](function(_0x415d18){if(_0x415d18){_0x1c198e=_0x415d18;_0x1ae837[_0xc823('0x33')]=_['keys'](db[_0xc823('0x60')][_0xc823('0x32')]);_0x1ae837[_0xc823('0x34')]=_[_0xc823('0x49')](_0x48c43f[_0xc823('0x34')]);_0x1ae837['filters']=_[_0xc823('0x36')](_0x1ae837[_0xc823('0x33')],_0x1ae837[_0xc823('0x34')]);_0x2e0774[_0xc823('0x37')]=_['intersection'](_0x1ae837[_0xc823('0x33')],qs[_0xc823('0x38')](_0x48c43f[_0xc823('0x34')][_0xc823('0x38')]));_0x2e0774[_0xc823('0x37')]=_0x2e0774[_0xc823('0x37')]['length']?_0x2e0774[_0xc823('0x37')]:_0x1ae837['model'];_0x2e0774[_0xc823('0x3b')]=qs[_0xc823('0x53')](_0x48c43f[_0xc823('0x34')]['sort']);_0x2e0774[_0xc823('0x3c')]=qs[_0xc823('0x35')](_[_0xc823('0x61')](_0x48c43f[_0xc823('0x34')],_0x1ae837[_0xc823('0x35')]));if(_0x48c43f[_0xc823('0x34')][_0xc823('0x3d')]){_0x2e0774['where']=_[_0xc823('0x3e')](_0x2e0774[_0xc823('0x3c')],{'$or':_[_0xc823('0x55')](_0x2e0774[_0xc823('0x37')],function(_0x1ca2e1){var _0x39282f={};_0x39282f[_0x1ca2e1]={'$like':'%'+_0x48c43f[_0xc823('0x34')][_0xc823('0x3d')]+'%'};return _0x39282f;})});}_0x2e0774=_[_0xc823('0x3e')]({},_0x2e0774,_0x48c43f[_0xc823('0x42')]);return _0x1c198e[_0xc823('0x5f')](_0x2e0774);}})[_0xc823('0x27')](function(_0x2091ab){if(_0x2091ab){_0x444f12=_0x2091ab[_0xc823('0x39')];if(!_0x48c43f[_0xc823('0x34')][_0xc823('0x3a')](_0xc823('0x62'))){_0x2e0774[_0xc823('0x1f')]=qs[_0xc823('0x1f')](_0x48c43f[_0xc823('0x34')]['limit']);_0x2e0774[_0xc823('0x1e')]=qs[_0xc823('0x1e')](_0x48c43f[_0xc823('0x34')][_0xc823('0x1e')]);}return _0x1c198e[_0xc823('0x5f')](_0x2e0774);}})[_0xc823('0x27')](function(_0x5b5717){if(_0x5b5717){return _0x5b5717?{'count':_0x444f12,'rows':_0x5b5717}:null;}})[_0xc823('0x27')](respondWithResult(_0x2ad8de,null))[_0xc823('0x46')](handleError(_0x2ad8de,null));};exports[_0xc823('0x63')]=function(_0x3fa853,_0x2d250d,_0x397a29){var _0x3dcd52=_0x3fa853['body'][_0xc823('0x64')];return db[_0xc823('0x60')][_0xc823('0x44')]({'where':{'id':_[_0xc823('0x55')](_0x3dcd52,'id')},'attributes':['id'],'include':[{'model':db[_0xc823('0x65')],'as':_0xc823('0x66'),'attributes':['id','name',_0xc823('0x67'),_0xc823('0x68'),_0xc823('0x69')],'raw':!![]}]})[_0xc823('0x27')](function(_0xc383c0){if(_0xc383c0){var _0x18146b=_[_0xc823('0x6a')](_0xc383c0,function(_0x5ef927){var _0x500d75=_0x5ef927['get']({'plain':!![]});return _0x500d75[_0xc823('0x66')];});return db['SmsQueue'][_0xc823('0x4b')]({'where':{'id':_0x3fa853[_0xc823('0x48')]['id']}})[_0xc823('0x27')](function(_0x8bd300){return db['sequelize'][_0xc823('0x6b')](function(_0x977981){return _0x8bd300[_0xc823('0x63')](_[_0xc823('0x55')](_0x3dcd52,'id'),{'transaction':_0x977981})['then'](function(){return BPromise[_0xc823('0x6c')](_0x18146b,function(_0x26c8f0){return db['UserSmsQueue'][_0xc823('0x6d')]({'where':{'UserId':_0x26c8f0['id'],'SmsQueueId':_0x3fa853['params']['id']},'transaction':_0x977981});});})[_0xc823('0x27')](function(){_0x18146b['forEach'](function(_0x417a47){socket[_0xc823('0x6e')](_0xc823('0x6f'),{'UserId':_0x417a47['id'],'SmsQueueId':_0x8bd300['id']});});});});});}})['then'](respondWithStatusCode(_0x2d250d,null))[_0xc823('0x46')](handleError(_0x2d250d,null));};exports['removeTeams']=function(_0x455df5,_0x6ea423,_0x246f64){return db[_0xc823('0x60')][_0xc823('0x44')]({'where':{'id':_0x455df5[_0xc823('0x34')][_0xc823('0x70')]},'attributes':['id'],'include':[{'model':db[_0xc823('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc823('0x27')](handleEntityNotFound(_0x6ea423,null))[_0xc823('0x27')](function(_0x1e4688){var _0x1ec68a=_[_0xc823('0x55')](_0x1e4688,'id');var _0xeed288=[];var _0x1c7322=[];var _0x108327=squel[_0xc823('0x71')]();_0x108327[_0xc823('0x41')](_0xc823('0x72'))[_0xc823('0x73')](_0xc823('0x74'),'tq')['join'](_0xc823('0x75'),'ut',_0xc823('0x76'))[_0xc823('0x3c')](_0xc823('0x77'),_0x455df5[_0xc823('0x48')]['id']);for(var _0x18927e=0x0;_0x18927e<_0x1e4688['length'];_0x18927e+=0x1){let _0x596d87=_0x1e4688[_0x18927e];for(var _0x40f196=0x0;_0x40f196<_0x596d87[_0xc823('0x66')][_0xc823('0x39')];_0x40f196+=0x1){let _0x283ddc=_0x596d87['Agents'][_0x40f196];var _0x50bad9=_0x108327[_0xc823('0x78')]();_0x50bad9[_0xc823('0x3c')](_0xc823('0x79'),_0x283ddc['id']);_0x1c7322[_0xc823('0x7a')](db['sequelize'][_0xc823('0x34')](_0x50bad9[_0xc823('0x7b')](),{'type':db['sequelize'][_0xc823('0x7c')][_0xc823('0x7d')]})[_0xc823('0x27')](function(_0x1a8121){if(_0x1a8121['length']===0x1){return _0x283ddc['id'];}else{var _0x561a5b=_[_0xc823('0x7e')](_[_0xc823('0x55')](_0x1a8121,_0xc823('0x7f')),function(_0x597444){return _[_0xc823('0x80')](_0x1ec68a,_0x597444);});if(_0x561a5b){return _0x283ddc['id'];}}}));}}return BPromise[_0xc823('0x81')](_0x1c7322)[_0xc823('0x27')](function(_0x74c832){_0xeed288=_(_0xeed288)[_0xc823('0x82')](_0x74c832)[_0xc823('0x83')]()[_0xc823('0x84')]();return db[_0xc823('0x31')]['find']({'where':{'id':_0x455df5[_0xc823('0x48')]['id']}})[_0xc823('0x27')](function(_0xc0c51d){return db['sequelize'][_0xc823('0x6b')](function(_0x3995b7){return _0xc0c51d[_0xc823('0x85')](_0x455df5['query']['ids'],{'transaction':_0x3995b7})[_0xc823('0x27')](function(){if(!_[_0xc823('0x86')](_0xeed288)){return _0xc0c51d[_0xc823('0x87')](_0xeed288,{'transaction':_0x3995b7});}})[_0xc823('0x27')](function(){_0xeed288[_0xc823('0x88')](function(_0x41193e){socket[_0xc823('0x6e')]('userSmsQueue:remove',{'UserId':_0x41193e,'SmsQueueId':_0xc0c51d['id']});});});});});});})[_0xc823('0x27')](respondWithStatusCode(_0x6ea423,null))[_0xc823('0x46')](handleError(_0x6ea423,null));};exports['addAgents']=function(_0x20e741,_0x21a254,_0x5514ba){return db[_0xc823('0x31')][_0xc823('0x4b')]({'where':{'id':_0x20e741['params']['id']}})[_0xc823('0x27')](handleEntityNotFound(_0x21a254,null))[_0xc823('0x27')](function(_0x34801b){if(_0x34801b){return _0x34801b[_0xc823('0x89')](_0x20e741[_0xc823('0x4d')]['ids'],_[_0xc823('0x8a')](_0x20e741[_0xc823('0x4d')],[_0xc823('0x70'),'id'])||{})[_0xc823('0x8b')](function(_0x3a6abe){for(var _0x2008ad=0x0;_0x2008ad<_0x20e741['body'][_0xc823('0x70')]['length'];_0x2008ad+=0x1){socket['emit'](_0xc823('0x6f'),{'UserId':_0x20e741['body'][_0xc823('0x70')][_0x2008ad],'SmsQueueId':_0x20e741[_0xc823('0x48')]['id']});}return _0x3a6abe;});}})[_0xc823('0x27')](respondWithResult(_0x21a254,null))[_0xc823('0x46')](handleError(_0x21a254,null));};exports[_0xc823('0x87')]=function(_0x29b6d9,_0x32788a,_0xe3c137){return db[_0xc823('0x31')][_0xc823('0x4b')]({'where':{'id':_0x29b6d9[_0xc823('0x48')]['id']}})[_0xc823('0x27')](handleEntityNotFound(_0x32788a,null))[_0xc823('0x27')](function(_0x179f08){if(_0x179f08){return _0x179f08['removeAgents'](_0x29b6d9['query'][_0xc823('0x70')])[_0xc823('0x27')](function(){if(_[_0xc823('0x8c')](_0x29b6d9[_0xc823('0x34')][_0xc823('0x70')])){for(var _0x34dfe7=0x0;_0x34dfe7<_0x29b6d9[_0xc823('0x34')][_0xc823('0x70')][_0xc823('0x39')];_0x34dfe7+=0x1){socket['emit'](_0xc823('0x8d'),{'UserId':Number(_0x29b6d9['query'][_0xc823('0x70')][_0x34dfe7]),'SmsQueueId':Number(_0x29b6d9['params']['id'])});}}else{socket[_0xc823('0x6e')](_0xc823('0x8d'),{'UserId':Number(_0x29b6d9[_0xc823('0x34')][_0xc823('0x70')]),'SmsQueueId':Number(_0x29b6d9[_0xc823('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x32788a,null))[_0xc823('0x46')](handleError(_0x32788a,null));};exports[_0xc823('0x8e')]=function(_0x541d73,_0x5ddf40,_0x1ede91){var _0x2d9d6f={};var _0x60be33={};var _0x369e91;var _0x5c92da;return db[_0xc823('0x31')][_0xc823('0x52')]({'where':{'id':_0x541d73[_0xc823('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ddf40,null))[_0xc823('0x27')](function(_0x503bd6){if(_0x503bd6){_0x369e91=_0x503bd6;_0x60be33[_0xc823('0x33')]=_[_0xc823('0x49')](db['User'][_0xc823('0x32')]);_0x60be33[_0xc823('0x34')]=_[_0xc823('0x49')](_0x541d73[_0xc823('0x34')]);_0x60be33[_0xc823('0x35')]=_[_0xc823('0x36')](_0x60be33['model'],_0x60be33[_0xc823('0x34')]);_0x2d9d6f[_0xc823('0x37')]=_['intersection'](_0x60be33['model'],qs[_0xc823('0x38')](_0x541d73['query'][_0xc823('0x38')]));_0x2d9d6f[_0xc823('0x37')]=_0x2d9d6f['attributes'][_0xc823('0x39')]?_0x2d9d6f[_0xc823('0x37')]:_0x60be33[_0xc823('0x33')];_0x2d9d6f[_0xc823('0x3b')]=qs['sort'](_0x541d73[_0xc823('0x34')][_0xc823('0x53')]);_0x2d9d6f[_0xc823('0x3c')]=qs[_0xc823('0x35')](_[_0xc823('0x61')](_0x541d73[_0xc823('0x34')],_0x60be33[_0xc823('0x35')]));if(_0x541d73['query']['filter']){_0x2d9d6f[_0xc823('0x3c')]=_['merge'](_0x2d9d6f[_0xc823('0x3c')],{'$or':_[_0xc823('0x55')](_0x2d9d6f[_0xc823('0x37')],function(_0x358e55){var _0xa86e4c={};_0xa86e4c[_0x358e55]={'$like':'%'+_0x541d73[_0xc823('0x34')][_0xc823('0x3d')]+'%'};return _0xa86e4c;})});}_0x2d9d6f=_['merge']({},_0x2d9d6f,_0x541d73[_0xc823('0x42')]);return _0x369e91[_0xc823('0x8e')](_0x2d9d6f);}})['then'](function(_0x465f2e){if(_0x465f2e){_0x5c92da=_0x465f2e[_0xc823('0x39')];if(!_0x541d73['query'][_0xc823('0x3a')]('nolimit')){_0x2d9d6f[_0xc823('0x1f')]=qs[_0xc823('0x1f')](_0x541d73['query'][_0xc823('0x1f')]);_0x2d9d6f[_0xc823('0x1e')]=qs['offset'](_0x541d73[_0xc823('0x34')]['offset']);}return _0x369e91['getAgents'](_0x2d9d6f);}})[_0xc823('0x27')](function(_0x437b87){if(_0x437b87){return _0x437b87?{'count':_0x5c92da,'rows':_0x437b87}:null;}})[_0xc823('0x27')](respondWithResult(_0x5ddf40,null))[_0xc823('0x46')](handleError(_0x5ddf40,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index de3dfc5..15f6f90 100644 --- a/server/api/smsQueue/smsQueue.events.js +++ b/server/api/smsQueue/smsQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8499=['remove','emit','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0x8499,0xf7));var _0x9849=function(_0x4c3b8d,_0x47b987){_0x4c3b8d=_0x4c3b8d-0x0;var _0x7cbe87=_0x8499[_0x4c3b8d];return _0x7cbe87;};'use strict';var EventEmitter=require(_0x9849('0x0'));var SmsQueue=require(_0x9849('0x1'))['db'][_0x9849('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9849('0x3')](0x0);var events={'afterCreate':_0x9849('0x4'),'afterUpdate':'update','afterDestroy':_0x9849('0x5')};function emitEvent(_0x4cee5c){return function(_0x51f366,_0x4e4e25,_0x31429f){SmsQueueEvents[_0x9849('0x6')](_0x4cee5c+':'+_0x51f366['id'],_0x51f366);SmsQueueEvents[_0x9849('0x6')](_0x4cee5c,_0x51f366);_0x31429f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x9849('0x7')](e,emitEvent(event));}}module[_0x9849('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x6a43=['emit','events','../../mysqldb','SmsQueue','setMaxListeners','save','update'];(function(_0x58a65e,_0x5b9484){var _0x4653b2=function(_0x4a6eae){while(--_0x4a6eae){_0x58a65e['push'](_0x58a65e['shift']());}};_0x4653b2(++_0x5b9484);}(_0x6a43,0xcc));var _0x36a4=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x6a43[_0x487b0c];return _0x1adbdc;};'use strict';var EventEmitter=require(_0x36a4('0x0'));var SmsQueue=require(_0x36a4('0x1'))['db'][_0x36a4('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x36a4('0x3')](0x0);var events={'afterCreate':_0x36a4('0x4'),'afterUpdate':_0x36a4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x540941){return function(_0x536621,_0x158f0d,_0x4b3801){SmsQueueEvents[_0x36a4('0x6')](_0x540941+':'+_0x536621['id'],_0x536621);SmsQueueEvents[_0x36a4('0x6')](_0x540941,_0x536621);_0x4b3801(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 350cd49..692d0eb 100644 --- a/server/api/smsQueue/smsQueue.model.js +++ b/server/api/smsQueue/smsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e04=['bluebird','request-promise','rimraf','../../config/environment','exports','SmsQueue','sms_queues','lodash','util','api','moment'];(function(_0x336ca2,_0x1a813a){var _0xda59a6=function(_0x47caa6){while(--_0x47caa6){_0x336ca2['push'](_0x336ca2['shift']());}};_0xda59a6(++_0x1a813a);}(_0x5e04,0x130));var _0x45e0=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0x5e04[_0x2212d1];return _0x15eec5;};'use strict';var _=require(_0x45e0('0x0'));var util=require(_0x45e0('0x1'));var logger=require('../../config/logger')(_0x45e0('0x2'));var moment=require(_0x45e0('0x3'));var BPromise=require(_0x45e0('0x4'));var rp=require(_0x45e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x45e0('0x6'));var config=require(_0x45e0('0x7'));var attributes=require('./smsQueue.attributes');module[_0x45e0('0x8')]=function(_0x4d8007,_0x4d86dc){return _0x4d8007['define'](_0x45e0('0x9'),attributes,{'tableName':_0x45e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x930e=['define','SmsQueue','sms_queues','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x930e,0x179));var _0xe930=function(_0x410fe6,_0x16125a){_0x410fe6=_0x410fe6-0x0;var _0x1c2d23=_0x930e[_0x410fe6];return _0x1c2d23;};'use strict';var _=require(_0xe930('0x0'));var util=require(_0xe930('0x1'));var logger=require(_0xe930('0x2'))('api');var moment=require(_0xe930('0x3'));var BPromise=require(_0xe930('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe930('0x5'));var config=require(_0xe930('0x6'));var attributes=require(_0xe930('0x7'));module['exports']=function(_0x1141dd,_0x20153f){return _0x1141dd[_0xe930('0x8')](_0xe930('0x9'),attributes,{'tableName':_0xe930('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index ef62626..1112415 100644 --- a/server/api/smsQueue/smsQueue.rpc.js +++ b/server/api/smsQueue/smsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce85=['socket.io-emitter','./smsQueue.socket','register','request','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','GetSmsQueue','SmsQueue','findAll','options','raw','attributes','limit','map','include','model','catch','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xce85,0x148));var _0x5ce8=function(_0x111740,_0x37238d){_0x111740=_0x111740-0x0;var _0x3b370f=_0xce85[_0x111740];return _0x3b370f;};'use strict';var _=require(_0x5ce8('0x0'));var util=require(_0x5ce8('0x1'));var moment=require(_0x5ce8('0x2'));var BPromise=require(_0x5ce8('0x3'));var rs=require(_0x5ce8('0x4'));var fs=require('fs');var Redis=require(_0x5ce8('0x5'));var db=require(_0x5ce8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ce8('0x7'))(_0x5ce8('0x8'));var config=require(_0x5ce8('0x9'));var jayson=require(_0x5ce8('0xa'));var client=jayson[_0x5ce8('0xb')][_0x5ce8('0xc')]({'port':0x232a});config[_0x5ce8('0xd')]=_[_0x5ce8('0xe')](config[_0x5ce8('0xd')],{'host':_0x5ce8('0xf'),'port':0x18eb});var socket=require(_0x5ce8('0x10'))(new Redis(config[_0x5ce8('0xd')]));require(_0x5ce8('0x11'))[_0x5ce8('0x12')](socket);function respondWithRpcPromise(_0x138361,_0x757ee1,_0x36008d){return new BPromise(function(_0xea4cc,_0x53e3db){return client[_0x5ce8('0x13')](_0x138361,_0x36008d)[_0x5ce8('0x14')](function(_0x1754bd){logger[_0x5ce8('0x15')]('SmsQueue,\x20%s,\x20%s',_0x757ee1,_0x5ce8('0x16'));logger[_0x5ce8('0x17')](_0x5ce8('0x18'),_0x757ee1,_0x5ce8('0x16'),JSON[_0x5ce8('0x19')](_0x1754bd));if(_0x1754bd[_0x5ce8('0x1a')]){if(_0x1754bd['error'][_0x5ce8('0x1b')]===0x1f4){logger[_0x5ce8('0x1a')](_0x5ce8('0x1c'),_0x757ee1,_0x1754bd['error'][_0x5ce8('0x1d')]);return _0x53e3db(_0x1754bd[_0x5ce8('0x1a')][_0x5ce8('0x1d')]);}logger[_0x5ce8('0x1a')](_0x5ce8('0x1c'),_0x757ee1,_0x1754bd['error']['message']);return _0xea4cc(_0x1754bd[_0x5ce8('0x1a')]['message']);}else{logger[_0x5ce8('0x15')](_0x5ce8('0x1c'),_0x757ee1,_0x5ce8('0x16'));_0xea4cc(_0x1754bd['result'][_0x5ce8('0x1d')]);}})['catch'](function(_0x9e3931){logger['error'](_0x5ce8('0x1c'),_0x757ee1,_0x9e3931);_0x53e3db(_0x9e3931);});});}exports[_0x5ce8('0x1e')]=function(_0x223b43){var _0x4a4eb0=this;return new Promise(function(_0x1c654a,_0x4d30c1){return db[_0x5ce8('0x1f')][_0x5ce8('0x20')]({'raw':_0x223b43[_0x5ce8('0x21')]?_0x223b43[_0x5ce8('0x21')][_0x5ce8('0x22')]===undefined?!![]:![]:!![],'where':_0x223b43[_0x5ce8('0x21')]?_0x223b43['options']['where']||null:null,'attributes':_0x223b43[_0x5ce8('0x21')]?_0x223b43[_0x5ce8('0x21')][_0x5ce8('0x23')]||null:null,'limit':_0x223b43['options']?_0x223b43[_0x5ce8('0x21')][_0x5ce8('0x24')]||null:null,'include':_0x223b43[_0x5ce8('0x21')]?_0x223b43[_0x5ce8('0x21')]['include']?_[_0x5ce8('0x25')](_0x223b43[_0x5ce8('0x21')][_0x5ce8('0x26')],function(_0x41affd){return{'model':db[_0x41affd[_0x5ce8('0x27')]],'as':_0x41affd['as'],'attributes':_0x41affd[_0x5ce8('0x23')],'include':_0x41affd[_0x5ce8('0x26')]?_[_0x5ce8('0x25')](_0x41affd[_0x5ce8('0x26')],function(_0x2b7164){return{'model':db[_0x2b7164[_0x5ce8('0x27')]],'as':_0x2b7164['as'],'attributes':_0x2b7164[_0x5ce8('0x23')],'include':_0x2b7164['include']?_[_0x5ce8('0x25')](_0x2b7164['include'],function(_0x32a586){return{'model':db[_0x32a586[_0x5ce8('0x27')]],'as':_0x32a586['as'],'attributes':_0x32a586[_0x5ce8('0x23')]};}):[]};}):[]};}):[]:[]})[_0x5ce8('0x14')](function(_0x410cde){logger[_0x5ce8('0x15')](_0x5ce8('0x1e'),_0x223b43);logger['debug'](_0x5ce8('0x1e'),_0x223b43,JSON[_0x5ce8('0x19')](_0x410cde));_0x1c654a(_0x410cde);})[_0x5ce8('0x28')](function(_0x12a6f9){logger[_0x5ce8('0x1a')](_0x5ce8('0x1e'),_0x12a6f9[_0x5ce8('0x1d')],_0x223b43);_0x4d30c1(_0x4a4eb0[_0x5ce8('0x1a')](0x1f4,_0x12a6f9[_0x5ce8('0x1d')]));});});};exports[_0x5ce8('0x29')]=function(_0x1d711b){var _0x1964f3=this;return new Promise(function(_0x58c145,_0x55359a){return db[_0x5ce8('0x1f')][_0x5ce8('0x2a')]({'raw':_0x1d711b[_0x5ce8('0x21')]?_0x1d711b['options'][_0x5ce8('0x22')]===undefined?!![]:![]:!![],'where':_0x1d711b[_0x5ce8('0x21')]?_0x1d711b[_0x5ce8('0x21')]['where']||null:null,'attributes':_0x1d711b['options']?_0x1d711b[_0x5ce8('0x21')][_0x5ce8('0x23')]||null:null,'include':_0x1d711b['options']?_0x1d711b[_0x5ce8('0x21')][_0x5ce8('0x26')]?_['map'](_0x1d711b[_0x5ce8('0x21')]['include'],function(_0x1fa9a0){return{'model':db[_0x1fa9a0[_0x5ce8('0x27')]],'as':_0x1fa9a0['as'],'attributes':_0x1fa9a0[_0x5ce8('0x23')],'include':_0x1fa9a0[_0x5ce8('0x26')]?_[_0x5ce8('0x25')](_0x1fa9a0['include'],function(_0xefe35){return{'model':db[_0xefe35[_0x5ce8('0x27')]],'as':_0xefe35['as'],'attributes':_0xefe35[_0x5ce8('0x23')],'include':_0xefe35['include']?_[_0x5ce8('0x25')](_0xefe35[_0x5ce8('0x26')],function(_0x399596){return{'model':db[_0x399596[_0x5ce8('0x27')]],'as':_0x399596['as'],'attributes':_0x399596['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ce8('0x14')](function(_0x19b0ba){logger['info'](_0x5ce8('0x29'),_0x1d711b);logger[_0x5ce8('0x17')]('ShowSmsQueue',_0x1d711b,JSON[_0x5ce8('0x19')](_0x19b0ba));_0x58c145(_0x19b0ba);})[_0x5ce8('0x28')](function(_0x488eb8){logger[_0x5ce8('0x1a')](_0x5ce8('0x29'),_0x488eb8[_0x5ce8('0x1d')],_0x1d711b);_0x55359a(_0x1964f3['error'](0x1f4,_0x488eb8['message']));});});}; \ No newline at end of file +var _0xb9b6=['ShowSmsQueue','find','raw','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','GetSmsQueue','SmsQueue','options','where','limit','include','map','attributes','model','catch'];(function(_0x2e7899,_0x38fca7){var _0x3baa47=function(_0x282267){while(--_0x282267){_0x2e7899['push'](_0x2e7899['shift']());}};_0x3baa47(++_0x38fca7);}(_0xb9b6,0x19e));var _0x6b9b=function(_0x19aa84,_0x549537){_0x19aa84=_0x19aa84-0x0;var _0x536146=_0xb9b6[_0x19aa84];return _0x536146;};'use strict';var _=require(_0x6b9b('0x0'));var util=require('util');var moment=require(_0x6b9b('0x1'));var BPromise=require('bluebird');var rs=require(_0x6b9b('0x2'));var fs=require('fs');var Redis=require(_0x6b9b('0x3'));var db=require(_0x6b9b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b9b('0x5'))(_0x6b9b('0x6'));var config=require(_0x6b9b('0x7'));var jayson=require(_0x6b9b('0x8'));var client=jayson[_0x6b9b('0x9')][_0x6b9b('0xa')]({'port':0x232a});config[_0x6b9b('0xb')]=_[_0x6b9b('0xc')](config[_0x6b9b('0xb')],{'host':_0x6b9b('0xd'),'port':0x18eb});var socket=require(_0x6b9b('0xe'))(new Redis(config[_0x6b9b('0xb')]));require(_0x6b9b('0xf'))['register'](socket);function respondWithRpcPromise(_0x11ed90,_0x439e67,_0x2352dc){return new BPromise(function(_0x24e327,_0x59c72e){return client[_0x6b9b('0x10')](_0x11ed90,_0x2352dc)[_0x6b9b('0x11')](function(_0x4d8480){logger[_0x6b9b('0x12')]('SmsQueue,\x20%s,\x20%s',_0x439e67,_0x6b9b('0x13'));logger['debug'](_0x6b9b('0x14'),_0x439e67,_0x6b9b('0x13'),JSON[_0x6b9b('0x15')](_0x4d8480));if(_0x4d8480[_0x6b9b('0x16')]){if(_0x4d8480[_0x6b9b('0x16')][_0x6b9b('0x17')]===0x1f4){logger[_0x6b9b('0x16')]('SmsQueue,\x20%s,\x20%s',_0x439e67,_0x4d8480[_0x6b9b('0x16')]['message']);return _0x59c72e(_0x4d8480[_0x6b9b('0x16')]['message']);}logger[_0x6b9b('0x16')](_0x6b9b('0x18'),_0x439e67,_0x4d8480[_0x6b9b('0x16')][_0x6b9b('0x19')]);return _0x24e327(_0x4d8480[_0x6b9b('0x16')][_0x6b9b('0x19')]);}else{logger[_0x6b9b('0x12')](_0x6b9b('0x18'),_0x439e67,'request\x20sent');_0x24e327(_0x4d8480[_0x6b9b('0x1a')][_0x6b9b('0x19')]);}})['catch'](function(_0x8d71d8){logger[_0x6b9b('0x16')](_0x6b9b('0x18'),_0x439e67,_0x8d71d8);_0x59c72e(_0x8d71d8);});});}exports[_0x6b9b('0x1b')]=function(_0x41dee9){var _0x3ad50f=this;return new Promise(function(_0x1d4adb,_0x7ad54a){return db[_0x6b9b('0x1c')]['findAll']({'raw':_0x41dee9[_0x6b9b('0x1d')]?_0x41dee9['options']['raw']===undefined?!![]:![]:!![],'where':_0x41dee9['options']?_0x41dee9['options'][_0x6b9b('0x1e')]||null:null,'attributes':_0x41dee9[_0x6b9b('0x1d')]?_0x41dee9[_0x6b9b('0x1d')]['attributes']||null:null,'limit':_0x41dee9[_0x6b9b('0x1d')]?_0x41dee9[_0x6b9b('0x1d')][_0x6b9b('0x1f')]||null:null,'include':_0x41dee9[_0x6b9b('0x1d')]?_0x41dee9['options'][_0x6b9b('0x20')]?_[_0x6b9b('0x21')](_0x41dee9['options'][_0x6b9b('0x20')],function(_0x3b2178){return{'model':db[_0x3b2178['model']],'as':_0x3b2178['as'],'attributes':_0x3b2178[_0x6b9b('0x22')],'include':_0x3b2178[_0x6b9b('0x20')]?_[_0x6b9b('0x21')](_0x3b2178[_0x6b9b('0x20')],function(_0xb165c7){return{'model':db[_0xb165c7[_0x6b9b('0x23')]],'as':_0xb165c7['as'],'attributes':_0xb165c7['attributes'],'include':_0xb165c7[_0x6b9b('0x20')]?_[_0x6b9b('0x21')](_0xb165c7[_0x6b9b('0x20')],function(_0x32991e){return{'model':db[_0x32991e[_0x6b9b('0x23')]],'as':_0x32991e['as'],'attributes':_0x32991e[_0x6b9b('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6b9b('0x11')](function(_0x1527f7){logger['info'](_0x6b9b('0x1b'),_0x41dee9);logger['debug'](_0x6b9b('0x1b'),_0x41dee9,JSON[_0x6b9b('0x15')](_0x1527f7));_0x1d4adb(_0x1527f7);})[_0x6b9b('0x24')](function(_0x2f608f){logger[_0x6b9b('0x16')](_0x6b9b('0x1b'),_0x2f608f[_0x6b9b('0x19')],_0x41dee9);_0x7ad54a(_0x3ad50f[_0x6b9b('0x16')](0x1f4,_0x2f608f['message']));});});};exports[_0x6b9b('0x25')]=function(_0x5e87a9){var _0x33d21b=this;return new Promise(function(_0x107985,_0x58aa5d){return db[_0x6b9b('0x1c')][_0x6b9b('0x26')]({'raw':_0x5e87a9['options']?_0x5e87a9[_0x6b9b('0x1d')][_0x6b9b('0x27')]===undefined?!![]:![]:!![],'where':_0x5e87a9[_0x6b9b('0x1d')]?_0x5e87a9[_0x6b9b('0x1d')]['where']||null:null,'attributes':_0x5e87a9[_0x6b9b('0x1d')]?_0x5e87a9[_0x6b9b('0x1d')][_0x6b9b('0x22')]||null:null,'include':_0x5e87a9[_0x6b9b('0x1d')]?_0x5e87a9[_0x6b9b('0x1d')][_0x6b9b('0x20')]?_[_0x6b9b('0x21')](_0x5e87a9['options'][_0x6b9b('0x20')],function(_0x206943){return{'model':db[_0x206943[_0x6b9b('0x23')]],'as':_0x206943['as'],'attributes':_0x206943[_0x6b9b('0x22')],'include':_0x206943['include']?_[_0x6b9b('0x21')](_0x206943[_0x6b9b('0x20')],function(_0x389660){return{'model':db[_0x389660[_0x6b9b('0x23')]],'as':_0x389660['as'],'attributes':_0x389660[_0x6b9b('0x22')],'include':_0x389660[_0x6b9b('0x20')]?_[_0x6b9b('0x21')](_0x389660[_0x6b9b('0x20')],function(_0x26741b){return{'model':db[_0x26741b[_0x6b9b('0x23')]],'as':_0x26741b['as'],'attributes':_0x26741b[_0x6b9b('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6b9b('0x11')](function(_0x306c85){logger[_0x6b9b('0x12')]('ShowSmsQueue',_0x5e87a9);logger[_0x6b9b('0x28')](_0x6b9b('0x25'),_0x5e87a9,JSON['stringify'](_0x306c85));_0x107985(_0x306c85);})[_0x6b9b('0x24')](function(_0x59b2ac){logger[_0x6b9b('0x16')]('ShowSmsQueue',_0x59b2ac['message'],_0x5e87a9);_0x58aa5d(_0x33d21b[_0x6b9b('0x16')](0x1f4,_0x59b2ac[_0x6b9b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index dfb702f..343410c 100644 --- a/server/api/smsQueue/smsQueue.socket.js +++ b/server/api/smsQueue/smsQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed66=['removeListener','register','length','smsQueue:','./smsQueue.events','save','remove','update','emit'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xed66,0xa6));var _0x6ed6=function(_0x4fe5b5,_0x41efab){_0x4fe5b5=_0x4fe5b5-0x0;var _0x221fbe=_0xed66[_0x4fe5b5];return _0x221fbe;};'use strict';var SmsQueueEvents=require(_0x6ed6('0x0'));var events=[_0x6ed6('0x1'),_0x6ed6('0x2'),_0x6ed6('0x3')];function createListener(_0x5f411a,_0xe5943b){return function(_0xeca08){_0xe5943b[_0x6ed6('0x4')](_0x5f411a,_0xeca08);};}function removeListener(_0x2530c1,_0x1cc572){return function(){SmsQueueEvents[_0x6ed6('0x5')](_0x2530c1,_0x1cc572);};}exports[_0x6ed6('0x6')]=function(_0x7248c8){for(var _0x22fe73=0x0,_0x2aec2e=events[_0x6ed6('0x7')];_0x22fe73<_0x2aec2e;_0x22fe73++){var _0x30de38=events[_0x22fe73];var _0x4ca31a=createListener(_0x6ed6('0x8')+_0x30de38,_0x7248c8);SmsQueueEvents['on'](_0x30de38,_0x4ca31a);}}; \ No newline at end of file +var _0xaa17=['length','smsQueue:','./smsQueue.events','emit'];(function(_0x4ee791,_0x5897f6){var _0x3b6f42=function(_0x3956aa){while(--_0x3956aa){_0x4ee791['push'](_0x4ee791['shift']());}};_0x3b6f42(++_0x5897f6);}(_0xaa17,0x1b2));var _0x7aa1=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xaa17[_0x5b644e];return _0x49c6bf;};'use strict';var SmsQueueEvents=require(_0x7aa1('0x0'));var events=['save','remove','update'];function createListener(_0x1a23f1,_0x4b114c){return function(_0x59e82f){_0x4b114c[_0x7aa1('0x1')](_0x1a23f1,_0x59e82f);};}function removeListener(_0x1dd172,_0x478beb){return function(){SmsQueueEvents['removeListener'](_0x1dd172,_0x478beb);};}exports['register']=function(_0x547afc){for(var _0x41d75e=0x0,_0x2b708a=events[_0x7aa1('0x2')];_0x41d75e<_0x2b708a;_0x41d75e++){var _0x21539b=events[_0x41d75e];var _0x5d93ad=createListener(_0x7aa1('0x3')+_0x21539b,_0x547afc);SmsQueueEvents['on'](_0x21539b,_0x5d93ad);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 0184196..fb62960 100644 --- a/server/api/smsQueueReport/index.js +++ b/server/api/smsQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2a0=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x27d771,_0x1a50b2){var _0x2ba087=function(_0x1fcfa4){while(--_0x1fcfa4){_0x27d771['push'](_0x27d771['shift']());}};_0x2ba087(++_0x1a50b2);}(_0xa2a0,0x1c4));var _0x0a2a=function(_0x576866,_0x4ac50a){_0x576866=_0x576866-0x0;var _0x88ef91=_0xa2a0[_0x576866];return _0x88ef91;};'use strict';var multer=require(_0x0a2a('0x0'));var util=require(_0x0a2a('0x1'));var path=require(_0x0a2a('0x2'));var timeout=require(_0x0a2a('0x3'));var express=require(_0x0a2a('0x4'));var router=express[_0x0a2a('0x5')]();var auth=require(_0x0a2a('0x6'));var interaction=require(_0x0a2a('0x7'));var config=require(_0x0a2a('0x8'));var controller=require(_0x0a2a('0x9'));router[_0x0a2a('0xa')]('/',auth[_0x0a2a('0xb')](),controller['index']);router[_0x0a2a('0xa')](_0x0a2a('0xc'),auth[_0x0a2a('0xb')](),controller['describe']);router['get'](_0x0a2a('0xd'),auth[_0x0a2a('0xb')](),controller['show']);router[_0x0a2a('0xe')]('/',auth['isAuthenticated'](),controller[_0x0a2a('0xf')]);router['put'](_0x0a2a('0xd'),auth['isAuthenticated'](),controller[_0x0a2a('0x10')]);router['delete'](_0x0a2a('0xd'),auth[_0x0a2a('0xb')](),controller[_0x0a2a('0x11')]);module[_0x0a2a('0x12')]=router; \ No newline at end of file +var _0xf47d=['./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf47d,0xeb));var _0xdf47=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0xf47d[_0x3e6d5d];return _0x238923;};'use strict';var multer=require(_0xdf47('0x0'));var util=require(_0xdf47('0x1'));var path=require(_0xdf47('0x2'));var timeout=require(_0xdf47('0x3'));var express=require(_0xdf47('0x4'));var router=express['Router']();var auth=require(_0xdf47('0x5'));var interaction=require(_0xdf47('0x6'));var config=require('../../config/environment');var controller=require(_0xdf47('0x7'));router[_0xdf47('0x8')]('/',auth[_0xdf47('0x9')](),controller[_0xdf47('0xa')]);router[_0xdf47('0x8')](_0xdf47('0xb'),auth[_0xdf47('0x9')](),controller[_0xdf47('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdf47('0xd')]);router[_0xdf47('0xe')]('/',auth['isAuthenticated'](),controller[_0xdf47('0xf')]);router[_0xdf47('0x10')](_0xdf47('0x11'),auth[_0xdf47('0x9')](),controller[_0xdf47('0x12')]);router[_0xdf47('0x13')](_0xdf47('0x11'),auth['isAuthenticated'](),controller[_0xdf47('0x14')]);module[_0xdf47('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 0082753..a105910 100644 --- a/server/api/smsQueueReport/smsQueueReport.attributes.js +++ b/server/api/smsQueueReport/smsQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16d4=['moment','sequelize','STRING','DATE'];(function(_0xe2523,_0x32e4c8){var _0x1ee20a=function(_0x5cd37c){while(--_0x5cd37c){_0xe2523['push'](_0xe2523['shift']());}};_0x1ee20a(++_0x32e4c8);}(_0x16d4,0x64));var _0x416d=function(_0x52b85c,_0xa40c6){_0x52b85c=_0x52b85c-0x0;var _0x510a1e=_0x16d4[_0x52b85c];return _0x510a1e;};'use strict';var moment=require(_0x416d('0x0'));var Sequelize=require(_0x416d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x416d('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x416d('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x416d('0x2')]}}; \ No newline at end of file +var _0xaa3f=['moment','sequelize','DATE','STRING'];(function(_0x573c9e,_0xd4ab71){var _0x5d0714=function(_0x127a2a){while(--_0x127a2a){_0x573c9e['push'](_0x573c9e['shift']());}};_0x5d0714(++_0xd4ab71);}(_0xaa3f,0x144));var _0xfaa3=function(_0xf8cc52,_0x42078a){_0xf8cc52=_0xf8cc52-0x0;var _0xa74122=_0xaa3f[_0xf8cc52];return _0xa74122;};'use strict';var moment=require(_0xfaa3('0x0'));var Sequelize=require(_0xfaa3('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xfaa3('0x2')]},'leaveAt':{'type':Sequelize[_0xfaa3('0x2')]},'acceptAt':{'type':Sequelize[_0xfaa3('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfaa3('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 25ede43..264dd2b 100644 --- a/server/api/smsQueueReport/smsQueueReport.controller.js +++ b/server/api/smsQueueReport/smsQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9eee=['findAll','rows','catch','show','find','create','body','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','to-csv','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','SmsQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include'];(function(_0x5a09ab,_0x565b32){var _0x4a79b9=function(_0x361ad5){while(--_0x361ad5){_0x5a09ab['push'](_0x5a09ab['shift']());}};_0x4a79b9(++_0x565b32);}(_0x9eee,0x91));var _0xe9ee=function(_0x1570ed,_0x3a9587){_0x1570ed=_0x1570ed-0x0;var _0x46e90f=_0x9eee[_0x1570ed];return _0x46e90f;};'use strict';var pdf=require(_0xe9ee('0x0'));var emlformat=require(_0xe9ee('0x1'));var rimraf=require(_0xe9ee('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe9ee('0x3'));var moment=require(_0xe9ee('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe9ee('0x5'));var util=require(_0xe9ee('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe9ee('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe9ee('0x8'));var squel=require(_0xe9ee('0x9'));var crypto=require(_0xe9ee('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe9ee('0x7'));var querystring=require(_0xe9ee('0xb'));var Papa=require(_0xe9ee('0xc'));var Redis=require('ioredis');var authService=require(_0xe9ee('0xd'));var qs=require(_0xe9ee('0xe'));var hardwareService=require(_0xe9ee('0xf'));var logger=require('../../config/logger')(_0xe9ee('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe9ee('0x11'))['db'];function respondWithStatusCode(_0x2319ed,_0x100854){_0x100854=_0x100854||0xcc;return function(_0x34f2a9){if(_0x34f2a9){return _0x2319ed[_0xe9ee('0x12')](_0x100854);}return _0x2319ed[_0xe9ee('0x13')](_0x100854)['end']();};}function respondWithResult(_0x59efc1,_0x4d54b8){_0x4d54b8=_0x4d54b8||0xc8;return function(_0x37c4c8){if(_0x37c4c8){return _0x59efc1['status'](_0x4d54b8)['json'](_0x37c4c8);}};}function respondWithFilteredResult(_0x35adf8,_0x54dde7){return function(_0x115c5a){if(_0x115c5a){var _0x451abd=_0x115c5a[_0xe9ee('0x14')],_0x3ea8b6=_0x54dde7[_0xe9ee('0x15')],_0x48becf=_0x54dde7['offset']+_0x54dde7[_0xe9ee('0x16')],_0x8903;if(_0x48becf>=_0x451abd){_0x48becf=_0x451abd;_0x8903=0xc8;}else{_0x8903=0xce;}_0x35adf8[_0xe9ee('0x13')](_0x8903);return _0x35adf8[_0xe9ee('0x17')](_0xe9ee('0x18'),_0x3ea8b6+'-'+_0x48becf+'/'+_0x451abd)['json'](_0x115c5a);}return null;};}function patchUpdates(_0xf839e8){return function(_0x5ba853){try{jsonpatch['apply'](_0x5ba853,_0xf839e8,!![]);}catch(_0x1d9eb5){return BPromise[_0xe9ee('0x19')](_0x1d9eb5);}return _0x5ba853[_0xe9ee('0x1a')]();};}function saveUpdates(_0x1997b6,_0x2acd3a){return function(_0x506c89){if(_0x506c89){return _0x506c89[_0xe9ee('0x1b')](_0x1997b6)[_0xe9ee('0x1c')](function(_0x456088){return _0x456088;});}return null;};}function removeEntity(_0x12d6cd,_0x143d3e){return function(_0x1bb606){if(_0x1bb606){return _0x1bb606[_0xe9ee('0x1d')]()[_0xe9ee('0x1c')](function(){_0x12d6cd[_0xe9ee('0x13')](0xcc)[_0xe9ee('0x1e')]();});}};}function handleEntityNotFound(_0x1d87de,_0x488c43){return function(_0x30bdc2){if(!_0x30bdc2){_0x1d87de[_0xe9ee('0x12')](0x194);}return _0x30bdc2;};}function handleError(_0x3d92a4,_0x12d5a8){_0x12d5a8=_0x12d5a8||0x1f4;return function(_0xeb3177){logger[_0xe9ee('0x1f')](_0xeb3177[_0xe9ee('0x20')]);if(_0xeb3177[_0xe9ee('0x21')]){delete _0xeb3177[_0xe9ee('0x21')];}_0x3d92a4[_0xe9ee('0x13')](_0x12d5a8)['send'](_0xeb3177);};}exports['index']=function(_0x26d995,_0x31814c){var _0x27c27e={},_0x315492={},_0xe5cfa8={'count':0x0,'rows':[]};var _0x4032a1=db[_0xe9ee('0x22')][_0xe9ee('0x23')];_0x315492[_0xe9ee('0x24')]=_[_0xe9ee('0x25')](_0x4032a1);_0x315492[_0xe9ee('0x26')]=_[_0xe9ee('0x25')](_0x26d995['query']);_0x315492[_0xe9ee('0x27')]=_[_0xe9ee('0x28')](_0x315492[_0xe9ee('0x24')],_0x315492[_0xe9ee('0x26')]);_0x27c27e[_0xe9ee('0x29')]=_['intersection'](_0x315492[_0xe9ee('0x24')],qs[_0xe9ee('0x2a')](_0x26d995[_0xe9ee('0x26')][_0xe9ee('0x2a')]));_0x27c27e[_0xe9ee('0x29')]=_0x27c27e[_0xe9ee('0x29')][_0xe9ee('0x2b')]?_0x27c27e['attributes']:_0x315492[_0xe9ee('0x24')];if(!_0x26d995[_0xe9ee('0x26')][_0xe9ee('0x2c')](_0xe9ee('0x2d'))){_0x27c27e['limit']=qs[_0xe9ee('0x16')](_0x26d995[_0xe9ee('0x26')]['limit']);_0x27c27e[_0xe9ee('0x15')]=qs[_0xe9ee('0x15')](_0x26d995[_0xe9ee('0x26')][_0xe9ee('0x15')]);}_0x27c27e[_0xe9ee('0x2e')]=qs[_0xe9ee('0x2f')](_0x26d995['query'][_0xe9ee('0x2f')]);_0x27c27e[_0xe9ee('0x30')]=qs[_0xe9ee('0x27')](_[_0xe9ee('0x31')](_0x26d995[_0xe9ee('0x26')],_0x315492[_0xe9ee('0x27')]));if(_0x26d995[_0xe9ee('0x26')][_0xe9ee('0x32')]){_0x27c27e[_0xe9ee('0x30')]=_[_0xe9ee('0x33')](_0x27c27e[_0xe9ee('0x30')],{'$or':_[_0xe9ee('0x34')](_0x4032a1,function(_0x342f94){if(_0x342f94[_0xe9ee('0x35')][_0xe9ee('0x36')]!==_0xe9ee('0x37')){var _0x5e851f={};_0x5e851f[_0x342f94['field']]={'$like':'%'+_0x26d995[_0xe9ee('0x26')]['filter']+'%'};return _0x5e851f;}})});}_0x27c27e=_['merge']({},_0x27c27e,_0x26d995[_0xe9ee('0x38')]);var _0x389718={'where':_0x27c27e[_0xe9ee('0x30')]};return db[_0xe9ee('0x22')][_0xe9ee('0x14')](_0x389718)[_0xe9ee('0x1c')](function(_0x2ce711){_0xe5cfa8[_0xe9ee('0x14')]=_0x2ce711;if(_0x26d995[_0xe9ee('0x26')][_0xe9ee('0x39')]){_0x27c27e[_0xe9ee('0x3a')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xe9ee('0x3b')](_0x27c27e);})[_0xe9ee('0x1c')](function(_0x5299a1){_0xe5cfa8[_0xe9ee('0x3c')]=_0x5299a1;return _0xe5cfa8;})[_0xe9ee('0x1c')](respondWithFilteredResult(_0x31814c,_0x27c27e))[_0xe9ee('0x3d')](handleError(_0x31814c,null));};exports[_0xe9ee('0x3e')]=function(_0xece1b3,_0x3f2977){var _0x5b9896={'raw':!![],'where':{'id':_0xece1b3['params']['id']}},_0x3f516={};_0x3f516[_0xe9ee('0x24')]=_[_0xe9ee('0x25')](db[_0xe9ee('0x22')][_0xe9ee('0x23')]);_0x3f516[_0xe9ee('0x26')]=_[_0xe9ee('0x25')](_0xece1b3[_0xe9ee('0x26')]);_0x3f516[_0xe9ee('0x27')]=_['intersection'](_0x3f516[_0xe9ee('0x24')],_0x3f516[_0xe9ee('0x26')]);_0x5b9896['attributes']=_[_0xe9ee('0x28')](_0x3f516[_0xe9ee('0x24')],qs['fields'](_0xece1b3[_0xe9ee('0x26')][_0xe9ee('0x2a')]));_0x5b9896[_0xe9ee('0x29')]=_0x5b9896['attributes'][_0xe9ee('0x2b')]?_0x5b9896[_0xe9ee('0x29')]:_0x3f516[_0xe9ee('0x24')];if(_0xece1b3[_0xe9ee('0x26')]['includeAll']){_0x5b9896['include']=[{'all':!![]}];}_0x5b9896=_[_0xe9ee('0x33')]({},_0x5b9896,_0xece1b3['options']);return db['SmsQueueReport'][_0xe9ee('0x3f')](_0x5b9896)[_0xe9ee('0x1c')](handleEntityNotFound(_0x3f2977,null))[_0xe9ee('0x1c')](respondWithResult(_0x3f2977,null))['catch'](handleError(_0x3f2977,null));};exports[_0xe9ee('0x40')]=function(_0x322e2b,_0x51cda2){return db['SmsQueueReport'][_0xe9ee('0x40')](_0x322e2b[_0xe9ee('0x41')],{})['then'](respondWithResult(_0x51cda2,0xc9))[_0xe9ee('0x3d')](handleError(_0x51cda2,null));};exports[_0xe9ee('0x1b')]=function(_0x167a8e,_0x66eee){if(_0x167a8e['body']['id']){delete _0x167a8e[_0xe9ee('0x41')]['id'];}return db['SmsQueueReport'][_0xe9ee('0x3f')]({'where':{'id':_0x167a8e[_0xe9ee('0x42')]['id']}})[_0xe9ee('0x1c')](handleEntityNotFound(_0x66eee,null))['then'](saveUpdates(_0x167a8e[_0xe9ee('0x41')],null))[_0xe9ee('0x1c')](respondWithResult(_0x66eee,null))[_0xe9ee('0x3d')](handleError(_0x66eee,null));};exports[_0xe9ee('0x1d')]=function(_0x3c6d10,_0x59dcda){return db[_0xe9ee('0x22')]['find']({'where':{'id':_0x3c6d10['params']['id']}})['then'](handleEntityNotFound(_0x59dcda,null))[_0xe9ee('0x1c')](removeEntity(_0x59dcda,null))[_0xe9ee('0x3d')](handleError(_0x59dcda,null));};exports[_0xe9ee('0x43')]=function(_0x19730b,_0x735261){return db[_0xe9ee('0x22')][_0xe9ee('0x43')]()['then'](respondWithResult(_0x735261,null))[_0xe9ee('0x3d')](handleError(_0x735261,null));}; \ No newline at end of file +var _0x1b46=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','SmsQueueReport','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','key','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','html-pdf','eml-format','rimraf'];(function(_0x2d9c88,_0xd31cd){var _0x42fa5d=function(_0x532145){while(--_0x532145){_0x2d9c88['push'](_0x2d9c88['shift']());}};_0x42fa5d(++_0xd31cd);}(_0x1b46,0xde));var _0x61b4=function(_0x21d0fb,_0x5ba56e){_0x21d0fb=_0x21d0fb-0x0;var _0x3f2c33=_0x1b46[_0x21d0fb];return _0x3f2c33;};'use strict';var pdf=require(_0x61b4('0x0'));var emlformat=require(_0x61b4('0x1'));var rimraf=require(_0x61b4('0x2'));var zipdir=require(_0x61b4('0x3'));var jsonpatch=require(_0x61b4('0x4'));var rp=require(_0x61b4('0x5'));var moment=require(_0x61b4('0x6'));var BPromise=require(_0x61b4('0x7'));var Mustache=require(_0x61b4('0x8'));var util=require('util');var path=require(_0x61b4('0x9'));var sox=require(_0x61b4('0xa'));var csv=require('to-csv');var ejs=require(_0x61b4('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x61b4('0xc'));var crypto=require(_0x61b4('0xd'));var jsforce=require(_0x61b4('0xe'));var deskjs=require(_0x61b4('0xf'));var toCsv=require(_0x61b4('0x10'));var querystring=require(_0x61b4('0x11'));var Papa=require('papaparse');var Redis=require(_0x61b4('0x12'));var authService=require(_0x61b4('0x13'));var qs=require(_0x61b4('0x14'));var hardwareService=require(_0x61b4('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x61b4('0x16'));var config=require(_0x61b4('0x17'));var db=require(_0x61b4('0x18'))['db'];function respondWithStatusCode(_0xd7de34,_0x125c0c){_0x125c0c=_0x125c0c||0xcc;return function(_0x46696c){if(_0x46696c){return _0xd7de34[_0x61b4('0x19')](_0x125c0c);}return _0xd7de34['status'](_0x125c0c)[_0x61b4('0x1a')]();};}function respondWithResult(_0x32d6c9,_0x5066cb){_0x5066cb=_0x5066cb||0xc8;return function(_0x1d1e8c){if(_0x1d1e8c){return _0x32d6c9[_0x61b4('0x1b')](_0x5066cb)[_0x61b4('0x1c')](_0x1d1e8c);}};}function respondWithFilteredResult(_0x3b929a,_0x88adfa){return function(_0x2156cc){if(_0x2156cc){var _0xbc3ca1=_0x2156cc[_0x61b4('0x1d')],_0x561b8b=_0x88adfa[_0x61b4('0x1e')],_0x4ce0da=_0x88adfa['offset']+_0x88adfa[_0x61b4('0x1f')],_0x2478b;if(_0x4ce0da>=_0xbc3ca1){_0x4ce0da=_0xbc3ca1;_0x2478b=0xc8;}else{_0x2478b=0xce;}_0x3b929a[_0x61b4('0x1b')](_0x2478b);return _0x3b929a[_0x61b4('0x20')](_0x61b4('0x21'),_0x561b8b+'-'+_0x4ce0da+'/'+_0xbc3ca1)[_0x61b4('0x1c')](_0x2156cc);}return null;};}function patchUpdates(_0x28f6af){return function(_0x148baa){try{jsonpatch[_0x61b4('0x22')](_0x148baa,_0x28f6af,!![]);}catch(_0x26fbe9){return BPromise[_0x61b4('0x23')](_0x26fbe9);}return _0x148baa[_0x61b4('0x24')]();};}function saveUpdates(_0x54a780,_0xbe522f){return function(_0x26cc5c){if(_0x26cc5c){return _0x26cc5c[_0x61b4('0x25')](_0x54a780)[_0x61b4('0x26')](function(_0x27aa90){return _0x27aa90;});}return null;};}function removeEntity(_0x16e87d,_0x4cd1d5){return function(_0x120c6d){if(_0x120c6d){return _0x120c6d[_0x61b4('0x27')]()[_0x61b4('0x26')](function(){_0x16e87d[_0x61b4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53c7a7,_0x3f0818){return function(_0x41e485){if(!_0x41e485){_0x53c7a7[_0x61b4('0x19')](0x194);}return _0x41e485;};}function handleError(_0x2febe1,_0x4282a5){_0x4282a5=_0x4282a5||0x1f4;return function(_0x1c654f){logger['error'](_0x1c654f[_0x61b4('0x28')]);if(_0x1c654f[_0x61b4('0x29')]){delete _0x1c654f[_0x61b4('0x29')];}_0x2febe1[_0x61b4('0x1b')](_0x4282a5)[_0x61b4('0x2a')](_0x1c654f);};}exports[_0x61b4('0x2b')]=function(_0x54b7e5,_0x570dec){var _0x4ed78a={},_0x5c0134={},_0x429620={'count':0x0,'rows':[]};var _0x3ac381=db[_0x61b4('0x2c')][_0x61b4('0x2d')];_0x5c0134['model']=_[_0x61b4('0x2e')](_0x3ac381);_0x5c0134['query']=_[_0x61b4('0x2e')](_0x54b7e5[_0x61b4('0x2f')]);_0x5c0134[_0x61b4('0x30')]=_['intersection'](_0x5c0134[_0x61b4('0x31')],_0x5c0134[_0x61b4('0x2f')]);_0x4ed78a[_0x61b4('0x32')]=_[_0x61b4('0x33')](_0x5c0134[_0x61b4('0x31')],qs[_0x61b4('0x34')](_0x54b7e5[_0x61b4('0x2f')]['fields']));_0x4ed78a['attributes']=_0x4ed78a['attributes'][_0x61b4('0x35')]?_0x4ed78a['attributes']:_0x5c0134[_0x61b4('0x31')];if(!_0x54b7e5[_0x61b4('0x2f')][_0x61b4('0x36')]('nolimit')){_0x4ed78a['limit']=qs[_0x61b4('0x1f')](_0x54b7e5[_0x61b4('0x2f')][_0x61b4('0x1f')]);_0x4ed78a[_0x61b4('0x1e')]=qs[_0x61b4('0x1e')](_0x54b7e5[_0x61b4('0x2f')][_0x61b4('0x1e')]);}_0x4ed78a[_0x61b4('0x37')]=qs[_0x61b4('0x38')](_0x54b7e5[_0x61b4('0x2f')][_0x61b4('0x38')]);_0x4ed78a[_0x61b4('0x39')]=qs[_0x61b4('0x30')](_['pick'](_0x54b7e5['query'],_0x5c0134['filters']));if(_0x54b7e5[_0x61b4('0x2f')][_0x61b4('0x3a')]){_0x4ed78a['where']=_[_0x61b4('0x3b')](_0x4ed78a[_0x61b4('0x39')],{'$or':_[_0x61b4('0x3c')](_0x3ac381,function(_0x17e3b){if(_0x17e3b['type'][_0x61b4('0x3d')]!==_0x61b4('0x3e')){var _0x3271c2={};_0x3271c2[_0x17e3b['field']]={'$like':'%'+_0x54b7e5[_0x61b4('0x2f')]['filter']+'%'};return _0x3271c2;}})});}_0x4ed78a=_[_0x61b4('0x3b')]({},_0x4ed78a,_0x54b7e5[_0x61b4('0x3f')]);var _0x35fac8={'where':_0x4ed78a[_0x61b4('0x39')]};return db['SmsQueueReport'][_0x61b4('0x1d')](_0x35fac8)[_0x61b4('0x26')](function(_0x296892){_0x429620[_0x61b4('0x1d')]=_0x296892;if(_0x54b7e5[_0x61b4('0x2f')][_0x61b4('0x40')]){_0x4ed78a[_0x61b4('0x41')]=[{'all':!![]}];}return db[_0x61b4('0x2c')][_0x61b4('0x42')](_0x4ed78a);})[_0x61b4('0x26')](function(_0x2f2429){_0x429620[_0x61b4('0x43')]=_0x2f2429;return _0x429620;})[_0x61b4('0x26')](respondWithFilteredResult(_0x570dec,_0x4ed78a))['catch'](handleError(_0x570dec,null));};exports[_0x61b4('0x44')]=function(_0x3d2c0b,_0x5a7df4){var _0x466151={'raw':!![],'where':{'id':_0x3d2c0b[_0x61b4('0x45')]['id']}},_0x35cb80={};_0x35cb80[_0x61b4('0x31')]=_[_0x61b4('0x2e')](db[_0x61b4('0x2c')][_0x61b4('0x2d')]);_0x35cb80[_0x61b4('0x2f')]=_['keys'](_0x3d2c0b[_0x61b4('0x2f')]);_0x35cb80[_0x61b4('0x30')]=_[_0x61b4('0x33')](_0x35cb80['model'],_0x35cb80['query']);_0x466151[_0x61b4('0x32')]=_[_0x61b4('0x33')](_0x35cb80['model'],qs[_0x61b4('0x34')](_0x3d2c0b[_0x61b4('0x2f')][_0x61b4('0x34')]));_0x466151[_0x61b4('0x32')]=_0x466151[_0x61b4('0x32')][_0x61b4('0x35')]?_0x466151[_0x61b4('0x32')]:_0x35cb80[_0x61b4('0x31')];if(_0x3d2c0b[_0x61b4('0x2f')][_0x61b4('0x40')]){_0x466151[_0x61b4('0x41')]=[{'all':!![]}];}_0x466151=_[_0x61b4('0x3b')]({},_0x466151,_0x3d2c0b[_0x61b4('0x3f')]);return db[_0x61b4('0x2c')][_0x61b4('0x46')](_0x466151)[_0x61b4('0x26')](handleEntityNotFound(_0x5a7df4,null))[_0x61b4('0x26')](respondWithResult(_0x5a7df4,null))[_0x61b4('0x47')](handleError(_0x5a7df4,null));};exports['create']=function(_0x40cb23,_0xe12d97){return db[_0x61b4('0x2c')][_0x61b4('0x48')](_0x40cb23[_0x61b4('0x49')],{})['then'](respondWithResult(_0xe12d97,0xc9))[_0x61b4('0x47')](handleError(_0xe12d97,null));};exports['update']=function(_0x4b7919,_0x10912a){if(_0x4b7919[_0x61b4('0x49')]['id']){delete _0x4b7919['body']['id'];}return db[_0x61b4('0x2c')][_0x61b4('0x46')]({'where':{'id':_0x4b7919[_0x61b4('0x45')]['id']}})['then'](handleEntityNotFound(_0x10912a,null))['then'](saveUpdates(_0x4b7919[_0x61b4('0x49')],null))[_0x61b4('0x26')](respondWithResult(_0x10912a,null))[_0x61b4('0x47')](handleError(_0x10912a,null));};exports['destroy']=function(_0x54cc95,_0x41192f){return db[_0x61b4('0x2c')][_0x61b4('0x46')]({'where':{'id':_0x54cc95[_0x61b4('0x45')]['id']}})[_0x61b4('0x26')](handleEntityNotFound(_0x41192f,null))[_0x61b4('0x26')](removeEntity(_0x41192f,null))[_0x61b4('0x47')](handleError(_0x41192f,null));};exports[_0x61b4('0x4a')]=function(_0x2be7df,_0x222db8){return db[_0x61b4('0x2c')][_0x61b4('0x4a')]()[_0x61b4('0x26')](respondWithResult(_0x222db8,null))['catch'](handleError(_0x222db8,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index e8644ad..501301d 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4b6=['lodash','util','api','moment','request-promise','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x5a90a2,_0xd5d7b3){var _0x6e54c9=function(_0x2234b8){while(--_0x2234b8){_0x5a90a2['push'](_0x5a90a2['shift']());}};_0x6e54c9(++_0xd5d7b3);}(_0xd4b6,0x13f));var _0x6d4b=function(_0x4e47dd,_0x28ed73){_0x4e47dd=_0x4e47dd-0x0;var _0x2fd1f2=_0xd4b6[_0x4e47dd];return _0x2fd1f2;};'use strict';var _=require(_0x6d4b('0x0'));var util=require(_0x6d4b('0x1'));var logger=require('../../config/logger')(_0x6d4b('0x2'));var moment=require(_0x6d4b('0x3'));var BPromise=require('bluebird');var rp=require(_0x6d4b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d4b('0x5'));module[_0x6d4b('0x6')]=function(_0x442164,_0x5daf08){return _0x442164[_0x6d4b('0x7')](_0x6d4b('0x8'),attributes,{'tableName':_0x6d4b('0x9'),'paranoid':![],'indexes':[{'name':_0x6d4b('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x41c8=['report_sms_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport'];(function(_0x4e9107,_0x2fa63d){var _0x280f76=function(_0x19a1ed){while(--_0x19a1ed){_0x4e9107['push'](_0x4e9107['shift']());}};_0x280f76(++_0x2fa63d);}(_0x41c8,0x98));var _0x841c=function(_0x2fdc84,_0x308794){_0x2fdc84=_0x2fdc84-0x0;var _0x446133=_0x41c8[_0x2fdc84];return _0x446133;};'use strict';var _=require(_0x841c('0x0'));var util=require(_0x841c('0x1'));var logger=require('../../config/logger')(_0x841c('0x2'));var moment=require(_0x841c('0x3'));var BPromise=require(_0x841c('0x4'));var rp=require(_0x841c('0x5'));var fs=require('fs');var path=require(_0x841c('0x6'));var rimraf=require(_0x841c('0x7'));var config=require(_0x841c('0x8'));var attributes=require(_0x841c('0x9'));module[_0x841c('0xa')]=function(_0xff70f,_0x3b7561){return _0xff70f[_0x841c('0xb')](_0x841c('0xc'),attributes,{'tableName':_0x841c('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x841c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index d8b89f4..ab0d298 100644 --- a/server/api/smsQueueReport/smsQueueReport.rpc.js +++ b/server/api/smsQueueReport/smsQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90bd=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','result','catch','CreateSmsQueueReport','body','raw','UpdateSmsQueueReport','SmsQueueReport','update','options','where','limit','lodash','util','bluebird','randomstring'];(function(_0x7e384a,_0x2d3078){var _0x2514ec=function(_0x15c0bc){while(--_0x15c0bc){_0x7e384a['push'](_0x7e384a['shift']());}};_0x2514ec(++_0x2d3078);}(_0x90bd,0x172));var _0xd90b=function(_0x594e11,_0x28f652){_0x594e11=_0x594e11-0x0;var _0x5418ad=_0x90bd[_0x594e11];return _0x5418ad;};'use strict';var _=require(_0xd90b('0x0'));var util=require(_0xd90b('0x1'));var moment=require('moment');var BPromise=require(_0xd90b('0x2'));var rs=require(_0xd90b('0x3'));var fs=require('fs');var Redis=require(_0xd90b('0x4'));var db=require(_0xd90b('0x5'))['db'];var utils=require(_0xd90b('0x6'));var logger=require('../../config/logger')(_0xd90b('0x7'));var config=require(_0xd90b('0x8'));var jayson=require(_0xd90b('0x9'));var client=jayson[_0xd90b('0xa')][_0xd90b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a5d5e,_0x20d0a8,_0x457f53){return new BPromise(function(_0x50a374,_0x4a01c3){return client[_0xd90b('0xc')](_0x3a5d5e,_0x457f53)[_0xd90b('0xd')](function(_0x4ce262){logger[_0xd90b('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x20d0a8,_0xd90b('0xf'));logger[_0xd90b('0x10')](_0xd90b('0x11'),_0x20d0a8,_0xd90b('0xf'),JSON[_0xd90b('0x12')](_0x4ce262));if(_0x4ce262[_0xd90b('0x13')]){if(_0x4ce262[_0xd90b('0x13')][_0xd90b('0x14')]===0x1f4){logger[_0xd90b('0x13')](_0xd90b('0x15'),_0x20d0a8,_0x4ce262[_0xd90b('0x13')][_0xd90b('0x16')]);return _0x4a01c3(_0x4ce262['error']['message']);}logger[_0xd90b('0x13')](_0xd90b('0x15'),_0x20d0a8,_0x4ce262[_0xd90b('0x13')][_0xd90b('0x16')]);return _0x50a374(_0x4ce262['error'][_0xd90b('0x16')]);}else{logger[_0xd90b('0xe')](_0xd90b('0x15'),_0x20d0a8,_0xd90b('0xf'));_0x50a374(_0x4ce262[_0xd90b('0x17')][_0xd90b('0x16')]);}})[_0xd90b('0x18')](function(_0x36e4a6){logger[_0xd90b('0x13')](_0xd90b('0x15'),_0x20d0a8,_0x36e4a6);_0x4a01c3(_0x36e4a6);});});}exports[_0xd90b('0x19')]=function(_0x5e86db){var _0x492984=this;return new Promise(function(_0x524891,_0x57e22a){return db['SmsQueueReport']['create'](_0x5e86db[_0xd90b('0x1a')],{'raw':_0x5e86db['options']?_0x5e86db['options'][_0xd90b('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x401fdb){logger[_0xd90b('0xe')](_0xd90b('0x19'),_0x5e86db);logger[_0xd90b('0x10')](_0xd90b('0x19'),_0x5e86db,JSON['stringify'](_0x401fdb));_0x524891(_0x401fdb);})[_0xd90b('0x18')](function(_0x3a17db){logger[_0xd90b('0x13')](_0xd90b('0x19'),_0x3a17db['message'],_0x5e86db);_0x57e22a(_0x492984[_0xd90b('0x13')](0x1f4,_0x3a17db[_0xd90b('0x16')]));});});};exports[_0xd90b('0x1c')]=function(_0x242af4){var _0x3f512d=this;return new Promise(function(_0x17b4f7,_0x19bdc5){return db[_0xd90b('0x1d')][_0xd90b('0x1e')](_0x242af4[_0xd90b('0x1a')],{'raw':_0x242af4['options']?_0x242af4[_0xd90b('0x1f')][_0xd90b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x242af4[_0xd90b('0x1f')]?_0x242af4['options'][_0xd90b('0x20')]||null:null,'attributes':_0x242af4[_0xd90b('0x1f')]?_0x242af4[_0xd90b('0x1f')]['attributes']||null:null,'limit':_0x242af4[_0xd90b('0x1f')]?_0x242af4[_0xd90b('0x1f')][_0xd90b('0x21')]||null:null})[_0xd90b('0xd')](function(_0x52b5ba){logger[_0xd90b('0xe')](_0xd90b('0x1c'),_0x242af4);logger[_0xd90b('0x10')](_0xd90b('0x1c'),_0x242af4,JSON[_0xd90b('0x12')](_0x52b5ba));_0x17b4f7(_0x52b5ba);})[_0xd90b('0x18')](function(_0x56db7a){logger[_0xd90b('0x13')](_0xd90b('0x1c'),_0x56db7a[_0xd90b('0x16')],_0x242af4);_0x19bdc5(_0x3f512d['error'](0x1f4,_0x56db7a[_0xd90b('0x16')]));});});}; \ No newline at end of file +var _0x2906=['UpdateSmsQueueReport','update','body','where','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','options','raw'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x2906,0xe6));var _0x6290=function(_0x26b5cb,_0x15f879){_0x26b5cb=_0x26b5cb-0x0;var _0x3b2277=_0x2906[_0x26b5cb];return _0x3b2277;};'use strict';var _=require(_0x6290('0x0'));var util=require(_0x6290('0x1'));var moment=require('moment');var BPromise=require(_0x6290('0x2'));var rs=require(_0x6290('0x3'));var fs=require('fs');var Redis=require(_0x6290('0x4'));var db=require(_0x6290('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6290('0x6'))(_0x6290('0x7'));var config=require(_0x6290('0x8'));var jayson=require(_0x6290('0x9'));var client=jayson[_0x6290('0xa')][_0x6290('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bdc0a,_0x1ab3e8,_0x3696eb){return new BPromise(function(_0x1b84a0,_0x5ddfc9){return client['request'](_0x5bdc0a,_0x3696eb)['then'](function(_0x2c0fcc){logger[_0x6290('0xc')](_0x6290('0xd'),_0x1ab3e8,_0x6290('0xe'));logger[_0x6290('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x1ab3e8,_0x6290('0xe'),JSON[_0x6290('0x10')](_0x2c0fcc));if(_0x2c0fcc[_0x6290('0x11')]){if(_0x2c0fcc[_0x6290('0x11')][_0x6290('0x12')]===0x1f4){logger[_0x6290('0x11')](_0x6290('0xd'),_0x1ab3e8,_0x2c0fcc['error'][_0x6290('0x13')]);return _0x5ddfc9(_0x2c0fcc['error'][_0x6290('0x13')]);}logger[_0x6290('0x11')](_0x6290('0xd'),_0x1ab3e8,_0x2c0fcc['error'][_0x6290('0x13')]);return _0x1b84a0(_0x2c0fcc[_0x6290('0x11')][_0x6290('0x13')]);}else{logger['info'](_0x6290('0xd'),_0x1ab3e8,'request\x20sent');_0x1b84a0(_0x2c0fcc[_0x6290('0x14')][_0x6290('0x13')]);}})['catch'](function(_0x2add49){logger[_0x6290('0x11')](_0x6290('0xd'),_0x1ab3e8,_0x2add49);_0x5ddfc9(_0x2add49);});});}exports[_0x6290('0x15')]=function(_0x162b4b){var _0x5342af=this;return new Promise(function(_0x2db615,_0x28745a){return db[_0x6290('0x16')][_0x6290('0x17')](_0x162b4b['body'],{'raw':_0x162b4b[_0x6290('0x18')]?_0x162b4b[_0x6290('0x18')][_0x6290('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1d4067){logger[_0x6290('0xc')](_0x6290('0x15'),_0x162b4b);logger[_0x6290('0xf')](_0x6290('0x15'),_0x162b4b,JSON[_0x6290('0x10')](_0x1d4067));_0x2db615(_0x1d4067);})['catch'](function(_0x2bd305){logger['error'](_0x6290('0x15'),_0x2bd305[_0x6290('0x13')],_0x162b4b);_0x28745a(_0x5342af['error'](0x1f4,_0x2bd305[_0x6290('0x13')]));});});};exports[_0x6290('0x1a')]=function(_0x417e14){var _0x4d8491=this;return new Promise(function(_0x31c157,_0x4a6486){return db[_0x6290('0x16')][_0x6290('0x1b')](_0x417e14[_0x6290('0x1c')],{'raw':_0x417e14[_0x6290('0x18')]?_0x417e14[_0x6290('0x18')][_0x6290('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x417e14[_0x6290('0x18')]?_0x417e14[_0x6290('0x18')][_0x6290('0x1d')]||null:null,'attributes':_0x417e14[_0x6290('0x18')]?_0x417e14[_0x6290('0x18')]['attributes']||null:null,'limit':_0x417e14[_0x6290('0x18')]?_0x417e14[_0x6290('0x18')][_0x6290('0x1e')]||null:null})['then'](function(_0x1d8cf1){logger[_0x6290('0xc')](_0x6290('0x1a'),_0x417e14);logger[_0x6290('0xf')](_0x6290('0x1a'),_0x417e14,JSON['stringify'](_0x1d8cf1));_0x31c157(_0x1d8cf1);})[_0x6290('0x1f')](function(_0x4d7bc4){logger['error'](_0x6290('0x1a'),_0x4d7bc4[_0x6290('0x13')],_0x417e14);_0x4a6486(_0x4d8491['error'](0x1f4,_0x4d7bc4['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 9e0f800..a62d122 100644 --- a/server/api/smsTransferReport/index.js +++ b/server/api/smsTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffd=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','update','delete','destroy','exports','multer'];(function(_0x300f79,_0x16a0f9){var _0x3a4326=function(_0x3e9573){while(--_0x3e9573){_0x300f79['push'](_0x300f79['shift']());}};_0x3a4326(++_0x16a0f9);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3a5191,_0x3f4184){_0x3a5191=_0x3a5191-0x0;var _0x2c587a=_0x9ffd[_0x3a5191];return _0x2c587a;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var auth=require(_0xd9ff('0x5'));var interaction=require(_0xd9ff('0x6'));var config=require('../../config/environment');var controller=require(_0xd9ff('0x7'));router[_0xd9ff('0x8')]('/',auth['isAuthenticated'](),controller[_0xd9ff('0x9')]);router[_0xd9ff('0x8')](_0xd9ff('0xa'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xc')]);router[_0xd9ff('0x8')](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0x10')](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file +var _0x2547=['../../config/environment','get','isAuthenticated','index','describe','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2f7a4c,_0x2f8b77){var _0x1d23e0=function(_0x3e7a7e){while(--_0x3e7a7e){_0x2f7a4c['push'](_0x2f7a4c['shift']());}};_0x1d23e0(++_0x2f8b77);}(_0x2547,0x1cd));var _0x7254=function(_0x10efed,_0x329838){_0x10efed=_0x10efed-0x0;var _0x4fc48d=_0x2547[_0x10efed];return _0x4fc48d;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var auth=require(_0x7254('0x5'));var interaction=require(_0x7254('0x6'));var config=require(_0x7254('0x7'));var controller=require('./smsTransferReport.controller');router[_0x7254('0x8')]('/',auth[_0x7254('0x9')](),controller[_0x7254('0xa')]);router[_0x7254('0x8')]('/describe',auth[_0x7254('0x9')](),controller[_0x7254('0xb')]);router[_0x7254('0x8')]('/:id',auth[_0x7254('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7254('0xc')]);router[_0x7254('0xd')](_0x7254('0xe'),auth[_0x7254('0x9')](),controller[_0x7254('0xf')]);router[_0x7254('0x10')]('/:id',auth[_0x7254('0x9')](),controller['destroy']);module[_0x7254('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 7172954..2e9f961 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5204=['sequelize','exports','STRING','ENUM','account','agent','queue','NOW','moment'];(function(_0x1f59e3,_0x17fb81){var _0x3d3b2e=function(_0x30ce09){while(--_0x30ce09){_0x1f59e3['push'](_0x1f59e3['shift']());}};_0x3d3b2e(++_0x17fb81);}(_0x5204,0x116));var _0x4520=function(_0x1af98d,_0x3c608e){_0x1af98d=_0x1af98d-0x0;var _0x3553ea=_0x5204[_0x1af98d];return _0x3553ea;};'use strict';var moment=require(_0x4520('0x0'));var Sequelize=require(_0x4520('0x1'));module[_0x4520('0x2')]={'uniqueid':{'type':Sequelize[_0x4520('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4520('0x4')](_0x4520('0x5'),_0x4520('0x6'),_0x4520('0x7')),'allowNull':![],'defaultValue':_0x4520('0x7')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x4520('0x8')]}}; \ No newline at end of file +var _0x4aaa=['NOW','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x1041c6,_0x7ee475){var _0x49b6cf=function(_0x377a08){while(--_0x377a08){_0x1041c6['push'](_0x1041c6['shift']());}};_0x49b6cf(++_0x7ee475);}(_0x4aaa,0x159));var _0xa4aa=function(_0x4629fb,_0x5cae52){_0x4629fb=_0x4629fb-0x0;var _0x58be62=_0x4aaa[_0x4629fb];return _0x58be62;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xa4aa('0x0')]={'uniqueid':{'type':Sequelize[_0xa4aa('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa4aa('0x2')](_0xa4aa('0x3'),_0xa4aa('0x4'),_0xa4aa('0x5')),'allowNull':![],'defaultValue':_0xa4aa('0x5')},'transferredAt':{'type':Sequelize[_0xa4aa('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xa4aa('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index bf7e67a..8866bea 100644 --- a/server/api/smsTransferReport/smsTransferReport.controller.js +++ b/server/api/smsTransferReport/smsTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','SmsTransferReport','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','filter','includeAll','include','rows','catch','show','fields','options','create','body','find','params','describe','rimraf'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xcb91[_0x45d55e];return _0x29812a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xd'));var authService=require(_0x1cb9('0xe'));var qs=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require(_0x1cb9('0x11'))('api');var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var db=require(_0x1cb9('0x14'))['db'];function respondWithStatusCode(_0x3fdd83,_0x46af58){_0x46af58=_0x46af58||0xcc;return function(_0x5445e1){if(_0x5445e1){return _0x3fdd83['sendStatus'](_0x46af58);}return _0x3fdd83['status'](_0x46af58)[_0x1cb9('0x15')]();};}function respondWithResult(_0x282bc6,_0x384496){_0x384496=_0x384496||0xc8;return function(_0x1c714f){if(_0x1c714f){return _0x282bc6['status'](_0x384496)[_0x1cb9('0x16')](_0x1c714f);}};}function respondWithFilteredResult(_0x6ef389,_0x1b3cd7){return function(_0x8dfa55){if(_0x8dfa55){var _0x3e2d11=_0x8dfa55[_0x1cb9('0x17')],_0x5806d8=_0x1b3cd7[_0x1cb9('0x18')],_0x5572cb=_0x1b3cd7[_0x1cb9('0x18')]+_0x1b3cd7[_0x1cb9('0x19')],_0xd446a3;if(_0x5572cb>=_0x3e2d11){_0x5572cb=_0x3e2d11;_0xd446a3=0xc8;}else{_0xd446a3=0xce;}_0x6ef389[_0x1cb9('0x1a')](_0xd446a3);return _0x6ef389[_0x1cb9('0x1b')]('Content-Range',_0x5806d8+'-'+_0x5572cb+'/'+_0x3e2d11)['json'](_0x8dfa55);}return null;};}function patchUpdates(_0x1b2fa6){return function(_0x41ac41){try{jsonpatch[_0x1cb9('0x1c')](_0x41ac41,_0x1b2fa6,!![]);}catch(_0x31481a){return BPromise[_0x1cb9('0x1d')](_0x31481a);}return _0x41ac41[_0x1cb9('0x1e')]();};}function saveUpdates(_0x24fa1f,_0x4ac422){return function(_0x559bcc){if(_0x559bcc){return _0x559bcc[_0x1cb9('0x1f')](_0x24fa1f)['then'](function(_0x4750b1){return _0x4750b1;});}return null;};}function removeEntity(_0x2265ea,_0x523b26){return function(_0x599275){if(_0x599275){return _0x599275[_0x1cb9('0x20')]()[_0x1cb9('0x21')](function(){_0x2265ea[_0x1cb9('0x1a')](0xcc)[_0x1cb9('0x15')]();});}};}function handleEntityNotFound(_0x45b8d3,_0x27db16){return function(_0x59ebea){if(!_0x59ebea){_0x45b8d3['sendStatus'](0x194);}return _0x59ebea;};}function handleError(_0x6c6f61,_0x557199){_0x557199=_0x557199||0x1f4;return function(_0x10a419){logger[_0x1cb9('0x22')](_0x10a419[_0x1cb9('0x23')]);if(_0x10a419[_0x1cb9('0x24')]){delete _0x10a419[_0x1cb9('0x24')];}_0x6c6f61['status'](_0x557199)[_0x1cb9('0x25')](_0x10a419);};}exports[_0x1cb9('0x26')]=function(_0x4c8d76,_0xd6891c){var _0x21effa={},_0x41a9a0={},_0x1804fd={'count':0x0,'rows':[]};var _0x406821=db[_0x1cb9('0x27')][_0x1cb9('0x28')];_0x41a9a0[_0x1cb9('0x29')]=_[_0x1cb9('0x2a')](_0x406821);_0x41a9a0[_0x1cb9('0x2b')]=_['keys'](_0x4c8d76[_0x1cb9('0x2b')]);_0x41a9a0['filters']=_[_0x1cb9('0x2c')](_0x41a9a0['model'],_0x41a9a0[_0x1cb9('0x2b')]);_0x21effa[_0x1cb9('0x2d')]=_[_0x1cb9('0x2c')](_0x41a9a0[_0x1cb9('0x29')],qs['fields'](_0x4c8d76[_0x1cb9('0x2b')]['fields']));_0x21effa[_0x1cb9('0x2d')]=_0x21effa[_0x1cb9('0x2d')][_0x1cb9('0x2e')]?_0x21effa['attributes']:_0x41a9a0[_0x1cb9('0x29')];if(!_0x4c8d76['query'][_0x1cb9('0x2f')]('nolimit')){_0x21effa[_0x1cb9('0x19')]=qs[_0x1cb9('0x19')](_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x19')]);_0x21effa['offset']=qs[_0x1cb9('0x18')](_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x18')]);}_0x21effa[_0x1cb9('0x30')]=qs[_0x1cb9('0x31')](_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x31')]);_0x21effa[_0x1cb9('0x32')]=qs[_0x1cb9('0x33')](_[_0x1cb9('0x34')](_0x4c8d76[_0x1cb9('0x2b')],_0x41a9a0[_0x1cb9('0x33')]));if(_0x4c8d76[_0x1cb9('0x2b')]['filter']){_0x21effa['where']=_[_0x1cb9('0x35')](_0x21effa[_0x1cb9('0x32')],{'$or':_[_0x1cb9('0x36')](_0x406821,function(_0x29f451){if(_0x29f451[_0x1cb9('0x37')][_0x1cb9('0x38')]!==_0x1cb9('0x39')){var _0x3f5637={};_0x3f5637[_0x29f451['field']]={'$like':'%'+_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x3a')]+'%'};return _0x3f5637;}})});}_0x21effa=_[_0x1cb9('0x35')]({},_0x21effa,_0x4c8d76['options']);var _0x2a5aac={'where':_0x21effa['where']};return db[_0x1cb9('0x27')]['count'](_0x2a5aac)[_0x1cb9('0x21')](function(_0x13d4fd){_0x1804fd[_0x1cb9('0x17')]=_0x13d4fd;if(_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x3b')]){_0x21effa[_0x1cb9('0x3c')]=[{'all':!![]}];}return db[_0x1cb9('0x27')]['findAll'](_0x21effa);})['then'](function(_0x4111b8){_0x1804fd[_0x1cb9('0x3d')]=_0x4111b8;return _0x1804fd;})[_0x1cb9('0x21')](respondWithFilteredResult(_0xd6891c,_0x21effa))[_0x1cb9('0x3e')](handleError(_0xd6891c,null));};exports[_0x1cb9('0x3f')]=function(_0x1d7304,_0x32130b){var _0x4a670c={'raw':!![],'where':{'id':_0x1d7304['params']['id']}},_0xbcaa32={};_0xbcaa32['model']=_['keys'](db[_0x1cb9('0x27')][_0x1cb9('0x28')]);_0xbcaa32[_0x1cb9('0x2b')]=_[_0x1cb9('0x2a')](_0x1d7304[_0x1cb9('0x2b')]);_0xbcaa32['filters']=_[_0x1cb9('0x2c')](_0xbcaa32['model'],_0xbcaa32[_0x1cb9('0x2b')]);_0x4a670c[_0x1cb9('0x2d')]=_[_0x1cb9('0x2c')](_0xbcaa32['model'],qs[_0x1cb9('0x40')](_0x1d7304['query'][_0x1cb9('0x40')]));_0x4a670c[_0x1cb9('0x2d')]=_0x4a670c['attributes']['length']?_0x4a670c[_0x1cb9('0x2d')]:_0xbcaa32[_0x1cb9('0x29')];if(_0x1d7304[_0x1cb9('0x2b')][_0x1cb9('0x3b')]){_0x4a670c[_0x1cb9('0x3c')]=[{'all':!![]}];}_0x4a670c=_['merge']({},_0x4a670c,_0x1d7304[_0x1cb9('0x41')]);return db['SmsTransferReport']['find'](_0x4a670c)['then'](handleEntityNotFound(_0x32130b,null))[_0x1cb9('0x21')](respondWithResult(_0x32130b,null))[_0x1cb9('0x3e')](handleError(_0x32130b,null));};exports[_0x1cb9('0x42')]=function(_0x11cea5,_0x116c05){return db[_0x1cb9('0x27')][_0x1cb9('0x42')](_0x11cea5[_0x1cb9('0x43')],{})[_0x1cb9('0x21')](respondWithResult(_0x116c05,0xc9))[_0x1cb9('0x3e')](handleError(_0x116c05,null));};exports[_0x1cb9('0x1f')]=function(_0x4ce899,_0x9d08cb){if(_0x4ce899[_0x1cb9('0x43')]['id']){delete _0x4ce899[_0x1cb9('0x43')]['id'];}return db['SmsTransferReport'][_0x1cb9('0x44')]({'where':{'id':_0x4ce899[_0x1cb9('0x45')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x9d08cb,null))[_0x1cb9('0x21')](saveUpdates(_0x4ce899[_0x1cb9('0x43')],null))['then'](respondWithResult(_0x9d08cb,null))[_0x1cb9('0x3e')](handleError(_0x9d08cb,null));};exports['destroy']=function(_0x2eaa11,_0x4ac483){return db[_0x1cb9('0x27')][_0x1cb9('0x44')]({'where':{'id':_0x2eaa11[_0x1cb9('0x45')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x4ac483,null))['then'](removeEntity(_0x4ac483,null))[_0x1cb9('0x3e')](handleError(_0x4ac483,null));};exports[_0x1cb9('0x46')]=function(_0x1b750d,_0x3561a5){return db[_0x1cb9('0x27')][_0x1cb9('0x46')]()[_0x1cb9('0x21')](respondWithResult(_0x3561a5,null))[_0x1cb9('0x3e')](handleError(_0x3561a5,null));}; \ No newline at end of file +var _0x0713=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','set','Content-Range','json','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','SmsTransferReport','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','map','key','VIRTUAL','field','include','findAll','catch','show','params','length','includeAll','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x22548b,_0x2a04e7){var _0x52ba6e=function(_0x180ee4){while(--_0x180ee4){_0x22548b['push'](_0x22548b['shift']());}};_0x52ba6e(++_0x2a04e7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var hardwareService=require(_0x3071('0x14'));var logger=require(_0x3071('0x15'))('api');var utils=require(_0x3071('0x16'));var config=require(_0x3071('0x17'));var db=require(_0x3071('0x18'))['db'];function respondWithStatusCode(_0x3ed4a0,_0xa0c1){_0xa0c1=_0xa0c1||0xcc;return function(_0x4a8cc7){if(_0x4a8cc7){return _0x3ed4a0['sendStatus'](_0xa0c1);}return _0x3ed4a0[_0x3071('0x19')](_0xa0c1)['end']();};}function respondWithResult(_0x31c220,_0x44fbae){_0x44fbae=_0x44fbae||0xc8;return function(_0x5d4883){if(_0x5d4883){return _0x31c220[_0x3071('0x19')](_0x44fbae)['json'](_0x5d4883);}};}function respondWithFilteredResult(_0x2fc15d,_0x45c93b){return function(_0x1271d0){if(_0x1271d0){var _0x1f14e1=_0x1271d0[_0x3071('0x1a')],_0x1caa5d=_0x45c93b[_0x3071('0x1b')],_0x2a6a4b=_0x45c93b[_0x3071('0x1b')]+_0x45c93b['limit'],_0x157a47;if(_0x2a6a4b>=_0x1f14e1){_0x2a6a4b=_0x1f14e1;_0x157a47=0xc8;}else{_0x157a47=0xce;}_0x2fc15d[_0x3071('0x19')](_0x157a47);return _0x2fc15d[_0x3071('0x1c')](_0x3071('0x1d'),_0x1caa5d+'-'+_0x2a6a4b+'/'+_0x1f14e1)[_0x3071('0x1e')](_0x1271d0);}return null;};}function patchUpdates(_0x3acf0e){return function(_0x17aee2){try{jsonpatch[_0x3071('0x1f')](_0x17aee2,_0x3acf0e,!![]);}catch(_0x26f113){return BPromise['reject'](_0x26f113);}return _0x17aee2[_0x3071('0x20')]();};}function saveUpdates(_0x2bfa33,_0xd3e23d){return function(_0x56c267){if(_0x56c267){return _0x56c267[_0x3071('0x21')](_0x2bfa33)['then'](function(_0x833074){return _0x833074;});}return null;};}function removeEntity(_0x43128c,_0x3762d8){return function(_0x457b57){if(_0x457b57){return _0x457b57[_0x3071('0x22')]()[_0x3071('0x23')](function(){_0x43128c[_0x3071('0x19')](0xcc)[_0x3071('0x24')]();});}};}function handleEntityNotFound(_0x542646,_0x481a51){return function(_0x2ce48a){if(!_0x2ce48a){_0x542646[_0x3071('0x25')](0x194);}return _0x2ce48a;};}function handleError(_0x412652,_0x13df9f){_0x13df9f=_0x13df9f||0x1f4;return function(_0x2793ef){logger[_0x3071('0x26')](_0x2793ef[_0x3071('0x27')]);if(_0x2793ef[_0x3071('0x28')]){delete _0x2793ef[_0x3071('0x28')];}_0x412652['status'](_0x13df9f)[_0x3071('0x29')](_0x2793ef);};}exports[_0x3071('0x2a')]=function(_0x177138,_0x4d5c4b){var _0x4fb1ca={},_0x28792d={},_0x163604={'count':0x0,'rows':[]};var _0x950fde=db[_0x3071('0x2b')][_0x3071('0x2c')];_0x28792d[_0x3071('0x2d')]=_[_0x3071('0x2e')](_0x950fde);_0x28792d[_0x3071('0x2f')]=_[_0x3071('0x2e')](_0x177138[_0x3071('0x2f')]);_0x28792d['filters']=_['intersection'](_0x28792d[_0x3071('0x2d')],_0x28792d[_0x3071('0x2f')]);_0x4fb1ca[_0x3071('0x30')]=_[_0x3071('0x31')](_0x28792d[_0x3071('0x2d')],qs[_0x3071('0x32')](_0x177138[_0x3071('0x2f')][_0x3071('0x32')]));_0x4fb1ca['attributes']=_0x4fb1ca['attributes']['length']?_0x4fb1ca[_0x3071('0x30')]:_0x28792d[_0x3071('0x2d')];if(!_0x177138['query'][_0x3071('0x33')](_0x3071('0x34'))){_0x4fb1ca[_0x3071('0x35')]=qs[_0x3071('0x35')](_0x177138['query'][_0x3071('0x35')]);_0x4fb1ca[_0x3071('0x1b')]=qs[_0x3071('0x1b')](_0x177138[_0x3071('0x2f')][_0x3071('0x1b')]);}_0x4fb1ca[_0x3071('0x36')]=qs[_0x3071('0x37')](_0x177138[_0x3071('0x2f')]['sort']);_0x4fb1ca[_0x3071('0x38')]=qs['filters'](_['pick'](_0x177138[_0x3071('0x2f')],_0x28792d[_0x3071('0x39')]));if(_0x177138['query'][_0x3071('0x3a')]){_0x4fb1ca[_0x3071('0x38')]=_[_0x3071('0x3b')](_0x4fb1ca[_0x3071('0x38')],{'$or':_[_0x3071('0x3c')](_0x950fde,function(_0x232235){if(_0x232235['type'][_0x3071('0x3d')]!==_0x3071('0x3e')){var _0x4ce6d4={};_0x4ce6d4[_0x232235[_0x3071('0x3f')]]={'$like':'%'+_0x177138['query'][_0x3071('0x3a')]+'%'};return _0x4ce6d4;}})});}_0x4fb1ca=_[_0x3071('0x3b')]({},_0x4fb1ca,_0x177138['options']);var _0x593c99={'where':_0x4fb1ca[_0x3071('0x38')]};return db[_0x3071('0x2b')][_0x3071('0x1a')](_0x593c99)['then'](function(_0x4dea69){_0x163604['count']=_0x4dea69;if(_0x177138[_0x3071('0x2f')]['includeAll']){_0x4fb1ca[_0x3071('0x40')]=[{'all':!![]}];}return db[_0x3071('0x2b')][_0x3071('0x41')](_0x4fb1ca);})[_0x3071('0x23')](function(_0x30ab68){_0x163604['rows']=_0x30ab68;return _0x163604;})['then'](respondWithFilteredResult(_0x4d5c4b,_0x4fb1ca))[_0x3071('0x42')](handleError(_0x4d5c4b,null));};exports[_0x3071('0x43')]=function(_0x1455be,_0x1f69a6){var _0x525389={'raw':!![],'where':{'id':_0x1455be[_0x3071('0x44')]['id']}},_0x3cfc05={};_0x3cfc05[_0x3071('0x2d')]=_[_0x3071('0x2e')](db[_0x3071('0x2b')][_0x3071('0x2c')]);_0x3cfc05['query']=_[_0x3071('0x2e')](_0x1455be['query']);_0x3cfc05['filters']=_['intersection'](_0x3cfc05['model'],_0x3cfc05[_0x3071('0x2f')]);_0x525389[_0x3071('0x30')]=_[_0x3071('0x31')](_0x3cfc05[_0x3071('0x2d')],qs[_0x3071('0x32')](_0x1455be[_0x3071('0x2f')][_0x3071('0x32')]));_0x525389[_0x3071('0x30')]=_0x525389['attributes'][_0x3071('0x45')]?_0x525389[_0x3071('0x30')]:_0x3cfc05[_0x3071('0x2d')];if(_0x1455be[_0x3071('0x2f')][_0x3071('0x46')]){_0x525389['include']=[{'all':!![]}];}_0x525389=_['merge']({},_0x525389,_0x1455be[_0x3071('0x47')]);return db[_0x3071('0x2b')][_0x3071('0x48')](_0x525389)[_0x3071('0x23')](handleEntityNotFound(_0x1f69a6,null))[_0x3071('0x23')](respondWithResult(_0x1f69a6,null))['catch'](handleError(_0x1f69a6,null));};exports[_0x3071('0x49')]=function(_0x4a1d29,_0x18a773){return db['SmsTransferReport']['create'](_0x4a1d29[_0x3071('0x4a')],{})['then'](respondWithResult(_0x18a773,0xc9))[_0x3071('0x42')](handleError(_0x18a773,null));};exports['update']=function(_0x717c43,_0x1d75e5){if(_0x717c43[_0x3071('0x4a')]['id']){delete _0x717c43[_0x3071('0x4a')]['id'];}return db['SmsTransferReport'][_0x3071('0x48')]({'where':{'id':_0x717c43['params']['id']}})[_0x3071('0x23')](handleEntityNotFound(_0x1d75e5,null))['then'](saveUpdates(_0x717c43[_0x3071('0x4a')],null))[_0x3071('0x23')](respondWithResult(_0x1d75e5,null))['catch'](handleError(_0x1d75e5,null));};exports[_0x3071('0x22')]=function(_0x117e73,_0x224a70){return db[_0x3071('0x2b')][_0x3071('0x48')]({'where':{'id':_0x117e73[_0x3071('0x44')]['id']}})[_0x3071('0x23')](handleEntityNotFound(_0x224a70,null))['then'](removeEntity(_0x224a70,null))[_0x3071('0x42')](handleError(_0x224a70,null));};exports[_0x3071('0x4b')]=function(_0x443b0e,_0xda07a4){return db['SmsTransferReport'][_0x3071('0x4b')]()[_0x3071('0x23')](respondWithResult(_0xda07a4,null))[_0x3071('0x42')](handleError(_0xda07a4,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 5c0afd8..2f8f3a9 100644 --- a/server/api/smsTransferReport/smsTransferReport.model.js +++ b/server/api/smsTransferReport/smsTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6b0=['./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x462fe4,_0x394d3e){var _0x82b23a=function(_0x2c071f){while(--_0x2c071f){_0x462fe4['push'](_0x462fe4['shift']());}};_0x82b23a(++_0x394d3e);}(_0xa6b0,0xaf));var _0x0a6b=function(_0xda46e0,_0x274f30){_0xda46e0=_0xda46e0-0x0;var _0xe3aac1=_0xa6b0[_0xda46e0];return _0xe3aac1;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a6b('0x2'));var BPromise=require(_0x0a6b('0x3'));var rp=require(_0x0a6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var attributes=require(_0x0a6b('0x7'));module[_0x0a6b('0x8')]=function(_0x3dc2b0,_0x3b6967){return _0x3dc2b0[_0x0a6b('0x9')](_0x0a6b('0xa'),attributes,{'tableName':_0x0a6b('0xb'),'paranoid':![],'indexes':[{'name':_0x0a6b('0xc'),'fields':[_0x0a6b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf69d=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer'];(function(_0x43747e,_0x13b832){var _0x7fb853=function(_0x4b1028){while(--_0x4b1028){_0x43747e['push'](_0x43747e['shift']());}};_0x7fb853(++_0x13b832);}(_0xf69d,0xd3));var _0xdf69=function(_0x62142c,_0x1dbe3c){_0x62142c=_0x62142c-0x0;var _0x231b86=_0xf69d[_0x62142c];return _0x231b86;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var logger=require(_0xdf69('0x2'))(_0xdf69('0x3'));var moment=require(_0xdf69('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf69('0x5'));var fs=require('fs');var path=require(_0xdf69('0x6'));var rimraf=require(_0xdf69('0x7'));var config=require(_0xdf69('0x8'));var attributes=require(_0xdf69('0x9'));module[_0xdf69('0xa')]=function(_0x2d456f,_0x465b1b){return _0x2d456f[_0xdf69('0xb')](_0xdf69('0xc'),attributes,{'tableName':_0xdf69('0xd'),'paranoid':![],'indexes':[{'name':_0xdf69('0xe'),'fields':[_0xdf69('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 38c44fd..cdd32dd 100644 --- a/server/api/smsTransferReport/smsTransferReport.rpc.js +++ b/server/api/smsTransferReport/smsTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x734a=['result','catch','lodash','util','moment','../../mysqldb','rpc','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x5ba7a9,_0x42efb5){var _0x3a8e51=function(_0x343ddc){while(--_0x343ddc){_0x5ba7a9['push'](_0x5ba7a9['shift']());}};_0x3a8e51(++_0x42efb5);}(_0x734a,0xc8));var _0xa734=function(_0x36d8ff,_0x224895){_0x36d8ff=_0x36d8ff-0x0;var _0x906ef5=_0x734a[_0x36d8ff];return _0x906ef5;};'use strict';var _=require(_0xa734('0x0'));var util=require(_0xa734('0x1'));var moment=require(_0xa734('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa734('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa734('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa734('0x5')][_0xa734('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x33984f,_0x235730,_0x1dcbc8){return new BPromise(function(_0x10ca15,_0x2c7da1){return client[_0xa734('0x7')](_0x33984f,_0x1dcbc8)['then'](function(_0xfa6bff){logger[_0xa734('0x8')](_0xa734('0x9'),_0x235730,_0xa734('0xa'));logger[_0xa734('0xb')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x235730,'request\x20sent',JSON[_0xa734('0xc')](_0xfa6bff));if(_0xfa6bff['error']){if(_0xfa6bff[_0xa734('0xd')][_0xa734('0xe')]===0x1f4){logger[_0xa734('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x235730,_0xfa6bff['error'][_0xa734('0xf')]);return _0x2c7da1(_0xfa6bff[_0xa734('0xd')]['message']);}logger['error'](_0xa734('0x9'),_0x235730,_0xfa6bff[_0xa734('0xd')]['message']);return _0x10ca15(_0xfa6bff['error']['message']);}else{logger[_0xa734('0x8')]('SmsTransferReport,\x20%s,\x20%s',_0x235730,_0xa734('0xa'));_0x10ca15(_0xfa6bff[_0xa734('0x10')]['message']);}})[_0xa734('0x11')](function(_0x389997){logger[_0xa734('0xd')](_0xa734('0x9'),_0x235730,_0x389997);_0x2c7da1(_0x389997);});});} \ No newline at end of file +var _0xe59e=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe59e,0x135));var _0xee59=function(_0xe73014,_0x2fdcbc){_0xe73014=_0xe73014-0x0;var _0x127bd3=_0xe59e[_0xe73014];return _0x127bd3;};'use strict';var _=require('lodash');var util=require(_0xee59('0x0'));var moment=require(_0xee59('0x1'));var BPromise=require('bluebird');var rs=require(_0xee59('0x2'));var fs=require('fs');var Redis=require(_0xee59('0x3'));var db=require(_0xee59('0x4'))['db'];var utils=require(_0xee59('0x5'));var logger=require(_0xee59('0x6'))(_0xee59('0x7'));var config=require(_0xee59('0x8'));var jayson=require(_0xee59('0x9'));var client=jayson['client'][_0xee59('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdf1cfb,_0x33ef27,_0x278bb1){return new BPromise(function(_0x37b093,_0x52969a){return client['request'](_0xdf1cfb,_0x278bb1)[_0xee59('0xb')](function(_0x34e151){logger[_0xee59('0xc')](_0xee59('0xd'),_0x33ef27,_0xee59('0xe'));logger[_0xee59('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x33ef27,_0xee59('0xe'),JSON[_0xee59('0x10')](_0x34e151));if(_0x34e151[_0xee59('0x11')]){if(_0x34e151[_0xee59('0x11')][_0xee59('0x12')]===0x1f4){logger['error'](_0xee59('0xd'),_0x33ef27,_0x34e151[_0xee59('0x11')][_0xee59('0x13')]);return _0x52969a(_0x34e151['error'][_0xee59('0x13')]);}logger[_0xee59('0x11')](_0xee59('0xd'),_0x33ef27,_0x34e151[_0xee59('0x11')][_0xee59('0x13')]);return _0x37b093(_0x34e151[_0xee59('0x11')][_0xee59('0x13')]);}else{logger[_0xee59('0xc')](_0xee59('0xd'),_0x33ef27,_0xee59('0xe'));_0x37b093(_0x34e151['result'][_0xee59('0x13')]);}})[_0xee59('0x14')](function(_0x5433eb){logger[_0xee59('0x11')](_0xee59('0xd'),_0x33ef27,_0x5433eb);_0x52969a(_0x5433eb);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index f499893..30e06b5 100644 --- a/server/api/sound/index.js +++ b/server/api/sound/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d05=['../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','diskStorage','join','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','post','single','file','create','update','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d05,0x191));var _0x56d0=function(_0x38172e,_0x9ce5f6){_0x38172e=_0x38172e-0x0;var _0x31daaf=_0x6d05[_0x38172e];return _0x31daaf;};'use strict';var multer=require(_0x56d0('0x0'));var util=require(_0x56d0('0x1'));var path=require(_0x56d0('0x2'));var timeout=require(_0x56d0('0x3'));var express=require('express');var router=express[_0x56d0('0x4')]();var auth=require(_0x56d0('0x5'));var interaction=require(_0x56d0('0x6'));var config=require(_0x56d0('0x7'));var controller=require(_0x56d0('0x8'));router['get']('/',auth[_0x56d0('0x9')](),controller[_0x56d0('0xa')]);router[_0x56d0('0xb')](_0x56d0('0xc'),auth[_0x56d0('0x9')](),controller[_0x56d0('0xd')]);router[_0x56d0('0xb')]('/:id/download',auth[_0x56d0('0x9')](),controller['download']);var upload=multer({'storage':multer[_0x56d0('0xe')]({'destination':function(_0x36c13d,_0x46a6c3,_0x105d51){_0x105d51(null,path[_0x56d0('0xf')](config['root'],_0x56d0('0x10')));},'filename':function(_0x31e819,_0x3829ad,_0xd12a03){_0x3829ad[_0x56d0('0x11')]=_0x3829ad[_0x56d0('0x11')][_0x56d0('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xd12a03(null,util['format'](_0x56d0('0x13'),path[_0x56d0('0x14')](_0x3829ad[_0x56d0('0x11')],path[_0x56d0('0x15')](_0x3829ad['originalname'])),Date['now'](),path[_0x56d0('0x15')](_0x3829ad[_0x56d0('0x11')])));}})});router[_0x56d0('0x16')]('/',upload[_0x56d0('0x17')](_0x56d0('0x18')),controller[_0x56d0('0x19')]);router['put'](_0x56d0('0xc'),auth[_0x56d0('0x9')](),controller[_0x56d0('0x1a')]);router[_0x56d0('0x1b')](_0x56d0('0xc'),auth['isAuthenticated'](),controller['delete']);module[_0x56d0('0x1c')]=router; \ No newline at end of file +var _0xb03f=['download','root','replace','format','%s-%s%s','basename','originalname','extname','post','single','file','create','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','/:id/download'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xb03f,0x197));var _0xfb03=function(_0xace5bb,_0x4322f6){_0xace5bb=_0xace5bb-0x0;var _0x37bd48=_0xb03f[_0xace5bb];return _0x37bd48;};'use strict';var multer=require(_0xfb03('0x0'));var util=require(_0xfb03('0x1'));var path=require('path');var timeout=require(_0xfb03('0x2'));var express=require(_0xfb03('0x3'));var router=express[_0xfb03('0x4')]();var auth=require(_0xfb03('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfb03('0x6'));var controller=require(_0xfb03('0x7'));router[_0xfb03('0x8')]('/',auth[_0xfb03('0x9')](),controller['index']);router[_0xfb03('0x8')](_0xfb03('0xa'),auth['isAuthenticated'](),controller[_0xfb03('0xb')]);router[_0xfb03('0x8')](_0xfb03('0xc'),auth['isAuthenticated'](),controller[_0xfb03('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x26d874,_0x4bd497,_0x592959){_0x592959(null,path['join'](config[_0xfb03('0xe')],'server/files/sounds/original/'));},'filename':function(_0x4bd71a,_0x4ff7f1,_0x1cd6eb){_0x4ff7f1['originalname']=_0x4ff7f1['originalname'][_0xfb03('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1cd6eb(null,util[_0xfb03('0x10')](_0xfb03('0x11'),path[_0xfb03('0x12')](_0x4ff7f1[_0xfb03('0x13')],path[_0xfb03('0x14')](_0x4ff7f1['originalname'])),Date['now'](),path[_0xfb03('0x14')](_0x4ff7f1[_0xfb03('0x13')])));}})});router[_0xfb03('0x15')]('/',upload[_0xfb03('0x16')](_0xfb03('0x17')),controller[_0xfb03('0x18')]);router['put'](_0xfb03('0xa'),auth[_0xfb03('0x9')](),controller[_0xfb03('0x19')]);router['delete'](_0xfb03('0xa'),auth[_0xfb03('0x9')](),controller[_0xfb03('0x1a')]);module[_0xfb03('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 9b43ce7..45da321 100644 --- a/server/api/sound/sound.attributes.js +++ b/server/api/sound/sound.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc56c=['name','STRING','BIGINT','INTEGER'];(function(_0x14fe9f,_0x37e6f2){var _0x4cef94=function(_0x29e569){while(--_0x29e569){_0x14fe9f['push'](_0x14fe9f['shift']());}};_0x4cef94(++_0x37e6f2);}(_0xc56c,0xf4));var _0xcc56=function(_0x3bfb15,_0x5a7326){_0x3bfb15=_0x3bfb15-0x0;var _0xf74830=_0xc56c[_0x3bfb15];return _0xf74830;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xcc56('0x0'),'allowNull':![]},'save_name':{'type':Sequelize[_0xcc56('0x1')]},'display_name':{'type':Sequelize[_0xcc56('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xcc56('0x1')]},'original_format':{'type':Sequelize[_0xcc56('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xcc56('0x2')]},'original_channelCount':{'type':Sequelize[_0xcc56('0x3')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xcc56('0x3')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xcc56('0x2')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xcc56('0x2')]},'converted_sampleRate':{'type':Sequelize[_0xcc56('0x3')]}}; \ No newline at end of file +var _0x4c13=['BIGINT','INTEGER','exports','STRING','FLOAT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c13,0x1c9));var _0x34c1=function(_0x58c0cd,_0x535ee7){_0x58c0cd=_0x58c0cd-0x0;var _0x28cead=_0x4c13[_0x58c0cd];return _0x28cead;};'use strict';var Sequelize=require('sequelize');module[_0x34c1('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x34c1('0x1')]},'display_name':{'type':Sequelize[_0x34c1('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x34c1('0x1')]},'original_duration':{'type':Sequelize[_0x34c1('0x2')]},'original_sampleCount':{'type':Sequelize[_0x34c1('0x3')]},'original_channelCount':{'type':Sequelize[_0x34c1('0x4')]},'original_bitRate':{'type':Sequelize[_0x34c1('0x3')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x34c1('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x34c1('0x4')]},'converted_bitRate':{'type':Sequelize[_0x34c1('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 2f95270..cbe3300 100644 --- a/server/api/sound/sound.controller.js +++ b/server/api/sound/sound.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x434e=['duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','pick','original_format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','destroy','get','Sounds','UserProfileResource','then','error','stack','send','index','Sound','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','map','type','key','VIRTUAL','options','count','include','findAll','rows','catch','params','find','converted_format','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','name','create','file','originalname','extname','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','unlinkSync','src','original_duration'];(function(_0x1e59ed,_0x3a610c){var _0x164b09=function(_0x18a6c8){while(--_0x18a6c8){_0x1e59ed['push'](_0x1e59ed['shift']());}};_0x164b09(++_0x3a610c);}(_0x434e,0x181));var _0xe434=function(_0x460fd7,_0x2012db){_0x460fd7=_0x460fd7-0x0;var _0x44d1c2=_0x434e[_0x460fd7];return _0x44d1c2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe434('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe434('0x1'));var jsonpatch=require(_0xe434('0x2'));var rp=require(_0xe434('0x3'));var moment=require(_0xe434('0x4'));var BPromise=require(_0xe434('0x5'));var Mustache=require('mustache');var util=require(_0xe434('0x6'));var path=require(_0xe434('0x7'));var sox=require(_0xe434('0x8'));var csv=require(_0xe434('0x9'));var ejs=require(_0xe434('0xa'));var fs=require('fs');var _=require(_0xe434('0xb'));var squel=require(_0xe434('0xc'));var crypto=require(_0xe434('0xd'));var jsforce=require(_0xe434('0xe'));var deskjs=require(_0xe434('0xf'));var toCsv=require(_0xe434('0x9'));var querystring=require('querystring');var Papa=require(_0xe434('0x10'));var Redis=require(_0xe434('0x11'));var authService=require(_0xe434('0x12'));var qs=require(_0xe434('0x13'));var hardwareService=require(_0xe434('0x14'));var logger=require('../../config/logger')(_0xe434('0x15'));var utils=require(_0xe434('0x16'));var config=require('../../config/environment');var db=require(_0xe434('0x17'))['db'];function respondWithStatusCode(_0xf6c435,_0x2f8204){_0x2f8204=_0x2f8204||0xcc;return function(_0x25f9f2){if(_0x25f9f2){return _0xf6c435[_0xe434('0x18')](_0x2f8204);}return _0xf6c435['status'](_0x2f8204)[_0xe434('0x19')]();};}function respondWithResult(_0x531658,_0x5d907d){_0x5d907d=_0x5d907d||0xc8;return function(_0x3b51f1){if(_0x3b51f1){return _0x531658[_0xe434('0x1a')](_0x5d907d)[_0xe434('0x1b')](_0x3b51f1);}};}function respondWithFilteredResult(_0x373c62,_0x216ecc){return function(_0x189718){if(_0x189718){var _0x3223ef=_0x189718['count'],_0x3c5e64=_0x216ecc[_0xe434('0x1c')],_0x54b278=_0x216ecc[_0xe434('0x1c')]+_0x216ecc[_0xe434('0x1d')],_0x29da83;if(_0x54b278>=_0x3223ef){_0x54b278=_0x3223ef;_0x29da83=0xc8;}else{_0x29da83=0xce;}_0x373c62[_0xe434('0x1a')](_0x29da83);return _0x373c62['set']('Content-Range',_0x3c5e64+'-'+_0x54b278+'/'+_0x3223ef)[_0xe434('0x1b')](_0x189718);}return null;};}function patchUpdates(_0x249325){return function(_0x4ef1ad){try{jsonpatch['apply'](_0x4ef1ad,_0x249325,!![]);}catch(_0x5b89a3){return BPromise['reject'](_0x5b89a3);}return _0x4ef1ad['save']();};}function saveUpdates(_0x232cfe,_0x3ae32a){return function(_0x50b6b){if(_0x50b6b){return _0x50b6b['update'](_0x232cfe)['then'](function(_0x59cc79){return _0x59cc79;});}return null;};}function removeEntity(_0x5f45b0,_0x36b1a8){return function(_0x1f05c7){if(_0x1f05c7){return _0x1f05c7[_0xe434('0x1e')]()['then'](function(){var _0x207818=_0x1f05c7[_0xe434('0x1f')]({'plain':!![]});var _0x54c813=_0xe434('0x20');return db[_0xe434('0x21')][_0xe434('0x1e')]({'where':{'type':_0x54c813,'resourceId':_0x207818['id']}})['then'](function(){return _0x1f05c7;});})[_0xe434('0x22')](function(){_0x5f45b0[_0xe434('0x1a')](0xcc)[_0xe434('0x19')]();});}};}function handleEntityNotFound(_0x5dee93,_0x519c55){return function(_0x1b8c1c){if(!_0x1b8c1c){_0x5dee93[_0xe434('0x18')](0x194);}return _0x1b8c1c;};}function handleError(_0x35b781,_0x35c167){_0x35c167=_0x35c167||0x1f4;return function(_0x3f1af2){logger[_0xe434('0x23')](_0x3f1af2[_0xe434('0x24')]);if(_0x3f1af2['name']){delete _0x3f1af2['name'];}_0x35b781[_0xe434('0x1a')](_0x35c167)[_0xe434('0x25')](_0x3f1af2);};}exports[_0xe434('0x26')]=function(_0xd3b4a3,_0x2cc827){var _0x2f5603={},_0x1dc51f={},_0x32e228={'count':0x0,'rows':[]};var _0x2f1df1=db[_0xe434('0x27')][_0xe434('0x28')];_0x1dc51f[_0xe434('0x29')]=_[_0xe434('0x2a')](_0x2f1df1);_0x1dc51f[_0xe434('0x2b')]=_['keys'](_0xd3b4a3[_0xe434('0x2b')]);_0x1dc51f[_0xe434('0x2c')]=_[_0xe434('0x2d')](_0x1dc51f['model'],_0x1dc51f[_0xe434('0x2b')]);_0x2f5603['attributes']=_[_0xe434('0x2d')](_0x1dc51f[_0xe434('0x29')],qs[_0xe434('0x2e')](_0xd3b4a3[_0xe434('0x2b')]['fields']));_0x2f5603['attributes']=_0x2f5603[_0xe434('0x2f')][_0xe434('0x30')]?_0x2f5603[_0xe434('0x2f')]:_0x1dc51f[_0xe434('0x29')];if(!_0xd3b4a3[_0xe434('0x2b')]['hasOwnProperty']('nolimit')){_0x2f5603['limit']=qs['limit'](_0xd3b4a3[_0xe434('0x2b')]['limit']);_0x2f5603['offset']=qs[_0xe434('0x1c')](_0xd3b4a3[_0xe434('0x2b')][_0xe434('0x1c')]);}_0x2f5603[_0xe434('0x31')]=qs[_0xe434('0x32')](_0xd3b4a3['query'][_0xe434('0x32')]);_0x2f5603[_0xe434('0x33')]=qs[_0xe434('0x2c')](_['pick'](_0xd3b4a3[_0xe434('0x2b')],_0x1dc51f[_0xe434('0x2c')]));if(_0xd3b4a3[_0xe434('0x2b')][_0xe434('0x34')]){_0x2f5603[_0xe434('0x33')]=_[_0xe434('0x35')](_0x2f5603[_0xe434('0x33')],{'$or':_[_0xe434('0x36')](_0x2f1df1,function(_0x40f449){if(_0x40f449[_0xe434('0x37')][_0xe434('0x38')]!==_0xe434('0x39')){var _0x2316bf={};_0x2316bf[_0x40f449['field']]={'$like':'%'+_0xd3b4a3[_0xe434('0x2b')][_0xe434('0x34')]+'%'};return _0x2316bf;}})});}_0x2f5603=_['merge']({},_0x2f5603,_0xd3b4a3[_0xe434('0x3a')]);var _0x34fcf4={'where':_0x2f5603['where']};return db['Sound'][_0xe434('0x3b')](_0x34fcf4)['then'](function(_0x4c1d76){_0x32e228['count']=_0x4c1d76;if(_0xd3b4a3['query']['includeAll']){_0x2f5603[_0xe434('0x3c')]=[{'all':!![]}];}return db['Sound'][_0xe434('0x3d')](_0x2f5603);})[_0xe434('0x22')](function(_0x358422){_0x32e228[_0xe434('0x3e')]=_0x358422;return _0x32e228;})[_0xe434('0x22')](respondWithFilteredResult(_0x2cc827,_0x2f5603))[_0xe434('0x3f')](handleError(_0x2cc827,null));};exports['show']=function(_0x5a1732,_0xc4d91d){var _0x835708={'raw':!![],'where':{'id':_0x5a1732[_0xe434('0x40')]['id']}},_0xdf44ad={};_0xdf44ad[_0xe434('0x29')]=_[_0xe434('0x2a')](db[_0xe434('0x27')]['rawAttributes']);_0xdf44ad[_0xe434('0x2b')]=_[_0xe434('0x2a')](_0x5a1732['query']);_0xdf44ad[_0xe434('0x2c')]=_['intersection'](_0xdf44ad[_0xe434('0x29')],_0xdf44ad[_0xe434('0x2b')]);_0x835708[_0xe434('0x2f')]=_[_0xe434('0x2d')](_0xdf44ad[_0xe434('0x29')],qs['fields'](_0x5a1732[_0xe434('0x2b')][_0xe434('0x2e')]));_0x835708[_0xe434('0x2f')]=_0x835708[_0xe434('0x2f')][_0xe434('0x30')]?_0x835708[_0xe434('0x2f')]:_0xdf44ad[_0xe434('0x29')];if(_0x5a1732[_0xe434('0x2b')]['includeAll']){_0x835708[_0xe434('0x3c')]=[{'all':!![]}];}_0x835708=_[_0xe434('0x35')]({},_0x835708,_0x5a1732['options']);return db[_0xe434('0x27')][_0xe434('0x41')](_0x835708)[_0xe434('0x22')](handleEntityNotFound(_0xc4d91d,null))['then'](respondWithResult(_0xc4d91d,null))[_0xe434('0x3f')](handleError(_0xc4d91d,null));};exports['download']=function(_0x35353c,_0x5d980c,_0x32d5d3){return db['Sound'][_0xe434('0x41')]({'where':{'id':_0x35353c['params']['id']},'attributes':['name','save_name',_0xe434('0x42')],'raw':!![]})[_0xe434('0x22')](handleEntityNotFound(_0x5d980c,null))[_0xe434('0x22')](function(_0x27647b){if(_0x27647b){if(!fs['existsSync'](path[_0xe434('0x43')](config[_0xe434('0x44')],_0xe434('0x45'),_0x27647b[_0xe434('0x46')]+'.'+_0x27647b[_0xe434('0x42')]))){throw new db[(_0xe434('0x47'))][(_0xe434('0x48'))](_0xe434('0x49'));}return _0x5d980c['download'](path[_0xe434('0x43')](config[_0xe434('0x44')],_0xe434('0x45'),util[_0xe434('0x4a')](_0xe434('0x4b'),_0x27647b[_0xe434('0x46')],_0x27647b[_0xe434('0x42')])),util['format'](_0xe434('0x4b'),_0x27647b[_0xe434('0x4c')],_0x27647b['converted_format']));}return null;})['catch'](handleError(_0x5d980c,null));};exports[_0xe434('0x4d')]=function(_0x1e630c,_0x358a91,_0x3be428){var _0x9722cc={'name':path['basename'](_0x1e630c[_0xe434('0x4e')][_0xe434('0x4f')],path[_0xe434('0x50')](_0x1e630c['file'][_0xe434('0x4f')])),'save_name':path['basename'](_0x1e630c['file']['filename'],path[_0xe434('0x50')](_0x1e630c['file'][_0xe434('0x51')])),'original_format':path[_0xe434('0x50')](_0x1e630c[_0xe434('0x4e')][_0xe434('0x4f')])[_0xe434('0x52')](0x1),'converted_format':_0xe434('0x53')};var _0x5931ba=path[_0xe434('0x43')](config['root'],'server/files/sounds/original',_0x1e630c['file'][_0xe434('0x51')]);var _0x4cc69f=path[_0xe434('0x43')](config[_0xe434('0x44')],_0xe434('0x45'),util[_0xe434('0x4a')](_0xe434('0x4b'),path['basename'](_0x1e630c[_0xe434('0x4e')][_0xe434('0x51')],path[_0xe434('0x50')](_0x1e630c[_0xe434('0x4e')][_0xe434('0x51')])),_0x9722cc[_0xe434('0x42')]));logger[_0xe434('0x54')](_0xe434('0x55'),_0x5931ba);logger[_0xe434('0x54')](_0xe434('0x56'),_0x4cc69f);try{fs[_0xe434('0x57')](_0x5931ba,parseInt('0777',0x8));var _0x44180c=sox['transcode'](_0x5931ba,_0x4cc69f,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x44180c['on'](_0xe434('0x23'),function(_0x4f88a3){fs[_0xe434('0x58')](_0x5931ba);_0x358a91['status'](0x1f4)['send'](_0x4f88a3);});_0x44180c['on'](_0xe434('0x59'),function(_0x4c30f4){_0x9722cc[_0xe434('0x5a')]=isNaN(_0x4c30f4['duration'])?null:_0x4c30f4[_0xe434('0x5b')]*0x3e8;_0x9722cc[_0xe434('0x5c')]=isNaN(_0x4c30f4[_0xe434('0x5d')])?null:_0x4c30f4[_0xe434('0x5d')];_0x9722cc[_0xe434('0x5e')]=isNaN(_0x4c30f4['channelCount'])?null:_0x4c30f4[_0xe434('0x5f')];_0x9722cc[_0xe434('0x60')]=isNaN(_0x4c30f4[_0xe434('0x61')])?null:_0x4c30f4[_0xe434('0x61')];_0x9722cc[_0xe434('0x62')]=isNaN(_0x4c30f4[_0xe434('0x63')])?null:_0x4c30f4[_0xe434('0x63')];});_0x44180c['on'](_0xe434('0x64'),function(_0x3aa8de){_0x9722cc[_0xe434('0x65')]=isNaN(_0x3aa8de[_0xe434('0x5b')])?null:_0x3aa8de['duration']*0x3e8;_0x9722cc[_0xe434('0x66')]=isNaN(_0x3aa8de[_0xe434('0x5d')])?null:_0x3aa8de[_0xe434('0x5d')];_0x9722cc[_0xe434('0x67')]=isNaN(_0x3aa8de[_0xe434('0x5f')])?null:_0x3aa8de['channelCount'];_0x9722cc[_0xe434('0x68')]=isNaN(_0x3aa8de[_0xe434('0x61')])?null:_0x3aa8de[_0xe434('0x61')];_0x9722cc[_0xe434('0x69')]=isNaN(_0x3aa8de[_0xe434('0x63')])?null:_0x3aa8de[_0xe434('0x63')];});_0x44180c['on'](_0xe434('0x19'),function(){fs[_0xe434('0x57')](_0x4cc69f,parseInt(_0xe434('0x6a'),0x8));return db[_0xe434('0x27')][_0xe434('0x4d')](_0x9722cc)[_0xe434('0x22')](function(_0x74db40){var _0x103bbf={'role':_0x1e630c[_0xe434('0x6b')][_0xe434('0x6c')],'userProfileId':_0x1e630c[_0xe434('0x6b')][_0xe434('0x6d')]};if(!_0x103bbf)throw new Error(_0xe434('0x6e'));if(_0x103bbf[_0xe434('0x6c')]===_0xe434('0x6f')){var _0x582d8d=_0x74db40[_0xe434('0x1f')]({'plain':!![]});return db[_0xe434('0x70')][_0xe434('0x41')]({'where':{'name':_0xe434('0x20'),'userProfileId':_0x103bbf[_0xe434('0x6d')]},'raw':!![]})['then'](function(_0x355466){if(_0x355466&&_0x355466[_0xe434('0x71')]===0x0){return db[_0xe434('0x21')][_0xe434('0x4d')]({'name':_0x582d8d[_0xe434('0x4c')],'resourceId':_0x582d8d['id'],'type':_0x355466[_0xe434('0x4c')],'sectionId':_0x355466['id']},{})[_0xe434('0x22')](function(){return _0x74db40;});}else{return _0x74db40;}})[_0xe434('0x3f')](function(_0x38f20a){logger[_0xe434('0x23')](_0xe434('0x72'),_0x38f20a);throw _0x38f20a;});}return _0x74db40;})[_0xe434('0x22')](respondWithResult(_0x358a91,null))[_0xe434('0x3f')](handleError(_0x358a91,null));});_0x44180c[_0xe434('0x73')]();}catch(_0x50e1c2){_0x358a91[_0xe434('0x1a')](0x1f4)[_0xe434('0x25')](_0x50e1c2);}};exports[_0xe434('0x74')]=function(_0x25bfd5,_0x28d765,_0x569765){return db['Sound'][_0xe434('0x41')]({'where':{'id':_0x25bfd5[_0xe434('0x40')]['id']}})[_0xe434('0x22')](handleEntityNotFound(_0x28d765,null))[_0xe434('0x22')](saveUpdates(_[_0xe434('0x75')](_0x25bfd5['body'],['name','description']),null))['then'](respondWithResult(_0x28d765,null))['catch'](handleError(_0x28d765,null));};exports['delete']=function(_0xd6cd02,_0x297a8a,_0x57c2fc){return db[_0xe434('0x27')][_0xe434('0x41')]({'where':{'id':_0xd6cd02[_0xe434('0x40')]['id']}})[_0xe434('0x22')](function(_0x1a7a4f){if(_0x1a7a4f){return _0x1a7a4f['destroy']();}})[_0xe434('0x22')](function(_0x42369e){var _0x47bf41=path['join'](config[_0xe434('0x44')],'server/files/sounds/original',util[_0xe434('0x4a')](_0xe434('0x4b'),_0x42369e[_0xe434('0x46')],_0x42369e[_0xe434('0x76')]));var _0x20fcf2=path['join'](config[_0xe434('0x44')],'server/files/sounds/converted',util[_0xe434('0x4a')](_0xe434('0x4b'),_0x42369e[_0xe434('0x46')],_0x42369e[_0xe434('0x42')]));fs[_0xe434('0x58')](_0x47bf41);fs['unlinkSync'](_0x20fcf2);return _0x42369e;})[_0xe434('0x22')](function(_0x37e9ed){if(_0x37e9ed){return _0x297a8a[_0xe434('0x1a')](0xcc)[_0xe434('0x19')]();}})[_0xe434('0x22')](handleEntityNotFound(_0x297a8a,null))[_0xe434('0x3f')](handleError(_0x297a8a,null));}; \ No newline at end of file +var _0x4d50=['Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','Sound','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','map','type','options','include','rows','catch','show','params','includeAll','find','download','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','originalname','extname','file','basename','filename','substring','wav','server/files/sounds/original','info','transcode','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','bitRate','converted_sampleRate','chmodSync','0777','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x632a42,_0xb15b3d){var _0x5491b6=function(_0x4853fc){while(--_0x4853fc){_0x632a42['push'](_0x632a42['shift']());}};_0x5491b6(++_0xb15b3d);}(_0x4d50,0x1ba));var _0x04d5=function(_0x4bfb4e,_0x2cef88){_0x4bfb4e=_0x4bfb4e-0x0;var _0x4fac1b=_0x4d50[_0x4bfb4e];return _0x4fac1b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x04d5('0x0'));var rimraf=require(_0x04d5('0x1'));var zipdir=require(_0x04d5('0x2'));var jsonpatch=require(_0x04d5('0x3'));var rp=require(_0x04d5('0x4'));var moment=require(_0x04d5('0x5'));var BPromise=require(_0x04d5('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x04d5('0x7'));var sox=require(_0x04d5('0x8'));var csv=require(_0x04d5('0x9'));var ejs=require(_0x04d5('0xa'));var fs=require('fs');var _=require(_0x04d5('0xb'));var squel=require(_0x04d5('0xc'));var crypto=require(_0x04d5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x04d5('0x9'));var querystring=require(_0x04d5('0xe'));var Papa=require(_0x04d5('0xf'));var Redis=require('ioredis');var authService=require(_0x04d5('0x10'));var qs=require(_0x04d5('0x11'));var hardwareService=require(_0x04d5('0x12'));var logger=require(_0x04d5('0x13'))(_0x04d5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x04d5('0x15'))['db'];function respondWithStatusCode(_0x4ef123,_0x960e1e){_0x960e1e=_0x960e1e||0xcc;return function(_0x55ee55){if(_0x55ee55){return _0x4ef123[_0x04d5('0x16')](_0x960e1e);}return _0x4ef123[_0x04d5('0x17')](_0x960e1e)[_0x04d5('0x18')]();};}function respondWithResult(_0x1fff48,_0x3b8c51){_0x3b8c51=_0x3b8c51||0xc8;return function(_0x5e8595){if(_0x5e8595){return _0x1fff48[_0x04d5('0x17')](_0x3b8c51)[_0x04d5('0x19')](_0x5e8595);}};}function respondWithFilteredResult(_0x567c47,_0xd9ba56){return function(_0xc9a306){if(_0xc9a306){var _0x43c003=_0xc9a306[_0x04d5('0x1a')],_0x2b0ab9=_0xd9ba56[_0x04d5('0x1b')],_0x552569=_0xd9ba56[_0x04d5('0x1b')]+_0xd9ba56[_0x04d5('0x1c')],_0x56ca14;if(_0x552569>=_0x43c003){_0x552569=_0x43c003;_0x56ca14=0xc8;}else{_0x56ca14=0xce;}_0x567c47[_0x04d5('0x17')](_0x56ca14);return _0x567c47[_0x04d5('0x1d')](_0x04d5('0x1e'),_0x2b0ab9+'-'+_0x552569+'/'+_0x43c003)[_0x04d5('0x19')](_0xc9a306);}return null;};}function patchUpdates(_0x38c773){return function(_0x5b3e61){try{jsonpatch[_0x04d5('0x1f')](_0x5b3e61,_0x38c773,!![]);}catch(_0x5bdf1c){return BPromise[_0x04d5('0x20')](_0x5bdf1c);}return _0x5b3e61['save']();};}function saveUpdates(_0x3602ee,_0xdaddaf){return function(_0x348526){if(_0x348526){return _0x348526['update'](_0x3602ee)[_0x04d5('0x21')](function(_0x2917ed){return _0x2917ed;});}return null;};}function removeEntity(_0x1fe0e9,_0x2c0696){return function(_0xa2ca23){if(_0xa2ca23){return _0xa2ca23[_0x04d5('0x22')]()[_0x04d5('0x21')](function(){var _0x247f56=_0xa2ca23[_0x04d5('0x23')]({'plain':!![]});var _0x5dd338='Sounds';return db[_0x04d5('0x24')][_0x04d5('0x22')]({'where':{'type':_0x5dd338,'resourceId':_0x247f56['id']}})[_0x04d5('0x21')](function(){return _0xa2ca23;});})[_0x04d5('0x21')](function(){_0x1fe0e9[_0x04d5('0x17')](0xcc)[_0x04d5('0x18')]();});}};}function handleEntityNotFound(_0xc96179,_0x210c45){return function(_0x1fa58d){if(!_0x1fa58d){_0xc96179['sendStatus'](0x194);}return _0x1fa58d;};}function handleError(_0x29682e,_0x14922c){_0x14922c=_0x14922c||0x1f4;return function(_0x3eb42a){logger[_0x04d5('0x25')](_0x3eb42a[_0x04d5('0x26')]);if(_0x3eb42a[_0x04d5('0x27')]){delete _0x3eb42a['name'];}_0x29682e['status'](_0x14922c)[_0x04d5('0x28')](_0x3eb42a);};}exports['index']=function(_0x4a644,_0x57b52){var _0x18ea78={},_0x2e58f3={},_0x541f01={'count':0x0,'rows':[]};var _0x307d94=db[_0x04d5('0x29')][_0x04d5('0x2a')];_0x2e58f3[_0x04d5('0x2b')]=_['keys'](_0x307d94);_0x2e58f3[_0x04d5('0x2c')]=_[_0x04d5('0x2d')](_0x4a644[_0x04d5('0x2c')]);_0x2e58f3[_0x04d5('0x2e')]=_[_0x04d5('0x2f')](_0x2e58f3[_0x04d5('0x2b')],_0x2e58f3[_0x04d5('0x2c')]);_0x18ea78[_0x04d5('0x30')]=_[_0x04d5('0x2f')](_0x2e58f3[_0x04d5('0x2b')],qs[_0x04d5('0x31')](_0x4a644[_0x04d5('0x2c')][_0x04d5('0x31')]));_0x18ea78[_0x04d5('0x30')]=_0x18ea78[_0x04d5('0x30')]['length']?_0x18ea78[_0x04d5('0x30')]:_0x2e58f3[_0x04d5('0x2b')];if(!_0x4a644[_0x04d5('0x2c')][_0x04d5('0x32')]('nolimit')){_0x18ea78['limit']=qs[_0x04d5('0x1c')](_0x4a644[_0x04d5('0x2c')]['limit']);_0x18ea78[_0x04d5('0x1b')]=qs[_0x04d5('0x1b')](_0x4a644[_0x04d5('0x2c')][_0x04d5('0x1b')]);}_0x18ea78['order']=qs[_0x04d5('0x33')](_0x4a644[_0x04d5('0x2c')]['sort']);_0x18ea78[_0x04d5('0x34')]=qs[_0x04d5('0x2e')](_[_0x04d5('0x35')](_0x4a644[_0x04d5('0x2c')],_0x2e58f3[_0x04d5('0x2e')]));if(_0x4a644['query'][_0x04d5('0x36')]){_0x18ea78[_0x04d5('0x34')]=_[_0x04d5('0x37')](_0x18ea78[_0x04d5('0x34')],{'$or':_[_0x04d5('0x38')](_0x307d94,function(_0x27453b){if(_0x27453b[_0x04d5('0x39')]['key']!=='VIRTUAL'){var _0x511784={};_0x511784[_0x27453b['field']]={'$like':'%'+_0x4a644[_0x04d5('0x2c')][_0x04d5('0x36')]+'%'};return _0x511784;}})});}_0x18ea78=_[_0x04d5('0x37')]({},_0x18ea78,_0x4a644[_0x04d5('0x3a')]);var _0x4aa7d4={'where':_0x18ea78[_0x04d5('0x34')]};return db['Sound'][_0x04d5('0x1a')](_0x4aa7d4)[_0x04d5('0x21')](function(_0x32d07b){_0x541f01[_0x04d5('0x1a')]=_0x32d07b;if(_0x4a644[_0x04d5('0x2c')]['includeAll']){_0x18ea78[_0x04d5('0x3b')]=[{'all':!![]}];}return db[_0x04d5('0x29')]['findAll'](_0x18ea78);})[_0x04d5('0x21')](function(_0x47f99d){_0x541f01[_0x04d5('0x3c')]=_0x47f99d;return _0x541f01;})[_0x04d5('0x21')](respondWithFilteredResult(_0x57b52,_0x18ea78))[_0x04d5('0x3d')](handleError(_0x57b52,null));};exports[_0x04d5('0x3e')]=function(_0x365c53,_0x2d64d3){var _0x3c077f={'raw':!![],'where':{'id':_0x365c53[_0x04d5('0x3f')]['id']}},_0x519c9a={};_0x519c9a[_0x04d5('0x2b')]=_['keys'](db[_0x04d5('0x29')][_0x04d5('0x2a')]);_0x519c9a[_0x04d5('0x2c')]=_[_0x04d5('0x2d')](_0x365c53[_0x04d5('0x2c')]);_0x519c9a[_0x04d5('0x2e')]=_['intersection'](_0x519c9a['model'],_0x519c9a['query']);_0x3c077f[_0x04d5('0x30')]=_['intersection'](_0x519c9a[_0x04d5('0x2b')],qs[_0x04d5('0x31')](_0x365c53[_0x04d5('0x2c')]['fields']));_0x3c077f[_0x04d5('0x30')]=_0x3c077f[_0x04d5('0x30')]['length']?_0x3c077f[_0x04d5('0x30')]:_0x519c9a['model'];if(_0x365c53[_0x04d5('0x2c')][_0x04d5('0x40')]){_0x3c077f[_0x04d5('0x3b')]=[{'all':!![]}];}_0x3c077f=_[_0x04d5('0x37')]({},_0x3c077f,_0x365c53[_0x04d5('0x3a')]);return db['Sound'][_0x04d5('0x41')](_0x3c077f)[_0x04d5('0x21')](handleEntityNotFound(_0x2d64d3,null))[_0x04d5('0x21')](respondWithResult(_0x2d64d3,null))[_0x04d5('0x3d')](handleError(_0x2d64d3,null));};exports[_0x04d5('0x42')]=function(_0x2d7f8e,_0x2c42ac,_0x315456){return db[_0x04d5('0x29')][_0x04d5('0x41')]({'where':{'id':_0x2d7f8e[_0x04d5('0x3f')]['id']},'attributes':[_0x04d5('0x27'),'save_name',_0x04d5('0x43')],'raw':!![]})[_0x04d5('0x21')](handleEntityNotFound(_0x2c42ac,null))[_0x04d5('0x21')](function(_0x6dc0b7){if(_0x6dc0b7){if(!fs[_0x04d5('0x44')](path[_0x04d5('0x45')](config[_0x04d5('0x46')],_0x04d5('0x47'),_0x6dc0b7[_0x04d5('0x48')]+'.'+_0x6dc0b7[_0x04d5('0x43')]))){throw new db[(_0x04d5('0x49'))][(_0x04d5('0x4a'))](_0x04d5('0x4b'));}return _0x2c42ac[_0x04d5('0x42')](path[_0x04d5('0x45')](config[_0x04d5('0x46')],_0x04d5('0x47'),util['format']('%s.%s',_0x6dc0b7[_0x04d5('0x48')],_0x6dc0b7[_0x04d5('0x43')])),util[_0x04d5('0x4c')](_0x04d5('0x4d'),_0x6dc0b7['name'],_0x6dc0b7[_0x04d5('0x43')]));}return null;})[_0x04d5('0x3d')](handleError(_0x2c42ac,null));};exports[_0x04d5('0x4e')]=function(_0x52314d,_0x3e675c,_0x2688aa){var _0x348239={'name':path['basename'](_0x52314d['file'][_0x04d5('0x4f')],path[_0x04d5('0x50')](_0x52314d[_0x04d5('0x51')]['originalname'])),'save_name':path[_0x04d5('0x52')](_0x52314d[_0x04d5('0x51')][_0x04d5('0x53')],path[_0x04d5('0x50')](_0x52314d['file']['filename'])),'original_format':path['extname'](_0x52314d[_0x04d5('0x51')][_0x04d5('0x4f')])[_0x04d5('0x54')](0x1),'converted_format':_0x04d5('0x55')};var _0x5c76ac=path[_0x04d5('0x45')](config[_0x04d5('0x46')],_0x04d5('0x56'),_0x52314d[_0x04d5('0x51')]['filename']);var _0xd59c13=path[_0x04d5('0x45')](config[_0x04d5('0x46')],_0x04d5('0x47'),util[_0x04d5('0x4c')](_0x04d5('0x4d'),path[_0x04d5('0x52')](_0x52314d[_0x04d5('0x51')][_0x04d5('0x53')],path[_0x04d5('0x50')](_0x52314d[_0x04d5('0x51')]['filename'])),_0x348239[_0x04d5('0x43')]));logger[_0x04d5('0x57')]('Sound\x20upload\x20filepath:\x20%s',_0x5c76ac);logger[_0x04d5('0x57')]('Sound\x20upload\x20destination:\x20%s',_0xd59c13);try{fs['chmodSync'](_0x5c76ac,parseInt('0777',0x8));var _0x49026b=sox[_0x04d5('0x58')](_0x5c76ac,_0xd59c13,{'sampleRate':0x1f40,'format':_0x04d5('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x49026b['on'](_0x04d5('0x25'),function(_0x1a07a0){fs['unlinkSync'](_0x5c76ac);_0x3e675c[_0x04d5('0x17')](0x1f4)[_0x04d5('0x28')](_0x1a07a0);});_0x49026b['on'](_0x04d5('0x59'),function(_0x2d6cdf){_0x348239[_0x04d5('0x5a')]=isNaN(_0x2d6cdf[_0x04d5('0x5b')])?null:_0x2d6cdf[_0x04d5('0x5b')]*0x3e8;_0x348239[_0x04d5('0x5c')]=isNaN(_0x2d6cdf[_0x04d5('0x5d')])?null:_0x2d6cdf[_0x04d5('0x5d')];_0x348239[_0x04d5('0x5e')]=isNaN(_0x2d6cdf[_0x04d5('0x5f')])?null:_0x2d6cdf['channelCount'];_0x348239[_0x04d5('0x60')]=isNaN(_0x2d6cdf['bitRate'])?null:_0x2d6cdf['bitRate'];_0x348239[_0x04d5('0x61')]=isNaN(_0x2d6cdf[_0x04d5('0x62')])?null:_0x2d6cdf[_0x04d5('0x62')];});_0x49026b['on'](_0x04d5('0x63'),function(_0x4ccee4){_0x348239['converted_duration']=isNaN(_0x4ccee4[_0x04d5('0x5b')])?null:_0x4ccee4['duration']*0x3e8;_0x348239[_0x04d5('0x64')]=isNaN(_0x4ccee4[_0x04d5('0x5d')])?null:_0x4ccee4['sampleCount'];_0x348239[_0x04d5('0x65')]=isNaN(_0x4ccee4[_0x04d5('0x5f')])?null:_0x4ccee4[_0x04d5('0x5f')];_0x348239['converted_bitRate']=isNaN(_0x4ccee4[_0x04d5('0x66')])?null:_0x4ccee4[_0x04d5('0x66')];_0x348239[_0x04d5('0x67')]=isNaN(_0x4ccee4['sampleRate'])?null:_0x4ccee4[_0x04d5('0x62')];});_0x49026b['on'](_0x04d5('0x18'),function(){fs[_0x04d5('0x68')](_0xd59c13,parseInt(_0x04d5('0x69'),0x8));return db[_0x04d5('0x29')][_0x04d5('0x4e')](_0x348239)[_0x04d5('0x21')](function(_0x5c3013){var _0xaf109d={'role':_0x52314d['body'][_0x04d5('0x6a')],'userProfileId':_0x52314d[_0x04d5('0x6b')][_0x04d5('0x6c')]};if(!_0xaf109d)throw new Error(_0x04d5('0x6d'));if(_0xaf109d[_0x04d5('0x6a')]==='user'){var _0x27eaae=_0x5c3013[_0x04d5('0x23')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x04d5('0x6e'),'userProfileId':_0xaf109d[_0x04d5('0x6c')]},'raw':!![]})[_0x04d5('0x21')](function(_0x460641){if(_0x460641&&_0x460641[_0x04d5('0x6f')]===0x0){return db[_0x04d5('0x24')][_0x04d5('0x4e')]({'name':_0x27eaae[_0x04d5('0x27')],'resourceId':_0x27eaae['id'],'type':_0x460641[_0x04d5('0x27')],'sectionId':_0x460641['id']},{})[_0x04d5('0x21')](function(){return _0x5c3013;});}else{return _0x5c3013;}})[_0x04d5('0x3d')](function(_0x156d4a){logger[_0x04d5('0x25')](_0x04d5('0x70'),_0x156d4a);throw _0x156d4a;});}return _0x5c3013;})[_0x04d5('0x21')](respondWithResult(_0x3e675c,null))[_0x04d5('0x3d')](handleError(_0x3e675c,null));});_0x49026b[_0x04d5('0x71')]();}catch(_0x156c34){_0x3e675c[_0x04d5('0x17')](0x1f4)[_0x04d5('0x28')](_0x156c34);}};exports[_0x04d5('0x72')]=function(_0x5256b5,_0x10fb49,_0x9bc34e){return db[_0x04d5('0x29')]['find']({'where':{'id':_0x5256b5[_0x04d5('0x3f')]['id']}})[_0x04d5('0x21')](handleEntityNotFound(_0x10fb49,null))['then'](saveUpdates(_['pick'](_0x5256b5['body'],['name',_0x04d5('0x73')]),null))[_0x04d5('0x21')](respondWithResult(_0x10fb49,null))['catch'](handleError(_0x10fb49,null));};exports[_0x04d5('0x74')]=function(_0x22248b,_0x144b35,_0x616044){return db['Sound'][_0x04d5('0x41')]({'where':{'id':_0x22248b['params']['id']}})[_0x04d5('0x21')](function(_0x3401f3){if(_0x3401f3){return _0x3401f3['destroy']();}})['then'](function(_0x2728ac){var _0x53a62c=path[_0x04d5('0x45')](config[_0x04d5('0x46')],'server/files/sounds/original',util[_0x04d5('0x4c')]('%s.%s',_0x2728ac[_0x04d5('0x48')],_0x2728ac['original_format']));var _0xb51263=path['join'](config[_0x04d5('0x46')],_0x04d5('0x47'),util[_0x04d5('0x4c')](_0x04d5('0x4d'),_0x2728ac['save_name'],_0x2728ac[_0x04d5('0x43')]));fs[_0x04d5('0x75')](_0x53a62c);fs[_0x04d5('0x75')](_0xb51263);return _0x2728ac;})[_0x04d5('0x21')](function(_0xf5c2cd){if(_0xf5c2cd){return _0x144b35[_0x04d5('0x17')](0xcc)[_0x04d5('0x18')]();}})[_0x04d5('0x21')](handleEntityNotFound(_0x144b35,null))[_0x04d5('0x3d')](handleError(_0x144b35,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index b088d30..a234d15 100644 --- a/server/api/sound/sound.model.js +++ b/server/api/sound/sound.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x919f=['request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','tools_sounds','lodash','util','../../config/logger','moment','bluebird'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x919f,0x1a8));var _0xf919=function(_0x13d09e,_0x37497d){_0x13d09e=_0x13d09e-0x0;var _0x4397dc=_0x919f[_0x13d09e];return _0x4397dc;};'use strict';var _=require(_0xf919('0x0'));var util=require(_0xf919('0x1'));var logger=require(_0xf919('0x2'))('api');var moment=require(_0xf919('0x3'));var BPromise=require(_0xf919('0x4'));var rp=require(_0xf919('0x5'));var fs=require('fs');var path=require(_0xf919('0x6'));var rimraf=require(_0xf919('0x7'));var config=require(_0xf919('0x8'));var attributes=require(_0xf919('0x9'));module[_0xf919('0xa')]=function(_0x10ea7c,_0x392581){return _0x10ea7c[_0xf919('0xb')]('Sound',attributes,{'tableName':_0xf919('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb67d=['exports','Sound','tools_sounds','lodash','api','moment','bluebird','request-promise','path','rimraf','./sound.attributes'];(function(_0x4fa0e8,_0x26b636){var _0x19cadd=function(_0x4cda62){while(--_0x4cda62){_0x4fa0e8['push'](_0x4fa0e8['shift']());}};_0x19cadd(++_0x26b636);}(_0xb67d,0xdf));var _0xdb67=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb67d[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xdb67('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdb67('0x1'));var moment=require(_0xdb67('0x2'));var BPromise=require(_0xdb67('0x3'));var rp=require(_0xdb67('0x4'));var fs=require('fs');var path=require(_0xdb67('0x5'));var rimraf=require(_0xdb67('0x6'));var config=require('../../config/environment');var attributes=require(_0xdb67('0x7'));module[_0xdb67('0x8')]=function(_0x61bd23,_0x2a6672){return _0x61bd23['define'](_0xdb67('0x9'),attributes,{'tableName':_0xdb67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 71fa137..3a48f9e 100644 --- a/server/api/sound/sound.rpc.js +++ b/server/api/sound/sound.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4fa=['request','then','Sound,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','ShowSound','find','options','raw','attributes','include','map','model','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x4a1748,_0x56c7c2){var _0x132d0d=function(_0x2907f5){while(--_0x2907f5){_0x4a1748['push'](_0x4a1748['shift']());}};_0x132d0d(++_0x56c7c2);}(_0xc4fa,0x15e));var _0xac4f=function(_0x59e444,_0x2ff6cd){_0x59e444=_0x59e444-0x0;var _0x4924fb=_0xc4fa[_0x59e444];return _0x4924fb;};'use strict';var _=require(_0xac4f('0x0'));var util=require(_0xac4f('0x1'));var moment=require(_0xac4f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac4f('0x3'));var db=require(_0xac4f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xac4f('0x5'))('rpc');var config=require(_0xac4f('0x6'));var jayson=require(_0xac4f('0x7'));var client=jayson[_0xac4f('0x8')][_0xac4f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57f63a,_0x4c4a16,_0xc39451){return new BPromise(function(_0x41cbd4,_0x3bf8f5){return client[_0xac4f('0xa')](_0x57f63a,_0xc39451)[_0xac4f('0xb')](function(_0x22b1b8){logger['info'](_0xac4f('0xc'),_0x4c4a16,'request\x20sent');logger[_0xac4f('0xd')]('Sound,\x20%s,\x20%s,\x20%s',_0x4c4a16,_0xac4f('0xe'),JSON[_0xac4f('0xf')](_0x22b1b8));if(_0x22b1b8[_0xac4f('0x10')]){if(_0x22b1b8[_0xac4f('0x10')][_0xac4f('0x11')]===0x1f4){logger[_0xac4f('0x10')](_0xac4f('0xc'),_0x4c4a16,_0x22b1b8['error'][_0xac4f('0x12')]);return _0x3bf8f5(_0x22b1b8[_0xac4f('0x10')]['message']);}logger[_0xac4f('0x10')](_0xac4f('0xc'),_0x4c4a16,_0x22b1b8['error'][_0xac4f('0x12')]);return _0x41cbd4(_0x22b1b8[_0xac4f('0x10')][_0xac4f('0x12')]);}else{logger[_0xac4f('0x13')](_0xac4f('0xc'),_0x4c4a16,_0xac4f('0xe'));_0x41cbd4(_0x22b1b8[_0xac4f('0x14')][_0xac4f('0x12')]);}})[_0xac4f('0x15')](function(_0x4256eb){logger['error'](_0xac4f('0xc'),_0x4c4a16,_0x4256eb);_0x3bf8f5(_0x4256eb);});});}exports[_0xac4f('0x16')]=function(_0xd14012){var _0x480009=this;return new Promise(function(_0x52571e,_0x2894cd){return db['Sound'][_0xac4f('0x17')]({'raw':_0xd14012[_0xac4f('0x18')]?_0xd14012[_0xac4f('0x18')][_0xac4f('0x19')]===undefined?!![]:![]:!![],'where':_0xd14012[_0xac4f('0x18')]?_0xd14012[_0xac4f('0x18')]['where']||null:null,'attributes':_0xd14012[_0xac4f('0x18')]?_0xd14012[_0xac4f('0x18')][_0xac4f('0x1a')]||null:null,'include':_0xd14012[_0xac4f('0x18')]?_0xd14012[_0xac4f('0x18')][_0xac4f('0x1b')]?_[_0xac4f('0x1c')](_0xd14012[_0xac4f('0x18')][_0xac4f('0x1b')],function(_0x2edc71){return{'model':db[_0x2edc71[_0xac4f('0x1d')]],'as':_0x2edc71['as'],'attributes':_0x2edc71[_0xac4f('0x1a')],'include':_0x2edc71['include']?_[_0xac4f('0x1c')](_0x2edc71[_0xac4f('0x1b')],function(_0x1d54d0){return{'model':db[_0x1d54d0['model']],'as':_0x1d54d0['as'],'attributes':_0x1d54d0[_0xac4f('0x1a')],'include':_0x1d54d0[_0xac4f('0x1b')]?_[_0xac4f('0x1c')](_0x1d54d0['include'],function(_0x1eb740){return{'model':db[_0x1eb740[_0xac4f('0x1d')]],'as':_0x1eb740['as'],'attributes':_0x1eb740[_0xac4f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xac4f('0xb')](function(_0x2c8b96){logger[_0xac4f('0x13')](_0xac4f('0x16'),_0xd14012);logger[_0xac4f('0xd')]('ShowSound',_0xd14012,JSON[_0xac4f('0xf')](_0x2c8b96));_0x52571e(_0x2c8b96);})[_0xac4f('0x15')](function(_0x4ab08c){logger['error'](_0xac4f('0x16'),_0x4ab08c[_0xac4f('0x12')],_0xd14012);_0x2894cd(_0x480009[_0xac4f('0x10')](0x1f4,_0x4ab08c[_0xac4f('0x12')]));});});}; \ No newline at end of file +var _0x4082=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSound','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4082,0x123));var _0x2408=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x4082[_0x292f93];return _0x5a94b1;};'use strict';var _=require(_0x2408('0x0'));var util=require(_0x2408('0x1'));var moment=require(_0x2408('0x2'));var BPromise=require(_0x2408('0x3'));var rs=require(_0x2408('0x4'));var fs=require('fs');var Redis=require(_0x2408('0x5'));var db=require(_0x2408('0x6'))['db'];var utils=require(_0x2408('0x7'));var logger=require(_0x2408('0x8'))(_0x2408('0x9'));var config=require('../../config/environment');var jayson=require(_0x2408('0xa'));var client=jayson['client'][_0x2408('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d7e9c,_0x116359,_0x1d2e6f){return new BPromise(function(_0x27737a,_0x2218e1){return client[_0x2408('0xc')](_0x3d7e9c,_0x1d2e6f)[_0x2408('0xd')](function(_0x127c63){logger[_0x2408('0xe')](_0x2408('0xf'),_0x116359,_0x2408('0x10'));logger[_0x2408('0x11')](_0x2408('0x12'),_0x116359,_0x2408('0x10'),JSON[_0x2408('0x13')](_0x127c63));if(_0x127c63[_0x2408('0x14')]){if(_0x127c63[_0x2408('0x14')][_0x2408('0x15')]===0x1f4){logger[_0x2408('0x14')](_0x2408('0xf'),_0x116359,_0x127c63['error'][_0x2408('0x16')]);return _0x2218e1(_0x127c63['error']['message']);}logger[_0x2408('0x14')](_0x2408('0xf'),_0x116359,_0x127c63['error'][_0x2408('0x16')]);return _0x27737a(_0x127c63[_0x2408('0x14')][_0x2408('0x16')]);}else{logger['info'](_0x2408('0xf'),_0x116359,_0x2408('0x10'));_0x27737a(_0x127c63['result'][_0x2408('0x16')]);}})[_0x2408('0x17')](function(_0x46de91){logger[_0x2408('0x14')]('Sound,\x20%s,\x20%s',_0x116359,_0x46de91);_0x2218e1(_0x46de91);});});}exports[_0x2408('0x18')]=function(_0x4acdb1){var _0xaf1bfc=this;return new Promise(function(_0x4db364,_0x39e744){return db['Sound'][_0x2408('0x19')]({'raw':_0x4acdb1[_0x2408('0x1a')]?_0x4acdb1[_0x2408('0x1a')][_0x2408('0x1b')]===undefined?!![]:![]:!![],'where':_0x4acdb1[_0x2408('0x1a')]?_0x4acdb1[_0x2408('0x1a')][_0x2408('0x1c')]||null:null,'attributes':_0x4acdb1[_0x2408('0x1a')]?_0x4acdb1[_0x2408('0x1a')][_0x2408('0x1d')]||null:null,'include':_0x4acdb1[_0x2408('0x1a')]?_0x4acdb1[_0x2408('0x1a')][_0x2408('0x1e')]?_[_0x2408('0x1f')](_0x4acdb1[_0x2408('0x1a')]['include'],function(_0x3a7885){return{'model':db[_0x3a7885['model']],'as':_0x3a7885['as'],'attributes':_0x3a7885[_0x2408('0x1d')],'include':_0x3a7885['include']?_[_0x2408('0x1f')](_0x3a7885[_0x2408('0x1e')],function(_0x204dec){return{'model':db[_0x204dec['model']],'as':_0x204dec['as'],'attributes':_0x204dec[_0x2408('0x1d')],'include':_0x204dec[_0x2408('0x1e')]?_[_0x2408('0x1f')](_0x204dec[_0x2408('0x1e')],function(_0xf5b62b){return{'model':db[_0xf5b62b[_0x2408('0x20')]],'as':_0xf5b62b['as'],'attributes':_0xf5b62b[_0x2408('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2408('0xd')](function(_0x53f92f){logger[_0x2408('0xe')]('ShowSound',_0x4acdb1);logger['debug']('ShowSound',_0x4acdb1,JSON[_0x2408('0x13')](_0x53f92f));_0x4db364(_0x53f92f);})[_0x2408('0x17')](function(_0x25bcf3){logger['error']('ShowSound',_0x25bcf3[_0x2408('0x16')],_0x4acdb1);_0x39e744(_0xaf1bfc[_0x2408('0x14')](0x1f4,_0x25bcf3['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 79c9c44..0936020 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd75=['update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','/:id','isAuthenticated','show','create','put'];(function(_0x1d0776,_0x2ee7ac){var _0x14947f=function(_0x306387){while(--_0x306387){_0x1d0776['push'](_0x1d0776['shift']());}};_0x14947f(++_0x2ee7ac);}(_0xfd75,0x16b));var _0x5fd7=function(_0x18efb0,_0x402155){_0x18efb0=_0x18efb0-0x0;var _0x463641=_0xfd75[_0x18efb0];return _0x463641;};'use strict';var multer=require(_0x5fd7('0x0'));var util=require(_0x5fd7('0x1'));var path=require('path');var timeout=require(_0x5fd7('0x2'));var express=require('express');var router=express[_0x5fd7('0x3')]();var auth=require(_0x5fd7('0x4'));var interaction=require(_0x5fd7('0x5'));var config=require(_0x5fd7('0x6'));var controller=require(_0x5fd7('0x7'));router[_0x5fd7('0x8')]('/',auth['isAuthenticated'](),controller[_0x5fd7('0x9')]);router['get'](_0x5fd7('0xa'),auth[_0x5fd7('0xb')](),controller[_0x5fd7('0xc')]);router['post']('/',auth[_0x5fd7('0xb')](),controller[_0x5fd7('0xd')]);router[_0x5fd7('0xe')](_0x5fd7('0xa'),auth[_0x5fd7('0xb')](),controller[_0x5fd7('0xf')]);router[_0x5fd7('0x10')](_0x5fd7('0xa'),auth['isAuthenticated'](),controller[_0x5fd7('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf73c=['index','post','create','/:id','update','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./squareMessage.controller','isAuthenticated'];(function(_0x28012d,_0x2be955){var _0x49d0b4=function(_0x52c403){while(--_0x52c403){_0x28012d['push'](_0x28012d['shift']());}};_0x49d0b4(++_0x2be955);}(_0xf73c,0x9e));var _0xcf73=function(_0x598a4e,_0x21dc9c){_0x598a4e=_0x598a4e-0x0;var _0x115594=_0xf73c[_0x598a4e];return _0x115594;};'use strict';var multer=require(_0xcf73('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcf73('0x1'));var router=express[_0xcf73('0x2')]();var auth=require(_0xcf73('0x3'));var interaction=require(_0xcf73('0x4'));var config=require('../../config/environment');var controller=require(_0xcf73('0x5'));router['get']('/',auth[_0xcf73('0x6')](),controller[_0xcf73('0x7')]);router['get']('/:id',auth[_0xcf73('0x6')](),controller['show']);router[_0xcf73('0x8')]('/',auth[_0xcf73('0x6')](),controller[_0xcf73('0x9')]);router['put'](_0xcf73('0xa'),auth[_0xcf73('0x6')](),controller[_0xcf73('0xb')]);router[_0xcf73('0xc')](_0xcf73('0xa'),auth[_0xcf73('0x6')](),controller[_0xcf73('0xd')]);module[_0xcf73('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index c7cf1be..5311800 100644 --- a/server/api/squareMessage/squareMessage.attributes.js +++ b/server/api/squareMessage/squareMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7c2=['TEXT','ENUM','out','sequelize','exports','STRING'];(function(_0x53b50e,_0xc49361){var _0x3f8625=function(_0x4ce88b){while(--_0x4ce88b){_0x53b50e['push'](_0x53b50e['shift']());}};_0x3f8625(++_0xc49361);}(_0xe7c2,0x6f));var _0x2e7c=function(_0x541818,_0xc9ade5){_0x541818=_0x541818-0x0;var _0x433288=_0xe7c2[_0x541818];return _0x433288;};'use strict';var Sequelize=require(_0x2e7c('0x0'));module[_0x2e7c('0x1')]={'uniqueid':{'type':Sequelize[_0x2e7c('0x2')]},'body':{'type':Sequelize[_0x2e7c('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x2e7c('0x4')]('in',_0x2e7c('0x5')),'defaultValue':_0x2e7c('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x6d96=['ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x259318,_0x35f43d){var _0x14a57a=function(_0x5d208f){while(--_0x5d208f){_0x259318['push'](_0x259318['shift']());}};_0x14a57a(++_0x35f43d);}(_0x6d96,0x158));var _0x66d9=function(_0x2d74a7,_0x27443c){_0x2d74a7=_0x2d74a7-0x0;var _0x2577e1=_0x6d96[_0x2d74a7];return _0x2577e1;};'use strict';var Sequelize=require(_0x66d9('0x0'));module[_0x66d9('0x1')]={'uniqueid':{'type':Sequelize[_0x66d9('0x2')]},'body':{'type':Sequelize[_0x66d9('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x66d9('0x4')]('in',_0x66d9('0x5')),'defaultValue':_0x66d9('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index e8e1b63..7885b1b 100644 --- a/server/api/squareMessage/squareMessage.controller.js +++ b/server/api/squareMessage/squareMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fe7=['catch','params','find','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','update','then','destroy','stack','name','send','index','SquareMessage','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows'];(function(_0x3ef045,_0x32e6ea){var _0x14d661=function(_0x548d7d){while(--_0x548d7d){_0x3ef045['push'](_0x3ef045['shift']());}};_0x14d661(++_0x32e6ea);}(_0x3fe7,0x168));var _0x73fe=function(_0x3168e1,_0xa046e0){_0x3168e1=_0x3168e1-0x0;var _0x13ad69=_0x3fe7[_0x3168e1];return _0x13ad69;};'use strict';var pdf=require(_0x73fe('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x73fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x73fe('0x2'));var rp=require(_0x73fe('0x3'));var moment=require(_0x73fe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x73fe('0x5'));var util=require(_0x73fe('0x6'));var path=require(_0x73fe('0x7'));var sox=require(_0x73fe('0x8'));var csv=require(_0x73fe('0x9'));var ejs=require(_0x73fe('0xa'));var fs=require('fs');var _=require(_0x73fe('0xb'));var squel=require('squel');var crypto=require(_0x73fe('0xc'));var jsforce=require(_0x73fe('0xd'));var deskjs=require(_0x73fe('0xe'));var toCsv=require(_0x73fe('0x9'));var querystring=require(_0x73fe('0xf'));var Papa=require(_0x73fe('0x10'));var Redis=require(_0x73fe('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x73fe('0x12'));var hardwareService=require(_0x73fe('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x73fe('0x14'));var config=require(_0x73fe('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13dfe,_0x7fc182){_0x7fc182=_0x7fc182||0xcc;return function(_0x2dcee3){if(_0x2dcee3){return _0x13dfe[_0x73fe('0x16')](_0x7fc182);}return _0x13dfe[_0x73fe('0x17')](_0x7fc182)[_0x73fe('0x18')]();};}function respondWithResult(_0x58e6e6,_0x278915){_0x278915=_0x278915||0xc8;return function(_0x21a2c6){if(_0x21a2c6){return _0x58e6e6[_0x73fe('0x17')](_0x278915)['json'](_0x21a2c6);}};}function respondWithFilteredResult(_0x3215f7,_0x3e71a3){return function(_0x4df1de){if(_0x4df1de){var _0x225504=_0x4df1de[_0x73fe('0x19')],_0x55a75d=_0x3e71a3[_0x73fe('0x1a')],_0x199392=_0x3e71a3[_0x73fe('0x1a')]+_0x3e71a3[_0x73fe('0x1b')],_0x447792;if(_0x199392>=_0x225504){_0x199392=_0x225504;_0x447792=0xc8;}else{_0x447792=0xce;}_0x3215f7[_0x73fe('0x17')](_0x447792);return _0x3215f7[_0x73fe('0x1c')](_0x73fe('0x1d'),_0x55a75d+'-'+_0x199392+'/'+_0x225504)[_0x73fe('0x1e')](_0x4df1de);}return null;};}function patchUpdates(_0x5a9881){return function(_0xd69464){try{jsonpatch['apply'](_0xd69464,_0x5a9881,!![]);}catch(_0x318c3a){return BPromise['reject'](_0x318c3a);}return _0xd69464[_0x73fe('0x1f')]();};}function saveUpdates(_0x17f17d,_0x1f9184){return function(_0x53f3be){if(_0x53f3be){return _0x53f3be[_0x73fe('0x20')](_0x17f17d)[_0x73fe('0x21')](function(_0x3ad951){return _0x3ad951;});}return null;};}function removeEntity(_0x48171a,_0x54885d){return function(_0x48b338){if(_0x48b338){return _0x48b338[_0x73fe('0x22')]()['then'](function(){_0x48171a[_0x73fe('0x17')](0xcc)[_0x73fe('0x18')]();});}};}function handleEntityNotFound(_0x5924f1,_0x55e331){return function(_0xd5e324){if(!_0xd5e324){_0x5924f1[_0x73fe('0x16')](0x194);}return _0xd5e324;};}function handleError(_0xb535d3,_0x5bba7c){_0x5bba7c=_0x5bba7c||0x1f4;return function(_0x47b54e){logger['error'](_0x47b54e[_0x73fe('0x23')]);if(_0x47b54e[_0x73fe('0x24')]){delete _0x47b54e[_0x73fe('0x24')];}_0xb535d3[_0x73fe('0x17')](_0x5bba7c)[_0x73fe('0x25')](_0x47b54e);};}exports[_0x73fe('0x26')]=function(_0x598668,_0x2a8543){var _0x432327={},_0x592d81={},_0x1c61e1={'count':0x0,'rows':[]};var _0x23803e=db[_0x73fe('0x27')]['rawAttributes'];_0x592d81[_0x73fe('0x28')]=_['keys'](_0x23803e);_0x592d81[_0x73fe('0x29')]=_[_0x73fe('0x2a')](_0x598668[_0x73fe('0x29')]);_0x592d81[_0x73fe('0x2b')]=_[_0x73fe('0x2c')](_0x592d81[_0x73fe('0x28')],_0x592d81[_0x73fe('0x29')]);_0x432327['attributes']=_[_0x73fe('0x2c')](_0x592d81[_0x73fe('0x28')],qs['fields'](_0x598668[_0x73fe('0x29')][_0x73fe('0x2d')]));_0x432327['attributes']=_0x432327[_0x73fe('0x2e')][_0x73fe('0x2f')]?_0x432327[_0x73fe('0x2e')]:_0x592d81[_0x73fe('0x28')];if(!_0x598668[_0x73fe('0x29')][_0x73fe('0x30')](_0x73fe('0x31'))){_0x432327['limit']=qs[_0x73fe('0x1b')](_0x598668['query'][_0x73fe('0x1b')]);_0x432327[_0x73fe('0x1a')]=qs[_0x73fe('0x1a')](_0x598668[_0x73fe('0x29')][_0x73fe('0x1a')]);}_0x432327[_0x73fe('0x32')]=qs[_0x73fe('0x33')](_0x598668[_0x73fe('0x29')][_0x73fe('0x33')]);_0x432327[_0x73fe('0x34')]=qs[_0x73fe('0x2b')](_[_0x73fe('0x35')](_0x598668['query'],_0x592d81[_0x73fe('0x2b')]));if(_0x598668[_0x73fe('0x29')][_0x73fe('0x36')]){_0x432327['where']=_[_0x73fe('0x37')](_0x432327[_0x73fe('0x34')],{'$or':_[_0x73fe('0x38')](_0x23803e,function(_0x3e3803){if(_0x3e3803[_0x73fe('0x39')][_0x73fe('0x3a')]!==_0x73fe('0x3b')){var _0x19299e={};_0x19299e[_0x3e3803[_0x73fe('0x3c')]]={'$like':'%'+_0x598668[_0x73fe('0x29')][_0x73fe('0x36')]+'%'};return _0x19299e;}})});}_0x432327=_[_0x73fe('0x37')]({},_0x432327,_0x598668[_0x73fe('0x3d')]);var _0x5c64ba={'where':_0x432327['where']};return db['SquareMessage']['count'](_0x5c64ba)['then'](function(_0x56bad1){_0x1c61e1['count']=_0x56bad1;if(_0x598668[_0x73fe('0x29')][_0x73fe('0x3e')]){_0x432327[_0x73fe('0x3f')]=[{'all':!![]}];}return db[_0x73fe('0x27')][_0x73fe('0x40')](_0x432327);})['then'](function(_0x5bd9ef){_0x1c61e1[_0x73fe('0x41')]=_0x5bd9ef;return _0x1c61e1;})[_0x73fe('0x21')](respondWithFilteredResult(_0x2a8543,_0x432327))[_0x73fe('0x42')](handleError(_0x2a8543,null));};exports['show']=function(_0x378f85,_0x1adcec){var _0x10a8b1={'raw':!![],'where':{'id':_0x378f85[_0x73fe('0x43')]['id']}},_0x18d2b0={};_0x18d2b0['model']=_[_0x73fe('0x2a')](db[_0x73fe('0x27')]['rawAttributes']);_0x18d2b0[_0x73fe('0x29')]=_[_0x73fe('0x2a')](_0x378f85[_0x73fe('0x29')]);_0x18d2b0[_0x73fe('0x2b')]=_[_0x73fe('0x2c')](_0x18d2b0[_0x73fe('0x28')],_0x18d2b0['query']);_0x10a8b1[_0x73fe('0x2e')]=_[_0x73fe('0x2c')](_0x18d2b0[_0x73fe('0x28')],qs['fields'](_0x378f85[_0x73fe('0x29')]['fields']));_0x10a8b1[_0x73fe('0x2e')]=_0x10a8b1[_0x73fe('0x2e')][_0x73fe('0x2f')]?_0x10a8b1[_0x73fe('0x2e')]:_0x18d2b0['model'];if(_0x378f85[_0x73fe('0x29')][_0x73fe('0x3e')]){_0x10a8b1[_0x73fe('0x3f')]=[{'all':!![]}];}_0x10a8b1=_['merge']({},_0x10a8b1,_0x378f85['options']);return db[_0x73fe('0x27')][_0x73fe('0x44')](_0x10a8b1)['then'](handleEntityNotFound(_0x1adcec,null))[_0x73fe('0x21')](respondWithResult(_0x1adcec,null))[_0x73fe('0x42')](handleError(_0x1adcec,null));};exports[_0x73fe('0x45')]=function(_0x147e80,_0x6ad213){return db[_0x73fe('0x27')][_0x73fe('0x45')](_0x147e80[_0x73fe('0x46')],{})['then'](respondWithResult(_0x6ad213,0xc9))[_0x73fe('0x42')](handleError(_0x6ad213,null));};exports[_0x73fe('0x20')]=function(_0xa2f9c7,_0x354f66){if(_0xa2f9c7['body']['id']){delete _0xa2f9c7['body']['id'];}return db[_0x73fe('0x27')]['find']({'where':{'id':_0xa2f9c7['params']['id']}})['then'](handleEntityNotFound(_0x354f66,null))[_0x73fe('0x21')](saveUpdates(_0xa2f9c7[_0x73fe('0x46')],null))[_0x73fe('0x21')](respondWithResult(_0x354f66,null))[_0x73fe('0x42')](handleError(_0x354f66,null));};exports[_0x73fe('0x22')]=function(_0x362cd5,_0x3c0b78){return db['SquareMessage']['find']({'where':{'id':_0x362cd5[_0x73fe('0x43')]['id']}})[_0x73fe('0x21')](handleEntityNotFound(_0x3c0b78,null))[_0x73fe('0x21')](removeEntity(_0x3c0b78,null))[_0x73fe('0x42')](handleError(_0x3c0b78,null));}; \ No newline at end of file +var _0xf9b6=['where','pick','filter','map','type','key','options','findAll','rows','catch','show','params','include','merge','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','json','count','offset','limit','set','Content-Range','save','update','then','destroy','end','stack','name','send','index','SquareMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xf9b6,0xce));var _0x6f9b=function(_0x4201de,_0x43ac07){_0x4201de=_0x4201de-0x0;var _0x3fef97=_0xf9b6[_0x4201de];return _0x3fef97;};'use strict';var pdf=require(_0x6f9b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6f9b('0x1'));var zipdir=require(_0x6f9b('0x2'));var jsonpatch=require(_0x6f9b('0x3'));var rp=require('request-promise');var moment=require(_0x6f9b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6f9b('0x5'));var util=require(_0x6f9b('0x6'));var path=require(_0x6f9b('0x7'));var sox=require('sox');var csv=require(_0x6f9b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6f9b('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f9b('0x8'));var querystring=require(_0x6f9b('0xa'));var Papa=require(_0x6f9b('0xb'));var Redis=require('ioredis');var authService=require(_0x6f9b('0xc'));var qs=require(_0x6f9b('0xd'));var hardwareService=require(_0x6f9b('0xe'));var logger=require(_0x6f9b('0xf'))('api');var utils=require(_0x6f9b('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2dbed3,_0x2255dc){_0x2255dc=_0x2255dc||0xcc;return function(_0x3e95f6){if(_0x3e95f6){return _0x2dbed3[_0x6f9b('0x11')](_0x2255dc);}return _0x2dbed3['status'](_0x2255dc)['end']();};}function respondWithResult(_0x54a00e,_0x5039bc){_0x5039bc=_0x5039bc||0xc8;return function(_0x5ce90c){if(_0x5ce90c){return _0x54a00e[_0x6f9b('0x12')](_0x5039bc)[_0x6f9b('0x13')](_0x5ce90c);}};}function respondWithFilteredResult(_0x20f72b,_0x2aa255){return function(_0x15e8f6){if(_0x15e8f6){var _0x5cf7c4=_0x15e8f6[_0x6f9b('0x14')],_0x5e2822=_0x2aa255[_0x6f9b('0x15')],_0x2365d3=_0x2aa255['offset']+_0x2aa255[_0x6f9b('0x16')],_0x5790e4;if(_0x2365d3>=_0x5cf7c4){_0x2365d3=_0x5cf7c4;_0x5790e4=0xc8;}else{_0x5790e4=0xce;}_0x20f72b['status'](_0x5790e4);return _0x20f72b[_0x6f9b('0x17')](_0x6f9b('0x18'),_0x5e2822+'-'+_0x2365d3+'/'+_0x5cf7c4)[_0x6f9b('0x13')](_0x15e8f6);}return null;};}function patchUpdates(_0x1ff482){return function(_0xe3b019){try{jsonpatch['apply'](_0xe3b019,_0x1ff482,!![]);}catch(_0x50612b){return BPromise['reject'](_0x50612b);}return _0xe3b019[_0x6f9b('0x19')]();};}function saveUpdates(_0x5a6251,_0x31a0fd){return function(_0x326a7f){if(_0x326a7f){return _0x326a7f[_0x6f9b('0x1a')](_0x5a6251)[_0x6f9b('0x1b')](function(_0x4c275f){return _0x4c275f;});}return null;};}function removeEntity(_0x1967d7,_0x4b1daa){return function(_0x1e4768){if(_0x1e4768){return _0x1e4768[_0x6f9b('0x1c')]()['then'](function(){_0x1967d7[_0x6f9b('0x12')](0xcc)[_0x6f9b('0x1d')]();});}};}function handleEntityNotFound(_0x3db81a,_0x4a00d7){return function(_0x2230cc){if(!_0x2230cc){_0x3db81a[_0x6f9b('0x11')](0x194);}return _0x2230cc;};}function handleError(_0x8cdc20,_0x2e6548){_0x2e6548=_0x2e6548||0x1f4;return function(_0x529fcc){logger['error'](_0x529fcc[_0x6f9b('0x1e')]);if(_0x529fcc[_0x6f9b('0x1f')]){delete _0x529fcc[_0x6f9b('0x1f')];}_0x8cdc20[_0x6f9b('0x12')](_0x2e6548)[_0x6f9b('0x20')](_0x529fcc);};}exports[_0x6f9b('0x21')]=function(_0x46852f,_0x2f0c5d){var _0x326aa7={},_0x2ecf71={},_0x162fe1={'count':0x0,'rows':[]};var _0x4d352a=db[_0x6f9b('0x22')][_0x6f9b('0x23')];_0x2ecf71[_0x6f9b('0x24')]=_['keys'](_0x4d352a);_0x2ecf71['query']=_[_0x6f9b('0x25')](_0x46852f[_0x6f9b('0x26')]);_0x2ecf71[_0x6f9b('0x27')]=_[_0x6f9b('0x28')](_0x2ecf71[_0x6f9b('0x24')],_0x2ecf71['query']);_0x326aa7[_0x6f9b('0x29')]=_[_0x6f9b('0x28')](_0x2ecf71['model'],qs[_0x6f9b('0x2a')](_0x46852f[_0x6f9b('0x26')]['fields']));_0x326aa7[_0x6f9b('0x29')]=_0x326aa7['attributes'][_0x6f9b('0x2b')]?_0x326aa7[_0x6f9b('0x29')]:_0x2ecf71[_0x6f9b('0x24')];if(!_0x46852f[_0x6f9b('0x26')]['hasOwnProperty']('nolimit')){_0x326aa7['limit']=qs[_0x6f9b('0x16')](_0x46852f[_0x6f9b('0x26')][_0x6f9b('0x16')]);_0x326aa7[_0x6f9b('0x15')]=qs[_0x6f9b('0x15')](_0x46852f[_0x6f9b('0x26')][_0x6f9b('0x15')]);}_0x326aa7[_0x6f9b('0x2c')]=qs[_0x6f9b('0x2d')](_0x46852f[_0x6f9b('0x26')][_0x6f9b('0x2d')]);_0x326aa7[_0x6f9b('0x2e')]=qs['filters'](_[_0x6f9b('0x2f')](_0x46852f['query'],_0x2ecf71[_0x6f9b('0x27')]));if(_0x46852f[_0x6f9b('0x26')][_0x6f9b('0x30')]){_0x326aa7[_0x6f9b('0x2e')]=_['merge'](_0x326aa7[_0x6f9b('0x2e')],{'$or':_[_0x6f9b('0x31')](_0x4d352a,function(_0x31e148){if(_0x31e148[_0x6f9b('0x32')][_0x6f9b('0x33')]!=='VIRTUAL'){var _0x37fc75={};_0x37fc75[_0x31e148['field']]={'$like':'%'+_0x46852f[_0x6f9b('0x26')]['filter']+'%'};return _0x37fc75;}})});}_0x326aa7=_['merge']({},_0x326aa7,_0x46852f[_0x6f9b('0x34')]);var _0x40cf58={'where':_0x326aa7['where']};return db[_0x6f9b('0x22')][_0x6f9b('0x14')](_0x40cf58)['then'](function(_0xa1c89e){_0x162fe1[_0x6f9b('0x14')]=_0xa1c89e;if(_0x46852f[_0x6f9b('0x26')]['includeAll']){_0x326aa7['include']=[{'all':!![]}];}return db[_0x6f9b('0x22')][_0x6f9b('0x35')](_0x326aa7);})[_0x6f9b('0x1b')](function(_0x300f43){_0x162fe1[_0x6f9b('0x36')]=_0x300f43;return _0x162fe1;})[_0x6f9b('0x1b')](respondWithFilteredResult(_0x2f0c5d,_0x326aa7))[_0x6f9b('0x37')](handleError(_0x2f0c5d,null));};exports[_0x6f9b('0x38')]=function(_0x5a9da6,_0x587385){var _0x73ea59={'raw':!![],'where':{'id':_0x5a9da6[_0x6f9b('0x39')]['id']}},_0x35a6fa={};_0x35a6fa[_0x6f9b('0x24')]=_['keys'](db[_0x6f9b('0x22')][_0x6f9b('0x23')]);_0x35a6fa['query']=_[_0x6f9b('0x25')](_0x5a9da6[_0x6f9b('0x26')]);_0x35a6fa[_0x6f9b('0x27')]=_['intersection'](_0x35a6fa['model'],_0x35a6fa[_0x6f9b('0x26')]);_0x73ea59[_0x6f9b('0x29')]=_['intersection'](_0x35a6fa[_0x6f9b('0x24')],qs['fields'](_0x5a9da6['query'][_0x6f9b('0x2a')]));_0x73ea59['attributes']=_0x73ea59[_0x6f9b('0x29')][_0x6f9b('0x2b')]?_0x73ea59[_0x6f9b('0x29')]:_0x35a6fa[_0x6f9b('0x24')];if(_0x5a9da6[_0x6f9b('0x26')]['includeAll']){_0x73ea59[_0x6f9b('0x3a')]=[{'all':!![]}];}_0x73ea59=_[_0x6f9b('0x3b')]({},_0x73ea59,_0x5a9da6['options']);return db[_0x6f9b('0x22')][_0x6f9b('0x3c')](_0x73ea59)[_0x6f9b('0x1b')](handleEntityNotFound(_0x587385,null))['then'](respondWithResult(_0x587385,null))[_0x6f9b('0x37')](handleError(_0x587385,null));};exports[_0x6f9b('0x3d')]=function(_0x1f43f3,_0x65d0fc){return db[_0x6f9b('0x22')][_0x6f9b('0x3d')](_0x1f43f3[_0x6f9b('0x3e')],{})[_0x6f9b('0x1b')](respondWithResult(_0x65d0fc,0xc9))['catch'](handleError(_0x65d0fc,null));};exports[_0x6f9b('0x1a')]=function(_0x2c1673,_0x3b689b){if(_0x2c1673[_0x6f9b('0x3e')]['id']){delete _0x2c1673[_0x6f9b('0x3e')]['id'];}return db[_0x6f9b('0x22')][_0x6f9b('0x3c')]({'where':{'id':_0x2c1673[_0x6f9b('0x39')]['id']}})[_0x6f9b('0x1b')](handleEntityNotFound(_0x3b689b,null))[_0x6f9b('0x1b')](saveUpdates(_0x2c1673[_0x6f9b('0x3e')],null))[_0x6f9b('0x1b')](respondWithResult(_0x3b689b,null))[_0x6f9b('0x37')](handleError(_0x3b689b,null));};exports[_0x6f9b('0x1c')]=function(_0x56c19f,_0x478ff8){return db['SquareMessage'][_0x6f9b('0x3c')]({'where':{'id':_0x56c19f[_0x6f9b('0x39')]['id']}})['then'](handleEntityNotFound(_0x478ff8,null))[_0x6f9b('0x1b')](removeEntity(_0x478ff8,null))[_0x6f9b('0x37')](handleError(_0x478ff8,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 90ca34a..5197847 100644 --- a/server/api/squareMessage/squareMessage.model.js +++ b/server/api/squareMessage/squareMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0447=['rimraf','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','api','bluebird','request-promise','path'];(function(_0x5a8132,_0xd3a40){var _0x3af702=function(_0x46e149){while(--_0x46e149){_0x5a8132['push'](_0x5a8132['shift']());}};_0x3af702(++_0xd3a40);}(_0x0447,0x156));var _0x7044=function(_0x4689d0,_0x5a28c5){_0x4689d0=_0x4689d0-0x0;var _0xb61270=_0x0447[_0x4689d0];return _0xb61270;};'use strict';var _=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var logger=require('../../config/logger')(_0x7044('0x2'));var moment=require('moment');var BPromise=require(_0x7044('0x3'));var rp=require(_0x7044('0x4'));var fs=require('fs');var path=require(_0x7044('0x5'));var rimraf=require(_0x7044('0x6'));var config=require('../../config/environment');var attributes=require(_0x7044('0x7'));module[_0x7044('0x8')]=function(_0x2ed4db,_0x15bdc9){return _0x2ed4db[_0x7044('0x9')](_0x7044('0xa'),attributes,{'tableName':_0x7044('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7eea=['../../config/environment','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x547a9c,_0x47efe5){var _0x171964=function(_0x2dadd0){while(--_0x2dadd0){_0x547a9c['push'](_0x547a9c['shift']());}};_0x171964(++_0x47efe5);}(_0x7eea,0xd4));var _0xa7ee=function(_0x4923b4,_0x582237){_0x4923b4=_0x4923b4-0x0;var _0x2a16b2=_0x7eea[_0x4923b4];return _0x2a16b2;};'use strict';var _=require(_0xa7ee('0x0'));var util=require(_0xa7ee('0x1'));var logger=require(_0xa7ee('0x2'))(_0xa7ee('0x3'));var moment=require(_0xa7ee('0x4'));var BPromise=require(_0xa7ee('0x5'));var rp=require(_0xa7ee('0x6'));var fs=require('fs');var path=require(_0xa7ee('0x7'));var rimraf=require(_0xa7ee('0x8'));var config=require(_0xa7ee('0x9'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x196f98,_0xc3c39d){return _0x196f98[_0xa7ee('0xa')](_0xa7ee('0xb'),attributes,{'tableName':_0xa7ee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index d715a75..948053f 100644 --- a/server/api/squareMessage/squareMessage.rpc.js +++ b/server/api/squareMessage/squareMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc61d=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','CreateSquareMessage','body','options','raw','then','stringify','catch','lodash'];(function(_0x32ca62,_0x18fe6a){var _0x175d88=function(_0x3bc7ec){while(--_0x3bc7ec){_0x32ca62['push'](_0x32ca62['shift']());}};_0x175d88(++_0x18fe6a);}(_0xc61d,0xfb));var _0xdc61=function(_0x3f2a89,_0x447ce8){_0x3f2a89=_0x3f2a89-0x0;var _0x80658b=_0xc61d[_0x3f2a89];return _0x80658b;};'use strict';var _=require(_0xdc61('0x0'));var util=require(_0xdc61('0x1'));var moment=require(_0xdc61('0x2'));var BPromise=require(_0xdc61('0x3'));var rs=require(_0xdc61('0x4'));var fs=require('fs');var Redis=require(_0xdc61('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc61('0x6'));var logger=require(_0xdc61('0x7'))('rpc');var config=require(_0xdc61('0x8'));var jayson=require(_0xdc61('0x9'));var client=jayson[_0xdc61('0xa')][_0xdc61('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3518fc,_0x84103c,_0x14899f){return new BPromise(function(_0x20bf1e,_0x26eb01){return client[_0xdc61('0xc')](_0x3518fc,_0x14899f)['then'](function(_0x3d38bc){logger[_0xdc61('0xd')](_0xdc61('0xe'),_0x84103c,_0xdc61('0xf'));logger[_0xdc61('0x10')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x84103c,_0xdc61('0xf'),JSON['stringify'](_0x3d38bc));if(_0x3d38bc[_0xdc61('0x11')]){if(_0x3d38bc['error'][_0xdc61('0x12')]===0x1f4){logger[_0xdc61('0x11')](_0xdc61('0xe'),_0x84103c,_0x3d38bc[_0xdc61('0x11')][_0xdc61('0x13')]);return _0x26eb01(_0x3d38bc['error'][_0xdc61('0x13')]);}logger[_0xdc61('0x11')]('SquareMessage,\x20%s,\x20%s',_0x84103c,_0x3d38bc[_0xdc61('0x11')][_0xdc61('0x13')]);return _0x20bf1e(_0x3d38bc[_0xdc61('0x11')][_0xdc61('0x13')]);}else{logger[_0xdc61('0xd')](_0xdc61('0xe'),_0x84103c,_0xdc61('0xf'));_0x20bf1e(_0x3d38bc[_0xdc61('0x14')][_0xdc61('0x13')]);}})['catch'](function(_0x356baf){logger[_0xdc61('0x11')](_0xdc61('0xe'),_0x84103c,_0x356baf);_0x26eb01(_0x356baf);});});}exports[_0xdc61('0x15')]=function(_0x45b7b7){var _0x393205=this;return new Promise(function(_0x2393a4,_0x5dbe97){return db['SquareMessage']['create'](_0x45b7b7[_0xdc61('0x16')],{'raw':_0x45b7b7['options']?_0x45b7b7[_0xdc61('0x17')][_0xdc61('0x18')]===undefined?!![]:![]:!![]})[_0xdc61('0x19')](function(_0x117d13){logger[_0xdc61('0xd')]('CreateSquareMessage',_0x45b7b7);logger[_0xdc61('0x10')](_0xdc61('0x15'),_0x45b7b7,JSON[_0xdc61('0x1a')](_0x117d13));_0x2393a4(_0x117d13);})[_0xdc61('0x1b')](function(_0x32514d){logger['error'](_0xdc61('0x15'),_0x32514d['message'],_0x45b7b7);_0x5dbe97(_0x393205['error'](0x1f4,_0x32514d['message']));});});}; \ No newline at end of file +var _0x9541=['error','result','message','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s'];(function(_0x52892b,_0x171228){var _0x10c9b6=function(_0x2c676c){while(--_0x2c676c){_0x52892b['push'](_0x52892b['shift']());}};_0x10c9b6(++_0x171228);}(_0x9541,0xb3));var _0x1954=function(_0x266247,_0x147af0){_0x266247=_0x266247-0x0;var _0x3c0b46=_0x9541[_0x266247];return _0x3c0b46;};'use strict';var _=require(_0x1954('0x0'));var util=require(_0x1954('0x1'));var moment=require(_0x1954('0x2'));var BPromise=require(_0x1954('0x3'));var rs=require(_0x1954('0x4'));var fs=require('fs');var Redis=require(_0x1954('0x5'));var db=require(_0x1954('0x6'))['db'];var utils=require(_0x1954('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1954('0x8'));var jayson=require(_0x1954('0x9'));var client=jayson['client'][_0x1954('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21ceca,_0x30beea,_0x2ccff8){return new BPromise(function(_0xda7a2f,_0xa7a784){return client['request'](_0x21ceca,_0x2ccff8)[_0x1954('0xb')](function(_0x2f2c4b){logger[_0x1954('0xc')](_0x1954('0xd'),_0x30beea,_0x1954('0xe'));logger[_0x1954('0xf')](_0x1954('0x10'),_0x30beea,_0x1954('0xe'),JSON['stringify'](_0x2f2c4b));if(_0x2f2c4b[_0x1954('0x11')]){if(_0x2f2c4b[_0x1954('0x11')]['code']===0x1f4){logger[_0x1954('0x11')]('SquareMessage,\x20%s,\x20%s',_0x30beea,_0x2f2c4b[_0x1954('0x11')]['message']);return _0xa7a784(_0x2f2c4b['error']['message']);}logger[_0x1954('0x11')](_0x1954('0xd'),_0x30beea,_0x2f2c4b[_0x1954('0x11')]['message']);return _0xda7a2f(_0x2f2c4b[_0x1954('0x11')]['message']);}else{logger['info'](_0x1954('0xd'),_0x30beea,_0x1954('0xe'));_0xda7a2f(_0x2f2c4b[_0x1954('0x12')][_0x1954('0x13')]);}})[_0x1954('0x14')](function(_0x37f4fc){logger[_0x1954('0x11')](_0x1954('0xd'),_0x30beea,_0x37f4fc);_0xa7a784(_0x37f4fc);});});}exports[_0x1954('0x15')]=function(_0xb9c2cd){var _0xc8cb0b=this;return new Promise(function(_0x3da757,_0x16b8b1){return db[_0x1954('0x16')][_0x1954('0x17')](_0xb9c2cd[_0x1954('0x18')],{'raw':_0xb9c2cd[_0x1954('0x19')]?_0xb9c2cd[_0x1954('0x19')][_0x1954('0x1a')]===undefined?!![]:![]:!![]})[_0x1954('0xb')](function(_0x5e20b8){logger[_0x1954('0xc')](_0x1954('0x15'),_0xb9c2cd);logger[_0x1954('0xf')](_0x1954('0x15'),_0xb9c2cd,JSON[_0x1954('0x1b')](_0x5e20b8));_0x3da757(_0x5e20b8);})['catch'](function(_0x61107d){logger[_0x1954('0x11')](_0x1954('0x15'),_0x61107d[_0x1954('0x13')],_0xb9c2cd);_0x16b8b1(_0xc8cb0b[_0x1954('0x11')](0x1f4,_0x61107d['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 1f8ecaf..4e3e542 100644 --- a/server/api/squareOdbc/index.js +++ b/server/api/squareOdbc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc788=['15s','test','post','create','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id','/:id/test'];(function(_0x139221,_0x32a2ba){var _0x2b8f50=function(_0x386448){while(--_0x386448){_0x139221['push'](_0x139221['shift']());}};_0x2b8f50(++_0x32a2ba);}(_0xc788,0xc4));var _0x8c78=function(_0x26abc4,_0x52fbef){_0x26abc4=_0x26abc4-0x0;var _0xbfcce3=_0xc788[_0x26abc4];return _0xbfcce3;};'use strict';var multer=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var path=require(_0x8c78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c78('0x3')]();var auth=require(_0x8c78('0x4'));var interaction=require(_0x8c78('0x5'));var config=require(_0x8c78('0x6'));var controller=require(_0x8c78('0x7'));router['get']('/',auth[_0x8c78('0x8')](),controller[_0x8c78('0x9')]);router[_0x8c78('0xa')](_0x8c78('0xb'),auth[_0x8c78('0x8')](),controller['show']);router[_0x8c78('0xa')](_0x8c78('0xc'),auth[_0x8c78('0x8')](),timeout(_0x8c78('0xd')),controller[_0x8c78('0xe')]);router[_0x8c78('0xf')]('/',auth['isAuthenticated'](),controller[_0x8c78('0x10')]);router['put'](_0x8c78('0xb'),auth[_0x8c78('0x8')](),controller['update']);router[_0x8c78('0x11')](_0x8c78('0xb'),auth['isAuthenticated'](),controller[_0x8c78('0x12')]);module['exports']=router; \ No newline at end of file +var _0xdab5=['multer','util','express','../../components/auth/service','../../config/environment','get','index','/:id','/:id/test','isAuthenticated','15s','test','post','create','update','delete','exports'];(function(_0x53abc6,_0x45fd80){var _0x54022b=function(_0x5582ed){while(--_0x5582ed){_0x53abc6['push'](_0x53abc6['shift']());}};_0x54022b(++_0x45fd80);}(_0xdab5,0x165));var _0x5dab=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xdab5[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require(_0x5dab('0x0'));var util=require(_0x5dab('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dab('0x2'));var router=express['Router']();var auth=require(_0x5dab('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5dab('0x4'));var controller=require('./squareOdbc.controller');router[_0x5dab('0x5')]('/',auth['isAuthenticated'](),controller[_0x5dab('0x6')]);router[_0x5dab('0x5')](_0x5dab('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x5dab('0x5')](_0x5dab('0x8'),auth[_0x5dab('0x9')](),timeout(_0x5dab('0xa')),controller[_0x5dab('0xb')]);router[_0x5dab('0xc')]('/',auth['isAuthenticated'](),controller[_0x5dab('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5dab('0xe')]);router[_0x5dab('0xf')](_0x5dab('0x7'),auth[_0x5dab('0x9')](),controller['destroy']);module[_0x5dab('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 32900df..c5d283a 100644 --- a/server/api/squareOdbc/squareOdbc.attributes.js +++ b/server/api/squareOdbc/squareOdbc.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99a0=['STRING','sequelize','exports'];(function(_0x3fd13b,_0x3c951e){var _0xa5eb72=function(_0x3848b9){while(--_0x3848b9){_0x3fd13b['push'](_0x3fd13b['shift']());}};_0xa5eb72(++_0x3c951e);}(_0x99a0,0xfa));var _0x099a=function(_0x2f5f85,_0x182a02){_0x2f5f85=_0x2f5f85-0x0;var _0x234368=_0x99a0[_0x2f5f85];return _0x234368;};'use strict';var Sequelize=require(_0x099a('0x0'));module[_0x099a('0x1')]={'name':{'type':Sequelize[_0x099a('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x099a('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6e88=['exports','STRING','name','sequelize'];(function(_0xfd26aa,_0xd0c9f1){var _0x4e795e=function(_0x3d4f49){while(--_0x3d4f49){_0xfd26aa['push'](_0xfd26aa['shift']());}};_0x4e795e(++_0xd0c9f1);}(_0x6e88,0x173));var _0x86e8=function(_0x4c9a40,_0x4fb98b){_0x4c9a40=_0x4c9a40-0x0;var _0xb7009a=_0x6e88[_0x4c9a40];return _0xb7009a;};'use strict';var Sequelize=require(_0x86e8('0x0'));module[_0x86e8('0x1')]={'name':{'type':Sequelize[_0x86e8('0x2')],'unique':_0x86e8('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x86e8('0x2')]},'description':{'type':Sequelize[_0x86e8('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index fd19fdc..b0f5efe 100644 --- a/server/api/squareOdbc/squareOdbc.controller.js +++ b/server/api/squareOdbc/squareOdbc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e6b=['UserProfileResource','stack','name','send','index','SquareOdbc','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','closeSync','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','ODBC'];(function(_0x1dc20e,_0x1a09b4){var _0x18ac02=function(_0x83963){while(--_0x83963){_0x1dc20e['push'](_0x1dc20e['shift']());}};_0x18ac02(++_0x1a09b4);}(_0x0e6b,0x17d));var _0xb0e6=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x0e6b[_0x9df060];return _0x338dfe;};'use strict';var pdf=require(_0xb0e6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb0e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb0e6('0x2'));var rp=require(_0xb0e6('0x3'));var moment=require(_0xb0e6('0x4'));var BPromise=require(_0xb0e6('0x5'));var Mustache=require(_0xb0e6('0x6'));var util=require(_0xb0e6('0x7'));var path=require('path');var sox=require(_0xb0e6('0x8'));var csv=require(_0xb0e6('0x9'));var ejs=require(_0xb0e6('0xa'));var fs=require('fs');var _=require(_0xb0e6('0xb'));var squel=require('squel');var crypto=require(_0xb0e6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb0e6('0xd'));var toCsv=require(_0xb0e6('0x9'));var querystring=require(_0xb0e6('0xe'));var Papa=require(_0xb0e6('0xf'));var Redis=require(_0xb0e6('0x10'));var authService=require(_0xb0e6('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb0e6('0x12'));var logger=require('../../config/logger')(_0xb0e6('0x13'));var utils=require(_0xb0e6('0x14'));var config=require(_0xb0e6('0x15'));var db=require(_0xb0e6('0x16'))['db'];function respondWithStatusCode(_0x1ae73b,_0x13748c){_0x13748c=_0x13748c||0xcc;return function(_0x48f67b){if(_0x48f67b){return _0x1ae73b[_0xb0e6('0x17')](_0x13748c);}return _0x1ae73b['status'](_0x13748c)[_0xb0e6('0x18')]();};}function respondWithResult(_0x2bf322,_0x4e5577){_0x4e5577=_0x4e5577||0xc8;return function(_0x17b3f8){if(_0x17b3f8){return _0x2bf322[_0xb0e6('0x19')](_0x4e5577)[_0xb0e6('0x1a')](_0x17b3f8);}};}function respondWithFilteredResult(_0x174071,_0x2e52f6){return function(_0x2ae378){if(_0x2ae378){var _0x1c155c=_0x2ae378[_0xb0e6('0x1b')],_0x40bc7b=_0x2e52f6[_0xb0e6('0x1c')],_0x5b0d68=_0x2e52f6[_0xb0e6('0x1c')]+_0x2e52f6[_0xb0e6('0x1d')],_0x1aa54e;if(_0x5b0d68>=_0x1c155c){_0x5b0d68=_0x1c155c;_0x1aa54e=0xc8;}else{_0x1aa54e=0xce;}_0x174071[_0xb0e6('0x19')](_0x1aa54e);return _0x174071['set'](_0xb0e6('0x1e'),_0x40bc7b+'-'+_0x5b0d68+'/'+_0x1c155c)[_0xb0e6('0x1a')](_0x2ae378);}return null;};}function patchUpdates(_0x179c92){return function(_0x5d486a){try{jsonpatch[_0xb0e6('0x1f')](_0x5d486a,_0x179c92,!![]);}catch(_0x38851f){return BPromise[_0xb0e6('0x20')](_0x38851f);}return _0x5d486a[_0xb0e6('0x21')]();};}function saveUpdates(_0x253cf5,_0x1e21cf){return function(_0x2ec80d){if(_0x2ec80d){return _0x2ec80d[_0xb0e6('0x22')](_0x253cf5)[_0xb0e6('0x23')](function(_0x5f500d){return _0x5f500d;});}return null;};}function removeEntity(_0x28944f,_0x38e70f){return function(_0x391954){if(_0x391954){return _0x391954[_0xb0e6('0x24')]()['then'](function(){var _0x17dc15=_0x391954[_0xb0e6('0x25')]({'plain':!![]});var _0x2f515d=_0xb0e6('0x26');return db[_0xb0e6('0x27')][_0xb0e6('0x24')]({'where':{'type':_0x2f515d,'resourceId':_0x17dc15['id']}})[_0xb0e6('0x23')](function(){return _0x391954;});})[_0xb0e6('0x23')](function(){_0x28944f['status'](0xcc)[_0xb0e6('0x18')]();});}};}function handleEntityNotFound(_0x5d1f05,_0x376bd6){return function(_0x5e7119){if(!_0x5e7119){_0x5d1f05[_0xb0e6('0x17')](0x194);}return _0x5e7119;};}function handleError(_0x3b7809,_0x5ae9ad){_0x5ae9ad=_0x5ae9ad||0x1f4;return function(_0x449803){logger['error'](_0x449803[_0xb0e6('0x28')]);if(_0x449803[_0xb0e6('0x29')]){delete _0x449803[_0xb0e6('0x29')];}_0x3b7809[_0xb0e6('0x19')](_0x5ae9ad)[_0xb0e6('0x2a')](_0x449803);};}exports[_0xb0e6('0x2b')]=function(_0x4555ef,_0x33b945){var _0x20277f={},_0x304329={},_0xfde378={'count':0x0,'rows':[]};var _0xb09a37=db[_0xb0e6('0x2c')][_0xb0e6('0x2d')];_0x304329[_0xb0e6('0x2e')]=_[_0xb0e6('0x2f')](_0xb09a37);_0x304329[_0xb0e6('0x30')]=_['keys'](_0x4555ef[_0xb0e6('0x30')]);_0x304329[_0xb0e6('0x31')]=_['intersection'](_0x304329[_0xb0e6('0x2e')],_0x304329['query']);_0x20277f['attributes']=_[_0xb0e6('0x32')](_0x304329[_0xb0e6('0x2e')],qs[_0xb0e6('0x33')](_0x4555ef[_0xb0e6('0x30')]['fields']));_0x20277f['attributes']=_0x20277f[_0xb0e6('0x34')][_0xb0e6('0x35')]?_0x20277f[_0xb0e6('0x34')]:_0x304329[_0xb0e6('0x2e')];if(!_0x4555ef['query'][_0xb0e6('0x36')](_0xb0e6('0x37'))){_0x20277f[_0xb0e6('0x1d')]=qs[_0xb0e6('0x1d')](_0x4555ef[_0xb0e6('0x30')][_0xb0e6('0x1d')]);_0x20277f[_0xb0e6('0x1c')]=qs[_0xb0e6('0x1c')](_0x4555ef[_0xb0e6('0x30')][_0xb0e6('0x1c')]);}_0x20277f['order']=qs[_0xb0e6('0x38')](_0x4555ef[_0xb0e6('0x30')][_0xb0e6('0x38')]);_0x20277f[_0xb0e6('0x39')]=qs['filters'](_[_0xb0e6('0x3a')](_0x4555ef[_0xb0e6('0x30')],_0x304329[_0xb0e6('0x31')]));if(_0x4555ef[_0xb0e6('0x30')]['filter']){_0x20277f['where']=_['merge'](_0x20277f[_0xb0e6('0x39')],{'$or':_[_0xb0e6('0x3b')](_0xb09a37,function(_0x3bf24b){if(_0x3bf24b['type']['key']!==_0xb0e6('0x3c')){var _0x38fa0d={};_0x38fa0d[_0x3bf24b[_0xb0e6('0x3d')]]={'$like':'%'+_0x4555ef[_0xb0e6('0x30')][_0xb0e6('0x3e')]+'%'};return _0x38fa0d;}})});}_0x20277f=_[_0xb0e6('0x3f')]({},_0x20277f,_0x4555ef[_0xb0e6('0x40')]);var _0x5f1bd8={'where':_0x20277f[_0xb0e6('0x39')]};return db['SquareOdbc'][_0xb0e6('0x1b')](_0x5f1bd8)[_0xb0e6('0x23')](function(_0x53aa79){_0xfde378[_0xb0e6('0x1b')]=_0x53aa79;if(_0x4555ef['query'][_0xb0e6('0x41')]){_0x20277f[_0xb0e6('0x42')]=[{'all':!![]}];}return db[_0xb0e6('0x2c')][_0xb0e6('0x43')](_0x20277f);})[_0xb0e6('0x23')](function(_0x3e5e9d){_0xfde378['rows']=_0x3e5e9d;return _0xfde378;})[_0xb0e6('0x23')](respondWithFilteredResult(_0x33b945,_0x20277f))['catch'](handleError(_0x33b945,null));};exports[_0xb0e6('0x44')]=function(_0x3f46be,_0x71ea03){var _0x360f18={'raw':!![],'where':{'id':_0x3f46be[_0xb0e6('0x45')]['id']}},_0x5bfca1={};_0x5bfca1[_0xb0e6('0x2e')]=_[_0xb0e6('0x2f')](db['SquareOdbc'][_0xb0e6('0x2d')]);_0x5bfca1[_0xb0e6('0x30')]=_[_0xb0e6('0x2f')](_0x3f46be[_0xb0e6('0x30')]);_0x5bfca1[_0xb0e6('0x31')]=_[_0xb0e6('0x32')](_0x5bfca1[_0xb0e6('0x2e')],_0x5bfca1[_0xb0e6('0x30')]);_0x360f18[_0xb0e6('0x34')]=_[_0xb0e6('0x32')](_0x5bfca1[_0xb0e6('0x2e')],qs['fields'](_0x3f46be[_0xb0e6('0x30')][_0xb0e6('0x33')]));_0x360f18['attributes']=_0x360f18[_0xb0e6('0x34')][_0xb0e6('0x35')]?_0x360f18['attributes']:_0x5bfca1[_0xb0e6('0x2e')];if(_0x3f46be[_0xb0e6('0x30')][_0xb0e6('0x41')]){_0x360f18[_0xb0e6('0x42')]=[{'all':!![]}];}_0x360f18=_[_0xb0e6('0x3f')]({},_0x360f18,_0x3f46be[_0xb0e6('0x40')]);return db[_0xb0e6('0x2c')][_0xb0e6('0x46')](_0x360f18)[_0xb0e6('0x23')](handleEntityNotFound(_0x71ea03,null))[_0xb0e6('0x23')](respondWithResult(_0x71ea03,null))[_0xb0e6('0x47')](handleError(_0x71ea03,null));};exports['create']=function(_0x3a4995,_0x34f0ed){return db[_0xb0e6('0x2c')][_0xb0e6('0x48')](_0x3a4995['body'],{})[_0xb0e6('0x23')](function(_0x2f379c){var _0x3207f1=_0x3a4995[_0xb0e6('0x49')]['get']({'plain':!![]});if(!_0x3207f1)throw new Error(_0xb0e6('0x4a'));if(_0x3207f1[_0xb0e6('0x4b')]==='user'){var _0x2e3664=_0x2f379c[_0xb0e6('0x25')]({'plain':!![]});var _0x551665=_0xb0e6('0x26');return db[_0xb0e6('0x4c')][_0xb0e6('0x46')]({'where':{'name':_0x551665,'userProfileId':_0x3207f1[_0xb0e6('0x4d')]},'raw':!![]})['then'](function(_0x2a9bc7){if(_0x2a9bc7&&_0x2a9bc7[_0xb0e6('0x4e')]===0x0){return db[_0xb0e6('0x27')][_0xb0e6('0x48')]({'name':_0x2e3664[_0xb0e6('0x29')],'resourceId':_0x2e3664['id'],'type':_0x2a9bc7[_0xb0e6('0x29')],'sectionId':_0x2a9bc7['id']},{})[_0xb0e6('0x23')](function(){return _0x2f379c;});}else{return _0x2f379c;}})['catch'](function(_0x4e5abf){logger[_0xb0e6('0x4f')](_0xb0e6('0x50'),_0x4e5abf);throw _0x4e5abf;});}return _0x2f379c;})[_0xb0e6('0x23')](respondWithResult(_0x34f0ed,0xc9))[_0xb0e6('0x47')](handleError(_0x34f0ed,null));};exports[_0xb0e6('0x22')]=function(_0x3b7a8a,_0x30564b){if(_0x3b7a8a[_0xb0e6('0x51')]['id']){delete _0x3b7a8a[_0xb0e6('0x51')]['id'];}return db[_0xb0e6('0x2c')]['find']({'where':{'id':_0x3b7a8a[_0xb0e6('0x45')]['id']}})[_0xb0e6('0x23')](handleEntityNotFound(_0x30564b,null))['then'](saveUpdates(_0x3b7a8a[_0xb0e6('0x51')],null))[_0xb0e6('0x23')](respondWithResult(_0x30564b,null))['catch'](handleError(_0x30564b,null));};exports[_0xb0e6('0x24')]=function(_0xa08643,_0x4a7977){return db['SquareOdbc'][_0xb0e6('0x46')]({'where':{'id':_0xa08643['params']['id']}})[_0xb0e6('0x23')](handleEntityNotFound(_0x4a7977,null))[_0xb0e6('0x23')](removeEntity(_0x4a7977,null))[_0xb0e6('0x47')](handleError(_0x4a7977,null));};exports[_0xb0e6('0x52')]=function(_0x16258,_0x4fe69a,_0x399919){var _0x222538;return db[_0xb0e6('0x2c')][_0xb0e6('0x46')]({'where':{'id':_0x16258[_0xb0e6('0x45')]['id']},'attributes':['id','dsn']})[_0xb0e6('0x23')](handleEntityNotFound(_0x4fe69a,null))[_0xb0e6('0x23')](function(_0x4adc2b){if(_0x4adc2b){var _0x54f3eb=require('odbc')();_0x54f3eb['openSync'](_0x4adc2b['dsn']);_0x54f3eb[_0xb0e6('0x53')]();return _0x4adc2b;}})[_0xb0e6('0x23')](respondWithResult(_0x4fe69a,null))['catch'](handleError(_0x4fe69a,null));}; \ No newline at end of file +var _0x9ab9=['userProfileId','autoAssociation','UserProfileResource','update','dsn','odbc','openSync','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','get','ODBC','error','stack','name','send','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','map','type','VIRTUAL','field','filter','options','SquareOdbc','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0xd9ab80,_0x1f1968){var _0x559fc7=function(_0x46504f){while(--_0x46504f){_0xd9ab80['push'](_0xd9ab80['shift']());}};_0x559fc7(++_0x1f1968);}(_0x9ab9,0x19d));var _0x99ab=function(_0x459278,_0x376620){_0x459278=_0x459278-0x0;var _0x355ba2=_0x9ab9[_0x459278];return _0x355ba2;};'use strict';var pdf=require(_0x99ab('0x0'));var emlformat=require(_0x99ab('0x1'));var rimraf=require(_0x99ab('0x2'));var zipdir=require(_0x99ab('0x3'));var jsonpatch=require(_0x99ab('0x4'));var rp=require('request-promise');var moment=require(_0x99ab('0x5'));var BPromise=require(_0x99ab('0x6'));var Mustache=require('mustache');var util=require(_0x99ab('0x7'));var path=require('path');var sox=require(_0x99ab('0x8'));var csv=require(_0x99ab('0x9'));var ejs=require(_0x99ab('0xa'));var fs=require('fs');var _=require(_0x99ab('0xb'));var squel=require(_0x99ab('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99ab('0xd'));var toCsv=require(_0x99ab('0x9'));var querystring=require('querystring');var Papa=require(_0x99ab('0xe'));var Redis=require(_0x99ab('0xf'));var authService=require(_0x99ab('0x10'));var qs=require(_0x99ab('0x11'));var hardwareService=require(_0x99ab('0x12'));var logger=require(_0x99ab('0x13'))('api');var utils=require(_0x99ab('0x14'));var config=require(_0x99ab('0x15'));var db=require(_0x99ab('0x16'))['db'];function respondWithStatusCode(_0x5bd277,_0x4e7b4a){_0x4e7b4a=_0x4e7b4a||0xcc;return function(_0xed2100){if(_0xed2100){return _0x5bd277[_0x99ab('0x17')](_0x4e7b4a);}return _0x5bd277[_0x99ab('0x18')](_0x4e7b4a)[_0x99ab('0x19')]();};}function respondWithResult(_0x25f225,_0x536af1){_0x536af1=_0x536af1||0xc8;return function(_0x584744){if(_0x584744){return _0x25f225[_0x99ab('0x18')](_0x536af1)[_0x99ab('0x1a')](_0x584744);}};}function respondWithFilteredResult(_0x5e51ab,_0x381959){return function(_0x36d89e){if(_0x36d89e){var _0xa60b53=_0x36d89e[_0x99ab('0x1b')],_0x4b11f1=_0x381959[_0x99ab('0x1c')],_0x4299ae=_0x381959[_0x99ab('0x1c')]+_0x381959[_0x99ab('0x1d')],_0x13b9aa;if(_0x4299ae>=_0xa60b53){_0x4299ae=_0xa60b53;_0x13b9aa=0xc8;}else{_0x13b9aa=0xce;}_0x5e51ab[_0x99ab('0x18')](_0x13b9aa);return _0x5e51ab[_0x99ab('0x1e')]('Content-Range',_0x4b11f1+'-'+_0x4299ae+'/'+_0xa60b53)[_0x99ab('0x1a')](_0x36d89e);}return null;};}function patchUpdates(_0x368b52){return function(_0x4193c0){try{jsonpatch[_0x99ab('0x1f')](_0x4193c0,_0x368b52,!![]);}catch(_0x34e694){return BPromise[_0x99ab('0x20')](_0x34e694);}return _0x4193c0[_0x99ab('0x21')]();};}function saveUpdates(_0x2dde57,_0x2d67c3){return function(_0x51ded6){if(_0x51ded6){return _0x51ded6['update'](_0x2dde57)[_0x99ab('0x22')](function(_0x26d94a){return _0x26d94a;});}return null;};}function removeEntity(_0x194f39,_0x4e7647){return function(_0x2e0464){if(_0x2e0464){return _0x2e0464[_0x99ab('0x23')]()[_0x99ab('0x22')](function(){var _0x2604ee=_0x2e0464[_0x99ab('0x24')]({'plain':!![]});var _0x15fea0=_0x99ab('0x25');return db['UserProfileResource'][_0x99ab('0x23')]({'where':{'type':_0x15fea0,'resourceId':_0x2604ee['id']}})['then'](function(){return _0x2e0464;});})[_0x99ab('0x22')](function(){_0x194f39['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3281,_0x17df1e){return function(_0x2188db){if(!_0x2188db){_0x2d3281['sendStatus'](0x194);}return _0x2188db;};}function handleError(_0x1a44eb,_0x40b5b2){_0x40b5b2=_0x40b5b2||0x1f4;return function(_0x447ef0){logger[_0x99ab('0x26')](_0x447ef0[_0x99ab('0x27')]);if(_0x447ef0[_0x99ab('0x28')]){delete _0x447ef0[_0x99ab('0x28')];}_0x1a44eb[_0x99ab('0x18')](_0x40b5b2)[_0x99ab('0x29')](_0x447ef0);};}exports['index']=function(_0x37182e,_0x3178c2){var _0x50ffdc={},_0x35d09e={},_0x2c7333={'count':0x0,'rows':[]};var _0x12c3e9=db['SquareOdbc']['rawAttributes'];_0x35d09e[_0x99ab('0x2a')]=_[_0x99ab('0x2b')](_0x12c3e9);_0x35d09e[_0x99ab('0x2c')]=_[_0x99ab('0x2b')](_0x37182e[_0x99ab('0x2c')]);_0x35d09e[_0x99ab('0x2d')]=_[_0x99ab('0x2e')](_0x35d09e[_0x99ab('0x2a')],_0x35d09e['query']);_0x50ffdc[_0x99ab('0x2f')]=_[_0x99ab('0x2e')](_0x35d09e['model'],qs[_0x99ab('0x30')](_0x37182e[_0x99ab('0x2c')]['fields']));_0x50ffdc['attributes']=_0x50ffdc[_0x99ab('0x2f')][_0x99ab('0x31')]?_0x50ffdc[_0x99ab('0x2f')]:_0x35d09e['model'];if(!_0x37182e['query']['hasOwnProperty']('nolimit')){_0x50ffdc['limit']=qs['limit'](_0x37182e[_0x99ab('0x2c')][_0x99ab('0x1d')]);_0x50ffdc[_0x99ab('0x1c')]=qs['offset'](_0x37182e[_0x99ab('0x2c')][_0x99ab('0x1c')]);}_0x50ffdc[_0x99ab('0x32')]=qs['sort'](_0x37182e[_0x99ab('0x2c')][_0x99ab('0x33')]);_0x50ffdc[_0x99ab('0x34')]=qs[_0x99ab('0x2d')](_[_0x99ab('0x35')](_0x37182e[_0x99ab('0x2c')],_0x35d09e[_0x99ab('0x2d')]));if(_0x37182e['query']['filter']){_0x50ffdc[_0x99ab('0x34')]=_[_0x99ab('0x36')](_0x50ffdc['where'],{'$or':_[_0x99ab('0x37')](_0x12c3e9,function(_0x41a54d){if(_0x41a54d[_0x99ab('0x38')]['key']!==_0x99ab('0x39')){var _0x182044={};_0x182044[_0x41a54d[_0x99ab('0x3a')]]={'$like':'%'+_0x37182e[_0x99ab('0x2c')][_0x99ab('0x3b')]+'%'};return _0x182044;}})});}_0x50ffdc=_['merge']({},_0x50ffdc,_0x37182e[_0x99ab('0x3c')]);var _0x36730a={'where':_0x50ffdc['where']};return db[_0x99ab('0x3d')]['count'](_0x36730a)[_0x99ab('0x22')](function(_0x2ddc5c){_0x2c7333[_0x99ab('0x1b')]=_0x2ddc5c;if(_0x37182e[_0x99ab('0x2c')][_0x99ab('0x3e')]){_0x50ffdc[_0x99ab('0x3f')]=[{'all':!![]}];}return db[_0x99ab('0x3d')][_0x99ab('0x40')](_0x50ffdc);})[_0x99ab('0x22')](function(_0x2c4f29){_0x2c7333['rows']=_0x2c4f29;return _0x2c7333;})[_0x99ab('0x22')](respondWithFilteredResult(_0x3178c2,_0x50ffdc))[_0x99ab('0x41')](handleError(_0x3178c2,null));};exports['show']=function(_0x13c94f,_0x5c6f5f){var _0x165411={'raw':!![],'where':{'id':_0x13c94f[_0x99ab('0x42')]['id']}},_0x5bee18={};_0x5bee18[_0x99ab('0x2a')]=_[_0x99ab('0x2b')](db[_0x99ab('0x3d')]['rawAttributes']);_0x5bee18[_0x99ab('0x2c')]=_[_0x99ab('0x2b')](_0x13c94f[_0x99ab('0x2c')]);_0x5bee18[_0x99ab('0x2d')]=_[_0x99ab('0x2e')](_0x5bee18[_0x99ab('0x2a')],_0x5bee18[_0x99ab('0x2c')]);_0x165411[_0x99ab('0x2f')]=_[_0x99ab('0x2e')](_0x5bee18[_0x99ab('0x2a')],qs[_0x99ab('0x30')](_0x13c94f[_0x99ab('0x2c')][_0x99ab('0x30')]));_0x165411[_0x99ab('0x2f')]=_0x165411[_0x99ab('0x2f')]['length']?_0x165411[_0x99ab('0x2f')]:_0x5bee18[_0x99ab('0x2a')];if(_0x13c94f['query'][_0x99ab('0x3e')]){_0x165411[_0x99ab('0x3f')]=[{'all':!![]}];}_0x165411=_[_0x99ab('0x36')]({},_0x165411,_0x13c94f[_0x99ab('0x3c')]);return db[_0x99ab('0x3d')][_0x99ab('0x43')](_0x165411)[_0x99ab('0x22')](handleEntityNotFound(_0x5c6f5f,null))[_0x99ab('0x22')](respondWithResult(_0x5c6f5f,null))[_0x99ab('0x41')](handleError(_0x5c6f5f,null));};exports[_0x99ab('0x44')]=function(_0x1c4442,_0x531a14){return db[_0x99ab('0x3d')][_0x99ab('0x44')](_0x1c4442[_0x99ab('0x45')],{})[_0x99ab('0x22')](function(_0x513cc4){var _0x520420=_0x1c4442[_0x99ab('0x46')]['get']({'plain':!![]});if(!_0x520420)throw new Error(_0x99ab('0x47'));if(_0x520420[_0x99ab('0x48')]===_0x99ab('0x46')){var _0x3953dc=_0x513cc4[_0x99ab('0x24')]({'plain':!![]});var _0x3ceffc=_0x99ab('0x25');return db['UserProfileSection'][_0x99ab('0x43')]({'where':{'name':_0x3ceffc,'userProfileId':_0x520420[_0x99ab('0x49')]},'raw':!![]})[_0x99ab('0x22')](function(_0x436f84){if(_0x436f84&&_0x436f84[_0x99ab('0x4a')]===0x0){return db[_0x99ab('0x4b')][_0x99ab('0x44')]({'name':_0x3953dc[_0x99ab('0x28')],'resourceId':_0x3953dc['id'],'type':_0x436f84[_0x99ab('0x28')],'sectionId':_0x436f84['id']},{})[_0x99ab('0x22')](function(){return _0x513cc4;});}else{return _0x513cc4;}})['catch'](function(_0x152414){logger[_0x99ab('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x152414);throw _0x152414;});}return _0x513cc4;})[_0x99ab('0x22')](respondWithResult(_0x531a14,0xc9))[_0x99ab('0x41')](handleError(_0x531a14,null));};exports[_0x99ab('0x4c')]=function(_0x1bba5c,_0x12fcfe){if(_0x1bba5c[_0x99ab('0x45')]['id']){delete _0x1bba5c[_0x99ab('0x45')]['id'];}return db['SquareOdbc'][_0x99ab('0x43')]({'where':{'id':_0x1bba5c[_0x99ab('0x42')]['id']}})[_0x99ab('0x22')](handleEntityNotFound(_0x12fcfe,null))[_0x99ab('0x22')](saveUpdates(_0x1bba5c[_0x99ab('0x45')],null))['then'](respondWithResult(_0x12fcfe,null))['catch'](handleError(_0x12fcfe,null));};exports[_0x99ab('0x23')]=function(_0x36ac2c,_0x284aee){return db[_0x99ab('0x3d')]['find']({'where':{'id':_0x36ac2c[_0x99ab('0x42')]['id']}})['then'](handleEntityNotFound(_0x284aee,null))[_0x99ab('0x22')](removeEntity(_0x284aee,null))[_0x99ab('0x41')](handleError(_0x284aee,null));};exports['test']=function(_0xd93031,_0x10e575,_0xc6482b){var _0x4adeac;return db[_0x99ab('0x3d')][_0x99ab('0x43')]({'where':{'id':_0xd93031['params']['id']},'attributes':['id',_0x99ab('0x4d')]})[_0x99ab('0x22')](handleEntityNotFound(_0x10e575,null))[_0x99ab('0x22')](function(_0x2662be){if(_0x2662be){var _0x40ff5c=require(_0x99ab('0x4e'))();_0x40ff5c[_0x99ab('0x4f')](_0x2662be[_0x99ab('0x4d')]);_0x40ff5c[_0x99ab('0x50')]();return _0x2662be;}})[_0x99ab('0x22')](respondWithResult(_0x10e575,null))[_0x99ab('0x41')](handleError(_0x10e575,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index abea86c..d2bbf4c 100644 --- a/server/api/squareOdbc/squareOdbc.model.js +++ b/server/api/squareOdbc/squareOdbc.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x12c8=['api','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger'];(function(_0x553999,_0x4d0851){var _0xe23463=function(_0x123432){while(--_0x123432){_0x553999['push'](_0x553999['shift']());}};_0xe23463(++_0x4d0851);}(_0x12c8,0x1a1));var _0x812c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12c8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x812c('0x0'));var util=require(_0x812c('0x1'));var logger=require(_0x812c('0x2'))(_0x812c('0x3'));var moment=require('moment');var BPromise=require(_0x812c('0x4'));var rp=require(_0x812c('0x5'));var fs=require('fs');var path=require(_0x812c('0x6'));var rimraf=require(_0x812c('0x7'));var config=require(_0x812c('0x8'));var attributes=require(_0x812c('0x9'));module[_0x812c('0xa')]=function(_0x3fd3fb,_0x361c2e){return _0x3fd3fb[_0x812c('0xb')](_0x812c('0xc'),attributes,{'tableName':_0x812c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18af=['../../config/logger','api','moment','path','rimraf','../../config/environment','exports','square_odbc','lodash'];(function(_0x1ac0ce,_0x3c30b0){var _0x5bdc1a=function(_0xa4ca34){while(--_0xa4ca34){_0x1ac0ce['push'](_0x1ac0ce['shift']());}};_0x5bdc1a(++_0x3c30b0);}(_0x18af,0x19d));var _0xf18a=function(_0x553afe,_0x4dce44){_0x553afe=_0x553afe-0x0;var _0x1321e2=_0x18af[_0x553afe];return _0x1321e2;};'use strict';var _=require(_0xf18a('0x0'));var util=require('util');var logger=require(_0xf18a('0x1'))(_0xf18a('0x2'));var moment=require(_0xf18a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf18a('0x4'));var rimraf=require(_0xf18a('0x5'));var config=require(_0xf18a('0x6'));var attributes=require('./squareOdbc.attributes');module[_0xf18a('0x7')]=function(_0x4588fd,_0x3d57d1){return _0x4588fd['define']('SquareOdbc',attributes,{'tableName':_0xf18a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 6e2d67e..dbe20b5 100644 --- a/server/api/squareOdbc/squareOdbc.rpc.js +++ b/server/api/squareOdbc/squareOdbc.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['stringify','error','code','message','result','catch','ShowSquareOdbc','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x510c3f,_0x39e99c){var _0x5e8546=function(_0x312f27){while(--_0x312f27){_0x510c3f['push'](_0x510c3f['shift']());}};_0x5e8546(++_0x39e99c);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['SquareOdbc'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowSquareOdbc',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find'];(function(_0xec1289,_0x4fa82b){var _0x3e223c=function(_0x9752ec){while(--_0x9752ec){_0xec1289['push'](_0xec1289['shift']());}};_0x3e223c(++_0x4fa82b);}(_0x55ca,0x126));var _0xa55c=function(_0x392f82,_0x4dc713){_0x392f82=_0x392f82-0x0;var _0x3ad0b8=_0x55ca[_0x392f82];return _0x3ad0b8;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 8a30005..4b3c3f2 100644 --- a/server/api/squareProject/index.js +++ b/server/api/squareProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7916=['destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','getUsers','post','create','/:id/users','addUsers','put','/:id','update','delete'];(function(_0x15e17c,_0x39f6c8){var _0x55d8c7=function(_0x3d3313){while(--_0x3d3313){_0x15e17c['push'](_0x15e17c['shift']());}};_0x55d8c7(++_0x39f6c8);}(_0x7916,0x128));var _0x6791=function(_0x2ea231,_0x373a5d){_0x2ea231=_0x2ea231-0x0;var _0x28a7d2=_0x7916[_0x2ea231];return _0x28a7d2;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var auth=require(_0x6791('0x4'));var interaction=require(_0x6791('0x5'));var config=require(_0x6791('0x6'));var controller=require('./squareProject.controller');router[_0x6791('0x7')]('/',auth['isAuthenticated'](),controller[_0x6791('0x8')]);router[_0x6791('0x7')]('/:id',auth[_0x6791('0x9')](),controller['show']);router[_0x6791('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x6791('0xa')]);router[_0x6791('0xb')]('/',auth['isAuthenticated'](),controller[_0x6791('0xc')]);router[_0x6791('0xb')](_0x6791('0xd'),auth['isAuthenticated'](),controller[_0x6791('0xe')]);router[_0x6791('0xf')](_0x6791('0x10'),auth[_0x6791('0x9')](),controller[_0x6791('0x11')]);router[_0x6791('0x12')](_0x6791('0x10'),auth[_0x6791('0x9')](),controller[_0x6791('0x13')]);router[_0x6791('0x12')](_0x6791('0xd'),auth['isAuthenticated'](),controller['removeUsers']);module[_0x6791('0x14')]=router; \ No newline at end of file +var _0xd87e=['put','/:id','update','delete','destroy','removeUsers','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./squareProject.controller','get','index','isAuthenticated','show','/:id/users','getUsers','post','create'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xd87e,0x1bf));var _0xed87=function(_0x5676d3,_0x582062){_0x5676d3=_0x5676d3-0x0;var _0x573736=_0xd87e[_0x5676d3];return _0x573736;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require('path');var timeout=require(_0xed87('0x2'));var express=require(_0xed87('0x3'));var router=express[_0xed87('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xed87('0x5'));var config=require('../../config/environment');var controller=require(_0xed87('0x6'));router[_0xed87('0x7')]('/',auth['isAuthenticated'](),controller[_0xed87('0x8')]);router['get']('/:id',auth[_0xed87('0x9')](),controller[_0xed87('0xa')]);router[_0xed87('0x7')](_0xed87('0xb'),auth['isAuthenticated'](),controller[_0xed87('0xc')]);router[_0xed87('0xd')]('/',auth[_0xed87('0x9')](),controller[_0xed87('0xe')]);router[_0xed87('0xd')](_0xed87('0xb'),auth[_0xed87('0x9')](),controller['addUsers']);router[_0xed87('0xf')](_0xed87('0x10'),auth['isAuthenticated'](),controller[_0xed87('0x11')]);router[_0xed87('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xed87('0x13')]);router[_0xed87('0x12')](_0xed87('0xb'),auth[_0xed87('0x9')](),controller[_0xed87('0x14')]);module[_0xed87('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 6ef0545..cef1087 100644 --- a/server/api/squareProject/squareProject.attributes.js +++ b/server/api/squareProject/squareProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf924=['BLOB','long','getDataValue','preproduction','toString','utf8','production','exports','STRING','name','TEXT'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xf924,0xc2));var _0x4f92=function(_0x25dfdf,_0x542333){_0x25dfdf=_0x25dfdf-0x0;var _0x5220da=_0xf924[_0x25dfdf];return _0x5220da;};'use strict';var Sequelize=require('sequelize');module[_0x4f92('0x0')]={'name':{'type':Sequelize[_0x4f92('0x1')],'unique':_0x4f92('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x4f92('0x1')]},'notes':{'type':Sequelize[_0x4f92('0x3')]},'preproduction':{'type':Sequelize[_0x4f92('0x4')](_0x4f92('0x5')),'get':function(){if(this[_0x4f92('0x6')](_0x4f92('0x7'))){return this['getDataValue'](_0x4f92('0x7'))[_0x4f92('0x8')](_0x4f92('0x9'));}}},'production':{'type':Sequelize['BLOB'](_0x4f92('0x5')),'get':function(){if(this[_0x4f92('0x6')]('production')){return this[_0x4f92('0x6')](_0x4f92('0xa'))['toString'](_0x4f92('0x9'));}}}}; \ No newline at end of file +var _0xc220=['production','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','utf8'];(function(_0x121fac,_0x42a298){var _0x5717e3=function(_0x3c5df7){while(--_0x3c5df7){_0x121fac['push'](_0x121fac['shift']());}};_0x5717e3(++_0x42a298);}(_0xc220,0x109));var _0x0c22=function(_0x4b2993,_0xd46430){_0x4b2993=_0x4b2993-0x0;var _0x480074=_0xc220[_0x4b2993];return _0x480074;};'use strict';var Sequelize=require(_0x0c22('0x0'));module[_0x0c22('0x1')]={'name':{'type':Sequelize[_0x0c22('0x2')],'unique':_0x0c22('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0c22('0x2')]},'notes':{'type':Sequelize[_0x0c22('0x4')]},'preproduction':{'type':Sequelize[_0x0c22('0x5')](_0x0c22('0x6')),'get':function(){if(this[_0x0c22('0x7')](_0x0c22('0x8'))){return this['getDataValue'](_0x0c22('0x8'))['toString'](_0x0c22('0x9'));}}},'production':{'type':Sequelize[_0x0c22('0x5')](_0x0c22('0x6')),'get':function(){if(this[_0x0c22('0x7')](_0x0c22('0xa'))){return this[_0x0c22('0x7')]('production')['toString']('utf8');}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 63079f4..bd71d8b 100644 --- a/server/api/squareProject/squareProject.controller.js +++ b/server/api/squareProject/squareProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71e8=['json','offset','limit','set','Content-Range','apply','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','send','SquareProject','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','count','includeAll','include','catch','show','params','find','create','body','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','findOne','options','getUsers','hasOwnProperty','nolimit','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end'];(function(_0x13ca07,_0x22b8ef){var _0x48782e=function(_0x1c7850){while(--_0x1c7850){_0x13ca07['push'](_0x13ca07['shift']());}};_0x48782e(++_0x22b8ef);}(_0x71e8,0x1a2));var _0x871e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x71e8[_0x4cf98e];return _0x1623ac;};'use strict';var pdf=require(_0x871e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x871e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x871e('0x2'));var rp=require(_0x871e('0x3'));var moment=require(_0x871e('0x4'));var BPromise=require(_0x871e('0x5'));var Mustache=require('mustache');var util=require(_0x871e('0x6'));var path=require(_0x871e('0x7'));var sox=require(_0x871e('0x8'));var csv=require('to-csv');var ejs=require(_0x871e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x871e('0xa'));var crypto=require(_0x871e('0xb'));var jsforce=require(_0x871e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x871e('0xd'));var Papa=require('papaparse');var Redis=require(_0x871e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x871e('0xf'));var hardwareService=require(_0x871e('0x10'));var logger=require(_0x871e('0x11'))(_0x871e('0x12'));var utils=require(_0x871e('0x13'));var config=require('../../config/environment');var db=require(_0x871e('0x14'))['db'];config['redis']=_['defaults'](config[_0x871e('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x871e('0x16'))(new Redis(config[_0x871e('0x15')]));require('./squareProject.socket')[_0x871e('0x17')](socket);function respondWithStatusCode(_0x5b94d7,_0x495656){_0x495656=_0x495656||0xcc;return function(_0x5f4141){if(_0x5f4141){return _0x5b94d7[_0x871e('0x18')](_0x495656);}return _0x5b94d7[_0x871e('0x19')](_0x495656)[_0x871e('0x1a')]();};}function respondWithResult(_0x2c3ce9,_0x1695f2){_0x1695f2=_0x1695f2||0xc8;return function(_0x42eaae){if(_0x42eaae){return _0x2c3ce9['status'](_0x1695f2)[_0x871e('0x1b')](_0x42eaae);}};}function respondWithFilteredResult(_0x1ac05b,_0x4193af){return function(_0x3dd033){if(_0x3dd033){var _0x1b8000=_0x3dd033['count'],_0xcfa05=_0x4193af['offset'],_0x1dec5f=_0x4193af[_0x871e('0x1c')]+_0x4193af[_0x871e('0x1d')],_0xdda241;if(_0x1dec5f>=_0x1b8000){_0x1dec5f=_0x1b8000;_0xdda241=0xc8;}else{_0xdda241=0xce;}_0x1ac05b[_0x871e('0x19')](_0xdda241);return _0x1ac05b[_0x871e('0x1e')](_0x871e('0x1f'),_0xcfa05+'-'+_0x1dec5f+'/'+_0x1b8000)[_0x871e('0x1b')](_0x3dd033);}return null;};}function patchUpdates(_0x2cbea0){return function(_0x5ba543){try{jsonpatch[_0x871e('0x20')](_0x5ba543,_0x2cbea0,!![]);}catch(_0x3a1341){return BPromise['reject'](_0x3a1341);}return _0x5ba543['save']();};}function saveUpdates(_0x33f211,_0x3d6f59){return function(_0x3497e5){if(_0x3497e5){return _0x3497e5[_0x871e('0x21')](_0x33f211)[_0x871e('0x22')](function(_0x1e63ef){return _0x1e63ef;});}return null;};}function removeEntity(_0x53136e,_0x171a02){return function(_0x15098c){if(_0x15098c){return _0x15098c[_0x871e('0x23')]()['then'](function(){var _0x1e5fc3=_0x15098c[_0x871e('0x24')]({'plain':!![]});var _0x1b0aee=_0x871e('0x25');return db[_0x871e('0x26')][_0x871e('0x23')]({'where':{'type':_0x1b0aee,'resourceId':_0x1e5fc3['id']}})[_0x871e('0x22')](function(){return _0x15098c;});})[_0x871e('0x22')](function(){_0x53136e[_0x871e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5817ef,_0x2b4153){return function(_0x36002c){if(!_0x36002c){_0x5817ef['sendStatus'](0x194);}return _0x36002c;};}function handleError(_0x407b3c,_0xe8d2ff){_0xe8d2ff=_0xe8d2ff||0x1f4;return function(_0x3ce29d){logger[_0x871e('0x27')](_0x3ce29d[_0x871e('0x28')]);if(_0x3ce29d[_0x871e('0x29')]){delete _0x3ce29d[_0x871e('0x29')];}_0x407b3c[_0x871e('0x19')](_0xe8d2ff)[_0x871e('0x2a')](_0x3ce29d);};}exports['index']=function(_0x1c9770,_0x5c2419){var _0x4e1198={},_0x2bef6c={},_0xb51458={'count':0x0,'rows':[]};var _0x5da6c3=db[_0x871e('0x2b')][_0x871e('0x2c')];_0x2bef6c[_0x871e('0x2d')]=_[_0x871e('0x2e')](_0x5da6c3);_0x2bef6c[_0x871e('0x2f')]=_['keys'](_0x1c9770[_0x871e('0x2f')]);_0x2bef6c[_0x871e('0x30')]=_[_0x871e('0x31')](_0x2bef6c[_0x871e('0x2d')],_0x2bef6c[_0x871e('0x2f')]);_0x4e1198['attributes']=_[_0x871e('0x31')](_0x2bef6c['model'],qs[_0x871e('0x32')](_0x1c9770['query']['fields']));_0x4e1198[_0x871e('0x33')]=_0x4e1198['attributes'][_0x871e('0x34')]?_0x4e1198[_0x871e('0x33')]:_0x2bef6c[_0x871e('0x2d')];if(!_0x1c9770['query']['hasOwnProperty']('nolimit')){_0x4e1198[_0x871e('0x1d')]=qs[_0x871e('0x1d')](_0x1c9770['query'][_0x871e('0x1d')]);_0x4e1198['offset']=qs[_0x871e('0x1c')](_0x1c9770[_0x871e('0x2f')][_0x871e('0x1c')]);}_0x4e1198[_0x871e('0x35')]=qs[_0x871e('0x36')](_0x1c9770[_0x871e('0x2f')][_0x871e('0x36')]);_0x4e1198[_0x871e('0x37')]=qs[_0x871e('0x30')](_[_0x871e('0x38')](_0x1c9770[_0x871e('0x2f')],_0x2bef6c[_0x871e('0x30')]));if(_0x1c9770[_0x871e('0x2f')]['filter']){_0x4e1198[_0x871e('0x37')]=_[_0x871e('0x39')](_0x4e1198[_0x871e('0x37')],{'$or':_[_0x871e('0x3a')](_0x5da6c3,function(_0x24aaa2){if(_0x24aaa2[_0x871e('0x3b')][_0x871e('0x3c')]!==_0x871e('0x3d')){var _0x8f5be6={};_0x8f5be6[_0x24aaa2[_0x871e('0x3e')]]={'$like':'%'+_0x1c9770[_0x871e('0x2f')][_0x871e('0x3f')]+'%'};return _0x8f5be6;}})});}_0x4e1198=_[_0x871e('0x39')]({},_0x4e1198,_0x1c9770['options']);var _0x1edf46={'where':_0x4e1198['where']};return db[_0x871e('0x2b')][_0x871e('0x40')](_0x1edf46)[_0x871e('0x22')](function(_0x92a85b){_0xb51458['count']=_0x92a85b;if(_0x1c9770[_0x871e('0x2f')][_0x871e('0x41')]){_0x4e1198[_0x871e('0x42')]=[{'all':!![]}];}return db[_0x871e('0x2b')]['findAll'](_0x4e1198);})['then'](function(_0x3b98ad){_0xb51458['rows']=_0x3b98ad;return _0xb51458;})['then'](respondWithFilteredResult(_0x5c2419,_0x4e1198))[_0x871e('0x43')](handleError(_0x5c2419,null));};exports[_0x871e('0x44')]=function(_0x2a523f,_0x4399bf){var _0xb782c9={'raw':![],'where':{'id':_0x2a523f[_0x871e('0x45')]['id']}},_0xdecb24={};_0xdecb24[_0x871e('0x2d')]=_[_0x871e('0x2e')](db[_0x871e('0x2b')]['rawAttributes']);_0xdecb24['query']=_[_0x871e('0x2e')](_0x2a523f[_0x871e('0x2f')]);_0xdecb24[_0x871e('0x30')]=_[_0x871e('0x31')](_0xdecb24[_0x871e('0x2d')],_0xdecb24[_0x871e('0x2f')]);_0xb782c9[_0x871e('0x33')]=_[_0x871e('0x31')](_0xdecb24[_0x871e('0x2d')],qs[_0x871e('0x32')](_0x2a523f['query'][_0x871e('0x32')]));_0xb782c9[_0x871e('0x33')]=_0xb782c9['attributes'][_0x871e('0x34')]?_0xb782c9[_0x871e('0x33')]:_0xdecb24[_0x871e('0x2d')];if(_0x2a523f[_0x871e('0x2f')][_0x871e('0x41')]){_0xb782c9['include']=[{'all':!![]}];}_0xb782c9=_[_0x871e('0x39')]({},_0xb782c9,_0x2a523f['options']);return db[_0x871e('0x2b')][_0x871e('0x46')](_0xb782c9)[_0x871e('0x22')](handleEntityNotFound(_0x4399bf,null))[_0x871e('0x22')](respondWithResult(_0x4399bf,null))[_0x871e('0x43')](handleError(_0x4399bf,null));};exports[_0x871e('0x47')]=function(_0x318aca,_0x2f1c5c){return db['SquareProject'][_0x871e('0x47')](_0x318aca[_0x871e('0x48')],{})['then'](function(_0x1b2c01){var _0x3e844f=_0x318aca['user']['get']({'plain':!![]});if(!_0x3e844f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e844f['role']==='user'){var _0x47a54b=_0x1b2c01[_0x871e('0x24')]({'plain':!![]});var _0x888e3c=_0x871e('0x25');return db[_0x871e('0x49')][_0x871e('0x46')]({'where':{'name':_0x888e3c,'userProfileId':_0x3e844f[_0x871e('0x4a')]},'raw':!![]})['then'](function(_0x2ff3bd){if(_0x2ff3bd&&_0x2ff3bd[_0x871e('0x4b')]===0x0){return db[_0x871e('0x26')][_0x871e('0x47')]({'name':_0x47a54b[_0x871e('0x29')],'resourceId':_0x47a54b['id'],'type':_0x2ff3bd[_0x871e('0x29')],'sectionId':_0x2ff3bd['id']},{})['then'](function(){return _0x1b2c01;});}else{return _0x1b2c01;}})[_0x871e('0x43')](function(_0x40df32){logger['error'](_0x871e('0x4c'),_0x40df32);throw _0x40df32;});}return _0x1b2c01;})[_0x871e('0x22')](respondWithResult(_0x2f1c5c,0xc9))['catch'](handleError(_0x2f1c5c,null));};exports[_0x871e('0x21')]=function(_0x5bd17a,_0x2227f9){if(_0x5bd17a['body']['id']){delete _0x5bd17a[_0x871e('0x48')]['id'];}return db['SquareProject'][_0x871e('0x46')]({'where':{'id':_0x5bd17a[_0x871e('0x45')]['id']}})[_0x871e('0x22')](handleEntityNotFound(_0x2227f9,null))[_0x871e('0x22')](saveUpdates(_0x5bd17a[_0x871e('0x48')],null))['then'](respondWithResult(_0x2227f9,null))['catch'](handleError(_0x2227f9,null));};exports[_0x871e('0x23')]=function(_0x3b3da0,_0x24644c){return db[_0x871e('0x2b')][_0x871e('0x46')]({'where':{'id':_0x3b3da0[_0x871e('0x45')]['id']}})[_0x871e('0x22')](handleEntityNotFound(_0x24644c,null))['then'](removeEntity(_0x24644c,null))[_0x871e('0x43')](handleError(_0x24644c,null));};exports['addUsers']=function(_0x282126,_0x4ac6b8,_0x2efd0e){return db[_0x871e('0x2b')][_0x871e('0x46')]({'where':{'id':_0x282126[_0x871e('0x45')]['id']}})[_0x871e('0x22')](handleEntityNotFound(_0x4ac6b8,null))[_0x871e('0x22')](function(_0x20a1c9){if(_0x20a1c9){return _0x20a1c9[_0x871e('0x4d')](_0x282126[_0x871e('0x48')]['ids'],_[_0x871e('0x4e')](_0x282126['body'],[_0x871e('0x4f'),'id'])||{});}})[_0x871e('0x22')](respondWithResult(_0x4ac6b8,null))[_0x871e('0x43')](handleError(_0x4ac6b8,null));};exports[_0x871e('0x50')]=function(_0x22d37d,_0x431e57,_0x1a248f){return db['SquareProject']['find']({'where':{'id':_0x22d37d[_0x871e('0x45')]['id']}})[_0x871e('0x22')](handleEntityNotFound(_0x431e57,null))[_0x871e('0x22')](function(_0x2c4bc9){if(_0x2c4bc9){return _0x2c4bc9[_0x871e('0x50')](_0x22d37d[_0x871e('0x2f')][_0x871e('0x4f')])[_0x871e('0x22')](function(){if(_[_0x871e('0x51')](_0x22d37d[_0x871e('0x2f')][_0x871e('0x4f')])){for(var _0x3b4e0f=0x0;_0x3b4e0f<_0x22d37d[_0x871e('0x2f')][_0x871e('0x4f')]['length'];_0x3b4e0f+=0x1){socket[_0x871e('0x52')](_0x871e('0x53'),{'UserId':Number(_0x22d37d[_0x871e('0x2f')][_0x871e('0x4f')][_0x3b4e0f]),'SquareProjectId':Number(_0x22d37d[_0x871e('0x45')]['id'])});}}else{socket[_0x871e('0x52')](_0x871e('0x53'),{'UserId':Number(_0x22d37d[_0x871e('0x2f')]['ids']),'SquareProjectId':Number(_0x22d37d[_0x871e('0x45')]['id'])});}});}})[_0x871e('0x22')](respondWithStatusCode(_0x431e57,null))[_0x871e('0x43')](handleError(_0x431e57,null));};exports['getUsers']=function(_0x362a11,_0x4a256e,_0x157d66){var _0x151b5e={};var _0x339fba={};var _0x3d3f86;var _0x3f871a;return db[_0x871e('0x2b')][_0x871e('0x54')]({'where':{'id':_0x362a11[_0x871e('0x45')]['id']}})[_0x871e('0x22')](handleEntityNotFound(_0x4a256e,null))['then'](function(_0x4e3ad1){if(_0x4e3ad1){_0x3d3f86=_0x4e3ad1;_0x339fba['model']=_[_0x871e('0x2e')](db['User']['rawAttributes']);_0x339fba[_0x871e('0x2f')]=_[_0x871e('0x2e')](_0x362a11[_0x871e('0x2f')]);_0x339fba['filters']=_['intersection'](_0x339fba[_0x871e('0x2d')],_0x339fba['query']);_0x151b5e['attributes']=_[_0x871e('0x31')](_0x339fba[_0x871e('0x2d')],qs['fields'](_0x362a11[_0x871e('0x2f')][_0x871e('0x32')]));_0x151b5e[_0x871e('0x33')]=_0x151b5e['attributes'][_0x871e('0x34')]?_0x151b5e[_0x871e('0x33')]:_0x339fba['model'];_0x151b5e[_0x871e('0x35')]=qs[_0x871e('0x36')](_0x362a11[_0x871e('0x2f')][_0x871e('0x36')]);_0x151b5e[_0x871e('0x37')]=qs[_0x871e('0x30')](_[_0x871e('0x38')](_0x362a11['query'],_0x339fba[_0x871e('0x30')]));if(_0x362a11[_0x871e('0x2f')]['filter']){_0x151b5e[_0x871e('0x37')]=_[_0x871e('0x39')](_0x151b5e['where'],{'$or':_[_0x871e('0x3a')](_0x151b5e[_0x871e('0x33')],function(_0x1e3b5a){var _0x346c30={};_0x346c30[_0x1e3b5a]={'$like':'%'+_0x362a11[_0x871e('0x2f')][_0x871e('0x3f')]+'%'};return _0x346c30;})});}_0x151b5e=_['merge']({},_0x151b5e,_0x362a11[_0x871e('0x55')]);return _0x3d3f86[_0x871e('0x56')](_0x151b5e);}})['then'](function(_0x327a74){if(_0x327a74){_0x3f871a=_0x327a74[_0x871e('0x34')];if(!_0x362a11[_0x871e('0x2f')][_0x871e('0x57')](_0x871e('0x58'))){_0x151b5e[_0x871e('0x1d')]=qs[_0x871e('0x1d')](_0x362a11[_0x871e('0x2f')]['limit']);_0x151b5e[_0x871e('0x1c')]=qs[_0x871e('0x1c')](_0x362a11[_0x871e('0x2f')][_0x871e('0x1c')]);}return _0x3d3f86[_0x871e('0x56')](_0x151b5e);}})[_0x871e('0x22')](function(_0x295098){if(_0x295098){return _0x295098?{'count':_0x3f871a,'rows':_0x295098}:null;}})['then'](respondWithResult(_0x4a256e,null))[_0x871e('0x43')](handleError(_0x4a256e,null));}; \ No newline at end of file +var _0x60e2=['merge','map','type','key','field','filter','options','count','includeAll','rows','show','params','length','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','findOne','User','hasOwnProperty','getUsers','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','sendStatus','end','status','offset','limit','Content-Range','apply','save','then','destroy','get','SquareProjects','UserProfileResource','error','name','index','SquareProject','rawAttributes','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick'];(function(_0x4b0290,_0x188c34){var _0x4bd9f4=function(_0x357f3f){while(--_0x357f3f){_0x4b0290['push'](_0x4b0290['shift']());}};_0x4bd9f4(++_0x188c34);}(_0x60e2,0xdc));var _0x260e=function(_0x121e48,_0x44640e){_0x121e48=_0x121e48-0x0;var _0x2f1199=_0x60e2[_0x121e48];return _0x2f1199;};'use strict';var pdf=require(_0x260e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x260e('0x1'));var zipdir=require(_0x260e('0x2'));var jsonpatch=require(_0x260e('0x3'));var rp=require(_0x260e('0x4'));var moment=require(_0x260e('0x5'));var BPromise=require(_0x260e('0x6'));var Mustache=require(_0x260e('0x7'));var util=require(_0x260e('0x8'));var path=require(_0x260e('0x9'));var sox=require(_0x260e('0xa'));var csv=require(_0x260e('0xb'));var ejs=require(_0x260e('0xc'));var fs=require('fs');var _=require(_0x260e('0xd'));var squel=require(_0x260e('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x260e('0xb'));var querystring=require(_0x260e('0xf'));var Papa=require(_0x260e('0x10'));var Redis=require(_0x260e('0x11'));var authService=require(_0x260e('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x260e('0x13'));var logger=require(_0x260e('0x14'))('api');var utils=require(_0x260e('0x15'));var config=require(_0x260e('0x16'));var db=require(_0x260e('0x17'))['db'];config[_0x260e('0x18')]=_[_0x260e('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x260e('0x1a'))(new Redis(config[_0x260e('0x18')]));require(_0x260e('0x1b'))[_0x260e('0x1c')](socket);function respondWithStatusCode(_0x56b1ef,_0x3efe2c){_0x3efe2c=_0x3efe2c||0xcc;return function(_0x4b2b81){if(_0x4b2b81){return _0x56b1ef[_0x260e('0x1d')](_0x3efe2c);}return _0x56b1ef['status'](_0x3efe2c)[_0x260e('0x1e')]();};}function respondWithResult(_0x204c09,_0x124838){_0x124838=_0x124838||0xc8;return function(_0x2f5b11){if(_0x2f5b11){return _0x204c09[_0x260e('0x1f')](_0x124838)['json'](_0x2f5b11);}};}function respondWithFilteredResult(_0x1908e7,_0x48fbb7){return function(_0x6a971e){if(_0x6a971e){var _0x27136b=_0x6a971e['count'],_0x337929=_0x48fbb7[_0x260e('0x20')],_0x5e098c=_0x48fbb7[_0x260e('0x20')]+_0x48fbb7[_0x260e('0x21')],_0x341b11;if(_0x5e098c>=_0x27136b){_0x5e098c=_0x27136b;_0x341b11=0xc8;}else{_0x341b11=0xce;}_0x1908e7[_0x260e('0x1f')](_0x341b11);return _0x1908e7['set'](_0x260e('0x22'),_0x337929+'-'+_0x5e098c+'/'+_0x27136b)['json'](_0x6a971e);}return null;};}function patchUpdates(_0x4cce47){return function(_0x7963ce){try{jsonpatch[_0x260e('0x23')](_0x7963ce,_0x4cce47,!![]);}catch(_0x55a83d){return BPromise['reject'](_0x55a83d);}return _0x7963ce[_0x260e('0x24')]();};}function saveUpdates(_0xb68bcd,_0x1a8a20){return function(_0x5c1e86){if(_0x5c1e86){return _0x5c1e86['update'](_0xb68bcd)[_0x260e('0x25')](function(_0x1a8318){return _0x1a8318;});}return null;};}function removeEntity(_0xfd3a4f,_0x262207){return function(_0x34a767){if(_0x34a767){return _0x34a767[_0x260e('0x26')]()['then'](function(){var _0x41f83c=_0x34a767[_0x260e('0x27')]({'plain':!![]});var _0x8feb30=_0x260e('0x28');return db[_0x260e('0x29')]['destroy']({'where':{'type':_0x8feb30,'resourceId':_0x41f83c['id']}})[_0x260e('0x25')](function(){return _0x34a767;});})[_0x260e('0x25')](function(){_0xfd3a4f[_0x260e('0x1f')](0xcc)[_0x260e('0x1e')]();});}};}function handleEntityNotFound(_0x14e21a,_0x1b8f49){return function(_0x2ea37f){if(!_0x2ea37f){_0x14e21a['sendStatus'](0x194);}return _0x2ea37f;};}function handleError(_0x323f8a,_0x38a474){_0x38a474=_0x38a474||0x1f4;return function(_0x2b1986){logger[_0x260e('0x2a')](_0x2b1986['stack']);if(_0x2b1986[_0x260e('0x2b')]){delete _0x2b1986[_0x260e('0x2b')];}_0x323f8a[_0x260e('0x1f')](_0x38a474)['send'](_0x2b1986);};}exports[_0x260e('0x2c')]=function(_0x104c48,_0x4b9820){var _0x31c66d={},_0x3a1b3c={},_0x3092b2={'count':0x0,'rows':[]};var _0x1c9648=db[_0x260e('0x2d')][_0x260e('0x2e')];_0x3a1b3c['model']=_[_0x260e('0x2f')](_0x1c9648);_0x3a1b3c[_0x260e('0x30')]=_[_0x260e('0x2f')](_0x104c48['query']);_0x3a1b3c[_0x260e('0x31')]=_[_0x260e('0x32')](_0x3a1b3c[_0x260e('0x33')],_0x3a1b3c[_0x260e('0x30')]);_0x31c66d[_0x260e('0x34')]=_[_0x260e('0x32')](_0x3a1b3c['model'],qs[_0x260e('0x35')](_0x104c48['query']['fields']));_0x31c66d['attributes']=_0x31c66d[_0x260e('0x34')]['length']?_0x31c66d['attributes']:_0x3a1b3c[_0x260e('0x33')];if(!_0x104c48['query']['hasOwnProperty'](_0x260e('0x36'))){_0x31c66d[_0x260e('0x21')]=qs[_0x260e('0x21')](_0x104c48['query'][_0x260e('0x21')]);_0x31c66d[_0x260e('0x20')]=qs[_0x260e('0x20')](_0x104c48[_0x260e('0x30')][_0x260e('0x20')]);}_0x31c66d[_0x260e('0x37')]=qs[_0x260e('0x38')](_0x104c48['query'][_0x260e('0x38')]);_0x31c66d[_0x260e('0x39')]=qs['filters'](_[_0x260e('0x3a')](_0x104c48[_0x260e('0x30')],_0x3a1b3c['filters']));if(_0x104c48[_0x260e('0x30')]['filter']){_0x31c66d[_0x260e('0x39')]=_[_0x260e('0x3b')](_0x31c66d[_0x260e('0x39')],{'$or':_[_0x260e('0x3c')](_0x1c9648,function(_0x541964){if(_0x541964[_0x260e('0x3d')][_0x260e('0x3e')]!=='VIRTUAL'){var _0x15c6bd={};_0x15c6bd[_0x541964[_0x260e('0x3f')]]={'$like':'%'+_0x104c48[_0x260e('0x30')][_0x260e('0x40')]+'%'};return _0x15c6bd;}})});}_0x31c66d=_[_0x260e('0x3b')]({},_0x31c66d,_0x104c48[_0x260e('0x41')]);var _0x44cbc3={'where':_0x31c66d[_0x260e('0x39')]};return db[_0x260e('0x2d')][_0x260e('0x42')](_0x44cbc3)[_0x260e('0x25')](function(_0x3362af){_0x3092b2[_0x260e('0x42')]=_0x3362af;if(_0x104c48[_0x260e('0x30')][_0x260e('0x43')]){_0x31c66d['include']=[{'all':!![]}];}return db[_0x260e('0x2d')]['findAll'](_0x31c66d);})[_0x260e('0x25')](function(_0x3cfad9){_0x3092b2[_0x260e('0x44')]=_0x3cfad9;return _0x3092b2;})[_0x260e('0x25')](respondWithFilteredResult(_0x4b9820,_0x31c66d))['catch'](handleError(_0x4b9820,null));};exports[_0x260e('0x45')]=function(_0x3613b3,_0x527cbe){var _0x420a36={'raw':![],'where':{'id':_0x3613b3[_0x260e('0x46')]['id']}},_0x3d01e2={};_0x3d01e2[_0x260e('0x33')]=_[_0x260e('0x2f')](db[_0x260e('0x2d')][_0x260e('0x2e')]);_0x3d01e2[_0x260e('0x30')]=_[_0x260e('0x2f')](_0x3613b3['query']);_0x3d01e2[_0x260e('0x31')]=_[_0x260e('0x32')](_0x3d01e2[_0x260e('0x33')],_0x3d01e2['query']);_0x420a36[_0x260e('0x34')]=_[_0x260e('0x32')](_0x3d01e2[_0x260e('0x33')],qs[_0x260e('0x35')](_0x3613b3['query'][_0x260e('0x35')]));_0x420a36[_0x260e('0x34')]=_0x420a36[_0x260e('0x34')][_0x260e('0x47')]?_0x420a36[_0x260e('0x34')]:_0x3d01e2[_0x260e('0x33')];if(_0x3613b3[_0x260e('0x30')][_0x260e('0x43')]){_0x420a36[_0x260e('0x48')]=[{'all':!![]}];}_0x420a36=_['merge']({},_0x420a36,_0x3613b3[_0x260e('0x41')]);return db[_0x260e('0x2d')]['find'](_0x420a36)[_0x260e('0x25')](handleEntityNotFound(_0x527cbe,null))[_0x260e('0x25')](respondWithResult(_0x527cbe,null))[_0x260e('0x49')](handleError(_0x527cbe,null));};exports[_0x260e('0x4a')]=function(_0x355280,_0x3d8c9a){return db[_0x260e('0x2d')][_0x260e('0x4a')](_0x355280[_0x260e('0x4b')],{})['then'](function(_0x18ab47){var _0x55a2e6=_0x355280[_0x260e('0x4c')][_0x260e('0x27')]({'plain':!![]});if(!_0x55a2e6)throw new Error(_0x260e('0x4d'));if(_0x55a2e6['role']===_0x260e('0x4c')){var _0x28a2e8=_0x18ab47['get']({'plain':!![]});var _0xfc37c7=_0x260e('0x28');return db[_0x260e('0x4e')][_0x260e('0x4f')]({'where':{'name':_0xfc37c7,'userProfileId':_0x55a2e6['userProfileId']},'raw':!![]})[_0x260e('0x25')](function(_0x24049d){if(_0x24049d&&_0x24049d['autoAssociation']===0x0){return db[_0x260e('0x29')][_0x260e('0x4a')]({'name':_0x28a2e8[_0x260e('0x2b')],'resourceId':_0x28a2e8['id'],'type':_0x24049d[_0x260e('0x2b')],'sectionId':_0x24049d['id']},{})[_0x260e('0x25')](function(){return _0x18ab47;});}else{return _0x18ab47;}})[_0x260e('0x49')](function(_0x200a0d){logger['error'](_0x260e('0x50'),_0x200a0d);throw _0x200a0d;});}return _0x18ab47;})['then'](respondWithResult(_0x3d8c9a,0xc9))[_0x260e('0x49')](handleError(_0x3d8c9a,null));};exports[_0x260e('0x51')]=function(_0x568416,_0x585238){if(_0x568416['body']['id']){delete _0x568416['body']['id'];}return db[_0x260e('0x2d')][_0x260e('0x4f')]({'where':{'id':_0x568416[_0x260e('0x46')]['id']}})[_0x260e('0x25')](handleEntityNotFound(_0x585238,null))[_0x260e('0x25')](saveUpdates(_0x568416[_0x260e('0x4b')],null))[_0x260e('0x25')](respondWithResult(_0x585238,null))[_0x260e('0x49')](handleError(_0x585238,null));};exports[_0x260e('0x26')]=function(_0xfd5178,_0x52006e){return db['SquareProject']['find']({'where':{'id':_0xfd5178['params']['id']}})['then'](handleEntityNotFound(_0x52006e,null))[_0x260e('0x25')](removeEntity(_0x52006e,null))[_0x260e('0x49')](handleError(_0x52006e,null));};exports[_0x260e('0x52')]=function(_0xc38f88,_0x39b659,_0x209086){return db[_0x260e('0x2d')]['find']({'where':{'id':_0xc38f88[_0x260e('0x46')]['id']}})[_0x260e('0x25')](handleEntityNotFound(_0x39b659,null))[_0x260e('0x25')](function(_0x2ced29){if(_0x2ced29){return _0x2ced29[_0x260e('0x52')](_0xc38f88['body'][_0x260e('0x53')],_[_0x260e('0x54')](_0xc38f88[_0x260e('0x4b')],[_0x260e('0x53'),'id'])||{});}})[_0x260e('0x25')](respondWithResult(_0x39b659,null))['catch'](handleError(_0x39b659,null));};exports['removeUsers']=function(_0x4cd43a,_0x125f5f,_0x4af612){return db[_0x260e('0x2d')][_0x260e('0x4f')]({'where':{'id':_0x4cd43a[_0x260e('0x46')]['id']}})[_0x260e('0x25')](handleEntityNotFound(_0x125f5f,null))[_0x260e('0x25')](function(_0xf6fbe){if(_0xf6fbe){return _0xf6fbe[_0x260e('0x55')](_0x4cd43a[_0x260e('0x30')][_0x260e('0x53')])[_0x260e('0x25')](function(){if(_[_0x260e('0x56')](_0x4cd43a[_0x260e('0x30')]['ids'])){for(var _0x1c77e6=0x0;_0x1c77e6<_0x4cd43a[_0x260e('0x30')][_0x260e('0x53')][_0x260e('0x47')];_0x1c77e6+=0x1){socket[_0x260e('0x57')]('userSquareProject:remove',{'UserId':Number(_0x4cd43a[_0x260e('0x30')]['ids'][_0x1c77e6]),'SquareProjectId':Number(_0x4cd43a[_0x260e('0x46')]['id'])});}}else{socket[_0x260e('0x57')](_0x260e('0x58'),{'UserId':Number(_0x4cd43a[_0x260e('0x30')][_0x260e('0x53')]),'SquareProjectId':Number(_0x4cd43a[_0x260e('0x46')]['id'])});}});}})[_0x260e('0x25')](respondWithStatusCode(_0x125f5f,null))[_0x260e('0x49')](handleError(_0x125f5f,null));};exports['getUsers']=function(_0x290376,_0xaade36,_0x52e8d4){var _0x53de74={};var _0x13ab9a={};var _0xcb0dce;var _0x175444;return db[_0x260e('0x2d')][_0x260e('0x59')]({'where':{'id':_0x290376['params']['id']}})['then'](handleEntityNotFound(_0xaade36,null))[_0x260e('0x25')](function(_0x333f18){if(_0x333f18){_0xcb0dce=_0x333f18;_0x13ab9a[_0x260e('0x33')]=_[_0x260e('0x2f')](db[_0x260e('0x5a')][_0x260e('0x2e')]);_0x13ab9a['query']=_[_0x260e('0x2f')](_0x290376[_0x260e('0x30')]);_0x13ab9a[_0x260e('0x31')]=_['intersection'](_0x13ab9a['model'],_0x13ab9a[_0x260e('0x30')]);_0x53de74[_0x260e('0x34')]=_[_0x260e('0x32')](_0x13ab9a[_0x260e('0x33')],qs[_0x260e('0x35')](_0x290376[_0x260e('0x30')][_0x260e('0x35')]));_0x53de74[_0x260e('0x34')]=_0x53de74[_0x260e('0x34')][_0x260e('0x47')]?_0x53de74['attributes']:_0x13ab9a['model'];_0x53de74[_0x260e('0x37')]=qs[_0x260e('0x38')](_0x290376['query']['sort']);_0x53de74[_0x260e('0x39')]=qs[_0x260e('0x31')](_[_0x260e('0x3a')](_0x290376[_0x260e('0x30')],_0x13ab9a[_0x260e('0x31')]));if(_0x290376[_0x260e('0x30')]['filter']){_0x53de74[_0x260e('0x39')]=_[_0x260e('0x3b')](_0x53de74['where'],{'$or':_[_0x260e('0x3c')](_0x53de74['attributes'],function(_0x598575){var _0x9cfd77={};_0x9cfd77[_0x598575]={'$like':'%'+_0x290376[_0x260e('0x30')]['filter']+'%'};return _0x9cfd77;})});}_0x53de74=_[_0x260e('0x3b')]({},_0x53de74,_0x290376[_0x260e('0x41')]);return _0xcb0dce['getUsers'](_0x53de74);}})[_0x260e('0x25')](function(_0x5f1baa){if(_0x5f1baa){_0x175444=_0x5f1baa[_0x260e('0x47')];if(!_0x290376[_0x260e('0x30')][_0x260e('0x5b')](_0x260e('0x36'))){_0x53de74[_0x260e('0x21')]=qs[_0x260e('0x21')](_0x290376[_0x260e('0x30')][_0x260e('0x21')]);_0x53de74['offset']=qs['offset'](_0x290376[_0x260e('0x30')]['offset']);}return _0xcb0dce[_0x260e('0x5c')](_0x53de74);}})[_0x260e('0x25')](function(_0x59648f){if(_0x59648f){return _0x59648f?{'count':_0x175444,'rows':_0x59648f}:null;}})['then'](respondWithResult(_0xaade36,null))[_0x260e('0x49')](handleError(_0xaade36,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index dd97a21..5dcfdef 100644 --- a/server/api/squareProject/squareProject.events.js +++ b/server/api/squareProject/squareProject.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34ab=['SquareProject','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x24a4eb,_0x5b03c3){var _0x459f8a=function(_0x5db13f){while(--_0x5db13f){_0x24a4eb['push'](_0x24a4eb['shift']());}};_0x459f8a(++_0x5b03c3);}(_0x34ab,0xf1));var _0xb34a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x34ab[_0x4f9b18];return _0x29f20c;};'use strict';var EventEmitter=require(_0xb34a('0x0'));var SquareProject=require(_0xb34a('0x1'))['db'][_0xb34a('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb34a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb34a('0x4')};function emitEvent(_0x54ca38){return function(_0x32ef74,_0x34ac6c,_0x46ba33){SquareProjectEvents['emit'](_0x54ca38+':'+_0x32ef74['id'],_0x32ef74);SquareProjectEvents[_0xb34a('0x5')](_0x54ca38,_0x32ef74);_0x46ba33(null);};}for(var e in events){if(events[_0xb34a('0x6')](e)){var event=events[e];SquareProject[_0xb34a('0x7')](e,emitEvent(event));}}module[_0xb34a('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x455f=['events','../../mysqldb','SquareProject','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x25b457,_0x38f6b4){var _0x77066a=function(_0x4c593a){while(--_0x4c593a){_0x25b457['push'](_0x25b457['shift']());}};_0x77066a(++_0x38f6b4);}(_0x455f,0x118));var _0xf455=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x455f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf455('0x0'));var SquareProject=require(_0xf455('0x1'))['db'][_0xf455('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xf455('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf455('0x4')};function emitEvent(_0x2bb9f3){return function(_0x30e709,_0x591c36,_0xf53a57){SquareProjectEvents[_0xf455('0x5')](_0x2bb9f3+':'+_0x30e709['id'],_0x30e709);SquareProjectEvents[_0xf455('0x5')](_0x2bb9f3,_0x30e709);_0xf53a57(null);};}for(var e in events){if(events[_0xf455('0x6')](e)){var event=events[e];SquareProject[_0xf455('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 29816a2..a3be964 100644 --- a/server/api/squareProject/squareProject.model.js +++ b/server/api/squareProject/squareProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x896c=['rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0x896c,0x17c));var _0xc896=function(_0x1486e5,_0x39684f){_0x1486e5=_0x1486e5-0x0;var _0x29d89b=_0x896c[_0x1486e5];return _0x29d89b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc896('0x0'))('api');var moment=require(_0xc896('0x1'));var BPromise=require(_0xc896('0x2'));var rp=require(_0xc896('0x3'));var fs=require('fs');var path=require(_0xc896('0x4'));var rimraf=require(_0xc896('0x5'));var config=require(_0xc896('0x6'));var attributes=require(_0xc896('0x7'));module['exports']=function(_0x15d9b9,_0x17dcbb){return _0x15d9b9[_0xc896('0x8')](_0xc896('0x9'),attributes,{'tableName':_0xc896('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58e0=['../../config/environment','exports','SquareProject','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x444fa3,_0x1a5f0a){var _0x1c9939=function(_0x3200ee){while(--_0x3200ee){_0x444fa3['push'](_0x444fa3['shift']());}};_0x1c9939(++_0x1a5f0a);}(_0x58e0,0x157));var _0x058e=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x58e0[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x058e('0x0'));var util=require('util');var logger=require(_0x058e('0x1'))('api');var moment=require(_0x058e('0x2'));var BPromise=require(_0x058e('0x3'));var rp=require(_0x058e('0x4'));var fs=require('fs');var path=require(_0x058e('0x5'));var rimraf=require(_0x058e('0x6'));var config=require(_0x058e('0x7'));var attributes=require('./squareProject.attributes');module[_0x058e('0x8')]=function(_0x33c99e,_0x110613){return _0x33c99e['define'](_0x058e('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 0d4c4d2..5a832d7 100644 --- a/server/api/squareProject/squareProject.rpc.js +++ b/server/api/squareProject/squareProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9c5=['redis','defaults','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','SquareProject','options','raw','attributes','include','map','model','ShowSquareProject','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5cd542,_0x538bde){var _0x228f67=function(_0x5c5ccd){while(--_0x5c5ccd){_0x5cd542['push'](_0x5cd542['shift']());}};_0x228f67(++_0x538bde);}(_0xa9c5,0x16f));var _0x5a9c=function(_0x257e09,_0x4d59fa){_0x257e09=_0x257e09-0x0;var _0x36015b=_0xa9c5[_0x257e09];return _0x36015b;};'use strict';var _=require(_0x5a9c('0x0'));var util=require(_0x5a9c('0x1'));var moment=require(_0x5a9c('0x2'));var BPromise=require(_0x5a9c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a9c('0x4'));var db=require(_0x5a9c('0x5'))['db'];var utils=require(_0x5a9c('0x6'));var logger=require(_0x5a9c('0x7'))(_0x5a9c('0x8'));var config=require(_0x5a9c('0x9'));var jayson=require(_0x5a9c('0xa'));var client=jayson[_0x5a9c('0xb')][_0x5a9c('0xc')]({'port':0x232a});config[_0x5a9c('0xd')]=_[_0x5a9c('0xe')](config[_0x5a9c('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x5a9c('0xf'))(new Redis(config[_0x5a9c('0xd')]));require(_0x5a9c('0x10'))[_0x5a9c('0x11')](socket);function respondWithRpcPromise(_0x4c06c8,_0x4d542d,_0x599e41){return new BPromise(function(_0x14136b,_0x9d0699){return client[_0x5a9c('0x12')](_0x4c06c8,_0x599e41)[_0x5a9c('0x13')](function(_0x2f5c97){logger[_0x5a9c('0x14')](_0x5a9c('0x15'),_0x4d542d,'request\x20sent');logger['debug'](_0x5a9c('0x16'),_0x4d542d,_0x5a9c('0x17'),JSON[_0x5a9c('0x18')](_0x2f5c97));if(_0x2f5c97['error']){if(_0x2f5c97['error'][_0x5a9c('0x19')]===0x1f4){logger[_0x5a9c('0x1a')](_0x5a9c('0x15'),_0x4d542d,_0x2f5c97[_0x5a9c('0x1a')][_0x5a9c('0x1b')]);return _0x9d0699(_0x2f5c97['error'][_0x5a9c('0x1b')]);}logger[_0x5a9c('0x1a')](_0x5a9c('0x15'),_0x4d542d,_0x2f5c97[_0x5a9c('0x1a')][_0x5a9c('0x1b')]);return _0x14136b(_0x2f5c97[_0x5a9c('0x1a')][_0x5a9c('0x1b')]);}else{logger[_0x5a9c('0x14')]('SquareProject,\x20%s,\x20%s',_0x4d542d,_0x5a9c('0x17'));_0x14136b(_0x2f5c97['result'][_0x5a9c('0x1b')]);}})[_0x5a9c('0x1c')](function(_0x576259){logger['error'](_0x5a9c('0x15'),_0x4d542d,_0x576259);_0x9d0699(_0x576259);});});}exports['ShowSquareProject']=function(_0x3d9771){var _0x687911=this;return new Promise(function(_0x3ef10e,_0x1ee453){return db[_0x5a9c('0x1d')]['find']({'raw':_0x3d9771[_0x5a9c('0x1e')]?_0x3d9771[_0x5a9c('0x1e')][_0x5a9c('0x1f')]===undefined?!![]:![]:!![],'where':_0x3d9771['options']?_0x3d9771[_0x5a9c('0x1e')]['where']||null:null,'attributes':_0x3d9771[_0x5a9c('0x1e')]?_0x3d9771[_0x5a9c('0x1e')][_0x5a9c('0x20')]||null:null,'include':_0x3d9771[_0x5a9c('0x1e')]?_0x3d9771[_0x5a9c('0x1e')][_0x5a9c('0x21')]?_[_0x5a9c('0x22')](_0x3d9771['options']['include'],function(_0x509ef2){return{'model':db[_0x509ef2[_0x5a9c('0x23')]],'as':_0x509ef2['as'],'attributes':_0x509ef2[_0x5a9c('0x20')],'include':_0x509ef2[_0x5a9c('0x21')]?_[_0x5a9c('0x22')](_0x509ef2[_0x5a9c('0x21')],function(_0x4c72d7){return{'model':db[_0x4c72d7[_0x5a9c('0x23')]],'as':_0x4c72d7['as'],'attributes':_0x4c72d7[_0x5a9c('0x20')],'include':_0x4c72d7[_0x5a9c('0x21')]?_[_0x5a9c('0x22')](_0x4c72d7[_0x5a9c('0x21')],function(_0x1be07b){return{'model':db[_0x1be07b[_0x5a9c('0x23')]],'as':_0x1be07b['as'],'attributes':_0x1be07b[_0x5a9c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5a9c('0x13')](function(_0x5c617a){logger['info'](_0x5a9c('0x24'),_0x3d9771);logger[_0x5a9c('0x25')](_0x5a9c('0x24'),_0x3d9771,JSON[_0x5a9c('0x18')](_0x5c617a));_0x3ef10e(_0x5c617a);})[_0x5a9c('0x1c')](function(_0xda8614){logger[_0x5a9c('0x1a')](_0x5a9c('0x24'),_0xda8614[_0x5a9c('0x1b')],_0x3d9771);_0x1ee453(_0x687911[_0x5a9c('0x1a')](0x1f4,_0xda8614[_0x5a9c('0x1b')]));});});}; \ No newline at end of file +var _0x6e41=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./squareProject.socket','register','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ShowSquareProject','SquareProject','find','options','raw','attributes','include','map','model','info','catch','lodash','util','moment','bluebird'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x6e41,0x1c3));var _0x16e4=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x6e41[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x16e4('0x0'));var util=require(_0x16e4('0x1'));var moment=require(_0x16e4('0x2'));var BPromise=require(_0x16e4('0x3'));var rs=require(_0x16e4('0x4'));var fs=require('fs');var Redis=require(_0x16e4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x16e4('0x6'))(_0x16e4('0x7'));var config=require('../../config/environment');var jayson=require(_0x16e4('0x8'));var client=jayson[_0x16e4('0x9')][_0x16e4('0xa')]({'port':0x232a});config[_0x16e4('0xb')]=_[_0x16e4('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x16e4('0xb')]));require(_0x16e4('0xd'))[_0x16e4('0xe')](socket);function respondWithRpcPromise(_0x31069b,_0x3b2cf8,_0x3bb1e0){return new BPromise(function(_0x27e025,_0x34abd5){return client['request'](_0x31069b,_0x3bb1e0)[_0x16e4('0xf')](function(_0xf8bc05){logger['info'](_0x16e4('0x10'),_0x3b2cf8,_0x16e4('0x11'));logger[_0x16e4('0x12')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x3b2cf8,_0x16e4('0x11'),JSON[_0x16e4('0x13')](_0xf8bc05));if(_0xf8bc05['error']){if(_0xf8bc05[_0x16e4('0x14')][_0x16e4('0x15')]===0x1f4){logger[_0x16e4('0x14')](_0x16e4('0x10'),_0x3b2cf8,_0xf8bc05[_0x16e4('0x14')][_0x16e4('0x16')]);return _0x34abd5(_0xf8bc05[_0x16e4('0x14')][_0x16e4('0x16')]);}logger[_0x16e4('0x14')]('SquareProject,\x20%s,\x20%s',_0x3b2cf8,_0xf8bc05['error'][_0x16e4('0x16')]);return _0x27e025(_0xf8bc05[_0x16e4('0x14')][_0x16e4('0x16')]);}else{logger['info']('SquareProject,\x20%s,\x20%s',_0x3b2cf8,'request\x20sent');_0x27e025(_0xf8bc05[_0x16e4('0x17')][_0x16e4('0x16')]);}})['catch'](function(_0x5240e6){logger[_0x16e4('0x14')](_0x16e4('0x10'),_0x3b2cf8,_0x5240e6);_0x34abd5(_0x5240e6);});});}exports[_0x16e4('0x18')]=function(_0x3ed398){var _0x44bb3c=this;return new Promise(function(_0x4adc99,_0x29d4d4){return db[_0x16e4('0x19')][_0x16e4('0x1a')]({'raw':_0x3ed398['options']?_0x3ed398[_0x16e4('0x1b')][_0x16e4('0x1c')]===undefined?!![]:![]:!![],'where':_0x3ed398['options']?_0x3ed398[_0x16e4('0x1b')]['where']||null:null,'attributes':_0x3ed398['options']?_0x3ed398[_0x16e4('0x1b')][_0x16e4('0x1d')]||null:null,'include':_0x3ed398['options']?_0x3ed398[_0x16e4('0x1b')][_0x16e4('0x1e')]?_[_0x16e4('0x1f')](_0x3ed398[_0x16e4('0x1b')][_0x16e4('0x1e')],function(_0x9f76f9){return{'model':db[_0x9f76f9[_0x16e4('0x20')]],'as':_0x9f76f9['as'],'attributes':_0x9f76f9[_0x16e4('0x1d')],'include':_0x9f76f9[_0x16e4('0x1e')]?_[_0x16e4('0x1f')](_0x9f76f9[_0x16e4('0x1e')],function(_0x2bcd36){return{'model':db[_0x2bcd36[_0x16e4('0x20')]],'as':_0x2bcd36['as'],'attributes':_0x2bcd36[_0x16e4('0x1d')],'include':_0x2bcd36[_0x16e4('0x1e')]?_[_0x16e4('0x1f')](_0x2bcd36['include'],function(_0x308937){return{'model':db[_0x308937[_0x16e4('0x20')]],'as':_0x308937['as'],'attributes':_0x308937[_0x16e4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x16e4('0xf')](function(_0x35565e){logger[_0x16e4('0x21')](_0x16e4('0x18'),_0x3ed398);logger['debug'](_0x16e4('0x18'),_0x3ed398,JSON[_0x16e4('0x13')](_0x35565e));_0x4adc99(_0x35565e);})[_0x16e4('0x22')](function(_0x22a98d){logger[_0x16e4('0x14')](_0x16e4('0x18'),_0x22a98d[_0x16e4('0x16')],_0x3ed398);_0x29d4d4(_0x44bb3c['error'](0x1f4,_0x22a98d[_0x16e4('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 0140763..ed48625 100644 --- a/server/api/squareProject/squareProject.socket.js +++ b/server/api/squareProject/squareProject.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdbd=['removeListener','squareProject:','./squareProject.events','save','remove','update','emit'];(function(_0x221ef2,_0x2f4b12){var _0x3665a3=function(_0x4899f1){while(--_0x4899f1){_0x221ef2['push'](_0x221ef2['shift']());}};_0x3665a3(++_0x2f4b12);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x580971,_0x10984d){_0x580971=_0x580971-0x0;var _0x16d873=_0xfdbd[_0x580971];return _0x16d873;};'use strict';var SquareProjectEvents=require(_0xdfdb('0x0'));var events=[_0xdfdb('0x1'),_0xdfdb('0x2'),_0xdfdb('0x3')];function createListener(_0x28f05d,_0x3078f0){return function(_0x11218a){_0x3078f0[_0xdfdb('0x4')](_0x28f05d,_0x11218a);};}function removeListener(_0x330ad3,_0x5945e0){return function(){SquareProjectEvents[_0xdfdb('0x5')](_0x330ad3,_0x5945e0);};}exports['register']=function(_0x453ef6){for(var _0x41bd5e=0x0,_0x489f19=events['length'];_0x41bd5e<_0x489f19;_0x41bd5e++){var _0x590b5d=events[_0x41bd5e];var _0x188508=createListener(_0xdfdb('0x6')+_0x590b5d,_0x453ef6);SquareProjectEvents['on'](_0x590b5d,_0x188508);}}; \ No newline at end of file +var _0xacf4=['removeListener','register','length','remove','update','emit'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xacf4,0xe7));var _0x4acf=function(_0x16dc15,_0x5188db){_0x16dc15=_0x16dc15-0x0;var _0x58da19=_0xacf4[_0x16dc15];return _0x58da19;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0x4acf('0x0'),_0x4acf('0x1')];function createListener(_0x1e2413,_0x21fb75){return function(_0x25709c){_0x21fb75[_0x4acf('0x2')](_0x1e2413,_0x25709c);};}function removeListener(_0x145264,_0x5cf22d){return function(){SquareProjectEvents[_0x4acf('0x3')](_0x145264,_0x5cf22d);};}exports[_0x4acf('0x4')]=function(_0x4e0c43){for(var _0x24bf24=0x0,_0x2ba08a=events[_0x4acf('0x5')];_0x24bf24<_0x2ba08a;_0x24bf24++){var _0x45a5a4=events[_0x24bf24];var _0x25d345=createListener('squareProject:'+_0x45a5a4,_0x4e0c43);SquareProjectEvents['on'](_0x45a5a4,_0x25d345);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 0ae5fb9..1a61d56 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['show','/:id/download','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id'];(function(_0x31beca,_0x432ceb){var _0x5902e0=function(_0x1d6484){while(--_0x1d6484){_0x31beca['push'](_0x31beca['shift']());}};_0x5902e0(++_0x432ceb);}(_0x2032,0xd9));var _0x2203=function(_0x273da1,_0x145e09){_0x273da1=_0x273da1-0x0;var _0x4645ba=_0x2032[_0x273da1];return _0x4645ba;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var auth=require(_0x2203('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2203('0x5'));var controller=require(_0x2203('0x6'));router[_0x2203('0x7')]('/',auth[_0x2203('0x8')](),controller[_0x2203('0x9')]);router[_0x2203('0x7')](_0x2203('0xa'),auth[_0x2203('0x8')](),controller[_0x2203('0xb')]);router[_0x2203('0x7')](_0x2203('0xc'),auth['isAuthenticated'](),controller['download']);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller[_0x2203('0xe')]);router[_0x2203('0xf')](_0x2203('0xa'),auth['isAuthenticated'](),controller[_0x2203('0x10')]);router['delete'](_0x2203('0xa'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);module[_0x2203('0x12')]=router; \ No newline at end of file +var _0x2ef3=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','post','create','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x2ef3,0xba));var _0x32ef=function(_0x29423d,_0x415a6b){_0x29423d=_0x29423d-0x0;var _0xb9d78=_0x2ef3[_0x29423d];return _0xb9d78;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./squareRecording.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0x8')](_0x32ef('0xc'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0xe')]('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0xf')]);router['put']('/:id',auth[_0x32ef('0x9')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')](_0x32ef('0xa'),auth['isAuthenticated'](),controller[_0x32ef('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index a3e625c..4b8e9b5 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4eb8=['sequelize','exports','STRING'];(function(_0x21ba7d,_0x3721f1){var _0x1445b6=function(_0xde3c73){while(--_0xde3c73){_0x21ba7d['push'](_0x21ba7d['shift']());}};_0x1445b6(++_0x3721f1);}(_0x4eb8,0x15c));var _0x84eb=function(_0x414e73,_0x57569f){_0x414e73=_0x414e73-0x0;var _0x5c3cba=_0x4eb8[_0x414e73];return _0x5c3cba;};'use strict';var Sequelize=require(_0x84eb('0x0'));module[_0x84eb('0x1')]={'uniqueid':{'type':Sequelize[_0x84eb('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x84eb('0x2')]},'context':{'type':Sequelize[_0x84eb('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x84eb('0x2')]},'projectName':{'type':Sequelize[_0x84eb('0x2')]},'saveName':{'type':Sequelize[_0x84eb('0x2')]},'filename':{'type':Sequelize[_0x84eb('0x2')]},'savePath':{'type':Sequelize[_0x84eb('0x2')]}}; \ No newline at end of file +var _0xf3f5=['exports','STRING','sequelize'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0xf3f5,0xfe));var _0x5f3f=function(_0x3cbcf9,_0x2826ca){_0x3cbcf9=_0x3cbcf9-0x0;var _0x5222e9=_0xf3f5[_0x3cbcf9];return _0x5222e9;};'use strict';var Sequelize=require(_0x5f3f('0x0'));module[_0x5f3f('0x1')]={'uniqueid':{'type':Sequelize[_0x5f3f('0x2')]},'callerid':{'type':Sequelize[_0x5f3f('0x2')]},'calleridname':{'type':Sequelize[_0x5f3f('0x2')]},'context':{'type':Sequelize[_0x5f3f('0x2')]},'extension':{'type':Sequelize[_0x5f3f('0x2')]},'priority':{'type':Sequelize[_0x5f3f('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x5f3f('0x2')]},'projectName':{'type':Sequelize[_0x5f3f('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x5f3f('0x2')]},'savePath':{'type':Sequelize[_0x5f3f('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 4875846..c0e20c2 100644 --- a/server/api/squareRecording/squareRecording.controller.js +++ b/server/api/squareRecording/squareRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2da=['rows','show','rawAttributes','length','catch','create','body','find','params','destroy','download','../../components/encryptor','type','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','send','Not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','error','stack','name','index','SquareRecording','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','key','field','options','include','findAll'];(function(_0x2a6a66,_0x44978f){var _0x31f742=function(_0x3fef0a){while(--_0x3fef0a){_0x2a6a66['push'](_0x2a6a66['shift']());}};_0x31f742(++_0x44978f);}(_0xc2da,0x181));var _0xac2d=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xc2da[_0x5e3b04];return _0x1fc44d;};'use strict';var pdf=require(_0xac2d('0x0'));var emlformat=require(_0xac2d('0x1'));var rimraf=require(_0xac2d('0x2'));var zipdir=require(_0xac2d('0x3'));var jsonpatch=require(_0xac2d('0x4'));var rp=require(_0xac2d('0x5'));var moment=require('moment');var BPromise=require(_0xac2d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xac2d('0x7'));var sox=require(_0xac2d('0x8'));var csv=require(_0xac2d('0x9'));var ejs=require(_0xac2d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xac2d('0xb'));var crypto=require(_0xac2d('0xc'));var jsforce=require(_0xac2d('0xd'));var deskjs=require(_0xac2d('0xe'));var toCsv=require(_0xac2d('0x9'));var querystring=require(_0xac2d('0xf'));var Papa=require(_0xac2d('0x10'));var Redis=require(_0xac2d('0x11'));var authService=require(_0xac2d('0x12'));var qs=require(_0xac2d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac2d('0x14'))(_0xac2d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xac2d('0x16'))['db'];function respondWithStatusCode(_0x6b47c0,_0x2d0832){_0x2d0832=_0x2d0832||0xcc;return function(_0x8cc196){if(_0x8cc196){return _0x6b47c0[_0xac2d('0x17')](_0x2d0832);}return _0x6b47c0[_0xac2d('0x18')](_0x2d0832)[_0xac2d('0x19')]();};}function respondWithResult(_0x7ea50f,_0x108c93){_0x108c93=_0x108c93||0xc8;return function(_0x53ceaf){if(_0x53ceaf){return _0x7ea50f[_0xac2d('0x18')](_0x108c93)[_0xac2d('0x1a')](_0x53ceaf);}};}function respondWithFilteredResult(_0x526b3e,_0x352cbd){return function(_0x2c7bad){if(_0x2c7bad){var _0x57e3ed=_0x2c7bad[_0xac2d('0x1b')],_0x3c387c=_0x352cbd['offset'],_0x34eea7=_0x352cbd[_0xac2d('0x1c')]+_0x352cbd[_0xac2d('0x1d')],_0x2eb386;if(_0x34eea7>=_0x57e3ed){_0x34eea7=_0x57e3ed;_0x2eb386=0xc8;}else{_0x2eb386=0xce;}_0x526b3e[_0xac2d('0x18')](_0x2eb386);return _0x526b3e[_0xac2d('0x1e')]('Content-Range',_0x3c387c+'-'+_0x34eea7+'/'+_0x57e3ed)[_0xac2d('0x1a')](_0x2c7bad);}return null;};}function patchUpdates(_0x1835c6){return function(_0x25d61e){try{jsonpatch['apply'](_0x25d61e,_0x1835c6,!![]);}catch(_0x5d4534){return BPromise[_0xac2d('0x1f')](_0x5d4534);}return _0x25d61e[_0xac2d('0x20')]();};}function saveUpdates(_0x44a876,_0x56bd3b){return function(_0x13fdce){if(_0x13fdce){return _0x13fdce[_0xac2d('0x21')](_0x44a876)[_0xac2d('0x22')](function(_0x2a9c0d){return _0x2a9c0d;});}return null;};}function removeEntity(_0x2750a4,_0x5eca6d){return function(_0x10da62){if(_0x10da62){return _0x10da62['destroy']()['then'](function(){_0x2750a4[_0xac2d('0x18')](0xcc)[_0xac2d('0x19')]();});}};}function handleEntityNotFound(_0x51d7f8,_0x2e4abd){return function(_0x2165e6){if(!_0x2165e6){_0x51d7f8[_0xac2d('0x17')](0x194);}return _0x2165e6;};}function handleError(_0x48b3d3,_0x57cba4){_0x57cba4=_0x57cba4||0x1f4;return function(_0x320b11){logger[_0xac2d('0x23')](_0x320b11[_0xac2d('0x24')]);if(_0x320b11['name']){delete _0x320b11[_0xac2d('0x25')];}_0x48b3d3[_0xac2d('0x18')](_0x57cba4)['send'](_0x320b11);};}exports[_0xac2d('0x26')]=function(_0x42e417,_0x175e8f){var _0x5d72be={},_0x3b7726={},_0x537611={'count':0x0,'rows':[]};var _0x2b6100=db[_0xac2d('0x27')]['rawAttributes'];_0x3b7726[_0xac2d('0x28')]=_[_0xac2d('0x29')](_0x2b6100);_0x3b7726[_0xac2d('0x2a')]=_['keys'](_0x42e417[_0xac2d('0x2a')]);_0x3b7726[_0xac2d('0x2b')]=_[_0xac2d('0x2c')](_0x3b7726[_0xac2d('0x28')],_0x3b7726[_0xac2d('0x2a')]);_0x5d72be[_0xac2d('0x2d')]=_[_0xac2d('0x2c')](_0x3b7726[_0xac2d('0x28')],qs[_0xac2d('0x2e')](_0x42e417[_0xac2d('0x2a')][_0xac2d('0x2e')]));_0x5d72be[_0xac2d('0x2d')]=_0x5d72be['attributes']['length']?_0x5d72be['attributes']:_0x3b7726[_0xac2d('0x28')];if(!_0x42e417['query'][_0xac2d('0x2f')](_0xac2d('0x30'))){_0x5d72be[_0xac2d('0x1d')]=qs[_0xac2d('0x1d')](_0x42e417['query'][_0xac2d('0x1d')]);_0x5d72be[_0xac2d('0x1c')]=qs[_0xac2d('0x1c')](_0x42e417[_0xac2d('0x2a')][_0xac2d('0x1c')]);}_0x5d72be['order']=qs[_0xac2d('0x31')](_0x42e417[_0xac2d('0x2a')][_0xac2d('0x31')]);_0x5d72be[_0xac2d('0x32')]=qs['filters'](_[_0xac2d('0x33')](_0x42e417['query'],_0x3b7726[_0xac2d('0x2b')]));if(_0x42e417[_0xac2d('0x2a')][_0xac2d('0x34')]){_0x5d72be[_0xac2d('0x32')]=_[_0xac2d('0x35')](_0x5d72be[_0xac2d('0x32')],{'$or':_[_0xac2d('0x36')](_0x2b6100,function(_0x1c50e5){if(_0x1c50e5['type'][_0xac2d('0x37')]!=='VIRTUAL'){var _0x675ae2={};_0x675ae2[_0x1c50e5[_0xac2d('0x38')]]={'$like':'%'+_0x42e417[_0xac2d('0x2a')]['filter']+'%'};return _0x675ae2;}})});}_0x5d72be=_[_0xac2d('0x35')]({},_0x5d72be,_0x42e417[_0xac2d('0x39')]);var _0x1a7bf3={'where':_0x5d72be[_0xac2d('0x32')]};return db[_0xac2d('0x27')][_0xac2d('0x1b')](_0x1a7bf3)[_0xac2d('0x22')](function(_0x298ea3){_0x537611['count']=_0x298ea3;if(_0x42e417[_0xac2d('0x2a')]['includeAll']){_0x5d72be[_0xac2d('0x3a')]=[{'all':!![]}];}return db[_0xac2d('0x27')][_0xac2d('0x3b')](_0x5d72be);})[_0xac2d('0x22')](function(_0x3065c4){_0x537611[_0xac2d('0x3c')]=_0x3065c4;return _0x537611;})[_0xac2d('0x22')](respondWithFilteredResult(_0x175e8f,_0x5d72be))['catch'](handleError(_0x175e8f,null));};exports[_0xac2d('0x3d')]=function(_0x2fa54d,_0x3753c5){var _0xb9be5c={'raw':!![],'where':{'id':_0x2fa54d['params']['id']}},_0x1909ee={};_0x1909ee['model']=_[_0xac2d('0x29')](db[_0xac2d('0x27')][_0xac2d('0x3e')]);_0x1909ee[_0xac2d('0x2a')]=_[_0xac2d('0x29')](_0x2fa54d[_0xac2d('0x2a')]);_0x1909ee['filters']=_[_0xac2d('0x2c')](_0x1909ee[_0xac2d('0x28')],_0x1909ee[_0xac2d('0x2a')]);_0xb9be5c['attributes']=_['intersection'](_0x1909ee['model'],qs[_0xac2d('0x2e')](_0x2fa54d[_0xac2d('0x2a')][_0xac2d('0x2e')]));_0xb9be5c[_0xac2d('0x2d')]=_0xb9be5c[_0xac2d('0x2d')][_0xac2d('0x3f')]?_0xb9be5c[_0xac2d('0x2d')]:_0x1909ee[_0xac2d('0x28')];if(_0x2fa54d[_0xac2d('0x2a')]['includeAll']){_0xb9be5c['include']=[{'all':!![]}];}_0xb9be5c=_[_0xac2d('0x35')]({},_0xb9be5c,_0x2fa54d[_0xac2d('0x39')]);return db[_0xac2d('0x27')]['find'](_0xb9be5c)[_0xac2d('0x22')](handleEntityNotFound(_0x3753c5,null))[_0xac2d('0x22')](respondWithResult(_0x3753c5,null))[_0xac2d('0x40')](handleError(_0x3753c5,null));};exports['create']=function(_0x564b4c,_0x3649a1){return db[_0xac2d('0x27')][_0xac2d('0x41')](_0x564b4c[_0xac2d('0x42')],{})[_0xac2d('0x22')](respondWithResult(_0x3649a1,0xc9))[_0xac2d('0x40')](handleError(_0x3649a1,null));};exports['update']=function(_0x1e2c09,_0x2263f6){if(_0x1e2c09[_0xac2d('0x42')]['id']){delete _0x1e2c09[_0xac2d('0x42')]['id'];}return db[_0xac2d('0x27')][_0xac2d('0x43')]({'where':{'id':_0x1e2c09[_0xac2d('0x44')]['id']}})[_0xac2d('0x22')](handleEntityNotFound(_0x2263f6,null))[_0xac2d('0x22')](saveUpdates(_0x1e2c09[_0xac2d('0x42')],null))[_0xac2d('0x22')](respondWithResult(_0x2263f6,null))[_0xac2d('0x40')](handleError(_0x2263f6,null));};exports[_0xac2d('0x45')]=function(_0x11923a,_0x49ec7d){return db[_0xac2d('0x27')][_0xac2d('0x43')]({'where':{'id':_0x11923a[_0xac2d('0x44')]['id']}})[_0xac2d('0x22')](handleEntityNotFound(_0x49ec7d,null))[_0xac2d('0x22')](removeEntity(_0x49ec7d,null))[_0xac2d('0x40')](handleError(_0x49ec7d,null));};exports[_0xac2d('0x46')]=function(_0x2c7107,_0x56e0ee,_0x3e22c4){var _0x213a97=require(_0xac2d('0x47'));var _0x4eb376=![];var _0x1ba015={};if(_0x2c7107[_0xac2d('0x2a')][_0xac2d('0x48')]&&_0x2c7107[_0xac2d('0x2a')][_0xac2d('0x48')]===_0xac2d('0x49')){_0x1ba015[_0xac2d('0x49')]=_0x2c7107[_0xac2d('0x44')]['id'];}else{_0x1ba015['id']=_0x2c7107['params']['id'];}return db[_0xac2d('0x27')]['find']({'where':_0x1ba015,'attributes':['id',_0xac2d('0x4a'),_0xac2d('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x56e0ee,null))[_0xac2d('0x22')](function(_0x4ae778){if(_0x4ae778){var _0x1a9ce7=_0x4ae778['savePath'];var _0x571c35=util[_0xac2d('0x4c')](_0xac2d('0x4d'),_0x1a9ce7);if(fs[_0xac2d('0x4e')](_0x571c35)){_0x4eb376=!![];return _0x213a97[_0xac2d('0x4f')](_0x571c35,_0x1a9ce7,config[_0xac2d('0x50')][_0xac2d('0x51')])[_0xac2d('0x22')](function(){return _0x4ae778;});}return _0x4ae778;}})[_0xac2d('0x22')](function(_0x1424a9){if(_0x1424a9){var _0x121d33=_0x1424a9[_0xac2d('0x4a')];if(!fs[_0xac2d('0x4e')](_0x121d33)){throw new db[(_0xac2d('0x52'))][(_0xac2d('0x53'))](_0xac2d('0x54'));}if(_0x1424a9['filename']){return _0x56e0ee[_0xac2d('0x46')](_0x121d33,_0x1424a9['filename']+path['extname'](_0x121d33),function(){if(_0x4eb376){fs[_0xac2d('0x55')](_0x121d33);}});}else{return _0x56e0ee[_0xac2d('0x46')](_0x121d33,function(_0x14b248){if(_0x4eb376){fs[_0xac2d('0x55')](_0x121d33);}});}}})[_0xac2d('0x40')](function(_0x2ee3f6){if(_0x2ee3f6[_0xac2d('0x56')]===_0xac2d('0x54')){_0x56e0ee[_0xac2d('0x18')](0x194)[_0xac2d('0x57')](_0xac2d('0x58'));}else{return handleError(_0x56e0ee,null);}});}; \ No newline at end of file +var _0x2862=['secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','SquareRecording','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','pick','filter','map','type','key','field','options','where','include','rows','catch','show','params','includeAll','merge','find','create','body','destroy','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync'];(function(_0x11a962,_0x3cc338){var _0x55d423=function(_0xf4b236){while(--_0xf4b236){_0x11a962['push'](_0x11a962['shift']());}};_0x55d423(++_0x3cc338);}(_0x2862,0x179));var _0x2286=function(_0xe07b5a,_0x49dca5){_0xe07b5a=_0xe07b5a-0x0;var _0x46c34a=_0x2862[_0xe07b5a];return _0x46c34a;};'use strict';var pdf=require(_0x2286('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2286('0x1'));var jsonpatch=require(_0x2286('0x2'));var rp=require(_0x2286('0x3'));var moment=require(_0x2286('0x4'));var BPromise=require(_0x2286('0x5'));var Mustache=require('mustache');var util=require(_0x2286('0x6'));var path=require(_0x2286('0x7'));var sox=require(_0x2286('0x8'));var csv=require('to-csv');var ejs=require(_0x2286('0x9'));var fs=require('fs');var _=require(_0x2286('0xa'));var squel=require(_0x2286('0xb'));var crypto=require(_0x2286('0xc'));var jsforce=require(_0x2286('0xd'));var deskjs=require(_0x2286('0xe'));var toCsv=require(_0x2286('0xf'));var querystring=require(_0x2286('0x10'));var Papa=require(_0x2286('0x11'));var Redis=require(_0x2286('0x12'));var authService=require(_0x2286('0x13'));var qs=require(_0x2286('0x14'));var hardwareService=require(_0x2286('0x15'));var logger=require(_0x2286('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x2286('0x17'));var db=require(_0x2286('0x18'))['db'];function respondWithStatusCode(_0x3bc03b,_0x3d16f7){_0x3d16f7=_0x3d16f7||0xcc;return function(_0x259e99){if(_0x259e99){return _0x3bc03b['sendStatus'](_0x3d16f7);}return _0x3bc03b[_0x2286('0x19')](_0x3d16f7)[_0x2286('0x1a')]();};}function respondWithResult(_0x2d3d50,_0x4c39e5){_0x4c39e5=_0x4c39e5||0xc8;return function(_0x3f497b){if(_0x3f497b){return _0x2d3d50[_0x2286('0x19')](_0x4c39e5)[_0x2286('0x1b')](_0x3f497b);}};}function respondWithFilteredResult(_0xf704b,_0x585be4){return function(_0x3caf5b){if(_0x3caf5b){var _0x2d6698=_0x3caf5b[_0x2286('0x1c')],_0x1cef98=_0x585be4[_0x2286('0x1d')],_0x36b46d=_0x585be4[_0x2286('0x1d')]+_0x585be4[_0x2286('0x1e')],_0x4c86ed;if(_0x36b46d>=_0x2d6698){_0x36b46d=_0x2d6698;_0x4c86ed=0xc8;}else{_0x4c86ed=0xce;}_0xf704b[_0x2286('0x19')](_0x4c86ed);return _0xf704b[_0x2286('0x1f')](_0x2286('0x20'),_0x1cef98+'-'+_0x36b46d+'/'+_0x2d6698)[_0x2286('0x1b')](_0x3caf5b);}return null;};}function patchUpdates(_0x44006b){return function(_0x13ba5e){try{jsonpatch[_0x2286('0x21')](_0x13ba5e,_0x44006b,!![]);}catch(_0x258c17){return BPromise[_0x2286('0x22')](_0x258c17);}return _0x13ba5e[_0x2286('0x23')]();};}function saveUpdates(_0x32823e,_0x3b4e5a){return function(_0x823aef){if(_0x823aef){return _0x823aef[_0x2286('0x24')](_0x32823e)[_0x2286('0x25')](function(_0x7a2ae0){return _0x7a2ae0;});}return null;};}function removeEntity(_0x50a842,_0x44c7f7){return function(_0x57bf16){if(_0x57bf16){return _0x57bf16['destroy']()[_0x2286('0x25')](function(){_0x50a842[_0x2286('0x19')](0xcc)[_0x2286('0x1a')]();});}};}function handleEntityNotFound(_0x43d52a,_0x4ecee2){return function(_0x29599d){if(!_0x29599d){_0x43d52a[_0x2286('0x26')](0x194);}return _0x29599d;};}function handleError(_0x1a3593,_0x2b0a96){_0x2b0a96=_0x2b0a96||0x1f4;return function(_0x33c594){logger[_0x2286('0x27')](_0x33c594[_0x2286('0x28')]);if(_0x33c594['name']){delete _0x33c594[_0x2286('0x29')];}_0x1a3593[_0x2286('0x19')](_0x2b0a96)[_0x2286('0x2a')](_0x33c594);};}exports[_0x2286('0x2b')]=function(_0x258c88,_0x4891bb){var _0x164421={},_0x54bbdf={},_0x1e6d34={'count':0x0,'rows':[]};var _0x454d9e=db[_0x2286('0x2c')][_0x2286('0x2d')];_0x54bbdf[_0x2286('0x2e')]=_[_0x2286('0x2f')](_0x454d9e);_0x54bbdf[_0x2286('0x30')]=_[_0x2286('0x2f')](_0x258c88[_0x2286('0x30')]);_0x54bbdf[_0x2286('0x31')]=_[_0x2286('0x32')](_0x54bbdf[_0x2286('0x2e')],_0x54bbdf['query']);_0x164421[_0x2286('0x33')]=_[_0x2286('0x32')](_0x54bbdf['model'],qs[_0x2286('0x34')](_0x258c88[_0x2286('0x30')]['fields']));_0x164421[_0x2286('0x33')]=_0x164421[_0x2286('0x33')][_0x2286('0x35')]?_0x164421['attributes']:_0x54bbdf['model'];if(!_0x258c88[_0x2286('0x30')][_0x2286('0x36')]('nolimit')){_0x164421[_0x2286('0x1e')]=qs[_0x2286('0x1e')](_0x258c88['query'][_0x2286('0x1e')]);_0x164421[_0x2286('0x1d')]=qs['offset'](_0x258c88[_0x2286('0x30')][_0x2286('0x1d')]);}_0x164421[_0x2286('0x37')]=qs['sort'](_0x258c88[_0x2286('0x30')]['sort']);_0x164421['where']=qs[_0x2286('0x31')](_[_0x2286('0x38')](_0x258c88[_0x2286('0x30')],_0x54bbdf[_0x2286('0x31')]));if(_0x258c88[_0x2286('0x30')][_0x2286('0x39')]){_0x164421['where']=_['merge'](_0x164421['where'],{'$or':_[_0x2286('0x3a')](_0x454d9e,function(_0x5a39ce){if(_0x5a39ce[_0x2286('0x3b')][_0x2286('0x3c')]!=='VIRTUAL'){var _0xfb8020={};_0xfb8020[_0x5a39ce[_0x2286('0x3d')]]={'$like':'%'+_0x258c88[_0x2286('0x30')][_0x2286('0x39')]+'%'};return _0xfb8020;}})});}_0x164421=_['merge']({},_0x164421,_0x258c88[_0x2286('0x3e')]);var _0x7e551e={'where':_0x164421[_0x2286('0x3f')]};return db['SquareRecording'][_0x2286('0x1c')](_0x7e551e)[_0x2286('0x25')](function(_0x1b414d){_0x1e6d34[_0x2286('0x1c')]=_0x1b414d;if(_0x258c88['query']['includeAll']){_0x164421[_0x2286('0x40')]=[{'all':!![]}];}return db[_0x2286('0x2c')]['findAll'](_0x164421);})[_0x2286('0x25')](function(_0x58e7b3){_0x1e6d34[_0x2286('0x41')]=_0x58e7b3;return _0x1e6d34;})[_0x2286('0x25')](respondWithFilteredResult(_0x4891bb,_0x164421))[_0x2286('0x42')](handleError(_0x4891bb,null));};exports[_0x2286('0x43')]=function(_0x5bea89,_0x294921){var _0x12533f={'raw':!![],'where':{'id':_0x5bea89[_0x2286('0x44')]['id']}},_0xbc8107={};_0xbc8107[_0x2286('0x2e')]=_[_0x2286('0x2f')](db[_0x2286('0x2c')][_0x2286('0x2d')]);_0xbc8107['query']=_['keys'](_0x5bea89['query']);_0xbc8107[_0x2286('0x31')]=_[_0x2286('0x32')](_0xbc8107[_0x2286('0x2e')],_0xbc8107[_0x2286('0x30')]);_0x12533f[_0x2286('0x33')]=_['intersection'](_0xbc8107[_0x2286('0x2e')],qs['fields'](_0x5bea89[_0x2286('0x30')][_0x2286('0x34')]));_0x12533f['attributes']=_0x12533f[_0x2286('0x33')]['length']?_0x12533f['attributes']:_0xbc8107[_0x2286('0x2e')];if(_0x5bea89[_0x2286('0x30')][_0x2286('0x45')]){_0x12533f[_0x2286('0x40')]=[{'all':!![]}];}_0x12533f=_[_0x2286('0x46')]({},_0x12533f,_0x5bea89[_0x2286('0x3e')]);return db[_0x2286('0x2c')][_0x2286('0x47')](_0x12533f)[_0x2286('0x25')](handleEntityNotFound(_0x294921,null))[_0x2286('0x25')](respondWithResult(_0x294921,null))['catch'](handleError(_0x294921,null));};exports['create']=function(_0x1bfc4,_0x204908){return db[_0x2286('0x2c')][_0x2286('0x48')](_0x1bfc4[_0x2286('0x49')],{})[_0x2286('0x25')](respondWithResult(_0x204908,0xc9))[_0x2286('0x42')](handleError(_0x204908,null));};exports['update']=function(_0x138801,_0x398ece){if(_0x138801['body']['id']){delete _0x138801[_0x2286('0x49')]['id'];}return db[_0x2286('0x2c')][_0x2286('0x47')]({'where':{'id':_0x138801[_0x2286('0x44')]['id']}})[_0x2286('0x25')](handleEntityNotFound(_0x398ece,null))[_0x2286('0x25')](saveUpdates(_0x138801[_0x2286('0x49')],null))['then'](respondWithResult(_0x398ece,null))[_0x2286('0x42')](handleError(_0x398ece,null));};exports[_0x2286('0x4a')]=function(_0x2e6bd1,_0x7d29da){return db['SquareRecording'][_0x2286('0x47')]({'where':{'id':_0x2e6bd1[_0x2286('0x44')]['id']}})['then'](handleEntityNotFound(_0x7d29da,null))[_0x2286('0x25')](removeEntity(_0x7d29da,null))['catch'](handleError(_0x7d29da,null));};exports[_0x2286('0x4b')]=function(_0x2be1d2,_0xb26147,_0x5ce05b){var _0x4c2318=require(_0x2286('0x4c'));var _0x3b0eb2=![];var _0x2a5d40={};if(_0x2be1d2[_0x2286('0x30')][_0x2286('0x3b')]&&_0x2be1d2[_0x2286('0x30')]['type']===_0x2286('0x4d')){_0x2a5d40[_0x2286('0x4d')]=_0x2be1d2[_0x2286('0x44')]['id'];}else{_0x2a5d40['id']=_0x2be1d2[_0x2286('0x44')]['id'];}return db['SquareRecording'][_0x2286('0x47')]({'where':_0x2a5d40,'attributes':['id',_0x2286('0x4e'),_0x2286('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0xb26147,null))[_0x2286('0x25')](function(_0x4ba99c){if(_0x4ba99c){var _0x50c06f=_0x4ba99c[_0x2286('0x4e')];var _0x7a55f2=util[_0x2286('0x50')](_0x2286('0x51'),_0x50c06f);if(fs[_0x2286('0x52')](_0x7a55f2)){_0x3b0eb2=!![];return _0x4c2318['decryptFile'](_0x7a55f2,_0x50c06f,config[_0x2286('0x53')][_0x2286('0x54')])[_0x2286('0x25')](function(){return _0x4ba99c;});}return _0x4ba99c;}})[_0x2286('0x25')](function(_0x366cef){if(_0x366cef){var _0x5eea4b=_0x366cef['savePath'];if(!fs[_0x2286('0x52')](_0x5eea4b)){throw new db[(_0x2286('0x55'))][(_0x2286('0x56'))](_0x2286('0x57'));}if(_0x366cef[_0x2286('0x4f')]){return _0xb26147[_0x2286('0x4b')](_0x5eea4b,_0x366cef[_0x2286('0x4f')]+path[_0x2286('0x58')](_0x5eea4b),function(){if(_0x3b0eb2){fs['unlink'](_0x5eea4b);}});}else{return _0xb26147['download'](_0x5eea4b,function(_0x10769b){if(_0x3b0eb2){fs[_0x2286('0x59')](_0x5eea4b);}});}}})[_0x2286('0x42')](function(_0x3eff16){if(_0x3eff16[_0x2286('0x5a')]===_0x2286('0x57')){_0xb26147[_0x2286('0x19')](0x194)[_0x2286('0x2a')](_0x2286('0x5b'));}else{return handleError(_0xb26147,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 33f30f6..3541fbf 100644 --- a/server/api/squareRecording/squareRecording.model.js +++ b/server/api/squareRecording/squareRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73a1=['square_recordings','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareRecording'];(function(_0x5359e1,_0x21ffa3){var _0x484bc6=function(_0xa2860a){while(--_0xa2860a){_0x5359e1['push'](_0x5359e1['shift']());}};_0x484bc6(++_0x21ffa3);}(_0x73a1,0x161));var _0x173a=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0x73a1[_0x58547b];return _0x1d3fd2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x173a('0x0'))(_0x173a('0x1'));var moment=require('moment');var BPromise=require(_0x173a('0x2'));var rp=require(_0x173a('0x3'));var fs=require('fs');var path=require(_0x173a('0x4'));var rimraf=require(_0x173a('0x5'));var config=require(_0x173a('0x6'));var attributes=require('./squareRecording.attributes');module[_0x173a('0x7')]=function(_0x1a8b94,_0xac84a){return _0x1a8b94[_0x173a('0x8')](_0x173a('0x9'),attributes,{'tableName':_0x173a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7880=['../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3a7a0a,_0x29db7f){var _0x12ecc9=function(_0x1e4b8e){while(--_0x1e4b8e){_0x3a7a0a['push'](_0x3a7a0a['shift']());}};_0x12ecc9(++_0x29db7f);}(_0x7880,0x1f4));var _0x0788=function(_0x255be9,_0x3345d9){_0x255be9=_0x255be9-0x0;var _0x34fedf=_0x7880[_0x255be9];return _0x34fedf;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var logger=require(_0x0788('0x1'))(_0x0788('0x2'));var moment=require(_0x0788('0x3'));var BPromise=require(_0x0788('0x4'));var rp=require(_0x0788('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var attributes=require(_0x0788('0x8'));module[_0x0788('0x9')]=function(_0x262f5c,_0x775629){return _0x262f5c[_0x0788('0xa')](_0x0788('0xb'),attributes,{'tableName':_0x0788('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 82cbf29..00e3e6f 100644 --- a/server/api/squareRecording/squareRecording.rpc.js +++ b/server/api/squareRecording/squareRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3fc=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','body','raw','lodash','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0xc3fc,0x1ab));var _0xcc3f=function(_0x50c780,_0x18644e){_0x50c780=_0x50c780-0x0;var _0x29bb25=_0xc3fc[_0x50c780];return _0x29bb25;};'use strict';var _=require(_0xcc3f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcc3f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc3f('0x2'));var db=require(_0xcc3f('0x3'))['db'];var utils=require(_0xcc3f('0x4'));var logger=require(_0xcc3f('0x5'))(_0xcc3f('0x6'));var config=require('../../config/environment');var jayson=require(_0xcc3f('0x7'));var client=jayson[_0xcc3f('0x8')][_0xcc3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x355070,_0x50b233,_0x515ce3){return new BPromise(function(_0xeb100c,_0x468f54){return client[_0xcc3f('0xa')](_0x355070,_0x515ce3)[_0xcc3f('0xb')](function(_0x18cf11){logger[_0xcc3f('0xc')](_0xcc3f('0xd'),_0x50b233,_0xcc3f('0xe'));logger[_0xcc3f('0xf')](_0xcc3f('0x10'),_0x50b233,'request\x20sent',JSON[_0xcc3f('0x11')](_0x18cf11));if(_0x18cf11[_0xcc3f('0x12')]){if(_0x18cf11[_0xcc3f('0x12')][_0xcc3f('0x13')]===0x1f4){logger[_0xcc3f('0x12')]('SquareRecording,\x20%s,\x20%s',_0x50b233,_0x18cf11['error'][_0xcc3f('0x14')]);return _0x468f54(_0x18cf11[_0xcc3f('0x12')][_0xcc3f('0x14')]);}logger[_0xcc3f('0x12')](_0xcc3f('0xd'),_0x50b233,_0x18cf11[_0xcc3f('0x12')][_0xcc3f('0x14')]);return _0xeb100c(_0x18cf11[_0xcc3f('0x12')]['message']);}else{logger[_0xcc3f('0xc')](_0xcc3f('0xd'),_0x50b233,_0xcc3f('0xe'));_0xeb100c(_0x18cf11[_0xcc3f('0x15')][_0xcc3f('0x14')]);}})[_0xcc3f('0x16')](function(_0x1068e9){logger['error'](_0xcc3f('0xd'),_0x50b233,_0x1068e9);_0x468f54(_0x1068e9);});});}exports[_0xcc3f('0x17')]=function(_0x38247c){var _0x47b9c6=this;return new Promise(function(_0x5f17ce,_0x1f8b9b){return db[_0xcc3f('0x18')]['create'](_0x38247c[_0xcc3f('0x19')],{'raw':_0x38247c['options']?_0x38247c['options'][_0xcc3f('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x181e64){logger['info'](_0xcc3f('0x17'),_0x38247c);logger[_0xcc3f('0xf')]('CreateSquareRecording',_0x38247c,JSON['stringify'](_0x181e64));_0x5f17ce(_0x181e64);})['catch'](function(_0x31ca05){logger[_0xcc3f('0x12')](_0xcc3f('0x17'),_0x31ca05[_0xcc3f('0x14')],_0x38247c);_0x1f8b9b(_0x47b9c6[_0xcc3f('0x12')](0x1f4,_0x31ca05['message']));});});}; \ No newline at end of file +var _0x5f51=['then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','SquareRecording','options','CreateSquareRecording','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x571d83,_0x4cb677){var _0x36e67f=function(_0x39022b){while(--_0x39022b){_0x571d83['push'](_0x571d83['shift']());}};_0x36e67f(++_0x4cb677);}(_0x5f51,0xde));var _0x15f5=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f51[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x15f5('0x0'));var util=require('util');var moment=require(_0x15f5('0x1'));var BPromise=require(_0x15f5('0x2'));var rs=require(_0x15f5('0x3'));var fs=require('fs');var Redis=require(_0x15f5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x15f5('0x5'));var logger=require(_0x15f5('0x6'))(_0x15f5('0x7'));var config=require(_0x15f5('0x8'));var jayson=require(_0x15f5('0x9'));var client=jayson[_0x15f5('0xa')][_0x15f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4710ac,_0x108e91,_0x4026e5){return new BPromise(function(_0xb41a43,_0x39ca56){return client['request'](_0x4710ac,_0x4026e5)[_0x15f5('0xc')](function(_0x63fdc6){logger[_0x15f5('0xd')](_0x15f5('0xe'),_0x108e91,'request\x20sent');logger[_0x15f5('0xf')](_0x15f5('0x10'),_0x108e91,_0x15f5('0x11'),JSON[_0x15f5('0x12')](_0x63fdc6));if(_0x63fdc6[_0x15f5('0x13')]){if(_0x63fdc6[_0x15f5('0x13')]['code']===0x1f4){logger[_0x15f5('0x13')](_0x15f5('0xe'),_0x108e91,_0x63fdc6[_0x15f5('0x13')][_0x15f5('0x14')]);return _0x39ca56(_0x63fdc6[_0x15f5('0x13')][_0x15f5('0x14')]);}logger[_0x15f5('0x13')](_0x15f5('0xe'),_0x108e91,_0x63fdc6[_0x15f5('0x13')]['message']);return _0xb41a43(_0x63fdc6[_0x15f5('0x13')]['message']);}else{logger[_0x15f5('0xd')](_0x15f5('0xe'),_0x108e91,_0x15f5('0x11'));_0xb41a43(_0x63fdc6[_0x15f5('0x15')][_0x15f5('0x14')]);}})[_0x15f5('0x16')](function(_0x497618){logger[_0x15f5('0x13')](_0x15f5('0xe'),_0x108e91,_0x497618);_0x39ca56(_0x497618);});});}exports['CreateSquareRecording']=function(_0xc395c1){var _0x585d9c=this;return new Promise(function(_0x4113fb,_0x63408d){return db[_0x15f5('0x17')]['create'](_0xc395c1['body'],{'raw':_0xc395c1[_0x15f5('0x18')]?_0xc395c1[_0x15f5('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x15f5('0xc')](function(_0x5e0314){logger['info'](_0x15f5('0x19'),_0xc395c1);logger[_0x15f5('0xf')]('CreateSquareRecording',_0xc395c1,JSON['stringify'](_0x5e0314));_0x4113fb(_0x5e0314);})[_0x15f5('0x16')](function(_0x21a15c){logger[_0x15f5('0x13')](_0x15f5('0x19'),_0x21a15c[_0x15f5('0x14')],_0xc395c1);_0x63408d(_0x585d9c['error'](0x1f4,_0x21a15c[_0x15f5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 8ace0db..714952a 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3d9=['destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id','update','delete'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa3d9,0x7a));var _0x9a3d=function(_0x5c4e53,_0x5c15f7){_0x5c4e53=_0x5c4e53-0x0;var _0x581e7c=_0xa3d9[_0x5c4e53];return _0x581e7c;};'use strict';var multer=require(_0x9a3d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9a3d('0x1'));var express=require('express');var router=express[_0x9a3d('0x2')]();var auth=require(_0x9a3d('0x3'));var interaction=require(_0x9a3d('0x4'));var config=require(_0x9a3d('0x5'));var controller=require(_0x9a3d('0x6'));router[_0x9a3d('0x7')]('/',auth[_0x9a3d('0x8')](),controller[_0x9a3d('0x9')]);router[_0x9a3d('0x7')]('/describe',auth[_0x9a3d('0x8')](),controller[_0x9a3d('0xa')]);router['get']('/:id',auth[_0x9a3d('0x8')](),controller[_0x9a3d('0xb')]);router[_0x9a3d('0xc')]('/',auth[_0x9a3d('0x8')](),controller[_0x9a3d('0xd')]);router[_0x9a3d('0xe')](_0x9a3d('0xf'),auth[_0x9a3d('0x8')](),controller[_0x9a3d('0x10')]);router[_0x9a3d('0x11')]('/:id',auth[_0x9a3d('0x8')](),controller[_0x9a3d('0x12')]);module[_0x9a3d('0x13')]=router; \ No newline at end of file +var _0xa10e=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/:id','post','put','delete'];(function(_0x26dce0,_0x5f890){var _0x26a2aa=function(_0x1ab947){while(--_0x1ab947){_0x26dce0['push'](_0x26dce0['shift']());}};_0x26a2aa(++_0x5f890);}(_0xa10e,0xac));var _0xea10=function(_0x4f1c92,_0x259090){_0x4f1c92=_0x4f1c92-0x0;var _0x5570b5=_0xa10e[_0x4f1c92];return _0x5570b5;};'use strict';var multer=require(_0xea10('0x0'));var util=require(_0xea10('0x1'));var path=require(_0xea10('0x2'));var timeout=require(_0xea10('0x3'));var express=require(_0xea10('0x4'));var router=express[_0xea10('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xea10('0x6'));var controller=require(_0xea10('0x7'));router[_0xea10('0x8')]('/',auth[_0xea10('0x9')](),controller[_0xea10('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xea10('0xb'),auth[_0xea10('0x9')](),controller['show']);router[_0xea10('0xc')]('/',auth[_0xea10('0x9')](),controller['create']);router[_0xea10('0xd')]('/:id',auth[_0xea10('0x9')](),controller['update']);router[_0xea10('0xe')](_0xea10('0xb'),auth[_0xea10('0x9')](),controller[_0xea10('0xf')]);module[_0xea10('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index cbc458a..b558a08 100644 --- a/server/api/squareReport/squareReport.attributes.js +++ b/server/api/squareReport/squareReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe965=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0xe965,0xe3));var _0x5e96=function(_0x22e151,_0x507319){_0x22e151=_0x22e151-0x0;var _0x1c83ce=_0xe965[_0x22e151];return _0x1c83ce;};'use strict';var Sequelize=require(_0x5e96('0x0'));module[_0x5e96('0x1')]={'network':{'type':Sequelize[_0x5e96('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x5e96('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5e96('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5e96('0x2')]},'version':{'type':Sequelize[_0x5e96('0x2')]},'callerid':{'type':Sequelize[_0x5e96('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x5e96('0x2')]},'callington':{'type':Sequelize[_0x5e96('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x5e96('0x2')]},'rdnis':{'type':Sequelize[_0x5e96('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x5e96('0x2')]},'priority':{'type':Sequelize[_0x5e96('0x2')]},'enhanced':{'type':Sequelize[_0x5e96('0x2')]},'accountcode':{'type':Sequelize[_0x5e96('0x2')]},'threadid':{'type':Sequelize[_0x5e96('0x2')]},'project_name':{'type':Sequelize[_0x5e96('0x2')]},'joinAt':{'type':Sequelize[_0x5e96('0x3')]},'leaveAt':{'type':Sequelize[_0x5e96('0x3')]},'bot':{'type':Sequelize[_0x5e96('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x3e62=['STRING','DATE','BOOLEAN','exports'];(function(_0x1d211b,_0x475f3b){var _0x47c88b=function(_0x3126f5){while(--_0x3126f5){_0x1d211b['push'](_0x1d211b['shift']());}};_0x47c88b(++_0x475f3b);}(_0x3e62,0x1bf));var _0x23e6=function(_0x5c80f4,_0xfa4681){_0x5c80f4=_0x5c80f4-0x0;var _0x200e7e=_0x3e62[_0x5c80f4];return _0x200e7e;};'use strict';var Sequelize=require('sequelize');module[_0x23e6('0x0')]={'network':{'type':Sequelize[_0x23e6('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x23e6('0x1')]},'language':{'type':Sequelize[_0x23e6('0x1')]},'type':{'type':Sequelize[_0x23e6('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x23e6('0x1')]},'callerid':{'type':Sequelize[_0x23e6('0x1')]},'calleridname':{'type':Sequelize[_0x23e6('0x1')]},'callingpres':{'type':Sequelize[_0x23e6('0x1')]},'callingani2':{'type':Sequelize[_0x23e6('0x1')]},'callington':{'type':Sequelize[_0x23e6('0x1')]},'callingtns':{'type':Sequelize[_0x23e6('0x1')]},'dnid':{'type':Sequelize[_0x23e6('0x1')]},'rdnis':{'type':Sequelize[_0x23e6('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x23e6('0x1')]},'priority':{'type':Sequelize[_0x23e6('0x1')]},'enhanced':{'type':Sequelize[_0x23e6('0x1')]},'accountcode':{'type':Sequelize[_0x23e6('0x1')]},'threadid':{'type':Sequelize[_0x23e6('0x1')]},'project_name':{'type':Sequelize[_0x23e6('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x23e6('0x2')]},'bot':{'type':Sequelize[_0x23e6('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index f30c703..eace481 100644 --- a/server/api/squareReport/squareReport.controller.js +++ b/server/api/squareReport/squareReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5525=['SquareReport','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','include','findAll','rows','catch','rawAttributes','includeAll','find','create','body','update','params','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send'];(function(_0x28d3f8,_0x16d351){var _0x371d67=function(_0x2d8ee4){while(--_0x2d8ee4){_0x28d3f8['push'](_0x28d3f8['shift']());}};_0x371d67(++_0x16d351);}(_0x5525,0xbb));var _0x5552=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5525[_0x59ee6f];return _0x4c0979;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5552('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5552('0x1'));var jsonpatch=require(_0x5552('0x2'));var rp=require('request-promise');var moment=require(_0x5552('0x3'));var BPromise=require(_0x5552('0x4'));var Mustache=require(_0x5552('0x5'));var util=require(_0x5552('0x6'));var path=require(_0x5552('0x7'));var sox=require(_0x5552('0x8'));var csv=require(_0x5552('0x9'));var ejs=require(_0x5552('0xa'));var fs=require('fs');var _=require(_0x5552('0xb'));var squel=require(_0x5552('0xc'));var crypto=require(_0x5552('0xd'));var jsforce=require(_0x5552('0xe'));var deskjs=require(_0x5552('0xf'));var toCsv=require(_0x5552('0x9'));var querystring=require(_0x5552('0x10'));var Papa=require(_0x5552('0x11'));var Redis=require(_0x5552('0x12'));var authService=require(_0x5552('0x13'));var qs=require(_0x5552('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5552('0x15'));var utils=require(_0x5552('0x16'));var config=require(_0x5552('0x17'));var db=require(_0x5552('0x18'))['db'];function respondWithStatusCode(_0x494692,_0x5aa8dc){_0x5aa8dc=_0x5aa8dc||0xcc;return function(_0x3dc1cf){if(_0x3dc1cf){return _0x494692['sendStatus'](_0x5aa8dc);}return _0x494692[_0x5552('0x19')](_0x5aa8dc)[_0x5552('0x1a')]();};}function respondWithResult(_0x3060d2,_0x31fd50){_0x31fd50=_0x31fd50||0xc8;return function(_0x374061){if(_0x374061){return _0x3060d2[_0x5552('0x19')](_0x31fd50)[_0x5552('0x1b')](_0x374061);}};}function respondWithFilteredResult(_0x445018,_0x3b5944){return function(_0x1b64b2){if(_0x1b64b2){var _0x5aee8f=_0x1b64b2[_0x5552('0x1c')],_0x3f1f01=_0x3b5944[_0x5552('0x1d')],_0x4c8ea2=_0x3b5944['offset']+_0x3b5944[_0x5552('0x1e')],_0x5b923e;if(_0x4c8ea2>=_0x5aee8f){_0x4c8ea2=_0x5aee8f;_0x5b923e=0xc8;}else{_0x5b923e=0xce;}_0x445018[_0x5552('0x19')](_0x5b923e);return _0x445018[_0x5552('0x1f')](_0x5552('0x20'),_0x3f1f01+'-'+_0x4c8ea2+'/'+_0x5aee8f)[_0x5552('0x1b')](_0x1b64b2);}return null;};}function patchUpdates(_0x403830){return function(_0x4b0014){try{jsonpatch[_0x5552('0x21')](_0x4b0014,_0x403830,!![]);}catch(_0x89c881){return BPromise[_0x5552('0x22')](_0x89c881);}return _0x4b0014[_0x5552('0x23')]();};}function saveUpdates(_0x3eff47,_0x429ea8){return function(_0x17ab7a){if(_0x17ab7a){return _0x17ab7a['update'](_0x3eff47)[_0x5552('0x24')](function(_0x29fb8c){return _0x29fb8c;});}return null;};}function removeEntity(_0x75e044,_0x131945){return function(_0x39d9b0){if(_0x39d9b0){return _0x39d9b0['destroy']()[_0x5552('0x24')](function(){_0x75e044[_0x5552('0x19')](0xcc)[_0x5552('0x1a')]();});}};}function handleEntityNotFound(_0x316652,_0x2af752){return function(_0x5c68b1){if(!_0x5c68b1){_0x316652['sendStatus'](0x194);}return _0x5c68b1;};}function handleError(_0x35df7c,_0x65d007){_0x65d007=_0x65d007||0x1f4;return function(_0xc053e3){logger[_0x5552('0x25')](_0xc053e3[_0x5552('0x26')]);if(_0xc053e3[_0x5552('0x27')]){delete _0xc053e3[_0x5552('0x27')];}_0x35df7c[_0x5552('0x19')](_0x65d007)[_0x5552('0x28')](_0xc053e3);};}exports['index']=function(_0x1ac1aa,_0x1ac4f0){var _0x35d1e7={},_0x375aa2={},_0x127477={'count':0x0,'rows':[]};var _0x4b1e21=db[_0x5552('0x29')]['rawAttributes'];_0x375aa2[_0x5552('0x2a')]=_[_0x5552('0x2b')](_0x4b1e21);_0x375aa2[_0x5552('0x2c')]=_[_0x5552('0x2b')](_0x1ac1aa[_0x5552('0x2c')]);_0x375aa2[_0x5552('0x2d')]=_['intersection'](_0x375aa2[_0x5552('0x2a')],_0x375aa2[_0x5552('0x2c')]);_0x35d1e7['attributes']=_[_0x5552('0x2e')](_0x375aa2['model'],qs[_0x5552('0x2f')](_0x1ac1aa[_0x5552('0x2c')][_0x5552('0x2f')]));_0x35d1e7[_0x5552('0x30')]=_0x35d1e7[_0x5552('0x30')][_0x5552('0x31')]?_0x35d1e7['attributes']:_0x375aa2[_0x5552('0x2a')];if(!_0x1ac1aa['query'][_0x5552('0x32')](_0x5552('0x33'))){_0x35d1e7['limit']=qs[_0x5552('0x1e')](_0x1ac1aa['query'][_0x5552('0x1e')]);_0x35d1e7[_0x5552('0x1d')]=qs[_0x5552('0x1d')](_0x1ac1aa[_0x5552('0x2c')]['offset']);}_0x35d1e7[_0x5552('0x34')]=qs[_0x5552('0x35')](_0x1ac1aa['query']['sort']);_0x35d1e7[_0x5552('0x36')]=qs[_0x5552('0x2d')](_[_0x5552('0x37')](_0x1ac1aa['query'],_0x375aa2['filters']));if(_0x1ac1aa[_0x5552('0x2c')][_0x5552('0x38')]){_0x35d1e7['where']=_[_0x5552('0x39')](_0x35d1e7[_0x5552('0x36')],{'$or':_[_0x5552('0x3a')](_0x4b1e21,function(_0x12775e){if(_0x12775e[_0x5552('0x3b')][_0x5552('0x3c')]!==_0x5552('0x3d')){var _0x571c96={};_0x571c96[_0x12775e[_0x5552('0x3e')]]={'$like':'%'+_0x1ac1aa[_0x5552('0x2c')][_0x5552('0x38')]+'%'};return _0x571c96;}})});}_0x35d1e7=_['merge']({},_0x35d1e7,_0x1ac1aa['options']);var _0x2f3036={'where':_0x35d1e7['where']};return db[_0x5552('0x29')][_0x5552('0x1c')](_0x2f3036)[_0x5552('0x24')](function(_0x782fdb){_0x127477[_0x5552('0x1c')]=_0x782fdb;if(_0x1ac1aa[_0x5552('0x2c')]['includeAll']){_0x35d1e7[_0x5552('0x3f')]=[{'all':!![]}];}return db['SquareReport'][_0x5552('0x40')](_0x35d1e7);})[_0x5552('0x24')](function(_0x3891e0){_0x127477[_0x5552('0x41')]=_0x3891e0;return _0x127477;})[_0x5552('0x24')](respondWithFilteredResult(_0x1ac4f0,_0x35d1e7))[_0x5552('0x42')](handleError(_0x1ac4f0,null));};exports['show']=function(_0x26215a,_0x3c2060){var _0x9c5b91={'raw':!![],'where':{'id':_0x26215a['params']['id']}},_0x469e57={};_0x469e57['model']=_[_0x5552('0x2b')](db[_0x5552('0x29')][_0x5552('0x43')]);_0x469e57[_0x5552('0x2c')]=_[_0x5552('0x2b')](_0x26215a[_0x5552('0x2c')]);_0x469e57[_0x5552('0x2d')]=_['intersection'](_0x469e57[_0x5552('0x2a')],_0x469e57[_0x5552('0x2c')]);_0x9c5b91['attributes']=_[_0x5552('0x2e')](_0x469e57['model'],qs[_0x5552('0x2f')](_0x26215a['query']['fields']));_0x9c5b91['attributes']=_0x9c5b91[_0x5552('0x30')][_0x5552('0x31')]?_0x9c5b91['attributes']:_0x469e57[_0x5552('0x2a')];if(_0x26215a['query'][_0x5552('0x44')]){_0x9c5b91['include']=[{'all':!![]}];}_0x9c5b91=_[_0x5552('0x39')]({},_0x9c5b91,_0x26215a['options']);return db['SquareReport'][_0x5552('0x45')](_0x9c5b91)['then'](handleEntityNotFound(_0x3c2060,null))[_0x5552('0x24')](respondWithResult(_0x3c2060,null))['catch'](handleError(_0x3c2060,null));};exports[_0x5552('0x46')]=function(_0x9409ef,_0xf32c4){return db[_0x5552('0x29')][_0x5552('0x46')](_0x9409ef[_0x5552('0x47')],{})[_0x5552('0x24')](respondWithResult(_0xf32c4,0xc9))[_0x5552('0x42')](handleError(_0xf32c4,null));};exports[_0x5552('0x48')]=function(_0x3c6ef7,_0x4be53f){if(_0x3c6ef7['body']['id']){delete _0x3c6ef7[_0x5552('0x47')]['id'];}return db[_0x5552('0x29')][_0x5552('0x45')]({'where':{'id':_0x3c6ef7[_0x5552('0x49')]['id']}})[_0x5552('0x24')](handleEntityNotFound(_0x4be53f,null))['then'](saveUpdates(_0x3c6ef7[_0x5552('0x47')],null))[_0x5552('0x24')](respondWithResult(_0x4be53f,null))[_0x5552('0x42')](handleError(_0x4be53f,null));};exports[_0x5552('0x4a')]=function(_0x40f3eb,_0x16dfd6){return db['SquareReport'][_0x5552('0x45')]({'where':{'id':_0x40f3eb[_0x5552('0x49')]['id']}})['then'](handleEntityNotFound(_0x16dfd6,null))[_0x5552('0x24')](removeEntity(_0x16dfd6,null))['catch'](handleError(_0x16dfd6,null));};exports[_0x5552('0x4b')]=function(_0x52287d,_0x51b0be){return db[_0x5552('0x29')][_0x5552('0x4b')]()[_0x5552('0x24')](respondWithResult(_0x51b0be,null))[_0x5552('0x42')](handleError(_0x51b0be,null));}; \ No newline at end of file +var _0xdf2a=['count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','index','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','field','options','SquareReport','then','includeAll','include','findAll','rows','show','length','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x34b6c3,_0x2bd657){var _0x10a2da=function(_0x4a953c){while(--_0x4a953c){_0x34b6c3['push'](_0x34b6c3['shift']());}};_0x10a2da(++_0x2bd657);}(_0xdf2a,0x1f1));var _0xadf2=function(_0x320409,_0x22830f){_0x320409=_0x320409-0x0;var _0x1dacba=_0xdf2a[_0x320409];return _0x1dacba;};'use strict';var pdf=require(_0xadf2('0x0'));var emlformat=require(_0xadf2('0x1'));var rimraf=require(_0xadf2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xadf2('0x3'));var rp=require(_0xadf2('0x4'));var moment=require(_0xadf2('0x5'));var BPromise=require(_0xadf2('0x6'));var Mustache=require(_0xadf2('0x7'));var util=require(_0xadf2('0x8'));var path=require(_0xadf2('0x9'));var sox=require(_0xadf2('0xa'));var csv=require('to-csv');var ejs=require(_0xadf2('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xadf2('0xc'));var crypto=require('crypto');var jsforce=require(_0xadf2('0xd'));var deskjs=require(_0xadf2('0xe'));var toCsv=require(_0xadf2('0xf'));var querystring=require('querystring');var Papa=require(_0xadf2('0x10'));var Redis=require('ioredis');var authService=require(_0xadf2('0x11'));var qs=require(_0xadf2('0x12'));var hardwareService=require(_0xadf2('0x13'));var logger=require(_0xadf2('0x14'))(_0xadf2('0x15'));var utils=require(_0xadf2('0x16'));var config=require(_0xadf2('0x17'));var db=require(_0xadf2('0x18'))['db'];function respondWithStatusCode(_0x25cc87,_0x573e77){_0x573e77=_0x573e77||0xcc;return function(_0x515f2e){if(_0x515f2e){return _0x25cc87[_0xadf2('0x19')](_0x573e77);}return _0x25cc87[_0xadf2('0x1a')](_0x573e77)['end']();};}function respondWithResult(_0x3d68d0,_0x202e3d){_0x202e3d=_0x202e3d||0xc8;return function(_0x14cde4){if(_0x14cde4){return _0x3d68d0[_0xadf2('0x1a')](_0x202e3d)[_0xadf2('0x1b')](_0x14cde4);}};}function respondWithFilteredResult(_0x4cbb06,_0x73b03a){return function(_0x56f323){if(_0x56f323){var _0x36cd38=_0x56f323[_0xadf2('0x1c')],_0xc63b64=_0x73b03a[_0xadf2('0x1d')],_0x18b04a=_0x73b03a['offset']+_0x73b03a[_0xadf2('0x1e')],_0x8cc88f;if(_0x18b04a>=_0x36cd38){_0x18b04a=_0x36cd38;_0x8cc88f=0xc8;}else{_0x8cc88f=0xce;}_0x4cbb06[_0xadf2('0x1a')](_0x8cc88f);return _0x4cbb06[_0xadf2('0x1f')](_0xadf2('0x20'),_0xc63b64+'-'+_0x18b04a+'/'+_0x36cd38)[_0xadf2('0x1b')](_0x56f323);}return null;};}function patchUpdates(_0x1507f2){return function(_0x4b903e){try{jsonpatch[_0xadf2('0x21')](_0x4b903e,_0x1507f2,!![]);}catch(_0x1c834f){return BPromise[_0xadf2('0x22')](_0x1c834f);}return _0x4b903e[_0xadf2('0x23')]();};}function saveUpdates(_0xfa9886,_0x426852){return function(_0x4fe72a){if(_0x4fe72a){return _0x4fe72a[_0xadf2('0x24')](_0xfa9886)['then'](function(_0x52f11c){return _0x52f11c;});}return null;};}function removeEntity(_0xa1e422,_0x29db11){return function(_0x5c339e){if(_0x5c339e){return _0x5c339e[_0xadf2('0x25')]()['then'](function(){_0xa1e422[_0xadf2('0x1a')](0xcc)[_0xadf2('0x26')]();});}};}function handleEntityNotFound(_0xc721e1,_0x418098){return function(_0x3b781b){if(!_0x3b781b){_0xc721e1[_0xadf2('0x19')](0x194);}return _0x3b781b;};}function handleError(_0x3cc225,_0x5ec1ac){_0x5ec1ac=_0x5ec1ac||0x1f4;return function(_0x3abe73){logger[_0xadf2('0x27')](_0x3abe73[_0xadf2('0x28')]);if(_0x3abe73[_0xadf2('0x29')]){delete _0x3abe73[_0xadf2('0x29')];}_0x3cc225['status'](_0x5ec1ac)['send'](_0x3abe73);};}exports[_0xadf2('0x2a')]=function(_0x4f47f9,_0x3821b3){var _0x40683f={},_0x42033d={},_0x493739={'count':0x0,'rows':[]};var _0x1fbdea=db['SquareReport'][_0xadf2('0x2b')];_0x42033d[_0xadf2('0x2c')]=_[_0xadf2('0x2d')](_0x1fbdea);_0x42033d['query']=_[_0xadf2('0x2d')](_0x4f47f9[_0xadf2('0x2e')]);_0x42033d['filters']=_[_0xadf2('0x2f')](_0x42033d['model'],_0x42033d['query']);_0x40683f[_0xadf2('0x30')]=_[_0xadf2('0x2f')](_0x42033d[_0xadf2('0x2c')],qs[_0xadf2('0x31')](_0x4f47f9[_0xadf2('0x2e')]['fields']));_0x40683f['attributes']=_0x40683f[_0xadf2('0x30')]['length']?_0x40683f[_0xadf2('0x30')]:_0x42033d[_0xadf2('0x2c')];if(!_0x4f47f9[_0xadf2('0x2e')]['hasOwnProperty'](_0xadf2('0x32'))){_0x40683f[_0xadf2('0x1e')]=qs['limit'](_0x4f47f9[_0xadf2('0x2e')][_0xadf2('0x1e')]);_0x40683f[_0xadf2('0x1d')]=qs[_0xadf2('0x1d')](_0x4f47f9[_0xadf2('0x2e')][_0xadf2('0x1d')]);}_0x40683f[_0xadf2('0x33')]=qs[_0xadf2('0x34')](_0x4f47f9['query'][_0xadf2('0x34')]);_0x40683f[_0xadf2('0x35')]=qs['filters'](_[_0xadf2('0x36')](_0x4f47f9[_0xadf2('0x2e')],_0x42033d[_0xadf2('0x37')]));if(_0x4f47f9[_0xadf2('0x2e')][_0xadf2('0x38')]){_0x40683f['where']=_[_0xadf2('0x39')](_0x40683f[_0xadf2('0x35')],{'$or':_['map'](_0x1fbdea,function(_0x1de01b){if(_0x1de01b['type']['key']!==_0xadf2('0x3a')){var _0x4b7cc2={};_0x4b7cc2[_0x1de01b[_0xadf2('0x3b')]]={'$like':'%'+_0x4f47f9['query']['filter']+'%'};return _0x4b7cc2;}})});}_0x40683f=_[_0xadf2('0x39')]({},_0x40683f,_0x4f47f9[_0xadf2('0x3c')]);var _0x4aa2a0={'where':_0x40683f[_0xadf2('0x35')]};return db[_0xadf2('0x3d')][_0xadf2('0x1c')](_0x4aa2a0)[_0xadf2('0x3e')](function(_0x281fdc){_0x493739['count']=_0x281fdc;if(_0x4f47f9[_0xadf2('0x2e')][_0xadf2('0x3f')]){_0x40683f[_0xadf2('0x40')]=[{'all':!![]}];}return db[_0xadf2('0x3d')][_0xadf2('0x41')](_0x40683f);})[_0xadf2('0x3e')](function(_0xccebd4){_0x493739[_0xadf2('0x42')]=_0xccebd4;return _0x493739;})[_0xadf2('0x3e')](respondWithFilteredResult(_0x3821b3,_0x40683f))['catch'](handleError(_0x3821b3,null));};exports[_0xadf2('0x43')]=function(_0x5002d4,_0x1ecd0c){var _0x45affb={'raw':!![],'where':{'id':_0x5002d4['params']['id']}},_0x440243={};_0x440243[_0xadf2('0x2c')]=_[_0xadf2('0x2d')](db[_0xadf2('0x3d')]['rawAttributes']);_0x440243['query']=_[_0xadf2('0x2d')](_0x5002d4['query']);_0x440243[_0xadf2('0x37')]=_[_0xadf2('0x2f')](_0x440243['model'],_0x440243[_0xadf2('0x2e')]);_0x45affb[_0xadf2('0x30')]=_[_0xadf2('0x2f')](_0x440243[_0xadf2('0x2c')],qs[_0xadf2('0x31')](_0x5002d4[_0xadf2('0x2e')][_0xadf2('0x31')]));_0x45affb[_0xadf2('0x30')]=_0x45affb['attributes'][_0xadf2('0x44')]?_0x45affb[_0xadf2('0x30')]:_0x440243['model'];if(_0x5002d4[_0xadf2('0x2e')]['includeAll']){_0x45affb[_0xadf2('0x40')]=[{'all':!![]}];}_0x45affb=_['merge']({},_0x45affb,_0x5002d4[_0xadf2('0x3c')]);return db[_0xadf2('0x3d')][_0xadf2('0x45')](_0x45affb)[_0xadf2('0x3e')](handleEntityNotFound(_0x1ecd0c,null))[_0xadf2('0x3e')](respondWithResult(_0x1ecd0c,null))[_0xadf2('0x46')](handleError(_0x1ecd0c,null));};exports[_0xadf2('0x47')]=function(_0xaac5b8,_0xc1f072){return db[_0xadf2('0x3d')][_0xadf2('0x47')](_0xaac5b8[_0xadf2('0x48')],{})[_0xadf2('0x3e')](respondWithResult(_0xc1f072,0xc9))[_0xadf2('0x46')](handleError(_0xc1f072,null));};exports['update']=function(_0xd3449d,_0x47068d){if(_0xd3449d[_0xadf2('0x48')]['id']){delete _0xd3449d['body']['id'];}return db[_0xadf2('0x3d')]['find']({'where':{'id':_0xd3449d[_0xadf2('0x49')]['id']}})[_0xadf2('0x3e')](handleEntityNotFound(_0x47068d,null))['then'](saveUpdates(_0xd3449d[_0xadf2('0x48')],null))[_0xadf2('0x3e')](respondWithResult(_0x47068d,null))[_0xadf2('0x46')](handleError(_0x47068d,null));};exports[_0xadf2('0x25')]=function(_0x3e4e05,_0xf3e89a){return db[_0xadf2('0x3d')]['find']({'where':{'id':_0x3e4e05[_0xadf2('0x49')]['id']}})[_0xadf2('0x3e')](handleEntityNotFound(_0xf3e89a,null))[_0xadf2('0x3e')](removeEntity(_0xf3e89a,null))[_0xadf2('0x46')](handleError(_0xf3e89a,null));};exports[_0xadf2('0x4a')]=function(_0x9c6bcc,_0x2974c1){return db[_0xadf2('0x3d')][_0xadf2('0x4a')]()[_0xadf2('0x3e')](respondWithResult(_0x2974c1,null))[_0xadf2('0x46')](handleError(_0x2974c1,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 6c0430c..fabc244 100644 --- a/server/api/squareReport/squareReport.model.js +++ b/server/api/squareReport/squareReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ca1=['./squareReport.attributes','exports','define','report_square','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5405da,_0x5211a4){var _0x51faee=function(_0x4c446a){while(--_0x4c446a){_0x5405da['push'](_0x5405da['shift']());}};_0x51faee(++_0x5211a4);}(_0x7ca1,0x1e7));var _0x17ca=function(_0x4d1313,_0x32d7b2){_0x4d1313=_0x4d1313-0x0;var _0x1891ec=_0x7ca1[_0x4d1313];return _0x1891ec;};'use strict';var _=require(_0x17ca('0x0'));var util=require(_0x17ca('0x1'));var logger=require(_0x17ca('0x2'))(_0x17ca('0x3'));var moment=require(_0x17ca('0x4'));var BPromise=require(_0x17ca('0x5'));var rp=require(_0x17ca('0x6'));var fs=require('fs');var path=require(_0x17ca('0x7'));var rimraf=require(_0x17ca('0x8'));var config=require('../../config/environment');var attributes=require(_0x17ca('0x9'));module[_0x17ca('0xa')]=function(_0x4f0334,_0x3537b1){return _0x4f0334[_0x17ca('0xb')]('SquareReport',attributes,{'tableName':_0x17ca('0xc'),'paranoid':![],'indexes':[{'name':_0x17ca('0xd'),'fields':[_0x17ca('0xe'),'project_name']},{'name':_0x17ca('0xf'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7f79=['exports','define','SquareReport','uniqueid','leaveAt','util','../../config/logger','api','moment','bluebird','path','rimraf','./squareReport.attributes'];(function(_0x424e47,_0x22985f){var _0x52633e=function(_0x3a8d82){while(--_0x3a8d82){_0x424e47['push'](_0x424e47['shift']());}};_0x52633e(++_0x22985f);}(_0x7f79,0x198));var _0x97f7=function(_0x15ba30,_0x23daff){_0x15ba30=_0x15ba30-0x0;var _0x3ae812=_0x7f79[_0x15ba30];return _0x3ae812;};'use strict';var _=require('lodash');var util=require(_0x97f7('0x0'));var logger=require(_0x97f7('0x1'))(_0x97f7('0x2'));var moment=require(_0x97f7('0x3'));var BPromise=require(_0x97f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x97f7('0x5'));var rimraf=require(_0x97f7('0x6'));var config=require('../../config/environment');var attributes=require(_0x97f7('0x7'));module[_0x97f7('0x8')]=function(_0x36d606,_0x281e09){return _0x36d606[_0x97f7('0x9')](_0x97f7('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x97f7('0xb'),'project_name']},{'name':'leaveAt','fields':[_0x97f7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index b2a825e..1ec9b17 100644 --- a/server/api/squareReport/squareReport.rpc.js +++ b/server/api/squareReport/squareReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x471e=['limit','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateSquareReport','SquareReport','body','options','raw','UpdateSquareReport','update','where','attributes'];(function(_0x2e53e1,_0x12aed1){var _0x3a23de=function(_0xd84699){while(--_0xd84699){_0x2e53e1['push'](_0x2e53e1['shift']());}};_0x3a23de(++_0x12aed1);}(_0x471e,0x123));var _0xe471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x471e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe471('0x0'));var moment=require(_0xe471('0x1'));var BPromise=require(_0xe471('0x2'));var rs=require(_0xe471('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe471('0x4'))(_0xe471('0x5'));var config=require(_0xe471('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe471('0x7')][_0xe471('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32c93e,_0x22efb4,_0x4fafa2){return new BPromise(function(_0x288efe,_0x59096e){return client['request'](_0x32c93e,_0x4fafa2)[_0xe471('0x9')](function(_0x47b4d5){logger[_0xe471('0xa')](_0xe471('0xb'),_0x22efb4,_0xe471('0xc'));logger[_0xe471('0xd')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x22efb4,_0xe471('0xc'),JSON[_0xe471('0xe')](_0x47b4d5));if(_0x47b4d5[_0xe471('0xf')]){if(_0x47b4d5['error']['code']===0x1f4){logger[_0xe471('0xf')]('SquareReport,\x20%s,\x20%s',_0x22efb4,_0x47b4d5[_0xe471('0xf')]['message']);return _0x59096e(_0x47b4d5[_0xe471('0xf')][_0xe471('0x10')]);}logger['error'](_0xe471('0xb'),_0x22efb4,_0x47b4d5['error']['message']);return _0x288efe(_0x47b4d5['error']['message']);}else{logger[_0xe471('0xa')]('SquareReport,\x20%s,\x20%s',_0x22efb4,_0xe471('0xc'));_0x288efe(_0x47b4d5[_0xe471('0x11')][_0xe471('0x10')]);}})[_0xe471('0x12')](function(_0x1d4a71){logger[_0xe471('0xf')](_0xe471('0xb'),_0x22efb4,_0x1d4a71);_0x59096e(_0x1d4a71);});});}exports[_0xe471('0x13')]=function(_0x5e39ec){var _0x54c43f=this;return new Promise(function(_0x19dea6,_0x53bd4a){return db[_0xe471('0x14')]['create'](_0x5e39ec[_0xe471('0x15')],{'raw':_0x5e39ec[_0xe471('0x16')]?_0x5e39ec[_0xe471('0x16')][_0xe471('0x17')]===undefined?!![]:![]:!![]})[_0xe471('0x9')](function(_0x399d61){logger[_0xe471('0xa')]('CreateSquareReport',_0x5e39ec);logger[_0xe471('0xd')]('CreateSquareReport',_0x5e39ec,JSON[_0xe471('0xe')](_0x399d61));_0x19dea6(_0x399d61);})['catch'](function(_0x245c03){logger[_0xe471('0xf')]('CreateSquareReport',_0x245c03[_0xe471('0x10')],_0x5e39ec);_0x53bd4a(_0x54c43f[_0xe471('0xf')](0x1f4,_0x245c03['message']));});});};exports[_0xe471('0x18')]=function(_0x50c0c4){var _0xc56875=this;return new Promise(function(_0x4ad4d1,_0x40c499){return db[_0xe471('0x14')][_0xe471('0x19')](_0x50c0c4['body'],{'raw':_0x50c0c4[_0xe471('0x16')]?_0x50c0c4[_0xe471('0x16')][_0xe471('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50c0c4['options']?_0x50c0c4[_0xe471('0x16')][_0xe471('0x1a')]||null:null,'attributes':_0x50c0c4[_0xe471('0x16')]?_0x50c0c4[_0xe471('0x16')][_0xe471('0x1b')]||null:null,'limit':_0x50c0c4[_0xe471('0x16')]?_0x50c0c4['options'][_0xe471('0x1c')]||null:null})[_0xe471('0x9')](function(_0x492a00){logger[_0xe471('0xa')](_0xe471('0x18'),_0x50c0c4);logger['debug'](_0xe471('0x18'),_0x50c0c4,JSON[_0xe471('0xe')](_0x492a00));_0x4ad4d1(_0x492a00);})['catch'](function(_0x5de1b5){logger[_0xe471('0xf')]('UpdateSquareReport',_0x5de1b5[_0xe471('0x10')],_0x50c0c4);_0x40c499(_0xc56875[_0xe471('0xf')](0x1f4,_0x5de1b5[_0xe471('0x10')]));});});}; \ No newline at end of file +var _0xf504=['options','raw','CreateSquareReport','stringify','catch','UpdateSquareReport','update','where','limit','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','info','SquareReport,\x20%s,\x20%s','SquareReport','create','body'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf504,0x101));var _0x4f50=function(_0x505395,_0x3df958){_0x505395=_0x505395-0x0;var _0x2957f8=_0xf504[_0x505395];return _0x2957f8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4f50('0x0'));var rs=require(_0x4f50('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f50('0x2'))['db'];var utils=require(_0x4f50('0x3'));var logger=require(_0x4f50('0x4'))(_0x4f50('0x5'));var config=require(_0x4f50('0x6'));var jayson=require(_0x4f50('0x7'));var client=jayson[_0x4f50('0x8')][_0x4f50('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27b435,_0x453840,_0x23c7a3){return new BPromise(function(_0x25d4cc,_0x52d2ec){return client['request'](_0x27b435,_0x23c7a3)[_0x4f50('0xa')](function(_0x52a044){logger['info']('SquareReport,\x20%s,\x20%s',_0x453840,_0x4f50('0xb'));logger[_0x4f50('0xc')](_0x4f50('0xd'),_0x453840,'request\x20sent',JSON['stringify'](_0x52a044));if(_0x52a044[_0x4f50('0xe')]){if(_0x52a044[_0x4f50('0xe')][_0x4f50('0xf')]===0x1f4){logger[_0x4f50('0xe')]('SquareReport,\x20%s,\x20%s',_0x453840,_0x52a044[_0x4f50('0xe')][_0x4f50('0x10')]);return _0x52d2ec(_0x52a044[_0x4f50('0xe')][_0x4f50('0x10')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x453840,_0x52a044[_0x4f50('0xe')][_0x4f50('0x10')]);return _0x25d4cc(_0x52a044[_0x4f50('0xe')][_0x4f50('0x10')]);}else{logger[_0x4f50('0x11')](_0x4f50('0x12'),_0x453840,_0x4f50('0xb'));_0x25d4cc(_0x52a044['result'][_0x4f50('0x10')]);}})['catch'](function(_0x4ded12){logger[_0x4f50('0xe')]('SquareReport,\x20%s,\x20%s',_0x453840,_0x4ded12);_0x52d2ec(_0x4ded12);});});}exports['CreateSquareReport']=function(_0x1a80aa){var _0xde5e13=this;return new Promise(function(_0x151935,_0x575778){return db[_0x4f50('0x13')][_0x4f50('0x14')](_0x1a80aa[_0x4f50('0x15')],{'raw':_0x1a80aa[_0x4f50('0x16')]?_0x1a80aa[_0x4f50('0x16')][_0x4f50('0x17')]===undefined?!![]:![]:!![]})[_0x4f50('0xa')](function(_0x4dd2e6){logger[_0x4f50('0x11')](_0x4f50('0x18'),_0x1a80aa);logger['debug'](_0x4f50('0x18'),_0x1a80aa,JSON[_0x4f50('0x19')](_0x4dd2e6));_0x151935(_0x4dd2e6);})[_0x4f50('0x1a')](function(_0x3d683b){logger['error']('CreateSquareReport',_0x3d683b[_0x4f50('0x10')],_0x1a80aa);_0x575778(_0xde5e13[_0x4f50('0xe')](0x1f4,_0x3d683b[_0x4f50('0x10')]));});});};exports[_0x4f50('0x1b')]=function(_0x3fbb63){var _0x496f32=this;return new Promise(function(_0x15b673,_0x22d0c3){return db['SquareReport'][_0x4f50('0x1c')](_0x3fbb63[_0x4f50('0x15')],{'raw':_0x3fbb63[_0x4f50('0x16')]?_0x3fbb63[_0x4f50('0x16')][_0x4f50('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fbb63[_0x4f50('0x16')]?_0x3fbb63[_0x4f50('0x16')][_0x4f50('0x1d')]||null:null,'attributes':_0x3fbb63[_0x4f50('0x16')]?_0x3fbb63['options']['attributes']||null:null,'limit':_0x3fbb63[_0x4f50('0x16')]?_0x3fbb63['options'][_0x4f50('0x1e')]||null:null})[_0x4f50('0xa')](function(_0x330361){logger[_0x4f50('0x11')]('UpdateSquareReport',_0x3fbb63);logger[_0x4f50('0xc')](_0x4f50('0x1b'),_0x3fbb63,JSON[_0x4f50('0x19')](_0x330361));_0x15b673(_0x330361);})[_0x4f50('0x1a')](function(_0x28b170){logger[_0x4f50('0xe')](_0x4f50('0x1b'),_0x28b170[_0x4f50('0x10')],_0x3fbb63);_0x22d0c3(_0x496f32[_0x4f50('0xe')](0x1f4,_0x28b170[_0x4f50('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 7229c5b..4a94987 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x2ef78f,_0x46e15f){var _0x43f1a5=function(_0x555134){while(--_0x555134){_0x2ef78f['push'](_0x2ef78f['shift']());}};_0x43f1a5(++_0x46e15f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4c7382,_0x313d30){_0x4c7382=_0x4c7382-0x0;var _0x47cee7=_0x5f2f[_0x4c7382];return _0x47cee7;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file +var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x38b718,_0x3fca68){var _0x2c2125=function(_0x4a4645){while(--_0x4a4645){_0x38b718['push'](_0x38b718['shift']());}};_0x2c2125(++_0x3fca68);}(_0x7a54,0x106));var _0x47a5=function(_0x37395d,_0x4c7639){_0x37395d=_0x37395d-0x0;var _0x11226a=_0x7a54[_0x37395d];return _0x11226a;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 253c77d..6d4e114 100644 --- a/server/api/squareReportDetail/squareReportDetail.attributes.js +++ b/server/api/squareReportDetail/squareReportDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb459=['exports','STRING','TEXT','sequelize'];(function(_0x19d19c,_0x1f05da){var _0x849751=function(_0x11d43a){while(--_0x11d43a){_0x19d19c['push'](_0x19d19c['shift']());}};_0x849751(++_0x1f05da);}(_0xb459,0x197));var _0x9b45=function(_0x285c85,_0x132c21){_0x285c85=_0x285c85-0x0;var _0x2f81cd=_0xb459[_0x285c85];return _0x2f81cd;};'use strict';var Sequelize=require(_0x9b45('0x0'));module[_0x9b45('0x1')]={'uniqueid':{'type':Sequelize[_0x9b45('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x9b45('0x2')]},'data':{'type':Sequelize[_0x9b45('0x3')]},'project_name':{'type':Sequelize[_0x9b45('0x2')]},'callerid':{'type':Sequelize[_0x9b45('0x2')]}}; \ No newline at end of file +var _0x6228=['STRING','sequelize'];(function(_0x22f5f7,_0x176e75){var _0x3c6e75=function(_0x5a7c3a){while(--_0x5a7c3a){_0x22f5f7['push'](_0x22f5f7['shift']());}};_0x3c6e75(++_0x176e75);}(_0x6228,0xb9));var _0x8622=function(_0x4a05a4,_0x1f558e){_0x4a05a4=_0x4a05a4-0x0;var _0x349ce4=_0x6228[_0x4a05a4];return _0x349ce4;};'use strict';var Sequelize=require(_0x8622('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x8622('0x1')]},'node':{'type':Sequelize[_0x8622('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x8622('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index dcc92c9..61879a5 100644 --- a/server/api/squareReportDetail/squareReportDetail.controller.js +++ b/server/api/squareReportDetail/squareReportDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6185=['json','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','SquareDetailsReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','type','key','filter','merge','options','findAll','rows','catch','includeAll','include','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end'];(function(_0x24607a,_0x228806){var _0x49afdd=function(_0xea6b73){while(--_0xea6b73){_0x24607a['push'](_0x24607a['shift']());}};_0x49afdd(++_0x228806);}(_0x6185,0x18f));var _0x5618=function(_0x4fcfbd,_0x27925b){_0x4fcfbd=_0x4fcfbd-0x0;var _0x4423eb=_0x6185[_0x4fcfbd];return _0x4423eb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5618('0x0'));var rimraf=require(_0x5618('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5618('0x2'));var rp=require(_0x5618('0x3'));var moment=require(_0x5618('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5618('0x5'));var util=require('util');var path=require(_0x5618('0x6'));var sox=require(_0x5618('0x7'));var csv=require(_0x5618('0x8'));var ejs=require(_0x5618('0x9'));var fs=require('fs');var _=require(_0x5618('0xa'));var squel=require(_0x5618('0xb'));var crypto=require(_0x5618('0xc'));var jsforce=require(_0x5618('0xd'));var deskjs=require(_0x5618('0xe'));var toCsv=require(_0x5618('0x8'));var querystring=require(_0x5618('0xf'));var Papa=require(_0x5618('0x10'));var Redis=require(_0x5618('0x11'));var authService=require(_0x5618('0x12'));var qs=require(_0x5618('0x13'));var hardwareService=require(_0x5618('0x14'));var logger=require('../../config/logger')(_0x5618('0x15'));var utils=require(_0x5618('0x16'));var config=require(_0x5618('0x17'));var db=require(_0x5618('0x18'))['db'];function respondWithStatusCode(_0x3bae2a,_0x145784){_0x145784=_0x145784||0xcc;return function(_0x552f49){if(_0x552f49){return _0x3bae2a['sendStatus'](_0x145784);}return _0x3bae2a[_0x5618('0x19')](_0x145784)[_0x5618('0x1a')]();};}function respondWithResult(_0x3ef3a0,_0x5c22fb){_0x5c22fb=_0x5c22fb||0xc8;return function(_0x5982ea){if(_0x5982ea){return _0x3ef3a0[_0x5618('0x19')](_0x5c22fb)[_0x5618('0x1b')](_0x5982ea);}};}function respondWithFilteredResult(_0x39dfc1,_0x2e6757){return function(_0x2bbf52){if(_0x2bbf52){var _0x1cdc25=_0x2bbf52[_0x5618('0x1c')],_0x3ca2e1=_0x2e6757['offset'],_0xa13cbd=_0x2e6757[_0x5618('0x1d')]+_0x2e6757['limit'],_0x47502a;if(_0xa13cbd>=_0x1cdc25){_0xa13cbd=_0x1cdc25;_0x47502a=0xc8;}else{_0x47502a=0xce;}_0x39dfc1[_0x5618('0x19')](_0x47502a);return _0x39dfc1[_0x5618('0x1e')](_0x5618('0x1f'),_0x3ca2e1+'-'+_0xa13cbd+'/'+_0x1cdc25)[_0x5618('0x1b')](_0x2bbf52);}return null;};}function patchUpdates(_0x5d133f){return function(_0x236bda){try{jsonpatch[_0x5618('0x20')](_0x236bda,_0x5d133f,!![]);}catch(_0x14cf9f){return BPromise['reject'](_0x14cf9f);}return _0x236bda[_0x5618('0x21')]();};}function saveUpdates(_0x4bd6a2,_0x53c025){return function(_0x2544c4){if(_0x2544c4){return _0x2544c4[_0x5618('0x22')](_0x4bd6a2)[_0x5618('0x23')](function(_0x24eec7){return _0x24eec7;});}return null;};}function removeEntity(_0x1410dc,_0x2d9702){return function(_0x41e7d8){if(_0x41e7d8){return _0x41e7d8[_0x5618('0x24')]()['then'](function(){_0x1410dc[_0x5618('0x19')](0xcc)[_0x5618('0x1a')]();});}};}function handleEntityNotFound(_0x7f5d79,_0x330ddf){return function(_0x40802e){if(!_0x40802e){_0x7f5d79['sendStatus'](0x194);}return _0x40802e;};}function handleError(_0x532e70,_0x385c26){_0x385c26=_0x385c26||0x1f4;return function(_0xc70420){logger['error'](_0xc70420[_0x5618('0x25')]);if(_0xc70420[_0x5618('0x26')]){delete _0xc70420[_0x5618('0x26')];}_0x532e70[_0x5618('0x19')](_0x385c26)[_0x5618('0x27')](_0xc70420);};}exports['index']=function(_0x4221b2,_0x2543ad){var _0x329200={},_0x2162e0={},_0x3d040e={'count':0x0,'rows':[]};var _0x529b8f=db[_0x5618('0x28')][_0x5618('0x29')];_0x2162e0[_0x5618('0x2a')]=_[_0x5618('0x2b')](_0x529b8f);_0x2162e0[_0x5618('0x2c')]=_[_0x5618('0x2b')](_0x4221b2[_0x5618('0x2c')]);_0x2162e0[_0x5618('0x2d')]=_[_0x5618('0x2e')](_0x2162e0[_0x5618('0x2a')],_0x2162e0[_0x5618('0x2c')]);_0x329200[_0x5618('0x2f')]=_['intersection'](_0x2162e0[_0x5618('0x2a')],qs[_0x5618('0x30')](_0x4221b2[_0x5618('0x2c')][_0x5618('0x30')]));_0x329200[_0x5618('0x2f')]=_0x329200[_0x5618('0x2f')][_0x5618('0x31')]?_0x329200[_0x5618('0x2f')]:_0x2162e0[_0x5618('0x2a')];if(!_0x4221b2[_0x5618('0x2c')][_0x5618('0x32')](_0x5618('0x33'))){_0x329200[_0x5618('0x34')]=qs[_0x5618('0x34')](_0x4221b2[_0x5618('0x2c')][_0x5618('0x34')]);_0x329200[_0x5618('0x1d')]=qs[_0x5618('0x1d')](_0x4221b2['query'][_0x5618('0x1d')]);}_0x329200['order']=qs['sort'](_0x4221b2[_0x5618('0x2c')][_0x5618('0x35')]);_0x329200[_0x5618('0x36')]=qs[_0x5618('0x2d')](_[_0x5618('0x37')](_0x4221b2[_0x5618('0x2c')],_0x2162e0[_0x5618('0x2d')]));if(_0x4221b2['query']['filter']){_0x329200['where']=_['merge'](_0x329200['where'],{'$or':_['map'](_0x529b8f,function(_0x5e7b37){if(_0x5e7b37[_0x5618('0x38')][_0x5618('0x39')]!=='VIRTUAL'){var _0x5d1538={};_0x5d1538[_0x5e7b37['field']]={'$like':'%'+_0x4221b2[_0x5618('0x2c')][_0x5618('0x3a')]+'%'};return _0x5d1538;}})});}_0x329200=_[_0x5618('0x3b')]({},_0x329200,_0x4221b2[_0x5618('0x3c')]);var _0x17ee40={'where':_0x329200[_0x5618('0x36')]};return db[_0x5618('0x28')][_0x5618('0x1c')](_0x17ee40)['then'](function(_0x259360){_0x3d040e['count']=_0x259360;if(_0x4221b2[_0x5618('0x2c')]['includeAll']){_0x329200['include']=[{'all':!![]}];}return db[_0x5618('0x28')][_0x5618('0x3d')](_0x329200);})['then'](function(_0x5dc61f){_0x3d040e[_0x5618('0x3e')]=_0x5dc61f;return _0x3d040e;})[_0x5618('0x23')](respondWithFilteredResult(_0x2543ad,_0x329200))[_0x5618('0x3f')](handleError(_0x2543ad,null));};exports['show']=function(_0x59274b,_0xe94991){var _0x4293a9={'raw':!![],'where':{'id':_0x59274b['params']['id']}},_0x57eca7={};_0x57eca7['model']=_[_0x5618('0x2b')](db[_0x5618('0x28')][_0x5618('0x29')]);_0x57eca7[_0x5618('0x2c')]=_['keys'](_0x59274b['query']);_0x57eca7[_0x5618('0x2d')]=_['intersection'](_0x57eca7['model'],_0x57eca7[_0x5618('0x2c')]);_0x4293a9[_0x5618('0x2f')]=_[_0x5618('0x2e')](_0x57eca7['model'],qs['fields'](_0x59274b[_0x5618('0x2c')][_0x5618('0x30')]));_0x4293a9[_0x5618('0x2f')]=_0x4293a9['attributes'][_0x5618('0x31')]?_0x4293a9[_0x5618('0x2f')]:_0x57eca7[_0x5618('0x2a')];if(_0x59274b[_0x5618('0x2c')][_0x5618('0x40')]){_0x4293a9[_0x5618('0x41')]=[{'all':!![]}];}_0x4293a9=_[_0x5618('0x3b')]({},_0x4293a9,_0x59274b[_0x5618('0x3c')]);return db[_0x5618('0x28')]['find'](_0x4293a9)[_0x5618('0x23')](handleEntityNotFound(_0xe94991,null))[_0x5618('0x23')](respondWithResult(_0xe94991,null))[_0x5618('0x3f')](handleError(_0xe94991,null));};exports['create']=function(_0xdc840a,_0x463a6){return db[_0x5618('0x28')][_0x5618('0x42')](_0xdc840a[_0x5618('0x43')],{})[_0x5618('0x23')](respondWithResult(_0x463a6,0xc9))[_0x5618('0x3f')](handleError(_0x463a6,null));};exports[_0x5618('0x22')]=function(_0x50c7a4,_0x211396){if(_0x50c7a4['body']['id']){delete _0x50c7a4[_0x5618('0x43')]['id'];}return db[_0x5618('0x28')][_0x5618('0x44')]({'where':{'id':_0x50c7a4[_0x5618('0x45')]['id']}})[_0x5618('0x23')](handleEntityNotFound(_0x211396,null))['then'](saveUpdates(_0x50c7a4[_0x5618('0x43')],null))[_0x5618('0x23')](respondWithResult(_0x211396,null))[_0x5618('0x3f')](handleError(_0x211396,null));};exports[_0x5618('0x24')]=function(_0x37db5a,_0x14e03e){return db[_0x5618('0x28')][_0x5618('0x44')]({'where':{'id':_0x37db5a[_0x5618('0x45')]['id']}})[_0x5618('0x23')](handleEntityNotFound(_0x14e03e,null))['then'](removeEntity(_0x14e03e,null))['catch'](handleError(_0x14e03e,null));};exports[_0x5618('0x46')]=function(_0x591949,_0x2a1720){return db[_0x5618('0x28')]['describe']()[_0x5618('0x23')](respondWithResult(_0x2a1720,null))['catch'](handleError(_0x2a1720,null));}; \ No newline at end of file +var _0xeecf=['limit','set','Content-Range','reject','then','stack','send','index','SquareDetailsReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','key','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','update','destroy','describe','html-pdf','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xeecf,0x12d));var _0xfeec=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeecf[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xfeec('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfeec('0x1'));var zipdir=require(_0xfeec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfeec('0x3'));var Mustache=require(_0xfeec('0x4'));var util=require(_0xfeec('0x5'));var path=require(_0xfeec('0x6'));var sox=require(_0xfeec('0x7'));var csv=require(_0xfeec('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfeec('0x9'));var squel=require(_0xfeec('0xa'));var crypto=require(_0xfeec('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfeec('0x8'));var querystring=require(_0xfeec('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfeec('0xd'));var qs=require(_0xfeec('0xe'));var hardwareService=require(_0xfeec('0xf'));var logger=require('../../config/logger')(_0xfeec('0x10'));var utils=require(_0xfeec('0x11'));var config=require('../../config/environment');var db=require(_0xfeec('0x12'))['db'];function respondWithStatusCode(_0x15b3d9,_0x32cb32){_0x32cb32=_0x32cb32||0xcc;return function(_0x3d574e){if(_0x3d574e){return _0x15b3d9[_0xfeec('0x13')](_0x32cb32);}return _0x15b3d9[_0xfeec('0x14')](_0x32cb32)[_0xfeec('0x15')]();};}function respondWithResult(_0x1649ff,_0x3e2b20){_0x3e2b20=_0x3e2b20||0xc8;return function(_0x29de86){if(_0x29de86){return _0x1649ff['status'](_0x3e2b20)[_0xfeec('0x16')](_0x29de86);}};}function respondWithFilteredResult(_0x55f524,_0xff5f79){return function(_0x17a2ea){if(_0x17a2ea){var _0x2fa767=_0x17a2ea['count'],_0xf30de=_0xff5f79[_0xfeec('0x17')],_0x3ae10c=_0xff5f79[_0xfeec('0x17')]+_0xff5f79[_0xfeec('0x18')],_0x519dd7;if(_0x3ae10c>=_0x2fa767){_0x3ae10c=_0x2fa767;_0x519dd7=0xc8;}else{_0x519dd7=0xce;}_0x55f524[_0xfeec('0x14')](_0x519dd7);return _0x55f524[_0xfeec('0x19')](_0xfeec('0x1a'),_0xf30de+'-'+_0x3ae10c+'/'+_0x2fa767)[_0xfeec('0x16')](_0x17a2ea);}return null;};}function patchUpdates(_0x23518c){return function(_0xc08097){try{jsonpatch['apply'](_0xc08097,_0x23518c,!![]);}catch(_0x4bd888){return BPromise[_0xfeec('0x1b')](_0x4bd888);}return _0xc08097['save']();};}function saveUpdates(_0x3f2fb1,_0x1e17e2){return function(_0x170fa8){if(_0x170fa8){return _0x170fa8['update'](_0x3f2fb1)[_0xfeec('0x1c')](function(_0x525775){return _0x525775;});}return null;};}function removeEntity(_0x2b7caf,_0x36be3d){return function(_0x5cf38d){if(_0x5cf38d){return _0x5cf38d['destroy']()[_0xfeec('0x1c')](function(){_0x2b7caf[_0xfeec('0x14')](0xcc)[_0xfeec('0x15')]();});}};}function handleEntityNotFound(_0x379be5,_0x20a87d){return function(_0x19aeab){if(!_0x19aeab){_0x379be5[_0xfeec('0x13')](0x194);}return _0x19aeab;};}function handleError(_0xce0288,_0x1de99e){_0x1de99e=_0x1de99e||0x1f4;return function(_0x303d22){logger['error'](_0x303d22[_0xfeec('0x1d')]);if(_0x303d22['name']){delete _0x303d22['name'];}_0xce0288['status'](_0x1de99e)[_0xfeec('0x1e')](_0x303d22);};}exports[_0xfeec('0x1f')]=function(_0x26161a,_0x572b23){var _0x113e49={},_0x34a3f6={},_0x7654e={'count':0x0,'rows':[]};var _0xa9c479=db[_0xfeec('0x20')][_0xfeec('0x21')];_0x34a3f6[_0xfeec('0x22')]=_['keys'](_0xa9c479);_0x34a3f6['query']=_[_0xfeec('0x23')](_0x26161a[_0xfeec('0x24')]);_0x34a3f6[_0xfeec('0x25')]=_['intersection'](_0x34a3f6[_0xfeec('0x22')],_0x34a3f6['query']);_0x113e49['attributes']=_[_0xfeec('0x26')](_0x34a3f6[_0xfeec('0x22')],qs[_0xfeec('0x27')](_0x26161a[_0xfeec('0x24')]['fields']));_0x113e49[_0xfeec('0x28')]=_0x113e49[_0xfeec('0x28')][_0xfeec('0x29')]?_0x113e49[_0xfeec('0x28')]:_0x34a3f6['model'];if(!_0x26161a[_0xfeec('0x24')][_0xfeec('0x2a')]('nolimit')){_0x113e49[_0xfeec('0x18')]=qs[_0xfeec('0x18')](_0x26161a[_0xfeec('0x24')]['limit']);_0x113e49[_0xfeec('0x17')]=qs['offset'](_0x26161a[_0xfeec('0x24')][_0xfeec('0x17')]);}_0x113e49['order']=qs[_0xfeec('0x2b')](_0x26161a[_0xfeec('0x24')][_0xfeec('0x2b')]);_0x113e49[_0xfeec('0x2c')]=qs[_0xfeec('0x25')](_[_0xfeec('0x2d')](_0x26161a[_0xfeec('0x24')],_0x34a3f6[_0xfeec('0x25')]));if(_0x26161a[_0xfeec('0x24')][_0xfeec('0x2e')]){_0x113e49['where']=_[_0xfeec('0x2f')](_0x113e49[_0xfeec('0x2c')],{'$or':_[_0xfeec('0x30')](_0xa9c479,function(_0xf513a9){if(_0xf513a9[_0xfeec('0x31')][_0xfeec('0x32')]!=='VIRTUAL'){var _0x354082={};_0x354082[_0xf513a9['field']]={'$like':'%'+_0x26161a['query'][_0xfeec('0x2e')]+'%'};return _0x354082;}})});}_0x113e49=_[_0xfeec('0x2f')]({},_0x113e49,_0x26161a[_0xfeec('0x33')]);var _0x6486f5={'where':_0x113e49[_0xfeec('0x2c')]};return db[_0xfeec('0x20')][_0xfeec('0x34')](_0x6486f5)['then'](function(_0x101e8){_0x7654e[_0xfeec('0x34')]=_0x101e8;if(_0x26161a[_0xfeec('0x24')][_0xfeec('0x35')]){_0x113e49[_0xfeec('0x36')]=[{'all':!![]}];}return db[_0xfeec('0x20')][_0xfeec('0x37')](_0x113e49);})[_0xfeec('0x1c')](function(_0x253c6e){_0x7654e[_0xfeec('0x38')]=_0x253c6e;return _0x7654e;})[_0xfeec('0x1c')](respondWithFilteredResult(_0x572b23,_0x113e49))[_0xfeec('0x39')](handleError(_0x572b23,null));};exports['show']=function(_0x1f87e9,_0x35f2f0){var _0x54d9b8={'raw':!![],'where':{'id':_0x1f87e9[_0xfeec('0x3a')]['id']}},_0x320d00={};_0x320d00[_0xfeec('0x22')]=_[_0xfeec('0x23')](db[_0xfeec('0x20')][_0xfeec('0x21')]);_0x320d00['query']=_[_0xfeec('0x23')](_0x1f87e9[_0xfeec('0x24')]);_0x320d00[_0xfeec('0x25')]=_['intersection'](_0x320d00[_0xfeec('0x22')],_0x320d00[_0xfeec('0x24')]);_0x54d9b8[_0xfeec('0x28')]=_[_0xfeec('0x26')](_0x320d00[_0xfeec('0x22')],qs[_0xfeec('0x27')](_0x1f87e9[_0xfeec('0x24')][_0xfeec('0x27')]));_0x54d9b8[_0xfeec('0x28')]=_0x54d9b8[_0xfeec('0x28')][_0xfeec('0x29')]?_0x54d9b8['attributes']:_0x320d00['model'];if(_0x1f87e9[_0xfeec('0x24')][_0xfeec('0x35')]){_0x54d9b8[_0xfeec('0x36')]=[{'all':!![]}];}_0x54d9b8=_[_0xfeec('0x2f')]({},_0x54d9b8,_0x1f87e9[_0xfeec('0x33')]);return db[_0xfeec('0x20')][_0xfeec('0x3b')](_0x54d9b8)[_0xfeec('0x1c')](handleEntityNotFound(_0x35f2f0,null))[_0xfeec('0x1c')](respondWithResult(_0x35f2f0,null))['catch'](handleError(_0x35f2f0,null));};exports[_0xfeec('0x3c')]=function(_0x4d9e26,_0x162acc){return db[_0xfeec('0x20')]['create'](_0x4d9e26[_0xfeec('0x3d')],{})['then'](respondWithResult(_0x162acc,0xc9))[_0xfeec('0x39')](handleError(_0x162acc,null));};exports[_0xfeec('0x3e')]=function(_0x564dfb,_0x1de682){if(_0x564dfb[_0xfeec('0x3d')]['id']){delete _0x564dfb[_0xfeec('0x3d')]['id'];}return db['SquareDetailsReport'][_0xfeec('0x3b')]({'where':{'id':_0x564dfb['params']['id']}})[_0xfeec('0x1c')](handleEntityNotFound(_0x1de682,null))[_0xfeec('0x1c')](saveUpdates(_0x564dfb[_0xfeec('0x3d')],null))[_0xfeec('0x1c')](respondWithResult(_0x1de682,null))[_0xfeec('0x39')](handleError(_0x1de682,null));};exports[_0xfeec('0x3f')]=function(_0x1dbbc7,_0x1874ab){return db['SquareDetailsReport'][_0xfeec('0x3b')]({'where':{'id':_0x1dbbc7[_0xfeec('0x3a')]['id']}})[_0xfeec('0x1c')](handleEntityNotFound(_0x1874ab,null))[_0xfeec('0x1c')](removeEntity(_0x1874ab,null))[_0xfeec('0x39')](handleError(_0x1874ab,null));};exports[_0xfeec('0x40')]=function(_0x94bdb1,_0x2cacb7){return db[_0xfeec('0x20')][_0xfeec('0x40')]()[_0xfeec('0x1c')](respondWithResult(_0x2cacb7,null))[_0xfeec('0x39')](handleError(_0x2cacb7,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 0c5b17a..2c74944 100644 --- a/server/api/squareReportDetail/squareReportDetail.model.js +++ b/server/api/squareReportDetail/squareReportDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x508e=['define','report_square_details','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x508e,0x7a));var _0xe508=function(_0x46d27d,_0x3596b4){_0x46d27d=_0x46d27d-0x0;var _0x215122=_0x508e[_0x46d27d];return _0x215122;};'use strict';var _=require('lodash');var util=require(_0xe508('0x0'));var logger=require(_0xe508('0x1'))(_0xe508('0x2'));var moment=require('moment');var BPromise=require(_0xe508('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe508('0x4'));var rimraf=require(_0xe508('0x5'));var config=require(_0xe508('0x6'));var attributes=require(_0xe508('0x7'));module['exports']=function(_0x3127bc,_0x22e700){return _0x3127bc[_0xe508('0x8')]('SquareDetailsReport',attributes,{'tableName':_0xe508('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf25=['report_square_details','lodash','util','api','moment','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xbf25,0x12d));var _0x5bf2=function(_0x144778,_0x3deb73){_0x144778=_0x144778-0x0;var _0x11ad2d=_0xbf25[_0x144778];return _0x11ad2d;};'use strict';var _=require(_0x5bf2('0x0'));var util=require(_0x5bf2('0x1'));var logger=require('../../config/logger')(_0x5bf2('0x2'));var moment=require(_0x5bf2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bf2('0x4'));var rimraf=require(_0x5bf2('0x5'));var config=require(_0x5bf2('0x6'));var attributes=require(_0x5bf2('0x7'));module[_0x5bf2('0x8')]=function(_0x160111,_0x4367be){return _0x160111[_0x5bf2('0x9')](_0x5bf2('0xa'),attributes,{'tableName':_0x5bf2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 01fc35e..a08aa74 100644 --- a/server/api/squareReportDetail/squareReportDetail.rpc.js +++ b/server/api/squareReportDetail/squareReportDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a2c=['code','message','catch','create','body','options','raw','CreateSquareDetailsReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2e4b9d,_0x5b7416){var _0x381dcd=function(_0x5b7be8){while(--_0x5b7be8){_0x2e4b9d['push'](_0x2e4b9d['shift']());}};_0x381dcd(++_0x5b7416);}(_0x6a2c,0x120));var _0xc6a2=function(_0xd94bbc,_0x30094f){_0xd94bbc=_0xd94bbc-0x0;var _0x196f9a=_0x6a2c[_0xd94bbc];return _0x196f9a;};'use strict';var _=require(_0xc6a2('0x0'));var util=require(_0xc6a2('0x1'));var moment=require('moment');var BPromise=require(_0xc6a2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6a2('0x3'));var db=require(_0xc6a2('0x4'))['db'];var utils=require(_0xc6a2('0x5'));var logger=require(_0xc6a2('0x6'))(_0xc6a2('0x7'));var config=require(_0xc6a2('0x8'));var jayson=require(_0xc6a2('0x9'));var client=jayson[_0xc6a2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x575524,_0x4e17c9,_0x49d1d2){return new BPromise(function(_0x50dd5c,_0xa149b4){return client[_0xc6a2('0xb')](_0x575524,_0x49d1d2)[_0xc6a2('0xc')](function(_0x224291){logger[_0xc6a2('0xd')](_0xc6a2('0xe'),_0x4e17c9,_0xc6a2('0xf'));logger[_0xc6a2('0x10')](_0xc6a2('0x11'),_0x4e17c9,_0xc6a2('0xf'),JSON[_0xc6a2('0x12')](_0x224291));if(_0x224291[_0xc6a2('0x13')]){if(_0x224291[_0xc6a2('0x13')][_0xc6a2('0x14')]===0x1f4){logger['error'](_0xc6a2('0xe'),_0x4e17c9,_0x224291[_0xc6a2('0x13')][_0xc6a2('0x15')]);return _0xa149b4(_0x224291[_0xc6a2('0x13')][_0xc6a2('0x15')]);}logger[_0xc6a2('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x4e17c9,_0x224291[_0xc6a2('0x13')][_0xc6a2('0x15')]);return _0x50dd5c(_0x224291[_0xc6a2('0x13')][_0xc6a2('0x15')]);}else{logger[_0xc6a2('0xd')](_0xc6a2('0xe'),_0x4e17c9,'request\x20sent');_0x50dd5c(_0x224291['result'][_0xc6a2('0x15')]);}})[_0xc6a2('0x16')](function(_0x2603d4){logger[_0xc6a2('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x4e17c9,_0x2603d4);_0xa149b4(_0x2603d4);});});}exports['CreateSquareDetailsReport']=function(_0x119f51){var _0x563e26=this;return new Promise(function(_0x5af90c,_0xa96d06){return db['SquareDetailsReport'][_0xc6a2('0x17')](_0x119f51[_0xc6a2('0x18')],{'raw':_0x119f51[_0xc6a2('0x19')]?_0x119f51[_0xc6a2('0x19')][_0xc6a2('0x1a')]===undefined?!![]:![]:!![]})[_0xc6a2('0xc')](function(_0x275acb){logger['info']('CreateSquareDetailsReport',_0x119f51);logger['debug'](_0xc6a2('0x1b'),_0x119f51,JSON[_0xc6a2('0x12')](_0x275acb));_0x5af90c(_0x275acb);})[_0xc6a2('0x16')](function(_0x4f3fda){logger[_0xc6a2('0x13')](_0xc6a2('0x1b'),_0x4f3fda[_0xc6a2('0x15')],_0x119f51);_0xa96d06(_0x563e26[_0xc6a2('0x13')](0x1f4,_0x4f3fda['message']));});});}; \ No newline at end of file +var _0xdeec=['stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0xdeec,0xd7));var _0xcdee=function(_0x2c37bb,_0x2e2202){_0x2c37bb=_0x2c37bb-0x0;var _0x2d285b=_0xdeec[_0x2c37bb];return _0x2d285b;};'use strict';var _=require(_0xcdee('0x0'));var util=require(_0xcdee('0x1'));var moment=require(_0xcdee('0x2'));var BPromise=require(_0xcdee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdee('0x4'));var db=require(_0xcdee('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcdee('0x6'))(_0xcdee('0x7'));var config=require('../../config/environment');var jayson=require(_0xcdee('0x8'));var client=jayson[_0xcdee('0x9')][_0xcdee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c987b,_0x47c274,_0x9ab2b8){return new BPromise(function(_0x49aed4,_0x39c3fd){return client[_0xcdee('0xb')](_0x3c987b,_0x9ab2b8)[_0xcdee('0xc')](function(_0x2a94f7){logger[_0xcdee('0xd')](_0xcdee('0xe'),_0x47c274,'request\x20sent');logger['debug'](_0xcdee('0xf'),_0x47c274,_0xcdee('0x10'),JSON[_0xcdee('0x11')](_0x2a94f7));if(_0x2a94f7[_0xcdee('0x12')]){if(_0x2a94f7[_0xcdee('0x12')][_0xcdee('0x13')]===0x1f4){logger[_0xcdee('0x12')](_0xcdee('0xe'),_0x47c274,_0x2a94f7['error'][_0xcdee('0x14')]);return _0x39c3fd(_0x2a94f7[_0xcdee('0x12')]['message']);}logger['error'](_0xcdee('0xe'),_0x47c274,_0x2a94f7[_0xcdee('0x12')][_0xcdee('0x14')]);return _0x49aed4(_0x2a94f7[_0xcdee('0x12')]['message']);}else{logger[_0xcdee('0xd')](_0xcdee('0xe'),_0x47c274,'request\x20sent');_0x49aed4(_0x2a94f7[_0xcdee('0x15')]['message']);}})[_0xcdee('0x16')](function(_0x39e6b9){logger[_0xcdee('0x12')](_0xcdee('0xe'),_0x47c274,_0x39e6b9);_0x39c3fd(_0x39e6b9);});});}exports[_0xcdee('0x17')]=function(_0x3361e4){var _0x42219c=this;return new Promise(function(_0x3f1536,_0x1197be){return db[_0xcdee('0x18')][_0xcdee('0x19')](_0x3361e4[_0xcdee('0x1a')],{'raw':_0x3361e4[_0xcdee('0x1b')]?_0x3361e4['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x47dea2){logger[_0xcdee('0xd')](_0xcdee('0x17'),_0x3361e4);logger[_0xcdee('0x1c')]('CreateSquareDetailsReport',_0x3361e4,JSON[_0xcdee('0x11')](_0x47dea2));_0x3f1536(_0x47dea2);})['catch'](function(_0x80a7f2){logger['error']('CreateSquareDetailsReport',_0x80a7f2[_0xcdee('0x14')],_0x3361e4);_0x1197be(_0x42219c[_0xcdee('0x12')](0x1f4,_0x80a7f2[_0xcdee('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index acad5d8..022ea0c 100644 --- a/server/api/system/index.js +++ b/server/api/system/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5523=['../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','express','Router'];(function(_0x3c4a7c,_0x2f4e3c){var _0xf13d1e=function(_0x24cb78){while(--_0x24cb78){_0x3c4a7c['push'](_0x3c4a7c['shift']());}};_0xf13d1e(++_0x2f4e3c);}(_0x5523,0x96));var _0x3552=function(_0x1b9047,_0x3995b8){_0x1b9047=_0x1b9047-0x0;var _0x38ca3c=_0x5523[_0x1b9047];return _0x38ca3c;};'use strict';var express=require(_0x3552('0x0'));var router=express[_0x3552('0x1')]();var auth=require(_0x3552('0x2'));var controller=require(_0x3552('0x3'));router[_0x3552('0x4')]('/',auth[_0x3552('0x5')](),controller['index']);router[_0x3552('0x4')](_0x3552('0x6'),auth[_0x3552('0x5')](),controller[_0x3552('0x7')]);module['exports']=router; \ No newline at end of file +var _0x4566=['isAuthenticated','/process/:pid/kill','killProcess','express','../../components/auth/service','get'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x4566,0x8d));var _0x6456=function(_0x1858ce,_0x4d03a3){_0x1858ce=_0x1858ce-0x0;var _0x3c560e=_0x4566[_0x1858ce];return _0x3c560e;};'use strict';var express=require(_0x6456('0x0'));var router=express['Router']();var auth=require(_0x6456('0x1'));var controller=require('./system.controller');router[_0x6456('0x2')]('/',auth[_0x6456('0x3')](),controller['index']);router[_0x6456('0x2')](_0x6456('0x4'),auth['isAuthenticated'](),controller[_0x6456('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index a2ee851..739d0ca 100644 --- a/server/api/system/system.controller.js +++ b/server/api/system/system.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7c5=['SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then','catch','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0xa7c5,0x1e6));var _0x5a7c=function(_0x4c6035,_0xcd1df0){_0x4c6035=_0x4c6035-0x0;var _0x15ed82=_0xa7c5[_0x4c6035];return _0x15ed82;};'use strict';var info=require(_0x5a7c('0x0'));var exec=require('child_process')['exec'];var logger=require('../../config/logger')(_0x5a7c('0x1'));var util=require(_0x5a7c('0x2'));var BPromise=require(_0x5a7c('0x3'));var _=require(_0x5a7c('0x4'));function handleError(_0x1bb1f4,_0x2944cf,_0x65a0cc){_0x2944cf=_0x2944cf||0x1f4;return function(_0x21a63b){logger['error'](_0x5a7c('0x5'),_0x65a0cc,_0x2944cf,util[_0x5a7c('0x6')](_0x21a63b,{'showHidden':![],'depth':null}));delete _0x21a63b['name'];_0x1bb1f4[_0x5a7c('0x7')](_0x2944cf)[_0x5a7c('0x8')](_0x21a63b);};}exports[_0x5a7c('0x9')]=function(_0xecbb69,_0x3bfe68){return info[_0x5a7c('0xa')]()[_0x5a7c('0xb')](function(_0x1ab0d9){return _0x3bfe68[_0x5a7c('0x7')](0xc8)['json'](_0x1ab0d9);})[_0x5a7c('0xc')](function(_0x44e424){return _0x3bfe68['status'](0x1f4)[_0x5a7c('0xd')](_0x44e424);});};exports['killProcess']=function(_0x25eac8,_0xa52620){var _0xe27d6b=[_0x5a7c('0xe')];return new BPromise(function(_0xf141f7,_0x20ddfb){return exec(util[_0x5a7c('0xf')](_0x5a7c('0x10'),_0x25eac8[_0x5a7c('0x11')][_0x5a7c('0x12')]),function(_0x570be5,_0x580a63,_0x248328){if(_0x570be5){return _0x20ddfb(_0x570be5);}return _0xf141f7(_0x580a63);});})['then'](function(_0x5284d0){var _0x512674=![];var _0x284fd2=_0x5284d0[_0x5a7c('0x13')](/\n/);for(var _0x3887dd=0x0,_0x347d7a=_0xe27d6b['length'];_0x3887dd<_0x347d7a,_0x512674===![];_0x3887dd+=0x1){if(_0x5284d0['indexOf'](_0xe27d6b[_0x3887dd])>=0x0){_0x512674=!![];}}if(!_0x512674){throw new Error(util[_0x5a7c('0xf')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x25eac8[_0x5a7c('0x11')][_0x5a7c('0x12')]));}process['kill'](_0x25eac8[_0x5a7c('0x11')][_0x5a7c('0x12')],_0x5a7c('0x14'));return _0xa52620[_0x5a7c('0x7')](0xc8)[_0x5a7c('0xd')]({'message':util[_0x5a7c('0xf')](_0x5a7c('0x15'),_0x25eac8['params']['pid'])});})['catch'](handleError(_0xa52620,null,'killProcess'));}; \ No newline at end of file +var _0xe86b=['inspect','name','status','send','index','getAllData','then','catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s'];(function(_0x4fa737,_0x1f9665){var _0x1b5d47=function(_0x1a791e){while(--_0x1a791e){_0x4fa737['push'](_0x4fa737['shift']());}};_0x1b5d47(++_0x1f9665);}(_0xe86b,0x173));var _0xbe86=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe86b[_0x2c91e9];return _0x13f0ff;};'use strict';var info=require(_0xbe86('0x0'));var exec=require('child_process')[_0xbe86('0x1')];var logger=require(_0xbe86('0x2'))('api');var util=require(_0xbe86('0x3'));var BPromise=require(_0xbe86('0x4'));var _=require('lodash');function handleError(_0x246b01,_0x5c0dad,_0xf69bc4){_0x5c0dad=_0x5c0dad||0x1f4;return function(_0x1f3e42){logger[_0xbe86('0x5')](_0xbe86('0x6'),_0xf69bc4,_0x5c0dad,util[_0xbe86('0x7')](_0x1f3e42,{'showHidden':![],'depth':null}));delete _0x1f3e42[_0xbe86('0x8')];_0x246b01[_0xbe86('0x9')](_0x5c0dad)[_0xbe86('0xa')](_0x1f3e42);};}exports[_0xbe86('0xb')]=function(_0x2f0273,_0x556041){return info[_0xbe86('0xc')]()[_0xbe86('0xd')](function(_0x4c7bd3){return _0x556041[_0xbe86('0x9')](0xc8)['json'](_0x4c7bd3);})[_0xbe86('0xe')](function(_0x5819ae){return _0x556041[_0xbe86('0x9')](0x1f4)[_0xbe86('0xf')](_0x5819ae);});};exports[_0xbe86('0x10')]=function(_0xdbe66d,_0xa8c968){var _0x37b650=[_0xbe86('0x11')];return new BPromise(function(_0x318909,_0x560fb5){return exec(util[_0xbe86('0x12')](_0xbe86('0x13'),_0xdbe66d['params']['pid']),function(_0x5afa69,_0x23ce35,_0x5f1f9e){if(_0x5afa69){return _0x560fb5(_0x5afa69);}return _0x318909(_0x23ce35);});})[_0xbe86('0xd')](function(_0x92e10e){var _0x5337ab=![];var _0x4259c9=_0x92e10e['split'](/\n/);for(var _0x565d9f=0x0,_0x3fc785=_0x37b650[_0xbe86('0x14')];_0x565d9f<_0x3fc785,_0x5337ab===![];_0x565d9f+=0x1){if(_0x92e10e[_0xbe86('0x15')](_0x37b650[_0x565d9f])>=0x0){_0x5337ab=!![];}}if(!_0x5337ab){throw new Error(util[_0xbe86('0x12')](_0xbe86('0x16'),_0xdbe66d[_0xbe86('0x17')][_0xbe86('0x18')]));}process['kill'](_0xdbe66d[_0xbe86('0x17')][_0xbe86('0x18')],_0xbe86('0x19'));return _0xa8c968[_0xbe86('0x9')](0xc8)[_0xbe86('0xf')]({'message':util['format'](_0xbe86('0x1a'),_0xdbe66d[_0xbe86('0x17')][_0xbe86('0x18')])});})[_0xbe86('0xe')](handleError(_0xa8c968,null,_0xbe86('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index d843cf9..a67491e 100644 --- a/server/api/tag/index.js +++ b/server/api/tag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1339=['./tag.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x27c201,_0xd947bf){var _0x3cabde=function(_0x4cf697){while(--_0x4cf697){_0x27c201['push'](_0x27c201['shift']());}};_0x3cabde(++_0xd947bf);}(_0x1339,0x1ed));var _0x9133=function(_0xac3c6f,_0x21f17a){_0xac3c6f=_0xac3c6f-0x0;var _0x123e72=_0x1339[_0xac3c6f];return _0x123e72;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var auth=require(_0x9133('0x4'));var interaction=require(_0x9133('0x5'));var config=require(_0x9133('0x6'));var controller=require(_0x9133('0x7'));router['get']('/',auth[_0x9133('0x8')](),controller[_0x9133('0x9')]);router[_0x9133('0xa')]('/:id',auth[_0x9133('0x8')](),controller[_0x9133('0xb')]);router[_0x9133('0xc')]('/',auth[_0x9133('0x8')](),controller[_0x9133('0xd')]);router[_0x9133('0xe')](_0x9133('0xf'),auth[_0x9133('0x8')](),controller[_0x9133('0x10')]);router[_0x9133('0x11')]('/:id',auth[_0x9133('0x8')](),controller[_0x9133('0x12')]);module[_0x9133('0x13')]=router; \ No newline at end of file +var _0xb821=['post','create','put','update','delete','destroy','exports','util','path','Router','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show'];(function(_0x222bd3,_0x4c9a4f){var _0x4bed46=function(_0x4a0261){while(--_0x4a0261){_0x222bd3['push'](_0x222bd3['shift']());}};_0x4bed46(++_0x4c9a4f);}(_0xb821,0xa7));var _0x1b82=function(_0x161df3,_0x1bf4ea){_0x161df3=_0x161df3-0x0;var _0x2acc6e=_0xb821[_0x161df3];return _0x2acc6e;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b82('0x3'));var controller=require(_0x1b82('0x4'));router[_0x1b82('0x5')]('/',auth[_0x1b82('0x6')](),controller['index']);router[_0x1b82('0x5')](_0x1b82('0x7'),auth[_0x1b82('0x6')](),controller[_0x1b82('0x8')]);router[_0x1b82('0x9')]('/',auth[_0x1b82('0x6')](),controller[_0x1b82('0xa')]);router[_0x1b82('0xb')](_0x1b82('0x7'),auth['isAuthenticated'](),controller[_0x1b82('0xc')]);router[_0x1b82('0xd')](_0x1b82('0x7'),auth[_0x1b82('0x6')](),controller[_0x1b82('0xe')]);module[_0x1b82('0xf')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index bd2bef7..f9064af 100644 --- a/server/api/tag/tag.attributes.js +++ b/server/api/tag/tag.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3423=['name','#0091EA','STRING'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3342('0x0')],'defaultValue':_0x3342('0x2')},'description':{'type':Sequelize[_0x3342('0x0')]}}; \ No newline at end of file +var _0x087b=['sequelize','exports','STRING'];(function(_0x298ff6,_0x32445b){var _0x324a34=function(_0x397c69){while(--_0x397c69){_0x298ff6['push'](_0x298ff6['shift']());}};_0x324a34(++_0x32445b);}(_0x087b,0x11a));var _0xb087=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x087b[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require(_0xb087('0x0'));module[_0xb087('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xb087('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xb087('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 287e490..94063cc 100644 --- a/server/api/tag/tag.controller.js +++ b/server/api/tag/tag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x608a=['include','findAll','rows','catch','show','length','options','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','limit','set','Content-Range','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','name','send','index','Tag','rawAttributes','model','keys','filters','intersection','fields','query','attributes','hasOwnProperty','offset','order','sort','where','pick','merge','map','type','key','filter','count','includeAll'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x608a,0xff));var _0xa608=function(_0x1fc47b,_0x3fa1f0){_0x1fc47b=_0x1fc47b-0x0;var _0x33a9a4=_0x608a[_0x1fc47b];return _0x33a9a4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa608('0x0'));var rimraf=require(_0xa608('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa608('0x2'));var rp=require(_0xa608('0x3'));var moment=require(_0xa608('0x4'));var BPromise=require(_0xa608('0x5'));var Mustache=require('mustache');var util=require(_0xa608('0x6'));var path=require(_0xa608('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa608('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa608('0x9'));var crypto=require(_0xa608('0xa'));var jsforce=require(_0xa608('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa608('0xc'));var querystring=require('querystring');var Papa=require(_0xa608('0xd'));var Redis=require(_0xa608('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa608('0xf'));var hardwareService=require(_0xa608('0x10'));var logger=require(_0xa608('0x11'))(_0xa608('0x12'));var utils=require('../../config/utils');var config=require(_0xa608('0x13'));var db=require(_0xa608('0x14'))['db'];function respondWithStatusCode(_0x2f90a1,_0x15e29f){_0x15e29f=_0x15e29f||0xcc;return function(_0x30d74b){if(_0x30d74b){return _0x2f90a1['sendStatus'](_0x15e29f);}return _0x2f90a1[_0xa608('0x15')](_0x15e29f)[_0xa608('0x16')]();};}function respondWithResult(_0x5cc272,_0x55642d){_0x55642d=_0x55642d||0xc8;return function(_0x162821){if(_0x162821){return _0x5cc272[_0xa608('0x15')](_0x55642d)[_0xa608('0x17')](_0x162821);}};}function respondWithFilteredResult(_0x1b223c,_0x565a3f){return function(_0x35cd7a){if(_0x35cd7a){var _0x4564f5=_0x35cd7a['count'],_0x49d154=_0x565a3f['offset'],_0xf4fcf6=_0x565a3f['offset']+_0x565a3f[_0xa608('0x18')],_0x2d6790;if(_0xf4fcf6>=_0x4564f5){_0xf4fcf6=_0x4564f5;_0x2d6790=0xc8;}else{_0x2d6790=0xce;}_0x1b223c[_0xa608('0x15')](_0x2d6790);return _0x1b223c[_0xa608('0x19')](_0xa608('0x1a'),_0x49d154+'-'+_0xf4fcf6+'/'+_0x4564f5)['json'](_0x35cd7a);}return null;};}function patchUpdates(_0x5c4167){return function(_0x349397){try{jsonpatch['apply'](_0x349397,_0x5c4167,!![]);}catch(_0x1b568f){return BPromise[_0xa608('0x1b')](_0x1b568f);}return _0x349397[_0xa608('0x1c')]();};}function saveUpdates(_0x345e7b,_0x33b96d){return function(_0x408060){if(_0x408060){return _0x408060[_0xa608('0x1d')](_0x345e7b)[_0xa608('0x1e')](function(_0x37abec){return _0x37abec;});}return null;};}function removeEntity(_0x272fd2,_0x3f152f){return function(_0x30bb22){if(_0x30bb22){return _0x30bb22[_0xa608('0x1f')]()[_0xa608('0x1e')](function(){var _0x566424=_0x30bb22[_0xa608('0x20')]({'plain':!![]});var _0x4d9de0=_0xa608('0x21');return db[_0xa608('0x22')][_0xa608('0x1f')]({'where':{'type':_0x4d9de0,'resourceId':_0x566424['id']}})[_0xa608('0x1e')](function(){return _0x30bb22;});})[_0xa608('0x1e')](function(){_0x272fd2[_0xa608('0x15')](0xcc)[_0xa608('0x16')]();});}};}function handleEntityNotFound(_0x121119,_0x22df89){return function(_0x497107){if(!_0x497107){_0x121119['sendStatus'](0x194);}return _0x497107;};}function handleError(_0x287f89,_0x464270){_0x464270=_0x464270||0x1f4;return function(_0x38d67b){logger[_0xa608('0x23')](_0x38d67b['stack']);if(_0x38d67b[_0xa608('0x24')]){delete _0x38d67b[_0xa608('0x24')];}_0x287f89[_0xa608('0x15')](_0x464270)[_0xa608('0x25')](_0x38d67b);};}exports[_0xa608('0x26')]=function(_0x4ab12f,_0x449633){var _0x1d9977={},_0x529f42={},_0x2d6ca4={'count':0x0,'rows':[]};var _0x5a20e0=db[_0xa608('0x27')][_0xa608('0x28')];_0x529f42[_0xa608('0x29')]=_[_0xa608('0x2a')](_0x5a20e0);_0x529f42['query']=_['keys'](_0x4ab12f['query']);_0x529f42[_0xa608('0x2b')]=_[_0xa608('0x2c')](_0x529f42['model'],_0x529f42['query']);_0x1d9977['attributes']=_['intersection'](_0x529f42[_0xa608('0x29')],qs[_0xa608('0x2d')](_0x4ab12f[_0xa608('0x2e')][_0xa608('0x2d')]));_0x1d9977[_0xa608('0x2f')]=_0x1d9977['attributes']['length']?_0x1d9977[_0xa608('0x2f')]:_0x529f42['model'];if(!_0x4ab12f[_0xa608('0x2e')][_0xa608('0x30')]('nolimit')){_0x1d9977[_0xa608('0x18')]=qs[_0xa608('0x18')](_0x4ab12f['query']['limit']);_0x1d9977[_0xa608('0x31')]=qs[_0xa608('0x31')](_0x4ab12f[_0xa608('0x2e')]['offset']);}_0x1d9977[_0xa608('0x32')]=qs[_0xa608('0x33')](_0x4ab12f[_0xa608('0x2e')][_0xa608('0x33')]);_0x1d9977[_0xa608('0x34')]=qs['filters'](_[_0xa608('0x35')](_0x4ab12f[_0xa608('0x2e')],_0x529f42['filters']));if(_0x4ab12f[_0xa608('0x2e')]['filter']){_0x1d9977[_0xa608('0x34')]=_[_0xa608('0x36')](_0x1d9977[_0xa608('0x34')],{'$or':_[_0xa608('0x37')](_0x5a20e0,function(_0xc21362){if(_0xc21362[_0xa608('0x38')][_0xa608('0x39')]!=='VIRTUAL'){var _0x4b49af={};_0x4b49af[_0xc21362['field']]={'$like':'%'+_0x4ab12f[_0xa608('0x2e')][_0xa608('0x3a')]+'%'};return _0x4b49af;}})});}_0x1d9977=_[_0xa608('0x36')]({},_0x1d9977,_0x4ab12f['options']);var _0x29de65={'where':_0x1d9977['where']};return db['Tag'][_0xa608('0x3b')](_0x29de65)[_0xa608('0x1e')](function(_0x332cb8){_0x2d6ca4[_0xa608('0x3b')]=_0x332cb8;if(_0x4ab12f['query'][_0xa608('0x3c')]){_0x1d9977[_0xa608('0x3d')]=[{'all':!![]}];}return db[_0xa608('0x27')][_0xa608('0x3e')](_0x1d9977);})[_0xa608('0x1e')](function(_0x2d1a41){_0x2d6ca4[_0xa608('0x3f')]=_0x2d1a41;return _0x2d6ca4;})[_0xa608('0x1e')](respondWithFilteredResult(_0x449633,_0x1d9977))[_0xa608('0x40')](handleError(_0x449633,null));};exports[_0xa608('0x41')]=function(_0x5b36e3,_0x456811){var _0x22f100={'raw':!![],'where':{'id':_0x5b36e3['params']['id']}},_0xa7c674={};_0xa7c674[_0xa608('0x29')]=_[_0xa608('0x2a')](db[_0xa608('0x27')][_0xa608('0x28')]);_0xa7c674[_0xa608('0x2e')]=_[_0xa608('0x2a')](_0x5b36e3[_0xa608('0x2e')]);_0xa7c674['filters']=_[_0xa608('0x2c')](_0xa7c674[_0xa608('0x29')],_0xa7c674[_0xa608('0x2e')]);_0x22f100['attributes']=_[_0xa608('0x2c')](_0xa7c674[_0xa608('0x29')],qs[_0xa608('0x2d')](_0x5b36e3[_0xa608('0x2e')]['fields']));_0x22f100[_0xa608('0x2f')]=_0x22f100[_0xa608('0x2f')][_0xa608('0x42')]?_0x22f100[_0xa608('0x2f')]:_0xa7c674[_0xa608('0x29')];if(_0x5b36e3['query'][_0xa608('0x3c')]){_0x22f100[_0xa608('0x3d')]=[{'all':!![]}];}_0x22f100=_[_0xa608('0x36')]({},_0x22f100,_0x5b36e3[_0xa608('0x43')]);return db[_0xa608('0x27')]['find'](_0x22f100)[_0xa608('0x1e')](handleEntityNotFound(_0x456811,null))[_0xa608('0x1e')](respondWithResult(_0x456811,null))[_0xa608('0x40')](handleError(_0x456811,null));};exports['create']=function(_0x35cd12,_0x550b16){return db[_0xa608('0x27')]['create'](_0x35cd12[_0xa608('0x44')],{})[_0xa608('0x1e')](function(_0x85c01b){var _0x318972=_0x35cd12['user']['get']({'plain':!![]});if(!_0x318972)throw new Error(_0xa608('0x45'));if(_0x318972[_0xa608('0x46')]===_0xa608('0x47')){var _0x5ca777=_0x85c01b[_0xa608('0x20')]({'plain':!![]});var _0x14b022='Tags';return db[_0xa608('0x48')][_0xa608('0x49')]({'where':{'name':_0x14b022,'userProfileId':_0x318972[_0xa608('0x4a')]},'raw':!![]})['then'](function(_0x281f9a){if(_0x281f9a&&_0x281f9a[_0xa608('0x4b')]===0x0){return db['UserProfileResource'][_0xa608('0x4c')]({'name':_0x5ca777[_0xa608('0x24')],'resourceId':_0x5ca777['id'],'type':_0x281f9a['name'],'sectionId':_0x281f9a['id']},{})['then'](function(){return _0x85c01b;});}else{return _0x85c01b;}})[_0xa608('0x40')](function(_0x3fbf46){logger[_0xa608('0x23')](_0xa608('0x4d'),_0x3fbf46);throw _0x3fbf46;});}return _0x85c01b;})[_0xa608('0x1e')](respondWithResult(_0x550b16,0xc9))[_0xa608('0x40')](handleError(_0x550b16,null));};exports[_0xa608('0x1d')]=function(_0xa37955,_0x950ce1){if(_0xa37955['body']['id']){delete _0xa37955[_0xa608('0x44')]['id'];}return db['Tag'][_0xa608('0x49')]({'where':{'id':_0xa37955[_0xa608('0x4e')]['id']}})[_0xa608('0x1e')](handleEntityNotFound(_0x950ce1,null))[_0xa608('0x1e')](saveUpdates(_0xa37955[_0xa608('0x44')],null))[_0xa608('0x1e')](respondWithResult(_0x950ce1,null))[_0xa608('0x40')](handleError(_0x950ce1,null));};exports[_0xa608('0x1f')]=function(_0x5d87ba,_0x470d34){return db[_0xa608('0x27')][_0xa608('0x49')]({'where':{'id':_0x5d87ba[_0xa608('0x4e')]['id']}})[_0xa608('0x1e')](handleEntityNotFound(_0x470d34,null))[_0xa608('0x1e')](removeEntity(_0x470d34,null))['catch'](handleError(_0x470d34,null));}; \ No newline at end of file +var _0xcc8d=['pick','filter','where','merge','map','type','VIRTUAL','field','includeAll','include','findAll','rows','show','intersection','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','apply','reject','save','update','then','destroy','get','sendStatus','stack','name','send','Tag','rawAttributes','model','keys','query','filters','attributes','fields','length','limit','order'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0xcc8d,0xbb));var _0xdcc8=function(_0x1c6efd,_0xb2f3cd){_0x1c6efd=_0x1c6efd-0x0;var _0x53a918=_0xcc8d[_0x1c6efd];return _0x53a918;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdcc8('0x0'));var rimraf=require(_0xdcc8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdcc8('0x2'));var moment=require(_0xdcc8('0x3'));var BPromise=require(_0xdcc8('0x4'));var Mustache=require(_0xdcc8('0x5'));var util=require(_0xdcc8('0x6'));var path=require(_0xdcc8('0x7'));var sox=require(_0xdcc8('0x8'));var csv=require('to-csv');var ejs=require(_0xdcc8('0x9'));var fs=require('fs');var _=require(_0xdcc8('0xa'));var squel=require(_0xdcc8('0xb'));var crypto=require(_0xdcc8('0xc'));var jsforce=require(_0xdcc8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdcc8('0xe'));var querystring=require(_0xdcc8('0xf'));var Papa=require(_0xdcc8('0x10'));var Redis=require(_0xdcc8('0x11'));var authService=require(_0xdcc8('0x12'));var qs=require(_0xdcc8('0x13'));var hardwareService=require(_0xdcc8('0x14'));var logger=require(_0xdcc8('0x15'))(_0xdcc8('0x16'));var utils=require(_0xdcc8('0x17'));var config=require(_0xdcc8('0x18'));var db=require(_0xdcc8('0x19'))['db'];function respondWithStatusCode(_0x59af51,_0x4160ff){_0x4160ff=_0x4160ff||0xcc;return function(_0x37d3c1){if(_0x37d3c1){return _0x59af51['sendStatus'](_0x4160ff);}return _0x59af51[_0xdcc8('0x1a')](_0x4160ff)[_0xdcc8('0x1b')]();};}function respondWithResult(_0xb23ffe,_0x378a27){_0x378a27=_0x378a27||0xc8;return function(_0x583375){if(_0x583375){return _0xb23ffe[_0xdcc8('0x1a')](_0x378a27)[_0xdcc8('0x1c')](_0x583375);}};}function respondWithFilteredResult(_0x52ba88,_0x2bd45c){return function(_0x54541f){if(_0x54541f){var _0x5f599=_0x54541f[_0xdcc8('0x1d')],_0x3dfd45=_0x2bd45c[_0xdcc8('0x1e')],_0xc04807=_0x2bd45c[_0xdcc8('0x1e')]+_0x2bd45c['limit'],_0x33f2e5;if(_0xc04807>=_0x5f599){_0xc04807=_0x5f599;_0x33f2e5=0xc8;}else{_0x33f2e5=0xce;}_0x52ba88['status'](_0x33f2e5);return _0x52ba88['set']('Content-Range',_0x3dfd45+'-'+_0xc04807+'/'+_0x5f599)['json'](_0x54541f);}return null;};}function patchUpdates(_0x371807){return function(_0x4dff9b){try{jsonpatch[_0xdcc8('0x1f')](_0x4dff9b,_0x371807,!![]);}catch(_0x249f47){return BPromise[_0xdcc8('0x20')](_0x249f47);}return _0x4dff9b[_0xdcc8('0x21')]();};}function saveUpdates(_0x29dcfd,_0x57b7b8){return function(_0x4a34a0){if(_0x4a34a0){return _0x4a34a0[_0xdcc8('0x22')](_0x29dcfd)[_0xdcc8('0x23')](function(_0x203f8d){return _0x203f8d;});}return null;};}function removeEntity(_0xeb9825,_0x42631f){return function(_0x25e9e6){if(_0x25e9e6){return _0x25e9e6[_0xdcc8('0x24')]()[_0xdcc8('0x23')](function(){var _0x19b300=_0x25e9e6[_0xdcc8('0x25')]({'plain':!![]});var _0x415514='Tags';return db['UserProfileResource']['destroy']({'where':{'type':_0x415514,'resourceId':_0x19b300['id']}})['then'](function(){return _0x25e9e6;});})[_0xdcc8('0x23')](function(){_0xeb9825[_0xdcc8('0x1a')](0xcc)[_0xdcc8('0x1b')]();});}};}function handleEntityNotFound(_0x289ee9,_0x1f7c0a){return function(_0x2271d7){if(!_0x2271d7){_0x289ee9[_0xdcc8('0x26')](0x194);}return _0x2271d7;};}function handleError(_0x2f4541,_0x1e9051){_0x1e9051=_0x1e9051||0x1f4;return function(_0x79f872){logger['error'](_0x79f872[_0xdcc8('0x27')]);if(_0x79f872[_0xdcc8('0x28')]){delete _0x79f872[_0xdcc8('0x28')];}_0x2f4541['status'](_0x1e9051)[_0xdcc8('0x29')](_0x79f872);};}exports['index']=function(_0x3c5d48,_0x7f0684){var _0x333d40={},_0x25e80d={},_0x16c40c={'count':0x0,'rows':[]};var _0x55fd9f=db[_0xdcc8('0x2a')][_0xdcc8('0x2b')];_0x25e80d[_0xdcc8('0x2c')]=_[_0xdcc8('0x2d')](_0x55fd9f);_0x25e80d['query']=_['keys'](_0x3c5d48[_0xdcc8('0x2e')]);_0x25e80d[_0xdcc8('0x2f')]=_['intersection'](_0x25e80d[_0xdcc8('0x2c')],_0x25e80d['query']);_0x333d40[_0xdcc8('0x30')]=_['intersection'](_0x25e80d[_0xdcc8('0x2c')],qs['fields'](_0x3c5d48[_0xdcc8('0x2e')][_0xdcc8('0x31')]));_0x333d40[_0xdcc8('0x30')]=_0x333d40['attributes'][_0xdcc8('0x32')]?_0x333d40['attributes']:_0x25e80d[_0xdcc8('0x2c')];if(!_0x3c5d48[_0xdcc8('0x2e')]['hasOwnProperty']('nolimit')){_0x333d40['limit']=qs[_0xdcc8('0x33')](_0x3c5d48[_0xdcc8('0x2e')][_0xdcc8('0x33')]);_0x333d40[_0xdcc8('0x1e')]=qs[_0xdcc8('0x1e')](_0x3c5d48[_0xdcc8('0x2e')][_0xdcc8('0x1e')]);}_0x333d40[_0xdcc8('0x34')]=qs['sort'](_0x3c5d48[_0xdcc8('0x2e')]['sort']);_0x333d40['where']=qs[_0xdcc8('0x2f')](_[_0xdcc8('0x35')](_0x3c5d48['query'],_0x25e80d[_0xdcc8('0x2f')]));if(_0x3c5d48['query'][_0xdcc8('0x36')]){_0x333d40[_0xdcc8('0x37')]=_[_0xdcc8('0x38')](_0x333d40[_0xdcc8('0x37')],{'$or':_[_0xdcc8('0x39')](_0x55fd9f,function(_0x5c702a){if(_0x5c702a[_0xdcc8('0x3a')]['key']!==_0xdcc8('0x3b')){var _0x4d34f3={};_0x4d34f3[_0x5c702a[_0xdcc8('0x3c')]]={'$like':'%'+_0x3c5d48[_0xdcc8('0x2e')][_0xdcc8('0x36')]+'%'};return _0x4d34f3;}})});}_0x333d40=_[_0xdcc8('0x38')]({},_0x333d40,_0x3c5d48['options']);var _0x2448a3={'where':_0x333d40[_0xdcc8('0x37')]};return db[_0xdcc8('0x2a')][_0xdcc8('0x1d')](_0x2448a3)['then'](function(_0x22f9f3){_0x16c40c['count']=_0x22f9f3;if(_0x3c5d48[_0xdcc8('0x2e')][_0xdcc8('0x3d')]){_0x333d40[_0xdcc8('0x3e')]=[{'all':!![]}];}return db['Tag'][_0xdcc8('0x3f')](_0x333d40);})['then'](function(_0x1c2c10){_0x16c40c[_0xdcc8('0x40')]=_0x1c2c10;return _0x16c40c;})[_0xdcc8('0x23')](respondWithFilteredResult(_0x7f0684,_0x333d40))['catch'](handleError(_0x7f0684,null));};exports[_0xdcc8('0x41')]=function(_0x4d5c6a,_0x58645a){var _0x54af4d={'raw':!![],'where':{'id':_0x4d5c6a['params']['id']}},_0x4cf0bb={};_0x4cf0bb[_0xdcc8('0x2c')]=_['keys'](db[_0xdcc8('0x2a')][_0xdcc8('0x2b')]);_0x4cf0bb[_0xdcc8('0x2e')]=_[_0xdcc8('0x2d')](_0x4d5c6a[_0xdcc8('0x2e')]);_0x4cf0bb[_0xdcc8('0x2f')]=_[_0xdcc8('0x42')](_0x4cf0bb['model'],_0x4cf0bb['query']);_0x54af4d[_0xdcc8('0x30')]=_[_0xdcc8('0x42')](_0x4cf0bb[_0xdcc8('0x2c')],qs['fields'](_0x4d5c6a[_0xdcc8('0x2e')][_0xdcc8('0x31')]));_0x54af4d['attributes']=_0x54af4d['attributes'][_0xdcc8('0x32')]?_0x54af4d[_0xdcc8('0x30')]:_0x4cf0bb[_0xdcc8('0x2c')];if(_0x4d5c6a['query'][_0xdcc8('0x3d')]){_0x54af4d[_0xdcc8('0x3e')]=[{'all':!![]}];}_0x54af4d=_[_0xdcc8('0x38')]({},_0x54af4d,_0x4d5c6a[_0xdcc8('0x43')]);return db[_0xdcc8('0x2a')]['find'](_0x54af4d)[_0xdcc8('0x23')](handleEntityNotFound(_0x58645a,null))[_0xdcc8('0x23')](respondWithResult(_0x58645a,null))[_0xdcc8('0x44')](handleError(_0x58645a,null));};exports[_0xdcc8('0x45')]=function(_0x1c2173,_0x1d03e2){return db[_0xdcc8('0x2a')][_0xdcc8('0x45')](_0x1c2173[_0xdcc8('0x46')],{})[_0xdcc8('0x23')](function(_0x3d4284){var _0x34654d=_0x1c2173['user'][_0xdcc8('0x25')]({'plain':!![]});if(!_0x34654d)throw new Error(_0xdcc8('0x47'));if(_0x34654d['role']===_0xdcc8('0x48')){var _0x5a2a7e=_0x3d4284[_0xdcc8('0x25')]({'plain':!![]});var _0x19fa64='Tags';return db[_0xdcc8('0x49')][_0xdcc8('0x4a')]({'where':{'name':_0x19fa64,'userProfileId':_0x34654d[_0xdcc8('0x4b')]},'raw':!![]})[_0xdcc8('0x23')](function(_0x1fcf87){if(_0x1fcf87&&_0x1fcf87[_0xdcc8('0x4c')]===0x0){return db[_0xdcc8('0x4d')][_0xdcc8('0x45')]({'name':_0x5a2a7e['name'],'resourceId':_0x5a2a7e['id'],'type':_0x1fcf87[_0xdcc8('0x28')],'sectionId':_0x1fcf87['id']},{})[_0xdcc8('0x23')](function(){return _0x3d4284;});}else{return _0x3d4284;}})[_0xdcc8('0x44')](function(_0x1b0f58){logger['error'](_0xdcc8('0x4e'),_0x1b0f58);throw _0x1b0f58;});}return _0x3d4284;})[_0xdcc8('0x23')](respondWithResult(_0x1d03e2,0xc9))[_0xdcc8('0x44')](handleError(_0x1d03e2,null));};exports['update']=function(_0xa22d65,_0x44349d){if(_0xa22d65[_0xdcc8('0x46')]['id']){delete _0xa22d65[_0xdcc8('0x46')]['id'];}return db[_0xdcc8('0x2a')][_0xdcc8('0x4a')]({'where':{'id':_0xa22d65[_0xdcc8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x44349d,null))['then'](saveUpdates(_0xa22d65[_0xdcc8('0x46')],null))[_0xdcc8('0x23')](respondWithResult(_0x44349d,null))[_0xdcc8('0x44')](handleError(_0x44349d,null));};exports[_0xdcc8('0x24')]=function(_0x356b8c,_0x495e79){return db['Tag']['find']({'where':{'id':_0x356b8c['params']['id']}})[_0xdcc8('0x23')](handleEntityNotFound(_0x495e79,null))[_0xdcc8('0x23')](removeEntity(_0x495e79,null))[_0xdcc8('0x44')](handleError(_0x495e79,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 6ace287..b884ba0 100644 --- a/server/api/tag/tag.model.js +++ b/server/api/tag/tag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9c6=['define','Tag','tools_tags','util','api','request-promise','rimraf','../../config/environment','./tag.attributes'];(function(_0x37d5ff,_0x5ee83b){var _0x146b37=function(_0x596170){while(--_0x596170){_0x37d5ff['push'](_0x37d5ff['shift']());}};_0x146b37(++_0x5ee83b);}(_0xb9c6,0x1c5));var _0x6b9c=function(_0x520769,_0x37f7ce){_0x520769=_0x520769-0x0;var _0x527ac5=_0xb9c6[_0x520769];return _0x527ac5;};'use strict';var _=require('lodash');var util=require(_0x6b9c('0x0'));var logger=require('../../config/logger')(_0x6b9c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6b9c('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b9c('0x3'));var config=require(_0x6b9c('0x4'));var attributes=require(_0x6b9c('0x5'));module['exports']=function(_0x1c220c,_0x26f7b2){return _0x1c220c[_0x6b9c('0x6')](_0x6b9c('0x7'),attributes,{'tableName':_0x6b9c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd811=['./tag.attributes','exports','define','Tag','tools_tags','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x188b14,_0x5550a7){var _0x51764a=function(_0x591ae0){while(--_0x591ae0){_0x188b14['push'](_0x188b14['shift']());}};_0x51764a(++_0x5550a7);}(_0xd811,0x165));var _0x1d81=function(_0x36acb3,_0x204e94){_0x36acb3=_0x36acb3-0x0;var _0x13976c=_0xd811[_0x36acb3];return _0x13976c;};'use strict';var _=require(_0x1d81('0x0'));var util=require(_0x1d81('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1d81('0x2'));var BPromise=require(_0x1d81('0x3'));var rp=require(_0x1d81('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d81('0x5'));var config=require('../../config/environment');var attributes=require(_0x1d81('0x6'));module[_0x1d81('0x7')]=function(_0x41d857,_0x3c0e8d){return _0x41d857[_0x1d81('0x8')](_0x1d81('0x9'),attributes,{'tableName':_0x1d81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index d71963c..1aa1a04 100644 --- a/server/api/tag/tag.rpc.js +++ b/server/api/tag/tag.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0xabb3e6,_0x9172cb){var _0x2d4bbb=function(_0x1c288c){while(--_0x1c288c){_0xabb3e6['push'](_0xabb3e6['shift']());}};_0x2d4bbb(++_0x9172cb);}(_0x54ef,0x112));var _0xf54e=function(_0xed6de0,_0x1ea8a9){_0xed6de0=_0xed6de0-0x0;var _0x3778a5=_0x54ef[_0xed6de0];return _0x3778a5;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('Tag,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('Tag,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file +var _0xd64b=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x323329,_0x1dcdcd){var _0x5c086a=function(_0xfd0192){while(--_0xfd0192){_0x323329['push'](_0x323329['shift']());}};_0x5c086a(++_0x1dcdcd);}(_0xd64b,0xc1));var _0xbd64=function(_0x4969d0,_0x4a5788){_0x4969d0=_0x4969d0-0x0;var _0x754944=_0xd64b[_0x4969d0];return _0x754944;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32995f,_0x3e700e,_0x38204e){return new BPromise(function(_0x3f1f17,_0x2b8543){return client[_0xbd64('0x8')](_0x32995f,_0x38204e)['then'](function(_0x5ae70c){logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));logger['debug'](_0xbd64('0xc'),_0x3e700e,_0xbd64('0xb'),JSON[_0xbd64('0xd')](_0x5ae70c));if(_0x5ae70c[_0xbd64('0xe')]){if(_0x5ae70c['error'][_0xbd64('0xf')]===0x1f4){logger['error'](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x2b8543(_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);}logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x3f1f17(_0x5ae70c['error'][_0xbd64('0x10')]);}else{logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));_0x3f1f17(_0x5ae70c[_0xbd64('0x11')]['message']);}})[_0xbd64('0x12')](function(_0x5332e0){logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5332e0);_0x2b8543(_0x5332e0);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 0d9b78c..1314fe0 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a8f=['addQueues','/:id/users','put','update','delete','destroy','removeQueues','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/queues','getQueues','getAgents','create','post'];(function(_0x1d5660,_0x433ed7){var _0x2d0a20=function(_0x4ec78){while(--_0x4ec78){_0x1d5660['push'](_0x1d5660['shift']());}};_0x2d0a20(++_0x433ed7);}(_0x3a8f,0x14d));var _0xf3a8=function(_0x4deaca,_0xc772f7){_0x4deaca=_0x4deaca-0x0;var _0x23d4c7=_0x3a8f[_0x4deaca];return _0x23d4c7;};'use strict';var multer=require(_0xf3a8('0x0'));var util=require(_0xf3a8('0x1'));var path=require(_0xf3a8('0x2'));var timeout=require('connect-timeout');var express=require(_0xf3a8('0x3'));var router=express[_0xf3a8('0x4')]();var auth=require(_0xf3a8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf3a8('0x6'));var controller=require('./team.controller');router[_0xf3a8('0x7')]('/',auth['isAuthenticated'](),controller[_0xf3a8('0x8')]);router[_0xf3a8('0x7')](_0xf3a8('0x9'),auth[_0xf3a8('0xa')](),controller[_0xf3a8('0xb')]);router[_0xf3a8('0x7')](_0xf3a8('0xc'),auth[_0xf3a8('0xa')](),controller[_0xf3a8('0xd')]);router[_0xf3a8('0x7')]('/:id/users',auth[_0xf3a8('0xa')](),controller[_0xf3a8('0xe')]);router['post']('/',auth[_0xf3a8('0xa')](),controller[_0xf3a8('0xf')]);router[_0xf3a8('0x10')](_0xf3a8('0xc'),auth[_0xf3a8('0xa')](),controller[_0xf3a8('0x11')]);router[_0xf3a8('0x10')](_0xf3a8('0x12'),auth[_0xf3a8('0xa')](),controller['addAgents']);router[_0xf3a8('0x13')](_0xf3a8('0x9'),auth[_0xf3a8('0xa')](),controller[_0xf3a8('0x14')]);router[_0xf3a8('0x15')](_0xf3a8('0x9'),auth[_0xf3a8('0xa')](),controller[_0xf3a8('0x16')]);router[_0xf3a8('0x15')]('/:id/queues',auth[_0xf3a8('0xa')](),controller[_0xf3a8('0x17')]);router['delete']('/:id/users',auth[_0xf3a8('0xa')](),controller['removeAgents']);module[_0xf3a8('0x18')]=router; \ No newline at end of file +var _0x9c75=['removeQueues','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','index','get','show','/:id/queues','isAuthenticated','getQueues','/:id/users','getAgents','post','addQueues','addAgents','put','/:id','update','delete','destroy'];(function(_0x104b25,_0x2750e6){var _0x2371fd=function(_0x2d4410){while(--_0x2d4410){_0x104b25['push'](_0x104b25['shift']());}};_0x2371fd(++_0x2750e6);}(_0x9c75,0x1c4));var _0x59c7=function(_0x57f590,_0x31e929){_0x57f590=_0x57f590-0x0;var _0x3181dd=_0x9c75[_0x57f590];return _0x3181dd;};'use strict';var multer=require(_0x59c7('0x0'));var util=require(_0x59c7('0x1'));var path=require('path');var timeout=require(_0x59c7('0x2'));var express=require(_0x59c7('0x3'));var router=express[_0x59c7('0x4')]();var auth=require(_0x59c7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x59c7('0x6'));var controller=require('./team.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x59c7('0x7')]);router[_0x59c7('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x59c7('0x9')]);router['get'](_0x59c7('0xa'),auth[_0x59c7('0xb')](),controller[_0x59c7('0xc')]);router[_0x59c7('0x8')](_0x59c7('0xd'),auth['isAuthenticated'](),controller[_0x59c7('0xe')]);router[_0x59c7('0xf')]('/',auth[_0x59c7('0xb')](),controller['create']);router[_0x59c7('0xf')](_0x59c7('0xa'),auth[_0x59c7('0xb')](),controller[_0x59c7('0x10')]);router[_0x59c7('0xf')](_0x59c7('0xd'),auth[_0x59c7('0xb')](),controller[_0x59c7('0x11')]);router[_0x59c7('0x12')](_0x59c7('0x13'),auth[_0x59c7('0xb')](),controller[_0x59c7('0x14')]);router[_0x59c7('0x15')]('/:id',auth[_0x59c7('0xb')](),controller[_0x59c7('0x16')]);router[_0x59c7('0x15')]('/:id/queues',auth['isAuthenticated'](),controller[_0x59c7('0x17')]);router['delete'](_0x59c7('0xd'),auth['isAuthenticated'](),controller[_0x59c7('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 4de42a6..bece469 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x032f=['exports','STRING','sequelize'];(function(_0x3bd170,_0x11c344){var _0x47caf0=function(_0x5cce2c){while(--_0x5cce2c){_0x3bd170['push'](_0x3bd170['shift']());}};_0x47caf0(++_0x11c344);}(_0x032f,0x16a));var _0xf032=function(_0x5ac71a,_0x13a4b0){_0x5ac71a=_0x5ac71a-0x0;var _0x36c828=_0x032f[_0x5ac71a];return _0x36c828;};'use strict';var Sequelize=require(_0xf032('0x0'));module[_0xf032('0x1')]={'name':{'type':Sequelize[_0xf032('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0xf032('0x2')]}}; \ No newline at end of file +var _0x2181=['exports','name','STRING'];(function(_0x3162ec,_0x391377){var _0x56b740=function(_0x1daeca){while(--_0x1daeca){_0x3162ec['push'](_0x3162ec['shift']());}};_0x56b740(++_0x391377);}(_0x2181,0x1b9));var _0x1218=function(_0x2c9b9b,_0x390e9f){_0x2c9b9b=_0x2c9b9b-0x0;var _0x243f31=_0x2181[_0x2c9b9b];return _0x243f31;};'use strict';var Sequelize=require('sequelize');module[_0x1218('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1218('0x1')},'description':{'type':Sequelize[_0x1218('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 280b78c..6e4bb80 100644 --- a/server/api/team/team.controller.js +++ b/server/api/team/team.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','redis','./team.socket','register','end','status','json','offset','limit','Content-Range','apply','reject','save','then','destroy','Teams','UserProfileResource','sendStatus','error','stack','name','send','index','Team','rawAttributes','keys','query','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','key','VIRTUAL','field','filter','options','count','includeAll','findAll','rows','params','intersection','include','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','isValidChannel','Sequelize','add','ids','remove','addAgents','Voice','Mail','Sms','Fax','Openchannel','each','User','online','voicePause','interface','upsert','isNil','format','SIP/%s','omit','spread','emit','removeAgents','voice','chat','mail','sms','fax','openchannel','userTeam:remove','getAgents','html-pdf','request-promise','mustache','util'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3e1712,_0x17a6f3){_0x3e1712=_0x3e1712-0x0;var _0x45341f=_0xf4eb[_0x3e1712];return _0x45341f;};'use strict';var pdf=require(_0xbf4e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf4e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf4e('0x2'));var util=require(_0xbf4e('0x3'));var path=require(_0xbf4e('0x4'));var sox=require(_0xbf4e('0x5'));var csv=require(_0xbf4e('0x6'));var ejs=require(_0xbf4e('0x7'));var fs=require('fs');var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x6'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var hardwareService=require(_0xbf4e('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xbf4e('0x10'));var config=require('../../config/environment');var db=require(_0xbf4e('0x11'))['db'];config[_0xbf4e('0x12')]=_['defaults'](config[_0xbf4e('0x12')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf4e('0x12')]));require(_0xbf4e('0x13'))[_0xbf4e('0x14')](socket);function respondWithStatusCode(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xcc;return function(_0x61bd54){if(_0x61bd54){return _0x302841['sendStatus'](_0x3b74bd);}return _0x302841['status'](_0x3b74bd)[_0xbf4e('0x15')]();};}function respondWithResult(_0x1735ae,_0x28fc6b){_0x28fc6b=_0x28fc6b||0xc8;return function(_0x542909){if(_0x542909){return _0x1735ae[_0xbf4e('0x16')](_0x28fc6b)[_0xbf4e('0x17')](_0x542909);}};}function respondWithFilteredResult(_0x912fc0,_0x320e7d){return function(_0x5a631e){if(_0x5a631e){var _0x247322=_0x5a631e['count'],_0x577c27=_0x320e7d[_0xbf4e('0x18')],_0x5db03f=_0x320e7d[_0xbf4e('0x18')]+_0x320e7d[_0xbf4e('0x19')],_0x566ec3;if(_0x5db03f>=_0x247322){_0x5db03f=_0x247322;_0x566ec3=0xc8;}else{_0x566ec3=0xce;}_0x912fc0['status'](_0x566ec3);return _0x912fc0['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x5db03f+'/'+_0x247322)[_0xbf4e('0x17')](_0x5a631e);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1b')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1c')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1d')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1e')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x1f')]()[_0xbf4e('0x1e')](function(){var _0x3a5d72=_0x30994d['get']({'plain':!![]});var _0x90635e=_0xbf4e('0x20');return db[_0xbf4e('0x21')]['destroy']({'where':{'type':_0x90635e,'resourceId':_0x3a5d72['id']}})[_0xbf4e('0x1e')](function(){return _0x30994d;});})['then'](function(){_0x51648c['status'](0xcc)[_0xbf4e('0x15')]();});}};}function handleEntityNotFound(_0x5a0a9b,_0x38c923){return function(_0x315df3){if(!_0x315df3){_0x5a0a9b[_0xbf4e('0x22')](0x194);}return _0x315df3;};}function handleError(_0x41f918,_0x5c912f){_0x5c912f=_0x5c912f||0x1f4;return function(_0x2d4686){logger[_0xbf4e('0x23')](_0x2d4686[_0xbf4e('0x24')]);if(_0x2d4686['name']){delete _0x2d4686[_0xbf4e('0x25')];}_0x41f918['status'](_0x5c912f)[_0xbf4e('0x26')](_0x2d4686);};}exports[_0xbf4e('0x27')]=function(_0xb8b58e,_0x498dbd){var _0x1d12e2={},_0x362716={},_0x2f3cf8={'count':0x0,'rows':[]};var _0xc7ca87=db[_0xbf4e('0x28')][_0xbf4e('0x29')];_0x362716['model']=_[_0xbf4e('0x2a')](_0xc7ca87);_0x362716[_0xbf4e('0x2b')]=_['keys'](_0xb8b58e[_0xbf4e('0x2b')]);_0x362716[_0xbf4e('0x2c')]=_['intersection'](_0x362716[_0xbf4e('0x2d')],_0x362716['query']);_0x1d12e2[_0xbf4e('0x2e')]=_['intersection'](_0x362716[_0xbf4e('0x2d')],qs[_0xbf4e('0x2f')](_0xb8b58e[_0xbf4e('0x2b')]['fields']));_0x1d12e2[_0xbf4e('0x2e')]=_0x1d12e2[_0xbf4e('0x2e')][_0xbf4e('0x30')]?_0x1d12e2[_0xbf4e('0x2e')]:_0x362716[_0xbf4e('0x2d')];if(!_0xb8b58e[_0xbf4e('0x2b')]['hasOwnProperty'](_0xbf4e('0x31'))){_0x1d12e2[_0xbf4e('0x19')]=qs[_0xbf4e('0x19')](_0xb8b58e[_0xbf4e('0x2b')][_0xbf4e('0x19')]);_0x1d12e2['offset']=qs['offset'](_0xb8b58e['query']['offset']);}_0x1d12e2[_0xbf4e('0x32')]=qs[_0xbf4e('0x33')](_0xb8b58e[_0xbf4e('0x2b')][_0xbf4e('0x33')]);_0x1d12e2[_0xbf4e('0x34')]=qs[_0xbf4e('0x2c')](_[_0xbf4e('0x35')](_0xb8b58e[_0xbf4e('0x2b')],_0x362716[_0xbf4e('0x2c')]));if(_0xb8b58e['query']['filter']){_0x1d12e2[_0xbf4e('0x34')]=_[_0xbf4e('0x36')](_0x1d12e2[_0xbf4e('0x34')],{'$or':_['map'](_0xc7ca87,function(_0x3f46f1){if(_0x3f46f1['type'][_0xbf4e('0x37')]!==_0xbf4e('0x38')){var _0xd0bcf0={};_0xd0bcf0[_0x3f46f1[_0xbf4e('0x39')]]={'$like':'%'+_0xb8b58e['query'][_0xbf4e('0x3a')]+'%'};return _0xd0bcf0;}})});}_0x1d12e2=_[_0xbf4e('0x36')]({},_0x1d12e2,_0xb8b58e[_0xbf4e('0x3b')]);var _0x3d5123={'where':_0x1d12e2['where']};return db[_0xbf4e('0x28')][_0xbf4e('0x3c')](_0x3d5123)[_0xbf4e('0x1e')](function(_0x29fe9d){_0x2f3cf8[_0xbf4e('0x3c')]=_0x29fe9d;if(_0xb8b58e[_0xbf4e('0x2b')][_0xbf4e('0x3d')]){_0x1d12e2['include']=[{'all':!![]}];}return db[_0xbf4e('0x28')][_0xbf4e('0x3e')](_0x1d12e2);})['then'](function(_0x47d6f2){_0x2f3cf8[_0xbf4e('0x3f')]=_0x47d6f2;return _0x2f3cf8;})[_0xbf4e('0x1e')](respondWithFilteredResult(_0x498dbd,_0x1d12e2))['catch'](handleError(_0x498dbd,null));};exports['show']=function(_0x2b1bf4,_0x150224){var _0x35906d={'raw':![],'where':{'id':_0x2b1bf4[_0xbf4e('0x40')]['id']}},_0x29d68e={};_0x29d68e[_0xbf4e('0x2d')]=_['keys'](db[_0xbf4e('0x28')][_0xbf4e('0x29')]);_0x29d68e['query']=_['keys'](_0x2b1bf4['query']);_0x29d68e['filters']=_[_0xbf4e('0x41')](_0x29d68e['model'],_0x29d68e[_0xbf4e('0x2b')]);_0x35906d[_0xbf4e('0x2e')]=_['intersection'](_0x29d68e['model'],qs[_0xbf4e('0x2f')](_0x2b1bf4[_0xbf4e('0x2b')][_0xbf4e('0x2f')]));_0x35906d[_0xbf4e('0x2e')]=_0x35906d[_0xbf4e('0x2e')]['length']?_0x35906d[_0xbf4e('0x2e')]:_0x29d68e[_0xbf4e('0x2d')];if(_0x2b1bf4[_0xbf4e('0x2b')][_0xbf4e('0x3d')]){_0x35906d[_0xbf4e('0x42')]=[{'all':!![]}];}_0x35906d=_[_0xbf4e('0x36')]({},_0x35906d,_0x2b1bf4[_0xbf4e('0x3b')]);return db[_0xbf4e('0x28')]['find'](_0x35906d)[_0xbf4e('0x1e')](handleEntityNotFound(_0x150224,null))[_0xbf4e('0x1e')](respondWithResult(_0x150224,null))[_0xbf4e('0x43')](handleError(_0x150224,null));};exports[_0xbf4e('0x44')]=function(_0x9bc1fe,_0x1198e8){return db[_0xbf4e('0x28')][_0xbf4e('0x44')](_0x9bc1fe[_0xbf4e('0x45')],{})[_0xbf4e('0x1e')](function(_0x2fdba9){var _0x6fd78d=_0x9bc1fe[_0xbf4e('0x46')][_0xbf4e('0x47')]({'plain':!![]});if(!_0x6fd78d)throw new Error(_0xbf4e('0x48'));if(_0x6fd78d[_0xbf4e('0x49')]===_0xbf4e('0x46')){var _0x5492bf=_0x2fdba9[_0xbf4e('0x47')]({'plain':!![]});var _0x17a7be=_0xbf4e('0x20');return db['UserProfileSection'][_0xbf4e('0x4a')]({'where':{'name':_0x17a7be,'userProfileId':_0x6fd78d['userProfileId']},'raw':!![]})['then'](function(_0x3832c3){if(_0x3832c3&&_0x3832c3[_0xbf4e('0x4b')]===0x0){return db['UserProfileResource'][_0xbf4e('0x44')]({'name':_0x5492bf[_0xbf4e('0x25')],'resourceId':_0x5492bf['id'],'type':_0x3832c3[_0xbf4e('0x25')],'sectionId':_0x3832c3['id']},{})[_0xbf4e('0x1e')](function(){return _0x2fdba9;});}else{return _0x2fdba9;}})[_0xbf4e('0x43')](function(_0x2ac2c8){logger[_0xbf4e('0x23')](_0xbf4e('0x4c'),_0x2ac2c8);throw _0x2ac2c8;});}return _0x2fdba9;})[_0xbf4e('0x1e')](respondWithResult(_0x1198e8,0xc9))[_0xbf4e('0x43')](handleError(_0x1198e8,null));};exports[_0xbf4e('0x4d')]=function(_0x5659bd,_0x5d6324){if(_0x5659bd[_0xbf4e('0x45')]['id']){delete _0x5659bd[_0xbf4e('0x45')]['id'];}return db[_0xbf4e('0x28')]['find']({'where':{'id':_0x5659bd[_0xbf4e('0x40')]['id']}})[_0xbf4e('0x1e')](handleEntityNotFound(_0x5d6324,null))['then'](saveUpdates(_0x5659bd['body'],null))[_0xbf4e('0x1e')](respondWithResult(_0x5d6324,null))['catch'](handleError(_0x5d6324,null));};exports['destroy']=function(_0x424f41,_0x3dd51a){return db[_0xbf4e('0x28')][_0xbf4e('0x4a')]({'where':{'id':_0x424f41[_0xbf4e('0x40')]['id']}})['then'](handleEntityNotFound(_0x3dd51a,null))[_0xbf4e('0x1e')](removeEntity(_0x3dd51a,null))['catch'](handleError(_0x3dd51a,null));};exports[_0xbf4e('0x4e')]=function(_0x53875e,_0xa3f71b,_0x57a247){return db[_0xbf4e('0x28')][_0xbf4e('0x4f')]({'where':{'id':_0x53875e[_0xbf4e('0x40')]['id']}})[_0xbf4e('0x1e')](handleEntityNotFound(_0xa3f71b,null))[_0xbf4e('0x1e')](function(_0x52dfc4){if(!_0x53875e['query']['channel']||!utils['isValidChannel'](_0x53875e[_0xbf4e('0x2b')][_0xbf4e('0x50')])){throw new db['Sequelize'][(_0xbf4e('0x51'))](_0xbf4e('0x52'));}var _0x458fea={};var _0x20e913={};_0x20e913[_0xbf4e('0x2d')]=_[_0xbf4e('0x2a')](db[_[_0xbf4e('0x53')](_0x53875e['query'][_0xbf4e('0x50')][_0xbf4e('0x54')]())+_0xbf4e('0x55')]['rawAttributes']);_0x20e913['query']=_[_0xbf4e('0x2a')](_0x53875e[_0xbf4e('0x2b')]);_0x20e913[_0xbf4e('0x2c')]=_['intersection'](_0x20e913[_0xbf4e('0x2d')],_0x20e913[_0xbf4e('0x2b')]);_0x458fea[_0xbf4e('0x2e')]=_[_0xbf4e('0x41')](_0x20e913[_0xbf4e('0x2d')],qs[_0xbf4e('0x2f')](_0x53875e[_0xbf4e('0x2b')][_0xbf4e('0x2f')]));_0x458fea[_0xbf4e('0x2e')]=_0x458fea[_0xbf4e('0x2e')][_0xbf4e('0x30')]?_0x458fea[_0xbf4e('0x2e')]:_0x20e913['model'];_0x458fea[_0xbf4e('0x19')]=qs['limit'](_0x53875e[_0xbf4e('0x2b')][_0xbf4e('0x19')]);_0x458fea[_0xbf4e('0x18')]=qs[_0xbf4e('0x18')](_0x53875e[_0xbf4e('0x2b')][_0xbf4e('0x18')]);_0x458fea[_0xbf4e('0x32')]=qs[_0xbf4e('0x33')](_0x53875e['query'][_0xbf4e('0x33')]);_0x458fea[_0xbf4e('0x34')]=qs[_0xbf4e('0x2c')](_[_0xbf4e('0x35')](_0x53875e[_0xbf4e('0x2b')],_0x20e913['filters']));_0x458fea=_[_0xbf4e('0x36')]({},_0x458fea,_0x53875e[_0xbf4e('0x3b')]);return _0x52dfc4[_0xbf4e('0x47')+_[_0xbf4e('0x53')](_0x53875e[_0xbf4e('0x2b')][_0xbf4e('0x50')]['toLowerCase']())+_0xbf4e('0x56')](_0x458fea);})['then'](respondWithResult(_0xa3f71b,null))[_0xbf4e('0x43')](handleError(_0xa3f71b,null));};exports[_0xbf4e('0x57')]=function(_0x9335f7,_0x108746,_0x4bff77){return db[_0xbf4e('0x28')]['findOne']({'where':{'id':_0x9335f7['params']['id']}})[_0xbf4e('0x1e')](function(_0x1213da){if(_0x1213da){if(!_0x9335f7[_0xbf4e('0x45')]['channel']||!utils[_0xbf4e('0x58')](_0x9335f7[_0xbf4e('0x45')]['channel'])){throw new db[(_0xbf4e('0x59'))][(_0xbf4e('0x51'))](_0xbf4e('0x52'));}return _0x1213da[_0xbf4e('0x5a')+_[_0xbf4e('0x53')](_0x9335f7[_0xbf4e('0x45')][_0xbf4e('0x50')][_0xbf4e('0x54')]())+_0xbf4e('0x56')](_0x9335f7['body'][_0xbf4e('0x5b')]);}return null;})[_0xbf4e('0x1e')](handleEntityNotFound(_0x108746,null))[_0xbf4e('0x1e')](respondWithStatusCode(_0x108746,null))[_0xbf4e('0x43')](handleError(_0x108746,null));};exports['removeQueues']=function(_0x29a55f,_0x667836,_0x40e566){return db[_0xbf4e('0x28')][_0xbf4e('0x4f')]({'where':{'id':_0x29a55f[_0xbf4e('0x40')]['id']}})[_0xbf4e('0x1e')](function(_0xaa5430){if(_0xaa5430){if(!_0x29a55f[_0xbf4e('0x2b')]['channel']||!utils[_0xbf4e('0x58')](_0x29a55f['query'][_0xbf4e('0x50')])){throw new db[(_0xbf4e('0x59'))][(_0xbf4e('0x51'))](_0xbf4e('0x52'));}return _0xaa5430[_0xbf4e('0x5c')+_['capitalize'](_0x29a55f[_0xbf4e('0x2b')][_0xbf4e('0x50')][_0xbf4e('0x54')]())+'Queues'](_0x29a55f[_0xbf4e('0x2b')][_0xbf4e('0x5b')]);}return null;})[_0xbf4e('0x1e')](handleEntityNotFound(_0x667836,null))['then'](respondWithStatusCode(_0x667836,null))[_0xbf4e('0x43')](handleError(_0x667836,null));};exports[_0xbf4e('0x5d')]=function(_0x1ee46c,_0x1cb0b8,_0x3defaf){return db['Team'][_0xbf4e('0x4a')]({'where':{'id':_0x1ee46c['params']['id']}})[_0xbf4e('0x1e')](handleEntityNotFound(_0x1cb0b8,null))['then'](function(_0x19a7e9){if(_0x19a7e9){var _0x5d0856=[_0xbf4e('0x5e'),'Chat',_0xbf4e('0x5f'),_0xbf4e('0x60'),_0xbf4e('0x61'),_0xbf4e('0x62')];return BPromise[_0xbf4e('0x63')](_0x5d0856,function(_0xea3331){return _0x19a7e9[_0xbf4e('0x47')+_0xea3331+'Queues']({'attributes':['id',_0xbf4e('0x25')]})[_0xbf4e('0x1e')](function(_0x2a242b){return BPromise[_0xbf4e('0x63')](_0x2a242b,function(_0x1bff2e){return _0x1bff2e[_0xbf4e('0x5d')](_0x1ee46c['body'][_0xbf4e('0x5b')])[_0xbf4e('0x1e')](function(){if(_0xea3331==='Voice'){return db[_0xbf4e('0x64')][_0xbf4e('0x3e')]({'where':{'id':_0x1ee46c[_0xbf4e('0x45')][_0xbf4e('0x5b')]},'attributes':['id',_0xbf4e('0x25'),_0xbf4e('0x65'),_0xbf4e('0x66'),_0xbf4e('0x67')],'raw':!![]})[_0xbf4e('0x1e')](function(_0x5bdc1c){return BPromise[_0xbf4e('0x63')](_[_0xbf4e('0x3a')](_0x5bdc1c,{'online':0x1}),function(_0xe22a21){return db['UserVoiceQueueRt'][_0xbf4e('0x68')]({'membername':_0xe22a21[_0xbf4e('0x25')],'UserId':_0xe22a21['id'],'queue_name':_0x1bff2e['name'],'VoiceQueueId':_0x1bff2e['id'],'interface':_[_0xbf4e('0x69')](_0xe22a21[_0xbf4e('0x67')])?util[_0xbf4e('0x6a')](_0xbf4e('0x6b'),_0xe22a21[_0xbf4e('0x25')]):_0xe22a21[_0xbf4e('0x67')],'paused':_0xe22a21[_0xbf4e('0x66')]||![],'penalty':0x0});});});}});});})[_0xbf4e('0x1e')](function(){return _0x19a7e9;});})[_0xbf4e('0x1e')](function(){return _0x19a7e9;});}})[_0xbf4e('0x1e')](function(_0x55bc7c){if(_0x55bc7c){return _0x55bc7c['addAgents'](_0x1ee46c[_0xbf4e('0x45')][_0xbf4e('0x5b')],_[_0xbf4e('0x6c')](_0x1ee46c[_0xbf4e('0x45')],['ids','id'])||{})[_0xbf4e('0x6d')](function(_0x30e5c1){for(var _0x299af9=0x0;_0x299af9<_0x1ee46c[_0xbf4e('0x45')][_0xbf4e('0x5b')][_0xbf4e('0x30')];_0x299af9+=0x1){socket[_0xbf4e('0x6e')]('userTeam:save',{'UserId':_0x1ee46c[_0xbf4e('0x45')][_0xbf4e('0x5b')][_0x299af9],'TeamId':_0x1ee46c[_0xbf4e('0x40')]['id']});}return _0x30e5c1;});}})[_0xbf4e('0x1e')](respondWithResult(_0x1cb0b8,null))[_0xbf4e('0x43')](handleError(_0x1cb0b8,null));};exports[_0xbf4e('0x6f')]=function(_0x521d8e,_0x8dc4d5,_0x25ce6d){return db[_0xbf4e('0x28')][_0xbf4e('0x4a')]({'where':{'id':_0x521d8e[_0xbf4e('0x40')]['id']}})[_0xbf4e('0x1e')](handleEntityNotFound(_0x8dc4d5,null))[_0xbf4e('0x1e')](function(_0x535bc9){if(_0x535bc9){return BPromise['each']([_0xbf4e('0x70'),_0xbf4e('0x71'),_0xbf4e('0x72'),_0xbf4e('0x73'),_0xbf4e('0x74'),_0xbf4e('0x75')],function(_0x38e3ee){return _0x535bc9['get'+_[_0xbf4e('0x53')](_0x38e3ee)+_0xbf4e('0x56')]({'attributes':['id',_0xbf4e('0x25')]})['then'](function(_0x4ed161){return BPromise[_0xbf4e('0x63')](_0x4ed161,function(_0x3dcef2){return _0x3dcef2[_0xbf4e('0x6f')](_0x521d8e['query'][_0xbf4e('0x5b')])[_0xbf4e('0x1e')](function(){if(_0x38e3ee===_0xbf4e('0x70')){return db['UserVoiceQueueRt'][_0xbf4e('0x1f')]({'where':{'VoiceQueueId':_0x3dcef2['id'],'UserId':_0x521d8e[_0xbf4e('0x2b')][_0xbf4e('0x5b')]}});}});});})[_0xbf4e('0x1e')](function(){return _0x535bc9;});})[_0xbf4e('0x1e')](function(){return _0x535bc9;});}})[_0xbf4e('0x1e')](function(_0xbcac6d){if(_0xbcac6d){return _0xbcac6d[_0xbf4e('0x6f')](_0x521d8e[_0xbf4e('0x2b')][_0xbf4e('0x5b')])[_0xbf4e('0x1e')](function(){if(_['isArray'](_0x521d8e[_0xbf4e('0x2b')]['ids'])){for(var _0x2de373=0x0;_0x2de373<_0x521d8e[_0xbf4e('0x2b')][_0xbf4e('0x5b')][_0xbf4e('0x30')];_0x2de373+=0x1){socket['emit'](_0xbf4e('0x76'),{'UserId':Number(_0x521d8e[_0xbf4e('0x2b')]['ids'][_0x2de373]),'TeamId':Number(_0x521d8e[_0xbf4e('0x40')]['id'])});}}else{socket[_0xbf4e('0x6e')](_0xbf4e('0x76'),{'UserId':Number(_0x521d8e[_0xbf4e('0x2b')][_0xbf4e('0x5b')]),'TeamId':Number(_0x521d8e[_0xbf4e('0x40')]['id'])});}});}})[_0xbf4e('0x1e')](respondWithStatusCode(_0x8dc4d5,null))[_0xbf4e('0x43')](handleError(_0x8dc4d5,null));};exports[_0xbf4e('0x77')]=function(_0x5f461a,_0x426445,_0x3545aa){var _0x5e751c={};var _0x23f7f7={};var _0xf951e1;var _0x12c8cb;return db[_0xbf4e('0x28')][_0xbf4e('0x4f')]({'where':{'id':_0x5f461a[_0xbf4e('0x40')]['id']}})[_0xbf4e('0x1e')](handleEntityNotFound(_0x426445,null))[_0xbf4e('0x1e')](function(_0x512dd1){if(_0x512dd1){_0xf951e1=_0x512dd1;_0x23f7f7[_0xbf4e('0x2d')]=_[_0xbf4e('0x2a')](db[_0xbf4e('0x64')][_0xbf4e('0x29')]);_0x23f7f7[_0xbf4e('0x2b')]=_['keys'](_0x5f461a[_0xbf4e('0x2b')]);_0x23f7f7[_0xbf4e('0x2c')]=_[_0xbf4e('0x41')](_0x23f7f7[_0xbf4e('0x2d')],_0x23f7f7[_0xbf4e('0x2b')]);_0x5e751c[_0xbf4e('0x2e')]=_[_0xbf4e('0x41')](_0x23f7f7[_0xbf4e('0x2d')],qs[_0xbf4e('0x2f')](_0x5f461a['query']['fields']));_0x5e751c['attributes']=_0x5e751c[_0xbf4e('0x2e')][_0xbf4e('0x30')]?_0x5e751c[_0xbf4e('0x2e')]:_0x23f7f7['model'];_0x5e751c[_0xbf4e('0x32')]=qs[_0xbf4e('0x33')](_0x5f461a['query'][_0xbf4e('0x33')]);_0x5e751c[_0xbf4e('0x34')]=qs['filters'](_[_0xbf4e('0x35')](_0x5f461a['query'],_0x23f7f7[_0xbf4e('0x2c')]));if(_0x5f461a['query']['filter']){_0x5e751c['where']=_[_0xbf4e('0x36')](_0x5e751c[_0xbf4e('0x34')],{'$or':_['map'](_0x5e751c[_0xbf4e('0x2e')],function(_0x15d135){var _0x26ed50={};_0x26ed50[_0x15d135]={'$like':'%'+_0x5f461a[_0xbf4e('0x2b')][_0xbf4e('0x3a')]+'%'};return _0x26ed50;})});}_0x5e751c=_[_0xbf4e('0x36')]({},_0x5e751c,_0x5f461a[_0xbf4e('0x3b')]);return _0xf951e1[_0xbf4e('0x77')](_0x5e751c);}})[_0xbf4e('0x1e')](function(_0x46a481){if(_0x46a481){_0x12c8cb=_0x46a481[_0xbf4e('0x30')];if(!_0x5f461a['query']['hasOwnProperty']('nolimit')){_0x5e751c[_0xbf4e('0x19')]=qs[_0xbf4e('0x19')](_0x5f461a[_0xbf4e('0x2b')][_0xbf4e('0x19')]);_0x5e751c[_0xbf4e('0x18')]=qs[_0xbf4e('0x18')](_0x5f461a[_0xbf4e('0x2b')]['offset']);}return _0xf951e1[_0xbf4e('0x77')](_0x5e751c);}})[_0xbf4e('0x1e')](function(_0x25884e){if(_0x25884e){return _0x25884e?{'count':_0x12c8cb,'rows':_0x25884e}:null;}})['then'](respondWithResult(_0x426445,null))[_0xbf4e('0x43')](handleError(_0x426445,null));}; \ No newline at end of file +var _0xb43b=['attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','type','key','field','merge','Team','count','includeAll','include','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','options','get','Queues','findOne','Sequelize','ValidationError','add','ids','removeQueues','remove','addAgents','Voice','Mail','Sms','Fax','each','User','voicePause','interface','UserVoiceQueueRt','format','omit','spread','emit','userTeam:save','removeAgents','voice','chat','mail','fax','openchannel','userTeam:remove','getAgents','pick','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','json','offset','set','Content-Range','apply','reject','update','destroy','Teams','then','status','sendStatus','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model'];(function(_0x2f88bf,_0x761a0e){var _0x1b451e=function(_0x1116fa){while(--_0x1116fa){_0x2f88bf['push'](_0x2f88bf['shift']());}};_0x1b451e(++_0x761a0e);}(_0xb43b,0x1b2));var _0xbb43=function(_0xfe6f0,_0x14fc33){_0xfe6f0=_0xfe6f0-0x0;var _0x2fc8dd=_0xb43b[_0xfe6f0];return _0x2fc8dd;};'use strict';var pdf=require(_0xbb43('0x0'));var emlformat=require(_0xbb43('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbb43('0x2'));var jsonpatch=require(_0xbb43('0x3'));var rp=require(_0xbb43('0x4'));var moment=require('moment');var BPromise=require(_0xbb43('0x5'));var Mustache=require(_0xbb43('0x6'));var util=require(_0xbb43('0x7'));var path=require(_0xbb43('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbb43('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var hardwareService=require(_0xbb43('0x12'));var logger=require(_0xbb43('0x13'))(_0xbb43('0x14'));var utils=require(_0xbb43('0x15'));var config=require(_0xbb43('0x16'));var db=require('../../mysqldb')['db'];config[_0xbb43('0x17')]=_[_0xbb43('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbb43('0x19'))(new Redis(config['redis']));require('./team.socket')[_0xbb43('0x1a')](socket);function respondWithStatusCode(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xcc;return function(_0x43021d){if(_0x43021d){return _0x5a509f['sendStatus'](_0x68d45d);}return _0x5a509f['status'](_0x68d45d)['end']();};}function respondWithResult(_0x338120,_0x2abce0){_0x2abce0=_0x2abce0||0xc8;return function(_0x57bd1d){if(_0x57bd1d){return _0x338120['status'](_0x2abce0)[_0xbb43('0x1b')](_0x57bd1d);}};}function respondWithFilteredResult(_0x563ce1,_0x5923dc){return function(_0x2b0797){if(_0x2b0797){var _0x8242ab=_0x2b0797['count'],_0x2e3b43=_0x5923dc[_0xbb43('0x1c')],_0x55dd73=_0x5923dc[_0xbb43('0x1c')]+_0x5923dc['limit'],_0x1c16d7;if(_0x55dd73>=_0x8242ab){_0x55dd73=_0x8242ab;_0x1c16d7=0xc8;}else{_0x1c16d7=0xce;}_0x563ce1['status'](_0x1c16d7);return _0x563ce1[_0xbb43('0x1d')](_0xbb43('0x1e'),_0x2e3b43+'-'+_0x55dd73+'/'+_0x8242ab)[_0xbb43('0x1b')](_0x2b0797);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x1f')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x20')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x21')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x22')]()['then'](function(){var _0x53f0d5=_0x298ce2['get']({'plain':!![]});var _0x269ca5=_0xbb43('0x23');return db['UserProfileResource'][_0xbb43('0x22')]({'where':{'type':_0x269ca5,'resourceId':_0x53f0d5['id']}})[_0xbb43('0x24')](function(){return _0x298ce2;});})[_0xbb43('0x24')](function(){_0x4dfb7f[_0xbb43('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b5342,_0x27fd7a){return function(_0x42800f){if(!_0x42800f){_0x4b5342[_0xbb43('0x26')](0x194);}return _0x42800f;};}function handleError(_0x8b3205,_0x510b05){_0x510b05=_0x510b05||0x1f4;return function(_0x40b04b){logger[_0xbb43('0x27')](_0x40b04b[_0xbb43('0x28')]);if(_0x40b04b['name']){delete _0x40b04b[_0xbb43('0x29')];}_0x8b3205['status'](_0x510b05)[_0xbb43('0x2a')](_0x40b04b);};}exports[_0xbb43('0x2b')]=function(_0x34f5b2,_0x1880cd){var _0x555b99={},_0x157d62={},_0x547a6f={'count':0x0,'rows':[]};var _0x5566cf=db['Team'][_0xbb43('0x2c')];_0x157d62['model']=_[_0xbb43('0x2d')](_0x5566cf);_0x157d62[_0xbb43('0x2e')]=_[_0xbb43('0x2d')](_0x34f5b2['query']);_0x157d62[_0xbb43('0x2f')]=_[_0xbb43('0x30')](_0x157d62[_0xbb43('0x31')],_0x157d62[_0xbb43('0x2e')]);_0x555b99[_0xbb43('0x32')]=_[_0xbb43('0x30')](_0x157d62[_0xbb43('0x31')],qs[_0xbb43('0x33')](_0x34f5b2['query'][_0xbb43('0x33')]));_0x555b99[_0xbb43('0x32')]=_0x555b99[_0xbb43('0x32')][_0xbb43('0x34')]?_0x555b99[_0xbb43('0x32')]:_0x157d62[_0xbb43('0x31')];if(!_0x34f5b2[_0xbb43('0x2e')][_0xbb43('0x35')](_0xbb43('0x36'))){_0x555b99[_0xbb43('0x37')]=qs[_0xbb43('0x37')](_0x34f5b2[_0xbb43('0x2e')][_0xbb43('0x37')]);_0x555b99[_0xbb43('0x1c')]=qs[_0xbb43('0x1c')](_0x34f5b2[_0xbb43('0x2e')]['offset']);}_0x555b99[_0xbb43('0x38')]=qs[_0xbb43('0x39')](_0x34f5b2['query'][_0xbb43('0x39')]);_0x555b99[_0xbb43('0x3a')]=qs[_0xbb43('0x2f')](_['pick'](_0x34f5b2['query'],_0x157d62['filters']));if(_0x34f5b2[_0xbb43('0x2e')][_0xbb43('0x3b')]){_0x555b99['where']=_['merge'](_0x555b99[_0xbb43('0x3a')],{'$or':_[_0xbb43('0x3c')](_0x5566cf,function(_0x29f6e5){if(_0x29f6e5[_0xbb43('0x3d')][_0xbb43('0x3e')]!=='VIRTUAL'){var _0x249b6a={};_0x249b6a[_0x29f6e5[_0xbb43('0x3f')]]={'$like':'%'+_0x34f5b2[_0xbb43('0x2e')][_0xbb43('0x3b')]+'%'};return _0x249b6a;}})});}_0x555b99=_[_0xbb43('0x40')]({},_0x555b99,_0x34f5b2['options']);var _0x2ed462={'where':_0x555b99['where']};return db[_0xbb43('0x41')][_0xbb43('0x42')](_0x2ed462)['then'](function(_0x4783fe){_0x547a6f['count']=_0x4783fe;if(_0x34f5b2[_0xbb43('0x2e')][_0xbb43('0x43')]){_0x555b99[_0xbb43('0x44')]=[{'all':!![]}];}return db[_0xbb43('0x41')]['findAll'](_0x555b99);})[_0xbb43('0x24')](function(_0x136bd4){_0x547a6f['rows']=_0x136bd4;return _0x547a6f;})[_0xbb43('0x24')](respondWithFilteredResult(_0x1880cd,_0x555b99))['catch'](handleError(_0x1880cd,null));};exports[_0xbb43('0x45')]=function(_0x14285d,_0xcb5000){var _0x14e57e={'raw':![],'where':{'id':_0x14285d[_0xbb43('0x46')]['id']}},_0x37ffb7={};_0x37ffb7['model']=_[_0xbb43('0x2d')](db['Team'][_0xbb43('0x2c')]);_0x37ffb7[_0xbb43('0x2e')]=_[_0xbb43('0x2d')](_0x14285d[_0xbb43('0x2e')]);_0x37ffb7['filters']=_[_0xbb43('0x30')](_0x37ffb7[_0xbb43('0x31')],_0x37ffb7[_0xbb43('0x2e')]);_0x14e57e[_0xbb43('0x32')]=_[_0xbb43('0x30')](_0x37ffb7[_0xbb43('0x31')],qs[_0xbb43('0x33')](_0x14285d[_0xbb43('0x2e')]['fields']));_0x14e57e[_0xbb43('0x32')]=_0x14e57e[_0xbb43('0x32')]['length']?_0x14e57e[_0xbb43('0x32')]:_0x37ffb7['model'];if(_0x14285d['query']['includeAll']){_0x14e57e['include']=[{'all':!![]}];}_0x14e57e=_[_0xbb43('0x40')]({},_0x14e57e,_0x14285d['options']);return db[_0xbb43('0x41')]['find'](_0x14e57e)[_0xbb43('0x24')](handleEntityNotFound(_0xcb5000,null))[_0xbb43('0x24')](respondWithResult(_0xcb5000,null))[_0xbb43('0x47')](handleError(_0xcb5000,null));};exports['create']=function(_0x186cd6,_0x4d9f18){return db[_0xbb43('0x41')][_0xbb43('0x48')](_0x186cd6[_0xbb43('0x49')],{})[_0xbb43('0x24')](function(_0x417ad9){var _0x13d0a5=_0x186cd6[_0xbb43('0x4a')]['get']({'plain':!![]});if(!_0x13d0a5)throw new Error(_0xbb43('0x4b'));if(_0x13d0a5[_0xbb43('0x4c')]===_0xbb43('0x4a')){var _0x271abb=_0x417ad9['get']({'plain':!![]});var _0x46a4af=_0xbb43('0x23');return db[_0xbb43('0x4d')][_0xbb43('0x4e')]({'where':{'name':_0x46a4af,'userProfileId':_0x13d0a5['userProfileId']},'raw':!![]})[_0xbb43('0x24')](function(_0x3fdb10){if(_0x3fdb10&&_0x3fdb10[_0xbb43('0x4f')]===0x0){return db['UserProfileResource'][_0xbb43('0x48')]({'name':_0x271abb[_0xbb43('0x29')],'resourceId':_0x271abb['id'],'type':_0x3fdb10[_0xbb43('0x29')],'sectionId':_0x3fdb10['id']},{})[_0xbb43('0x24')](function(){return _0x417ad9;});}else{return _0x417ad9;}})[_0xbb43('0x47')](function(_0x59c805){logger['error'](_0xbb43('0x50'),_0x59c805);throw _0x59c805;});}return _0x417ad9;})['then'](respondWithResult(_0x4d9f18,0xc9))[_0xbb43('0x47')](handleError(_0x4d9f18,null));};exports[_0xbb43('0x21')]=function(_0x5d043d,_0x29aea0){if(_0x5d043d[_0xbb43('0x49')]['id']){delete _0x5d043d[_0xbb43('0x49')]['id'];}return db[_0xbb43('0x41')][_0xbb43('0x4e')]({'where':{'id':_0x5d043d['params']['id']}})[_0xbb43('0x24')](handleEntityNotFound(_0x29aea0,null))['then'](saveUpdates(_0x5d043d['body'],null))[_0xbb43('0x24')](respondWithResult(_0x29aea0,null))[_0xbb43('0x47')](handleError(_0x29aea0,null));};exports[_0xbb43('0x22')]=function(_0x474cee,_0x129ee6){return db['Team']['find']({'where':{'id':_0x474cee[_0xbb43('0x46')]['id']}})[_0xbb43('0x24')](handleEntityNotFound(_0x129ee6,null))[_0xbb43('0x24')](removeEntity(_0x129ee6,null))[_0xbb43('0x47')](handleError(_0x129ee6,null));};exports[_0xbb43('0x51')]=function(_0x38d540,_0x44691b,_0x14fce0){return db[_0xbb43('0x41')]['findOne']({'where':{'id':_0x38d540[_0xbb43('0x46')]['id']}})[_0xbb43('0x24')](handleEntityNotFound(_0x44691b,null))[_0xbb43('0x24')](function(_0x3675d9){if(!_0x38d540[_0xbb43('0x2e')][_0xbb43('0x52')]||!utils[_0xbb43('0x53')](_0x38d540[_0xbb43('0x2e')][_0xbb43('0x52')])){throw new db['Sequelize']['ValidationError'](_0xbb43('0x54'));}var _0x2b72ae={};var _0x44db54={};_0x44db54[_0xbb43('0x31')]=_[_0xbb43('0x2d')](db[_[_0xbb43('0x55')](_0x38d540[_0xbb43('0x2e')]['channel'][_0xbb43('0x56')]())+'Queue']['rawAttributes']);_0x44db54[_0xbb43('0x2e')]=_[_0xbb43('0x2d')](_0x38d540[_0xbb43('0x2e')]);_0x44db54[_0xbb43('0x2f')]=_[_0xbb43('0x30')](_0x44db54[_0xbb43('0x31')],_0x44db54[_0xbb43('0x2e')]);_0x2b72ae[_0xbb43('0x32')]=_['intersection'](_0x44db54['model'],qs[_0xbb43('0x33')](_0x38d540[_0xbb43('0x2e')][_0xbb43('0x33')]));_0x2b72ae[_0xbb43('0x32')]=_0x2b72ae[_0xbb43('0x32')][_0xbb43('0x34')]?_0x2b72ae[_0xbb43('0x32')]:_0x44db54[_0xbb43('0x31')];_0x2b72ae[_0xbb43('0x37')]=qs['limit'](_0x38d540[_0xbb43('0x2e')][_0xbb43('0x37')]);_0x2b72ae[_0xbb43('0x1c')]=qs[_0xbb43('0x1c')](_0x38d540[_0xbb43('0x2e')][_0xbb43('0x1c')]);_0x2b72ae['order']=qs[_0xbb43('0x39')](_0x38d540[_0xbb43('0x2e')][_0xbb43('0x39')]);_0x2b72ae[_0xbb43('0x3a')]=qs[_0xbb43('0x2f')](_['pick'](_0x38d540[_0xbb43('0x2e')],_0x44db54[_0xbb43('0x2f')]));_0x2b72ae=_[_0xbb43('0x40')]({},_0x2b72ae,_0x38d540[_0xbb43('0x57')]);return _0x3675d9[_0xbb43('0x58')+_[_0xbb43('0x55')](_0x38d540[_0xbb43('0x2e')][_0xbb43('0x52')][_0xbb43('0x56')]())+_0xbb43('0x59')](_0x2b72ae);})['then'](respondWithResult(_0x44691b,null))[_0xbb43('0x47')](handleError(_0x44691b,null));};exports['addQueues']=function(_0x2b9e5d,_0x2478fb,_0x37d6d7){return db[_0xbb43('0x41')][_0xbb43('0x5a')]({'where':{'id':_0x2b9e5d['params']['id']}})['then'](function(_0x2aa7ba){if(_0x2aa7ba){if(!_0x2b9e5d[_0xbb43('0x49')]['channel']||!utils[_0xbb43('0x53')](_0x2b9e5d[_0xbb43('0x49')][_0xbb43('0x52')])){throw new db[(_0xbb43('0x5b'))][(_0xbb43('0x5c'))](_0xbb43('0x54'));}return _0x2aa7ba[_0xbb43('0x5d')+_[_0xbb43('0x55')](_0x2b9e5d[_0xbb43('0x49')][_0xbb43('0x52')][_0xbb43('0x56')]())+_0xbb43('0x59')](_0x2b9e5d[_0xbb43('0x49')][_0xbb43('0x5e')]);}return null;})['then'](handleEntityNotFound(_0x2478fb,null))['then'](respondWithStatusCode(_0x2478fb,null))[_0xbb43('0x47')](handleError(_0x2478fb,null));};exports[_0xbb43('0x5f')]=function(_0x4758d3,_0x4e9e7a,_0xe661d){return db[_0xbb43('0x41')][_0xbb43('0x5a')]({'where':{'id':_0x4758d3[_0xbb43('0x46')]['id']}})[_0xbb43('0x24')](function(_0x4923c0){if(_0x4923c0){if(!_0x4758d3[_0xbb43('0x2e')][_0xbb43('0x52')]||!utils[_0xbb43('0x53')](_0x4758d3['query'][_0xbb43('0x52')])){throw new db[(_0xbb43('0x5b'))][(_0xbb43('0x5c'))](_0xbb43('0x54'));}return _0x4923c0[_0xbb43('0x60')+_[_0xbb43('0x55')](_0x4758d3[_0xbb43('0x2e')][_0xbb43('0x52')][_0xbb43('0x56')]())+_0xbb43('0x59')](_0x4758d3[_0xbb43('0x2e')]['ids']);}return null;})[_0xbb43('0x24')](handleEntityNotFound(_0x4e9e7a,null))[_0xbb43('0x24')](respondWithStatusCode(_0x4e9e7a,null))[_0xbb43('0x47')](handleError(_0x4e9e7a,null));};exports[_0xbb43('0x61')]=function(_0x34c1cd,_0x4ce918,_0x49c0e2){return db['Team'][_0xbb43('0x4e')]({'where':{'id':_0x34c1cd[_0xbb43('0x46')]['id']}})[_0xbb43('0x24')](handleEntityNotFound(_0x4ce918,null))[_0xbb43('0x24')](function(_0x8d5a8d){if(_0x8d5a8d){var _0x3b08e8=[_0xbb43('0x62'),'Chat',_0xbb43('0x63'),_0xbb43('0x64'),_0xbb43('0x65'),'Openchannel'];return BPromise[_0xbb43('0x66')](_0x3b08e8,function(_0x5e43b4){return _0x8d5a8d[_0xbb43('0x58')+_0x5e43b4+'Queues']({'attributes':['id',_0xbb43('0x29')]})[_0xbb43('0x24')](function(_0x41b9cd){return BPromise[_0xbb43('0x66')](_0x41b9cd,function(_0x24f722){return _0x24f722[_0xbb43('0x61')](_0x34c1cd[_0xbb43('0x49')][_0xbb43('0x5e')])['then'](function(){if(_0x5e43b4===_0xbb43('0x62')){return db[_0xbb43('0x67')]['findAll']({'where':{'id':_0x34c1cd[_0xbb43('0x49')][_0xbb43('0x5e')]},'attributes':['id',_0xbb43('0x29'),'online',_0xbb43('0x68'),_0xbb43('0x69')],'raw':!![]})[_0xbb43('0x24')](function(_0x416e28){return BPromise[_0xbb43('0x66')](_[_0xbb43('0x3b')](_0x416e28,{'online':0x1}),function(_0x4f356d){return db[_0xbb43('0x6a')]['upsert']({'membername':_0x4f356d[_0xbb43('0x29')],'UserId':_0x4f356d['id'],'queue_name':_0x24f722[_0xbb43('0x29')],'VoiceQueueId':_0x24f722['id'],'interface':_['isNil'](_0x4f356d[_0xbb43('0x69')])?util[_0xbb43('0x6b')]('SIP/%s',_0x4f356d['name']):_0x4f356d[_0xbb43('0x69')],'paused':_0x4f356d[_0xbb43('0x68')]||![],'penalty':0x0});});});}});});})[_0xbb43('0x24')](function(){return _0x8d5a8d;});})[_0xbb43('0x24')](function(){return _0x8d5a8d;});}})[_0xbb43('0x24')](function(_0x18415a){if(_0x18415a){return _0x18415a[_0xbb43('0x61')](_0x34c1cd[_0xbb43('0x49')][_0xbb43('0x5e')],_[_0xbb43('0x6c')](_0x34c1cd['body'],[_0xbb43('0x5e'),'id'])||{})[_0xbb43('0x6d')](function(_0xdaeb62){for(var _0x5b2892=0x0;_0x5b2892<_0x34c1cd['body'][_0xbb43('0x5e')][_0xbb43('0x34')];_0x5b2892+=0x1){socket[_0xbb43('0x6e')](_0xbb43('0x6f'),{'UserId':_0x34c1cd['body'][_0xbb43('0x5e')][_0x5b2892],'TeamId':_0x34c1cd['params']['id']});}return _0xdaeb62;});}})[_0xbb43('0x24')](respondWithResult(_0x4ce918,null))[_0xbb43('0x47')](handleError(_0x4ce918,null));};exports[_0xbb43('0x70')]=function(_0x5d606f,_0x1451ec,_0x144f67){return db['Team']['find']({'where':{'id':_0x5d606f[_0xbb43('0x46')]['id']}})[_0xbb43('0x24')](handleEntityNotFound(_0x1451ec,null))[_0xbb43('0x24')](function(_0x91e289){if(_0x91e289){return BPromise[_0xbb43('0x66')]([_0xbb43('0x71'),_0xbb43('0x72'),_0xbb43('0x73'),'sms',_0xbb43('0x74'),_0xbb43('0x75')],function(_0xd5dfc8){return _0x91e289[_0xbb43('0x58')+_['capitalize'](_0xd5dfc8)+_0xbb43('0x59')]({'attributes':['id','name']})['then'](function(_0x11659e){return BPromise[_0xbb43('0x66')](_0x11659e,function(_0x7f4564){return _0x7f4564['removeAgents'](_0x5d606f['query']['ids'])[_0xbb43('0x24')](function(){if(_0xd5dfc8===_0xbb43('0x71')){return db[_0xbb43('0x6a')][_0xbb43('0x22')]({'where':{'VoiceQueueId':_0x7f4564['id'],'UserId':_0x5d606f[_0xbb43('0x2e')]['ids']}});}});});})[_0xbb43('0x24')](function(){return _0x91e289;});})['then'](function(){return _0x91e289;});}})[_0xbb43('0x24')](function(_0x4c2da1){if(_0x4c2da1){return _0x4c2da1['removeAgents'](_0x5d606f['query'][_0xbb43('0x5e')])[_0xbb43('0x24')](function(){if(_['isArray'](_0x5d606f[_0xbb43('0x2e')][_0xbb43('0x5e')])){for(var _0x134ca3=0x0;_0x134ca3<_0x5d606f[_0xbb43('0x2e')][_0xbb43('0x5e')][_0xbb43('0x34')];_0x134ca3+=0x1){socket[_0xbb43('0x6e')](_0xbb43('0x76'),{'UserId':Number(_0x5d606f[_0xbb43('0x2e')][_0xbb43('0x5e')][_0x134ca3]),'TeamId':Number(_0x5d606f[_0xbb43('0x46')]['id'])});}}else{socket['emit'](_0xbb43('0x76'),{'UserId':Number(_0x5d606f[_0xbb43('0x2e')][_0xbb43('0x5e')]),'TeamId':Number(_0x5d606f[_0xbb43('0x46')]['id'])});}});}})[_0xbb43('0x24')](respondWithStatusCode(_0x1451ec,null))[_0xbb43('0x47')](handleError(_0x1451ec,null));};exports[_0xbb43('0x77')]=function(_0x13bea1,_0x1f3eae,_0x465cbf){var _0x40a35e={};var _0x502b36={};var _0x5ea9fb;var _0x46f8f9;return db[_0xbb43('0x41')]['findOne']({'where':{'id':_0x13bea1[_0xbb43('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f3eae,null))[_0xbb43('0x24')](function(_0x4683ce){if(_0x4683ce){_0x5ea9fb=_0x4683ce;_0x502b36[_0xbb43('0x31')]=_[_0xbb43('0x2d')](db[_0xbb43('0x67')][_0xbb43('0x2c')]);_0x502b36['query']=_[_0xbb43('0x2d')](_0x13bea1[_0xbb43('0x2e')]);_0x502b36[_0xbb43('0x2f')]=_[_0xbb43('0x30')](_0x502b36[_0xbb43('0x31')],_0x502b36[_0xbb43('0x2e')]);_0x40a35e[_0xbb43('0x32')]=_[_0xbb43('0x30')](_0x502b36[_0xbb43('0x31')],qs[_0xbb43('0x33')](_0x13bea1[_0xbb43('0x2e')][_0xbb43('0x33')]));_0x40a35e[_0xbb43('0x32')]=_0x40a35e[_0xbb43('0x32')][_0xbb43('0x34')]?_0x40a35e['attributes']:_0x502b36[_0xbb43('0x31')];_0x40a35e[_0xbb43('0x38')]=qs['sort'](_0x13bea1['query'][_0xbb43('0x39')]);_0x40a35e['where']=qs['filters'](_[_0xbb43('0x78')](_0x13bea1['query'],_0x502b36[_0xbb43('0x2f')]));if(_0x13bea1[_0xbb43('0x2e')][_0xbb43('0x3b')]){_0x40a35e[_0xbb43('0x3a')]=_['merge'](_0x40a35e[_0xbb43('0x3a')],{'$or':_[_0xbb43('0x3c')](_0x40a35e[_0xbb43('0x32')],function(_0x5c65a1){var _0x263d28={};_0x263d28[_0x5c65a1]={'$like':'%'+_0x13bea1[_0xbb43('0x2e')]['filter']+'%'};return _0x263d28;})});}_0x40a35e=_[_0xbb43('0x40')]({},_0x40a35e,_0x13bea1[_0xbb43('0x57')]);return _0x5ea9fb[_0xbb43('0x77')](_0x40a35e);}})[_0xbb43('0x24')](function(_0x61ff2f){if(_0x61ff2f){_0x46f8f9=_0x61ff2f[_0xbb43('0x34')];if(!_0x13bea1[_0xbb43('0x2e')][_0xbb43('0x35')](_0xbb43('0x36'))){_0x40a35e[_0xbb43('0x37')]=qs[_0xbb43('0x37')](_0x13bea1[_0xbb43('0x2e')][_0xbb43('0x37')]);_0x40a35e[_0xbb43('0x1c')]=qs['offset'](_0x13bea1[_0xbb43('0x2e')][_0xbb43('0x1c')]);}return _0x5ea9fb[_0xbb43('0x77')](_0x40a35e);}})[_0xbb43('0x24')](function(_0x50be32){if(_0x50be32){return _0x50be32?{'count':_0x46f8f9,'rows':_0x50be32}:null;}})[_0xbb43('0x24')](respondWithResult(_0x1f3eae,null))[_0xbb43('0x47')](handleError(_0x1f3eae,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index e2612d4..e9c2125 100644 --- a/server/api/team/team.events.js +++ b/server/api/team/team.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fa7=['remove','emit','hasOwnProperty','hook','events','Team','save','update'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0fa7,0x64));var _0x70fa=function(_0x164517,_0x1ea624){_0x164517=_0x164517-0x0;var _0x2d819b=_0x0fa7[_0x164517];return _0x2d819b;};'use strict';var EventEmitter=require(_0x70fa('0x0'));var Team=require('../../mysqldb')['db'][_0x70fa('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x70fa('0x2'),'afterUpdate':_0x70fa('0x3'),'afterDestroy':_0x70fa('0x4')};function emitEvent(_0x251992){return function(_0x54bf55,_0x109020,_0x2bf40a){TeamEvents[_0x70fa('0x5')](_0x251992+':'+_0x54bf55['id'],_0x54bf55);TeamEvents[_0x70fa('0x5')](_0x251992,_0x54bf55);_0x2bf40a(null);};}for(var e in events){if(events[_0x70fa('0x6')](e)){var event=events[e];Team[_0x70fa('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x8956=['save','remove','emit','exports','events','Team'];(function(_0x13934c,_0x201ad0){var _0x3e0588=function(_0xcab523){while(--_0xcab523){_0x13934c['push'](_0x13934c['shift']());}};_0x3e0588(++_0x201ad0);}(_0x8956,0x18a));var _0x6895=function(_0x16430c,_0x5fba4f){_0x16430c=_0x16430c-0x0;var _0x3deea9=_0x8956[_0x16430c];return _0x3deea9;};'use strict';var EventEmitter=require(_0x6895('0x0'));var Team=require('../../mysqldb')['db'][_0x6895('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6895('0x2'),'afterUpdate':'update','afterDestroy':_0x6895('0x3')};function emitEvent(_0x951c78){return function(_0x34bbe9,_0x5022a8,_0x4fa659){TeamEvents[_0x6895('0x4')](_0x951c78+':'+_0x34bbe9['id'],_0x34bbe9);TeamEvents[_0x6895('0x4')](_0x951c78,_0x34bbe9);_0x4fa659(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x6895('0x5')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 0d124ea..9612393 100644 --- a/server/api/team/team.model.js +++ b/server/api/team/team.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4430=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','teams','lodash'];(function(_0x5f40b0,_0x588778){var _0x18111e=function(_0x326093){while(--_0x326093){_0x5f40b0['push'](_0x5f40b0['shift']());}};_0x18111e(++_0x588778);}(_0x4430,0x107));var _0x0443=function(_0x3ce0d5,_0x203024){_0x3ce0d5=_0x3ce0d5-0x0;var _0x2e5731=_0x4430[_0x3ce0d5];return _0x2e5731;};'use strict';var _=require(_0x0443('0x0'));var util=require('util');var logger=require(_0x0443('0x1'))(_0x0443('0x2'));var moment=require(_0x0443('0x3'));var BPromise=require(_0x0443('0x4'));var rp=require(_0x0443('0x5'));var fs=require('fs');var path=require(_0x0443('0x6'));var rimraf=require(_0x0443('0x7'));var config=require(_0x0443('0x8'));var attributes=require(_0x0443('0x9'));module[_0x0443('0xa')]=function(_0x2bc3c4,_0x1bfd38){return _0x2bc3c4['define']('Team',attributes,{'tableName':_0x0443('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7882=['rimraf','../../config/environment','exports','define','Team','teams','lodash','util','../../config/logger','api','moment','path'];(function(_0x13b061,_0x7331f){var _0x46a99e=function(_0x13edaa){while(--_0x13edaa){_0x13b061['push'](_0x13b061['shift']());}};_0x46a99e(++_0x7331f);}(_0x7882,0x1b6));var _0x2788=function(_0x4f0c2b,_0x2c9d14){_0x4f0c2b=_0x4f0c2b-0x0;var _0x526436=_0x7882[_0x4f0c2b];return _0x526436;};'use strict';var _=require(_0x2788('0x0'));var util=require(_0x2788('0x1'));var logger=require(_0x2788('0x2'))(_0x2788('0x3'));var moment=require(_0x2788('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2788('0x5'));var rimraf=require(_0x2788('0x6'));var config=require(_0x2788('0x7'));var attributes=require('./team.attributes');module[_0x2788('0x8')]=function(_0x2f90ae,_0x790a10){return _0x2f90ae[_0x2788('0x9')](_0x2788('0xa'),attributes,{'tableName':_0x2788('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index b12b216..40db092 100644 --- a/server/api/team/team.rpc.js +++ b/server/api/team/team.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21c7=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','request\x20sent','debug','stringify','error','code','Team,\x20%s,\x20%s','message','info','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xb017d,_0x1f0138){var _0x2c4de3=function(_0x3475a5){while(--_0x3475a5){_0xb017d['push'](_0xb017d['shift']());}};_0x2c4de3(++_0x1f0138);}(_0x21c7,0x82));var _0x721c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21c7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x721c('0x0'));var moment=require('moment');var BPromise=require(_0x721c('0x1'));var rs=require(_0x721c('0x2'));var fs=require('fs');var Redis=require(_0x721c('0x3'));var db=require(_0x721c('0x4'))['db'];var utils=require(_0x721c('0x5'));var logger=require(_0x721c('0x6'))('rpc');var config=require(_0x721c('0x7'));var jayson=require(_0x721c('0x8'));var client=jayson[_0x721c('0x9')]['http']({'port':0x232a});config[_0x721c('0xa')]=_[_0x721c('0xb')](config['redis'],{'host':_0x721c('0xc'),'port':0x18eb});var socket=require(_0x721c('0xd'))(new Redis(config[_0x721c('0xa')]));require(_0x721c('0xe'))[_0x721c('0xf')](socket);function respondWithRpcPromise(_0x208fb0,_0xe07f83,_0x3d2cf7){return new BPromise(function(_0x5ce8f4,_0x1a8408){return client[_0x721c('0x10')](_0x208fb0,_0x3d2cf7)[_0x721c('0x11')](function(_0x24dd01){logger['info']('Team,\x20%s,\x20%s',_0xe07f83,_0x721c('0x12'));logger[_0x721c('0x13')]('Team,\x20%s,\x20%s,\x20%s',_0xe07f83,_0x721c('0x12'),JSON[_0x721c('0x14')](_0x24dd01));if(_0x24dd01[_0x721c('0x15')]){if(_0x24dd01['error'][_0x721c('0x16')]===0x1f4){logger[_0x721c('0x15')](_0x721c('0x17'),_0xe07f83,_0x24dd01[_0x721c('0x15')]['message']);return _0x1a8408(_0x24dd01[_0x721c('0x15')][_0x721c('0x18')]);}logger[_0x721c('0x15')](_0x721c('0x17'),_0xe07f83,_0x24dd01[_0x721c('0x15')][_0x721c('0x18')]);return _0x5ce8f4(_0x24dd01[_0x721c('0x15')][_0x721c('0x18')]);}else{logger[_0x721c('0x19')](_0x721c('0x17'),_0xe07f83,_0x721c('0x12'));_0x5ce8f4(_0x24dd01['result'][_0x721c('0x18')]);}})[_0x721c('0x1a')](function(_0x3ba46f){logger['error'](_0x721c('0x17'),_0xe07f83,_0x3ba46f);_0x1a8408(_0x3ba46f);});});} \ No newline at end of file +var _0xe923=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','./team.socket','register','request','Team,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe923,0xda));var _0x3e92=function(_0x16051a,_0x5e4326){_0x16051a=_0x16051a-0x0;var _0x35d20d=_0xe923[_0x16051a];return _0x35d20d;};'use strict';var _=require(_0x3e92('0x0'));var util=require(_0x3e92('0x1'));var moment=require(_0x3e92('0x2'));var BPromise=require(_0x3e92('0x3'));var rs=require(_0x3e92('0x4'));var fs=require('fs');var Redis=require(_0x3e92('0x5'));var db=require(_0x3e92('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e92('0x7'))(_0x3e92('0x8'));var config=require(_0x3e92('0x9'));var jayson=require(_0x3e92('0xa'));var client=jayson['client'][_0x3e92('0xb')]({'port':0x232a});config[_0x3e92('0xc')]=_[_0x3e92('0xd')](config[_0x3e92('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3e92('0xc')]));require(_0x3e92('0xe'))[_0x3e92('0xf')](socket);function respondWithRpcPromise(_0x1def46,_0x10fc9a,_0x30d4dc){return new BPromise(function(_0xa0c78c,_0x162b0b){return client[_0x3e92('0x10')](_0x1def46,_0x30d4dc)['then'](function(_0x145773){logger['info'](_0x3e92('0x11'),_0x10fc9a,'request\x20sent');logger[_0x3e92('0x12')]('Team,\x20%s,\x20%s,\x20%s',_0x10fc9a,'request\x20sent',JSON['stringify'](_0x145773));if(_0x145773[_0x3e92('0x13')]){if(_0x145773[_0x3e92('0x13')][_0x3e92('0x14')]===0x1f4){logger[_0x3e92('0x13')](_0x3e92('0x11'),_0x10fc9a,_0x145773[_0x3e92('0x13')][_0x3e92('0x15')]);return _0x162b0b(_0x145773['error']['message']);}logger['error'](_0x3e92('0x11'),_0x10fc9a,_0x145773[_0x3e92('0x13')][_0x3e92('0x15')]);return _0xa0c78c(_0x145773[_0x3e92('0x13')][_0x3e92('0x15')]);}else{logger[_0x3e92('0x16')](_0x3e92('0x11'),_0x10fc9a,_0x3e92('0x17'));_0xa0c78c(_0x145773[_0x3e92('0x18')][_0x3e92('0x15')]);}})['catch'](function(_0x1daece){logger[_0x3e92('0x13')]('Team,\x20%s,\x20%s',_0x10fc9a,_0x1daece);_0x162b0b(_0x1daece);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index f75e637..d7781f2 100644 --- a/server/api/team/team.socket.js +++ b/server/api/team/team.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea4e=['removeListener','register','length','./team.events','emit'];(function(_0x32453b,_0x5d523b){var _0x5bb5bc=function(_0x12471d){while(--_0x12471d){_0x32453b['push'](_0x32453b['shift']());}};_0x5bb5bc(++_0x5d523b);}(_0xea4e,0x10c));var _0xeea4=function(_0x4f6f84,_0x31e197){_0x4f6f84=_0x4f6f84-0x0;var _0x20d989=_0xea4e[_0x4f6f84];return _0x20d989;};'use strict';var TeamEvents=require(_0xeea4('0x0'));var events=['save','remove','update'];function createListener(_0x386b78,_0x4bee3b){return function(_0x1be1b9){_0x4bee3b[_0xeea4('0x1')](_0x386b78,_0x1be1b9);};}function removeListener(_0x5b0c1f,_0x42d137){return function(){TeamEvents[_0xeea4('0x2')](_0x5b0c1f,_0x42d137);};}exports[_0xeea4('0x3')]=function(_0x12e419){for(var _0x297af5=0x0,_0x26d41b=events[_0xeea4('0x4')];_0x297af5<_0x26d41b;_0x297af5++){var _0x44113d=events[_0x297af5];var _0x227d33=createListener('team:'+_0x44113d,_0x12e419);TeamEvents['on'](_0x44113d,_0x227d33);}}; \ No newline at end of file +var _0x0ef4=['removeListener','length','team:','save','remove','update','emit'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0ef4,0xc7));var _0x40ef=function(_0x5d6c3e,_0x409a3e){_0x5d6c3e=_0x5d6c3e-0x0;var _0x44ecb7=_0x0ef4[_0x5d6c3e];return _0x44ecb7;};'use strict';var TeamEvents=require('./team.events');var events=[_0x40ef('0x0'),_0x40ef('0x1'),_0x40ef('0x2')];function createListener(_0x51ab4d,_0x5dbe16){return function(_0x2890f7){_0x5dbe16[_0x40ef('0x3')](_0x51ab4d,_0x2890f7);};}function removeListener(_0x85ee1d,_0x4a5798){return function(){TeamEvents[_0x40ef('0x4')](_0x85ee1d,_0x4a5798);};}exports['register']=function(_0x59af1f){for(var _0x28c1e7=0x0,_0x3dba6e=events[_0x40ef('0x5')];_0x28c1e7<_0x3dba6e;_0x28c1e7++){var _0x7d0e82=events[_0x28c1e7];var _0x439a37=createListener(_0x40ef('0x6')+_0x7d0e82,_0x59af1f);TeamEvents['on'](_0x7d0e82,_0x439a37);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 320d0ea..9184cea 100644 --- a/server/api/template/index.js +++ b/server/api/template/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14d1=['/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x5bde18,_0x451fdd){var _0x2f4f59=function(_0x572c63){while(--_0x572c63){_0x5bde18['push'](_0x5bde18['shift']());}};_0x2f4f59(++_0x451fdd);}(_0x14d1,0x1f4));var _0x114d=function(_0x22da04,_0x1cef75){_0x22da04=_0x22da04-0x0;var _0x4bf70c=_0x14d1[_0x22da04];return _0x4bf70c;};'use strict';var multer=require(_0x114d('0x0'));var util=require(_0x114d('0x1'));var path=require(_0x114d('0x2'));var timeout=require(_0x114d('0x3'));var express=require(_0x114d('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x114d('0x5'));var config=require(_0x114d('0x6'));var controller=require('./template.controller');router['get']('/',auth[_0x114d('0x7')](),controller[_0x114d('0x8')]);router[_0x114d('0x9')](_0x114d('0xa'),auth[_0x114d('0x7')](),controller['show']);router[_0x114d('0xb')]('/',auth['isAuthenticated'](),controller[_0x114d('0xc')]);router[_0x114d('0xd')](_0x114d('0xa'),auth[_0x114d('0x7')](),controller['update']);router[_0x114d('0xe')](_0x114d('0xa'),auth['isAuthenticated'](),controller[_0x114d('0xf')]);module[_0x114d('0x10')]=router; \ No newline at end of file +var _0x39cf=['create','put','update','delete','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x6af505,_0x189090){var _0x549534=function(_0x3470ba){while(--_0x3470ba){_0x6af505['push'](_0x6af505['shift']());}};_0x549534(++_0x189090);}(_0x39cf,0x114));var _0xf39c=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0x39cf[_0x4849f6];return _0x1a3dcd;};'use strict';var multer=require('multer');var util=require(_0xf39c('0x0'));var path=require(_0xf39c('0x1'));var timeout=require(_0xf39c('0x2'));var express=require('express');var router=express[_0xf39c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf39c('0x4'));var config=require(_0xf39c('0x5'));var controller=require(_0xf39c('0x6'));router[_0xf39c('0x7')]('/',auth[_0xf39c('0x8')](),controller[_0xf39c('0x9')]);router['get'](_0xf39c('0xa'),auth[_0xf39c('0x8')](),controller[_0xf39c('0xb')]);router[_0xf39c('0xc')]('/',auth[_0xf39c('0x8')](),controller[_0xf39c('0xd')]);router[_0xf39c('0xe')](_0xf39c('0xa'),auth[_0xf39c('0x8')](),controller[_0xf39c('0xf')]);router[_0xf39c('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 50a0b6a..ee85e07 100644 --- a/server/api/template/template.attributes.js +++ b/server/api/template/template.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2d5=['sequelize','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb2d5,0x15c));var _0x5b2d=function(_0x1bef98,_0x3ac898){_0x1bef98=_0x1bef98-0x0;var _0x4bf871=_0xb2d5[_0x1bef98];return _0x4bf871;};'use strict';var Sequelize=require(_0x5b2d('0x0'));module[_0x5b2d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xbf7c=['TEXT','sequelize','exports','STRING'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xbf7c,0xa9));var _0xcbf7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbf7c[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xcbf7('0x0'));module[_0xcbf7('0x1')]={'name':{'type':Sequelize[_0xcbf7('0x2')]},'description':{'type':Sequelize[_0xcbf7('0x2')]},'html':{'type':Sequelize[_0xcbf7('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 3777d6a..9a04574 100644 --- a/server/api/template/template.controller.js +++ b/server/api/template/template.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['options','Template','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','apply','destroy','then','get','Templates','end','send','index','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','merge'];(function(_0x597d09,_0x6fad2c){var _0x187444=function(_0x344dc7){while(--_0x344dc7){_0x597d09['push'](_0x597d09['shift']());}};_0x187444(++_0x6fad2c);}(_0x008c,0x188));var _0xc008=function(_0x4ab866,_0x40e607){_0x4ab866=_0x4ab866-0x0;var _0x56047a=_0x008c[_0x4ab866];return _0x56047a;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc008('0x12'))(_0xc008('0x13'));var utils=require('../../config/utils');var config=require(_0xc008('0x14'));var db=require(_0xc008('0x15'))['db'];function respondWithStatusCode(_0x2ea200,_0x2a5b4e){_0x2a5b4e=_0x2a5b4e||0xcc;return function(_0x9ffa93){if(_0x9ffa93){return _0x2ea200[_0xc008('0x16')](_0x2a5b4e);}return _0x2ea200[_0xc008('0x17')](_0x2a5b4e)['end']();};}function respondWithResult(_0x560e28,_0x33f44c){_0x33f44c=_0x33f44c||0xc8;return function(_0x50c1ab){if(_0x50c1ab){return _0x560e28[_0xc008('0x17')](_0x33f44c)[_0xc008('0x18')](_0x50c1ab);}};}function respondWithFilteredResult(_0x2073ef,_0x339ffc){return function(_0x3f0ecf){if(_0x3f0ecf){var _0x5ee00b=_0x3f0ecf[_0xc008('0x19')],_0x5e894e=_0x339ffc[_0xc008('0x1a')],_0x4bd0f4=_0x339ffc[_0xc008('0x1a')]+_0x339ffc['limit'],_0x11ef38;if(_0x4bd0f4>=_0x5ee00b){_0x4bd0f4=_0x5ee00b;_0x11ef38=0xc8;}else{_0x11ef38=0xce;}_0x2073ef['status'](_0x11ef38);return _0x2073ef['set']('Content-Range',_0x5e894e+'-'+_0x4bd0f4+'/'+_0x5ee00b)[_0xc008('0x18')](_0x3f0ecf);}return null;};}function patchUpdates(_0x462af5){return function(_0x501137){try{jsonpatch[_0xc008('0x1b')](_0x501137,_0x462af5,!![]);}catch(_0x5906e6){return BPromise['reject'](_0x5906e6);}return _0x501137['save']();};}function saveUpdates(_0x50261c,_0x5754a0){return function(_0x4b9726){if(_0x4b9726){return _0x4b9726['update'](_0x50261c)['then'](function(_0x4a582d){return _0x4a582d;});}return null;};}function removeEntity(_0x5a58bd,_0x13a263){return function(_0x4777a6){if(_0x4777a6){return _0x4777a6[_0xc008('0x1c')]()[_0xc008('0x1d')](function(){var _0x11cc75=_0x4777a6[_0xc008('0x1e')]({'plain':!![]});var _0x4f43e2=_0xc008('0x1f');return db['UserProfileResource']['destroy']({'where':{'type':_0x4f43e2,'resourceId':_0x11cc75['id']}})[_0xc008('0x1d')](function(){return _0x4777a6;});})[_0xc008('0x1d')](function(){_0x5a58bd[_0xc008('0x17')](0xcc)[_0xc008('0x20')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x16')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x21')](_0x2e31c2);};}exports[_0xc008('0x22')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=db['Template'][_0xc008('0x23')];_0x32390d[_0xc008('0x24')]=_['keys'](_0x2a7d4f);_0x32390d['query']=_['keys'](_0x25eae4[_0xc008('0x25')]);_0x32390d[_0xc008('0x26')]=_[_0xc008('0x27')](_0x32390d[_0xc008('0x24')],_0x32390d[_0xc008('0x25')]);_0x24c14c[_0xc008('0x28')]=_[_0xc008('0x27')](_0x32390d[_0xc008('0x24')],qs[_0xc008('0x29')](_0x25eae4[_0xc008('0x25')][_0xc008('0x29')]));_0x24c14c[_0xc008('0x28')]=_0x24c14c['attributes'][_0xc008('0x2a')]?_0x24c14c[_0xc008('0x28')]:_0x32390d['model'];if(!_0x25eae4[_0xc008('0x25')][_0xc008('0x2b')](_0xc008('0x2c'))){_0x24c14c[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x25eae4[_0xc008('0x25')][_0xc008('0x2d')]);_0x24c14c[_0xc008('0x1a')]=qs[_0xc008('0x1a')](_0x25eae4['query'][_0xc008('0x1a')]);}_0x24c14c[_0xc008('0x2e')]=qs[_0xc008('0x2f')](_0x25eae4[_0xc008('0x25')][_0xc008('0x2f')]);_0x24c14c[_0xc008('0x30')]=qs[_0xc008('0x26')](_['pick'](_0x25eae4[_0xc008('0x25')],_0x32390d[_0xc008('0x26')]));if(_0x25eae4['query'][_0xc008('0x31')]){_0x24c14c[_0xc008('0x30')]=_['merge'](_0x24c14c[_0xc008('0x30')],{'$or':_[_0xc008('0x32')](_0x2a7d4f,function(_0x280e9b){if(_0x280e9b['type']['key']!=='VIRTUAL'){var _0x234f2a={};_0x234f2a[_0x280e9b['field']]={'$like':'%'+_0x25eae4[_0xc008('0x25')][_0xc008('0x31')]+'%'};return _0x234f2a;}})});}_0x24c14c=_[_0xc008('0x33')]({},_0x24c14c,_0x25eae4[_0xc008('0x34')]);var _0x3148e1={'where':_0x24c14c[_0xc008('0x30')]};return db[_0xc008('0x35')][_0xc008('0x19')](_0x3148e1)[_0xc008('0x1d')](function(_0x387dfd){_0x209591[_0xc008('0x19')]=_0x387dfd;if(_0x25eae4[_0xc008('0x25')][_0xc008('0x36')]){_0x24c14c[_0xc008('0x37')]=[{'all':!![]}];}return db['Template'][_0xc008('0x38')](_0x24c14c);})[_0xc008('0x1d')](function(_0x30b7df){_0x209591[_0xc008('0x39')]=_0x30b7df;return _0x209591;})['then'](respondWithFilteredResult(_0x529961,_0x24c14c))[_0xc008('0x3a')](handleError(_0x529961,null));};exports[_0xc008('0x3b')]=function(_0xc8cb91,_0x36e7ae){var _0x2d142d={'raw':!![],'where':{'id':_0xc8cb91[_0xc008('0x3c')]['id']}},_0x5706bb={};_0x5706bb[_0xc008('0x24')]=_[_0xc008('0x3d')](db[_0xc008('0x35')][_0xc008('0x23')]);_0x5706bb['query']=_[_0xc008('0x3d')](_0xc8cb91[_0xc008('0x25')]);_0x5706bb[_0xc008('0x26')]=_[_0xc008('0x27')](_0x5706bb['model'],_0x5706bb[_0xc008('0x25')]);_0x2d142d[_0xc008('0x28')]=_[_0xc008('0x27')](_0x5706bb['model'],qs[_0xc008('0x29')](_0xc8cb91['query'][_0xc008('0x29')]));_0x2d142d['attributes']=_0x2d142d[_0xc008('0x28')][_0xc008('0x2a')]?_0x2d142d['attributes']:_0x5706bb[_0xc008('0x24')];if(_0xc8cb91[_0xc008('0x25')][_0xc008('0x36')]){_0x2d142d['include']=[{'all':!![]}];}_0x2d142d=_[_0xc008('0x33')]({},_0x2d142d,_0xc8cb91[_0xc008('0x34')]);return db[_0xc008('0x35')][_0xc008('0x3e')](_0x2d142d)[_0xc008('0x1d')](handleEntityNotFound(_0x36e7ae,null))[_0xc008('0x1d')](respondWithResult(_0x36e7ae,null))['catch'](handleError(_0x36e7ae,null));};exports['create']=function(_0x5283a8,_0x4552ed){return db[_0xc008('0x35')][_0xc008('0x3f')](_0x5283a8[_0xc008('0x40')],{})[_0xc008('0x1d')](function(_0x24f6a4){var _0x2cf641=_0x5283a8[_0xc008('0x41')]['get']({'plain':!![]});if(!_0x2cf641)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cf641['role']===_0xc008('0x41')){var _0x2651cf=_0x24f6a4[_0xc008('0x1e')]({'plain':!![]});var _0x511383=_0xc008('0x1f');return db[_0xc008('0x42')][_0xc008('0x3e')]({'where':{'name':_0x511383,'userProfileId':_0x2cf641[_0xc008('0x43')]},'raw':!![]})[_0xc008('0x1d')](function(_0x56e4ac){if(_0x56e4ac&&_0x56e4ac[_0xc008('0x44')]===0x0){return db[_0xc008('0x45')][_0xc008('0x3f')]({'name':_0x2651cf[_0xc008('0x46')],'resourceId':_0x2651cf['id'],'type':_0x56e4ac['name'],'sectionId':_0x56e4ac['id']},{})['then'](function(){return _0x24f6a4;});}else{return _0x24f6a4;}})[_0xc008('0x3a')](function(_0x51cb14){logger[_0xc008('0x47')](_0xc008('0x48'),_0x51cb14);throw _0x51cb14;});}return _0x24f6a4;})[_0xc008('0x1d')](respondWithResult(_0x4552ed,0xc9))['catch'](handleError(_0x4552ed,null));};exports[_0xc008('0x49')]=function(_0x32b435,_0xee64){if(_0x32b435[_0xc008('0x40')]['id']){delete _0x32b435[_0xc008('0x40')]['id'];}return db['Template'][_0xc008('0x3e')]({'where':{'id':_0x32b435[_0xc008('0x3c')]['id']}})['then'](handleEntityNotFound(_0xee64,null))[_0xc008('0x1d')](saveUpdates(_0x32b435[_0xc008('0x40')],null))['then'](respondWithResult(_0xee64,null))['catch'](handleError(_0xee64,null));};exports[_0xc008('0x1c')]=function(_0xd47b74,_0x20947b){return db[_0xc008('0x35')][_0xc008('0x3e')]({'where':{'id':_0xd47b74['params']['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x1d')](removeEntity(_0x20947b,null))['catch'](handleError(_0x20947b,null));}; \ No newline at end of file +var _0x34e8=['then','get','Templates','UserProfileResource','error','stack','name','Template','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','key','VIRTUAL','field','includeAll','include','show','params','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','update'];(function(_0x493a51,_0x45128c){var _0xc85756=function(_0x2c39a8){while(--_0x2c39a8){_0x493a51['push'](_0x493a51['shift']());}};_0xc85756(++_0x45128c);}(_0x34e8,0x12c));var _0x834e=function(_0x3dde5d,_0x26477e){_0x3dde5d=_0x3dde5d-0x0;var _0x1e2a69=_0x34e8[_0x3dde5d];return _0x1e2a69;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var db=require(_0x834e('0x1b'))['db'];function respondWithStatusCode(_0x2fd95c,_0x538bb3){_0x538bb3=_0x538bb3||0xcc;return function(_0x5e5b6d){if(_0x5e5b6d){return _0x2fd95c[_0x834e('0x1c')](_0x538bb3);}return _0x2fd95c['status'](_0x538bb3)[_0x834e('0x1d')]();};}function respondWithResult(_0x2d95f2,_0x28e659){_0x28e659=_0x28e659||0xc8;return function(_0x21cc0a){if(_0x21cc0a){return _0x2d95f2['status'](_0x28e659)[_0x834e('0x1e')](_0x21cc0a);}};}function respondWithFilteredResult(_0x302cbd,_0x57274a){return function(_0x316205){if(_0x316205){var _0x4a9cdc=_0x316205[_0x834e('0x1f')],_0x38a8cd=_0x57274a[_0x834e('0x20')],_0x36d443=_0x57274a[_0x834e('0x20')]+_0x57274a['limit'],_0x478afe;if(_0x36d443>=_0x4a9cdc){_0x36d443=_0x4a9cdc;_0x478afe=0xc8;}else{_0x478afe=0xce;}_0x302cbd[_0x834e('0x21')](_0x478afe);return _0x302cbd[_0x834e('0x22')](_0x834e('0x23'),_0x38a8cd+'-'+_0x36d443+'/'+_0x4a9cdc)[_0x834e('0x1e')](_0x316205);}return null;};}function patchUpdates(_0x237947){return function(_0x254677){try{jsonpatch[_0x834e('0x24')](_0x254677,_0x237947,!![]);}catch(_0x595515){return BPromise[_0x834e('0x25')](_0x595515);}return _0x254677[_0x834e('0x26')]();};}function saveUpdates(_0x113ff4,_0x325a99){return function(_0x4ab05d){if(_0x4ab05d){return _0x4ab05d[_0x834e('0x27')](_0x113ff4)[_0x834e('0x28')](function(_0x5a05c0){return _0x5a05c0;});}return null;};}function removeEntity(_0x1b4bdf,_0x28d687){return function(_0x8d406e){if(_0x8d406e){return _0x8d406e['destroy']()['then'](function(){var _0x231619=_0x8d406e[_0x834e('0x29')]({'plain':!![]});var _0x589dde=_0x834e('0x2a');return db[_0x834e('0x2b')]['destroy']({'where':{'type':_0x589dde,'resourceId':_0x231619['id']}})[_0x834e('0x28')](function(){return _0x8d406e;});})[_0x834e('0x28')](function(){_0x1b4bdf[_0x834e('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x21')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=db[_0x834e('0x2f')][_0x834e('0x30')];_0x567cea[_0x834e('0x31')]=_[_0x834e('0x32')](_0x5dacc1);_0x567cea[_0x834e('0x33')]=_[_0x834e('0x32')](_0x4dc64a[_0x834e('0x33')]);_0x567cea[_0x834e('0x34')]=_[_0x834e('0x35')](_0x567cea['model'],_0x567cea[_0x834e('0x33')]);_0x2c7a8d['attributes']=_[_0x834e('0x35')](_0x567cea[_0x834e('0x31')],qs[_0x834e('0x36')](_0x4dc64a[_0x834e('0x33')][_0x834e('0x36')]));_0x2c7a8d[_0x834e('0x37')]=_0x2c7a8d[_0x834e('0x37')][_0x834e('0x38')]?_0x2c7a8d[_0x834e('0x37')]:_0x567cea[_0x834e('0x31')];if(!_0x4dc64a['query'][_0x834e('0x39')](_0x834e('0x3a'))){_0x2c7a8d[_0x834e('0x3b')]=qs[_0x834e('0x3b')](_0x4dc64a['query'][_0x834e('0x3b')]);_0x2c7a8d[_0x834e('0x20')]=qs['offset'](_0x4dc64a['query']['offset']);}_0x2c7a8d[_0x834e('0x3c')]=qs[_0x834e('0x3d')](_0x4dc64a[_0x834e('0x33')][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs[_0x834e('0x34')](_['pick'](_0x4dc64a[_0x834e('0x33')],_0x567cea['filters']));if(_0x4dc64a[_0x834e('0x33')][_0x834e('0x3f')]){_0x2c7a8d['where']=_[_0x834e('0x40')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_['map'](_0x5dacc1,function(_0x481f70){if(_0x481f70[_0x834e('0x41')][_0x834e('0x42')]!==_0x834e('0x43')){var _0x130c23={};_0x130c23[_0x481f70[_0x834e('0x44')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x3f')]+'%'};return _0x130c23;}})});}_0x2c7a8d=_['merge']({},_0x2c7a8d,_0x4dc64a['options']);var _0x1b2edf={'where':_0x2c7a8d['where']};return db[_0x834e('0x2f')][_0x834e('0x1f')](_0x1b2edf)[_0x834e('0x28')](function(_0x3c59af){_0x106d6a[_0x834e('0x1f')]=_0x3c59af;if(_0x4dc64a['query'][_0x834e('0x45')]){_0x2c7a8d[_0x834e('0x46')]=[{'all':!![]}];}return db[_0x834e('0x2f')]['findAll'](_0x2c7a8d);})[_0x834e('0x28')](function(_0x16ac45){_0x106d6a['rows']=_0x16ac45;return _0x106d6a;})[_0x834e('0x28')](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))['catch'](handleError(_0x58c1d7,null));};exports[_0x834e('0x47')]=function(_0x585335,_0x4a18bb){var _0x4a6942={'raw':!![],'where':{'id':_0x585335[_0x834e('0x48')]['id']}},_0x22ea21={};_0x22ea21[_0x834e('0x31')]=_[_0x834e('0x32')](db[_0x834e('0x2f')][_0x834e('0x30')]);_0x22ea21[_0x834e('0x33')]=_['keys'](_0x585335[_0x834e('0x33')]);_0x22ea21['filters']=_[_0x834e('0x35')](_0x22ea21['model'],_0x22ea21[_0x834e('0x33')]);_0x4a6942['attributes']=_[_0x834e('0x35')](_0x22ea21[_0x834e('0x31')],qs['fields'](_0x585335[_0x834e('0x33')][_0x834e('0x36')]));_0x4a6942[_0x834e('0x37')]=_0x4a6942[_0x834e('0x37')][_0x834e('0x38')]?_0x4a6942[_0x834e('0x37')]:_0x22ea21[_0x834e('0x31')];if(_0x585335[_0x834e('0x33')][_0x834e('0x45')]){_0x4a6942[_0x834e('0x46')]=[{'all':!![]}];}_0x4a6942=_['merge']({},_0x4a6942,_0x585335[_0x834e('0x49')]);return db[_0x834e('0x2f')]['find'](_0x4a6942)[_0x834e('0x28')](handleEntityNotFound(_0x4a18bb,null))[_0x834e('0x28')](respondWithResult(_0x4a18bb,null))[_0x834e('0x4a')](handleError(_0x4a18bb,null));};exports[_0x834e('0x4b')]=function(_0x19b5ef,_0x4264b8){return db['Template']['create'](_0x19b5ef[_0x834e('0x4c')],{})[_0x834e('0x28')](function(_0x30568e){var _0x40ff5a=_0x19b5ef[_0x834e('0x4d')][_0x834e('0x29')]({'plain':!![]});if(!_0x40ff5a)throw new Error(_0x834e('0x4e'));if(_0x40ff5a[_0x834e('0x4f')]===_0x834e('0x4d')){var _0x390c45=_0x30568e[_0x834e('0x29')]({'plain':!![]});var _0x385435=_0x834e('0x2a');return db[_0x834e('0x50')][_0x834e('0x51')]({'where':{'name':_0x385435,'userProfileId':_0x40ff5a[_0x834e('0x52')]},'raw':!![]})[_0x834e('0x28')](function(_0x32b8f7){if(_0x32b8f7&&_0x32b8f7[_0x834e('0x53')]===0x0){return db[_0x834e('0x2b')]['create']({'name':_0x390c45[_0x834e('0x2e')],'resourceId':_0x390c45['id'],'type':_0x32b8f7[_0x834e('0x2e')],'sectionId':_0x32b8f7['id']},{})['then'](function(){return _0x30568e;});}else{return _0x30568e;}})[_0x834e('0x4a')](function(_0x3b0988){logger['error'](_0x834e('0x54'),_0x3b0988);throw _0x3b0988;});}return _0x30568e;})[_0x834e('0x28')](respondWithResult(_0x4264b8,0xc9))[_0x834e('0x4a')](handleError(_0x4264b8,null));};exports[_0x834e('0x27')]=function(_0x4288e4,_0xb77aab){if(_0x4288e4[_0x834e('0x4c')]['id']){delete _0x4288e4['body']['id'];}return db[_0x834e('0x2f')][_0x834e('0x51')]({'where':{'id':_0x4288e4[_0x834e('0x48')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0xb77aab,null))[_0x834e('0x28')](saveUpdates(_0x4288e4[_0x834e('0x4c')],null))[_0x834e('0x28')](respondWithResult(_0xb77aab,null))[_0x834e('0x4a')](handleError(_0xb77aab,null));};exports['destroy']=function(_0x11778e,_0x4dc104){return db[_0x834e('0x2f')]['find']({'where':{'id':_0x11778e[_0x834e('0x48')]['id']}})['then'](handleEntityNotFound(_0x4dc104,null))['then'](removeEntity(_0x4dc104,null))[_0x834e('0x4a')](handleError(_0x4dc104,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index fe4b19c..4cc802f 100644 --- a/server/api/template/template.model.js +++ b/server/api/template/template.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfea8=['request-promise','rimraf','../../config/environment','./template.attributes','exports','tools_templates','lodash','util','../../config/logger','api','moment'];(function(_0x19297d,_0x9c4d1b){var _0x1d26c3=function(_0x4bc11e){while(--_0x4bc11e){_0x19297d['push'](_0x19297d['shift']());}};_0x1d26c3(++_0x9c4d1b);}(_0xfea8,0x1be));var _0x8fea=function(_0x2cc711,_0x300328){_0x2cc711=_0x2cc711-0x0;var _0x31a52e=_0xfea8[_0x2cc711];return _0x31a52e;};'use strict';var _=require(_0x8fea('0x0'));var util=require(_0x8fea('0x1'));var logger=require(_0x8fea('0x2'))(_0x8fea('0x3'));var moment=require(_0x8fea('0x4'));var BPromise=require('bluebird');var rp=require(_0x8fea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8fea('0x6'));var config=require(_0x8fea('0x7'));var attributes=require(_0x8fea('0x8'));module[_0x8fea('0x9')]=function(_0x29c0a7,_0x1dc2ea){return _0x29c0a7['define']('Template',attributes,{'tableName':_0x8fea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdaf2=['bluebird','request-promise','path','../../config/environment','exports','define','Template','tools_templates','../../config/logger','api'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdaf2,0x152));var _0x2daf=function(_0x14477e,_0x44d4da){_0x14477e=_0x14477e-0x0;var _0x5d4a05=_0xdaf2[_0x14477e];return _0x5d4a05;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2daf('0x0'))(_0x2daf('0x1'));var moment=require('moment');var BPromise=require(_0x2daf('0x2'));var rp=require(_0x2daf('0x3'));var fs=require('fs');var path=require(_0x2daf('0x4'));var rimraf=require('rimraf');var config=require(_0x2daf('0x5'));var attributes=require('./template.attributes');module[_0x2daf('0x6')]=function(_0x598f2d,_0x2db2d2){return _0x598f2d[_0x2daf('0x7')](_0x2daf('0x8'),attributes,{'tableName':_0x2daf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 6d89e98..d3710fe 100644 --- a/server/api/template/template.rpc.js +++ b/server/api/template/template.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52e9=['rpc','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','options','raw','where','attributes','include','map','model','GetTemplate','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x52e9,0x1d4));var _0x952e=function(_0x436b21,_0x17b1de){_0x436b21=_0x436b21-0x0;var _0x20faec=_0x52e9[_0x436b21];return _0x20faec;};'use strict';var _=require(_0x952e('0x0'));var util=require(_0x952e('0x1'));var moment=require(_0x952e('0x2'));var BPromise=require(_0x952e('0x3'));var rs=require(_0x952e('0x4'));var fs=require('fs');var Redis=require(_0x952e('0x5'));var db=require(_0x952e('0x6'))['db'];var utils=require(_0x952e('0x7'));var logger=require('../../config/logger')(_0x952e('0x8'));var config=require(_0x952e('0x9'));var jayson=require(_0x952e('0xa'));var client=jayson[_0x952e('0xb')][_0x952e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48a418,_0x5053b0,_0x242087){return new BPromise(function(_0xcc6071,_0x2237dd){return client['request'](_0x48a418,_0x242087)[_0x952e('0xd')](function(_0x4aad73){logger[_0x952e('0xe')](_0x952e('0xf'),_0x5053b0,_0x952e('0x10'));logger[_0x952e('0x11')](_0x952e('0x12'),_0x5053b0,'request\x20sent',JSON[_0x952e('0x13')](_0x4aad73));if(_0x4aad73[_0x952e('0x14')]){if(_0x4aad73['error'][_0x952e('0x15')]===0x1f4){logger[_0x952e('0x14')]('Template,\x20%s,\x20%s',_0x5053b0,_0x4aad73['error'][_0x952e('0x16')]);return _0x2237dd(_0x4aad73[_0x952e('0x14')][_0x952e('0x16')]);}logger['error']('Template,\x20%s,\x20%s',_0x5053b0,_0x4aad73[_0x952e('0x14')]['message']);return _0xcc6071(_0x4aad73[_0x952e('0x14')][_0x952e('0x16')]);}else{logger[_0x952e('0xe')](_0x952e('0xf'),_0x5053b0,'request\x20sent');_0xcc6071(_0x4aad73[_0x952e('0x17')][_0x952e('0x16')]);}})[_0x952e('0x18')](function(_0x2ff366){logger[_0x952e('0x14')]('Template,\x20%s,\x20%s',_0x5053b0,_0x2ff366);_0x2237dd(_0x2ff366);});});}exports['GetTemplate']=function(_0x5cec55){var _0x47c92a=this;return new Promise(function(_0x1696b8,_0x26e888){return db[_0x952e('0x19')]['findAll']({'raw':_0x5cec55[_0x952e('0x1a')]?_0x5cec55['options'][_0x952e('0x1b')]===undefined?!![]:![]:!![],'where':_0x5cec55['options']?_0x5cec55['options'][_0x952e('0x1c')]||null:null,'attributes':_0x5cec55[_0x952e('0x1a')]?_0x5cec55[_0x952e('0x1a')][_0x952e('0x1d')]||null:null,'limit':_0x5cec55[_0x952e('0x1a')]?_0x5cec55['options']['limit']||null:null,'include':_0x5cec55[_0x952e('0x1a')]?_0x5cec55[_0x952e('0x1a')][_0x952e('0x1e')]?_[_0x952e('0x1f')](_0x5cec55[_0x952e('0x1a')][_0x952e('0x1e')],function(_0x3a3d87){return{'model':db[_0x3a3d87[_0x952e('0x20')]],'as':_0x3a3d87['as'],'attributes':_0x3a3d87['attributes'],'include':_0x3a3d87[_0x952e('0x1e')]?_[_0x952e('0x1f')](_0x3a3d87[_0x952e('0x1e')],function(_0x17a1fe){return{'model':db[_0x17a1fe[_0x952e('0x20')]],'as':_0x17a1fe['as'],'attributes':_0x17a1fe[_0x952e('0x1d')],'include':_0x17a1fe[_0x952e('0x1e')]?_[_0x952e('0x1f')](_0x17a1fe[_0x952e('0x1e')],function(_0xf18d80){return{'model':db[_0xf18d80[_0x952e('0x20')]],'as':_0xf18d80['as'],'attributes':_0xf18d80[_0x952e('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x356251){logger[_0x952e('0xe')](_0x952e('0x21'),_0x5cec55);logger[_0x952e('0x11')]('GetTemplate',_0x5cec55,JSON[_0x952e('0x13')](_0x356251));_0x1696b8(_0x356251);})[_0x952e('0x18')](function(_0x1f1c69){logger[_0x952e('0x14')](_0x952e('0x21'),_0x1f1c69['message'],_0x5cec55);_0x26e888(_0x47c92a[_0x952e('0x14')](0x1f4,_0x1f1c69[_0x952e('0x16')]));});});}; \ No newline at end of file +var _0x870c=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x569d72,_0x415be2){var _0xa891a0=function(_0x3ce2f9){while(--_0x3ce2f9){_0x569d72['push'](_0x569d72['shift']());}};_0xa891a0(++_0x415be2);}(_0x870c,0x171));var _0xc870=function(_0x3c8eae,_0x498ae3){_0x3c8eae=_0x3c8eae-0x0;var _0x5252fa=_0x870c[_0x3c8eae];return _0x5252fa;};'use strict';var _=require(_0xc870('0x0'));var util=require('util');var moment=require(_0xc870('0x1'));var BPromise=require(_0xc870('0x2'));var rs=require(_0xc870('0x3'));var fs=require('fs');var Redis=require(_0xc870('0x4'));var db=require(_0xc870('0x5'))['db'];var utils=require(_0xc870('0x6'));var logger=require('../../config/logger')(_0xc870('0x7'));var config=require(_0xc870('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc870('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34f9aa,_0x469473,_0x155c37){return new BPromise(function(_0x54f6d6,_0x31fb16){return client[_0xc870('0xa')](_0x34f9aa,_0x155c37)['then'](function(_0x12a050){logger[_0xc870('0xb')](_0xc870('0xc'),_0x469473,_0xc870('0xd'));logger[_0xc870('0xe')](_0xc870('0xf'),_0x469473,_0xc870('0xd'),JSON['stringify'](_0x12a050));if(_0x12a050[_0xc870('0x10')]){if(_0x12a050[_0xc870('0x10')][_0xc870('0x11')]===0x1f4){logger['error'](_0xc870('0xc'),_0x469473,_0x12a050[_0xc870('0x10')][_0xc870('0x12')]);return _0x31fb16(_0x12a050['error']['message']);}logger[_0xc870('0x10')](_0xc870('0xc'),_0x469473,_0x12a050['error']['message']);return _0x54f6d6(_0x12a050[_0xc870('0x10')][_0xc870('0x12')]);}else{logger['info'](_0xc870('0xc'),_0x469473,_0xc870('0xd'));_0x54f6d6(_0x12a050[_0xc870('0x13')][_0xc870('0x12')]);}})[_0xc870('0x14')](function(_0x308601){logger[_0xc870('0x10')](_0xc870('0xc'),_0x469473,_0x308601);_0x31fb16(_0x308601);});});}exports[_0xc870('0x15')]=function(_0x539d6c){var _0x4a6bc5=this;return new Promise(function(_0x26e8e3,_0x41b556){return db[_0xc870('0x16')][_0xc870('0x17')]({'raw':_0x539d6c['options']?_0x539d6c[_0xc870('0x18')][_0xc870('0x19')]===undefined?!![]:![]:!![],'where':_0x539d6c[_0xc870('0x18')]?_0x539d6c[_0xc870('0x18')][_0xc870('0x1a')]||null:null,'attributes':_0x539d6c[_0xc870('0x18')]?_0x539d6c[_0xc870('0x18')][_0xc870('0x1b')]||null:null,'limit':_0x539d6c[_0xc870('0x18')]?_0x539d6c[_0xc870('0x18')][_0xc870('0x1c')]||null:null,'include':_0x539d6c[_0xc870('0x18')]?_0x539d6c[_0xc870('0x18')][_0xc870('0x1d')]?_[_0xc870('0x1e')](_0x539d6c[_0xc870('0x18')][_0xc870('0x1d')],function(_0x5ebc61){return{'model':db[_0x5ebc61[_0xc870('0x1f')]],'as':_0x5ebc61['as'],'attributes':_0x5ebc61['attributes'],'include':_0x5ebc61[_0xc870('0x1d')]?_['map'](_0x5ebc61[_0xc870('0x1d')],function(_0x5e287f){return{'model':db[_0x5e287f[_0xc870('0x1f')]],'as':_0x5e287f['as'],'attributes':_0x5e287f[_0xc870('0x1b')],'include':_0x5e287f[_0xc870('0x1d')]?_[_0xc870('0x1e')](_0x5e287f['include'],function(_0xe69bda){return{'model':db[_0xe69bda[_0xc870('0x1f')]],'as':_0xe69bda['as'],'attributes':_0xe69bda['attributes']};}):[]};}):[]};}):[]:[]})[_0xc870('0x20')](function(_0x69544){logger[_0xc870('0xb')](_0xc870('0x15'),_0x539d6c);logger[_0xc870('0xe')]('GetTemplate',_0x539d6c,JSON[_0xc870('0x21')](_0x69544));_0x26e8e3(_0x69544);})[_0xc870('0x14')](function(_0x4f557d){logger[_0xc870('0x10')]('GetTemplate',_0x4f557d['message'],_0x539d6c);_0x41b556(_0x4a6bc5['error'](0x1f4,_0x4f557d[_0xc870('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index b8bea95..3609e70 100644 --- a/server/api/trigger/index.js +++ b/server/api/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebd7=['/:id/all_conditions','/:id/any_conditions','/:id/actions','getActions','post','addAnyCondition','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show'];(function(_0x156bab,_0x438a0c){var _0xebdf00=function(_0x2cfcb0){while(--_0x2cfcb0){_0x156bab['push'](_0x156bab['shift']());}};_0xebdf00(++_0x438a0c);}(_0xebd7,0x144));var _0x7ebd=function(_0x112405,_0x4bb2bb){_0x112405=_0x112405-0x0;var _0x2ae382=_0xebd7[_0x112405];return _0x2ae382;};'use strict';var multer=require(_0x7ebd('0x0'));var util=require(_0x7ebd('0x1'));var path=require(_0x7ebd('0x2'));var timeout=require(_0x7ebd('0x3'));var express=require(_0x7ebd('0x4'));var router=express['Router']();var auth=require(_0x7ebd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7ebd('0x6'));var controller=require(_0x7ebd('0x7'));router[_0x7ebd('0x8')]('/',auth[_0x7ebd('0x9')](),controller[_0x7ebd('0xa')]);router[_0x7ebd('0x8')]('/:id',auth[_0x7ebd('0x9')](),controller[_0x7ebd('0xb')]);router[_0x7ebd('0x8')](_0x7ebd('0xc'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x7ebd('0x8')](_0x7ebd('0xd'),auth[_0x7ebd('0x9')](),controller['getAnyConditions']);router[_0x7ebd('0x8')](_0x7ebd('0xe'),auth['isAuthenticated'](),controller[_0x7ebd('0xf')]);router['post']('/',auth[_0x7ebd('0x9')](),controller['create']);router[_0x7ebd('0x10')](_0x7ebd('0xc'),auth[_0x7ebd('0x9')](),controller['addAllCondition']);router[_0x7ebd('0x10')](_0x7ebd('0xd'),auth[_0x7ebd('0x9')](),controller[_0x7ebd('0x11')]);router[_0x7ebd('0x10')](_0x7ebd('0xe'),auth[_0x7ebd('0x9')](),controller['addAction']);router[_0x7ebd('0x12')](_0x7ebd('0x13'),auth['isAuthenticated'](),controller[_0x7ebd('0x14')]);router[_0x7ebd('0x15')](_0x7ebd('0x13'),auth[_0x7ebd('0x9')](),controller[_0x7ebd('0x16')]);module[_0x7ebd('0x17')]=router; \ No newline at end of file +var _0x4747=['addAllCondition','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create'];(function(_0x3b5587,_0x22a6f4){var _0x3fbb62=function(_0x41f5ce){while(--_0x41f5ce){_0x3b5587['push'](_0x3b5587['shift']());}};_0x3fbb62(++_0x22a6f4);}(_0x4747,0x1e1));var _0x7474=function(_0x19fa06,_0x14dcc6){_0x19fa06=_0x19fa06-0x0;var _0x278075=_0x4747[_0x19fa06];return _0x278075;};'use strict';var multer=require(_0x7474('0x0'));var util=require(_0x7474('0x1'));var path=require(_0x7474('0x2'));var timeout=require('connect-timeout');var express=require(_0x7474('0x3'));var router=express['Router']();var auth=require(_0x7474('0x4'));var interaction=require(_0x7474('0x5'));var config=require(_0x7474('0x6'));var controller=require(_0x7474('0x7'));router['get']('/',auth[_0x7474('0x8')](),controller[_0x7474('0x9')]);router[_0x7474('0xa')](_0x7474('0xb'),auth[_0x7474('0x8')](),controller['show']);router[_0x7474('0xa')](_0x7474('0xc'),auth[_0x7474('0x8')](),controller['getAllConditions']);router[_0x7474('0xa')](_0x7474('0xd'),auth[_0x7474('0x8')](),controller[_0x7474('0xe')]);router[_0x7474('0xa')](_0x7474('0xf'),auth['isAuthenticated'](),controller[_0x7474('0x10')]);router[_0x7474('0x11')]('/',auth[_0x7474('0x8')](),controller[_0x7474('0x12')]);router[_0x7474('0x11')](_0x7474('0xc'),auth[_0x7474('0x8')](),controller[_0x7474('0x13')]);router[_0x7474('0x11')](_0x7474('0xd'),auth[_0x7474('0x8')](),controller['addAnyCondition']);router[_0x7474('0x11')](_0x7474('0xf'),auth[_0x7474('0x8')](),controller['addAction']);router[_0x7474('0x14')](_0x7474('0xb'),auth[_0x7474('0x8')](),controller[_0x7474('0x15')]);router[_0x7474('0x16')](_0x7474('0xb'),auth[_0x7474('0x8')](),controller[_0x7474('0x17')]);module[_0x7474('0x18')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 06239cd..2c488c7 100644 --- a/server/api/trigger/trigger.attributes.js +++ b/server/api/trigger/trigger.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5ec=['sequelize','exports','STRING','BOOLEAN'];(function(_0x36c847,_0x41da55){var _0x46004b=function(_0x3d5053){while(--_0x3d5053){_0x36c847['push'](_0x36c847['shift']());}};_0x46004b(++_0x41da55);}(_0xc5ec,0x6c));var _0xcc5e=function(_0x1fee24,_0x5b185e){_0x1fee24=_0x1fee24-0x0;var _0x3f85a6=_0xc5ec[_0x1fee24];return _0x3f85a6;};'use strict';var Sequelize=require(_0xcc5e('0x0'));module[_0xcc5e('0x1')]={'name':{'type':Sequelize[_0xcc5e('0x2')]},'channel':{'type':Sequelize[_0xcc5e('0x2')]},'description':{'type':Sequelize[_0xcc5e('0x2')]},'status':{'type':Sequelize[_0xcc5e('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0d7b=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1a45dd,_0x4bd6ae){var _0x2a3567=function(_0x220d94){while(--_0x220d94){_0x1a45dd['push'](_0x1a45dd['shift']());}};_0x2a3567(++_0x4bd6ae);}(_0x0d7b,0x84));var _0xb0d7=function(_0x376506,_0x4fe6bf){_0x376506=_0x376506-0x0;var _0x10401b=_0x0d7b[_0x376506];return _0x10401b;};'use strict';var Sequelize=require(_0xb0d7('0x0'));module[_0xb0d7('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb0d7('0x2')]},'description':{'type':Sequelize[_0xb0d7('0x2')]},'status':{'type':Sequelize[_0xb0d7('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index f2c5214..88785dc 100644 --- a/server/api/trigger/trigger.controller.js +++ b/server/api/trigger/trigger.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5231=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','Trigger','rawAttributes','model','keys','query','intersection','attributes','length','nolimit','sort','filters','pick','filter','where','map','type','key','field','merge','include','rows','catch','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','fields','order','hasOwnProperty','getAnyConditions','TriggerId','Action','getActions','html-pdf'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x5231,0x1c6));var _0x1523=function(_0x4b8954,_0x2c0a1b){_0x4b8954=_0x4b8954-0x0;var _0x2c35ca=_0x5231[_0x4b8954];return _0x2c35ca;};'use strict';var pdf=require(_0x1523('0x0'));var emlformat=require(_0x1523('0x1'));var rimraf=require(_0x1523('0x2'));var zipdir=require(_0x1523('0x3'));var jsonpatch=require(_0x1523('0x4'));var rp=require(_0x1523('0x5'));var moment=require(_0x1523('0x6'));var BPromise=require(_0x1523('0x7'));var Mustache=require(_0x1523('0x8'));var util=require(_0x1523('0x9'));var path=require('path');var sox=require(_0x1523('0xa'));var csv=require(_0x1523('0xb'));var ejs=require(_0x1523('0xc'));var fs=require('fs');var _=require(_0x1523('0xd'));var squel=require('squel');var crypto=require(_0x1523('0xe'));var jsforce=require(_0x1523('0xf'));var deskjs=require(_0x1523('0x10'));var toCsv=require(_0x1523('0xb'));var querystring=require(_0x1523('0x11'));var Papa=require(_0x1523('0x12'));var Redis=require(_0x1523('0x13'));var authService=require(_0x1523('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1523('0x15'))(_0x1523('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa3b151,_0x40d074){_0x40d074=_0x40d074||0xcc;return function(_0x127923){if(_0x127923){return _0xa3b151[_0x1523('0x17')](_0x40d074);}return _0xa3b151[_0x1523('0x18')](_0x40d074)[_0x1523('0x19')]();};}function respondWithResult(_0x1de8c4,_0x57f486){_0x57f486=_0x57f486||0xc8;return function(_0x37c98c){if(_0x37c98c){return _0x1de8c4['status'](_0x57f486)['json'](_0x37c98c);}};}function respondWithFilteredResult(_0x1c19f2,_0x599df8){return function(_0x5b8dc){if(_0x5b8dc){var _0x5b2268=_0x5b8dc[_0x1523('0x1a')],_0x41b106=_0x599df8['offset'],_0x165292=_0x599df8[_0x1523('0x1b')]+_0x599df8[_0x1523('0x1c')],_0x18d065;if(_0x165292>=_0x5b2268){_0x165292=_0x5b2268;_0x18d065=0xc8;}else{_0x18d065=0xce;}_0x1c19f2[_0x1523('0x18')](_0x18d065);return _0x1c19f2[_0x1523('0x1d')]('Content-Range',_0x41b106+'-'+_0x165292+'/'+_0x5b2268)[_0x1523('0x1e')](_0x5b8dc);}return null;};}function patchUpdates(_0x12c077){return function(_0x4abbef){try{jsonpatch[_0x1523('0x1f')](_0x4abbef,_0x12c077,!![]);}catch(_0x15657c){return BPromise[_0x1523('0x20')](_0x15657c);}return _0x4abbef[_0x1523('0x21')]();};}function saveUpdates(_0x57f46c,_0x25a001){return function(_0x80bf46){if(_0x80bf46){return _0x80bf46[_0x1523('0x22')](_0x57f46c)[_0x1523('0x23')](function(_0x552706){return _0x552706;});}return null;};}function removeEntity(_0x353b9f,_0xc650e7){return function(_0x22106f){if(_0x22106f){return _0x22106f['destroy']()[_0x1523('0x23')](function(){var _0x1dd472=_0x22106f[_0x1523('0x24')]({'plain':!![]});var _0x45e30a='Triggers';return db[_0x1523('0x25')][_0x1523('0x26')]({'where':{'type':_0x45e30a,'resourceId':_0x1dd472['id']}})['then'](function(){return _0x22106f;});})['then'](function(){_0x353b9f[_0x1523('0x18')](0xcc)[_0x1523('0x19')]();});}};}function handleEntityNotFound(_0xe734b0,_0x4cb4c1){return function(_0x192cb2){if(!_0x192cb2){_0xe734b0[_0x1523('0x17')](0x194);}return _0x192cb2;};}function handleError(_0x2b55f6,_0x147cbc){_0x147cbc=_0x147cbc||0x1f4;return function(_0x407c84){logger[_0x1523('0x27')](_0x407c84[_0x1523('0x28')]);if(_0x407c84[_0x1523('0x29')]){delete _0x407c84[_0x1523('0x29')];}_0x2b55f6['status'](_0x147cbc)[_0x1523('0x2a')](_0x407c84);};}exports[_0x1523('0x2b')]=function(_0x132da4,_0x14893f){var _0x1e0815={},_0x1bd190={},_0x4d8241={'count':0x0,'rows':[]};var _0xd69bcd=db[_0x1523('0x2c')][_0x1523('0x2d')];_0x1bd190[_0x1523('0x2e')]=_[_0x1523('0x2f')](_0xd69bcd);_0x1bd190[_0x1523('0x30')]=_[_0x1523('0x2f')](_0x132da4[_0x1523('0x30')]);_0x1bd190['filters']=_[_0x1523('0x31')](_0x1bd190[_0x1523('0x2e')],_0x1bd190[_0x1523('0x30')]);_0x1e0815[_0x1523('0x32')]=_['intersection'](_0x1bd190[_0x1523('0x2e')],qs['fields'](_0x132da4['query']['fields']));_0x1e0815['attributes']=_0x1e0815['attributes'][_0x1523('0x33')]?_0x1e0815[_0x1523('0x32')]:_0x1bd190[_0x1523('0x2e')];if(!_0x132da4[_0x1523('0x30')]['hasOwnProperty'](_0x1523('0x34'))){_0x1e0815[_0x1523('0x1c')]=qs['limit'](_0x132da4[_0x1523('0x30')][_0x1523('0x1c')]);_0x1e0815[_0x1523('0x1b')]=qs[_0x1523('0x1b')](_0x132da4[_0x1523('0x30')][_0x1523('0x1b')]);}_0x1e0815['order']=qs[_0x1523('0x35')](_0x132da4[_0x1523('0x30')]['sort']);_0x1e0815['where']=qs[_0x1523('0x36')](_[_0x1523('0x37')](_0x132da4['query'],_0x1bd190['filters']));if(_0x132da4[_0x1523('0x30')][_0x1523('0x38')]){_0x1e0815[_0x1523('0x39')]=_['merge'](_0x1e0815[_0x1523('0x39')],{'$or':_[_0x1523('0x3a')](_0xd69bcd,function(_0x14269f){if(_0x14269f[_0x1523('0x3b')][_0x1523('0x3c')]!=='VIRTUAL'){var _0x406813={};_0x406813[_0x14269f[_0x1523('0x3d')]]={'$like':'%'+_0x132da4[_0x1523('0x30')]['filter']+'%'};return _0x406813;}})});}_0x1e0815=_[_0x1523('0x3e')]({},_0x1e0815,_0x132da4['options']);var _0x12cef0={'where':_0x1e0815[_0x1523('0x39')]};return db[_0x1523('0x2c')]['count'](_0x12cef0)[_0x1523('0x23')](function(_0x2e6e7f){_0x4d8241['count']=_0x2e6e7f;if(_0x132da4[_0x1523('0x30')]['includeAll']){_0x1e0815[_0x1523('0x3f')]=[{'all':!![]}];}return db[_0x1523('0x2c')]['findAll'](_0x1e0815);})[_0x1523('0x23')](function(_0x5ce267){_0x4d8241[_0x1523('0x40')]=_0x5ce267;return _0x4d8241;})['then'](respondWithFilteredResult(_0x14893f,_0x1e0815))[_0x1523('0x41')](handleError(_0x14893f,null));};exports[_0x1523('0x42')]=function(_0x532e90,_0x14022b){var _0x17ee5e={'raw':![],'where':{'id':_0x532e90[_0x1523('0x43')]['id']}},_0x694fc7={};_0x694fc7[_0x1523('0x2e')]=_['keys'](db[_0x1523('0x2c')][_0x1523('0x2d')]);_0x694fc7[_0x1523('0x30')]=_['keys'](_0x532e90[_0x1523('0x30')]);_0x694fc7['filters']=_['intersection'](_0x694fc7[_0x1523('0x2e')],_0x694fc7[_0x1523('0x30')]);_0x17ee5e['attributes']=_[_0x1523('0x31')](_0x694fc7[_0x1523('0x2e')],qs['fields'](_0x532e90[_0x1523('0x30')]['fields']));_0x17ee5e[_0x1523('0x32')]=_0x17ee5e['attributes'][_0x1523('0x33')]?_0x17ee5e['attributes']:_0x694fc7[_0x1523('0x2e')];if(_0x532e90['query'][_0x1523('0x44')]){_0x17ee5e[_0x1523('0x3f')]=[{'all':!![]}];}_0x17ee5e=_['merge']({},_0x17ee5e,_0x532e90[_0x1523('0x45')]);return db[_0x1523('0x2c')][_0x1523('0x46')](_0x17ee5e)[_0x1523('0x23')](handleEntityNotFound(_0x14022b,null))[_0x1523('0x23')](respondWithResult(_0x14022b,null))[_0x1523('0x41')](handleError(_0x14022b,null));};exports[_0x1523('0x47')]=function(_0x291447,_0x2d3723){return db['Trigger'][_0x1523('0x47')](_0x291447[_0x1523('0x48')],{})[_0x1523('0x23')](function(_0x268276){var _0x4cf7c6=_0x291447[_0x1523('0x49')][_0x1523('0x24')]({'plain':!![]});if(!_0x4cf7c6)throw new Error(_0x1523('0x4a'));if(_0x4cf7c6['role']==='user'){var _0x4a2aaa=_0x268276[_0x1523('0x24')]({'plain':!![]});var _0x205b2f='Triggers';return db[_0x1523('0x4b')]['find']({'where':{'name':_0x205b2f,'userProfileId':_0x4cf7c6[_0x1523('0x4c')]},'raw':!![]})[_0x1523('0x23')](function(_0x3310eb){if(_0x3310eb&&_0x3310eb['autoAssociation']===0x0){return db[_0x1523('0x25')]['create']({'name':_0x4a2aaa['name'],'resourceId':_0x4a2aaa['id'],'type':_0x3310eb[_0x1523('0x29')],'sectionId':_0x3310eb['id']},{})[_0x1523('0x23')](function(){return _0x268276;});}else{return _0x268276;}})[_0x1523('0x41')](function(_0x26752f){logger[_0x1523('0x27')](_0x1523('0x4d'),_0x26752f);throw _0x26752f;});}return _0x268276;})['then'](respondWithResult(_0x2d3723,0xc9))[_0x1523('0x41')](handleError(_0x2d3723,null));};exports['update']=function(_0x5f0cab,_0x21fa7e){if(_0x5f0cab[_0x1523('0x48')]['id']){delete _0x5f0cab[_0x1523('0x48')]['id'];}return db[_0x1523('0x2c')][_0x1523('0x46')]({'where':{'id':_0x5f0cab[_0x1523('0x43')]['id']}})[_0x1523('0x23')](handleEntityNotFound(_0x21fa7e,null))['then'](saveUpdates(_0x5f0cab['body'],null))[_0x1523('0x23')](respondWithResult(_0x21fa7e,null))[_0x1523('0x41')](handleError(_0x21fa7e,null));};exports['destroy']=function(_0x28a32e,_0x3173cb){return db[_0x1523('0x2c')][_0x1523('0x46')]({'where':{'id':_0x28a32e['params']['id']}})[_0x1523('0x23')](handleEntityNotFound(_0x3173cb,null))['then'](removeEntity(_0x3173cb,null))[_0x1523('0x41')](handleError(_0x3173cb,null));};exports[_0x1523('0x4e')]=function(_0x450ec3,_0x15bcab,_0x3a2c54){if(_0x450ec3[_0x1523('0x48')]['id']){delete _0x450ec3[_0x1523('0x48')]['id'];}return db[_0x1523('0x2c')][_0x1523('0x46')]({'where':{'id':_0x450ec3['params']['id']}})[_0x1523('0x23')](handleEntityNotFound(_0x15bcab,null))[_0x1523('0x23')](function(_0x405220){if(_0x405220){_0x450ec3[_0x1523('0x48')]['TriggerAllId']=_0x405220['id'];return db[_0x1523('0x4f')][_0x1523('0x47')](_0x450ec3[_0x1523('0x48')]);}})[_0x1523('0x23')](respondWithResult(_0x15bcab,null))[_0x1523('0x41')](handleError(_0x15bcab,null));};exports[_0x1523('0x50')]=function(_0x13306d,_0x4c0111,_0x2243d6){if(_0x13306d[_0x1523('0x48')]['id']){delete _0x13306d[_0x1523('0x48')]['id'];}return db[_0x1523('0x2c')][_0x1523('0x46')]({'where':{'id':_0x13306d[_0x1523('0x43')]['id']}})[_0x1523('0x23')](handleEntityNotFound(_0x4c0111,null))[_0x1523('0x23')](function(_0x4d327c){if(_0x4d327c){_0x13306d[_0x1523('0x48')][_0x1523('0x51')]=_0x4d327c['id'];return db['Condition'][_0x1523('0x47')](_0x13306d[_0x1523('0x48')]);}})[_0x1523('0x23')](respondWithResult(_0x4c0111,null))['catch'](handleError(_0x4c0111,null));};exports[_0x1523('0x52')]=function(_0x7c3ec3,_0x5891e7,_0x23ca7c){var _0x3f22fc={};var _0x41a0d0={};var _0x265240;var _0x39e7ea;return db[_0x1523('0x2c')][_0x1523('0x53')]({'where':{'id':_0x7c3ec3[_0x1523('0x43')]['id']}})['then'](handleEntityNotFound(_0x5891e7,null))['then'](function(_0x1bdd0f){if(_0x1bdd0f){_0x265240=_0x1bdd0f;_0x41a0d0['model']=_[_0x1523('0x2f')](db[_0x1523('0x4f')][_0x1523('0x2d')]);_0x41a0d0[_0x1523('0x30')]=_[_0x1523('0x2f')](_0x7c3ec3[_0x1523('0x30')]);_0x41a0d0[_0x1523('0x36')]=_['intersection'](_0x41a0d0[_0x1523('0x2e')],_0x41a0d0[_0x1523('0x30')]);_0x3f22fc[_0x1523('0x32')]=_[_0x1523('0x31')](_0x41a0d0[_0x1523('0x2e')],qs['fields'](_0x7c3ec3['query'][_0x1523('0x54')]));_0x3f22fc['attributes']=_0x3f22fc[_0x1523('0x32')]['length']?_0x3f22fc[_0x1523('0x32')]:_0x41a0d0[_0x1523('0x2e')];_0x3f22fc[_0x1523('0x55')]=qs[_0x1523('0x35')](_0x7c3ec3[_0x1523('0x30')]['sort']);_0x3f22fc[_0x1523('0x39')]=qs['filters'](_[_0x1523('0x37')](_0x7c3ec3[_0x1523('0x30')],_0x41a0d0['filters']));if(_0x7c3ec3['query'][_0x1523('0x38')]){_0x3f22fc[_0x1523('0x39')]=_[_0x1523('0x3e')](_0x3f22fc[_0x1523('0x39')],{'$or':_[_0x1523('0x3a')](_0x3f22fc['attributes'],function(_0x16027c){var _0x3a87f2={};_0x3a87f2[_0x16027c]={'$like':'%'+_0x7c3ec3[_0x1523('0x30')][_0x1523('0x38')]+'%'};return _0x3a87f2;})});}_0x3f22fc=_[_0x1523('0x3e')]({},_0x3f22fc,_0x7c3ec3['options']);return _0x265240[_0x1523('0x52')](_0x3f22fc);}})['then'](function(_0x5028b0){if(_0x5028b0){_0x39e7ea=_0x5028b0[_0x1523('0x33')];if(!_0x7c3ec3[_0x1523('0x30')][_0x1523('0x56')](_0x1523('0x34'))){_0x3f22fc[_0x1523('0x1c')]=qs['limit'](_0x7c3ec3[_0x1523('0x30')][_0x1523('0x1c')]);_0x3f22fc[_0x1523('0x1b')]=qs['offset'](_0x7c3ec3[_0x1523('0x30')]['offset']);}return _0x265240[_0x1523('0x52')](_0x3f22fc);}})[_0x1523('0x23')](function(_0x3ee5db){if(_0x3ee5db){return _0x3ee5db?{'count':_0x39e7ea,'rows':_0x3ee5db}:null;}})[_0x1523('0x23')](respondWithResult(_0x5891e7,null))[_0x1523('0x41')](handleError(_0x5891e7,null));};exports['getAnyConditions']=function(_0x4c6d5f,_0x9387a2,_0xde780f){var _0x548857={};var _0x512bf0={};var _0x1225f0;var _0x22514f;return db[_0x1523('0x2c')][_0x1523('0x53')]({'where':{'id':_0x4c6d5f[_0x1523('0x43')]['id']}})[_0x1523('0x23')](handleEntityNotFound(_0x9387a2,null))[_0x1523('0x23')](function(_0x334623){if(_0x334623){_0x1225f0=_0x334623;_0x512bf0[_0x1523('0x2e')]=_['keys'](db['Condition'][_0x1523('0x2d')]);_0x512bf0[_0x1523('0x30')]=_['keys'](_0x4c6d5f['query']);_0x512bf0['filters']=_[_0x1523('0x31')](_0x512bf0[_0x1523('0x2e')],_0x512bf0[_0x1523('0x30')]);_0x548857[_0x1523('0x32')]=_[_0x1523('0x31')](_0x512bf0['model'],qs[_0x1523('0x54')](_0x4c6d5f['query'][_0x1523('0x54')]));_0x548857[_0x1523('0x32')]=_0x548857[_0x1523('0x32')][_0x1523('0x33')]?_0x548857['attributes']:_0x512bf0['model'];_0x548857['order']=qs[_0x1523('0x35')](_0x4c6d5f[_0x1523('0x30')][_0x1523('0x35')]);_0x548857[_0x1523('0x39')]=qs[_0x1523('0x36')](_[_0x1523('0x37')](_0x4c6d5f[_0x1523('0x30')],_0x512bf0['filters']));if(_0x4c6d5f[_0x1523('0x30')]['filter']){_0x548857[_0x1523('0x39')]=_[_0x1523('0x3e')](_0x548857[_0x1523('0x39')],{'$or':_[_0x1523('0x3a')](_0x548857[_0x1523('0x32')],function(_0x297f0d){var _0xc7119a={};_0xc7119a[_0x297f0d]={'$like':'%'+_0x4c6d5f[_0x1523('0x30')][_0x1523('0x38')]+'%'};return _0xc7119a;})});}_0x548857=_[_0x1523('0x3e')]({},_0x548857,_0x4c6d5f['options']);return _0x1225f0[_0x1523('0x57')](_0x548857);}})[_0x1523('0x23')](function(_0x2ff84e){if(_0x2ff84e){_0x22514f=_0x2ff84e[_0x1523('0x33')];if(!_0x4c6d5f[_0x1523('0x30')][_0x1523('0x56')](_0x1523('0x34'))){_0x548857[_0x1523('0x1c')]=qs[_0x1523('0x1c')](_0x4c6d5f[_0x1523('0x30')]['limit']);_0x548857[_0x1523('0x1b')]=qs[_0x1523('0x1b')](_0x4c6d5f['query'][_0x1523('0x1b')]);}return _0x1225f0[_0x1523('0x57')](_0x548857);}})[_0x1523('0x23')](function(_0x559e38){if(_0x559e38){return _0x559e38?{'count':_0x22514f,'rows':_0x559e38}:null;}})['then'](respondWithResult(_0x9387a2,null))[_0x1523('0x41')](handleError(_0x9387a2,null));};exports['addAction']=function(_0x474b0c,_0x1619bd,_0x457ba2){if(_0x474b0c[_0x1523('0x48')]['id']){delete _0x474b0c[_0x1523('0x48')]['id'];}return db['Trigger'][_0x1523('0x46')]({'where':{'id':_0x474b0c['params']['id']}})[_0x1523('0x23')](handleEntityNotFound(_0x1619bd,null))[_0x1523('0x23')](function(_0x177700){if(_0x177700){_0x474b0c[_0x1523('0x48')][_0x1523('0x58')]=_0x177700['id'];return db[_0x1523('0x59')]['create'](_0x474b0c[_0x1523('0x48')]);}})[_0x1523('0x23')](respondWithResult(_0x1619bd,null))[_0x1523('0x41')](handleError(_0x1619bd,null));};exports[_0x1523('0x5a')]=function(_0x59354c,_0x44d4b4,_0x3ac9c1){var _0x3d769d={};var _0x197ad4={};var _0x2f444e;var _0x3da02d;return db[_0x1523('0x2c')][_0x1523('0x53')]({'where':{'id':_0x59354c[_0x1523('0x43')]['id']}})[_0x1523('0x23')](handleEntityNotFound(_0x44d4b4,null))['then'](function(_0x535c59){if(_0x535c59){_0x2f444e=_0x535c59;_0x197ad4[_0x1523('0x2e')]=_[_0x1523('0x2f')](db['Action'][_0x1523('0x2d')]);_0x197ad4['query']=_[_0x1523('0x2f')](_0x59354c[_0x1523('0x30')]);_0x197ad4['filters']=_[_0x1523('0x31')](_0x197ad4[_0x1523('0x2e')],_0x197ad4[_0x1523('0x30')]);_0x3d769d[_0x1523('0x32')]=_[_0x1523('0x31')](_0x197ad4[_0x1523('0x2e')],qs[_0x1523('0x54')](_0x59354c[_0x1523('0x30')][_0x1523('0x54')]));_0x3d769d['attributes']=_0x3d769d[_0x1523('0x32')][_0x1523('0x33')]?_0x3d769d[_0x1523('0x32')]:_0x197ad4['model'];_0x3d769d[_0x1523('0x55')]=qs[_0x1523('0x35')](_0x59354c[_0x1523('0x30')][_0x1523('0x35')]);_0x3d769d['where']=qs[_0x1523('0x36')](_[_0x1523('0x37')](_0x59354c[_0x1523('0x30')],_0x197ad4[_0x1523('0x36')]));if(_0x59354c[_0x1523('0x30')]['filter']){_0x3d769d['where']=_[_0x1523('0x3e')](_0x3d769d[_0x1523('0x39')],{'$or':_[_0x1523('0x3a')](_0x3d769d['attributes'],function(_0x266beb){var _0x236acf={};_0x236acf[_0x266beb]={'$like':'%'+_0x59354c[_0x1523('0x30')][_0x1523('0x38')]+'%'};return _0x236acf;})});}_0x3d769d=_[_0x1523('0x3e')]({},_0x3d769d,_0x59354c[_0x1523('0x45')]);return _0x2f444e[_0x1523('0x5a')](_0x3d769d);}})[_0x1523('0x23')](function(_0x170065){if(_0x170065){_0x3da02d=_0x170065[_0x1523('0x33')];if(!_0x59354c['query'][_0x1523('0x56')](_0x1523('0x34'))){_0x3d769d['limit']=qs[_0x1523('0x1c')](_0x59354c[_0x1523('0x30')]['limit']);_0x3d769d[_0x1523('0x1b')]=qs[_0x1523('0x1b')](_0x59354c[_0x1523('0x30')][_0x1523('0x1b')]);}return _0x2f444e[_0x1523('0x5a')](_0x3d769d);}})[_0x1523('0x23')](function(_0x552b29){if(_0x552b29){return _0x552b29?{'count':_0x3da02d,'rows':_0x552b29}:null;}})['then'](respondWithResult(_0x44d4b4,null))['catch'](handleError(_0x44d4b4,null));}; \ No newline at end of file +var _0xedca=['html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','count','offset','limit','apply','reject','save','update','then','get','Triggers','UserProfileResource','stack','name','send','Trigger','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions'];(function(_0x4286bc,_0x3637ff){var _0x5d6a46=function(_0x35982d){while(--_0x35982d){_0x4286bc['push'](_0x4286bc['shift']());}};_0x5d6a46(++_0x3637ff);}(_0xedca,0x15c));var _0xaedc=function(_0x465095,_0x14c116){_0x465095=_0x465095-0x0;var _0x3c2af4=_0xedca[_0x465095];return _0x3c2af4;};'use strict';var pdf=require(_0xaedc('0x0'));var emlformat=require(_0xaedc('0x1'));var rimraf=require(_0xaedc('0x2'));var zipdir=require(_0xaedc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaedc('0x4'));var BPromise=require(_0xaedc('0x5'));var Mustache=require(_0xaedc('0x6'));var util=require('util');var path=require('path');var sox=require(_0xaedc('0x7'));var csv=require(_0xaedc('0x8'));var ejs=require(_0xaedc('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xaedc('0xa'));var crypto=require(_0xaedc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xaedc('0xc'));var toCsv=require(_0xaedc('0x8'));var querystring=require(_0xaedc('0xd'));var Papa=require(_0xaedc('0xe'));var Redis=require(_0xaedc('0xf'));var authService=require(_0xaedc('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xaedc('0x11'));var logger=require(_0xaedc('0x12'))(_0xaedc('0x13'));var utils=require(_0xaedc('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xeb68b5,_0x190f6b){_0x190f6b=_0x190f6b||0xcc;return function(_0x547bc0){if(_0x547bc0){return _0xeb68b5[_0xaedc('0x15')](_0x190f6b);}return _0xeb68b5['status'](_0x190f6b)[_0xaedc('0x16')]();};}function respondWithResult(_0x4bc06e,_0x283772){_0x283772=_0x283772||0xc8;return function(_0x297cce){if(_0x297cce){return _0x4bc06e[_0xaedc('0x17')](_0x283772)['json'](_0x297cce);}};}function respondWithFilteredResult(_0x5e80be,_0x48b63b){return function(_0x5e4a6d){if(_0x5e4a6d){var _0x12cf5d=_0x5e4a6d[_0xaedc('0x18')],_0x5f01d5=_0x48b63b[_0xaedc('0x19')],_0x5d3252=_0x48b63b[_0xaedc('0x19')]+_0x48b63b[_0xaedc('0x1a')],_0x32d985;if(_0x5d3252>=_0x12cf5d){_0x5d3252=_0x12cf5d;_0x32d985=0xc8;}else{_0x32d985=0xce;}_0x5e80be[_0xaedc('0x17')](_0x32d985);return _0x5e80be['set']('Content-Range',_0x5f01d5+'-'+_0x5d3252+'/'+_0x12cf5d)['json'](_0x5e4a6d);}return null;};}function patchUpdates(_0x5b888c){return function(_0x1db9df){try{jsonpatch[_0xaedc('0x1b')](_0x1db9df,_0x5b888c,!![]);}catch(_0x46f2a4){return BPromise[_0xaedc('0x1c')](_0x46f2a4);}return _0x1db9df[_0xaedc('0x1d')]();};}function saveUpdates(_0x1269ea,_0x1feb13){return function(_0x1b4937){if(_0x1b4937){return _0x1b4937[_0xaedc('0x1e')](_0x1269ea)[_0xaedc('0x1f')](function(_0x26dcf1){return _0x26dcf1;});}return null;};}function removeEntity(_0x3cad4e,_0x3b7052){return function(_0xb1582d){if(_0xb1582d){return _0xb1582d['destroy']()[_0xaedc('0x1f')](function(){var _0x2005bb=_0xb1582d[_0xaedc('0x20')]({'plain':!![]});var _0x161e9c=_0xaedc('0x21');return db[_0xaedc('0x22')]['destroy']({'where':{'type':_0x161e9c,'resourceId':_0x2005bb['id']}})['then'](function(){return _0xb1582d;});})['then'](function(){_0x3cad4e[_0xaedc('0x17')](0xcc)[_0xaedc('0x16')]();});}};}function handleEntityNotFound(_0x2b5e00,_0xad7950){return function(_0x2cb838){if(!_0x2cb838){_0x2b5e00[_0xaedc('0x15')](0x194);}return _0x2cb838;};}function handleError(_0x2d1e6f,_0x30c9e1){_0x30c9e1=_0x30c9e1||0x1f4;return function(_0x143069){logger['error'](_0x143069[_0xaedc('0x23')]);if(_0x143069[_0xaedc('0x24')]){delete _0x143069[_0xaedc('0x24')];}_0x2d1e6f[_0xaedc('0x17')](_0x30c9e1)[_0xaedc('0x25')](_0x143069);};}exports['index']=function(_0x689239,_0x41f57a){var _0x3fd42c={},_0x25b1dc={},_0x81f9c3={'count':0x0,'rows':[]};var _0x518628=db[_0xaedc('0x26')]['rawAttributes'];_0x25b1dc[_0xaedc('0x27')]=_['keys'](_0x518628);_0x25b1dc[_0xaedc('0x28')]=_[_0xaedc('0x29')](_0x689239[_0xaedc('0x28')]);_0x25b1dc[_0xaedc('0x2a')]=_[_0xaedc('0x2b')](_0x25b1dc[_0xaedc('0x27')],_0x25b1dc[_0xaedc('0x28')]);_0x3fd42c[_0xaedc('0x2c')]=_[_0xaedc('0x2b')](_0x25b1dc[_0xaedc('0x27')],qs[_0xaedc('0x2d')](_0x689239[_0xaedc('0x28')][_0xaedc('0x2d')]));_0x3fd42c[_0xaedc('0x2c')]=_0x3fd42c[_0xaedc('0x2c')][_0xaedc('0x2e')]?_0x3fd42c[_0xaedc('0x2c')]:_0x25b1dc['model'];if(!_0x689239[_0xaedc('0x28')][_0xaedc('0x2f')](_0xaedc('0x30'))){_0x3fd42c['limit']=qs['limit'](_0x689239[_0xaedc('0x28')]['limit']);_0x3fd42c[_0xaedc('0x19')]=qs[_0xaedc('0x19')](_0x689239[_0xaedc('0x28')][_0xaedc('0x19')]);}_0x3fd42c[_0xaedc('0x31')]=qs[_0xaedc('0x32')](_0x689239[_0xaedc('0x28')][_0xaedc('0x32')]);_0x3fd42c[_0xaedc('0x33')]=qs['filters'](_[_0xaedc('0x34')](_0x689239[_0xaedc('0x28')],_0x25b1dc[_0xaedc('0x2a')]));if(_0x689239['query'][_0xaedc('0x35')]){_0x3fd42c[_0xaedc('0x33')]=_[_0xaedc('0x36')](_0x3fd42c[_0xaedc('0x33')],{'$or':_[_0xaedc('0x37')](_0x518628,function(_0x40d2ec){if(_0x40d2ec[_0xaedc('0x38')]['key']!==_0xaedc('0x39')){var _0xbea2e4={};_0xbea2e4[_0x40d2ec[_0xaedc('0x3a')]]={'$like':'%'+_0x689239[_0xaedc('0x28')]['filter']+'%'};return _0xbea2e4;}})});}_0x3fd42c=_[_0xaedc('0x36')]({},_0x3fd42c,_0x689239[_0xaedc('0x3b')]);var _0x1581e9={'where':_0x3fd42c['where']};return db[_0xaedc('0x26')]['count'](_0x1581e9)[_0xaedc('0x1f')](function(_0x24bfbb){_0x81f9c3[_0xaedc('0x18')]=_0x24bfbb;if(_0x689239[_0xaedc('0x28')][_0xaedc('0x3c')]){_0x3fd42c[_0xaedc('0x3d')]=[{'all':!![]}];}return db[_0xaedc('0x26')][_0xaedc('0x3e')](_0x3fd42c);})[_0xaedc('0x1f')](function(_0x54a9fe){_0x81f9c3['rows']=_0x54a9fe;return _0x81f9c3;})['then'](respondWithFilteredResult(_0x41f57a,_0x3fd42c))[_0xaedc('0x3f')](handleError(_0x41f57a,null));};exports[_0xaedc('0x40')]=function(_0xad9b95,_0x155897){var _0x3bb98e={'raw':![],'where':{'id':_0xad9b95['params']['id']}},_0xb8ab8={};_0xb8ab8[_0xaedc('0x27')]=_[_0xaedc('0x29')](db[_0xaedc('0x26')][_0xaedc('0x41')]);_0xb8ab8['query']=_[_0xaedc('0x29')](_0xad9b95['query']);_0xb8ab8[_0xaedc('0x2a')]=_['intersection'](_0xb8ab8[_0xaedc('0x27')],_0xb8ab8[_0xaedc('0x28')]);_0x3bb98e[_0xaedc('0x2c')]=_[_0xaedc('0x2b')](_0xb8ab8['model'],qs[_0xaedc('0x2d')](_0xad9b95['query'][_0xaedc('0x2d')]));_0x3bb98e[_0xaedc('0x2c')]=_0x3bb98e['attributes']['length']?_0x3bb98e[_0xaedc('0x2c')]:_0xb8ab8[_0xaedc('0x27')];if(_0xad9b95[_0xaedc('0x28')]['includeAll']){_0x3bb98e['include']=[{'all':!![]}];}_0x3bb98e=_[_0xaedc('0x36')]({},_0x3bb98e,_0xad9b95[_0xaedc('0x3b')]);return db['Trigger'][_0xaedc('0x42')](_0x3bb98e)[_0xaedc('0x1f')](handleEntityNotFound(_0x155897,null))[_0xaedc('0x1f')](respondWithResult(_0x155897,null))['catch'](handleError(_0x155897,null));};exports['create']=function(_0x1f9dd1,_0x3c97c0){return db[_0xaedc('0x26')][_0xaedc('0x43')](_0x1f9dd1[_0xaedc('0x44')],{})[_0xaedc('0x1f')](function(_0x3efc4e){var _0x37cab5=_0x1f9dd1[_0xaedc('0x45')]['get']({'plain':!![]});if(!_0x37cab5)throw new Error(_0xaedc('0x46'));if(_0x37cab5['role']===_0xaedc('0x45')){var _0x2a88ff=_0x3efc4e[_0xaedc('0x20')]({'plain':!![]});var _0x1e4869=_0xaedc('0x21');return db[_0xaedc('0x47')][_0xaedc('0x42')]({'where':{'name':_0x1e4869,'userProfileId':_0x37cab5['userProfileId']},'raw':!![]})[_0xaedc('0x1f')](function(_0x7a4c3c){if(_0x7a4c3c&&_0x7a4c3c[_0xaedc('0x48')]===0x0){return db['UserProfileResource'][_0xaedc('0x43')]({'name':_0x2a88ff[_0xaedc('0x24')],'resourceId':_0x2a88ff['id'],'type':_0x7a4c3c[_0xaedc('0x24')],'sectionId':_0x7a4c3c['id']},{})[_0xaedc('0x1f')](function(){return _0x3efc4e;});}else{return _0x3efc4e;}})[_0xaedc('0x3f')](function(_0x5033f1){logger['error'](_0xaedc('0x49'),_0x5033f1);throw _0x5033f1;});}return _0x3efc4e;})[_0xaedc('0x1f')](respondWithResult(_0x3c97c0,0xc9))[_0xaedc('0x3f')](handleError(_0x3c97c0,null));};exports[_0xaedc('0x1e')]=function(_0x256b48,_0x5eade1){if(_0x256b48['body']['id']){delete _0x256b48[_0xaedc('0x44')]['id'];}return db[_0xaedc('0x26')]['find']({'where':{'id':_0x256b48['params']['id']}})[_0xaedc('0x1f')](handleEntityNotFound(_0x5eade1,null))['then'](saveUpdates(_0x256b48['body'],null))[_0xaedc('0x1f')](respondWithResult(_0x5eade1,null))[_0xaedc('0x3f')](handleError(_0x5eade1,null));};exports[_0xaedc('0x4a')]=function(_0x1cf8f6,_0x53bcb7){return db[_0xaedc('0x26')][_0xaedc('0x42')]({'where':{'id':_0x1cf8f6[_0xaedc('0x4b')]['id']}})[_0xaedc('0x1f')](handleEntityNotFound(_0x53bcb7,null))[_0xaedc('0x1f')](removeEntity(_0x53bcb7,null))[_0xaedc('0x3f')](handleError(_0x53bcb7,null));};exports[_0xaedc('0x4c')]=function(_0x5a42ef,_0x47a3ba,_0x34aea1){if(_0x5a42ef[_0xaedc('0x44')]['id']){delete _0x5a42ef[_0xaedc('0x44')]['id'];}return db[_0xaedc('0x26')]['find']({'where':{'id':_0x5a42ef['params']['id']}})['then'](handleEntityNotFound(_0x47a3ba,null))[_0xaedc('0x1f')](function(_0x27f79b){if(_0x27f79b){_0x5a42ef['body'][_0xaedc('0x4d')]=_0x27f79b['id'];return db[_0xaedc('0x4e')]['create'](_0x5a42ef[_0xaedc('0x44')]);}})['then'](respondWithResult(_0x47a3ba,null))[_0xaedc('0x3f')](handleError(_0x47a3ba,null));};exports[_0xaedc('0x4f')]=function(_0x25672a,_0x456464,_0x1fa13c){if(_0x25672a[_0xaedc('0x44')]['id']){delete _0x25672a[_0xaedc('0x44')]['id'];}return db[_0xaedc('0x26')][_0xaedc('0x42')]({'where':{'id':_0x25672a[_0xaedc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x456464,null))[_0xaedc('0x1f')](function(_0x3f6d76){if(_0x3f6d76){_0x25672a[_0xaedc('0x44')][_0xaedc('0x50')]=_0x3f6d76['id'];return db[_0xaedc('0x4e')][_0xaedc('0x43')](_0x25672a[_0xaedc('0x44')]);}})[_0xaedc('0x1f')](respondWithResult(_0x456464,null))[_0xaedc('0x3f')](handleError(_0x456464,null));};exports[_0xaedc('0x51')]=function(_0x649392,_0x1fee2b,_0xa7702b){var _0x42ae1d={};var _0x4f7a8c={};var _0x20621f;var _0x25aa55;return db[_0xaedc('0x26')]['findOne']({'where':{'id':_0x649392['params']['id']}})[_0xaedc('0x1f')](handleEntityNotFound(_0x1fee2b,null))[_0xaedc('0x1f')](function(_0xf63365){if(_0xf63365){_0x20621f=_0xf63365;_0x4f7a8c[_0xaedc('0x27')]=_[_0xaedc('0x29')](db[_0xaedc('0x4e')][_0xaedc('0x41')]);_0x4f7a8c['query']=_[_0xaedc('0x29')](_0x649392[_0xaedc('0x28')]);_0x4f7a8c[_0xaedc('0x2a')]=_[_0xaedc('0x2b')](_0x4f7a8c[_0xaedc('0x27')],_0x4f7a8c[_0xaedc('0x28')]);_0x42ae1d['attributes']=_['intersection'](_0x4f7a8c[_0xaedc('0x27')],qs[_0xaedc('0x2d')](_0x649392[_0xaedc('0x28')]['fields']));_0x42ae1d[_0xaedc('0x2c')]=_0x42ae1d['attributes']['length']?_0x42ae1d[_0xaedc('0x2c')]:_0x4f7a8c[_0xaedc('0x27')];_0x42ae1d[_0xaedc('0x31')]=qs[_0xaedc('0x32')](_0x649392[_0xaedc('0x28')][_0xaedc('0x32')]);_0x42ae1d[_0xaedc('0x33')]=qs['filters'](_[_0xaedc('0x34')](_0x649392[_0xaedc('0x28')],_0x4f7a8c[_0xaedc('0x2a')]));if(_0x649392['query'][_0xaedc('0x35')]){_0x42ae1d['where']=_[_0xaedc('0x36')](_0x42ae1d[_0xaedc('0x33')],{'$or':_['map'](_0x42ae1d[_0xaedc('0x2c')],function(_0x569ab2){var _0x487abb={};_0x487abb[_0x569ab2]={'$like':'%'+_0x649392[_0xaedc('0x28')]['filter']+'%'};return _0x487abb;})});}_0x42ae1d=_[_0xaedc('0x36')]({},_0x42ae1d,_0x649392[_0xaedc('0x3b')]);return _0x20621f[_0xaedc('0x51')](_0x42ae1d);}})[_0xaedc('0x1f')](function(_0x20119b){if(_0x20119b){_0x25aa55=_0x20119b[_0xaedc('0x2e')];if(!_0x649392[_0xaedc('0x28')]['hasOwnProperty'](_0xaedc('0x30'))){_0x42ae1d['limit']=qs[_0xaedc('0x1a')](_0x649392[_0xaedc('0x28')]['limit']);_0x42ae1d[_0xaedc('0x19')]=qs[_0xaedc('0x19')](_0x649392['query'][_0xaedc('0x19')]);}return _0x20621f[_0xaedc('0x51')](_0x42ae1d);}})[_0xaedc('0x1f')](function(_0x24ca47){if(_0x24ca47){return _0x24ca47?{'count':_0x25aa55,'rows':_0x24ca47}:null;}})[_0xaedc('0x1f')](respondWithResult(_0x1fee2b,null))[_0xaedc('0x3f')](handleError(_0x1fee2b,null));};exports[_0xaedc('0x52')]=function(_0x52e56d,_0x21fc8c,_0x2482a4){var _0x3920d4={};var _0x3bc519={};var _0x48c4a9;var _0x32a585;return db[_0xaedc('0x26')]['findOne']({'where':{'id':_0x52e56d[_0xaedc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x21fc8c,null))[_0xaedc('0x1f')](function(_0x11369c){if(_0x11369c){_0x48c4a9=_0x11369c;_0x3bc519['model']=_[_0xaedc('0x29')](db['Condition'][_0xaedc('0x41')]);_0x3bc519['query']=_[_0xaedc('0x29')](_0x52e56d['query']);_0x3bc519['filters']=_[_0xaedc('0x2b')](_0x3bc519['model'],_0x3bc519['query']);_0x3920d4[_0xaedc('0x2c')]=_['intersection'](_0x3bc519[_0xaedc('0x27')],qs['fields'](_0x52e56d[_0xaedc('0x28')][_0xaedc('0x2d')]));_0x3920d4[_0xaedc('0x2c')]=_0x3920d4[_0xaedc('0x2c')][_0xaedc('0x2e')]?_0x3920d4[_0xaedc('0x2c')]:_0x3bc519[_0xaedc('0x27')];_0x3920d4[_0xaedc('0x31')]=qs[_0xaedc('0x32')](_0x52e56d['query'][_0xaedc('0x32')]);_0x3920d4[_0xaedc('0x33')]=qs[_0xaedc('0x2a')](_[_0xaedc('0x34')](_0x52e56d[_0xaedc('0x28')],_0x3bc519[_0xaedc('0x2a')]));if(_0x52e56d[_0xaedc('0x28')][_0xaedc('0x35')]){_0x3920d4[_0xaedc('0x33')]=_[_0xaedc('0x36')](_0x3920d4[_0xaedc('0x33')],{'$or':_['map'](_0x3920d4['attributes'],function(_0x45d527){var _0x1e5b8a={};_0x1e5b8a[_0x45d527]={'$like':'%'+_0x52e56d[_0xaedc('0x28')][_0xaedc('0x35')]+'%'};return _0x1e5b8a;})});}_0x3920d4=_[_0xaedc('0x36')]({},_0x3920d4,_0x52e56d[_0xaedc('0x3b')]);return _0x48c4a9[_0xaedc('0x52')](_0x3920d4);}})[_0xaedc('0x1f')](function(_0x3373b5){if(_0x3373b5){_0x32a585=_0x3373b5['length'];if(!_0x52e56d['query'][_0xaedc('0x2f')](_0xaedc('0x30'))){_0x3920d4[_0xaedc('0x1a')]=qs[_0xaedc('0x1a')](_0x52e56d[_0xaedc('0x28')][_0xaedc('0x1a')]);_0x3920d4[_0xaedc('0x19')]=qs[_0xaedc('0x19')](_0x52e56d[_0xaedc('0x28')][_0xaedc('0x19')]);}return _0x48c4a9[_0xaedc('0x52')](_0x3920d4);}})[_0xaedc('0x1f')](function(_0x5204ae){if(_0x5204ae){return _0x5204ae?{'count':_0x32a585,'rows':_0x5204ae}:null;}})['then'](respondWithResult(_0x21fc8c,null))[_0xaedc('0x3f')](handleError(_0x21fc8c,null));};exports[_0xaedc('0x53')]=function(_0x3361a2,_0x4d324e,_0x3f1145){if(_0x3361a2['body']['id']){delete _0x3361a2['body']['id'];}return db[_0xaedc('0x26')][_0xaedc('0x42')]({'where':{'id':_0x3361a2[_0xaedc('0x4b')]['id']}})[_0xaedc('0x1f')](handleEntityNotFound(_0x4d324e,null))['then'](function(_0x44d224){if(_0x44d224){_0x3361a2[_0xaedc('0x44')][_0xaedc('0x54')]=_0x44d224['id'];return db[_0xaedc('0x55')][_0xaedc('0x43')](_0x3361a2[_0xaedc('0x44')]);}})[_0xaedc('0x1f')](respondWithResult(_0x4d324e,null))[_0xaedc('0x3f')](handleError(_0x4d324e,null));};exports[_0xaedc('0x56')]=function(_0x168ef9,_0x21a905,_0x2cc667){var _0x5496ed={};var _0x13e87e={};var _0x298189;var _0x4b8c37;return db[_0xaedc('0x26')]['findOne']({'where':{'id':_0x168ef9['params']['id']}})['then'](handleEntityNotFound(_0x21a905,null))[_0xaedc('0x1f')](function(_0x237ab8){if(_0x237ab8){_0x298189=_0x237ab8;_0x13e87e['model']=_[_0xaedc('0x29')](db['Action'][_0xaedc('0x41')]);_0x13e87e['query']=_[_0xaedc('0x29')](_0x168ef9[_0xaedc('0x28')]);_0x13e87e[_0xaedc('0x2a')]=_[_0xaedc('0x2b')](_0x13e87e['model'],_0x13e87e[_0xaedc('0x28')]);_0x5496ed[_0xaedc('0x2c')]=_[_0xaedc('0x2b')](_0x13e87e[_0xaedc('0x27')],qs[_0xaedc('0x2d')](_0x168ef9[_0xaedc('0x28')][_0xaedc('0x2d')]));_0x5496ed[_0xaedc('0x2c')]=_0x5496ed[_0xaedc('0x2c')]['length']?_0x5496ed['attributes']:_0x13e87e[_0xaedc('0x27')];_0x5496ed[_0xaedc('0x31')]=qs[_0xaedc('0x32')](_0x168ef9[_0xaedc('0x28')][_0xaedc('0x32')]);_0x5496ed[_0xaedc('0x33')]=qs['filters'](_[_0xaedc('0x34')](_0x168ef9[_0xaedc('0x28')],_0x13e87e[_0xaedc('0x2a')]));if(_0x168ef9[_0xaedc('0x28')][_0xaedc('0x35')]){_0x5496ed['where']=_[_0xaedc('0x36')](_0x5496ed[_0xaedc('0x33')],{'$or':_[_0xaedc('0x37')](_0x5496ed[_0xaedc('0x2c')],function(_0x20176e){var _0x174882={};_0x174882[_0x20176e]={'$like':'%'+_0x168ef9[_0xaedc('0x28')]['filter']+'%'};return _0x174882;})});}_0x5496ed=_[_0xaedc('0x36')]({},_0x5496ed,_0x168ef9[_0xaedc('0x3b')]);return _0x298189['getActions'](_0x5496ed);}})[_0xaedc('0x1f')](function(_0x35da40){if(_0x35da40){_0x4b8c37=_0x35da40['length'];if(!_0x168ef9['query']['hasOwnProperty'](_0xaedc('0x30'))){_0x5496ed[_0xaedc('0x1a')]=qs[_0xaedc('0x1a')](_0x168ef9[_0xaedc('0x28')][_0xaedc('0x1a')]);_0x5496ed[_0xaedc('0x19')]=qs[_0xaedc('0x19')](_0x168ef9[_0xaedc('0x28')][_0xaedc('0x19')]);}return _0x298189[_0xaedc('0x56')](_0x5496ed);}})['then'](function(_0x1b4168){if(_0x1b4168){return _0x1b4168?{'count':_0x4b8c37,'rows':_0x1b4168}:null;}})[_0xaedc('0x1f')](respondWithResult(_0x21a905,null))['catch'](handleError(_0x21a905,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 56ba85c..6ceb59f 100644 --- a/server/api/trigger/trigger.model.js +++ b/server/api/trigger/trigger.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x644e=['exports','define','tools_triggers','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x938eb2,_0x57e235){var _0x33a52d=function(_0x23de73){while(--_0x23de73){_0x938eb2['push'](_0x938eb2['shift']());}};_0x33a52d(++_0x57e235);}(_0x644e,0x1d7));var _0xe644=function(_0x1a9c69,_0x31a73c){_0x1a9c69=_0x1a9c69-0x0;var _0x2bb231=_0x644e[_0x1a9c69];return _0x2bb231;};'use strict';var _=require(_0xe644('0x0'));var util=require('util');var logger=require(_0xe644('0x1'))(_0xe644('0x2'));var moment=require(_0xe644('0x3'));var BPromise=require(_0xe644('0x4'));var rp=require(_0xe644('0x5'));var fs=require('fs');var path=require(_0xe644('0x6'));var rimraf=require(_0xe644('0x7'));var config=require(_0xe644('0x8'));var attributes=require(_0xe644('0x9'));module[_0xe644('0xa')]=function(_0x53f76b,_0x2702d6){return _0x53f76b[_0xe644('0xb')]('Trigger',attributes,{'tableName':_0xe644('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb419=['util','../../config/logger','moment','bluebird','path','rimraf','./trigger.attributes','exports','define','Trigger','tools_triggers'];(function(_0x1ccf77,_0x1b255a){var _0x488456=function(_0x1f2a89){while(--_0x1f2a89){_0x1ccf77['push'](_0x1ccf77['shift']());}};_0x488456(++_0x1b255a);}(_0xb419,0x6e));var _0x9b41=function(_0x4b3a41,_0x2b0764){_0x4b3a41=_0x4b3a41-0x0;var _0x29b6fb=_0xb419[_0x4b3a41];return _0x29b6fb;};'use strict';var _=require('lodash');var util=require(_0x9b41('0x0'));var logger=require(_0x9b41('0x1'))('api');var moment=require(_0x9b41('0x2'));var BPromise=require(_0x9b41('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b41('0x4'));var rimraf=require(_0x9b41('0x5'));var config=require('../../config/environment');var attributes=require(_0x9b41('0x6'));module[_0x9b41('0x7')]=function(_0x36eb07,_0x5a248e){return _0x36eb07[_0x9b41('0x8')](_0x9b41('0x9'),attributes,{'tableName':_0x9b41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 6e09305..02057ec 100644 --- a/server/api/trigger/trigger.rpc.js +++ b/server/api/trigger/trigger.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c9a=['limit','include','map','attributes','model','ShowTrigger','find','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','raw'];(function(_0x3ba6fd,_0x3f2190){var _0x51de66=function(_0x1b1dd0){while(--_0x1b1dd0){_0x3ba6fd['push'](_0x3ba6fd['shift']());}};_0x51de66(++_0x3f2190);}(_0x1c9a,0x98));var _0xa1c9=function(_0x1a550e,_0x324fc2){_0x1a550e=_0x1a550e-0x0;var _0x2dfbcd=_0x1c9a[_0x1a550e];return _0x2dfbcd;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5448f2,_0x222624,_0x463c9c){return new BPromise(function(_0x3f07c2,_0x5059df){return client[_0xa1c9('0xa')](_0x5448f2,_0x463c9c)[_0xa1c9('0xb')](function(_0x24136d){logger[_0xa1c9('0xc')]('Trigger,\x20%s,\x20%s',_0x222624,_0xa1c9('0xd'));logger[_0xa1c9('0xe')](_0xa1c9('0xf'),_0x222624,_0xa1c9('0xd'),JSON[_0xa1c9('0x10')](_0x24136d));if(_0x24136d[_0xa1c9('0x11')]){if(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x5059df(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x3f07c2(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xc')](_0xa1c9('0x13'),_0x222624,_0xa1c9('0xd'));_0x3f07c2(_0x24136d[_0xa1c9('0x15')][_0xa1c9('0x14')]);}})[_0xa1c9('0x16')](function(_0x373f5d){logger['error'](_0xa1c9('0x13'),_0x222624,_0x373f5d);_0x5059df(_0x373f5d);});});}exports[_0xa1c9('0x17')]=function(_0x224ae4){var _0x50db9b=this;return new Promise(function(_0x2fb81e,_0x5ab911){return db[_0xa1c9('0x18')][_0xa1c9('0x19')]({'raw':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4['options'][_0xa1c9('0x1b')]===undefined?!![]:![]:!![],'where':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4[_0xa1c9('0x1a')]['where']||null:null,'attributes':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4[_0xa1c9('0x1a')]['attributes']||null:null,'limit':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4[_0xa1c9('0x1a')][_0xa1c9('0x1c')]||null:null,'include':_0x224ae4['options']?_0x224ae4[_0xa1c9('0x1a')][_0xa1c9('0x1d')]?_[_0xa1c9('0x1e')](_0x224ae4[_0xa1c9('0x1a')][_0xa1c9('0x1d')],function(_0x4a0a0c){return{'model':db[_0x4a0a0c['model']],'as':_0x4a0a0c['as'],'attributes':_0x4a0a0c[_0xa1c9('0x1f')],'include':_0x4a0a0c['include']?_[_0xa1c9('0x1e')](_0x4a0a0c[_0xa1c9('0x1d')],function(_0x1c6f37){return{'model':db[_0x1c6f37[_0xa1c9('0x20')]],'as':_0x1c6f37['as'],'attributes':_0x1c6f37[_0xa1c9('0x1f')],'include':_0x1c6f37['include']?_[_0xa1c9('0x1e')](_0x1c6f37[_0xa1c9('0x1d')],function(_0x20cbe1){return{'model':db[_0x20cbe1['model']],'as':_0x20cbe1['as'],'attributes':_0x20cbe1[_0xa1c9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa1c9('0xb')](function(_0x1ca443){logger['info'](_0xa1c9('0x17'),_0x224ae4);logger[_0xa1c9('0xe')]('GetTrigger',_0x224ae4,JSON[_0xa1c9('0x10')](_0x1ca443));_0x2fb81e(_0x1ca443);})['catch'](function(_0xdf6d0c){logger[_0xa1c9('0x11')](_0xa1c9('0x17'),_0xdf6d0c[_0xa1c9('0x14')],_0x224ae4);_0x5ab911(_0x50db9b[_0xa1c9('0x11')](0x1f4,_0xdf6d0c[_0xa1c9('0x14')]));});});};exports[_0xa1c9('0x21')]=function(_0x58b900){var _0x5648b8=this;return new Promise(function(_0x4d23cd,_0x1c7038){return db[_0xa1c9('0x18')][_0xa1c9('0x22')]({'raw':_0x58b900[_0xa1c9('0x1a')]?_0x58b900[_0xa1c9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x58b900['options']?_0x58b900['options'][_0xa1c9('0x23')]||null:null,'attributes':_0x58b900[_0xa1c9('0x1a')]?_0x58b900[_0xa1c9('0x1a')][_0xa1c9('0x1f')]||null:null,'include':_0x58b900[_0xa1c9('0x1a')]?_0x58b900[_0xa1c9('0x1a')][_0xa1c9('0x1d')]?_['map'](_0x58b900[_0xa1c9('0x1a')]['include'],function(_0x1b8707){return{'model':db[_0x1b8707['model']],'as':_0x1b8707['as'],'attributes':_0x1b8707[_0xa1c9('0x1f')],'include':_0x1b8707[_0xa1c9('0x1d')]?_[_0xa1c9('0x1e')](_0x1b8707['include'],function(_0x39818f){return{'model':db[_0x39818f[_0xa1c9('0x20')]],'as':_0x39818f['as'],'attributes':_0x39818f[_0xa1c9('0x1f')],'include':_0x39818f[_0xa1c9('0x1d')]?_['map'](_0x39818f['include'],function(_0x1f1612){return{'model':db[_0x1f1612[_0xa1c9('0x20')]],'as':_0x1f1612['as'],'attributes':_0x1f1612[_0xa1c9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa1c9('0xb')](function(_0x1c0cce){logger[_0xa1c9('0xc')](_0xa1c9('0x21'),_0x58b900);logger[_0xa1c9('0xe')](_0xa1c9('0x21'),_0x58b900,JSON[_0xa1c9('0x10')](_0x1c0cce));_0x4d23cd(_0x1c0cce);})['catch'](function(_0x3e6ec0){logger[_0xa1c9('0x11')](_0xa1c9('0x21'),_0x3e6ec0[_0xa1c9('0x14')],_0x58b900);_0x1c7038(_0x5648b8[_0xa1c9('0x11')](0x1f4,_0x3e6ec0[_0xa1c9('0x14')]));});});}; \ No newline at end of file +var _0x4024=['attributes','include','map','model','then','debug','ShowTrigger','find','where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','info','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','options'];(function(_0x56fb0a,_0x7317f){var _0x2e846f=function(_0x36fbb3){while(--_0x36fbb3){_0x56fb0a['push'](_0x56fb0a['shift']());}};_0x2e846f(++_0x7317f);}(_0x4024,0x89));var _0x4402=function(_0x1d0921,_0xf28fb){_0x1d0921=_0x1d0921-0x0;var _0x530473=_0x4024[_0x1d0921];return _0x530473;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x168acd,_0x4ed77d,_0x3045ae){return new BPromise(function(_0x5d7ca4,_0x5c0b70){return client[_0x4402('0x9')](_0x168acd,_0x3045ae)['then'](function(_0x4d2882){logger[_0x4402('0xa')]('Trigger,\x20%s,\x20%s',_0x4ed77d,_0x4402('0xb'));logger['debug'](_0x4402('0xc'),_0x4ed77d,'request\x20sent',JSON[_0x4402('0xd')](_0x4d2882));if(_0x4d2882[_0x4402('0xe')]){if(_0x4d2882['error'][_0x4402('0xf')]===0x1f4){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882['error'][_0x4402('0x11')]);return _0x5c0b70(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);return _0x5d7ca4(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}else{logger[_0x4402('0xa')](_0x4402('0x10'),_0x4ed77d,_0x4402('0xb'));_0x5d7ca4(_0x4d2882[_0x4402('0x12')][_0x4402('0x11')]);}})[_0x4402('0x13')](function(_0x30c390){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x30c390);_0x5c0b70(_0x30c390);});});}exports[_0x4402('0x14')]=function(_0x231382){var _0x5b127f=this;return new Promise(function(_0x494389,_0x663ab7){return db[_0x4402('0x15')]['findAll']({'raw':_0x231382[_0x4402('0x16')]?_0x231382[_0x4402('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x231382[_0x4402('0x16')]?_0x231382['options']['where']||null:null,'attributes':_0x231382[_0x4402('0x16')]?_0x231382[_0x4402('0x16')][_0x4402('0x17')]||null:null,'limit':_0x231382['options']?_0x231382[_0x4402('0x16')]['limit']||null:null,'include':_0x231382['options']?_0x231382[_0x4402('0x16')][_0x4402('0x18')]?_[_0x4402('0x19')](_0x231382[_0x4402('0x16')][_0x4402('0x18')],function(_0x2e6fee){return{'model':db[_0x2e6fee[_0x4402('0x1a')]],'as':_0x2e6fee['as'],'attributes':_0x2e6fee[_0x4402('0x17')],'include':_0x2e6fee[_0x4402('0x18')]?_['map'](_0x2e6fee[_0x4402('0x18')],function(_0x4e1c04){return{'model':db[_0x4e1c04[_0x4402('0x1a')]],'as':_0x4e1c04['as'],'attributes':_0x4e1c04[_0x4402('0x17')],'include':_0x4e1c04[_0x4402('0x18')]?_[_0x4402('0x19')](_0x4e1c04['include'],function(_0x15c19f){return{'model':db[_0x15c19f['model']],'as':_0x15c19f['as'],'attributes':_0x15c19f['attributes']};}):[]};}):[]};}):[]:[]})[_0x4402('0x1b')](function(_0x395e49){logger[_0x4402('0xa')](_0x4402('0x14'),_0x231382);logger[_0x4402('0x1c')]('GetTrigger',_0x231382,JSON[_0x4402('0xd')](_0x395e49));_0x494389(_0x395e49);})['catch'](function(_0x71da2f){logger[_0x4402('0xe')](_0x4402('0x14'),_0x71da2f['message'],_0x231382);_0x663ab7(_0x5b127f[_0x4402('0xe')](0x1f4,_0x71da2f[_0x4402('0x11')]));});});};exports[_0x4402('0x1d')]=function(_0x3f4bcb){var _0x2526d1=this;return new Promise(function(_0x605702,_0x1189b8){return db[_0x4402('0x15')][_0x4402('0x1e')]({'raw':_0x3f4bcb[_0x4402('0x16')]?_0x3f4bcb[_0x4402('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3f4bcb[_0x4402('0x16')]?_0x3f4bcb['options'][_0x4402('0x1f')]||null:null,'attributes':_0x3f4bcb['options']?_0x3f4bcb[_0x4402('0x16')][_0x4402('0x17')]||null:null,'include':_0x3f4bcb[_0x4402('0x16')]?_0x3f4bcb[_0x4402('0x16')][_0x4402('0x18')]?_['map'](_0x3f4bcb[_0x4402('0x16')][_0x4402('0x18')],function(_0x169340){return{'model':db[_0x169340['model']],'as':_0x169340['as'],'attributes':_0x169340[_0x4402('0x17')],'include':_0x169340[_0x4402('0x18')]?_['map'](_0x169340[_0x4402('0x18')],function(_0x437e83){return{'model':db[_0x437e83[_0x4402('0x1a')]],'as':_0x437e83['as'],'attributes':_0x437e83[_0x4402('0x17')],'include':_0x437e83[_0x4402('0x18')]?_[_0x4402('0x19')](_0x437e83[_0x4402('0x18')],function(_0x6e9fb7){return{'model':db[_0x6e9fb7[_0x4402('0x1a')]],'as':_0x6e9fb7['as'],'attributes':_0x6e9fb7['attributes']};}):[]};}):[]};}):[]:[]})[_0x4402('0x1b')](function(_0x28fee8){logger[_0x4402('0xa')]('ShowTrigger',_0x3f4bcb);logger[_0x4402('0x1c')](_0x4402('0x1d'),_0x3f4bcb,JSON['stringify'](_0x28fee8));_0x605702(_0x28fee8);})['catch'](function(_0x2b9d51){logger[_0x4402('0xe')](_0x4402('0x1d'),_0x2b9d51[_0x4402('0x11')],_0x3f4bcb);_0x1189b8(_0x2526d1['error'](0x1f4,_0x2b9d51['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 98fe767..603c218 100644 --- a/server/api/trunk/index.js +++ b/server/api/trunk/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb821=['../../config/environment','./trunk.controller','get','isAuthenticated','/:id','show','post','/:id/clone','clone','create','put','update','delete','exports','util','path','Router'];(function(_0x1e715a,_0x47db84){var _0x262f09=function(_0x392a5b){while(--_0x392a5b){_0x1e715a['push'](_0x1e715a['shift']());}};_0x262f09(++_0x47db84);}(_0xb821,0xa7));var _0x1b82=function(_0x4d96b7,_0x5daf2b){_0x4d96b7=_0x4d96b7-0x0;var _0x1c8bdc=_0xb821[_0x4d96b7];return _0x1c8bdc;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b82('0x3'));var controller=require(_0x1b82('0x4'));router[_0x1b82('0x5')]('/',auth[_0x1b82('0x6')](),controller['index']);router[_0x1b82('0x5')](_0x1b82('0x7'),auth[_0x1b82('0x6')](),controller[_0x1b82('0x8')]);router[_0x1b82('0x9')](_0x1b82('0xa'),auth[_0x1b82('0x6')](),controller[_0x1b82('0xb')]);router[_0x1b82('0x9')]('/',auth['isAuthenticated'](),controller[_0x1b82('0xc')]);router[_0x1b82('0xd')](_0x1b82('0x7'),auth[_0x1b82('0x6')](),controller[_0x1b82('0xe')]);router[_0x1b82('0xf')](_0x1b82('0x7'),auth[_0x1b82('0x6')](),controller['destroy']);module[_0x1b82('0x10')]=router; \ No newline at end of file +var _0x7217=['./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2d387d,_0x120826){var _0x181f11=function(_0x5981dd){while(--_0x5981dd){_0x2d387d['push'](_0x2d387d['shift']());}};_0x181f11(++_0x120826);}(_0x7217,0x19e));var _0x7721=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x7217[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0xc')](_0x7721('0xd'),auth[_0x7721('0x8')](),controller[_0x7721('0xe')]);router[_0x7721('0xc')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0xf')]);router['put'](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x10')]);router[_0x7721('0x11')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x12')]);module[_0x7721('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index e38a608..b25bae0 100644 --- a/server/api/trunk/trunk.attributes.js +++ b/server/api/trunk/trunk.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35f0=['BOOLEAN','exports','STRING','name','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','nonat','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','accept','refuse','originate','INTEGER','uac','uas','pai','fingerprint','certificate','active','passive','dynamic'];(function(_0x257da6,_0x51e7fd){var _0x485816=function(_0x4bd3d5){while(--_0x4bd3d5){_0x257da6['push'](_0x257da6['shift']());}};_0x485816(++_0x51e7fd);}(_0x35f0,0x67));var _0x035f=function(_0x320df1,_0x8503c6){_0x320df1=_0x320df1-0x0;var _0x1daeb7=_0x35f0[_0x320df1];return _0x1daeb7;};'use strict';var Sequelize=require('sequelize');module[_0x035f('0x0')]={'name':{'type':Sequelize[_0x035f('0x1')],'allowNull':![],'unique':_0x035f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x4'),'user',_0x035f('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x035f('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x6'),_0x035f('0x7'),_0x035f('0x8'),_0x035f('0x9'),'PROHIB_NOT_SCREENED',_0x035f('0xa'),_0x035f('0xb'),_0x035f('0xc'))},'deny':{'type':Sequelize[_0x035f('0x1')]},'permit':{'type':Sequelize[_0x035f('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x035f('0xd'),'set':function(_0x4657f9){this[_0x035f('0xe')](_0x035f('0xf'),_0x4657f9?_0x4657f9[_0x035f('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x035f('0xf'))?this[_0x035f('0x11')]('transport')[_0x035f('0x12')](','):null;},'comment':_0x035f('0x13')},'dtmfmode':{'type':Sequelize[_0x035f('0x3')]('rfc2833',_0x035f('0x14'),_0x035f('0x15'),_0x035f('0x16'),_0x035f('0x17')),'defaultValue':_0x035f('0x18')},'directmedia':{'type':Sequelize[_0x035f('0x3')]('yes','no',_0x035f('0x19'),'update',_0x035f('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x035f('0x1')]},'nat':{'type':Sequelize[_0x035f('0x1')],'defaultValue':_0x035f('0x1c'),'set':function(_0x6fbed7){this[_0x035f('0xe')]('nat',_0x6fbed7?_0x6fbed7[_0x035f('0x10')](','):null);},'get':function(){return this[_0x035f('0x11')](_0x035f('0x1d'))?this[_0x035f('0x11')](_0x035f('0x1d'))[_0x035f('0x12')](','):null;},'comment':_0x035f('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x035f('0x1')]},'pickupgroup':{'type':Sequelize[_0x035f('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x035f('0x1')]},'language':{'type':Sequelize[_0x035f('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x035f('0x1f')},'allow':{'type':Sequelize[_0x035f('0x1')],'allowNull':![],'defaultValue':_0x035f('0x20'),'set':function(_0x47a77a){this[_0x035f('0xe')](_0x035f('0x21'),_0x47a77a?_0x47a77a[_0x035f('0x10')](';'):_0x035f('0x20'));},'get':function(){return this[_0x035f('0x11')]('allow')?this[_0x035f('0x11')](_0x035f('0x21'))[_0x035f('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x035f('0x22'),'set':function(_0x15ebec){this[_0x035f('0xe')](_0x035f('0x23'),_0x15ebec?_0x15ebec['join'](','):null);},'get':function(){return this[_0x035f('0x11')](_0x035f('0x23'))?this[_0x035f('0x11')](_0x035f('0x23'))[_0x035f('0x12')](','):null;},'comment':_0x035f('0x24')},'trustrpid':{'type':Sequelize['ENUM'](_0x035f('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x035f('0x1b'),'no',_0x035f('0x25'))},'promiscredir':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x035f('0x1')]},'callerid':{'type':Sequelize[_0x035f('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0x035f('0x1b'),'no'),'defaultValue':_0x035f('0x1b')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x035f('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no')},'allowtransfer':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x035f('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0x035f('0x1b'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no')},'mailbox':{'type':Sequelize[_0x035f('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x035f('0x26'),_0x035f('0x27'),_0x035f('0x28'))},'session_expires':{'type':Sequelize[_0x035f('0x29')](0xb)},'session_minse':{'type':Sequelize[_0x035f('0x29')](0xb)},'session_refresher':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x2a'),_0x035f('0x2b')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x035f('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x035f('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x035f('0x29')](0x5)},'qualify':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no'),'defaultValue':_0x035f('0x1b')},'keepalive':{'type':Sequelize[_0x035f('0x29')](0xb)},'defaultip':{'type':Sequelize[_0x035f('0x1')]},'defaultuser':{'type':Sequelize[_0x035f('0x1')]},'rtptimeout':{'type':Sequelize[_0x035f('0x29')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x035f('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x035f('0x29')](0xb)},'sendrpid':{'type':Sequelize[_0x035f('0x3')]('yes','no',_0x035f('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x035f('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x035f('0x29')](0xb)},'timerb':{'type':Sequelize[_0x035f('0x29')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x035f('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x035f('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x035f('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x035f('0x29')](0xb)},'encryption':{'type':Sequelize[_0x035f('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0x035f('0x1b'),'no')},'icesupport':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no')},'dtlsverify':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no',_0x035f('0x2d'),_0x035f('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x035f('0x29')](0xb)},'dtlscertfile':{'type':Sequelize[_0x035f('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x035f('0x1')]},'dtlscafile':{'type':Sequelize[_0x035f('0x1')]},'dtlscapath':{'type':Sequelize[_0x035f('0x1')]},'dtlssetup':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x2f'),_0x035f('0x30'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x035f('0x1')]},'usereqphone':{'type':Sequelize['ENUM'](_0x035f('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x035f('0x1')]},'recordofffeature':{'type':Sequelize[_0x035f('0x1')]},'call_limit':{'type':Sequelize[_0x035f('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x035f('0x1b'),'no')},'vmexten':{'type':Sequelize[_0x035f('0x1')]},'mohinterpret':{'type':Sequelize[_0x035f('0x1')]},'mohsuggest':{'type':Sequelize[_0x035f('0x1')]},'parkinglot':{'type':Sequelize[_0x035f('0x1')]},'description':{'type':Sequelize[_0x035f('0x1')]},'host':{'type':Sequelize[_0x035f('0x1')],'defaultValue':_0x035f('0x31')},'canreinvite':{'type':Sequelize[_0x035f('0x3')](_0x035f('0x1b'),'no','nonat','update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x035f('0x1')]},'active':{'type':Sequelize[_0x035f('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x8ede=['transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','yes','port,invite','insecure','never','\x22\x22\x20<>','INTEGER','always','accept','originate','uac','uas','pai','fingerprint','certificate','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','friend','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','udp','setDataValue','join','getDataValue'];(function(_0x38287b,_0x5dad9a){var _0x20a3e2=function(_0x3c3d70){while(--_0x3c3d70){_0x38287b['push'](_0x38287b['shift']());}};_0x20a3e2(++_0x5dad9a);}(_0x8ede,0x160));var _0xe8ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ede[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe8ed('0x0'));module[_0xe8ed('0x1')]={'name':{'type':Sequelize[_0xe8ed('0x2')],'allowNull':![],'unique':_0xe8ed('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xe8ed('0x4'),_0xe8ed('0x5'),_0xe8ed('0x6')),'allowNull':![],'defaultValue':_0xe8ed('0x4')},'context':{'type':Sequelize[_0xe8ed('0x2')],'allowNull':![],'defaultValue':_0xe8ed('0x7')},'callingpres':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x9'),_0xe8ed('0xa'),_0xe8ed('0xb'),_0xe8ed('0xc'),_0xe8ed('0xd'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0xe8ed('0xe'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xe8ed('0x2')]},'secret':{'type':Sequelize[_0xe8ed('0x2')]},'md5secret':{'type':Sequelize[_0xe8ed('0x2')]},'remotesecret':{'type':Sequelize[_0xe8ed('0x2')]},'transport':{'type':Sequelize[_0xe8ed('0x2')],'defaultValue':_0xe8ed('0xf'),'set':function(_0x15ecc5){this[_0xe8ed('0x10')]('transport',_0x15ecc5?_0x15ecc5[_0xe8ed('0x11')](','):null);},'get':function(){return this[_0xe8ed('0x12')](_0xe8ed('0x13'))?this[_0xe8ed('0x12')]('transport')[_0xe8ed('0x14')](','):null;},'comment':_0xe8ed('0x15')},'dtmfmode':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x16'),_0xe8ed('0x17'),_0xe8ed('0x18'),_0xe8ed('0x19'),_0xe8ed('0x1a')),'defaultValue':_0xe8ed('0x16')},'directmedia':{'type':Sequelize[_0xe8ed('0x8')]('yes','no',_0xe8ed('0x1b'),_0xe8ed('0x1c'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe8ed('0x8')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe8ed('0x2')]},'directmediadeny':{'type':Sequelize[_0xe8ed('0x2')]},'nat':{'type':Sequelize[_0xe8ed('0x2')],'defaultValue':_0xe8ed('0x1d'),'set':function(_0x37ff97){this[_0xe8ed('0x10')](_0xe8ed('0x1e'),_0x37ff97?_0x37ff97[_0xe8ed('0x11')](','):null);},'get':function(){return this[_0xe8ed('0x12')]('nat')?this[_0xe8ed('0x12')](_0xe8ed('0x1e'))[_0xe8ed('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xe8ed('0x2')]},'namedcallgroup':{'type':Sequelize[_0xe8ed('0x2')]},'pickupgroup':{'type':Sequelize[_0xe8ed('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xe8ed('0x2')]},'language':{'type':Sequelize[_0xe8ed('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe8ed('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xe8ed('0x2')],'defaultValue':_0xe8ed('0x1f')},'allow':{'type':Sequelize[_0xe8ed('0x2')],'allowNull':![],'defaultValue':_0xe8ed('0x20'),'set':function(_0x446364){this[_0xe8ed('0x10')](_0xe8ed('0x21'),_0x446364?_0x446364[_0xe8ed('0x11')](';'):_0xe8ed('0x20'));},'get':function(){return this[_0xe8ed('0x12')](_0xe8ed('0x21'))?this['getDataValue']('allow')[_0xe8ed('0x14')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x22'),'no')},'insecure':{'type':Sequelize[_0xe8ed('0x2')],'defaultValue':_0xe8ed('0x23'),'set':function(_0x13bb1d){this['setDataValue']('insecure',_0x13bb1d?_0x13bb1d['join'](','):null);},'get':function(){return this[_0xe8ed('0x12')]('insecure')?this['getDataValue'](_0xe8ed('0x24'))[_0xe8ed('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x22'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe8ed('0x8')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x22'),'no',_0xe8ed('0x25'))},'promiscredir':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x22'),'no')},'useclientcode':{'type':Sequelize[_0xe8ed('0x8')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xe8ed('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xe8ed('0x26')},'amaflags':{'type':Sequelize[_0xe8ed('0x2')]},'callcounter':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x22'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xe8ed('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0xe8ed('0x8')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xe8ed('0x8')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xe8ed('0x8')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xe8ed('0x2')]},'template':{'type':Sequelize[_0xe8ed('0x2')]},'videosupport':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x22'),'no',_0xe8ed('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe8ed('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x22'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x29'),'refuse',_0xe8ed('0x2a'))},'session_expires':{'type':Sequelize[_0xe8ed('0x27')](0xb)},'session_minse':{'type':Sequelize[_0xe8ed('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x2b'),'uas'),'defaultValue':_0xe8ed('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xe8ed('0x2')]},'regexten':{'type':Sequelize[_0xe8ed('0x2')]},'fromdomain':{'type':Sequelize[_0xe8ed('0x2')]},'fromuser':{'type':Sequelize[_0xe8ed('0x2')]},'port':{'type':Sequelize[_0xe8ed('0x27')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xe8ed('0x22'),'no'),'defaultValue':_0xe8ed('0x22')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xe8ed('0x2')]},'rtptimeout':{'type':Sequelize[_0xe8ed('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xe8ed('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xe8ed('0x8')]('yes','no',_0xe8ed('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe8ed('0x2')]},'callbackextension':{'type':Sequelize[_0xe8ed('0x2')]},'timert1':{'type':Sequelize[_0xe8ed('0x27')](0xb)},'timerb':{'type':Sequelize[_0xe8ed('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0xe8ed('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0xe8ed('0x2')]},'contactdeny':{'type':Sequelize[_0xe8ed('0x2')]},'contactacl':{'type':Sequelize[_0xe8ed('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xe8ed('0x2')]},'maxforwards':{'type':Sequelize[_0xe8ed('0x27')](0xb)},'encryption':{'type':Sequelize[_0xe8ed('0x8')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x22'),'no')},'force_avp':{'type':Sequelize[_0xe8ed('0x8')]('yes','no')},'icesupport':{'type':Sequelize[_0xe8ed('0x8')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xe8ed('0x8')]('yes','no')},'dtlsverify':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x22'),'no',_0xe8ed('0x2e'),_0xe8ed('0x2f'))},'dtlsrekey':{'type':Sequelize[_0xe8ed('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0xe8ed('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xe8ed('0x2')]},'dtlscipher':{'type':Sequelize[_0xe8ed('0x2')]},'dtlscafile':{'type':Sequelize[_0xe8ed('0x2')]},'dtlscapath':{'type':Sequelize[_0xe8ed('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xe8ed('0x30'),'passive',_0xe8ed('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe8ed('0x2')]},'usereqphone':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x22'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe8ed('0x2')]},'recordofffeature':{'type':Sequelize[_0xe8ed('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x22'),'no')},'subscribemwi':{'type':Sequelize[_0xe8ed('0x8')](_0xe8ed('0x22'),'no')},'vmexten':{'type':Sequelize[_0xe8ed('0x2')]},'mohinterpret':{'type':Sequelize[_0xe8ed('0x2')]},'mohsuggest':{'type':Sequelize[_0xe8ed('0x2')]},'parkinglot':{'type':Sequelize[_0xe8ed('0x2')]},'description':{'type':Sequelize[_0xe8ed('0x2')]},'host':{'type':Sequelize[_0xe8ed('0x2')],'defaultValue':_0xe8ed('0x32')},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0xe8ed('0x1b'),_0xe8ed('0x1c'),_0xe8ed('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xe8ed('0x2')]},'otherFields':{'type':Sequelize[_0xe8ed('0x2')]},'active':{'type':Sequelize[_0xe8ed('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index f91cceb..6b145b6 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda64=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','apply','reject','save','destroy','get','Trunks','UserProfileResource','name','send','index','Trunk','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','map','key','VIRTUAL','filter','count','includeAll','include','findAll','rows','show','params','options','find','clone','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','chan_sip.so','userProfileId','update','/etc/asterisk/sip_xcally_registers.conf','Reload','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x52f98f,_0x2b96ec){var _0x2205eb=function(_0x15794c){while(--_0x15794c){_0x52f98f['push'](_0x52f98f['shift']());}};_0x2205eb(++_0x2b96ec);}(_0xda64,0xc8));var _0x4da6=function(_0x1b56ac,_0x32127f){_0x1b56ac=_0x1b56ac-0x0;var _0x4eea86=_0xda64[_0x1b56ac];return _0x4eea86;};'use strict';var pdf=require(_0x4da6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4da6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4da6('0x2'));var rp=require(_0x4da6('0x3'));var moment=require(_0x4da6('0x4'));var BPromise=require(_0x4da6('0x5'));var Mustache=require(_0x4da6('0x6'));var util=require(_0x4da6('0x7'));var path=require('path');var sox=require(_0x4da6('0x8'));var csv=require('to-csv');var ejs=require(_0x4da6('0x9'));var fs=require('fs');var _=require(_0x4da6('0xa'));var squel=require(_0x4da6('0xb'));var crypto=require(_0x4da6('0xc'));var jsforce=require(_0x4da6('0xd'));var deskjs=require(_0x4da6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4da6('0xf'));var Papa=require('papaparse');var Redis=require(_0x4da6('0x10'));var authService=require(_0x4da6('0x11'));var qs=require(_0x4da6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4da6('0x13'))(_0x4da6('0x14'));var utils=require(_0x4da6('0x15'));var config=require(_0x4da6('0x16'));var db=require(_0x4da6('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x4da6('0x18')][_0x4da6('0x19')]({'port':0x232a});function checkPasswordPattern(_0x49c9cc,_0x4ae262,_0x215752){if(_0x215752){var _0x346730=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x346730[_0x4da6('0x1a')](_0x4ae262)){return _0x49c9cc;}else{throw new Error(_0x4da6('0x1b'));}}else{return _0x49c9cc;}}function respondWithRpcPromise(_0x4f7972,_0x34159e,_0x1418ee,_0x507e8d){return new BPromise(function(_0x5b05a3,_0x303d5d){var _0x581161=_0x507e8d||client;return _0x581161['request'](_0x4f7972,_0x1418ee)[_0x4da6('0x1c')](function(_0x375188){logger[_0x4da6('0x1d')](_0x4da6('0x1e'),_0x34159e,_0x4da6('0x1f'));logger['debug'](_0x4da6('0x20'),_0x34159e,_0x4da6('0x1f'),JSON[_0x4da6('0x21')](_0x375188));if(_0x375188[_0x4da6('0x22')]){if(_0x375188['error'][_0x4da6('0x23')]===0x1f4){logger[_0x4da6('0x22')]('Trunk,\x20%s,\x20%s',_0x34159e,_0x375188[_0x4da6('0x22')][_0x4da6('0x24')]);return _0x303d5d(_0x375188['error'][_0x4da6('0x24')]);}logger[_0x4da6('0x22')](_0x4da6('0x1e'),_0x34159e,_0x375188[_0x4da6('0x22')]['message']);return _0x5b05a3(_0x375188[_0x4da6('0x22')][_0x4da6('0x24')]);}else{logger[_0x4da6('0x1d')](_0x4da6('0x1e'),_0x34159e,_0x4da6('0x1f'));_0x5b05a3(_0x375188[_0x4da6('0x25')][_0x4da6('0x24')]);}})[_0x4da6('0x26')](function(_0x1d928d){logger['error'](_0x4da6('0x1e'),_0x34159e,_0x1d928d);_0x303d5d(_0x1d928d);});});}function respondWithStatusCode(_0x1729b6,_0x4c01cf){_0x4c01cf=_0x4c01cf||0xcc;return function(_0x4f4501){if(_0x4f4501){return _0x1729b6[_0x4da6('0x27')](_0x4c01cf);}return _0x1729b6[_0x4da6('0x28')](_0x4c01cf)[_0x4da6('0x29')]();};}function respondWithResult(_0x2fe486,_0x59fe4f){_0x59fe4f=_0x59fe4f||0xc8;return function(_0x34764f){if(_0x34764f){return _0x2fe486[_0x4da6('0x28')](_0x59fe4f)[_0x4da6('0x2a')](_0x34764f);}};}function respondWithFilteredResult(_0x24f884,_0x2afadf){return function(_0x20d87a){if(_0x20d87a){var _0x50897c=_0x20d87a['count'],_0x210482=_0x2afadf[_0x4da6('0x2b')],_0x126afd=_0x2afadf[_0x4da6('0x2b')]+_0x2afadf[_0x4da6('0x2c')],_0x7f6cc3;if(_0x126afd>=_0x50897c){_0x126afd=_0x50897c;_0x7f6cc3=0xc8;}else{_0x7f6cc3=0xce;}_0x24f884['status'](_0x7f6cc3);return _0x24f884['set']('Content-Range',_0x210482+'-'+_0x126afd+'/'+_0x50897c)[_0x4da6('0x2a')](_0x20d87a);}return null;};}function patchUpdates(_0x12047d){return function(_0x5c29c3){try{jsonpatch[_0x4da6('0x2d')](_0x5c29c3,_0x12047d,!![]);}catch(_0x129c65){return BPromise[_0x4da6('0x2e')](_0x129c65);}return _0x5c29c3[_0x4da6('0x2f')]();};}function saveUpdates(_0x2a06f2,_0x5e36c9){return function(_0x5d789d){if(_0x5d789d){return _0x5d789d['update'](_0x2a06f2)[_0x4da6('0x1c')](function(_0x363aaf){return _0x363aaf;});}return null;};}function removeEntity(_0x4c4da2,_0x2dab91){return function(_0x43eea2){if(_0x43eea2){return _0x43eea2[_0x4da6('0x30')]()[_0x4da6('0x1c')](function(){var _0x5ee65=_0x43eea2[_0x4da6('0x31')]({'plain':!![]});var _0x94fa0d=_0x4da6('0x32');return db[_0x4da6('0x33')][_0x4da6('0x30')]({'where':{'type':_0x94fa0d,'resourceId':_0x5ee65['id']}})['then'](function(){return _0x43eea2;});})[_0x4da6('0x1c')](function(){_0x4c4da2['status'](0xcc)[_0x4da6('0x29')]();});}};}function handleEntityNotFound(_0x3bd68b,_0xcddbe6){return function(_0x1fec04){if(!_0x1fec04){_0x3bd68b[_0x4da6('0x27')](0x194);}return _0x1fec04;};}function handleError(_0x5a4bf6,_0x24fd29){_0x24fd29=_0x24fd29||0x1f4;return function(_0x53cae3){logger[_0x4da6('0x22')](_0x53cae3['stack']);if(_0x53cae3[_0x4da6('0x34')]){delete _0x53cae3['name'];}_0x5a4bf6[_0x4da6('0x28')](_0x24fd29)[_0x4da6('0x35')](_0x53cae3);};}exports[_0x4da6('0x36')]=function(_0x22d46e,_0x22b4b3){var _0x483851={},_0x1023b7={},_0x231a66={'count':0x0,'rows':[]};var _0x4d2103=db[_0x4da6('0x37')][_0x4da6('0x38')];_0x1023b7[_0x4da6('0x39')]=_['keys'](_0x4d2103);_0x1023b7[_0x4da6('0x3a')]=_[_0x4da6('0x3b')](_0x22d46e['query']);_0x1023b7[_0x4da6('0x3c')]=_['intersection'](_0x1023b7[_0x4da6('0x39')],_0x1023b7[_0x4da6('0x3a')]);_0x483851[_0x4da6('0x3d')]=_[_0x4da6('0x3e')](_0x1023b7[_0x4da6('0x39')],qs[_0x4da6('0x3f')](_0x22d46e[_0x4da6('0x3a')][_0x4da6('0x3f')]));_0x483851[_0x4da6('0x3d')]=_0x483851[_0x4da6('0x3d')][_0x4da6('0x40')]?_0x483851['attributes']:_0x1023b7[_0x4da6('0x39')];if(!_0x22d46e[_0x4da6('0x3a')]['hasOwnProperty'](_0x4da6('0x41'))){_0x483851[_0x4da6('0x2c')]=qs[_0x4da6('0x2c')](_0x22d46e[_0x4da6('0x3a')]['limit']);_0x483851['offset']=qs['offset'](_0x22d46e[_0x4da6('0x3a')][_0x4da6('0x2b')]);}_0x483851[_0x4da6('0x42')]=qs['sort'](_0x22d46e[_0x4da6('0x3a')][_0x4da6('0x43')]);_0x483851[_0x4da6('0x44')]=qs[_0x4da6('0x3c')](_[_0x4da6('0x45')](_0x22d46e[_0x4da6('0x3a')],_0x1023b7[_0x4da6('0x3c')]));if(_0x22d46e['query']['filter']){_0x483851[_0x4da6('0x44')]=_[_0x4da6('0x46')](_0x483851[_0x4da6('0x44')],{'$or':_[_0x4da6('0x47')](_0x4d2103,function(_0x32430c){if(_0x32430c['type'][_0x4da6('0x48')]!==_0x4da6('0x49')){var _0x4e97ff={};_0x4e97ff[_0x32430c['field']]={'$like':'%'+_0x22d46e['query'][_0x4da6('0x4a')]+'%'};return _0x4e97ff;}})});}_0x483851=_['merge']({},_0x483851,_0x22d46e['options']);var _0x1ca74f={'where':_0x483851['where']};return db[_0x4da6('0x37')][_0x4da6('0x4b')](_0x1ca74f)[_0x4da6('0x1c')](function(_0x197c85){_0x231a66[_0x4da6('0x4b')]=_0x197c85;if(_0x22d46e[_0x4da6('0x3a')][_0x4da6('0x4c')]){_0x483851[_0x4da6('0x4d')]=[{'all':!![]}];}return db['Trunk'][_0x4da6('0x4e')](_0x483851);})['then'](function(_0x73a4d){_0x231a66[_0x4da6('0x4f')]=_0x73a4d;return _0x231a66;})[_0x4da6('0x1c')](respondWithFilteredResult(_0x22b4b3,_0x483851))[_0x4da6('0x26')](handleError(_0x22b4b3,null));};exports[_0x4da6('0x50')]=function(_0x55a696,_0xec48b){var _0x512b30={'raw':![],'where':{'id':_0x55a696[_0x4da6('0x51')]['id']}},_0xae6a2c={};_0xae6a2c[_0x4da6('0x39')]=_[_0x4da6('0x3b')](db[_0x4da6('0x37')]['rawAttributes']);_0xae6a2c['query']=_[_0x4da6('0x3b')](_0x55a696[_0x4da6('0x3a')]);_0xae6a2c['filters']=_[_0x4da6('0x3e')](_0xae6a2c[_0x4da6('0x39')],_0xae6a2c[_0x4da6('0x3a')]);_0x512b30[_0x4da6('0x3d')]=_['intersection'](_0xae6a2c[_0x4da6('0x39')],qs['fields'](_0x55a696[_0x4da6('0x3a')][_0x4da6('0x3f')]));_0x512b30[_0x4da6('0x3d')]=_0x512b30[_0x4da6('0x3d')][_0x4da6('0x40')]?_0x512b30[_0x4da6('0x3d')]:_0xae6a2c[_0x4da6('0x39')];if(_0x55a696[_0x4da6('0x3a')][_0x4da6('0x4c')]){_0x512b30['include']=[{'all':!![]}];}_0x512b30=_[_0x4da6('0x46')]({},_0x512b30,_0x55a696[_0x4da6('0x52')]);return db[_0x4da6('0x37')][_0x4da6('0x53')](_0x512b30)[_0x4da6('0x1c')](handleEntityNotFound(_0xec48b,null))['then'](respondWithResult(_0xec48b,null))[_0x4da6('0x26')](handleError(_0xec48b,null));};exports[_0x4da6('0x54')]=function(_0x2152e6,_0x2f9ba9){var _0xd801b8={'raw':![],'where':{'id':_0x2152e6['params']['id']}},_0x55682c={};_0x55682c[_0x4da6('0x39')]=_[_0x4da6('0x3b')](db[_0x4da6('0x37')][_0x4da6('0x38')]);_0xd801b8['attributes']=_[_0x4da6('0x3e')](_0x55682c[_0x4da6('0x39')],qs[_0x4da6('0x3f')](_0x2152e6['query']['fields']));_0xd801b8[_0x4da6('0x3d')]=_0xd801b8[_0x4da6('0x3d')]['length']?_0xd801b8[_0x4da6('0x3d')]:_0x55682c['model'];if(_0x2152e6[_0x4da6('0x3a')][_0x4da6('0x4c')]){_0xd801b8[_0x4da6('0x4d')]=[{'all':!![]}];}_0xd801b8=_[_0x4da6('0x46')]({},_0xd801b8,_0x2152e6['options']);return db[_0x4da6('0x37')][_0x4da6('0x53')](_0xd801b8)['then'](handleEntityNotFound(_0x2f9ba9,null))[_0x4da6('0x1c')](function(_0x59653d){if(_0x59653d){var _0x18924f=_0x59653d[_0x4da6('0x31')]({'plain':!![]});_0x18924f=qs[_0x4da6('0x55')](_0x18924f,['id',_0x4da6('0x56'),_0x4da6('0x57')]);_0x2152e6['body']=_[_0x4da6('0x55')](_0x2152e6[_0x4da6('0x58')],['id',_0x4da6('0x56'),'updatedAt']);return db[_0x4da6('0x37')][_0x4da6('0x59')](_[_0x4da6('0x46')](_0x18924f,_0x2152e6[_0x4da6('0x58')]),{'include':_0x2152e6['query'][_0x4da6('0x4c')]?[{'all':!![]}]:undefined})[_0x4da6('0x1c')](function(_0x297b32){var _0x301410=_0x2152e6[_0x4da6('0x5a')][_0x4da6('0x31')]({'plain':!![]});if(!_0x301410)throw new Error(_0x4da6('0x5b'));if(_0x301410['role']==='user'){var _0x5d2d5f=_0x297b32[_0x4da6('0x31')]({'plain':!![]});var _0x367c38='Trunks';return db[_0x4da6('0x5c')][_0x4da6('0x53')]({'where':{'name':_0x367c38,'userProfileId':_0x301410['userProfileId']},'raw':!![]})[_0x4da6('0x1c')](function(_0x39e51c){if(_0x39e51c&&_0x39e51c['autoAssociation']===0x0){return db[_0x4da6('0x33')][_0x4da6('0x59')]({'name':_0x5d2d5f[_0x4da6('0x34')],'resourceId':_0x5d2d5f['id'],'type':_0x39e51c[_0x4da6('0x34')],'sectionId':_0x39e51c['id']},{})[_0x4da6('0x1c')](function(){return _0x297b32;});}else{return _0x297b32;}})[_0x4da6('0x26')](function(_0x39948c){logger['error'](_0x4da6('0x5d'),_0x39948c);throw _0x39948c;});}return _0x297b32;});}})[_0x4da6('0x1c')](respondWithResult(_0x2f9ba9,0xc9))[_0x4da6('0x26')](handleError(_0x2f9ba9,null));};exports['create']=function(_0x334744,_0x4f529e,_0x3587e3){var _0x1b6e1d;return db['Trunk'][_0x4da6('0x59')](_0x334744[_0x4da6('0x58')],{'raw':!![]})[_0x4da6('0x1c')](function(_0x1ee66c){_0x1b6e1d=_0x1ee66c;return db['Trunk']['findAll']({'raw':!![]});})[_0x4da6('0x1c')](function(_0x225018){var _0x8c148d=fs[_0x4da6('0x5e')](path[_0x4da6('0x5f')](config[_0x4da6('0x60')],_0x4da6('0x61')),_0x4da6('0x62'));var _0x3f1b1f=fs[_0x4da6('0x5e')](path[_0x4da6('0x5f')](config['root'],_0x4da6('0x63')),'utf8');var _0x3f5582=ejs[_0x4da6('0x64')](_0x8c148d,{'trunks':_0x225018||[]});fs[_0x4da6('0x65')](_0x4da6('0x66'),_0x3f5582);if(_0x1b6e1d[_0x4da6('0x67')]){var _0x526c4f=ejs['render'](_0x3f1b1f,{'trunks':_0x225018||[]});fs[_0x4da6('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x526c4f);}})['then'](function(){return respondWithRpcPromise('Reload',_0x4da6('0x59'),{'module':_0x4da6('0x68')});})[_0x4da6('0x1c')](function(){var _0x19c672=_0x334744[_0x4da6('0x5a')][_0x4da6('0x31')]({'plain':!![]});if(!_0x19c672)throw new Error(_0x4da6('0x5b'));if(_0x19c672['role']===_0x4da6('0x5a')){var _0x500f22=_0x1b6e1d[_0x4da6('0x31')]({'plain':!![]});return db[_0x4da6('0x5c')][_0x4da6('0x53')]({'where':{'name':_0x4da6('0x32'),'userProfileId':_0x19c672[_0x4da6('0x69')]},'raw':!![]})[_0x4da6('0x1c')](function(_0xe222ee){if(_0xe222ee&&_0xe222ee['autoAssociation']===0x0){return db[_0x4da6('0x33')][_0x4da6('0x59')]({'name':_0x500f22['name'],'resourceId':_0x500f22['id'],'type':_0xe222ee[_0x4da6('0x34')],'sectionId':_0xe222ee['id']},{})[_0x4da6('0x1c')](function(){return _0x1b6e1d;});}else{return _0x1b6e1d;}})[_0x4da6('0x26')](function(_0x429464){logger[_0x4da6('0x22')](_0x4da6('0x5d'),_0x429464);throw _0x429464;});}return _0x1b6e1d;})[_0x4da6('0x1c')](respondWithResult(_0x4f529e,0xc9))['catch'](handleError(_0x4f529e,null));};exports[_0x4da6('0x6a')]=function(_0x12205e,_0x1c86ac,_0x538b2d){var _0x159eb5;return db['Trunk'][_0x4da6('0x53')]({'where':{'id':_0x12205e[_0x4da6('0x51')]['id']}})[_0x4da6('0x1c')](handleEntityNotFound(_0x1c86ac,null))[_0x4da6('0x1c')](saveUpdates(_0x12205e[_0x4da6('0x58')],null))[_0x4da6('0x1c')](function(_0x4ebbbc){if(_0x4ebbbc){_0x159eb5=_0x4ebbbc;return db[_0x4da6('0x37')]['findAll']({'raw':!![]});}})[_0x4da6('0x1c')](function(_0x11a249){if(_0x11a249){var _0x146e12=fs['readFileSync'](path[_0x4da6('0x5f')](config[_0x4da6('0x60')],_0x4da6('0x61')),_0x4da6('0x62'));var _0xed40bd=fs['readFileSync'](path['join'](config[_0x4da6('0x60')],_0x4da6('0x63')),'utf8');var _0x35a695=ejs['render'](_0x146e12,{'trunks':_0x11a249||[]});fs[_0x4da6('0x65')](_0x4da6('0x66'),_0x35a695);var _0x45f208=ejs[_0x4da6('0x64')](_0xed40bd,{'trunks':_0x11a249||[]});fs[_0x4da6('0x65')](_0x4da6('0x6b'),_0x45f208);return respondWithRpcPromise(_0x4da6('0x6c'),_0x4da6('0x6a'),{'module':_0x4da6('0x68')});}return null;})[_0x4da6('0x1c')](function(_0x47ffff){if(_0x47ffff){return _0x159eb5;}})[_0x4da6('0x1c')](respondWithResult(_0x1c86ac,null))[_0x4da6('0x26')](handleError(_0x1c86ac,null));};exports[_0x4da6('0x30')]=function(_0xc61a99,_0x22713f,_0x143812){var _0x170da6;return db[_0x4da6('0x37')][_0x4da6('0x53')]({'where':{'id':_0xc61a99[_0x4da6('0x51')]['id']}})[_0x4da6('0x1c')](handleEntityNotFound(_0x22713f,null))[_0x4da6('0x1c')](removeEntity(_0x22713f,null))[_0x4da6('0x1c')](function(){return db['Trunk'][_0x4da6('0x4e')]({'raw':!![]});})['then'](function(_0x4dda20){var _0x51ef4b=fs[_0x4da6('0x5e')](path[_0x4da6('0x5f')](config[_0x4da6('0x60')],_0x4da6('0x61')),_0x4da6('0x62'));var _0x4218bc=fs[_0x4da6('0x5e')](path['join'](config[_0x4da6('0x60')],'server/files/templates/registry.ejs'),_0x4da6('0x62'));var _0x48cd81=ejs['render'](_0x51ef4b,{'trunks':_0x4dda20});var _0x4a501f=ejs[_0x4da6('0x64')](_0x4218bc,{'trunks':_0x4dda20});fs[_0x4da6('0x65')](_0x4da6('0x66'),_0x48cd81);fs[_0x4da6('0x65')](_0x4da6('0x6b'),_0x4a501f);return respondWithRpcPromise('Reload',_0x4da6('0x30'),{'module':_0x4da6('0x68')});})[_0x4da6('0x26')](handleError(_0x22713f,null));}; \ No newline at end of file +var _0x84c0=['set','Content-Range','apply','reject','update','destroy','get','Trunks','UserProfileResource','stack','send','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','Trunk','includeAll','include','rows','catch','show','params','find','omit','createdAt','body','updatedAt','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','findAll','server/files/templates/trunk.ejs','html-pdf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','client','http','test','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','result','sendStatus','status','end','json','count','offset','limit'];(function(_0x451f88,_0x5c061a){var _0x2cc2b7=function(_0x5bb6ce){while(--_0x5bb6ce){_0x451f88['push'](_0x451f88['shift']());}};_0x2cc2b7(++_0x5c061a);}(_0x84c0,0xad));var _0x084c=function(_0x3f7829,_0x51e79d){_0x3f7829=_0x3f7829-0x0;var _0x52358e=_0x84c0[_0x3f7829];return _0x52358e;};'use strict';var pdf=require(_0x084c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x084c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x084c('0x2'));var moment=require(_0x084c('0x3'));var BPromise=require(_0x084c('0x4'));var Mustache=require('mustache');var util=require(_0x084c('0x5'));var path=require(_0x084c('0x6'));var sox=require(_0x084c('0x7'));var csv=require(_0x084c('0x8'));var ejs=require(_0x084c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x084c('0xa'));var jsforce=require(_0x084c('0xb'));var deskjs=require(_0x084c('0xc'));var toCsv=require(_0x084c('0x8'));var querystring=require('querystring');var Papa=require(_0x084c('0xd'));var Redis=require(_0x084c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x084c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x084c('0x10'));var utils=require(_0x084c('0x11'));var config=require(_0x084c('0x12'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x084c('0x13')][_0x084c('0x14')]({'port':0x232a});function checkPasswordPattern(_0x4283d9,_0x103a7b,_0x9c1d66){if(_0x9c1d66){var _0x705f1a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x705f1a[_0x084c('0x15')](_0x103a7b)){return _0x4283d9;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4283d9;}}function respondWithRpcPromise(_0x501a4f,_0x15ca01,_0x2ce2c2,_0x1f69eb){return new BPromise(function(_0x31c120,_0x52a718){var _0x55ea9d=_0x1f69eb||client;return _0x55ea9d[_0x084c('0x16')](_0x501a4f,_0x2ce2c2)[_0x084c('0x17')](function(_0x4ec502){logger[_0x084c('0x18')]('Trunk,\x20%s,\x20%s',_0x15ca01,_0x084c('0x19'));logger[_0x084c('0x1a')](_0x084c('0x1b'),_0x15ca01,_0x084c('0x19'),JSON[_0x084c('0x1c')](_0x4ec502));if(_0x4ec502[_0x084c('0x1d')]){if(_0x4ec502['error'][_0x084c('0x1e')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x15ca01,_0x4ec502[_0x084c('0x1d')][_0x084c('0x1f')]);return _0x52a718(_0x4ec502[_0x084c('0x1d')][_0x084c('0x1f')]);}logger[_0x084c('0x1d')](_0x084c('0x20'),_0x15ca01,_0x4ec502['error'][_0x084c('0x1f')]);return _0x31c120(_0x4ec502[_0x084c('0x1d')][_0x084c('0x1f')]);}else{logger[_0x084c('0x18')](_0x084c('0x20'),_0x15ca01,'request\x20sent');_0x31c120(_0x4ec502[_0x084c('0x21')][_0x084c('0x1f')]);}})['catch'](function(_0xec1b17){logger['error'](_0x084c('0x20'),_0x15ca01,_0xec1b17);_0x52a718(_0xec1b17);});});}function respondWithStatusCode(_0x8c679,_0x52c070){_0x52c070=_0x52c070||0xcc;return function(_0x3bf656){if(_0x3bf656){return _0x8c679[_0x084c('0x22')](_0x52c070);}return _0x8c679[_0x084c('0x23')](_0x52c070)[_0x084c('0x24')]();};}function respondWithResult(_0x1a0d94,_0x4585a1){_0x4585a1=_0x4585a1||0xc8;return function(_0x57b60a){if(_0x57b60a){return _0x1a0d94[_0x084c('0x23')](_0x4585a1)[_0x084c('0x25')](_0x57b60a);}};}function respondWithFilteredResult(_0x299db3,_0x29bf5d){return function(_0x44a45f){if(_0x44a45f){var _0x2bad5e=_0x44a45f[_0x084c('0x26')],_0x5a2ee5=_0x29bf5d[_0x084c('0x27')],_0x258adc=_0x29bf5d[_0x084c('0x27')]+_0x29bf5d[_0x084c('0x28')],_0x1d41c0;if(_0x258adc>=_0x2bad5e){_0x258adc=_0x2bad5e;_0x1d41c0=0xc8;}else{_0x1d41c0=0xce;}_0x299db3[_0x084c('0x23')](_0x1d41c0);return _0x299db3[_0x084c('0x29')](_0x084c('0x2a'),_0x5a2ee5+'-'+_0x258adc+'/'+_0x2bad5e)[_0x084c('0x25')](_0x44a45f);}return null;};}function patchUpdates(_0x2f13f4){return function(_0x280177){try{jsonpatch[_0x084c('0x2b')](_0x280177,_0x2f13f4,!![]);}catch(_0x2606c4){return BPromise[_0x084c('0x2c')](_0x2606c4);}return _0x280177['save']();};}function saveUpdates(_0x1f9385,_0x1325b0){return function(_0x1978ad){if(_0x1978ad){return _0x1978ad[_0x084c('0x2d')](_0x1f9385)[_0x084c('0x17')](function(_0x24b32d){return _0x24b32d;});}return null;};}function removeEntity(_0x41bb88,_0x5a58df){return function(_0x15cbe4){if(_0x15cbe4){return _0x15cbe4[_0x084c('0x2e')]()['then'](function(){var _0x22a688=_0x15cbe4[_0x084c('0x2f')]({'plain':!![]});var _0x3e6066=_0x084c('0x30');return db[_0x084c('0x31')]['destroy']({'where':{'type':_0x3e6066,'resourceId':_0x22a688['id']}})['then'](function(){return _0x15cbe4;});})[_0x084c('0x17')](function(){_0x41bb88[_0x084c('0x23')](0xcc)[_0x084c('0x24')]();});}};}function handleEntityNotFound(_0x3fb631,_0xde31ba){return function(_0x151ccd){if(!_0x151ccd){_0x3fb631[_0x084c('0x22')](0x194);}return _0x151ccd;};}function handleError(_0xe5f000,_0x5f4aa2){_0x5f4aa2=_0x5f4aa2||0x1f4;return function(_0x17fe7f){logger[_0x084c('0x1d')](_0x17fe7f[_0x084c('0x32')]);if(_0x17fe7f['name']){delete _0x17fe7f['name'];}_0xe5f000['status'](_0x5f4aa2)[_0x084c('0x33')](_0x17fe7f);};}exports['index']=function(_0x95849c,_0x13b66f){var _0x3d738a={},_0x3fefa7={},_0x410c05={'count':0x0,'rows':[]};var _0x4b2284=db['Trunk'][_0x084c('0x34')];_0x3fefa7['model']=_[_0x084c('0x35')](_0x4b2284);_0x3fefa7[_0x084c('0x36')]=_[_0x084c('0x35')](_0x95849c[_0x084c('0x36')]);_0x3fefa7[_0x084c('0x37')]=_[_0x084c('0x38')](_0x3fefa7['model'],_0x3fefa7['query']);_0x3d738a[_0x084c('0x39')]=_[_0x084c('0x38')](_0x3fefa7[_0x084c('0x3a')],qs[_0x084c('0x3b')](_0x95849c[_0x084c('0x36')][_0x084c('0x3b')]));_0x3d738a[_0x084c('0x39')]=_0x3d738a[_0x084c('0x39')][_0x084c('0x3c')]?_0x3d738a[_0x084c('0x39')]:_0x3fefa7['model'];if(!_0x95849c[_0x084c('0x36')][_0x084c('0x3d')]('nolimit')){_0x3d738a[_0x084c('0x28')]=qs['limit'](_0x95849c['query'][_0x084c('0x28')]);_0x3d738a[_0x084c('0x27')]=qs[_0x084c('0x27')](_0x95849c[_0x084c('0x36')][_0x084c('0x27')]);}_0x3d738a[_0x084c('0x3e')]=qs[_0x084c('0x3f')](_0x95849c[_0x084c('0x36')][_0x084c('0x3f')]);_0x3d738a[_0x084c('0x40')]=qs[_0x084c('0x37')](_['pick'](_0x95849c['query'],_0x3fefa7[_0x084c('0x37')]));if(_0x95849c[_0x084c('0x36')][_0x084c('0x41')]){_0x3d738a[_0x084c('0x40')]=_[_0x084c('0x42')](_0x3d738a['where'],{'$or':_[_0x084c('0x43')](_0x4b2284,function(_0xb67f8b){if(_0xb67f8b[_0x084c('0x44')][_0x084c('0x45')]!==_0x084c('0x46')){var _0x3cef90={};_0x3cef90[_0xb67f8b[_0x084c('0x47')]]={'$like':'%'+_0x95849c[_0x084c('0x36')][_0x084c('0x41')]+'%'};return _0x3cef90;}})});}_0x3d738a=_[_0x084c('0x42')]({},_0x3d738a,_0x95849c[_0x084c('0x48')]);var _0x1af5f1={'where':_0x3d738a[_0x084c('0x40')]};return db[_0x084c('0x49')][_0x084c('0x26')](_0x1af5f1)[_0x084c('0x17')](function(_0x5224b2){_0x410c05[_0x084c('0x26')]=_0x5224b2;if(_0x95849c[_0x084c('0x36')][_0x084c('0x4a')]){_0x3d738a[_0x084c('0x4b')]=[{'all':!![]}];}return db[_0x084c('0x49')]['findAll'](_0x3d738a);})[_0x084c('0x17')](function(_0xe3b65d){_0x410c05[_0x084c('0x4c')]=_0xe3b65d;return _0x410c05;})['then'](respondWithFilteredResult(_0x13b66f,_0x3d738a))[_0x084c('0x4d')](handleError(_0x13b66f,null));};exports[_0x084c('0x4e')]=function(_0x365f8d,_0x14a0fd){var _0xd8001b={'raw':![],'where':{'id':_0x365f8d[_0x084c('0x4f')]['id']}},_0x28bbc3={};_0x28bbc3[_0x084c('0x3a')]=_[_0x084c('0x35')](db[_0x084c('0x49')][_0x084c('0x34')]);_0x28bbc3[_0x084c('0x36')]=_[_0x084c('0x35')](_0x365f8d[_0x084c('0x36')]);_0x28bbc3[_0x084c('0x37')]=_['intersection'](_0x28bbc3[_0x084c('0x3a')],_0x28bbc3[_0x084c('0x36')]);_0xd8001b[_0x084c('0x39')]=_[_0x084c('0x38')](_0x28bbc3[_0x084c('0x3a')],qs[_0x084c('0x3b')](_0x365f8d[_0x084c('0x36')][_0x084c('0x3b')]));_0xd8001b[_0x084c('0x39')]=_0xd8001b[_0x084c('0x39')][_0x084c('0x3c')]?_0xd8001b['attributes']:_0x28bbc3['model'];if(_0x365f8d[_0x084c('0x36')][_0x084c('0x4a')]){_0xd8001b['include']=[{'all':!![]}];}_0xd8001b=_[_0x084c('0x42')]({},_0xd8001b,_0x365f8d[_0x084c('0x48')]);return db['Trunk']['find'](_0xd8001b)[_0x084c('0x17')](handleEntityNotFound(_0x14a0fd,null))[_0x084c('0x17')](respondWithResult(_0x14a0fd,null))[_0x084c('0x4d')](handleError(_0x14a0fd,null));};exports['clone']=function(_0x241e31,_0x4f2308){var _0x498dee={'raw':![],'where':{'id':_0x241e31[_0x084c('0x4f')]['id']}},_0x19ab29={};_0x19ab29[_0x084c('0x3a')]=_['keys'](db[_0x084c('0x49')]['rawAttributes']);_0x498dee['attributes']=_[_0x084c('0x38')](_0x19ab29['model'],qs[_0x084c('0x3b')](_0x241e31['query'][_0x084c('0x3b')]));_0x498dee[_0x084c('0x39')]=_0x498dee[_0x084c('0x39')][_0x084c('0x3c')]?_0x498dee[_0x084c('0x39')]:_0x19ab29[_0x084c('0x3a')];if(_0x241e31['query']['includeAll']){_0x498dee['include']=[{'all':!![]}];}_0x498dee=_[_0x084c('0x42')]({},_0x498dee,_0x241e31[_0x084c('0x48')]);return db[_0x084c('0x49')][_0x084c('0x50')](_0x498dee)['then'](handleEntityNotFound(_0x4f2308,null))[_0x084c('0x17')](function(_0x541c17){if(_0x541c17){var _0x365ba6=_0x541c17[_0x084c('0x2f')]({'plain':!![]});_0x365ba6=qs[_0x084c('0x51')](_0x365ba6,['id',_0x084c('0x52'),'updatedAt']);_0x241e31['body']=_['omit'](_0x241e31[_0x084c('0x53')],['id','createdAt',_0x084c('0x54')]);return db[_0x084c('0x49')][_0x084c('0x55')](_[_0x084c('0x42')](_0x365ba6,_0x241e31[_0x084c('0x53')]),{'include':_0x241e31[_0x084c('0x36')][_0x084c('0x4a')]?[{'all':!![]}]:undefined})[_0x084c('0x17')](function(_0x4f8d68){var _0x4ba618=_0x241e31['user']['get']({'plain':!![]});if(!_0x4ba618)throw new Error(_0x084c('0x56'));if(_0x4ba618['role']===_0x084c('0x57')){var _0x3ce618=_0x4f8d68['get']({'plain':!![]});var _0x4643fb=_0x084c('0x30');return db[_0x084c('0x58')][_0x084c('0x50')]({'where':{'name':_0x4643fb,'userProfileId':_0x4ba618[_0x084c('0x59')]},'raw':!![]})[_0x084c('0x17')](function(_0x313ab9){if(_0x313ab9&&_0x313ab9[_0x084c('0x5a')]===0x0){return db[_0x084c('0x31')][_0x084c('0x55')]({'name':_0x3ce618[_0x084c('0x5b')],'resourceId':_0x3ce618['id'],'type':_0x313ab9[_0x084c('0x5b')],'sectionId':_0x313ab9['id']},{})['then'](function(){return _0x4f8d68;});}else{return _0x4f8d68;}})[_0x084c('0x4d')](function(_0x292b29){logger[_0x084c('0x1d')](_0x084c('0x5c'),_0x292b29);throw _0x292b29;});}return _0x4f8d68;});}})[_0x084c('0x17')](respondWithResult(_0x4f2308,0xc9))[_0x084c('0x4d')](handleError(_0x4f2308,null));};exports['create']=function(_0x1fc463,_0x4b31e4,_0x24dc34){var _0x2dff2d;return db[_0x084c('0x49')][_0x084c('0x55')](_0x1fc463[_0x084c('0x53')],{'raw':!![]})[_0x084c('0x17')](function(_0x4c7076){_0x2dff2d=_0x4c7076;return db['Trunk']['findAll']({'raw':!![]});})[_0x084c('0x17')](function(_0x4f7d9a){var _0x36a31f=fs['readFileSync'](path[_0x084c('0x5d')](config[_0x084c('0x5e')],'server/files/templates/trunk.ejs'),'utf8');var _0x44b2a2=fs[_0x084c('0x5f')](path['join'](config[_0x084c('0x5e')],_0x084c('0x60')),_0x084c('0x61'));var _0x32e6c8=ejs['render'](_0x36a31f,{'trunks':_0x4f7d9a||[]});fs[_0x084c('0x62')](_0x084c('0x63'),_0x32e6c8);if(_0x2dff2d['registry']){var _0x2e1f62=ejs[_0x084c('0x64')](_0x44b2a2,{'trunks':_0x4f7d9a||[]});fs['writeFileSync'](_0x084c('0x65'),_0x2e1f62);}})['then'](function(){return respondWithRpcPromise(_0x084c('0x66'),_0x084c('0x55'),{'module':_0x084c('0x67')});})['then'](function(){var _0x5395e2=_0x1fc463[_0x084c('0x57')][_0x084c('0x2f')]({'plain':!![]});if(!_0x5395e2)throw new Error(_0x084c('0x56'));if(_0x5395e2[_0x084c('0x68')]===_0x084c('0x57')){var _0x34fcca=_0x2dff2d[_0x084c('0x2f')]({'plain':!![]});return db[_0x084c('0x58')]['find']({'where':{'name':_0x084c('0x30'),'userProfileId':_0x5395e2[_0x084c('0x59')]},'raw':!![]})[_0x084c('0x17')](function(_0x305a8d){if(_0x305a8d&&_0x305a8d['autoAssociation']===0x0){return db['UserProfileResource'][_0x084c('0x55')]({'name':_0x34fcca[_0x084c('0x5b')],'resourceId':_0x34fcca['id'],'type':_0x305a8d['name'],'sectionId':_0x305a8d['id']},{})[_0x084c('0x17')](function(){return _0x2dff2d;});}else{return _0x2dff2d;}})[_0x084c('0x4d')](function(_0x35cb4b){logger['error'](_0x084c('0x5c'),_0x35cb4b);throw _0x35cb4b;});}return _0x2dff2d;})[_0x084c('0x17')](respondWithResult(_0x4b31e4,0xc9))['catch'](handleError(_0x4b31e4,null));};exports[_0x084c('0x2d')]=function(_0x76a705,_0x1076eb,_0x3092f6){var _0x5eaaaf;return db['Trunk'][_0x084c('0x50')]({'where':{'id':_0x76a705[_0x084c('0x4f')]['id']}})[_0x084c('0x17')](handleEntityNotFound(_0x1076eb,null))[_0x084c('0x17')](saveUpdates(_0x76a705[_0x084c('0x53')],null))[_0x084c('0x17')](function(_0x263c47){if(_0x263c47){_0x5eaaaf=_0x263c47;return db['Trunk'][_0x084c('0x69')]({'raw':!![]});}})[_0x084c('0x17')](function(_0x10e920){if(_0x10e920){var _0x9628c=fs[_0x084c('0x5f')](path[_0x084c('0x5d')](config['root'],_0x084c('0x6a')),_0x084c('0x61'));var _0x58a556=fs[_0x084c('0x5f')](path['join'](config['root'],_0x084c('0x60')),_0x084c('0x61'));var _0x188d36=ejs[_0x084c('0x64')](_0x9628c,{'trunks':_0x10e920||[]});fs[_0x084c('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x188d36);var _0x7a1267=ejs['render'](_0x58a556,{'trunks':_0x10e920||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x7a1267);return respondWithRpcPromise(_0x084c('0x66'),_0x084c('0x2d'),{'module':_0x084c('0x67')});}return null;})[_0x084c('0x17')](function(_0x3ca8a0){if(_0x3ca8a0){return _0x5eaaaf;}})[_0x084c('0x17')](respondWithResult(_0x1076eb,null))[_0x084c('0x4d')](handleError(_0x1076eb,null));};exports['destroy']=function(_0x51364c,_0x55a1d8,_0x3b3d5e){var _0x216725;return db[_0x084c('0x49')][_0x084c('0x50')]({'where':{'id':_0x51364c[_0x084c('0x4f')]['id']}})[_0x084c('0x17')](handleEntityNotFound(_0x55a1d8,null))[_0x084c('0x17')](removeEntity(_0x55a1d8,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x31e081){var _0x167831=fs['readFileSync'](path[_0x084c('0x5d')](config['root'],_0x084c('0x6a')),_0x084c('0x61'));var _0x192258=fs[_0x084c('0x5f')](path[_0x084c('0x5d')](config[_0x084c('0x5e')],_0x084c('0x60')),'utf8');var _0xbeeb6e=ejs[_0x084c('0x64')](_0x167831,{'trunks':_0x31e081});var _0x7e195b=ejs[_0x084c('0x64')](_0x192258,{'trunks':_0x31e081});fs[_0x084c('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0xbeeb6e);fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x7e195b);return respondWithRpcPromise(_0x084c('0x66'),_0x084c('0x2e'),{'module':_0x084c('0x67')});})['catch'](handleError(_0x55a1d8,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 44402dd..054ae5a 100644 --- a/server/api/trunk/trunk.model.js +++ b/server/api/trunk/trunk.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ef0=['moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','lodash','../../config/logger'];(function(_0x9763c0,_0x55eb6e){var _0x292fbf=function(_0x433987){while(--_0x433987){_0x9763c0['push'](_0x9763c0['shift']());}};_0x292fbf(++_0x55eb6e);}(_0x9ef0,0x174));var _0x09ef=function(_0x46d448,_0x44f28e){_0x46d448=_0x46d448-0x0;var _0x451d82=_0x9ef0[_0x46d448];return _0x451d82;};'use strict';var _=require(_0x09ef('0x0'));var util=require('util');var logger=require(_0x09ef('0x1'))('api');var moment=require(_0x09ef('0x2'));var BPromise=require(_0x09ef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x09ef('0x4'));var rimraf=require(_0x09ef('0x5'));var config=require(_0x09ef('0x6'));var attributes=require(_0x09ef('0x7'));module[_0x09ef('0x8')]=function(_0x5cb906,_0x1e8ff3){return _0x5cb906['define'](_0x09ef('0x9'),attributes,{'tableName':_0x09ef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1543=['request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','tools_trunks','lodash','../../config/logger','api','moment'];(function(_0x3dd160,_0x1f67f4){var _0xd4bd3c=function(_0x4dde2c){while(--_0x4dde2c){_0x3dd160['push'](_0x3dd160['shift']());}};_0xd4bd3c(++_0x1f67f4);}(_0x1543,0x110));var _0x3154=function(_0x48fc99,_0x2318f2){_0x48fc99=_0x48fc99-0x0;var _0x51c8a7=_0x1543[_0x48fc99];return _0x51c8a7;};'use strict';var _=require(_0x3154('0x0'));var util=require('util');var logger=require(_0x3154('0x1'))(_0x3154('0x2'));var moment=require(_0x3154('0x3'));var BPromise=require('bluebird');var rp=require(_0x3154('0x4'));var fs=require('fs');var path=require(_0x3154('0x5'));var rimraf=require(_0x3154('0x6'));var config=require(_0x3154('0x7'));var attributes=require(_0x3154('0x8'));module[_0x3154('0x9')]=function(_0x50ff6b,_0x58eaf8){return _0x50ff6b[_0x3154('0xa')]('Trunk',attributes,{'tableName':_0x3154('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index e5033a7..6d1a2a2 100644 --- a/server/api/trunk/trunk.rpc.js +++ b/server/api/trunk/trunk.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14a0=['limit','include','model','map','find','ShowTrunk','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes'];(function(_0x6fb860,_0x5cd78a){var _0x1522c6=function(_0x48d03b){while(--_0x48d03b){_0x6fb860['push'](_0x6fb860['shift']());}};_0x1522c6(++_0x5cd78a);}(_0x14a0,0x8e));var _0x014a=function(_0x281e02,_0x2c2889){_0x281e02=_0x281e02-0x0;var _0x52df67=_0x14a0[_0x281e02];return _0x52df67;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('Trunk,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('Trunk,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('Trunk,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});}exports[_0x014a('0x15')]=function(_0x12d339){var _0x61ec9f=this;return new Promise(function(_0x263b07,_0x16490a){return db[_0x014a('0x16')][_0x014a('0x17')]({'raw':_0x12d339[_0x014a('0x18')]?_0x12d339[_0x014a('0x18')][_0x014a('0x19')]===undefined?!![]:![]:!![],'where':_0x12d339['options']?_0x12d339[_0x014a('0x18')][_0x014a('0x1a')]||null:null,'attributes':_0x12d339[_0x014a('0x18')]?_0x12d339[_0x014a('0x18')][_0x014a('0x1b')]||null:null,'limit':_0x12d339[_0x014a('0x18')]?_0x12d339[_0x014a('0x18')][_0x014a('0x1c')]||null:null,'include':_0x12d339[_0x014a('0x18')]?_0x12d339['options'][_0x014a('0x1d')]?_['map'](_0x12d339[_0x014a('0x18')][_0x014a('0x1d')],function(_0x44d921){return{'model':db[_0x44d921[_0x014a('0x1e')]],'as':_0x44d921['as'],'attributes':_0x44d921[_0x014a('0x1b')],'include':_0x44d921[_0x014a('0x1d')]?_[_0x014a('0x1f')](_0x44d921[_0x014a('0x1d')],function(_0x165a42){return{'model':db[_0x165a42['model']],'as':_0x165a42['as'],'attributes':_0x165a42[_0x014a('0x1b')],'include':_0x165a42['include']?_[_0x014a('0x1f')](_0x165a42[_0x014a('0x1d')],function(_0x4f1c44){return{'model':db[_0x4f1c44['model']],'as':_0x4f1c44['as'],'attributes':_0x4f1c44[_0x014a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x014a('0xa')](function(_0x143346){logger['info'](_0x014a('0x15'),_0x12d339);logger[_0x014a('0xb')]('GetTrunk',_0x12d339,JSON[_0x014a('0xd')](_0x143346));_0x263b07(_0x143346);})[_0x014a('0x14')](function(_0x496040){logger['error'](_0x014a('0x15'),_0x496040[_0x014a('0x11')],_0x12d339);_0x16490a(_0x61ec9f[_0x014a('0xe')](0x1f4,_0x496040[_0x014a('0x11')]));});});};exports['ShowTrunk']=function(_0x434038){var _0x147e7e=this;return new Promise(function(_0x15af07,_0x402d3b){return db[_0x014a('0x16')][_0x014a('0x20')]({'raw':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')][_0x014a('0x19')]===undefined?!![]:![]:!![],'where':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')]['where']||null:null,'attributes':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')][_0x014a('0x1b')]||null:null,'include':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')][_0x014a('0x1d')]?_[_0x014a('0x1f')](_0x434038['options'][_0x014a('0x1d')],function(_0x325b3c){return{'model':db[_0x325b3c['model']],'as':_0x325b3c['as'],'attributes':_0x325b3c[_0x014a('0x1b')],'include':_0x325b3c[_0x014a('0x1d')]?_[_0x014a('0x1f')](_0x325b3c[_0x014a('0x1d')],function(_0x329136){return{'model':db[_0x329136[_0x014a('0x1e')]],'as':_0x329136['as'],'attributes':_0x329136[_0x014a('0x1b')],'include':_0x329136[_0x014a('0x1d')]?_['map'](_0x329136[_0x014a('0x1d')],function(_0x1dfe6e){return{'model':db[_0x1dfe6e[_0x014a('0x1e')]],'as':_0x1dfe6e['as'],'attributes':_0x1dfe6e[_0x014a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x427c7a){logger[_0x014a('0x12')](_0x014a('0x21'),_0x434038);logger[_0x014a('0xb')](_0x014a('0x21'),_0x434038,JSON[_0x014a('0xd')](_0x427c7a));_0x15af07(_0x427c7a);})[_0x014a('0x14')](function(_0x36187b){logger[_0x014a('0xe')]('ShowTrunk',_0x36187b[_0x014a('0x11')],_0x434038);_0x402d3b(_0x147e7e['error'](0x1f4,_0x36187b[_0x014a('0x11')]));});});}; \ No newline at end of file +var _0x14a0=['limit','include','model','map','find','ShowTrunk','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes'];(function(_0x369118,_0xa363c3){var _0x3c8be2=function(_0x12db8f){while(--_0x12db8f){_0x369118['push'](_0x369118['shift']());}};_0x3c8be2(++_0xa363c3);}(_0x14a0,0x8e));var _0x014a=function(_0x2a41d9,_0x566f4b){_0x2a41d9=_0x2a41d9-0x0;var _0x44ac8a=_0x14a0[_0x2a41d9];return _0x44ac8a;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('Trunk,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('Trunk,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('Trunk,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});}exports[_0x014a('0x15')]=function(_0x12d339){var _0x61ec9f=this;return new Promise(function(_0x263b07,_0x16490a){return db[_0x014a('0x16')][_0x014a('0x17')]({'raw':_0x12d339[_0x014a('0x18')]?_0x12d339[_0x014a('0x18')][_0x014a('0x19')]===undefined?!![]:![]:!![],'where':_0x12d339['options']?_0x12d339[_0x014a('0x18')][_0x014a('0x1a')]||null:null,'attributes':_0x12d339[_0x014a('0x18')]?_0x12d339[_0x014a('0x18')][_0x014a('0x1b')]||null:null,'limit':_0x12d339[_0x014a('0x18')]?_0x12d339[_0x014a('0x18')][_0x014a('0x1c')]||null:null,'include':_0x12d339[_0x014a('0x18')]?_0x12d339['options'][_0x014a('0x1d')]?_['map'](_0x12d339[_0x014a('0x18')][_0x014a('0x1d')],function(_0x44d921){return{'model':db[_0x44d921[_0x014a('0x1e')]],'as':_0x44d921['as'],'attributes':_0x44d921[_0x014a('0x1b')],'include':_0x44d921[_0x014a('0x1d')]?_[_0x014a('0x1f')](_0x44d921[_0x014a('0x1d')],function(_0x165a42){return{'model':db[_0x165a42['model']],'as':_0x165a42['as'],'attributes':_0x165a42[_0x014a('0x1b')],'include':_0x165a42['include']?_[_0x014a('0x1f')](_0x165a42[_0x014a('0x1d')],function(_0x4f1c44){return{'model':db[_0x4f1c44['model']],'as':_0x4f1c44['as'],'attributes':_0x4f1c44[_0x014a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x014a('0xa')](function(_0x143346){logger['info'](_0x014a('0x15'),_0x12d339);logger[_0x014a('0xb')]('GetTrunk',_0x12d339,JSON[_0x014a('0xd')](_0x143346));_0x263b07(_0x143346);})[_0x014a('0x14')](function(_0x496040){logger['error'](_0x014a('0x15'),_0x496040[_0x014a('0x11')],_0x12d339);_0x16490a(_0x61ec9f[_0x014a('0xe')](0x1f4,_0x496040[_0x014a('0x11')]));});});};exports['ShowTrunk']=function(_0x434038){var _0x147e7e=this;return new Promise(function(_0x15af07,_0x402d3b){return db[_0x014a('0x16')][_0x014a('0x20')]({'raw':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')][_0x014a('0x19')]===undefined?!![]:![]:!![],'where':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')]['where']||null:null,'attributes':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')][_0x014a('0x1b')]||null:null,'include':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')][_0x014a('0x1d')]?_[_0x014a('0x1f')](_0x434038['options'][_0x014a('0x1d')],function(_0x325b3c){return{'model':db[_0x325b3c['model']],'as':_0x325b3c['as'],'attributes':_0x325b3c[_0x014a('0x1b')],'include':_0x325b3c[_0x014a('0x1d')]?_[_0x014a('0x1f')](_0x325b3c[_0x014a('0x1d')],function(_0x329136){return{'model':db[_0x329136[_0x014a('0x1e')]],'as':_0x329136['as'],'attributes':_0x329136[_0x014a('0x1b')],'include':_0x329136[_0x014a('0x1d')]?_['map'](_0x329136[_0x014a('0x1d')],function(_0x1dfe6e){return{'model':db[_0x1dfe6e[_0x014a('0x1e')]],'as':_0x1dfe6e['as'],'attributes':_0x1dfe6e[_0x014a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x427c7a){logger[_0x014a('0x12')](_0x014a('0x21'),_0x434038);logger[_0x014a('0xb')](_0x014a('0x21'),_0x434038,JSON[_0x014a('0xd')](_0x427c7a));_0x15af07(_0x427c7a);})[_0x014a('0x14')](function(_0x36187b){logger[_0x014a('0xe')]('ShowTrunk',_0x36187b[_0x014a('0x11')],_0x434038);_0x402d3b(_0x147e7e['error'](0x1f4,_0x36187b[_0x014a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index d18a26f..f058148 100644 --- a/server/api/user/index.js +++ b/server/api/user/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa71c=['getOpenchannelInteractions','/:id/mail/interactions','getSmsInteractions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','/create_many','bulkCreate','post','addContacts','addQueues','diskStorage','server/files/images/','format','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','pause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','addFaxAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','put','update','/:id/password','delete','removeQueues','destroy','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeOpenchannelAccounts','removeSmsAccounts','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions'];(function(_0x509da2,_0xd2f81a){var _0x277535=function(_0x4823bb){while(--_0x4823bb){_0x509da2['push'](_0x509da2['shift']());}};_0x277535(++_0xd2f81a);}(_0xa71c,0xa1));var _0xca71=function(_0x1476d8,_0x4492c7){_0x1476d8=_0x1476d8-0x0;var _0x20bf70=_0xa71c[_0x1476d8];return _0x20bf70;};'use strict';var multer=require(_0xca71('0x0'));var util=require('util');var path=require(_0xca71('0x1'));var timeout=require(_0xca71('0x2'));var express=require(_0xca71('0x3'));var router=express[_0xca71('0x4')]();var auth=require(_0xca71('0x5'));var interaction=require(_0xca71('0x6'));var config=require(_0xca71('0x7'));var controller=require(_0xca71('0x8'));router[_0xca71('0x9')]('/',auth[_0xca71('0xa')](),controller[_0xca71('0xb')]);router[_0xca71('0x9')](_0xca71('0xc'),auth[_0xca71('0xa')](),controller[_0xca71('0xd')]);router[_0xca71('0x9')](_0xca71('0xe'),auth[_0xca71('0xa')](),controller['show']);router[_0xca71('0x9')](_0xca71('0xf'),controller[_0xca71('0x10')]);router['get'](_0xca71('0x11'),auth[_0xca71('0xa')](),controller[_0xca71('0x12')]);router[_0xca71('0x9')](_0xca71('0x13'),auth[_0xca71('0xa')](),controller['getQueues']);router[_0xca71('0x9')](_0xca71('0x14'),auth[_0xca71('0xa')](),controller[_0xca71('0x15')]);router['get'](_0xca71('0x16'),auth['isAuthenticated'](),controller[_0xca71('0x17')]);router[_0xca71('0x9')](_0xca71('0x18'),auth[_0xca71('0xa')](),controller['getRecordings']);router[_0xca71('0x9')]('/:id/screen_recordings',auth[_0xca71('0xa')](),controller[_0xca71('0x19')]);router[_0xca71('0x9')](_0xca71('0x1a'),auth['isAuthenticated'](),controller[_0xca71('0x1b')]);router[_0xca71('0x9')](_0xca71('0x1c'),auth[_0xca71('0xa')](),controller[_0xca71('0x1d')]);router['get'](_0xca71('0x1e'),auth[_0xca71('0xa')](),controller['getMailInteractions']);router[_0xca71('0x9')]('/:id/sms/interactions',auth[_0xca71('0xa')](),controller[_0xca71('0x1f')]);router[_0xca71('0x9')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0xca71('0x20')]);router['get'](_0xca71('0x21'),auth[_0xca71('0xa')](),controller[_0xca71('0x22')]);router[_0xca71('0x9')](_0xca71('0x23'),auth[_0xca71('0xa')](),controller['getLists']);router[_0xca71('0x9')]('/:id/agents',auth[_0xca71('0xa')](),controller['getAgents']);router[_0xca71('0x9')]('/:id/prefixes',auth[_0xca71('0xa')](),controller[_0xca71('0x24')]);router[_0xca71('0x9')](_0xca71('0x25'),auth[_0xca71('0xa')](),controller[_0xca71('0x26')]);router[_0xca71('0x9')](_0xca71('0x27'),auth[_0xca71('0xa')](),controller[_0xca71('0x28')]);router[_0xca71('0x9')](_0xca71('0x29'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xca71('0x9')]('/:id/sms_accounts',auth[_0xca71('0xa')](),controller[_0xca71('0x2a')]);router['get'](_0xca71('0x2b'),auth[_0xca71('0xa')](),controller[_0xca71('0x2c')]);router['get'](_0xca71('0x2d'),auth[_0xca71('0xa')](),controller['getSquareProjects']);router[_0xca71('0x9')](_0xca71('0x2e'),auth[_0xca71('0xa')](),controller[_0xca71('0x2f')]);router[_0xca71('0x9')](_0xca71('0x30'),auth[_0xca71('0xa')](),controller[_0xca71('0x31')]);router['post'](_0xca71('0x32'),auth[_0xca71('0xa')](),controller[_0xca71('0x33')]);router[_0xca71('0x34')](_0xca71('0x11'),auth['isAuthenticated'](),controller[_0xca71('0x35')]);router[_0xca71('0x34')]('/',auth['isAuthenticated'](),controller['create']);router[_0xca71('0x34')](_0xca71('0x13'),auth['isAuthenticated'](),controller[_0xca71('0x36')]);var upload=multer({'storage':multer[_0xca71('0x37')]({'destination':function(_0x4d4b1a,_0x3d3096,_0xe42d1f){_0xe42d1f(null,path['join'](config['root'],_0xca71('0x38')));},'filename':function(_0x44a499,_0x392c75,_0x352e03){_0x352e03(null,util[_0xca71('0x39')]('%s-%s',Date[_0xca71('0x3a')](),_0x392c75[_0xca71('0x3b')]));}})});router[_0xca71('0x34')](_0xca71('0xf'),upload[_0xca71('0x3c')](_0xca71('0x3d')),controller[_0xca71('0x3e')]);router['post'](_0xca71('0x3f'),auth[_0xca71('0xa')](),controller[_0xca71('0x40')]);router[_0xca71('0x34')](_0xca71('0x41'),auth[_0xca71('0xa')](),controller['logout']);router['post']('/:id/pause',auth[_0xca71('0xa')](),controller[_0xca71('0x42')]);router[_0xca71('0x34')]('/:id/unpause',auth[_0xca71('0xa')](),controller['unpause']);router[_0xca71('0x34')](_0xca71('0x21'),auth[_0xca71('0xa')](),controller[_0xca71('0x43')]);router['post'](_0xca71('0x44'),auth[_0xca71('0xa')](),controller[_0xca71('0x45')]);router[_0xca71('0x34')](_0xca71('0x46'),auth['isAuthenticated'](),controller[_0xca71('0x47')]);router[_0xca71('0x34')]('/:id/fax_interactions',auth[_0xca71('0xa')](),controller[_0xca71('0x48')]);router[_0xca71('0x34')](_0xca71('0x49'),auth[_0xca71('0xa')](),controller[_0xca71('0x4a')]);router[_0xca71('0x34')]('/:id/openchannel_interactions',auth[_0xca71('0xa')](),controller[_0xca71('0x4b')]);router['post']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xca71('0x4c')]);router[_0xca71('0x34')](_0xca71('0x27'),auth[_0xca71('0xa')](),controller['addMailAccounts']);router['post']('/:id/openchannel_accounts',auth[_0xca71('0xa')](),controller['addOpenchannelAccounts']);router[_0xca71('0x34')](_0xca71('0x4d'),auth['isAuthenticated'](),controller[_0xca71('0x4e')]);router[_0xca71('0x34')](_0xca71('0x2b'),auth[_0xca71('0xa')](),controller[_0xca71('0x4f')]);router[_0xca71('0x34')](_0xca71('0x2d'),auth[_0xca71('0xa')](),controller[_0xca71('0x50')]);router['post'](_0xca71('0x30'),auth[_0xca71('0xa')](),controller[_0xca71('0x51')]);router[_0xca71('0x52')](_0xca71('0xe'),auth[_0xca71('0xa')](),controller[_0xca71('0x53')]);router[_0xca71('0x52')](_0xca71('0x54'),auth[_0xca71('0xa')](),controller['changePassword']);router[_0xca71('0x55')](_0xca71('0x13'),auth[_0xca71('0xa')](),controller[_0xca71('0x56')]);router['delete'](_0xca71('0x21'),auth[_0xca71('0xa')](),controller['removeTeams']);router[_0xca71('0x55')]('/:id',auth[_0xca71('0xa')](),controller[_0xca71('0x57')]);router['delete']('/:id/chat_interactions',auth[_0xca71('0xa')](),controller['removeChatInteractions']);router[_0xca71('0x55')](_0xca71('0x46'),auth[_0xca71('0xa')](),controller[_0xca71('0x58')]);router['delete']('/:id/fax_interactions',auth[_0xca71('0xa')](),controller[_0xca71('0x59')]);router[_0xca71('0x55')](_0xca71('0x49'),auth[_0xca71('0xa')](),controller['removeSmsInteractions']);router['delete'](_0xca71('0x5a'),auth['isAuthenticated'](),controller[_0xca71('0x5b')]);router[_0xca71('0x55')](_0xca71('0x25'),auth[_0xca71('0xa')](),controller['removeFaxAccounts']);router['delete'](_0xca71('0x27'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0xca71('0x55')](_0xca71('0x29'),auth['isAuthenticated'](),controller[_0xca71('0x5c')]);router[_0xca71('0x55')](_0xca71('0x4d'),auth[_0xca71('0xa')](),controller[_0xca71('0x5d')]);router[_0xca71('0x55')](_0xca71('0x2b'),auth[_0xca71('0xa')](),controller['removeChatWebsites']);router[_0xca71('0x55')]('/:id/square_projects',auth[_0xca71('0xa')](),controller['removeSquareProjects']);router[_0xca71('0x55')]('/:id/api_key',auth[_0xca71('0xa')](),controller['removeApiKey']);module[_0xca71('0x5e')]=router; \ No newline at end of file +var _0x4f0f=['/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./user.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','addContacts','create','addQueues','diskStorage','join','root','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/square_projects','createApiKey','put','update','/:id/password','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeFaxInteractions','removeSmsInteractions'];(function(_0x828c7f,_0x1b60b1){var _0x3b8415=function(_0xa2b876){while(--_0xa2b876){_0x828c7f['push'](_0x828c7f['shift']());}};_0x3b8415(++_0x1b60b1);}(_0x4f0f,0xdf));var _0xf4f0=function(_0x420446,_0x31572e){_0x420446=_0x420446-0x0;var _0x26854b=_0x4f0f[_0x420446];return _0x26854b;};'use strict';var multer=require(_0xf4f0('0x0'));var util=require(_0xf4f0('0x1'));var path=require(_0xf4f0('0x2'));var timeout=require(_0xf4f0('0x3'));var express=require('express');var router=express[_0xf4f0('0x4')]();var auth=require(_0xf4f0('0x5'));var interaction=require(_0xf4f0('0x6'));var config=require('../../config/environment');var controller=require(_0xf4f0('0x7'));router['get']('/',auth[_0xf4f0('0x8')](),controller['index']);router[_0xf4f0('0x9')](_0xf4f0('0xa'),auth['isAuthenticated'](),controller[_0xf4f0('0xb')]);router[_0xf4f0('0x9')](_0xf4f0('0xc'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0xd')]);router[_0xf4f0('0x9')](_0xf4f0('0xe'),controller[_0xf4f0('0xf')]);router['get'](_0xf4f0('0x10'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x11')]);router[_0xf4f0('0x9')](_0xf4f0('0x12'),auth[_0xf4f0('0x8')](),controller['getQueues']);router[_0xf4f0('0x9')](_0xf4f0('0x13'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x14')]);router[_0xf4f0('0x9')]('/:id/groups',auth['isAuthenticated'](),controller[_0xf4f0('0x15')]);router[_0xf4f0('0x9')](_0xf4f0('0x16'),auth[_0xf4f0('0x8')](),controller['getRecordings']);router[_0xf4f0('0x9')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0xf4f0('0x17')]);router['get'](_0xf4f0('0x18'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x19')]);router[_0xf4f0('0x9')](_0xf4f0('0x1a'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x1b')]);router[_0xf4f0('0x9')](_0xf4f0('0x1c'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x1d')]);router[_0xf4f0('0x9')](_0xf4f0('0x1e'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x1f')]);router['get'](_0xf4f0('0x20'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x21')]);router[_0xf4f0('0x9')](_0xf4f0('0x22'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x23')]);router[_0xf4f0('0x9')](_0xf4f0('0x24'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x25')]);router[_0xf4f0('0x9')](_0xf4f0('0x26'),auth['isAuthenticated'](),controller[_0xf4f0('0x27')]);router['get'](_0xf4f0('0x28'),auth['isAuthenticated'](),controller[_0xf4f0('0x29')]);router[_0xf4f0('0x9')](_0xf4f0('0x2a'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x2b')]);router[_0xf4f0('0x9')](_0xf4f0('0x2c'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x2d')]);router[_0xf4f0('0x9')](_0xf4f0('0x2e'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x2f')]);router[_0xf4f0('0x9')](_0xf4f0('0x30'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x31')]);router['get'](_0xf4f0('0x32'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x33')]);router['get']('/:id/square_projects',auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x34')]);router[_0xf4f0('0x9')](_0xf4f0('0x35'),auth['isAuthenticated'](),controller[_0xf4f0('0x36')]);router[_0xf4f0('0x9')](_0xf4f0('0x37'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x38')]);router[_0xf4f0('0x39')](_0xf4f0('0x3a'),auth[_0xf4f0('0x8')](),controller['bulkCreate']);router[_0xf4f0('0x39')](_0xf4f0('0x10'),auth['isAuthenticated'](),controller[_0xf4f0('0x3b')]);router[_0xf4f0('0x39')]('/',auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x3c')]);router[_0xf4f0('0x39')](_0xf4f0('0x12'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x3d')]);var upload=multer({'storage':multer[_0xf4f0('0x3e')]({'destination':function(_0xd928e1,_0x2a5793,_0x5716b8){_0x5716b8(null,path[_0xf4f0('0x3f')](config[_0xf4f0('0x40')],'server/files/images/'));},'filename':function(_0x537197,_0xccac3,_0x355793){_0x355793(null,util[_0xf4f0('0x41')](_0xf4f0('0x42'),Date[_0xf4f0('0x43')](),_0xccac3[_0xf4f0('0x44')]));}})});router[_0xf4f0('0x39')]('/:id/avatar',upload[_0xf4f0('0x45')](_0xf4f0('0x46')),controller[_0xf4f0('0x47')]);router['post'](_0xf4f0('0x48'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x49')]);router[_0xf4f0('0x39')]('/:id/logout',auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x4a')]);router[_0xf4f0('0x39')](_0xf4f0('0x4b'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x4c')]);router['post'](_0xf4f0('0x4d'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x4e')]);router[_0xf4f0('0x39')](_0xf4f0('0x22'),auth[_0xf4f0('0x8')](),controller['addTeams']);router['post']('/:id/chat_interactions',auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x4f')]);router['post'](_0xf4f0('0x50'),auth['isAuthenticated'](),controller['addMailInteractions']);router[_0xf4f0('0x39')](_0xf4f0('0x51'),auth[_0xf4f0('0x8')](),controller['addFaxInteractions']);router['post']('/:id/sms_interactions',auth[_0xf4f0('0x8')](),controller['addSmsInteractions']);router['post']('/:id/openchannel_interactions',auth[_0xf4f0('0x8')](),controller['addOpenchannelInteractions']);router[_0xf4f0('0x39')]('/:id/fax_accounts',auth[_0xf4f0('0x8')](),controller['addFaxAccounts']);router[_0xf4f0('0x39')](_0xf4f0('0x2c'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x52')]);router['post'](_0xf4f0('0x2e'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x53')]);router['post'](_0xf4f0('0x30'),auth['isAuthenticated'](),controller[_0xf4f0('0x54')]);router[_0xf4f0('0x39')](_0xf4f0('0x32'),auth[_0xf4f0('0x8')](),controller['addChatWebsites']);router['post'](_0xf4f0('0x55'),auth[_0xf4f0('0x8')](),controller['addSquareProjects']);router[_0xf4f0('0x39')](_0xf4f0('0x37'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x56')]);router[_0xf4f0('0x57')](_0xf4f0('0xc'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x58')]);router[_0xf4f0('0x57')](_0xf4f0('0x59'),auth[_0xf4f0('0x8')](),controller['changePassword']);router[_0xf4f0('0x5a')](_0xf4f0('0x12'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x5b')]);router[_0xf4f0('0x5a')](_0xf4f0('0x22'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x5c')]);router['delete'](_0xf4f0('0xc'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x5d')]);router[_0xf4f0('0x5a')](_0xf4f0('0x5e'),auth['isAuthenticated'](),controller[_0xf4f0('0x5f')]);router[_0xf4f0('0x5a')]('/:id/mail_interactions',auth[_0xf4f0('0x8')](),controller['removeMailInteractions']);router[_0xf4f0('0x5a')]('/:id/fax_interactions',auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x60')]);router[_0xf4f0('0x5a')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xf4f0('0x61')]);router[_0xf4f0('0x5a')](_0xf4f0('0x62'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x63')]);router[_0xf4f0('0x5a')](_0xf4f0('0x2a'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x64')]);router[_0xf4f0('0x5a')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xf4f0('0x65')]);router['delete'](_0xf4f0('0x2e'),auth['isAuthenticated'](),controller[_0xf4f0('0x66')]);router[_0xf4f0('0x5a')](_0xf4f0('0x30'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x67')]);router[_0xf4f0('0x5a')](_0xf4f0('0x32'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x68')]);router[_0xf4f0('0x5a')]('/:id/square_projects',auth[_0xf4f0('0x8')](),controller['removeSquareProjects']);router[_0xf4f0('0x5a')](_0xf4f0('0x37'),auth[_0xf4f0('0x8')](),controller[_0xf4f0('0x69')]);module[_0xf4f0('0x6a')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 8b69d0a..98bed99 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x4be81d,_0x4949b7){var _0x2cce98=function(_0x44b578){while(--_0x44b578){_0x4be81d['push'](_0x4be81d['shift']());}};_0x2cce98(++_0x4949b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x21fc6e,_0x253a40){var _0x5681ce=function(_0x13850a){while(--_0x13850a){_0x21fc6e['push'](_0x21fc6e['shift']());}};_0x5681ce(++_0x253a40);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 5d162e8..3ef7043 100644 --- a/server/api/user/user.controller.js +++ b/server/api/user/user.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec46=['device','LOGININPAUSE','concat','resolve','logout','pause','QueuePause','updateAttributes','PAUSE','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','pauseType','fax','sms','openchannel','manual','%s%s','Pause','getTeams','addTeams','omit','removeTeams','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$gt','$lt','$eq','$not','$notIn','$like','$notLike','$notILike','$overlap','$contained','firstName','lastName','phone','Contact','retrieveApiKey','No\x20API\x20access\x20key\x20found!','generateApiKey','apiKeyNonce','apiKeyIat','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','removeApiKey','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','redis','./user.socket','register','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','User,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','user','Agents','Telephones','telephone','value','role','find','name','UserProfileResource','sendStatus','send','index','User','rawAttributes','model','differenceBy','keys','password','query','filters','attributes','intersection','fields','length','nolimit','limit','sort','pick','where','map','type','key','VIRTUAL','sequelize','lower','col','filter','merge','options','includeAll','findAll','catch','show','salt','include','bulkCreate','body','describe','addContacts','params','ids','agent','agent\x20role','../../config/license/util','getLicense','telephones','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','internal','Setting','findById','securePassword','min_internal','max','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','fullname','102','103','110','105','108','109','100','111','create','VoiceMail','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','admin','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','channel','online','loginInPause','voicePause','Unknown\x20channel','add','toLowerCase','penalty','spread','capitalize','QueueId','voice','VoiceQueue','interface','SIP/%s','each','UserVoiceQueueRt','remove','Queues','emit','Queue:remove','userpic','file','filename','getAvatar','join','root','download','existsSync','server/files/images/','getContacts','CmContact','order','Tags','color','tag','hasOwnProperty','getQueues','isValidChannel','Queue','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','rows','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','login','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','socket','remoteAddress','push','upsert','MemberReport','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','forEach','LOGIN'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xec46,0x19c));var _0x6ec4=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0xec46[_0x51cc1d];return _0x2eb9f2;};'use strict';var pdf=require(_0x6ec4('0x0'));var emlformat=require(_0x6ec4('0x1'));var rimraf=require(_0x6ec4('0x2'));var zipdir=require(_0x6ec4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ec4('0x4'));var BPromise=require(_0x6ec4('0x5'));var Mustache=require(_0x6ec4('0x6'));var util=require('util');var path=require(_0x6ec4('0x7'));var sox=require(_0x6ec4('0x8'));var csv=require('to-csv');var ejs=require(_0x6ec4('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6ec4('0xa'));var crypto=require(_0x6ec4('0xb'));var jsforce=require(_0x6ec4('0xc'));var deskjs=require(_0x6ec4('0xd'));var toCsv=require(_0x6ec4('0xe'));var querystring=require(_0x6ec4('0xf'));var Papa=require(_0x6ec4('0x10'));var Redis=require(_0x6ec4('0x11'));var authService=require(_0x6ec4('0x12'));var qs=require(_0x6ec4('0x13'));var hardwareService=require(_0x6ec4('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x6ec4('0x15'));var config=require(_0x6ec4('0x16'));var db=require(_0x6ec4('0x17'))['db'];config['redis']=_[_0x6ec4('0x18')](config['redis'],{'host':_0x6ec4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6ec4('0x1a')]));require(_0x6ec4('0x1b'))[_0x6ec4('0x1c')](socket);var jayson=require(_0x6ec4('0x1d'));var client=jayson[_0x6ec4('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x472907,_0x3368e9,_0x43d7f8){if(_0x43d7f8){var _0x272d71=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x272d71[_0x6ec4('0x1f')](_0x3368e9)){return _0x472907;}else{throw new Error(_0x6ec4('0x20'));}}else{return _0x472907;}}function respondWithRpcPromise(_0x17704d,_0x1f2ef7,_0x19ffc8,_0x477b3d){return new BPromise(function(_0x1b7c00,_0x57825d){var _0x327724=_0x477b3d||client;return _0x327724['request'](_0x17704d,_0x19ffc8)['then'](function(_0x42799c){logger['info'](_0x6ec4('0x21'),_0x1f2ef7,_0x6ec4('0x22'));logger[_0x6ec4('0x23')]('User,\x20%s,\x20%s,\x20%s',_0x1f2ef7,_0x6ec4('0x22'),JSON['stringify'](_0x42799c));if(_0x42799c['error']){if(_0x42799c[_0x6ec4('0x24')][_0x6ec4('0x25')]===0x1f4){logger['error'](_0x6ec4('0x21'),_0x1f2ef7,_0x42799c[_0x6ec4('0x24')][_0x6ec4('0x26')]);return _0x57825d(_0x42799c[_0x6ec4('0x24')]['message']);}logger[_0x6ec4('0x24')]('User,\x20%s,\x20%s',_0x1f2ef7,_0x42799c['error'][_0x6ec4('0x26')]);return _0x1b7c00(_0x42799c[_0x6ec4('0x24')][_0x6ec4('0x26')]);}else{logger[_0x6ec4('0x27')](_0x6ec4('0x21'),_0x1f2ef7,'request\x20sent');_0x1b7c00(_0x42799c['result'][_0x6ec4('0x26')]);}})['catch'](function(_0x1bc94e){logger['error'](_0x6ec4('0x21'),_0x1f2ef7,_0x1bc94e);_0x57825d(_0x1bc94e);});});}function respondWithStatusCode(_0x4dc97d,_0x239430){_0x239430=_0x239430||0xcc;return function(_0x4e20d6){if(_0x4e20d6){return _0x4dc97d['sendStatus'](_0x239430);}return _0x4dc97d[_0x6ec4('0x28')](_0x239430)['end']();};}function respondWithResult(_0x12a346,_0x2a9400){_0x2a9400=_0x2a9400||0xc8;return function(_0x3eb808){if(_0x3eb808){return _0x12a346[_0x6ec4('0x28')](_0x2a9400)[_0x6ec4('0x29')](_0x3eb808);}};}function respondWithFilteredResult(_0x486951,_0x1ada63){return function(_0x29cd10){if(_0x29cd10){var _0x1bab80=_0x29cd10[_0x6ec4('0x2a')],_0x3c7cc7=_0x1ada63[_0x6ec4('0x2b')],_0x5dae20=_0x1ada63[_0x6ec4('0x2b')]+_0x1ada63['limit'],_0x263e88;if(_0x5dae20>=_0x1bab80){_0x5dae20=_0x1bab80;_0x263e88=0xc8;}else{_0x263e88=0xce;}_0x486951['status'](_0x263e88);return _0x486951[_0x6ec4('0x2c')](_0x6ec4('0x2d'),_0x3c7cc7+'-'+_0x5dae20+'/'+_0x1bab80)['json'](_0x29cd10);}return null;};}function patchUpdates(_0x1ebb45){return function(_0x5bfc1d){try{jsonpatch[_0x6ec4('0x2e')](_0x5bfc1d,_0x1ebb45,!![]);}catch(_0x9de8e6){return BPromise[_0x6ec4('0x2f')](_0x9de8e6);}return _0x5bfc1d[_0x6ec4('0x30')]();};}function saveUpdates(_0x5d740e,_0x1fe385){return function(_0x28bb35){if(_0x28bb35){return _0x28bb35[_0x6ec4('0x31')](_0x5d740e)[_0x6ec4('0x32')](function(_0x215b66){return _0x215b66;});}return null;};}function removeEntity(_0x424966,_0x112459){return function(_0x126a00){if(_0x126a00){return _0x126a00[_0x6ec4('0x33')]()['then'](function(){var _0x80151d=_0x126a00[_0x6ec4('0x34')]({'plain':!![]});var _0xf26a21=[{'name':'Users','value':_0x6ec4('0x35'),'ignore':!![]},{'name':_0x6ec4('0x36'),'value':'agent','ignore':![]},{'name':_0x6ec4('0x37'),'value':_0x6ec4('0x38'),'ignore':![]}];var _0x584363=_(_0xf26a21)['filter']('ignore')['map']('value')[_0x6ec4('0x39')]();if(_['includes'](_0x584363,_0x80151d[_0x6ec4('0x3a')])){return;}var _0x5c3a17=_[_0x6ec4('0x3b')](_0xf26a21,[_0x6ec4('0x39'),_0x80151d['role']])[_0x6ec4('0x3c')];return db[_0x6ec4('0x3d')]['destroy']({'where':{'type':_0x5c3a17,'resourceId':_0x80151d['id']}})[_0x6ec4('0x32')](function(){return _0x126a00;});})['then'](function(){_0x424966[_0x6ec4('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb56dd6,_0x35a618){return function(_0xf89437){if(!_0xf89437){_0xb56dd6[_0x6ec4('0x3e')](0x194);}return _0xf89437;};}function handleError(_0xd5867d,_0x14a62e){_0x14a62e=_0x14a62e||0x1f4;return function(_0xf96403){logger[_0x6ec4('0x24')](_0xf96403['stack']);if(_0xf96403[_0x6ec4('0x3c')]){delete _0xf96403[_0x6ec4('0x3c')];}_0xd5867d[_0x6ec4('0x28')](_0x14a62e)[_0x6ec4('0x3f')](_0xf96403);};}exports[_0x6ec4('0x40')]=function(_0x2e6435,_0x43eef7){var _0x2f85a9={},_0x426cb8={},_0x528c91={'count':0x0,'rows':[]};var _0x2ba5e8=db[_0x6ec4('0x41')][_0x6ec4('0x42')];_0x426cb8[_0x6ec4('0x43')]=_[_0x6ec4('0x44')](_[_0x6ec4('0x45')](_0x2ba5e8),[_0x6ec4('0x46'),'salt']);_0x426cb8[_0x6ec4('0x47')]=_['keys'](_0x2e6435['query']);_0x426cb8[_0x6ec4('0x48')]=_['intersection'](_0x426cb8[_0x6ec4('0x43')],_0x426cb8['query']);_0x2f85a9[_0x6ec4('0x49')]=_[_0x6ec4('0x4a')](_0x426cb8[_0x6ec4('0x43')],qs[_0x6ec4('0x4b')](_0x2e6435['query'][_0x6ec4('0x4b')]));_0x2f85a9[_0x6ec4('0x49')]=_0x2f85a9[_0x6ec4('0x49')][_0x6ec4('0x4c')]?_0x2f85a9[_0x6ec4('0x49')]:_0x426cb8[_0x6ec4('0x43')];if(!_0x2e6435[_0x6ec4('0x47')]['hasOwnProperty'](_0x6ec4('0x4d'))){_0x2f85a9['limit']=qs[_0x6ec4('0x4e')](_0x2e6435[_0x6ec4('0x47')][_0x6ec4('0x4e')]);_0x2f85a9[_0x6ec4('0x2b')]=qs['offset'](_0x2e6435['query']['offset']);}_0x2f85a9['order']=qs[_0x6ec4('0x4f')](_0x2e6435[_0x6ec4('0x47')][_0x6ec4('0x4f')]);_0x2f85a9['where']=qs['filters'](_[_0x6ec4('0x50')](_0x2e6435[_0x6ec4('0x47')],_0x426cb8[_0x6ec4('0x48')]));if(_0x2e6435[_0x6ec4('0x47')]['filter']){_0x2f85a9[_0x6ec4('0x51')]=_['merge'](_0x2f85a9[_0x6ec4('0x51')],{'$or':_[_0x6ec4('0x52')](_0x2ba5e8,function(_0x30bc55){if(_0x30bc55[_0x6ec4('0x53')][_0x6ec4('0x54')]!==_0x6ec4('0x55')){return db['sequelize']['where'](db[_0x6ec4('0x56')]['fn'](_0x6ec4('0x57'),db[_0x6ec4('0x56')][_0x6ec4('0x58')](_0x30bc55['field'])),{'$like':db[_0x6ec4('0x56')]['fn']('lower','%'+_0x2e6435[_0x6ec4('0x47')][_0x6ec4('0x59')]+'%')});}})});}_0x2f85a9=_[_0x6ec4('0x5a')]({},_0x2f85a9,_0x2e6435[_0x6ec4('0x5b')]);var _0x21e8a5={'where':_0x2f85a9[_0x6ec4('0x51')]};return db[_0x6ec4('0x41')][_0x6ec4('0x2a')](_0x21e8a5)[_0x6ec4('0x32')](function(_0x36538e){_0x528c91[_0x6ec4('0x2a')]=_0x36538e;if(_0x2e6435['query'][_0x6ec4('0x5c')]){_0x2f85a9['include']=[{'all':!![]}];}return db[_0x6ec4('0x41')][_0x6ec4('0x5d')](_0x2f85a9);})[_0x6ec4('0x32')](function(_0x228e7c){_0x528c91['rows']=_0x228e7c;return _0x528c91;})[_0x6ec4('0x32')](respondWithFilteredResult(_0x43eef7,_0x2f85a9))[_0x6ec4('0x5e')](handleError(_0x43eef7,null));};exports[_0x6ec4('0x5f')]=function(_0x1b00e4,_0x2cdd9a){var _0x30c31e={'raw':![],'where':{'id':_0x1b00e4['params']['id']}},_0x50b41c={};_0x50b41c[_0x6ec4('0x43')]=_[_0x6ec4('0x44')](_[_0x6ec4('0x45')](db[_0x6ec4('0x41')][_0x6ec4('0x42')]),[_0x6ec4('0x46'),_0x6ec4('0x60')]);_0x50b41c['query']=_[_0x6ec4('0x45')](_0x1b00e4[_0x6ec4('0x47')]);_0x50b41c[_0x6ec4('0x48')]=_['intersection'](_0x50b41c['model'],_0x50b41c['query']);_0x30c31e[_0x6ec4('0x49')]=_[_0x6ec4('0x4a')](_0x50b41c[_0x6ec4('0x43')],qs[_0x6ec4('0x4b')](_0x1b00e4[_0x6ec4('0x47')][_0x6ec4('0x4b')]));_0x30c31e['attributes']=_0x30c31e[_0x6ec4('0x49')][_0x6ec4('0x4c')]?_0x30c31e[_0x6ec4('0x49')]:_0x50b41c['model'];if(_0x1b00e4[_0x6ec4('0x47')][_0x6ec4('0x5c')]){_0x30c31e[_0x6ec4('0x61')]=[{'all':!![]}];}_0x30c31e=_['merge']({},_0x30c31e,_0x1b00e4[_0x6ec4('0x5b')]);return db[_0x6ec4('0x41')][_0x6ec4('0x3b')](_0x30c31e)[_0x6ec4('0x32')](handleEntityNotFound(_0x2cdd9a,null))[_0x6ec4('0x32')](respondWithResult(_0x2cdd9a,null))[_0x6ec4('0x5e')](handleError(_0x2cdd9a,null));};exports[_0x6ec4('0x62')]=function(_0x3c949f,_0xcc6695){return db[_0x6ec4('0x41')]['bulkCreate'](_0x3c949f[_0x6ec4('0x63')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xcc6695,0xc9))[_0x6ec4('0x5e')](handleError(_0xcc6695,null));};exports[_0x6ec4('0x31')]=function(_0x41995a,_0x4ab2e6){if(_0x41995a[_0x6ec4('0x63')]['id']){delete _0x41995a['body']['id'];}delete _0x41995a[_0x6ec4('0x63')][_0x6ec4('0x3a')];return db['User']['find']({'where':{'id':_0x41995a['params']['id']}})['then'](handleEntityNotFound(_0x4ab2e6,null))[_0x6ec4('0x32')](saveUpdates(_0x41995a['body'],null))[_0x6ec4('0x32')](respondWithResult(_0x4ab2e6,null))[_0x6ec4('0x5e')](handleError(_0x4ab2e6,null));};exports['describe']=function(_0x11da3f,_0x565ddf){return db['User'][_0x6ec4('0x64')]()[_0x6ec4('0x32')](respondWithResult(_0x565ddf,null))[_0x6ec4('0x5e')](handleError(_0x565ddf,null));};exports[_0x6ec4('0x65')]=function(_0x26e975,_0x73b908,_0x1a3b4f){return db['User'][_0x6ec4('0x3b')]({'where':{'id':_0x26e975[_0x6ec4('0x66')]['id']}})[_0x6ec4('0x32')](handleEntityNotFound(_0x73b908,null))[_0x6ec4('0x32')](function(_0x1b5643){if(_0x1b5643){return _0x1b5643[_0x6ec4('0x65')](_0x26e975[_0x6ec4('0x63')][_0x6ec4('0x67')],_['omit'](_0x26e975[_0x6ec4('0x63')],[_0x6ec4('0x67'),'id'])||{});}})[_0x6ec4('0x32')](respondWithResult(_0x73b908,null))[_0x6ec4('0x5e')](handleError(_0x73b908,null));};var getLicense=function(_0x1c16c5){return new BPromise(function(_0x5492a1,_0x368b47){var _0x24de00=0x0;_0x1c16c5[_0x6ec4('0x63')][_0x6ec4('0x3a')]===_0x6ec4('0x68')&&_0x5492a1(_0x6ec4('0x69'));return db[_0x6ec4('0x41')][_0x6ec4('0x2a')]({'where':{'$or':[{'role':_0x1c16c5['body'][_0x6ec4('0x3a')]===_0x6ec4('0x38')?_0x6ec4('0x38'):['admin',_0x6ec4('0x35')]}]}})[_0x6ec4('0x32')](function(_0x592e30){_0x24de00=_0x592e30;return require(_0x6ec4('0x6a'))[_0x6ec4('0x6b')]();})[_0x6ec4('0x32')](function(_0x3d591a){var _0x18ccda=_0x1c16c5[_0x6ec4('0x63')]['role']===_0x6ec4('0x38')?_0x6ec4('0x6c'):'users';if(!_[_0x6ec4('0x6d')](_0x3d591a[_0x18ccda])&&_0x24de00>=_0x3d591a[_0x18ccda]){return _0x368b47({'message':_0x6ec4('0x6e')});}return _0x5492a1(util[_0x6ec4('0x6f')](_0x6ec4('0x70'),_0x18ccda,_0x24de00));})[_0x6ec4('0x5e')](function(_0x4be917){return _0x368b47(_0x4be917);});});};exports['create']=function(_0x43b979,_0x5b9405){return getLicense(_0x43b979)[_0x6ec4('0x32')](function(_0x2f360a){if(!_0x43b979[_0x6ec4('0x63')][_0x6ec4('0x71')]){var _0x294848;return db[_0x6ec4('0x72')][_0x6ec4('0x73')](0x1)[_0x6ec4('0x32')](function(_0x1f3ffc){return checkPasswordPattern(_0x1f3ffc,_0x43b979[_0x6ec4('0x63')][_0x6ec4('0x46')],_0x1f3ffc[_0x6ec4('0x74')]);})[_0x6ec4('0x32')](function(_0x16ded0){_0x294848=_0x16ded0[_0x6ec4('0x75')];return db[_0x6ec4('0x41')][_0x6ec4('0x76')]('internal');})['then'](function(_0x3537d4){if(_['isNil'](_0x3537d4)){if(_0x294848){_0x43b979[_0x6ec4('0x63')][_0x6ec4('0x71')]=_0x294848;}else{_0x43b979[_0x6ec4('0x63')][_0x6ec4('0x71')]=0x1;}}else{if(_[_0x6ec4('0x6d')](_0x294848)||_0x294848==_0x3537d4){_0x43b979['body'][_0x6ec4('0x71')]=_0x3537d4+0x1;}else if(_0x294848>_0x3537d4){_0x43b979['body']['internal']=_0x294848;}else{return db[_0x6ec4('0x56')][_0x6ec4('0x47')](_0x6ec4('0x77'),{'type':db[_0x6ec4('0x56')][_0x6ec4('0x78')][_0x6ec4('0x79')]})['then'](function(_0xdb3f43){if(_0xdb3f43&&_0xdb3f43[_0x6ec4('0x4c')]){for(var _0x2db296=0x0,_0x455f5e=_0xdb3f43[_0x6ec4('0x4c')];_0x2db296<_0x455f5e&&_[_0x6ec4('0x6d')](_0x43b979[_0x6ec4('0x63')][_0x6ec4('0x71')]);_0x2db296++){if(_0x294848<=_0xdb3f43[_0x2db296]['from']){_0x43b979['body'][_0x6ec4('0x71')]=_0xdb3f43[_0x2db296][_0x6ec4('0x7a')];}else if(_0x294848>_0xdb3f43[_0x2db296][_0x6ec4('0x7a')]&&_0x294848<=_0xdb3f43[_0x2db296]['to']){_0x43b979[_0x6ec4('0x63')]['internal']=_0x294848;}}}if(_[_0x6ec4('0x6d')](_0x43b979[_0x6ec4('0x63')][_0x6ec4('0x71')])){_0x43b979[_0x6ec4('0x63')][_0x6ec4('0x71')]=_0x3537d4+0x1;}});}}});}})['then'](function(){if(_0x43b979[_0x6ec4('0x63')]['voicemail']){_0x43b979[_0x6ec4('0x63')]['mailbox']=_0x43b979['body'][_0x6ec4('0x71')];_0x43b979['body']['VoiceMail']={'mailbox':_0x43b979[_0x6ec4('0x63')][_0x6ec4('0x71')],'password':_0x43b979[_0x6ec4('0x63')][_0x6ec4('0x46')],'fullname':_0x43b979[_0x6ec4('0x63')][_0x6ec4('0x7b')],'email':_0x43b979[_0x6ec4('0x63')]['email']};}if(_0x43b979[_0x6ec4('0x63')]&&_0x43b979[_0x6ec4('0x63')]['role']==='agent'){_0x43b979[_0x6ec4('0x63')]['permissions']=['101',_0x6ec4('0x7c'),_0x6ec4('0x7d'),_0x6ec4('0x7e'),'104',_0x6ec4('0x7f'),'106','107',_0x6ec4('0x80'),_0x6ec4('0x81'),_0x6ec4('0x82'),_0x6ec4('0x83')];}return db[_0x6ec4('0x41')][_0x6ec4('0x84')](_0x43b979[_0x6ec4('0x63')],{'include':[{'model':db[_0x6ec4('0x85')],'as':_0x6ec4('0x85')}]});})[_0x6ec4('0x32')](function(_0x26a967){if(_0x43b979[_0x6ec4('0x63')][_0x6ec4('0x3a')]===_0x6ec4('0x35'))return _0x26a967;var _0x135388=_0x43b979[_0x6ec4('0x35')][_0x6ec4('0x34')]({'plain':!![]});if(!_0x135388)throw new Error(_0x6ec4('0x86'));if(_0x135388[_0x6ec4('0x3a')]===_0x6ec4('0x35')){var _0x24d58e=_0x26a967[_0x6ec4('0x34')]({'plain':!![]});var _0x26bf2f=[{'name':_0x6ec4('0x36'),'value':_0x6ec4('0x68')},{'name':_0x6ec4('0x37'),'value':_0x6ec4('0x38')}];var _0x3e819c=_[_0x6ec4('0x3b')](_0x26bf2f,[_0x6ec4('0x39'),_0x24d58e[_0x6ec4('0x3a')]])[_0x6ec4('0x3c')];return db[_0x6ec4('0x87')][_0x6ec4('0x3b')]({'where':{'name':_0x3e819c,'userProfileId':_0x135388['userProfileId']},'raw':!![]})[_0x6ec4('0x32')](function(_0x49e8fa){if(_0x49e8fa&&_0x49e8fa[_0x6ec4('0x88')]===0x0){return db[_0x6ec4('0x3d')]['create']({'name':_0x24d58e['name'],'resourceId':_0x24d58e['id'],'type':_0x49e8fa['name'],'sectionId':_0x49e8fa['id']},{})[_0x6ec4('0x32')](function(){return _0x26a967;});}else{return _0x26a967;}})[_0x6ec4('0x5e')](function(_0x1e0770){logger[_0x6ec4('0x24')](_0x6ec4('0x89'),_0x1e0770);throw _0x1e0770;});}return _0x26a967;})[_0x6ec4('0x32')](respondWithResult(_0x5b9405,0xc9))['catch'](handleError(_0x5b9405,null));};exports['changePassword']=function(_0x26be72,_0x39014f,_0x1afd22){var _0x8d4c29=![];if(_0x26be72[_0x6ec4('0x63')]['id']){delete _0x26be72[_0x6ec4('0x63')]['id'];}if(!_[_0x6ec4('0x6d')](_0x26be72[_0x6ec4('0x63')][_0x6ec4('0x8a')])){if(_0x26be72[_0x6ec4('0x63')][_0x6ec4('0x8a')]===_0x26be72[_0x6ec4('0x63')][_0x6ec4('0x8b')]){throw new Error('New\x20password\x20must\x20be\x20different\x20from\x20old\x20one');}}return db[_0x6ec4('0x41')][_0x6ec4('0x3b')]({'where':{'id':_0x26be72['params']['id']}})[_0x6ec4('0x32')](function(_0x366729){if(_0x366729){if(_0x366729['id']==_0x26be72[_0x6ec4('0x35')]['id']){if(!_0x26be72[_0x6ec4('0x63')][_0x6ec4('0x8a')]||!_0x26be72[_0x6ec4('0x63')][_0x6ec4('0x8b')]){throw new db[(_0x6ec4('0x8c'))][(_0x6ec4('0x8d'))](_0x6ec4('0x8e'));}if(!_0x366729[_0x6ec4('0x8f')](_0x26be72[_0x6ec4('0x63')][_0x6ec4('0x8a')])){throw new db[(_0x6ec4('0x8c'))][(_0x6ec4('0x8d'))](_0x6ec4('0x90'));}if(_0x26be72['body'][_0x6ec4('0x8a')]==_0x26be72[_0x6ec4('0x63')][_0x6ec4('0x8b')]){throw new db['Sequelize'][(_0x6ec4('0x8d'))](_0x6ec4('0x91'));}return _0x366729;}else if(_0x26be72[_0x6ec4('0x35')][_0x6ec4('0x3a')]==_0x6ec4('0x92')){if(!_0x26be72[_0x6ec4('0x63')]['newPassword']){throw new db[(_0x6ec4('0x8c'))][(_0x6ec4('0x8d'))](_0x6ec4('0x93'));}return _0x366729;}else if(_0x26be72[_0x6ec4('0x35')][_0x6ec4('0x3a')]==_0x6ec4('0x35')){if(!_0x26be72[_0x6ec4('0x63')][_0x6ec4('0x8b')]){throw new db[(_0x6ec4('0x8c'))][(_0x6ec4('0x8d'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x366729['role']!=_0x6ec4('0x68')){throw new db[(_0x6ec4('0x8c'))][(_0x6ec4('0x8d'))](_0x6ec4('0x94'));}return _0x366729;}else{throw new db[(_0x6ec4('0x8c'))][(_0x6ec4('0x8d'))](_0x6ec4('0x94'));}}return null;})[_0x6ec4('0x32')](handleEntityNotFound(_0x39014f,null))[_0x6ec4('0x32')](function(_0x2db00e){return db['Setting'][_0x6ec4('0x95')]({'attributes':['id',_0x6ec4('0x74')]})[_0x6ec4('0x32')](function(_0x4bec87){_0x8d4c29=_0x4bec87[_0x6ec4('0x74')];return checkPasswordPattern(_0x2db00e,_0x26be72['body'][_0x6ec4('0x8b')],_0x8d4c29);});})[_0x6ec4('0x32')](saveUpdates({'password':_0x26be72['body']['newPassword'],'passwordResetAt':_0x26be72['user']['id']==_0x26be72[_0x6ec4('0x66')]['id']?moment():null},null))['then'](respondWithResult(_0x39014f,null))['catch'](handleError(_0x39014f,null));};exports['addQueues']=function(_0x2a2a7f,_0x178d85,_0x461607){var _0x24930d=_0x2a2a7f[_0x6ec4('0x63')][_0x6ec4('0x96')];return db['User'][_0x6ec4('0x3b')]({'where':{'id':_0x2a2a7f[_0x6ec4('0x66')]['id']},'attributes':['id','name',_0x6ec4('0x3a'),_0x6ec4('0x97'),_0x6ec4('0x98'),_0x6ec4('0x99'),'interface']})[_0x6ec4('0x32')](handleEntityNotFound(_0x178d85,null))['then'](function(_0x2b5e63){if(_0x2b5e63){if(!utils['isValidChannel'](_0x24930d)){throw new db[(_0x6ec4('0x8c'))][(_0x6ec4('0x8d'))](_0x6ec4('0x9a'));}return _0x2b5e63[_0x6ec4('0x9b')+_['capitalize'](_0x24930d[_0x6ec4('0x9c')]())+'Queues'](_0x2a2a7f[_0x6ec4('0x63')][_0x6ec4('0x67')],{'penalty':_0x2a2a7f['body'][_0x6ec4('0x9d')]||0x0})[_0x6ec4('0x9e')](function(_0x3dfee7){for(var _0x119c6b=0x0;_0x119c6b<_0x2a2a7f[_0x6ec4('0x63')]['ids'][_0x6ec4('0x4c')];_0x119c6b+=0x1){var _0x237687={'UserId':_0x2a2a7f['params']['id']};_0x237687[_[_0x6ec4('0x9f')](_0x24930d[_0x6ec4('0x9c')]())+_0x6ec4('0xa0')]=_0x2a2a7f[_0x6ec4('0x63')][_0x6ec4('0x67')][_0x119c6b];socket['emit'](_0x6ec4('0x35')+_[_0x6ec4('0x9f')](_0x24930d[_0x6ec4('0x9c')]())+'Queue:save',_0x237687);}return _0x3dfee7;})[_0x6ec4('0x32')](function(){if(_0x24930d===_0x6ec4('0xa1')){return db[_0x6ec4('0xa2')]['findAll']({'where':{'id':_0x2a2a7f[_0x6ec4('0x63')][_0x6ec4('0x67')]||[]},'raw':!![],'attributes':['id',_0x6ec4('0x3c')]});}})[_0x6ec4('0x32')](function(_0x49619a){var _0x1f9944=_0x2b5e63[_0x6ec4('0x34')]({'plain':!![]});var _0x51c372=[];if(_0x24930d===_0x6ec4('0xa1')&&_0x1f9944[_0x6ec4('0x3a')]===_0x6ec4('0x68')&&_0x1f9944['online']){for(var _0x53f998=0x0;_0x53f998<_0x49619a[_0x6ec4('0x4c')];_0x53f998+=0x1){_0x51c372['push']({'membername':_0x1f9944['name'],'UserId':_0x1f9944['id'],'queue_name':_0x49619a[_0x53f998][_0x6ec4('0x3c')],'VoiceQueueId':_0x49619a[_0x53f998]['id'],'interface':_[_0x6ec4('0x6d')](_0x1f9944[_0x6ec4('0xa3')])?util[_0x6ec4('0x6f')](_0x6ec4('0xa4'),_0x1f9944[_0x6ec4('0x3c')]):_0x1f9944['interface'],'paused':_0x1f9944[_0x6ec4('0x99')]||![],'penalty':_0x2a2a7f['body']['penalty']||0x0});}return BPromise[_0x6ec4('0xa5')](_0x51c372,function(_0x26d1c1){return db[_0x6ec4('0xa6')]['upsert'](_0x26d1c1);});}return _0x2b5e63;});}})[_0x6ec4('0x32')](respondWithStatusCode(_0x178d85,null))[_0x6ec4('0x5e')](handleError(_0x178d85,null));};exports['removeQueues']=function(_0x1d2235,_0x3c593a,_0x342862){var _0x578a39;return db[_0x6ec4('0x41')][_0x6ec4('0x3b')]({'where':{'id':_0x1d2235[_0x6ec4('0x66')]['id']},'attributes':['id','name','role']})[_0x6ec4('0x32')](handleEntityNotFound(_0x3c593a,null))[_0x6ec4('0x32')](function(_0x18917b){if(_0x18917b){_0x578a39=_0x18917b;if(!_0x1d2235[_0x6ec4('0x47')][_0x6ec4('0x96')]||!utils['isValidChannel'](_0x1d2235[_0x6ec4('0x47')][_0x6ec4('0x96')])){throw new db[(_0x6ec4('0x8c'))][(_0x6ec4('0x8d'))](_0x6ec4('0x9a'));}return _0x18917b[_0x6ec4('0xa7')+_['capitalize'](_0x1d2235[_0x6ec4('0x47')][_0x6ec4('0x96')][_0x6ec4('0x9c')]())+_0x6ec4('0xa8')](_0x1d2235[_0x6ec4('0x47')]['ids']);}})[_0x6ec4('0x32')](function(_0x4f1533){for(var _0xf368c6=0x0;_0xf368c6<_0x1d2235[_0x6ec4('0x47')][_0x6ec4('0x67')][_0x6ec4('0x4c')];_0xf368c6+=0x1){var _0x4f64f2={'UserId':_0x1d2235[_0x6ec4('0x66')]['id']};_0x4f64f2[_[_0x6ec4('0x9f')](_0x1d2235['query'][_0x6ec4('0x96')][_0x6ec4('0x9c')]())+_0x6ec4('0xa0')]=_0x1d2235['query'][_0x6ec4('0x67')][_0xf368c6];socket[_0x6ec4('0xa9')](_0x6ec4('0x35')+_[_0x6ec4('0x9f')](_0x1d2235['query'][_0x6ec4('0x96')]['toLowerCase']())+_0x6ec4('0xaa'),_0x4f64f2);}return _0x4f1533;})[_0x6ec4('0x32')](function(){if(_0x1d2235[_0x6ec4('0x47')][_0x6ec4('0x96')]===_0x6ec4('0xa1')){return db['UserVoiceQueueRt'][_0x6ec4('0x33')]({'where':{'UserId':_0x1d2235[_0x6ec4('0x66')]['id'],'VoiceQueueId':_0x1d2235[_0x6ec4('0x47')][_0x6ec4('0x67')]},'individualHooks':!![]})[_0x6ec4('0x32')](function(){return _0x578a39;});}return _0x578a39;})[_0x6ec4('0x32')](respondWithStatusCode(_0x3c593a,null))[_0x6ec4('0x5e')](handleError(_0x3c593a,null));};exports['addAvatar']=function(_0x56fd00,_0x5550ee,_0x429d42){_0x56fd00['body'][_0x6ec4('0xab')]=_0x56fd00[_0x6ec4('0xac')][_0x6ec4('0xad')];return db[_0x6ec4('0x41')][_0x6ec4('0x3b')]({'where':{'id':_0x56fd00[_0x6ec4('0x66')]['id']}})[_0x6ec4('0x32')](handleEntityNotFound(_0x5550ee,null))[_0x6ec4('0x32')](saveUpdates(_0x56fd00[_0x6ec4('0x63')],null))['then'](respondWithResult(_0x5550ee,null))[_0x6ec4('0x5e')](handleError(_0x5550ee,null));};exports[_0x6ec4('0xae')]=function(_0x58bd5a,_0x364ae4,_0x13ec04){var _0x593382=path[_0x6ec4('0xaf')](config[_0x6ec4('0xb0')],'server/files/images/logos/default_profile.png');return db['User']['find']({'where':{'id':_0x58bd5a[_0x6ec4('0x66')]['id']},'attributes':['id',_0x6ec4('0xab')],'raw':!![]})[_0x6ec4('0x32')](handleEntityNotFound(_0x364ae4,null))[_0x6ec4('0x32')](function(_0x2c308b){if(_0x2c308b){if(_['isNil'](_0x2c308b[_0x6ec4('0xab')])){return _0x364ae4[_0x6ec4('0xb1')](_0x593382);}else{if(!fs[_0x6ec4('0xb2')](path[_0x6ec4('0xaf')](config[_0x6ec4('0xb0')],_0x6ec4('0xb3'),_0x2c308b['userpic']))){return _0x364ae4[_0x6ec4('0xb1')](_0x593382);}return _0x364ae4[_0x6ec4('0xb1')](path[_0x6ec4('0xaf')](config['root'],_0x6ec4('0xb3'),_0x2c308b['userpic']));}}})['catch'](handleError(_0x364ae4,null));};exports[_0x6ec4('0xb4')]=function(_0x47368f,_0xccca98,_0x419f1b){var _0x184619={};var _0x3541f8={};var _0x21cb51;var _0x1ada1c;return db[_0x6ec4('0x41')]['findOne']({'where':{'id':_0x47368f[_0x6ec4('0x66')]['id']}})[_0x6ec4('0x32')](handleEntityNotFound(_0xccca98,null))[_0x6ec4('0x32')](function(_0x196599){if(_0x196599){_0x21cb51=_0x196599;_0x3541f8['model']=_[_0x6ec4('0x45')](db[_0x6ec4('0xb5')][_0x6ec4('0x42')]);_0x3541f8[_0x6ec4('0x47')]=_['keys'](_0x47368f[_0x6ec4('0x47')]);_0x3541f8[_0x6ec4('0x48')]=_[_0x6ec4('0x4a')](_0x3541f8[_0x6ec4('0x43')],_0x3541f8['query']);_0x184619[_0x6ec4('0x49')]=_[_0x6ec4('0x4a')](_0x3541f8['model'],qs[_0x6ec4('0x4b')](_0x47368f[_0x6ec4('0x47')][_0x6ec4('0x4b')]));_0x184619[_0x6ec4('0x49')]=_0x184619[_0x6ec4('0x49')][_0x6ec4('0x4c')]?_0x184619['attributes']:_0x3541f8[_0x6ec4('0x43')];_0x184619[_0x6ec4('0xb6')]=qs['sort'](_0x47368f[_0x6ec4('0x47')][_0x6ec4('0x4f')]);_0x184619[_0x6ec4('0x51')]=qs[_0x6ec4('0x48')](_[_0x6ec4('0x50')](_0x47368f[_0x6ec4('0x47')],_0x3541f8['filters']));if(_0x47368f[_0x6ec4('0x47')]['filter']){_0x184619[_0x6ec4('0x51')]=_[_0x6ec4('0x5a')](_0x184619[_0x6ec4('0x51')],{'$or':_[_0x6ec4('0x52')](_0x184619[_0x6ec4('0x49')],function(_0x36d6ba){var _0x309a99={};_0x309a99[_0x36d6ba]={'$like':'%'+_0x47368f[_0x6ec4('0x47')][_0x6ec4('0x59')]+'%'};return _0x309a99;})});}_0x184619=_[_0x6ec4('0x5a')]({},_0x184619,_0x47368f['options']);return _0x21cb51[_0x6ec4('0xb4')](_0x184619);}})[_0x6ec4('0x32')](function(_0x2ee46c){if(_0x2ee46c){_0x1ada1c=_0x2ee46c[_0x6ec4('0x4c')];if(_0x47368f[_0x6ec4('0x47')]['hasOwnProperty'](_0x6ec4('0x5c'))){_0x184619[_0x6ec4('0x61')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db['Tag'],'as':_0x6ec4('0xb7'),'attributes':['id',_0x6ec4('0x3c'),_0x6ec4('0xb8')],'where':_0x47368f[_0x6ec4('0x47')][_0x6ec4('0xb9')]?{'id':_0x47368f['query'][_0x6ec4('0xb9')]}:undefined,'required':_0x47368f[_0x6ec4('0x47')][_0x6ec4('0xb9')]?!![]:![]}];}if(!_0x47368f['query'][_0x6ec4('0xba')](_0x6ec4('0x4d'))){_0x184619['limit']=qs[_0x6ec4('0x4e')](_0x47368f[_0x6ec4('0x47')][_0x6ec4('0x4e')]);_0x184619[_0x6ec4('0x2b')]=qs[_0x6ec4('0x2b')](_0x47368f[_0x6ec4('0x47')][_0x6ec4('0x2b')]);}return _0x21cb51[_0x6ec4('0xb4')](_0x184619);}})[_0x6ec4('0x32')](function(_0x111e5d){if(_0x111e5d){return _0x111e5d?{'count':_0x1ada1c,'rows':_0x111e5d}:null;}})[_0x6ec4('0x32')](respondWithResult(_0xccca98,null))[_0x6ec4('0x5e')](handleError(_0xccca98,null));};exports[_0x6ec4('0xbb')]=function(_0x1cd459,_0x48ea19,_0xaa11e3){var _0x4d9412;var _0x2f2136;var _0x1b9451={};var _0x177e15;return db[_0x6ec4('0x41')][_0x6ec4('0x95')]({'where':{'id':_0x1cd459[_0x6ec4('0x66')]['id']},'attributes':['id',_0x6ec4('0x3c'),_0x6ec4('0x3a')]})['then'](handleEntityNotFound(_0x48ea19,null))['then'](function(_0x5a80a5){if(!utils[_0x6ec4('0xbc')](_0x1cd459[_0x6ec4('0x47')][_0x6ec4('0x96')])){throw new db[(_0x6ec4('0x8c'))][(_0x6ec4('0x8d'))]('Unknown\x20channel');}_0x4d9412=_0x5a80a5;var _0x127a77={};_0x127a77['model']=_[_0x6ec4('0x45')](db[_['capitalize'](_0x1cd459['query'][_0x6ec4('0x96')])+_0x6ec4('0xbd')][_0x6ec4('0x42')]);_0x127a77[_0x6ec4('0x47')]=_['keys'](_0x1cd459[_0x6ec4('0x47')]);_0x127a77[_0x6ec4('0x48')]=_[_0x6ec4('0x4a')](_0x127a77[_0x6ec4('0x43')],_0x127a77[_0x6ec4('0x47')]);_0x1b9451[_0x6ec4('0x49')]=_[_0x6ec4('0x4a')](_0x127a77[_0x6ec4('0x43')],qs[_0x6ec4('0x4b')](_0x1cd459[_0x6ec4('0x47')][_0x6ec4('0x4b')]));_0x1b9451[_0x6ec4('0x49')]=_0x1b9451[_0x6ec4('0x49')]['length']?_0x1b9451[_0x6ec4('0x49')]:_0x127a77['model'];_0x1b9451['order']=qs[_0x6ec4('0x4f')](_0x1cd459[_0x6ec4('0x47')][_0x6ec4('0x4f')]);_0x1b9451[_0x6ec4('0x51')]=qs['filters'](_[_0x6ec4('0x50')](_0x1cd459[_0x6ec4('0x47')],_0x127a77[_0x6ec4('0x48')]));if(_0x1cd459['query'][_0x6ec4('0x59')]){_0x1b9451[_0x6ec4('0x51')]=_[_0x6ec4('0x5a')](_0x1b9451['where'],{'$or':_[_0x6ec4('0x52')](_0x1b9451[_0x6ec4('0x49')],function(_0x3e26b9){var _0x5408ba={};_0x5408ba[_0x3e26b9]={'$like':'%'+_0x1cd459['query'][_0x6ec4('0x59')]+'%'};return _0x5408ba;})});}_0x1b9451=_[_0x6ec4('0x5a')]({},_0x1b9451,_0x1cd459[_0x6ec4('0x5b')]);switch(_0x4d9412[_0x6ec4('0x3a')]){case _0x6ec4('0x92'):return db[_[_0x6ec4('0x9f')](_0x1cd459[_0x6ec4('0x47')]['channel'])+_0x6ec4('0xbd')][_0x6ec4('0x5d')](_0x1b9451);case _0x6ec4('0x35'):case _0x6ec4('0x68'):return _0x4d9412[_0x6ec4('0x34')+_[_0x6ec4('0x9f')](_0x1cd459['query'][_0x6ec4('0x96')])+_0x6ec4('0xa8')](_0x1b9451);default:throw new db['Sequelize'][(_0x6ec4('0x8d'))]('Unknown\x20role');}})[_0x6ec4('0x32')](function(_0x51ac32){_0x177e15=_0x51ac32[_0x6ec4('0x4c')];if(!_0x1cd459['query'][_0x6ec4('0xba')]('nolimit')){_0x1b9451[_0x6ec4('0x4e')]=qs[_0x6ec4('0x4e')](_0x1cd459[_0x6ec4('0x47')][_0x6ec4('0x4e')]);_0x1b9451['offset']=qs['offset'](_0x1cd459[_0x6ec4('0x47')]['offset']);}switch(_0x4d9412[_0x6ec4('0x3a')]){case'admin':return db[_['capitalize'](_0x1cd459[_0x6ec4('0x47')][_0x6ec4('0x96')])+'Queue'][_0x6ec4('0x5d')](_0x1b9451);case _0x6ec4('0x35'):case _0x6ec4('0x68'):return _0x4d9412[_0x6ec4('0x34')+_['capitalize'](_0x1cd459[_0x6ec4('0x47')][_0x6ec4('0x96')])+_0x6ec4('0xa8')](_0x1b9451);}})[_0x6ec4('0x32')](function(_0x5615a8){return{'count':_0x177e15,'rows':_0x5615a8};})[_0x6ec4('0x32')](respondWithResult(_0x48ea19,null))[_0x6ec4('0x5e')](handleError(_0x48ea19,null));};exports[_0x6ec4('0xbe')]=function(_0x3a8971,_0x470527,_0x571ab2){var _0xa15114={};var _0x12c065={};var _0x665b8;var _0x84e158;return db[_0x6ec4('0x41')][_0x6ec4('0x95')]({'where':{'id':_0x3a8971[_0x6ec4('0x66')]['id']}})['then'](handleEntityNotFound(_0x470527,null))[_0x6ec4('0x32')](function(_0x384b08){if(_0x384b08){_0x665b8=_0x384b08;_0x12c065['model']=_[_0x6ec4('0x45')](db[_0x6ec4('0xa6')][_0x6ec4('0x42')]);_0x12c065[_0x6ec4('0x47')]=_[_0x6ec4('0x45')](_0x3a8971[_0x6ec4('0x47')]);_0x12c065[_0x6ec4('0x48')]=_[_0x6ec4('0x4a')](_0x12c065[_0x6ec4('0x43')],_0x12c065['query']);_0xa15114['attributes']=_[_0x6ec4('0x4a')](_0x12c065[_0x6ec4('0x43')],qs[_0x6ec4('0x4b')](_0x3a8971['query'][_0x6ec4('0x4b')]));_0xa15114[_0x6ec4('0x49')]=_0xa15114[_0x6ec4('0x49')][_0x6ec4('0x4c')]?_0xa15114['attributes']:_0x12c065[_0x6ec4('0x43')];_0xa15114[_0x6ec4('0xb6')]=qs[_0x6ec4('0x4f')](_0x3a8971[_0x6ec4('0x47')][_0x6ec4('0x4f')]);_0xa15114[_0x6ec4('0x51')]=qs[_0x6ec4('0x48')](_[_0x6ec4('0x50')](_0x3a8971[_0x6ec4('0x47')],_0x12c065[_0x6ec4('0x48')]));if(_0x3a8971[_0x6ec4('0x47')]['filter']){_0xa15114[_0x6ec4('0x51')]=_[_0x6ec4('0x5a')](_0xa15114['where'],{'$or':_[_0x6ec4('0x52')](_0xa15114['attributes'],function(_0x158212){var _0x39239d={};_0x39239d[_0x158212]={'$like':'%'+_0x3a8971[_0x6ec4('0x47')][_0x6ec4('0x59')]+'%'};return _0x39239d;})});}_0xa15114=_[_0x6ec4('0x5a')]({},_0xa15114,_0x3a8971[_0x6ec4('0x5b')]);return _0x665b8[_0x6ec4('0xbe')](_0xa15114);}})[_0x6ec4('0x32')](function(_0x438472){if(_0x438472){_0x84e158=_0x438472[_0x6ec4('0x4c')];if(!_0x3a8971[_0x6ec4('0x47')][_0x6ec4('0xba')]('nolimit')){_0xa15114['limit']=qs[_0x6ec4('0x4e')](_0x3a8971[_0x6ec4('0x47')]['limit']);_0xa15114['offset']=qs[_0x6ec4('0x2b')](_0x3a8971['query'][_0x6ec4('0x2b')]);}return _0x665b8[_0x6ec4('0xbe')](_0xa15114);}})[_0x6ec4('0x32')](function(_0x1508b1){if(_0x1508b1){return _0x1508b1?{'count':_0x84e158,'rows':_0x1508b1}:null;}})[_0x6ec4('0x32')](respondWithResult(_0x470527,null))['catch'](handleError(_0x470527,null));};exports[_0x6ec4('0xbf')]=function(_0x33cb80,_0x2b4991,_0x1faf6f){var _0x3391dc={};var _0x539d10={};var _0x3283f0;var _0x41fbb8;return db[_0x6ec4('0x41')][_0x6ec4('0x95')]({'where':{'id':_0x33cb80['params']['id']}})[_0x6ec4('0x32')](handleEntityNotFound(_0x2b4991,null))[_0x6ec4('0x32')](function(_0x3342f7){if(_0x3342f7){_0x3283f0=_0x3342f7;_0x539d10['model']=_[_0x6ec4('0x45')](db[_0x6ec4('0xc0')][_0x6ec4('0x42')]);_0x539d10[_0x6ec4('0x47')]=_[_0x6ec4('0x45')](_0x33cb80[_0x6ec4('0x47')]);_0x539d10['filters']=_[_0x6ec4('0x4a')](_0x539d10[_0x6ec4('0x43')],_0x539d10[_0x6ec4('0x47')]);_0x3391dc[_0x6ec4('0x49')]=_[_0x6ec4('0x4a')](_0x539d10[_0x6ec4('0x43')],qs[_0x6ec4('0x4b')](_0x33cb80['query']['fields']));_0x3391dc[_0x6ec4('0x49')]=_0x3391dc[_0x6ec4('0x49')][_0x6ec4('0x4c')]?_0x3391dc['attributes']:_0x539d10[_0x6ec4('0x43')];_0x3391dc['order']=qs['sort'](_0x33cb80[_0x6ec4('0x47')]['sort']);_0x3391dc[_0x6ec4('0x51')]=qs[_0x6ec4('0x48')](_[_0x6ec4('0x50')](_0x33cb80['query'],_0x539d10[_0x6ec4('0x48')]));if(_0x33cb80['query'][_0x6ec4('0x59')]){_0x3391dc[_0x6ec4('0x51')]=_[_0x6ec4('0x5a')](_0x3391dc[_0x6ec4('0x51')],{'$or':_[_0x6ec4('0x52')](_0x3391dc[_0x6ec4('0x49')],function(_0x5253f2){var _0x12b3da={};_0x12b3da[_0x5253f2]={'$like':'%'+_0x33cb80['query']['filter']+'%'};return _0x12b3da;})});}_0x3391dc=_[_0x6ec4('0x5a')]({},_0x3391dc,_0x33cb80['options']);return _0x3283f0['getGroups'](_0x3391dc);}})['then'](function(_0x2daa3a){if(_0x2daa3a){_0x41fbb8=_0x2daa3a[_0x6ec4('0x4c')];if(!_0x33cb80[_0x6ec4('0x47')][_0x6ec4('0xba')](_0x6ec4('0x4d'))){_0x3391dc[_0x6ec4('0x4e')]=qs[_0x6ec4('0x4e')](_0x33cb80[_0x6ec4('0x47')]['limit']);_0x3391dc['offset']=qs[_0x6ec4('0x2b')](_0x33cb80[_0x6ec4('0x47')]['offset']);}return _0x3283f0[_0x6ec4('0xbf')](_0x3391dc);}})[_0x6ec4('0x32')](function(_0x312b12){if(_0x312b12){return _0x312b12?{'count':_0x41fbb8,'rows':_0x312b12}:null;}})['then'](respondWithResult(_0x2b4991,null))['catch'](handleError(_0x2b4991,null));};exports[_0x6ec4('0xc1')]=function(_0x530e70,_0x3bbaf0,_0x107ac0){var _0x53661f={'raw':!![],'where':{}};var _0x334ea1={};var _0x51be53={'count':0x0,'rows':[]};return db[_0x6ec4('0x41')][_0x6ec4('0x95')]({'where':{'id':_0x530e70[_0x6ec4('0x66')]['id']}})[_0x6ec4('0x32')](handleEntityNotFound(_0x3bbaf0,null))[_0x6ec4('0x32')](function(_0x3cc58a){if(_0x3cc58a){_0x334ea1['model']=_[_0x6ec4('0x45')](db[_0x6ec4('0xc2')][_0x6ec4('0x42')]);_0x334ea1[_0x6ec4('0x47')]=_[_0x6ec4('0x45')](_0x530e70[_0x6ec4('0x47')]);_0x334ea1[_0x6ec4('0x48')]=_[_0x6ec4('0x4a')](_0x334ea1['model'],_0x334ea1[_0x6ec4('0x47')]);_0x53661f[_0x6ec4('0x49')]=_[_0x6ec4('0x4a')](_0x334ea1[_0x6ec4('0x43')],qs[_0x6ec4('0x4b')](_0x530e70[_0x6ec4('0x47')][_0x6ec4('0x4b')]));_0x53661f[_0x6ec4('0x49')]=_0x53661f['attributes'][_0x6ec4('0x4c')]?_0x53661f[_0x6ec4('0x49')]:_0x334ea1['model'];if(!_0x530e70['query'][_0x6ec4('0xba')](_0x6ec4('0x4d'))){_0x53661f[_0x6ec4('0x4e')]=qs[_0x6ec4('0x4e')](_0x530e70[_0x6ec4('0x47')][_0x6ec4('0x4e')]);_0x53661f[_0x6ec4('0x2b')]=qs['offset'](_0x530e70[_0x6ec4('0x47')][_0x6ec4('0x2b')]);}_0x53661f['order']=qs[_0x6ec4('0x4f')](_0x530e70['query'][_0x6ec4('0x4f')]);_0x53661f[_0x6ec4('0x51')]=qs[_0x6ec4('0x48')](_[_0x6ec4('0x50')](_0x530e70[_0x6ec4('0x47')],_0x334ea1[_0x6ec4('0x48')]));_0x53661f['where'][_0x6ec4('0xc3')]=_0x3cc58a['id'];if(_0x530e70[_0x6ec4('0x47')][_0x6ec4('0x59')]){_0x53661f['where']=_['merge'](_0x53661f[_0x6ec4('0x51')],{'$or':_[_0x6ec4('0x52')](_0x53661f[_0x6ec4('0x49')],function(_0x456d07){var _0x1ca4f5={};_0x1ca4f5[_0x456d07]={'$like':'%'+_0x530e70['query'][_0x6ec4('0x59')]+'%'};return _0x1ca4f5;})});}_0x53661f=_[_0x6ec4('0x5a')]({},_0x53661f,_0x530e70[_0x6ec4('0x5b')]);return db[_0x6ec4('0xc2')]['count']({'where':_0x53661f['where']})[_0x6ec4('0x32')](function(_0x529ed9){_0x51be53['count']=_0x529ed9;if(_0x530e70[_0x6ec4('0x47')][_0x6ec4('0x5c')]){_0x53661f[_0x6ec4('0x61')]=[{'all':!![]}];}return db[_0x6ec4('0xc2')][_0x6ec4('0x5d')](_0x53661f);})['then'](function(_0x19954e){_0x51be53[_0x6ec4('0xc4')]=_0x19954e;return _0x51be53;});}})[_0x6ec4('0x32')](respondWithFilteredResult(_0x3bbaf0,_0x53661f))[_0x6ec4('0x5e')](handleError(_0x3bbaf0,null));};exports[_0x6ec4('0xc5')]=function(_0x20758e,_0x45cbb2,_0x4a6a24){var _0x9ef717={'raw':!![],'where':{}};var _0x7883ed={};var _0x266e76={'count':0x0,'rows':[]};return db['User'][_0x6ec4('0x95')]({'where':{'id':_0x20758e[_0x6ec4('0x66')]['id']}})[_0x6ec4('0x32')](handleEntityNotFound(_0x45cbb2,null))['then'](function(_0x1cb01d){if(_0x1cb01d){_0x7883ed[_0x6ec4('0x43')]=_[_0x6ec4('0x45')](db[_0x6ec4('0xc6')][_0x6ec4('0x42')]);_0x7883ed[_0x6ec4('0x47')]=_['keys'](_0x20758e[_0x6ec4('0x47')]);_0x7883ed[_0x6ec4('0x48')]=_['intersection'](_0x7883ed[_0x6ec4('0x43')],_0x7883ed['query']);_0x9ef717[_0x6ec4('0x49')]=_['intersection'](_0x7883ed[_0x6ec4('0x43')],qs[_0x6ec4('0x4b')](_0x20758e[_0x6ec4('0x47')]['fields']));_0x9ef717[_0x6ec4('0x49')]=_0x9ef717[_0x6ec4('0x49')][_0x6ec4('0x4c')]?_0x9ef717[_0x6ec4('0x49')]:_0x7883ed['model'];if(!_0x20758e[_0x6ec4('0x47')][_0x6ec4('0xba')](_0x6ec4('0x4d'))){_0x9ef717['limit']=qs[_0x6ec4('0x4e')](_0x20758e[_0x6ec4('0x47')]['limit']);_0x9ef717[_0x6ec4('0x2b')]=qs[_0x6ec4('0x2b')](_0x20758e[_0x6ec4('0x47')][_0x6ec4('0x2b')]);}_0x9ef717['order']=qs[_0x6ec4('0x4f')](_0x20758e[_0x6ec4('0x47')][_0x6ec4('0x4f')]);_0x9ef717['where']=qs[_0x6ec4('0x48')](_[_0x6ec4('0x50')](_0x20758e[_0x6ec4('0x47')],_0x7883ed[_0x6ec4('0x48')]));_0x9ef717[_0x6ec4('0x51')][_0x6ec4('0xc3')]=_0x1cb01d['id'];if(_0x20758e['query']['filter']){_0x9ef717[_0x6ec4('0x51')]=_['merge'](_0x9ef717['where'],{'$or':_['map'](_0x9ef717['attributes'],function(_0x289a19){var _0x386671={};_0x386671[_0x289a19]={'$like':'%'+_0x20758e[_0x6ec4('0x47')][_0x6ec4('0x59')]+'%'};return _0x386671;})});}_0x9ef717=_[_0x6ec4('0x5a')]({},_0x9ef717,_0x20758e['options']);return db['ScreenRecording']['count']({'where':_0x9ef717[_0x6ec4('0x51')]})[_0x6ec4('0x32')](function(_0x39d6ea){_0x266e76['count']=_0x39d6ea;if(_0x20758e[_0x6ec4('0x47')][_0x6ec4('0x5c')]){_0x9ef717['include']=[{'all':!![]}];}return db[_0x6ec4('0xc6')][_0x6ec4('0x5d')](_0x9ef717);})['then'](function(_0x1fc86b){_0x266e76[_0x6ec4('0xc4')]=_0x1fc86b;return _0x266e76;});}})['then'](respondWithFilteredResult(_0x45cbb2,_0x9ef717))[_0x6ec4('0x5e')](handleError(_0x45cbb2,null));};exports[_0x6ec4('0xc7')]=function(_0x2894f6,_0x23056b,_0x5382dd){var _0x489ba9={};var _0x5def62={};var _0x35d63d;var _0x496b5c;return db[_0x6ec4('0x41')][_0x6ec4('0x95')]({'where':{'id':_0x2894f6[_0x6ec4('0x66')]['id']}})['then'](handleEntityNotFound(_0x23056b,null))[_0x6ec4('0x32')](function(_0x3f8f26){if(_0x3f8f26){_0x35d63d=_0x3f8f26;_0x5def62[_0x6ec4('0x43')]=_[_0x6ec4('0x45')](db['ChatInteraction'][_0x6ec4('0x42')]);_0x5def62[_0x6ec4('0x47')]=_['keys'](_0x2894f6[_0x6ec4('0x47')]);_0x5def62[_0x6ec4('0x48')]=_[_0x6ec4('0x4a')](_0x5def62[_0x6ec4('0x43')],_0x5def62[_0x6ec4('0x47')]);_0x489ba9[_0x6ec4('0x49')]=_[_0x6ec4('0x4a')](_0x5def62[_0x6ec4('0x43')],qs[_0x6ec4('0x4b')](_0x2894f6[_0x6ec4('0x47')][_0x6ec4('0x4b')]));_0x489ba9['attributes']=_0x489ba9[_0x6ec4('0x49')][_0x6ec4('0x4c')]?_0x489ba9[_0x6ec4('0x49')]:_0x5def62[_0x6ec4('0x43')];_0x489ba9[_0x6ec4('0xb6')]=qs['sort'](_0x2894f6[_0x6ec4('0x47')]['sort']);_0x489ba9[_0x6ec4('0x51')]=qs[_0x6ec4('0x48')](_[_0x6ec4('0x50')](_0x2894f6[_0x6ec4('0x47')],_0x5def62[_0x6ec4('0x48')]));if(_0x2894f6[_0x6ec4('0x47')]['filter']){_0x489ba9[_0x6ec4('0x51')]=_[_0x6ec4('0x5a')](_0x489ba9[_0x6ec4('0x51')],{'$or':_[_0x6ec4('0x52')](_0x489ba9['attributes'],function(_0x26823d){var _0x2bed88={};_0x2bed88[_0x26823d]={'$like':'%'+_0x2894f6[_0x6ec4('0x47')][_0x6ec4('0x59')]+'%'};return _0x2bed88;})});}_0x489ba9=_['merge']({},_0x489ba9,_0x2894f6['options']);return _0x35d63d[_0x6ec4('0xc7')](_0x489ba9);}})['then'](function(_0x163d3d){if(_0x163d3d){_0x496b5c=_0x163d3d[_0x6ec4('0x4c')];if(!_0x2894f6[_0x6ec4('0x47')][_0x6ec4('0xba')](_0x6ec4('0x4d'))){_0x489ba9[_0x6ec4('0x4e')]=qs[_0x6ec4('0x4e')](_0x2894f6[_0x6ec4('0x47')]['limit']);_0x489ba9['offset']=qs[_0x6ec4('0x2b')](_0x2894f6[_0x6ec4('0x47')][_0x6ec4('0x2b')]);}return _0x35d63d[_0x6ec4('0xc7')](_0x489ba9);}})['then'](function(_0x53ca9a){if(_0x53ca9a){return _0x53ca9a?{'count':_0x496b5c,'rows':_0x53ca9a}:null;}})[_0x6ec4('0x32')](respondWithResult(_0x23056b,null))[_0x6ec4('0x5e')](handleError(_0x23056b,null));};exports[_0x6ec4('0xc8')]=function(_0x1abfae,_0x55ddcf,_0xa997a6){var _0x425cc0={};var _0x44ee0e={};var _0x1e8991;var _0x47c6ef;return db[_0x6ec4('0x41')][_0x6ec4('0x95')]({'where':{'id':_0x1abfae['params']['id']}})[_0x6ec4('0x32')](handleEntityNotFound(_0x55ddcf,null))[_0x6ec4('0x32')](function(_0x55dcb3){if(_0x55dcb3){_0x1e8991=_0x55dcb3;_0x44ee0e[_0x6ec4('0x43')]=_[_0x6ec4('0x45')](db['OpenchannelInteraction'][_0x6ec4('0x42')]);_0x44ee0e[_0x6ec4('0x47')]=_[_0x6ec4('0x45')](_0x1abfae[_0x6ec4('0x47')]);_0x44ee0e['filters']=_[_0x6ec4('0x4a')](_0x44ee0e[_0x6ec4('0x43')],_0x44ee0e['query']);_0x425cc0[_0x6ec4('0x49')]=_['intersection'](_0x44ee0e['model'],qs[_0x6ec4('0x4b')](_0x1abfae['query'][_0x6ec4('0x4b')]));_0x425cc0[_0x6ec4('0x49')]=_0x425cc0[_0x6ec4('0x49')][_0x6ec4('0x4c')]?_0x425cc0[_0x6ec4('0x49')]:_0x44ee0e[_0x6ec4('0x43')];_0x425cc0['order']=qs['sort'](_0x1abfae[_0x6ec4('0x47')][_0x6ec4('0x4f')]);_0x425cc0['where']=qs[_0x6ec4('0x48')](_[_0x6ec4('0x50')](_0x1abfae[_0x6ec4('0x47')],_0x44ee0e[_0x6ec4('0x48')]));if(_0x1abfae[_0x6ec4('0x47')]['filter']){_0x425cc0[_0x6ec4('0x51')]=_[_0x6ec4('0x5a')](_0x425cc0[_0x6ec4('0x51')],{'$or':_[_0x6ec4('0x52')](_0x425cc0['attributes'],function(_0x2c6880){var _0x3382a6={};_0x3382a6[_0x2c6880]={'$like':'%'+_0x1abfae[_0x6ec4('0x47')][_0x6ec4('0x59')]+'%'};return _0x3382a6;})});}_0x425cc0=_[_0x6ec4('0x5a')]({},_0x425cc0,_0x1abfae[_0x6ec4('0x5b')]);return _0x1e8991['getOpenchannelInteractions'](_0x425cc0);}})[_0x6ec4('0x32')](function(_0x153438){if(_0x153438){_0x47c6ef=_0x153438[_0x6ec4('0x4c')];if(!_0x1abfae[_0x6ec4('0x47')][_0x6ec4('0xba')](_0x6ec4('0x4d'))){_0x425cc0['limit']=qs['limit'](_0x1abfae[_0x6ec4('0x47')]['limit']);_0x425cc0['offset']=qs[_0x6ec4('0x2b')](_0x1abfae[_0x6ec4('0x47')][_0x6ec4('0x2b')]);}return _0x1e8991[_0x6ec4('0xc8')](_0x425cc0);}})[_0x6ec4('0x32')](function(_0x1cf894){if(_0x1cf894){return _0x1cf894?{'count':_0x47c6ef,'rows':_0x1cf894}:null;}})['then'](respondWithResult(_0x55ddcf,null))[_0x6ec4('0x5e')](handleError(_0x55ddcf,null));};exports[_0x6ec4('0xc9')]=function(_0xc7fe74,_0xae992e,_0x588ba6){var _0x215a5a={'raw':!![],'where':{}};var _0x33dca9={};var _0x4105bb={'count':0x0,'rows':[]};return db[_0x6ec4('0x41')]['findOne']({'where':{'id':_0xc7fe74[_0x6ec4('0x66')]['id']}})[_0x6ec4('0x32')](handleEntityNotFound(_0xae992e,null))['then'](function(_0x45415b){if(_0x45415b){_0x33dca9['model']=_[_0x6ec4('0x45')](db[_0x6ec4('0xca')]['rawAttributes']);_0x33dca9[_0x6ec4('0x47')]=_['keys'](_0xc7fe74[_0x6ec4('0x47')]);_0x33dca9[_0x6ec4('0x48')]=_[_0x6ec4('0x4a')](_0x33dca9[_0x6ec4('0x43')],_0x33dca9['query']);_0x215a5a[_0x6ec4('0x49')]=_['intersection'](_0x33dca9[_0x6ec4('0x43')],qs[_0x6ec4('0x4b')](_0xc7fe74[_0x6ec4('0x47')][_0x6ec4('0x4b')]));_0x215a5a['attributes']=_0x215a5a[_0x6ec4('0x49')]['length']?_0x215a5a[_0x6ec4('0x49')]:_0x33dca9[_0x6ec4('0x43')];if(!_0xc7fe74[_0x6ec4('0x47')]['hasOwnProperty'](_0x6ec4('0x4d'))){_0x215a5a['limit']=qs[_0x6ec4('0x4e')](_0xc7fe74[_0x6ec4('0x47')][_0x6ec4('0x4e')]);_0x215a5a[_0x6ec4('0x2b')]=qs['offset'](_0xc7fe74[_0x6ec4('0x47')][_0x6ec4('0x2b')]);}_0x215a5a[_0x6ec4('0xb6')]=qs[_0x6ec4('0x4f')](_0xc7fe74['query']['sort']);_0x215a5a[_0x6ec4('0x51')]=qs[_0x6ec4('0x48')](_[_0x6ec4('0x50')](_0xc7fe74[_0x6ec4('0x47')],_0x33dca9[_0x6ec4('0x48')]));_0x215a5a['where'][_0x6ec4('0xc3')]=_0x45415b['id'];if(_0xc7fe74[_0x6ec4('0x47')][_0x6ec4('0x59')]){_0x215a5a[_0x6ec4('0x51')]=_[_0x6ec4('0x5a')](_0x215a5a['where'],{'$or':_[_0x6ec4('0x52')](_0x215a5a[_0x6ec4('0x49')],function(_0x3742cd){var _0x262c9b={};_0x262c9b[_0x3742cd]={'$like':'%'+_0xc7fe74[_0x6ec4('0x47')]['filter']+'%'};return _0x262c9b;})});}_0x215a5a=_[_0x6ec4('0x5a')]({},_0x215a5a,_0xc7fe74[_0x6ec4('0x5b')]);return db[_0x6ec4('0xca')][_0x6ec4('0x2a')]({'where':_0x215a5a[_0x6ec4('0x51')]})[_0x6ec4('0x32')](function(_0x8999f0){_0x4105bb[_0x6ec4('0x2a')]=_0x8999f0;if(_0xc7fe74['query']['includeAll']){_0x215a5a[_0x6ec4('0x61')]=[{'all':!![]}];}return db[_0x6ec4('0xca')]['findAll'](_0x215a5a);})[_0x6ec4('0x32')](function(_0x3bc064){_0x4105bb['rows']=_0x3bc064;return _0x4105bb;});}})[_0x6ec4('0x32')](respondWithFilteredResult(_0xae992e,_0x215a5a))[_0x6ec4('0x5e')](handleError(_0xae992e,null));};exports[_0x6ec4('0xcb')]=function(_0x41061c,_0x2cf457,_0x4b9389){var _0x43566a={};var _0x176480={};var _0x1ee2de;var _0x4e893a;return db[_0x6ec4('0x41')][_0x6ec4('0x95')]({'where':{'id':_0x41061c[_0x6ec4('0x66')]['id']}})[_0x6ec4('0x32')](handleEntityNotFound(_0x2cf457,null))[_0x6ec4('0x32')](function(_0x718198){if(_0x718198){_0x1ee2de=_0x718198;_0x176480[_0x6ec4('0x43')]=_[_0x6ec4('0x45')](db[_0x6ec4('0xcc')]['rawAttributes']);_0x176480[_0x6ec4('0x47')]=_[_0x6ec4('0x45')](_0x41061c['query']);_0x176480[_0x6ec4('0x48')]=_[_0x6ec4('0x4a')](_0x176480['model'],_0x176480[_0x6ec4('0x47')]);_0x43566a[_0x6ec4('0x49')]=_['intersection'](_0x176480[_0x6ec4('0x43')],qs[_0x6ec4('0x4b')](_0x41061c[_0x6ec4('0x47')][_0x6ec4('0x4b')]));_0x43566a[_0x6ec4('0x49')]=_0x43566a[_0x6ec4('0x49')]['length']?_0x43566a[_0x6ec4('0x49')]:_0x176480[_0x6ec4('0x43')];_0x43566a['order']=qs[_0x6ec4('0x4f')](_0x41061c[_0x6ec4('0x47')]['sort']);_0x43566a[_0x6ec4('0x51')]=qs['filters'](_[_0x6ec4('0x50')](_0x41061c[_0x6ec4('0x47')],_0x176480['filters']));if(_0x41061c[_0x6ec4('0x47')]['filter']){_0x43566a['where']=_[_0x6ec4('0x5a')](_0x43566a[_0x6ec4('0x51')],{'$or':_[_0x6ec4('0x52')](_0x43566a[_0x6ec4('0x49')],function(_0x1a6716){var _0x5ed1dd={};_0x5ed1dd[_0x1a6716]={'$like':'%'+_0x41061c[_0x6ec4('0x47')][_0x6ec4('0x59')]+'%'};return _0x5ed1dd;})});}_0x43566a=_[_0x6ec4('0x5a')]({},_0x43566a,_0x41061c[_0x6ec4('0x5b')]);return _0x1ee2de['getSmsInteractions'](_0x43566a);}})[_0x6ec4('0x32')](function(_0x2de4ae){if(_0x2de4ae){_0x4e893a=_0x2de4ae[_0x6ec4('0x4c')];if(!_0x41061c['query']['hasOwnProperty'](_0x6ec4('0x4d'))){_0x43566a[_0x6ec4('0x4e')]=qs['limit'](_0x41061c[_0x6ec4('0x47')][_0x6ec4('0x4e')]);_0x43566a[_0x6ec4('0x2b')]=qs[_0x6ec4('0x2b')](_0x41061c[_0x6ec4('0x47')][_0x6ec4('0x2b')]);}return _0x1ee2de[_0x6ec4('0xcb')](_0x43566a);}})[_0x6ec4('0x32')](function(_0x9819a9){if(_0x9819a9){return _0x9819a9?{'count':_0x4e893a,'rows':_0x9819a9}:null;}})[_0x6ec4('0x32')](respondWithResult(_0x2cf457,null))['catch'](handleError(_0x2cf457,null));};exports['getFaxInteractions']=function(_0x30832e,_0x5f39ea,_0x478ead){var _0x1febd5={};var _0x2423b2={};var _0x284f85;var _0x4c1305;return db[_0x6ec4('0x41')][_0x6ec4('0x95')]({'where':{'id':_0x30832e[_0x6ec4('0x66')]['id']}})[_0x6ec4('0x32')](handleEntityNotFound(_0x5f39ea,null))[_0x6ec4('0x32')](function(_0x530c3f){if(_0x530c3f){_0x284f85=_0x530c3f;_0x2423b2[_0x6ec4('0x43')]=_['keys'](db[_0x6ec4('0xcd')][_0x6ec4('0x42')]);_0x2423b2[_0x6ec4('0x47')]=_[_0x6ec4('0x45')](_0x30832e[_0x6ec4('0x47')]);_0x2423b2[_0x6ec4('0x48')]=_['intersection'](_0x2423b2[_0x6ec4('0x43')],_0x2423b2[_0x6ec4('0x47')]);_0x1febd5[_0x6ec4('0x49')]=_[_0x6ec4('0x4a')](_0x2423b2['model'],qs[_0x6ec4('0x4b')](_0x30832e[_0x6ec4('0x47')][_0x6ec4('0x4b')]));_0x1febd5[_0x6ec4('0x49')]=_0x1febd5[_0x6ec4('0x49')][_0x6ec4('0x4c')]?_0x1febd5[_0x6ec4('0x49')]:_0x2423b2[_0x6ec4('0x43')];_0x1febd5[_0x6ec4('0xb6')]=qs[_0x6ec4('0x4f')](_0x30832e[_0x6ec4('0x47')][_0x6ec4('0x4f')]);_0x1febd5['where']=qs[_0x6ec4('0x48')](_[_0x6ec4('0x50')](_0x30832e[_0x6ec4('0x47')],_0x2423b2['filters']));if(_0x30832e[_0x6ec4('0x47')][_0x6ec4('0x59')]){_0x1febd5[_0x6ec4('0x51')]=_[_0x6ec4('0x5a')](_0x1febd5[_0x6ec4('0x51')],{'$or':_[_0x6ec4('0x52')](_0x1febd5['attributes'],function(_0x2bd77d){var _0x4c1886={};_0x4c1886[_0x2bd77d]={'$like':'%'+_0x30832e[_0x6ec4('0x47')][_0x6ec4('0x59')]+'%'};return _0x4c1886;})});}_0x1febd5=_['merge']({},_0x1febd5,_0x30832e[_0x6ec4('0x5b')]);return _0x284f85['getFaxInteractions'](_0x1febd5);}})[_0x6ec4('0x32')](function(_0x17e515){if(_0x17e515){_0x4c1305=_0x17e515[_0x6ec4('0x4c')];if(!_0x30832e[_0x6ec4('0x47')]['hasOwnProperty']('nolimit')){_0x1febd5[_0x6ec4('0x4e')]=qs[_0x6ec4('0x4e')](_0x30832e[_0x6ec4('0x47')][_0x6ec4('0x4e')]);_0x1febd5['offset']=qs[_0x6ec4('0x2b')](_0x30832e[_0x6ec4('0x47')][_0x6ec4('0x2b')]);}return _0x284f85[_0x6ec4('0xce')](_0x1febd5);}})[_0x6ec4('0x32')](function(_0x2f10f2){if(_0x2f10f2){return _0x2f10f2?{'count':_0x4c1305,'rows':_0x2f10f2}:null;}})[_0x6ec4('0x32')](respondWithResult(_0x5f39ea,null))[_0x6ec4('0x5e')](handleError(_0x5f39ea,null));};exports[_0x6ec4('0xcf')]=function(_0x5ccf1a,_0x41a434,_0x467cbd){var _0x4f35df;var _0x2b94ac;var _0x111737;var _0x36baaf=!_[_0x6ec4('0x6d')](_0x5ccf1a[_0x6ec4('0x66')]['id'])?_0x5ccf1a['params']['id']:!_[_0x6ec4('0x6d')](_0x5ccf1a['user']['id'])?_0x5ccf1a['user']['id']:null;return db['User'][_0x6ec4('0x3b')]({'where':{'id':_0x36baaf,'role':_0x6ec4('0x68')},'attributes':['id',_0x6ec4('0x3c'),'phone',_0x6ec4('0xd0'),'role',_0x6ec4('0x71'),_0x6ec4('0x98')]})[_0x6ec4('0x32')](handleEntityNotFound(_0x41a434,null))[_0x6ec4('0x32')](function(_0xf550f0){if(_0xf550f0){_0x4f35df=_0xf550f0;if(_0x5ccf1a[_0x6ec4('0x63')][_0x6ec4('0xa3')]){_0x111737=util[_0x6ec4('0x6f')](_0x6ec4('0xd1'),_0x4f35df[_0x5ccf1a[_0x6ec4('0x63')]['interface']]);}else if(_0x5ccf1a[_0x6ec4('0x63')][_0x6ec4('0xd2')]){_0x111737=util[_0x6ec4('0x6f')]('SIP/%s',_0x5ccf1a['body'][_0x6ec4('0xd2')]);}else{_0x111737=util[_0x6ec4('0x6f')](_0x6ec4('0xa4'),_0x4f35df['name']);}socket['to'](util[_0x6ec4('0x6f')](_0x6ec4('0xd3'),_0x4f35df['name']))[_0x6ec4('0xa9')](_0x6ec4('0xd4'),{'ip':_0x5ccf1a[_0x6ec4('0xd5')][_0x6ec4('0xd6')]||_0x5ccf1a[_0x6ec4('0xd7')]['remoteAddress']||_0x5ccf1a[_0x6ec4('0xd8')][_0x6ec4('0xd9')]||_0x5ccf1a[_0x6ec4('0xd7')][_0x6ec4('0xd8')]['remoteAddress']});return db[_0x6ec4('0xa6')][_0x6ec4('0x33')]({'where':{'membername':_0x4f35df[_0x6ec4('0x3c')]},'individualHooks':!![]});}})['then'](function(_0x3d4641){if(_0x4f35df){return _0x4f35df['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x97a60e){var _0x25caf6=[];if(_0x97a60e){_0x2b94ac=_0x97a60e;if(_0x2b94ac[_0x6ec4('0x4c')]){for(var _0x1936c0=0x0;_0x1936c0<_0x2b94ac['length'];_0x1936c0++){_0x25caf6[_0x6ec4('0xda')]({'membername':_0x4f35df[_0x6ec4('0x3c')],'UserId':_0x4f35df['id'],'queue_name':_0x2b94ac[_0x1936c0][_0x6ec4('0x3c')],'VoiceQueueId':_0x2b94ac[_0x1936c0]['id'],'interface':_0x111737,'paused':_0x4f35df[_0x6ec4('0x98')]||![],'penalty':_0x2b94ac[_0x1936c0]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x6ec4('0xa5')](_0x25caf6,function(_0x22068e){return db[_0x6ec4('0xa6')][_0x6ec4('0xdb')](_0x22068e);});}}})[_0x6ec4('0x32')](function(){return db[_0x6ec4('0xdc')][_0x6ec4('0x5d')]({'where':{'membername':_0x4f35df['name'],'exitAt':null}});})[_0x6ec4('0x32')](function(_0x24f25f){var _0x5238a8=[];_0x24f25f['forEach'](function(_0xba77fa){_0x5238a8['push'](_0xba77fa[_0x6ec4('0x31')]({'exitAt':moment()[_0x6ec4('0x6f')](_0x6ec4('0xdd'))}));});return BPromise[_0x6ec4('0xde')](_0x5238a8);})[_0x6ec4('0x32')](function(){var _0x1ec03e=[];var _0x3ebbe1=[];var _0x775fb2=utils[_0x6ec4('0xdf')]();var _0x1d0534={'membername':_0x4f35df[_0x6ec4('0x3c')],'interface':_0x111737,'enterAt':moment()['format'](_0x6ec4('0xdd')),'role':_0x4f35df[_0x6ec4('0x3a')],'internal':_0x4f35df[_0x6ec4('0x71')]};_0x775fb2[_0x6ec4('0xe0')](function(_0xc5e040){_0x1ec03e['push'](_[_0x6ec4('0x5a')]({'channel':_0xc5e040,'type':_0x6ec4('0xe1'),'data1':_0x5ccf1a['body'][_0x6ec4('0xe2')],'data2':_0x111737},_0x1d0534));if(_0x4f35df[_0x6ec4('0x98')]){_0x3ebbe1[_0x6ec4('0xda')](_[_0x6ec4('0x5a')]({'channel':_0xc5e040,'type':'PAUSE','data1':_0x6ec4('0xe3')},_0x1d0534));}});return db[_0x6ec4('0xdc')][_0x6ec4('0x62')](_0x1ec03e[_0x6ec4('0xe4')](_0x3ebbe1),{'individualHooks':!![]});})[_0x6ec4('0x32')](function(){return _0x4f35df[_0x6ec4('0x31')]({'online':!![],'lastLoginAt':moment()['format'](_0x6ec4('0xdd')),'voicePause':_0x4f35df[_0x6ec4('0x98')]||![],'mailPause':_0x4f35df['loginInPause']||![],'chatPause':_0x4f35df[_0x6ec4('0x98')]||![],'faxPause':_0x4f35df[_0x6ec4('0x98')]||![],'smsPause':_0x4f35df[_0x6ec4('0x98')]||![],'openchannelPause':_0x4f35df['loginInPause']||![],'pauseType':_0x4f35df[_0x6ec4('0x98')]?'LOGININPAUSE':null,'interface':_0x111737,'lastPauseAt':moment()[_0x6ec4('0x6f')](_0x6ec4('0xdd'))});})[_0x6ec4('0x32')](function(_0x1bbb5e){if(_0x5ccf1a['isMiddleware']){return _0x467cbd();}else{return BPromise[_0x6ec4('0xe5')](_0x1bbb5e)[_0x6ec4('0x32')](respondWithResult(_0x41a434,null));}})[_0x6ec4('0x5e')](handleError(_0x41a434,null));};exports[_0x6ec4('0xe6')]=function(_0x1af896,_0x193cd7,_0x4275e9){var _0x22c0b6;return db[_0x6ec4('0x41')][_0x6ec4('0x3b')]({'where':{'id':_0x1af896[_0x6ec4('0x66')]['id'],'role':_0x6ec4('0x68')},'attributes':['id',_0x6ec4('0x3c'),'role']})[_0x6ec4('0x32')](handleEntityNotFound(_0x193cd7,null))['then'](function(_0x542aa6){if(_0x542aa6){_0x22c0b6=_0x542aa6;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x22c0b6[_0x6ec4('0x3c')]},'individualHooks':!![]});}})['then'](function(){return db[_0x6ec4('0xdc')]['findAll']({'where':{'membername':_0x22c0b6[_0x6ec4('0x3c')],'exitAt':null}});})['then'](function(_0x225a2e){var _0x18470e=[];_0x225a2e[_0x6ec4('0xe0')](function(_0x3422f8){_0x18470e['push'](_0x3422f8['update']({'exitAt':moment()['format'](_0x6ec4('0xdd'))}));});return BPromise[_0x6ec4('0xde')](_0x18470e);})[_0x6ec4('0x32')](function(){return _0x22c0b6[_0x6ec4('0x31')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x6ec4('0x32')](respondWithResult(_0x193cd7,null))['catch'](handleError(_0x193cd7,null));};exports[_0x6ec4('0xe7')]=function(_0xbab9ba,_0x12c1c6,_0x538714){var _0x49e45c;return db['UserVoiceQueueRt'][_0x6ec4('0x31')]({'paused':0x1},{'where':{'UserId':_0xbab9ba[_0x6ec4('0x66')]['id']},'individualHooks':!![]})[_0x6ec4('0x32')](function(){return db[_0x6ec4('0x41')]['find']({'where':{'id':_0xbab9ba[_0x6ec4('0x66')]['id'],'role':_0x6ec4('0x68')},'attributes':['id',_0x6ec4('0x3c'),'role',_0x6ec4('0x71'),_0x6ec4('0xa3')]});})[_0x6ec4('0x32')](handleEntityNotFound(_0x12c1c6,null))[_0x6ec4('0x32')](function(_0x3ff291){if(_0x3ff291){_0x49e45c=_0x3ff291;return respondWithRpcPromise(_0x6ec4('0xe8'),_0x6ec4('0xe7'),{'id':_0x49e45c['id'],'name':_0x49e45c[_0x6ec4('0x3c')],'pause':!![]});}})[_0x6ec4('0x32')](function(){if(_0x49e45c){return db[_0x6ec4('0xdc')][_0x6ec4('0x5d')]({'where':{'membername':_0x49e45c[_0x6ec4('0x3c')],'type':'PAUSE','exitAt':null}});}})[_0x6ec4('0x32')](function(_0x45b030){if(_0x45b030['length']){var _0x4ba52b=moment()[_0x6ec4('0x6f')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x545a4d=0x0,_0x353387=_0x45b030[_0x6ec4('0x4c')];_0x545a4d<_0x353387;_0x545a4d++){_0x45b030[_0x545a4d][_0x6ec4('0xe9')]({'exitAt':_0x4ba52b});}}})['then'](function(){var _0x2197b7=[];var _0xb76aa1=utils[_0x6ec4('0xdf')]();_0xb76aa1[_0x6ec4('0xe0')](function(_0x301a81){_0x2197b7[_0x6ec4('0xda')]({'channel':_0x301a81,'membername':_0x49e45c[_0x6ec4('0x3c')],'interface':_['isNil'](_0x49e45c[_0x6ec4('0xa3')])?util[_0x6ec4('0x6f')]('SIP/%s',_0x49e45c[_0x6ec4('0x3c')]):_0x49e45c[_0x6ec4('0xa3')],'type':_0x6ec4('0xea'),'enterAt':moment()[_0x6ec4('0x6f')](_0x6ec4('0xdd')),'data1':_0xbab9ba[_0x6ec4('0x63')]['type']||_0x6ec4('0xeb'),'role':_0x49e45c[_0x6ec4('0x3a')],'internal':_0x49e45c['internal']});});return db['MemberReport'][_0x6ec4('0x62')](_0x2197b7,{'individualHooks':!![]});})[_0x6ec4('0x32')](function(){return _0x49e45c['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0xbab9ba[_0x6ec4('0x63')][_0x6ec4('0x53')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0x6ec4('0xdd'))});})[_0x6ec4('0x32')](respondWithResult(_0x12c1c6,null))[_0x6ec4('0x5e')](handleError(_0x12c1c6,null));};exports[_0x6ec4('0xec')]=function(_0x416ed3,_0x2fa1a3,_0x5067f6){var _0x547b54;return db[_0x6ec4('0x41')][_0x6ec4('0x3b')]({'where':{'id':_0x416ed3[_0x6ec4('0x66')]['id']},'attributes':['id','name',_0x6ec4('0x3a'),_0x6ec4('0x99'),_0x6ec4('0xed'),'chatPause',_0x6ec4('0xee'),_0x6ec4('0xef'),_0x6ec4('0xf0'),_0x6ec4('0xf1'),'lastPauseAt']})[_0x6ec4('0x32')](handleEntityNotFound(_0x2fa1a3,null))[_0x6ec4('0x32')](function(_0x597c4c){if(_0x597c4c){_0x547b54=_0x597c4c;if(_0x416ed3[_0x6ec4('0x63')]['channel']&&!utils['isValidChannel'](_0x416ed3[_0x6ec4('0x63')]['channel'])){throw new db[(_0x6ec4('0x8c'))][(_0x6ec4('0x8d'))](_0x6ec4('0x9a'));}switch(_0x416ed3[_0x6ec4('0x63')]['channel']){case _0x6ec4('0xa1'):return respondWithRpcPromise(_0x6ec4('0xe8'),_0x6ec4('0xec'),{'id':_0x547b54['id'],'name':_0x547b54[_0x6ec4('0x3c')],'pause':![]})[_0x6ec4('0x32')](function(){return db[_0x6ec4('0xa6')][_0x6ec4('0x31')]({'paused':0x0},{'where':{'UserId':_0x547b54['id']},'individualHooks':!![]});})[_0x6ec4('0x32')](function(){return db[_0x6ec4('0xdc')][_0x6ec4('0x3b')]({'where':{'channel':_0x416ed3['body'][_0x6ec4('0x96')],'membername':_0x547b54[_0x6ec4('0x3c')],'type':'PAUSE','exitAt':null}});})[_0x6ec4('0x32')](function(_0x5bc3d1){if(_0x5bc3d1){return _0x5bc3d1[_0x6ec4('0x31')]({'exitAt':moment()[_0x6ec4('0x6f')](_0x6ec4('0xdd')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x6ec4('0x32')](function(){return _0x547b54[_0x6ec4('0x31')]({'voicePause':![]});});case'mail':case'chat':case _0x6ec4('0xf2'):case _0x6ec4('0xf3'):case _0x6ec4('0xf4'):return db['MemberReport'][_0x6ec4('0x3b')]({'where':{'channel':_0x416ed3[_0x6ec4('0x63')][_0x6ec4('0x96')],'membername':_0x547b54[_0x6ec4('0x3c')],'type':_0x6ec4('0xea'),'exitAt':null}})['then'](function(_0x42463e){if(_0x42463e){return _0x42463e[_0x6ec4('0x31')]({'exitAt':moment()[_0x6ec4('0x6f')](_0x6ec4('0xdd')),'data2':_0x6ec4('0xf5')},{'individualHooks':!![]});}return null;})[_0x6ec4('0x32')](function(){var _0x215a34={};_[_0x6ec4('0x2c')](_0x215a34,util[_0x6ec4('0x6f')](_0x6ec4('0xf6'),_0x416ed3[_0x6ec4('0x63')]['channel'],_0x6ec4('0xf7')),![]);return _0x547b54[_0x6ec4('0x31')](_0x215a34);});default:return respondWithRpcPromise(_0x6ec4('0xe8'),'unpause',{'id':_0x547b54['id'],'name':_0x547b54[_0x6ec4('0x3c')],'pause':![]})[_0x6ec4('0x32')](function(){return db[_0x6ec4('0xa6')][_0x6ec4('0x31')]({'paused':0x0},{'where':{'UserId':_0x547b54['id']}});})[_0x6ec4('0x32')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x547b54[_0x6ec4('0x3c')],'type':_0x6ec4('0xea'),'exitAt':null}});})[_0x6ec4('0x32')](function(_0x104462){var _0xcd9ff9=[];_0x104462['forEach'](function(_0x4863cb){_0xcd9ff9['push'](_0x4863cb['update']({'exitAt':moment()[_0x6ec4('0x6f')](_0x6ec4('0xdd')),'data2':_0x6ec4('0xf5')}));});return BPromise['all'](_0xcd9ff9);})['then'](function(){return _0x547b54['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x6ec4('0x32')](respondWithResult(_0x2fa1a3,null))['catch'](handleError(_0x2fa1a3,null));};exports[_0x6ec4('0xf8')]=function(_0x3dae96,_0x5287bf,_0x2c37c2){var _0x21ee85={};var _0x3c258f={};var _0xa75de1;var _0x303738;return db[_0x6ec4('0x41')][_0x6ec4('0x95')]({'where':{'id':_0x3dae96[_0x6ec4('0x66')]['id']}})[_0x6ec4('0x32')](handleEntityNotFound(_0x5287bf,null))[_0x6ec4('0x32')](function(_0x413a48){if(_0x413a48){_0xa75de1=_0x413a48;_0x3c258f[_0x6ec4('0x43')]=_[_0x6ec4('0x45')](db['Team']['rawAttributes']);_0x3c258f[_0x6ec4('0x47')]=_[_0x6ec4('0x45')](_0x3dae96[_0x6ec4('0x47')]);_0x3c258f['filters']=_[_0x6ec4('0x4a')](_0x3c258f[_0x6ec4('0x43')],_0x3c258f['query']);_0x21ee85[_0x6ec4('0x49')]=_['intersection'](_0x3c258f[_0x6ec4('0x43')],qs[_0x6ec4('0x4b')](_0x3dae96['query'][_0x6ec4('0x4b')]));_0x21ee85[_0x6ec4('0x49')]=_0x21ee85['attributes']['length']?_0x21ee85['attributes']:_0x3c258f[_0x6ec4('0x43')];_0x21ee85['order']=qs[_0x6ec4('0x4f')](_0x3dae96[_0x6ec4('0x47')]['sort']);_0x21ee85[_0x6ec4('0x51')]=qs[_0x6ec4('0x48')](_[_0x6ec4('0x50')](_0x3dae96[_0x6ec4('0x47')],_0x3c258f[_0x6ec4('0x48')]));if(_0x3dae96[_0x6ec4('0x47')][_0x6ec4('0x59')]){_0x21ee85[_0x6ec4('0x51')]=_[_0x6ec4('0x5a')](_0x21ee85[_0x6ec4('0x51')],{'$or':_['map'](_0x21ee85[_0x6ec4('0x49')],function(_0x302acb){var _0x31eca4={};_0x31eca4[_0x302acb]={'$like':'%'+_0x3dae96[_0x6ec4('0x47')][_0x6ec4('0x59')]+'%'};return _0x31eca4;})});}_0x21ee85=_['merge']({},_0x21ee85,_0x3dae96[_0x6ec4('0x5b')]);return _0xa75de1[_0x6ec4('0xf8')](_0x21ee85);}})[_0x6ec4('0x32')](function(_0xb63863){if(_0xb63863){_0x303738=_0xb63863[_0x6ec4('0x4c')];if(!_0x3dae96['query'][_0x6ec4('0xba')](_0x6ec4('0x4d'))){_0x21ee85[_0x6ec4('0x4e')]=qs[_0x6ec4('0x4e')](_0x3dae96['query']['limit']);_0x21ee85['offset']=qs[_0x6ec4('0x2b')](_0x3dae96[_0x6ec4('0x47')][_0x6ec4('0x2b')]);}return _0xa75de1['getTeams'](_0x21ee85);}})[_0x6ec4('0x32')](function(_0x69270a){if(_0x69270a){return _0x69270a?{'count':_0x303738,'rows':_0x69270a}:null;}})[_0x6ec4('0x32')](respondWithResult(_0x5287bf,null))['catch'](handleError(_0x5287bf,null));};exports[_0x6ec4('0xf9')]=function(_0x5e206d,_0x2034b2,_0x9397f){return db[_0x6ec4('0x41')][_0x6ec4('0x3b')]({'where':{'id':_0x5e206d[_0x6ec4('0x66')]['id']}})[_0x6ec4('0x32')](handleEntityNotFound(_0x2034b2,null))['then'](function(_0x242495){if(_0x242495){return _0x242495[_0x6ec4('0xf9')](_0x5e206d[_0x6ec4('0x63')][_0x6ec4('0x67')],_[_0x6ec4('0xfa')](_0x5e206d[_0x6ec4('0x63')],[_0x6ec4('0x67'),'id'])||{});}})[_0x6ec4('0x32')](respondWithResult(_0x2034b2,null))[_0x6ec4('0x5e')](handleError(_0x2034b2,null));};exports[_0x6ec4('0xfb')]=function(_0x5bb5f5,_0x2d46dc,_0x15d2bf){return db['User'][_0x6ec4('0x3b')]({'where':{'id':_0x5bb5f5[_0x6ec4('0x66')]['id']}})['then'](handleEntityNotFound(_0x2d46dc,null))[_0x6ec4('0x32')](function(_0x1c2d47){if(_0x1c2d47){return _0x1c2d47[_0x6ec4('0xfb')](_0x5bb5f5[_0x6ec4('0x47')][_0x6ec4('0x67')]);}})['then'](respondWithStatusCode(_0x2d46dc,null))['catch'](handleError(_0x2d46dc,null));};exports[_0x6ec4('0xfc')]=function(_0x14442b,_0x174196,_0x484e69){var _0x3a504c={};var _0x269ea9={};var _0x1a8f13;var _0x212337;return db['User'][_0x6ec4('0x95')]({'where':{'id':_0x14442b[_0x6ec4('0x66')]['id']}})['then'](handleEntityNotFound(_0x174196,null))[_0x6ec4('0x32')](function(_0x4782a7){if(_0x4782a7){_0x1a8f13=_0x4782a7;_0x269ea9[_0x6ec4('0x43')]=_[_0x6ec4('0x45')](db['CmList'][_0x6ec4('0x42')]);_0x269ea9[_0x6ec4('0x47')]=_[_0x6ec4('0x45')](_0x14442b[_0x6ec4('0x47')]);_0x269ea9[_0x6ec4('0x48')]=_['intersection'](_0x269ea9['model'],_0x269ea9['query']);_0x3a504c[_0x6ec4('0x49')]=_['intersection'](_0x269ea9['model'],qs['fields'](_0x14442b[_0x6ec4('0x47')]['fields']));_0x3a504c[_0x6ec4('0x49')]=_0x3a504c[_0x6ec4('0x49')][_0x6ec4('0x4c')]?_0x3a504c[_0x6ec4('0x49')]:_0x269ea9[_0x6ec4('0x43')];_0x3a504c['order']=qs[_0x6ec4('0x4f')](_0x14442b[_0x6ec4('0x47')]['sort']);_0x3a504c[_0x6ec4('0x51')]=qs[_0x6ec4('0x48')](_[_0x6ec4('0x50')](_0x14442b[_0x6ec4('0x47')],_0x269ea9[_0x6ec4('0x48')]));if(_0x14442b[_0x6ec4('0x47')][_0x6ec4('0x59')]){_0x3a504c['where']=_[_0x6ec4('0x5a')](_0x3a504c['where'],{'$or':_[_0x6ec4('0x52')](_0x3a504c[_0x6ec4('0x49')],function(_0x33e577){var _0x21637e={};_0x21637e[_0x33e577]={'$like':'%'+_0x14442b['query'][_0x6ec4('0x59')]+'%'};return _0x21637e;})});}_0x3a504c=_[_0x6ec4('0x5a')]({},_0x3a504c,_0x14442b[_0x6ec4('0x5b')]);return _0x1a8f13[_0x6ec4('0xfc')](_0x3a504c);}})[_0x6ec4('0x32')](function(_0x5c6378){if(_0x5c6378){_0x212337=_0x5c6378['length'];if(!_0x14442b[_0x6ec4('0x47')][_0x6ec4('0xba')]('nolimit')){_0x3a504c[_0x6ec4('0x4e')]=qs['limit'](_0x14442b[_0x6ec4('0x47')]['limit']);_0x3a504c[_0x6ec4('0x2b')]=qs[_0x6ec4('0x2b')](_0x14442b[_0x6ec4('0x47')][_0x6ec4('0x2b')]);}return _0x1a8f13['getLists'](_0x3a504c);}})[_0x6ec4('0x32')](function(_0x268e79){if(_0x268e79){return _0x268e79?{'count':_0x212337,'rows':_0x268e79}:null;}})[_0x6ec4('0x32')](respondWithResult(_0x174196,null))[_0x6ec4('0x5e')](handleError(_0x174196,null));};exports[_0x6ec4('0xfd')]=function(_0x307864,_0x1615c4,_0x12d9cf){var _0xbb41a8={};var _0x4ed79e={};var _0xdc8e9d;var _0x38132a;return db['User'][_0x6ec4('0x95')]({'where':{'id':_0x307864['params']['id']}})[_0x6ec4('0x32')](handleEntityNotFound(_0x1615c4,null))['then'](function(_0x4ac135){if(_0x4ac135){_0xdc8e9d=_0x4ac135;_0x4ed79e['model']=_[_0x6ec4('0x45')](db[_0x6ec4('0x41')][_0x6ec4('0x42')]);_0x4ed79e[_0x6ec4('0x47')]=_['keys'](_0x307864[_0x6ec4('0x47')]);_0x4ed79e[_0x6ec4('0x48')]=_[_0x6ec4('0x4a')](_0x4ed79e['model'],_0x4ed79e[_0x6ec4('0x47')]);_0xbb41a8[_0x6ec4('0x49')]=_['intersection'](_0x4ed79e[_0x6ec4('0x43')],qs[_0x6ec4('0x4b')](_0x307864[_0x6ec4('0x47')][_0x6ec4('0x4b')]));_0xbb41a8[_0x6ec4('0x49')]=_0xbb41a8[_0x6ec4('0x49')][_0x6ec4('0x4c')]?_0xbb41a8[_0x6ec4('0x49')]:_0x4ed79e[_0x6ec4('0x43')];_0xbb41a8[_0x6ec4('0xb6')]=qs[_0x6ec4('0x4f')](_0x307864[_0x6ec4('0x47')][_0x6ec4('0x4f')]);_0xbb41a8['where']=qs[_0x6ec4('0x48')](_[_0x6ec4('0x50')](_0x307864[_0x6ec4('0x47')],_0x4ed79e[_0x6ec4('0x48')]));if(_0x307864[_0x6ec4('0x47')][_0x6ec4('0x59')]){_0xbb41a8[_0x6ec4('0x51')]=_[_0x6ec4('0x5a')](_0xbb41a8['where'],{'$or':_['map'](_0xbb41a8['attributes'],function(_0x1579ba){var _0x3cc401={};_0x3cc401[_0x1579ba]={'$like':'%'+_0x307864[_0x6ec4('0x47')]['filter']+'%'};return _0x3cc401;})});}_0xbb41a8[_0x6ec4('0x43')]=db[_0x6ec4('0x41')];_0xbb41a8['as']=_0x6ec4('0x36');_0xbb41a8=_[_0x6ec4('0x5a')]({},_0xbb41a8,_0x307864[_0x6ec4('0x5b')]);return _0xdc8e9d['getVoiceQueues']({'include':[_0xbb41a8]});}})[_0x6ec4('0x32')](function(_0x23332b){if(_0x23332b){var _0x18e2b0={},_0x165e9f=[],_0x7c039f=0x0;for(var _0x3dc7d5=0x0;_0x3dc7d5<_0x23332b['length'];_0x3dc7d5+=0x1){for(var _0x122f37=0x0,_0x6f9286;_0x122f37<_0x23332b[_0x3dc7d5][_0x6ec4('0x36')][_0x6ec4('0x4c')];_0x122f37+=0x1){_0x6f9286=_0x23332b[_0x3dc7d5][_0x6ec4('0x36')][_0x122f37][_0x6ec4('0x34')]({'plain':!![]});_0x18e2b0[_0x6f9286['id']]=_0x6f9286;}}_0x18e2b0=_[_0x6ec4('0xfe')](_0x18e2b0);for(var _0x284247=qs[_0x6ec4('0x2b')](_0x307864[_0x6ec4('0x47')]['offset']);_0x284247<_0x18e2b0[_0x6ec4('0x4c')]&&_0x165e9f[_0x6ec4('0x4c')]=_0x2b82ff){_0x30b5b7=_0x2b82ff;_0x5ad1cb=0xc8;}else{_0x5ad1cb=0xce;}_0x3a91bb[_0xb1c3('0x2a')](_0x5ad1cb);return _0x3a91bb[_0xb1c3('0x30')]('Content-Range',_0x52b961+'-'+_0x30b5b7+'/'+_0x2b82ff)['json'](_0x5c335f);}return null;};}function patchUpdates(_0x2dc95f){return function(_0x41b8c){try{jsonpatch[_0xb1c3('0x31')](_0x41b8c,_0x2dc95f,!![]);}catch(_0x18d556){return BPromise[_0xb1c3('0x32')](_0x18d556);}return _0x41b8c[_0xb1c3('0x33')]();};}function saveUpdates(_0x1af122,_0x578d49){return function(_0x10d2e1){if(_0x10d2e1){return _0x10d2e1['update'](_0x1af122)[_0xb1c3('0x1d')](function(_0x106e06){return _0x106e06;});}return null;};}function removeEntity(_0x53aa89,_0x27f709){return function(_0x1f126f){if(_0x1f126f){return _0x1f126f[_0xb1c3('0x34')]()[_0xb1c3('0x1d')](function(){var _0x58a9df=_0x1f126f[_0xb1c3('0x35')]({'plain':!![]});var _0xc28b8=[{'name':_0xb1c3('0x36'),'value':_0xb1c3('0x37'),'ignore':!![]},{'name':_0xb1c3('0x38'),'value':_0xb1c3('0x39'),'ignore':![]},{'name':_0xb1c3('0x3a'),'value':_0xb1c3('0x3b'),'ignore':![]}];var _0x95a7a4=_(_0xc28b8)[_0xb1c3('0x3c')](_0xb1c3('0x3d'))[_0xb1c3('0x3e')]('value')[_0xb1c3('0x3f')]();if(_[_0xb1c3('0x40')](_0x95a7a4,_0x58a9df['role'])){return;}var _0x319a2e=_[_0xb1c3('0x41')](_0xc28b8,[_0xb1c3('0x3f'),_0x58a9df[_0xb1c3('0x42')]])[_0xb1c3('0x43')];return db[_0xb1c3('0x44')][_0xb1c3('0x34')]({'where':{'type':_0x319a2e,'resourceId':_0x58a9df['id']}})[_0xb1c3('0x1d')](function(){return _0x1f126f;});})['then'](function(){_0x53aa89[_0xb1c3('0x2a')](0xcc)[_0xb1c3('0x2b')]();});}};}function handleEntityNotFound(_0x157488,_0x5b7e25){return function(_0x507034){if(!_0x507034){_0x157488[_0xb1c3('0x29')](0x194);}return _0x507034;};}function handleError(_0x31507b,_0x52dd8a){_0x52dd8a=_0x52dd8a||0x1f4;return function(_0x19cd9f){logger[_0xb1c3('0x24')](_0x19cd9f['stack']);if(_0x19cd9f[_0xb1c3('0x43')]){delete _0x19cd9f['name'];}_0x31507b[_0xb1c3('0x2a')](_0x52dd8a)['send'](_0x19cd9f);};}exports[_0xb1c3('0x45')]=function(_0x5444f1,_0x1c7d6b){var _0x319f57={},_0x2d5f85={},_0x40fedc={'count':0x0,'rows':[]};var _0x5cf38e=db[_0xb1c3('0x46')][_0xb1c3('0x47')];_0x2d5f85['model']=_[_0xb1c3('0x48')](_[_0xb1c3('0x49')](_0x5cf38e),[_0xb1c3('0x4a'),_0xb1c3('0x4b')]);_0x2d5f85[_0xb1c3('0x4c')]=_[_0xb1c3('0x49')](_0x5444f1[_0xb1c3('0x4c')]);_0x2d5f85[_0xb1c3('0x4d')]=_[_0xb1c3('0x4e')](_0x2d5f85[_0xb1c3('0x4f')],_0x2d5f85['query']);_0x319f57[_0xb1c3('0x50')]=_[_0xb1c3('0x4e')](_0x2d5f85[_0xb1c3('0x4f')],qs[_0xb1c3('0x51')](_0x5444f1['query']['fields']));_0x319f57['attributes']=_0x319f57[_0xb1c3('0x50')][_0xb1c3('0x52')]?_0x319f57['attributes']:_0x2d5f85[_0xb1c3('0x4f')];if(!_0x5444f1[_0xb1c3('0x4c')][_0xb1c3('0x53')](_0xb1c3('0x54'))){_0x319f57[_0xb1c3('0x2f')]=qs[_0xb1c3('0x2f')](_0x5444f1[_0xb1c3('0x4c')][_0xb1c3('0x2f')]);_0x319f57[_0xb1c3('0x2e')]=qs[_0xb1c3('0x2e')](_0x5444f1[_0xb1c3('0x4c')][_0xb1c3('0x2e')]);}_0x319f57[_0xb1c3('0x55')]=qs[_0xb1c3('0x56')](_0x5444f1[_0xb1c3('0x4c')][_0xb1c3('0x56')]);_0x319f57[_0xb1c3('0x57')]=qs[_0xb1c3('0x4d')](_[_0xb1c3('0x58')](_0x5444f1[_0xb1c3('0x4c')],_0x2d5f85[_0xb1c3('0x4d')]));if(_0x5444f1[_0xb1c3('0x4c')][_0xb1c3('0x3c')]){_0x319f57[_0xb1c3('0x57')]=_['merge'](_0x319f57['where'],{'$or':_[_0xb1c3('0x3e')](_0x5cf38e,function(_0x55a72c){if(_0x55a72c[_0xb1c3('0x59')][_0xb1c3('0x5a')]!=='VIRTUAL'){return db[_0xb1c3('0x5b')][_0xb1c3('0x57')](db['sequelize']['fn'](_0xb1c3('0x5c'),db[_0xb1c3('0x5b')][_0xb1c3('0x5d')](_0x55a72c[_0xb1c3('0x5e')])),{'$like':db[_0xb1c3('0x5b')]['fn'](_0xb1c3('0x5c'),'%'+_0x5444f1[_0xb1c3('0x4c')][_0xb1c3('0x3c')]+'%')});}})});}_0x319f57=_[_0xb1c3('0x5f')]({},_0x319f57,_0x5444f1[_0xb1c3('0x60')]);var _0x39fa69={'where':_0x319f57['where']};return db[_0xb1c3('0x46')][_0xb1c3('0x2d')](_0x39fa69)[_0xb1c3('0x1d')](function(_0x84e68a){_0x40fedc['count']=_0x84e68a;if(_0x5444f1[_0xb1c3('0x4c')][_0xb1c3('0x61')]){_0x319f57[_0xb1c3('0x62')]=[{'all':!![]}];}return db[_0xb1c3('0x46')][_0xb1c3('0x63')](_0x319f57);})[_0xb1c3('0x1d')](function(_0x2ee169){_0x40fedc[_0xb1c3('0x64')]=_0x2ee169;return _0x40fedc;})['then'](respondWithFilteredResult(_0x1c7d6b,_0x319f57))['catch'](handleError(_0x1c7d6b,null));};exports[_0xb1c3('0x65')]=function(_0x1a5377,_0x25b1bb){var _0x536590={'raw':![],'where':{'id':_0x1a5377[_0xb1c3('0x66')]['id']}},_0x2ea398={};_0x2ea398[_0xb1c3('0x4f')]=_[_0xb1c3('0x48')](_[_0xb1c3('0x49')](db[_0xb1c3('0x46')][_0xb1c3('0x47')]),[_0xb1c3('0x4a'),_0xb1c3('0x4b')]);_0x2ea398[_0xb1c3('0x4c')]=_[_0xb1c3('0x49')](_0x1a5377[_0xb1c3('0x4c')]);_0x2ea398['filters']=_[_0xb1c3('0x4e')](_0x2ea398[_0xb1c3('0x4f')],_0x2ea398[_0xb1c3('0x4c')]);_0x536590[_0xb1c3('0x50')]=_[_0xb1c3('0x4e')](_0x2ea398[_0xb1c3('0x4f')],qs[_0xb1c3('0x51')](_0x1a5377['query'][_0xb1c3('0x51')]));_0x536590[_0xb1c3('0x50')]=_0x536590['attributes']['length']?_0x536590[_0xb1c3('0x50')]:_0x2ea398[_0xb1c3('0x4f')];if(_0x1a5377['query'][_0xb1c3('0x61')]){_0x536590[_0xb1c3('0x62')]=[{'all':!![]}];}_0x536590=_['merge']({},_0x536590,_0x1a5377['options']);return db[_0xb1c3('0x46')][_0xb1c3('0x41')](_0x536590)[_0xb1c3('0x1d')](handleEntityNotFound(_0x25b1bb,null))['then'](respondWithResult(_0x25b1bb,null))[_0xb1c3('0x28')](handleError(_0x25b1bb,null));};exports[_0xb1c3('0x67')]=function(_0x3b9d2f,_0x553535){return db[_0xb1c3('0x46')][_0xb1c3('0x67')](_0x3b9d2f[_0xb1c3('0x68')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x553535,0xc9))[_0xb1c3('0x28')](handleError(_0x553535,null));};exports['update']=function(_0x553355,_0x1edef3){if(_0x553355[_0xb1c3('0x68')]['id']){delete _0x553355[_0xb1c3('0x68')]['id'];}delete _0x553355['body'][_0xb1c3('0x42')];return db[_0xb1c3('0x46')][_0xb1c3('0x41')]({'where':{'id':_0x553355[_0xb1c3('0x66')]['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x1edef3,null))[_0xb1c3('0x1d')](saveUpdates(_0x553355[_0xb1c3('0x68')],null))[_0xb1c3('0x1d')](respondWithResult(_0x1edef3,null))[_0xb1c3('0x28')](handleError(_0x1edef3,null));};exports[_0xb1c3('0x69')]=function(_0x2750cd,_0x2c0404){return db[_0xb1c3('0x46')][_0xb1c3('0x69')]()[_0xb1c3('0x1d')](respondWithResult(_0x2c0404,null))[_0xb1c3('0x28')](handleError(_0x2c0404,null));};exports[_0xb1c3('0x6a')]=function(_0x22fd6f,_0x42be79,_0x2c7dcd){return db['User'][_0xb1c3('0x41')]({'where':{'id':_0x22fd6f[_0xb1c3('0x66')]['id']}})['then'](handleEntityNotFound(_0x42be79,null))['then'](function(_0x5b4072){if(_0x5b4072){return _0x5b4072[_0xb1c3('0x6a')](_0x22fd6f[_0xb1c3('0x68')][_0xb1c3('0x6b')],_[_0xb1c3('0x6c')](_0x22fd6f['body'],[_0xb1c3('0x6b'),'id'])||{});}})[_0xb1c3('0x1d')](respondWithResult(_0x42be79,null))['catch'](handleError(_0x42be79,null));};var getLicense=function(_0xe96985){return new BPromise(function(_0xccd347,_0x31fa66){var _0x2f100e=0x0;_0xe96985[_0xb1c3('0x68')][_0xb1c3('0x42')]===_0xb1c3('0x39')&&_0xccd347('agent\x20role');return db[_0xb1c3('0x46')]['count']({'where':{'$or':[{'role':_0xe96985[_0xb1c3('0x68')]['role']==='telephone'?_0xb1c3('0x3b'):[_0xb1c3('0x6d'),'user']}]}})[_0xb1c3('0x1d')](function(_0x2917fd){_0x2f100e=_0x2917fd;return require(_0xb1c3('0x6e'))[_0xb1c3('0x6f')]();})[_0xb1c3('0x1d')](function(_0x1ea5af){var _0x212ea5=_0xe96985[_0xb1c3('0x68')][_0xb1c3('0x42')]===_0xb1c3('0x3b')?_0xb1c3('0x70'):_0xb1c3('0x71');if(!_['isNil'](_0x1ea5af[_0x212ea5])&&_0x2f100e>=_0x1ea5af[_0x212ea5]){return _0x31fa66({'message':_0xb1c3('0x72')});}return _0xccd347(util[_0xb1c3('0x73')](_0xb1c3('0x74'),_0x212ea5,_0x2f100e));})[_0xb1c3('0x28')](function(_0x319039){return _0x31fa66(_0x319039);});});};exports[_0xb1c3('0x75')]=function(_0x5489b2,_0x212830){return getLicense(_0x5489b2)[_0xb1c3('0x1d')](function(_0x509f26){if(!_0x5489b2[_0xb1c3('0x68')][_0xb1c3('0x76')]){var _0x564314;return db['Setting'][_0xb1c3('0x77')](0x1)[_0xb1c3('0x1d')](function(_0x3a1137){return checkPasswordPattern(_0x3a1137,_0x5489b2[_0xb1c3('0x68')]['password'],_0x3a1137['securePassword']);})[_0xb1c3('0x1d')](function(_0x4cb463){_0x564314=_0x4cb463['min_internal'];return db[_0xb1c3('0x46')][_0xb1c3('0x78')](_0xb1c3('0x76'));})[_0xb1c3('0x1d')](function(_0x283963){if(_[_0xb1c3('0x79')](_0x283963)){if(_0x564314){_0x5489b2[_0xb1c3('0x68')][_0xb1c3('0x76')]=_0x564314;}else{_0x5489b2['body']['internal']=0x1;}}else{if(_[_0xb1c3('0x79')](_0x564314)||_0x564314==_0x283963){_0x5489b2[_0xb1c3('0x68')][_0xb1c3('0x76')]=_0x283963+0x1;}else if(_0x564314>_0x283963){_0x5489b2[_0xb1c3('0x68')][_0xb1c3('0x76')]=_0x564314;}else{return db[_0xb1c3('0x5b')][_0xb1c3('0x4c')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize'][_0xb1c3('0x7a')]['SELECT']})['then'](function(_0x29b6ff){if(_0x29b6ff&&_0x29b6ff['length']){for(var _0x23e13b=0x0,_0x7f6da0=_0x29b6ff[_0xb1c3('0x52')];_0x23e13b<_0x7f6da0&&_[_0xb1c3('0x79')](_0x5489b2[_0xb1c3('0x68')]['internal']);_0x23e13b++){if(_0x564314<=_0x29b6ff[_0x23e13b][_0xb1c3('0x7b')]){_0x5489b2['body'][_0xb1c3('0x76')]=_0x29b6ff[_0x23e13b]['from'];}else if(_0x564314>_0x29b6ff[_0x23e13b][_0xb1c3('0x7b')]&&_0x564314<=_0x29b6ff[_0x23e13b]['to']){_0x5489b2['body'][_0xb1c3('0x76')]=_0x564314;}}}if(_[_0xb1c3('0x79')](_0x5489b2[_0xb1c3('0x68')][_0xb1c3('0x76')])){_0x5489b2[_0xb1c3('0x68')]['internal']=_0x283963+0x1;}});}}});}})[_0xb1c3('0x1d')](function(){if(_0x5489b2[_0xb1c3('0x68')]['voicemail']){_0x5489b2[_0xb1c3('0x68')]['mailbox']=_0x5489b2[_0xb1c3('0x68')][_0xb1c3('0x76')];_0x5489b2[_0xb1c3('0x68')]['VoiceMail']={'mailbox':_0x5489b2['body']['internal'],'password':_0x5489b2[_0xb1c3('0x68')][_0xb1c3('0x4a')],'fullname':_0x5489b2[_0xb1c3('0x68')]['fullname'],'email':_0x5489b2[_0xb1c3('0x68')][_0xb1c3('0x7c')]};}if(_0x5489b2['body']&&_0x5489b2[_0xb1c3('0x68')][_0xb1c3('0x42')]===_0xb1c3('0x39')){_0x5489b2[_0xb1c3('0x68')][_0xb1c3('0x7d')]=[_0xb1c3('0x7e'),_0xb1c3('0x7f'),'103','110',_0xb1c3('0x80'),_0xb1c3('0x81'),_0xb1c3('0x82'),_0xb1c3('0x83'),_0xb1c3('0x84'),'109',_0xb1c3('0x85'),_0xb1c3('0x86')];}return db[_0xb1c3('0x46')][_0xb1c3('0x75')](_0x5489b2['body'],{'include':[{'model':db[_0xb1c3('0x87')],'as':_0xb1c3('0x87')}]});})[_0xb1c3('0x1d')](function(_0x176595){if(_0x5489b2[_0xb1c3('0x68')]['role']==='user')return _0x176595;var _0x446eff=_0x5489b2['user'][_0xb1c3('0x35')]({'plain':!![]});if(!_0x446eff)throw new Error(_0xb1c3('0x88'));if(_0x446eff[_0xb1c3('0x42')]===_0xb1c3('0x37')){var _0x1254c6=_0x176595[_0xb1c3('0x35')]({'plain':!![]});var _0x296ccb=[{'name':_0xb1c3('0x38'),'value':'agent'},{'name':_0xb1c3('0x3a'),'value':'telephone'}];var _0x2c21e0=_[_0xb1c3('0x41')](_0x296ccb,[_0xb1c3('0x3f'),_0x1254c6[_0xb1c3('0x42')]])['name'];return db[_0xb1c3('0x89')][_0xb1c3('0x41')]({'where':{'name':_0x2c21e0,'userProfileId':_0x446eff[_0xb1c3('0x8a')]},'raw':!![]})[_0xb1c3('0x1d')](function(_0x2def40){if(_0x2def40&&_0x2def40[_0xb1c3('0x8b')]===0x0){return db[_0xb1c3('0x44')][_0xb1c3('0x75')]({'name':_0x1254c6['name'],'resourceId':_0x1254c6['id'],'type':_0x2def40['name'],'sectionId':_0x2def40['id']},{})[_0xb1c3('0x1d')](function(){return _0x176595;});}else{return _0x176595;}})['catch'](function(_0x480deb){logger['error'](_0xb1c3('0x8c'),_0x480deb);throw _0x480deb;});}return _0x176595;})['then'](respondWithResult(_0x212830,0xc9))['catch'](handleError(_0x212830,null));};exports[_0xb1c3('0x8d')]=function(_0x4fcb2f,_0x135d8a,_0x179c72){var _0x374b94=![];if(_0x4fcb2f[_0xb1c3('0x68')]['id']){delete _0x4fcb2f[_0xb1c3('0x68')]['id'];}if(!_['isNil'](_0x4fcb2f[_0xb1c3('0x68')][_0xb1c3('0x8e')])){if(_0x4fcb2f['body'][_0xb1c3('0x8e')]===_0x4fcb2f[_0xb1c3('0x68')][_0xb1c3('0x8f')]){throw new Error(_0xb1c3('0x90'));}}return db[_0xb1c3('0x46')][_0xb1c3('0x41')]({'where':{'id':_0x4fcb2f[_0xb1c3('0x66')]['id']}})['then'](function(_0x1cc02c){if(_0x1cc02c){if(_0x1cc02c['id']==_0x4fcb2f['user']['id']){if(!_0x4fcb2f[_0xb1c3('0x68')][_0xb1c3('0x8e')]||!_0x4fcb2f[_0xb1c3('0x68')][_0xb1c3('0x8f')]){throw new db['Sequelize'][(_0xb1c3('0x91'))](_0xb1c3('0x92'));}if(!_0x1cc02c[_0xb1c3('0x93')](_0x4fcb2f[_0xb1c3('0x68')]['oldPassword'])){throw new db[(_0xb1c3('0x94'))][(_0xb1c3('0x91'))](_0xb1c3('0x95'));}if(_0x4fcb2f[_0xb1c3('0x68')][_0xb1c3('0x8e')]==_0x4fcb2f[_0xb1c3('0x68')][_0xb1c3('0x8f')]){throw new db['Sequelize'][(_0xb1c3('0x91'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x1cc02c;}else if(_0x4fcb2f[_0xb1c3('0x37')][_0xb1c3('0x42')]==_0xb1c3('0x6d')){if(!_0x4fcb2f[_0xb1c3('0x68')]['newPassword']){throw new db[(_0xb1c3('0x94'))]['ValidationError'](_0xb1c3('0x96'));}return _0x1cc02c;}else if(_0x4fcb2f[_0xb1c3('0x37')][_0xb1c3('0x42')]==_0xb1c3('0x37')){if(!_0x4fcb2f[_0xb1c3('0x68')][_0xb1c3('0x8f')]){throw new db[(_0xb1c3('0x94'))][(_0xb1c3('0x91'))](_0xb1c3('0x96'));}if(_0x1cc02c[_0xb1c3('0x42')]!=_0xb1c3('0x39')){throw new db['Sequelize']['ValidationError'](_0xb1c3('0x97'));}return _0x1cc02c;}else{throw new db[(_0xb1c3('0x94'))][(_0xb1c3('0x91'))](_0xb1c3('0x97'));}}return null;})['then'](handleEntityNotFound(_0x135d8a,null))[_0xb1c3('0x1d')](function(_0x9c4ae6){return db[_0xb1c3('0x98')][_0xb1c3('0x99')]({'attributes':['id',_0xb1c3('0x9a')]})[_0xb1c3('0x1d')](function(_0x3c640b){_0x374b94=_0x3c640b[_0xb1c3('0x9a')];return checkPasswordPattern(_0x9c4ae6,_0x4fcb2f['body'][_0xb1c3('0x8f')],_0x374b94);});})['then'](saveUpdates({'password':_0x4fcb2f['body'][_0xb1c3('0x8f')],'passwordResetAt':_0x4fcb2f['user']['id']==_0x4fcb2f[_0xb1c3('0x66')]['id']?moment():null},null))[_0xb1c3('0x1d')](respondWithResult(_0x135d8a,null))[_0xb1c3('0x28')](handleError(_0x135d8a,null));};exports[_0xb1c3('0x9b')]=function(_0x54f3bf,_0x363c50,_0x35b13a){var _0x4db10e=_0x54f3bf[_0xb1c3('0x68')][_0xb1c3('0x9c')];return db[_0xb1c3('0x46')]['find']({'where':{'id':_0x54f3bf['params']['id']},'attributes':['id','name',_0xb1c3('0x42'),_0xb1c3('0x9d'),'loginInPause',_0xb1c3('0x9e'),_0xb1c3('0x9f')]})[_0xb1c3('0x1d')](handleEntityNotFound(_0x363c50,null))['then'](function(_0x1399ee){if(_0x1399ee){if(!utils[_0xb1c3('0xa0')](_0x4db10e)){throw new db[(_0xb1c3('0x94'))]['ValidationError'](_0xb1c3('0xa1'));}return _0x1399ee[_0xb1c3('0xa2')+_[_0xb1c3('0xa3')](_0x4db10e[_0xb1c3('0xa4')]())+_0xb1c3('0xa5')](_0x54f3bf[_0xb1c3('0x68')]['ids'],{'penalty':_0x54f3bf[_0xb1c3('0x68')][_0xb1c3('0xa6')]||0x0})[_0xb1c3('0xa7')](function(_0x5c8d27){for(var _0x37ddc1=0x0;_0x37ddc1<_0x54f3bf['body']['ids'][_0xb1c3('0x52')];_0x37ddc1+=0x1){var _0x4996bc={'UserId':_0x54f3bf[_0xb1c3('0x66')]['id']};_0x4996bc[_[_0xb1c3('0xa3')](_0x4db10e[_0xb1c3('0xa4')]())+'QueueId']=_0x54f3bf[_0xb1c3('0x68')][_0xb1c3('0x6b')][_0x37ddc1];socket[_0xb1c3('0xa8')](_0xb1c3('0x37')+_[_0xb1c3('0xa3')](_0x4db10e['toLowerCase']())+_0xb1c3('0xa9'),_0x4996bc);}return _0x5c8d27;})['then'](function(){if(_0x4db10e===_0xb1c3('0xaa')){return db[_0xb1c3('0xab')]['findAll']({'where':{'id':_0x54f3bf[_0xb1c3('0x68')][_0xb1c3('0x6b')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xb1c3('0x1d')](function(_0x978da6){var _0x5ec795=_0x1399ee['get']({'plain':!![]});var _0x255e85=[];if(_0x4db10e===_0xb1c3('0xaa')&&_0x5ec795[_0xb1c3('0x42')]===_0xb1c3('0x39')&&_0x5ec795['online']){for(var _0x2e9ef5=0x0;_0x2e9ef5<_0x978da6['length'];_0x2e9ef5+=0x1){_0x255e85[_0xb1c3('0xac')]({'membername':_0x5ec795[_0xb1c3('0x43')],'UserId':_0x5ec795['id'],'queue_name':_0x978da6[_0x2e9ef5][_0xb1c3('0x43')],'VoiceQueueId':_0x978da6[_0x2e9ef5]['id'],'interface':_[_0xb1c3('0x79')](_0x5ec795[_0xb1c3('0x9f')])?util[_0xb1c3('0x73')](_0xb1c3('0xad'),_0x5ec795[_0xb1c3('0x43')]):_0x5ec795[_0xb1c3('0x9f')],'paused':_0x5ec795[_0xb1c3('0x9e')]||![],'penalty':_0x54f3bf['body']['penalty']||0x0});}return BPromise[_0xb1c3('0xae')](_0x255e85,function(_0x7b5b15){return db[_0xb1c3('0xaf')][_0xb1c3('0xb0')](_0x7b5b15);});}return _0x1399ee;});}})[_0xb1c3('0x1d')](respondWithStatusCode(_0x363c50,null))[_0xb1c3('0x28')](handleError(_0x363c50,null));};exports[_0xb1c3('0xb1')]=function(_0x16fc88,_0x4fa60a,_0x16faae){var _0x124ecf;return db['User']['find']({'where':{'id':_0x16fc88[_0xb1c3('0x66')]['id']},'attributes':['id',_0xb1c3('0x43'),_0xb1c3('0x42')]})['then'](handleEntityNotFound(_0x4fa60a,null))[_0xb1c3('0x1d')](function(_0x33e1ff){if(_0x33e1ff){_0x124ecf=_0x33e1ff;if(!_0x16fc88[_0xb1c3('0x4c')][_0xb1c3('0x9c')]||!utils['isValidChannel'](_0x16fc88['query']['channel'])){throw new db[(_0xb1c3('0x94'))][(_0xb1c3('0x91'))](_0xb1c3('0xa1'));}return _0x33e1ff[_0xb1c3('0xb2')+_[_0xb1c3('0xa3')](_0x16fc88['query'][_0xb1c3('0x9c')][_0xb1c3('0xa4')]())+_0xb1c3('0xa5')](_0x16fc88['query'][_0xb1c3('0x6b')]);}})[_0xb1c3('0x1d')](function(_0x2e6e42){for(var _0xa7e34a=0x0;_0xa7e34a<_0x16fc88[_0xb1c3('0x4c')][_0xb1c3('0x6b')][_0xb1c3('0x52')];_0xa7e34a+=0x1){var _0xa34c6d={'UserId':_0x16fc88['params']['id']};_0xa34c6d[_[_0xb1c3('0xa3')](_0x16fc88['query'][_0xb1c3('0x9c')][_0xb1c3('0xa4')]())+'QueueId']=_0x16fc88[_0xb1c3('0x4c')]['ids'][_0xa7e34a];socket[_0xb1c3('0xa8')](_0xb1c3('0x37')+_[_0xb1c3('0xa3')](_0x16fc88['query']['channel']['toLowerCase']())+'Queue:remove',_0xa34c6d);}return _0x2e6e42;})[_0xb1c3('0x1d')](function(){if(_0x16fc88[_0xb1c3('0x4c')][_0xb1c3('0x9c')]===_0xb1c3('0xaa')){return db[_0xb1c3('0xaf')][_0xb1c3('0x34')]({'where':{'UserId':_0x16fc88['params']['id'],'VoiceQueueId':_0x16fc88['query'][_0xb1c3('0x6b')]},'individualHooks':!![]})[_0xb1c3('0x1d')](function(){return _0x124ecf;});}return _0x124ecf;})[_0xb1c3('0x1d')](respondWithStatusCode(_0x4fa60a,null))[_0xb1c3('0x28')](handleError(_0x4fa60a,null));};exports[_0xb1c3('0xb3')]=function(_0x32388b,_0xd02cc2,_0x949477){_0x32388b['body']['userpic']=_0x32388b[_0xb1c3('0xb4')][_0xb1c3('0xb5')];return db['User'][_0xb1c3('0x41')]({'where':{'id':_0x32388b[_0xb1c3('0x66')]['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0xd02cc2,null))[_0xb1c3('0x1d')](saveUpdates(_0x32388b['body'],null))['then'](respondWithResult(_0xd02cc2,null))[_0xb1c3('0x28')](handleError(_0xd02cc2,null));};exports[_0xb1c3('0xb6')]=function(_0x46b1aa,_0x13cb2c,_0x348f3d){var _0x3dfabe=path[_0xb1c3('0xb7')](config[_0xb1c3('0xb8')],'server/files/images/logos/default_profile.png');return db[_0xb1c3('0x46')]['find']({'where':{'id':_0x46b1aa[_0xb1c3('0x66')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xb1c3('0x1d')](handleEntityNotFound(_0x13cb2c,null))['then'](function(_0x3a6b34){if(_0x3a6b34){if(_['isNil'](_0x3a6b34[_0xb1c3('0xb9')])){return _0x13cb2c[_0xb1c3('0xba')](_0x3dfabe);}else{if(!fs[_0xb1c3('0xbb')](path[_0xb1c3('0xb7')](config[_0xb1c3('0xb8')],_0xb1c3('0xbc'),_0x3a6b34['userpic']))){return _0x13cb2c['download'](_0x3dfabe);}return _0x13cb2c[_0xb1c3('0xba')](path['join'](config['root'],'server/files/images/',_0x3a6b34[_0xb1c3('0xb9')]));}}})['catch'](handleError(_0x13cb2c,null));};exports['getContacts']=function(_0x26968f,_0x1265dd,_0x4f17e8){var _0x3e8532={};var _0x4f4854={};var _0x37ded0;var _0x3a82c7;return db[_0xb1c3('0x46')][_0xb1c3('0x99')]({'where':{'id':_0x26968f['params']['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x1265dd,null))[_0xb1c3('0x1d')](function(_0x4c3df0){if(_0x4c3df0){_0x37ded0=_0x4c3df0;_0x4f4854[_0xb1c3('0x4f')]=_[_0xb1c3('0x49')](db[_0xb1c3('0xbd')][_0xb1c3('0x47')]);_0x4f4854[_0xb1c3('0x4c')]=_[_0xb1c3('0x49')](_0x26968f[_0xb1c3('0x4c')]);_0x4f4854['filters']=_[_0xb1c3('0x4e')](_0x4f4854[_0xb1c3('0x4f')],_0x4f4854[_0xb1c3('0x4c')]);_0x3e8532[_0xb1c3('0x50')]=_[_0xb1c3('0x4e')](_0x4f4854[_0xb1c3('0x4f')],qs['fields'](_0x26968f[_0xb1c3('0x4c')][_0xb1c3('0x51')]));_0x3e8532[_0xb1c3('0x50')]=_0x3e8532[_0xb1c3('0x50')][_0xb1c3('0x52')]?_0x3e8532[_0xb1c3('0x50')]:_0x4f4854[_0xb1c3('0x4f')];_0x3e8532[_0xb1c3('0x55')]=qs[_0xb1c3('0x56')](_0x26968f[_0xb1c3('0x4c')][_0xb1c3('0x56')]);_0x3e8532['where']=qs[_0xb1c3('0x4d')](_['pick'](_0x26968f[_0xb1c3('0x4c')],_0x4f4854[_0xb1c3('0x4d')]));if(_0x26968f[_0xb1c3('0x4c')][_0xb1c3('0x3c')]){_0x3e8532[_0xb1c3('0x57')]=_[_0xb1c3('0x5f')](_0x3e8532[_0xb1c3('0x57')],{'$or':_[_0xb1c3('0x3e')](_0x3e8532[_0xb1c3('0x50')],function(_0x56f8c0){var _0x176e7f={};_0x176e7f[_0x56f8c0]={'$like':'%'+_0x26968f[_0xb1c3('0x4c')][_0xb1c3('0x3c')]+'%'};return _0x176e7f;})});}_0x3e8532=_[_0xb1c3('0x5f')]({},_0x3e8532,_0x26968f[_0xb1c3('0x60')]);return _0x37ded0[_0xb1c3('0xbe')](_0x3e8532);}})['then'](function(_0x52f31a){if(_0x52f31a){_0x3a82c7=_0x52f31a[_0xb1c3('0x52')];if(_0x26968f[_0xb1c3('0x4c')][_0xb1c3('0x53')](_0xb1c3('0x61'))){_0x3e8532[_0xb1c3('0x62')]=[{'model':db[_0xb1c3('0xbf')],'as':_0xb1c3('0xc0'),'required':![]},{'model':db[_0xb1c3('0xc1')],'as':_0xb1c3('0xc2'),'attributes':['id',_0xb1c3('0x43'),_0xb1c3('0xc3')],'where':_0x26968f[_0xb1c3('0x4c')][_0xb1c3('0xc4')]?{'id':_0x26968f[_0xb1c3('0x4c')]['tag']}:undefined,'required':_0x26968f[_0xb1c3('0x4c')][_0xb1c3('0xc4')]?!![]:![]}];}if(!_0x26968f[_0xb1c3('0x4c')][_0xb1c3('0x53')](_0xb1c3('0x54'))){_0x3e8532[_0xb1c3('0x2f')]=qs[_0xb1c3('0x2f')](_0x26968f[_0xb1c3('0x4c')]['limit']);_0x3e8532['offset']=qs[_0xb1c3('0x2e')](_0x26968f[_0xb1c3('0x4c')][_0xb1c3('0x2e')]);}return _0x37ded0[_0xb1c3('0xbe')](_0x3e8532);}})[_0xb1c3('0x1d')](function(_0x2d876b){if(_0x2d876b){return _0x2d876b?{'count':_0x3a82c7,'rows':_0x2d876b}:null;}})[_0xb1c3('0x1d')](respondWithResult(_0x1265dd,null))[_0xb1c3('0x28')](handleError(_0x1265dd,null));};exports[_0xb1c3('0xc5')]=function(_0x2d6bfd,_0x56ff83,_0x288b87){var _0x581ba1;var _0x4b0748;var _0x36b5d7={};var _0x480aa1;return db['User'][_0xb1c3('0x99')]({'where':{'id':_0x2d6bfd[_0xb1c3('0x66')]['id']},'attributes':['id','name',_0xb1c3('0x42')]})[_0xb1c3('0x1d')](handleEntityNotFound(_0x56ff83,null))['then'](function(_0x303dbf){if(!utils[_0xb1c3('0xa0')](_0x2d6bfd['query'][_0xb1c3('0x9c')])){throw new db[(_0xb1c3('0x94'))][(_0xb1c3('0x91'))](_0xb1c3('0xa1'));}_0x581ba1=_0x303dbf;var _0x2b5d34={};_0x2b5d34[_0xb1c3('0x4f')]=_[_0xb1c3('0x49')](db[_[_0xb1c3('0xa3')](_0x2d6bfd['query'][_0xb1c3('0x9c')])+_0xb1c3('0xc6')][_0xb1c3('0x47')]);_0x2b5d34[_0xb1c3('0x4c')]=_[_0xb1c3('0x49')](_0x2d6bfd[_0xb1c3('0x4c')]);_0x2b5d34[_0xb1c3('0x4d')]=_[_0xb1c3('0x4e')](_0x2b5d34['model'],_0x2b5d34[_0xb1c3('0x4c')]);_0x36b5d7[_0xb1c3('0x50')]=_['intersection'](_0x2b5d34[_0xb1c3('0x4f')],qs['fields'](_0x2d6bfd['query']['fields']));_0x36b5d7[_0xb1c3('0x50')]=_0x36b5d7[_0xb1c3('0x50')][_0xb1c3('0x52')]?_0x36b5d7[_0xb1c3('0x50')]:_0x2b5d34[_0xb1c3('0x4f')];_0x36b5d7[_0xb1c3('0x55')]=qs[_0xb1c3('0x56')](_0x2d6bfd[_0xb1c3('0x4c')][_0xb1c3('0x56')]);_0x36b5d7[_0xb1c3('0x57')]=qs[_0xb1c3('0x4d')](_[_0xb1c3('0x58')](_0x2d6bfd['query'],_0x2b5d34[_0xb1c3('0x4d')]));if(_0x2d6bfd['query'][_0xb1c3('0x3c')]){_0x36b5d7['where']=_[_0xb1c3('0x5f')](_0x36b5d7['where'],{'$or':_[_0xb1c3('0x3e')](_0x36b5d7[_0xb1c3('0x50')],function(_0x591f08){var _0x4c2797={};_0x4c2797[_0x591f08]={'$like':'%'+_0x2d6bfd['query']['filter']+'%'};return _0x4c2797;})});}_0x36b5d7=_[_0xb1c3('0x5f')]({},_0x36b5d7,_0x2d6bfd[_0xb1c3('0x60')]);switch(_0x581ba1[_0xb1c3('0x42')]){case _0xb1c3('0x6d'):return db[_[_0xb1c3('0xa3')](_0x2d6bfd[_0xb1c3('0x4c')][_0xb1c3('0x9c')])+_0xb1c3('0xc6')][_0xb1c3('0x63')](_0x36b5d7);case _0xb1c3('0x37'):case'agent':return _0x581ba1[_0xb1c3('0x35')+_[_0xb1c3('0xa3')](_0x2d6bfd[_0xb1c3('0x4c')][_0xb1c3('0x9c')])+_0xb1c3('0xa5')](_0x36b5d7);default:throw new db['Sequelize'][(_0xb1c3('0x91'))](_0xb1c3('0xc7'));}})['then'](function(_0x4ff4b8){_0x480aa1=_0x4ff4b8[_0xb1c3('0x52')];if(!_0x2d6bfd['query'][_0xb1c3('0x53')](_0xb1c3('0x54'))){_0x36b5d7[_0xb1c3('0x2f')]=qs[_0xb1c3('0x2f')](_0x2d6bfd[_0xb1c3('0x4c')]['limit']);_0x36b5d7[_0xb1c3('0x2e')]=qs[_0xb1c3('0x2e')](_0x2d6bfd[_0xb1c3('0x4c')][_0xb1c3('0x2e')]);}switch(_0x581ba1[_0xb1c3('0x42')]){case _0xb1c3('0x6d'):return db[_[_0xb1c3('0xa3')](_0x2d6bfd['query'][_0xb1c3('0x9c')])+'Queue'][_0xb1c3('0x63')](_0x36b5d7);case _0xb1c3('0x37'):case _0xb1c3('0x39'):return _0x581ba1[_0xb1c3('0x35')+_[_0xb1c3('0xa3')](_0x2d6bfd[_0xb1c3('0x4c')][_0xb1c3('0x9c')])+_0xb1c3('0xa5')](_0x36b5d7);}})[_0xb1c3('0x1d')](function(_0x3d7684){return{'count':_0x480aa1,'rows':_0x3d7684};})[_0xb1c3('0x1d')](respondWithResult(_0x56ff83,null))[_0xb1c3('0x28')](handleError(_0x56ff83,null));};exports['getVoiceQueuesRt']=function(_0x2069f2,_0x1a932c,_0x5d680a){var _0x44c4fb={};var _0x23c5c3={};var _0x18eedb;var _0x2989dd;return db[_0xb1c3('0x46')][_0xb1c3('0x99')]({'where':{'id':_0x2069f2[_0xb1c3('0x66')]['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x1a932c,null))[_0xb1c3('0x1d')](function(_0x5e4688){if(_0x5e4688){_0x18eedb=_0x5e4688;_0x23c5c3['model']=_['keys'](db[_0xb1c3('0xaf')][_0xb1c3('0x47')]);_0x23c5c3[_0xb1c3('0x4c')]=_[_0xb1c3('0x49')](_0x2069f2['query']);_0x23c5c3[_0xb1c3('0x4d')]=_['intersection'](_0x23c5c3[_0xb1c3('0x4f')],_0x23c5c3[_0xb1c3('0x4c')]);_0x44c4fb[_0xb1c3('0x50')]=_[_0xb1c3('0x4e')](_0x23c5c3['model'],qs[_0xb1c3('0x51')](_0x2069f2[_0xb1c3('0x4c')][_0xb1c3('0x51')]));_0x44c4fb[_0xb1c3('0x50')]=_0x44c4fb[_0xb1c3('0x50')][_0xb1c3('0x52')]?_0x44c4fb[_0xb1c3('0x50')]:_0x23c5c3['model'];_0x44c4fb['order']=qs[_0xb1c3('0x56')](_0x2069f2[_0xb1c3('0x4c')][_0xb1c3('0x56')]);_0x44c4fb[_0xb1c3('0x57')]=qs[_0xb1c3('0x4d')](_[_0xb1c3('0x58')](_0x2069f2['query'],_0x23c5c3[_0xb1c3('0x4d')]));if(_0x2069f2['query'][_0xb1c3('0x3c')]){_0x44c4fb[_0xb1c3('0x57')]=_[_0xb1c3('0x5f')](_0x44c4fb['where'],{'$or':_[_0xb1c3('0x3e')](_0x44c4fb[_0xb1c3('0x50')],function(_0x4c79de){var _0x2d6482={};_0x2d6482[_0x4c79de]={'$like':'%'+_0x2069f2[_0xb1c3('0x4c')][_0xb1c3('0x3c')]+'%'};return _0x2d6482;})});}_0x44c4fb=_['merge']({},_0x44c4fb,_0x2069f2[_0xb1c3('0x60')]);return _0x18eedb[_0xb1c3('0xc8')](_0x44c4fb);}})[_0xb1c3('0x1d')](function(_0x284d62){if(_0x284d62){_0x2989dd=_0x284d62[_0xb1c3('0x52')];if(!_0x2069f2[_0xb1c3('0x4c')][_0xb1c3('0x53')](_0xb1c3('0x54'))){_0x44c4fb[_0xb1c3('0x2f')]=qs[_0xb1c3('0x2f')](_0x2069f2['query']['limit']);_0x44c4fb[_0xb1c3('0x2e')]=qs[_0xb1c3('0x2e')](_0x2069f2[_0xb1c3('0x4c')]['offset']);}return _0x18eedb[_0xb1c3('0xc8')](_0x44c4fb);}})['then'](function(_0x44c304){if(_0x44c304){return _0x44c304?{'count':_0x2989dd,'rows':_0x44c304}:null;}})[_0xb1c3('0x1d')](respondWithResult(_0x1a932c,null))[_0xb1c3('0x28')](handleError(_0x1a932c,null));};exports[_0xb1c3('0xc9')]=function(_0x54acbf,_0x410242,_0x2ef4ed){var _0x57c27e={};var _0x40ab30={};var _0x4fe508;var _0x7747b3;return db['User'][_0xb1c3('0x99')]({'where':{'id':_0x54acbf['params']['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x410242,null))[_0xb1c3('0x1d')](function(_0x695790){if(_0x695790){_0x4fe508=_0x695790;_0x40ab30['model']=_[_0xb1c3('0x49')](db[_0xb1c3('0xca')][_0xb1c3('0x47')]);_0x40ab30[_0xb1c3('0x4c')]=_['keys'](_0x54acbf['query']);_0x40ab30[_0xb1c3('0x4d')]=_['intersection'](_0x40ab30['model'],_0x40ab30['query']);_0x57c27e[_0xb1c3('0x50')]=_[_0xb1c3('0x4e')](_0x40ab30[_0xb1c3('0x4f')],qs[_0xb1c3('0x51')](_0x54acbf[_0xb1c3('0x4c')]['fields']));_0x57c27e[_0xb1c3('0x50')]=_0x57c27e[_0xb1c3('0x50')][_0xb1c3('0x52')]?_0x57c27e[_0xb1c3('0x50')]:_0x40ab30[_0xb1c3('0x4f')];_0x57c27e[_0xb1c3('0x55')]=qs[_0xb1c3('0x56')](_0x54acbf[_0xb1c3('0x4c')][_0xb1c3('0x56')]);_0x57c27e[_0xb1c3('0x57')]=qs['filters'](_[_0xb1c3('0x58')](_0x54acbf['query'],_0x40ab30[_0xb1c3('0x4d')]));if(_0x54acbf[_0xb1c3('0x4c')]['filter']){_0x57c27e[_0xb1c3('0x57')]=_[_0xb1c3('0x5f')](_0x57c27e[_0xb1c3('0x57')],{'$or':_['map'](_0x57c27e['attributes'],function(_0x4317f9){var _0x670506={};_0x670506[_0x4317f9]={'$like':'%'+_0x54acbf[_0xb1c3('0x4c')]['filter']+'%'};return _0x670506;})});}_0x57c27e=_[_0xb1c3('0x5f')]({},_0x57c27e,_0x54acbf[_0xb1c3('0x60')]);return _0x4fe508[_0xb1c3('0xc9')](_0x57c27e);}})['then'](function(_0x5d911c){if(_0x5d911c){_0x7747b3=_0x5d911c[_0xb1c3('0x52')];if(!_0x54acbf[_0xb1c3('0x4c')][_0xb1c3('0x53')](_0xb1c3('0x54'))){_0x57c27e[_0xb1c3('0x2f')]=qs['limit'](_0x54acbf[_0xb1c3('0x4c')][_0xb1c3('0x2f')]);_0x57c27e[_0xb1c3('0x2e')]=qs[_0xb1c3('0x2e')](_0x54acbf[_0xb1c3('0x4c')][_0xb1c3('0x2e')]);}return _0x4fe508[_0xb1c3('0xc9')](_0x57c27e);}})[_0xb1c3('0x1d')](function(_0x137c5b){if(_0x137c5b){return _0x137c5b?{'count':_0x7747b3,'rows':_0x137c5b}:null;}})[_0xb1c3('0x1d')](respondWithResult(_0x410242,null))[_0xb1c3('0x28')](handleError(_0x410242,null));};exports['getRecordings']=function(_0x584387,_0x4ff1dc,_0x4316a5){var _0x25083a={'raw':!![],'where':{}};var _0x582d13={};var _0x1f31cd={'count':0x0,'rows':[]};return db[_0xb1c3('0x46')][_0xb1c3('0x99')]({'where':{'id':_0x584387[_0xb1c3('0x66')]['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x4ff1dc,null))[_0xb1c3('0x1d')](function(_0x4b9da6){if(_0x4b9da6){_0x582d13[_0xb1c3('0x4f')]=_[_0xb1c3('0x49')](db[_0xb1c3('0xcb')][_0xb1c3('0x47')]);_0x582d13[_0xb1c3('0x4c')]=_[_0xb1c3('0x49')](_0x584387['query']);_0x582d13[_0xb1c3('0x4d')]=_[_0xb1c3('0x4e')](_0x582d13[_0xb1c3('0x4f')],_0x582d13[_0xb1c3('0x4c')]);_0x25083a['attributes']=_[_0xb1c3('0x4e')](_0x582d13[_0xb1c3('0x4f')],qs['fields'](_0x584387[_0xb1c3('0x4c')][_0xb1c3('0x51')]));_0x25083a[_0xb1c3('0x50')]=_0x25083a[_0xb1c3('0x50')][_0xb1c3('0x52')]?_0x25083a[_0xb1c3('0x50')]:_0x582d13[_0xb1c3('0x4f')];if(!_0x584387[_0xb1c3('0x4c')][_0xb1c3('0x53')](_0xb1c3('0x54'))){_0x25083a[_0xb1c3('0x2f')]=qs[_0xb1c3('0x2f')](_0x584387[_0xb1c3('0x4c')]['limit']);_0x25083a[_0xb1c3('0x2e')]=qs[_0xb1c3('0x2e')](_0x584387[_0xb1c3('0x4c')][_0xb1c3('0x2e')]);}_0x25083a[_0xb1c3('0x55')]=qs['sort'](_0x584387['query']['sort']);_0x25083a['where']=qs[_0xb1c3('0x4d')](_[_0xb1c3('0x58')](_0x584387[_0xb1c3('0x4c')],_0x582d13[_0xb1c3('0x4d')]));_0x25083a[_0xb1c3('0x57')]['UserId']=_0x4b9da6['id'];if(_0x584387[_0xb1c3('0x4c')][_0xb1c3('0x3c')]){_0x25083a[_0xb1c3('0x57')]=_[_0xb1c3('0x5f')](_0x25083a[_0xb1c3('0x57')],{'$or':_['map'](_0x25083a[_0xb1c3('0x50')],function(_0x22c7be){var _0xedc7b2={};_0xedc7b2[_0x22c7be]={'$like':'%'+_0x584387['query'][_0xb1c3('0x3c')]+'%'};return _0xedc7b2;})});}_0x25083a=_['merge']({},_0x25083a,_0x584387[_0xb1c3('0x60')]);return db[_0xb1c3('0xcb')][_0xb1c3('0x2d')]({'where':_0x25083a[_0xb1c3('0x57')]})[_0xb1c3('0x1d')](function(_0x134121){_0x1f31cd[_0xb1c3('0x2d')]=_0x134121;if(_0x584387['query'][_0xb1c3('0x61')]){_0x25083a[_0xb1c3('0x62')]=[{'all':!![]}];}return db[_0xb1c3('0xcb')][_0xb1c3('0x63')](_0x25083a);})[_0xb1c3('0x1d')](function(_0x1f1c1a){_0x1f31cd[_0xb1c3('0x64')]=_0x1f1c1a;return _0x1f31cd;});}})['then'](respondWithFilteredResult(_0x4ff1dc,_0x25083a))[_0xb1c3('0x28')](handleError(_0x4ff1dc,null));};exports[_0xb1c3('0xcc')]=function(_0xedd7e,_0x53620f,_0x4f35e4){var _0x5701c3={'raw':!![],'where':{}};var _0x3086ca={};var _0x254b9a={'count':0x0,'rows':[]};return db[_0xb1c3('0x46')]['findOne']({'where':{'id':_0xedd7e['params']['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x53620f,null))[_0xb1c3('0x1d')](function(_0x41486c){if(_0x41486c){_0x3086ca['model']=_['keys'](db[_0xb1c3('0xcd')][_0xb1c3('0x47')]);_0x3086ca['query']=_[_0xb1c3('0x49')](_0xedd7e[_0xb1c3('0x4c')]);_0x3086ca[_0xb1c3('0x4d')]=_[_0xb1c3('0x4e')](_0x3086ca[_0xb1c3('0x4f')],_0x3086ca[_0xb1c3('0x4c')]);_0x5701c3[_0xb1c3('0x50')]=_[_0xb1c3('0x4e')](_0x3086ca[_0xb1c3('0x4f')],qs[_0xb1c3('0x51')](_0xedd7e['query'][_0xb1c3('0x51')]));_0x5701c3[_0xb1c3('0x50')]=_0x5701c3[_0xb1c3('0x50')][_0xb1c3('0x52')]?_0x5701c3[_0xb1c3('0x50')]:_0x3086ca[_0xb1c3('0x4f')];if(!_0xedd7e['query'][_0xb1c3('0x53')](_0xb1c3('0x54'))){_0x5701c3[_0xb1c3('0x2f')]=qs['limit'](_0xedd7e['query'][_0xb1c3('0x2f')]);_0x5701c3['offset']=qs['offset'](_0xedd7e[_0xb1c3('0x4c')][_0xb1c3('0x2e')]);}_0x5701c3[_0xb1c3('0x55')]=qs[_0xb1c3('0x56')](_0xedd7e[_0xb1c3('0x4c')][_0xb1c3('0x56')]);_0x5701c3[_0xb1c3('0x57')]=qs[_0xb1c3('0x4d')](_[_0xb1c3('0x58')](_0xedd7e['query'],_0x3086ca[_0xb1c3('0x4d')]));_0x5701c3[_0xb1c3('0x57')][_0xb1c3('0xce')]=_0x41486c['id'];if(_0xedd7e[_0xb1c3('0x4c')][_0xb1c3('0x3c')]){_0x5701c3[_0xb1c3('0x57')]=_[_0xb1c3('0x5f')](_0x5701c3[_0xb1c3('0x57')],{'$or':_[_0xb1c3('0x3e')](_0x5701c3[_0xb1c3('0x50')],function(_0x3f2523){var _0x367d66={};_0x367d66[_0x3f2523]={'$like':'%'+_0xedd7e[_0xb1c3('0x4c')][_0xb1c3('0x3c')]+'%'};return _0x367d66;})});}_0x5701c3=_[_0xb1c3('0x5f')]({},_0x5701c3,_0xedd7e[_0xb1c3('0x60')]);return db[_0xb1c3('0xcd')][_0xb1c3('0x2d')]({'where':_0x5701c3[_0xb1c3('0x57')]})[_0xb1c3('0x1d')](function(_0x1450db){_0x254b9a[_0xb1c3('0x2d')]=_0x1450db;if(_0xedd7e[_0xb1c3('0x4c')][_0xb1c3('0x61')]){_0x5701c3[_0xb1c3('0x62')]=[{'all':!![]}];}return db[_0xb1c3('0xcd')][_0xb1c3('0x63')](_0x5701c3);})['then'](function(_0xbdc6cf){_0x254b9a['rows']=_0xbdc6cf;return _0x254b9a;});}})[_0xb1c3('0x1d')](respondWithFilteredResult(_0x53620f,_0x5701c3))['catch'](handleError(_0x53620f,null));};exports[_0xb1c3('0xcf')]=function(_0x34c6e0,_0x3452ae,_0x20d61e){var _0x3edc89={};var _0x300f41={};var _0x126174;var _0x12b8c3;return db[_0xb1c3('0x46')][_0xb1c3('0x99')]({'where':{'id':_0x34c6e0[_0xb1c3('0x66')]['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x3452ae,null))[_0xb1c3('0x1d')](function(_0x2006bf){if(_0x2006bf){_0x126174=_0x2006bf;_0x300f41['model']=_[_0xb1c3('0x49')](db[_0xb1c3('0xd0')][_0xb1c3('0x47')]);_0x300f41[_0xb1c3('0x4c')]=_[_0xb1c3('0x49')](_0x34c6e0['query']);_0x300f41[_0xb1c3('0x4d')]=_[_0xb1c3('0x4e')](_0x300f41['model'],_0x300f41['query']);_0x3edc89[_0xb1c3('0x50')]=_[_0xb1c3('0x4e')](_0x300f41['model'],qs[_0xb1c3('0x51')](_0x34c6e0['query'][_0xb1c3('0x51')]));_0x3edc89[_0xb1c3('0x50')]=_0x3edc89[_0xb1c3('0x50')][_0xb1c3('0x52')]?_0x3edc89[_0xb1c3('0x50')]:_0x300f41['model'];_0x3edc89['order']=qs['sort'](_0x34c6e0['query'][_0xb1c3('0x56')]);_0x3edc89[_0xb1c3('0x57')]=qs[_0xb1c3('0x4d')](_[_0xb1c3('0x58')](_0x34c6e0['query'],_0x300f41[_0xb1c3('0x4d')]));if(_0x34c6e0[_0xb1c3('0x4c')][_0xb1c3('0x3c')]){_0x3edc89[_0xb1c3('0x57')]=_['merge'](_0x3edc89[_0xb1c3('0x57')],{'$or':_[_0xb1c3('0x3e')](_0x3edc89[_0xb1c3('0x50')],function(_0x332a63){var _0x5bc75b={};_0x5bc75b[_0x332a63]={'$like':'%'+_0x34c6e0[_0xb1c3('0x4c')][_0xb1c3('0x3c')]+'%'};return _0x5bc75b;})});}_0x3edc89=_[_0xb1c3('0x5f')]({},_0x3edc89,_0x34c6e0[_0xb1c3('0x60')]);return _0x126174[_0xb1c3('0xcf')](_0x3edc89);}})[_0xb1c3('0x1d')](function(_0x2f1aed){if(_0x2f1aed){_0x12b8c3=_0x2f1aed[_0xb1c3('0x52')];if(!_0x34c6e0[_0xb1c3('0x4c')][_0xb1c3('0x53')]('nolimit')){_0x3edc89[_0xb1c3('0x2f')]=qs['limit'](_0x34c6e0['query'][_0xb1c3('0x2f')]);_0x3edc89[_0xb1c3('0x2e')]=qs[_0xb1c3('0x2e')](_0x34c6e0[_0xb1c3('0x4c')][_0xb1c3('0x2e')]);}return _0x126174['getChatInteractions'](_0x3edc89);}})[_0xb1c3('0x1d')](function(_0x473712){if(_0x473712){return _0x473712?{'count':_0x12b8c3,'rows':_0x473712}:null;}})[_0xb1c3('0x1d')](respondWithResult(_0x3452ae,null))['catch'](handleError(_0x3452ae,null));};exports[_0xb1c3('0xd1')]=function(_0x73dddf,_0x534a18,_0x54f53c){var _0x2e69ff={};var _0x2c9afa={};var _0x57aac4;var _0x3de0b5;return db[_0xb1c3('0x46')][_0xb1c3('0x99')]({'where':{'id':_0x73dddf[_0xb1c3('0x66')]['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x534a18,null))[_0xb1c3('0x1d')](function(_0x43640b){if(_0x43640b){_0x57aac4=_0x43640b;_0x2c9afa[_0xb1c3('0x4f')]=_[_0xb1c3('0x49')](db[_0xb1c3('0xd2')]['rawAttributes']);_0x2c9afa['query']=_['keys'](_0x73dddf[_0xb1c3('0x4c')]);_0x2c9afa[_0xb1c3('0x4d')]=_[_0xb1c3('0x4e')](_0x2c9afa[_0xb1c3('0x4f')],_0x2c9afa[_0xb1c3('0x4c')]);_0x2e69ff[_0xb1c3('0x50')]=_[_0xb1c3('0x4e')](_0x2c9afa[_0xb1c3('0x4f')],qs[_0xb1c3('0x51')](_0x73dddf[_0xb1c3('0x4c')]['fields']));_0x2e69ff['attributes']=_0x2e69ff[_0xb1c3('0x50')][_0xb1c3('0x52')]?_0x2e69ff[_0xb1c3('0x50')]:_0x2c9afa[_0xb1c3('0x4f')];_0x2e69ff[_0xb1c3('0x55')]=qs['sort'](_0x73dddf[_0xb1c3('0x4c')][_0xb1c3('0x56')]);_0x2e69ff[_0xb1c3('0x57')]=qs['filters'](_[_0xb1c3('0x58')](_0x73dddf[_0xb1c3('0x4c')],_0x2c9afa['filters']));if(_0x73dddf[_0xb1c3('0x4c')][_0xb1c3('0x3c')]){_0x2e69ff[_0xb1c3('0x57')]=_[_0xb1c3('0x5f')](_0x2e69ff[_0xb1c3('0x57')],{'$or':_[_0xb1c3('0x3e')](_0x2e69ff[_0xb1c3('0x50')],function(_0x5a36ab){var _0x4f323b={};_0x4f323b[_0x5a36ab]={'$like':'%'+_0x73dddf['query'][_0xb1c3('0x3c')]+'%'};return _0x4f323b;})});}_0x2e69ff=_[_0xb1c3('0x5f')]({},_0x2e69ff,_0x73dddf[_0xb1c3('0x60')]);return _0x57aac4['getOpenchannelInteractions'](_0x2e69ff);}})[_0xb1c3('0x1d')](function(_0x248eb8){if(_0x248eb8){_0x3de0b5=_0x248eb8['length'];if(!_0x73dddf[_0xb1c3('0x4c')][_0xb1c3('0x53')](_0xb1c3('0x54'))){_0x2e69ff[_0xb1c3('0x2f')]=qs['limit'](_0x73dddf[_0xb1c3('0x4c')][_0xb1c3('0x2f')]);_0x2e69ff[_0xb1c3('0x2e')]=qs[_0xb1c3('0x2e')](_0x73dddf[_0xb1c3('0x4c')][_0xb1c3('0x2e')]);}return _0x57aac4[_0xb1c3('0xd1')](_0x2e69ff);}})[_0xb1c3('0x1d')](function(_0x56709c){if(_0x56709c){return _0x56709c?{'count':_0x3de0b5,'rows':_0x56709c}:null;}})[_0xb1c3('0x1d')](respondWithResult(_0x534a18,null))[_0xb1c3('0x28')](handleError(_0x534a18,null));};exports['getMailInteractions']=function(_0x19162e,_0x25e544,_0x1ca4b2){var _0xb06faf={'raw':!![],'where':{}};var _0x341e0e={};var _0x4f81ec={'count':0x0,'rows':[]};return db[_0xb1c3('0x46')][_0xb1c3('0x99')]({'where':{'id':_0x19162e[_0xb1c3('0x66')]['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x25e544,null))['then'](function(_0x14c17b){if(_0x14c17b){_0x341e0e[_0xb1c3('0x4f')]=_[_0xb1c3('0x49')](db[_0xb1c3('0xd3')][_0xb1c3('0x47')]);_0x341e0e['query']=_[_0xb1c3('0x49')](_0x19162e[_0xb1c3('0x4c')]);_0x341e0e[_0xb1c3('0x4d')]=_[_0xb1c3('0x4e')](_0x341e0e[_0xb1c3('0x4f')],_0x341e0e[_0xb1c3('0x4c')]);_0xb06faf[_0xb1c3('0x50')]=_[_0xb1c3('0x4e')](_0x341e0e[_0xb1c3('0x4f')],qs[_0xb1c3('0x51')](_0x19162e[_0xb1c3('0x4c')]['fields']));_0xb06faf[_0xb1c3('0x50')]=_0xb06faf['attributes'][_0xb1c3('0x52')]?_0xb06faf['attributes']:_0x341e0e[_0xb1c3('0x4f')];if(!_0x19162e[_0xb1c3('0x4c')][_0xb1c3('0x53')](_0xb1c3('0x54'))){_0xb06faf[_0xb1c3('0x2f')]=qs['limit'](_0x19162e[_0xb1c3('0x4c')][_0xb1c3('0x2f')]);_0xb06faf[_0xb1c3('0x2e')]=qs[_0xb1c3('0x2e')](_0x19162e[_0xb1c3('0x4c')]['offset']);}_0xb06faf[_0xb1c3('0x55')]=qs[_0xb1c3('0x56')](_0x19162e[_0xb1c3('0x4c')][_0xb1c3('0x56')]);_0xb06faf['where']=qs[_0xb1c3('0x4d')](_['pick'](_0x19162e[_0xb1c3('0x4c')],_0x341e0e[_0xb1c3('0x4d')]));_0xb06faf[_0xb1c3('0x57')]['UserId']=_0x14c17b['id'];if(_0x19162e[_0xb1c3('0x4c')][_0xb1c3('0x3c')]){_0xb06faf[_0xb1c3('0x57')]=_['merge'](_0xb06faf[_0xb1c3('0x57')],{'$or':_[_0xb1c3('0x3e')](_0xb06faf[_0xb1c3('0x50')],function(_0x42ba80){var _0x8da030={};_0x8da030[_0x42ba80]={'$like':'%'+_0x19162e['query']['filter']+'%'};return _0x8da030;})});}_0xb06faf=_[_0xb1c3('0x5f')]({},_0xb06faf,_0x19162e[_0xb1c3('0x60')]);return db[_0xb1c3('0xd3')]['count']({'where':_0xb06faf[_0xb1c3('0x57')]})['then'](function(_0x36504b){_0x4f81ec[_0xb1c3('0x2d')]=_0x36504b;if(_0x19162e[_0xb1c3('0x4c')][_0xb1c3('0x61')]){_0xb06faf[_0xb1c3('0x62')]=[{'all':!![]}];}return db['MailInteraction'][_0xb1c3('0x63')](_0xb06faf);})[_0xb1c3('0x1d')](function(_0x33fbad){_0x4f81ec[_0xb1c3('0x64')]=_0x33fbad;return _0x4f81ec;});}})[_0xb1c3('0x1d')](respondWithFilteredResult(_0x25e544,_0xb06faf))[_0xb1c3('0x28')](handleError(_0x25e544,null));};exports[_0xb1c3('0xd4')]=function(_0x2879db,_0x7a4e6f,_0x2111b9){var _0x534358={};var _0x2e9d1d={};var _0x2fedfe;var _0x131b93;return db['User']['findOne']({'where':{'id':_0x2879db[_0xb1c3('0x66')]['id']}})['then'](handleEntityNotFound(_0x7a4e6f,null))[_0xb1c3('0x1d')](function(_0x39a519){if(_0x39a519){_0x2fedfe=_0x39a519;_0x2e9d1d[_0xb1c3('0x4f')]=_[_0xb1c3('0x49')](db[_0xb1c3('0xd5')][_0xb1c3('0x47')]);_0x2e9d1d[_0xb1c3('0x4c')]=_[_0xb1c3('0x49')](_0x2879db[_0xb1c3('0x4c')]);_0x2e9d1d['filters']=_[_0xb1c3('0x4e')](_0x2e9d1d[_0xb1c3('0x4f')],_0x2e9d1d['query']);_0x534358['attributes']=_[_0xb1c3('0x4e')](_0x2e9d1d[_0xb1c3('0x4f')],qs[_0xb1c3('0x51')](_0x2879db[_0xb1c3('0x4c')][_0xb1c3('0x51')]));_0x534358[_0xb1c3('0x50')]=_0x534358[_0xb1c3('0x50')][_0xb1c3('0x52')]?_0x534358[_0xb1c3('0x50')]:_0x2e9d1d[_0xb1c3('0x4f')];_0x534358['order']=qs[_0xb1c3('0x56')](_0x2879db[_0xb1c3('0x4c')][_0xb1c3('0x56')]);_0x534358[_0xb1c3('0x57')]=qs[_0xb1c3('0x4d')](_['pick'](_0x2879db[_0xb1c3('0x4c')],_0x2e9d1d[_0xb1c3('0x4d')]));if(_0x2879db[_0xb1c3('0x4c')][_0xb1c3('0x3c')]){_0x534358['where']=_[_0xb1c3('0x5f')](_0x534358[_0xb1c3('0x57')],{'$or':_[_0xb1c3('0x3e')](_0x534358[_0xb1c3('0x50')],function(_0xdc8bf2){var _0x926232={};_0x926232[_0xdc8bf2]={'$like':'%'+_0x2879db[_0xb1c3('0x4c')]['filter']+'%'};return _0x926232;})});}_0x534358=_[_0xb1c3('0x5f')]({},_0x534358,_0x2879db[_0xb1c3('0x60')]);return _0x2fedfe[_0xb1c3('0xd4')](_0x534358);}})[_0xb1c3('0x1d')](function(_0x18af23){if(_0x18af23){_0x131b93=_0x18af23[_0xb1c3('0x52')];if(!_0x2879db[_0xb1c3('0x4c')][_0xb1c3('0x53')]('nolimit')){_0x534358[_0xb1c3('0x2f')]=qs[_0xb1c3('0x2f')](_0x2879db['query']['limit']);_0x534358[_0xb1c3('0x2e')]=qs[_0xb1c3('0x2e')](_0x2879db[_0xb1c3('0x4c')]['offset']);}return _0x2fedfe['getSmsInteractions'](_0x534358);}})[_0xb1c3('0x1d')](function(_0x2301d8){if(_0x2301d8){return _0x2301d8?{'count':_0x131b93,'rows':_0x2301d8}:null;}})[_0xb1c3('0x1d')](respondWithResult(_0x7a4e6f,null))[_0xb1c3('0x28')](handleError(_0x7a4e6f,null));};exports[_0xb1c3('0xd6')]=function(_0x3dc3d7,_0x5348cf,_0x24c90d){var _0x1aeb30={};var _0x1e3fc9={};var _0x3ea230;var _0x2232e0;return db[_0xb1c3('0x46')][_0xb1c3('0x99')]({'where':{'id':_0x3dc3d7[_0xb1c3('0x66')]['id']}})['then'](handleEntityNotFound(_0x5348cf,null))['then'](function(_0x311078){if(_0x311078){_0x3ea230=_0x311078;_0x1e3fc9[_0xb1c3('0x4f')]=_[_0xb1c3('0x49')](db[_0xb1c3('0xd7')][_0xb1c3('0x47')]);_0x1e3fc9['query']=_[_0xb1c3('0x49')](_0x3dc3d7['query']);_0x1e3fc9[_0xb1c3('0x4d')]=_[_0xb1c3('0x4e')](_0x1e3fc9[_0xb1c3('0x4f')],_0x1e3fc9[_0xb1c3('0x4c')]);_0x1aeb30[_0xb1c3('0x50')]=_[_0xb1c3('0x4e')](_0x1e3fc9[_0xb1c3('0x4f')],qs[_0xb1c3('0x51')](_0x3dc3d7[_0xb1c3('0x4c')][_0xb1c3('0x51')]));_0x1aeb30['attributes']=_0x1aeb30[_0xb1c3('0x50')]['length']?_0x1aeb30[_0xb1c3('0x50')]:_0x1e3fc9[_0xb1c3('0x4f')];_0x1aeb30['order']=qs['sort'](_0x3dc3d7[_0xb1c3('0x4c')]['sort']);_0x1aeb30['where']=qs[_0xb1c3('0x4d')](_[_0xb1c3('0x58')](_0x3dc3d7[_0xb1c3('0x4c')],_0x1e3fc9['filters']));if(_0x3dc3d7['query'][_0xb1c3('0x3c')]){_0x1aeb30[_0xb1c3('0x57')]=_[_0xb1c3('0x5f')](_0x1aeb30['where'],{'$or':_[_0xb1c3('0x3e')](_0x1aeb30['attributes'],function(_0x303ce1){var _0x4e1c8a={};_0x4e1c8a[_0x303ce1]={'$like':'%'+_0x3dc3d7['query'][_0xb1c3('0x3c')]+'%'};return _0x4e1c8a;})});}_0x1aeb30=_[_0xb1c3('0x5f')]({},_0x1aeb30,_0x3dc3d7[_0xb1c3('0x60')]);return _0x3ea230[_0xb1c3('0xd6')](_0x1aeb30);}})[_0xb1c3('0x1d')](function(_0x305c1a){if(_0x305c1a){_0x2232e0=_0x305c1a[_0xb1c3('0x52')];if(!_0x3dc3d7[_0xb1c3('0x4c')][_0xb1c3('0x53')]('nolimit')){_0x1aeb30['limit']=qs[_0xb1c3('0x2f')](_0x3dc3d7['query'][_0xb1c3('0x2f')]);_0x1aeb30[_0xb1c3('0x2e')]=qs[_0xb1c3('0x2e')](_0x3dc3d7[_0xb1c3('0x4c')][_0xb1c3('0x2e')]);}return _0x3ea230[_0xb1c3('0xd6')](_0x1aeb30);}})['then'](function(_0x3b7d3f){if(_0x3b7d3f){return _0x3b7d3f?{'count':_0x2232e0,'rows':_0x3b7d3f}:null;}})[_0xb1c3('0x1d')](respondWithResult(_0x5348cf,null))[_0xb1c3('0x28')](handleError(_0x5348cf,null));};exports['login']=function(_0xba50a4,_0x3a250a,_0x3ee3fd){var _0x3af0c3;var _0x332605;var _0x397097;var _0xe08f2c=!_[_0xb1c3('0x79')](_0xba50a4[_0xb1c3('0x66')]['id'])?_0xba50a4[_0xb1c3('0x66')]['id']:!_['isNil'](_0xba50a4[_0xb1c3('0x37')]['id'])?_0xba50a4[_0xb1c3('0x37')]['id']:null;return db[_0xb1c3('0x46')]['find']({'where':{'id':_0xe08f2c,'role':_0xb1c3('0x39')},'attributes':['id',_0xb1c3('0x43'),_0xb1c3('0xd8'),_0xb1c3('0xd9'),_0xb1c3('0x42'),_0xb1c3('0x76'),_0xb1c3('0xda')]})[_0xb1c3('0x1d')](handleEntityNotFound(_0x3a250a,null))[_0xb1c3('0x1d')](function(_0xf8f2a7){if(_0xf8f2a7){_0x3af0c3=_0xf8f2a7;if(_0xba50a4[_0xb1c3('0x68')][_0xb1c3('0x9f')]){_0x397097=util[_0xb1c3('0x73')](_0xb1c3('0xdb'),_0x3af0c3[_0xba50a4[_0xb1c3('0x68')][_0xb1c3('0x9f')]]);}else if(_0xba50a4[_0xb1c3('0x68')][_0xb1c3('0xdc')]){_0x397097=util[_0xb1c3('0x73')](_0xb1c3('0xad'),_0xba50a4[_0xb1c3('0x68')][_0xb1c3('0xdc')]);}else{_0x397097=util['format'](_0xb1c3('0xad'),_0x3af0c3[_0xb1c3('0x43')]);}socket['to'](util['format'](_0xb1c3('0xdd'),_0x3af0c3[_0xb1c3('0x43')]))[_0xb1c3('0xa8')](_0xb1c3('0xde'),{'ip':_0xba50a4[_0xb1c3('0xdf')][_0xb1c3('0xe0')]||_0xba50a4[_0xb1c3('0xe1')][_0xb1c3('0xe2')]||_0xba50a4[_0xb1c3('0xe3')]['remoteAddress']||_0xba50a4[_0xb1c3('0xe1')][_0xb1c3('0xe3')][_0xb1c3('0xe2')]});return db[_0xb1c3('0xaf')]['destroy']({'where':{'membername':_0x3af0c3[_0xb1c3('0x43')]},'individualHooks':!![]});}})[_0xb1c3('0x1d')](function(_0x5330d2){if(_0x3af0c3){return _0x3af0c3[_0xb1c3('0xe4')]({'raw':!![]});}})[_0xb1c3('0x1d')](function(_0x5651d2){var _0x51465d=[];if(_0x5651d2){_0x332605=_0x5651d2;if(_0x332605[_0xb1c3('0x52')]){for(var _0x1ad3f1=0x0;_0x1ad3f1<_0x332605['length'];_0x1ad3f1++){_0x51465d['push']({'membername':_0x3af0c3[_0xb1c3('0x43')],'UserId':_0x3af0c3['id'],'queue_name':_0x332605[_0x1ad3f1][_0xb1c3('0x43')],'VoiceQueueId':_0x332605[_0x1ad3f1]['id'],'interface':_0x397097,'paused':_0x3af0c3[_0xb1c3('0xda')]||![],'penalty':_0x332605[_0x1ad3f1][_0xb1c3('0xe5')]||0x0});}return BPromise['each'](_0x51465d,function(_0x4ed4da){return db[_0xb1c3('0xaf')][_0xb1c3('0xb0')](_0x4ed4da);});}}})[_0xb1c3('0x1d')](function(){return db[_0xb1c3('0xe6')]['findAll']({'where':{'membername':_0x3af0c3[_0xb1c3('0x43')],'exitAt':null}});})[_0xb1c3('0x1d')](function(_0x4fdfe2){var _0x54655e=[];_0x4fdfe2['forEach'](function(_0x386089){_0x54655e[_0xb1c3('0xac')](_0x386089[_0xb1c3('0xe7')]({'exitAt':moment()[_0xb1c3('0x73')](_0xb1c3('0xe8'))}));});return BPromise[_0xb1c3('0xe9')](_0x54655e);})[_0xb1c3('0x1d')](function(){var _0x312d16=[];var _0x43a338=[];var _0x18fc94=utils['getChannels']();var _0xc35329={'membername':_0x3af0c3[_0xb1c3('0x43')],'interface':_0x397097,'enterAt':moment()['format'](_0xb1c3('0xe8')),'role':_0x3af0c3[_0xb1c3('0x42')],'internal':_0x3af0c3[_0xb1c3('0x76')]};_0x18fc94['forEach'](function(_0x579dc9){_0x312d16[_0xb1c3('0xac')](_['merge']({'channel':_0x579dc9,'type':'LOGIN','data1':_0xba50a4['body'][_0xb1c3('0xea')],'data2':_0x397097},_0xc35329));if(_0x3af0c3[_0xb1c3('0xda')]){_0x43a338['push'](_[_0xb1c3('0x5f')]({'channel':_0x579dc9,'type':_0xb1c3('0xeb'),'data1':'LOGININPAUSE'},_0xc35329));}});return db[_0xb1c3('0xe6')][_0xb1c3('0x67')](_0x312d16['concat'](_0x43a338),{'individualHooks':!![]});})['then'](function(){return _0x3af0c3['update']({'online':!![],'lastLoginAt':moment()[_0xb1c3('0x73')](_0xb1c3('0xe8')),'voicePause':_0x3af0c3[_0xb1c3('0xda')]||![],'mailPause':_0x3af0c3[_0xb1c3('0xda')]||![],'chatPause':_0x3af0c3[_0xb1c3('0xda')]||![],'faxPause':_0x3af0c3[_0xb1c3('0xda')]||![],'smsPause':_0x3af0c3[_0xb1c3('0xda')]||![],'openchannelPause':_0x3af0c3['loginInPause']||![],'pauseType':_0x3af0c3['loginInPause']?_0xb1c3('0xec'):null,'interface':_0x397097,'lastPauseAt':moment()[_0xb1c3('0x73')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xb1c3('0x1d')](function(_0x30ea76){if(_0xba50a4[_0xb1c3('0xed')]){return _0x3ee3fd();}else{return BPromise[_0xb1c3('0xee')](_0x30ea76)['then'](respondWithResult(_0x3a250a,null));}})[_0xb1c3('0x28')](handleError(_0x3a250a,null));};exports[_0xb1c3('0xef')]=function(_0x3c2fcc,_0x4e00b1,_0x472a30){var _0x5dba9a;return db[_0xb1c3('0x46')]['find']({'where':{'id':_0x3c2fcc[_0xb1c3('0x66')]['id'],'role':_0xb1c3('0x39')},'attributes':['id','name','role']})[_0xb1c3('0x1d')](handleEntityNotFound(_0x4e00b1,null))[_0xb1c3('0x1d')](function(_0x292d36){if(_0x292d36){_0x5dba9a=_0x292d36;return db[_0xb1c3('0xaf')][_0xb1c3('0x34')]({'where':{'membername':_0x5dba9a[_0xb1c3('0x43')]},'individualHooks':!![]});}})[_0xb1c3('0x1d')](function(){return db[_0xb1c3('0xe6')][_0xb1c3('0x63')]({'where':{'membername':_0x5dba9a[_0xb1c3('0x43')],'exitAt':null}});})['then'](function(_0x1ff4f1){var _0x379ec0=[];_0x1ff4f1[_0xb1c3('0xf0')](function(_0x1e3965){_0x379ec0[_0xb1c3('0xac')](_0x1e3965['update']({'exitAt':moment()['format'](_0xb1c3('0xe8'))}));});return BPromise[_0xb1c3('0xe9')](_0x379ec0);})['then'](function(){return _0x5dba9a['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x4e00b1,null))[_0xb1c3('0x28')](handleError(_0x4e00b1,null));};exports['pause']=function(_0x479aae,_0x30c9de,_0x411574){var _0x320569;return db[_0xb1c3('0xaf')]['update']({'paused':0x1},{'where':{'UserId':_0x479aae[_0xb1c3('0x66')]['id']},'individualHooks':!![]})[_0xb1c3('0x1d')](function(){return db[_0xb1c3('0x46')][_0xb1c3('0x41')]({'where':{'id':_0x479aae['params']['id'],'role':'agent'},'attributes':['id',_0xb1c3('0x43'),_0xb1c3('0x42'),_0xb1c3('0x76'),_0xb1c3('0x9f')]});})[_0xb1c3('0x1d')](handleEntityNotFound(_0x30c9de,null))['then'](function(_0x19541a){if(_0x19541a){_0x320569=_0x19541a;return respondWithRpcPromise(_0xb1c3('0xf1'),'pause',{'id':_0x320569['id'],'name':_0x320569[_0xb1c3('0x43')],'pause':!![]});}})['then'](function(){if(_0x320569){return db[_0xb1c3('0xe6')][_0xb1c3('0x63')]({'where':{'membername':_0x320569[_0xb1c3('0x43')],'type':_0xb1c3('0xeb'),'exitAt':null}});}})[_0xb1c3('0x1d')](function(_0x4e606d){if(_0x4e606d[_0xb1c3('0x52')]){var _0x2de10b=moment()[_0xb1c3('0x73')](_0xb1c3('0xe8'));for(var _0x25c9ee=0x0,_0x1277bb=_0x4e606d[_0xb1c3('0x52')];_0x25c9ee<_0x1277bb;_0x25c9ee++){_0x4e606d[_0x25c9ee][_0xb1c3('0xf2')]({'exitAt':_0x2de10b});}}})[_0xb1c3('0x1d')](function(){var _0x24df30=[];var _0x3706e4=utils['getChannels']();_0x3706e4[_0xb1c3('0xf0')](function(_0x3f5e94){_0x24df30['push']({'channel':_0x3f5e94,'membername':_0x320569['name'],'interface':_[_0xb1c3('0x79')](_0x320569['interface'])?util[_0xb1c3('0x73')](_0xb1c3('0xad'),_0x320569[_0xb1c3('0x43')]):_0x320569['interface'],'type':_0xb1c3('0xeb'),'enterAt':moment()['format'](_0xb1c3('0xe8')),'data1':_0x479aae[_0xb1c3('0x68')][_0xb1c3('0x59')]||'DEFAULT\x20PAUSE','role':_0x320569[_0xb1c3('0x42')],'internal':_0x320569[_0xb1c3('0x76')]});});return db[_0xb1c3('0xe6')][_0xb1c3('0x67')](_0x24df30,{'individualHooks':!![]});})[_0xb1c3('0x1d')](function(){return _0x320569['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x479aae[_0xb1c3('0x68')][_0xb1c3('0x59')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xb1c3('0xe8'))});})[_0xb1c3('0x1d')](respondWithResult(_0x30c9de,null))['catch'](handleError(_0x30c9de,null));};exports[_0xb1c3('0xf3')]=function(_0x4de1f8,_0x55d74d,_0x3d93e2){var _0x249cbe;return db[_0xb1c3('0x46')][_0xb1c3('0x41')]({'where':{'id':_0x4de1f8['params']['id']},'attributes':['id',_0xb1c3('0x43'),'role','voicePause',_0xb1c3('0xf4'),_0xb1c3('0xf5'),_0xb1c3('0xf6'),_0xb1c3('0xf7'),_0xb1c3('0xf8'),_0xb1c3('0xf9'),'lastPauseAt']})[_0xb1c3('0x1d')](handleEntityNotFound(_0x55d74d,null))[_0xb1c3('0x1d')](function(_0x4f4e9d){if(_0x4f4e9d){_0x249cbe=_0x4f4e9d;if(_0x4de1f8[_0xb1c3('0x68')][_0xb1c3('0x9c')]&&!utils[_0xb1c3('0xa0')](_0x4de1f8[_0xb1c3('0x68')]['channel'])){throw new db['Sequelize'][(_0xb1c3('0x91'))](_0xb1c3('0xa1'));}switch(_0x4de1f8[_0xb1c3('0x68')][_0xb1c3('0x9c')]){case _0xb1c3('0xaa'):return respondWithRpcPromise(_0xb1c3('0xf1'),'unpause',{'id':_0x249cbe['id'],'name':_0x249cbe[_0xb1c3('0x43')],'pause':![]})[_0xb1c3('0x1d')](function(){return db[_0xb1c3('0xaf')][_0xb1c3('0xe7')]({'paused':0x0},{'where':{'UserId':_0x249cbe['id']},'individualHooks':!![]});})[_0xb1c3('0x1d')](function(){return db[_0xb1c3('0xe6')][_0xb1c3('0x41')]({'where':{'channel':_0x4de1f8[_0xb1c3('0x68')][_0xb1c3('0x9c')],'membername':_0x249cbe[_0xb1c3('0x43')],'type':'PAUSE','exitAt':null}});})[_0xb1c3('0x1d')](function(_0x5c9763){if(_0x5c9763){return _0x5c9763[_0xb1c3('0xe7')]({'exitAt':moment()[_0xb1c3('0x73')](_0xb1c3('0xe8')),'data2':_0xb1c3('0xfa')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x249cbe[_0xb1c3('0xe7')]({'voicePause':![]});});case _0xb1c3('0xfb'):case _0xb1c3('0xfc'):case _0xb1c3('0xfd'):case _0xb1c3('0xfe'):case _0xb1c3('0xff'):return db['MemberReport'][_0xb1c3('0x41')]({'where':{'channel':_0x4de1f8[_0xb1c3('0x68')][_0xb1c3('0x9c')],'membername':_0x249cbe[_0xb1c3('0x43')],'type':_0xb1c3('0xeb'),'exitAt':null}})[_0xb1c3('0x1d')](function(_0x55e3eb){if(_0x55e3eb){return _0x55e3eb[_0xb1c3('0xe7')]({'exitAt':moment()['format'](_0xb1c3('0xe8')),'data2':_0xb1c3('0xfa')},{'individualHooks':!![]});}return null;})[_0xb1c3('0x1d')](function(){var _0x37d3e8={};_[_0xb1c3('0x30')](_0x37d3e8,util[_0xb1c3('0x73')]('%s%s',_0x4de1f8['body'][_0xb1c3('0x9c')],_0xb1c3('0x100')),![]);return _0x249cbe[_0xb1c3('0xe7')](_0x37d3e8);});default:return respondWithRpcPromise(_0xb1c3('0xf1'),_0xb1c3('0xf3'),{'id':_0x249cbe['id'],'name':_0x249cbe[_0xb1c3('0x43')],'pause':![]})[_0xb1c3('0x1d')](function(){return db[_0xb1c3('0xaf')][_0xb1c3('0xe7')]({'paused':0x0},{'where':{'UserId':_0x249cbe['id']}});})[_0xb1c3('0x1d')](function(){return db[_0xb1c3('0xe6')][_0xb1c3('0x63')]({'where':{'membername':_0x249cbe['name'],'type':_0xb1c3('0xeb'),'exitAt':null}});})[_0xb1c3('0x1d')](function(_0x52e021){var _0x59f2bd=[];_0x52e021[_0xb1c3('0xf0')](function(_0x1285f2){_0x59f2bd[_0xb1c3('0xac')](_0x1285f2['update']({'exitAt':moment()[_0xb1c3('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xb1c3('0xfa')}));});return BPromise[_0xb1c3('0xe9')](_0x59f2bd);})[_0xb1c3('0x1d')](function(){return _0x249cbe[_0xb1c3('0xe7')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xb1c3('0x1d')](respondWithResult(_0x55d74d,null))[_0xb1c3('0x28')](handleError(_0x55d74d,null));};exports[_0xb1c3('0x101')]=function(_0x3b6571,_0x545524,_0x1bba3f){var _0x390cb8={};var _0x227312={};var _0x364e7b;var _0x49830b;return db['User'][_0xb1c3('0x99')]({'where':{'id':_0x3b6571[_0xb1c3('0x66')]['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x545524,null))[_0xb1c3('0x1d')](function(_0x5a8d03){if(_0x5a8d03){_0x364e7b=_0x5a8d03;_0x227312[_0xb1c3('0x4f')]=_[_0xb1c3('0x49')](db[_0xb1c3('0x102')][_0xb1c3('0x47')]);_0x227312[_0xb1c3('0x4c')]=_[_0xb1c3('0x49')](_0x3b6571['query']);_0x227312[_0xb1c3('0x4d')]=_[_0xb1c3('0x4e')](_0x227312['model'],_0x227312[_0xb1c3('0x4c')]);_0x390cb8[_0xb1c3('0x50')]=_[_0xb1c3('0x4e')](_0x227312[_0xb1c3('0x4f')],qs[_0xb1c3('0x51')](_0x3b6571[_0xb1c3('0x4c')][_0xb1c3('0x51')]));_0x390cb8[_0xb1c3('0x50')]=_0x390cb8['attributes']['length']?_0x390cb8['attributes']:_0x227312[_0xb1c3('0x4f')];_0x390cb8['order']=qs['sort'](_0x3b6571[_0xb1c3('0x4c')][_0xb1c3('0x56')]);_0x390cb8['where']=qs[_0xb1c3('0x4d')](_[_0xb1c3('0x58')](_0x3b6571['query'],_0x227312[_0xb1c3('0x4d')]));if(_0x3b6571[_0xb1c3('0x4c')][_0xb1c3('0x3c')]){_0x390cb8['where']=_[_0xb1c3('0x5f')](_0x390cb8[_0xb1c3('0x57')],{'$or':_[_0xb1c3('0x3e')](_0x390cb8['attributes'],function(_0x62c08b){var _0x38764b={};_0x38764b[_0x62c08b]={'$like':'%'+_0x3b6571[_0xb1c3('0x4c')]['filter']+'%'};return _0x38764b;})});}_0x390cb8=_[_0xb1c3('0x5f')]({},_0x390cb8,_0x3b6571['options']);return _0x364e7b[_0xb1c3('0x101')](_0x390cb8);}})['then'](function(_0x471f16){if(_0x471f16){_0x49830b=_0x471f16[_0xb1c3('0x52')];if(!_0x3b6571[_0xb1c3('0x4c')][_0xb1c3('0x53')]('nolimit')){_0x390cb8['limit']=qs[_0xb1c3('0x2f')](_0x3b6571[_0xb1c3('0x4c')][_0xb1c3('0x2f')]);_0x390cb8[_0xb1c3('0x2e')]=qs[_0xb1c3('0x2e')](_0x3b6571[_0xb1c3('0x4c')]['offset']);}return _0x364e7b[_0xb1c3('0x101')](_0x390cb8);}})[_0xb1c3('0x1d')](function(_0x17544e){if(_0x17544e){return _0x17544e?{'count':_0x49830b,'rows':_0x17544e}:null;}})['then'](respondWithResult(_0x545524,null))[_0xb1c3('0x28')](handleError(_0x545524,null));};exports['addTeams']=function(_0x1e5622,_0x37493d,_0x456988){return db[_0xb1c3('0x46')]['find']({'where':{'id':_0x1e5622[_0xb1c3('0x66')]['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x37493d,null))['then'](function(_0x53e77d){if(_0x53e77d){return _0x53e77d[_0xb1c3('0x103')](_0x1e5622[_0xb1c3('0x68')][_0xb1c3('0x6b')],_[_0xb1c3('0x6c')](_0x1e5622['body'],['ids','id'])||{});}})[_0xb1c3('0x1d')](respondWithResult(_0x37493d,null))[_0xb1c3('0x28')](handleError(_0x37493d,null));};exports['removeTeams']=function(_0x426a06,_0x514b6e,_0x1602ff){return db['User'][_0xb1c3('0x41')]({'where':{'id':_0x426a06[_0xb1c3('0x66')]['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x514b6e,null))[_0xb1c3('0x1d')](function(_0x226ad2){if(_0x226ad2){return _0x226ad2[_0xb1c3('0x104')](_0x426a06['query'][_0xb1c3('0x6b')]);}})['then'](respondWithStatusCode(_0x514b6e,null))['catch'](handleError(_0x514b6e,null));};exports[_0xb1c3('0x105')]=function(_0x3e8ad9,_0x1f89cc,_0x52567e){var _0x1e8a99={};var _0x59d052={};var _0x6ff8c2;var _0x4091fa;return db[_0xb1c3('0x46')][_0xb1c3('0x99')]({'where':{'id':_0x3e8ad9[_0xb1c3('0x66')]['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x1f89cc,null))[_0xb1c3('0x1d')](function(_0x1da259){if(_0x1da259){_0x6ff8c2=_0x1da259;_0x59d052[_0xb1c3('0x4f')]=_[_0xb1c3('0x49')](db[_0xb1c3('0xbf')][_0xb1c3('0x47')]);_0x59d052['query']=_[_0xb1c3('0x49')](_0x3e8ad9[_0xb1c3('0x4c')]);_0x59d052[_0xb1c3('0x4d')]=_['intersection'](_0x59d052[_0xb1c3('0x4f')],_0x59d052[_0xb1c3('0x4c')]);_0x1e8a99[_0xb1c3('0x50')]=_[_0xb1c3('0x4e')](_0x59d052[_0xb1c3('0x4f')],qs[_0xb1c3('0x51')](_0x3e8ad9[_0xb1c3('0x4c')][_0xb1c3('0x51')]));_0x1e8a99[_0xb1c3('0x50')]=_0x1e8a99[_0xb1c3('0x50')][_0xb1c3('0x52')]?_0x1e8a99['attributes']:_0x59d052[_0xb1c3('0x4f')];_0x1e8a99[_0xb1c3('0x55')]=qs[_0xb1c3('0x56')](_0x3e8ad9[_0xb1c3('0x4c')][_0xb1c3('0x56')]);_0x1e8a99[_0xb1c3('0x57')]=qs[_0xb1c3('0x4d')](_[_0xb1c3('0x58')](_0x3e8ad9['query'],_0x59d052['filters']));if(_0x3e8ad9['query'][_0xb1c3('0x3c')]){_0x1e8a99[_0xb1c3('0x57')]=_[_0xb1c3('0x5f')](_0x1e8a99['where'],{'$or':_[_0xb1c3('0x3e')](_0x1e8a99[_0xb1c3('0x50')],function(_0x27c848){var _0x45e229={};_0x45e229[_0x27c848]={'$like':'%'+_0x3e8ad9[_0xb1c3('0x4c')][_0xb1c3('0x3c')]+'%'};return _0x45e229;})});}_0x1e8a99=_['merge']({},_0x1e8a99,_0x3e8ad9[_0xb1c3('0x60')]);return _0x6ff8c2[_0xb1c3('0x105')](_0x1e8a99);}})['then'](function(_0x1408c1){if(_0x1408c1){_0x4091fa=_0x1408c1[_0xb1c3('0x52')];if(!_0x3e8ad9['query'][_0xb1c3('0x53')](_0xb1c3('0x54'))){_0x1e8a99[_0xb1c3('0x2f')]=qs[_0xb1c3('0x2f')](_0x3e8ad9[_0xb1c3('0x4c')][_0xb1c3('0x2f')]);_0x1e8a99[_0xb1c3('0x2e')]=qs[_0xb1c3('0x2e')](_0x3e8ad9[_0xb1c3('0x4c')][_0xb1c3('0x2e')]);}return _0x6ff8c2['getLists'](_0x1e8a99);}})['then'](function(_0x392107){if(_0x392107){return _0x392107?{'count':_0x4091fa,'rows':_0x392107}:null;}})[_0xb1c3('0x1d')](respondWithResult(_0x1f89cc,null))[_0xb1c3('0x28')](handleError(_0x1f89cc,null));};exports[_0xb1c3('0x106')]=function(_0x40e2ea,_0x2505b4,_0x1f536a){var _0x25c0e8={};var _0x51899b={};var _0x565e91;var _0x45143f;return db[_0xb1c3('0x46')][_0xb1c3('0x99')]({'where':{'id':_0x40e2ea[_0xb1c3('0x66')]['id']}})[_0xb1c3('0x1d')](handleEntityNotFound(_0x2505b4,null))['then'](function(_0x3392f0){if(_0x3392f0){_0x565e91=_0x3392f0;_0x51899b[_0xb1c3('0x4f')]=_[_0xb1c3('0x49')](db[_0xb1c3('0x46')][_0xb1c3('0x47')]);_0x51899b[_0xb1c3('0x4c')]=_['keys'](_0x40e2ea[_0xb1c3('0x4c')]);_0x51899b[_0xb1c3('0x4d')]=_['intersection'](_0x51899b['model'],_0x51899b[_0xb1c3('0x4c')]);_0x25c0e8[_0xb1c3('0x50')]=_[_0xb1c3('0x4e')](_0x51899b[_0xb1c3('0x4f')],qs[_0xb1c3('0x51')](_0x40e2ea[_0xb1c3('0x4c')]['fields']));_0x25c0e8[_0xb1c3('0x50')]=_0x25c0e8[_0xb1c3('0x50')]['length']?_0x25c0e8[_0xb1c3('0x50')]:_0x51899b[_0xb1c3('0x4f')];_0x25c0e8[_0xb1c3('0x55')]=qs[_0xb1c3('0x56')](_0x40e2ea[_0xb1c3('0x4c')][_0xb1c3('0x56')]);_0x25c0e8[_0xb1c3('0x57')]=qs['filters'](_['pick'](_0x40e2ea[_0xb1c3('0x4c')],_0x51899b[_0xb1c3('0x4d')]));if(_0x40e2ea[_0xb1c3('0x4c')][_0xb1c3('0x3c')]){_0x25c0e8[_0xb1c3('0x57')]=_[_0xb1c3('0x5f')](_0x25c0e8['where'],{'$or':_[_0xb1c3('0x3e')](_0x25c0e8['attributes'],function(_0x4da692){var _0x4d4796={};_0x4d4796[_0x4da692]={'$like':'%'+_0x40e2ea[_0xb1c3('0x4c')][_0xb1c3('0x3c')]+'%'};return _0x4d4796;})});}_0x25c0e8['model']=db[_0xb1c3('0x46')];_0x25c0e8['as']='Agents';_0x25c0e8=_['merge']({},_0x25c0e8,_0x40e2ea[_0xb1c3('0x60')]);return _0x565e91['getVoiceQueues']({'include':[_0x25c0e8]});}})['then'](function(_0x5d3e11){if(_0x5d3e11){var _0x1915a4={},_0xf51b48=[],_0x105328=0x0;for(var _0x2460c9=0x0;_0x2460c9<_0x5d3e11[_0xb1c3('0x52')];_0x2460c9+=0x1){for(var _0x27d5a5=0x0,_0x299db0;_0x27d5a5<_0x5d3e11[_0x2460c9][_0xb1c3('0x38')]['length'];_0x27d5a5+=0x1){_0x299db0=_0x5d3e11[_0x2460c9][_0xb1c3('0x38')][_0x27d5a5][_0xb1c3('0x35')]({'plain':!![]});_0x1915a4[_0x299db0['id']]=_0x299db0;}}_0x1915a4=_[_0xb1c3('0x107')](_0x1915a4);for(var _0x1af54a=qs[_0xb1c3('0x2e')](_0x40e2ea[_0xb1c3('0x4c')]['offset']);_0x1af54a<_0x1915a4[_0xb1c3('0x52')]&&_0xf51b48[_0xb1c3('0x52')]=_0x262b2d['agents']){throw new Error(_0xc0c8('0x4d'));}})[_0xc0c8('0x11')](function(){if(_0x4ea728){return db[_0xc0c8('0x2b')]['destroy']({'where':{'membername':_0x4ea728[_0xc0c8('0x28')]},'individualHooks':!![]});}})[_0xc0c8('0x11')](function(){if(_0x4ea728){return _0x4ea728[_0xc0c8('0x4e')]({'raw':!![]});}})[_0xc0c8('0x11')](function(_0x1a2db9){if(_0x4ea728){if(_0x1a2db9){var _0xb548ba=[];_0x110933=_0x1a2db9;if(_0x110933[_0xc0c8('0x2f')]){for(var _0x536a1e=0x0;_0x536a1e<_0x110933[_0xc0c8('0x2f')];_0x536a1e++){_0xb548ba[_0xc0c8('0x35')](db[_0xc0c8('0x2b')][_0xc0c8('0x4f')]({'membername':_0x4ea728[_0xc0c8('0x28')],'UserId':_0x4ea728['id'],'queue_name':_0x110933[_0x536a1e][_0xc0c8('0x28')],'VoiceQueueId':_0x110933[_0x536a1e]['id'],'interface':_0x1f30b5,'paused':_0x4ea728[_0xc0c8('0x48')]||![],'penalty':_0x110933[_0x536a1e][_0xc0c8('0x50')]||0x0}));}return BPromise[_0xc0c8('0x43')](_0xb548ba);}}}})[_0xc0c8('0x11')](function(){if(_0x4ea728){return db['MemberReport'][_0xc0c8('0x1b')]({'where':{'membername':_0x4ea728[_0xc0c8('0x28')],'exitAt':null}});}})[_0xc0c8('0x11')](function(_0x5f5767){if(_0x4ea728){if(_0x5f5767&&_0x5f5767[_0xc0c8('0x2f')]){var _0x5076d5=[];_0x5f5767[_0xc0c8('0x34')](function(_0x57b164){_0x5076d5[_0xc0c8('0x35')](_0x57b164['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xc0c8('0x43')](_0x5076d5);}}})['then'](function(_0x5bc0bf){if(_0x4ea728){var _0x21062e=[];var _0x48b014=[];var _0x36dfbd=utils['getChannels']();var _0x22bbf7={'membername':_0x4ea728[_0xc0c8('0x28')],'interface':_0x1f30b5,'enterAt':moment()[_0xc0c8('0x30')](_0xc0c8('0x31')),'role':_0x4ea728[_0xc0c8('0x29')],'internal':_0x4ea728['internal']};_0x36dfbd[_0xc0c8('0x34')](function(_0x367d8b){_0x21062e['push'](_[_0xc0c8('0x51')]({'channel':_0x367d8b,'type':_0xc0c8('0x52'),'data1':_0xc0c8('0x53'),'data2':_0x1f30b5},_0x22bbf7));if(_0x4ea728['loginInPause']){_0x48b014[_0xc0c8('0x35')](_[_0xc0c8('0x51')]({'channel':_0x367d8b,'type':'PAUSE','data1':_0xc0c8('0x54')},_0x22bbf7));}});return db['MemberReport'][_0xc0c8('0x55')](_0x21062e[_0xc0c8('0x56')](_0x48b014),{'individualHooks':!![]});}})[_0xc0c8('0x11')](function(){if(_0x4ea728){return _0x4ea728[_0xc0c8('0x2c')]({'online':!![],'lastLoginAt':moment()['format'](_0xc0c8('0x31')),'voicePause':_0x4ea728[_0xc0c8('0x48')]||![],'mailPause':_0x4ea728[_0xc0c8('0x48')]||![],'chatPause':_0x4ea728[_0xc0c8('0x48')]||![],'faxPause':_0x4ea728['loginInPause']||![],'smsPause':_0x4ea728[_0xc0c8('0x48')]||![],'openchannelPause':_0x4ea728['loginInPause']||![],'pauseType':_0x4ea728[_0xc0c8('0x48')]?_0xc0c8('0x54'):null,'lastPauseAt':moment()[_0xc0c8('0x30')](_0xc0c8('0x31')),'interface':_0x1f30b5});}})['then'](function(_0x5cb6cf){_0x34d30a(_0x5cb6cf);})[_0xc0c8('0x57')](function(_0x48aeb9){_0x1ec3ee(_0x3e9f16[_0xc0c8('0x15')](0x1f4,_0x48aeb9[_0xc0c8('0x17')]));});});}; \ No newline at end of file +var _0x6ebb=['MemberReport','findAll','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','push','isNil','format','SIP/%s','name','body','type','DEFAULT\x20PAUSE','bulkCreate','channel','isValidChannel','Unknown\x20channel','voice','system','mail','chat','fax','sms','openchannel','set','%s%s','Pause','UserVoiceQueueRt','LogoutUser','LoginUser','findOne','phone','count','getLicense','agents','destroy','upsert','UserVoiceQueue.penalty','all','getChannels','merge','LOGIN','callysquare','loginInPause','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','User,\x20%s,\x20%s','result','catch','GetUser','User','options','raw','where','limit','include','model','attributes','map','ShowUser','find','PauseUser','role','internal','interface','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ebb,0x1a0));var _0xb6eb=function(_0x48b8b0,_0x59ca5f){_0x48b8b0=_0x48b8b0-0x0;var _0x5e9435=_0x6ebb[_0x48b8b0];return _0x5e9435;};'use strict';var _=require(_0xb6eb('0x0'));var util=require(_0xb6eb('0x1'));var moment=require(_0xb6eb('0x2'));var BPromise=require(_0xb6eb('0x3'));var rs=require(_0xb6eb('0x4'));var fs=require('fs');var Redis=require(_0xb6eb('0x5'));var db=require(_0xb6eb('0x6'))['db'];var utils=require(_0xb6eb('0x7'));var logger=require(_0xb6eb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb6eb('0x9')]['http']({'port':0x232a});config[_0xb6eb('0xa')]=_['defaults'](config[_0xb6eb('0xa')],{'host':_0xb6eb('0xb'),'port':0x18eb});var socket=require(_0xb6eb('0xc'))(new Redis(config[_0xb6eb('0xa')]));require(_0xb6eb('0xd'))[_0xb6eb('0xe')](socket);function respondWithRpcPromise(_0x39055e,_0xf86ce9,_0x5593aa){return new BPromise(function(_0x131c82,_0x47698c){return client[_0xb6eb('0xf')](_0x39055e,_0x5593aa)[_0xb6eb('0x10')](function(_0x2604dd){logger[_0xb6eb('0x11')]('User,\x20%s,\x20%s',_0xf86ce9,_0xb6eb('0x12'));logger[_0xb6eb('0x13')](_0xb6eb('0x14'),_0xf86ce9,_0xb6eb('0x12'),JSON[_0xb6eb('0x15')](_0x2604dd));if(_0x2604dd[_0xb6eb('0x16')]){if(_0x2604dd[_0xb6eb('0x16')]['code']===0x1f4){logger['error']('User,\x20%s,\x20%s',_0xf86ce9,_0x2604dd[_0xb6eb('0x16')][_0xb6eb('0x17')]);return _0x47698c(_0x2604dd['error'][_0xb6eb('0x17')]);}logger[_0xb6eb('0x16')](_0xb6eb('0x18'),_0xf86ce9,_0x2604dd['error'][_0xb6eb('0x17')]);return _0x131c82(_0x2604dd[_0xb6eb('0x16')][_0xb6eb('0x17')]);}else{logger['info']('User,\x20%s,\x20%s',_0xf86ce9,'request\x20sent');_0x131c82(_0x2604dd[_0xb6eb('0x19')]['message']);}})[_0xb6eb('0x1a')](function(_0x59bf4c){logger[_0xb6eb('0x16')](_0xb6eb('0x18'),_0xf86ce9,_0x59bf4c);_0x47698c(_0x59bf4c);});});}exports[_0xb6eb('0x1b')]=function(_0x42ac12){var _0x23b8fc=this;return new Promise(function(_0x12cd97,_0x1b101a){return db[_0xb6eb('0x1c')]['findAll']({'raw':_0x42ac12[_0xb6eb('0x1d')]?_0x42ac12['options'][_0xb6eb('0x1e')]===undefined?!![]:![]:!![],'where':_0x42ac12[_0xb6eb('0x1d')]?_0x42ac12[_0xb6eb('0x1d')][_0xb6eb('0x1f')]||null:null,'attributes':_0x42ac12[_0xb6eb('0x1d')]?_0x42ac12[_0xb6eb('0x1d')]['attributes']||null:null,'limit':_0x42ac12[_0xb6eb('0x1d')]?_0x42ac12[_0xb6eb('0x1d')][_0xb6eb('0x20')]||null:null,'include':_0x42ac12[_0xb6eb('0x1d')]?_0x42ac12[_0xb6eb('0x1d')][_0xb6eb('0x21')]?_['map'](_0x42ac12[_0xb6eb('0x1d')][_0xb6eb('0x21')],function(_0x585331){return{'model':db[_0x585331[_0xb6eb('0x22')]],'as':_0x585331['as'],'attributes':_0x585331[_0xb6eb('0x23')],'include':_0x585331['include']?_[_0xb6eb('0x24')](_0x585331[_0xb6eb('0x21')],function(_0x305d15){return{'model':db[_0x305d15[_0xb6eb('0x22')]],'as':_0x305d15['as'],'attributes':_0x305d15['attributes'],'include':_0x305d15['include']?_[_0xb6eb('0x24')](_0x305d15['include'],function(_0x36abe8){return{'model':db[_0x36abe8[_0xb6eb('0x22')]],'as':_0x36abe8['as'],'attributes':_0x36abe8[_0xb6eb('0x23')]};}):[]};}):[]};}):[]:[]})[_0xb6eb('0x10')](function(_0x3a4185){logger['info'](_0xb6eb('0x1b'),_0x42ac12);logger[_0xb6eb('0x13')](_0xb6eb('0x1b'),_0x42ac12,JSON[_0xb6eb('0x15')](_0x3a4185));_0x12cd97(_0x3a4185);})['catch'](function(_0x22e26d){logger[_0xb6eb('0x16')](_0xb6eb('0x1b'),_0x22e26d['message'],_0x42ac12);_0x1b101a(_0x23b8fc[_0xb6eb('0x16')](0x1f4,_0x22e26d[_0xb6eb('0x17')]));});});};exports[_0xb6eb('0x25')]=function(_0x50c64f){var _0x53ae2d=this;return new Promise(function(_0x562624,_0x447de0){return db['User'][_0xb6eb('0x26')]({'raw':_0x50c64f[_0xb6eb('0x1d')]?_0x50c64f[_0xb6eb('0x1d')][_0xb6eb('0x1e')]===undefined?!![]:![]:!![],'where':_0x50c64f[_0xb6eb('0x1d')]?_0x50c64f['options']['where']||null:null,'attributes':_0x50c64f['options']?_0x50c64f[_0xb6eb('0x1d')]['attributes']||null:null,'include':_0x50c64f[_0xb6eb('0x1d')]?_0x50c64f['options'][_0xb6eb('0x21')]?_[_0xb6eb('0x24')](_0x50c64f[_0xb6eb('0x1d')]['include'],function(_0x315832){return{'model':db[_0x315832['model']],'as':_0x315832['as'],'attributes':_0x315832[_0xb6eb('0x23')],'include':_0x315832[_0xb6eb('0x21')]?_[_0xb6eb('0x24')](_0x315832[_0xb6eb('0x21')],function(_0x48a586){return{'model':db[_0x48a586[_0xb6eb('0x22')]],'as':_0x48a586['as'],'attributes':_0x48a586['attributes'],'include':_0x48a586[_0xb6eb('0x21')]?_[_0xb6eb('0x24')](_0x48a586[_0xb6eb('0x21')],function(_0x3cc5f9){return{'model':db[_0x3cc5f9[_0xb6eb('0x22')]],'as':_0x3cc5f9['as'],'attributes':_0x3cc5f9['attributes']};}):[]};}):[]};}):[]:[]})[_0xb6eb('0x10')](function(_0x50032b){logger[_0xb6eb('0x11')]('ShowUser',_0x50c64f);logger[_0xb6eb('0x13')](_0xb6eb('0x25'),_0x50c64f,JSON[_0xb6eb('0x15')](_0x50032b));_0x562624(_0x50032b);})['catch'](function(_0x108969){logger[_0xb6eb('0x16')]('ShowUser',_0x108969[_0xb6eb('0x17')],_0x50c64f);_0x447de0(_0x53ae2d['error'](0x1f4,_0x108969[_0xb6eb('0x17')]));});});};exports[_0xb6eb('0x27')]=function(_0x514f67){var _0xc7df33=this;return new Promise(function(_0x1359cb,_0x530c81){var _0x104055;return db[_0xb6eb('0x1c')]['find']({'where':_0x514f67[_0xb6eb('0x1d')][_0xb6eb('0x1f')]||{},'attributes':['id','name',_0xb6eb('0x28'),_0xb6eb('0x29'),_0xb6eb('0x2a')]})[_0xb6eb('0x10')](function(_0x43fdad){if(_0x43fdad){_0x104055=_0x43fdad;return db['UserVoiceQueueRt'][_0xb6eb('0x2b')]({'paused':0x1},{'where':{'UserId':_0x104055['id']},'individualHooks':!![]});}})[_0xb6eb('0x10')](function(){if(_0x104055){return db[_0xb6eb('0x2c')][_0xb6eb('0x2d')]({'where':{'membername':_0x104055['name'],'type':_0xb6eb('0x2e'),'exitAt':null}});}})[_0xb6eb('0x10')](function(_0x13a1de){if(_0x104055){if(_0x13a1de&&_0x13a1de[_0xb6eb('0x2f')]){var _0x281d59=moment()['format'](_0xb6eb('0x30'));for(var _0x1361b8=0x0,_0x384a1b=_0x13a1de[_0xb6eb('0x2f')];_0x1361b8<_0x384a1b;_0x1361b8++){_0x13a1de[_0x1361b8][_0xb6eb('0x31')]({'exitAt':_0x281d59});}}}})[_0xb6eb('0x10')](function(){if(_0x104055){var _0x55b23e=[];var _0x447333=utils['getChannels']();_0x447333[_0xb6eb('0x32')](function(_0xd9d6a9){_0x55b23e[_0xb6eb('0x33')]({'channel':_0xd9d6a9,'membername':_0x104055['name'],'interface':_[_0xb6eb('0x34')](_0x104055[_0xb6eb('0x2a')])?util[_0xb6eb('0x35')](_0xb6eb('0x36'),_0x104055[_0xb6eb('0x37')]):_0x104055[_0xb6eb('0x2a')],'type':_0xb6eb('0x2e'),'enterAt':moment()[_0xb6eb('0x35')](_0xb6eb('0x30')),'data1':_0x514f67[_0xb6eb('0x38')][_0xb6eb('0x39')]||_0xb6eb('0x3a'),'role':_0x104055[_0xb6eb('0x28')],'internal':_0x104055[_0xb6eb('0x29')],'uniqueid':_0x514f67[_0xb6eb('0x38')]['uniqueid']||null});});return db[_0xb6eb('0x2c')][_0xb6eb('0x3b')](_0x55b23e,{'individualHooks':!![]});}})[_0xb6eb('0x10')](function(){if(_0x104055){return _0x104055['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x514f67[_0xb6eb('0x38')][_0xb6eb('0x39')]||_0xb6eb('0x3a'),'lastPauseAt':moment()['format'](_0xb6eb('0x30'))});}})[_0xb6eb('0x10')](function(_0x12141d){_0x1359cb(_0x12141d);})[_0xb6eb('0x1a')](function(_0x4c6d5a){_0x530c81(_0xc7df33['error'](0x1f4,_0x4c6d5a[_0xb6eb('0x17')]));});});};exports['UnpauseUser']=function(_0x41d6f4){var _0x19c1f0=this;return new Promise(function(_0x306567,_0x3b15fb){var _0x324384;return db['User']['findOne']({'where':_0x41d6f4[_0xb6eb('0x1d')]['where']||{},'attributes':['id',_0xb6eb('0x37')]})[_0xb6eb('0x10')](function(_0x4fcc78){if(_0x4fcc78){_0x324384=_0x4fcc78;if(_0x41d6f4[_0xb6eb('0x38')][_0xb6eb('0x3c')]&&!utils[_0xb6eb('0x3d')](_0x41d6f4[_0xb6eb('0x38')][_0xb6eb('0x3c')])){throw new Error(_0xb6eb('0x3e'));}switch(_0x41d6f4[_0xb6eb('0x38')][_0xb6eb('0x3c')]){case _0xb6eb('0x3f'):return db['UserVoiceQueueRt'][_0xb6eb('0x2b')]({'paused':0x0},{'where':{'UserId':_0x324384['id']}})[_0xb6eb('0x10')](function(){return db[_0xb6eb('0x2c')][_0xb6eb('0x26')]({'where':{'channel':_0x41d6f4[_0xb6eb('0x38')][_0xb6eb('0x3c')],'membername':_0x324384['name'],'type':_0xb6eb('0x2e'),'exitAt':null}});})[_0xb6eb('0x10')](function(_0x56a6ff){if(_0x56a6ff){return _0x56a6ff[_0xb6eb('0x2b')]({'exitAt':moment()[_0xb6eb('0x35')](_0xb6eb('0x30')),'data2':_0xb6eb('0x40')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x324384[_0xb6eb('0x2b')]({'voicePause':![]});});case _0xb6eb('0x41'):case _0xb6eb('0x42'):case _0xb6eb('0x43'):case _0xb6eb('0x44'):case _0xb6eb('0x45'):return db['MemberReport'][_0xb6eb('0x26')]({'where':{'channel':_0x41d6f4[_0xb6eb('0x38')][_0xb6eb('0x3c')],'membername':_0x324384['name'],'type':_0xb6eb('0x2e'),'exitAt':null}})[_0xb6eb('0x10')](function(_0x593985){return _0x593985[_0xb6eb('0x2b')]({'exitAt':moment()[_0xb6eb('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xb6eb('0x40')},{'individualHooks':!![]});})[_0xb6eb('0x10')](function(){var _0x97fb20={};_[_0xb6eb('0x46')](_0x97fb20,util['format'](_0xb6eb('0x47'),_0x41d6f4[_0xb6eb('0x38')][_0xb6eb('0x3c')],_0xb6eb('0x48')),![]);return _0x324384[_0xb6eb('0x2b')](_0x97fb20);});default:return db[_0xb6eb('0x49')][_0xb6eb('0x2b')]({'paused':0x0},{'where':{'UserId':_0x324384['id']}})[_0xb6eb('0x10')](function(){return db[_0xb6eb('0x2c')][_0xb6eb('0x2d')]({'where':{'membername':_0x324384[_0xb6eb('0x37')],'type':_0xb6eb('0x2e'),'exitAt':null}});})[_0xb6eb('0x10')](function(_0x40afc1){var _0x5869cc=[];_0x40afc1[_0xb6eb('0x32')](function(_0x2c9bec){_0x5869cc[_0xb6eb('0x33')](_0x2c9bec[_0xb6eb('0x2b')]({'exitAt':moment()['format'](_0xb6eb('0x30')),'data2':_0xb6eb('0x40')}));});return BPromise['all'](_0x5869cc);})['then'](function(){return _0x324384[_0xb6eb('0x2b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xb6eb('0x10')](function(_0x3ca070){_0x306567(_0x3ca070);})[_0xb6eb('0x1a')](function(_0x2c8756){_0x3b15fb(_0x19c1f0['error'](0x1f4,_0x2c8756['message']));});});};exports[_0xb6eb('0x4a')]=function(_0x148b89){var _0x43f7d2=this;return new Promise(function(_0x1028a1,_0x452654){var _0xdfcaf2;return db['User']['findOne']({'where':_0x148b89[_0xb6eb('0x1d')][_0xb6eb('0x1f')]||{},'attributes':['id',_0xb6eb('0x37')]})['then'](function(_0x10a896){if(_0x10a896){_0xdfcaf2=_0x10a896;return db[_0xb6eb('0x49')]['destroy']({'where':{'membername':_0xdfcaf2['name']},'individualHooks':!![]});}})['then'](function(){if(_0xdfcaf2){return db[_0xb6eb('0x2c')][_0xb6eb('0x2d')]({'where':{'membername':_0xdfcaf2[_0xb6eb('0x37')],'exitAt':null}});}})[_0xb6eb('0x10')](function(_0x290551){if(_0xdfcaf2){if(_0x290551&&_0x290551['length']){var _0x148b0e=[];_0x290551[_0xb6eb('0x32')](function(_0x3a82a8){_0x148b0e[_0xb6eb('0x33')](_0x3a82a8[_0xb6eb('0x2b')]({'exitAt':moment()['format'](_0xb6eb('0x30'))}));});return BPromise['all'](_0x148b0e);}}})[_0xb6eb('0x10')](function(){if(_0xdfcaf2){return _0xdfcaf2[_0xb6eb('0x2b')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xb6eb('0x10')](function(_0x38172d){_0x1028a1(_0x38172d);})['catch'](function(_0x447379){_0x452654(_0x43f7d2[_0xb6eb('0x16')](0x1f4,_0x447379['message']));});});};exports[_0xb6eb('0x4b')]=function(_0x733396){var _0x3c91d0=this;return new Promise(function(_0x4470b7,_0x185cf3){var _0x323296;var _0x3bd6d0;var _0x2fe78b;var _0xa56eea;return db[_0xb6eb('0x1c')][_0xb6eb('0x4c')]({'where':_0x733396[_0xb6eb('0x1d')][_0xb6eb('0x1f')]||{},'attributes':['id','name',_0xb6eb('0x28'),'mobile',_0xb6eb('0x4d'),_0xb6eb('0x29'),'loginInPause',_0xb6eb('0x2a')]})[_0xb6eb('0x10')](function(_0x4e6e65){if(_0x4e6e65){_0x323296=_0x4e6e65;_0xa56eea=_0x733396[_0xb6eb('0x38')][_0xb6eb('0x2a')]?_0x733396[_0xb6eb('0x38')]['interface']:util[_0xb6eb('0x35')](_0xb6eb('0x36'),_0x323296[_0xb6eb('0x37')]);return db[_0xb6eb('0x1c')][_0xb6eb('0x4e')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x323296['id']}}});}})[_0xb6eb('0x10')](function(_0x55372e){if(_0x55372e){_0x2fe78b=_0x55372e;return require('../../config/license/util')[_0xb6eb('0x4f')]();}})['then'](function(_0x50a2f8){if(_0x50a2f8&&_0x50a2f8[_0xb6eb('0x50')]&&_0x2fe78b>=_0x50a2f8['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xb6eb('0x10')](function(){if(_0x323296){return db[_0xb6eb('0x49')][_0xb6eb('0x51')]({'where':{'membername':_0x323296[_0xb6eb('0x37')]},'individualHooks':!![]});}})[_0xb6eb('0x10')](function(){if(_0x323296){return _0x323296['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x24408e){if(_0x323296){if(_0x24408e){var _0x41b53a=[];_0x3bd6d0=_0x24408e;if(_0x3bd6d0[_0xb6eb('0x2f')]){for(var _0x3c4c83=0x0;_0x3c4c83<_0x3bd6d0['length'];_0x3c4c83++){_0x41b53a[_0xb6eb('0x33')](db[_0xb6eb('0x49')][_0xb6eb('0x52')]({'membername':_0x323296['name'],'UserId':_0x323296['id'],'queue_name':_0x3bd6d0[_0x3c4c83][_0xb6eb('0x37')],'VoiceQueueId':_0x3bd6d0[_0x3c4c83]['id'],'interface':_0xa56eea,'paused':_0x323296['loginInPause']||![],'penalty':_0x3bd6d0[_0x3c4c83][_0xb6eb('0x53')]||0x0}));}return BPromise[_0xb6eb('0x54')](_0x41b53a);}}}})[_0xb6eb('0x10')](function(){if(_0x323296){return db[_0xb6eb('0x2c')][_0xb6eb('0x2d')]({'where':{'membername':_0x323296[_0xb6eb('0x37')],'exitAt':null}});}})['then'](function(_0x552fe1){if(_0x323296){if(_0x552fe1&&_0x552fe1[_0xb6eb('0x2f')]){var _0x1c166a=[];_0x552fe1[_0xb6eb('0x32')](function(_0x3d8199){_0x1c166a['push'](_0x3d8199[_0xb6eb('0x2b')]({'exitAt':moment()['format'](_0xb6eb('0x30'))}));});return BPromise['all'](_0x1c166a);}}})[_0xb6eb('0x10')](function(_0x346f89){if(_0x323296){var _0x2800cb=[];var _0x1e7e50=[];var _0x2427ce=utils[_0xb6eb('0x55')]();var _0x236014={'membername':_0x323296[_0xb6eb('0x37')],'interface':_0xa56eea,'enterAt':moment()[_0xb6eb('0x35')](_0xb6eb('0x30')),'role':_0x323296['role'],'internal':_0x323296['internal']};_0x2427ce[_0xb6eb('0x32')](function(_0x5767dc){_0x2800cb[_0xb6eb('0x33')](_[_0xb6eb('0x56')]({'channel':_0x5767dc,'type':_0xb6eb('0x57'),'data1':_0xb6eb('0x58'),'data2':_0xa56eea},_0x236014));if(_0x323296[_0xb6eb('0x59')]){_0x1e7e50[_0xb6eb('0x33')](_[_0xb6eb('0x56')]({'channel':_0x5767dc,'type':'PAUSE','data1':_0xb6eb('0x5a')},_0x236014));}});return db[_0xb6eb('0x2c')][_0xb6eb('0x3b')](_0x2800cb[_0xb6eb('0x5b')](_0x1e7e50),{'individualHooks':!![]});}})[_0xb6eb('0x10')](function(){if(_0x323296){return _0x323296[_0xb6eb('0x2b')]({'online':!![],'lastLoginAt':moment()[_0xb6eb('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x323296[_0xb6eb('0x59')]||![],'mailPause':_0x323296[_0xb6eb('0x59')]||![],'chatPause':_0x323296[_0xb6eb('0x59')]||![],'faxPause':_0x323296['loginInPause']||![],'smsPause':_0x323296[_0xb6eb('0x59')]||![],'openchannelPause':_0x323296[_0xb6eb('0x59')]||![],'pauseType':_0x323296['loginInPause']?_0xb6eb('0x5a'):null,'lastPauseAt':moment()[_0xb6eb('0x35')](_0xb6eb('0x30')),'interface':_0xa56eea});}})[_0xb6eb('0x10')](function(_0x35fc58){_0x4470b7(_0x35fc58);})['catch'](function(_0x4e57e2){_0x185cf3(_0x3c91d0[_0xb6eb('0x16')](0x1f4,_0x4e57e2[_0xb6eb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index c0a1e12..997898b 100644 --- a/server/api/user/user.socket.js +++ b/server/api/user/user.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf870=['save','remove','update','emit','removeListener','user:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf870,0x1b6));var _0x0f87=function(_0x9fd772,_0xff157a){_0x9fd772=_0x9fd772-0x0;var _0x1ca2b9=_0xf870[_0x9fd772];return _0x1ca2b9;};'use strict';var UserEvents=require('./user.events');var events=[_0x0f87('0x0'),_0x0f87('0x1'),_0x0f87('0x2')];function createListener(_0x1cc786,_0xb1ac37){return function(_0x3352be){_0xb1ac37[_0x0f87('0x3')](_0x1cc786,_0x3352be);};}function removeListener(_0x29a49d,_0xbbffc8){return function(){UserEvents[_0x0f87('0x4')](_0x29a49d,_0xbbffc8);};}exports['register']=function(_0x16bfda){for(var _0x585c24=0x0,_0x317979=events['length'];_0x585c24<_0x317979;_0x585c24++){var _0x168e5f=events[_0x585c24];var _0x296ca3=createListener(_0x0f87('0x5')+_0x168e5f,_0x16bfda);UserEvents['on'](_0x168e5f,_0x296ca3);}}; \ No newline at end of file +var _0x03e8=['update','emit','removeListener','register','length','user:','./user.events','remove'];(function(_0x2769f6,_0x4261a3){var _0x302769=function(_0x5ebd48){while(--_0x5ebd48){_0x2769f6['push'](_0x2769f6['shift']());}};_0x302769(++_0x4261a3);}(_0x03e8,0x86));var _0x803e=function(_0x529be7,_0xe3abe1){_0x529be7=_0x529be7-0x0;var _0x435ec1=_0x03e8[_0x529be7];return _0x435ec1;};'use strict';var UserEvents=require(_0x803e('0x0'));var events=['save',_0x803e('0x1'),_0x803e('0x2')];function createListener(_0x53d25d,_0x536adc){return function(_0x24cd4a){_0x536adc[_0x803e('0x3')](_0x53d25d,_0x24cd4a);};}function removeListener(_0x4923f3,_0x2c2bf5){return function(){UserEvents[_0x803e('0x4')](_0x4923f3,_0x2c2bf5);};}exports[_0x803e('0x5')]=function(_0x45ad26){for(var _0x3828d6=0x0,_0x4bfd35=events[_0x803e('0x6')];_0x3828d6<_0x4bfd35;_0x3828d6++){var _0x330f78=events[_0x3828d6];var _0x2aed59=createListener(_0x803e('0x7')+_0x330f78,_0x45ad26);UserEvents['on'](_0x330f78,_0x2aed59);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 27d9af9..470219a 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8273=['../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout','Router','../../components/auth/service'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8273,0x103));var _0x3827=function(_0xef4a2a,_0xd90e14){_0xef4a2a=_0xef4a2a-0x0;var _0x136336=_0x8273[_0xef4a2a];return _0x136336;};'use strict';var multer=require(_0x3827('0x0'));var util=require(_0x3827('0x1'));var path=require('path');var timeout=require(_0x3827('0x2'));var express=require('express');var router=express[_0x3827('0x3')]();var auth=require(_0x3827('0x4'));var interaction=require(_0x3827('0x5'));var config=require(_0x3827('0x6'));module[_0x3827('0x7')]=router; \ No newline at end of file +var _0x6eb0=['../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x35ea21,_0x46d9de){var _0x395a42=function(_0x43dbb3){while(--_0x43dbb3){_0x35ea21['push'](_0x35ea21['shift']());}};_0x395a42(++_0x46d9de);}(_0x6eb0,0x81));var _0x06eb=function(_0x2ab889,_0x4c8e5d){_0x2ab889=_0x2ab889-0x0;var _0x301175=_0x6eb0[_0x2ab889];return _0x301175;};'use strict';var multer=require(_0x06eb('0x0'));var util=require('util');var path=require(_0x06eb('0x1'));var timeout=require(_0x06eb('0x2'));var express=require(_0x06eb('0x3'));var router=express[_0x06eb('0x4')]();var auth=require(_0x06eb('0x5'));var interaction=require(_0x06eb('0x6'));var config=require(_0x06eb('0x7'));module[_0x06eb('0x8')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 932c1fc..69b5f68 100644 --- a/server/api/userChatQueue/userChatQueue.attributes.js +++ b/server/api/userChatQueue/userChatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['INTEGER','sequelize','exports'];(function(_0x212359,_0x71bf8c){var _0x2ef823=function(_0x507557){while(--_0x507557){_0x212359['push'](_0x212359['shift']());}};_0x2ef823(++_0x71bf8c);}(_0xe706,0xa3));var _0x6e70=function(_0x1998bb,_0x1f1da1){_0x1998bb=_0x1998bb-0x0;var _0x4ae4c9=_0xe706[_0x1998bb];return _0x4ae4c9;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x15833e,_0x58a046){var _0x5c4745=function(_0x2d1a2c){while(--_0x2d1a2c){_0x15833e['push'](_0x15833e['shift']());}};_0x5c4745(++_0x58a046);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 0121293..f702c59 100644 --- a/server/api/userChatQueue/userChatQueue.model.js +++ b/server/api/userChatQueue/userChatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x928c=['define','UserChatQueue','user_has_chat_queues','lodash','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x42fbdd,_0xbb21a3){var _0x525b95=function(_0x330481){while(--_0x330481){_0x42fbdd['push'](_0x42fbdd['shift']());}};_0x525b95(++_0xbb21a3);}(_0x928c,0x157));var _0xc928=function(_0x236a90,_0x555f16){_0x236a90=_0x236a90-0x0;var _0x269994=_0x928c[_0x236a90];return _0x269994;};'use strict';var _=require(_0xc928('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc928('0x1'));var moment=require(_0xc928('0x2'));var BPromise=require(_0xc928('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc928('0x4'));var rimraf=require('rimraf');var config=require(_0xc928('0x5'));var attributes=require('./userChatQueue.attributes');module[_0xc928('0x6')]=function(_0x10218e,_0x1b3abe){return _0x10218e[_0xc928('0x7')](_0xc928('0x8'),attributes,{'tableName':_0xc928('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86be=['UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x3c858f,_0x235201){var _0x198090=function(_0xc4c406){while(--_0xc4c406){_0x3c858f['push'](_0x3c858f['shift']());}};_0x198090(++_0x235201);}(_0x86be,0x176));var _0xe86b=function(_0x3d9a2f,_0xd2fb0e){_0x3d9a2f=_0x3d9a2f-0x0;var _0x24eef0=_0x86be[_0x3d9a2f];return _0x24eef0;};'use strict';var _=require(_0xe86b('0x0'));var util=require('util');var logger=require(_0xe86b('0x1'))(_0xe86b('0x2'));var moment=require(_0xe86b('0x3'));var BPromise=require(_0xe86b('0x4'));var rp=require(_0xe86b('0x5'));var fs=require('fs');var path=require(_0xe86b('0x6'));var rimraf=require(_0xe86b('0x7'));var config=require(_0xe86b('0x8'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x5c2e13,_0x7ccd64){return _0x5c2e13[_0xe86b('0x9')](_0xe86b('0xa'),attributes,{'tableName':_0xe86b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 4b0f659..178181b 100644 --- a/server/api/userChatQueue/userChatQueue.rpc.js +++ b/server/api/userChatQueue/userChatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d5d=['then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x3d5d,0x88));var _0xd3d5=function(_0x24679e,_0x22d9d7){_0x24679e=_0x24679e-0x0;var _0x291f21=_0x3d5d[_0x24679e];return _0x291f21;};'use strict';var _=require(_0xd3d5('0x0'));var util=require(_0xd3d5('0x1'));var moment=require(_0xd3d5('0x2'));var BPromise=require('bluebird');var rs=require(_0xd3d5('0x3'));var fs=require('fs');var Redis=require(_0xd3d5('0x4'));var db=require(_0xd3d5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd3d5('0x6'));var jayson=require(_0xd3d5('0x7'));var client=jayson[_0xd3d5('0x8')][_0xd3d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a1564,_0x326520,_0xf3970a){return new BPromise(function(_0x358ff0,_0x274ce6){return client[_0xd3d5('0xa')](_0x4a1564,_0xf3970a)[_0xd3d5('0xb')](function(_0x720964){logger[_0xd3d5('0xc')](_0xd3d5('0xd'),_0x326520,_0xd3d5('0xe'));logger[_0xd3d5('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x326520,_0xd3d5('0xe'),JSON['stringify'](_0x720964));if(_0x720964[_0xd3d5('0x10')]){if(_0x720964[_0xd3d5('0x10')][_0xd3d5('0x11')]===0x1f4){logger['error'](_0xd3d5('0xd'),_0x326520,_0x720964[_0xd3d5('0x10')][_0xd3d5('0x12')]);return _0x274ce6(_0x720964[_0xd3d5('0x10')][_0xd3d5('0x12')]);}logger[_0xd3d5('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x326520,_0x720964['error'][_0xd3d5('0x12')]);return _0x358ff0(_0x720964[_0xd3d5('0x10')]['message']);}else{logger[_0xd3d5('0xc')](_0xd3d5('0xd'),_0x326520,'request\x20sent');_0x358ff0(_0x720964[_0xd3d5('0x13')][_0xd3d5('0x12')]);}})[_0xd3d5('0x14')](function(_0x4d4f00){logger[_0xd3d5('0x10')](_0xd3d5('0xd'),_0x326520,_0x4d4f00);_0x274ce6(_0x4d4f00);});});} \ No newline at end of file +var _0x29fe=['code','UserChatQueue,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','request\x20sent','debug','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x29fe,0x1bc));var _0xe29f=function(_0x6fb7c2,_0x27d02a){_0x6fb7c2=_0x6fb7c2-0x0;var _0x506651=_0x29fe[_0x6fb7c2];return _0x506651;};'use strict';var _=require(_0xe29f('0x0'));var util=require(_0xe29f('0x1'));var moment=require('moment');var BPromise=require(_0xe29f('0x2'));var rs=require(_0xe29f('0x3'));var fs=require('fs');var Redis=require(_0xe29f('0x4'));var db=require(_0xe29f('0x5'))['db'];var utils=require(_0xe29f('0x6'));var logger=require(_0xe29f('0x7'))('rpc');var config=require(_0xe29f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe29f('0x9')][_0xe29f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1296ce,_0x13aa9a,_0x34f5f8){return new BPromise(function(_0x32189c,_0x507dc6){return client[_0xe29f('0xb')](_0x1296ce,_0x34f5f8)['then'](function(_0x1e7651){logger[_0xe29f('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x13aa9a,_0xe29f('0xd'));logger[_0xe29f('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x13aa9a,_0xe29f('0xd'),JSON['stringify'](_0x1e7651));if(_0x1e7651['error']){if(_0x1e7651[_0xe29f('0xf')][_0xe29f('0x10')]===0x1f4){logger[_0xe29f('0xf')](_0xe29f('0x11'),_0x13aa9a,_0x1e7651[_0xe29f('0xf')][_0xe29f('0x12')]);return _0x507dc6(_0x1e7651[_0xe29f('0xf')][_0xe29f('0x12')]);}logger['error'](_0xe29f('0x11'),_0x13aa9a,_0x1e7651[_0xe29f('0xf')][_0xe29f('0x12')]);return _0x32189c(_0x1e7651[_0xe29f('0xf')][_0xe29f('0x12')]);}else{logger['info'](_0xe29f('0x11'),_0x13aa9a,_0xe29f('0xd'));_0x32189c(_0x1e7651['result'][_0xe29f('0x12')]);}})[_0xe29f('0x13')](function(_0x326547){logger[_0xe29f('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x13aa9a,_0x326547);_0x507dc6(_0x326547);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index b3e4dac..0ba9b17 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0746=['../../components/interaction/service','../../config/environment','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x49a48a,_0x27de5f){var _0x4ec7b6=function(_0x1f800e){while(--_0x1f800e){_0x49a48a['push'](_0x49a48a['shift']());}};_0x4ec7b6(++_0x27de5f);}(_0x0746,0x153));var _0x6074=function(_0x3215bc,_0x76783e){_0x3215bc=_0x3215bc-0x0;var _0x29b5fb=_0x0746[_0x3215bc];return _0x29b5fb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6074('0x0'));var timeout=require(_0x6074('0x1'));var express=require(_0x6074('0x2'));var router=express[_0x6074('0x3')]();var auth=require(_0x6074('0x4'));var interaction=require(_0x6074('0x5'));var config=require(_0x6074('0x6'));module[_0x6074('0x7')]=router; \ No newline at end of file +var _0x63b0=['../../components/interaction/service','exports','multer','connect-timeout','express','../../components/auth/service'];(function(_0x472e46,_0x23f24b){var _0x56ee3c=function(_0x5e3043){while(--_0x5e3043){_0x472e46['push'](_0x472e46['shift']());}};_0x56ee3c(++_0x23f24b);}(_0x63b0,0x68));var _0x063b=function(_0x2816ec,_0xf7270c){_0x2816ec=_0x2816ec-0x0;var _0x4a7560=_0x63b0[_0x2816ec];return _0x4a7560;};'use strict';var multer=require(_0x063b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x063b('0x1'));var express=require(_0x063b('0x2'));var router=express['Router']();var auth=require(_0x063b('0x3'));var interaction=require(_0x063b('0x4'));var config=require('../../config/environment');module[_0x063b('0x5')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index b17507f..4ad67eb 100644 --- a/server/api/userFaxQueue/userFaxQueue.attributes.js +++ b/server/api/userFaxQueue/userFaxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0972=['exports','INTEGER'];(function(_0x4c6a15,_0x1cbe0a){var _0x4dfff=function(_0x19d705){while(--_0x19d705){_0x4c6a15['push'](_0x4c6a15['shift']());}};_0x4dfff(++_0x1cbe0a);}(_0x0972,0x64));var _0x2097=function(_0xd74016,_0x282f59){_0xd74016=_0xd74016-0x0;var _0x323584=_0x0972[_0xd74016];return _0x323584;};'use strict';var Sequelize=require('sequelize');module[_0x2097('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2097('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9c00=['exports','STRING','sequelize'];(function(_0x567058,_0x58309e){var _0x3f8fda=function(_0x4d763e){while(--_0x4d763e){_0x567058['push'](_0x567058['shift']());}};_0x3f8fda(++_0x58309e);}(_0x9c00,0x1a0));var _0x09c0=function(_0x29c3a0,_0x32be87){_0x29c3a0=_0x29c3a0-0x0;var _0x430f8a=_0x9c00[_0x29c3a0];return _0x430f8a;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x09c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index bca6d55..38d780f 100644 --- a/server/api/userFaxQueue/userFaxQueue.model.js +++ b/server/api/userFaxQueue/userFaxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x099b=['UserFaxQueue','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','define'];(function(_0x33f78a,_0x42a8f8){var _0x5b6758=function(_0x1b6da0){while(--_0x1b6da0){_0x33f78a['push'](_0x33f78a['shift']());}};_0x5b6758(++_0x42a8f8);}(_0x099b,0xe8));var _0xb099=function(_0xfe2ab8,_0x3cb101){_0xfe2ab8=_0xfe2ab8-0x0;var _0x658988=_0x099b[_0xfe2ab8];return _0x658988;};'use strict';var _=require(_0xb099('0x0'));var util=require(_0xb099('0x1'));var logger=require('../../config/logger')(_0xb099('0x2'));var moment=require(_0xb099('0x3'));var BPromise=require(_0xb099('0x4'));var rp=require(_0xb099('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb099('0x6'));var config=require(_0xb099('0x7'));var attributes=require(_0xb099('0x8'));module['exports']=function(_0x3d987b,_0x1e28c2){return _0x3d987b[_0xb099('0x9')](_0xb099('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4e9=['bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4e9,0x174));var _0x9f4e=function(_0x48abf0,_0x3177fb){_0x48abf0=_0x48abf0-0x0;var _0x4faf78=_0xf4e9[_0x48abf0];return _0x4faf78;};'use strict';var _=require(_0x9f4e('0x0'));var util=require(_0x9f4e('0x1'));var logger=require(_0x9f4e('0x2'))(_0x9f4e('0x3'));var moment=require(_0x9f4e('0x4'));var BPromise=require(_0x9f4e('0x5'));var rp=require(_0x9f4e('0x6'));var fs=require('fs');var path=require(_0x9f4e('0x7'));var rimraf=require('rimraf');var config=require(_0x9f4e('0x8'));var attributes=require(_0x9f4e('0x9'));module['exports']=function(_0x38ffb9,_0xf78cc){return _0x38ffb9[_0x9f4e('0xa')](_0x9f4e('0xb'),attributes,{'tableName':_0x9f4e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 4cbb504..0a0b861 100644 --- a/server/api/userFaxQueue/userFaxQueue.rpc.js +++ b/server/api/userFaxQueue/userFaxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8946=['then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x489730,_0x5226b9){var _0x7855d1=function(_0x3bce57){while(--_0x3bce57){_0x489730['push'](_0x489730['shift']());}};_0x7855d1(++_0x5226b9);}(_0x8946,0x193));var _0x6894=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8946[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x6894('0x0'));var util=require(_0x6894('0x1'));var moment=require(_0x6894('0x2'));var BPromise=require(_0x6894('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6894('0x4'));var logger=require('../../config/logger')(_0x6894('0x5'));var config=require(_0x6894('0x6'));var jayson=require(_0x6894('0x7'));var client=jayson[_0x6894('0x8')][_0x6894('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x421b59,_0x1c3269,_0x25ab0a){return new BPromise(function(_0x4486fc,_0x5b2556){return client[_0x6894('0xa')](_0x421b59,_0x25ab0a)[_0x6894('0xb')](function(_0x29dc51){logger[_0x6894('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x1c3269,_0x6894('0xd'));logger[_0x6894('0xe')](_0x6894('0xf'),_0x1c3269,'request\x20sent',JSON[_0x6894('0x10')](_0x29dc51));if(_0x29dc51['error']){if(_0x29dc51[_0x6894('0x11')][_0x6894('0x12')]===0x1f4){logger[_0x6894('0x11')](_0x6894('0x13'),_0x1c3269,_0x29dc51[_0x6894('0x11')][_0x6894('0x14')]);return _0x5b2556(_0x29dc51['error']['message']);}logger[_0x6894('0x11')](_0x6894('0x13'),_0x1c3269,_0x29dc51[_0x6894('0x11')][_0x6894('0x14')]);return _0x4486fc(_0x29dc51[_0x6894('0x11')]['message']);}else{logger[_0x6894('0xc')](_0x6894('0x13'),_0x1c3269,_0x6894('0xd'));_0x4486fc(_0x29dc51[_0x6894('0x15')][_0x6894('0x14')]);}})[_0x6894('0x16')](function(_0x568eda){logger[_0x6894('0x11')](_0x6894('0x13'),_0x1c3269,_0x568eda);_0x5b2556(_0x568eda);});});} \ No newline at end of file +var _0xf7a8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','moment','bluebird'];(function(_0x41fa32,_0x2faf36){var _0x801b0d=function(_0x286dc9){while(--_0x286dc9){_0x41fa32['push'](_0x41fa32['shift']());}};_0x801b0d(++_0x2faf36);}(_0xf7a8,0xfa));var _0x8f7a=function(_0x3d1a58,_0x35233a){_0x3d1a58=_0x3d1a58-0x0;var _0x116fe2=_0xf7a8[_0x3d1a58];return _0x116fe2;};'use strict';var _=require(_0x8f7a('0x0'));var util=require('util');var moment=require(_0x8f7a('0x1'));var BPromise=require(_0x8f7a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f7a('0x3'));var db=require(_0x8f7a('0x4'))['db'];var utils=require(_0x8f7a('0x5'));var logger=require(_0x8f7a('0x6'))(_0x8f7a('0x7'));var config=require(_0x8f7a('0x8'));var jayson=require(_0x8f7a('0x9'));var client=jayson[_0x8f7a('0xa')][_0x8f7a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xee5258,_0x14612c,_0x1b81eb){return new BPromise(function(_0x9f3931,_0x4f0dd6){return client['request'](_0xee5258,_0x1b81eb)[_0x8f7a('0xc')](function(_0x958ae4){logger[_0x8f7a('0xd')](_0x8f7a('0xe'),_0x14612c,'request\x20sent');logger[_0x8f7a('0xf')](_0x8f7a('0x10'),_0x14612c,_0x8f7a('0x11'),JSON[_0x8f7a('0x12')](_0x958ae4));if(_0x958ae4['error']){if(_0x958ae4['error'][_0x8f7a('0x13')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x14612c,_0x958ae4[_0x8f7a('0x14')][_0x8f7a('0x15')]);return _0x4f0dd6(_0x958ae4[_0x8f7a('0x14')]['message']);}logger['error'](_0x8f7a('0xe'),_0x14612c,_0x958ae4[_0x8f7a('0x14')]['message']);return _0x9f3931(_0x958ae4[_0x8f7a('0x14')][_0x8f7a('0x15')]);}else{logger[_0x8f7a('0xd')](_0x8f7a('0xe'),_0x14612c,'request\x20sent');_0x9f3931(_0x958ae4[_0x8f7a('0x16')]['message']);}})['catch'](function(_0xe663a6){logger[_0x8f7a('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x14612c,_0xe663a6);_0x4f0dd6(_0xe663a6);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 15c888f..f9345af 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x785f=['multer','path','connect-timeout','express','Router','../../config/environment','exports'];(function(_0x203118,_0x340b21){var _0x33042f=function(_0x7f6472){while(--_0x7f6472){_0x203118['push'](_0x203118['shift']());}};_0x33042f(++_0x340b21);}(_0x785f,0x69));var _0xf785=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x785f[_0x381589];return _0x2a075d;};'use strict';var multer=require(_0xf785('0x0'));var util=require('util');var path=require(_0xf785('0x1'));var timeout=require(_0xf785('0x2'));var express=require(_0xf785('0x3'));var router=express[_0xf785('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf785('0x5'));module[_0xf785('0x6')]=router; \ No newline at end of file +var _0x22f8=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4097cd,_0x290c62){var _0x1a60d5=function(_0x19bba0){while(--_0x19bba0){_0x4097cd['push'](_0x4097cd['shift']());}};_0x1a60d5(++_0x290c62);}(_0x22f8,0xa8));var _0x822f=function(_0x8a3ebd,_0x5123ef){_0x8a3ebd=_0x8a3ebd-0x0;var _0x28ae52=_0x22f8[_0x8a3ebd];return _0x28ae52;};'use strict';var multer=require(_0x822f('0x0'));var util=require(_0x822f('0x1'));var path=require(_0x822f('0x2'));var timeout=require(_0x822f('0x3'));var express=require(_0x822f('0x4'));var router=express['Router']();var auth=require(_0x822f('0x5'));var interaction=require(_0x822f('0x6'));var config=require(_0x822f('0x7'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index b9199b6..4bfd44d 100644 --- a/server/api/userMailQueue/userMailQueue.attributes.js +++ b/server/api/userMailQueue/userMailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['sequelize','INTEGER'];(function(_0x2efe3c,_0x331e44){var _0x2b4ac2=function(_0x21a189){while(--_0x21a189){_0x2efe3c['push'](_0x2efe3c['shift']());}};_0x2b4ac2(++_0x331e44);}(_0xb10b,0x12a));var _0xbb10=function(_0x487d56,_0x1d4a80){_0x487d56=_0x487d56-0x0;var _0x3f409f=_0xb10b[_0x487d56];return _0x3f409f;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x4a18f0,_0x903c50){var _0x158316=function(_0x3cf39c){while(--_0x3cf39c){_0x4a18f0['push'](_0x4a18f0['shift']());}};_0x158316(++_0x903c50);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index c5ee190..0673779 100644 --- a/server/api/userMailQueue/userMailQueue.model.js +++ b/server/api/userMailQueue/userMailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['define','user_has_mail_queues','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x829616,_0x5d9318){var _0x35857a=function(_0x502cb9){while(--_0x502cb9){_0x829616['push'](_0x829616['shift']());}};_0x35857a(++_0x5d9318);}(_0x757a,0xde));var _0xa757=function(_0x9fbfe2,_0x511e4a){_0x9fbfe2=_0x9fbfe2-0x0;var _0x32482b=_0x757a[_0x9fbfe2];return _0x32482b;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('UserMailQueue',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','user_has_mail_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5cf0a2,_0x4c81db){var _0x589da8=function(_0x287fa4){while(--_0x287fa4){_0x5cf0a2['push'](_0x5cf0a2['shift']());}};_0x589da8(++_0x4c81db);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('UserMailQueue',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index f8cdef9..763fb64 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09f4=['message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21cc35,_0x4e715c){var _0x4cae2b=function(_0x1f7ff7){while(--_0x1f7ff7){_0x21cc35['push'](_0x21cc35['shift']());}};_0x4cae2b(++_0x4e715c);}(_0x09f4,0x1a5));var _0x409f=function(_0x54147d,_0x503b2c){_0x54147d=_0x54147d-0x0;var _0x46b48a=_0x09f4[_0x54147d];return _0x46b48a;};'use strict';var _=require('lodash');var util=require(_0x409f('0x0'));var moment=require(_0x409f('0x1'));var BPromise=require('bluebird');var rs=require(_0x409f('0x2'));var fs=require('fs');var Redis=require(_0x409f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x409f('0x4'));var logger=require(_0x409f('0x5'))('rpc');var config=require(_0x409f('0x6'));var jayson=require(_0x409f('0x7'));var client=jayson[_0x409f('0x8')][_0x409f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41f10a,_0x1b731f,_0x210f96){return new BPromise(function(_0x276232,_0x3627d1){return client[_0x409f('0xa')](_0x41f10a,_0x210f96)[_0x409f('0xb')](function(_0xc1b11c){logger[_0x409f('0xc')](_0x409f('0xd'),_0x1b731f,_0x409f('0xe'));logger[_0x409f('0xf')](_0x409f('0x10'),_0x1b731f,_0x409f('0xe'),JSON[_0x409f('0x11')](_0xc1b11c));if(_0xc1b11c[_0x409f('0x12')]){if(_0xc1b11c[_0x409f('0x12')]['code']===0x1f4){logger['error'](_0x409f('0xd'),_0x1b731f,_0xc1b11c[_0x409f('0x12')][_0x409f('0x13')]);return _0x3627d1(_0xc1b11c[_0x409f('0x12')][_0x409f('0x13')]);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x1b731f,_0xc1b11c[_0x409f('0x12')][_0x409f('0x13')]);return _0x276232(_0xc1b11c['error'][_0x409f('0x13')]);}else{logger[_0x409f('0xc')](_0x409f('0xd'),_0x1b731f,_0x409f('0xe'));_0x276232(_0xc1b11c[_0x409f('0x14')]['message']);}})[_0x409f('0x15')](function(_0x35a201){logger[_0x409f('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x1b731f,_0x35a201);_0x3627d1(_0x35a201);});});} \ No newline at end of file +var _0x308a=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','UserMailQueue,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x5abf0e,_0x5e969b){var _0x3cad78=function(_0x5770e7){while(--_0x5770e7){_0x5abf0e['push'](_0x5abf0e['shift']());}};_0x3cad78(++_0x5e969b);}(_0x308a,0x71));var _0xa308=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x308a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa308('0x0'));var util=require('util');var moment=require(_0xa308('0x1'));var BPromise=require(_0xa308('0x2'));var rs=require(_0xa308('0x3'));var fs=require('fs');var Redis=require(_0xa308('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa308('0x5'))(_0xa308('0x6'));var config=require(_0xa308('0x7'));var jayson=require(_0xa308('0x8'));var client=jayson[_0xa308('0x9')][_0xa308('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc30239,_0x5e0962,_0x5b8a23){return new BPromise(function(_0x2ca45e,_0x293f00){return client['request'](_0xc30239,_0x5b8a23)[_0xa308('0xb')](function(_0x5ced05){logger[_0xa308('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x5e0962,_0xa308('0xd'));logger[_0xa308('0xe')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x5e0962,_0xa308('0xd'),JSON['stringify'](_0x5ced05));if(_0x5ced05['error']){if(_0x5ced05[_0xa308('0xf')][_0xa308('0x10')]===0x1f4){logger[_0xa308('0xf')](_0xa308('0x11'),_0x5e0962,_0x5ced05[_0xa308('0xf')][_0xa308('0x12')]);return _0x293f00(_0x5ced05['error'][_0xa308('0x12')]);}logger[_0xa308('0xf')](_0xa308('0x11'),_0x5e0962,_0x5ced05[_0xa308('0xf')][_0xa308('0x12')]);return _0x2ca45e(_0x5ced05['error']['message']);}else{logger[_0xa308('0xc')](_0xa308('0x11'),_0x5e0962,_0xa308('0xd'));_0x2ca45e(_0x5ced05[_0xa308('0x13')][_0xa308('0x12')]);}})['catch'](function(_0x3fbc05){logger[_0xa308('0xf')](_0xa308('0x11'),_0x5e0962,_0x3fbc05);_0x293f00(_0x3fbc05);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 641a58d..f16fd07 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd07e=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x556e11,_0x551af3){var _0x3eeb3d=function(_0x9f66f){while(--_0x9f66f){_0x556e11['push'](_0x556e11['shift']());}};_0x3eeb3d(++_0x551af3);}(_0xd07e,0x10a));var _0xed07=function(_0x1c2319,_0x33ac0c){_0x1c2319=_0x1c2319-0x0;var _0x379adb=_0xd07e[_0x1c2319];return _0x379adb;};'use strict';var multer=require(_0xed07('0x0'));var util=require(_0xed07('0x1'));var path=require(_0xed07('0x2'));var timeout=require(_0xed07('0x3'));var express=require(_0xed07('0x4'));var router=express[_0xed07('0x5')]();var auth=require(_0xed07('0x6'));var interaction=require(_0xed07('0x7'));var config=require(_0xed07('0x8'));module[_0xed07('0x9')]=router; \ No newline at end of file +var _0x6d21=['../../components/interaction/service','multer','path','connect-timeout','express','Router'];(function(_0x5a0edf,_0x5306f9){var _0x36cfd9=function(_0x585f40){while(--_0x585f40){_0x5a0edf['push'](_0x5a0edf['shift']());}};_0x36cfd9(++_0x5306f9);}(_0x6d21,0xfd));var _0x16d2=function(_0xc3aed2,_0x2a0bef){_0xc3aed2=_0xc3aed2-0x0;var _0x1e85eb=_0x6d21[_0xc3aed2];return _0x1e85eb;};'use strict';var multer=require(_0x16d2('0x0'));var util=require('util');var path=require(_0x16d2('0x1'));var timeout=require(_0x16d2('0x2'));var express=require(_0x16d2('0x3'));var router=express[_0x16d2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x16d2('0x5'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index fd223b1..0de99e2 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x43139b,_0x1d704c){var _0x2de4de=function(_0x434fac){while(--_0x434fac){_0x43139b['push'](_0x43139b['shift']());}};_0x2de4de(++_0x1d704c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x176cbe,_0xfbbda6){var _0x1490cc=function(_0x12e158){while(--_0x12e158){_0x176cbe['push'](_0x176cbe['shift']());}};_0x1490cc(++_0xfbbda6);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index ced9f19..a67e981 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7725=['user_has_openchannel_queues','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue'];(function(_0x10bd94,_0x46b509){var _0x364677=function(_0x417683){while(--_0x417683){_0x10bd94['push'](_0x10bd94['shift']());}};_0x364677(++_0x46b509);}(_0x7725,0x1b1));var _0x5772=function(_0x145e9e,_0x2e6dd4){_0x145e9e=_0x145e9e-0x0;var _0x2264c2=_0x7725[_0x145e9e];return _0x2264c2;};'use strict';var _=require('lodash');var util=require(_0x5772('0x0'));var logger=require(_0x5772('0x1'))(_0x5772('0x2'));var moment=require(_0x5772('0x3'));var BPromise=require(_0x5772('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5772('0x5'));var rimraf=require(_0x5772('0x6'));var config=require(_0x5772('0x7'));var attributes=require(_0x5772('0x8'));module[_0x5772('0x9')]=function(_0x19a13d,_0x386efe){return _0x19a13d['define'](_0x5772('0xa'),attributes,{'tableName':_0x5772('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x507f=['../../config/environment','./userOpenchannelQueue.attributes','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x507f,0x1b2));var _0xf507=function(_0x1d8dd4,_0x25a626){_0x1d8dd4=_0x1d8dd4-0x0;var _0x4a3fc4=_0x507f[_0x1d8dd4];return _0x4a3fc4;};'use strict';var _=require(_0xf507('0x0'));var util=require(_0xf507('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf507('0x2'));var BPromise=require(_0xf507('0x3'));var rp=require(_0xf507('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf507('0x5'));var config=require(_0xf507('0x6'));var attributes=require(_0xf507('0x7'));module['exports']=function(_0x517adf,_0x557ee4){return _0x517adf['define'](_0xf507('0x8'),attributes,{'tableName':_0xf507('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index be11092..7d5a9e9 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad8a=['catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x19115e,_0x507bab){var _0x45bbd4=function(_0x1308bf){while(--_0x1308bf){_0x19115e['push'](_0x19115e['shift']());}};_0x45bbd4(++_0x507bab);}(_0xad8a,0x135));var _0xaad8=function(_0x31f86b,_0x3a3143){_0x31f86b=_0x31f86b-0x0;var _0x45343a=_0xad8a[_0x31f86b];return _0x45343a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaad8('0x0'));var BPromise=require(_0xaad8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaad8('0x2'));var db=require(_0xaad8('0x3'))['db'];var utils=require(_0xaad8('0x4'));var logger=require(_0xaad8('0x5'))('rpc');var config=require(_0xaad8('0x6'));var jayson=require(_0xaad8('0x7'));var client=jayson[_0xaad8('0x8')][_0xaad8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c0117,_0xadf291,_0x3c4833){return new BPromise(function(_0x5ca058,_0x58dbdc){return client['request'](_0x2c0117,_0x3c4833)[_0xaad8('0xa')](function(_0xfe3265){logger['info'](_0xaad8('0xb'),_0xadf291,_0xaad8('0xc'));logger[_0xaad8('0xd')](_0xaad8('0xe'),_0xadf291,_0xaad8('0xc'),JSON[_0xaad8('0xf')](_0xfe3265));if(_0xfe3265[_0xaad8('0x10')]){if(_0xfe3265[_0xaad8('0x10')][_0xaad8('0x11')]===0x1f4){logger[_0xaad8('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xadf291,_0xfe3265['error'][_0xaad8('0x12')]);return _0x58dbdc(_0xfe3265[_0xaad8('0x10')][_0xaad8('0x12')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0xadf291,_0xfe3265[_0xaad8('0x10')]['message']);return _0x5ca058(_0xfe3265[_0xaad8('0x10')][_0xaad8('0x12')]);}else{logger[_0xaad8('0x13')](_0xaad8('0xb'),_0xadf291,'request\x20sent');_0x5ca058(_0xfe3265[_0xaad8('0x14')][_0xaad8('0x12')]);}})[_0xaad8('0x15')](function(_0x314b46){logger[_0xaad8('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xadf291,_0x314b46);_0x58dbdc(_0x314b46);});});} \ No newline at end of file +var _0x4ca3=['error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4ca3,0x1b5));var _0x34ca=function(_0x4c456c,_0x3c73a6){_0x4c456c=_0x4c456c-0x0;var _0xd5e934=_0x4ca3[_0x4c456c];return _0xd5e934;};'use strict';var _=require(_0x34ca('0x0'));var util=require(_0x34ca('0x1'));var moment=require(_0x34ca('0x2'));var BPromise=require(_0x34ca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ca('0x4'));var db=require(_0x34ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x34ca('0x6'))(_0x34ca('0x7'));var config=require(_0x34ca('0x8'));var jayson=require(_0x34ca('0x9'));var client=jayson[_0x34ca('0xa')][_0x34ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4784a0,_0x52ba65,_0x4338b4){return new BPromise(function(_0x4121a8,_0x53fbb3){return client[_0x34ca('0xc')](_0x4784a0,_0x4338b4)['then'](function(_0x231183){logger[_0x34ca('0xd')](_0x34ca('0xe'),_0x52ba65,_0x34ca('0xf'));logger[_0x34ca('0x10')](_0x34ca('0x11'),_0x52ba65,_0x34ca('0xf'),JSON[_0x34ca('0x12')](_0x231183));if(_0x231183[_0x34ca('0x13')]){if(_0x231183[_0x34ca('0x13')][_0x34ca('0x14')]===0x1f4){logger[_0x34ca('0x13')](_0x34ca('0xe'),_0x52ba65,_0x231183['error'][_0x34ca('0x15')]);return _0x53fbb3(_0x231183['error'][_0x34ca('0x15')]);}logger[_0x34ca('0x13')](_0x34ca('0xe'),_0x52ba65,_0x231183[_0x34ca('0x13')][_0x34ca('0x15')]);return _0x4121a8(_0x231183[_0x34ca('0x13')]['message']);}else{logger['info'](_0x34ca('0xe'),_0x52ba65,_0x34ca('0xf'));_0x4121a8(_0x231183[_0x34ca('0x16')][_0x34ca('0x15')]);}})[_0x34ca('0x17')](function(_0x36acb5){logger['error'](_0x34ca('0xe'),_0x52ba65,_0x36acb5);_0x53fbb3(_0x36acb5);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index fc258f0..8116655 100644 --- a/server/api/userProfile/index.js +++ b/server/api/userProfile/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5b6=['addResources','put','/:id','update','delete','removeSections','removeResources','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','/describe','describe','show','/:id/resources','getResources','post','create','/:id/clone','clone','/:id/sections','addSections'];(function(_0x26d50f,_0x24e564){var _0x26a0f3=function(_0x141275){while(--_0x141275){_0x26d50f['push'](_0x26d50f['shift']());}};_0x26a0f3(++_0x24e564);}(_0xf5b6,0x1b9));var _0x6f5b=function(_0x8a6095,_0x552d36){_0x8a6095=_0x8a6095-0x0;var _0x400774=_0xf5b6[_0x8a6095];return _0x400774;};'use strict';var multer=require(_0x6f5b('0x0'));var util=require(_0x6f5b('0x1'));var path=require(_0x6f5b('0x2'));var timeout=require(_0x6f5b('0x3'));var express=require(_0x6f5b('0x4'));var router=express[_0x6f5b('0x5')]();var auth=require(_0x6f5b('0x6'));var interaction=require(_0x6f5b('0x7'));var config=require(_0x6f5b('0x8'));var controller=require(_0x6f5b('0x9'));router['get']('/',auth[_0x6f5b('0xa')](),controller[_0x6f5b('0xb')]);router[_0x6f5b('0xc')](_0x6f5b('0xd'),auth[_0x6f5b('0xa')](),controller[_0x6f5b('0xe')]);router[_0x6f5b('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x6f5b('0xf')]);router[_0x6f5b('0xc')](_0x6f5b('0x10'),auth['isAuthenticated'](),controller[_0x6f5b('0x11')]);router[_0x6f5b('0x12')]('/',auth[_0x6f5b('0xa')](),controller[_0x6f5b('0x13')]);router[_0x6f5b('0x12')](_0x6f5b('0x14'),auth['isAuthenticated'](),controller[_0x6f5b('0x15')]);router[_0x6f5b('0x12')](_0x6f5b('0x16'),auth[_0x6f5b('0xa')](),controller[_0x6f5b('0x17')]);router[_0x6f5b('0x12')](_0x6f5b('0x10'),auth[_0x6f5b('0xa')](),controller[_0x6f5b('0x18')]);router[_0x6f5b('0x19')](_0x6f5b('0x1a'),auth['isAuthenticated'](),controller[_0x6f5b('0x1b')]);router[_0x6f5b('0x1c')](_0x6f5b('0x1a'),auth[_0x6f5b('0xa')](),controller['destroy']);router['delete']('/:id/sections',auth[_0x6f5b('0xa')](),controller[_0x6f5b('0x1d')]);router[_0x6f5b('0x1c')](_0x6f5b('0x10'),auth['isAuthenticated'](),controller[_0x6f5b('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x1f7d=['/:id/sections','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/resources','post','create','clone'];(function(_0x18b9fd,_0xcf8c93){var _0x50d5d6=function(_0x486057){while(--_0x486057){_0x18b9fd['push'](_0x18b9fd['shift']());}};_0x50d5d6(++_0xcf8c93);}(_0x1f7d,0x136));var _0xd1f7=function(_0x50b660,_0x2f5328){_0x50b660=_0x50b660-0x0;var _0x5118c4=_0x1f7d[_0x50b660];return _0x5118c4;};'use strict';var multer=require(_0xd1f7('0x0'));var util=require(_0xd1f7('0x1'));var path=require(_0xd1f7('0x2'));var timeout=require(_0xd1f7('0x3'));var express=require('express');var router=express[_0xd1f7('0x4')]();var auth=require(_0xd1f7('0x5'));var interaction=require(_0xd1f7('0x6'));var config=require(_0xd1f7('0x7'));var controller=require(_0xd1f7('0x8'));router[_0xd1f7('0x9')]('/',auth[_0xd1f7('0xa')](),controller[_0xd1f7('0xb')]);router[_0xd1f7('0x9')](_0xd1f7('0xc'),auth[_0xd1f7('0xa')](),controller[_0xd1f7('0xd')]);router[_0xd1f7('0x9')](_0xd1f7('0xe'),auth[_0xd1f7('0xa')](),controller[_0xd1f7('0xf')]);router[_0xd1f7('0x9')](_0xd1f7('0x10'),auth['isAuthenticated'](),controller['getResources']);router[_0xd1f7('0x11')]('/',auth[_0xd1f7('0xa')](),controller[_0xd1f7('0x12')]);router[_0xd1f7('0x11')]('/:id/clone',auth[_0xd1f7('0xa')](),controller[_0xd1f7('0x13')]);router[_0xd1f7('0x11')](_0xd1f7('0x14'),auth[_0xd1f7('0xa')](),controller[_0xd1f7('0x15')]);router[_0xd1f7('0x11')]('/:id/resources',auth[_0xd1f7('0xa')](),controller[_0xd1f7('0x16')]);router[_0xd1f7('0x17')](_0xd1f7('0xe'),auth[_0xd1f7('0xa')](),controller[_0xd1f7('0x18')]);router[_0xd1f7('0x19')](_0xd1f7('0xe'),auth['isAuthenticated'](),controller[_0xd1f7('0x1a')]);router[_0xd1f7('0x19')](_0xd1f7('0x14'),auth['isAuthenticated'](),controller[_0xd1f7('0x1b')]);router[_0xd1f7('0x19')](_0xd1f7('0x10'),auth[_0xd1f7('0xa')](),controller[_0xd1f7('0x1c')]);module[_0xd1f7('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index e44653b..dbf87d6 100644 --- a/server/api/userProfile/userProfile.attributes.js +++ b/server/api/userProfile/userProfile.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcac2=['getDataValue','split','sequelize','exports','STRING','crudPermissions'];(function(_0xe77767,_0x332183){var _0x560b61=function(_0x37fdcf){while(--_0x37fdcf){_0xe77767['push'](_0xe77767['shift']());}};_0x560b61(++_0x332183);}(_0xcac2,0x1e8));var _0x2cac=function(_0x2e70ba,_0x28b858){_0x2e70ba=_0x2e70ba-0x0;var _0x2415cd=_0xcac2[_0x2e70ba];return _0x2415cd;};'use strict';var Sequelize=require(_0x2cac('0x0'));module[_0x2cac('0x1')]={'name':{'type':Sequelize[_0x2cac('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x2cac('0x2')],'set':function(_0x305cc8){this['setDataValue']('crudPermissions',_0x305cc8?_0x305cc8['join'](''):[]);},'get':function(){return this['getDataValue'](_0x2cac('0x3'))?this[_0x2cac('0x4')](_0x2cac('0x3'))[_0x2cac('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x2cac('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x390a=['getDataValue','sequelize','exports','STRING','name','setDataValue','crudPermissions','join'];(function(_0x533852,_0x5e1347){var _0x3b39f2=function(_0x37711a){while(--_0x37711a){_0x533852['push'](_0x533852['shift']());}};_0x3b39f2(++_0x5e1347);}(_0x390a,0xc9));var _0xa390=function(_0x531632,_0x3b0f90){_0x531632=_0x531632-0x0;var _0x458cb3=_0x390a[_0x531632];return _0x458cb3;};'use strict';var Sequelize=require(_0xa390('0x0'));module[_0xa390('0x1')]={'name':{'type':Sequelize[_0xa390('0x2')],'allowNull':![],'unique':_0xa390('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x177b8f){this[_0xa390('0x4')](_0xa390('0x5'),_0x177b8f?_0x177b8f[_0xa390('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xa390('0x5'))?this[_0xa390('0x7')](_0xa390('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa390('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 905595e..65fbbb2 100644 --- a/server/api/userProfile/userProfile.controller.js +++ b/server/api/userProfile/userProfile.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39e2=['Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','push','all','ignore','union','length','hasOwnProperty','order','pick','AnalyticExtractedReport','foreignKey','associatedResources','forEach','reportType','default','reportId','DefaultReports','custom','CmContact','Tags','color','Tag','ThroughTags','tag','value','resourceId','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','Campaign','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','voicequeues','users','agents','telephones','Users','admin','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Schedule','sounds','tags','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','offset','set','apply','save','update','then','destroy','end','error','stack','name','send','index','UserProfile','rawAttributes','model','keys','query','filters','attributes','intersection','fields','nolimit','limit','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','clone','find','omit','createdAt','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','userProfileId','Resources','UserProfileResource','describe','sectionId','get','removeSections','ids','addResources','bulkCreate','removeResources','getResources','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel'];(function(_0x277894,_0x5ab1df){var _0x58d4fa=function(_0x28b0e4){while(--_0x28b0e4){_0x277894['push'](_0x277894['shift']());}};_0x58d4fa(++_0x5ab1df);}(_0x39e2,0x83));var _0x239e=function(_0x146370,_0x1943c3){_0x146370=_0x146370-0x0;var _0xf675d=_0x39e2[_0x146370];return _0xf675d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x239e('0x0'));var rimraf=require(_0x239e('0x1'));var zipdir=require(_0x239e('0x2'));var jsonpatch=require(_0x239e('0x3'));var rp=require(_0x239e('0x4'));var moment=require(_0x239e('0x5'));var BPromise=require(_0x239e('0x6'));var Mustache=require(_0x239e('0x7'));var util=require(_0x239e('0x8'));var path=require(_0x239e('0x9'));var sox=require(_0x239e('0xa'));var csv=require(_0x239e('0xb'));var ejs=require(_0x239e('0xc'));var fs=require('fs');var _=require(_0x239e('0xd'));var squel=require(_0x239e('0xe'));var crypto=require(_0x239e('0xf'));var jsforce=require(_0x239e('0x10'));var deskjs=require(_0x239e('0x11'));var toCsv=require(_0x239e('0xb'));var querystring=require(_0x239e('0x12'));var Papa=require(_0x239e('0x13'));var Redis=require(_0x239e('0x14'));var authService=require(_0x239e('0x15'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x239e('0x16'))('api');var utils=require(_0x239e('0x17'));var config=require(_0x239e('0x18'));var db=require(_0x239e('0x19'))['db'];config[_0x239e('0x1a')]=_[_0x239e('0x1b')](config[_0x239e('0x1a')],{'host':_0x239e('0x1c'),'port':0x18eb});var socket=require(_0x239e('0x1d'))(new Redis(config[_0x239e('0x1a')]));require(_0x239e('0x1e'))['register'](socket);function respondWithStatusCode(_0x348388,_0x5f8c6f){_0x5f8c6f=_0x5f8c6f||0xcc;return function(_0x1d337c){if(_0x1d337c){return _0x348388[_0x239e('0x1f')](_0x5f8c6f);}return _0x348388[_0x239e('0x20')](_0x5f8c6f)['end']();};}function respondWithResult(_0x500c5e,_0x454606){_0x454606=_0x454606||0xc8;return function(_0x45cbe8){if(_0x45cbe8){return _0x500c5e['status'](_0x454606)['json'](_0x45cbe8);}};}function respondWithFilteredResult(_0x340988,_0x101d84){return function(_0x5c9ed0){if(_0x5c9ed0){var _0x4a6500=_0x5c9ed0['count'],_0x28c49f=_0x101d84['offset'],_0x4b225f=_0x101d84[_0x239e('0x21')]+_0x101d84['limit'],_0x290acb;if(_0x4b225f>=_0x4a6500){_0x4b225f=_0x4a6500;_0x290acb=0xc8;}else{_0x290acb=0xce;}_0x340988['status'](_0x290acb);return _0x340988[_0x239e('0x22')]('Content-Range',_0x28c49f+'-'+_0x4b225f+'/'+_0x4a6500)['json'](_0x5c9ed0);}return null;};}function patchUpdates(_0x3edb22){return function(_0x4289c2){try{jsonpatch[_0x239e('0x23')](_0x4289c2,_0x3edb22,!![]);}catch(_0x3ccd82){return BPromise['reject'](_0x3ccd82);}return _0x4289c2[_0x239e('0x24')]();};}function saveUpdates(_0xa2908f,_0x52b0b7){return function(_0x2d1140){if(_0x2d1140){return _0x2d1140[_0x239e('0x25')](_0xa2908f)[_0x239e('0x26')](function(_0x1d9dc7){return _0x1d9dc7;});}return null;};}function removeEntity(_0x2ec9e3,_0x24f4c8){return function(_0x309191){if(_0x309191){return _0x309191[_0x239e('0x27')]()[_0x239e('0x26')](function(){_0x2ec9e3[_0x239e('0x20')](0xcc)[_0x239e('0x28')]();});}};}function handleEntityNotFound(_0x54c75f,_0x5df304){return function(_0x95cc07){if(!_0x95cc07){_0x54c75f[_0x239e('0x1f')](0x194);}return _0x95cc07;};}function handleError(_0x2537e1,_0x5b6ead){_0x5b6ead=_0x5b6ead||0x1f4;return function(_0x128c81){logger[_0x239e('0x29')](_0x128c81[_0x239e('0x2a')]);if(_0x128c81[_0x239e('0x2b')]){delete _0x128c81['name'];}_0x2537e1[_0x239e('0x20')](_0x5b6ead)[_0x239e('0x2c')](_0x128c81);};}exports[_0x239e('0x2d')]=function(_0x4d5071,_0x3a3fc9){var _0x19a977={},_0x7cb591={},_0x1d85be={'count':0x0,'rows':[]};var _0x23f9d1=db[_0x239e('0x2e')][_0x239e('0x2f')];_0x7cb591[_0x239e('0x30')]=_[_0x239e('0x31')](_0x23f9d1);_0x7cb591[_0x239e('0x32')]=_[_0x239e('0x31')](_0x4d5071['query']);_0x7cb591[_0x239e('0x33')]=_['intersection'](_0x7cb591[_0x239e('0x30')],_0x7cb591['query']);_0x19a977[_0x239e('0x34')]=_[_0x239e('0x35')](_0x7cb591[_0x239e('0x30')],qs[_0x239e('0x36')](_0x4d5071[_0x239e('0x32')][_0x239e('0x36')]));_0x19a977['attributes']=_0x19a977[_0x239e('0x34')]['length']?_0x19a977['attributes']:_0x7cb591['model'];if(!_0x4d5071[_0x239e('0x32')]['hasOwnProperty'](_0x239e('0x37'))){_0x19a977['limit']=qs['limit'](_0x4d5071[_0x239e('0x32')][_0x239e('0x38')]);_0x19a977[_0x239e('0x21')]=qs[_0x239e('0x21')](_0x4d5071[_0x239e('0x32')][_0x239e('0x21')]);}_0x19a977['order']=qs[_0x239e('0x39')](_0x4d5071['query'][_0x239e('0x39')]);_0x19a977[_0x239e('0x3a')]=qs[_0x239e('0x33')](_['pick'](_0x4d5071[_0x239e('0x32')],_0x7cb591[_0x239e('0x33')]));if(_0x4d5071[_0x239e('0x32')][_0x239e('0x3b')]){_0x19a977['where']=_[_0x239e('0x3c')](_0x19a977[_0x239e('0x3a')],{'$or':_[_0x239e('0x3d')](_0x23f9d1,function(_0x46fa8b){if(_0x46fa8b[_0x239e('0x3e')][_0x239e('0x3f')]!==_0x239e('0x40')){var _0xbd1e86={};_0xbd1e86[_0x46fa8b[_0x239e('0x41')]]={'$like':'%'+_0x4d5071[_0x239e('0x32')]['filter']+'%'};return _0xbd1e86;}})});}_0x19a977=_[_0x239e('0x3c')]({},_0x19a977,_0x4d5071[_0x239e('0x42')]);var _0x42485c={'where':_0x19a977[_0x239e('0x3a')]};return db[_0x239e('0x2e')][_0x239e('0x43')](_0x42485c)[_0x239e('0x26')](function(_0x10299e){_0x1d85be[_0x239e('0x43')]=_0x10299e;if(_0x4d5071[_0x239e('0x32')][_0x239e('0x44')]){_0x19a977[_0x239e('0x45')]=[{'all':!![]}];}return db[_0x239e('0x2e')][_0x239e('0x46')](_0x19a977);})[_0x239e('0x26')](function(_0x36d393){_0x1d85be[_0x239e('0x47')]=_0x36d393;return _0x1d85be;})['then'](respondWithFilteredResult(_0x3a3fc9,_0x19a977))[_0x239e('0x48')](handleError(_0x3a3fc9,null));};exports[_0x239e('0x49')]=function(_0x3357b8,_0x235025){var _0x150890={'raw':![],'where':{'id':_0x3357b8[_0x239e('0x4a')]['id']}},_0x389866={};_0x389866[_0x239e('0x30')]=_[_0x239e('0x31')](db[_0x239e('0x2e')][_0x239e('0x2f')]);_0x389866['query']=_[_0x239e('0x31')](_0x3357b8[_0x239e('0x32')]);_0x389866[_0x239e('0x33')]=_[_0x239e('0x35')](_0x389866[_0x239e('0x30')],_0x389866[_0x239e('0x32')]);_0x150890[_0x239e('0x34')]=_[_0x239e('0x35')](_0x389866['model'],qs[_0x239e('0x36')](_0x3357b8['query'][_0x239e('0x36')]));_0x150890[_0x239e('0x34')]=_0x150890[_0x239e('0x34')]['length']?_0x150890[_0x239e('0x34')]:_0x389866[_0x239e('0x30')];if(_0x3357b8[_0x239e('0x32')]['includeAll']){_0x150890['include']=[{'all':!![]}];}_0x150890=_[_0x239e('0x3c')]({},_0x150890,_0x3357b8[_0x239e('0x42')]);return db[_0x239e('0x2e')]['find'](_0x150890)['then'](handleEntityNotFound(_0x235025,null))[_0x239e('0x26')](respondWithResult(_0x235025,null))['catch'](handleError(_0x235025,null));};exports['create']=function(_0x5cda12,_0x2ad042){return db[_0x239e('0x2e')][_0x239e('0x4b')](_0x5cda12[_0x239e('0x4c')],{})['then'](respondWithResult(_0x2ad042,0xc9))[_0x239e('0x48')](handleError(_0x2ad042,null));};exports[_0x239e('0x4d')]=function(_0x62b363,_0x4c4680){var _0x29913c={'raw':![],'where':{'id':_0x62b363[_0x239e('0x4a')]['id']}},_0x4c5979={};_0x4c5979[_0x239e('0x30')]=_['keys'](db[_0x239e('0x2e')][_0x239e('0x2f')]);_0x29913c[_0x239e('0x34')]=_[_0x239e('0x35')](_0x4c5979[_0x239e('0x30')],qs['fields'](_0x62b363['query'][_0x239e('0x36')]));_0x29913c['attributes']=_0x29913c['attributes']['length']?_0x29913c[_0x239e('0x34')]:_0x4c5979[_0x239e('0x30')];if(_0x62b363[_0x239e('0x32')]['includeAll']){_0x29913c[_0x239e('0x45')]=[{'all':!![]}];}_0x29913c=_[_0x239e('0x3c')]({},_0x29913c,_0x62b363[_0x239e('0x42')]);return db[_0x239e('0x2e')][_0x239e('0x4e')](_0x29913c)[_0x239e('0x26')](handleEntityNotFound(_0x4c4680,null))['then'](function(_0x4017c0){if(_0x4017c0){var _0x372946=_0x4017c0['get']({'plain':!![]});_0x372946=qs[_0x239e('0x4f')](_0x372946,['id',_0x239e('0x50'),_0x239e('0x51'),'crudPermissions']);_0x62b363[_0x239e('0x4c')]=_[_0x239e('0x4f')](_0x62b363[_0x239e('0x4c')],['id',_0x239e('0x50'),'updatedAt']);return db[_0x239e('0x52')][_0x239e('0x53')](function(_0x561f3d){return db['UserProfile'][_0x239e('0x4b')](_['merge'](_0x372946,_0x62b363[_0x239e('0x4c')]),{'include':_0x62b363[_0x239e('0x32')][_0x239e('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x561f3d})[_0x239e('0x26')](function(_0x2d7dfb){var _0x10b0c5=_0x2d7dfb['get']({'plain':!![]});return db[_0x239e('0x54')][_0x239e('0x46')]({'where':{'userProfileId':_0x62b363['params']['id']},'raw':!![]})[_0x239e('0x26')](function(_0x10779e){if(_0x10779e){return BPromise[_0x239e('0x55')](_0x10779e,function(_0x1b2a03){return new BPromise(function(_0x2db7eb,_0x46de7f){if(_0x1b2a03[_0x239e('0x56')]===null||_0x1b2a03[_0x239e('0x56')]===0x1)_0x2db7eb(null);return db['UserProfileResource'][_0x239e('0x46')]({'where':{'sectionId':_0x1b2a03['id']},'raw':!![]})[_0x239e('0x26')](function(_0x34fdc8){var _0x3df3f5=_[_0x239e('0x3d')](_0x34fdc8,function(_0x16bb1c){return qs['omit'](_0x16bb1c,['id',_0x239e('0x50'),_0x239e('0x51'),'sectionId']);});_0x2db7eb(_0x3df3f5);})[_0x239e('0x48')](function(_0x2e8045){_0x46de7f(_0x2e8045);});})['then'](function(_0x2e2375){var _0x4b6a90=qs[_0x239e('0x4f')](_0x1b2a03,['id',_0x239e('0x50'),'updatedAt']);_0x4b6a90[_0x239e('0x57')]=_0x10b0c5['id'];if(_0x2e2375)_0x4b6a90[_0x239e('0x58')]=_0x2e2375;return _0x4b6a90;})[_0x239e('0x26')](function(_0xb0ea86){return db[_0x239e('0x54')]['create'](_0xb0ea86,{'include':[{'model':db[_0x239e('0x59')],'as':_0x239e('0x58')}],'raw':!![],'transaction':_0x561f3d});});})[_0x239e('0x26')](function(){return _0x10b0c5;});}});});});}})['then'](respondWithResult(_0x4c4680,0xc9))[_0x239e('0x48')](handleError(_0x4c4680,null));};exports[_0x239e('0x25')]=function(_0x729852,_0x24ce7e){if(_0x729852['body']['id']){delete _0x729852[_0x239e('0x4c')]['id'];}return db['UserProfile'][_0x239e('0x4e')]({'where':{'id':_0x729852[_0x239e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x24ce7e,null))['then'](saveUpdates(_0x729852[_0x239e('0x4c')],null))['then'](respondWithResult(_0x24ce7e,null))[_0x239e('0x48')](handleError(_0x24ce7e,null));};exports[_0x239e('0x27')]=function(_0x263f33,_0x9cd3a1){return db[_0x239e('0x2e')][_0x239e('0x4e')]({'where':{'id':_0x263f33[_0x239e('0x4a')]['id']}})[_0x239e('0x26')](handleEntityNotFound(_0x9cd3a1,null))[_0x239e('0x26')](removeEntity(_0x9cd3a1,null))[_0x239e('0x48')](handleError(_0x9cd3a1,null));};exports['describe']=function(_0xd28f37,_0x46cf46){return db[_0x239e('0x2e')][_0x239e('0x5a')]()[_0x239e('0x26')](respondWithResult(_0x46cf46,null))[_0x239e('0x48')](handleError(_0x46cf46,null));};exports['addSections']=function(_0x2062cb,_0x4dae3c){var _0x541557=_0x2062cb[_0x239e('0x4c')];return db[_0x239e('0x2e')][_0x239e('0x4e')]({'where':{'id':_0x2062cb[_0x239e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4dae3c,null))[_0x239e('0x26')](function(_0x488d0a){if(_0x488d0a){return db[_0x239e('0x52')][_0x239e('0x53')](function(_0xf67cbc){return db[_0x239e('0x54')][_0x239e('0x27')]({'where':{'userProfileId':_0x2062cb['params']['id'],'sectionId':_[_0x239e('0x3d')](_0x541557,function(_0x354d50){return _0x354d50[_0x239e('0x5b')];})},'transaction':_0xf67cbc})[_0x239e('0x26')](function(){var _0x1a883a=_['map'](_0x541557,function(_0x2d6389){_0x2d6389['userProfileId']=_0x2062cb[_0x239e('0x4a')]['id'];return _0x2d6389;});var _0x3e2650=[];return BPromise[_0x239e('0x55')](_0x1a883a,function(_0x2ef19a){return db['UserProfileSection'][_0x239e('0x4b')](_0x2ef19a,{'include':[{'model':db[_0x239e('0x59')],'as':_0x239e('0x58')}],'raw':!![],'transaction':_0xf67cbc})[_0x239e('0x26')](function(_0x278fa8){_0x3e2650['push'](_0x278fa8[_0x239e('0x5c')]({'plain':!![]}));});})[_0x239e('0x26')](function(){return _0x3e2650;});});});}})[_0x239e('0x26')](function(_0x4d4d67){return _0x4d4d67;})['then'](respondWithResult(_0x4dae3c,null))[_0x239e('0x48')](handleError(_0x4dae3c,null));};exports[_0x239e('0x5d')]=function(_0x458ea8,_0x35a5d1){var _0x1a0d24;return db['UserProfile'][_0x239e('0x4e')]({'where':{'id':_0x458ea8[_0x239e('0x4a')]['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x35a5d1,null))[_0x239e('0x26')](function(_0x4ef713){if(_0x4ef713){_0x1a0d24=_0x4ef713;return db['UserProfileSection'][_0x239e('0x27')]({'where':{'userProfileId':_0x458ea8[_0x239e('0x4a')]['id'],'sectionId':_0x458ea8[_0x239e('0x32')][_0x239e('0x5e')]}});}})[_0x239e('0x26')](function(){return _0x1a0d24;})[_0x239e('0x26')](respondWithStatusCode(_0x35a5d1,null))[_0x239e('0x48')](handleError(_0x35a5d1,null));};exports[_0x239e('0x5f')]=function(_0x30d971,_0x28f476){return db[_0x239e('0x2e')]['find']({'where':{'id':_0x30d971[_0x239e('0x4a')]['id']}})[_0x239e('0x26')](handleEntityNotFound(_0x28f476,null))[_0x239e('0x26')](function(_0x426637){if(_0x426637){return db[_0x239e('0x52')]['transaction'](function(_0x4d6f46){return db[_0x239e('0x54')][_0x239e('0x46')]({'where':{'userProfileId':_0x30d971[_0x239e('0x4a')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x5008b3){if(_0x5008b3){return db[_0x239e('0x54')][_0x239e('0x27')]({'where':{'userProfileId':_0x30d971['params']['id'],'id':_[_0x239e('0x3d')](_0x5008b3,function(_0x30822a){return _0x30822a['id'];})},'transaction':_0x4d6f46});}})[_0x239e('0x26')](function(_0x5daf21){var _0x3a67e9=_[_0x239e('0x3d')](_0x30d971[_0x239e('0x4c')],function(_0x3a3ce2){_0x3a3ce2[_0x239e('0x57')]=_0x30d971[_0x239e('0x4a')]['id'];return _0x3a3ce2;});return db[_0x239e('0x54')][_0x239e('0x60')](_0x3a67e9,{'raw':!![],'transaction':_0x4d6f46});})[_0x239e('0x26')](function(_0x40ba19){var _0x30c8f6=_[_0x239e('0x3b')](_[_0x239e('0x3d')](_0x40ba19,function(_0x1a9497){return _0x1a9497[_0x239e('0x5c')]({'plain':!![]});}),{'includeAll':![]});if(_0x30c8f6){return db[_0x239e('0x54')][_0x239e('0x46')]({'where':{'userProfileId':_0x30d971[_0x239e('0x4a')]['id'],'sectionId':_[_0x239e('0x3d')](_0x30c8f6,function(_0x465718){return _0x465718['sectionId'];})},'attributes':['id',_0x239e('0x5b')],'raw':!![]})[_0x239e('0x26')](function(_0x109466){var _0x11ec2a=_['map'](_0x30d971['body'],function(_0x554111){_0x554111['userProfileId']=_0x30d971['params']['id'];return _0x554111;});return db[_0x239e('0x59')][_0x239e('0x60')](_0x11ec2a,{'raw':!![],'transaction':_0x4d6f46});});}})[_0x239e('0x48')](handleError(_0x28f476,null));});}})['then'](function(_0xa985a5){var _0x2bfeec=_[_0x239e('0x3d')](_0xa985a5,function(_0x1d2df5){return _0x1d2df5[_0x239e('0x5c')]({'plain':!![]});});})[_0x239e('0x26')](respondWithResult(_0x28f476,null))[_0x239e('0x48')](handleError(_0x28f476,null));};exports[_0x239e('0x61')]=function(_0x4dbda4,_0x2fa13f,_0x5be3da){return db[_0x239e('0x2e')][_0x239e('0x4e')]({'where':{'id':_0x4dbda4[_0x239e('0x4a')]['id']}})[_0x239e('0x26')](handleEntityNotFound(_0x2fa13f,null))[_0x239e('0x26')](function(_0x4f0821){if(_0x4f0821){return _0x4f0821[_0x239e('0x61')](_0x4dbda4['query']['ids']);}})[_0x239e('0x26')](respondWithStatusCode(_0x2fa13f,null))[_0x239e('0x48')](handleError(_0x2fa13f,null));};exports[_0x239e('0x62')]=function(_0x351357,_0x1f6559){var _0xb46ec8={'raw':![],'where':{}};var _0x3ccb1a={};var _0x45129d={'count':0x0,'rows':[]};var _0x32cb56=_0x351357[_0x239e('0x32')]['section'];if(typeof _0x32cb56===_0x239e('0x63')){throw new db[(_0x239e('0x64'))][(_0x239e('0x65'))](_0x239e('0x66'));}var _0x41207c=_0x351357[_0x239e('0x32')][_0x239e('0x67')]||![];var _0x574320=getQueryModels(_0x32cb56,_0x41207c);if(typeof _0x574320[_0x239e('0x68')]===_0x239e('0x63')){throw new db[(_0x239e('0x64'))][(_0x239e('0x65'))](_0x239e('0x69')+_0x32cb56+'\x27');}var _0x98d6ad=[];if(!_[_0x239e('0x6a')](_0x574320['parentSections'])){_0x98d6ad=_0x574320[_0x239e('0x6b')];}else{_0x98d6ad=[{'name':_0x32cb56}];}return db['UserProfile'][_0x239e('0x6c')]({'where':{'id':_0x351357['params']['id']}})[_0x239e('0x26')](handleEntityNotFound(_0x1f6559,null))['then'](function(_0x52a922){if(_0x52a922){var _0x1f7099=[];for(var _0x3803e2=0x0;_0x3803e2<_0x98d6ad['length'];_0x3803e2++){_0x1f7099[_0x239e('0x6d')](db['UserProfileSection'][_0x239e('0x6c')]({'where':{'userProfileId':_0x52a922['id'],'name':_0x98d6ad[_0x3803e2][_0x239e('0x2b')]},'raw':!![]}));}return BPromise[_0x239e('0x6e')](_0x1f7099);}})['then'](function(_0x355cd8){var _0x2df969=_[_0x239e('0x3b')](_0x355cd8,function(_0x2cc324){return _0x2cc324?_0x2cc324:undefined;});var _0x2f7b78=_[_0x239e('0x3b')](_0x98d6ad,[_0x239e('0x6f'),!![]]);var _0xb6ec3d=_['isEmpty'](_0x2df969)&&_[_0x239e('0x6a')](_0x2f7b78)?null:_[_0x239e('0x70')](_0x2f7b78,_0x2df969);if(_0xb6ec3d){var _0x3438b4=[];for(var _0x54d4ae=0x0;_0x54d4ae<_0xb6ec3d['length'];_0x54d4ae++){var _0xf63007=_[_0x239e('0x4e')](_0x98d6ad,function(_0x46d228){return _0xb6ec3d[_0x54d4ae]?_0x46d228[_0x239e('0x2b')]===_0xb6ec3d[_0x54d4ae][_0x239e('0x2b')]:null;});if(_0xf63007){if(_0xb6ec3d[_0x54d4ae][_0x239e('0x6f')]){_0x3438b4['push'](getAllResources(_0x574320['childModel'],_0xb6ec3d[_0x54d4ae]));}else{if(!_0xb6ec3d[_0x54d4ae][_0x239e('0x56')]){_0x3438b4[_0x239e('0x6d')](getAllowedResources(_0xf63007,_0xb6ec3d[_0x54d4ae],_0x574320[_0x239e('0x68')]));}else{if(_0xf63007[_0x239e('0x30')]){_0x3438b4[_0x239e('0x6d')](getAllFilteredResources(_0xf63007,_0xb6ec3d[_0x54d4ae]));}}}}}return BPromise[_0x239e('0x6e')](_0x3438b4);}else{return null;}})[_0x239e('0x26')](function(_0x4bde98){var _0x22eb5f=_0x4bde98;var _0x341e83=null;if(_0x22eb5f){_0x341e83=_0x22eb5f[_0x239e('0x71')]===0x1?_0x22eb5f[0x0]:null;}if(_0x341e83||_0x22eb5f){var _0x6dade8=db[_0x574320[_0x239e('0x68')]][_0x239e('0x2f')];_0x3ccb1a[_0x239e('0x30')]=_[_0x239e('0x31')](_0x6dade8);_0x3ccb1a[_0x239e('0x32')]=_['keys'](_0x351357['query']);_0x3ccb1a[_0x239e('0x33')]=_[_0x239e('0x35')](_0x3ccb1a[_0x239e('0x30')],_0x3ccb1a[_0x239e('0x32')]);_0xb46ec8['attributes']=_[_0x239e('0x35')](_0x3ccb1a[_0x239e('0x30')],qs[_0x239e('0x36')](_0x351357[_0x239e('0x32')][_0x239e('0x36')]));_0xb46ec8[_0x239e('0x34')]=_0xb46ec8['attributes'][_0x239e('0x71')]?_0xb46ec8['attributes']:_0x3ccb1a[_0x239e('0x30')];if(!_0x351357['query'][_0x239e('0x72')](_0x239e('0x37'))){_0xb46ec8[_0x239e('0x38')]=qs[_0x239e('0x38')](_0x351357[_0x239e('0x32')][_0x239e('0x38')]);_0xb46ec8[_0x239e('0x21')]=qs['offset'](_0x351357['query'][_0x239e('0x21')]);}_0xb46ec8[_0x239e('0x73')]=qs[_0x239e('0x39')](_0x351357[_0x239e('0x32')][_0x239e('0x39')]);_0xb46ec8[_0x239e('0x3a')]=qs[_0x239e('0x33')](_[_0x239e('0x74')](_0x351357['query'],_0x3ccb1a[_0x239e('0x33')]));if(_0x351357[_0x239e('0x32')][_0x239e('0x3b')]){_0xb46ec8[_0x239e('0x3a')]=_[_0x239e('0x3c')](_0xb46ec8[_0x239e('0x3a')],{'$or':_['map'](_0x6dade8,function(_0x5a197f){if(_0x5a197f[_0x239e('0x3e')]['key']!==_0x239e('0x40')){var _0x3245e4={};_0x3245e4[_0x5a197f[_0x239e('0x41')]]={'$like':'%'+_0x351357[_0x239e('0x32')][_0x239e('0x3b')]+'%'};return _0x3245e4;}})});}var _0x1303d2=[];if(_0x341e83){var _0x586aad=_['find'](_0x98d6ad,[_0x239e('0x2b'),_0x341e83[_0x239e('0x2b')]]);if(_0x586aad[_0x239e('0x41')]){var _0xaec426={};if(_0x574320[_0x239e('0x68')]===_0x239e('0x75')){_0xaec426[_0x586aad[_0x239e('0x76')]]=_[_0x239e('0x3d')](_0x341e83['associatedResources'],'id');}else{_0xaec426[_0x586aad[_0x239e('0x76')]]=_0x341e83[_0x239e('0x77')];}_0x1303d2['push'](_0xaec426);}else{_0xb46ec8['where']['id']=_0x341e83['associatedResources'];}}else{for(var _0x51f39e=0x0;_0x51f39e<_0x22eb5f[_0x239e('0x71')];_0x51f39e++){var _0x586aad=_[_0x239e('0x4e')](_0x98d6ad,[_0x239e('0x2b'),_0x22eb5f[_0x51f39e][_0x239e('0x2b')]]);if(_0x586aad[_0x239e('0x41')]){var _0xaec426={};_0xaec426[_0x586aad[_0x239e('0x76')]]=_0x22eb5f[_0x51f39e][_0x239e('0x77')];_0x1303d2[_0x239e('0x6d')](_0xaec426);}else{if(!_0xb46ec8['where']['id'])_0xb46ec8[_0x239e('0x3a')]['id']=[];_0x22eb5f[_0x51f39e][_0x239e('0x77')][_0x239e('0x78')](function(_0x27e9cc){_0xb46ec8[_0x239e('0x3a')]['id'][_0x239e('0x6d')](_0x27e9cc);});}}}if(!_['isEmpty'](_0x1303d2)){_0xb46ec8['where']=_['merge'](_0xb46ec8[_0x239e('0x3a')],{'$and':{'$or':_0x1303d2}});}_0xb46ec8=_['merge']({},_0xb46ec8,_0x351357[_0x239e('0x42')]);if(_0x341e83&&!_0x341e83[_0x239e('0x56')]&&_0x574320[_0x239e('0x68')]===_0x239e('0x75')){if(_0x351357[_0x239e('0x32')][_0x239e('0x44')]){_0xb46ec8[_0x239e('0x45')]=[{'all':!![]}];}return db[_0x574320[_0x239e('0x68')]][_0x239e('0x46')](_0xb46ec8)[_0x239e('0x26')](function(_0x2a9412){var _0x26e99d=[];_0x2a9412[_0x239e('0x78')](function(_0x180d67){var _0x383a9a;switch(_0x180d67[_0x239e('0x79')]){case _0x239e('0x7a'):_0x383a9a=_[_0x239e('0x4e')](_0x341e83[_0x239e('0x77')],function(_0x59e63f){return _0x59e63f['id']===_0x180d67[_0x239e('0x7b')]&&_0x59e63f[_0x239e('0x3e')]===_0x239e('0x7c');});break;case _0x239e('0x7d'):_0x383a9a=_['find'](_0x341e83['associatedResources'],function(_0x37bf68){return _0x37bf68['id']===_0x180d67[_0x239e('0x7b')]&&_0x37bf68[_0x239e('0x3e')]==='CustomReports';});break;}if(_0x383a9a)_0x26e99d['push'](_0x180d67);});_0x45129d[_0x239e('0x43')]=_0x26e99d[_0x239e('0x71')];_0x45129d[_0x239e('0x47')]=_0x26e99d;return _0x45129d;});}else{return db[_0x574320['childModel']]['count']({'where':_0xb46ec8['where']})[_0x239e('0x26')](function(_0x1169ec){_0x45129d[_0x239e('0x43')]=_0x1169ec;if(_0x351357[_0x239e('0x32')][_0x239e('0x44')]){if(_0x574320[_0x239e('0x68')]===_0x239e('0x7e')){_0xb46ec8[_0x239e('0x45')]=[{'model':db['Tag'],'as':_0x239e('0x7f'),'attributes':['id',_0x239e('0x2b'),_0x239e('0x80')],'required':_0x351357[_0x239e('0x32')]['tag']?!![]:![]},{'model':db[_0x239e('0x81')],'as':_0x239e('0x82'),'attributes':['id',_0x239e('0x2b'),_0x239e('0x80')],'through':_0x351357[_0x239e('0x32')][_0x239e('0x83')]?{'attributes':[],'where':{'TagId':_0x351357[_0x239e('0x32')]['tag']||undefined}}:{},'required':_0x351357['query'][_0x239e('0x83')]?!![]:![]}];}else{_0xb46ec8['include']=[{'all':!![]}];}}return db[_0x574320[_0x239e('0x68')]][_0x239e('0x46')](_0xb46ec8);})[_0x239e('0x26')](function(_0x9e50cc){_0x45129d['rows']=_0x9e50cc;return _0x45129d;});}}else{return _0x45129d;}})['then'](respondWithFilteredResult(_0x1f6559,_0xb46ec8))['catch'](handleError(_0x1f6559,null));};function getAllResources(_0x36e9ae,_0x1320c2){return new BPromise(function(_0x13928f,_0x410d55){if(_0x1320c2){var _0x404547=_0x1320c2['filter']?{[_0x1320c2['filter'][_0x239e('0x41')]]:_0x1320c2[_0x239e('0x3b')][_0x239e('0x84')]}:undefined;return db[_0x36e9ae]['findAll']({'where':_0x404547,'raw':!![]})[_0x239e('0x26')](function(_0x476e36){_0x1320c2[_0x239e('0x77')]=_[_0x239e('0x3d')](_0x476e36,'id');_0x13928f(_0x1320c2);})[_0x239e('0x48')](function(_0x441e63){_0x410d55(_0x441e63);});}else{_0x13928f(null);}});}function getAllFilteredResources(_0x5c702b,_0x5035cc){return new BPromise(function(_0x3e1ffe,_0xed2c59){var _0x2e8540=_0x5c702b[_0x239e('0x3b')]?{[_0x5c702b[_0x239e('0x3b')][_0x239e('0x41')]]:_0x5c702b[_0x239e('0x3b')][_0x239e('0x84')]}:undefined;return db[_0x5c702b['model']][_0x239e('0x46')]({'where':_0x2e8540,'raw':!![]})[_0x239e('0x26')](function(_0x3f8c03){_0x5035cc['associatedResources']=_[_0x239e('0x3d')](_0x3f8c03,function(_0x21111b){return _0x21111b[_0x239e('0x2b')];});_0x3e1ffe(_0x5035cc);})[_0x239e('0x48')](function(_0x5708a6){_0xed2c59(_0x5708a6);});});}function getAllowedResources(_0x3ff55b,_0x24901d,_0x1f6cd0){return new BPromise(function(_0x970fc5,_0x71eec0){if(_0x24901d){return db[_0x239e('0x59')][_0x239e('0x46')]({'where':{'sectionId':_0x24901d['id']},'raw':!![]})[_0x239e('0x26')](function(_0x4456e9){if(_0x3ff55b[_0x239e('0x41')]&&_0x3ff55b[_0x239e('0x41')]!=='id'){_0x24901d[_0x239e('0x77')]=_[_0x239e('0x3d')](_0x4456e9,function(_0x667460){return _0x667460[_0x3ff55b[_0x239e('0x41')]];});}else{if(_0x1f6cd0===_0x239e('0x75')){_0x24901d['associatedResources']=_['map'](_0x4456e9,function(_0x59a3e4){return{'id':_0x59a3e4[_0x239e('0x85')],'type':_0x59a3e4[_0x239e('0x3e')]};});}else{_0x24901d[_0x239e('0x77')]=_[_0x239e('0x3d')](_0x4456e9,function(_0x3e81df){return _0x3e81df[_0x239e('0x85')];});}}_0x970fc5(_0x24901d);})['catch'](function(_0x25cb5b){_0x71eec0(_0x25cb5b);});}else{_0x970fc5(null);}});}function getQueryModels(_0x1b4682,_0x29612e){var _0x5a34e0=_0x1b4682[_0x239e('0x86')]();var _0x3b4379={'childModel':undefined,'parentSections':[]};switch(_0x5a34e0){case _0x239e('0x87'):_0x3b4379[_0x239e('0x68')]=_0x239e('0x88');break;case _0x239e('0x89'):_0x3b4379['childModel']=_0x239e('0x8a');break;case _0x239e('0x8b'):_0x3b4379[_0x239e('0x68')]=_0x239e('0x8c');_0x3b4379[_0x239e('0x6b')]=[{'name':_0x239e('0x8d'),'field':'name','foreignKey':_0x239e('0x8e')}];break;case _0x239e('0x8f'):_0x3b4379[_0x239e('0x68')]=_0x239e('0x90');break;case _0x239e('0x91'):_0x3b4379[_0x239e('0x68')]=_0x239e('0x7e');_0x3b4379['parentSections']=[{'name':_0x239e('0x92'),'field':'id','foreignKey':_0x239e('0x93')}];break;case'lists':_0x3b4379[_0x239e('0x68')]='CmList';break;case'companies':_0x3b4379[_0x239e('0x68')]=_0x239e('0x94');break;case _0x239e('0x95'):_0x3b4379[_0x239e('0x68')]='CmCustomField';break;case _0x239e('0x96'):_0x3b4379[_0x239e('0x68')]=_0x239e('0x97');break;case _0x239e('0x98'):_0x3b4379[_0x239e('0x68')]=_0x239e('0x99');break;case _0x239e('0x9a'):_0x3b4379['childModel']=_0x239e('0x9b');break;case _0x239e('0x9c'):_0x3b4379[_0x239e('0x68')]=_0x239e('0x9d');break;case _0x239e('0x9e'):case _0x239e('0x9f'):case _0x239e('0xa0'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xa1');break;case _0x239e('0xa2'):_0x3b4379['childModel']=_0x239e('0xa3');break;case _0x239e('0xa4'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xa5');break;case _0x239e('0xa6'):_0x3b4379['childModel']=_0x239e('0xa7');_0x3b4379[_0x239e('0x6b')]=[{'name':_0x239e('0xa8'),'field':'name','foreignKey':_0x239e('0xa9'),'model':_0x239e('0xaa'),'filter':{'field':_0x239e('0xab'),'value':[_0x239e('0xac')]}},{'name':_0x239e('0xad'),'field':_0x239e('0x2b'),'foreignKey':_0x239e('0xa9'),'model':_0x239e('0xaa'),'filter':{'field':'role','value':[_0x239e('0xae')]}},{'name':_0x239e('0xaf'),'field':_0x239e('0x2b'),'foreignKey':_0x239e('0xb0'),'model':_0x239e('0xb1'),'filter':{'field':'type','value':['inbound']}},{'name':_0x239e('0xb2'),'field':_0x239e('0x2b'),'foreignKey':_0x239e('0xb0'),'model':_0x239e('0xb1'),'filter':{'field':'type','value':[_0x239e('0xb3')]}}];break;case _0x239e('0xb4'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xb5');break;case _0x239e('0xb6'):_0x3b4379[_0x239e('0x68')]='VoiceChanSpy';break;case _0x239e('0xb7'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xb8');break;case'ivrcampaigns':_0x3b4379[_0x239e('0x68')]=_0x239e('0xb9');break;case'mailqueues':_0x3b4379['childModel']=_0x239e('0xba');break;case'mailaccounts':_0x3b4379[_0x239e('0x68')]=_0x239e('0xbb');break;case _0x239e('0xbc'):_0x3b4379[_0x239e('0x68')]='MailSubstatus';break;case _0x239e('0xbd'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xbe');break;case _0x239e('0xbf'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xc0');break;case _0x239e('0xc1'):_0x3b4379['childModel']=_0x239e('0xc2');break;case'smsaccounts':_0x3b4379['childModel']=_0x239e('0xc3');break;case'teams':_0x3b4379[_0x239e('0x68')]='Team';break;case _0x239e('0xc4'):case'queuecampaigns':_0x3b4379[_0x239e('0x68')]=_0x239e('0xb1');if(_0x29612e){_0x3b4379['parentSections']=[{'name':'VoiceQueues'},{'name':_0x239e('0xb2')}];}break;case _0x239e('0xc5'):case _0x239e('0xc6'):case _0x239e('0xc7'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xaa');if(_0x29612e){_0x3b4379['parentSections']=[{'name':_0x239e('0xc8'),'filter':{'field':_0x239e('0xab'),'value':[_0x239e('0xc9'),'user']},'ignore':!![]},{'name':_0x239e('0xa8')},{'name':'Telephones'}];}break;case _0x239e('0xca'):_0x3b4379[_0x239e('0x68')]='ZendeskAccount';break;case _0x239e('0xcb'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xcc');break;case _0x239e('0xcd'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xce');break;case _0x239e('0xcf'):_0x3b4379['childModel']=_0x239e('0xd0');break;case _0x239e('0xd1'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xd2');break;case'zohoaccounts':_0x3b4379['childModel']='ZohoAccount';break;case _0x239e('0xd3'):_0x3b4379['childModel']=_0x239e('0xaa');break;case _0x239e('0xd4'):_0x3b4379['childModel']=_0x239e('0xd5');break;case _0x239e('0xd6'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xd7');break;case _0x239e('0xd8'):_0x3b4379['childModel']=_0x239e('0xd9');break;case _0x239e('0xda'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xdb');break;case _0x239e('0xdc'):_0x3b4379[_0x239e('0x68')]='Pause';break;case'scheduler':_0x3b4379[_0x239e('0x68')]=_0x239e('0xdd');break;case _0x239e('0xde'):_0x3b4379[_0x239e('0x68')]='Sound';break;case _0x239e('0xdf'):_0x3b4379['childModel']=_0x239e('0x81');break;case'templates':_0x3b4379['childModel']=_0x239e('0xe0');break;case _0x239e('0xe1'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xe2');break;case _0x239e('0xe3'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xe4');break;case _0x239e('0xe5'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xe6');break;case _0x239e('0xe7'):_0x3b4379[_0x239e('0x68')]='Plugin';break;case _0x239e('0xe8'):_0x3b4379[_0x239e('0x68')]=_0x239e('0x75');_0x3b4379['parentSections']=[{'name':_0x239e('0xe9'),'field':'id','foreignKey':'reportId'}];break;case _0x239e('0xea'):_0x3b4379[_0x239e('0x68')]=_0x239e('0xeb');break;default:return _0x3b4379;}return _0x3b4379;} \ No newline at end of file +var _0xf076=['FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','VoiceMusicOnHold','voiceprefixes','VoicePrefix','ivrcampaigns','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','Team','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','Schedule','sounds','tags','templates','Template','triggers','Trunk','variables','plugins','Reports','metrics','AnalyticMetric','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','end','json','offset','Content-Range','apply','reject','save','update','then','error','stack','name','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','field','options','UserProfile','count','includeAll','include','rows','show','params','find','catch','create','clone','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','transaction','each','autoAssociation','findAll','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','destroy','addSections','removeSections','ids','addResources','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','push','ignore','union','childModel','all','VIRTUAL','AnalyticExtractedReport','associatedResources','foreignKey','forEach','reportType','default','reportId','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','color','ThroughTags','tag','value','resourceId','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','projectName','projects','contacts','lists','CmList','companies','CmCompany','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts'];(function(_0x6d38e5,_0x391e6e){var _0x2deb4c=function(_0x148ec5){while(--_0x148ec5){_0x6d38e5['push'](_0x6d38e5['shift']());}};_0x2deb4c(++_0x391e6e);}(_0xf076,0x12b));var _0x6f07=function(_0x582b37,_0x3289e1){_0x582b37=_0x582b37-0x0;var _0x1832ee=_0xf076[_0x582b37];return _0x1832ee;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6f07('0x0'));var rimraf=require(_0x6f07('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6f07('0x2'));var moment=require(_0x6f07('0x3'));var BPromise=require(_0x6f07('0x4'));var Mustache=require(_0x6f07('0x5'));var util=require(_0x6f07('0x6'));var path=require(_0x6f07('0x7'));var sox=require('sox');var csv=require(_0x6f07('0x8'));var ejs=require(_0x6f07('0x9'));var fs=require('fs');var _=require(_0x6f07('0xa'));var squel=require(_0x6f07('0xb'));var crypto=require(_0x6f07('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6f07('0xd'));var toCsv=require(_0x6f07('0x8'));var querystring=require(_0x6f07('0xe'));var Papa=require('papaparse');var Redis=require(_0x6f07('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6f07('0x10'));var logger=require(_0x6f07('0x11'))(_0x6f07('0x12'));var utils=require('../../config/utils');var config=require(_0x6f07('0x13'));var db=require(_0x6f07('0x14'))['db'];config['redis']=_[_0x6f07('0x15')](config[_0x6f07('0x16')],{'host':_0x6f07('0x17'),'port':0x18eb});var socket=require(_0x6f07('0x18'))(new Redis(config[_0x6f07('0x16')]));require('./userProfile.socket')[_0x6f07('0x19')](socket);function respondWithStatusCode(_0x26ee83,_0x10e219){_0x10e219=_0x10e219||0xcc;return function(_0x3506cb){if(_0x3506cb){return _0x26ee83['sendStatus'](_0x10e219);}return _0x26ee83[_0x6f07('0x1a')](_0x10e219)[_0x6f07('0x1b')]();};}function respondWithResult(_0x5e42af,_0x51992e){_0x51992e=_0x51992e||0xc8;return function(_0x10f134){if(_0x10f134){return _0x5e42af['status'](_0x51992e)[_0x6f07('0x1c')](_0x10f134);}};}function respondWithFilteredResult(_0x1245c3,_0x58920e){return function(_0x36c3b2){if(_0x36c3b2){var _0x4fe812=_0x36c3b2['count'],_0x560953=_0x58920e['offset'],_0xb1131b=_0x58920e[_0x6f07('0x1d')]+_0x58920e['limit'],_0x5f3452;if(_0xb1131b>=_0x4fe812){_0xb1131b=_0x4fe812;_0x5f3452=0xc8;}else{_0x5f3452=0xce;}_0x1245c3[_0x6f07('0x1a')](_0x5f3452);return _0x1245c3['set'](_0x6f07('0x1e'),_0x560953+'-'+_0xb1131b+'/'+_0x4fe812)[_0x6f07('0x1c')](_0x36c3b2);}return null;};}function patchUpdates(_0x22df24){return function(_0x2b659b){try{jsonpatch[_0x6f07('0x1f')](_0x2b659b,_0x22df24,!![]);}catch(_0x1a7593){return BPromise[_0x6f07('0x20')](_0x1a7593);}return _0x2b659b[_0x6f07('0x21')]();};}function saveUpdates(_0xc19192,_0x92bffd){return function(_0x55517f){if(_0x55517f){return _0x55517f[_0x6f07('0x22')](_0xc19192)['then'](function(_0x2e0d65){return _0x2e0d65;});}return null;};}function removeEntity(_0x458561,_0x14cb37){return function(_0x3199f9){if(_0x3199f9){return _0x3199f9['destroy']()[_0x6f07('0x23')](function(){_0x458561[_0x6f07('0x1a')](0xcc)[_0x6f07('0x1b')]();});}};}function handleEntityNotFound(_0x1497db,_0x729744){return function(_0x17f80d){if(!_0x17f80d){_0x1497db['sendStatus'](0x194);}return _0x17f80d;};}function handleError(_0x16a366,_0x58761a){_0x58761a=_0x58761a||0x1f4;return function(_0x4910bc){logger[_0x6f07('0x24')](_0x4910bc[_0x6f07('0x25')]);if(_0x4910bc[_0x6f07('0x26')]){delete _0x4910bc['name'];}_0x16a366[_0x6f07('0x1a')](_0x58761a)['send'](_0x4910bc);};}exports[_0x6f07('0x27')]=function(_0x465a0b,_0x332eed){var _0x2faade={},_0x1476e7={},_0x55c253={'count':0x0,'rows':[]};var _0x5f014b=db['UserProfile'][_0x6f07('0x28')];_0x1476e7[_0x6f07('0x29')]=_[_0x6f07('0x2a')](_0x5f014b);_0x1476e7['query']=_['keys'](_0x465a0b[_0x6f07('0x2b')]);_0x1476e7[_0x6f07('0x2c')]=_['intersection'](_0x1476e7['model'],_0x1476e7[_0x6f07('0x2b')]);_0x2faade[_0x6f07('0x2d')]=_[_0x6f07('0x2e')](_0x1476e7['model'],qs['fields'](_0x465a0b[_0x6f07('0x2b')][_0x6f07('0x2f')]));_0x2faade[_0x6f07('0x2d')]=_0x2faade[_0x6f07('0x2d')][_0x6f07('0x30')]?_0x2faade[_0x6f07('0x2d')]:_0x1476e7[_0x6f07('0x29')];if(!_0x465a0b[_0x6f07('0x2b')][_0x6f07('0x31')](_0x6f07('0x32'))){_0x2faade[_0x6f07('0x33')]=qs['limit'](_0x465a0b['query'][_0x6f07('0x33')]);_0x2faade[_0x6f07('0x1d')]=qs[_0x6f07('0x1d')](_0x465a0b[_0x6f07('0x2b')][_0x6f07('0x1d')]);}_0x2faade[_0x6f07('0x34')]=qs[_0x6f07('0x35')](_0x465a0b['query'][_0x6f07('0x35')]);_0x2faade[_0x6f07('0x36')]=qs[_0x6f07('0x2c')](_[_0x6f07('0x37')](_0x465a0b[_0x6f07('0x2b')],_0x1476e7[_0x6f07('0x2c')]));if(_0x465a0b[_0x6f07('0x2b')][_0x6f07('0x38')]){_0x2faade[_0x6f07('0x36')]=_[_0x6f07('0x39')](_0x2faade['where'],{'$or':_[_0x6f07('0x3a')](_0x5f014b,function(_0x28dbce){if(_0x28dbce[_0x6f07('0x3b')][_0x6f07('0x3c')]!=='VIRTUAL'){var _0x5eec5e={};_0x5eec5e[_0x28dbce[_0x6f07('0x3d')]]={'$like':'%'+_0x465a0b['query'][_0x6f07('0x38')]+'%'};return _0x5eec5e;}})});}_0x2faade=_[_0x6f07('0x39')]({},_0x2faade,_0x465a0b[_0x6f07('0x3e')]);var _0x416cfe={'where':_0x2faade[_0x6f07('0x36')]};return db[_0x6f07('0x3f')][_0x6f07('0x40')](_0x416cfe)[_0x6f07('0x23')](function(_0x7a20af){_0x55c253[_0x6f07('0x40')]=_0x7a20af;if(_0x465a0b[_0x6f07('0x2b')][_0x6f07('0x41')]){_0x2faade[_0x6f07('0x42')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x2faade);})[_0x6f07('0x23')](function(_0x3abfdd){_0x55c253[_0x6f07('0x43')]=_0x3abfdd;return _0x55c253;})[_0x6f07('0x23')](respondWithFilteredResult(_0x332eed,_0x2faade))['catch'](handleError(_0x332eed,null));};exports[_0x6f07('0x44')]=function(_0x4011f5,_0x49ee26){var _0x153bc1={'raw':![],'where':{'id':_0x4011f5[_0x6f07('0x45')]['id']}},_0x10d5e6={};_0x10d5e6['model']=_[_0x6f07('0x2a')](db['UserProfile']['rawAttributes']);_0x10d5e6[_0x6f07('0x2b')]=_[_0x6f07('0x2a')](_0x4011f5[_0x6f07('0x2b')]);_0x10d5e6[_0x6f07('0x2c')]=_[_0x6f07('0x2e')](_0x10d5e6[_0x6f07('0x29')],_0x10d5e6[_0x6f07('0x2b')]);_0x153bc1[_0x6f07('0x2d')]=_[_0x6f07('0x2e')](_0x10d5e6[_0x6f07('0x29')],qs['fields'](_0x4011f5[_0x6f07('0x2b')][_0x6f07('0x2f')]));_0x153bc1[_0x6f07('0x2d')]=_0x153bc1[_0x6f07('0x2d')][_0x6f07('0x30')]?_0x153bc1[_0x6f07('0x2d')]:_0x10d5e6[_0x6f07('0x29')];if(_0x4011f5[_0x6f07('0x2b')][_0x6f07('0x41')]){_0x153bc1[_0x6f07('0x42')]=[{'all':!![]}];}_0x153bc1=_[_0x6f07('0x39')]({},_0x153bc1,_0x4011f5[_0x6f07('0x3e')]);return db[_0x6f07('0x3f')][_0x6f07('0x46')](_0x153bc1)['then'](handleEntityNotFound(_0x49ee26,null))[_0x6f07('0x23')](respondWithResult(_0x49ee26,null))[_0x6f07('0x47')](handleError(_0x49ee26,null));};exports[_0x6f07('0x48')]=function(_0x14165c,_0x2ba6e3){return db[_0x6f07('0x3f')][_0x6f07('0x48')](_0x14165c['body'],{})[_0x6f07('0x23')](respondWithResult(_0x2ba6e3,0xc9))[_0x6f07('0x47')](handleError(_0x2ba6e3,null));};exports[_0x6f07('0x49')]=function(_0x2767c7,_0x3c1ae8){var _0x25628f={'raw':![],'where':{'id':_0x2767c7[_0x6f07('0x45')]['id']}},_0x567397={};_0x567397['model']=_[_0x6f07('0x2a')](db[_0x6f07('0x3f')][_0x6f07('0x28')]);_0x25628f['attributes']=_[_0x6f07('0x2e')](_0x567397['model'],qs[_0x6f07('0x2f')](_0x2767c7[_0x6f07('0x2b')]['fields']));_0x25628f['attributes']=_0x25628f[_0x6f07('0x2d')]['length']?_0x25628f[_0x6f07('0x2d')]:_0x567397['model'];if(_0x2767c7['query'][_0x6f07('0x41')]){_0x25628f[_0x6f07('0x42')]=[{'all':!![]}];}_0x25628f=_[_0x6f07('0x39')]({},_0x25628f,_0x2767c7[_0x6f07('0x3e')]);return db[_0x6f07('0x3f')][_0x6f07('0x46')](_0x25628f)[_0x6f07('0x23')](handleEntityNotFound(_0x3c1ae8,null))[_0x6f07('0x23')](function(_0x1f963b){if(_0x1f963b){var _0x1aa790=_0x1f963b[_0x6f07('0x4a')]({'plain':!![]});_0x1aa790=qs[_0x6f07('0x4b')](_0x1aa790,['id',_0x6f07('0x4c'),_0x6f07('0x4d'),_0x6f07('0x4e')]);_0x2767c7[_0x6f07('0x4f')]=_[_0x6f07('0x4b')](_0x2767c7['body'],['id',_0x6f07('0x4c'),_0x6f07('0x4d')]);return db[_0x6f07('0x50')][_0x6f07('0x51')](function(_0x46b020){return db[_0x6f07('0x3f')][_0x6f07('0x48')](_[_0x6f07('0x39')](_0x1aa790,_0x2767c7[_0x6f07('0x4f')]),{'include':_0x2767c7[_0x6f07('0x2b')][_0x6f07('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x46b020})[_0x6f07('0x23')](function(_0x27e6a9){var _0x816316=_0x27e6a9[_0x6f07('0x4a')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2767c7['params']['id']},'raw':!![]})[_0x6f07('0x23')](function(_0x118beb){if(_0x118beb){return BPromise[_0x6f07('0x52')](_0x118beb,function(_0x4a8e0c){return new BPromise(function(_0x32acf8,_0x2e68e1){if(_0x4a8e0c[_0x6f07('0x53')]===null||_0x4a8e0c[_0x6f07('0x53')]===0x1)_0x32acf8(null);return db['UserProfileResource'][_0x6f07('0x54')]({'where':{'sectionId':_0x4a8e0c['id']},'raw':!![]})[_0x6f07('0x23')](function(_0x1ff485){var _0x31aa46=_[_0x6f07('0x3a')](_0x1ff485,function(_0xa332d8){return qs['omit'](_0xa332d8,['id',_0x6f07('0x4c'),_0x6f07('0x4d'),_0x6f07('0x55')]);});_0x32acf8(_0x31aa46);})[_0x6f07('0x47')](function(_0x907c71){_0x2e68e1(_0x907c71);});})['then'](function(_0x2727ba){var _0x52b65c=qs[_0x6f07('0x4b')](_0x4a8e0c,['id',_0x6f07('0x4c'),'updatedAt']);_0x52b65c[_0x6f07('0x56')]=_0x816316['id'];if(_0x2727ba)_0x52b65c[_0x6f07('0x57')]=_0x2727ba;return _0x52b65c;})[_0x6f07('0x23')](function(_0x33591e){return db[_0x6f07('0x58')]['create'](_0x33591e,{'include':[{'model':db[_0x6f07('0x59')],'as':_0x6f07('0x57')}],'raw':!![],'transaction':_0x46b020});});})['then'](function(){return _0x816316;});}});});});}})[_0x6f07('0x23')](respondWithResult(_0x3c1ae8,0xc9))[_0x6f07('0x47')](handleError(_0x3c1ae8,null));};exports['update']=function(_0x47f4da,_0x15ea39){if(_0x47f4da[_0x6f07('0x4f')]['id']){delete _0x47f4da['body']['id'];}return db[_0x6f07('0x3f')][_0x6f07('0x46')]({'where':{'id':_0x47f4da['params']['id']}})[_0x6f07('0x23')](handleEntityNotFound(_0x15ea39,null))[_0x6f07('0x23')](saveUpdates(_0x47f4da[_0x6f07('0x4f')],null))[_0x6f07('0x23')](respondWithResult(_0x15ea39,null))[_0x6f07('0x47')](handleError(_0x15ea39,null));};exports[_0x6f07('0x5a')]=function(_0x2a5dde,_0x3015e6){return db[_0x6f07('0x3f')][_0x6f07('0x46')]({'where':{'id':_0x2a5dde[_0x6f07('0x45')]['id']}})[_0x6f07('0x23')](handleEntityNotFound(_0x3015e6,null))['then'](removeEntity(_0x3015e6,null))[_0x6f07('0x47')](handleError(_0x3015e6,null));};exports['describe']=function(_0x442ee9,_0x1afc12){return db[_0x6f07('0x3f')]['describe']()[_0x6f07('0x23')](respondWithResult(_0x1afc12,null))[_0x6f07('0x47')](handleError(_0x1afc12,null));};exports[_0x6f07('0x5b')]=function(_0x56cc7f,_0x16ba25){var _0x105be1=_0x56cc7f[_0x6f07('0x4f')];return db[_0x6f07('0x3f')][_0x6f07('0x46')]({'where':{'id':_0x56cc7f[_0x6f07('0x45')]['id']}})[_0x6f07('0x23')](handleEntityNotFound(_0x16ba25,null))[_0x6f07('0x23')](function(_0x3b661c){if(_0x3b661c){return db[_0x6f07('0x50')][_0x6f07('0x51')](function(_0x679cc5){return db['UserProfileSection'][_0x6f07('0x5a')]({'where':{'userProfileId':_0x56cc7f[_0x6f07('0x45')]['id'],'sectionId':_['map'](_0x105be1,function(_0x1e6000){return _0x1e6000['sectionId'];})},'transaction':_0x679cc5})[_0x6f07('0x23')](function(){var _0x25fad7=_[_0x6f07('0x3a')](_0x105be1,function(_0x1d587e){_0x1d587e[_0x6f07('0x56')]=_0x56cc7f[_0x6f07('0x45')]['id'];return _0x1d587e;});var _0x45b1bf=[];return BPromise[_0x6f07('0x52')](_0x25fad7,function(_0x1a7c05){return db['UserProfileSection'][_0x6f07('0x48')](_0x1a7c05,{'include':[{'model':db[_0x6f07('0x59')],'as':_0x6f07('0x57')}],'raw':!![],'transaction':_0x679cc5})[_0x6f07('0x23')](function(_0x27d9c2){_0x45b1bf['push'](_0x27d9c2[_0x6f07('0x4a')]({'plain':!![]}));});})[_0x6f07('0x23')](function(){return _0x45b1bf;});});});}})[_0x6f07('0x23')](function(_0x3cbcd5){return _0x3cbcd5;})[_0x6f07('0x23')](respondWithResult(_0x16ba25,null))['catch'](handleError(_0x16ba25,null));};exports[_0x6f07('0x5c')]=function(_0x49e87d,_0x255545){var _0x3d871e;return db[_0x6f07('0x3f')][_0x6f07('0x46')]({'where':{'id':_0x49e87d[_0x6f07('0x45')]['id']},'attributes':['id',_0x6f07('0x26')]})[_0x6f07('0x23')](handleEntityNotFound(_0x255545,null))['then'](function(_0x1eb96c){if(_0x1eb96c){_0x3d871e=_0x1eb96c;return db['UserProfileSection'][_0x6f07('0x5a')]({'where':{'userProfileId':_0x49e87d[_0x6f07('0x45')]['id'],'sectionId':_0x49e87d[_0x6f07('0x2b')][_0x6f07('0x5d')]}});}})[_0x6f07('0x23')](function(){return _0x3d871e;})['then'](respondWithStatusCode(_0x255545,null))['catch'](handleError(_0x255545,null));};exports[_0x6f07('0x5e')]=function(_0x1b3160,_0x3ce665){return db['UserProfile'][_0x6f07('0x46')]({'where':{'id':_0x1b3160[_0x6f07('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ce665,null))['then'](function(_0x5b0f4f){if(_0x5b0f4f){return db[_0x6f07('0x50')]['transaction'](function(_0x27fa36){return db[_0x6f07('0x58')][_0x6f07('0x54')]({'where':{'userProfileId':_0x1b3160[_0x6f07('0x45')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x3f1ad6){if(_0x3f1ad6){return db[_0x6f07('0x58')]['destroy']({'where':{'userProfileId':_0x1b3160[_0x6f07('0x45')]['id'],'id':_[_0x6f07('0x3a')](_0x3f1ad6,function(_0x48bfd4){return _0x48bfd4['id'];})},'transaction':_0x27fa36});}})['then'](function(_0x33b285){var _0x189fb6=_[_0x6f07('0x3a')](_0x1b3160['body'],function(_0x223733){_0x223733[_0x6f07('0x56')]=_0x1b3160['params']['id'];return _0x223733;});return db[_0x6f07('0x58')]['bulkCreate'](_0x189fb6,{'raw':!![],'transaction':_0x27fa36});})[_0x6f07('0x23')](function(_0x4d9585){var _0x5dfd7c=_[_0x6f07('0x38')](_[_0x6f07('0x3a')](_0x4d9585,function(_0x50eb5c){return _0x50eb5c['get']({'plain':!![]});}),{'includeAll':![]});if(_0x5dfd7c){return db[_0x6f07('0x58')][_0x6f07('0x54')]({'where':{'userProfileId':_0x1b3160[_0x6f07('0x45')]['id'],'sectionId':_['map'](_0x5dfd7c,function(_0x315161){return _0x315161[_0x6f07('0x55')];})},'attributes':['id',_0x6f07('0x55')],'raw':!![]})['then'](function(_0x21afd5){var _0x56e25d=_[_0x6f07('0x3a')](_0x1b3160[_0x6f07('0x4f')],function(_0x3bcf1f){_0x3bcf1f['userProfileId']=_0x1b3160[_0x6f07('0x45')]['id'];return _0x3bcf1f;});return db[_0x6f07('0x59')][_0x6f07('0x5f')](_0x56e25d,{'raw':!![],'transaction':_0x27fa36});});}})[_0x6f07('0x47')](handleError(_0x3ce665,null));});}})[_0x6f07('0x23')](function(_0x57251d){var _0x4185f4=_[_0x6f07('0x3a')](_0x57251d,function(_0xe6a837){return _0xe6a837[_0x6f07('0x4a')]({'plain':!![]});});})[_0x6f07('0x23')](respondWithResult(_0x3ce665,null))[_0x6f07('0x47')](handleError(_0x3ce665,null));};exports[_0x6f07('0x60')]=function(_0x304fd3,_0x2bbee6,_0x29405c){return db[_0x6f07('0x3f')][_0x6f07('0x46')]({'where':{'id':_0x304fd3[_0x6f07('0x45')]['id']}})[_0x6f07('0x23')](handleEntityNotFound(_0x2bbee6,null))[_0x6f07('0x23')](function(_0x379335){if(_0x379335){return _0x379335['removeResources'](_0x304fd3[_0x6f07('0x2b')][_0x6f07('0x5d')]);}})['then'](respondWithStatusCode(_0x2bbee6,null))[_0x6f07('0x47')](handleError(_0x2bbee6,null));};exports[_0x6f07('0x61')]=function(_0x3237f0,_0x2c4d42){var _0x3b7d6={'raw':![],'where':{}};var _0x23cdcb={};var _0x3e8380={'count':0x0,'rows':[]};var _0x11f776=_0x3237f0[_0x6f07('0x2b')][_0x6f07('0x62')];if(typeof _0x11f776===_0x6f07('0x63')){throw new db[(_0x6f07('0x64'))][(_0x6f07('0x65'))](_0x6f07('0x66'));}var _0x3fd362=_0x3237f0[_0x6f07('0x2b')][_0x6f07('0x67')]||![];var _0x4d0fcd=getQueryModels(_0x11f776,_0x3fd362);if(typeof _0x4d0fcd['childModel']==='undefined'){throw new db[(_0x6f07('0x64'))][(_0x6f07('0x65'))](_0x6f07('0x68')+_0x11f776+'\x27');}var _0x1caaa1=[];if(!_[_0x6f07('0x69')](_0x4d0fcd[_0x6f07('0x6a')])){_0x1caaa1=_0x4d0fcd['parentSections'];}else{_0x1caaa1=[{'name':_0x11f776}];}return db[_0x6f07('0x3f')][_0x6f07('0x6b')]({'where':{'id':_0x3237f0[_0x6f07('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c4d42,null))[_0x6f07('0x23')](function(_0x4c7930){if(_0x4c7930){var _0x1c51b5=[];for(var _0x6b79bb=0x0;_0x6b79bb<_0x1caaa1[_0x6f07('0x30')];_0x6b79bb++){_0x1c51b5[_0x6f07('0x6c')](db[_0x6f07('0x58')][_0x6f07('0x6b')]({'where':{'userProfileId':_0x4c7930['id'],'name':_0x1caaa1[_0x6b79bb][_0x6f07('0x26')]},'raw':!![]}));}return BPromise['all'](_0x1c51b5);}})['then'](function(_0x11b212){var _0x57e9ee=_['filter'](_0x11b212,function(_0x586515){return _0x586515?_0x586515:undefined;});var _0x2ee095=_[_0x6f07('0x38')](_0x1caaa1,[_0x6f07('0x6d'),!![]]);var _0x4ba929=_[_0x6f07('0x69')](_0x57e9ee)&&_[_0x6f07('0x69')](_0x2ee095)?null:_[_0x6f07('0x6e')](_0x2ee095,_0x57e9ee);if(_0x4ba929){var _0x11464e=[];for(var _0xc8e4ed=0x0;_0xc8e4ed<_0x4ba929['length'];_0xc8e4ed++){var _0x2700dc=_[_0x6f07('0x46')](_0x1caaa1,function(_0x1ec611){return _0x4ba929[_0xc8e4ed]?_0x1ec611[_0x6f07('0x26')]===_0x4ba929[_0xc8e4ed][_0x6f07('0x26')]:null;});if(_0x2700dc){if(_0x4ba929[_0xc8e4ed]['ignore']){_0x11464e['push'](getAllResources(_0x4d0fcd[_0x6f07('0x6f')],_0x4ba929[_0xc8e4ed]));}else{if(!_0x4ba929[_0xc8e4ed]['autoAssociation']){_0x11464e[_0x6f07('0x6c')](getAllowedResources(_0x2700dc,_0x4ba929[_0xc8e4ed],_0x4d0fcd['childModel']));}else{if(_0x2700dc[_0x6f07('0x29')]){_0x11464e[_0x6f07('0x6c')](getAllFilteredResources(_0x2700dc,_0x4ba929[_0xc8e4ed]));}}}}}return BPromise[_0x6f07('0x70')](_0x11464e);}else{return null;}})['then'](function(_0x10072d){var _0x279ad8=_0x10072d;var _0x18867b=null;if(_0x279ad8){_0x18867b=_0x279ad8[_0x6f07('0x30')]===0x1?_0x279ad8[0x0]:null;}if(_0x18867b||_0x279ad8){var _0x3146b4=db[_0x4d0fcd[_0x6f07('0x6f')]][_0x6f07('0x28')];_0x23cdcb['model']=_[_0x6f07('0x2a')](_0x3146b4);_0x23cdcb[_0x6f07('0x2b')]=_[_0x6f07('0x2a')](_0x3237f0[_0x6f07('0x2b')]);_0x23cdcb[_0x6f07('0x2c')]=_[_0x6f07('0x2e')](_0x23cdcb[_0x6f07('0x29')],_0x23cdcb[_0x6f07('0x2b')]);_0x3b7d6['attributes']=_[_0x6f07('0x2e')](_0x23cdcb[_0x6f07('0x29')],qs['fields'](_0x3237f0['query'][_0x6f07('0x2f')]));_0x3b7d6[_0x6f07('0x2d')]=_0x3b7d6[_0x6f07('0x2d')]['length']?_0x3b7d6[_0x6f07('0x2d')]:_0x23cdcb[_0x6f07('0x29')];if(!_0x3237f0[_0x6f07('0x2b')][_0x6f07('0x31')](_0x6f07('0x32'))){_0x3b7d6[_0x6f07('0x33')]=qs[_0x6f07('0x33')](_0x3237f0['query']['limit']);_0x3b7d6[_0x6f07('0x1d')]=qs[_0x6f07('0x1d')](_0x3237f0[_0x6f07('0x2b')][_0x6f07('0x1d')]);}_0x3b7d6[_0x6f07('0x34')]=qs['sort'](_0x3237f0[_0x6f07('0x2b')][_0x6f07('0x35')]);_0x3b7d6[_0x6f07('0x36')]=qs[_0x6f07('0x2c')](_[_0x6f07('0x37')](_0x3237f0[_0x6f07('0x2b')],_0x23cdcb[_0x6f07('0x2c')]));if(_0x3237f0[_0x6f07('0x2b')]['filter']){_0x3b7d6[_0x6f07('0x36')]=_[_0x6f07('0x39')](_0x3b7d6['where'],{'$or':_[_0x6f07('0x3a')](_0x3146b4,function(_0x1bf651){if(_0x1bf651['type'][_0x6f07('0x3c')]!==_0x6f07('0x71')){var _0x4f576a={};_0x4f576a[_0x1bf651[_0x6f07('0x3d')]]={'$like':'%'+_0x3237f0[_0x6f07('0x2b')][_0x6f07('0x38')]+'%'};return _0x4f576a;}})});}var _0xd16058=[];if(_0x18867b){var _0x5446c4=_[_0x6f07('0x46')](_0x1caaa1,[_0x6f07('0x26'),_0x18867b['name']]);if(_0x5446c4[_0x6f07('0x3d')]){var _0x892a28={};if(_0x4d0fcd[_0x6f07('0x6f')]===_0x6f07('0x72')){_0x892a28[_0x5446c4['foreignKey']]=_[_0x6f07('0x3a')](_0x18867b[_0x6f07('0x73')],'id');}else{_0x892a28[_0x5446c4[_0x6f07('0x74')]]=_0x18867b[_0x6f07('0x73')];}_0xd16058[_0x6f07('0x6c')](_0x892a28);}else{_0x3b7d6['where']['id']=_0x18867b[_0x6f07('0x73')];}}else{for(var _0x351cef=0x0;_0x351cef<_0x279ad8['length'];_0x351cef++){var _0x5446c4=_['find'](_0x1caaa1,[_0x6f07('0x26'),_0x279ad8[_0x351cef]['name']]);if(_0x5446c4[_0x6f07('0x3d')]){var _0x892a28={};_0x892a28[_0x5446c4[_0x6f07('0x74')]]=_0x279ad8[_0x351cef][_0x6f07('0x73')];_0xd16058[_0x6f07('0x6c')](_0x892a28);}else{if(!_0x3b7d6[_0x6f07('0x36')]['id'])_0x3b7d6['where']['id']=[];_0x279ad8[_0x351cef]['associatedResources']['forEach'](function(_0x2aa347){_0x3b7d6['where']['id'][_0x6f07('0x6c')](_0x2aa347);});}}}if(!_[_0x6f07('0x69')](_0xd16058)){_0x3b7d6[_0x6f07('0x36')]=_[_0x6f07('0x39')](_0x3b7d6['where'],{'$and':{'$or':_0xd16058}});}_0x3b7d6=_[_0x6f07('0x39')]({},_0x3b7d6,_0x3237f0[_0x6f07('0x3e')]);if(_0x18867b&&!_0x18867b[_0x6f07('0x53')]&&_0x4d0fcd[_0x6f07('0x6f')]==='AnalyticExtractedReport'){if(_0x3237f0[_0x6f07('0x2b')]['includeAll']){_0x3b7d6['include']=[{'all':!![]}];}return db[_0x4d0fcd['childModel']][_0x6f07('0x54')](_0x3b7d6)['then'](function(_0x5832f0){var _0x3df232=[];_0x5832f0[_0x6f07('0x75')](function(_0x38edcb){var _0x8b86ce;switch(_0x38edcb[_0x6f07('0x76')]){case _0x6f07('0x77'):_0x8b86ce=_[_0x6f07('0x46')](_0x18867b[_0x6f07('0x73')],function(_0x4ca12c){return _0x4ca12c['id']===_0x38edcb[_0x6f07('0x78')]&&_0x4ca12c[_0x6f07('0x3b')]===_0x6f07('0x79');});break;case _0x6f07('0x7a'):_0x8b86ce=_['find'](_0x18867b['associatedResources'],function(_0x2513e8){return _0x2513e8['id']===_0x38edcb[_0x6f07('0x78')]&&_0x2513e8[_0x6f07('0x3b')]===_0x6f07('0x7b');});break;}if(_0x8b86ce)_0x3df232['push'](_0x38edcb);});_0x3e8380['count']=_0x3df232[_0x6f07('0x30')];_0x3e8380[_0x6f07('0x43')]=_0x3df232;return _0x3e8380;});}else{return db[_0x4d0fcd[_0x6f07('0x6f')]][_0x6f07('0x40')]({'where':_0x3b7d6[_0x6f07('0x36')]})[_0x6f07('0x23')](function(_0x4d5a60){_0x3e8380[_0x6f07('0x40')]=_0x4d5a60;if(_0x3237f0[_0x6f07('0x2b')][_0x6f07('0x41')]){if(_0x4d0fcd['childModel']===_0x6f07('0x7c')){_0x3b7d6[_0x6f07('0x42')]=[{'model':db[_0x6f07('0x7d')],'as':_0x6f07('0x7e'),'attributes':['id','name',_0x6f07('0x7f')],'required':_0x3237f0[_0x6f07('0x2b')]['tag']?!![]:![]},{'model':db[_0x6f07('0x7d')],'as':_0x6f07('0x80'),'attributes':['id',_0x6f07('0x26'),_0x6f07('0x7f')],'through':_0x3237f0[_0x6f07('0x2b')][_0x6f07('0x81')]?{'attributes':[],'where':{'TagId':_0x3237f0[_0x6f07('0x2b')][_0x6f07('0x81')]||undefined}}:{},'required':_0x3237f0[_0x6f07('0x2b')][_0x6f07('0x81')]?!![]:![]}];}else{_0x3b7d6[_0x6f07('0x42')]=[{'all':!![]}];}}return db[_0x4d0fcd[_0x6f07('0x6f')]][_0x6f07('0x54')](_0x3b7d6);})['then'](function(_0x43dc28){_0x3e8380[_0x6f07('0x43')]=_0x43dc28;return _0x3e8380;});}}else{return _0x3e8380;}})[_0x6f07('0x23')](respondWithFilteredResult(_0x2c4d42,_0x3b7d6))[_0x6f07('0x47')](handleError(_0x2c4d42,null));};function getAllResources(_0x10f373,_0x4715c7){return new BPromise(function(_0x39880e,_0x2f5743){if(_0x4715c7){var _0x2e747e=_0x4715c7[_0x6f07('0x38')]?{[_0x4715c7['filter'][_0x6f07('0x3d')]]:_0x4715c7[_0x6f07('0x38')][_0x6f07('0x82')]}:undefined;return db[_0x10f373][_0x6f07('0x54')]({'where':_0x2e747e,'raw':!![]})[_0x6f07('0x23')](function(_0x23b23a){_0x4715c7[_0x6f07('0x73')]=_[_0x6f07('0x3a')](_0x23b23a,'id');_0x39880e(_0x4715c7);})[_0x6f07('0x47')](function(_0x331f91){_0x2f5743(_0x331f91);});}else{_0x39880e(null);}});}function getAllFilteredResources(_0x2ae0a3,_0x3ae6c5){return new BPromise(function(_0x1a40f1,_0x704ffa){var _0x5937c1=_0x2ae0a3['filter']?{[_0x2ae0a3[_0x6f07('0x38')]['field']]:_0x2ae0a3[_0x6f07('0x38')][_0x6f07('0x82')]}:undefined;return db[_0x2ae0a3[_0x6f07('0x29')]][_0x6f07('0x54')]({'where':_0x5937c1,'raw':!![]})[_0x6f07('0x23')](function(_0x100f19){_0x3ae6c5['associatedResources']=_[_0x6f07('0x3a')](_0x100f19,function(_0x190c51){return _0x190c51['name'];});_0x1a40f1(_0x3ae6c5);})[_0x6f07('0x47')](function(_0x17299e){_0x704ffa(_0x17299e);});});}function getAllowedResources(_0x5a9735,_0xc28ad5,_0x2908f5){return new BPromise(function(_0x2ecfba,_0x30af30){if(_0xc28ad5){return db[_0x6f07('0x59')][_0x6f07('0x54')]({'where':{'sectionId':_0xc28ad5['id']},'raw':!![]})[_0x6f07('0x23')](function(_0x4290fc){if(_0x5a9735[_0x6f07('0x3d')]&&_0x5a9735['field']!=='id'){_0xc28ad5[_0x6f07('0x73')]=_[_0x6f07('0x3a')](_0x4290fc,function(_0x16c13c){return _0x16c13c[_0x5a9735[_0x6f07('0x3d')]];});}else{if(_0x2908f5===_0x6f07('0x72')){_0xc28ad5[_0x6f07('0x73')]=_[_0x6f07('0x3a')](_0x4290fc,function(_0x298126){return{'id':_0x298126[_0x6f07('0x83')],'type':_0x298126['type']};});}else{_0xc28ad5[_0x6f07('0x73')]=_['map'](_0x4290fc,function(_0x1bdd5b){return _0x1bdd5b['resourceId'];});}}_0x2ecfba(_0xc28ad5);})[_0x6f07('0x47')](function(_0xdcca80){_0x30af30(_0xdcca80);});}else{_0x2ecfba(null);}});}function getQueryModels(_0x50ab96,_0x479752){var _0x2408c4=_0x50ab96[_0x6f07('0x84')]();var _0x229393={'childModel':undefined,'parentSections':[]};switch(_0x2408c4){case _0x6f07('0x85'):_0x229393['childModel']=_0x6f07('0x86');break;case _0x6f07('0x87'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0x88');break;case'squarerecordings':_0x229393[_0x6f07('0x6f')]='SquareRecording';_0x229393[_0x6f07('0x6a')]=[{'name':'SquareProjects','field':_0x6f07('0x26'),'foreignKey':_0x6f07('0x89')}];break;case _0x6f07('0x8a'):_0x229393[_0x6f07('0x6f')]='JscriptyProject';break;case _0x6f07('0x8b'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0x7c');_0x229393[_0x6f07('0x6a')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x6f07('0x8c'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0x8d');break;case _0x6f07('0x8e'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0x8f');break;case'globalcustomfields':_0x229393['childModel']=_0x6f07('0x90');break;case'chatqueues':_0x229393[_0x6f07('0x6f')]=_0x6f07('0x91');break;case _0x6f07('0x92'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0x93');break;case _0x6f07('0x94'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0x95');break;case _0x6f07('0x96'):_0x229393['childModel']=_0x6f07('0x97');break;case _0x6f07('0x98'):case _0x6f07('0x99'):case _0x6f07('0x9a'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0x9b');break;case _0x6f07('0x9c'):_0x229393['childModel']=_0x6f07('0x9d');break;case'voicemails':_0x229393[_0x6f07('0x6f')]=_0x6f07('0x9e');break;case'voicerecordings':_0x229393[_0x6f07('0x6f')]=_0x6f07('0x9f');_0x229393['parentSections']=[{'name':_0x6f07('0xa0'),'field':_0x6f07('0x26'),'foreignKey':_0x6f07('0xa1'),'model':_0x6f07('0xa2'),'filter':{'field':'role','value':[_0x6f07('0xa3')]}},{'name':_0x6f07('0xa4'),'field':'name','foreignKey':_0x6f07('0xa1'),'model':_0x6f07('0xa2'),'filter':{'field':_0x6f07('0xa5'),'value':[_0x6f07('0xa6')]}},{'name':_0x6f07('0xa7'),'field':_0x6f07('0x26'),'foreignKey':'queue','model':_0x6f07('0xa8'),'filter':{'field':_0x6f07('0x3b'),'value':[_0x6f07('0xa9')]}},{'name':_0x6f07('0xaa'),'field':'name','foreignKey':_0x6f07('0xab'),'model':_0x6f07('0xa8'),'filter':{'field':_0x6f07('0x3b'),'value':[_0x6f07('0xac')]}}];break;case'musiconholds':_0x229393[_0x6f07('0x6f')]=_0x6f07('0xad');break;case'chanspies':_0x229393[_0x6f07('0x6f')]='VoiceChanSpy';break;case _0x6f07('0xae'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0xaf');break;case _0x6f07('0xb0'):_0x229393[_0x6f07('0x6f')]='Campaign';break;case'mailqueues':_0x229393[_0x6f07('0x6f')]=_0x6f07('0xb1');break;case'mailaccounts':_0x229393[_0x6f07('0x6f')]=_0x6f07('0xb2');break;case _0x6f07('0xb3'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0xb4');break;case'openchannelqueues':_0x229393[_0x6f07('0x6f')]=_0x6f07('0xb5');break;case _0x6f07('0xb6'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0xb7');break;case _0x6f07('0xb8'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0xb9');break;case _0x6f07('0xba'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0xbb');break;case _0x6f07('0xbc'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0xbd');break;case'voicequeues':case _0x6f07('0xbe'):_0x229393[_0x6f07('0x6f')]='VoiceQueue';if(_0x479752){_0x229393['parentSections']=[{'name':'VoiceQueues'},{'name':_0x6f07('0xaa')}];}break;case _0x6f07('0xbf'):case _0x6f07('0xc0'):case _0x6f07('0xc1'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0xa2');if(_0x479752){_0x229393['parentSections']=[{'name':_0x6f07('0xc2'),'filter':{'field':_0x6f07('0xa5'),'value':[_0x6f07('0xc3'),_0x6f07('0xc4')]},'ignore':!![]},{'name':_0x6f07('0xa0')},{'name':_0x6f07('0xa4')}];}break;case _0x6f07('0xc5'):_0x229393[_0x6f07('0x6f')]='ZendeskAccount';break;case _0x6f07('0xc6'):_0x229393[_0x6f07('0x6f')]='SalesforceAccount';break;case _0x6f07('0xc7'):_0x229393[_0x6f07('0x6f')]='FreshdeskAccount';break;case _0x6f07('0xc8'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0xc9');break;case'deskaccounts':_0x229393[_0x6f07('0x6f')]=_0x6f07('0xca');break;case _0x6f07('0xcb'):_0x229393['childModel']=_0x6f07('0xcc');break;case'vtigeraccounts':_0x229393[_0x6f07('0x6f')]='User';break;case'cannedanswers':_0x229393['childModel']=_0x6f07('0xcd');break;case _0x6f07('0xce'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0xcf');break;case _0x6f07('0xd0'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0xd1');break;case _0x6f07('0xd2'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0xd3');break;case'pauses':_0x229393[_0x6f07('0x6f')]=_0x6f07('0xd4');break;case'scheduler':_0x229393[_0x6f07('0x6f')]=_0x6f07('0xd5');break;case _0x6f07('0xd6'):_0x229393[_0x6f07('0x6f')]='Sound';break;case _0x6f07('0xd7'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0x7d');break;case _0x6f07('0xd8'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0xd9');break;case _0x6f07('0xda'):_0x229393[_0x6f07('0x6f')]='Trigger';break;case'trunks':_0x229393[_0x6f07('0x6f')]=_0x6f07('0xdb');break;case _0x6f07('0xdc'):_0x229393[_0x6f07('0x6f')]='Variable';break;case _0x6f07('0xdd'):_0x229393[_0x6f07('0x6f')]='Plugin';break;case'extractedreports':_0x229393[_0x6f07('0x6f')]=_0x6f07('0x72');_0x229393[_0x6f07('0x6a')]=[{'name':_0x6f07('0xde'),'field':'id','foreignKey':_0x6f07('0x78')}];break;case _0x6f07('0xdf'):_0x229393[_0x6f07('0x6f')]=_0x6f07('0xe0');break;default:return _0x229393;}return _0x229393;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 955c45a..fa5b79e 100644 --- a/server/api/userProfile/userProfile.events.js +++ b/server/api/userProfile/userProfile.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc23b=['exports','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc23b,0x1cc));var _0xbc23=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0xc23b[_0x516ffb];return _0x319667;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xbc23('0x0'))['db'][_0xbc23('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xbc23('0x2')](0x0);var events={'afterCreate':_0xbc23('0x3'),'afterUpdate':_0xbc23('0x4'),'afterDestroy':_0xbc23('0x5')};function emitEvent(_0x3b29ac){return function(_0x181a4f,_0x163e4f,_0x4fe104){UserProfileEvents[_0xbc23('0x6')](_0x3b29ac+':'+_0x181a4f['id'],_0x181a4f);UserProfileEvents[_0xbc23('0x6')](_0x3b29ac,_0x181a4f);_0x4fe104(null);};}for(var e in events){if(events[_0xbc23('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xbc23('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x0f7a=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0f7a,0x1d4));var _0xa0f7=function(_0x24a1b2,_0x51c479){_0x24a1b2=_0x24a1b2-0x0;var _0x435832=_0x0f7a[_0x24a1b2];return _0x435832;};'use strict';var EventEmitter=require(_0xa0f7('0x0'));var UserProfile=require(_0xa0f7('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa0f7('0x2')](0x0);var events={'afterCreate':_0xa0f7('0x3'),'afterUpdate':_0xa0f7('0x4'),'afterDestroy':_0xa0f7('0x5')};function emitEvent(_0x2cb5eb){return function(_0x36573c,_0x459da5,_0x571be4){UserProfileEvents[_0xa0f7('0x6')](_0x2cb5eb+':'+_0x36573c['id'],_0x36573c);UserProfileEvents[_0xa0f7('0x6')](_0x2cb5eb,_0x36573c);_0x571be4(null);};}for(var e in events){if(events[_0xa0f7('0x7')](e)){var event=events[e];UserProfile[_0xa0f7('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 2486fcb..8f87950 100644 --- a/server/api/userProfile/userProfile.model.js +++ b/server/api/userProfile/userProfile.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x968e=['moment','bluebird','path','./userProfile.attributes','define','UserProfile','user_profiles','util','../../config/logger','api'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x968e,0x75));var _0xe968=function(_0x1e3c2f,_0x53b8d1){_0x1e3c2f=_0x1e3c2f-0x0;var _0x40ac24=_0x968e[_0x1e3c2f];return _0x40ac24;};'use strict';var _=require('lodash');var util=require(_0xe968('0x0'));var logger=require(_0xe968('0x1'))(_0xe968('0x2'));var moment=require(_0xe968('0x3'));var BPromise=require(_0xe968('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe968('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe968('0x6'));module['exports']=function(_0xe6bee8,_0x20f946){return _0xe6bee8[_0xe968('0x7')](_0xe968('0x8'),attributes,{'tableName':_0xe968('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00e0=['util','../../config/logger','api','bluebird','path','rimraf','./userProfile.attributes','define','UserProfile','lodash'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x00e0,0xef));var _0x000e=function(_0x1136be,_0x504440){_0x1136be=_0x1136be-0x0;var _0x3b3013=_0x00e0[_0x1136be];return _0x3b3013;};'use strict';var _=require(_0x000e('0x0'));var util=require(_0x000e('0x1'));var logger=require(_0x000e('0x2'))(_0x000e('0x3'));var moment=require('moment');var BPromise=require(_0x000e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x000e('0x5'));var rimraf=require(_0x000e('0x6'));var config=require('../../config/environment');var attributes=require(_0x000e('0x7'));module['exports']=function(_0x4ddc91,_0x42333d){return _0x4ddc91[_0x000e('0x8')](_0x000e('0x9'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 377f9aa..3bcfb5d 100644 --- a/server/api/userProfile/userProfile.rpc.js +++ b/server/api/userProfile/userProfile.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','then','UserProfile,\x20%s,\x20%s','request\x20sent'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('UserProfile,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});} \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0x2bfe52,_0x43946e){var _0x1cf649=function(_0xc8300c){while(--_0xc8300c){_0x2bfe52['push'](_0x2bfe52['shift']());}};_0x1cf649(++_0x43946e);}(_0xe14b,0x93));var _0xbe14=function(_0x126cd2,_0x2426f2){_0x126cd2=_0x126cd2-0x0;var _0x100d79=_0xe14b[_0x126cd2];return _0x100d79;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});config[_0xbe14('0x9')]=_[_0xbe14('0xa')](config[_0xbe14('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbe14('0xb'))[_0xbe14('0xc')](socket);function respondWithRpcPromise(_0xd68cd7,_0x90b4f,_0x53c7ea){return new BPromise(function(_0x5b9fc6,_0x113243){return client[_0xbe14('0xd')](_0xd68cd7,_0x53c7ea)['then'](function(_0x254c3b){logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));logger[_0xbe14('0x11')](_0xbe14('0x12'),_0x90b4f,_0xbe14('0x10'),JSON[_0xbe14('0x13')](_0x254c3b));if(_0x254c3b[_0xbe14('0x14')]){if(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x15')]===0x1f4){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error']['message']);return _0x113243(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error'][_0xbe14('0x16')]);return _0x5b9fc6(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}else{logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));_0x5b9fc6(_0x254c3b[_0xbe14('0x17')]['message']);}})[_0xbe14('0x18')](function(_0x456ca8){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x456ca8);_0x113243(_0x456ca8);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 1651d68..328c42e 100644 --- a/server/api/userProfile/userProfile.socket.js +++ b/server/api/userProfile/userProfile.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdfce=['removeListener','userProfile:','./userProfile.events','remove','emit'];(function(_0x4758ca,_0x21bf50){var _0x2b3154=function(_0x296722){while(--_0x296722){_0x4758ca['push'](_0x4758ca['shift']());}};_0x2b3154(++_0x21bf50);}(_0xdfce,0xac));var _0xedfc=function(_0x2454be,_0x61e546){_0x2454be=_0x2454be-0x0;var _0x4e0ace=_0xdfce[_0x2454be];return _0x4e0ace;};'use strict';var UserProfileEvents=require(_0xedfc('0x0'));var events=['save',_0xedfc('0x1'),'update'];function createListener(_0x1ffa6d,_0x418b91){return function(_0x2cbce3){_0x418b91[_0xedfc('0x2')](_0x1ffa6d,_0x2cbce3);};}function removeListener(_0x5574f4,_0x5e37d8){return function(){UserProfileEvents[_0xedfc('0x3')](_0x5574f4,_0x5e37d8);};}exports['register']=function(_0x4805f9){for(var _0x11cd56=0x0,_0x4b4694=events['length'];_0x11cd56<_0x4b4694;_0x11cd56++){var _0x6405fc=events[_0x11cd56];var _0x39b3d7=createListener(_0xedfc('0x4')+_0x6405fc,_0x4805f9);UserProfileEvents['on'](_0x6405fc,_0x39b3d7);}}; \ No newline at end of file +var _0x2bb9=['removeListener','register','userProfile:','save','remove','update','emit'];(function(_0x4727f1,_0x33a032){var _0x54d860=function(_0x2283e8){while(--_0x2283e8){_0x4727f1['push'](_0x4727f1['shift']());}};_0x54d860(++_0x33a032);}(_0x2bb9,0x7a));var _0x92bb=function(_0x1c1f05,_0x1cbeeb){_0x1c1f05=_0x1c1f05-0x0;var _0x3d68d4=_0x2bb9[_0x1c1f05];return _0x3d68d4;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x92bb('0x0'),_0x92bb('0x1'),_0x92bb('0x2')];function createListener(_0xc259b3,_0x4684dd){return function(_0xbeaf17){_0x4684dd[_0x92bb('0x3')](_0xc259b3,_0xbeaf17);};}function removeListener(_0x18b1b3,_0x3e81d5){return function(){UserProfileEvents[_0x92bb('0x4')](_0x18b1b3,_0x3e81d5);};}exports[_0x92bb('0x5')]=function(_0x516120){for(var _0x370529=0x0,_0x58a896=events['length'];_0x370529<_0x58a896;_0x370529++){var _0x5c5bce=events[_0x370529];var _0x196d33=createListener(_0x92bb('0x6')+_0x5c5bce,_0x516120);UserProfileEvents['on'](_0x5c5bce,_0x196d33);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index a924168..dfed461 100644 --- a/server/api/userProfileResource/index.js +++ b/server/api/userProfileResource/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc9b=['post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./userProfileResource.controller','isAuthenticated','index','/describe','describe','get','/:id','show'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdc9b,0x70));var _0xbdc9=function(_0x16382a,_0x5b3f87){_0x16382a=_0x16382a-0x0;var _0x3b4b5a=_0xdc9b[_0x16382a];return _0x3b4b5a;};'use strict';var multer=require(_0xbdc9('0x0'));var util=require(_0xbdc9('0x1'));var path=require(_0xbdc9('0x2'));var timeout=require('connect-timeout');var express=require(_0xbdc9('0x3'));var router=express[_0xbdc9('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbdc9('0x5'));var controller=require(_0xbdc9('0x6'));router['get']('/',auth[_0xbdc9('0x7')](),controller[_0xbdc9('0x8')]);router['get'](_0xbdc9('0x9'),auth['isAuthenticated'](),controller[_0xbdc9('0xa')]);router[_0xbdc9('0xb')](_0xbdc9('0xc'),auth[_0xbdc9('0x7')](),controller[_0xbdc9('0xd')]);router[_0xbdc9('0xe')]('/',auth[_0xbdc9('0x7')](),controller[_0xbdc9('0xf')]);router[_0xbdc9('0x10')](_0xbdc9('0xc'),auth[_0xbdc9('0x7')](),controller[_0xbdc9('0x11')]);router[_0xbdc9('0x12')](_0xbdc9('0xc'),auth[_0xbdc9('0x7')](),controller[_0xbdc9('0x13')]);module[_0xbdc9('0x14')]=router; \ No newline at end of file +var _0xe35c=['../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xe35c,0xd5));var _0xce35=function(_0x535dee,_0x2d90f9){_0x535dee=_0x535dee-0x0;var _0x5e6f24=_0xe35c[_0x535dee];return _0x5e6f24;};'use strict';var multer=require(_0xce35('0x0'));var util=require(_0xce35('0x1'));var path=require(_0xce35('0x2'));var timeout=require(_0xce35('0x3'));var express=require(_0xce35('0x4'));var router=express[_0xce35('0x5')]();var auth=require(_0xce35('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xce35('0x7'));var controller=require(_0xce35('0x8'));router[_0xce35('0x9')]('/',auth[_0xce35('0xa')](),controller[_0xce35('0xb')]);router[_0xce35('0x9')](_0xce35('0xc'),auth[_0xce35('0xa')](),controller[_0xce35('0xd')]);router[_0xce35('0x9')](_0xce35('0xe'),auth[_0xce35('0xa')](),controller[_0xce35('0xf')]);router[_0xce35('0x10')]('/',auth[_0xce35('0xa')](),controller[_0xce35('0x11')]);router[_0xce35('0x12')](_0xce35('0xe'),auth[_0xce35('0xa')](),controller[_0xce35('0x13')]);router['delete'](_0xce35('0xe'),auth[_0xce35('0xa')](),controller[_0xce35('0x14')]);module[_0xce35('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index cd3bacb..df990dc 100644 --- a/server/api/userProfileResource/userProfileResource.attributes.js +++ b/server/api/userProfileResource/userProfileResource.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd72=['STRING','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcd72,0x1d1));var _0x2cd7=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xcd72[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module[_0x2cd7('0x0')]={'name':{'type':Sequelize[_0x2cd7('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x2cd7('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4ff6=['INTEGER','exports'];(function(_0x9db63,_0x1e15ab){var _0x54073a=function(_0x4bdf8d){while(--_0x4bdf8d){_0x9db63['push'](_0x9db63['shift']());}};_0x54073a(++_0x1e15ab);}(_0x4ff6,0xb9));var _0x64ff=function(_0xa04df8,_0x37575c){_0xa04df8=_0xa04df8-0x0;var _0x54d914=_0x4ff6[_0xa04df8];return _0x54d914;};'use strict';var Sequelize=require('sequelize');module[_0x64ff('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x64ff('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 30fec57..240d50b 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc978=['set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','UserProfileResource','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','status'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x8c97('0x0'));var emlformat=require(_0x8c97('0x1'));var rimraf=require(_0x8c97('0x2'));var zipdir=require(_0x8c97('0x3'));var jsonpatch=require(_0x8c97('0x4'));var rp=require(_0x8c97('0x5'));var moment=require('moment');var BPromise=require(_0x8c97('0x6'));var Mustache=require(_0x8c97('0x7'));var util=require(_0x8c97('0x8'));var path=require(_0x8c97('0x9'));var sox=require(_0x8c97('0xa'));var csv=require(_0x8c97('0xb'));var ejs=require(_0x8c97('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8c97('0xd'));var crypto=require(_0x8c97('0xe'));var jsforce=require(_0x8c97('0xf'));var deskjs=require(_0x8c97('0x10'));var toCsv=require(_0x8c97('0xb'));var querystring=require(_0x8c97('0x11'));var Papa=require(_0x8c97('0x12'));var Redis=require('ioredis');var authService=require(_0x8c97('0x13'));var qs=require(_0x8c97('0x14'));var hardwareService=require(_0x8c97('0x15'));var logger=require(_0x8c97('0x16'))(_0x8c97('0x17'));var utils=require(_0x8c97('0x18'));var config=require(_0x8c97('0x19'));var db=require(_0x8c97('0x1a'))['db'];function respondWithStatusCode(_0x36a84b,_0x5cf392){_0x5cf392=_0x5cf392||0xcc;return function(_0x44611a){if(_0x44611a){return _0x36a84b[_0x8c97('0x1b')](_0x5cf392);}return _0x36a84b['status'](_0x5cf392)[_0x8c97('0x1c')]();};}function respondWithResult(_0x34be9b,_0x4c6227){_0x4c6227=_0x4c6227||0xc8;return function(_0x3b179a){if(_0x3b179a){return _0x34be9b['status'](_0x4c6227)['json'](_0x3b179a);}};}function respondWithFilteredResult(_0x57902c,_0x2d9aae){return function(_0xab3812){if(_0xab3812){var _0x17065f=_0xab3812[_0x8c97('0x1d')],_0xd0e5aa=_0x2d9aae[_0x8c97('0x1e')],_0x24a2a5=_0x2d9aae[_0x8c97('0x1e')]+_0x2d9aae['limit'],_0x29767b;if(_0x24a2a5>=_0x17065f){_0x24a2a5=_0x17065f;_0x29767b=0xc8;}else{_0x29767b=0xce;}_0x57902c[_0x8c97('0x1f')](_0x29767b);return _0x57902c[_0x8c97('0x20')](_0x8c97('0x21'),_0xd0e5aa+'-'+_0x24a2a5+'/'+_0x17065f)[_0x8c97('0x22')](_0xab3812);}return null;};}function patchUpdates(_0x272010){return function(_0x1445db){try{jsonpatch[_0x8c97('0x23')](_0x1445db,_0x272010,!![]);}catch(_0x400bbc){return BPromise[_0x8c97('0x24')](_0x400bbc);}return _0x1445db[_0x8c97('0x25')]();};}function saveUpdates(_0x3bb0fa,_0xb55f9b){return function(_0x292ab2){if(_0x292ab2){return _0x292ab2[_0x8c97('0x26')](_0x3bb0fa)[_0x8c97('0x27')](function(_0x2b83a8){return _0x2b83a8;});}return null;};}function removeEntity(_0x57a266,_0x33a9a8){return function(_0x29b396){if(_0x29b396){return _0x29b396[_0x8c97('0x28')]()['then'](function(){_0x57a266['status'](0xcc)[_0x8c97('0x1c')]();});}};}function handleEntityNotFound(_0x4817d9,_0x41d276){return function(_0x1f2dd5){if(!_0x1f2dd5){_0x4817d9[_0x8c97('0x1b')](0x194);}return _0x1f2dd5;};}function handleError(_0x13a9de,_0x354251){_0x354251=_0x354251||0x1f4;return function(_0x42464a){logger[_0x8c97('0x29')](_0x42464a['stack']);if(_0x42464a['name']){delete _0x42464a[_0x8c97('0x2a')];}_0x13a9de[_0x8c97('0x1f')](_0x354251)[_0x8c97('0x2b')](_0x42464a);};}exports['index']=function(_0x49b7fa,_0x25ef83){var _0x37986d={},_0x34095={},_0x1609de={'count':0x0,'rows':[]};var _0x34f8be=db[_0x8c97('0x2c')]['rawAttributes'];_0x34095[_0x8c97('0x2d')]=_['keys'](_0x34f8be);_0x34095[_0x8c97('0x2e')]=_['keys'](_0x49b7fa[_0x8c97('0x2e')]);_0x34095[_0x8c97('0x2f')]=_['intersection'](_0x34095[_0x8c97('0x2d')],_0x34095['query']);_0x37986d[_0x8c97('0x30')]=_[_0x8c97('0x31')](_0x34095[_0x8c97('0x2d')],qs[_0x8c97('0x32')](_0x49b7fa[_0x8c97('0x2e')][_0x8c97('0x32')]));_0x37986d['attributes']=_0x37986d['attributes'][_0x8c97('0x33')]?_0x37986d[_0x8c97('0x30')]:_0x34095[_0x8c97('0x2d')];if(!_0x49b7fa['query'][_0x8c97('0x34')]('nolimit')){_0x37986d['limit']=qs[_0x8c97('0x35')](_0x49b7fa[_0x8c97('0x2e')][_0x8c97('0x35')]);_0x37986d[_0x8c97('0x1e')]=qs[_0x8c97('0x1e')](_0x49b7fa[_0x8c97('0x2e')]['offset']);}_0x37986d[_0x8c97('0x36')]=qs[_0x8c97('0x37')](_0x49b7fa[_0x8c97('0x2e')][_0x8c97('0x37')]);_0x37986d[_0x8c97('0x38')]=qs[_0x8c97('0x2f')](_[_0x8c97('0x39')](_0x49b7fa[_0x8c97('0x2e')],_0x34095['filters']));if(_0x49b7fa[_0x8c97('0x2e')][_0x8c97('0x3a')]){_0x37986d[_0x8c97('0x38')]=_[_0x8c97('0x3b')](_0x37986d[_0x8c97('0x38')],{'$or':_[_0x8c97('0x3c')](_0x34f8be,function(_0x5946d7){if(_0x5946d7[_0x8c97('0x3d')][_0x8c97('0x3e')]!==_0x8c97('0x3f')){var _0x38e2e2={};_0x38e2e2[_0x5946d7[_0x8c97('0x40')]]={'$like':'%'+_0x49b7fa[_0x8c97('0x2e')][_0x8c97('0x3a')]+'%'};return _0x38e2e2;}})});}_0x37986d=_[_0x8c97('0x3b')]({},_0x37986d,_0x49b7fa[_0x8c97('0x41')]);var _0x4d0625={'where':_0x37986d[_0x8c97('0x38')]};return db[_0x8c97('0x2c')][_0x8c97('0x1d')](_0x4d0625)[_0x8c97('0x27')](function(_0x3d10b1){_0x1609de[_0x8c97('0x1d')]=_0x3d10b1;if(_0x49b7fa['query'][_0x8c97('0x42')]){_0x37986d[_0x8c97('0x43')]=[{'all':!![]}];}return db[_0x8c97('0x2c')][_0x8c97('0x44')](_0x37986d);})[_0x8c97('0x27')](function(_0x4374c5){_0x1609de[_0x8c97('0x45')]=_0x4374c5;return _0x1609de;})[_0x8c97('0x27')](respondWithFilteredResult(_0x25ef83,_0x37986d))[_0x8c97('0x46')](handleError(_0x25ef83,null));};exports[_0x8c97('0x47')]=function(_0x3220b7,_0x367987){var _0x3b41f6={'raw':![],'where':{'id':_0x3220b7[_0x8c97('0x48')]['id']}},_0x3cab0e={};_0x3cab0e[_0x8c97('0x2d')]=_[_0x8c97('0x49')](db[_0x8c97('0x2c')][_0x8c97('0x4a')]);_0x3cab0e[_0x8c97('0x2e')]=_['keys'](_0x3220b7[_0x8c97('0x2e')]);_0x3cab0e[_0x8c97('0x2f')]=_[_0x8c97('0x31')](_0x3cab0e[_0x8c97('0x2d')],_0x3cab0e[_0x8c97('0x2e')]);_0x3b41f6[_0x8c97('0x30')]=_['intersection'](_0x3cab0e[_0x8c97('0x2d')],qs[_0x8c97('0x32')](_0x3220b7[_0x8c97('0x2e')][_0x8c97('0x32')]));_0x3b41f6[_0x8c97('0x30')]=_0x3b41f6[_0x8c97('0x30')][_0x8c97('0x33')]?_0x3b41f6[_0x8c97('0x30')]:_0x3cab0e[_0x8c97('0x2d')];if(_0x3220b7['query'][_0x8c97('0x42')]){_0x3b41f6[_0x8c97('0x43')]=[{'all':!![]}];}_0x3b41f6=_[_0x8c97('0x3b')]({},_0x3b41f6,_0x3220b7[_0x8c97('0x41')]);return db[_0x8c97('0x2c')]['find'](_0x3b41f6)['then'](handleEntityNotFound(_0x367987,null))[_0x8c97('0x27')](respondWithResult(_0x367987,null))['catch'](handleError(_0x367987,null));};exports[_0x8c97('0x4b')]=function(_0x31f9b6,_0x5eb72c){return db[_0x8c97('0x2c')][_0x8c97('0x4b')](_0x31f9b6['body'],{})['then'](respondWithResult(_0x5eb72c,0xc9))[_0x8c97('0x46')](handleError(_0x5eb72c,null));};exports[_0x8c97('0x26')]=function(_0x52e2bf,_0x52f6bb){if(_0x52e2bf['body']['id']){delete _0x52e2bf[_0x8c97('0x4c')]['id'];}return db['UserProfileResource']['find']({'where':{'id':_0x52e2bf[_0x8c97('0x48')]['id']}})[_0x8c97('0x27')](handleEntityNotFound(_0x52f6bb,null))[_0x8c97('0x27')](saveUpdates(_0x52e2bf[_0x8c97('0x4c')],null))[_0x8c97('0x27')](respondWithResult(_0x52f6bb,null))[_0x8c97('0x46')](handleError(_0x52f6bb,null));};exports['destroy']=function(_0x40b25b,_0x3703eb){return db[_0x8c97('0x2c')][_0x8c97('0x4d')]({'where':{'id':_0x40b25b[_0x8c97('0x48')]['id']}})[_0x8c97('0x27')](handleEntityNotFound(_0x3703eb,null))[_0x8c97('0x27')](removeEntity(_0x3703eb,null))[_0x8c97('0x46')](handleError(_0x3703eb,null));};exports[_0x8c97('0x4e')]=function(_0x1147f9,_0x478390){return db[_0x8c97('0x2c')][_0x8c97('0x4e')]()['then'](respondWithResult(_0x478390,null))[_0x8c97('0x46')](handleError(_0x478390,null));}; \ No newline at end of file +var _0x7a72=['limit','set','Content-Range','save','then','destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filter','where','merge','map','key','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','length','options','create','body','update','find','params','describe','eml-format','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4ad630,_0x4855dc){var _0x5c9312=function(_0x5797c7){while(--_0x5797c7){_0x4ad630['push'](_0x4ad630['shift']());}};_0x5c9312(++_0x4855dc);}(_0x7a72,0x1be));var _0x27a7=function(_0x127664,_0x2b4986){_0x127664=_0x127664-0x0;var _0x368d07=_0x7a72[_0x127664];return _0x368d07;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x27a7('0x0'));var rimraf=require(_0x27a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x27a7('0x2'));var rp=require('request-promise');var moment=require(_0x27a7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x27a7('0x4'));var util=require('util');var path=require(_0x27a7('0x5'));var sox=require('sox');var csv=require(_0x27a7('0x6'));var ejs=require(_0x27a7('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x27a7('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x27a7('0x9'));var toCsv=require(_0x27a7('0x6'));var querystring=require(_0x27a7('0xa'));var Papa=require(_0x27a7('0xb'));var Redis=require('ioredis');var authService=require(_0x27a7('0xc'));var qs=require(_0x27a7('0xd'));var hardwareService=require(_0x27a7('0xe'));var logger=require('../../config/logger')(_0x27a7('0xf'));var utils=require(_0x27a7('0x10'));var config=require('../../config/environment');var db=require(_0x27a7('0x11'))['db'];function respondWithStatusCode(_0x27bb33,_0x521561){_0x521561=_0x521561||0xcc;return function(_0x22a0d0){if(_0x22a0d0){return _0x27bb33[_0x27a7('0x12')](_0x521561);}return _0x27bb33[_0x27a7('0x13')](_0x521561)[_0x27a7('0x14')]();};}function respondWithResult(_0x428e6a,_0x20189e){_0x20189e=_0x20189e||0xc8;return function(_0x4948ec){if(_0x4948ec){return _0x428e6a['status'](_0x20189e)[_0x27a7('0x15')](_0x4948ec);}};}function respondWithFilteredResult(_0x50ae9f,_0x17b031){return function(_0x560929){if(_0x560929){var _0x1b2c5a=_0x560929['count'],_0x455bbe=_0x17b031['offset'],_0xcd9791=_0x17b031[_0x27a7('0x16')]+_0x17b031[_0x27a7('0x17')],_0xb1663d;if(_0xcd9791>=_0x1b2c5a){_0xcd9791=_0x1b2c5a;_0xb1663d=0xc8;}else{_0xb1663d=0xce;}_0x50ae9f['status'](_0xb1663d);return _0x50ae9f[_0x27a7('0x18')](_0x27a7('0x19'),_0x455bbe+'-'+_0xcd9791+'/'+_0x1b2c5a)[_0x27a7('0x15')](_0x560929);}return null;};}function patchUpdates(_0xe506ee){return function(_0x1f10be){try{jsonpatch['apply'](_0x1f10be,_0xe506ee,!![]);}catch(_0x113e8a){return BPromise['reject'](_0x113e8a);}return _0x1f10be[_0x27a7('0x1a')]();};}function saveUpdates(_0x1ab335,_0x4de342){return function(_0x32c6c6){if(_0x32c6c6){return _0x32c6c6['update'](_0x1ab335)[_0x27a7('0x1b')](function(_0x5d5031){return _0x5d5031;});}return null;};}function removeEntity(_0x7276d1,_0x21453b){return function(_0x1ce3f6){if(_0x1ce3f6){return _0x1ce3f6[_0x27a7('0x1c')]()['then'](function(){_0x7276d1['status'](0xcc)[_0x27a7('0x14')]();});}};}function handleEntityNotFound(_0xde9e67,_0x32cb91){return function(_0x5bf3d7){if(!_0x5bf3d7){_0xde9e67[_0x27a7('0x12')](0x194);}return _0x5bf3d7;};}function handleError(_0x351ef4,_0x153bc7){_0x153bc7=_0x153bc7||0x1f4;return function(_0x345753){logger[_0x27a7('0x1d')](_0x345753[_0x27a7('0x1e')]);if(_0x345753[_0x27a7('0x1f')]){delete _0x345753[_0x27a7('0x1f')];}_0x351ef4[_0x27a7('0x13')](_0x153bc7)[_0x27a7('0x20')](_0x345753);};}exports[_0x27a7('0x21')]=function(_0x517b8f,_0x3c3c4a){var _0x439066={},_0x2a8d90={},_0x2fcfce={'count':0x0,'rows':[]};var _0x4c935c=db[_0x27a7('0x22')][_0x27a7('0x23')];_0x2a8d90[_0x27a7('0x24')]=_[_0x27a7('0x25')](_0x4c935c);_0x2a8d90[_0x27a7('0x26')]=_[_0x27a7('0x25')](_0x517b8f['query']);_0x2a8d90[_0x27a7('0x27')]=_[_0x27a7('0x28')](_0x2a8d90['model'],_0x2a8d90[_0x27a7('0x26')]);_0x439066['attributes']=_[_0x27a7('0x28')](_0x2a8d90[_0x27a7('0x24')],qs['fields'](_0x517b8f['query'][_0x27a7('0x29')]));_0x439066[_0x27a7('0x2a')]=_0x439066[_0x27a7('0x2a')]['length']?_0x439066[_0x27a7('0x2a')]:_0x2a8d90[_0x27a7('0x24')];if(!_0x517b8f['query'][_0x27a7('0x2b')](_0x27a7('0x2c'))){_0x439066['limit']=qs['limit'](_0x517b8f[_0x27a7('0x26')]['limit']);_0x439066['offset']=qs['offset'](_0x517b8f['query'][_0x27a7('0x16')]);}_0x439066['order']=qs[_0x27a7('0x2d')](_0x517b8f[_0x27a7('0x26')]['sort']);_0x439066['where']=qs[_0x27a7('0x27')](_['pick'](_0x517b8f[_0x27a7('0x26')],_0x2a8d90['filters']));if(_0x517b8f[_0x27a7('0x26')][_0x27a7('0x2e')]){_0x439066[_0x27a7('0x2f')]=_[_0x27a7('0x30')](_0x439066['where'],{'$or':_[_0x27a7('0x31')](_0x4c935c,function(_0x149c7f){if(_0x149c7f['type'][_0x27a7('0x32')]!==_0x27a7('0x33')){var _0x18517f={};_0x18517f[_0x149c7f[_0x27a7('0x34')]]={'$like':'%'+_0x517b8f[_0x27a7('0x26')]['filter']+'%'};return _0x18517f;}})});}_0x439066=_[_0x27a7('0x30')]({},_0x439066,_0x517b8f['options']);var _0x22c689={'where':_0x439066['where']};return db[_0x27a7('0x22')][_0x27a7('0x35')](_0x22c689)[_0x27a7('0x1b')](function(_0x23eb08){_0x2fcfce[_0x27a7('0x35')]=_0x23eb08;if(_0x517b8f['query'][_0x27a7('0x36')]){_0x439066[_0x27a7('0x37')]=[{'all':!![]}];}return db[_0x27a7('0x22')][_0x27a7('0x38')](_0x439066);})[_0x27a7('0x1b')](function(_0x161abe){_0x2fcfce[_0x27a7('0x39')]=_0x161abe;return _0x2fcfce;})[_0x27a7('0x1b')](respondWithFilteredResult(_0x3c3c4a,_0x439066))[_0x27a7('0x3a')](handleError(_0x3c3c4a,null));};exports['show']=function(_0x5af7bc,_0x3cae38){var _0x27e73b={'raw':![],'where':{'id':_0x5af7bc['params']['id']}},_0x268944={};_0x268944[_0x27a7('0x24')]=_[_0x27a7('0x25')](db[_0x27a7('0x22')][_0x27a7('0x23')]);_0x268944[_0x27a7('0x26')]=_['keys'](_0x5af7bc[_0x27a7('0x26')]);_0x268944[_0x27a7('0x27')]=_[_0x27a7('0x28')](_0x268944['model'],_0x268944[_0x27a7('0x26')]);_0x27e73b[_0x27a7('0x2a')]=_[_0x27a7('0x28')](_0x268944[_0x27a7('0x24')],qs[_0x27a7('0x29')](_0x5af7bc[_0x27a7('0x26')][_0x27a7('0x29')]));_0x27e73b['attributes']=_0x27e73b[_0x27a7('0x2a')][_0x27a7('0x3b')]?_0x27e73b[_0x27a7('0x2a')]:_0x268944[_0x27a7('0x24')];if(_0x5af7bc[_0x27a7('0x26')]['includeAll']){_0x27e73b[_0x27a7('0x37')]=[{'all':!![]}];}_0x27e73b=_['merge']({},_0x27e73b,_0x5af7bc[_0x27a7('0x3c')]);return db[_0x27a7('0x22')]['find'](_0x27e73b)[_0x27a7('0x1b')](handleEntityNotFound(_0x3cae38,null))[_0x27a7('0x1b')](respondWithResult(_0x3cae38,null))['catch'](handleError(_0x3cae38,null));};exports['create']=function(_0x360c69,_0xd6d69){return db[_0x27a7('0x22')][_0x27a7('0x3d')](_0x360c69[_0x27a7('0x3e')],{})['then'](respondWithResult(_0xd6d69,0xc9))['catch'](handleError(_0xd6d69,null));};exports[_0x27a7('0x3f')]=function(_0x566aab,_0x2c126b){if(_0x566aab[_0x27a7('0x3e')]['id']){delete _0x566aab[_0x27a7('0x3e')]['id'];}return db[_0x27a7('0x22')][_0x27a7('0x40')]({'where':{'id':_0x566aab[_0x27a7('0x41')]['id']}})['then'](handleEntityNotFound(_0x2c126b,null))[_0x27a7('0x1b')](saveUpdates(_0x566aab['body'],null))[_0x27a7('0x1b')](respondWithResult(_0x2c126b,null))[_0x27a7('0x3a')](handleError(_0x2c126b,null));};exports[_0x27a7('0x1c')]=function(_0x294156,_0x4cacc5){return db['UserProfileResource']['find']({'where':{'id':_0x294156[_0x27a7('0x41')]['id']}})['then'](handleEntityNotFound(_0x4cacc5,null))[_0x27a7('0x1b')](removeEntity(_0x4cacc5,null))[_0x27a7('0x3a')](handleError(_0x4cacc5,null));};exports['describe']=function(_0x195cb7,_0xa46ee2){return db['UserProfileResource'][_0x27a7('0x42')]()['then'](respondWithResult(_0xa46ee2,null))[_0x27a7('0x3a')](handleError(_0xa46ee2,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 914da40..efd69bf 100644 --- a/server/api/userProfileResource/userProfileResource.model.js +++ b/server/api/userProfileResource/userProfileResource.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe880=['resourceId','sectionId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources'];(function(_0x3b5c4d,_0x843584){var _0x29ceae=function(_0xb6daeb){while(--_0xb6daeb){_0x3b5c4d['push'](_0x3b5c4d['shift']());}};_0x29ceae(++_0x843584);}(_0xe880,0x12e));var _0x0e88=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe880[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x0e88('0x0'));var util=require(_0x0e88('0x1'));var logger=require('../../config/logger')(_0x0e88('0x2'));var moment=require(_0x0e88('0x3'));var BPromise=require(_0x0e88('0x4'));var rp=require(_0x0e88('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e88('0x6'));var config=require(_0x0e88('0x7'));var attributes=require(_0x0e88('0x8'));module[_0x0e88('0x9')]=function(_0x3e3ebd,_0x10d6f1){return _0x3e3ebd[_0x0e88('0xa')](_0x0e88('0xb'),attributes,{'tableName':_0x0e88('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x0e88('0xd'),_0x0e88('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3b8=['resourceId','sectionId','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','compositeIndex'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0xf3b8,0x80));var _0x8f3b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xf3b8[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x8f3b('0x0'));var util=require(_0x8f3b('0x1'));var logger=require(_0x8f3b('0x2'))(_0x8f3b('0x3'));var moment=require(_0x8f3b('0x4'));var BPromise=require('bluebird');var rp=require(_0x8f3b('0x5'));var fs=require('fs');var path=require(_0x8f3b('0x6'));var rimraf=require('rimraf');var config=require(_0x8f3b('0x7'));var attributes=require(_0x8f3b('0x8'));module[_0x8f3b('0x9')]=function(_0x730a22,_0x4d4dc2){return _0x730a22['define'](_0x8f3b('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x8f3b('0xb'),'fields':[_0x8f3b('0xc'),_0x8f3b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 44e8162..a33bfb9 100644 --- a/server/api/userProfileResource/userProfileResource.rpc.js +++ b/server/api/userProfileResource/userProfileResource.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed91=['request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x1ebfc7,_0x2797db){var _0x1627b8=function(_0x59ceee){while(--_0x59ceee){_0x1ebfc7['push'](_0x1ebfc7['shift']());}};_0x1627b8(++_0x2797db);}(_0xed91,0x1c0));var _0x1ed9=function(_0x178333,_0x192773){_0x178333=_0x178333-0x0;var _0xe7f018=_0xed91[_0x178333];return _0xe7f018;};'use strict';var _=require(_0x1ed9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1ed9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ed9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ed9('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x1ed9('0x4'));var jayson=require(_0x1ed9('0x5'));var client=jayson[_0x1ed9('0x6')][_0x1ed9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4cb427,_0x1dfba8,_0x27f4ad){return new BPromise(function(_0x44e183,_0x3da944){return client[_0x1ed9('0x8')](_0x4cb427,_0x27f4ad)[_0x1ed9('0x9')](function(_0x1705a7){logger[_0x1ed9('0xa')](_0x1ed9('0xb'),_0x1dfba8,_0x1ed9('0xc'));logger[_0x1ed9('0xd')](_0x1ed9('0xe'),_0x1dfba8,_0x1ed9('0xc'),JSON[_0x1ed9('0xf')](_0x1705a7));if(_0x1705a7['error']){if(_0x1705a7[_0x1ed9('0x10')]['code']===0x1f4){logger[_0x1ed9('0x10')](_0x1ed9('0xb'),_0x1dfba8,_0x1705a7[_0x1ed9('0x10')][_0x1ed9('0x11')]);return _0x3da944(_0x1705a7[_0x1ed9('0x10')][_0x1ed9('0x11')]);}logger[_0x1ed9('0x10')](_0x1ed9('0xb'),_0x1dfba8,_0x1705a7[_0x1ed9('0x10')]['message']);return _0x44e183(_0x1705a7['error'][_0x1ed9('0x11')]);}else{logger[_0x1ed9('0xa')](_0x1ed9('0xb'),_0x1dfba8,_0x1ed9('0xc'));_0x44e183(_0x1705a7[_0x1ed9('0x12')]['message']);}})[_0x1ed9('0x13')](function(_0x50e704){logger[_0x1ed9('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x1dfba8,_0x50e704);_0x3da944(_0x50e704);});});} \ No newline at end of file +var _0xee71=['UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info'];(function(_0x2b5b85,_0x2651d8){var _0x34cb0d=function(_0xefc181){while(--_0xefc181){_0x2b5b85['push'](_0x2b5b85['shift']());}};_0x34cb0d(++_0x2651d8);}(_0xee71,0xa8));var _0x1ee7=function(_0x393ea2,_0x58f35c){_0x393ea2=_0x393ea2-0x0;var _0x26fce9=_0xee71[_0x393ea2];return _0x26fce9;};'use strict';var _=require(_0x1ee7('0x0'));var util=require(_0x1ee7('0x1'));var moment=require(_0x1ee7('0x2'));var BPromise=require(_0x1ee7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ee7('0x4'))['db'];var utils=require(_0x1ee7('0x5'));var logger=require(_0x1ee7('0x6'))('rpc');var config=require(_0x1ee7('0x7'));var jayson=require(_0x1ee7('0x8'));var client=jayson[_0x1ee7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x363b10,_0x13f70d,_0x5c145e){return new BPromise(function(_0x36c66a,_0x29d1d7){return client['request'](_0x363b10,_0x5c145e)[_0x1ee7('0xa')](function(_0x19dc85){logger[_0x1ee7('0xb')](_0x1ee7('0xc'),_0x13f70d,_0x1ee7('0xd'));logger[_0x1ee7('0xe')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x13f70d,_0x1ee7('0xd'),JSON[_0x1ee7('0xf')](_0x19dc85));if(_0x19dc85['error']){if(_0x19dc85[_0x1ee7('0x10')]['code']===0x1f4){logger[_0x1ee7('0x10')](_0x1ee7('0xc'),_0x13f70d,_0x19dc85[_0x1ee7('0x10')]['message']);return _0x29d1d7(_0x19dc85[_0x1ee7('0x10')][_0x1ee7('0x11')]);}logger[_0x1ee7('0x10')](_0x1ee7('0xc'),_0x13f70d,_0x19dc85[_0x1ee7('0x10')]['message']);return _0x36c66a(_0x19dc85[_0x1ee7('0x10')]['message']);}else{logger[_0x1ee7('0xb')](_0x1ee7('0xc'),_0x13f70d,'request\x20sent');_0x36c66a(_0x19dc85[_0x1ee7('0x12')]['message']);}})[_0x1ee7('0x13')](function(_0x49739e){logger[_0x1ee7('0x10')](_0x1ee7('0xc'),_0x13f70d,_0x49739e);_0x29d1d7(_0x49739e);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index ca60d21..d47a040 100644 --- a/server/api/userProfileSection/index.js +++ b/server/api/userProfileSection/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4889=['describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','Router','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe'];(function(_0x487d6e,_0x590ce7){var _0x3d0a2e=function(_0x4d559f){while(--_0x4d559f){_0x487d6e['push'](_0x487d6e['shift']());}};_0x3d0a2e(++_0x590ce7);}(_0x4889,0x194));var _0x9488=function(_0x4579dc,_0xff67f8){_0x4579dc=_0x4579dc-0x0;var _0x458962=_0x4889[_0x4579dc];return _0x458962;};'use strict';var multer=require(_0x9488('0x0'));var util=require('util');var path=require(_0x9488('0x1'));var timeout=require(_0x9488('0x2'));var express=require('express');var router=express[_0x9488('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9488('0x4'));var controller=require(_0x9488('0x5'));router[_0x9488('0x6')]('/',auth[_0x9488('0x7')](),controller[_0x9488('0x8')]);router[_0x9488('0x6')](_0x9488('0x9'),auth[_0x9488('0x7')](),controller[_0x9488('0xa')]);router[_0x9488('0x6')](_0x9488('0xb'),auth[_0x9488('0x7')](),controller[_0x9488('0xc')]);router[_0x9488('0xd')]('/',auth[_0x9488('0x7')](),controller[_0x9488('0xe')]);router['put'](_0x9488('0xb'),auth[_0x9488('0x7')](),controller[_0x9488('0xf')]);router[_0x9488('0x10')](_0x9488('0xb'),auth[_0x9488('0x7')](),controller['destroy']);module[_0x9488('0x11')]=router; \ No newline at end of file +var _0x5002=['put','update','destroy','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','post'];(function(_0x99e4e2,_0x269c54){var _0x423fd8=function(_0x2d7fde){while(--_0x2d7fde){_0x99e4e2['push'](_0x99e4e2['shift']());}};_0x423fd8(++_0x269c54);}(_0x5002,0x189));var _0x2500=function(_0x2d9412,_0x47f181){_0x2d9412=_0x2d9412-0x0;var _0x437fe2=_0x5002[_0x2d9412];return _0x437fe2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2500('0x0'));var express=require('express');var router=express[_0x2500('0x1')]();var auth=require(_0x2500('0x2'));var interaction=require(_0x2500('0x3'));var config=require(_0x2500('0x4'));var controller=require(_0x2500('0x5'));router[_0x2500('0x6')]('/',auth[_0x2500('0x7')](),controller[_0x2500('0x8')]);router[_0x2500('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x2500('0x9')]);router[_0x2500('0x6')](_0x2500('0xa'),auth[_0x2500('0x7')](),controller['show']);router[_0x2500('0xb')]('/',auth[_0x2500('0x7')](),controller['create']);router[_0x2500('0xc')](_0x2500('0xa'),auth[_0x2500('0x7')](),controller[_0x2500('0xd')]);router['delete']('/:id',auth[_0x2500('0x7')](),controller[_0x2500('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 53e5fd7..5feca7c 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f23=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','sequelize'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x8f23,0x1e5));var _0x38f2=function(_0x42e2c5,_0x1acfdc){_0x42e2c5=_0x42e2c5-0x0;var _0x3bd70d=_0x8f23[_0x42e2c5];return _0x3bd70d;};'use strict';var Sequelize=require(_0x38f2('0x0'));module[_0x38f2('0x1')]={'name':{'type':Sequelize[_0x38f2('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x38f2('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x38f2('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x38f2('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x31dbb0){this[_0x38f2('0x5')](_0x38f2('0x6'),_0x31dbb0?_0x31dbb0[_0x38f2('0x7')](''):[]);},'get':function(){return this[_0x38f2('0x8')](_0x38f2('0x6'))?this[_0x38f2('0x8')](_0x38f2('0x6'))['split'](''):[];}}}; \ No newline at end of file +var _0xcb06=['split','STRING','BOOLEAN','setDataValue','join','getDataValue','crudPermissions'];(function(_0x5ac5c1,_0x1d27f8){var _0x2e8285=function(_0x325055){while(--_0x325055){_0x5ac5c1['push'](_0x5ac5c1['shift']());}};_0x2e8285(++_0x1d27f8);}(_0xcb06,0x127));var _0x6cb0=function(_0x8a30cf,_0x40f19b){_0x8a30cf=_0x8a30cf-0x0;var _0x20f439=_0xcb06[_0x8a30cf];return _0x20f439;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x6cb0('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x6cb0('0x1')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x6cb0('0x0')],'set':function(_0x5eab59){this[_0x6cb0('0x2')]('crudPermissions',_0x5eab59?_0x5eab59[_0x6cb0('0x3')](''):[]);},'get':function(){return this[_0x6cb0('0x4')](_0x6cb0('0x5'))?this[_0x6cb0('0x4')](_0x6cb0('0x5'))[_0x6cb0('0x6')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 93a07a2..a149405 100644 --- a/server/api/userProfileSection/userProfileSection.controller.js +++ b/server/api/userProfileSection/userProfileSection.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','then','destroy','error','stack','name','send','index','UserProfileSection','rawAttributes','keys','query','filters','intersection','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','include','findAll','show','params','model','fields','includeAll','find','catch','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x814b,0x1a2));var _0xb814=function(_0x18032f,_0x4f4e45){_0x18032f=_0x18032f-0x0;var _0xb0b2b8=_0x814b[_0x18032f];return _0xb0b2b8;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var hardwareService=require(_0xb814('0x15'));var logger=require(_0xb814('0x16'))(_0xb814('0x17'));var utils=require('../../config/utils');var config=require(_0xb814('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26b35f,_0x15d6ef){_0x15d6ef=_0x15d6ef||0xcc;return function(_0x35b10d){if(_0x35b10d){return _0x26b35f[_0xb814('0x19')](_0x15d6ef);}return _0x26b35f[_0xb814('0x1a')](_0x15d6ef)[_0xb814('0x1b')]();};}function respondWithResult(_0x1438e7,_0x41ed7b){_0x41ed7b=_0x41ed7b||0xc8;return function(_0xa0a2e5){if(_0xa0a2e5){return _0x1438e7[_0xb814('0x1a')](_0x41ed7b)[_0xb814('0x1c')](_0xa0a2e5);}};}function respondWithFilteredResult(_0x44fb96,_0x17f5bd){return function(_0x39bfcf){if(_0x39bfcf){var _0x303aca=_0x39bfcf[_0xb814('0x1d')],_0x3a71d6=_0x17f5bd[_0xb814('0x1e')],_0x45e0d0=_0x17f5bd[_0xb814('0x1e')]+_0x17f5bd['limit'],_0x265a83;if(_0x45e0d0>=_0x303aca){_0x45e0d0=_0x303aca;_0x265a83=0xc8;}else{_0x265a83=0xce;}_0x44fb96[_0xb814('0x1a')](_0x265a83);return _0x44fb96['set'](_0xb814('0x1f'),_0x3a71d6+'-'+_0x45e0d0+'/'+_0x303aca)[_0xb814('0x1c')](_0x39bfcf);}return null;};}function patchUpdates(_0x4c3007){return function(_0x4b55a7){try{jsonpatch['apply'](_0x4b55a7,_0x4c3007,!![]);}catch(_0x399b43){return BPromise['reject'](_0x399b43);}return _0x4b55a7['save']();};}function saveUpdates(_0xb684ea,_0x24211d){return function(_0x25b6b6){if(_0x25b6b6){return _0x25b6b6['update'](_0xb684ea)[_0xb814('0x20')](function(_0x531032){return _0x531032;});}return null;};}function removeEntity(_0x1e6393,_0x1808a3){return function(_0x3b267e){if(_0x3b267e){return _0x3b267e[_0xb814('0x21')]()[_0xb814('0x20')](function(){_0x1e6393[_0xb814('0x1a')](0xcc)[_0xb814('0x1b')]();});}};}function handleEntityNotFound(_0x594470,_0x2ead86){return function(_0x52b7a3){if(!_0x52b7a3){_0x594470[_0xb814('0x19')](0x194);}return _0x52b7a3;};}function handleError(_0x457dac,_0x31c7ec){_0x31c7ec=_0x31c7ec||0x1f4;return function(_0x208927){logger[_0xb814('0x22')](_0x208927[_0xb814('0x23')]);if(_0x208927[_0xb814('0x24')]){delete _0x208927['name'];}_0x457dac[_0xb814('0x1a')](_0x31c7ec)[_0xb814('0x25')](_0x208927);};}exports[_0xb814('0x26')]=function(_0x349394,_0x32ed56){var _0x1d5965={},_0x3f0150={},_0x1e4e89={'count':0x0,'rows':[]};var _0x5a6291=db[_0xb814('0x27')][_0xb814('0x28')];_0x3f0150['model']=_[_0xb814('0x29')](_0x5a6291);_0x3f0150[_0xb814('0x2a')]=_[_0xb814('0x29')](_0x349394['query']);_0x3f0150[_0xb814('0x2b')]=_[_0xb814('0x2c')](_0x3f0150['model'],_0x3f0150[_0xb814('0x2a')]);_0x1d5965['attributes']=_[_0xb814('0x2c')](_0x3f0150['model'],qs['fields'](_0x349394[_0xb814('0x2a')]['fields']));_0x1d5965[_0xb814('0x2d')]=_0x1d5965[_0xb814('0x2d')][_0xb814('0x2e')]?_0x1d5965['attributes']:_0x3f0150['model'];if(!_0x349394[_0xb814('0x2a')][_0xb814('0x2f')]('nolimit')){_0x1d5965[_0xb814('0x30')]=qs[_0xb814('0x30')](_0x349394[_0xb814('0x2a')][_0xb814('0x30')]);_0x1d5965[_0xb814('0x1e')]=qs[_0xb814('0x1e')](_0x349394[_0xb814('0x2a')]['offset']);}_0x1d5965[_0xb814('0x31')]=qs[_0xb814('0x32')](_0x349394[_0xb814('0x2a')][_0xb814('0x32')]);_0x1d5965[_0xb814('0x33')]=qs['filters'](_[_0xb814('0x34')](_0x349394['query'],_0x3f0150[_0xb814('0x2b')]));if(_0x349394[_0xb814('0x2a')][_0xb814('0x35')]){_0x1d5965['where']=_[_0xb814('0x36')](_0x1d5965[_0xb814('0x33')],{'$or':_['map'](_0x5a6291,function(_0x2fcd92){if(_0x2fcd92[_0xb814('0x37')][_0xb814('0x38')]!==_0xb814('0x39')){var _0xd77d96={};_0xd77d96[_0x2fcd92[_0xb814('0x3a')]]={'$like':'%'+_0x349394['query'][_0xb814('0x35')]+'%'};return _0xd77d96;}})});}_0x1d5965=_['merge']({},_0x1d5965,_0x349394[_0xb814('0x3b')]);var _0x4b5583={'where':_0x1d5965[_0xb814('0x33')]};return db['UserProfileSection'][_0xb814('0x1d')](_0x4b5583)[_0xb814('0x20')](function(_0x54a7fb){_0x1e4e89['count']=_0x54a7fb;if(_0x349394['query']['includeAll']){_0x1d5965[_0xb814('0x3c')]=[{'all':!![]}];}return db[_0xb814('0x27')][_0xb814('0x3d')](_0x1d5965);})[_0xb814('0x20')](function(_0x51cdba){_0x1e4e89['rows']=_0x51cdba;return _0x1e4e89;})[_0xb814('0x20')](respondWithFilteredResult(_0x32ed56,_0x1d5965))['catch'](handleError(_0x32ed56,null));};exports[_0xb814('0x3e')]=function(_0x1098eb,_0x178823){var _0x3063bf={'raw':![],'where':{'id':_0x1098eb[_0xb814('0x3f')]['id']}},_0x42653f={};_0x42653f[_0xb814('0x40')]=_[_0xb814('0x29')](db[_0xb814('0x27')]['rawAttributes']);_0x42653f['query']=_['keys'](_0x1098eb[_0xb814('0x2a')]);_0x42653f['filters']=_[_0xb814('0x2c')](_0x42653f['model'],_0x42653f[_0xb814('0x2a')]);_0x3063bf[_0xb814('0x2d')]=_[_0xb814('0x2c')](_0x42653f[_0xb814('0x40')],qs['fields'](_0x1098eb[_0xb814('0x2a')][_0xb814('0x41')]));_0x3063bf[_0xb814('0x2d')]=_0x3063bf[_0xb814('0x2d')][_0xb814('0x2e')]?_0x3063bf[_0xb814('0x2d')]:_0x42653f['model'];if(_0x1098eb[_0xb814('0x2a')][_0xb814('0x42')]){_0x3063bf[_0xb814('0x3c')]=[{'all':!![]}];}_0x3063bf=_[_0xb814('0x36')]({},_0x3063bf,_0x1098eb[_0xb814('0x3b')]);return db[_0xb814('0x27')][_0xb814('0x43')](_0x3063bf)['then'](handleEntityNotFound(_0x178823,null))['then'](respondWithResult(_0x178823,null))[_0xb814('0x44')](handleError(_0x178823,null));};exports[_0xb814('0x45')]=function(_0x4c08d6,_0x2bf906){return db[_0xb814('0x27')][_0xb814('0x45')](_0x4c08d6[_0xb814('0x46')],{})[_0xb814('0x20')](respondWithResult(_0x2bf906,0xc9))[_0xb814('0x44')](handleError(_0x2bf906,null));};exports[_0xb814('0x47')]=function(_0xe73300,_0x5c7a49){if(_0xe73300[_0xb814('0x46')]['id']){delete _0xe73300[_0xb814('0x46')]['id'];}return db['UserProfileSection'][_0xb814('0x43')]({'where':{'id':_0xe73300['params']['id']}})[_0xb814('0x20')](handleEntityNotFound(_0x5c7a49,null))[_0xb814('0x20')](saveUpdates(_0xe73300[_0xb814('0x46')],null))[_0xb814('0x20')](respondWithResult(_0x5c7a49,null))[_0xb814('0x44')](handleError(_0x5c7a49,null));};exports[_0xb814('0x21')]=function(_0x2cc806,_0x45480e){return db[_0xb814('0x27')][_0xb814('0x43')]({'where':{'id':_0x2cc806['params']['id']}})['then'](handleEntityNotFound(_0x45480e,null))[_0xb814('0x20')](removeEntity(_0x45480e,null))[_0xb814('0x44')](handleError(_0x45480e,null));};exports[_0xb814('0x48')]=function(_0x3f8e29,_0x1b565c){return db[_0xb814('0x27')][_0xb814('0x48')]()['then'](respondWithResult(_0x1b565c,null))[_0xb814('0x44')](handleError(_0x1b565c,null));}; \ No newline at end of file +var _0x7217=['query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','type','key','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','include','merge','options','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','save','then','destroy','end','error','stack','name','send','index','UserProfileSection','rawAttributes','model','keys'];(function(_0x310377,_0x41a00a){var _0x478b92=function(_0x4e04e9){while(--_0x4e04e9){_0x310377['push'](_0x310377['shift']());}};_0x478b92(++_0x41a00a);}(_0x7217,0x19e));var _0x7721=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x7217[_0x138f59];return _0x3d114d;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7721('0x14'));var logger=require(_0x7721('0x15'))(_0x7721('0x16'));var utils=require(_0x7721('0x17'));var config=require(_0x7721('0x18'));var db=require(_0x7721('0x19'))['db'];function respondWithStatusCode(_0x1e7fd7,_0x27b36b){_0x27b36b=_0x27b36b||0xcc;return function(_0x55b4ca){if(_0x55b4ca){return _0x1e7fd7[_0x7721('0x1a')](_0x27b36b);}return _0x1e7fd7[_0x7721('0x1b')](_0x27b36b)['end']();};}function respondWithResult(_0x109900,_0x30da54){_0x30da54=_0x30da54||0xc8;return function(_0x3f01c5){if(_0x3f01c5){return _0x109900[_0x7721('0x1b')](_0x30da54)['json'](_0x3f01c5);}};}function respondWithFilteredResult(_0x3cbce8,_0x25b1c0){return function(_0x534f1b){if(_0x534f1b){var _0x4e199a=_0x534f1b[_0x7721('0x1c')],_0x4b183e=_0x25b1c0[_0x7721('0x1d')],_0x5ed54=_0x25b1c0['offset']+_0x25b1c0[_0x7721('0x1e')],_0x25a628;if(_0x5ed54>=_0x4e199a){_0x5ed54=_0x4e199a;_0x25a628=0xc8;}else{_0x25a628=0xce;}_0x3cbce8['status'](_0x25a628);return _0x3cbce8[_0x7721('0x1f')]('Content-Range',_0x4b183e+'-'+_0x5ed54+'/'+_0x4e199a)[_0x7721('0x20')](_0x534f1b);}return null;};}function patchUpdates(_0x4e96fb){return function(_0x3ab5a5){try{jsonpatch[_0x7721('0x21')](_0x3ab5a5,_0x4e96fb,!![]);}catch(_0x2286e5){return BPromise[_0x7721('0x22')](_0x2286e5);}return _0x3ab5a5[_0x7721('0x23')]();};}function saveUpdates(_0x413263,_0x3b29ac){return function(_0xaeccc4){if(_0xaeccc4){return _0xaeccc4['update'](_0x413263)[_0x7721('0x24')](function(_0x2c1583){return _0x2c1583;});}return null;};}function removeEntity(_0x3a053f,_0xd8ad3c){return function(_0x57140c){if(_0x57140c){return _0x57140c[_0x7721('0x25')]()['then'](function(){_0x3a053f[_0x7721('0x1b')](0xcc)[_0x7721('0x26')]();});}};}function handleEntityNotFound(_0x3e8a4e,_0x1caad8){return function(_0x121cc4){if(!_0x121cc4){_0x3e8a4e[_0x7721('0x1a')](0x194);}return _0x121cc4;};}function handleError(_0x2c6b7b,_0x5b4d74){_0x5b4d74=_0x5b4d74||0x1f4;return function(_0x216f20){logger[_0x7721('0x27')](_0x216f20[_0x7721('0x28')]);if(_0x216f20[_0x7721('0x29')]){delete _0x216f20[_0x7721('0x29')];}_0x2c6b7b[_0x7721('0x1b')](_0x5b4d74)[_0x7721('0x2a')](_0x216f20);};}exports[_0x7721('0x2b')]=function(_0x40f367,_0x52316e){var _0x258ddf={},_0x5b0551={},_0x499b87={'count':0x0,'rows':[]};var _0x315202=db[_0x7721('0x2c')][_0x7721('0x2d')];_0x5b0551[_0x7721('0x2e')]=_[_0x7721('0x2f')](_0x315202);_0x5b0551[_0x7721('0x30')]=_[_0x7721('0x2f')](_0x40f367[_0x7721('0x30')]);_0x5b0551['filters']=_[_0x7721('0x31')](_0x5b0551[_0x7721('0x2e')],_0x5b0551['query']);_0x258ddf['attributes']=_[_0x7721('0x31')](_0x5b0551[_0x7721('0x2e')],qs['fields'](_0x40f367[_0x7721('0x30')][_0x7721('0x32')]));_0x258ddf[_0x7721('0x33')]=_0x258ddf['attributes'][_0x7721('0x34')]?_0x258ddf[_0x7721('0x33')]:_0x5b0551[_0x7721('0x2e')];if(!_0x40f367[_0x7721('0x30')][_0x7721('0x35')]('nolimit')){_0x258ddf[_0x7721('0x1e')]=qs[_0x7721('0x1e')](_0x40f367[_0x7721('0x30')]['limit']);_0x258ddf[_0x7721('0x1d')]=qs[_0x7721('0x1d')](_0x40f367['query'][_0x7721('0x1d')]);}_0x258ddf['order']=qs[_0x7721('0x36')](_0x40f367[_0x7721('0x30')][_0x7721('0x36')]);_0x258ddf[_0x7721('0x37')]=qs[_0x7721('0x38')](_[_0x7721('0x39')](_0x40f367[_0x7721('0x30')],_0x5b0551[_0x7721('0x38')]));if(_0x40f367[_0x7721('0x30')][_0x7721('0x3a')]){_0x258ddf[_0x7721('0x37')]=_['merge'](_0x258ddf[_0x7721('0x37')],{'$or':_['map'](_0x315202,function(_0x212384){if(_0x212384[_0x7721('0x3b')][_0x7721('0x3c')]!==_0x7721('0x3d')){var _0x3968f3={};_0x3968f3[_0x212384[_0x7721('0x3e')]]={'$like':'%'+_0x40f367['query']['filter']+'%'};return _0x3968f3;}})});}_0x258ddf=_['merge']({},_0x258ddf,_0x40f367['options']);var _0x18001c={'where':_0x258ddf[_0x7721('0x37')]};return db[_0x7721('0x2c')][_0x7721('0x1c')](_0x18001c)['then'](function(_0xa389fa){_0x499b87['count']=_0xa389fa;if(_0x40f367[_0x7721('0x30')][_0x7721('0x3f')]){_0x258ddf['include']=[{'all':!![]}];}return db[_0x7721('0x2c')][_0x7721('0x40')](_0x258ddf);})['then'](function(_0x4d0111){_0x499b87[_0x7721('0x41')]=_0x4d0111;return _0x499b87;})[_0x7721('0x24')](respondWithFilteredResult(_0x52316e,_0x258ddf))[_0x7721('0x42')](handleError(_0x52316e,null));};exports[_0x7721('0x43')]=function(_0x577af9,_0x2db173){var _0x120de9={'raw':![],'where':{'id':_0x577af9[_0x7721('0x44')]['id']}},_0x40ce8c={};_0x40ce8c[_0x7721('0x2e')]=_['keys'](db[_0x7721('0x2c')]['rawAttributes']);_0x40ce8c[_0x7721('0x30')]=_['keys'](_0x577af9[_0x7721('0x30')]);_0x40ce8c[_0x7721('0x38')]=_[_0x7721('0x31')](_0x40ce8c['model'],_0x40ce8c[_0x7721('0x30')]);_0x120de9[_0x7721('0x33')]=_[_0x7721('0x31')](_0x40ce8c['model'],qs[_0x7721('0x32')](_0x577af9[_0x7721('0x30')][_0x7721('0x32')]));_0x120de9[_0x7721('0x33')]=_0x120de9[_0x7721('0x33')][_0x7721('0x34')]?_0x120de9[_0x7721('0x33')]:_0x40ce8c['model'];if(_0x577af9['query'][_0x7721('0x3f')]){_0x120de9[_0x7721('0x45')]=[{'all':!![]}];}_0x120de9=_[_0x7721('0x46')]({},_0x120de9,_0x577af9[_0x7721('0x47')]);return db[_0x7721('0x2c')][_0x7721('0x48')](_0x120de9)[_0x7721('0x24')](handleEntityNotFound(_0x2db173,null))[_0x7721('0x24')](respondWithResult(_0x2db173,null))[_0x7721('0x42')](handleError(_0x2db173,null));};exports[_0x7721('0x49')]=function(_0x5460cd,_0x578867){return db[_0x7721('0x2c')][_0x7721('0x49')](_0x5460cd[_0x7721('0x4a')],{})[_0x7721('0x24')](respondWithResult(_0x578867,0xc9))['catch'](handleError(_0x578867,null));};exports[_0x7721('0x4b')]=function(_0x2d5a88,_0x56c3d9){if(_0x2d5a88[_0x7721('0x4a')]['id']){delete _0x2d5a88['body']['id'];}return db[_0x7721('0x2c')]['find']({'where':{'id':_0x2d5a88[_0x7721('0x44')]['id']}})[_0x7721('0x24')](handleEntityNotFound(_0x56c3d9,null))[_0x7721('0x24')](saveUpdates(_0x2d5a88['body'],null))[_0x7721('0x24')](respondWithResult(_0x56c3d9,null))[_0x7721('0x42')](handleError(_0x56c3d9,null));};exports['destroy']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x2c')]['find']({'where':{'id':_0x223d93[_0x7721('0x44')]['id']}})['then'](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x24')](removeEntity(_0x1196c2,null))[_0x7721('0x42')](handleError(_0x1196c2,null));};exports[_0x7721('0x4c')]=function(_0x443503,_0x1c95d8){return db[_0x7721('0x2c')][_0x7721('0x4c')]()[_0x7721('0x24')](respondWithResult(_0x1c95d8,null))[_0x7721('0x42')](handleError(_0x1c95d8,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 5d3d086..07c74e3 100644 --- a/server/api/userProfileSection/userProfileSection.model.js +++ b/server/api/userProfileSection/userProfileSection.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30c4=['bluebird','request-promise','rimraf','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','lodash','util','../../config/logger'];(function(_0x48d7ac,_0xc3802a){var _0x296d5e=function(_0x4ed733){while(--_0x4ed733){_0x48d7ac['push'](_0x48d7ac['shift']());}};_0x296d5e(++_0xc3802a);}(_0x30c4,0x152));var _0x430c=function(_0x3219d5,_0x3d9acd){_0x3219d5=_0x3219d5-0x0;var _0x4c2d49=_0x30c4[_0x3219d5];return _0x4c2d49;};'use strict';var _=require(_0x430c('0x0'));var util=require(_0x430c('0x1'));var logger=require(_0x430c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x430c('0x3'));var rp=require(_0x430c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x430c('0x5'));var config=require(_0x430c('0x6'));var attributes=require('./userProfileSection.attributes');module[_0x430c('0x7')]=function(_0x572f9c,_0xa076f2){return _0x572f9c[_0x430c('0x8')](_0x430c('0x9'),attributes,{'tableName':_0x430c('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa863=['rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','userProfileId','util','api','moment','path'];(function(_0x17882c,_0x4b964b){var _0x355a59=function(_0x534b5b){while(--_0x534b5b){_0x17882c['push'](_0x17882c['shift']());}};_0x355a59(++_0x4b964b);}(_0xa863,0x1d0));var _0x3a86=function(_0x2bf153,_0x4f33c6){_0x2bf153=_0x2bf153-0x0;var _0xbbb84=_0xa863[_0x2bf153];return _0xbbb84;};'use strict';var _=require('lodash');var util=require(_0x3a86('0x0'));var logger=require('../../config/logger')(_0x3a86('0x1'));var moment=require(_0x3a86('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a86('0x3'));var rimraf=require(_0x3a86('0x4'));var config=require(_0x3a86('0x5'));var attributes=require(_0x3a86('0x6'));module[_0x3a86('0x7')]=function(_0x107486,_0x1fb484){return _0x107486[_0x3a86('0x8')](_0x3a86('0x9'),attributes,{'tableName':_0x3a86('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0x3a86('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 55f146a..c59bfe3 100644 --- a/server/api/userProfileSection/userProfileSection.rpc.js +++ b/server/api/userProfileSection/userProfileSection.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fe7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fe7,0xe4));var _0x71fe=function(_0x5257e7,_0x5f59c6){_0x5257e7=_0x5257e7-0x0;var _0x279f42=_0x1fe7[_0x5257e7];return _0x279f42;};'use strict';var _=require(_0x71fe('0x0'));var util=require(_0x71fe('0x1'));var moment=require(_0x71fe('0x2'));var BPromise=require(_0x71fe('0x3'));var rs=require(_0x71fe('0x4'));var fs=require('fs');var Redis=require(_0x71fe('0x5'));var db=require(_0x71fe('0x6'))['db'];var utils=require(_0x71fe('0x7'));var logger=require(_0x71fe('0x8'))(_0x71fe('0x9'));var config=require(_0x71fe('0xa'));var jayson=require(_0x71fe('0xb'));var client=jayson[_0x71fe('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x504d06,_0x57011e,_0x5cb5a6){return new BPromise(function(_0x14d036,_0x4f7003){return client[_0x71fe('0xd')](_0x504d06,_0x5cb5a6)[_0x71fe('0xe')](function(_0x3fbbe8){logger[_0x71fe('0xf')](_0x71fe('0x10'),_0x57011e,'request\x20sent');logger[_0x71fe('0x11')](_0x71fe('0x12'),_0x57011e,_0x71fe('0x13'),JSON[_0x71fe('0x14')](_0x3fbbe8));if(_0x3fbbe8[_0x71fe('0x15')]){if(_0x3fbbe8[_0x71fe('0x15')][_0x71fe('0x16')]===0x1f4){logger[_0x71fe('0x15')](_0x71fe('0x10'),_0x57011e,_0x3fbbe8['error'][_0x71fe('0x17')]);return _0x4f7003(_0x3fbbe8['error']['message']);}logger['error'](_0x71fe('0x10'),_0x57011e,_0x3fbbe8[_0x71fe('0x15')][_0x71fe('0x17')]);return _0x14d036(_0x3fbbe8[_0x71fe('0x15')][_0x71fe('0x17')]);}else{logger[_0x71fe('0xf')](_0x71fe('0x10'),_0x57011e,_0x71fe('0x13'));_0x14d036(_0x3fbbe8[_0x71fe('0x18')][_0x71fe('0x17')]);}})[_0x71fe('0x19')](function(_0x1eecbd){logger[_0x71fe('0x15')](_0x71fe('0x10'),_0x57011e,_0x1eecbd);_0x4f7003(_0x1eecbd);});});} \ No newline at end of file +var _0xa7f1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x3c0c60,_0x1f6648){var _0x577e88=function(_0x2c784e){while(--_0x2c784e){_0x3c0c60['push'](_0x3c0c60['shift']());}};_0x577e88(++_0x1f6648);}(_0xa7f1,0xbb));var _0x1a7f=function(_0xfa73ac,_0x2a7395){_0xfa73ac=_0xfa73ac-0x0;var _0x4e8e14=_0xa7f1[_0xfa73ac];return _0x4e8e14;};'use strict';var _=require(_0x1a7f('0x0'));var util=require(_0x1a7f('0x1'));var moment=require('moment');var BPromise=require(_0x1a7f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a7f('0x3'));var db=require(_0x1a7f('0x4'))['db'];var utils=require(_0x1a7f('0x5'));var logger=require(_0x1a7f('0x6'))(_0x1a7f('0x7'));var config=require(_0x1a7f('0x8'));var jayson=require(_0x1a7f('0x9'));var client=jayson[_0x1a7f('0xa')][_0x1a7f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dd37f,_0x4931e5,_0x598ee8){return new BPromise(function(_0x2e3e4c,_0xe78aaf){return client[_0x1a7f('0xc')](_0x1dd37f,_0x598ee8)[_0x1a7f('0xd')](function(_0x461e4d){logger[_0x1a7f('0xe')](_0x1a7f('0xf'),_0x4931e5,'request\x20sent');logger[_0x1a7f('0x10')](_0x1a7f('0x11'),_0x4931e5,'request\x20sent',JSON[_0x1a7f('0x12')](_0x461e4d));if(_0x461e4d[_0x1a7f('0x13')]){if(_0x461e4d[_0x1a7f('0x13')][_0x1a7f('0x14')]===0x1f4){logger[_0x1a7f('0x13')](_0x1a7f('0xf'),_0x4931e5,_0x461e4d['error'][_0x1a7f('0x15')]);return _0xe78aaf(_0x461e4d[_0x1a7f('0x13')][_0x1a7f('0x15')]);}logger['error'](_0x1a7f('0xf'),_0x4931e5,_0x461e4d[_0x1a7f('0x13')][_0x1a7f('0x15')]);return _0x2e3e4c(_0x461e4d[_0x1a7f('0x13')]['message']);}else{logger['info'](_0x1a7f('0xf'),_0x4931e5,'request\x20sent');_0x2e3e4c(_0x461e4d[_0x1a7f('0x16')]['message']);}})[_0x1a7f('0x17')](function(_0x3bd49e){logger[_0x1a7f('0x13')](_0x1a7f('0xf'),_0x4931e5,_0x3bd49e);_0xe78aaf(_0x3bd49e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 8df2a3a..3577c44 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8935=['express','Router','../../components/interaction/service','../../config/environment','multer','connect-timeout'];(function(_0x2ce136,_0x3fc40e){var _0x283a39=function(_0x5dfc92){while(--_0x5dfc92){_0x2ce136['push'](_0x2ce136['shift']());}};_0x283a39(++_0x3fc40e);}(_0x8935,0xbe));var _0x5893=function(_0x52e341,_0x26abb9){_0x52e341=_0x52e341-0x0;var _0x1dc553=_0x8935[_0x52e341];return _0x1dc553;};'use strict';var multer=require(_0x5893('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5893('0x1'));var express=require(_0x5893('0x2'));var router=express[_0x5893('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5893('0x4'));var config=require(_0x5893('0x5'));module['exports']=router; \ No newline at end of file +var _0xad05=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x3d9fef,_0x4020b5){var _0x524921=function(_0x3c634b){while(--_0x3c634b){_0x3d9fef['push'](_0x3d9fef['shift']());}};_0x524921(++_0x4020b5);}(_0xad05,0x1c7));var _0x5ad0=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0xad05[_0x2de0a7];return _0x429437;};'use strict';var multer=require(_0x5ad0('0x0'));var util=require(_0x5ad0('0x1'));var path=require(_0x5ad0('0x2'));var timeout=require(_0x5ad0('0x3'));var express=require(_0x5ad0('0x4'));var router=express[_0x5ad0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5ad0('0x6'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index ea652c9..bcb2de7 100644 --- a/server/api/userSmsQueue/userSmsQueue.attributes.js +++ b/server/api/userSmsQueue/userSmsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['INTEGER','sequelize','exports'];(function(_0x5e542e,_0x38143a){var _0x2d6add=function(_0x43bccd){while(--_0x43bccd){_0x5e542e['push'](_0x5e542e['shift']());}};_0x2d6add(++_0x38143a);}(_0xe706,0xa3));var _0x6e70=function(_0x7902d0,_0x378152){_0x7902d0=_0x7902d0-0x0;var _0x2ab4ac=_0xe706[_0x7902d0];return _0x2ab4ac;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x34960c,_0x265d05){var _0x8e14d8=function(_0x43fc90){while(--_0x43fc90){_0x34960c['push'](_0x34960c['shift']());}};_0x8e14d8(++_0x265d05);}(_0xe706,0xa3));var _0x6e70=function(_0x3cf7df,_0x43b053){_0x3cf7df=_0x3cf7df-0x0;var _0x52ca51=_0xe706[_0x3cf7df];return _0x52ca51;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index cd4cab3..ec3521f 100644 --- a/server/api/userSmsQueue/userSmsQueue.model.js +++ b/server/api/userSmsQueue/userSmsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07ce=['path','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','request-promise'];(function(_0x35a32a,_0x57f736){var _0x30b18e=function(_0x24ecd9){while(--_0x24ecd9){_0x35a32a['push'](_0x35a32a['shift']());}};_0x30b18e(++_0x57f736);}(_0x07ce,0xec));var _0xe07c=function(_0x19dd8e,_0x3da498){_0x19dd8e=_0x19dd8e-0x0;var _0x4e46ea=_0x07ce[_0x19dd8e];return _0x4e46ea;};'use strict';var _=require(_0xe07c('0x0'));var util=require(_0xe07c('0x1'));var logger=require(_0xe07c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe07c('0x3'));var fs=require('fs');var path=require(_0xe07c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe07c('0x5'));module[_0xe07c('0x6')]=function(_0x233928,_0x452875){return _0x233928[_0xe07c('0x7')](_0xe07c('0x8'),attributes,{'tableName':_0xe07c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a29=['./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1fc18b,_0x13d27d){var _0x16a351=function(_0x54a799){while(--_0x54a799){_0x1fc18b['push'](_0x1fc18b['shift']());}};_0x16a351(++_0x13d27d);}(_0x8a29,0x14a));var _0x98a2=function(_0x1e829f,_0x45ed9c){_0x1e829f=_0x1e829f-0x0;var _0x4055d8=_0x8a29[_0x1e829f];return _0x4055d8;};'use strict';var _=require(_0x98a2('0x0'));var util=require(_0x98a2('0x1'));var logger=require(_0x98a2('0x2'))(_0x98a2('0x3'));var moment=require(_0x98a2('0x4'));var BPromise=require(_0x98a2('0x5'));var rp=require(_0x98a2('0x6'));var fs=require('fs');var path=require(_0x98a2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x98a2('0x8'));module[_0x98a2('0x9')]=function(_0x1eb6fb,_0x10389b){return _0x1eb6fb[_0x98a2('0xa')](_0x98a2('0xb'),attributes,{'tableName':_0x98a2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 72496a1..b804f93 100644 --- a/server/api/userSmsQueue/userSmsQueue.rpc.js +++ b/server/api/userSmsQueue/userSmsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5edd=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','randomstring','../../mysqldb'];(function(_0x262007,_0x22defe){var _0x1e419d=function(_0x25861b){while(--_0x25861b){_0x262007['push'](_0x262007['shift']());}};_0x1e419d(++_0x22defe);}(_0x5edd,0x1ad));var _0xd5ed=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x5edd[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd5ed('0x0'));var BPromise=require('bluebird');var rs=require(_0xd5ed('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5ed('0x2'))['db'];var utils=require(_0xd5ed('0x3'));var logger=require(_0xd5ed('0x4'))('rpc');var config=require(_0xd5ed('0x5'));var jayson=require(_0xd5ed('0x6'));var client=jayson[_0xd5ed('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7f4ece,_0x1494e6,_0x3166b2){return new BPromise(function(_0x4ccb58,_0x2e6a80){return client['request'](_0x7f4ece,_0x3166b2)[_0xd5ed('0x8')](function(_0x51c8ca){logger[_0xd5ed('0x9')](_0xd5ed('0xa'),_0x1494e6,_0xd5ed('0xb'));logger['debug'](_0xd5ed('0xc'),_0x1494e6,_0xd5ed('0xb'),JSON[_0xd5ed('0xd')](_0x51c8ca));if(_0x51c8ca[_0xd5ed('0xe')]){if(_0x51c8ca['error'][_0xd5ed('0xf')]===0x1f4){logger[_0xd5ed('0xe')](_0xd5ed('0xa'),_0x1494e6,_0x51c8ca[_0xd5ed('0xe')]['message']);return _0x2e6a80(_0x51c8ca[_0xd5ed('0xe')]['message']);}logger[_0xd5ed('0xe')](_0xd5ed('0xa'),_0x1494e6,_0x51c8ca['error'][_0xd5ed('0x10')]);return _0x4ccb58(_0x51c8ca[_0xd5ed('0xe')][_0xd5ed('0x10')]);}else{logger[_0xd5ed('0x9')](_0xd5ed('0xa'),_0x1494e6,'request\x20sent');_0x4ccb58(_0x51c8ca[_0xd5ed('0x11')][_0xd5ed('0x10')]);}})['catch'](function(_0xdbf41){logger[_0xd5ed('0xe')](_0xd5ed('0xa'),_0x1494e6,_0xdbf41);_0x2e6a80(_0xdbf41);});});} \ No newline at end of file +var _0x7697=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x3b517c,_0x533b4e){var _0x5cc760=function(_0x5c9210){while(--_0x5c9210){_0x3b517c['push'](_0x3b517c['shift']());}};_0x5cc760(++_0x533b4e);}(_0x7697,0x66));var _0x7769=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x7697[_0x19b3f9];return _0x18c3f6;};'use strict';var _=require('lodash');var util=require(_0x7769('0x0'));var moment=require(_0x7769('0x1'));var BPromise=require(_0x7769('0x2'));var rs=require(_0x7769('0x3'));var fs=require('fs');var Redis=require(_0x7769('0x4'));var db=require(_0x7769('0x5'))['db'];var utils=require(_0x7769('0x6'));var logger=require(_0x7769('0x7'))(_0x7769('0x8'));var config=require(_0x7769('0x9'));var jayson=require(_0x7769('0xa'));var client=jayson['client'][_0x7769('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12cc92,_0x1e2e5d,_0x243080){return new BPromise(function(_0x80f875,_0x4c18a0){return client[_0x7769('0xc')](_0x12cc92,_0x243080)['then'](function(_0x1bb984){logger[_0x7769('0xd')](_0x7769('0xe'),_0x1e2e5d,_0x7769('0xf'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x1e2e5d,_0x7769('0xf'),JSON[_0x7769('0x10')](_0x1bb984));if(_0x1bb984[_0x7769('0x11')]){if(_0x1bb984[_0x7769('0x11')][_0x7769('0x12')]===0x1f4){logger[_0x7769('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x1e2e5d,_0x1bb984[_0x7769('0x11')][_0x7769('0x13')]);return _0x4c18a0(_0x1bb984[_0x7769('0x11')]['message']);}logger[_0x7769('0x11')](_0x7769('0xe'),_0x1e2e5d,_0x1bb984[_0x7769('0x11')]['message']);return _0x80f875(_0x1bb984[_0x7769('0x11')]['message']);}else{logger[_0x7769('0xd')](_0x7769('0xe'),_0x1e2e5d,'request\x20sent');_0x80f875(_0x1bb984['result'][_0x7769('0x13')]);}})[_0x7769('0x14')](function(_0x3a54ad){logger[_0x7769('0x11')](_0x7769('0xe'),_0x1e2e5d,_0x3a54ad);_0x4c18a0(_0x3a54ad);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index b7691f4..aa31d48 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x320b=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x3d7f7d,_0x5d57d7){var _0x59c78b=function(_0x34f2bf){while(--_0x34f2bf){_0x3d7f7d['push'](_0x3d7f7d['shift']());}};_0x59c78b(++_0x5d57d7);}(_0x320b,0x137));var _0xb320=function(_0x3cd91d,_0x163516){_0x3cd91d=_0x3cd91d-0x0;var _0x3b4fab=_0x320b[_0x3cd91d];return _0x3b4fab;};'use strict';var multer=require(_0xb320('0x0'));var util=require(_0xb320('0x1'));var path=require(_0xb320('0x2'));var timeout=require('connect-timeout');var express=require(_0xb320('0x3'));var router=express['Router']();var auth=require(_0xb320('0x4'));var interaction=require(_0xb320('0x5'));var config=require(_0xb320('0x6'));module[_0xb320('0x7')]=router; \ No newline at end of file +var _0x3a8c=['../../config/environment','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x147078,_0x4e509c){var _0x2d2f5c=function(_0x231582){while(--_0x231582){_0x147078['push'](_0x147078['shift']());}};_0x2d2f5c(++_0x4e509c);}(_0x3a8c,0x18a));var _0xc3a8=function(_0x2e0756,_0x17a9cf){_0x2e0756=_0x2e0756-0x0;var _0x2e54d9=_0x3a8c[_0x2e0756];return _0x2e54d9;};'use strict';var multer=require(_0xc3a8('0x0'));var util=require(_0xc3a8('0x1'));var path=require(_0xc3a8('0x2'));var timeout=require(_0xc3a8('0x3'));var express=require('express');var router=express[_0xc3a8('0x4')]();var auth=require(_0xc3a8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc3a8('0x6'));module[_0xc3a8('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 6591853..4f42595 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js +++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x2465c6,_0x412a0a){var _0x28b33c=function(_0x52220f){while(--_0x52220f){_0x2465c6['push'](_0x2465c6['shift']());}};_0x28b33c(++_0x412a0a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x44b0bb,_0x1fd4e0){var _0x2c4b04=function(_0x3fe496){while(--_0x3fe496){_0x44b0bb['push'](_0x44b0bb['shift']());}};_0x2c4b04(++_0x1fd4e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 49cce97..a012cbf 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.model.js +++ b/server/api/userVoiceQueue/userVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ad3=['user_has_voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define'];(function(_0xd257f8,_0x32ab2e){var _0x24afa2=function(_0x157d54){while(--_0x157d54){_0xd257f8['push'](_0xd257f8['shift']());}};_0x24afa2(++_0x32ab2e);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x4f3b2d,_0x3bbf46){_0x4f3b2d=_0x4f3b2d-0x0;var _0x3dddfa=_0x5ad3[_0x4f3b2d];return _0x3dddfa;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var logger=require(_0x35ad('0x2'))(_0x35ad('0x3'));var moment=require('moment');var BPromise=require(_0x35ad('0x4'));var rp=require(_0x35ad('0x5'));var fs=require('fs');var path=require(_0x35ad('0x6'));var rimraf=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var attributes=require(_0x35ad('0x9'));module[_0x35ad('0xa')]=function(_0x436dcb,_0x36c606){return _0x436dcb[_0x35ad('0xb')]('UserVoiceQueue',attributes,{'tableName':_0x35ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','util'];(function(_0xdddd2f,_0x21a682){var _0x39dbbe=function(_0x5b7b45){while(--_0x5b7b45){_0xdddd2f['push'](_0xdddd2f['shift']());}};_0x39dbbe(++_0x21a682);}(_0x9f62,0x154));var _0x29f6=function(_0x12710c,_0x398fae){_0x12710c=_0x12710c-0x0;var _0x2f4c55=_0x9f62[_0x12710c];return _0x2f4c55;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index ee4659b..231a1c0 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.rpc.js +++ b/server/api/userVoiceQueue/userVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91b2=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x132f75,_0x3b8965){var _0x1879da=function(_0xfff743){while(--_0xfff743){_0x132f75['push'](_0x132f75['shift']());}};_0x1879da(++_0x3b8965);}(_0x91b2,0x99));var _0x291b=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x91b2[_0x47e549];return _0x251374;};'use strict';var _=require(_0x291b('0x0'));var util=require(_0x291b('0x1'));var moment=require(_0x291b('0x2'));var BPromise=require(_0x291b('0x3'));var rs=require(_0x291b('0x4'));var fs=require('fs');var Redis=require(_0x291b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x291b('0x6'))(_0x291b('0x7'));var config=require(_0x291b('0x8'));var jayson=require(_0x291b('0x9'));var client=jayson[_0x291b('0xa')][_0x291b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a47ca,_0x591688,_0x26138f){return new BPromise(function(_0x33c296,_0x21e2ab){return client[_0x291b('0xc')](_0x2a47ca,_0x26138f)['then'](function(_0x483474){logger[_0x291b('0xd')](_0x291b('0xe'),_0x591688,'request\x20sent');logger['debug'](_0x291b('0xf'),_0x591688,'request\x20sent',JSON[_0x291b('0x10')](_0x483474));if(_0x483474['error']){if(_0x483474[_0x291b('0x11')][_0x291b('0x12')]===0x1f4){logger[_0x291b('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x591688,_0x483474[_0x291b('0x11')][_0x291b('0x13')]);return _0x21e2ab(_0x483474[_0x291b('0x11')][_0x291b('0x13')]);}logger[_0x291b('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x591688,_0x483474[_0x291b('0x11')][_0x291b('0x13')]);return _0x33c296(_0x483474[_0x291b('0x11')]['message']);}else{logger[_0x291b('0xd')](_0x291b('0xe'),_0x591688,'request\x20sent');_0x33c296(_0x483474[_0x291b('0x14')][_0x291b('0x13')]);}})[_0x291b('0x15')](function(_0x1b3e71){logger[_0x291b('0x11')](_0x291b('0xe'),_0x591688,_0x1b3e71);_0x21e2ab(_0x1b3e71);});});} \ No newline at end of file +var _0x9f35=['message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5ce03c,_0x4e2d5b){var _0x3cc46d=function(_0x3e07ba){while(--_0x3e07ba){_0x5ce03c['push'](_0x5ce03c['shift']());}};_0x3cc46d(++_0x4e2d5b);}(_0x9f35,0xfe));var _0x59f3=function(_0x45903f,_0x1c0ea0){_0x45903f=_0x45903f-0x0;var _0x3c131d=_0x9f35[_0x45903f];return _0x3c131d;};'use strict';var _=require('lodash');var util=require(_0x59f3('0x0'));var moment=require(_0x59f3('0x1'));var BPromise=require('bluebird');var rs=require(_0x59f3('0x2'));var fs=require('fs');var Redis=require(_0x59f3('0x3'));var db=require(_0x59f3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x59f3('0x5'))(_0x59f3('0x6'));var config=require(_0x59f3('0x7'));var jayson=require(_0x59f3('0x8'));var client=jayson[_0x59f3('0x9')][_0x59f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfc7110,_0x18390a,_0x3f6a00){return new BPromise(function(_0x4e7971,_0x7c7bf8){return client[_0x59f3('0xb')](_0xfc7110,_0x3f6a00)[_0x59f3('0xc')](function(_0x547bf4){logger[_0x59f3('0xd')](_0x59f3('0xe'),_0x18390a,'request\x20sent');logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x18390a,_0x59f3('0xf'),JSON[_0x59f3('0x10')](_0x547bf4));if(_0x547bf4[_0x59f3('0x11')]){if(_0x547bf4[_0x59f3('0x11')][_0x59f3('0x12')]===0x1f4){logger[_0x59f3('0x11')](_0x59f3('0xe'),_0x18390a,_0x547bf4['error']['message']);return _0x7c7bf8(_0x547bf4[_0x59f3('0x11')]['message']);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x18390a,_0x547bf4[_0x59f3('0x11')][_0x59f3('0x13')]);return _0x4e7971(_0x547bf4[_0x59f3('0x11')][_0x59f3('0x13')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x18390a,_0x59f3('0xf'));_0x4e7971(_0x547bf4[_0x59f3('0x14')][_0x59f3('0x13')]);}})['catch'](function(_0x5a876){logger[_0x59f3('0x11')](_0x59f3('0xe'),_0x18390a,_0x5a876);_0x7c7bf8(_0x5a876);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 22fc9b0..536722d 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x262a=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x1637e0,_0x1c956b){var _0x46ce9c=function(_0x44e0a1){while(--_0x44e0a1){_0x1637e0['push'](_0x1637e0['shift']());}};_0x46ce9c(++_0x1c956b);}(_0x262a,0x178));var _0xa262=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x262a[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0xa262('0x0'));var util=require(_0xa262('0x1'));var path=require(_0xa262('0x2'));var timeout=require(_0xa262('0x3'));var express=require(_0xa262('0x4'));var router=express[_0xa262('0x5')]();var auth=require(_0xa262('0x6'));var interaction=require(_0xa262('0x7'));var config=require(_0xa262('0x8'));module[_0xa262('0x9')]=router; \ No newline at end of file +var _0xffc4=['util','connect-timeout','express','Router','../../config/environment','multer'];(function(_0x418a35,_0x44ba22){var _0x2da4b7=function(_0x1f8832){while(--_0x1f8832){_0x418a35['push'](_0x418a35['shift']());}};_0x2da4b7(++_0x44ba22);}(_0xffc4,0x19d));var _0x4ffc=function(_0x139e4c,_0x324f74){_0x139e4c=_0x139e4c-0x0;var _0x52eede=_0xffc4[_0x139e4c];return _0x52eede;};'use strict';var multer=require(_0x4ffc('0x0'));var util=require(_0x4ffc('0x1'));var path=require('path');var timeout=require(_0x4ffc('0x2'));var express=require(_0x4ffc('0x3'));var router=express[_0x4ffc('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ffc('0x5'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 8eede61..2b00825 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x156c=['queue_interface','Required\x20by\x20Asterisk','sequelize','exports','INTEGER','STRING'];(function(_0x5cb25d,_0x1619f2){var _0x4d2b31=function(_0x585a94){while(--_0x585a94){_0x5cb25d['push'](_0x5cb25d['shift']());}};_0x4d2b31(++_0x1619f2);}(_0x156c,0x1d6));var _0xc156=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0x156c[_0x1af05b];return _0x5be7cc;};'use strict';var Sequelize=require(_0xc156('0x0'));module[_0xc156('0x1')]={'uniqueid':{'type':Sequelize[_0xc156('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xc156('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xc156('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xc156('0x3')],'allowNull':![],'unique':_0xc156('0x4'),'comment':_0xc156('0x5')},'VoiceQueueId':{'type':Sequelize[_0xc156('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xc156('0x3')],'allowNull':![],'unique':_0xc156('0x4'),'comment':_0xc156('0x5')},'penalty':{'type':Sequelize[_0xc156('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xc156('0x2')](0xb),'defaultValue':0x0,'comment':_0xc156('0x5')}}; \ No newline at end of file +var _0x07e0=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x40130c,_0x3f78a9){var _0x3a913e=function(_0x22286c){while(--_0x22286c){_0x40130c['push'](_0x40130c['shift']());}};_0x3a913e(++_0x3f78a9);}(_0x07e0,0x1e5));var _0x007e=function(_0x169790,_0x48aa33){_0x169790=_0x169790-0x0;var _0x4d0f36=_0x07e0[_0x169790];return _0x4d0f36;};'use strict';var Sequelize=require(_0x007e('0x0'));module[_0x007e('0x1')]={'uniqueid':{'type':Sequelize[_0x007e('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x007e('0x3')},'membername':{'type':Sequelize[_0x007e('0x4')],'allowNull':![],'comment':_0x007e('0x3')},'UserId':{'type':Sequelize[_0x007e('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x007e('0x5'),'comment':_0x007e('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x007e('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x007e('0x3')},'penalty':{'type':Sequelize[_0x007e('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x007e('0x2')](0xb),'defaultValue':0x0,'comment':_0x007e('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 1b65c4e..b6c7eab 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8604=['exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','update','remove','hasOwnProperty','hook'];(function(_0x423696,_0x2640f3){var _0x214cad=function(_0x57b774){while(--_0x57b774){_0x423696['push'](_0x423696['shift']());}};_0x214cad(++_0x2640f3);}(_0x8604,0x160));var _0x4860=function(_0xa464a1,_0x4ec344){_0xa464a1=_0xa464a1-0x0;var _0x19e814=_0x8604[_0xa464a1];return _0x19e814;};'use strict';var EventEmitter=require(_0x4860('0x0'));var UserVoiceQueueRt=require(_0x4860('0x1'))['db'][_0x4860('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4860('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4860('0x4'),'afterDestroy':_0x4860('0x5')};function emitEvent(_0x6ddbf){return function(_0x20a03d,_0x2e0f07,_0xce3617){UserVoiceQueueRtEvents['emit'](_0x6ddbf+':'+_0x20a03d['id'],_0x20a03d);UserVoiceQueueRtEvents['emit'](_0x6ddbf,_0x20a03d);_0xce3617(null);};}for(var e in events){if(events[_0x4860('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x4860('0x7')](e,emitEvent(event));}}module[_0x4860('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x2488=['exports','events','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hook'];(function(_0x37e1e3,_0x39c403){var _0x4cc2d7=function(_0x44dbe9){while(--_0x44dbe9){_0x37e1e3['push'](_0x37e1e3['shift']());}};_0x4cc2d7(++_0x39c403);}(_0x2488,0x1f0));var _0x8248=function(_0x4945da,_0x2ecb03){_0x4945da=_0x4945da-0x0;var _0x24460c=_0x2488[_0x4945da];return _0x24460c;};'use strict';var EventEmitter=require(_0x8248('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x8248('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x8248('0x2')](0x0);var events={'afterCreate':_0x8248('0x3'),'afterUpdate':_0x8248('0x4'),'afterDestroy':_0x8248('0x5')};function emitEvent(_0x429784){return function(_0x186ee8,_0x4c633c,_0xca6032){UserVoiceQueueRtEvents[_0x8248('0x6')](_0x429784+':'+_0x186ee8['id'],_0x186ee8);UserVoiceQueueRtEvents['emit'](_0x429784,_0x186ee8);_0xca6032(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x8248('0x7')](e,emitEvent(event));}}module[_0x8248('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index da40deb..751a479 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c4f=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x37b022,_0x742861){var _0x3b6c68=function(_0x420316){while(--_0x420316){_0x37b022['push'](_0x37b022['shift']());}};_0x3b6c68(++_0x742861);}(_0x4c4f,0xfb));var _0xf4c4=function(_0x1d7d78,_0x4c3d01){_0x1d7d78=_0x1d7d78-0x0;var _0x4a5baf=_0x4c4f[_0x1d7d78];return _0x4a5baf;};'use strict';var _=require(_0xf4c4('0x0'));var util=require(_0xf4c4('0x1'));var logger=require(_0xf4c4('0x2'))(_0xf4c4('0x3'));var moment=require(_0xf4c4('0x4'));var BPromise=require('bluebird');var rp=require(_0xf4c4('0x5'));var fs=require('fs');var path=require(_0xf4c4('0x6'));var rimraf=require('rimraf');var config=require(_0xf4c4('0x7'));var attributes=require(_0xf4c4('0x8'));module[_0xf4c4('0x9')]=function(_0x46a0cd,_0x552a6c){return _0x46a0cd['define'](_0xf4c4('0xa'),attributes,{'tableName':_0xf4c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2917=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','user_has_voice_queues_rt'];(function(_0x1ebd00,_0x396bd6){var _0x35f09f=function(_0x25a244){while(--_0x25a244){_0x1ebd00['push'](_0x1ebd00['shift']());}};_0x35f09f(++_0x396bd6);}(_0x2917,0x1b8));var _0x7291=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0x2917[_0x5c4e16];return _0x36044a;};'use strict';var _=require(_0x7291('0x0'));var util=require(_0x7291('0x1'));var logger=require(_0x7291('0x2'))(_0x7291('0x3'));var moment=require('moment');var BPromise=require(_0x7291('0x4'));var rp=require(_0x7291('0x5'));var fs=require('fs');var path=require(_0x7291('0x6'));var rimraf=require('rimraf');var config=require(_0x7291('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x7291('0x8')]=function(_0x45ffd4,_0x2763d8){return _0x45ffd4[_0x7291('0x9')]('UserVoiceQueueRt',attributes,{'tableName':_0x7291('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 096658c..449a2f0 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfef5=['UserVoiceQueueRt','findAll','options','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','GetVoiceQueueRtPauses'];(function(_0x441eab,_0x583ba5){var _0xe6ff41=function(_0x98c274){while(--_0x98c274){_0x441eab['push'](_0x441eab['shift']());}};_0xe6ff41(++_0x583ba5);}(_0xfef5,0x1ac));var _0x5fef=function(_0x57237b,_0x51f8b4){_0x57237b=_0x57237b-0x0;var _0x57e431=_0xfef5[_0x57237b];return _0x57e431;};'use strict';var _=require(_0x5fef('0x0'));var util=require(_0x5fef('0x1'));var moment=require('moment');var BPromise=require(_0x5fef('0x2'));var rs=require(_0x5fef('0x3'));var fs=require('fs');var Redis=require(_0x5fef('0x4'));var db=require(_0x5fef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fef('0x6'))(_0x5fef('0x7'));var config=require(_0x5fef('0x8'));var jayson=require(_0x5fef('0x9'));var client=jayson[_0x5fef('0xa')]['http']({'port':0x232a});config[_0x5fef('0xb')]=_[_0x5fef('0xc')](config['redis'],{'host':_0x5fef('0xd'),'port':0x18eb});var socket=require(_0x5fef('0xe'))(new Redis(config[_0x5fef('0xb')]));require(_0x5fef('0xf'))[_0x5fef('0x10')](socket);function respondWithRpcPromise(_0x1cc2f5,_0x5e31a3,_0x3a7670){return new BPromise(function(_0xbaeaa1,_0x544178){return client['request'](_0x1cc2f5,_0x3a7670)[_0x5fef('0x11')](function(_0x4a411e){logger['info'](_0x5fef('0x12'),_0x5e31a3,'request\x20sent');logger[_0x5fef('0x13')](_0x5fef('0x14'),_0x5e31a3,_0x5fef('0x15'),JSON['stringify'](_0x4a411e));if(_0x4a411e[_0x5fef('0x16')]){if(_0x4a411e[_0x5fef('0x16')][_0x5fef('0x17')]===0x1f4){logger[_0x5fef('0x16')](_0x5fef('0x12'),_0x5e31a3,_0x4a411e[_0x5fef('0x16')]['message']);return _0x544178(_0x4a411e[_0x5fef('0x16')]['message']);}logger[_0x5fef('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5e31a3,_0x4a411e[_0x5fef('0x16')][_0x5fef('0x18')]);return _0xbaeaa1(_0x4a411e[_0x5fef('0x16')]['message']);}else{logger[_0x5fef('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5e31a3,_0x5fef('0x15'));_0xbaeaa1(_0x4a411e['result']['message']);}})[_0x5fef('0x1a')](function(_0x4d99e3){logger['error'](_0x5fef('0x12'),_0x5e31a3,_0x4d99e3);_0x544178(_0x4d99e3);});});}exports[_0x5fef('0x1b')]=function(_0x1fe82e){var _0x114c9f=this;return new Promise(function(_0x4b7784,_0x31cc71){return db[_0x5fef('0x1c')][_0x5fef('0x1d')]({'raw':_0x1fe82e[_0x5fef('0x1e')]?_0x1fe82e['options']['raw']===undefined?!![]:![]:!![],'where':_0x1fe82e[_0x5fef('0x1e')]?_0x1fe82e[_0x5fef('0x1e')][_0x5fef('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x5fef('0x20'),db[_0x5fef('0x21')]['fn']('IF',db[_0x5fef('0x21')][_0x5fef('0x22')](_0x5fef('0x23')))),_0x5fef('0x24')]]})[_0x5fef('0x11')](function(_0x1fa01b){logger[_0x5fef('0x19')]('GetVoiceQueueRtPauses',_0x1fe82e);logger[_0x5fef('0x13')](_0x5fef('0x1b'),_0x1fe82e,JSON[_0x5fef('0x25')](_0x1fa01b));_0x4b7784(_0x1fa01b);})[_0x5fef('0x1a')](function(_0x152b83){logger[_0x5fef('0x16')](_0x5fef('0x1b'),_0x152b83['message'],_0x1fe82e);_0x31cc71(_0x114c9f['error'](0x1f4,_0x152b83[_0x5fef('0x18')]));});});}; \ No newline at end of file +var _0x8529=['socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults'];(function(_0x6143bc,_0x547322){var _0x277165=function(_0x3a9a79){while(--_0x3a9a79){_0x6143bc['push'](_0x6143bc['shift']());}};_0x277165(++_0x547322);}(_0x8529,0x138));var _0x9852=function(_0x46e0f8,_0x1bc18e){_0x46e0f8=_0x46e0f8-0x0;var _0x362605=_0x8529[_0x46e0f8];return _0x362605;};'use strict';var _=require(_0x9852('0x0'));var util=require(_0x9852('0x1'));var moment=require(_0x9852('0x2'));var BPromise=require(_0x9852('0x3'));var rs=require(_0x9852('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9852('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9852('0x6'))(_0x9852('0x7'));var config=require('../../config/environment');var jayson=require(_0x9852('0x8'));var client=jayson[_0x9852('0x9')]['http']({'port':0x232a});config[_0x9852('0xa')]=_[_0x9852('0xb')](config[_0x9852('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9852('0xc'))(new Redis(config['redis']));require(_0x9852('0xd'))[_0x9852('0xe')](socket);function respondWithRpcPromise(_0xae1a9c,_0x3ebffc,_0xf89160){return new BPromise(function(_0x1465d0,_0xf9eafc){return client['request'](_0xae1a9c,_0xf89160)[_0x9852('0xf')](function(_0x4f33ca){logger[_0x9852('0x10')](_0x9852('0x11'),_0x3ebffc,_0x9852('0x12'));logger[_0x9852('0x13')](_0x9852('0x14'),_0x3ebffc,'request\x20sent',JSON[_0x9852('0x15')](_0x4f33ca));if(_0x4f33ca[_0x9852('0x16')]){if(_0x4f33ca[_0x9852('0x16')][_0x9852('0x17')]===0x1f4){logger['error'](_0x9852('0x11'),_0x3ebffc,_0x4f33ca[_0x9852('0x16')][_0x9852('0x18')]);return _0xf9eafc(_0x4f33ca[_0x9852('0x16')][_0x9852('0x18')]);}logger['error'](_0x9852('0x11'),_0x3ebffc,_0x4f33ca[_0x9852('0x16')][_0x9852('0x18')]);return _0x1465d0(_0x4f33ca[_0x9852('0x16')]['message']);}else{logger[_0x9852('0x10')](_0x9852('0x11'),_0x3ebffc,'request\x20sent');_0x1465d0(_0x4f33ca[_0x9852('0x19')]['message']);}})[_0x9852('0x1a')](function(_0x19997b){logger[_0x9852('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3ebffc,_0x19997b);_0xf9eafc(_0x19997b);});});}exports[_0x9852('0x1b')]=function(_0x2d0faa){var _0x32287b=this;return new Promise(function(_0x4935cb,_0x2c60b4){return db[_0x9852('0x1c')]['findAll']({'raw':_0x2d0faa[_0x9852('0x1d')]?_0x2d0faa[_0x9852('0x1d')][_0x9852('0x1e')]===undefined?!![]:![]:!![],'where':_0x2d0faa[_0x9852('0x1d')]?_0x2d0faa[_0x9852('0x1d')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x9852('0x1f'),db[_0x9852('0x20')]['fn']('IF',db[_0x9852('0x20')][_0x9852('0x21')](_0x9852('0x22')))),_0x9852('0x23')]]})[_0x9852('0xf')](function(_0x2e0195){logger[_0x9852('0x10')](_0x9852('0x1b'),_0x2d0faa);logger[_0x9852('0x13')](_0x9852('0x1b'),_0x2d0faa,JSON['stringify'](_0x2e0195));_0x4935cb(_0x2e0195);})['catch'](function(_0x5d4c29){logger[_0x9852('0x16')](_0x9852('0x1b'),_0x5d4c29[_0x9852('0x18')],_0x2d0faa);_0x2c60b4(_0x32287b[_0x9852('0x16')](0x1f4,_0x5d4c29[_0x9852('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index c29d32d..891a59e 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9002=['update','emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x32ab87,_0x5803d0){var _0x5ae2b0=function(_0x3af5d3){while(--_0x3af5d3){_0x32ab87['push'](_0x32ab87['shift']());}};_0x5ae2b0(++_0x5803d0);}(_0x9002,0xde));var _0x2900=function(_0x209635,_0x4494fe){_0x209635=_0x209635-0x0;var _0x28e00a=_0x9002[_0x209635];return _0x28e00a;};'use strict';var UserVoiceQueueRtEvents=require(_0x2900('0x0'));var events=[_0x2900('0x1'),_0x2900('0x2'),_0x2900('0x3')];function createListener(_0x5c866a,_0x1972da){return function(_0x48b978){_0x1972da[_0x2900('0x4')](_0x5c866a,_0x48b978);};}function removeListener(_0x4d4415,_0x5ac280){return function(){UserVoiceQueueRtEvents[_0x2900('0x5')](_0x4d4415,_0x5ac280);};}exports[_0x2900('0x6')]=function(_0x16a8dc){for(var _0x132e29=0x0,_0x1edc70=events[_0x2900('0x7')];_0x132e29<_0x1edc70;_0x132e29++){var _0xd0af38=events[_0x132e29];var _0x1227cc=createListener(_0x2900('0x8')+_0xd0af38,_0x16a8dc);UserVoiceQueueRtEvents['on'](_0xd0af38,_0x1227cc);}}; \ No newline at end of file +var _0x1ac2=['length','userVoiceQueueRt:','save','removeListener','register'];(function(_0x4982a3,_0xc7d7d8){var _0x3a02ed=function(_0x2c7ccb){while(--_0x2c7ccb){_0x4982a3['push'](_0x4982a3['shift']());}};_0x3a02ed(++_0xc7d7d8);}(_0x1ac2,0x1e2));var _0x21ac=function(_0x34fd8f,_0x1f490b){_0x34fd8f=_0x34fd8f-0x0;var _0x5f2057=_0x1ac2[_0x34fd8f];return _0x5f2057;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x21ac('0x0'),'remove','update'];function createListener(_0x1ae77,_0x2cb875){return function(_0x4eb9a6){_0x2cb875['emit'](_0x1ae77,_0x4eb9a6);};}function removeListener(_0x443176,_0x474984){return function(){UserVoiceQueueRtEvents[_0x21ac('0x1')](_0x443176,_0x474984);};}exports[_0x21ac('0x2')]=function(_0x5485a1){for(var _0x1ae510=0x0,_0x187ad5=events[_0x21ac('0x3')];_0x1ae510<_0x187ad5;_0x1ae510++){var _0x50aeb3=events[_0x1ae510];var _0x596bc4=createListener(_0x21ac('0x4')+_0x50aeb3,_0x5485a1);UserVoiceQueueRtEvents['on'](_0x50aeb3,_0x596bc4);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 842e9a3..4e316dd 100644 --- a/server/api/variable/index.js +++ b/server/api/variable/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeef7=['../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','put','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x48c482,_0x4407a0){var _0x360d4e=function(_0xac2a44){while(--_0xac2a44){_0x48c482['push'](_0x48c482['shift']());}};_0x360d4e(++_0x4407a0);}(_0xeef7,0x79));var _0x7eef=function(_0x179971,_0x2df84e){_0x179971=_0x179971-0x0;var _0x2d47c3=_0xeef7[_0x179971];return _0x2d47c3;};'use strict';var multer=require(_0x7eef('0x0'));var util=require(_0x7eef('0x1'));var path=require(_0x7eef('0x2'));var timeout=require('connect-timeout');var express=require(_0x7eef('0x3'));var router=express[_0x7eef('0x4')]();var auth=require(_0x7eef('0x5'));var interaction=require(_0x7eef('0x6'));var config=require(_0x7eef('0x7'));var controller=require(_0x7eef('0x8'));router[_0x7eef('0x9')]('/',auth[_0x7eef('0xa')](),controller['index']);router[_0x7eef('0x9')](_0x7eef('0xb'),auth[_0x7eef('0xa')](),controller[_0x7eef('0xc')]);router['post']('/',auth[_0x7eef('0xa')](),controller['create']);router[_0x7eef('0xd')]('/:id',auth[_0x7eef('0xa')](),controller['update']);router[_0x7eef('0xe')](_0x7eef('0xb'),auth[_0x7eef('0xa')](),controller[_0x7eef('0xf')]);module['exports']=router; \ No newline at end of file +var _0x08bf=['create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x31c269,_0x58f97e){var _0x475bbf=function(_0x1cd9b4){while(--_0x1cd9b4){_0x31c269['push'](_0x31c269['shift']());}};_0x475bbf(++_0x58f97e);}(_0x08bf,0x109));var _0xf08b=function(_0x1ab5a7,_0x1e1274){_0x1ab5a7=_0x1ab5a7-0x0;var _0x4d5485=_0x08bf[_0x1ab5a7];return _0x4d5485;};'use strict';var multer=require(_0xf08b('0x0'));var util=require(_0xf08b('0x1'));var path=require(_0xf08b('0x2'));var timeout=require(_0xf08b('0x3'));var express=require(_0xf08b('0x4'));var router=express['Router']();var auth=require(_0xf08b('0x5'));var interaction=require(_0xf08b('0x6'));var config=require(_0xf08b('0x7'));var controller=require(_0xf08b('0x8'));router[_0xf08b('0x9')]('/',auth[_0xf08b('0xa')](),controller[_0xf08b('0xb')]);router[_0xf08b('0x9')](_0xf08b('0xc'),auth[_0xf08b('0xa')](),controller[_0xf08b('0xd')]);router[_0xf08b('0xe')]('/',auth[_0xf08b('0xa')](),controller[_0xf08b('0xf')]);router[_0xf08b('0x10')](_0xf08b('0xc'),auth['isAuthenticated'](),controller[_0xf08b('0x11')]);router[_0xf08b('0x12')](_0xf08b('0xc'),auth[_0xf08b('0xa')](),controller['destroy']);module[_0xf08b('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index eb6bc9d..5bd32b8 100644 --- a/server/api/variable/variable.attributes.js +++ b/server/api/variable/variable.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x395b=['sequelize','exports','STRING','name'];(function(_0x4aee2c,_0x2209fa){var _0x5cd49b=function(_0x2c2b85){while(--_0x2c2b85){_0x4aee2c['push'](_0x4aee2c['shift']());}};_0x5cd49b(++_0x2209fa);}(_0x395b,0xc0));var _0xb395=function(_0x57d71f,_0x598a0e){_0x57d71f=_0x57d71f-0x0;var _0x2d1d26=_0x395b[_0x57d71f];return _0x2d1d26;};'use strict';var Sequelize=require(_0xb395('0x0'));module[_0xb395('0x1')]={'name':{'type':Sequelize[_0xb395('0x2')],'unique':_0xb395('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe25f=['exports','name','STRING','sequelize'];(function(_0x4a6224,_0xcc3344){var _0x5bcd50=function(_0x2f1db8){while(--_0x2f1db8){_0x4a6224['push'](_0x4a6224['shift']());}};_0x5bcd50(++_0xcc3344);}(_0xe25f,0x6b));var _0xfe25=function(_0x287894,_0x30e799){_0x287894=_0x287894-0x0;var _0xde9bf6=_0xe25f[_0x287894];return _0xde9bf6;};'use strict';var Sequelize=require(_0xfe25('0x0'));module[_0xfe25('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfe25('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfe25('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index c6f525a..0fb68cb 100644 --- a/server/api/variable/variable.controller.js +++ b/server/api/variable/variable.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa81b=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','apply','reject','save','update','destroy','then','get','Variables','UserProfileResource','error','stack','name','send','index','rawAttributes','keys','intersection','query','attributes','model','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','Variable','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x470212,_0x1387de){var _0x5083cb=function(_0x3bec27){while(--_0x3bec27){_0x470212['push'](_0x470212['shift']());}};_0x5083cb(++_0x1387de);}(_0xa81b,0x9b));var _0xba81=function(_0xb247e3,_0x1319d1){_0xb247e3=_0xb247e3-0x0;var _0x57fb7b=_0xa81b[_0xb247e3];return _0x57fb7b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xba81('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xba81('0x1'));var Mustache=require('mustache');var util=require(_0xba81('0x2'));var path=require(_0xba81('0x3'));var sox=require(_0xba81('0x4'));var csv=require(_0xba81('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xba81('0x6'));var squel=require('squel');var crypto=require(_0xba81('0x7'));var jsforce=require(_0xba81('0x8'));var deskjs=require(_0xba81('0x9'));var toCsv=require('to-csv');var querystring=require(_0xba81('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xba81('0xb'));var hardwareService=require(_0xba81('0xc'));var logger=require(_0xba81('0xd'))('api');var utils=require(_0xba81('0xe'));var config=require(_0xba81('0xf'));var db=require(_0xba81('0x10'))['db'];function respondWithStatusCode(_0x41f74b,_0x599bee){_0x599bee=_0x599bee||0xcc;return function(_0x43d8ae){if(_0x43d8ae){return _0x41f74b[_0xba81('0x11')](_0x599bee);}return _0x41f74b[_0xba81('0x12')](_0x599bee)[_0xba81('0x13')]();};}function respondWithResult(_0x43af9e,_0x21253f){_0x21253f=_0x21253f||0xc8;return function(_0x4ec0ca){if(_0x4ec0ca){return _0x43af9e[_0xba81('0x12')](_0x21253f)['json'](_0x4ec0ca);}};}function respondWithFilteredResult(_0x8395b0,_0x334b91){return function(_0x4a2676){if(_0x4a2676){var _0x3d3e43=_0x4a2676[_0xba81('0x14')],_0x129459=_0x334b91[_0xba81('0x15')],_0x4f7060=_0x334b91[_0xba81('0x15')]+_0x334b91['limit'],_0x1d431c;if(_0x4f7060>=_0x3d3e43){_0x4f7060=_0x3d3e43;_0x1d431c=0xc8;}else{_0x1d431c=0xce;}_0x8395b0['status'](_0x1d431c);return _0x8395b0[_0xba81('0x16')]('Content-Range',_0x129459+'-'+_0x4f7060+'/'+_0x3d3e43)['json'](_0x4a2676);}return null;};}function patchUpdates(_0x3f77b5){return function(_0x39cda6){try{jsonpatch[_0xba81('0x17')](_0x39cda6,_0x3f77b5,!![]);}catch(_0x5731b5){return BPromise[_0xba81('0x18')](_0x5731b5);}return _0x39cda6[_0xba81('0x19')]();};}function saveUpdates(_0x5611ed,_0x4de7fd){return function(_0x568479){if(_0x568479){return _0x568479[_0xba81('0x1a')](_0x5611ed)['then'](function(_0x5cb9c8){return _0x5cb9c8;});}return null;};}function removeEntity(_0x3d93eb,_0x5cb854){return function(_0x4f9234){if(_0x4f9234){return _0x4f9234[_0xba81('0x1b')]()[_0xba81('0x1c')](function(){var _0x2e045f=_0x4f9234[_0xba81('0x1d')]({'plain':!![]});var _0x504fb0=_0xba81('0x1e');return db[_0xba81('0x1f')][_0xba81('0x1b')]({'where':{'type':_0x504fb0,'resourceId':_0x2e045f['id']}})['then'](function(){return _0x4f9234;});})[_0xba81('0x1c')](function(){_0x3d93eb[_0xba81('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c01af,_0x143ddb){return function(_0x4cca94){if(!_0x4cca94){_0x5c01af[_0xba81('0x11')](0x194);}return _0x4cca94;};}function handleError(_0x4211fa,_0x2375fa){_0x2375fa=_0x2375fa||0x1f4;return function(_0x11238f){logger[_0xba81('0x20')](_0x11238f[_0xba81('0x21')]);if(_0x11238f[_0xba81('0x22')]){delete _0x11238f['name'];}_0x4211fa[_0xba81('0x12')](_0x2375fa)[_0xba81('0x23')](_0x11238f);};}exports[_0xba81('0x24')]=function(_0x292de2,_0x12cb17){var _0xaeffb5={},_0x4a7814={},_0x4b5c01={'count':0x0,'rows':[]};var _0x31f7d0=db['Variable'][_0xba81('0x25')];_0x4a7814['model']=_['keys'](_0x31f7d0);_0x4a7814['query']=_[_0xba81('0x26')](_0x292de2['query']);_0x4a7814['filters']=_[_0xba81('0x27')](_0x4a7814['model'],_0x4a7814[_0xba81('0x28')]);_0xaeffb5[_0xba81('0x29')]=_[_0xba81('0x27')](_0x4a7814[_0xba81('0x2a')],qs[_0xba81('0x2b')](_0x292de2[_0xba81('0x28')][_0xba81('0x2b')]));_0xaeffb5[_0xba81('0x29')]=_0xaeffb5[_0xba81('0x29')][_0xba81('0x2c')]?_0xaeffb5[_0xba81('0x29')]:_0x4a7814[_0xba81('0x2a')];if(!_0x292de2['query'][_0xba81('0x2d')]('nolimit')){_0xaeffb5[_0xba81('0x2e')]=qs[_0xba81('0x2e')](_0x292de2['query']['limit']);_0xaeffb5[_0xba81('0x15')]=qs['offset'](_0x292de2['query'][_0xba81('0x15')]);}_0xaeffb5[_0xba81('0x2f')]=qs['sort'](_0x292de2[_0xba81('0x28')][_0xba81('0x30')]);_0xaeffb5[_0xba81('0x31')]=qs[_0xba81('0x32')](_[_0xba81('0x33')](_0x292de2[_0xba81('0x28')],_0x4a7814['filters']));if(_0x292de2[_0xba81('0x28')][_0xba81('0x34')]){_0xaeffb5[_0xba81('0x31')]=_[_0xba81('0x35')](_0xaeffb5[_0xba81('0x31')],{'$or':_[_0xba81('0x36')](_0x31f7d0,function(_0x1fdd30){if(_0x1fdd30['type'][_0xba81('0x37')]!==_0xba81('0x38')){var _0x15b99e={};_0x15b99e[_0x1fdd30[_0xba81('0x39')]]={'$like':'%'+_0x292de2[_0xba81('0x28')][_0xba81('0x34')]+'%'};return _0x15b99e;}})});}_0xaeffb5=_[_0xba81('0x35')]({},_0xaeffb5,_0x292de2[_0xba81('0x3a')]);var _0x62c7f1={'where':_0xaeffb5[_0xba81('0x31')]};return db['Variable'][_0xba81('0x14')](_0x62c7f1)[_0xba81('0x1c')](function(_0x10fc9d){_0x4b5c01[_0xba81('0x14')]=_0x10fc9d;if(_0x292de2[_0xba81('0x28')][_0xba81('0x3b')]){_0xaeffb5[_0xba81('0x3c')]=[{'all':!![]}];}return db[_0xba81('0x3d')][_0xba81('0x3e')](_0xaeffb5);})['then'](function(_0x3de931){_0x4b5c01[_0xba81('0x3f')]=_0x3de931;return _0x4b5c01;})[_0xba81('0x1c')](respondWithFilteredResult(_0x12cb17,_0xaeffb5))[_0xba81('0x40')](handleError(_0x12cb17,null));};exports[_0xba81('0x41')]=function(_0x51f9f6,_0x203cbf){var _0x51fcab={'raw':!![],'where':{'id':_0x51f9f6[_0xba81('0x42')]['id']}},_0xf94789={};_0xf94789[_0xba81('0x2a')]=_[_0xba81('0x26')](db['Variable'][_0xba81('0x25')]);_0xf94789['query']=_['keys'](_0x51f9f6[_0xba81('0x28')]);_0xf94789[_0xba81('0x32')]=_['intersection'](_0xf94789['model'],_0xf94789[_0xba81('0x28')]);_0x51fcab[_0xba81('0x29')]=_[_0xba81('0x27')](_0xf94789[_0xba81('0x2a')],qs[_0xba81('0x2b')](_0x51f9f6['query'][_0xba81('0x2b')]));_0x51fcab[_0xba81('0x29')]=_0x51fcab['attributes'][_0xba81('0x2c')]?_0x51fcab[_0xba81('0x29')]:_0xf94789[_0xba81('0x2a')];if(_0x51f9f6[_0xba81('0x28')][_0xba81('0x3b')]){_0x51fcab[_0xba81('0x3c')]=[{'all':!![]}];}_0x51fcab=_[_0xba81('0x35')]({},_0x51fcab,_0x51f9f6['options']);return db[_0xba81('0x3d')][_0xba81('0x43')](_0x51fcab)['then'](handleEntityNotFound(_0x203cbf,null))[_0xba81('0x1c')](respondWithResult(_0x203cbf,null))['catch'](handleError(_0x203cbf,null));};exports[_0xba81('0x44')]=function(_0x1a9409,_0x5b888c){return db[_0xba81('0x3d')]['create'](_0x1a9409[_0xba81('0x45')],{})['then'](function(_0x82a353){var _0x5df220=_0x1a9409['user'][_0xba81('0x1d')]({'plain':!![]});if(!_0x5df220)throw new Error(_0xba81('0x46'));if(_0x5df220[_0xba81('0x47')]===_0xba81('0x48')){var _0x131b44=_0x82a353[_0xba81('0x1d')]({'plain':!![]});var _0x261a1c=_0xba81('0x1e');return db[_0xba81('0x49')][_0xba81('0x43')]({'where':{'name':_0x261a1c,'userProfileId':_0x5df220[_0xba81('0x4a')]},'raw':!![]})[_0xba81('0x1c')](function(_0x135e82){if(_0x135e82&&_0x135e82[_0xba81('0x4b')]===0x0){return db[_0xba81('0x1f')][_0xba81('0x44')]({'name':_0x131b44['name'],'resourceId':_0x131b44['id'],'type':_0x135e82['name'],'sectionId':_0x135e82['id']},{})[_0xba81('0x1c')](function(){return _0x82a353;});}else{return _0x82a353;}})[_0xba81('0x40')](function(_0x525f8e){logger['error'](_0xba81('0x4c'),_0x525f8e);throw _0x525f8e;});}return _0x82a353;})[_0xba81('0x1c')](respondWithResult(_0x5b888c,0xc9))[_0xba81('0x40')](handleError(_0x5b888c,null));};exports['update']=function(_0x2ff642,_0x4e62e3){if(_0x2ff642[_0xba81('0x45')]['id']){delete _0x2ff642[_0xba81('0x45')]['id'];}return db['Variable'][_0xba81('0x43')]({'where':{'id':_0x2ff642[_0xba81('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e62e3,null))[_0xba81('0x1c')](saveUpdates(_0x2ff642[_0xba81('0x45')],null))[_0xba81('0x1c')](respondWithResult(_0x4e62e3,null))[_0xba81('0x40')](handleError(_0x4e62e3,null));};exports['destroy']=function(_0x47b51e,_0x1d6e1f){return db[_0xba81('0x3d')][_0xba81('0x43')]({'where':{'id':_0x47b51e[_0xba81('0x42')]['id']}})[_0xba81('0x1c')](handleEntityNotFound(_0x1d6e1f,null))[_0xba81('0x1c')](removeEntity(_0x1d6e1f,null))['catch'](handleError(_0x1d6e1f,null));}; \ No newline at end of file +var _0x664b=['destroy','error','name','send','index','Variable','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','rawAttributes','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','create','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','get','Variables'];(function(_0x4f213d,_0x35c13e){var _0xd95602=function(_0x1e752b){while(--_0x1e752b){_0x4f213d['push'](_0x4f213d['shift']());}};_0xd95602(++_0x35c13e);}(_0x664b,0xc6));var _0xb664=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x664b[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0xb664('0x0'));var emlformat=require(_0xb664('0x1'));var rimraf=require(_0xb664('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb664('0x3'));var rp=require(_0xb664('0x4'));var moment=require('moment');var BPromise=require(_0xb664('0x5'));var Mustache=require(_0xb664('0x6'));var util=require(_0xb664('0x7'));var path=require(_0xb664('0x8'));var sox=require('sox');var csv=require(_0xb664('0x9'));var ejs=require(_0xb664('0xa'));var fs=require('fs');var _=require(_0xb664('0xb'));var squel=require(_0xb664('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb664('0xd'));var Papa=require(_0xb664('0xe'));var Redis=require(_0xb664('0xf'));var authService=require(_0xb664('0x10'));var qs=require(_0xb664('0x11'));var hardwareService=require(_0xb664('0x12'));var logger=require(_0xb664('0x13'))(_0xb664('0x14'));var utils=require(_0xb664('0x15'));var config=require(_0xb664('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5732cb,_0x17cc79){_0x17cc79=_0x17cc79||0xcc;return function(_0x13185d){if(_0x13185d){return _0x5732cb['sendStatus'](_0x17cc79);}return _0x5732cb[_0xb664('0x17')](_0x17cc79)[_0xb664('0x18')]();};}function respondWithResult(_0xad008c,_0x58cc0b){_0x58cc0b=_0x58cc0b||0xc8;return function(_0x1b3bf1){if(_0x1b3bf1){return _0xad008c['status'](_0x58cc0b)[_0xb664('0x19')](_0x1b3bf1);}};}function respondWithFilteredResult(_0x43e8aa,_0x53346a){return function(_0x2f6ba2){if(_0x2f6ba2){var _0x28eb0e=_0x2f6ba2[_0xb664('0x1a')],_0x5bc6f6=_0x53346a[_0xb664('0x1b')],_0x174e4d=_0x53346a[_0xb664('0x1b')]+_0x53346a[_0xb664('0x1c')],_0x41cf85;if(_0x174e4d>=_0x28eb0e){_0x174e4d=_0x28eb0e;_0x41cf85=0xc8;}else{_0x41cf85=0xce;}_0x43e8aa[_0xb664('0x17')](_0x41cf85);return _0x43e8aa['set'](_0xb664('0x1d'),_0x5bc6f6+'-'+_0x174e4d+'/'+_0x28eb0e)[_0xb664('0x19')](_0x2f6ba2);}return null;};}function patchUpdates(_0x50c8ff){return function(_0x4df3b5){try{jsonpatch[_0xb664('0x1e')](_0x4df3b5,_0x50c8ff,!![]);}catch(_0x6d723e){return BPromise['reject'](_0x6d723e);}return _0x4df3b5[_0xb664('0x1f')]();};}function saveUpdates(_0x263762,_0x3d2421){return function(_0x462204){if(_0x462204){return _0x462204[_0xb664('0x20')](_0x263762)[_0xb664('0x21')](function(_0xfdc993){return _0xfdc993;});}return null;};}function removeEntity(_0x1862bb,_0x4a102d){return function(_0x9fa4d0){if(_0x9fa4d0){return _0x9fa4d0['destroy']()[_0xb664('0x21')](function(){var _0x2a7e=_0x9fa4d0[_0xb664('0x22')]({'plain':!![]});var _0x3f2735=_0xb664('0x23');return db['UserProfileResource'][_0xb664('0x24')]({'where':{'type':_0x3f2735,'resourceId':_0x2a7e['id']}})['then'](function(){return _0x9fa4d0;});})[_0xb664('0x21')](function(){_0x1862bb[_0xb664('0x17')](0xcc)[_0xb664('0x18')]();});}};}function handleEntityNotFound(_0x4a99f7,_0x5c9225){return function(_0x6ccf98){if(!_0x6ccf98){_0x4a99f7['sendStatus'](0x194);}return _0x6ccf98;};}function handleError(_0x4bd913,_0x1afefa){_0x1afefa=_0x1afefa||0x1f4;return function(_0x428629){logger[_0xb664('0x25')](_0x428629['stack']);if(_0x428629[_0xb664('0x26')]){delete _0x428629['name'];}_0x4bd913['status'](_0x1afefa)[_0xb664('0x27')](_0x428629);};}exports[_0xb664('0x28')]=function(_0x5f0d67,_0x5dc60e){var _0x58801e={},_0x286e94={},_0x1f488b={'count':0x0,'rows':[]};var _0x2912a3=db[_0xb664('0x29')]['rawAttributes'];_0x286e94[_0xb664('0x2a')]=_[_0xb664('0x2b')](_0x2912a3);_0x286e94[_0xb664('0x2c')]=_[_0xb664('0x2b')](_0x5f0d67[_0xb664('0x2c')]);_0x286e94[_0xb664('0x2d')]=_[_0xb664('0x2e')](_0x286e94[_0xb664('0x2a')],_0x286e94[_0xb664('0x2c')]);_0x58801e['attributes']=_[_0xb664('0x2e')](_0x286e94[_0xb664('0x2a')],qs['fields'](_0x5f0d67['query'][_0xb664('0x2f')]));_0x58801e[_0xb664('0x30')]=_0x58801e[_0xb664('0x30')][_0xb664('0x31')]?_0x58801e[_0xb664('0x30')]:_0x286e94[_0xb664('0x2a')];if(!_0x5f0d67[_0xb664('0x2c')][_0xb664('0x32')](_0xb664('0x33'))){_0x58801e['limit']=qs[_0xb664('0x1c')](_0x5f0d67[_0xb664('0x2c')]['limit']);_0x58801e['offset']=qs[_0xb664('0x1b')](_0x5f0d67['query']['offset']);}_0x58801e[_0xb664('0x34')]=qs[_0xb664('0x35')](_0x5f0d67['query'][_0xb664('0x35')]);_0x58801e[_0xb664('0x36')]=qs[_0xb664('0x2d')](_[_0xb664('0x37')](_0x5f0d67['query'],_0x286e94[_0xb664('0x2d')]));if(_0x5f0d67['query'][_0xb664('0x38')]){_0x58801e['where']=_[_0xb664('0x39')](_0x58801e[_0xb664('0x36')],{'$or':_[_0xb664('0x3a')](_0x2912a3,function(_0x118076){if(_0x118076['type']['key']!==_0xb664('0x3b')){var _0x25f094={};_0x25f094[_0x118076[_0xb664('0x3c')]]={'$like':'%'+_0x5f0d67['query']['filter']+'%'};return _0x25f094;}})});}_0x58801e=_[_0xb664('0x39')]({},_0x58801e,_0x5f0d67[_0xb664('0x3d')]);var _0x345690={'where':_0x58801e[_0xb664('0x36')]};return db[_0xb664('0x29')]['count'](_0x345690)[_0xb664('0x21')](function(_0x1fe734){_0x1f488b[_0xb664('0x1a')]=_0x1fe734;if(_0x5f0d67[_0xb664('0x2c')][_0xb664('0x3e')]){_0x58801e[_0xb664('0x3f')]=[{'all':!![]}];}return db['Variable'][_0xb664('0x40')](_0x58801e);})[_0xb664('0x21')](function(_0xfc89b){_0x1f488b[_0xb664('0x41')]=_0xfc89b;return _0x1f488b;})[_0xb664('0x21')](respondWithFilteredResult(_0x5dc60e,_0x58801e))[_0xb664('0x42')](handleError(_0x5dc60e,null));};exports['show']=function(_0x5cc7a6,_0x48ebf1){var _0x1adbeb={'raw':!![],'where':{'id':_0x5cc7a6[_0xb664('0x43')]['id']}},_0x32d8a5={};_0x32d8a5['model']=_[_0xb664('0x2b')](db[_0xb664('0x29')][_0xb664('0x44')]);_0x32d8a5[_0xb664('0x2c')]=_['keys'](_0x5cc7a6[_0xb664('0x2c')]);_0x32d8a5[_0xb664('0x2d')]=_[_0xb664('0x2e')](_0x32d8a5[_0xb664('0x2a')],_0x32d8a5[_0xb664('0x2c')]);_0x1adbeb[_0xb664('0x30')]=_[_0xb664('0x2e')](_0x32d8a5[_0xb664('0x2a')],qs[_0xb664('0x2f')](_0x5cc7a6[_0xb664('0x2c')][_0xb664('0x2f')]));_0x1adbeb[_0xb664('0x30')]=_0x1adbeb[_0xb664('0x30')][_0xb664('0x31')]?_0x1adbeb[_0xb664('0x30')]:_0x32d8a5[_0xb664('0x2a')];if(_0x5cc7a6['query']['includeAll']){_0x1adbeb[_0xb664('0x3f')]=[{'all':!![]}];}_0x1adbeb=_[_0xb664('0x39')]({},_0x1adbeb,_0x5cc7a6[_0xb664('0x3d')]);return db[_0xb664('0x29')]['find'](_0x1adbeb)[_0xb664('0x21')](handleEntityNotFound(_0x48ebf1,null))['then'](respondWithResult(_0x48ebf1,null))[_0xb664('0x42')](handleError(_0x48ebf1,null));};exports['create']=function(_0x2c734b,_0x40376c){return db['Variable']['create'](_0x2c734b[_0xb664('0x45')],{})['then'](function(_0x5168f4){var _0x1bd8c3=_0x2c734b[_0xb664('0x46')][_0xb664('0x22')]({'plain':!![]});if(!_0x1bd8c3)throw new Error(_0xb664('0x47'));if(_0x1bd8c3[_0xb664('0x48')]===_0xb664('0x46')){var _0x29c2c8=_0x5168f4[_0xb664('0x22')]({'plain':!![]});var _0x4f7d92=_0xb664('0x23');return db['UserProfileSection'][_0xb664('0x49')]({'where':{'name':_0x4f7d92,'userProfileId':_0x1bd8c3[_0xb664('0x4a')]},'raw':!![]})[_0xb664('0x21')](function(_0x35d692){if(_0x35d692&&_0x35d692[_0xb664('0x4b')]===0x0){return db[_0xb664('0x4c')][_0xb664('0x4d')]({'name':_0x29c2c8['name'],'resourceId':_0x29c2c8['id'],'type':_0x35d692['name'],'sectionId':_0x35d692['id']},{})['then'](function(){return _0x5168f4;});}else{return _0x5168f4;}})[_0xb664('0x42')](function(_0x5b1550){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b1550);throw _0x5b1550;});}return _0x5168f4;})[_0xb664('0x21')](respondWithResult(_0x40376c,0xc9))[_0xb664('0x42')](handleError(_0x40376c,null));};exports[_0xb664('0x20')]=function(_0x14d69a,_0x5079d1){if(_0x14d69a['body']['id']){delete _0x14d69a[_0xb664('0x45')]['id'];}return db['Variable']['find']({'where':{'id':_0x14d69a['params']['id']}})[_0xb664('0x21')](handleEntityNotFound(_0x5079d1,null))[_0xb664('0x21')](saveUpdates(_0x14d69a[_0xb664('0x45')],null))[_0xb664('0x21')](respondWithResult(_0x5079d1,null))[_0xb664('0x42')](handleError(_0x5079d1,null));};exports[_0xb664('0x24')]=function(_0x9a61c8,_0x43aa2c){return db[_0xb664('0x29')][_0xb664('0x49')]({'where':{'id':_0x9a61c8['params']['id']}})[_0xb664('0x21')](handleEntityNotFound(_0x43aa2c,null))[_0xb664('0x21')](removeEntity(_0x43aa2c,null))[_0xb664('0x42')](handleError(_0x43aa2c,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index aab1786..b2a8332 100644 --- a/server/api/variable/variable.model.js +++ b/server/api/variable/variable.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0e8=['bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','exports','Variable','tools_variables','lodash','util','api'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0xf0e8,0x81));var _0x8f0e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf0e8[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x8f0e('0x0'));var util=require(_0x8f0e('0x1'));var logger=require('../../config/logger')(_0x8f0e('0x2'));var moment=require('moment');var BPromise=require(_0x8f0e('0x3'));var rp=require(_0x8f0e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f0e('0x5'));var config=require(_0x8f0e('0x6'));var attributes=require(_0x8f0e('0x7'));module[_0x8f0e('0x8')]=function(_0x42e77a,_0x492be0){return _0x42e77a['define'](_0x8f0e('0x9'),attributes,{'tableName':_0x8f0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5f8=['moment','request-promise','path','../../config/environment','./variable.attributes','tools_variables','lodash','util','../../config/logger','api'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb5f8,0x88));var _0x8b5f=function(_0x59c78a,_0x1f605a){_0x59c78a=_0x59c78a-0x0;var _0x44e1cb=_0xb5f8[_0x59c78a];return _0x44e1cb;};'use strict';var _=require(_0x8b5f('0x0'));var util=require(_0x8b5f('0x1'));var logger=require(_0x8b5f('0x2'))(_0x8b5f('0x3'));var moment=require(_0x8b5f('0x4'));var BPromise=require('bluebird');var rp=require(_0x8b5f('0x5'));var fs=require('fs');var path=require(_0x8b5f('0x6'));var rimraf=require('rimraf');var config=require(_0x8b5f('0x7'));var attributes=require(_0x8b5f('0x8'));module['exports']=function(_0x437371,_0x3f6cc9){return _0x437371['define']('Variable',attributes,{'tableName':_0x8b5f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 1136d5c..af98456 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x870d=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','find','options','raw','include','map','model','attributes','ShowVariable','lodash','util','moment','ioredis'];(function(_0x502c83,_0x1db15d){var _0x40dd62=function(_0x405dfa){while(--_0x405dfa){_0x502c83['push'](_0x502c83['shift']());}};_0x40dd62(++_0x1db15d);}(_0x870d,0x1e9));var _0xd870=function(_0x4ade2c,_0x46bc94){_0x4ade2c=_0x4ade2c-0x0;var _0x20f9d6=_0x870d[_0x4ade2c];return _0x20f9d6;};'use strict';var _=require(_0xd870('0x0'));var util=require(_0xd870('0x1'));var moment=require(_0xd870('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd870('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd870('0x4'))('rpc');var config=require(_0xd870('0x5'));var jayson=require(_0xd870('0x6'));var client=jayson['client'][_0xd870('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x13f07d,_0x466bec,_0xbe7e99){return new BPromise(function(_0x2ee00a,_0x83e26c){return client[_0xd870('0x8')](_0x13f07d,_0xbe7e99)[_0xd870('0x9')](function(_0x4bec83){logger[_0xd870('0xa')](_0xd870('0xb'),_0x466bec,_0xd870('0xc'));logger[_0xd870('0xd')](_0xd870('0xe'),_0x466bec,'request\x20sent',JSON[_0xd870('0xf')](_0x4bec83));if(_0x4bec83[_0xd870('0x10')]){if(_0x4bec83[_0xd870('0x10')][_0xd870('0x11')]===0x1f4){logger[_0xd870('0x10')](_0xd870('0xb'),_0x466bec,_0x4bec83[_0xd870('0x10')][_0xd870('0x12')]);return _0x83e26c(_0x4bec83[_0xd870('0x10')][_0xd870('0x12')]);}logger['error'](_0xd870('0xb'),_0x466bec,_0x4bec83[_0xd870('0x10')][_0xd870('0x12')]);return _0x2ee00a(_0x4bec83[_0xd870('0x10')]['message']);}else{logger[_0xd870('0xa')](_0xd870('0xb'),_0x466bec,_0xd870('0xc'));_0x2ee00a(_0x4bec83[_0xd870('0x13')][_0xd870('0x12')]);}})[_0xd870('0x14')](function(_0x16b83b){logger[_0xd870('0x10')]('Variable,\x20%s,\x20%s',_0x466bec,_0x16b83b);_0x83e26c(_0x16b83b);});});}exports['ShowVariable']=function(_0x4d6846){var _0x2716d7=this;return new Promise(function(_0x4e8eb4,_0x325f09){return db['Variable'][_0xd870('0x15')]({'raw':_0x4d6846[_0xd870('0x16')]?_0x4d6846[_0xd870('0x16')][_0xd870('0x17')]===undefined?!![]:![]:!![],'where':_0x4d6846[_0xd870('0x16')]?_0x4d6846[_0xd870('0x16')]['where']||null:null,'attributes':_0x4d6846['options']?_0x4d6846['options']['attributes']||null:null,'include':_0x4d6846[_0xd870('0x16')]?_0x4d6846[_0xd870('0x16')][_0xd870('0x18')]?_[_0xd870('0x19')](_0x4d6846['options'][_0xd870('0x18')],function(_0xb1b3b){return{'model':db[_0xb1b3b[_0xd870('0x1a')]],'as':_0xb1b3b['as'],'attributes':_0xb1b3b[_0xd870('0x1b')],'include':_0xb1b3b[_0xd870('0x18')]?_['map'](_0xb1b3b[_0xd870('0x18')],function(_0x1a70f4){return{'model':db[_0x1a70f4['model']],'as':_0x1a70f4['as'],'attributes':_0x1a70f4[_0xd870('0x1b')],'include':_0x1a70f4['include']?_[_0xd870('0x19')](_0x1a70f4[_0xd870('0x18')],function(_0x569570){return{'model':db[_0x569570[_0xd870('0x1a')]],'as':_0x569570['as'],'attributes':_0x569570[_0xd870('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa6f4dc){logger[_0xd870('0xa')]('ShowVariable',_0x4d6846);logger[_0xd870('0xd')](_0xd870('0x1c'),_0x4d6846,JSON[_0xd870('0xf')](_0xa6f4dc));_0x4e8eb4(_0xa6f4dc);})[_0xd870('0x14')](function(_0x4828a2){logger['error'](_0xd870('0x1c'),_0x4828a2[_0xd870('0x12')],_0x4d6846);_0x325f09(_0x2716d7['error'](0x1f4,_0x4828a2[_0xd870('0x12')]));});});}; \ No newline at end of file +var _0xaed4=['util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','ShowVariable','Variable','find','options','where','attributes','include','model','map','lodash'];(function(_0x1d6b56,_0x2269ef){var _0x545e0f=function(_0x369586){while(--_0x369586){_0x1d6b56['push'](_0x1d6b56['shift']());}};_0x545e0f(++_0x2269ef);}(_0xaed4,0x135));var _0x4aed=function(_0x14fd4e,_0x27c587){_0x14fd4e=_0x14fd4e-0x0;var _0x4a73d2=_0xaed4[_0x14fd4e];return _0x4a73d2;};'use strict';var _=require(_0x4aed('0x0'));var util=require(_0x4aed('0x1'));var moment=require(_0x4aed('0x2'));var BPromise=require(_0x4aed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4aed('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4aed('0x5'))(_0x4aed('0x6'));var config=require(_0x4aed('0x7'));var jayson=require(_0x4aed('0x8'));var client=jayson[_0x4aed('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f59bf,_0xc5ee0c,_0x2923bd){return new BPromise(function(_0x38d639,_0x390572){return client[_0x4aed('0xa')](_0x1f59bf,_0x2923bd)[_0x4aed('0xb')](function(_0x5aa24a){logger['info'](_0x4aed('0xc'),_0xc5ee0c,'request\x20sent');logger[_0x4aed('0xd')](_0x4aed('0xe'),_0xc5ee0c,_0x4aed('0xf'),JSON[_0x4aed('0x10')](_0x5aa24a));if(_0x5aa24a[_0x4aed('0x11')]){if(_0x5aa24a[_0x4aed('0x11')]['code']===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0xc5ee0c,_0x5aa24a[_0x4aed('0x11')]['message']);return _0x390572(_0x5aa24a[_0x4aed('0x11')][_0x4aed('0x12')]);}logger[_0x4aed('0x11')](_0x4aed('0xc'),_0xc5ee0c,_0x5aa24a[_0x4aed('0x11')][_0x4aed('0x12')]);return _0x38d639(_0x5aa24a['error'][_0x4aed('0x12')]);}else{logger[_0x4aed('0x13')]('Variable,\x20%s,\x20%s',_0xc5ee0c,_0x4aed('0xf'));_0x38d639(_0x5aa24a[_0x4aed('0x14')][_0x4aed('0x12')]);}})[_0x4aed('0x15')](function(_0x59c3dc){logger[_0x4aed('0x11')](_0x4aed('0xc'),_0xc5ee0c,_0x59c3dc);_0x390572(_0x59c3dc);});});}exports[_0x4aed('0x16')]=function(_0x2818c2){var _0xab7825=this;return new Promise(function(_0xf28caf,_0x5d8a66){return db[_0x4aed('0x17')][_0x4aed('0x18')]({'raw':_0x2818c2[_0x4aed('0x19')]?_0x2818c2[_0x4aed('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2818c2[_0x4aed('0x19')]?_0x2818c2[_0x4aed('0x19')][_0x4aed('0x1a')]||null:null,'attributes':_0x2818c2[_0x4aed('0x19')]?_0x2818c2[_0x4aed('0x19')][_0x4aed('0x1b')]||null:null,'include':_0x2818c2[_0x4aed('0x19')]?_0x2818c2[_0x4aed('0x19')][_0x4aed('0x1c')]?_['map'](_0x2818c2[_0x4aed('0x19')]['include'],function(_0x37b832){return{'model':db[_0x37b832[_0x4aed('0x1d')]],'as':_0x37b832['as'],'attributes':_0x37b832[_0x4aed('0x1b')],'include':_0x37b832[_0x4aed('0x1c')]?_[_0x4aed('0x1e')](_0x37b832[_0x4aed('0x1c')],function(_0x4528ff){return{'model':db[_0x4528ff[_0x4aed('0x1d')]],'as':_0x4528ff['as'],'attributes':_0x4528ff[_0x4aed('0x1b')],'include':_0x4528ff[_0x4aed('0x1c')]?_[_0x4aed('0x1e')](_0x4528ff[_0x4aed('0x1c')],function(_0xaa394b){return{'model':db[_0xaa394b['model']],'as':_0xaa394b['as'],'attributes':_0xaa394b[_0x4aed('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b118f){logger[_0x4aed('0x13')]('ShowVariable',_0x2818c2);logger[_0x4aed('0xd')](_0x4aed('0x16'),_0x2818c2,JSON[_0x4aed('0x10')](_0x3b118f));_0xf28caf(_0x3b118f);})[_0x4aed('0x15')](function(_0x22461e){logger[_0x4aed('0x11')](_0x4aed('0x16'),_0x22461e[_0x4aed('0x12')],_0x2818c2);_0x5d8a66(_0xab7825['error'](0x1f4,_0x22461e[_0x4aed('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 0093356..efa36d7 100644 --- a/server/api/version/index.js +++ b/server/api/version/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a28=['index','/fetch','fetch','canUpdate','reset','isAuthenticated','pull','/restart','restart','migrations','exports','express','Router','../../components/auth/service','./version.controller','get'];(function(_0x599d21,_0x25e645){var _0x5eae3c=function(_0x1d63a0){while(--_0x1d63a0){_0x599d21['push'](_0x599d21['shift']());}};_0x5eae3c(++_0x25e645);}(_0x9a28,0x1bb));var _0x89a2=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x9a28[_0x7e2eb0];return _0xd92de4;};'use strict';var express=require(_0x89a2('0x0'));var router=express[_0x89a2('0x1')]();var auth=require(_0x89a2('0x2'));var controller=require(_0x89a2('0x3'));router[_0x89a2('0x4')]('/',controller[_0x89a2('0x5')]);router['get'](_0x89a2('0x6'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x89a2('0x7')]);router[_0x89a2('0x4')]('/reset',auth['isAuthenticated'](),auth[_0x89a2('0x8')](),controller[_0x89a2('0x9')]);router[_0x89a2('0x4')]('/pull',auth[_0x89a2('0xa')](),auth[_0x89a2('0x8')](),controller[_0x89a2('0xb')]);router[_0x89a2('0x4')](_0x89a2('0xc'),auth['isAuthenticated'](),controller[_0x89a2('0xd')]);router[_0x89a2('0x4')]('/migrations',controller[_0x89a2('0xe')]);module[_0x89a2('0xf')]=router; \ No newline at end of file +var _0xcf7d=['get','/reset','isAuthenticated','reset','/pull','pull','/restart','/migrations','migrations','exports','../../components/auth/service','./version.controller','index','/fetch','canUpdate','fetch'];(function(_0x196e1f,_0x18a7e1){var _0x2b5e77=function(_0x32ff81){while(--_0x32ff81){_0x196e1f['push'](_0x196e1f['shift']());}};_0x2b5e77(++_0x18a7e1);}(_0xcf7d,0x8a));var _0xdcf7=function(_0x4abdc1,_0x3b5f5e){_0x4abdc1=_0x4abdc1-0x0;var _0xb39ed4=_0xcf7d[_0x4abdc1];return _0xb39ed4;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xdcf7('0x0'));var controller=require(_0xdcf7('0x1'));router['get']('/',controller[_0xdcf7('0x2')]);router['get'](_0xdcf7('0x3'),auth['isAuthenticated'](),auth[_0xdcf7('0x4')](),controller[_0xdcf7('0x5')]);router[_0xdcf7('0x6')](_0xdcf7('0x7'),auth[_0xdcf7('0x8')](),auth[_0xdcf7('0x4')](),controller[_0xdcf7('0x9')]);router['get'](_0xdcf7('0xa'),auth['isAuthenticated'](),auth[_0xdcf7('0x4')](),controller[_0xdcf7('0xb')]);router[_0xdcf7('0x6')](_0xdcf7('0xc'),auth['isAuthenticated'](),controller['restart']);router['get'](_0xdcf7('0xd'),controller[_0xdcf7('0xe')]);module[_0xdcf7('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index e3e3d20..f136c21 100644 --- a/server/api/version/version.controller.js +++ b/server/api/version/version.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ce1=['version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','info','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo'];(function(_0x443854,_0x3f4fbc){var _0x4ff779=function(_0x5c0a48){while(--_0x5c0a48){_0x443854['push'](_0x443854['shift']());}};_0x4ff779(++_0x3f4fbc);}(_0x8ce1,0x152));var _0x18ce=function(_0x1ea118,_0x43cb9a){_0x1ea118=_0x1ea118-0x0;var _0xb91771=_0x8ce1[_0x1ea118];return _0xb91771;};'use strict';var Umzug=require(_0x18ce('0x0'));var path=require(_0x18ce('0x1'));var fs=require('fs');var _=require(_0x18ce('0x2'));var pkginfo=require(_0x18ce('0x3'))(module,_0x18ce('0x4'));var compareVersions=require(_0x18ce('0x5'));var exec=require(_0x18ce('0x6'))['exec'];var db=require(_0x18ce('0x7'))['db'];var config=require(_0x18ce('0x8'));var pm2=require(_0x18ce('0x9'));var logger=require(_0x18ce('0xa'))('update');var git=require(_0x18ce('0xb'))(config[_0x18ce('0xc')]);exports['index']=function(_0x3481fe,_0x3e7646){var _0x509e2c={'current':module[_0x18ce('0xd')]['version'],'phonebar':0x2};if(_0x3481fe[_0x18ce('0xe')]&&_0x3481fe[_0x18ce('0xe')][_0x18ce('0xf')]){return git[_0x18ce('0x10')]()[_0x18ce('0x11')](function(_0x59b4f2,_0x5d0755){_0x509e2c[_0x18ce('0xf')]=(_0x59b4f2?module['exports']['version']:_0x5d0755[_0x18ce('0xf')])||_0x18ce('0x12');return _0x3e7646[_0x18ce('0x13')](0xc8)[_0x18ce('0x14')](_0x509e2c);});}else{return _0x3e7646[_0x18ce('0x13')](0xc8)[_0x18ce('0x14')](_0x509e2c);}};exports['fetch']=function(_0x4469c0,_0x49c3a6){return git[_0x18ce('0x10')]([_0x18ce('0x15'),_0x18ce('0x16')],function(_0x236926){if(_0x236926){logger[_0x18ce('0x17')](_0x236926);return _0x49c3a6['status'](0x1f4)[_0x18ce('0x14')](_0x236926);}logger['info']('git\x20fetch');return _0x49c3a6['status'](0xc8)['json']({'output':_0x18ce('0x18')});});};exports[_0x18ce('0x19')]=function(_0x6b66f9,_0x4e65ba){return git[_0x18ce('0x19')]([_0x18ce('0x1a'),_0x18ce('0x1b')],function(_0x293979){if(_0x293979){logger['error'](_0x293979);return _0x4e65ba[_0x18ce('0x13')](0x1f4)[_0x18ce('0x14')](_0x293979);}logger['info'](_0x18ce('0x1c'));return _0x4e65ba[_0x18ce('0x13')](0xc8)[_0x18ce('0x14')]({'output':_0x18ce('0x1d')});});};exports['pull']=function(_0x5a92cd,_0x456049){exec(_0x18ce('0x1e'),function(_0xc25148,_0x2e1df5,_0x387110){logger[_0x18ce('0x1f')](_0x2e1df5);logger['info'](_0x387110);if(_0xc25148){logger['error'](_0xc25148);return _0x456049['status'](0x1f4)[_0x18ce('0x14')](_0xc25148);}return _0x456049[_0x18ce('0x13')](0xc8)[_0x18ce('0x14')]({'output':_0x2e1df5});});};exports[_0x18ce('0x20')]=function(_0x2b4aa7,_0x4cc82e){return pm2[_0x18ce('0x20')](_0x18ce('0x21'))[_0x18ce('0x22')](function(_0x51bb26){logger['info'](_0x18ce('0x23'),_0x51bb26);return _0x4cc82e['status'](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x18ce('0x24')](function(_0x4f64c4){logger[_0x18ce('0x17')](_0x4f64c4);return _0x4cc82e[_0x18ce('0x13')](0x1f4)[_0x18ce('0x14')](_0x4f64c4);});};exports[_0x18ce('0x25')]=function(_0x54ddca,_0x28a046){var _0x211848=fs[_0x18ce('0x26')](path[_0x18ce('0x27')](config[_0x18ce('0xc')],_0x18ce('0x28'),'migrations'));var _0x59d764=[];for(var _0x5eb287=0x0;_0x5eb287<_0x211848[_0x18ce('0x29')];_0x5eb287++){var _0x112396=_0x211848[_0x5eb287][_0x18ce('0x2a')](_0x18ce('0x2b'),'');if(compareVersions(module[_0x18ce('0xd')][_0x18ce('0x4')],_0x112396)===-0x1){_0x59d764[_0x18ce('0x2c')](_0x112396);}}if(_0x59d764[_0x18ce('0x29')]){var _0x3b6c34=_0x59d764[_0x18ce('0x2d')](compareVersions);var _0x1b779f=new Umzug({'storage':_0x18ce('0x2e'),'storageOptions':{'model':db[_0x18ce('0x2f')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0x18ce('0x2e')][_0x18ce('0x30')](),db[_0x18ce('0x2e')][_0x18ce('0x31')],function(){throw new Error(_0x18ce('0x32'));}],'path':path[_0x18ce('0x27')](config[_0x18ce('0xc')],_0x18ce('0x28'),_0x18ce('0x25')),'pattern':/\.js$/}});_0x1b779f['up']({'migrations':_[_0x18ce('0x33')](_0x3b6c34,function(_0x2f5be4){return _0x2f5be4+_0x18ce('0x2b');})})['then'](function(){return _0x28a046['status'](0xc8)[_0x18ce('0x14')]({'output':_0x18ce('0x34')+module['exports']['version']+_0x18ce('0x35')+_[_0x18ce('0x36')](_0x3b6c34),'migrations':_[_0x18ce('0x27')](_0x3b6c34)});})['catch'](function(_0xd873db){if(_0xd873db instanceof db['sequelize'][_0x18ce('0x37')]){return _0x28a046[_0x18ce('0x13')](0xc8)[_0x18ce('0x14')]({'output':_0x18ce('0x38')});}else{return _0x28a046[_0x18ce('0x13')](0x1f4)[_0x18ce('0x14')](_0xd873db);}});}else{return _0x28a046[_0x18ce('0x13')](0xc8)[_0x18ce('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xa413=['map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','version','compare-versions','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','fetch','latest','exports','2.0.0','status','json','origin','master','error','info','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','restart','motion2','then','catch','readdirSync','join','server','migrations','length','replace','.js','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.'];(function(_0x52f2ae,_0x59c827){var _0x5d0cf8=function(_0x12cbac){while(--_0x12cbac){_0x52f2ae['push'](_0x52f2ae['shift']());}};_0x5d0cf8(++_0x59c827);}(_0xa413,0x1e5));var _0x3a41=function(_0xbd47d6,_0x59b168){_0xbd47d6=_0xbd47d6-0x0;var _0x5ad64e=_0xa413[_0xbd47d6];return _0x5ad64e;};'use strict';var Umzug=require(_0x3a41('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x3a41('0x1'));var pkginfo=require('pkginfo')(module,_0x3a41('0x2'));var compareVersions=require(_0x3a41('0x3'));var exec=require('child_process')['exec'];var db=require(_0x3a41('0x4'))['db'];var config=require(_0x3a41('0x5'));var pm2=require(_0x3a41('0x6'));var logger=require(_0x3a41('0x7'))(_0x3a41('0x8'));var git=require(_0x3a41('0x9'))(config[_0x3a41('0xa')]);exports[_0x3a41('0xb')]=function(_0xca7253,_0x473cd2){var _0x27c2e5={'current':module['exports'][_0x3a41('0x2')],'phonebar':0x2};if(_0xca7253['query']&&_0xca7253['query']['latest']){return git[_0x3a41('0xc')]()['tags'](function(_0x1554ab,_0x503009){_0x27c2e5[_0x3a41('0xd')]=(_0x1554ab?module[_0x3a41('0xe')]['version']:_0x503009[_0x3a41('0xd')])||_0x3a41('0xf');return _0x473cd2[_0x3a41('0x10')](0xc8)[_0x3a41('0x11')](_0x27c2e5);});}else{return _0x473cd2[_0x3a41('0x10')](0xc8)['json'](_0x27c2e5);}};exports[_0x3a41('0xc')]=function(_0x25945f,_0x2a6c12){return git[_0x3a41('0xc')]([_0x3a41('0x12'),_0x3a41('0x13')],function(_0x1fc976){if(_0x1fc976){logger[_0x3a41('0x14')](_0x1fc976);return _0x2a6c12[_0x3a41('0x10')](0x1f4)[_0x3a41('0x11')](_0x1fc976);}logger[_0x3a41('0x15')]('git\x20fetch');return _0x2a6c12[_0x3a41('0x10')](0xc8)[_0x3a41('0x11')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0xa564ed,_0x3c4267){return git[_0x3a41('0x16')]([_0x3a41('0x17'),_0x3a41('0x18')],function(_0x38c802){if(_0x38c802){logger[_0x3a41('0x14')](_0x38c802);return _0x3c4267[_0x3a41('0x10')](0x1f4)['json'](_0x38c802);}logger['info'](_0x3a41('0x19'));return _0x3c4267[_0x3a41('0x10')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x8629b5,_0x24196c){exec(_0x3a41('0x1a'),function(_0xc3f7ce,_0x547e43,_0x5caa79){logger[_0x3a41('0x15')](_0x547e43);logger[_0x3a41('0x15')](_0x5caa79);if(_0xc3f7ce){logger[_0x3a41('0x14')](_0xc3f7ce);return _0x24196c[_0x3a41('0x10')](0x1f4)[_0x3a41('0x11')](_0xc3f7ce);}return _0x24196c[_0x3a41('0x10')](0xc8)['json']({'output':_0x547e43});});};exports[_0x3a41('0x1b')]=function(_0x134966,_0x56c62d){return pm2[_0x3a41('0x1b')](_0x3a41('0x1c'))[_0x3a41('0x1d')](function(_0x2d5f59){logger[_0x3a41('0x15')]('pm2\x20restart\x20motion\x20%s',_0x2d5f59);return _0x56c62d[_0x3a41('0x10')](0xc8)[_0x3a41('0x11')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x3a41('0x1e')](function(_0x5dfbee){logger[_0x3a41('0x14')](_0x5dfbee);return _0x56c62d['status'](0x1f4)[_0x3a41('0x11')](_0x5dfbee);});};exports['migrations']=function(_0x39b9ef,_0x219a12){var _0x185b95=fs[_0x3a41('0x1f')](path[_0x3a41('0x20')](config[_0x3a41('0xa')],_0x3a41('0x21'),_0x3a41('0x22')));var _0xeb5219=[];for(var _0x3772ce=0x0;_0x3772ce<_0x185b95[_0x3a41('0x23')];_0x3772ce++){var _0x443fdf=_0x185b95[_0x3772ce][_0x3a41('0x24')](_0x3a41('0x25'),'');if(compareVersions(module['exports']['version'],_0x443fdf)===-0x1){_0xeb5219['push'](_0x443fdf);}}if(_0xeb5219['length']){var _0x22d0be=_0xeb5219[_0x3a41('0x26')](compareVersions);var _0x34c4ce=new Umzug({'storage':_0x3a41('0x27'),'storageOptions':{'model':db[_0x3a41('0x28')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db['sequelize'][_0x3a41('0x29')](),db[_0x3a41('0x27')]['constructor'],function(){throw new Error(_0x3a41('0x2a'));}],'path':path[_0x3a41('0x20')](config[_0x3a41('0xa')],_0x3a41('0x21'),_0x3a41('0x22')),'pattern':/\.js$/}});_0x34c4ce['up']({'migrations':_[_0x3a41('0x2b')](_0x22d0be,function(_0x1465a4){return _0x1465a4+_0x3a41('0x25');})})[_0x3a41('0x1d')](function(){return _0x219a12[_0x3a41('0x10')](0xc8)[_0x3a41('0x11')]({'output':_0x3a41('0x2c')+module[_0x3a41('0xe')][_0x3a41('0x2')]+_0x3a41('0x2d')+_['last'](_0x22d0be),'migrations':_['join'](_0x22d0be)});})[_0x3a41('0x1e')](function(_0x327a6e){if(_0x327a6e instanceof db['sequelize'][_0x3a41('0x2e')]){return _0x219a12['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x219a12[_0x3a41('0x10')](0x1f4)[_0x3a41('0x11')](_0x327a6e);}});}else{return _0x219a12['status'](0xc8)[_0x3a41('0x11')]({'output':_0x3a41('0x2f')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 18ed16d..43e12dc 100644 --- a/server/api/voiceAgentReport/index.js +++ b/server/api/voiceAgentReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7cff=['connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','util','path'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7cff,0x8d));var _0xf7cf=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x7cff[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require(_0xf7cf('0x0'));var util=require(_0xf7cf('0x1'));var path=require(_0xf7cf('0x2'));var timeout=require(_0xf7cf('0x3'));var express=require(_0xf7cf('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xf7cf('0x5'));var config=require(_0xf7cf('0x6'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0xf7cf('0x7')](),controller[_0xf7cf('0x8')]);router['get'](_0xf7cf('0x9'),auth[_0xf7cf('0x7')](),controller[_0xf7cf('0xa')]);router['get'](_0xf7cf('0xb'),auth[_0xf7cf('0x7')](),controller[_0xf7cf('0xc')]);router['post']('/',auth[_0xf7cf('0x7')](),controller[_0xf7cf('0xd')]);router['put'](_0xf7cf('0xb'),auth[_0xf7cf('0x7')](),controller[_0xf7cf('0xe')]);router[_0xf7cf('0xf')](_0xf7cf('0xb'),auth[_0xf7cf('0x7')](),controller[_0xf7cf('0x10')]);module[_0xf7cf('0x11')]=router; \ No newline at end of file +var _0x7289=['/describe','isAuthenticated','describe','/:id','show','post','create','put','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x7289,0x8a));var _0x9728=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x7289[_0x134c2e];return _0x2825db;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9728('0x0'));var router=express[_0x9728('0x1')]();var auth=require(_0x9728('0x2'));var interaction=require(_0x9728('0x3'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x9728('0x4')]('/',auth['isAuthenticated'](),controller[_0x9728('0x5')]);router[_0x9728('0x4')](_0x9728('0x6'),auth[_0x9728('0x7')](),controller[_0x9728('0x8')]);router[_0x9728('0x4')](_0x9728('0x9'),auth[_0x9728('0x7')](),controller[_0x9728('0xa')]);router[_0x9728('0xb')]('/',auth[_0x9728('0x7')](),controller[_0x9728('0xc')]);router[_0x9728('0xd')](_0x9728('0x9'),auth[_0x9728('0x7')](),controller['update']);router['delete'](_0x9728('0x9'),auth['isAuthenticated'](),controller[_0x9728('0xe')]);module[_0x9728('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 1165d29..9ff95a4 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.attributes.js +++ b/server/api/voiceAgentReport/voiceAgentReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x1ac9b6,_0xe2449a){var _0xa0d863=function(_0x1eea3a){while(--_0x1eea3a){_0x1ac9b6['push'](_0x1ac9b6['shift']());}};_0xa0d863(++_0xe2449a);}(_0x8ef6,0xf2));var _0x68ef=function(_0x354f92,_0x58c457){_0x354f92=_0x354f92-0x0;var _0x2ce2b5=_0x8ef6[_0x354f92];return _0x2ce2b5;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'type':{'type':Sequelize[_0x68ef('0x2')]},'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'calleridnum':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize[_0x68ef('0x2')]},'queue':{'type':Sequelize[_0x68ef('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x68ef('0x2')]},'agentcalledAt':{'type':Sequelize[_0x68ef('0x3')]},'agentconnectAt':{'type':Sequelize[_0x68ef('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x68ef('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x68ef('0x4')]},'agentcomplete':{'type':Sequelize[_0x68ef('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x68ef('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x68ef('0x4')]},'agentacw':{'type':Sequelize[_0x68ef('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x68ef('0x4')]},'reason':{'type':Sequelize[_0x68ef('0x2')]},'lastevent':{'type':Sequelize[_0x68ef('0x2')]},'channel':{'type':Sequelize[_0x68ef('0x2')]},'channelstate':{'type':Sequelize[_0x68ef('0x4')]},'channelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'connectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'connectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'language':{'type':Sequelize[_0x68ef('0x2')]},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x68ef('0x2')]},'priority':{'type':Sequelize[_0x68ef('0x2')]},'destchannel':{'type':Sequelize[_0x68ef('0x2')]},'destchannelstate':{'type':Sequelize[_0x68ef('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridnum':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'destlanguage':{'type':Sequelize[_0x68ef('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x68ef('0x2')]},'destexten':{'type':Sequelize[_0x68ef('0x2')]},'destpriority':{'type':Sequelize[_0x68ef('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x68ef('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x68ef('0x2')]},'transfer':{'type':Sequelize[_0x68ef('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x68ef('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x68ef('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb138=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x4c2896,_0x124fe6){var _0xdcfb66=function(_0x8648b7){while(--_0x8648b7){_0x4c2896['push'](_0x4c2896['shift']());}};_0xdcfb66(++_0x124fe6);}(_0xb138,0x1dd));var _0x8b13=function(_0x4095d7,_0x4b6de6){_0x4095d7=_0x4095d7-0x0;var _0x1f3491=_0xb138[_0x4095d7];return _0x1f3491;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'type':{'type':Sequelize[_0x8b13('0x2')]},'uniqueid':{'type':Sequelize[_0x8b13('0x2')]},'calleridnum':{'type':Sequelize[_0x8b13('0x2')]},'calleridname':{'type':Sequelize[_0x8b13('0x2')]},'queue':{'type':Sequelize[_0x8b13('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8b13('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8b13('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8b13('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x8b13('0x3')]},'agentdumpAt':{'type':Sequelize[_0x8b13('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8b13('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8b13('0x2')]},'channelstate':{'type':Sequelize[_0x8b13('0x5')]},'channelstatedesc':{'type':Sequelize[_0x8b13('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8b13('0x2')]},'connectedlinename':{'type':Sequelize[_0x8b13('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8b13('0x2')]},'context':{'type':Sequelize[_0x8b13('0x2')]},'exten':{'type':Sequelize[_0x8b13('0x2')]},'priority':{'type':Sequelize[_0x8b13('0x2')]},'destchannel':{'type':Sequelize[_0x8b13('0x2')]},'destchannelstate':{'type':Sequelize[_0x8b13('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x8b13('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8b13('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x8b13('0x2')]},'destexten':{'type':Sequelize[_0x8b13('0x2')]},'destpriority':{'type':Sequelize[_0x8b13('0x2')]},'destuniqueid':{'type':Sequelize[_0x8b13('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8b13('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8b13('0x2')],'comment':_0x8b13('0x6')},'transferexten':{'type':Sequelize[_0x8b13('0x2')]},'transferuniqueid':{'type':Sequelize[_0x8b13('0x2')]},'agententerreason':{'type':Sequelize[_0x8b13('0x5')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 1eada47..7c9cf7e 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ead=['attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','key','field','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','reject','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','model','query','keys','filters','intersection'];(function(_0x17fe5e,_0x1ad0c3){var _0x5c74a3=function(_0x18aa07){while(--_0x18aa07){_0x17fe5e['push'](_0x17fe5e['shift']());}};_0x5c74a3(++_0x1ad0c3);}(_0x3ead,0x9d));var _0xd3ea=function(_0x251e8c,_0x277c33){_0x251e8c=_0x251e8c-0x0;var _0x1e0c1d=_0x3ead[_0x251e8c];return _0x1e0c1d;};'use strict';var pdf=require(_0xd3ea('0x0'));var emlformat=require(_0xd3ea('0x1'));var rimraf=require(_0xd3ea('0x2'));var zipdir=require(_0xd3ea('0x3'));var jsonpatch=require(_0xd3ea('0x4'));var rp=require(_0xd3ea('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd3ea('0x6'));var util=require(_0xd3ea('0x7'));var path=require(_0xd3ea('0x8'));var sox=require('sox');var csv=require(_0xd3ea('0x9'));var ejs=require(_0xd3ea('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd3ea('0xb'));var deskjs=require(_0xd3ea('0xc'));var toCsv=require(_0xd3ea('0x9'));var querystring=require('querystring');var Papa=require(_0xd3ea('0xd'));var Redis=require(_0xd3ea('0xe'));var authService=require(_0xd3ea('0xf'));var qs=require(_0xd3ea('0x10'));var hardwareService=require(_0xd3ea('0x11'));var logger=require(_0xd3ea('0x12'))(_0xd3ea('0x13'));var utils=require(_0xd3ea('0x14'));var config=require(_0xd3ea('0x15'));var db=require(_0xd3ea('0x16'))['db'];function respondWithStatusCode(_0x350fd3,_0x450f14){_0x450f14=_0x450f14||0xcc;return function(_0x326e94){if(_0x326e94){return _0x350fd3[_0xd3ea('0x17')](_0x450f14);}return _0x350fd3[_0xd3ea('0x18')](_0x450f14)['end']();};}function respondWithResult(_0x1cbd1e,_0x8a386){_0x8a386=_0x8a386||0xc8;return function(_0x20b844){if(_0x20b844){return _0x1cbd1e[_0xd3ea('0x18')](_0x8a386)['json'](_0x20b844);}};}function respondWithFilteredResult(_0x5cd94c,_0x587a53){return function(_0x3b65f7){if(_0x3b65f7){var _0xb36eb0=_0x3b65f7[_0xd3ea('0x19')],_0x3c00bb=_0x587a53[_0xd3ea('0x1a')],_0x20798d=_0x587a53[_0xd3ea('0x1a')]+_0x587a53[_0xd3ea('0x1b')],_0x32d166;if(_0x20798d>=_0xb36eb0){_0x20798d=_0xb36eb0;_0x32d166=0xc8;}else{_0x32d166=0xce;}_0x5cd94c[_0xd3ea('0x18')](_0x32d166);return _0x5cd94c['set'](_0xd3ea('0x1c'),_0x3c00bb+'-'+_0x20798d+'/'+_0xb36eb0)['json'](_0x3b65f7);}return null;};}function patchUpdates(_0x429d6a){return function(_0x185a49){try{jsonpatch['apply'](_0x185a49,_0x429d6a,!![]);}catch(_0x33a1b3){return BPromise[_0xd3ea('0x1d')](_0x33a1b3);}return _0x185a49['save']();};}function saveUpdates(_0x5cdf1c,_0x4ab8ac){return function(_0x48ec0a){if(_0x48ec0a){return _0x48ec0a[_0xd3ea('0x1e')](_0x5cdf1c)[_0xd3ea('0x1f')](function(_0x389d4b){return _0x389d4b;});}return null;};}function removeEntity(_0x4edf91,_0x414d89){return function(_0x297fdd){if(_0x297fdd){return _0x297fdd[_0xd3ea('0x20')]()[_0xd3ea('0x1f')](function(){_0x4edf91[_0xd3ea('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe7a0f7,_0x59b0b6){return function(_0x2fda47){if(!_0x2fda47){_0xe7a0f7[_0xd3ea('0x17')](0x194);}return _0x2fda47;};}function handleError(_0x212d00,_0x23ca26){_0x23ca26=_0x23ca26||0x1f4;return function(_0x42bfc4){logger['error'](_0x42bfc4[_0xd3ea('0x21')]);if(_0x42bfc4[_0xd3ea('0x22')]){delete _0x42bfc4['name'];}_0x212d00[_0xd3ea('0x18')](_0x23ca26)[_0xd3ea('0x23')](_0x42bfc4);};}exports[_0xd3ea('0x24')]=function(_0xca5a,_0x46657c){var _0x425705={},_0x107a8a={},_0x1cd178={'count':0x0,'rows':[]};var _0x401b39=db[_0xd3ea('0x25')][_0xd3ea('0x26')];_0x107a8a[_0xd3ea('0x27')]=_['keys'](_0x401b39);_0x107a8a[_0xd3ea('0x28')]=_[_0xd3ea('0x29')](_0xca5a[_0xd3ea('0x28')]);_0x107a8a[_0xd3ea('0x2a')]=_[_0xd3ea('0x2b')](_0x107a8a[_0xd3ea('0x27')],_0x107a8a[_0xd3ea('0x28')]);_0x425705[_0xd3ea('0x2c')]=_[_0xd3ea('0x2b')](_0x107a8a['model'],qs['fields'](_0xca5a[_0xd3ea('0x28')][_0xd3ea('0x2d')]));_0x425705[_0xd3ea('0x2c')]=_0x425705[_0xd3ea('0x2c')][_0xd3ea('0x2e')]?_0x425705[_0xd3ea('0x2c')]:_0x107a8a[_0xd3ea('0x27')];if(!_0xca5a[_0xd3ea('0x28')][_0xd3ea('0x2f')]('nolimit')){_0x425705['limit']=qs[_0xd3ea('0x1b')](_0xca5a['query']['limit']);_0x425705[_0xd3ea('0x1a')]=qs['offset'](_0xca5a[_0xd3ea('0x28')][_0xd3ea('0x1a')]);}_0x425705[_0xd3ea('0x30')]=qs[_0xd3ea('0x31')](_0xca5a[_0xd3ea('0x28')][_0xd3ea('0x31')]);_0x425705[_0xd3ea('0x32')]=qs[_0xd3ea('0x2a')](_['pick'](_0xca5a['query'],_0x107a8a['filters']));if(_0xca5a[_0xd3ea('0x28')]['filter']){_0x425705[_0xd3ea('0x32')]=_[_0xd3ea('0x33')](_0x425705[_0xd3ea('0x32')],{'$or':_[_0xd3ea('0x34')](_0x401b39,function(_0x1d625c){if(_0x1d625c['type'][_0xd3ea('0x35')]!=='VIRTUAL'){var _0x1690b9={};_0x1690b9[_0x1d625c[_0xd3ea('0x36')]]={'$like':'%'+_0xca5a[_0xd3ea('0x28')]['filter']+'%'};return _0x1690b9;}})});}_0x425705=_[_0xd3ea('0x33')]({},_0x425705,_0xca5a[_0xd3ea('0x37')]);var _0x15ca09={'where':_0x425705[_0xd3ea('0x32')]};return db[_0xd3ea('0x25')][_0xd3ea('0x19')](_0x15ca09)['then'](function(_0x31fa5e){_0x1cd178[_0xd3ea('0x19')]=_0x31fa5e;if(_0xca5a[_0xd3ea('0x28')]['includeAll']){_0x425705['include']=[{'all':!![]}];}return db[_0xd3ea('0x25')][_0xd3ea('0x38')](_0x425705);})['then'](function(_0x5cb3b2){_0x1cd178[_0xd3ea('0x39')]=_0x5cb3b2;return _0x1cd178;})['then'](respondWithFilteredResult(_0x46657c,_0x425705))[_0xd3ea('0x3a')](handleError(_0x46657c,null));};exports[_0xd3ea('0x3b')]=function(_0x5d42c0,_0x25cbb1){var _0x4cd284={'raw':![],'where':{'id':_0x5d42c0[_0xd3ea('0x3c')]['id']}},_0x4c1677={};_0x4c1677[_0xd3ea('0x27')]=_[_0xd3ea('0x29')](db['VoiceAgentReport'][_0xd3ea('0x26')]);_0x4c1677[_0xd3ea('0x28')]=_['keys'](_0x5d42c0[_0xd3ea('0x28')]);_0x4c1677[_0xd3ea('0x2a')]=_[_0xd3ea('0x2b')](_0x4c1677[_0xd3ea('0x27')],_0x4c1677[_0xd3ea('0x28')]);_0x4cd284[_0xd3ea('0x2c')]=_[_0xd3ea('0x2b')](_0x4c1677[_0xd3ea('0x27')],qs[_0xd3ea('0x2d')](_0x5d42c0['query']['fields']));_0x4cd284[_0xd3ea('0x2c')]=_0x4cd284[_0xd3ea('0x2c')][_0xd3ea('0x2e')]?_0x4cd284[_0xd3ea('0x2c')]:_0x4c1677[_0xd3ea('0x27')];if(_0x5d42c0['query'][_0xd3ea('0x3d')]){_0x4cd284[_0xd3ea('0x3e')]=[{'all':!![]}];}_0x4cd284=_[_0xd3ea('0x33')]({},_0x4cd284,_0x5d42c0['options']);return db[_0xd3ea('0x25')][_0xd3ea('0x3f')](_0x4cd284)[_0xd3ea('0x1f')](handleEntityNotFound(_0x25cbb1,null))[_0xd3ea('0x1f')](respondWithResult(_0x25cbb1,null))['catch'](handleError(_0x25cbb1,null));};exports[_0xd3ea('0x40')]=function(_0x5c4f48,_0x66ff2b){return db['VoiceAgentReport']['create'](_0x5c4f48[_0xd3ea('0x41')],{})[_0xd3ea('0x1f')](respondWithResult(_0x66ff2b,0xc9))[_0xd3ea('0x3a')](handleError(_0x66ff2b,null));};exports[_0xd3ea('0x1e')]=function(_0x130bdd,_0x163f97){if(_0x130bdd[_0xd3ea('0x41')]['id']){delete _0x130bdd[_0xd3ea('0x41')]['id'];}return db[_0xd3ea('0x25')][_0xd3ea('0x3f')]({'where':{'id':_0x130bdd[_0xd3ea('0x3c')]['id']}})['then'](handleEntityNotFound(_0x163f97,null))[_0xd3ea('0x1f')](saveUpdates(_0x130bdd[_0xd3ea('0x41')],null))[_0xd3ea('0x1f')](respondWithResult(_0x163f97,null))[_0xd3ea('0x3a')](handleError(_0x163f97,null));};exports['destroy']=function(_0x5a2117,_0x4c3e74){return db[_0xd3ea('0x25')]['find']({'where':{'id':_0x5a2117[_0xd3ea('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4c3e74,null))[_0xd3ea('0x1f')](removeEntity(_0x4c3e74,null))[_0xd3ea('0x3a')](handleError(_0x4c3e74,null));};exports[_0xd3ea('0x42')]=function(_0x28b96c,_0x3ab3fb){return db[_0xd3ea('0x25')]['describe']()[_0xd3ea('0x1f')](respondWithResult(_0x3ab3fb,null))['catch'](handleError(_0x3ab3fb,null));}; \ No newline at end of file +var _0x5d6e=['keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','VoiceAgentReport','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','rawAttributes','model'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0x5d6e,0xbb));var _0xe5d6=function(_0x3c8679,_0x2faea3){_0x3c8679=_0x3c8679-0x0;var _0x2791f8=_0x5d6e[_0x3c8679];return _0x2791f8;};'use strict';var pdf=require(_0xe5d6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe5d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe5d6('0x2'));var rp=require(_0xe5d6('0x3'));var moment=require(_0xe5d6('0x4'));var BPromise=require(_0xe5d6('0x5'));var Mustache=require(_0xe5d6('0x6'));var util=require('util');var path=require(_0xe5d6('0x7'));var sox=require(_0xe5d6('0x8'));var csv=require('to-csv');var ejs=require(_0xe5d6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe5d6('0xa'));var crypto=require(_0xe5d6('0xb'));var jsforce=require(_0xe5d6('0xc'));var deskjs=require(_0xe5d6('0xd'));var toCsv=require(_0xe5d6('0xe'));var querystring=require(_0xe5d6('0xf'));var Papa=require(_0xe5d6('0x10'));var Redis=require(_0xe5d6('0x11'));var authService=require(_0xe5d6('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe5d6('0x13'));var logger=require(_0xe5d6('0x14'))(_0xe5d6('0x15'));var utils=require(_0xe5d6('0x16'));var config=require(_0xe5d6('0x17'));var db=require(_0xe5d6('0x18'))['db'];function respondWithStatusCode(_0x430edb,_0x32dc98){_0x32dc98=_0x32dc98||0xcc;return function(_0x5565ff){if(_0x5565ff){return _0x430edb[_0xe5d6('0x19')](_0x32dc98);}return _0x430edb['status'](_0x32dc98)[_0xe5d6('0x1a')]();};}function respondWithResult(_0x1184ee,_0x315d11){_0x315d11=_0x315d11||0xc8;return function(_0x56249d){if(_0x56249d){return _0x1184ee[_0xe5d6('0x1b')](_0x315d11)[_0xe5d6('0x1c')](_0x56249d);}};}function respondWithFilteredResult(_0x29915a,_0x5c84f4){return function(_0x5c89f4){if(_0x5c89f4){var _0x3ddb61=_0x5c89f4[_0xe5d6('0x1d')],_0x2906af=_0x5c84f4[_0xe5d6('0x1e')],_0x1b8f27=_0x5c84f4[_0xe5d6('0x1e')]+_0x5c84f4[_0xe5d6('0x1f')],_0x302f51;if(_0x1b8f27>=_0x3ddb61){_0x1b8f27=_0x3ddb61;_0x302f51=0xc8;}else{_0x302f51=0xce;}_0x29915a[_0xe5d6('0x1b')](_0x302f51);return _0x29915a[_0xe5d6('0x20')](_0xe5d6('0x21'),_0x2906af+'-'+_0x1b8f27+'/'+_0x3ddb61)[_0xe5d6('0x1c')](_0x5c89f4);}return null;};}function patchUpdates(_0x5cfaf9){return function(_0x57abea){try{jsonpatch[_0xe5d6('0x22')](_0x57abea,_0x5cfaf9,!![]);}catch(_0x5b7f48){return BPromise['reject'](_0x5b7f48);}return _0x57abea[_0xe5d6('0x23')]();};}function saveUpdates(_0x58a44b,_0x37a7aa){return function(_0x180d43){if(_0x180d43){return _0x180d43[_0xe5d6('0x24')](_0x58a44b)[_0xe5d6('0x25')](function(_0x40c9da){return _0x40c9da;});}return null;};}function removeEntity(_0x2d6f69,_0x212d8b){return function(_0x5479b2){if(_0x5479b2){return _0x5479b2['destroy']()[_0xe5d6('0x25')](function(){_0x2d6f69['status'](0xcc)[_0xe5d6('0x1a')]();});}};}function handleEntityNotFound(_0x1c608a,_0x42d0eb){return function(_0x16b522){if(!_0x16b522){_0x1c608a['sendStatus'](0x194);}return _0x16b522;};}function handleError(_0xb450c5,_0x36838b){_0x36838b=_0x36838b||0x1f4;return function(_0x56ece3){logger[_0xe5d6('0x26')](_0x56ece3[_0xe5d6('0x27')]);if(_0x56ece3[_0xe5d6('0x28')]){delete _0x56ece3['name'];}_0xb450c5[_0xe5d6('0x1b')](_0x36838b)[_0xe5d6('0x29')](_0x56ece3);};}exports['index']=function(_0x3fa5e9,_0x51938c){var _0x2b1583={},_0x2d72d0={},_0x36cde7={'count':0x0,'rows':[]};var _0x5efd86=db['VoiceAgentReport'][_0xe5d6('0x2a')];_0x2d72d0[_0xe5d6('0x2b')]=_[_0xe5d6('0x2c')](_0x5efd86);_0x2d72d0[_0xe5d6('0x2d')]=_[_0xe5d6('0x2c')](_0x3fa5e9['query']);_0x2d72d0[_0xe5d6('0x2e')]=_[_0xe5d6('0x2f')](_0x2d72d0[_0xe5d6('0x2b')],_0x2d72d0[_0xe5d6('0x2d')]);_0x2b1583['attributes']=_[_0xe5d6('0x2f')](_0x2d72d0['model'],qs[_0xe5d6('0x30')](_0x3fa5e9[_0xe5d6('0x2d')][_0xe5d6('0x30')]));_0x2b1583[_0xe5d6('0x31')]=_0x2b1583[_0xe5d6('0x31')][_0xe5d6('0x32')]?_0x2b1583[_0xe5d6('0x31')]:_0x2d72d0[_0xe5d6('0x2b')];if(!_0x3fa5e9['query'][_0xe5d6('0x33')](_0xe5d6('0x34'))){_0x2b1583[_0xe5d6('0x1f')]=qs[_0xe5d6('0x1f')](_0x3fa5e9['query'][_0xe5d6('0x1f')]);_0x2b1583[_0xe5d6('0x1e')]=qs['offset'](_0x3fa5e9['query'][_0xe5d6('0x1e')]);}_0x2b1583[_0xe5d6('0x35')]=qs[_0xe5d6('0x36')](_0x3fa5e9[_0xe5d6('0x2d')][_0xe5d6('0x36')]);_0x2b1583[_0xe5d6('0x37')]=qs[_0xe5d6('0x2e')](_[_0xe5d6('0x38')](_0x3fa5e9['query'],_0x2d72d0[_0xe5d6('0x2e')]));if(_0x3fa5e9[_0xe5d6('0x2d')][_0xe5d6('0x39')]){_0x2b1583[_0xe5d6('0x37')]=_[_0xe5d6('0x3a')](_0x2b1583[_0xe5d6('0x37')],{'$or':_[_0xe5d6('0x3b')](_0x5efd86,function(_0x31e855){if(_0x31e855[_0xe5d6('0x3c')][_0xe5d6('0x3d')]!==_0xe5d6('0x3e')){var _0x4980d2={};_0x4980d2[_0x31e855[_0xe5d6('0x3f')]]={'$like':'%'+_0x3fa5e9['query'][_0xe5d6('0x39')]+'%'};return _0x4980d2;}})});}_0x2b1583=_[_0xe5d6('0x3a')]({},_0x2b1583,_0x3fa5e9[_0xe5d6('0x40')]);var _0x35dca7={'where':_0x2b1583[_0xe5d6('0x37')]};return db[_0xe5d6('0x41')][_0xe5d6('0x1d')](_0x35dca7)[_0xe5d6('0x25')](function(_0x4daa16){_0x36cde7[_0xe5d6('0x1d')]=_0x4daa16;if(_0x3fa5e9['query'][_0xe5d6('0x42')]){_0x2b1583[_0xe5d6('0x43')]=[{'all':!![]}];}return db[_0xe5d6('0x41')][_0xe5d6('0x44')](_0x2b1583);})['then'](function(_0x4a9ad7){_0x36cde7['rows']=_0x4a9ad7;return _0x36cde7;})[_0xe5d6('0x25')](respondWithFilteredResult(_0x51938c,_0x2b1583))[_0xe5d6('0x45')](handleError(_0x51938c,null));};exports[_0xe5d6('0x46')]=function(_0x522966,_0x335886){var _0x34d413={'raw':![],'where':{'id':_0x522966[_0xe5d6('0x47')]['id']}},_0x249859={};_0x249859[_0xe5d6('0x2b')]=_[_0xe5d6('0x2c')](db[_0xe5d6('0x41')][_0xe5d6('0x2a')]);_0x249859[_0xe5d6('0x2d')]=_[_0xe5d6('0x2c')](_0x522966[_0xe5d6('0x2d')]);_0x249859['filters']=_[_0xe5d6('0x2f')](_0x249859[_0xe5d6('0x2b')],_0x249859[_0xe5d6('0x2d')]);_0x34d413[_0xe5d6('0x31')]=_[_0xe5d6('0x2f')](_0x249859[_0xe5d6('0x2b')],qs['fields'](_0x522966['query'][_0xe5d6('0x30')]));_0x34d413[_0xe5d6('0x31')]=_0x34d413[_0xe5d6('0x31')][_0xe5d6('0x32')]?_0x34d413[_0xe5d6('0x31')]:_0x249859[_0xe5d6('0x2b')];if(_0x522966[_0xe5d6('0x2d')]['includeAll']){_0x34d413[_0xe5d6('0x43')]=[{'all':!![]}];}_0x34d413=_[_0xe5d6('0x3a')]({},_0x34d413,_0x522966[_0xe5d6('0x40')]);return db['VoiceAgentReport'][_0xe5d6('0x48')](_0x34d413)['then'](handleEntityNotFound(_0x335886,null))[_0xe5d6('0x25')](respondWithResult(_0x335886,null))[_0xe5d6('0x45')](handleError(_0x335886,null));};exports[_0xe5d6('0x49')]=function(_0x5e2e2b,_0x3f33b7){return db[_0xe5d6('0x41')][_0xe5d6('0x49')](_0x5e2e2b['body'],{})[_0xe5d6('0x25')](respondWithResult(_0x3f33b7,0xc9))[_0xe5d6('0x45')](handleError(_0x3f33b7,null));};exports[_0xe5d6('0x24')]=function(_0x1a84d2,_0x34cfa6){if(_0x1a84d2['body']['id']){delete _0x1a84d2[_0xe5d6('0x4a')]['id'];}return db[_0xe5d6('0x41')][_0xe5d6('0x48')]({'where':{'id':_0x1a84d2['params']['id']}})[_0xe5d6('0x25')](handleEntityNotFound(_0x34cfa6,null))[_0xe5d6('0x25')](saveUpdates(_0x1a84d2['body'],null))['then'](respondWithResult(_0x34cfa6,null))[_0xe5d6('0x45')](handleError(_0x34cfa6,null));};exports[_0xe5d6('0x4b')]=function(_0x45b4eb,_0x347db6){return db[_0xe5d6('0x41')]['find']({'where':{'id':_0x45b4eb[_0xe5d6('0x47')]['id']}})[_0xe5d6('0x25')](handleEntityNotFound(_0x347db6,null))['then'](removeEntity(_0x347db6,null))['catch'](handleError(_0x347db6,null));};exports[_0xe5d6('0x4c')]=function(_0x5f033f,_0xb76d23){return db[_0xe5d6('0x41')]['describe']()[_0xe5d6('0x25')](respondWithResult(_0xb76d23,null))['catch'](handleError(_0xb76d23,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index b834e3f..8edd9dc 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.model.js +++ b/server/api/voiceAgentReport/voiceAgentReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0815=['VoiceAgentReport','uniqueid','destuniqueid','lodash','../../config/logger','api','bluebird','path','rimraf','exports','define'];(function(_0x5a9acd,_0x2f0aaa){var _0x20924f=function(_0x1159b7){while(--_0x1159b7){_0x5a9acd['push'](_0x5a9acd['shift']());}};_0x20924f(++_0x2f0aaa);}(_0x0815,0x92));var _0x5081=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0815[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x5081('0x0'));var util=require('util');var logger=require(_0x5081('0x1'))(_0x5081('0x2'));var moment=require('moment');var BPromise=require(_0x5081('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5081('0x4'));var rimraf=require(_0x5081('0x5'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0x5081('0x6')]=function(_0x4b61be,_0x553619){return _0x4b61be[_0x5081('0x7')](_0x5081('0x8'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x5081('0x9'),_0x5081('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa008=['exports','define','VoiceAgentReport','destuniqueid','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./voiceAgentReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa008,0x64));var _0x8a00=function(_0x57474d,_0x1a0413){_0x57474d=_0x57474d-0x0;var _0x5bb176=_0xa008[_0x57474d];return _0x5bb176;};'use strict';var _=require(_0x8a00('0x0'));var util=require(_0x8a00('0x1'));var logger=require(_0x8a00('0x2'))(_0x8a00('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a00('0x4'));var rimraf=require(_0x8a00('0x5'));var config=require(_0x8a00('0x6'));var attributes=require(_0x8a00('0x7'));module[_0x8a00('0x8')]=function(_0x1baf5f,_0xa6d306){return _0x1baf5f[_0x8a00('0x9')](_0x8a00('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid',_0x8a00('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 7983d4e..1379515 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.rpc.js +++ b/server/api/voiceAgentReport/voiceAgentReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a85=['ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','UpdateVoiceAgentReport','where','attributes','lodash','util','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3a85,0x175));var _0x53a8=function(_0x2cee34,_0x3a70c8){_0x2cee34=_0x2cee34-0x0;var _0x33f4b7=_0x3a85[_0x2cee34];return _0x33f4b7;};'use strict';var _=require(_0x53a8('0x0'));var util=require(_0x53a8('0x1'));var moment=require(_0x53a8('0x2'));var BPromise=require(_0x53a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x53a8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x53a8('0x5'))(_0x53a8('0x6'));var config=require(_0x53a8('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x53a8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11dba6,_0x48b431,_0x389f77){return new BPromise(function(_0x549909,_0xa48439){return client[_0x53a8('0x9')](_0x11dba6,_0x389f77)[_0x53a8('0xa')](function(_0x10e440){logger[_0x53a8('0xb')](_0x53a8('0xc'),_0x48b431,_0x53a8('0xd'));logger[_0x53a8('0xe')](_0x53a8('0xf'),_0x48b431,_0x53a8('0xd'),JSON[_0x53a8('0x10')](_0x10e440));if(_0x10e440[_0x53a8('0x11')]){if(_0x10e440[_0x53a8('0x11')]['code']===0x1f4){logger['error'](_0x53a8('0xc'),_0x48b431,_0x10e440[_0x53a8('0x11')][_0x53a8('0x12')]);return _0xa48439(_0x10e440[_0x53a8('0x11')][_0x53a8('0x12')]);}logger[_0x53a8('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x48b431,_0x10e440[_0x53a8('0x11')][_0x53a8('0x12')]);return _0x549909(_0x10e440[_0x53a8('0x11')][_0x53a8('0x12')]);}else{logger[_0x53a8('0xb')](_0x53a8('0xc'),_0x48b431,_0x53a8('0xd'));_0x549909(_0x10e440[_0x53a8('0x13')]['message']);}})[_0x53a8('0x14')](function(_0x2a6ac6){logger[_0x53a8('0x11')](_0x53a8('0xc'),_0x48b431,_0x2a6ac6);_0xa48439(_0x2a6ac6);});});}exports[_0x53a8('0x15')]=function(_0x36e86d){var _0x1549a1=this;return new Promise(function(_0x1468a7,_0x2405c3){return db[_0x53a8('0x16')][_0x53a8('0x17')](_0x36e86d['body'],{'raw':_0x36e86d['options']?_0x36e86d[_0x53a8('0x18')][_0x53a8('0x19')]===undefined?!![]:![]:!![]})[_0x53a8('0xa')](function(_0x8228d1){logger[_0x53a8('0xb')](_0x53a8('0x15'),_0x36e86d);logger[_0x53a8('0xe')](_0x53a8('0x15'),_0x36e86d,JSON[_0x53a8('0x10')](_0x8228d1));_0x1468a7(_0x8228d1);})['catch'](function(_0x1026de){logger[_0x53a8('0x11')]('CreateVoiceAgentReport',_0x1026de[_0x53a8('0x12')],_0x36e86d);_0x2405c3(_0x1549a1[_0x53a8('0x11')](0x1f4,_0x1026de[_0x53a8('0x12')]));});});};exports[_0x53a8('0x1a')]=function(_0x3e2deb){var _0x315f0b=this;return new Promise(function(_0x4050c5,_0x27cb93){return db[_0x53a8('0x16')]['update'](_0x3e2deb['body'],{'raw':_0x3e2deb[_0x53a8('0x18')]?_0x3e2deb['options'][_0x53a8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e2deb['options']?_0x3e2deb[_0x53a8('0x18')][_0x53a8('0x1b')]||null:null,'attributes':_0x3e2deb['options']?_0x3e2deb['options'][_0x53a8('0x1c')]||null:null,'limit':_0x3e2deb[_0x53a8('0x18')]?_0x3e2deb[_0x53a8('0x18')]['limit']||null:null})[_0x53a8('0xa')](function(_0x16fa3d){logger[_0x53a8('0xb')](_0x53a8('0x1a'),_0x3e2deb);logger[_0x53a8('0xe')](_0x53a8('0x1a'),_0x3e2deb,JSON[_0x53a8('0x10')](_0x16fa3d));_0x4050c5(_0x16fa3d);})[_0x53a8('0x14')](function(_0x3b125d){logger[_0x53a8('0x11')]('UpdateVoiceAgentReport',_0x3b125d[_0x53a8('0x12')],_0x3e2deb);_0x27cb93(_0x315f0b['error'](0x1f4,_0x3b125d[_0x53a8('0x12')]));});});}; \ No newline at end of file +var _0xb157=['VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','then','UpdateVoiceAgentReport','update','body','attributes','limit','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x1c6bc4,_0x71b911){var _0x1e83b8=function(_0x5bc541){while(--_0x5bc541){_0x1c6bc4['push'](_0x1c6bc4['shift']());}};_0x1e83b8(++_0x71b911);}(_0xb157,0x13e));var _0x7b15=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb157[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x7b15('0x0'));var moment=require('moment');var BPromise=require(_0x7b15('0x1'));var rs=require(_0x7b15('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7b15('0x3'));var logger=require(_0x7b15('0x4'))(_0x7b15('0x5'));var config=require(_0x7b15('0x6'));var jayson=require(_0x7b15('0x7'));var client=jayson[_0x7b15('0x8')][_0x7b15('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x511f37,_0x277a3b,_0x194252){return new BPromise(function(_0x43c219,_0x384275){return client[_0x7b15('0xa')](_0x511f37,_0x194252)['then'](function(_0x3ec0c6){logger[_0x7b15('0xb')](_0x7b15('0xc'),_0x277a3b,_0x7b15('0xd'));logger[_0x7b15('0xe')](_0x7b15('0xf'),_0x277a3b,_0x7b15('0xd'),JSON[_0x7b15('0x10')](_0x3ec0c6));if(_0x3ec0c6[_0x7b15('0x11')]){if(_0x3ec0c6['error'][_0x7b15('0x12')]===0x1f4){logger[_0x7b15('0x11')](_0x7b15('0xc'),_0x277a3b,_0x3ec0c6[_0x7b15('0x11')]['message']);return _0x384275(_0x3ec0c6[_0x7b15('0x11')]['message']);}logger[_0x7b15('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x277a3b,_0x3ec0c6[_0x7b15('0x11')][_0x7b15('0x13')]);return _0x43c219(_0x3ec0c6[_0x7b15('0x11')][_0x7b15('0x13')]);}else{logger[_0x7b15('0xb')](_0x7b15('0xc'),_0x277a3b,'request\x20sent');_0x43c219(_0x3ec0c6[_0x7b15('0x14')]['message']);}})[_0x7b15('0x15')](function(_0x2362a0){logger['error'](_0x7b15('0xc'),_0x277a3b,_0x2362a0);_0x384275(_0x2362a0);});});}exports[_0x7b15('0x16')]=function(_0x147ee5){var _0x2f7893=this;return new Promise(function(_0x4ecfd4,_0x4e5faa){return db[_0x7b15('0x17')][_0x7b15('0x18')](_0x147ee5['body'],{'raw':_0x147ee5[_0x7b15('0x19')]?_0x147ee5[_0x7b15('0x19')][_0x7b15('0x1a')]===undefined?!![]:![]:!![]})[_0x7b15('0x1b')](function(_0x2ce2f6){logger[_0x7b15('0xb')](_0x7b15('0x16'),_0x147ee5);logger[_0x7b15('0xe')](_0x7b15('0x16'),_0x147ee5,JSON[_0x7b15('0x10')](_0x2ce2f6));_0x4ecfd4(_0x2ce2f6);})[_0x7b15('0x15')](function(_0x570495){logger[_0x7b15('0x11')](_0x7b15('0x16'),_0x570495[_0x7b15('0x13')],_0x147ee5);_0x4e5faa(_0x2f7893[_0x7b15('0x11')](0x1f4,_0x570495[_0x7b15('0x13')]));});});};exports[_0x7b15('0x1c')]=function(_0x428178){var _0x37b1b1=this;return new Promise(function(_0x3bd0a2,_0x4e91c2){return db['VoiceAgentReport'][_0x7b15('0x1d')](_0x428178[_0x7b15('0x1e')],{'raw':_0x428178[_0x7b15('0x19')]?_0x428178[_0x7b15('0x19')][_0x7b15('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x428178[_0x7b15('0x19')]?_0x428178[_0x7b15('0x19')]['where']||null:null,'attributes':_0x428178[_0x7b15('0x19')]?_0x428178[_0x7b15('0x19')][_0x7b15('0x1f')]||null:null,'limit':_0x428178[_0x7b15('0x19')]?_0x428178[_0x7b15('0x19')][_0x7b15('0x20')]||null:null})[_0x7b15('0x1b')](function(_0x330e98){logger['info']('UpdateVoiceAgentReport',_0x428178);logger[_0x7b15('0xe')](_0x7b15('0x1c'),_0x428178,JSON[_0x7b15('0x10')](_0x330e98));_0x3bd0a2(_0x330e98);})[_0x7b15('0x15')](function(_0x2f5c5f){logger['error']('UpdateVoiceAgentReport',_0x2f5c5f[_0x7b15('0x13')],_0x428178);_0x4e91c2(_0x37b1b1[_0x7b15('0x11')](0x1f4,_0x2f5c5f[_0x7b15('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 41dcaaa..838860b 100644 --- a/server/api/voiceCallReport/index.js +++ b/server/api/voiceCallReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9446=['../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x9446,0x1b4));var _0x6944=function(_0x84bd82,_0x49d285){_0x84bd82=_0x84bd82-0x0;var _0x1aafab=_0x9446[_0x84bd82];return _0x1aafab;};'use strict';var multer=require(_0x6944('0x0'));var util=require('util');var path=require(_0x6944('0x1'));var timeout=require(_0x6944('0x2'));var express=require(_0x6944('0x3'));var router=express['Router']();var auth=require(_0x6944('0x4'));var interaction=require(_0x6944('0x5'));var config=require(_0x6944('0x6'));var controller=require(_0x6944('0x7'));router[_0x6944('0x8')]('/',auth[_0x6944('0x9')](),controller[_0x6944('0xa')]);router[_0x6944('0x8')](_0x6944('0xb'),auth[_0x6944('0x9')](),controller[_0x6944('0xc')]);router[_0x6944('0x8')](_0x6944('0xd'),auth['isAuthenticated'](),controller[_0x6944('0xe')]);router[_0x6944('0xf')]('/',auth[_0x6944('0x9')](),controller[_0x6944('0x10')]);router['put'](_0x6944('0xd'),auth[_0x6944('0x9')](),controller[_0x6944('0x11')]);router[_0x6944('0x12')]('/:id',auth[_0x6944('0x9')](),controller[_0x6944('0x13')]);module[_0x6944('0x14')]=router; \ No newline at end of file +var _0xda15=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x1f1617,_0x2d836f){var _0x991db3=function(_0x14744a){while(--_0x14744a){_0x1f1617['push'](_0x1f1617['shift']());}};_0x991db3(++_0x2d836f);}(_0xda15,0x1b3));var _0x5da1=function(_0x1c0c87,_0x17bb1f){_0x1c0c87=_0x1c0c87-0x0;var _0x1461fe=_0xda15[_0x1c0c87];return _0x1461fe;};'use strict';var multer=require(_0x5da1('0x0'));var util=require(_0x5da1('0x1'));var path=require('path');var timeout=require(_0x5da1('0x2'));var express=require(_0x5da1('0x3'));var router=express[_0x5da1('0x4')]();var auth=require(_0x5da1('0x5'));var interaction=require(_0x5da1('0x6'));var config=require(_0x5da1('0x7'));var controller=require(_0x5da1('0x8'));router[_0x5da1('0x9')]('/',auth[_0x5da1('0xa')](),controller[_0x5da1('0xb')]);router[_0x5da1('0x9')](_0x5da1('0xc'),auth[_0x5da1('0xa')](),controller[_0x5da1('0xd')]);router['get'](_0x5da1('0xe'),auth[_0x5da1('0xa')](),controller[_0x5da1('0xf')]);router['post']('/',auth[_0x5da1('0xa')](),controller['create']);router[_0x5da1('0x10')](_0x5da1('0xe'),auth[_0x5da1('0xa')](),controller['update']);router[_0x5da1('0x11')](_0x5da1('0xe'),auth[_0x5da1('0xa')](),controller[_0x5da1('0x12')]);module[_0x5da1('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 776ab67..a940c03 100644 --- a/server/api/voiceCallReport/voiceCallReport.attributes.js +++ b/server/api/voiceCallReport/voiceCallReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x137815,_0x78dd4b){var _0x29ded1=function(_0x32d620){while(--_0x32d620){_0x137815['push'](_0x137815['shift']());}};_0x29ded1(++_0x78dd4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file +var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0xd3328e,_0x586e46){var _0x12c939=function(_0x5da905){while(--_0x5da905){_0xd3328e['push'](_0xd3328e['shift']());}};_0x12c939(++_0x586e46);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 360702d..747613d 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7b4=['where','merge','map','type','key','VIRTUAL','field','options','include','fullname','alias','User','rows','catch','params','includeAll','find','create','body','describe','uniqueid','user','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','VoiceCallReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filter'];(function(_0x53084c,_0x4a10a7){var _0x3725c5=function(_0x2d650c){while(--_0x2d650c){_0x53084c['push'](_0x53084c['shift']());}};_0x3725c5(++_0x4a10a7);}(_0xf7b4,0x152));var _0x4f7b=function(_0x36ae89,_0x37bc49){_0x36ae89=_0x36ae89-0x0;var _0x66179=_0xf7b4[_0x36ae89];return _0x66179;};'use strict';var pdf=require(_0x4f7b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4f7b('0x1'));var jsonpatch=require(_0x4f7b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4f7b('0x3'));var Mustache=require(_0x4f7b('0x4'));var util=require(_0x4f7b('0x5'));var path=require(_0x4f7b('0x6'));var sox=require(_0x4f7b('0x7'));var csv=require(_0x4f7b('0x8'));var ejs=require(_0x4f7b('0x9'));var fs=require('fs');var _=require(_0x4f7b('0xa'));var squel=require(_0x4f7b('0xb'));var crypto=require(_0x4f7b('0xc'));var jsforce=require(_0x4f7b('0xd'));var deskjs=require(_0x4f7b('0xe'));var toCsv=require(_0x4f7b('0x8'));var querystring=require('querystring');var Papa=require(_0x4f7b('0xf'));var Redis=require(_0x4f7b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f7b('0x11'));var hardwareService=require(_0x4f7b('0x12'));var logger=require(_0x4f7b('0x13'))(_0x4f7b('0x14'));var utils=require(_0x4f7b('0x15'));var config=require('../../config/environment');var db=require(_0x4f7b('0x16'))['db'];function respondWithStatusCode(_0x5850c8,_0x5e5815){_0x5e5815=_0x5e5815||0xcc;return function(_0xd9b349){if(_0xd9b349){return _0x5850c8[_0x4f7b('0x17')](_0x5e5815);}return _0x5850c8[_0x4f7b('0x18')](_0x5e5815)[_0x4f7b('0x19')]();};}function respondWithResult(_0x4f7c2b,_0x889894){_0x889894=_0x889894||0xc8;return function(_0x368091){if(_0x368091){return _0x4f7c2b[_0x4f7b('0x18')](_0x889894)[_0x4f7b('0x1a')](_0x368091);}};}function respondWithFilteredResult(_0x339486,_0x330de9){return function(_0x40ecb0){if(_0x40ecb0){var _0x2437cc=_0x40ecb0[_0x4f7b('0x1b')],_0x260667=_0x330de9['offset'],_0x29fdd5=_0x330de9[_0x4f7b('0x1c')]+_0x330de9['limit'],_0x1a28b8;if(_0x29fdd5>=_0x2437cc){_0x29fdd5=_0x2437cc;_0x1a28b8=0xc8;}else{_0x1a28b8=0xce;}_0x339486['status'](_0x1a28b8);return _0x339486[_0x4f7b('0x1d')](_0x4f7b('0x1e'),_0x260667+'-'+_0x29fdd5+'/'+_0x2437cc)['json'](_0x40ecb0);}return null;};}function patchUpdates(_0x2b34c9){return function(_0x24c460){try{jsonpatch[_0x4f7b('0x1f')](_0x24c460,_0x2b34c9,!![]);}catch(_0xf2311f){return BPromise['reject'](_0xf2311f);}return _0x24c460[_0x4f7b('0x20')]();};}function saveUpdates(_0x5adacb,_0x41cf36){return function(_0x12374b){if(_0x12374b){return _0x12374b[_0x4f7b('0x21')](_0x5adacb)[_0x4f7b('0x22')](function(_0x27127b){return _0x27127b;});}return null;};}function removeEntity(_0x203a92,_0xc5dcfa){return function(_0x1f545e){if(_0x1f545e){return _0x1f545e[_0x4f7b('0x23')]()['then'](function(){_0x203a92[_0x4f7b('0x18')](0xcc)[_0x4f7b('0x19')]();});}};}function handleEntityNotFound(_0x2c9ea6,_0x5bd43f){return function(_0x150f57){if(!_0x150f57){_0x2c9ea6[_0x4f7b('0x17')](0x194);}return _0x150f57;};}function handleError(_0x5d22f4,_0x15dbec){_0x15dbec=_0x15dbec||0x1f4;return function(_0x59ec24){logger[_0x4f7b('0x24')](_0x59ec24[_0x4f7b('0x25')]);if(_0x59ec24[_0x4f7b('0x26')]){delete _0x59ec24[_0x4f7b('0x26')];}_0x5d22f4[_0x4f7b('0x18')](_0x15dbec)[_0x4f7b('0x27')](_0x59ec24);};}exports[_0x4f7b('0x28')]=function(_0x3ad769,_0x4ec9a3){var _0x6c9626={},_0x14e2c2={},_0x311675={'count':0x0,'rows':[]};var _0x5c6c3e=db[_0x4f7b('0x29')][_0x4f7b('0x2a')];_0x14e2c2[_0x4f7b('0x2b')]=_[_0x4f7b('0x2c')](_0x5c6c3e);_0x14e2c2[_0x4f7b('0x2d')]=_['keys'](_0x3ad769[_0x4f7b('0x2d')]);_0x14e2c2[_0x4f7b('0x2e')]=_[_0x4f7b('0x2f')](_0x14e2c2['model'],_0x14e2c2[_0x4f7b('0x2d')]);_0x6c9626['attributes']=_['intersection'](_0x14e2c2[_0x4f7b('0x2b')],qs['fields'](_0x3ad769[_0x4f7b('0x2d')][_0x4f7b('0x30')]));_0x6c9626[_0x4f7b('0x31')]=_0x6c9626[_0x4f7b('0x31')][_0x4f7b('0x32')]?_0x6c9626[_0x4f7b('0x31')]:_0x14e2c2[_0x4f7b('0x2b')];if(!_0x3ad769[_0x4f7b('0x2d')][_0x4f7b('0x33')](_0x4f7b('0x34'))){_0x6c9626[_0x4f7b('0x35')]=qs[_0x4f7b('0x35')](_0x3ad769[_0x4f7b('0x2d')][_0x4f7b('0x35')]);_0x6c9626[_0x4f7b('0x1c')]=qs[_0x4f7b('0x1c')](_0x3ad769[_0x4f7b('0x2d')][_0x4f7b('0x1c')]);}_0x6c9626[_0x4f7b('0x36')]=qs[_0x4f7b('0x37')](_0x3ad769[_0x4f7b('0x2d')][_0x4f7b('0x37')]);_0x6c9626['where']=qs[_0x4f7b('0x2e')](_['pick'](_0x3ad769[_0x4f7b('0x2d')],_0x14e2c2[_0x4f7b('0x2e')]));if(_0x3ad769['query'][_0x4f7b('0x38')]){_0x6c9626[_0x4f7b('0x39')]=_[_0x4f7b('0x3a')](_0x6c9626['where'],{'$or':_[_0x4f7b('0x3b')](_0x5c6c3e,function(_0x25eee5){if(_0x25eee5[_0x4f7b('0x3c')][_0x4f7b('0x3d')]!==_0x4f7b('0x3e')){var _0x42ff48={};_0x42ff48[_0x25eee5[_0x4f7b('0x3f')]]={'$like':'%'+_0x3ad769['query'][_0x4f7b('0x38')]+'%'};return _0x42ff48;}})});}_0x6c9626=_['merge']({},_0x6c9626,_0x3ad769[_0x4f7b('0x40')]);var _0x14d1f3={'where':_0x6c9626[_0x4f7b('0x39')]};return db['VoiceCallReport'][_0x4f7b('0x1b')](_0x14d1f3)['then'](function(_0x2471dc){_0x311675[_0x4f7b('0x1b')]=_0x2471dc;if(_0x3ad769['query']['includeAll']){_0x6c9626[_0x4f7b('0x41')]=[{'attributes':['id','name',_0x4f7b('0x42'),_0x4f7b('0x43')],'model':db['User'],'as':_0x4f7b('0x44')}];}return db['VoiceCallReport']['findAll'](_0x6c9626);})['then'](function(_0x1e4421){_0x311675[_0x4f7b('0x45')]=_0x1e4421;return _0x311675;})[_0x4f7b('0x22')](respondWithFilteredResult(_0x4ec9a3,_0x6c9626))[_0x4f7b('0x46')](handleError(_0x4ec9a3,null));};exports['show']=function(_0x3da93f,_0x49f4c0){var _0x3c2fcf={'raw':!![],'where':{'id':_0x3da93f[_0x4f7b('0x47')]['id']}},_0x586406={};_0x586406['model']=_[_0x4f7b('0x2c')](db[_0x4f7b('0x29')][_0x4f7b('0x2a')]);_0x586406[_0x4f7b('0x2d')]=_[_0x4f7b('0x2c')](_0x3da93f[_0x4f7b('0x2d')]);_0x586406[_0x4f7b('0x2e')]=_[_0x4f7b('0x2f')](_0x586406[_0x4f7b('0x2b')],_0x586406[_0x4f7b('0x2d')]);_0x3c2fcf[_0x4f7b('0x31')]=_[_0x4f7b('0x2f')](_0x586406[_0x4f7b('0x2b')],qs[_0x4f7b('0x30')](_0x3da93f[_0x4f7b('0x2d')][_0x4f7b('0x30')]));_0x3c2fcf[_0x4f7b('0x31')]=_0x3c2fcf[_0x4f7b('0x31')]['length']?_0x3c2fcf['attributes']:_0x586406[_0x4f7b('0x2b')];if(_0x3da93f[_0x4f7b('0x2d')][_0x4f7b('0x48')]){_0x3c2fcf[_0x4f7b('0x41')]=[{'all':!![]}];}_0x3c2fcf=_['merge']({},_0x3c2fcf,_0x3da93f['options']);return db[_0x4f7b('0x29')][_0x4f7b('0x49')](_0x3c2fcf)[_0x4f7b('0x22')](handleEntityNotFound(_0x49f4c0,null))[_0x4f7b('0x22')](respondWithResult(_0x49f4c0,null))['catch'](handleError(_0x49f4c0,null));};exports['create']=function(_0x3ee70,_0x201c2e){return db[_0x4f7b('0x29')][_0x4f7b('0x4a')](_0x3ee70[_0x4f7b('0x4b')],{})['then'](respondWithResult(_0x201c2e,0xc9))[_0x4f7b('0x46')](handleError(_0x201c2e,null));};exports[_0x4f7b('0x23')]=function(_0x35c0ea,_0x5df68e){return db[_0x4f7b('0x29')][_0x4f7b('0x49')]({'where':{'id':_0x35c0ea[_0x4f7b('0x47')]['id']}})[_0x4f7b('0x22')](handleEntityNotFound(_0x5df68e,null))[_0x4f7b('0x22')](removeEntity(_0x5df68e,null))[_0x4f7b('0x46')](handleError(_0x5df68e,null));};exports[_0x4f7b('0x4c')]=function(_0x2e563f,_0x2630ec){return db[_0x4f7b('0x29')]['describe']()[_0x4f7b('0x22')](respondWithResult(_0x2630ec,null))[_0x4f7b('0x46')](handleError(_0x2630ec,null));};exports[_0x4f7b('0x21')]=function(_0x5003f1,_0x16eaef){if(_0x5003f1[_0x4f7b('0x4b')][_0x4f7b('0x4d')]){delete _0x5003f1[_0x4f7b('0x4b')][_0x4f7b('0x4d')];}return db[_0x4f7b('0x29')][_0x4f7b('0x49')]({'where':{'uniqueid':_0x5003f1[_0x4f7b('0x47')]['id'],'UserId':{'$or':[null,_0x5003f1[_0x4f7b('0x4e')]['id']]}}})[_0x4f7b('0x22')](handleEntityNotFound(_0x16eaef,null))['then'](saveUpdates(_0x5003f1[_0x4f7b('0x4b')],null))[_0x4f7b('0x22')](respondWithResult(_0x16eaef,null))[_0x4f7b('0x46')](handleError(_0x16eaef,null));}; \ No newline at end of file +var _0x9c00=['pick','where','merge','map','type','key','field','filter','include','alias','User','findAll','rows','show','params','keys','VoiceCallReport','length','includeAll','find','catch','create','body','describe','uniqueid','user','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','error','name','send','index','rawAttributes','model','query','intersection','attributes','fields','nolimit','order','sort','filters'];(function(_0x5f3670,_0x1d270d){var _0x4c4d66=function(_0x11a792){while(--_0x11a792){_0x5f3670['push'](_0x5f3670['shift']());}};_0x4c4d66(++_0x1d270d);}(_0x9c00,0x1a0));var _0x09c0=function(_0x36a073,_0x2ce3ce){_0x36a073=_0x36a073-0x0;var _0xc9762b=_0x9c00[_0x36a073];return _0xc9762b;};'use strict';var pdf=require(_0x09c0('0x0'));var emlformat=require(_0x09c0('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x09c0('0x2'));var rp=require(_0x09c0('0x3'));var moment=require('moment');var BPromise=require(_0x09c0('0x4'));var Mustache=require(_0x09c0('0x5'));var util=require(_0x09c0('0x6'));var path=require(_0x09c0('0x7'));var sox=require(_0x09c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var hardwareService=require(_0x09c0('0x13'));var logger=require(_0x09c0('0x14'))(_0x09c0('0x15'));var utils=require(_0x09c0('0x16'));var config=require(_0x09c0('0x17'));var db=require(_0x09c0('0x18'))['db'];function respondWithStatusCode(_0x2a8262,_0x2929f1){_0x2929f1=_0x2929f1||0xcc;return function(_0x144271){if(_0x144271){return _0x2a8262[_0x09c0('0x19')](_0x2929f1);}return _0x2a8262[_0x09c0('0x1a')](_0x2929f1)[_0x09c0('0x1b')]();};}function respondWithResult(_0x2a86da,_0x342ceb){_0x342ceb=_0x342ceb||0xc8;return function(_0x3649d2){if(_0x3649d2){return _0x2a86da[_0x09c0('0x1a')](_0x342ceb)[_0x09c0('0x1c')](_0x3649d2);}};}function respondWithFilteredResult(_0x152140,_0x45a265){return function(_0x33c3d6){if(_0x33c3d6){var _0x2fdf11=_0x33c3d6[_0x09c0('0x1d')],_0x4ff6b7=_0x45a265[_0x09c0('0x1e')],_0x590129=_0x45a265[_0x09c0('0x1e')]+_0x45a265[_0x09c0('0x1f')],_0x558b4f;if(_0x590129>=_0x2fdf11){_0x590129=_0x2fdf11;_0x558b4f=0xc8;}else{_0x558b4f=0xce;}_0x152140['status'](_0x558b4f);return _0x152140[_0x09c0('0x20')]('Content-Range',_0x4ff6b7+'-'+_0x590129+'/'+_0x2fdf11)['json'](_0x33c3d6);}return null;};}function patchUpdates(_0x2c12da){return function(_0x50fccc){try{jsonpatch[_0x09c0('0x21')](_0x50fccc,_0x2c12da,!![]);}catch(_0x319c36){return BPromise[_0x09c0('0x22')](_0x319c36);}return _0x50fccc['save']();};}function saveUpdates(_0x23bc34,_0x44f714){return function(_0x8ad645){if(_0x8ad645){return _0x8ad645[_0x09c0('0x23')](_0x23bc34)[_0x09c0('0x24')](function(_0xa5d16f){return _0xa5d16f;});}return null;};}function removeEntity(_0x8c6b9a,_0x5d5391){return function(_0x1695e8){if(_0x1695e8){return _0x1695e8[_0x09c0('0x25')]()[_0x09c0('0x24')](function(){_0x8c6b9a[_0x09c0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f6824,_0x321bcc){return function(_0x25fdb5){if(!_0x25fdb5){_0x4f6824[_0x09c0('0x19')](0x194);}return _0x25fdb5;};}function handleError(_0x3a5370,_0x491e6f){_0x491e6f=_0x491e6f||0x1f4;return function(_0x42ebfc){logger[_0x09c0('0x26')](_0x42ebfc['stack']);if(_0x42ebfc[_0x09c0('0x27')]){delete _0x42ebfc[_0x09c0('0x27')];}_0x3a5370[_0x09c0('0x1a')](_0x491e6f)[_0x09c0('0x28')](_0x42ebfc);};}exports[_0x09c0('0x29')]=function(_0x1d2d9d,_0x45cc64){var _0x35b61c={},_0x1ea951={},_0x1aa80e={'count':0x0,'rows':[]};var _0x46a36a=db['VoiceCallReport'][_0x09c0('0x2a')];_0x1ea951[_0x09c0('0x2b')]=_['keys'](_0x46a36a);_0x1ea951[_0x09c0('0x2c')]=_['keys'](_0x1d2d9d[_0x09c0('0x2c')]);_0x1ea951['filters']=_[_0x09c0('0x2d')](_0x1ea951[_0x09c0('0x2b')],_0x1ea951[_0x09c0('0x2c')]);_0x35b61c[_0x09c0('0x2e')]=_['intersection'](_0x1ea951['model'],qs[_0x09c0('0x2f')](_0x1d2d9d[_0x09c0('0x2c')][_0x09c0('0x2f')]));_0x35b61c['attributes']=_0x35b61c[_0x09c0('0x2e')]['length']?_0x35b61c[_0x09c0('0x2e')]:_0x1ea951[_0x09c0('0x2b')];if(!_0x1d2d9d[_0x09c0('0x2c')]['hasOwnProperty'](_0x09c0('0x30'))){_0x35b61c[_0x09c0('0x1f')]=qs[_0x09c0('0x1f')](_0x1d2d9d[_0x09c0('0x2c')][_0x09c0('0x1f')]);_0x35b61c[_0x09c0('0x1e')]=qs[_0x09c0('0x1e')](_0x1d2d9d['query'][_0x09c0('0x1e')]);}_0x35b61c[_0x09c0('0x31')]=qs[_0x09c0('0x32')](_0x1d2d9d[_0x09c0('0x2c')][_0x09c0('0x32')]);_0x35b61c['where']=qs[_0x09c0('0x33')](_[_0x09c0('0x34')](_0x1d2d9d[_0x09c0('0x2c')],_0x1ea951[_0x09c0('0x33')]));if(_0x1d2d9d[_0x09c0('0x2c')]['filter']){_0x35b61c[_0x09c0('0x35')]=_[_0x09c0('0x36')](_0x35b61c[_0x09c0('0x35')],{'$or':_[_0x09c0('0x37')](_0x46a36a,function(_0x419d1c){if(_0x419d1c[_0x09c0('0x38')][_0x09c0('0x39')]!=='VIRTUAL'){var _0x363b5c={};_0x363b5c[_0x419d1c[_0x09c0('0x3a')]]={'$like':'%'+_0x1d2d9d[_0x09c0('0x2c')][_0x09c0('0x3b')]+'%'};return _0x363b5c;}})});}_0x35b61c=_[_0x09c0('0x36')]({},_0x35b61c,_0x1d2d9d['options']);var _0x5420fd={'where':_0x35b61c['where']};return db['VoiceCallReport'][_0x09c0('0x1d')](_0x5420fd)[_0x09c0('0x24')](function(_0xfd295b){_0x1aa80e[_0x09c0('0x1d')]=_0xfd295b;if(_0x1d2d9d[_0x09c0('0x2c')]['includeAll']){_0x35b61c[_0x09c0('0x3c')]=[{'attributes':['id',_0x09c0('0x27'),'fullname',_0x09c0('0x3d')],'model':db['User'],'as':_0x09c0('0x3e')}];}return db['VoiceCallReport'][_0x09c0('0x3f')](_0x35b61c);})[_0x09c0('0x24')](function(_0x56a511){_0x1aa80e[_0x09c0('0x40')]=_0x56a511;return _0x1aa80e;})[_0x09c0('0x24')](respondWithFilteredResult(_0x45cc64,_0x35b61c))['catch'](handleError(_0x45cc64,null));};exports[_0x09c0('0x41')]=function(_0x30f8a7,_0xb8a592){var _0x27e4fb={'raw':!![],'where':{'id':_0x30f8a7[_0x09c0('0x42')]['id']}},_0xeb8191={};_0xeb8191['model']=_[_0x09c0('0x43')](db[_0x09c0('0x44')][_0x09c0('0x2a')]);_0xeb8191['query']=_[_0x09c0('0x43')](_0x30f8a7[_0x09c0('0x2c')]);_0xeb8191[_0x09c0('0x33')]=_['intersection'](_0xeb8191[_0x09c0('0x2b')],_0xeb8191[_0x09c0('0x2c')]);_0x27e4fb['attributes']=_['intersection'](_0xeb8191[_0x09c0('0x2b')],qs[_0x09c0('0x2f')](_0x30f8a7['query'][_0x09c0('0x2f')]));_0x27e4fb[_0x09c0('0x2e')]=_0x27e4fb['attributes'][_0x09c0('0x45')]?_0x27e4fb[_0x09c0('0x2e')]:_0xeb8191[_0x09c0('0x2b')];if(_0x30f8a7[_0x09c0('0x2c')][_0x09c0('0x46')]){_0x27e4fb['include']=[{'all':!![]}];}_0x27e4fb=_[_0x09c0('0x36')]({},_0x27e4fb,_0x30f8a7['options']);return db['VoiceCallReport'][_0x09c0('0x47')](_0x27e4fb)[_0x09c0('0x24')](handleEntityNotFound(_0xb8a592,null))[_0x09c0('0x24')](respondWithResult(_0xb8a592,null))[_0x09c0('0x48')](handleError(_0xb8a592,null));};exports[_0x09c0('0x49')]=function(_0x401d52,_0x52a4ff){return db['VoiceCallReport']['create'](_0x401d52[_0x09c0('0x4a')],{})[_0x09c0('0x24')](respondWithResult(_0x52a4ff,0xc9))[_0x09c0('0x48')](handleError(_0x52a4ff,null));};exports['destroy']=function(_0xdf1553,_0xff9650){return db[_0x09c0('0x44')][_0x09c0('0x47')]({'where':{'id':_0xdf1553[_0x09c0('0x42')]['id']}})[_0x09c0('0x24')](handleEntityNotFound(_0xff9650,null))[_0x09c0('0x24')](removeEntity(_0xff9650,null))[_0x09c0('0x48')](handleError(_0xff9650,null));};exports[_0x09c0('0x4b')]=function(_0x38085c,_0x1b0198){return db[_0x09c0('0x44')][_0x09c0('0x4b')]()[_0x09c0('0x24')](respondWithResult(_0x1b0198,null))[_0x09c0('0x48')](handleError(_0x1b0198,null));};exports[_0x09c0('0x23')]=function(_0x37e043,_0x14c834){if(_0x37e043[_0x09c0('0x4a')][_0x09c0('0x4c')]){delete _0x37e043['body'][_0x09c0('0x4c')];}return db[_0x09c0('0x44')][_0x09c0('0x47')]({'where':{'uniqueid':_0x37e043[_0x09c0('0x42')]['id'],'UserId':{'$or':[null,_0x37e043[_0x09c0('0x4d')]['id']]}}})['then'](handleEntityNotFound(_0x14c834,null))[_0x09c0('0x24')](saveUpdates(_0x37e043[_0x09c0('0x4a')],null))[_0x09c0('0x24')](respondWithResult(_0x14c834,null))['catch'](handleError(_0x14c834,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 74d1d1b..3e329b5 100644 --- a/server/api/voiceCallReport/voiceCallReport.model.js +++ b/server/api/voiceCallReport/voiceCallReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad80=['rimraf','../../config/environment','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1c3736,_0x34662d){var _0x2a3fd6=function(_0x20c5f2){while(--_0x20c5f2){_0x1c3736['push'](_0x1c3736['shift']());}};_0x2a3fd6(++_0x34662d);}(_0xad80,0xbd));var _0x0ad8=function(_0x1cbd90,_0x112fd9){_0x1cbd90=_0x1cbd90-0x0;var _0x2f09a1=_0xad80[_0x1cbd90];return _0x2f09a1;};'use strict';var _=require(_0x0ad8('0x0'));var util=require(_0x0ad8('0x1'));var logger=require(_0x0ad8('0x2'))(_0x0ad8('0x3'));var moment=require(_0x0ad8('0x4'));var BPromise=require(_0x0ad8('0x5'));var rp=require(_0x0ad8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ad8('0x7'));var config=require(_0x0ad8('0x8'));var attributes=require('./voiceCallReport.attributes');module[_0x0ad8('0x9')]=function(_0x5122b7,_0xe18157){return _0x5122b7[_0x0ad8('0xa')](_0x0ad8('0xb'),attributes,{'tableName':_0x0ad8('0xc'),'paranoid':![],'indexes':[{'fields':[_0x0ad8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x80e6=['uniqueid','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x80e6,0xb5));var _0x680e=function(_0xa2dcf8,_0x221eba){_0xa2dcf8=_0xa2dcf8-0x0;var _0x349925=_0x80e6[_0xa2dcf8];return _0x349925;};'use strict';var _=require(_0x680e('0x0'));var util=require(_0x680e('0x1'));var logger=require('../../config/logger')(_0x680e('0x2'));var moment=require('moment');var BPromise=require(_0x680e('0x3'));var rp=require(_0x680e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x680e('0x5'));var config=require(_0x680e('0x6'));var attributes=require(_0x680e('0x7'));module['exports']=function(_0x2640a9,_0x57c5eb){return _0x2640a9[_0x680e('0x8')](_0x680e('0x9'),attributes,{'tableName':_0x680e('0xa'),'paranoid':![],'indexes':[{'fields':[_0x680e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 8d37100..94c0475 100644 --- a/server/api/voiceCallReport/voiceCallReport.rpc.js +++ b/server/api/voiceCallReport/voiceCallReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc622=['create','update','raw','UpdateVoiceCallReport','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','options','where','attributes','limit','include','map','model','CreateVoiceCallReport'];(function(_0x21ab4b,_0x4d4cc8){var _0xb594ab=function(_0x347f07){while(--_0x347f07){_0x21ab4b['push'](_0x21ab4b['shift']());}};_0xb594ab(++_0x4d4cc8);}(_0xc622,0x176));var _0x2c62=function(_0x5c4b6a,_0x3e4163){_0x5c4b6a=_0x5c4b6a-0x0;var _0x2dec05=_0xc622[_0x5c4b6a];return _0x2dec05;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2c62('0x0'));var rs=require(_0x2c62('0x1'));var fs=require('fs');var Redis=require(_0x2c62('0x2'));var db=require(_0x2c62('0x3'))['db'];var utils=require(_0x2c62('0x4'));var logger=require('../../config/logger')(_0x2c62('0x5'));var config=require(_0x2c62('0x6'));var jayson=require(_0x2c62('0x7'));var client=jayson[_0x2c62('0x8')][_0x2c62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x623a3d,_0x32ee9e,_0x5eb31a){return new BPromise(function(_0xabea72,_0x5c9fe8){return client[_0x2c62('0xa')](_0x623a3d,_0x5eb31a)[_0x2c62('0xb')](function(_0x3fb52f){logger['info'](_0x2c62('0xc'),_0x32ee9e,_0x2c62('0xd'));logger[_0x2c62('0xe')](_0x2c62('0xf'),_0x32ee9e,_0x2c62('0xd'),JSON[_0x2c62('0x10')](_0x3fb52f));if(_0x3fb52f['error']){if(_0x3fb52f[_0x2c62('0x11')][_0x2c62('0x12')]===0x1f4){logger[_0x2c62('0x11')](_0x2c62('0xc'),_0x32ee9e,_0x3fb52f[_0x2c62('0x11')]['message']);return _0x5c9fe8(_0x3fb52f[_0x2c62('0x11')][_0x2c62('0x13')]);}logger[_0x2c62('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x32ee9e,_0x3fb52f[_0x2c62('0x11')][_0x2c62('0x13')]);return _0xabea72(_0x3fb52f[_0x2c62('0x11')]['message']);}else{logger[_0x2c62('0x14')](_0x2c62('0xc'),_0x32ee9e,_0x2c62('0xd'));_0xabea72(_0x3fb52f[_0x2c62('0x15')][_0x2c62('0x13')]);}})[_0x2c62('0x16')](function(_0x26cd74){logger[_0x2c62('0x11')](_0x2c62('0xc'),_0x32ee9e,_0x26cd74);_0x5c9fe8(_0x26cd74);});});}exports[_0x2c62('0x17')]=function(_0x5abcd7){var _0x11a6ff=this;return new Promise(function(_0x47e77e,_0x2273c3){return db[_0x2c62('0x18')]['findAll']({'raw':_0x5abcd7[_0x2c62('0x19')]?_0x5abcd7['options']['raw']===undefined?!![]:![]:!![],'where':_0x5abcd7['options']?_0x5abcd7[_0x2c62('0x19')][_0x2c62('0x1a')]||null:null,'attributes':_0x5abcd7[_0x2c62('0x19')]?_0x5abcd7[_0x2c62('0x19')][_0x2c62('0x1b')]||null:null,'limit':_0x5abcd7[_0x2c62('0x19')]?_0x5abcd7[_0x2c62('0x19')][_0x2c62('0x1c')]||null:null,'include':_0x5abcd7[_0x2c62('0x19')]?_0x5abcd7[_0x2c62('0x19')][_0x2c62('0x1d')]?_[_0x2c62('0x1e')](_0x5abcd7['options'][_0x2c62('0x1d')],function(_0x19e5bd){return{'model':db[_0x19e5bd[_0x2c62('0x1f')]],'as':_0x19e5bd['as'],'attributes':_0x19e5bd[_0x2c62('0x1b')],'include':_0x19e5bd[_0x2c62('0x1d')]?_['map'](_0x19e5bd['include'],function(_0x400692){return{'model':db[_0x400692[_0x2c62('0x1f')]],'as':_0x400692['as'],'attributes':_0x400692[_0x2c62('0x1b')],'include':_0x400692['include']?_[_0x2c62('0x1e')](_0x400692[_0x2c62('0x1d')],function(_0x4da5f6){return{'model':db[_0x4da5f6[_0x2c62('0x1f')]],'as':_0x4da5f6['as'],'attributes':_0x4da5f6[_0x2c62('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2c62('0xb')](function(_0x3371be){logger['info'](_0x2c62('0x17'),_0x5abcd7);logger[_0x2c62('0xe')](_0x2c62('0x17'),_0x5abcd7,JSON[_0x2c62('0x10')](_0x3371be));_0x47e77e(_0x3371be);})[_0x2c62('0x16')](function(_0x735392){logger[_0x2c62('0x11')](_0x2c62('0x17'),_0x735392['message'],_0x5abcd7);_0x2273c3(_0x11a6ff[_0x2c62('0x11')](0x1f4,_0x735392[_0x2c62('0x13')]));});});};exports[_0x2c62('0x20')]=function(_0x3501a8){var _0x10be75=this;return new Promise(function(_0x915fff,_0x5d67a4){return db[_0x2c62('0x18')][_0x2c62('0x21')](_0x3501a8['body'],{'raw':_0x3501a8[_0x2c62('0x19')]?_0x3501a8[_0x2c62('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x2c62('0xb')](function(_0x589207){logger['info'](_0x2c62('0x20'),_0x3501a8);logger[_0x2c62('0xe')](_0x2c62('0x20'),_0x3501a8,JSON[_0x2c62('0x10')](_0x589207));_0x915fff(_0x589207);})[_0x2c62('0x16')](function(_0x239cf5){logger[_0x2c62('0x11')](_0x2c62('0x20'),_0x239cf5[_0x2c62('0x13')],_0x3501a8);_0x5d67a4(_0x10be75['error'](0x1f4,_0x239cf5['message']));});});};exports['UpdateVoiceCallReport']=function(_0xc2b1b){var _0x42b45e=this;return new Promise(function(_0x4d8ec8,_0x25ff56){return db['VoiceCallReport'][_0x2c62('0x22')](_0xc2b1b['body'],{'raw':_0xc2b1b[_0x2c62('0x19')]?_0xc2b1b['options'][_0x2c62('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc2b1b['options']?_0xc2b1b[_0x2c62('0x19')][_0x2c62('0x1a')]||null:null,'attributes':_0xc2b1b[_0x2c62('0x19')]?_0xc2b1b[_0x2c62('0x19')]['attributes']||null:null,'limit':_0xc2b1b[_0x2c62('0x19')]?_0xc2b1b[_0x2c62('0x19')][_0x2c62('0x1c')]||null:null})[_0x2c62('0xb')](function(_0x2a74c9){logger[_0x2c62('0x14')](_0x2c62('0x24'),_0xc2b1b);logger['debug']('UpdateVoiceCallReport',_0xc2b1b,JSON[_0x2c62('0x10')](_0x2a74c9));_0x4d8ec8(_0x2a74c9);})[_0x2c62('0x16')](function(_0x28910e){logger[_0x2c62('0x11')]('UpdateVoiceCallReport',_0x28910e[_0x2c62('0x13')],_0xc2b1b);_0x25ff56(_0x42b45e['error'](0x1f4,_0x28910e[_0x2c62('0x13')]));});});}; \ No newline at end of file +var _0x6a4f=['body','raw','CreateVoiceCallReport','stringify','UpdateVoiceCallReport','update','lodash','moment','bluebird','randomstring','rpc','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','map','model','debug','create'];(function(_0x5e996c,_0x1dd5a7){var _0x4b1fdb=function(_0x3e7052){while(--_0x3e7052){_0x5e996c['push'](_0x5e996c['shift']());}};_0x4b1fdb(++_0x1dd5a7);}(_0x6a4f,0x102));var _0xf6a4=function(_0x5528b9,_0x1309c3){_0x5528b9=_0x5528b9-0x0;var _0x1231ac=_0x6a4f[_0x5528b9];return _0x1231ac;};'use strict';var _=require(_0xf6a4('0x0'));var util=require('util');var moment=require(_0xf6a4('0x1'));var BPromise=require(_0xf6a4('0x2'));var rs=require(_0xf6a4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf6a4('0x4'));var config=require('../../config/environment');var jayson=require(_0xf6a4('0x5'));var client=jayson[_0xf6a4('0x6')][_0xf6a4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x812b8e,_0x1823d0,_0x465b86){return new BPromise(function(_0x3739ea,_0x2d1d8e){return client[_0xf6a4('0x8')](_0x812b8e,_0x465b86)[_0xf6a4('0x9')](function(_0xa5af2d){logger['info'](_0xf6a4('0xa'),_0x1823d0,_0xf6a4('0xb'));logger['debug'](_0xf6a4('0xc'),_0x1823d0,_0xf6a4('0xb'),JSON['stringify'](_0xa5af2d));if(_0xa5af2d[_0xf6a4('0xd')]){if(_0xa5af2d[_0xf6a4('0xd')]['code']===0x1f4){logger[_0xf6a4('0xd')](_0xf6a4('0xa'),_0x1823d0,_0xa5af2d[_0xf6a4('0xd')][_0xf6a4('0xe')]);return _0x2d1d8e(_0xa5af2d[_0xf6a4('0xd')]['message']);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x1823d0,_0xa5af2d['error']['message']);return _0x3739ea(_0xa5af2d[_0xf6a4('0xd')][_0xf6a4('0xe')]);}else{logger[_0xf6a4('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x1823d0,_0xf6a4('0xb'));_0x3739ea(_0xa5af2d[_0xf6a4('0x10')][_0xf6a4('0xe')]);}})[_0xf6a4('0x11')](function(_0x3a8dca){logger[_0xf6a4('0xd')](_0xf6a4('0xa'),_0x1823d0,_0x3a8dca);_0x2d1d8e(_0x3a8dca);});});}exports[_0xf6a4('0x12')]=function(_0x47faab){var _0x299f42=this;return new Promise(function(_0x58dcd3,_0x3ec86e){return db[_0xf6a4('0x13')][_0xf6a4('0x14')]({'raw':_0x47faab[_0xf6a4('0x15')]?_0x47faab[_0xf6a4('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x47faab[_0xf6a4('0x15')]?_0x47faab['options'][_0xf6a4('0x16')]||null:null,'attributes':_0x47faab[_0xf6a4('0x15')]?_0x47faab[_0xf6a4('0x15')][_0xf6a4('0x17')]||null:null,'limit':_0x47faab[_0xf6a4('0x15')]?_0x47faab[_0xf6a4('0x15')][_0xf6a4('0x18')]||null:null,'include':_0x47faab[_0xf6a4('0x15')]?_0x47faab[_0xf6a4('0x15')][_0xf6a4('0x19')]?_[_0xf6a4('0x1a')](_0x47faab[_0xf6a4('0x15')]['include'],function(_0x40dc88){return{'model':db[_0x40dc88[_0xf6a4('0x1b')]],'as':_0x40dc88['as'],'attributes':_0x40dc88[_0xf6a4('0x17')],'include':_0x40dc88[_0xf6a4('0x19')]?_[_0xf6a4('0x1a')](_0x40dc88[_0xf6a4('0x19')],function(_0x592dc5){return{'model':db[_0x592dc5[_0xf6a4('0x1b')]],'as':_0x592dc5['as'],'attributes':_0x592dc5[_0xf6a4('0x17')],'include':_0x592dc5[_0xf6a4('0x19')]?_[_0xf6a4('0x1a')](_0x592dc5[_0xf6a4('0x19')],function(_0x18305c){return{'model':db[_0x18305c[_0xf6a4('0x1b')]],'as':_0x18305c['as'],'attributes':_0x18305c[_0xf6a4('0x17')]};}):[]};}):[]};}):[]:[]})[_0xf6a4('0x9')](function(_0x2b4319){logger[_0xf6a4('0xf')](_0xf6a4('0x12'),_0x47faab);logger[_0xf6a4('0x1c')]('GetVoiceCallReport',_0x47faab,JSON['stringify'](_0x2b4319));_0x58dcd3(_0x2b4319);})[_0xf6a4('0x11')](function(_0x5e4abe){logger[_0xf6a4('0xd')](_0xf6a4('0x12'),_0x5e4abe[_0xf6a4('0xe')],_0x47faab);_0x3ec86e(_0x299f42[_0xf6a4('0xd')](0x1f4,_0x5e4abe['message']));});});};exports['CreateVoiceCallReport']=function(_0x2d2c5b){var _0x33374c=this;return new Promise(function(_0x2bef6a,_0x3de4dd){return db[_0xf6a4('0x13')][_0xf6a4('0x1d')](_0x2d2c5b[_0xf6a4('0x1e')],{'raw':_0x2d2c5b[_0xf6a4('0x15')]?_0x2d2c5b[_0xf6a4('0x15')][_0xf6a4('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x57c0aa){logger[_0xf6a4('0xf')](_0xf6a4('0x20'),_0x2d2c5b);logger[_0xf6a4('0x1c')](_0xf6a4('0x20'),_0x2d2c5b,JSON[_0xf6a4('0x21')](_0x57c0aa));_0x2bef6a(_0x57c0aa);})[_0xf6a4('0x11')](function(_0x1121a0){logger[_0xf6a4('0xd')](_0xf6a4('0x20'),_0x1121a0[_0xf6a4('0xe')],_0x2d2c5b);_0x3de4dd(_0x33374c['error'](0x1f4,_0x1121a0[_0xf6a4('0xe')]));});});};exports[_0xf6a4('0x22')]=function(_0x14ed98){var _0x13dfa3=this;return new Promise(function(_0x581341,_0x338edc){return db[_0xf6a4('0x13')][_0xf6a4('0x23')](_0x14ed98['body'],{'raw':_0x14ed98['options']?_0x14ed98[_0xf6a4('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14ed98['options']?_0x14ed98[_0xf6a4('0x15')][_0xf6a4('0x16')]||null:null,'attributes':_0x14ed98['options']?_0x14ed98[_0xf6a4('0x15')][_0xf6a4('0x17')]||null:null,'limit':_0x14ed98[_0xf6a4('0x15')]?_0x14ed98[_0xf6a4('0x15')]['limit']||null:null})[_0xf6a4('0x9')](function(_0x317728){logger[_0xf6a4('0xf')](_0xf6a4('0x22'),_0x14ed98);logger[_0xf6a4('0x1c')](_0xf6a4('0x22'),_0x14ed98,JSON[_0xf6a4('0x21')](_0x317728));_0x581341(_0x317728);})['catch'](function(_0x337d81){logger[_0xf6a4('0xd')]('UpdateVoiceCallReport',_0x337d81['message'],_0x14ed98);_0x338edc(_0x13dfa3[_0xf6a4('0xd')](0x1f4,_0x337d81[_0xf6a4('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 3ede8bd..bd1e303 100644 --- a/server/api/voiceChanSpy/index.js +++ b/server/api/voiceChanSpy/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ce1=['put','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','/:id','create'];(function(_0x577cf0,_0x2f6e64){var _0x45d175=function(_0x546438){while(--_0x546438){_0x577cf0['push'](_0x577cf0['shift']());}};_0x45d175(++_0x2f6e64);}(_0x5ce1,0xd4));var _0x15ce=function(_0x26c364,_0x4226c3){_0x26c364=_0x26c364-0x0;var _0x565bf4=_0x5ce1[_0x26c364];return _0x565bf4;};'use strict';var multer=require('multer');var util=require(_0x15ce('0x0'));var path=require(_0x15ce('0x1'));var timeout=require(_0x15ce('0x2'));var express=require('express');var router=express[_0x15ce('0x3')]();var auth=require(_0x15ce('0x4'));var interaction=require(_0x15ce('0x5'));var config=require(_0x15ce('0x6'));var controller=require(_0x15ce('0x7'));router[_0x15ce('0x8')]('/',auth[_0x15ce('0x9')](),controller['index']);router[_0x15ce('0x8')](_0x15ce('0xa'),auth[_0x15ce('0x9')](),controller['show']);router['post']('/',auth[_0x15ce('0x9')](),controller[_0x15ce('0xb')]);router[_0x15ce('0xc')]('/:id',auth[_0x15ce('0x9')](),controller[_0x15ce('0xd')]);router[_0x15ce('0xe')]('/:id',auth[_0x15ce('0x9')](),controller['destroy']);module[_0x15ce('0xf')]=router; \ No newline at end of file +var _0xfd50=['Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0xa9a65e,_0x2b74cf){var _0x362b4c=function(_0x322b7e){while(--_0x322b7e){_0xa9a65e['push'](_0xa9a65e['shift']());}};_0x362b4c(++_0x2b74cf);}(_0xfd50,0x178));var _0x0fd5=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xfd50[_0x45783c];return _0x1161da;};'use strict';var multer=require('multer');var util=require(_0x0fd5('0x0'));var path=require(_0x0fd5('0x1'));var timeout=require(_0x0fd5('0x2'));var express=require(_0x0fd5('0x3'));var router=express[_0x0fd5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0fd5('0x5'));var config=require(_0x0fd5('0x6'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x0fd5('0x7')](),controller[_0x0fd5('0x8')]);router[_0x0fd5('0x9')](_0x0fd5('0xa'),auth['isAuthenticated'](),controller[_0x0fd5('0xb')]);router[_0x0fd5('0xc')]('/',auth['isAuthenticated'](),controller[_0x0fd5('0xd')]);router[_0x0fd5('0xe')](_0x0fd5('0xa'),auth[_0x0fd5('0x7')](),controller[_0x0fd5('0xf')]);router[_0x0fd5('0x10')](_0x0fd5('0xa'),auth['isAuthenticated'](),controller[_0x0fd5('0x11')]);module[_0x0fd5('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 9eaf471..24d7693 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.attributes.js +++ b/server/api/voiceChanSpy/voiceChanSpy.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8dc9=['split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join','getDataValue'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8dc9,0xe8));var _0x98dc=function(_0x440fe9,_0x3548dd){_0x440fe9=_0x440fe9-0x0;var _0x5149b6=_0x8dc9[_0x440fe9];return _0x5149b6;};'use strict';var Sequelize=require(_0x98dc('0x0'));module[_0x98dc('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x98dc('0x2')],'unique':_0x98dc('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x98dc('0x2')],'set':function(_0x3d9e4f){this[_0x98dc('0x4')](_0x98dc('0x5'),_0x3d9e4f?_0x3d9e4f[_0x98dc('0x6')](''):[]);},'get':function(){return this[_0x98dc('0x7')](_0x98dc('0x5'))?this[_0x98dc('0x7')]('options')[_0x98dc('0x8')](''):[];}},'auth':{'type':Sequelize[_0x98dc('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x98dc('0x2')]},'record':{'type':Sequelize[_0x98dc('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x98dc('0x2')]},'description':{'type':Sequelize[_0x98dc('0x2')]}}; \ No newline at end of file +var _0xd464=['name','setDataValue','getDataValue','options','BOOLEAN','exports','STRING'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0xd464,0xd0));var _0x4d46=function(_0x2bfb79,_0x2d7c50){_0x2bfb79=_0x2bfb79-0x0;var _0x2aecda=_0xd464[_0x2bfb79];return _0x2aecda;};'use strict';var Sequelize=require('sequelize');module[_0x4d46('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x4d46('0x1')],'unique':_0x4d46('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x5c2bf7){this[_0x4d46('0x3')]('options',_0x5c2bf7?_0x5c2bf7['join'](''):[]);},'get':function(){return this[_0x4d46('0x4')]('options')?this['getDataValue'](_0x4d46('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0x4d46('0x6')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4d46('0x1')]},'description':{'type':Sequelize[_0x4d46('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 916c102..3be00ff 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.controller.js +++ b/server/api/voiceChanSpy/voiceChanSpy.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29d1=['offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','ChanSpies','UserProfileResource','end','stack','name','send','index','VoiceChanSpy','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x2923cc,_0xa62a85){var _0x2ccb9f=function(_0x43c624){while(--_0x43c624){_0x2923cc['push'](_0x2923cc['shift']());}};_0x2ccb9f(++_0xa62a85);}(_0x29d1,0x8d));var _0x129d=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0x29d1[_0x47b15f];return _0x55bf25;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x129d('0x0'));var zipdir=require(_0x129d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x129d('0x2'));var moment=require(_0x129d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x129d('0x4'));var util=require(_0x129d('0x5'));var path=require(_0x129d('0x6'));var sox=require('sox');var csv=require(_0x129d('0x7'));var ejs=require(_0x129d('0x8'));var fs=require('fs');var _=require(_0x129d('0x9'));var squel=require(_0x129d('0xa'));var crypto=require(_0x129d('0xb'));var jsforce=require(_0x129d('0xc'));var deskjs=require(_0x129d('0xd'));var toCsv=require(_0x129d('0x7'));var querystring=require(_0x129d('0xe'));var Papa=require(_0x129d('0xf'));var Redis=require(_0x129d('0x10'));var authService=require(_0x129d('0x11'));var qs=require(_0x129d('0x12'));var hardwareService=require(_0x129d('0x13'));var logger=require(_0x129d('0x14'))(_0x129d('0x15'));var utils=require(_0x129d('0x16'));var config=require(_0x129d('0x17'));var db=require(_0x129d('0x18'))['db'];function respondWithStatusCode(_0x59f779,_0x11a0bc){_0x11a0bc=_0x11a0bc||0xcc;return function(_0x3f4f7d){if(_0x3f4f7d){return _0x59f779[_0x129d('0x19')](_0x11a0bc);}return _0x59f779[_0x129d('0x1a')](_0x11a0bc)['end']();};}function respondWithResult(_0x5c7709,_0x905fde){_0x905fde=_0x905fde||0xc8;return function(_0xf443cc){if(_0xf443cc){return _0x5c7709[_0x129d('0x1a')](_0x905fde)['json'](_0xf443cc);}};}function respondWithFilteredResult(_0x1909d4,_0x110591){return function(_0x3a5e42){if(_0x3a5e42){var _0x4011a4=_0x3a5e42['count'],_0x4b1c97=_0x110591[_0x129d('0x1b')],_0x5717fc=_0x110591[_0x129d('0x1b')]+_0x110591[_0x129d('0x1c')],_0x5ce637;if(_0x5717fc>=_0x4011a4){_0x5717fc=_0x4011a4;_0x5ce637=0xc8;}else{_0x5ce637=0xce;}_0x1909d4[_0x129d('0x1a')](_0x5ce637);return _0x1909d4[_0x129d('0x1d')](_0x129d('0x1e'),_0x4b1c97+'-'+_0x5717fc+'/'+_0x4011a4)[_0x129d('0x1f')](_0x3a5e42);}return null;};}function patchUpdates(_0x56b39a){return function(_0x33dcfa){try{jsonpatch[_0x129d('0x20')](_0x33dcfa,_0x56b39a,!![]);}catch(_0x1c4836){return BPromise[_0x129d('0x21')](_0x1c4836);}return _0x33dcfa['save']();};}function saveUpdates(_0x17495b,_0x48127e){return function(_0xf601e6){if(_0xf601e6){return _0xf601e6[_0x129d('0x22')](_0x17495b)[_0x129d('0x23')](function(_0x4dbcd9){return _0x4dbcd9;});}return null;};}function removeEntity(_0x4da684,_0x18165c){return function(_0x3527){if(_0x3527){return _0x3527[_0x129d('0x24')]()[_0x129d('0x23')](function(){var _0xe1e8d1=_0x3527[_0x129d('0x25')]({'plain':!![]});var _0x326262=_0x129d('0x26');return db[_0x129d('0x27')][_0x129d('0x24')]({'where':{'type':_0x326262,'resourceId':_0xe1e8d1['id']}})[_0x129d('0x23')](function(){return _0x3527;});})[_0x129d('0x23')](function(){_0x4da684[_0x129d('0x1a')](0xcc)[_0x129d('0x28')]();});}};}function handleEntityNotFound(_0x1b6556,_0x57d75a){return function(_0x129f24){if(!_0x129f24){_0x1b6556[_0x129d('0x19')](0x194);}return _0x129f24;};}function handleError(_0xb569c6,_0xc5892f){_0xc5892f=_0xc5892f||0x1f4;return function(_0x3a23f0){logger['error'](_0x3a23f0[_0x129d('0x29')]);if(_0x3a23f0[_0x129d('0x2a')]){delete _0x3a23f0[_0x129d('0x2a')];}_0xb569c6[_0x129d('0x1a')](_0xc5892f)[_0x129d('0x2b')](_0x3a23f0);};}exports[_0x129d('0x2c')]=function(_0x6d672,_0x327bf8){var _0x2d343e={},_0x21ab0c={},_0x797cc9={'count':0x0,'rows':[]};var _0x38d157=db[_0x129d('0x2d')][_0x129d('0x2e')];_0x21ab0c[_0x129d('0x2f')]=_[_0x129d('0x30')](_0x38d157);_0x21ab0c[_0x129d('0x31')]=_[_0x129d('0x30')](_0x6d672['query']);_0x21ab0c[_0x129d('0x32')]=_[_0x129d('0x33')](_0x21ab0c[_0x129d('0x2f')],_0x21ab0c[_0x129d('0x31')]);_0x2d343e['attributes']=_[_0x129d('0x33')](_0x21ab0c[_0x129d('0x2f')],qs[_0x129d('0x34')](_0x6d672['query']['fields']));_0x2d343e[_0x129d('0x35')]=_0x2d343e[_0x129d('0x35')][_0x129d('0x36')]?_0x2d343e[_0x129d('0x35')]:_0x21ab0c[_0x129d('0x2f')];if(!_0x6d672['query']['hasOwnProperty'](_0x129d('0x37'))){_0x2d343e['limit']=qs[_0x129d('0x1c')](_0x6d672[_0x129d('0x31')][_0x129d('0x1c')]);_0x2d343e[_0x129d('0x1b')]=qs['offset'](_0x6d672[_0x129d('0x31')]['offset']);}_0x2d343e['order']=qs[_0x129d('0x38')](_0x6d672[_0x129d('0x31')][_0x129d('0x38')]);_0x2d343e[_0x129d('0x39')]=qs['filters'](_[_0x129d('0x3a')](_0x6d672[_0x129d('0x31')],_0x21ab0c[_0x129d('0x32')]));if(_0x6d672[_0x129d('0x31')][_0x129d('0x3b')]){_0x2d343e[_0x129d('0x39')]=_[_0x129d('0x3c')](_0x2d343e['where'],{'$or':_[_0x129d('0x3d')](_0x38d157,function(_0x3dbfdf){if(_0x3dbfdf[_0x129d('0x3e')][_0x129d('0x3f')]!==_0x129d('0x40')){var _0x87b334={};_0x87b334[_0x3dbfdf[_0x129d('0x41')]]={'$like':'%'+_0x6d672[_0x129d('0x31')][_0x129d('0x3b')]+'%'};return _0x87b334;}})});}_0x2d343e=_[_0x129d('0x3c')]({},_0x2d343e,_0x6d672[_0x129d('0x42')]);var _0x5499cf={'where':_0x2d343e[_0x129d('0x39')]};return db[_0x129d('0x2d')]['count'](_0x5499cf)['then'](function(_0xf624f3){_0x797cc9['count']=_0xf624f3;if(_0x6d672[_0x129d('0x31')][_0x129d('0x43')]){_0x2d343e[_0x129d('0x44')]=[{'all':!![]}];}return db[_0x129d('0x2d')][_0x129d('0x45')](_0x2d343e);})[_0x129d('0x23')](function(_0xc09c30){_0x797cc9[_0x129d('0x46')]=_0xc09c30;return _0x797cc9;})[_0x129d('0x23')](respondWithFilteredResult(_0x327bf8,_0x2d343e))['catch'](handleError(_0x327bf8,null));};exports[_0x129d('0x47')]=function(_0x27838f,_0x1e8a8c){var _0xa6951c={'raw':![],'where':{'id':_0x27838f[_0x129d('0x48')]['id']}},_0x8b5b3f={};_0x8b5b3f[_0x129d('0x2f')]=_[_0x129d('0x30')](db['VoiceChanSpy'][_0x129d('0x2e')]);_0x8b5b3f[_0x129d('0x31')]=_[_0x129d('0x30')](_0x27838f[_0x129d('0x31')]);_0x8b5b3f[_0x129d('0x32')]=_['intersection'](_0x8b5b3f[_0x129d('0x2f')],_0x8b5b3f[_0x129d('0x31')]);_0xa6951c['attributes']=_[_0x129d('0x33')](_0x8b5b3f[_0x129d('0x2f')],qs[_0x129d('0x34')](_0x27838f[_0x129d('0x31')]['fields']));_0xa6951c[_0x129d('0x35')]=_0xa6951c['attributes'][_0x129d('0x36')]?_0xa6951c['attributes']:_0x8b5b3f[_0x129d('0x2f')];if(_0x27838f[_0x129d('0x31')][_0x129d('0x43')]){_0xa6951c['include']=[{'all':!![]}];}_0xa6951c=_[_0x129d('0x3c')]({},_0xa6951c,_0x27838f[_0x129d('0x42')]);return db['VoiceChanSpy'][_0x129d('0x49')](_0xa6951c)['then'](handleEntityNotFound(_0x1e8a8c,null))[_0x129d('0x23')](respondWithResult(_0x1e8a8c,null))[_0x129d('0x4a')](handleError(_0x1e8a8c,null));};exports[_0x129d('0x4b')]=function(_0x5ab399,_0x48ba67){return db[_0x129d('0x2d')][_0x129d('0x4b')](_0x5ab399[_0x129d('0x4c')],{})[_0x129d('0x23')](function(_0x2ee015){var _0x5ba49d=_0x5ab399[_0x129d('0x4d')][_0x129d('0x25')]({'plain':!![]});if(!_0x5ba49d)throw new Error(_0x129d('0x4e'));if(_0x5ba49d[_0x129d('0x4f')]===_0x129d('0x4d')){var _0x50888d=_0x2ee015[_0x129d('0x25')]({'plain':!![]});var _0x5ae246=_0x129d('0x26');return db[_0x129d('0x50')]['find']({'where':{'name':_0x5ae246,'userProfileId':_0x5ba49d[_0x129d('0x51')]},'raw':!![]})[_0x129d('0x23')](function(_0x12b62b){if(_0x12b62b&&_0x12b62b['autoAssociation']===0x0){return db[_0x129d('0x27')][_0x129d('0x4b')]({'name':_0x50888d['name'],'resourceId':_0x50888d['id'],'type':_0x12b62b[_0x129d('0x2a')],'sectionId':_0x12b62b['id']},{})[_0x129d('0x23')](function(){return _0x2ee015;});}else{return _0x2ee015;}})[_0x129d('0x4a')](function(_0x40050e){logger[_0x129d('0x52')](_0x129d('0x53'),_0x40050e);throw _0x40050e;});}return _0x2ee015;})[_0x129d('0x23')](respondWithResult(_0x48ba67,0xc9))[_0x129d('0x4a')](handleError(_0x48ba67,null));};exports['update']=function(_0x19d903,_0x1c9ec3){if(_0x19d903['body']['id']){delete _0x19d903[_0x129d('0x4c')]['id'];}return db[_0x129d('0x2d')][_0x129d('0x49')]({'where':{'id':_0x19d903[_0x129d('0x48')]['id']}})[_0x129d('0x23')](handleEntityNotFound(_0x1c9ec3,null))['then'](saveUpdates(_0x19d903[_0x129d('0x4c')],null))[_0x129d('0x23')](respondWithResult(_0x1c9ec3,null))[_0x129d('0x4a')](handleError(_0x1c9ec3,null));};exports['destroy']=function(_0x43a0b1,_0x30aaa4){return db['VoiceChanSpy'][_0x129d('0x49')]({'where':{'id':_0x43a0b1[_0x129d('0x48')]['id']}})['then'](handleEntityNotFound(_0x30aaa4,null))['then'](removeEntity(_0x30aaa4,null))[_0x129d('0x4a')](handleError(_0x30aaa4,null));}; \ No newline at end of file +var _0xa8ec=['count','offset','set','Content-Range','apply','save','destroy','then','get','ChanSpies','error','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','merge','where','type','key','field','filter','options','VoiceChanSpy','includeAll','rows','catch','params','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x4acd8e,_0x124a4c){var _0x5bc78c=function(_0x137ba7){while(--_0x137ba7){_0x4acd8e['push'](_0x4acd8e['shift']());}};_0x5bc78c(++_0x124a4c);}(_0xa8ec,0xd5));var _0xca8e=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xa8ec[_0x25e7cb];return _0x375d92;};'use strict';var pdf=require(_0xca8e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xca8e('0x1'));var rp=require(_0xca8e('0x2'));var moment=require('moment');var BPromise=require(_0xca8e('0x3'));var Mustache=require(_0xca8e('0x4'));var util=require(_0xca8e('0x5'));var path=require(_0xca8e('0x6'));var sox=require(_0xca8e('0x7'));var csv=require(_0xca8e('0x8'));var ejs=require(_0xca8e('0x9'));var fs=require('fs');var _=require(_0xca8e('0xa'));var squel=require(_0xca8e('0xb'));var crypto=require(_0xca8e('0xc'));var jsforce=require(_0xca8e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xca8e('0x8'));var querystring=require(_0xca8e('0xe'));var Papa=require(_0xca8e('0xf'));var Redis=require(_0xca8e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xca8e('0x11'));var hardwareService=require(_0xca8e('0x12'));var logger=require('../../config/logger')(_0xca8e('0x13'));var utils=require(_0xca8e('0x14'));var config=require(_0xca8e('0x15'));var db=require(_0xca8e('0x16'))['db'];function respondWithStatusCode(_0x229e05,_0x5e0995){_0x5e0995=_0x5e0995||0xcc;return function(_0x1c15ba){if(_0x1c15ba){return _0x229e05[_0xca8e('0x17')](_0x5e0995);}return _0x229e05[_0xca8e('0x18')](_0x5e0995)[_0xca8e('0x19')]();};}function respondWithResult(_0xf51cf,_0x9a2b4c){_0x9a2b4c=_0x9a2b4c||0xc8;return function(_0x1d7ab5){if(_0x1d7ab5){return _0xf51cf[_0xca8e('0x18')](_0x9a2b4c)[_0xca8e('0x1a')](_0x1d7ab5);}};}function respondWithFilteredResult(_0x390a5c,_0x4e2a9c){return function(_0x162e80){if(_0x162e80){var _0x15db9d=_0x162e80[_0xca8e('0x1b')],_0x10d29b=_0x4e2a9c[_0xca8e('0x1c')],_0x4012b6=_0x4e2a9c[_0xca8e('0x1c')]+_0x4e2a9c['limit'],_0x47c711;if(_0x4012b6>=_0x15db9d){_0x4012b6=_0x15db9d;_0x47c711=0xc8;}else{_0x47c711=0xce;}_0x390a5c[_0xca8e('0x18')](_0x47c711);return _0x390a5c[_0xca8e('0x1d')](_0xca8e('0x1e'),_0x10d29b+'-'+_0x4012b6+'/'+_0x15db9d)[_0xca8e('0x1a')](_0x162e80);}return null;};}function patchUpdates(_0x405244){return function(_0x18c877){try{jsonpatch[_0xca8e('0x1f')](_0x18c877,_0x405244,!![]);}catch(_0x58b86f){return BPromise['reject'](_0x58b86f);}return _0x18c877[_0xca8e('0x20')]();};}function saveUpdates(_0x20dd78,_0x462692){return function(_0x5d07b4){if(_0x5d07b4){return _0x5d07b4['update'](_0x20dd78)['then'](function(_0x4612fd){return _0x4612fd;});}return null;};}function removeEntity(_0x139a92,_0x3b0544){return function(_0x567423){if(_0x567423){return _0x567423[_0xca8e('0x21')]()[_0xca8e('0x22')](function(){var _0x1e027d=_0x567423[_0xca8e('0x23')]({'plain':!![]});var _0x41a199=_0xca8e('0x24');return db['UserProfileResource'][_0xca8e('0x21')]({'where':{'type':_0x41a199,'resourceId':_0x1e027d['id']}})[_0xca8e('0x22')](function(){return _0x567423;});})[_0xca8e('0x22')](function(){_0x139a92[_0xca8e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56b68b,_0x16c619){return function(_0x5565e4){if(!_0x5565e4){_0x56b68b[_0xca8e('0x17')](0x194);}return _0x5565e4;};}function handleError(_0x1203d1,_0x387025){_0x387025=_0x387025||0x1f4;return function(_0xc4ab15){logger[_0xca8e('0x25')](_0xc4ab15[_0xca8e('0x26')]);if(_0xc4ab15['name']){delete _0xc4ab15[_0xca8e('0x27')];}_0x1203d1[_0xca8e('0x18')](_0x387025)[_0xca8e('0x28')](_0xc4ab15);};}exports[_0xca8e('0x29')]=function(_0x1e6bd3,_0x26f7ed){var _0x107250={},_0x34ea50={},_0x4fdc61={'count':0x0,'rows':[]};var _0x52e28f=db['VoiceChanSpy'][_0xca8e('0x2a')];_0x34ea50[_0xca8e('0x2b')]=_[_0xca8e('0x2c')](_0x52e28f);_0x34ea50[_0xca8e('0x2d')]=_['keys'](_0x1e6bd3[_0xca8e('0x2d')]);_0x34ea50[_0xca8e('0x2e')]=_['intersection'](_0x34ea50['model'],_0x34ea50[_0xca8e('0x2d')]);_0x107250[_0xca8e('0x2f')]=_['intersection'](_0x34ea50[_0xca8e('0x2b')],qs[_0xca8e('0x30')](_0x1e6bd3['query'][_0xca8e('0x30')]));_0x107250['attributes']=_0x107250[_0xca8e('0x2f')][_0xca8e('0x31')]?_0x107250[_0xca8e('0x2f')]:_0x34ea50[_0xca8e('0x2b')];if(!_0x1e6bd3[_0xca8e('0x2d')][_0xca8e('0x32')](_0xca8e('0x33'))){_0x107250[_0xca8e('0x34')]=qs['limit'](_0x1e6bd3[_0xca8e('0x2d')]['limit']);_0x107250['offset']=qs[_0xca8e('0x1c')](_0x1e6bd3[_0xca8e('0x2d')][_0xca8e('0x1c')]);}_0x107250[_0xca8e('0x35')]=qs[_0xca8e('0x36')](_0x1e6bd3['query'][_0xca8e('0x36')]);_0x107250['where']=qs[_0xca8e('0x2e')](_['pick'](_0x1e6bd3[_0xca8e('0x2d')],_0x34ea50[_0xca8e('0x2e')]));if(_0x1e6bd3['query']['filter']){_0x107250['where']=_[_0xca8e('0x37')](_0x107250[_0xca8e('0x38')],{'$or':_['map'](_0x52e28f,function(_0x3d2f9a){if(_0x3d2f9a[_0xca8e('0x39')][_0xca8e('0x3a')]!=='VIRTUAL'){var _0xafe3df={};_0xafe3df[_0x3d2f9a[_0xca8e('0x3b')]]={'$like':'%'+_0x1e6bd3['query'][_0xca8e('0x3c')]+'%'};return _0xafe3df;}})});}_0x107250=_[_0xca8e('0x37')]({},_0x107250,_0x1e6bd3[_0xca8e('0x3d')]);var _0x177cd0={'where':_0x107250[_0xca8e('0x38')]};return db[_0xca8e('0x3e')][_0xca8e('0x1b')](_0x177cd0)['then'](function(_0x1fdf60){_0x4fdc61[_0xca8e('0x1b')]=_0x1fdf60;if(_0x1e6bd3[_0xca8e('0x2d')][_0xca8e('0x3f')]){_0x107250['include']=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x107250);})[_0xca8e('0x22')](function(_0x3f570a){_0x4fdc61[_0xca8e('0x40')]=_0x3f570a;return _0x4fdc61;})[_0xca8e('0x22')](respondWithFilteredResult(_0x26f7ed,_0x107250))[_0xca8e('0x41')](handleError(_0x26f7ed,null));};exports['show']=function(_0x42fb44,_0x29a5ac){var _0x306d28={'raw':![],'where':{'id':_0x42fb44[_0xca8e('0x42')]['id']}},_0x3e82c2={};_0x3e82c2[_0xca8e('0x2b')]=_[_0xca8e('0x2c')](db[_0xca8e('0x3e')]['rawAttributes']);_0x3e82c2[_0xca8e('0x2d')]=_['keys'](_0x42fb44['query']);_0x3e82c2[_0xca8e('0x2e')]=_[_0xca8e('0x43')](_0x3e82c2['model'],_0x3e82c2[_0xca8e('0x2d')]);_0x306d28[_0xca8e('0x2f')]=_[_0xca8e('0x43')](_0x3e82c2['model'],qs[_0xca8e('0x30')](_0x42fb44[_0xca8e('0x2d')]['fields']));_0x306d28[_0xca8e('0x2f')]=_0x306d28['attributes'][_0xca8e('0x31')]?_0x306d28[_0xca8e('0x2f')]:_0x3e82c2[_0xca8e('0x2b')];if(_0x42fb44[_0xca8e('0x2d')][_0xca8e('0x3f')]){_0x306d28[_0xca8e('0x44')]=[{'all':!![]}];}_0x306d28=_[_0xca8e('0x37')]({},_0x306d28,_0x42fb44[_0xca8e('0x3d')]);return db[_0xca8e('0x3e')][_0xca8e('0x45')](_0x306d28)[_0xca8e('0x22')](handleEntityNotFound(_0x29a5ac,null))[_0xca8e('0x22')](respondWithResult(_0x29a5ac,null))[_0xca8e('0x41')](handleError(_0x29a5ac,null));};exports[_0xca8e('0x46')]=function(_0xcf7581,_0x1385e0){return db['VoiceChanSpy'][_0xca8e('0x46')](_0xcf7581[_0xca8e('0x47')],{})[_0xca8e('0x22')](function(_0x1b8f2b){var _0x4e04ce=_0xcf7581[_0xca8e('0x48')]['get']({'plain':!![]});if(!_0x4e04ce)throw new Error(_0xca8e('0x49'));if(_0x4e04ce[_0xca8e('0x4a')]===_0xca8e('0x48')){var _0x529897=_0x1b8f2b[_0xca8e('0x23')]({'plain':!![]});var _0x1fe4bd=_0xca8e('0x24');return db[_0xca8e('0x4b')][_0xca8e('0x45')]({'where':{'name':_0x1fe4bd,'userProfileId':_0x4e04ce[_0xca8e('0x4c')]},'raw':!![]})[_0xca8e('0x22')](function(_0x1259d1){if(_0x1259d1&&_0x1259d1[_0xca8e('0x4d')]===0x0){return db[_0xca8e('0x4e')][_0xca8e('0x46')]({'name':_0x529897[_0xca8e('0x27')],'resourceId':_0x529897['id'],'type':_0x1259d1[_0xca8e('0x27')],'sectionId':_0x1259d1['id']},{})[_0xca8e('0x22')](function(){return _0x1b8f2b;});}else{return _0x1b8f2b;}})['catch'](function(_0xe13315){logger['error'](_0xca8e('0x4f'),_0xe13315);throw _0xe13315;});}return _0x1b8f2b;})[_0xca8e('0x22')](respondWithResult(_0x1385e0,0xc9))[_0xca8e('0x41')](handleError(_0x1385e0,null));};exports['update']=function(_0x1ee3bc,_0xa23b4f){if(_0x1ee3bc[_0xca8e('0x47')]['id']){delete _0x1ee3bc['body']['id'];}return db[_0xca8e('0x3e')]['find']({'where':{'id':_0x1ee3bc['params']['id']}})[_0xca8e('0x22')](handleEntityNotFound(_0xa23b4f,null))[_0xca8e('0x22')](saveUpdates(_0x1ee3bc[_0xca8e('0x47')],null))[_0xca8e('0x22')](respondWithResult(_0xa23b4f,null))[_0xca8e('0x41')](handleError(_0xa23b4f,null));};exports[_0xca8e('0x21')]=function(_0x143816,_0x2eb958){return db[_0xca8e('0x3e')][_0xca8e('0x45')]({'where':{'id':_0x143816[_0xca8e('0x42')]['id']}})['then'](handleEntityNotFound(_0x2eb958,null))[_0xca8e('0x22')](removeEntity(_0x2eb958,null))['catch'](handleError(_0x2eb958,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 15dd550..4f3ade1 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.model.js +++ b/server/api/voiceChanSpy/voiceChanSpy.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed3d=['name','options','join','StopMixMonitor','length','concat','internal','User','agent','then','catch','exports','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','chanspy','MixMonitor','Authenticate','password','SIP/%s,%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed3d,0x1f1));var _0xded3=function(_0x3822bd,_0x552f33){_0x3822bd=_0x3822bd-0x0;var _0x43a876=_0xed3d[_0x3822bd];return _0x43a876;};'use strict';var _=require(_0xded3('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require(_0xded3('0x1'));var getUserApplications=function(_0x39e6b6,_0x149f0a,_0x2929fb){var _0x2091d2=0x1;var _0x27441b=[];var _0x3b3a03={'context':_0x149f0a[_0xded3('0x2')]||_0xded3('0x3'),'exten':util[_0xded3('0x4')](_0xded3('0x5'),_0x39e6b6[_0xded3('0x6')],_0x2929fb),'type':_0xded3('0x7'),'isApp':![],'ChanSpyId':_0x39e6b6['id'],'UserId':_0x149f0a['id']};_0x27441b[_0xded3('0x8')](_[_0xded3('0x9')]({'app':'Set','appdata':util[_0xded3('0x4')]('CDR(type)=%s',_0xded3('0xa')),'priority':_0x2091d2++},_0x3b3a03));if(_0x39e6b6['record']){_0x27441b[_0xded3('0x8')](_['merge']({'app':_0xded3('0xb'),'appdata':util[_0xded3('0x4')]('${UNIQUEID}.%s,ab',_0x39e6b6['recordingFormat']),'priority':_0x2091d2++},_0x3b3a03));}if(_0x39e6b6['auth']){_0x27441b[_0xded3('0x8')](_[_0xded3('0x9')]({'app':_0xded3('0xc'),'appdata':_0x39e6b6[_0xded3('0xd')],'priority':_0x2091d2++},_0x3b3a03));}_0x27441b[_0xded3('0x8')](_[_0xded3('0x9')]({'app':'ChanSpy','appdata':util['format'](_0xded3('0xe'),_0x149f0a[_0xded3('0xf')],_0x39e6b6[_0xded3('0x10')]?_0x39e6b6[_0xded3('0x10')][_0xded3('0x11')](''):''),'priority':_0x2091d2++},_0x3b3a03));if(_0x39e6b6['record']){_0x27441b[_0xded3('0x8')](_['merge']({'app':_0xded3('0x12'),'priority':_0x2091d2++},_0x3b3a03));}return _0x27441b;};var getChanSpyApplications=function(_0x43abcf,_0x3e5dae){var _0x505a16=[];for(var _0x1625f9=0x0,_0x2cce04=0x1;_0x1625f9<_0x3e5dae[_0xded3('0x13')];_0x1625f9++,_0x2cce04=0x1){_0x505a16=_0x505a16[_0xded3('0x14')](getUserApplications(_0x43abcf,_0x3e5dae[_0x1625f9],_0x3e5dae[_0x1625f9][_0xded3('0x15')]));if(_0x3e5dae[_0x1625f9][_0xded3('0x15')]!=_0x3e5dae[_0x1625f9][_0xded3('0xf')]){_0x505a16=_0x505a16['concat'](getUserApplications(_0x43abcf,_0x3e5dae[_0x1625f9],_0x3e5dae[_0x1625f9][_0xded3('0xf')]));}}return _0x505a16;};var getChanSpyPromise=function(_0x1c9510,_0x50dbf8){return new BPromise(function(_0x4de09b,_0x1f0393){return _0x1c9510[_0xded3('0x16')]['findAll']({'attributes':['id','name','internal'],'where':{'role':_0xded3('0x17'),'chanspy':!![]},'raw':!![]})[_0xded3('0x18')](function(_0x52b28f){if(_0x52b28f){return _0x4de09b(getChanSpyApplications(_0x50dbf8,_0x52b28f));}return _0x4de09b([]);})[_0xded3('0x19')](function(_0x5cfabf){_0x1f0393(_0x5cfabf);});});};module[_0xded3('0x1a')]=function(_0x9ff282,_0x487993){var _0x338f11=_0x9ff282['models'];return _0x9ff282[_0xded3('0x1b')](_0xded3('0x1c'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b23d5,_0x2de016,_0x4db6fa){return getChanSpyPromise(_0x338f11,_0x4b23d5)[_0xded3('0x18')](function(_0x576d69){if(_0x576d69&&_0x576d69[_0xded3('0x13')]){return _0x338f11[_0xded3('0x1d')]['bulkCreate'](_0x576d69);}})[_0xded3('0x18')](function(){_0x4db6fa();})['catch'](function(_0x1a82c4){_0x4db6fa(_0x1a82c4);});},'afterUpdate':function(_0x4325e7,_0x55ed68,_0x2e94f7){return _0x338f11['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x4325e7['id']}})[_0xded3('0x18')](function(){return getChanSpyPromise(_0x338f11,_0x4325e7);})['then'](function(_0x1e3c1a){if(_0x1e3c1a&&_0x1e3c1a[_0xded3('0x13')]){return _0x338f11[_0xded3('0x1d')][_0xded3('0x1e')](_0x1e3c1a);}})[_0xded3('0x18')](function(){_0x2e94f7();})[_0xded3('0x19')](function(_0xe04712){_0x2e94f7(_0xe04712);});},'afterDestroy':function(_0x2558b3,_0x3fb12f,_0x19a9de){return _0x338f11['VoiceExtension'][_0xded3('0x1f')]({'where':{'ChanSpyId':_0x2558b3['id']}})['then'](function(){_0x19a9de();})[_0xded3('0x19')](function(_0x458347){_0x19a9de(_0x458347);});}}});}; \ No newline at end of file +var _0x5d9e=['then','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','catch','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','record','MixMonitor','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','findAll','agent'];(function(_0x4c148b,_0x45022f){var _0x37fad4=function(_0x208538){while(--_0x208538){_0x4c148b['push'](_0x4c148b['shift']());}};_0x37fad4(++_0x45022f);}(_0x5d9e,0x13a));var _0xe5d9=function(_0x3fa22f,_0x4dcdec){_0x3fa22f=_0x3fa22f-0x0;var _0x132455=_0x5d9e[_0x3fa22f];return _0x132455;};'use strict';var _=require(_0xe5d9('0x0'));var util=require('util');var BPromise=require(_0xe5d9('0x1'));var attributes=require(_0xe5d9('0x2'));var getUserApplications=function(_0x48fd54,_0x3339c3,_0x8292bc){var _0x3196a0=0x1;var _0x4c195d=[];var _0x1c9a15={'context':_0x3339c3[_0xe5d9('0x3')]||_0xe5d9('0x4'),'exten':util[_0xe5d9('0x5')](_0xe5d9('0x6'),_0x48fd54[_0xe5d9('0x7')],_0x8292bc),'type':_0xe5d9('0x8'),'isApp':![],'ChanSpyId':_0x48fd54['id'],'UserId':_0x3339c3['id']};_0x4c195d[_0xe5d9('0x9')](_[_0xe5d9('0xa')]({'app':'Set','appdata':util[_0xe5d9('0x5')](_0xe5d9('0xb'),'chanspy'),'priority':_0x3196a0++},_0x1c9a15));if(_0x48fd54[_0xe5d9('0xc')]){_0x4c195d['push'](_[_0xe5d9('0xa')]({'app':_0xe5d9('0xd'),'appdata':util[_0xe5d9('0x5')]('${UNIQUEID}.%s,ab',_0x48fd54[_0xe5d9('0xe')]),'priority':_0x3196a0++},_0x1c9a15));}if(_0x48fd54[_0xe5d9('0xf')]){_0x4c195d['push'](_[_0xe5d9('0xa')]({'app':_0xe5d9('0x10'),'appdata':_0x48fd54[_0xe5d9('0x11')],'priority':_0x3196a0++},_0x1c9a15));}_0x4c195d[_0xe5d9('0x9')](_['merge']({'app':_0xe5d9('0x12'),'appdata':util[_0xe5d9('0x5')](_0xe5d9('0x13'),_0x3339c3[_0xe5d9('0x14')],_0x48fd54[_0xe5d9('0x15')]?_0x48fd54[_0xe5d9('0x15')]['join'](''):''),'priority':_0x3196a0++},_0x1c9a15));if(_0x48fd54[_0xe5d9('0xc')]){_0x4c195d[_0xe5d9('0x9')](_[_0xe5d9('0xa')]({'app':_0xe5d9('0x16'),'priority':_0x3196a0++},_0x1c9a15));}return _0x4c195d;};var getChanSpyApplications=function(_0x54f4ca,_0x36a8bd){var _0x5d570a=[];for(var _0x21c07a=0x0,_0x61eb74=0x1;_0x21c07a<_0x36a8bd[_0xe5d9('0x17')];_0x21c07a++,_0x61eb74=0x1){_0x5d570a=_0x5d570a[_0xe5d9('0x18')](getUserApplications(_0x54f4ca,_0x36a8bd[_0x21c07a],_0x36a8bd[_0x21c07a]['internal']));if(_0x36a8bd[_0x21c07a][_0xe5d9('0x19')]!=_0x36a8bd[_0x21c07a]['name']){_0x5d570a=_0x5d570a[_0xe5d9('0x18')](getUserApplications(_0x54f4ca,_0x36a8bd[_0x21c07a],_0x36a8bd[_0x21c07a]['name']));}}return _0x5d570a;};var getChanSpyPromise=function(_0x2c04db,_0x47f500){return new BPromise(function(_0x2dcb8c,_0x22adbb){return _0x2c04db['User'][_0xe5d9('0x1a')]({'attributes':['id',_0xe5d9('0x14'),_0xe5d9('0x19')],'where':{'role':_0xe5d9('0x1b'),'chanspy':!![]},'raw':!![]})[_0xe5d9('0x1c')](function(_0x14109c){if(_0x14109c){return _0x2dcb8c(getChanSpyApplications(_0x47f500,_0x14109c));}return _0x2dcb8c([]);})['catch'](function(_0x4bb7c1){_0x22adbb(_0x4bb7c1);});});};module[_0xe5d9('0x1d')]=function(_0x293a49,_0x2724ae){var _0x376969=_0x293a49[_0xe5d9('0x1e')];return _0x293a49[_0xe5d9('0x1f')](_0xe5d9('0x20'),attributes,{'tableName':_0xe5d9('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x24b3d2,_0x592791,_0x4f9125){return getChanSpyPromise(_0x376969,_0x24b3d2)[_0xe5d9('0x1c')](function(_0x3f5892){if(_0x3f5892&&_0x3f5892['length']){return _0x376969[_0xe5d9('0x22')][_0xe5d9('0x23')](_0x3f5892);}})[_0xe5d9('0x1c')](function(){_0x4f9125();})['catch'](function(_0x4c4739){_0x4f9125(_0x4c4739);});},'afterUpdate':function(_0x392911,_0x3010eb,_0x4390e5){return _0x376969['VoiceExtension'][_0xe5d9('0x24')]({'where':{'ChanSpyId':_0x392911['id']}})[_0xe5d9('0x1c')](function(){return getChanSpyPromise(_0x376969,_0x392911);})['then'](function(_0x27776a){if(_0x27776a&&_0x27776a['length']){return _0x376969[_0xe5d9('0x22')]['bulkCreate'](_0x27776a);}})[_0xe5d9('0x1c')](function(){_0x4390e5();})['catch'](function(_0x1745eb){_0x4390e5(_0x1745eb);});},'afterDestroy':function(_0x12bf5f,_0x30fd65,_0x5409bd){return _0x376969[_0xe5d9('0x22')]['destroy']({'where':{'ChanSpyId':_0x12bf5f['id']}})['then'](function(){_0x5409bd();})[_0xe5d9('0x25')](function(_0x4a8c32){_0x5409bd(_0x4a8c32);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 97841e8..4080453 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js +++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3fa=['../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x362892,_0x2e9646){var _0x1f269a=function(_0x481b48){while(--_0x481b48){_0x362892['push'](_0x362892['shift']());}};_0x1f269a(++_0x2e9646);}(_0xa3fa,0x142));var _0xaa3f=function(_0x3619ba,_0x52a68f){_0x3619ba=_0x3619ba-0x0;var _0x5507db=_0xa3fa[_0x3619ba];return _0x5507db;};'use strict';var _=require(_0xaa3f('0x0'));var util=require(_0xaa3f('0x1'));var moment=require(_0xaa3f('0x2'));var BPromise=require(_0xaa3f('0x3'));var rs=require(_0xaa3f('0x4'));var fs=require('fs');var Redis=require(_0xaa3f('0x5'));var db=require(_0xaa3f('0x6'))['db'];var utils=require(_0xaa3f('0x7'));var logger=require(_0xaa3f('0x8'))(_0xaa3f('0x9'));var config=require('../../config/environment');var jayson=require(_0xaa3f('0xa'));var client=jayson['client'][_0xaa3f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bfed3,_0x1cd758,_0xf38b88){return new BPromise(function(_0x2a5cd1,_0x396ee2){return client[_0xaa3f('0xc')](_0x1bfed3,_0xf38b88)['then'](function(_0x3706d0){logger[_0xaa3f('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cd758,_0xaa3f('0xe'));logger[_0xaa3f('0xf')](_0xaa3f('0x10'),_0x1cd758,_0xaa3f('0xe'),JSON[_0xaa3f('0x11')](_0x3706d0));if(_0x3706d0[_0xaa3f('0x12')]){if(_0x3706d0[_0xaa3f('0x12')][_0xaa3f('0x13')]===0x1f4){logger[_0xaa3f('0x12')](_0xaa3f('0x14'),_0x1cd758,_0x3706d0[_0xaa3f('0x12')][_0xaa3f('0x15')]);return _0x396ee2(_0x3706d0[_0xaa3f('0x12')][_0xaa3f('0x15')]);}logger[_0xaa3f('0x12')](_0xaa3f('0x14'),_0x1cd758,_0x3706d0[_0xaa3f('0x12')]['message']);return _0x2a5cd1(_0x3706d0[_0xaa3f('0x12')][_0xaa3f('0x15')]);}else{logger[_0xaa3f('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cd758,_0xaa3f('0xe'));_0x2a5cd1(_0x3706d0['result'][_0xaa3f('0x15')]);}})['catch'](function(_0xbb3a7e){logger[_0xaa3f('0x12')](_0xaa3f('0x14'),_0x1cd758,_0xbb3a7e);_0x396ee2(_0xbb3a7e);});});} \ No newline at end of file +var _0xf379=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis'];(function(_0x43ae69,_0x503298){var _0x5d0f1c=function(_0x214a35){while(--_0x214a35){_0x43ae69['push'](_0x43ae69['shift']());}};_0x5d0f1c(++_0x503298);}(_0xf379,0x1b4));var _0x9f37=function(_0x46f7c0,_0x4c5ff0){_0x46f7c0=_0x46f7c0-0x0;var _0x43c478=_0xf379[_0x46f7c0];return _0x43c478;};'use strict';var _=require(_0x9f37('0x0'));var util=require(_0x9f37('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f37('0x2'));var fs=require('fs');var Redis=require(_0x9f37('0x3'));var db=require(_0x9f37('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f37('0x5'))(_0x9f37('0x6'));var config=require(_0x9f37('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9f37('0x8')][_0x9f37('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d6e6f,_0x3aedc6,_0x40e184){return new BPromise(function(_0x5c0462,_0x256442){return client[_0x9f37('0xa')](_0x1d6e6f,_0x40e184)[_0x9f37('0xb')](function(_0xb9d9d0){logger[_0x9f37('0xc')](_0x9f37('0xd'),_0x3aedc6,_0x9f37('0xe'));logger['debug'](_0x9f37('0xf'),_0x3aedc6,'request\x20sent',JSON[_0x9f37('0x10')](_0xb9d9d0));if(_0xb9d9d0[_0x9f37('0x11')]){if(_0xb9d9d0[_0x9f37('0x11')][_0x9f37('0x12')]===0x1f4){logger[_0x9f37('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x3aedc6,_0xb9d9d0[_0x9f37('0x11')]['message']);return _0x256442(_0xb9d9d0['error']['message']);}logger[_0x9f37('0x11')](_0x9f37('0xd'),_0x3aedc6,_0xb9d9d0['error'][_0x9f37('0x13')]);return _0x5c0462(_0xb9d9d0['error'][_0x9f37('0x13')]);}else{logger[_0x9f37('0xc')](_0x9f37('0xd'),_0x3aedc6,_0x9f37('0xe'));_0x5c0462(_0xb9d9d0[_0x9f37('0x14')][_0x9f37('0x13')]);}})[_0x9f37('0x15')](function(_0xea6fe3){logger['error'](_0x9f37('0xd'),_0x3aedc6,_0xea6fe3);_0x256442(_0xea6fe3);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 2979e2a..2b84909 100644 --- a/server/api/voiceContext/index.js +++ b/server/api/voiceContext/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb91b=['put','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','get','/:id','post','create'];(function(_0x28e7fc,_0x4b19af){var _0x4c4f67=function(_0x2d27e3){while(--_0x2d27e3){_0x28e7fc['push'](_0x28e7fc['shift']());}};_0x4c4f67(++_0x4b19af);}(_0xb91b,0x99));var _0xbb91=function(_0x6f41af,_0x3e5f65){_0x6f41af=_0x6f41af-0x0;var _0x3faea0=_0xb91b[_0x6f41af];return _0x3faea0;};'use strict';var multer=require('multer');var util=require(_0xbb91('0x0'));var path=require(_0xbb91('0x1'));var timeout=require(_0xbb91('0x2'));var express=require(_0xbb91('0x3'));var router=express[_0xbb91('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbb91('0x5'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router['get']('/',auth[_0xbb91('0x6')](),controller[_0xbb91('0x7')]);router[_0xbb91('0x8')](_0xbb91('0x9'),auth[_0xbb91('0x6')](),controller['show']);router[_0xbb91('0xa')]('/',auth[_0xbb91('0x6')](),controller[_0xbb91('0xb')]);router[_0xbb91('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xbb91('0xd')](_0xbb91('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xbb91('0xe')]=router; \ No newline at end of file +var _0xbd24=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xbd24,0xe7));var _0x4bd2=function(_0x2b7389,_0x58311b){_0x2b7389=_0x2b7389-0x0;var _0xe5d9da=_0xbd24[_0x2b7389];return _0xe5d9da;};'use strict';var multer=require(_0x4bd2('0x0'));var util=require('util');var path=require(_0x4bd2('0x1'));var timeout=require(_0x4bd2('0x2'));var express=require(_0x4bd2('0x3'));var router=express[_0x4bd2('0x4')]();var auth=require(_0x4bd2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4bd2('0x6'));router[_0x4bd2('0x7')]('/',auth[_0x4bd2('0x8')](),controller[_0x4bd2('0x9')]);router[_0x4bd2('0x7')](_0x4bd2('0xa'),auth[_0x4bd2('0x8')](),controller[_0x4bd2('0xb')]);router[_0x4bd2('0xc')]('/',auth[_0x4bd2('0x8')](),controller[_0x4bd2('0xd')]);router[_0x4bd2('0xe')](_0x4bd2('0xa'),auth[_0x4bd2('0x8')](),controller[_0x4bd2('0xf')]);router[_0x4bd2('0x10')](_0x4bd2('0xa'),auth['isAuthenticated'](),controller[_0x4bd2('0x11')]);module[_0x4bd2('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 5c98b08..8e77694 100644 --- a/server/api/voiceContext/voiceContext.attributes.js +++ b/server/api/voiceContext/voiceContext.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x5a4e58,_0x41442c){var _0x12279a=function(_0x3d15e0){while(--_0x3d15e0){_0x5a4e58['push'](_0x5a4e58['shift']());}};_0x12279a(++_0x41442c);}(_0x34e8,0x12c));var _0x834e=function(_0x5d0841,_0x43e9c8){_0x5d0841=_0x5d0841-0x0;var _0x46edf4=_0x34e8[_0x5d0841];return _0x46edf4;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'unique':_0x834e('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x834e('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3e74=['name','sequelize','STRING'];(function(_0x4b05f6,_0x57dd81){var _0xbb1a44=function(_0x1dd695){while(--_0x1dd695){_0x4b05f6['push'](_0x4b05f6['shift']());}};_0xbb1a44(++_0x57dd81);}(_0x3e74,0x175));var _0x43e7=function(_0x3b7ef4,_0xfb133b){_0x3b7ef4=_0x3b7ef4-0x0;var _0x4ff0d3=_0x3e74[_0x3b7ef4];return _0x4ff0d3;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'unique':_0x43e7('0x2')},'description':{'type':Sequelize[_0x43e7('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 666efd8..80d0ef1 100644 --- a/server/api/voiceContext/voiceContext.controller.js +++ b/server/api/voiceContext/voiceContext.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05c0=['json','count','offset','apply','save','update','destroy','get','Contexts','UserProfileResource','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','map','key','VIRTUAL','field','VoiceContext','includeAll','include','findAll','rows','show','params','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','end','status'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x05c0,0x166));var _0x005c=function(_0x355001,_0x14925a){_0x355001=_0x355001-0x0;var _0x59ea2f=_0x05c0[_0x355001];return _0x59ea2f;};'use strict';var pdf=require(_0x005c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x005c('0x1'));var zipdir=require(_0x005c('0x2'));var jsonpatch=require(_0x005c('0x3'));var rp=require(_0x005c('0x4'));var moment=require(_0x005c('0x5'));var BPromise=require(_0x005c('0x6'));var Mustache=require(_0x005c('0x7'));var util=require('util');var path=require(_0x005c('0x8'));var sox=require(_0x005c('0x9'));var csv=require('to-csv');var ejs=require(_0x005c('0xa'));var fs=require('fs');var _=require(_0x005c('0xb'));var squel=require(_0x005c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x005c('0xd'));var querystring=require(_0x005c('0xe'));var Papa=require(_0x005c('0xf'));var Redis=require(_0x005c('0x10'));var authService=require(_0x005c('0x11'));var qs=require(_0x005c('0x12'));var hardwareService=require(_0x005c('0x13'));var logger=require(_0x005c('0x14'))(_0x005c('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x005c('0x16'))['db'];var jayson=require(_0x005c('0x17'));var client=jayson[_0x005c('0x18')][_0x005c('0x19')]({'port':0x232a});function checkPasswordPattern(_0x217408,_0x2e4c3f,_0x15f5e9){if(_0x15f5e9){var _0x1c4727=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c4727[_0x005c('0x1a')](_0x2e4c3f)){return _0x217408;}else{throw new Error(_0x005c('0x1b'));}}else{return _0x217408;}}function respondWithRpcPromise(_0x4afbd9,_0x43543f,_0x1734fd,_0x1739b4){return new BPromise(function(_0x57739e,_0xb14653){var _0x2b09fc=_0x1739b4||client;return _0x2b09fc['request'](_0x4afbd9,_0x1734fd)[_0x005c('0x1c')](function(_0x432032){logger[_0x005c('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x43543f,_0x005c('0x1e'));logger[_0x005c('0x1f')](_0x005c('0x20'),_0x43543f,_0x005c('0x1e'),JSON['stringify'](_0x432032));if(_0x432032[_0x005c('0x21')]){if(_0x432032[_0x005c('0x21')][_0x005c('0x22')]===0x1f4){logger[_0x005c('0x21')](_0x005c('0x23'),_0x43543f,_0x432032[_0x005c('0x21')][_0x005c('0x24')]);return _0xb14653(_0x432032[_0x005c('0x21')][_0x005c('0x24')]);}logger[_0x005c('0x21')](_0x005c('0x23'),_0x43543f,_0x432032[_0x005c('0x21')]['message']);return _0x57739e(_0x432032[_0x005c('0x21')][_0x005c('0x24')]);}else{logger['info'](_0x005c('0x23'),_0x43543f,_0x005c('0x1e'));_0x57739e(_0x432032[_0x005c('0x25')]['message']);}})[_0x005c('0x26')](function(_0x25cd86){logger[_0x005c('0x21')](_0x005c('0x23'),_0x43543f,_0x25cd86);_0xb14653(_0x25cd86);});});}function respondWithStatusCode(_0x535f3b,_0x23c03e){_0x23c03e=_0x23c03e||0xcc;return function(_0x31c3ad){if(_0x31c3ad){return _0x535f3b[_0x005c('0x27')](_0x23c03e);}return _0x535f3b['status'](_0x23c03e)[_0x005c('0x28')]();};}function respondWithResult(_0xe75159,_0x37c731){_0x37c731=_0x37c731||0xc8;return function(_0x1b7e9b){if(_0x1b7e9b){return _0xe75159[_0x005c('0x29')](_0x37c731)[_0x005c('0x2a')](_0x1b7e9b);}};}function respondWithFilteredResult(_0x49d323,_0x10fa21){return function(_0x9596eb){if(_0x9596eb){var _0x2a6f51=_0x9596eb[_0x005c('0x2b')],_0x3e5da3=_0x10fa21[_0x005c('0x2c')],_0x2fd798=_0x10fa21[_0x005c('0x2c')]+_0x10fa21['limit'],_0xc56552;if(_0x2fd798>=_0x2a6f51){_0x2fd798=_0x2a6f51;_0xc56552=0xc8;}else{_0xc56552=0xce;}_0x49d323['status'](_0xc56552);return _0x49d323['set']('Content-Range',_0x3e5da3+'-'+_0x2fd798+'/'+_0x2a6f51)[_0x005c('0x2a')](_0x9596eb);}return null;};}function patchUpdates(_0x4c1696){return function(_0x159e85){try{jsonpatch[_0x005c('0x2d')](_0x159e85,_0x4c1696,!![]);}catch(_0x2d59a6){return BPromise['reject'](_0x2d59a6);}return _0x159e85[_0x005c('0x2e')]();};}function saveUpdates(_0x1d0ecc,_0x39916f){return function(_0x54b52b){if(_0x54b52b){return _0x54b52b[_0x005c('0x2f')](_0x1d0ecc)['then'](function(_0x105192){return _0x105192;});}return null;};}function removeEntity(_0x2264fd,_0x1ab671){return function(_0x2d7938){if(_0x2d7938){return _0x2d7938[_0x005c('0x30')]()[_0x005c('0x1c')](function(){var _0x5e1f4f=_0x2d7938[_0x005c('0x31')]({'plain':!![]});var _0x49b11f=_0x005c('0x32');return db[_0x005c('0x33')]['destroy']({'where':{'type':_0x49b11f,'resourceId':_0x5e1f4f['id']}})[_0x005c('0x1c')](function(){return _0x2d7938;});})[_0x005c('0x1c')](function(){_0x2264fd['status'](0xcc)[_0x005c('0x28')]();});}};}function handleEntityNotFound(_0x52ef1e,_0x47f269){return function(_0x38c9f0){if(!_0x38c9f0){_0x52ef1e[_0x005c('0x27')](0x194);}return _0x38c9f0;};}function handleError(_0x41b709,_0xd43ad6){_0xd43ad6=_0xd43ad6||0x1f4;return function(_0x6d0fe4){logger[_0x005c('0x21')](_0x6d0fe4['stack']);if(_0x6d0fe4[_0x005c('0x34')]){delete _0x6d0fe4[_0x005c('0x34')];}_0x41b709[_0x005c('0x29')](_0xd43ad6)[_0x005c('0x35')](_0x6d0fe4);};}exports[_0x005c('0x36')]=function(_0x3d3e58,_0x3dc6ca){var _0x4e0e5d={},_0x36a5bd={},_0x354fe1={'count':0x0,'rows':[]};var _0x350f0c=db['VoiceContext'][_0x005c('0x37')];_0x36a5bd[_0x005c('0x38')]=_[_0x005c('0x39')](_0x350f0c);_0x36a5bd[_0x005c('0x3a')]=_[_0x005c('0x39')](_0x3d3e58[_0x005c('0x3a')]);_0x36a5bd[_0x005c('0x3b')]=_[_0x005c('0x3c')](_0x36a5bd[_0x005c('0x38')],_0x36a5bd[_0x005c('0x3a')]);_0x4e0e5d[_0x005c('0x3d')]=_[_0x005c('0x3c')](_0x36a5bd[_0x005c('0x38')],qs[_0x005c('0x3e')](_0x3d3e58[_0x005c('0x3a')]['fields']));_0x4e0e5d[_0x005c('0x3d')]=_0x4e0e5d['attributes'][_0x005c('0x3f')]?_0x4e0e5d[_0x005c('0x3d')]:_0x36a5bd['model'];if(!_0x3d3e58[_0x005c('0x3a')]['hasOwnProperty'](_0x005c('0x40'))){_0x4e0e5d[_0x005c('0x41')]=qs[_0x005c('0x41')](_0x3d3e58[_0x005c('0x3a')][_0x005c('0x41')]);_0x4e0e5d[_0x005c('0x2c')]=qs[_0x005c('0x2c')](_0x3d3e58[_0x005c('0x3a')][_0x005c('0x2c')]);}_0x4e0e5d['order']=qs[_0x005c('0x42')](_0x3d3e58[_0x005c('0x3a')][_0x005c('0x42')]);_0x4e0e5d[_0x005c('0x43')]=qs['filters'](_[_0x005c('0x44')](_0x3d3e58[_0x005c('0x3a')],_0x36a5bd[_0x005c('0x3b')]));if(_0x3d3e58[_0x005c('0x3a')][_0x005c('0x45')]){_0x4e0e5d[_0x005c('0x43')]=_[_0x005c('0x46')](_0x4e0e5d[_0x005c('0x43')],{'$or':_[_0x005c('0x47')](_0x350f0c,function(_0x3946fb){if(_0x3946fb['type'][_0x005c('0x48')]!==_0x005c('0x49')){var _0x1ddd6a={};_0x1ddd6a[_0x3946fb[_0x005c('0x4a')]]={'$like':'%'+_0x3d3e58[_0x005c('0x3a')][_0x005c('0x45')]+'%'};return _0x1ddd6a;}})});}_0x4e0e5d=_[_0x005c('0x46')]({},_0x4e0e5d,_0x3d3e58['options']);var _0x96543e={'where':_0x4e0e5d[_0x005c('0x43')]};return db[_0x005c('0x4b')][_0x005c('0x2b')](_0x96543e)['then'](function(_0x5191be){_0x354fe1[_0x005c('0x2b')]=_0x5191be;if(_0x3d3e58[_0x005c('0x3a')][_0x005c('0x4c')]){_0x4e0e5d[_0x005c('0x4d')]=[{'all':!![]}];}return db[_0x005c('0x4b')][_0x005c('0x4e')](_0x4e0e5d);})[_0x005c('0x1c')](function(_0x45f7cc){_0x354fe1[_0x005c('0x4f')]=_0x45f7cc;return _0x354fe1;})[_0x005c('0x1c')](respondWithFilteredResult(_0x3dc6ca,_0x4e0e5d))['catch'](handleError(_0x3dc6ca,null));};exports[_0x005c('0x50')]=function(_0x42bc68,_0x12cc1a){var _0x106a52={'raw':![],'where':{'id':_0x42bc68[_0x005c('0x51')]['id']}},_0x13ecac={};_0x13ecac['model']=_['keys'](db[_0x005c('0x4b')]['rawAttributes']);_0x13ecac[_0x005c('0x3a')]=_[_0x005c('0x39')](_0x42bc68[_0x005c('0x3a')]);_0x13ecac[_0x005c('0x3b')]=_[_0x005c('0x3c')](_0x13ecac[_0x005c('0x38')],_0x13ecac[_0x005c('0x3a')]);_0x106a52[_0x005c('0x3d')]=_['intersection'](_0x13ecac[_0x005c('0x38')],qs[_0x005c('0x3e')](_0x42bc68[_0x005c('0x3a')][_0x005c('0x3e')]));_0x106a52[_0x005c('0x3d')]=_0x106a52['attributes'][_0x005c('0x3f')]?_0x106a52[_0x005c('0x3d')]:_0x13ecac['model'];if(_0x42bc68[_0x005c('0x3a')]['includeAll']){_0x106a52['include']=[{'all':!![]}];}_0x106a52=_['merge']({},_0x106a52,_0x42bc68['options']);return db[_0x005c('0x4b')][_0x005c('0x52')](_0x106a52)['then'](handleEntityNotFound(_0x12cc1a,null))[_0x005c('0x1c')](respondWithResult(_0x12cc1a,null))['catch'](handleError(_0x12cc1a,null));};exports['create']=function(_0x330ce5,_0x3f85ee,_0x23e0b8){var _0x448162;return db[_0x005c('0x4b')][_0x005c('0x53')](_0x330ce5[_0x005c('0x54')],{'raw':!![]})[_0x005c('0x1c')](function(_0x2ca459){_0x448162=_0x2ca459;return db[_0x005c('0x4b')]['findAll']({'raw':!![]});})[_0x005c('0x1c')](function(_0x35593c){var _0x3d03f1=fs[_0x005c('0x55')](path[_0x005c('0x56')](config[_0x005c('0x57')],_0x005c('0x58')),_0x005c('0x59'));var _0x3c1681=ejs['render'](_0x3d03f1,{'contexts':_0x35593c||[]});fs[_0x005c('0x5a')](_0x005c('0x5b'),_0x3c1681);})[_0x005c('0x1c')](function(){return respondWithRpcPromise(_0x005c('0x5c'),_0x005c('0x53'),{'module':_0x005c('0x5d')});})['then'](function(){var _0x51f9bf=_0x330ce5['user'][_0x005c('0x31')]({'plain':!![]});if(!_0x51f9bf)throw new Error(_0x005c('0x5e'));if(_0x51f9bf[_0x005c('0x5f')]==='user'){var _0x53e308=_0x448162[_0x005c('0x31')]({'plain':!![]});return db[_0x005c('0x60')]['find']({'where':{'name':_0x005c('0x32'),'userProfileId':_0x51f9bf[_0x005c('0x61')]},'raw':!![]})['then'](function(_0x4840a7){if(_0x4840a7&&_0x4840a7[_0x005c('0x62')]===0x0){return db[_0x005c('0x33')][_0x005c('0x53')]({'name':_0x53e308[_0x005c('0x34')],'resourceId':_0x53e308['id'],'type':_0x4840a7[_0x005c('0x34')],'sectionId':_0x4840a7['id']},{})[_0x005c('0x1c')](function(){return _0x448162;});}else{return _0x448162;}})['catch'](function(_0x5c277d){logger[_0x005c('0x21')](_0x005c('0x63'),_0x5c277d);throw _0x5c277d;});}return _0x448162;})[_0x005c('0x1c')](respondWithResult(_0x3f85ee,0xc9))[_0x005c('0x26')](handleError(_0x3f85ee,null));};exports[_0x005c('0x2f')]=function(_0x145c04,_0x1fc8dd,_0x1233f8){var _0x5dad98;return db[_0x005c('0x4b')][_0x005c('0x52')]({'where':{'id':_0x145c04[_0x005c('0x51')]['id']}})[_0x005c('0x1c')](handleEntityNotFound(_0x1fc8dd,null))[_0x005c('0x1c')](saveUpdates(_0x145c04['body'],null))['then'](function(_0x35f8db){if(_0x35f8db){_0x5dad98=_0x35f8db;return db[_0x005c('0x4b')][_0x005c('0x4e')]({'raw':!![]});}})[_0x005c('0x1c')](function(_0x339ba0){var _0x445e0a=fs[_0x005c('0x55')](path[_0x005c('0x56')](config[_0x005c('0x57')],_0x005c('0x58')),_0x005c('0x59'));var _0x43c5f5=ejs['render'](_0x445e0a,{'contexts':_0x339ba0||[]});fs[_0x005c('0x5a')](_0x005c('0x5b'),_0x43c5f5);})[_0x005c('0x1c')](function(){return respondWithRpcPromise('Reload',_0x005c('0x2f'),{'module':_0x005c('0x5d')});})[_0x005c('0x1c')](function(){return _0x5dad98;})[_0x005c('0x1c')](respondWithResult(_0x1fc8dd,null))[_0x005c('0x26')](handleError(_0x1fc8dd,null));};exports[_0x005c('0x30')]=function(_0x9868,_0x418d7f,_0x18066d){var _0x3e84ec;return db[_0x005c('0x4b')]['find']({'where':{'id':_0x9868['params']['id']}})[_0x005c('0x1c')](handleEntityNotFound(_0x418d7f,null))[_0x005c('0x1c')](removeEntity(_0x418d7f,null))[_0x005c('0x1c')](function(){return db[_0x005c('0x4b')][_0x005c('0x4e')]({'raw':!![]});})[_0x005c('0x1c')](function(_0x2e6bf7){var _0x40c303=fs['readFileSync'](path['join'](config[_0x005c('0x57')],'server/files/templates/context.ejs'),_0x005c('0x59'));var _0x96cf5b=ejs['render'](_0x40c303,{'contexts':_0x2e6bf7});fs[_0x005c('0x5a')](_0x005c('0x5b'),_0x96cf5b);return respondWithRpcPromise(_0x005c('0x5c'),_0x005c('0x30'),{'module':_0x005c('0x5d')});})[_0x005c('0x26')](handleError(_0x418d7f,null));}; \ No newline at end of file +var _0x57c6=['utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','server/files/templates/context.ejs','writeFileSync','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','stringify','error','message','result','catch','VoiceContext,\x20%s,\x20%s','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','VoiceContext','model','keys','query','intersection','attributes','fields','length','nolimit','where','filters','filter','merge','map','type','key','field','options','count','includeAll','rows','params','rawAttributes','include','find','create','body','findAll','readFileSync','join'];(function(_0x217f66,_0x15a5a2){var _0x5f5dd7=function(_0x2f1b91){while(--_0x2f1b91){_0x217f66['push'](_0x217f66['shift']());}};_0x5f5dd7(++_0x15a5a2);}(_0x57c6,0x1ee));var _0x657c=function(_0x488b4d,_0x233540){_0x488b4d=_0x488b4d-0x0;var _0x51ee8f=_0x57c6[_0x488b4d];return _0x51ee8f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x657c('0x0'));var moment=require(_0x657c('0x1'));var BPromise=require(_0x657c('0x2'));var Mustache=require(_0x657c('0x3'));var util=require(_0x657c('0x4'));var path=require(_0x657c('0x5'));var sox=require(_0x657c('0x6'));var csv=require(_0x657c('0x7'));var ejs=require(_0x657c('0x8'));var fs=require('fs');var _=require(_0x657c('0x9'));var squel=require(_0x657c('0xa'));var crypto=require(_0x657c('0xb'));var jsforce=require(_0x657c('0xc'));var deskjs=require(_0x657c('0xd'));var toCsv=require(_0x657c('0x7'));var querystring=require(_0x657c('0xe'));var Papa=require(_0x657c('0xf'));var Redis=require(_0x657c('0x10'));var authService=require(_0x657c('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x657c('0x12'));var logger=require(_0x657c('0x13'))(_0x657c('0x14'));var utils=require(_0x657c('0x15'));var config=require('../../config/environment');var db=require(_0x657c('0x16'))['db'];var jayson=require(_0x657c('0x17'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x376a21,_0x2e6605,_0x4d6267){if(_0x4d6267){var _0x350c83=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x350c83['test'](_0x2e6605)){return _0x376a21;}else{throw new Error(_0x657c('0x18'));}}else{return _0x376a21;}}function respondWithRpcPromise(_0x17a5db,_0x507895,_0x3c6f23,_0x3e8f53){return new BPromise(function(_0x53a59b,_0x44ab1e){var _0x6a0bed=_0x3e8f53||client;return _0x6a0bed['request'](_0x17a5db,_0x3c6f23)[_0x657c('0x19')](function(_0x1441d2){logger[_0x657c('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x507895,_0x657c('0x1b'));logger[_0x657c('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x507895,_0x657c('0x1b'),JSON[_0x657c('0x1d')](_0x1441d2));if(_0x1441d2['error']){if(_0x1441d2[_0x657c('0x1e')]['code']===0x1f4){logger[_0x657c('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x507895,_0x1441d2[_0x657c('0x1e')][_0x657c('0x1f')]);return _0x44ab1e(_0x1441d2[_0x657c('0x1e')][_0x657c('0x1f')]);}logger[_0x657c('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x507895,_0x1441d2[_0x657c('0x1e')][_0x657c('0x1f')]);return _0x53a59b(_0x1441d2['error'][_0x657c('0x1f')]);}else{logger[_0x657c('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x507895,'request\x20sent');_0x53a59b(_0x1441d2[_0x657c('0x20')][_0x657c('0x1f')]);}})[_0x657c('0x21')](function(_0x24f91f){logger[_0x657c('0x1e')](_0x657c('0x22'),_0x507895,_0x24f91f);_0x44ab1e(_0x24f91f);});});}function respondWithStatusCode(_0x306053,_0x5d9f3c){_0x5d9f3c=_0x5d9f3c||0xcc;return function(_0x2cbaff){if(_0x2cbaff){return _0x306053[_0x657c('0x23')](_0x5d9f3c);}return _0x306053[_0x657c('0x24')](_0x5d9f3c)[_0x657c('0x25')]();};}function respondWithResult(_0x35d7d9,_0x170f58){_0x170f58=_0x170f58||0xc8;return function(_0x967fa0){if(_0x967fa0){return _0x35d7d9[_0x657c('0x24')](_0x170f58)[_0x657c('0x26')](_0x967fa0);}};}function respondWithFilteredResult(_0x59c40d,_0x5d5272){return function(_0x12e411){if(_0x12e411){var _0x2fef53=_0x12e411['count'],_0x3f89cc=_0x5d5272[_0x657c('0x27')],_0x2f6ae4=_0x5d5272['offset']+_0x5d5272[_0x657c('0x28')],_0x14fbf1;if(_0x2f6ae4>=_0x2fef53){_0x2f6ae4=_0x2fef53;_0x14fbf1=0xc8;}else{_0x14fbf1=0xce;}_0x59c40d['status'](_0x14fbf1);return _0x59c40d['set'](_0x657c('0x29'),_0x3f89cc+'-'+_0x2f6ae4+'/'+_0x2fef53)[_0x657c('0x26')](_0x12e411);}return null;};}function patchUpdates(_0x2f2e27){return function(_0x54ce7d){try{jsonpatch[_0x657c('0x2a')](_0x54ce7d,_0x2f2e27,!![]);}catch(_0x4541e7){return BPromise[_0x657c('0x2b')](_0x4541e7);}return _0x54ce7d[_0x657c('0x2c')]();};}function saveUpdates(_0x4f5697,_0x1b6638){return function(_0x416408){if(_0x416408){return _0x416408[_0x657c('0x2d')](_0x4f5697)[_0x657c('0x19')](function(_0x5c13f7){return _0x5c13f7;});}return null;};}function removeEntity(_0x410248,_0x37af54){return function(_0x3fd50b){if(_0x3fd50b){return _0x3fd50b[_0x657c('0x2e')]()['then'](function(){var _0xadb328=_0x3fd50b[_0x657c('0x2f')]({'plain':!![]});var _0x206895='Contexts';return db[_0x657c('0x30')]['destroy']({'where':{'type':_0x206895,'resourceId':_0xadb328['id']}})[_0x657c('0x19')](function(){return _0x3fd50b;});})[_0x657c('0x19')](function(){_0x410248[_0x657c('0x24')](0xcc)[_0x657c('0x25')]();});}};}function handleEntityNotFound(_0x29bebf,_0x4c38bb){return function(_0x3cb464){if(!_0x3cb464){_0x29bebf[_0x657c('0x23')](0x194);}return _0x3cb464;};}function handleError(_0x4237fe,_0x2513b5){_0x2513b5=_0x2513b5||0x1f4;return function(_0x26becc){logger[_0x657c('0x1e')](_0x26becc[_0x657c('0x31')]);if(_0x26becc['name']){delete _0x26becc[_0x657c('0x32')];}_0x4237fe[_0x657c('0x24')](_0x2513b5)[_0x657c('0x33')](_0x26becc);};}exports['index']=function(_0x476801,_0x582750){var _0x3f5a9c={},_0x2b2afb={},_0x362250={'count':0x0,'rows':[]};var _0x4ec2e7=db[_0x657c('0x34')]['rawAttributes'];_0x2b2afb[_0x657c('0x35')]=_[_0x657c('0x36')](_0x4ec2e7);_0x2b2afb[_0x657c('0x37')]=_[_0x657c('0x36')](_0x476801[_0x657c('0x37')]);_0x2b2afb['filters']=_[_0x657c('0x38')](_0x2b2afb['model'],_0x2b2afb[_0x657c('0x37')]);_0x3f5a9c[_0x657c('0x39')]=_['intersection'](_0x2b2afb[_0x657c('0x35')],qs['fields'](_0x476801[_0x657c('0x37')][_0x657c('0x3a')]));_0x3f5a9c[_0x657c('0x39')]=_0x3f5a9c['attributes'][_0x657c('0x3b')]?_0x3f5a9c[_0x657c('0x39')]:_0x2b2afb[_0x657c('0x35')];if(!_0x476801[_0x657c('0x37')]['hasOwnProperty'](_0x657c('0x3c'))){_0x3f5a9c[_0x657c('0x28')]=qs[_0x657c('0x28')](_0x476801[_0x657c('0x37')][_0x657c('0x28')]);_0x3f5a9c[_0x657c('0x27')]=qs[_0x657c('0x27')](_0x476801[_0x657c('0x37')]['offset']);}_0x3f5a9c['order']=qs['sort'](_0x476801[_0x657c('0x37')]['sort']);_0x3f5a9c[_0x657c('0x3d')]=qs[_0x657c('0x3e')](_['pick'](_0x476801[_0x657c('0x37')],_0x2b2afb[_0x657c('0x3e')]));if(_0x476801[_0x657c('0x37')][_0x657c('0x3f')]){_0x3f5a9c[_0x657c('0x3d')]=_[_0x657c('0x40')](_0x3f5a9c[_0x657c('0x3d')],{'$or':_[_0x657c('0x41')](_0x4ec2e7,function(_0x566988){if(_0x566988[_0x657c('0x42')][_0x657c('0x43')]!=='VIRTUAL'){var _0x4caecd={};_0x4caecd[_0x566988[_0x657c('0x44')]]={'$like':'%'+_0x476801['query'][_0x657c('0x3f')]+'%'};return _0x4caecd;}})});}_0x3f5a9c=_[_0x657c('0x40')]({},_0x3f5a9c,_0x476801[_0x657c('0x45')]);var _0x3da32c={'where':_0x3f5a9c[_0x657c('0x3d')]};return db[_0x657c('0x34')]['count'](_0x3da32c)[_0x657c('0x19')](function(_0x1d45da){_0x362250[_0x657c('0x46')]=_0x1d45da;if(_0x476801[_0x657c('0x37')][_0x657c('0x47')]){_0x3f5a9c['include']=[{'all':!![]}];}return db[_0x657c('0x34')]['findAll'](_0x3f5a9c);})[_0x657c('0x19')](function(_0x5a1efc){_0x362250[_0x657c('0x48')]=_0x5a1efc;return _0x362250;})['then'](respondWithFilteredResult(_0x582750,_0x3f5a9c))['catch'](handleError(_0x582750,null));};exports['show']=function(_0x287910,_0x37c96f){var _0x114932={'raw':![],'where':{'id':_0x287910[_0x657c('0x49')]['id']}},_0x3d5618={};_0x3d5618[_0x657c('0x35')]=_[_0x657c('0x36')](db[_0x657c('0x34')][_0x657c('0x4a')]);_0x3d5618[_0x657c('0x37')]=_['keys'](_0x287910[_0x657c('0x37')]);_0x3d5618[_0x657c('0x3e')]=_[_0x657c('0x38')](_0x3d5618[_0x657c('0x35')],_0x3d5618[_0x657c('0x37')]);_0x114932[_0x657c('0x39')]=_['intersection'](_0x3d5618[_0x657c('0x35')],qs[_0x657c('0x3a')](_0x287910['query'][_0x657c('0x3a')]));_0x114932[_0x657c('0x39')]=_0x114932[_0x657c('0x39')][_0x657c('0x3b')]?_0x114932[_0x657c('0x39')]:_0x3d5618[_0x657c('0x35')];if(_0x287910[_0x657c('0x37')]['includeAll']){_0x114932[_0x657c('0x4b')]=[{'all':!![]}];}_0x114932=_[_0x657c('0x40')]({},_0x114932,_0x287910[_0x657c('0x45')]);return db[_0x657c('0x34')][_0x657c('0x4c')](_0x114932)[_0x657c('0x19')](handleEntityNotFound(_0x37c96f,null))[_0x657c('0x19')](respondWithResult(_0x37c96f,null))[_0x657c('0x21')](handleError(_0x37c96f,null));};exports[_0x657c('0x4d')]=function(_0x758c3d,_0x5213a5,_0x33db54){var _0xbb3313;return db[_0x657c('0x34')]['create'](_0x758c3d[_0x657c('0x4e')],{'raw':!![]})[_0x657c('0x19')](function(_0x17f55f){_0xbb3313=_0x17f55f;return db['VoiceContext'][_0x657c('0x4f')]({'raw':!![]});})[_0x657c('0x19')](function(_0x48ec0b){var _0x47a193=fs[_0x657c('0x50')](path[_0x657c('0x51')](config['root'],'server/files/templates/context.ejs'),_0x657c('0x52'));var _0x14ec7a=ejs[_0x657c('0x53')](_0x47a193,{'contexts':_0x48ec0b||[]});fs['writeFileSync'](_0x657c('0x54'),_0x14ec7a);})[_0x657c('0x19')](function(){return respondWithRpcPromise(_0x657c('0x55'),_0x657c('0x4d'),{'module':_0x657c('0x56')});})[_0x657c('0x19')](function(){var _0x33fa95=_0x758c3d[_0x657c('0x57')][_0x657c('0x2f')]({'plain':!![]});if(!_0x33fa95)throw new Error(_0x657c('0x58'));if(_0x33fa95[_0x657c('0x59')]===_0x657c('0x57')){var _0x15f68a=_0xbb3313['get']({'plain':!![]});return db[_0x657c('0x5a')][_0x657c('0x4c')]({'where':{'name':'Contexts','userProfileId':_0x33fa95[_0x657c('0x5b')]},'raw':!![]})[_0x657c('0x19')](function(_0xed7830){if(_0xed7830&&_0xed7830['autoAssociation']===0x0){return db['UserProfileResource'][_0x657c('0x4d')]({'name':_0x15f68a[_0x657c('0x32')],'resourceId':_0x15f68a['id'],'type':_0xed7830[_0x657c('0x32')],'sectionId':_0xed7830['id']},{})['then'](function(){return _0xbb3313;});}else{return _0xbb3313;}})['catch'](function(_0x31da53){logger[_0x657c('0x1e')](_0x657c('0x5c'),_0x31da53);throw _0x31da53;});}return _0xbb3313;})[_0x657c('0x19')](respondWithResult(_0x5213a5,0xc9))[_0x657c('0x21')](handleError(_0x5213a5,null));};exports[_0x657c('0x2d')]=function(_0x553e51,_0x509d22,_0x2ae572){var _0x2c0638;return db[_0x657c('0x34')][_0x657c('0x4c')]({'where':{'id':_0x553e51[_0x657c('0x49')]['id']}})['then'](handleEntityNotFound(_0x509d22,null))['then'](saveUpdates(_0x553e51['body'],null))[_0x657c('0x19')](function(_0x1320ce){if(_0x1320ce){_0x2c0638=_0x1320ce;return db[_0x657c('0x34')][_0x657c('0x4f')]({'raw':!![]});}})[_0x657c('0x19')](function(_0x5e4303){var _0x2388f4=fs[_0x657c('0x50')](path['join'](config[_0x657c('0x5d')],_0x657c('0x5e')),_0x657c('0x52'));var _0x3049a6=ejs[_0x657c('0x53')](_0x2388f4,{'contexts':_0x5e4303||[]});fs[_0x657c('0x5f')](_0x657c('0x54'),_0x3049a6);})['then'](function(){return respondWithRpcPromise(_0x657c('0x55'),_0x657c('0x2d'),{'module':_0x657c('0x56')});})[_0x657c('0x19')](function(){return _0x2c0638;})[_0x657c('0x19')](respondWithResult(_0x509d22,null))[_0x657c('0x21')](handleError(_0x509d22,null));};exports[_0x657c('0x2e')]=function(_0x26dd63,_0x2dbe0c,_0x49504c){var _0x5f52fe;return db['VoiceContext'][_0x657c('0x4c')]({'where':{'id':_0x26dd63[_0x657c('0x49')]['id']}})[_0x657c('0x19')](handleEntityNotFound(_0x2dbe0c,null))['then'](removeEntity(_0x2dbe0c,null))[_0x657c('0x19')](function(){return db[_0x657c('0x34')]['findAll']({'raw':!![]});})['then'](function(_0x470ddf){var _0xab16d5=fs[_0x657c('0x50')](path[_0x657c('0x51')](config[_0x657c('0x5d')],_0x657c('0x5e')),_0x657c('0x52'));var _0x2fa7ad=ejs[_0x657c('0x53')](_0xab16d5,{'contexts':_0x470ddf});fs[_0x657c('0x5f')](_0x657c('0x54'),_0x2fa7ad);return respondWithRpcPromise(_0x657c('0x55'),_0x657c('0x2e'),{'module':_0x657c('0x56')});})[_0x657c('0x21')](handleError(_0x2dbe0c,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 70dd85c..736b657 100644 --- a/server/api/voiceContext/voiceContext.model.js +++ b/server/api/voiceContext/voiceContext.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf91a=['voice_contexts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext'];(function(_0x3cba90,_0x10e941){var _0x12d73c=function(_0x122d94){while(--_0x122d94){_0x3cba90['push'](_0x3cba90['shift']());}};_0x12d73c(++_0x10e941);}(_0xf91a,0xc4));var _0xaf91=function(_0x2540a8,_0x2711ba){_0x2540a8=_0x2540a8-0x0;var _0x2aaeb6=_0xf91a[_0x2540a8];return _0x2aaeb6;};'use strict';var _=require(_0xaf91('0x0'));var util=require(_0xaf91('0x1'));var logger=require(_0xaf91('0x2'))(_0xaf91('0x3'));var moment=require('moment');var BPromise=require(_0xaf91('0x4'));var rp=require(_0xaf91('0x5'));var fs=require('fs');var path=require(_0xaf91('0x6'));var rimraf=require(_0xaf91('0x7'));var config=require(_0xaf91('0x8'));var attributes=require(_0xaf91('0x9'));module['exports']=function(_0x568cf0,_0x2cc7d6){return _0x568cf0[_0xaf91('0xa')](_0xaf91('0xb'),attributes,{'tableName':_0xaf91('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66af=['VoiceContext','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0x4c7857,_0x99c2ec){var _0x3a29e2=function(_0x545cea){while(--_0x545cea){_0x4c7857['push'](_0x4c7857['shift']());}};_0x3a29e2(++_0x99c2ec);}(_0x66af,0xde));var _0xf66a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x66af[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf66a('0x0'));var util=require(_0xf66a('0x1'));var logger=require(_0xf66a('0x2'))(_0xf66a('0x3'));var moment=require(_0xf66a('0x4'));var BPromise=require(_0xf66a('0x5'));var rp=require(_0xf66a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf66a('0x7'));var config=require(_0xf66a('0x8'));var attributes=require(_0xf66a('0x9'));module[_0xf66a('0xa')]=function(_0x54dffd,_0x47c238){return _0x54dffd[_0xf66a('0xb')](_0xf66a('0xc'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index ceb322f..cb01ecc 100644 --- a/server/api/voiceContext/voiceContext.rpc.js +++ b/server/api/voiceContext/voiceContext.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e0a=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4e0a,0xd3));var _0xa4e0=function(_0x1417c6,_0x194309){_0x1417c6=_0x1417c6-0x0;var _0x44db97=_0x4e0a[_0x1417c6];return _0x44db97;};'use strict';var _=require(_0xa4e0('0x0'));var util=require(_0xa4e0('0x1'));var moment=require(_0xa4e0('0x2'));var BPromise=require(_0xa4e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4e0('0x4'))['db'];var utils=require(_0xa4e0('0x5'));var logger=require(_0xa4e0('0x6'))('rpc');var config=require(_0xa4e0('0x7'));var jayson=require(_0xa4e0('0x8'));var client=jayson[_0xa4e0('0x9')][_0xa4e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48f5ed,_0x295546,_0x50c98b){return new BPromise(function(_0x3d0447,_0x3a6e2a){return client[_0xa4e0('0xb')](_0x48f5ed,_0x50c98b)[_0xa4e0('0xc')](function(_0x18939a){logger['info'](_0xa4e0('0xd'),_0x295546,_0xa4e0('0xe'));logger[_0xa4e0('0xf')](_0xa4e0('0x10'),_0x295546,_0xa4e0('0xe'),JSON[_0xa4e0('0x11')](_0x18939a));if(_0x18939a[_0xa4e0('0x12')]){if(_0x18939a['error'][_0xa4e0('0x13')]===0x1f4){logger[_0xa4e0('0x12')](_0xa4e0('0xd'),_0x295546,_0x18939a[_0xa4e0('0x12')][_0xa4e0('0x14')]);return _0x3a6e2a(_0x18939a[_0xa4e0('0x12')][_0xa4e0('0x14')]);}logger[_0xa4e0('0x12')]('VoiceContext,\x20%s,\x20%s',_0x295546,_0x18939a[_0xa4e0('0x12')][_0xa4e0('0x14')]);return _0x3d0447(_0x18939a[_0xa4e0('0x12')]['message']);}else{logger[_0xa4e0('0x15')](_0xa4e0('0xd'),_0x295546,_0xa4e0('0xe'));_0x3d0447(_0x18939a[_0xa4e0('0x16')][_0xa4e0('0x14')]);}})[_0xa4e0('0x17')](function(_0x36bc88){logger['error']('VoiceContext,\x20%s,\x20%s',_0x295546,_0x36bc88);_0x3a6e2a(_0x36bc88);});});} \ No newline at end of file +var _0x8505=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result','catch','lodash'];(function(_0x470f63,_0x48d80b){var _0x4f09e2=function(_0x3aa3a4){while(--_0x3aa3a4){_0x470f63['push'](_0x470f63['shift']());}};_0x4f09e2(++_0x48d80b);}(_0x8505,0xe6));var _0x5850=function(_0x292cfc,_0x3d3b88){_0x292cfc=_0x292cfc-0x0;var _0x322319=_0x8505[_0x292cfc];return _0x322319;};'use strict';var _=require(_0x5850('0x0'));var util=require('util');var moment=require(_0x5850('0x1'));var BPromise=require('bluebird');var rs=require(_0x5850('0x2'));var fs=require('fs');var Redis=require(_0x5850('0x3'));var db=require(_0x5850('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5850('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5850('0x6')][_0x5850('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x20e1e1,_0x15a089,_0x581ea4){return new BPromise(function(_0x564247,_0xff15c4){return client[_0x5850('0x8')](_0x20e1e1,_0x581ea4)[_0x5850('0x9')](function(_0x2c9121){logger[_0x5850('0xa')]('VoiceContext,\x20%s,\x20%s',_0x15a089,_0x5850('0xb'));logger[_0x5850('0xc')](_0x5850('0xd'),_0x15a089,_0x5850('0xb'),JSON[_0x5850('0xe')](_0x2c9121));if(_0x2c9121[_0x5850('0xf')]){if(_0x2c9121[_0x5850('0xf')][_0x5850('0x10')]===0x1f4){logger[_0x5850('0xf')]('VoiceContext,\x20%s,\x20%s',_0x15a089,_0x2c9121[_0x5850('0xf')][_0x5850('0x11')]);return _0xff15c4(_0x2c9121['error'][_0x5850('0x11')]);}logger[_0x5850('0xf')](_0x5850('0x12'),_0x15a089,_0x2c9121['error'][_0x5850('0x11')]);return _0x564247(_0x2c9121[_0x5850('0xf')][_0x5850('0x11')]);}else{logger[_0x5850('0xa')](_0x5850('0x12'),_0x15a089,'request\x20sent');_0x564247(_0x2c9121[_0x5850('0x13')][_0x5850('0x11')]);}})[_0x5850('0x14')](function(_0xd8aede){logger[_0x5850('0xf')]('VoiceContext,\x20%s,\x20%s',_0x15a089,_0xd8aede);_0xff15c4(_0xd8aede);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 4068cd2..ce7ef90 100644 --- a/server/api/voiceDialReport/index.js +++ b/server/api/voiceDialReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf118=['create','/:id','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','post'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0xf118,0xe1));var _0x8f11=function(_0x43186d,_0x4b40ec){_0x43186d=_0x43186d-0x0;var _0x5f562c=_0xf118[_0x43186d];return _0x5f562c;};'use strict';var multer=require(_0x8f11('0x0'));var util=require(_0x8f11('0x1'));var path=require(_0x8f11('0x2'));var timeout=require(_0x8f11('0x3'));var express=require('express');var router=express[_0x8f11('0x4')]();var auth=require(_0x8f11('0x5'));var interaction=require(_0x8f11('0x6'));var config=require(_0x8f11('0x7'));var controller=require(_0x8f11('0x8'));router[_0x8f11('0x9')]('/',auth[_0x8f11('0xa')](),controller['index']);router['get'](_0x8f11('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x8f11('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8f11('0xc')]('/',auth[_0x8f11('0xa')](),controller[_0x8f11('0xd')]);router['put'](_0x8f11('0xe'),auth[_0x8f11('0xa')](),controller[_0x8f11('0xf')]);router['delete'](_0x8f11('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x8f11('0x10')]=router; \ No newline at end of file +var _0xd9d0=['destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update'];(function(_0xc8fea7,_0x590060){var _0x446754=function(_0x4800f4){while(--_0x4800f4){_0xc8fea7['push'](_0xc8fea7['shift']());}};_0x446754(++_0x590060);}(_0xd9d0,0xb6));var _0x0d9d=function(_0x3e3936,_0x24c3a6){_0x3e3936=_0x3e3936-0x0;var _0x10be4e=_0xd9d0[_0x3e3936];return _0x10be4e;};'use strict';var multer=require(_0x0d9d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0d9d('0x1'));var express=require(_0x0d9d('0x2'));var router=express['Router']();var auth=require(_0x0d9d('0x3'));var interaction=require(_0x0d9d('0x4'));var config=require(_0x0d9d('0x5'));var controller=require(_0x0d9d('0x6'));router['get']('/',auth[_0x0d9d('0x7')](),controller[_0x0d9d('0x8')]);router[_0x0d9d('0x9')](_0x0d9d('0xa'),auth[_0x0d9d('0x7')](),controller[_0x0d9d('0xb')]);router[_0x0d9d('0x9')]('/:id',auth[_0x0d9d('0x7')](),controller[_0x0d9d('0xc')]);router[_0x0d9d('0xd')]('/',auth[_0x0d9d('0x7')](),controller[_0x0d9d('0xe')]);router[_0x0d9d('0xf')](_0x0d9d('0x10'),auth[_0x0d9d('0x7')](),controller[_0x0d9d('0x11')]);router['delete']('/:id',auth[_0x0d9d('0x7')](),controller[_0x0d9d('0x12')]);module[_0x0d9d('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 6d5029a..e7acf36 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x95d2=['sequelize','STRING','INTEGER','DATE'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0x95d2,0x100));var _0x295d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x95d2[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x295d('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x295d('0x1')]},'channel':{'type':Sequelize[_0x295d('0x1')]},'channelstate':{'type':Sequelize[_0x295d('0x2')]},'channelstatedesc':{'type':Sequelize[_0x295d('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x295d('0x1')]},'connectedlinenum':{'type':Sequelize[_0x295d('0x1')]},'connectedlinename':{'type':Sequelize[_0x295d('0x1')]},'language':{'type':Sequelize[_0x295d('0x1')]},'accountcode':{'type':Sequelize[_0x295d('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x295d('0x1')]},'priority':{'type':Sequelize[_0x295d('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x295d('0x1')]},'destchannel':{'type':Sequelize[_0x295d('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x295d('0x1')]},'destcalleridnum':{'type':Sequelize[_0x295d('0x1')]},'destcalleridname':{'type':Sequelize[_0x295d('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x295d('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x295d('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x295d('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x295d('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x295d('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x295d('0x1')]},'dialstatus':{'type':Sequelize[_0x295d('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x295d('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x295d('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x295d('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x295d('0x2')]}}; \ No newline at end of file +var _0xbeed=['INTEGER','DATE','exports','STRING'];(function(_0x39d481,_0x23c1a2){var _0x3b22d0=function(_0xea81e6){while(--_0xea81e6){_0x39d481['push'](_0x39d481['shift']());}};_0x3b22d0(++_0x23c1a2);}(_0xbeed,0x17e));var _0xdbee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbeed[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xdbee('0x0')]={'privilege':{'type':Sequelize[_0xdbee('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xdbee('0x2')]},'channelstatedesc':{'type':Sequelize[_0xdbee('0x1')]},'calleridnum':{'type':Sequelize[_0xdbee('0x1')]},'calleridname':{'type':Sequelize[_0xdbee('0x1')]},'connectedlinenum':{'type':Sequelize[_0xdbee('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xdbee('0x1')]},'accountcode':{'type':Sequelize[_0xdbee('0x1')]},'context':{'type':Sequelize[_0xdbee('0x1')]},'exten':{'type':Sequelize[_0xdbee('0x1')]},'priority':{'type':Sequelize[_0xdbee('0x2')]},'uniqueid':{'type':Sequelize[_0xdbee('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdbee('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xdbee('0x1')]},'destcalleridnum':{'type':Sequelize[_0xdbee('0x1')]},'destcalleridname':{'type':Sequelize[_0xdbee('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xdbee('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xdbee('0x1')]},'destlanguage':{'type':Sequelize[_0xdbee('0x1')]},'destaccountcode':{'type':Sequelize[_0xdbee('0x1')]},'destcontext':{'type':Sequelize[_0xdbee('0x1')]},'destexten':{'type':Sequelize[_0xdbee('0x1')]},'destpriority':{'type':Sequelize[_0xdbee('0x2')]},'destuniqueid':{'type':Sequelize[_0xdbee('0x1')]},'destlinkedid':{'type':Sequelize[_0xdbee('0x1')]},'dialstring':{'type':Sequelize[_0xdbee('0x1')]},'dialstatus':{'type':Sequelize[_0xdbee('0x1')]},'starttime':{'type':Sequelize[_0xdbee('0x3')]},'answertime':{'type':Sequelize[_0xdbee('0x3')]},'endtime':{'type':Sequelize[_0xdbee('0x3')]},'lastevent':{'type':Sequelize[_0xdbee('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xdbee('0x2')]},'duration':{'type':Sequelize[_0xdbee('0x2')]},'holdtime':{'type':Sequelize[_0xdbee('0x2')]},'billableseconds':{'type':Sequelize[_0xdbee('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 37cd32d..e8739f8 100644 --- a/server/api/voiceDialReport/voiceDialReport.controller.js +++ b/server/api/voiceDialReport/voiceDialReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6aa=['create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','VoiceDialReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6aa,0x120));var _0xaa6a=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0xa6aa[_0x1678c8];return _0x387aa9;};'use strict';var pdf=require(_0xaa6a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xaa6a('0x1'));var zipdir=require(_0xaa6a('0x2'));var jsonpatch=require(_0xaa6a('0x3'));var rp=require(_0xaa6a('0x4'));var moment=require('moment');var BPromise=require(_0xaa6a('0x5'));var Mustache=require('mustache');var util=require(_0xaa6a('0x6'));var path=require(_0xaa6a('0x7'));var sox=require(_0xaa6a('0x8'));var csv=require('to-csv');var ejs=require(_0xaa6a('0x9'));var fs=require('fs');var _=require(_0xaa6a('0xa'));var squel=require(_0xaa6a('0xb'));var crypto=require('crypto');var jsforce=require(_0xaa6a('0xc'));var deskjs=require(_0xaa6a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaa6a('0xe'));var Papa=require(_0xaa6a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaa6a('0x10'));var hardwareService=require(_0xaa6a('0x11'));var logger=require(_0xaa6a('0x12'))('api');var utils=require(_0xaa6a('0x13'));var config=require('../../config/environment');var db=require(_0xaa6a('0x14'))['db'];function respondWithStatusCode(_0x349b2a,_0x2f53ae){_0x2f53ae=_0x2f53ae||0xcc;return function(_0x4eb828){if(_0x4eb828){return _0x349b2a[_0xaa6a('0x15')](_0x2f53ae);}return _0x349b2a[_0xaa6a('0x16')](_0x2f53ae)[_0xaa6a('0x17')]();};}function respondWithResult(_0x47b9ed,_0x1b1824){_0x1b1824=_0x1b1824||0xc8;return function(_0x5393d2){if(_0x5393d2){return _0x47b9ed[_0xaa6a('0x16')](_0x1b1824)[_0xaa6a('0x18')](_0x5393d2);}};}function respondWithFilteredResult(_0x148c61,_0x154541){return function(_0x466ea8){if(_0x466ea8){var _0x2b9c3a=_0x466ea8[_0xaa6a('0x19')],_0x46bfe4=_0x154541[_0xaa6a('0x1a')],_0x39ecba=_0x154541[_0xaa6a('0x1a')]+_0x154541[_0xaa6a('0x1b')],_0x553326;if(_0x39ecba>=_0x2b9c3a){_0x39ecba=_0x2b9c3a;_0x553326=0xc8;}else{_0x553326=0xce;}_0x148c61['status'](_0x553326);return _0x148c61[_0xaa6a('0x1c')](_0xaa6a('0x1d'),_0x46bfe4+'-'+_0x39ecba+'/'+_0x2b9c3a)[_0xaa6a('0x18')](_0x466ea8);}return null;};}function patchUpdates(_0x5e31f1){return function(_0x531c26){try{jsonpatch[_0xaa6a('0x1e')](_0x531c26,_0x5e31f1,!![]);}catch(_0x2cb7f8){return BPromise[_0xaa6a('0x1f')](_0x2cb7f8);}return _0x531c26['save']();};}function saveUpdates(_0x1faf02,_0x342a39){return function(_0x2f5a30){if(_0x2f5a30){return _0x2f5a30[_0xaa6a('0x20')](_0x1faf02)['then'](function(_0x5dff04){return _0x5dff04;});}return null;};}function removeEntity(_0x11c0de,_0xc50e11){return function(_0x47cf82){if(_0x47cf82){return _0x47cf82[_0xaa6a('0x21')]()[_0xaa6a('0x22')](function(){_0x11c0de[_0xaa6a('0x16')](0xcc)[_0xaa6a('0x17')]();});}};}function handleEntityNotFound(_0x36366e,_0x498974){return function(_0x32ea37){if(!_0x32ea37){_0x36366e[_0xaa6a('0x15')](0x194);}return _0x32ea37;};}function handleError(_0x704d8a,_0x2fd5bf){_0x2fd5bf=_0x2fd5bf||0x1f4;return function(_0x49f151){logger[_0xaa6a('0x23')](_0x49f151[_0xaa6a('0x24')]);if(_0x49f151[_0xaa6a('0x25')]){delete _0x49f151[_0xaa6a('0x25')];}_0x704d8a['status'](_0x2fd5bf)[_0xaa6a('0x26')](_0x49f151);};}exports[_0xaa6a('0x27')]=function(_0x1b4ed0,_0x3d0d2d){var _0x2f3a94={},_0x18c105={},_0x46bad7={'count':0x0,'rows':[]};var _0x43aef2=db[_0xaa6a('0x28')][_0xaa6a('0x29')];_0x18c105[_0xaa6a('0x2a')]=_[_0xaa6a('0x2b')](_0x43aef2);_0x18c105['query']=_[_0xaa6a('0x2b')](_0x1b4ed0[_0xaa6a('0x2c')]);_0x18c105[_0xaa6a('0x2d')]=_[_0xaa6a('0x2e')](_0x18c105['model'],_0x18c105[_0xaa6a('0x2c')]);_0x2f3a94[_0xaa6a('0x2f')]=_['intersection'](_0x18c105[_0xaa6a('0x2a')],qs['fields'](_0x1b4ed0['query'][_0xaa6a('0x30')]));_0x2f3a94[_0xaa6a('0x2f')]=_0x2f3a94[_0xaa6a('0x2f')][_0xaa6a('0x31')]?_0x2f3a94['attributes']:_0x18c105[_0xaa6a('0x2a')];if(!_0x1b4ed0[_0xaa6a('0x2c')][_0xaa6a('0x32')](_0xaa6a('0x33'))){_0x2f3a94[_0xaa6a('0x1b')]=qs[_0xaa6a('0x1b')](_0x1b4ed0[_0xaa6a('0x2c')][_0xaa6a('0x1b')]);_0x2f3a94[_0xaa6a('0x1a')]=qs[_0xaa6a('0x1a')](_0x1b4ed0[_0xaa6a('0x2c')][_0xaa6a('0x1a')]);}_0x2f3a94['order']=qs[_0xaa6a('0x34')](_0x1b4ed0['query'][_0xaa6a('0x34')]);_0x2f3a94[_0xaa6a('0x35')]=qs[_0xaa6a('0x2d')](_['pick'](_0x1b4ed0['query'],_0x18c105[_0xaa6a('0x2d')]));if(_0x1b4ed0[_0xaa6a('0x2c')][_0xaa6a('0x36')]){_0x2f3a94[_0xaa6a('0x35')]=_[_0xaa6a('0x37')](_0x2f3a94[_0xaa6a('0x35')],{'$or':_[_0xaa6a('0x38')](_0x43aef2,function(_0x573881){if(_0x573881[_0xaa6a('0x39')]['key']!==_0xaa6a('0x3a')){var _0x369776={};_0x369776[_0x573881[_0xaa6a('0x3b')]]={'$like':'%'+_0x1b4ed0[_0xaa6a('0x2c')][_0xaa6a('0x36')]+'%'};return _0x369776;}})});}_0x2f3a94=_['merge']({},_0x2f3a94,_0x1b4ed0[_0xaa6a('0x3c')]);var _0xb0f976={'where':_0x2f3a94[_0xaa6a('0x35')]};return db[_0xaa6a('0x28')][_0xaa6a('0x19')](_0xb0f976)[_0xaa6a('0x22')](function(_0xcdc8a){_0x46bad7['count']=_0xcdc8a;if(_0x1b4ed0[_0xaa6a('0x2c')][_0xaa6a('0x3d')]){_0x2f3a94['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0xaa6a('0x3e')](_0x2f3a94);})[_0xaa6a('0x22')](function(_0x1c37b9){_0x46bad7[_0xaa6a('0x3f')]=_0x1c37b9;return _0x46bad7;})[_0xaa6a('0x22')](respondWithFilteredResult(_0x3d0d2d,_0x2f3a94))[_0xaa6a('0x40')](handleError(_0x3d0d2d,null));};exports[_0xaa6a('0x41')]=function(_0x114721,_0x54f801){var _0x5167f1={'raw':!![],'where':{'id':_0x114721[_0xaa6a('0x42')]['id']}},_0x3d5368={};_0x3d5368[_0xaa6a('0x2a')]=_['keys'](db[_0xaa6a('0x28')][_0xaa6a('0x29')]);_0x3d5368[_0xaa6a('0x2c')]=_[_0xaa6a('0x2b')](_0x114721['query']);_0x3d5368['filters']=_[_0xaa6a('0x2e')](_0x3d5368[_0xaa6a('0x2a')],_0x3d5368[_0xaa6a('0x2c')]);_0x5167f1[_0xaa6a('0x2f')]=_['intersection'](_0x3d5368[_0xaa6a('0x2a')],qs[_0xaa6a('0x30')](_0x114721['query'][_0xaa6a('0x30')]));_0x5167f1[_0xaa6a('0x2f')]=_0x5167f1['attributes'][_0xaa6a('0x31')]?_0x5167f1[_0xaa6a('0x2f')]:_0x3d5368[_0xaa6a('0x2a')];if(_0x114721[_0xaa6a('0x2c')][_0xaa6a('0x3d')]){_0x5167f1['include']=[{'all':!![]}];}_0x5167f1=_[_0xaa6a('0x37')]({},_0x5167f1,_0x114721[_0xaa6a('0x3c')]);return db[_0xaa6a('0x28')]['find'](_0x5167f1)['then'](handleEntityNotFound(_0x54f801,null))[_0xaa6a('0x22')](respondWithResult(_0x54f801,null))[_0xaa6a('0x40')](handleError(_0x54f801,null));};exports[_0xaa6a('0x43')]=function(_0x4c7087,_0x44cca2){return db['VoiceDialReport']['create'](_0x4c7087['body'],{})[_0xaa6a('0x22')](respondWithResult(_0x44cca2,0xc9))[_0xaa6a('0x40')](handleError(_0x44cca2,null));};exports[_0xaa6a('0x20')]=function(_0x1b7315,_0x471ab4){if(_0x1b7315[_0xaa6a('0x44')]['id']){delete _0x1b7315['body']['id'];}return db[_0xaa6a('0x28')][_0xaa6a('0x45')]({'where':{'id':_0x1b7315[_0xaa6a('0x42')]['id']}})[_0xaa6a('0x22')](handleEntityNotFound(_0x471ab4,null))['then'](saveUpdates(_0x1b7315[_0xaa6a('0x44')],null))['then'](respondWithResult(_0x471ab4,null))[_0xaa6a('0x40')](handleError(_0x471ab4,null));};exports[_0xaa6a('0x21')]=function(_0x3965ea,_0x3f110c){return db['VoiceDialReport'][_0xaa6a('0x45')]({'where':{'id':_0x3965ea['params']['id']}})[_0xaa6a('0x22')](handleEntityNotFound(_0x3f110c,null))[_0xaa6a('0x22')](removeEntity(_0x3f110c,null))[_0xaa6a('0x40')](handleError(_0x3f110c,null));};exports[_0xaa6a('0x46')]=function(_0x22802f,_0x1b138d){return db[_0xaa6a('0x28')]['describe']()['then'](respondWithResult(_0x1b138d,null))[_0xaa6a('0x40')](handleError(_0x1b138d,null));}; \ No newline at end of file +var _0x604c=['index','VoiceDialReport','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','show','params','includeAll','create','body','catch','find','describe','html-pdf','eml-format','fast-json-patch','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x604c,0x65));var _0xc604=function(_0x57a9f9,_0x17568f){_0x57a9f9=_0x57a9f9-0x0;var _0x2c34d3=_0x604c[_0x57a9f9];return _0x2c34d3;};'use strict';var pdf=require(_0xc604('0x0'));var emlformat=require(_0xc604('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc604('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc604('0x3'));var Mustache=require(_0xc604('0x4'));var util=require('util');var path=require(_0xc604('0x5'));var sox=require(_0xc604('0x6'));var csv=require(_0xc604('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc604('0x8'));var squel=require('squel');var crypto=require(_0xc604('0x9'));var jsforce=require(_0xc604('0xa'));var deskjs=require(_0xc604('0xb'));var toCsv=require(_0xc604('0x7'));var querystring=require(_0xc604('0xc'));var Papa=require(_0xc604('0xd'));var Redis=require('ioredis');var authService=require(_0xc604('0xe'));var qs=require(_0xc604('0xf'));var hardwareService=require(_0xc604('0x10'));var logger=require(_0xc604('0x11'))('api');var utils=require(_0xc604('0x12'));var config=require(_0xc604('0x13'));var db=require(_0xc604('0x14'))['db'];function respondWithStatusCode(_0x3f1fc8,_0x596658){_0x596658=_0x596658||0xcc;return function(_0x4e4cd0){if(_0x4e4cd0){return _0x3f1fc8[_0xc604('0x15')](_0x596658);}return _0x3f1fc8[_0xc604('0x16')](_0x596658)[_0xc604('0x17')]();};}function respondWithResult(_0x3a411b,_0x5726b0){_0x5726b0=_0x5726b0||0xc8;return function(_0x206ddb){if(_0x206ddb){return _0x3a411b[_0xc604('0x16')](_0x5726b0)[_0xc604('0x18')](_0x206ddb);}};}function respondWithFilteredResult(_0x1cb559,_0x199d5d){return function(_0x5e70a2){if(_0x5e70a2){var _0x20aa5b=_0x5e70a2[_0xc604('0x19')],_0x583830=_0x199d5d[_0xc604('0x1a')],_0x32927f=_0x199d5d[_0xc604('0x1a')]+_0x199d5d[_0xc604('0x1b')],_0xa13484;if(_0x32927f>=_0x20aa5b){_0x32927f=_0x20aa5b;_0xa13484=0xc8;}else{_0xa13484=0xce;}_0x1cb559[_0xc604('0x16')](_0xa13484);return _0x1cb559[_0xc604('0x1c')](_0xc604('0x1d'),_0x583830+'-'+_0x32927f+'/'+_0x20aa5b)[_0xc604('0x18')](_0x5e70a2);}return null;};}function patchUpdates(_0x2e65cd){return function(_0x403fd2){try{jsonpatch[_0xc604('0x1e')](_0x403fd2,_0x2e65cd,!![]);}catch(_0x300b4d){return BPromise[_0xc604('0x1f')](_0x300b4d);}return _0x403fd2['save']();};}function saveUpdates(_0xd56593,_0x43fd61){return function(_0x2f9047){if(_0x2f9047){return _0x2f9047[_0xc604('0x20')](_0xd56593)[_0xc604('0x21')](function(_0x5c87d4){return _0x5c87d4;});}return null;};}function removeEntity(_0x497564,_0x1b381a){return function(_0x44f7a6){if(_0x44f7a6){return _0x44f7a6[_0xc604('0x22')]()[_0xc604('0x21')](function(){_0x497564[_0xc604('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e97e4,_0x4e18c3){return function(_0x1133c6){if(!_0x1133c6){_0x1e97e4[_0xc604('0x15')](0x194);}return _0x1133c6;};}function handleError(_0x3b02bb,_0x22d10a){_0x22d10a=_0x22d10a||0x1f4;return function(_0x59aca7){logger[_0xc604('0x23')](_0x59aca7[_0xc604('0x24')]);if(_0x59aca7[_0xc604('0x25')]){delete _0x59aca7['name'];}_0x3b02bb[_0xc604('0x16')](_0x22d10a)[_0xc604('0x26')](_0x59aca7);};}exports[_0xc604('0x27')]=function(_0x3913cc,_0x592950){var _0x2e1b54={},_0x2712bf={},_0x5ab80f={'count':0x0,'rows':[]};var _0x43136d=db[_0xc604('0x28')][_0xc604('0x29')];_0x2712bf['model']=_[_0xc604('0x2a')](_0x43136d);_0x2712bf['query']=_[_0xc604('0x2a')](_0x3913cc[_0xc604('0x2b')]);_0x2712bf[_0xc604('0x2c')]=_[_0xc604('0x2d')](_0x2712bf['model'],_0x2712bf[_0xc604('0x2b')]);_0x2e1b54[_0xc604('0x2e')]=_[_0xc604('0x2d')](_0x2712bf[_0xc604('0x2f')],qs[_0xc604('0x30')](_0x3913cc[_0xc604('0x2b')][_0xc604('0x30')]));_0x2e1b54['attributes']=_0x2e1b54[_0xc604('0x2e')][_0xc604('0x31')]?_0x2e1b54[_0xc604('0x2e')]:_0x2712bf[_0xc604('0x2f')];if(!_0x3913cc['query'][_0xc604('0x32')]('nolimit')){_0x2e1b54['limit']=qs['limit'](_0x3913cc['query'][_0xc604('0x1b')]);_0x2e1b54[_0xc604('0x1a')]=qs['offset'](_0x3913cc[_0xc604('0x2b')][_0xc604('0x1a')]);}_0x2e1b54['order']=qs[_0xc604('0x33')](_0x3913cc[_0xc604('0x2b')][_0xc604('0x33')]);_0x2e1b54[_0xc604('0x34')]=qs['filters'](_[_0xc604('0x35')](_0x3913cc[_0xc604('0x2b')],_0x2712bf[_0xc604('0x2c')]));if(_0x3913cc[_0xc604('0x2b')][_0xc604('0x36')]){_0x2e1b54[_0xc604('0x34')]=_[_0xc604('0x37')](_0x2e1b54['where'],{'$or':_[_0xc604('0x38')](_0x43136d,function(_0x40352d){if(_0x40352d['type']['key']!==_0xc604('0x39')){var _0x26141c={};_0x26141c[_0x40352d['field']]={'$like':'%'+_0x3913cc[_0xc604('0x2b')][_0xc604('0x36')]+'%'};return _0x26141c;}})});}_0x2e1b54=_[_0xc604('0x37')]({},_0x2e1b54,_0x3913cc[_0xc604('0x3a')]);var _0x48e4f2={'where':_0x2e1b54[_0xc604('0x34')]};return db[_0xc604('0x28')][_0xc604('0x19')](_0x48e4f2)[_0xc604('0x21')](function(_0x2cabd2){_0x5ab80f[_0xc604('0x19')]=_0x2cabd2;if(_0x3913cc[_0xc604('0x2b')]['includeAll']){_0x2e1b54[_0xc604('0x3b')]=[{'all':!![]}];}return db[_0xc604('0x28')][_0xc604('0x3c')](_0x2e1b54);})[_0xc604('0x21')](function(_0x23bdd3){_0x5ab80f[_0xc604('0x3d')]=_0x23bdd3;return _0x5ab80f;})[_0xc604('0x21')](respondWithFilteredResult(_0x592950,_0x2e1b54))['catch'](handleError(_0x592950,null));};exports[_0xc604('0x3e')]=function(_0x1cc11d,_0x561dcf){var _0x50000e={'raw':!![],'where':{'id':_0x1cc11d[_0xc604('0x3f')]['id']}},_0x4f7bc4={};_0x4f7bc4['model']=_[_0xc604('0x2a')](db[_0xc604('0x28')][_0xc604('0x29')]);_0x4f7bc4[_0xc604('0x2b')]=_[_0xc604('0x2a')](_0x1cc11d[_0xc604('0x2b')]);_0x4f7bc4[_0xc604('0x2c')]=_[_0xc604('0x2d')](_0x4f7bc4[_0xc604('0x2f')],_0x4f7bc4[_0xc604('0x2b')]);_0x50000e[_0xc604('0x2e')]=_[_0xc604('0x2d')](_0x4f7bc4[_0xc604('0x2f')],qs[_0xc604('0x30')](_0x1cc11d[_0xc604('0x2b')][_0xc604('0x30')]));_0x50000e[_0xc604('0x2e')]=_0x50000e[_0xc604('0x2e')][_0xc604('0x31')]?_0x50000e['attributes']:_0x4f7bc4[_0xc604('0x2f')];if(_0x1cc11d[_0xc604('0x2b')][_0xc604('0x40')]){_0x50000e['include']=[{'all':!![]}];}_0x50000e=_[_0xc604('0x37')]({},_0x50000e,_0x1cc11d['options']);return db[_0xc604('0x28')]['find'](_0x50000e)[_0xc604('0x21')](handleEntityNotFound(_0x561dcf,null))[_0xc604('0x21')](respondWithResult(_0x561dcf,null))['catch'](handleError(_0x561dcf,null));};exports['create']=function(_0x4f5755,_0x568a02){return db[_0xc604('0x28')][_0xc604('0x41')](_0x4f5755[_0xc604('0x42')],{})[_0xc604('0x21')](respondWithResult(_0x568a02,0xc9))[_0xc604('0x43')](handleError(_0x568a02,null));};exports[_0xc604('0x20')]=function(_0xa5a15c,_0x2c429b){if(_0xa5a15c[_0xc604('0x42')]['id']){delete _0xa5a15c[_0xc604('0x42')]['id'];}return db['VoiceDialReport'][_0xc604('0x44')]({'where':{'id':_0xa5a15c[_0xc604('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2c429b,null))[_0xc604('0x21')](saveUpdates(_0xa5a15c['body'],null))['then'](respondWithResult(_0x2c429b,null))['catch'](handleError(_0x2c429b,null));};exports['destroy']=function(_0x41c8d7,_0x455f31){return db['VoiceDialReport'][_0xc604('0x44')]({'where':{'id':_0x41c8d7[_0xc604('0x3f')]['id']}})['then'](handleEntityNotFound(_0x455f31,null))[_0xc604('0x21')](removeEntity(_0x455f31,null))['catch'](handleError(_0x455f31,null));};exports[_0xc604('0x45')]=function(_0x5e1a73,_0x45b7ed){return db[_0xc604('0x28')][_0xc604('0x45')]()[_0xc604('0x21')](respondWithResult(_0x45b7ed,null))[_0xc604('0x43')](handleError(_0x45b7ed,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 3a45aaa..36202be 100644 --- a/server/api/voiceDialReport/voiceDialReport.model.js +++ b/server/api/voiceDialReport/voiceDialReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d27=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','lodash','util','moment','bluebird','request-promise','path'];(function(_0x3653c7,_0xadb356){var _0x58a021=function(_0x20b237){while(--_0x20b237){_0x3653c7['push'](_0x3653c7['shift']());}};_0x58a021(++_0xadb356);}(_0x9d27,0xfe));var _0x79d2=function(_0x5ccab3,_0x5c7df5){_0x5ccab3=_0x5ccab3-0x0;var _0x8a5eb3=_0x9d27[_0x5ccab3];return _0x8a5eb3;};'use strict';var _=require(_0x79d2('0x0'));var util=require(_0x79d2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x79d2('0x2'));var BPromise=require(_0x79d2('0x3'));var rp=require(_0x79d2('0x4'));var fs=require('fs');var path=require(_0x79d2('0x5'));var rimraf=require(_0x79d2('0x6'));var config=require(_0x79d2('0x7'));var attributes=require(_0x79d2('0x8'));module[_0x79d2('0x9')]=function(_0x4e8d10,_0x4fbcc8){return _0x4e8d10['define'](_0x79d2('0xa'),attributes,{'tableName':_0x79d2('0xb'),'paranoid':![],'indexes':[{'fields':[_0x79d2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x21da=['rimraf','exports','define','uniqueid','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x3a0cb9,_0xf1c42){var _0x54df0e=function(_0x1477e5){while(--_0x1477e5){_0x3a0cb9['push'](_0x3a0cb9['shift']());}};_0x54df0e(++_0xf1c42);}(_0x21da,0x1ee));var _0xa21d=function(_0x25ddcf,_0x17bab4){_0x25ddcf=_0x25ddcf-0x0;var _0x5baff8=_0x21da[_0x25ddcf];return _0x5baff8;};'use strict';var _=require(_0xa21d('0x0'));var util=require(_0xa21d('0x1'));var logger=require(_0xa21d('0x2'))(_0xa21d('0x3'));var moment=require('moment');var BPromise=require(_0xa21d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa21d('0x5'));var rimraf=require(_0xa21d('0x6'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0xa21d('0x7')]=function(_0x28f8fc,_0x44b5a3){return _0x28f8fc[_0xa21d('0x8')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xa21d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index e737682..faa28a7 100644 --- a/server/api/voiceDialReport/voiceDialReport.rpc.js +++ b/server/api/voiceDialReport/voiceDialReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x340c=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceDialReport','body','options','UpdateVoiceDialReport','VoiceDialReport','update','raw','where','limit','then','lodash','util'];(function(_0x58dab2,_0x193b28){var _0x539b1e=function(_0x429e18){while(--_0x429e18){_0x58dab2['push'](_0x58dab2['shift']());}};_0x539b1e(++_0x193b28);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc340('0x0'));var util=require(_0xc340('0x1'));var moment=require(_0xc340('0x2'));var BPromise=require(_0xc340('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc340('0x4'));var db=require(_0xc340('0x5'))['db'];var utils=require(_0xc340('0x6'));var logger=require(_0xc340('0x7'))('rpc');var config=require(_0xc340('0x8'));var jayson=require(_0xc340('0x9'));var client=jayson[_0xc340('0xa')][_0xc340('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35b8e6,_0x4c3a04,_0x4c33db){return new BPromise(function(_0x59a213,_0x4726ff){return client[_0xc340('0xc')](_0x35b8e6,_0x4c33db)['then'](function(_0x388873){logger[_0xc340('0xd')](_0xc340('0xe'),_0x4c3a04,_0xc340('0xf'));logger[_0xc340('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x4c3a04,_0xc340('0xf'),JSON[_0xc340('0x11')](_0x388873));if(_0x388873[_0xc340('0x12')]){if(_0x388873['error'][_0xc340('0x13')]===0x1f4){logger[_0xc340('0x12')](_0xc340('0xe'),_0x4c3a04,_0x388873[_0xc340('0x12')][_0xc340('0x14')]);return _0x4726ff(_0x388873['error'][_0xc340('0x14')]);}logger[_0xc340('0x12')](_0xc340('0xe'),_0x4c3a04,_0x388873[_0xc340('0x12')][_0xc340('0x14')]);return _0x59a213(_0x388873['error'][_0xc340('0x14')]);}else{logger[_0xc340('0xd')](_0xc340('0xe'),_0x4c3a04,_0xc340('0xf'));_0x59a213(_0x388873[_0xc340('0x15')]['message']);}})[_0xc340('0x16')](function(_0x3b05bb){logger[_0xc340('0x12')](_0xc340('0xe'),_0x4c3a04,_0x3b05bb);_0x4726ff(_0x3b05bb);});});}exports[_0xc340('0x17')]=function(_0x51efe9){var _0x2a08e1=this;return new Promise(function(_0x32286c,_0x3696f3){return db['VoiceDialReport']['create'](_0x51efe9[_0xc340('0x18')],{'raw':_0x51efe9[_0xc340('0x19')]?_0x51efe9[_0xc340('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x22e6ee){logger['info'](_0xc340('0x17'),_0x51efe9);logger[_0xc340('0x10')](_0xc340('0x17'),_0x51efe9,JSON[_0xc340('0x11')](_0x22e6ee));_0x32286c(_0x22e6ee);})[_0xc340('0x16')](function(_0x435c28){logger[_0xc340('0x12')](_0xc340('0x17'),_0x435c28[_0xc340('0x14')],_0x51efe9);_0x3696f3(_0x2a08e1[_0xc340('0x12')](0x1f4,_0x435c28['message']));});});};exports[_0xc340('0x1a')]=function(_0x250dbd){var _0x5e3892=this;return new Promise(function(_0x3b13eb,_0x50ec86){return db[_0xc340('0x1b')][_0xc340('0x1c')](_0x250dbd[_0xc340('0x18')],{'raw':_0x250dbd['options']?_0x250dbd[_0xc340('0x19')][_0xc340('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x250dbd[_0xc340('0x19')]?_0x250dbd[_0xc340('0x19')][_0xc340('0x1e')]||null:null,'attributes':_0x250dbd[_0xc340('0x19')]?_0x250dbd[_0xc340('0x19')]['attributes']||null:null,'limit':_0x250dbd['options']?_0x250dbd[_0xc340('0x19')][_0xc340('0x1f')]||null:null})[_0xc340('0x20')](function(_0x17a567){logger[_0xc340('0xd')](_0xc340('0x1a'),_0x250dbd);logger['debug'](_0xc340('0x1a'),_0x250dbd,JSON[_0xc340('0x11')](_0x17a567));_0x3b13eb(_0x17a567);})[_0xc340('0x16')](function(_0x197510){logger[_0xc340('0x12')](_0xc340('0x1a'),_0x197510[_0xc340('0x14')],_0x250dbd);_0x50ec86(_0x5e3892['error'](0x1f4,_0x197510['message']));});});}; \ No newline at end of file +var _0x03bc=['body','where','limit','stringify','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error','message','VoiceDialReport,\x20%s,\x20%s','result','CreateVoiceDialReport','VoiceDialReport','options','raw','debug','catch','UpdateVoiceDialReport','update'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x03bc,0xb8));var _0xc03b=function(_0x4fa9b6,_0x5dbc8){_0x4fa9b6=_0x4fa9b6-0x0;var _0x423a19=_0x03bc[_0x4fa9b6];return _0x423a19;};'use strict';var _=require(_0xc03b('0x0'));var util=require('util');var moment=require(_0xc03b('0x1'));var BPromise=require(_0xc03b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc03b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc03b('0x4'));var logger=require(_0xc03b('0x5'))(_0xc03b('0x6'));var config=require(_0xc03b('0x7'));var jayson=require(_0xc03b('0x8'));var client=jayson['client'][_0xc03b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5982de,_0x4dd542,_0xfccf77){return new BPromise(function(_0x64dd0a,_0x2c9c10){return client[_0xc03b('0xa')](_0x5982de,_0xfccf77)[_0xc03b('0xb')](function(_0xd974ef){logger[_0xc03b('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x4dd542,_0xc03b('0xd'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x4dd542,'request\x20sent',JSON['stringify'](_0xd974ef));if(_0xd974ef[_0xc03b('0xe')]){if(_0xd974ef['error']['code']===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x4dd542,_0xd974ef[_0xc03b('0xe')][_0xc03b('0xf')]);return _0x2c9c10(_0xd974ef[_0xc03b('0xe')][_0xc03b('0xf')]);}logger[_0xc03b('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x4dd542,_0xd974ef[_0xc03b('0xe')]['message']);return _0x64dd0a(_0xd974ef['error']['message']);}else{logger[_0xc03b('0xc')](_0xc03b('0x10'),_0x4dd542,_0xc03b('0xd'));_0x64dd0a(_0xd974ef[_0xc03b('0x11')][_0xc03b('0xf')]);}})['catch'](function(_0x519a8f){logger[_0xc03b('0xe')](_0xc03b('0x10'),_0x4dd542,_0x519a8f);_0x2c9c10(_0x519a8f);});});}exports[_0xc03b('0x12')]=function(_0x1fbe7a){var _0x479125=this;return new Promise(function(_0x17ff7c,_0x1e5526){return db[_0xc03b('0x13')]['create'](_0x1fbe7a['body'],{'raw':_0x1fbe7a[_0xc03b('0x14')]?_0x1fbe7a[_0xc03b('0x14')][_0xc03b('0x15')]===undefined?!![]:![]:!![]})[_0xc03b('0xb')](function(_0x41a877){logger[_0xc03b('0xc')]('CreateVoiceDialReport',_0x1fbe7a);logger[_0xc03b('0x16')](_0xc03b('0x12'),_0x1fbe7a,JSON['stringify'](_0x41a877));_0x17ff7c(_0x41a877);})[_0xc03b('0x17')](function(_0x21cc21){logger[_0xc03b('0xe')]('CreateVoiceDialReport',_0x21cc21[_0xc03b('0xf')],_0x1fbe7a);_0x1e5526(_0x479125[_0xc03b('0xe')](0x1f4,_0x21cc21[_0xc03b('0xf')]));});});};exports[_0xc03b('0x18')]=function(_0x2d5355){var _0x50a18=this;return new Promise(function(_0x51a2ea,_0x4fa398){return db[_0xc03b('0x13')][_0xc03b('0x19')](_0x2d5355[_0xc03b('0x1a')],{'raw':_0x2d5355[_0xc03b('0x14')]?_0x2d5355[_0xc03b('0x14')][_0xc03b('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d5355[_0xc03b('0x14')]?_0x2d5355['options'][_0xc03b('0x1b')]||null:null,'attributes':_0x2d5355[_0xc03b('0x14')]?_0x2d5355['options']['attributes']||null:null,'limit':_0x2d5355[_0xc03b('0x14')]?_0x2d5355['options'][_0xc03b('0x1c')]||null:null})[_0xc03b('0xb')](function(_0x34fefa){logger[_0xc03b('0xc')](_0xc03b('0x18'),_0x2d5355);logger[_0xc03b('0x16')](_0xc03b('0x18'),_0x2d5355,JSON[_0xc03b('0x1d')](_0x34fefa));_0x51a2ea(_0x34fefa);})[_0xc03b('0x17')](function(_0x2b52bd){logger[_0xc03b('0xe')](_0xc03b('0x18'),_0x2b52bd[_0xc03b('0xf')],_0x2d5355);_0x4fa398(_0x50a18[_0xc03b('0xe')](0x1f4,_0x2b52bd['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index cd3daac..3a2d09b 100644 --- a/server/api/voiceExtension/index.js +++ b/server/api/voiceExtension/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44f6=['isAuthenticated','post','/:id/applications','addApplications','put','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x44f6,0x116));var _0x644f=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0x44f6[_0x4f5108];return _0x2d56ca;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x644f('0x0'));var express=require(_0x644f('0x1'));var router=express[_0x644f('0x2')]();var auth=require(_0x644f('0x3'));var interaction=require(_0x644f('0x4'));var config=require(_0x644f('0x5'));var controller=require(_0x644f('0x6'));router[_0x644f('0x7')]('/',auth['isAuthenticated'](),controller[_0x644f('0x8')]);router[_0x644f('0x7')](_0x644f('0x9'),auth[_0x644f('0xa')](),controller['show']);router[_0x644f('0xb')]('/',auth[_0x644f('0xa')](),controller['create']);router[_0x644f('0xb')](_0x644f('0xc'),auth[_0x644f('0xa')](),controller[_0x644f('0xd')]);router[_0x644f('0xe')](_0x644f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x644f('0xf')](_0x644f('0x9'),auth['isAuthenticated'](),controller[_0x644f('0x10')]);module[_0x644f('0x11')]=router; \ No newline at end of file +var _0x9640=['../../components/auth/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x9c56d5,_0x38d06a){var _0x2c9ad8=function(_0x3f08b8){while(--_0x3f08b8){_0x9c56d5['push'](_0x9c56d5['shift']());}};_0x2c9ad8(++_0x38d06a);}(_0x9640,0x19c));var _0x0964=function(_0x4e310d,_0x1b88d9){_0x4e310d=_0x4e310d-0x0;var _0xf2e3f=_0x9640[_0x4e310d];return _0xf2e3f;};'use strict';var multer=require(_0x0964('0x0'));var util=require(_0x0964('0x1'));var path=require(_0x0964('0x2'));var timeout=require(_0x0964('0x3'));var express=require(_0x0964('0x4'));var router=express[_0x0964('0x5')]();var auth=require(_0x0964('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0964('0x7'));router[_0x0964('0x8')]('/',auth[_0x0964('0x9')](),controller[_0x0964('0xa')]);router['get'](_0x0964('0xb'),auth[_0x0964('0x9')](),controller[_0x0964('0xc')]);router[_0x0964('0xd')]('/',auth[_0x0964('0x9')](),controller[_0x0964('0xe')]);router[_0x0964('0xd')](_0x0964('0xf'),auth[_0x0964('0x9')](),controller[_0x0964('0x10')]);router[_0x0964('0x11')](_0x0964('0xb'),auth[_0x0964('0x9')](),controller[_0x0964('0x12')]);router[_0x0964('0x13')](_0x0964('0xb'),auth[_0x0964('0x9')](),controller[_0x0964('0x14')]);module[_0x0964('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 50a44a4..73ae46d 100644 --- a/server/api/voiceExtension/voiceExtension.attributes.js +++ b/server/api/voiceExtension/voiceExtension.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x282fb7,_0x5a4048){var _0x5d03a0=function(_0x16a207){while(--_0x16a207){_0x282fb7['push'](_0x282fb7['shift']());}};_0x5d03a0(++_0x5a4048);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x1bbf98,_0x223289){var _0x116c4e=function(_0xe8a430){while(--_0xe8a430){_0x1bbf98['push'](_0x1bbf98['shift']());}};_0x116c4e(++_0x223289);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 0dc8d7b..23057f8 100644 --- a/server/api/voiceExtension/voiceExtension.controller.js +++ b/server/api/voiceExtension/voiceExtension.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','error','stack','send','index','VoiceExtension','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','key','field','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis'];(function(_0xfc1d53,_0x4165b2){var _0x561c46=function(_0x26b7e6){while(--_0x26b7e6){_0xfc1d53['push'](_0xfc1d53['shift']());}};_0x561c46(++_0x4165b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./voiceExtension.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0x0a9e('0x26'),'value':_0x0a9e('0x27'),'ignore':![]},{'name':_0x0a9e('0x28'),'value':_0x0a9e('0x29'),'ignore':![]}];var _0x526cf3=_(_0x16b1ca)[_0x0a9e('0x2a')]('ignore')[_0x0a9e('0x2b')]('value')[_0x0a9e('0x2c')]();if(_[_0x0a9e('0x2d')](_0x526cf3,_0x370d86[_0x0a9e('0x2e')])){return;}var _0x14433c=_[_0x0a9e('0x2f')](_0x16b1ca,[_0x0a9e('0x2c'),_0x370d86[_0x0a9e('0x2e')]])[_0x0a9e('0x30')];return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x14433c,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15b200,_0x40e7a3){return function(_0x1843b2){if(!_0x1843b2){_0x15b200[_0x0a9e('0x18')](0x194);}return _0x1843b2;};}function handleError(_0x58b06f,_0x563b45){_0x563b45=_0x563b45||0x1f4;return function(_0x296f41){logger[_0x0a9e('0x31')](_0x296f41[_0x0a9e('0x32')]);if(_0x296f41['name']){delete _0x296f41[_0x0a9e('0x30')];}_0x58b06f['status'](_0x563b45)[_0x0a9e('0x33')](_0x296f41);};}exports[_0x0a9e('0x34')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a={},_0x5180f1={},_0x66c1d2={'count':0x0,'rows':[]};var _0x46f0a5=db[_0x0a9e('0x35')][_0x0a9e('0x36')];_0x5180f1[_0x0a9e('0x37')]=_[_0x0a9e('0x38')](_0x46f0a5);_0x5180f1[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x1122db['query']);_0x5180f1[_0x0a9e('0x3a')]=_['intersection'](_0x5180f1[_0x0a9e('0x37')],_0x5180f1[_0x0a9e('0x39')]);_0x25ce3a[_0x0a9e('0x3b')]=_[_0x0a9e('0x3c')](_0x5180f1['model'],qs[_0x0a9e('0x3d')](_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x25ce3a[_0x0a9e('0x3b')]=_0x25ce3a['attributes']['length']?_0x25ce3a[_0x0a9e('0x3b')]:_0x5180f1['model'];if(!_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x3e')](_0x0a9e('0x3f'))){_0x25ce3a[_0x0a9e('0x1d')]=qs['limit'](_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x25ce3a[_0x0a9e('0x1c')]=qs['offset'](_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x25ce3a[_0x0a9e('0x40')]=qs['sort'](_0x1122db['query'][_0x0a9e('0x41')]);_0x25ce3a[_0x0a9e('0x42')]=qs['filters'](_[_0x0a9e('0x43')](_0x1122db[_0x0a9e('0x39')],_0x5180f1[_0x0a9e('0x3a')]));if(_0x1122db[_0x0a9e('0x39')]['filter']){_0x25ce3a['where']=_[_0x0a9e('0x44')](_0x25ce3a[_0x0a9e('0x42')],{'$or':_['map'](_0x46f0a5,function(_0x183991){if(_0x183991[_0x0a9e('0x2e')][_0x0a9e('0x45')]!=='VIRTUAL'){var _0x316c8f={};_0x316c8f[_0x183991[_0x0a9e('0x46')]]={'$like':'%'+_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x2a')]+'%'};return _0x316c8f;}})});}_0x25ce3a=_[_0x0a9e('0x44')]({},_0x25ce3a,_0x1122db[_0x0a9e('0x47')]);var _0x2881b3={'where':_0x25ce3a[_0x0a9e('0x42')]};return db[_0x0a9e('0x35')][_0x0a9e('0x1b')](_0x2881b3)[_0x0a9e('0x23')](function(_0x148007){_0x66c1d2[_0x0a9e('0x1b')]=_0x148007;if(_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x48')]){_0x25ce3a['include']=[{'all':!![]}];}return db['VoiceExtension'][_0x0a9e('0x49')](_0x25ce3a);})[_0x0a9e('0x23')](function(_0x405c8f){_0x66c1d2[_0x0a9e('0x4a')]=_0x405c8f;return _0x66c1d2;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x33bdb7,_0x25ce3a))[_0x0a9e('0x4b')](handleError(_0x33bdb7,null));};exports[_0x0a9e('0x4c')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'raw':![],'where':{'id':_0x445e25[_0x0a9e('0x4d')]['id']}},_0x2c2cb0={};_0x2c2cb0['model']=_[_0x0a9e('0x38')](db[_0x0a9e('0x35')][_0x0a9e('0x36')]);_0x2c2cb0[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x445e25[_0x0a9e('0x39')]);_0x2c2cb0[_0x0a9e('0x3a')]=_[_0x0a9e('0x3c')](_0x2c2cb0['model'],_0x2c2cb0[_0x0a9e('0x39')]);_0x25c6e6['attributes']=_[_0x0a9e('0x3c')](_0x2c2cb0[_0x0a9e('0x37')],qs[_0x0a9e('0x3d')](_0x445e25['query'][_0x0a9e('0x3d')]));_0x25c6e6[_0x0a9e('0x3b')]=_0x25c6e6[_0x0a9e('0x3b')][_0x0a9e('0x4e')]?_0x25c6e6[_0x0a9e('0x3b')]:_0x2c2cb0[_0x0a9e('0x37')];if(_0x445e25[_0x0a9e('0x39')]['includeAll']){_0x25c6e6[_0x0a9e('0x4f')]=[{'all':!![]}];}_0x25c6e6=_[_0x0a9e('0x44')]({},_0x25c6e6,_0x445e25[_0x0a9e('0x47')]);return db[_0x0a9e('0x35')][_0x0a9e('0x2f')](_0x25c6e6)[_0x0a9e('0x23')](handleEntityNotFound(_0x432fcc,null))[_0x0a9e('0x23')](respondWithResult(_0x432fcc,null))[_0x0a9e('0x4b')](handleError(_0x432fcc,null));};exports[_0x0a9e('0x24')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x23')](removeEntity(_0xe401a,null))[_0x0a9e('0x4b')](handleError(_0xe401a,null));};exports[_0x0a9e('0x50')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x51')][_0x0a9e('0x2e')]===_0x0a9e('0x27')&&!_['startsWith'](_0x11545a['body']['exten'],'_')){_0x11545a[_0x0a9e('0x51')][_0x0a9e('0x52')]='_'[_0x0a9e('0x53')](_0x11545a['body'][_0x0a9e('0x52')]);}return db[_0x0a9e('0x35')]['create'](_0x11545a['body'],{'raw':![]})[_0x0a9e('0x23')](function(_0x59c6ff){var _0x443e72=_0x11545a['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x443e72)throw new Error(_0x0a9e('0x54'));if(_0x443e72[_0x0a9e('0x55')]==='user'){var _0x2f82da=_0x59c6ff[_0x0a9e('0x25')]({'plain':!![]});var _0x508b47=[{'name':'InboundRoutes','value':_0x0a9e('0x56')},{'name':_0x0a9e('0x26'),'value':'outbound'},{'name':_0x0a9e('0x28'),'value':'internal'}];var _0x211ef9=_['find'](_0x508b47,[_0x0a9e('0x2c'),_0x2f82da['type']])['name'];return db['UserProfileSection'][_0x0a9e('0x2f')]({'where':{'name':_0x211ef9,'userProfileId':_0x443e72['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x65432){if(_0x65432&&_0x65432[_0x0a9e('0x57')]===0x0){return db[_0x0a9e('0x58')][_0x0a9e('0x50')]({'name':_0x2f82da[_0x0a9e('0x30')],'resourceId':_0x2f82da['id'],'type':_0x65432[_0x0a9e('0x30')],'sectionId':_0x65432['id']},{})[_0x0a9e('0x23')](function(){return _0x59c6ff;});}else{return _0x59c6ff;}})['catch'](function(_0x1c693e){logger[_0x0a9e('0x31')](_0x0a9e('0x59'),_0x1c693e);throw _0x1c693e;});}return _0x59c6ff;})[_0x0a9e('0x23')](respondWithResult(_0x61bb17,0xc9))[_0x0a9e('0x4b')](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x5d86e9,_0x956fbe){if(_0x5d86e9[_0x0a9e('0x51')]['id']){delete _0x5d86e9['body']['id'];}return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x5d86e9[_0x0a9e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x956fbe,null))['then'](function(_0x5674ee){if(_0x5674ee){return db[_0x0a9e('0x35')]['update'](_[_0x0a9e('0x43')](_0x5d86e9[_0x0a9e('0x51')],[_0x0a9e('0x52'),_0x0a9e('0x5a'),_0x0a9e('0x5b'),_0x0a9e('0x5c'),'cutdigits',_0x0a9e('0x5d')]),{'where':{'context':_0x5674ee['context'],'exten':_0x5674ee[_0x0a9e('0x52')]},'individualHooks':!![]})[_0x0a9e('0x23')](function(_0x51aaf7){return _0x51aaf7;});}return null;})['then'](respondWithStatusCode(_0x956fbe,null))[_0x0a9e('0x4b')](handleError(_0x956fbe,null));};exports[_0x0a9e('0x5e')]=function(_0x119677,_0x32e134,_0x497d91){return db[_0x0a9e('0x35')][_0x0a9e('0x5f')]({'where':{'id':_0x119677['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x32e134,null))[_0x0a9e('0x23')](function(_0x88dcbf){if(_0x88dcbf){return db[_0x0a9e('0x60')][_0x0a9e('0x61')](function(_0x4d4a35){return db[_0x0a9e('0x35')][_0x0a9e('0x24')]({'where':{'VoiceExtensionId':_0x119677[_0x0a9e('0x4d')]['id']},'transaction':_0x4d4a35})['then'](function(_0x3528b7){var _0x4f1e60=_['map'](_0x119677[_0x0a9e('0x51')],function(_0x4556c5){_0x4556c5[_0x0a9e('0x62')]=_0x119677[_0x0a9e('0x4d')]['id'];return _0x4556c5;});return db[_0x0a9e('0x35')][_0x0a9e('0x63')](_0x4f1e60,{'transaction':_0x4d4a35});});})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x35')][_0x0a9e('0x64')]({'where':{'isApp':!![],'VoiceExtensionId':_0x119677[_0x0a9e('0x4d')]['id']},'order':_0x0a9e('0x65')});});}})[_0x0a9e('0x23')](respondWithResult(_0x32e134,null))[_0x0a9e('0x4b')](handleError(_0x32e134,null));}; \ No newline at end of file +var _0xa9e0=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','error','stack','send','index','VoiceExtension','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','key','field','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis'];(function(_0x33f226,_0x101d32){var _0x277648=function(_0x234ba0){while(--_0x234ba0){_0x33f226['push'](_0x33f226['shift']());}};_0x277648(++_0x101d32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./voiceExtension.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0x0a9e('0x26'),'value':_0x0a9e('0x27'),'ignore':![]},{'name':_0x0a9e('0x28'),'value':_0x0a9e('0x29'),'ignore':![]}];var _0x526cf3=_(_0x16b1ca)[_0x0a9e('0x2a')]('ignore')[_0x0a9e('0x2b')]('value')[_0x0a9e('0x2c')]();if(_[_0x0a9e('0x2d')](_0x526cf3,_0x370d86[_0x0a9e('0x2e')])){return;}var _0x14433c=_[_0x0a9e('0x2f')](_0x16b1ca,[_0x0a9e('0x2c'),_0x370d86[_0x0a9e('0x2e')]])[_0x0a9e('0x30')];return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x14433c,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15b200,_0x40e7a3){return function(_0x1843b2){if(!_0x1843b2){_0x15b200[_0x0a9e('0x18')](0x194);}return _0x1843b2;};}function handleError(_0x58b06f,_0x563b45){_0x563b45=_0x563b45||0x1f4;return function(_0x296f41){logger[_0x0a9e('0x31')](_0x296f41[_0x0a9e('0x32')]);if(_0x296f41['name']){delete _0x296f41[_0x0a9e('0x30')];}_0x58b06f['status'](_0x563b45)[_0x0a9e('0x33')](_0x296f41);};}exports[_0x0a9e('0x34')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a={},_0x5180f1={},_0x66c1d2={'count':0x0,'rows':[]};var _0x46f0a5=db[_0x0a9e('0x35')][_0x0a9e('0x36')];_0x5180f1[_0x0a9e('0x37')]=_[_0x0a9e('0x38')](_0x46f0a5);_0x5180f1[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x1122db['query']);_0x5180f1[_0x0a9e('0x3a')]=_['intersection'](_0x5180f1[_0x0a9e('0x37')],_0x5180f1[_0x0a9e('0x39')]);_0x25ce3a[_0x0a9e('0x3b')]=_[_0x0a9e('0x3c')](_0x5180f1['model'],qs[_0x0a9e('0x3d')](_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x25ce3a[_0x0a9e('0x3b')]=_0x25ce3a['attributes']['length']?_0x25ce3a[_0x0a9e('0x3b')]:_0x5180f1['model'];if(!_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x3e')](_0x0a9e('0x3f'))){_0x25ce3a[_0x0a9e('0x1d')]=qs['limit'](_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x25ce3a[_0x0a9e('0x1c')]=qs['offset'](_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x25ce3a[_0x0a9e('0x40')]=qs['sort'](_0x1122db['query'][_0x0a9e('0x41')]);_0x25ce3a[_0x0a9e('0x42')]=qs['filters'](_[_0x0a9e('0x43')](_0x1122db[_0x0a9e('0x39')],_0x5180f1[_0x0a9e('0x3a')]));if(_0x1122db[_0x0a9e('0x39')]['filter']){_0x25ce3a['where']=_[_0x0a9e('0x44')](_0x25ce3a[_0x0a9e('0x42')],{'$or':_['map'](_0x46f0a5,function(_0x183991){if(_0x183991[_0x0a9e('0x2e')][_0x0a9e('0x45')]!=='VIRTUAL'){var _0x316c8f={};_0x316c8f[_0x183991[_0x0a9e('0x46')]]={'$like':'%'+_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x2a')]+'%'};return _0x316c8f;}})});}_0x25ce3a=_[_0x0a9e('0x44')]({},_0x25ce3a,_0x1122db[_0x0a9e('0x47')]);var _0x2881b3={'where':_0x25ce3a[_0x0a9e('0x42')]};return db[_0x0a9e('0x35')][_0x0a9e('0x1b')](_0x2881b3)[_0x0a9e('0x23')](function(_0x148007){_0x66c1d2[_0x0a9e('0x1b')]=_0x148007;if(_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x48')]){_0x25ce3a['include']=[{'all':!![]}];}return db['VoiceExtension'][_0x0a9e('0x49')](_0x25ce3a);})[_0x0a9e('0x23')](function(_0x405c8f){_0x66c1d2[_0x0a9e('0x4a')]=_0x405c8f;return _0x66c1d2;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x33bdb7,_0x25ce3a))[_0x0a9e('0x4b')](handleError(_0x33bdb7,null));};exports[_0x0a9e('0x4c')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'raw':![],'where':{'id':_0x445e25[_0x0a9e('0x4d')]['id']}},_0x2c2cb0={};_0x2c2cb0['model']=_[_0x0a9e('0x38')](db[_0x0a9e('0x35')][_0x0a9e('0x36')]);_0x2c2cb0[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x445e25[_0x0a9e('0x39')]);_0x2c2cb0[_0x0a9e('0x3a')]=_[_0x0a9e('0x3c')](_0x2c2cb0['model'],_0x2c2cb0[_0x0a9e('0x39')]);_0x25c6e6['attributes']=_[_0x0a9e('0x3c')](_0x2c2cb0[_0x0a9e('0x37')],qs[_0x0a9e('0x3d')](_0x445e25['query'][_0x0a9e('0x3d')]));_0x25c6e6[_0x0a9e('0x3b')]=_0x25c6e6[_0x0a9e('0x3b')][_0x0a9e('0x4e')]?_0x25c6e6[_0x0a9e('0x3b')]:_0x2c2cb0[_0x0a9e('0x37')];if(_0x445e25[_0x0a9e('0x39')]['includeAll']){_0x25c6e6[_0x0a9e('0x4f')]=[{'all':!![]}];}_0x25c6e6=_[_0x0a9e('0x44')]({},_0x25c6e6,_0x445e25[_0x0a9e('0x47')]);return db[_0x0a9e('0x35')][_0x0a9e('0x2f')](_0x25c6e6)[_0x0a9e('0x23')](handleEntityNotFound(_0x432fcc,null))[_0x0a9e('0x23')](respondWithResult(_0x432fcc,null))[_0x0a9e('0x4b')](handleError(_0x432fcc,null));};exports[_0x0a9e('0x24')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x23')](removeEntity(_0xe401a,null))[_0x0a9e('0x4b')](handleError(_0xe401a,null));};exports[_0x0a9e('0x50')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x51')][_0x0a9e('0x2e')]===_0x0a9e('0x27')&&!_['startsWith'](_0x11545a['body']['exten'],'_')){_0x11545a[_0x0a9e('0x51')][_0x0a9e('0x52')]='_'[_0x0a9e('0x53')](_0x11545a['body'][_0x0a9e('0x52')]);}return db[_0x0a9e('0x35')]['create'](_0x11545a['body'],{'raw':![]})[_0x0a9e('0x23')](function(_0x59c6ff){var _0x443e72=_0x11545a['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x443e72)throw new Error(_0x0a9e('0x54'));if(_0x443e72[_0x0a9e('0x55')]==='user'){var _0x2f82da=_0x59c6ff[_0x0a9e('0x25')]({'plain':!![]});var _0x508b47=[{'name':'InboundRoutes','value':_0x0a9e('0x56')},{'name':_0x0a9e('0x26'),'value':'outbound'},{'name':_0x0a9e('0x28'),'value':'internal'}];var _0x211ef9=_['find'](_0x508b47,[_0x0a9e('0x2c'),_0x2f82da['type']])['name'];return db['UserProfileSection'][_0x0a9e('0x2f')]({'where':{'name':_0x211ef9,'userProfileId':_0x443e72['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x65432){if(_0x65432&&_0x65432[_0x0a9e('0x57')]===0x0){return db[_0x0a9e('0x58')][_0x0a9e('0x50')]({'name':_0x2f82da[_0x0a9e('0x30')],'resourceId':_0x2f82da['id'],'type':_0x65432[_0x0a9e('0x30')],'sectionId':_0x65432['id']},{})[_0x0a9e('0x23')](function(){return _0x59c6ff;});}else{return _0x59c6ff;}})['catch'](function(_0x1c693e){logger[_0x0a9e('0x31')](_0x0a9e('0x59'),_0x1c693e);throw _0x1c693e;});}return _0x59c6ff;})[_0x0a9e('0x23')](respondWithResult(_0x61bb17,0xc9))[_0x0a9e('0x4b')](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x5d86e9,_0x956fbe){if(_0x5d86e9[_0x0a9e('0x51')]['id']){delete _0x5d86e9['body']['id'];}return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x5d86e9[_0x0a9e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x956fbe,null))['then'](function(_0x5674ee){if(_0x5674ee){return db[_0x0a9e('0x35')]['update'](_[_0x0a9e('0x43')](_0x5d86e9[_0x0a9e('0x51')],[_0x0a9e('0x52'),_0x0a9e('0x5a'),_0x0a9e('0x5b'),_0x0a9e('0x5c'),'cutdigits',_0x0a9e('0x5d')]),{'where':{'context':_0x5674ee['context'],'exten':_0x5674ee[_0x0a9e('0x52')]},'individualHooks':!![]})[_0x0a9e('0x23')](function(_0x51aaf7){return _0x51aaf7;});}return null;})['then'](respondWithStatusCode(_0x956fbe,null))[_0x0a9e('0x4b')](handleError(_0x956fbe,null));};exports[_0x0a9e('0x5e')]=function(_0x119677,_0x32e134,_0x497d91){return db[_0x0a9e('0x35')][_0x0a9e('0x5f')]({'where':{'id':_0x119677['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x32e134,null))[_0x0a9e('0x23')](function(_0x88dcbf){if(_0x88dcbf){return db[_0x0a9e('0x60')][_0x0a9e('0x61')](function(_0x4d4a35){return db[_0x0a9e('0x35')][_0x0a9e('0x24')]({'where':{'VoiceExtensionId':_0x119677[_0x0a9e('0x4d')]['id']},'transaction':_0x4d4a35})['then'](function(_0x3528b7){var _0x4f1e60=_['map'](_0x119677[_0x0a9e('0x51')],function(_0x4556c5){_0x4556c5[_0x0a9e('0x62')]=_0x119677[_0x0a9e('0x4d')]['id'];return _0x4556c5;});return db[_0x0a9e('0x35')][_0x0a9e('0x63')](_0x4f1e60,{'transaction':_0x4d4a35});});})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x35')][_0x0a9e('0x64')]({'where':{'isApp':!![],'VoiceExtensionId':_0x119677[_0x0a9e('0x4d')]['id']},'order':_0x0a9e('0x65')});});}})[_0x0a9e('0x23')](respondWithResult(_0x32e134,null))[_0x0a9e('0x4b')](handleError(_0x32e134,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 058a40a..5acf238 100644 --- a/server/api/voiceExtension/voiceExtension.events.js +++ b/server/api/voiceExtension/voiceExtension.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeaac=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','VoiceExtension'];(function(_0x1ec67f,_0x59940d){var _0x3531d5=function(_0x3812b3){while(--_0x3812b3){_0x1ec67f['push'](_0x1ec67f['shift']());}};_0x3531d5(++_0x59940d);}(_0xeaac,0xa7));var _0xceaa=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xeaac[_0x16b9ed];return _0x66b1f8;};'use strict';var EventEmitter=require(_0xceaa('0x0'));var VoiceExtension=require(_0xceaa('0x1'))['db'][_0xceaa('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xceaa('0x3')](0x0);var events={'afterCreate':_0xceaa('0x4'),'afterUpdate':_0xceaa('0x5'),'afterDestroy':_0xceaa('0x6')};function emitEvent(_0x1ecbef){return function(_0xc2ab8e,_0x233cfa,_0x469f43){VoiceExtensionEvents[_0xceaa('0x7')](_0x1ecbef+':'+_0xc2ab8e['id'],_0xc2ab8e);VoiceExtensionEvents[_0xceaa('0x7')](_0x1ecbef,_0xc2ab8e);_0x469f43(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xceaa('0x8')](e,emitEvent(event));}}module[_0xceaa('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0xcc76=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','remove'];(function(_0x33e76a,_0x5a5433){var _0x34a165=function(_0x4f43e0){while(--_0x4f43e0){_0x33e76a['push'](_0x33e76a['shift']());}};_0x34a165(++_0x5a5433);}(_0xcc76,0x11a));var _0x6cc7=function(_0x487671,_0x4fc7e3){_0x487671=_0x487671-0x0;var _0x45e510=_0xcc76[_0x487671];return _0x45e510;};'use strict';var EventEmitter=require(_0x6cc7('0x0'));var VoiceExtension=require(_0x6cc7('0x1'))['db'][_0x6cc7('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6cc7('0x3')](0x0);var events={'afterCreate':_0x6cc7('0x4'),'afterUpdate':'update','afterDestroy':_0x6cc7('0x5')};function emitEvent(_0x5a236e){return function(_0xbd6ebd,_0x2f960c,_0x3351b9){VoiceExtensionEvents['emit'](_0x5a236e+':'+_0xbd6ebd['id'],_0xbd6ebd);VoiceExtensionEvents['emit'](_0x5a236e,_0xbd6ebd);_0x3351b9(null);};}for(var e in events){if(events[_0x6cc7('0x6')](e)){var event=events[e];VoiceExtension[_0x6cc7('0x7')](e,emitEvent(event));}}module[_0x6cc7('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 3cf2716..a95ea03 100644 --- a/server/api/voiceExtension/voiceExtension.model.js +++ b/server/api/voiceExtension/voiceExtension.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2418=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','voice_extensions','lodash','util','../../config/logger'];(function(_0x114cc0,_0x3132bc){var _0x3307a8=function(_0x29e841){while(--_0x29e841){_0x114cc0['push'](_0x114cc0['shift']());}};_0x3307a8(++_0x3132bc);}(_0x2418,0xde));var _0x8241=function(_0x530cee,_0xa0be3c){_0x530cee=_0x530cee-0x0;var _0xde0c68=_0x2418[_0x530cee];return _0xde0c68;};'use strict';var _=require(_0x8241('0x0'));var util=require(_0x8241('0x1'));var logger=require(_0x8241('0x2'))(_0x8241('0x3'));var moment=require(_0x8241('0x4'));var BPromise=require(_0x8241('0x5'));var rp=require(_0x8241('0x6'));var fs=require('fs');var path=require(_0x8241('0x7'));var rimraf=require(_0x8241('0x8'));var config=require(_0x8241('0x9'));var attributes=require(_0x8241('0xa'));module[_0x8241('0xb')]=function(_0xb38d18,_0x5f9c3){return _0xb38d18[_0x8241('0xc')](_0x8241('0xd'),attributes,{'tableName':_0x8241('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x838a=['define','VoiceExtension','voice_extensions','lodash','api','moment','request-promise','rimraf','./voiceExtension.attributes','exports'];(function(_0x48b4f9,_0xbbe897){var _0x30dda9=function(_0xddc3b6){while(--_0xddc3b6){_0x48b4f9['push'](_0x48b4f9['shift']());}};_0x30dda9(++_0xbbe897);}(_0x838a,0xdf));var _0xa838=function(_0x2b0f81,_0x3917f0){_0x2b0f81=_0x2b0f81-0x0;var _0x5ce74c=_0x838a[_0x2b0f81];return _0x5ce74c;};'use strict';var _=require(_0xa838('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa838('0x1'));var moment=require(_0xa838('0x2'));var BPromise=require('bluebird');var rp=require(_0xa838('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa838('0x4'));var config=require('../../config/environment');var attributes=require(_0xa838('0x5'));module[_0xa838('0x6')]=function(_0x538854,_0x34ebae){return _0x538854[_0xa838('0x7')](_0xa838('0x8'),attributes,{'tableName':_0xa838('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index ecfeaa9..b9a5429 100644 --- a/server/api/voiceExtension/voiceExtension.rpc.js +++ b/server/api/voiceExtension/voiceExtension.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6204=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','VoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','GetVoiceExtension','lodash','util','moment','bluebird'];(function(_0x4dae23,_0x484b63){var _0x799f9d=function(_0xeb3c30){while(--_0xeb3c30){_0x4dae23['push'](_0x4dae23['shift']());}};_0x799f9d(++_0x484b63);}(_0x6204,0xf8));var _0x4620=function(_0x3531c2,_0x29a5dd){_0x3531c2=_0x3531c2-0x0;var _0x44c5df=_0x6204[_0x3531c2];return _0x44c5df;};'use strict';var _=require(_0x4620('0x0'));var util=require(_0x4620('0x1'));var moment=require(_0x4620('0x2'));var BPromise=require(_0x4620('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4620('0x4'));var db=require(_0x4620('0x5'))['db'];var utils=require(_0x4620('0x6'));var logger=require(_0x4620('0x7'))(_0x4620('0x8'));var config=require(_0x4620('0x9'));var jayson=require(_0x4620('0xa'));var client=jayson[_0x4620('0xb')][_0x4620('0xc')]({'port':0x232a});config[_0x4620('0xd')]=_[_0x4620('0xe')](config['redis'],{'host':_0x4620('0xf'),'port':0x18eb});var socket=require(_0x4620('0x10'))(new Redis(config[_0x4620('0xd')]));require(_0x4620('0x11'))[_0x4620('0x12')](socket);function respondWithRpcPromise(_0x329af6,_0x47406f,_0x5b097b){return new BPromise(function(_0xe7089c,_0x333452){return client[_0x4620('0x13')](_0x329af6,_0x5b097b)[_0x4620('0x14')](function(_0xbf5e07){logger['info'](_0x4620('0x15'),_0x47406f,_0x4620('0x16'));logger[_0x4620('0x17')](_0x4620('0x18'),_0x47406f,_0x4620('0x16'),JSON['stringify'](_0xbf5e07));if(_0xbf5e07[_0x4620('0x19')]){if(_0xbf5e07[_0x4620('0x19')][_0x4620('0x1a')]===0x1f4){logger[_0x4620('0x19')](_0x4620('0x15'),_0x47406f,_0xbf5e07[_0x4620('0x19')][_0x4620('0x1b')]);return _0x333452(_0xbf5e07[_0x4620('0x19')]['message']);}logger[_0x4620('0x19')](_0x4620('0x15'),_0x47406f,_0xbf5e07[_0x4620('0x19')][_0x4620('0x1b')]);return _0xe7089c(_0xbf5e07[_0x4620('0x19')][_0x4620('0x1b')]);}else{logger[_0x4620('0x1c')]('VoiceExtension,\x20%s,\x20%s',_0x47406f,_0x4620('0x16'));_0xe7089c(_0xbf5e07[_0x4620('0x1d')][_0x4620('0x1b')]);}})[_0x4620('0x1e')](function(_0x39e722){logger[_0x4620('0x19')](_0x4620('0x15'),_0x47406f,_0x39e722);_0x333452(_0x39e722);});});}exports['GetVoiceExtension']=function(_0x5059ef){var _0x1574fb=this;return new Promise(function(_0xe65508,_0x53d635){return db[_0x4620('0x1f')][_0x4620('0x20')]({'raw':_0x5059ef[_0x4620('0x21')]?_0x5059ef[_0x4620('0x21')][_0x4620('0x22')]===undefined?!![]:![]:!![],'where':_0x5059ef[_0x4620('0x21')]?_0x5059ef['options'][_0x4620('0x23')]||null:null,'attributes':_0x5059ef[_0x4620('0x21')]?_0x5059ef[_0x4620('0x21')]['attributes']||null:null,'limit':_0x5059ef[_0x4620('0x21')]?_0x5059ef[_0x4620('0x21')][_0x4620('0x24')]||null:null,'include':_0x5059ef[_0x4620('0x21')]?_0x5059ef[_0x4620('0x21')][_0x4620('0x25')]?_[_0x4620('0x26')](_0x5059ef[_0x4620('0x21')][_0x4620('0x25')],function(_0x3f4bbf){return{'model':db[_0x3f4bbf[_0x4620('0x27')]],'as':_0x3f4bbf['as'],'attributes':_0x3f4bbf[_0x4620('0x28')],'include':_0x3f4bbf[_0x4620('0x25')]?_[_0x4620('0x26')](_0x3f4bbf[_0x4620('0x25')],function(_0x1cddd6){return{'model':db[_0x1cddd6[_0x4620('0x27')]],'as':_0x1cddd6['as'],'attributes':_0x1cddd6[_0x4620('0x28')],'include':_0x1cddd6[_0x4620('0x25')]?_[_0x4620('0x26')](_0x1cddd6[_0x4620('0x25')],function(_0x584ca7){return{'model':db[_0x584ca7['model']],'as':_0x584ca7['as'],'attributes':_0x584ca7[_0x4620('0x28')]};}):[]};}):[]};}):[]:[]})[_0x4620('0x14')](function(_0x432c50){logger[_0x4620('0x1c')](_0x4620('0x29'),_0x5059ef);logger[_0x4620('0x17')](_0x4620('0x29'),_0x5059ef,JSON['stringify'](_0x432c50));_0xe65508(_0x432c50);})[_0x4620('0x1e')](function(_0x4dc20c){logger[_0x4620('0x19')]('GetVoiceExtension',_0x4dc20c[_0x4620('0x1b')],_0x5059ef);_0x53d635(_0x1574fb[_0x4620('0x19')](0x1f4,_0x4dc20c[_0x4620('0x1b')]));});});}; \ No newline at end of file +var _0x6153=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','code','error','VoiceExtension,\x20%s,\x20%s','message','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','map','include','model','attributes','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x96d26c,_0xc42ea2){var _0x43d74c=function(_0x523b6e){while(--_0x523b6e){_0x96d26c['push'](_0x96d26c['shift']());}};_0x43d74c(++_0xc42ea2);}(_0x6153,0x174));var _0x3615=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x6153[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x3615('0x0'));var util=require(_0x3615('0x1'));var moment=require('moment');var BPromise=require(_0x3615('0x2'));var rs=require(_0x3615('0x3'));var fs=require('fs');var Redis=require(_0x3615('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3615('0x5'));var logger=require(_0x3615('0x6'))(_0x3615('0x7'));var config=require(_0x3615('0x8'));var jayson=require(_0x3615('0x9'));var client=jayson[_0x3615('0xa')][_0x3615('0xb')]({'port':0x232a});config[_0x3615('0xc')]=_['defaults'](config['redis'],{'host':_0x3615('0xd'),'port':0x18eb});var socket=require(_0x3615('0xe'))(new Redis(config[_0x3615('0xc')]));require('./voiceExtension.socket')[_0x3615('0xf')](socket);function respondWithRpcPromise(_0x18b9e8,_0x5b85d8,_0x51c794){return new BPromise(function(_0x47b455,_0x4e2afd){return client['request'](_0x18b9e8,_0x51c794)[_0x3615('0x10')](function(_0x266182){logger[_0x3615('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x5b85d8,_0x3615('0x12'));logger[_0x3615('0x13')](_0x3615('0x14'),_0x5b85d8,_0x3615('0x12'),JSON['stringify'](_0x266182));if(_0x266182['error']){if(_0x266182['error'][_0x3615('0x15')]===0x1f4){logger[_0x3615('0x16')](_0x3615('0x17'),_0x5b85d8,_0x266182[_0x3615('0x16')][_0x3615('0x18')]);return _0x4e2afd(_0x266182[_0x3615('0x16')][_0x3615('0x18')]);}logger[_0x3615('0x16')](_0x3615('0x17'),_0x5b85d8,_0x266182[_0x3615('0x16')][_0x3615('0x18')]);return _0x47b455(_0x266182['error'][_0x3615('0x18')]);}else{logger[_0x3615('0x11')](_0x3615('0x17'),_0x5b85d8,_0x3615('0x12'));_0x47b455(_0x266182['result'][_0x3615('0x18')]);}})['catch'](function(_0x5b0ff5){logger[_0x3615('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x5b85d8,_0x5b0ff5);_0x4e2afd(_0x5b0ff5);});});}exports[_0x3615('0x19')]=function(_0x5f14d2){var _0x588444=this;return new Promise(function(_0x5b7354,_0x4ad65c){return db[_0x3615('0x1a')][_0x3615('0x1b')]({'raw':_0x5f14d2[_0x3615('0x1c')]?_0x5f14d2[_0x3615('0x1c')][_0x3615('0x1d')]===undefined?!![]:![]:!![],'where':_0x5f14d2[_0x3615('0x1c')]?_0x5f14d2[_0x3615('0x1c')][_0x3615('0x1e')]||null:null,'attributes':_0x5f14d2[_0x3615('0x1c')]?_0x5f14d2[_0x3615('0x1c')]['attributes']||null:null,'limit':_0x5f14d2[_0x3615('0x1c')]?_0x5f14d2['options'][_0x3615('0x1f')]||null:null,'include':_0x5f14d2[_0x3615('0x1c')]?_0x5f14d2['options']['include']?_[_0x3615('0x20')](_0x5f14d2[_0x3615('0x1c')][_0x3615('0x21')],function(_0x3da613){return{'model':db[_0x3da613[_0x3615('0x22')]],'as':_0x3da613['as'],'attributes':_0x3da613[_0x3615('0x23')],'include':_0x3da613['include']?_[_0x3615('0x20')](_0x3da613[_0x3615('0x21')],function(_0x3f0e20){return{'model':db[_0x3f0e20[_0x3615('0x22')]],'as':_0x3f0e20['as'],'attributes':_0x3f0e20[_0x3615('0x23')],'include':_0x3f0e20[_0x3615('0x21')]?_[_0x3615('0x20')](_0x3f0e20[_0x3615('0x21')],function(_0x588ab1){return{'model':db[_0x588ab1['model']],'as':_0x588ab1['as'],'attributes':_0x588ab1[_0x3615('0x23')]};}):[]};}):[]};}):[]:[]})[_0x3615('0x10')](function(_0x3f199f){logger['info'](_0x3615('0x19'),_0x5f14d2);logger[_0x3615('0x13')](_0x3615('0x19'),_0x5f14d2,JSON[_0x3615('0x24')](_0x3f199f));_0x5b7354(_0x3f199f);})[_0x3615('0x25')](function(_0x9ea888){logger['error'](_0x3615('0x19'),_0x9ea888[_0x3615('0x18')],_0x5f14d2);_0x4ad65c(_0x588444['error'](0x1f4,_0x9ea888[_0x3615('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index c4985c0..2daf95a 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85b4=['register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x524e33,_0x215056){var _0x593928=function(_0x53b2c5){while(--_0x53b2c5){_0x524e33['push'](_0x524e33['shift']());}};_0x593928(++_0x215056);}(_0x85b4,0x173));var _0x485b=function(_0x480fc2,_0x482fba){_0x480fc2=_0x480fc2-0x0;var _0x540a95=_0x85b4[_0x480fc2];return _0x540a95;};'use strict';var VoiceExtensionEvents=require(_0x485b('0x0'));var events=[_0x485b('0x1'),_0x485b('0x2'),_0x485b('0x3')];function createListener(_0x40355f,_0x1ab3d2){return function(_0x7fdcd9){_0x1ab3d2[_0x485b('0x4')](_0x40355f,_0x7fdcd9);};}function removeListener(_0x22c04d,_0x41fda9){return function(){VoiceExtensionEvents['removeListener'](_0x22c04d,_0x41fda9);};}exports[_0x485b('0x5')]=function(_0x51d78a){for(var _0x3c0a9a=0x0,_0x28c2a2=events[_0x485b('0x6')];_0x3c0a9a<_0x28c2a2;_0x3c0a9a++){var _0x2d1b8d=events[_0x3c0a9a];var _0x7cb1a4=createListener(_0x485b('0x7')+_0x2d1b8d,_0x51d78a);VoiceExtensionEvents['on'](_0x2d1b8d,_0x7cb1a4);}}; \ No newline at end of file +var _0xf551=['voiceExtension:','./voiceExtension.events','save','remove','update','length'];(function(_0x56b777,_0x231761){var _0x2fccdb=function(_0x16f356){while(--_0x16f356){_0x56b777['push'](_0x56b777['shift']());}};_0x2fccdb(++_0x231761);}(_0xf551,0xf7));var _0x1f55=function(_0x2ef178,_0x565200){_0x2ef178=_0x2ef178-0x0;var _0x45eb27=_0xf551[_0x2ef178];return _0x45eb27;};'use strict';var VoiceExtensionEvents=require(_0x1f55('0x0'));var events=[_0x1f55('0x1'),_0x1f55('0x2'),_0x1f55('0x3')];function createListener(_0xe07a99,_0x57f9f8){return function(_0x518407){_0x57f9f8['emit'](_0xe07a99,_0x518407);};}function removeListener(_0x30f7da,_0x10bc04){return function(){VoiceExtensionEvents['removeListener'](_0x30f7da,_0x10bc04);};}exports['register']=function(_0x268adc){for(var _0x41d601=0x0,_0x2c65c5=events[_0x1f55('0x4')];_0x41d601<_0x2c65c5;_0x41d601++){var _0x46a560=events[_0x41d601];var _0x296d85=createListener(_0x1f55('0x5')+_0x46a560,_0x268adc);VoiceExtensionEvents['on'](_0x46a560,_0x296d85);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 0c13a6e..a848f09 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebe1=['multer','util','path','connect-timeout','Router','./voiceMail.controller','/:id','isAuthenticated','show','get','/:id/messages','post','update','delete'];(function(_0x258d2a,_0x3a48f6){var _0x5d6ebe=function(_0x5eb9b3){while(--_0x5eb9b3){_0x258d2a['push'](_0x258d2a['shift']());}};_0x5d6ebe(++_0x3a48f6);}(_0xebe1,0xe0));var _0x1ebe=function(_0x512b62,_0x14df68){_0x512b62=_0x512b62-0x0;var _0x18b39e=_0xebe1[_0x512b62];return _0x18b39e;};'use strict';var multer=require(_0x1ebe('0x0'));var util=require(_0x1ebe('0x1'));var path=require(_0x1ebe('0x2'));var timeout=require(_0x1ebe('0x3'));var express=require('express');var router=express[_0x1ebe('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1ebe('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1ebe('0x6'),auth[_0x1ebe('0x7')](),controller[_0x1ebe('0x8')]);router[_0x1ebe('0x9')](_0x1ebe('0xa'),auth[_0x1ebe('0x7')](),controller['getMessages']);router[_0x1ebe('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x1ebe('0x7')](),controller[_0x1ebe('0xc')]);router[_0x1ebe('0xd')]('/:id',auth[_0x1ebe('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe56b=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','/:id/messages','getMessages','post','create','put','delete','destroy','exports','multer','path'];(function(_0x5aa249,_0x14fd15){var _0x47126c=function(_0x2b2914){while(--_0x2b2914){_0x5aa249['push'](_0x5aa249['shift']());}};_0x47126c(++_0x14fd15);}(_0xe56b,0x1a2));var _0xbe56=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe56b[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xbe56('0x0'));var util=require('util');var path=require(_0xbe56('0x1'));var timeout=require(_0xbe56('0x2'));var express=require(_0xbe56('0x3'));var router=express[_0xbe56('0x4')]();var auth=require(_0xbe56('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbe56('0x6'));var controller=require(_0xbe56('0x7'));router[_0xbe56('0x8')]('/',auth['isAuthenticated'](),controller[_0xbe56('0x9')]);router[_0xbe56('0x8')](_0xbe56('0xa'),auth[_0xbe56('0xb')](),controller['show']);router[_0xbe56('0x8')](_0xbe56('0xc'),auth[_0xbe56('0xb')](),controller[_0xbe56('0xd')]);router[_0xbe56('0xe')]('/',auth[_0xbe56('0xb')](),controller[_0xbe56('0xf')]);router[_0xbe56('0x10')]('/:id',auth[_0xbe56('0xb')](),controller['update']);router[_0xbe56('0x11')](_0xbe56('0xa'),auth[_0xbe56('0xb')](),controller[_0xbe56('0x12')]);module[_0xbe56('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 922bc4c..0a85553 100644 --- a/server/api/voiceMail/voiceMail.attributes.js +++ b/server/api/voiceMail/voiceMail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','\x20-\x20'];(function(_0x228c5a,_0x2aa4ff){var _0x42a7cd=function(_0x5d875a){while(--_0x5d875a){_0x228c5a['push'](_0x228c5a['shift']());}};_0x42a7cd(++_0x2aa4ff);}(_0x4fc2,0x111));var _0x24fc=function(_0x1ceafa,_0x252713){_0x1ceafa=_0x1ceafa-0x0;var _0x2cb283=_0x4fc2[_0x1ceafa];return _0x2cb283;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'customer_id':{'type':Sequelize[_0x24fc('0x2')]},'context':{'type':Sequelize[_0x24fc('0x2')],'defaultValue':'from-voicemail','unique':_0x24fc('0x3')},'mailbox':{'type':Sequelize[_0x24fc('0x2')],'defaultValue':'','allowNull':![],'unique':_0x24fc('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x24fc('0x2')]},'email':{'type':Sequelize[_0x24fc('0x2')],'validate':{'isEmail':!![]},'set':function(_0x58dafc){this[_0x24fc('0x4')](_0x24fc('0x5'),typeof _0x58dafc==='string'&&_0x58dafc[_0x24fc('0x6')]()?_0x58dafc[_0x24fc('0x6')]():null);}},'pager':{'type':Sequelize[_0x24fc('0x2')]},'tz':{'type':Sequelize[_0x24fc('0x2')],'defaultValue':_0x24fc('0x7')},'attach':{'type':Sequelize[_0x24fc('0x8')]('yes','no'),'defaultValue':_0x24fc('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x24fc('0x8')](_0x24fc('0x9'),'no'),'defaultValue':_0x24fc('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x24fc('0x2')]},'callback':{'type':Sequelize[_0x24fc('0x2')]},'review':{'type':Sequelize[_0x24fc('0x8')](_0x24fc('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x24fc('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x24fc('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x24fc('0x8')](_0x24fc('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x24fc('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x24fc('0x8')](_0x24fc('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x24fc('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x24fc('0x8')](_0x24fc('0x9'),'no'),'defaultValue':_0x24fc('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x24fc('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x24fc('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x24fc('0x8')](_0x24fc('0x9'),'no'),'defaultValue':_0x24fc('0x9'),'allowNull':![]},'stamp':{'type':_0x24fc('0xb')},'emailsubject':{'type':Sequelize[_0x24fc('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x24fc('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x24fc('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x24fc('0xd')],'get':function(){return this[_0x24fc('0xe')]('fullname')+_0x24fc('0xf')+this[_0x24fc('0xe')](_0x24fc('0x10'));}}}; \ No newline at end of file +var _0x6e6c=['yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','ENUM'];(function(_0x3d879e,_0x22c372){var _0x96fbc9=function(_0x4b0033){while(--_0x4b0033){_0x3d879e['push'](_0x3d879e['shift']());}};_0x96fbc9(++_0x22c372);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc6e6('0x2')],'defaultValue':_0xc6e6('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xc6e6('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xc6e6('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0xe59212){this[_0xc6e6('0x5')]('email',typeof _0xe59212===_0xc6e6('0x6')&&_0xe59212[_0xc6e6('0x7')]()?_0xe59212['trim']():null);}},'pager':{'type':Sequelize[_0xc6e6('0x2')]},'tz':{'type':Sequelize[_0xc6e6('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xc6e6('0x8')]('yes','no'),'defaultValue':_0xc6e6('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xc6e6('0x8')](_0xc6e6('0x9'),'no'),'defaultValue':_0xc6e6('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xc6e6('0x2')]},'callback':{'type':Sequelize[_0xc6e6('0x2')]},'review':{'type':Sequelize[_0xc6e6('0x8')](_0xc6e6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xc6e6('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xc6e6('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xc6e6('0x8')](_0xc6e6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xc6e6('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xc6e6('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xc6e6('0x8')](_0xc6e6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xc6e6('0x8')](_0xc6e6('0x9'),'no'),'defaultValue':_0xc6e6('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xc6e6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xc6e6('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xc6e6('0x8')](_0xc6e6('0x9'),'no'),'defaultValue':_0xc6e6('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xc6e6('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xc6e6('0xc')],'get':function(){return this[_0xc6e6('0xd')](_0xc6e6('0xe'))+_0xc6e6('0xf')+this[_0xc6e6('0xd')](_0xc6e6('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 57c4cbb..8be5f64 100644 --- a/server/api/voiceMail/voiceMail.controller.js +++ b/server/api/voiceMail/voiceMail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcadb=['error','stack','send','VoiceMail','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','count','includeAll','findAll','rows','show','length','include','options','catch','create','body','user','role','UserProfileSection','find','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xcadb,0x184));var _0xbcad=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xcadb[_0x278e3c];return _0x3e2d9b;};'use strict';var pdf=require(_0xbcad('0x0'));var emlformat=require(_0xbcad('0x1'));var rimraf=require(_0xbcad('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbcad('0x3'));var rp=require(_0xbcad('0x4'));var moment=require(_0xbcad('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbcad('0x6'));var path=require(_0xbcad('0x7'));var sox=require(_0xbcad('0x8'));var csv=require('to-csv');var ejs=require(_0xbcad('0x9'));var fs=require('fs');var _=require(_0xbcad('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbcad('0xb'));var toCsv=require(_0xbcad('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbcad('0xd'));var authService=require(_0xbcad('0xe'));var qs=require(_0xbcad('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbcad('0x10'))(_0xbcad('0x11'));var utils=require(_0xbcad('0x12'));var config=require(_0xbcad('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x248b67,_0x8cbd7d){_0x8cbd7d=_0x8cbd7d||0xcc;return function(_0x25371d){if(_0x25371d){return _0x248b67[_0xbcad('0x14')](_0x8cbd7d);}return _0x248b67[_0xbcad('0x15')](_0x8cbd7d)[_0xbcad('0x16')]();};}function respondWithResult(_0x95559c,_0x1d6634){_0x1d6634=_0x1d6634||0xc8;return function(_0x29fd56){if(_0x29fd56){return _0x95559c[_0xbcad('0x15')](_0x1d6634)[_0xbcad('0x17')](_0x29fd56);}};}function respondWithFilteredResult(_0x3fb872,_0x9e81d5){return function(_0x21b76c){if(_0x21b76c){var _0x3c8dc3=_0x21b76c['count'],_0x333e4a=_0x9e81d5[_0xbcad('0x18')],_0x1099ea=_0x9e81d5['offset']+_0x9e81d5[_0xbcad('0x19')],_0x1e46ef;if(_0x1099ea>=_0x3c8dc3){_0x1099ea=_0x3c8dc3;_0x1e46ef=0xc8;}else{_0x1e46ef=0xce;}_0x3fb872['status'](_0x1e46ef);return _0x3fb872[_0xbcad('0x1a')](_0xbcad('0x1b'),_0x333e4a+'-'+_0x1099ea+'/'+_0x3c8dc3)[_0xbcad('0x17')](_0x21b76c);}return null;};}function patchUpdates(_0x2271bb){return function(_0x4bbc99){try{jsonpatch[_0xbcad('0x1c')](_0x4bbc99,_0x2271bb,!![]);}catch(_0x653bc2){return BPromise[_0xbcad('0x1d')](_0x653bc2);}return _0x4bbc99[_0xbcad('0x1e')]();};}function saveUpdates(_0x25f1f5,_0x4ca340){return function(_0x5237d3){if(_0x5237d3){return _0x5237d3[_0xbcad('0x1f')](_0x25f1f5)[_0xbcad('0x20')](function(_0x55c01e){return _0x55c01e;});}return null;};}function removeEntity(_0x10ffce,_0x18f95a){return function(_0x1654c3){if(_0x1654c3){return _0x1654c3[_0xbcad('0x21')]()[_0xbcad('0x20')](function(){var _0x608133=_0x1654c3[_0xbcad('0x22')]({'plain':!![]});var _0x3da51a=_0xbcad('0x23');return db[_0xbcad('0x24')][_0xbcad('0x21')]({'where':{'type':_0x3da51a,'resourceId':_0x608133['id']}})[_0xbcad('0x20')](function(){return _0x1654c3;});})['then'](function(){_0x10ffce['status'](0xcc)[_0xbcad('0x16')]();});}};}function handleEntityNotFound(_0x32b05c,_0x13dcd5){return function(_0x4c1495){if(!_0x4c1495){_0x32b05c[_0xbcad('0x14')](0x194);}return _0x4c1495;};}function handleError(_0xf6fede,_0x4872a6){_0x4872a6=_0x4872a6||0x1f4;return function(_0x177c3c){logger[_0xbcad('0x25')](_0x177c3c[_0xbcad('0x26')]);if(_0x177c3c['name']){delete _0x177c3c['name'];}_0xf6fede[_0xbcad('0x15')](_0x4872a6)[_0xbcad('0x27')](_0x177c3c);};}exports['index']=function(_0x5c1d64,_0x13f6a7){var _0x393bab={},_0x237366={},_0x129cc3={'count':0x0,'rows':[]};var _0x276b57=db[_0xbcad('0x28')][_0xbcad('0x29')];_0x237366[_0xbcad('0x2a')]=_[_0xbcad('0x2b')](_0x276b57);_0x237366[_0xbcad('0x2c')]=_[_0xbcad('0x2b')](_0x5c1d64[_0xbcad('0x2c')]);_0x237366[_0xbcad('0x2d')]=_[_0xbcad('0x2e')](_0x237366[_0xbcad('0x2a')],_0x237366['query']);_0x393bab[_0xbcad('0x2f')]=_['intersection'](_0x237366[_0xbcad('0x2a')],qs[_0xbcad('0x30')](_0x5c1d64[_0xbcad('0x2c')][_0xbcad('0x30')]));_0x393bab[_0xbcad('0x2f')]=_0x393bab['attributes']['length']?_0x393bab['attributes']:_0x237366[_0xbcad('0x2a')];if(!_0x5c1d64[_0xbcad('0x2c')][_0xbcad('0x31')](_0xbcad('0x32'))){_0x393bab[_0xbcad('0x19')]=qs[_0xbcad('0x19')](_0x5c1d64['query']['limit']);_0x393bab[_0xbcad('0x18')]=qs[_0xbcad('0x18')](_0x5c1d64[_0xbcad('0x2c')]['offset']);}_0x393bab[_0xbcad('0x33')]=qs[_0xbcad('0x34')](_0x5c1d64[_0xbcad('0x2c')][_0xbcad('0x34')]);_0x393bab[_0xbcad('0x35')]=qs['filters'](_[_0xbcad('0x36')](_0x5c1d64[_0xbcad('0x2c')],_0x237366[_0xbcad('0x2d')]));if(_0x5c1d64[_0xbcad('0x2c')][_0xbcad('0x37')]){_0x393bab[_0xbcad('0x35')]=_['merge'](_0x393bab[_0xbcad('0x35')],{'$or':_[_0xbcad('0x38')](_0x276b57,function(_0x50168b){if(_0x50168b['type'][_0xbcad('0x39')]!==_0xbcad('0x3a')){var _0x1f0070={};_0x1f0070[_0x50168b[_0xbcad('0x3b')]]={'$like':'%'+_0x5c1d64[_0xbcad('0x2c')][_0xbcad('0x37')]+'%'};return _0x1f0070;}})});}_0x393bab=_[_0xbcad('0x3c')]({},_0x393bab,_0x5c1d64['options']);var _0x507177={'where':_0x393bab[_0xbcad('0x35')]};return db[_0xbcad('0x28')][_0xbcad('0x3d')](_0x507177)[_0xbcad('0x20')](function(_0x1a53f8){_0x129cc3['count']=_0x1a53f8;if(_0x5c1d64[_0xbcad('0x2c')][_0xbcad('0x3e')]){_0x393bab['include']=[{'all':!![]}];}return db['VoiceMail'][_0xbcad('0x3f')](_0x393bab);})['then'](function(_0x2555bd){_0x129cc3[_0xbcad('0x40')]=_0x2555bd;return _0x129cc3;})['then'](respondWithFilteredResult(_0x13f6a7,_0x393bab))['catch'](handleError(_0x13f6a7,null));};exports[_0xbcad('0x41')]=function(_0x5d03be,_0x522aaf){var _0x5605b3={'raw':!![],'where':{'id':_0x5d03be['params']['id']}},_0x2baf6e={};_0x2baf6e[_0xbcad('0x2a')]=_[_0xbcad('0x2b')](db[_0xbcad('0x28')][_0xbcad('0x29')]);_0x2baf6e[_0xbcad('0x2c')]=_[_0xbcad('0x2b')](_0x5d03be[_0xbcad('0x2c')]);_0x2baf6e[_0xbcad('0x2d')]=_[_0xbcad('0x2e')](_0x2baf6e[_0xbcad('0x2a')],_0x2baf6e[_0xbcad('0x2c')]);_0x5605b3['attributes']=_[_0xbcad('0x2e')](_0x2baf6e[_0xbcad('0x2a')],qs[_0xbcad('0x30')](_0x5d03be[_0xbcad('0x2c')]['fields']));_0x5605b3[_0xbcad('0x2f')]=_0x5605b3[_0xbcad('0x2f')][_0xbcad('0x42')]?_0x5605b3['attributes']:_0x2baf6e[_0xbcad('0x2a')];if(_0x5d03be[_0xbcad('0x2c')][_0xbcad('0x3e')]){_0x5605b3[_0xbcad('0x43')]=[{'all':!![]}];}_0x5605b3=_[_0xbcad('0x3c')]({},_0x5605b3,_0x5d03be[_0xbcad('0x44')]);return db[_0xbcad('0x28')]['find'](_0x5605b3)[_0xbcad('0x20')](handleEntityNotFound(_0x522aaf,null))[_0xbcad('0x20')](respondWithResult(_0x522aaf,null))[_0xbcad('0x45')](handleError(_0x522aaf,null));};exports[_0xbcad('0x46')]=function(_0x4d3ec1,_0x12fbe4){return db[_0xbcad('0x28')]['create'](_0x4d3ec1[_0xbcad('0x47')],{})[_0xbcad('0x20')](function(_0x1894b2){var _0x3c5f6c=_0x4d3ec1[_0xbcad('0x48')][_0xbcad('0x22')]({'plain':!![]});if(!_0x3c5f6c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c5f6c[_0xbcad('0x49')]===_0xbcad('0x48')){var _0x277d03=_0x1894b2[_0xbcad('0x22')]({'plain':!![]});var _0x27ff0f=_0xbcad('0x23');return db[_0xbcad('0x4a')][_0xbcad('0x4b')]({'where':{'name':_0x27ff0f,'userProfileId':_0x3c5f6c[_0xbcad('0x4c')]},'raw':!![]})[_0xbcad('0x20')](function(_0x1913f6){if(_0x1913f6&&_0x1913f6['autoAssociation']===0x0){return db[_0xbcad('0x24')][_0xbcad('0x46')]({'name':_0x277d03[_0xbcad('0x4d')],'resourceId':_0x277d03['id'],'type':_0x1913f6['name'],'sectionId':_0x1913f6['id']},{})['then'](function(){return _0x1894b2;});}else{return _0x1894b2;}})[_0xbcad('0x45')](function(_0x24c45a){logger[_0xbcad('0x25')](_0xbcad('0x4e'),_0x24c45a);throw _0x24c45a;});}return _0x1894b2;})[_0xbcad('0x20')](respondWithResult(_0x12fbe4,0xc9))[_0xbcad('0x45')](handleError(_0x12fbe4,null));};exports[_0xbcad('0x1f')]=function(_0x1ec740,_0x15c2ca){if(_0x1ec740[_0xbcad('0x47')]['id']){delete _0x1ec740[_0xbcad('0x47')]['id'];}return db[_0xbcad('0x28')][_0xbcad('0x4b')]({'where':{'id':_0x1ec740[_0xbcad('0x4f')]['id']}})[_0xbcad('0x20')](handleEntityNotFound(_0x15c2ca,null))[_0xbcad('0x20')](saveUpdates(_0x1ec740['body'],null))[_0xbcad('0x20')](respondWithResult(_0x15c2ca,null))['catch'](handleError(_0x15c2ca,null));};exports['destroy']=function(_0x203331,_0x53fecb){return db[_0xbcad('0x28')][_0xbcad('0x4b')]({'where':{'id':_0x203331[_0xbcad('0x4f')]['id']}})['then'](handleEntityNotFound(_0x53fecb,null))['then'](removeEntity(_0x53fecb,null))[_0xbcad('0x45')](handleError(_0x53fecb,null));};exports[_0xbcad('0x50')]=function(_0x37b0d8,_0x552040,_0x531d6f){return db[_0xbcad('0x28')][_0xbcad('0x51')]({'where':{'id':_0x37b0d8[_0xbcad('0x4f')]['id']}})[_0xbcad('0x20')](handleEntityNotFound(_0x552040,null))[_0xbcad('0x20')](function(_0xd3a616){var _0x3505db;var _0x1c42d7={},_0x1e4183={};_0x1e4183[_0xbcad('0x2a')]=_['keys'](db[_0xbcad('0x52')]['rawAttributes']);_0x1e4183[_0xbcad('0x2c')]=_[_0xbcad('0x2b')](_0x37b0d8['query']);_0x1e4183['filters']=_[_0xbcad('0x2e')](_0x1e4183['model'],_0x1e4183[_0xbcad('0x2c')]);_0x1c42d7['attributes']=_[_0xbcad('0x2e')](_0x1e4183[_0xbcad('0x2a')],qs[_0xbcad('0x30')](_0x37b0d8['query'][_0xbcad('0x30')]));_0x1c42d7[_0xbcad('0x2f')]=_0x1c42d7[_0xbcad('0x2f')]['length']?_0x1c42d7[_0xbcad('0x2f')]:_0x1e4183[_0xbcad('0x2a')];if(!_0x37b0d8[_0xbcad('0x2c')][_0xbcad('0x31')](_0xbcad('0x32'))){_0x1c42d7[_0xbcad('0x19')]=qs[_0xbcad('0x19')](_0x37b0d8[_0xbcad('0x2c')][_0xbcad('0x19')]);_0x1c42d7[_0xbcad('0x18')]=qs[_0xbcad('0x18')](_0x37b0d8[_0xbcad('0x2c')]['offset']);}_0x1c42d7[_0xbcad('0x33')]=qs[_0xbcad('0x34')](_0x37b0d8['query'][_0xbcad('0x34')]);_0x1c42d7['where']=qs[_0xbcad('0x2d')](_[_0xbcad('0x36')](_0x37b0d8[_0xbcad('0x2c')],_0x1e4183[_0xbcad('0x2d')]));if(_0x37b0d8['query']['filter']){_0x1c42d7['where']=_[_0xbcad('0x3c')](_0x1c42d7['where'],{'$or':_[_0xbcad('0x38')](_0x1c42d7[_0xbcad('0x2f')],function(_0x2a0d33){var _0x11a7c4={};_0x11a7c4[_0x2a0d33]={'$like':'%'+_0x37b0d8['query'][_0xbcad('0x37')]+'%'};return _0x11a7c4;})});}_0x1c42d7[_0xbcad('0x35')]=_[_0xbcad('0x3c')](_0x1c42d7['where'],{'mailboxuser':_0xd3a616[_0xbcad('0x53')]});_0x1c42d7=_[_0xbcad('0x3c')]({},_0x1c42d7,_0x37b0d8['options']);return db['VoiceMailMessage'][_0xbcad('0x54')](_0x1c42d7)[_0xbcad('0x20')](respondWithFilteredResult(_0x552040,_0x1c42d7));})['catch'](handleError(_0x552040,null));}; \ No newline at end of file +var _0x9900=['user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','VoiceMail','includeAll','rows','params','include','find','catch','create','body'];(function(_0x31b588,_0x30b636){var _0xf4faae=function(_0x535ad7){while(--_0x535ad7){_0x31b588['push'](_0x31b588['shift']());}};_0xf4faae(++_0x30b636);}(_0x9900,0x157));var _0x0990=function(_0x252751,_0x543b81){_0x252751=_0x252751-0x0;var _0x56e1b1=_0x9900[_0x252751];return _0x56e1b1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0990('0x0'));var rimraf=require(_0x0990('0x1'));var zipdir=require(_0x0990('0x2'));var jsonpatch=require(_0x0990('0x3'));var rp=require(_0x0990('0x4'));var moment=require(_0x0990('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0990('0x6'));var util=require(_0x0990('0x7'));var path=require('path');var sox=require(_0x0990('0x8'));var csv=require(_0x0990('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0990('0xa'));var squel=require(_0x0990('0xb'));var crypto=require(_0x0990('0xc'));var jsforce=require(_0x0990('0xd'));var deskjs=require(_0x0990('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0990('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0990('0x10'));var hardwareService=require(_0x0990('0x11'));var logger=require(_0x0990('0x12'))(_0x0990('0x13'));var utils=require(_0x0990('0x14'));var config=require('../../config/environment');var db=require(_0x0990('0x15'))['db'];function respondWithStatusCode(_0x4ef534,_0x15ffdf){_0x15ffdf=_0x15ffdf||0xcc;return function(_0x516279){if(_0x516279){return _0x4ef534[_0x0990('0x16')](_0x15ffdf);}return _0x4ef534[_0x0990('0x17')](_0x15ffdf)[_0x0990('0x18')]();};}function respondWithResult(_0x1e286c,_0x385e26){_0x385e26=_0x385e26||0xc8;return function(_0x20bb34){if(_0x20bb34){return _0x1e286c[_0x0990('0x17')](_0x385e26)[_0x0990('0x19')](_0x20bb34);}};}function respondWithFilteredResult(_0x51b404,_0x262a79){return function(_0x3303a0){if(_0x3303a0){var _0x3f3c8b=_0x3303a0[_0x0990('0x1a')],_0x1bf8f8=_0x262a79[_0x0990('0x1b')],_0x22797f=_0x262a79['offset']+_0x262a79[_0x0990('0x1c')],_0x5d3db1;if(_0x22797f>=_0x3f3c8b){_0x22797f=_0x3f3c8b;_0x5d3db1=0xc8;}else{_0x5d3db1=0xce;}_0x51b404['status'](_0x5d3db1);return _0x51b404[_0x0990('0x1d')]('Content-Range',_0x1bf8f8+'-'+_0x22797f+'/'+_0x3f3c8b)[_0x0990('0x19')](_0x3303a0);}return null;};}function patchUpdates(_0x2a2406){return function(_0xc02f5){try{jsonpatch[_0x0990('0x1e')](_0xc02f5,_0x2a2406,!![]);}catch(_0x558b9a){return BPromise[_0x0990('0x1f')](_0x558b9a);}return _0xc02f5['save']();};}function saveUpdates(_0x4c5b97,_0x4e20e4){return function(_0x2418d0){if(_0x2418d0){return _0x2418d0[_0x0990('0x20')](_0x4c5b97)[_0x0990('0x21')](function(_0x1bc586){return _0x1bc586;});}return null;};}function removeEntity(_0x257502,_0x10f663){return function(_0x578847){if(_0x578847){return _0x578847[_0x0990('0x22')]()[_0x0990('0x21')](function(){var _0x14c9ee=_0x578847[_0x0990('0x23')]({'plain':!![]});var _0xd4d9db='Voicemails';return db[_0x0990('0x24')][_0x0990('0x22')]({'where':{'type':_0xd4d9db,'resourceId':_0x14c9ee['id']}})['then'](function(){return _0x578847;});})['then'](function(){_0x257502[_0x0990('0x17')](0xcc)[_0x0990('0x18')]();});}};}function handleEntityNotFound(_0xc982f1,_0x25df01){return function(_0xf47307){if(!_0xf47307){_0xc982f1[_0x0990('0x16')](0x194);}return _0xf47307;};}function handleError(_0x5a4215,_0x88fc4c){_0x88fc4c=_0x88fc4c||0x1f4;return function(_0x298875){logger[_0x0990('0x25')](_0x298875[_0x0990('0x26')]);if(_0x298875[_0x0990('0x27')]){delete _0x298875['name'];}_0x5a4215[_0x0990('0x17')](_0x88fc4c)[_0x0990('0x28')](_0x298875);};}exports[_0x0990('0x29')]=function(_0x398084,_0x26c1aa){var _0x3a8c3c={},_0x375401={},_0x2b9801={'count':0x0,'rows':[]};var _0x3db269=db['VoiceMail'][_0x0990('0x2a')];_0x375401[_0x0990('0x2b')]=_['keys'](_0x3db269);_0x375401[_0x0990('0x2c')]=_[_0x0990('0x2d')](_0x398084['query']);_0x375401[_0x0990('0x2e')]=_[_0x0990('0x2f')](_0x375401[_0x0990('0x2b')],_0x375401[_0x0990('0x2c')]);_0x3a8c3c[_0x0990('0x30')]=_[_0x0990('0x2f')](_0x375401[_0x0990('0x2b')],qs[_0x0990('0x31')](_0x398084[_0x0990('0x2c')][_0x0990('0x31')]));_0x3a8c3c['attributes']=_0x3a8c3c[_0x0990('0x30')][_0x0990('0x32')]?_0x3a8c3c[_0x0990('0x30')]:_0x375401[_0x0990('0x2b')];if(!_0x398084[_0x0990('0x2c')][_0x0990('0x33')](_0x0990('0x34'))){_0x3a8c3c[_0x0990('0x1c')]=qs[_0x0990('0x1c')](_0x398084[_0x0990('0x2c')][_0x0990('0x1c')]);_0x3a8c3c[_0x0990('0x1b')]=qs[_0x0990('0x1b')](_0x398084[_0x0990('0x2c')][_0x0990('0x1b')]);}_0x3a8c3c['order']=qs[_0x0990('0x35')](_0x398084[_0x0990('0x2c')][_0x0990('0x35')]);_0x3a8c3c[_0x0990('0x36')]=qs[_0x0990('0x2e')](_['pick'](_0x398084[_0x0990('0x2c')],_0x375401[_0x0990('0x2e')]));if(_0x398084[_0x0990('0x2c')][_0x0990('0x37')]){_0x3a8c3c[_0x0990('0x36')]=_['merge'](_0x3a8c3c[_0x0990('0x36')],{'$or':_[_0x0990('0x38')](_0x3db269,function(_0x1cfc5e){if(_0x1cfc5e[_0x0990('0x39')][_0x0990('0x3a')]!==_0x0990('0x3b')){var _0x52bcf1={};_0x52bcf1[_0x1cfc5e[_0x0990('0x3c')]]={'$like':'%'+_0x398084[_0x0990('0x2c')][_0x0990('0x37')]+'%'};return _0x52bcf1;}})});}_0x3a8c3c=_[_0x0990('0x3d')]({},_0x3a8c3c,_0x398084[_0x0990('0x3e')]);var _0x547cd8={'where':_0x3a8c3c[_0x0990('0x36')]};return db[_0x0990('0x3f')][_0x0990('0x1a')](_0x547cd8)[_0x0990('0x21')](function(_0x1707c9){_0x2b9801[_0x0990('0x1a')]=_0x1707c9;if(_0x398084[_0x0990('0x2c')][_0x0990('0x40')]){_0x3a8c3c['include']=[{'all':!![]}];}return db[_0x0990('0x3f')]['findAll'](_0x3a8c3c);})[_0x0990('0x21')](function(_0x28fa24){_0x2b9801[_0x0990('0x41')]=_0x28fa24;return _0x2b9801;})[_0x0990('0x21')](respondWithFilteredResult(_0x26c1aa,_0x3a8c3c))['catch'](handleError(_0x26c1aa,null));};exports['show']=function(_0x3a14e6,_0x3320ab){var _0x4fa7d8={'raw':!![],'where':{'id':_0x3a14e6[_0x0990('0x42')]['id']}},_0x107c07={};_0x107c07['model']=_[_0x0990('0x2d')](db[_0x0990('0x3f')][_0x0990('0x2a')]);_0x107c07[_0x0990('0x2c')]=_[_0x0990('0x2d')](_0x3a14e6['query']);_0x107c07[_0x0990('0x2e')]=_['intersection'](_0x107c07[_0x0990('0x2b')],_0x107c07[_0x0990('0x2c')]);_0x4fa7d8[_0x0990('0x30')]=_[_0x0990('0x2f')](_0x107c07[_0x0990('0x2b')],qs[_0x0990('0x31')](_0x3a14e6[_0x0990('0x2c')][_0x0990('0x31')]));_0x4fa7d8[_0x0990('0x30')]=_0x4fa7d8['attributes'][_0x0990('0x32')]?_0x4fa7d8['attributes']:_0x107c07[_0x0990('0x2b')];if(_0x3a14e6['query'][_0x0990('0x40')]){_0x4fa7d8[_0x0990('0x43')]=[{'all':!![]}];}_0x4fa7d8=_[_0x0990('0x3d')]({},_0x4fa7d8,_0x3a14e6[_0x0990('0x3e')]);return db['VoiceMail'][_0x0990('0x44')](_0x4fa7d8)[_0x0990('0x21')](handleEntityNotFound(_0x3320ab,null))[_0x0990('0x21')](respondWithResult(_0x3320ab,null))[_0x0990('0x45')](handleError(_0x3320ab,null));};exports[_0x0990('0x46')]=function(_0xc51c79,_0x4c94da){return db[_0x0990('0x3f')][_0x0990('0x46')](_0xc51c79[_0x0990('0x47')],{})[_0x0990('0x21')](function(_0xf73be9){var _0x1825a9=_0xc51c79[_0x0990('0x48')][_0x0990('0x23')]({'plain':!![]});if(!_0x1825a9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1825a9[_0x0990('0x49')]===_0x0990('0x48')){var _0x39d14b=_0xf73be9[_0x0990('0x23')]({'plain':!![]});var _0x411820=_0x0990('0x4a');return db[_0x0990('0x4b')][_0x0990('0x44')]({'where':{'name':_0x411820,'userProfileId':_0x1825a9[_0x0990('0x4c')]},'raw':!![]})[_0x0990('0x21')](function(_0x18af6e){if(_0x18af6e&&_0x18af6e[_0x0990('0x4d')]===0x0){return db[_0x0990('0x24')][_0x0990('0x46')]({'name':_0x39d14b[_0x0990('0x27')],'resourceId':_0x39d14b['id'],'type':_0x18af6e[_0x0990('0x27')],'sectionId':_0x18af6e['id']},{})[_0x0990('0x21')](function(){return _0xf73be9;});}else{return _0xf73be9;}})[_0x0990('0x45')](function(_0x299471){logger['error'](_0x0990('0x4e'),_0x299471);throw _0x299471;});}return _0xf73be9;})[_0x0990('0x21')](respondWithResult(_0x4c94da,0xc9))['catch'](handleError(_0x4c94da,null));};exports['update']=function(_0x57d9f0,_0x331d67){if(_0x57d9f0[_0x0990('0x47')]['id']){delete _0x57d9f0[_0x0990('0x47')]['id'];}return db[_0x0990('0x3f')][_0x0990('0x44')]({'where':{'id':_0x57d9f0[_0x0990('0x42')]['id']}})[_0x0990('0x21')](handleEntityNotFound(_0x331d67,null))['then'](saveUpdates(_0x57d9f0['body'],null))['then'](respondWithResult(_0x331d67,null))['catch'](handleError(_0x331d67,null));};exports['destroy']=function(_0x403474,_0x344b11){return db[_0x0990('0x3f')][_0x0990('0x44')]({'where':{'id':_0x403474[_0x0990('0x42')]['id']}})[_0x0990('0x21')](handleEntityNotFound(_0x344b11,null))[_0x0990('0x21')](removeEntity(_0x344b11,null))[_0x0990('0x45')](handleError(_0x344b11,null));};exports['getMessages']=function(_0x3879b2,_0x370e64,_0x172fb9){return db[_0x0990('0x3f')][_0x0990('0x4f')]({'where':{'id':_0x3879b2[_0x0990('0x42')]['id']}})[_0x0990('0x21')](handleEntityNotFound(_0x370e64,null))['then'](function(_0x832f15){var _0x386335;var _0x52fc58={},_0x3eedd9={};_0x3eedd9[_0x0990('0x2b')]=_[_0x0990('0x2d')](db[_0x0990('0x50')]['rawAttributes']);_0x3eedd9[_0x0990('0x2c')]=_[_0x0990('0x2d')](_0x3879b2['query']);_0x3eedd9[_0x0990('0x2e')]=_[_0x0990('0x2f')](_0x3eedd9[_0x0990('0x2b')],_0x3eedd9[_0x0990('0x2c')]);_0x52fc58[_0x0990('0x30')]=_[_0x0990('0x2f')](_0x3eedd9[_0x0990('0x2b')],qs[_0x0990('0x31')](_0x3879b2[_0x0990('0x2c')][_0x0990('0x31')]));_0x52fc58[_0x0990('0x30')]=_0x52fc58['attributes'][_0x0990('0x32')]?_0x52fc58[_0x0990('0x30')]:_0x3eedd9[_0x0990('0x2b')];if(!_0x3879b2[_0x0990('0x2c')][_0x0990('0x33')]('nolimit')){_0x52fc58[_0x0990('0x1c')]=qs[_0x0990('0x1c')](_0x3879b2['query']['limit']);_0x52fc58[_0x0990('0x1b')]=qs[_0x0990('0x1b')](_0x3879b2[_0x0990('0x2c')][_0x0990('0x1b')]);}_0x52fc58['order']=qs[_0x0990('0x35')](_0x3879b2[_0x0990('0x2c')][_0x0990('0x35')]);_0x52fc58[_0x0990('0x36')]=qs[_0x0990('0x2e')](_['pick'](_0x3879b2[_0x0990('0x2c')],_0x3eedd9[_0x0990('0x2e')]));if(_0x3879b2['query']['filter']){_0x52fc58[_0x0990('0x36')]=_[_0x0990('0x3d')](_0x52fc58[_0x0990('0x36')],{'$or':_[_0x0990('0x38')](_0x52fc58[_0x0990('0x30')],function(_0x41d819){var _0x1c598b={};_0x1c598b[_0x41d819]={'$like':'%'+_0x3879b2[_0x0990('0x2c')][_0x0990('0x37')]+'%'};return _0x1c598b;})});}_0x52fc58[_0x0990('0x36')]=_[_0x0990('0x3d')](_0x52fc58[_0x0990('0x36')],{'mailboxuser':_0x832f15[_0x0990('0x51')]});_0x52fc58=_[_0x0990('0x3d')]({},_0x52fc58,_0x3879b2[_0x0990('0x3e')]);return db[_0x0990('0x50')][_0x0990('0x52')](_0x52fc58)[_0x0990('0x21')](respondWithFilteredResult(_0x370e64,_0x52fc58));})[_0x0990('0x45')](handleError(_0x370e64,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index bebfd2f..e72ce7b 100644 --- a/server/api/voiceMail/voiceMail.model.js +++ b/server/api/voiceMail/voiceMail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf619=['context','util','api','moment','bluebird','request-promise','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','mailbox'];(function(_0x512891,_0x46005a){var _0x1c190c=function(_0x42b95b){while(--_0x42b95b){_0x512891['push'](_0x512891['shift']());}};_0x1c190c(++_0x46005a);}(_0xf619,0x17a));var _0x9f61=function(_0x3aa5df,_0x424ec2){_0x3aa5df=_0x3aa5df-0x0;var _0x4f7bd5=_0xf619[_0x3aa5df];return _0x4f7bd5;};'use strict';var _=require('lodash');var util=require(_0x9f61('0x0'));var logger=require('../../config/logger')(_0x9f61('0x1'));var moment=require(_0x9f61('0x2'));var BPromise=require(_0x9f61('0x3'));var rp=require(_0x9f61('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9f61('0x5'));var attributes=require(_0x9f61('0x6'));module[_0x9f61('0x7')]=function(_0x2f0882,_0x5c2ec0){return _0x2f0882[_0x9f61('0x8')](_0x9f61('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x9f61('0xa'),'fields':[_0x9f61('0xb'),_0x9f61('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1967=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','context','util','../../config/logger','api','moment'];(function(_0x3e0a0d,_0x4bcc82){var _0x39ee02=function(_0x2641e4){while(--_0x2641e4){_0x3e0a0d['push'](_0x3e0a0d['shift']());}};_0x39ee02(++_0x4bcc82);}(_0x1967,0x173));var _0x7196=function(_0x3484b5,_0x167934){_0x3484b5=_0x3484b5-0x0;var _0x589a8d=_0x1967[_0x3484b5];return _0x589a8d;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'paranoid':![],'indexes':[{'name':_0x7196('0xd'),'fields':['mailbox',_0x7196('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 465034b..69004f9 100644 --- a/server/api/voiceMail/voiceMail.rpc.js +++ b/server/api/voiceMail/voiceMail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fed=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x213a5e,_0x40d7a9){var _0x35046e=function(_0x1cdb82){while(--_0x1cdb82){_0x213a5e['push'](_0x213a5e['shift']());}};_0x35046e(++_0x40d7a9);}(_0x5fed,0xac));var _0xd5fe=function(_0x3c3698,_0xa0bf08){_0x3c3698=_0x3c3698-0x0;var _0x4e6637=_0x5fed[_0x3c3698];return _0x4e6637;};'use strict';var _=require(_0xd5fe('0x0'));var util=require(_0xd5fe('0x1'));var moment=require(_0xd5fe('0x2'));var BPromise=require(_0xd5fe('0x3'));var rs=require(_0xd5fe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5fe('0x5'))['db'];var utils=require(_0xd5fe('0x6'));var logger=require(_0xd5fe('0x7'))('rpc');var config=require(_0xd5fe('0x8'));var jayson=require(_0xd5fe('0x9'));var client=jayson[_0xd5fe('0xa')][_0xd5fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20e2d7,_0x46d4fc,_0x4b4f10){return new BPromise(function(_0x5aef26,_0x35c01b){return client[_0xd5fe('0xc')](_0x20e2d7,_0x4b4f10)[_0xd5fe('0xd')](function(_0x2e9d57){logger[_0xd5fe('0xe')](_0xd5fe('0xf'),_0x46d4fc,_0xd5fe('0x10'));logger[_0xd5fe('0x11')](_0xd5fe('0x12'),_0x46d4fc,_0xd5fe('0x10'),JSON[_0xd5fe('0x13')](_0x2e9d57));if(_0x2e9d57['error']){if(_0x2e9d57[_0xd5fe('0x14')][_0xd5fe('0x15')]===0x1f4){logger['error'](_0xd5fe('0xf'),_0x46d4fc,_0x2e9d57['error'][_0xd5fe('0x16')]);return _0x35c01b(_0x2e9d57[_0xd5fe('0x14')][_0xd5fe('0x16')]);}logger[_0xd5fe('0x14')](_0xd5fe('0xf'),_0x46d4fc,_0x2e9d57['error'][_0xd5fe('0x16')]);return _0x5aef26(_0x2e9d57[_0xd5fe('0x14')][_0xd5fe('0x16')]);}else{logger[_0xd5fe('0xe')]('VoiceMail,\x20%s,\x20%s',_0x46d4fc,_0xd5fe('0x10'));_0x5aef26(_0x2e9d57[_0xd5fe('0x17')][_0xd5fe('0x16')]);}})[_0xd5fe('0x18')](function(_0x7bab6b){logger[_0xd5fe('0x14')](_0xd5fe('0xf'),_0x46d4fc,_0x7bab6b);_0x35c01b(_0x7bab6b);});});} \ No newline at end of file +var _0x1606=['rpc','jayson/promise','client','http','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26188d,_0x360c8a){var _0x30b992=function(_0x47d00a){while(--_0x47d00a){_0x26188d['push'](_0x26188d['shift']());}};_0x30b992(++_0x360c8a);}(_0x1606,0xbf));var _0x6160=function(_0x48c89d,_0x63c32a){_0x48c89d=_0x48c89d-0x0;var _0x2b1ac5=_0x1606[_0x48c89d];return _0x2b1ac5;};'use strict';var _=require(_0x6160('0x0'));var util=require(_0x6160('0x1'));var moment=require(_0x6160('0x2'));var BPromise=require(_0x6160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6160('0x4'))['db'];var utils=require(_0x6160('0x5'));var logger=require(_0x6160('0x6'))(_0x6160('0x7'));var config=require('../../config/environment');var jayson=require(_0x6160('0x8'));var client=jayson[_0x6160('0x9')][_0x6160('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eafdf,_0x4e15e7,_0x452466){return new BPromise(function(_0x34f156,_0x30bd39){return client['request'](_0x1eafdf,_0x452466)['then'](function(_0x2dec81){logger[_0x6160('0xb')](_0x6160('0xc'),_0x4e15e7,_0x6160('0xd'));logger[_0x6160('0xe')](_0x6160('0xf'),_0x4e15e7,_0x6160('0xd'),JSON[_0x6160('0x10')](_0x2dec81));if(_0x2dec81[_0x6160('0x11')]){if(_0x2dec81[_0x6160('0x11')][_0x6160('0x12')]===0x1f4){logger[_0x6160('0x11')](_0x6160('0xc'),_0x4e15e7,_0x2dec81[_0x6160('0x11')]['message']);return _0x30bd39(_0x2dec81['error'][_0x6160('0x13')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x4e15e7,_0x2dec81[_0x6160('0x11')][_0x6160('0x13')]);return _0x34f156(_0x2dec81[_0x6160('0x11')][_0x6160('0x13')]);}else{logger[_0x6160('0xb')](_0x6160('0xc'),_0x4e15e7,_0x6160('0xd'));_0x34f156(_0x2dec81[_0x6160('0x14')][_0x6160('0x13')]);}})[_0x6160('0x15')](function(_0x4e18a6){logger[_0x6160('0x11')]('VoiceMail,\x20%s,\x20%s',_0x4e15e7,_0x4e18a6);_0x30bd39(_0x4e18a6);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 5a5e3d0..9d11a43 100644 --- a/server/api/voiceMailMessage/index.js +++ b/server/api/voiceMailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7da7=['get','/:id/download','download','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','/:id','show'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7da7,0x10d));var _0x77da=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x7da7[_0x8b8564];return _0x360c61;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var auth=require(_0x77da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x77da('0x5'));var controller=require(_0x77da('0x6'));router['get']('/',auth[_0x77da('0x7')](),controller[_0x77da('0x8')]);router['get'](_0x77da('0x9'),auth['isAuthenticated'](),controller[_0x77da('0xa')]);router[_0x77da('0xb')](_0x77da('0xc'),auth[_0x77da('0x7')](),controller[_0x77da('0xd')]);router['post']('/',auth[_0x77da('0x7')](),controller[_0x77da('0xe')]);router[_0x77da('0xf')]('/:id',auth[_0x77da('0x7')](),controller[_0x77da('0x10')]);router[_0x77da('0x11')](_0x77da('0x9'),auth['isAuthenticated'](),controller[_0x77da('0x12')]);module[_0x77da('0x13')]=router; \ No newline at end of file +var _0x53ec=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','/:id/download','download','post','create','put','delete'];(function(_0x3e609e,_0x17a29a){var _0x70bb1f=function(_0x35e316){while(--_0x35e316){_0x3e609e['push'](_0x3e609e['shift']());}};_0x70bb1f(++_0x17a29a);}(_0x53ec,0x192));var _0xc53e=function(_0x190e94,_0x117fc1){_0x190e94=_0x190e94-0x0;var _0x3012a0=_0x53ec[_0x190e94];return _0x3012a0;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc53e('0x6'));var config=require('../../config/environment');var controller=require(_0xc53e('0x7'));router[_0xc53e('0x8')]('/',auth['isAuthenticated'](),controller[_0xc53e('0x9')]);router['get'](_0xc53e('0xa'),auth[_0xc53e('0xb')](),controller['show']);router[_0xc53e('0x8')](_0xc53e('0xc'),auth[_0xc53e('0xb')](),controller[_0xc53e('0xd')]);router[_0xc53e('0xe')]('/',auth[_0xc53e('0xb')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);module[_0xc53e('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index bf3e8ab..54436a8 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.attributes.js +++ b/server/api/voiceMailMessage/voiceMailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf48a=['STRING','long','TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER'];(function(_0x536a5c,_0x49b786){var _0xa4071b=function(_0x27f048){while(--_0x27f048){_0x536a5c['push'](_0x536a5c['shift']());}};_0xa4071b(++_0x49b786);}(_0xf48a,0xbb));var _0xaf48=function(_0x300e9e,_0xcbfa6b){_0x300e9e=_0x300e9e-0x0;var _0x53c501=_0xf48a[_0x300e9e];return _0x53c501;};'use strict';var Sequelize=require(_0xaf48('0x0'));module[_0xaf48('0x1')]={'name':{'type':Sequelize[_0xaf48('0x2')],'get':function(_0x4aaa84){return this[_0xaf48('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xaf48('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xaf48('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0xaf48('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xaf48('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xaf48('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xaf48('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xaf48('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xaf48('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xaf48('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xaf48('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xaf48('0x7'),'allowNull':![]}}; \ No newline at end of file +var _0x6dea=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','sequelize','exports','VIRTUAL'];(function(_0x8640c4,_0x2f6108){var _0xa6e434=function(_0x2f3cdd){while(--_0x2f3cdd){_0x8640c4['push'](_0x8640c4['shift']());}};_0xa6e434(++_0x2f6108);}(_0x6dea,0x1c8));var _0xa6de=function(_0x63b5c7,_0x9fd72){_0x63b5c7=_0x63b5c7-0x0;var _0x224bff=_0x6dea[_0x63b5c7];return _0x224bff;};'use strict';var Sequelize=require(_0xa6de('0x0'));module[_0xa6de('0x1')]={'name':{'type':Sequelize[_0xa6de('0x2')],'get':function(_0x345caf){return this[_0xa6de('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xa6de('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xa6de('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xa6de('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xa6de('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xa6de('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xa6de('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xa6de('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xa6de('0x6')](_0xa6de('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0xa6de('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xa6de('0x5')],'defaultValue':''},'stamp':{'type':_0xa6de('0x8'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 8e2b405..c284987 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.controller.js +++ b/server/api/voiceMailMessage/voiceMailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x716a=['../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','set','Content-Range','update','destroy','stack','send','model','differenceBy','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','VoiceMailMessage','count','then','includeAll','findAll','catch','show','rawAttributes','include','find','create','body','params','download','recording','msg_id','ValidationError','attachment;\x20filename=\x22','.wav\x22','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api'];(function(_0x1912f2,_0x59c37f){var _0x449b1f=function(_0x344a60){while(--_0x344a60){_0x1912f2['push'](_0x1912f2['shift']());}};_0x449b1f(++_0x59c37f);}(_0x716a,0x170));var _0xa716=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x716a[_0x9fd887];return _0x1a54ab;};'use strict';var pdf=require(_0xa716('0x0'));var emlformat=require(_0xa716('0x1'));var rimraf=require(_0xa716('0x2'));var zipdir=require(_0xa716('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa716('0x4'));var moment=require(_0xa716('0x5'));var BPromise=require(_0xa716('0x6'));var Mustache=require(_0xa716('0x7'));var util=require('util');var path=require(_0xa716('0x8'));var sox=require(_0xa716('0x9'));var csv=require(_0xa716('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa716('0xb'));var squel=require(_0xa716('0xc'));var crypto=require(_0xa716('0xd'));var jsforce=require(_0xa716('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa716('0xa'));var querystring=require(_0xa716('0xf'));var Papa=require(_0xa716('0x10'));var Redis=require(_0xa716('0x11'));var authService=require(_0xa716('0x12'));var qs=require(_0xa716('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa716('0x14'))(_0xa716('0x15'));var utils=require(_0xa716('0x16'));var config=require(_0xa716('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c9925,_0x268df){_0x268df=_0x268df||0xcc;return function(_0x6d6ff5){if(_0x6d6ff5){return _0x5c9925[_0xa716('0x18')](_0x268df);}return _0x5c9925['status'](_0x268df)[_0xa716('0x19')]();};}function respondWithResult(_0x57aac0,_0x26ef30){_0x26ef30=_0x26ef30||0xc8;return function(_0x49ee06){if(_0x49ee06){return _0x57aac0[_0xa716('0x1a')](_0x26ef30)[_0xa716('0x1b')](_0x49ee06);}};}function respondWithFilteredResult(_0x21f959,_0x3f43b3){return function(_0x3d5247){if(_0x3d5247){var _0x46165b=_0x3d5247['count'],_0x3b0bf2=_0x3f43b3[_0xa716('0x1c')],_0x11475f=_0x3f43b3['offset']+_0x3f43b3[_0xa716('0x1d')],_0x287238;if(_0x11475f>=_0x46165b){_0x11475f=_0x46165b;_0x287238=0xc8;}else{_0x287238=0xce;}_0x21f959['status'](_0x287238);return _0x21f959[_0xa716('0x1e')](_0xa716('0x1f'),_0x3b0bf2+'-'+_0x11475f+'/'+_0x46165b)[_0xa716('0x1b')](_0x3d5247);}return null;};}function patchUpdates(_0x41b9c8){return function(_0x3ec45a){try{jsonpatch['apply'](_0x3ec45a,_0x41b9c8,!![]);}catch(_0x335211){return BPromise['reject'](_0x335211);}return _0x3ec45a['save']();};}function saveUpdates(_0x5bd62a,_0x2a3a51){return function(_0x28fba5){if(_0x28fba5){return _0x28fba5[_0xa716('0x20')](_0x5bd62a)['then'](function(_0x557480){return _0x557480;});}return null;};}function removeEntity(_0x34ad6b,_0x462edb){return function(_0x2c1fc4){if(_0x2c1fc4){return _0x2c1fc4[_0xa716('0x21')]()['then'](function(){_0x34ad6b[_0xa716('0x1a')](0xcc)[_0xa716('0x19')]();});}};}function handleEntityNotFound(_0x48f3f6,_0x167eb2){return function(_0x117fa2){if(!_0x117fa2){_0x48f3f6[_0xa716('0x18')](0x194);}return _0x117fa2;};}function handleError(_0x555ac7,_0x5dfd7c){_0x5dfd7c=_0x5dfd7c||0x1f4;return function(_0x4172ad){logger['error'](_0x4172ad[_0xa716('0x22')]);if(_0x4172ad['name']){delete _0x4172ad['name'];}_0x555ac7[_0xa716('0x1a')](_0x5dfd7c)[_0xa716('0x23')](_0x4172ad);};}exports['index']=function(_0x44f86b,_0x2560f9){var _0x1b380c={},_0x491517={},_0x23e4e6={'count':0x0,'rows':[]};var _0x468157=db['VoiceMailMessage']['rawAttributes'];_0x491517[_0xa716('0x24')]=_[_0xa716('0x25')](_['keys'](_0x468157),[_0xa716('0x26')]);_0x491517[_0xa716('0x27')]=_[_0xa716('0x28')](_0x44f86b[_0xa716('0x27')]);_0x491517[_0xa716('0x29')]=_[_0xa716('0x2a')](_0x491517[_0xa716('0x24')],_0x491517[_0xa716('0x27')]);_0x1b380c[_0xa716('0x2b')]=_['intersection'](_0x491517[_0xa716('0x24')],qs[_0xa716('0x2c')](_0x44f86b[_0xa716('0x27')][_0xa716('0x2c')]));_0x1b380c['attributes']=_0x1b380c[_0xa716('0x2b')][_0xa716('0x2d')]?_0x1b380c['attributes']:_0x491517[_0xa716('0x24')];if(!_0x44f86b[_0xa716('0x27')]['hasOwnProperty'](_0xa716('0x2e'))){_0x1b380c[_0xa716('0x1d')]=qs[_0xa716('0x1d')](_0x44f86b[_0xa716('0x27')][_0xa716('0x1d')]);_0x1b380c['offset']=qs[_0xa716('0x1c')](_0x44f86b['query'][_0xa716('0x1c')]);}_0x1b380c[_0xa716('0x2f')]=qs['sort'](_0x44f86b[_0xa716('0x27')][_0xa716('0x30')]);_0x1b380c[_0xa716('0x31')]=qs['filters'](_[_0xa716('0x32')](_0x44f86b['query'],_0x491517['filters']));if(_0x44f86b[_0xa716('0x27')][_0xa716('0x33')]){_0x1b380c[_0xa716('0x31')]=_[_0xa716('0x34')](_0x1b380c[_0xa716('0x31')],{'$or':_[_0xa716('0x35')](_0x468157,function(_0x308e79){if(_0x308e79[_0xa716('0x36')][_0xa716('0x37')]!==_0xa716('0x38')){var _0x132e03={};_0x132e03[_0x308e79[_0xa716('0x39')]]={'$like':'%'+_0x44f86b[_0xa716('0x27')]['filter']+'%'};return _0x132e03;}})});}_0x1b380c=_[_0xa716('0x34')]({},_0x1b380c,_0x44f86b[_0xa716('0x3a')]);var _0x292ae2={'where':_0x1b380c[_0xa716('0x31')]};return db[_0xa716('0x3b')][_0xa716('0x3c')](_0x292ae2)[_0xa716('0x3d')](function(_0x17651a){_0x23e4e6[_0xa716('0x3c')]=_0x17651a;if(_0x44f86b[_0xa716('0x27')][_0xa716('0x3e')]){_0x1b380c['include']=[{'all':!![]}];}return db[_0xa716('0x3b')][_0xa716('0x3f')](_0x1b380c);})[_0xa716('0x3d')](function(_0x4d0879){_0x23e4e6['rows']=_0x4d0879;return _0x23e4e6;})[_0xa716('0x3d')](respondWithFilteredResult(_0x2560f9,_0x1b380c))[_0xa716('0x40')](handleError(_0x2560f9,null));};exports[_0xa716('0x41')]=function(_0x5f0c43,_0x1bed50){var _0x41ab0f={'raw':!![],'where':{'id':_0x5f0c43['params']['id']}},_0x2e1932={};_0x2e1932[_0xa716('0x24')]=_[_0xa716('0x28')](db[_0xa716('0x3b')][_0xa716('0x42')]);_0x2e1932[_0xa716('0x27')]=_[_0xa716('0x28')](_0x5f0c43['query']);_0x2e1932[_0xa716('0x29')]=_[_0xa716('0x2a')](_0x2e1932[_0xa716('0x24')],_0x2e1932[_0xa716('0x27')]);_0x41ab0f[_0xa716('0x2b')]=_[_0xa716('0x2a')](_0x2e1932[_0xa716('0x24')],qs[_0xa716('0x2c')](_0x5f0c43[_0xa716('0x27')][_0xa716('0x2c')]));_0x41ab0f['attributes']=_0x41ab0f['attributes'][_0xa716('0x2d')]?_0x41ab0f[_0xa716('0x2b')]:_0x2e1932[_0xa716('0x24')];if(_0x5f0c43[_0xa716('0x27')][_0xa716('0x3e')]){_0x41ab0f[_0xa716('0x43')]=[{'all':!![]}];}_0x41ab0f=_[_0xa716('0x34')]({},_0x41ab0f,_0x5f0c43['options']);return db[_0xa716('0x3b')][_0xa716('0x44')](_0x41ab0f)[_0xa716('0x3d')](handleEntityNotFound(_0x1bed50,null))[_0xa716('0x3d')](respondWithResult(_0x1bed50,null))[_0xa716('0x40')](handleError(_0x1bed50,null));};exports['create']=function(_0x2d3ccd,_0x38ecc8){return db['VoiceMailMessage'][_0xa716('0x45')](_0x2d3ccd[_0xa716('0x46')],{})[_0xa716('0x3d')](respondWithResult(_0x38ecc8,0xc9))[_0xa716('0x40')](handleError(_0x38ecc8,null));};exports['update']=function(_0x7b5921,_0x22f104){if(_0x7b5921[_0xa716('0x46')]['id']){delete _0x7b5921[_0xa716('0x46')]['id'];}return db[_0xa716('0x3b')][_0xa716('0x44')]({'where':{'id':_0x7b5921[_0xa716('0x47')]['id']}})['then'](handleEntityNotFound(_0x22f104,null))[_0xa716('0x3d')](saveUpdates(_0x7b5921['body'],null))[_0xa716('0x3d')](respondWithResult(_0x22f104,null))['catch'](handleError(_0x22f104,null));};exports[_0xa716('0x21')]=function(_0x11bd90,_0x1578f2){return db[_0xa716('0x3b')][_0xa716('0x44')]({'where':{'id':_0x11bd90[_0xa716('0x47')]['id']}})[_0xa716('0x3d')](handleEntityNotFound(_0x1578f2,null))[_0xa716('0x3d')](removeEntity(_0x1578f2,null))[_0xa716('0x40')](handleError(_0x1578f2,null));};exports[_0xa716('0x48')]=function(_0x4a7dae,_0x5977fb,_0x3ad5b3){return db['VoiceMailMessage'][_0xa716('0x44')]({'where':{'id':_0x4a7dae['params']['id']},'attributes':['id',_0xa716('0x49'),_0xa716('0x4a')]})[_0xa716('0x3d')](handleEntityNotFound(_0x5977fb,null))[_0xa716('0x3d')](function(_0x2e554d){if(_0x2e554d){if(!_0x2e554d[_0xa716('0x49')]){throw new db['Sequelize'][(_0xa716('0x4b'))]('VoiceMailMessage\x20not\x20found');}var _0x1ffa9a={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x2e554d[_0xa716('0x4a')]){_0x1ffa9a['Content-Disposition']=_0xa716('0x4c')+_0x2e554d[_0xa716('0x4a')]+_0xa716('0x4d');}_0x5977fb[_0xa716('0x1e')](_0x1ffa9a);return _0x5977fb[_0xa716('0x23')](new Buffer(_0x2e554d[_0xa716('0x49')]));}})[_0xa716('0x40')](handleError(_0x5977fb,null));}; \ No newline at end of file +var _0xd981=['ejs','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','reject','update','then','destroy','sendStatus','error','name','rawAttributes','model','differenceBy','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','pick','filter','where','merge','type','key','VIRTUAL','options','VoiceMailMessage','include','findAll','rows','catch','length','includeAll','find','create','body','params','msg_id','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv'];(function(_0x439515,_0x41b472){var _0x5e50d3=function(_0x4b5928){while(--_0x4b5928){_0x439515['push'](_0x439515['shift']());}};_0x5e50d3(++_0x41b472);}(_0xd981,0x88));var _0x1d98=function(_0x302c95,_0x1c2854){_0x302c95=_0x302c95-0x0;var _0x439735=_0xd981[_0x302c95];return _0x439735;};'use strict';var pdf=require(_0x1d98('0x0'));var emlformat=require(_0x1d98('0x1'));var rimraf=require(_0x1d98('0x2'));var zipdir=require(_0x1d98('0x3'));var jsonpatch=require(_0x1d98('0x4'));var rp=require(_0x1d98('0x5'));var moment=require(_0x1d98('0x6'));var BPromise=require(_0x1d98('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1d98('0x8'));var sox=require('sox');var csv=require(_0x1d98('0x9'));var ejs=require(_0x1d98('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1d98('0xb'));var jsforce=require(_0x1d98('0xc'));var deskjs=require(_0x1d98('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1d98('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d98('0xf'))(_0x1d98('0x10'));var utils=require(_0x1d98('0x11'));var config=require(_0x1d98('0x12'));var db=require(_0x1d98('0x13'))['db'];function respondWithStatusCode(_0x535753,_0x4dd077){_0x4dd077=_0x4dd077||0xcc;return function(_0x252b20){if(_0x252b20){return _0x535753['sendStatus'](_0x4dd077);}return _0x535753['status'](_0x4dd077)[_0x1d98('0x14')]();};}function respondWithResult(_0x2e8c44,_0x1509ff){_0x1509ff=_0x1509ff||0xc8;return function(_0x4d7d21){if(_0x4d7d21){return _0x2e8c44['status'](_0x1509ff)[_0x1d98('0x15')](_0x4d7d21);}};}function respondWithFilteredResult(_0x116bdc,_0x1493f6){return function(_0x21d9b0){if(_0x21d9b0){var _0x6c273b=_0x21d9b0[_0x1d98('0x16')],_0x46cf75=_0x1493f6[_0x1d98('0x17')],_0x442814=_0x1493f6[_0x1d98('0x17')]+_0x1493f6[_0x1d98('0x18')],_0x33e1a1;if(_0x442814>=_0x6c273b){_0x442814=_0x6c273b;_0x33e1a1=0xc8;}else{_0x33e1a1=0xce;}_0x116bdc[_0x1d98('0x19')](_0x33e1a1);return _0x116bdc[_0x1d98('0x1a')]('Content-Range',_0x46cf75+'-'+_0x442814+'/'+_0x6c273b)[_0x1d98('0x15')](_0x21d9b0);}return null;};}function patchUpdates(_0x295ce2){return function(_0x385ce5){try{jsonpatch['apply'](_0x385ce5,_0x295ce2,!![]);}catch(_0x33d413){return BPromise[_0x1d98('0x1b')](_0x33d413);}return _0x385ce5['save']();};}function saveUpdates(_0x5ccabf,_0x5209fc){return function(_0x3ab0ac){if(_0x3ab0ac){return _0x3ab0ac[_0x1d98('0x1c')](_0x5ccabf)[_0x1d98('0x1d')](function(_0x5cdaab){return _0x5cdaab;});}return null;};}function removeEntity(_0x8d396c,_0xe5b7ae){return function(_0x1ef2ad){if(_0x1ef2ad){return _0x1ef2ad[_0x1d98('0x1e')]()[_0x1d98('0x1d')](function(){_0x8d396c[_0x1d98('0x19')](0xcc)[_0x1d98('0x14')]();});}};}function handleEntityNotFound(_0x333df7,_0x86bb9a){return function(_0x316747){if(!_0x316747){_0x333df7[_0x1d98('0x1f')](0x194);}return _0x316747;};}function handleError(_0x129c8b,_0x3403d9){_0x3403d9=_0x3403d9||0x1f4;return function(_0x42a585){logger[_0x1d98('0x20')](_0x42a585['stack']);if(_0x42a585[_0x1d98('0x21')]){delete _0x42a585[_0x1d98('0x21')];}_0x129c8b['status'](_0x3403d9)['send'](_0x42a585);};}exports['index']=function(_0x246a1f,_0x441fc0){var _0xced20c={},_0x18d10e={},_0x5a8892={'count':0x0,'rows':[]};var _0x573894=db['VoiceMailMessage'][_0x1d98('0x22')];_0x18d10e[_0x1d98('0x23')]=_[_0x1d98('0x24')](_[_0x1d98('0x25')](_0x573894),[_0x1d98('0x21')]);_0x18d10e[_0x1d98('0x26')]=_[_0x1d98('0x25')](_0x246a1f['query']);_0x18d10e[_0x1d98('0x27')]=_['intersection'](_0x18d10e[_0x1d98('0x23')],_0x18d10e[_0x1d98('0x26')]);_0xced20c['attributes']=_[_0x1d98('0x28')](_0x18d10e[_0x1d98('0x23')],qs[_0x1d98('0x29')](_0x246a1f[_0x1d98('0x26')][_0x1d98('0x29')]));_0xced20c['attributes']=_0xced20c['attributes']['length']?_0xced20c[_0x1d98('0x2a')]:_0x18d10e[_0x1d98('0x23')];if(!_0x246a1f[_0x1d98('0x26')][_0x1d98('0x2b')](_0x1d98('0x2c'))){_0xced20c[_0x1d98('0x18')]=qs[_0x1d98('0x18')](_0x246a1f[_0x1d98('0x26')][_0x1d98('0x18')]);_0xced20c['offset']=qs[_0x1d98('0x17')](_0x246a1f[_0x1d98('0x26')][_0x1d98('0x17')]);}_0xced20c['order']=qs['sort'](_0x246a1f['query']['sort']);_0xced20c['where']=qs[_0x1d98('0x27')](_[_0x1d98('0x2d')](_0x246a1f[_0x1d98('0x26')],_0x18d10e[_0x1d98('0x27')]));if(_0x246a1f[_0x1d98('0x26')][_0x1d98('0x2e')]){_0xced20c[_0x1d98('0x2f')]=_[_0x1d98('0x30')](_0xced20c[_0x1d98('0x2f')],{'$or':_['map'](_0x573894,function(_0x4e8f19){if(_0x4e8f19[_0x1d98('0x31')][_0x1d98('0x32')]!==_0x1d98('0x33')){var _0x1b5845={};_0x1b5845[_0x4e8f19['field']]={'$like':'%'+_0x246a1f['query'][_0x1d98('0x2e')]+'%'};return _0x1b5845;}})});}_0xced20c=_[_0x1d98('0x30')]({},_0xced20c,_0x246a1f[_0x1d98('0x34')]);var _0x2c981d={'where':_0xced20c['where']};return db[_0x1d98('0x35')][_0x1d98('0x16')](_0x2c981d)['then'](function(_0x389ce1){_0x5a8892[_0x1d98('0x16')]=_0x389ce1;if(_0x246a1f[_0x1d98('0x26')]['includeAll']){_0xced20c[_0x1d98('0x36')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x1d98('0x37')](_0xced20c);})[_0x1d98('0x1d')](function(_0x5f539c){_0x5a8892[_0x1d98('0x38')]=_0x5f539c;return _0x5a8892;})[_0x1d98('0x1d')](respondWithFilteredResult(_0x441fc0,_0xced20c))[_0x1d98('0x39')](handleError(_0x441fc0,null));};exports['show']=function(_0x94efb5,_0x22db5b){var _0x8967c2={'raw':!![],'where':{'id':_0x94efb5['params']['id']}},_0x1e8df6={};_0x1e8df6['model']=_[_0x1d98('0x25')](db[_0x1d98('0x35')][_0x1d98('0x22')]);_0x1e8df6[_0x1d98('0x26')]=_['keys'](_0x94efb5[_0x1d98('0x26')]);_0x1e8df6[_0x1d98('0x27')]=_[_0x1d98('0x28')](_0x1e8df6['model'],_0x1e8df6[_0x1d98('0x26')]);_0x8967c2[_0x1d98('0x2a')]=_[_0x1d98('0x28')](_0x1e8df6[_0x1d98('0x23')],qs[_0x1d98('0x29')](_0x94efb5[_0x1d98('0x26')]['fields']));_0x8967c2[_0x1d98('0x2a')]=_0x8967c2['attributes'][_0x1d98('0x3a')]?_0x8967c2[_0x1d98('0x2a')]:_0x1e8df6[_0x1d98('0x23')];if(_0x94efb5['query'][_0x1d98('0x3b')]){_0x8967c2['include']=[{'all':!![]}];}_0x8967c2=_['merge']({},_0x8967c2,_0x94efb5['options']);return db['VoiceMailMessage'][_0x1d98('0x3c')](_0x8967c2)[_0x1d98('0x1d')](handleEntityNotFound(_0x22db5b,null))[_0x1d98('0x1d')](respondWithResult(_0x22db5b,null))['catch'](handleError(_0x22db5b,null));};exports[_0x1d98('0x3d')]=function(_0x5b2c3f,_0x179b27){return db[_0x1d98('0x35')][_0x1d98('0x3d')](_0x5b2c3f['body'],{})[_0x1d98('0x1d')](respondWithResult(_0x179b27,0xc9))[_0x1d98('0x39')](handleError(_0x179b27,null));};exports[_0x1d98('0x1c')]=function(_0x3b559a,_0x46107e){if(_0x3b559a[_0x1d98('0x3e')]['id']){delete _0x3b559a[_0x1d98('0x3e')]['id'];}return db['VoiceMailMessage'][_0x1d98('0x3c')]({'where':{'id':_0x3b559a['params']['id']}})['then'](handleEntityNotFound(_0x46107e,null))[_0x1d98('0x1d')](saveUpdates(_0x3b559a[_0x1d98('0x3e')],null))[_0x1d98('0x1d')](respondWithResult(_0x46107e,null))['catch'](handleError(_0x46107e,null));};exports[_0x1d98('0x1e')]=function(_0x5b3e02,_0x25b7c5){return db[_0x1d98('0x35')][_0x1d98('0x3c')]({'where':{'id':_0x5b3e02[_0x1d98('0x3f')]['id']}})[_0x1d98('0x1d')](handleEntityNotFound(_0x25b7c5,null))[_0x1d98('0x1d')](removeEntity(_0x25b7c5,null))[_0x1d98('0x39')](handleError(_0x25b7c5,null));};exports['download']=function(_0x2a0e21,_0x317226,_0x276347){return db[_0x1d98('0x35')][_0x1d98('0x3c')]({'where':{'id':_0x2a0e21[_0x1d98('0x3f')]['id']},'attributes':['id','recording',_0x1d98('0x40')]})[_0x1d98('0x1d')](handleEntityNotFound(_0x317226,null))[_0x1d98('0x1d')](function(_0x587644){if(_0x587644){if(!_0x587644[_0x1d98('0x41')]){throw new db[(_0x1d98('0x42'))]['ValidationError'](_0x1d98('0x43'));}var _0x5c097e={'Content-Type':_0x1d98('0x44'),'Content-Disposition':_0x1d98('0x45')};if(_0x587644[_0x1d98('0x40')]){_0x5c097e[_0x1d98('0x46')]='attachment;\x20filename=\x22'+_0x587644['msg_id']+_0x1d98('0x47');}_0x317226[_0x1d98('0x1a')](_0x5c097e);return _0x317226[_0x1d98('0x48')](new Buffer(_0x587644[_0x1d98('0x41')]));}})['catch'](handleError(_0x317226,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 74c7f79..6ce42dd 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.model.js +++ b/server/api/voiceMailMessage/voiceMailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff13=['bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xff13,0x175));var _0x3ff1=function(_0xad16cf,_0x1deb78){_0xad16cf=_0xad16cf-0x0;var _0x196160=_0xff13[_0xad16cf];return _0x196160;};'use strict';var _=require(_0x3ff1('0x0'));var util=require(_0x3ff1('0x1'));var logger=require(_0x3ff1('0x2'))(_0x3ff1('0x3'));var moment=require(_0x3ff1('0x4'));var BPromise=require(_0x3ff1('0x5'));var rp=require(_0x3ff1('0x6'));var fs=require('fs');var path=require(_0x3ff1('0x7'));var rimraf=require(_0x3ff1('0x8'));var config=require('../../config/environment');var attributes=require(_0x3ff1('0x9'));module[_0x3ff1('0xa')]=function(_0x354867,_0x5e4a60){return _0x354867[_0x3ff1('0xb')]('VoiceMailMessage',attributes,{'tableName':_0x3ff1('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x3ff1('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9230=['define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','exports'];(function(_0x5ecf73,_0x1db719){var _0x3d0a0e=function(_0x41c825){while(--_0x41c825){_0x5ecf73['push'](_0x5ecf73['shift']());}};_0x3d0a0e(++_0x1db719);}(_0x9230,0x17b));var _0x0923=function(_0x3ae230,_0x25d811){_0x3ae230=_0x3ae230-0x0;var _0x49cdeb=_0x9230[_0x3ae230];return _0x49cdeb;};'use strict';var _=require(_0x0923('0x0'));var util=require(_0x0923('0x1'));var logger=require(_0x0923('0x2'))(_0x0923('0x3'));var moment=require(_0x0923('0x4'));var BPromise=require(_0x0923('0x5'));var rp=require(_0x0923('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0923('0x7'));var config=require(_0x0923('0x8'));var attributes=require(_0x0923('0x9'));module[_0x0923('0xa')]=function(_0x51d2b4,_0xa78922){return _0x51d2b4[_0x0923('0xb')](_0x0923('0xc'),attributes,{'tableName':_0x0923('0xd'),'paranoid':![],'indexes':[{'name':_0x0923('0xe'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 2180949..3413a08 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js +++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','VoiceMailMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x1a0076,_0x12be4b){_0x1a0076=_0x1a0076-0x0;var _0x4458d6=_0x7a54[_0x1a0076];return _0x4458d6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x1967=['then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x1967,0x173));var _0x7196=function(_0x4f37cf,_0x45a811){_0x4f37cf=_0x4f37cf-0x0;var _0x4569d8=_0x1967[_0x4f37cf];return _0x4569d8;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index eb22d21..a59be6f 100644 --- a/server/api/voiceMusicOnHold/index.js +++ b/server/api/voiceMusicOnHold/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab74=['exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sounds','getSounds','post','create','addSound','put','update','delete','destroy','removeSound'];(function(_0x24ff9a,_0x4da153){var _0x118ce1=function(_0x8c4df4){while(--_0x8c4df4){_0x24ff9a['push'](_0x24ff9a['shift']());}};_0x118ce1(++_0x4da153);}(_0xab74,0x13c));var _0x4ab7=function(_0x51d269,_0x1972d4){_0x51d269=_0x51d269-0x0;var _0x15d897=_0xab74[_0x51d269];return _0x15d897;};'use strict';var multer=require('multer');var util=require(_0x4ab7('0x0'));var path=require('path');var timeout=require(_0x4ab7('0x1'));var express=require(_0x4ab7('0x2'));var router=express[_0x4ab7('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4ab7('0x4'));var config=require(_0x4ab7('0x5'));var controller=require('./voiceMusicOnHold.controller');router[_0x4ab7('0x6')]('/',auth[_0x4ab7('0x7')](),controller[_0x4ab7('0x8')]);router['get'](_0x4ab7('0x9'),auth[_0x4ab7('0x7')](),controller['show']);router[_0x4ab7('0x6')](_0x4ab7('0xa'),auth[_0x4ab7('0x7')](),controller[_0x4ab7('0xb')]);router[_0x4ab7('0xc')]('/',auth[_0x4ab7('0x7')](),controller[_0x4ab7('0xd')]);router[_0x4ab7('0xc')](_0x4ab7('0xa'),auth['isAuthenticated'](),controller[_0x4ab7('0xe')]);router[_0x4ab7('0xf')](_0x4ab7('0x9'),auth[_0x4ab7('0x7')](),controller[_0x4ab7('0x10')]);router[_0x4ab7('0x11')](_0x4ab7('0x9'),auth[_0x4ab7('0x7')](),controller[_0x4ab7('0x12')]);router[_0x4ab7('0x11')]('/:id/sounds/:id2',auth[_0x4ab7('0x7')](),controller[_0x4ab7('0x13')]);module[_0x4ab7('0x14')]=router; \ No newline at end of file +var _0x373d=['removeSound','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','index','get','/:id','isAuthenticated','post','/:id/sounds','put','update','destroy','delete'];(function(_0x31d6c2,_0x422dcd){var _0x295dd0=function(_0x2b5dd1){while(--_0x2b5dd1){_0x31d6c2['push'](_0x31d6c2['shift']());}};_0x295dd0(++_0x422dcd);}(_0x373d,0x1e2));var _0xd373=function(_0x290232,_0x1e8ebd){_0x290232=_0x290232-0x0;var _0x3b2a32=_0x373d[_0x290232];return _0x3b2a32;};'use strict';var multer=require(_0xd373('0x0'));var util=require('util');var path=require(_0xd373('0x1'));var timeout=require(_0xd373('0x2'));var express=require(_0xd373('0x3'));var router=express[_0xd373('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd373('0x5'));var config=require(_0xd373('0x6'));var controller=require(_0xd373('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd373('0x8')]);router[_0xd373('0x9')](_0xd373('0xa'),auth[_0xd373('0xb')](),controller['show']);router[_0xd373('0x9')]('/:id/sounds',auth['isAuthenticated'](),controller['getSounds']);router[_0xd373('0xc')]('/',auth[_0xd373('0xb')](),controller['create']);router[_0xd373('0xc')](_0xd373('0xd'),auth['isAuthenticated'](),controller['addSound']);router[_0xd373('0xe')](_0xd373('0xa'),auth[_0xd373('0xb')](),controller[_0xd373('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd373('0x10')]);router[_0xd373('0x11')]('/:id/sounds/:id2',auth[_0xd373('0xb')](),controller[_0xd373('0x12')]);module[_0xd373('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index c4dc670..1a3cc67 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f6d=['mp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','custom'];(function(_0x3187ca,_0x32af56){var _0xa5c88a=function(_0x4ad8cb){while(--_0x4ad8cb){_0x3187ca['push'](_0x3187ca['shift']());}};_0xa5c88a(++_0x32af56);}(_0x2f6d,0x109));var _0xd2f6=function(_0x594b45,_0x18b8bb){_0x594b45=_0x594b45-0x0;var _0x9b8156=_0x2f6d[_0x594b45];return _0x9b8156;};'use strict';var Sequelize=require(_0xd2f6('0x0'));module[_0xd2f6('0x1')]={'name':{'type':Sequelize[_0xd2f6('0x2')],'allowNull':![],'unique':_0xd2f6('0x3')},'mode':{'type':Sequelize['ENUM'](_0xd2f6('0x4'),'files',_0xd2f6('0x5'),'quietmp3nb',_0xd2f6('0x6'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xd2f6('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xd2f6('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xd2f6('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd2f6('0x7')},'format':{'type':Sequelize[_0xd2f6('0x2')],'allowNull':!![]},'stamp':{'type':_0xd2f6('0x8')},'defaultEntry':{'type':Sequelize[_0xd2f6('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc1a9=['STRING','alpha','TIMESTAMP','sequelize','exports','name','ENUM','custom','files','mp3nb','quietmp3','mp3'];(function(_0x46774f,_0x3ef542){var _0x2eb0e3=function(_0x40dfc3){while(--_0x40dfc3){_0x46774f['push'](_0x46774f['shift']());}};_0x2eb0e3(++_0x3ef542);}(_0xc1a9,0x177));var _0x9c1a=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xc1a9[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require(_0x9c1a('0x0'));module[_0x9c1a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9c1a('0x2')},'mode':{'type':Sequelize[_0x9c1a('0x3')](_0x9c1a('0x4'),_0x9c1a('0x5'),_0x9c1a('0x6'),'quietmp3nb',_0x9c1a('0x7'),_0x9c1a('0x8')),'allowNull':!![],'defaultValue':_0x9c1a('0x5')},'directory':{'type':Sequelize[_0x9c1a('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0x9c1a('0x9')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x9c1a('0x9')],'allowNull':!![],'defaultValue':_0x9c1a('0xa')},'format':{'type':Sequelize[_0x9c1a('0x9')],'allowNull':!![]},'stamp':{'type':_0x9c1a('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 7cd5d6f..6b2fba0 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd40c=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','unlinkSync','getSounds','pick','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','papaparse','ioredis','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','error','stack','name','send','VoiceMusicOnHold','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','map','type','key','VIRTUAL','field','merge','options','include','rows','show','params','length','includeAll','find','catch','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x367676,_0x28af86){var _0x37ff68=function(_0x5bb0ae){while(--_0x5bb0ae){_0x367676['push'](_0x367676['shift']());}};_0x37ff68(++_0x28af86);}(_0xd40c,0x87));var _0xcd40=function(_0x331c91,_0xad02cd){_0x331c91=_0x331c91-0x0;var _0xbda8a5=_0xd40c[_0x331c91];return _0xbda8a5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcd40('0x0'));var rimraf=require(_0xcd40('0x1'));var zipdir=require(_0xcd40('0x2'));var jsonpatch=require(_0xcd40('0x3'));var rp=require(_0xcd40('0x4'));var moment=require('moment');var BPromise=require(_0xcd40('0x5'));var Mustache=require(_0xcd40('0x6'));var util=require(_0xcd40('0x7'));var path=require('path');var sox=require(_0xcd40('0x8'));var csv=require(_0xcd40('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcd40('0xa'));var squel=require(_0xcd40('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcd40('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcd40('0xd'));var Redis=require(_0xcd40('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xcd40('0xf'));var config=require(_0xcd40('0x10'));var db=require(_0xcd40('0x11'))['db'];function respondWithStatusCode(_0x1f4356,_0xdde5d4){_0xdde5d4=_0xdde5d4||0xcc;return function(_0x20a25f){if(_0x20a25f){return _0x1f4356[_0xcd40('0x12')](_0xdde5d4);}return _0x1f4356[_0xcd40('0x13')](_0xdde5d4)[_0xcd40('0x14')]();};}function respondWithResult(_0x434992,_0x5da0a7){_0x5da0a7=_0x5da0a7||0xc8;return function(_0x5361ab){if(_0x5361ab){return _0x434992['status'](_0x5da0a7)[_0xcd40('0x15')](_0x5361ab);}};}function respondWithFilteredResult(_0x10c148,_0x3b1cce){return function(_0x52ba60){if(_0x52ba60){var _0x7b7fa5=_0x52ba60[_0xcd40('0x16')],_0x34b6c8=_0x3b1cce[_0xcd40('0x17')],_0x3dd242=_0x3b1cce['offset']+_0x3b1cce[_0xcd40('0x18')],_0x1f12f4;if(_0x3dd242>=_0x7b7fa5){_0x3dd242=_0x7b7fa5;_0x1f12f4=0xc8;}else{_0x1f12f4=0xce;}_0x10c148[_0xcd40('0x13')](_0x1f12f4);return _0x10c148['set'](_0xcd40('0x19'),_0x34b6c8+'-'+_0x3dd242+'/'+_0x7b7fa5)[_0xcd40('0x15')](_0x52ba60);}return null;};}function patchUpdates(_0x30f4dd){return function(_0x3b8450){try{jsonpatch[_0xcd40('0x1a')](_0x3b8450,_0x30f4dd,!![]);}catch(_0x36e778){return BPromise[_0xcd40('0x1b')](_0x36e778);}return _0x3b8450[_0xcd40('0x1c')]();};}function saveUpdates(_0x486702,_0x26542b){return function(_0x3faa57){if(_0x3faa57){return _0x3faa57[_0xcd40('0x1d')](_0x486702)[_0xcd40('0x1e')](function(_0x53adce){return _0x53adce;});}return null;};}function removeEntity(_0x470629,_0x18932b){return function(_0x53844a){if(_0x53844a){return _0x53844a['destroy']()[_0xcd40('0x1e')](function(){var _0xd7c09d=_0x53844a[_0xcd40('0x1f')]({'plain':!![]});var _0xbb37d1=_0xcd40('0x20');return db[_0xcd40('0x21')][_0xcd40('0x22')]({'where':{'type':_0xbb37d1,'resourceId':_0xd7c09d['id']}})[_0xcd40('0x1e')](function(){return _0x53844a;});})[_0xcd40('0x1e')](function(){_0x470629[_0xcd40('0x13')](0xcc)[_0xcd40('0x14')]();});}};}function handleEntityNotFound(_0x3e42f0,_0x22b272){return function(_0x9eb3c4){if(!_0x9eb3c4){_0x3e42f0['sendStatus'](0x194);}return _0x9eb3c4;};}function handleError(_0x333d3a,_0x146f80){_0x146f80=_0x146f80||0x1f4;return function(_0x1259c5){logger[_0xcd40('0x23')](_0x1259c5[_0xcd40('0x24')]);if(_0x1259c5[_0xcd40('0x25')]){delete _0x1259c5[_0xcd40('0x25')];}_0x333d3a[_0xcd40('0x13')](_0x146f80)[_0xcd40('0x26')](_0x1259c5);};}exports['index']=function(_0x1d0b9e,_0x20b7f2){var _0x1921a2={},_0x7a99ab={},_0x1737ae={'count':0x0,'rows':[]};var _0x328e94=db[_0xcd40('0x27')][_0xcd40('0x28')];_0x7a99ab[_0xcd40('0x29')]=_['keys'](_0x328e94);_0x7a99ab[_0xcd40('0x2a')]=_[_0xcd40('0x2b')](_0x1d0b9e['query']);_0x7a99ab[_0xcd40('0x2c')]=_[_0xcd40('0x2d')](_0x7a99ab[_0xcd40('0x29')],_0x7a99ab[_0xcd40('0x2a')]);_0x1921a2[_0xcd40('0x2e')]=_[_0xcd40('0x2d')](_0x7a99ab[_0xcd40('0x29')],qs['fields'](_0x1d0b9e[_0xcd40('0x2a')][_0xcd40('0x2f')]));_0x1921a2[_0xcd40('0x2e')]=_0x1921a2[_0xcd40('0x2e')]['length']?_0x1921a2['attributes']:_0x7a99ab['model'];if(!_0x1d0b9e[_0xcd40('0x2a')][_0xcd40('0x30')]('nolimit')){_0x1921a2[_0xcd40('0x18')]=qs[_0xcd40('0x18')](_0x1d0b9e['query'][_0xcd40('0x18')]);_0x1921a2[_0xcd40('0x17')]=qs['offset'](_0x1d0b9e['query'][_0xcd40('0x17')]);}_0x1921a2[_0xcd40('0x31')]=qs[_0xcd40('0x32')](_0x1d0b9e['query']['sort']);_0x1921a2['where']=qs[_0xcd40('0x2c')](_['pick'](_0x1d0b9e[_0xcd40('0x2a')],_0x7a99ab['filters']));if(_0x1d0b9e['query'][_0xcd40('0x33')]){_0x1921a2[_0xcd40('0x34')]=_['merge'](_0x1921a2[_0xcd40('0x34')],{'$or':_[_0xcd40('0x35')](_0x328e94,function(_0x50cc0e){if(_0x50cc0e[_0xcd40('0x36')][_0xcd40('0x37')]!==_0xcd40('0x38')){var _0x2aee14={};_0x2aee14[_0x50cc0e[_0xcd40('0x39')]]={'$like':'%'+_0x1d0b9e['query'][_0xcd40('0x33')]+'%'};return _0x2aee14;}})});}_0x1921a2=_[_0xcd40('0x3a')]({},_0x1921a2,_0x1d0b9e[_0xcd40('0x3b')]);var _0x21af8c={'where':_0x1921a2['where']};return db[_0xcd40('0x27')][_0xcd40('0x16')](_0x21af8c)[_0xcd40('0x1e')](function(_0x2073cc){_0x1737ae[_0xcd40('0x16')]=_0x2073cc;if(_0x1d0b9e[_0xcd40('0x2a')]['includeAll']){_0x1921a2[_0xcd40('0x3c')]=[{'all':!![]}];}return db[_0xcd40('0x27')]['findAll'](_0x1921a2);})['then'](function(_0x9b4135){_0x1737ae[_0xcd40('0x3d')]=_0x9b4135;return _0x1737ae;})[_0xcd40('0x1e')](respondWithFilteredResult(_0x20b7f2,_0x1921a2))['catch'](handleError(_0x20b7f2,null));};exports[_0xcd40('0x3e')]=function(_0x971628,_0x4d87a4){var _0x300f36={'raw':![],'where':{'id':_0x971628[_0xcd40('0x3f')]['id']}},_0x4bc024={};_0x4bc024[_0xcd40('0x29')]=_[_0xcd40('0x2b')](db[_0xcd40('0x27')][_0xcd40('0x28')]);_0x4bc024[_0xcd40('0x2a')]=_[_0xcd40('0x2b')](_0x971628[_0xcd40('0x2a')]);_0x4bc024[_0xcd40('0x2c')]=_[_0xcd40('0x2d')](_0x4bc024[_0xcd40('0x29')],_0x4bc024['query']);_0x300f36[_0xcd40('0x2e')]=_['intersection'](_0x4bc024[_0xcd40('0x29')],qs['fields'](_0x971628[_0xcd40('0x2a')][_0xcd40('0x2f')]));_0x300f36['attributes']=_0x300f36[_0xcd40('0x2e')][_0xcd40('0x40')]?_0x300f36[_0xcd40('0x2e')]:_0x4bc024[_0xcd40('0x29')];if(_0x971628[_0xcd40('0x2a')][_0xcd40('0x41')]){_0x300f36[_0xcd40('0x3c')]=[{'all':!![]}];}_0x300f36=_['merge']({},_0x300f36,_0x971628[_0xcd40('0x3b')]);return db[_0xcd40('0x27')][_0xcd40('0x42')](_0x300f36)['then'](handleEntityNotFound(_0x4d87a4,null))[_0xcd40('0x1e')](respondWithResult(_0x4d87a4,null))[_0xcd40('0x43')](handleError(_0x4d87a4,null));};exports[_0xcd40('0x1d')]=function(_0x37c8f1,_0x4d162e){if(_0x37c8f1[_0xcd40('0x44')]['id']){delete _0x37c8f1[_0xcd40('0x44')]['id'];}return db['VoiceMusicOnHold'][_0xcd40('0x42')]({'where':{'id':_0x37c8f1[_0xcd40('0x3f')]['id']}})[_0xcd40('0x1e')](handleEntityNotFound(_0x4d162e,null))[_0xcd40('0x1e')](saveUpdates(_0x37c8f1[_0xcd40('0x44')],null))[_0xcd40('0x1e')](respondWithResult(_0x4d162e,null))[_0xcd40('0x43')](handleError(_0x4d162e,null));};exports[_0xcd40('0x45')]=function(_0x31ffa9,_0x53b8ee,_0x491b3a){return db[_0xcd40('0x46')][_0xcd40('0x47')](function(_0x2bb583){if(_0x31ffa9['body'][_0xcd40('0x48')]===_0xcd40('0x49')){_0x31ffa9[_0xcd40('0x44')][_0xcd40('0x4a')]=path[_0xcd40('0x4b')](config[_0xcd40('0x4c')],_0xcd40('0x4d'),_0x31ffa9[_0xcd40('0x44')][_0xcd40('0x25')]);}return db[_0xcd40('0x27')][_0xcd40('0x45')](_0x31ffa9[_0xcd40('0x44')],{'transaction':_0x2bb583})[_0xcd40('0x1e')](function(_0xe48bc6){if(_0x31ffa9[_0xcd40('0x44')][_0xcd40('0x48')]===_0xcd40('0x49')){fs[_0xcd40('0x4e')](_0xe48bc6[_0xcd40('0x4a')],parseInt(_0xcd40('0x4f'),0x8));}var _0x24b766=_0x31ffa9[_0xcd40('0x50')][_0xcd40('0x1f')]({'plain':!![]});if(!_0x24b766)throw new Error(_0xcd40('0x51'));if(_0x24b766[_0xcd40('0x52')]===_0xcd40('0x50')){var _0xe2f48e=_0xe48bc6['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xcd40('0x20'),'userProfileId':_0x24b766['userProfileId']},'raw':!![]})[_0xcd40('0x1e')](function(_0x459e02){if(_0x459e02&&_0x459e02[_0xcd40('0x53')]===0x0){return db[_0xcd40('0x21')][_0xcd40('0x45')]({'name':_0xe2f48e['name'],'resourceId':_0xe2f48e['id'],'type':_0x459e02['name'],'sectionId':_0x459e02['id']},{})[_0xcd40('0x1e')](function(){return _0xe48bc6;});}else{return _0xe48bc6;}})['catch'](function(_0x5f5c3f){logger[_0xcd40('0x23')](_0xcd40('0x54'),_0x5f5c3f);});}return _0xe48bc6;});})[_0xcd40('0x1e')](respondWithResult(_0x53b8ee,0xc9))[_0xcd40('0x43')](handleError(_0x53b8ee,null));};exports[_0xcd40('0x22')]=function(_0x5ae094,_0x3ef9c1,_0x22d472){var _0x4b5ea1;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x5ae094['params']['id']}})[_0xcd40('0x1e')](function(_0x4fc0e9){if(_0x4fc0e9){return db['sequelize'][_0xcd40('0x47')](function(_0x468ec0){return _0x4fc0e9[_0xcd40('0x22')]({'transaction':_0x468ec0,'raw':!![]})[_0xcd40('0x1e')](function(_0x52f43c){if(_0x52f43c['directory']){fs[_0xcd40('0x55')](_0x52f43c['directory'])[_0xcd40('0x56')](function(_0x1fc93b){fs['unlinkSync'](path[_0xcd40('0x4b')](_0x52f43c[_0xcd40('0x4a')],_0x1fc93b));});fs[_0xcd40('0x57')](_0x52f43c[_0xcd40('0x4a')]);}return _0x52f43c;});})['catch'](function(_0x108dd8){throw new db[(_0xcd40('0x58'))][(_0xcd40('0x59'))](_0x108dd8[_0xcd40('0x5a')]);});}})[_0xcd40('0x1e')](handleEntityNotFound(_0x3ef9c1,null))[_0xcd40('0x1e')](removeEntity(_0x3ef9c1,null))['catch'](handleError(_0x3ef9c1,null));};exports['addSound']=function(_0x3fc56c,_0x3061a6,_0x5b1f26){return db[_0xcd40('0x46')][_0xcd40('0x47')](function(_0xa50380){var _0x467021;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x3fc56c[_0xcd40('0x3f')]['id']}})[_0xcd40('0x1e')](function(_0x54670c){if(_0x54670c){_0x467021=_0x54670c;return _0x54670c[_0xcd40('0x5b')](_0x3fc56c[_0xcd40('0x44')]['id'],{'transaction':_0xa50380});}})[_0xcd40('0x1e')](function(_0x4acef6){if(_0x4acef6){return db[_0xcd40('0x5c')][_0xcd40('0x5d')]({'where':{'id':_0x3fc56c[_0xcd40('0x44')]['id']},'attributes':['id',_0xcd40('0x25'),_0xcd40('0x5e'),_0xcd40('0x5f'),_0xcd40('0x60')],'raw':!![]});}})[_0xcd40('0x1e')](function(_0x3aced0){if(_0x3aced0){var _0x39198c=path[_0xcd40('0x4b')](config[_0xcd40('0x4c')],_0xcd40('0x61'),util[_0xcd40('0x62')](_0xcd40('0x63'),path[_0xcd40('0x64')](_0x3aced0[_0xcd40('0x5e')],path[_0xcd40('0x65')](_0x3aced0[_0xcd40('0x5e')])),_0x3aced0[_0xcd40('0x5f')]));var _0x180a4a=path[_0xcd40('0x4b')](config[_0xcd40('0x4c')],_0xcd40('0x4d'),_0x467021['name'],util['format'](_0xcd40('0x63'),_0x3aced0[_0xcd40('0x25')],_0x3aced0[_0xcd40('0x5f')]));fs[_0xcd40('0x66')](_0x39198c,_0x180a4a);return _0x3aced0;}})[_0xcd40('0x43')](function(_0x3c82cb){throw new db['Sequelize'][(_0xcd40('0x59'))](_0x3c82cb[_0xcd40('0x5a')]);});})[_0xcd40('0x1e')](handleEntityNotFound(_0x3061a6,null))[_0xcd40('0x1e')](respondWithResult(_0x3061a6,0xc9))[_0xcd40('0x43')](handleError(_0x3061a6,null));};exports[_0xcd40('0x67')]=function(_0x181792,_0x13b009,_0x4e9529){return db[_0xcd40('0x46')][_0xcd40('0x47')](function(_0x726d64){var _0x15252b;return db['VoiceMusicOnHold'][_0xcd40('0x5d')]({'where':{'id':_0x181792['params']['id']}})[_0xcd40('0x1e')](handleEntityNotFound(_0x13b009,null))[_0xcd40('0x1e')](function(_0x21b5bf){if(_0x21b5bf){_0x15252b=_0x21b5bf;return _0x21b5bf[_0xcd40('0x67')](_0x181792[_0xcd40('0x3f')][_0xcd40('0x68')]);}})['then'](function(_0x2ff6d9){if(_0x2ff6d9){return db[_0xcd40('0x5c')][_0xcd40('0x5d')]({'where':{'id':_0x181792[_0xcd40('0x3f')][_0xcd40('0x68')]},'attributes':['id',_0xcd40('0x25'),'save_name',_0xcd40('0x5f'),_0xcd40('0x60')],'raw':!![]});}})[_0xcd40('0x1e')](function(_0x37489e){if(_0x37489e){fs[_0xcd40('0x69')](path['join'](_0x15252b[_0xcd40('0x4a')],util[_0xcd40('0x62')](_0xcd40('0x63'),_0x37489e['name'],_0x37489e[_0xcd40('0x5f')])));return _0x37489e;}})[_0xcd40('0x43')](function(_0x52258c){throw new db[(_0xcd40('0x58'))][(_0xcd40('0x59'))](_0x52258c[_0xcd40('0x5a')]);});})[_0xcd40('0x1e')](handleEntityNotFound(_0x13b009,null))[_0xcd40('0x1e')](respondWithStatusCode(_0x13b009,0xcc))[_0xcd40('0x43')](handleError(_0x13b009,null));};exports[_0xcd40('0x6a')]=function(_0x139734,_0xcdbdd0,_0x1945c6){var _0xb08b16={};var _0x3ae55b={};var _0x2a1594;var _0x4783b8;return db[_0xcd40('0x27')][_0xcd40('0x5d')]({'where':{'id':_0x139734[_0xcd40('0x3f')]['id']}})[_0xcd40('0x1e')](handleEntityNotFound(_0xcdbdd0,null))[_0xcd40('0x1e')](function(_0x354c93){if(_0x354c93){_0x2a1594=_0x354c93;_0x3ae55b[_0xcd40('0x29')]=_[_0xcd40('0x2b')](db[_0xcd40('0x5c')][_0xcd40('0x28')]);_0x3ae55b[_0xcd40('0x2a')]=_[_0xcd40('0x2b')](_0x139734[_0xcd40('0x2a')]);_0x3ae55b['filters']=_['intersection'](_0x3ae55b[_0xcd40('0x29')],_0x3ae55b[_0xcd40('0x2a')]);_0xb08b16['attributes']=_[_0xcd40('0x2d')](_0x3ae55b[_0xcd40('0x29')],qs[_0xcd40('0x2f')](_0x139734[_0xcd40('0x2a')][_0xcd40('0x2f')]));_0xb08b16[_0xcd40('0x2e')]=_0xb08b16[_0xcd40('0x2e')][_0xcd40('0x40')]?_0xb08b16[_0xcd40('0x2e')]:_0x3ae55b[_0xcd40('0x29')];_0xb08b16[_0xcd40('0x31')]=qs[_0xcd40('0x32')](_0x139734[_0xcd40('0x2a')][_0xcd40('0x32')]);_0xb08b16[_0xcd40('0x34')]=qs[_0xcd40('0x2c')](_[_0xcd40('0x6b')](_0x139734['query'],_0x3ae55b[_0xcd40('0x2c')]));if(_0x139734[_0xcd40('0x2a')]['filter']){_0xb08b16['where']=_[_0xcd40('0x3a')](_0xb08b16[_0xcd40('0x34')],{'$or':_[_0xcd40('0x35')](_0xb08b16[_0xcd40('0x2e')],function(_0x2e363d){var _0x211958={};_0x211958[_0x2e363d]={'$like':'%'+_0x139734[_0xcd40('0x2a')][_0xcd40('0x33')]+'%'};return _0x211958;})});}_0xb08b16=_[_0xcd40('0x3a')]({},_0xb08b16,_0x139734[_0xcd40('0x3b')]);return _0x2a1594['getSounds'](_0xb08b16);}})[_0xcd40('0x1e')](function(_0x790f94){if(_0x790f94){_0x4783b8=_0x790f94[_0xcd40('0x40')];if(!_0x139734[_0xcd40('0x2a')]['hasOwnProperty'](_0xcd40('0x6c'))){_0xb08b16[_0xcd40('0x18')]=qs[_0xcd40('0x18')](_0x139734[_0xcd40('0x2a')][_0xcd40('0x18')]);_0xb08b16[_0xcd40('0x17')]=qs[_0xcd40('0x17')](_0x139734['query'][_0xcd40('0x17')]);}return _0x2a1594['getSounds'](_0xb08b16);}})[_0xcd40('0x1e')](function(_0x4fcfb7){if(_0x4fcfb7){return _0x4fcfb7?{'count':_0x4783b8,'rows':_0x4fcfb7}:null;}})[_0xcd40('0x1e')](respondWithResult(_0xcdbdd0,null))[_0xcd40('0x43')](handleError(_0xcdbdd0,null));}; \ No newline at end of file +var _0x41f7=['keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','findAll','rows','catch','length','include','body','params','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','ValidationError','getSounds','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','MusicOnHolds','UserProfileResource','error','name','VoiceMusicOnHold','rawAttributes'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x41f7,0x191));var _0x741f=function(_0x22a263,_0x560c72){_0x22a263=_0x22a263-0x0;var _0x2b1a24=_0x41f7[_0x22a263];return _0x2b1a24;};'use strict';var pdf=require(_0x741f('0x0'));var emlformat=require(_0x741f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x741f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x741f('0x3'));var moment=require(_0x741f('0x4'));var BPromise=require(_0x741f('0x5'));var Mustache=require(_0x741f('0x6'));var util=require(_0x741f('0x7'));var path=require(_0x741f('0x8'));var sox=require(_0x741f('0x9'));var csv=require(_0x741f('0xa'));var ejs=require(_0x741f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x741f('0xc'));var crypto=require('crypto');var jsforce=require(_0x741f('0xd'));var deskjs=require(_0x741f('0xe'));var toCsv=require(_0x741f('0xa'));var querystring=require(_0x741f('0xf'));var Papa=require(_0x741f('0x10'));var Redis=require('ioredis');var authService=require(_0x741f('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x741f('0x12'));var logger=require(_0x741f('0x13'))(_0x741f('0x14'));var utils=require(_0x741f('0x15'));var config=require('../../config/environment');var db=require(_0x741f('0x16'))['db'];function respondWithStatusCode(_0x305b20,_0x176ae5){_0x176ae5=_0x176ae5||0xcc;return function(_0x81b1c1){if(_0x81b1c1){return _0x305b20[_0x741f('0x17')](_0x176ae5);}return _0x305b20['status'](_0x176ae5)[_0x741f('0x18')]();};}function respondWithResult(_0x16e27,_0x110b45){_0x110b45=_0x110b45||0xc8;return function(_0x14ec04){if(_0x14ec04){return _0x16e27[_0x741f('0x19')](_0x110b45)[_0x741f('0x1a')](_0x14ec04);}};}function respondWithFilteredResult(_0x301e21,_0x357b8a){return function(_0x4469f0){if(_0x4469f0){var _0x376e86=_0x4469f0[_0x741f('0x1b')],_0x24e3c2=_0x357b8a[_0x741f('0x1c')],_0x5963d3=_0x357b8a[_0x741f('0x1c')]+_0x357b8a['limit'],_0x1ff5e4;if(_0x5963d3>=_0x376e86){_0x5963d3=_0x376e86;_0x1ff5e4=0xc8;}else{_0x1ff5e4=0xce;}_0x301e21[_0x741f('0x19')](_0x1ff5e4);return _0x301e21[_0x741f('0x1d')](_0x741f('0x1e'),_0x24e3c2+'-'+_0x5963d3+'/'+_0x376e86)[_0x741f('0x1a')](_0x4469f0);}return null;};}function patchUpdates(_0x4acb8d){return function(_0x2b8fe4){try{jsonpatch[_0x741f('0x1f')](_0x2b8fe4,_0x4acb8d,!![]);}catch(_0x18c5d5){return BPromise[_0x741f('0x20')](_0x18c5d5);}return _0x2b8fe4[_0x741f('0x21')]();};}function saveUpdates(_0x16f4bc,_0x4a07a6){return function(_0x63a456){if(_0x63a456){return _0x63a456[_0x741f('0x22')](_0x16f4bc)['then'](function(_0xe3f750){return _0xe3f750;});}return null;};}function removeEntity(_0x5f0fb0,_0x12506b){return function(_0x462dcf){if(_0x462dcf){return _0x462dcf[_0x741f('0x23')]()[_0x741f('0x24')](function(){var _0x39eb69=_0x462dcf['get']({'plain':!![]});var _0x11d5f3=_0x741f('0x25');return db[_0x741f('0x26')][_0x741f('0x23')]({'where':{'type':_0x11d5f3,'resourceId':_0x39eb69['id']}})['then'](function(){return _0x462dcf;});})[_0x741f('0x24')](function(){_0x5f0fb0[_0x741f('0x19')](0xcc)[_0x741f('0x18')]();});}};}function handleEntityNotFound(_0x42b296,_0x51a737){return function(_0x9b5567){if(!_0x9b5567){_0x42b296[_0x741f('0x17')](0x194);}return _0x9b5567;};}function handleError(_0x2c5267,_0x212cf1){_0x212cf1=_0x212cf1||0x1f4;return function(_0x159acb){logger[_0x741f('0x27')](_0x159acb['stack']);if(_0x159acb[_0x741f('0x28')]){delete _0x159acb[_0x741f('0x28')];}_0x2c5267[_0x741f('0x19')](_0x212cf1)['send'](_0x159acb);};}exports['index']=function(_0x4d87c3,_0x5143b3){var _0x4cbdf5={},_0x42b688={},_0x4b9868={'count':0x0,'rows':[]};var _0x1241dc=db[_0x741f('0x29')][_0x741f('0x2a')];_0x42b688['model']=_[_0x741f('0x2b')](_0x1241dc);_0x42b688[_0x741f('0x2c')]=_['keys'](_0x4d87c3[_0x741f('0x2c')]);_0x42b688[_0x741f('0x2d')]=_[_0x741f('0x2e')](_0x42b688[_0x741f('0x2f')],_0x42b688['query']);_0x4cbdf5[_0x741f('0x30')]=_[_0x741f('0x2e')](_0x42b688[_0x741f('0x2f')],qs[_0x741f('0x31')](_0x4d87c3[_0x741f('0x2c')]['fields']));_0x4cbdf5[_0x741f('0x30')]=_0x4cbdf5[_0x741f('0x30')]['length']?_0x4cbdf5[_0x741f('0x30')]:_0x42b688[_0x741f('0x2f')];if(!_0x4d87c3[_0x741f('0x2c')][_0x741f('0x32')](_0x741f('0x33'))){_0x4cbdf5[_0x741f('0x34')]=qs[_0x741f('0x34')](_0x4d87c3['query'][_0x741f('0x34')]);_0x4cbdf5[_0x741f('0x1c')]=qs[_0x741f('0x1c')](_0x4d87c3['query'][_0x741f('0x1c')]);}_0x4cbdf5['order']=qs[_0x741f('0x35')](_0x4d87c3[_0x741f('0x2c')][_0x741f('0x35')]);_0x4cbdf5['where']=qs[_0x741f('0x2d')](_[_0x741f('0x36')](_0x4d87c3[_0x741f('0x2c')],_0x42b688[_0x741f('0x2d')]));if(_0x4d87c3[_0x741f('0x2c')][_0x741f('0x37')]){_0x4cbdf5[_0x741f('0x38')]=_[_0x741f('0x39')](_0x4cbdf5[_0x741f('0x38')],{'$or':_[_0x741f('0x3a')](_0x1241dc,function(_0x44ec89){if(_0x44ec89[_0x741f('0x3b')]['key']!==_0x741f('0x3c')){var _0x2de8b5={};_0x2de8b5[_0x44ec89[_0x741f('0x3d')]]={'$like':'%'+_0x4d87c3[_0x741f('0x2c')]['filter']+'%'};return _0x2de8b5;}})});}_0x4cbdf5=_[_0x741f('0x39')]({},_0x4cbdf5,_0x4d87c3[_0x741f('0x3e')]);var _0x511c5a={'where':_0x4cbdf5[_0x741f('0x38')]};return db[_0x741f('0x29')][_0x741f('0x1b')](_0x511c5a)[_0x741f('0x24')](function(_0x2ca4ef){_0x4b9868['count']=_0x2ca4ef;if(_0x4d87c3[_0x741f('0x2c')][_0x741f('0x3f')]){_0x4cbdf5['include']=[{'all':!![]}];}return db[_0x741f('0x29')][_0x741f('0x40')](_0x4cbdf5);})['then'](function(_0x11f98a){_0x4b9868[_0x741f('0x41')]=_0x11f98a;return _0x4b9868;})[_0x741f('0x24')](respondWithFilteredResult(_0x5143b3,_0x4cbdf5))[_0x741f('0x42')](handleError(_0x5143b3,null));};exports['show']=function(_0x3d3ff2,_0x3a5357){var _0xaa9c78={'raw':![],'where':{'id':_0x3d3ff2['params']['id']}},_0xbc2908={};_0xbc2908['model']=_[_0x741f('0x2b')](db['VoiceMusicOnHold'][_0x741f('0x2a')]);_0xbc2908[_0x741f('0x2c')]=_[_0x741f('0x2b')](_0x3d3ff2[_0x741f('0x2c')]);_0xbc2908['filters']=_[_0x741f('0x2e')](_0xbc2908[_0x741f('0x2f')],_0xbc2908[_0x741f('0x2c')]);_0xaa9c78['attributes']=_[_0x741f('0x2e')](_0xbc2908[_0x741f('0x2f')],qs[_0x741f('0x31')](_0x3d3ff2[_0x741f('0x2c')][_0x741f('0x31')]));_0xaa9c78[_0x741f('0x30')]=_0xaa9c78['attributes'][_0x741f('0x43')]?_0xaa9c78[_0x741f('0x30')]:_0xbc2908['model'];if(_0x3d3ff2[_0x741f('0x2c')][_0x741f('0x3f')]){_0xaa9c78[_0x741f('0x44')]=[{'all':!![]}];}_0xaa9c78=_[_0x741f('0x39')]({},_0xaa9c78,_0x3d3ff2[_0x741f('0x3e')]);return db[_0x741f('0x29')]['find'](_0xaa9c78)[_0x741f('0x24')](handleEntityNotFound(_0x3a5357,null))[_0x741f('0x24')](respondWithResult(_0x3a5357,null))[_0x741f('0x42')](handleError(_0x3a5357,null));};exports[_0x741f('0x22')]=function(_0x31aadd,_0x201b78){if(_0x31aadd['body']['id']){delete _0x31aadd[_0x741f('0x45')]['id'];}return db[_0x741f('0x29')]['find']({'where':{'id':_0x31aadd[_0x741f('0x46')]['id']}})[_0x741f('0x24')](handleEntityNotFound(_0x201b78,null))[_0x741f('0x24')](saveUpdates(_0x31aadd['body'],null))[_0x741f('0x24')](respondWithResult(_0x201b78,null))[_0x741f('0x42')](handleError(_0x201b78,null));};exports[_0x741f('0x47')]=function(_0x2e8620,_0x5f2139,_0x2f41c0){return db[_0x741f('0x48')][_0x741f('0x49')](function(_0x4c075b){if(_0x2e8620[_0x741f('0x45')][_0x741f('0x4a')]===_0x741f('0x4b')){_0x2e8620[_0x741f('0x45')][_0x741f('0x4c')]=path[_0x741f('0x4d')](config[_0x741f('0x4e')],_0x741f('0x4f'),_0x2e8620['body']['name']);}return db['VoiceMusicOnHold'][_0x741f('0x47')](_0x2e8620[_0x741f('0x45')],{'transaction':_0x4c075b})['then'](function(_0x23754c){if(_0x2e8620[_0x741f('0x45')][_0x741f('0x4a')]==='files'){fs[_0x741f('0x50')](_0x23754c[_0x741f('0x4c')],parseInt(_0x741f('0x51'),0x8));}var _0x3b757f=_0x2e8620[_0x741f('0x52')][_0x741f('0x53')]({'plain':!![]});if(!_0x3b757f)throw new Error(_0x741f('0x54'));if(_0x3b757f['role']===_0x741f('0x52')){var _0x5604e4=_0x23754c['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x741f('0x25'),'userProfileId':_0x3b757f[_0x741f('0x55')]},'raw':!![]})[_0x741f('0x24')](function(_0x3de54f){if(_0x3de54f&&_0x3de54f[_0x741f('0x56')]===0x0){return db['UserProfileResource'][_0x741f('0x47')]({'name':_0x5604e4[_0x741f('0x28')],'resourceId':_0x5604e4['id'],'type':_0x3de54f['name'],'sectionId':_0x3de54f['id']},{})['then'](function(){return _0x23754c;});}else{return _0x23754c;}})[_0x741f('0x42')](function(_0x259e79){logger[_0x741f('0x27')](_0x741f('0x57'),_0x259e79);});}return _0x23754c;});})[_0x741f('0x24')](respondWithResult(_0x5f2139,0xc9))['catch'](handleError(_0x5f2139,null));};exports[_0x741f('0x23')]=function(_0x5c8de1,_0x47e300,_0xaa15f7){var _0xb4c79;return db[_0x741f('0x29')][_0x741f('0x58')]({'where':{'id':_0x5c8de1['params']['id']}})[_0x741f('0x24')](function(_0x50aa87){if(_0x50aa87){return db[_0x741f('0x48')]['transaction'](function(_0x11611f){return _0x50aa87['destroy']({'transaction':_0x11611f,'raw':!![]})[_0x741f('0x24')](function(_0x5a53ff){if(_0x5a53ff[_0x741f('0x4c')]){fs[_0x741f('0x59')](_0x5a53ff[_0x741f('0x4c')])[_0x741f('0x5a')](function(_0x5b9192){fs[_0x741f('0x5b')](path[_0x741f('0x4d')](_0x5a53ff[_0x741f('0x4c')],_0x5b9192));});fs[_0x741f('0x5c')](_0x5a53ff[_0x741f('0x4c')]);}return _0x5a53ff;});})[_0x741f('0x42')](function(_0x1665ab){throw new db[(_0x741f('0x5d'))]['ValidationError'](_0x1665ab[_0x741f('0x5e')]);});}})['then'](handleEntityNotFound(_0x47e300,null))['then'](removeEntity(_0x47e300,null))['catch'](handleError(_0x47e300,null));};exports[_0x741f('0x5f')]=function(_0x4227b0,_0x476f70,_0x5e4bd0){return db[_0x741f('0x48')][_0x741f('0x49')](function(_0x1da4f6){var _0x568794;return db[_0x741f('0x29')][_0x741f('0x58')]({'where':{'id':_0x4227b0['params']['id']}})[_0x741f('0x24')](function(_0x1caa07){if(_0x1caa07){_0x568794=_0x1caa07;return _0x1caa07[_0x741f('0x5f')](_0x4227b0[_0x741f('0x45')]['id'],{'transaction':_0x1da4f6});}})[_0x741f('0x24')](function(_0xf831a8){if(_0xf831a8){return db[_0x741f('0x60')][_0x741f('0x61')]({'where':{'id':_0x4227b0[_0x741f('0x45')]['id']},'attributes':['id',_0x741f('0x28'),_0x741f('0x62'),_0x741f('0x63'),_0x741f('0x64')],'raw':!![]});}})[_0x741f('0x24')](function(_0x3af4f5){if(_0x3af4f5){var _0x355f3d=path[_0x741f('0x4d')](config[_0x741f('0x4e')],_0x741f('0x65'),util[_0x741f('0x66')](_0x741f('0x67'),path[_0x741f('0x68')](_0x3af4f5[_0x741f('0x62')],path[_0x741f('0x69')](_0x3af4f5[_0x741f('0x62')])),_0x3af4f5[_0x741f('0x63')]));var _0x5830c7=path['join'](config[_0x741f('0x4e')],_0x741f('0x4f'),_0x568794[_0x741f('0x28')],util[_0x741f('0x66')](_0x741f('0x67'),_0x3af4f5[_0x741f('0x28')],_0x3af4f5[_0x741f('0x63')]));fs[_0x741f('0x6a')](_0x355f3d,_0x5830c7);return _0x3af4f5;}})[_0x741f('0x42')](function(_0x4b15c4){throw new db[(_0x741f('0x5d'))]['ValidationError'](_0x4b15c4[_0x741f('0x5e')]);});})['then'](handleEntityNotFound(_0x476f70,null))[_0x741f('0x24')](respondWithResult(_0x476f70,0xc9))[_0x741f('0x42')](handleError(_0x476f70,null));};exports[_0x741f('0x6b')]=function(_0x150cf6,_0x4f0d61,_0x358214){return db[_0x741f('0x48')]['transaction'](function(_0x1c8c17){var _0x3b4d85;return db['VoiceMusicOnHold'][_0x741f('0x61')]({'where':{'id':_0x150cf6['params']['id']}})[_0x741f('0x24')](handleEntityNotFound(_0x4f0d61,null))[_0x741f('0x24')](function(_0x37a139){if(_0x37a139){_0x3b4d85=_0x37a139;return _0x37a139[_0x741f('0x6b')](_0x150cf6['params'][_0x741f('0x6c')]);}})[_0x741f('0x24')](function(_0x4ffc66){if(_0x4ffc66){return db['Sound'][_0x741f('0x61')]({'where':{'id':_0x150cf6[_0x741f('0x46')]['id2']},'attributes':['id','name',_0x741f('0x62'),'converted_format',_0x741f('0x64')],'raw':!![]});}})[_0x741f('0x24')](function(_0x3259c7){if(_0x3259c7){fs[_0x741f('0x5b')](path['join'](_0x3b4d85[_0x741f('0x4c')],util[_0x741f('0x66')](_0x741f('0x67'),_0x3259c7[_0x741f('0x28')],_0x3259c7['converted_format'])));return _0x3259c7;}})[_0x741f('0x42')](function(_0x43e393){throw new db[(_0x741f('0x5d'))][(_0x741f('0x6d'))](_0x43e393['message']);});})[_0x741f('0x24')](handleEntityNotFound(_0x4f0d61,null))['then'](respondWithStatusCode(_0x4f0d61,0xcc))['catch'](handleError(_0x4f0d61,null));};exports['getSounds']=function(_0x5d9459,_0x1a40c4,_0x2d4cf9){var _0x35b002={};var _0x354ce0={};var _0x1ea3c0;var _0x2a6e1b;return db[_0x741f('0x29')][_0x741f('0x61')]({'where':{'id':_0x5d9459[_0x741f('0x46')]['id']}})[_0x741f('0x24')](handleEntityNotFound(_0x1a40c4,null))[_0x741f('0x24')](function(_0x425b40){if(_0x425b40){_0x1ea3c0=_0x425b40;_0x354ce0['model']=_['keys'](db['Sound'][_0x741f('0x2a')]);_0x354ce0['query']=_[_0x741f('0x2b')](_0x5d9459['query']);_0x354ce0['filters']=_[_0x741f('0x2e')](_0x354ce0[_0x741f('0x2f')],_0x354ce0[_0x741f('0x2c')]);_0x35b002[_0x741f('0x30')]=_[_0x741f('0x2e')](_0x354ce0[_0x741f('0x2f')],qs[_0x741f('0x31')](_0x5d9459['query']['fields']));_0x35b002[_0x741f('0x30')]=_0x35b002[_0x741f('0x30')][_0x741f('0x43')]?_0x35b002[_0x741f('0x30')]:_0x354ce0[_0x741f('0x2f')];_0x35b002['order']=qs['sort'](_0x5d9459[_0x741f('0x2c')][_0x741f('0x35')]);_0x35b002[_0x741f('0x38')]=qs[_0x741f('0x2d')](_[_0x741f('0x36')](_0x5d9459[_0x741f('0x2c')],_0x354ce0['filters']));if(_0x5d9459['query'][_0x741f('0x37')]){_0x35b002[_0x741f('0x38')]=_['merge'](_0x35b002[_0x741f('0x38')],{'$or':_[_0x741f('0x3a')](_0x35b002[_0x741f('0x30')],function(_0x4205f8){var _0x56a6ec={};_0x56a6ec[_0x4205f8]={'$like':'%'+_0x5d9459[_0x741f('0x2c')][_0x741f('0x37')]+'%'};return _0x56a6ec;})});}_0x35b002=_[_0x741f('0x39')]({},_0x35b002,_0x5d9459[_0x741f('0x3e')]);return _0x1ea3c0[_0x741f('0x6e')](_0x35b002);}})[_0x741f('0x24')](function(_0x8fbb1){if(_0x8fbb1){_0x2a6e1b=_0x8fbb1[_0x741f('0x43')];if(!_0x5d9459[_0x741f('0x2c')][_0x741f('0x32')](_0x741f('0x33'))){_0x35b002['limit']=qs[_0x741f('0x34')](_0x5d9459[_0x741f('0x2c')][_0x741f('0x34')]);_0x35b002[_0x741f('0x1c')]=qs[_0x741f('0x1c')](_0x5d9459[_0x741f('0x2c')]['offset']);}return _0x1ea3c0[_0x741f('0x6e')](_0x35b002);}})[_0x741f('0x24')](function(_0x564a53){if(_0x564a53){return _0x564a53?{'count':_0x2a6e1b,'rows':_0x564a53}:null;}})[_0x741f('0x24')](respondWithResult(_0x1a40c4,null))['catch'](handleError(_0x1a40c4,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index e544486..408cf03 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c8e=['VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x1c8e,0x12b));var _0xe1c8=function(_0x3f6b47,_0x1256d8){_0x3f6b47=_0x3f6b47-0x0;var _0x3c70ec=_0x1c8e[_0x3f6b47];return _0x3c70ec;};'use strict';var _=require(_0xe1c8('0x0'));var util=require('util');var logger=require(_0xe1c8('0x1'))(_0xe1c8('0x2'));var moment=require(_0xe1c8('0x3'));var BPromise=require(_0xe1c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1c8('0x5'));var rimraf=require(_0xe1c8('0x6'));var config=require(_0xe1c8('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x3e347e,_0x1bbde5){return _0x3e347e[_0xe1c8('0x8')](_0xe1c8('0x9'),attributes,{'tableName':_0xe1c8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcad=['exports','define','voice_musiconhold','util','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5baa1f,_0x4fe688){var _0x2d3a23=function(_0x375f98){while(--_0x375f98){_0x5baa1f['push'](_0x5baa1f['shift']());}};_0x2d3a23(++_0x4fe688);}(_0xbcad,0x78));var _0xdbca=function(_0x3a9f4d,_0x1f49a2){_0x3a9f4d=_0x3a9f4d-0x0;var _0x2a7a3b=_0xbcad[_0x3a9f4d];return _0x2a7a3b;};'use strict';var _=require('lodash');var util=require(_0xdbca('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xdbca('0x1'));var BPromise=require(_0xdbca('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbca('0x3'));var rimraf=require(_0xdbca('0x4'));var config=require(_0xdbca('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xdbca('0x6')]=function(_0x59a4e3,_0x212e32){return _0x59a4e3[_0xdbca('0x7')]('VoiceMusicOnHold',attributes,{'tableName':_0xdbca('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index f69b244..6e7a4e1 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf851=['error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0xf851,0x6f));var _0x1f85=function(_0x6cfb8a,_0x53be6f){_0x6cfb8a=_0x6cfb8a-0x0;var _0x29ba1d=_0xf851[_0x6cfb8a];return _0x29ba1d;};'use strict';var _=require('lodash');var util=require(_0x1f85('0x0'));var moment=require(_0x1f85('0x1'));var BPromise=require(_0x1f85('0x2'));var rs=require(_0x1f85('0x3'));var fs=require('fs');var Redis=require(_0x1f85('0x4'));var db=require(_0x1f85('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f85('0x6'))(_0x1f85('0x7'));var config=require(_0x1f85('0x8'));var jayson=require(_0x1f85('0x9'));var client=jayson[_0x1f85('0xa')][_0x1f85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41fc8d,_0x5ab30f,_0x31fe1c){return new BPromise(function(_0x5df7ae,_0x313b8){return client[_0x1f85('0xc')](_0x41fc8d,_0x31fe1c)['then'](function(_0x1b0630){logger[_0x1f85('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5ab30f,_0x1f85('0xe'));logger['debug']('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x5ab30f,_0x1f85('0xe'),JSON['stringify'](_0x1b0630));if(_0x1b0630[_0x1f85('0xf')]){if(_0x1b0630['error'][_0x1f85('0x10')]===0x1f4){logger['error'](_0x1f85('0x11'),_0x5ab30f,_0x1b0630['error'][_0x1f85('0x12')]);return _0x313b8(_0x1b0630['error']['message']);}logger[_0x1f85('0xf')](_0x1f85('0x11'),_0x5ab30f,_0x1b0630[_0x1f85('0xf')][_0x1f85('0x12')]);return _0x5df7ae(_0x1b0630['error'][_0x1f85('0x12')]);}else{logger[_0x1f85('0xd')](_0x1f85('0x11'),_0x5ab30f,'request\x20sent');_0x5df7ae(_0x1b0630[_0x1f85('0x13')][_0x1f85('0x12')]);}})[_0x1f85('0x14')](function(_0x23d8b3){logger[_0x1f85('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5ab30f,_0x23d8b3);_0x313b8(_0x23d8b3);});});} \ No newline at end of file +var _0xf81b=['then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0xf81b,0x109));var _0xbf81=function(_0x2c24aa,_0x488c07){_0x2c24aa=_0x2c24aa-0x0;var _0x477fbe=_0xf81b[_0x2c24aa];return _0x477fbe;};'use strict';var _=require('lodash');var util=require(_0xbf81('0x0'));var moment=require(_0xbf81('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf81('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf81('0x3'))['db'];var utils=require(_0xbf81('0x4'));var logger=require(_0xbf81('0x5'))(_0xbf81('0x6'));var config=require(_0xbf81('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbf81('0x8')][_0xbf81('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21338e,_0x53c282,_0x3c5ba7){return new BPromise(function(_0x1b8bdc,_0x5dbda4){return client[_0xbf81('0xa')](_0x21338e,_0x3c5ba7)[_0xbf81('0xb')](function(_0x141a0f){logger[_0xbf81('0xc')](_0xbf81('0xd'),_0x53c282,_0xbf81('0xe'));logger[_0xbf81('0xf')](_0xbf81('0x10'),_0x53c282,_0xbf81('0xe'),JSON[_0xbf81('0x11')](_0x141a0f));if(_0x141a0f[_0xbf81('0x12')]){if(_0x141a0f[_0xbf81('0x12')][_0xbf81('0x13')]===0x1f4){logger[_0xbf81('0x12')](_0xbf81('0xd'),_0x53c282,_0x141a0f[_0xbf81('0x12')][_0xbf81('0x14')]);return _0x5dbda4(_0x141a0f[_0xbf81('0x12')][_0xbf81('0x14')]);}logger[_0xbf81('0x12')](_0xbf81('0xd'),_0x53c282,_0x141a0f[_0xbf81('0x12')][_0xbf81('0x14')]);return _0x1b8bdc(_0x141a0f[_0xbf81('0x12')][_0xbf81('0x14')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x53c282,_0xbf81('0xe'));_0x1b8bdc(_0x141a0f[_0xbf81('0x15')][_0xbf81('0x14')]);}})[_0xbf81('0x16')](function(_0x5cacf4){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x53c282,_0x5cacf4);_0x5dbda4(_0x5cacf4);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 6df8e97..da35337 100644 --- a/server/api/voicePrefix/index.js +++ b/server/api/voicePrefix/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb74b=['removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','/:id/users','post','addAgents','put','update','destroy'];(function(_0x387059,_0xbf706c){var _0x2fe2c4=function(_0x248a4b){while(--_0x248a4b){_0x387059['push'](_0x387059['shift']());}};_0x2fe2c4(++_0xbf706c);}(_0xb74b,0xf9));var _0xbb74=function(_0x11e000,_0x12a8e5){_0x11e000=_0x11e000-0x0;var _0x110c27=_0xb74b[_0x11e000];return _0x110c27;};'use strict';var multer=require(_0xbb74('0x0'));var util=require(_0xbb74('0x1'));var path=require(_0xbb74('0x2'));var timeout=require('connect-timeout');var express=require(_0xbb74('0x3'));var router=express['Router']();var auth=require(_0xbb74('0x4'));var interaction=require(_0xbb74('0x5'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0xbb74('0x6')]('/',auth[_0xbb74('0x7')](),controller['index']);router[_0xbb74('0x6')]('/describe',auth[_0xbb74('0x7')](),controller[_0xbb74('0x8')]);router[_0xbb74('0x6')](_0xbb74('0x9'),auth[_0xbb74('0x7')](),controller[_0xbb74('0xa')]);router[_0xbb74('0x6')](_0xbb74('0xb'),auth[_0xbb74('0x7')](),controller['getAgents']);router[_0xbb74('0xc')]('/',auth[_0xbb74('0x7')](),controller['create']);router['post'](_0xbb74('0xb'),auth['isAuthenticated'](),controller[_0xbb74('0xd')]);router[_0xbb74('0xe')](_0xbb74('0x9'),auth[_0xbb74('0x7')](),controller[_0xbb74('0xf')]);router['delete'](_0xbb74('0x9'),auth['isAuthenticated'](),controller[_0xbb74('0x10')]);router['delete']('/:id/users',auth[_0xbb74('0x7')](),controller[_0xbb74('0x11')]);module[_0xbb74('0x12')]=router; \ No newline at end of file +var _0x7d4f=['addAgents','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','describe','/:id','/:id/users','create','post'];(function(_0x2519bd,_0x200a9b){var _0x61e3d7=function(_0x882ec3){while(--_0x882ec3){_0x2519bd['push'](_0x2519bd['shift']());}};_0x61e3d7(++_0x200a9b);}(_0x7d4f,0xbd));var _0xf7d4=function(_0x18bebd,_0x32f07a){_0x18bebd=_0x18bebd-0x0;var _0x42524b=_0x7d4f[_0x18bebd];return _0x42524b;};'use strict';var multer=require(_0xf7d4('0x0'));var util=require(_0xf7d4('0x1'));var path=require(_0xf7d4('0x2'));var timeout=require(_0xf7d4('0x3'));var express=require(_0xf7d4('0x4'));var router=express[_0xf7d4('0x5')]();var auth=require(_0xf7d4('0x6'));var interaction=require(_0xf7d4('0x7'));var config=require(_0xf7d4('0x8'));var controller=require(_0xf7d4('0x9'));router[_0xf7d4('0xa')]('/',auth[_0xf7d4('0xb')](),controller['index']);router['get'](_0xf7d4('0xc'),auth['isAuthenticated'](),controller[_0xf7d4('0xd')]);router[_0xf7d4('0xa')](_0xf7d4('0xe'),auth[_0xf7d4('0xb')](),controller['show']);router[_0xf7d4('0xa')](_0xf7d4('0xf'),auth[_0xf7d4('0xb')](),controller['getAgents']);router['post']('/',auth[_0xf7d4('0xb')](),controller[_0xf7d4('0x10')]);router[_0xf7d4('0x11')](_0xf7d4('0xf'),auth['isAuthenticated'](),controller[_0xf7d4('0x12')]);router['put'](_0xf7d4('0xe'),auth[_0xf7d4('0xb')](),controller[_0xf7d4('0x13')]);router[_0xf7d4('0x14')](_0xf7d4('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xf7d4('0x14')](_0xf7d4('0xf'),auth['isAuthenticated'](),controller[_0xf7d4('0x15')]);module[_0xf7d4('0x16')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 9331f71..e14a325 100644 --- a/server/api/voicePrefix/voicePrefix.attributes.js +++ b/server/api/voicePrefix/voicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79e3=['name','exports','STRING','VIRTUAL','system-','getDataValue'];(function(_0x57ffa0,_0x57e3ce){var _0x2c352c=function(_0x3882f6){while(--_0x3882f6){_0x57ffa0['push'](_0x57ffa0['shift']());}};_0x2c352c(++_0x57e3ce);}(_0x79e3,0x157));var _0x379e=function(_0xa696a9,_0x4fea71){_0xa696a9=_0xa696a9-0x0;var _0x3d39ce=_0x79e3[_0xa696a9];return _0x3d39ce;};'use strict';var Sequelize=require('sequelize');module[_0x379e('0x0')]={'name':{'type':Sequelize[_0x379e('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x379e('0x2')],'get':function(_0x2be262){return _0x379e('0x3')+this[_0x379e('0x4')](_0x379e('0x5'))+'-';}},'description':{'type':Sequelize[_0x379e('0x1')]},'callerIdAll':{'type':Sequelize[_0x379e('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x534d=['INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x15d401,_0x196527){var _0x1b2a46=function(_0x48eefb){while(--_0x48eefb){_0x15d401['push'](_0x15d401['shift']());}};_0x1b2a46(++_0x196527);}(_0x534d,0x79));var _0xd534=function(_0x2b5227,_0x3a24af){_0x2b5227=_0x2b5227-0x0;var _0x5c8913=_0x534d[_0x2b5227];return _0x5c8913;};'use strict';var Sequelize=require(_0xd534('0x0'));module[_0xd534('0x1')]={'name':{'type':Sequelize[_0xd534('0x2')],'allowNull':![],'unique':_0xd534('0x3')},'prefix':{'type':Sequelize[_0xd534('0x4')],'get':function(_0xedc863){return _0xd534('0x5')+this[_0xd534('0x6')](_0xd534('0x3'))+'-';}},'description':{'type':Sequelize[_0xd534('0x2')]},'callerIdAll':{'type':Sequelize[_0xd534('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xd534('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 5ff2681..2e04f4d 100644 --- a/server/api/voicePrefix/voicePrefix.controller.js +++ b/server/api/voicePrefix/voicePrefix.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['catch','describe','create','transaction','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','VoicePrefixId','VoiceExtension','get','map','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','system-','addAgents','omit','spread','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','VoicePrefixes','end','error','name','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','VoicePrefix','findAll','rows','params','find'];(function(_0x17a2f3,_0x92db94){var _0x1affd2=function(_0x467911){while(--_0x467911){_0x17a2f3['push'](_0x17a2f3['shift']());}};_0x1affd2(++_0x92db94);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var hardwareService=require(_0x0d8b('0x11'));var logger=require(_0x0d8b('0x12'))('api');var utils=require(_0x0d8b('0x13'));var config=require('../../config/environment');var db=require(_0x0d8b('0x14'))['db'];config[_0x0d8b('0x15')]=_[_0x0d8b('0x16')](config[_0x0d8b('0x15')],{'host':_0x0d8b('0x17'),'port':0x18eb});var socket=require(_0x0d8b('0x18'))(new Redis(config[_0x0d8b('0x15')]));require(_0x0d8b('0x19'))[_0x0d8b('0x1a')](socket);function respondWithStatusCode(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xcc;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x1b')](_0x5ad086);}return _0x2ce75e[_0x0d8b('0x1c')](_0x5ad086)['end']();};}function respondWithResult(_0x23eb7b,_0xa86349){_0xa86349=_0xa86349||0xc8;return function(_0x17f7df){if(_0x17f7df){return _0x23eb7b[_0x0d8b('0x1c')](_0xa86349)[_0x0d8b('0x1d')](_0x17f7df);}};}function respondWithFilteredResult(_0x5cd485,_0x106a01){return function(_0x4586c2){if(_0x4586c2){var _0x2fd0fc=_0x4586c2[_0x0d8b('0x1e')],_0x5fecbd=_0x106a01[_0x0d8b('0x1f')],_0x333674=_0x106a01['offset']+_0x106a01[_0x0d8b('0x20')],_0x18dd2d;if(_0x333674>=_0x2fd0fc){_0x333674=_0x2fd0fc;_0x18dd2d=0xc8;}else{_0x18dd2d=0xce;}_0x5cd485[_0x0d8b('0x1c')](_0x18dd2d);return _0x5cd485[_0x0d8b('0x21')](_0x0d8b('0x22'),_0x5fecbd+'-'+_0x333674+'/'+_0x2fd0fc)[_0x0d8b('0x1d')](_0x4586c2);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x23')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x24')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x25')](_0x54a9a7)[_0x0d8b('0x26')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x27')]()[_0x0d8b('0x26')](function(){var _0x27b695=_0x2c64e2['get']({'plain':!![]});var _0xe8bbee=_0x0d8b('0x28');return db['UserProfileResource'][_0x0d8b('0x27')]({'where':{'type':_0xe8bbee,'resourceId':_0x27b695['id']}})['then'](function(){return _0x2c64e2;});})[_0x0d8b('0x26')](function(){_0x38efc8[_0x0d8b('0x1c')](0xcc)[_0x0d8b('0x29')]();});}};}function handleEntityNotFound(_0x4fe6f9,_0x59a905){return function(_0x28f639){if(!_0x28f639){_0x4fe6f9[_0x0d8b('0x1b')](0x194);}return _0x28f639;};}function handleError(_0x4c05ee,_0xcbc4ac){_0xcbc4ac=_0xcbc4ac||0x1f4;return function(_0x59aa83){logger[_0x0d8b('0x2a')](_0x59aa83['stack']);if(_0x59aa83[_0x0d8b('0x2b')]){delete _0x59aa83['name'];}_0x4c05ee[_0x0d8b('0x1c')](_0xcbc4ac)['send'](_0x59aa83);};}exports[_0x0d8b('0x2c')]=function(_0x544735,_0x3c8887){var _0x106e4c={},_0x2c058d={},_0x56120a={'count':0x0,'rows':[]};var _0x4c80a2=db['VoicePrefix'][_0x0d8b('0x2d')];_0x2c058d['model']=_[_0x0d8b('0x2e')](_0x4c80a2);_0x2c058d['query']=_['keys'](_0x544735[_0x0d8b('0x2f')]);_0x2c058d[_0x0d8b('0x30')]=_[_0x0d8b('0x31')](_0x2c058d[_0x0d8b('0x32')],_0x2c058d[_0x0d8b('0x2f')]);_0x106e4c[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0x2c058d[_0x0d8b('0x32')],qs['fields'](_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x34')]));_0x106e4c['attributes']=_0x106e4c[_0x0d8b('0x33')][_0x0d8b('0x35')]?_0x106e4c[_0x0d8b('0x33')]:_0x2c058d['model'];if(!_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x36')](_0x0d8b('0x37'))){_0x106e4c[_0x0d8b('0x20')]=qs[_0x0d8b('0x20')](_0x544735['query'][_0x0d8b('0x20')]);_0x106e4c[_0x0d8b('0x1f')]=qs['offset'](_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x1f')]);}_0x106e4c[_0x0d8b('0x38')]=qs[_0x0d8b('0x39')](_0x544735[_0x0d8b('0x2f')]['sort']);_0x106e4c['where']=qs[_0x0d8b('0x30')](_['pick'](_0x544735['query'],_0x2c058d[_0x0d8b('0x30')]));if(_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x3a')]){_0x106e4c[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x106e4c[_0x0d8b('0x3b')],{'$or':_['map'](_0x4c80a2,function(_0x6e5bab){if(_0x6e5bab[_0x0d8b('0x3d')][_0x0d8b('0x3e')]!==_0x0d8b('0x3f')){var _0x338ed3={};_0x338ed3[_0x6e5bab[_0x0d8b('0x40')]]={'$like':'%'+_0x544735[_0x0d8b('0x2f')]['filter']+'%'};return _0x338ed3;}})});}_0x106e4c=_[_0x0d8b('0x3c')]({},_0x106e4c,_0x544735[_0x0d8b('0x41')]);var _0x3fa955={'where':_0x106e4c[_0x0d8b('0x3b')]};return db['VoicePrefix'][_0x0d8b('0x1e')](_0x3fa955)['then'](function(_0x37b26c){_0x56120a[_0x0d8b('0x1e')]=_0x37b26c;if(_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x42')]){_0x106e4c[_0x0d8b('0x43')]=[{'all':!![]}];}return db[_0x0d8b('0x44')][_0x0d8b('0x45')](_0x106e4c);})[_0x0d8b('0x26')](function(_0x89ab0d){_0x56120a[_0x0d8b('0x46')]=_0x89ab0d;return _0x56120a;})['then'](respondWithFilteredResult(_0x3c8887,_0x106e4c))['catch'](handleError(_0x3c8887,null));};exports['show']=function(_0x4d0811,_0x524d79){var _0x1a46f6={'raw':![],'where':{'id':_0x4d0811[_0x0d8b('0x47')]['id']}},_0x402fe0={};_0x402fe0['model']=_['keys'](db[_0x0d8b('0x44')][_0x0d8b('0x2d')]);_0x402fe0[_0x0d8b('0x2f')]=_['keys'](_0x4d0811[_0x0d8b('0x2f')]);_0x402fe0[_0x0d8b('0x30')]=_['intersection'](_0x402fe0['model'],_0x402fe0[_0x0d8b('0x2f')]);_0x1a46f6['attributes']=_[_0x0d8b('0x31')](_0x402fe0['model'],qs['fields'](_0x4d0811[_0x0d8b('0x2f')][_0x0d8b('0x34')]));_0x1a46f6['attributes']=_0x1a46f6['attributes']['length']?_0x1a46f6['attributes']:_0x402fe0[_0x0d8b('0x32')];if(_0x4d0811[_0x0d8b('0x2f')][_0x0d8b('0x42')]){_0x1a46f6['include']=[{'all':!![]}];}_0x1a46f6=_[_0x0d8b('0x3c')]({},_0x1a46f6,_0x4d0811[_0x0d8b('0x41')]);return db[_0x0d8b('0x44')][_0x0d8b('0x48')](_0x1a46f6)[_0x0d8b('0x26')](handleEntityNotFound(_0x524d79,null))[_0x0d8b('0x26')](respondWithResult(_0x524d79,null))[_0x0d8b('0x49')](handleError(_0x524d79,null));};exports[_0x0d8b('0x27')]=function(_0x384a5e,_0x1f2077){return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x384a5e[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x1f2077,null))[_0x0d8b('0x26')](removeEntity(_0x1f2077,null))[_0x0d8b('0x49')](handleError(_0x1f2077,null));};exports[_0x0d8b('0x4a')]=function(_0x1e162c,_0x408bc5){return db['VoicePrefix'][_0x0d8b('0x4a')]()['then'](respondWithResult(_0x408bc5,null))['catch'](handleError(_0x408bc5,null));};exports[_0x0d8b('0x4b')]=function(_0x113fb7,_0x3f943a){var _0x4396b5;return db['sequelize'][_0x0d8b('0x4c')](function(_0x1106d6){return db[_0x0d8b('0x44')][_0x0d8b('0x4b')](_0x113fb7[_0x0d8b('0x4d')],{'transaction':_0x1106d6})['then'](function(_0x5c0824){_0x4396b5=_0x5c0824['get']({'plain':!![]});return db['VoiceExtension'][_0x0d8b('0x48')]({'where':{'id':_0x4396b5[_0x0d8b('0x4e')]},'raw':!![]})['then'](function(_0x4950a8){return createVoicePrefixExtensions(_0x4396b5,_0x4950a8,_0x1106d6);});});})[_0x0d8b('0x26')](function(){var _0x3d3cb6=_0x113fb7['user']['get']({'plain':!![]});if(!_0x3d3cb6)throw new Error(_0x0d8b('0x4f'));if(_0x3d3cb6[_0x0d8b('0x50')]===_0x0d8b('0x51')){var _0x346c0d=_0x4396b5;return db[_0x0d8b('0x52')]['find']({'where':{'name':_0x0d8b('0x28'),'userProfileId':_0x3d3cb6[_0x0d8b('0x53')]},'raw':!![]})['then'](function(_0x580580){if(_0x580580&&_0x580580[_0x0d8b('0x54')]===0x0){return db[_0x0d8b('0x55')]['create']({'name':_0x346c0d['name'],'resourceId':_0x346c0d['id'],'type':_0x580580[_0x0d8b('0x2b')],'sectionId':_0x580580['id']},{})[_0x0d8b('0x26')](function(){return _0x4396b5;});}else{return _0x4396b5;}})[_0x0d8b('0x49')](function(_0xb58818){logger['error'](_0x0d8b('0x56'),_0xb58818);throw _0xb58818;});}return _0x4396b5;})['then'](respondWithResult(_0x3f943a,null))['catch'](handleError(_0x3f943a,null));};function Extension(_0x38c24e,_0x44043b,_0x54aa03,_0x4a8f33){this[_0x0d8b('0x57')]=_0x0d8b('0x58');this[_0x0d8b('0x59')]=_0x38c24e;this[_0x0d8b('0x5a')]=_0x54aa03;this[_0x0d8b('0x3d')]=_0x0d8b('0x5b');this[_0x0d8b('0x5c')]=_0x0d8b('0x5d');this['priority']=_0x44043b;this[_0x0d8b('0x5e')]=_0x4a8f33;}function createVoicePrefixExtensions(_0x37dc9f,_0x3a3d33,_0x3c7efb){return new BPromise(function(_0x3fb9ea,_0x47104e){var _0x70c8c4=new Extension(formatPrefixName(_0x37dc9f[_0x0d8b('0x5f')]),0x1,_0x0d8b('0x60'),'Voice\x20Prefix');_0x70c8c4[_0x0d8b('0x61')]=_0x37dc9f['id'];return db[_0x0d8b('0x62')][_0x0d8b('0x4b')](_0x70c8c4,{'transaction':_0x3c7efb})[_0x0d8b('0x26')](function(_0x43ad22){var _0x577951=_0x43ad22[_0x0d8b('0x63')]({'plain':!![]});var _0x2d6284=_[_0x0d8b('0x64')](addVoicePrefixExtensions(_0x37dc9f,_0x3a3d33),function(_0x17a87f){_0x17a87f[_0x0d8b('0x4e')]=_0x577951['id'];_0x17a87f['VoicePrefixId']=_0x37dc9f['id'];return _0x17a87f;});return db['VoiceExtension'][_0x0d8b('0x65')](_0x2d6284,{'transaction':_0x3c7efb})[_0x0d8b('0x26')](function(_0x3e4a41){if(!_0x3e4a41){return _0x47104e(_0x0d8b('0x66'));}else{return _0x3fb9ea(_0x3e4a41);}})['catch'](function(_0x199122){return _0x47104e(_0x199122);});});;});};function addVoicePrefixExtensions(_0x12aef7,_0x8c0bbe){var _0x5952dd=[];var _0x2f19f4=formatPrefixName(_0x12aef7['prefix']);_0x5952dd[_0x0d8b('0x67')](new Extension(_0x2f19f4,0x2,_0x0d8b('0x68'),_0x0d8b('0x69')+_0x12aef7[_0x0d8b('0x2b')]));if(_0x12aef7[_0x0d8b('0x6a')]){_0x5952dd[_0x0d8b('0x67')](new Extension(_0x2f19f4,0x3,'Set',_0x0d8b('0x6b')+_0x12aef7['callerIdAll']));}else{_0x5952dd[_0x0d8b('0x67')](new Extension(_0x2f19f4,0x3,_0x0d8b('0x60'),_0x0d8b('0x6c')));}_0x5952dd[_0x0d8b('0x67')](new Extension(_0x2f19f4,0x4,'goto',_0x8c0bbe[_0x0d8b('0x57')]+','+_0x0d8b('0x6d')+(0x8+_0x12aef7[_0x0d8b('0x2b')][_0x0d8b('0x35')])+'}'+','+0x1));return _0x5952dd;}function formatPrefixName(_0x2ccdae){var _0x273aef='_';for(var _0x223fd8=0x0;_0x223fd8<_0x2ccdae[_0x0d8b('0x35')];_0x223fd8++){if(_0x2ccdae[_0x0d8b('0x6e')](_0x223fd8)=='-'){_0x273aef+=_0x2ccdae[_0x0d8b('0x6e')](_0x223fd8);}else{_0x273aef+='['+_0x2ccdae['charAt'](_0x223fd8)+']';}}_0x273aef+='.';return _0x273aef;}exports['update']=function(_0x6388ae,_0x3eb647,_0x53e399){var _0xb1aa96=_0x6388ae['body'];_0xb1aa96['prefix']=_0x0d8b('0x6f')+_0xb1aa96[_0x0d8b('0x2b')]+'-';return db['sequelize']['transaction'](function(_0x1900e3){return db[_0x0d8b('0x44')][_0x0d8b('0x25')](_0xb1aa96,{'where':{'id':_0xb1aa96['id']},'transaction':_0x1900e3})[_0x0d8b('0x26')](function(){return db[_0x0d8b('0x62')][_0x0d8b('0x27')]({'where':{'VoicePrefixId':_0xb1aa96['id']},'transaction':_0x1900e3})[_0x0d8b('0x26')](function(){return db['VoiceExtension'][_0x0d8b('0x48')]({'where':{'id':_0xb1aa96['VoiceExtensionId']},'raw':!![]})[_0x0d8b('0x26')](function(_0x2c6242){return createVoicePrefixExtensions(_0xb1aa96,_0x2c6242,_0x1900e3);});});});})[_0x0d8b('0x26')](function(){return db[_0x0d8b('0x44')]['findById'](_0xb1aa96['id']);})[_0x0d8b('0x26')](respondWithResult(_0x3eb647,null))['catch'](handleError(_0x3eb647,null));};exports[_0x0d8b('0x70')]=function(_0x2c6c5f,_0x1c5fe2,_0x2ebea3){return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x2c6c5f[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x1c5fe2,null))[_0x0d8b('0x26')](function(_0x44aa74){if(_0x44aa74){return _0x44aa74['addAgents'](_0x2c6c5f[_0x0d8b('0x4d')]['ids'],_[_0x0d8b('0x71')](_0x2c6c5f[_0x0d8b('0x4d')],['ids','id'])||{})[_0x0d8b('0x72')](function(_0x56e03c){for(var _0x10c318=0x0;_0x10c318<_0x2c6c5f[_0x0d8b('0x4d')][_0x0d8b('0x73')][_0x0d8b('0x35')];_0x10c318+=0x1){socket[_0x0d8b('0x74')](_0x0d8b('0x75'),{'UserId':_0x2c6c5f[_0x0d8b('0x4d')][_0x0d8b('0x73')][_0x10c318],'VoicePrefixId':_0x2c6c5f['params']['id']});}return _0x56e03c;});}})[_0x0d8b('0x26')](respondWithResult(_0x1c5fe2,null))[_0x0d8b('0x49')](handleError(_0x1c5fe2,null));};exports['removeAgents']=function(_0x191a5a,_0x105df9,_0x303d6){return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x191a5a[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x105df9,null))[_0x0d8b('0x26')](function(_0x466082){if(_0x466082){return _0x466082[_0x0d8b('0x76')](_0x191a5a[_0x0d8b('0x2f')][_0x0d8b('0x73')])['then'](function(){if(_[_0x0d8b('0x77')](_0x191a5a[_0x0d8b('0x2f')][_0x0d8b('0x73')])){for(var _0x58525c=0x0;_0x58525c<_0x191a5a['query'][_0x0d8b('0x73')][_0x0d8b('0x35')];_0x58525c+=0x1){socket[_0x0d8b('0x74')]('userVoicePrefix:remove',{'UserId':Number(_0x191a5a['query'][_0x0d8b('0x73')][_0x58525c]),'VoicePrefixId':Number(_0x191a5a[_0x0d8b('0x47')]['id'])});}}else{socket[_0x0d8b('0x74')](_0x0d8b('0x78'),{'UserId':Number(_0x191a5a[_0x0d8b('0x2f')][_0x0d8b('0x73')]),'VoicePrefixId':Number(_0x191a5a[_0x0d8b('0x47')]['id'])});}});}})[_0x0d8b('0x26')](respondWithStatusCode(_0x105df9,null))[_0x0d8b('0x49')](handleError(_0x105df9,null));};exports[_0x0d8b('0x79')]=function(_0x195901,_0x291336,_0x3b060e){var _0x5dbc6b={};var _0x3d3b0b={};var _0x1b8b12;var _0x48c965;return db['VoicePrefix'][_0x0d8b('0x7a')]({'where':{'id':_0x195901[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x291336,null))[_0x0d8b('0x26')](function(_0x23e2e0){if(_0x23e2e0){_0x1b8b12=_0x23e2e0;_0x3d3b0b[_0x0d8b('0x32')]=_['keys'](db['User']['rawAttributes']);_0x3d3b0b[_0x0d8b('0x2f')]=_[_0x0d8b('0x2e')](_0x195901[_0x0d8b('0x2f')]);_0x3d3b0b[_0x0d8b('0x30')]=_[_0x0d8b('0x31')](_0x3d3b0b[_0x0d8b('0x32')],_0x3d3b0b['query']);_0x5dbc6b[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0x3d3b0b['model'],qs[_0x0d8b('0x34')](_0x195901['query'][_0x0d8b('0x34')]));_0x5dbc6b[_0x0d8b('0x33')]=_0x5dbc6b[_0x0d8b('0x33')][_0x0d8b('0x35')]?_0x5dbc6b[_0x0d8b('0x33')]:_0x3d3b0b[_0x0d8b('0x32')];_0x5dbc6b[_0x0d8b('0x38')]=qs[_0x0d8b('0x39')](_0x195901[_0x0d8b('0x2f')][_0x0d8b('0x39')]);_0x5dbc6b[_0x0d8b('0x3b')]=qs[_0x0d8b('0x30')](_['pick'](_0x195901['query'],_0x3d3b0b[_0x0d8b('0x30')]));if(_0x195901[_0x0d8b('0x2f')][_0x0d8b('0x3a')]){_0x5dbc6b[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x5dbc6b[_0x0d8b('0x3b')],{'$or':_[_0x0d8b('0x64')](_0x5dbc6b['attributes'],function(_0x246152){var _0x4c3948={};_0x4c3948[_0x246152]={'$like':'%'+_0x195901[_0x0d8b('0x2f')]['filter']+'%'};return _0x4c3948;})});}_0x5dbc6b=_['merge']({},_0x5dbc6b,_0x195901[_0x0d8b('0x41')]);return _0x1b8b12[_0x0d8b('0x79')](_0x5dbc6b);}})[_0x0d8b('0x26')](function(_0x883a20){if(_0x883a20){_0x48c965=_0x883a20[_0x0d8b('0x35')];if(!_0x195901[_0x0d8b('0x2f')][_0x0d8b('0x36')](_0x0d8b('0x37'))){_0x5dbc6b[_0x0d8b('0x20')]=qs[_0x0d8b('0x20')](_0x195901[_0x0d8b('0x2f')][_0x0d8b('0x20')]);_0x5dbc6b['offset']=qs[_0x0d8b('0x1f')](_0x195901[_0x0d8b('0x2f')][_0x0d8b('0x1f')]);}return _0x1b8b12['getAgents'](_0x5dbc6b);}})['then'](function(_0x2db144){if(_0x2db144){return _0x2db144?{'count':_0x48c965,'rows':_0x2db144}:null;}})[_0x0d8b('0x26')](respondWithResult(_0x291336,null))[_0x0d8b('0x49')](handleError(_0x291336,null));}; \ No newline at end of file +var _0xb10b=['find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','push','${EXTEN:','charAt','findById','params','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','map','hasOwnProperty','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','count','offset','set','Content-Range','json','reject','update','then','destroy','get','error','stack','name','send','VoicePrefix','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','type','key','field','filter','options','include','findAll','rows','catch','show','rawAttributes','includeAll'];(function(_0x319a06,_0x6f3d3f){var _0x198747=function(_0x1c6997){while(--_0x1c6997){_0x319a06['push'](_0x319a06['shift']());}};_0x198747(++_0x6f3d3f);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c5950,_0x49e128){_0x1c5950=_0x1c5950-0x0;var _0x2b720a=_0xb10b[_0x1c5950];return _0x2b720a;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];config['redis']=_[_0xbb10('0x18')](config[_0xbb10('0x19')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x19')]));require(_0xbb10('0x1c'))['register'](socket);function respondWithStatusCode(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xcc;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x1d')](_0x42d7e4);}return _0x26e021[_0xbb10('0x1e')](_0x42d7e4)[_0xbb10('0x1f')]();};}function respondWithResult(_0x24a57b,_0x36b5e8){_0x36b5e8=_0x36b5e8||0xc8;return function(_0x3e26f4){if(_0x3e26f4){return _0x24a57b[_0xbb10('0x1e')](_0x36b5e8)['json'](_0x3e26f4);}};}function respondWithFilteredResult(_0x2eca0f,_0x1145f1){return function(_0x133ac2){if(_0x133ac2){var _0x42db98=_0x133ac2[_0xbb10('0x20')],_0x378da8=_0x1145f1[_0xbb10('0x21')],_0x1682a4=_0x1145f1[_0xbb10('0x21')]+_0x1145f1['limit'],_0x575cca;if(_0x1682a4>=_0x42db98){_0x1682a4=_0x42db98;_0x575cca=0xc8;}else{_0x575cca=0xce;}_0x2eca0f[_0xbb10('0x1e')](_0x575cca);return _0x2eca0f[_0xbb10('0x22')](_0xbb10('0x23'),_0x378da8+'-'+_0x1682a4+'/'+_0x42db98)[_0xbb10('0x24')](_0x133ac2);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x25')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x26')](_0x4c4b0d)[_0xbb10('0x27')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x28')]()[_0xbb10('0x27')](function(){var _0x3ba6cd=_0x436104[_0xbb10('0x29')]({'plain':!![]});var _0x537898='VoicePrefixes';return db['UserProfileResource'][_0xbb10('0x28')]({'where':{'type':_0x537898,'resourceId':_0x3ba6cd['id']}})[_0xbb10('0x27')](function(){return _0x436104;});})[_0xbb10('0x27')](function(){_0x1824b7['status'](0xcc)[_0xbb10('0x1f')]();});}};}function handleEntityNotFound(_0x24d586,_0x6ed43b){return function(_0x1d5e95){if(!_0x1d5e95){_0x24d586[_0xbb10('0x1d')](0x194);}return _0x1d5e95;};}function handleError(_0x20d946,_0x2a0e8b){_0x2a0e8b=_0x2a0e8b||0x1f4;return function(_0x4aabb9){logger[_0xbb10('0x2a')](_0x4aabb9[_0xbb10('0x2b')]);if(_0x4aabb9[_0xbb10('0x2c')]){delete _0x4aabb9[_0xbb10('0x2c')];}_0x20d946[_0xbb10('0x1e')](_0x2a0e8b)[_0xbb10('0x2d')](_0x4aabb9);};}exports['index']=function(_0x221624,_0x4ee02e){var _0x448d5c={},_0x56f2da={},_0x16ad2a={'count':0x0,'rows':[]};var _0x1dcc9c=db[_0xbb10('0x2e')]['rawAttributes'];_0x56f2da['model']=_[_0xbb10('0x2f')](_0x1dcc9c);_0x56f2da[_0xbb10('0x30')]=_['keys'](_0x221624[_0xbb10('0x30')]);_0x56f2da[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x56f2da[_0xbb10('0x33')],_0x56f2da[_0xbb10('0x30')]);_0x448d5c[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0x56f2da['model'],qs[_0xbb10('0x35')](_0x221624[_0xbb10('0x30')][_0xbb10('0x35')]));_0x448d5c[_0xbb10('0x34')]=_0x448d5c[_0xbb10('0x34')][_0xbb10('0x36')]?_0x448d5c[_0xbb10('0x34')]:_0x56f2da[_0xbb10('0x33')];if(!_0x221624[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x37'))){_0x448d5c[_0xbb10('0x38')]=qs[_0xbb10('0x38')](_0x221624[_0xbb10('0x30')]['limit']);_0x448d5c[_0xbb10('0x21')]=qs['offset'](_0x221624['query'][_0xbb10('0x21')]);}_0x448d5c[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_0x221624[_0xbb10('0x30')][_0xbb10('0x3a')]);_0x448d5c[_0xbb10('0x3b')]=qs['filters'](_[_0xbb10('0x3c')](_0x221624[_0xbb10('0x30')],_0x56f2da['filters']));if(_0x221624['query']['filter']){_0x448d5c[_0xbb10('0x3b')]=_[_0xbb10('0x3d')](_0x448d5c[_0xbb10('0x3b')],{'$or':_['map'](_0x1dcc9c,function(_0x3c0cd7){if(_0x3c0cd7[_0xbb10('0x3e')][_0xbb10('0x3f')]!=='VIRTUAL'){var _0x17b6c5={};_0x17b6c5[_0x3c0cd7[_0xbb10('0x40')]]={'$like':'%'+_0x221624[_0xbb10('0x30')][_0xbb10('0x41')]+'%'};return _0x17b6c5;}})});}_0x448d5c=_['merge']({},_0x448d5c,_0x221624[_0xbb10('0x42')]);var _0x110eb5={'where':_0x448d5c['where']};return db[_0xbb10('0x2e')][_0xbb10('0x20')](_0x110eb5)[_0xbb10('0x27')](function(_0x3a9934){_0x16ad2a[_0xbb10('0x20')]=_0x3a9934;if(_0x221624[_0xbb10('0x30')]['includeAll']){_0x448d5c[_0xbb10('0x43')]=[{'all':!![]}];}return db[_0xbb10('0x2e')][_0xbb10('0x44')](_0x448d5c);})[_0xbb10('0x27')](function(_0x4943d9){_0x16ad2a[_0xbb10('0x45')]=_0x4943d9;return _0x16ad2a;})[_0xbb10('0x27')](respondWithFilteredResult(_0x4ee02e,_0x448d5c))[_0xbb10('0x46')](handleError(_0x4ee02e,null));};exports[_0xbb10('0x47')]=function(_0x5e2cfa,_0x351484){var _0x202c60={'raw':![],'where':{'id':_0x5e2cfa['params']['id']}},_0x54ac18={};_0x54ac18[_0xbb10('0x33')]=_['keys'](db[_0xbb10('0x2e')][_0xbb10('0x48')]);_0x54ac18['query']=_[_0xbb10('0x2f')](_0x5e2cfa[_0xbb10('0x30')]);_0x54ac18[_0xbb10('0x31')]=_['intersection'](_0x54ac18[_0xbb10('0x33')],_0x54ac18[_0xbb10('0x30')]);_0x202c60[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0x54ac18[_0xbb10('0x33')],qs[_0xbb10('0x35')](_0x5e2cfa[_0xbb10('0x30')][_0xbb10('0x35')]));_0x202c60[_0xbb10('0x34')]=_0x202c60[_0xbb10('0x34')][_0xbb10('0x36')]?_0x202c60[_0xbb10('0x34')]:_0x54ac18['model'];if(_0x5e2cfa[_0xbb10('0x30')][_0xbb10('0x49')]){_0x202c60['include']=[{'all':!![]}];}_0x202c60=_[_0xbb10('0x3d')]({},_0x202c60,_0x5e2cfa[_0xbb10('0x42')]);return db[_0xbb10('0x2e')][_0xbb10('0x4a')](_0x202c60)[_0xbb10('0x27')](handleEntityNotFound(_0x351484,null))[_0xbb10('0x27')](respondWithResult(_0x351484,null))[_0xbb10('0x46')](handleError(_0x351484,null));};exports['destroy']=function(_0x4a9793,_0xcb3354){return db[_0xbb10('0x2e')][_0xbb10('0x4a')]({'where':{'id':_0x4a9793['params']['id']}})['then'](handleEntityNotFound(_0xcb3354,null))[_0xbb10('0x27')](removeEntity(_0xcb3354,null))[_0xbb10('0x46')](handleError(_0xcb3354,null));};exports[_0xbb10('0x4b')]=function(_0xf820fe,_0x10159b){return db[_0xbb10('0x2e')][_0xbb10('0x4b')]()[_0xbb10('0x27')](respondWithResult(_0x10159b,null))[_0xbb10('0x46')](handleError(_0x10159b,null));};exports[_0xbb10('0x4c')]=function(_0x550111,_0x5eafac){var _0x412e13;return db[_0xbb10('0x4d')][_0xbb10('0x4e')](function(_0xb014b0){return db[_0xbb10('0x2e')][_0xbb10('0x4c')](_0x550111[_0xbb10('0x4f')],{'transaction':_0xb014b0})[_0xbb10('0x27')](function(_0x1c0d8f){_0x412e13=_0x1c0d8f[_0xbb10('0x29')]({'plain':!![]});return db[_0xbb10('0x50')][_0xbb10('0x4a')]({'where':{'id':_0x412e13[_0xbb10('0x51')]},'raw':!![]})[_0xbb10('0x27')](function(_0x1d15f4){return createVoicePrefixExtensions(_0x412e13,_0x1d15f4,_0xb014b0);});});})['then'](function(){var _0x124052=_0x550111['user'][_0xbb10('0x29')]({'plain':!![]});if(!_0x124052)throw new Error(_0xbb10('0x52'));if(_0x124052[_0xbb10('0x53')]===_0xbb10('0x54')){var _0x26e66e=_0x412e13;return db[_0xbb10('0x55')][_0xbb10('0x4a')]({'where':{'name':_0xbb10('0x56'),'userProfileId':_0x124052[_0xbb10('0x57')]},'raw':!![]})[_0xbb10('0x27')](function(_0x44a056){if(_0x44a056&&_0x44a056[_0xbb10('0x58')]===0x0){return db[_0xbb10('0x59')][_0xbb10('0x4c')]({'name':_0x26e66e[_0xbb10('0x2c')],'resourceId':_0x26e66e['id'],'type':_0x44a056['name'],'sectionId':_0x44a056['id']},{})[_0xbb10('0x27')](function(){return _0x412e13;});}else{return _0x412e13;}})[_0xbb10('0x46')](function(_0x1b83a9){logger[_0xbb10('0x2a')](_0xbb10('0x5a'),_0x1b83a9);throw _0x1b83a9;});}return _0x412e13;})[_0xbb10('0x27')](respondWithResult(_0x5eafac,null))['catch'](handleError(_0x5eafac,null));};function Extension(_0x120bda,_0x4731ce,_0x2909a1,_0x14fed3){this[_0xbb10('0x5b')]=_0xbb10('0x5c');this[_0xbb10('0x5d')]=_0x120bda;this[_0xbb10('0x5e')]=_0x2909a1;this[_0xbb10('0x3e')]=_0xbb10('0x5f');this[_0xbb10('0x60')]=_0xbb10('0x61');this[_0xbb10('0x62')]=_0x4731ce;this['appdata']=_0x14fed3;}function createVoicePrefixExtensions(_0x4ea1a6,_0x16272d,_0x3e6338){return new BPromise(function(_0x3d0cb7,_0x8b0a7d){var _0x5573bb=new Extension(formatPrefixName(_0x4ea1a6['prefix']),0x1,_0xbb10('0x63'),_0xbb10('0x64'));_0x5573bb[_0xbb10('0x65')]=_0x4ea1a6['id'];return db[_0xbb10('0x50')][_0xbb10('0x4c')](_0x5573bb,{'transaction':_0x3e6338})[_0xbb10('0x27')](function(_0x45c0dc){var _0x4a5fb9=_0x45c0dc[_0xbb10('0x29')]({'plain':!![]});var _0x216cff=_['map'](addVoicePrefixExtensions(_0x4ea1a6,_0x16272d),function(_0x5e03cb){_0x5e03cb['VoiceExtensionId']=_0x4a5fb9['id'];_0x5e03cb[_0xbb10('0x65')]=_0x4ea1a6['id'];return _0x5e03cb;});return db[_0xbb10('0x50')][_0xbb10('0x66')](_0x216cff,{'transaction':_0x3e6338})['then'](function(_0x4e6e7c){if(!_0x4e6e7c){return _0x8b0a7d('Extensions\x20creation\x20failed');}else{return _0x3d0cb7(_0x4e6e7c);}})[_0xbb10('0x46')](function(_0x249b33){return _0x8b0a7d(_0x249b33);});});;});};function addVoicePrefixExtensions(_0x45167a,_0x4e9fbd){var _0xa1bbd9=[];var _0x13131c=formatPrefixName(_0x45167a['prefix']);_0xa1bbd9['push'](new Extension(_0x13131c,0x2,_0xbb10('0x67'),_0xbb10('0x68')+_0x45167a[_0xbb10('0x2c')]));if(_0x45167a[_0xbb10('0x69')]){_0xa1bbd9['push'](new Extension(_0x13131c,0x3,_0xbb10('0x67'),_0xbb10('0x6a')+_0x45167a[_0xbb10('0x69')]));}else{_0xa1bbd9['push'](new Extension(_0x13131c,0x3,_0xbb10('0x63'),_0xbb10('0x6b')));}_0xa1bbd9[_0xbb10('0x6c')](new Extension(_0x13131c,0x4,'goto',_0x4e9fbd[_0xbb10('0x5b')]+','+_0xbb10('0x6d')+(0x8+_0x45167a[_0xbb10('0x2c')][_0xbb10('0x36')])+'}'+','+0x1));return _0xa1bbd9;}function formatPrefixName(_0x5e4a6e){var _0x251417='_';for(var _0x258e55=0x0;_0x258e55<_0x5e4a6e[_0xbb10('0x36')];_0x258e55++){if(_0x5e4a6e[_0xbb10('0x6e')](_0x258e55)=='-'){_0x251417+=_0x5e4a6e['charAt'](_0x258e55);}else{_0x251417+='['+_0x5e4a6e[_0xbb10('0x6e')](_0x258e55)+']';}}_0x251417+='.';return _0x251417;}exports[_0xbb10('0x26')]=function(_0x2a166e,_0x2ceb3e,_0x12f750){var _0x17807e=_0x2a166e[_0xbb10('0x4f')];_0x17807e['prefix']='system-'+_0x17807e['name']+'-';return db[_0xbb10('0x4d')][_0xbb10('0x4e')](function(_0x3eda96){return db['VoicePrefix']['update'](_0x17807e,{'where':{'id':_0x17807e['id']},'transaction':_0x3eda96})[_0xbb10('0x27')](function(){return db[_0xbb10('0x50')][_0xbb10('0x28')]({'where':{'VoicePrefixId':_0x17807e['id']},'transaction':_0x3eda96})[_0xbb10('0x27')](function(){return db[_0xbb10('0x50')][_0xbb10('0x4a')]({'where':{'id':_0x17807e['VoiceExtensionId']},'raw':!![]})[_0xbb10('0x27')](function(_0x15fae2){return createVoicePrefixExtensions(_0x17807e,_0x15fae2,_0x3eda96);});});});})[_0xbb10('0x27')](function(){return db[_0xbb10('0x2e')][_0xbb10('0x6f')](_0x17807e['id']);})['then'](respondWithResult(_0x2ceb3e,null))['catch'](handleError(_0x2ceb3e,null));};exports['addAgents']=function(_0x329da7,_0x1e0569,_0x36917f){return db[_0xbb10('0x2e')][_0xbb10('0x4a')]({'where':{'id':_0x329da7[_0xbb10('0x70')]['id']}})['then'](handleEntityNotFound(_0x1e0569,null))[_0xbb10('0x27')](function(_0x4bc316){if(_0x4bc316){return _0x4bc316['addAgents'](_0x329da7['body'][_0xbb10('0x71')],_[_0xbb10('0x72')](_0x329da7[_0xbb10('0x4f')],[_0xbb10('0x71'),'id'])||{})['spread'](function(_0x122d38){for(var _0x5c583b=0x0;_0x5c583b<_0x329da7['body'][_0xbb10('0x71')][_0xbb10('0x36')];_0x5c583b+=0x1){socket[_0xbb10('0x73')](_0xbb10('0x74'),{'UserId':_0x329da7[_0xbb10('0x4f')]['ids'][_0x5c583b],'VoicePrefixId':_0x329da7[_0xbb10('0x70')]['id']});}return _0x122d38;});}})[_0xbb10('0x27')](respondWithResult(_0x1e0569,null))[_0xbb10('0x46')](handleError(_0x1e0569,null));};exports[_0xbb10('0x75')]=function(_0x43cdb7,_0x27f42f,_0x174395){return db['VoicePrefix'][_0xbb10('0x4a')]({'where':{'id':_0x43cdb7[_0xbb10('0x70')]['id']}})[_0xbb10('0x27')](handleEntityNotFound(_0x27f42f,null))[_0xbb10('0x27')](function(_0x37b20e){if(_0x37b20e){return _0x37b20e[_0xbb10('0x75')](_0x43cdb7[_0xbb10('0x30')][_0xbb10('0x71')])['then'](function(){if(_[_0xbb10('0x76')](_0x43cdb7[_0xbb10('0x30')][_0xbb10('0x71')])){for(var _0x56416a=0x0;_0x56416a<_0x43cdb7['query']['ids'][_0xbb10('0x36')];_0x56416a+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x43cdb7[_0xbb10('0x30')][_0xbb10('0x71')][_0x56416a]),'VoicePrefixId':Number(_0x43cdb7[_0xbb10('0x70')]['id'])});}}else{socket[_0xbb10('0x73')](_0xbb10('0x77'),{'UserId':Number(_0x43cdb7[_0xbb10('0x30')][_0xbb10('0x71')]),'VoicePrefixId':Number(_0x43cdb7[_0xbb10('0x70')]['id'])});}});}})[_0xbb10('0x27')](respondWithStatusCode(_0x27f42f,null))['catch'](handleError(_0x27f42f,null));};exports[_0xbb10('0x78')]=function(_0x1351eb,_0x46b6d2,_0x35b811){var _0x5c8eb8={};var _0x4c0795={};var _0x3547a3;var _0x2280bd;return db[_0xbb10('0x2e')][_0xbb10('0x79')]({'where':{'id':_0x1351eb['params']['id']}})[_0xbb10('0x27')](handleEntityNotFound(_0x46b6d2,null))[_0xbb10('0x27')](function(_0x3f0d74){if(_0x3f0d74){_0x3547a3=_0x3f0d74;_0x4c0795[_0xbb10('0x33')]=_[_0xbb10('0x2f')](db['User']['rawAttributes']);_0x4c0795[_0xbb10('0x30')]=_[_0xbb10('0x2f')](_0x1351eb[_0xbb10('0x30')]);_0x4c0795['filters']=_[_0xbb10('0x32')](_0x4c0795[_0xbb10('0x33')],_0x4c0795['query']);_0x5c8eb8['attributes']=_[_0xbb10('0x32')](_0x4c0795[_0xbb10('0x33')],qs[_0xbb10('0x35')](_0x1351eb['query'][_0xbb10('0x35')]));_0x5c8eb8[_0xbb10('0x34')]=_0x5c8eb8[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5c8eb8[_0xbb10('0x34')]:_0x4c0795[_0xbb10('0x33')];_0x5c8eb8[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_0x1351eb[_0xbb10('0x30')]['sort']);_0x5c8eb8[_0xbb10('0x3b')]=qs[_0xbb10('0x31')](_[_0xbb10('0x3c')](_0x1351eb[_0xbb10('0x30')],_0x4c0795[_0xbb10('0x31')]));if(_0x1351eb[_0xbb10('0x30')][_0xbb10('0x41')]){_0x5c8eb8[_0xbb10('0x3b')]=_[_0xbb10('0x3d')](_0x5c8eb8[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x7a')](_0x5c8eb8[_0xbb10('0x34')],function(_0x59e985){var _0x51f106={};_0x51f106[_0x59e985]={'$like':'%'+_0x1351eb[_0xbb10('0x30')][_0xbb10('0x41')]+'%'};return _0x51f106;})});}_0x5c8eb8=_[_0xbb10('0x3d')]({},_0x5c8eb8,_0x1351eb[_0xbb10('0x42')]);return _0x3547a3[_0xbb10('0x78')](_0x5c8eb8);}})['then'](function(_0x2749a7){if(_0x2749a7){_0x2280bd=_0x2749a7[_0xbb10('0x36')];if(!_0x1351eb[_0xbb10('0x30')][_0xbb10('0x7b')](_0xbb10('0x37'))){_0x5c8eb8[_0xbb10('0x38')]=qs['limit'](_0x1351eb[_0xbb10('0x30')][_0xbb10('0x38')]);_0x5c8eb8['offset']=qs[_0xbb10('0x21')](_0x1351eb['query'][_0xbb10('0x21')]);}return _0x3547a3[_0xbb10('0x78')](_0x5c8eb8);}})[_0xbb10('0x27')](function(_0xa99bf5){if(_0xa99bf5){return _0xa99bf5?{'count':_0x2280bd,'rows':_0xa99bf5}:null;}})[_0xbb10('0x27')](respondWithResult(_0x46b6d2,null))['catch'](handleError(_0x46b6d2,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 8b1ddfd..eccce63 100644 --- a/server/api/voicePrefix/voicePrefix.events.js +++ b/server/api/voicePrefix/voicePrefix.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x15d75d,_0x1f2059){var _0x44fabc=function(_0x2ae5cb){while(--_0x2ae5cb){_0x15d75d['push'](_0x15d75d['shift']());}};_0x44fabc(++_0x1f2059);}(_0x008c,0x188));var _0xc008=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x008c[_0x4cbf20];return _0x582ae4;};'use strict';var EventEmitter=require(_0xc008('0x0'));var VoicePrefix=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){VoicePrefixEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);VoicePrefixEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];VoicePrefix[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','VoicePrefix','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x127df3,_0x4ad7c9){_0x127df3=_0x127df3-0x0;var _0x54f004=_0x3e74[_0x127df3];return _0x54f004;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x43e7('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){VoicePrefixEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);VoicePrefixEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 63e29b3..f6bed95 100644 --- a/server/api/voicePrefix/voicePrefix.model.js +++ b/server/api/voicePrefix/voicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b38=['define','VoicePrefix','util','../../config/logger','api','moment','path','../../config/environment','./voicePrefix.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4b38,0x66));var _0x84b3=function(_0x36b16d,_0x262e74){_0x36b16d=_0x36b16d-0x0;var _0x34ff9d=_0x4b38[_0x36b16d];return _0x34ff9d;};'use strict';var _=require('lodash');var util=require(_0x84b3('0x0'));var logger=require(_0x84b3('0x1'))(_0x84b3('0x2'));var moment=require(_0x84b3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x84b3('0x4'));var rimraf=require('rimraf');var config=require(_0x84b3('0x5'));var attributes=require(_0x84b3('0x6'));module[_0x84b3('0x7')]=function(_0x5160e0,_0x321fd1){return _0x5160e0[_0x84b3('0x8')](_0x84b3('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb1f=['define','VoicePrefix','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports'];(function(_0x6ddb4,_0x162122){var _0x59d768=function(_0x1f3997){while(--_0x1f3997){_0x6ddb4['push'](_0x6ddb4['shift']());}};_0x59d768(++_0x162122);}(_0xeb1f,0x161));var _0xfeb1=function(_0x531c6d,_0x24ef3f){_0x531c6d=_0x531c6d-0x0;var _0x2c012e=_0xeb1f[_0x531c6d];return _0x2c012e;};'use strict';var _=require(_0xfeb1('0x0'));var util=require(_0xfeb1('0x1'));var logger=require('../../config/logger')(_0xfeb1('0x2'));var moment=require(_0xfeb1('0x3'));var BPromise=require(_0xfeb1('0x4'));var rp=require(_0xfeb1('0x5'));var fs=require('fs');var path=require(_0xfeb1('0x6'));var rimraf=require(_0xfeb1('0x7'));var config=require(_0xfeb1('0x8'));var attributes=require(_0xfeb1('0x9'));module[_0xfeb1('0xa')]=function(_0x2dd6fc,_0x572a3d){return _0x2dd6fc[_0xfeb1('0xb')](_0xfeb1('0xc'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index ff46d1e..cc6eb4c 100644 --- a/server/api/voicePrefix/voicePrefix.rpc.js +++ b/server/api/voicePrefix/voicePrefix.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc20=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s'];(function(_0x5786f9,_0x59a148){var _0x22c3cf=function(_0x360be2){while(--_0x360be2){_0x5786f9['push'](_0x5786f9['shift']());}};_0x22c3cf(++_0x59a148);}(_0xbc20,0x181));var _0x0bc2=function(_0x2f8bc6,_0x4dc869){_0x2f8bc6=_0x2f8bc6-0x0;var _0x2d008a=_0xbc20[_0x2f8bc6];return _0x2d008a;};'use strict';var _=require(_0x0bc2('0x0'));var util=require(_0x0bc2('0x1'));var moment=require(_0x0bc2('0x2'));var BPromise=require(_0x0bc2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bc2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0bc2('0x5'))(_0x0bc2('0x6'));var config=require(_0x0bc2('0x7'));var jayson=require(_0x0bc2('0x8'));var client=jayson['client'][_0x0bc2('0x9')]({'port':0x232a});config[_0x0bc2('0xa')]=_[_0x0bc2('0xb')](config[_0x0bc2('0xa')],{'host':_0x0bc2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0bc2('0xd'))[_0x0bc2('0xe')](socket);function respondWithRpcPromise(_0x154210,_0x5a50fe,_0x1ded21){return new BPromise(function(_0x59dc3f,_0x4e6e6c){return client[_0x0bc2('0xf')](_0x154210,_0x1ded21)[_0x0bc2('0x10')](function(_0x4b47c9){logger['info'](_0x0bc2('0x11'),_0x5a50fe,_0x0bc2('0x12'));logger['debug'](_0x0bc2('0x13'),_0x5a50fe,_0x0bc2('0x12'),JSON[_0x0bc2('0x14')](_0x4b47c9));if(_0x4b47c9[_0x0bc2('0x15')]){if(_0x4b47c9[_0x0bc2('0x15')][_0x0bc2('0x16')]===0x1f4){logger[_0x0bc2('0x15')](_0x0bc2('0x11'),_0x5a50fe,_0x4b47c9[_0x0bc2('0x15')][_0x0bc2('0x17')]);return _0x4e6e6c(_0x4b47c9[_0x0bc2('0x15')]['message']);}logger['error'](_0x0bc2('0x11'),_0x5a50fe,_0x4b47c9[_0x0bc2('0x15')]['message']);return _0x59dc3f(_0x4b47c9[_0x0bc2('0x15')][_0x0bc2('0x17')]);}else{logger[_0x0bc2('0x18')](_0x0bc2('0x11'),_0x5a50fe,'request\x20sent');_0x59dc3f(_0x4b47c9[_0x0bc2('0x19')][_0x0bc2('0x17')]);}})[_0x0bc2('0x1a')](function(_0x3f650b){logger[_0x0bc2('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x5a50fe,_0x3f650b);_0x4e6e6c(_0x3f650b);});});} \ No newline at end of file +var _0xe062=['client','localhost','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4cc31e,_0x480830){var _0x5cae79=function(_0x3a1b6a){while(--_0x3a1b6a){_0x4cc31e['push'](_0x4cc31e['shift']());}};_0x5cae79(++_0x480830);}(_0xe062,0x1b8));var _0x2e06=function(_0x16083f,_0x5f4558){_0x16083f=_0x16083f-0x0;var _0x23db9e=_0xe062[_0x16083f];return _0x23db9e;};'use strict';var _=require(_0x2e06('0x0'));var util=require(_0x2e06('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2e06('0x2'));var fs=require('fs');var Redis=require(_0x2e06('0x3'));var db=require(_0x2e06('0x4'))['db'];var utils=require(_0x2e06('0x5'));var logger=require(_0x2e06('0x6'))(_0x2e06('0x7'));var config=require(_0x2e06('0x8'));var jayson=require(_0x2e06('0x9'));var client=jayson[_0x2e06('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x2e06('0xb'),'port':0x18eb});var socket=require(_0x2e06('0xc'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x2e06('0xd')](socket);function respondWithRpcPromise(_0x28433e,_0x6be39d,_0x29a813){return new BPromise(function(_0x18552c,_0x450369){return client[_0x2e06('0xe')](_0x28433e,_0x29a813)[_0x2e06('0xf')](function(_0x396810){logger[_0x2e06('0x10')](_0x2e06('0x11'),_0x6be39d,_0x2e06('0x12'));logger['debug'](_0x2e06('0x13'),_0x6be39d,_0x2e06('0x12'),JSON['stringify'](_0x396810));if(_0x396810['error']){if(_0x396810[_0x2e06('0x14')][_0x2e06('0x15')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x6be39d,_0x396810[_0x2e06('0x14')]['message']);return _0x450369(_0x396810['error'][_0x2e06('0x16')]);}logger[_0x2e06('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x6be39d,_0x396810[_0x2e06('0x14')]['message']);return _0x18552c(_0x396810[_0x2e06('0x14')]['message']);}else{logger[_0x2e06('0x10')](_0x2e06('0x11'),_0x6be39d,_0x2e06('0x12'));_0x18552c(_0x396810[_0x2e06('0x17')][_0x2e06('0x16')]);}})[_0x2e06('0x18')](function(_0x3773fa){logger['error'](_0x2e06('0x11'),_0x6be39d,_0x3773fa);_0x450369(_0x3773fa);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 3ff2db6..dd8d684 100644 --- a/server/api/voicePrefix/voicePrefix.socket.js +++ b/server/api/voicePrefix/voicePrefix.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4225=['length','remove','emit','removeListener'];(function(_0x4d7fb1,_0x311578){var _0x6d3712=function(_0x244da2){while(--_0x244da2){_0x4d7fb1['push'](_0x4d7fb1['shift']());}};_0x6d3712(++_0x311578);}(_0x4225,0xf1));var _0x5422=function(_0x21754e,_0x3d5ce5){_0x21754e=_0x21754e-0x0;var _0xf818ca=_0x4225[_0x21754e];return _0xf818ca;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x5422('0x0'),'update'];function createListener(_0x31891f,_0x210786){return function(_0x12ce8a){_0x210786[_0x5422('0x1')](_0x31891f,_0x12ce8a);};}function removeListener(_0x5d1b65,_0x5f131d){return function(){VoicePrefixEvents[_0x5422('0x2')](_0x5d1b65,_0x5f131d);};}exports['register']=function(_0x2b5a5b){for(var _0x247c0a=0x0,_0x1bf13e=events[_0x5422('0x3')];_0x247c0a<_0x1bf13e;_0x247c0a++){var _0x99bfe5=events[_0x247c0a];var _0xa3e661=createListener('voicePrefix:'+_0x99bfe5,_0x2b5a5b);VoicePrefixEvents['on'](_0x99bfe5,_0xa3e661);}}; \ No newline at end of file +var _0x6a37=['update','emit','register','length','./voicePrefix.events'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6a37,0x130));var _0x76a3=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x6a37[_0x556927];return _0x5f1235;};'use strict';var VoicePrefixEvents=require(_0x76a3('0x0'));var events=['save','remove',_0x76a3('0x1')];function createListener(_0x56ba16,_0x27405e){return function(_0x19e287){_0x27405e[_0x76a3('0x2')](_0x56ba16,_0x19e287);};}function removeListener(_0x17af87,_0x2853d3){return function(){VoicePrefixEvents['removeListener'](_0x17af87,_0x2853d3);};}exports[_0x76a3('0x3')]=function(_0x58c978){for(var _0x3234dd=0x0,_0x155fd5=events[_0x76a3('0x4')];_0x3234dd<_0x155fd5;_0x3234dd++){var _0x152b70=events[_0x3234dd];var _0x122406=createListener('voicePrefix:'+_0x152b70,_0x58c978);VoicePrefixEvents['on'](_0x152b70,_0x122406);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 15c75d3..dec5ae1 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05c9=['removeAgents','removeLists','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','isAuthenticated','show','get','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','getLists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','/:id/lists','/:id/blacklists','addBlackLists','put','/:id','update','delete','destroy','removeTeams'];(function(_0x143896,_0x31f415){var _0x27d303=function(_0x2af02b){while(--_0x2af02b){_0x143896['push'](_0x143896['shift']());}};_0x27d303(++_0x31f415);}(_0x05c9,0x130));var _0x905c=function(_0x3e794b,_0x475f91){_0x3e794b=_0x3e794b-0x0;var _0x44ba46=_0x05c9[_0x3e794b];return _0x44ba46;};'use strict';var multer=require(_0x905c('0x0'));var util=require('util');var path=require(_0x905c('0x1'));var timeout=require(_0x905c('0x2'));var express=require(_0x905c('0x3'));var router=express[_0x905c('0x4')]();var auth=require(_0x905c('0x5'));var interaction=require(_0x905c('0x6'));var config=require(_0x905c('0x7'));var controller=require(_0x905c('0x8'));router['get']('/',auth[_0x905c('0x9')](),controller['index']);router['get']('/:id',auth[_0x905c('0x9')](),controller[_0x905c('0xa')]);router[_0x905c('0xb')](_0x905c('0xc'),auth['isAuthenticated'](),controller[_0x905c('0xd')]);router[_0x905c('0xb')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x905c('0xe')]);router[_0x905c('0xb')](_0x905c('0xf'),auth[_0x905c('0x9')](),controller[_0x905c('0x10')]);router[_0x905c('0xb')](_0x905c('0x11'),auth['isAuthenticated'](),controller[_0x905c('0x12')]);router[_0x905c('0xb')](_0x905c('0x13'),auth['isAuthenticated'](),controller[_0x905c('0x14')]);router[_0x905c('0xb')](_0x905c('0x15'),auth[_0x905c('0x9')](),controller[_0x905c('0x16')]);router[_0x905c('0xb')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router['get']('/:id/lists',auth[_0x905c('0x9')](),controller[_0x905c('0x17')]);router['get']('/:id/blacklists',auth[_0x905c('0x9')](),controller[_0x905c('0x18')]);router[_0x905c('0x19')]('/',auth['isAuthenticated'](),controller[_0x905c('0x1a')]);router[_0x905c('0x19')](_0x905c('0x1b'),auth[_0x905c('0x9')](),controller[_0x905c('0x1c')]);router[_0x905c('0x19')]('/:id/teams',auth[_0x905c('0x9')](),controller[_0x905c('0x1d')]);router[_0x905c('0x19')](_0x905c('0x15'),auth[_0x905c('0x9')](),controller[_0x905c('0x1e')]);router[_0x905c('0x19')](_0x905c('0x1f'),auth[_0x905c('0x9')](),controller['addLists']);router[_0x905c('0x19')](_0x905c('0x20'),auth['isAuthenticated'](),controller[_0x905c('0x21')]);router[_0x905c('0x22')](_0x905c('0x23'),auth[_0x905c('0x9')](),controller[_0x905c('0x24')]);router[_0x905c('0x25')](_0x905c('0x23'),auth[_0x905c('0x9')](),controller[_0x905c('0x26')]);router[_0x905c('0x25')](_0x905c('0x13'),auth['isAuthenticated'](),controller[_0x905c('0x27')]);router[_0x905c('0x25')](_0x905c('0x15'),auth[_0x905c('0x9')](),controller[_0x905c('0x28')]);router['delete']('/:id/lists',auth['isAuthenticated'](),controller[_0x905c('0x29')]);router[_0x905c('0x25')](_0x905c('0x20'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x905c('0x2a')]=router; \ No newline at end of file +var _0x27a0=['getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','addTeams','addLists','put','update','delete','/:id','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x6dfdf,_0x2595d4){var _0x48d11a=function(_0x43b95f){while(--_0x43b95f){_0x6dfdf['push'](_0x6dfdf['shift']());}};_0x48d11a(++_0x2595d4);}(_0x27a0,0x12c));var _0x027a=function(_0x31f0ca,_0xc9905d){_0x31f0ca=_0x31f0ca-0x0;var _0xdcb439=_0x27a0[_0x31f0ca];return _0xdcb439;};'use strict';var multer=require(_0x027a('0x0'));var util=require(_0x027a('0x1'));var path=require(_0x027a('0x2'));var timeout=require(_0x027a('0x3'));var express=require('express');var router=express[_0x027a('0x4')]();var auth=require(_0x027a('0x5'));var interaction=require(_0x027a('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueue.controller');router[_0x027a('0x7')]('/',auth[_0x027a('0x8')](),controller[_0x027a('0x9')]);router[_0x027a('0x7')]('/:id',auth[_0x027a('0x8')](),controller[_0x027a('0xa')]);router[_0x027a('0x7')]('/:id/hoppers',auth[_0x027a('0x8')](),controller[_0x027a('0xb')]);router['get'](_0x027a('0xc'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x027a('0x7')](_0x027a('0xd'),auth[_0x027a('0x8')](),controller[_0x027a('0xe')]);router[_0x027a('0x7')]('/:id/hopper_black',auth[_0x027a('0x8')](),controller[_0x027a('0xf')]);router[_0x027a('0x7')](_0x027a('0x10'),auth[_0x027a('0x8')](),controller[_0x027a('0x11')]);router[_0x027a('0x7')](_0x027a('0x12'),auth[_0x027a('0x8')](),controller[_0x027a('0x13')]);router['get']('/:id/members',auth[_0x027a('0x8')](),controller[_0x027a('0x14')]);router[_0x027a('0x7')](_0x027a('0x15'),auth['isAuthenticated'](),controller[_0x027a('0x16')]);router[_0x027a('0x7')](_0x027a('0x17'),auth['isAuthenticated'](),controller[_0x027a('0x18')]);router['post']('/',auth[_0x027a('0x8')](),controller[_0x027a('0x19')]);router[_0x027a('0x1a')](_0x027a('0x1b'),auth[_0x027a('0x8')](),controller['clone']);router['post'](_0x027a('0x10'),auth[_0x027a('0x8')](),controller[_0x027a('0x1c')]);router[_0x027a('0x1a')](_0x027a('0x12'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0x027a('0x15'),auth[_0x027a('0x8')](),controller[_0x027a('0x1d')]);router[_0x027a('0x1a')](_0x027a('0x17'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0x027a('0x1e')]('/:id',auth[_0x027a('0x8')](),controller[_0x027a('0x1f')]);router[_0x027a('0x20')](_0x027a('0x21'),auth[_0x027a('0x8')](),controller[_0x027a('0x22')]);router['delete'](_0x027a('0x10'),auth[_0x027a('0x8')](),controller[_0x027a('0x23')]);router[_0x027a('0x20')]('/:id/users',auth[_0x027a('0x8')](),controller[_0x027a('0x24')]);router[_0x027a('0x20')](_0x027a('0x15'),auth[_0x027a('0x8')](),controller[_0x027a('0x25')]);router[_0x027a('0x20')](_0x027a('0x17'),auth['isAuthenticated'](),controller[_0x027a('0x26')]);module[_0x027a('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index baf60fe..9760bda 100644 --- a/server/api/voiceQueue/voiceQueue.attributes.js +++ b/server/api/voiceQueue/voiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2d2=['Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','predictive','power','INTEGER','yes','all','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'];(function(_0x1cdd11,_0x3c4bdf){var _0x55eebc=function(_0x394e91){while(--_0x394e91){_0x1cdd11['push'](_0x1cdd11['shift']());}};_0x55eebc(++_0x3c4bdf);}(_0xb2d2,0x68));var _0x2b2d=function(_0x5b64af,_0x38fd55){_0x5b64af=_0x5b64af-0x0;var _0x429295=_0xb2d2[_0x5b64af];return _0x429295;};'use strict';var Sequelize=require(_0x2b2d('0x0'));module[_0x2b2d('0x1')]={'name':{'type':Sequelize[_0x2b2d('0x2')],'allowNull':![],'unique':_0x2b2d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2b2d('0x4')](_0x2b2d('0x5'),_0x2b2d('0x6')),'allowNull':![],'defaultValue':_0x2b2d('0x5')},'musiconhold':{'type':Sequelize[_0x2b2d('0x2')],'defaultValue':_0x2b2d('0x7')},'announce':{'type':Sequelize[_0x2b2d('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x2b2d('0x4')]('rr',_0x2b2d('0x8'),_0x2b2d('0x9'),_0x2b2d('0xa'),_0x2b2d('0xb'),_0x2b2d('0xc'),_0x2b2d('0xd'),_0x2b2d('0xe'),_0x2b2d('0xf')),'allowNull':![],'defaultValue':_0x2b2d('0x8'),'set':function(_0x4fbcd1){this[_0x2b2d('0x10')](_0x2b2d('0x11'),_0x4fbcd1?_0x4fbcd1:_0x2b2d('0xc'));},'get':function(){var _0x8fa85e=this[_0x2b2d('0x12')](_0x2b2d('0x13'));var _0x66dde2=this[_0x2b2d('0x12')](_0x2b2d('0x14'));var _0x10e019=this[_0x2b2d('0x12')](_0x2b2d('0x11'));if(_0x8fa85e===_0x2b2d('0x5')){return _0x10e019;}if(_0x66dde2===_0x2b2d('0x15')&&_0x10e019===_0x2b2d('0xc')||_0x66dde2==='booked'&&_0x10e019===_0x2b2d('0x16')){return _0x10e019;}if(_0x66dde2==='progressive'||_0x66dde2===_0x2b2d('0x17')||_0x66dde2===_0x2b2d('0x18')){return _0x10e019;}return null;}},'servicelevel':{'type':Sequelize[_0x2b2d('0x19')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x2b2d('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x2b2d('0x19')](0xb)},'timeout':{'type':Sequelize[_0x2b2d('0x19')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x2b2d('0x19')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x2b2d('0x2')]},'weight':{'type':Sequelize[_0x2b2d('0x19')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x2b2d('0x19')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x2b2d('0x1a')},'autopause':{'type':Sequelize['ENUM'](_0x2b2d('0x1a'),'no',_0x2b2d('0x1b')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x2b2d('0x19')](0xb)},'autopausebusy':{'type':Sequelize[_0x2b2d('0x4')](_0x2b2d('0x1a'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x2b2d('0x4')](_0x2b2d('0x1a'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x2b2d('0x19')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x2b2d('0x4')](_0x2b2d('0x1a'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x2b2d('0x1a'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x2b2d('0x4')](_0x2b2d('0x1a'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x2b2d('0x4')](_0x2b2d('0x1a'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2b2d('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x2b2d('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x2b2d('0x19')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x2b2d('0x19')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x2b2d('0x19')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x2b2d('0x1a'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x2b2d('0x4')](_0x2b2d('0x1a'),'no'),'defaultValue':_0x2b2d('0x1a')},'announce_holdtime':{'type':Sequelize[_0x2b2d('0x4')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x2b2d('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x2b2d('0x4')](_0x2b2d('0x1a'),'no')},'announce_position_limit':{'type':Sequelize[_0x2b2d('0x19')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x2b2d('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x2b2d('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x2b2d('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x2b2d('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x2b2d('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x2b2d('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x2b2d('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x2b2d('0x2')]},'queue_quantity1':{'type':Sequelize[_0x2b2d('0x2')]},'queue_quantity2':{'type':Sequelize[_0x2b2d('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x2b2d('0x2')]},'queue_less_than':{'type':Sequelize[_0x2b2d('0x2')]},'periodic_announce':{'type':Sequelize[_0x2b2d('0x1c')],'set':function(_0x4c9da5){this[_0x2b2d('0x10')]('periodic_announce',_0x4c9da5?_0x4c9da5[_0x2b2d('0x1d')](','):[]);},'get':function(){return this['getDataValue'](_0x2b2d('0x1e'))?this[_0x2b2d('0x12')](_0x2b2d('0x1e'))[_0x2b2d('0x1f')](','):[];}},'joinempty':{'type':Sequelize[_0x2b2d('0x2')],'defaultValue':_0x2b2d('0x1a'),'set':function(_0x8b382f){this[_0x2b2d('0x10')](_0x2b2d('0x20'),_0x8b382f?_0x8b382f[_0x2b2d('0x1d')](','):[]);},'get':function(){return this['getDataValue'](_0x2b2d('0x20'))?this['getDataValue'](_0x2b2d('0x20'))[_0x2b2d('0x1f')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x2b2d('0x2')],'defaultValue':'no','set':function(_0x1ce1e8){this[_0x2b2d('0x10')](_0x2b2d('0x21'),_0x1ce1e8?_0x1ce1e8[_0x2b2d('0x1d')](','):[]);},'get':function(){return this[_0x2b2d('0x12')](_0x2b2d('0x21'))?this[_0x2b2d('0x12')](_0x2b2d('0x21'))['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0x2b2d('0x4')](_0x2b2d('0x1a'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x2b2d('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2b2d('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x3a629f){this[_0x2b2d('0x10')](_0x2b2d('0x22'),_0x3a629f);if(_0x3a629f){if(this[_0x2b2d('0x12')](_0x2b2d('0x23'))<0x2){this[_0x2b2d('0x10')](_0x2b2d('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x2b2d('0x19')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x2b2d('0x24')],'defaultValue':0x0,'comment':_0x2b2d('0x25')},'dialMethod':{'type':Sequelize[_0x2b2d('0x4')](_0x2b2d('0x26'),_0x2b2d('0x27'),_0x2b2d('0x18'),_0x2b2d('0x17'),_0x2b2d('0x15')),'defaultValue':'progressive','comment':_0x2b2d('0x28')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x2b2d('0x29')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2b2d('0x2a')},'dialLimitQueue':{'type':Sequelize[_0x2b2d('0x19')](0x4)[_0x2b2d('0x29')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2b2d('0x2b')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x2b2d('0x29')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x2b2d('0x2c')},'dialPredictiveOptimization':{'type':Sequelize[_0x2b2d('0x4')](_0x2b2d('0x2d'),_0x2b2d('0x2e')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x2b2d('0x2f')](0x2)[_0x2b2d('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x2b2d('0x30')},'dialPredictiveInterval':{'type':Sequelize[_0x2b2d('0x19')](0x3)[_0x2b2d('0x29')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2b2d('0x31')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2b2d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2b2d('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x2b2d('0x29')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2b2d('0x32')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x2b2d('0x33'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x2b2d('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x2b2d('0x19')](0x3)[_0x2b2d('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2b2d('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2b2d('0x19')](0x5)[_0x2b2d('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x2b2d('0x19')](0x3)[_0x2b2d('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x2b2d('0x19')](0x5)[_0x2b2d('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2b2d('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2b2d('0x19')](0x3)[_0x2b2d('0x29')],'defaultValue':0x3,'comment':_0x2b2d('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2b2d('0x19')](0x5)[_0x2b2d('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2b2d('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2b2d('0x19')](0x3)[_0x2b2d('0x29')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x2b2d('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x2b2d('0x38')},'dialPrefix':{'type':Sequelize[_0x2b2d('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x2b2d('0x4')]('always',_0x2b2d('0x39'),_0x2b2d('0x3a')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x2b2d('0x24')],'defaultValue':0x0,'comment':_0x2b2d('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x2b2d('0x19')](0x9)[_0x2b2d('0x29')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2b2d('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x2b2d('0x19')](0x9)[_0x2b2d('0x29')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2b2d('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2b2d('0x19')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2b2d('0x19')](0x9)[_0x2b2d('0x29')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x2b2d('0x19')](0x9)[_0x2b2d('0x29')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x2b2d('0x29')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2b2d('0x19')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2b2d('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2b2d('0x19')](0x5)[_0x2b2d('0x29')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2b2d('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x2b2d('0x19')](0x5)[_0x2b2d('0x29')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x2b2d('0x24')],'defaultValue':0x0,'comment':_0x2b2d('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2b2d('0x4')](_0x2b2d('0x41'),_0x2b2d('0x42')),'defaultValue':_0x2b2d('0x41')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x2b2d('0x43')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x2b2d('0x24')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2b2d('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x2b2d('0x29')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2b2d('0x45')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2b2d('0x19')],'allowNull':!![],'comment':_0x2b2d('0x46')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2b2d('0x47'),'set':function(_0x909330){if(!_0x909330)this[_0x2b2d('0x10')](_0x2b2d('0x48'),null);this[_0x2b2d('0x10')](_0x2b2d('0x49'),_0x909330);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x2b2d('0x19')](0x3)[_0x2b2d('0x29')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x2b2d('0x19')](0x3)[_0x2b2d('0x29')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x27ac=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','fewestcalls','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x5d9690,_0x690ea0){var _0xc0fd5=function(_0x302f93){while(--_0x302f93){_0x5d9690['push'](_0x5d9690['shift']());}};_0xc0fd5(++_0x690ea0);}(_0x27ac,0x13c));var _0xc27a=function(_0x1b8524,_0x1bb669){_0x1b8524=_0x1b8524-0x0;var _0x81418d=_0x27ac[_0x1b8524];return _0x81418d;};'use strict';var Sequelize=require(_0xc27a('0x0'));module[_0xc27a('0x1')]={'name':{'type':Sequelize[_0xc27a('0x2')],'allowNull':![],'unique':_0xc27a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc27a('0x4')](_0xc27a('0x5'),_0xc27a('0x6')),'allowNull':![],'defaultValue':_0xc27a('0x5')},'musiconhold':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':_0xc27a('0x7')},'announce':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xc27a('0x4')]('rr',_0xc27a('0x8'),'leastrecent',_0xc27a('0x9'),_0xc27a('0xa'),'rrmemory',_0xc27a('0xb'),_0xc27a('0xc'),_0xc27a('0xd')),'allowNull':![],'defaultValue':_0xc27a('0x8'),'set':function(_0x5b3623){this[_0xc27a('0xe')](_0xc27a('0xf'),_0x5b3623?_0x5b3623:_0xc27a('0x10'));},'get':function(){var _0x2bceef=this[_0xc27a('0x11')](_0xc27a('0x12'));var _0x1e6cfe=this['getDataValue'](_0xc27a('0x13'));var _0x4e92cd=this[_0xc27a('0x11')](_0xc27a('0xf'));if(_0x2bceef===_0xc27a('0x5')){return _0x4e92cd;}if(_0x1e6cfe==='booked'&&_0x4e92cd==='rrmemory'||_0x1e6cfe==='booked'&&_0x4e92cd===_0xc27a('0x14')){return _0x4e92cd;}if(_0x1e6cfe===_0xc27a('0x15')||_0x1e6cfe===_0xc27a('0x16')||_0x1e6cfe===_0xc27a('0x17')){return _0x4e92cd;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xc27a('0x18')](0xb)},'timeout':{'type':Sequelize[_0xc27a('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xc27a('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xc27a('0x2')]},'weight':{'type':Sequelize[_0xc27a('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xc27a('0x4')](_0xc27a('0x19'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xc27a('0x4')](_0xc27a('0x19'),'no',_0xc27a('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xc27a('0x18')](0xb)},'autopausebusy':{'type':Sequelize[_0xc27a('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xc27a('0x4')](_0xc27a('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xc27a('0x4')](_0xc27a('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xc27a('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xc27a('0x4')](_0xc27a('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xc27a('0x4')](_0xc27a('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xc27a('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xc27a('0x18')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xc27a('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xc27a('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xc27a('0x19'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xc27a('0x4')](_0xc27a('0x19'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xc27a('0x4')]('yes','no',_0xc27a('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xc27a('0x4')](_0xc27a('0x19'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xc27a('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xc27a('0x2')]},'queue_youarenext':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xc27a('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xc27a('0x2')]},'queue_quantity1':{'type':Sequelize[_0xc27a('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xc27a('0x2')]},'queue_less_than':{'type':Sequelize[_0xc27a('0x2')]},'periodic_announce':{'type':Sequelize[_0xc27a('0x1c')],'set':function(_0x35a547){this['setDataValue'](_0xc27a('0x1d'),_0x35a547?_0x35a547[_0xc27a('0x1e')](','):[]);},'get':function(){return this[_0xc27a('0x11')](_0xc27a('0x1d'))?this[_0xc27a('0x11')](_0xc27a('0x1d'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':'yes','set':function(_0x266bf0){this[_0xc27a('0xe')](_0xc27a('0x1f'),_0x266bf0?_0x266bf0[_0xc27a('0x1e')](','):[]);},'get':function(){return this[_0xc27a('0x11')](_0xc27a('0x1f'))?this[_0xc27a('0x11')]('joinempty')[_0xc27a('0x20')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':'no','set':function(_0x1222ba){this[_0xc27a('0xe')](_0xc27a('0x21'),_0x1222ba?_0x1222ba[_0xc27a('0x1e')](','):[]);},'get':function(){return this[_0xc27a('0x11')](_0xc27a('0x21'))?this[_0xc27a('0x11')](_0xc27a('0x21'))['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0xc27a('0x4')](_0xc27a('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xc27a('0x4')](_0xc27a('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xc27a('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xc27a('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xc27a('0x2')]},'description':{'type':Sequelize[_0xc27a('0x2')]},'acw':{'type':Sequelize[_0xc27a('0x22')],'defaultValue':0x0,'set':function(_0xeef205){this[_0xc27a('0xe')](_0xc27a('0x23'),_0xeef205);if(_0xeef205){if(this[_0xc27a('0x11')]('wrapuptime')<0x2){this[_0xc27a('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xc27a('0x22')],'defaultValue':0x0,'comment':_0xc27a('0x24')},'dialMethod':{'type':Sequelize[_0xc27a('0x4')](_0xc27a('0x25'),_0xc27a('0x15'),_0xc27a('0x17'),_0xc27a('0x16'),'booked'),'defaultValue':_0xc27a('0x15'),'comment':_0xc27a('0x26')},'dialLimitChannel':{'type':Sequelize[_0xc27a('0x18')](0x4)[_0xc27a('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xc27a('0x18')](0x4)[_0xc27a('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xc27a('0x28')},'dialPowerLevel':{'type':Sequelize[_0xc27a('0x29')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xc27a('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0xc27a('0x4')](_0xc27a('0x2b'),_0xc27a('0x2c')),'defaultValue':_0xc27a('0x2c'),'comment':_0xc27a('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xc27a('0x29')](0x2)[_0xc27a('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xc27a('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0xc27a('0x18')](0x3)[_0xc27a('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xc27a('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc27a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc27a('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc27a('0x18')](0x3)[_0xc27a('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xc27a('0x30'),'comment':_0xc27a('0x31')},'dialQueueTimeout':{'type':Sequelize[_0xc27a('0x18')](0x3)[_0xc27a('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc27a('0x32')},'dialQueueProject':{'type':Sequelize[_0xc27a('0x2')],'comment':_0xc27a('0x33')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc27a('0x18')](0x3)[_0xc27a('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc27a('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc27a('0x35')},'dialBusyMaxRetry':{'type':Sequelize[_0xc27a('0x18')](0x3)[_0xc27a('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc27a('0x36')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc27a('0x37')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc27a('0x18')](0x3)[_0xc27a('0x27')],'defaultValue':0x3,'comment':_0xc27a('0x38')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc27a('0x18')](0x5)[_0xc27a('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc27a('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc27a('0x39')},'dialTimezone':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xc27a('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xc27a('0x3a'),_0xc27a('0x3b')),'defaultValue':_0xc27a('0x3c')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc27a('0x3d')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc27a('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc27a('0x3e')},'dialAMDGreeting':{'type':Sequelize[_0xc27a('0x18')](0x9)[_0xc27a('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc27a('0x3f')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc27a('0x18')](0x9)[_0xc27a('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc27a('0x40')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc27a('0x18')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc27a('0x41')},'dialAMDMinWordLength':{'type':Sequelize[_0xc27a('0x18')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc27a('0x42')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc27a('0x18')](0x9)[_0xc27a('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc27a('0x43')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc27a('0x18')](0x9)[_0xc27a('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc27a('0x44')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc27a('0x18')](0x5)[_0xc27a('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc27a('0x45')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc27a('0x18')](0x9)[_0xc27a('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xc27a('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xc27a('0x22')],'defaultValue':0x0,'comment':_0xc27a('0x46')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc27a('0x4')]('DESC','ASC'),'defaultValue':_0xc27a('0x47')},'dialQueueProject2':{'type':Sequelize[_0xc27a('0x2')],'comment':_0xc27a('0x33')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xc27a('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xc27a('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc27a('0x18')](0x3)[_0xc27a('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xc27a('0x18')](0x3)[_0xc27a('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc27a('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc27a('0x18')],'allowNull':!![],'comment':_0xc27a('0x49')},'mandatoryDisposition':{'type':Sequelize[_0xc27a('0x22')],'defaultValue':![],'comment':_0xc27a('0x4a'),'set':function(_0x506234){if(!_0x506234)this[_0xc27a('0xe')]('mandatoryDispositionPauseId',null);this[_0xc27a('0xe')](_0xc27a('0x4b'),_0x506234);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xc27a('0x18')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 0675bca..ac438cf 100644 --- a/server/api/voiceQueue/voiceQueue.controller.js +++ b/server/api/voiceQueue/voiceQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a69=['getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','User','online','voicePause','forEach','penalty','Agents','sequelize','transaction','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','interface','format','emit','userVoiceQueue:save','removeTeams','select','tq.TeamId','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','removeAgents','userVoiceQueue:remove','addAgents','ids','spread','isEmpty','SIP/%s','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','ContactId','CmListId','NOW()','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','into','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','zip-dir','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','VoiceQueues','inbound','ignore','map','value','includes','type','find','name','error','stack','send','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','key','VIRTUAL','field','VoiceQueue','includeAll','include','findAll','rows','catch','show','params','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','clone','omit','updatedAt','body','createdAt','outbound','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getHoppers','CmHopper','nolimit','VoiceQueueId','getHopperHistories','CmHopperHistory','options'];(function(_0x3909f1,_0x3b24fa){var _0x2f02e3=function(_0x16e6f6){while(--_0x16e6f6){_0x3909f1['push'](_0x3909f1['shift']());}};_0x2f02e3(++_0x3b24fa);}(_0x5a69,0x1c0));var _0x95a6=function(_0x5953fd,_0x4fbcc2){_0x5953fd=_0x5953fd-0x0;var _0x3b132f=_0x5a69[_0x5953fd];return _0x3b132f;};'use strict';var pdf=require(_0x95a6('0x0'));var emlformat=require(_0x95a6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x95a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x95a6('0x3'));var BPromise=require(_0x95a6('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x95a6('0x5'));var sox=require(_0x95a6('0x6'));var csv=require(_0x95a6('0x7'));var ejs=require(_0x95a6('0x8'));var fs=require('fs');var _=require(_0x95a6('0x9'));var squel=require(_0x95a6('0xa'));var crypto=require('crypto');var jsforce=require(_0x95a6('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x95a6('0xc'));var Papa=require(_0x95a6('0xd'));var Redis=require(_0x95a6('0xe'));var authService=require(_0x95a6('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x95a6('0x10'));var logger=require(_0x95a6('0x11'))(_0x95a6('0x12'));var utils=require(_0x95a6('0x13'));var config=require(_0x95a6('0x14'));var db=require(_0x95a6('0x15'))['db'];config[_0x95a6('0x16')]=_[_0x95a6('0x17')](config['redis'],{'host':_0x95a6('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x95a6('0x16')]));require(_0x95a6('0x19'))[_0x95a6('0x1a')](socket);function respondWithStatusCode(_0x133181,_0x5b93a1){_0x5b93a1=_0x5b93a1||0xcc;return function(_0x168d7d){if(_0x168d7d){return _0x133181[_0x95a6('0x1b')](_0x5b93a1);}return _0x133181[_0x95a6('0x1c')](_0x5b93a1)[_0x95a6('0x1d')]();};}function respondWithResult(_0x1d5ac9,_0x469ac2){_0x469ac2=_0x469ac2||0xc8;return function(_0x39c067){if(_0x39c067){return _0x1d5ac9['status'](_0x469ac2)[_0x95a6('0x1e')](_0x39c067);}};}function respondWithFilteredResult(_0x19dbcb,_0x37824f){return function(_0x14340b){if(_0x14340b){var _0x1c373c=_0x14340b[_0x95a6('0x1f')],_0x383826=_0x37824f[_0x95a6('0x20')],_0x1d0725=_0x37824f[_0x95a6('0x20')]+_0x37824f['limit'],_0x57f3e2;if(_0x1d0725>=_0x1c373c){_0x1d0725=_0x1c373c;_0x57f3e2=0xc8;}else{_0x57f3e2=0xce;}_0x19dbcb['status'](_0x57f3e2);return _0x19dbcb[_0x95a6('0x21')](_0x95a6('0x22'),_0x383826+'-'+_0x1d0725+'/'+_0x1c373c)[_0x95a6('0x1e')](_0x14340b);}return null;};}function patchUpdates(_0xafa971){return function(_0x67451f){try{jsonpatch['apply'](_0x67451f,_0xafa971,!![]);}catch(_0x308ffe){return BPromise[_0x95a6('0x23')](_0x308ffe);}return _0x67451f[_0x95a6('0x24')]();};}function saveUpdates(_0x15658f,_0x19362e){return function(_0x319a94){if(_0x319a94){return _0x319a94[_0x95a6('0x25')](_0x15658f)['then'](function(_0x49b71e){return _0x49b71e;});}return null;};}function removeEntity(_0x2cce3e,_0x55e1d8){return function(_0x577884){if(_0x577884){return _0x577884['destroy']()[_0x95a6('0x26')](function(){var _0x4d0a9a=_0x577884['get']({'plain':!![]});var _0x53740c=[{'name':_0x95a6('0x27'),'value':_0x95a6('0x28'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x89fe80=_(_0x53740c)['filter'](_0x95a6('0x29'))[_0x95a6('0x2a')](_0x95a6('0x2b'))[_0x95a6('0x2b')]();if(_[_0x95a6('0x2c')](_0x89fe80,_0x4d0a9a[_0x95a6('0x2d')])){return;}var _0xfed28b=_[_0x95a6('0x2e')](_0x53740c,['value',_0x4d0a9a[_0x95a6('0x2d')]])[_0x95a6('0x2f')];return db['UserProfileResource']['destroy']({'where':{'type':_0xfed28b,'resourceId':_0x4d0a9a['id']}})[_0x95a6('0x26')](function(){return _0x577884;});})['then'](function(){_0x2cce3e[_0x95a6('0x1c')](0xcc)[_0x95a6('0x1d')]();});}};}function handleEntityNotFound(_0x5df6a6,_0x2e0aaa){return function(_0x5e14bf){if(!_0x5e14bf){_0x5df6a6['sendStatus'](0x194);}return _0x5e14bf;};}function handleError(_0x788561,_0x3ecb70){_0x3ecb70=_0x3ecb70||0x1f4;return function(_0x1c23cc){logger[_0x95a6('0x30')](_0x1c23cc[_0x95a6('0x31')]);if(_0x1c23cc[_0x95a6('0x2f')]){delete _0x1c23cc[_0x95a6('0x2f')];}_0x788561['status'](_0x3ecb70)[_0x95a6('0x32')](_0x1c23cc);};}exports['index']=function(_0x2532d2,_0x23576b){var _0xb73c6d={},_0x25d017={},_0x43107f={'count':0x0,'rows':[]};var _0x3cc56f=db['VoiceQueue'][_0x95a6('0x33')];_0x25d017[_0x95a6('0x34')]=_[_0x95a6('0x35')](_0x3cc56f);_0x25d017[_0x95a6('0x36')]=_['keys'](_0x2532d2[_0x95a6('0x36')]);_0x25d017['filters']=_[_0x95a6('0x37')](_0x25d017['model'],_0x25d017[_0x95a6('0x36')]);_0xb73c6d[_0x95a6('0x38')]=_[_0x95a6('0x37')](_0x25d017[_0x95a6('0x34')],qs[_0x95a6('0x39')](_0x2532d2[_0x95a6('0x36')][_0x95a6('0x39')]));_0xb73c6d[_0x95a6('0x38')]=_0xb73c6d[_0x95a6('0x38')][_0x95a6('0x3a')]?_0xb73c6d[_0x95a6('0x38')]:_0x25d017['model'];if(!_0x2532d2[_0x95a6('0x36')][_0x95a6('0x3b')]('nolimit')){_0xb73c6d[_0x95a6('0x3c')]=qs['limit'](_0x2532d2[_0x95a6('0x36')][_0x95a6('0x3c')]);_0xb73c6d[_0x95a6('0x20')]=qs[_0x95a6('0x20')](_0x2532d2[_0x95a6('0x36')][_0x95a6('0x20')]);}_0xb73c6d[_0x95a6('0x3d')]=qs[_0x95a6('0x3e')](_0x2532d2[_0x95a6('0x36')][_0x95a6('0x3e')]);_0xb73c6d[_0x95a6('0x3f')]=qs[_0x95a6('0x40')](_[_0x95a6('0x41')](_0x2532d2[_0x95a6('0x36')],_0x25d017[_0x95a6('0x40')]));if(_0x2532d2[_0x95a6('0x36')][_0x95a6('0x42')]){_0xb73c6d['where']=_[_0x95a6('0x43')](_0xb73c6d[_0x95a6('0x3f')],{'$or':_[_0x95a6('0x2a')](_0x3cc56f,function(_0x4736be){if(_0x4736be[_0x95a6('0x2d')][_0x95a6('0x44')]!==_0x95a6('0x45')){var _0x2bca42={};_0x2bca42[_0x4736be[_0x95a6('0x46')]]={'$like':'%'+_0x2532d2['query'][_0x95a6('0x42')]+'%'};return _0x2bca42;}})});}_0xb73c6d=_[_0x95a6('0x43')]({},_0xb73c6d,_0x2532d2['options']);var _0x5c6d4b={'where':_0xb73c6d[_0x95a6('0x3f')]};return db[_0x95a6('0x47')][_0x95a6('0x1f')](_0x5c6d4b)[_0x95a6('0x26')](function(_0xb8cf58){_0x43107f[_0x95a6('0x1f')]=_0xb8cf58;if(_0x2532d2['query'][_0x95a6('0x48')]){_0xb73c6d[_0x95a6('0x49')]=[{'all':!![]}];}return db[_0x95a6('0x47')][_0x95a6('0x4a')](_0xb73c6d);})[_0x95a6('0x26')](function(_0xa520f9){_0x43107f[_0x95a6('0x4b')]=_0xa520f9;return _0x43107f;})[_0x95a6('0x26')](respondWithFilteredResult(_0x23576b,_0xb73c6d))[_0x95a6('0x4c')](handleError(_0x23576b,null));};exports[_0x95a6('0x4d')]=function(_0x461531,_0x54b334){var _0x413cba={'raw':![],'where':{'id':_0x461531[_0x95a6('0x4e')]['id']}},_0x16bd7b={};_0x16bd7b[_0x95a6('0x34')]=_['keys'](db[_0x95a6('0x47')]['rawAttributes']);_0x16bd7b[_0x95a6('0x36')]=_[_0x95a6('0x35')](_0x461531[_0x95a6('0x36')]);_0x16bd7b[_0x95a6('0x40')]=_[_0x95a6('0x37')](_0x16bd7b[_0x95a6('0x34')],_0x16bd7b['query']);_0x413cba[_0x95a6('0x38')]=_[_0x95a6('0x37')](_0x16bd7b[_0x95a6('0x34')],qs['fields'](_0x461531[_0x95a6('0x36')]['fields']));_0x413cba[_0x95a6('0x38')]=_0x413cba[_0x95a6('0x38')][_0x95a6('0x3a')]?_0x413cba[_0x95a6('0x38')]:_0x16bd7b[_0x95a6('0x34')];if(_0x461531[_0x95a6('0x36')][_0x95a6('0x48')]){_0x413cba[_0x95a6('0x49')]=[{'all':!![]}];}_0x413cba=_[_0x95a6('0x43')]({},_0x413cba,_0x461531['options']);return db[_0x95a6('0x47')][_0x95a6('0x2e')](_0x413cba)['then'](handleEntityNotFound(_0x54b334,null))['then'](respondWithResult(_0x54b334,null))['catch'](handleError(_0x54b334,null));};exports[_0x95a6('0x4f')]=function(_0x299435,_0x4a4620){return db['VoiceQueue'][_0x95a6('0x4f')](_0x299435['body'],{})['then'](function(_0x5808d3){var _0x2afbb4=_0x299435['user'][_0x95a6('0x50')]({'plain':!![]});if(!_0x2afbb4)throw new Error(_0x95a6('0x51'));if(_0x2afbb4[_0x95a6('0x52')]===_0x95a6('0x53')){var _0x560975=_0x5808d3[_0x95a6('0x50')]({'plain':!![]});var _0x5da65e=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x95a6('0x54'),'value':'outbound'}];var _0x53fc64=_['find'](_0x5da65e,[_0x95a6('0x2b'),_0x560975[_0x95a6('0x2d')]])[_0x95a6('0x2f')];return db[_0x95a6('0x55')][_0x95a6('0x2e')]({'where':{'name':_0x53fc64,'userProfileId':_0x2afbb4[_0x95a6('0x56')]},'raw':!![]})['then'](function(_0x37676e){if(_0x37676e&&_0x37676e[_0x95a6('0x57')]===0x0){return db[_0x95a6('0x58')][_0x95a6('0x4f')]({'name':_0x560975[_0x95a6('0x2f')],'resourceId':_0x560975['id'],'type':_0x37676e['name'],'sectionId':_0x37676e['id']},{})[_0x95a6('0x26')](function(){return _0x5808d3;});}else{return _0x5808d3;}})[_0x95a6('0x4c')](function(_0x13317a){logger[_0x95a6('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13317a);throw _0x13317a;});}return _0x5808d3;})[_0x95a6('0x26')](respondWithResult(_0x4a4620,0xc9))[_0x95a6('0x4c')](handleError(_0x4a4620,null));};exports[_0x95a6('0x59')]=function(_0x1fa827,_0x123e2e){var _0x135c8d={'raw':![],'where':{'id':_0x1fa827[_0x95a6('0x4e')]['id']}},_0x374276={};_0x374276[_0x95a6('0x34')]=_['keys'](db[_0x95a6('0x47')]['rawAttributes']);_0x135c8d[_0x95a6('0x38')]=_['intersection'](_0x374276['model'],qs[_0x95a6('0x39')](_0x1fa827[_0x95a6('0x36')][_0x95a6('0x39')]));_0x135c8d[_0x95a6('0x38')]=_0x135c8d[_0x95a6('0x38')][_0x95a6('0x3a')]?_0x135c8d[_0x95a6('0x38')]:_0x374276[_0x95a6('0x34')];if(_0x1fa827[_0x95a6('0x36')]['includeAll']){_0x135c8d[_0x95a6('0x49')]=[{'all':!![]}];}_0x135c8d=_[_0x95a6('0x43')]({},_0x135c8d,_0x1fa827['options']);return db['VoiceQueue'][_0x95a6('0x2e')](_0x135c8d)['then'](handleEntityNotFound(_0x123e2e,null))[_0x95a6('0x26')](function(_0x10f0e7){if(_0x10f0e7){var _0x35b063=_0x10f0e7['get']({'plain':!![]});_0x35b063=qs[_0x95a6('0x5a')](_0x35b063,['id','createdAt',_0x95a6('0x5b')]);_0x1fa827[_0x95a6('0x5c')]=_[_0x95a6('0x5a')](_0x1fa827[_0x95a6('0x5c')],['id',_0x95a6('0x5d'),_0x95a6('0x5b')]);return db['VoiceQueue'][_0x95a6('0x4f')](_['merge'](_0x35b063,_0x1fa827['body']),{'include':_0x1fa827['query'][_0x95a6('0x48')]?[{'all':!![]}]:undefined})[_0x95a6('0x26')](function(_0x31c3ef){var _0x1fde77=_0x1fa827[_0x95a6('0x53')][_0x95a6('0x50')]({'plain':!![]});if(!_0x1fde77)throw new Error(_0x95a6('0x51'));if(_0x1fde77[_0x95a6('0x52')]===_0x95a6('0x53')){var _0x2d7391=_0x31c3ef['get']({'plain':!![]});var _0x545bba=[{'name':_0x95a6('0x27'),'value':_0x95a6('0x28')},{'name':_0x95a6('0x54'),'value':_0x95a6('0x5e')}];var _0x42ebe2=_[_0x95a6('0x2e')](_0x545bba,['value',_0x2d7391[_0x95a6('0x2d')]])[_0x95a6('0x2f')];return db[_0x95a6('0x55')][_0x95a6('0x2e')]({'where':{'name':_0x42ebe2,'userProfileId':_0x1fde77[_0x95a6('0x56')]},'raw':!![]})['then'](function(_0x48a791){if(_0x48a791&&_0x48a791[_0x95a6('0x57')]===0x0){return db['UserProfileResource'][_0x95a6('0x4f')]({'name':_0x2d7391[_0x95a6('0x2f')],'resourceId':_0x2d7391['id'],'type':_0x48a791[_0x95a6('0x2f')],'sectionId':_0x48a791['id']},{})['then'](function(){return _0x31c3ef;});}else{return _0x31c3ef;}})[_0x95a6('0x4c')](function(_0x1ee51b){logger['error'](_0x95a6('0x5f'),_0x1ee51b);throw _0x1ee51b;});}return _0x31c3ef;});}})[_0x95a6('0x26')](respondWithResult(_0x123e2e,0xc9))[_0x95a6('0x4c')](handleError(_0x123e2e,null));};exports['update']=function(_0xd6c419,_0x5d69c9){if(_0xd6c419[_0x95a6('0x5c')]['id']){delete _0xd6c419['body']['id'];}return db[_0x95a6('0x47')][_0x95a6('0x2e')]({'where':{'id':_0xd6c419[_0x95a6('0x4e')]['id']}})[_0x95a6('0x26')](handleEntityNotFound(_0x5d69c9,null))[_0x95a6('0x26')](saveUpdates(_0xd6c419[_0x95a6('0x5c')],null))[_0x95a6('0x26')](respondWithResult(_0x5d69c9,null))[_0x95a6('0x4c')](handleError(_0x5d69c9,null));};exports[_0x95a6('0x60')]=function(_0x57f32d,_0x1d39dd){return db[_0x95a6('0x47')][_0x95a6('0x2e')]({'where':{'id':_0x57f32d['params']['id']}})[_0x95a6('0x26')](handleEntityNotFound(_0x1d39dd,null))[_0x95a6('0x26')](removeEntity(_0x1d39dd,null))[_0x95a6('0x4c')](handleError(_0x1d39dd,null));};exports[_0x95a6('0x61')]=function(_0x444959,_0x3ecf1e,_0x3a3346){var _0x171399={'raw':![],'where':{}};var _0x587354={};var _0x131114={'count':0x0,'rows':[]};return db[_0x95a6('0x47')]['findOne']({'where':{'id':_0x444959[_0x95a6('0x4e')]['id']}})[_0x95a6('0x26')](handleEntityNotFound(_0x3ecf1e,null))[_0x95a6('0x26')](function(_0x1d05f7){if(_0x1d05f7){_0x587354[_0x95a6('0x34')]=_[_0x95a6('0x35')](db[_0x95a6('0x62')][_0x95a6('0x33')]);_0x587354[_0x95a6('0x36')]=_[_0x95a6('0x35')](_0x444959[_0x95a6('0x36')]);_0x587354[_0x95a6('0x40')]=_['intersection'](_0x587354[_0x95a6('0x34')],_0x587354['query']);_0x171399[_0x95a6('0x38')]=_['intersection'](_0x587354[_0x95a6('0x34')],qs[_0x95a6('0x39')](_0x444959['query'][_0x95a6('0x39')]));_0x171399[_0x95a6('0x38')]=_0x171399[_0x95a6('0x38')][_0x95a6('0x3a')]?_0x171399['attributes']:_0x587354[_0x95a6('0x34')];if(!_0x444959[_0x95a6('0x36')][_0x95a6('0x3b')](_0x95a6('0x63'))){_0x171399['limit']=qs[_0x95a6('0x3c')](_0x444959[_0x95a6('0x36')][_0x95a6('0x3c')]);_0x171399['offset']=qs[_0x95a6('0x20')](_0x444959[_0x95a6('0x36')][_0x95a6('0x20')]);}_0x171399[_0x95a6('0x3d')]=qs[_0x95a6('0x3e')](_0x444959['query'][_0x95a6('0x3e')]);_0x171399[_0x95a6('0x3f')]=qs[_0x95a6('0x40')](_[_0x95a6('0x41')](_0x444959[_0x95a6('0x36')],_0x587354[_0x95a6('0x40')]));_0x171399[_0x95a6('0x3f')][_0x95a6('0x64')]=_0x1d05f7['id'];if(_0x444959[_0x95a6('0x36')][_0x95a6('0x42')]){_0x171399[_0x95a6('0x3f')]=_[_0x95a6('0x43')](_0x171399[_0x95a6('0x3f')],{'$or':_[_0x95a6('0x2a')](_0x171399['attributes'],function(_0x5019eb){var _0x440862={};_0x440862[_0x5019eb]={'$like':'%'+_0x444959[_0x95a6('0x36')]['filter']+'%'};return _0x440862;})});}_0x171399=_[_0x95a6('0x43')]({},_0x171399,_0x444959['options']);return db[_0x95a6('0x62')][_0x95a6('0x1f')]({'where':_0x171399['where']})[_0x95a6('0x26')](function(_0x4a4c1e){_0x131114[_0x95a6('0x1f')]=_0x4a4c1e;if(_0x444959[_0x95a6('0x36')][_0x95a6('0x48')]){_0x171399[_0x95a6('0x49')]=[{'all':!![]}];}return db[_0x95a6('0x62')][_0x95a6('0x4a')](_0x171399);})['then'](function(_0x3e8476){_0x131114[_0x95a6('0x4b')]=_0x3e8476;return _0x131114;});}})[_0x95a6('0x26')](respondWithFilteredResult(_0x3ecf1e,_0x171399))['catch'](handleError(_0x3ecf1e,null));};exports[_0x95a6('0x65')]=function(_0xa168a1,_0x2fb50f,_0x232ef6){var _0x5ef7bb={'raw':!![],'where':{}};var _0x3a563a={};var _0x33b078={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0xa168a1[_0x95a6('0x4e')]['id']}})[_0x95a6('0x26')](handleEntityNotFound(_0x2fb50f,null))[_0x95a6('0x26')](function(_0x37c1d8){if(_0x37c1d8){_0x3a563a['model']=_['keys'](db[_0x95a6('0x66')]['rawAttributes']);_0x3a563a[_0x95a6('0x36')]=_[_0x95a6('0x35')](_0xa168a1['query']);_0x3a563a['filters']=_[_0x95a6('0x37')](_0x3a563a[_0x95a6('0x34')],_0x3a563a[_0x95a6('0x36')]);_0x5ef7bb[_0x95a6('0x38')]=_[_0x95a6('0x37')](_0x3a563a['model'],qs[_0x95a6('0x39')](_0xa168a1[_0x95a6('0x36')][_0x95a6('0x39')]));_0x5ef7bb[_0x95a6('0x38')]=_0x5ef7bb[_0x95a6('0x38')][_0x95a6('0x3a')]?_0x5ef7bb[_0x95a6('0x38')]:_0x3a563a[_0x95a6('0x34')];if(!_0xa168a1[_0x95a6('0x36')][_0x95a6('0x3b')](_0x95a6('0x63'))){_0x5ef7bb[_0x95a6('0x3c')]=qs[_0x95a6('0x3c')](_0xa168a1['query'][_0x95a6('0x3c')]);_0x5ef7bb[_0x95a6('0x20')]=qs['offset'](_0xa168a1['query']['offset']);}_0x5ef7bb['order']=qs[_0x95a6('0x3e')](_0xa168a1[_0x95a6('0x36')][_0x95a6('0x3e')]);_0x5ef7bb['where']=qs[_0x95a6('0x40')](_['pick'](_0xa168a1[_0x95a6('0x36')],_0x3a563a[_0x95a6('0x40')]));_0x5ef7bb[_0x95a6('0x3f')][_0x95a6('0x64')]=_0x37c1d8['id'];if(_0xa168a1['query'][_0x95a6('0x42')]){_0x5ef7bb[_0x95a6('0x3f')]=_[_0x95a6('0x43')](_0x5ef7bb[_0x95a6('0x3f')],{'$or':_['map'](_0x5ef7bb[_0x95a6('0x38')],function(_0x416b75){var _0x4ab658={};_0x4ab658[_0x416b75]={'$like':'%'+_0xa168a1['query'][_0x95a6('0x42')]+'%'};return _0x4ab658;})});}_0x5ef7bb=_[_0x95a6('0x43')]({},_0x5ef7bb,_0xa168a1[_0x95a6('0x67')]);return db[_0x95a6('0x66')][_0x95a6('0x1f')]({'where':_0x5ef7bb[_0x95a6('0x3f')]})[_0x95a6('0x26')](function(_0x5b5fb5){_0x33b078[_0x95a6('0x1f')]=_0x5b5fb5;if(_0xa168a1[_0x95a6('0x36')][_0x95a6('0x48')]){_0x5ef7bb[_0x95a6('0x49')]=[{'all':!![]}];}return db[_0x95a6('0x66')][_0x95a6('0x4a')](_0x5ef7bb);})[_0x95a6('0x26')](function(_0x5a2bfa){_0x33b078['rows']=_0x5a2bfa;return _0x33b078;});}})[_0x95a6('0x26')](respondWithFilteredResult(_0x2fb50f,_0x5ef7bb))[_0x95a6('0x4c')](handleError(_0x2fb50f,null));};exports[_0x95a6('0x68')]=function(_0x369896,_0x277912,_0x1b0f21){var _0x11e71a={'raw':!![],'where':{}};var _0xe022fc={};var _0x592b8e={'count':0x0,'rows':[]};return db[_0x95a6('0x47')][_0x95a6('0x69')]({'where':{'id':_0x369896[_0x95a6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x277912,null))[_0x95a6('0x26')](function(_0x4f4cb9){if(_0x4f4cb9){_0xe022fc[_0x95a6('0x34')]=_[_0x95a6('0x35')](db[_0x95a6('0x6a')][_0x95a6('0x33')]);_0xe022fc['query']=_[_0x95a6('0x35')](_0x369896[_0x95a6('0x36')]);_0xe022fc[_0x95a6('0x40')]=_[_0x95a6('0x37')](_0xe022fc[_0x95a6('0x34')],_0xe022fc[_0x95a6('0x36')]);_0x11e71a['attributes']=_[_0x95a6('0x37')](_0xe022fc[_0x95a6('0x34')],qs[_0x95a6('0x39')](_0x369896['query'][_0x95a6('0x39')]));_0x11e71a['attributes']=_0x11e71a[_0x95a6('0x38')][_0x95a6('0x3a')]?_0x11e71a[_0x95a6('0x38')]:_0xe022fc[_0x95a6('0x34')];if(!_0x369896['query']['hasOwnProperty'](_0x95a6('0x63'))){_0x11e71a[_0x95a6('0x3c')]=qs['limit'](_0x369896['query']['limit']);_0x11e71a['offset']=qs[_0x95a6('0x20')](_0x369896[_0x95a6('0x36')][_0x95a6('0x20')]);}_0x11e71a[_0x95a6('0x3d')]=qs[_0x95a6('0x3e')](_0x369896[_0x95a6('0x36')][_0x95a6('0x3e')]);_0x11e71a[_0x95a6('0x3f')]=qs[_0x95a6('0x40')](_[_0x95a6('0x41')](_0x369896[_0x95a6('0x36')],_0xe022fc['filters']));_0x11e71a['where'][_0x95a6('0x64')]=_0x4f4cb9['id'];if(_0x369896[_0x95a6('0x36')][_0x95a6('0x42')]){_0x11e71a[_0x95a6('0x3f')]=_['merge'](_0x11e71a[_0x95a6('0x3f')],{'$or':_[_0x95a6('0x2a')](_0x11e71a['attributes'],function(_0x1bc5ac){var _0x47dbf7={};_0x47dbf7[_0x1bc5ac]={'$like':'%'+_0x369896['query']['filter']+'%'};return _0x47dbf7;})});}_0x11e71a=_[_0x95a6('0x43')]({},_0x11e71a,_0x369896['options']);return db[_0x95a6('0x6a')][_0x95a6('0x1f')]({'where':_0x11e71a[_0x95a6('0x3f')]})['then'](function(_0x2b9f55){_0x592b8e[_0x95a6('0x1f')]=_0x2b9f55;if(_0x369896[_0x95a6('0x36')][_0x95a6('0x48')]){_0x11e71a[_0x95a6('0x49')]=[{'all':!![]}];}return db[_0x95a6('0x6a')][_0x95a6('0x4a')](_0x11e71a);})[_0x95a6('0x26')](function(_0x4a6f73){_0x592b8e[_0x95a6('0x4b')]=_0x4a6f73;return _0x592b8e;});}})['then'](respondWithFilteredResult(_0x277912,_0x11e71a))['catch'](handleError(_0x277912,null));};exports[_0x95a6('0x6b')]=function(_0x3a108a,_0x18166c,_0x47dc60){var _0x2f8a78={'raw':!![],'where':{}};var _0x5e4f1f={};var _0x1527eb={'count':0x0,'rows':[]};return db[_0x95a6('0x47')][_0x95a6('0x69')]({'where':{'id':_0x3a108a[_0x95a6('0x4e')]['id']}})[_0x95a6('0x26')](handleEntityNotFound(_0x18166c,null))[_0x95a6('0x26')](function(_0x386e05){if(_0x386e05){_0x5e4f1f['model']=_[_0x95a6('0x35')](db['CmHopperBlack'][_0x95a6('0x33')]);_0x5e4f1f[_0x95a6('0x36')]=_[_0x95a6('0x35')](_0x3a108a[_0x95a6('0x36')]);_0x5e4f1f[_0x95a6('0x40')]=_[_0x95a6('0x37')](_0x5e4f1f[_0x95a6('0x34')],_0x5e4f1f[_0x95a6('0x36')]);_0x2f8a78[_0x95a6('0x38')]=_[_0x95a6('0x37')](_0x5e4f1f[_0x95a6('0x34')],qs[_0x95a6('0x39')](_0x3a108a[_0x95a6('0x36')]['fields']));_0x2f8a78['attributes']=_0x2f8a78['attributes'][_0x95a6('0x3a')]?_0x2f8a78[_0x95a6('0x38')]:_0x5e4f1f[_0x95a6('0x34')];if(!_0x3a108a[_0x95a6('0x36')][_0x95a6('0x3b')](_0x95a6('0x63'))){_0x2f8a78[_0x95a6('0x3c')]=qs[_0x95a6('0x3c')](_0x3a108a[_0x95a6('0x36')][_0x95a6('0x3c')]);_0x2f8a78[_0x95a6('0x20')]=qs[_0x95a6('0x20')](_0x3a108a['query']['offset']);}_0x2f8a78[_0x95a6('0x3d')]=qs[_0x95a6('0x3e')](_0x3a108a[_0x95a6('0x36')][_0x95a6('0x3e')]);_0x2f8a78[_0x95a6('0x3f')]=qs[_0x95a6('0x40')](_[_0x95a6('0x41')](_0x3a108a[_0x95a6('0x36')],_0x5e4f1f[_0x95a6('0x40')]));_0x2f8a78[_0x95a6('0x3f')][_0x95a6('0x64')]=_0x386e05['id'];if(_0x3a108a['query'][_0x95a6('0x42')]){_0x2f8a78[_0x95a6('0x3f')]=_[_0x95a6('0x43')](_0x2f8a78['where'],{'$or':_[_0x95a6('0x2a')](_0x2f8a78[_0x95a6('0x38')],function(_0x5d4eff){var _0x4add15={};_0x4add15[_0x5d4eff]={'$like':'%'+_0x3a108a[_0x95a6('0x36')]['filter']+'%'};return _0x4add15;})});}_0x2f8a78=_['merge']({},_0x2f8a78,_0x3a108a[_0x95a6('0x67')]);return db['CmHopperBlack']['count']({'where':_0x2f8a78[_0x95a6('0x3f')]})['then'](function(_0xf1a920){_0x1527eb[_0x95a6('0x1f')]=_0xf1a920;if(_0x3a108a[_0x95a6('0x36')]['includeAll']){_0x2f8a78[_0x95a6('0x49')]=[{'all':!![]}];}return db[_0x95a6('0x6c')][_0x95a6('0x4a')](_0x2f8a78);})[_0x95a6('0x26')](function(_0x316018){_0x1527eb[_0x95a6('0x4b')]=_0x316018;return _0x1527eb;});}})['then'](respondWithFilteredResult(_0x18166c,_0x2f8a78))[_0x95a6('0x4c')](handleError(_0x18166c,null));};exports[_0x95a6('0x6d')]=function(_0x245193,_0x147598,_0x264b70){var _0x542a89={};var _0x738bac={};var _0x1fb118;var _0x5e2e29;return db[_0x95a6('0x47')]['findOne']({'where':{'id':_0x245193['params']['id']}})['then'](handleEntityNotFound(_0x147598,null))['then'](function(_0x1b6670){if(_0x1b6670){_0x1fb118=_0x1b6670;_0x738bac[_0x95a6('0x34')]=_[_0x95a6('0x35')](db['Team'][_0x95a6('0x33')]);_0x738bac[_0x95a6('0x36')]=_[_0x95a6('0x35')](_0x245193[_0x95a6('0x36')]);_0x738bac[_0x95a6('0x40')]=_[_0x95a6('0x37')](_0x738bac[_0x95a6('0x34')],_0x738bac[_0x95a6('0x36')]);_0x542a89['attributes']=_[_0x95a6('0x37')](_0x738bac['model'],qs[_0x95a6('0x39')](_0x245193[_0x95a6('0x36')]['fields']));_0x542a89['attributes']=_0x542a89[_0x95a6('0x38')][_0x95a6('0x3a')]?_0x542a89['attributes']:_0x738bac[_0x95a6('0x34')];_0x542a89['order']=qs['sort'](_0x245193[_0x95a6('0x36')][_0x95a6('0x3e')]);_0x542a89[_0x95a6('0x3f')]=qs[_0x95a6('0x40')](_[_0x95a6('0x41')](_0x245193[_0x95a6('0x36')],_0x738bac[_0x95a6('0x40')]));if(_0x245193[_0x95a6('0x36')]['filter']){_0x542a89[_0x95a6('0x3f')]=_[_0x95a6('0x43')](_0x542a89[_0x95a6('0x3f')],{'$or':_[_0x95a6('0x2a')](_0x542a89[_0x95a6('0x38')],function(_0x2d3c6c){var _0x3d666a={};_0x3d666a[_0x2d3c6c]={'$like':'%'+_0x245193['query'][_0x95a6('0x42')]+'%'};return _0x3d666a;})});}_0x542a89=_['merge']({},_0x542a89,_0x245193[_0x95a6('0x67')]);return _0x1fb118[_0x95a6('0x6d')](_0x542a89);}})[_0x95a6('0x26')](function(_0x3406fc){if(_0x3406fc){_0x5e2e29=_0x3406fc[_0x95a6('0x3a')];if(!_0x245193[_0x95a6('0x36')][_0x95a6('0x3b')](_0x95a6('0x63'))){_0x542a89[_0x95a6('0x3c')]=qs[_0x95a6('0x3c')](_0x245193[_0x95a6('0x36')][_0x95a6('0x3c')]);_0x542a89[_0x95a6('0x20')]=qs['offset'](_0x245193[_0x95a6('0x36')][_0x95a6('0x20')]);}return _0x1fb118[_0x95a6('0x6d')](_0x542a89);}})['then'](function(_0x1d8bb6){if(_0x1d8bb6){return _0x1d8bb6?{'count':_0x5e2e29,'rows':_0x1d8bb6}:null;}})[_0x95a6('0x26')](respondWithResult(_0x147598,null))['catch'](handleError(_0x147598,null));};exports[_0x95a6('0x6e')]=function(_0x3e5093,_0xc225a0,_0x4caa91){var _0x425f39=_0x3e5093[_0x95a6('0x5c')][_0x95a6('0x6f')];return db[_0x95a6('0x70')][_0x95a6('0x4a')]({'where':{'id':_[_0x95a6('0x2a')](_0x425f39,'id')},'attributes':['id'],'include':[{'model':db[_0x95a6('0x71')],'as':'Agents','attributes':['id',_0x95a6('0x2f'),_0x95a6('0x72'),_0x95a6('0x73'),'interface'],'raw':!![]}]})[_0x95a6('0x26')](function(_0x3812b5){if(_0x3812b5){var _0x37e5c8=_['flatMap'](_0x3812b5,function(_0x18c52c){var _0x508c96=_0x18c52c[_0x95a6('0x50')]({'plain':!![]});_0x508c96['Agents'][_0x95a6('0x74')](function(_0x39c81b){_0x39c81b[_0x95a6('0x75')]=_[_0x95a6('0x2e')](_0x425f39,{'id':_0x508c96['id']})[_0x95a6('0x75')];});return _0x508c96[_0x95a6('0x76')];});return db[_0x95a6('0x47')][_0x95a6('0x2e')]({'where':{'id':_0x3e5093[_0x95a6('0x4e')]['id']}})['then'](function(_0x54577b){return db[_0x95a6('0x77')][_0x95a6('0x78')](function(_0x3ad625){return _0x54577b['addTeams'](_[_0x95a6('0x2a')](_0x425f39,'id'),{'transaction':_0x3ad625})['then'](function(){return BPromise['each'](_0x37e5c8,function(_0x56c82f){return db[_0x95a6('0x79')][_0x95a6('0x7a')]({'where':{'UserId':_0x56c82f['id'],'VoiceQueueId':_0x3e5093['params']['id']},'defaults':{'penalty':_0x56c82f[_0x95a6('0x75')]},'transaction':_0x3ad625});});})[_0x95a6('0x26')](function(){return BPromise['each'](_[_0x95a6('0x42')](_0x37e5c8,{'online':!![]}),function(_0xa2d2ef){return db[_0x95a6('0x7b')][_0x95a6('0x7c')]({'membername':_0xa2d2ef[_0x95a6('0x2f')],'UserId':_0xa2d2ef['id'],'queue_name':_0x54577b[_0x95a6('0x2f')],'VoiceQueueId':_0x54577b['id'],'interface':_[_0x95a6('0x7d')](_0xa2d2ef[_0x95a6('0x7e')])?util[_0x95a6('0x7f')]('SIP/%s',_0xa2d2ef[_0x95a6('0x2f')]):_0xa2d2ef[_0x95a6('0x7e')],'paused':_0xa2d2ef[_0x95a6('0x73')]||![],'penalty':_0xa2d2ef[_0x95a6('0x75')]},{'transaction':_0x3ad625});});})[_0x95a6('0x26')](function(){_0x37e5c8[_0x95a6('0x74')](function(_0x317d4c){socket[_0x95a6('0x80')](_0x95a6('0x81'),{'UserId':_0x317d4c['id'],'VoiceQueueId':_0x54577b['id']});});});});});}})[_0x95a6('0x26')](respondWithStatusCode(_0xc225a0,null))['catch'](handleError(_0xc225a0,null));};exports[_0x95a6('0x82')]=function(_0x3f2738,_0x40e076,_0x5d6637){return db[_0x95a6('0x70')]['findAll']({'where':{'id':_0x3f2738[_0x95a6('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x95a6('0x71')],'as':_0x95a6('0x76'),'attributes':['id'],'raw':!![]}]})[_0x95a6('0x26')](handleEntityNotFound(_0x40e076,null))[_0x95a6('0x26')](function(_0x5b6831){var _0xcf583b=_['map'](_0x5b6831,'id');var _0x78ad9=[];var _0xcc3298=[];var _0x2cfd45=squel[_0x95a6('0x83')]();_0x2cfd45['field'](_0x95a6('0x84'))['from'](_0x95a6('0x85'),'tq')[_0x95a6('0x86')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x95a6('0x3f')](_0x95a6('0x87'),_0x3f2738['params']['id']);for(var _0x1e42f3=0x0;_0x1e42f3<_0x5b6831['length'];_0x1e42f3+=0x1){let _0x302f95=_0x5b6831[_0x1e42f3];for(var _0x4ad4d4=0x0;_0x4ad4d4<_0x302f95['Agents'][_0x95a6('0x3a')];_0x4ad4d4+=0x1){let _0x38185b=_0x302f95[_0x95a6('0x76')][_0x4ad4d4];var _0x28afab=_0x2cfd45[_0x95a6('0x59')]();_0x28afab[_0x95a6('0x3f')](_0x95a6('0x88'),_0x38185b['id']);_0xcc3298[_0x95a6('0x89')](db[_0x95a6('0x77')][_0x95a6('0x36')](_0x28afab[_0x95a6('0x8a')](),{'type':db[_0x95a6('0x77')][_0x95a6('0x8b')][_0x95a6('0x8c')]})[_0x95a6('0x26')](function(_0x2bfcd7){if(_0x2bfcd7['length']===0x1){return _0x38185b['id'];}else{var _0x33c686=_[_0x95a6('0x8d')](_[_0x95a6('0x2a')](_0x2bfcd7,_0x95a6('0x8e')),function(_0x95bfac){return _[_0x95a6('0x2c')](_0xcf583b,_0x95bfac);});if(_0x33c686){return _0x38185b['id'];}}}));}}return BPromise[_0x95a6('0x8f')](_0xcc3298)[_0x95a6('0x26')](function(_0x1b2f65){_0x78ad9=_(_0x78ad9)['union'](_0x1b2f65)[_0x95a6('0x90')]()[_0x95a6('0x2b')]();return db[_0x95a6('0x47')]['find']({'where':{'id':_0x3f2738[_0x95a6('0x4e')]['id']}})[_0x95a6('0x26')](function(_0x10a93d){return db[_0x95a6('0x77')][_0x95a6('0x78')](function(_0x1aa711){return _0x10a93d[_0x95a6('0x82')](_0x3f2738[_0x95a6('0x36')]['ids'],{'transaction':_0x1aa711})[_0x95a6('0x26')](function(){if(!_['isEmpty'](_0x78ad9)){return _0x10a93d[_0x95a6('0x91')](_0x78ad9,{'transaction':_0x1aa711})['then'](function(){return db['UserVoiceQueueRt'][_0x95a6('0x60')]({'where':{'VoiceQueueId':_0x3f2738[_0x95a6('0x4e')]['id'],'UserId':_0x78ad9},'transaction':_0x1aa711});});}})['then'](function(){_0x78ad9[_0x95a6('0x74')](function(_0x43b587){socket[_0x95a6('0x80')](_0x95a6('0x92'),{'UserId':_0x43b587,'VoiceQueueId':_0x10a93d['id']});});});});});});})['then'](respondWithStatusCode(_0x40e076,null))['catch'](handleError(_0x40e076,null));};exports[_0x95a6('0x93')]=function(_0xce2195,_0x4a7863,_0x404e7d){var _0xdf744c,_0x13894c;return db[_0x95a6('0x47')][_0x95a6('0x2e')]({'where':{'id':_0xce2195['params']['id']}})[_0x95a6('0x26')](handleEntityNotFound(_0x4a7863,null))['then'](function(_0x2376e1){if(_0x2376e1){_0x13894c=_0x2376e1;return _0x2376e1[_0x95a6('0x93')](_0xce2195[_0x95a6('0x5c')][_0x95a6('0x94')],_['omit'](_0xce2195[_0x95a6('0x5c')],['ids','id'])||{})[_0x95a6('0x95')](function(_0x256d3d){for(var _0x3ee05b=0x0;_0x3ee05b<_0xce2195[_0x95a6('0x5c')][_0x95a6('0x94')]['length'];_0x3ee05b+=0x1){socket[_0x95a6('0x80')](_0x95a6('0x81'),{'UserId':_0xce2195[_0x95a6('0x5c')]['ids'][_0x3ee05b],'VoiceQueueId':_0xce2195[_0x95a6('0x4e')]['id']});}return _0x256d3d;});}})[_0x95a6('0x26')](function(_0x1d8538){_0xdf744c=_0x1d8538||[];if(_0x13894c){return db[_0x95a6('0x71')][_0x95a6('0x4a')]({'where':{'id':_0xce2195[_0x95a6('0x5c')][_0x95a6('0x94')]},'attributes':['id',_0x95a6('0x2f'),_0x95a6('0x72'),_0x95a6('0x73'),_0x95a6('0x7e')],'raw':!![]});}})[_0x95a6('0x26')](function(_0x478839){if(!_[_0x95a6('0x96')](_0x478839)){var _0x4689af=[];for(var _0x2dcdcd=0x0;_0x2dcdcd<_0x478839[_0x95a6('0x3a')];_0x2dcdcd++){if(_0x478839[_0x2dcdcd][_0x95a6('0x72')]){_0x4689af['push'](db[_0x95a6('0x7b')][_0x95a6('0x7c')]({'membername':_0x478839[_0x2dcdcd]['name'],'UserId':_0x478839[_0x2dcdcd]['id'],'queue_name':_0x13894c[_0x95a6('0x2f')],'VoiceQueueId':_0x13894c['id'],'interface':_[_0x95a6('0x7d')](_0x478839[_0x2dcdcd]['interface'])?util[_0x95a6('0x7f')](_0x95a6('0x97'),_0x478839[_0x2dcdcd][_0x95a6('0x2f')]):_0x478839[_0x2dcdcd][_0x95a6('0x7e')],'paused':_0x478839[_0x2dcdcd][_0x95a6('0x73')]||![],'penalty':_0xce2195['body'][_0x95a6('0x75')]||0x0}));}}return BPromise[_0x95a6('0x8f')](_0x4689af);}})[_0x95a6('0x26')](function(){return _0xdf744c;})[_0x95a6('0x26')](respondWithResult(_0x4a7863,null))[_0x95a6('0x4c')](handleError(_0x4a7863,null));};exports[_0x95a6('0x91')]=function(_0xa9b4dd,_0x277ad3,_0x1823ae){return db[_0x95a6('0x47')][_0x95a6('0x2e')]({'where':{'id':_0xa9b4dd[_0x95a6('0x4e')]['id']}})[_0x95a6('0x26')](handleEntityNotFound(_0x277ad3,null))[_0x95a6('0x26')](function(_0x3fd3e2){if(_0x3fd3e2){return _0x3fd3e2[_0x95a6('0x91')](_0xa9b4dd[_0x95a6('0x36')][_0x95a6('0x94')])[_0x95a6('0x26')](function(){if(_[_0x95a6('0x98')](_0xa9b4dd[_0x95a6('0x36')][_0x95a6('0x94')])){for(var _0x1bf93c=0x0;_0x1bf93c<_0xa9b4dd[_0x95a6('0x36')][_0x95a6('0x94')][_0x95a6('0x3a')];_0x1bf93c+=0x1){socket[_0x95a6('0x80')]('userVoiceQueue:remove',{'UserId':Number(_0xa9b4dd['query'][_0x95a6('0x94')][_0x1bf93c]),'VoiceQueueId':Number(_0xa9b4dd['params']['id'])});}}else{socket[_0x95a6('0x80')]('userVoiceQueue:remove',{'UserId':Number(_0xa9b4dd['query'][_0x95a6('0x94')]),'VoiceQueueId':Number(_0xa9b4dd[_0x95a6('0x4e')]['id'])});}});}})[_0x95a6('0x26')](function(_0x50b9e8){return db[_0x95a6('0x7b')][_0x95a6('0x60')]({'where':{'VoiceQueueId':_0xa9b4dd['params']['id'],'UserId':_0xa9b4dd['query']['ids']}})[_0x95a6('0x26')](function(){return _0x50b9e8;});})['then'](respondWithStatusCode(_0x277ad3,null))[_0x95a6('0x4c')](handleError(_0x277ad3,null));};exports[_0x95a6('0x99')]=function(_0x2e5f1d,_0x3bf75d,_0x58907a){var _0x13ea4e={};var _0x31d6d1={};var _0x29faa7;var _0x400514;return db['VoiceQueue'][_0x95a6('0x69')]({'where':{'id':_0x2e5f1d[_0x95a6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3bf75d,null))['then'](function(_0x3bbe2d){if(_0x3bbe2d){_0x29faa7=_0x3bbe2d;_0x31d6d1[_0x95a6('0x34')]=_['keys'](db[_0x95a6('0x71')][_0x95a6('0x33')]);_0x31d6d1[_0x95a6('0x36')]=_['keys'](_0x2e5f1d[_0x95a6('0x36')]);_0x31d6d1[_0x95a6('0x40')]=_['intersection'](_0x31d6d1[_0x95a6('0x34')],_0x31d6d1['query']);_0x13ea4e[_0x95a6('0x38')]=_['intersection'](_0x31d6d1[_0x95a6('0x34')],qs[_0x95a6('0x39')](_0x2e5f1d[_0x95a6('0x36')][_0x95a6('0x39')]));_0x13ea4e[_0x95a6('0x38')]=_0x13ea4e[_0x95a6('0x38')][_0x95a6('0x3a')]?_0x13ea4e[_0x95a6('0x38')]:_0x31d6d1[_0x95a6('0x34')];_0x13ea4e[_0x95a6('0x3d')]=qs[_0x95a6('0x3e')](_0x2e5f1d[_0x95a6('0x36')][_0x95a6('0x3e')]);_0x13ea4e['where']=qs[_0x95a6('0x40')](_[_0x95a6('0x41')](_0x2e5f1d[_0x95a6('0x36')],_0x31d6d1[_0x95a6('0x40')]));if(_0x2e5f1d[_0x95a6('0x36')][_0x95a6('0x42')]){_0x13ea4e[_0x95a6('0x3f')]=_[_0x95a6('0x43')](_0x13ea4e['where'],{'$or':_[_0x95a6('0x2a')](_0x13ea4e[_0x95a6('0x38')],function(_0x11c411){var _0x2f53a3={};_0x2f53a3[_0x11c411]={'$like':'%'+_0x2e5f1d[_0x95a6('0x36')]['filter']+'%'};return _0x2f53a3;})});}_0x13ea4e=_[_0x95a6('0x43')]({},_0x13ea4e,_0x2e5f1d[_0x95a6('0x67')]);return _0x29faa7[_0x95a6('0x99')](_0x13ea4e);}})[_0x95a6('0x26')](function(_0x58d143){if(_0x58d143){_0x400514=_0x58d143[_0x95a6('0x3a')];if(!_0x2e5f1d['query'][_0x95a6('0x3b')]('nolimit')){_0x13ea4e[_0x95a6('0x3c')]=qs[_0x95a6('0x3c')](_0x2e5f1d[_0x95a6('0x36')][_0x95a6('0x3c')]);_0x13ea4e[_0x95a6('0x20')]=qs[_0x95a6('0x20')](_0x2e5f1d['query'][_0x95a6('0x20')]);}return _0x29faa7[_0x95a6('0x99')](_0x13ea4e);}})[_0x95a6('0x26')](function(_0x3e045b){if(_0x3e045b){return _0x3e045b?{'count':_0x400514,'rows':_0x3e045b}:null;}})['then'](respondWithResult(_0x3bf75d,null))[_0x95a6('0x4c')](handleError(_0x3bf75d,null));};exports[_0x95a6('0x9a')]=function(_0x407265,_0xa23d76,_0x3a1af6){var _0x3c91d6={};var _0x537ce1={};var _0x30873d;var _0xa4017b;return db[_0x95a6('0x47')][_0x95a6('0x69')]({'where':{'id':_0x407265[_0x95a6('0x4e')]['id']}})[_0x95a6('0x26')](handleEntityNotFound(_0xa23d76,null))['then'](function(_0x27f766){if(_0x27f766){_0x30873d=_0x27f766;_0x537ce1[_0x95a6('0x34')]=_[_0x95a6('0x35')](db['UserVoiceQueueRt']['rawAttributes']);_0x537ce1['query']=_[_0x95a6('0x35')](_0x407265[_0x95a6('0x36')]);_0x537ce1[_0x95a6('0x40')]=_['intersection'](_0x537ce1[_0x95a6('0x34')],_0x537ce1[_0x95a6('0x36')]);_0x3c91d6[_0x95a6('0x38')]=_['intersection'](_0x537ce1['model'],qs[_0x95a6('0x39')](_0x407265['query'][_0x95a6('0x39')]));_0x3c91d6['attributes']=_0x3c91d6[_0x95a6('0x38')]['length']?_0x3c91d6[_0x95a6('0x38')]:_0x537ce1[_0x95a6('0x34')];_0x3c91d6[_0x95a6('0x3d')]=qs[_0x95a6('0x3e')](_0x407265[_0x95a6('0x36')]['sort']);_0x3c91d6['where']=qs[_0x95a6('0x40')](_[_0x95a6('0x41')](_0x407265[_0x95a6('0x36')],_0x537ce1['filters']));if(_0x407265[_0x95a6('0x36')][_0x95a6('0x42')]){_0x3c91d6[_0x95a6('0x3f')]=_[_0x95a6('0x43')](_0x3c91d6[_0x95a6('0x3f')],{'$or':_['map'](_0x3c91d6['attributes'],function(_0x37ff47){var _0x52f3ca={};_0x52f3ca[_0x37ff47]={'$like':'%'+_0x407265[_0x95a6('0x36')][_0x95a6('0x42')]+'%'};return _0x52f3ca;})});}_0x3c91d6=_[_0x95a6('0x43')]({},_0x3c91d6,_0x407265[_0x95a6('0x67')]);return _0x30873d[_0x95a6('0x9a')](_0x3c91d6);}})[_0x95a6('0x26')](function(_0x1c2053){if(_0x1c2053){_0xa4017b=_0x1c2053[_0x95a6('0x3a')];if(!_0x407265['query']['hasOwnProperty'](_0x95a6('0x63'))){_0x3c91d6[_0x95a6('0x3c')]=qs[_0x95a6('0x3c')](_0x407265[_0x95a6('0x36')][_0x95a6('0x3c')]);_0x3c91d6[_0x95a6('0x20')]=qs['offset'](_0x407265[_0x95a6('0x36')][_0x95a6('0x20')]);}return _0x30873d[_0x95a6('0x9a')](_0x3c91d6);}})[_0x95a6('0x26')](function(_0x19816d){return _0x19816d?{'count':_0xa4017b,'rows':_0x19816d}:null;})[_0x95a6('0x26')](respondWithResult(_0xa23d76,null))[_0x95a6('0x4c')](handleError(_0xa23d76,null));};exports['getLists']=function(_0x2cc3b0,_0x322cbe,_0x205f8c){var _0x264423={};var _0x50aaf1={};var _0xfb141a;var _0x5e1e2e;return db[_0x95a6('0x47')][_0x95a6('0x69')]({'where':{'id':_0x2cc3b0[_0x95a6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x322cbe,null))[_0x95a6('0x26')](function(_0x4edb60){if(_0x4edb60){_0xfb141a=_0x4edb60;_0x50aaf1[_0x95a6('0x34')]=_[_0x95a6('0x35')](db[_0x95a6('0x9b')][_0x95a6('0x33')]);_0x50aaf1['query']=_['keys'](_0x2cc3b0[_0x95a6('0x36')]);_0x50aaf1[_0x95a6('0x40')]=_['intersection'](_0x50aaf1[_0x95a6('0x34')],_0x50aaf1[_0x95a6('0x36')]);_0x264423['attributes']=_['intersection'](_0x50aaf1[_0x95a6('0x34')],qs['fields'](_0x2cc3b0[_0x95a6('0x36')][_0x95a6('0x39')]));_0x264423[_0x95a6('0x38')]=_0x264423['attributes'][_0x95a6('0x3a')]?_0x264423[_0x95a6('0x38')]:_0x50aaf1[_0x95a6('0x34')];_0x264423['order']=qs[_0x95a6('0x3e')](_0x2cc3b0[_0x95a6('0x36')][_0x95a6('0x3e')]);_0x264423[_0x95a6('0x3f')]=qs[_0x95a6('0x40')](_[_0x95a6('0x41')](_0x2cc3b0[_0x95a6('0x36')],_0x50aaf1['filters']));if(_0x2cc3b0[_0x95a6('0x36')][_0x95a6('0x42')]){_0x264423['where']=_[_0x95a6('0x43')](_0x264423['where'],{'$or':_[_0x95a6('0x2a')](_0x264423[_0x95a6('0x38')],function(_0x250223){var _0x317166={};_0x317166[_0x250223]={'$like':'%'+_0x2cc3b0[_0x95a6('0x36')][_0x95a6('0x42')]+'%'};return _0x317166;})});}_0x264423=_['merge']({},_0x264423,_0x2cc3b0['options']);return _0xfb141a['getLists'](_0x264423);}})[_0x95a6('0x26')](function(_0x41307f){if(_0x41307f){_0x5e1e2e=_0x41307f['length'];if(!_0x2cc3b0[_0x95a6('0x36')]['hasOwnProperty'](_0x95a6('0x63'))){_0x264423[_0x95a6('0x3c')]=qs[_0x95a6('0x3c')](_0x2cc3b0['query'][_0x95a6('0x3c')]);_0x264423[_0x95a6('0x20')]=qs[_0x95a6('0x20')](_0x2cc3b0[_0x95a6('0x36')][_0x95a6('0x20')]);}return _0xfb141a[_0x95a6('0x9c')](_0x264423);}})[_0x95a6('0x26')](function(_0x3c5a10){if(_0x3c5a10){return _0x3c5a10?{'count':_0x5e1e2e,'rows':_0x3c5a10}:null;}})[_0x95a6('0x26')](respondWithResult(_0x322cbe,null))[_0x95a6('0x4c')](handleError(_0x322cbe,null));};exports['addLists']=function(_0x2078ff,_0x5be214,_0x44da40){var _0x5adaaf,_0x341586;return db[_0x95a6('0x47')][_0x95a6('0x2e')]({'where':{'id':_0x2078ff[_0x95a6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5be214,null))[_0x95a6('0x26')](function(_0x5b94ba){if(_0x5b94ba){_0x341586=_0x5b94ba;return _0x5b94ba[_0x95a6('0x9d')](_0x2078ff['body'][_0x95a6('0x94')],_[_0x95a6('0x5a')](_0x2078ff[_0x95a6('0x5c')],[_0x95a6('0x94'),'id'])||{});}return null;})[_0x95a6('0x95')](function(_0x5bc9c9){var _0x4e243d;_0x5adaaf=_0x5bc9c9||[];var _0x42ef7a=[];if(_0x5bc9c9){for(var _0x3a35ef=0x0;_0x3a35ef<_0x5bc9c9[_0x95a6('0x3a')];_0x3a35ef+=0x1){var _0x4850c4=_0x5bc9c9[_0x3a35ef][_0x95a6('0x50')]({'plain':!![]});_0x341586[_0x95a6('0x9e')]=_0x2078ff['body']['dialCheckDuplicateType']?_0x2078ff[_0x95a6('0x5c')]['dialCheckDuplicateType']:_0x341586[_0x95a6('0x9e')];switch(_0x341586[_0x95a6('0x9e')]){case'always':_0x4e243d=squel[_0x95a6('0x9f')]()['into'](_0x95a6('0xa0'))[_0x95a6('0xa1')]([_0x95a6('0xa2'),_0x95a6('0xa3'),'ContactId',_0x95a6('0xa4'),_0x95a6('0x64'),'createdAt',_0x95a6('0x5b')],squel[_0x95a6('0x83')]()[_0x95a6('0x46')](_0x95a6('0xa2'),_0x95a6('0xa2'))[_0x95a6('0x46')]('NOW()',_0x95a6('0xa3'))[_0x95a6('0x46')]('id',_0x95a6('0xa5'))[_0x95a6('0x46')](_0x4850c4[_0x95a6('0xa6')][_0x95a6('0x8a')](),_0x95a6('0xa4'))[_0x95a6('0x46')](_0x2078ff[_0x95a6('0x4e')]['id'][_0x95a6('0x8a')](),_0x95a6('0x64'))[_0x95a6('0x46')](_0x95a6('0xa7'),_0x95a6('0x5d'))[_0x95a6('0x46')](_0x95a6('0xa7'),_0x95a6('0x5b'))[_0x95a6('0xa8')](_0x95a6('0xa9'))[_0x95a6('0x3f')]('deletedAt\x20IS\x20NULL')[_0x95a6('0x3f')](_0x95a6('0xaa'),_0x4850c4[_0x95a6('0xa6')][_0x95a6('0x8a')]())[_0x95a6('0x3f')](_0x95a6('0xab'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x95a6('0x46')](_0x95a6('0xac'))[_0x95a6('0xa8')](_0x95a6('0xad'))[_0x95a6('0x3f')](_0x95a6('0x87'),_0x2078ff['params']['id'][_0x95a6('0x8a')]()))[_0x95a6('0x3f')](_0x95a6('0xae'),squel[_0x95a6('0x83')]()[_0x95a6('0x46')](_0x95a6('0xaf'))['from'](_0x95a6('0xa0'))[_0x95a6('0x3f')]('VoiceQueueId\x20=\x20?',_0x2078ff['params']['id'][_0x95a6('0x8a')]())))[_0x95a6('0x8a')]();break;case _0x95a6('0xb0'):_0x4e243d=squel['insert']()['into'](_0x95a6('0xa0'))['fromQuery']([_0x95a6('0xa2'),_0x95a6('0xa3'),_0x95a6('0xa5'),'ListId',_0x95a6('0x64'),_0x95a6('0x5d'),'updatedAt'],squel[_0x95a6('0x83')]()[_0x95a6('0x46')](_0x95a6('0xa2'),_0x95a6('0xa2'))[_0x95a6('0x46')]('NOW()',_0x95a6('0xa3'))[_0x95a6('0x46')]('id',_0x95a6('0xa5'))['field'](_0x4850c4[_0x95a6('0xa6')][_0x95a6('0x8a')](),_0x95a6('0xa4'))[_0x95a6('0x46')](_0x2078ff['params']['id'][_0x95a6('0x8a')](),'VoiceQueueId')[_0x95a6('0x46')](_0x95a6('0xa7'),_0x95a6('0x5d'))[_0x95a6('0x46')]('NOW()',_0x95a6('0x5b'))[_0x95a6('0xa8')](_0x95a6('0xa9'))[_0x95a6('0x3f')](_0x95a6('0xb1'))[_0x95a6('0x3f')](_0x95a6('0xaa'),_0x4850c4[_0x95a6('0xa6')][_0x95a6('0x8a')]())[_0x95a6('0x3f')](_0x95a6('0xab'))['where'](_0x95a6('0xae'),squel[_0x95a6('0x83')]()[_0x95a6('0x46')](_0x95a6('0xaf'))[_0x95a6('0xa8')](_0x95a6('0xa0'))['where'](_0x95a6('0x87'),_0x2078ff['params']['id']['toString']())))[_0x95a6('0x8a')]();break;default:_0x4e243d=squel[_0x95a6('0x9f')]()[_0x95a6('0xb2')](_0x95a6('0xa0'))[_0x95a6('0xa1')](['phone',_0x95a6('0xa3'),_0x95a6('0xa5'),_0x95a6('0xa4'),_0x95a6('0x64'),_0x95a6('0x5d'),_0x95a6('0x5b')],squel[_0x95a6('0x83')]()[_0x95a6('0x46')]('phone',_0x95a6('0xa2'))[_0x95a6('0x46')](_0x95a6('0xa7'),'scheduledAt')['field']('id',_0x95a6('0xa5'))[_0x95a6('0x46')](_0x4850c4['CmListId'][_0x95a6('0x8a')](),_0x95a6('0xa4'))[_0x95a6('0x46')](_0x2078ff[_0x95a6('0x4e')]['id'][_0x95a6('0x8a')](),_0x95a6('0x64'))['field'](_0x95a6('0xa7'),_0x95a6('0x5d'))['field'](_0x95a6('0xa7'),'updatedAt')[_0x95a6('0xa8')](_0x95a6('0xa9'))[_0x95a6('0x3f')](_0x95a6('0xb1'))['where']('ListId\x20=\x20?',_0x4850c4['CmListId'][_0x95a6('0x8a')]())['where'](_0x95a6('0xab')))[_0x95a6('0x8a')]();}_0x42ef7a[_0x95a6('0x89')](db['sequelize'][_0x95a6('0x36')](_0x4e243d));}return BPromise[_0x95a6('0x8f')](_0x42ef7a);}})[_0x95a6('0x26')](function(){return _0x5adaaf;})[_0x95a6('0x26')](respondWithResult(_0x5be214,null))[_0x95a6('0x4c')](handleError(_0x5be214,null));};exports['removeLists']=function(_0x3a8bd3,_0xa90dba,_0x48fd37){return db[_0x95a6('0x47')]['find']({'where':{'id':_0x3a8bd3[_0x95a6('0x4e')]['id']}})[_0x95a6('0x26')](handleEntityNotFound(_0xa90dba,null))['then'](function(_0x369b16){if(_0x369b16){return _0x369b16[_0x95a6('0xb3')](_0x3a8bd3['query'][_0x95a6('0x94')]);}})['then'](function(_0x2bdf96){if(_0x2bdf96){return db[_0x95a6('0x62')]['destroy']({'where':{'ListId':_0x3a8bd3[_0x95a6('0x36')][_0x95a6('0x94')],'VoiceQueueId':_0x3a8bd3[_0x95a6('0x4e')]['id']}})[_0x95a6('0x26')](function(){return _0x2bdf96;});}})['then'](respondWithStatusCode(_0xa90dba,null))[_0x95a6('0x4c')](handleError(_0xa90dba,null));};exports[_0x95a6('0xb4')]=function(_0x4e49ce,_0x27f434,_0x58f86e){var _0x3154cb={};var _0x50628f={};var _0x4c7a20;var _0x388551;return db[_0x95a6('0x47')]['findOne']({'where':{'id':_0x4e49ce['params']['id']}})[_0x95a6('0x26')](handleEntityNotFound(_0x27f434,null))['then'](function(_0x49c596){if(_0x49c596){_0x4c7a20=_0x49c596;_0x50628f['model']=_[_0x95a6('0x35')](db[_0x95a6('0x9b')][_0x95a6('0x33')]);_0x50628f['query']=_[_0x95a6('0x35')](_0x4e49ce[_0x95a6('0x36')]);_0x50628f[_0x95a6('0x40')]=_['intersection'](_0x50628f[_0x95a6('0x34')],_0x50628f[_0x95a6('0x36')]);_0x3154cb['attributes']=_['intersection'](_0x50628f[_0x95a6('0x34')],qs[_0x95a6('0x39')](_0x4e49ce[_0x95a6('0x36')]['fields']));_0x3154cb[_0x95a6('0x38')]=_0x3154cb['attributes'][_0x95a6('0x3a')]?_0x3154cb['attributes']:_0x50628f[_0x95a6('0x34')];_0x3154cb[_0x95a6('0x3d')]=qs[_0x95a6('0x3e')](_0x4e49ce['query'][_0x95a6('0x3e')]);_0x3154cb[_0x95a6('0x3f')]=qs['filters'](_[_0x95a6('0x41')](_0x4e49ce['query'],_0x50628f[_0x95a6('0x40')]));if(_0x4e49ce[_0x95a6('0x36')]['filter']){_0x3154cb[_0x95a6('0x3f')]=_[_0x95a6('0x43')](_0x3154cb[_0x95a6('0x3f')],{'$or':_[_0x95a6('0x2a')](_0x3154cb[_0x95a6('0x38')],function(_0x4a2a83){var _0x5d0323={};_0x5d0323[_0x4a2a83]={'$like':'%'+_0x4e49ce[_0x95a6('0x36')][_0x95a6('0x42')]+'%'};return _0x5d0323;})});}_0x3154cb=_['merge']({},_0x3154cb,_0x4e49ce[_0x95a6('0x67')]);return _0x4c7a20[_0x95a6('0xb4')](_0x3154cb);}})[_0x95a6('0x26')](function(_0x91cd89){if(_0x91cd89){_0x388551=_0x91cd89[_0x95a6('0x3a')];if(!_0x4e49ce[_0x95a6('0x36')][_0x95a6('0x3b')](_0x95a6('0x63'))){_0x3154cb[_0x95a6('0x3c')]=qs['limit'](_0x4e49ce['query'][_0x95a6('0x3c')]);_0x3154cb['offset']=qs[_0x95a6('0x20')](_0x4e49ce[_0x95a6('0x36')][_0x95a6('0x20')]);}return _0x4c7a20['getBlackLists'](_0x3154cb);}})['then'](function(_0x50306c){if(_0x50306c){return _0x50306c?{'count':_0x388551,'rows':_0x50306c}:null;}})[_0x95a6('0x26')](respondWithResult(_0x27f434,null))[_0x95a6('0x4c')](handleError(_0x27f434,null));};exports['addBlackLists']=function(_0x2dd9a1,_0x493221,_0x2391b0){var _0x3fdea2,_0x1f7e04;return db['VoiceQueue'][_0x95a6('0x2e')]({'where':{'id':_0x2dd9a1[_0x95a6('0x4e')]['id']}})[_0x95a6('0x26')](handleEntityNotFound(_0x493221,null))[_0x95a6('0x26')](function(_0x18e52d){if(_0x18e52d){_0x1f7e04=_0x18e52d;return _0x18e52d[_0x95a6('0xb5')](_0x2dd9a1[_0x95a6('0x5c')][_0x95a6('0x94')],_[_0x95a6('0x5a')](_0x2dd9a1[_0x95a6('0x5c')],[_0x95a6('0x94'),'id'])||{});}return null;})[_0x95a6('0x95')](function(_0x26d4c4){var _0x3afc96;_0x3fdea2=_0x26d4c4||[];var _0x45c57b=[];if(_0x26d4c4){for(var _0x7fe9f6=0x0;_0x7fe9f6<_0x26d4c4['length'];_0x7fe9f6+=0x1){var _0x11c1e4=_0x26d4c4[_0x7fe9f6]['get']({'plain':!![]});_0x3afc96=squel[_0x95a6('0x9f')]()[_0x95a6('0xb2')](_0x95a6('0xb6'))[_0x95a6('0xa1')](['phone',_0x95a6('0xa5'),_0x95a6('0xa4'),'VoiceQueueId',_0x95a6('0x5d'),'updatedAt'],squel['select']()['field'](_0x95a6('0xa2'),_0x95a6('0xa2'))[_0x95a6('0x46')]('id',_0x95a6('0xa5'))[_0x95a6('0x46')](_0x11c1e4['CmListId'][_0x95a6('0x8a')](),_0x95a6('0xa4'))['field'](_0x2dd9a1[_0x95a6('0x4e')]['id'][_0x95a6('0x8a')](),'VoiceQueueId')[_0x95a6('0x46')](_0x95a6('0xa7'),_0x95a6('0x5d'))['field'](_0x95a6('0xa7'),_0x95a6('0x5b'))[_0x95a6('0xa8')](_0x95a6('0xa9'))[_0x95a6('0x3f')](_0x95a6('0xb1'))[_0x95a6('0x3f')](_0x95a6('0xaa'),_0x11c1e4[_0x95a6('0xa6')]['toString']())[_0x95a6('0x3f')](_0x95a6('0xab')))[_0x95a6('0x8a')]();_0x45c57b[_0x95a6('0x89')](db[_0x95a6('0x77')][_0x95a6('0x36')](_0x3afc96));}return BPromise[_0x95a6('0x8f')](_0x45c57b);}})['then'](function(){return _0x3fdea2;})['then'](respondWithResult(_0x493221,null))['catch'](handleError(_0x493221,null));};exports[_0x95a6('0xb7')]=function(_0x5c91ae,_0x10a916,_0x44aaf4){return db[_0x95a6('0x47')]['find']({'where':{'id':_0x5c91ae[_0x95a6('0x4e')]['id']}})[_0x95a6('0x26')](handleEntityNotFound(_0x10a916,null))[_0x95a6('0x26')](function(_0x572c3c){if(_0x572c3c){return _0x572c3c[_0x95a6('0xb7')](_0x5c91ae['query'][_0x95a6('0x94')]);}})['then'](function(_0x5a45f9){if(_0x5a45f9){return db[_0x95a6('0x6c')]['destroy']({'where':{'ListId':_0x5c91ae[_0x95a6('0x36')]['ids'],'VoiceQueueId':_0x5c91ae['params']['id']}})[_0x95a6('0x26')](function(){return _0x5a45f9;});}})[_0x95a6('0x26')](respondWithStatusCode(_0x10a916,null))[_0x95a6('0x4c')](handleError(_0x10a916,null));}; \ No newline at end of file +var _0xd39a=['moment','bluebird','mustache','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','name','UserProfileResource','send','VoiceQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','key','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','VoiceQueues','getHoppers','findOne','nolimit','VoiceQueueId','CmHopper','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','UserVoiceQueue','findOrCreate','each','UserVoiceQueueRt','upsert','format','userVoiceQueue:save','ids','select','field','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','every','TeamId','union','compact','transaction','removeTeams','isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','spread','isNil','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','NOW()','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','html-pdf','rimraf','zip-dir','fast-json-patch'];(function(_0x41cfd4,_0x1ed2cc){var _0x190f48=function(_0x4b5b1a){while(--_0x4b5b1a){_0x41cfd4['push'](_0x41cfd4['shift']());}};_0x190f48(++_0x1ed2cc);}(_0xd39a,0xa9));var _0xad39=function(_0x152499,_0x4eefc4){_0x152499=_0x152499-0x0;var _0x2804f2=_0xd39a[_0x152499];return _0x2804f2;};'use strict';var pdf=require(_0xad39('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xad39('0x1'));var zipdir=require(_0xad39('0x2'));var jsonpatch=require(_0xad39('0x3'));var rp=require('request-promise');var moment=require(_0xad39('0x4'));var BPromise=require(_0xad39('0x5'));var Mustache=require(_0xad39('0x6'));var util=require('util');var path=require('path');var sox=require(_0xad39('0x7'));var csv=require('to-csv');var ejs=require(_0xad39('0x8'));var fs=require('fs');var _=require(_0xad39('0x9'));var squel=require('squel');var crypto=require(_0xad39('0xa'));var jsforce=require(_0xad39('0xb'));var deskjs=require(_0xad39('0xc'));var toCsv=require(_0xad39('0xd'));var querystring=require(_0xad39('0xe'));var Papa=require(_0xad39('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xad39('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad39('0x11'))('api');var utils=require(_0xad39('0x12'));var config=require(_0xad39('0x13'));var db=require(_0xad39('0x14'))['db'];config[_0xad39('0x15')]=_[_0xad39('0x16')](config[_0xad39('0x15')],{'host':_0xad39('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad39('0x15')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x1482e9,_0x47aabf){_0x47aabf=_0x47aabf||0xcc;return function(_0x441753){if(_0x441753){return _0x1482e9[_0xad39('0x18')](_0x47aabf);}return _0x1482e9[_0xad39('0x19')](_0x47aabf)[_0xad39('0x1a')]();};}function respondWithResult(_0x407c7a,_0xbbaf36){_0xbbaf36=_0xbbaf36||0xc8;return function(_0x4fb4c0){if(_0x4fb4c0){return _0x407c7a[_0xad39('0x19')](_0xbbaf36)[_0xad39('0x1b')](_0x4fb4c0);}};}function respondWithFilteredResult(_0x3b2259,_0x264cf1){return function(_0x55b6e3){if(_0x55b6e3){var _0xe70191=_0x55b6e3[_0xad39('0x1c')],_0x3c1b72=_0x264cf1[_0xad39('0x1d')],_0x24f87f=_0x264cf1['offset']+_0x264cf1[_0xad39('0x1e')],_0x2db233;if(_0x24f87f>=_0xe70191){_0x24f87f=_0xe70191;_0x2db233=0xc8;}else{_0x2db233=0xce;}_0x3b2259[_0xad39('0x19')](_0x2db233);return _0x3b2259[_0xad39('0x1f')](_0xad39('0x20'),_0x3c1b72+'-'+_0x24f87f+'/'+_0xe70191)[_0xad39('0x1b')](_0x55b6e3);}return null;};}function patchUpdates(_0x3977b2){return function(_0x416eae){try{jsonpatch[_0xad39('0x21')](_0x416eae,_0x3977b2,!![]);}catch(_0x44c3f3){return BPromise[_0xad39('0x22')](_0x44c3f3);}return _0x416eae['save']();};}function saveUpdates(_0x47db6f,_0x16bfce){return function(_0x55c047){if(_0x55c047){return _0x55c047[_0xad39('0x23')](_0x47db6f)[_0xad39('0x24')](function(_0x113eab){return _0x113eab;});}return null;};}function removeEntity(_0x42eb47,_0x3bdd2d){return function(_0xbfbf97){if(_0xbfbf97){return _0xbfbf97[_0xad39('0x25')]()[_0xad39('0x24')](function(){var _0x1c0232=_0xbfbf97[_0xad39('0x26')]({'plain':!![]});var _0x2b533d=[{'name':'VoiceQueues','value':_0xad39('0x27'),'ignore':![]},{'name':_0xad39('0x28'),'value':_0xad39('0x29'),'ignore':![]}];var _0x5061ca=_(_0x2b533d)[_0xad39('0x2a')](_0xad39('0x2b'))[_0xad39('0x2c')](_0xad39('0x2d'))[_0xad39('0x2d')]();if(_['includes'](_0x5061ca,_0x1c0232['type'])){return;}var _0x12992e=_['find'](_0x2b533d,[_0xad39('0x2d'),_0x1c0232[_0xad39('0x2e')]])[_0xad39('0x2f')];return db[_0xad39('0x30')][_0xad39('0x25')]({'where':{'type':_0x12992e,'resourceId':_0x1c0232['id']}})[_0xad39('0x24')](function(){return _0xbfbf97;});})[_0xad39('0x24')](function(){_0x42eb47[_0xad39('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33bfb3,_0x53daa6){return function(_0x276692){if(!_0x276692){_0x33bfb3['sendStatus'](0x194);}return _0x276692;};}function handleError(_0x38578e,_0xe935c2){_0xe935c2=_0xe935c2||0x1f4;return function(_0x10f777){logger['error'](_0x10f777['stack']);if(_0x10f777[_0xad39('0x2f')]){delete _0x10f777[_0xad39('0x2f')];}_0x38578e[_0xad39('0x19')](_0xe935c2)[_0xad39('0x31')](_0x10f777);};}exports['index']=function(_0x3103b5,_0x5a3e74){var _0x2e7501={},_0x1a1821={},_0x391345={'count':0x0,'rows':[]};var _0x3e45bb=db[_0xad39('0x32')][_0xad39('0x33')];_0x1a1821[_0xad39('0x34')]=_['keys'](_0x3e45bb);_0x1a1821['query']=_[_0xad39('0x35')](_0x3103b5[_0xad39('0x36')]);_0x1a1821[_0xad39('0x37')]=_[_0xad39('0x38')](_0x1a1821['model'],_0x1a1821[_0xad39('0x36')]);_0x2e7501[_0xad39('0x39')]=_[_0xad39('0x38')](_0x1a1821[_0xad39('0x34')],qs[_0xad39('0x3a')](_0x3103b5[_0xad39('0x36')][_0xad39('0x3a')]));_0x2e7501[_0xad39('0x39')]=_0x2e7501['attributes'][_0xad39('0x3b')]?_0x2e7501[_0xad39('0x39')]:_0x1a1821[_0xad39('0x34')];if(!_0x3103b5[_0xad39('0x36')][_0xad39('0x3c')]('nolimit')){_0x2e7501['limit']=qs[_0xad39('0x1e')](_0x3103b5['query'][_0xad39('0x1e')]);_0x2e7501[_0xad39('0x1d')]=qs[_0xad39('0x1d')](_0x3103b5[_0xad39('0x36')][_0xad39('0x1d')]);}_0x2e7501[_0xad39('0x3d')]=qs[_0xad39('0x3e')](_0x3103b5[_0xad39('0x36')][_0xad39('0x3e')]);_0x2e7501[_0xad39('0x3f')]=qs[_0xad39('0x37')](_[_0xad39('0x40')](_0x3103b5[_0xad39('0x36')],_0x1a1821[_0xad39('0x37')]));if(_0x3103b5[_0xad39('0x36')][_0xad39('0x2a')]){_0x2e7501['where']=_[_0xad39('0x41')](_0x2e7501[_0xad39('0x3f')],{'$or':_['map'](_0x3e45bb,function(_0x41dab8){if(_0x41dab8[_0xad39('0x2e')][_0xad39('0x42')]!=='VIRTUAL'){var _0x553d06={};_0x553d06[_0x41dab8['field']]={'$like':'%'+_0x3103b5[_0xad39('0x36')][_0xad39('0x2a')]+'%'};return _0x553d06;}})});}_0x2e7501=_['merge']({},_0x2e7501,_0x3103b5[_0xad39('0x43')]);var _0x349bbd={'where':_0x2e7501['where']};return db[_0xad39('0x32')][_0xad39('0x1c')](_0x349bbd)[_0xad39('0x24')](function(_0x28dbf2){_0x391345[_0xad39('0x1c')]=_0x28dbf2;if(_0x3103b5[_0xad39('0x36')][_0xad39('0x44')]){_0x2e7501['include']=[{'all':!![]}];}return db[_0xad39('0x32')][_0xad39('0x45')](_0x2e7501);})[_0xad39('0x24')](function(_0x586ebb){_0x391345[_0xad39('0x46')]=_0x586ebb;return _0x391345;})[_0xad39('0x24')](respondWithFilteredResult(_0x5a3e74,_0x2e7501))['catch'](handleError(_0x5a3e74,null));};exports[_0xad39('0x47')]=function(_0x397e68,_0x5edf55){var _0xe5851e={'raw':![],'where':{'id':_0x397e68[_0xad39('0x48')]['id']}},_0x30a53d={};_0x30a53d[_0xad39('0x34')]=_['keys'](db[_0xad39('0x32')][_0xad39('0x33')]);_0x30a53d['query']=_[_0xad39('0x35')](_0x397e68['query']);_0x30a53d['filters']=_[_0xad39('0x38')](_0x30a53d[_0xad39('0x34')],_0x30a53d[_0xad39('0x36')]);_0xe5851e[_0xad39('0x39')]=_[_0xad39('0x38')](_0x30a53d[_0xad39('0x34')],qs['fields'](_0x397e68[_0xad39('0x36')][_0xad39('0x3a')]));_0xe5851e[_0xad39('0x39')]=_0xe5851e['attributes'][_0xad39('0x3b')]?_0xe5851e[_0xad39('0x39')]:_0x30a53d[_0xad39('0x34')];if(_0x397e68[_0xad39('0x36')][_0xad39('0x44')]){_0xe5851e[_0xad39('0x49')]=[{'all':!![]}];}_0xe5851e=_[_0xad39('0x41')]({},_0xe5851e,_0x397e68[_0xad39('0x43')]);return db[_0xad39('0x32')][_0xad39('0x4a')](_0xe5851e)[_0xad39('0x24')](handleEntityNotFound(_0x5edf55,null))['then'](respondWithResult(_0x5edf55,null))[_0xad39('0x4b')](handleError(_0x5edf55,null));};exports[_0xad39('0x4c')]=function(_0x1ad919,_0x40fe35){return db[_0xad39('0x32')][_0xad39('0x4c')](_0x1ad919[_0xad39('0x4d')],{})[_0xad39('0x24')](function(_0x227da5){var _0x4b3a60=_0x1ad919[_0xad39('0x4e')][_0xad39('0x26')]({'plain':!![]});if(!_0x4b3a60)throw new Error(_0xad39('0x4f'));if(_0x4b3a60[_0xad39('0x50')]===_0xad39('0x4e')){var _0x1b34ba=_0x227da5[_0xad39('0x26')]({'plain':!![]});var _0x38071f=[{'name':'VoiceQueues','value':_0xad39('0x27')},{'name':_0xad39('0x28'),'value':_0xad39('0x29')}];var _0x1e06ab=_[_0xad39('0x4a')](_0x38071f,['value',_0x1b34ba['type']])[_0xad39('0x2f')];return db[_0xad39('0x51')]['find']({'where':{'name':_0x1e06ab,'userProfileId':_0x4b3a60[_0xad39('0x52')]},'raw':!![]})[_0xad39('0x24')](function(_0x50e417){if(_0x50e417&&_0x50e417['autoAssociation']===0x0){return db[_0xad39('0x30')]['create']({'name':_0x1b34ba[_0xad39('0x2f')],'resourceId':_0x1b34ba['id'],'type':_0x50e417[_0xad39('0x2f')],'sectionId':_0x50e417['id']},{})['then'](function(){return _0x227da5;});}else{return _0x227da5;}})[_0xad39('0x4b')](function(_0x4a760e){logger[_0xad39('0x53')](_0xad39('0x54'),_0x4a760e);throw _0x4a760e;});}return _0x227da5;})[_0xad39('0x24')](respondWithResult(_0x40fe35,0xc9))[_0xad39('0x4b')](handleError(_0x40fe35,null));};exports['clone']=function(_0x3f3bf2,_0x42e78d){var _0x4fe140={'raw':![],'where':{'id':_0x3f3bf2[_0xad39('0x48')]['id']}},_0x3dbf28={};_0x3dbf28[_0xad39('0x34')]=_[_0xad39('0x35')](db['VoiceQueue'][_0xad39('0x33')]);_0x4fe140[_0xad39('0x39')]=_[_0xad39('0x38')](_0x3dbf28[_0xad39('0x34')],qs[_0xad39('0x3a')](_0x3f3bf2[_0xad39('0x36')][_0xad39('0x3a')]));_0x4fe140['attributes']=_0x4fe140[_0xad39('0x39')][_0xad39('0x3b')]?_0x4fe140['attributes']:_0x3dbf28['model'];if(_0x3f3bf2[_0xad39('0x36')][_0xad39('0x44')]){_0x4fe140[_0xad39('0x49')]=[{'all':!![]}];}_0x4fe140=_[_0xad39('0x41')]({},_0x4fe140,_0x3f3bf2[_0xad39('0x43')]);return db[_0xad39('0x32')]['find'](_0x4fe140)[_0xad39('0x24')](handleEntityNotFound(_0x42e78d,null))[_0xad39('0x24')](function(_0xcbc2ba){if(_0xcbc2ba){var _0x55e67b=_0xcbc2ba[_0xad39('0x26')]({'plain':!![]});_0x55e67b=qs[_0xad39('0x55')](_0x55e67b,['id','createdAt',_0xad39('0x56')]);_0x3f3bf2['body']=_[_0xad39('0x55')](_0x3f3bf2[_0xad39('0x4d')],['id','createdAt',_0xad39('0x56')]);return db[_0xad39('0x32')]['create'](_[_0xad39('0x41')](_0x55e67b,_0x3f3bf2[_0xad39('0x4d')]),{'include':_0x3f3bf2['query']['includeAll']?[{'all':!![]}]:undefined})[_0xad39('0x24')](function(_0x1312c7){var _0x3e28e7=_0x3f3bf2[_0xad39('0x4e')]['get']({'plain':!![]});if(!_0x3e28e7)throw new Error(_0xad39('0x4f'));if(_0x3e28e7[_0xad39('0x50')]===_0xad39('0x4e')){var _0x11aafd=_0x1312c7[_0xad39('0x26')]({'plain':!![]});var _0x2e335a=[{'name':_0xad39('0x57'),'value':_0xad39('0x27')},{'name':_0xad39('0x28'),'value':_0xad39('0x29')}];var _0x4d19f3=_[_0xad39('0x4a')](_0x2e335a,[_0xad39('0x2d'),_0x11aafd[_0xad39('0x2e')]])[_0xad39('0x2f')];return db['UserProfileSection'][_0xad39('0x4a')]({'where':{'name':_0x4d19f3,'userProfileId':_0x3e28e7['userProfileId']},'raw':!![]})[_0xad39('0x24')](function(_0x39c5b0){if(_0x39c5b0&&_0x39c5b0['autoAssociation']===0x0){return db[_0xad39('0x30')][_0xad39('0x4c')]({'name':_0x11aafd[_0xad39('0x2f')],'resourceId':_0x11aafd['id'],'type':_0x39c5b0[_0xad39('0x2f')],'sectionId':_0x39c5b0['id']},{})['then'](function(){return _0x1312c7;});}else{return _0x1312c7;}})[_0xad39('0x4b')](function(_0xe45259){logger[_0xad39('0x53')](_0xad39('0x54'),_0xe45259);throw _0xe45259;});}return _0x1312c7;});}})[_0xad39('0x24')](respondWithResult(_0x42e78d,0xc9))['catch'](handleError(_0x42e78d,null));};exports[_0xad39('0x23')]=function(_0xae09d3,_0x45b03b){if(_0xae09d3[_0xad39('0x4d')]['id']){delete _0xae09d3[_0xad39('0x4d')]['id'];}return db[_0xad39('0x32')][_0xad39('0x4a')]({'where':{'id':_0xae09d3[_0xad39('0x48')]['id']}})[_0xad39('0x24')](handleEntityNotFound(_0x45b03b,null))[_0xad39('0x24')](saveUpdates(_0xae09d3[_0xad39('0x4d')],null))[_0xad39('0x24')](respondWithResult(_0x45b03b,null))[_0xad39('0x4b')](handleError(_0x45b03b,null));};exports[_0xad39('0x25')]=function(_0x39f190,_0x4ae17d){return db[_0xad39('0x32')][_0xad39('0x4a')]({'where':{'id':_0x39f190[_0xad39('0x48')]['id']}})[_0xad39('0x24')](handleEntityNotFound(_0x4ae17d,null))[_0xad39('0x24')](removeEntity(_0x4ae17d,null))[_0xad39('0x4b')](handleError(_0x4ae17d,null));};exports[_0xad39('0x58')]=function(_0xe5d5bb,_0xb00e6f,_0x1dc768){var _0x32a6f1={'raw':![],'where':{}};var _0x44207c={};var _0x322ee6={'count':0x0,'rows':[]};return db[_0xad39('0x32')][_0xad39('0x59')]({'where':{'id':_0xe5d5bb['params']['id']}})[_0xad39('0x24')](handleEntityNotFound(_0xb00e6f,null))[_0xad39('0x24')](function(_0x39291c){if(_0x39291c){_0x44207c[_0xad39('0x34')]=_[_0xad39('0x35')](db['CmHopper']['rawAttributes']);_0x44207c[_0xad39('0x36')]=_[_0xad39('0x35')](_0xe5d5bb['query']);_0x44207c['filters']=_[_0xad39('0x38')](_0x44207c['model'],_0x44207c[_0xad39('0x36')]);_0x32a6f1[_0xad39('0x39')]=_[_0xad39('0x38')](_0x44207c['model'],qs[_0xad39('0x3a')](_0xe5d5bb[_0xad39('0x36')][_0xad39('0x3a')]));_0x32a6f1[_0xad39('0x39')]=_0x32a6f1[_0xad39('0x39')][_0xad39('0x3b')]?_0x32a6f1['attributes']:_0x44207c[_0xad39('0x34')];if(!_0xe5d5bb[_0xad39('0x36')]['hasOwnProperty'](_0xad39('0x5a'))){_0x32a6f1[_0xad39('0x1e')]=qs[_0xad39('0x1e')](_0xe5d5bb[_0xad39('0x36')][_0xad39('0x1e')]);_0x32a6f1[_0xad39('0x1d')]=qs[_0xad39('0x1d')](_0xe5d5bb[_0xad39('0x36')][_0xad39('0x1d')]);}_0x32a6f1[_0xad39('0x3d')]=qs['sort'](_0xe5d5bb['query'][_0xad39('0x3e')]);_0x32a6f1['where']=qs['filters'](_[_0xad39('0x40')](_0xe5d5bb[_0xad39('0x36')],_0x44207c[_0xad39('0x37')]));_0x32a6f1[_0xad39('0x3f')][_0xad39('0x5b')]=_0x39291c['id'];if(_0xe5d5bb[_0xad39('0x36')]['filter']){_0x32a6f1['where']=_[_0xad39('0x41')](_0x32a6f1[_0xad39('0x3f')],{'$or':_['map'](_0x32a6f1[_0xad39('0x39')],function(_0x38c32b){var _0x4d7e71={};_0x4d7e71[_0x38c32b]={'$like':'%'+_0xe5d5bb[_0xad39('0x36')][_0xad39('0x2a')]+'%'};return _0x4d7e71;})});}_0x32a6f1=_[_0xad39('0x41')]({},_0x32a6f1,_0xe5d5bb[_0xad39('0x43')]);return db[_0xad39('0x5c')][_0xad39('0x1c')]({'where':_0x32a6f1[_0xad39('0x3f')]})[_0xad39('0x24')](function(_0x2f0649){_0x322ee6['count']=_0x2f0649;if(_0xe5d5bb[_0xad39('0x36')][_0xad39('0x44')]){_0x32a6f1['include']=[{'all':!![]}];}return db[_0xad39('0x5c')][_0xad39('0x45')](_0x32a6f1);})['then'](function(_0x18e183){_0x322ee6['rows']=_0x18e183;return _0x322ee6;});}})[_0xad39('0x24')](respondWithFilteredResult(_0xb00e6f,_0x32a6f1))[_0xad39('0x4b')](handleError(_0xb00e6f,null));};exports['getHopperHistories']=function(_0xc3df68,_0x4ff1fd,_0x42c27f){var _0x4cff2b={'raw':!![],'where':{}};var _0x241c2d={};var _0x3b09db={'count':0x0,'rows':[]};return db[_0xad39('0x32')][_0xad39('0x59')]({'where':{'id':_0xc3df68[_0xad39('0x48')]['id']}})[_0xad39('0x24')](handleEntityNotFound(_0x4ff1fd,null))['then'](function(_0x56f30f){if(_0x56f30f){_0x241c2d[_0xad39('0x34')]=_['keys'](db['CmHopperHistory'][_0xad39('0x33')]);_0x241c2d[_0xad39('0x36')]=_[_0xad39('0x35')](_0xc3df68['query']);_0x241c2d['filters']=_['intersection'](_0x241c2d[_0xad39('0x34')],_0x241c2d[_0xad39('0x36')]);_0x4cff2b[_0xad39('0x39')]=_[_0xad39('0x38')](_0x241c2d[_0xad39('0x34')],qs[_0xad39('0x3a')](_0xc3df68[_0xad39('0x36')][_0xad39('0x3a')]));_0x4cff2b[_0xad39('0x39')]=_0x4cff2b[_0xad39('0x39')][_0xad39('0x3b')]?_0x4cff2b[_0xad39('0x39')]:_0x241c2d['model'];if(!_0xc3df68['query']['hasOwnProperty']('nolimit')){_0x4cff2b[_0xad39('0x1e')]=qs[_0xad39('0x1e')](_0xc3df68[_0xad39('0x36')][_0xad39('0x1e')]);_0x4cff2b[_0xad39('0x1d')]=qs[_0xad39('0x1d')](_0xc3df68['query'][_0xad39('0x1d')]);}_0x4cff2b[_0xad39('0x3d')]=qs[_0xad39('0x3e')](_0xc3df68[_0xad39('0x36')][_0xad39('0x3e')]);_0x4cff2b[_0xad39('0x3f')]=qs[_0xad39('0x37')](_['pick'](_0xc3df68[_0xad39('0x36')],_0x241c2d[_0xad39('0x37')]));_0x4cff2b[_0xad39('0x3f')][_0xad39('0x5b')]=_0x56f30f['id'];if(_0xc3df68[_0xad39('0x36')][_0xad39('0x2a')]){_0x4cff2b[_0xad39('0x3f')]=_[_0xad39('0x41')](_0x4cff2b[_0xad39('0x3f')],{'$or':_[_0xad39('0x2c')](_0x4cff2b['attributes'],function(_0x11405d){var _0x2a92e1={};_0x2a92e1[_0x11405d]={'$like':'%'+_0xc3df68[_0xad39('0x36')][_0xad39('0x2a')]+'%'};return _0x2a92e1;})});}_0x4cff2b=_[_0xad39('0x41')]({},_0x4cff2b,_0xc3df68[_0xad39('0x43')]);return db[_0xad39('0x5d')][_0xad39('0x1c')]({'where':_0x4cff2b[_0xad39('0x3f')]})[_0xad39('0x24')](function(_0x4080b1){_0x3b09db[_0xad39('0x1c')]=_0x4080b1;if(_0xc3df68[_0xad39('0x36')]['includeAll']){_0x4cff2b[_0xad39('0x49')]=[{'all':!![]}];}return db[_0xad39('0x5d')][_0xad39('0x45')](_0x4cff2b);})[_0xad39('0x24')](function(_0x51a7e4){_0x3b09db[_0xad39('0x46')]=_0x51a7e4;return _0x3b09db;});}})[_0xad39('0x24')](respondWithFilteredResult(_0x4ff1fd,_0x4cff2b))[_0xad39('0x4b')](handleError(_0x4ff1fd,null));};exports['getHopperFinals']=function(_0x1f1b80,_0x31de1f,_0x18d480){var _0x3a2ab7={'raw':!![],'where':{}};var _0x1daa35={};var _0x48f6b4={'count':0x0,'rows':[]};return db[_0xad39('0x32')][_0xad39('0x59')]({'where':{'id':_0x1f1b80[_0xad39('0x48')]['id']}})[_0xad39('0x24')](handleEntityNotFound(_0x31de1f,null))[_0xad39('0x24')](function(_0x54d1ab){if(_0x54d1ab){_0x1daa35[_0xad39('0x34')]=_['keys'](db[_0xad39('0x5e')][_0xad39('0x33')]);_0x1daa35[_0xad39('0x36')]=_[_0xad39('0x35')](_0x1f1b80[_0xad39('0x36')]);_0x1daa35[_0xad39('0x37')]=_[_0xad39('0x38')](_0x1daa35[_0xad39('0x34')],_0x1daa35['query']);_0x3a2ab7[_0xad39('0x39')]=_[_0xad39('0x38')](_0x1daa35['model'],qs['fields'](_0x1f1b80[_0xad39('0x36')]['fields']));_0x3a2ab7['attributes']=_0x3a2ab7[_0xad39('0x39')]['length']?_0x3a2ab7[_0xad39('0x39')]:_0x1daa35['model'];if(!_0x1f1b80[_0xad39('0x36')][_0xad39('0x3c')](_0xad39('0x5a'))){_0x3a2ab7['limit']=qs['limit'](_0x1f1b80[_0xad39('0x36')][_0xad39('0x1e')]);_0x3a2ab7[_0xad39('0x1d')]=qs[_0xad39('0x1d')](_0x1f1b80[_0xad39('0x36')][_0xad39('0x1d')]);}_0x3a2ab7['order']=qs[_0xad39('0x3e')](_0x1f1b80[_0xad39('0x36')][_0xad39('0x3e')]);_0x3a2ab7[_0xad39('0x3f')]=qs['filters'](_[_0xad39('0x40')](_0x1f1b80[_0xad39('0x36')],_0x1daa35[_0xad39('0x37')]));_0x3a2ab7[_0xad39('0x3f')][_0xad39('0x5b')]=_0x54d1ab['id'];if(_0x1f1b80[_0xad39('0x36')]['filter']){_0x3a2ab7[_0xad39('0x3f')]=_[_0xad39('0x41')](_0x3a2ab7['where'],{'$or':_[_0xad39('0x2c')](_0x3a2ab7['attributes'],function(_0x327d0f){var _0x45f7af={};_0x45f7af[_0x327d0f]={'$like':'%'+_0x1f1b80[_0xad39('0x36')][_0xad39('0x2a')]+'%'};return _0x45f7af;})});}_0x3a2ab7=_['merge']({},_0x3a2ab7,_0x1f1b80['options']);return db[_0xad39('0x5e')][_0xad39('0x1c')]({'where':_0x3a2ab7[_0xad39('0x3f')]})[_0xad39('0x24')](function(_0x28f2f2){_0x48f6b4['count']=_0x28f2f2;if(_0x1f1b80[_0xad39('0x36')]['includeAll']){_0x3a2ab7[_0xad39('0x49')]=[{'all':!![]}];}return db[_0xad39('0x5e')][_0xad39('0x45')](_0x3a2ab7);})[_0xad39('0x24')](function(_0x3824af){_0x48f6b4[_0xad39('0x46')]=_0x3824af;return _0x48f6b4;});}})[_0xad39('0x24')](respondWithFilteredResult(_0x31de1f,_0x3a2ab7))['catch'](handleError(_0x31de1f,null));};exports[_0xad39('0x5f')]=function(_0x4c3718,_0x49e35d,_0x4c9c2a){var _0x3423fc={'raw':!![],'where':{}};var _0x383805={};var _0x44075e={'count':0x0,'rows':[]};return db[_0xad39('0x32')][_0xad39('0x59')]({'where':{'id':_0x4c3718['params']['id']}})[_0xad39('0x24')](handleEntityNotFound(_0x49e35d,null))[_0xad39('0x24')](function(_0x200e9f){if(_0x200e9f){_0x383805['model']=_[_0xad39('0x35')](db[_0xad39('0x60')]['rawAttributes']);_0x383805[_0xad39('0x36')]=_[_0xad39('0x35')](_0x4c3718[_0xad39('0x36')]);_0x383805['filters']=_['intersection'](_0x383805['model'],_0x383805[_0xad39('0x36')]);_0x3423fc[_0xad39('0x39')]=_['intersection'](_0x383805['model'],qs[_0xad39('0x3a')](_0x4c3718['query'][_0xad39('0x3a')]));_0x3423fc[_0xad39('0x39')]=_0x3423fc[_0xad39('0x39')]['length']?_0x3423fc[_0xad39('0x39')]:_0x383805[_0xad39('0x34')];if(!_0x4c3718['query'][_0xad39('0x3c')](_0xad39('0x5a'))){_0x3423fc[_0xad39('0x1e')]=qs[_0xad39('0x1e')](_0x4c3718[_0xad39('0x36')]['limit']);_0x3423fc[_0xad39('0x1d')]=qs['offset'](_0x4c3718['query'][_0xad39('0x1d')]);}_0x3423fc[_0xad39('0x3d')]=qs[_0xad39('0x3e')](_0x4c3718[_0xad39('0x36')][_0xad39('0x3e')]);_0x3423fc[_0xad39('0x3f')]=qs['filters'](_['pick'](_0x4c3718[_0xad39('0x36')],_0x383805['filters']));_0x3423fc['where'][_0xad39('0x5b')]=_0x200e9f['id'];if(_0x4c3718[_0xad39('0x36')][_0xad39('0x2a')]){_0x3423fc[_0xad39('0x3f')]=_['merge'](_0x3423fc['where'],{'$or':_['map'](_0x3423fc[_0xad39('0x39')],function(_0xa3d343){var _0x5919e1={};_0x5919e1[_0xa3d343]={'$like':'%'+_0x4c3718[_0xad39('0x36')][_0xad39('0x2a')]+'%'};return _0x5919e1;})});}_0x3423fc=_[_0xad39('0x41')]({},_0x3423fc,_0x4c3718[_0xad39('0x43')]);return db['CmHopperBlack'][_0xad39('0x1c')]({'where':_0x3423fc[_0xad39('0x3f')]})[_0xad39('0x24')](function(_0x1e7169){_0x44075e[_0xad39('0x1c')]=_0x1e7169;if(_0x4c3718[_0xad39('0x36')]['includeAll']){_0x3423fc['include']=[{'all':!![]}];}return db[_0xad39('0x60')][_0xad39('0x45')](_0x3423fc);})[_0xad39('0x24')](function(_0x16de18){_0x44075e[_0xad39('0x46')]=_0x16de18;return _0x44075e;});}})[_0xad39('0x24')](respondWithFilteredResult(_0x49e35d,_0x3423fc))[_0xad39('0x4b')](handleError(_0x49e35d,null));};exports[_0xad39('0x61')]=function(_0x5018d1,_0x3c2017,_0x272f2f){var _0x36bd39={};var _0x4c73a7={};var _0x34a54e;var _0x4b3ed4;return db[_0xad39('0x32')][_0xad39('0x59')]({'where':{'id':_0x5018d1[_0xad39('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c2017,null))[_0xad39('0x24')](function(_0x23e5ec){if(_0x23e5ec){_0x34a54e=_0x23e5ec;_0x4c73a7[_0xad39('0x34')]=_[_0xad39('0x35')](db[_0xad39('0x62')][_0xad39('0x33')]);_0x4c73a7[_0xad39('0x36')]=_[_0xad39('0x35')](_0x5018d1[_0xad39('0x36')]);_0x4c73a7[_0xad39('0x37')]=_[_0xad39('0x38')](_0x4c73a7[_0xad39('0x34')],_0x4c73a7[_0xad39('0x36')]);_0x36bd39[_0xad39('0x39')]=_[_0xad39('0x38')](_0x4c73a7['model'],qs[_0xad39('0x3a')](_0x5018d1[_0xad39('0x36')][_0xad39('0x3a')]));_0x36bd39[_0xad39('0x39')]=_0x36bd39[_0xad39('0x39')][_0xad39('0x3b')]?_0x36bd39[_0xad39('0x39')]:_0x4c73a7[_0xad39('0x34')];_0x36bd39['order']=qs[_0xad39('0x3e')](_0x5018d1[_0xad39('0x36')][_0xad39('0x3e')]);_0x36bd39['where']=qs['filters'](_['pick'](_0x5018d1[_0xad39('0x36')],_0x4c73a7[_0xad39('0x37')]));if(_0x5018d1[_0xad39('0x36')][_0xad39('0x2a')]){_0x36bd39['where']=_[_0xad39('0x41')](_0x36bd39['where'],{'$or':_[_0xad39('0x2c')](_0x36bd39['attributes'],function(_0x5c8527){var _0x5a4596={};_0x5a4596[_0x5c8527]={'$like':'%'+_0x5018d1['query']['filter']+'%'};return _0x5a4596;})});}_0x36bd39=_[_0xad39('0x41')]({},_0x36bd39,_0x5018d1[_0xad39('0x43')]);return _0x34a54e['getTeams'](_0x36bd39);}})[_0xad39('0x24')](function(_0x34f0a9){if(_0x34f0a9){_0x4b3ed4=_0x34f0a9[_0xad39('0x3b')];if(!_0x5018d1['query'][_0xad39('0x3c')](_0xad39('0x5a'))){_0x36bd39[_0xad39('0x1e')]=qs[_0xad39('0x1e')](_0x5018d1['query'][_0xad39('0x1e')]);_0x36bd39[_0xad39('0x1d')]=qs['offset'](_0x5018d1[_0xad39('0x36')][_0xad39('0x1d')]);}return _0x34a54e[_0xad39('0x61')](_0x36bd39);}})[_0xad39('0x24')](function(_0x1df970){if(_0x1df970){return _0x1df970?{'count':_0x4b3ed4,'rows':_0x1df970}:null;}})[_0xad39('0x24')](respondWithResult(_0x3c2017,null))[_0xad39('0x4b')](handleError(_0x3c2017,null));};exports[_0xad39('0x63')]=function(_0x3ce464,_0x90bc51,_0x156b34){var _0x4954b5=_0x3ce464[_0xad39('0x4d')][_0xad39('0x64')];return db[_0xad39('0x62')][_0xad39('0x45')]({'where':{'id':_[_0xad39('0x2c')](_0x4954b5,'id')},'attributes':['id'],'include':[{'model':db[_0xad39('0x65')],'as':_0xad39('0x66'),'attributes':['id','name',_0xad39('0x67'),_0xad39('0x68'),_0xad39('0x69')],'raw':!![]}]})[_0xad39('0x24')](function(_0x257dd9){if(_0x257dd9){var _0x57697c=_[_0xad39('0x6a')](_0x257dd9,function(_0x5016df){var _0x43f35a=_0x5016df[_0xad39('0x26')]({'plain':!![]});_0x43f35a[_0xad39('0x66')][_0xad39('0x6b')](function(_0x18c897){_0x18c897[_0xad39('0x6c')]=_['find'](_0x4954b5,{'id':_0x43f35a['id']})[_0xad39('0x6c')];});return _0x43f35a[_0xad39('0x66')];});return db[_0xad39('0x32')][_0xad39('0x4a')]({'where':{'id':_0x3ce464['params']['id']}})['then'](function(_0x20607b){return db[_0xad39('0x6d')]['transaction'](function(_0x48fdf7){return _0x20607b['addTeams'](_[_0xad39('0x2c')](_0x4954b5,'id'),{'transaction':_0x48fdf7})[_0xad39('0x24')](function(){return BPromise['each'](_0x57697c,function(_0x58a1b1){return db[_0xad39('0x6e')][_0xad39('0x6f')]({'where':{'UserId':_0x58a1b1['id'],'VoiceQueueId':_0x3ce464['params']['id']},'defaults':{'penalty':_0x58a1b1[_0xad39('0x6c')]},'transaction':_0x48fdf7});});})['then'](function(){return BPromise[_0xad39('0x70')](_[_0xad39('0x2a')](_0x57697c,{'online':!![]}),function(_0x57795f){return db[_0xad39('0x71')][_0xad39('0x72')]({'membername':_0x57795f['name'],'UserId':_0x57795f['id'],'queue_name':_0x20607b[_0xad39('0x2f')],'VoiceQueueId':_0x20607b['id'],'interface':_['isNil'](_0x57795f[_0xad39('0x69')])?util[_0xad39('0x73')]('SIP/%s',_0x57795f['name']):_0x57795f[_0xad39('0x69')],'paused':_0x57795f[_0xad39('0x68')]||![],'penalty':_0x57795f[_0xad39('0x6c')]},{'transaction':_0x48fdf7});});})[_0xad39('0x24')](function(){_0x57697c['forEach'](function(_0x1ff44b){socket['emit'](_0xad39('0x74'),{'UserId':_0x1ff44b['id'],'VoiceQueueId':_0x20607b['id']});});});});});}})[_0xad39('0x24')](respondWithStatusCode(_0x90bc51,null))[_0xad39('0x4b')](handleError(_0x90bc51,null));};exports['removeTeams']=function(_0x38a1c1,_0x443e30,_0x2e837a){return db['Team'][_0xad39('0x45')]({'where':{'id':_0x38a1c1[_0xad39('0x36')][_0xad39('0x75')]},'attributes':['id'],'include':[{'model':db[_0xad39('0x65')],'as':_0xad39('0x66'),'attributes':['id'],'raw':!![]}]})[_0xad39('0x24')](handleEntityNotFound(_0x443e30,null))[_0xad39('0x24')](function(_0x4ce9a8){var _0x212a08=_['map'](_0x4ce9a8,'id');var _0x21d5b8=[];var _0x4d10ad=[];var _0x52466f=squel[_0xad39('0x76')]();_0x52466f[_0xad39('0x77')]('tq.TeamId')[_0xad39('0x78')](_0xad39('0x79'),'tq')[_0xad39('0x7a')]('user_has_teams','ut',_0xad39('0x7b'))[_0xad39('0x3f')]('VoiceQueueId\x20=\x20?',_0x38a1c1[_0xad39('0x48')]['id']);for(var _0xc0474b=0x0;_0xc0474b<_0x4ce9a8['length'];_0xc0474b+=0x1){let _0x22b6e9=_0x4ce9a8[_0xc0474b];for(var _0x32dcb4=0x0;_0x32dcb4<_0x22b6e9[_0xad39('0x66')][_0xad39('0x3b')];_0x32dcb4+=0x1){let _0x4fef86=_0x22b6e9[_0xad39('0x66')][_0x32dcb4];var _0x275cce=_0x52466f[_0xad39('0x7c')]();_0x275cce['where']('ut.UserId\x20=\x20?',_0x4fef86['id']);_0x4d10ad[_0xad39('0x7d')](db['sequelize'][_0xad39('0x36')](_0x275cce[_0xad39('0x7e')](),{'type':db[_0xad39('0x6d')][_0xad39('0x7f')]['SELECT']})[_0xad39('0x24')](function(_0x2da567){if(_0x2da567[_0xad39('0x3b')]===0x1){return _0x4fef86['id'];}else{var _0x488587=_[_0xad39('0x80')](_[_0xad39('0x2c')](_0x2da567,_0xad39('0x81')),function(_0x2b77f9){return _['includes'](_0x212a08,_0x2b77f9);});if(_0x488587){return _0x4fef86['id'];}}}));}}return BPromise['all'](_0x4d10ad)[_0xad39('0x24')](function(_0x413f06){_0x21d5b8=_(_0x21d5b8)[_0xad39('0x82')](_0x413f06)[_0xad39('0x83')]()[_0xad39('0x2d')]();return db['VoiceQueue'][_0xad39('0x4a')]({'where':{'id':_0x38a1c1[_0xad39('0x48')]['id']}})['then'](function(_0x36e3d7){return db['sequelize'][_0xad39('0x84')](function(_0x246ed8){return _0x36e3d7[_0xad39('0x85')](_0x38a1c1[_0xad39('0x36')][_0xad39('0x75')],{'transaction':_0x246ed8})[_0xad39('0x24')](function(){if(!_[_0xad39('0x86')](_0x21d5b8)){return _0x36e3d7[_0xad39('0x87')](_0x21d5b8,{'transaction':_0x246ed8})['then'](function(){return db[_0xad39('0x71')][_0xad39('0x25')]({'where':{'VoiceQueueId':_0x38a1c1['params']['id'],'UserId':_0x21d5b8},'transaction':_0x246ed8});});}})['then'](function(){_0x21d5b8['forEach'](function(_0x5507b2){socket[_0xad39('0x88')](_0xad39('0x89'),{'UserId':_0x5507b2,'VoiceQueueId':_0x36e3d7['id']});});});});});});})['then'](respondWithStatusCode(_0x443e30,null))[_0xad39('0x4b')](handleError(_0x443e30,null));};exports[_0xad39('0x8a')]=function(_0x11e0f8,_0x4ebb86,_0x24866d){var _0x176f7b,_0x498305;return db['VoiceQueue'][_0xad39('0x4a')]({'where':{'id':_0x11e0f8['params']['id']}})[_0xad39('0x24')](handleEntityNotFound(_0x4ebb86,null))[_0xad39('0x24')](function(_0x128500){if(_0x128500){_0x498305=_0x128500;return _0x128500['addAgents'](_0x11e0f8[_0xad39('0x4d')][_0xad39('0x75')],_['omit'](_0x11e0f8[_0xad39('0x4d')],['ids','id'])||{})[_0xad39('0x8b')](function(_0x403f5f){for(var _0x3c0064=0x0;_0x3c0064<_0x11e0f8[_0xad39('0x4d')][_0xad39('0x75')][_0xad39('0x3b')];_0x3c0064+=0x1){socket[_0xad39('0x88')](_0xad39('0x74'),{'UserId':_0x11e0f8[_0xad39('0x4d')][_0xad39('0x75')][_0x3c0064],'VoiceQueueId':_0x11e0f8[_0xad39('0x48')]['id']});}return _0x403f5f;});}})[_0xad39('0x24')](function(_0x4ff7ab){_0x176f7b=_0x4ff7ab||[];if(_0x498305){return db['User']['findAll']({'where':{'id':_0x11e0f8['body'][_0xad39('0x75')]},'attributes':['id',_0xad39('0x2f'),_0xad39('0x67'),_0xad39('0x68'),_0xad39('0x69')],'raw':!![]});}})[_0xad39('0x24')](function(_0x2ef3a2){if(!_[_0xad39('0x86')](_0x2ef3a2)){var _0x33022a=[];for(var _0x17f54b=0x0;_0x17f54b<_0x2ef3a2['length'];_0x17f54b++){if(_0x2ef3a2[_0x17f54b][_0xad39('0x67')]){_0x33022a[_0xad39('0x7d')](db[_0xad39('0x71')][_0xad39('0x72')]({'membername':_0x2ef3a2[_0x17f54b][_0xad39('0x2f')],'UserId':_0x2ef3a2[_0x17f54b]['id'],'queue_name':_0x498305[_0xad39('0x2f')],'VoiceQueueId':_0x498305['id'],'interface':_[_0xad39('0x8c')](_0x2ef3a2[_0x17f54b][_0xad39('0x69')])?util['format']('SIP/%s',_0x2ef3a2[_0x17f54b][_0xad39('0x2f')]):_0x2ef3a2[_0x17f54b][_0xad39('0x69')],'paused':_0x2ef3a2[_0x17f54b]['voicePause']||![],'penalty':_0x11e0f8['body'][_0xad39('0x6c')]||0x0}));}}return BPromise['all'](_0x33022a);}})[_0xad39('0x24')](function(){return _0x176f7b;})[_0xad39('0x24')](respondWithResult(_0x4ebb86,null))[_0xad39('0x4b')](handleError(_0x4ebb86,null));};exports[_0xad39('0x87')]=function(_0x574d56,_0x3463de,_0x24e200){return db[_0xad39('0x32')][_0xad39('0x4a')]({'where':{'id':_0x574d56[_0xad39('0x48')]['id']}})['then'](handleEntityNotFound(_0x3463de,null))['then'](function(_0x41894e){if(_0x41894e){return _0x41894e[_0xad39('0x87')](_0x574d56[_0xad39('0x36')]['ids'])['then'](function(){if(_['isArray'](_0x574d56['query'][_0xad39('0x75')])){for(var _0x40f47b=0x0;_0x40f47b<_0x574d56[_0xad39('0x36')][_0xad39('0x75')][_0xad39('0x3b')];_0x40f47b+=0x1){socket[_0xad39('0x88')]('userVoiceQueue:remove',{'UserId':Number(_0x574d56[_0xad39('0x36')][_0xad39('0x75')][_0x40f47b]),'VoiceQueueId':Number(_0x574d56[_0xad39('0x48')]['id'])});}}else{socket[_0xad39('0x88')](_0xad39('0x89'),{'UserId':Number(_0x574d56[_0xad39('0x36')][_0xad39('0x75')]),'VoiceQueueId':Number(_0x574d56[_0xad39('0x48')]['id'])});}});}})['then'](function(_0x34efc1){return db['UserVoiceQueueRt'][_0xad39('0x25')]({'where':{'VoiceQueueId':_0x574d56['params']['id'],'UserId':_0x574d56[_0xad39('0x36')][_0xad39('0x75')]}})['then'](function(){return _0x34efc1;});})['then'](respondWithStatusCode(_0x3463de,null))['catch'](handleError(_0x3463de,null));};exports[_0xad39('0x8d')]=function(_0x529fe1,_0x350870,_0x2a0d9b){var _0x2dbc87={};var _0xb72565={};var _0x307888;var _0x2983e4;return db[_0xad39('0x32')][_0xad39('0x59')]({'where':{'id':_0x529fe1[_0xad39('0x48')]['id']}})[_0xad39('0x24')](handleEntityNotFound(_0x350870,null))[_0xad39('0x24')](function(_0x14c402){if(_0x14c402){_0x307888=_0x14c402;_0xb72565[_0xad39('0x34')]=_[_0xad39('0x35')](db['User'][_0xad39('0x33')]);_0xb72565[_0xad39('0x36')]=_[_0xad39('0x35')](_0x529fe1[_0xad39('0x36')]);_0xb72565[_0xad39('0x37')]=_[_0xad39('0x38')](_0xb72565[_0xad39('0x34')],_0xb72565['query']);_0x2dbc87['attributes']=_['intersection'](_0xb72565[_0xad39('0x34')],qs[_0xad39('0x3a')](_0x529fe1[_0xad39('0x36')][_0xad39('0x3a')]));_0x2dbc87[_0xad39('0x39')]=_0x2dbc87[_0xad39('0x39')][_0xad39('0x3b')]?_0x2dbc87['attributes']:_0xb72565[_0xad39('0x34')];_0x2dbc87[_0xad39('0x3d')]=qs[_0xad39('0x3e')](_0x529fe1[_0xad39('0x36')][_0xad39('0x3e')]);_0x2dbc87[_0xad39('0x3f')]=qs[_0xad39('0x37')](_[_0xad39('0x40')](_0x529fe1['query'],_0xb72565[_0xad39('0x37')]));if(_0x529fe1[_0xad39('0x36')][_0xad39('0x2a')]){_0x2dbc87[_0xad39('0x3f')]=_['merge'](_0x2dbc87[_0xad39('0x3f')],{'$or':_[_0xad39('0x2c')](_0x2dbc87[_0xad39('0x39')],function(_0x2e0387){var _0x405142={};_0x405142[_0x2e0387]={'$like':'%'+_0x529fe1['query'][_0xad39('0x2a')]+'%'};return _0x405142;})});}_0x2dbc87=_['merge']({},_0x2dbc87,_0x529fe1['options']);return _0x307888[_0xad39('0x8d')](_0x2dbc87);}})[_0xad39('0x24')](function(_0x1e53a1){if(_0x1e53a1){_0x2983e4=_0x1e53a1[_0xad39('0x3b')];if(!_0x529fe1['query'][_0xad39('0x3c')](_0xad39('0x5a'))){_0x2dbc87[_0xad39('0x1e')]=qs[_0xad39('0x1e')](_0x529fe1['query'][_0xad39('0x1e')]);_0x2dbc87[_0xad39('0x1d')]=qs[_0xad39('0x1d')](_0x529fe1[_0xad39('0x36')][_0xad39('0x1d')]);}return _0x307888[_0xad39('0x8d')](_0x2dbc87);}})[_0xad39('0x24')](function(_0x2c241b){if(_0x2c241b){return _0x2c241b?{'count':_0x2983e4,'rows':_0x2c241b}:null;}})['then'](respondWithResult(_0x350870,null))[_0xad39('0x4b')](handleError(_0x350870,null));};exports[_0xad39('0x8e')]=function(_0x45b80e,_0x23b85f,_0x4bf92f){var _0x52468a={};var _0x17695c={};var _0x2b2712;var _0x234dd1;return db[_0xad39('0x32')][_0xad39('0x59')]({'where':{'id':_0x45b80e[_0xad39('0x48')]['id']}})[_0xad39('0x24')](handleEntityNotFound(_0x23b85f,null))['then'](function(_0x4d5e59){if(_0x4d5e59){_0x2b2712=_0x4d5e59;_0x17695c[_0xad39('0x34')]=_['keys'](db['UserVoiceQueueRt']['rawAttributes']);_0x17695c['query']=_[_0xad39('0x35')](_0x45b80e[_0xad39('0x36')]);_0x17695c[_0xad39('0x37')]=_[_0xad39('0x38')](_0x17695c[_0xad39('0x34')],_0x17695c['query']);_0x52468a[_0xad39('0x39')]=_[_0xad39('0x38')](_0x17695c[_0xad39('0x34')],qs[_0xad39('0x3a')](_0x45b80e[_0xad39('0x36')][_0xad39('0x3a')]));_0x52468a[_0xad39('0x39')]=_0x52468a['attributes']['length']?_0x52468a[_0xad39('0x39')]:_0x17695c[_0xad39('0x34')];_0x52468a[_0xad39('0x3d')]=qs[_0xad39('0x3e')](_0x45b80e[_0xad39('0x36')]['sort']);_0x52468a[_0xad39('0x3f')]=qs['filters'](_['pick'](_0x45b80e[_0xad39('0x36')],_0x17695c[_0xad39('0x37')]));if(_0x45b80e[_0xad39('0x36')][_0xad39('0x2a')]){_0x52468a['where']=_['merge'](_0x52468a[_0xad39('0x3f')],{'$or':_[_0xad39('0x2c')](_0x52468a['attributes'],function(_0x45ddab){var _0x53e2ed={};_0x53e2ed[_0x45ddab]={'$like':'%'+_0x45b80e[_0xad39('0x36')][_0xad39('0x2a')]+'%'};return _0x53e2ed;})});}_0x52468a=_['merge']({},_0x52468a,_0x45b80e[_0xad39('0x43')]);return _0x2b2712[_0xad39('0x8e')](_0x52468a);}})[_0xad39('0x24')](function(_0x4cd392){if(_0x4cd392){_0x234dd1=_0x4cd392[_0xad39('0x3b')];if(!_0x45b80e[_0xad39('0x36')][_0xad39('0x3c')](_0xad39('0x5a'))){_0x52468a[_0xad39('0x1e')]=qs['limit'](_0x45b80e[_0xad39('0x36')][_0xad39('0x1e')]);_0x52468a[_0xad39('0x1d')]=qs['offset'](_0x45b80e['query']['offset']);}return _0x2b2712['getMembers'](_0x52468a);}})[_0xad39('0x24')](function(_0xa22e63){return _0xa22e63?{'count':_0x234dd1,'rows':_0xa22e63}:null;})[_0xad39('0x24')](respondWithResult(_0x23b85f,null))['catch'](handleError(_0x23b85f,null));};exports[_0xad39('0x8f')]=function(_0x1fe9ec,_0x46bb2e,_0x4aa190){var _0x260fa1={};var _0xd2808={};var _0xa66de7;var _0x268334;return db[_0xad39('0x32')][_0xad39('0x59')]({'where':{'id':_0x1fe9ec[_0xad39('0x48')]['id']}})[_0xad39('0x24')](handleEntityNotFound(_0x46bb2e,null))[_0xad39('0x24')](function(_0x9d59ca){if(_0x9d59ca){_0xa66de7=_0x9d59ca;_0xd2808[_0xad39('0x34')]=_[_0xad39('0x35')](db[_0xad39('0x90')][_0xad39('0x33')]);_0xd2808[_0xad39('0x36')]=_[_0xad39('0x35')](_0x1fe9ec[_0xad39('0x36')]);_0xd2808[_0xad39('0x37')]=_[_0xad39('0x38')](_0xd2808[_0xad39('0x34')],_0xd2808[_0xad39('0x36')]);_0x260fa1[_0xad39('0x39')]=_['intersection'](_0xd2808['model'],qs[_0xad39('0x3a')](_0x1fe9ec[_0xad39('0x36')][_0xad39('0x3a')]));_0x260fa1[_0xad39('0x39')]=_0x260fa1['attributes'][_0xad39('0x3b')]?_0x260fa1[_0xad39('0x39')]:_0xd2808['model'];_0x260fa1['order']=qs[_0xad39('0x3e')](_0x1fe9ec[_0xad39('0x36')][_0xad39('0x3e')]);_0x260fa1[_0xad39('0x3f')]=qs[_0xad39('0x37')](_[_0xad39('0x40')](_0x1fe9ec[_0xad39('0x36')],_0xd2808[_0xad39('0x37')]));if(_0x1fe9ec[_0xad39('0x36')][_0xad39('0x2a')]){_0x260fa1['where']=_[_0xad39('0x41')](_0x260fa1['where'],{'$or':_[_0xad39('0x2c')](_0x260fa1['attributes'],function(_0x125ad8){var _0x346bb7={};_0x346bb7[_0x125ad8]={'$like':'%'+_0x1fe9ec[_0xad39('0x36')][_0xad39('0x2a')]+'%'};return _0x346bb7;})});}_0x260fa1=_[_0xad39('0x41')]({},_0x260fa1,_0x1fe9ec[_0xad39('0x43')]);return _0xa66de7[_0xad39('0x8f')](_0x260fa1);}})[_0xad39('0x24')](function(_0x16d3b5){if(_0x16d3b5){_0x268334=_0x16d3b5['length'];if(!_0x1fe9ec['query'][_0xad39('0x3c')](_0xad39('0x5a'))){_0x260fa1['limit']=qs['limit'](_0x1fe9ec[_0xad39('0x36')][_0xad39('0x1e')]);_0x260fa1[_0xad39('0x1d')]=qs[_0xad39('0x1d')](_0x1fe9ec['query'][_0xad39('0x1d')]);}return _0xa66de7[_0xad39('0x8f')](_0x260fa1);}})['then'](function(_0x13bda4){if(_0x13bda4){return _0x13bda4?{'count':_0x268334,'rows':_0x13bda4}:null;}})[_0xad39('0x24')](respondWithResult(_0x46bb2e,null))[_0xad39('0x4b')](handleError(_0x46bb2e,null));};exports['addLists']=function(_0x5654b6,_0x273deb,_0x1a587f){var _0xf0ab3,_0x4717ad;return db['VoiceQueue'][_0xad39('0x4a')]({'where':{'id':_0x5654b6[_0xad39('0x48')]['id']}})[_0xad39('0x24')](handleEntityNotFound(_0x273deb,null))[_0xad39('0x24')](function(_0x17d63c){if(_0x17d63c){_0x4717ad=_0x17d63c;return _0x17d63c[_0xad39('0x91')](_0x5654b6[_0xad39('0x4d')]['ids'],_[_0xad39('0x55')](_0x5654b6['body'],[_0xad39('0x75'),'id'])||{});}return null;})[_0xad39('0x8b')](function(_0x1e2ebc){var _0x226002;_0xf0ab3=_0x1e2ebc||[];var _0x2be1e4=[];if(_0x1e2ebc){for(var _0x281ab7=0x0;_0x281ab7<_0x1e2ebc['length'];_0x281ab7+=0x1){var _0x42d43c=_0x1e2ebc[_0x281ab7][_0xad39('0x26')]({'plain':!![]});_0x4717ad['dialCheckDuplicateType']=_0x5654b6[_0xad39('0x4d')]['dialCheckDuplicateType']?_0x5654b6[_0xad39('0x4d')][_0xad39('0x92')]:_0x4717ad[_0xad39('0x92')];switch(_0x4717ad[_0xad39('0x92')]){case'always':_0x226002=squel[_0xad39('0x93')]()[_0xad39('0x94')](_0xad39('0x95'))[_0xad39('0x96')]([_0xad39('0x97'),_0xad39('0x98'),_0xad39('0x99'),_0xad39('0x9a'),_0xad39('0x5b'),_0xad39('0x9b'),'updatedAt'],squel[_0xad39('0x76')]()['field'](_0xad39('0x97'),_0xad39('0x97'))[_0xad39('0x77')](_0xad39('0x9c'),_0xad39('0x98'))[_0xad39('0x77')]('id',_0xad39('0x99'))['field'](_0x42d43c[_0xad39('0x9d')][_0xad39('0x7e')](),_0xad39('0x9a'))[_0xad39('0x77')](_0x5654b6['params']['id']['toString'](),_0xad39('0x5b'))['field'](_0xad39('0x9c'),_0xad39('0x9b'))[_0xad39('0x77')](_0xad39('0x9c'),_0xad39('0x56'))['from'](_0xad39('0x9e'))[_0xad39('0x3f')]('deletedAt\x20IS\x20NULL')[_0xad39('0x3f')](_0xad39('0x9f'),_0x42d43c['CmListId'][_0xad39('0x7e')]())[_0xad39('0x3f')](_0xad39('0xa0'))[_0xad39('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xad39('0x76')]()[_0xad39('0x77')](_0xad39('0xa1'))[_0xad39('0x78')](_0xad39('0xa2'))['where'](_0xad39('0xa3'),_0x5654b6[_0xad39('0x48')]['id']['toString']()))[_0xad39('0x3f')](_0xad39('0xa4'),squel[_0xad39('0x76')]()[_0xad39('0x77')](_0xad39('0xa5'))['from'](_0xad39('0x95'))[_0xad39('0x3f')](_0xad39('0xa3'),_0x5654b6[_0xad39('0x48')]['id'][_0xad39('0x7e')]())))['toString']();break;case _0xad39('0xa6'):_0x226002=squel[_0xad39('0x93')]()['into'](_0xad39('0x95'))[_0xad39('0x96')](['phone',_0xad39('0x98'),_0xad39('0x99'),'ListId','VoiceQueueId',_0xad39('0x9b'),'updatedAt'],squel[_0xad39('0x76')]()['field']('phone',_0xad39('0x97'))['field'](_0xad39('0x9c'),'scheduledAt')['field']('id',_0xad39('0x99'))[_0xad39('0x77')](_0x42d43c[_0xad39('0x9d')][_0xad39('0x7e')](),'ListId')[_0xad39('0x77')](_0x5654b6['params']['id'][_0xad39('0x7e')](),_0xad39('0x5b'))[_0xad39('0x77')](_0xad39('0x9c'),'createdAt')[_0xad39('0x77')](_0xad39('0x9c'),_0xad39('0x56'))[_0xad39('0x78')](_0xad39('0x9e'))[_0xad39('0x3f')](_0xad39('0xa7'))[_0xad39('0x3f')](_0xad39('0x9f'),_0x42d43c[_0xad39('0x9d')][_0xad39('0x7e')]())[_0xad39('0x3f')](_0xad39('0xa0'))[_0xad39('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xad39('0x77')](_0xad39('0xa5'))[_0xad39('0x78')](_0xad39('0x95'))['where'](_0xad39('0xa3'),_0x5654b6['params']['id'][_0xad39('0x7e')]())))['toString']();break;default:_0x226002=squel[_0xad39('0x93')]()[_0xad39('0x94')](_0xad39('0x95'))[_0xad39('0x96')](['phone','scheduledAt',_0xad39('0x99'),'ListId',_0xad39('0x5b'),_0xad39('0x9b'),_0xad39('0x56')],squel[_0xad39('0x76')]()[_0xad39('0x77')](_0xad39('0x97'),_0xad39('0x97'))[_0xad39('0x77')](_0xad39('0x9c'),_0xad39('0x98'))[_0xad39('0x77')]('id',_0xad39('0x99'))[_0xad39('0x77')](_0x42d43c[_0xad39('0x9d')][_0xad39('0x7e')](),_0xad39('0x9a'))[_0xad39('0x77')](_0x5654b6['params']['id'][_0xad39('0x7e')](),_0xad39('0x5b'))['field'](_0xad39('0x9c'),'createdAt')[_0xad39('0x77')]('NOW()','updatedAt')['from'](_0xad39('0x9e'))[_0xad39('0x3f')](_0xad39('0xa7'))[_0xad39('0x3f')](_0xad39('0x9f'),_0x42d43c[_0xad39('0x9d')][_0xad39('0x7e')]())[_0xad39('0x3f')](_0xad39('0xa0')))[_0xad39('0x7e')]();}_0x2be1e4[_0xad39('0x7d')](db[_0xad39('0x6d')][_0xad39('0x36')](_0x226002));}return BPromise[_0xad39('0xa8')](_0x2be1e4);}})[_0xad39('0x24')](function(){return _0xf0ab3;})['then'](respondWithResult(_0x273deb,null))[_0xad39('0x4b')](handleError(_0x273deb,null));};exports[_0xad39('0xa9')]=function(_0x17310f,_0x51ccdc,_0x4e061d){return db[_0xad39('0x32')][_0xad39('0x4a')]({'where':{'id':_0x17310f[_0xad39('0x48')]['id']}})[_0xad39('0x24')](handleEntityNotFound(_0x51ccdc,null))['then'](function(_0x5711ee){if(_0x5711ee){return _0x5711ee[_0xad39('0xa9')](_0x17310f['query'][_0xad39('0x75')]);}})[_0xad39('0x24')](function(_0x487e19){if(_0x487e19){return db[_0xad39('0x5c')][_0xad39('0x25')]({'where':{'ListId':_0x17310f['query'][_0xad39('0x75')],'VoiceQueueId':_0x17310f[_0xad39('0x48')]['id']}})[_0xad39('0x24')](function(){return _0x487e19;});}})[_0xad39('0x24')](respondWithStatusCode(_0x51ccdc,null))['catch'](handleError(_0x51ccdc,null));};exports[_0xad39('0xaa')]=function(_0x394e73,_0x42f6bf,_0x2dc5e7){var _0x349d30={};var _0x21ba6e={};var _0xdd944a;var _0x52a26a;return db['VoiceQueue'][_0xad39('0x59')]({'where':{'id':_0x394e73['params']['id']}})[_0xad39('0x24')](handleEntityNotFound(_0x42f6bf,null))['then'](function(_0xde371){if(_0xde371){_0xdd944a=_0xde371;_0x21ba6e[_0xad39('0x34')]=_[_0xad39('0x35')](db[_0xad39('0x90')][_0xad39('0x33')]);_0x21ba6e[_0xad39('0x36')]=_['keys'](_0x394e73['query']);_0x21ba6e[_0xad39('0x37')]=_[_0xad39('0x38')](_0x21ba6e[_0xad39('0x34')],_0x21ba6e['query']);_0x349d30['attributes']=_['intersection'](_0x21ba6e[_0xad39('0x34')],qs[_0xad39('0x3a')](_0x394e73[_0xad39('0x36')]['fields']));_0x349d30[_0xad39('0x39')]=_0x349d30[_0xad39('0x39')]['length']?_0x349d30['attributes']:_0x21ba6e[_0xad39('0x34')];_0x349d30[_0xad39('0x3d')]=qs[_0xad39('0x3e')](_0x394e73[_0xad39('0x36')]['sort']);_0x349d30[_0xad39('0x3f')]=qs[_0xad39('0x37')](_[_0xad39('0x40')](_0x394e73[_0xad39('0x36')],_0x21ba6e[_0xad39('0x37')]));if(_0x394e73['query'][_0xad39('0x2a')]){_0x349d30['where']=_['merge'](_0x349d30[_0xad39('0x3f')],{'$or':_[_0xad39('0x2c')](_0x349d30[_0xad39('0x39')],function(_0x3e2fa9){var _0x4147bb={};_0x4147bb[_0x3e2fa9]={'$like':'%'+_0x394e73[_0xad39('0x36')][_0xad39('0x2a')]+'%'};return _0x4147bb;})});}_0x349d30=_[_0xad39('0x41')]({},_0x349d30,_0x394e73['options']);return _0xdd944a[_0xad39('0xaa')](_0x349d30);}})['then'](function(_0x3c4a2e){if(_0x3c4a2e){_0x52a26a=_0x3c4a2e[_0xad39('0x3b')];if(!_0x394e73[_0xad39('0x36')][_0xad39('0x3c')](_0xad39('0x5a'))){_0x349d30['limit']=qs[_0xad39('0x1e')](_0x394e73[_0xad39('0x36')][_0xad39('0x1e')]);_0x349d30['offset']=qs[_0xad39('0x1d')](_0x394e73[_0xad39('0x36')][_0xad39('0x1d')]);}return _0xdd944a[_0xad39('0xaa')](_0x349d30);}})[_0xad39('0x24')](function(_0x5c2711){if(_0x5c2711){return _0x5c2711?{'count':_0x52a26a,'rows':_0x5c2711}:null;}})['then'](respondWithResult(_0x42f6bf,null))[_0xad39('0x4b')](handleError(_0x42f6bf,null));};exports[_0xad39('0xab')]=function(_0x55e757,_0x198c85,_0x38192c){var _0x2e3449,_0x493a71;return db['VoiceQueue'][_0xad39('0x4a')]({'where':{'id':_0x55e757[_0xad39('0x48')]['id']}})['then'](handleEntityNotFound(_0x198c85,null))[_0xad39('0x24')](function(_0x16533a){if(_0x16533a){_0x493a71=_0x16533a;return _0x16533a[_0xad39('0xab')](_0x55e757[_0xad39('0x4d')][_0xad39('0x75')],_['omit'](_0x55e757[_0xad39('0x4d')],['ids','id'])||{});}return null;})[_0xad39('0x8b')](function(_0x4a69ec){var _0x3c4b2e;_0x2e3449=_0x4a69ec||[];var _0x1b2a11=[];if(_0x4a69ec){for(var _0x4b241e=0x0;_0x4b241e<_0x4a69ec[_0xad39('0x3b')];_0x4b241e+=0x1){var _0x1723e5=_0x4a69ec[_0x4b241e][_0xad39('0x26')]({'plain':!![]});_0x3c4b2e=squel[_0xad39('0x93')]()['into']('cm_hopper_black')[_0xad39('0x96')]([_0xad39('0x97'),'ContactId','ListId',_0xad39('0x5b'),'createdAt',_0xad39('0x56')],squel[_0xad39('0x76')]()[_0xad39('0x77')](_0xad39('0x97'),_0xad39('0x97'))[_0xad39('0x77')]('id',_0xad39('0x99'))[_0xad39('0x77')](_0x1723e5[_0xad39('0x9d')]['toString'](),_0xad39('0x9a'))[_0xad39('0x77')](_0x55e757[_0xad39('0x48')]['id'][_0xad39('0x7e')](),_0xad39('0x5b'))['field'](_0xad39('0x9c'),_0xad39('0x9b'))[_0xad39('0x77')]('NOW()',_0xad39('0x56'))['from']('cm_contacts')['where'](_0xad39('0xa7'))[_0xad39('0x3f')](_0xad39('0x9f'),_0x1723e5[_0xad39('0x9d')]['toString']())[_0xad39('0x3f')](_0xad39('0xa0')))[_0xad39('0x7e')]();_0x1b2a11[_0xad39('0x7d')](db['sequelize'][_0xad39('0x36')](_0x3c4b2e));}return BPromise['all'](_0x1b2a11);}})[_0xad39('0x24')](function(){return _0x2e3449;})[_0xad39('0x24')](respondWithResult(_0x198c85,null))[_0xad39('0x4b')](handleError(_0x198c85,null));};exports[_0xad39('0xac')]=function(_0x184ff5,_0x3aed8e,_0x107eb7){return db[_0xad39('0x32')][_0xad39('0x4a')]({'where':{'id':_0x184ff5['params']['id']}})[_0xad39('0x24')](handleEntityNotFound(_0x3aed8e,null))[_0xad39('0x24')](function(_0x55163d){if(_0x55163d){return _0x55163d[_0xad39('0xac')](_0x184ff5[_0xad39('0x36')]['ids']);}})[_0xad39('0x24')](function(_0x1d200f){if(_0x1d200f){return db[_0xad39('0x60')][_0xad39('0x25')]({'where':{'ListId':_0x184ff5['query']['ids'],'VoiceQueueId':_0x184ff5[_0xad39('0x48')]['id']}})['then'](function(){return _0x1d200f;});}})[_0xad39('0x24')](respondWithStatusCode(_0x3aed8e,null))[_0xad39('0x4b')](handleError(_0x3aed8e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 0778660..65874e7 100644 --- a/server/api/voiceQueue/voiceQueue.events.js +++ b/server/api/voiceQueue/voiceQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49c8=['setMaxListeners','emit','hasOwnProperty','exports','../../mysqldb','VoiceQueue'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x49c8,0xb8));var _0x849c=function(_0x267383,_0xe13297){_0x267383=_0x267383-0x0;var _0xe89152=_0x49c8[_0x267383];return _0xe89152;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x849c('0x0'))['db'][_0x849c('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x849c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1ef808){return function(_0x3d9b1c,_0x219c3f,_0x5b958f){VoiceQueueEvents[_0x849c('0x3')](_0x1ef808+':'+_0x3d9b1c['id'],_0x3d9b1c);VoiceQueueEvents[_0x849c('0x3')](_0x1ef808,_0x3d9b1c);_0x5b958f(null);};}for(var e in events){if(events[_0x849c('0x4')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x849c('0x5')]=VoiceQueueEvents; \ No newline at end of file +var _0x894d=['hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4b6db3,_0x4bfef8){var _0x5797ff=function(_0x574adf){while(--_0x574adf){_0x4b6db3['push'](_0x4b6db3['shift']());}};_0x5797ff(++_0x4bfef8);}(_0x894d,0x136));var _0xd894=function(_0x3e6f3a,_0x744063){_0x3e6f3a=_0x3e6f3a-0x0;var _0x3364fd=_0x894d[_0x3e6f3a];return _0x3364fd;};'use strict';var EventEmitter=require(_0xd894('0x0'));var VoiceQueue=require(_0xd894('0x1'))['db'][_0xd894('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xd894('0x3')](0x0);var events={'afterCreate':_0xd894('0x4'),'afterUpdate':_0xd894('0x5'),'afterDestroy':_0xd894('0x6')};function emitEvent(_0x3bc6cd){return function(_0x4ac40a,_0x6e0d96,_0x316d02){VoiceQueueEvents[_0xd894('0x7')](_0x3bc6cd+':'+_0x4ac40a['id'],_0x4ac40a);VoiceQueueEvents[_0xd894('0x7')](_0x3bc6cd,_0x4ac40a);_0x316d02(null);};}for(var e in events){if(events[_0xd894('0x8')](e)){var event=events[e];VoiceQueue[_0xd894('0x9')](e,emitEvent(event));}}module[_0xd894('0xa')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 88df3cb..99f606a 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18bf=['bluebird','path','../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','api','moment'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x18bf,0x151));var _0xf18b=function(_0x349c19,_0xf43969){_0x349c19=_0x349c19-0x0;var _0x5af8b8=_0x18bf[_0x349c19];return _0x5af8b8;};'use strict';var _=require(_0xf18b('0x0'));var util=require(_0xf18b('0x1'));var logger=require('../../config/logger')(_0xf18b('0x2'));var moment=require(_0xf18b('0x3'));var BPromise=require(_0xf18b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf18b('0x5'));var rimraf=require('rimraf');var config=require(_0xf18b('0x6'));var attributes=require(_0xf18b('0x7'));module[_0xf18b('0x8')]=function(_0x5ba130,_0xe2577d){return _0x5ba130[_0xf18b('0x9')](_0xf18b('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdd2=['../../config/logger','api','moment','bluebird','path','../../config/environment','exports','VoiceQueue','lodash','util'];(function(_0x19d350,_0x3c843f){var _0x3bfc8d=function(_0xd89003){while(--_0xd89003){_0x19d350['push'](_0x19d350['shift']());}};_0x3bfc8d(++_0x3c843f);}(_0xcdd2,0x94));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cdd('0x0'));var util=require(_0x2cdd('0x1'));var logger=require(_0x2cdd('0x2'))(_0x2cdd('0x3'));var moment=require(_0x2cdd('0x4'));var BPromise=require(_0x2cdd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2cdd('0x6'));var rimraf=require('rimraf');var config=require(_0x2cdd('0x7'));var attributes=require('./voiceQueue.attributes');module[_0x2cdd('0x8')]=function(_0x4ab135,_0x1be7d0){return _0x4ab135['define'](_0x2cdd('0x9'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index aa8d6b9..8e45fe7 100644 --- a/server/api/voiceQueue/voiceQueue.rpc.js +++ b/server/api/voiceQueue/voiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3154=['message','info','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','find','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./voiceQueue.socket','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x1cb654,_0x3a8a02){var _0x3197a7=function(_0x2929bd){while(--_0x2929bd){_0x1cb654['push'](_0x1cb654['shift']());}};_0x3197a7(++_0x3a8a02);}(_0x3154,0x152));var _0x4315=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x3154[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x4315('0x0'));var util=require('util');var moment=require(_0x4315('0x1'));var BPromise=require(_0x4315('0x2'));var rs=require(_0x4315('0x3'));var fs=require('fs');var Redis=require(_0x4315('0x4'));var db=require(_0x4315('0x5'))['db'];var utils=require(_0x4315('0x6'));var logger=require(_0x4315('0x7'))(_0x4315('0x8'));var config=require(_0x4315('0x9'));var jayson=require(_0x4315('0xa'));var client=jayson[_0x4315('0xb')]['http']({'port':0x232a});config[_0x4315('0xc')]=_['defaults'](config['redis'],{'host':_0x4315('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4315('0xe'))['register'](socket);function respondWithRpcPromise(_0x3ee109,_0x1d9d13,_0x35ba00){return new BPromise(function(_0x3a0937,_0x5b4ad1){return client[_0x4315('0xf')](_0x3ee109,_0x35ba00)[_0x4315('0x10')](function(_0x43af0d){logger['info'](_0x4315('0x11'),_0x1d9d13,_0x4315('0x12'));logger[_0x4315('0x13')](_0x4315('0x14'),_0x1d9d13,_0x4315('0x12'),JSON['stringify'](_0x43af0d));if(_0x43af0d[_0x4315('0x15')]){if(_0x43af0d[_0x4315('0x15')]['code']===0x1f4){logger[_0x4315('0x15')](_0x4315('0x11'),_0x1d9d13,_0x43af0d[_0x4315('0x15')][_0x4315('0x16')]);return _0x5b4ad1(_0x43af0d[_0x4315('0x15')]['message']);}logger[_0x4315('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x1d9d13,_0x43af0d[_0x4315('0x15')][_0x4315('0x16')]);return _0x3a0937(_0x43af0d[_0x4315('0x15')]['message']);}else{logger[_0x4315('0x17')](_0x4315('0x11'),_0x1d9d13,_0x4315('0x12'));_0x3a0937(_0x43af0d[_0x4315('0x18')][_0x4315('0x16')]);}})[_0x4315('0x19')](function(_0x10de0e){logger['error'](_0x4315('0x11'),_0x1d9d13,_0x10de0e);_0x5b4ad1(_0x10de0e);});});}exports[_0x4315('0x1a')]=function(_0x1fb963){var _0x45d95a=this;return new Promise(function(_0x35da99,_0x273b62){return db[_0x4315('0x1b')][_0x4315('0x1c')]({'raw':_0x1fb963['options']?_0x1fb963[_0x4315('0x1d')][_0x4315('0x1e')]===undefined?!![]:![]:!![],'where':_0x1fb963['options']?_0x1fb963['options'][_0x4315('0x1f')]||null:null,'attributes':_0x1fb963[_0x4315('0x1d')]?_0x1fb963[_0x4315('0x1d')][_0x4315('0x20')]||null:null,'limit':_0x1fb963[_0x4315('0x1d')]?_0x1fb963['options'][_0x4315('0x21')]||null:null,'include':_0x1fb963[_0x4315('0x1d')]?_0x1fb963['options'][_0x4315('0x22')]?_[_0x4315('0x23')](_0x1fb963[_0x4315('0x1d')][_0x4315('0x22')],function(_0x5936eb){return{'model':db[_0x5936eb['model']],'as':_0x5936eb['as'],'attributes':_0x5936eb[_0x4315('0x20')],'include':_0x5936eb[_0x4315('0x22')]?_[_0x4315('0x23')](_0x5936eb[_0x4315('0x22')],function(_0x3db182){return{'model':db[_0x3db182[_0x4315('0x24')]],'as':_0x3db182['as'],'attributes':_0x3db182[_0x4315('0x20')],'include':_0x3db182[_0x4315('0x22')]?_[_0x4315('0x23')](_0x3db182[_0x4315('0x22')],function(_0x2001da){return{'model':db[_0x2001da['model']],'as':_0x2001da['as'],'attributes':_0x2001da[_0x4315('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4315('0x10')](function(_0xf0d631){logger[_0x4315('0x17')](_0x4315('0x1a'),_0x1fb963);logger[_0x4315('0x13')]('GetVoiceQueue',_0x1fb963,JSON['stringify'](_0xf0d631));_0x35da99(_0xf0d631);})['catch'](function(_0x1936c9){logger[_0x4315('0x15')](_0x4315('0x1a'),_0x1936c9['message'],_0x1fb963);_0x273b62(_0x45d95a[_0x4315('0x15')](0x1f4,_0x1936c9['message']));});});};exports[_0x4315('0x25')]=function(_0x432fdf){var _0x41e415=this;return new Promise(function(_0x1e9d55,_0x484735){return db['VoiceQueue'][_0x4315('0x26')]({'raw':_0x432fdf[_0x4315('0x1d')]?_0x432fdf[_0x4315('0x1d')][_0x4315('0x1e')]===undefined?!![]:![]:!![],'where':_0x432fdf[_0x4315('0x1d')]?_0x432fdf['options'][_0x4315('0x1f')]||null:null,'attributes':_0x432fdf['options']?_0x432fdf[_0x4315('0x1d')]['attributes']||null:null,'include':_0x432fdf['options']?_0x432fdf[_0x4315('0x1d')][_0x4315('0x22')]?_[_0x4315('0x23')](_0x432fdf[_0x4315('0x1d')][_0x4315('0x22')],function(_0x409c18){return{'model':db[_0x409c18[_0x4315('0x24')]],'as':_0x409c18['as'],'attributes':_0x409c18[_0x4315('0x20')],'include':_0x409c18[_0x4315('0x22')]?_['map'](_0x409c18['include'],function(_0x468c53){return{'model':db[_0x468c53[_0x4315('0x24')]],'as':_0x468c53['as'],'attributes':_0x468c53[_0x4315('0x20')],'include':_0x468c53[_0x4315('0x22')]?_['map'](_0x468c53[_0x4315('0x22')],function(_0x1f4b4e){return{'model':db[_0x1f4b4e[_0x4315('0x24')]],'as':_0x1f4b4e['as'],'attributes':_0x1f4b4e[_0x4315('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26bd27){logger[_0x4315('0x17')](_0x4315('0x25'),_0x432fdf);logger[_0x4315('0x13')](_0x4315('0x25'),_0x432fdf,JSON[_0x4315('0x27')](_0x26bd27));_0x1e9d55(_0x26bd27);})[_0x4315('0x19')](function(_0x4a29f3){logger[_0x4315('0x15')](_0x4315('0x25'),_0x4a29f3[_0x4315('0x16')],_0x432fdf);_0x484735(_0x41e415[_0x4315('0x15')](0x1f4,_0x4a29f3[_0x4315('0x16')]));});});}; \ No newline at end of file +var _0xac40=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','VoiceQueue,\x20%s,\x20%s','GetVoiceQueue','VoiceQueue','findAll','options','where','include','map','model','stringify','ShowVoiceQueue','raw','attributes','lodash','util'];(function(_0x40ca11,_0x2cb203){var _0x14555f=function(_0x4df08d){while(--_0x4df08d){_0x40ca11['push'](_0x40ca11['shift']());}};_0x14555f(++_0x2cb203);}(_0xac40,0x178));var _0x0ac4=function(_0x5d3bea,_0x460172){_0x5d3bea=_0x5d3bea-0x0;var _0x14c1f0=_0xac40[_0x5d3bea];return _0x14c1f0;};'use strict';var _=require(_0x0ac4('0x0'));var util=require(_0x0ac4('0x1'));var moment=require(_0x0ac4('0x2'));var BPromise=require(_0x0ac4('0x3'));var rs=require(_0x0ac4('0x4'));var fs=require('fs');var Redis=require(_0x0ac4('0x5'));var db=require(_0x0ac4('0x6'))['db'];var utils=require(_0x0ac4('0x7'));var logger=require(_0x0ac4('0x8'))(_0x0ac4('0x9'));var config=require(_0x0ac4('0xa'));var jayson=require(_0x0ac4('0xb'));var client=jayson[_0x0ac4('0xc')][_0x0ac4('0xd')]({'port':0x232a});config[_0x0ac4('0xe')]=_[_0x0ac4('0xf')](config[_0x0ac4('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x0ac4('0x10'))(new Redis(config['redis']));require(_0x0ac4('0x11'))[_0x0ac4('0x12')](socket);function respondWithRpcPromise(_0x27838f,_0x3df135,_0x3f1c47){return new BPromise(function(_0x3e8d7b,_0x5400ed){return client[_0x0ac4('0x13')](_0x27838f,_0x3f1c47)[_0x0ac4('0x14')](function(_0x2b9f13){logger[_0x0ac4('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x3df135,_0x0ac4('0x16'));logger[_0x0ac4('0x17')](_0x0ac4('0x18'),_0x3df135,_0x0ac4('0x16'),JSON['stringify'](_0x2b9f13));if(_0x2b9f13[_0x0ac4('0x19')]){if(_0x2b9f13[_0x0ac4('0x19')]['code']===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x3df135,_0x2b9f13[_0x0ac4('0x19')][_0x0ac4('0x1a')]);return _0x5400ed(_0x2b9f13[_0x0ac4('0x19')][_0x0ac4('0x1a')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x3df135,_0x2b9f13[_0x0ac4('0x19')][_0x0ac4('0x1a')]);return _0x3e8d7b(_0x2b9f13[_0x0ac4('0x19')][_0x0ac4('0x1a')]);}else{logger[_0x0ac4('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x3df135,'request\x20sent');_0x3e8d7b(_0x2b9f13[_0x0ac4('0x1b')][_0x0ac4('0x1a')]);}})[_0x0ac4('0x1c')](function(_0x4ebe61){logger[_0x0ac4('0x19')](_0x0ac4('0x1d'),_0x3df135,_0x4ebe61);_0x5400ed(_0x4ebe61);});});}exports[_0x0ac4('0x1e')]=function(_0x386236){var _0x57ae7f=this;return new Promise(function(_0x2aa2dc,_0x1f16bc){return db[_0x0ac4('0x1f')][_0x0ac4('0x20')]({'raw':_0x386236[_0x0ac4('0x21')]?_0x386236['options']['raw']===undefined?!![]:![]:!![],'where':_0x386236[_0x0ac4('0x21')]?_0x386236[_0x0ac4('0x21')][_0x0ac4('0x22')]||null:null,'attributes':_0x386236[_0x0ac4('0x21')]?_0x386236[_0x0ac4('0x21')]['attributes']||null:null,'limit':_0x386236[_0x0ac4('0x21')]?_0x386236[_0x0ac4('0x21')]['limit']||null:null,'include':_0x386236[_0x0ac4('0x21')]?_0x386236[_0x0ac4('0x21')][_0x0ac4('0x23')]?_[_0x0ac4('0x24')](_0x386236[_0x0ac4('0x21')][_0x0ac4('0x23')],function(_0x39dccd){return{'model':db[_0x39dccd[_0x0ac4('0x25')]],'as':_0x39dccd['as'],'attributes':_0x39dccd['attributes'],'include':_0x39dccd[_0x0ac4('0x23')]?_['map'](_0x39dccd[_0x0ac4('0x23')],function(_0x1a7b91){return{'model':db[_0x1a7b91[_0x0ac4('0x25')]],'as':_0x1a7b91['as'],'attributes':_0x1a7b91['attributes'],'include':_0x1a7b91[_0x0ac4('0x23')]?_[_0x0ac4('0x24')](_0x1a7b91['include'],function(_0x510306){return{'model':db[_0x510306[_0x0ac4('0x25')]],'as':_0x510306['as'],'attributes':_0x510306['attributes']};}):[]};}):[]};}):[]:[]})[_0x0ac4('0x14')](function(_0x37bd42){logger['info']('GetVoiceQueue',_0x386236);logger['debug'](_0x0ac4('0x1e'),_0x386236,JSON[_0x0ac4('0x26')](_0x37bd42));_0x2aa2dc(_0x37bd42);})[_0x0ac4('0x1c')](function(_0x1cce12){logger['error'](_0x0ac4('0x1e'),_0x1cce12[_0x0ac4('0x1a')],_0x386236);_0x1f16bc(_0x57ae7f['error'](0x1f4,_0x1cce12['message']));});});};exports[_0x0ac4('0x27')]=function(_0x2a688a){var _0x4b775a=this;return new Promise(function(_0x151c10,_0x5f4ae6){return db[_0x0ac4('0x1f')]['find']({'raw':_0x2a688a['options']?_0x2a688a['options'][_0x0ac4('0x28')]===undefined?!![]:![]:!![],'where':_0x2a688a[_0x0ac4('0x21')]?_0x2a688a[_0x0ac4('0x21')]['where']||null:null,'attributes':_0x2a688a[_0x0ac4('0x21')]?_0x2a688a[_0x0ac4('0x21')][_0x0ac4('0x29')]||null:null,'include':_0x2a688a[_0x0ac4('0x21')]?_0x2a688a[_0x0ac4('0x21')][_0x0ac4('0x23')]?_[_0x0ac4('0x24')](_0x2a688a[_0x0ac4('0x21')]['include'],function(_0x202668){return{'model':db[_0x202668['model']],'as':_0x202668['as'],'attributes':_0x202668[_0x0ac4('0x29')],'include':_0x202668[_0x0ac4('0x23')]?_[_0x0ac4('0x24')](_0x202668[_0x0ac4('0x23')],function(_0x1535fd){return{'model':db[_0x1535fd[_0x0ac4('0x25')]],'as':_0x1535fd['as'],'attributes':_0x1535fd[_0x0ac4('0x29')],'include':_0x1535fd[_0x0ac4('0x23')]?_[_0x0ac4('0x24')](_0x1535fd['include'],function(_0x3a2156){return{'model':db[_0x3a2156[_0x0ac4('0x25')]],'as':_0x3a2156['as'],'attributes':_0x3a2156[_0x0ac4('0x29')]};}):[]};}):[]};}):[]:[]})[_0x0ac4('0x14')](function(_0x119bcd){logger[_0x0ac4('0x15')](_0x0ac4('0x27'),_0x2a688a);logger['debug'](_0x0ac4('0x27'),_0x2a688a,JSON[_0x0ac4('0x26')](_0x119bcd));_0x151c10(_0x119bcd);})[_0x0ac4('0x1c')](function(_0x297362){logger[_0x0ac4('0x19')]('ShowVoiceQueue',_0x297362[_0x0ac4('0x1a')],_0x2a688a);_0x5f4ae6(_0x4b775a[_0x0ac4('0x19')](0x1f4,_0x297362['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index d83e800..9c88c67 100644 --- a/server/api/voiceQueue/voiceQueue.socket.js +++ b/server/api/voiceQueue/voiceQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54bd=['register','voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x3d646c,_0x35ddb7){var _0xc6b37c=function(_0x4d89fd){while(--_0x4d89fd){_0x3d646c['push'](_0x3d646c['shift']());}};_0xc6b37c(++_0x35ddb7);}(_0x54bd,0x9a));var _0xd54b=function(_0x547928,_0x26050e){_0x547928=_0x547928-0x0;var _0x3ade56=_0x54bd[_0x547928];return _0x3ade56;};'use strict';var VoiceQueueEvents=require(_0xd54b('0x0'));var events=[_0xd54b('0x1'),_0xd54b('0x2'),_0xd54b('0x3')];function createListener(_0x2391b6,_0x5e7034){return function(_0x4f22d4){_0x5e7034[_0xd54b('0x4')](_0x2391b6,_0x4f22d4);};}function removeListener(_0x18bbf6,_0x4dc045){return function(){VoiceQueueEvents[_0xd54b('0x5')](_0x18bbf6,_0x4dc045);};}exports[_0xd54b('0x6')]=function(_0x52190c){for(var _0x21a670=0x0,_0xff037c=events['length'];_0x21a670<_0xff037c;_0x21a670++){var _0x8046b2=events[_0x21a670];var _0x171422=createListener(_0xd54b('0x7')+_0x8046b2,_0x52190c);VoiceQueueEvents['on'](_0x8046b2,_0x171422);}}; \ No newline at end of file +var _0x4672=['remove','update','emit','removeListener','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x26cf12,_0x151827){var _0x4f2df0=function(_0x36841e){while(--_0x36841e){_0x26cf12['push'](_0x26cf12['shift']());}};_0x4f2df0(++_0x151827);}(_0x4672,0x1d6));var _0x2467=function(_0x2e0a0b,_0x2efce7){_0x2e0a0b=_0x2e0a0b-0x0;var _0x5bc68b=_0x4672[_0x2e0a0b];return _0x5bc68b;};'use strict';var VoiceQueueEvents=require(_0x2467('0x0'));var events=[_0x2467('0x1'),_0x2467('0x2'),_0x2467('0x3')];function createListener(_0x5865a0,_0x3097a4){return function(_0x16e398){_0x3097a4[_0x2467('0x4')](_0x5865a0,_0x16e398);};}function removeListener(_0x581709,_0x310fcf){return function(){VoiceQueueEvents[_0x2467('0x5')](_0x581709,_0x310fcf);};}exports['register']=function(_0x5bd0d7){for(var _0x5b7bde=0x0,_0xa60aaa=events[_0x2467('0x6')];_0x5b7bde<_0xa60aaa;_0x5b7bde++){var _0x163d8e=events[_0x5b7bde];var _0x17c9f6=createListener(_0x2467('0x7')+_0x163d8e,_0x5bd0d7);VoiceQueueEvents['on'](_0x163d8e,_0x17c9f6);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 1948e9a..78757c5 100644 --- a/server/api/voiceQueueReport/index.js +++ b/server/api/voiceQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a07=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','show','create','put','/:id','delete','destroy'];(function(_0x1790bb,_0x232cce){var _0xf5487c=function(_0x6613f2){while(--_0x6613f2){_0x1790bb['push'](_0x1790bb['shift']());}};_0xf5487c(++_0x232cce);}(_0x2a07,0x74));var _0x72a0=function(_0x2bdf29,_0x40cab0){_0x2bdf29=_0x2bdf29-0x0;var _0x60cb83=_0x2a07[_0x2bdf29];return _0x60cb83;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var auth=require(_0x72a0('0x5'));var interaction=require(_0x72a0('0x6'));var config=require(_0x72a0('0x7'));var controller=require(_0x72a0('0x8'));router[_0x72a0('0x9')]('/',auth[_0x72a0('0xa')](),controller[_0x72a0('0xb')]);router[_0x72a0('0x9')](_0x72a0('0xc'),auth[_0x72a0('0xa')](),controller[_0x72a0('0xd')]);router[_0x72a0('0x9')](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller[_0x72a0('0xf')]);router[_0x72a0('0x9')]('/:id',auth[_0x72a0('0xa')](),controller[_0x72a0('0x10')]);router['post']('/',auth[_0x72a0('0xa')](),controller[_0x72a0('0x11')]);router[_0x72a0('0x12')](_0x72a0('0x13'),auth[_0x72a0('0xa')](),controller['update']);router[_0x72a0('0x14')](_0x72a0('0x13'),auth[_0x72a0('0xa')](),controller[_0x72a0('0x15')]);module[_0x72a0('0x16')]=router; \ No newline at end of file +var _0xc7a3=['index','get','getVoiceQueuesReport','show','put','update','delete','/:id','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated'];(function(_0x45c900,_0x38ac6d){var _0x7116ad=function(_0xcf734){while(--_0xcf734){_0x45c900['push'](_0x45c900['shift']());}};_0x7116ad(++_0x38ac6d);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x123c09,_0x44fe60){_0x123c09=_0x123c09-0x0;var _0x3cbf7a=_0xc7a3[_0x123c09];return _0x3cbf7a;};'use strict';var multer=require('multer');var util=require(_0x3c7a('0x0'));var path=require(_0x3c7a('0x1'));var timeout=require(_0x3c7a('0x2'));var express=require(_0x3c7a('0x3'));var router=express[_0x3c7a('0x4')]();var auth=require(_0x3c7a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3c7a('0x6'));var controller=require(_0x3c7a('0x7'));router['get']('/',auth[_0x3c7a('0x8')](),controller[_0x3c7a('0x9')]);router[_0x3c7a('0xa')]('/describe',auth[_0x3c7a('0x8')](),controller['describe']);router[_0x3c7a('0xa')]('/index',auth[_0x3c7a('0x8')](),controller[_0x3c7a('0xb')]);router[_0x3c7a('0xa')]('/:id',auth[_0x3c7a('0x8')](),controller[_0x3c7a('0xc')]);router['post']('/',auth[_0x3c7a('0x8')](),controller['create']);router[_0x3c7a('0xd')]('/:id',auth[_0x3c7a('0x8')](),controller[_0x3c7a('0xe')]);router[_0x3c7a('0xf')](_0x3c7a('0x10'),auth[_0x3c7a('0x8')](),controller['destroy']);module[_0x3c7a('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index d4b0bd5..6cc0b5c 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.attributes.js +++ b/server/api/voiceQueueReport/voiceQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a5b=['DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5a5b,0x1cc));var _0xb5a5=function(_0x5a5bdc,_0x34e85e){_0x5a5bdc=_0x5a5bdc-0x0;var _0x1ae040=_0x5a5b[_0x5a5bdc];return _0x1ae040;};'use strict';var Sequelize=require(_0xb5a5('0x0'));var moment=require(_0xb5a5('0x1'));module[_0xb5a5('0x2')]={'type':{'type':Sequelize[_0xb5a5('0x3')]},'uniqueid':{'type':Sequelize[_0xb5a5('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb5a5('0x3')]},'queue':{'type':Sequelize[_0xb5a5('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xb5a5('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xb5a5('0x4')],'set':function(_0x692fcf){var _0x732b6e=moment(_0x692fcf);var _0x46827f=moment(this[_0xb5a5('0x5')](_0xb5a5('0x6')))[_0xb5a5('0x7')](_0xb5a5('0x8'));var _0x598083=_0x732b6e[_0xb5a5('0x9')](_0x46827f,'seconds');this[_0xb5a5('0xa')](_0xb5a5('0xb'),_0x692fcf);this[_0xb5a5('0xa')](_0xb5a5('0xc'),_0x598083||null);}},'position':{'type':Sequelize[_0xb5a5('0xd')]},'count':{'type':Sequelize[_0xb5a5('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xb5a5('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xb5a5('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xb5a5('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xb5a5('0x4')]},'queuecallerexit':{'type':Sequelize[_0xb5a5('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb5a5('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xb5a5('0x3')],'comment':_0xb5a5('0xf')},'originalposition':{'type':Sequelize[_0xb5a5('0xd')]},'channel':{'type':Sequelize[_0xb5a5('0x3')]},'connectedlinenum':{'type':Sequelize[_0xb5a5('0x3')]},'connectedlinename':{'type':Sequelize[_0xb5a5('0x3')]},'accountcode':{'type':Sequelize[_0xb5a5('0x3')]},'context':{'type':Sequelize[_0xb5a5('0x3')]},'exten':{'type':Sequelize[_0xb5a5('0x3')]},'priority':{'type':Sequelize[_0xb5a5('0x3')]},'holdtime':{'type':Sequelize[_0xb5a5('0xd')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb5a5('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xb5a5('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xb5a5('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1e67=['queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','INTEGER','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1e67,0x1dc));var _0x71e6=function(_0x263bfe,_0x1ed627){_0x263bfe=_0x263bfe-0x0;var _0xb3a493=_0x1e67[_0x263bfe];return _0xb3a493;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x71e6('0x0'));module[_0x71e6('0x1')]={'type':{'type':Sequelize[_0x71e6('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x71e6('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x71e6('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x71e6('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x381a4b){var _0x19176e=moment(_0x381a4b);var _0x5e47ba=moment(this[_0x71e6('0x4')](_0x71e6('0x5')))[_0x71e6('0x6')](_0x71e6('0x7'));var _0x1f0f7d=_0x19176e[_0x71e6('0x8')](_0x5e47ba,'seconds');this['setDataValue']('queuecallerleaveAt',_0x381a4b);this['setDataValue']('holdtime',_0x1f0f7d||null);}},'position':{'type':Sequelize[_0x71e6('0x9')]},'count':{'type':Sequelize[_0x71e6('0x9')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x71e6('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x71e6('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x71e6('0x2')],'comment':_0x71e6('0xa')},'originalposition':{'type':Sequelize[_0x71e6('0x9')]},'channel':{'type':Sequelize[_0x71e6('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x71e6('0x2')]},'accountcode':{'type':Sequelize[_0x71e6('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x71e6('0x2')]},'priority':{'type':Sequelize[_0x71e6('0x2')]},'holdtime':{'type':Sequelize[_0x71e6('0x9')]},'mohtime':{'type':Sequelize[_0x71e6('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x71e6('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x71e6('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x71e6('0x2')],'comment':_0x71e6('0xc')},'transferexten':{'type':Sequelize[_0x71e6('0x2')]},'transferuniqueid':{'type':Sequelize[_0x71e6('0x2')]},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x71e6('0x9')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index f64ed5f..e869561 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.controller.js +++ b/server/api/voiceQueueReport/voiceQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','then','destroy','error','name','send','index','VoiceQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','map','key','VIRTUAL','merge','options','count','includeAll','include','findAll','show','params','length','find','create','body','update','catch','describe','pick','rows','getVoiceQueuesReport','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x5133f5,_0x8f7a00){var _0x2cc098=function(_0x106672){while(--_0x106672){_0x5133f5['push'](_0x5133f5['shift']());}};_0x2cc098(++_0x8f7a00);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4270ac,_0x5d6bc7){_0x4270ac=_0x4270ac-0x0;var _0x439a79=_0x9bde[_0x4270ac];return _0x439a79;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe9bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe9bd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9bd('0x2'));var moment=require(_0xe9bd('0x3'));var BPromise=require(_0xe9bd('0x4'));var Mustache=require(_0xe9bd('0x5'));var util=require(_0xe9bd('0x6'));var path=require(_0xe9bd('0x7'));var sox=require(_0xe9bd('0x8'));var csv=require('to-csv');var ejs=require(_0xe9bd('0x9'));var fs=require('fs');var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0xf'));var querystring=require(_0xe9bd('0x10'));var Papa=require(_0xe9bd('0x11'));var Redis=require(_0xe9bd('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))(_0xe9bd('0x15'));var utils=require('../../config/utils');var config=require(_0xe9bd('0x16'));var db=require(_0xe9bd('0x17'))['db'];config[_0xe9bd('0x18')]=_[_0xe9bd('0x19')](config['redis'],{'host':_0xe9bd('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe9bd('0x18')]));require(_0xe9bd('0x1b'))[_0xe9bd('0x1c')](socket);function respondWithStatusCode(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xcc;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1d')](_0x47ba5e);}return _0x51109f[_0xe9bd('0x1e')](_0x47ba5e)[_0xe9bd('0x1f')]();};}function respondWithResult(_0x3360bd,_0x389e7b){_0x389e7b=_0x389e7b||0xc8;return function(_0x45a9f2){if(_0x45a9f2){return _0x3360bd['status'](_0x389e7b)[_0xe9bd('0x20')](_0x45a9f2);}};}function respondWithFilteredResult(_0x464a1b,_0x160281){return function(_0x494b27){if(_0x494b27){var _0x36f03d=_0x494b27['count'],_0x3bae08=_0x160281[_0xe9bd('0x21')],_0x34ba2b=_0x160281['offset']+_0x160281[_0xe9bd('0x22')],_0x330733;if(_0x34ba2b>=_0x36f03d){_0x34ba2b=_0x36f03d;_0x330733=0xc8;}else{_0x330733=0xce;}_0x464a1b['status'](_0x330733);return _0x464a1b[_0xe9bd('0x23')](_0xe9bd('0x24'),_0x3bae08+'-'+_0x34ba2b+'/'+_0x36f03d)[_0xe9bd('0x20')](_0x494b27);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x25')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x26')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x27')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x28')]()[_0xe9bd('0x27')](function(){_0x36f8c0[_0xe9bd('0x1e')](0xcc)[_0xe9bd('0x1f')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x1d')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x29')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x2a')]){delete _0x3c211a[_0xe9bd('0x2a')];}_0x1ae889[_0xe9bd('0x1e')](_0x5987af)[_0xe9bd('0x2b')](_0x3c211a);};}exports[_0xe9bd('0x2c')]=function(_0x183601,_0x519f48){var _0x5b7f1d={},_0x1de54c={},_0x56e409={'count':0x0,'rows':[]};var _0xa45eb0=db[_0xe9bd('0x2d')][_0xe9bd('0x2e')];_0x1de54c[_0xe9bd('0x2f')]=_[_0xe9bd('0x30')](_0xa45eb0);_0x1de54c['query']=_['keys'](_0x183601[_0xe9bd('0x31')]);_0x1de54c[_0xe9bd('0x32')]=_[_0xe9bd('0x33')](_0x1de54c[_0xe9bd('0x2f')],_0x1de54c[_0xe9bd('0x31')]);_0x5b7f1d[_0xe9bd('0x34')]=_[_0xe9bd('0x33')](_0x1de54c[_0xe9bd('0x2f')],qs[_0xe9bd('0x35')](_0x183601['query'][_0xe9bd('0x35')]));_0x5b7f1d[_0xe9bd('0x34')]=_0x5b7f1d[_0xe9bd('0x34')]['length']?_0x5b7f1d['attributes']:_0x1de54c[_0xe9bd('0x2f')];if(!_0x183601[_0xe9bd('0x31')][_0xe9bd('0x36')](_0xe9bd('0x37'))){_0x5b7f1d[_0xe9bd('0x22')]=qs[_0xe9bd('0x22')](_0x183601[_0xe9bd('0x31')][_0xe9bd('0x22')]);_0x5b7f1d[_0xe9bd('0x21')]=qs[_0xe9bd('0x21')](_0x183601[_0xe9bd('0x31')][_0xe9bd('0x21')]);}_0x5b7f1d[_0xe9bd('0x38')]=qs[_0xe9bd('0x39')](_0x183601[_0xe9bd('0x31')][_0xe9bd('0x39')]);_0x5b7f1d[_0xe9bd('0x3a')]=qs[_0xe9bd('0x32')](_['pick'](_0x183601[_0xe9bd('0x31')],_0x1de54c[_0xe9bd('0x32')]));if(_0x183601['query'][_0xe9bd('0x3b')]){_0x5b7f1d[_0xe9bd('0x3a')]=_['merge'](_0x5b7f1d['where'],{'$or':_[_0xe9bd('0x3c')](_0xa45eb0,function(_0xdf43b9){if(_0xdf43b9['type'][_0xe9bd('0x3d')]!==_0xe9bd('0x3e')){var _0x14927c={};_0x14927c[_0xdf43b9['field']]={'$like':'%'+_0x183601[_0xe9bd('0x31')]['filter']+'%'};return _0x14927c;}})});}_0x5b7f1d=_[_0xe9bd('0x3f')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x40')]);var _0x63d67c={'where':_0x5b7f1d[_0xe9bd('0x3a')]};return db['VoiceQueueReport'][_0xe9bd('0x41')](_0x63d67c)[_0xe9bd('0x27')](function(_0x327e1a){_0x56e409[_0xe9bd('0x41')]=_0x327e1a;if(_0x183601[_0xe9bd('0x31')][_0xe9bd('0x42')]){_0x5b7f1d[_0xe9bd('0x43')]=[{'all':!![]}];}return db[_0xe9bd('0x2d')][_0xe9bd('0x44')](_0x5b7f1d);})[_0xe9bd('0x27')](function(_0x4e8565){_0x56e409['rows']=_0x4e8565;return _0x56e409;})[_0xe9bd('0x27')](respondWithFilteredResult(_0x519f48,_0x5b7f1d))['catch'](handleError(_0x519f48,null));};exports[_0xe9bd('0x45')]=function(_0x340819,_0x41881a){var _0x480797={'raw':![],'where':{'id':_0x340819[_0xe9bd('0x46')]['id']}},_0x1ba613={};_0x1ba613[_0xe9bd('0x2f')]=_['keys'](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1ba613[_0xe9bd('0x31')]=_[_0xe9bd('0x30')](_0x340819[_0xe9bd('0x31')]);_0x1ba613[_0xe9bd('0x32')]=_[_0xe9bd('0x33')](_0x1ba613[_0xe9bd('0x2f')],_0x1ba613[_0xe9bd('0x31')]);_0x480797[_0xe9bd('0x34')]=_[_0xe9bd('0x33')](_0x1ba613[_0xe9bd('0x2f')],qs[_0xe9bd('0x35')](_0x340819[_0xe9bd('0x31')][_0xe9bd('0x35')]));_0x480797['attributes']=_0x480797['attributes'][_0xe9bd('0x47')]?_0x480797[_0xe9bd('0x34')]:_0x1ba613[_0xe9bd('0x2f')];if(_0x340819['query']['includeAll']){_0x480797[_0xe9bd('0x43')]=[{'all':!![]}];}_0x480797=_[_0xe9bd('0x3f')]({},_0x480797,_0x340819[_0xe9bd('0x40')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x48')](_0x480797)[_0xe9bd('0x27')](handleEntityNotFound(_0x41881a,null))[_0xe9bd('0x27')](respondWithResult(_0x41881a,null))['catch'](handleError(_0x41881a,null));};exports[_0xe9bd('0x49')]=function(_0x4cc146,_0x36726e){return db[_0xe9bd('0x2d')][_0xe9bd('0x49')](_0x4cc146[_0xe9bd('0x4a')],{})[_0xe9bd('0x27')](respondWithResult(_0x36726e,0xc9))['catch'](handleError(_0x36726e,null));};exports[_0xe9bd('0x4b')]=function(_0x3e5d44,_0xe14fa4){if(_0x3e5d44['body']['id']){delete _0x3e5d44[_0xe9bd('0x4a')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x48')]({'where':{'id':_0x3e5d44['params']['id']}})[_0xe9bd('0x27')](handleEntityNotFound(_0xe14fa4,null))[_0xe9bd('0x27')](saveUpdates(_0x3e5d44[_0xe9bd('0x4a')],null))[_0xe9bd('0x27')](respondWithResult(_0xe14fa4,null))[_0xe9bd('0x4c')](handleError(_0xe14fa4,null));};exports['destroy']=function(_0x3f4833,_0x4b8ff9){return db[_0xe9bd('0x2d')][_0xe9bd('0x48')]({'where':{'id':_0x3f4833[_0xe9bd('0x46')]['id']}})[_0xe9bd('0x27')](handleEntityNotFound(_0x4b8ff9,null))[_0xe9bd('0x27')](removeEntity(_0x4b8ff9,null))['catch'](handleError(_0x4b8ff9,null));};exports[_0xe9bd('0x4d')]=function(_0x485e95,_0x14eed2){return db[_0xe9bd('0x2d')]['describe']()['then'](respondWithResult(_0x14eed2,null))[_0xe9bd('0x4c')](handleError(_0x14eed2,null));};exports['getVoiceQueuesReport']=function(_0x1ad573,_0x519535){var _0x26b25a={},_0x1cf7be={},_0x5496d7={'count':0x0,'rows':[]};_0x1cf7be[_0xe9bd('0x2f')]=_['keys'](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1cf7be[_0xe9bd('0x31')]=_['keys'](_0x1ad573[_0xe9bd('0x31')]);_0x1cf7be[_0xe9bd('0x32')]=_[_0xe9bd('0x33')](_0x1cf7be[_0xe9bd('0x2f')],_0x1cf7be['query']);_0x26b25a['attributes']=_[_0xe9bd('0x33')](_0x1cf7be['model'],qs[_0xe9bd('0x35')](_0x1ad573[_0xe9bd('0x31')][_0xe9bd('0x35')]));_0x26b25a[_0xe9bd('0x34')]=_0x26b25a[_0xe9bd('0x34')][_0xe9bd('0x47')]?_0x26b25a[_0xe9bd('0x34')]:_0x1cf7be[_0xe9bd('0x2f')];if(!_0x1ad573[_0xe9bd('0x31')][_0xe9bd('0x36')](_0xe9bd('0x37'))){_0x26b25a[_0xe9bd('0x22')]=qs['limit'](_0x1ad573['query']['limit']);_0x26b25a[_0xe9bd('0x21')]=qs['offset'](_0x1ad573[_0xe9bd('0x31')][_0xe9bd('0x21')]);}_0x26b25a[_0xe9bd('0x38')]=qs[_0xe9bd('0x39')](_0x1ad573[_0xe9bd('0x31')][_0xe9bd('0x39')]);_0x26b25a[_0xe9bd('0x3a')]=qs[_0xe9bd('0x32')](_[_0xe9bd('0x4e')](_0x1ad573['query'],_0x1cf7be[_0xe9bd('0x32')]));if(_0x1ad573[_0xe9bd('0x31')][_0xe9bd('0x3b')]){_0x26b25a[_0xe9bd('0x3a')]=_['merge'](_0x26b25a[_0xe9bd('0x3a')],{'$or':_[_0xe9bd('0x3c')](_0x26b25a[_0xe9bd('0x34')],function(_0x4e05f0){var _0x3e6f63={};_0x3e6f63[_0x4e05f0]={'$like':'%'+_0x1ad573[_0xe9bd('0x31')][_0xe9bd('0x3b')]+'%'};return _0x3e6f63;})});}_0x26b25a=_[_0xe9bd('0x3f')]({},_0x26b25a,_0x1ad573['options']);var _0x4b3447={'where':_0x26b25a[_0xe9bd('0x3a')]};return db[_0xe9bd('0x2d')][_0xe9bd('0x41')](_0x4b3447)[_0xe9bd('0x27')](function(_0x52cd0a){_0x5496d7['count']=_0x52cd0a;if(_0x1ad573[_0xe9bd('0x31')][_0xe9bd('0x42')]){_0x26b25a[_0xe9bd('0x43')]=[{'all':!![]}];}return db[_0xe9bd('0x2d')][_0xe9bd('0x44')](_0x26b25a);})[_0xe9bd('0x27')](function(_0x4870f8){_0x5496d7[_0xe9bd('0x4f')]=_0x4870f8;return _0x5496d7;})['then'](respondWithFilteredResult(_0x519535,_0x26b25a,_0xe9bd('0x50')))[_0xe9bd('0x4c')](handleError(_0x519535,null,_0xe9bd('0x50')));}; \ No newline at end of file +var _0xbec5=['jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','index','VoiceQueueReport','rawAttributes','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','type','key','field','merge','options','includeAll','include','rows','catch','params','keys','fields','find','create','body','describe','getVoiceQueuesReport','hasOwnProperty','map','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto'];(function(_0x16602c,_0x5d6c55){var _0x1247d2=function(_0x12509a){while(--_0x12509a){_0x16602c['push'](_0x16602c['shift']());}};_0x1247d2(++_0x5d6c55);}(_0xbec5,0xe5));var _0x5bec=function(_0x4c7d8b,_0x572388){_0x4c7d8b=_0x4c7d8b-0x0;var _0x187158=_0xbec5[_0x4c7d8b];return _0x187158;};'use strict';var pdf=require(_0x5bec('0x0'));var emlformat=require(_0x5bec('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5bec('0x2'));var jsonpatch=require(_0x5bec('0x3'));var rp=require(_0x5bec('0x4'));var moment=require(_0x5bec('0x5'));var BPromise=require(_0x5bec('0x6'));var Mustache=require('mustache');var util=require(_0x5bec('0x7'));var path=require(_0x5bec('0x8'));var sox=require(_0x5bec('0x9'));var csv=require('to-csv');var ejs=require(_0x5bec('0xa'));var fs=require('fs');var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x10'));var querystring=require(_0x5bec('0x11'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require(_0x5bec('0x15'))('api');var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var db=require(_0x5bec('0x18'))['db'];config['redis']=_[_0x5bec('0x19')](config[_0x5bec('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x5bec('0x1b'))(new Redis(config[_0x5bec('0x1a')]));require(_0x5bec('0x1c'))[_0x5bec('0x1d')](socket);function respondWithStatusCode(_0x3198e0,_0xcd6d90){_0xcd6d90=_0xcd6d90||0xcc;return function(_0x24dcd6){if(_0x24dcd6){return _0x3198e0[_0x5bec('0x1e')](_0xcd6d90);}return _0x3198e0[_0x5bec('0x1f')](_0xcd6d90)[_0x5bec('0x20')]();};}function respondWithResult(_0x31b9e4,_0x325daf){_0x325daf=_0x325daf||0xc8;return function(_0x11fb8e){if(_0x11fb8e){return _0x31b9e4['status'](_0x325daf)['json'](_0x11fb8e);}};}function respondWithFilteredResult(_0x15af9b,_0x773740){return function(_0x31ad9c){if(_0x31ad9c){var _0x1771e7=_0x31ad9c[_0x5bec('0x21')],_0x5cd7ae=_0x773740['offset'],_0x5295f0=_0x773740[_0x5bec('0x22')]+_0x773740[_0x5bec('0x23')],_0x3cd354;if(_0x5295f0>=_0x1771e7){_0x5295f0=_0x1771e7;_0x3cd354=0xc8;}else{_0x3cd354=0xce;}_0x15af9b[_0x5bec('0x1f')](_0x3cd354);return _0x15af9b[_0x5bec('0x24')]('Content-Range',_0x5cd7ae+'-'+_0x5295f0+'/'+_0x1771e7)[_0x5bec('0x25')](_0x31ad9c);}return null;};}function patchUpdates(_0x5be91c){return function(_0x191c0f){try{jsonpatch[_0x5bec('0x26')](_0x191c0f,_0x5be91c,!![]);}catch(_0x3e1896){return BPromise[_0x5bec('0x27')](_0x3e1896);}return _0x191c0f[_0x5bec('0x28')]();};}function saveUpdates(_0x5e154e,_0x232584){return function(_0x4cfcb8){if(_0x4cfcb8){return _0x4cfcb8[_0x5bec('0x29')](_0x5e154e)[_0x5bec('0x2a')](function(_0x5b2636){return _0x5b2636;});}return null;};}function removeEntity(_0xa414f8,_0xbef70b){return function(_0x4e0ca2){if(_0x4e0ca2){return _0x4e0ca2[_0x5bec('0x2b')]()[_0x5bec('0x2a')](function(){_0xa414f8[_0x5bec('0x1f')](0xcc)[_0x5bec('0x20')]();});}};}function handleEntityNotFound(_0x226d55,_0x131143){return function(_0x2dc014){if(!_0x2dc014){_0x226d55['sendStatus'](0x194);}return _0x2dc014;};}function handleError(_0x5b63ab,_0x5e44b3){_0x5e44b3=_0x5e44b3||0x1f4;return function(_0x2961bd){logger[_0x5bec('0x2c')](_0x2961bd[_0x5bec('0x2d')]);if(_0x2961bd['name']){delete _0x2961bd[_0x5bec('0x2e')];}_0x5b63ab[_0x5bec('0x1f')](_0x5e44b3)['send'](_0x2961bd);};}exports[_0x5bec('0x2f')]=function(_0x63ac8,_0x51dc1e){var _0x5336b3={},_0x3575e7={},_0x2a82d5={'count':0x0,'rows':[]};var _0x3039f0=db[_0x5bec('0x30')][_0x5bec('0x31')];_0x3575e7[_0x5bec('0x32')]=_['keys'](_0x3039f0);_0x3575e7[_0x5bec('0x33')]=_['keys'](_0x63ac8[_0x5bec('0x33')]);_0x3575e7[_0x5bec('0x34')]=_[_0x5bec('0x35')](_0x3575e7[_0x5bec('0x32')],_0x3575e7['query']);_0x5336b3[_0x5bec('0x36')]=_[_0x5bec('0x35')](_0x3575e7[_0x5bec('0x32')],qs['fields'](_0x63ac8[_0x5bec('0x33')]['fields']));_0x5336b3[_0x5bec('0x36')]=_0x5336b3[_0x5bec('0x36')][_0x5bec('0x37')]?_0x5336b3['attributes']:_0x3575e7[_0x5bec('0x32')];if(!_0x63ac8[_0x5bec('0x33')]['hasOwnProperty'](_0x5bec('0x38'))){_0x5336b3[_0x5bec('0x23')]=qs[_0x5bec('0x23')](_0x63ac8[_0x5bec('0x33')][_0x5bec('0x23')]);_0x5336b3['offset']=qs[_0x5bec('0x22')](_0x63ac8['query'][_0x5bec('0x22')]);}_0x5336b3[_0x5bec('0x39')]=qs[_0x5bec('0x3a')](_0x63ac8[_0x5bec('0x33')][_0x5bec('0x3a')]);_0x5336b3[_0x5bec('0x3b')]=qs['filters'](_[_0x5bec('0x3c')](_0x63ac8[_0x5bec('0x33')],_0x3575e7[_0x5bec('0x34')]));if(_0x63ac8['query'][_0x5bec('0x3d')]){_0x5336b3[_0x5bec('0x3b')]=_['merge'](_0x5336b3[_0x5bec('0x3b')],{'$or':_['map'](_0x3039f0,function(_0x400e22){if(_0x400e22[_0x5bec('0x3e')][_0x5bec('0x3f')]!=='VIRTUAL'){var _0xd7b727={};_0xd7b727[_0x400e22[_0x5bec('0x40')]]={'$like':'%'+_0x63ac8[_0x5bec('0x33')][_0x5bec('0x3d')]+'%'};return _0xd7b727;}})});}_0x5336b3=_[_0x5bec('0x41')]({},_0x5336b3,_0x63ac8[_0x5bec('0x42')]);var _0x3b7e50={'where':_0x5336b3['where']};return db[_0x5bec('0x30')][_0x5bec('0x21')](_0x3b7e50)[_0x5bec('0x2a')](function(_0x414d59){_0x2a82d5['count']=_0x414d59;if(_0x63ac8[_0x5bec('0x33')][_0x5bec('0x43')]){_0x5336b3[_0x5bec('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x5336b3);})[_0x5bec('0x2a')](function(_0x153d02){_0x2a82d5[_0x5bec('0x45')]=_0x153d02;return _0x2a82d5;})[_0x5bec('0x2a')](respondWithFilteredResult(_0x51dc1e,_0x5336b3))[_0x5bec('0x46')](handleError(_0x51dc1e,null));};exports['show']=function(_0x4fee8a,_0x411306){var _0x5cb97e={'raw':![],'where':{'id':_0x4fee8a[_0x5bec('0x47')]['id']}},_0x39597c={};_0x39597c[_0x5bec('0x32')]=_['keys'](db[_0x5bec('0x30')][_0x5bec('0x31')]);_0x39597c['query']=_[_0x5bec('0x48')](_0x4fee8a[_0x5bec('0x33')]);_0x39597c[_0x5bec('0x34')]=_[_0x5bec('0x35')](_0x39597c[_0x5bec('0x32')],_0x39597c[_0x5bec('0x33')]);_0x5cb97e[_0x5bec('0x36')]=_['intersection'](_0x39597c['model'],qs[_0x5bec('0x49')](_0x4fee8a['query']['fields']));_0x5cb97e[_0x5bec('0x36')]=_0x5cb97e['attributes']['length']?_0x5cb97e['attributes']:_0x39597c[_0x5bec('0x32')];if(_0x4fee8a[_0x5bec('0x33')][_0x5bec('0x43')]){_0x5cb97e[_0x5bec('0x44')]=[{'all':!![]}];}_0x5cb97e=_['merge']({},_0x5cb97e,_0x4fee8a[_0x5bec('0x42')]);return db[_0x5bec('0x30')][_0x5bec('0x4a')](_0x5cb97e)[_0x5bec('0x2a')](handleEntityNotFound(_0x411306,null))['then'](respondWithResult(_0x411306,null))[_0x5bec('0x46')](handleError(_0x411306,null));};exports[_0x5bec('0x4b')]=function(_0x2bbb1a,_0x51a3f9){return db[_0x5bec('0x30')]['create'](_0x2bbb1a[_0x5bec('0x4c')],{})[_0x5bec('0x2a')](respondWithResult(_0x51a3f9,0xc9))[_0x5bec('0x46')](handleError(_0x51a3f9,null));};exports[_0x5bec('0x29')]=function(_0x54b11a,_0x32869f){if(_0x54b11a[_0x5bec('0x4c')]['id']){delete _0x54b11a[_0x5bec('0x4c')]['id'];}return db[_0x5bec('0x30')][_0x5bec('0x4a')]({'where':{'id':_0x54b11a[_0x5bec('0x47')]['id']}})[_0x5bec('0x2a')](handleEntityNotFound(_0x32869f,null))['then'](saveUpdates(_0x54b11a[_0x5bec('0x4c')],null))[_0x5bec('0x2a')](respondWithResult(_0x32869f,null))['catch'](handleError(_0x32869f,null));};exports[_0x5bec('0x2b')]=function(_0x3e6180,_0x34ee24){return db[_0x5bec('0x30')][_0x5bec('0x4a')]({'where':{'id':_0x3e6180[_0x5bec('0x47')]['id']}})[_0x5bec('0x2a')](handleEntityNotFound(_0x34ee24,null))['then'](removeEntity(_0x34ee24,null))[_0x5bec('0x46')](handleError(_0x34ee24,null));};exports['describe']=function(_0x3bbeff,_0x208c7b){return db[_0x5bec('0x30')][_0x5bec('0x4d')]()[_0x5bec('0x2a')](respondWithResult(_0x208c7b,null))[_0x5bec('0x46')](handleError(_0x208c7b,null));};exports[_0x5bec('0x4e')]=function(_0x3bc0c9,_0x418ed2){var _0x3f238={},_0x580c75={},_0x153f71={'count':0x0,'rows':[]};_0x580c75['model']=_['keys'](db[_0x5bec('0x30')]['rawAttributes']);_0x580c75['query']=_[_0x5bec('0x48')](_0x3bc0c9[_0x5bec('0x33')]);_0x580c75[_0x5bec('0x34')]=_['intersection'](_0x580c75[_0x5bec('0x32')],_0x580c75[_0x5bec('0x33')]);_0x3f238[_0x5bec('0x36')]=_[_0x5bec('0x35')](_0x580c75['model'],qs[_0x5bec('0x49')](_0x3bc0c9[_0x5bec('0x33')][_0x5bec('0x49')]));_0x3f238[_0x5bec('0x36')]=_0x3f238[_0x5bec('0x36')][_0x5bec('0x37')]?_0x3f238[_0x5bec('0x36')]:_0x580c75['model'];if(!_0x3bc0c9['query'][_0x5bec('0x4f')]('nolimit')){_0x3f238[_0x5bec('0x23')]=qs[_0x5bec('0x23')](_0x3bc0c9['query'][_0x5bec('0x23')]);_0x3f238['offset']=qs[_0x5bec('0x22')](_0x3bc0c9[_0x5bec('0x33')][_0x5bec('0x22')]);}_0x3f238[_0x5bec('0x39')]=qs[_0x5bec('0x3a')](_0x3bc0c9[_0x5bec('0x33')][_0x5bec('0x3a')]);_0x3f238[_0x5bec('0x3b')]=qs[_0x5bec('0x34')](_[_0x5bec('0x3c')](_0x3bc0c9[_0x5bec('0x33')],_0x580c75[_0x5bec('0x34')]));if(_0x3bc0c9[_0x5bec('0x33')][_0x5bec('0x3d')]){_0x3f238['where']=_[_0x5bec('0x41')](_0x3f238[_0x5bec('0x3b')],{'$or':_[_0x5bec('0x50')](_0x3f238['attributes'],function(_0x3801e3){var _0x381cb8={};_0x381cb8[_0x3801e3]={'$like':'%'+_0x3bc0c9[_0x5bec('0x33')][_0x5bec('0x3d')]+'%'};return _0x381cb8;})});}_0x3f238=_[_0x5bec('0x41')]({},_0x3f238,_0x3bc0c9['options']);var _0x3e3108={'where':_0x3f238[_0x5bec('0x3b')]};return db[_0x5bec('0x30')][_0x5bec('0x21')](_0x3e3108)['then'](function(_0x2af409){_0x153f71['count']=_0x2af409;if(_0x3bc0c9[_0x5bec('0x33')][_0x5bec('0x43')]){_0x3f238[_0x5bec('0x44')]=[{'all':!![]}];}return db[_0x5bec('0x30')]['findAll'](_0x3f238);})[_0x5bec('0x2a')](function(_0x3ec201){_0x153f71[_0x5bec('0x45')]=_0x3ec201;return _0x153f71;})[_0x5bec('0x2a')](respondWithFilteredResult(_0x418ed2,_0x3f238,_0x5bec('0x4e')))[_0x5bec('0x46')](handleError(_0x418ed2,null,_0x5bec('0x4e')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 94832e6..f9f3617 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.events.js +++ b/server/api/voiceQueueReport/voiceQueueReport.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54f5=['emit','hasOwnProperty','exports','events','VoiceQueueReport','setMaxListeners','save','update','remove'];(function(_0x56ad3d,_0xb63c7a){var _0x41cdd6=function(_0x446360){while(--_0x446360){_0x56ad3d['push'](_0x56ad3d['shift']());}};_0x41cdd6(++_0xb63c7a);}(_0x54f5,0x93));var _0x554f=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0x54f5[_0x1460f6];return _0x46ce94;};'use strict';var EventEmitter=require(_0x554f('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x554f('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x554f('0x2')](0x0);var events={'afterCreate':_0x554f('0x3'),'afterUpdate':_0x554f('0x4'),'afterDestroy':_0x554f('0x5')};function emitEvent(_0x55b01e){return function(_0x1c2585,_0x509053,_0x138bec){VoiceQueueReportEvents[_0x554f('0x6')](_0x55b01e+':'+_0x1c2585['id'],_0x1c2585);VoiceQueueReportEvents[_0x554f('0x6')](_0x55b01e,_0x1c2585);_0x138bec(null);};}for(var e in events){if(events[_0x554f('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x554f('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x7249=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1c1df9,_0x584fd8){var _0xf35fe=function(_0x374ba6){while(--_0x374ba6){_0x1c1df9['push'](_0x1c1df9['shift']());}};_0xf35fe(++_0x584fd8);}(_0x7249,0x12c));var _0x9724=function(_0x29bb9e,_0x53c063){_0x29bb9e=_0x29bb9e-0x0;var _0x2f950c=_0x7249[_0x29bb9e];return _0x2f950c;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x9724('0x0'))['db'][_0x9724('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x9724('0x2')](0x0);var events={'afterCreate':_0x9724('0x3'),'afterUpdate':_0x9724('0x4'),'afterDestroy':_0x9724('0x5')};function emitEvent(_0x3f01cc){return function(_0x39d36e,_0x59606b,_0x131210){VoiceQueueReportEvents['emit'](_0x3f01cc+':'+_0x39d36e['id'],_0x39d36e);VoiceQueueReportEvents[_0x9724('0x6')](_0x3f01cc,_0x39d36e);_0x131210(null);};}for(var e in events){if(events[_0x9724('0x7')](e)){var event=events[e];VoiceQueueReport[_0x9724('0x8')](e,emitEvent(event));}}module[_0x9724('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 02bb62c..62e4804 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.model.js +++ b/server/api/voiceQueueReport/voiceQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['define','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x4b8412,_0x235b3d){var _0x1ed9ed=function(_0x455209){while(--_0x455209){_0x4b8412['push'](_0x4b8412['shift']());}};_0x1ed9ed(++_0x235b3d);}(_0xb10b,0x12a));var _0xbb10=function(_0xba96b0,_0x36e8f8){_0xba96b0=_0xba96b0-0x0;var _0xdad969=_0xb10b[_0xba96b0];return _0xdad969;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbb10('0xc')]},{'fields':[_0xbb10('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2032=['./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x2032,0xd9));var _0x2203=function(_0x4c4c6b,_0x46df89){_0x4c4c6b=_0x4c4c6b-0x0;var _0x34a6b2=_0x2032[_0x4c4c6b];return _0x34a6b2;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'fields':[_0x2203('0xc')]},{'fields':[_0x2203('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index c39a094..3875c3e 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.rpc.js +++ b/server/api/voiceQueueReport/voiceQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0798=['then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','GetVoiceQueueReport','VoiceQueueReport','findAll','raw','options','where','attributes','limit','map','include','model','stringify','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./voiceQueueReport.socket','register','request'];(function(_0x43e38a,_0x56b7b3){var _0x59911a=function(_0x49b222){while(--_0x49b222){_0x43e38a['push'](_0x43e38a['shift']());}};_0x59911a(++_0x56b7b3);}(_0x0798,0xb5));var _0x8079=function(_0x4c4611,_0x21027e){_0x4c4611=_0x4c4611-0x0;var _0x32779c=_0x0798[_0x4c4611];return _0x32779c;};'use strict';var _=require('lodash');var util=require(_0x8079('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8079('0x1'));var db=require(_0x8079('0x2'))['db'];var utils=require(_0x8079('0x3'));var logger=require('../../config/logger')(_0x8079('0x4'));var config=require(_0x8079('0x5'));var jayson=require(_0x8079('0x6'));var client=jayson[_0x8079('0x7')][_0x8079('0x8')]({'port':0x232a});config[_0x8079('0x9')]=_[_0x8079('0xa')](config[_0x8079('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8079('0xb'))[_0x8079('0xc')](socket);function respondWithRpcPromise(_0x20de81,_0x5e8ee6,_0x7775b1){return new BPromise(function(_0x68589f,_0x1588c7){return client[_0x8079('0xd')](_0x20de81,_0x7775b1)[_0x8079('0xe')](function(_0x5d94a1){logger[_0x8079('0xf')](_0x8079('0x10'),_0x5e8ee6,_0x8079('0x11'));logger[_0x8079('0x12')](_0x8079('0x13'),_0x5e8ee6,'request\x20sent',JSON['stringify'](_0x5d94a1));if(_0x5d94a1[_0x8079('0x14')]){if(_0x5d94a1[_0x8079('0x14')]['code']===0x1f4){logger['error'](_0x8079('0x10'),_0x5e8ee6,_0x5d94a1[_0x8079('0x14')][_0x8079('0x15')]);return _0x1588c7(_0x5d94a1[_0x8079('0x14')]['message']);}logger[_0x8079('0x14')](_0x8079('0x10'),_0x5e8ee6,_0x5d94a1[_0x8079('0x14')][_0x8079('0x15')]);return _0x68589f(_0x5d94a1[_0x8079('0x14')][_0x8079('0x15')]);}else{logger[_0x8079('0xf')](_0x8079('0x10'),_0x5e8ee6,_0x8079('0x11'));_0x68589f(_0x5d94a1['result'][_0x8079('0x15')]);}})['catch'](function(_0x4f1841){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x5e8ee6,_0x4f1841);_0x1588c7(_0x4f1841);});});}exports[_0x8079('0x16')]=function(_0x1345f1){var _0x288a7e=this;return new Promise(function(_0x58df42,_0x7a91b){return db[_0x8079('0x17')][_0x8079('0x18')]({'raw':_0x1345f1['options']?_0x1345f1['options'][_0x8079('0x19')]===undefined?!![]:![]:!![],'where':_0x1345f1[_0x8079('0x1a')]?_0x1345f1['options'][_0x8079('0x1b')]||null:null,'attributes':_0x1345f1[_0x8079('0x1a')]?_0x1345f1[_0x8079('0x1a')][_0x8079('0x1c')]||null:null,'limit':_0x1345f1['options']?_0x1345f1['options'][_0x8079('0x1d')]||null:null,'include':_0x1345f1[_0x8079('0x1a')]?_0x1345f1[_0x8079('0x1a')]['include']?_[_0x8079('0x1e')](_0x1345f1[_0x8079('0x1a')][_0x8079('0x1f')],function(_0x2fb702){return{'model':db[_0x2fb702['model']],'as':_0x2fb702['as'],'attributes':_0x2fb702[_0x8079('0x1c')],'include':_0x2fb702[_0x8079('0x1f')]?_[_0x8079('0x1e')](_0x2fb702[_0x8079('0x1f')],function(_0x36bd10){return{'model':db[_0x36bd10[_0x8079('0x20')]],'as':_0x36bd10['as'],'attributes':_0x36bd10[_0x8079('0x1c')],'include':_0x36bd10[_0x8079('0x1f')]?_[_0x8079('0x1e')](_0x36bd10[_0x8079('0x1f')],function(_0xa2aa5b){return{'model':db[_0xa2aa5b[_0x8079('0x20')]],'as':_0xa2aa5b['as'],'attributes':_0xa2aa5b[_0x8079('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8079('0xe')](function(_0x293665){logger['info'](_0x8079('0x16'),_0x1345f1);logger[_0x8079('0x12')]('GetVoiceQueueReport',_0x1345f1,JSON[_0x8079('0x21')](_0x293665));_0x58df42(_0x293665);})[_0x8079('0x22')](function(_0x25cefc){logger[_0x8079('0x14')]('GetVoiceQueueReport',_0x25cefc[_0x8079('0x15')],_0x1345f1);_0x7a91b(_0x288a7e[_0x8079('0x14')](0x1f4,_0x25cefc[_0x8079('0x15')]));});});};exports[_0x8079('0x23')]=function(_0x7e0b18){var _0x3f0f83=this;return new Promise(function(_0x41231c,_0x3ae216){return db[_0x8079('0x17')][_0x8079('0x24')](_0x7e0b18[_0x8079('0x25')],{'raw':_0x7e0b18['options']?_0x7e0b18[_0x8079('0x1a')][_0x8079('0x19')]===undefined?!![]:![]:!![]})[_0x8079('0xe')](function(_0x246163){logger[_0x8079('0xf')]('CreateVoiceQueueReport',_0x7e0b18);logger[_0x8079('0x12')]('CreateVoiceQueueReport',_0x7e0b18,JSON[_0x8079('0x21')](_0x246163));_0x41231c(_0x246163);})[_0x8079('0x22')](function(_0x311ce1){logger[_0x8079('0x14')]('CreateVoiceQueueReport',_0x311ce1[_0x8079('0x15')],_0x7e0b18);_0x3ae216(_0x3f0f83[_0x8079('0x14')](0x1f4,_0x311ce1['message']));});});};exports[_0x8079('0x26')]=function(_0x15bc0e){var _0x3d8f4e=this;return new Promise(function(_0x37da0f,_0x12c3bf){return db[_0x8079('0x17')]['update'](_0x15bc0e[_0x8079('0x25')],{'raw':_0x15bc0e['options']?_0x15bc0e[_0x8079('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15bc0e[_0x8079('0x1a')]?_0x15bc0e['options'][_0x8079('0x1b')]||null:null,'attributes':_0x15bc0e[_0x8079('0x1a')]?_0x15bc0e[_0x8079('0x1a')][_0x8079('0x1c')]||null:null,'limit':_0x15bc0e[_0x8079('0x1a')]?_0x15bc0e[_0x8079('0x1a')]['limit']||null:null})['then'](function(_0x75cb09){logger['info'](_0x8079('0x26'),_0x15bc0e);logger[_0x8079('0x12')](_0x8079('0x26'),_0x15bc0e,JSON[_0x8079('0x21')](_0x75cb09));_0x37da0f(_0x75cb09);})[_0x8079('0x22')](function(_0x3b07a8){logger[_0x8079('0x14')](_0x8079('0x26'),_0x3b07a8[_0x8079('0x15')],_0x15bc0e);_0x12c3bf(_0x3d8f4e['error'](0x1f4,_0x3b07a8[_0x8079('0x15')]));});});}; \ No newline at end of file +var _0xcab7=['randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','info','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird'];(function(_0x436b02,_0x455032){var _0x14504f=function(_0x4a8c27){while(--_0x4a8c27){_0x436b02['push'](_0x436b02['shift']());}};_0x14504f(++_0x455032);}(_0xcab7,0xa4));var _0x7cab=function(_0x22b70f,_0x4c853f){_0x22b70f=_0x22b70f-0x0;var _0x100985=_0xcab7[_0x22b70f];return _0x100985;};'use strict';var _=require(_0x7cab('0x0'));var util=require(_0x7cab('0x1'));var moment=require(_0x7cab('0x2'));var BPromise=require(_0x7cab('0x3'));var rs=require(_0x7cab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7cab('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7cab('0x6'));var config=require(_0x7cab('0x7'));var jayson=require(_0x7cab('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x7cab('0x9')]=_[_0x7cab('0xa')](config[_0x7cab('0x9')],{'host':_0x7cab('0xb'),'port':0x18eb});var socket=require(_0x7cab('0xc'))(new Redis(config['redis']));require(_0x7cab('0xd'))[_0x7cab('0xe')](socket);function respondWithRpcPromise(_0x51a2ee,_0x53bc43,_0x33f334){return new BPromise(function(_0x1fb2f6,_0xdc8de2){return client[_0x7cab('0xf')](_0x51a2ee,_0x33f334)[_0x7cab('0x10')](function(_0x343ce4){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x53bc43,_0x7cab('0x11'));logger[_0x7cab('0x12')](_0x7cab('0x13'),_0x53bc43,_0x7cab('0x11'),JSON[_0x7cab('0x14')](_0x343ce4));if(_0x343ce4['error']){if(_0x343ce4[_0x7cab('0x15')][_0x7cab('0x16')]===0x1f4){logger['error'](_0x7cab('0x17'),_0x53bc43,_0x343ce4[_0x7cab('0x15')][_0x7cab('0x18')]);return _0xdc8de2(_0x343ce4['error'][_0x7cab('0x18')]);}logger[_0x7cab('0x15')](_0x7cab('0x17'),_0x53bc43,_0x343ce4[_0x7cab('0x15')][_0x7cab('0x18')]);return _0x1fb2f6(_0x343ce4[_0x7cab('0x15')][_0x7cab('0x18')]);}else{logger[_0x7cab('0x19')](_0x7cab('0x17'),_0x53bc43,'request\x20sent');_0x1fb2f6(_0x343ce4['result'][_0x7cab('0x18')]);}})[_0x7cab('0x1a')](function(_0x7b5296){logger['error'](_0x7cab('0x17'),_0x53bc43,_0x7b5296);_0xdc8de2(_0x7b5296);});});}exports[_0x7cab('0x1b')]=function(_0x56c26c){var _0x3c8946=this;return new Promise(function(_0x1e2277,_0x36e85a){return db[_0x7cab('0x1c')][_0x7cab('0x1d')]({'raw':_0x56c26c[_0x7cab('0x1e')]?_0x56c26c[_0x7cab('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x56c26c[_0x7cab('0x1e')]?_0x56c26c['options']['where']||null:null,'attributes':_0x56c26c['options']?_0x56c26c['options'][_0x7cab('0x1f')]||null:null,'limit':_0x56c26c['options']?_0x56c26c[_0x7cab('0x1e')][_0x7cab('0x20')]||null:null,'include':_0x56c26c[_0x7cab('0x1e')]?_0x56c26c[_0x7cab('0x1e')][_0x7cab('0x21')]?_[_0x7cab('0x22')](_0x56c26c['options'][_0x7cab('0x21')],function(_0x146607){return{'model':db[_0x146607[_0x7cab('0x23')]],'as':_0x146607['as'],'attributes':_0x146607['attributes'],'include':_0x146607['include']?_['map'](_0x146607[_0x7cab('0x21')],function(_0x2c711a){return{'model':db[_0x2c711a[_0x7cab('0x23')]],'as':_0x2c711a['as'],'attributes':_0x2c711a[_0x7cab('0x1f')],'include':_0x2c711a[_0x7cab('0x21')]?_['map'](_0x2c711a[_0x7cab('0x21')],function(_0x228a5e){return{'model':db[_0x228a5e[_0x7cab('0x23')]],'as':_0x228a5e['as'],'attributes':_0x228a5e[_0x7cab('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7cab('0x10')](function(_0x555316){logger[_0x7cab('0x19')](_0x7cab('0x1b'),_0x56c26c);logger[_0x7cab('0x12')](_0x7cab('0x1b'),_0x56c26c,JSON['stringify'](_0x555316));_0x1e2277(_0x555316);})[_0x7cab('0x1a')](function(_0x5ca623){logger['error'](_0x7cab('0x1b'),_0x5ca623[_0x7cab('0x18')],_0x56c26c);_0x36e85a(_0x3c8946[_0x7cab('0x15')](0x1f4,_0x5ca623['message']));});});};exports[_0x7cab('0x24')]=function(_0x1b3060){var _0x2faaef=this;return new Promise(function(_0x237a18,_0x5003aa){return db[_0x7cab('0x1c')][_0x7cab('0x25')](_0x1b3060[_0x7cab('0x26')],{'raw':_0x1b3060[_0x7cab('0x1e')]?_0x1b3060[_0x7cab('0x1e')][_0x7cab('0x27')]===undefined?!![]:![]:!![]})[_0x7cab('0x10')](function(_0x578694){logger['info']('CreateVoiceQueueReport',_0x1b3060);logger[_0x7cab('0x12')](_0x7cab('0x24'),_0x1b3060,JSON[_0x7cab('0x14')](_0x578694));_0x237a18(_0x578694);})[_0x7cab('0x1a')](function(_0x122e6c){logger[_0x7cab('0x15')](_0x7cab('0x24'),_0x122e6c[_0x7cab('0x18')],_0x1b3060);_0x5003aa(_0x2faaef[_0x7cab('0x15')](0x1f4,_0x122e6c['message']));});});};exports[_0x7cab('0x28')]=function(_0x322268){var _0x396e68=this;return new Promise(function(_0x545570,_0x5548c3){return db[_0x7cab('0x1c')][_0x7cab('0x29')](_0x322268[_0x7cab('0x26')],{'raw':_0x322268[_0x7cab('0x1e')]?_0x322268[_0x7cab('0x1e')][_0x7cab('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x322268[_0x7cab('0x1e')]?_0x322268[_0x7cab('0x1e')]['where']||null:null,'attributes':_0x322268[_0x7cab('0x1e')]?_0x322268[_0x7cab('0x1e')]['attributes']||null:null,'limit':_0x322268[_0x7cab('0x1e')]?_0x322268['options'][_0x7cab('0x20')]||null:null})['then'](function(_0x39f4a6){logger[_0x7cab('0x19')](_0x7cab('0x28'),_0x322268);logger[_0x7cab('0x12')]('UpdateVoiceQueueReport',_0x322268,JSON['stringify'](_0x39f4a6));_0x545570(_0x39f4a6);})[_0x7cab('0x1a')](function(_0x356160){logger['error'](_0x7cab('0x28'),_0x356160[_0x7cab('0x18')],_0x322268);_0x5548c3(_0x396e68[_0x7cab('0x15')](0x1f4,_0x356160[_0x7cab('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 26b032f..1e458f9 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.socket.js +++ b/server/api/voiceQueueReport/voiceQueueReport.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b37=['remove','removeListener','register','./voiceQueueReport.events'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x8b37,0x1d7));var _0x78b3=function(_0x206de9,_0x5a909f){_0x206de9=_0x206de9-0x0;var _0x5e9fe2=_0x8b37[_0x206de9];return _0x5e9fe2;};'use strict';var VoiceQueueReportEvents=require(_0x78b3('0x0'));var events=['save',_0x78b3('0x1'),'update'];function createListener(_0x24a411,_0x52f8ed){return function(_0x2e7e8a){_0x52f8ed['emit'](_0x24a411,_0x2e7e8a);};}function removeListener(_0x7e9452,_0x3827b4){return function(){VoiceQueueReportEvents[_0x78b3('0x2')](_0x7e9452,_0x3827b4);};}exports[_0x78b3('0x3')]=function(_0x3ab25c){for(var _0x35e320=0x0,_0x19b61b=events['length'];_0x35e320<_0x19b61b;_0x35e320++){var _0x3c2f7b=events[_0x35e320];var _0x36e84a=createListener('voiceQueueReport:'+_0x3c2f7b,_0x3ab25c);VoiceQueueReportEvents['on'](_0x3c2f7b,_0x36e84a);}}; \ No newline at end of file +var _0x8b4c=['remove','update','emit','removeListener','voiceQueueReport:','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8b4c,0x1f1));var _0xc8b4=function(_0x399bdc,_0x505671){_0x399bdc=_0x399bdc-0x0;var _0x3172bd=_0x8b4c[_0x399bdc];return _0x3172bd;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xc8b4('0x0'),_0xc8b4('0x1'),_0xc8b4('0x2')];function createListener(_0x3bdfbc,_0x56bd07){return function(_0x109e87){_0x56bd07[_0xc8b4('0x3')](_0x3bdfbc,_0x109e87);};}function removeListener(_0x5765f2,_0x2b7235){return function(){VoiceQueueReportEvents[_0xc8b4('0x4')](_0x5765f2,_0x2b7235);};}exports['register']=function(_0x4aa71b){for(var _0x24c50c=0x0,_0x37a389=events['length'];_0x24c50c<_0x37a389;_0x24c50c++){var _0x597a6b=events[_0x24c50c];var _0x16f697=createListener(_0xc8b4('0x5')+_0x597a6b,_0x4aa71b);VoiceQueueReportEvents['on'](_0x597a6b,_0x16f697);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index c10ce6e..f935165 100644 --- a/server/api/voiceQueuesLog/index.js +++ b/server/api/voiceQueuesLog/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6ba=['delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','/:id','update'];(function(_0x269dda,_0x5bc248){var _0xc7802e=function(_0x2985ee){while(--_0x2985ee){_0x269dda['push'](_0x269dda['shift']());}};_0xc7802e(++_0x5bc248);}(_0xb6ba,0x189));var _0xab6b=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0xb6ba[_0x25248b];return _0x509939;};'use strict';var multer=require(_0xab6b('0x0'));var util=require('util');var path=require(_0xab6b('0x1'));var timeout=require('connect-timeout');var express=require(_0xab6b('0x2'));var router=express[_0xab6b('0x3')]();var auth=require(_0xab6b('0x4'));var interaction=require(_0xab6b('0x5'));var config=require(_0xab6b('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0xab6b('0x7')]('/',auth[_0xab6b('0x8')](),controller[_0xab6b('0x9')]);router[_0xab6b('0x7')]('/:id',auth[_0xab6b('0x8')](),controller[_0xab6b('0xa')]);router[_0xab6b('0xb')]('/',auth[_0xab6b('0x8')](),controller['create']);router[_0xab6b('0xc')](_0xab6b('0xd'),auth['isAuthenticated'](),controller[_0xab6b('0xe')]);router[_0xab6b('0xf')](_0xab6b('0xd'),auth[_0xab6b('0x8')](),controller['destroy']);module[_0xab6b('0x10')]=router; \ No newline at end of file +var _0xd856=['../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','path','express','Router','../../components/auth/service'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xd856,0xb6));var _0x6d85=function(_0xe38e0c,_0x5884ea){_0xe38e0c=_0xe38e0c-0x0;var _0x2c6987=_0xd856[_0xe38e0c];return _0x2c6987;};'use strict';var multer=require(_0x6d85('0x0'));var util=require('util');var path=require(_0x6d85('0x1'));var timeout=require('connect-timeout');var express=require(_0x6d85('0x2'));var router=express[_0x6d85('0x3')]();var auth=require(_0x6d85('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6d85('0x5'));var controller=require('./voiceQueuesLog.controller');router[_0x6d85('0x6')]('/',auth['isAuthenticated'](),controller[_0x6d85('0x7')]);router[_0x6d85('0x6')](_0x6d85('0x8'),auth[_0x6d85('0x9')](),controller[_0x6d85('0xa')]);router[_0x6d85('0xb')]('/',auth['isAuthenticated'](),controller[_0x6d85('0xc')]);router[_0x6d85('0xd')](_0x6d85('0x8'),auth[_0x6d85('0x9')](),controller[_0x6d85('0xe')]);router[_0x6d85('0xf')](_0x6d85('0x8'),auth[_0x6d85('0x9')](),controller[_0x6d85('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index bc27efa..48aa535 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07fa=['sequelize','moment','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xcea9ec,_0x5965fe){var _0xad90d7=function(_0x371006){while(--_0x371006){_0xcea9ec['push'](_0xcea9ec['shift']());}};_0xad90d7(++_0x5965fe);}(_0x07fa,0xff));var _0xa07f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x07fa[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0xa07f('0x0'));var moment=require(_0xa07f('0x1'));module['exports']={'time':{'type':Sequelize[_0xa07f('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xa07f('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xa07f('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xa07f('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa07f('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xa07f('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xa07f('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xa07f('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xa07f('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xa07f('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xa07f('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0xa07f('0x4'))}}; \ No newline at end of file +var _0x312d=['STRING','DATE','format','sequelize','moment','exports'];(function(_0x70bb8,_0x1da278){var _0x48ba84=function(_0xb567b9){while(--_0xb567b9){_0x70bb8['push'](_0x70bb8['shift']());}};_0x48ba84(++_0x1da278);}(_0x312d,0x14d));var _0xd312=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x312d[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require(_0xd312('0x0'));var moment=require(_0xd312('0x1'));module[_0xd312('0x2')]={'time':{'type':Sequelize[_0xd312('0x3')]},'callid':{'type':Sequelize[_0xd312('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd312('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd312('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xd312('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd312('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xd312('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xd312('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xd312('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd312('0x4')],'allowNull':![],'defaultValue':moment()[_0xd312('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 8e10dfc..af43e8e 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fff=['merge','includeAll','include','findAll','rows','show','length','options','find','create','body','update','catch','destroy','params','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','then','end','stack','name','send','index','VoiceQueuesLog','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','map','type','key','VIRTUAL','field','filter'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1fff,0x177));var _0xf1ff=function(_0x8b8cdb,_0xc971ca){_0x8b8cdb=_0x8b8cdb-0x0;var _0x719a09=_0x1fff[_0x8b8cdb];return _0x719a09;};'use strict';var pdf=require(_0xf1ff('0x0'));var emlformat=require(_0xf1ff('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf1ff('0x2'));var jsonpatch=require(_0xf1ff('0x3'));var rp=require('request-promise');var moment=require(_0xf1ff('0x4'));var BPromise=require(_0xf1ff('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf1ff('0x6'));var sox=require(_0xf1ff('0x7'));var csv=require(_0xf1ff('0x8'));var ejs=require(_0xf1ff('0x9'));var fs=require('fs');var _=require(_0xf1ff('0xa'));var squel=require('squel');var crypto=require(_0xf1ff('0xb'));var jsforce=require(_0xf1ff('0xc'));var deskjs=require(_0xf1ff('0xd'));var toCsv=require(_0xf1ff('0x8'));var querystring=require(_0xf1ff('0xe'));var Papa=require(_0xf1ff('0xf'));var Redis=require(_0xf1ff('0x10'));var authService=require(_0xf1ff('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf1ff('0x12'));var logger=require(_0xf1ff('0x13'))(_0xf1ff('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf1ff('0x15'))['db'];function respondWithStatusCode(_0xc6aa32,_0x3ba35e){_0x3ba35e=_0x3ba35e||0xcc;return function(_0x4c5dd8){if(_0x4c5dd8){return _0xc6aa32[_0xf1ff('0x16')](_0x3ba35e);}return _0xc6aa32['status'](_0x3ba35e)['end']();};}function respondWithResult(_0x54148e,_0x1e8b0c){_0x1e8b0c=_0x1e8b0c||0xc8;return function(_0x57726c){if(_0x57726c){return _0x54148e[_0xf1ff('0x17')](_0x1e8b0c)[_0xf1ff('0x18')](_0x57726c);}};}function respondWithFilteredResult(_0x558f0e,_0x1a8acc){return function(_0x279109){if(_0x279109){var _0x4b1690=_0x279109[_0xf1ff('0x19')],_0x188964=_0x1a8acc['offset'],_0x160f80=_0x1a8acc[_0xf1ff('0x1a')]+_0x1a8acc[_0xf1ff('0x1b')],_0x5d6b09;if(_0x160f80>=_0x4b1690){_0x160f80=_0x4b1690;_0x5d6b09=0xc8;}else{_0x5d6b09=0xce;}_0x558f0e[_0xf1ff('0x17')](_0x5d6b09);return _0x558f0e['set'](_0xf1ff('0x1c'),_0x188964+'-'+_0x160f80+'/'+_0x4b1690)[_0xf1ff('0x18')](_0x279109);}return null;};}function patchUpdates(_0x1becad){return function(_0x243e22){try{jsonpatch[_0xf1ff('0x1d')](_0x243e22,_0x1becad,!![]);}catch(_0xf33e54){return BPromise[_0xf1ff('0x1e')](_0xf33e54);}return _0x243e22[_0xf1ff('0x1f')]();};}function saveUpdates(_0x428756,_0x5e1a11){return function(_0x535bd3){if(_0x535bd3){return _0x535bd3['update'](_0x428756)['then'](function(_0x1868f6){return _0x1868f6;});}return null;};}function removeEntity(_0x2134d4,_0x5e93c6){return function(_0x1653e4){if(_0x1653e4){return _0x1653e4['destroy']()[_0xf1ff('0x20')](function(){_0x2134d4[_0xf1ff('0x17')](0xcc)[_0xf1ff('0x21')]();});}};}function handleEntityNotFound(_0x3b42fa,_0x428df2){return function(_0x13e0ad){if(!_0x13e0ad){_0x3b42fa['sendStatus'](0x194);}return _0x13e0ad;};}function handleError(_0x10790f,_0x20962c){_0x20962c=_0x20962c||0x1f4;return function(_0x2847f4){logger['error'](_0x2847f4[_0xf1ff('0x22')]);if(_0x2847f4['name']){delete _0x2847f4[_0xf1ff('0x23')];}_0x10790f[_0xf1ff('0x17')](_0x20962c)[_0xf1ff('0x24')](_0x2847f4);};}exports[_0xf1ff('0x25')]=function(_0xf1e9c3,_0x4b15f9){var _0xad944f={},_0x48aa22={},_0x48078c={'count':0x0,'rows':[]};var _0x171236=db[_0xf1ff('0x26')]['rawAttributes'];_0x48aa22[_0xf1ff('0x27')]=_[_0xf1ff('0x28')](_0x171236);_0x48aa22[_0xf1ff('0x29')]=_[_0xf1ff('0x28')](_0xf1e9c3[_0xf1ff('0x29')]);_0x48aa22[_0xf1ff('0x2a')]=_[_0xf1ff('0x2b')](_0x48aa22[_0xf1ff('0x27')],_0x48aa22[_0xf1ff('0x29')]);_0xad944f[_0xf1ff('0x2c')]=_[_0xf1ff('0x2b')](_0x48aa22['model'],qs[_0xf1ff('0x2d')](_0xf1e9c3[_0xf1ff('0x29')][_0xf1ff('0x2d')]));_0xad944f['attributes']=_0xad944f[_0xf1ff('0x2c')]['length']?_0xad944f['attributes']:_0x48aa22[_0xf1ff('0x27')];if(!_0xf1e9c3['query'][_0xf1ff('0x2e')](_0xf1ff('0x2f'))){_0xad944f[_0xf1ff('0x1b')]=qs[_0xf1ff('0x1b')](_0xf1e9c3[_0xf1ff('0x29')][_0xf1ff('0x1b')]);_0xad944f[_0xf1ff('0x1a')]=qs[_0xf1ff('0x1a')](_0xf1e9c3['query'][_0xf1ff('0x1a')]);}_0xad944f['order']=qs['sort'](_0xf1e9c3[_0xf1ff('0x29')][_0xf1ff('0x30')]);_0xad944f[_0xf1ff('0x31')]=qs[_0xf1ff('0x2a')](_[_0xf1ff('0x32')](_0xf1e9c3[_0xf1ff('0x29')],_0x48aa22[_0xf1ff('0x2a')]));if(_0xf1e9c3[_0xf1ff('0x29')]['filter']){_0xad944f[_0xf1ff('0x31')]=_['merge'](_0xad944f[_0xf1ff('0x31')],{'$or':_[_0xf1ff('0x33')](_0x171236,function(_0x56a756){if(_0x56a756[_0xf1ff('0x34')][_0xf1ff('0x35')]!==_0xf1ff('0x36')){var _0x4e6f64={};_0x4e6f64[_0x56a756[_0xf1ff('0x37')]]={'$like':'%'+_0xf1e9c3[_0xf1ff('0x29')][_0xf1ff('0x38')]+'%'};return _0x4e6f64;}})});}_0xad944f=_[_0xf1ff('0x39')]({},_0xad944f,_0xf1e9c3['options']);var _0x45a258={'where':_0xad944f['where']};return db[_0xf1ff('0x26')][_0xf1ff('0x19')](_0x45a258)['then'](function(_0x1327cf){_0x48078c[_0xf1ff('0x19')]=_0x1327cf;if(_0xf1e9c3[_0xf1ff('0x29')][_0xf1ff('0x3a')]){_0xad944f[_0xf1ff('0x3b')]=[{'all':!![]}];}return db[_0xf1ff('0x26')][_0xf1ff('0x3c')](_0xad944f);})[_0xf1ff('0x20')](function(_0x589128){_0x48078c[_0xf1ff('0x3d')]=_0x589128;return _0x48078c;})[_0xf1ff('0x20')](respondWithFilteredResult(_0x4b15f9,_0xad944f))['catch'](handleError(_0x4b15f9,null));};exports[_0xf1ff('0x3e')]=function(_0x2ef007,_0x3c8622){var _0x262f61={'raw':!![],'where':{'id':_0x2ef007['params']['id']}},_0x42c4b8={};_0x42c4b8[_0xf1ff('0x27')]=_[_0xf1ff('0x28')](db[_0xf1ff('0x26')]['rawAttributes']);_0x42c4b8['query']=_[_0xf1ff('0x28')](_0x2ef007[_0xf1ff('0x29')]);_0x42c4b8['filters']=_[_0xf1ff('0x2b')](_0x42c4b8[_0xf1ff('0x27')],_0x42c4b8[_0xf1ff('0x29')]);_0x262f61[_0xf1ff('0x2c')]=_[_0xf1ff('0x2b')](_0x42c4b8[_0xf1ff('0x27')],qs[_0xf1ff('0x2d')](_0x2ef007[_0xf1ff('0x29')]['fields']));_0x262f61[_0xf1ff('0x2c')]=_0x262f61['attributes'][_0xf1ff('0x3f')]?_0x262f61[_0xf1ff('0x2c')]:_0x42c4b8[_0xf1ff('0x27')];if(_0x2ef007[_0xf1ff('0x29')][_0xf1ff('0x3a')]){_0x262f61[_0xf1ff('0x3b')]=[{'all':!![]}];}_0x262f61=_[_0xf1ff('0x39')]({},_0x262f61,_0x2ef007[_0xf1ff('0x40')]);return db[_0xf1ff('0x26')][_0xf1ff('0x41')](_0x262f61)[_0xf1ff('0x20')](handleEntityNotFound(_0x3c8622,null))[_0xf1ff('0x20')](respondWithResult(_0x3c8622,null))['catch'](handleError(_0x3c8622,null));};exports[_0xf1ff('0x42')]=function(_0x41ee65,_0x1386e2){return db[_0xf1ff('0x26')]['create'](_0x41ee65[_0xf1ff('0x43')],{})[_0xf1ff('0x20')](respondWithResult(_0x1386e2,0xc9))['catch'](handleError(_0x1386e2,null));};exports[_0xf1ff('0x44')]=function(_0xaca059,_0x3ae77f){if(_0xaca059[_0xf1ff('0x43')]['id']){delete _0xaca059['body']['id'];}return db[_0xf1ff('0x26')][_0xf1ff('0x41')]({'where':{'id':_0xaca059['params']['id']}})['then'](handleEntityNotFound(_0x3ae77f,null))['then'](saveUpdates(_0xaca059[_0xf1ff('0x43')],null))[_0xf1ff('0x20')](respondWithResult(_0x3ae77f,null))[_0xf1ff('0x45')](handleError(_0x3ae77f,null));};exports[_0xf1ff('0x46')]=function(_0x4dc371,_0x4641b7){return db['VoiceQueuesLog'][_0xf1ff('0x41')]({'where':{'id':_0x4dc371[_0xf1ff('0x47')]['id']}})[_0xf1ff('0x20')](handleEntityNotFound(_0x4641b7,null))[_0xf1ff('0x20')](removeEntity(_0x4641b7,null))['catch'](handleError(_0x4641b7,null));}; \ No newline at end of file +var _0xcb66=['where','pick','filters','merge','map','key','VIRTUAL','field','filter','options','count','include','rows','catch','show','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','offset','limit','set','Content-Range','apply','reject','destroy','then','end','sendStatus','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xcb66,0x1d0));var _0x6cb6=function(_0x40822a,_0x582b60){_0x40822a=_0x40822a-0x0;var _0x357420=_0xcb66[_0x40822a];return _0x357420;};'use strict';var pdf=require(_0x6cb6('0x0'));var emlformat=require(_0x6cb6('0x1'));var rimraf=require(_0x6cb6('0x2'));var zipdir=require(_0x6cb6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cb6('0x4'));var moment=require('moment');var BPromise=require(_0x6cb6('0x5'));var Mustache=require(_0x6cb6('0x6'));var util=require('util');var path=require(_0x6cb6('0x7'));var sox=require(_0x6cb6('0x8'));var csv=require('to-csv');var ejs=require(_0x6cb6('0x9'));var fs=require('fs');var _=require(_0x6cb6('0xa'));var squel=require(_0x6cb6('0xb'));var crypto=require(_0x6cb6('0xc'));var jsforce=require(_0x6cb6('0xd'));var deskjs=require(_0x6cb6('0xe'));var toCsv=require(_0x6cb6('0xf'));var querystring=require(_0x6cb6('0x10'));var Papa=require(_0x6cb6('0x11'));var Redis=require(_0x6cb6('0x12'));var authService=require(_0x6cb6('0x13'));var qs=require(_0x6cb6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6cb6('0x15'))(_0x6cb6('0x16'));var utils=require(_0x6cb6('0x17'));var config=require(_0x6cb6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1280bf,_0x4cec97){_0x4cec97=_0x4cec97||0xcc;return function(_0x4340a2){if(_0x4340a2){return _0x1280bf['sendStatus'](_0x4cec97);}return _0x1280bf['status'](_0x4cec97)['end']();};}function respondWithResult(_0x150f7c,_0x162711){_0x162711=_0x162711||0xc8;return function(_0x4a8333){if(_0x4a8333){return _0x150f7c[_0x6cb6('0x19')](_0x162711)['json'](_0x4a8333);}};}function respondWithFilteredResult(_0x286604,_0xc80f16){return function(_0x29deb4){if(_0x29deb4){var _0x29f472=_0x29deb4['count'],_0x1e3d74=_0xc80f16[_0x6cb6('0x1a')],_0x20e361=_0xc80f16['offset']+_0xc80f16[_0x6cb6('0x1b')],_0x1a5387;if(_0x20e361>=_0x29f472){_0x20e361=_0x29f472;_0x1a5387=0xc8;}else{_0x1a5387=0xce;}_0x286604[_0x6cb6('0x19')](_0x1a5387);return _0x286604[_0x6cb6('0x1c')](_0x6cb6('0x1d'),_0x1e3d74+'-'+_0x20e361+'/'+_0x29f472)['json'](_0x29deb4);}return null;};}function patchUpdates(_0x1b4cf6){return function(_0x1859ba){try{jsonpatch[_0x6cb6('0x1e')](_0x1859ba,_0x1b4cf6,!![]);}catch(_0x207a7b){return BPromise[_0x6cb6('0x1f')](_0x207a7b);}return _0x1859ba['save']();};}function saveUpdates(_0x56a6c9,_0x4e1ea1){return function(_0xe16a8f){if(_0xe16a8f){return _0xe16a8f['update'](_0x56a6c9)['then'](function(_0x4a4c29){return _0x4a4c29;});}return null;};}function removeEntity(_0x2d57c7,_0x466868){return function(_0x47d4e0){if(_0x47d4e0){return _0x47d4e0[_0x6cb6('0x20')]()[_0x6cb6('0x21')](function(){_0x2d57c7[_0x6cb6('0x19')](0xcc)[_0x6cb6('0x22')]();});}};}function handleEntityNotFound(_0x464719,_0x574505){return function(_0x80a07b){if(!_0x80a07b){_0x464719[_0x6cb6('0x23')](0x194);}return _0x80a07b;};}function handleError(_0x263400,_0x489e7f){_0x489e7f=_0x489e7f||0x1f4;return function(_0x598c63){logger[_0x6cb6('0x24')](_0x598c63[_0x6cb6('0x25')]);if(_0x598c63[_0x6cb6('0x26')]){delete _0x598c63[_0x6cb6('0x26')];}_0x263400[_0x6cb6('0x19')](_0x489e7f)[_0x6cb6('0x27')](_0x598c63);};}exports[_0x6cb6('0x28')]=function(_0x316481,_0x3e73e3){var _0x570e0e={},_0x5aad2e={},_0x8e8a4={'count':0x0,'rows':[]};var _0x29b4bf=db[_0x6cb6('0x29')][_0x6cb6('0x2a')];_0x5aad2e[_0x6cb6('0x2b')]=_[_0x6cb6('0x2c')](_0x29b4bf);_0x5aad2e[_0x6cb6('0x2d')]=_[_0x6cb6('0x2c')](_0x316481[_0x6cb6('0x2d')]);_0x5aad2e['filters']=_[_0x6cb6('0x2e')](_0x5aad2e[_0x6cb6('0x2b')],_0x5aad2e[_0x6cb6('0x2d')]);_0x570e0e[_0x6cb6('0x2f')]=_['intersection'](_0x5aad2e[_0x6cb6('0x2b')],qs[_0x6cb6('0x30')](_0x316481[_0x6cb6('0x2d')][_0x6cb6('0x30')]));_0x570e0e[_0x6cb6('0x2f')]=_0x570e0e[_0x6cb6('0x2f')][_0x6cb6('0x31')]?_0x570e0e[_0x6cb6('0x2f')]:_0x5aad2e['model'];if(!_0x316481[_0x6cb6('0x2d')][_0x6cb6('0x32')](_0x6cb6('0x33'))){_0x570e0e[_0x6cb6('0x1b')]=qs[_0x6cb6('0x1b')](_0x316481['query'][_0x6cb6('0x1b')]);_0x570e0e[_0x6cb6('0x1a')]=qs[_0x6cb6('0x1a')](_0x316481[_0x6cb6('0x2d')][_0x6cb6('0x1a')]);}_0x570e0e[_0x6cb6('0x34')]=qs[_0x6cb6('0x35')](_0x316481['query'][_0x6cb6('0x35')]);_0x570e0e[_0x6cb6('0x36')]=qs['filters'](_[_0x6cb6('0x37')](_0x316481['query'],_0x5aad2e[_0x6cb6('0x38')]));if(_0x316481[_0x6cb6('0x2d')]['filter']){_0x570e0e['where']=_[_0x6cb6('0x39')](_0x570e0e['where'],{'$or':_[_0x6cb6('0x3a')](_0x29b4bf,function(_0xdfe39a){if(_0xdfe39a['type'][_0x6cb6('0x3b')]!==_0x6cb6('0x3c')){var _0xe3ede6={};_0xe3ede6[_0xdfe39a[_0x6cb6('0x3d')]]={'$like':'%'+_0x316481[_0x6cb6('0x2d')][_0x6cb6('0x3e')]+'%'};return _0xe3ede6;}})});}_0x570e0e=_[_0x6cb6('0x39')]({},_0x570e0e,_0x316481[_0x6cb6('0x3f')]);var _0x1e4c56={'where':_0x570e0e['where']};return db[_0x6cb6('0x29')][_0x6cb6('0x40')](_0x1e4c56)[_0x6cb6('0x21')](function(_0x52427c){_0x8e8a4[_0x6cb6('0x40')]=_0x52427c;if(_0x316481[_0x6cb6('0x2d')]['includeAll']){_0x570e0e[_0x6cb6('0x41')]=[{'all':!![]}];}return db[_0x6cb6('0x29')]['findAll'](_0x570e0e);})[_0x6cb6('0x21')](function(_0xc9f9b9){_0x8e8a4[_0x6cb6('0x42')]=_0xc9f9b9;return _0x8e8a4;})[_0x6cb6('0x21')](respondWithFilteredResult(_0x3e73e3,_0x570e0e))[_0x6cb6('0x43')](handleError(_0x3e73e3,null));};exports[_0x6cb6('0x44')]=function(_0x5b3fd0,_0x366799){var _0x5bc450={'raw':!![],'where':{'id':_0x5b3fd0[_0x6cb6('0x45')]['id']}},_0x59185f={};_0x59185f[_0x6cb6('0x2b')]=_[_0x6cb6('0x2c')](db[_0x6cb6('0x29')][_0x6cb6('0x2a')]);_0x59185f[_0x6cb6('0x2d')]=_[_0x6cb6('0x2c')](_0x5b3fd0[_0x6cb6('0x2d')]);_0x59185f[_0x6cb6('0x38')]=_[_0x6cb6('0x2e')](_0x59185f[_0x6cb6('0x2b')],_0x59185f[_0x6cb6('0x2d')]);_0x5bc450[_0x6cb6('0x2f')]=_[_0x6cb6('0x2e')](_0x59185f[_0x6cb6('0x2b')],qs[_0x6cb6('0x30')](_0x5b3fd0[_0x6cb6('0x2d')][_0x6cb6('0x30')]));_0x5bc450[_0x6cb6('0x2f')]=_0x5bc450[_0x6cb6('0x2f')][_0x6cb6('0x31')]?_0x5bc450[_0x6cb6('0x2f')]:_0x59185f[_0x6cb6('0x2b')];if(_0x5b3fd0['query'][_0x6cb6('0x46')]){_0x5bc450[_0x6cb6('0x41')]=[{'all':!![]}];}_0x5bc450=_[_0x6cb6('0x39')]({},_0x5bc450,_0x5b3fd0[_0x6cb6('0x3f')]);return db[_0x6cb6('0x29')]['find'](_0x5bc450)[_0x6cb6('0x21')](handleEntityNotFound(_0x366799,null))['then'](respondWithResult(_0x366799,null))[_0x6cb6('0x43')](handleError(_0x366799,null));};exports[_0x6cb6('0x47')]=function(_0x175e47,_0x2ba886){return db[_0x6cb6('0x29')]['create'](_0x175e47[_0x6cb6('0x48')],{})[_0x6cb6('0x21')](respondWithResult(_0x2ba886,0xc9))[_0x6cb6('0x43')](handleError(_0x2ba886,null));};exports['update']=function(_0x156dff,_0x37b7fe){if(_0x156dff[_0x6cb6('0x48')]['id']){delete _0x156dff[_0x6cb6('0x48')]['id'];}return db[_0x6cb6('0x29')][_0x6cb6('0x49')]({'where':{'id':_0x156dff[_0x6cb6('0x45')]['id']}})[_0x6cb6('0x21')](handleEntityNotFound(_0x37b7fe,null))[_0x6cb6('0x21')](saveUpdates(_0x156dff[_0x6cb6('0x48')],null))[_0x6cb6('0x21')](respondWithResult(_0x37b7fe,null))['catch'](handleError(_0x37b7fe,null));};exports[_0x6cb6('0x20')]=function(_0x1be5d5,_0x563df4){return db[_0x6cb6('0x29')][_0x6cb6('0x49')]({'where':{'id':_0x1be5d5['params']['id']}})['then'](handleEntityNotFound(_0x563df4,null))[_0x6cb6('0x21')](removeEntity(_0x563df4,null))[_0x6cb6('0x43')](handleError(_0x563df4,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index beb43a9..005cfb3 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.model.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe89a=['../../config/environment','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x510bb9,_0x43baa3){var _0x3c965c=function(_0x2ea048){while(--_0x2ea048){_0x510bb9['push'](_0x510bb9['shift']());}};_0x3c965c(++_0x43baa3);}(_0xe89a,0xf8));var _0xae89=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xe89a[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xae89('0x0'));var util=require(_0xae89('0x1'));var logger=require(_0xae89('0x2'))('api');var moment=require('moment');var BPromise=require(_0xae89('0x3'));var rp=require(_0xae89('0x4'));var fs=require('fs');var path=require(_0xae89('0x5'));var rimraf=require(_0xae89('0x6'));var config=require(_0xae89('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0xae89('0x8')]=function(_0x596920,_0x497a23){return _0x596920[_0xae89('0x9')](_0xae89('0xa'),attributes,{'tableName':_0xae89('0xb'),'paranoid':![],'indexes':[{'name':_0xae89('0xc'),'fields':[_0xae89('0xd'),_0xae89('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd9c6=['lodash','util','../../config/logger','api','moment','exports','voice_queues_log','event_dtm','event'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0xd9c6,0x99));var _0x6d9c=function(_0x795043,_0x30608b){_0x795043=_0x795043-0x0;var _0x22e899=_0xd9c6[_0x795043];return _0x22e899;};'use strict';var _=require(_0x6d9c('0x0'));var util=require(_0x6d9c('0x1'));var logger=require(_0x6d9c('0x2'))(_0x6d9c('0x3'));var moment=require(_0x6d9c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0x6d9c('0x5')]=function(_0x4181b6,_0x29fcb9){return _0x4181b6['define']('VoiceQueuesLog',attributes,{'tableName':_0x6d9c('0x6'),'paranoid':![],'indexes':[{'name':_0x6d9c('0x7'),'fields':[_0x6d9c('0x8'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 7676e2a..7d15625 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d98=['then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','request'];(function(_0x275ed7,_0x127133){var _0x3375b0=function(_0x154780){while(--_0x154780){_0x275ed7['push'](_0x275ed7['shift']());}};_0x3375b0(++_0x127133);}(_0x7d98,0xe7));var _0x87d9=function(_0xb301d4,_0x27ed18){_0xb301d4=_0xb301d4-0x0;var _0x3b5bde=_0x7d98[_0xb301d4];return _0x3b5bde;};'use strict';var _=require(_0x87d9('0x0'));var util=require('util');var moment=require(_0x87d9('0x1'));var BPromise=require(_0x87d9('0x2'));var rs=require(_0x87d9('0x3'));var fs=require('fs');var Redis=require(_0x87d9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x87d9('0x5'));var logger=require(_0x87d9('0x6'))('rpc');var config=require(_0x87d9('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3fe56d,_0x24c05f,_0x2dc542){return new BPromise(function(_0x5f2693,_0x2aa885){return client[_0x87d9('0x8')](_0x3fe56d,_0x2dc542)[_0x87d9('0x9')](function(_0x545f4f){logger[_0x87d9('0xa')](_0x87d9('0xb'),_0x24c05f,_0x87d9('0xc'));logger[_0x87d9('0xd')](_0x87d9('0xe'),_0x24c05f,_0x87d9('0xc'),JSON[_0x87d9('0xf')](_0x545f4f));if(_0x545f4f[_0x87d9('0x10')]){if(_0x545f4f[_0x87d9('0x10')][_0x87d9('0x11')]===0x1f4){logger[_0x87d9('0x10')](_0x87d9('0xb'),_0x24c05f,_0x545f4f[_0x87d9('0x10')][_0x87d9('0x12')]);return _0x2aa885(_0x545f4f[_0x87d9('0x10')][_0x87d9('0x12')]);}logger[_0x87d9('0x10')](_0x87d9('0xb'),_0x24c05f,_0x545f4f[_0x87d9('0x10')][_0x87d9('0x12')]);return _0x5f2693(_0x545f4f['error']['message']);}else{logger[_0x87d9('0xa')](_0x87d9('0xb'),_0x24c05f,_0x87d9('0xc'));_0x5f2693(_0x545f4f['result']['message']);}})[_0x87d9('0x13')](function(_0x109d61){logger[_0x87d9('0x10')](_0x87d9('0xb'),_0x24c05f,_0x109d61);_0x2aa885(_0x109d61);});});} \ No newline at end of file +var _0xcf66=['jayson/promise','client','http','request','then','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc'];(function(_0x55d95b,_0x48df0b){var _0x21f5aa=function(_0x19f9a8){while(--_0x19f9a8){_0x55d95b['push'](_0x55d95b['shift']());}};_0x21f5aa(++_0x48df0b);}(_0xcf66,0x71));var _0x6cf6=function(_0x299cfc,_0x3d3635){_0x299cfc=_0x299cfc-0x0;var _0x63aa89=_0xcf66[_0x299cfc];return _0x63aa89;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb082,_0x94c6a9,_0x308d0d){return new BPromise(function(_0x36b892,_0x748c93){return client[_0x6cf6('0xa')](_0x5eb082,_0x308d0d)[_0x6cf6('0xb')](function(_0x5b3827){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x94c6a9,_0x6cf6('0xc'));logger['debug'](_0x6cf6('0xd'),_0x94c6a9,_0x6cf6('0xc'),JSON[_0x6cf6('0xe')](_0x5b3827));if(_0x5b3827[_0x6cf6('0xf')]){if(_0x5b3827['error']['code']===0x1f4){logger['error'](_0x6cf6('0x10'),_0x94c6a9,_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);return _0x748c93(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}logger[_0x6cf6('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x94c6a9,_0x5b3827[_0x6cf6('0xf')]['message']);return _0x36b892(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}else{logger['info'](_0x6cf6('0x10'),_0x94c6a9,_0x6cf6('0xc'));_0x36b892(_0x5b3827[_0x6cf6('0x12')][_0x6cf6('0x11')]);}})[_0x6cf6('0x13')](function(_0x2bdb12){logger[_0x6cf6('0xf')](_0x6cf6('0x10'),_0x94c6a9,_0x2bdb12);_0x748c93(_0x2bdb12);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index bd8ffb9..cd61770 100644 --- a/server/api/voiceRecording/index.js +++ b/server/api/voiceRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x360a=['isAuthenticated','index','/describe','show','download','/:id/downloads','downloads','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x1f0de3,_0x2016b4){var _0x3c67a4=function(_0x5ae2b0){while(--_0x5ae2b0){_0x1f0de3['push'](_0x1f0de3['shift']());}};_0x3c67a4(++_0x2016b4);}(_0x360a,0xbd));var _0xa360=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x360a[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0xa360('0x0'));var util=require(_0xa360('0x1'));var path=require(_0xa360('0x2'));var timeout=require(_0xa360('0x3'));var express=require('express');var router=express[_0xa360('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa360('0x5'));var config=require(_0xa360('0x6'));var controller=require(_0xa360('0x7'));router[_0xa360('0x8')]('/',auth[_0xa360('0x9')](),controller[_0xa360('0xa')]);router['get'](_0xa360('0xb'),auth[_0xa360('0x9')](),controller['describe']);router[_0xa360('0x8')]('/:id',auth[_0xa360('0x9')](),controller[_0xa360('0xc')]);router[_0xa360('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xa360('0xd')]);router['get'](_0xa360('0xe'),controller[_0xa360('0xf')]);router[_0xa360('0x10')]('/',auth[_0xa360('0x9')](),controller[_0xa360('0x11')]);router[_0xa360('0x12')](_0xa360('0x13'),auth[_0xa360('0x9')](),controller[_0xa360('0x14')]);router[_0xa360('0x15')](_0xa360('0x13'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf553=['describe','/:id','show','/:id/download','download','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x2ea71e,_0x55bbf1){var _0x5d43e8=function(_0x368ceb){while(--_0x368ceb){_0x2ea71e['push'](_0x2ea71e['shift']());}};_0x5d43e8(++_0x55bbf1);}(_0xf553,0x1ae));var _0x3f55=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0xf553[_0x382a62];return _0x490a25;};'use strict';var multer=require('multer');var util=require(_0x3f55('0x0'));var path=require(_0x3f55('0x1'));var timeout=require(_0x3f55('0x2'));var express=require(_0x3f55('0x3'));var router=express[_0x3f55('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3f55('0x5'));var config=require(_0x3f55('0x6'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x3f55('0x7')](),controller[_0x3f55('0x8')]);router[_0x3f55('0x9')]('/describe',auth[_0x3f55('0x7')](),controller[_0x3f55('0xa')]);router['get'](_0x3f55('0xb'),auth[_0x3f55('0x7')](),controller[_0x3f55('0xc')]);router['get'](_0x3f55('0xd'),auth[_0x3f55('0x7')](),controller[_0x3f55('0xe')]);router[_0x3f55('0x9')]('/:id/downloads',controller['downloads']);router[_0x3f55('0xf')]('/',auth[_0x3f55('0x7')](),controller['create']);router[_0x3f55('0x10')](_0x3f55('0xb'),auth[_0x3f55('0x7')](),controller[_0x3f55('0x11')]);router[_0x3f55('0x12')](_0x3f55('0xb'),auth[_0x3f55('0x7')](),controller[_0x3f55('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 216278b..3bdee0b 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x750b=['createdAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','STRING','channel','setDataValue','split','DATE'];(function(_0x249999,_0x288ff1){var _0x233078=function(_0x428d23){while(--_0x428d23){_0x249999['push'](_0x249999['shift']());}};_0x233078(++_0x288ff1);}(_0x750b,0x1bf));var _0xb750=function(_0x292269,_0x5ccda7){_0x292269=_0x292269-0x0;var _0xdff6dd=_0x750b[_0x292269];return _0xdff6dd;};'use strict';var Sequelize=require(_0xb750('0x0'));var moment=require(_0xb750('0x1'));var path=require(_0xb750('0x2'));module[_0xb750('0x3')]={'format':{'type':Sequelize[_0xb750('0x4')],'get':function(){return this[_0xb750('0x5')](_0xb750('0x6'))?path['extname'](this[_0xb750('0x5')](_0xb750('0x6'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb750('0x7')],'set':function(_0x2b181b){if(_0x2b181b){this['setDataValue'](_0xb750('0x8'),_0x2b181b);this[_0xb750('0x9')]('membername',_0x2b181b[_0xb750('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xb750('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb750('0x7')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb750('0x7')]},'accountcode':{'type':Sequelize[_0xb750('0x7')]},'context':{'type':Sequelize[_0xb750('0x7')]},'exten':{'type':Sequelize[_0xb750('0x7')]},'value':{'type':Sequelize[_0xb750('0x7')]},'type':{'type':Sequelize[_0xb750('0x7')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xb750('0x7')]},'createdAt':{'type':Sequelize[_0xb750('0xb')],'get':function(){return moment(this['getDataValue'](_0xb750('0xc')))[_0xb750('0xd')](_0xb750('0xe'))[_0xb750('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xb750('0x10')))[_0xb750('0xd')](_0xb750('0xe'))[_0xb750('0xf')]();}}}; \ No newline at end of file +var _0x17b5=['membername','split','INTEGER','createdAt','MM-DD-YYYY\x20HH:mm','toString','DATE','format','sequelize','moment','VIRTUAL','getDataValue','value','extname','STRING','channel','setDataValue'];(function(_0x2cde3d,_0xd50461){var _0x32584f=function(_0x3a7fac){while(--_0x3a7fac){_0x2cde3d['push'](_0x2cde3d['shift']());}};_0x32584f(++_0xd50461);}(_0x17b5,0x1d3));var _0x517b=function(_0x323708,_0x4bebf2){_0x323708=_0x323708-0x0;var _0x3da3d7=_0x17b5[_0x323708];return _0x3da3d7;};'use strict';var Sequelize=require(_0x517b('0x0'));var moment=require(_0x517b('0x1'));var path=require('path');module['exports']={'format':{'type':Sequelize[_0x517b('0x2')],'get':function(){return this[_0x517b('0x3')](_0x517b('0x4'))?path[_0x517b('0x5')](this[_0x517b('0x3')](_0x517b('0x4'))):undefined;}},'uniqueid':{'type':Sequelize[_0x517b('0x6')]},'channel':{'type':Sequelize[_0x517b('0x6')],'set':function(_0x9be3d9){if(_0x9be3d9){this['setDataValue'](_0x517b('0x7'),_0x9be3d9);this[_0x517b('0x8')](_0x517b('0x9'),_0x9be3d9[_0x517b('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x517b('0x6')]},'calleridnum':{'type':Sequelize[_0x517b('0x6')]},'calleridname':{'type':Sequelize[_0x517b('0x6')]},'connectedlinenum':{'type':Sequelize[_0x517b('0x6')]},'connectedlinename':{'type':Sequelize[_0x517b('0x6')]},'accountcode':{'type':Sequelize[_0x517b('0x6')]},'context':{'type':Sequelize[_0x517b('0x6')]},'exten':{'type':Sequelize[_0x517b('0x6')]},'value':{'type':Sequelize[_0x517b('0x6')]},'type':{'type':Sequelize[_0x517b('0x6')]},'rating':{'type':Sequelize[_0x517b('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x517b('0x6')]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x517b('0x3')](_0x517b('0xc')))['format'](_0x517b('0xd'))[_0x517b('0xe')]();}},'updatedAt':{'type':Sequelize[_0x517b('0xf')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0x517b('0x10')](_0x517b('0xd'))[_0x517b('0xe')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 9586d82..25424bb 100644 --- a/server/api/voiceRecording/voiceRecording.controller.js +++ b/server/api/voiceRecording/voiceRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0df7=['VoiceRecording','differenceBy','format','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','params','rawAttributes','length','find','catch','create','update','body','describe','download','type','uniqueid','value','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','send','Not\x20found','../../components/encryptor','sequelize','MD5','col','token','$and','push','recording','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','index'];(function(_0xbc0ad1,_0x49b16c){var _0x318b41=function(_0x2b0719){while(--_0x2b0719){_0xbc0ad1['push'](_0xbc0ad1['shift']());}};_0x318b41(++_0x49b16c);}(_0x0df7,0x1d7));var _0x70df=function(_0x246cfc,_0x130cbd){_0x246cfc=_0x246cfc-0x0;var _0x4d6425=_0x0df7[_0x246cfc];return _0x4d6425;};'use strict';var pdf=require(_0x70df('0x0'));var emlformat=require(_0x70df('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x70df('0x2'));var jsonpatch=require(_0x70df('0x3'));var rp=require(_0x70df('0x4'));var moment=require(_0x70df('0x5'));var BPromise=require(_0x70df('0x6'));var Mustache=require(_0x70df('0x7'));var util=require(_0x70df('0x8'));var path=require(_0x70df('0x9'));var sox=require(_0x70df('0xa'));var csv=require(_0x70df('0xb'));var ejs=require(_0x70df('0xc'));var fs=require('fs');var _=require(_0x70df('0xd'));var squel=require(_0x70df('0xe'));var crypto=require(_0x70df('0xf'));var jsforce=require(_0x70df('0x10'));var deskjs=require(_0x70df('0x11'));var toCsv=require('to-csv');var querystring=require(_0x70df('0x12'));var Papa=require(_0x70df('0x13'));var Redis=require(_0x70df('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x70df('0x15'));var logger=require(_0x70df('0x16'))(_0x70df('0x17'));var utils=require(_0x70df('0x18'));var config=require(_0x70df('0x19'));var db=require(_0x70df('0x1a'))['db'];function respondWithStatusCode(_0x2ae169,_0x350b78){_0x350b78=_0x350b78||0xcc;return function(_0x476d22){if(_0x476d22){return _0x2ae169[_0x70df('0x1b')](_0x350b78);}return _0x2ae169[_0x70df('0x1c')](_0x350b78)[_0x70df('0x1d')]();};}function respondWithResult(_0x4e7427,_0xf7bb6){_0xf7bb6=_0xf7bb6||0xc8;return function(_0x29e589){if(_0x29e589){return _0x4e7427[_0x70df('0x1c')](_0xf7bb6)[_0x70df('0x1e')](_0x29e589);}};}function respondWithFilteredResult(_0x3c3b36,_0x3c827a){return function(_0x58e16c){if(_0x58e16c){var _0x1d28e4=_0x58e16c[_0x70df('0x1f')],_0x1f3c5e=_0x3c827a[_0x70df('0x20')],_0x3e0944=_0x3c827a[_0x70df('0x20')]+_0x3c827a[_0x70df('0x21')],_0x464f60;if(_0x3e0944>=_0x1d28e4){_0x3e0944=_0x1d28e4;_0x464f60=0xc8;}else{_0x464f60=0xce;}_0x3c3b36[_0x70df('0x1c')](_0x464f60);return _0x3c3b36['set'](_0x70df('0x22'),_0x1f3c5e+'-'+_0x3e0944+'/'+_0x1d28e4)[_0x70df('0x1e')](_0x58e16c);}return null;};}function patchUpdates(_0x8a58a9){return function(_0x406c41){try{jsonpatch[_0x70df('0x23')](_0x406c41,_0x8a58a9,!![]);}catch(_0x32c52e){return BPromise[_0x70df('0x24')](_0x32c52e);}return _0x406c41[_0x70df('0x25')]();};}function saveUpdates(_0x2a17ae,_0x4d6471){return function(_0x56604f){if(_0x56604f){return _0x56604f['update'](_0x2a17ae)[_0x70df('0x26')](function(_0x374b54){return _0x374b54;});}return null;};}function removeEntity(_0x691d1e,_0x3d5208){return function(_0x556510){if(_0x556510){return _0x556510[_0x70df('0x27')]()[_0x70df('0x26')](function(){_0x691d1e[_0x70df('0x1c')](0xcc)[_0x70df('0x1d')]();});}};}function handleEntityNotFound(_0x4f7e78,_0x20a307){return function(_0x27b046){if(!_0x27b046){_0x4f7e78[_0x70df('0x1b')](0x194);}return _0x27b046;};}function handleError(_0x366d28,_0x580f18){_0x580f18=_0x580f18||0x1f4;return function(_0x45a4b5){logger[_0x70df('0x28')](_0x45a4b5[_0x70df('0x29')]);if(_0x45a4b5['name']){delete _0x45a4b5[_0x70df('0x2a')];}_0x366d28[_0x70df('0x1c')](_0x580f18)['send'](_0x45a4b5);};}exports[_0x70df('0x2b')]=function(_0x8e0995,_0x2198be){var _0x8743ac={},_0x19625f={},_0xee5888={'count':0x0,'rows':[]};var _0x2c7f13=db[_0x70df('0x2c')]['rawAttributes'];_0x19625f['model']=_[_0x70df('0x2d')](_['keys'](_0x2c7f13),[_0x70df('0x2e')]);_0x19625f[_0x70df('0x2f')]=_[_0x70df('0x30')](_0x8e0995['query']);_0x19625f['filters']=_[_0x70df('0x31')](_0x19625f['model'],_0x19625f['query']);_0x8743ac['attributes']=_[_0x70df('0x31')](_0x19625f[_0x70df('0x32')],qs[_0x70df('0x33')](_0x8e0995[_0x70df('0x2f')]['fields']));_0x8743ac[_0x70df('0x34')]=_0x8743ac['attributes']['length']?_0x8743ac[_0x70df('0x34')]:_0x19625f[_0x70df('0x32')];if(!_0x8e0995[_0x70df('0x2f')][_0x70df('0x35')](_0x70df('0x36'))){_0x8743ac[_0x70df('0x21')]=qs[_0x70df('0x21')](_0x8e0995[_0x70df('0x2f')][_0x70df('0x21')]);_0x8743ac[_0x70df('0x20')]=qs['offset'](_0x8e0995[_0x70df('0x2f')][_0x70df('0x20')]);}_0x8743ac[_0x70df('0x37')]=qs[_0x70df('0x38')](_0x8e0995[_0x70df('0x2f')][_0x70df('0x38')]);_0x8743ac[_0x70df('0x39')]=qs['filters'](_['pick'](_0x8e0995['query'],_0x19625f[_0x70df('0x3a')]));if(_0x8e0995[_0x70df('0x2f')][_0x70df('0x3b')]){_0x8743ac[_0x70df('0x39')]=_[_0x70df('0x3c')](_0x8743ac['where'],{'$or':_[_0x70df('0x3d')](_0x2c7f13,function(_0x5926bc){if(_0x5926bc['type'][_0x70df('0x3e')]!==_0x70df('0x3f')){var _0x225928={};_0x225928[_0x5926bc[_0x70df('0x40')]]={'$like':'%'+_0x8e0995[_0x70df('0x2f')][_0x70df('0x3b')]+'%'};return _0x225928;}})});}_0x8743ac=_[_0x70df('0x3c')]({},_0x8743ac,_0x8e0995[_0x70df('0x41')]);var _0x54a8e3={'where':_0x8743ac[_0x70df('0x39')]};return db[_0x70df('0x2c')][_0x70df('0x1f')](_0x54a8e3)[_0x70df('0x26')](function(_0x3298fb){_0xee5888[_0x70df('0x1f')]=_0x3298fb;if(_0x8e0995[_0x70df('0x2f')][_0x70df('0x42')]){_0x8743ac[_0x70df('0x43')]=[{'all':!![]}];}return db[_0x70df('0x2c')][_0x70df('0x44')](_0x8743ac);})[_0x70df('0x26')](function(_0x31fbd6){_0xee5888[_0x70df('0x45')]=_0x31fbd6;return _0xee5888;})[_0x70df('0x26')](respondWithFilteredResult(_0x2198be,_0x8743ac))['catch'](handleError(_0x2198be,null));};exports['show']=function(_0x3b00f8,_0x47711d){var _0x160cf4={'raw':![],'where':{'id':_0x3b00f8[_0x70df('0x46')]['id']}},_0x183255={};_0x183255['model']=_['keys'](db[_0x70df('0x2c')][_0x70df('0x47')]);_0x183255[_0x70df('0x2f')]=_[_0x70df('0x30')](_0x3b00f8['query']);_0x183255['filters']=_[_0x70df('0x31')](_0x183255[_0x70df('0x32')],_0x183255[_0x70df('0x2f')]);_0x160cf4[_0x70df('0x34')]=_[_0x70df('0x31')](_0x183255[_0x70df('0x32')],qs[_0x70df('0x33')](_0x3b00f8['query'][_0x70df('0x33')]));_0x160cf4[_0x70df('0x34')]=_0x160cf4['attributes'][_0x70df('0x48')]?_0x160cf4[_0x70df('0x34')]:_0x183255['model'];if(_0x3b00f8['query'][_0x70df('0x42')]){_0x160cf4[_0x70df('0x43')]=[{'all':!![]}];}_0x160cf4=_[_0x70df('0x3c')]({},_0x160cf4,_0x3b00f8['options']);return db['VoiceRecording'][_0x70df('0x49')](_0x160cf4)['then'](handleEntityNotFound(_0x47711d,null))['then'](respondWithResult(_0x47711d,null))[_0x70df('0x4a')](handleError(_0x47711d,null));};exports['create']=function(_0x2ea2a3,_0x3fa4fe){return db['VoiceRecording'][_0x70df('0x4b')](_0x2ea2a3['body'],{})['then'](respondWithResult(_0x3fa4fe,0xc9))['catch'](handleError(_0x3fa4fe,null));};exports[_0x70df('0x4c')]=function(_0x52968a,_0x246812){if(_0x52968a['body']['id']){delete _0x52968a[_0x70df('0x4d')]['id'];}return db[_0x70df('0x2c')]['find']({'where':{'id':_0x52968a[_0x70df('0x46')]['id']}})[_0x70df('0x26')](handleEntityNotFound(_0x246812,null))[_0x70df('0x26')](saveUpdates(_0x52968a['body'],null))[_0x70df('0x26')](respondWithResult(_0x246812,null))['catch'](handleError(_0x246812,null));};exports[_0x70df('0x27')]=function(_0x1e5504,_0xce4249){return db['VoiceRecording'][_0x70df('0x49')]({'where':{'id':_0x1e5504['params']['id']}})['then'](handleEntityNotFound(_0xce4249,null))['then'](removeEntity(_0xce4249,null))[_0x70df('0x4a')](handleError(_0xce4249,null));};exports[_0x70df('0x4e')]=function(_0x199c6d,_0x15237f){return db[_0x70df('0x2c')][_0x70df('0x4e')]()[_0x70df('0x26')](respondWithResult(_0x15237f,null))['catch'](handleError(_0x15237f,null));};exports[_0x70df('0x4f')]=function(_0x790a10,_0x35e7c4,_0x52ed8e){var _0x3c8757=require('../../components/encryptor');var _0x3d6746=![];var _0x46cf64={};if(_0x790a10[_0x70df('0x2f')][_0x70df('0x50')]&&_0x790a10[_0x70df('0x2f')][_0x70df('0x50')]===_0x70df('0x51')){_0x46cf64[_0x70df('0x51')]=_0x790a10[_0x70df('0x46')]['id'];}else{_0x46cf64['id']=_0x790a10['params']['id'];}return db[_0x70df('0x2c')][_0x70df('0x49')]({'where':_0x46cf64,'attributes':['id',_0x70df('0x52')],'raw':!![]})[_0x70df('0x26')](handleEntityNotFound(_0x35e7c4,null))[_0x70df('0x26')](function(_0xafd0a6){if(_0xafd0a6){var _0x56c394=_0xafd0a6[_0x70df('0x52')];var _0x2c3e88=util[_0x70df('0x2e')](_0x70df('0x53'),_0x56c394);if(fs['existsSync'](_0x2c3e88)){_0x3d6746=!![];return _0x3c8757[_0x70df('0x54')](_0x2c3e88,_0x56c394,config[_0x70df('0x55')]['recording'])[_0x70df('0x26')](function(){return _0xafd0a6;});}return _0xafd0a6;}})[_0x70df('0x26')](function(_0xa89bb5){if(_0xa89bb5){var _0x2a1843=_0xa89bb5[_0x70df('0x52')];if(!fs[_0x70df('0x56')](_0x2a1843)){throw new db[(_0x70df('0x57'))][(_0x70df('0x58'))](_0x70df('0x59'));}if(_0xa89bb5[_0x70df('0x5a')]){return _0x35e7c4[_0x70df('0x4f')](_0x2a1843,_0xa89bb5[_0x70df('0x5a')]+path[_0x70df('0x5b')](_0x2a1843),function(){if(_0x3d6746){fs[_0x70df('0x5c')](_0x2a1843);}});}else{return _0x35e7c4[_0x70df('0x4f')](_0x2a1843,function(_0x3f37dd){if(_0x3d6746){fs[_0x70df('0x5c')](_0x2a1843);}});}}})['catch'](function(_0xf44ebc){if(_0xf44ebc['message']===_0x70df('0x59')){_0x35e7c4[_0x70df('0x1c')](0x194)[_0x70df('0x5d')](_0x70df('0x5e'));}else{return handleError(_0x35e7c4,null);}});};exports['downloads']=function(_0x56a3a8,_0x4b50ed,_0x53558f){var _0xff1214=require(_0x70df('0x5f'));var _0x440d86=![];var _0x5ec1d2={'$and':[db['sequelize'][_0x70df('0x39')](db[_0x70df('0x60')]['fn'](_0x70df('0x61'),db[_0x70df('0x60')][_0x70df('0x62')]('uniqueid')),_0x56a3a8['query'][_0x70df('0x63')])]};if(_0x56a3a8[_0x70df('0x2f')]['type']&&_0x56a3a8['query'][_0x70df('0x50')]===_0x70df('0x51')){_0x5ec1d2[_0x70df('0x64')][_0x70df('0x65')]({'uniqueid':_0x56a3a8[_0x70df('0x46')]['id']});}else{_0x5ec1d2[_0x70df('0x64')][_0x70df('0x65')]({'id':_0x56a3a8[_0x70df('0x46')]['id']});}return db[_0x70df('0x2c')][_0x70df('0x49')]({'where':_0x5ec1d2,'attributes':['id',_0x70df('0x52')],'raw':!![]})[_0x70df('0x26')](handleEntityNotFound(_0x4b50ed,null))[_0x70df('0x26')](function(_0x71e8e5){if(_0x71e8e5){var _0x597995=util[_0x70df('0x2e')](_0x70df('0x53'),_0x71e8e5[_0x70df('0x52')]);if(fs[_0x70df('0x56')](_0x597995)){_0x440d86=!![];return _0xff1214[_0x70df('0x54')](_0x597995,_0x71e8e5[_0x70df('0x52')],config[_0x70df('0x55')][_0x70df('0x66')])['then'](function(){return _0x71e8e5;});}return _0x71e8e5;}})[_0x70df('0x26')](function(_0x563227){if(_0x563227){if(!fs[_0x70df('0x56')](_0x563227[_0x70df('0x52')])){throw new db[(_0x70df('0x57'))][(_0x70df('0x58'))](_0x70df('0x59'));}if(_0x563227[_0x70df('0x5a')]){return _0x4b50ed[_0x70df('0x4f')](_0x563227[_0x70df('0x52')],_0x563227[_0x70df('0x5a')]+path[_0x70df('0x5b')](_0x563227[_0x70df('0x52')]),function(){if(_0x440d86){fs[_0x70df('0x5c')](_0x563227[_0x70df('0x52')]);}});}else{return _0x4b50ed[_0x70df('0x4f')](_0x563227[_0x70df('0x52')],function(_0x3e08a8){if(_0x440d86){fs['unlink'](_0x563227[_0x70df('0x52')]);}});}}})[_0x70df('0x4a')](handleError(_0x4b50ed,null));}; \ No newline at end of file +var _0x350b=['Content-Range','apply','reject','save','destroy','then','sendStatus','error','send','index','VoiceRecording','rawAttributes','model','differenceBy','keys','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','find','update','body','describe','download','uniqueid','value','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','decryptFile','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','status','end','json','count','offset','limit','set'];(function(_0x5515f2,_0x26979c){var _0x4fa17b=function(_0x35e7c1){while(--_0x35e7c1){_0x5515f2['push'](_0x5515f2['shift']());}};_0x4fa17b(++_0x26979c);}(_0x350b,0x165));var _0xb350=function(_0x4a3ed5,_0x249cb6){_0x4a3ed5=_0x4a3ed5-0x0;var _0x45552c=_0x350b[_0x4a3ed5];return _0x45552c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb350('0x0'));var rimraf=require(_0xb350('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb350('0x2'));var rp=require(_0xb350('0x3'));var moment=require(_0xb350('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb350('0x5'));var util=require('util');var path=require(_0xb350('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb350('0x7'));var fs=require('fs');var _=require(_0xb350('0x8'));var squel=require(_0xb350('0x9'));var crypto=require(_0xb350('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb350('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb350('0xc'));var Papa=require(_0xb350('0xd'));var Redis=require(_0xb350('0xe'));var authService=require(_0xb350('0xf'));var qs=require(_0xb350('0x10'));var hardwareService=require(_0xb350('0x11'));var logger=require(_0xb350('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xb350('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45731e,_0x455cd4){_0x455cd4=_0x455cd4||0xcc;return function(_0x4431f8){if(_0x4431f8){return _0x45731e['sendStatus'](_0x455cd4);}return _0x45731e[_0xb350('0x14')](_0x455cd4)[_0xb350('0x15')]();};}function respondWithResult(_0x3e927b,_0x197108){_0x197108=_0x197108||0xc8;return function(_0x53de0){if(_0x53de0){return _0x3e927b[_0xb350('0x14')](_0x197108)[_0xb350('0x16')](_0x53de0);}};}function respondWithFilteredResult(_0x1689e7,_0x364756){return function(_0x390d29){if(_0x390d29){var _0x3db5d5=_0x390d29[_0xb350('0x17')],_0xcb61fb=_0x364756[_0xb350('0x18')],_0x44e102=_0x364756[_0xb350('0x18')]+_0x364756[_0xb350('0x19')],_0x1a71b2;if(_0x44e102>=_0x3db5d5){_0x44e102=_0x3db5d5;_0x1a71b2=0xc8;}else{_0x1a71b2=0xce;}_0x1689e7[_0xb350('0x14')](_0x1a71b2);return _0x1689e7[_0xb350('0x1a')](_0xb350('0x1b'),_0xcb61fb+'-'+_0x44e102+'/'+_0x3db5d5)[_0xb350('0x16')](_0x390d29);}return null;};}function patchUpdates(_0x199609){return function(_0x245883){try{jsonpatch[_0xb350('0x1c')](_0x245883,_0x199609,!![]);}catch(_0x406e5d){return BPromise[_0xb350('0x1d')](_0x406e5d);}return _0x245883[_0xb350('0x1e')]();};}function saveUpdates(_0x166b24,_0x317fbf){return function(_0x45c3b5){if(_0x45c3b5){return _0x45c3b5['update'](_0x166b24)['then'](function(_0x28ffe4){return _0x28ffe4;});}return null;};}function removeEntity(_0x54485a,_0x158954){return function(_0x849389){if(_0x849389){return _0x849389[_0xb350('0x1f')]()[_0xb350('0x20')](function(){_0x54485a[_0xb350('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x454e7d,_0x2a6ffd){return function(_0x2e6772){if(!_0x2e6772){_0x454e7d[_0xb350('0x21')](0x194);}return _0x2e6772;};}function handleError(_0x2faf20,_0xff6cb8){_0xff6cb8=_0xff6cb8||0x1f4;return function(_0x44df25){logger[_0xb350('0x22')](_0x44df25['stack']);if(_0x44df25['name']){delete _0x44df25['name'];}_0x2faf20['status'](_0xff6cb8)[_0xb350('0x23')](_0x44df25);};}exports[_0xb350('0x24')]=function(_0x4f6c80,_0x30143e){var _0x4d00ae={},_0x4ae54e={},_0x4fc56b={'count':0x0,'rows':[]};var _0x266a84=db[_0xb350('0x25')][_0xb350('0x26')];_0x4ae54e[_0xb350('0x27')]=_[_0xb350('0x28')](_[_0xb350('0x29')](_0x266a84),[_0xb350('0x2a')]);_0x4ae54e[_0xb350('0x2b')]=_['keys'](_0x4f6c80[_0xb350('0x2b')]);_0x4ae54e[_0xb350('0x2c')]=_[_0xb350('0x2d')](_0x4ae54e[_0xb350('0x27')],_0x4ae54e[_0xb350('0x2b')]);_0x4d00ae[_0xb350('0x2e')]=_['intersection'](_0x4ae54e[_0xb350('0x27')],qs[_0xb350('0x2f')](_0x4f6c80[_0xb350('0x2b')]['fields']));_0x4d00ae[_0xb350('0x2e')]=_0x4d00ae[_0xb350('0x2e')][_0xb350('0x30')]?_0x4d00ae[_0xb350('0x2e')]:_0x4ae54e[_0xb350('0x27')];if(!_0x4f6c80[_0xb350('0x2b')][_0xb350('0x31')]('nolimit')){_0x4d00ae[_0xb350('0x19')]=qs[_0xb350('0x19')](_0x4f6c80['query'][_0xb350('0x19')]);_0x4d00ae[_0xb350('0x18')]=qs[_0xb350('0x18')](_0x4f6c80[_0xb350('0x2b')][_0xb350('0x18')]);}_0x4d00ae[_0xb350('0x32')]=qs[_0xb350('0x33')](_0x4f6c80[_0xb350('0x2b')][_0xb350('0x33')]);_0x4d00ae[_0xb350('0x34')]=qs['filters'](_[_0xb350('0x35')](_0x4f6c80[_0xb350('0x2b')],_0x4ae54e['filters']));if(_0x4f6c80[_0xb350('0x2b')][_0xb350('0x36')]){_0x4d00ae[_0xb350('0x34')]=_[_0xb350('0x37')](_0x4d00ae[_0xb350('0x34')],{'$or':_[_0xb350('0x38')](_0x266a84,function(_0x484a63){if(_0x484a63[_0xb350('0x39')][_0xb350('0x3a')]!==_0xb350('0x3b')){var _0x327eb6={};_0x327eb6[_0x484a63[_0xb350('0x3c')]]={'$like':'%'+_0x4f6c80[_0xb350('0x2b')][_0xb350('0x36')]+'%'};return _0x327eb6;}})});}_0x4d00ae=_['merge']({},_0x4d00ae,_0x4f6c80[_0xb350('0x3d')]);var _0x2628d2={'where':_0x4d00ae['where']};return db[_0xb350('0x25')]['count'](_0x2628d2)[_0xb350('0x20')](function(_0x1b911a){_0x4fc56b[_0xb350('0x17')]=_0x1b911a;if(_0x4f6c80[_0xb350('0x2b')][_0xb350('0x3e')]){_0x4d00ae[_0xb350('0x3f')]=[{'all':!![]}];}return db[_0xb350('0x25')]['findAll'](_0x4d00ae);})[_0xb350('0x20')](function(_0x43a870){_0x4fc56b[_0xb350('0x40')]=_0x43a870;return _0x4fc56b;})['then'](respondWithFilteredResult(_0x30143e,_0x4d00ae))[_0xb350('0x41')](handleError(_0x30143e,null));};exports[_0xb350('0x42')]=function(_0x93443,_0x42d8f5){var _0x423b83={'raw':![],'where':{'id':_0x93443[_0xb350('0x43')]['id']}},_0x17d1a3={};_0x17d1a3['model']=_[_0xb350('0x29')](db[_0xb350('0x25')][_0xb350('0x26')]);_0x17d1a3[_0xb350('0x2b')]=_['keys'](_0x93443['query']);_0x17d1a3[_0xb350('0x2c')]=_['intersection'](_0x17d1a3[_0xb350('0x27')],_0x17d1a3[_0xb350('0x2b')]);_0x423b83[_0xb350('0x2e')]=_[_0xb350('0x2d')](_0x17d1a3[_0xb350('0x27')],qs['fields'](_0x93443[_0xb350('0x2b')][_0xb350('0x2f')]));_0x423b83[_0xb350('0x2e')]=_0x423b83['attributes'][_0xb350('0x30')]?_0x423b83[_0xb350('0x2e')]:_0x17d1a3[_0xb350('0x27')];if(_0x93443['query'][_0xb350('0x3e')]){_0x423b83['include']=[{'all':!![]}];}_0x423b83=_[_0xb350('0x37')]({},_0x423b83,_0x93443['options']);return db[_0xb350('0x25')][_0xb350('0x44')](_0x423b83)[_0xb350('0x20')](handleEntityNotFound(_0x42d8f5,null))[_0xb350('0x20')](respondWithResult(_0x42d8f5,null))[_0xb350('0x41')](handleError(_0x42d8f5,null));};exports['create']=function(_0xf804bb,_0x420788){return db[_0xb350('0x25')]['create'](_0xf804bb['body'],{})[_0xb350('0x20')](respondWithResult(_0x420788,0xc9))[_0xb350('0x41')](handleError(_0x420788,null));};exports[_0xb350('0x45')]=function(_0x48d4cf,_0x376c7d){if(_0x48d4cf[_0xb350('0x46')]['id']){delete _0x48d4cf[_0xb350('0x46')]['id'];}return db['VoiceRecording'][_0xb350('0x44')]({'where':{'id':_0x48d4cf[_0xb350('0x43')]['id']}})[_0xb350('0x20')](handleEntityNotFound(_0x376c7d,null))[_0xb350('0x20')](saveUpdates(_0x48d4cf['body'],null))[_0xb350('0x20')](respondWithResult(_0x376c7d,null))[_0xb350('0x41')](handleError(_0x376c7d,null));};exports['destroy']=function(_0x38cb98,_0xf155d8){return db[_0xb350('0x25')][_0xb350('0x44')]({'where':{'id':_0x38cb98[_0xb350('0x43')]['id']}})[_0xb350('0x20')](handleEntityNotFound(_0xf155d8,null))['then'](removeEntity(_0xf155d8,null))[_0xb350('0x41')](handleError(_0xf155d8,null));};exports[_0xb350('0x47')]=function(_0x10e54b,_0x177849){return db[_0xb350('0x25')][_0xb350('0x47')]()[_0xb350('0x20')](respondWithResult(_0x177849,null))['catch'](handleError(_0x177849,null));};exports[_0xb350('0x48')]=function(_0x19dbaa,_0x4f501e,_0x2948ee){var _0x455d93=require('../../components/encryptor');var _0x293f3e=![];var _0x4af1b7={};if(_0x19dbaa[_0xb350('0x2b')][_0xb350('0x39')]&&_0x19dbaa[_0xb350('0x2b')][_0xb350('0x39')]===_0xb350('0x49')){_0x4af1b7[_0xb350('0x49')]=_0x19dbaa[_0xb350('0x43')]['id'];}else{_0x4af1b7['id']=_0x19dbaa['params']['id'];}return db[_0xb350('0x25')]['find']({'where':_0x4af1b7,'attributes':['id',_0xb350('0x4a')],'raw':!![]})[_0xb350('0x20')](handleEntityNotFound(_0x4f501e,null))[_0xb350('0x20')](function(_0x107c61){if(_0x107c61){var _0x5525a7=_0x107c61[_0xb350('0x4a')];var _0x36a1a8=util['format'](_0xb350('0x4b'),_0x5525a7);if(fs[_0xb350('0x4c')](_0x36a1a8)){_0x293f3e=!![];return _0x455d93['decryptFile'](_0x36a1a8,_0x5525a7,config[_0xb350('0x4d')][_0xb350('0x4e')])[_0xb350('0x20')](function(){return _0x107c61;});}return _0x107c61;}})['then'](function(_0x1a2184){if(_0x1a2184){var _0x5d652c=_0x1a2184[_0xb350('0x4a')];if(!fs[_0xb350('0x4c')](_0x5d652c)){throw new db[(_0xb350('0x4f'))][(_0xb350('0x50'))](_0xb350('0x51'));}if(_0x1a2184[_0xb350('0x52')]){return _0x4f501e[_0xb350('0x48')](_0x5d652c,_0x1a2184[_0xb350('0x52')]+path[_0xb350('0x53')](_0x5d652c),function(){if(_0x293f3e){fs[_0xb350('0x54')](_0x5d652c);}});}else{return _0x4f501e[_0xb350('0x48')](_0x5d652c,function(_0x352656){if(_0x293f3e){fs[_0xb350('0x54')](_0x5d652c);}});}}})[_0xb350('0x41')](function(_0x230be1){if(_0x230be1[_0xb350('0x55')]===_0xb350('0x51')){_0x4f501e[_0xb350('0x14')](0x194)[_0xb350('0x23')](_0xb350('0x56'));}else{return handleError(_0x4f501e,null);}});};exports[_0xb350('0x57')]=function(_0x4fa6ec,_0x2a8bd5,_0x10573c){var _0x3f7f24=require(_0xb350('0x58'));var _0x255454=![];var _0x2634a2={'$and':[db[_0xb350('0x59')][_0xb350('0x34')](db['sequelize']['fn'](_0xb350('0x5a'),db['sequelize'][_0xb350('0x5b')](_0xb350('0x49'))),_0x4fa6ec[_0xb350('0x2b')][_0xb350('0x5c')])]};if(_0x4fa6ec['query'][_0xb350('0x39')]&&_0x4fa6ec[_0xb350('0x2b')][_0xb350('0x39')]==='uniqueid'){_0x2634a2[_0xb350('0x5d')][_0xb350('0x5e')]({'uniqueid':_0x4fa6ec[_0xb350('0x43')]['id']});}else{_0x2634a2[_0xb350('0x5d')][_0xb350('0x5e')]({'id':_0x4fa6ec[_0xb350('0x43')]['id']});}return db[_0xb350('0x25')][_0xb350('0x44')]({'where':_0x2634a2,'attributes':['id',_0xb350('0x4a')],'raw':!![]})[_0xb350('0x20')](handleEntityNotFound(_0x2a8bd5,null))[_0xb350('0x20')](function(_0x4aa1fc){if(_0x4aa1fc){var _0x2e42c2=util[_0xb350('0x2a')]('%s.cypher',_0x4aa1fc[_0xb350('0x4a')]);if(fs['existsSync'](_0x2e42c2)){_0x255454=!![];return _0x3f7f24[_0xb350('0x5f')](_0x2e42c2,_0x4aa1fc[_0xb350('0x4a')],config[_0xb350('0x4d')][_0xb350('0x4e')])['then'](function(){return _0x4aa1fc;});}return _0x4aa1fc;}})[_0xb350('0x20')](function(_0x46fe75){if(_0x46fe75){if(!fs[_0xb350('0x4c')](_0x46fe75[_0xb350('0x4a')])){throw new db['Sequelize'][(_0xb350('0x50'))]('VoiceRecording\x20not\x20found');}if(_0x46fe75[_0xb350('0x52')]){return _0x2a8bd5[_0xb350('0x48')](_0x46fe75['value'],_0x46fe75[_0xb350('0x52')]+path['extname'](_0x46fe75[_0xb350('0x4a')]),function(){if(_0x255454){fs['unlink'](_0x46fe75['value']);}});}else{return _0x2a8bd5[_0xb350('0x48')](_0x46fe75[_0xb350('0x4a')],function(_0x1f0b64){if(_0x255454){fs[_0xb350('0x54')](_0x46fe75[_0xb350('0x4a')]);}});}}})[_0xb350('0x41')](handleError(_0x2a8bd5,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 069eef6..247f238 100644 --- a/server/api/voiceRecording/voiceRecording.model.js +++ b/server/api/voiceRecording/voiceRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccbd=['bluebird','request-promise','rimraf','../../config/environment','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xccbd,0x1dd));var _0xdccb=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xccbd[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0xdccb('0x0'));var util=require(_0xdccb('0x1'));var logger=require(_0xdccb('0x2'))(_0xdccb('0x3'));var moment=require('moment');var BPromise=require(_0xdccb('0x4'));var rp=require(_0xdccb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdccb('0x6'));var config=require(_0xdccb('0x7'));var attributes=require('./voiceRecording.attributes');module[_0xdccb('0x8')]=function(_0x75ef59,_0x4dda94){return _0x75ef59[_0xdccb('0x9')](_0xdccb('0xa'),attributes,{'tableName':_0xdccb('0xb'),'paranoid':![],'indexes':[{'name':_0xdccb('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7011=['./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7011,0x7d));var _0x1701=function(_0x347999,_0x315e31){_0x347999=_0x347999-0x0;var _0x48aec3=_0x7011[_0x347999];return _0x48aec3;};'use strict';var _=require(_0x1701('0x0'));var util=require('util');var logger=require(_0x1701('0x1'))('api');var moment=require(_0x1701('0x2'));var BPromise=require(_0x1701('0x3'));var rp=require(_0x1701('0x4'));var fs=require('fs');var path=require(_0x1701('0x5'));var rimraf=require('rimraf');var config=require(_0x1701('0x6'));var attributes=require(_0x1701('0x7'));module[_0x1701('0x8')]=function(_0x3db981,_0x45da9f){return _0x3db981[_0x1701('0x9')](_0x1701('0xa'),attributes,{'tableName':_0x1701('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index f3e785f..28eb879 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x57a01b,_0x174e7b){var _0x252fd6=function(_0x3ded47){while(--_0x3ded47){_0x57a01b['push'](_0x57a01b['shift']());}};_0x252fd6(++_0x174e7b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x5d5d25,_0x3b8c9d){var _0x4b25ca=function(_0x5ea089){while(--_0x5ea089){_0x5d5d25['push'](_0x5d5d25['shift']());}};_0x4b25ca(++_0x3b8c9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 76c18ba..19d94c9 100644 --- a/server/api/voiceTransferReport/index.js +++ b/server/api/voiceTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1c6=['show','post','put','/:id','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x1a843,_0x3a4208){var _0x3eb636=function(_0x19aec3){while(--_0x19aec3){_0x1a843['push'](_0x1a843['shift']());}};_0x3eb636(++_0x3a4208);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x48abdb,_0x225cd8){_0x48abdb=_0x48abdb-0x0;var _0x400a99=_0xc1c6[_0x48abdb];return _0x400a99;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var auth=require(_0x6c1c('0x4'));var interaction=require(_0x6c1c('0x5'));var config=require(_0x6c1c('0x6'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x6c1c('0x7')](),controller['index']);router[_0x6c1c('0x8')]('/:id',auth[_0x6c1c('0x7')](),controller[_0x6c1c('0x9')]);router[_0x6c1c('0xa')]('/',auth[_0x6c1c('0x7')](),controller['create']);router[_0x6c1c('0xb')](_0x6c1c('0xc'),auth['isAuthenticated'](),controller[_0x6c1c('0xd')]);router[_0x6c1c('0xe')](_0x6c1c('0xc'),auth[_0x6c1c('0x7')](),controller['destroy']);module[_0x6c1c('0xf')]=router; \ No newline at end of file +var _0x187d=['update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x4c2199,_0x1796c4){var _0x406c95=function(_0x25c635){while(--_0x25c635){_0x4c2199['push'](_0x4c2199['shift']());}};_0x406c95(++_0x1796c4);}(_0x187d,0x93));var _0xd187=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x187d[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var auth=require(_0xd187('0x5'));var interaction=require(_0xd187('0x6'));var config=require('../../config/environment');var controller=require(_0xd187('0x7'));router[_0xd187('0x8')]('/',auth['isAuthenticated'](),controller[_0xd187('0x9')]);router[_0xd187('0x8')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xc')]);router[_0xd187('0xd')]('/',auth[_0xd187('0xb')](),controller[_0xd187('0xe')]);router['put'](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xf')]);router[_0xd187('0x10')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller['destroy']);module[_0xd187('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index ab6591c..713315b 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.attributes.js +++ b/server/api/voiceTransferReport/voiceTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b68=['moment','exports','ENUM','blind','STRING','Yes','sequelize'];(function(_0x2495b5,_0x3c4fc4){var _0x4269d4=function(_0x2b3113){while(--_0x2b3113){_0x2495b5['push'](_0x2495b5['shift']());}};_0x4269d4(++_0x3c4fc4);}(_0x5b68,0x110));var _0x85b6=function(_0x157e1d,_0x2ac5d2){_0x157e1d=_0x157e1d-0x0;var _0x493d29=_0x5b68[_0x157e1d];return _0x493d29;};'use strict';var Sequelize=require(_0x85b6('0x0'));var moment=require(_0x85b6('0x1'));module[_0x85b6('0x2')]={'type':{'type':Sequelize[_0x85b6('0x3')](_0x85b6('0x4'),'attended')},'result':{'type':Sequelize[_0x85b6('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x85b6('0x5')]},'transferercalleridname':{'type':Sequelize[_0x85b6('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x85b6('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x85b6('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x85b6('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x85b6('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x85b6('0x5')]},'transfereechannel':{'type':Sequelize[_0x85b6('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x85b6('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x85b6('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x85b6('0x5')]},'transfereeexten':{'type':Sequelize[_0x85b6('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x85b6('0x5')]},'isexternal':{'type':Sequelize[_0x85b6('0x3')](_0x85b6('0x6'),'No')},'context':{'type':Sequelize[_0x85b6('0x5')]},'extension':{'type':Sequelize[_0x85b6('0x5')]}}; \ No newline at end of file +var _0x67e2=['ENUM','blind','attended','STRING','Yes','sequelize','moment'];(function(_0x188bfe,_0x2517cc){var _0x1a9efa=function(_0x361964){while(--_0x361964){_0x188bfe['push'](_0x188bfe['shift']());}};_0x1a9efa(++_0x2517cc);}(_0x67e2,0x17f));var _0x267e=function(_0x12a721,_0x5239ae){_0x12a721=_0x12a721-0x0;var _0x8c0ae0=_0x67e2[_0x12a721];return _0x8c0ae0;};'use strict';var Sequelize=require(_0x267e('0x0'));var moment=require(_0x267e('0x1'));module['exports']={'type':{'type':Sequelize[_0x267e('0x2')](_0x267e('0x3'),_0x267e('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x267e('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x267e('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x267e('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x267e('0x5')]},'transferercontext':{'type':Sequelize[_0x267e('0x5')]},'transfererexten':{'type':Sequelize[_0x267e('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x267e('0x5')]},'transfereechannel':{'type':Sequelize[_0x267e('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x267e('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x267e('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x267e('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x267e('0x6'),'No')},'context':{'type':Sequelize[_0x267e('0x5')]},'extension':{'type':Sequelize[_0x267e('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 5c75f21..e7be714 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.controller.js +++ b/server/api/voiceTransferReport/voiceTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e71=['moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','VoiceTransferReport','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filter','where','merge','map','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find','html-pdf','eml-format','fast-json-patch','request-promise'];(function(_0x12518e,_0x253352){var _0x167941=function(_0x386dea){while(--_0x386dea){_0x12518e['push'](_0x12518e['shift']());}};_0x167941(++_0x253352);}(_0x5e71,0x1ac));var _0x15e7=function(_0x1bcfae,_0x5b5078){_0x1bcfae=_0x1bcfae-0x0;var _0x1986fa=_0x5e71[_0x1bcfae];return _0x1986fa;};'use strict';var pdf=require(_0x15e7('0x0'));var emlformat=require(_0x15e7('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x15e7('0x2'));var rp=require(_0x15e7('0x3'));var moment=require(_0x15e7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x15e7('0x5'));var util=require(_0x15e7('0x6'));var path=require(_0x15e7('0x7'));var sox=require(_0x15e7('0x8'));var csv=require(_0x15e7('0x9'));var ejs=require(_0x15e7('0xa'));var fs=require('fs');var _=require(_0x15e7('0xb'));var squel=require(_0x15e7('0xc'));var crypto=require(_0x15e7('0xd'));var jsforce=require(_0x15e7('0xe'));var deskjs=require(_0x15e7('0xf'));var toCsv=require(_0x15e7('0x9'));var querystring=require(_0x15e7('0x10'));var Papa=require(_0x15e7('0x11'));var Redis=require('ioredis');var authService=require(_0x15e7('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x15e7('0x13'));var logger=require(_0x15e7('0x14'))('api');var utils=require(_0x15e7('0x15'));var config=require(_0x15e7('0x16'));var db=require(_0x15e7('0x17'))['db'];function respondWithStatusCode(_0x16eff1,_0x5baac9){_0x5baac9=_0x5baac9||0xcc;return function(_0x13102e){if(_0x13102e){return _0x16eff1[_0x15e7('0x18')](_0x5baac9);}return _0x16eff1[_0x15e7('0x19')](_0x5baac9)[_0x15e7('0x1a')]();};}function respondWithResult(_0x424d55,_0x338e86){_0x338e86=_0x338e86||0xc8;return function(_0x4fc590){if(_0x4fc590){return _0x424d55[_0x15e7('0x19')](_0x338e86)[_0x15e7('0x1b')](_0x4fc590);}};}function respondWithFilteredResult(_0x42f843,_0x2bda91){return function(_0x5b9dea){if(_0x5b9dea){var _0x4dcd43=_0x5b9dea[_0x15e7('0x1c')],_0x4a30fb=_0x2bda91['offset'],_0x504c7d=_0x2bda91[_0x15e7('0x1d')]+_0x2bda91[_0x15e7('0x1e')],_0x3b5956;if(_0x504c7d>=_0x4dcd43){_0x504c7d=_0x4dcd43;_0x3b5956=0xc8;}else{_0x3b5956=0xce;}_0x42f843['status'](_0x3b5956);return _0x42f843[_0x15e7('0x1f')](_0x15e7('0x20'),_0x4a30fb+'-'+_0x504c7d+'/'+_0x4dcd43)[_0x15e7('0x1b')](_0x5b9dea);}return null;};}function patchUpdates(_0x3ad750){return function(_0x565c4a){try{jsonpatch['apply'](_0x565c4a,_0x3ad750,!![]);}catch(_0x520d77){return BPromise[_0x15e7('0x21')](_0x520d77);}return _0x565c4a[_0x15e7('0x22')]();};}function saveUpdates(_0x5e12cf,_0x3e5e65){return function(_0x34039b){if(_0x34039b){return _0x34039b[_0x15e7('0x23')](_0x5e12cf)[_0x15e7('0x24')](function(_0x3a6274){return _0x3a6274;});}return null;};}function removeEntity(_0x158a80,_0x1fa0af){return function(_0x36bd95){if(_0x36bd95){return _0x36bd95[_0x15e7('0x25')]()[_0x15e7('0x24')](function(){_0x158a80[_0x15e7('0x19')](0xcc)[_0x15e7('0x1a')]();});}};}function handleEntityNotFound(_0x41f32d,_0xdc962b){return function(_0x444cc5){if(!_0x444cc5){_0x41f32d['sendStatus'](0x194);}return _0x444cc5;};}function handleError(_0xa7942f,_0x312498){_0x312498=_0x312498||0x1f4;return function(_0x1912ca){logger['error'](_0x1912ca[_0x15e7('0x26')]);if(_0x1912ca[_0x15e7('0x27')]){delete _0x1912ca[_0x15e7('0x27')];}_0xa7942f[_0x15e7('0x19')](_0x312498)[_0x15e7('0x28')](_0x1912ca);};}exports[_0x15e7('0x29')]=function(_0x3b8013,_0x548e2b){var _0x33a09d={},_0x41f641={},_0x1b51fe={'count':0x0,'rows':[]};var _0xf9efb7=db[_0x15e7('0x2a')]['rawAttributes'];_0x41f641[_0x15e7('0x2b')]=_[_0x15e7('0x2c')](_0xf9efb7);_0x41f641[_0x15e7('0x2d')]=_['keys'](_0x3b8013['query']);_0x41f641[_0x15e7('0x2e')]=_[_0x15e7('0x2f')](_0x41f641[_0x15e7('0x2b')],_0x41f641[_0x15e7('0x2d')]);_0x33a09d[_0x15e7('0x30')]=_[_0x15e7('0x2f')](_0x41f641['model'],qs[_0x15e7('0x31')](_0x3b8013[_0x15e7('0x2d')][_0x15e7('0x31')]));_0x33a09d['attributes']=_0x33a09d['attributes'][_0x15e7('0x32')]?_0x33a09d[_0x15e7('0x30')]:_0x41f641[_0x15e7('0x2b')];if(!_0x3b8013['query'][_0x15e7('0x33')](_0x15e7('0x34'))){_0x33a09d['limit']=qs[_0x15e7('0x1e')](_0x3b8013[_0x15e7('0x2d')][_0x15e7('0x1e')]);_0x33a09d[_0x15e7('0x1d')]=qs[_0x15e7('0x1d')](_0x3b8013['query'][_0x15e7('0x1d')]);}_0x33a09d[_0x15e7('0x35')]=qs['sort'](_0x3b8013[_0x15e7('0x2d')]['sort']);_0x33a09d['where']=qs[_0x15e7('0x2e')](_['pick'](_0x3b8013[_0x15e7('0x2d')],_0x41f641[_0x15e7('0x2e')]));if(_0x3b8013[_0x15e7('0x2d')][_0x15e7('0x36')]){_0x33a09d[_0x15e7('0x37')]=_[_0x15e7('0x38')](_0x33a09d[_0x15e7('0x37')],{'$or':_[_0x15e7('0x39')](_0xf9efb7,function(_0x153cf1){if(_0x153cf1[_0x15e7('0x3a')]['key']!==_0x15e7('0x3b')){var _0x5d740e={};_0x5d740e[_0x153cf1['field']]={'$like':'%'+_0x3b8013[_0x15e7('0x2d')][_0x15e7('0x36')]+'%'};return _0x5d740e;}})});}_0x33a09d=_[_0x15e7('0x38')]({},_0x33a09d,_0x3b8013[_0x15e7('0x3c')]);var _0xccde40={'where':_0x33a09d['where']};return db['VoiceTransferReport'][_0x15e7('0x1c')](_0xccde40)['then'](function(_0x5cf8d2){_0x1b51fe[_0x15e7('0x1c')]=_0x5cf8d2;if(_0x3b8013[_0x15e7('0x2d')]['includeAll']){_0x33a09d[_0x15e7('0x3d')]=[{'all':!![]}];}return db[_0x15e7('0x2a')][_0x15e7('0x3e')](_0x33a09d);})[_0x15e7('0x24')](function(_0x5967da){_0x1b51fe[_0x15e7('0x3f')]=_0x5967da;return _0x1b51fe;})[_0x15e7('0x24')](respondWithFilteredResult(_0x548e2b,_0x33a09d))[_0x15e7('0x40')](handleError(_0x548e2b,null));};exports[_0x15e7('0x41')]=function(_0x365193,_0x473926){var _0x919abb={'raw':!![],'where':{'id':_0x365193[_0x15e7('0x42')]['id']}},_0x5d5d66={};_0x5d5d66['model']=_[_0x15e7('0x2c')](db[_0x15e7('0x2a')][_0x15e7('0x43')]);_0x5d5d66['query']=_[_0x15e7('0x2c')](_0x365193[_0x15e7('0x2d')]);_0x5d5d66['filters']=_[_0x15e7('0x2f')](_0x5d5d66[_0x15e7('0x2b')],_0x5d5d66[_0x15e7('0x2d')]);_0x919abb[_0x15e7('0x30')]=_[_0x15e7('0x2f')](_0x5d5d66[_0x15e7('0x2b')],qs['fields'](_0x365193['query']['fields']));_0x919abb[_0x15e7('0x30')]=_0x919abb[_0x15e7('0x30')][_0x15e7('0x32')]?_0x919abb[_0x15e7('0x30')]:_0x5d5d66[_0x15e7('0x2b')];if(_0x365193[_0x15e7('0x2d')][_0x15e7('0x44')]){_0x919abb[_0x15e7('0x3d')]=[{'all':!![]}];}_0x919abb=_[_0x15e7('0x38')]({},_0x919abb,_0x365193[_0x15e7('0x3c')]);return db[_0x15e7('0x2a')]['find'](_0x919abb)['then'](handleEntityNotFound(_0x473926,null))[_0x15e7('0x24')](respondWithResult(_0x473926,null))[_0x15e7('0x40')](handleError(_0x473926,null));};exports[_0x15e7('0x45')]=function(_0x29050a,_0x39a807){return db[_0x15e7('0x2a')][_0x15e7('0x45')](_0x29050a['body'],{})[_0x15e7('0x24')](respondWithResult(_0x39a807,0xc9))['catch'](handleError(_0x39a807,null));};exports['update']=function(_0x5c861a,_0xb856b7){if(_0x5c861a[_0x15e7('0x46')]['id']){delete _0x5c861a[_0x15e7('0x46')]['id'];}return db[_0x15e7('0x2a')][_0x15e7('0x47')]({'where':{'id':_0x5c861a[_0x15e7('0x42')]['id']}})['then'](handleEntityNotFound(_0xb856b7,null))[_0x15e7('0x24')](saveUpdates(_0x5c861a[_0x15e7('0x46')],null))[_0x15e7('0x24')](respondWithResult(_0xb856b7,null))[_0x15e7('0x40')](handleError(_0xb856b7,null));};exports[_0x15e7('0x25')]=function(_0x3c8f78,_0x23b707){return db[_0x15e7('0x2a')][_0x15e7('0x47')]({'where':{'id':_0x3c8f78['params']['id']}})[_0x15e7('0x24')](handleEntityNotFound(_0x23b707,null))[_0x15e7('0x24')](removeEntity(_0x23b707,null))[_0x15e7('0x40')](handleError(_0x23b707,null));}; \ No newline at end of file +var _0x4216=['reject','save','update','then','destroy','stack','name','send','index','VoiceTransferReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','include','findAll','rows','show','params','includeAll','options','find','create','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0x4216,0x157));var _0x6421=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4216[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6421('0x0'));var rimraf=require(_0x6421('0x1'));var zipdir=require(_0x6421('0x2'));var jsonpatch=require(_0x6421('0x3'));var rp=require(_0x6421('0x4'));var moment=require(_0x6421('0x5'));var BPromise=require(_0x6421('0x6'));var Mustache=require(_0x6421('0x7'));var util=require(_0x6421('0x8'));var path=require(_0x6421('0x9'));var sox=require('sox');var csv=require(_0x6421('0xa'));var ejs=require(_0x6421('0xb'));var fs=require('fs');var _=require(_0x6421('0xc'));var squel=require(_0x6421('0xd'));var crypto=require(_0x6421('0xe'));var jsforce=require(_0x6421('0xf'));var deskjs=require(_0x6421('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6421('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6421('0x12'));var hardwareService=require(_0x6421('0x13'));var logger=require(_0x6421('0x14'))('api');var utils=require(_0x6421('0x15'));var config=require('../../config/environment');var db=require(_0x6421('0x16'))['db'];function respondWithStatusCode(_0x392543,_0x1d9b64){_0x1d9b64=_0x1d9b64||0xcc;return function(_0x4863ad){if(_0x4863ad){return _0x392543[_0x6421('0x17')](_0x1d9b64);}return _0x392543[_0x6421('0x18')](_0x1d9b64)[_0x6421('0x19')]();};}function respondWithResult(_0x2a1a9e,_0x339a7e){_0x339a7e=_0x339a7e||0xc8;return function(_0x5825e2){if(_0x5825e2){return _0x2a1a9e[_0x6421('0x18')](_0x339a7e)[_0x6421('0x1a')](_0x5825e2);}};}function respondWithFilteredResult(_0x3a4333,_0x19beac){return function(_0x323446){if(_0x323446){var _0x4560fe=_0x323446[_0x6421('0x1b')],_0x5d2365=_0x19beac[_0x6421('0x1c')],_0x2343fc=_0x19beac['offset']+_0x19beac['limit'],_0x311cb3;if(_0x2343fc>=_0x4560fe){_0x2343fc=_0x4560fe;_0x311cb3=0xc8;}else{_0x311cb3=0xce;}_0x3a4333[_0x6421('0x18')](_0x311cb3);return _0x3a4333[_0x6421('0x1d')](_0x6421('0x1e'),_0x5d2365+'-'+_0x2343fc+'/'+_0x4560fe)[_0x6421('0x1a')](_0x323446);}return null;};}function patchUpdates(_0x41c167){return function(_0x246a13){try{jsonpatch[_0x6421('0x1f')](_0x246a13,_0x41c167,!![]);}catch(_0x4d0625){return BPromise[_0x6421('0x20')](_0x4d0625);}return _0x246a13[_0x6421('0x21')]();};}function saveUpdates(_0x4428c6,_0x280e70){return function(_0x58cdca){if(_0x58cdca){return _0x58cdca[_0x6421('0x22')](_0x4428c6)[_0x6421('0x23')](function(_0x2b39c7){return _0x2b39c7;});}return null;};}function removeEntity(_0x535e9e,_0x3ab9a1){return function(_0x1f5e38){if(_0x1f5e38){return _0x1f5e38[_0x6421('0x24')]()[_0x6421('0x23')](function(){_0x535e9e[_0x6421('0x18')](0xcc)[_0x6421('0x19')]();});}};}function handleEntityNotFound(_0x1eeb92,_0x1659e9){return function(_0x53d27d){if(!_0x53d27d){_0x1eeb92[_0x6421('0x17')](0x194);}return _0x53d27d;};}function handleError(_0x41207c,_0x2cda79){_0x2cda79=_0x2cda79||0x1f4;return function(_0x1785a6){logger['error'](_0x1785a6[_0x6421('0x25')]);if(_0x1785a6[_0x6421('0x26')]){delete _0x1785a6[_0x6421('0x26')];}_0x41207c['status'](_0x2cda79)[_0x6421('0x27')](_0x1785a6);};}exports[_0x6421('0x28')]=function(_0x5557f2,_0x500338){var _0xe06ee5={},_0x3775ed={},_0x37b80e={'count':0x0,'rows':[]};var _0x1a2475=db[_0x6421('0x29')][_0x6421('0x2a')];_0x3775ed[_0x6421('0x2b')]=_[_0x6421('0x2c')](_0x1a2475);_0x3775ed[_0x6421('0x2d')]=_[_0x6421('0x2c')](_0x5557f2['query']);_0x3775ed[_0x6421('0x2e')]=_['intersection'](_0x3775ed[_0x6421('0x2b')],_0x3775ed[_0x6421('0x2d')]);_0xe06ee5['attributes']=_[_0x6421('0x2f')](_0x3775ed[_0x6421('0x2b')],qs['fields'](_0x5557f2[_0x6421('0x2d')][_0x6421('0x30')]));_0xe06ee5[_0x6421('0x31')]=_0xe06ee5[_0x6421('0x31')][_0x6421('0x32')]?_0xe06ee5[_0x6421('0x31')]:_0x3775ed['model'];if(!_0x5557f2['query']['hasOwnProperty'](_0x6421('0x33'))){_0xe06ee5[_0x6421('0x34')]=qs['limit'](_0x5557f2[_0x6421('0x2d')]['limit']);_0xe06ee5['offset']=qs[_0x6421('0x1c')](_0x5557f2['query'][_0x6421('0x1c')]);}_0xe06ee5[_0x6421('0x35')]=qs['sort'](_0x5557f2['query'][_0x6421('0x36')]);_0xe06ee5['where']=qs['filters'](_[_0x6421('0x37')](_0x5557f2[_0x6421('0x2d')],_0x3775ed['filters']));if(_0x5557f2[_0x6421('0x2d')][_0x6421('0x38')]){_0xe06ee5[_0x6421('0x39')]=_['merge'](_0xe06ee5['where'],{'$or':_[_0x6421('0x3a')](_0x1a2475,function(_0x254357){if(_0x254357[_0x6421('0x3b')][_0x6421('0x3c')]!==_0x6421('0x3d')){var _0x5c6882={};_0x5c6882[_0x254357[_0x6421('0x3e')]]={'$like':'%'+_0x5557f2[_0x6421('0x2d')][_0x6421('0x38')]+'%'};return _0x5c6882;}})});}_0xe06ee5=_[_0x6421('0x3f')]({},_0xe06ee5,_0x5557f2['options']);var _0x4216f4={'where':_0xe06ee5[_0x6421('0x39')]};return db[_0x6421('0x29')]['count'](_0x4216f4)[_0x6421('0x23')](function(_0x10045d){_0x37b80e['count']=_0x10045d;if(_0x5557f2['query']['includeAll']){_0xe06ee5[_0x6421('0x40')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x6421('0x41')](_0xe06ee5);})[_0x6421('0x23')](function(_0x3fe392){_0x37b80e[_0x6421('0x42')]=_0x3fe392;return _0x37b80e;})[_0x6421('0x23')](respondWithFilteredResult(_0x500338,_0xe06ee5))['catch'](handleError(_0x500338,null));};exports[_0x6421('0x43')]=function(_0x10f75b,_0x5e1884){var _0x44326b={'raw':!![],'where':{'id':_0x10f75b[_0x6421('0x44')]['id']}},_0x231c3f={};_0x231c3f['model']=_['keys'](db[_0x6421('0x29')][_0x6421('0x2a')]);_0x231c3f['query']=_[_0x6421('0x2c')](_0x10f75b[_0x6421('0x2d')]);_0x231c3f[_0x6421('0x2e')]=_[_0x6421('0x2f')](_0x231c3f['model'],_0x231c3f[_0x6421('0x2d')]);_0x44326b[_0x6421('0x31')]=_['intersection'](_0x231c3f[_0x6421('0x2b')],qs[_0x6421('0x30')](_0x10f75b[_0x6421('0x2d')][_0x6421('0x30')]));_0x44326b[_0x6421('0x31')]=_0x44326b[_0x6421('0x31')][_0x6421('0x32')]?_0x44326b[_0x6421('0x31')]:_0x231c3f[_0x6421('0x2b')];if(_0x10f75b[_0x6421('0x2d')][_0x6421('0x45')]){_0x44326b[_0x6421('0x40')]=[{'all':!![]}];}_0x44326b=_[_0x6421('0x3f')]({},_0x44326b,_0x10f75b[_0x6421('0x46')]);return db['VoiceTransferReport'][_0x6421('0x47')](_0x44326b)[_0x6421('0x23')](handleEntityNotFound(_0x5e1884,null))[_0x6421('0x23')](respondWithResult(_0x5e1884,null))['catch'](handleError(_0x5e1884,null));};exports[_0x6421('0x48')]=function(_0x445360,_0x5202bc){return db[_0x6421('0x29')][_0x6421('0x48')](_0x445360['body'],{})[_0x6421('0x23')](respondWithResult(_0x5202bc,0xc9))[_0x6421('0x49')](handleError(_0x5202bc,null));};exports[_0x6421('0x22')]=function(_0x2cd905,_0x526061){if(_0x2cd905[_0x6421('0x4a')]['id']){delete _0x2cd905[_0x6421('0x4a')]['id'];}return db[_0x6421('0x29')]['find']({'where':{'id':_0x2cd905['params']['id']}})[_0x6421('0x23')](handleEntityNotFound(_0x526061,null))['then'](saveUpdates(_0x2cd905[_0x6421('0x4a')],null))[_0x6421('0x23')](respondWithResult(_0x526061,null))[_0x6421('0x49')](handleError(_0x526061,null));};exports['destroy']=function(_0x367501,_0x59e8c6){return db[_0x6421('0x29')][_0x6421('0x47')]({'where':{'id':_0x367501[_0x6421('0x44')]['id']}})['then'](handleEntityNotFound(_0x59e8c6,null))['then'](removeEntity(_0x59e8c6,null))[_0x6421('0x49')](handleError(_0x59e8c6,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 110faa6..e0f2b68 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.model.js +++ b/server/api/voiceTransferReport/voiceTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2172=['path','rimraf','../../config/environment','define','VoiceTransferReport','util','../../config/logger','api','moment'];(function(_0x4c0f9e,_0x3db8fa){var _0x53b8ee=function(_0x34c13a){while(--_0x34c13a){_0x4c0f9e['push'](_0x4c0f9e['shift']());}};_0x53b8ee(++_0x3db8fa);}(_0x2172,0x15b));var _0x2217=function(_0x198699,_0xf27ce4){_0x198699=_0x198699-0x0;var _0x39f441=_0x2172[_0x198699];return _0x39f441;};'use strict';var _=require('lodash');var util=require(_0x2217('0x0'));var logger=require(_0x2217('0x1'))(_0x2217('0x2'));var moment=require(_0x2217('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2217('0x4'));var rimraf=require(_0x2217('0x5'));var config=require(_0x2217('0x6'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x57adaa,_0x25ddb0){return _0x57adaa[_0x2217('0x7')](_0x2217('0x8'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf117=['VoiceTransferReport','report_call_transfer','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define'];(function(_0x782da0,_0x1cd393){var _0x2b28d8=function(_0x151e31){while(--_0x151e31){_0x782da0['push'](_0x782da0['shift']());}};_0x2b28d8(++_0x1cd393);}(_0xf117,0x122));var _0x7f11=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xf117[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var util=require(_0x7f11('0x0'));var logger=require(_0x7f11('0x1'))(_0x7f11('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7f11('0x3'));var fs=require('fs');var path=require(_0x7f11('0x4'));var rimraf=require(_0x7f11('0x5'));var config=require(_0x7f11('0x6'));var attributes=require(_0x7f11('0x7'));module[_0x7f11('0x8')]=function(_0x165ec6,_0x199ac7){return _0x165ec6[_0x7f11('0x9')](_0x7f11('0xa'),attributes,{'tableName':_0x7f11('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 3a0a8b4..3767c8d 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.rpc.js +++ b/server/api/voiceTransferReport/voiceTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6c4=['body','raw','CreateVoiceTransferReport','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceTransferReport','create'];(function(_0x1140bf,_0x965cd5){var _0x2eeafa=function(_0x26def5){while(--_0x26def5){_0x1140bf['push'](_0x1140bf['shift']());}};_0x2eeafa(++_0x965cd5);}(_0xa6c4,0x1e3));var _0x4a6c=function(_0x402731,_0x43c115){_0x402731=_0x402731-0x0;var _0x111736=_0xa6c4[_0x402731];return _0x111736;};'use strict';var _=require(_0x4a6c('0x0'));var util=require(_0x4a6c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a6c('0x2'));var db=require(_0x4a6c('0x3'))['db'];var utils=require(_0x4a6c('0x4'));var logger=require('../../config/logger')(_0x4a6c('0x5'));var config=require(_0x4a6c('0x6'));var jayson=require(_0x4a6c('0x7'));var client=jayson['client'][_0x4a6c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e860d,_0x261903,_0xa09753){return new BPromise(function(_0x3e9f32,_0x480785){return client['request'](_0x3e860d,_0xa09753)['then'](function(_0x2e7be8){logger[_0x4a6c('0x9')]('VoiceTransferReport,\x20%s,\x20%s',_0x261903,_0x4a6c('0xa'));logger[_0x4a6c('0xb')](_0x4a6c('0xc'),_0x261903,'request\x20sent',JSON[_0x4a6c('0xd')](_0x2e7be8));if(_0x2e7be8[_0x4a6c('0xe')]){if(_0x2e7be8[_0x4a6c('0xe')][_0x4a6c('0xf')]===0x1f4){logger[_0x4a6c('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x261903,_0x2e7be8['error'][_0x4a6c('0x10')]);return _0x480785(_0x2e7be8[_0x4a6c('0xe')]['message']);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x261903,_0x2e7be8[_0x4a6c('0xe')]['message']);return _0x3e9f32(_0x2e7be8[_0x4a6c('0xe')][_0x4a6c('0x10')]);}else{logger[_0x4a6c('0x9')]('VoiceTransferReport,\x20%s,\x20%s',_0x261903,_0x4a6c('0xa'));_0x3e9f32(_0x2e7be8[_0x4a6c('0x11')][_0x4a6c('0x10')]);}})[_0x4a6c('0x12')](function(_0x1e8a00){logger[_0x4a6c('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x261903,_0x1e8a00);_0x480785(_0x1e8a00);});});}exports['CreateVoiceTransferReport']=function(_0x2ef005){var _0x95e4d3=this;return new Promise(function(_0x7d1086,_0x10e85a){return db[_0x4a6c('0x13')][_0x4a6c('0x14')](_0x2ef005[_0x4a6c('0x15')],{'raw':_0x2ef005['options']?_0x2ef005['options'][_0x4a6c('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x374aa4){logger[_0x4a6c('0x9')](_0x4a6c('0x17'),_0x2ef005);logger['debug'](_0x4a6c('0x17'),_0x2ef005,JSON[_0x4a6c('0xd')](_0x374aa4));_0x7d1086(_0x374aa4);})[_0x4a6c('0x12')](function(_0x583d2f){logger[_0x4a6c('0xe')](_0x4a6c('0x17'),_0x583d2f[_0x4a6c('0x10')],_0x2ef005);_0x10e85a(_0x95e4d3[_0x4a6c('0xe')](0x1f4,_0x583d2f[_0x4a6c('0x10')]));});});}; \ No newline at end of file +var _0x5e86=['catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x5e86,0x89));var _0x65e8=function(_0x771402,_0x394b84){_0x771402=_0x771402-0x0;var _0x55ce82=_0x5e86[_0x771402];return _0x55ce82;};'use strict';var _=require(_0x65e8('0x0'));var util=require(_0x65e8('0x1'));var moment=require('moment');var BPromise=require(_0x65e8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65e8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x65e8('0x4'));var logger=require(_0x65e8('0x5'))('rpc');var config=require(_0x65e8('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x65e8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3652c2,_0x2292c6,_0x1be331){return new BPromise(function(_0x15896f,_0x51b6e7){return client[_0x65e8('0x8')](_0x3652c2,_0x1be331)[_0x65e8('0x9')](function(_0x25504c){logger['info'](_0x65e8('0xa'),_0x2292c6,_0x65e8('0xb'));logger[_0x65e8('0xc')](_0x65e8('0xd'),_0x2292c6,_0x65e8('0xb'),JSON[_0x65e8('0xe')](_0x25504c));if(_0x25504c['error']){if(_0x25504c[_0x65e8('0xf')][_0x65e8('0x10')]===0x1f4){logger[_0x65e8('0xf')](_0x65e8('0xa'),_0x2292c6,_0x25504c[_0x65e8('0xf')]['message']);return _0x51b6e7(_0x25504c[_0x65e8('0xf')][_0x65e8('0x11')]);}logger[_0x65e8('0xf')](_0x65e8('0xa'),_0x2292c6,_0x25504c[_0x65e8('0xf')]['message']);return _0x15896f(_0x25504c[_0x65e8('0xf')]['message']);}else{logger[_0x65e8('0x12')](_0x65e8('0xa'),_0x2292c6,_0x65e8('0xb'));_0x15896f(_0x25504c['result'][_0x65e8('0x11')]);}})[_0x65e8('0x13')](function(_0x4b84fa){logger[_0x65e8('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x2292c6,_0x4b84fa);_0x51b6e7(_0x4b84fa);});});}exports[_0x65e8('0x14')]=function(_0x332206){var _0x5b7b3e=this;return new Promise(function(_0x3db649,_0x4235d0){return db[_0x65e8('0x15')][_0x65e8('0x16')](_0x332206[_0x65e8('0x17')],{'raw':_0x332206[_0x65e8('0x18')]?_0x332206['options'][_0x65e8('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1aeb06){logger[_0x65e8('0x12')](_0x65e8('0x14'),_0x332206);logger[_0x65e8('0xc')]('CreateVoiceTransferReport',_0x332206,JSON[_0x65e8('0xe')](_0x1aeb06));_0x3db649(_0x1aeb06);})[_0x65e8('0x13')](function(_0x245a2a){logger['error']('CreateVoiceTransferReport',_0x245a2a[_0x65e8('0x11')],_0x332206);_0x4235d0(_0x5b7b3e[_0x65e8('0xf')](0x1f4,_0x245a2a[_0x65e8('0x11')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index d5c4309..dd6be28 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4a5=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','sequelize','then','listen','start','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','status','seedDB','./config/seedDB','default','catch'];(function(_0x4a04a2,_0xe7350c){var _0x208eba=function(_0x1840c9){while(--_0x1840c9){_0x4a04a2['push'](_0x4a04a2['shift']());}};_0x208eba(++_0xe7350c);}(_0xa4a5,0x9d));var _0x5a4a=function(_0x4f019b,_0x414f79){_0x4f019b=_0x4f019b-0x0;var _0x25bc48=_0xa4a5[_0x4f019b];return _0x25bc48;};'use strict';var _=require(_0x5a4a('0x0'));var mysqldb=require(_0x5a4a('0x1'));var rpc=require(_0x5a4a('0x2'));var config=require(_0x5a4a('0x3'));var logger=require(_0x5a4a('0x4'))(_0x5a4a('0x5'));var pm2=require(_0x5a4a('0x6'));var pm2Config=require(_0x5a4a('0x7'));var schedule=require(_0x5a4a('0x8'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0x5a4a('0x9')]['sync']()[_0x5a4a('0xa')](function(){return rpc[_0x5a4a('0xb')]();})[_0x5a4a('0xa')](function(_0x24905e){logger['info'](_0x24905e);return chat['start']();})[_0x5a4a('0xa')](function(){return schedule[_0x5a4a('0xc')]();})[_0x5a4a('0xa')](function(_0x34e68b){logger['info'](_0x34e68b);return pm2[_0x5a4a('0xc')](pm2Config);})[_0x5a4a('0xa')](function(_0x2a7002){logger['info'](_0x5a4a('0xd'),_[_0x5a4a('0xe')](_[_0x5a4a('0xf')](_0x2a7002,{'status':_0x5a4a('0x10')}),_0x5a4a('0x11'))[_0x5a4a('0x12')]());logger['info'](_0x5a4a('0x13'),_[_0x5a4a('0xe')](_[_0x5a4a('0xf')](_0x2a7002,function(_0x5a3d86){return _0x5a3d86[_0x5a4a('0x14')]!=='online';}),_0x5a4a('0x11'))[_0x5a4a('0x12')]()||'None');config[_0x5a4a('0x15')]&&require(_0x5a4a('0x16'))[_0x5a4a('0x17')]();require('./config/license')[_0x5a4a('0x17')]();})[_0x5a4a('0x18')](function(_0x9e38d2){logger['error'](_0x5a4a('0x19'),_0x9e38d2);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xec03=['None','seedDB','./config/seedDB','default','./config/license','catch','exit','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','start','info','Online\x20apps:','filter','online','join','map','status','name'];(function(_0x355e06,_0x5678de){var _0x27b414=function(_0x28a1fd){while(--_0x28a1fd){_0x355e06['push'](_0x355e06['shift']());}};_0x27b414(++_0x5678de);}(_0xec03,0x181));var _0x3ec0=function(_0x5ca494,_0x31e2f6){_0x5ca494=_0x5ca494-0x0;var _0x359899=_0xec03[_0x5ca494];return _0x359899;};'use strict';var _=require('lodash');var mysqldb=require('./mysqldb');var rpc=require(_0x3ec0('0x0'));var config=require(_0x3ec0('0x1'));var logger=require(_0x3ec0('0x2'))(_0x3ec0('0x3'));var pm2=require(_0x3ec0('0x4'));var pm2Config=require(_0x3ec0('0x5'));var schedule=require(_0x3ec0('0x6'));var chat=require(_0x3ec0('0x7'));function main(){return mysqldb['db'][_0x3ec0('0x8')][_0x3ec0('0x9')]()['then'](function(){return rpc['listen']();})['then'](function(_0x6f321){logger['info'](_0x6f321);return chat['start']();})[_0x3ec0('0xa')](function(){return schedule[_0x3ec0('0xb')]();})[_0x3ec0('0xa')](function(_0x2540b2){logger[_0x3ec0('0xc')](_0x2540b2);return pm2[_0x3ec0('0xb')](pm2Config);})['then'](function(_0x89e063){logger[_0x3ec0('0xc')](_0x3ec0('0xd'),_['map'](_[_0x3ec0('0xe')](_0x89e063,{'status':_0x3ec0('0xf')}),'name')[_0x3ec0('0x10')]());logger[_0x3ec0('0xc')]('Offline\x20apps:',_[_0x3ec0('0x11')](_[_0x3ec0('0xe')](_0x89e063,function(_0x4c9f33){return _0x4c9f33[_0x3ec0('0x12')]!=='online';}),_0x3ec0('0x13'))[_0x3ec0('0x10')]()||_0x3ec0('0x14'));config[_0x3ec0('0x15')]&&require(_0x3ec0('0x16'))[_0x3ec0('0x17')]();require(_0x3ec0('0x18'))[_0x3ec0('0x17')]();})[_0x3ec0('0x19')](function(_0x1d2522){logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x1d2522);process[_0x3ec0('0x1a')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 64498ca..e46ce5c 100644 --- a/server/components/auth/service.js +++ b/server/components/auth/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x896e=['sign','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','isMiddleware','setTokenCookie','role','motion.token','cookie','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','apiKeyNonce','randomBytes','toString','floor','now','regenerateApiKey','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','ipaddr.js','secrets','session','fullname','name','internal','email','userpic','voicePause','chatPause','mailPause','smsPause','pauseType','phoneBarRemoteControlPort','phoneBarRemoteControl','interface','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','disposition','status','json','Unmanaged.','catch','headers','authorization','startsWith','then','authenticate','Bearer','Unknown\x20authorization\x20format','query','verify','apikey','getUuid','User','find','sub','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','log','User\x20not\x20found.','User\x20object\x20not\x20found.','isAuthenticated','../../config/license/util','Forbidden'];(function(_0x5be690,_0x542198){var _0x4ea7d0=function(_0xc63e3c){while(--_0xc63e3c){_0x5be690['push'](_0x5be690['shift']());}};_0x4ea7d0(++_0x542198);}(_0x896e,0x1e9));var _0xe896=function(_0xd03984,_0x12a4d3){_0xd03984=_0xd03984-0x0;var _0x38fae1=_0x896e[_0xd03984];return _0x38fae1;};'use strict';var db=require(_0xe896('0x0'))['db'];var config=require(_0xe896('0x1'));var hardwareConf=require(_0xe896('0x2'));var _=require(_0xe896('0x3'));var jwt=require(_0xe896('0x4'));var expressJwt=require(_0xe896('0x5'));var compose=require(_0xe896('0x6'));var basicAuth=require(_0xe896('0x7'));var crypto=require(_0xe896('0x8'));var ipaddr=require(_0xe896('0x9'));var validateJwt=expressJwt({'secret':config[_0xe896('0xa')][_0xe896('0xb')]});var userAttributes=['id','role',_0xe896('0xc'),_0xe896('0xd'),_0xe896('0xe'),_0xe896('0xf'),_0xe896('0x10'),'permissions',_0xe896('0x11'),_0xe896('0x12'),_0xe896('0x13'),'faxPause',_0xe896('0x14'),'openchannelPause',_0xe896('0x15'),'showWebBar',_0xe896('0x16'),_0xe896('0x17'),_0xe896('0x18'),'userProfileId'];exports[_0xe896('0x19')]=function(){return isAuthenticated(!![])[_0xe896('0x1a')](function(_0x3e8ac9,_0x580aac,_0x2aa522){if(_0x3e8ac9[_0xe896('0x1b')]){_0x2aa522();}else{return db[_0xe896('0x1c')]['findOne']({'where':{'id':_0x3e8ac9[_0xe896('0x1d')]['id']},'attributes':['id',_0xe896('0x1e'),_0xe896('0x1f')],'raw':!![]})['then'](function(_0x5a7957){if(_0x5a7957&&_0x5a7957[_0xe896('0x1e')]){return _0x580aac[_0xe896('0x20')](_0x5a7957['disposition']==='unmanaged'?0x195:0x193)[_0xe896('0x21')]({'message':_0x5a7957[_0xe896('0x1f')]==='unmanaged'?_0xe896('0x22'):'Forbidden.'});}else{_0x2aa522();}})[_0xe896('0x23')](function(_0x32f86d){_0x2aa522(_0x32f86d);});}});};function isAuthenticated(_0x2d4cf0){return compose()['use'](function(_0x782813,_0x9714f1,_0xdcdba8){if(_0x782813[_0xe896('0x24')][_0xe896('0x25')]){if(_[_0xe896('0x26')](_0x782813[_0xe896('0x24')][_0xe896('0x25')],'Basic')){var _0x180d46=basicAuth(_0x782813);db['User']['find']({'where':{'name':_0x180d46[_0xe896('0xd')]}})[_0xe896('0x27')](function(_0x40502b){if(!_0x40502b||!_0x40502b[_0xe896('0x28')](_0x180d46['pass'])){return _0x9714f1[_0xe896('0x20')](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x782813[_0xe896('0x1b')]={'id':_0x40502b['id']};_0xdcdba8();})[_0xe896('0x23')](function(_0x1e952a){_0xdcdba8(_0x1e952a);});}else if(_[_0xe896('0x26')](_0x782813[_0xe896('0x24')][_0xe896('0x25')],_0xe896('0x29'))){validateJwt(_0x782813,_0x9714f1,_0xdcdba8);}else{if(_0x2d4cf0){_0xdcdba8();}else{return _0x9714f1['status'](0x193)[_0xe896('0x21')]({'message':_0xe896('0x2a')});}}}else if(_0x782813[_0xe896('0x2b')]['apikey']){try{var _0x26635e=jwt[_0xe896('0x2c')](_0x782813[_0xe896('0x2b')][_0xe896('0x2d')],config[_0xe896('0xa')][_0xe896('0xb')],{'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xe896('0x2e')]()});db[_0xe896('0x2f')][_0xe896('0x30')]({'where':{'id':_0x26635e[_0xe896('0x31')]}})[_0xe896('0x27')](function(_0x5e0d9b){if(!_0x5e0d9b||!_['isEqual'](_0x5e0d9b['apiKeyNonce'],_0x26635e['nonce'])){return _0x9714f1['status'](0x193)[_0xe896('0x21')]({'message':_0xe896('0x32')});}_0x782813[_0xe896('0x1b')]={'id':_0x5e0d9b['id']};_0xdcdba8();})[_0xe896('0x23')](function(_0x3cd88e){_0xdcdba8(_0x3cd88e);});}catch(_0x1a6090){console[_0xe896('0x33')](_0x1a6090);return _0x9714f1[_0xe896('0x20')](0x193)['json']({'message':'Unrecognized\x20API\x20access\x20key'});}}else if(_0x2d4cf0){_0xdcdba8();}else{return _0x9714f1[_0xe896('0x20')](0x193)[_0xe896('0x21')]({'message':_0xe896('0x2a')});}})[_0xe896('0x1a')](function(_0x4ddeb6,_0x14ad7a,_0x571e4d){if(_0x4ddeb6['user']){db[_0xe896('0x2f')][_0xe896('0x30')]({'where':{'id':_0x4ddeb6[_0xe896('0x1b')]['id']},'attributes':userAttributes})['then'](function(_0x4d8092){if(!_0x4d8092){return _0x14ad7a['status'](0x194)[_0xe896('0x21')]({'message':_0xe896('0x34')});}_0x4ddeb6[_0xe896('0x1b')]=_0x4d8092;_0x571e4d();})[_0xe896('0x23')](function(_0x36d2d7){_0x571e4d(_0x36d2d7);});}else if(_0x2d4cf0){_0x571e4d();}else{return _0x14ad7a['status'](0x194)[_0xe896('0x21')]({'message':_0xe896('0x35')});}});}exports[_0xe896('0x36')]=isAuthenticated;function canUpdate(){return compose()[_0xe896('0x1a')](function(_0x1366d0,_0x2cce09,_0x3aeccc){return require(_0xe896('0x37'))['getLicense']()[_0xe896('0x27')](function(_0x1ad362){if(_0x1ad362['update']){_0x3aeccc();}else{return _0x2cce09[_0xe896('0x20')](0x193)['json']({'message':_0xe896('0x38')});}})['catch'](function(_0x42f445){_0x3aeccc(_0x42f445);});});}exports['canUpdate']=canUpdate;function signToken(_0x2ab7a6,_0x470c29){return jwt[_0xe896('0x39')]({'id':_0x2ab7a6,'role':_0x470c29},config[_0xe896('0xa')][_0xe896('0xb')],{'expiresIn':0x15180});}exports['signToken']=signToken;exports['hasRole']=function(_0x203aea){if(!_0x203aea){throw new Error(_0xe896('0x3a'));}return compose()[_0xe896('0x1a')](isAuthenticated())[_0xe896('0x1a')](function meetsRequirements(_0x2ff489,_0x4c0ef0,_0x5b8131){if(config[_0xe896('0x3b')][_0xe896('0x3c')](_0x2ff489['user']['role'])>=config[_0xe896('0x3b')][_0xe896('0x3c')](_0x203aea)){return _0x5b8131();}else{return _0x4c0ef0[_0xe896('0x20')](0x193)[_0xe896('0x21')]({'message':_0xe896('0x38')});}});};exports[_0xe896('0x3d')]=function(_0x462b38,_0x38e36f,_0x372c71){_0x462b38[_0xe896('0x3d')]=!![];return _0x372c71();};exports[_0xe896('0x3e')]=function(_0x1bc76a,_0x5c00c6){if(!_0x1bc76a[_0xe896('0x1b')]){return _0x5c00c6[_0xe896('0x20')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x5cd5a3=signToken(_0x1bc76a[_0xe896('0x1b')]['id'],_0x1bc76a[_0xe896('0x1b')][_0xe896('0x3f')]);_0x5c00c6['cookie'](_0xe896('0x40'),_0x5cd5a3);_0x5c00c6[_0xe896('0x41')]('motion.user',JSON['stringify'](_['pick'](_0x1bc76a[_0xe896('0x1b')],userAttributes)));_0x5c00c6[_0xe896('0x42')](_0xe896('0x43'));};exports[_0xe896('0x44')]=function(_0x4452aa){if(_[_0xe896('0x45')](_0x4452aa['apiKeyNonce'])||_[_0xe896('0x45')](_0x4452aa[_0xe896('0x46')]))return null;else return createJwt(_0x4452aa);};exports['generateApiKey']=function(_0x43bca4){_0x43bca4[_0xe896('0x47')]=crypto[_0xe896('0x48')](0x10)[_0xe896('0x49')]('hex');_0x43bca4[_0xe896('0x46')]=Math[_0xe896('0x4a')](Date[_0xe896('0x4b')]()/0x3e8)[_0xe896('0x49')]();return createJwt(_0x43bca4);};exports[_0xe896('0x4c')]=function(_0xc6829e,_0x591024){if(_0xc6829e[_0xe896('0x2b')]['apikey']){jwt[_0xe896('0x2c')](_0xc6829e[_0xe896('0x2b')][_0xe896('0x2d')],config[_0xe896('0xa')][_0xe896('0xb')],{'nonce':_0x591024[_0xe896('0x47')],'iat':_0x591024['apiKeyIat'],'audience':hardwareConf[_0xe896('0x2e')](),'issuer':hardwareConf[_0xe896('0x2e')]()});return generateApiKey(_0x591024);}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function createJwt(_0x3373dc){return jwt[_0xe896('0x39')]({'iat':_0x3373dc['apiKeyIat'],'nonce':_0x3373dc[_0xe896('0x47')]},config['secrets'][_0xe896('0xb')],{'algorithm':_0xe896('0x4d'),'subject':_0x3373dc['id'][_0xe896('0x49')](),'issuer':hardwareConf[_0xe896('0x2e')](),'audience':hardwareConf[_0xe896('0x2e')]()});} \ No newline at end of file +var _0x1967=['isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','log','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','isAuthenticated','../../config/license/util','getLicense','update','Forbidden','canUpdate','sign','signToken','userRoles','indexOf','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','cookie','stringify','isNil','apiKeyIat','generateApiKey','toString','hex','now','regenerateApiKey','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','ipaddr.js','secrets','role','fullname','name','internal','email','userpic','voicePause','chatPause','mailPause','faxPause','smsPause','showWebBar','phoneBarRemoteControlPort','phoneBarRemoteControl','interface','userProfileId','isChatInteractionAuthorized','use','user','findOne','params','closed','disposition','status','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','startsWith','Basic','User','then','pass','Wrong\x20credentials.','authorization','Bearer','Unknown\x20authorization\x20format','verify','query','session','getUuid','find'];(function(_0x30b8a3,_0x5c3a80){var _0xfbb6e5=function(_0x4cc765){while(--_0x4cc765){_0x30b8a3['push'](_0x30b8a3['shift']());}};_0xfbb6e5(++_0x5c3a80);}(_0x1967,0x173));var _0x7196=function(_0x522a8c,_0x5dec44){_0x522a8c=_0x522a8c-0x0;var _0x10001a=_0x1967[_0x522a8c];return _0x10001a;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x7196('0x0'));var hardwareConf=require(_0x7196('0x1'));var _=require(_0x7196('0x2'));var jwt=require(_0x7196('0x3'));var expressJwt=require(_0x7196('0x4'));var compose=require(_0x7196('0x5'));var basicAuth=require(_0x7196('0x6'));var crypto=require(_0x7196('0x7'));var ipaddr=require(_0x7196('0x8'));var validateJwt=expressJwt({'secret':config[_0x7196('0x9')]['session']});var userAttributes=['id',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'permissions',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'openchannelPause','pauseType',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19')];exports[_0x7196('0x1a')]=function(){return isAuthenticated(!![])[_0x7196('0x1b')](function(_0x325641,_0x24f1c3,_0xba707b){if(_0x325641[_0x7196('0x1c')]){_0xba707b();}else{return db['ChatInteraction'][_0x7196('0x1d')]({'where':{'id':_0x325641[_0x7196('0x1e')]['id']},'attributes':['id',_0x7196('0x1f'),_0x7196('0x20')],'raw':!![]})['then'](function(_0x31c778){if(_0x31c778&&_0x31c778['closed']){return _0x24f1c3[_0x7196('0x21')](_0x31c778[_0x7196('0x20')]===_0x7196('0x22')?0x195:0x193)[_0x7196('0x23')]({'message':_0x31c778[_0x7196('0x20')]===_0x7196('0x22')?_0x7196('0x24'):_0x7196('0x25')});}else{_0xba707b();}})[_0x7196('0x26')](function(_0x32fe2b){_0xba707b(_0x32fe2b);});}});};function isAuthenticated(_0x385f2d){return compose()['use'](function(_0x4c4f91,_0x448f13,_0x26b447){if(_0x4c4f91[_0x7196('0x27')]['authorization']){if(_[_0x7196('0x28')](_0x4c4f91['headers']['authorization'],_0x7196('0x29'))){var _0x627223=basicAuth(_0x4c4f91);db[_0x7196('0x2a')]['find']({'where':{'name':_0x627223['name']}})[_0x7196('0x2b')](function(_0x3cd8ff){if(!_0x3cd8ff||!_0x3cd8ff['authenticate'](_0x627223[_0x7196('0x2c')])){return _0x448f13[_0x7196('0x21')](0x191)[_0x7196('0x23')]({'message':_0x7196('0x2d')});}_0x4c4f91[_0x7196('0x1c')]={'id':_0x3cd8ff['id']};_0x26b447();})['catch'](function(_0x3f8178){_0x26b447(_0x3f8178);});}else if(_['startsWith'](_0x4c4f91[_0x7196('0x27')][_0x7196('0x2e')],_0x7196('0x2f'))){validateJwt(_0x4c4f91,_0x448f13,_0x26b447);}else{if(_0x385f2d){_0x26b447();}else{return _0x448f13[_0x7196('0x21')](0x193)[_0x7196('0x23')]({'message':_0x7196('0x30')});}}}else if(_0x4c4f91['query']['apikey']){try{var _0x1482e5=jwt[_0x7196('0x31')](_0x4c4f91[_0x7196('0x32')]['apikey'],config['secrets'][_0x7196('0x33')],{'audience':hardwareConf[_0x7196('0x34')](),'issuer':hardwareConf[_0x7196('0x34')]()});db['User'][_0x7196('0x35')]({'where':{'id':_0x1482e5['sub']}})[_0x7196('0x2b')](function(_0x59d79d){if(!_0x59d79d||!_[_0x7196('0x36')](_0x59d79d[_0x7196('0x37')],_0x1482e5[_0x7196('0x38')])){return _0x448f13['status'](0x193)[_0x7196('0x23')]({'message':_0x7196('0x39')});}_0x4c4f91[_0x7196('0x1c')]={'id':_0x59d79d['id']};_0x26b447();})[_0x7196('0x26')](function(_0x50c386){_0x26b447(_0x50c386);});}catch(_0x39710d){console[_0x7196('0x3a')](_0x39710d);return _0x448f13[_0x7196('0x21')](0x193)[_0x7196('0x23')]({'message':_0x7196('0x3b')});}}else if(_0x385f2d){_0x26b447();}else{return _0x448f13[_0x7196('0x21')](0x193)[_0x7196('0x23')]({'message':_0x7196('0x30')});}})[_0x7196('0x1b')](function(_0xf33b59,_0x1ff4b4,_0x54e46b){if(_0xf33b59[_0x7196('0x1c')]){db['User'][_0x7196('0x35')]({'where':{'id':_0xf33b59['user']['id']},'attributes':userAttributes})[_0x7196('0x2b')](function(_0x25fa11){if(!_0x25fa11){return _0x1ff4b4['status'](0x194)[_0x7196('0x23')]({'message':_0x7196('0x3c')});}_0xf33b59[_0x7196('0x1c')]=_0x25fa11;_0x54e46b();})[_0x7196('0x26')](function(_0x7547cf){_0x54e46b(_0x7547cf);});}else if(_0x385f2d){_0x54e46b();}else{return _0x1ff4b4['status'](0x194)[_0x7196('0x23')]({'message':_0x7196('0x3d')});}});}exports[_0x7196('0x3e')]=isAuthenticated;function canUpdate(){return compose()[_0x7196('0x1b')](function(_0x3e8f98,_0x123cad,_0x50a101){return require(_0x7196('0x3f'))[_0x7196('0x40')]()[_0x7196('0x2b')](function(_0x4f6b27){if(_0x4f6b27[_0x7196('0x41')]){_0x50a101();}else{return _0x123cad[_0x7196('0x21')](0x193)[_0x7196('0x23')]({'message':_0x7196('0x42')});}})[_0x7196('0x26')](function(_0x31fca7){_0x50a101(_0x31fca7);});});}exports[_0x7196('0x43')]=canUpdate;function signToken(_0x1ab720,_0x92cfb1){return jwt[_0x7196('0x44')]({'id':_0x1ab720,'role':_0x92cfb1},config['secrets'][_0x7196('0x33')],{'expiresIn':0x15180});}exports[_0x7196('0x45')]=signToken;exports['hasRole']=function(_0x186efe){if(!_0x186efe){throw new Error('Required\x20role\x20needs\x20to\x20be\x20set');}return compose()['use'](isAuthenticated())[_0x7196('0x1b')](function meetsRequirements(_0x1a14c6,_0x4d03c9,_0x587f6f){if(config[_0x7196('0x46')][_0x7196('0x47')](_0x1a14c6[_0x7196('0x1c')]['role'])>=config[_0x7196('0x46')][_0x7196('0x47')](_0x186efe)){return _0x587f6f();}else{return _0x4d03c9[_0x7196('0x21')](0x193)[_0x7196('0x23')]({'message':_0x7196('0x42')});}});};exports[_0x7196('0x48')]=function(_0xc94d24,_0x440077,_0x5cd903){_0xc94d24[_0x7196('0x48')]=!![];return _0x5cd903();};exports[_0x7196('0x49')]=function(_0x4f8b4a,_0x266bd7){if(!_0x4f8b4a[_0x7196('0x1c')]){return _0x266bd7['status'](0x194)[_0x7196('0x23')]({'message':_0x7196('0x4a')});}var _0x3b78c8=signToken(_0x4f8b4a['user']['id'],_0x4f8b4a[_0x7196('0x1c')][_0x7196('0xa')]);_0x266bd7['cookie'](_0x7196('0x4b'),_0x3b78c8);_0x266bd7[_0x7196('0x4c')]('motion.user',JSON[_0x7196('0x4d')](_['pick'](_0x4f8b4a['user'],userAttributes)));_0x266bd7['redirect']('/dashboards/general');};exports['retrieveApiKey']=function(_0x230087){if(_['isNil'](_0x230087[_0x7196('0x37')])||_[_0x7196('0x4e')](_0x230087[_0x7196('0x4f')]))return null;else return createJwt(_0x230087);};exports[_0x7196('0x50')]=function(_0x522fbd){_0x522fbd[_0x7196('0x37')]=crypto['randomBytes'](0x10)[_0x7196('0x51')](_0x7196('0x52'));_0x522fbd[_0x7196('0x4f')]=Math['floor'](Date[_0x7196('0x53')]()/0x3e8)[_0x7196('0x51')]();return createJwt(_0x522fbd);};exports[_0x7196('0x54')]=function(_0x5b8f7a,_0x4e2aad){if(_0x5b8f7a[_0x7196('0x32')]['apikey']){jwt[_0x7196('0x31')](_0x5b8f7a['query']['apikey'],config[_0x7196('0x9')]['session'],{'nonce':_0x4e2aad['apiKeyNonce'],'iat':_0x4e2aad['apiKeyIat'],'audience':hardwareConf[_0x7196('0x34')](),'issuer':hardwareConf['getUuid']()});return generateApiKey(_0x4e2aad);}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function createJwt(_0x28591e){return jwt[_0x7196('0x44')]({'iat':_0x28591e[_0x7196('0x4f')],'nonce':_0x28591e[_0x7196('0x37')]},config['secrets'][_0x7196('0x33')],{'algorithm':'HS512','subject':_0x28591e['id'][_0x7196('0x51')](),'issuer':hardwareConf[_0x7196('0x34')](),'audience':hardwareConf['getUuid']()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 5ca3c1b..e413d3d 100644 --- a/server/components/encryptor/index.js +++ b/server/components/encryptor/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['data','binary','end','final','write','close','unlink','decryptFile','createReadStream','createDecipher','update','crypto','bluebird','hasOwnProperty','encryptFile','createWriteStream','createCipher','algorithm'];(function(_0x163901,_0x256b16){var _0x2f10ed=function(_0x23a5c3){while(--_0x23a5c3){_0x163901['push'](_0x163901['shift']());}};_0x2f10ed(++_0x256b16);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var crypto=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x585166){var _0x4b72b0={};for(var _0x3ff8df in defaultOptions){if(defaultOptions[_0x0d8b('0x2')](_0x3ff8df)){_0x4b72b0[_0x3ff8df]=defaultOptions[_0x3ff8df];}}if(_0x585166){for(var _0x43bca1 in _0x585166){if(_0x585166[_0x0d8b('0x2')](_0x43bca1)){_0x4b72b0[_0x43bca1]=_0x585166[_0x43bca1];}}}return _0x4b72b0;}exports[_0x0d8b('0x3')]=function(_0x577834,_0x5e15e6,_0x3f8b6f,_0x227c63){return new BPromise(function(_0x39f43a,_0x4a4470){_0x227c63=combineOptions(_0x227c63);var _0x413284=new Buffer(_0x3f8b6f);var _0x284169=fs['createReadStream'](_0x577834);var _0x129310=fs[_0x0d8b('0x4')](_0x5e15e6);var _0x3b027f=crypto[_0x0d8b('0x5')](_0x227c63[_0x0d8b('0x6')],_0x413284);_0x284169['on'](_0x0d8b('0x7'),function(_0x2c5e9e){var _0x28f87c=new Buffer(_0x3b027f['update'](_0x2c5e9e),_0x0d8b('0x8'));_0x129310['write'](_0x28f87c);});_0x284169['on'](_0x0d8b('0x9'),function(){try{var _0xc574a3=new Buffer(_0x3b027f[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x129310[_0x0d8b('0xb')](_0xc574a3);_0x129310[_0x0d8b('0x9')]();_0x129310['on'](_0x0d8b('0xc'),function(){return _0x39f43a(_0x5e15e6);});}catch(_0x1d4bbc){fs[_0x0d8b('0xd')](_0x5e15e6);return _0x4a4470(_0x1d4bbc);}});});};exports[_0x0d8b('0xe')]=function(_0xe65334,_0x1567ce,_0x2d4e1c,_0x4f6f21){return new BPromise(function(_0x23eb7b,_0xa86349){_0x4f6f21=combineOptions(_0x4f6f21);var _0x17f7df=new Buffer(_0x2d4e1c);var _0xe2e167=fs[_0x0d8b('0xf')](_0xe65334);var _0x5cd485=fs[_0x0d8b('0x4')](_0x1567ce);var _0x4586c2=crypto[_0x0d8b('0x10')](_0x4f6f21[_0x0d8b('0x6')],_0x17f7df);_0xe2e167['on'](_0x0d8b('0x7'),function(_0x18dd2d){var _0x264b39=new Buffer(_0x4586c2[_0x0d8b('0x11')](_0x18dd2d),'binary');_0x5cd485[_0x0d8b('0xb')](_0x264b39);});_0xe2e167['on'](_0x0d8b('0x9'),function(){try{var _0x196c0a=new Buffer(_0x4586c2[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x5cd485[_0x0d8b('0xb')](_0x196c0a);_0x5cd485[_0x0d8b('0x9')]();_0x5cd485['on']('close',function(){return _0x23eb7b(_0x1567ce);});}catch(_0x4f0a1a){fs[_0x0d8b('0xd')](_0x1567ce);return _0xa86349(_0x4f0a1a);}});});}; \ No newline at end of file +var _0xa9e0=['update','close','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createCipher','algorithm','data','final','binary','write','end','unlink','decryptFile'];(function(_0x385cfa,_0xf2f5eb){var _0x5d076f=function(_0x9307f3){while(--_0x9307f3){_0x385cfa['push'](_0x385cfa['shift']());}};_0x5d076f(++_0xf2f5eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var crypto=require(_0x0a9e('0x0'));var fs=require('fs');var BPromise=require(_0x0a9e('0x1'));var defaultOptions={'algorithm':_0x0a9e('0x2')};function combineOptions(_0x5dd881){var _0x550fbc={};for(var _0x18d5c9 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x18d5c9)){_0x550fbc[_0x18d5c9]=defaultOptions[_0x18d5c9];}}if(_0x5dd881){for(var _0x333808 in _0x5dd881){if(_0x5dd881[_0x0a9e('0x3')](_0x333808)){_0x550fbc[_0x333808]=_0x5dd881[_0x333808];}}}return _0x550fbc;}exports[_0x0a9e('0x4')]=function(_0x991246,_0x981158,_0x57b080,_0x219af0){return new BPromise(function(_0x441e3a,_0x2cc193){_0x219af0=combineOptions(_0x219af0);var _0x5f41ea=new Buffer(_0x57b080);var _0x503809=fs[_0x0a9e('0x5')](_0x991246);var _0x56465b=fs['createWriteStream'](_0x981158);var _0x39753a=crypto[_0x0a9e('0x6')](_0x219af0[_0x0a9e('0x7')],_0x5f41ea);_0x503809['on'](_0x0a9e('0x8'),function(_0xfeb75b){var _0xbd1168=new Buffer(_0x39753a['update'](_0xfeb75b),'binary');_0x56465b['write'](_0xbd1168);});_0x503809['on']('end',function(){try{var _0x273d4d=new Buffer(_0x39753a[_0x0a9e('0x9')](_0x0a9e('0xa')),_0x0a9e('0xa'));_0x56465b[_0x0a9e('0xb')](_0x273d4d);_0x56465b[_0x0a9e('0xc')]();_0x56465b['on']('close',function(){return _0x441e3a(_0x981158);});}catch(_0x4283ce){fs[_0x0a9e('0xd')](_0x981158);return _0x2cc193(_0x4283ce);}});});};exports[_0x0a9e('0xe')]=function(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){_0x52a03d=combineOptions(_0x52a03d);var _0x1985b6=new Buffer(_0x4d5611);var _0x519dfd=fs[_0x0a9e('0x5')](_0x281129);var _0x12066b=fs['createWriteStream'](_0x44dcfd);var _0x225616=crypto['createDecipher'](_0x52a03d[_0x0a9e('0x7')],_0x1985b6);_0x519dfd['on'](_0x0a9e('0x8'),function(_0x106033){var _0x205fd6=new Buffer(_0x225616[_0x0a9e('0xf')](_0x106033),_0x0a9e('0xa'));_0x12066b[_0x0a9e('0xb')](_0x205fd6);});_0x519dfd['on'](_0x0a9e('0xc'),function(){try{var _0x1314ae=new Buffer(_0x225616[_0x0a9e('0x9')](_0x0a9e('0xa')),_0x0a9e('0xa'));_0x12066b['write'](_0x1314ae);_0x12066b[_0x0a9e('0xc')]();_0x12066b['on'](_0x0a9e('0x10'),function(){return _0x22dccb(_0x44dcfd);});}catch(_0x53682f){fs[_0x0a9e('0xd')](_0x44dcfd);return _0x5d0880(_0x53682f);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 089db3d..097bc79 100644 --- a/server/components/export/csv.js +++ b/server/components/export/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf109=['Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','path','lodash','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeCsv','then','query','sequelize','QueryTypes','num','length','SELECT','push','basename','.csv','join','mkdirSync','%s%d.%s','csv','%s.%s','writeFileSync'];(function(_0x148b70,_0x44643b){var _0x141e16=function(_0x20fd30){while(--_0x20fd30){_0x148b70['push'](_0x148b70['shift']());}};_0x141e16(++_0x44643b);}(_0xf109,0xce));var _0x9f10=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0xf109[_0xda464c];return _0x19e222;};'use strict';var util=require(_0x9f10('0x0'));var path=require(_0x9f10('0x1'));var _=require(_0x9f10('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x9f10('0x3'));var db=require(_0x9f10('0x4'))['db'];var dbH=require(_0x9f10('0x4'))[_0x9f10('0x5')];var logger=require(_0x9f10('0x6'))(_0x9f10('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x9f10('0x8')][0x2]);var QUERY=process[_0x9f10('0x8')][0x3];var PATH=process[_0x9f10('0x8')][0x4];function analyticExtractedReport(_0x2a877e,_0x3fd82f){var _0x5c8719={'status':_0x2a877e};var _0x42a8cd={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3fd82f){_0x5c8719[_0x9f10('0x9')]=_0x3fd82f;}return db[_0x9f10('0xa')][_0x9f10('0xb')](_0x5c8719,_0x42a8cd);}function main(){var _0x325f22=0x1388;var _0x5d5f53;logger[_0x9f10('0xc')](util[_0x9f10('0xd')](_0x9f10('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0x9f10('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9f10('0x10'),_0x9f10('0x11')]})['then'](function(_0x289164){if(_0x289164){_0x5d5f53=_0x289164;_0x325f22=_0x5d5f53[_0x9f10('0x11')]||0x1388;}})[_0x9f10('0x12')](function(){return dbH['sequelize'][_0x9f10('0x13')](util[_0x9f10('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x9f10('0x14')][_0x9f10('0x15')]['SELECT']});})['then'](function(_0x2b6c4c){if(!_0x2b6c4c[0x0][_0x9f10('0x16')]){return analyticExtractedReport('Empty');}var _0x11154b=[];var _0x5ae255=0x0;var _0x14d3fe=!![];if(_0x2b6c4c&&_0x2b6c4c[_0x9f10('0x17')]){var _0x4b1b8f=_0x2b6c4c[0x0][_0x9f10('0x16')]%(_0x5ae255+_0x325f22);if(_0x5d5f53[_0x9f10('0x10')]){for(;_0x14d3fe;_0x5ae255+=_0x325f22,_0x4b1b8f=_0x2b6c4c[0x0]['num']%(_0x5ae255+_0x325f22)){if(_0x4b1b8f==0x0||_0x4b1b8f==_0x2b6c4c[0x0][_0x9f10('0x16')]){_0x14d3fe=![];}_0x11154b['push'](dbH[_0x9f10('0x14')]['query'](util[_0x9f10('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x325f22,_0x5ae255),{'type':dbH['sequelize'][_0x9f10('0x15')][_0x9f10('0x18')]}));}}else{_0x11154b[_0x9f10('0x19')](dbH[_0x9f10('0x14')][_0x9f10('0x13')](QUERY,{'type':dbH[_0x9f10('0x14')][_0x9f10('0x15')]['SELECT']}));}}var _0x366044=path['dirname'](PATH);var _0x293990=path[_0x9f10('0x1a')](PATH,_0x9f10('0x1b'));var _0x4adbda=_0x5d5f53[_0x9f10('0x10')]&&_0x11154b[_0x9f10('0x17')]>0x1;var _0x213567=[];if(!fs['existsSync'](path[_0x9f10('0x1c')](_0x366044,_0x293990))&&_0x4adbda){fs[_0x9f10('0x1d')](path[_0x9f10('0x1c')](_0x366044,_0x293990));}return BPromise['each'](_0x11154b,function(_0x2ec07d){_0x213567[_0x9f10('0x19')](_0x2ec07d);})[_0x9f10('0x12')](function(){for(var _0x1647c0=0x0;_0x1647c0<_0x213567['length'];_0x1647c0+=0x1){var _0x57539b;var _0x5c1800=_0x213567[_0x1647c0];if(_0x4adbda){_0x57539b=path[_0x9f10('0x1c')](_0x366044,_0x293990,util['format'](_0x9f10('0x1e'),_0x293990,_0x1647c0,_0x9f10('0x1f')));}else{_0x57539b=path[_0x9f10('0x1c')](_0x366044,util[_0x9f10('0xd')](_0x9f10('0x20'),_0x293990,'csv'));}fs[_0x9f10('0x21')](_0x57539b,csv(_0x5c1800));}})[_0x9f10('0x12')](function(){if(_0x4adbda){zipdir(path[_0x9f10('0x1c')](_0x366044,_0x293990),{'saveTo':path[_0x9f10('0x1c')](_0x366044,util[_0x9f10('0xd')](_0x9f10('0x20'),_0x293990,'zip'))},function(_0x358d3f,_0x501ee){});rimraf(path[_0x9f10('0x1c')](_0x366044,_0x293990),function(){});}})[_0x9f10('0x12')](function(){logger['info'](util[_0x9f10('0xd')](_0x9f10('0x22'),EXTRACTED_REPORT_ID,_0x9f10('0x23')));return analyticExtractedReport('Completed',_0x4adbda?util[_0x9f10('0xd')]('%s.%s',_0x293990,_0x4adbda?_0x9f10('0x24'):_0x9f10('0x1f')):null);});})[_0x9f10('0x25')](function(_0x5944e5){logger[_0x9f10('0xc')](util[_0x9f10('0xd')](_0x9f10('0x26'),EXTRACTED_REPORT_ID,_0x9f10('0x23')),util[_0x9f10('0x27')](_0x5944e5,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0xcb91=['splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','join','each','push','%s%d.%s','csv','%s.%s','writeFileSync','CSV','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','to-csv','bluebird','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split'];(function(_0x2e3297,_0x52cf83){var _0x12a635=function(_0x3eb6c0){while(--_0x3eb6c0){_0x2e3297['push'](_0x2e3297['shift']());}};_0x12a635(++_0x52cf83);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0xcb91[_0x119b3e];return _0x1169ae;};'use strict';var util=require('util');var path=require('path');var _=require(_0x1cb9('0x0'));var csv=require(_0x1cb9('0x1'));var fs=require('fs');var BPromise=require(_0x1cb9('0x2'));var zipdir=require(_0x1cb9('0x3'));var rimraf=require('rimraf');var db=require(_0x1cb9('0x4'))['db'];var dbH=require(_0x1cb9('0x4'))['dbH'];var logger=require(_0x1cb9('0x5'))(_0x1cb9('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x1cb9('0x7')][0x3];var PATH=process[_0x1cb9('0x7')][0x4];function analyticExtractedReport(_0x4ffe20,_0x38737d){var _0x12567c={'status':_0x4ffe20};var _0x59d1be={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x38737d){_0x12567c[_0x1cb9('0x8')]=_0x38737d;}return db['AnalyticExtractedReport']['update'](_0x12567c,_0x59d1be);}function main(){var _0x45a12f=0x1388;var _0x2fa15c;logger[_0x1cb9('0x9')](util[_0x1cb9('0xa')](_0x1cb9('0xb'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x1cb9('0xc')][_0x1cb9('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1cb9('0xe'),_0x1cb9('0xf')]})[_0x1cb9('0x10')](function(_0x5445e1){if(_0x5445e1){_0x2fa15c=_0x5445e1;_0x45a12f=_0x2fa15c['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x1cb9('0x11')][_0x1cb9('0x12')](util[_0x1cb9('0xa')](_0x1cb9('0x13'),QUERY),{'type':dbH['sequelize'][_0x1cb9('0x14')][_0x1cb9('0x15')]});})[_0x1cb9('0x10')](function(_0x8dfa55){if(!_0x8dfa55[0x0][_0x1cb9('0x16')]){return analyticExtractedReport('Empty');}var _0x5572cb=[];var _0xd446a3=0x0;var _0x3cc765=!![];if(_0x8dfa55&&_0x8dfa55[_0x1cb9('0x17')]){var _0x3f1376=_0x8dfa55[0x0][_0x1cb9('0x16')]%(_0xd446a3+_0x45a12f);if(_0x2fa15c[_0x1cb9('0xe')]){for(;_0x3cc765;_0xd446a3+=_0x45a12f,_0x3f1376=_0x8dfa55[0x0][_0x1cb9('0x16')]%(_0xd446a3+_0x45a12f)){if(_0x3f1376==0x0||_0x3f1376==_0x8dfa55[0x0]['num']){_0x3cc765=![];}_0x5572cb['push'](dbH[_0x1cb9('0x11')][_0x1cb9('0x12')](util[_0x1cb9('0xa')](_0x1cb9('0x18'),QUERY,_0x45a12f,_0xd446a3),{'type':dbH[_0x1cb9('0x11')][_0x1cb9('0x14')][_0x1cb9('0x15')]}));}}else{_0x5572cb['push'](dbH['sequelize'][_0x1cb9('0x12')](QUERY,{'type':dbH['sequelize'][_0x1cb9('0x14')][_0x1cb9('0x15')]}));}}var _0x523b26=path['dirname'](PATH);var _0x2e3854=path[_0x1cb9('0x19')](PATH,_0x1cb9('0x1a'));var _0x4601b8=_0x2fa15c[_0x1cb9('0xe')]&&_0x5572cb[_0x1cb9('0x17')]>0x1;var _0x59ebea=[];if(!fs['existsSync'](path[_0x1cb9('0x1b')](_0x523b26,_0x2e3854))&&_0x4601b8){fs['mkdirSync'](path[_0x1cb9('0x1b')](_0x523b26,_0x2e3854));}return BPromise[_0x1cb9('0x1c')](_0x5572cb,function(_0x69b4c8){_0x59ebea[_0x1cb9('0x1d')](_0x69b4c8);})[_0x1cb9('0x10')](function(){for(var _0x53f9fa=0x0;_0x53f9fa<_0x59ebea[_0x1cb9('0x17')];_0x53f9fa+=0x1){var _0x9df250;var _0x4c8d76=_0x59ebea[_0x53f9fa];if(_0x4601b8){_0x9df250=path[_0x1cb9('0x1b')](_0x523b26,_0x2e3854,util[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x2e3854,_0x53f9fa,_0x1cb9('0x1f')));}else{_0x9df250=path[_0x1cb9('0x1b')](_0x523b26,util[_0x1cb9('0xa')](_0x1cb9('0x20'),_0x2e3854,_0x1cb9('0x1f')));}fs[_0x1cb9('0x21')](_0x9df250,csv(_0x4c8d76));}})[_0x1cb9('0x10')](function(){if(_0x4601b8){zipdir(path['join'](_0x523b26,_0x2e3854),{'saveTo':path[_0x1cb9('0x1b')](_0x523b26,util['format'](_0x1cb9('0x20'),_0x2e3854,'zip'))},function(_0x278327,_0x41011c){});rimraf(path[_0x1cb9('0x1b')](_0x523b26,_0x2e3854),function(){});}})[_0x1cb9('0x10')](function(){logger['info'](util[_0x1cb9('0xa')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x1cb9('0x22')));return analyticExtractedReport(_0x1cb9('0x23'),_0x4601b8?util[_0x1cb9('0xa')]('%s.%s',_0x2e3854,_0x4601b8?_0x1cb9('0x24'):'csv'):null);});})[_0x1cb9('0x25')](function(_0x58f4f5){logger[_0x1cb9('0x9')](util[_0x1cb9('0xa')](_0x1cb9('0x26'),EXTRACTED_REPORT_ID,_0x1cb9('0x22')),util['inspect'](_0x58f4f5,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x1cb9('0x27'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 8ad2179..d4de125 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x39dbc7,_0xb37e71){var _0x5ea546=function(_0x3ff5ed){while(--_0x3ff5ed){_0x39dbc7['push'](_0x39dbc7['shift']());}};_0x5ea546(++_0xb37e71);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e6c85,_0x59c747){_0x1e6c85=_0x1e6c85-0x0;var _0x16ec9b=_0xb10b[_0x1e6c85];return _0x16ec9b;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file +var _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x4f7547,_0x2924e1){var _0x15cdef=function(_0x534436){while(--_0x534436){_0x4f7547['push'](_0x4f7547['shift']());}};_0x15cdef(++_0x2924e1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 2f6b400..d0f8a46 100644 --- a/server/components/export/xlsx.js +++ b/server/components/export/xlsx.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e43=['find','split','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Empty','length','num','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','dirname','.xlsx','existsSync','join','mkdirSync','%s%d.%s','xlsx','%s.%s','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','savename','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e43,0x168));var _0x31e4=function(_0x54aea3,_0xae7d81){_0x54aea3=_0x54aea3-0x0;var _0x21ae46=_0x1e43[_0x54aea3];return _0x21ae46;};'use strict';var util=require(_0x31e4('0x0'));var path=require(_0x31e4('0x1'));var _=require(_0x31e4('0x2'));var fs=require('fs');var json2xls=require(_0x31e4('0x3'));var BPromise=require(_0x31e4('0x4'));var zipdir=require(_0x31e4('0x5'));var rimraf=require(_0x31e4('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x31e4('0x7'))[_0x31e4('0x8')];var logger=require('../../config/logger')(_0x31e4('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x551194,_0x17532f){var _0x17e452={'status':_0x551194};var _0x237aae={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17532f){_0x17e452[_0x31e4('0xa')]=_0x17532f;}return db['AnalyticExtractedReport'][_0x31e4('0xb')](_0x17e452,_0x237aae);}function main(){var _0x46debe=0x1388;var _0x5c2cbf;logger[_0x31e4('0xc')](util['format'](_0x31e4('0xd'),EXTRACTED_REPORT_ID,_0x31e4('0xe')));return db[_0x31e4('0xf')][_0x31e4('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x31e4('0x11'),_0x31e4('0x12')]})[_0x31e4('0x13')](function(_0x23c67e){if(_0x23c67e){_0x5c2cbf=_0x23c67e;_0x46debe=_0x5c2cbf[_0x31e4('0x12')]||0x1388;}})[_0x31e4('0x13')](function(){return dbH[_0x31e4('0x14')][_0x31e4('0x15')](util[_0x31e4('0x16')](_0x31e4('0x17'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x31e4('0x13')](function(_0x222164){if(!_0x222164[0x0]['num']){return analyticExtractedReport(_0x31e4('0x18'));}var _0x52e4cb=[];var _0x591f86=0x0;var _0x1e3c51=!![];if(_0x5c2cbf[_0x31e4('0x11')]){if(_0x222164&&_0x222164[_0x31e4('0x19')]){var _0x48319d=_0x222164[0x0][_0x31e4('0x1a')]%(_0x591f86+_0x46debe);for(;_0x1e3c51;_0x591f86+=_0x46debe,_0x48319d=_0x222164[0x0][_0x31e4('0x1a')]%(_0x591f86+_0x46debe)){if(_0x48319d==0x0||_0x48319d==_0x222164[0x0][_0x31e4('0x1a')]){_0x1e3c51=![];}_0x52e4cb['push'](dbH['sequelize'][_0x31e4('0x15')](util['format'](_0x31e4('0x1b'),QUERY,_0x46debe,_0x591f86),{'type':dbH[_0x31e4('0x14')][_0x31e4('0x1c')]['SELECT']}));}}}else{_0x52e4cb[_0x31e4('0x1d')](dbH[_0x31e4('0x14')][_0x31e4('0x15')](QUERY,{'type':dbH[_0x31e4('0x14')][_0x31e4('0x1c')][_0x31e4('0x1e')]}));}var _0xdafc73=path[_0x31e4('0x1f')](PATH);var _0x1872c8=path['basename'](PATH,_0x31e4('0x20'));var _0x192677=_0x5c2cbf[_0x31e4('0x11')]&&_0x52e4cb[_0x31e4('0x19')]>0x1;var _0x540d9e=[];if(!fs[_0x31e4('0x21')](path[_0x31e4('0x22')](_0xdafc73,_0x1872c8))&&_0x192677){fs[_0x31e4('0x23')](path['join'](_0xdafc73,_0x1872c8));}return BPromise['each'](_0x52e4cb,function(_0x13c584){_0x540d9e[_0x31e4('0x1d')](_0x13c584);})['then'](function(){for(var _0x4d98af=0x0;_0x4d98af<_0x540d9e['length'];_0x4d98af+=0x1){var _0x25d2df;var _0x58cf48=_0x540d9e[_0x4d98af];if(_0x192677){_0x25d2df=path[_0x31e4('0x22')](_0xdafc73,_0x1872c8,util[_0x31e4('0x16')](_0x31e4('0x24'),_0x1872c8,_0x4d98af,_0x31e4('0x25')));}else{_0x25d2df=path[_0x31e4('0x22')](_0xdafc73,util[_0x31e4('0x16')](_0x31e4('0x26'),_0x1872c8,_0x31e4('0x25')));}fs['writeFileSync'](_0x25d2df,json2xls(_0x58cf48),_0x31e4('0x27'));}})['then'](function(){if(_0x192677){zipdir(path[_0x31e4('0x22')](_0xdafc73,_0x1872c8),{'saveTo':path[_0x31e4('0x22')](_0xdafc73,util['format'](_0x31e4('0x26'),_0x1872c8,_0x31e4('0x28')))},function(_0x564ee6,_0x12996c){});rimraf(path[_0x31e4('0x22')](_0xdafc73,_0x1872c8),function(){});}})[_0x31e4('0x13')](function(){logger[_0x31e4('0xc')](util[_0x31e4('0x16')](_0x31e4('0x29'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x31e4('0x2a'),_0x192677?util['format'](_0x31e4('0x26'),_0x1872c8,_0x192677?'zip':_0x31e4('0x25')):null);});})[_0x31e4('0x2b')](function(_0x52389e){logger[_0x31e4('0xc')](util['format'](_0x31e4('0x2c'),EXTRACTED_REPORT_ID,_0x31e4('0xe')),util[_0x31e4('0x2d')](_0x52389e,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x31e4('0x2e'));});}main(); \ No newline at end of file +var _0x3b64=['then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','split','existsSync','join','mkdirSync','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','XLSX','splitSizeXlsx'];(function(_0x4f1b8c,_0x103cb4){var _0x4f6c44=function(_0x4ddb0b){while(--_0x4ddb0b){_0x4f1b8c['push'](_0x4f1b8c['shift']());}};_0x4f6c44(++_0x103cb4);}(_0x3b64,0x1bd));var _0x43b6=function(_0x3b0eed,_0x4d1bb7){_0x3b0eed=_0x3b0eed-0x0;var _0x5609d2=_0x3b64[_0x3b0eed];return _0x5609d2;};'use strict';var util=require(_0x43b6('0x0'));var path=require(_0x43b6('0x1'));var _=require(_0x43b6('0x2'));var fs=require('fs');var json2xls=require(_0x43b6('0x3'));var BPromise=require(_0x43b6('0x4'));var zipdir=require(_0x43b6('0x5'));var rimraf=require(_0x43b6('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x43b6('0x7'))['dbH'];var logger=require(_0x43b6('0x8'))(_0x43b6('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x43b6('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x43b6('0xa')][0x4];function analyticExtractedReport(_0x57ed7c,_0x85ae8c){var _0x5b4d59={'status':_0x57ed7c};var _0x2f2bc9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x85ae8c){_0x5b4d59[_0x43b6('0xb')]=_0x85ae8c;}return db[_0x43b6('0xc')]['update'](_0x5b4d59,_0x2f2bc9);}function main(){var _0x3bc214=0x1388;var _0x2b944a;logger[_0x43b6('0xd')](util[_0x43b6('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x43b6('0xf')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x43b6('0x10')]})['then'](function(_0x4e457c){if(_0x4e457c){_0x2b944a=_0x4e457c;_0x3bc214=_0x2b944a[_0x43b6('0x10')]||0x1388;}})[_0x43b6('0x11')](function(){return dbH[_0x43b6('0x12')][_0x43b6('0x13')](util['format'](_0x43b6('0x14'),QUERY),{'type':dbH['sequelize'][_0x43b6('0x15')][_0x43b6('0x16')]});})[_0x43b6('0x11')](function(_0x25f6f4){if(!_0x25f6f4[0x0]['num']){return analyticExtractedReport('Empty');}var _0xe0b1f2=[];var _0x148676=0x0;var _0x1bfb90=!![];if(_0x2b944a['split']){if(_0x25f6f4&&_0x25f6f4[_0x43b6('0x17')]){var _0x4c562b=_0x25f6f4[0x0]['num']%(_0x148676+_0x3bc214);for(;_0x1bfb90;_0x148676+=_0x3bc214,_0x4c562b=_0x25f6f4[0x0][_0x43b6('0x18')]%(_0x148676+_0x3bc214)){if(_0x4c562b==0x0||_0x4c562b==_0x25f6f4[0x0]['num']){_0x1bfb90=![];}_0xe0b1f2[_0x43b6('0x19')](dbH[_0x43b6('0x12')][_0x43b6('0x13')](util[_0x43b6('0xe')](_0x43b6('0x1a'),QUERY,_0x3bc214,_0x148676),{'type':dbH[_0x43b6('0x12')][_0x43b6('0x15')]['SELECT']}));}}}else{_0xe0b1f2[_0x43b6('0x19')](dbH['sequelize'][_0x43b6('0x13')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x43b6('0x16')]}));}var _0x528ec0=path[_0x43b6('0x1b')](PATH);var _0x311898=path['basename'](PATH,'.xlsx');var _0x8d32af=_0x2b944a[_0x43b6('0x1c')]&&_0xe0b1f2[_0x43b6('0x17')]>0x1;var _0x1d02cd=[];if(!fs[_0x43b6('0x1d')](path[_0x43b6('0x1e')](_0x528ec0,_0x311898))&&_0x8d32af){fs[_0x43b6('0x1f')](path[_0x43b6('0x1e')](_0x528ec0,_0x311898));}return BPromise['each'](_0xe0b1f2,function(_0x1807ef){_0x1d02cd[_0x43b6('0x19')](_0x1807ef);})[_0x43b6('0x11')](function(){for(var _0xb65012=0x0;_0xb65012<_0x1d02cd[_0x43b6('0x17')];_0xb65012+=0x1){var _0x121723;var _0x1dbf3e=_0x1d02cd[_0xb65012];if(_0x8d32af){_0x121723=path['join'](_0x528ec0,_0x311898,util['format'](_0x43b6('0x20'),_0x311898,_0xb65012,_0x43b6('0x21')));}else{_0x121723=path[_0x43b6('0x1e')](_0x528ec0,util[_0x43b6('0xe')]('%s.%s',_0x311898,'xlsx'));}fs[_0x43b6('0x22')](_0x121723,json2xls(_0x1dbf3e),_0x43b6('0x23'));}})[_0x43b6('0x11')](function(){if(_0x8d32af){zipdir(path[_0x43b6('0x1e')](_0x528ec0,_0x311898),{'saveTo':path[_0x43b6('0x1e')](_0x528ec0,util[_0x43b6('0xe')](_0x43b6('0x24'),_0x311898,_0x43b6('0x25')))},function(_0x424cd9,_0x20948f){});rimraf(path[_0x43b6('0x1e')](_0x528ec0,_0x311898),function(){});}})[_0x43b6('0x11')](function(){logger[_0x43b6('0xd')](util[_0x43b6('0xe')](_0x43b6('0x26'),EXTRACTED_REPORT_ID,_0x43b6('0xf')));return analyticExtractedReport(_0x43b6('0x27'),_0x8d32af?util[_0x43b6('0xe')]('%s.%s',_0x311898,_0x8d32af?_0x43b6('0x25'):_0x43b6('0x21')):null);});})[_0x43b6('0x28')](function(_0x3d0033){logger[_0x43b6('0xd')](util[_0x43b6('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x43b6('0xf')),util[_0x43b6('0x29')](_0x3d0033,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index a161aaf..c110e7f 100644 --- a/server/components/extensions/rewrite.js +++ b/server/components/extensions/rewrite.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c2e=['toLowerCase','createdAt','updatedAt','interval','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','VoiceExtension','destroy','bulkCreate','catch','rewrite','util','models','findAll','intervals','IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extension','find','extensions','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length'];(function(_0x2d37a6,_0x22914f){var _0x47bcb7=function(_0x214161){while(--_0x214161){_0x2d37a6['push'](_0x2d37a6['shift']());}};_0x47bcb7(++_0x22914f);}(_0x1c2e,0x186));var _0xe1c2=function(_0x31e380,_0x69b651){_0x31e380=_0x31e380-0x0;var _0x1f18a8=_0x1c2e[_0x31e380];return _0x1f18a8;};'use strict';var _=require('lodash');var util=require(_0xe1c2('0x0'));function rewrite(_0x2e7af0,_0x4bc1f9){var _0x1ec5c3=this;return _0x2e7af0[_0xe1c2('0x1')]['Interval'][_0xe1c2('0x2')]({'raw':!![]})['then'](function(_0xb769b3){_0x1ec5c3[_0xe1c2('0x3')]=_0xb769b3;return _0x2e7af0['models']['VoiceExtension'][_0xe1c2('0x2')]({'where':{'IntervalId':_0x4bc1f9[_0xe1c2('0x4')]},'raw':!![]});})[_0xe1c2('0x5')](function(_0x49fbff){return _0x2e7af0['models']['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0xe1c2('0x6')](_[_0xe1c2('0x7')](_0x49fbff,_0xe1c2('0x8')))}},'order':[{'raw':_0xe1c2('0x9')}],'raw':!![]});})[_0xe1c2('0x5')](function(_0x80db51){var _0x5ef8b8=_[_0xe1c2('0xa')](_0x80db51,{'priority':'1'});var _0x2f8f11=_[_0xe1c2('0xa')](_0x80db51,{'isApp':0x1});var _0x378413=_[_0xe1c2('0xb')](_0x2f8f11,_0xe1c2('0x8'));var _0x1dfdac=[_0xe1c2('0xc'),_0xe1c2('0xd')];var _0x4505c2=[];var _0x30a257=[];for(var _0x5ec6b9 in _0x378413){if(_0x378413[_0xe1c2('0xe')](_0x5ec6b9)){_0x1ec5c3[_0xe1c2('0xf')]=0x2;_0x1ec5c3['extensions']=[];_0x1ec5c3[_0xe1c2('0x10')]=_[_0xe1c2('0x11')](_0x5ef8b8,{'exten':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x8')]});_0x1ec5c3[_0xe1c2('0x12')][_0xe1c2('0x13')]({'type':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x14')],'app':_0xe1c2('0x15'),'appdata':util['format'](_0xe1c2('0x16'),_0x378413[_0x5ec6b9][0x0]['type']),'context':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x17')],'exten':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x8')],'priority':_0x1ec5c3['priority']++,'VoiceExtensionId':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x18')]});if(_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x14')]==='outbound'){if(_0x1ec5c3[_0xe1c2('0x10')]){_0x1ec5c3[_0xe1c2('0x12')][_0xe1c2('0x13')]({'type':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x14')],'app':'Set','appdata':_0xe1c2('0x19')+(_0x1ec5c3['extension'][_0xe1c2('0x1a')]?_0xe1c2('0x1b')+_0x1ec5c3[_0xe1c2('0x10')][_0xe1c2('0x1a')]+'}':'${EXTEN}'),'context':_0x378413[_0x5ec6b9][0x0]['context'],'exten':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x8')],'priority':_0x1ec5c3['priority']++,'VoiceExtensionId':_0x378413[_0x5ec6b9][0x0]['VoiceExtensionId']});}_0x1ec5c3[_0xe1c2('0x12')][_0xe1c2('0x13')]({'type':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x14')],'app':_0xe1c2('0x15'),'appdata':_0xe1c2('0x1c')+_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x18')],'context':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x17')],'exten':_0x378413[_0x5ec6b9][0x0]['exten'],'priority':_0x1ec5c3['priority']++,'VoiceExtensionId':_0x378413[_0x5ec6b9][0x0]['VoiceExtensionId']});var _0x4e83aa=_0x1ec5c3['priority']++;_0x1ec5c3[_0xe1c2('0x12')]['push']({'type':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x14')],'app':_0xe1c2('0x1d'),'appdata':_0xe1c2('0x1e')+(_0x4e83aa+0x2)+_0xe1c2('0x1f')+(_0x4e83aa+0x1)+')','context':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x17')],'exten':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x8')],'priority':_0x4e83aa,'VoiceExtensionId':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x18')]});if(_0x1ec5c3[_0xe1c2('0x10')]){_0x1ec5c3[_0xe1c2('0x12')][_0xe1c2('0x13')]({'type':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x14')],'app':_0xe1c2('0x15'),'appdata':_0x1ec5c3[_0xe1c2('0x10')][_0xe1c2('0x1a')]?_0xe1c2('0x20')+_0x1ec5c3['extension'][_0xe1c2('0x1a')]+'}':_0xe1c2('0x21'),'context':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x17')],'exten':_0x378413[_0x5ec6b9][0x0]['exten'],'priority':_0x1ec5c3[_0xe1c2('0xf')]++,'VoiceExtensionId':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x18')]});}_0x1ec5c3['extensions'][_0xe1c2('0x13')]({'type':_0x378413[_0x5ec6b9][0x0]['type'],'app':_0xe1c2('0x15'),'appdata':_0xe1c2('0x22')+_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x18')],'context':_0x378413[_0x5ec6b9][0x0]['context'],'exten':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x8')],'priority':_0x1ec5c3[_0xe1c2('0xf')]++,'VoiceExtensionId':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x18')]});if(_0x1ec5c3[_0xe1c2('0x10')]&&_0x1ec5c3[_0xe1c2('0x10')][_0xe1c2('0xe')](_0xe1c2('0x23'))&&_0x1ec5c3['extension'][_0xe1c2('0x23')]!==_0xe1c2('0x24')){_0x1ec5c3['extensions']['push']({'type':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x14')],'app':_0xe1c2('0x15'),'appdata':_0xe1c2('0x25'),'context':_0x378413[_0x5ec6b9][0x0]['context'],'exten':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x8')],'priority':_0x1ec5c3['priority']++,'VoiceExtensionId':_0x378413[_0x5ec6b9][0x0]['VoiceExtensionId']});_0x1ec5c3['extensions'][_0xe1c2('0x13')]({'type':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x14')],'app':_0xe1c2('0x15'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1ec5c3[_0xe1c2('0x10')][_0xe1c2('0x23')]||'wav','context':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x17')],'exten':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x8')],'priority':_0x1ec5c3[_0xe1c2('0xf')]++,'VoiceExtensionId':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x18')]});}}_0x1ec5c3[_0xe1c2('0x12')][_0xe1c2('0x13')]({'type':_0x378413[_0x5ec6b9][0x0]['type'],'app':'Set','appdata':_0xe1c2('0x26'),'context':_0x378413[_0x5ec6b9][0x0]['context'],'exten':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x8')],'priority':_0x1ec5c3[_0xe1c2('0xf')]++,'VoiceExtensionId':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x18')]});_0x1ec5c3[_0xe1c2('0x12')][_0xe1c2('0x13')]({'type':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x14')],'app':_0xe1c2('0x15'),'appdata':_0xe1c2('0x27'),'context':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x17')],'exten':_0x378413[_0x5ec6b9][0x0]['exten'],'priority':_0x1ec5c3['priority']++,'VoiceExtensionId':_0x378413[_0x5ec6b9][0x0]['VoiceExtensionId']});_0x1ec5c3[_0xe1c2('0x12')][_0xe1c2('0x13')]({'type':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x14')],'app':_0xe1c2('0x15'),'appdata':_0xe1c2('0x28'),'context':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x17')],'exten':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x8')],'priority':_0x1ec5c3[_0xe1c2('0xf')]++,'VoiceExtensionId':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x18')]});for(var _0x2f3e28=0x0,_0x1f9a65=0x0;_0x2f3e28<_0x378413[_0x5ec6b9][_0xe1c2('0x29')];_0x2f3e28+=0x1,_0x1f9a65=0x0){var _0x5dc831=_0x378413[_0x5ec6b9][_0x2f3e28];if(_0x5dc831[_0xe1c2('0x14')]){_0x5dc831[_0xe1c2('0x14')]=_0x5dc831[_0xe1c2('0x14')][_0xe1c2('0x2a')]();}var _0x33bb49=[];var _0x37d59f=[];delete _0x5dc831['id'];delete _0x5dc831[_0xe1c2('0x2b')];delete _0x5dc831[_0xe1c2('0x2c')];var _0x28aba4=_0x5dc831[_0xe1c2('0x2d')]!=='*,*,*,*'?[_0x5dc831[_0xe1c2('0x2d')]]:_0x5dc831[_0xe1c2('0x4')]?_[_0xe1c2('0x7')](_[_0xe1c2('0xa')](_0x1ec5c3[_0xe1c2('0x3')],{'IntervalId':_0x5dc831[_0xe1c2('0x4')]}),_0xe1c2('0x2d')):[];if(_0x5dc831['hasOwnProperty'](_0xe1c2('0x2e'))){if(_0x5dc831[_0xe1c2('0x2e')]&&_0x5dc831[_0xe1c2('0x2e')]!=='--'){_0x33bb49['push']({'type':_0x5dc831[_0xe1c2('0x14')],'app':'Set','appdata':_0xe1c2('0x2f')+_0x5dc831[_0xe1c2('0x2e')],'context':_0x5dc831[_0xe1c2('0x17')],'exten':_0x5dc831['exten'],'priority':_0x28aba4[_0xe1c2('0x29')]+_0x1ec5c3[_0xe1c2('0xf')]+_0x1f9a65++,'VoiceExtensionId':_0x5dc831[_0xe1c2('0x18')]});}}if(_0x5dc831[_0xe1c2('0x14')]===_0xe1c2('0x30')&&_0x5dc831[_0xe1c2('0xe')](_0xe1c2('0x31'))){if(_0x5dc831[_0xe1c2('0x31')]){_0x33bb49[_0xe1c2('0x13')]({'type':_0x5dc831[_0xe1c2('0x14')],'app':'ExecIf','appdata':_0xe1c2('0x32')+_0x5dc831[_0xe1c2('0x31')]+')','context':_0x5dc831[_0xe1c2('0x17')],'exten':_0x5dc831[_0xe1c2('0x8')],'priority':_0x28aba4['length']+_0x1ec5c3[_0xe1c2('0xf')]+_0x1f9a65++,'VoiceExtensionId':_0x5dc831[_0xe1c2('0x18')]});}else{_0x33bb49[_0xe1c2('0x13')]({'type':_0x5dc831[_0xe1c2('0x14')],'app':_0xe1c2('0x1d'),'appdata':_0xe1c2('0x33'),'context':_0x5dc831[_0xe1c2('0x17')],'exten':_0x5dc831[_0xe1c2('0x8')],'priority':_0x28aba4[_0xe1c2('0x29')]+_0x1ec5c3[_0xe1c2('0xf')]+_0x1f9a65++,'VoiceExtensionId':_0x5dc831[_0xe1c2('0x18')]});}}if(_0x5dc831[_0xe1c2('0xe')](_0xe1c2('0x34'))){if(_0x1dfdac[_0xe1c2('0x35')](_0x5dc831[_0xe1c2('0x36')][_0xe1c2('0x2a')]())>=0x0&&_0x5dc831[_0xe1c2('0x37')]!==_0xe1c2('0x38')){if(_0x5dc831[_0xe1c2('0x34')]){_0x33bb49[_0xe1c2('0x13')]({'type':_0x5dc831['type'],'app':_0xe1c2('0x1d'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5dc831['context'],'exten':_0x5dc831[_0xe1c2('0x8')],'priority':_0x28aba4[_0xe1c2('0x29')]+_0x1ec5c3[_0xe1c2('0xf')]+_0x1f9a65++,'VoiceExtensionId':_0x5dc831[_0xe1c2('0x18')]});_0x33bb49['push']({'type':_0x5dc831[_0xe1c2('0x14')],'app':'Set','appdata':_0xe1c2('0x39'),'context':_0x5dc831['context'],'exten':_0x5dc831[_0xe1c2('0x8')],'priority':_0x28aba4[_0xe1c2('0x29')]+_0x1ec5c3[_0xe1c2('0xf')]+_0x1f9a65++,'VoiceExtensionId':_0x5dc831[_0xe1c2('0x18')]});}else{_0x33bb49[_0xe1c2('0x13')]({'type':_0x5dc831[_0xe1c2('0x14')],'app':_0xe1c2('0x1d'),'appdata':_0xe1c2('0x3a'),'context':_0x5dc831[_0xe1c2('0x17')],'exten':_0x5dc831[_0xe1c2('0x8')],'priority':_0x28aba4[_0xe1c2('0x29')]+_0x1ec5c3[_0xe1c2('0xf')]+_0x1f9a65++,'VoiceExtensionId':_0x5dc831[_0xe1c2('0x18')]});_0x33bb49[_0xe1c2('0x13')]({'type':_0x5dc831[_0xe1c2('0x14')],'app':_0xe1c2('0x15'),'appdata':_0xe1c2('0x3b'),'context':_0x5dc831[_0xe1c2('0x17')],'exten':_0x5dc831[_0xe1c2('0x8')],'priority':_0x28aba4[_0xe1c2('0x29')]+_0x1ec5c3[_0xe1c2('0xf')]+_0x1f9a65++,'VoiceExtensionId':_0x5dc831[_0xe1c2('0x18')]});}}}for(var _0x2b2fac=0x0;_0x2b2fac<_0x28aba4[_0xe1c2('0x29')];_0x2b2fac+=0x1){var _0x5bc8c2=_0x1ec5c3[_0xe1c2('0xf')]+_0x28aba4[_0xe1c2('0x29')];var _0x2da583=_0x2b2fac===_0x28aba4[_0xe1c2('0x29')]-0x1?_0x1ec5c3['priority']+_0x33bb49[_0xe1c2('0x29')]+_0x37d59f[_0xe1c2('0x29')]+0x2:_0x1ec5c3[_0xe1c2('0xf')]+_0x2b2fac+0x1;_0x33bb49[_0xe1c2('0x3c')](_0x2b2fac,0x0,{'type':_0x5dc831[_0xe1c2('0x14')],'app':_0xe1c2('0x3d'),'appdata':_0x28aba4[_0x2b2fac]+'?'+_0x5dc831[_0xe1c2('0x17')]+_0xe1c2('0x3e')+_0x5bc8c2+':'+_0x5dc831[_0xe1c2('0x17')]+_0xe1c2('0x3e')+_0x2da583,'exten':_0x5dc831['exten'],'context':_0x5dc831[_0xe1c2('0x17')],'priority':_0x1ec5c3[_0xe1c2('0xf')]+_0x2b2fac,'VoiceExtensionId':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x18')]});}_0x5dc831[_0xe1c2('0xf')]=_0x33bb49[_0xe1c2('0x29')]?_[_0xe1c2('0x3f')](_0x33bb49)[_0xe1c2('0xf')]+0x1:_0x1ec5c3[_0xe1c2('0xf')];_0x1ec5c3[_0xe1c2('0xf')]=(_0x37d59f[_0xe1c2('0x29')]?_[_0xe1c2('0x3f')](_0x37d59f)['priority']:_0x5dc831['priority'])+0x1;_0x1ec5c3[_0xe1c2('0x12')]=_['concat'](_0x1ec5c3[_0xe1c2('0x12')],_0x33bb49,[_0x5dc831],_0x37d59f);}_0x1ec5c3[_0xe1c2('0x12')]['push']({'type':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x14')],'app':_0xe1c2('0x40'),'exten':_0x378413[_0x5ec6b9][0x0]['exten'],'context':_0x378413[_0x5ec6b9][0x0]['context'],'priority':_0x1ec5c3[_0xe1c2('0xf')],'VoiceExtensionId':_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x18')]});_0x4505c2[_0xe1c2('0x13')](_0x378413[_0x5ec6b9][0x0][_0xe1c2('0x18')]);_0x30a257=_[_0xe1c2('0x41')](_0x30a257,_0x1ec5c3[_0xe1c2('0x12')]);}}return _0x2e7af0[_0xe1c2('0x42')](function(_0x22d996){return _0x2e7af0[_0xe1c2('0x1')][_0xe1c2('0x43')][_0xe1c2('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x4505c2}},'transaction':_0x22d996})['then'](function(_0x30106e){return _0x2e7af0[_0xe1c2('0x1')][_0xe1c2('0x43')][_0xe1c2('0x45')](_['sortBy'](_0x30a257,_0xe1c2('0xf')),{'transaction':_0x22d996});});});})[_0xe1c2('0x46')](function(_0x1d8798){console['error'](_0x1d8798);});}exports[_0xe1c2('0x47')]=rewrite; \ No newline at end of file +var _0x1e1a=['none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','toLowerCase','appType','custom','answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','bulkCreate','sortBy','catch','error','rewrite','util','models','findAll','then','intervals','IntervalId','VoiceExtension','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','playback','priority','extension','extensions','Set','CDR(type)=%s','context','VoiceExtensionId','outbound','push','type','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat'];(function(_0x361ddd,_0x503739){var _0x3a92da=function(_0x439b0e){while(--_0x439b0e){_0x361ddd['push'](_0x361ddd['shift']());}};_0x3a92da(++_0x503739);}(_0x1e1a,0x175));var _0xa1e1=function(_0x1ea25e,_0x56ac18){_0x1ea25e=_0x1ea25e-0x0;var _0x2a6203=_0x1e1a[_0x1ea25e];return _0x2a6203;};'use strict';var _=require('lodash');var util=require(_0xa1e1('0x0'));function rewrite(_0x99c800,_0x111222){var _0xf9c59b=this;return _0x99c800[_0xa1e1('0x1')]['Interval'][_0xa1e1('0x2')]({'raw':!![]})[_0xa1e1('0x3')](function(_0x23e873){_0xf9c59b[_0xa1e1('0x4')]=_0x23e873;return _0x99c800[_0xa1e1('0x1')]['VoiceExtension'][_0xa1e1('0x2')]({'where':{'IntervalId':_0x111222[_0xa1e1('0x5')]},'raw':!![]});})[_0xa1e1('0x3')](function(_0x546bbc){return _0x99c800[_0xa1e1('0x1')][_0xa1e1('0x6')][_0xa1e1('0x2')]({'where':{'exten':{'$in':_['uniq'](_[_0xa1e1('0x7')](_0x546bbc,'exten'))}},'order':[{'raw':_0xa1e1('0x8')}],'raw':!![]});})['then'](function(_0x21dc33){var _0x532b8e=_[_0xa1e1('0x9')](_0x21dc33,{'priority':'1'});var _0x171b4e=_[_0xa1e1('0x9')](_0x21dc33,{'isApp':0x1});var _0x4ee2e6=_[_0xa1e1('0xa')](_0x171b4e,_0xa1e1('0xb'));var _0x2d5533=['queue',_0xa1e1('0xc')];var _0x2b6cd7=[];var _0x8f77f7=[];for(var _0x5bd9d0 in _0x4ee2e6){if(_0x4ee2e6['hasOwnProperty'](_0x5bd9d0)){_0xf9c59b[_0xa1e1('0xd')]=0x2;_0xf9c59b['extensions']=[];_0xf9c59b[_0xa1e1('0xe')]=_['find'](_0x532b8e,{'exten':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0xb')]});_0xf9c59b[_0xa1e1('0xf')]['push']({'type':_0x4ee2e6[_0x5bd9d0][0x0]['type'],'app':_0xa1e1('0x10'),'appdata':util['format'](_0xa1e1('0x11'),_0x4ee2e6[_0x5bd9d0][0x0]['type']),'context':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x12')],'exten':_0x4ee2e6[_0x5bd9d0][0x0]['exten'],'priority':_0xf9c59b[_0xa1e1('0xd')]++,'VoiceExtensionId':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x13')]});if(_0x4ee2e6[_0x5bd9d0][0x0]['type']===_0xa1e1('0x14')){if(_0xf9c59b['extension']){_0xf9c59b[_0xa1e1('0xf')][_0xa1e1('0x15')]({'type':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x16')],'app':_0xa1e1('0x10'),'appdata':_0xa1e1('0x17')+(_0xf9c59b[_0xa1e1('0xe')][_0xa1e1('0x18')]?_0xa1e1('0x19')+_0xf9c59b[_0xa1e1('0xe')][_0xa1e1('0x18')]+'}':_0xa1e1('0x1a')),'context':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x12')],'exten':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0xb')],'priority':_0xf9c59b[_0xa1e1('0xd')]++,'VoiceExtensionId':_0x4ee2e6[_0x5bd9d0][0x0]['VoiceExtensionId']});}_0xf9c59b[_0xa1e1('0xf')][_0xa1e1('0x15')]({'type':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x16')],'app':_0xa1e1('0x10'),'appdata':_0xa1e1('0x1b')+_0x4ee2e6[_0x5bd9d0][0x0]['VoiceExtensionId'],'context':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x12')],'exten':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0xb')],'priority':_0xf9c59b[_0xa1e1('0xd')]++,'VoiceExtensionId':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x13')]});var _0x110bce=_0xf9c59b['priority']++;_0xf9c59b[_0xa1e1('0xf')][_0xa1e1('0x15')]({'type':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x16')],'app':_0xa1e1('0x1c'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x110bce+0x2)+_0xa1e1('0x1d')+(_0x110bce+0x1)+')','context':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x12')],'exten':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0xb')],'priority':_0x110bce,'VoiceExtensionId':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x13')]});if(_0xf9c59b[_0xa1e1('0xe')]){_0xf9c59b['extensions']['push']({'type':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x16')],'app':_0xa1e1('0x10'),'appdata':_0xf9c59b[_0xa1e1('0xe')]['cutdigits']?_0xa1e1('0x1e')+_0xf9c59b[_0xa1e1('0xe')]['cutdigits']+'}':_0xa1e1('0x1f'),'context':_0x4ee2e6[_0x5bd9d0][0x0]['context'],'exten':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0xb')],'priority':_0xf9c59b[_0xa1e1('0xd')]++,'VoiceExtensionId':_0x4ee2e6[_0x5bd9d0][0x0]['VoiceExtensionId']});}_0xf9c59b[_0xa1e1('0xf')][_0xa1e1('0x15')]({'type':_0x4ee2e6[_0x5bd9d0][0x0]['type'],'app':_0xa1e1('0x10'),'appdata':_0xa1e1('0x20')+_0x4ee2e6[_0x5bd9d0][0x0]['VoiceExtensionId'],'context':_0x4ee2e6[_0x5bd9d0][0x0]['context'],'exten':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0xb')],'priority':_0xf9c59b[_0xa1e1('0xd')]++,'VoiceExtensionId':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x13')]});if(_0xf9c59b[_0xa1e1('0xe')]&&_0xf9c59b['extension'][_0xa1e1('0x21')](_0xa1e1('0x22'))&&_0xf9c59b[_0xa1e1('0xe')][_0xa1e1('0x22')]!==_0xa1e1('0x23')){_0xf9c59b['extensions'][_0xa1e1('0x15')]({'type':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x16')],'app':_0xa1e1('0x10'),'appdata':_0xa1e1('0x24'),'context':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x12')],'exten':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0xb')],'priority':_0xf9c59b[_0xa1e1('0xd')]++,'VoiceExtensionId':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x13')]});_0xf9c59b[_0xa1e1('0xf')][_0xa1e1('0x15')]({'type':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x16')],'app':_0xa1e1('0x10'),'appdata':_0xa1e1('0x25')+_0xf9c59b[_0xa1e1('0xe')][_0xa1e1('0x22')]||'wav','context':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x12')],'exten':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0xb')],'priority':_0xf9c59b[_0xa1e1('0xd')]++,'VoiceExtensionId':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x13')]});}}_0xf9c59b[_0xa1e1('0xf')][_0xa1e1('0x15')]({'type':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x16')],'app':_0xa1e1('0x10'),'appdata':_0xa1e1('0x26'),'context':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x12')],'exten':_0x4ee2e6[_0x5bd9d0][0x0]['exten'],'priority':_0xf9c59b[_0xa1e1('0xd')]++,'VoiceExtensionId':_0x4ee2e6[_0x5bd9d0][0x0]['VoiceExtensionId']});_0xf9c59b[_0xa1e1('0xf')][_0xa1e1('0x15')]({'type':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x16')],'app':_0xa1e1('0x10'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x12')],'exten':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0xb')],'priority':_0xf9c59b[_0xa1e1('0xd')]++,'VoiceExtensionId':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x13')]});_0xf9c59b[_0xa1e1('0xf')][_0xa1e1('0x15')]({'type':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x16')],'app':'Set','appdata':_0xa1e1('0x27'),'context':_0x4ee2e6[_0x5bd9d0][0x0]['context'],'exten':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0xb')],'priority':_0xf9c59b[_0xa1e1('0xd')]++,'VoiceExtensionId':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x13')]});for(var _0x5bb396=0x0,_0x22d9ba=0x0;_0x5bb396<_0x4ee2e6[_0x5bd9d0][_0xa1e1('0x28')];_0x5bb396+=0x1,_0x22d9ba=0x0){var _0x10f083=_0x4ee2e6[_0x5bd9d0][_0x5bb396];if(_0x10f083[_0xa1e1('0x16')]){_0x10f083[_0xa1e1('0x16')]=_0x10f083[_0xa1e1('0x16')]['toLowerCase']();}var _0x1d62b7=[];var _0x59ef7a=[];delete _0x10f083['id'];delete _0x10f083['createdAt'];delete _0x10f083[_0xa1e1('0x29')];var _0x3e8652=_0x10f083[_0xa1e1('0x2a')]!==_0xa1e1('0x2b')?[_0x10f083['interval']]:_0x10f083[_0xa1e1('0x5')]?_[_0xa1e1('0x7')](_[_0xa1e1('0x9')](_0xf9c59b[_0xa1e1('0x4')],{'IntervalId':_0x10f083[_0xa1e1('0x5')]}),_0xa1e1('0x2a')):[];if(_0x10f083['hasOwnProperty'](_0xa1e1('0x2c'))){if(_0x10f083['tag']&&_0x10f083[_0xa1e1('0x2c')]!=='--'){_0x1d62b7['push']({'type':_0x10f083[_0xa1e1('0x16')],'app':_0xa1e1('0x10'),'appdata':_0xa1e1('0x2d')+_0x10f083[_0xa1e1('0x2c')],'context':_0x10f083[_0xa1e1('0x12')],'exten':_0x10f083[_0xa1e1('0xb')],'priority':_0x3e8652[_0xa1e1('0x28')]+_0xf9c59b[_0xa1e1('0xd')]+_0x22d9ba++,'VoiceExtensionId':_0x10f083[_0xa1e1('0x13')]});}}if(_0x10f083[_0xa1e1('0x16')]===_0xa1e1('0x14')&&_0x10f083['hasOwnProperty'](_0xa1e1('0x2e'))){if(_0x10f083[_0xa1e1('0x2e')]){_0x1d62b7[_0xa1e1('0x15')]({'type':_0x10f083[_0xa1e1('0x16')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x10f083[_0xa1e1('0x2e')]+')','context':_0x10f083[_0xa1e1('0x12')],'exten':_0x10f083[_0xa1e1('0xb')],'priority':_0x3e8652[_0xa1e1('0x28')]+_0xf9c59b['priority']+_0x22d9ba++,'VoiceExtensionId':_0x10f083['VoiceExtensionId']});}else{_0x1d62b7[_0xa1e1('0x15')]({'type':_0x10f083[_0xa1e1('0x16')],'app':_0xa1e1('0x1c'),'appdata':_0xa1e1('0x2f'),'context':_0x10f083[_0xa1e1('0x12')],'exten':_0x10f083[_0xa1e1('0xb')],'priority':_0x3e8652['length']+_0xf9c59b[_0xa1e1('0xd')]+_0x22d9ba++,'VoiceExtensionId':_0x10f083[_0xa1e1('0x13')]});}}if(_0x10f083[_0xa1e1('0x21')]('answer')){if(_0x2d5533[_0xa1e1('0x30')](_0x10f083[_0xa1e1('0x31')][_0xa1e1('0x32')]())>=0x0&&_0x10f083[_0xa1e1('0x33')]!==_0xa1e1('0x34')){if(_0x10f083[_0xa1e1('0x35')]){_0x1d62b7[_0xa1e1('0x15')]({'type':_0x10f083[_0xa1e1('0x16')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x10f083['context'],'exten':_0x10f083['exten'],'priority':_0x3e8652[_0xa1e1('0x28')]+_0xf9c59b[_0xa1e1('0xd')]+_0x22d9ba++,'VoiceExtensionId':_0x10f083[_0xa1e1('0x13')]});_0x1d62b7['push']({'type':_0x10f083[_0xa1e1('0x16')],'app':_0xa1e1('0x10'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x10f083[_0xa1e1('0x12')],'exten':_0x10f083[_0xa1e1('0xb')],'priority':_0x3e8652[_0xa1e1('0x28')]+_0xf9c59b[_0xa1e1('0xd')]+_0x22d9ba++,'VoiceExtensionId':_0x10f083['VoiceExtensionId']});}else{_0x1d62b7['push']({'type':_0x10f083[_0xa1e1('0x16')],'app':_0xa1e1('0x1c'),'appdata':_0xa1e1('0x36'),'context':_0x10f083[_0xa1e1('0x12')],'exten':_0x10f083[_0xa1e1('0xb')],'priority':_0x3e8652['length']+_0xf9c59b['priority']+_0x22d9ba++,'VoiceExtensionId':_0x10f083[_0xa1e1('0x13')]});_0x1d62b7[_0xa1e1('0x15')]({'type':_0x10f083['type'],'app':_0xa1e1('0x10'),'appdata':_0xa1e1('0x37'),'context':_0x10f083[_0xa1e1('0x12')],'exten':_0x10f083['exten'],'priority':_0x3e8652[_0xa1e1('0x28')]+_0xf9c59b[_0xa1e1('0xd')]+_0x22d9ba++,'VoiceExtensionId':_0x10f083['VoiceExtensionId']});}}}for(var _0x3d9b60=0x0;_0x3d9b60<_0x3e8652[_0xa1e1('0x28')];_0x3d9b60+=0x1){var _0x374e9c=_0xf9c59b[_0xa1e1('0xd')]+_0x3e8652['length'];var _0x169048=_0x3d9b60===_0x3e8652['length']-0x1?_0xf9c59b['priority']+_0x1d62b7[_0xa1e1('0x28')]+_0x59ef7a[_0xa1e1('0x28')]+0x2:_0xf9c59b[_0xa1e1('0xd')]+_0x3d9b60+0x1;_0x1d62b7[_0xa1e1('0x38')](_0x3d9b60,0x0,{'type':_0x10f083[_0xa1e1('0x16')],'app':_0xa1e1('0x39'),'appdata':_0x3e8652[_0x3d9b60]+'?'+_0x10f083[_0xa1e1('0x12')]+',${EXTEN},'+_0x374e9c+':'+_0x10f083['context']+_0xa1e1('0x3a')+_0x169048,'exten':_0x10f083['exten'],'context':_0x10f083[_0xa1e1('0x12')],'priority':_0xf9c59b[_0xa1e1('0xd')]+_0x3d9b60,'VoiceExtensionId':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x13')]});}_0x10f083[_0xa1e1('0xd')]=_0x1d62b7[_0xa1e1('0x28')]?_[_0xa1e1('0x3b')](_0x1d62b7)[_0xa1e1('0xd')]+0x1:_0xf9c59b[_0xa1e1('0xd')];_0xf9c59b[_0xa1e1('0xd')]=(_0x59ef7a[_0xa1e1('0x28')]?_[_0xa1e1('0x3b')](_0x59ef7a)[_0xa1e1('0xd')]:_0x10f083[_0xa1e1('0xd')])+0x1;_0xf9c59b[_0xa1e1('0xf')]=_['concat'](_0xf9c59b[_0xa1e1('0xf')],_0x1d62b7,[_0x10f083],_0x59ef7a);}_0xf9c59b[_0xa1e1('0xf')][_0xa1e1('0x15')]({'type':_0x4ee2e6[_0x5bd9d0][0x0]['type'],'app':_0xa1e1('0x3c'),'exten':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0xb')],'context':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x12')],'priority':_0xf9c59b[_0xa1e1('0xd')],'VoiceExtensionId':_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x13')]});_0x2b6cd7[_0xa1e1('0x15')](_0x4ee2e6[_0x5bd9d0][0x0][_0xa1e1('0x13')]);_0x8f77f7=_[_0xa1e1('0x3d')](_0x8f77f7,_0xf9c59b[_0xa1e1('0xf')]);}}return _0x99c800[_0xa1e1('0x3e')](function(_0x11b724){return _0x99c800[_0xa1e1('0x1')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x2b6cd7}},'transaction':_0x11b724})[_0xa1e1('0x3')](function(_0x354320){return _0x99c800[_0xa1e1('0x1')]['VoiceExtension'][_0xa1e1('0x3f')](_[_0xa1e1('0x40')](_0x8f77f7,_0xa1e1('0xd')),{'transaction':_0x11b724});});});})[_0xa1e1('0x41')](function(_0xa676d){console[_0xa1e1('0x42')](_0xa676d);});}exports[_0xa1e1('0x43')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index aaec529..0fc57e4 100644 --- a/server/components/import/cm/csv.js +++ b/server/components/import/cm/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['generalCheckHopper','Error\x20processing\x20rows\x20block:','resolve','emit','contact:csv_','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','zipObject','split','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','email','ListId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','\x20=\x20?','into','fromQuery','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','get','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s'];(function(_0xb861b,_0x1effb2){var _0x2d2170=function(_0x3d00a4){while(--_0x3d00a4){_0xb861b['push'](_0xb861b['shift']());}};_0x2d2170(++_0x1effb2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1e91eb,_0x5829a3){_0x1e91eb=_0x1e91eb-0x0;var _0x2af75a=_0xcb91[_0x1e91eb];return _0x2af75a;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x1cb9('0x0'));var fs=require('fs');var squel=require(_0x1cb9('0x1'));var Papa=require(_0x1cb9('0x2'));var Redis=require(_0x1cb9('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('api');config[_0x1cb9('0x6')]=_[_0x1cb9('0x7')](config['redis'],{'host':_0x1cb9('0x8'),'port':0x18eb});var socket=require(_0x1cb9('0x9'))(new Redis(config['redis']));require(_0x1cb9('0xa'))[_0x1cb9('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x1cb9('0xc')][0x2]==='undefined'||process['argv'][0x2]===_0x1cb9('0xd')){throw new Error(_0x1cb9('0xe'));}var FILEPATH=process[_0x1cb9('0xc')][0x2];if(!process[_0x1cb9('0xc')][0x3]||process[_0x1cb9('0xc')][0x3]==='undefined'||process[_0x1cb9('0xc')][0x3]===_0x1cb9('0xd')||!process[_0x1cb9('0xc')][0x4]||process[_0x1cb9('0xc')][0x4]===_0x1cb9('0xf')||process['argv'][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x1cb9('0x10')](process[_0x1cb9('0xc')][0x3][_0x1cb9('0x11')](','),process[_0x1cb9('0xc')][0x4]['split'](','));if(!process[_0x1cb9('0xc')][0x5]||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x1cb9('0xc')][0x6]&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xf')&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x6]:null;var DUPLICATES=process[_0x1cb9('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x1cb9('0xc')][0x7]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x7]:null;if(!process[_0x1cb9('0xc')][0x8]||process[_0x1cb9('0xc')][0x8]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1cb9('0xc')][0x8];}catch(_0x5dbfae){logger[_0x1cb9('0x12')](_0x5dbfae);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x2265ea,_0x523b26,_0x599275,_0x2e3854){var _0x325637={'message':_0x523b26};_0x325637[_0x2265ea]=!![];if(_0x599275){_0x325637[_0x1cb9('0x13')]=_0x599275;}if(_0x2e3854){_0x325637[_0x1cb9('0x14')]=_0x2e3854;}return _0x325637;}function isEmail(_0x45b8d3){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x1cb9('0x15')](_0x45b8d3);}function checkRow(_0x59ebea,_0x55b232,_0x6c6f61){return new BPromise(function(_0x557199,_0x10a419){if(_[_0x1cb9('0x16')](_0x59ebea)){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x1cb9('0x17'),null,_0x6c6f61));}if(_0x59ebea[_0x1cb9('0x18')]&&_0x59ebea['errors'][_0x1cb9('0x19')]){var _0x9df250=_['map'](_0x59ebea[_0x1cb9('0x18')],_0x1cb9('0x1a'))[_0x1cb9('0x1b')](';');return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x9df250,null,_0x6c6f61));}var _0x406821={};for(var _0x21d6f5 in FIELDS){if(FIELDS[_0x1cb9('0x1c')](_0x21d6f5)&&FIELDS[_0x21d6f5]){_0x406821[_0x21d6f5]=_0x59ebea[_0x1cb9('0x1d')][0x0][FIELDS[_0x21d6f5]]||_0x59ebea[_0x1cb9('0x1d')][0x0]['\ufeff'+FIELDS[_0x21d6f5]];}}if(!_0x406821[_0x1cb9('0x1e')]){return _0x10a419(handleCheckRowError('error',_0x1cb9('0x1f'),null,_0x6c6f61));}if(!_0x406821['phone']){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'phone\x20not\x20specified!',null,_0x6c6f61));}if(_0x406821[_0x1cb9('0x20')]){var _0x41011c=moment(_0x406821[_0x1cb9('0x20')],_0x1cb9('0x21'));if(!_0x41011c['isValid']()){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x6c6f61));}}if(_0x406821[_0x1cb9('0x22')]){if(!isEmail(_0x406821[_0x1cb9('0x22')])){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x6c6f61));}}_0x406821[_0x1cb9('0x23')]=LISTID;_0x406821['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){var _0x58f4f5={};for(var _0x2164e3=0x0,_0x42a688=DUPLICATES[_0x1cb9('0x19')];_0x2164e3<_0x42a688;_0x2164e3+=0x1){_0x58f4f5[DUPLICATES[_0x2164e3]]=_0x406821[DUPLICATES[_0x2164e3]];}var _0xae910=_['find'](_0x55b232,_0x58f4f5);if(_0xae910){return _0x10a419(handleCheckRowError(_0x1cb9('0x24'),_0x1cb9('0x25'),_0xae910,_0x6c6f61));}}return db[_0x1cb9('0x26')][_0x1cb9('0x27')](_0x406821,{'raw':!![],'hooks':![],'fields':_[_0x1cb9('0x28')](_0x406821)})[_0x1cb9('0x29')](function(_0xc6d5fd){if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){_0x55b232[_0x1cb9('0x2a')](_[_0x1cb9('0x2b')](_0x406821,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xc6d5fd['id'];return _0x557199();})[_0x1cb9('0x2c')](function(_0x26b950){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x26b950['message']||JSON[_0x1cb9('0x2d')](_0x26b950)),null,_0x6c6f61));});});}function checkHopper(){function _0x30f7e4(){return function(_0x91c937){logger[_0x1cb9('0x12')](_0x1cb9('0x2e'),_0x1cb9('0x2f'),util[_0x1cb9('0x30')](_0x91c937,{'showHidden':![],'depth':null}));};}var _0x3f5637=function(_0x4d3e39,_0x2aa59b){var _0x1482c4=squel[_0x1cb9('0x31')]()['into'](_0x1cb9('0x32'))['fromQuery']([_0x1cb9('0x33'),'scheduledAt',_0x1cb9('0x34'),_0x1cb9('0x23'),_0x2aa59b,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),'phone')['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x4d3e39['id'][_0x1cb9('0x3b')](),_0x2aa59b)['field']('NOW()','createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))['where'](_0x1cb9('0x3e'))['where'](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x1cb9('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone')['from'](_0x1cb9('0x32'))[_0x1cb9('0x40')](_0x2aa59b+_0x1cb9('0x41'),_0x4d3e39['id'][_0x1cb9('0x3b')]())))[_0x1cb9('0x3b')]();return _0x1482c4;};var _0x58832e=function(_0x11d877,_0x5594fc){var _0x4c59e7=squel['insert']()[_0x1cb9('0x42')](_0x1cb9('0x32'))[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x5594fc,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone',_0x1cb9('0x33'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'scheduledAt')[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x11d877['id'][_0x1cb9('0x3b')](),_0x5594fc)['field'](_0x1cb9('0x39'),'createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')]('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x47'))[_0x1cb9('0x3c')](_0x1cb9('0x48'))[_0x1cb9('0x40')](_0x5594fc+_0x1cb9('0x41'),_0x11d877['id'][_0x1cb9('0x3b')]()))[_0x1cb9('0x40')](_0x1cb9('0x49'),squel['select']()[_0x1cb9('0x38')]('phone')[_0x1cb9('0x3c')]('cm_hopper')[_0x1cb9('0x40')](_0x5594fc+'\x20=\x20?',_0x11d877['id']['toString']())))[_0x1cb9('0x3b')]();return _0x4c59e7;};function _0x3b0c2e(_0x303da3,_0x4bce54){var _0x3c157f=squel[_0x1cb9('0x31')]()['into']('cm_hopper')[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x4bce54,_0x1cb9('0x35'),_0x1cb9('0x36')],squel['select']()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),'ListId')[_0x1cb9('0x38')](_0x303da3['id'][_0x1cb9('0x3b')](),_0x4bce54)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))[_0x1cb9('0x40')]('deletedAt\x20IS\x20NULL')[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46')))[_0x1cb9('0x3b')]();return _0x3c157f;}function _0x173db5(_0x3c2f9c,_0x75c734){var _0xc515a6=squel[_0x1cb9('0x31')]()['into']('cm_hopper_black')[_0x1cb9('0x43')](['phone','ContactId','ListId',_0x75c734,'createdAt','updatedAt'],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))['field'](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x3c2f9c['id']['toString'](),_0x75c734)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'updatedAt')['from']('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())['where'](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1cb9('0x3b')]();return _0xc515a6;}return db['VoiceQueue'][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x4aeeff){var _0xde0d93=[];if(_0x4aeeff){var _0x15fc04;for(var _0x330fc1=0x0,_0x17c361;_0x330fc1<_0x4aeeff['length'];_0x330fc1+=0x1){_0x17c361=_0x4aeeff[_0x330fc1]['get']({'plain':!![]});switch(_0x17c361[_0x1cb9('0x4c')]){case _0x1cb9('0x4f'):_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x17c361,_0x1cb9('0x52')))['then'](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;case'onlyIfOpen':_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')]['query'](_0x3f5637(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0xde0d93['push'](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}}return _0xde0d93;})[_0x1cb9('0x53')]()['then'](function(){return db[_0x1cb9('0x54')][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x128a41){var _0x37bcd9=[];if(_0x128a41){var _0x4cd544;for(var _0x28bac2=0x0,_0x78e9c;_0x28bac2<_0x128a41['length'];_0x28bac2+=0x1){_0x78e9c=_0x128a41[_0x28bac2][_0x1cb9('0x56')]({'plain':!![]});_0x37bcd9['push'](db[_0x1cb9('0x50')]['query'](_0x173db5(_0x78e9c,'VoiceQueueId'))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x37bcd9;})['all']();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x45ca54){var _0x3d25a3=[];if(_0x45ca54){for(var _0x2a157d=0x0,_0x27cc3c;_0x2a157d<_0x45ca54[_0x1cb9('0x19')];_0x2a157d+=0x1){_0x27cc3c=_0x45ca54[_0x2a157d][_0x1cb9('0x56')]({'plain':!![]});switch(_0x27cc3c['dialCheckDuplicateType']){case _0x1cb9('0x4f'):_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));break;case _0x1cb9('0x58'):_0x3d25a3[_0x1cb9('0x2a')](db['sequelize'][_0x1cb9('0x51')](_0x3f5637(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x27cc3c,'CampaignId'))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));}}}return _0x3d25a3;})[_0x1cb9('0x53')]();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x56f23d){var _0x113367=[];if(_0x56f23d){for(var _0x39b0cb=0x0,_0x429371;_0x39b0cb<_0x56f23d['length'];_0x39b0cb+=0x1){_0x429371=_0x56f23d[_0x39b0cb][_0x1cb9('0x56')]({'plain':!![]});_0x113367[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x173db5(_0x429371,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x113367;})['all']();})[_0x1cb9('0x2c')](function(_0x4b15a4){logger[_0x1cb9('0x12')](_0x1cb9('0x59'),_0x1cb9('0x5a'),_0x4b15a4[_0x1cb9('0x1a')]);});}var processPromises=function(_0x4bdbd2){return BPromise[_0x1cb9('0x53')](promises)[_0x1cb9('0x29')](function(_0x5e68a1){})[_0x1cb9('0x2c')](function(_0x416508){logger[_0x1cb9('0x12')](_0x1cb9('0x5b'),JSON[_0x1cb9('0x2d')](_0x416508));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4bdbd2){return _0x4bdbd2['resume']();}});};var endCsv=function(){return BPromise[_0x1cb9('0x5c')]()[_0x1cb9('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x1cb9('0x29')](function(){socket[_0x1cb9('0x5d')](_0x1cb9('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1cb9('0x5f')](FILEPATH);}catch(_0x1e6402){logger[_0x1cb9('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x1cb9('0x2d')](_0x1e6402));}finally{process[_0x1cb9('0x60')](0x0);}});};process['on'](_0x1cb9('0x61'),function(){logger['info'](_0x1cb9('0x62'));endCsv();});function main(){return BPromise[_0x1cb9('0x5c')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1cb9('0x11')](',');return db[_0x1cb9('0x26')][_0x1cb9('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1cb9('0x29')](function(_0x5cb5e5){var _0x2c0416=fs[_0x1cb9('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x2c0416,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5bd78d,_0x1f2d69){total+=0x1;var _0x3ba0a5=total;promises['push'](checkRow(_0x5bd78d,_0x5cb5e5,_0x3ba0a5)['then'](function(){success+=0x1;})[_0x1cb9('0x2c')](function(_0x3486e5){if(_0x3486e5['error']){errors+=0x1;delete _0x3486e5['error'];}else if(_0x3486e5[_0x1cb9('0x24')]){duplicates+=0x1;delete _0x3486e5['duplicate'];}rows['push'](_0x3486e5);}));if(total%0xc8===0x0){_0x1f2d69['pause']();return processPromises(_0x1f2d69);}},'complete':function(){return processPromises()[_0x1cb9('0x29')](function(){logger['info'](_0x1cb9('0x64'));endCsv();});},'error':function(_0x3c717b,_0x33ec43){logger['info'](_0x1cb9('0x65'),JSON[_0x1cb9('0x2d')](_0x3c717b));endCsv();}});})[_0x1cb9('0x2c')](function(_0x4c54b5){logger[_0x1cb9('0x12')](_0x1cb9('0x66'),JSON[_0x1cb9('0x2d')](_0x4c54b5));});}main(); \ No newline at end of file +var _0xcb91=['generalCheckHopper','Error\x20processing\x20rows\x20block:','resolve','emit','contact:csv_','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','zipObject','split','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','email','ListId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','\x20=\x20?','into','fromQuery','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','get','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s'];(function(_0x1a9913,_0x3ce9be){var _0x1dee9a=function(_0x408948){while(--_0x408948){_0x1a9913['push'](_0x1a9913['shift']());}};_0x1dee9a(++_0x3ce9be);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0xcb91[_0x4695ba];return _0x524b7d;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x1cb9('0x0'));var fs=require('fs');var squel=require(_0x1cb9('0x1'));var Papa=require(_0x1cb9('0x2'));var Redis=require(_0x1cb9('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('api');config[_0x1cb9('0x6')]=_[_0x1cb9('0x7')](config['redis'],{'host':_0x1cb9('0x8'),'port':0x18eb});var socket=require(_0x1cb9('0x9'))(new Redis(config['redis']));require(_0x1cb9('0xa'))[_0x1cb9('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x1cb9('0xc')][0x2]==='undefined'||process['argv'][0x2]===_0x1cb9('0xd')){throw new Error(_0x1cb9('0xe'));}var FILEPATH=process[_0x1cb9('0xc')][0x2];if(!process[_0x1cb9('0xc')][0x3]||process[_0x1cb9('0xc')][0x3]==='undefined'||process[_0x1cb9('0xc')][0x3]===_0x1cb9('0xd')||!process[_0x1cb9('0xc')][0x4]||process[_0x1cb9('0xc')][0x4]===_0x1cb9('0xf')||process['argv'][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x1cb9('0x10')](process[_0x1cb9('0xc')][0x3][_0x1cb9('0x11')](','),process[_0x1cb9('0xc')][0x4]['split'](','));if(!process[_0x1cb9('0xc')][0x5]||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x1cb9('0xc')][0x6]&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xf')&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x6]:null;var DUPLICATES=process[_0x1cb9('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x1cb9('0xc')][0x7]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x7]:null;if(!process[_0x1cb9('0xc')][0x8]||process[_0x1cb9('0xc')][0x8]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1cb9('0xc')][0x8];}catch(_0x5dbfae){logger[_0x1cb9('0x12')](_0x5dbfae);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x2265ea,_0x523b26,_0x599275,_0x2e3854){var _0x325637={'message':_0x523b26};_0x325637[_0x2265ea]=!![];if(_0x599275){_0x325637[_0x1cb9('0x13')]=_0x599275;}if(_0x2e3854){_0x325637[_0x1cb9('0x14')]=_0x2e3854;}return _0x325637;}function isEmail(_0x45b8d3){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x1cb9('0x15')](_0x45b8d3);}function checkRow(_0x59ebea,_0x55b232,_0x6c6f61){return new BPromise(function(_0x557199,_0x10a419){if(_[_0x1cb9('0x16')](_0x59ebea)){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x1cb9('0x17'),null,_0x6c6f61));}if(_0x59ebea[_0x1cb9('0x18')]&&_0x59ebea['errors'][_0x1cb9('0x19')]){var _0x9df250=_['map'](_0x59ebea[_0x1cb9('0x18')],_0x1cb9('0x1a'))[_0x1cb9('0x1b')](';');return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x9df250,null,_0x6c6f61));}var _0x406821={};for(var _0x21d6f5 in FIELDS){if(FIELDS[_0x1cb9('0x1c')](_0x21d6f5)&&FIELDS[_0x21d6f5]){_0x406821[_0x21d6f5]=_0x59ebea[_0x1cb9('0x1d')][0x0][FIELDS[_0x21d6f5]]||_0x59ebea[_0x1cb9('0x1d')][0x0]['\ufeff'+FIELDS[_0x21d6f5]];}}if(!_0x406821[_0x1cb9('0x1e')]){return _0x10a419(handleCheckRowError('error',_0x1cb9('0x1f'),null,_0x6c6f61));}if(!_0x406821['phone']){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'phone\x20not\x20specified!',null,_0x6c6f61));}if(_0x406821[_0x1cb9('0x20')]){var _0x41011c=moment(_0x406821[_0x1cb9('0x20')],_0x1cb9('0x21'));if(!_0x41011c['isValid']()){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x6c6f61));}}if(_0x406821[_0x1cb9('0x22')]){if(!isEmail(_0x406821[_0x1cb9('0x22')])){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x6c6f61));}}_0x406821[_0x1cb9('0x23')]=LISTID;_0x406821['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){var _0x58f4f5={};for(var _0x2164e3=0x0,_0x42a688=DUPLICATES[_0x1cb9('0x19')];_0x2164e3<_0x42a688;_0x2164e3+=0x1){_0x58f4f5[DUPLICATES[_0x2164e3]]=_0x406821[DUPLICATES[_0x2164e3]];}var _0xae910=_['find'](_0x55b232,_0x58f4f5);if(_0xae910){return _0x10a419(handleCheckRowError(_0x1cb9('0x24'),_0x1cb9('0x25'),_0xae910,_0x6c6f61));}}return db[_0x1cb9('0x26')][_0x1cb9('0x27')](_0x406821,{'raw':!![],'hooks':![],'fields':_[_0x1cb9('0x28')](_0x406821)})[_0x1cb9('0x29')](function(_0xc6d5fd){if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){_0x55b232[_0x1cb9('0x2a')](_[_0x1cb9('0x2b')](_0x406821,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xc6d5fd['id'];return _0x557199();})[_0x1cb9('0x2c')](function(_0x26b950){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x26b950['message']||JSON[_0x1cb9('0x2d')](_0x26b950)),null,_0x6c6f61));});});}function checkHopper(){function _0x30f7e4(){return function(_0x91c937){logger[_0x1cb9('0x12')](_0x1cb9('0x2e'),_0x1cb9('0x2f'),util[_0x1cb9('0x30')](_0x91c937,{'showHidden':![],'depth':null}));};}var _0x3f5637=function(_0x4d3e39,_0x2aa59b){var _0x1482c4=squel[_0x1cb9('0x31')]()['into'](_0x1cb9('0x32'))['fromQuery']([_0x1cb9('0x33'),'scheduledAt',_0x1cb9('0x34'),_0x1cb9('0x23'),_0x2aa59b,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),'phone')['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x4d3e39['id'][_0x1cb9('0x3b')](),_0x2aa59b)['field']('NOW()','createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))['where'](_0x1cb9('0x3e'))['where'](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x1cb9('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone')['from'](_0x1cb9('0x32'))[_0x1cb9('0x40')](_0x2aa59b+_0x1cb9('0x41'),_0x4d3e39['id'][_0x1cb9('0x3b')]())))[_0x1cb9('0x3b')]();return _0x1482c4;};var _0x58832e=function(_0x11d877,_0x5594fc){var _0x4c59e7=squel['insert']()[_0x1cb9('0x42')](_0x1cb9('0x32'))[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x5594fc,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone',_0x1cb9('0x33'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'scheduledAt')[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x11d877['id'][_0x1cb9('0x3b')](),_0x5594fc)['field'](_0x1cb9('0x39'),'createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')]('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x47'))[_0x1cb9('0x3c')](_0x1cb9('0x48'))[_0x1cb9('0x40')](_0x5594fc+_0x1cb9('0x41'),_0x11d877['id'][_0x1cb9('0x3b')]()))[_0x1cb9('0x40')](_0x1cb9('0x49'),squel['select']()[_0x1cb9('0x38')]('phone')[_0x1cb9('0x3c')]('cm_hopper')[_0x1cb9('0x40')](_0x5594fc+'\x20=\x20?',_0x11d877['id']['toString']())))[_0x1cb9('0x3b')]();return _0x4c59e7;};function _0x3b0c2e(_0x303da3,_0x4bce54){var _0x3c157f=squel[_0x1cb9('0x31')]()['into']('cm_hopper')[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x4bce54,_0x1cb9('0x35'),_0x1cb9('0x36')],squel['select']()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),'ListId')[_0x1cb9('0x38')](_0x303da3['id'][_0x1cb9('0x3b')](),_0x4bce54)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))[_0x1cb9('0x40')]('deletedAt\x20IS\x20NULL')[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46')))[_0x1cb9('0x3b')]();return _0x3c157f;}function _0x173db5(_0x3c2f9c,_0x75c734){var _0xc515a6=squel[_0x1cb9('0x31')]()['into']('cm_hopper_black')[_0x1cb9('0x43')](['phone','ContactId','ListId',_0x75c734,'createdAt','updatedAt'],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))['field'](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x3c2f9c['id']['toString'](),_0x75c734)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'updatedAt')['from']('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())['where'](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1cb9('0x3b')]();return _0xc515a6;}return db['VoiceQueue'][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x4aeeff){var _0xde0d93=[];if(_0x4aeeff){var _0x15fc04;for(var _0x330fc1=0x0,_0x17c361;_0x330fc1<_0x4aeeff['length'];_0x330fc1+=0x1){_0x17c361=_0x4aeeff[_0x330fc1]['get']({'plain':!![]});switch(_0x17c361[_0x1cb9('0x4c')]){case _0x1cb9('0x4f'):_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x17c361,_0x1cb9('0x52')))['then'](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;case'onlyIfOpen':_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')]['query'](_0x3f5637(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0xde0d93['push'](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}}return _0xde0d93;})[_0x1cb9('0x53')]()['then'](function(){return db[_0x1cb9('0x54')][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x128a41){var _0x37bcd9=[];if(_0x128a41){var _0x4cd544;for(var _0x28bac2=0x0,_0x78e9c;_0x28bac2<_0x128a41['length'];_0x28bac2+=0x1){_0x78e9c=_0x128a41[_0x28bac2][_0x1cb9('0x56')]({'plain':!![]});_0x37bcd9['push'](db[_0x1cb9('0x50')]['query'](_0x173db5(_0x78e9c,'VoiceQueueId'))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x37bcd9;})['all']();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x45ca54){var _0x3d25a3=[];if(_0x45ca54){for(var _0x2a157d=0x0,_0x27cc3c;_0x2a157d<_0x45ca54[_0x1cb9('0x19')];_0x2a157d+=0x1){_0x27cc3c=_0x45ca54[_0x2a157d][_0x1cb9('0x56')]({'plain':!![]});switch(_0x27cc3c['dialCheckDuplicateType']){case _0x1cb9('0x4f'):_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));break;case _0x1cb9('0x58'):_0x3d25a3[_0x1cb9('0x2a')](db['sequelize'][_0x1cb9('0x51')](_0x3f5637(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x27cc3c,'CampaignId'))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));}}}return _0x3d25a3;})[_0x1cb9('0x53')]();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x56f23d){var _0x113367=[];if(_0x56f23d){for(var _0x39b0cb=0x0,_0x429371;_0x39b0cb<_0x56f23d['length'];_0x39b0cb+=0x1){_0x429371=_0x56f23d[_0x39b0cb][_0x1cb9('0x56')]({'plain':!![]});_0x113367[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x173db5(_0x429371,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x113367;})['all']();})[_0x1cb9('0x2c')](function(_0x4b15a4){logger[_0x1cb9('0x12')](_0x1cb9('0x59'),_0x1cb9('0x5a'),_0x4b15a4[_0x1cb9('0x1a')]);});}var processPromises=function(_0x4bdbd2){return BPromise[_0x1cb9('0x53')](promises)[_0x1cb9('0x29')](function(_0x5e68a1){})[_0x1cb9('0x2c')](function(_0x416508){logger[_0x1cb9('0x12')](_0x1cb9('0x5b'),JSON[_0x1cb9('0x2d')](_0x416508));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4bdbd2){return _0x4bdbd2['resume']();}});};var endCsv=function(){return BPromise[_0x1cb9('0x5c')]()[_0x1cb9('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x1cb9('0x29')](function(){socket[_0x1cb9('0x5d')](_0x1cb9('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1cb9('0x5f')](FILEPATH);}catch(_0x1e6402){logger[_0x1cb9('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x1cb9('0x2d')](_0x1e6402));}finally{process[_0x1cb9('0x60')](0x0);}});};process['on'](_0x1cb9('0x61'),function(){logger['info'](_0x1cb9('0x62'));endCsv();});function main(){return BPromise[_0x1cb9('0x5c')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1cb9('0x11')](',');return db[_0x1cb9('0x26')][_0x1cb9('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1cb9('0x29')](function(_0x5cb5e5){var _0x2c0416=fs[_0x1cb9('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x2c0416,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5bd78d,_0x1f2d69){total+=0x1;var _0x3ba0a5=total;promises['push'](checkRow(_0x5bd78d,_0x5cb5e5,_0x3ba0a5)['then'](function(){success+=0x1;})[_0x1cb9('0x2c')](function(_0x3486e5){if(_0x3486e5['error']){errors+=0x1;delete _0x3486e5['error'];}else if(_0x3486e5[_0x1cb9('0x24')]){duplicates+=0x1;delete _0x3486e5['duplicate'];}rows['push'](_0x3486e5);}));if(total%0xc8===0x0){_0x1f2d69['pause']();return processPromises(_0x1f2d69);}},'complete':function(){return processPromises()[_0x1cb9('0x29')](function(){logger['info'](_0x1cb9('0x64'));endCsv();});},'error':function(_0x3c717b,_0x33ec43){logger['info'](_0x1cb9('0x65'),JSON[_0x1cb9('0x2d')](_0x3c717b));endCsv();}});})[_0x1cb9('0x2c')](function(_0x4c54b5){logger[_0x1cb9('0x12')](_0x1cb9('0x66'),JSON[_0x1cb9('0x2d')](_0x4c54b5));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index a9936ec..97d59ce 100644 --- a/server/components/import/cm/csv2.js +++ b/server/components/import/cm/csv2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0696=['step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','then','finish','affectedRows','unlink','catch','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','test','select','field','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','insert','into','phone','scheduledat','ContactId','createdAt','priority','UserId','recallme','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_contacts.updatedAt','cm_hopper_black','fromQuery','ListId','updatedAt','fields','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','keys','cm_contacts',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','group','info','message','exit','push','code','sequelize','spread','error','main','stringify','send','start','binding','socket_timestamp','root','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','errors','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError'];(function(_0x201df3,_0xce5f44){var _0xdc84af=function(_0x3bcf84){while(--_0x3bcf84){_0x201df3['push'](_0x201df3['shift']());}};_0xdc84af(++_0xce5f44);}(_0x0696,0x13e));var _0x6069=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x0696[_0x368fb9];return _0x4892fb;};'use strict';var fs=require('fs');var path=require(_0x6069('0x0'));var _=require(_0x6069('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0x6069('0x2'));var moment=require(_0x6069('0x3'));var squel=require(_0x6069('0x4'));var Redis=require(_0x6069('0x5'));var db=require(_0x6069('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x6069('0x7'))(_0x6069('0x8'));config[_0x6069('0x9')]=_[_0x6069('0xa')](config[_0x6069('0x9')],{'host':_0x6069('0xb'),'port':0x18eb});var socket=require(_0x6069('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x6069('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x3a65ba){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x6069('0xe')](_0x3a65ba);}function selectNotIn(_0x1d4252,_0x22b0f7,_0x415eb2,_0xe88cc3,_0x2182e2){return squel[_0x6069('0xf')]()[_0x6069('0x10')]('phone')[_0x6069('0x11')](_0xe88cc3)['join'](_0x22b0f7,null,_0x22b0f7+_0x6069('0x12')+_0xe88cc3+'.'+_0x415eb2)[_0x6069('0x13')](_0xe88cc3+'.'+_0x415eb2+_0x6069('0x14')+_0x1d4252+'.'+_0x415eb2)[_0x6069('0x13')](_0x22b0f7+_0x6069('0x15')+_0x2182e2[_0x6069('0x16')]()+')');}function insertCmHopper(_0x3b7376,_0x49906c,_0x4d5457,_0x4338f2,_0x45ff98){var _0x425c2e=['cm_contacts.phone','cm_contacts.scheduledat',_0x6069('0x17'),_0x6069('0x18'),_0x49906c+'.'+_0x4338f2,_0x6069('0x19'),'cm_contacts.updatedAt','cm_contacts.priority',_0x6069('0x1a'),'\x22'+_0x45ff98+'\x22'];return squel[_0x6069('0x1b')]()[_0x6069('0x1c')]('cm_hopper')['fromQuery']([_0x6069('0x1d'),_0x6069('0x1e'),_0x6069('0x1f'),'ListId',_0x4338f2,_0x6069('0x20'),'updatedAt',_0x6069('0x21'),_0x6069('0x22'),_0x6069('0x23')],squel[_0x6069('0xf')]()['fields'](_0x425c2e)[_0x6069('0x11')](_0x49906c)['join']('cm_contacts',null,_0x6069('0x24')+_0x49906c+_0x6069('0x25'))[_0x6069('0x16')](_0x4d5457,null,_0x4d5457+'.id\x20=\x20'+_0x49906c+'.'+_0x4338f2)[_0x6069('0x13')](_0x49906c+'.CmListId\x20=\x20?',_0x3b7376)[_0x6069('0x13')](_0x6069('0x26'),NOW)[_0x6069('0x13')](_0x6069('0x27'),selectNotIn(_0x49906c,_0x4d5457,_0x4338f2,_0x6069('0x28'),[_0x6069('0x29'),_0x6069('0x2a')]))[_0x6069('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x49906c,_0x4d5457,_0x4338f2,'cm_hopper',[_0x6069('0x29')])))[_0x6069('0x2b')]();}function insertCmHopperBlack(_0x53cab9,_0x13aec0,_0x14b649,_0x456366){var _0x45e155=[_0x6069('0x2c'),_0x6069('0x17'),_0x6069('0x18'),_0x13aec0+'.'+_0x456366,_0x6069('0x19'),_0x6069('0x2d')];return squel[_0x6069('0x1b')]()[_0x6069('0x1c')](_0x6069('0x2e'))[_0x6069('0x2f')]([_0x6069('0x1d'),'ContactId',_0x6069('0x30'),_0x456366,_0x6069('0x20'),_0x6069('0x31')],squel['select']()[_0x6069('0x32')](_0x45e155)[_0x6069('0x11')](_0x13aec0)[_0x6069('0x16')]('cm_contacts',null,_0x6069('0x24')+_0x13aec0+_0x6069('0x25'))[_0x6069('0x16')](_0x14b649,null,_0x14b649+_0x6069('0x12')+_0x13aec0+'.'+_0x456366)[_0x6069('0x13')](_0x13aec0+_0x6069('0x33'),_0x53cab9)[_0x6069('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x6069('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x6069('0xf')]()['field'](_0x6069('0x1d'))[_0x6069('0x11')]('cm_hopper_black')[_0x6069('0x13')](_0x6069('0x34'),_0x53cab9)[_0x6069('0x13')](_0x456366+_0x6069('0x35'),_0x13aec0+'.'+_0x456366)))[_0x6069('0x2b')]();}function insertCmContact(_0xc06cc2,_0x268f02,_0x11abd9,_0x2cf663){var _0x37dda4=_[_0x6069('0x36')](_[_0x6069('0x37')](_0x2cf663),['ListId','CompanyId','createdAt','updatedAt']);return squel[_0x6069('0x1b')]()[_0x6069('0x1c')](_0x6069('0x38'))[_0x6069('0x2f')](_0x37dda4,squel[_0x6069('0xf')]()[_0x6069('0x32')](_0x37dda4)[_0x6069('0x11')](_0x268f02)[_0x6069('0x13')]('('+_0x11abd9[_0x6069('0x16')](',')+_0x6069('0x39'),squel[_0x6069('0xf')]()[_0x6069('0x32')](_0x11abd9)['from'](_0x6069('0x38'))['where'](_0x6069('0x34'),_0xc06cc2))[_0x6069('0x13')](_0x6069('0x3a'),squel['select']()['field'](_0x6069('0x3b'),'min_id')[_0x6069('0x11')](_0x268f02)[_0x6069('0x3c')](_0x11abd9['join'](','))))[_0x6069('0x2b')]();}function handleStop(){logger[_0x6069('0x3d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x4879b6){logger['error'](_0x4879b6[_0x6069('0x3e')]);process[_0x6069('0x3f')](0x1);}function handleError(_0x36ae59,_0x2304b7){stats['errors'][_0x6069('0x40')]({'name':_0x2304b7[_0x6069('0x41')],'message':_0x2304b7[_0x6069('0x3e')],'row':_0x36ae59});}function handleQuery(_0x1b0265){logger['info'](_0x1b0265);return db[_0x6069('0x42')]['query'](_0x1b0265)[_0x6069('0x43')](function(_0x6cfbd8){results[_0x6069('0x40')](_0x6cfbd8);})['catch'](function(_0x147461){logger[_0x6069('0x44')](_0x147461[_0x6069('0x3e')]);});}function main(_0x2701ba,_0x2d1c16,_0x5492a3,_0x5b775c){logger[_0x6069('0x3d')](_0x6069('0x45'),_0x2701ba,JSON[_0x6069('0x46')](_0x2d1c16));process[_0x6069('0x47')](_0x6069('0x48'));var _0x2de83a=_0x2d1c16[_0x6069('0x49')];var _0x115af4=_0x2d1c16[_0x6069('0x4a')];var _0x365422=path[_0x6069('0x16')](config[_0x6069('0x4b')],'server/files/tmp',_0x115af4+_0x6069('0x4c'));var _0x1fe8d2=_['keys'](_0x2de83a)[_0x6069('0x16')]();logger[_0x6069('0x3d')](_0x6069('0x4d'),_0x1fe8d2);fs[_0x6069('0x4e')](_0x365422,_0x1fe8d2+'\x0a');Papa[_0x6069('0x4f')](fs[_0x6069('0x50')](_0x2701ba),{'header':!![],'skipEmptyLines':!![],'step':function(_0xa98245,_0x296103){try{for(var _0x4dfd4c=0x0,_0x41373d=[];_0x4dfd4c<_0xa98245[_0x6069('0x51')][_0x6069('0x52')];_0x4dfd4c++){stats[_0x6069('0x53')]+=0x1;if(_0xa98245[_0x6069('0x54')][_0x4dfd4c]){handleError(_0xa98245[_0x6069('0x51')][_0x4dfd4c],_0xa98245[_0x6069('0x54')][_0x4dfd4c]);}else{var _0x277a15=[];for(var _0xbb3a8d in _0x2de83a){if(_0x2de83a[_0x6069('0x55')](_0xbb3a8d)){if(_0xa98245[_0x6069('0x51')][_0x4dfd4c][_0x2de83a[_0xbb3a8d]]){var _0x2b3ae5=_[_0x6069('0x56')](_0xa98245['data'][_0x4dfd4c][_0x2de83a[_0xbb3a8d]][_0x6069('0x57')](/"/g,'\x27'));switch(_0xbb3a8d){case'scheduledat':var _0x37f72c=moment(_0x2b3ae5,_0x6069('0x58'),!![]);if(_0x37f72c[_0x6069('0x59')]()){_0x41373d[_0x6069('0x40')]('\x22'+_0x2b3ae5+'\x22');}else{_0x277a15['push'](_0x6069('0x5a'));}break;case _0x6069('0x21'):var _0xcecc21=parseInt(_0x2b3ae5);_0x2b3ae5=_[_0x6069('0x5b')](_0xcecc21)||_0xcecc21<0x0||_0xcecc21>0x4?_0x5b775c?0x3:0x2:_0xcecc21;_0x41373d['push']('\x22'+_0x2b3ae5+'\x22');break;case _0x6069('0x22'):var _0x230093=parseInt(_0x2b3ae5);if(_[_0x6069('0x5c')](_0x230093)&&_[_0x6069('0x5d')](_0x5492a3,_0x230093)){_0x41373d[_0x6069('0x40')]('\x22'+_0x230093+'\x22');}else{_0x277a15[_0x6069('0x40')]('agent\x20not\x20exists');}break;case _0x6069('0x5e'):if(isEmail(_0x2b3ae5)){_0x41373d[_0x6069('0x40')]('\x22'+_0x2b3ae5+'\x22');}else{_0x277a15['push'](_0x6069('0x5f'));}break;case'dateOfBirth':var _0x4f134d=moment(_0x2b3ae5,'YYYY-MM-DD',!![]);if(_0x4f134d[_0x6069('0x59')]()){_0x41373d[_0x6069('0x40')]('\x22'+_0x2b3ae5+'\x22');}else{_0x277a15[_0x6069('0x40')](_0x6069('0x60'));}break;default:_0x41373d[_0x6069('0x40')]('\x22'+_0x2b3ae5+'\x22');}}else{switch(_0xbb3a8d){case _0x6069('0x61'):case _0x6069('0x1d'):_0x277a15[_0x6069('0x40')](_0xbb3a8d+'\x20not\x20specified');break;default:_0x41373d['push']('\x22\x22');}}}}if(_0x277a15['length']){handleError(_0xa98245[_0x6069('0x51')][_0x4dfd4c],{'code':_0x6069('0x62'),'message':_0x277a15[_0x6069('0x16')]()});}else{fs[_0x6069('0x63')](_0x365422,_0x41373d[_0x6069('0x16')]()+'\x0a');}_0x41373d=[];}if(!(stats['rows']%0xc8)){socket[_0x6069('0x64')](_0x6069('0x65')+_0x115af4,stats);stats[_0x6069('0x54')]=[];}}if(stopped){logger[_0x6069('0x3d')](_0x6069('0x66'));_0x296103[_0x6069('0x67')]();}}catch(_0x52164f){handleError(_0xa98245['data'][_0x4dfd4c],{'code':_0x6069('0x68'),'message':_0x52164f[_0x6069('0x3e')]});logger[_0x6069('0x44')](_0x6069('0x69'),_0x52164f[_0x6069('0x3e')]);}},'complete':function(){try{var _0x517293=[];var _0x52ca91=_0x6069('0x38');if(_0x2d1c16[_0x6069('0x6a')]&&_0x2d1c16[_0x6069('0x6a')][_0x6069('0x52')]){_0x52ca91=_0x6069('0x6b')+_0x115af4;_0x517293[_0x6069('0x40')](_0x6069('0x6c')+_0x52ca91+_0x6069('0x6d'));}var _0x250cd8=util['format'](_0x6069('0x6e'),_0x365422,_0x52ca91,_0x1fe8d2,_0x2d1c16['ListId'],_0x2d1c16['CompanyId']||null,NOW,NOW);if(_[_0x6069('0x6f')](_0x2de83a[_0x6069('0x1e')])){_0x250cd8+=_0x6069('0x70');}_0x517293[_0x6069('0x40')](_0x250cd8);if(_0x2d1c16[_0x6069('0x6a')]&&_0x2d1c16[_0x6069('0x6a')]['length']){_0x517293[_0x6069('0x40')](insertCmContact(_0x2d1c16[_0x6069('0x30')],_0x52ca91,_0x2d1c16['duplicates'],_0x2de83a));_0x517293[_0x6069('0x40')](_0x6069('0x71')+_0x52ca91+';');}_0x517293['push'](insertCmHopper(_0x2d1c16[_0x6069('0x30')],_0x6069('0x72'),_0x6069('0x73'),'VoiceQueueId',_0x5b775c));_0x517293[_0x6069('0x40')](insertCmHopperBlack(_0x2d1c16[_0x6069('0x30')],_0x6069('0x74'),_0x6069('0x73'),_0x6069('0x75')));_0x517293[_0x6069('0x40')](insertCmHopper(_0x2d1c16[_0x6069('0x30')],_0x6069('0x76'),_0x6069('0x77'),_0x6069('0x78'),_0x5b775c));_0x517293[_0x6069('0x40')](insertCmHopperBlack(_0x2d1c16[_0x6069('0x30')],_0x6069('0x79'),'campaigns',_0x6069('0x78')));BPromise['each'](_0x517293,handleQuery)[_0x6069('0x7a')](function(_0x351cb7){stats[_0x6069('0x7b')]=!![];stats[_0x6069('0x7c')]=_0x2d1c16[_0x6069('0x6a')]&&_0x2d1c16['duplicates'][_0x6069('0x52')]?results[0x2][_0x6069('0x7c')]:results[0x0][_0x6069('0x7c')];socket[_0x6069('0x64')](_0x6069('0x65')+_0x115af4,stats);fs[_0x6069('0x7d')](_0x2701ba);fs[_0x6069('0x7d')](_0x365422);process[_0x6069('0x3f')](0x0);})[_0x6069('0x7e')](function(_0x2051d2){logger['error'](_0x2051d2[_0x6069('0x3e')]);process['exit'](0x1);});}catch(_0x5158ea){logger[_0x6069('0x44')](_0x6069('0x7f'),_0x5158ea['message']);process[_0x6069('0x3f')](0x1);}},'error':function(_0x1e4936,_0x579ce3,_0x43ca26,_0x37f1bb){throw new Error(_0x37f1bb);}});}function validate(){if(process[_0x6069('0x80')]&&process[_0x6069('0x80')]['length']<0x4){throw new Error(_0x6069('0x81'));}var _0x4fb55d=path[_0x6069('0x16')](config[_0x6069('0x4b')],_0x6069('0x82'),process[_0x6069('0x80')][0x2]);if(!fs[_0x6069('0x83')](_0x4fb55d)){throw new Error(_0x6069('0x84'));}var _0x1f2b17={};try{_0x1f2b17=JSON[_0x6069('0x4f')](process[_0x6069('0x80')][0x3]);if(!_0x1f2b17[_0x6069('0x49')]){throw new Error(_0x6069('0x85'));}if(!_0x1f2b17[_0x6069('0x49')][_0x6069('0x1d')]){throw new Error(_0x6069('0x86'));}if(!_0x1f2b17[_0x6069('0x49')]['firstName']){throw new Error(_0x6069('0x87'));}var _0x147065=0x0;if(_0x1f2b17[_0x6069('0x49')]['UserId']){_0x147065=0x1;}if(!_0x1f2b17['ListId']){throw new Error(_0x6069('0x88'));}}catch(_0x238a19){throw new Error(_0x6069('0x89'));}var _0x5f2e5a=[];try{_0x5f2e5a=_[_0x6069('0x8a')](JSON[_0x6069('0x4f')](process['argv'][0x4]),'id');}catch(_0x16a5c8){logger['info'](_0x6069('0x8b'));}main(_0x4fb55d,_0x1f2b17,_0x5f2e5a,_0x147065);}validate();process['on'](_0x6069('0x8c'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xbefe=['phone\x20is\x20mandatory','firstName\x20is\x20mandatory','map','No\x20agent\x20available','path','lodash','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','from','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','phone','scheduledat','createdAt','updatedAt','recallme','select','fields','cm_contacts','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_contacts.updatedAt','cm_hopper_black','cm_contacts.ListId\x20=\x20','cm_contacts.phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','message','exit','push','code','sequelize','query','error','send','start','root','header','writeFileSync','parse','createReadStream','data','rows','errors','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','firstName','length','SystemRow','Abort\x20parser','abort','step','cm_contacts_','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','ListId','isNil','duplicates','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','emit','unlink','catch','complete','argv','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists'];(function(_0x588d81,_0x259c9f){var _0x11e077=function(_0x514b58){while(--_0x514b58){_0x588d81['push'](_0x588d81['shift']());}};_0x11e077(++_0x259c9f);}(_0xbefe,0x84));var _0xebef=function(_0x395a03,_0x362943){_0x395a03=_0x395a03-0x0;var _0x8de6f=_0xbefe[_0x395a03];return _0x8de6f;};'use strict';var fs=require('fs');var path=require(_0xebef('0x0'));var _=require(_0xebef('0x1'));var Papa=require('papaparse');var util=require(_0xebef('0x2'));var BPromise=require('bluebird');var moment=require(_0xebef('0x3'));var squel=require(_0xebef('0x4'));var Redis=require(_0xebef('0x5'));var db=require(_0xebef('0x6'))['db'];var config=require(_0xebef('0x7'));var logger=require('../../../config/logger')(_0xebef('0x8'));config[_0xebef('0x9')]=_[_0xebef('0xa')](config[_0xebef('0x9')],{'host':_0xebef('0xb'),'port':0x18eb});var socket=require(_0xebef('0xc'))(new Redis(config[_0xebef('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xebef('0xd')](_0xebef('0xe'));function isEmail(_0x21ac2c){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xebef('0xf')](_0x21ac2c);}function selectNotIn(_0xb3d668,_0x397ec3,_0x46a2b8,_0x5703aa,_0x1e2bb9){return squel['select']()[_0xebef('0x10')]('phone')[_0xebef('0x11')](_0x5703aa)['join'](_0x397ec3,null,_0x397ec3+'.id\x20=\x20'+_0x5703aa+'.'+_0x46a2b8)[_0xebef('0x12')](_0x5703aa+'.'+_0x46a2b8+_0xebef('0x13')+_0xb3d668+'.'+_0x46a2b8)[_0xebef('0x12')](_0x397ec3+_0xebef('0x14')+_0x1e2bb9[_0xebef('0x15')]()+')');}function insertCmHopper(_0x345a8f,_0x1ff0a7,_0x41f372,_0x5f5231,_0x41bd54){var _0x471f03=[_0xebef('0x16'),_0xebef('0x17'),_0xebef('0x18'),'cm_contacts.ListId',_0x1ff0a7+'.'+_0x5f5231,_0xebef('0x19'),'cm_contacts.updatedAt',_0xebef('0x1a'),_0xebef('0x1b'),'\x22'+_0x41bd54+'\x22'];return squel[_0xebef('0x1c')]()[_0xebef('0x1d')](_0xebef('0x1e'))['fromQuery']([_0xebef('0x1f'),_0xebef('0x20'),'ContactId','ListId',_0x5f5231,_0xebef('0x21'),_0xebef('0x22'),'priority','UserId',_0xebef('0x23')],squel[_0xebef('0x24')]()[_0xebef('0x25')](_0x471f03)[_0xebef('0x11')](_0x1ff0a7)[_0xebef('0x15')](_0xebef('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x1ff0a7+_0xebef('0x27'))[_0xebef('0x15')](_0x41f372,null,_0x41f372+_0xebef('0x28')+_0x1ff0a7+'.'+_0x5f5231)[_0xebef('0x12')](_0x1ff0a7+_0xebef('0x29'),_0x345a8f)[_0xebef('0x12')](_0xebef('0x2a'),NOW)[_0xebef('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1ff0a7,_0x41f372,_0x5f5231,'cm_hopper',[_0xebef('0x2b'),_0xebef('0x2c')]))[_0xebef('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1ff0a7,_0x41f372,_0x5f5231,_0xebef('0x1e'),[_0xebef('0x2b')])))[_0xebef('0x2d')]();}function insertCmHopperBlack(_0x3248d8,_0x1ff6d8,_0x5a7098,_0x1dcf52){var _0x2e1779=['cm_contacts.phone','cm_contacts.id',_0xebef('0x2e'),_0x1ff6d8+'.'+_0x1dcf52,_0xebef('0x19'),_0xebef('0x2f')];return squel[_0xebef('0x1c')]()[_0xebef('0x1d')](_0xebef('0x30'))['fromQuery'](['phone','ContactId','ListId',_0x1dcf52,_0xebef('0x21'),_0xebef('0x22')],squel['select']()[_0xebef('0x25')](_0x2e1779)[_0xebef('0x11')](_0x1ff6d8)[_0xebef('0x15')]('cm_contacts',null,_0xebef('0x31')+_0x1ff6d8+_0xebef('0x27'))[_0xebef('0x15')](_0x5a7098,null,_0x5a7098+'.id\x20=\x20'+_0x1ff6d8+'.'+_0x1dcf52)[_0xebef('0x12')](_0x1ff6d8+'.CmListId\x20=\x20?',_0x3248d8)[_0xebef('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xebef('0x32'),squel[_0xebef('0x24')]()[_0xebef('0x10')](_0xebef('0x1f'))[_0xebef('0x11')](_0xebef('0x30'))[_0xebef('0x12')](_0xebef('0x33'),_0x3248d8)[_0xebef('0x12')](_0x1dcf52+'\x20=\x20?',_0x1ff6d8+'.'+_0x1dcf52)))[_0xebef('0x2d')]();}function insertCmContact(_0xb08450,_0x528bed,_0x3428ec,_0x615124){var _0x1ecd3f=_[_0xebef('0x34')](_[_0xebef('0x35')](_0x615124),['ListId',_0xebef('0x36'),_0xebef('0x21'),_0xebef('0x22')]);return squel[_0xebef('0x1c')]()[_0xebef('0x1d')](_0xebef('0x26'))['fromQuery'](_0x1ecd3f,squel[_0xebef('0x24')]()['fields'](_0x1ecd3f)[_0xebef('0x11')](_0x528bed)[_0xebef('0x12')]('('+_0x3428ec['join'](',')+_0xebef('0x37'),squel['select']()[_0xebef('0x25')](_0x3428ec)[_0xebef('0x11')](_0xebef('0x26'))[_0xebef('0x12')]('ListId\x20=\x20?',_0xb08450))[_0xebef('0x12')]('id\x20IN\x20?',squel[_0xebef('0x24')]()[_0xebef('0x10')](_0xebef('0x38'),'min_id')['from'](_0x528bed)[_0xebef('0x39')](_0x3428ec[_0xebef('0x15')](','))))[_0xebef('0x2d')]();}function handleStop(){logger[_0xebef('0x3a')](_0xebef('0x3b'));stopped=!![];}function handleUncaughtException(_0x1553cd){logger['error'](_0x1553cd[_0xebef('0x3c')]);process[_0xebef('0x3d')](0x1);}function handleError(_0x49f06c,_0x4907e6){stats['errors'][_0xebef('0x3e')]({'name':_0x4907e6[_0xebef('0x3f')],'message':_0x4907e6['message'],'row':_0x49f06c});}function handleQuery(_0x303d04){logger['info'](_0x303d04);return db[_0xebef('0x40')][_0xebef('0x41')](_0x303d04)['spread'](function(_0x1f1824){results[_0xebef('0x3e')](_0x1f1824);})['catch'](function(_0x28732f){logger[_0xebef('0x42')](_0x28732f[_0xebef('0x3c')]);});}function main(_0x5369cf,_0x307d94,_0xd0fee8,_0x3cea61){logger[_0xebef('0x3a')]('main',_0x5369cf,JSON['stringify'](_0x307d94));process[_0xebef('0x43')](_0xebef('0x44'));var _0x355c6a=_0x307d94['binding'];var _0x3b53ab=_0x307d94['socket_timestamp'];var _0x3b4d77=path[_0xebef('0x15')](config[_0xebef('0x45')],'server/files/tmp',_0x3b53ab+'.csv');var _0x55981f=_[_0xebef('0x35')](_0x355c6a)[_0xebef('0x15')]();logger['info'](_0xebef('0x46'),_0x55981f);fs[_0xebef('0x47')](_0x3b4d77,_0x55981f+'\x0a');Papa[_0xebef('0x48')](fs[_0xebef('0x49')](_0x5369cf),{'header':!![],'skipEmptyLines':!![],'step':function(_0xdc8ad1,_0x7ce1d2){try{for(var _0x33724e=0x0,_0x405da7=[];_0x33724e<_0xdc8ad1[_0xebef('0x4a')]['length'];_0x33724e++){stats[_0xebef('0x4b')]+=0x1;if(_0xdc8ad1[_0xebef('0x4c')][_0x33724e]){handleError(_0xdc8ad1['data'][_0x33724e],_0xdc8ad1[_0xebef('0x4c')][_0x33724e]);}else{var _0x6c5e68=[];for(var _0x464a46 in _0x355c6a){if(_0x355c6a[_0xebef('0x4d')](_0x464a46)){if(_0xdc8ad1[_0xebef('0x4a')][_0x33724e][_0x355c6a[_0x464a46]]){var _0x1d6b5f=_[_0xebef('0x4e')](_0xdc8ad1['data'][_0x33724e][_0x355c6a[_0x464a46]][_0xebef('0x4f')](/"/g,'\x27'));switch(_0x464a46){case _0xebef('0x20'):var _0x50b3d5=moment(_0x1d6b5f,_0xebef('0xe'),!![]);if(_0x50b3d5[_0xebef('0x50')]()){_0x405da7['push']('\x22'+_0x1d6b5f+'\x22');}else{_0x6c5e68[_0xebef('0x3e')](_0xebef('0x51'));}break;case _0xebef('0x52'):var _0x740804=parseInt(_0x1d6b5f);_0x1d6b5f=_[_0xebef('0x53')](_0x740804)||_0x740804<0x0||_0x740804>0x4?_0x3cea61?0x3:0x2:_0x740804;_0x405da7[_0xebef('0x3e')]('\x22'+_0x1d6b5f+'\x22');break;case _0xebef('0x54'):var _0x336470=parseInt(_0x1d6b5f);if(_[_0xebef('0x55')](_0x336470)&&_[_0xebef('0x56')](_0xd0fee8,_0x336470)){_0x405da7['push']('\x22'+_0x336470+'\x22');}else{_0x6c5e68[_0xebef('0x3e')](_0xebef('0x57'));}break;case'email':if(isEmail(_0x1d6b5f)){_0x405da7['push']('\x22'+_0x1d6b5f+'\x22');}else{_0x6c5e68[_0xebef('0x3e')]('email\x20wrong\x20format');}break;case _0xebef('0x58'):var _0x464eda=moment(_0x1d6b5f,_0xebef('0x59'),!![]);if(_0x464eda[_0xebef('0x50')]()){_0x405da7['push']('\x22'+_0x1d6b5f+'\x22');}else{_0x6c5e68[_0xebef('0x3e')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x405da7[_0xebef('0x3e')]('\x22'+_0x1d6b5f+'\x22');}}else{switch(_0x464a46){case _0xebef('0x5a'):case _0xebef('0x1f'):_0x6c5e68[_0xebef('0x3e')](_0x464a46+'\x20not\x20specified');break;default:_0x405da7[_0xebef('0x3e')]('\x22\x22');}}}}if(_0x6c5e68[_0xebef('0x5b')]){handleError(_0xdc8ad1['data'][_0x33724e],{'code':_0xebef('0x5c'),'message':_0x6c5e68[_0xebef('0x15')]()});}else{fs['appendFileSync'](_0x3b4d77,_0x405da7[_0xebef('0x15')]()+'\x0a');}_0x405da7=[];}if(!(stats[_0xebef('0x4b')]%0xc8)){socket['emit']('contact:import:'+_0x3b53ab,stats);stats['errors']=[];}}if(stopped){logger['info'](_0xebef('0x5d'));_0x7ce1d2[_0xebef('0x5e')]();}}catch(_0x5598e2){handleError(_0xdc8ad1[_0xebef('0x4a')][_0x33724e],{'code':'SystemError','message':_0x5598e2[_0xebef('0x3c')]});logger[_0xebef('0x42')](_0xebef('0x5f'),_0x5598e2[_0xebef('0x3c')]);}},'complete':function(){try{var _0x1a81df=[];var _0x21357c=_0xebef('0x26');if(_0x307d94['duplicates']&&_0x307d94['duplicates']['length']){_0x21357c=_0xebef('0x60')+_0x3b53ab;_0x1a81df[_0xebef('0x3e')]('CREATE\x20TABLE\x20'+_0x21357c+_0xebef('0x61'));}var _0xc76b71=util['format'](_0xebef('0x62'),_0x3b4d77,_0x21357c,_0x55981f,_0x307d94[_0xebef('0x63')],_0x307d94['CompanyId']||null,NOW,NOW);if(_[_0xebef('0x64')](_0x355c6a['scheduledat'])){_0xc76b71+=',\x20scheduledAt\x20=\x20NOW()';}_0x1a81df[_0xebef('0x3e')](_0xc76b71);if(_0x307d94['duplicates']&&_0x307d94[_0xebef('0x65')][_0xebef('0x5b')]){_0x1a81df[_0xebef('0x3e')](insertCmContact(_0x307d94['ListId'],_0x21357c,_0x307d94[_0xebef('0x65')],_0x355c6a));_0x1a81df[_0xebef('0x3e')](_0xebef('0x66')+_0x21357c+';');}_0x1a81df[_0xebef('0x3e')](insertCmHopper(_0x307d94['ListId'],_0xebef('0x67'),_0xebef('0x68'),_0xebef('0x69'),_0x3cea61));_0x1a81df[_0xebef('0x3e')](insertCmHopperBlack(_0x307d94[_0xebef('0x63')],'voice_queues_has_cm_blacklists',_0xebef('0x68'),_0xebef('0x69')));_0x1a81df[_0xebef('0x3e')](insertCmHopper(_0x307d94[_0xebef('0x63')],_0xebef('0x6a'),_0xebef('0x6b'),_0xebef('0x6c'),_0x3cea61));_0x1a81df[_0xebef('0x3e')](insertCmHopperBlack(_0x307d94[_0xebef('0x63')],_0xebef('0x6d'),'campaigns',_0xebef('0x6c')));BPromise[_0xebef('0x6e')](_0x1a81df,handleQuery)[_0xebef('0x6f')](function(_0x4787ea){stats[_0xebef('0x70')]=!![];stats['affectedRows']=_0x307d94[_0xebef('0x65')]&&_0x307d94[_0xebef('0x65')][_0xebef('0x5b')]?results[0x2][_0xebef('0x71')]:results[0x0][_0xebef('0x71')];socket[_0xebef('0x72')]('contact:import:'+_0x3b53ab,stats);fs[_0xebef('0x73')](_0x5369cf);fs['unlink'](_0x3b4d77);process[_0xebef('0x3d')](0x0);})[_0xebef('0x74')](function(_0x2fe75c){logger['error'](_0x2fe75c[_0xebef('0x3c')]);process[_0xebef('0x3d')](0x1);});}catch(_0x3f5579){logger[_0xebef('0x42')](_0xebef('0x75'),_0x3f5579[_0xebef('0x3c')]);process['exit'](0x1);}},'error':function(_0x271092,_0x320de3,_0xba8a57,_0x39d96e){throw new Error(_0x39d96e);}});}function validate(){if(process['argv']&&process[_0xebef('0x76')][_0xebef('0x5b')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x385794=path['join'](config['root'],_0xebef('0x77'),process[_0xebef('0x76')][0x2]);if(!fs[_0xebef('0x78')](_0x385794)){throw new Error(_0xebef('0x79'));}var _0xd21dbc={};try{_0xd21dbc=JSON[_0xebef('0x48')](process[_0xebef('0x76')][0x3]);if(!_0xd21dbc[_0xebef('0x7a')]){throw new Error(_0xebef('0x7b'));}if(!_0xd21dbc[_0xebef('0x7a')][_0xebef('0x1f')]){throw new Error(_0xebef('0x7c'));}if(!_0xd21dbc[_0xebef('0x7a')][_0xebef('0x5a')]){throw new Error(_0xebef('0x7d'));}var _0x594442=0x0;if(_0xd21dbc[_0xebef('0x7a')]['UserId']){_0x594442=0x1;}if(!_0xd21dbc['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x5f4559){throw new Error('body\x20id\x20mandatory');}var _0x2e7a3d=[];try{_0x2e7a3d=_[_0xebef('0x7e')](JSON[_0xebef('0x48')](process[_0xebef('0x76')][0x4]),'id');}catch(_0x2d4b9e){logger[_0xebef('0x3a')](_0xebef('0x7f'));}main(_0x385794,_0xd21dbc,_0x2e7a3d,_0x594442);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index a20d55f..7e55aae 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b0f=['***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','Queue','UniqueId','Date','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','Billable\x20Time','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions'];(function(_0x281fd8,_0x10e42a){var _0x3db3e9=function(_0x5f4519){while(--_0x5f4519){_0x281fd8['push'](_0x281fd8['shift']());}};_0x3db3e9(++_0x10e42a);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x13a11b,_0x5361b4){_0x13a11b=_0x13a11b-0x0;var _0xe65d31=_0x4b0f[_0x13a11b];return _0xe65d31;};'use strict';exports['getSubjects']=function(_0x3a0e4f,_0x95169b){var _0x38265f=[{'type':'string','content':_0xf4b0('0x0'),'variableName':null}];switch(_0x3a0e4f[_0xf4b0('0x1')]()){case _0xf4b0('0x2'):switch(_0x95169b[_0xf4b0('0x1')]()){case _0xf4b0('0x3'):_0x38265f[_0xf4b0('0x4')]({'type':_0xf4b0('0x5'),'content':'','variableName':_0xf4b0('0x6')});_0x38265f[_0xf4b0('0x4')]({'type':_0xf4b0('0x5'),'content':'','variableName':_0xf4b0('0x7')});break;case _0xf4b0('0x8'):_0x38265f[_0xf4b0('0x4')]({'type':_0xf4b0('0x9'),'content':_0xf4b0('0xa'),'variableName':null});_0x38265f[_0xf4b0('0x4')]({'type':'variable','content':'','variableName':_0xf4b0('0xb')});break;}}return _0x38265f;};exports[_0xf4b0('0xc')]=function(_0x25ad2c,_0x21db22){var _0x35e838=[];switch(_0x25ad2c[_0xf4b0('0x1')]()){case _0xf4b0('0x2'):switch(_0x21db22[_0xf4b0('0x1')]()){case _0xf4b0('0x3'):_0x35e838=[{'type':_0xf4b0('0x9'),'content':_0xf4b0('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0xf'),'keyType':_0xf4b0('0x5'),'variableName':_0xf4b0('0x7')},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x10'),'keyType':_0xf4b0('0x5'),'variableName':_0xf4b0('0x11')},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x12'),'keyType':_0xf4b0('0x5'),'variableName':'destexten'},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x13'),'keyType':_0xf4b0('0x5'),'variableName':'queue'},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x14'),'keyType':_0xf4b0('0x5'),'variableName':'uniqueid'},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x15'),'keyType':_0xf4b0('0x5'),'variableName':'agentcalledAt'},{'type':'string','content':_0xf4b0('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0xf4b0('0xe'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0xf4b0('0x17')},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x18'),'keyType':'variable','variableName':_0xf4b0('0xb')},{'type':_0xf4b0('0x9'),'content':_0xf4b0('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x1a'),'keyType':_0xf4b0('0x5'),'variableName':_0xf4b0('0x1b')},{'type':'keyValue','content':'','key':_0xf4b0('0x1c'),'keyType':_0xf4b0('0x5'),'variableName':_0xf4b0('0x1d')},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x1e'),'keyType':_0xf4b0('0x5'),'variableName':_0xf4b0('0x1f')},{'type':_0xf4b0('0xe'),'content':'','key':'Hold\x20Time','keyType':_0xf4b0('0x5'),'variableName':'holdtime'},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x20'),'keyType':_0xf4b0('0x5'),'variableName':_0xf4b0('0x21')}];break;case _0xf4b0('0x8'):_0x35e838=[{'type':_0xf4b0('0x9'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x22'),'keyType':_0xf4b0('0x5'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x23'),'keyType':_0xf4b0('0x5'),'keyContent':'','variableName':'membername'},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x14'),'keyType':_0xf4b0('0x5'),'keyContent':'','variableName':_0xf4b0('0x24')},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x15'),'keyType':_0xf4b0('0x5'),'keyContent':'','variableName':_0xf4b0('0x25')},{'type':'string','content':_0xf4b0('0x19')},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x26'),'keyType':_0xf4b0('0x5'),'keyContent':'','variableName':_0xf4b0('0x27')},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x28'),'keyType':_0xf4b0('0x5'),'keyContent':'','variableName':_0xf4b0('0x29')},{'type':_0xf4b0('0xe'),'content':'','key':_0xf4b0('0x2a'),'keyType':_0xf4b0('0x5'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0xf4b0('0x2b'),'keyType':_0xf4b0('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x35e838;}; \ No newline at end of file +var _0x23a3=['Duration','duration','Billable\x20Time','billableseconds','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Call\x20To','destexten','Queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','uniqueid','starttime','answertime','Complete\x20Time','endtime'];(function(_0x505055,_0x43e74c){var _0x560b79=function(_0x351534){while(--_0x351534){_0x505055['push'](_0x505055['shift']());}};_0x560b79(++_0x43e74c);}(_0x23a3,0x131));var _0x323a=function(_0x587d32,_0x45a0c5){_0x587d32=_0x587d32-0x0;var _0x5552f8=_0x23a3[_0x587d32];return _0x5552f8;};'use strict';exports['getSubjects']=function(_0x4992bb,_0x5e2477){var _0x43fa16=[{'type':'string','content':_0x323a('0x0'),'variableName':null}];switch(_0x4992bb[_0x323a('0x1')]()){case _0x323a('0x2'):switch(_0x5e2477[_0x323a('0x1')]()){case _0x323a('0x3'):_0x43fa16[_0x323a('0x4')]({'type':_0x323a('0x5'),'content':'','variableName':_0x323a('0x6')});_0x43fa16[_0x323a('0x4')]({'type':'variable','content':'','variableName':_0x323a('0x7')});break;case _0x323a('0x8'):_0x43fa16['push']({'type':_0x323a('0x9'),'content':_0x323a('0xa'),'variableName':null});_0x43fa16[_0x323a('0x4')]({'type':'variable','content':'','variableName':_0x323a('0xb')});break;}}return _0x43fa16;};exports[_0x323a('0xc')]=function(_0xbdb43f,_0x3e0e0b){var _0x1b3d13=[];switch(_0xbdb43f[_0x323a('0x1')]()){case _0x323a('0x2'):switch(_0x3e0e0b[_0x323a('0x1')]()){case _0x323a('0x3'):_0x1b3d13=[{'type':_0x323a('0x9'),'content':_0x323a('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x323a('0xe'),'content':'','key':_0x323a('0xf'),'keyType':_0x323a('0x5'),'variableName':'calleridnum'},{'type':_0x323a('0xe'),'content':'','key':'Caller\x20Name','keyType':_0x323a('0x5'),'variableName':'calleridname'},{'type':'keyValue','content':'','key':_0x323a('0x10'),'keyType':'variable','variableName':_0x323a('0x11')},{'type':'keyValue','content':'','key':_0x323a('0x12'),'keyType':_0x323a('0x5'),'variableName':'queue'},{'type':_0x323a('0xe'),'content':'','key':_0x323a('0x13'),'keyType':'variable','variableName':'uniqueid'},{'type':_0x323a('0xe'),'content':'','key':_0x323a('0x14'),'keyType':_0x323a('0x5'),'variableName':_0x323a('0x15')},{'type':_0x323a('0x9'),'content':_0x323a('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':'variable','variableName':'destcalleridname'},{'type':_0x323a('0xe'),'content':'','key':'Agent\x20Number','keyType':_0x323a('0x5'),'variableName':_0x323a('0xb')},{'type':_0x323a('0x9'),'content':_0x323a('0x17'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x323a('0x18'),'keyType':'variable','variableName':_0x323a('0x15')},{'type':_0x323a('0xe'),'content':'','key':_0x323a('0x19'),'keyType':'variable','variableName':_0x323a('0x1a')},{'type':_0x323a('0xe'),'content':'','key':_0x323a('0x1b'),'keyType':_0x323a('0x5'),'variableName':_0x323a('0x1c')},{'type':_0x323a('0xe'),'content':'','key':'Hold\x20Time','keyType':_0x323a('0x5'),'variableName':'holdtime'},{'type':_0x323a('0xe'),'content':'','key':_0x323a('0x1d'),'keyType':_0x323a('0x5'),'variableName':_0x323a('0x1e')}];break;case _0x323a('0x8'):_0x1b3d13=[{'type':'string','content':_0x323a('0xd'),'variableName':null},{'type':_0x323a('0xe'),'content':'','key':_0x323a('0x1f'),'keyType':_0x323a('0x5'),'keyContent':'','variableName':_0x323a('0xb')},{'type':'keyValue','content':'','key':_0x323a('0x20'),'keyType':'variable','keyContent':'','variableName':_0x323a('0x21')},{'type':_0x323a('0xe'),'content':'','key':_0x323a('0x13'),'keyType':_0x323a('0x5'),'keyContent':'','variableName':_0x323a('0x22')},{'type':_0x323a('0xe'),'content':'','key':'Date','keyType':_0x323a('0x5'),'keyContent':'','variableName':_0x323a('0x23')},{'type':'string','content':_0x323a('0x17')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0x323a('0x24')},{'type':'keyValue','content':'','key':_0x323a('0x25'),'keyType':_0x323a('0x5'),'keyContent':'','variableName':_0x323a('0x26')},{'type':_0x323a('0xe'),'content':'','key':_0x323a('0x27'),'keyType':'variable','keyContent':'','variableName':_0x323a('0x28')},{'type':'keyValue','content':'','key':_0x323a('0x29'),'keyType':'variable','keyContent':'','variableName':_0x323a('0x2a')}];break;}}return _0x1b3d13;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 7e93acb..028be68 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c86=['catch','error','tracked','user','query','body','omit','phone','fax','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','chat-interactions','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','Interaction','findOne','then','info'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x8c86,0xd1));var _0x68c8=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x8c86[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x68c8('0x0'));var db=require(_0x68c8('0x1'))['db'];var loggers={'openchannel':require(_0x68c8('0x2'))(_0x68c8('0x3')),'mail':require(_0x68c8('0x2'))(_0x68c8('0x4')),'fax':require(_0x68c8('0x2'))('fax-interactions'),'sms':require(_0x68c8('0x2'))('sms-interactions'),'chat':require(_0x68c8('0x2'))(_0x68c8('0x5'))};function getInteractionId(_0x5a0130,_0x470e9b,_0x2468fb){if(_0x5a0130&&_0x5a0130[_['upperFirst'](_0x2468fb)+_0x68c8('0x6')]){return _0x5a0130[_['upperFirst'](_0x2468fb)+_0x68c8('0x6')];}else if(_0x5a0130&&_0x5a0130['id']){return _0x5a0130['id'];}else if(_0x470e9b&&_0x470e9b['id']){return _0x470e9b['id'];}else{return _0x68c8('0x7');}}function log(_0x44d088,_0x108578,_0x18bb60,_0x2906c2,_0x403510,_0x32e02b){loggers[_0x403510['toLowerCase']()][_0x44d088](_0x68c8('0x8'),_0x32e02b[_0x68c8('0x9')](),_0x108578?_0x108578['id']:null,_0x108578?_0x108578[_0x68c8('0xa')]:null,_0x108578?_0x108578[_0x68c8('0xb')]:null,getInteractionId(_0x18bb60,_0x2906c2,_0x403510),_0x18bb60?JSON['stringify'](_0x18bb60):'null');}function updateUser(_0x1eb2eb,_0x31dd24,_0x32d297,_0x541e14,_0x281bf1){db[_['upperFirst'](_0x541e14)+_0x68c8('0xc')][_0x68c8('0xd')]({'where':{'id':getInteractionId(_0x31dd24,_0x32d297,_0x541e14)}})[_0x68c8('0xe')](function(_0x3ec1e2){if(_0x3ec1e2){return _0x3ec1e2['update']({'UserId':_0x1eb2eb?_0x1eb2eb['id']:null});}})[_0x68c8('0xe')](function(_0x3dda99){if(_0x3dda99){log(_0x68c8('0xf'),_0x1eb2eb,_0x31dd24,_0x32d297,_0x541e14,_0x281bf1);}})[_0x68c8('0x10')](function(){log(_0x68c8('0x11'),_0x1eb2eb,_0x31dd24,_0x32d297,_0x541e14,_0x281bf1);});}exports[_0x68c8('0x12')]=function(_0x3e52f3,_0x35a56a){return function(_0x40abec,_0x16a505,_0x211831){var _0x427d30=_0x40abec[_0x68c8('0x13')];var _0x3808ed={};var _0x4f3e10=_0x40abec[_0x68c8('0x14')];if(_0x3808ed){_0x3808ed=_['clone'](_0x40abec[_0x68c8('0x15')]);_0x3808ed=_[_0x68c8('0x16')](_0x3808ed,[_0x68c8('0x15'),'html',_0x68c8('0x17'),_0x68c8('0x18'),'mobile']);}updateUser(_0x427d30,_0x3808ed,_0x4f3e10,_0x3e52f3,_0x35a56a);_0x211831(null);};}; \ No newline at end of file +var _0x897a=['html','lodash','../../mysqldb','../../config/logger','mail-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','null','findOne','then','update','info','error','clone','body','omit'];(function(_0x21feae,_0x471af4){var _0x28915f=function(_0x36e370){while(--_0x36e370){_0x21feae['push'](_0x21feae['shift']());}};_0x28915f(++_0x471af4);}(_0x897a,0x9b));var _0xa897=function(_0x52ab8e,_0x2a0e9d){_0x52ab8e=_0x52ab8e-0x0;var _0x1a7da6=_0x897a[_0x52ab8e];return _0x1a7da6;};'use strict';var _=require(_0xa897('0x0'));var db=require(_0xa897('0x1'))['db'];var loggers={'openchannel':require(_0xa897('0x2'))('openchannel-interactions'),'mail':require(_0xa897('0x2'))(_0xa897('0x3')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0xa897('0x2'))(_0xa897('0x4')),'chat':require(_0xa897('0x2'))(_0xa897('0x5'))};function getInteractionId(_0x3e5a87,_0x26ba5d,_0x2ae003){if(_0x3e5a87&&_0x3e5a87[_['upperFirst'](_0x2ae003)+'InteractionId']){return _0x3e5a87[_[_0xa897('0x6')](_0x2ae003)+_0xa897('0x7')];}else if(_0x3e5a87&&_0x3e5a87['id']){return _0x3e5a87['id'];}else if(_0x26ba5d&&_0x26ba5d['id']){return _0x26ba5d['id'];}else{return'unknown';}}function log(_0x187695,_0x1dd07f,_0x34c1c2,_0x32782b,_0x405591,_0xd2a78a){loggers[_0x405591[_0xa897('0x8')]()][_0x187695](_0xa897('0x9'),_0xd2a78a[_0xa897('0xa')](),_0x1dd07f?_0x1dd07f['id']:null,_0x1dd07f?_0x1dd07f['name']:null,_0x1dd07f?_0x1dd07f['role']:null,getInteractionId(_0x34c1c2,_0x32782b,_0x405591),_0x34c1c2?JSON[_0xa897('0xb')](_0x34c1c2):_0xa897('0xc'));}function updateUser(_0x35384c,_0x543594,_0x5b9cb1,_0x13c6a3,_0x5adedd){db[_[_0xa897('0x6')](_0x13c6a3)+'Interaction'][_0xa897('0xd')]({'where':{'id':getInteractionId(_0x543594,_0x5b9cb1,_0x13c6a3)}})[_0xa897('0xe')](function(_0x475714){if(_0x475714){return _0x475714[_0xa897('0xf')]({'UserId':_0x35384c?_0x35384c['id']:null});}})[_0xa897('0xe')](function(_0x4c4f0b){if(_0x4c4f0b){log(_0xa897('0x10'),_0x35384c,_0x543594,_0x5b9cb1,_0x13c6a3,_0x5adedd);}})['catch'](function(){log(_0xa897('0x11'),_0x35384c,_0x543594,_0x5b9cb1,_0x13c6a3,_0x5adedd);});}exports['tracked']=function(_0x583819,_0x1e7cf5){return function(_0x1efa71,_0x262587,_0x17c569){var _0x926631=_0x1efa71['user'];var _0x389af7={};var _0x5a7e89=_0x1efa71['query'];if(_0x389af7){_0x389af7=_[_0xa897('0x12')](_0x1efa71[_0xa897('0x13')]);_0x389af7=_[_0xa897('0x14')](_0x389af7,[_0xa897('0x13'),_0xa897('0x15'),'phone','fax','mobile']);}updateUser(_0x926631,_0x389af7,_0x5a7e89,_0x583819,_0x1e7cf5);_0x17c569(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index fa23803..fb66fe2 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd267=['../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','catch','User','admin','user','isUserLimit','composable-middleware'];(function(_0x52221f,_0x27d7f0){var _0x3a6ab5=function(_0x1f576a){while(--_0x1f576a){_0x52221f['push'](_0x52221f['shift']());}};_0x3a6ab5(++_0x27d7f0);}(_0xd267,0x1c1));var _0x7d26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd267[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x7d26('0x0'));var db=require(_0x7d26('0x1'))['db'];var config=require(_0x7d26('0x2'));function getValueFromLicense(_0x427768,_0x11d5b4){if(_0x427768&&_0x11d5b4){if(_0x11d5b4[_0x7d26('0x3')]&&_0x11d5b4[_0x7d26('0x4')]){var _0x283f6b=_0x11d5b4['data1'];var _0x574079=_0x11d5b4['license'];var _0x5bba19=_0x283f6b[_0x7d26('0x5')]('-')[0x4];var _0x244b5b=_0x283f6b[_0x7d26('0x5')]('-')[0x0];var _0x1e86b5=crypto['createDecipher'](_0x7d26('0x6'),util[_0x7d26('0x7')](_0x7d26('0x8'),_0x5bba19,_0x283f6b,_0x244b5b));var _0xf6004c=_0x1e86b5['update'](_0x574079,_0x7d26('0x9'),'utf8');_0xf6004c+=_0x1e86b5['final'](_0x7d26('0xa'));var _0x302ba0=JSON[_0x7d26('0xb')](_0xf6004c);return _0x302ba0[_0x7d26('0xc')](_0x427768)?_0x302ba0[_0x427768]:null;}}return null;}function isLimit(_0xdbd670,_0x1b5368,_0x44d110,_0x10d1a7){var _0x32e32f=_0x1b5368;return compose()[_0x7d26('0xd')](function(_0x1a4c0e,_0x5dc36e,_0x335551){return db[_0x7d26('0xe')][_0x7d26('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x7d26('0x10')](function(_0x3c92ea){var _0x398b07=getValueFromLicense(_0xdbd670,_0x3c92ea);return _0x398b07?_0x398b07:_0x32e32f;})[_0x7d26('0x10')](function(_0x46924e){_0x32e32f=_0x46924e;return _0x44d110[_0x7d26('0x11')](_0x10d1a7);})['then'](function(_0x459181){if(_0x459181>=_0x32e32f){return _0x5dc36e[_0x7d26('0x12')](0x193)[_0x7d26('0x13')]({'message':util[_0x7d26('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0xdbd670)});}_0x335551();})[_0x7d26('0x14')](function(_0x253cc9){_0x335551(_0x253cc9);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x7d26('0x15')],{'where':{'$or':[{'role':_0x7d26('0x16')},{'role':_0x7d26('0x17')}]}});}exports[_0x7d26('0x18')]=isUserLimit; \ No newline at end of file +var _0x8600=['catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','base64','utf8','use','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x749c41,_0x814a97){var _0x193046=function(_0x5ba05c){while(--_0x5ba05c){_0x749c41['push'](_0x749c41['shift']());}};_0x193046(++_0x814a97);}(_0x8600,0x9c));var _0x0860=function(_0x3d27ba,_0x2671a3){_0x3d27ba=_0x3d27ba-0x0;var _0xf01885=_0x8600[_0x3d27ba];return _0xf01885;};'use strict';var crypto=require(_0x0860('0x0'));var util=require(_0x0860('0x1'));var compose=require(_0x0860('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x0860('0x3'));function getValueFromLicense(_0x14e852,_0x10175c){if(_0x14e852&&_0x10175c){if(_0x10175c[_0x0860('0x4')]&&_0x10175c[_0x0860('0x5')]){var _0x2f07ed=_0x10175c[_0x0860('0x4')];var _0x37c935=_0x10175c['license'];var _0x586866=_0x2f07ed['split']('-')[0x4];var _0x3735cd=_0x2f07ed[_0x0860('0x6')]('-')[0x0];var _0x299dfa=crypto[_0x0860('0x7')]('aes-256-ctr',util[_0x0860('0x8')](_0x0860('0x9'),_0x586866,_0x2f07ed,_0x3735cd));var _0x539bf6=_0x299dfa['update'](_0x37c935,_0x0860('0xa'),_0x0860('0xb'));_0x539bf6+=_0x299dfa['final'](_0x0860('0xb'));var _0x2c2beb=JSON['parse'](_0x539bf6);return _0x2c2beb['hasOwnProperty'](_0x14e852)?_0x2c2beb[_0x14e852]:null;}}return null;}function isLimit(_0x2b3a68,_0x15740d,_0x10e067,_0x5b4d4d){var _0x55d59b=_0x15740d;return compose()[_0x0860('0xc')](function(_0x541a44,_0x30c734,_0x9cc487){return db[_0x0860('0xd')][_0x0860('0xe')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x1606d3){var _0x41c970=getValueFromLicense(_0x2b3a68,_0x1606d3);return _0x41c970?_0x41c970:_0x55d59b;})[_0x0860('0xf')](function(_0x283683){_0x55d59b=_0x283683;return _0x10e067[_0x0860('0x10')](_0x5b4d4d);})['then'](function(_0xd2c1b3){if(_0xd2c1b3>=_0x55d59b){return _0x30c734[_0x0860('0x11')](0x193)['json']({'message':util[_0x0860('0x8')](_0x0860('0x12'),_0x2b3a68)});}_0x9cc487();})[_0x0860('0x13')](function(_0x4f9fe2){_0x9cc487(_0x4f9fe2);});});}function isUserLimit(){return isLimit(_0x0860('0x14'),0x1,db[_0x0860('0x15')],{'where':{'$or':[{'role':_0x0860('0x16')},{'role':_0x0860('0x17')}]}});}exports[_0x0860('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 50b5bf7..49bc500 100644 --- a/server/components/parsers/qs.js +++ b/server/components/parsers/qs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb402=['isObject','isString','length','unset','hasOwnProperty','isNumeric','match','^[0-9]*$','lodash','moment','sequelize','split','filters','forOwn','isArray','limit','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isEmpty'];(function(_0x3ceea3,_0x5f51a1){var _0x1fc4bb=function(_0x4e1b44){while(--_0x4e1b44){_0x3ceea3['push'](_0x3ceea3['shift']());}};_0x1fc4bb(++_0x5f51a1);}(_0xb402,0x1c8));var _0x2b40=function(_0x22e9fe,_0x3d019f){_0x22e9fe=_0x22e9fe-0x0;var _0x47cd19=_0xb402[_0x22e9fe];return _0x47cd19;};'use strict';var _=require(_0x2b40('0x0'));var moment=require(_0x2b40('0x1'));var sequelize=require(_0x2b40('0x2'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x3b1a6f){var _0x168760=null;if(_0x3b1a6f){_0x168760=_0x3b1a6f[_0x2b40('0x3')](',');}return _0x168760;};exports[_0x2b40('0x4')]=function(_0x30452b){var _0x1806da={};if(!_['isEmpty'](_0x30452b)){_0x1806da={};_[_0x2b40('0x5')](_0x30452b,function(_0x15d392,_0xed05a){try{_0x1806da[_0xed05a]=_[_0x2b40('0x6')](_0x15d392)?_0x15d392:JSON['parse'](_0x15d392);}catch(_0x2d389d){_0x1806da[_0xed05a]=_0x15d392[_0x2b40('0x3')](',');}});}return _0x1806da;};exports[_0x2b40('0x7')]=function(_0x1a8d4d){_0x1a8d4d=parseInt(_0x1a8d4d,0xa);if(!_0x1a8d4d||_0x1a8d4d<0x0){_0x1a8d4d=LIMIT_VALUE;}return _0x1a8d4d;};exports['offset']=function(_0x4670f4){_0x4670f4=parseInt(_0x4670f4,0xa);if(!_0x4670f4||_0x4670f4<0x0){_0x4670f4=0x0;}return _0x4670f4;};exports[_0x2b40('0x8')]=function(_0x24570a){var _0x2f393a,_0x491513=null;if(_0x24570a){_0x2f393a=_0x24570a[_0x2b40('0x3')](',');_0x491513=_[_0x2b40('0x9')](_0x2f393a,function(_0x3b2816){if(_0x3b2816[_0x2b40('0xa')]('-')===0x0){return[_0x3b2816===_0x2b40('0xb')?sequelize[_0x2b40('0xc')](sequelize[_0x2b40('0xd')](_0x2b40('0xb')),_0x2b40('0xe')):_0x3b2816[_0x2b40('0xf')](0x1),_0x2b40('0x10')];}else{return[_0x3b2816===_0x2b40('0xb')?sequelize[_0x2b40('0xc')](sequelize[_0x2b40('0xd')](_0x2b40('0xb')),'unsigned'):_0x3b2816,_0x2b40('0x11')];}});}return _0x491513;};exports[_0x2b40('0x12')]=function(_0x25914d,_0x57ce0f){if(_[_0x2b40('0x13')](_0x25914d)){return _0x25914d;}if(_[_0x2b40('0x6')](_0x25914d)){for(var _0x1731ce=0x0;_0x1731ce<_0x25914d['length'];_0x1731ce+=0x1){_0x25914d[_0x1731ce]=this['omit'](_0x25914d[_0x1731ce],_0x57ce0f);}return _0x25914d;}if(!_[_0x2b40('0x14')](_0x25914d)){return _0x25914d;}if(_[_0x2b40('0x15')](_0x57ce0f)){_0x57ce0f=[_0x57ce0f];}if(!_[_0x2b40('0x6')](_0x57ce0f)){return _0x25914d;}for(var _0x48dd4b=0x0;_0x48dd4b<_0x57ce0f[_0x2b40('0x16')];_0x48dd4b+=0x1){_[_0x2b40('0x17')](_0x25914d,_0x57ce0f[_0x48dd4b]);}for(var _0x1ade29 in _0x25914d){if(_0x25914d[_0x2b40('0x18')](_0x1ade29)){_0x25914d[_0x1ade29]=this[_0x2b40('0x12')](_0x25914d[_0x1ade29],_0x57ce0f);}}return _0x25914d;};exports[_0x2b40('0x19')]=function(_0x267e35){return _0x267e35[_0x2b40('0x1a')](RegExp(_0x2b40('0x1b')))?!![]:![];};exports['isEmail']=function(_0x355686){return _0x355686['match'](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file +var _0x4129=['offset','sort','map','indexOf','priority','cast','col','substr','DESC','unsigned','ASC','omit','isArray','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','lodash','moment','sequelize','fields','split','filters','isEmpty'];(function(_0x1b98b4,_0xb1826a){var _0x448bb3=function(_0x15ac17){while(--_0x15ac17){_0x1b98b4['push'](_0x1b98b4['shift']());}};_0x448bb3(++_0xb1826a);}(_0x4129,0xd1));var _0x9412=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4129[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9412('0x0'));var moment=require(_0x9412('0x1'));var sequelize=require(_0x9412('0x2'));var LIMIT_VALUE=0xfa;exports[_0x9412('0x3')]=function(_0x574888){var _0x51e93d=null;if(_0x574888){_0x51e93d=_0x574888[_0x9412('0x4')](',');}return _0x51e93d;};exports[_0x9412('0x5')]=function(_0x1b96b3){var _0x7c3a30={};if(!_[_0x9412('0x6')](_0x1b96b3)){_0x7c3a30={};_['forOwn'](_0x1b96b3,function(_0x3b3bd8,_0x4c1438){try{_0x7c3a30[_0x4c1438]=_['isArray'](_0x3b3bd8)?_0x3b3bd8:JSON['parse'](_0x3b3bd8);}catch(_0xc571bd){_0x7c3a30[_0x4c1438]=_0x3b3bd8[_0x9412('0x4')](',');}});}return _0x7c3a30;};exports['limit']=function(_0x2b0980){_0x2b0980=parseInt(_0x2b0980,0xa);if(!_0x2b0980||_0x2b0980<0x0){_0x2b0980=LIMIT_VALUE;}return _0x2b0980;};exports[_0x9412('0x7')]=function(_0x1ed508){_0x1ed508=parseInt(_0x1ed508,0xa);if(!_0x1ed508||_0x1ed508<0x0){_0x1ed508=0x0;}return _0x1ed508;};exports[_0x9412('0x8')]=function(_0x4ce943){var _0x4fa90b,_0xcba93a=null;if(_0x4ce943){_0x4fa90b=_0x4ce943[_0x9412('0x4')](',');_0xcba93a=_[_0x9412('0x9')](_0x4fa90b,function(_0xc4e166){if(_0xc4e166[_0x9412('0xa')]('-')===0x0){return[_0xc4e166===_0x9412('0xb')?sequelize[_0x9412('0xc')](sequelize[_0x9412('0xd')]('priority'),'unsigned'):_0xc4e166[_0x9412('0xe')](0x1),_0x9412('0xf')];}else{return[_0xc4e166===_0x9412('0xb')?sequelize[_0x9412('0xc')](sequelize['col'](_0x9412('0xb')),_0x9412('0x10')):_0xc4e166,_0x9412('0x11')];}});}return _0xcba93a;};exports[_0x9412('0x12')]=function(_0x58afc1,_0x2716e5){if(_[_0x9412('0x6')](_0x58afc1)){return _0x58afc1;}if(_[_0x9412('0x13')](_0x58afc1)){for(var _0x5d1caa=0x0;_0x5d1caa<_0x58afc1[_0x9412('0x14')];_0x5d1caa+=0x1){_0x58afc1[_0x5d1caa]=this[_0x9412('0x12')](_0x58afc1[_0x5d1caa],_0x2716e5);}return _0x58afc1;}if(!_[_0x9412('0x15')](_0x58afc1)){return _0x58afc1;}if(_[_0x9412('0x16')](_0x2716e5)){_0x2716e5=[_0x2716e5];}if(!_[_0x9412('0x13')](_0x2716e5)){return _0x58afc1;}for(var _0x37eedc=0x0;_0x37eedc<_0x2716e5[_0x9412('0x14')];_0x37eedc+=0x1){_[_0x9412('0x17')](_0x58afc1,_0x2716e5[_0x37eedc]);}for(var _0x2f2da9 in _0x58afc1){if(_0x58afc1[_0x9412('0x18')](_0x2f2da9)){_0x58afc1[_0x2f2da9]=this[_0x9412('0x12')](_0x58afc1[_0x2f2da9],_0x2716e5);}}return _0x58afc1;};exports[_0x9412('0x19')]=function(_0x498825){return _0x498825[_0x9412('0x1a')](RegExp('^[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x3d4d8c){return _0x3d4d8c[_0x9412('0x1a')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 082f8ea..127330c 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7390=['renderFile','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','moment','./environment','../mysqldb','get','env','set','appPath','join','development','test','client','use','json\x20replacer','static','views','root','/server/views','engine','ejs'];(function(_0x8a217e,_0x450bfc){var _0x3fc350=function(_0x55ed99){while(--_0x55ed99){_0x8a217e['push'](_0x8a217e['shift']());}};_0x3fc350(++_0x450bfc);}(_0x7390,0x146));var _0x0739=function(_0x4db727,_0x566559){_0x4db727=_0x4db727-0x0;var _0x13388e=_0x7390[_0x4db727];return _0x13388e;};'use strict';var express=require(_0x0739('0x0'));var favicon=require(_0x0739('0x1'));var bodyParser=require(_0x0739('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x0739('0x3'));var errorHandler=require(_0x0739('0x4'));var path=require(_0x0739('0x5'));var passport=require(_0x0739('0x6'));var cors=require('cors');var moment=require(_0x0739('0x7'));var config=require(_0x0739('0x8'));var db=require(_0x0739('0x9'))['db'];exports['default']=function(_0x141e0b){var _0x29ede4=_0x141e0b[_0x0739('0xa')](_0x0739('0xb'));if(_0x29ede4==='production'){_0x141e0b[_0x0739('0xc')](_0x0739('0xd'),path[_0x0739('0xe')](config['root'],'public'));}if(_0x29ede4===_0x0739('0xf')||_0x29ede4===_0x0739('0x10')){_0x141e0b[_0x0739('0xc')](_0x0739('0xd'),path['join'](config['root'],_0x0739('0x11')));_0x141e0b[_0x0739('0x12')](errorHandler());}_0x141e0b['set'](_0x0739('0x13'),function(_0x1b6fdf,_0x2d4e6){if(this[_0x1b6fdf]instanceof Date){_0x2d4e6=this[_0x1b6fdf]['toISOString']()['split']('.')[0x0]+'Z';}return _0x2d4e6;});_0x141e0b['use'](express[_0x0739('0x14')](_0x141e0b[_0x0739('0xa')](_0x0739('0xd'))));_0x141e0b[_0x0739('0xc')](_0x0739('0x15'),config[_0x0739('0x16')]+_0x0739('0x17'));_0x141e0b[_0x0739('0x18')]('html',require(_0x0739('0x19'))[_0x0739('0x1a')]);_0x141e0b[_0x0739('0xc')](_0x0739('0x1b'),'html');_0x141e0b['use'](bodyParser[_0x0739('0x1c')]({'limit':_0x0739('0x1d'),'extended':!![]}));_0x141e0b[_0x0739('0x12')](bodyParser[_0x0739('0x1e')]({'limit':_0x0739('0x1d')}));_0x141e0b[_0x0739('0x12')](cors());_0x141e0b[_0x0739('0x12')](methodOverride());_0x141e0b[_0x0739('0x12')](cookieParser());_0x141e0b[_0x0739('0x12')](passport[_0x0739('0x1f')]());}; \ No newline at end of file +var _0xe33b=['root','set','client','use','toISOString','static','views','/server/views','engine','html','ejs','renderFile','50mb','express','body-parser','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default','get','env','production','appPath','join'];(function(_0x56d20e,_0x217c31){var _0x18b27a=function(_0x5d68bb){while(--_0x5d68bb){_0x56d20e['push'](_0x56d20e['shift']());}};_0x18b27a(++_0x217c31);}(_0xe33b,0xd1));var _0xbe33=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xe33b[_0x20589d];return _0x422de9;};'use strict';var express=require(_0xbe33('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xbe33('0x1'));var methodOverride=require('method-override');var cookieParser=require(_0xbe33('0x2'));var errorHandler=require(_0xbe33('0x3'));var path=require(_0xbe33('0x4'));var passport=require('passport');var cors=require(_0xbe33('0x5'));var moment=require(_0xbe33('0x6'));var config=require(_0xbe33('0x7'));var db=require(_0xbe33('0x8'))['db'];exports[_0xbe33('0x9')]=function(_0x5b4d90){var _0x458a4b=_0x5b4d90[_0xbe33('0xa')](_0xbe33('0xb'));if(_0x458a4b===_0xbe33('0xc')){_0x5b4d90['set'](_0xbe33('0xd'),path[_0xbe33('0xe')](config[_0xbe33('0xf')],'public'));}if(_0x458a4b==='development'||_0x458a4b==='test'){_0x5b4d90[_0xbe33('0x10')](_0xbe33('0xd'),path[_0xbe33('0xe')](config[_0xbe33('0xf')],_0xbe33('0x11')));_0x5b4d90[_0xbe33('0x12')](errorHandler());}_0x5b4d90[_0xbe33('0x10')]('json\x20replacer',function(_0x2f393f,_0x2583b8){if(this[_0x2f393f]instanceof Date){_0x2583b8=this[_0x2f393f][_0xbe33('0x13')]()['split']('.')[0x0]+'Z';}return _0x2583b8;});_0x5b4d90[_0xbe33('0x12')](express[_0xbe33('0x14')](_0x5b4d90[_0xbe33('0xa')](_0xbe33('0xd'))));_0x5b4d90[_0xbe33('0x10')](_0xbe33('0x15'),config[_0xbe33('0xf')]+_0xbe33('0x16'));_0x5b4d90[_0xbe33('0x17')](_0xbe33('0x18'),require(_0xbe33('0x19'))[_0xbe33('0x1a')]);_0x5b4d90['set']('view\x20engine','html');_0x5b4d90[_0xbe33('0x12')](bodyParser['urlencoded']({'limit':'50mb','extended':!![]}));_0x5b4d90['use'](bodyParser['json']({'limit':_0xbe33('0x1b')}));_0x5b4d90[_0xbe33('0x12')](cors());_0x5b4d90[_0xbe33('0x12')](methodOverride());_0x5b4d90[_0xbe33('0x12')](cookieParser());_0x5b4d90['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 7fa3ef1..58f038c 100644 --- a/server/config/license/hardware.js +++ b/server/config/license/hardware.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6dac=['win32','utf8','replace','macAddress','md5','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','update','digest','hex','getUuid','platform'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x6dac,0x16e));var _0xc6da=function(_0x3d6a73,_0x48e4de){_0x3d6a73=_0x3d6a73-0x0;var _0x3fe924=_0x6dac[_0x3d6a73];return _0x3fe924;};'use strict';var _=require(_0xc6da('0x0'));var os=require('os');var crypto=require(_0xc6da('0x1'));var machine=require(_0xc6da('0x2'));var exec=require(_0xc6da('0x3'))[_0xc6da('0x4')];function getInterfaces(){var _0x224a52=[];var _0x3391f5=os[_0xc6da('0x5')]();var _0x28663f=_[_0xc6da('0x6')](_[_0xc6da('0x7')](_0x3391f5));for(var _0xb6c5b2=0x0;_0xb6c5b2<_0x28663f[_0xc6da('0x8')];_0xb6c5b2++){var _0x5caf49=_0x3391f5[_0x28663f[_0xb6c5b2]][_0xc6da('0x9')](function(_0x1abd90){return _0x1abd90[_0xc6da('0xa')]===_0xc6da('0xb')&&_0x1abd90[_0xc6da('0xc')]===![];});_0x224a52=_0x224a52[_0xc6da('0xd')](_0x5caf49);}return _0x224a52;}function getFirstInterface(){var _0x909bcf=_[_0xc6da('0xe')](getInterfaces());return{'macAddress':_0x909bcf&&_0x909bcf[_0xc6da('0xf')]?_0x909bcf['mac']:_0xc6da('0x10'),'ipAddress':_0x909bcf&&_0x909bcf[_0xc6da('0x11')]?_0x909bcf[_0xc6da('0x11')]:_0xc6da('0x12')};}exports[_0xc6da('0x13')]=getFirstInterface;function getCPUhash(){var _0x27411e=_[_0xc6da('0x6')](os[_0xc6da('0x14')]()[_0xc6da('0x15')](function(_0x22d0e3){return _0x22d0e3[_0xc6da('0x16')];}))[_0xc6da('0x17')](':');return crypto[_0xc6da('0x18')]('md5')[_0xc6da('0x19')](_0x27411e)[_0xc6da('0x1a')](_0xc6da('0x1b'));}exports[_0xc6da('0x1c')]=function(){switch(os[_0xc6da('0x1d')]()){case _0xc6da('0x1e'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xc6da('0x1f')})[_0xc6da('0x20')]('\x0d\x0a','');default:var _0x287468=getFirstInterface();var _0x43a97a=getCPUhash();var _0x7df0a8=_0x43a97a+'|'+os['hostname']()+'|'+_0x287468[_0xc6da('0x21')]+'|'+_0x287468['ipAddress'];var _0x362e56=crypto[_0xc6da('0x18')](_0xc6da('0x22'))[_0xc6da('0x19')](_0x7df0a8)['digest'](_0xc6da('0x1b'));return _0x362e56[_0xc6da('0x23')](0x0,0x8)+'-'+_0x362e56[_0xc6da('0x23')](0x8,0xc)+'-'+_0x362e56[_0xc6da('0x23')](0xc,0x10)+'-'+_0x362e56[_0xc6da('0x23')](0x10,0x14)+'-'+_0x362e56[_0xc6da('0x23')](0x14);}}; \ No newline at end of file +var _0x25fa=['substring','lodash','bimedia-machine-uuid','child_process','networkInterfaces','keys','length','filter','family','IPv4','internal','concat','mac','address','127.0.0.1','getFirstInterface','orderBy','cpus','model','createHash','md5','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x25fa,0x109));var _0xa25f=function(_0x2a3d82,_0x363e77){_0x2a3d82=_0x2a3d82-0x0;var _0x3a6e8b=_0x25fa[_0x2a3d82];return _0x3a6e8b;};'use strict';var _=require(_0xa25f('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xa25f('0x1'));var exec=require(_0xa25f('0x2'))['execSync'];function getInterfaces(){var _0x408155=[];var _0xb88bd8=os[_0xa25f('0x3')]();var _0x4d0b34=_['orderBy'](_[_0xa25f('0x4')](_0xb88bd8));for(var _0x50dafc=0x0;_0x50dafc<_0x4d0b34[_0xa25f('0x5')];_0x50dafc++){var _0x3ab530=_0xb88bd8[_0x4d0b34[_0x50dafc]][_0xa25f('0x6')](function(_0x455225){return _0x455225[_0xa25f('0x7')]===_0xa25f('0x8')&&_0x455225[_0xa25f('0x9')]===![];});_0x408155=_0x408155[_0xa25f('0xa')](_0x3ab530);}return _0x408155;}function getFirstInterface(){var _0xa27a42=_['head'](getInterfaces());return{'macAddress':_0xa27a42&&_0xa27a42[_0xa25f('0xb')]?_0xa27a42[_0xa25f('0xb')]:'00:00:00:00:00:00','ipAddress':_0xa27a42&&_0xa27a42[_0xa25f('0xc')]?_0xa27a42[_0xa25f('0xc')]:_0xa25f('0xd')};}exports[_0xa25f('0xe')]=getFirstInterface;function getCPUhash(){var _0x5168c1=_[_0xa25f('0xf')](os[_0xa25f('0x10')]()['map'](function(_0x3e970c){return _0x3e970c[_0xa25f('0x11')];}))['join'](':');return crypto[_0xa25f('0x12')](_0xa25f('0x13'))[_0xa25f('0x14')](_0x5168c1)[_0xa25f('0x15')](_0xa25f('0x16'));}exports[_0xa25f('0x17')]=function(){switch(os[_0xa25f('0x18')]()){case _0xa25f('0x19'):return exec(_0xa25f('0x1a'),{'encoding':_0xa25f('0x1b')})[_0xa25f('0x1c')]('\x0d\x0a','');default:var _0x1859ba=getFirstInterface();var _0x57ada6=getCPUhash();var _0x2d4f0f=_0x57ada6+'|'+os[_0xa25f('0x1d')]()+'|'+_0x1859ba[_0xa25f('0x1e')]+'|'+_0x1859ba[_0xa25f('0x1f')];var _0x18705c=crypto[_0xa25f('0x12')]('md5')[_0xa25f('0x14')](_0x2d4f0f)['digest'](_0xa25f('0x16'));return _0x18705c['substring'](0x0,0x8)+'-'+_0x18705c['substring'](0x8,0xc)+'-'+_0x18705c[_0xa25f('0x20')](0xc,0x10)+'-'+_0x18705c['substring'](0x10,0x14)+'-'+_0x18705c[_0xa25f('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0d74f66..bff7151 100644 --- a/server/config/license/index.js +++ b/server/config/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e24=['./hardware','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','createCipher','aes-256-ctr','secrets','session','update','utf8','base64','createDecipher','final','||FIELD||VALUE||\x0a','User','admin','email','then','|reason|','|uuid|','|name|','fullname','|email|','getFirstInterface','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','data1','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','toUpperCase','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','error','message','finally','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','crypto','moment','request-promise','bluebird','version','../../mysqldb'];(function(_0x45ae88,_0x5603da){var _0x21a547=function(_0x4aab67){while(--_0x4aab67){_0x45ae88['push'](_0x45ae88['shift']());}};_0x21a547(++_0x5603da);}(_0x3e24,0x167));var _0x43e2=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0x3e24[_0x3c5e54];return _0x3ae1f3;};'use strict';var util=require(_0x43e2('0x0'));var crypto=require(_0x43e2('0x1'));var moment=require(_0x43e2('0x2'));var rp=require(_0x43e2('0x3'));var BPromise=require(_0x43e2('0x4'));var pkginfo=require('pkginfo')(module,_0x43e2('0x5'));var db=require(_0x43e2('0x6'))['db'];var config=require('../environment');var hardware=require(_0x43e2('0x7'));var logger=require(_0x43e2('0x8'))(_0x43e2('0x9'));var jira=require(_0x43e2('0xa'));var HOST=_0x43e2('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x121e2e){return new BPromise(function(_0x23b2d8,_0x59956d){var _0xb75b=util[_0x43e2('0xc')]('%s/api/servers/%s/check?version=%s',HOST,_0x121e2e,module[_0x43e2('0xd')][_0x43e2('0x5')]);if(oldToken){_0xb75b=util['format'](_0x43e2('0xe'),HOST,_0x121e2e,module[_0x43e2('0xd')]['version'],oldToken);}var _0x45848e={'uri':_0xb75b,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x45848e)['then'](function(_0x5847f0){_0x23b2d8(_0x5847f0);})[_0x43e2('0xf')](function(_0x33dbcb){_0x59956d(_0x33dbcb);});});}function encryptDate(_0x236b88){var _0x44781a=crypto[_0x43e2('0x10')](_0x43e2('0x11'),config[_0x43e2('0x12')][_0x43e2('0x13')]);var _0x10d166=_0x44781a[_0x43e2('0x14')](_0x236b88,_0x43e2('0x15'),_0x43e2('0x16'));_0x10d166+=_0x44781a['final'](_0x43e2('0x16'));return _0x10d166;}function decryptDate(_0x40fb7b){var _0xb929b5=crypto[_0x43e2('0x17')]('aes-256-ctr',config['secrets'][_0x43e2('0x13')]);var _0x417ce5=_0xb929b5[_0x43e2('0x14')](_0x40fb7b,_0x43e2('0x16'),_0x43e2('0x15'));_0x417ce5+=_0xb929b5[_0x43e2('0x18')](_0x43e2('0x15'));return _0x417ce5;}function sendJiraAlert(_0x15ecb5,_0x3236b9,_0x399cab){var _0x4879e9=_0x43e2('0x19');return db[_0x43e2('0x1a')]['findOne']({'where':{'role':_0x43e2('0x1b')},'attributes':['fullname',_0x43e2('0x1c')],'raw':!![]})[_0x43e2('0x1d')](function(_0x1fac53){ADMIN=_0x1fac53;_0x4879e9+=_0x43e2('0x1e')+_0x399cab+'|\x0a';_0x4879e9+=_0x43e2('0x1f')+_0x15ecb5+'|\x0a';_0x4879e9+='|machineUuid|'+_0x3236b9+'|\x0a';_0x4879e9+=_0x43e2('0x20')+ADMIN[_0x43e2('0x21')]+'|\x0a';_0x4879e9+=_0x43e2('0x22')+ADMIN['email']+'|\x0a';return _0x4879e9;})[_0x43e2('0x1d')](function(_0x32f048){var _0x43078f=hardware[_0x43e2('0x23')]()['ipAddress'];return jira[_0x43e2('0x24')]({'key':_0x43e2('0x25'),'summary':_0x43e2('0x26'),'description':_0x32f048,'issuetype':_0x43e2('0x27'),'oldToken':_0x15ecb5,'newToken':_0x3236b9,'email':ADMIN[_0x43e2('0x1c')],'name':ADMIN[_0x43e2('0x21')],'reason':GRAY_PERIOD_REASON,'ip':_0x43078f});});}function manageLicense(_0x3ca16b,_0x39a75d){var _0xd29b7b=_0x39a75d[_0x43e2('0x28')]({'plain':!![]});httpRequest(_0x3ca16b)[_0x43e2('0x1d')](function(_0x1de7e1){if(oldToken){oldToken=undefined;}if(_0x1de7e1['active']){if(!_0xd29b7b[_0x43e2('0x9')]&&_0xd29b7b[_0x43e2('0x9')]!=_0x1de7e1['license']||_0xd29b7b[_0x43e2('0x9')]&&_0xd29b7b[_0x43e2('0x29')]){logger[_0x43e2('0x2a')](_0x43e2('0x2b'));}if(_0xd29b7b[_0x43e2('0x9')]&&!_0xd29b7b['data2']&&_0xd29b7b[_0x43e2('0x9')]!=_0x1de7e1[_0x43e2('0x9')]){logger[_0x43e2('0x2a')](_0x43e2('0x2c'));}if(_0xd29b7b[_0x43e2('0x9')]&&!_0xd29b7b[_0x43e2('0x29')]&&_0xd29b7b['license']==_0x1de7e1['license']){return _0x39a75d;}return _0x39a75d[_0x43e2('0x14')]({'data1':_0x3ca16b,'data2':null,'license':_0x1de7e1[_0x43e2('0x9')]});}else{if(_0x1de7e1[_0x43e2('0x9')]||_0xd29b7b[_0x43e2('0x9')]){if(!_0xd29b7b[_0x43e2('0x29')]){if(_0xd29b7b['data1']==_0x3ca16b){GRAY_PERIOD_REASON=_0x43e2('0x2d');logger[_0x43e2('0x2a')](_0x43e2('0x2e'));}else{GRAY_PERIOD_REASON=_0x43e2('0x2f');oldToken=_0xd29b7b[_0x43e2('0x30')];logger[_0x43e2('0x2a')](_0x43e2('0x31'),_0xd29b7b['data1'],_0x3ca16b);}sendJiraAlert(_0xd29b7b['data1'],_0x1de7e1[_0x43e2('0x32')],GRAY_PERIOD_REASON);logger[_0x43e2('0x2a')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x43e2('0x33')](),moment()[_0x43e2('0xc')]('YYYY-MM-DD\x20HH:mm'));return _0x39a75d[_0x43e2('0x14')]({'data2':encryptDate(moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](decryptDate(_0xd29b7b[_0x43e2('0x29')]),'days')>DAYS){logger[_0x43e2('0x2a')](_0x43e2('0x34'),moment()[_0x43e2('0xc')](_0x43e2('0x35')));return _0x39a75d[_0x43e2('0x14')]({'data1':_0x3ca16b,'data2':null,'license':null});}}}else{if(_0xd29b7b[_0x43e2('0x30')]!=_0x3ca16b){logger[_0x43e2('0x2a')](_0x43e2('0x31'),_0xd29b7b[_0x43e2('0x30')],_0x3ca16b);return _0x39a75d[_0x43e2('0x14')]({'data1':_0x3ca16b,'data2':null,'license':null});}}}return _0x39a75d;})[_0x43e2('0x1d')](function(_0xf38103){_0x39a75d=_0xf38103;})[_0x43e2('0xf')](function(_0x134f36){logger[_0x43e2('0x36')](_0x134f36[_0x43e2('0x37')]);})[_0x43e2('0x38')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x39a75d);},TIME);});}function defaultLicense(){var _0x4da45f=hardware['getUuid']();if(_0x4da45f){return db[_0x43e2('0x39')][_0x43e2('0x3a')]({'where':{'id':0x1},'defaults':{'data1':_0x4da45f}})['spread'](function(_0x5cfde9,_0x2b5fce){logger[_0x43e2('0x2a')](_0x43e2('0x3b'),_0x4da45f);manageLicense(_0x4da45f,_0x5cfde9);})[_0x43e2('0xf')](function(_0x2f9567){logger[_0x43e2('0x36')](_0x2f9567[_0x43e2('0x37')]);});}}exports[_0x43e2('0x3c')]=defaultLicense; \ No newline at end of file +var _0xa24d=['get','active','data2','info','data1','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','diff','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','crypto','moment','request-promise','bluebird','pkginfo','version','../environment','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','aes-256-ctr','secrets','session','utf8','final','base64','createDecipher','update','findOne','admin','fullname','email','then','|reason|','|machineUuid|','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert'];(function(_0x463af6,_0x556ddc){var _0x4a59f1=function(_0x3e7600){while(--_0x3e7600){_0x463af6['push'](_0x463af6['shift']());}};_0x4a59f1(++_0x556ddc);}(_0xa24d,0x1c1));var _0xda24=function(_0x253b13,_0x247a2f){_0x253b13=_0x253b13-0x0;var _0x396bcc=_0xa24d[_0x253b13];return _0x396bcc;};'use strict';var util=require(_0xda24('0x0'));var crypto=require(_0xda24('0x1'));var moment=require(_0xda24('0x2'));var rp=require(_0xda24('0x3'));var BPromise=require(_0xda24('0x4'));var pkginfo=require(_0xda24('0x5'))(module,_0xda24('0x6'));var db=require('../../mysqldb')['db'];var config=require(_0xda24('0x7'));var hardware=require(_0xda24('0x8'));var logger=require(_0xda24('0x9'))(_0xda24('0xa'));var jira=require('../../api/jira/jira.controller');var HOST=_0xda24('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0xdba54e){return new BPromise(function(_0x5868af,_0x3d0ec5){var _0x48117a=util[_0xda24('0xc')](_0xda24('0xd'),HOST,_0xdba54e,module[_0xda24('0xe')][_0xda24('0x6')]);if(oldToken){_0x48117a=util['format'](_0xda24('0xf'),HOST,_0xdba54e,module[_0xda24('0xe')][_0xda24('0x6')],oldToken);}var _0x3a508b={'uri':_0x48117a,'method':_0xda24('0x10'),'timeout':0xea60,'json':!![]};return rp(_0x3a508b)['then'](function(_0x32c867){_0x5868af(_0x32c867);})['catch'](function(_0x3c2d60){_0x3d0ec5(_0x3c2d60);});});}function encryptDate(_0x3d9420){var _0x519fb9=crypto['createCipher'](_0xda24('0x11'),config[_0xda24('0x12')][_0xda24('0x13')]);var _0x2d271d=_0x519fb9['update'](_0x3d9420,_0xda24('0x14'),'base64');_0x2d271d+=_0x519fb9[_0xda24('0x15')](_0xda24('0x16'));return _0x2d271d;}function decryptDate(_0x57f4d6){var _0x547e1c=crypto[_0xda24('0x17')](_0xda24('0x11'),config[_0xda24('0x12')][_0xda24('0x13')]);var _0x3348e0=_0x547e1c[_0xda24('0x18')](_0x57f4d6,_0xda24('0x16'),_0xda24('0x14'));_0x3348e0+=_0x547e1c[_0xda24('0x15')]('utf8');return _0x3348e0;}function sendJiraAlert(_0x22b57d,_0x793b05,_0x52b393){var _0x1eb304='||FIELD||VALUE||\x0a';return db['User'][_0xda24('0x19')]({'where':{'role':_0xda24('0x1a')},'attributes':[_0xda24('0x1b'),_0xda24('0x1c')],'raw':!![]})[_0xda24('0x1d')](function(_0x4179f1){ADMIN=_0x4179f1;_0x1eb304+=_0xda24('0x1e')+_0x52b393+'|\x0a';_0x1eb304+='|uuid|'+_0x22b57d+'|\x0a';_0x1eb304+=_0xda24('0x1f')+_0x793b05+'|\x0a';_0x1eb304+='|name|'+ADMIN[_0xda24('0x1b')]+'|\x0a';_0x1eb304+=_0xda24('0x20')+ADMIN[_0xda24('0x1c')]+'|\x0a';return _0x1eb304;})[_0xda24('0x1d')](function(_0x17c573){var _0x2f9ae2=hardware[_0xda24('0x21')]()[_0xda24('0x22')];return jira[_0xda24('0x23')]({'key':_0xda24('0x24'),'summary':_0xda24('0x25'),'description':_0x17c573,'issuetype':_0xda24('0x26'),'oldToken':_0x22b57d,'newToken':_0x793b05,'email':ADMIN['email'],'name':ADMIN[_0xda24('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x2f9ae2});});}function manageLicense(_0x30e886,_0xc668d){var _0x35ff0f=_0xc668d[_0xda24('0x27')]({'plain':!![]});httpRequest(_0x30e886)[_0xda24('0x1d')](function(_0x5bf414){if(oldToken){oldToken=undefined;}if(_0x5bf414[_0xda24('0x28')]){if(!_0x35ff0f['license']&&_0x35ff0f[_0xda24('0xa')]!=_0x5bf414[_0xda24('0xa')]||_0x35ff0f['license']&&_0x35ff0f[_0xda24('0x29')]){logger[_0xda24('0x2a')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x35ff0f[_0xda24('0xa')]&&!_0x35ff0f[_0xda24('0x29')]&&_0x35ff0f[_0xda24('0xa')]!=_0x5bf414[_0xda24('0xa')]){logger[_0xda24('0x2a')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x35ff0f['license']&&!_0x35ff0f[_0xda24('0x29')]&&_0x35ff0f['license']==_0x5bf414['license']){return _0xc668d;}return _0xc668d[_0xda24('0x18')]({'data1':_0x30e886,'data2':null,'license':_0x5bf414[_0xda24('0xa')]});}else{if(_0x5bf414['license']||_0x35ff0f['license']){if(!_0x35ff0f[_0xda24('0x29')]){if(_0x35ff0f[_0xda24('0x2b')]==_0x30e886){GRAY_PERIOD_REASON='Disabled';logger['info'](_0xda24('0x2c'));}else{GRAY_PERIOD_REASON=_0xda24('0x2d');oldToken=_0x35ff0f[_0xda24('0x2b')];logger[_0xda24('0x2a')](_0xda24('0x2e'),_0x35ff0f['data1'],_0x30e886);}sendJiraAlert(_0x35ff0f[_0xda24('0x2b')],_0x5bf414[_0xda24('0x2f')],GRAY_PERIOD_REASON);logger[_0xda24('0x2a')](_0xda24('0x30'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xda24('0xc')]('YYYY-MM-DD\x20HH:mm'));return _0xc668d[_0xda24('0x18')]({'data2':encryptDate(moment()[_0xda24('0xc')](_0xda24('0x31')))});}else{if(moment()[_0xda24('0x32')](decryptDate(_0x35ff0f[_0xda24('0x29')]),'days')>DAYS){logger[_0xda24('0x2a')](_0xda24('0x33'),moment()[_0xda24('0xc')](_0xda24('0x31')));return _0xc668d[_0xda24('0x18')]({'data1':_0x30e886,'data2':null,'license':null});}}}else{if(_0x35ff0f['data1']!=_0x30e886){logger[_0xda24('0x2a')](_0xda24('0x2e'),_0x35ff0f['data1'],_0x30e886);return _0xc668d['update']({'data1':_0x30e886,'data2':null,'license':null});}}}return _0xc668d;})['then'](function(_0x182674){_0xc668d=_0x182674;})[_0xda24('0x34')](function(_0x355c6e){logger[_0xda24('0x35')](_0x355c6e[_0xda24('0x36')]);})[_0xda24('0x37')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0xc668d);},TIME);});}function defaultLicense(){var _0x70fe54=hardware[_0xda24('0x38')]();if(_0x70fe54){return db[_0xda24('0x39')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x70fe54}})[_0xda24('0x3a')](function(_0x4b4d84,_0x25d0cd){logger['info'](_0xda24('0x3b'),_0x70fe54);manageLicense(_0x70fe54,_0x4b4d84);})['catch'](function(_0x404000){logger['error'](_0x404000['message']);});}}exports[_0xda24('0x3c')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 3e973c7..72120ba 100644 --- a/server/config/license/util.js +++ b/server/config/license/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2b7=['base64','utf8','final','parse','uuid','getUuid','aes-256-ctr','deadline','add','grayReason','changed','disabled','Breaking\x20license','message','Demo\x20license','find','defaults','then','checkLicense','crypto','util','lodash','moment','./hardware','../../mysqldb','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','format','%s:%s:%s','update'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xb2b7,0x79));var _0x7b2b=function(_0x3a9c01,_0x5a2e25){_0x3a9c01=_0x3a9c01-0x0;var _0x146644=_0xb2b7[_0x3a9c01];return _0x146644;};'use strict';var crypto=require(_0x7b2b('0x0'));var util=require(_0x7b2b('0x1'));var _=require(_0x7b2b('0x2'));var moment=require(_0x7b2b('0x3'));var hardware=require(_0x7b2b('0x4'));var config=require('../environment');var db=require(_0x7b2b('0x5'))['db'];function checkLicense(_0x407078,_0x3f6c53){if(_0x407078){try{var _0x31d72c=_0x3f6c53||_0x407078['license'];if(_[_0x7b2b('0x6')](_0x31d72c)){throw new Error(_0x7b2b('0x7'));}var _0x3af9a6=_0x407078[_0x7b2b('0x8')];var _0x1d9141=_0x407078[_0x7b2b('0x9')];var _0x2687bc=_0x3af9a6[_0x7b2b('0xa')]('-')[0x4];var _0x2ed7b9=_0x3af9a6[_0x7b2b('0xa')]('-')[0x0];var _0x57b032=crypto[_0x7b2b('0xb')]('aes-256-ctr',util[_0x7b2b('0xc')](_0x7b2b('0xd'),_0x2687bc,_0x3af9a6,_0x2ed7b9));var _0x2d26dd=_0x57b032[_0x7b2b('0xe')](_0x31d72c,_0x7b2b('0xf'),_0x7b2b('0x10'));_0x2d26dd+=_0x57b032[_0x7b2b('0x11')](_0x7b2b('0x10'));var _0x4b04e6=JSON[_0x7b2b('0x12')](_0x2d26dd);_0x4b04e6['demo']=![];_0x4b04e6[_0x7b2b('0x13')]=_0x3af9a6;_0x4b04e6['machineUuid']=hardware[_0x7b2b('0x14')]();if(_0x1d9141){var _0x30663d=crypto[_0x7b2b('0xb')](_0x7b2b('0x15'),config['secrets']['session']);var _0x52fef5=_0x30663d['update'](_0x1d9141,_0x7b2b('0xf'),_0x7b2b('0x10'));_0x52fef5+=_0x30663d[_0x7b2b('0x11')]('utf8');_0x4b04e6['gray']=_0x52fef5;_0x4b04e6[_0x7b2b('0x16')]=moment(_0x52fef5)[_0x7b2b('0x17')](0x7,'days')[_0x7b2b('0xc')]();_0x4b04e6[_0x7b2b('0x18')]=_0x4b04e6['uuid']!=_0x4b04e6['machineUuid']?_0x7b2b('0x19'):_0x7b2b('0x1a');}return _0x4b04e6;}catch(_0x3ded85){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x7b2b('0x1b'),'uuid':_0x407078[_0x7b2b('0x8')],'machineUuid':hardware[_0x7b2b('0x14')](),'message':_0x3ded85[_0x7b2b('0x1c')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x7b2b('0x1d'),'uuid':_0x407078[_0x7b2b('0x8')],'machineUuid':hardware[_0x7b2b('0x14')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports['getLicense']=function(_0x3a3f62){return db['License'][_0x7b2b('0x1e')](_[_0x7b2b('0x1f')](_0x3a3f62,{'raw':!![],'where':{'id':0x1}}))[_0x7b2b('0x20')](function(_0x27973b){return checkLicense(_0x27973b,null);});};exports[_0x7b2b('0x21')]=checkLicense; \ No newline at end of file +var _0xaf73=['lodash','moment','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','aes-256-ctr','%s:%s:%s','update','base64','utf8','final','demo','uuid','createDecipher','secrets','session','deadline','days','format','grayReason','machineUuid','disabled','2027-01-01T00:00:00.000Z','message','Demo\x20license','getUuid','getLicense','find','defaults','then','checkLicense','crypto','util'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0xaf73,0x1ec));var _0x3af7=function(_0x4571cb,_0x5afa6f){_0x4571cb=_0x4571cb-0x0;var _0x12a183=_0xaf73[_0x4571cb];return _0x12a183;};'use strict';var crypto=require(_0x3af7('0x0'));var util=require(_0x3af7('0x1'));var _=require(_0x3af7('0x2'));var moment=require(_0x3af7('0x3'));var hardware=require('./hardware');var config=require(_0x3af7('0x4'));var db=require(_0x3af7('0x5'))['db'];function checkLicense(_0x251703,_0x5b4cba){if(_0x251703){try{var _0x2ea3cb=_0x5b4cba||_0x251703[_0x3af7('0x6')];if(_[_0x3af7('0x7')](_0x2ea3cb)){throw new Error(_0x3af7('0x8'));}var _0xa68296=_0x251703[_0x3af7('0x9')];var _0x380e00=_0x251703[_0x3af7('0xa')];var _0x49078d=_0xa68296[_0x3af7('0xb')]('-')[0x4];var _0x4c82a5=_0xa68296[_0x3af7('0xb')]('-')[0x0];var _0x65ee3b=crypto['createDecipher'](_0x3af7('0xc'),util['format'](_0x3af7('0xd'),_0x49078d,_0xa68296,_0x4c82a5));var _0x59832f=_0x65ee3b[_0x3af7('0xe')](_0x2ea3cb,_0x3af7('0xf'),_0x3af7('0x10'));_0x59832f+=_0x65ee3b[_0x3af7('0x11')](_0x3af7('0x10'));var _0x3fadbc=JSON['parse'](_0x59832f);_0x3fadbc[_0x3af7('0x12')]=![];_0x3fadbc[_0x3af7('0x13')]=_0xa68296;_0x3fadbc['machineUuid']=hardware['getUuid']();if(_0x380e00){var _0x3a4555=crypto[_0x3af7('0x14')]('aes-256-ctr',config[_0x3af7('0x15')][_0x3af7('0x16')]);var _0x20328c=_0x3a4555[_0x3af7('0xe')](_0x380e00,'base64',_0x3af7('0x10'));_0x20328c+=_0x3a4555[_0x3af7('0x11')](_0x3af7('0x10'));_0x3fadbc['gray']=_0x20328c;_0x3fadbc[_0x3af7('0x17')]=moment(_0x20328c)['add'](0x7,_0x3af7('0x18'))[_0x3af7('0x19')]();_0x3fadbc[_0x3af7('0x1a')]=_0x3fadbc[_0x3af7('0x13')]!=_0x3fadbc[_0x3af7('0x1b')]?'changed':_0x3af7('0x1c');}return _0x3fadbc;}catch(_0x2006c8){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3af7('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x251703['data1'],'machineUuid':hardware['getUuid'](),'message':_0x2006c8[_0x3af7('0x1e')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3af7('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x3af7('0x1f'),'uuid':_0x251703[_0x3af7('0x9')],'machineUuid':hardware[_0x3af7('0x20')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x3af7('0x21')]=function(_0x20fbcd){return db['License'][_0x3af7('0x22')](_[_0x3af7('0x23')](_0x20fbcd,{'raw':!![],'where':{'id':0x1}}))[_0x3af7('0x24')](function(_0x2c2ec7){return checkLicense(_0x2c2ec7,null);});};exports[_0x3af7('0x25')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 3550da6..aeb9a47 100644 --- a/server/config/local.env.js +++ b/server/config/local.env.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfad0=['app-id','secret','http://localhost:9000'];(function(_0x4b7cd5,_0x2b816b){var _0x410c56=function(_0x3b6c4f){while(--_0x3b6c4f){_0x4b7cd5['push'](_0x4b7cd5['shift']());}};_0x410c56(++_0x2b816b);}(_0xfad0,0xb0));var _0x0fad=function(_0x58879a,_0x1d3bce){_0x58879a=_0x58879a-0x0;var _0x28de3f=_0xfad0[_0x58879a];return _0x28de3f;};'use strict';module['exports']={'DOMAIN':_0x0fad('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x0fad('0x1'),'GOOGLE_SECRET':_0x0fad('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x0a2d=['exports','http://localhost:9000','myappanuglar-secret'];(function(_0x1082b7,_0xb7a0aa){var _0x2bd213=function(_0x2e61b1){while(--_0x2e61b1){_0x1082b7['push'](_0x1082b7['shift']());}};_0x2bd213(++_0xb7a0aa);}(_0x0a2d,0x14a));var _0xd0a2=function(_0x25e5d7,_0x2e04ea){_0x25e5d7=_0x25e5d7-0x0;var _0xd472c1=_0x0a2d[_0x25e5d7];return _0xd472c1;};'use strict';module[_0xd0a2('0x0')]={'DOMAIN':_0xd0a2('0x1'),'SESSION_SECRET':_0xd0a2('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 05e38b2..d80cf73 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf56=['/var','log','%s-%s.log','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','path','INFO','join'];(function(_0x3ca349,_0x203ed0){var _0xeac360=function(_0x1ba652){while(--_0x1ba652){_0x3ca349['push'](_0x3ca349['shift']());}};_0xeac360(++_0x203ed0);}(_0xbf56,0x162));var _0x6bf5=function(_0xc7f321,_0x1d6caa){_0xc7f321=_0xc7f321-0x0;var _0x19bd59=_0xbf56[_0xc7f321];return _0x19bd59;};'use strict';var moment=require(_0x6bf5('0x0'));var winston=require(_0x6bf5('0x1'));var util=require(_0x6bf5('0x2'));var path=require(_0x6bf5('0x3'));var debugLevel=_0x6bf5('0x4');function filename(_0x3833ce,_0x526718){return path[_0x6bf5('0x5')](_0x6bf5('0x6'),_0x6bf5('0x7'),'xcally',util['format'](_0x6bf5('0x8'),_0x3833ce,_0x526718));}function formatter(_0x3d9897,_0x26f159){return util[_0x6bf5('0x9')](_0x6bf5('0xa'),moment()[_0x6bf5('0x9')](_0x6bf5('0xb')),_0x26f159[_0x6bf5('0xc')][_0x6bf5('0xd')](),_0x3d9897,_0x26f159['message']);}module[_0x6bf5('0xe')]=function(_0x50ec18){return new winston[(_0x6bf5('0xf'))]({'transports':[new winston[(_0x6bf5('0x10'))][(_0x6bf5('0x11'))]({'name':util['format'](_0x6bf5('0x12'),_0x50ec18,'error'),'filename':filename(_0x50ec18,_0x6bf5('0x13')),'level':_0x6bf5('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x297491){return formatter(_0x50ec18,_0x297491);}}),new winston[(_0x6bf5('0x10'))][(_0x6bf5('0x11'))]({'name':util[_0x6bf5('0x9')](_0x6bf5('0x12'),_0x50ec18,_0x6bf5('0x14')),'filename':filename(_0x50ec18,'info'),'level':_0x6bf5('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x389506){return formatter(_0x50ec18,_0x389506);}}),new winston[(_0x6bf5('0x10'))][(_0x6bf5('0x15'))]({'level':process[_0x6bf5('0x16')][_0x6bf5('0x17')]||debugLevel,'json':![],'formatter':function(_0x19a0ac){return formatter(_0x50ec18,_0x19a0ac);}})]});}; \ No newline at end of file +var _0xde19=['%s-%s','error','transports','info','Console','debugLevel','moment','path','INFO','join','/var','log','%s-%s.log','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','Logger','File'];(function(_0x7d3263,_0x402cf6){var _0x91a7cf=function(_0x1289da){while(--_0x1289da){_0x7d3263['push'](_0x7d3263['shift']());}};_0x91a7cf(++_0x402cf6);}(_0xde19,0xa0));var _0x9de1=function(_0x151a93,_0x55d68e){_0x151a93=_0x151a93-0x0;var _0x1c45e4=_0xde19[_0x151a93];return _0x1c45e4;};'use strict';var moment=require(_0x9de1('0x0'));var winston=require('winston');var util=require('util');var path=require(_0x9de1('0x1'));var debugLevel=_0x9de1('0x2');function filename(_0x40a7f0,_0x3abd1d){return path[_0x9de1('0x3')](_0x9de1('0x4'),_0x9de1('0x5'),'xcally',util['format'](_0x9de1('0x6'),_0x40a7f0,_0x3abd1d));}function formatter(_0xc97e7c,_0x3ebe87){return util[_0x9de1('0x7')](_0x9de1('0x8'),moment()['format'](_0x9de1('0x9')),_0x3ebe87[_0x9de1('0xa')][_0x9de1('0xb')](),_0xc97e7c,_0x3ebe87[_0x9de1('0xc')]);}module[_0x9de1('0xd')]=function(_0x212793){return new winston[(_0x9de1('0xe'))]({'transports':[new winston['transports'][(_0x9de1('0xf'))]({'name':util[_0x9de1('0x7')](_0x9de1('0x10'),_0x212793,_0x9de1('0x11')),'filename':filename(_0x212793,_0x9de1('0x11')),'level':_0x9de1('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x431441){return formatter(_0x212793,_0x431441);}}),new winston[(_0x9de1('0x12'))]['File']({'name':util[_0x9de1('0x7')]('%s-%s',_0x212793,_0x9de1('0x13')),'filename':filename(_0x212793,_0x9de1('0x13')),'level':_0x9de1('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1bc996){return formatter(_0x212793,_0x1bc996);}}),new winston[(_0x9de1('0x12'))][(_0x9de1('0x14'))]({'level':process['env'][_0x9de1('0x15')]||debugLevel,'json':![],'formatter':function(_0x349f04){return formatter(_0x212793,_0x349f04);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 72079f4..2d9a00d 100644 --- a/server/config/pm2/config.js +++ b/server/config/pm2/config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62ec=['routing','../../services/xdr/index.js','express','../../services/express/index.js','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js'];(function(_0x4c4bc3,_0x2398a8){var _0x328957=function(_0x4104b2){while(--_0x4104b2){_0x4c4bc3['push'](_0x4c4bc3['shift']());}};_0x328957(++_0x2398a8);}(_0x62ec,0xca));var _0xc62e=function(_0x5b3bac,_0xc310e0){_0x5b3bac=_0x5b3bac-0x0;var _0x29e542=_0x62ec[_0x5b3bac];return _0x29e542;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xc62e('0x0'),'script':path['join'](__dirname,_0xc62e('0x1'))},{'name':_0xc62e('0x2'),'script':path[_0xc62e('0x3')](__dirname,_0xc62e('0x4'))},{'name':_0xc62e('0x5'),'script':path[_0xc62e('0x3')](__dirname,_0xc62e('0x6'))},{'name':'email','script':path[_0xc62e('0x3')](__dirname,_0xc62e('0x7'))},{'name':_0xc62e('0x8'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path[_0xc62e('0x3')](__dirname,_0xc62e('0x9'))}]};module['exports']=config; \ No newline at end of file +var _0x1352=['exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','xdr'];(function(_0x4a5f6c,_0x4f532e){var _0x281ffd=function(_0x4c68e3){while(--_0x4c68e3){_0x4a5f6c['push'](_0x4a5f6c['shift']());}};_0x281ffd(++_0x4f532e);}(_0x1352,0x17a));var _0x2135=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x1352[_0x24237f];return _0x48298e;};'use strict';var path=require(_0x2135('0x0'));var os=require('os');var config={'apps':[{'name':_0x2135('0x1'),'script':path[_0x2135('0x2')](__dirname,_0x2135('0x3'))},{'name':_0x2135('0x4'),'script':path[_0x2135('0x2')](__dirname,_0x2135('0x5'))},{'name':_0x2135('0x6'),'script':path[_0x2135('0x2')](__dirname,_0x2135('0x7'))},{'name':_0x2135('0x8'),'script':path[_0x2135('0x2')](__dirname,_0x2135('0x9'))},{'name':_0x2135('0xa'),'script':path[_0x2135('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x2135('0xb'),'script':path[_0x2135('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0x2135('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 1db5591..edc1259 100644 --- a/server/config/pm2/index.js +++ b/server/config/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9d9=['list','describe','delete','dump','saved','bluebird','./config','connect','connected','start','disconnect','stop','then','restart'];(function(_0x36375a,_0x43ede3){var _0xe646d0=function(_0x4e9ea2){while(--_0x4e9ea2){_0x36375a['push'](_0x36375a['shift']());}};_0xe646d0(++_0x43ede3);}(_0xd9d9,0x11d));var _0x9d9d=function(_0x42b468,_0x581efb){_0x42b468=_0x42b468-0x0;var _0x5dde5a=_0xd9d9[_0x42b468];return _0x5dde5a;};'use strict';var pm2=require('pm2');var BPromise=require(_0x9d9d('0x0'));var config=require(_0x9d9d('0x1'));function connect(){return new BPromise(function(_0x15e6b3,_0x1161e2){return pm2[_0x9d9d('0x2')](function(_0x13655d){if(_0x13655d){return _0x1161e2(_0x13655d);}return _0x15e6b3(_0x9d9d('0x3'));});});};exports[_0x9d9d('0x4')]=function(_0x482617){return connect()['then'](function(){return new BPromise(function(_0x9c1923,_0x508cb4){return pm2[_0x9d9d('0x4')](_0x482617,function(_0x577bb3,_0x2d05bb){if(_0x577bb3){return _0x508cb4(_0x577bb3);}pm2[_0x9d9d('0x5')]();return _0x9c1923(_0x2d05bb);});});});};exports[_0x9d9d('0x6')]=function(_0x4832cc){return connect()[_0x9d9d('0x7')](function(){return new BPromise(function(_0x176b93,_0x1552dc){return pm2['stop'](_0x4832cc,function(_0x53b543,_0x39c9e1){if(_0x53b543){return _0x1552dc(_0x53b543);}pm2[_0x9d9d('0x5')]();return _0x176b93(_0x39c9e1);});});});};exports[_0x9d9d('0x8')]=function(_0x561fc2){return connect()[_0x9d9d('0x7')](function(){return new BPromise(function(_0x57d6e7,_0x22b999){return pm2[_0x9d9d('0x8')](_0x561fc2,function(_0x52a2ed,_0x43ce74){if(_0x52a2ed){return _0x22b999(_0x52a2ed);}pm2['disconnect']();return _0x57d6e7(_0x43ce74);});});});};exports['list']=function(){return connect()[_0x9d9d('0x7')](function(){return new BPromise(function(_0x41ba97,_0x491c71){return pm2[_0x9d9d('0x9')](function(_0x3ebd6b,_0x4ff340){if(_0x3ebd6b){return _0x491c71(_0x3ebd6b);}pm2['disconnect']();return _0x41ba97(_0x4ff340);});});});};exports[_0x9d9d('0xa')]=function(_0x4f81e1){return connect()['then'](function(){return new BPromise(function(_0x500adc,_0x367ab0){return pm2['describe'](_0x4f81e1,function(_0x3297fd,_0x2a4e1e){if(_0x3297fd){return _0x367ab0(_0x3297fd);}pm2[_0x9d9d('0x5')]();return _0x500adc(_0x2a4e1e);});});});};exports[_0x9d9d('0xb')]=function(_0x530ad4){return connect()[_0x9d9d('0x7')](function(){return new BPromise(function(_0x7825d4,_0x302071){return pm2[_0x9d9d('0xb')](_0x530ad4,function(_0x472e14,_0x52b7fb){if(_0x472e14){return _0x302071(_0x472e14);}pm2[_0x9d9d('0x5')]();return _0x7825d4(_0x52b7fb);});});});};exports[_0x9d9d('0xc')]=function(){return connect()[_0x9d9d('0x7')](function(){return new BPromise(function(_0x2cef73,_0x46e0b7){return pm2[_0x9d9d('0xc')](function(_0x1c09b8){if(_0x1c09b8){return _0x46e0b7(_0x1c09b8);}return _0x2cef73(_0x9d9d('0xd'));});});});}; \ No newline at end of file +var _0xbe3b=['start','disconnect','stop','restart','list','describe','delete','dump','saved','bluebird','./config','connected','then'];(function(_0x7ebbfe,_0x2efed3){var _0x3ce73c=function(_0x3fe2f1){while(--_0x3fe2f1){_0x7ebbfe['push'](_0x7ebbfe['shift']());}};_0x3ce73c(++_0x2efed3);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x57d843,_0x2a95e0){_0x57d843=_0x57d843-0x0;var _0x42ba2d=_0xbe3b[_0x57d843];return _0x42ba2d;};'use strict';var pm2=require('pm2');var BPromise=require(_0xbbe3('0x0'));var config=require(_0xbbe3('0x1'));function connect(){return new BPromise(function(_0x48ba3c,_0x364f65){return pm2['connect'](function(_0x5bfd65){if(_0x5bfd65){return _0x364f65(_0x5bfd65);}return _0x48ba3c(_0xbbe3('0x2'));});});};exports['start']=function(_0x5d74ec){return connect()[_0xbbe3('0x3')](function(){return new BPromise(function(_0x328b10,_0x257eb0){return pm2[_0xbbe3('0x4')](_0x5d74ec,function(_0x4c6976,_0x9bd4a9){if(_0x4c6976){return _0x257eb0(_0x4c6976);}pm2[_0xbbe3('0x5')]();return _0x328b10(_0x9bd4a9);});});});};exports[_0xbbe3('0x6')]=function(_0x3c0c43){return connect()[_0xbbe3('0x3')](function(){return new BPromise(function(_0x492173,_0x1ff205){return pm2[_0xbbe3('0x6')](_0x3c0c43,function(_0x2be6e4,_0x2cb1f1){if(_0x2be6e4){return _0x1ff205(_0x2be6e4);}pm2[_0xbbe3('0x5')]();return _0x492173(_0x2cb1f1);});});});};exports[_0xbbe3('0x7')]=function(_0x3205b8){return connect()[_0xbbe3('0x3')](function(){return new BPromise(function(_0x4ff398,_0x2ac83){return pm2[_0xbbe3('0x7')](_0x3205b8,function(_0x2adb77,_0x464538){if(_0x2adb77){return _0x2ac83(_0x2adb77);}pm2['disconnect']();return _0x4ff398(_0x464538);});});});};exports['list']=function(){return connect()[_0xbbe3('0x3')](function(){return new BPromise(function(_0x27c5a9,_0x10ee4b){return pm2[_0xbbe3('0x8')](function(_0x1e1552,_0x2df26d){if(_0x1e1552){return _0x10ee4b(_0x1e1552);}pm2['disconnect']();return _0x27c5a9(_0x2df26d);});});});};exports[_0xbbe3('0x9')]=function(_0x5ba69a){return connect()[_0xbbe3('0x3')](function(){return new BPromise(function(_0x12a90c,_0x46c91b){return pm2[_0xbbe3('0x9')](_0x5ba69a,function(_0x1bea70,_0x2af60d){if(_0x1bea70){return _0x46c91b(_0x1bea70);}pm2[_0xbbe3('0x5')]();return _0x12a90c(_0x2af60d);});});});};exports[_0xbbe3('0xa')]=function(_0x1e98eb){return connect()[_0xbbe3('0x3')](function(){return new BPromise(function(_0x445b23,_0x3de02e){return pm2['delete'](_0x1e98eb,function(_0x546d6b,_0x4aebd6){if(_0x546d6b){return _0x3de02e(_0x546d6b);}pm2[_0xbbe3('0x5')]();return _0x445b23(_0x4aebd6);});});});};exports[_0xbbe3('0xb')]=function(){return connect()[_0xbbe3('0x3')](function(){return new BPromise(function(_0x3201e8,_0x42c84f){return pm2['dump'](function(_0x25f694){if(_0x25f694){return _0x42c84f(_0x25f694);}return _0x3201e8(_0xbbe3('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 3cec89f..4105212 100644 --- a/server/config/schedule/chat.js +++ b/server/config/schedule/chat.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b76=['timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','catch','error','ioredis','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','ChatInteraction','findAll','subtract','minutes','then','update'];(function(_0x5be798,_0x2c82fa){var _0x1f7187=function(_0xcd1a5){while(--_0xcd1a5){_0x5be798['push'](_0x5be798['shift']());}};_0x1f7187(++_0x2c82fa);}(_0x4b76,0x7b));var _0x64b7=function(_0x2da463,_0x70ae83){_0x2da463=_0x2da463-0x0;var _0x1033b9=_0x4b76[_0x2da463];return _0x1033b9;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x64b7('0x0'));var db=require(_0x64b7('0x1'))['db'];var config=require(_0x64b7('0x2'));config[_0x64b7('0x3')]=_[_0x64b7('0x4')](config['redis'],{'host':_0x64b7('0x5'),'port':0x18eb});var io=require(_0x64b7('0x6'))(new Redis(config[_0x64b7('0x3')]));function closeInteractions(){var _0x2162b5=0x0;var _0x2cd783=[];return db[_0x64b7('0x7')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x3ac2a8){_0x2162b5=_0x3ac2a8[_0x64b7('0x8')];if(_0x2162b5){return db[_0x64b7('0x9')][_0x64b7('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x64b7('0xb')](_0x3ac2a8[_0x64b7('0x8')],_0x64b7('0xc'))}}});}else{return[];}})[_0x64b7('0xd')](function(_0x5bd7b5){_0x2cd783=_0x5bd7b5;if(_0x2162b5){return db['ChatInteraction'][_0x64b7('0xe')]({'closeReason':'system','disposition':_0x64b7('0xf'),'closed':!![],'closedAt':moment()[_0x64b7('0x10')](_0x64b7('0x11'))},{'where':{'id':_[_0x64b7('0x12')](_0x2cd783||[],'id')}});}})[_0x64b7('0xd')](function(_0x4934a4){for(var _0x2cbc98=0x0;_0x2cbc98<_0x2cd783[_0x64b7('0x13')];_0x2cbc98++){io[_0x64b7('0x14')]('chatInteraction:update',{'id':_0x2cd783[_0x2cbc98]['id'],'closed':!![]});}})[_0x64b7('0x15')](function(_0x3253fa){console[_0x64b7('0x16')](_0x3253fa);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5ac5=['lodash','moment','ioredis','../../mysqldb','../../config/environment','redis','defaults','localhost','Setting','find','chatTimeout','ChatInteraction','findAll','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','then','length','emit','chatInteraction:update','error'];(function(_0x153544,_0x3eeaaf){var _0x47e50d=function(_0x28444a){while(--_0x28444a){_0x153544['push'](_0x153544['shift']());}};_0x47e50d(++_0x3eeaaf);}(_0x5ac5,0xfd));var _0x55ac=function(_0x2f3ca5,_0x3ba4ac){_0x2f3ca5=_0x2f3ca5-0x0;var _0x11cc85=_0x5ac5[_0x2f3ca5];return _0x11cc85;};'use strict';var _=require(_0x55ac('0x0'));var moment=require(_0x55ac('0x1'));var Redis=require(_0x55ac('0x2'));var db=require(_0x55ac('0x3'))['db'];var config=require(_0x55ac('0x4'));config[_0x55ac('0x5')]=_[_0x55ac('0x6')](config[_0x55ac('0x5')],{'host':_0x55ac('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x2f119c=0x0;var _0x5b3915=[];return db[_0x55ac('0x8')][_0x55ac('0x9')]({'raw':!![],'attributes':['id',_0x55ac('0xa')],'where':{'id':0x1}})['then'](function(_0x4169ae){_0x2f119c=_0x4169ae[_0x55ac('0xa')];if(_0x2f119c){return db[_0x55ac('0xb')][_0x55ac('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x4169ae[_0x55ac('0xa')],'minutes')}}});}else{return[];}})['then'](function(_0x4a2cd2){_0x5b3915=_0x4a2cd2;if(_0x2f119c){return db[_0x55ac('0xb')][_0x55ac('0xd')]({'closeReason':'system','disposition':_0x55ac('0xe'),'closed':!![],'closedAt':moment()[_0x55ac('0xf')](_0x55ac('0x10'))},{'where':{'id':_[_0x55ac('0x11')](_0x5b3915||[],'id')}});}})[_0x55ac('0x12')](function(_0x110c10){for(var _0x31c002=0x0;_0x31c002<_0x5b3915[_0x55ac('0x13')];_0x31c002++){io[_0x55ac('0x14')](_0x55ac('0x15'),{'id':_0x5b3915[_0x31c002]['id'],'closed':!![]});}})['catch'](function(_0x1a07a6){console[_0x55ac('0x16')](_0x1a07a6);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index e8e0852..775e2b9 100644 --- a/server/config/schedule/index.js +++ b/server/config/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x760f=['endAt','start','add\x20cron','stop','startAt','update','stop\x20cron','run','util','lodash','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','name','email','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','%s.%s','basename','savename','extname','zip','join','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','email\x20sent','error\x20mail','isNil','subtractNumber','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','keys','map','toString','keyBy','difference','exists','deleteJob','toRun','length','index','my\x20id','run\x20job','cron','active','isBetween'];(function(_0x4163d0,_0x15122d){var _0x1b869a=function(_0x4d931c){while(--_0x4d931c){_0x4163d0['push'](_0x4163d0['shift']());}};_0x1b869a(++_0x15122d);}(_0x760f,0x1b6));var _0xf760=function(_0x1601e9,_0x109aea){_0x1601e9=_0x1601e9-0x0;var _0x374353=_0x760f[_0x1601e9];return _0x374353;};'use strict';var fs=require('fs');var util=require(_0xf760('0x0'));var path=require('path');var _=require(_0xf760('0x1'));var moment=require('moment');var CronJobManager=require(_0xf760('0x2'));var jayson=require(_0xf760('0x3'));var BPromise=require(_0xf760('0x4'));var logger=require('../logger')(_0xf760('0x5'));var db=require(_0xf760('0x6'))['db'];var analyticCustomReportController=require(_0xf760('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xf760('0x8')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3910ed,_0xbffc8b){return function(){logger['info'](_0xf760('0x9'),_0x3910ed['email']);var _0x80804e=!![];var _0x3eba5c={'tls':{'rejectUnauthorized':![]}};if(_0x3910ed[_0xf760('0xa')][_0xf760('0xb')][_0xf760('0xc')]){_0x3eba5c[_0xf760('0xc')]=_0x3910ed[_0xf760('0xa')][_0xf760('0xb')][_0xf760('0xc')];}else{_0x3eba5c['host']=_0x3910ed[_0xf760('0xa')][_0xf760('0xb')][_0xf760('0xd')];_0x3eba5c[_0xf760('0xe')]=_0x3910ed[_0xf760('0xa')]['Smtp'][_0xf760('0xe')];_0x3eba5c[_0xf760('0xf')]=_0x3910ed[_0xf760('0xa')][_0xf760('0xb')][_0xf760('0xf')];}if(_0x3910ed[_0xf760('0xa')][_0xf760('0xb')][_0xf760('0x10')]){_0x3eba5c[_0xf760('0x11')]={'user':_0x3910ed[_0xf760('0xa')][_0xf760('0xb')]['user'],'pass':_0x3910ed[_0xf760('0xa')]['Smtp']['pass']};}var _0x44afe4={'account':_0x3eba5c,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x3910ed[_0xf760('0xa')][_0xf760('0x12')],_0x3910ed['MailAccount'][_0xf760('0x13')]||_0x3910ed[_0xf760('0xa')][_0xf760('0xb')][_0xf760('0x14')]),'to':_0x3910ed[_0xf760('0x13')],'cc':_0x3910ed['cc'],'bcc':_0x3910ed[_0xf760('0x15')],'subject':util[_0xf760('0x16')](_0xf760('0x17'),_0xbffc8b['name'],_0x3910ed['subtractNumber'],_0x3910ed[_0xf760('0x18')])}};var _0x2eff2d=path['join'](__dirname,_0xf760('0x19'));var _0x1f1fb7=_0xbffc8b['savename'];var _0x3b4c1c=util[_0xf760('0x16')](_0xf760('0x1a'),path[_0xf760('0x1b')](_0xbffc8b[_0xf760('0x1c')],path[_0xf760('0x1d')](_0xbffc8b[_0xf760('0x1c')])),_0xf760('0x1e'));var _0x3bcd2f=path[_0xf760('0x1f')](_0x2eff2d,_0x1f1fb7);var _0x2a4164=path[_0xf760('0x1f')](_0x2eff2d,_0x3b4c1c);if(fs[_0xf760('0x20')](_0x3bcd2f)){_0xbffc8b[_0xf760('0x21')]=_0xf760('0x22');_0x44afe4['message']['attachments']=[{'filename':_0x1f1fb7,'path':_0x3bcd2f}];_0x44afe4[_0xf760('0x23')][_0xf760('0x24')]=util[_0xf760('0x16')](_0xf760('0x25'),JSON[_0xf760('0x26')](_0xbffc8b,null,0x2));}else if(fs[_0xf760('0x20')](_0x2a4164)){_0xbffc8b[_0xf760('0x21')]=_0xf760('0x22');_0x44afe4[_0xf760('0x23')][_0xf760('0x27')]=[{'filename':_0x3b4c1c,'path':_0x2a4164}];}else{_0x44afe4['message'][_0xf760('0x24')]=_0xf760('0x28');if(!_0x3910ed['sendIfEmpty']){_0x80804e=![];logger[_0xf760('0x29')](_0xf760('0x2a'));}}if(_0x80804e){return client[_0xf760('0x2b')](_0xf760('0x2c'),_0x44afe4)[_0xf760('0x2d')](function(_0x193da8){if(_0x193da8[_0xf760('0x2e')]){return logger[_0xf760('0x2e')]('error\x20mail',JSON['stringify'](_0x193da8));}return logger['info'](_0xf760('0x2f'));})['catch'](function(_0x260511){return logger[_0xf760('0x2e')](_0xf760('0x30'),JSON[_0xf760('0x26')](_0x260511));});}};}function handleError(){return function(_0x5a8829){return logger[_0xf760('0x2e')](JSON['stringify'](_0x5a8829));};}function handleResult(_0x1c235b){return function(_0x5d88e6){logger[_0xf760('0x29')]('data',JSON[_0xf760('0x26')](_0x5d88e6));if(_0x1c235b[_0xf760('0xa')]&&_0x1c235b[_0xf760('0xa')][_0xf760('0xb')]&&!_[_0xf760('0x31')](_0x1c235b['email'])){setTimeout(handleSendEmail(_0x1c235b,_0x5d88e6),0x3c*0x3e8);}};}function handleJob(_0x57ae8f){return function(){try{if(_[_0xf760('0x31')](_0x57ae8f[_0xf760('0x32')])){return logger[_0xf760('0x29')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xf760('0x31')](_0x57ae8f[_0xf760('0x18')])){return logger['info'](_0xf760('0x33'));}var _0x215eef={'startDate':moment()['subtract'](_0x57ae8f['subtractNumber'],_0x57ae8f[_0xf760('0x18')])[_0xf760('0x16')](_0xf760('0x34')),'endDate':moment()['format'](_0xf760('0x34')),'type':_0xf760('0x35'),'output':_0x57ae8f[_0xf760('0x36')],'name':_0x57ae8f[_0xf760('0x12')]};if(!_[_0xf760('0x31')](_0x57ae8f[_0xf760('0x37')])){logger[_0xf760('0x29')]('exec\x20defaul\x20report\x20id:%s',_0x57ae8f[_0xf760('0x37')]);return analyticDefaultReportController[_0xf760('0x38')]({'id':_0x57ae8f[_0xf760('0x37')]},_0x215eef)[_0xf760('0x2d')](handleResult(_0x57ae8f))[_0xf760('0x39')](handleError());}if(!_[_0xf760('0x31')](_0x57ae8f[_0xf760('0x3a')])){logger[_0xf760('0x29')](_0xf760('0x3b'),_0x57ae8f[_0xf760('0x3a')]);return analyticCustomReportController['runReport']({'id':_0x57ae8f[_0xf760('0x3a')]},_0x215eef)[_0xf760('0x2d')](handleResult(_0x57ae8f))[_0xf760('0x39')](handleError());}}catch(_0x1a83e6){logger[_0xf760('0x2e')](JSON[_0xf760('0x26')](_0x1a83e6));}return logger[_0xf760('0x29')](_0xf760('0x3c'));};}function getJobs(_0x3c2f6f){var _0xd3e899={};if(_0x3c2f6f){_0xd3e899['id']=_0x3c2f6f;}return db['Schedule'][_0xf760('0x3d')]({'where':_0xd3e899,'include':[{'model':db[_0xf760('0xa')],'attributes':['id',_0xf760('0x12'),'email'],'include':[{'model':db[_0xf760('0x3e')],'as':_0xf760('0xb')}]}]})['then'](function(_0xdef83b){var _0x54ff6a=_[_0xf760('0x3f')](manager['jobs']);var _0x5de740=_[_0xf760('0x40')](_0xdef83b,function(_0xdd2f87){return _0xdd2f87['id'][_0xf760('0x41')]();});var _0x185757=_[_0xf760('0x42')](_0xdef83b,function(_0x364341){return _0x364341['id'][_0xf760('0x41')]();});var _0x53a069=_0x3c2f6f?_0x5de740:_['difference'](_0x5de740,_0x54ff6a);var _0x5e20d9=_['intersection'](_0x5de740,_0x54ff6a);var _0x2d0800=_[_0xf760('0x43')](_0x54ff6a,_0x5de740);var _0xd15adc;var _0x30b931;for(_0xd15adc=0x0;_0xd15adc<_0x2d0800['length']&&!_0x3c2f6f;_0xd15adc+=0x1){_0x30b931=_0x2d0800[_0xd15adc]['toString']();if(manager[_0xf760('0x44')](_0x30b931)){manager['stop'](_0x30b931);manager[_0xf760('0x45')](_0x30b931);logger[_0xf760('0x29')]('delete\x20cron',_0x30b931);}}logger[_0xf760('0x29')](_0xf760('0x46'),JSON['stringify'](_0x53a069));for(_0xd15adc=0x0;_0xd15adc<_0x53a069[_0xf760('0x47')];_0xd15adc+=0x1){_0x30b931=_0x53a069[_0xd15adc]['toString']();logger['info'](_0xf760('0x48'),_0x30b931);if(_0x3c2f6f){logger['info'](_0xf760('0x49'),_0x3c2f6f);logger[_0xf760('0x29')](JSON[_0xf760('0x26')](_0x185757[_0x30b931]));BPromise['resolve']()[_0xf760('0x2d')](handleJob(_0x185757[_0x30b931]));logger[_0xf760('0x29')](_0xf760('0x4a'),_0x185757[_0x30b931][_0xf760('0x12')],_0x185757[_0x30b931][_0xf760('0x4b')]);}else if(_0x185757[_0x30b931][_0xf760('0x4b')]&&_0x185757[_0x30b931][_0xf760('0x4c')]&&moment()[_0xf760('0x4d')](_0x185757[_0x30b931]['startAt'],_0x185757[_0x30b931][_0xf760('0x4e')])){manager['add'](_0x30b931,_0x185757[_0x30b931][_0xf760('0x4b')],handleJob(_0x185757[_0x30b931]));manager[_0xf760('0x4f')](_0x30b931);logger[_0xf760('0x29')](_0xf760('0x50'),_0x185757[_0x30b931][_0xf760('0x12')],_0x185757[_0x30b931]['cron']);}else if(manager['exists'](_0x30b931)){manager[_0xf760('0x51')](_0x30b931);manager[_0xf760('0x45')](_0x30b931);logger[_0xf760('0x29')]('stop\x20cron',_0x185757[_0x30b931][_0xf760('0x12')],_0x185757[_0x30b931][_0xf760('0x4b')]);}}for(_0xd15adc=0x0,_0x30b931;_0xd15adc<_0x5e20d9[_0xf760('0x47')]&&!_0x3c2f6f;_0xd15adc+=0x1){_0x30b931=_0x5e20d9[_0xd15adc][_0xf760('0x41')]();if(manager[_0xf760('0x44')](_0x30b931)){if(_0x185757[_0x30b931]['cron']&&_0x185757[_0x30b931][_0xf760('0x4c')]&&moment()[_0xf760('0x4d')](_0x185757[_0x30b931][_0xf760('0x52')],_0x185757[_0x30b931][_0xf760('0x4e')])){manager[_0xf760('0x53')](_0x30b931,_0x185757[_0x30b931][_0xf760('0x4b')],handleJob(_0x185757[_0x30b931]));logger[_0xf760('0x29')]('update\x20cron',_0x185757[_0x30b931][_0xf760('0x12')],_0x185757[_0x30b931][_0xf760('0x4b')]);}else{manager[_0xf760('0x51')](_0x30b931);manager['deleteJob'](_0x30b931);logger[_0xf760('0x29')](_0xf760('0x54'),_0x185757[_0x30b931][_0xf760('0x12')],_0x185757[_0x30b931][_0xf760('0x4b')]);}}}})[_0xf760('0x39')](function(_0x41d1ac){logger[_0xf760('0x2e')](JSON[_0xf760('0x26')](_0x41d1ac));});}exports[_0xf760('0x55')]=function(_0x428a28){return getJobs(_0x428a28);};exports[_0xf760('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x5888=['scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','no\x20report\x20id','findAll','keys','jobs','map','toString','difference','intersection','length','exists','deleteJob','delete\x20cron','toRun','index','run\x20job','cron','active','isBetween','endAt','add','start','add\x20cron','stop','stop\x20cron','startAt','update','update\x20cron','run','util','lodash','cron-job-manager','jayson/promise','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','auth','pass','format','\x22%s\x22\x20<%s>','name','email','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','savename','extname','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error\x20mail','email\x20sent','error','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x30f38a,_0x59de39){var _0x272f6c=function(_0x191ee8){while(--_0x191ee8){_0x30f38a['push'](_0x30f38a['shift']());}};_0x272f6c(++_0x59de39);}(_0x5888,0x17b));var _0x8588=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0x5888[_0x382a62];return _0x490a25;};'use strict';var fs=require('fs');var util=require(_0x8588('0x0'));var path=require('path');var _=require(_0x8588('0x1'));var moment=require('moment');var CronJobManager=require(_0x8588('0x2'));var jayson=require(_0x8588('0x3'));var BPromise=require('bluebird');var logger=require('../logger')(_0x8588('0x4'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x8588('0x5'));var analyticDefaultReportController=require(_0x8588('0x6'));var client=jayson[_0x8588('0x7')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x284e50,_0x3b6600){return function(){logger[_0x8588('0x8')](_0x8588('0x9'),_0x284e50['email']);var _0x5a0235=!![];var _0x477d34={'tls':{'rejectUnauthorized':![]}};if(_0x284e50[_0x8588('0xa')][_0x8588('0xb')]['service']){_0x477d34[_0x8588('0xc')]=_0x284e50[_0x8588('0xa')]['Smtp'][_0x8588('0xc')];}else{_0x477d34[_0x8588('0xd')]=_0x284e50['MailAccount'][_0x8588('0xb')][_0x8588('0xd')];_0x477d34[_0x8588('0xe')]=_0x284e50[_0x8588('0xa')][_0x8588('0xb')]['port'];_0x477d34[_0x8588('0xf')]=_0x284e50[_0x8588('0xa')][_0x8588('0xb')][_0x8588('0xf')];}if(_0x284e50[_0x8588('0xa')][_0x8588('0xb')]['authentication']){_0x477d34[_0x8588('0x10')]={'user':_0x284e50[_0x8588('0xa')][_0x8588('0xb')]['user'],'pass':_0x284e50[_0x8588('0xa')][_0x8588('0xb')][_0x8588('0x11')]};}var _0x5e3ede={'account':_0x477d34,'message':{'from':util[_0x8588('0x12')](_0x8588('0x13'),_0x284e50[_0x8588('0xa')][_0x8588('0x14')],_0x284e50['MailAccount']['email']||_0x284e50[_0x8588('0xa')][_0x8588('0xb')]['user']),'to':_0x284e50[_0x8588('0x15')],'cc':_0x284e50['cc'],'bcc':_0x284e50['bcc'],'subject':util[_0x8588('0x12')](_0x8588('0x16'),_0x3b6600[_0x8588('0x14')],_0x284e50[_0x8588('0x17')],_0x284e50[_0x8588('0x18')])}};var _0x3f3efd=path[_0x8588('0x19')](__dirname,_0x8588('0x1a'));var _0x233eca=_0x3b6600['savename'];var _0x587efe=util[_0x8588('0x12')](_0x8588('0x1b'),path[_0x8588('0x1c')](_0x3b6600[_0x8588('0x1d')],path[_0x8588('0x1e')](_0x3b6600['savename'])),'zip');var _0x44669c=path[_0x8588('0x19')](_0x3f3efd,_0x233eca);var _0x2a77b1=path[_0x8588('0x19')](_0x3f3efd,_0x587efe);if(fs[_0x8588('0x1f')](_0x44669c)){_0x3b6600[_0x8588('0x20')]='Sent';_0x5e3ede[_0x8588('0x21')][_0x8588('0x22')]=[{'filename':_0x233eca,'path':_0x44669c}];_0x5e3ede[_0x8588('0x21')][_0x8588('0x23')]=util[_0x8588('0x12')](_0x8588('0x24'),JSON[_0x8588('0x25')](_0x3b6600,null,0x2));}else if(fs['existsSync'](_0x2a77b1)){_0x3b6600[_0x8588('0x20')]=_0x8588('0x26');_0x5e3ede[_0x8588('0x21')][_0x8588('0x22')]=[{'filename':_0x587efe,'path':_0x2a77b1}];}else{_0x5e3ede[_0x8588('0x21')][_0x8588('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x284e50[_0x8588('0x27')]){_0x5a0235=![];logger[_0x8588('0x8')](_0x8588('0x28'));}}if(_0x5a0235){return client[_0x8588('0x29')](_0x8588('0x2a'),_0x5e3ede)[_0x8588('0x2b')](function(_0x4b7565){if(_0x4b7565['error']){return logger['error'](_0x8588('0x2c'),JSON['stringify'](_0x4b7565));}return logger[_0x8588('0x8')](_0x8588('0x2d'));})['catch'](function(_0x1db9de){return logger[_0x8588('0x2e')](_0x8588('0x2c'),JSON['stringify'](_0x1db9de));});}};}function handleError(){return function(_0x18ed7b){return logger[_0x8588('0x2e')](JSON[_0x8588('0x25')](_0x18ed7b));};}function handleResult(_0x51c20e){return function(_0x5957f1){logger[_0x8588('0x8')]('data',JSON['stringify'](_0x5957f1));if(_0x51c20e[_0x8588('0xa')]&&_0x51c20e[_0x8588('0xa')][_0x8588('0xb')]&&!_[_0x8588('0x2f')](_0x51c20e[_0x8588('0x15')])){setTimeout(handleSendEmail(_0x51c20e,_0x5957f1),0x3c*0x3e8);}};}function handleJob(_0x437ca4){return function(){try{if(_[_0x8588('0x2f')](_0x437ca4[_0x8588('0x17')])){return logger[_0x8588('0x8')](_0x8588('0x30'));}if(_[_0x8588('0x2f')](_0x437ca4[_0x8588('0x18')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x55e4a2={'startDate':moment()[_0x8588('0x31')](_0x437ca4[_0x8588('0x17')],_0x437ca4['subtractUnit'])[_0x8588('0x12')](_0x8588('0x32')),'endDate':moment()[_0x8588('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x8588('0x33'),'output':_0x437ca4[_0x8588('0x34')],'name':_0x437ca4[_0x8588('0x14')]};if(!_[_0x8588('0x2f')](_0x437ca4[_0x8588('0x35')])){logger[_0x8588('0x8')](_0x8588('0x36'),_0x437ca4['DefaultReportId']);return analyticDefaultReportController[_0x8588('0x37')]({'id':_0x437ca4[_0x8588('0x35')]},_0x55e4a2)[_0x8588('0x2b')](handleResult(_0x437ca4))[_0x8588('0x38')](handleError());}if(!_[_0x8588('0x2f')](_0x437ca4[_0x8588('0x39')])){logger[_0x8588('0x8')]('exec\x20custom\x20report\x20id:%s',_0x437ca4['CustomReportId']);return analyticCustomReportController[_0x8588('0x37')]({'id':_0x437ca4[_0x8588('0x39')]},_0x55e4a2)[_0x8588('0x2b')](handleResult(_0x437ca4))['catch'](handleError());}}catch(_0x4bb896){logger[_0x8588('0x2e')](JSON[_0x8588('0x25')](_0x4bb896));}return logger[_0x8588('0x8')](_0x8588('0x3a'));};}function getJobs(_0x4baf64){var _0x116c80={};if(_0x4baf64){_0x116c80['id']=_0x4baf64;}return db['Schedule'][_0x8588('0x3b')]({'where':_0x116c80,'include':[{'model':db[_0x8588('0xa')],'attributes':['id',_0x8588('0x14'),_0x8588('0x15')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})['then'](function(_0x4b75d3){var _0x269ff8=_[_0x8588('0x3c')](manager[_0x8588('0x3d')]);var _0x545ce7=_[_0x8588('0x3e')](_0x4b75d3,function(_0x3b5a53){return _0x3b5a53['id'][_0x8588('0x3f')]();});var _0x291614=_['keyBy'](_0x4b75d3,function(_0xe9ce06){return _0xe9ce06['id'][_0x8588('0x3f')]();});var _0x5d2483=_0x4baf64?_0x545ce7:_[_0x8588('0x40')](_0x545ce7,_0x269ff8);var _0x1d195a=_[_0x8588('0x41')](_0x545ce7,_0x269ff8);var _0x100a4e=_['difference'](_0x269ff8,_0x545ce7);var _0x367f92;var _0x3ad1e4;for(_0x367f92=0x0;_0x367f92<_0x100a4e[_0x8588('0x42')]&&!_0x4baf64;_0x367f92+=0x1){_0x3ad1e4=_0x100a4e[_0x367f92][_0x8588('0x3f')]();if(manager[_0x8588('0x43')](_0x3ad1e4)){manager['stop'](_0x3ad1e4);manager[_0x8588('0x44')](_0x3ad1e4);logger[_0x8588('0x8')](_0x8588('0x45'),_0x3ad1e4);}}logger[_0x8588('0x8')](_0x8588('0x46'),JSON['stringify'](_0x5d2483));for(_0x367f92=0x0;_0x367f92<_0x5d2483['length'];_0x367f92+=0x1){_0x3ad1e4=_0x5d2483[_0x367f92][_0x8588('0x3f')]();logger[_0x8588('0x8')](_0x8588('0x47'),_0x3ad1e4);if(_0x4baf64){logger[_0x8588('0x8')]('my\x20id',_0x4baf64);logger[_0x8588('0x8')](JSON['stringify'](_0x291614[_0x3ad1e4]));BPromise['resolve']()[_0x8588('0x2b')](handleJob(_0x291614[_0x3ad1e4]));logger[_0x8588('0x8')](_0x8588('0x48'),_0x291614[_0x3ad1e4][_0x8588('0x14')],_0x291614[_0x3ad1e4]['cron']);}else if(_0x291614[_0x3ad1e4][_0x8588('0x49')]&&_0x291614[_0x3ad1e4][_0x8588('0x4a')]&&moment()[_0x8588('0x4b')](_0x291614[_0x3ad1e4]['startAt'],_0x291614[_0x3ad1e4][_0x8588('0x4c')])){manager[_0x8588('0x4d')](_0x3ad1e4,_0x291614[_0x3ad1e4][_0x8588('0x49')],handleJob(_0x291614[_0x3ad1e4]));manager[_0x8588('0x4e')](_0x3ad1e4);logger['info'](_0x8588('0x4f'),_0x291614[_0x3ad1e4][_0x8588('0x14')],_0x291614[_0x3ad1e4][_0x8588('0x49')]);}else if(manager[_0x8588('0x43')](_0x3ad1e4)){manager[_0x8588('0x50')](_0x3ad1e4);manager[_0x8588('0x44')](_0x3ad1e4);logger[_0x8588('0x8')](_0x8588('0x51'),_0x291614[_0x3ad1e4][_0x8588('0x14')],_0x291614[_0x3ad1e4][_0x8588('0x49')]);}}for(_0x367f92=0x0,_0x3ad1e4;_0x367f92<_0x1d195a[_0x8588('0x42')]&&!_0x4baf64;_0x367f92+=0x1){_0x3ad1e4=_0x1d195a[_0x367f92][_0x8588('0x3f')]();if(manager[_0x8588('0x43')](_0x3ad1e4)){if(_0x291614[_0x3ad1e4][_0x8588('0x49')]&&_0x291614[_0x3ad1e4][_0x8588('0x4a')]&&moment()[_0x8588('0x4b')](_0x291614[_0x3ad1e4][_0x8588('0x52')],_0x291614[_0x3ad1e4][_0x8588('0x4c')])){manager[_0x8588('0x53')](_0x3ad1e4,_0x291614[_0x3ad1e4][_0x8588('0x49')],handleJob(_0x291614[_0x3ad1e4]));logger[_0x8588('0x8')](_0x8588('0x54'),_0x291614[_0x3ad1e4]['name'],_0x291614[_0x3ad1e4][_0x8588('0x49')]);}else{manager[_0x8588('0x50')](_0x3ad1e4);manager['deleteJob'](_0x3ad1e4);logger[_0x8588('0x8')](_0x8588('0x51'),_0x291614[_0x3ad1e4][_0x8588('0x14')],_0x291614[_0x3ad1e4][_0x8588('0x49')]);}}}})[_0x8588('0x38')](function(_0x4fff35){logger[_0x8588('0x2e')](JSON[_0x8588('0x25')](_0x4fff35));});}exports[_0x8588('0x55')]=function(_0x494083){return getJobs(_0x494083);};exports[_0x8588('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 7606eb3..2b8261f 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x064f=['Biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','../mysqldb','push'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0x064f,0x11e));var _0xf064=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x064f[_0x5d6456];return _0x4d66c1;};'use strict';var util=require('util');var db=require(_0xf064('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf064('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xf064('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xf064('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xf064('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xf064('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf064('0x4')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xf064('0x1')]({'id':i,'firstName':_0xf064('0x5')+i,'lastName':_0xf064('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xf064('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xf064('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf064('0x4')](),'updatedAt':Date[_0xf064('0x4')]()});}db[_0xf064('0x6')][_0xf064('0x7')]({'where':{}})[_0xf064('0x8')](function(){return db[_0xf064('0x6')][_0xf064('0x9')](contacts);})['then'](function(){console[_0xf064('0xa')](_0xf064('0xb'),_0xf064('0xc'));return db[_0xf064('0xd')][_0xf064('0x7')]({'where':{}});})['then'](function(){return db[_0xf064('0xd')][_0xf064('0x9')](hopper);})['then'](function(){console[_0xf064('0xa')](_0xf064('0xb'),_0xf064('0xe'));return db[_0xf064('0x6')][_0xf064('0x9')](contacts2);})[_0xf064('0x8')](function(){console[_0xf064('0xa')](_0xf064('0xb'),_0xf064('0xf'));return db[_0xf064('0xd')][_0xf064('0x9')](hopper2);})[_0xf064('0x8')](function(){console[_0xf064('0xa')](_0xf064('0xb'),_0xf064('0x10'));})[_0xf064('0x11')](function(_0x11f5cc){console['log'](_0x11f5cc);}); \ No newline at end of file +var _0x3fd3=['contacts2','hopper2','catch','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','push','destroy','then','CmContact','bulkCreate','finished\x20populating','contacts1','CmHopper','log','hopper1'];(function(_0x57ddb6,_0x384af0){var _0x41c743=function(_0x2aabe9){while(--_0x2aabe9){_0x57ddb6['push'](_0x57ddb6['shift']());}};_0x41c743(++_0x384af0);}(_0x3fd3,0x107));var _0x33fd=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x3fd3[_0x11005e];return _0x29338f;};'use strict';var util=require(_0x33fd('0x0'));var db=require(_0x33fd('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x33fd('0x2')+i,'lastName':_0x33fd('0x3')+i,'phone':0xf879fb460+i,'email':_0x33fd('0x4')+i+_0x33fd('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x33fd('0x6')](),'updatedAt':Date[_0x33fd('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x33fd('0x7')]({'id':i,'firstName':_0x33fd('0x2')+i,'lastName':_0x33fd('0x3')+i,'phone':0xf879fb460+i,'email':_0x33fd('0x4')+i+_0x33fd('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x33fd('0x7')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x33fd('0x6')](),'updatedAt':Date[_0x33fd('0x6')]()});}db['CmContact'][_0x33fd('0x8')]({'where':{}})[_0x33fd('0x9')](function(){return db[_0x33fd('0xa')][_0x33fd('0xb')](contacts);})[_0x33fd('0x9')](function(){console['log'](_0x33fd('0xc'),_0x33fd('0xd'));return db[_0x33fd('0xe')][_0x33fd('0x8')]({'where':{}});})[_0x33fd('0x9')](function(){return db[_0x33fd('0xe')][_0x33fd('0xb')](hopper);})[_0x33fd('0x9')](function(){console[_0x33fd('0xf')](_0x33fd('0xc'),_0x33fd('0x10'));return db['CmContact']['bulkCreate'](contacts2);})[_0x33fd('0x9')](function(){console['log']('finished\x20populating',_0x33fd('0x11'));return db[_0x33fd('0xe')][_0x33fd('0xb')](hopper2);})['then'](function(){console[_0x33fd('0xf')](_0x33fd('0xc'),_0x33fd('0x12'));})[_0x33fd('0x13')](function(_0x59647d){console['log'](_0x59647d);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 0554d2b..c02e6b6 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e68=['/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes'];(function(_0x55d4df,_0x2ec2d6){var _0x17d27b=function(_0x465459){while(--_0x465459){_0x55d4df['push'](_0x55d4df['shift']());}};_0x17d27b(++_0x2ec2d6);}(_0x3e68,0x11e));var _0x83e6=function(_0x238376,_0x6ce50a){_0x238376=_0x238376-0x0;var _0x1399d0=_0x3e68[_0x238376];return _0x1399d0;};'use strict';var util=require('util');var db=require(_0x83e6('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x83e6('0x1')]({'name':util[_0x83e6('0x2')](_0x83e6('0x3'),_0x83e6('0x4'),i),'fullname':util[_0x83e6('0x2')](_0x83e6('0x3'),_0x83e6('0x4'),i),'email':util[_0x83e6('0x2')](_0x83e6('0x5'),_0x83e6('0x4'),i),'role':_0x83e6('0x4'),'password':_0x83e6('0x6'),'internal':0xfa0+i,'type':_0x83e6('0x7'),'transport':[_0x83e6('0x8'),'ws',_0x83e6('0x9')],'disallow':[_0x83e6('0xa')],'allow':[_0x83e6('0xb')],'defaultuser':util[_0x83e6('0x2')](_0x83e6('0x3'),_0x83e6('0x4'),i),'encryption':_0x83e6('0xc'),'avpf':_0x83e6('0xc'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0x83e6('0xc'),'dtlsverify':'no','dtlscertfile':_0x83e6('0xd'),'dtlsprivatekey':_0x83e6('0xe'),'dtlssetup':_0x83e6('0xf'),'callerid':util['format'](_0x83e6('0x10'),util[_0x83e6('0x2')](_0x83e6('0x3'),_0x83e6('0x4'),i),0xfa0+i)});}db[_0x83e6('0x11')][_0x83e6('0x12')](users)[_0x83e6('0x13')](function(){console[_0x83e6('0x14')](_0x83e6('0x15'));})[_0x83e6('0x16')](function(_0x55ade5){console['log'](_0x55ade5);}); \ No newline at end of file +var _0x3f4b=['agent','%s%s@xcally.com','password','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','User','bulkCreate','log','add\x20user','catch','util','../mysqldb','push','format','%s%s'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x3f4b,0x18a));var _0xb3f4=function(_0x215b35,_0x27ab40){_0x215b35=_0x215b35-0x0;var _0x34aad6=_0x3f4b[_0x215b35];return _0x34aad6;};'use strict';var util=require(_0xb3f4('0x0'));var db=require(_0xb3f4('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xb3f4('0x2')]({'name':util[_0xb3f4('0x3')](_0xb3f4('0x4'),_0xb3f4('0x5'),i),'fullname':util['format'](_0xb3f4('0x4'),'agent',i),'email':util[_0xb3f4('0x3')](_0xb3f4('0x6'),_0xb3f4('0x5'),i),'role':_0xb3f4('0x5'),'password':_0xb3f4('0x7'),'internal':0xfa0+i,'type':'friend','transport':[_0xb3f4('0x8'),'ws',_0xb3f4('0x9')],'disallow':['all'],'allow':[_0xb3f4('0xa')],'defaultuser':util[_0xb3f4('0x3')](_0xb3f4('0x4'),'agent',i),'encryption':_0xb3f4('0xb'),'avpf':_0xb3f4('0xb'),'force_avp':'yes','icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xb3f4('0xc'),'dtlsprivatekey':_0xb3f4('0xd'),'dtlssetup':'actpass','callerid':util['format']('\x22%s\x22\x20<%s>',util[_0xb3f4('0x3')](_0xb3f4('0x4'),_0xb3f4('0x5'),i),0xfa0+i)});}db[_0xb3f4('0xe')][_0xb3f4('0xf')](users)['then'](function(){console[_0xb3f4('0x10')](_0xb3f4('0x11'));})[_0xb3f4('0x12')](function(_0x2a68ab){console[_0xb3f4('0x10')](_0x2a68ab);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index dd51e01..f9e4c81 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcee3=['Telephones','findAll','Trunks','IvrCampaigns','resourceId','map','where','Campaign','type','format','%s:queue:%s','user:%s','handshake','query','userProfileId','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','Trunk','user','SmsQueues','MailQueue','getVoiceQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','voice','chat','fax','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','SocketIO\x20','nsp','address','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','then','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xcee3,0x1ac));var _0x3cee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcee3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3cee('0x0'));var util=require(_0x3cee('0x1'));var BPromise=require(_0x3cee('0x2'));var db=require(_0x3cee('0x3'))['db'];var config=require(_0x3cee('0x4'));var queryQueues={'attributes':['id',_0x3cee('0x5')],'include':[{'as':_0x3cee('0x6'),'model':db[_0x3cee('0x7')],'attributes':['id',_0x3cee('0x5'),_0x3cee('0x8')],'raw':!![],'where':{'role':_0x3cee('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x3cee('0x5')],'where':{'role':_0x3cee('0xa')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x3cee('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x3cee('0x5'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x26e857,_0x1cd5ae,_0x37b85c){return db['UserProfileSection']['findOne']({'where':{'name':_0x26e857,'userProfileId':_0x1cd5ae},'raw':!![]})[_0x3cee('0xb')](function(_0x3d71a1){if(_0x3d71a1){if(_0x3d71a1['autoAssociation']){switch(_0x26e857){case _0x3cee('0xc'):case _0x3cee('0xd'):case _0x3cee('0xe'):case'SmsQueues':case _0x3cee('0xf'):case _0x3cee('0x10'):return db[_0x37b85c]['findAll'](queryQueues);case _0x3cee('0x11'):return db[_0x37b85c][_0x3cee('0x12')](queryTelephones);case _0x3cee('0x13'):return db[_0x37b85c][_0x3cee('0x12')](queryTrunks);case _0x3cee('0x14'):return db[_0x37b85c]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x3cee('0x12')]({'attributes':[_0x3cee('0x15')],'where':{'sectionId':_0x3d71a1['id']},'raw':!![]})[_0x3cee('0xb')](function(_0x5be939){if(_0x5be939){var _0x98e072={'where':{'id':_[_0x3cee('0x16')](_0x5be939,'resourceId')},'raw':!![]};switch(_0x37b85c){case _0x3cee('0x7'):_0x98e072[_0x3cee('0x17')][_0x3cee('0x8')]=_0x3cee('0xa');break;case _0x3cee('0x18'):_0x98e072[_0x3cee('0x17')][_0x3cee('0x19')]='ivr';break;}return db[_0x37b85c]['findAll'](_0x98e072);}else{return[];}});}}else{return[];}})['then'](function(_0x398de7){return _0x398de7;});}function joinOrLeaveQueues(_0x4ede44,_0x34f6da,_0x422860,_0x33f335){_0x4ede44[_0x34f6da](util[_0x3cee('0x1a')](_0x3cee('0x1b'),_0x422860,_0x33f335['name']));if(_0x33f335[_0x3cee('0x6')]){for(var _0x52725e=0x0;_0x52725e<_0x33f335[_0x3cee('0x6')]['length'];_0x52725e+=0x1){_0x4ede44[_0x34f6da](util[_0x3cee('0x1a')](_0x3cee('0x1c'),_0x33f335[_0x3cee('0x6')][_0x52725e]['name']));}}}function joinOrLeave(_0x1a87cd,_0x43bd98,_0x5cc425){var _0x27e399;if(_0x1a87cd[_0x3cee('0x1d')][_0x3cee('0x1e')]['id']){db['User']['find']({'attributes':['id',_0x3cee('0x5'),_0x3cee('0x8'),_0x3cee('0x1f')],'where':{'id':_0x1a87cd[_0x3cee('0x1d')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0x3cee('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x3cee('0x21')],'as':_0x3cee('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x3cee('0x23')],'as':_0x3cee('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x3cee('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x3cee('0x26'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x4538f3){if(_0x4538f3){_0x27e399=_0x4538f3;_0x1a87cd[_0x43bd98](util[_0x3cee('0x1a')]('user:%s',_0x4538f3['name']));var _0x5d4703=[];switch(_0x4538f3[_0x3cee('0x8')]){case _0x3cee('0x27'):_0x1a87cd[_0x43bd98](_0x3cee('0x28'));_0x1a87cd[_0x43bd98](_0x3cee('0x29'));if(queryQueues[_0x3cee('0x2a')](_0x3cee('0x2b'))){delete queryQueues[_0x3cee('0x2b')];}_0x5d4703[_0x3cee('0x2c')](db[_0x3cee('0x2d')][_0x3cee('0x12')](queryQueues));_0x5d4703[_0x3cee('0x2c')](db[_0x3cee('0x2e')][_0x3cee('0x12')](queryQueues));_0x5d4703['push'](db[_0x3cee('0x2f')][_0x3cee('0x12')](queryQueues));_0x5d4703['push'](db[_0x3cee('0x30')]['findAll'](queryQueues));_0x5d4703[_0x3cee('0x2c')](db['MailQueue']['findAll'](queryQueues));_0x5d4703[_0x3cee('0x2c')](db[_0x3cee('0x31')][_0x3cee('0x12')](queryQueues));_0x5d4703[_0x3cee('0x2c')](db[_0x3cee('0x7')][_0x3cee('0x12')](queryTelephones));_0x5d4703['push'](db[_0x3cee('0x32')][_0x3cee('0x12')](queryTrunks));_0x5d4703['push'](db[_0x3cee('0x18')][_0x3cee('0x12')](queryCampaigns));_0x5d4703[_0x3cee('0x2c')](db['User'][_0x3cee('0x12')](queryAgents));break;case _0x3cee('0x33'):_0x1a87cd[_0x43bd98](_0x3cee('0x28'));_0x1a87cd[_0x43bd98](_0x3cee('0x29'));_0x5d4703[_0x3cee('0x2c')](getAssociatedResources(_0x3cee('0xc'),_0x4538f3[_0x3cee('0x1f')],'VoiceQueue'));_0x5d4703['push'](getAssociatedResources('ChatQueues',_0x4538f3[_0x3cee('0x1f')],_0x3cee('0x2e')));_0x5d4703[_0x3cee('0x2c')](getAssociatedResources(_0x3cee('0xe'),_0x4538f3[_0x3cee('0x1f')],_0x3cee('0x2f')));_0x5d4703['push'](getAssociatedResources(_0x3cee('0x34'),_0x4538f3[_0x3cee('0x1f')],_0x3cee('0x30')));_0x5d4703[_0x3cee('0x2c')](getAssociatedResources(_0x3cee('0xf'),_0x4538f3[_0x3cee('0x1f')],_0x3cee('0x35')));_0x5d4703[_0x3cee('0x2c')](getAssociatedResources(_0x3cee('0x10'),_0x4538f3['userProfileId'],_0x3cee('0x31')));_0x5d4703[_0x3cee('0x2c')](getAssociatedResources('Telephones',_0x4538f3['userProfileId'],_0x3cee('0x7')));_0x5d4703['push'](getAssociatedResources(_0x3cee('0x13'),_0x4538f3[_0x3cee('0x1f')],_0x3cee('0x32')));_0x5d4703['push'](getAssociatedResources(_0x3cee('0x14'),_0x4538f3[_0x3cee('0x1f')],_0x3cee('0x18')));_0x5d4703[_0x3cee('0x2c')](db[_0x3cee('0x7')][_0x3cee('0x12')](queryAgents));break;case _0x3cee('0x9'):_0x1a87cd[_0x43bd98]('voice:inbound');_0x1a87cd[_0x43bd98](_0x3cee('0x29'));_0x5d4703[_0x3cee('0x2c')](_0x4538f3[_0x3cee('0x36')]({'attributes':['id',_0x3cee('0x5')]}));_0x5d4703['push'](_0x4538f3['getChatQueues']({'attributes':['id',_0x3cee('0x5')]}));_0x5d4703[_0x3cee('0x2c')](_0x4538f3['getFaxQueues']({'attributes':['id','name']}));_0x5d4703[_0x3cee('0x2c')](_0x4538f3[_0x3cee('0x37')]({'attributes':['id',_0x3cee('0x5')]}));_0x5d4703[_0x3cee('0x2c')](_0x4538f3[_0x3cee('0x38')]({'attributes':['id',_0x3cee('0x5')]}));_0x5d4703[_0x3cee('0x2c')](_0x4538f3[_0x3cee('0x39')]({'attributes':['id','name']}));break;}return BPromise[_0x3cee('0x3a')](_0x5d4703);}})['then'](function(_0x1fcb81){if(_0x1fcb81&&_0x1fcb81[_0x3cee('0x3b')]){for(var _0x1d992a=0x0;_0x1d992a<_0x1fcb81['length'];_0x1d992a+=0x1){for(var _0xc67b0=0x0;_0xc67b0<_0x1fcb81[_0x1d992a][_0x3cee('0x3b')];_0xc67b0+=0x1){switch(_0x1d992a){case 0x0:joinOrLeaveQueues(_0x1a87cd,_0x43bd98,_0x3cee('0x3c'),_0x1fcb81[_0x1d992a][_0xc67b0]);break;case 0x1:joinOrLeaveQueues(_0x1a87cd,_0x43bd98,_0x3cee('0x3d'),_0x1fcb81[_0x1d992a][_0xc67b0]);break;case 0x2:joinOrLeaveQueues(_0x1a87cd,_0x43bd98,_0x3cee('0x3e'),_0x1fcb81[_0x1d992a][_0xc67b0]);break;case 0x3:joinOrLeaveQueues(_0x1a87cd,_0x43bd98,'sms',_0x1fcb81[_0x1d992a][_0xc67b0]);break;case 0x4:joinOrLeaveQueues(_0x1a87cd,_0x43bd98,'mail',_0x1fcb81[_0x1d992a][_0xc67b0]);break;case 0x5:joinOrLeaveQueues(_0x1a87cd,_0x43bd98,_0x3cee('0x3f'),_0x1fcb81[_0x1d992a][_0xc67b0]);break;case 0x6:_0x1a87cd[_0x43bd98](util[_0x3cee('0x1a')](_0x3cee('0x40'),_0x1fcb81[_0x1d992a][_0xc67b0][_0x3cee('0x5')]));break;case 0x7:_0x1a87cd[_0x43bd98](util[_0x3cee('0x1a')](_0x3cee('0x41'),_0x1fcb81[_0x1d992a][_0xc67b0][_0x3cee('0x5')]));break;case 0x8:_0x1a87cd[_0x43bd98](util[_0x3cee('0x1a')]('campaign:%s:%s',_0x1fcb81[_0x1d992a][_0xc67b0][_0x3cee('0x19')],_0x1fcb81[_0x1d992a][_0xc67b0][_0x3cee('0x5')]));break;case 0x9:_0x1a87cd[_0x43bd98](util[_0x3cee('0x1a')](_0x3cee('0x1c'),_0x1fcb81[_0x1d992a][_0xc67b0][_0x3cee('0x5')]));break;}}}}})[_0x3cee('0xb')](function(){if(_0x43bd98===_0x3cee('0x42')){var _0x1a655d=_[_0x3cee('0x16')](_0x27e399['ChatInteractions'],'id');return _0x27e399[_0x3cee('0x43')](_0x1a655d)['then'](function(){for(var _0xe20d12=0x0;_0xe20d12<_0x1a655d['length'];_0xe20d12+=0x1){_0x5cc425[_0x3cee('0x44')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x1a655d[_0xe20d12]),'UserId':Number(_0x27e399['id'])});}});}})[_0x3cee('0xb')](function(){if(_0x43bd98===_0x3cee('0x42')){var _0x42d651=_[_0x3cee('0x16')](_0x27e399[_0x3cee('0x22')],'id');return _0x27e399[_0x3cee('0x45')](_0x42d651)['then'](function(){for(var _0x572dc6=0x0;_0x572dc6<_0x42d651[_0x3cee('0x3b')];_0x572dc6+=0x1){_0x5cc425[_0x3cee('0x44')](_0x3cee('0x46'),{'MailInteractionId':Number(_0x42d651[_0x572dc6]),'UserId':Number(_0x27e399['id'])});}});}})[_0x3cee('0xb')](function(){if(_0x43bd98===_0x3cee('0x42')){var _0x3a85ec=_[_0x3cee('0x16')](_0x27e399['FaxInteractions'],'id');return _0x27e399[_0x3cee('0x47')](_0x3a85ec)[_0x3cee('0xb')](function(){for(var _0x4d36f5=0x0;_0x4d36f5<_0x3a85ec[_0x3cee('0x3b')];_0x4d36f5+=0x1){_0x5cc425[_0x3cee('0x44')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x3a85ec[_0x4d36f5]),'UserId':Number(_0x27e399['id'])});}});}})[_0x3cee('0xb')](function(){if(_0x43bd98===_0x3cee('0x42')){var _0x2a1f83=_[_0x3cee('0x16')](_0x27e399['SmsInteractions'],'id');return _0x27e399[_0x3cee('0x48')](_0x2a1f83)['then'](function(){for(var _0x1f82e7=0x0;_0x1f82e7<_0x2a1f83['length'];_0x1f82e7+=0x1){_0x5cc425[_0x3cee('0x44')](_0x3cee('0x49'),{'SmsInteractionId':Number(_0x2a1f83[_0x1f82e7]),'UserId':Number(_0x27e399['id'])});}});}})['then'](function(){if(_0x43bd98===_0x3cee('0x42')){var _0x33cbf5=_[_0x3cee('0x16')](_0x27e399[_0x3cee('0x26')],'id');return _0x27e399[_0x3cee('0x4a')](_0x33cbf5)[_0x3cee('0xb')](function(){for(var _0x3a8084=0x0;_0x3a8084<_0x33cbf5[_0x3cee('0x3b')];_0x3a8084+=0x1){_0x5cc425['emit'](_0x3cee('0x4b'),{'OpenchannelInteractionId':Number(_0x33cbf5[_0x3a8084]),'UserId':Number(_0x27e399['id'])});}});}})[_0x3cee('0x4c')](function(_0x30ab17){_0x1a87cd[_0x3cee('0x4d')](_0x30ab17);});}}function onDisconnect(_0x5e5b15,_0x4f7178){joinOrLeave(_0x5e5b15,_0x3cee('0x42'),_0x4f7178);}function onConnect(_0x517f18){joinOrLeave(_0x517f18,_0x3cee('0x4e'));}exports[_0x3cee('0x4f')]=function(_0x1f8715){_0x1f8715['on'](_0x3cee('0x50'),function(_0x4a2020){_0x4a2020[_0x3cee('0x51')](0x0);_0x4a2020['address']=_0x4a2020[_0x3cee('0x52')][_0x3cee('0x50')][_0x3cee('0x53')]+':'+_0x4a2020['request']['connection']['remotePort'];_0x4a2020['connectedAt']=new Date();_0x4a2020[_0x3cee('0x4d')]=function(_0x3a1115){console['log'](_0x3cee('0x54')+_0x4a2020[_0x3cee('0x55')][_0x3cee('0x5')]+'['+_0x4a2020[_0x3cee('0x56')]+']',_0x3a1115);};_0x4a2020['on'](_0x3cee('0x57'),function(){onDisconnect(_0x4a2020,_0x1f8715);_0x4a2020[_0x3cee('0x4d')]('DISCONNECTED');});onConnect(_0x4a2020);_0x4a2020[_0x3cee('0x4d')](_0x3cee('0x58'));});}; \ No newline at end of file +var _0x497e=['voice','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','MailInteractions','removeMailInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','default','connection','setMaxListeners','request','connectedAt','log','SocketIO\x20','nsp','address','DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','findOne','autoAssociation','VoiceQueues','ChatQueues','MailQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','ivr','format','%s:queue:%s','length','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','FaxQueues','SmsQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','then'];(function(_0x15ad9d,_0x20e376){var _0xe7e5fe=function(_0x3f528b){while(--_0x3f528b){_0x15ad9d['push'](_0x15ad9d['shift']());}};_0xe7e5fe(++_0x20e376);}(_0x497e,0xcb));var _0xe497=function(_0x48ee51,_0x1f8508){_0x48ee51=_0x48ee51-0x0;var _0x331de9=_0x497e[_0x48ee51];return _0x331de9;};'use strict';var _=require(_0xe497('0x0'));var util=require(_0xe497('0x1'));var BPromise=require(_0xe497('0x2'));var db=require(_0xe497('0x3'))['db'];var config=require(_0xe497('0x4'));var queryQueues={'attributes':['id',_0xe497('0x5')],'include':[{'as':_0xe497('0x6'),'model':db[_0xe497('0x7')],'attributes':['id',_0xe497('0x5'),_0xe497('0x8')],'raw':!![],'where':{'role':_0xe497('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xe497('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0xe497('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xe497('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xe497('0x5'),_0xe497('0xb')],'where':{'type':'ivr'}};function getAssociatedResources(_0x363f94,_0x222eb7,_0x164ace){return db['UserProfileSection'][_0xe497('0xc')]({'where':{'name':_0x363f94,'userProfileId':_0x222eb7},'raw':!![]})['then'](function(_0x483e2d){if(_0x483e2d){if(_0x483e2d[_0xe497('0xd')]){switch(_0x363f94){case _0xe497('0xe'):case _0xe497('0xf'):case'FaxQueues':case'SmsQueues':case _0xe497('0x10'):case _0xe497('0x11'):return db[_0x164ace][_0xe497('0x12')](queryQueues);case _0xe497('0x13'):return db[_0x164ace][_0xe497('0x12')](queryTelephones);case'Trunks':return db[_0x164ace][_0xe497('0x12')](queryTrunks);case _0xe497('0x14'):return db[_0x164ace][_0xe497('0x12')](queryCampaigns);}}else{return db[_0xe497('0x15')][_0xe497('0x12')]({'attributes':[_0xe497('0x16')],'where':{'sectionId':_0x483e2d['id']},'raw':!![]})['then'](function(_0x50d3e9){if(_0x50d3e9){var _0x2e2666={'where':{'id':_[_0xe497('0x17')](_0x50d3e9,_0xe497('0x16'))},'raw':!![]};switch(_0x164ace){case'User':_0x2e2666[_0xe497('0x18')][_0xe497('0x8')]='telephone';break;case _0xe497('0x19'):_0x2e2666[_0xe497('0x18')][_0xe497('0xb')]=_0xe497('0x1a');break;}return db[_0x164ace]['findAll'](_0x2e2666);}else{return[];}});}}else{return[];}})['then'](function(_0x399b42){return _0x399b42;});}function joinOrLeaveQueues(_0x459c3c,_0x353387,_0x46eab9,_0x577e63){_0x459c3c[_0x353387](util[_0xe497('0x1b')](_0xe497('0x1c'),_0x46eab9,_0x577e63[_0xe497('0x5')]));if(_0x577e63['Agents']){for(var _0x56d380=0x0;_0x56d380<_0x577e63[_0xe497('0x6')][_0xe497('0x1d')];_0x56d380+=0x1){_0x459c3c[_0x353387](util['format'](_0xe497('0x1e'),_0x577e63[_0xe497('0x6')][_0x56d380][_0xe497('0x5')]));}}}function joinOrLeave(_0x318be9,_0x6ac97f,_0x3fa777){var _0x5b1ebc;if(_0x318be9[_0xe497('0x1f')][_0xe497('0x20')]['id']){db[_0xe497('0x7')]['find']({'attributes':['id','name',_0xe497('0x8'),_0xe497('0x21')],'where':{'id':_0x318be9[_0xe497('0x1f')][_0xe497('0x20')]['id']},'include':[{'model':db[_0xe497('0x22')],'as':_0xe497('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xe497('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xe497('0x25')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xe497('0x26')],'as':_0xe497('0x27'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x1aa9a4){if(_0x1aa9a4){_0x5b1ebc=_0x1aa9a4;_0x318be9[_0x6ac97f](util[_0xe497('0x1b')](_0xe497('0x1e'),_0x1aa9a4[_0xe497('0x5')]));var _0x1d55f3=[];switch(_0x1aa9a4[_0xe497('0x8')]){case _0xe497('0x28'):_0x318be9[_0x6ac97f](_0xe497('0x29'));_0x318be9[_0x6ac97f](_0xe497('0x2a'));if(queryQueues['hasOwnProperty'](_0xe497('0x2b'))){delete queryQueues['include'];}_0x1d55f3[_0xe497('0x2c')](db[_0xe497('0x2d')]['findAll'](queryQueues));_0x1d55f3['push'](db[_0xe497('0x2e')]['findAll'](queryQueues));_0x1d55f3['push'](db[_0xe497('0x2f')][_0xe497('0x12')](queryQueues));_0x1d55f3['push'](db[_0xe497('0x30')][_0xe497('0x12')](queryQueues));_0x1d55f3['push'](db[_0xe497('0x31')][_0xe497('0x12')](queryQueues));_0x1d55f3[_0xe497('0x2c')](db[_0xe497('0x32')]['findAll'](queryQueues));_0x1d55f3['push'](db[_0xe497('0x7')]['findAll'](queryTelephones));_0x1d55f3[_0xe497('0x2c')](db[_0xe497('0x33')][_0xe497('0x12')](queryTrunks));_0x1d55f3[_0xe497('0x2c')](db[_0xe497('0x19')]['findAll'](queryCampaigns));_0x1d55f3['push'](db[_0xe497('0x7')][_0xe497('0x12')](queryAgents));break;case _0xe497('0x34'):_0x318be9[_0x6ac97f](_0xe497('0x29'));_0x318be9[_0x6ac97f](_0xe497('0x2a'));_0x1d55f3[_0xe497('0x2c')](getAssociatedResources('VoiceQueues',_0x1aa9a4[_0xe497('0x21')],_0xe497('0x2d')));_0x1d55f3[_0xe497('0x2c')](getAssociatedResources(_0xe497('0xf'),_0x1aa9a4[_0xe497('0x21')],_0xe497('0x2e')));_0x1d55f3[_0xe497('0x2c')](getAssociatedResources(_0xe497('0x35'),_0x1aa9a4[_0xe497('0x21')],_0xe497('0x2f')));_0x1d55f3[_0xe497('0x2c')](getAssociatedResources(_0xe497('0x36'),_0x1aa9a4[_0xe497('0x21')],_0xe497('0x30')));_0x1d55f3[_0xe497('0x2c')](getAssociatedResources(_0xe497('0x10'),_0x1aa9a4[_0xe497('0x21')],_0xe497('0x31')));_0x1d55f3['push'](getAssociatedResources(_0xe497('0x11'),_0x1aa9a4['userProfileId'],'OpenchannelQueue'));_0x1d55f3['push'](getAssociatedResources('Telephones',_0x1aa9a4['userProfileId'],_0xe497('0x7')));_0x1d55f3[_0xe497('0x2c')](getAssociatedResources('Trunks',_0x1aa9a4[_0xe497('0x21')],_0xe497('0x33')));_0x1d55f3[_0xe497('0x2c')](getAssociatedResources(_0xe497('0x14'),_0x1aa9a4[_0xe497('0x21')],'Campaign'));_0x1d55f3[_0xe497('0x2c')](db['User'][_0xe497('0x12')](queryAgents));break;case'agent':_0x318be9[_0x6ac97f]('voice:inbound');_0x318be9[_0x6ac97f](_0xe497('0x2a'));_0x1d55f3[_0xe497('0x2c')](_0x1aa9a4[_0xe497('0x37')]({'attributes':['id',_0xe497('0x5')]}));_0x1d55f3[_0xe497('0x2c')](_0x1aa9a4[_0xe497('0x38')]({'attributes':['id',_0xe497('0x5')]}));_0x1d55f3[_0xe497('0x2c')](_0x1aa9a4[_0xe497('0x39')]({'attributes':['id',_0xe497('0x5')]}));_0x1d55f3[_0xe497('0x2c')](_0x1aa9a4[_0xe497('0x3a')]({'attributes':['id',_0xe497('0x5')]}));_0x1d55f3['push'](_0x1aa9a4['getMailQueues']({'attributes':['id','name']}));_0x1d55f3[_0xe497('0x2c')](_0x1aa9a4[_0xe497('0x3b')]({'attributes':['id',_0xe497('0x5')]}));break;}return BPromise['all'](_0x1d55f3);}})[_0xe497('0x3c')](function(_0x88c7c7){if(_0x88c7c7&&_0x88c7c7['length']){for(var _0x23c57d=0x0;_0x23c57d<_0x88c7c7[_0xe497('0x1d')];_0x23c57d+=0x1){for(var _0x26ff2a=0x0;_0x26ff2a<_0x88c7c7[_0x23c57d][_0xe497('0x1d')];_0x26ff2a+=0x1){switch(_0x23c57d){case 0x0:joinOrLeaveQueues(_0x318be9,_0x6ac97f,_0xe497('0x3d'),_0x88c7c7[_0x23c57d][_0x26ff2a]);break;case 0x1:joinOrLeaveQueues(_0x318be9,_0x6ac97f,'chat',_0x88c7c7[_0x23c57d][_0x26ff2a]);break;case 0x2:joinOrLeaveQueues(_0x318be9,_0x6ac97f,'fax',_0x88c7c7[_0x23c57d][_0x26ff2a]);break;case 0x3:joinOrLeaveQueues(_0x318be9,_0x6ac97f,'sms',_0x88c7c7[_0x23c57d][_0x26ff2a]);break;case 0x4:joinOrLeaveQueues(_0x318be9,_0x6ac97f,_0xe497('0x3e'),_0x88c7c7[_0x23c57d][_0x26ff2a]);break;case 0x5:joinOrLeaveQueues(_0x318be9,_0x6ac97f,_0xe497('0x3f'),_0x88c7c7[_0x23c57d][_0x26ff2a]);break;case 0x6:_0x318be9[_0x6ac97f](util[_0xe497('0x1b')](_0xe497('0x40'),_0x88c7c7[_0x23c57d][_0x26ff2a][_0xe497('0x5')]));break;case 0x7:_0x318be9[_0x6ac97f](util['format'](_0xe497('0x41'),_0x88c7c7[_0x23c57d][_0x26ff2a][_0xe497('0x5')]));break;case 0x8:_0x318be9[_0x6ac97f](util[_0xe497('0x1b')](_0xe497('0x42'),_0x88c7c7[_0x23c57d][_0x26ff2a][_0xe497('0xb')],_0x88c7c7[_0x23c57d][_0x26ff2a]['name']));break;case 0x9:_0x318be9[_0x6ac97f](util[_0xe497('0x1b')]('user:%s',_0x88c7c7[_0x23c57d][_0x26ff2a][_0xe497('0x5')]));break;}}}}})[_0xe497('0x3c')](function(){if(_0x6ac97f==='leave'){var _0x180fab=_[_0xe497('0x17')](_0x5b1ebc[_0xe497('0x23')],'id');return _0x5b1ebc[_0xe497('0x43')](_0x180fab)['then'](function(){for(var _0x44994b=0x0;_0x44994b<_0x180fab[_0xe497('0x1d')];_0x44994b+=0x1){_0x3fa777[_0xe497('0x44')](_0xe497('0x45'),{'ChatInteractionId':Number(_0x180fab[_0x44994b]),'UserId':Number(_0x5b1ebc['id'])});}});}})[_0xe497('0x3c')](function(){if(_0x6ac97f===_0xe497('0x46')){var _0x456ad3=_[_0xe497('0x17')](_0x5b1ebc[_0xe497('0x47')],'id');return _0x5b1ebc[_0xe497('0x48')](_0x456ad3)[_0xe497('0x3c')](function(){for(var _0x2c661c=0x0;_0x2c661c<_0x456ad3[_0xe497('0x1d')];_0x2c661c+=0x1){_0x3fa777[_0xe497('0x44')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x456ad3[_0x2c661c]),'UserId':Number(_0x5b1ebc['id'])});}});}})[_0xe497('0x3c')](function(){if(_0x6ac97f===_0xe497('0x46')){var _0x9647fc=_[_0xe497('0x17')](_0x5b1ebc['FaxInteractions'],'id');return _0x5b1ebc['removeFaxInteractions'](_0x9647fc)[_0xe497('0x3c')](function(){for(var _0x46d29f=0x0;_0x46d29f<_0x9647fc[_0xe497('0x1d')];_0x46d29f+=0x1){_0x3fa777[_0xe497('0x44')](_0xe497('0x49'),{'FaxInteractionId':Number(_0x9647fc[_0x46d29f]),'UserId':Number(_0x5b1ebc['id'])});}});}})['then'](function(){if(_0x6ac97f==='leave'){var _0x2287c2=_[_0xe497('0x17')](_0x5b1ebc['SmsInteractions'],'id');return _0x5b1ebc[_0xe497('0x4a')](_0x2287c2)[_0xe497('0x3c')](function(){for(var _0x1fbb76=0x0;_0x1fbb76<_0x2287c2[_0xe497('0x1d')];_0x1fbb76+=0x1){_0x3fa777[_0xe497('0x44')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x2287c2[_0x1fbb76]),'UserId':Number(_0x5b1ebc['id'])});}});}})['then'](function(){if(_0x6ac97f===_0xe497('0x46')){var _0x423b1e=_[_0xe497('0x17')](_0x5b1ebc['OpenchannelInteractions'],'id');return _0x5b1ebc[_0xe497('0x4b')](_0x423b1e)[_0xe497('0x3c')](function(){for(var _0x39f0c7=0x0;_0x39f0c7<_0x423b1e[_0xe497('0x1d')];_0x39f0c7+=0x1){_0x3fa777[_0xe497('0x44')](_0xe497('0x4c'),{'OpenchannelInteractionId':Number(_0x423b1e[_0x39f0c7]),'UserId':Number(_0x5b1ebc['id'])});}});}})[_0xe497('0x4d')](function(_0x49ec1){_0x318be9['log'](_0x49ec1);});}}function onDisconnect(_0x498a27,_0x6610e3){joinOrLeave(_0x498a27,_0xe497('0x46'),_0x6610e3);}function onConnect(_0x3bf7ec){joinOrLeave(_0x3bf7ec,'join');}exports[_0xe497('0x4e')]=function(_0x488e06){_0x488e06['on'](_0xe497('0x4f'),function(_0x4afada){_0x4afada[_0xe497('0x50')](0x0);_0x4afada['address']=_0x4afada[_0xe497('0x51')][_0xe497('0x4f')]['remoteAddress']+':'+_0x4afada[_0xe497('0x51')][_0xe497('0x4f')]['remotePort'];_0x4afada[_0xe497('0x52')]=new Date();_0x4afada[_0xe497('0x53')]=function(_0x4150fe){console['log'](_0xe497('0x54')+_0x4afada[_0xe497('0x55')][_0xe497('0x5')]+'['+_0x4afada[_0xe497('0x56')]+']',_0x4150fe);};_0x4afada['on']('disconnect',function(){onDisconnect(_0x4afada,_0x488e06);_0x4afada[_0xe497('0x53')](_0xe497('0x57'));});onConnect(_0x4afada);_0x4afada[_0xe497('0x53')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 784572c..c1313a2 100644 --- a/server/config/triggers/index.js +++ b/server/config/triggers/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6c5=['EventManager','error','catch','channel','event','direction','UserId','User','interface','SIP/%s','name','incomingmessage','outgoingmessage','get','opened','changed','closed','find','format','default','length','model','hook','callback','toLowerCase','condition','util','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','Sms','SmsInteraction','newmessage','FaxInteraction','Fax','FaxMessage','Mail','MailMessage','OpenchannelInteraction','Openchannel','then','info','Trigger,\x20%s'];(function(_0x5ec09c,_0x40f6b4){var _0x2259f1=function(_0x45df9d){while(--_0x45df9d){_0x5ec09c['push'](_0x5ec09c['shift']());}};_0x2259f1(++_0x40f6b4);}(_0xd6c5,0x11e));var _0x5d6c=function(_0x3128ba,_0x10a370){_0x3128ba=_0x3128ba-0x0;var _0x3128ef=_0xd6c5[_0x3128ba];return _0x3128ef;};'use strict';var util=require(_0x5d6c('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5d6c('0x1'));var logger=require(_0x5d6c('0x2'))(_0x5d6c('0x3'));var client=jayson[_0x5d6c('0x4')][_0x5d6c('0x5')]({'port':0x232a});var triggers=[{'channel':_0x5d6c('0x6'),'model':_0x5d6c('0x7'),'event':_0x5d6c('0x8'),'condition':_0x5d6c('0x9'),'callback':afterCreate},{'channel':'Chat','model':_0x5d6c('0x7'),'event':_0x5d6c('0xa'),'condition':_0x5d6c('0xb'),'callback':afterUpdate},{'channel':_0x5d6c('0x6'),'model':_0x5d6c('0xc'),'event':_0x5d6c('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x5d6c('0xd'),'model':'SmsInteraction','event':_0x5d6c('0x8'),'condition':_0x5d6c('0x9'),'callback':afterCreate},{'channel':_0x5d6c('0xd'),'model':_0x5d6c('0xe'),'event':_0x5d6c('0xa'),'condition':_0x5d6c('0xb'),'callback':afterUpdate},{'channel':_0x5d6c('0xd'),'model':'SmsMessage','event':_0x5d6c('0x8'),'condition':_0x5d6c('0xf'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0x5d6c('0x8'),'condition':_0x5d6c('0x9'),'callback':afterCreate},{'channel':'Fax','model':_0x5d6c('0x10'),'event':_0x5d6c('0xa'),'condition':_0x5d6c('0xb'),'callback':afterUpdate},{'channel':_0x5d6c('0x11'),'model':_0x5d6c('0x12'),'event':_0x5d6c('0x8'),'condition':_0x5d6c('0xf'),'callback':afterCreateMessage},{'channel':_0x5d6c('0x13'),'model':'MailInteraction','event':_0x5d6c('0x8'),'condition':_0x5d6c('0x9'),'callback':afterCreate},{'channel':_0x5d6c('0x13'),'model':'MailInteraction','event':_0x5d6c('0xa'),'condition':_0x5d6c('0xb'),'callback':afterUpdate},{'channel':_0x5d6c('0x13'),'model':_0x5d6c('0x14'),'event':_0x5d6c('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Openchannel','model':_0x5d6c('0x15'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x5d6c('0x16'),'model':_0x5d6c('0x15'),'event':_0x5d6c('0xa'),'condition':_0x5d6c('0xb'),'callback':afterUpdate},{'channel':_0x5d6c('0x16'),'model':'OpenchannelMessage','event':'afterCreate','condition':_0x5d6c('0xf'),'callback':afterCreateMessage}];function request(_0x2da042){return client['request']('EventManager',_0x2da042)[_0x5d6c('0x17')](function(_0x3ad981){logger[_0x5d6c('0x18')](_0x5d6c('0x19'),_0x5d6c('0x1a'),_0x3ad981);if(_0x3ad981[_0x5d6c('0x1b')]){if(_0x3ad981[_0x5d6c('0x1b')]['code']===0x1f4){logger[_0x5d6c('0x1b')](_0x5d6c('0x19'),_0x5d6c('0x1a'),_0x3ad981[_0x5d6c('0x1b')]);}}})[_0x5d6c('0x1c')](function(_0x5b53e4){logger[_0x5d6c('0x1b')](_0x5d6c('0x19'),'EventManager',_0x5b53e4);});}function afterCreateMessage(_0x331b72,_0x2f8110){return function(_0x1f16fa,_0x4f1407){_0x1f16fa=_0x1f16fa['get']({'plain':!![]});_0x1f16fa[_0x5d6c('0x1d')]=_0x331b72;_0x1f16fa[_0x5d6c('0x1e')]=_0x1f16fa[_0x5d6c('0x1f')];if(_0x1f16fa[_0x5d6c('0x20')]){return db[_0x5d6c('0x21')]['find']({'where':{'id':_0x1f16fa[_0x5d6c('0x20')]},'attributes':['id','name'],'raw':!![]})[_0x5d6c('0x17')](function(_0x2302a8){_0x1f16fa[_0x5d6c('0x22')]=util['format'](_0x5d6c('0x23'),_0x2302a8[_0x5d6c('0x24')]);_0x1f16fa[_0x5d6c('0x1d')]=_0x331b72;return request({'event':_0x5d6c('0x25'),'message':_0x1f16fa});})[_0x5d6c('0x1c')](function(_0x519137){console['error'](_0x519137);});}else{return request({'event':_0x5d6c('0x26'),'message':_0x1f16fa});}};}function afterCreate(_0x4dd7a8,_0x277996){return function(_0x3fdbf1,_0x2734a5){_0x3fdbf1=_0x3fdbf1[_0x5d6c('0x27')]({'plain':!![]});_0x3fdbf1[_0x5d6c('0x1d')]=_0x4dd7a8;_0x3fdbf1[_0x5d6c('0x1e')]=_0x5d6c('0x28');return request({'event':_0x277996,'message':_0x3fdbf1});};}function afterUpdate(_0x5ea37b,_0x3f0475){return function(_0x245ea0,_0x2c9da0){if(_0x245ea0[_0x5d6c('0x29')](_0x5d6c('0x2a'))&&_0x245ea0[_0x5d6c('0x2a')]){_0x245ea0=_0x245ea0['get']({'plain':!![]});_0x245ea0[_0x5d6c('0x1d')]=_0x5ea37b;_0x245ea0[_0x5d6c('0x1e')]=_0x5d6c('0x2a');if(_0x245ea0[_0x5d6c('0x20')]){return db[_0x5d6c('0x21')][_0x5d6c('0x2b')]({'where':{'id':_0x245ea0[_0x5d6c('0x20')]},'attributes':['id',_0x5d6c('0x24')],'raw':!![]})[_0x5d6c('0x17')](function(_0x28039f){_0x245ea0[_0x5d6c('0x22')]=util[_0x5d6c('0x2c')](_0x5d6c('0x23'),_0x28039f['name']);return request({'event':_0x3f0475,'message':_0x245ea0});})['catch'](function(_0x396c5f){console[_0x5d6c('0x1b')](_0x396c5f);});}else{return request({'event':_0x3f0475,'message':_0x245ea0});}}};}exports[_0x5d6c('0x2d')]=function(){for(var _0x573d4d=0x0;_0x573d4d=_0x3d1647['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x209c4a(_0x526f44);})[_0x5f68('0x14')](function(_0xb3390e){_0xeeef46(_0xb3390e);});});}; \ No newline at end of file +var _0x4aa5=['mail','chat','fax','openchannel','isValidChannel','includes','isUndefined','blockedAt','updateAttributes','role','User','agent','getLicense','agents','lodash','bluebird','./license/util','voice'];(function(_0x9adf2f,_0x65636d){var _0x5bbd46=function(_0x5384f7){while(--_0x5384f7){_0x9adf2f['push'](_0x9adf2f['shift']());}};_0x5bbd46(++_0x65636d);}(_0x4aa5,0x1d0));var _0x54aa=function(_0x10bc2e,_0xa2307e){_0x10bc2e=_0x10bc2e-0x0;var _0x2490c9=_0x4aa5[_0x10bc2e];return _0x2490c9;};'use strict';var _=require(_0x54aa('0x0'));var BPromise=require(_0x54aa('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x54aa('0x2'));var channels=[_0x54aa('0x3'),_0x54aa('0x4'),_0x54aa('0x5'),_0x54aa('0x6'),'sms',_0x54aa('0x7')];exports['getChannels']=function(){return channels;};exports[_0x54aa('0x8')]=function(_0x56a088){_0x56a088=_0x56a088['toLowerCase']();return _[_0x54aa('0x9')](channels,_0x56a088);};exports['clearBlockUser']=function(_0x562d4a,_0x50c74a,_0x5bbc8d,_0x2a8aa3){var _0x206798={'loginAttempts':_0x50c74a,'blocked':_0x5bbc8d};if(!_[_0x54aa('0xa')](_0x2a8aa3)){_0x206798[_0x54aa('0xb')]=_0x2a8aa3;}return _0x562d4a[_0x54aa('0xc')](_0x206798);};exports['getLicense']=function(_0x3ff0d2){return new BPromise(function(_0x5eea0a,_0x458d36){var _0x3b8f06=0x0;if(_0x3ff0d2[_0x54aa('0xd')]!=='agent'){_0x5eea0a(_0x3ff0d2);}db[_0x54aa('0xe')]['count']({'where':{'role':_0x54aa('0xf'),'online':!![],'id':{'$ne':_0x3ff0d2['id']}}})['then'](function(_0x470bcb){_0x3b8f06=_0x470bcb;return util[_0x54aa('0x10')]();})['then'](function(_0x1e77c4){if(_0x1e77c4&&_0x1e77c4['agents']&&_0x3b8f06>=_0x1e77c4[_0x54aa('0x11')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x5eea0a(_0x3ff0d2);})['catch'](function(_0x885a8b){_0x458d36(_0x885a8b);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index adcc9c9..2aa577e 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64a6=['render','json','exports','404','status'];(function(_0x192b02,_0x9af40d){var _0x2effa3=function(_0x57e765){while(--_0x57e765){_0x192b02['push'](_0x192b02['shift']());}};_0x2effa3(++_0x9af40d);}(_0x64a6,0x133));var _0x664a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x64a6[_0x4a9fb1];return _0x348672;};'use strict';module[_0x664a('0x0')][0x194]=function pageNotFound(_0x5f5ca3,_0x574251){var _0x435dc6=_0x664a('0x1');var _0x42a103=0x194;var _0x342a37={'status':_0x42a103};_0x574251[_0x664a('0x2')](_0x342a37[_0x664a('0x2')]);_0x574251[_0x664a('0x3')](_0x435dc6,{},function(_0x507031,_0x2103ea){if(_0x507031){return _0x574251['status'](_0x342a37[_0x664a('0x2')])[_0x664a('0x4')](_0x342a37);}_0x574251['send'](_0x2103ea);});}; \ No newline at end of file +var _0x32e0=['status','render','json','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32e0,0xcc));var _0x032e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x32e0[_0x5b561d];return _0x431060;};'use strict';module['exports'][0x194]=function pageNotFound(_0x509e2a,_0x24c764){var _0x1a1087='404';var _0x14ef59=0x194;var _0x5d1e5d={'status':_0x14ef59};_0x24c764[_0x032e('0x0')](_0x5d1e5d[_0x032e('0x0')]);_0x24c764[_0x032e('0x1')](_0x1a1087,{},function(_0x24052a,_0x244024){if(_0x24052a){return _0x24c764[_0x032e('0x0')](_0x5d1e5d[_0x032e('0x0')])[_0x032e('0x2')](_0x5d1e5d);}_0x24c764[_0x032e('0x3')](_0x244024);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 539b084..a997078 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x664e=['VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','cascade','hasMany','VoiceRecording','UserId','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','belongsTo','userProfileId','belongsToMany','CmContact','Contacts','cm_user_has_contacts','Lists','user_has_teams','user_has_mail_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','UserVoiceQueue','MailQueue','MailQueues','ChatQueues','FaxQueue','FaxQueues','SmsQueue','cm_user_has_lists','user_has_voice_prefixes','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','SmsAccounts','user_has_sms_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','team_has_voice_queues','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Imap','MailServerOut','Smtp','Dispositions','Answers','List','ListId','TemplateId','Teams','MailInteractionId','Account','mail_interaction_has_tags','Tags','Attachments','Interaction','restrict','TagId','Items','FaxAccountId','FaxAccount','Interactions','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','ThroughTags','Users','user_has_fax_interactions','Attachment','team_has_fax_queues','SmsAccountId','SmsMessage','SmsInteractionId','Owner','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','UserOpenchannelQueue','team_has_openchannel_queues','ChatWebsiteId','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatInternalMessage','ChatGroupId','chat_group_has_users','Hoppers','JscriptySessionReport','JscriptySessions','CompanyId','cm_contact_has_tags','OwnerId','Queue','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Action','Actions','AutomationId','Intervals','MailApplications','ChatApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','moh_has_sounds','sms_interaction_has_tags','Trigger','AllConditions','TriggerAllId','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceConfiguration','Configurations','SubjectId','Descriptions','FieldId','AccountId','Subject','Description','Field','VariableId','DescriptionId','Subjects','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerField','JscriptyQuestionReport','SessionId','ProjectId','team_has_sms_queues','SmsQueues','OpenchannelQueues','CampaignId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','FromAccount','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','ToAccount','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSection','UserProfileSections','Resources','sectionId','exports','path','../config/environment','sequelize','jstz','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','defaultsDeep','sequelizeHistory','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','Condition','../api/condition/condition.model','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model'];(function(_0x4bc428,_0xf56dd9){var _0x3ca37f=function(_0x39db20){while(--_0x39db20){_0x4bc428['push'](_0x4bc428['shift']());}};_0x3ca37f(++_0xf56dd9);}(_0x664e,0xe4));var _0xe664=function(_0x213165,_0x4f2a23){_0x213165=_0x213165-0x0;var _0x2794df=_0x664e[_0x213165];return _0x2794df;};'use strict';var path=require(_0xe664('0x0'));var config=require(_0xe664('0x1'));var Sequelize=require(_0xe664('0x2'));var _=require('lodash');var jstz=require(_0xe664('0x3'));var timezone=jstz['determine']();config[_0xe664('0x2')]=_['defaultsDeep'](config[_0xe664('0x2')],{'database':_0xe664('0x4'),'username':'xcall','password':_0xe664('0x5'),'options':{'host':_0xe664('0x6'),'port':0xcea,'dialect':_0xe664('0x7'),'dialectOptions':{'charset':_0xe664('0x8')},'logging':![],'timezone':timezone[_0xe664('0x9')](),'define':{'charset':_0xe664('0xa'),'collate':_0xe664('0xb')}}});config['sequelizeHistory']=_[_0xe664('0xc')](config[_0xe664('0xd')],{'database':_0xe664('0x4'),'username':'xcall','password':_0xe664('0x5'),'options':{'host':_0xe664('0x6'),'port':0xcea,'dialect':_0xe664('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xe664('0xa'),'collate':_0xe664('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe664('0x2')][_0xe664('0xe')],config['sequelize'][_0xe664('0xf')],config[_0xe664('0x2')][_0xe664('0x10')],config[_0xe664('0x2')][_0xe664('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe664('0xd')][_0xe664('0xe')],config[_0xe664('0xd')]['username'],config[_0xe664('0xd')][_0xe664('0x10')],config[_0xe664('0xd')]['options'])};db[_0xe664('0x12')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x14'));db[_0xe664('0x15')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x16'));db['VoiceContext']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x17'));db[_0xe664('0x18')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x19'));db[_0xe664('0x1a')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x1b'));db[_0xe664('0x1c')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x1d'));db[_0xe664('0x1e')]=db['sequelize']['import'](_0xe664('0x1f'));db[_0xe664('0x20')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/voiceMail/voiceMail.model');db[_0xe664('0x21')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xe664('0x22')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x23'));db[_0xe664('0x24')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x25'));db[_0xe664('0x26')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x27'));db[_0xe664('0x28')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x29'));db['MemberReport']=db[_0xe664('0x2')][_0xe664('0x13')]('../api/memberReport/memberReport.model');db[_0xe664('0x2a')]=db[_0xe664('0x2')]['import'](_0xe664('0x2b'));db[_0xe664('0x2c')]=db[_0xe664('0x2')]['import'](_0xe664('0x2d'));db[_0xe664('0x2e')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x2f'));db['UserVoiceQueue']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x30'));db[_0xe664('0x31')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/userChatQueue/userChatQueue.model');db[_0xe664('0x32')]=db[_0xe664('0x2')]['import'](_0xe664('0x33'));db[_0xe664('0x34')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x35'));db[_0xe664('0x36')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x37'));db['UserOpenchannelQueue']=db['sequelize'][_0xe664('0x13')](_0xe664('0x38'));db[_0xe664('0x39')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x3a'));db['MailServerOut']=db[_0xe664('0x2')]['import'](_0xe664('0x3b'));db['MailAccount']=db[_0xe664('0x2')]['import'](_0xe664('0x3c'));db['MailQueue']=db[_0xe664('0x2')][_0xe664('0x13')]('../api/mailQueue/mailQueue.model');db[_0xe664('0x3d')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x3e'));db[_0xe664('0x3f')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0xe664('0x40')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x41'));db[_0xe664('0x42')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x43'));db[_0xe664('0x44')]=db[_0xe664('0x2')]['import'](_0xe664('0x45'));db[_0xe664('0x46')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/dashboard/dashboard.model');db[_0xe664('0x47')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x48'));db['FaxAccount']=db['sequelize'][_0xe664('0x13')]('../api/faxAccount/faxAccount.model');db[_0xe664('0x49')]=db['sequelize']['import'](_0xe664('0x4a'));db[_0xe664('0x4b')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x4c'));db['FaxMessage']=db[_0xe664('0x2')][_0xe664('0x13')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db[_0xe664('0x2')]['import']('../api/faxQueue/faxQueue.model');db[_0xe664('0x4d')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x4e'));db[_0xe664('0x4f')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x50'));db[_0xe664('0x51')]=db[_0xe664('0x2')]['import'](_0xe664('0x52'));db[_0xe664('0x53')]=db[_0xe664('0x2')]['import'](_0xe664('0x54'));db['SmsMessage']=db[_0xe664('0x2')][_0xe664('0x13')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x55'));db[_0xe664('0x56')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x57'));db['OpenchannelApplication']=db['sequelize']['import'](_0xe664('0x58'));db[_0xe664('0x59')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0xe664('0x2')][_0xe664('0x13')]('../api/openchannelMessage/openchannelMessage.model');db[_0xe664('0x5a')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x5b'));db['ChatWebsite']=db[_0xe664('0x2')]['import']('../api/chatWebsite/chatWebsite.model');db[_0xe664('0x5c')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xe664('0x5d')]=db['sequelize'][_0xe664('0x13')]('../api/chatApplication/chatApplication.model');db[_0xe664('0x5e')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0xe664('0x5f')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x60'));db[_0xe664('0x61')]=db[_0xe664('0x2')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xe664('0x62')]=db['sequelize'][_0xe664('0x13')]('../api/chatQueue/chatQueue.model');db[_0xe664('0x63')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x64'));db[_0xe664('0x65')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x66'));db[_0xe664('0x67')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x68'));db['CmContact']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x69'));db[_0xe664('0x6a')]=db[_0xe664('0x2')]['import']('../api/cmHopper/cmHopper.model');db[_0xe664('0x6b')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x6c'));db[_0xe664('0x6d')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x6e'));db['ReportAgentPreview']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x6f'));db[_0xe664('0x70')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x71'));db['Action']=db[_0xe664('0x2')]['import'](_0xe664('0x72'));db[_0xe664('0x73')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x74'));db[_0xe664('0x75')]=db['sequelize'][_0xe664('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0xe664('0x76')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/disposition/disposition.model');db[_0xe664('0x77')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x78'));db['Interval']=db[_0xe664('0x2')][_0xe664('0x13')]('../api/interval/interval.model');db['Pause']=db['sequelize'][_0xe664('0x13')](_0xe664('0x79'));db['Cdr']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x7a'));db[_0xe664('0x7b')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x7c'));db[_0xe664('0x7d')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x7e'));db[_0xe664('0x7f')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/sound/sound.model');db[_0xe664('0x80')]=db['sequelize']['import'](_0xe664('0x81'));db[_0xe664('0x82')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x83'));db['Trigger']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x84'));db[_0xe664('0x85')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/variable/variable.model');db[_0xe664('0x86')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x87'));db[_0xe664('0x88')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x89'));db['AnalyticCustomReport']=db['sequelize'][_0xe664('0x13')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xe664('0x8a')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x8b'));db[_0xe664('0x8c')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x8d'));db[_0xe664('0x8e')]=db[_0xe664('0x2')]['import']('../api/analyticMetric/analyticMetric.model');db[_0xe664('0x8f')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x90'));db['AnalyticTreeReport']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x91'));db[_0xe664('0x92')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x93'));db['SalesforceConfiguration']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x94'));db[_0xe664('0x95')]=db[_0xe664('0x2')]['import'](_0xe664('0x96'));db[_0xe664('0x97')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x98'));db[_0xe664('0x99')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x9a'));db[_0xe664('0x9b')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0x9c'));db[_0xe664('0x9d')]=db['sequelize'][_0xe664('0x13')](_0xe664('0x9e'));db[_0xe664('0x9f')]=db['sequelize'][_0xe664('0x13')](_0xe664('0xa0'));db[_0xe664('0xa1')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xa2'));db[_0xe664('0xa3')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xa4'));db['ZohoConfiguration']=db[_0xe664('0x2')][_0xe664('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xe664('0xa5')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0xe664('0x2')]['import'](_0xe664('0xa6'));db[_0xe664('0xa7')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xa8'));db[_0xe664('0xa9')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xaa'));db[_0xe664('0xab')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xac'));db['FreshdeskConfiguration']=db['sequelize'][_0xe664('0x13')](_0xe664('0xad'));db['FreshdeskField']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xae'));db[_0xe664('0xaf')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xb0'));db[_0xe664('0xb1')]=db[_0xe664('0x2')]['import'](_0xe664('0xb2'));db['VtigerField']=db[_0xe664('0x2')]['import']('../api/intVtigerField/intVtigerField.model');db[_0xe664('0xb3')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xe664('0xb4')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xb5'));db[_0xe664('0xb6')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xb7'));db[_0xe664('0xb8')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xb9'));db[_0xe664('0xba')]=db[_0xe664('0x2')][_0xe664('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xe664('0xbb')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xbc'));db['Integration']=db[_0xe664('0x2')][_0xe664('0x13')]('../api/integration/integration.model');db[_0xe664('0xbd')]=db['sequelize'][_0xe664('0x13')](_0xe664('0xbe'));db[_0xe664('0xbf')]=db[_0xe664('0x2')]['import'](_0xe664('0xc0'));db['ChatInternalMessage']=db['sequelize'][_0xe664('0x13')](_0xe664('0xc1'));db[_0xe664('0xc2')]=db[_0xe664('0x2')]['import'](_0xe664('0xc3'));db['JscriptyQuestionReport']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xc4'));db['JscriptySessionReport']=db[_0xe664('0x2')][_0xe664('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xe664('0xc5')]=db[_0xe664('0x2')]['import'](_0xe664('0xc6'));db[_0xe664('0xc7')]=db['sequelize'][_0xe664('0x13')](_0xe664('0xc8'));db['SquareDetailsReport']=db['sequelize'][_0xe664('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0xe664('0xc9')]=db['sequelize'][_0xe664('0x13')](_0xe664('0xca'));db['Setting']=db[_0xe664('0x2')]['import'](_0xe664('0xcb'));db[_0xe664('0xcc')]=db['sequelize'][_0xe664('0x13')](_0xe664('0xcd'));db['SquareProject']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xce'));db[_0xe664('0xcf')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xd0'));db[_0xe664('0xd1')]=db['sequelize']['import']('../api/squareMessage/squareMessage.model');db[_0xe664('0xd2')]=db['sequelize'][_0xe664('0x13')](_0xe664('0xd3'));db[_0xe664('0xd4')]=db[_0xe664('0x2')]['import'](_0xe664('0xd5'));db[_0xe664('0xd6')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xd7'));db[_0xe664('0xd8')]=db[_0xe664('0x2')]['import'](_0xe664('0xd9'));db['Attachment']=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xda'));db[_0xe664('0xdb')]=db[_0xe664('0x2')]['import'](_0xe664('0xdc'));db[_0xe664('0xdd')]=db['sequelize'][_0xe664('0x13')](_0xe664('0xde'));db[_0xe664('0xdf')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xe0'));db['FaxTransferReport']=db[_0xe664('0x2')]['import']('../api/faxTransferReport/faxTransferReport.model');db[_0xe664('0xe1')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xe2'));db[_0xe664('0xe3')]=db['sequelize'][_0xe664('0x13')](_0xe664('0xe4'));db[_0xe664('0xe5')]=db[_0xe664('0x2')]['import'](_0xe664('0xe6'));db[_0xe664('0xe7')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xe8'));db[_0xe664('0xe9')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xea'));db['UserProfileSection']=db[_0xe664('0x2')]['import']('../api/userProfileSection/userProfileSection.model');db[_0xe664('0xeb')]=db[_0xe664('0x2')][_0xe664('0x13')](_0xe664('0xec'));db[_0xe664('0x12')][_0xe664('0xed')](db[_0xe664('0x20')],{'as':_0xe664('0x20'),'onDelete':_0xe664('0xee'),'foreignKey':'UserId'});db[_0xe664('0x12')][_0xe664('0xef')](db[_0xe664('0xf0')],{'as':'Recordings','foreignKey':_0xe664('0xf1')});db['User'][_0xe664('0xef')](db['UserVoiceQueueRt'],{'as':_0xe664('0xf2'),'foreignKey':_0xe664('0xf1')});db[_0xe664('0x12')][_0xe664('0xef')](db['VoiceExtension'],{'as':_0xe664('0xf3'),'onDelete':_0xe664('0xee'),'hooks':!![]});db[_0xe664('0x12')][_0xe664('0xef')](db[_0xe664('0xf4')],{'as':_0xe664('0xf5'),'foreignKey':_0xe664('0xf1')});db[_0xe664('0x12')][_0xe664('0xef')](db[_0xe664('0x6d')],{'as':_0xe664('0xf6'),'foreignKey':'UserId'});db[_0xe664('0x12')][_0xe664('0xef')](db[_0xe664('0xf7')],{'as':_0xe664('0xf7'),'foreignKey':_0xe664('0xf1')});db[_0xe664('0x12')][_0xe664('0xef')](db['OpenchannelInteraction'],{'as':_0xe664('0xf8'),'foreignKey':'UserId'});db[_0xe664('0x12')][_0xe664('0xef')](db['ChatInteraction'],{'as':_0xe664('0xf9'),'foreignKey':_0xe664('0xf1')});db[_0xe664('0x12')][_0xe664('0xef')](db[_0xe664('0x53')],{'as':_0xe664('0xfa'),'foreignKey':_0xe664('0xf1')});db[_0xe664('0x12')][_0xe664('0xef')](db[_0xe664('0x4b')],{'as':_0xe664('0xfb'),'foreignKey':_0xe664('0xf1')});db[_0xe664('0x12')][_0xe664('0xef')](db[_0xe664('0x3f')],{'as':_0xe664('0xfc'),'foreignKey':_0xe664('0xf1')});db[_0xe664('0x12')][_0xe664('0xfd')](db[_0xe664('0xe9')],{'as':_0xe664('0xe9'),'foreignKey':_0xe664('0xfe')});db[_0xe664('0x12')][_0xe664('0xff')](db[_0xe664('0x63')],{'as':'Groups','through':'chat_group_has_users'});db[_0xe664('0x12')][_0xe664('0xff')](db[_0xe664('0x100')],{'as':_0xe664('0x101'),'through':_0xe664('0x102')});db[_0xe664('0x12')][_0xe664('0xff')](db[_0xe664('0xe5')],{'as':_0xe664('0x103'),'through':'cm_user_has_lists'});db[_0xe664('0x12')][_0xe664('0xff')](db['Team'],{'through':_0xe664('0x104')});db['User'][_0xe664('0xff')](db[_0xe664('0x3f')],{'as':'MailInteractions','through':_0xe664('0x105')});db['User']['belongsToMany'](db[_0xe664('0x5e')],{'as':_0xe664('0xf9'),'through':'user_has_chat_interactions'});db[_0xe664('0x12')][_0xe664('0xff')](db[_0xe664('0x4b')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0xe664('0x12')][_0xe664('0xff')](db['SmsInteraction'],{'as':_0xe664('0xfa'),'through':_0xe664('0x106')});db[_0xe664('0x12')][_0xe664('0xff')](db['OpenchannelInteraction'],{'as':_0xe664('0xf8'),'through':_0xe664('0x107')});db[_0xe664('0x12')][_0xe664('0xff')](db[_0xe664('0x1c')],{'as':_0xe664('0x108'),'through':_0xe664('0x109'),'required':![]});db[_0xe664('0x12')][_0xe664('0xff')](db[_0xe664('0x10a')],{'as':_0xe664('0x10b'),'through':_0xe664('0x32'),'required':![]});db[_0xe664('0x12')]['belongsToMany'](db[_0xe664('0x62')],{'as':_0xe664('0x10c'),'through':_0xe664('0x31'),'required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0xe664('0x10d')],{'as':_0xe664('0x10e'),'through':_0xe664('0x34'),'required':![]});db['User'][_0xe664('0xff')](db[_0xe664('0x10f')],{'as':'SmsQueues','through':_0xe664('0x36'),'required':![]});db[_0xe664('0x12')][_0xe664('0xff')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0xe664('0x12')][_0xe664('0xff')](db[_0xe664('0xe5')],{'through':_0xe664('0x110')});db['User'][_0xe664('0xff')](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0xe664('0x111'),'required':![]});db[_0xe664('0x12')][_0xe664('0xff')](db[_0xe664('0x112')],{'as':_0xe664('0x113'),'through':_0xe664('0x114')});db[_0xe664('0x12')][_0xe664('0xff')](db['FaxAccount'],{'as':_0xe664('0x115'),'through':_0xe664('0x116')});db['User'][_0xe664('0xff')](db[_0xe664('0x117')],{'as':_0xe664('0x118'),'through':_0xe664('0x119')});db[_0xe664('0x12')]['belongsToMany'](db[_0xe664('0x56')],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0xe664('0x12')][_0xe664('0xff')](db[_0xe664('0x4f')],{'as':_0xe664('0x11a'),'through':_0xe664('0x11b')});db[_0xe664('0x12')]['belongsToMany'](db[_0xe664('0x11c')],{'as':_0xe664('0x11d'),'through':_0xe664('0x11e')});db[_0xe664('0x15')][_0xe664('0xef')](db[_0xe664('0x18')],{'as':_0xe664('0x11f'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x120')});db[_0xe664('0x121')][_0xe664('0xef')](db[_0xe664('0x18')],{'onDelete':_0xe664('0xee')});db[_0xe664('0x18')][_0xe664('0xef')](db[_0xe664('0x18')],{'as':_0xe664('0x122'),'onDelete':_0xe664('0xee')});db[_0xe664('0x1a')][_0xe664('0xff')](db[_0xe664('0x7f')],{'as':_0xe664('0x123'),'through':'moh_has_sounds'});db[_0xe664('0x1c')][_0xe664('0xef')](db[_0xe664('0x2e')],{'as':_0xe664('0x124'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xe664('0xef')](db[_0xe664('0x6a')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xe664('0xef')](db[_0xe664('0xf4')],{'as':_0xe664('0xf5'),'foreignKey':_0xe664('0x125')});db[_0xe664('0x1c')][_0xe664('0xef')](db[_0xe664('0x6d')],{'as':_0xe664('0x126'),'foreignKey':_0xe664('0x125')});db[_0xe664('0x1c')][_0xe664('0xef')](db[_0xe664('0xf7')],{'as':_0xe664('0xf7'),'foreignKey':_0xe664('0x125')});db[_0xe664('0x1c')][_0xe664('0xef')](db[_0xe664('0x6b')],{'as':_0xe664('0x127'),'foreignKey':_0xe664('0x125')});db[_0xe664('0x1c')]['hasMany'](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0xe664('0x125')});db[_0xe664('0x1c')]['belongsTo'](db[_0xe664('0x2a')],{'as':_0xe664('0x2a'),'foreignKey':_0xe664('0x128')});db['VoiceQueue'][_0xe664('0xfd')](db['Trunk'],{'as':_0xe664('0x129'),'foreignKey':_0xe664('0x12a')});db[_0xe664('0x1c')]['belongsTo'](db[_0xe664('0x12b')],{'as':'Interval','foreignKey':_0xe664('0x12c')});db[_0xe664('0x1c')][_0xe664('0xfd')](db[_0xe664('0x12d')],{'as':_0xe664('0x12e'),'foreignKey':_0xe664('0x12f')});db[_0xe664('0x1c')][_0xe664('0xff')](db[_0xe664('0xe5')],{'as':_0xe664('0x103'),'through':_0xe664('0x130')});db[_0xe664('0x1c')][_0xe664('0xff')](db[_0xe664('0x12')],{'as':_0xe664('0x131'),'through':_0xe664('0x109')});db[_0xe664('0x1c')][_0xe664('0xff')](db['Team'],{'as':'Teams','through':_0xe664('0x132')});db[_0xe664('0x1c')][_0xe664('0xff')](db[_0xe664('0xe5')],{'as':_0xe664('0x133'),'through':'voice_queues_has_cm_blacklists'});db['VoiceRecording'][_0xe664('0xfd')](db[_0xe664('0x12')],{'as':_0xe664('0x12'),'foreignKey':'UserId'});db[_0xe664('0x1e')][_0xe664('0xfd')](db[_0xe664('0x12')],{'as':'User','foreignKey':_0xe664('0xf1')});db['VoiceMail'][_0xe664('0xef')](db[_0xe664('0x21')],{'as':_0xe664('0x134'),'onDelete':'cascade','foreignKey':_0xe664('0x135'),'sourceKey':_0xe664('0x136')});db[_0xe664('0x21')][_0xe664('0xfd')](db[_0xe664('0x20')],{'foreignKey':_0xe664('0x135'),'targetKey':_0xe664('0x136')});db[_0xe664('0x22')]['hasMany'](db[_0xe664('0x28')],{'as':_0xe664('0x137'),'foreignKey':_0xe664('0x138'),'constraints':![]});db[_0xe664('0x22')][_0xe664('0xef')](db['VoiceAgentReport'],{'as':_0xe664('0x139'),'foreignKey':_0xe664('0x138'),'constraints':![]});db[_0xe664('0x22')]['belongsTo'](db[_0xe664('0x12')],{'as':_0xe664('0x12'),'foreignKey':_0xe664('0xf1')});db[_0xe664('0x22')][_0xe664('0xfd')](db[_0xe664('0x100')],{'as':_0xe664('0x13a'),'foreignKey':_0xe664('0x13b')});db[_0xe664('0x39')][_0xe664('0xfd')](db[_0xe664('0x117')],{'as':_0xe664('0x117'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0xe664('0xfd')](db[_0xe664('0x117')],{'as':'MailAccount','foreignKey':_0xe664('0x13c')});db[_0xe664('0x117')][_0xe664('0xed')](db[_0xe664('0x39')],{'as':_0xe664('0x13d'),'onDelete':'cascade'});db[_0xe664('0x117')]['hasOne'](db[_0xe664('0x13e')],{'as':_0xe664('0x13f'),'onDelete':_0xe664('0xee')});db['MailAccount']['hasMany'](db['Disposition'],{'as':_0xe664('0x140'),'foreignKey':_0xe664('0x13c')});db[_0xe664('0x117')][_0xe664('0xef')](db[_0xe664('0x75')],{'as':_0xe664('0x141'),'foreignKey':'MailAccountId'});db['MailAccount']['hasMany'](db[_0xe664('0x40')],{'as':_0xe664('0x134'),'foreignKey':_0xe664('0x13c')});db['MailAccount'][_0xe664('0xef')](db[_0xe664('0x3f')],{'as':'Interactions'});db['MailAccount']['hasMany'](db[_0xe664('0x42')],{'as':_0xe664('0x122')});db['MailAccount'][_0xe664('0xfd')](db[_0xe664('0xe5')],{'as':_0xe664('0x142'),'foreignKey':_0xe664('0x143')});db[_0xe664('0x117')][_0xe664('0xfd')](db[_0xe664('0x82')],{'as':_0xe664('0x82'),'foreignKey':_0xe664('0x144')});db[_0xe664('0x117')][_0xe664('0xfd')](db['Pause'],{'as':_0xe664('0x12e'),'foreignKey':_0xe664('0x12f')});db[_0xe664('0x117')][_0xe664('0xff')](db[_0xe664('0x12')],{'as':_0xe664('0x131'),'through':_0xe664('0x119')});db['MailQueue']['belongsToMany'](db[_0xe664('0x12')],{'as':_0xe664('0x131'),'through':'UserMailQueue'});db[_0xe664('0x10a')][_0xe664('0xff')](db[_0xe664('0xd2')],{'through':'team_has_mail_queues','as':_0xe664('0x145')});db[_0xe664('0x3f')]['hasMany'](db[_0xe664('0x40')],{'as':_0xe664('0x134'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x146')});db[_0xe664('0x3f')][_0xe664('0xfd')](db['MailAccount'],{'as':_0xe664('0x147'),'foreignKey':_0xe664('0x13c')});db[_0xe664('0x3f')][_0xe664('0xfd')](db['CmContact'],{'as':_0xe664('0x13a'),'foreignKey':_0xe664('0x13b')});db['MailInteraction'][_0xe664('0xfd')](db[_0xe664('0x12')],{'as':'Owner','foreignKey':_0xe664('0xf1')});db['MailInteraction']['belongsToMany'](db['Tag'],{'through':_0xe664('0x148'),'as':_0xe664('0x149')});db[_0xe664('0x3f')]['belongsToMany'](db[_0xe664('0x80')],{'through':_0xe664('0x148'),'as':'ThroughTags'});db['MailInteraction'][_0xe664('0xff')](db[_0xe664('0x12')],{'as':'Users','through':_0xe664('0x105'),'foreignKey':_0xe664('0x146')});db['MailMessage'][_0xe664('0xef')](db['Attachment'],{'as':_0xe664('0x14a'),'onDelete':_0xe664('0xee')});db['MailMessage'][_0xe664('0xfd')](db['User'],{'as':'User'});db[_0xe664('0x40')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0xe664('0x13a')});db[_0xe664('0x40')][_0xe664('0xfd')](db[_0xe664('0x3f')],{'as':_0xe664('0x14b'),'foreignKey':'MailInteractionId'});db[_0xe664('0x40')][_0xe664('0xfd')](db['MailAccount'],{'as':_0xe664('0x147'),'foreignKey':_0xe664('0x13c')});db[_0xe664('0x42')]['belongsTo'](db[_0xe664('0x12')],{'onDelete':_0xe664('0x14c')});db[_0xe664('0x42')][_0xe664('0xfd')](db['MailQueue'],{'onDelete':'restrict'});db[_0xe664('0x42')][_0xe664('0xfd')](db['MailAccount'],{'onDelete':_0xe664('0x14c')});db[_0xe664('0x42')][_0xe664('0xfd')](db[_0xe664('0x12b')],{'onDelete':_0xe664('0x14c'),'foreignKey':_0xe664('0x12c')});db[_0xe664('0x42')][_0xe664('0xfd')](db[_0xe664('0x80')],{'onDelete':_0xe664('0x14c'),'foreignKey':_0xe664('0x14d')});db[_0xe664('0x44')][_0xe664('0xfd')](db[_0xe664('0x117')],{});db[_0xe664('0x44')][_0xe664('0xfd')](db['CmList'],{'as':_0xe664('0x142'),'foreignKey':_0xe664('0x143')});db['MailQueueReport'][_0xe664('0xfd')](db['CmContact'],{'as':_0xe664('0x13a'),'foreignKey':'ContactId'});db[_0xe664('0x44')][_0xe664('0xfd')](db[_0xe664('0x3f')],{});db[_0xe664('0x44')][_0xe664('0xfd')](db[_0xe664('0x40')],{});db['MailQueueReport']['belongsTo'](db['User'],{});db[_0xe664('0x44')][_0xe664('0xfd')](db[_0xe664('0x10a')],{});db['Dashboard'][_0xe664('0xef')](db[_0xe664('0x47')],{'as':_0xe664('0x14e'),'onDelete':'cascade'});db['FaxAccount'][_0xe664('0xef')](db[_0xe664('0x76')],{'as':_0xe664('0x140'),'foreignKey':_0xe664('0x14f')});db[_0xe664('0x150')][_0xe664('0xef')](db[_0xe664('0x75')],{'as':'Answers','foreignKey':_0xe664('0x14f')});db[_0xe664('0x150')][_0xe664('0xef')](db[_0xe664('0x4b')],{'as':_0xe664('0x151')});db[_0xe664('0x150')][_0xe664('0xef')](db[_0xe664('0x49')],{'as':'Applications'});db['FaxAccount'][_0xe664('0xef')](db[_0xe664('0x18')],{'as':_0xe664('0x152'),'onDelete':_0xe664('0xee')});db[_0xe664('0x150')]['hasMany'](db['FaxMessage'],{'as':_0xe664('0x134')});db[_0xe664('0x150')][_0xe664('0xfd')](db[_0xe664('0x2a')],{'as':'Trunk'});db[_0xe664('0x150')]['belongsTo'](db[_0xe664('0xe5')],{'as':_0xe664('0x142'),'foreignKey':_0xe664('0x143')});db[_0xe664('0x150')][_0xe664('0xfd')](db['Pause'],{'as':_0xe664('0x12e'),'foreignKey':_0xe664('0x12f')});db[_0xe664('0x150')][_0xe664('0xff')](db[_0xe664('0x12')],{'as':_0xe664('0x131'),'through':'user_has_fax_accounts'});db[_0xe664('0x49')]['belongsTo'](db[_0xe664('0x12')],{'onDelete':'restrict'});db['FaxApplication'][_0xe664('0xfd')](db[_0xe664('0x10d')],{'onDelete':'restrict'});db[_0xe664('0x49')][_0xe664('0xfd')](db['FaxAccount'],{'onDelete':_0xe664('0x14c')});db[_0xe664('0x49')][_0xe664('0xfd')](db[_0xe664('0x80')],{'onDelete':_0xe664('0x14c'),'foreignKey':_0xe664('0x14d')});db['FaxInteraction'][_0xe664('0xef')](db[_0xe664('0x153')],{'as':_0xe664('0x134'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x154')});db[_0xe664('0x4b')][_0xe664('0xfd')](db[_0xe664('0x150')],{'as':_0xe664('0x147'),'foreignKey':_0xe664('0x14f')});db[_0xe664('0x4b')]['belongsTo'](db[_0xe664('0x100')],{'as':'Contact','foreignKey':_0xe664('0x13b')});db[_0xe664('0x4b')]['belongsTo'](db[_0xe664('0x12')],{'as':'Owner','foreignKey':_0xe664('0xf1')});db['FaxInteraction'][_0xe664('0xff')](db['Tag'],{'through':_0xe664('0x155'),'as':'Tags'});db[_0xe664('0x4b')]['belongsToMany'](db[_0xe664('0x80')],{'through':_0xe664('0x155'),'as':_0xe664('0x156')});db[_0xe664('0x4b')]['belongsToMany'](db[_0xe664('0x12')],{'as':_0xe664('0x157'),'through':_0xe664('0x158'),'foreignKey':_0xe664('0x154')});db[_0xe664('0x153')]['belongsTo'](db['User'],{'onDelete':'cascade','as':_0xe664('0x12')});db[_0xe664('0x153')][_0xe664('0xfd')](db[_0xe664('0x4b')],{'as':_0xe664('0x14b'),'foreignKey':_0xe664('0x154')});db[_0xe664('0x153')][_0xe664('0xfd')](db[_0xe664('0x100')],{'onDelete':_0xe664('0xee'),'as':_0xe664('0x13a')});db[_0xe664('0x153')][_0xe664('0xfd')](db[_0xe664('0x159')],{'as':_0xe664('0x159'),'foreignKey':'AttachmentId'});db[_0xe664('0x153')][_0xe664('0xfd')](db[_0xe664('0x150')],{'as':_0xe664('0x147'),'foreignKey':_0xe664('0x14f')});db['FaxQueue']['belongsToMany'](db[_0xe664('0x12')],{'as':'Agents','through':_0xe664('0x34')});db[_0xe664('0x10d')]['belongsToMany'](db[_0xe664('0xd2')],{'through':_0xe664('0x15a'),'as':'Teams'});db[_0xe664('0x4d')]['belongsTo'](db[_0xe664('0x150')],{});db[_0xe664('0x4d')]['belongsTo'](db[_0xe664('0xe5')],{'as':_0xe664('0x142'),'foreignKey':_0xe664('0x143')});db[_0xe664('0x4d')][_0xe664('0xfd')](db['CmContact'],{'as':'Contact','foreignKey':_0xe664('0x13b')});db[_0xe664('0x4d')]['belongsTo'](db['FaxInteraction'],{});db[_0xe664('0x4d')][_0xe664('0xfd')](db[_0xe664('0x153')],{});db[_0xe664('0x4d')][_0xe664('0xfd')](db[_0xe664('0x12')],{});db[_0xe664('0x4d')][_0xe664('0xfd')](db[_0xe664('0x10d')],{});db[_0xe664('0x4f')]['hasMany'](db[_0xe664('0x76')],{'as':'Dispositions','foreignKey':_0xe664('0x15b')});db[_0xe664('0x4f')][_0xe664('0xef')](db[_0xe664('0x75')],{'as':_0xe664('0x141'),'foreignKey':_0xe664('0x15b')});db['SmsAccount'][_0xe664('0xef')](db[_0xe664('0x15c')],{'as':_0xe664('0x134'),'foreignKey':_0xe664('0x15b')});db['SmsAccount']['hasMany'](db[_0xe664('0x53')],{'as':_0xe664('0x151')});db[_0xe664('0x4f')]['hasMany'](db[_0xe664('0x51')],{'as':_0xe664('0x122')});db[_0xe664('0x4f')]['belongsTo'](db[_0xe664('0xe5')],{'as':_0xe664('0x142'),'foreignKey':'ListId'});db[_0xe664('0x4f')][_0xe664('0xfd')](db[_0xe664('0x12d')],{'as':_0xe664('0x12e'),'foreignKey':_0xe664('0x12f')});db[_0xe664('0x4f')][_0xe664('0xff')](db['User'],{'as':_0xe664('0x131'),'through':_0xe664('0x11b')});db[_0xe664('0x51')][_0xe664('0xfd')](db[_0xe664('0x12')],{'onDelete':_0xe664('0x14c')});db[_0xe664('0x51')][_0xe664('0xfd')](db[_0xe664('0x10f')],{'onDelete':_0xe664('0x14c')});db[_0xe664('0x51')]['belongsTo'](db[_0xe664('0x4f')],{'onDelete':_0xe664('0x14c')});db[_0xe664('0x51')]['belongsTo'](db[_0xe664('0x12b')],{'onDelete':_0xe664('0x14c'),'foreignKey':_0xe664('0x12c')});db['SmsApplication']['belongsTo'](db[_0xe664('0x80')],{'onDelete':'restrict','foreignKey':_0xe664('0x14d')});db['SmsInteraction'][_0xe664('0xef')](db[_0xe664('0x15c')],{'as':_0xe664('0x134'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x15d')});db[_0xe664('0x53')][_0xe664('0xfd')](db[_0xe664('0x4f')],{'as':_0xe664('0x147'),'foreignKey':_0xe664('0x15b')});db[_0xe664('0x53')][_0xe664('0xfd')](db[_0xe664('0x100')],{'as':_0xe664('0x13a'),'foreignKey':_0xe664('0x13b')});db['SmsInteraction']['belongsTo'](db[_0xe664('0x12')],{'as':_0xe664('0x15e'),'foreignKey':_0xe664('0xf1')});db[_0xe664('0x53')][_0xe664('0xff')](db[_0xe664('0x80')],{'through':'sms_interaction_has_tags','as':_0xe664('0x149')});db[_0xe664('0x53')][_0xe664('0xff')](db[_0xe664('0x80')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0xe664('0x53')]['belongsToMany'](db[_0xe664('0x12')],{'as':_0xe664('0x157'),'through':_0xe664('0x106'),'foreignKey':_0xe664('0x15d')});db[_0xe664('0x15c')][_0xe664('0xfd')](db[_0xe664('0x12')],{'as':_0xe664('0x12')});db[_0xe664('0x15c')][_0xe664('0xfd')](db[_0xe664('0x100')],{'onDelete':_0xe664('0xee'),'as':'Contact'});db['SmsMessage'][_0xe664('0xfd')](db[_0xe664('0x53')],{'onDelete':_0xe664('0xee'),'as':'Interaction','foreignKey':'SmsInteractionId'});db[_0xe664('0x15c')][_0xe664('0xfd')](db[_0xe664('0x4f')],{'as':_0xe664('0x147'),'foreignKey':_0xe664('0x15b')});db['SmsQueue'][_0xe664('0xff')](db[_0xe664('0x12')],{'as':'Agents','through':_0xe664('0x36'),'foreignKey':_0xe664('0x15f')});db[_0xe664('0x10f')]['belongsToMany'](db[_0xe664('0xd2')],{'through':'team_has_sms_queues','as':_0xe664('0x145')});db[_0xe664('0x56')][_0xe664('0xef')](db[_0xe664('0x76')],{'as':'Dispositions','foreignKey':_0xe664('0x160')});db[_0xe664('0x56')][_0xe664('0xef')](db['CannedAnswer'],{'as':_0xe664('0x141'),'foreignKey':_0xe664('0x160')});db[_0xe664('0x56')][_0xe664('0xef')](db[_0xe664('0x59')],{'as':_0xe664('0x151'),'foreignKey':_0xe664('0x160')});db['OpenchannelAccount'][_0xe664('0xef')](db[_0xe664('0x161')],{'as':_0xe664('0x134'),'foreignKey':_0xe664('0x160')});db[_0xe664('0x56')][_0xe664('0xef')](db[_0xe664('0x162')],{'as':'Applications','foreignKey':_0xe664('0x160')});db[_0xe664('0x56')]['belongsTo'](db[_0xe664('0xe5')],{'as':_0xe664('0x142'),'foreignKey':_0xe664('0x143')});db['OpenchannelAccount'][_0xe664('0xfd')](db[_0xe664('0x12d')],{'as':_0xe664('0x12e'),'foreignKey':_0xe664('0x12f')});db[_0xe664('0x56')]['belongsToMany'](db[_0xe664('0x12')],{'as':_0xe664('0x131'),'through':'user_has_openchannel_accounts'});db[_0xe664('0x162')][_0xe664('0xfd')](db[_0xe664('0x12')],{'onDelete':_0xe664('0x14c')});db[_0xe664('0x162')][_0xe664('0xfd')](db[_0xe664('0x5a')],{'onDelete':'restrict','foreignKey':_0xe664('0x163')});db[_0xe664('0x162')]['belongsTo'](db[_0xe664('0x56')],{'onDelete':_0xe664('0x14c'),'foreignKey':_0xe664('0x160')});db[_0xe664('0x162')]['belongsTo'](db[_0xe664('0x12b')],{'onDelete':_0xe664('0x14c'),'foreignKey':_0xe664('0x12c')});db[_0xe664('0x162')][_0xe664('0xfd')](db[_0xe664('0x80')],{'onDelete':_0xe664('0x14c'),'foreignKey':_0xe664('0x14d')});db[_0xe664('0x59')][_0xe664('0xef')](db[_0xe664('0x161')],{'as':'Messages','onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x164')});db[_0xe664('0x59')][_0xe664('0xfd')](db['OpenchannelAccount'],{'as':_0xe664('0x147'),'foreignKey':_0xe664('0x160')});db[_0xe664('0x59')][_0xe664('0xfd')](db[_0xe664('0x100')],{'as':_0xe664('0x13a'),'foreignKey':_0xe664('0x13b')});db[_0xe664('0x59')][_0xe664('0xfd')](db[_0xe664('0x12')],{'as':_0xe664('0x15e'),'foreignKey':_0xe664('0xf1')});db[_0xe664('0x59')]['belongsToMany'](db[_0xe664('0x80')],{'through':_0xe664('0x165'),'as':_0xe664('0x149')});db[_0xe664('0x59')][_0xe664('0xff')](db[_0xe664('0x80')],{'through':'openchannel_interaction_has_tags','as':_0xe664('0x156')});db['OpenchannelInteraction'][_0xe664('0xff')](db[_0xe664('0x12')],{'as':'Users','through':_0xe664('0x107'),'foreignKey':_0xe664('0x164')});db[_0xe664('0x161')][_0xe664('0xfd')](db[_0xe664('0x12')],{'onDelete':'cascade','as':'User'});db['OpenchannelMessage'][_0xe664('0xfd')](db[_0xe664('0x100')],{'onDelete':'cascade','as':_0xe664('0x13a')});db[_0xe664('0x161')][_0xe664('0xfd')](db[_0xe664('0x59')],{'onDelete':'cascade','as':_0xe664('0x14b'),'foreignKey':'OpenchannelInteractionId'});db[_0xe664('0x161')][_0xe664('0xfd')](db['Attachment'],{'as':'Attachment','foreignKey':_0xe664('0x166')});db[_0xe664('0x161')][_0xe664('0xfd')](db[_0xe664('0x56')],{'as':'Account','foreignKey':_0xe664('0x160')});db[_0xe664('0x5a')][_0xe664('0xff')](db[_0xe664('0x12')],{'as':_0xe664('0x131'),'through':_0xe664('0x167'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0xe664('0xff')](db['Team'],{'through':_0xe664('0x168'),'as':'Teams'});db[_0xe664('0x112')][_0xe664('0xef')](db['Disposition'],{'as':_0xe664('0x140'),'foreignKey':_0xe664('0x169')});db[_0xe664('0x112')][_0xe664('0xef')](db[_0xe664('0x75')],{'as':'Answers','foreignKey':_0xe664('0x169')});db[_0xe664('0x112')][_0xe664('0xef')](db[_0xe664('0x65')],{'as':'ProactiveActions'});db[_0xe664('0x112')][_0xe664('0xef')](db[_0xe664('0x5e')],{'as':_0xe664('0x151')});db['ChatWebsite'][_0xe664('0xef')](db['ChatApplication'],{'as':'Applications'});db['ChatWebsite'][_0xe664('0xef')](db[_0xe664('0x5f')],{'as':'Messages'});db[_0xe664('0x112')][_0xe664('0xfd')](db[_0xe664('0xe5')],{'as':_0xe664('0x142'),'foreignKey':'ListId'});db[_0xe664('0x112')]['belongsTo'](db[_0xe664('0x12b')],{'as':_0xe664('0x12b'),'foreignKey':_0xe664('0x12c')});db[_0xe664('0x112')]['belongsTo'](db[_0xe664('0x12d')],{'as':_0xe664('0x12e'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite']['belongsToMany'](db[_0xe664('0x12')],{'as':_0xe664('0x131'),'through':_0xe664('0x114')});db['OpenchannelQueueReport'][_0xe664('0xfd')](db[_0xe664('0x56')],{});db['OpenchannelQueueReport'][_0xe664('0xfd')](db[_0xe664('0xe5')],{'as':_0xe664('0x142'),'foreignKey':_0xe664('0x143')});db[_0xe664('0x5c')][_0xe664('0xfd')](db[_0xe664('0x100')],{'as':_0xe664('0x13a'),'foreignKey':'ContactId'});db[_0xe664('0x5c')]['belongsTo'](db[_0xe664('0x59')],{});db[_0xe664('0x5c')][_0xe664('0xfd')](db['OpenchannelMessage'],{});db[_0xe664('0x5c')]['belongsTo'](db[_0xe664('0x12')],{});db['OpenchannelQueueReport'][_0xe664('0xfd')](db[_0xe664('0x5a')],{});db[_0xe664('0x5d')][_0xe664('0xfd')](db[_0xe664('0x12')],{'as':_0xe664('0x16a'),'foreignKey':_0xe664('0xf1'),'onDelete':_0xe664('0x14c')});db[_0xe664('0x5d')][_0xe664('0xfd')](db['ChatQueue'],{'as':'Queue','foreignKey':_0xe664('0x16b'),'onDelete':_0xe664('0x14c')});db[_0xe664('0x5d')][_0xe664('0xfd')](db['ChatWebsite'],{'as':_0xe664('0x16c'),'foreignKey':_0xe664('0x169'),'onDelete':_0xe664('0x14c')});db[_0xe664('0x5d')][_0xe664('0xfd')](db[_0xe664('0x80')],{'onDelete':_0xe664('0x14c'),'foreignKey':'TagId'});db[_0xe664('0x5e')][_0xe664('0xef')](db[_0xe664('0x5f')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xe664('0x16d')});db['ChatInteraction'][_0xe664('0xfd')](db['ChatWebsite'],{'as':_0xe664('0x147'),'foreignKey':_0xe664('0x169')});db[_0xe664('0x5e')][_0xe664('0xfd')](db['CmContact'],{'as':_0xe664('0x13a'),'foreignKey':'ContactId'});db[_0xe664('0x5e')][_0xe664('0xfd')](db[_0xe664('0x12')],{'as':'Owner','foreignKey':_0xe664('0xf1')});db[_0xe664('0x5e')][_0xe664('0xff')](db[_0xe664('0x80')],{'through':_0xe664('0x16e'),'as':_0xe664('0x149')});db[_0xe664('0x5e')]['belongsToMany'](db[_0xe664('0x80')],{'through':_0xe664('0x16e'),'as':_0xe664('0x156')});db[_0xe664('0x5e')][_0xe664('0xff')](db['User'],{'as':_0xe664('0x157'),'through':'user_has_chat_interactions','foreignKey':_0xe664('0x16d')});db[_0xe664('0x5f')][_0xe664('0xfd')](db[_0xe664('0x12')],{'onDelete':'cascade','as':'User'});db['ChatMessage']['belongsTo'](db[_0xe664('0x100')],{'onDelete':'cascade','as':_0xe664('0x13a'),'foreignKey':_0xe664('0x13b')});db[_0xe664('0x5f')][_0xe664('0xfd')](db['ChatInteraction'],{'onDelete':_0xe664('0xee'),'as':_0xe664('0x14b'),'foreignKey':_0xe664('0x16d')});db[_0xe664('0x5f')][_0xe664('0xfd')](db[_0xe664('0x159')],{'as':_0xe664('0x159'),'foreignKey':_0xe664('0x166')});db[_0xe664('0x5f')][_0xe664('0xfd')](db['ChatWebsite'],{'as':_0xe664('0x147'),'foreignKey':_0xe664('0x169')});db[_0xe664('0x61')][_0xe664('0xfd')](db['CmContact'],{'onDelete':_0xe664('0xee'),'as':_0xe664('0x13a'),'foreignKey':'ContactId'});db[_0xe664('0x61')]['belongsTo'](db[_0xe664('0x112')],{'as':_0xe664('0x147'),'foreignKey':'ChatWebsiteId'});db['ChatQueue']['belongsToMany'](db['User'],{'as':_0xe664('0x131'),'through':_0xe664('0x31'),'hooks':!![]});db[_0xe664('0x62')][_0xe664('0xff')](db[_0xe664('0xd2')],{'through':_0xe664('0x16f'),'as':'Teams'});db[_0xe664('0x63')][_0xe664('0xef')](db[_0xe664('0x170')],{'as':_0xe664('0x134'),'foreignKey':_0xe664('0x171'),'onDelete':_0xe664('0xee')});db[_0xe664('0x63')][_0xe664('0xff')](db[_0xe664('0x12')],{'as':'Members','through':_0xe664('0x172')});db['ChatProactiveAction']['belongsTo'](db[_0xe664('0x112')],{'as':_0xe664('0x16c'),'foreignKey':'ChatWebsiteId'});db[_0xe664('0x67')][_0xe664('0xef')](db[_0xe664('0x100')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0xe664('0x100')][_0xe664('0xef')](db[_0xe664('0x6a')],{'as':_0xe664('0x173'),'foreignKey':_0xe664('0x13b')});db[_0xe664('0x100')][_0xe664('0xef')](db['CmHopperFinal'],{'as':_0xe664('0xf5'),'foreignKey':'ContactId'});db[_0xe664('0x100')][_0xe664('0xef')](db[_0xe664('0x6d')],{'as':_0xe664('0x126'),'foreignKey':_0xe664('0x13b')});db['CmContact'][_0xe664('0xef')](db[_0xe664('0xf7')],{'as':_0xe664('0xf7'),'foreignKey':_0xe664('0x13b')});db['CmContact']['hasMany'](db[_0xe664('0x174')],{'as':_0xe664('0x175'),'foreignKey':_0xe664('0x13b')});db['CmContact']['hasMany'](db[_0xe664('0x59')],{'as':_0xe664('0xf8'),'foreignKey':_0xe664('0x13b'),'onDelete':_0xe664('0x14c')});db[_0xe664('0x100')][_0xe664('0xef')](db[_0xe664('0x5e')],{'as':_0xe664('0xf9'),'foreignKey':'ContactId','onDelete':_0xe664('0x14c')});db[_0xe664('0x100')][_0xe664('0xef')](db[_0xe664('0x53')],{'as':_0xe664('0xfa'),'foreignKey':_0xe664('0x13b'),'onDelete':_0xe664('0x14c')});db[_0xe664('0x100')][_0xe664('0xef')](db[_0xe664('0x4b')],{'as':'FaxInteractions','foreignKey':_0xe664('0x13b'),'onDelete':'restrict'});db[_0xe664('0x100')][_0xe664('0xef')](db[_0xe664('0x3f')],{'as':'MailInteractions','foreignKey':_0xe664('0x13b'),'onDelete':'restrict'});db[_0xe664('0x100')][_0xe664('0xfd')](db[_0xe664('0x67')],{'as':'Company','foreignKey':_0xe664('0x176')});db[_0xe664('0x100')][_0xe664('0xfd')](db[_0xe664('0xe5')],{'as':'List','foreignKey':_0xe664('0x143'),'onDelete':_0xe664('0xee')});db[_0xe664('0x100')][_0xe664('0xff')](db['User'],{'as':'Users','through':'cm_user_has_contacts'});db[_0xe664('0x100')][_0xe664('0xff')](db['Tag'],{'as':'Tags','through':_0xe664('0x177')});db['CmContact']['belongsToMany'](db[_0xe664('0x80')],{'through':_0xe664('0x177'),'as':_0xe664('0x156')});db[_0xe664('0x6a')]['belongsTo'](db[_0xe664('0x100')],{'as':_0xe664('0x13a'),'foreignKey':_0xe664('0x13b'),'onDelete':_0xe664('0xee')});db[_0xe664('0x6a')][_0xe664('0xfd')](db[_0xe664('0xe5')],{'as':_0xe664('0x142'),'foreignKey':_0xe664('0x143'),'onDelete':'cascade'});db[_0xe664('0x6a')][_0xe664('0xfd')](db[_0xe664('0x12')],{'as':_0xe664('0x16a'),'foreignKey':'UserId'});db[_0xe664('0x6a')]['belongsTo'](db[_0xe664('0x1c')],{'as':'Queue','foreignKey':_0xe664('0x125'),'onDelete':_0xe664('0xee')});db[_0xe664('0x6a')]['belongsTo'](db['Campaign'],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0xe664('0xee')});db[_0xe664('0x6a')][_0xe664('0xfd')](db['User'],{'as':_0xe664('0x15e'),'foreignKey':_0xe664('0x178')});db['CmHopperBlack'][_0xe664('0xfd')](db[_0xe664('0x100')],{'as':_0xe664('0x13a'),'foreignKey':_0xe664('0x13b'),'onDelete':_0xe664('0xee')});db[_0xe664('0x6b')][_0xe664('0xfd')](db['CmList'],{'as':_0xe664('0x142'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xe664('0x6b')]['belongsTo'](db[_0xe664('0x1c')],{'as':_0xe664('0x179'),'foreignKey':'VoiceQueueId','onDelete':_0xe664('0xee')});db['CmHopperBlack']['belongsTo'](db['Campaign'],{'as':_0xe664('0xd6'),'foreignKey':'CampaignId','onDelete':'cascade'});db['Automation'][_0xe664('0xef')](db[_0xe664('0x77')],{'as':{'plural':'All','singular':_0xe664('0x17a')},'foreignKey':_0xe664('0x17b'),'onDelete':'cascade','hooks':!![]});db[_0xe664('0x73')][_0xe664('0xef')](db[_0xe664('0x77')],{'as':{'plural':_0xe664('0x17c'),'singular':_0xe664('0x17d')},'foreignKey':_0xe664('0x17e'),'onDelete':_0xe664('0xee'),'hooks':!![]});db[_0xe664('0x73')][_0xe664('0xef')](db[_0xe664('0x17f')],{'as':_0xe664('0x180'),'foreignKey':_0xe664('0x181'),'onDelete':'cascade','hooks':!![]});db[_0xe664('0x12b')]['hasMany'](db[_0xe664('0x12b')],{'as':_0xe664('0x182'),'foreignKey':_0xe664('0x12c'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xe664('0x12b')][_0xe664('0xef')](db[_0xe664('0x18')],{'as':_0xe664('0xf3'),'foreignKey':_0xe664('0x12c'),'onDelete':_0xe664('0x14c')});db[_0xe664('0x12b')][_0xe664('0xef')](db[_0xe664('0x42')],{'as':_0xe664('0x183'),'foreignKey':_0xe664('0x12c')});db['Interval'][_0xe664('0xef')](db[_0xe664('0x5d')],{'as':_0xe664('0x184'),'foreignKey':'IntervalId'});db[_0xe664('0x12b')][_0xe664('0xef')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':'IntervalId'});db['Interval'][_0xe664('0xef')](db['SmsApplication'],{'as':_0xe664('0x185'),'foreignKey':'IntervalId'});db[_0xe664('0x7d')][_0xe664('0xfd')](db[_0xe664('0x117')],{});db[_0xe664('0x7d')][_0xe664('0xfd')](db[_0xe664('0x8a')],{'foreignKey':_0xe664('0x186')});db[_0xe664('0x7d')][_0xe664('0xfd')](db[_0xe664('0x187')],{'foreignKey':_0xe664('0x188')});db[_0xe664('0x7f')][_0xe664('0xff')](db[_0xe664('0x1a')],{'as':_0xe664('0x189'),'through':_0xe664('0x18a'),'onDelete':_0xe664('0x14c')});db[_0xe664('0x80')][_0xe664('0xff')](db['CmContact'],{'through':_0xe664('0x177')});db['Tag'][_0xe664('0xff')](db[_0xe664('0x5e')],{'through':_0xe664('0x16e')});db[_0xe664('0x80')][_0xe664('0xff')](db[_0xe664('0x3f')],{'through':_0xe664('0x148')});db[_0xe664('0x80')][_0xe664('0xff')](db[_0xe664('0x53')],{'through':_0xe664('0x18b')});db[_0xe664('0x80')][_0xe664('0xff')](db[_0xe664('0x4b')],{'through':_0xe664('0x155')});db[_0xe664('0x80')][_0xe664('0xff')](db[_0xe664('0x59')],{'through':_0xe664('0x165')});db[_0xe664('0x18c')][_0xe664('0xef')](db['Condition'],{'as':{'plural':_0xe664('0x18d'),'singular':'AllCondition'},'foreignKey':_0xe664('0x18e'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0xe664('0xef')](db[_0xe664('0x77')],{'as':{'plural':'AnyConditions','singular':_0xe664('0x18f')},'foreignKey':_0xe664('0x190'),'onDelete':_0xe664('0xee'),'hooks':!![]});db['Trigger'][_0xe664('0xef')](db[_0xe664('0x17f')],{'as':_0xe664('0x180'),'foreignKey':_0xe664('0x191'),'onDelete':_0xe664('0xee'),'hooks':!![]});db['AnalyticCustomReport'][_0xe664('0xef')](db[_0xe664('0x8f')],{'as':_0xe664('0x192'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0xe664('0x8a')][_0xe664('0xef')](db['AnalyticFieldReport'],{'as':_0xe664('0x192'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x186')});db[_0xe664('0x8e')][_0xe664('0xef')](db[_0xe664('0x8f')],{'as':'Fields','onDelete':_0xe664('0xee'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0xe664('0xfd')](db[_0xe664('0x8e')],{'foreignKey':_0xe664('0x193')});db[_0xe664('0x92')][_0xe664('0xef')](db[_0xe664('0x194')],{'as':_0xe664('0x195'),'onDelete':_0xe664('0xee'),'foreignKey':'AccountId'});db[_0xe664('0x194')][_0xe664('0xef')](db['SalesforceField'],{'as':'Subjects','onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x196')});db[_0xe664('0x194')]['hasMany'](db['SalesforceField'],{'as':_0xe664('0x197'),'onDelete':_0xe664('0xee'),'foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xe664('0xef')](db[_0xe664('0x95')],{'as':_0xe664('0x192'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x198')});db[_0xe664('0x194')][_0xe664('0xfd')](db[_0xe664('0x92')],{'as':'Account','foreignKey':_0xe664('0x199')});db[_0xe664('0x95')]['hasMany'](db[_0xe664('0x95')],{'as':_0xe664('0x19a'),'foreignKey':_0xe664('0x196')});db['SalesforceField'][_0xe664('0xef')](db['SalesforceField'],{'as':_0xe664('0x19b'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0xe664('0xef')](db['SalesforceField'],{'as':_0xe664('0x19c'),'foreignKey':_0xe664('0x198')});db[_0xe664('0x95')][_0xe664('0xfd')](db[_0xe664('0x85')],{'as':'Variable','foreignKey':_0xe664('0x19d')});db['SugarcrmAccount']['hasMany'](db[_0xe664('0x99')],{'as':'Configurations','onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x199')});db['SugarcrmConfiguration'][_0xe664('0xef')](db[_0xe664('0x9b')],{'as':'Subjects','onDelete':_0xe664('0xee'),'foreignKey':'SubjectId'});db[_0xe664('0x99')][_0xe664('0xef')](db[_0xe664('0x9b')],{'as':_0xe664('0x197'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x19e')});db[_0xe664('0x99')][_0xe664('0xef')](db[_0xe664('0x9b')],{'as':_0xe664('0x192'),'onDelete':'cascade','foreignKey':_0xe664('0x198')});db[_0xe664('0x99')][_0xe664('0xfd')](db[_0xe664('0x97')],{'as':_0xe664('0x147'),'foreignKey':'AccountId'});db[_0xe664('0x9b')][_0xe664('0xef')](db[_0xe664('0x9b')],{'as':_0xe664('0x19a'),'foreignKey':_0xe664('0x196')});db['SugarcrmField'][_0xe664('0xef')](db[_0xe664('0x9b')],{'as':_0xe664('0x19b'),'foreignKey':'DescriptionId'});db[_0xe664('0x9b')]['hasMany'](db['SugarcrmField'],{'as':'Field','foreignKey':_0xe664('0x198')});db[_0xe664('0x9b')][_0xe664('0xfd')](db['Variable'],{'as':'Variable','foreignKey':_0xe664('0x19d')});db[_0xe664('0x9d')][_0xe664('0xef')](db['DeskConfiguration'],{'as':_0xe664('0x195'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x199')});db[_0xe664('0x9f')][_0xe664('0xef')](db['DeskField'],{'as':_0xe664('0x19f'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x196')});db[_0xe664('0x9f')]['hasMany'](db[_0xe664('0xa1')],{'as':_0xe664('0x197'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x19e')});db['DeskConfiguration'][_0xe664('0xef')](db[_0xe664('0xa1')],{'as':_0xe664('0x192'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x198')});db[_0xe664('0x9f')][_0xe664('0xfd')](db[_0xe664('0x9d')],{'as':_0xe664('0x147'),'foreignKey':_0xe664('0x199')});db[_0xe664('0x9f')][_0xe664('0xff')](db['Tag'],{'through':_0xe664('0x1a0')});db[_0xe664('0xa1')][_0xe664('0xef')](db['DeskField'],{'as':_0xe664('0x19a'),'foreignKey':_0xe664('0x196')});db['DeskField']['hasMany'](db[_0xe664('0xa1')],{'as':'Description','foreignKey':_0xe664('0x19e')});db[_0xe664('0xa1')]['hasMany'](db['DeskField'],{'as':_0xe664('0x19c'),'foreignKey':_0xe664('0x198')});db[_0xe664('0xa1')][_0xe664('0xfd')](db['Variable'],{'as':_0xe664('0x85'),'foreignKey':_0xe664('0x19d')});db[_0xe664('0xa3')][_0xe664('0xef')](db[_0xe664('0x1a1')],{'as':'Configurations','onDelete':_0xe664('0xee'),'foreignKey':'AccountId'});db[_0xe664('0x1a1')][_0xe664('0xef')](db['ZohoField'],{'as':_0xe664('0x19f'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x196')});db[_0xe664('0x1a1')][_0xe664('0xef')](db[_0xe664('0xa5')],{'as':_0xe664('0x197'),'onDelete':'cascade','foreignKey':_0xe664('0x19e')});db[_0xe664('0x1a1')][_0xe664('0xef')](db['ZohoField'],{'as':'Fields','onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x198')});db[_0xe664('0x1a1')][_0xe664('0xfd')](db[_0xe664('0xa3')],{'as':_0xe664('0x147'),'foreignKey':_0xe664('0x199')});db[_0xe664('0xa5')][_0xe664('0xef')](db[_0xe664('0xa5')],{'as':'Subject','foreignKey':_0xe664('0x196')});db[_0xe664('0xa5')][_0xe664('0xef')](db[_0xe664('0xa5')],{'as':_0xe664('0x19b'),'foreignKey':_0xe664('0x19e')});db[_0xe664('0xa5')][_0xe664('0xef')](db[_0xe664('0xa5')],{'as':'Field','foreignKey':_0xe664('0x198')});db[_0xe664('0xa5')][_0xe664('0xfd')](db[_0xe664('0x85')],{'as':'Variable','foreignKey':_0xe664('0x19d')});db['ZendeskAccount'][_0xe664('0xef')](db['ZendeskConfiguration'],{'as':_0xe664('0x195'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x199')});db[_0xe664('0xa7')][_0xe664('0xef')](db['ZendeskField'],{'as':_0xe664('0x19f'),'foreignKey':_0xe664('0x196')});db[_0xe664('0xa7')][_0xe664('0xef')](db['ZendeskField'],{'as':_0xe664('0x197'),'foreignKey':'DescriptionId'});db[_0xe664('0xa7')][_0xe664('0xef')](db[_0xe664('0xa9')],{'as':_0xe664('0x192'),'foreignKey':_0xe664('0x198')});db['ZendeskConfiguration'][_0xe664('0xfd')](db[_0xe664('0x1a2')],{'as':_0xe664('0x147'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xe664('0xff')](db[_0xe664('0x80')],{'through':_0xe664('0x1a3')});db[_0xe664('0xa9')][_0xe664('0xef')](db[_0xe664('0xa9')],{'as':'Subject','foreignKey':'SubjectId'});db['ZendeskField'][_0xe664('0xef')](db[_0xe664('0xa9')],{'as':'Description','foreignKey':_0xe664('0x19e')});db[_0xe664('0xa9')][_0xe664('0xef')](db[_0xe664('0xa9')],{'as':_0xe664('0x19c'),'foreignKey':_0xe664('0x198')});db[_0xe664('0xa9')][_0xe664('0xfd')](db[_0xe664('0x85')],{'as':_0xe664('0x85'),'foreignKey':_0xe664('0x19d')});db[_0xe664('0xab')][_0xe664('0xef')](db[_0xe664('0x1a4')],{'as':_0xe664('0x195'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x199')});db[_0xe664('0x1a4')][_0xe664('0xef')](db[_0xe664('0x1a5')],{'as':_0xe664('0x19f'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x196')});db[_0xe664('0x1a4')][_0xe664('0xef')](db[_0xe664('0x1a5')],{'as':_0xe664('0x197'),'onDelete':'cascade','foreignKey':_0xe664('0x19e')});db[_0xe664('0x1a4')][_0xe664('0xef')](db[_0xe664('0x1a5')],{'as':_0xe664('0x192'),'onDelete':'cascade','foreignKey':_0xe664('0x198')});db[_0xe664('0x1a4')][_0xe664('0xfd')](db[_0xe664('0xab')],{'as':'Account','foreignKey':'AccountId'});db[_0xe664('0x1a4')][_0xe664('0xff')](db[_0xe664('0x80')],{'through':_0xe664('0x1a6')});db[_0xe664('0x1a5')][_0xe664('0xef')](db[_0xe664('0x1a5')],{'as':_0xe664('0x19a'),'foreignKey':_0xe664('0x196')});db[_0xe664('0x1a5')][_0xe664('0xef')](db['FreshdeskField'],{'as':_0xe664('0x19b'),'foreignKey':_0xe664('0x19e')});db[_0xe664('0x1a5')][_0xe664('0xef')](db['FreshdeskField'],{'as':'Field','foreignKey':_0xe664('0x198')});db[_0xe664('0x1a5')][_0xe664('0xfd')](db[_0xe664('0x85')],{'as':_0xe664('0x85'),'foreignKey':_0xe664('0x19d')});db[_0xe664('0xaf')]['hasMany'](db[_0xe664('0xb1')],{'as':_0xe664('0x195'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x199')});db[_0xe664('0xb1')][_0xe664('0xef')](db[_0xe664('0x1a7')],{'as':_0xe664('0x19f'),'foreignKey':_0xe664('0x196')});db[_0xe664('0xb1')][_0xe664('0xef')](db['VtigerField'],{'as':_0xe664('0x197'),'foreignKey':_0xe664('0x19e')});db[_0xe664('0xb1')]['hasMany'](db[_0xe664('0x1a7')],{'as':'Fields','foreignKey':_0xe664('0x198')});db[_0xe664('0xb1')]['belongsTo'](db['VtigerAccount'],{'as':'Account','foreignKey':_0xe664('0x199')});db['VtigerConfiguration'][_0xe664('0xff')](db[_0xe664('0x80')],{'through':'int_vtiger_configuration_has_tags'});db[_0xe664('0x1a7')][_0xe664('0xef')](db[_0xe664('0x1a7')],{'as':_0xe664('0x19a'),'foreignKey':_0xe664('0x196')});db[_0xe664('0x1a7')]['hasMany'](db[_0xe664('0x1a7')],{'as':_0xe664('0x19b'),'foreignKey':_0xe664('0x19e')});db[_0xe664('0x1a7')][_0xe664('0xef')](db['VtigerField'],{'as':_0xe664('0x19c'),'foreignKey':_0xe664('0x198')});db[_0xe664('0x1a7')]['belongsTo'](db['Variable'],{'as':_0xe664('0x85'),'foreignKey':_0xe664('0x19d')});db[_0xe664('0xb3')][_0xe664('0xef')](db[_0xe664('0xb4')],{'as':_0xe664('0x195'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x199')});db['ServicenowConfiguration']['hasMany'](db[_0xe664('0xb6')],{'as':_0xe664('0x19f'),'foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0xe664('0xef')](db[_0xe664('0xb6')],{'as':_0xe664('0x197'),'foreignKey':_0xe664('0x19e')});db['ServicenowConfiguration'][_0xe664('0xef')](db[_0xe664('0xb6')],{'as':_0xe664('0x192'),'foreignKey':_0xe664('0x198')});db[_0xe664('0xb4')][_0xe664('0xfd')](db['ServicenowAccount'],{'as':_0xe664('0x147'),'foreignKey':_0xe664('0x199')});db[_0xe664('0xb6')][_0xe664('0xef')](db[_0xe664('0xb6')],{'as':_0xe664('0x19a'),'foreignKey':_0xe664('0x196')});db[_0xe664('0xb6')][_0xe664('0xef')](db[_0xe664('0xb6')],{'as':_0xe664('0x19b'),'foreignKey':'DescriptionId'});db[_0xe664('0xb6')][_0xe664('0xef')](db['ServicenowField'],{'as':_0xe664('0x19c'),'foreignKey':_0xe664('0x198')});db[_0xe664('0xb6')]['belongsTo'](db['Variable'],{'as':_0xe664('0x85'),'foreignKey':'VariableId'});db[_0xe664('0xb8')]['hasMany'](db[_0xe664('0xba')],{'as':'Configurations','onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x199')});db[_0xe664('0xba')][_0xe664('0xef')](db[_0xe664('0xbb')],{'as':_0xe664('0x19f'),'onDelete':'cascade','foreignKey':_0xe664('0x196')});db['Dynamics365Configuration'][_0xe664('0xef')](db[_0xe664('0xbb')],{'as':_0xe664('0x197'),'onDelete':_0xe664('0xee'),'foreignKey':_0xe664('0x19e')});db[_0xe664('0xba')][_0xe664('0xef')](db[_0xe664('0xbb')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xe664('0x198')});db[_0xe664('0xba')][_0xe664('0xfd')](db['Dynamics365Account'],{'as':_0xe664('0x147'),'foreignKey':_0xe664('0x199')});db['Dynamics365Field'][_0xe664('0xef')](db['Dynamics365Field'],{'as':_0xe664('0x19a'),'foreignKey':_0xe664('0x196')});db[_0xe664('0xbb')][_0xe664('0xef')](db[_0xe664('0xbb')],{'as':_0xe664('0x19b'),'foreignKey':_0xe664('0x19e')});db[_0xe664('0xbb')][_0xe664('0xef')](db[_0xe664('0xbb')],{'as':_0xe664('0x19c'),'foreignKey':'FieldId'});db[_0xe664('0xbb')][_0xe664('0xfd')](db[_0xe664('0x85')],{'as':_0xe664('0x85'),'foreignKey':_0xe664('0x19d')});db[_0xe664('0xbf')][_0xe664('0xfd')](db[_0xe664('0x112')],{});db[_0xe664('0xbf')]['belongsTo'](db[_0xe664('0xe5')],{'as':_0xe664('0x142'),'foreignKey':'ListId'});db[_0xe664('0xbf')][_0xe664('0xfd')](db[_0xe664('0x100')],{'as':_0xe664('0x13a'),'foreignKey':_0xe664('0x13b')});db[_0xe664('0xbf')][_0xe664('0xfd')](db[_0xe664('0x5e')],{});db[_0xe664('0xbf')][_0xe664('0xfd')](db[_0xe664('0x5f')],{});db['ChatQueueReport']['belongsTo'](db[_0xe664('0x12')],{});db[_0xe664('0xbf')][_0xe664('0xfd')](db[_0xe664('0x62')],{});db['ChatInternalMessage'][_0xe664('0xfd')](db[_0xe664('0x12')],{'onDelete':_0xe664('0xee'),'foreignKey':'FromId'});db[_0xe664('0x170')][_0xe664('0xfd')](db[_0xe664('0x12')],{'onDelete':_0xe664('0xee'),'foreignKey':'ToId'});db[_0xe664('0x174')][_0xe664('0xef')](db[_0xe664('0x1a8')],{'foreignKey':_0xe664('0x1a9'),'onDelete':'cascade'});db[_0xe664('0x174')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0xe664('0x1a9'),'onDelete':_0xe664('0xee')});db[_0xe664('0xc5')][_0xe664('0xfd')](db[_0xe664('0x4f')],{});db[_0xe664('0xc5')]['belongsTo'](db[_0xe664('0xe5')],{'as':_0xe664('0x142'),'foreignKey':_0xe664('0x143')});db[_0xe664('0xc5')]['belongsTo'](db['CmContact'],{'as':_0xe664('0x13a'),'foreignKey':_0xe664('0x13b')});db[_0xe664('0xc5')][_0xe664('0xfd')](db[_0xe664('0x53')],{});db[_0xe664('0xc5')][_0xe664('0xfd')](db[_0xe664('0x15c')],{});db[_0xe664('0xc5')]['belongsTo'](db[_0xe664('0x12')],{});db[_0xe664('0xc5')][_0xe664('0xfd')](db[_0xe664('0x10f')],{});db[_0xe664('0xc9')]['hasMany'](db[_0xe664('0x174')],{'foreignKey':_0xe664('0x1aa')});db[_0xe664('0xc9')]['hasMany'](db[_0xe664('0x1a8')],{'foreignKey':_0xe664('0x1aa')});db[_0xe664('0xc9')]['hasMany'](db[_0xe664('0xc2')],{'foreignKey':_0xe664('0x1aa')});db[_0xe664('0x11c')][_0xe664('0xff')](db[_0xe664('0x12')],{'as':'Users','through':_0xe664('0x11e')});db[_0xe664('0xd2')][_0xe664('0xff')](db['User'],{'as':_0xe664('0x131'),'through':_0xe664('0x104')});db[_0xe664('0xd2')][_0xe664('0xff')](db[_0xe664('0x1c')],{'through':_0xe664('0x132'),'as':_0xe664('0x108')});db[_0xe664('0xd2')]['belongsToMany'](db[_0xe664('0x10a')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0xe664('0xd2')][_0xe664('0xff')](db[_0xe664('0x62')],{'through':'team_has_chat_queues','as':_0xe664('0x10c')});db[_0xe664('0xd2')][_0xe664('0xff')](db[_0xe664('0x10d')],{'through':_0xe664('0x15a'),'as':_0xe664('0x10e')});db[_0xe664('0xd2')]['belongsToMany'](db[_0xe664('0x10f')],{'through':_0xe664('0x1ab'),'as':_0xe664('0x1ac')});db[_0xe664('0xd2')][_0xe664('0xff')](db['OpenchannelQueue'],{'through':_0xe664('0x168'),'as':_0xe664('0x1ad')});db[_0xe664('0xd6')][_0xe664('0xef')](db[_0xe664('0x6a')],{'as':_0xe664('0x173'),'foreignKey':_0xe664('0x1ae')});db[_0xe664('0xd6')][_0xe664('0xef')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xe664('0x1ae')});db[_0xe664('0xd6')][_0xe664('0xef')](db[_0xe664('0x6d')],{'as':_0xe664('0x126'),'foreignKey':_0xe664('0x1ae')});db[_0xe664('0xd6')][_0xe664('0xef')](db[_0xe664('0x6b')],{'as':'HopperBlacks','foreignKey':_0xe664('0x1ae')});db['Campaign'][_0xe664('0xfd')](db[_0xe664('0x2a')],{'as':'Trunk','foreignKey':_0xe664('0x128')});db[_0xe664('0xd6')][_0xe664('0xfd')](db[_0xe664('0x2a')],{'as':_0xe664('0x129'),'foreignKey':_0xe664('0x12a')});db[_0xe664('0xd6')]['belongsTo'](db['Interval'],{'as':_0xe664('0x12b'),'foreignKey':'IntervalId'});db[_0xe664('0xd6')][_0xe664('0xfd')](db['SquareProject'],{'as':_0xe664('0x11c'),'foreignKey':_0xe664('0x1af')});db[_0xe664('0xd6')]['belongsToMany'](db[_0xe664('0xe5')],{'as':_0xe664('0x103'),'through':_0xe664('0x1b0')});db[_0xe664('0xd6')][_0xe664('0xff')](db['CmList'],{'as':_0xe664('0x133'),'through':_0xe664('0x1b1')});db[_0xe664('0xdd')][_0xe664('0xfd')](db[_0xe664('0x40')],{});db[_0xe664('0xdd')][_0xe664('0xfd')](db[_0xe664('0x3f')],{});db[_0xe664('0xdd')][_0xe664('0xfd')](db['MailAccount'],{'foreignKey':_0xe664('0x1b2'),'as':'FromAccount'});db[_0xe664('0xdd')][_0xe664('0xfd')](db[_0xe664('0x12')],{'foreignKey':_0xe664('0x1b3'),'as':_0xe664('0x1b4')});db[_0xe664('0xdd')][_0xe664('0xfd')](db[_0xe664('0x12')],{'foreignKey':_0xe664('0x1b5'),'as':_0xe664('0x1b6')});db['MailTransferReport'][_0xe664('0xfd')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0xe664('0x1b7')});db[_0xe664('0xdd')]['belongsTo'](db[_0xe664('0x117')],{'foreignKey':_0xe664('0x1b8'),'as':'ToAccount'});db[_0xe664('0xdf')]['belongsTo'](db[_0xe664('0x5f')],{});db[_0xe664('0xdf')][_0xe664('0xfd')](db[_0xe664('0x5e')],{});db[_0xe664('0xdf')][_0xe664('0xfd')](db[_0xe664('0x112')],{'foreignKey':'FromChatWebsiteId','as':_0xe664('0x1b9')});db[_0xe664('0xdf')][_0xe664('0xfd')](db[_0xe664('0x12')],{'foreignKey':'FromUserId','as':_0xe664('0x1b4')});db['ChatTransferReport'][_0xe664('0xfd')](db['User'],{'foreignKey':_0xe664('0x1b5'),'as':_0xe664('0x1b6')});db[_0xe664('0xdf')][_0xe664('0xfd')](db[_0xe664('0x62')],{'foreignKey':'ToChatQueueId','as':_0xe664('0x1b7')});db[_0xe664('0xdf')][_0xe664('0xfd')](db[_0xe664('0x112')],{'foreignKey':'ToChatWebsiteId','as':'ToAccount'});db[_0xe664('0x1ba')][_0xe664('0xfd')](db[_0xe664('0x153')],{});db[_0xe664('0x1ba')]['belongsTo'](db[_0xe664('0x4b')],{});db[_0xe664('0x1ba')][_0xe664('0xfd')](db[_0xe664('0x150')],{'foreignKey':_0xe664('0x1bb'),'as':_0xe664('0x1b9')});db[_0xe664('0x1ba')][_0xe664('0xfd')](db[_0xe664('0x12')],{'foreignKey':_0xe664('0x1b3'),'as':'FromAgent'});db['FaxTransferReport'][_0xe664('0xfd')](db[_0xe664('0x12')],{'foreignKey':_0xe664('0x1b5'),'as':'ToAgent'});db['FaxTransferReport'][_0xe664('0xfd')](db[_0xe664('0x10d')],{'foreignKey':_0xe664('0x1bc'),'as':_0xe664('0x1b7')});db[_0xe664('0x1ba')][_0xe664('0xfd')](db['FaxAccount'],{'foreignKey':_0xe664('0x1bd'),'as':'ToAccount'});db[_0xe664('0xe1')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xe664('0xe1')][_0xe664('0xfd')](db[_0xe664('0x59')],{});db[_0xe664('0xe1')][_0xe664('0xfd')](db[_0xe664('0x56')],{'foreignKey':_0xe664('0x1be'),'as':_0xe664('0x1b9')});db[_0xe664('0xe1')]['belongsTo'](db[_0xe664('0x12')],{'foreignKey':_0xe664('0x1b3'),'as':_0xe664('0x1b4')});db[_0xe664('0xe1')]['belongsTo'](db['User'],{'foreignKey':_0xe664('0x1b5'),'as':_0xe664('0x1b6')});db['OpenchannelTransferReport'][_0xe664('0xfd')](db[_0xe664('0x5a')],{'foreignKey':'ToOpenchannelQueueId','as':_0xe664('0x1b7')});db[_0xe664('0xe1')][_0xe664('0xfd')](db[_0xe664('0x56')],{'foreignKey':_0xe664('0x1bf'),'as':_0xe664('0x1c0')});db[_0xe664('0xe3')][_0xe664('0xfd')](db[_0xe664('0x15c')],{});db[_0xe664('0xe3')][_0xe664('0xfd')](db[_0xe664('0x53')],{});db[_0xe664('0xe3')][_0xe664('0xfd')](db[_0xe664('0x4f')],{'foreignKey':_0xe664('0x1c1'),'as':_0xe664('0x1b9')});db[_0xe664('0xe3')]['belongsTo'](db[_0xe664('0x12')],{'foreignKey':_0xe664('0x1b3'),'as':_0xe664('0x1b4')});db[_0xe664('0xe3')][_0xe664('0xfd')](db[_0xe664('0x12')],{'foreignKey':_0xe664('0x1b5'),'as':_0xe664('0x1b6')});db[_0xe664('0xe3')][_0xe664('0xfd')](db[_0xe664('0x10f')],{'foreignKey':_0xe664('0x1c2'),'as':_0xe664('0x1b7')});db['SmsTransferReport'][_0xe664('0xfd')](db['SmsAccount'],{'foreignKey':_0xe664('0x1c3'),'as':_0xe664('0x1c0')});db[_0xe664('0xe5')][_0xe664('0xef')](db[_0xe664('0x76')],{'as':_0xe664('0x140'),'foreignKey':_0xe664('0x143')});db[_0xe664('0xe5')]['hasMany'](db[_0xe664('0x70')],{'as':_0xe664('0x1c4'),'foreignKey':_0xe664('0x143')});db[_0xe664('0xe5')][_0xe664('0xef')](db[_0xe664('0x100')],{'as':_0xe664('0x101'),'onDelete':'cascade','foreignKey':_0xe664('0x143')});db['CmList']['hasMany'](db[_0xe664('0xf4')],{'as':_0xe664('0xf5'),'foreignKey':_0xe664('0x143')});db[_0xe664('0xe5')][_0xe664('0xef')](db[_0xe664('0x6d')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0xe664('0xe5')][_0xe664('0xef')](db[_0xe664('0xf7')],{'as':_0xe664('0xf7'),'foreignKey':_0xe664('0x143')});db['CmList'][_0xe664('0xff')](db[_0xe664('0x1c')],{'as':_0xe664('0x1c5'),'through':_0xe664('0x130')});db[_0xe664('0xe5')][_0xe664('0xff')](db['User'],{'as':_0xe664('0x131'),'through':'cm_user_has_lists'});db['VoicePrefix']['hasMany'](db['VoiceExtension'],{'as':_0xe664('0xf3'),'onDelete':_0xe664('0x14c')});db[_0xe664('0xe7')][_0xe664('0xff')](db[_0xe664('0x12')],{'as':_0xe664('0x131'),'through':_0xe664('0x111')});db[_0xe664('0xe9')][_0xe664('0xef')](db['User'],{'as':_0xe664('0x157'),'foreignKey':'userProfileId'});db['UserProfile'][_0xe664('0xef')](db[_0xe664('0x1c6')],{'as':_0xe664('0x1c7'),'foreignKey':_0xe664('0xfe'),'onDelete':_0xe664('0xee')});db[_0xe664('0x1c6')][_0xe664('0xef')](db['UserProfileResource'],{'as':_0xe664('0x1c8'),'foreignKey':_0xe664('0x1c9'),'onDelete':_0xe664('0xee')});module[_0xe664('0x1ca')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x904f=['Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Integration','Network','../api/network/network.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','hasMany','Recordings','UserId','Extensions','cascade','HopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteractions','MailInteractions','belongsTo','userProfileId','chat_group_has_users','belongsToMany','Contacts','Lists','cm_user_has_lists','user_has_mail_interactions','SmsInteraction','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueue','VoiceQueues','MailQueues','FaxQueue','SmsQueue','SmsQueues','UserOpenchannelQueue','VoicePrefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','CmHopperBlack','JscriptySessions','TrunkId','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Team','Teams','team_has_voice_queues','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','MailServerOut','hasOne','Smtp','Answers','Interactions','List','Template','TemplateId','Agents','MailInteractionId','Account','ContactId','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','restrict','IntervalId','TagId','ListId','DashboardItem','Items','Dispositions','FaxAccountId','Exntensions','FaxMessage','user_has_fax_accounts','user_has_fax_interactions','FaxInteractionId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueue','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','ChatWebsiteId','ChatMessage','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessage','team_has_chat_queues','ChatGroupId','CompanyId','Company','cm_user_has_contacts','cm_contact_has_tags','Agent','CampaignId','OwnerId','Queue','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Action','Actions','AutomationId','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','fax_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','TriggerAnyId','TriggerId','AnalyticCustomReport','Fields','MetricId','SalesforceAccount','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','SugarcrmField','Description','VariableId','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','int_vtiger_configuration_has_tags','Dynamics365Configuration','ChatQueueReport','JscriptyAnswerReport','SessionId','ProjectId','team_has_mail_queues','ChatQueues','FaxQueues','OpenchannelQueues','HopperBlacks','TrunkBackup','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','ToUserId','ToQueue','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','CustomFields','Queues','VoicePrefix','user_has_voice_prefixes','UserProfileSection','sectionId','exports','path','../config/environment','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','mysql','database','password','options','username','User','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsMessage','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model'];(function(_0xd0716a,_0x1f7fad){var _0x4e6ec1=function(_0x382c71){while(--_0x382c71){_0xd0716a['push'](_0xd0716a['shift']());}};_0x4e6ec1(++_0x1f7fad);}(_0x904f,0x105));var _0xf904=function(_0xe46433,_0x6c80c3){_0xe46433=_0xe46433-0x0;var _0x38d215=_0x904f[_0xe46433];return _0x38d215;};'use strict';var path=require(_0xf904('0x0'));var config=require(_0xf904('0x1'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xf904('0x2'));var timezone=jstz[_0xf904('0x3')]();config[_0xf904('0x4')]=_[_0xf904('0x5')](config[_0xf904('0x4')],{'database':_0xf904('0x6'),'username':_0xf904('0x7'),'password':_0xf904('0x8'),'options':{'host':_0xf904('0x9'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xf904('0xa')},'logging':![],'timezone':timezone[_0xf904('0xb')](),'define':{'charset':_0xf904('0xc'),'collate':_0xf904('0xd')}}});config[_0xf904('0xe')]=_['defaultsDeep'](config[_0xf904('0xe')],{'database':_0xf904('0x6'),'username':_0xf904('0x7'),'password':_0xf904('0x8'),'options':{'host':_0xf904('0x9'),'port':0xcea,'dialect':_0xf904('0xf'),'dialectOptions':{'charset':_0xf904('0xa')},'logging':![],'timezone':timezone[_0xf904('0xb')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf904('0x4')][_0xf904('0x10')],config[_0xf904('0x4')]['username'],config['sequelize'][_0xf904('0x11')],config[_0xf904('0x4')][_0xf904('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf904('0xe')][_0xf904('0x10')],config[_0xf904('0xe')][_0xf904('0x13')],config[_0xf904('0xe')][_0xf904('0x11')],config['sequelizeHistory'][_0xf904('0x12')])};db[_0xf904('0x14')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/user/user.model');db['VoiceChanSpy']=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x16'));db[_0xf904('0x17')]=db[_0xf904('0x4')]['import'](_0xf904('0x18'));db[_0xf904('0x19')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x1a'));db['VoiceMusicOnHold']=db[_0xf904('0x4')][_0xf904('0x15')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db['sequelize'][_0xf904('0x15')](_0xf904('0x1b'));db[_0xf904('0x1c')]=db['sequelize'][_0xf904('0x15')]('../api/voiceRecording/voiceRecording.model');db[_0xf904('0x1d')]=db['sequelize']['import'](_0xf904('0x1e'));db[_0xf904('0x1f')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x20'));db['VoiceMailMessage']=db['sequelize'][_0xf904('0x15')](_0xf904('0x21'));db[_0xf904('0x22')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db['sequelize'][_0xf904('0x15')]('../api/voiceDialReport/voiceDialReport.model');db[_0xf904('0x23')]=db[_0xf904('0x4')]['import'](_0xf904('0x24'));db[_0xf904('0x25')]=db[_0xf904('0x4')]['import'](_0xf904('0x26'));db[_0xf904('0x27')]=db[_0xf904('0x4')]['import']('../api/memberReport/memberReport.model');db[_0xf904('0x28')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x29'));db[_0xf904('0x2a')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x2b'));db[_0xf904('0x2c')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x2d'));db[_0xf904('0x2e')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x2f'));db[_0xf904('0x30')]=db[_0xf904('0x4')]['import'](_0xf904('0x31'));db[_0xf904('0x32')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x33'));db[_0xf904('0x34')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/userFaxQueue/userFaxQueue.model');db[_0xf904('0x35')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0xf904('0x4')][_0xf904('0x15')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xf904('0x36')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x37'));db['MailServerOut']=db[_0xf904('0x4')][_0xf904('0x15')]('../api/mailServerOut/mailServerOut.model');db[_0xf904('0x38')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x39'));db[_0xf904('0x3a')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/mailQueue/mailQueue.model');db[_0xf904('0x3b')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x3c'));db[_0xf904('0x3d')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/mailInteraction/mailInteraction.model');db[_0xf904('0x3e')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x3f'));db[_0xf904('0x40')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x41'));db[_0xf904('0x42')]=db[_0xf904('0x4')]['import'](_0xf904('0x43'));db[_0xf904('0x44')]=db[_0xf904('0x4')]['import'](_0xf904('0x45'));db['DashboardItem']=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x46'));db[_0xf904('0x47')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/faxAccount/faxAccount.model');db[_0xf904('0x48')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x49'));db[_0xf904('0x4a')]=db[_0xf904('0x4')]['import'](_0xf904('0x4b'));db['FaxMessage']=db[_0xf904('0x4')][_0xf904('0x15')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db['sequelize'][_0xf904('0x15')](_0xf904('0x4c'));db['FaxQueueReport']=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x4d'));db[_0xf904('0x4e')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x4f'));db['SmsApplication']=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x50'));db['SmsInteraction']=db[_0xf904('0x4')][_0xf904('0x15')]('../api/smsInteraction/smsInteraction.model');db[_0xf904('0x51')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db['sequelize'][_0xf904('0x15')]('../api/smsQueue/smsQueue.model');db[_0xf904('0x52')]=db[_0xf904('0x4')]['import'](_0xf904('0x53'));db[_0xf904('0x54')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x55'));db[_0xf904('0x56')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x57'));db[_0xf904('0x58')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x59'));db['OpenchannelQueue']=db['sequelize']['import'](_0xf904('0x5a'));db[_0xf904('0x5b')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x5c'));db[_0xf904('0x5d')]=db[_0xf904('0x4')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xf904('0x5e')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/chatApplication/chatApplication.model');db[_0xf904('0x5f')]=db['sequelize']['import'](_0xf904('0x60'));db['ChatMessage']=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x61'));db['ChatOfflineMessage']=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x62'));db[_0xf904('0x63')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x64'));db[_0xf904('0x65')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x66'));db[_0xf904('0x67')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x68'));db[_0xf904('0x69')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x6a'));db[_0xf904('0x6b')]=db['sequelize']['import'](_0xf904('0x6c'));db[_0xf904('0x6d')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x6e'));db['CmHopperBlack']=db[_0xf904('0x4')]['import'](_0xf904('0x6f'));db[_0xf904('0x70')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xf904('0x71')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x72'));db[_0xf904('0x73')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x74'));db[_0xf904('0x75')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x76'));db['Action']=db[_0xf904('0x4')][_0xf904('0x15')]('../api/action/action.model');db[_0xf904('0x77')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x78'));db[_0xf904('0x79')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x7a'));db[_0xf904('0x7b')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x7c'));db[_0xf904('0x7d')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x7e'));db[_0xf904('0x7f')]=db['sequelize']['import'](_0xf904('0x80'));db[_0xf904('0x81')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x82'));db[_0xf904('0x83')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/cdr/cdr.model');db[_0xf904('0x84')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xf904('0x85')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/schedule/schedule.model');db[_0xf904('0x86')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x87'));db[_0xf904('0x88')]=db['sequelize']['import'](_0xf904('0x89'));db['Template']=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x8a'));db[_0xf904('0x8b')]=db[_0xf904('0x4')]['import']('../api/trigger/trigger.model');db[_0xf904('0x8c')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x8d'));db['Integration']=db['sequelize']['import'](_0xf904('0x8e'));db[_0xf904('0x8f')]=db[_0xf904('0x4')]['import'](_0xf904('0x90'));db['AnalyticCustomReport']=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x91'));db[_0xf904('0x92')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x93'));db[_0xf904('0x94')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x95'));db[_0xf904('0x96')]=db['sequelize']['import'](_0xf904('0x97'));db[_0xf904('0x98')]=db[_0xf904('0x4')]['import'](_0xf904('0x99'));db[_0xf904('0x9a')]=db['sequelize'][_0xf904('0x15')]('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0x9b'));db[_0xf904('0x9c')]=db[_0xf904('0x4')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xf904('0x9d')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0xf904('0x9e')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x9f'));db[_0xf904('0xa0')]=db['sequelize'][_0xf904('0x15')](_0xf904('0xa1'));db['SugarcrmField']=db[_0xf904('0x4')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0xf904('0xa2')]=db['sequelize'][_0xf904('0x15')](_0xf904('0xa3'));db[_0xf904('0xa4')]=db['sequelize'][_0xf904('0x15')](_0xf904('0xa5'));db[_0xf904('0xa6')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/intDeskField/intDeskField.model');db[_0xf904('0xa7')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xa8'));db[_0xf904('0xa9')]=db['sequelize']['import'](_0xf904('0xaa'));db[_0xf904('0xab')]=db[_0xf904('0x4')]['import'](_0xf904('0xac'));db[_0xf904('0xad')]=db[_0xf904('0x4')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0xf904('0xae')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xaf'));db[_0xf904('0xb0')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xb1'));db[_0xf904('0xb2')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xb3'));db[_0xf904('0xb4')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xb5'));db[_0xf904('0xb6')]=db[_0xf904('0x4')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0xf904('0xb7')]=db['sequelize'][_0xf904('0x15')](_0xf904('0xb8'));db[_0xf904('0xb9')]=db['sequelize'][_0xf904('0x15')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xf904('0xba')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xbb'));db[_0xf904('0xbc')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xbd'));db[_0xf904('0xbe')]=db['sequelize']['import']('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xf904('0xbf')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/intServicenowField/intServicenowField.model');db[_0xf904('0xc0')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xc1'));db['Dynamics365Configuration']=db[_0xf904('0x4')]['import'](_0xf904('0xc2'));db[_0xf904('0xc3')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xc4'));db[_0xf904('0xc5')]=db['sequelize'][_0xf904('0x15')](_0xf904('0x8e'));db[_0xf904('0xc6')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xc7'));db['ChatQueueReport']=db[_0xf904('0x4')][_0xf904('0x15')]('../api/chatQueueReport/chatQueueReport.model');db[_0xf904('0xc8')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xc9'));db['JscriptyAnswerReport']=db[_0xf904('0x4')]['import'](_0xf904('0xca'));db[_0xf904('0xcb')]=db['sequelize'][_0xf904('0x15')](_0xf904('0xcc'));db[_0xf904('0xcd')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xce'));db[_0xf904('0xcf')]=db['sequelize']['import'](_0xf904('0xd0'));db[_0xf904('0xd1')]=db['sequelize'][_0xf904('0x15')](_0xf904('0xd2'));db[_0xf904('0xd3')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xd4'));db[_0xf904('0xd5')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xd6'));db['Setting']=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xd7'));db[_0xf904('0xd8')]=db['sequelize'][_0xf904('0x15')](_0xf904('0xd9'));db[_0xf904('0xda')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xdb'));db['SquareRecording']=db['sequelize'][_0xf904('0x15')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0xf904('0x4')][_0xf904('0x15')]('../api/squareMessage/squareMessage.model');db['Team']=db['sequelize'][_0xf904('0x15')]('../api/team/team.model');db['License']=db['sequelize'][_0xf904('0x15')](_0xf904('0xdc'));db[_0xf904('0xdd')]=db['sequelize']['import'](_0xf904('0xde'));db[_0xf904('0xdf')]=db['sequelize'][_0xf904('0x15')](_0xf904('0xe0'));db[_0xf904('0xe1')]=db[_0xf904('0x4')]['import']('../api/attachment/attachment.model');db[_0xf904('0xe2')]=db['sequelize'][_0xf904('0x15')](_0xf904('0xe3'));db[_0xf904('0xe4')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xe5'));db[_0xf904('0xe6')]=db[_0xf904('0x4')][_0xf904('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0xf904('0xe7')]=db[_0xf904('0x4')]['import'](_0xf904('0xe8'));db[_0xf904('0xe9')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xea'));db[_0xf904('0xeb')]=db['sequelize']['import'](_0xf904('0xec'));db[_0xf904('0xed')]=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xee'));db['VoicePrefix']=db['sequelize']['import'](_0xf904('0xef'));db[_0xf904('0xf0')]=db['sequelize'][_0xf904('0x15')](_0xf904('0xf1'));db['UserProfileSection']=db[_0xf904('0x4')][_0xf904('0x15')](_0xf904('0xf2'));db[_0xf904('0xf3')]=db['sequelize'][_0xf904('0x15')]('../api/userProfileResource/userProfileResource.model');db[_0xf904('0x14')]['hasOne'](db[_0xf904('0x1f')],{'as':_0xf904('0x1f'),'onDelete':'cascade','foreignKey':'UserId'});db['User'][_0xf904('0xf4')](db[_0xf904('0x1c')],{'as':_0xf904('0xf5'),'foreignKey':'UserId'});db[_0xf904('0x14')][_0xf904('0xf4')](db[_0xf904('0x2c')],{'as':'VoiceQueuesRt','foreignKey':_0xf904('0xf6')});db['User'][_0xf904('0xf4')](db[_0xf904('0x19')],{'as':_0xf904('0xf7'),'onDelete':_0xf904('0xf8'),'hooks':!![]});db['User'][_0xf904('0xf4')](db[_0xf904('0x70')],{'as':'HopperFinals','foreignKey':_0xf904('0xf6')});db[_0xf904('0x14')][_0xf904('0xf4')](db['CmHopperHistory'],{'as':_0xf904('0xf9'),'foreignKey':_0xf904('0xf6')});db[_0xf904('0x14')][_0xf904('0xf4')](db['ReportAgentPreview'],{'as':_0xf904('0x73'),'foreignKey':_0xf904('0xf6')});db[_0xf904('0x14')][_0xf904('0xf4')](db['OpenchannelInteraction'],{'as':_0xf904('0xfa'),'foreignKey':'UserId'});db[_0xf904('0x14')][_0xf904('0xf4')](db['ChatInteraction'],{'as':_0xf904('0xfb'),'foreignKey':_0xf904('0xf6')});db[_0xf904('0x14')]['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xf904('0xf6')});db[_0xf904('0x14')][_0xf904('0xf4')](db[_0xf904('0x4a')],{'as':_0xf904('0xfc'),'foreignKey':_0xf904('0xf6')});db[_0xf904('0x14')][_0xf904('0xf4')](db['MailInteraction'],{'as':_0xf904('0xfd'),'foreignKey':_0xf904('0xf6')});db[_0xf904('0x14')][_0xf904('0xfe')](db[_0xf904('0xf0')],{'as':_0xf904('0xf0'),'foreignKey':_0xf904('0xff')});db[_0xf904('0x14')]['belongsToMany'](db[_0xf904('0x65')],{'as':'Groups','through':_0xf904('0x100')});db[_0xf904('0x14')][_0xf904('0x101')](db[_0xf904('0x6b')],{'as':_0xf904('0x102'),'through':'cm_user_has_contacts'});db[_0xf904('0x14')]['belongsToMany'](db[_0xf904('0xed')],{'as':_0xf904('0x103'),'through':_0xf904('0x104')});db[_0xf904('0x14')]['belongsToMany'](db['Team'],{'through':'user_has_teams'});db['User'][_0xf904('0x101')](db[_0xf904('0x3d')],{'as':_0xf904('0xfd'),'through':_0xf904('0x105')});db['User'][_0xf904('0x101')](db[_0xf904('0x5f')],{'as':_0xf904('0xfb'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db['FaxInteraction'],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0xf904('0x14')][_0xf904('0x101')](db[_0xf904('0x106')],{'as':_0xf904('0x107'),'through':_0xf904('0x108')});db[_0xf904('0x14')][_0xf904('0x101')](db[_0xf904('0x56')],{'as':_0xf904('0xfa'),'through':_0xf904('0x109')});db[_0xf904('0x14')][_0xf904('0x101')](db[_0xf904('0x10a')],{'as':_0xf904('0x10b'),'through':'UserVoiceQueue','required':![]});db['User'][_0xf904('0x101')](db['MailQueue'],{'as':_0xf904('0x10c'),'through':_0xf904('0x32'),'required':![]});db[_0xf904('0x14')][_0xf904('0x101')](db[_0xf904('0x63')],{'as':'ChatQueues','through':_0xf904('0x30'),'required':![],'hooks':!![]});db[_0xf904('0x14')]['belongsToMany'](db[_0xf904('0x10d')],{'as':'FaxQueues','through':_0xf904('0x34'),'required':![]});db['User']['belongsToMany'](db[_0xf904('0x10e')],{'as':_0xf904('0x10f'),'through':'UserSmsQueue','required':![]});db[_0xf904('0x14')][_0xf904('0x101')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0xf904('0x110'),'required':![]});db[_0xf904('0x14')][_0xf904('0x101')](db['CmList'],{'through':_0xf904('0x104')});db[_0xf904('0x14')][_0xf904('0x101')](db['VoicePrefix'],{'as':_0xf904('0x111'),'through':'user_has_voice_prefixes','required':![]});db['User'][_0xf904('0x101')](db['ChatWebsite'],{'as':_0xf904('0x112'),'through':_0xf904('0x113')});db[_0xf904('0x14')]['belongsToMany'](db[_0xf904('0x47')],{'as':_0xf904('0x114'),'through':'user_has_fax_accounts'});db[_0xf904('0x14')][_0xf904('0x101')](db[_0xf904('0x38')],{'as':_0xf904('0x115'),'through':_0xf904('0x116')});db[_0xf904('0x14')][_0xf904('0x101')](db[_0xf904('0x52')],{'as':_0xf904('0x117'),'through':_0xf904('0x118')});db[_0xf904('0x14')][_0xf904('0x101')](db[_0xf904('0x4e')],{'as':_0xf904('0x119'),'through':_0xf904('0x11a')});db[_0xf904('0x14')][_0xf904('0x101')](db['SquareProject'],{'as':_0xf904('0x11b'),'through':_0xf904('0x11c')});db[_0xf904('0x11d')][_0xf904('0xf4')](db[_0xf904('0x19')],{'as':_0xf904('0x11e'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x11f')});db['VoiceContext'][_0xf904('0xf4')](db[_0xf904('0x19')],{'onDelete':_0xf904('0xf8')});db[_0xf904('0x19')][_0xf904('0xf4')](db[_0xf904('0x19')],{'as':_0xf904('0x120'),'onDelete':_0xf904('0xf8')});db[_0xf904('0x121')][_0xf904('0x101')](db['Sound'],{'as':_0xf904('0x122'),'through':'moh_has_sounds'});db[_0xf904('0x10a')][_0xf904('0xf4')](db[_0xf904('0x2c')],{'as':_0xf904('0x123'),'foreignKey':_0xf904('0x124')});db[_0xf904('0x10a')][_0xf904('0xf4')](db[_0xf904('0x6d')],{'as':_0xf904('0x125'),'foreignKey':_0xf904('0x124')});db[_0xf904('0x10a')][_0xf904('0xf4')](db[_0xf904('0x70')],{'as':_0xf904('0x126'),'foreignKey':_0xf904('0x124')});db[_0xf904('0x10a')]['hasMany'](db['CmHopperHistory'],{'as':_0xf904('0x127'),'foreignKey':_0xf904('0x124')});db[_0xf904('0x10a')][_0xf904('0xf4')](db[_0xf904('0x73')],{'as':_0xf904('0x73'),'foreignKey':'VoiceQueueId'});db[_0xf904('0x10a')][_0xf904('0xf4')](db[_0xf904('0x128')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0xf904('0x10a')][_0xf904('0xf4')](db[_0xf904('0xcd')],{'as':_0xf904('0x129'),'foreignKey':_0xf904('0x124')});db[_0xf904('0x10a')][_0xf904('0xfe')](db[_0xf904('0x28')],{'as':_0xf904('0x28'),'foreignKey':_0xf904('0x12a')});db[_0xf904('0x10a')]['belongsTo'](db[_0xf904('0x28')],{'as':'TrunkBackup','foreignKey':_0xf904('0x12b')});db['VoiceQueue'][_0xf904('0xfe')](db[_0xf904('0x7f')],{'as':'Interval','foreignKey':'IntervalId'});db[_0xf904('0x10a')][_0xf904('0xfe')](db['Pause'],{'as':_0xf904('0x12c'),'foreignKey':_0xf904('0x12d')});db['VoiceQueue']['belongsToMany'](db[_0xf904('0xed')],{'as':_0xf904('0x103'),'through':_0xf904('0x12e')});db[_0xf904('0x10a')]['belongsToMany'](db[_0xf904('0x14')],{'as':'Agents','through':'UserVoiceQueue'});db['VoiceQueue'][_0xf904('0x101')](db[_0xf904('0x12f')],{'as':_0xf904('0x130'),'through':_0xf904('0x131')});db[_0xf904('0x10a')][_0xf904('0x101')](db[_0xf904('0xed')],{'as':'BlackLists','through':_0xf904('0x132')});db[_0xf904('0x1c')][_0xf904('0xfe')](db[_0xf904('0x14')],{'as':_0xf904('0x14'),'foreignKey':_0xf904('0xf6')});db[_0xf904('0x1d')]['belongsTo'](db['User'],{'as':_0xf904('0x14'),'foreignKey':'UserId'});db['VoiceMail'][_0xf904('0xf4')](db[_0xf904('0x133')],{'as':_0xf904('0x134'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x135'),'sourceKey':'mailbox'});db[_0xf904('0x133')][_0xf904('0xfe')](db[_0xf904('0x1f')],{'foreignKey':_0xf904('0x135'),'targetKey':'mailbox'});db[_0xf904('0x22')][_0xf904('0xf4')](db[_0xf904('0x25')],{'as':_0xf904('0x136'),'foreignKey':_0xf904('0x137'),'constraints':![]});db[_0xf904('0x22')][_0xf904('0xf4')](db['VoiceAgentReport'],{'as':_0xf904('0x138'),'foreignKey':'uniqueid','constraints':![]});db[_0xf904('0x22')][_0xf904('0xfe')](db[_0xf904('0x14')],{'as':_0xf904('0x14'),'foreignKey':_0xf904('0xf6')});db[_0xf904('0x22')][_0xf904('0xfe')](db[_0xf904('0x6b')],{'as':_0xf904('0x139'),'foreignKey':'ContactId'});db[_0xf904('0x36')][_0xf904('0xfe')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xf904('0x13a')});db[_0xf904('0x13b')][_0xf904('0xfe')](db['MailAccount'],{'as':_0xf904('0x38'),'foreignKey':_0xf904('0x13a')});db[_0xf904('0x38')]['hasOne'](db[_0xf904('0x36')],{'as':'Imap','onDelete':_0xf904('0xf8')});db[_0xf904('0x38')][_0xf904('0x13c')](db[_0xf904('0x13b')],{'as':_0xf904('0x13d'),'onDelete':_0xf904('0xf8')});db[_0xf904('0x38')][_0xf904('0xf4')](db['Disposition'],{'as':'Dispositions','foreignKey':'MailAccountId'});db[_0xf904('0x38')]['hasMany'](db['CannedAnswer'],{'as':_0xf904('0x13e'),'foreignKey':'MailAccountId'});db[_0xf904('0x38')][_0xf904('0xf4')](db['MailMessage'],{'as':_0xf904('0x134'),'foreignKey':_0xf904('0x13a')});db['MailAccount']['hasMany'](db[_0xf904('0x3d')],{'as':_0xf904('0x13f')});db['MailAccount'][_0xf904('0xf4')](db['MailApplication'],{'as':_0xf904('0x120')});db[_0xf904('0x38')][_0xf904('0xfe')](db[_0xf904('0xed')],{'as':_0xf904('0x140'),'foreignKey':'ListId'});db[_0xf904('0x38')]['belongsTo'](db[_0xf904('0x141')],{'as':_0xf904('0x141'),'foreignKey':_0xf904('0x142')});db[_0xf904('0x38')][_0xf904('0xfe')](db[_0xf904('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0xf904('0x12d')});db[_0xf904('0x38')][_0xf904('0x101')](db[_0xf904('0x14')],{'as':_0xf904('0x143'),'through':_0xf904('0x116')});db[_0xf904('0x3a')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xf904('0x32')});db[_0xf904('0x3a')][_0xf904('0x101')](db[_0xf904('0x12f')],{'through':'team_has_mail_queues','as':'Teams'});db[_0xf904('0x3d')][_0xf904('0xf4')](db[_0xf904('0x3e')],{'as':_0xf904('0x134'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x144')});db[_0xf904('0x3d')][_0xf904('0xfe')](db[_0xf904('0x38')],{'as':_0xf904('0x145'),'foreignKey':_0xf904('0x13a')});db['MailInteraction']['belongsTo'](db[_0xf904('0x6b')],{'as':'Contact','foreignKey':_0xf904('0x146')});db[_0xf904('0x3d')][_0xf904('0xfe')](db[_0xf904('0x14')],{'as':_0xf904('0x147'),'foreignKey':_0xf904('0xf6')});db[_0xf904('0x3d')][_0xf904('0x101')](db[_0xf904('0x88')],{'through':'mail_interaction_has_tags','as':_0xf904('0x148')});db[_0xf904('0x3d')][_0xf904('0x101')](db['Tag'],{'through':_0xf904('0x149'),'as':_0xf904('0x14a')});db['MailInteraction'][_0xf904('0x101')](db[_0xf904('0x14')],{'as':_0xf904('0x14b'),'through':_0xf904('0x105'),'foreignKey':'MailInteractionId'});db[_0xf904('0x3e')][_0xf904('0xf4')](db[_0xf904('0xe1')],{'as':_0xf904('0x14c'),'onDelete':_0xf904('0xf8')});db[_0xf904('0x3e')][_0xf904('0xfe')](db[_0xf904('0x14')],{'as':'User'});db[_0xf904('0x3e')][_0xf904('0xfe')](db[_0xf904('0x6b')],{'onDelete':_0xf904('0xf8'),'as':'Contact'});db[_0xf904('0x3e')][_0xf904('0xfe')](db[_0xf904('0x3d')],{'as':_0xf904('0x14d'),'foreignKey':_0xf904('0x144')});db[_0xf904('0x3e')][_0xf904('0xfe')](db[_0xf904('0x38')],{'as':_0xf904('0x145'),'foreignKey':_0xf904('0x13a')});db[_0xf904('0x40')]['belongsTo'](db[_0xf904('0x14')],{'onDelete':_0xf904('0x14e')});db[_0xf904('0x40')][_0xf904('0xfe')](db[_0xf904('0x3a')],{'onDelete':_0xf904('0x14e')});db[_0xf904('0x40')][_0xf904('0xfe')](db['MailAccount'],{'onDelete':_0xf904('0x14e')});db[_0xf904('0x40')][_0xf904('0xfe')](db['Interval'],{'onDelete':_0xf904('0x14e'),'foreignKey':_0xf904('0x14f')});db[_0xf904('0x40')][_0xf904('0xfe')](db[_0xf904('0x88')],{'onDelete':_0xf904('0x14e'),'foreignKey':_0xf904('0x150')});db[_0xf904('0x42')][_0xf904('0xfe')](db['MailAccount'],{});db['MailQueueReport'][_0xf904('0xfe')](db[_0xf904('0xed')],{'as':'List','foreignKey':_0xf904('0x151')});db[_0xf904('0x42')][_0xf904('0xfe')](db['CmContact'],{'as':_0xf904('0x139'),'foreignKey':_0xf904('0x146')});db['MailQueueReport'][_0xf904('0xfe')](db[_0xf904('0x3d')],{});db[_0xf904('0x42')][_0xf904('0xfe')](db[_0xf904('0x3e')],{});db[_0xf904('0x42')][_0xf904('0xfe')](db['User'],{});db[_0xf904('0x42')]['belongsTo'](db['MailQueue'],{});db[_0xf904('0x44')][_0xf904('0xf4')](db[_0xf904('0x152')],{'as':_0xf904('0x153'),'onDelete':_0xf904('0xf8')});db['FaxAccount'][_0xf904('0xf4')](db[_0xf904('0x7b')],{'as':_0xf904('0x154'),'foreignKey':_0xf904('0x155')});db[_0xf904('0x47')]['hasMany'](db[_0xf904('0x79')],{'as':_0xf904('0x13e'),'foreignKey':_0xf904('0x155')});db[_0xf904('0x47')][_0xf904('0xf4')](db[_0xf904('0x4a')],{'as':_0xf904('0x13f')});db['FaxAccount'][_0xf904('0xf4')](db['FaxApplication'],{'as':_0xf904('0x120')});db['FaxAccount'][_0xf904('0xf4')](db[_0xf904('0x19')],{'as':_0xf904('0x156'),'onDelete':_0xf904('0xf8')});db[_0xf904('0x47')][_0xf904('0xf4')](db[_0xf904('0x157')],{'as':_0xf904('0x134')});db[_0xf904('0x47')][_0xf904('0xfe')](db[_0xf904('0x28')],{'as':_0xf904('0x28')});db['FaxAccount'][_0xf904('0xfe')](db[_0xf904('0xed')],{'as':'List','foreignKey':'ListId'});db[_0xf904('0x47')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xf904('0x12d')});db[_0xf904('0x47')]['belongsToMany'](db[_0xf904('0x14')],{'as':'Agents','through':_0xf904('0x158')});db[_0xf904('0x48')][_0xf904('0xfe')](db[_0xf904('0x14')],{'onDelete':_0xf904('0x14e')});db[_0xf904('0x48')][_0xf904('0xfe')](db[_0xf904('0x10d')],{'onDelete':_0xf904('0x14e')});db[_0xf904('0x48')][_0xf904('0xfe')](db[_0xf904('0x47')],{'onDelete':_0xf904('0x14e')});db[_0xf904('0x48')][_0xf904('0xfe')](db[_0xf904('0x88')],{'onDelete':'restrict','foreignKey':_0xf904('0x150')});db[_0xf904('0x4a')][_0xf904('0xf4')](db[_0xf904('0x157')],{'as':_0xf904('0x134'),'onDelete':_0xf904('0xf8'),'foreignKey':'FaxInteractionId'});db[_0xf904('0x4a')][_0xf904('0xfe')](db[_0xf904('0x47')],{'as':_0xf904('0x145'),'foreignKey':_0xf904('0x155')});db[_0xf904('0x4a')][_0xf904('0xfe')](db[_0xf904('0x6b')],{'as':_0xf904('0x139'),'foreignKey':_0xf904('0x146')});db[_0xf904('0x4a')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xf904('0xf6')});db[_0xf904('0x4a')][_0xf904('0x101')](db[_0xf904('0x88')],{'through':'fax_interaction_has_tags','as':_0xf904('0x148')});db[_0xf904('0x4a')]['belongsToMany'](db[_0xf904('0x88')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0xf904('0x4a')]['belongsToMany'](db[_0xf904('0x14')],{'as':'Users','through':_0xf904('0x159'),'foreignKey':_0xf904('0x15a')});db[_0xf904('0x157')]['belongsTo'](db['User'],{'onDelete':_0xf904('0xf8'),'as':_0xf904('0x14')});db[_0xf904('0x157')][_0xf904('0xfe')](db[_0xf904('0x4a')],{'as':'Interaction','foreignKey':_0xf904('0x15a')});db[_0xf904('0x157')][_0xf904('0xfe')](db[_0xf904('0x6b')],{'onDelete':_0xf904('0xf8'),'as':_0xf904('0x139')});db['FaxMessage'][_0xf904('0xfe')](db[_0xf904('0xe1')],{'as':_0xf904('0xe1'),'foreignKey':'AttachmentId'});db[_0xf904('0x157')][_0xf904('0xfe')](db[_0xf904('0x47')],{'as':'Account','foreignKey':_0xf904('0x155')});db[_0xf904('0x10d')]['belongsToMany'](db[_0xf904('0x14')],{'as':_0xf904('0x143'),'through':_0xf904('0x34')});db[_0xf904('0x10d')][_0xf904('0x101')](db['Team'],{'through':_0xf904('0x15b'),'as':_0xf904('0x130')});db['FaxQueueReport'][_0xf904('0xfe')](db[_0xf904('0x47')],{});db[_0xf904('0x15c')]['belongsTo'](db[_0xf904('0xed')],{'as':_0xf904('0x140'),'foreignKey':_0xf904('0x151')});db[_0xf904('0x15c')][_0xf904('0xfe')](db[_0xf904('0x6b')],{'as':_0xf904('0x139'),'foreignKey':_0xf904('0x146')});db['FaxQueueReport'][_0xf904('0xfe')](db[_0xf904('0x4a')],{});db[_0xf904('0x15c')][_0xf904('0xfe')](db[_0xf904('0x157')],{});db[_0xf904('0x15c')][_0xf904('0xfe')](db[_0xf904('0x14')],{});db[_0xf904('0x15c')][_0xf904('0xfe')](db[_0xf904('0x10d')],{});db['SmsAccount'][_0xf904('0xf4')](db[_0xf904('0x7b')],{'as':'Dispositions','foreignKey':_0xf904('0x15d')});db[_0xf904('0x4e')][_0xf904('0xf4')](db[_0xf904('0x79')],{'as':_0xf904('0x13e'),'foreignKey':_0xf904('0x15d')});db[_0xf904('0x4e')]['hasMany'](db[_0xf904('0x51')],{'as':_0xf904('0x134'),'foreignKey':_0xf904('0x15d')});db[_0xf904('0x4e')]['hasMany'](db['SmsInteraction'],{'as':'Interactions'});db[_0xf904('0x4e')][_0xf904('0xf4')](db['SmsApplication'],{'as':_0xf904('0x120')});db['SmsAccount']['belongsTo'](db[_0xf904('0xed')],{'as':'List','foreignKey':_0xf904('0x151')});db['SmsAccount']['belongsTo'](db[_0xf904('0x81')],{'as':_0xf904('0x12c'),'foreignKey':_0xf904('0x12d')});db['SmsAccount']['belongsToMany'](db[_0xf904('0x14')],{'as':_0xf904('0x143'),'through':_0xf904('0x11a')});db[_0xf904('0x15e')][_0xf904('0xfe')](db[_0xf904('0x14')],{'onDelete':_0xf904('0x14e')});db[_0xf904('0x15e')]['belongsTo'](db[_0xf904('0x10e')],{'onDelete':_0xf904('0x14e')});db[_0xf904('0x15e')][_0xf904('0xfe')](db['SmsAccount'],{'onDelete':_0xf904('0x14e')});db[_0xf904('0x15e')][_0xf904('0xfe')](db[_0xf904('0x7f')],{'onDelete':_0xf904('0x14e'),'foreignKey':_0xf904('0x14f')});db['SmsApplication'][_0xf904('0xfe')](db[_0xf904('0x88')],{'onDelete':'restrict','foreignKey':'TagId'});db['SmsInteraction']['hasMany'](db[_0xf904('0x51')],{'as':_0xf904('0x134'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x15f')});db['SmsInteraction'][_0xf904('0xfe')](db[_0xf904('0x4e')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0xf904('0x106')][_0xf904('0xfe')](db[_0xf904('0x6b')],{'as':_0xf904('0x139'),'foreignKey':_0xf904('0x146')});db['SmsInteraction'][_0xf904('0xfe')](db[_0xf904('0x14')],{'as':_0xf904('0x147'),'foreignKey':_0xf904('0xf6')});db[_0xf904('0x106')]['belongsToMany'](db[_0xf904('0x88')],{'through':'sms_interaction_has_tags','as':_0xf904('0x148')});db[_0xf904('0x106')][_0xf904('0x101')](db['Tag'],{'through':_0xf904('0x160'),'as':'ThroughTags'});db['SmsInteraction'][_0xf904('0x101')](db['User'],{'as':_0xf904('0x14b'),'through':'user_has_sms_interactions','foreignKey':_0xf904('0x15f')});db[_0xf904('0x51')]['belongsTo'](db[_0xf904('0x14')],{'as':_0xf904('0x14')});db[_0xf904('0x51')]['belongsTo'](db['CmContact'],{'onDelete':_0xf904('0xf8'),'as':'Contact'});db[_0xf904('0x51')][_0xf904('0xfe')](db[_0xf904('0x106')],{'onDelete':_0xf904('0xf8'),'as':_0xf904('0x14d'),'foreignKey':_0xf904('0x15f')});db[_0xf904('0x51')][_0xf904('0xfe')](db[_0xf904('0x4e')],{'as':_0xf904('0x145'),'foreignKey':_0xf904('0x15d')});db[_0xf904('0x10e')][_0xf904('0x101')](db[_0xf904('0x14')],{'as':'Agents','through':_0xf904('0x35'),'foreignKey':'SmsQueueId'});db[_0xf904('0x10e')][_0xf904('0x101')](db[_0xf904('0x12f')],{'through':_0xf904('0x161'),'as':_0xf904('0x130')});db[_0xf904('0x52')][_0xf904('0xf4')](db[_0xf904('0x7b')],{'as':_0xf904('0x154'),'foreignKey':_0xf904('0x162')});db[_0xf904('0x52')][_0xf904('0xf4')](db['CannedAnswer'],{'as':_0xf904('0x13e'),'foreignKey':_0xf904('0x162')});db[_0xf904('0x52')]['hasMany'](db[_0xf904('0x56')],{'as':_0xf904('0x13f'),'foreignKey':_0xf904('0x162')});db[_0xf904('0x52')]['hasMany'](db[_0xf904('0x58')],{'as':_0xf904('0x134'),'foreignKey':_0xf904('0x162')});db[_0xf904('0x52')][_0xf904('0xf4')](db[_0xf904('0x54')],{'as':'Applications','foreignKey':_0xf904('0x162')});db[_0xf904('0x52')][_0xf904('0xfe')](db['CmList'],{'as':_0xf904('0x140'),'foreignKey':_0xf904('0x151')});db['OpenchannelAccount'][_0xf904('0xfe')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xf904('0x12d')});db[_0xf904('0x52')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xf904('0x118')});db['OpenchannelApplication'][_0xf904('0xfe')](db['User'],{'onDelete':_0xf904('0x14e')});db[_0xf904('0x54')][_0xf904('0xfe')](db[_0xf904('0x163')],{'onDelete':_0xf904('0x14e'),'foreignKey':'OpenchannelQueueId'});db[_0xf904('0x54')][_0xf904('0xfe')](db['OpenchannelAccount'],{'onDelete':_0xf904('0x14e'),'foreignKey':_0xf904('0x162')});db['OpenchannelApplication']['belongsTo'](db[_0xf904('0x7f')],{'onDelete':_0xf904('0x14e'),'foreignKey':_0xf904('0x14f')});db[_0xf904('0x54')][_0xf904('0xfe')](db[_0xf904('0x88')],{'onDelete':_0xf904('0x14e'),'foreignKey':_0xf904('0x150')});db[_0xf904('0x56')][_0xf904('0xf4')](db[_0xf904('0x58')],{'as':_0xf904('0x134'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x164')});db[_0xf904('0x56')][_0xf904('0xfe')](db[_0xf904('0x52')],{'as':_0xf904('0x145'),'foreignKey':_0xf904('0x162')});db[_0xf904('0x56')][_0xf904('0xfe')](db[_0xf904('0x6b')],{'as':_0xf904('0x139'),'foreignKey':_0xf904('0x146')});db['OpenchannelInteraction'][_0xf904('0xfe')](db[_0xf904('0x14')],{'as':_0xf904('0x147'),'foreignKey':'UserId'});db['OpenchannelInteraction']['belongsToMany'](db[_0xf904('0x88')],{'through':_0xf904('0x165'),'as':_0xf904('0x148')});db['OpenchannelInteraction'][_0xf904('0x101')](db[_0xf904('0x88')],{'through':'openchannel_interaction_has_tags','as':_0xf904('0x14a')});db[_0xf904('0x56')][_0xf904('0x101')](db[_0xf904('0x14')],{'as':_0xf904('0x14b'),'through':_0xf904('0x109'),'foreignKey':_0xf904('0x164')});db['OpenchannelMessage']['belongsTo'](db[_0xf904('0x14')],{'onDelete':_0xf904('0xf8'),'as':_0xf904('0x14')});db[_0xf904('0x58')][_0xf904('0xfe')](db[_0xf904('0x6b')],{'onDelete':_0xf904('0xf8'),'as':'Contact'});db[_0xf904('0x58')]['belongsTo'](db[_0xf904('0x56')],{'onDelete':_0xf904('0xf8'),'as':_0xf904('0x14d'),'foreignKey':_0xf904('0x164')});db['OpenchannelMessage'][_0xf904('0xfe')](db[_0xf904('0xe1')],{'as':_0xf904('0xe1'),'foreignKey':_0xf904('0x166')});db[_0xf904('0x58')]['belongsTo'](db[_0xf904('0x52')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue']['belongsToMany'](db['User'],{'as':_0xf904('0x143'),'through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db[_0xf904('0x163')][_0xf904('0x101')](db[_0xf904('0x12f')],{'through':'team_has_openchannel_queues','as':_0xf904('0x130')});db['ChatWebsite'][_0xf904('0xf4')](db[_0xf904('0x7b')],{'as':_0xf904('0x154'),'foreignKey':_0xf904('0x167')});db[_0xf904('0x5b')]['hasMany'](db[_0xf904('0x79')],{'as':_0xf904('0x13e'),'foreignKey':_0xf904('0x167')});db[_0xf904('0x5b')][_0xf904('0xf4')](db[_0xf904('0x67')],{'as':'ProactiveActions'});db[_0xf904('0x5b')][_0xf904('0xf4')](db[_0xf904('0x5f')],{'as':_0xf904('0x13f')});db[_0xf904('0x5b')]['hasMany'](db[_0xf904('0x5e')],{'as':'Applications'});db[_0xf904('0x5b')][_0xf904('0xf4')](db[_0xf904('0x168')],{'as':_0xf904('0x134')});db[_0xf904('0x5b')][_0xf904('0xfe')](db[_0xf904('0xed')],{'as':'List','foreignKey':_0xf904('0x151')});db['ChatWebsite']['belongsTo'](db[_0xf904('0x7f')],{'as':_0xf904('0x7f'),'foreignKey':_0xf904('0x14f')});db[_0xf904('0x5b')][_0xf904('0xfe')](db[_0xf904('0x81')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0xf904('0x101')](db['User'],{'as':_0xf904('0x143'),'through':_0xf904('0x113')});db['OpenchannelQueueReport']['belongsTo'](db[_0xf904('0x52')],{});db[_0xf904('0x5d')][_0xf904('0xfe')](db[_0xf904('0xed')],{'as':_0xf904('0x140'),'foreignKey':'ListId'});db[_0xf904('0x5d')][_0xf904('0xfe')](db[_0xf904('0x6b')],{'as':_0xf904('0x139'),'foreignKey':_0xf904('0x146')});db[_0xf904('0x5d')]['belongsTo'](db[_0xf904('0x56')],{});db[_0xf904('0x5d')][_0xf904('0xfe')](db[_0xf904('0x58')],{});db[_0xf904('0x5d')][_0xf904('0xfe')](db[_0xf904('0x14')],{});db[_0xf904('0x5d')][_0xf904('0xfe')](db[_0xf904('0x163')],{});db[_0xf904('0x5e')][_0xf904('0xfe')](db[_0xf904('0x14')],{'as':'Agent','foreignKey':_0xf904('0xf6'),'onDelete':_0xf904('0x14e')});db[_0xf904('0x5e')]['belongsTo'](db[_0xf904('0x63')],{'as':'Queue','foreignKey':_0xf904('0x169'),'onDelete':_0xf904('0x14e')});db['ChatApplication'][_0xf904('0xfe')](db[_0xf904('0x5b')],{'as':_0xf904('0x16a'),'foreignKey':'ChatWebsiteId','onDelete':_0xf904('0x14e')});db['ChatApplication'][_0xf904('0xfe')](db[_0xf904('0x88')],{'onDelete':'restrict','foreignKey':_0xf904('0x150')});db[_0xf904('0x5f')][_0xf904('0xf4')](db['ChatMessage'],{'as':_0xf904('0x134'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x16b')});db[_0xf904('0x5f')][_0xf904('0xfe')](db[_0xf904('0x5b')],{'as':'Account','foreignKey':_0xf904('0x167')});db['ChatInteraction'][_0xf904('0xfe')](db[_0xf904('0x6b')],{'as':'Contact','foreignKey':_0xf904('0x146')});db[_0xf904('0x5f')][_0xf904('0xfe')](db[_0xf904('0x14')],{'as':_0xf904('0x147'),'foreignKey':_0xf904('0xf6')});db[_0xf904('0x5f')]['belongsToMany'](db[_0xf904('0x88')],{'through':_0xf904('0x16c'),'as':_0xf904('0x148')});db['ChatInteraction']['belongsToMany'](db['Tag'],{'through':_0xf904('0x16c'),'as':_0xf904('0x14a')});db['ChatInteraction'][_0xf904('0x101')](db[_0xf904('0x14')],{'as':'Users','through':_0xf904('0x16d'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xf904('0xfe')](db[_0xf904('0x14')],{'onDelete':_0xf904('0xf8'),'as':_0xf904('0x14')});db[_0xf904('0x168')][_0xf904('0xfe')](db[_0xf904('0x6b')],{'onDelete':_0xf904('0xf8'),'as':'Contact','foreignKey':_0xf904('0x146')});db['ChatMessage']['belongsTo'](db[_0xf904('0x5f')],{'onDelete':_0xf904('0xf8'),'as':_0xf904('0x14d'),'foreignKey':_0xf904('0x16b')});db['ChatMessage'][_0xf904('0xfe')](db[_0xf904('0xe1')],{'as':'Attachment','foreignKey':_0xf904('0x166')});db[_0xf904('0x168')][_0xf904('0xfe')](db['ChatWebsite'],{'as':_0xf904('0x145'),'foreignKey':_0xf904('0x167')});db['ChatOfflineMessage'][_0xf904('0xfe')](db[_0xf904('0x6b')],{'onDelete':_0xf904('0xf8'),'as':'Contact','foreignKey':_0xf904('0x146')});db[_0xf904('0x16e')][_0xf904('0xfe')](db[_0xf904('0x5b')],{'as':'Account','foreignKey':_0xf904('0x167')});db[_0xf904('0x63')][_0xf904('0x101')](db[_0xf904('0x14')],{'as':_0xf904('0x143'),'through':'UserChatQueue','hooks':!![]});db[_0xf904('0x63')][_0xf904('0x101')](db[_0xf904('0x12f')],{'through':_0xf904('0x16f'),'as':_0xf904('0x130')});db[_0xf904('0x65')][_0xf904('0xf4')](db[_0xf904('0xc8')],{'as':'Messages','foreignKey':_0xf904('0x170'),'onDelete':_0xf904('0xf8')});db['ChatGroup']['belongsToMany'](db[_0xf904('0x14')],{'as':'Members','through':'chat_group_has_users'});db[_0xf904('0x67')][_0xf904('0xfe')](db[_0xf904('0x5b')],{'as':_0xf904('0x16a'),'foreignKey':_0xf904('0x167')});db[_0xf904('0x69')]['hasMany'](db[_0xf904('0x6b')],{'as':_0xf904('0x102'),'foreignKey':_0xf904('0x171')});db['CmContact']['hasMany'](db[_0xf904('0x6d')],{'as':_0xf904('0x125'),'foreignKey':_0xf904('0x146')});db[_0xf904('0x6b')][_0xf904('0xf4')](db[_0xf904('0x70')],{'as':_0xf904('0x126'),'foreignKey':_0xf904('0x146')});db[_0xf904('0x6b')][_0xf904('0xf4')](db[_0xf904('0x71')],{'as':'HopperHistories','foreignKey':_0xf904('0x146')});db[_0xf904('0x6b')]['hasMany'](db[_0xf904('0x73')],{'as':_0xf904('0x73'),'foreignKey':_0xf904('0x146')});db[_0xf904('0x6b')][_0xf904('0xf4')](db[_0xf904('0xcd')],{'as':_0xf904('0x129'),'foreignKey':_0xf904('0x146')});db[_0xf904('0x6b')]['hasMany'](db[_0xf904('0x56')],{'as':_0xf904('0xfa'),'foreignKey':'ContactId','onDelete':_0xf904('0x14e')});db[_0xf904('0x6b')][_0xf904('0xf4')](db['ChatInteraction'],{'as':_0xf904('0xfb'),'foreignKey':_0xf904('0x146'),'onDelete':_0xf904('0x14e')});db[_0xf904('0x6b')][_0xf904('0xf4')](db[_0xf904('0x106')],{'as':_0xf904('0x107'),'foreignKey':_0xf904('0x146'),'onDelete':_0xf904('0x14e')});db[_0xf904('0x6b')][_0xf904('0xf4')](db[_0xf904('0x4a')],{'as':_0xf904('0xfc'),'foreignKey':'ContactId','onDelete':_0xf904('0x14e')});db[_0xf904('0x6b')][_0xf904('0xf4')](db[_0xf904('0x3d')],{'as':_0xf904('0xfd'),'foreignKey':_0xf904('0x146'),'onDelete':_0xf904('0x14e')});db[_0xf904('0x6b')][_0xf904('0xfe')](db['CmCompany'],{'as':_0xf904('0x172'),'foreignKey':_0xf904('0x171')});db[_0xf904('0x6b')][_0xf904('0xfe')](db[_0xf904('0xed')],{'as':_0xf904('0x140'),'foreignKey':'ListId','onDelete':_0xf904('0xf8')});db[_0xf904('0x6b')]['belongsToMany'](db['User'],{'as':_0xf904('0x14b'),'through':_0xf904('0x173')});db[_0xf904('0x6b')][_0xf904('0x101')](db[_0xf904('0x88')],{'as':_0xf904('0x148'),'through':_0xf904('0x174')});db[_0xf904('0x6b')][_0xf904('0x101')](db[_0xf904('0x88')],{'through':_0xf904('0x174'),'as':_0xf904('0x14a')});db[_0xf904('0x6d')][_0xf904('0xfe')](db['CmContact'],{'as':_0xf904('0x139'),'foreignKey':_0xf904('0x146'),'onDelete':'cascade'});db[_0xf904('0x6d')][_0xf904('0xfe')](db[_0xf904('0xed')],{'as':'List','foreignKey':_0xf904('0x151'),'onDelete':_0xf904('0xf8')});db[_0xf904('0x6d')][_0xf904('0xfe')](db[_0xf904('0x14')],{'as':_0xf904('0x175'),'foreignKey':_0xf904('0xf6')});db[_0xf904('0x6d')]['belongsTo'](db[_0xf904('0x10a')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0xf904('0xf8')});db[_0xf904('0x6d')][_0xf904('0xfe')](db[_0xf904('0xdd')],{'as':_0xf904('0xdd'),'foreignKey':_0xf904('0x176'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db['User'],{'as':_0xf904('0x147'),'foreignKey':_0xf904('0x177')});db[_0xf904('0x128')][_0xf904('0xfe')](db[_0xf904('0x6b')],{'as':_0xf904('0x139'),'foreignKey':'ContactId','onDelete':_0xf904('0xf8')});db['CmHopperBlack'][_0xf904('0xfe')](db['CmList'],{'as':'List','foreignKey':_0xf904('0x151'),'onDelete':_0xf904('0xf8')});db[_0xf904('0x128')]['belongsTo'](db[_0xf904('0x10a')],{'as':_0xf904('0x178'),'foreignKey':_0xf904('0x124'),'onDelete':_0xf904('0xf8')});db[_0xf904('0x128')][_0xf904('0xfe')](db[_0xf904('0xdd')],{'as':_0xf904('0xdd'),'foreignKey':_0xf904('0x176'),'onDelete':'cascade'});db['Automation'][_0xf904('0xf4')](db['Condition'],{'as':{'plural':_0xf904('0x179'),'singular':_0xf904('0x17a')},'foreignKey':_0xf904('0x17b'),'onDelete':'cascade','hooks':!![]});db[_0xf904('0x77')]['hasMany'](db[_0xf904('0x7d')],{'as':{'plural':'Any','singular':_0xf904('0x17c')},'foreignKey':_0xf904('0x17d'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xf904('0xf4')](db[_0xf904('0x17e')],{'as':_0xf904('0x17f'),'foreignKey':_0xf904('0x180'),'onDelete':_0xf904('0xf8'),'hooks':!![]});db[_0xf904('0x7f')][_0xf904('0xf4')](db[_0xf904('0x7f')],{'as':'Intervals','foreignKey':_0xf904('0x14f'),'onDelete':_0xf904('0xf8'),'hooks':!![],'required':![]});db[_0xf904('0x7f')][_0xf904('0xf4')](db['VoiceExtension'],{'as':_0xf904('0xf7'),'foreignKey':'IntervalId','onDelete':_0xf904('0x14e')});db[_0xf904('0x7f')][_0xf904('0xf4')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0xf904('0x14f')});db[_0xf904('0x7f')][_0xf904('0xf4')](db[_0xf904('0x5e')],{'as':_0xf904('0x181'),'foreignKey':_0xf904('0x14f')});db[_0xf904('0x7f')]['hasMany'](db[_0xf904('0x48')],{'as':_0xf904('0x182'),'foreignKey':'IntervalId'});db[_0xf904('0x7f')][_0xf904('0xf4')](db[_0xf904('0x15e')],{'as':_0xf904('0x183'),'foreignKey':'IntervalId'});db['Schedule'][_0xf904('0xfe')](db[_0xf904('0x38')],{});db[_0xf904('0x85')][_0xf904('0xfe')](db['AnalyticDefaultReport'],{'foreignKey':_0xf904('0x184')});db[_0xf904('0x85')][_0xf904('0xfe')](db['AnalyticCustomReport'],{'foreignKey':_0xf904('0x185')});db[_0xf904('0x86')]['belongsToMany'](db[_0xf904('0x121')],{'as':_0xf904('0x186'),'through':_0xf904('0x187'),'onDelete':_0xf904('0x14e')});db[_0xf904('0x88')][_0xf904('0x101')](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0xf904('0x88')]['belongsToMany'](db['ChatInteraction'],{'through':_0xf904('0x16c')});db[_0xf904('0x88')][_0xf904('0x101')](db['MailInteraction'],{'through':_0xf904('0x149')});db['Tag'][_0xf904('0x101')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0xf904('0x88')][_0xf904('0x101')](db[_0xf904('0x4a')],{'through':_0xf904('0x188')});db[_0xf904('0x88')][_0xf904('0x101')](db[_0xf904('0x56')],{'through':'openchannel_interaction_has_tags'});db[_0xf904('0x8b')][_0xf904('0xf4')](db[_0xf904('0x7d')],{'as':{'plural':_0xf904('0x189'),'singular':_0xf904('0x18a')},'foreignKey':_0xf904('0x18b'),'onDelete':_0xf904('0xf8'),'hooks':!![]});db[_0xf904('0x8b')][_0xf904('0xf4')](db[_0xf904('0x7d')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0xf904('0x18c'),'onDelete':_0xf904('0xf8'),'hooks':!![]});db[_0xf904('0x8b')][_0xf904('0xf4')](db[_0xf904('0x17e')],{'as':'Actions','foreignKey':_0xf904('0x18d'),'onDelete':_0xf904('0xf8'),'hooks':!![]});db[_0xf904('0x18e')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x185'),'hooks':!![]});db[_0xf904('0x92')][_0xf904('0xf4')](db['AnalyticFieldReport'],{'as':_0xf904('0x18f'),'onDelete':_0xf904('0xf8'),'foreignKey':'DefaultReportId'});db[_0xf904('0x96')][_0xf904('0xf4')](db[_0xf904('0x98')],{'as':_0xf904('0x18f'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x190')});db[_0xf904('0x98')][_0xf904('0xfe')](db[_0xf904('0x96')],{'foreignKey':_0xf904('0x190')});db[_0xf904('0x191')][_0xf904('0xf4')](db[_0xf904('0x9c')],{'as':_0xf904('0x192'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x193')});db[_0xf904('0x9c')][_0xf904('0xf4')](db[_0xf904('0x9d')],{'as':_0xf904('0x194'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x195')});db[_0xf904('0x9c')]['hasMany'](db['SalesforceField'],{'as':_0xf904('0x196'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x197')});db[_0xf904('0x9c')]['hasMany'](db[_0xf904('0x9d')],{'as':'Fields','onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x198')});db['SalesforceConfiguration'][_0xf904('0xfe')](db['SalesforceAccount'],{'as':_0xf904('0x145'),'foreignKey':'AccountId'});db[_0xf904('0x9d')][_0xf904('0xf4')](db[_0xf904('0x9d')],{'as':_0xf904('0x199'),'foreignKey':_0xf904('0x195')});db[_0xf904('0x9d')][_0xf904('0xf4')](db[_0xf904('0x9d')],{'as':'Description','foreignKey':_0xf904('0x197')});db[_0xf904('0x9d')][_0xf904('0xf4')](db[_0xf904('0x9d')],{'as':_0xf904('0x19a'),'foreignKey':_0xf904('0x198')});db['SalesforceField'][_0xf904('0xfe')](db[_0xf904('0x8c')],{'as':_0xf904('0x8c'),'foreignKey':'VariableId'});db[_0xf904('0x9e')]['hasMany'](db[_0xf904('0xa0')],{'as':_0xf904('0x192'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x193')});db['SugarcrmConfiguration']['hasMany'](db[_0xf904('0x19b')],{'as':_0xf904('0x194'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x195')});db['SugarcrmConfiguration'][_0xf904('0xf4')](db[_0xf904('0x19b')],{'as':'Descriptions','onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x197')});db[_0xf904('0xa0')][_0xf904('0xf4')](db[_0xf904('0x19b')],{'as':'Fields','onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x198')});db['SugarcrmConfiguration']['belongsTo'](db[_0xf904('0x9e')],{'as':_0xf904('0x145'),'foreignKey':_0xf904('0x193')});db['SugarcrmField'][_0xf904('0xf4')](db[_0xf904('0x19b')],{'as':_0xf904('0x199'),'foreignKey':_0xf904('0x195')});db[_0xf904('0x19b')]['hasMany'](db[_0xf904('0x19b')],{'as':_0xf904('0x19c'),'foreignKey':_0xf904('0x197')});db[_0xf904('0x19b')][_0xf904('0xf4')](db['SugarcrmField'],{'as':_0xf904('0x19a'),'foreignKey':'FieldId'});db[_0xf904('0x19b')][_0xf904('0xfe')](db['Variable'],{'as':_0xf904('0x8c'),'foreignKey':_0xf904('0x19d')});db['DeskAccount'][_0xf904('0xf4')](db[_0xf904('0xa4')],{'as':_0xf904('0x192'),'onDelete':'cascade','foreignKey':_0xf904('0x193')});db['DeskConfiguration'][_0xf904('0xf4')](db[_0xf904('0xa6')],{'as':_0xf904('0x194'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x195')});db[_0xf904('0xa4')][_0xf904('0xf4')](db['DeskField'],{'as':_0xf904('0x196'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x197')});db[_0xf904('0xa4')][_0xf904('0xf4')](db[_0xf904('0xa6')],{'as':_0xf904('0x18f'),'onDelete':'cascade','foreignKey':_0xf904('0x198')});db[_0xf904('0xa4')][_0xf904('0xfe')](db['DeskAccount'],{'as':_0xf904('0x145'),'foreignKey':_0xf904('0x193')});db[_0xf904('0xa4')][_0xf904('0x101')](db[_0xf904('0x88')],{'through':_0xf904('0x19e')});db['DeskField'][_0xf904('0xf4')](db[_0xf904('0xa6')],{'as':'Subject','foreignKey':_0xf904('0x195')});db['DeskField'][_0xf904('0xf4')](db[_0xf904('0xa6')],{'as':'Description','foreignKey':_0xf904('0x197')});db[_0xf904('0xa6')]['hasMany'](db['DeskField'],{'as':_0xf904('0x19a'),'foreignKey':_0xf904('0x198')});db[_0xf904('0xa6')][_0xf904('0xfe')](db[_0xf904('0x8c')],{'as':_0xf904('0x8c'),'foreignKey':'VariableId'});db[_0xf904('0xa7')][_0xf904('0xf4')](db[_0xf904('0xa9')],{'as':_0xf904('0x192'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x193')});db[_0xf904('0xa9')]['hasMany'](db[_0xf904('0xab')],{'as':'Subjects','onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x195')});db[_0xf904('0xa9')][_0xf904('0xf4')](db['ZohoField'],{'as':_0xf904('0x196'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x197')});db[_0xf904('0xa9')]['hasMany'](db[_0xf904('0xab')],{'as':_0xf904('0x18f'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x198')});db[_0xf904('0xa9')]['belongsTo'](db[_0xf904('0xa7')],{'as':'Account','foreignKey':'AccountId'});db[_0xf904('0xab')][_0xf904('0xf4')](db[_0xf904('0xab')],{'as':_0xf904('0x199'),'foreignKey':_0xf904('0x195')});db[_0xf904('0xab')]['hasMany'](db[_0xf904('0xab')],{'as':_0xf904('0x19c'),'foreignKey':'DescriptionId'});db[_0xf904('0xab')][_0xf904('0xf4')](db[_0xf904('0xab')],{'as':_0xf904('0x19a'),'foreignKey':_0xf904('0x198')});db[_0xf904('0xab')][_0xf904('0xfe')](db[_0xf904('0x8c')],{'as':'Variable','foreignKey':_0xf904('0x19d')});db[_0xf904('0xad')][_0xf904('0xf4')](db[_0xf904('0xae')],{'as':'Configurations','onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x193')});db['ZendeskConfiguration'][_0xf904('0xf4')](db[_0xf904('0xb0')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xf904('0xae')][_0xf904('0xf4')](db[_0xf904('0xb0')],{'as':_0xf904('0x196'),'foreignKey':_0xf904('0x197')});db['ZendeskConfiguration'][_0xf904('0xf4')](db[_0xf904('0xb0')],{'as':_0xf904('0x18f'),'foreignKey':'FieldId'});db[_0xf904('0xae')][_0xf904('0xfe')](db[_0xf904('0xad')],{'as':'Account','foreignKey':'AccountId'});db['ZendeskConfiguration']['belongsToMany'](db[_0xf904('0x88')],{'through':_0xf904('0x19f')});db[_0xf904('0xb0')][_0xf904('0xf4')](db[_0xf904('0xb0')],{'as':_0xf904('0x199'),'foreignKey':_0xf904('0x195')});db[_0xf904('0xb0')][_0xf904('0xf4')](db[_0xf904('0xb0')],{'as':_0xf904('0x19c'),'foreignKey':'DescriptionId'});db[_0xf904('0xb0')][_0xf904('0xf4')](db[_0xf904('0xb0')],{'as':'Field','foreignKey':_0xf904('0x198')});db[_0xf904('0xb0')][_0xf904('0xfe')](db[_0xf904('0x8c')],{'as':_0xf904('0x8c'),'foreignKey':_0xf904('0x19d')});db[_0xf904('0xb2')][_0xf904('0xf4')](db['FreshdeskConfiguration'],{'as':_0xf904('0x192'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x193')});db['FreshdeskConfiguration'][_0xf904('0xf4')](db[_0xf904('0xb6')],{'as':'Subjects','onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x195')});db[_0xf904('0xb4')][_0xf904('0xf4')](db[_0xf904('0xb6')],{'as':'Descriptions','onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x197')});db['FreshdeskConfiguration'][_0xf904('0xf4')](db[_0xf904('0xb6')],{'as':_0xf904('0x18f'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x198')});db[_0xf904('0xb4')][_0xf904('0xfe')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0xf904('0x193')});db[_0xf904('0xb4')][_0xf904('0x101')](db[_0xf904('0x88')],{'through':_0xf904('0x1a0')});db[_0xf904('0xb6')][_0xf904('0xf4')](db[_0xf904('0xb6')],{'as':'Subject','foreignKey':_0xf904('0x195')});db[_0xf904('0xb6')][_0xf904('0xf4')](db['FreshdeskField'],{'as':_0xf904('0x19c'),'foreignKey':_0xf904('0x197')});db[_0xf904('0xb6')][_0xf904('0xf4')](db[_0xf904('0xb6')],{'as':'Field','foreignKey':_0xf904('0x198')});db[_0xf904('0xb6')]['belongsTo'](db[_0xf904('0x8c')],{'as':_0xf904('0x8c'),'foreignKey':_0xf904('0x19d')});db[_0xf904('0xb7')][_0xf904('0xf4')](db[_0xf904('0xb9')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['VtigerConfiguration']['hasMany'](db[_0xf904('0xba')],{'as':_0xf904('0x194'),'foreignKey':_0xf904('0x195')});db['VtigerConfiguration'][_0xf904('0xf4')](db[_0xf904('0xba')],{'as':_0xf904('0x196'),'foreignKey':_0xf904('0x197')});db[_0xf904('0xb9')][_0xf904('0xf4')](db[_0xf904('0xba')],{'as':'Fields','foreignKey':'FieldId'});db[_0xf904('0xb9')]['belongsTo'](db[_0xf904('0xb7')],{'as':'Account','foreignKey':_0xf904('0x193')});db['VtigerConfiguration'][_0xf904('0x101')](db[_0xf904('0x88')],{'through':_0xf904('0x1a1')});db[_0xf904('0xba')][_0xf904('0xf4')](db[_0xf904('0xba')],{'as':_0xf904('0x199'),'foreignKey':_0xf904('0x195')});db['VtigerField'][_0xf904('0xf4')](db[_0xf904('0xba')],{'as':'Description','foreignKey':_0xf904('0x197')});db[_0xf904('0xba')]['hasMany'](db[_0xf904('0xba')],{'as':'Field','foreignKey':_0xf904('0x198')});db['VtigerField'][_0xf904('0xfe')](db['Variable'],{'as':_0xf904('0x8c'),'foreignKey':_0xf904('0x19d')});db[_0xf904('0xbc')][_0xf904('0xf4')](db[_0xf904('0xbe')],{'as':_0xf904('0x192'),'onDelete':'cascade','foreignKey':_0xf904('0x193')});db[_0xf904('0xbe')][_0xf904('0xf4')](db[_0xf904('0xbf')],{'as':_0xf904('0x194'),'foreignKey':'SubjectId'});db[_0xf904('0xbe')][_0xf904('0xf4')](db[_0xf904('0xbf')],{'as':'Descriptions','foreignKey':_0xf904('0x197')});db[_0xf904('0xbe')][_0xf904('0xf4')](db[_0xf904('0xbf')],{'as':_0xf904('0x18f'),'foreignKey':'FieldId'});db[_0xf904('0xbe')][_0xf904('0xfe')](db[_0xf904('0xbc')],{'as':_0xf904('0x145'),'foreignKey':_0xf904('0x193')});db['ServicenowField'][_0xf904('0xf4')](db[_0xf904('0xbf')],{'as':_0xf904('0x199'),'foreignKey':_0xf904('0x195')});db['ServicenowField']['hasMany'](db[_0xf904('0xbf')],{'as':'Description','foreignKey':_0xf904('0x197')});db[_0xf904('0xbf')][_0xf904('0xf4')](db['ServicenowField'],{'as':_0xf904('0x19a'),'foreignKey':_0xf904('0x198')});db['ServicenowField']['belongsTo'](db[_0xf904('0x8c')],{'as':_0xf904('0x8c'),'foreignKey':_0xf904('0x19d')});db[_0xf904('0xc0')][_0xf904('0xf4')](db[_0xf904('0x1a2')],{'as':_0xf904('0x192'),'onDelete':_0xf904('0xf8'),'foreignKey':'AccountId'});db[_0xf904('0x1a2')][_0xf904('0xf4')](db[_0xf904('0xc3')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xf904('0x195')});db['Dynamics365Configuration'][_0xf904('0xf4')](db[_0xf904('0xc3')],{'as':_0xf904('0x196'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x197')});db[_0xf904('0x1a2')][_0xf904('0xf4')](db[_0xf904('0xc3')],{'as':_0xf904('0x18f'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x198')});db[_0xf904('0x1a2')][_0xf904('0xfe')](db[_0xf904('0xc0')],{'as':'Account','foreignKey':_0xf904('0x193')});db[_0xf904('0xc3')]['hasMany'](db[_0xf904('0xc3')],{'as':_0xf904('0x199'),'foreignKey':_0xf904('0x195')});db[_0xf904('0xc3')][_0xf904('0xf4')](db[_0xf904('0xc3')],{'as':_0xf904('0x19c'),'foreignKey':'DescriptionId'});db['Dynamics365Field'][_0xf904('0xf4')](db[_0xf904('0xc3')],{'as':_0xf904('0x19a'),'foreignKey':_0xf904('0x198')});db[_0xf904('0xc3')][_0xf904('0xfe')](db[_0xf904('0x8c')],{'as':_0xf904('0x8c'),'foreignKey':_0xf904('0x19d')});db[_0xf904('0x1a3')][_0xf904('0xfe')](db[_0xf904('0x5b')],{});db['ChatQueueReport'][_0xf904('0xfe')](db[_0xf904('0xed')],{'as':'List','foreignKey':'ListId'});db[_0xf904('0x1a3')][_0xf904('0xfe')](db['CmContact'],{'as':_0xf904('0x139'),'foreignKey':_0xf904('0x146')});db[_0xf904('0x1a3')][_0xf904('0xfe')](db[_0xf904('0x5f')],{});db[_0xf904('0x1a3')][_0xf904('0xfe')](db[_0xf904('0x168')],{});db[_0xf904('0x1a3')][_0xf904('0xfe')](db[_0xf904('0x14')],{});db[_0xf904('0x1a3')][_0xf904('0xfe')](db['ChatQueue'],{});db[_0xf904('0xc8')][_0xf904('0xfe')](db[_0xf904('0x14')],{'onDelete':_0xf904('0xf8'),'foreignKey':'FromId'});db[_0xf904('0xc8')][_0xf904('0xfe')](db[_0xf904('0x14')],{'onDelete':_0xf904('0xf8'),'foreignKey':'ToId'});db[_0xf904('0xcd')][_0xf904('0xf4')](db[_0xf904('0xcb')],{'foreignKey':'SessionId','onDelete':'cascade'});db['JscriptySessionReport'][_0xf904('0xf4')](db[_0xf904('0x1a4')],{'foreignKey':_0xf904('0x1a5'),'onDelete':'cascade'});db[_0xf904('0xcf')][_0xf904('0xfe')](db[_0xf904('0x4e')],{});db[_0xf904('0xcf')][_0xf904('0xfe')](db[_0xf904('0xed')],{'as':_0xf904('0x140'),'foreignKey':_0xf904('0x151')});db['SmsQueueReport'][_0xf904('0xfe')](db[_0xf904('0x6b')],{'as':'Contact','foreignKey':_0xf904('0x146')});db['SmsQueueReport'][_0xf904('0xfe')](db['SmsInteraction'],{});db[_0xf904('0xcf')]['belongsTo'](db[_0xf904('0x51')],{});db[_0xf904('0xcf')]['belongsTo'](db[_0xf904('0x14')],{});db[_0xf904('0xcf')][_0xf904('0xfe')](db[_0xf904('0x10e')],{});db[_0xf904('0xd5')][_0xf904('0xf4')](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db[_0xf904('0xd5')][_0xf904('0xf4')](db[_0xf904('0xcb')],{'foreignKey':_0xf904('0x1a6')});db[_0xf904('0xd5')][_0xf904('0xf4')](db[_0xf904('0x1a4')],{'foreignKey':'ProjectId'});db['SquareProject'][_0xf904('0x101')](db[_0xf904('0x14')],{'as':_0xf904('0x14b'),'through':'user_has_square_projects'});db[_0xf904('0x12f')][_0xf904('0x101')](db[_0xf904('0x14')],{'as':_0xf904('0x143'),'through':'user_has_teams'});db['Team'][_0xf904('0x101')](db['VoiceQueue'],{'through':'team_has_voice_queues','as':'VoiceQueues'});db[_0xf904('0x12f')]['belongsToMany'](db[_0xf904('0x3a')],{'through':_0xf904('0x1a7'),'as':'MailQueues'});db[_0xf904('0x12f')][_0xf904('0x101')](db[_0xf904('0x63')],{'through':_0xf904('0x16f'),'as':_0xf904('0x1a8')});db[_0xf904('0x12f')][_0xf904('0x101')](db['FaxQueue'],{'through':_0xf904('0x15b'),'as':_0xf904('0x1a9')});db[_0xf904('0x12f')][_0xf904('0x101')](db[_0xf904('0x10e')],{'through':_0xf904('0x161'),'as':_0xf904('0x10f')});db['Team'][_0xf904('0x101')](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':_0xf904('0x1aa')});db[_0xf904('0xdd')][_0xf904('0xf4')](db[_0xf904('0x6d')],{'as':_0xf904('0x125'),'foreignKey':_0xf904('0x176')});db['Campaign'][_0xf904('0xf4')](db[_0xf904('0x70')],{'as':_0xf904('0x126'),'foreignKey':_0xf904('0x176')});db[_0xf904('0xdd')][_0xf904('0xf4')](db['CmHopperHistory'],{'as':_0xf904('0x127'),'foreignKey':'CampaignId'});db['Campaign'][_0xf904('0xf4')](db[_0xf904('0x128')],{'as':_0xf904('0x1ab'),'foreignKey':_0xf904('0x176')});db[_0xf904('0xdd')][_0xf904('0xfe')](db[_0xf904('0x28')],{'as':_0xf904('0x28'),'foreignKey':'TrunkId'});db[_0xf904('0xdd')][_0xf904('0xfe')](db[_0xf904('0x28')],{'as':_0xf904('0x1ac'),'foreignKey':'TrunkBackupId'});db[_0xf904('0xdd')]['belongsTo'](db[_0xf904('0x7f')],{'as':_0xf904('0x7f'),'foreignKey':_0xf904('0x14f')});db['Campaign']['belongsTo'](db['SquareProject'],{'as':_0xf904('0xda'),'foreignKey':'SquareProjectId'});db[_0xf904('0xdd')]['belongsToMany'](db['CmList'],{'as':'Lists','through':_0xf904('0x1ad')});db[_0xf904('0xdd')][_0xf904('0x101')](db[_0xf904('0xed')],{'as':'BlackLists','through':_0xf904('0x1ae')});db['MailTransferReport'][_0xf904('0xfe')](db[_0xf904('0x3e')],{});db[_0xf904('0xe4')][_0xf904('0xfe')](db[_0xf904('0x3d')],{});db['MailTransferReport']['belongsTo'](db[_0xf904('0x38')],{'foreignKey':_0xf904('0x1af'),'as':_0xf904('0x1b0')});db['MailTransferReport'][_0xf904('0xfe')](db[_0xf904('0x14')],{'foreignKey':_0xf904('0x1b1'),'as':_0xf904('0x1b2')});db[_0xf904('0xe4')][_0xf904('0xfe')](db[_0xf904('0x14')],{'foreignKey':'ToUserId','as':_0xf904('0x1b3')});db[_0xf904('0xe4')][_0xf904('0xfe')](db['MailQueue'],{'foreignKey':_0xf904('0x1b4'),'as':'ToQueue'});db[_0xf904('0xe4')][_0xf904('0xfe')](db[_0xf904('0x38')],{'foreignKey':_0xf904('0x1b5'),'as':_0xf904('0x1b6')});db[_0xf904('0xe6')][_0xf904('0xfe')](db[_0xf904('0x168')],{});db[_0xf904('0xe6')]['belongsTo'](db[_0xf904('0x5f')],{});db['ChatTransferReport'][_0xf904('0xfe')](db['ChatWebsite'],{'foreignKey':_0xf904('0x1b7'),'as':_0xf904('0x1b0')});db[_0xf904('0xe6')][_0xf904('0xfe')](db[_0xf904('0x14')],{'foreignKey':_0xf904('0x1b1'),'as':_0xf904('0x1b2')});db[_0xf904('0xe6')][_0xf904('0xfe')](db['User'],{'foreignKey':_0xf904('0x1b8'),'as':_0xf904('0x1b3')});db[_0xf904('0xe6')][_0xf904('0xfe')](db[_0xf904('0x63')],{'foreignKey':'ToChatQueueId','as':_0xf904('0x1b9')});db[_0xf904('0xe6')]['belongsTo'](db[_0xf904('0x5b')],{'foreignKey':'ToChatWebsiteId','as':_0xf904('0x1b6')});db[_0xf904('0xe7')][_0xf904('0xfe')](db['FaxMessage'],{});db[_0xf904('0xe7')][_0xf904('0xfe')](db[_0xf904('0x4a')],{});db[_0xf904('0xe7')][_0xf904('0xfe')](db[_0xf904('0x47')],{'foreignKey':_0xf904('0x1ba'),'as':_0xf904('0x1b0')});db[_0xf904('0xe7')][_0xf904('0xfe')](db[_0xf904('0x14')],{'foreignKey':_0xf904('0x1b1'),'as':_0xf904('0x1b2')});db[_0xf904('0xe7')][_0xf904('0xfe')](db[_0xf904('0x14')],{'foreignKey':'ToUserId','as':_0xf904('0x1b3')});db[_0xf904('0xe7')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0xf904('0x1bb'),'as':_0xf904('0x1b9')});db[_0xf904('0xe7')][_0xf904('0xfe')](db[_0xf904('0x47')],{'foreignKey':_0xf904('0x1bc'),'as':_0xf904('0x1b6')});db['OpenchannelTransferReport'][_0xf904('0xfe')](db[_0xf904('0x58')],{});db[_0xf904('0xe9')][_0xf904('0xfe')](db[_0xf904('0x56')],{});db[_0xf904('0xe9')][_0xf904('0xfe')](db['OpenchannelAccount'],{'foreignKey':_0xf904('0x1bd'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0xf904('0xfe')](db[_0xf904('0x14')],{'foreignKey':_0xf904('0x1b1'),'as':'FromAgent'});db['OpenchannelTransferReport']['belongsTo'](db[_0xf904('0x14')],{'foreignKey':'ToUserId','as':_0xf904('0x1b3')});db[_0xf904('0xe9')]['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0xf904('0x1be'),'as':_0xf904('0x1b9')});db[_0xf904('0xe9')][_0xf904('0xfe')](db[_0xf904('0x52')],{'foreignKey':_0xf904('0x1bf'),'as':'ToAccount'});db['SmsTransferReport'][_0xf904('0xfe')](db[_0xf904('0x51')],{});db[_0xf904('0xeb')][_0xf904('0xfe')](db[_0xf904('0x106')],{});db[_0xf904('0xeb')][_0xf904('0xfe')](db[_0xf904('0x4e')],{'foreignKey':'FromSmsAccountId','as':_0xf904('0x1b0')});db[_0xf904('0xeb')][_0xf904('0xfe')](db[_0xf904('0x14')],{'foreignKey':'FromUserId','as':_0xf904('0x1b2')});db[_0xf904('0xeb')][_0xf904('0xfe')](db['User'],{'foreignKey':_0xf904('0x1b8'),'as':_0xf904('0x1b3')});db[_0xf904('0xeb')][_0xf904('0xfe')](db['SmsQueue'],{'foreignKey':_0xf904('0x1c0'),'as':_0xf904('0x1b9')});db['SmsTransferReport']['belongsTo'](db[_0xf904('0x4e')],{'foreignKey':'ToSmsAccountId','as':_0xf904('0x1b6')});db[_0xf904('0xed')][_0xf904('0xf4')](db[_0xf904('0x7b')],{'as':'Dispositions','foreignKey':'ListId'});db[_0xf904('0xed')][_0xf904('0xf4')](db[_0xf904('0x75')],{'as':_0xf904('0x1c1'),'foreignKey':_0xf904('0x151')});db[_0xf904('0xed')]['hasMany'](db[_0xf904('0x6b')],{'as':_0xf904('0x102'),'onDelete':_0xf904('0xf8'),'foreignKey':_0xf904('0x151')});db['CmList']['hasMany'](db[_0xf904('0x70')],{'as':_0xf904('0x126'),'foreignKey':_0xf904('0x151')});db[_0xf904('0xed')][_0xf904('0xf4')](db[_0xf904('0x71')],{'as':_0xf904('0xf9'),'foreignKey':_0xf904('0x151')});db['CmList'][_0xf904('0xf4')](db['ReportAgentPreview'],{'as':_0xf904('0x73'),'foreignKey':_0xf904('0x151')});db[_0xf904('0xed')][_0xf904('0x101')](db[_0xf904('0x10a')],{'as':_0xf904('0x1c2'),'through':_0xf904('0x12e')});db[_0xf904('0xed')]['belongsToMany'](db[_0xf904('0x14')],{'as':_0xf904('0x143'),'through':'cm_user_has_lists'});db[_0xf904('0x1c3')][_0xf904('0xf4')](db[_0xf904('0x19')],{'as':'Extensions','onDelete':_0xf904('0x14e')});db[_0xf904('0x1c3')][_0xf904('0x101')](db[_0xf904('0x14')],{'as':_0xf904('0x143'),'through':_0xf904('0x1c4')});db['UserProfile'][_0xf904('0xf4')](db[_0xf904('0x14')],{'as':_0xf904('0x14b'),'foreignKey':_0xf904('0xff')});db['UserProfile'][_0xf904('0xf4')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0xf904('0xff'),'onDelete':_0xf904('0xf8')});db[_0xf904('0x1c5')]['hasMany'](db[_0xf904('0xf3')],{'as':'Resources','foreignKey':_0xf904('0x1c6'),'onDelete':'cascade'});module[_0xf904('0x1c7')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 8887d1a..af57181 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f78=['/api/mail/queues','./api/mailQueue','./api/mailSubstatus','./api/mailInteraction','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','/apidoc','static','join','root','/www','/demo','snippet','1.0.15','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','path','express-winston','./errors','./config/environment','api','auth','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','x-forwarded-for','headers','connection','remoteAddress','url','user','name','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','agent_id','responseTime','role','device','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','./api/mailAccount'];(function(_0x395f5a,_0x14a259){var _0x354e5a=function(_0x2007f7){while(--_0x2007f7){_0x395f5a['push'](_0x395f5a['shift']());}};_0x354e5a(++_0x14a259);}(_0x1f78,0x1cf));var _0x81f7=function(_0x42a5f4,_0x47f89b){_0x42a5f4=_0x42a5f4-0x0;var _0x100568=_0x1f78[_0x42a5f4];return _0x100568;};'use strict';var path=require(_0x81f7('0x0'));var express=require('express');var ewinston=require(_0x81f7('0x1'));var util=require('util');var errors=require(_0x81f7('0x2'));var config=require(_0x81f7('0x3'));var logger=require('./config/logger')(_0x81f7('0x4'));var authLogger=require('./config/logger')(_0x81f7('0x5'));exports[_0x81f7('0x6')]=function(_0x556d37){_0x556d37[_0x81f7('0x7')](ewinston[_0x81f7('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x804123,_0x3d53d5){return util[_0x81f7('0x9')](_0x81f7('0xa'),_0x804123[_0x81f7('0xb')],_0x804123['headers'][_0x81f7('0xc')]?_0x804123[_0x81f7('0xd')][_0x81f7('0xc')]:_0x804123[_0x81f7('0xe')][_0x81f7('0xf')]||_0x804123['ip'],_0x804123[_0x81f7('0x10')],_0x3d53d5['statusCode'],_0x3d53d5['responseTime'],_0x804123['user']?_0x804123[_0x81f7('0x11')]['id']:null,_0x804123[_0x81f7('0x11')]?_0x804123[_0x81f7('0x11')][_0x81f7('0x12')]:null,_0x804123[_0x81f7('0x11')]?_0x804123[_0x81f7('0x11')]['role']:null);}}));_0x556d37[_0x81f7('0x7')](ewinston[_0x81f7('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3820a0,_0x130ecd){var _0x471cab=_0x81f7('0x13');if(_0x3820a0[_0x81f7('0x14')]&&_0x3820a0[_0x81f7('0x14')]['device']&&_0x3820a0[_0x81f7('0x14')][_0x81f7('0x15')]){_0x471cab='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x471cab,_0x3820a0[_0x81f7('0xb')],_0x3820a0[_0x81f7('0xd')][_0x81f7('0xc')]?_0x3820a0[_0x81f7('0xd')][_0x81f7('0xc')]:_0x3820a0[_0x81f7('0xe')][_0x81f7('0xf')]||_0x3820a0['ip'],_0x3820a0[_0x81f7('0x10')],_0x130ecd['statusCode'],_0x130ecd[_0x81f7('0x16')],_0x3820a0[_0x81f7('0x11')]?_0x3820a0[_0x81f7('0x11')]['id']:null,_0x3820a0['user']?_0x3820a0['user']['name']:null,_0x3820a0[_0x81f7('0x11')]?_0x3820a0[_0x81f7('0x11')][_0x81f7('0x17')]:null,_0x3820a0[_0x81f7('0x14')]&&_0x3820a0[_0x81f7('0x14')][_0x81f7('0x18')]?_0x3820a0[_0x81f7('0x14')][_0x81f7('0x18')]:'other',_0x3820a0[_0x81f7('0x14')]&&_0x3820a0[_0x81f7('0x14')][_0x81f7('0x15')]?_0x3820a0['body']['agent_id']:'',_0x3820a0['body']&&_0x3820a0[_0x81f7('0x14')][_0x81f7('0x19')]?_0x3820a0[_0x81f7('0x14')][_0x81f7('0x19')]:'');},'ignoreRoute':function(_0x5a70f8){var _0x44eca9=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x44eca9['test'](_0x5a70f8[_0x81f7('0x10')]);}}));_0x556d37['use'](_0x81f7('0x1a'),require(_0x81f7('0x1b')));_0x556d37['use'](_0x81f7('0x1c'),require(_0x81f7('0x1d')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x1e'),require(_0x81f7('0x1f')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x20'),require(_0x81f7('0x21')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x22'),require(_0x81f7('0x23')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x24'),require('./api/voiceQueue'));_0x556d37['use'](_0x81f7('0x25'),require('./api/voiceRecording'));_0x556d37[_0x81f7('0x7')]('/api/screen/recordings',require('./api/screenRecording'));_0x556d37[_0x81f7('0x7')]('/api/voice/mails',require(_0x81f7('0x26')));_0x556d37[_0x81f7('0x7')]('/api/voice/mails/messages',require(_0x81f7('0x27')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x28'),require(_0x81f7('0x29')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x2a'),require(_0x81f7('0x2b')));_0x556d37['use'](_0x81f7('0x2c'),require(_0x81f7('0x2d')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x2e'),require(_0x81f7('0x2f')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x30'),require(_0x81f7('0x31')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x32'),require('./api/trunk'));_0x556d37[_0x81f7('0x7')](_0x81f7('0x33'),require(_0x81f7('0x34')));_0x556d37[_0x81f7('0x7')]('/api/mail/out_servers',require(_0x81f7('0x35')));_0x556d37[_0x81f7('0x7')]('/api/mail/accounts',require(_0x81f7('0x36')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x37'),require(_0x81f7('0x38')));_0x556d37[_0x81f7('0x7')]('/api/mail/substatuses',require(_0x81f7('0x39')));_0x556d37[_0x81f7('0x7')]('/api/mail/interactions',require(_0x81f7('0x3a')));_0x556d37['use']('/api/mail/messages',require('./api/mailMessage'));_0x556d37[_0x81f7('0x7')]('/api/mail/applications',require(_0x81f7('0x3b')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x3c'),require('./api/mailQueueReport'));_0x556d37[_0x81f7('0x7')](_0x81f7('0x3d'),require(_0x81f7('0x3e')));_0x556d37['use'](_0x81f7('0x3f'),require(_0x81f7('0x40')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x41'),require('./api/faxAccount'));_0x556d37['use'](_0x81f7('0x42'),require(_0x81f7('0x43')));_0x556d37['use'](_0x81f7('0x44'),require(_0x81f7('0x45')));_0x556d37[_0x81f7('0x7')]('/api/fax/messages',require('./api/faxMessage'));_0x556d37[_0x81f7('0x7')](_0x81f7('0x46'),require(_0x81f7('0x47')));_0x556d37[_0x81f7('0x7')]('/api/fax/reports/queue',require(_0x81f7('0x48')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x49'),require(_0x81f7('0x4a')));_0x556d37[_0x81f7('0x7')]('/api/sms/applications',require('./api/smsApplication'));_0x556d37['use'](_0x81f7('0x4b'),require(_0x81f7('0x4c')));_0x556d37['use'](_0x81f7('0x4d'),require(_0x81f7('0x4e')));_0x556d37['use']('/api/sms/queues',require('./api/smsQueue'));_0x556d37[_0x81f7('0x7')](_0x81f7('0x4f'),require(_0x81f7('0x50')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x51'),require(_0x81f7('0x52')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x53'),require(_0x81f7('0x54')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x55'),require(_0x81f7('0x56')));_0x556d37['use']('/api/openchannel/queues',require('./api/openchannelQueue'));_0x556d37[_0x81f7('0x7')](_0x81f7('0x57'),require(_0x81f7('0x58')));_0x556d37['use'](_0x81f7('0x59'),require(_0x81f7('0x5a')));_0x556d37[_0x81f7('0x7')]('/api/chat/applications',require(_0x81f7('0x5b')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x5c'),require(_0x81f7('0x5d')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x5e'),require('./api/chatMessage'));_0x556d37[_0x81f7('0x7')](_0x81f7('0x5f'),require('./api/chatOfflineMessage'));_0x556d37[_0x81f7('0x7')](_0x81f7('0x60'),require(_0x81f7('0x61')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x62'),require(_0x81f7('0x63')));_0x556d37['use'](_0x81f7('0x64'),require('./api/chatProactiveAction'));_0x556d37['use'](_0x81f7('0x65'),require(_0x81f7('0x66')));_0x556d37[_0x81f7('0x7')]('/api/cm/contacts',require(_0x81f7('0x67')));_0x556d37[_0x81f7('0x7')]('/api/cm/hopper',require(_0x81f7('0x68')));_0x556d37['use'](_0x81f7('0x69'),require(_0x81f7('0x6a')));_0x556d37['use'](_0x81f7('0x6b'),require(_0x81f7('0x6c')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x6d'),require(_0x81f7('0x6e')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x6f'),require(_0x81f7('0x70')));_0x556d37[_0x81f7('0x7')]('/api/actions',require(_0x81f7('0x71')));_0x556d37['use'](_0x81f7('0x72'),require(_0x81f7('0x73')));_0x556d37['use'](_0x81f7('0x74'),require(_0x81f7('0x75')));_0x556d37['use']('/api/dispositions',require('./api/disposition'));_0x556d37[_0x81f7('0x7')](_0x81f7('0x76'),require('./api/condition'));_0x556d37[_0x81f7('0x7')](_0x81f7('0x77'),require(_0x81f7('0x78')));_0x556d37['use'](_0x81f7('0x79'),require(_0x81f7('0x7a')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x7b'),require(_0x81f7('0x7c')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x7d'),require(_0x81f7('0x7e')));_0x556d37['use'](_0x81f7('0x7f'),require(_0x81f7('0x80')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x81'),require(_0x81f7('0x82')));_0x556d37[_0x81f7('0x7')]('/api/tags',require(_0x81f7('0x83')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x84'),require(_0x81f7('0x85')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x86'),require(_0x81f7('0x87')));_0x556d37[_0x81f7('0x7')]('/api/variables',require(_0x81f7('0x88')));_0x556d37[_0x81f7('0x7')]('/api/integrations',require(_0x81f7('0x89')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x8a'),require(_0x81f7('0x8b')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x8c'),require(_0x81f7('0x8d')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x8e'),require('./api/analyticDefaultReport'));_0x556d37[_0x81f7('0x7')]('/api/analytics/extracted_reports',require(_0x81f7('0x8f')));_0x556d37['use'](_0x81f7('0x90'),require(_0x81f7('0x91')));_0x556d37['use'](_0x81f7('0x92'),require(_0x81f7('0x93')));_0x556d37['use'](_0x81f7('0x94'),require('./api/analyticTreeReport'));_0x556d37[_0x81f7('0x7')](_0x81f7('0x95'),require(_0x81f7('0x96')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x97'),require(_0x81f7('0x98')));_0x556d37['use']('/api/integrations/salesforce/fields',require(_0x81f7('0x99')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x9a'),require(_0x81f7('0x9b')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x9c'),require(_0x81f7('0x9d')));_0x556d37[_0x81f7('0x7')](_0x81f7('0x9e'),require(_0x81f7('0x9f')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xa0'),require(_0x81f7('0xa1')));_0x556d37['use']('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x556d37['use'](_0x81f7('0xa2'),require('./api/intDeskField'));_0x556d37[_0x81f7('0x7')](_0x81f7('0xa3'),require(_0x81f7('0xa4')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xa5'),require(_0x81f7('0xa6')));_0x556d37[_0x81f7('0x7')]('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x556d37[_0x81f7('0x7')](_0x81f7('0xa7'),require(_0x81f7('0xa8')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xa9'),require(_0x81f7('0xaa')));_0x556d37['use'](_0x81f7('0xab'),require('./api/intZendeskField'));_0x556d37[_0x81f7('0x7')](_0x81f7('0xac'),require(_0x81f7('0xad')));_0x556d37['use'](_0x81f7('0xae'),require(_0x81f7('0xaf')));_0x556d37['use'](_0x81f7('0xb0'),require(_0x81f7('0xb1')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xb2'),require(_0x81f7('0xb3')));_0x556d37['use'](_0x81f7('0xb4'),require(_0x81f7('0xb5')));_0x556d37['use'](_0x81f7('0xb6'),require(_0x81f7('0xb7')));_0x556d37[_0x81f7('0x7')]('/api/integrations/servicenow/accounts',require(_0x81f7('0xb8')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xb9'),require('./api/intServicenowConfiguration'));_0x556d37['use']('/api/integrations/servicenow/fields',require(_0x81f7('0xba')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xbb'),require(_0x81f7('0xbc')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xbd'),require(_0x81f7('0xbe')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xbf'),require('./api/intDynamics365Field'));_0x556d37[_0x81f7('0x7')](_0x81f7('0xc0'),require(_0x81f7('0xc1')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xc2'),require('./api/chatQueueReport'));_0x556d37['use'](_0x81f7('0xc3'),require('./api/chatInternalMessage'));_0x556d37['use']('/api/jscripty/answers/reports',require(_0x81f7('0xc4')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xc5'),require('./api/jscriptyQuestionReport'));_0x556d37['use'](_0x81f7('0xc6'),require(_0x81f7('0xc7')));_0x556d37['use'](_0x81f7('0xc8'),require(_0x81f7('0xc9')));_0x556d37[_0x81f7('0x7')]('/api/square/reports',require(_0x81f7('0xca')));_0x556d37['use'](_0x81f7('0xcb'),require(_0x81f7('0xcc')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xcd'),require(_0x81f7('0xce')));_0x556d37[_0x81f7('0x7')]('/api/settings',require(_0x81f7('0xcf')));_0x556d37['use']('/api/square/odbc',require('./api/squareOdbc'));_0x556d37[_0x81f7('0x7')](_0x81f7('0xd0'),require(_0x81f7('0xd1')));_0x556d37['use'](_0x81f7('0xd2'),require('./api/squareRecording'));_0x556d37[_0x81f7('0x7')](_0x81f7('0xd3'),require(_0x81f7('0xd4')));_0x556d37['use'](_0x81f7('0xd5'),require('./api/team'));_0x556d37[_0x81f7('0x7')]('/api/license',require('./api/license'));_0x556d37[_0x81f7('0x7')](_0x81f7('0xd6'),require(_0x81f7('0xd7')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xd8'),require(_0x81f7('0xd9')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xda'),require(_0x81f7('0xdb')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xdc'),require(_0x81f7('0xdd')));_0x556d37[_0x81f7('0x7')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x556d37[_0x81f7('0x7')](_0x81f7('0xde'),require(_0x81f7('0xdf')));_0x556d37[_0x81f7('0x7')]('/api/fax/reports/transfer',require(_0x81f7('0xe0')));_0x556d37['use'](_0x81f7('0xe1'),require('./api/openchannelTransferReport'));_0x556d37[_0x81f7('0x7')](_0x81f7('0xe2'),require(_0x81f7('0xe3')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xe4'),require(_0x81f7('0xe5')));_0x556d37['use'](_0x81f7('0xe6'),require(_0x81f7('0xe7')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xe8'),require(_0x81f7('0xe9')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xea'),require('./api/userProfileSection'));_0x556d37[_0x81f7('0x7')](_0x81f7('0xeb'),require('./api/userProfileResource'));_0x556d37[_0x81f7('0x7')]('/api/auth/local',require(_0x81f7('0xec')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xed'),require(_0x81f7('0xee')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xef'),require(_0x81f7('0xf0')));_0x556d37[_0x81f7('0x7')]('/api/rpc',require(_0x81f7('0xf1')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xf2'),require(_0x81f7('0xf3')));_0x556d37['use']('/api/system',require(_0x81f7('0xf4')));_0x556d37[_0x81f7('0x7')](_0x81f7('0xf5'),require('./api/pm2'));_0x556d37[_0x81f7('0x7')](_0x81f7('0xf6'),express[_0x81f7('0xf7')](path[_0x81f7('0xf8')](config[_0x81f7('0xf9')],_0x81f7('0xf6'))));_0x556d37[_0x81f7('0x7')](_0x81f7('0xfa'),express['static'](path[_0x81f7('0xf8')](config[_0x81f7('0xf9')],_0x81f7('0xfa'))));_0x556d37[_0x81f7('0x7')]('/demo',express[_0x81f7('0xf7')](path[_0x81f7('0xf8')](config['root'],_0x81f7('0xfb'))));_0x556d37[_0x81f7('0x7')]('/snippet',express['static'](path[_0x81f7('0xf8')](config[_0x81f7('0xf9')],_0x81f7('0xfc'),_0x81f7('0xfd'))));_0x556d37[_0x81f7('0x7')]('/plugins',express[_0x81f7('0xf7')](path[_0x81f7('0xf8')](config[_0x81f7('0xf9')],_0x81f7('0xfe'))));_0x556d37[_0x81f7('0xff')](_0x81f7('0x100'))['get'](errors[0x194]);_0x556d37[_0x81f7('0xff')]('/*')[_0x81f7('0x101')](function(_0x30f62b,_0x28ccde){_0x28ccde[_0x81f7('0x102')](path['resolve'](_0x556d37[_0x81f7('0x101')]('appPath')+'/index.html'));});}; \ No newline at end of file +var _0x4aee=['./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','./api/chatQueue','/api/chat/proactive_actions','/api/cm/companies','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/interval','/api/pauses','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','./api/trigger','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intServicenowAccount','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','/api/license','./api/license','./api/migration','/api/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','snippet','1.0.15','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','path','express','express-winston','util','./config/environment','./config/logger','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','connection','remoteAddress','url','user','name','role','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','format','statusCode','responseTime','./api/user','/api/voice/chanspy'];(function(_0x1465dc,_0x4d684d){var _0x226206=function(_0x2db59e){while(--_0x2db59e){_0x1465dc['push'](_0x1465dc['shift']());}};_0x226206(++_0x4d684d);}(_0x4aee,0x1ed));var _0xe4ae=function(_0x538f63,_0x271f27){_0x538f63=_0x538f63-0x0;var _0x4c0dad=_0x4aee[_0x538f63];return _0x4c0dad;};'use strict';var path=require(_0xe4ae('0x0'));var express=require(_0xe4ae('0x1'));var ewinston=require(_0xe4ae('0x2'));var util=require(_0xe4ae('0x3'));var errors=require('./errors');var config=require(_0xe4ae('0x4'));var logger=require(_0xe4ae('0x5'))('api');var authLogger=require(_0xe4ae('0x5'))('auth');exports[_0xe4ae('0x6')]=function(_0x39448a){_0x39448a['use'](ewinston[_0xe4ae('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2db86a,_0x11d50c){return util['format'](_0xe4ae('0x8'),_0x2db86a[_0xe4ae('0x9')],_0x2db86a[_0xe4ae('0xa')]['x-forwarded-for']?_0x2db86a[_0xe4ae('0xa')]['x-forwarded-for']:_0x2db86a[_0xe4ae('0xb')][_0xe4ae('0xc')]||_0x2db86a['ip'],_0x2db86a[_0xe4ae('0xd')],_0x11d50c['statusCode'],_0x11d50c['responseTime'],_0x2db86a[_0xe4ae('0xe')]?_0x2db86a[_0xe4ae('0xe')]['id']:null,_0x2db86a['user']?_0x2db86a['user'][_0xe4ae('0xf')]:null,_0x2db86a[_0xe4ae('0xe')]?_0x2db86a[_0xe4ae('0xe')][_0xe4ae('0x10')]:null);}}));_0x39448a[_0xe4ae('0x11')](ewinston[_0xe4ae('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x1a6720,_0x2bb193){var _0x3975aa=_0xe4ae('0x12');if(_0x1a6720[_0xe4ae('0x13')]&&_0x1a6720[_0xe4ae('0x13')][_0xe4ae('0x14')]&&_0x1a6720['body'][_0xe4ae('0x15')]){_0x3975aa='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xe4ae('0x16')](_0x3975aa,_0x1a6720['method'],_0x1a6720['headers']['x-forwarded-for']?_0x1a6720[_0xe4ae('0xa')]['x-forwarded-for']:_0x1a6720[_0xe4ae('0xb')][_0xe4ae('0xc')]||_0x1a6720['ip'],_0x1a6720[_0xe4ae('0xd')],_0x2bb193[_0xe4ae('0x17')],_0x2bb193[_0xe4ae('0x18')],_0x1a6720[_0xe4ae('0xe')]?_0x1a6720[_0xe4ae('0xe')]['id']:null,_0x1a6720['user']?_0x1a6720['user'][_0xe4ae('0xf')]:null,_0x1a6720[_0xe4ae('0xe')]?_0x1a6720[_0xe4ae('0xe')][_0xe4ae('0x10')]:null,_0x1a6720['body']&&_0x1a6720[_0xe4ae('0x13')][_0xe4ae('0x14')]?_0x1a6720['body'][_0xe4ae('0x14')]:'other',_0x1a6720[_0xe4ae('0x13')]&&_0x1a6720[_0xe4ae('0x13')][_0xe4ae('0x15')]?_0x1a6720[_0xe4ae('0x13')]['agent_id']:'',_0x1a6720[_0xe4ae('0x13')]&&_0x1a6720[_0xe4ae('0x13')]['agent_name']?_0x1a6720['body']['agent_name']:'');},'ignoreRoute':function(_0x1a12a5){var _0x519b0a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x519b0a['test'](_0x1a12a5[_0xe4ae('0xd')]);}}));_0x39448a[_0xe4ae('0x11')]('/api/users',require(_0xe4ae('0x19')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x1a'),require(_0xe4ae('0x1b')));_0x39448a[_0xe4ae('0x11')]('/api/voice/contexts',require(_0xe4ae('0x1c')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x1d'),require(_0xe4ae('0x1e')));_0x39448a[_0xe4ae('0x11')]('/api/voice/mohs',require(_0xe4ae('0x1f')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x20'),require(_0xe4ae('0x21')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x22'),require(_0xe4ae('0x23')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x24'),require(_0xe4ae('0x25')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x26'),require(_0xe4ae('0x27')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x28'),require(_0xe4ae('0x29')));_0x39448a['use'](_0xe4ae('0x2a'),require(_0xe4ae('0x2b')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x2c'),require('./api/voiceDialReport'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x2d'),require(_0xe4ae('0x2e')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x2f'),require(_0xe4ae('0x30')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x31'),require(_0xe4ae('0x32')));_0x39448a[_0xe4ae('0x11')]('/api/trunks',require(_0xe4ae('0x33')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x34'),require(_0xe4ae('0x35')));_0x39448a[_0xe4ae('0x11')]('/api/mail/out_servers',require(_0xe4ae('0x36')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x37'),require(_0xe4ae('0x38')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x39'),require(_0xe4ae('0x3a')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x3b'),require(_0xe4ae('0x3c')));_0x39448a[_0xe4ae('0x11')]('/api/mail/interactions',require(_0xe4ae('0x3d')));_0x39448a[_0xe4ae('0x11')]('/api/mail/messages',require(_0xe4ae('0x3e')));_0x39448a['use'](_0xe4ae('0x3f'),require(_0xe4ae('0x40')));_0x39448a['use'](_0xe4ae('0x41'),require(_0xe4ae('0x42')));_0x39448a['use']('/api/dashboards',require(_0xe4ae('0x43')));_0x39448a[_0xe4ae('0x11')]('/api/dashboards/items',require(_0xe4ae('0x44')));_0x39448a[_0xe4ae('0x11')]('/api/fax/accounts',require('./api/faxAccount'));_0x39448a['use']('/api/fax/applications',require(_0xe4ae('0x45')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x46'),require('./api/faxInteraction'));_0x39448a['use'](_0xe4ae('0x47'),require(_0xe4ae('0x48')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x49'),require('./api/faxQueue'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x4a'),require(_0xe4ae('0x4b')));_0x39448a['use']('/api/sms/accounts',require(_0xe4ae('0x4c')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x4d'),require(_0xe4ae('0x4e')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x4f'),require(_0xe4ae('0x50')));_0x39448a[_0xe4ae('0x11')]('/api/sms/messages',require(_0xe4ae('0x51')));_0x39448a['use'](_0xe4ae('0x52'),require(_0xe4ae('0x53')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x54'),require(_0xe4ae('0x55')));_0x39448a['use'](_0xe4ae('0x56'),require(_0xe4ae('0x57')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x58'),require(_0xe4ae('0x59')));_0x39448a['use'](_0xe4ae('0x5a'),require(_0xe4ae('0x5b')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x5c'),require(_0xe4ae('0x5d')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x5e'),require(_0xe4ae('0x5f')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x60'),require(_0xe4ae('0x61')));_0x39448a['use'](_0xe4ae('0x62'),require(_0xe4ae('0x63')));_0x39448a['use']('/api/chat/interactions',require(_0xe4ae('0x64')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x65'),require(_0xe4ae('0x66')));_0x39448a[_0xe4ae('0x11')]('/api/chat/offline_messages',require(_0xe4ae('0x67')));_0x39448a[_0xe4ae('0x11')]('/api/chat/queues',require(_0xe4ae('0x68')));_0x39448a[_0xe4ae('0x11')]('/api/chat/groups',require('./api/chatGroup'));_0x39448a['use'](_0xe4ae('0x69'),require('./api/chatProactiveAction'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x6a'),require('./api/cmCompany'));_0x39448a[_0xe4ae('0x11')]('/api/cm/contacts',require(_0xe4ae('0x6b')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x6c'),require(_0xe4ae('0x6d')));_0x39448a['use'](_0xe4ae('0x6e'),require(_0xe4ae('0x6f')));_0x39448a['use'](_0xe4ae('0x70'),require('./api/cmHopperFinal'));_0x39448a['use'](_0xe4ae('0x71'),require(_0xe4ae('0x72')));_0x39448a['use'](_0xe4ae('0x73'),require(_0xe4ae('0x74')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x75'),require(_0xe4ae('0x76')));_0x39448a['use'](_0xe4ae('0x77'),require('./api/automation'));_0x39448a['use'](_0xe4ae('0x78'),require(_0xe4ae('0x79')));_0x39448a['use'](_0xe4ae('0x7a'),require('./api/disposition'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x7b'),require('./api/condition'));_0x39448a[_0xe4ae('0x11')]('/api/intervals',require(_0xe4ae('0x7c')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x7d'),require('./api/pause'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x7e'),require('./api/cdr'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x7f'),require(_0xe4ae('0x80')));_0x39448a['use'](_0xe4ae('0x81'),require(_0xe4ae('0x82')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x83'),require(_0xe4ae('0x84')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x85'),require(_0xe4ae('0x86')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x87'),require('./api/template'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x88'),require(_0xe4ae('0x89')));_0x39448a[_0xe4ae('0x11')]('/api/variables',require(_0xe4ae('0x8a')));_0x39448a['use']('/api/integrations',require(_0xe4ae('0x8b')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x8c'),require(_0xe4ae('0x8d')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x8e'),require(_0xe4ae('0x8f')));_0x39448a['use'](_0xe4ae('0x90'),require(_0xe4ae('0x91')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x92'),require(_0xe4ae('0x93')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x94'),require(_0xe4ae('0x95')));_0x39448a['use']('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x96'),require(_0xe4ae('0x97')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x98'),require(_0xe4ae('0x99')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x9a'),require('./api/intSalesforceConfiguration'));_0x39448a['use'](_0xe4ae('0x9b'),require(_0xe4ae('0x9c')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0x9d'),require(_0xe4ae('0x9e')));_0x39448a[_0xe4ae('0x11')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x39448a['use'](_0xe4ae('0x9f'),require('./api/intSugarcrmField'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xa0'),require(_0xe4ae('0xa1')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xa2'),require(_0xe4ae('0xa3')));_0x39448a[_0xe4ae('0x11')]('/api/integrations/desk/fields',require('./api/intDeskField'));_0x39448a['use'](_0xe4ae('0xa4'),require(_0xe4ae('0xa5')));_0x39448a['use'](_0xe4ae('0xa6'),require(_0xe4ae('0xa7')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xa8'),require(_0xe4ae('0xa9')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xaa'),require('./api/intZendeskAccount'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xab'),require('./api/intZendeskConfiguration'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xac'),require(_0xe4ae('0xad')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xae'),require(_0xe4ae('0xaf')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xb0'),require(_0xe4ae('0xb1')));_0x39448a['use'](_0xe4ae('0xb2'),require('./api/intFreshdeskField'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xb3'),require(_0xe4ae('0xb4')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xb5'),require(_0xe4ae('0xb6')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xb7'),require('./api/intVtigerField'));_0x39448a['use']('/api/integrations/servicenow/accounts',require(_0xe4ae('0xb8')));_0x39448a[_0xe4ae('0x11')]('/api/integrations/servicenow/configurations',require(_0xe4ae('0xb9')));_0x39448a[_0xe4ae('0x11')]('/api/integrations/servicenow/fields',require(_0xe4ae('0xba')));_0x39448a['use'](_0xe4ae('0xbb'),require(_0xe4ae('0xbc')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xbd'),require(_0xe4ae('0xbe')));_0x39448a[_0xe4ae('0x11')]('/api/integrations/dynamics365/fields',require(_0xe4ae('0xbf')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xc0'),require(_0xe4ae('0xc1')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xc2'),require('./api/chatQueueReport'));_0x39448a['use'](_0xe4ae('0xc3'),require(_0xe4ae('0xc4')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xc5'),require('./api/jscriptyAnswerReport'));_0x39448a[_0xe4ae('0x11')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x39448a[_0xe4ae('0x11')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xc6'),require('./api/smsQueueReport'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xc7'),require(_0xe4ae('0xc8')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xc9'),require(_0xe4ae('0xca')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xcb'),require(_0xe4ae('0xcc')));_0x39448a['use'](_0xe4ae('0xcd'),require(_0xe4ae('0xce')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xcf'),require(_0xe4ae('0xd0')));_0x39448a['use']('/api/square/projects',require('./api/squareProject'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xd1'),require(_0xe4ae('0xd2')));_0x39448a['use']('/api/square/messages',require(_0xe4ae('0xd3')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xd4'),require('./api/team'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xd5'),require(_0xe4ae('0xd6')));_0x39448a[_0xe4ae('0x11')]('/api/campaigns',require('./api/campaign'));_0x39448a[_0xe4ae('0x11')]('/api/migrations',require(_0xe4ae('0xd7')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xd8'),require('./api/attachment'));_0x39448a[_0xe4ae('0x11')]('/api/plugins',require(_0xe4ae('0xd9')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xda'),require(_0xe4ae('0xdb')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xdc'),require('./api/chatTransferReport'));_0x39448a['use'](_0xe4ae('0xdd'),require('./api/faxTransferReport'));_0x39448a[_0xe4ae('0x11')]('/api/openchannel/reports/transfer',require(_0xe4ae('0xde')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xdf'),require('./api/smsTransferReport'));_0x39448a[_0xe4ae('0x11')]('/api/cm/lists',require(_0xe4ae('0xe0')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xe1'),require(_0xe4ae('0xe2')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xe3'),require(_0xe4ae('0xe4')));_0x39448a['use'](_0xe4ae('0xe5'),require(_0xe4ae('0xe6')));_0x39448a['use'](_0xe4ae('0xe7'),require(_0xe4ae('0xe8')));_0x39448a[_0xe4ae('0x11')]('/api/auth/local',require('./api/authLocal'));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xe9'),require(_0xe4ae('0xea')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xeb'),require(_0xe4ae('0xec')));_0x39448a[_0xe4ae('0x11')]('/api/rpc',require(_0xe4ae('0xed')));_0x39448a['use'](_0xe4ae('0xee'),require(_0xe4ae('0xef')));_0x39448a['use'](_0xe4ae('0xf0'),require(_0xe4ae('0xf1')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xf2'),require(_0xe4ae('0xf3')));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xf4'),express[_0xe4ae('0xf5')](path[_0xe4ae('0xf6')](config[_0xe4ae('0xf7')],_0xe4ae('0xf4'))));_0x39448a['use'](_0xe4ae('0xf8'),express[_0xe4ae('0xf5')](path[_0xe4ae('0xf6')](config[_0xe4ae('0xf7')],_0xe4ae('0xf8'))));_0x39448a['use'](_0xe4ae('0xf9'),express[_0xe4ae('0xf5')](path[_0xe4ae('0xf6')](config[_0xe4ae('0xf7')],_0xe4ae('0xf9'))));_0x39448a[_0xe4ae('0x11')]('/snippet',express[_0xe4ae('0xf5')](path[_0xe4ae('0xf6')](config[_0xe4ae('0xf7')],_0xe4ae('0xfa'),_0xe4ae('0xfb'))));_0x39448a[_0xe4ae('0x11')](_0xe4ae('0xfc'),express[_0xe4ae('0xf5')](path[_0xe4ae('0xf6')](config['root'],_0xe4ae('0xfd'))));_0x39448a[_0xe4ae('0xfe')](_0xe4ae('0xff'))[_0xe4ae('0x100')](errors[0x194]);_0x39448a['route']('/*')[_0xe4ae('0x100')](function(_0x544199,_0x50bd09){_0x50bd09[_0xe4ae('0x101')](path[_0xe4ae('0x102')](_0x39448a[_0xe4ae('0x100')]('appPath')+_0xe4ae('0x103')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 91f7f3a..8e104cb 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0368=['../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','server','http','port','rpc','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','RPC\x20listening\x20on\x20','jayson/promise','bluebird','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0368,0xdf));var _0x8036=function(_0x32ee61,_0x3f1b2d){_0x32ee61=_0x32ee61-0x0;var _0x226c2f=_0x0368[_0x32ee61];return _0x226c2f;};'use strict';var jayson=require(_0x8036('0x0'));var BPromise=require(_0x8036('0x1'));var _=require('lodash');var config=require('../config/environment');exports[_0x8036('0x2')]=function(){return new BPromise(function(_0x2a61a,_0x1bd0fa){var _0x3d2dd0={};_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/user/user.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x4')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x5')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/voiceRecording/voiceRecording.rpc'));_0x3d2dd0=_['merge'](_0x3d2dd0,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x6')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x7')));_0x3d2dd0=_['merge'](_0x3d2dd0,require(_0x8036('0x8')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/trunk/trunk.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x9')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0xa')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0xb')));_0x3d2dd0=_['merge'](_0x3d2dd0,require(_0x8036('0xc')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/mailQueue/mailQueue.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0xd')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0xe')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0xf')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x10')));_0x3d2dd0=_['merge'](_0x3d2dd0,require('../api/faxAccount/faxAccount.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x11')));_0x3d2dd0=_['merge'](_0x3d2dd0,require('../api/faxInteraction/faxInteraction.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/faxMessage/faxMessage.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x12')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x13')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x14')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x15')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x16')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x17')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x3d2dd0=_['merge'](_0x3d2dd0,require(_0x8036('0x18')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x19')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x1a')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x1b')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x1c')));_0x3d2dd0=_['merge'](_0x3d2dd0,require(_0x8036('0x1d')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x1e')));_0x3d2dd0=_['merge'](_0x3d2dd0,require('../api/cmHopper/cmHopper.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x1f')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x20')));_0x3d2dd0=_['merge'](_0x3d2dd0,require(_0x8036('0x21')));_0x3d2dd0=_['merge'](_0x3d2dd0,require(_0x8036('0x22')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/sound/sound.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/template/template.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x23')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x24')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x25')));_0x3d2dd0=_['merge'](_0x3d2dd0,require(_0x8036('0x26')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x27')));_0x3d2dd0=_['merge'](_0x3d2dd0,require(_0x8036('0x28')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x29')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x2a')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x3d2dd0=_['merge'](_0x3d2dd0,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x2b')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x2c')));_0x3d2dd0=_['merge'](_0x3d2dd0,require(_0x8036('0x2d')));_0x3d2dd0=_['merge'](_0x3d2dd0,require(_0x8036('0x2e')));_0x3d2dd0=_['merge'](_0x3d2dd0,require(_0x8036('0x2f')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/squareProject/squareProject.rpc'));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require(_0x8036('0x30')));_0x3d2dd0=_[_0x8036('0x3')](_0x3d2dd0,require('../api/squareMessage/squareMessage.rpc'));_0x3d2dd0=_['merge'](_0x3d2dd0,require(_0x8036('0x31')));_0x3d2dd0=_['merge'](_0x3d2dd0,require('../api/attachment/attachment.rpc'));_0x3d2dd0=_['merge'](_0x3d2dd0,require(_0x8036('0x32')));var _0x25cb15=jayson[_0x8036('0x33')](_0x3d2dd0)[_0x8036('0x34')]();var _0x4260e0=config['rpc'][_0x8036('0x35')]||config[_0x8036('0x35')]+0x1;var _0x1c7fd4=config[_0x8036('0x36')]['ip']||'localhost';_0x25cb15['on']('error',function(_0x389ef9){return _0x1bd0fa(_0x389ef9);});_0x25cb15[_0x8036('0x2')](_0x4260e0,_0x1c7fd4,function(){console[_0x8036('0x37')](_0x8036('0x38'),_0x1c7fd4,_0x4260e0);require('../config/triggers')['default']();return _0x2a61a(_0x8036('0x39')+_0x1c7fd4+':'+_0x4260e0);});});}; \ No newline at end of file +var _0x85cc=['../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc'];(function(_0x5449e3,_0x184f95){var _0x138cd0=function(_0x1da0c0){while(--_0x1da0c0){_0x5449e3['push'](_0x5449e3['shift']());}};_0x138cd0(++_0x184f95);}(_0x85cc,0x166));var _0xc85c=function(_0x19849c,_0x41bcbe){_0x19849c=_0x19849c-0x0;var _0x2f7efd=_0x85cc[_0x19849c];return _0x2f7efd;};'use strict';var jayson=require(_0xc85c('0x0'));var BPromise=require('bluebird');var _=require('lodash');var config=require(_0xc85c('0x1'));exports[_0xc85c('0x2')]=function(){return new BPromise(function(_0xfabc93,_0x10862e){var _0x5cd657={};_0x5cd657=_['merge'](_0x5cd657,require(_0xc85c('0x3')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require('../api/voiceExtension/voiceExtension.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require('../api/voiceQueue/voiceQueue.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x5')));_0x5cd657=_['merge'](_0x5cd657,require(_0xc85c('0x6')));_0x5cd657=_['merge'](_0x5cd657,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x7')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x8')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require('../api/memberReport/memberReport.rpc'));_0x5cd657=_['merge'](_0x5cd657,require(_0xc85c('0x9')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0xa')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0xb')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0xc')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0xd')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0xe')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0xf')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x10')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x11')));_0x5cd657=_['merge'](_0x5cd657,require(_0xc85c('0x12')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require('../api/faxAccount/faxAccount.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x13')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require('../api/faxInteraction/faxInteraction.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x14')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x15')));_0x5cd657=_['merge'](_0x5cd657,require(_0xc85c('0x16')));_0x5cd657=_['merge'](_0x5cd657,require(_0xc85c('0x17')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x18')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require('../api/smsMessage/smsMessage.rpc'));_0x5cd657=_['merge'](_0x5cd657,require(_0xc85c('0x19')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x1a')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x1b')));_0x5cd657=_['merge'](_0x5cd657,require(_0xc85c('0x1c')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x1d')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require('../api/chatInteraction/chatInteraction.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x1e')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x1f')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require('../api/cmContact/cmContact.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x20')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x21')));_0x5cd657=_['merge'](_0x5cd657,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x22')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x23')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require('../api/interval/interval.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x24')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x25')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x26')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x27')));_0x5cd657=_['merge'](_0x5cd657,require('../api/variable/variable.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5cd657=_['merge'](_0x5cd657,require(_0xc85c('0x28')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x29')));_0x5cd657=_['merge'](_0x5cd657,require(_0xc85c('0x2a')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x2b')));_0x5cd657=_['merge'](_0x5cd657,require(_0xc85c('0x2c')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x2d')));_0x5cd657=_['merge'](_0x5cd657,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x5cd657=_['merge'](_0x5cd657,require(_0xc85c('0x2e')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x2f')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x30')));_0x5cd657=_['merge'](_0x5cd657,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x31')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x32')));_0x5cd657=_['merge'](_0x5cd657,require('../api/squareRecording/squareRecording.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x33')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x34')));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require('../api/attachment/attachment.rpc'));_0x5cd657=_[_0xc85c('0x4')](_0x5cd657,require(_0xc85c('0x35')));var _0x404848=jayson[_0xc85c('0x36')](_0x5cd657)[_0xc85c('0x37')]();var _0x1af0e0=config[_0xc85c('0x38')][_0xc85c('0x39')]||config['port']+0x1;var _0x51b99c=config[_0xc85c('0x38')]['ip']||_0xc85c('0x3a');_0x404848['on'](_0xc85c('0x3b'),function(_0x111900){return _0x10862e(_0x111900);});_0x404848[_0xc85c('0x2')](_0x1af0e0,_0x51b99c,function(){console[_0xc85c('0x3c')](_0xc85c('0x3d'),_0x51b99c,_0x1af0e0);require(_0xc85c('0x3e'))[_0xc85c('0x3f')]();return _0xfabc93(_0xc85c('0x40')+_0x51b99c+':'+_0x1af0e0);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 2bf8730..d8c811e 100644 --- a/server/services/agi/channel.js +++ b/server/services/agi/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa052=['WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./reply','call','setEncoding','setTimeout','utf8','emit','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','destroy','function','write','prototype','sendRequest','command','sync','answer','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20PRIORITY\x20%s','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','GOTO\x20%s\x20%s\x20%s','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','wait'];(function(_0x4df7b3,_0xc1cadb){var _0x3dd819=function(_0xcbf7df){while(--_0xcbf7df){_0x4df7b3['push'](_0x4df7b3['shift']());}};_0x3dd819(++_0xc1cadb);}(_0xa052,0x18a));var _0x2a05=function(_0x480a41,_0x5a4f55){_0x480a41=_0x480a41-0x0;var _0x848fa4=_0xa052[_0x480a41];return _0x848fa4;};'use strict';var util=require('util');var _=require(_0x2a05('0x0'));var EventEmitter=require(_0x2a05('0x1'))[_0x2a05('0x2')];var AGIReply=require(_0x2a05('0x3'));var AGIError=require('./error');function AGIChannel(_0x2c6eb7){var _0x4fadb5=this,_0x3b1669=new AGIReply(),_0x3ac9c9=![],_0x3b9138={};EventEmitter[_0x2a05('0x4')](_0x4fadb5);_0x2c6eb7[_0x2a05('0x5')]('utf8');_0x2c6eb7[_0x2a05('0x6')](0x8*0x3c*0x3c*0x3e8);_0x3b1669[_0x2a05('0x5')](_0x2a05('0x7'));_0x3b1669['on']('headers',function(_0x363d09){for(var _0x47029b in _0x363d09){_0x4fadb5[_0x47029b]=_0x363d09[_0x47029b];}_0x4fadb5[_0x2a05('0x8')]('ready');});_0x3b1669['on'](_0x2a05('0x9'),function(_0x2b9616){if(_0x2b9616[_0x2a05('0xa')]()==_0x2a05('0xb')){_0x4fadb5[_0x2a05('0x8')](_0x2a05('0xb'));return;}if(_0x2b9616[_0x2a05('0xc')](0x0,0xb)==_0x2a05('0xd')){_0x3ac9c9=!![];}if(_0x3ac9c9){_0x3b9138['rx']+=_0x2b9616+'\x0a';if(_0x2b9616[_0x2a05('0xe')](_0x2a05('0xf'))!=-0x1){_0x3ac9c9=![];}}else{_0x3b9138['rx']=_0x2b9616;}if(_0x3ac9c9){return;}if(typeof _0x3b9138['cb']=='function'){var _0x51f714=_0x3b9138['rx'][_0x2a05('0xc')](0x0,0x3),_0x59fbc2=null,_0x3a7fcf=null;_0x51f714=parseInt(_0x51f714);if(isNaN(_0x51f714)){_0x3b9138['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x2a05('0x10')});return;}if(_0x51f714!=0xc8){_0x3b9138['cb'](null,{'code':_0x51f714,'result':-0x1,'extra':'KO'});return;}_0x59fbc2=_0x3b9138['rx']['substring'](0x4)['replace'](_0x2a05('0x11'),'');if(_0x59fbc2['indexOf']('\x20')!=-0x1){_0x59fbc2=_0x59fbc2['substr'](0x0,_0x59fbc2[_0x2a05('0x12')]('\x20'));}if(_[_0x2a05('0x13')](_0x59fbc2,'-1')){_0x59fbc2=parseInt(_0x59fbc2);}_0x3a7fcf=_0x3b9138['rx'][_0x2a05('0x14')]('\x20');if(_0x3a7fcf['length']==0x3){_0x3a7fcf=_0x3a7fcf[0x2][_0x2a05('0xc')](0x1,_0x3a7fcf[0x2][_0x2a05('0x15')]-0x1);}else if(_0x3a7fcf[_0x2a05('0x15')]>0x3){var _0xee6a2a=/\((.+)\)/;var _0x196d26=_0x3b9138['rx'][_0x2a05('0x16')](_0xee6a2a);if(_0x196d26){_0x3a7fcf=_0x196d26[0x1];}else{_0x3a7fcf=null;}}else{_0x3a7fcf=null;}_0x3b9138['cb'](null,{'code':_0x51f714,'result':_0x59fbc2,'extra':_0x3a7fcf});}});_0x2c6eb7['on'](_0x2a05('0x17'),function(_0x2cfe76){_0x4fadb5[_0x2a05('0x8')]('error',new AGIError(_0x2a05('0x18'),_0x2cfe76[_0x2a05('0x19')]));});_0x2c6eb7['on'](_0x2a05('0x1a'),function(){_0x4fadb5[_0x2a05('0x8')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x2c6eb7['on'](_0x2a05('0x1b'),function(){_0x4fadb5[_0x2a05('0x8')](_0x2a05('0x1b'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2c6eb7[_0x2a05('0x1c')]();});_0x2c6eb7['pipe'](_0x3b1669);this['command']=function(_0x40f0bc,_0x2aebee){var _0x40f0bc=_0x40f0bc||'',_0x2aebee=typeof _0x2aebee==_0x2a05('0x1d')?_0x2aebee:new Function();_0x3b9138={'tx':_0x40f0bc,'rx':'','cb':_0x2aebee};_0x2c6eb7[_0x2a05('0x1e')](_0x40f0bc+'\x0a');},this[_0x2a05('0x1a')]=function(){_0x2c6eb7['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x2a05('0x1f')][_0x2a05('0x20')]=function(_0x55d20f){return this[_0x2a05('0x21')][_0x2a05('0x22')](this,_0x55d20f);};AGIChannel[_0x2a05('0x1f')][_0x2a05('0x23')]=function(){return this[_0x2a05('0x20')]('ANSWER');};AGIChannel[_0x2a05('0x1f')][_0x2a05('0x24')]=function(_0x3ba42d,_0x1da822,_0x1c93b3){_0x3ba42d=_0x3ba42d===undefined?'beep':_0x3ba42d;_0x1da822=_0x1da822===undefined?'5':_0x1da822;_0x1c93b3=_0x1c93b3===undefined?'1':_0x1c93b3;return this[_0x2a05('0x20')](util[_0x2a05('0x25')](_0x2a05('0x26'),_0x3ba42d,_0x1da822*0x3e8,_0x1c93b3));};AGIChannel[_0x2a05('0x1f')][_0x2a05('0x27')]=function(_0x411ac8){_0x411ac8=_0x411ac8||'NO\x20MESSAGE';return this[_0x2a05('0x20')](util['format']('VERBOSE\x20\x22%s\x22',_0x411ac8));};AGIChannel['prototype'][_0x2a05('0x28')]=function(_0x2e65aa,_0xc7ab59){if(_[_0x2a05('0x29')](_0xc7ab59)){return this[_0x2a05('0x20')](util[_0x2a05('0x25')](_0x2a05('0x2a'),_0x2e65aa,_0xc7ab59[_0x2a05('0x2b')](',')));}return this['sendRequest'](util['format'](_0x2a05('0x2a'),_0x2e65aa,_0xc7ab59));};AGIChannel[_0x2a05('0x1f')][_0x2a05('0x2c')]=function(_0x5ec374){return this[_0x2a05('0x20')](util[_0x2a05('0x25')]('SET\x20CONTEXT\x20%s',_0x5ec374));};AGIChannel[_0x2a05('0x1f')][_0x2a05('0x2d')]=function(_0x785cb8){return this[_0x2a05('0x20')](util['format']('SET\x20EXTENSION\x20%s',_0x785cb8));};AGIChannel[_0x2a05('0x1f')]['setPriority']=function(_0x1d2aa6){return this[_0x2a05('0x20')](util['format'](_0x2a05('0x2e'),_0x1d2aa6));};AGIChannel['prototype'][_0x2a05('0xb')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x2a05('0x1f')][_0x2a05('0x2f')]=function(_0x55dc74,_0x15723d){return this[_0x2a05('0x20')](util[_0x2a05('0x25')](_0x2a05('0x30'),_0x55dc74,_0x15723d?_0x15723d[_0x2a05('0x31')]()[_0x2a05('0x32')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x2a05('0x1f')][_0x2a05('0x33')]=function(_0x50b10b,_0x45a6de){return this[_0x2a05('0x20')](util[_0x2a05('0x25')](_0x2a05('0x34'),_0x50b10b,_0x45a6de));};AGIChannel[_0x2a05('0x1f')][_0x2a05('0x35')]=function(_0x3cd309,_0x5c4cea){return this[_0x2a05('0x20')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x3cd309,_0x5c4cea));};AGIChannel['prototype']['sayPhonetic']=function(_0x1c79db,_0x29ba12){return this[_0x2a05('0x20')](util[_0x2a05('0x25')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x1c79db,_0x29ba12));};AGIChannel[_0x2a05('0x1f')]['continueAt']=function(_0x17d757,_0x54748e,_0x3475b6){_0x54748e=_0x54748e||this['extension'];_0x3475b6=_0x3475b6||0x1;this[_0x2a05('0x2c')](_0x17d757);this[_0x2a05('0x2d')](_0x54748e);this['setPriority'](_0x3475b6);return this['noop'](util['format'](_0x2a05('0x36'),_0x17d757,_0x54748e,_0x3475b6));};AGIChannel[_0x2a05('0x1f')]['getVariable']=function(_0x34a78b){return this[_0x2a05('0x20')](util[_0x2a05('0x25')]('GET\x20VARIABLE\x20\x22%s\x22',_0x34a78b));};AGIChannel[_0x2a05('0x1f')][_0x2a05('0x37')]=function(_0x15c627,_0x5ab375,_0x201175,_0x408934,_0x48f1b6,_0x328811){_0x5ab375=_0x5ab375||_0x2a05('0x38');_0x201175=_0x201175||'';_0x408934=_0x408934===undefined?-0x1:_0x408934==='-1'?-0x1:_0x408934*0x3e8;_0x48f1b6=_0x48f1b6===undefined?'':'s='+_0x48f1b6;_0x328811=_0x328811?'BEEP':'';return this['sendRequest'](util[_0x2a05('0x25')](_0x2a05('0x39'),_0x15c627,_0x5ab375,_0x201175,_0x408934,_0x328811,_0x48f1b6));};AGIChannel['prototype'][_0x2a05('0x3a')]=function(_0x188572,_0x1f18a5){_0x1f18a5=_0x1f18a5||'';return this[_0x2a05('0x20')](util[_0x2a05('0x25')](_0x2a05('0x3b'),_0x188572,_0x1f18a5));};AGIChannel[_0x2a05('0x1f')]['agi']=function(_0x3ec72c){return this[_0x2a05('0x28')]('AGI',_0x3ec72c);};AGIChannel[_0x2a05('0x1f')][_0x2a05('0x3c')]=function(_0xd7dda9){return this['exec'](_0x2a05('0x3d'),_0xd7dda9);};AGIChannel[_0x2a05('0x1f')][_0x2a05('0x17')]=function(_0x25c184,_0x49c237){this[_0x2a05('0x27')](util[_0x2a05('0x25')](_0x2a05('0x3e'),_0x25c184['id'],_0x25c184[_0x2a05('0x3f')],_0x49c237));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2a05('0x40')]=AGIChannel; \ No newline at end of file +var _0x4366=['prototype','sendRequest','command','sync','answer','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','join','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','util','lodash','events','EventEmitter','./error','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf','substr','startsWith','split','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write'];(function(_0x1fb2de,_0x18556b){var _0x3d5c73=function(_0x2b16b2){while(--_0x2b16b2){_0x1fb2de['push'](_0x1fb2de['shift']());}};_0x3d5c73(++_0x18556b);}(_0x4366,0xf8));var _0x6436=function(_0x15b950,_0x2e8f7e){_0x15b950=_0x15b950-0x0;var _0xcee399=_0x4366[_0x15b950];return _0xcee399;};'use strict';var util=require(_0x6436('0x0'));var _=require(_0x6436('0x1'));var EventEmitter=require(_0x6436('0x2'))[_0x6436('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x6436('0x4'));function AGIChannel(_0x12684e){var _0x3c7960=this,_0x1a89f2=new AGIReply(),_0x502181=![],_0x3de433={};EventEmitter['call'](_0x3c7960);_0x12684e['setEncoding'](_0x6436('0x5'));_0x12684e[_0x6436('0x6')](0x8*0x3c*0x3c*0x3e8);_0x1a89f2['setEncoding'](_0x6436('0x5'));_0x1a89f2['on']('headers',function(_0x39070){for(var _0x4f9583 in _0x39070){_0x3c7960[_0x4f9583]=_0x39070[_0x4f9583];}_0x3c7960[_0x6436('0x7')](_0x6436('0x8'));});_0x1a89f2['on'](_0x6436('0x9'),function(_0x1e4671){if(_0x1e4671[_0x6436('0xa')]()=='hangup'){_0x3c7960['emit'](_0x6436('0xb'));return;}if(_0x1e4671[_0x6436('0xc')](0x0,0xb)=='520-Invalid'){_0x502181=!![];}if(_0x502181){_0x3de433['rx']+=_0x1e4671+'\x0a';if(_0x1e4671[_0x6436('0xd')](_0x6436('0xe'))!=-0x1){_0x502181=![];}}else{_0x3de433['rx']=_0x1e4671;}if(_0x502181){return;}if(typeof _0x3de433['cb']==_0x6436('0xf')){var _0x61d878=_0x3de433['rx'][_0x6436('0xc')](0x0,0x3),_0x4e9fda=null,_0x2af439=null;_0x61d878=parseInt(_0x61d878);if(isNaN(_0x61d878)){_0x3de433['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6436('0x10')});return;}if(_0x61d878!=0xc8){_0x3de433['cb'](null,{'code':_0x61d878,'result':-0x1,'extra':'KO'});return;}_0x4e9fda=_0x3de433['rx']['substring'](0x4)['replace'](_0x6436('0x11'),'');if(_0x4e9fda[_0x6436('0x12')]('\x20')!=-0x1){_0x4e9fda=_0x4e9fda[_0x6436('0x13')](0x0,_0x4e9fda[_0x6436('0x12')]('\x20'));}if(_[_0x6436('0x14')](_0x4e9fda,'-1')){_0x4e9fda=parseInt(_0x4e9fda);}_0x2af439=_0x3de433['rx'][_0x6436('0x15')]('\x20');if(_0x2af439[_0x6436('0x16')]==0x3){_0x2af439=_0x2af439[0x2][_0x6436('0xc')](0x1,_0x2af439[0x2][_0x6436('0x16')]-0x1);}else if(_0x2af439['length']>0x3){var _0x4bff37=/\((.+)\)/;var _0x45238d=_0x3de433['rx'][_0x6436('0x17')](_0x4bff37);if(_0x45238d){_0x2af439=_0x45238d[0x1];}else{_0x2af439=null;}}else{_0x2af439=null;}_0x3de433['cb'](null,{'code':_0x61d878,'result':_0x4e9fda,'extra':_0x2af439});}});_0x12684e['on'](_0x6436('0x18'),function(_0x3bdc6f){_0x3c7960[_0x6436('0x7')](_0x6436('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x3bdc6f['code']));});_0x12684e['on']('close',function(){_0x3c7960[_0x6436('0x7')](_0x6436('0x19'),new AGIError(_0x6436('0x1a')));});_0x12684e['on'](_0x6436('0x1b'),function(){_0x3c7960['emit'](_0x6436('0x1b'),new AGIError(_0x6436('0x1c')));_0x12684e[_0x6436('0x1d')]();});_0x12684e[_0x6436('0x1e')](_0x1a89f2);this['command']=function(_0x1f8d9f,_0x47c3bd){var _0x1f8d9f=_0x1f8d9f||'',_0x47c3bd=typeof _0x47c3bd==_0x6436('0xf')?_0x47c3bd:new Function();_0x3de433={'tx':_0x1f8d9f,'rx':'','cb':_0x47c3bd};_0x12684e[_0x6436('0x1f')](_0x1f8d9f+'\x0a');},this[_0x6436('0x19')]=function(){_0x12684e[_0x6436('0x1d')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x6436('0x20')][_0x6436('0x21')]=function(_0x3fcf77){return this[_0x6436('0x22')][_0x6436('0x23')](this,_0x3fcf77);};AGIChannel[_0x6436('0x20')][_0x6436('0x24')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x6436('0x20')][_0x6436('0x25')]=function(_0x4f6d7e,_0x337e87,_0x2a467e){_0x4f6d7e=_0x4f6d7e===undefined?'beep':_0x4f6d7e;_0x337e87=_0x337e87===undefined?'5':_0x337e87;_0x2a467e=_0x2a467e===undefined?'1':_0x2a467e;return this[_0x6436('0x21')](util[_0x6436('0x26')](_0x6436('0x27'),_0x4f6d7e,_0x337e87*0x3e8,_0x2a467e));};AGIChannel[_0x6436('0x20')][_0x6436('0x28')]=function(_0x9b2b3b){_0x9b2b3b=_0x9b2b3b||_0x6436('0x29');return this[_0x6436('0x21')](util[_0x6436('0x26')](_0x6436('0x2a'),_0x9b2b3b));};AGIChannel['prototype'][_0x6436('0x2b')]=function(_0x7f3d8e,_0x21102a){if(_['isArray'](_0x21102a)){return this[_0x6436('0x21')](util[_0x6436('0x26')]('EXEC\x20%s\x20%s',_0x7f3d8e,_0x21102a[_0x6436('0x2c')](',')));}return this[_0x6436('0x21')](util[_0x6436('0x26')](_0x6436('0x2d'),_0x7f3d8e,_0x21102a));};AGIChannel[_0x6436('0x20')]['setContext']=function(_0x541146){return this[_0x6436('0x21')](util[_0x6436('0x26')](_0x6436('0x2e'),_0x541146));};AGIChannel['prototype'][_0x6436('0x2f')]=function(_0x31400a){return this[_0x6436('0x21')](util['format']('SET\x20EXTENSION\x20%s',_0x31400a));};AGIChannel[_0x6436('0x20')][_0x6436('0x30')]=function(_0x22e235){return this[_0x6436('0x21')](util[_0x6436('0x26')](_0x6436('0x31'),_0x22e235));};AGIChannel[_0x6436('0x20')][_0x6436('0xb')]=function(){return this['sendRequest'](_0x6436('0x32'));};AGIChannel['prototype'][_0x6436('0x33')]=function(_0x5b334b,_0x1504d9){return this['sendRequest'](util[_0x6436('0x26')](_0x6436('0x34'),_0x5b334b,_0x1504d9?_0x1504d9[_0x6436('0x35')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x6436('0x20')][_0x6436('0x36')]=function(_0x2c4d21,_0x21bd57){return this['sendRequest'](util['format'](_0x6436('0x37'),_0x2c4d21,_0x21bd57));};AGIChannel[_0x6436('0x20')][_0x6436('0x38')]=function(_0x16632d,_0x5c7294){return this[_0x6436('0x21')](util[_0x6436('0x26')]('SAY\x20DIGITS\x20%s\x20%s',_0x16632d,_0x5c7294));};AGIChannel[_0x6436('0x20')][_0x6436('0x39')]=function(_0x504a52,_0x35806b){return this[_0x6436('0x21')](util[_0x6436('0x26')](_0x6436('0x3a'),_0x504a52,_0x35806b));};AGIChannel[_0x6436('0x20')][_0x6436('0x3b')]=function(_0xe637f6,_0x69a5ab,_0x29a8aa){_0x69a5ab=_0x69a5ab||this[_0x6436('0x3c')];_0x29a8aa=_0x29a8aa||0x1;this[_0x6436('0x3d')](_0xe637f6);this[_0x6436('0x2f')](_0x69a5ab);this[_0x6436('0x30')](_0x29a8aa);return this[_0x6436('0x28')](util['format']('GOTO\x20%s\x20%s\x20%s',_0xe637f6,_0x69a5ab,_0x29a8aa));};AGIChannel[_0x6436('0x20')]['getVariable']=function(_0x3a5890){return this['sendRequest'](util[_0x6436('0x26')](_0x6436('0x3e'),_0x3a5890));};AGIChannel[_0x6436('0x20')]['recordFile']=function(_0x22a98e,_0x1d531e,_0x245401,_0x2876da,_0x13b270,_0x383307){_0x1d531e=_0x1d531e||_0x6436('0x3f');_0x245401=_0x245401||'';_0x2876da=_0x2876da===undefined?-0x1:_0x2876da==='-1'?-0x1:_0x2876da*0x3e8;_0x13b270=_0x13b270===undefined?'':'s='+_0x13b270;_0x383307=_0x383307?_0x6436('0x40'):'';return this[_0x6436('0x21')](util[_0x6436('0x26')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x22a98e,_0x1d531e,_0x245401,_0x2876da,_0x383307,_0x13b270));};AGIChannel['prototype'][_0x6436('0x41')]=function(_0x59b853,_0x180c54){_0x180c54=_0x180c54||'';return this['sendRequest'](util['format'](_0x6436('0x42'),_0x59b853,_0x180c54));};AGIChannel['prototype'][_0x6436('0x43')]=function(_0x3e8c33){return this[_0x6436('0x2b')]('AGI',_0x3e8c33);};AGIChannel[_0x6436('0x20')][_0x6436('0x44')]=function(_0xef7ae8){return this[_0x6436('0x2b')](_0x6436('0x45'),_0xef7ae8);};AGIChannel['prototype'][_0x6436('0x18')]=function(_0x17cc5b,_0x39d3f1){this[_0x6436('0x28')](util[_0x6436('0x26')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x17cc5b['id'],_0x17cc5b['label'],_0x39d3f1));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 5dab996..d0f91e2 100644 --- a/server/services/agi/error.js +++ b/server/services/agi/error.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36aa=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x46bb87,_0x5a88fa){var _0x304cdc=function(_0x277021){while(--_0x277021){_0x46bb87['push'](_0x46bb87['shift']());}};_0x304cdc(++_0x5a88fa);}(_0x36aa,0x170));var _0xa36a=function(_0x3c7ad7,_0x35653c){_0x3c7ad7=_0x3c7ad7-0x0;var _0x66d5b0=_0x36aa[_0x3c7ad7];return _0x66d5b0;};'use strict';var util=require(_0xa36a('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xa36a('0x1'),'E_AGI_SERVER_ERROR':_0xa36a('0x2'),'E_AGI_SERVER_CLOSE':_0xa36a('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xa36a('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xa36a('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa36a('0x6'),'E_AGI_IVR_ENTRY':_0xa36a('0x7')};function AGIError(_0x59f262){var _0x59f262=_0x59f262||null,_0x32a4bc=_0x32a4bc||[],_0x27fbfc=0x1,_0x577ec4='';if(!error[_0x59f262]){_0x59f262=_0xa36a('0x8');}_0x32a4bc[_0xa36a('0x9')](error[_0x59f262]);while(arguments[_0x27fbfc]){_0x32a4bc[_0xa36a('0x9')](arguments[_0x27fbfc]);_0x27fbfc++;}_0x577ec4=util[_0xa36a('0xa')][_0xa36a('0xb')](util,_0x32a4bc);this[_0xa36a('0xc')]=_0x577ec4;this[_0xa36a('0xd')]=_0x59f262;}module[_0xa36a('0xe')]=AGIError; \ No newline at end of file +var _0x2904=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x4ef0bc,_0x95c3c4){var _0x16400b=function(_0xdc6a77){while(--_0xdc6a77){_0x4ef0bc['push'](_0x4ef0bc['shift']());}};_0x16400b(++_0x95c3c4);}(_0x2904,0x137));var _0x4290=function(_0x46a222,_0x42ab30){_0x46a222=_0x46a222-0x0;var _0x1f41f9=_0x2904[_0x46a222];return _0x1f41f9;};'use strict';var util=require(_0x4290('0x0'));var error={'E_AGI_UNDEFINED':_0x4290('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x4290('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x4290('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x4290('0x4'),'E_AGI_SOCKET_ERROR':_0x4290('0x5'),'E_AGI_SOCKET_CLOSE':_0x4290('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x4290('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x4290('0x8'),'E_AGI_IVR_ENTRY':_0x4290('0x9')};function AGIError(_0x2c44ab){var _0x2c44ab=_0x2c44ab||null,_0x4b1476=_0x4b1476||[],_0x5a4ac4=0x1,_0x50248b='';if(!error[_0x2c44ab]){_0x2c44ab=_0x4290('0xa');}_0x4b1476['push'](error[_0x2c44ab]);while(arguments[_0x5a4ac4]){_0x4b1476[_0x4290('0xb')](arguments[_0x5a4ac4]);_0x5a4ac4++;}_0x50248b=util[_0x4290('0xc')]['apply'](util,_0x4b1476);this[_0x4290('0xd')]=_0x50248b;this[_0x4290('0xe')]=_0x2c44ab;}module[_0x4290('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index c17e118..7c97271 100644 --- a/server/services/agi/graph/index.js +++ b/server/services/agi/graph/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b0f=['edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','vswitch','target','default','agicommand','invalid','default\x20on\x20switch\x20not\x20found','exports','../../../config/logger','agi','menu','getsecretdigits','vertices'];(function(_0x58a46e,_0x3f3278){var _0x1aa593=function(_0x415a3c){while(--_0x415a3c){_0x58a46e['push'](_0x58a46e['shift']());}};_0x1aa593(++_0x3f3278);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x4366e3,_0x53f422){_0x4366e3=_0x4366e3-0x0;var _0x189d11=_0x4b0f[_0x4366e3];return _0x189d11;};'use strict';var _=require('lodash');var logger=require(_0xf4b0('0x0'))(_0xf4b0('0x1'));var verticesWithRetry=[_0xf4b0('0x2'),'getdigits',_0xf4b0('0x3')];var Graph=function(){this[_0xf4b0('0x4')]={};this[_0xf4b0('0x5')]={};this[_0xf4b0('0x6')]=0x0;};Graph[_0xf4b0('0x7')][_0xf4b0('0x8')]=function(_0x3c0f87){this[_0xf4b0('0x4')][_0x3c0f87['id']]=_0x3c0f87;this[_0xf4b0('0x5')][_0x3c0f87['id']]=[];};Graph[_0xf4b0('0x7')][_0xf4b0('0x9')]=function(_0x35160f,_0x3a2236,_0xd132d8){this[_0xf4b0('0x5')][_0x35160f][_0xf4b0('0xa')]({'target':_0x3a2236,'condition':_0xd132d8});this['numberOfEdges']+=0x1;};Graph[_0xf4b0('0x7')][_0xf4b0('0xb')]=function(){return _[_0xf4b0('0xb')](this[_0xf4b0('0x4')]);};Graph[_0xf4b0('0x7')][_0xf4b0('0xc')]=function(){return this[_0xf4b0('0x6')];};Graph[_0xf4b0('0x7')][_0xf4b0('0xd')]=function(_0x16bd65){return this[_0xf4b0('0x4')][_0x16bd65];};Graph[_0xf4b0('0x7')][_0xf4b0('0xe')]=function(_0x12480f,_0x86a245){if(!this[_0xf4b0('0x4')][_0x12480f]){return logger[_0xf4b0('0xf')](_0xf4b0('0x10'));}var _0x3aa005=_0x86a245(this[_0xf4b0('0x4')][_0x12480f]);if(!_0x3aa005){return logger[_0xf4b0('0xf')](_0xf4b0('0x11'));}if(this['edges'][_0x12480f][_0xf4b0('0x12')]===0x0){return logger[_0xf4b0('0xf')](_0xf4b0('0x13'));}for(var _0x54991b=0x0,_0x252835=[],_0x1f2d74=![];_0x54991b\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./vertices','127.0.0.1','nextTick','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','port','name','message','error','[%s]\x20%s','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','getSquareProject','then','createSquareReport','catch','indexOf','agi_','substring','inspect','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','evtHangup'];(function(_0x1dc45f,_0x318b0e){var _0x127202=function(_0x27bd10){while(--_0x27bd10){_0x1dc45f['push'](_0x1dc45f['shift']());}};_0x127202(++_0x318b0e);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var parser=require(_0x7fd8('0x0'));var _=require(_0x7fd8('0x1'));var syncho=require(_0x7fd8('0x2'));var util=require(_0x7fd8('0x3'));var moment=require(_0x7fd8('0x4'));var config=require(_0x7fd8('0x5'));var logger=require(_0x7fd8('0x6'))(_0x7fd8('0x7'));var utilLicense=require(_0x7fd8('0x8'));var rpc=require(_0x7fd8('0x9'));var mailRpc=require(_0x7fd8('0xa'));var Graph=require('./graph');var Vertices=require(_0x7fd8('0xb'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x7fd8('0x7')]=_['defaults'](config[_0x7fd8('0x7')],{'ip':_0x7fd8('0xc'),'port':0x11dd});function connectionHandler(_0x2e2d74){process[_0x7fd8('0xd')](function(){syncho(function(){try{setChannelVariables(_0x2e2d74);agiHandler(_0x2e2d74);}catch(_0x469c2f){logger['error'](_0x469c2f[_0x7fd8('0xe')]);}});});}function listeningHandler(){console[_0x7fd8('0xf')](_0x7fd8('0x10'),config['agi']['port']);logger['info'](util[_0x7fd8('0x11')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x7fd8('0x7')]['ip'],config[_0x7fd8('0x7')][_0x7fd8('0x12')]));}function errorHandler(_0x566901){if(_0x566901&&_0x566901[_0x7fd8('0x13')]&&_0x566901[_0x7fd8('0x14')]){logger[_0x7fd8('0x15')](util[_0x7fd8('0x11')](_0x7fd8('0x16'),_0x566901['name'],_0x566901[_0x7fd8('0x14')]));}else{logger[_0x7fd8('0x15')](util[_0x7fd8('0x11')](_0x7fd8('0x17'),_0x566901[_0x7fd8('0xe')]));}}function closeHandler(){logger[_0x7fd8('0x18')](util[_0x7fd8('0x11')](_0x7fd8('0x19'),this[_0x7fd8('0x1a')],this[_0x7fd8('0x1b')],this[_0x7fd8('0x1c')],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x5ca7f6){logger[_0x7fd8('0x15')](_0x5ca7f6[_0x7fd8('0xe')]);}}function timeoutHandler(){logger['info'](util[_0x7fd8('0x11')](_0x7fd8('0x1d'),this[_0x7fd8('0x1a')],this[_0x7fd8('0x1b')],this[_0x7fd8('0x1c')],this[_0x7fd8('0x1e')],this[_0x7fd8('0x1f')]));}function hangupHandler(){logger[_0x7fd8('0x18')](util['format'](_0x7fd8('0x20'),this[_0x7fd8('0x1a')],this[_0x7fd8('0x1b')],this[_0x7fd8('0x1c')],this[_0x7fd8('0x1e')],this[_0x7fd8('0x1f')]));this['evtHangup']=!![];}function getRoot(_0xecd3f3){return parser[_0x7fd8('0x21')](_0xecd3f3,{'object':!![]})[_0x7fd8('0x22')][_0x7fd8('0x23')];}function addVertex(_0x52b71a,_0x3f71a4,_0x402fa1){_0x3f71a4[_0x7fd8('0x24')]=_0x402fa1;if(_0x3f71a4[_0x7fd8('0x25')](_0x7fd8('0x26'))){_0x3f71a4['maxRetry']=parseInt(_0x3f71a4['retry'],0xa);}_0x52b71a[_0x7fd8('0x27')](_[_0x7fd8('0x28')](_0x3f71a4,_0x7fd8('0x29')));}function initGraph(_0xd8168f,_0x17b86a){var _0x50f34f=new Graph();for(var _0x12bc21 in _0xd8168f){if(_0xd8168f[_0x7fd8('0x25')](_0x12bc21)){if(_[_0x7fd8('0x2a')](_0xd8168f[_0x12bc21])){for(var _0x40b79b=0x0;_0x40b79b<_0xd8168f[_0x12bc21][_0x7fd8('0x2b')];_0x40b79b+=0x1){addVertex(_0x50f34f,_0xd8168f[_0x12bc21][_0x40b79b],_0x12bc21);}}else{addVertex(_0x50f34f,_0xd8168f[_0x12bc21],_0x12bc21);}}}for(var _0x52e1ed=0x0;_0x52e1ed<_0x17b86a['length'];_0x52e1ed+=0x1){if(_0x17b86a[_0x52e1ed][_0x7fd8('0x2c')]&&_0x17b86a[_0x52e1ed][_0x7fd8('0x2d')]){_0x50f34f[_0x7fd8('0x2e')](_0x17b86a[_0x52e1ed][_0x7fd8('0x2c')],_0x17b86a[_0x52e1ed]['target'],_0x17b86a[_0x52e1ed]['value']);}}return _0x50f34f;}function getSquareProject(_0x8f9a8e,_0x5d439b){rpc[_0x7fd8('0x2f')](_0x8f9a8e)[_0x7fd8('0x30')](function(_0x3df0a2){_0x5d439b(null,_0x3df0a2);})['catch'](function(_0x28e28e){_0x5d439b(null,_0x28e28e);});}function createSquareReport(_0x5a3937,_0x10f56e){rpc[_0x7fd8('0x31')](_0x5a3937)[_0x7fd8('0x30')](function(_0x43ca67){if(_0x10f56e){_0x10f56e(null,_0x43ca67);}})[_0x7fd8('0x32')](function(_0x175c37){if(_0x10f56e){_0x10f56e(null,_0x175c37);}});}function setChannelVariables(_0x33dd4e){for(var _0x5212d3 in _0x33dd4e){if(_0x33dd4e[_0x7fd8('0x25')](_0x5212d3)){if(_0x5212d3[_0x7fd8('0x33')](_0x7fd8('0x34'))===0x0){_0x33dd4e[_0x5212d3[_0x7fd8('0x35')](0x4)]=_0x33dd4e[_0x5212d3];delete _0x33dd4e[_0x5212d3];}}}}function getLogFromObject(_0x4710d4){return util[_0x7fd8('0x36')](_0x4710d4,{'showHidden':![],'depth':null});}function agiHandler(_0x3837cd){var _0x3000a1,_0x4a66a8,_0x5d9f5b,_0x41c3be,_0x23b13f;logger[_0x7fd8('0x37')]('variables',JSON[_0x7fd8('0x38')](_0x3837cd,null,0x2));logger['info'](util['format'](_0x7fd8('0x39'),_0x3837cd[_0x7fd8('0x1a')],_0x3837cd[_0x7fd8('0x1b')],_0x3837cd[_0x7fd8('0x1c')],_0x3837cd[_0x7fd8('0x1e')],_0x3837cd[_0x7fd8('0x1f')]));_0x3837cd['on'](_0x7fd8('0x15'),errorHandler);_0x3837cd['on'](_0x7fd8('0x3a'),closeHandler);_0x3837cd['on']('timeout',timeoutHandler);_0x3837cd[_0x7fd8('0x3b')]=![];_0x3837cd['on']('hangup',hangupHandler);var _0x5e6231=getSquareProject[_0x7fd8('0x3c')](null,_0x3837cd['arg_1']);if(_0x5e6231){if(_0x5e6231['production']){_0x3000a1=getRoot(_0x5e6231['production']);if(_0x3000a1&&_0x3000a1[_0x7fd8('0x3d')]){logger[_0x7fd8('0x37')]('root',JSON[_0x7fd8('0x38')](_0x3000a1,null,0x2));_0x3837cd[_0x7fd8('0x3e')]=moment()[_0x7fd8('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a66a8=initGraph(_['omit'](_0x3000a1,'mxCell'),_0x3000a1[_0x7fd8('0x29')]);_0x5d9f5b=new Vertices(_0x3837cd,rpc,mailRpc);logger[_0x7fd8('0x18')](util[_0x7fd8('0x11')](_0x7fd8('0x3f'),_0x3837cd[_0x7fd8('0x1a')],_0x3837cd[_0x7fd8('0x1b')],_0x3837cd[_0x7fd8('0x1c')],_0x3837cd['dnid'],_0x3837cd['uniqueid']));_0x4a66a8['traverseBFS'](_0x3000a1[_0x7fd8('0x3d')]['id'],function(_0x24a0f8){try{_0x24a0f8=_0x5d9f5b[_0x7fd8('0x40')](_0x24a0f8);logger['debug'](_0x7fd8('0x41'),JSON[_0x7fd8('0x38')](_0x24a0f8,null,0x2));if(_0x24a0f8[_0x7fd8('0x24')]===_0x7fd8('0x42')){logger['info'](_0x7fd8('0x43'));_0x3837cd[_0x7fd8('0x44')]=_0x24a0f8['context']||_0x3837cd[_0x7fd8('0x44')];_0x3837cd['extension']=_0x24a0f8[_0x7fd8('0x45')];_0x3837cd[_0x7fd8('0x46')]=_0x24a0f8[_0x7fd8('0x46')]?_0x24a0f8[_0x7fd8('0x46')]-0x1:0x1;return null;}else if(_0x24a0f8&&_0x5d9f5b[_0x24a0f8['agicommand']]){_0x23b13f=_0x5d9f5b[_0x24a0f8[_0x7fd8('0x24')]](_0x24a0f8);logger[_0x7fd8('0x18')](_0x7fd8('0x47'),JSON[_0x7fd8('0x38')](_0x23b13f,null,0x2));if(_0x23b13f&&_0x23b13f[_0x7fd8('0x48')]===AGI_CODE_SUCCESS&&_0x23b13f[_0x7fd8('0x49')]!==AGI_RESULT_ERROR&&!_0x3837cd['evtHangup']){logger['debug']('response',getLogFromObject(_0x23b13f));return _[_0x7fd8('0x4a')](_0x23b13f[_0x7fd8('0x49')])?null:_0x23b13f['result']['toString']();}else{logger[_0x7fd8('0x15')](_0x7fd8('0x47'),getLogFromObject(_0x23b13f));return null;}}else{logger['error'](_0x7fd8('0x4b'));return null;}}catch(_0x2eb631){logger[_0x7fd8('0x15')](_0x2eb631['stack']);return null;}});if(_0x3000a1[_0x7fd8('0x4c')]){logger[_0x7fd8('0x18')](util['format'](_0x7fd8('0x4d'),_0x3837cd['arg_1'],_0x3837cd[_0x7fd8('0x1b')],_0x3837cd[_0x7fd8('0x1c')],_0x3837cd[_0x7fd8('0x1e')],_0x3837cd[_0x7fd8('0x1f')]));_0x4a66a8[_0x7fd8('0x4e')](_0x3000a1[_0x7fd8('0x4c')]['id'],function(_0x3e79a1){try{_0x3e79a1=_0x5d9f5b[_0x7fd8('0x40')](_0x3e79a1);logger['debug'](_0x7fd8('0x41'),JSON['stringify'](_0x3e79a1,null,0x2));if(_0x3e79a1&&_0x5d9f5b[_0x3e79a1[_0x7fd8('0x24')]]){_0x23b13f=_0x5d9f5b[_0x3e79a1[_0x7fd8('0x24')]](_0x3e79a1);if(_0x23b13f){logger['debug'](_0x7fd8('0x47'),getLogFromObject(_0x23b13f));return _[_0x7fd8('0x4a')](_0x23b13f['result'])?null:_0x23b13f['result']['toString']();}else{logger[_0x7fd8('0x15')]('response',getLogFromObject(_0x23b13f));return null;}}else{logger[_0x7fd8('0x15')](_0x7fd8('0x4b'));return null;}}catch(_0x1690d9){logger[_0x7fd8('0x15')](_0x1690d9[_0x7fd8('0xe')]);return null;}});}logger['info'](util['format'](_0x7fd8('0x4f'),_0x3837cd[_0x7fd8('0x1a')],_0x3837cd[_0x7fd8('0x1b')],_0x3837cd[_0x7fd8('0x1c')],_0x3837cd['dnid'],_0x3837cd[_0x7fd8('0x1f')]));logger['info'](util[_0x7fd8('0x11')](_0x7fd8('0x50'),_0x3837cd[_0x7fd8('0x44')],_0x3837cd[_0x7fd8('0x45')],parseInt(_0x3837cd[_0x7fd8('0x46')],0xa)+0x1));_0x3837cd[_0x7fd8('0x51')](_0x3837cd[_0x7fd8('0x44')],_0x3837cd[_0x7fd8('0x45')],parseInt(_0x3837cd[_0x7fd8('0x46')],0xa)+0x1);_0x3837cd[_0x7fd8('0x3a')]();}}else{logger[_0x7fd8('0x15')](util['format'](_0x7fd8('0x52'),_0x3837cd[_0x7fd8('0x1a')]));_0x3837cd[_0x7fd8('0x51')](_0x3837cd[_0x7fd8('0x44')],_0x3837cd[_0x7fd8('0x45')],parseInt(_0x3837cd['priority'],0xa)+0x1);_0x3837cd['close']();}}else{logger['error'](util[_0x7fd8('0x11')](_0x7fd8('0x53'),_0x3837cd[_0x7fd8('0x1a')]));_0x3837cd[_0x7fd8('0x51')](_0x3837cd[_0x7fd8('0x44')],_0x3837cd[_0x7fd8('0x45')],parseInt(_0x3837cd[_0x7fd8('0x46')],0xa)+0x1);_0x3837cd['close']();}}function main(){var _0x5e2809;return utilLicense[_0x7fd8('0x54')]()['then'](function(_0x8da2c0){if(_0x8da2c0){if(_0x8da2c0[_0x7fd8('0x55')]){if(_0x8da2c0['callysquare']&&_0x8da2c0[_0x7fd8('0x56')]>0x0){logger[_0x7fd8('0x18')](util['format'](_0x7fd8('0x57'),_0x8da2c0[_0x7fd8('0x56')]));_0x5e2809=_0x8da2c0[_0x7fd8('0x56')];}else{logger[_0x7fd8('0x18')](_0x7fd8('0x58'));}}else{logger[_0x7fd8('0x18')](_0x7fd8('0x59'));_0x5e2809=-0x1;}}})['catch'](function(_0x16d36e){logger[_0x7fd8('0x15')](_0x7fd8('0x5a'),_0x16d36e[_0x7fd8('0xe')]);})[_0x7fd8('0x4c')](function(){var _0x52682e=require(_0x7fd8('0x5b'))(config[_0x7fd8('0x7')][_0x7fd8('0x12')],config['agi']['ip'],_0x5e2809);_0x52682e['on']('error',errorHandler);_0x52682e['on'](_0x7fd8('0x5c'),listeningHandler);_0x52682e['on'](_0x7fd8('0x5d'),connectionHandler);_0x52682e['on'](_0x7fd8('0x3a'),closeHandler);});}main(); \ No newline at end of file +var _0x207c=['maxRetry','addVertex','omit','mxCell','length','source','target','value','getSquareProject','then','catch','createSquareReport','agi_','substring','inspect','debug','variables','stringify','close','timeout','hangup','sync','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','start','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','isUndefined','result','toString','agicommand\x20not\x20found','finally','traverseBFS','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','./rpc','defaults','nextTick','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','name','error','format','[%s]\x20%s','message','[ERROR]\x20%s','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','evtHangup','toJson','root','agicommand','hasOwnProperty','retry'];(function(_0x38c4be,_0x4cefa2){var _0x23edc0=function(_0x18c9b1){while(--_0x18c9b1){_0x38c4be['push'](_0x38c4be['shift']());}};_0x23edc0(++_0x4cefa2);}(_0x207c,0x1e8));var _0xc207=function(_0x59da33,_0x555969){_0x59da33=_0x59da33-0x0;var _0x1da20f=_0x207c[_0x59da33];return _0x1da20f;};'use strict';var parser=require('xml2json');var _=require(_0xc207('0x0'));var syncho=require(_0xc207('0x1'));var util=require(_0xc207('0x2'));var moment=require(_0xc207('0x3'));var config=require(_0xc207('0x4'));var logger=require(_0xc207('0x5'))(_0xc207('0x6'));var utilLicense=require('../../config/license/util');var rpc=require(_0xc207('0x7'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xc207('0x6')]=_[_0xc207('0x8')](config[_0xc207('0x6')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x25cb97){process[_0xc207('0x9')](function(){syncho(function(){try{setChannelVariables(_0x25cb97);agiHandler(_0x25cb97);}catch(_0x3c579f){logger['error'](_0x3c579f[_0xc207('0xa')]);}});});}function listeningHandler(){console[_0xc207('0xb')](_0xc207('0xc'),config[_0xc207('0x6')][_0xc207('0xd')]);logger[_0xc207('0xe')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config[_0xc207('0x6')]['port']));}function errorHandler(_0x2741f3){if(_0x2741f3&&_0x2741f3[_0xc207('0xf')]&&_0x2741f3['message']){logger[_0xc207('0x10')](util[_0xc207('0x11')](_0xc207('0x12'),_0x2741f3[_0xc207('0xf')],_0x2741f3[_0xc207('0x13')]));}else{logger['error'](util[_0xc207('0x11')](_0xc207('0x14'),_0x2741f3[_0xc207('0xa')]));}}function closeHandler(){logger[_0xc207('0xe')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xc207('0x15')],this[_0xc207('0x16')],this[_0xc207('0x17')],this[_0xc207('0x18')]));try{createSquareReport(this);}catch(_0x4b8f44){logger[_0xc207('0x10')](_0x4b8f44[_0xc207('0xa')]);}}function timeoutHandler(){logger[_0xc207('0xe')](util['format'](_0xc207('0x19'),this['arg_1'],this[_0xc207('0x15')],this[_0xc207('0x16')],this[_0xc207('0x17')],this[_0xc207('0x18')]));}function hangupHandler(){logger[_0xc207('0xe')](util[_0xc207('0x11')](_0xc207('0x1a'),this[_0xc207('0x1b')],this[_0xc207('0x15')],this[_0xc207('0x16')],this[_0xc207('0x17')],this[_0xc207('0x18')]));this[_0xc207('0x1c')]=!![];}function getRoot(_0x4b52a7){return parser[_0xc207('0x1d')](_0x4b52a7,{'object':!![]})['mxGraphModel'][_0xc207('0x1e')];}function addVertex(_0x3ac142,_0x1eabe8,_0x83253f){_0x1eabe8[_0xc207('0x1f')]=_0x83253f;if(_0x1eabe8[_0xc207('0x20')](_0xc207('0x21'))){_0x1eabe8[_0xc207('0x22')]=parseInt(_0x1eabe8[_0xc207('0x21')],0xa);}_0x3ac142[_0xc207('0x23')](_[_0xc207('0x24')](_0x1eabe8,_0xc207('0x25')));}function initGraph(_0x3f738e,_0x138970){var _0x1445d3=new Graph();for(var _0x56a066 in _0x3f738e){if(_0x3f738e[_0xc207('0x20')](_0x56a066)){if(_['isArray'](_0x3f738e[_0x56a066])){for(var _0x4cb3af=0x0;_0x4cb3af<_0x3f738e[_0x56a066][_0xc207('0x26')];_0x4cb3af+=0x1){addVertex(_0x1445d3,_0x3f738e[_0x56a066][_0x4cb3af],_0x56a066);}}else{addVertex(_0x1445d3,_0x3f738e[_0x56a066],_0x56a066);}}}for(var _0x3a05f3=0x0;_0x3a05f3<_0x138970[_0xc207('0x26')];_0x3a05f3+=0x1){if(_0x138970[_0x3a05f3][_0xc207('0x27')]&&_0x138970[_0x3a05f3][_0xc207('0x28')]){_0x1445d3['addEdge'](_0x138970[_0x3a05f3][_0xc207('0x27')],_0x138970[_0x3a05f3][_0xc207('0x28')],_0x138970[_0x3a05f3][_0xc207('0x29')]);}}return _0x1445d3;}function getSquareProject(_0x1bec3f,_0x11a647){rpc[_0xc207('0x2a')](_0x1bec3f)[_0xc207('0x2b')](function(_0x27bc72){_0x11a647(null,_0x27bc72);})[_0xc207('0x2c')](function(_0x3f79e8){_0x11a647(null,_0x3f79e8);});}function createSquareReport(_0x2043cf,_0xaa1b54){rpc[_0xc207('0x2d')](_0x2043cf)['then'](function(_0x1cc799){if(_0xaa1b54){_0xaa1b54(null,_0x1cc799);}})[_0xc207('0x2c')](function(_0x1c4027){if(_0xaa1b54){_0xaa1b54(null,_0x1c4027);}});}function setChannelVariables(_0x448df1){for(var _0x24df00 in _0x448df1){if(_0x448df1[_0xc207('0x20')](_0x24df00)){if(_0x24df00['indexOf'](_0xc207('0x2e'))===0x0){_0x448df1[_0x24df00[_0xc207('0x2f')](0x4)]=_0x448df1[_0x24df00];delete _0x448df1[_0x24df00];}}}}function getLogFromObject(_0x3899dd){return util[_0xc207('0x30')](_0x3899dd,{'showHidden':![],'depth':null});}function agiHandler(_0x58e906){var _0x20491d,_0x30e573,_0x3b05fd,_0x43e89e,_0x1a8359;logger[_0xc207('0x31')](_0xc207('0x32'),JSON[_0xc207('0x33')](_0x58e906,null,0x2));logger[_0xc207('0xe')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x58e906[_0xc207('0x1b')],_0x58e906[_0xc207('0x15')],_0x58e906[_0xc207('0x16')],_0x58e906[_0xc207('0x17')],_0x58e906['uniqueid']));_0x58e906['on'](_0xc207('0x10'),errorHandler);_0x58e906['on'](_0xc207('0x34'),closeHandler);_0x58e906['on'](_0xc207('0x35'),timeoutHandler);_0x58e906[_0xc207('0x1c')]=![];_0x58e906['on'](_0xc207('0x36'),hangupHandler);var _0x5e3177=getSquareProject[_0xc207('0x37')](null,_0x58e906[_0xc207('0x1b')]);if(_0x5e3177){if(_0x5e3177['production']){_0x20491d=getRoot(_0x5e3177[_0xc207('0x38')]);if(_0x20491d&&_0x20491d['start']){logger[_0xc207('0x31')](_0xc207('0x1e'),JSON['stringify'](_0x20491d,null,0x2));_0x58e906[_0xc207('0x39')]=moment()[_0xc207('0x11')](_0xc207('0x3a'));_0x30e573=initGraph(_['omit'](_0x20491d,'mxCell'),_0x20491d[_0xc207('0x25')]);_0x3b05fd=new Vertices(_0x58e906,rpc,mailRpc);logger[_0xc207('0xe')](util[_0xc207('0x11')](_0xc207('0x3b'),_0x58e906['arg_1'],_0x58e906[_0xc207('0x15')],_0x58e906['callerid'],_0x58e906['dnid'],_0x58e906['uniqueid']));_0x30e573['traverseBFS'](_0x20491d[_0xc207('0x3c')]['id'],function(_0x370d0d){try{_0x370d0d=_0x3b05fd[_0xc207('0x3d')](_0x370d0d);logger['debug'](_0xc207('0x3e'),JSON[_0xc207('0x33')](_0x370d0d,null,0x2));if(_0x370d0d[_0xc207('0x1f')]===_0xc207('0x3f')){logger['info'](_0xc207('0x40'));_0x58e906[_0xc207('0x41')]=_0x370d0d[_0xc207('0x41')]||_0x58e906[_0xc207('0x41')];_0x58e906[_0xc207('0x42')]=_0x370d0d['extension'];_0x58e906[_0xc207('0x43')]=_0x370d0d[_0xc207('0x43')]?_0x370d0d[_0xc207('0x43')]-0x1:0x1;return null;}else if(_0x370d0d&&_0x3b05fd[_0x370d0d[_0xc207('0x1f')]]){_0x1a8359=_0x3b05fd[_0x370d0d[_0xc207('0x1f')]](_0x370d0d);logger[_0xc207('0xe')](_0xc207('0x44'),JSON[_0xc207('0x33')](_0x1a8359,null,0x2));if(_0x1a8359&&_0x1a8359[_0xc207('0x45')]===AGI_CODE_SUCCESS&&_0x1a8359['result']!==AGI_RESULT_ERROR&&!_0x58e906[_0xc207('0x1c')]){logger[_0xc207('0x31')]('response',getLogFromObject(_0x1a8359));return _[_0xc207('0x46')](_0x1a8359[_0xc207('0x47')])?null:_0x1a8359[_0xc207('0x47')][_0xc207('0x48')]();}else{logger[_0xc207('0x10')]('response',getLogFromObject(_0x1a8359));return null;}}else{logger[_0xc207('0x10')](_0xc207('0x49'));return null;}}catch(_0x17da25){logger['error'](_0x17da25[_0xc207('0xa')]);return null;}});if(_0x20491d[_0xc207('0x4a')]){logger[_0xc207('0xe')](util[_0xc207('0x11')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x58e906['arg_1'],_0x58e906[_0xc207('0x15')],_0x58e906[_0xc207('0x16')],_0x58e906[_0xc207('0x17')],_0x58e906[_0xc207('0x18')]));_0x30e573[_0xc207('0x4b')](_0x20491d[_0xc207('0x4a')]['id'],function(_0x314fa0){try{_0x314fa0=_0x3b05fd[_0xc207('0x3d')](_0x314fa0);logger[_0xc207('0x31')](_0xc207('0x3e'),JSON[_0xc207('0x33')](_0x314fa0,null,0x2));if(_0x314fa0&&_0x3b05fd[_0x314fa0[_0xc207('0x1f')]]){_0x1a8359=_0x3b05fd[_0x314fa0['agicommand']](_0x314fa0);if(_0x1a8359){logger['debug'](_0xc207('0x44'),getLogFromObject(_0x1a8359));return _[_0xc207('0x46')](_0x1a8359[_0xc207('0x47')])?null:_0x1a8359['result'][_0xc207('0x48')]();}else{logger[_0xc207('0x10')](_0xc207('0x44'),getLogFromObject(_0x1a8359));return null;}}else{logger[_0xc207('0x10')]('agicommand\x20not\x20found');return null;}}catch(_0x26cb97){logger['error'](_0x26cb97[_0xc207('0xa')]);return null;}});}logger['info'](util['format'](_0xc207('0x4c'),_0x58e906[_0xc207('0x1b')],_0x58e906['calleridname'],_0x58e906['callerid'],_0x58e906['dnid'],_0x58e906[_0xc207('0x18')]));logger[_0xc207('0xe')](util[_0xc207('0x11')](_0xc207('0x4d'),_0x58e906[_0xc207('0x41')],_0x58e906[_0xc207('0x42')],parseInt(_0x58e906[_0xc207('0x43')],0xa)+0x1));_0x58e906[_0xc207('0x4e')](_0x58e906['context'],_0x58e906[_0xc207('0x42')],parseInt(_0x58e906[_0xc207('0x43')],0xa)+0x1);_0x58e906['close']();}}else{logger['error'](util[_0xc207('0x11')]('Project\x20%s\x20not\x20published',_0x58e906['arg_1']));_0x58e906[_0xc207('0x4e')](_0x58e906[_0xc207('0x41')],_0x58e906[_0xc207('0x42')],parseInt(_0x58e906[_0xc207('0x43')],0xa)+0x1);_0x58e906[_0xc207('0x34')]();}}else{logger[_0xc207('0x10')](util[_0xc207('0x11')](_0xc207('0x4f'),_0x58e906[_0xc207('0x1b')]));_0x58e906[_0xc207('0x4e')](_0x58e906[_0xc207('0x41')],_0x58e906['extension'],parseInt(_0x58e906['priority'],0xa)+0x1);_0x58e906[_0xc207('0x34')]();}}function main(){var _0x246f5b;return utilLicense[_0xc207('0x50')]()[_0xc207('0x2b')](function(_0xaff7a0){if(_0xaff7a0){if(_0xaff7a0[_0xc207('0x51')]){if(_0xaff7a0[_0xc207('0x52')]&&_0xaff7a0[_0xc207('0x52')]>0x0){logger[_0xc207('0xe')](util['format'](_0xc207('0x53'),_0xaff7a0[_0xc207('0x52')]));_0x246f5b=_0xaff7a0[_0xc207('0x52')];}else{logger[_0xc207('0xe')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xc207('0xe')](_0xc207('0x54'));_0x246f5b=-0x1;}}})[_0xc207('0x2c')](function(_0x409b2d){logger[_0xc207('0x10')](_0xc207('0x55'),_0x409b2d[_0xc207('0xa')]);})['finally'](function(){var _0x305cab=require(_0xc207('0x56'))(config[_0xc207('0x6')][_0xc207('0xd')],config['agi']['ip'],_0x246f5b);_0x305cab['on'](_0xc207('0x10'),errorHandler);_0x305cab['on']('listening',listeningHandler);_0x305cab['on']('connection',connectionHandler);_0x305cab['on'](_0xc207('0x34'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 40652a8..5475223 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x151b4a,_0x527f27){var _0x509504=function(_0x31b17f){while(--_0x31b17f){_0x151b4a['push'](_0x151b4a['shift']());}};_0x509504(++_0x527f27);}(_0x34e8,0x12c));var _0x834e=function(_0x51a942,_0x38601a){_0x51a942=_0x51a942-0x0;var _0x336009=_0x34e8[_0x51a942];return _0x336009;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x456082,_0x226277){var _0xa1bde4=function(_0x31fcc9){while(--_0x31fcc9){_0x456082['push'](_0x456082['shift']());}};_0xa1bde4(++_0x226277);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 347bad3..8dd5ca2 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x1d69d2,_0x2ef689){var _0x10b3ba=function(_0x2651f8){while(--_0x2651f8){_0x1d69d2['push'](_0x1d69d2['shift']());}};_0x10b3ba(++_0x2ef689);}(_0x5f2f,0x73));var _0xf5f2=function(_0x34eb5b,_0x16dcb1){_0x34eb5b=_0x34eb5b-0x0;var _0x285b30=_0x5f2f[_0x34eb5b];return _0x285b30;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file +var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x9791c4,_0x283c9f){var _0x36d7c9=function(_0x7c66df){while(--_0x7c66df){_0x9791c4['push'](_0x9791c4['shift']());}};_0x36d7c9(++_0x283c9f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3ca5d5,_0x92e7e3){_0x3ca5d5=_0x3ca5d5-0x0;var _0x210bd7=_0x5f2f[_0x3ca5d5];return _0x210bd7;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 5b57555..777f41a 100644 --- a/server/services/agi/rpc/index.js +++ b/server/services/agi/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefe3=['getVariableById','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','then','CreateCmContact','ShowPause','agentLogin','PauseUser','agentUnpause','UnpauseUser','bluebird','jayson/promise','client','http','request','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','email','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xefe3,0xf5));var _0x3efe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xefe3[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x3efe('0x0'));var moment=require('moment');var _=require('lodash');var util=require('util');var jayson=require(_0x3efe('0x1'));var client=jayson[_0x3efe('0x2')][_0x3efe('0x3')]({'port':0x2329});function request(_0x31dfff,_0x48d77b){return new BPromise(function(_0x11125f,_0x58e1bb){return client[_0x3efe('0x4')](_0x31dfff,_0x48d77b)['then'](function(_0x3a1c0a){if(_0x3a1c0a[_0x3efe('0x5')]){return _0x58e1bb(_0x3a1c0a[_0x3efe('0x5')][_0x3efe('0x6')]);}else{return _0x11125f(_0x3a1c0a[_0x3efe('0x7')]);}})[_0x3efe('0x8')](function(_0x4b9766){return _0x58e1bb(_0x4b9766);});});}exports[_0x3efe('0x9')]=function(_0x54fec1){return request(_0x3efe('0xa'),{'options':{'raw':![],'where':{'name':_0x54fec1},'attributes':[_0x3efe('0xb')]}});};exports[_0x3efe('0xc')]=function(_0x1d1d6a){return request(_0x3efe('0xd'),{'options':{'raw':![],'where':{'id':_0x1d1d6a},'include':[{'model':_0x3efe('0xe'),'as':'Smtp'}],'attributes':['id','name',_0x3efe('0xf')]}});};exports[_0x3efe('0x10')]=function(_0x276ca9){return request(_0x3efe('0xa'),{'options':{'where':{'id':_0x276ca9},'attributes':[_0x3efe('0x11')]}});};exports[_0x3efe('0x12')]=function(_0x12a82a){return request(_0x3efe('0x13'),{'options':{'where':{'id':_0x12a82a},'attributes':[_0x3efe('0x11')]}});};exports[_0x3efe('0x14')]=function(_0x2dd99f){return request('ShowVariable',{'options':{'where':{'id':_0x2dd99f},'attributes':[_0x3efe('0x11')]}});};exports[_0x3efe('0x15')]=function(_0x1e1ce9){return request(_0x3efe('0x16'),{'options':{'where':{'id':_0x1e1ce9},'attributes':['dsn']}});};exports[_0x3efe('0x17')]=function(_0x13730a){return request(_0x3efe('0x18'),{'options':{'where':{'id':_0x13730a},'attributes':['name']}});};exports['getTrunkById']=function(_0x3adf52){return request(_0x3efe('0x19'),{'options':{'where':{'id':_0x3adf52},'attributes':[_0x3efe('0x11')]}});};exports[_0x3efe('0x1a')]=function(_0x433c53){return request(_0x3efe('0x1b'),{'options':{'where':{'id':_0x433c53},'attributes':['save_name']}});};exports[_0x3efe('0x1c')]=function(_0x30b3fb){return request(_0x3efe('0x1d'),{'options':{'raw':![],'where':{'id':_0x30b3fb},'include':[{'model':_0x3efe('0x1e'),'as':_0x3efe('0x1f')}]}});};exports[_0x3efe('0x20')]=function(_0x41cfcd){return request(_0x3efe('0x21'),{'options':{'where':{'id':_0x41cfcd},'attributes':['id',_0x3efe('0x11')]}});};exports['createSmsMessage']=function(_0x34e55e){return request(_0x3efe('0x22'),{'body':_0x34e55e});};exports[_0x3efe('0x23')]=function(_0x3b6464){return request('CreateSquareDetailsReport',{'body':_0x3b6464});};exports['createSquareReport']=function(_0xe5160){return request(_0x3efe('0x24'),{'body':_['merge'](_0xe5160,{'project_name':_0xe5160['arg_1'],'prev_project_name':_0xe5160[_0x3efe('0x25')]||'','is_subproject':_0xe5160[_0x3efe('0x25')]?!![]:![],'leaveAt':moment()[_0x3efe('0x26')](_0x3efe('0x27'))})});};exports[_0x3efe('0x28')]=function(_0x39fc88){return request(_0x3efe('0x29'),{'body':_0x39fc88});};exports[_0x3efe('0x2a')]=function(_0x36f911){return request('CreateSquareMessage',{'body':_0x36f911});};exports[_0x3efe('0x2b')]=function(_0x56747e){return request(_0x3efe('0x2c'),{'options':{'raw':![],'where':{'phone':_0x56747e[_0x3efe('0x2d')],'ListId':_0x56747e['ListId']}}})[_0x3efe('0x2e')](function(_0x14908e){if(_0x14908e){return _0x14908e;}return request(_0x3efe('0x2f'),{'body':_0x56747e});});};exports['getPauseById']=function(_0xdedd1c){return request(_0x3efe('0x30'),{'options':{'where':{'id':_0xdedd1c},'attributes':['name']}});};exports[_0x3efe('0x31')]=function(_0x11778f,_0x4309b1){return request('LoginUser',{'body':{'interface':_0x4309b1},'options':{'where':_0x11778f}});};exports['agentPause']=function(_0x2e2d68,_0x34229c,_0x423056){return request(_0x3efe('0x32'),{'body':{'type':_0x34229c,'uniqueid':_0x423056},'options':{'where':_0x2e2d68}});};exports[_0x3efe('0x33')]=function(_0x1f271b){return request(_0x3efe('0x34'),{'body':{},'options':{'where':_0x1f271b}});};exports['agentLogout']=function(_0x3aa951){return request('LogoutUser',{'body':{},'options':{'where':_0x3aa951}});}; \ No newline at end of file +var _0xf300=['Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentLogout','lodash','util','http','request','then','message','result','getSquareProject','ShowSquareProject','MailServerOut'];(function(_0x373b90,_0x2d0a44){var _0x594668=function(_0x3bbb70){while(--_0x3bbb70){_0x373b90['push'](_0x373b90['shift']());}};_0x594668(++_0x2d0a44);}(_0xf300,0xc6));var _0x0f30=function(_0x644560,_0x1783aa){_0x644560=_0x644560-0x0;var _0x41b76b=_0xf300[_0x644560];return _0x41b76b;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x0f30('0x0'));var util=require(_0x0f30('0x1'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0f30('0x2')]({'port':0x2329});function request(_0x48d931,_0x5a7858){return new BPromise(function(_0x2750fa,_0x1eaff9){return client[_0x0f30('0x3')](_0x48d931,_0x5a7858)[_0x0f30('0x4')](function(_0x2649d8){if(_0x2649d8['error']){return _0x1eaff9(_0x2649d8['error'][_0x0f30('0x5')]);}else{return _0x2750fa(_0x2649d8[_0x0f30('0x6')]);}})['catch'](function(_0x3fbb95){return _0x1eaff9(_0x3fbb95);});});}exports[_0x0f30('0x7')]=function(_0x2ed016){return request(_0x0f30('0x8'),{'options':{'raw':![],'where':{'name':_0x2ed016},'attributes':['production']}});};exports['getMailAccountById']=function(_0x4ca6a4){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x4ca6a4},'include':[{'model':_0x0f30('0x9'),'as':_0x0f30('0xa')}],'attributes':['id',_0x0f30('0xb'),_0x0f30('0xc')]}});};exports[_0x0f30('0xd')]=function(_0x19e14a){return request(_0x0f30('0x8'),{'options':{'where':{'id':_0x19e14a},'attributes':['name']}});};exports[_0x0f30('0xe')]=function(_0x48a12d){return request(_0x0f30('0xf'),{'options':{'where':{'id':_0x48a12d},'attributes':[_0x0f30('0xb')]}});};exports[_0x0f30('0x10')]=function(_0x5b379d){return request(_0x0f30('0x11'),{'options':{'where':{'id':_0x5b379d},'attributes':['name']}});};exports[_0x0f30('0x12')]=function(_0x56203c){return request(_0x0f30('0x13'),{'options':{'where':{'id':_0x56203c},'attributes':[_0x0f30('0x14')]}});};exports['getUserById']=function(_0x4841c5){return request('ShowUser',{'options':{'where':{'id':_0x4841c5},'attributes':[_0x0f30('0xb')]}});};exports[_0x0f30('0x15')]=function(_0x1d89f5){return request(_0x0f30('0x16'),{'options':{'where':{'id':_0x1d89f5},'attributes':[_0x0f30('0xb')]}});};exports[_0x0f30('0x17')]=function(_0x24bc69){return request(_0x0f30('0x18'),{'options':{'where':{'id':_0x24bc69},'attributes':['save_name']}});};exports[_0x0f30('0x19')]=function(_0x221483){return request(_0x0f30('0x1a'),{'options':{'raw':![],'where':{'id':_0x221483},'include':[{'model':'Interval','as':_0x0f30('0x1b')}]}});};exports['getSmsAccountById']=function(_0x1b750f){return request(_0x0f30('0x1c'),{'options':{'where':{'id':_0x1b750f},'attributes':['id',_0x0f30('0xb')]}});};exports[_0x0f30('0x1d')]=function(_0x26280f){return request(_0x0f30('0x1e'),{'body':_0x26280f});};exports[_0x0f30('0x1f')]=function(_0x192744){return request(_0x0f30('0x20'),{'body':_0x192744});};exports[_0x0f30('0x21')]=function(_0x42d102){return request(_0x0f30('0x22'),{'body':_[_0x0f30('0x23')](_0x42d102,{'project_name':_0x42d102[_0x0f30('0x24')],'prev_project_name':_0x42d102['arg_2']||'','is_subproject':_0x42d102[_0x0f30('0x25')]?!![]:![],'leaveAt':moment()['format'](_0x0f30('0x26'))})});};exports[_0x0f30('0x27')]=function(_0x539b15){return request('CreateSquareRecording',{'body':_0x539b15});};exports[_0x0f30('0x28')]=function(_0xe5dbff){return request('CreateSquareMessage',{'body':_0xe5dbff});};exports[_0x0f30('0x29')]=function(_0x50f37e){return request(_0x0f30('0x2a'),{'options':{'raw':![],'where':{'phone':_0x50f37e[_0x0f30('0x2b')],'ListId':_0x50f37e[_0x0f30('0x2c')]}}})[_0x0f30('0x4')](function(_0x236f47){if(_0x236f47){return _0x236f47;}return request(_0x0f30('0x2d'),{'body':_0x50f37e});});};exports[_0x0f30('0x2e')]=function(_0x2bc919){return request(_0x0f30('0x2f'),{'options':{'where':{'id':_0x2bc919},'attributes':['name']}});};exports[_0x0f30('0x30')]=function(_0x58a6c5,_0x54e286){return request(_0x0f30('0x31'),{'body':{'interface':_0x54e286},'options':{'where':_0x58a6c5}});};exports['agentPause']=function(_0x384056,_0x540b10,_0x43331b){return request(_0x0f30('0x32'),{'body':{'type':_0x540b10,'uniqueid':_0x43331b},'options':{'where':_0x384056}});};exports['agentUnpause']=function(_0x3c4a81){return request('UnpauseUser',{'body':{},'options':{'where':_0x3c4a81}});};exports[_0x0f30('0x33')]=function(_0x5a98fb){return request('LogoutUser',{'body':{},'options':{'where':_0x5a98fb}});}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js index 4223b78..5962d36 100644 --- a/server/services/agi/scripts/aws/index.js +++ b/server/services/agi/scripts/aws/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c12=['./lex','exports'];(function(_0x42ab96,_0x5bd2f7){var _0x34a62e=function(_0x3b225d){while(--_0x3b225d){_0x42ab96['push'](_0x42ab96['shift']());}};_0x34a62e(++_0x5bd2f7);}(_0x5c12,0x188));var _0x25c1=function(_0x29d2d2,_0x3344){_0x29d2d2=_0x29d2d2-0x0;var _0x3f6476=_0x5c12[_0x29d2d2];return _0x3f6476;};var polly=require('./polly');var lex=require(_0x25c1('0x0'));module[_0x25c1('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x668b=['./polly','./lex'];(function(_0x13a7d0,_0xe26397){var _0x441364=function(_0x4248f4){while(--_0x4248f4){_0x13a7d0['push'](_0x13a7d0['shift']());}};_0x441364(++_0xe26397);}(_0x668b,0x140));var _0xb668=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0x668b[_0x1f44e4];return _0x591989;};var polly=require(_0xb668('0x0'));var lex=require(_0xb668('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index e44a197..54bf91f 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46fc=['exports','./lib/api'];(function(_0x649a3b,_0x2b1cf5){var _0x8ec5a5=function(_0x4e03a8){while(--_0x4e03a8){_0x649a3b['push'](_0x649a3b['shift']());}};_0x8ec5a5(++_0x2b1cf5);}(_0x46fc,0x103));var _0xc46f=function(_0x1b7252,_0x5ca6a4){_0x1b7252=_0x1b7252-0x0;var _0x1a315a=_0x46fc[_0x1b7252];return _0x1a315a;};'use strict';var lex=require(_0xc46f('0x0'));module[_0xc46f('0x1')]=function(_0xf5212c,_0x23d3ae,_0x865c60,_0x9460ea,_0x2bf9ee,_0x24058a){return lex(_0xf5212c,_0x23d3ae,_0x865c60,_0x9460ea,_0x2bf9ee,_0x24058a);}; \ No newline at end of file +var _0x130d=['./lib/api'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0x130d,0x125));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var lex=require(_0xd130('0x0'));module['exports']=function(_0x23e485,_0x5183ae,_0x45f869,_0x389725,_0x3591d2,_0x77d691){return lex(_0x23e485,_0x5183ae,_0x45f869,_0x389725,_0x3591d2,_0x77d691);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 9a22439..a56dce1 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf775=['aws-sdk','postText','slots','hasOwnProperty','slot_','exports','LexRuntime','$LATEST','bluebird'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xf775,0x8f));var _0x5f77=function(_0xf16538,_0xa32831){_0xf16538=_0xf16538-0x0;var _0x53353c=_0xf775[_0xf16538];return _0x53353c;};'use strict';var BPromise=require(_0x5f77('0x0'));var AWS=require(_0x5f77('0x1'));function lexResult(_0x3a9af7,_0xc044e0){return new BPromise(function(_0x2b70c5,_0x2b2442){_0x3a9af7[_0x5f77('0x2')](_0xc044e0,function(_0xff19a0,_0x58433f){if(_0xff19a0){_0x2b2442(_0xff19a0);}if(_0x58433f[_0x5f77('0x3')]){for(const _0x3aa119 in _0x58433f['slots']){if(_0x58433f[_0x5f77('0x3')][_0x5f77('0x4')](_0x3aa119)){var _0x36705d=_0x58433f[_0x5f77('0x3')][_0x3aa119];_0x58433f[_0x5f77('0x5')+_0x3aa119]=_0x36705d;}}}_0x2b70c5(_0x58433f);});});}module[_0x5f77('0x6')]=function(_0x316e66,_0x53a2ed,_0x4c9ddb,_0xe09639,_0xaf498a,_0x4c7887){var _0x136bc9=new AWS[(_0x5f77('0x7'))]({'accessKeyId':_0x53a2ed,'secretAccessKey':_0x4c9ddb,'region':_0xe09639});var _0x18e5b9={'botAlias':_0x5f77('0x8'),'botName':_0x4c7887,'inputText':_0xaf498a,'userId':_0x316e66};return lexResult(_0x136bc9,_0x18e5b9);}; \ No newline at end of file +var _0x45b3=['slots','hasOwnProperty','slot_','exports','LexRuntime','bluebird','aws-sdk'];(function(_0x2d843c,_0x4612bb){var _0x3768eb=function(_0x23585f){while(--_0x23585f){_0x2d843c['push'](_0x2d843c['shift']());}};_0x3768eb(++_0x4612bb);}(_0x45b3,0x15c));var _0x345b=function(_0x36c0f1,_0x38b1b2){_0x36c0f1=_0x36c0f1-0x0;var _0x5b375d=_0x45b3[_0x36c0f1];return _0x5b375d;};'use strict';var BPromise=require(_0x345b('0x0'));var AWS=require(_0x345b('0x1'));function lexResult(_0x48bc95,_0x38b257){return new BPromise(function(_0x121366,_0x313b86){_0x48bc95['postText'](_0x38b257,function(_0x2cef48,_0x4d2760){if(_0x2cef48){_0x313b86(_0x2cef48);}if(_0x4d2760[_0x345b('0x2')]){for(const _0x2afb02 in _0x4d2760['slots']){if(_0x4d2760[_0x345b('0x2')][_0x345b('0x3')](_0x2afb02)){var _0x27316c=_0x4d2760[_0x345b('0x2')][_0x2afb02];_0x4d2760[_0x345b('0x4')+_0x2afb02]=_0x27316c;}}}_0x121366(_0x4d2760);});});}module[_0x345b('0x5')]=function(_0x4a3aeb,_0x3bb9fd,_0x4355dd,_0x4cec92,_0x25479a,_0x3f5131){var _0x1de891=new AWS[(_0x345b('0x6'))]({'accessKeyId':_0x3bb9fd,'secretAccessKey':_0x4355dd,'region':_0x4cec92});var _0xe8d9c1={'botAlias':'$LATEST','botName':_0x3f5131,'inputText':_0x25479a,'userId':_0x4a3aeb};return lexResult(_0x1de891,_0xe8d9c1);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 6b20795..933b4ed 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b87=['./lib/api'];(function(_0xcb4f7d,_0x4881b8){var _0x5ca3d5=function(_0x3ac238){while(--_0x3ac238){_0xcb4f7d['push'](_0xcb4f7d['shift']());}};_0x5ca3d5(++_0x4881b8);}(_0x0b87,0xd9));var _0x70b8=function(_0x434f69,_0x9da9a7){_0x434f69=_0x434f69-0x0;var _0x5f40da=_0x0b87[_0x434f69];return _0x5f40da;};'use strict';var polly=require(_0x70b8('0x0'));module['exports']=function(_0x50a1e7,_0x511c32,_0x196e36,_0x574713,_0x4c0740,_0x5bd6a1,_0x52563b){return polly(_0x50a1e7,_0x511c32,_0x196e36,_0x574713,_0x4c0740,_0x5bd6a1,_0x52563b);}; \ No newline at end of file +var _0xacb9=['exports','./lib/api'];(function(_0xa862a1,_0x5a186e){var _0x409224=function(_0x5d2b6d){while(--_0x5d2b6d){_0xa862a1['push'](_0xa862a1['shift']());}};_0x409224(++_0x5a186e);}(_0xacb9,0x77));var _0x9acb=function(_0x3e0816,_0x18d9d3){_0x3e0816=_0x3e0816-0x0;var _0x4386f2=_0xacb9[_0x3e0816];return _0x4386f2;};'use strict';var polly=require(_0x9acb('0x0'));module[_0x9acb('0x1')]=function(_0x2e5d1f,_0x3af130,_0x29a6cc,_0xcac22f,_0x2873dc,_0x3b2000,_0x2bfd62){return polly(_0x2e5d1f,_0x3af130,_0x29a6cc,_0xcac22f,_0x2873dc,_0x3b2000,_0x2bfd62);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/lib/api.js b/server/services/agi/scripts/aws/polly/lib/api.js index b676810..4d23d09 100644 --- a/server/services/agi/scripts/aws/polly/lib/api.js +++ b/server/services/agi/scripts/aws/polly/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fe8=['randomstring','aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','mp3','path'];(function(_0x2a7210,_0x2f3d23){var _0x460766=function(_0xd575dd){while(--_0xd575dd){_0x2a7210['push'](_0x2a7210['shift']());}};_0x460766(++_0x2f3d23);}(_0x9fe8,0xdf));var _0x89fe=function(_0x5102b2,_0x54990f){_0x5102b2=_0x5102b2-0x0;var _0x284a6b=_0x9fe8[_0x5102b2];return _0x284a6b;};'use strict';var fs=require('fs');var path=require(_0x89fe('0x0'));var BPromise=require('bluebird');var rs=require(_0x89fe('0x1'));var AWS=require(_0x89fe('0x2'));function pollyResult(_0x3318ec,_0x2281eb,_0x44d7c3){return new BPromise(function(_0x380021,_0x52e80b){_0x3318ec['synthesizeSpeech'](_0x2281eb,function(_0x159fda,_0x42ce81){if(_0x159fda){_0x52e80b(_0x159fda);}else if(_0x42ce81){if(_0x42ce81[_0x89fe('0x3')]instanceof Buffer){fs['writeFile'](_0x44d7c3,_0x42ce81[_0x89fe('0x3')],function(_0x4cf3cc){if(_0x4cf3cc){_0x52e80b(_0x4cf3cc);}else{_0x380021();}});}else{_0x52e80b(new Error(_0x89fe('0x4')));}}else{_0x52e80b(new Error(_0x89fe('0x5')));}});});}module['exports']=function(_0x19f4ce,_0x4361f9,_0x44ab22,_0x3552d6,_0x8e206f,_0x39076d,_0x248a68){var _0x536d7e=new AWS['Polly']({'accessKeyId':_0x19f4ce,'secretAccessKey':_0x4361f9,'region':_0x44ab22});var _0x2efe56={'Text':_0x8e206f,'TextType':_0x39076d||'text','OutputFormat':_0x89fe('0x6'),'VoiceId':_0x3552d6};return pollyResult(_0x536d7e,_0x2efe56,_0x248a68);}; \ No newline at end of file +var _0x19d8=['mp3','bluebird','randomstring','aws-sdk','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text'];(function(_0x27a900,_0x1cc305){var _0xea9b1f=function(_0xaddd55){while(--_0xaddd55){_0x27a900['push'](_0x27a900['shift']());}};_0xea9b1f(++_0x1cc305);}(_0x19d8,0x1a5));var _0x819d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x19d8[_0x321bb2];return _0x9c12ed;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x819d('0x0'));var rs=require(_0x819d('0x1'));var AWS=require(_0x819d('0x2'));function pollyResult(_0x11dd5d,_0x40384d,_0x3f8a43){return new BPromise(function(_0x4d449,_0x23f08e){_0x11dd5d['synthesizeSpeech'](_0x40384d,function(_0x2a88d9,_0x34141c){if(_0x2a88d9){_0x23f08e(_0x2a88d9);}else if(_0x34141c){if(_0x34141c['AudioStream']instanceof Buffer){fs['writeFile'](_0x3f8a43,_0x34141c['AudioStream'],function(_0x1afa39){if(_0x1afa39){_0x23f08e(_0x1afa39);}else{_0x4d449();}});}else{_0x23f08e(new Error(_0x819d('0x3')));}}else{_0x23f08e(new Error(_0x819d('0x4')));}});});}module['exports']=function(_0x38540b,_0x1d67f1,_0x1aa271,_0x12535f,_0x4c6130,_0x1d2b3d,_0x6b217d){var _0x3d74ae=new AWS['Polly']({'accessKeyId':_0x38540b,'secretAccessKey':_0x1d67f1,'region':_0x1aa271});var _0x2da563={'Text':_0x4c6130,'TextType':_0x1d2b3d||_0x819d('0x5'),'OutputFormat':_0x819d('0x6'),'VoiceId':_0x12535f};return pollyResult(_0x3d74ae,_0x2da563,_0x6b217d);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/index.js b/server/services/agi/scripts/google/asr/index.js index 4f87f72..ea7d377 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x522d=['exports','./lib/api'];(function(_0x3a4894,_0x3605a2){var _0x4a522e=function(_0x36fde2){while(--_0x36fde2){_0x3a4894['push'](_0x3a4894['shift']());}};_0x4a522e(++_0x3605a2);}(_0x522d,0xe9));var _0xd522=function(_0x4ccefc,_0x24e1c6){_0x4ccefc=_0x4ccefc-0x0;var _0x127a74=_0x522d[_0x4ccefc];return _0x127a74;};'use strict';var asr=require(_0xd522('0x0'));module[_0xd522('0x1')]=function(_0x4a463f,_0x4fe40a,_0x861a1e,_0x36f127){return asr(_0x4a463f,_0x4fe40a,_0x861a1e);}; \ No newline at end of file +var _0x6ee5=['./lib/api','exports'];(function(_0x117d41,_0x367246){var _0x4b4d79=function(_0x3276cb){while(--_0x3276cb){_0x117d41['push'](_0x117d41['shift']());}};_0x4b4d79(++_0x367246);}(_0x6ee5,0x1b0));var _0x56ee=function(_0x83832c,_0x43453e){_0x83832c=_0x83832c-0x0;var _0x541ca5=_0x6ee5[_0x83832c];return _0x541ca5;};'use strict';var asr=require(_0x56ee('0x0'));module[_0x56ee('0x1')]=function(_0x5960c4,_0x3c23fd,_0x4ebfff,_0x52cb42){return asr(_0x5960c4,_0x3c23fd,_0x4ebfff);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/lib/api.js b/server/services/agi/scripts/google/asr/lib/api.js index 65418ab..e7e1fa4 100644 --- a/server/services/agi/scripts/google/asr/lib/api.js +++ b/server/services/agi/scripts/google/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2547=['exports','string','length','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','base64','POST','LINEAR16','8000'];(function(_0x5ea2f9,_0x320917){var _0x36e586=function(_0x2e79a2){while(--_0x2e79a2){_0x5ea2f9['push'](_0x5ea2f9['shift']());}};_0x36e586(++_0x320917);}(_0x2547,0xa5));var _0x7254=function(_0x48321c,_0x5e1ffc){_0x48321c=_0x48321c-0x0;var _0xe561be=_0x2547[_0x48321c];return _0xe561be;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x7254('0x0')]=function(_0x2df34e,_0x42c60b,_0x194a49){return new BPromise(function(_0xa13914,_0x59e1f6){var _0x10d78b;if(typeof _0x2df34e!==_0x7254('0x1')||_0x2df34e[_0x7254('0x2')]===0x0){return _0x59e1f6('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x42c60b!==_0x7254('0x1')||_0x42c60b['length']===0x0){return _0x59e1f6(_0x7254('0x3'));}if(typeof _0x194a49!==_0x7254('0x4')&&(typeof _0x194a49!==_0x7254('0x1')||_0x194a49['length']===0x0)){return _0x59e1f6('lang\x20should\x20be\x20a\x20string');}try{_0x10d78b=fs[_0x7254('0x5')](_0x2df34e)[_0x7254('0x6')](_0x7254('0x7'));}catch(_0x191fc8){return _0x59e1f6(_0x191fc8);}return _0xa13914({'method':_0x7254('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x42c60b,'body':{'config':{'encoding':_0x7254('0x9'),'sampleRateHertz':_0x7254('0xa'),'languageCode':_0x194a49},'audio':{'content':_0x10d78b}},'json':!![]});});}; \ No newline at end of file +var _0xd50a=['key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x410413,_0x2c77a9){var _0x34ec54=function(_0x23cd99){while(--_0x23cd99){_0x410413['push'](_0x410413['shift']());}};_0x34ec54(++_0x2c77a9);}(_0xd50a,0x126));var _0xad50=function(_0x27d878,_0x46f920){_0x27d878=_0x27d878-0x0;var _0x54ff9b=_0xd50a[_0x27d878];return _0x54ff9b;};'use strict';var url=require(_0xad50('0x0'));var BPromise=require(_0xad50('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xad50('0x2')]=function(_0x50aafc,_0x543dfe,_0x381309){return new BPromise(function(_0x2c649c,_0x194c19){var _0x56e395;if(typeof _0x50aafc!==_0xad50('0x3')||_0x50aafc[_0xad50('0x4')]===0x0){return _0x194c19(_0xad50('0x5'));}if(typeof _0x543dfe!==_0xad50('0x3')||_0x543dfe[_0xad50('0x4')]===0x0){return _0x194c19(_0xad50('0x6'));}if(typeof _0x381309!=='undefined'&&(typeof _0x381309!==_0xad50('0x3')||_0x381309[_0xad50('0x4')]===0x0)){return _0x194c19(_0xad50('0x7'));}try{_0x56e395=fs[_0xad50('0x8')](_0x50aafc)['toString']('base64');}catch(_0x404db8){return _0x194c19(_0x404db8);}return _0x2c649c({'method':_0xad50('0x9'),'uri':host+_0xad50('0xa')+_0x543dfe,'body':{'config':{'encoding':_0xad50('0xb'),'sampleRateHertz':'8000','languageCode':_0x381309},'audio':{'content':_0x56e395}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index a6dc5fb..76952b9 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd027=['exports'];(function(_0x5b8b97,_0x6b4dfa){var _0x1fdf84=function(_0x2ced4c){while(--_0x2ced4c){_0x5b8b97['push'](_0x5b8b97['shift']());}};_0x1fdf84(++_0x6b4dfa);}(_0xd027,0x197));var _0x7d02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd027[_0x14add3];return _0x4a174f;};var asr=require('./asr');module[_0x7d02('0x0')]={'asr':asr}; \ No newline at end of file +var _0x184d=['exports'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x184d,0x1d0));var _0xd184=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x184d[_0x22b68a];return _0x1ac67a;};var asr=require('./asr');module[_0xd184('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 62e4b7f..3e2bd0e 100644 --- a/server/services/agi/scripts/index.js +++ b/server/services/agi/scripts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ff8=['randomstring','sox','util','querystring','moment','google-tts-api','apiai-promise','./google','./aws','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','end','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','unlink','chmodSync','777','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','MP3','text:synthesize','POST','from','audioContent','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','path','http','https','parse','bluebird'];(function(_0x3eee56,_0x176daf){var _0x506bcd=function(_0x3cfe8b){while(--_0x3cfe8b){_0x3eee56['push'](_0x3eee56['shift']());}};_0x506bcd(++_0x176daf);}(_0x8ff8,0x68));var _0x88ff=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8ff8[_0x321bb2];return _0x9c12ed;};'use strict';var fs=require('fs');var path=require(_0x88ff('0x0'));var http=require(_0x88ff('0x1'));var https=require(_0x88ff('0x2'));var urlParse=require('url')[_0x88ff('0x3')];var BPromise=require(_0x88ff('0x4'));var rs=require(_0x88ff('0x5'));var sox=require(_0x88ff('0x6'));var rp=require('request-promise');var util=require(_0x88ff('0x7'));var querystring=require(_0x88ff('0x8'));var moment=require(_0x88ff('0x9'));var tts=require(_0x88ff('0xa'));var apiai=require(_0x88ff('0xb'));var md5=require('md5');var google=require(_0x88ff('0xc'));var aws=require(_0x88ff('0xd'));var tilde=require(_0x88ff('0xe'));var sestek=require('./sestek');var logger=require(_0x88ff('0xf'))(_0x88ff('0x10'));var ISPEECH_API=_0x88ff('0x11');function downloadFile(_0x5fb86d,_0x3bf341){return new BPromise(function(_0x253bf7,_0x58fd11){var _0x46ce36=urlParse(_0x5fb86d);var _0x361b89=_0x46ce36[_0x88ff('0x12')]===_0x88ff('0x13')?https:http;var _0x35664c={'host':_0x46ce36[_0x88ff('0x14')],'path':_0x46ce36[_0x88ff('0x0')],'headers':{'user-agent':_0x88ff('0x15')}};_0x361b89[_0x88ff('0x16')](_0x35664c,function(_0x271d23){if(_0x271d23[_0x88ff('0x17')]!==0xc8){logger[_0x88ff('0x18')](_0x88ff('0x19')+_0x5fb86d+'\x20failed,\x20status\x20code\x20=\x20'+_0x271d23['statusCode']+'\x20('+_0x271d23[_0x88ff('0x1a')]+')');_0x58fd11(new Error('request\x20to\x20'+_0x5fb86d+_0x88ff('0x1b')+_0x271d23['statusCode']+'\x20('+_0x271d23[_0x88ff('0x1a')]+')'));return;}var _0x2598d8=fs[_0x88ff('0x1c')](_0x3bf341);_0x2598d8['on'](_0x88ff('0x1d'),function(){logger[_0x88ff('0x1e')](_0x88ff('0x1f'));_0x2598d8[_0x88ff('0x20')](_0x253bf7);});_0x2598d8['on'](_0x88ff('0x18'),function(_0x12bbbf){fs['unlink'](_0x3bf341);logger[_0x88ff('0x18')](_0x88ff('0x21'),_0x12bbbf);_0x58fd11(_0x12bbbf);});_0x271d23['pipe'](_0x2598d8);})['on'](_0x88ff('0x18'),function(_0x19c78b){logger['error'](_0x19c78b);_0x58fd11(_0x19c78b);})[_0x88ff('0x22')]();});}function uploadFile(_0x44e3f6){return new BPromise(function(_0x19b169,_0x481f67){var _0x357db1=urlParse(_0x44e3f6);var _0x10e4af=_0x357db1[_0x88ff('0x12')]===_0x88ff('0x13')?https:http;var _0x495b87={'host':_0x357db1[_0x88ff('0x14')],'path':_0x357db1['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x10e4af[_0x88ff('0x16')](_0x495b87,function(_0x6634e4){if(_0x6634e4[_0x88ff('0x17')]!==0xc8){_0x481f67(new Error(_0x88ff('0x19')+_0x44e3f6+_0x88ff('0x1b')+_0x6634e4[_0x88ff('0x17')]+'\x20('+_0x6634e4['statusMessage']+')'));return;}var _0x2f4aff='';_0x6634e4['on'](_0x88ff('0x23'),function(_0x3c1c69){_0x2f4aff+=_0x3c1c69;});_0x6634e4['on']('end',function(){_0x19b169(_0x2f4aff);});})['on']('error',function(_0x131570){_0x481f67(_0x131570);})[_0x88ff('0x22')]();});}function convertFile(_0x330a88,_0x14e86c){return new BPromise(function(_0x11a326,_0x1aea7a){var _0x582bc0=sox['transcode'](_0x330a88,_0x14e86c,{'sampleRate':0x1f40,'format':_0x88ff('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x582bc0['on'](_0x88ff('0x18'),function(_0x5892b6){logger['error'](_0x88ff('0x25'),_0x5892b6);_0x1aea7a(_0x5892b6);});_0x582bc0['on']('end',function(){logger[_0x88ff('0x1e')](_0x88ff('0x26'));_0x11a326();});_0x582bc0[_0x88ff('0x27')]();});}function base64Decode(_0xf33edf,_0x1df0cb){var _0x2add49=path[_0x88ff('0x28')](__dirname,_0x88ff('0x29'),rs[_0x88ff('0x2a')](0x4)+_0x88ff('0x2b'));fs[_0x88ff('0x2c')](_0x2add49,_0xf33edf,'base64');return convertFile(_0x2add49,_0x1df0cb)[_0x88ff('0x2d')](function(){try{fs[_0x88ff('0x2e')](_0x2add49);fs[_0x88ff('0x2f')](_0x1df0cb,_0x88ff('0x30'));}catch(_0x13313e){logger[_0x88ff('0x18')](_0x13313e);}return _0x1df0cb[_0x88ff('0x31')]('.')[0x0];});}function base64Encode(_0xfe88c8){var _0x3a1ea1=fs[_0x88ff('0x32')](_0xfe88c8);return new Buffer(_0x3a1ea1)[_0x88ff('0x33')](_0x88ff('0x34'));}exports[_0x88ff('0x35')]=function(_0x52ad6a,_0x45db5c,_0x3c015f,_0x44af05,_0x3579c8){var _0x4932d1,_0x1aa3bc;var _0x37d96d=_0x88ff('0x36');var _0x23e354=_0x88ff('0x37')+_0x52ad6a;var _0x5bf408={'input':{'text':_0x45db5c},'voice':{'languageCode':_0x3c015f,'ssmlGender':_0x44af05},'audioConfig':{'audioEncoding':_0x88ff('0x38'),'sampleRateHertz':0x1f40}};var _0x1a0686={'url':_0x37d96d+_0x88ff('0x39')+_0x23e354,'method':_0x88ff('0x3a'),'json':!![],'body':_0x5bf408};return rp(_0x1a0686)['then'](function(_0x12c41a){return new BPromise(function(_0x6d90dc,_0x1698c7){_0x4932d1=path[_0x88ff('0x28')](__dirname,_0x88ff('0x29'),rs[_0x88ff('0x2a')](0x4)+'.mp3');var _0x5ddfe0=Buffer[_0x88ff('0x3b')](_0x12c41a[_0x88ff('0x3c')],_0x88ff('0x34'));return fs['writeFile'](_0x4932d1,_0x5ddfe0,function(_0x262bbd){_0x1698c7(_0x262bbd);},function(_0x103bdc){fs[_0x88ff('0x2f')](_0x4932d1,_0x88ff('0x30'));_0x6d90dc(_0x103bdc);});});})[_0x88ff('0x2d')](function(_0x120b5c){_0x1aa3bc=path['resolve'](__dirname,_0x88ff('0x29'),rs['generate'](0x4)+'.wav');return convertFile(_0x4932d1,_0x1aa3bc);})['then'](function(){try{fs[_0x88ff('0x2e')](_0x4932d1);fs['chmodSync'](_0x1aa3bc,_0x88ff('0x30'));}catch(_0xa5df39){logger['error'](_0xa5df39);}logger[_0x88ff('0x1e')]('googleCloudTTS\x20path',_0x1aa3bc[_0x88ff('0x31')]('.')[0x0]);return _0x1aa3bc['split']('.')[0x0];});};exports['googleTTS']=function(_0x4383d4,_0x4ab291){var _0x2d2752,_0x3f9ac5;return tts(_0x4383d4,_0x4ab291||'en',0x1)[_0x88ff('0x2d')](function(_0x54351f){logger[_0x88ff('0x1e')](_0x54351f);_0x2d2752=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x88ff('0x3d'));return downloadFile(_0x54351f,_0x2d2752);})['then'](function(){_0x3f9ac5=path['resolve'](__dirname,_0x88ff('0x29'),rs['generate'](0x4)+_0x88ff('0x2b'));return convertFile(_0x2d2752,_0x3f9ac5);})[_0x88ff('0x2d')](function(){try{fs[_0x88ff('0x2e')](_0x2d2752);fs[_0x88ff('0x2f')](_0x3f9ac5,_0x88ff('0x30'));}catch(_0x1b3cb9){logger[_0x88ff('0x18')](_0x1b3cb9);}logger[_0x88ff('0x1e')](_0x88ff('0x3e'),_0x3f9ac5[_0x88ff('0x31')]('.')[0x0]);return _0x3f9ac5['split']('.')[0x0];});};exports[_0x88ff('0x3f')]=function(_0x3c3c7d,_0x445fc2,_0x4822bb){return google[_0x88ff('0x40')](_0x3c3c7d,_0x445fc2,_0x4822bb)[_0x88ff('0x2d')](function(_0x3580f6){logger[_0x88ff('0x1e')](_0x3580f6[_0x88ff('0x41')]);return rp(_0x3580f6);})[_0x88ff('0x2d')](function(_0x290cff){var _0x26e807='';var _0x2b01f3=0x0;try{fs[_0x88ff('0x2e')](_0x3c3c7d);}catch(_0x4b719f){logger[_0x88ff('0x18')](_0x4b719f);}if(_0x290cff&&_0x290cff[_0x88ff('0x42')]){_0x26e807=_0x290cff[_0x88ff('0x42')][_0x88ff('0x43')](function(_0xc774c4){return _0xc774c4&&_0xc774c4[_0x88ff('0x44')][0x0]&&_0xc774c4[_0x88ff('0x44')][0x0][_0x88ff('0x45')]?_0xc774c4[_0x88ff('0x44')][0x0]['transcript']:'';})[_0x88ff('0x46')]('\x0a');_0x2b01f3=_0x290cff['results'][_0x88ff('0x43')](function(_0x4d017b){return _0x4d017b&&_0x4d017b[_0x88ff('0x44')][0x0]&&_0x4d017b['alternatives'][0x0]['confidence']?_0x4d017b['alternatives'][0x0][_0x88ff('0x47')]:0x0;})[_0x88ff('0x46')]('\x0a');}logger[_0x88ff('0x1e')](_0x88ff('0x48'),_0x26e807);logger[_0x88ff('0x1e')](_0x88ff('0x49'),_0x2b01f3);return{'transcript':_0x26e807,'confidence':_0x2b01f3};})['catch'](function(_0x4366b2){logger[_0x88ff('0x18')](_0x88ff('0x4a'),_0x4366b2[_0x88ff('0x17')],_0x4366b2[_0x88ff('0x4b')],_0x4366b2['message']);});};exports[_0x88ff('0x4c')]=function(_0x1e894e,_0x41c5db,_0x4a4eed,_0x5b0d59){var _0x38f746=apiai(_0x41c5db,{'language':_0x5b0d59||'en'});return _0x38f746[_0x88ff('0x4d')](_0x4a4eed,{'sessionId':md5(_0x1e894e)})['then'](function(_0x23b14c){logger[_0x88ff('0x1e')](JSON[_0x88ff('0x4e')](_0x23b14c));return{'source':_0x23b14c[_0x88ff('0x4f')][_0x88ff('0x50')],'resolvedQuery':_0x23b14c[_0x88ff('0x4f')][_0x88ff('0x51')],'action':_0x23b14c['result'][_0x88ff('0x52')],'actionIncomplete':_0x23b14c['result'][_0x88ff('0x53')],'speech':_0x23b14c[_0x88ff('0x4f')][_0x88ff('0x54')][_0x88ff('0x55')],'score':_0x23b14c['result'][_0x88ff('0x56')],'statusCode':_0x23b14c[_0x88ff('0x57')][_0x88ff('0x58')],'endConversation':_0x23b14c['result'][_0x88ff('0x59')][_0x88ff('0x5a')]||![],'isFallbackIntent':_0x23b14c['result'][_0x88ff('0x59')][_0x88ff('0x5b')]};});};exports[_0x88ff('0x5c')]=function(_0x38b128,_0x27528d,_0x373f2f,_0x33dfee){return tilde[_0x88ff('0x40')](_0x38b128,_0x27528d,_0x373f2f,_0x33dfee)[_0x88ff('0x2d')](function(_0x1b3348){try{fs['unlink'](_0x38b128);}catch(_0x554245){logger[_0x88ff('0x18')](_0x554245);}logger['info'](_0x88ff('0x5d'),_0x1b3348[_0x88ff('0x45')]);logger[_0x88ff('0x1e')]('Tilde\x20ASR\x20confidence',_0x1b3348[_0x88ff('0x47')]);return _0x1b3348;});};exports[_0x88ff('0x5e')]=function(_0x1a4633,_0x2115f6,_0x58361a,_0x153646,_0x5c2a59,_0x1c8334){var _0x155d0f=path['resolve'](__dirname,_0x88ff('0x29'),rs[_0x88ff('0x2a')](0x4)+_0x88ff('0x3d'));var _0x5a2739;return aws['polly'](_0x1a4633,_0x2115f6,_0x58361a,_0x153646,_0x5c2a59,_0x1c8334,_0x155d0f)[_0x88ff('0x2d')](function(){_0x5a2739=path['resolve'](__dirname,_0x88ff('0x29'),rs['generate'](0x4)+_0x88ff('0x2b'));return convertFile(_0x155d0f,_0x5a2739);})[_0x88ff('0x2d')](function(){try{fs[_0x88ff('0x2e')](_0x155d0f);fs['chmodSync'](_0x5a2739,_0x88ff('0x30'));}catch(_0x59f57b){logger[_0x88ff('0x18')](_0x59f57b);}return _0x5a2739['split']('.')[0x0];});};exports[_0x88ff('0x5f')]=function(_0x39db45,_0x31d6ca,_0xda09d2,_0x1d14cc,_0xda61e1,_0x39cad2){return aws[_0x88ff('0x60')](_0x39db45,_0x31d6ca,_0xda09d2,_0x1d14cc,_0xda61e1,_0x39cad2)[_0x88ff('0x2d')](function(_0x30bd1f){logger['info'](JSON[_0x88ff('0x4e')](_0x30bd1f));return _0x30bd1f;});};exports[_0x88ff('0x61')]=function(_0x594016,_0x26d2e1,_0x3900e6,_0xb743ce){var _0x3708b0=util[_0x88ff('0x62')](_0x88ff('0x63'),ISPEECH_API,_0x594016,encodeURIComponent(_0x26d2e1),_0x3900e6,_0xb743ce);var _0xf0404e=path[_0x88ff('0x28')](__dirname,_0x88ff('0x29'),rs[_0x88ff('0x2a')](0x4)+_0x88ff('0x3d'));var _0x44c6f4;return downloadFile(_0x3708b0,_0xf0404e)[_0x88ff('0x2d')](function(){_0x44c6f4=path[_0x88ff('0x28')](__dirname,_0x88ff('0x29'),rs[_0x88ff('0x2a')](0x4)+_0x88ff('0x2b'));return convertFile(_0xf0404e,_0x44c6f4);})[_0x88ff('0x2d')](function(){try{fs['unlink'](_0xf0404e);fs[_0x88ff('0x2f')](_0x44c6f4,'777');}catch(_0x27aab6){logger[_0x88ff('0x18')](_0x27aab6);}return _0x44c6f4[_0x88ff('0x31')]('.')[0x0];});};exports[_0x88ff('0x64')]=function(_0x202ac8,_0xe07965,_0xb5343d,_0x55e326){var _0x333d73=util[_0x88ff('0x62')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0xe07965,_0xb5343d,base64Encode(_0x202ac8),_0x55e326?util['format']('model=%s',encodeURIComponent(_0x55e326)):_0x88ff('0x65'));return uploadFile(_0x333d73)[_0x88ff('0x2d')](function(_0x2c60c4){return querystring[_0x88ff('0x3')](_0x2c60c4);});};exports['sestekNDA']=function(_0x4b572f,_0x271e5e){return sestek['nda'](_0x4b572f,_0x271e5e)[_0x88ff('0x2d')](function(_0x1421de){logger['info'](JSON[_0x88ff('0x4e')](_0x1421de));var _0x57d650={'speech':_0x1421de[_0x88ff('0x66')],'action':_0x1421de[_0x88ff('0x67')]?_0x1421de[_0x88ff('0x67')][_0x88ff('0x68')]:undefined,'actiondata':_0x1421de[_0x88ff('0x67')]?_0x1421de[_0x88ff('0x67')][_0x88ff('0x69')]:undefined};if(_0x1421de[_0x88ff('0x67')]&&_0x1421de['channelData'][_0x88ff('0x6a')]){return base64Decode(_0x1421de[_0x88ff('0x67')][_0x88ff('0x6a')][_0x88ff('0x6b')],path[_0x88ff('0x28')](__dirname,_0x88ff('0x29'),rs[_0x88ff('0x2a')](0x4)+_0x88ff('0x2b')))[_0x88ff('0x2d')](function(_0x3adca2){_0x57d650['audiofile']=_0x3adca2;return _0x57d650;});}return _0x57d650;});};exports[_0x88ff('0x6c')]=function(){return __dirname;}; \ No newline at end of file +var _0x6854=['google-tts-api','apiai-promise','md5','./google','./aws','./tilde','./sestek','../../../config/logger','protocol','https:','path','WHAT_EVER','get','statusCode','error','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','host','data','end','wav','error\x20convert','finish\x20to\x20convert','start','.wav','writeFileSync','base64','then','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','MP3','text:synthesize','POST','tmp','generate','.mp3','from','audioContent','writeFile','777','resolve','googleCloudTTS\x20path','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','fulfillment','speech','score','code','endConversation','metadata','tildeASR','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','http','https','parse','bluebird','sox','request-promise','util','querystring','moment'];(function(_0x3595b5,_0x4f2965){var _0x5addd4=function(_0x360610){while(--_0x360610){_0x3595b5['push'](_0x3595b5['shift']());}};_0x5addd4(++_0x4f2965);}(_0x6854,0xd5));var _0x4685=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0x6854[_0x95411e];return _0x2c8718;};'use strict';var fs=require('fs');var path=require('path');var http=require(_0x4685('0x0'));var https=require(_0x4685('0x1'));var urlParse=require('url')[_0x4685('0x2')];var BPromise=require(_0x4685('0x3'));var rs=require('randomstring');var sox=require(_0x4685('0x4'));var rp=require(_0x4685('0x5'));var util=require(_0x4685('0x6'));var querystring=require(_0x4685('0x7'));var moment=require(_0x4685('0x8'));var tts=require(_0x4685('0x9'));var apiai=require(_0x4685('0xa'));var md5=require(_0x4685('0xb'));var google=require(_0x4685('0xc'));var aws=require(_0x4685('0xd'));var tilde=require(_0x4685('0xe'));var sestek=require(_0x4685('0xf'));var logger=require(_0x4685('0x10'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x5f300b,_0x1af536){return new BPromise(function(_0x1fc851,_0xbb7bbd){var _0x3267a9=urlParse(_0x5f300b);var _0x5e99f6=_0x3267a9[_0x4685('0x11')]===_0x4685('0x12')?https:http;var _0x4a913f={'host':_0x3267a9['host'],'path':_0x3267a9[_0x4685('0x13')],'headers':{'user-agent':_0x4685('0x14')}};_0x5e99f6[_0x4685('0x15')](_0x4a913f,function(_0x312158){if(_0x312158[_0x4685('0x16')]!==0xc8){logger[_0x4685('0x17')]('request\x20to\x20'+_0x5f300b+'\x20failed,\x20status\x20code\x20=\x20'+_0x312158[_0x4685('0x16')]+'\x20('+_0x312158[_0x4685('0x18')]+')');_0xbb7bbd(new Error(_0x4685('0x19')+_0x5f300b+_0x4685('0x1a')+_0x312158[_0x4685('0x16')]+'\x20('+_0x312158[_0x4685('0x18')]+')'));return;}var _0x47aa16=fs[_0x4685('0x1b')](_0x1af536);_0x47aa16['on'](_0x4685('0x1c'),function(){logger[_0x4685('0x1d')](_0x4685('0x1e'));_0x47aa16[_0x4685('0x1f')](_0x1fc851);});_0x47aa16['on']('error',function(_0x87f0f){fs[_0x4685('0x20')](_0x1af536);logger['error'](_0x4685('0x21'),_0x87f0f);_0xbb7bbd(_0x87f0f);});_0x312158[_0x4685('0x22')](_0x47aa16);})['on'](_0x4685('0x17'),function(_0x41c806){logger[_0x4685('0x17')](_0x41c806);_0xbb7bbd(_0x41c806);})['end']();});}function uploadFile(_0x1a4c3c){return new BPromise(function(_0x47a96d,_0x2208fc){var _0x111718=urlParse(_0x1a4c3c);var _0x114377=_0x111718[_0x4685('0x11')]===_0x4685('0x12')?https:http;var _0xded0b3={'host':_0x111718[_0x4685('0x23')],'path':_0x111718['path'],'headers':{'user-agent':_0x4685('0x14')}};_0x114377[_0x4685('0x15')](_0xded0b3,function(_0x49b1fe){if(_0x49b1fe[_0x4685('0x16')]!==0xc8){_0x2208fc(new Error(_0x4685('0x19')+_0x1a4c3c+'\x20failed,\x20status\x20code\x20=\x20'+_0x49b1fe[_0x4685('0x16')]+'\x20('+_0x49b1fe['statusMessage']+')'));return;}var _0x4565b7='';_0x49b1fe['on'](_0x4685('0x24'),function(_0x36b9a7){_0x4565b7+=_0x36b9a7;});_0x49b1fe['on']('end',function(){_0x47a96d(_0x4565b7);});})['on'](_0x4685('0x17'),function(_0xafc284){_0x2208fc(_0xafc284);})[_0x4685('0x25')]();});}function convertFile(_0x438596,_0x286c8a){return new BPromise(function(_0x13432c,_0xd06cb2){var _0x4361f2=sox['transcode'](_0x438596,_0x286c8a,{'sampleRate':0x1f40,'format':_0x4685('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4361f2['on'](_0x4685('0x17'),function(_0x2498a1){logger[_0x4685('0x17')](_0x4685('0x27'),_0x2498a1);_0xd06cb2(_0x2498a1);});_0x4361f2['on'](_0x4685('0x25'),function(){logger[_0x4685('0x1d')](_0x4685('0x28'));_0x13432c();});_0x4361f2[_0x4685('0x29')]();});}function base64Decode(_0x3b96fd,_0x5e71ae){var _0x3dbab0=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x4685('0x2a'));fs[_0x4685('0x2b')](_0x3dbab0,_0x3b96fd,_0x4685('0x2c'));return convertFile(_0x3dbab0,_0x5e71ae)[_0x4685('0x2d')](function(){try{fs[_0x4685('0x20')](_0x3dbab0);fs[_0x4685('0x2e')](_0x5e71ae,'777');}catch(_0x260e0e){logger[_0x4685('0x17')](_0x260e0e);}return _0x5e71ae[_0x4685('0x2f')]('.')[0x0];});}function base64Encode(_0x393f46){var _0x455656=fs[_0x4685('0x30')](_0x393f46);return new Buffer(_0x455656)[_0x4685('0x31')](_0x4685('0x2c'));}exports[_0x4685('0x32')]=function(_0x13dd00,_0x1f0f96,_0x173a8e,_0x2d626c,_0x3da05a){var _0xeb8dae,_0x355981;var _0x13f539=_0x4685('0x33');var _0x30ca94=_0x4685('0x34')+_0x13dd00;var _0x5adf69={'input':{'text':_0x1f0f96},'voice':{'languageCode':_0x173a8e,'ssmlGender':_0x2d626c},'audioConfig':{'audioEncoding':_0x4685('0x35'),'sampleRateHertz':0x1f40}};var _0x887b85={'url':_0x13f539+_0x4685('0x36')+_0x30ca94,'method':_0x4685('0x37'),'json':!![],'body':_0x5adf69};return rp(_0x887b85)['then'](function(_0x3dbddb){return new BPromise(function(_0x5e667c,_0x14aef4){_0xeb8dae=path['resolve'](__dirname,_0x4685('0x38'),rs[_0x4685('0x39')](0x4)+_0x4685('0x3a'));var _0x3e67ac=Buffer[_0x4685('0x3b')](_0x3dbddb[_0x4685('0x3c')],_0x4685('0x2c'));return fs[_0x4685('0x3d')](_0xeb8dae,_0x3e67ac,function(_0x290b76){_0x14aef4(_0x290b76);},function(_0xbb063d){fs[_0x4685('0x2e')](_0xeb8dae,_0x4685('0x3e'));_0x5e667c(_0xbb063d);});});})[_0x4685('0x2d')](function(_0x22cf87){_0x355981=path[_0x4685('0x3f')](__dirname,_0x4685('0x38'),rs[_0x4685('0x39')](0x4)+_0x4685('0x2a'));return convertFile(_0xeb8dae,_0x355981);})[_0x4685('0x2d')](function(){try{fs[_0x4685('0x20')](_0xeb8dae);fs[_0x4685('0x2e')](_0x355981,'777');}catch(_0x203088){logger[_0x4685('0x17')](_0x203088);}logger[_0x4685('0x1d')](_0x4685('0x40'),_0x355981[_0x4685('0x2f')]('.')[0x0]);return _0x355981[_0x4685('0x2f')]('.')[0x0];});};exports['googleTTS']=function(_0xf5c4d9,_0x35d31b){var _0x2f0090,_0x2a8d7c;return tts(_0xf5c4d9,_0x35d31b||'en',0x1)[_0x4685('0x2d')](function(_0x33ae6a){logger[_0x4685('0x1d')](_0x33ae6a);_0x2f0090=path[_0x4685('0x3f')](__dirname,_0x4685('0x38'),rs[_0x4685('0x39')](0x4)+'.mp3');return downloadFile(_0x33ae6a,_0x2f0090);})['then'](function(){_0x2a8d7c=path['resolve'](__dirname,_0x4685('0x38'),rs[_0x4685('0x39')](0x4)+_0x4685('0x2a'));return convertFile(_0x2f0090,_0x2a8d7c);})[_0x4685('0x2d')](function(){try{fs[_0x4685('0x20')](_0x2f0090);fs[_0x4685('0x2e')](_0x2a8d7c,'777');}catch(_0x66ea39){logger[_0x4685('0x17')](_0x66ea39);}logger[_0x4685('0x1d')](_0x4685('0x41'),_0x2a8d7c[_0x4685('0x2f')]('.')[0x0]);return _0x2a8d7c['split']('.')[0x0];});};exports[_0x4685('0x42')]=function(_0x47cbb0,_0x8aec67,_0x40ff0b){return google[_0x4685('0x43')](_0x47cbb0,_0x8aec67,_0x40ff0b)[_0x4685('0x2d')](function(_0x10a6dd){logger['info'](_0x10a6dd[_0x4685('0x44')]);return rp(_0x10a6dd);})[_0x4685('0x2d')](function(_0x267e89){var _0x73ddba='';var _0x2a84ee=0x0;try{fs[_0x4685('0x20')](_0x47cbb0);}catch(_0x250481){logger[_0x4685('0x17')](_0x250481);}if(_0x267e89&&_0x267e89['results']){_0x73ddba=_0x267e89[_0x4685('0x45')][_0x4685('0x46')](function(_0x598d37){return _0x598d37&&_0x598d37['alternatives'][0x0]&&_0x598d37[_0x4685('0x47')][0x0][_0x4685('0x48')]?_0x598d37[_0x4685('0x47')][0x0][_0x4685('0x48')]:'';})[_0x4685('0x49')]('\x0a');_0x2a84ee=_0x267e89['results'][_0x4685('0x46')](function(_0x2a49dc){return _0x2a49dc&&_0x2a49dc['alternatives'][0x0]&&_0x2a49dc['alternatives'][0x0]['confidence']?_0x2a49dc[_0x4685('0x47')][0x0][_0x4685('0x4a')]:0x0;})['join']('\x0a');}logger[_0x4685('0x1d')](_0x4685('0x4b'),_0x73ddba);logger[_0x4685('0x1d')](_0x4685('0x4c'),_0x2a84ee);return{'transcript':_0x73ddba,'confidence':_0x2a84ee};})[_0x4685('0x4d')](function(_0x134c6a){logger[_0x4685('0x17')](_0x4685('0x4e'),_0x134c6a[_0x4685('0x16')],_0x134c6a[_0x4685('0x4f')],_0x134c6a[_0x4685('0x50')]);});};exports[_0x4685('0x51')]=function(_0x239acf,_0x174054,_0x424fd4,_0x399752){var _0x3248cc=apiai(_0x174054,{'language':_0x399752||'en'});return _0x3248cc[_0x4685('0x52')](_0x424fd4,{'sessionId':md5(_0x239acf)})['then'](function(_0x2a3528){logger[_0x4685('0x1d')](JSON[_0x4685('0x53')](_0x2a3528));return{'source':_0x2a3528[_0x4685('0x54')][_0x4685('0x55')],'resolvedQuery':_0x2a3528[_0x4685('0x54')][_0x4685('0x56')],'action':_0x2a3528['result'][_0x4685('0x57')],'actionIncomplete':_0x2a3528['result']['actionIncomplete'],'speech':_0x2a3528[_0x4685('0x54')][_0x4685('0x58')][_0x4685('0x59')],'score':_0x2a3528[_0x4685('0x54')][_0x4685('0x5a')],'statusCode':_0x2a3528['status'][_0x4685('0x5b')],'endConversation':_0x2a3528[_0x4685('0x54')]['metadata'][_0x4685('0x5c')]||![],'isFallbackIntent':_0x2a3528['result'][_0x4685('0x5d')]['isFallbackIntent']};});};exports[_0x4685('0x5e')]=function(_0x344d34,_0xe4ec53,_0x57f14b,_0x291c04){return tilde[_0x4685('0x43')](_0x344d34,_0xe4ec53,_0x57f14b,_0x291c04)[_0x4685('0x2d')](function(_0x35763a){try{fs[_0x4685('0x20')](_0x344d34);}catch(_0x489fb4){logger[_0x4685('0x17')](_0x489fb4);}logger[_0x4685('0x1d')]('Tilde\x20ASR\x20transcription',_0x35763a[_0x4685('0x48')]);logger[_0x4685('0x1d')]('Tilde\x20ASR\x20confidence',_0x35763a[_0x4685('0x4a')]);return _0x35763a;});};exports[_0x4685('0x5f')]=function(_0x4480c5,_0x25bb24,_0x2ce52a,_0xf36519,_0x9e45e3,_0x5dd3af){var _0x45d0d8=path[_0x4685('0x3f')](__dirname,_0x4685('0x38'),rs[_0x4685('0x39')](0x4)+'.mp3');var _0x4641fe;return aws[_0x4685('0x60')](_0x4480c5,_0x25bb24,_0x2ce52a,_0xf36519,_0x9e45e3,_0x5dd3af,_0x45d0d8)[_0x4685('0x2d')](function(){_0x4641fe=path['resolve'](__dirname,_0x4685('0x38'),rs[_0x4685('0x39')](0x4)+_0x4685('0x2a'));return convertFile(_0x45d0d8,_0x4641fe);})['then'](function(){try{fs[_0x4685('0x20')](_0x45d0d8);fs[_0x4685('0x2e')](_0x4641fe,_0x4685('0x3e'));}catch(_0x10c429){logger[_0x4685('0x17')](_0x10c429);}return _0x4641fe['split']('.')[0x0];});};exports['awsLex']=function(_0x1902ea,_0x45c4ad,_0x534fb3,_0x5053af,_0x37ec79,_0x3cbe25){return aws[_0x4685('0x61')](_0x1902ea,_0x45c4ad,_0x534fb3,_0x5053af,_0x37ec79,_0x3cbe25)[_0x4685('0x2d')](function(_0x2ae68b){logger[_0x4685('0x1d')](JSON[_0x4685('0x53')](_0x2ae68b));return _0x2ae68b;});};exports[_0x4685('0x62')]=function(_0x1db8ad,_0x3cc7c2,_0x4fdd43,_0x38eb8b){var _0x20acfe=util[_0x4685('0x63')](_0x4685('0x64'),ISPEECH_API,_0x1db8ad,encodeURIComponent(_0x3cc7c2),_0x4fdd43,_0x38eb8b);var _0x22f083=path[_0x4685('0x3f')](__dirname,'tmp',rs[_0x4685('0x39')](0x4)+_0x4685('0x3a'));var _0xbb94;return downloadFile(_0x20acfe,_0x22f083)['then'](function(){_0xbb94=path[_0x4685('0x3f')](__dirname,_0x4685('0x38'),rs[_0x4685('0x39')](0x4)+_0x4685('0x2a'));return convertFile(_0x22f083,_0xbb94);})[_0x4685('0x2d')](function(){try{fs['unlink'](_0x22f083);fs[_0x4685('0x2e')](_0xbb94,_0x4685('0x3e'));}catch(_0x1cd3ee){logger[_0x4685('0x17')](_0x1cd3ee);}return _0xbb94[_0x4685('0x2f')]('.')[0x0];});};exports[_0x4685('0x65')]=function(_0xb5fa9d,_0x1f583c,_0x11af82,_0x31ca88){var _0x522967=util[_0x4685('0x63')](_0x4685('0x66'),ISPEECH_API,_0x1f583c,_0x11af82,base64Encode(_0xb5fa9d),_0x31ca88?util['format']('model=%s',encodeURIComponent(_0x31ca88)):_0x4685('0x67'));return uploadFile(_0x522967)['then'](function(_0x2a30d6){return querystring[_0x4685('0x2')](_0x2a30d6);});};exports['sestekNDA']=function(_0x44b64b,_0x12d3e0){return sestek['nda'](_0x44b64b,_0x12d3e0)[_0x4685('0x2d')](function(_0x5eb809){logger[_0x4685('0x1d')](JSON[_0x4685('0x53')](_0x5eb809));var _0x43a2f9={'speech':_0x5eb809[_0x4685('0x68')],'action':_0x5eb809[_0x4685('0x69')]?_0x5eb809[_0x4685('0x69')][_0x4685('0x6a')]:undefined,'actiondata':_0x5eb809[_0x4685('0x69')]?_0x5eb809[_0x4685('0x69')][_0x4685('0x6b')]:undefined};if(_0x5eb809[_0x4685('0x69')]&&_0x5eb809[_0x4685('0x69')][_0x4685('0x6c')]){return base64Decode(_0x5eb809[_0x4685('0x69')][_0x4685('0x6c')][_0x4685('0x6d')],path[_0x4685('0x3f')](__dirname,_0x4685('0x38'),rs[_0x4685('0x39')](0x4)+_0x4685('0x2a')))[_0x4685('0x2d')](function(_0x19a7d1){_0x43a2f9['audiofile']=_0x19a7d1;return _0x43a2f9;});}return _0x43a2f9;});};exports[_0x4685('0x6e')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 8e7436b..3c5ba76 100644 --- a/server/services/agi/scripts/sestek/index.js +++ b/server/services/agi/scripts/sestek/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90a2=['exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x90a2,0x6e));var _0x290a=function(_0x391ef4,_0x4cef30){_0x391ef4=_0x391ef4-0x0;var _0x63aeaa=_0x90a2[_0x391ef4];return _0x63aeaa;};var nda=require('./nda');module[_0x290a('0x0')]={'nda':nda}; \ No newline at end of file +var _0xa1c6=['./nda','exports'];(function(_0x33975c,_0x50d085){var _0x1c15ab=function(_0x54e8bc){while(--_0x54e8bc){_0x33975c['push'](_0x33975c['shift']());}};_0x1c15ab(++_0x50d085);}(_0xa1c6,0x100));var _0x6a1c=function(_0x2a9bd3,_0x70c007){_0x2a9bd3=_0x2a9bd3-0x0;var _0xe7e5de=_0xa1c6[_0x2a9bd3];return _0xe7e5de;};var nda=require(_0x6a1c('0x0'));module[_0x6a1c('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index dfe4474..d747b3b 100644 --- a/server/services/agi/scripts/sestek/nda/index.js +++ b/server/services/agi/scripts/sestek/nda/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1fa=['project','channelData','custom_action','CustomAction','info','request-promise','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','body'];(function(_0x543569,_0x3035db){var _0x491c80=function(_0x3fe9f5){while(--_0x3fe9f5){_0x543569['push'](_0x543569['shift']());}};_0x491c80(++_0x3035db);}(_0xc1fa,0x79));var _0xac1f=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xc1fa[_0xca1f0e];return _0x35e4ef;};'use strict';var rp=require(_0xac1f('0x0'));var url=require(_0xac1f('0x1'));var logger=require(_0xac1f('0x2'))('agi');module[_0xac1f('0x3')]=function(_0x72c470,_0x1a7fcb){var _0x53ec22={'method':_0xac1f('0x4'),'uri':url[_0xac1f('0x5')](_0x1a7fcb[_0xac1f('0x6')],_0xac1f('0x7')),'form':{'grant_type':_0xac1f('0x8'),'username':_0x1a7fcb[_0xac1f('0x9')],'password':_0x1a7fcb[_0xac1f('0x8')]},'json':!![]};return rp(_0x53ec22)[_0xac1f('0xa')](function(_0x42a9d4){var _0x5d131c={'method':'POST','uri':url[_0xac1f('0x5')](_0x1a7fcb[_0xac1f('0xb')],_0xac1f('0xc')),'body':{'type':_0x1a7fcb[_0xac1f('0xd')]||'message','channelId':_0xac1f('0xe'),'conversation':{'id':_0x72c470[_0xac1f('0xf')]},'from':{'id':_0x72c470[_0xac1f('0x10')],'name':_0x72c470[_0xac1f('0x11')]},'recipient':{'id':_0x72c470[_0xac1f('0x12')],'name':_0x72c470[_0xac1f('0x13')]},'text':_0x1a7fcb[_0xac1f('0x14')],'channelData':{}},'headers':{'Authorization':_0xac1f('0x15')+_0x42a9d4[_0xac1f('0x16')]},'json':!![]};if(_0x1a7fcb['project']){_0x5d131c[_0xac1f('0x17')]['channelData']['ProjectName']=_0x1a7fcb[_0xac1f('0x18')];}if(_0x1a7fcb['ndagenerate_audio']=='1'){_0x5d131c[_0xac1f('0x17')][_0xac1f('0x19')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x1a7fcb[_0xac1f('0x1a')]){_0x5d131c[_0xac1f('0x17')][_0xac1f('0x19')][_0xac1f('0x1b')]=_0x1a7fcb[_0xac1f('0x1a')];if(_0x1a7fcb['custom_action_data']){_0x5d131c['body'][_0xac1f('0x19')]['CustomActionData']=_0x1a7fcb['custom_action_data'];}}logger[_0xac1f('0x1c')](JSON['stringify'](_0x5d131c));return rp(_0x5d131c);});}; \ No newline at end of file +var _0xddca=['POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','body','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','CustomActionData','info','request-promise','url','agi','exports'];(function(_0x25dbd4,_0x359199){var _0x55ca7e=function(_0x4cafad){while(--_0x4cafad){_0x25dbd4['push'](_0x25dbd4['shift']());}};_0x55ca7e(++_0x359199);}(_0xddca,0xd5));var _0xaddc=function(_0x3ac31a,_0x18f1b9){_0x3ac31a=_0x3ac31a-0x0;var _0x4caa11=_0xddca[_0x3ac31a];return _0x4caa11;};'use strict';var rp=require(_0xaddc('0x0'));var url=require(_0xaddc('0x1'));var logger=require('../../../../../config/logger')(_0xaddc('0x2'));module[_0xaddc('0x3')]=function(_0x1087b8,_0x14e827){var _0x10d8b8={'method':_0xaddc('0x4'),'uri':url[_0xaddc('0x5')](_0x14e827[_0xaddc('0x6')],_0xaddc('0x7')),'form':{'grant_type':_0xaddc('0x8'),'username':_0x14e827[_0xaddc('0x9')],'password':_0x14e827[_0xaddc('0x8')]},'json':!![]};return rp(_0x10d8b8)[_0xaddc('0xa')](function(_0x571e63){var _0x454b39={'method':'POST','uri':url[_0xaddc('0x5')](_0x14e827[_0xaddc('0xb')],_0xaddc('0xc')),'body':{'type':_0x14e827[_0xaddc('0xd')]||'message','channelId':'Nda','conversation':{'id':_0x1087b8[_0xaddc('0xe')]},'from':{'id':_0x1087b8[_0xaddc('0xf')],'name':_0x1087b8[_0xaddc('0x10')]},'recipient':{'id':_0x1087b8[_0xaddc('0x11')],'name':_0x1087b8[_0xaddc('0x12')]},'text':_0x14e827[_0xaddc('0x13')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x571e63[_0xaddc('0x14')]},'json':!![]};if(_0x14e827[_0xaddc('0x15')]){_0x454b39[_0xaddc('0x16')][_0xaddc('0x17')]['ProjectName']=_0x14e827[_0xaddc('0x15')];}if(_0x14e827[_0xaddc('0x18')]=='1'){_0x454b39[_0xaddc('0x16')][_0xaddc('0x17')][_0xaddc('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xaddc('0x1a')};}if(_0x14e827['custom_action']){_0x454b39[_0xaddc('0x16')][_0xaddc('0x17')][_0xaddc('0x1b')]=_0x14e827[_0xaddc('0x1c')];if(_0x14e827['custom_action_data']){_0x454b39[_0xaddc('0x16')][_0xaddc('0x17')][_0xaddc('0x1d')]=_0x14e827['custom_action_data'];}}logger[_0xaddc('0x1e')](JSON['stringify'](_0x454b39));return rp(_0x454b39);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/index.js b/server/services/agi/scripts/tilde/asr/index.js index ed222bc..eb71896 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cc3=['exports'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x9cc3,0x174));var _0x39cc=function(_0x32da87,_0x795f1a){_0x32da87=_0x32da87-0x0;var _0x480fd0=_0x9cc3[_0x32da87];return _0x480fd0;};'use strict';var asr=require('./lib/api');module[_0x39cc('0x0')]=function(_0x256e0e,_0x55cdac,_0x2ba2b5,_0x2101df){return asr(_0x256e0e,_0x55cdac,_0x2ba2b5,_0x2101df);}; \ No newline at end of file +var _0x40a2=['exports'];(function(_0x55ff5b,_0x12411e){var _0x249024=function(_0x501ac2){while(--_0x501ac2){_0x55ff5b['push'](_0x55ff5b['shift']());}};_0x249024(++_0x12411e);}(_0x40a2,0x9a));var _0x240a=function(_0x48e245,_0x4f0d6e){_0x48e245=_0x48e245-0x0;var _0x53d2a1=_0x40a2[_0x48e245];return _0x53d2a1;};'use strict';var asr=require('./lib/api');module[_0x240a('0x0')]=function(_0x14020d,_0x476160,_0x5b7e12,_0xf24a38){return asr(_0x14020d,_0x476160,_0x5b7e12,_0xf24a38);}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/lib/api.js b/server/services/agi/scripts/tilde/asr/lib/api.js index 97b0dff..312ffb5 100644 --- a/server/services/agi/scripts/tilde/asr/lib/api.js +++ b/server/services/agi/scripts/tilde/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a65=['EOS','error','Tilde\x20ASR\x20send\x20error','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','moment','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','close'];(function(_0xab9087,_0x15ad0e){var _0x36f4ff=function(_0x5a5970){while(--_0x5a5970){_0xab9087['push'](_0xab9087['shift']());}};_0x36f4ff(++_0x15ad0e);}(_0x2a65,0x135));var _0x52a6=function(_0x4e7d4a,_0x35cdc8){_0x4e7d4a=_0x4e7d4a-0x0;var _0x235800=_0x2a65[_0x4e7d4a];return _0x235800;};'use strict';var BPromise=require(_0x52a6('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x52a6('0x1'));var crypto=require(_0x52a6('0x2'));var logger=require('../../../../../../config/logger')(_0x52a6('0x3'));module[_0x52a6('0x4')]=function(_0x3abbd7,_0x17f8d7,_0x435e94,_0x35f7fa){return new BPromise(function(_0x187947,_0x4afc63){logger[_0x52a6('0x5')](_0x52a6('0x6'),_0x35f7fa||_0x52a6('0x7'));var _0x4d5de1=new WebSocket(_0x35f7fa||_0x52a6('0x7'),{'perMessageDeflate':![]});var _0x41e166='';var _0x1a58eb='0';var _0x462e05='1';var _0x479330=_0x52a6('0x8');function _0x8b7a3(_0x249a83){var _0x2aa73d=crypto['createHash'](_0x52a6('0x9'));_0x2aa73d[_0x52a6('0xa')](_0x249a83);return _0x2aa73d[_0x52a6('0xb')](_0x52a6('0xc'));}function _0x3121ec(){try{logger[_0x52a6('0x5')](_0x52a6('0xd'));var _0x54a797=moment()['unix']();var _0x19bc5f=_0x8b7a3(_0x54a797+_0x17f8d7+_0x435e94);_0x4d5de1[_0x52a6('0xe')](JSON[_0x52a6('0xf')]({'appID':_0x17f8d7,'timestamp':_0x54a797,'appKey':_0x19bc5f}));var _0x4c654b=fs[_0x52a6('0x10')](_0x3abbd7);_0x4c654b['on'](_0x52a6('0x11'),function(_0x1d9185){_0x4d5de1['send'](_0x1d9185);});_0x4c654b['on'](_0x52a6('0x12'),function(){_0x4d5de1[_0x52a6('0xe')](_0x52a6('0x13'));});}catch(_0x51a6e3){logger[_0x52a6('0x14')](_0x52a6('0x15'),JSON['stringify'](_0x51a6e3));_0x4d5de1['terminate']();}}function _0x325162(_0x59aff0){try{if(_0x59aff0){var _0x236a60=JSON[_0x52a6('0x16')](_0x59aff0);switch(_0x236a60['status']){case 0x0:if(_0x236a60[_0x52a6('0x17')]){if(_0x236a60['result'][_0x52a6('0x18')]){logger['info'](_0x52a6('0x19'),JSON[_0x52a6('0xf')](_0x236a60['result'][_0x52a6('0x1a')]));_0x41e166=_0x236a60[_0x52a6('0x17')][_0x52a6('0x1a')][0x0][_0x52a6('0x1b')];_0x1a58eb=_0x236a60[_0x52a6('0x17')][_0x52a6('0x1a')][0x0][_0x52a6('0x1c')];_0x462e05='0';_0x479330=_0x52a6('0x1d');_0x4d5de1[_0x52a6('0x1e')]();}}break;case 0x1:logger[_0x52a6('0x5')](_0x52a6('0x8'));_0x462e05='1';_0x479330='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x52a6('0x5')](_0x52a6('0x1f'));_0x462e05='2';_0x479330=_0x52a6('0x1f');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x462e05='9';_0x479330='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x52a6('0x5')]('Authentication\x20failed.');_0x462e05='10';_0x479330=_0x52a6('0x20');break;case 0xb:logger[_0x52a6('0x5')](_0x52a6('0x21'));_0x462e05='11';_0x479330=_0x52a6('0x21');}}}catch(_0x370ea4){logger[_0x52a6('0x14')](_0x52a6('0x22'),JSON[_0x52a6('0xf')](_0x370ea4));_0x4d5de1['terminate']();}}function _0x1eab0b(){logger['info'](_0x52a6('0x23'));_0x187947({'transcript':_0x41e166,'confidence':_0x1a58eb,'status':_0x462e05,'status_message':_0x479330});}function _0x2e3cca(_0x27da72){logger[_0x52a6('0x14')](_0x52a6('0x24'));if(!_[_0x52a6('0x25')](_0x27da72)){logger['error'](_[_0x52a6('0x26')](_0x27da72)?JSON[_0x52a6('0xf')](_0x27da72):_0x27da72);}}_0x4d5de1['on'](_0x52a6('0x27'),_0x3121ec);_0x4d5de1['on'](_0x52a6('0x28'),_0x325162);_0x4d5de1['on']('close',_0x1eab0b);_0x4d5de1['on'](_0x52a6('0x14'),_0x2e3cca);});}; \ No newline at end of file +var _0x6b4a=['lodash','moment','crypto','../../../../../../config/logger','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','unix','send','stringify','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','info','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird'];(function(_0x4cefc3,_0x23f291){var _0x1cc779=function(_0x7cb914){while(--_0x7cb914){_0x4cefc3['push'](_0x4cefc3['shift']());}};_0x1cc779(++_0x23f291);}(_0x6b4a,0x147));var _0xa6b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b4a[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xa6b4('0x0'));var _=require(_0xa6b4('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xa6b4('0x2'));var crypto=require(_0xa6b4('0x3'));var logger=require(_0xa6b4('0x4'))('agi');module[_0xa6b4('0x5')]=function(_0x402e09,_0x5c7d02,_0x356f31,_0x3d7779){return new BPromise(function(_0x4c8f36,_0x1e3cda){logger['info'](_0xa6b4('0x6'),_0x3d7779||_0xa6b4('0x7'));var _0x358779=new WebSocket(_0x3d7779||_0xa6b4('0x7'),{'perMessageDeflate':![]});var _0x5a973e='';var _0x5ab2af='0';var _0x2e10bd='1';var _0x824650=_0xa6b4('0x8');function _0x578238(_0x4d46e7){var _0x31c5ad=crypto[_0xa6b4('0x9')](_0xa6b4('0xa'));_0x31c5ad[_0xa6b4('0xb')](_0x4d46e7);return _0x31c5ad[_0xa6b4('0xc')](_0xa6b4('0xd'));}function _0x375d8b(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x178f1f=moment()[_0xa6b4('0xe')]();var _0x28ffc6=_0x578238(_0x178f1f+_0x5c7d02+_0x356f31);_0x358779[_0xa6b4('0xf')](JSON[_0xa6b4('0x10')]({'appID':_0x5c7d02,'timestamp':_0x178f1f,'appKey':_0x28ffc6}));var _0x3d337e=fs['createReadStream'](_0x402e09);_0x3d337e['on']('data',function(_0x5bdb6d){_0x358779[_0xa6b4('0xf')](_0x5bdb6d);});_0x3d337e['on'](_0xa6b4('0x11'),function(){_0x358779[_0xa6b4('0xf')](_0xa6b4('0x12'));});}catch(_0x3d666c){logger[_0xa6b4('0x13')](_0xa6b4('0x14'),JSON[_0xa6b4('0x10')](_0x3d666c));_0x358779[_0xa6b4('0x15')]();}}function _0x16f53c(_0x1e9a2f){try{if(_0x1e9a2f){var _0x290db6=JSON[_0xa6b4('0x16')](_0x1e9a2f);switch(_0x290db6['status']){case 0x0:if(_0x290db6[_0xa6b4('0x17')]){if(_0x290db6[_0xa6b4('0x17')][_0xa6b4('0x18')]){logger[_0xa6b4('0x19')](_0xa6b4('0x1a'),JSON[_0xa6b4('0x10')](_0x290db6[_0xa6b4('0x17')][_0xa6b4('0x1b')]));_0x5a973e=_0x290db6[_0xa6b4('0x17')][_0xa6b4('0x1b')][0x0][_0xa6b4('0x1c')];_0x5ab2af=_0x290db6[_0xa6b4('0x17')][_0xa6b4('0x1b')][0x0][_0xa6b4('0x1d')];_0x2e10bd='0';_0x824650='Success.';_0x358779['terminate']();}}break;case 0x1:logger[_0xa6b4('0x19')](_0xa6b4('0x8'));_0x2e10bd='1';_0x824650=_0xa6b4('0x8');break;case 0x2:logger[_0xa6b4('0x19')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x2e10bd='2';_0x824650=_0xa6b4('0x1e');break;case 0x9:logger[_0xa6b4('0x19')](_0xa6b4('0x1f'));_0x2e10bd='9';_0x824650=_0xa6b4('0x1f');break;case 0xa:logger[_0xa6b4('0x19')](_0xa6b4('0x20'));_0x2e10bd='10';_0x824650=_0xa6b4('0x20');break;case 0xb:logger[_0xa6b4('0x19')](_0xa6b4('0x21'));_0x2e10bd='11';_0x824650=_0xa6b4('0x21');}}}catch(_0xe79e7d){logger[_0xa6b4('0x13')](_0xa6b4('0x22'),JSON[_0xa6b4('0x10')](_0xe79e7d));_0x358779[_0xa6b4('0x15')]();}}function _0x3781de(){logger[_0xa6b4('0x19')](_0xa6b4('0x23'));_0x4c8f36({'transcript':_0x5a973e,'confidence':_0x5ab2af,'status':_0x2e10bd,'status_message':_0x824650});}function _0x33acdc(_0x404f64){logger[_0xa6b4('0x13')](_0xa6b4('0x24'));if(!_[_0xa6b4('0x25')](_0x404f64)){logger[_0xa6b4('0x13')](_[_0xa6b4('0x26')](_0x404f64)?JSON[_0xa6b4('0x10')](_0x404f64):_0x404f64);}}_0x358779['on'](_0xa6b4('0x27'),_0x375d8b);_0x358779['on'](_0xa6b4('0x28'),_0x16f53c);_0x358779['on'](_0xa6b4('0x11'),_0x3781de);_0x358779['on']('error',_0x33acdc);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js index 10cb4be..44c89e2 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x8e8f=['./asr'];(function(_0x4fbf13,_0x50c612){var _0x37304e=function(_0x29e328){while(--_0x29e328){_0x4fbf13['push'](_0x4fbf13['shift']());}};_0x37304e(++_0x50c612);}(_0x8e8f,0x96));var _0xf8e8=function(_0x22e4d4,_0x7d0a00){_0x22e4d4=_0x22e4d4-0x0;var _0x1f7693=_0x8e8f[_0x22e4d4];return _0x1f7693;};var asr=require(_0xf8e8('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index e7dbc23..cc12751 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf197=['close','nextTick','inherits','exports','util','net','events','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','code'];(function(_0x5f0f36,_0x1920d9){var _0x14e08a=function(_0x4adf19){while(--_0x4adf19){_0x5f0f36['push'](_0x5f0f36['shift']());}};_0x14e08a(++_0x1920d9);}(_0xf197,0x130));var _0x7f19=function(_0x290dfa,_0x34b8cf){_0x290dfa=_0x290dfa-0x0;var _0x2526f6=_0xf197[_0x290dfa];return _0x2526f6;};'use strict';var util=require(_0x7f19('0x0'));var net=require(_0x7f19('0x1'));var EventEmitter=require(_0x7f19('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x7f19('0x3'));var AGIServer=function(_0x5a184b,_0x4b7af0,_0x5715b0){var _0x152a30=this,_0x5a184b=_0x5a184b||0x11dd,_0x4b7af0=_0x4b7af0||_0x7f19('0x4'),_0x1a3591=null,_0x3c076e=0x0;EventEmitter[_0x7f19('0x5')](_0x152a30);function _0x39c494(){if(!_0x5a184b){_0x152a30[_0x7f19('0x6')](_0x7f19('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x1a3591=net[_0x7f19('0x8')]();_0x1a3591[_0x7f19('0x9')](_0x5a184b,_0x4b7af0);_0x1a3591['on'](_0x7f19('0xa'),function(){_0x152a30['emit'](_0x7f19('0xa'));});_0x1a3591['on'](_0x7f19('0xb'),function(_0x1e8dd9){_0x1a3591[_0x7f19('0xc')](function(_0x56ce22,_0x14bc93){if(_0x56ce22){_0x152a30['emit'](_0x7f19('0x7'),new AGIError(_0x7f19('0xd'),_0x56ce22));}else if(_0x5715b0&&_0x5715b0<0x0){_0x152a30[_0x7f19('0x6')]('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x1e8dd9[_0x7f19('0xe')]();}else if(_0x5715b0&&_0x5715b0>0x0&&_0x5715b0<_0x14bc93){_0x3c076e+=0x1;_0x152a30[_0x7f19('0x6')](_0x7f19('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x3c076e));_0x1e8dd9[_0x7f19('0xe')]();}else{var _0x20fe84=new AGIChannel(_0x1e8dd9);_0x20fe84['on']('ready',function(){_0x152a30[_0x7f19('0x6')](_0x7f19('0xb'),_0x20fe84);});}});});_0x1a3591['on'](_0x7f19('0x7'),function(_0x5c0b64){_0x152a30[_0x7f19('0x6')]('error',new AGIError(_0x7f19('0xd'),_0x5c0b64[_0x7f19('0xf')]));});_0x1a3591['on'](_0x7f19('0x10'),function(){_0x152a30[_0x7f19('0x6')](_0x7f19('0x10'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x7f19('0x11')](function(){_0x39c494();});};util[_0x7f19('0x12')](AGIServer,EventEmitter);module[_0x7f19('0x13')]=function(_0x58bab8,_0x106054,_0x52bcf){return new AGIServer(_0x58bab8,_0x106054,_0x52bcf);}; \ No newline at end of file +var _0xd3d1=['127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','ready','code','close','E_AGI_SERVER_CLOSE','inherits','util','net','./error','./channel'];(function(_0x3ec61f,_0x1742ed){var _0x3adb09=function(_0x203092){while(--_0x203092){_0x3ec61f['push'](_0x3ec61f['shift']());}};_0x3adb09(++_0x1742ed);}(_0xd3d1,0x172));var _0x1d3d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xd3d1[_0x138adb];return _0x1b27f2;};'use strict';var util=require(_0x1d3d('0x0'));var net=require(_0x1d3d('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require(_0x1d3d('0x2'));var AGIChannel=require(_0x1d3d('0x3'));var AGIServer=function(_0x1b8ea2,_0xfd3615,_0x41a806){var _0x328a4e=this,_0x1b8ea2=_0x1b8ea2||0x11dd,_0xfd3615=_0xfd3615||_0x1d3d('0x4'),_0x1cbe06=null,_0x449475=0x0;EventEmitter[_0x1d3d('0x5')](_0x328a4e);function _0xe10bca(){if(!_0x1b8ea2){_0x328a4e[_0x1d3d('0x6')](_0x1d3d('0x7'),new AGIError(_0x1d3d('0x8')));return![];}_0x1cbe06=net[_0x1d3d('0x9')]();_0x1cbe06['listen'](_0x1b8ea2,_0xfd3615);_0x1cbe06['on'](_0x1d3d('0xa'),function(){_0x328a4e[_0x1d3d('0x6')](_0x1d3d('0xa'));});_0x1cbe06['on'](_0x1d3d('0xb'),function(_0x27d914){_0x1cbe06[_0x1d3d('0xc')](function(_0x44b374,_0x2fa11e){if(_0x44b374){_0x328a4e[_0x1d3d('0x6')](_0x1d3d('0x7'),new AGIError(_0x1d3d('0xd'),_0x44b374));}else if(_0x41a806&&_0x41a806<0x0){_0x328a4e['emit'](_0x1d3d('0x7'),new AGIError(_0x1d3d('0xe')));_0x27d914['destroy']();}else if(_0x41a806&&_0x41a806>0x0&&_0x41a806<_0x2fa11e){_0x449475+=0x1;_0x328a4e['emit'](_0x1d3d('0x7'),new AGIError(_0x1d3d('0xf'),_0x449475));_0x27d914[_0x1d3d('0x10')]();}else{var _0x59b907=new AGIChannel(_0x27d914);_0x59b907['on'](_0x1d3d('0x11'),function(){_0x328a4e['emit'](_0x1d3d('0xb'),_0x59b907);});}});});_0x1cbe06['on'](_0x1d3d('0x7'),function(_0x3491e4){_0x328a4e[_0x1d3d('0x6')](_0x1d3d('0x7'),new AGIError(_0x1d3d('0xd'),_0x3491e4[_0x1d3d('0x12')]));});_0x1cbe06['on']('close',function(){_0x328a4e['emit'](_0x1d3d('0x13'),new AGIError(_0x1d3d('0x14')));});}process['nextTick'](function(){_0xe10bca();});};util[_0x1d3d('0x15')](AGIServer,EventEmitter);module['exports']=function(_0x1eade8,_0x392e92,_0x2cd430){return new AGIServer(_0x1eade8,_0x392e92,_0x2cd430);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index eccdd65..3261880 100644 --- a/server/services/agi/vertices.js +++ b/server/services/agi/vertices.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0bb=['queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','sayphonetic','sayPhonetic','account_id','no\x20mail\x20account\x20configured','Smtp','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','exports','path','util','lodash','odbc','moment','mustache','agi','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariableById','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','googleCloudTTS','text','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','uri','includes','clone','hasOwnProperty','replaceAllVariables','split','replaceAll','getVariable','extra','length','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','label','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','noop','application','options','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','url','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20is\x20unreachable','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','toString','test','stringify','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','isString','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','%s.%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','beep','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','wav','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','opts','Executed\x20command\x20%s\x20%s','PLAYBACK','queue'];(function(_0x556c76,_0x514cf2){var _0x3f719c=function(_0x4e8130){while(--_0x4e8130){_0x556c76['push'](_0x556c76['shift']());}};_0x3f719c(++_0x514cf2);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0xb49cb8,_0x39474b){_0xb49cb8=_0xb49cb8-0x0;var _0x879ead=_0xd0bb[_0xb49cb8];return _0x879ead;};'use strict';var fs=require('fs');var path=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var _=require(_0xbd0b('0x2'));var sh=require('shelljs');var odbc=require(_0xbd0b('0x3'))();var rs=require('randomstring');var moment=require(_0xbd0b('0x4'));var Mustache=require(_0xbd0b('0x5'));var logger=require('../../config/logger')(_0xbd0b('0x6'));var config=require('../../config/environment');var scripts=require(_0xbd0b('0x7'));var FILES_PATH=_0xbd0b('0x8');var verticesWithRetry=[_0xbd0b('0x9'),_0xbd0b('0xa'),_0xbd0b('0xb')];var AGIVertices=function(_0x5eb975,_0x2a4075,_0x4533ff){this[_0xbd0b('0xc')]=_0x5eb975;this[_0xbd0b('0xd')]=_0x2a4075;this[_0xbd0b('0xe')]=_0x4533ff;};AGIVertices['prototype']['getVariable']=function(_0x14bc5b,_0x110cf1){this['rpc'][_0xbd0b('0xf')](_0x14bc5b)[_0xbd0b('0x10')](function(_0x526258){_0x110cf1(null,_0x526258?_0x526258[_0xbd0b('0x11')]:![]);})[_0xbd0b('0x12')](function(_0x3a4b28){_0x110cf1(_0x3a4b28);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x14')]=function(_0x42a96b,_0x420f96){this[_0xbd0b('0xd')][_0xbd0b('0x15')](_0x42a96b)[_0xbd0b('0x10')](function(_0x2d4664){_0x420f96(null,_0x2d4664?_0x2d4664['name']:![]);})[_0xbd0b('0x12')](function(_0x4b113b){_0x420f96(_0x4b113b);});};AGIVertices['prototype'][_0xbd0b('0x16')]=function(_0x4c0e52,_0x3183cf){this[_0xbd0b('0xd')][_0xbd0b('0x17')](_0x4c0e52)['then'](function(_0x55e0a1){_0x3183cf(null,_0x55e0a1?_0x55e0a1[_0xbd0b('0x11')]:![]);})[_0xbd0b('0x12')](function(_0x1f2a6e){_0x3183cf(_0x1f2a6e);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x18')]=function(_0x40b798,_0x5aeb79){this[_0xbd0b('0xd')]['getSquareOdbcById'](_0x40b798)[_0xbd0b('0x10')](function(_0x475801){_0x5aeb79(null,_0x475801?_0x475801[_0xbd0b('0x19')]:![]);})[_0xbd0b('0x12')](function(_0x4b312d){_0x5aeb79(_0x4b312d);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x1a')]=function(_0x40b021,_0x495d62){this[_0xbd0b('0xd')]['getUserById'](_0x40b021)[_0xbd0b('0x10')](function(_0x3c4938){_0x495d62(null,_0x3c4938?_0x3c4938[_0xbd0b('0x11')]:![]);})[_0xbd0b('0x12')](function(_0x297c85){_0x495d62(_0x297c85);});};AGIVertices['prototype'][_0xbd0b('0x1b')]=function(_0x58a721,_0x3e7e9c){this[_0xbd0b('0xd')][_0xbd0b('0x1c')](_0x58a721)[_0xbd0b('0x10')](function(_0xfd9f82){_0x3e7e9c(null,_0xfd9f82?_0xfd9f82[_0xbd0b('0x11')]:![]);})['catch'](function(_0x382f76){_0x3e7e9c(_0x382f76);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x1d')]=function(_0x1b5a00,_0x1129ae){var _0x122893=this;this['rpc'][_0xbd0b('0x1e')](_0x1b5a00)[_0xbd0b('0x10')](function(_0x82d326){_0x1129ae(null,_0x82d326?_0x122893['getSoundPath'](_0x82d326['save_name']):![]);})[_0xbd0b('0x12')](function(_0x684b09){_0x1129ae(_0x684b09);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x1f')]=function(_0x4e2149,_0x38926f){this[_0xbd0b('0xd')]['getMailAccountById'](_0x4e2149)[_0xbd0b('0x10')](function(_0x3b70b4){_0x38926f(null,_0x3b70b4?_0x3b70b4:![]);})['catch'](function(_0x5e5e69){_0x38926f(_0x5e5e69);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x20')]=function(_0x53f555,_0x31bdd3,_0x2f7d61){this[_0xbd0b('0xe')][_0xbd0b('0x20')](_0x53f555,_0x31bdd3)[_0xbd0b('0x10')](function(){_0x2f7d61(null);})[_0xbd0b('0x12')](function(_0x5f224e){_0x2f7d61(_0x5f224e);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x21')]=function(_0x32572e,_0x3e38e4){this[_0xbd0b('0xd')][_0xbd0b('0x22')](_0x32572e)[_0xbd0b('0x10')](function(_0x1029a0){if(_0x1029a0){if(_0x1029a0[_0xbd0b('0x23')]){_0x3e38e4(null,[_0x1029a0[_0xbd0b('0x24')]]);}else{_0x3e38e4(null,_[_0xbd0b('0x25')](_0x1029a0[_0xbd0b('0x26')],_0xbd0b('0x24')));}}else{_0x3e38e4(null,![]);}})[_0xbd0b('0x12')](function(_0x48e4cb){_0x3e38e4(_0x48e4cb);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x27')]=function(_0x545f59){return util[_0xbd0b('0x28')](_0xbd0b('0x29'),FILES_PATH,_0x545f59);};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x2a')]=function(_0x27ad8b,_0x288715,_0x4c8ff5){odbc[_0xbd0b('0x2b')](_0x27ad8b,function(_0x11cf5a){if(_0x11cf5a){logger[_0xbd0b('0x2c')](_0xbd0b('0x2d'),_0x11cf5a);_0x4c8ff5(_0x11cf5a);}else{logger[_0xbd0b('0x2e')]('ODBC\x20connection\x20successfully');odbc['query'](_0x288715,function(_0x3b6a38,_0x8db305){if(_0x3b6a38){logger[_0xbd0b('0x2e')](_0xbd0b('0x2f'),_0x288715);_0x4c8ff5(_0x3b6a38);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x288715);odbc[_0xbd0b('0x30')](function(_0x4d8237){if(_0x4d8237){logger[_0xbd0b('0x2c')](_0xbd0b('0x31'),_0x4d8237);}_0x4c8ff5(null,_0x8db305);});}});}});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x32')]=function(_0x3e2ad9,_0x1f48ba){this[_0xbd0b('0xd')][_0xbd0b('0x33')](_0x3e2ad9)[_0xbd0b('0x10')](function(_0x14fcc7){_0x1f48ba(null,_0x14fcc7?_0x14fcc7:![]);})[_0xbd0b('0x12')](function(_0x411872){_0x1f48ba(_0x411872);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x34')]=function(_0x11b1a0,_0x18e51a){this[_0xbd0b('0xd')][_0xbd0b('0x34')](_0x11b1a0)['then'](function(_0x32bde9){_0x18e51a(null,_0x32bde9);})[_0xbd0b('0x12')](function(_0x89b5ea){_0x18e51a(_0x89b5ea);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x35')]=function(_0xb22cbf,_0x2e72a7,_0x1b4497){this[_0xbd0b('0xd')][_0xbd0b('0x35')]({'uniqueid':this[_0xbd0b('0xc')][_0xbd0b('0x36')],'node':_0xb22cbf['label'],'application':_0xb22cbf[_0xbd0b('0x37')],'data':_0x2e72a7||null,'project_name':this['channel']['arg_1'],'callerid':this[_0xbd0b('0xc')][_0xbd0b('0x38')]})[_0xbd0b('0x10')](function(_0x580fa2){if(_0x1b4497){_0x1b4497(null,_0x580fa2);}})[_0xbd0b('0x12')](function(_0x6e41bd){if(_0x1b4497){_0x1b4497(_0x6e41bd);}});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x39')]=function(_0x1a12c0,_0x4f1e3a,_0x1830e9,_0x3619b9){this[_0xbd0b('0xd')][_0xbd0b('0x39')]({'uniqueid':this[_0xbd0b('0xc')][_0xbd0b('0x36')],'callerid':this['channel'][_0xbd0b('0x38')],'calleridname':this[_0xbd0b('0xc')][_0xbd0b('0x3a')],'context':this[_0xbd0b('0xc')][_0xbd0b('0x3b')],'extension':this[_0xbd0b('0xc')][_0xbd0b('0x3c')],'priority':this[_0xbd0b('0xc')][_0xbd0b('0x3d')],'accountcode':this[_0xbd0b('0xc')][_0xbd0b('0x3e')],'dnid':this[_0xbd0b('0xc')][_0xbd0b('0x3f')],'projectName':this[_0xbd0b('0xc')][_0xbd0b('0x40')],'saveName':_0x4f1e3a,'filename':_0x1a12c0[_0xbd0b('0x41')]||_0x4f1e3a,'savePath':_0x1830e9})[_0xbd0b('0x10')](function(_0x74977a){_0x3619b9(null,_0x74977a);})[_0xbd0b('0x12')](function(_0x2ed890){_0x3619b9(_0x2ed890);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x42')]=function(_0x915d2c,_0x5148c2,_0x12d3e7){this[_0xbd0b('0xd')]['createSquareMessage']({'uniqueid':this['channel']['uniqueid'],'body':_0x915d2c,'direction':_0x5148c2})[_0xbd0b('0x10')](function(_0x5bae10){if(_0x12d3e7){_0x12d3e7(null,_0x5bae10);}})[_0xbd0b('0x12')](function(_0x14d5ce){if(_0x12d3e7){_0x12d3e7(_0x14d5ce);}});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x43')]=function(_0x5a28c5,_0x2d2e58){this['rpc'][_0xbd0b('0x43')]({'firstName':_['isEmpty'](_0x5a28c5['name'])||_[_0xbd0b('0x44')](_0x5a28c5[_0xbd0b('0x11')])?_0xbd0b('0x45')+Math[_0xbd0b('0x46')]():_0x5a28c5[_0xbd0b('0x11')],'lastName':_[_0xbd0b('0x47')](_0x5a28c5[_0xbd0b('0x48')])||_[_0xbd0b('0x44')](_0x5a28c5['lastName'])?null:_0x5a28c5['lastName'],'phone':_0x5a28c5[_0xbd0b('0x49')],'ListId':_0x5a28c5[_0xbd0b('0x4a')],'scheduledAt':_0x5a28c5['scheduledAt'],'callbackUniqueid':this['channel'][_0xbd0b('0x36')],'tags':_0xbd0b('0x4b'),'description':_0xbd0b('0x4c')+_0x5a28c5[_0xbd0b('0x4d')]['toString'](),'priority':_0x5a28c5[_0xbd0b('0x4e')]})[_0xbd0b('0x10')](function(_0x19d3e0){_0x2d2e58(null,_0x19d3e0);})[_0xbd0b('0x12')](function(_0x50fc5b){_0x2d2e58(_0x50fc5b);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x4f')]=function(_0x4bd549,_0x122a19){this[_0xbd0b('0xd')][_0xbd0b('0x50')](_0x4bd549)[_0xbd0b('0x10')](function(_0x1ba677){_0x122a19(null,_0x1ba677?_0x1ba677[_0xbd0b('0x11')]:![]);})[_0xbd0b('0x12')](function(_0x656a47){_0x122a19(_0x656a47);});};AGIVertices['prototype'][_0xbd0b('0x51')]=function(_0x114cf9,_0x315883,_0x15b83e){var _0x303037={'role':_0xbd0b('0x52')};_0x303037[_0x114cf9]=this['channel']['callerid'];this[_0xbd0b('0xd')][_0xbd0b('0x51')](_0x303037,_0x315883,this['channel'][_0xbd0b('0x36')])[_0xbd0b('0x10')](function(_0x34db98){_0x15b83e(null,_[_0xbd0b('0x44')](_0x34db98)?![]:!![]);})[_0xbd0b('0x12')](function(_0x5be34a){logger[_0xbd0b('0x2c')](_0x5be34a);_0x15b83e(null,![]);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x53')]=function(_0x26a7d9,_0x3fe55a){var _0xa08f72={'role':_0xbd0b('0x52')};_0xa08f72[_0x26a7d9]=this[_0xbd0b('0xc')][_0xbd0b('0x38')];this[_0xbd0b('0xd')][_0xbd0b('0x53')](_0xa08f72)[_0xbd0b('0x10')](function(_0x20502d){_0x3fe55a(null,_[_0xbd0b('0x44')](_0x20502d)?![]:!![]);})[_0xbd0b('0x12')](function(_0x1fefd5){logger[_0xbd0b('0x2c')](_0x1fefd5);_0x3fe55a(null,![]);});};AGIVertices['prototype'][_0xbd0b('0x54')]=function(_0x3f6f14,_0x319ee8){var _0x2c935c={'role':'agent'};_0x2c935c[_0x3f6f14]=this['channel'][_0xbd0b('0x38')];this[_0xbd0b('0xd')][_0xbd0b('0x54')](_0x2c935c)[_0xbd0b('0x10')](function(_0x2085f2){_0x319ee8(null,_['isNil'](_0x2085f2)?![]:!![]);})[_0xbd0b('0x12')](function(_0x4d3664){logger[_0xbd0b('0x2c')](_0x4d3664);_0x319ee8(null,![]);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x55')]=function(_0x4cc507,_0x2df588){var _0x463db8={'role':'agent'};_0x463db8[_0x4cc507]=this[_0xbd0b('0xc')][_0xbd0b('0x38')];var _0x21a475=_0x4cc507!=_0xbd0b('0x56')?util['format'](_0xbd0b('0x57'),_0xbd0b('0x58'),this[_0xbd0b('0xc')][_0xbd0b('0x38')]):undefined;this[_0xbd0b('0xd')]['agentLogin'](_0x463db8,_0x21a475)['then'](function(_0x4ce5bc){_0x2df588(null,_['isNil'](_0x4ce5bc)?![]:!![]);})[_0xbd0b('0x12')](function(_0x3735b9){logger[_0xbd0b('0x2c')](_0x3735b9);_0x2df588(null,![]);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x59')]=function(_0x42d8ed,_0x56317c){sh[_0xbd0b('0x5a')](_['trim'](_0x42d8ed),function(_0x271463,_0x537a32){var _0x4f2d7c=_0x537a32['replace'](/(\r\n|\n|\r)/gm,'');_0x56317c(null,_0x4f2d7c);});};AGIVertices[_0xbd0b('0x13')]['googleCloudTTS']=function(_0x57d14b,_0x308317){scripts[_0xbd0b('0x5b')](_0x57d14b['apiKey'],_0x57d14b[_0xbd0b('0x5c')],_0x57d14b['languageCode']||'en-US',_0x57d14b[_0xbd0b('0x5d')]||_0xbd0b('0x5e'),_0x57d14b[_0xbd0b('0x5f')]||_0xbd0b('0x60'))[_0xbd0b('0x10')](function(_0x19f4d0){_0x308317(null,_0x19f4d0);})[_0xbd0b('0x12')](function(_0x408ac4){_0x308317(_0x408ac4);});};AGIVertices['prototype']['googleTTS']=function(_0x1058f1,_0x5cb8bc){scripts[_0xbd0b('0x61')](_0x1058f1[_0xbd0b('0x5c')],_0x1058f1[_0xbd0b('0x62')]||'en',0x1)['then'](function(_0x3dd85f){_0x5cb8bc(null,_0x3dd85f);})[_0xbd0b('0x12')](function(_0x541853){_0x5cb8bc(_0x541853);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x63')]=function(_0x1a7106,_0x20d684){scripts[_0xbd0b('0x63')](this['channel'][_0xbd0b('0x36')],_0x1a7106[_0xbd0b('0x64')],_0x1a7106[_0xbd0b('0x5c')],_0x1a7106[_0xbd0b('0x65')]||'en')['then'](function(_0x19a7a3){_0x20d684(null,_0x19a7a3);})[_0xbd0b('0x12')](function(_0x4ce935){_0x20d684(_0x4ce935);});};AGIVertices[_0xbd0b('0x13')]['sestekNDA']=function(_0x39c327,_0x4097ff){scripts[_0xbd0b('0x66')](this[_0xbd0b('0xc')],_0x39c327)[_0xbd0b('0x10')](function(_0x47ad40){_0x4097ff(null,_0x47ad40);})['catch'](function(_0x4ccc9e){_0x4097ff(_0x4ccc9e);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x67')]=function(_0x3b220f,_0x4f3b37){scripts[_0xbd0b('0x67')](_0x3b220f[_0xbd0b('0x64')],_0x3b220f[_0xbd0b('0x5c')],_0x3b220f[_0xbd0b('0x68')]||_0xbd0b('0x69'),_0x3b220f['speed'])[_0xbd0b('0x10')](function(_0x4eaa74){_0x4f3b37(null,_0x4eaa74);})[_0xbd0b('0x12')](function(_0x91f7bb){_0x4f3b37(_0x91f7bb);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x6a')]=function(_0x104607,_0xba1071,_0x1fc2fd){scripts[_0xbd0b('0x6a')](_0xba1071,_0x104607[_0xbd0b('0x64')],_0x104607[_0xbd0b('0x6b')]||'en-US',this[_0xbd0b('0x6c')](_0x104607[_0xbd0b('0x6d')])?_0x104607[_0xbd0b('0x6d')]:undefined)[_0xbd0b('0x10')](function(_0xb6b7dd){_0x1fc2fd(null,_0xb6b7dd);})[_0xbd0b('0x12')](function(_0x3ec930){_0x1fc2fd(_0x3ec930);});};AGIVertices['prototype'][_0xbd0b('0x6e')]=function(_0x2d944c,_0x9960ab){scripts['awsPolly'](_0x2d944c[_0xbd0b('0x6f')],_0x2d944c['aws_secret_access_key'],_0x2d944c[_0xbd0b('0x70')],_0x2d944c[_0xbd0b('0x71')]||_0xbd0b('0x72'),_0x2d944c[_0xbd0b('0x5c')],_0x2d944c[_0xbd0b('0x73')]||_0xbd0b('0x5c'))['then'](function(_0xdc102d){_0x9960ab(null,_0xdc102d);})[_0xbd0b('0x12')](function(_0x2b3459){_0x9960ab(_0x2b3459);});};AGIVertices[_0xbd0b('0x13')]['awsLex']=function(_0x19a218,_0x4cbfdb){scripts[_0xbd0b('0x74')](this[_0xbd0b('0xc')][_0xbd0b('0x36')],_0x19a218[_0xbd0b('0x6f')],_0x19a218[_0xbd0b('0x75')],_0x19a218[_0xbd0b('0x76')],_0x19a218[_0xbd0b('0x5c')],_0x19a218[_0xbd0b('0x77')])[_0xbd0b('0x10')](function(_0x3b08b1){_0x4cbfdb(null,_0x3b08b1);})[_0xbd0b('0x12')](function(_0x6e6cda){_0x4cbfdb(_0x6e6cda);});};AGIVertices[_0xbd0b('0x13')]['googleASR']=function(_0x39740c,_0x2a86f5,_0x2dc361){scripts[_0xbd0b('0x78')](_0x2a86f5,_0x39740c[_0xbd0b('0x64')],_0x39740c[_0xbd0b('0x79')]||_0xbd0b('0x69'))[_0xbd0b('0x10')](function(_0x611f10){_0x2dc361(null,_0x611f10);})[_0xbd0b('0x12')](function(_0x3db94a){_0x2dc361(_0x3db94a);});};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x7a')]=function(_0x4ade50,_0x1bf1b3,_0x42a306){scripts[_0xbd0b('0x7a')](_0x1bf1b3,_0x4ade50[_0xbd0b('0x7b')],_0x4ade50['appsecret'],_0x4ade50[_0xbd0b('0x7c')])[_0xbd0b('0x10')](function(_0x45b133){_0x42a306(null,_0x45b133);})[_0xbd0b('0x12')](function(_0x114906){_0x42a306(_0x114906);});};AGIVertices['prototype']['clear']=function(_0x3bdb17){var _0x356ca4=_[_0xbd0b('0x7d')](verticesWithRetry,_0x3bdb17['agicommand'])?_0x3bdb17:_[_0xbd0b('0x7e')](_0x3bdb17);for(var _0x1e0183 in _0x356ca4){if(_0x356ca4[_0xbd0b('0x7f')](_0x1e0183)){if(_0x356ca4[_0x1e0183]&&_['isString'](_0x356ca4[_0x1e0183])){_0x356ca4[_0x1e0183]=this[_0xbd0b('0x80')](_0x356ca4[_0x1e0183]);}}}return _0x356ca4;};AGIVertices['prototype']['replaceAllVariables']=function(_0x270138){var _0x4f2985=_0x270138['split']('{');for(var _0xca8a4d=0x1;_0xca8a4d<_0x4f2985['length'];_0xca8a4d+=0x1){var _0x3ca88d=_0x4f2985[_0xca8a4d][_0xbd0b('0x81')]('}');if(_0x3ca88d['length']>0x1){_0x270138=_0x270138[_0xbd0b('0x82')]('{'+_0x3ca88d[0x0]+'}',this[_0xbd0b('0xc')][_0xbd0b('0x83')](_0x3ca88d[0x0])[_0xbd0b('0x84')]||_0x3ca88d[0x0]);}}if(_0x4f2985[_0xbd0b('0x85')]===0x1){return _0x270138['toString']();}return this[_0xbd0b('0x80')](_0x270138);};AGIVertices[_0xbd0b('0x13')]['getAndSetVariable']=function(_0x2e3baa,_0x272166){var _0x2347f3=this[_0xbd0b('0xc')][_0xbd0b('0x83')](_0x2e3baa);if(_0x2347f3[_0xbd0b('0x86')]===-0x1){return _0x2347f3;}logger['info'](util[_0xbd0b('0x28')](_0xbd0b('0x87'),_0x272166,_0x2347f3[_0xbd0b('0x84')]));return this[_0xbd0b('0xc')][_0xbd0b('0x88')](_0x272166,_0x2347f3[_0xbd0b('0x84')]);};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x6c')]=function(_0x22c00c){return _0x22c00c&&_0x22c00c!=='0'&&_0x22c00c!=='-1'&&_0x22c00c!=='';};AGIVertices['prototype'][_0xbd0b('0x89')]=function(_0x5623b1){this[_0xbd0b('0x35')][_0xbd0b('0x8a')](this,_0x5623b1,'-');_0x5623b1[_0xbd0b('0x8b')]=_0x5623b1[_0xbd0b('0x89')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x6')]=function(_0x2dc09b){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x8c'),_0x2dc09b[_0xbd0b('0x8d')]));return this[_0xbd0b('0xc')]['agi']([_0x2dc09b[_0xbd0b('0x8e')],_0x2dc09b['args']]);};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x8f')]=function(_0x59698c){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x90'),_0x59698c[_0xbd0b('0x8d')]));if(this[_0xbd0b('0x6c')](_0x59698c[_0xbd0b('0x91')])){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x92'),_0x59698c[_0xbd0b('0x91')]));var _0xb1c0bc=this[_0xbd0b('0xc')]['wait'](_0x59698c[_0xbd0b('0x91')]);if(_0xb1c0bc[_0xbd0b('0x86')]===-0x1){return _0xb1c0bc;}}return this['channel'][_0xbd0b('0x8f')]();};AGIVertices[_0xbd0b('0x13')]['callback']=function(_0x210ace){logger['info'](util[_0xbd0b('0x28')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x210ace[_0xbd0b('0x8d')]));if(!this[_0xbd0b('0x6c')](_0x210ace[_0xbd0b('0x4a')])){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x210ace,_0xbd0b('0x93'));}_0x210ace['scheduledAt']=moment();if(this['isConfigured'](_0x210ace[_0xbd0b('0x94')])){_0x210ace[_0xbd0b('0x4d')]=moment()[_0xbd0b('0x95')](_0x210ace[_0xbd0b('0x94')],_0xbd0b('0x96'));}if(!this[_0xbd0b('0x6c')](_0x210ace[_0xbd0b('0x4e')])){_0x210ace['callback_priority']=0x2;}this[_0xbd0b('0x43')][_0xbd0b('0x8a')](this,_0x210ace);return this[_0xbd0b('0xc')]['noop'](util[_0xbd0b('0x28')](_0xbd0b('0x97'),_0x210ace[_0xbd0b('0x49')],_0x210ace['list_id'],_0x210ace[_0xbd0b('0x4d')]));};AGIVertices['prototype'][_0xbd0b('0x98')]=function(_0x198f62){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x198f62['label']));var _0x13f764=this['channel'][_0xbd0b('0x5a')](_0x198f62['application'],_0x198f62['options']);if(_0x13f764[_0xbd0b('0x86')]===-0x1){return _0x13f764;}return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')]('Executed\x20command\x20%s\x20%s',_0x198f62[_0xbd0b('0x9a')],_0x198f62[_0xbd0b('0x9b')]));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x9c')]=function(_0x50814c){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x9d'),_0x50814c[_0xbd0b('0x8d')]));if(!this['isConfigured'](_0x50814c[_0xbd0b('0x5c')])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')]('no\x20text\x20configured');}var _0x126f7f='\x22'+_0x50814c[_0xbd0b('0x5c')]+'\x22';if(this[_0xbd0b('0x6c')](_0x50814c[_0xbd0b('0x9b')])){_0x126f7f+=','+_0x50814c[_0xbd0b('0x9b')];}var _0x33b08a=this[_0xbd0b('0xc')][_0xbd0b('0x5a')](_0xbd0b('0x9e'),_0x126f7f);if(_0x33b08a[_0xbd0b('0x86')]===-0x1){return _0x33b08a;}return this['channel']['noop'](util[_0xbd0b('0x28')](_0xbd0b('0x9f'),_0x126f7f));};AGIVertices['prototype'][_0xbd0b('0xa0')]=function(_0x33f10b){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x33f10b['label']));if(!this[_0xbd0b('0x6c')](_0x33f10b[_0xbd0b('0x5c')])){return this[_0xbd0b('0xc')]['noop'](_0xbd0b('0xa1'));}var _0x92e855='\x22'+_0x33f10b[_0xbd0b('0x5c')]+'\x22';if(this[_0xbd0b('0x6c')](_0x33f10b[_0xbd0b('0x9b')])){_0x92e855+=','+_0x33f10b['options'];}var _0x924359=this[_0xbd0b('0xc')][_0xbd0b('0x5a')]('MRCPSynth',_0x92e855);if(_0x924359[_0xbd0b('0x86')]===-0x1){return _0x924359;}return this[_0xbd0b('0xc')]['noop'](util[_0xbd0b('0x28')](_0xbd0b('0x9f'),_0x92e855));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0xa2')]=function(_0x25d26d){logger['info'](util[_0xbd0b('0x28')](_0xbd0b('0xa3'),_0x25d26d[_0xbd0b('0x8d')]));if(!this[_0xbd0b('0x6c')](_0x25d26d['grammar'])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0xa4'));}var _0x2f428e=_0x25d26d[_0xbd0b('0xa5')];if(this[_0xbd0b('0x6c')](_0x25d26d[_0xbd0b('0x9b')])){_0x2f428e+=','+_0x25d26d[_0xbd0b('0x9b')];}var _0x4b3cb1=this[_0xbd0b('0xc')]['exec'](_0xbd0b('0xa6'),_0x2f428e);if(_0x4b3cb1[_0xbd0b('0x86')]===-0x1){return _0x4b3cb1;}var _0x27a1b2=this[_0xbd0b('0xa7')](_0xbd0b('0xa8'),'LUMENVOX_ASR_CONFIDENCE');if(_0x27a1b2[_0xbd0b('0x86')]===-0x1){return _0x27a1b2;}var _0x4e6f97=this[_0xbd0b('0xa7')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x4e6f97[_0xbd0b('0x86')]===-0x1){return _0x4e6f97;}var _0x30c31b=this['getAndSetVariable'](_0xbd0b('0xa9'),'LUMENVOX_ASR_INSTANCE');if(_0x30c31b[_0xbd0b('0x86')]===-0x1){return _0x30c31b;}return this['channel'][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0xaa'),_0x2f428e));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0xab')]=function(_0x56c3ca){logger['info'](util[_0xbd0b('0x28')](_0xbd0b('0xac'),_0x56c3ca[_0xbd0b('0x8d')]));if(!this['isConfigured'](_0x56c3ca[_0xbd0b('0xa5')])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0xa4'));}var _0x4acf00=_0x56c3ca[_0xbd0b('0xa5')];if(this[_0xbd0b('0x6c')](_0x56c3ca[_0xbd0b('0x9b')])){_0x4acf00+=','+_0x56c3ca['options'];}var _0x2f1699=this[_0xbd0b('0xc')][_0xbd0b('0x5a')]('MRCPRecog',_0x4acf00);if(_0x2f1699[_0xbd0b('0x86')]===-0x1){return _0x2f1699;}var _0x4a70a3=this[_0xbd0b('0xa7')](_0xbd0b('0xa8'),_0xbd0b('0xad'));if(_0x4a70a3[_0xbd0b('0x86')]===-0x1){return _0x4a70a3;}var _0x406c23=this[_0xbd0b('0xa7')](_0xbd0b('0xae'),_0xbd0b('0xaf'));if(_0x406c23['result']===-0x1){return _0x406c23;}var _0x5663c5=this['getAndSetVariable'](_0xbd0b('0xa9'),_0xbd0b('0xb0'));if(_0x5663c5[_0xbd0b('0x86')]===-0x1){return _0x5663c5;}return this[_0xbd0b('0xc')]['noop'](util[_0xbd0b('0x28')](_0xbd0b('0xaa'),_0x4acf00));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0xb1')]=function(_0x1d20ee){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0xb2'),_0x1d20ee[_0xbd0b('0x8d')]));if(!this['isConfigured'](_0x1d20ee[_0xbd0b('0xb3')])){return this['channel']['error'](_0x1d20ee,_0xbd0b('0xb4'));}var _0x348fd5=this[_0xbd0b('0x18')][_0xbd0b('0x8a')](this,_0x1d20ee[_0xbd0b('0xb3')]);if(!_0x348fd5){return this['channel'][_0xbd0b('0x2c')](_0x1d20ee,_0xbd0b('0xb5'));}if(!this[_0xbd0b('0x6c')](_0x1d20ee[_0xbd0b('0xb6')])){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x1d20ee,_0xbd0b('0xb7'));}var _0xe8db7a=_0x1d20ee[_0xbd0b('0xb6')][_0xbd0b('0xb8')](/(\r\n|\n|\r)/gm,'\x20');this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0xb9'),_0xe8db7a));var _0x3b7051=this[_0xbd0b('0x2a')]['sync'](this,_0x348fd5,_0xe8db7a);this[_0xbd0b('0x35')][_0xbd0b('0x8a')](this,_0x1d20ee,_0xe8db7a);if(!this['isConfigured'](_0x1d20ee[_0xbd0b('0xba')])){return this[_0xbd0b('0xc')]['noop'](_0xbd0b('0xbb'));}var _0x53d613=this[_0xbd0b('0x83')][_0xbd0b('0x8a')](this,_0x1d20ee[_0xbd0b('0xba')]);if(!_0x53d613){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x1d20ee,_0xbd0b('0xbc'));}var _0x57c3b4=this;_0x3b7051['forEach'](function(_0x48aa74,_0x313f77){Object[_0xbd0b('0xbd')](_0x48aa74)[_0xbd0b('0xbe')](function(_0x24f353){_0x57c3b4[_0xbd0b('0xc')]['setVariable'](util[_0xbd0b('0x28')](_0xbd0b('0xbf'),_0x53d613,_0x313f77,_0x24f353),_0x48aa74[_0x24f353]);});});this[_0xbd0b('0xc')]['setVariable'](util['format'](_0xbd0b('0xc0'),_0x53d613),_0x3b7051['length']);return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0xc1'),_0x53d613));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0xc2')]=function(_0x457202){logger[_0xbd0b('0xc3')](util[_0xbd0b('0x28')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x457202['label']));if(!this['isConfigured'](_0x457202[_0xbd0b('0xc4')])){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x457202,_0xbd0b('0xc5'));}var _0x197f63=this['getUser']['sync'](this,_0x457202[_0xbd0b('0xc4')]);if(!_0x197f63){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x457202,_0xbd0b('0xc6'));}var _0x3cf6cd=this[_0xbd0b('0xc')][_0xbd0b('0x5a')](_0xbd0b('0xc7'),[util['format'](_0xbd0b('0xc8'),_0x197f63),_0x457202[_0xbd0b('0x91')],_0x457202['opts'],_0x457202[_0xbd0b('0xc9')]]);if(_0x3cf6cd[_0xbd0b('0x86')]===-0x1){return _0x3cf6cd;}return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0xca')]=function(_0x211868){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0xcb'),_0x211868['label']));if(!this[_0xbd0b('0x6c')](_0x211868[_0xbd0b('0x64')])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0xcc'));}if(!this[_0xbd0b('0x6c')](_0x211868[_0xbd0b('0x5c')])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0xa1'));}this[_0xbd0b('0xc')][_0xbd0b('0xcd')]=!![];this[_0xbd0b('0x35')](_0x211868);this[_0xbd0b('0x42')](_0x211868[_0xbd0b('0x5c')],'in');this['channel'][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0xce'),_0x211868[_0xbd0b('0x5c')]));var _0xc3aae8=this[_0xbd0b('0x63')][_0xbd0b('0x8a')](this,_0x211868);if(_0xc3aae8){for(var _0x1adbb0 in _0xc3aae8){if(_0xc3aae8[_0xbd0b('0x7f')](_0x1adbb0)){this[_0xbd0b('0xc')][_0xbd0b('0x88')](util['format'](_0xbd0b('0xcf'),_0x1adbb0[_0xbd0b('0xd0')]()),_0xc3aae8[_0x1adbb0]);}}this[_0xbd0b('0x42')](_0xc3aae8[_0xbd0b('0xd1')],_0xbd0b('0xd2'));return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format']('Dialogflow\x20Result\x20%s',_0xc3aae8[_0xbd0b('0xd1')]));}return this['channel'][_0xbd0b('0x2c')](_0x211868,_0xbd0b('0xd3'));};AGIVertices['prototype']['sesteknda']=function(_0x4066e0){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x4066e0[_0xbd0b('0x8d')]));if(!this['isConfigured'](_0x4066e0['ndauth_url'])){return this['channel'][_0xbd0b('0x99')](_0xbd0b('0xd4'));}if(!this['isConfigured'](_0x4066e0[_0xbd0b('0xd5')])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0xd6'));}if(!this[_0xbd0b('0x6c')](_0x4066e0[_0xbd0b('0xd7')])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')]('no\x20password\x20configured');}if(!this[_0xbd0b('0x6c')](_0x4066e0[_0xbd0b('0xd8')])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0xa1'));}this[_0xbd0b('0xc')]['bot']=!![];this[_0xbd0b('0x35')](_0x4066e0);this[_0xbd0b('0x42')](_0x4066e0[_0xbd0b('0x5c')],'in');this[_0xbd0b('0xc')]['noop'](util['format']('Trying\x20SestekNDA:\x20%s',_0x4066e0[_0xbd0b('0x5c')]));var _0x2fd994=this['sestekNDA'][_0xbd0b('0x8a')](this,_0x4066e0);if(_0x2fd994){for(var _0x27972c in _0x2fd994){if(_0x2fd994[_0xbd0b('0x7f')](_0x27972c)){this[_0xbd0b('0xc')][_0xbd0b('0x88')](util[_0xbd0b('0x28')]('SESTEK_NDA_%s',_0x27972c[_0xbd0b('0xd0')]()),_0x2fd994[_0x27972c]);}}this[_0xbd0b('0x42')](_0x2fd994[_0xbd0b('0xd1')],_0xbd0b('0xd2'));if(_0x2fd994[_0xbd0b('0xd9')]){this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0xda'),_0x2fd994['audiofile']));var _0x3cde15=this['channel'][_0xbd0b('0xdb')](_0x2fd994[_0xbd0b('0xd9')]);try{fs[_0xbd0b('0xdc')](_0x2fd994[_0xbd0b('0xd9')]+'.wav');}catch(_0x3cec0c){logger[_0xbd0b('0x2c')](_0x3cec0c);}return _0x3cde15;}else{return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format'](_0xbd0b('0xdd'),_0x2fd994['speech']));}}return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x4066e0,_0xbd0b('0xde'));};AGIVertices[_0xbd0b('0x13')]['end']=function(_0x32ceef){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0xdf'),_0x32ceef[_0xbd0b('0x8d')]));return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0xe0'));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0xe1')]=function(_0x301f75){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0xe2'),_0x301f75[_0xbd0b('0x8d')]));var _0x3f260b='';if(_0x301f75[_0xbd0b('0xe3')]){if(!this[_0xbd0b('0x6c')](_0x301f75['trunk_id'])){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x301f75,'no\x20trunk\x20selected');}else{var _0x153d7a=parseInt(_0x301f75[_0xbd0b('0xe3')],0xa);if(isNaN(_0x153d7a)){_0x3f260b=_0x301f75[_0xbd0b('0xe3')];}else{_0x3f260b=this[_0xbd0b('0x1b')][_0xbd0b('0x8a')](this,_0x301f75[_0xbd0b('0xe3')]);if(!_0x3f260b){return this['channel'][_0xbd0b('0x2c')](_0x301f75,_0xbd0b('0xe4'));}}}}else if(_0x301f75[_0xbd0b('0xe5')]){_0x3f260b=_0x301f75[_0xbd0b('0xe5')];}else{return this['channel']['error'](_0x301f75,_0xbd0b('0xe6'));}var _0x4d0310=this[_0xbd0b('0xc')]['exec']('DIAL',[util[_0xbd0b('0x28')](_0xbd0b('0xe7'),_0x3f260b,_0x301f75[_0xbd0b('0x49')]),_0x301f75[_0xbd0b('0x91')],_0x301f75['opts'],_0x301f75[_0xbd0b('0xc9')]]);if(_0x4d0310[_0xbd0b('0x86')]===-0x1){return _0x4d0310;}return this['channel'][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0xe8'),'DIAL'));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0xe9')]=function(_0x313f4c){logger[_0xbd0b('0x2e')](util['format'](_0xbd0b('0xea'),_0x313f4c[_0xbd0b('0x8d')]));return this[_0xbd0b('0xc')]['noop'](_0xbd0b('0xe9'));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0xa')]=function(_0x113679){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0xeb'),_0x113679[_0xbd0b('0x8d')]));if(_0x113679[_0xbd0b('0x8b')]===0x0){return this[_0xbd0b('0x89')](_0x113679);}_0x113679[_0xbd0b('0x8b')]-=0x1;if(!this[_0xbd0b('0x6c')](_0x113679[_0xbd0b('0xec')])){return this['channel'][_0xbd0b('0x2c')](_0x113679,_0xbd0b('0xed'));}var _0x21ce1c=this[_0xbd0b('0x1d')][_0xbd0b('0x8a')](this,_0x113679['file_id']);if(!_0x21ce1c){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x113679,_0xbd0b('0xee'));}if(!this['isConfigured'](_0x113679[_0xbd0b('0xba')])){return this['channel'][_0xbd0b('0x2c')](_0xbd0b('0xbb'));}var _0x4e981e=this['channel'][_0xbd0b('0xef')](_0x21ce1c,_0x113679['response'],_0x113679[_0xbd0b('0xf0')]);var _0x135095=_0x4e981e[_0xbd0b('0x86')]?_0x4e981e[_0xbd0b('0x86')][_0xbd0b('0xf1')]():'';logger[_0xbd0b('0x2e')](_0xbd0b('0xf2'),JSON[_0xbd0b('0xf3')](_0x4e981e));if(_0x4e981e[_0xbd0b('0x86')]===-0x1){this[_0xbd0b('0x35')][_0xbd0b('0x8a')](this,_0x113679,_0x135095);return _0x4e981e;}else if(_0x4e981e['extra']==='timeout'){_0x4e981e[_0xbd0b('0x86')]=_0x135095['length']>=parseInt(_0x113679[_0xbd0b('0xf4')])?'x':'i';}else{_0x4e981e[_0xbd0b('0x86')]=_0x135095[_0xbd0b('0x85')]>=parseInt(_0x113679['mindigit'])&&_0x135095[_0xbd0b('0x85')]<=parseInt(_0x113679[_0xbd0b('0xf0')])?'x':'i';}var _0x1ce43d=this[_0xbd0b('0x83')][_0xbd0b('0x8a')](this,_0x113679['variable_id']);if(!_0x1ce43d){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x113679,_0xbd0b('0xbc'));}this['channel']['setVariable'](_0x1ce43d,_0x135095);if(this[_0xbd0b('0x6c')](_0x113679[_0xbd0b('0xf5')])){var _0x4844ec=parseInt(_0x113679[_0xbd0b('0xf5')],0xa);var _0x19f0ad=rs[_0xbd0b('0xf6')]({'charset':'*','length':_0x4844ec});var _0x2dab36=_0x135095['length'];if(_0x2dab36>0x0){if(_0x2dab36>_0x4844ec){this[_0xbd0b('0x35')][_0xbd0b('0x8a')](this,_0x113679,_0x113679[_0xbd0b('0xf7')]===_0xbd0b('0xf8')?_0x19f0ad+_0x135095['substr'](_0x4844ec):_0x135095[_0xbd0b('0xf9')](0x0,_0x2dab36-_0x4844ec)+_0x19f0ad);}else{this['createSquareDetailsReport'][_0xbd0b('0x8a')](this,_0x113679,rs[_0xbd0b('0xf6')]({'charset':'*','length':_0x2dab36}));}}else{this['createSquareDetailsReport'][_0xbd0b('0x8a')](this,_0x113679,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x113679,_0x135095);}return _0x4e981e;};AGIVertices[_0xbd0b('0x13')]['getsecretdigits']=function(_0x221fda){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x221fda['label']));return this[_0xbd0b('0xa')](_0x221fda);};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0xfa')]=function(_0x31f0d6){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0xfb'),_0x31f0d6[_0xbd0b('0x8d')]));this[_0xbd0b('0x35')][_0xbd0b('0x8a')](this,_0x31f0d6,_0x31f0d6['goalname']);return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format'](_0xbd0b('0xfc'),_0x31f0d6['goalname']));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0xfd')]=function(_0xc70ad3){logger[_0xbd0b('0x2e')](util['format'](_0xbd0b('0xfe'),_0xc70ad3[_0xbd0b('0x8d')]));if(!this[_0xbd0b('0x6c')](_0xc70ad3[_0xbd0b('0x6f')])||!this['isConfigured'](_0xc70ad3[_0xbd0b('0x75')])){return this[_0xbd0b('0xc')]['noop'](_0xbd0b('0xff'));}if(!this[_0xbd0b('0x6c')](_0xc70ad3[_0xbd0b('0x5c')])){return this[_0xbd0b('0xc')]['noop'](_0xbd0b('0xa1'));}this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format'](_0xbd0b('0x100'),_0xc70ad3[_0xbd0b('0x5c')]));var _0x2a528e=this['awsPolly'][_0xbd0b('0x8a')](this,_0xc70ad3);if(_0x2a528e){this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')]('aws\x20Polly\x20%s\x20file\x20created',_0x2a528e));var _0x4c6266=this[_0xbd0b('0xc')]['streamFile'](_0x2a528e);try{fs[_0xbd0b('0xdc')](_0x2a528e+_0xbd0b('0x101'));}catch(_0xa80765){logger['error'](_0xa80765);}return _0x4c6266;}return this['channel']['error'](_0xc70ad3,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x102')]=function(_0x2447fb){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x103'),_0x2447fb['label']));if(!this[_0xbd0b('0x6c')](_0x2447fb[_0xbd0b('0x6f')])||!this[_0xbd0b('0x6c')](_0x2447fb['aws_secret_access_key'])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0xff'));}if(!this[_0xbd0b('0x6c')](_0x2447fb[_0xbd0b('0x77')])){return this[_0xbd0b('0xc')]['noop'](_0xbd0b('0x104'));}if(!this[_0xbd0b('0x6c')](_0x2447fb[_0xbd0b('0x5c')])){return this[_0xbd0b('0xc')]['noop']('no\x20text\x20configured');}this[_0xbd0b('0xc')][_0xbd0b('0xcd')]=!![];this[_0xbd0b('0x35')](_0x2447fb);this[_0xbd0b('0x42')](_0x2447fb[_0xbd0b('0x5c')],'in');this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0x105'),_0x2447fb['text']));var _0x2d2067=this[_0xbd0b('0x74')][_0xbd0b('0x8a')](this,_0x2447fb);if(_0x2d2067){for(var _0x3de3eb in _0x2d2067){if(_0x2d2067[_0xbd0b('0x7f')](_0x3de3eb)&&_[_0xbd0b('0x106')](_0x2d2067[_0x3de3eb])){this[_0xbd0b('0xc')][_0xbd0b('0x88')](util['format'](_0xbd0b('0x107'),_0x3de3eb[_0xbd0b('0xd0')]()),_0x2d2067[_0x3de3eb]);}}if(_[_0xbd0b('0x44')](_0x2d2067[_0xbd0b('0x108')])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0x109'));}else{this[_0xbd0b('0x42')](_0x2d2067[_0xbd0b('0x108')],'out');return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0x10a'),_0x2d2067[_0xbd0b('0x108')]));}}return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x2447fb,_0xbd0b('0x10b'));};AGIVertices[_0xbd0b('0x13')]['googleasr']=function(_0x4fe50b){logger['info'](util[_0xbd0b('0x28')](_0xbd0b('0x10c'),_0x4fe50b[_0xbd0b('0x8d')],_0x4fe50b['timeout']));if(!this[_0xbd0b('0x6c')](_0x4fe50b[_0xbd0b('0x64')])){return this['channel'][_0xbd0b('0x99')](_0xbd0b('0xcc'));}var _0x160dea='wav';var _0x1cb80f=util[_0xbd0b('0x28')](_0xbd0b('0x10d'),FILES_PATH,rs[_0xbd0b('0xf6')](0x4));var _0x556072=util[_0xbd0b('0x28')](_0xbd0b('0x10e'),_0x1cb80f,_0x160dea);var _0x3a218c=!![];if(_0x4fe50b['beep']===_0xbd0b('0x10f')){_0x3a218c=![];}var _0x5d4e03=this['channel'][_0xbd0b('0x110')](_0x1cb80f,_0x160dea,_0x4fe50b[_0xbd0b('0x111')],_0x4fe50b['timeout'],undefined,_0x3a218c);if(_0x5d4e03[_0xbd0b('0x86')]!==-0x1){this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0x112'),_0x556072));var _0x1973ec=this[_0xbd0b('0x78')][_0xbd0b('0x8a')](this,_0x4fe50b,_0x556072);if(_0x1973ec){for(var _0x3b334e in _0x1973ec){if(_0x1973ec[_0xbd0b('0x7f')](_0x3b334e)){this[_0xbd0b('0xc')]['setVariable'](util[_0xbd0b('0x28')]('GOOGLE_ASR_%s',_0x3b334e[_0xbd0b('0xd0')]()),_0x1973ec[_0x3b334e]);}}return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format'](_0xbd0b('0x113'),JSON[_0xbd0b('0xf3')](_0x1973ec)));}}return _0x5d4e03;};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x114')]=function(_0x2ee1c3){logger['info'](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x2ee1c3[_0xbd0b('0x8d')]));if(!this[_0xbd0b('0x6c')](_0x2ee1c3[_0xbd0b('0x7b')])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0x115'));}if(!this[_0xbd0b('0x6c')](_0x2ee1c3[_0xbd0b('0x116')])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0x117'));}var _0x4a4faa='wav';var _0x33dd6c=util[_0xbd0b('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0xbd0b('0xf6')](0x4));var _0x29f659=util[_0xbd0b('0x28')](_0xbd0b('0x10e'),_0x33dd6c,_0x4a4faa);var _0x254f1b=!![];if(_0x2ee1c3[_0xbd0b('0x118')]===_0xbd0b('0x10f')){_0x254f1b=![];}var _0x203ccc=this[_0xbd0b('0xc')][_0xbd0b('0x110')](_0x33dd6c,_0x4a4faa,_0x2ee1c3[_0xbd0b('0x111')],_0x2ee1c3[_0xbd0b('0x91')],undefined,_0x254f1b);if(_0x203ccc[_0xbd0b('0x86')]!==-0x1){this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')]('tilde\x20%s\x20file\x20created',_0x29f659));var _0x137f49=this['tildeASR'][_0xbd0b('0x8a')](this,_0x2ee1c3,_0x29f659);if(_0x137f49){for(var _0x258839 in _0x137f49){if(_0x137f49[_0xbd0b('0x7f')](_0x258839)){this[_0xbd0b('0xc')][_0xbd0b('0x88')](util[_0xbd0b('0x28')](_0xbd0b('0x119'),_0x258839[_0xbd0b('0xd0')]()),_0x137f49[_0x258839]);}}return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0x11a'),JSON['stringify'](_0x137f49)));}}return _0x203ccc;};AGIVertices['prototype'][_0xbd0b('0x11b')]=function(_0x398712){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x398712['label']));return this[_0xbd0b('0xc')][_0xbd0b('0x11c')](_0x398712['context'],_0x398712[_0xbd0b('0x3c')],_0x398712[_0xbd0b('0x3d')]);};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x11d')]=function(_0x324d0d){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x11e'),_0x324d0d[_0xbd0b('0x8d')]));if(!this[_0xbd0b('0x6c')](_0x324d0d[_0xbd0b('0x11f')])){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x324d0d,_0xbd0b('0x120'));}try{var _0xd09bcd=eval(_0x324d0d['condition'])?_0xbd0b('0x121'):_0xbd0b('0x122');this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format'](_0xbd0b('0x123'),_0x324d0d[_0xbd0b('0x11f')],_0xd09bcd));return{'code':0xc8,'result':_0xd09bcd};}catch(_0x11842f){return{'code':0xc8,'result':_0xbd0b('0x122')};}};AGIVertices['prototype'][_0xbd0b('0x124')]=function(_0x373868){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x125'),_0x373868['label']));if(!this[_0xbd0b('0x6c')](_0x373868['interval_id'])){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x373868,_0xbd0b('0x126'));}var _0x49cf36=this[_0xbd0b('0x21')][_0xbd0b('0x8a')](this,_0x373868[_0xbd0b('0x127')]);if(!_0x49cf36){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x373868,_0xbd0b('0x128'));}for(var _0x4fde7b=0x0;_0x4fde7b<_0x49cf36[_0xbd0b('0x85')];_0x4fde7b+=0x1){var _0x93394c=this[_0xbd0b('0xc')][_0xbd0b('0x83')](util[_0xbd0b('0x28')]('IFTIME(%s?true:false)',_0x49cf36[_0x4fde7b]));if(_0x93394c[_0xbd0b('0x86')]===-0x1){return _0x93394c;}logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('IFTIME\x20%s\x20%s',_0x49cf36[_0x4fde7b],_0x93394c[_0xbd0b('0x84')]));if(_0x93394c[_0xbd0b('0x84')]===_0xbd0b('0x121')){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x129'),_0x49cf36[_0x4fde7b],_0xbd0b('0x121')));this[_0xbd0b('0xc')]['noop'](util[_0xbd0b('0x28')](_0xbd0b('0x129'),_0x49cf36[_0x4fde7b],'true'));return{'code':0xc8,'result':_0xbd0b('0x121')};}else{logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x129'),_0x49cf36[_0x4fde7b],_0xbd0b('0x122')));this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format'](_0xbd0b('0x129'),_0x49cf36[_0x4fde7b],_0xbd0b('0x122')));}}return{'code':0xc8,'result':_0xbd0b('0x122')};};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x12a')]=function(_0x5a4ff4){logger[_0xbd0b('0x2e')](util['format'](_0xbd0b('0x12b'),_0x5a4ff4[_0xbd0b('0x8d')]));return this[_0xbd0b('0xc')]['hangup']();};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x12c')]=function(_0x5366ad){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x12d'),_0x5366ad[_0xbd0b('0x8d')]));if(!this['isConfigured'](_0x5366ad[_0xbd0b('0x64')])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')]('no\x20key\x20configured');}var _0x52561e=_0xbd0b('0x12e');var _0x2a9c31=util[_0xbd0b('0x28')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x4c798e=util[_0xbd0b('0x28')](_0xbd0b('0x10e'),_0x2a9c31,_0x52561e);var _0x31adf3=!![];if(_0x5366ad[_0xbd0b('0x118')]===_0xbd0b('0x10f')){_0x31adf3=![];}var _0x542d02=this['channel'][_0xbd0b('0x110')](_0x2a9c31,_0x52561e,_0x5366ad[_0xbd0b('0x111')],_0x5366ad[_0xbd0b('0x91')],undefined,_0x31adf3);if(_0x542d02[_0xbd0b('0x86')]!==-0x1){this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format'](_0xbd0b('0x12f'),_0x4c798e));var _0x1d8b89=this['ispeechASR']['sync'](this,_0x5366ad,_0x4c798e);if(_0x1d8b89){for(var _0x476fac in _0x1d8b89){if(_0x1d8b89[_0xbd0b('0x7f')](_0x476fac)){this['channel'][_0xbd0b('0x88')](util[_0xbd0b('0x28')]('ISPEECH_ASR_%s',_0x476fac[_0xbd0b('0xd0')]()),_0x1d8b89[_0x476fac]);}}return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format'](_0xbd0b('0x130'),JSON[_0xbd0b('0xf3')](_0x1d8b89)));}}return _0x542d02;};AGIVertices[_0xbd0b('0x13')]['ispeechtts']=function(_0x23708e){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x131'),_0x23708e['label']));if(!this[_0xbd0b('0x6c')](_0x23708e['key'])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0xcc'));}if(!this[_0xbd0b('0x6c')](_0x23708e['text'])){return this[_0xbd0b('0xc')]['noop'](_0xbd0b('0xa1'));}this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0x132'),_0x23708e[_0xbd0b('0x5c')]));var _0x15d904=this[_0xbd0b('0x67')][_0xbd0b('0x8a')](this,_0x23708e);if(_0x15d904){this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format']('ispeech\x20%s\x20file\x20created',_0x15d904));var _0x1f911b=this[_0xbd0b('0xc')][_0xbd0b('0xdb')](_0x15d904,_0x23708e[_0xbd0b('0x111')]);try{fs[_0xbd0b('0xdc')](_0x15d904+_0xbd0b('0x101'));}catch(_0x1c4a7b){logger[_0xbd0b('0x2c')](_0x1c4a7b);}return _0x1f911b;}return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x23708e,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['login']=function(_0x4193fe){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x4193fe['label']));if(!this[_0xbd0b('0x6c')](_0x4193fe[_0xbd0b('0x133')])){return this['channel'][_0xbd0b('0x2c')](_0x4193fe,_0xbd0b('0x134'));}logger[_0xbd0b('0x2e')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbd0b('0xc')]['callerid'],_0x4193fe['findBy']));var _0x45cbe6=this[_0xbd0b('0x55')][_0xbd0b('0x8a')](this,_0x4193fe[_0xbd0b('0x133')]);if(_0x45cbe6){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x135'),this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x4193fe[_0xbd0b('0x133')]));this['channel']['noop'](util[_0xbd0b('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x4193fe[_0xbd0b('0x133')]));return{'code':0xc8,'result':_0xbd0b('0x136')};}else{logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x137'),this['channel']['callerid'],_0x4193fe['findBy']));this[_0xbd0b('0xc')]['noop'](util[_0xbd0b('0x28')](_0xbd0b('0x137'),this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x4193fe[_0xbd0b('0x133')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x138')]=function(_0x40383f){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x139'),_0x40383f['label']));if(!this[_0xbd0b('0x6c')](_0x40383f[_0xbd0b('0x133')])){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x40383f,_0xbd0b('0x134'));}logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x13a'),this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x40383f['findBy']));var _0x487464=this[_0xbd0b('0x54')]['sync'](this,_0x40383f['findBy']);if(_0x487464){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x135'),this['channel'][_0xbd0b('0x38')],_0x40383f[_0xbd0b('0x133')]));this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0x135'),this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x40383f[_0xbd0b('0x133')]));return{'code':0xc8,'result':_0xbd0b('0x136')};}else{logger[_0xbd0b('0x2e')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x40383f[_0xbd0b('0x133')]));this[_0xbd0b('0xc')]['noop'](util[_0xbd0b('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbd0b('0xc')]['callerid'],_0x40383f['findBy']));return{'code':0xc8,'result':_0xbd0b('0x13b')};}};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x13c')]=function(_0x3a92ca){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x13d'),_0x3a92ca[_0xbd0b('0x8d')]));if(!this['isConfigured'](_0x3a92ca[_0xbd0b('0x13e')])){return this['channel'][_0xbd0b('0x2c')](_0x3a92ca,'no\x20operation\x20configured');}this['channel'][_0xbd0b('0x99')](util['format'](_0xbd0b('0x13f'),_0x3a92ca[_0xbd0b('0x13e')]));var _0x58aab7=eval(_0x3a92ca[_0xbd0b('0x13e')]);if(!this[_0xbd0b('0x6c')](_0x3a92ca['variable_id'])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0xbb'));}var _0x597b9d=this[_0xbd0b('0x83')][_0xbd0b('0x8a')](this,_0x3a92ca[_0xbd0b('0xba')]);if(!_0x597b9d){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x3a92ca,_0xbd0b('0xbc'));}if(_[_0xbd0b('0x140')](_0x58aab7)){var _0x35263a=this;_0x58aab7['forEach'](function(_0x36a959,_0x12c639){_0x35263a[_0xbd0b('0xc')]['setVariable'](util[_0xbd0b('0x28')](_0xbd0b('0x141'),_0x597b9d,_0x12c639),_0x36a959);});return this['channel'][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0x142'),_0x597b9d));}else{return this[_0xbd0b('0xc')][_0xbd0b('0x88')](_0x597b9d,_0x58aab7);}};AGIVertices[_0xbd0b('0x13')]['menu']=function(_0x3a4c2a){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x143'),_0x3a4c2a[_0xbd0b('0x8d')]));if(_0x3a4c2a[_0xbd0b('0x8b')]===0x0){return this['maxRetry'](_0x3a4c2a);}_0x3a4c2a[_0xbd0b('0x8b')]-=0x1;if(!this[_0xbd0b('0x6c')](_0x3a4c2a[_0xbd0b('0xec')])){return this[_0xbd0b('0xc')]['error'](_0x3a4c2a,_0xbd0b('0xed'));}var _0x388a7f=this[_0xbd0b('0x1d')][_0xbd0b('0x8a')](this,_0x3a4c2a[_0xbd0b('0xec')]);if(!_0x388a7f){return this[_0xbd0b('0xc')]['error'](_0x3a4c2a,_0xbd0b('0xee'));}var _0x4a95be=this[_0xbd0b('0xc')]['getData'](_0x388a7f,_0x3a4c2a[_0xbd0b('0x144')],_0x3a4c2a['digit']);var _0x2005f4=_0x4a95be[_0xbd0b('0x86')];if(_0x4a95be[_0xbd0b('0x86')]===-0x1){this['createSquareDetailsReport'][_0xbd0b('0x8a')](this,_0x3a4c2a,'-1');return _0x4a95be;}else if(_0x4a95be[_0xbd0b('0x84')]===_0xbd0b('0x91')){_0x4a95be['result']=_0x4a95be[_0xbd0b('0x86')]['length']>0x0?_0x4a95be[_0xbd0b('0x86')]:'t';}else if(_[_0xbd0b('0x47')](_0x4a95be['result'])){_0x4a95be['result']='#';_0x2005f4='#';}if(!this[_0xbd0b('0x6c')](_0x3a4c2a[_0xbd0b('0xba')])){this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0xbb'));}else{var _0x53b22b=this[_0xbd0b('0x83')]['sync'](this,_0x3a4c2a[_0xbd0b('0xba')]);if(!_0x53b22b){return this['channel']['error'](_0x3a4c2a,_0xbd0b('0xbc'));}this[_0xbd0b('0xc')][_0xbd0b('0x88')](_0x53b22b,_0x2005f4);}this['createSquareDetailsReport'][_0xbd0b('0x8a')](this,_0x3a4c2a,_0x2005f4);return _0x4a95be;};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x99')]=function(_0x465058){logger[_0xbd0b('0x2e')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x465058['label']));return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0x465058[_0xbd0b('0x145')]||_0x465058[_0xbd0b('0x8d')]);};AGIVertices['prototype']['pause']=function(_0x1090db){logger['info'](util[_0xbd0b('0x28')](_0xbd0b('0x146'),_0x1090db['label']));if(!this[_0xbd0b('0x6c')](_0x1090db['findBy'])){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x1090db,_0xbd0b('0x134'));}logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x13a'),this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x1090db['findBy']));var _0xabcfb7=this[_0xbd0b('0x4f')][_0xbd0b('0x8a')](this,_0x1090db[_0xbd0b('0x147')]);var _0x8f2810=this['agentPause'][_0xbd0b('0x8a')](this,_0x1090db[_0xbd0b('0x133')],_0xabcfb7);if(_0x8f2810){logger[_0xbd0b('0x2e')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x1090db[_0xbd0b('0x133')]));this[_0xbd0b('0xc')]['noop'](util[_0xbd0b('0x28')](_0xbd0b('0x135'),this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x1090db[_0xbd0b('0x133')]));return{'code':0xc8,'result':_0xbd0b('0x136')};}else{logger[_0xbd0b('0x2e')](util['format'](_0xbd0b('0x137'),this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x1090db['findBy']));this['channel'][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0x135'),this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x1090db[_0xbd0b('0x133')]));return{'code':0xc8,'result':_0xbd0b('0x13b')};}};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x148')]=function(_0x1ab726){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x1ab726[_0xbd0b('0x8d')]));if(!this[_0xbd0b('0x6c')](_0x1ab726[_0xbd0b('0xec')])){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x1ab726,_0xbd0b('0xed'));}var _0x462c96=this[_0xbd0b('0x1d')][_0xbd0b('0x8a')](this,_0x1ab726[_0xbd0b('0xec')]);if(!_0x462c96){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x1ab726,_0xbd0b('0xee'));}var _0x3b2f35=this[_0xbd0b('0xc')]['exec']('PLAYBACK',[_0x462c96,_0x1ab726[_0xbd0b('0x149')]]);if(_0x3b2f35[_0xbd0b('0x86')]===-0x1){return _0x3b2f35;}return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format'](_0xbd0b('0x14a'),_0xbd0b('0x14b'),_0x462c96));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x14c')]=function(_0x97cfd9){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x97cfd9[_0xbd0b('0x8d')]));if(!this['isConfigured'](_0x97cfd9[_0xbd0b('0x14d')])){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x97cfd9,_0xbd0b('0x14e'));}var _0x5e70cd='';var _0x143de2=parseInt(_0x97cfd9[_0xbd0b('0x14d')],0xa);if(isNaN(_0x143de2)){_0x5e70cd=_0x97cfd9['queue_id'];}else{_0x5e70cd=this[_0xbd0b('0x14')][_0xbd0b('0x8a')](this,_0x97cfd9['queue_id']);if(!_0x5e70cd){return this['channel'][_0xbd0b('0x2c')](_0x97cfd9,_0xbd0b('0x14f'));}}var _0x2e5882='';if(this[_0xbd0b('0x6c')](_0x97cfd9[_0xbd0b('0xec')])){var _0x1573c8=this[_0xbd0b('0x1d')][_0xbd0b('0x8a')](this,_0x97cfd9[_0xbd0b('0xec')]);if(_0x1573c8){_0x2e5882=_0x1573c8;}}this[_0xbd0b('0x35')][_0xbd0b('0x8a')](this,_0x97cfd9,_0x5e70cd);if(_0x97cfd9['opts']['indexOf']('x')<0x0){_0x97cfd9[_0xbd0b('0x149')]+='x';}if(_0x97cfd9[_0xbd0b('0x149')][_0xbd0b('0x150')]('X')<0x0){_0x97cfd9[_0xbd0b('0x149')]+='X';}this[_0xbd0b('0xc')][_0xbd0b('0x88')](_0xbd0b('0x151'),_0x5e70cd?_0x5e70cd['toLowerCase']():'');var _0x1db1f1=this['channel'][_0xbd0b('0x5a')](_0xbd0b('0x152'),[_0x5e70cd,_0x97cfd9[_0xbd0b('0x149')],_0x97cfd9[_0xbd0b('0xc9')],_0x2e5882,_0x97cfd9[_0xbd0b('0x91')],_0x97cfd9['agi'],_0x97cfd9['macro'],_0x97cfd9[_0xbd0b('0x153')],'',_0x97cfd9[_0xbd0b('0x154')]]);if(_0x1db1f1['result']===-0x1){return _0x1db1f1;}return this['channel'][_0xbd0b('0x99')](util[_0xbd0b('0x28')]('Executed\x20command\x20%s\x20%s',_0xbd0b('0x152'),_0x5e70cd));};AGIVertices[_0xbd0b('0x13')]['record']=function(_0x4f68b2){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x155'),_0x4f68b2[_0xbd0b('0x8d')]));var _0x5a5859=_0x4f68b2[_0xbd0b('0x156')]||_0xbd0b('0x12e');var _0x462bc9=util[_0xbd0b('0x28')]('%s_%s',this[_0xbd0b('0xc')][_0xbd0b('0x36')],rs[_0xbd0b('0xf6')](0x5));var _0x22ebe8=util[_0xbd0b('0x28')](_0xbd0b('0x157'),FILES_PATH,_0x462bc9,_0x5a5859);var _0x3c1740=util[_0xbd0b('0x28')]('%s/recordings/%s',FILES_PATH,_0x462bc9);this[_0xbd0b('0x39')][_0xbd0b('0x8a')](this,_0x4f68b2,_0x462bc9,_0x22ebe8);this[_0xbd0b('0xc')][_0xbd0b('0x88')](_0xbd0b('0x158'),_0x462bc9);logger['info'](_0xbd0b('0x159'),_0x3c1740,_0x5a5859,_0x4f68b2[_0xbd0b('0x15a')],_0x4f68b2[_0xbd0b('0x91')]);return this[_0xbd0b('0xc')][_0xbd0b('0x110')](_0x3c1740,_0x5a5859,_0x4f68b2[_0xbd0b('0x15a')],_0x4f68b2[_0xbd0b('0x91')],undefined,!![]);};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x15b')]=function(_0x29c06b){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x15c'),_0x29c06b[_0xbd0b('0x8d')]));return this[_0xbd0b('0xc')][_0xbd0b('0x15d')](_0x29c06b[_0xbd0b('0x15e')][_0xbd0b('0xb8')](/\s+/g,''),_0x29c06b['escape_digits']);};AGIVertices['prototype'][_0xbd0b('0x15f')]=function(_0x50a0ea){logger['info'](util[_0xbd0b('0x28')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x50a0ea[_0xbd0b('0x8d')]));return this[_0xbd0b('0xc')][_0xbd0b('0x160')](_0x50a0ea['number'][_0xbd0b('0xb8')](/\s+/g,''),_0x50a0ea[_0xbd0b('0x15a')]);};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x161')]=function(_0x321685){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x321685[_0xbd0b('0x8d')]));return this[_0xbd0b('0xc')][_0xbd0b('0x162')](_0x321685[_0xbd0b('0x5c')],_0x321685['escape_digits']);};AGIVertices[_0xbd0b('0x13')]['sendMail']=function(_0xbf006b){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0xbf006b[_0xbd0b('0x8d')]));if(!this[_0xbd0b('0x6c')](_0xbf006b[_0xbd0b('0x163')])){return this[_0xbd0b('0xc')]['noop'](_0xbd0b('0x164'));}var _0x4aa4b0=this[_0xbd0b('0x1f')]['sync'](this,_0xbf006b[_0xbd0b('0x163')]);if(!_0x4aa4b0||!_0x4aa4b0['Smtp']){return this['channel'][_0xbd0b('0x2c')](_0xbf006b,'no\x20mail\x20account\x20found');}var _0x5e3f3c={'from':util[_0xbd0b('0x28')]('\x22%s\x22\x20<%s>',_0x4aa4b0['name'],_0x4aa4b0['email']||_0x4aa4b0[_0xbd0b('0x165')][_0xbd0b('0x166')]),'to':_0xbf006b['to']||'','cc':_0xbf006b['cc']||'','bcc':_0xbf006b[_0xbd0b('0x167')]||'','subject':_0xbf006b[_0xbd0b('0x168')],'html':_0xbf006b[_0xbd0b('0x5c')],'text':_0xbf006b['text']};var _0x292ca5={'tls':{'rejectUnauthorized':![]}};if(_0x4aa4b0[_0xbd0b('0x165')][_0xbd0b('0x169')]){_0x292ca5[_0xbd0b('0x169')]=_0x4aa4b0[_0xbd0b('0x165')][_0xbd0b('0x169')];}else{_0x292ca5[_0xbd0b('0x16a')]=_0x4aa4b0['Smtp'][_0xbd0b('0x16a')];_0x292ca5['port']=_0x4aa4b0[_0xbd0b('0x165')][_0xbd0b('0x16b')];_0x292ca5[_0xbd0b('0x16c')]=_0x4aa4b0[_0xbd0b('0x165')]['secure'];}if(_0x4aa4b0[_0xbd0b('0x165')][_0xbd0b('0x16d')]){_0x292ca5[_0xbd0b('0x16e')]={'user':_0x4aa4b0[_0xbd0b('0x165')][_0xbd0b('0x166')],'pass':_0x4aa4b0[_0xbd0b('0x165')][_0xbd0b('0x16f')]};}if(this[_0xbd0b('0x6c')](_0xbf006b[_0xbd0b('0x170')])){}logger[_0xbd0b('0xc3')]('sendMail\x20message',JSON[_0xbd0b('0xf3')](_0x5e3f3c));this[_0xbd0b('0x35')][_0xbd0b('0x8a')](this,_0xbf006b,_0xbf006b[_0xbd0b('0x163')]);this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0x171'),_0x4aa4b0[_0xbd0b('0x11')]));this['sendMailMessage'][_0xbd0b('0x8a')](this,_0x292ca5,_0x5e3f3c);return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0x172'));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x173')]=function(_0x4f5ee7){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x4f5ee7['label']));return this['channel'][_0xbd0b('0x99')](_0xbd0b('0x174'));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x175')]=function(_0x4170c6){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x4170c6['label']));if(!this[_0xbd0b('0x6c')](_0x4170c6['sms_account_id'])){return this[_0xbd0b('0xc')]['noop'](_0xbd0b('0x176'));}var _0x45e004=this[_0xbd0b('0x32')][_0xbd0b('0x8a')](this,_0x4170c6[_0xbd0b('0x177')]);if(!_0x45e004){return this[_0xbd0b('0xc')]['error'](_0x4170c6,'no\x20sms\x20account\x20found');}var _0x268214={'body':_0x4170c6['sms_text'],'phone':_0x4170c6['to']||'','SmsAccountId':_0x45e004['id']};logger[_0xbd0b('0xc3')](_0xbd0b('0x178'),JSON[_0xbd0b('0xf3')](_0x268214));this[_0xbd0b('0x35')][_0xbd0b('0x8a')](this,_0x4170c6,_0x4170c6[_0xbd0b('0x177')]);this['channel'][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0x179'),_0x45e004[_0xbd0b('0x11')]));this['createSmsMessage'][_0xbd0b('0x8a')](this,_0x268214);return this[_0xbd0b('0xc')][_0xbd0b('0x99')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xbd0b('0x13')]['set']=function(_0x36be7b){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x36be7b[_0xbd0b('0x8d')]));if(!this['isConfigured'](_0x36be7b[_0xbd0b('0xba')])){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x36be7b,'no\x20variable\x20selected');}var _0x16b6e7=this['getVariable']['sync'](this,_0x36be7b[_0xbd0b('0xba')]);if(!_0x16b6e7){return this[_0xbd0b('0xc')]['error'](_0x36be7b,_0xbd0b('0xbc'));}return this['channel'][_0xbd0b('0x88')](_0x16b6e7,_0x36be7b[_0xbd0b('0x17a')]);};AGIVertices['prototype'][_0xbd0b('0x17b')]=function(_0xafe478){logger['info'](util[_0xbd0b('0x28')](_0xbd0b('0x17c'),_0xafe478['label']));this[_0xbd0b('0xc')]['noop'](_0xbd0b('0x17d'));if(_0xafe478[_0xbd0b('0x8f')]==='yes'){this[_0xbd0b('0xc')]['noop'](_0xbd0b('0x17e'));return this[_0xbd0b('0xc')][_0xbd0b('0x8f')]();}return this[_0xbd0b('0xc')][_0xbd0b('0x99')]('Skipped\x20Answer');};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x17f')]=function(_0xb33ba1){logger['info'](util[_0xbd0b('0x28')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0xb33ba1[_0xbd0b('0x8d')]));if(!this['isConfigured'](_0xb33ba1[_0xbd0b('0x180')])){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0xb33ba1,_0xbd0b('0x181'));}var _0x4b0d18=this['getSquareProject']['sync'](this,_0xb33ba1[_0xbd0b('0x180')]);if(!this[_0xbd0b('0x6c')](_0x4b0d18)){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0xb33ba1,util[_0xbd0b('0x28')](_0xbd0b('0x182'),_0xb33ba1[_0xbd0b('0x180')]));}if(_0x4b0d18===this[_0xbd0b('0xc')][_0xbd0b('0x40')]){return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0xb33ba1,_0xbd0b('0x183'));}this[_0xbd0b('0x35')][_0xbd0b('0x8a')](this,_0xb33ba1,_0x4b0d18);var _0x436ef4=this['channel']['exec'](_0xbd0b('0x184'),util['format'](_0xbd0b('0x185'),config[_0xbd0b('0x6')][_0xbd0b('0x16a')]||_0xbd0b('0x186'),_0x4b0d18,this['channel']['arg_1']));if(_0x436ef4[_0xbd0b('0x86')]===-0x1){return _0x436ef4;}return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format']('Executed\x20command\x20%s\x20%s','AGI',_0x4b0d18));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x187')]=function(_0x2511e5){logger['info'](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2511e5['label']));var _0x29b456=this[_0xbd0b('0x59')][_0xbd0b('0x8a')](this,_0x2511e5[_0xbd0b('0x8e')]);this[_0xbd0b('0x35')][_0xbd0b('0x8a')](this,_0x2511e5,_0x2511e5['command']);if(this['isConfigured'](_0x2511e5[_0xbd0b('0xba')])){var _0x1bd137=this[_0xbd0b('0x83')][_0xbd0b('0x8a')](this,_0x2511e5['variable_id']);if(_0x1bd137){this[_0xbd0b('0xc')][_0xbd0b('0x88')](_0x1bd137,_0x29b456);return this[_0xbd0b('0xc')]['noop'](util[_0xbd0b('0x28')](_0xbd0b('0x188'),_0x2511e5[_0xbd0b('0x8e')],_0x1bd137));}}return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0x189'),_0x2511e5['command']));};AGIVertices[_0xbd0b('0x13')]['google_cloud_tts']=function(_0x2c5be6){logger[_0xbd0b('0x2e')](util['format'](_0xbd0b('0x18a'),_0x2c5be6[_0xbd0b('0x8d')]));if(!this['isConfigured'](_0x2c5be6[_0xbd0b('0x18b')])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0x18c'));}if(!this[_0xbd0b('0x6c')](_0x2c5be6['text'])){return this[_0xbd0b('0xc')][_0xbd0b('0x99')](_0xbd0b('0xa1'));}this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x2c5be6[_0xbd0b('0x5c')]));var _0x56574c=this[_0xbd0b('0x5b')][_0xbd0b('0x8a')](this,_0x2c5be6);if(_0x56574c){this['channel'][_0xbd0b('0x99')](util[_0xbd0b('0x28')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x56574c));var _0x2b5c39=this[_0xbd0b('0xc')]['streamFile'](_0x56574c);try{fs[_0xbd0b('0xdc')](_0x56574c+'.wav');}catch(_0xce6be){logger[_0xbd0b('0x2c')](_0xce6be);}return _0x2b5c39;}return this[_0xbd0b('0xc')][_0xbd0b('0x2c')](_0x2c5be6,_0xbd0b('0x18d'));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x18e')]=function(_0x4aaeaf){logger[_0xbd0b('0x2e')](util['format'](_0xbd0b('0x18f'),_0x4aaeaf[_0xbd0b('0x8d')]));if(!this['isConfigured'](_0x4aaeaf[_0xbd0b('0x5c')])){return this[_0xbd0b('0xc')]['noop']('no\x20text\x20configured');}this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0x190'),_0x4aaeaf[_0xbd0b('0x5c')]));var _0x295444=this[_0xbd0b('0x61')][_0xbd0b('0x8a')](this,_0x4aaeaf);if(_0x295444){this[_0xbd0b('0xc')][_0xbd0b('0x99')](util[_0xbd0b('0x28')](_0xbd0b('0x191'),_0x295444));var _0x3e2ff1=this[_0xbd0b('0xc')][_0xbd0b('0xdb')](_0x295444);try{fs[_0xbd0b('0xdc')](_0x295444+_0xbd0b('0x101'));}catch(_0x116a1e){logger[_0xbd0b('0x2c')](_0x116a1e);}return _0x3e2ff1;}return this['channel'][_0xbd0b('0x2c')](_0x4aaeaf,_0xbd0b('0x192'));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x193')]=function(_0x4255e6){logger['info'](util['format'](_0xbd0b('0x194'),_0x4255e6[_0xbd0b('0x8d')]));if(!this['isConfigured'](_0x4255e6['findBy'])){return this['channel'][_0xbd0b('0x2c')](_0x4255e6,_0xbd0b('0x134'));}logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')](_0xbd0b('0x13a'),this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x4255e6[_0xbd0b('0x133')]));var _0xc79d6d=this[_0xbd0b('0x53')][_0xbd0b('0x8a')](this,_0x4255e6['findBy']);if(_0xc79d6d){logger['info'](util[_0xbd0b('0x28')](_0xbd0b('0x135'),this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x4255e6[_0xbd0b('0x133')]));this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format'](_0xbd0b('0x135'),this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x4255e6[_0xbd0b('0x133')]));return{'code':0xc8,'result':_0xbd0b('0x136')};}else{logger['info'](util[_0xbd0b('0x28')](_0xbd0b('0x137'),this[_0xbd0b('0xc')][_0xbd0b('0x38')],_0x4255e6[_0xbd0b('0x133')]));this[_0xbd0b('0xc')]['noop'](util[_0xbd0b('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x4255e6['findBy']));return{'code':0xc8,'result':_0xbd0b('0x13b')};}};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x195')]=function(_0x2d65e0){logger[_0xbd0b('0x2e')](util[_0xbd0b('0x28')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x2d65e0[_0xbd0b('0x8d')]));var _0x1e1e46=this[_0xbd0b('0xc')][_0xbd0b('0x5a')](_0xbd0b('0x196'),[_0x2d65e0[_0xbd0b('0x197')],_0x2d65e0[_0xbd0b('0x9b')]]);if(_0x1e1e46[_0xbd0b('0x86')]===-0x1){return _0x1e1e46;}return this[_0xbd0b('0xc')][_0xbd0b('0x99')](util['format']('Executed\x20command\x20%s\x20%s',_0xbd0b('0x196'),_0x2d65e0['mailbox']));};AGIVertices[_0xbd0b('0x13')][_0xbd0b('0x198')]=function(_0x385a7a){logger['info'](util[_0xbd0b('0x28')](_0xbd0b('0x199'),_0x385a7a[_0xbd0b('0x8d')]));if(!this[_0xbd0b('0x6c')](_0x385a7a[_0xbd0b('0xba')])){return this['channel'][_0xbd0b('0x2c')](_0x385a7a,_0xbd0b('0x19a'));}var _0x490895=this[_0xbd0b('0x83')]['sync'](this,_0x385a7a[_0xbd0b('0xba')]);if(!_0x490895){return this['channel']['error'](_0x385a7a,_0xbd0b('0xbc'));}var _0x36a29e=this['channel'][_0xbd0b('0x83')](_0x490895);return{'code':0xc8,'result':_0x36a29e[_0xbd0b('0x84')]?_0x36a29e[_0xbd0b('0x84')]:'-'};};String[_0xbd0b('0x13')]['replaceAll']=function(_0x322af5,_0xc3d73){return this[_0xbd0b('0x81')](_0x322af5)['join'](_0xc3d73);};module[_0xbd0b('0x19b')]=AGIVertices; \ No newline at end of file +var _0x432b=['createSquareRecording','calleridname','context','extension','priority','createSquareMessage','createCmContact','isEmpty','callback_','random','isNil','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agent','callerid','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','trim','replace','googleCloudTTS','apiKey','text','en-US','ssmlGender','MALE','audioEncoding','googleTTS','googleDialogflow','key','sestekNDA','ispeechTTS','speed','ispeechASR','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','google_asr_language','tildeASR','appid','appsecret','uri','clear','clone','hasOwnProperty','isString','replaceAllVariables','split','length','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','sync','retry','agi','label','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','add','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','options','lumenvoxtts','no\x20text\x20configured','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','exec','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','grammar','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','query','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','opts','url','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','bot','SESTEK_NDA_%s','toUpperCase','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','stringify','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','googleASR','GOOGLE_ASR_%s','tildeasr','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME\x20%s\x20%s','false','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','operation','isArray','%s[%s]','variable\x20%s[key]\x20set','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','QUEUE','gosub','position','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','bcc','subject','service','host','port','secure','authentication','auth','pass','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','path','lodash','shelljs','odbc','randomstring','../../config/logger','../../config/environment','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','name','getVoiceQueue','then','catch','getSquareProjectById','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1'];(function(_0x3225a8,_0x57a01c){var _0x6691c9=function(_0x1a6483){while(--_0x1a6483){_0x3225a8['push'](_0x3225a8['shift']());}};_0x6691c9(++_0x57a01c);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0xb432('0x0'));var util=require('util');var _=require(_0xb432('0x1'));var sh=require(_0xb432('0x2'));var odbc=require(_0xb432('0x3'))();var rs=require(_0xb432('0x4'));var moment=require('moment');var Mustache=require('mustache');var logger=require(_0xb432('0x5'))('agi');var config=require(_0xb432('0x6'));var scripts=require('./scripts');var FILES_PATH=_0xb432('0x7');var verticesWithRetry=[_0xb432('0x8'),_0xb432('0x9'),_0xb432('0xa')];var AGIVertices=function(_0x14fed4,_0x6833df,_0x198b71){this[_0xb432('0xb')]=_0x14fed4;this['rpc']=_0x6833df;this[_0xb432('0xc')]=_0x198b71;};AGIVertices[_0xb432('0xd')][_0xb432('0xe')]=function(_0x4288c3,_0x28fdde){this[_0xb432('0xf')]['getVariableById'](_0x4288c3)['then'](function(_0x3c1a43){_0x28fdde(null,_0x3c1a43?_0x3c1a43[_0xb432('0x10')]:![]);})['catch'](function(_0x659b46){_0x28fdde(_0x659b46);});};AGIVertices[_0xb432('0xd')][_0xb432('0x11')]=function(_0x55d5f6,_0xebf223){this[_0xb432('0xf')]['getVoiceQueueById'](_0x55d5f6)[_0xb432('0x12')](function(_0xdac1e3){_0xebf223(null,_0xdac1e3?_0xdac1e3[_0xb432('0x10')]:![]);})[_0xb432('0x13')](function(_0x10a298){_0xebf223(_0x10a298);});};AGIVertices['prototype']['getSquareProject']=function(_0x42f81d,_0x15bff1){this[_0xb432('0xf')][_0xb432('0x14')](_0x42f81d)[_0xb432('0x12')](function(_0x31fe99){_0x15bff1(null,_0x31fe99?_0x31fe99[_0xb432('0x10')]:![]);})[_0xb432('0x13')](function(_0x375775){_0x15bff1(_0x375775);});};AGIVertices[_0xb432('0xd')]['getSquareOdbc']=function(_0x482346,_0x26c96e){this[_0xb432('0xf')][_0xb432('0x15')](_0x482346)[_0xb432('0x12')](function(_0x4f22ae){_0x26c96e(null,_0x4f22ae?_0x4f22ae[_0xb432('0x16')]:![]);})[_0xb432('0x13')](function(_0x284b5a){_0x26c96e(_0x284b5a);});};AGIVertices[_0xb432('0xd')][_0xb432('0x17')]=function(_0x2903c4,_0x82d180){this[_0xb432('0xf')]['getUserById'](_0x2903c4)[_0xb432('0x12')](function(_0x62ba65){_0x82d180(null,_0x62ba65?_0x62ba65['name']:![]);})[_0xb432('0x13')](function(_0xaad177){_0x82d180(_0xaad177);});};AGIVertices[_0xb432('0xd')][_0xb432('0x18')]=function(_0x2afd9a,_0x3b1920){this[_0xb432('0xf')][_0xb432('0x19')](_0x2afd9a)[_0xb432('0x12')](function(_0x43c0f5){_0x3b1920(null,_0x43c0f5?_0x43c0f5['name']:![]);})[_0xb432('0x13')](function(_0x270be0){_0x3b1920(_0x270be0);});};AGIVertices[_0xb432('0xd')][_0xb432('0x1a')]=function(_0xbfb391,_0x27f636){var _0x5ce616=this;this[_0xb432('0xf')][_0xb432('0x1b')](_0xbfb391)[_0xb432('0x12')](function(_0x286f38){_0x27f636(null,_0x286f38?_0x5ce616[_0xb432('0x1c')](_0x286f38[_0xb432('0x1d')]):![]);})[_0xb432('0x13')](function(_0x406f61){_0x27f636(_0x406f61);});};AGIVertices[_0xb432('0xd')]['getMailAccount']=function(_0x4090b0,_0x3ffb1f){this[_0xb432('0xf')][_0xb432('0x1e')](_0x4090b0)[_0xb432('0x12')](function(_0x893c9a){_0x3ffb1f(null,_0x893c9a?_0x893c9a:![]);})[_0xb432('0x13')](function(_0x29e9b5){_0x3ffb1f(_0x29e9b5);});};AGIVertices[_0xb432('0xd')][_0xb432('0x1f')]=function(_0x405737,_0x294bcc,_0x50a875){this[_0xb432('0xc')]['sendMailMessage'](_0x405737,_0x294bcc)[_0xb432('0x12')](function(){_0x50a875(null);})[_0xb432('0x13')](function(_0x108828){_0x50a875(_0x108828);});};AGIVertices[_0xb432('0xd')][_0xb432('0x20')]=function(_0xaad050,_0x52cb04){this['rpc']['getIntervalById'](_0xaad050)[_0xb432('0x12')](function(_0x384faa){if(_0x384faa){if(_0x384faa[_0xb432('0x21')]){_0x52cb04(null,[_0x384faa[_0xb432('0x22')]]);}else{_0x52cb04(null,_['map'](_0x384faa['Intervals'],_0xb432('0x22')));}}else{_0x52cb04(null,![]);}})['catch'](function(_0x18231a){_0x52cb04(_0x18231a);});};AGIVertices[_0xb432('0xd')]['getSoundPath']=function(_0x2dea77){return util[_0xb432('0x23')](_0xb432('0x24'),FILES_PATH,_0x2dea77);};AGIVertices[_0xb432('0xd')][_0xb432('0x25')]=function(_0x5b181a,_0x461a92,_0x330fd1){odbc[_0xb432('0x26')](_0x5b181a,function(_0xcb78c1){if(_0xcb78c1){logger[_0xb432('0x27')](_0xb432('0x28'),_0xcb78c1);_0x330fd1(_0xcb78c1);}else{logger[_0xb432('0x29')]('ODBC\x20connection\x20successfully');odbc['query'](_0x461a92,function(_0x443796,_0x27155f){if(_0x443796){logger['info'](_0xb432('0x2a'),_0x461a92);_0x330fd1(_0x443796);}else{logger[_0xb432('0x29')](_0xb432('0x2b'),_0x461a92);odbc[_0xb432('0x2c')](function(_0x25514f){if(_0x25514f){logger['error'](_0xb432('0x2d'),_0x25514f);}_0x330fd1(null,_0x27155f);});}});}});};AGIVertices[_0xb432('0xd')][_0xb432('0x2e')]=function(_0x3bcf0d,_0xd4fd40){this[_0xb432('0xf')][_0xb432('0x2f')](_0x3bcf0d)[_0xb432('0x12')](function(_0x22303c){_0xd4fd40(null,_0x22303c?_0x22303c:![]);})['catch'](function(_0x4d7c10){_0xd4fd40(_0x4d7c10);});};AGIVertices[_0xb432('0xd')][_0xb432('0x30')]=function(_0xa0f987,_0x43c78c){this[_0xb432('0xf')][_0xb432('0x30')](_0xa0f987)[_0xb432('0x12')](function(_0x456bce){_0x43c78c(null,_0x456bce);})['catch'](function(_0x504535){_0x43c78c(_0x504535);});};AGIVertices['prototype'][_0xb432('0x31')]=function(_0xd6e5cd,_0x37a030,_0x21de3e){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0xb432('0xb')][_0xb432('0x32')],'node':_0xd6e5cd['label'],'application':_0xd6e5cd[_0xb432('0x33')],'data':_0x37a030||null,'project_name':this['channel'][_0xb432('0x34')],'callerid':this[_0xb432('0xb')]['callerid']})['then'](function(_0x7f9f39){if(_0x21de3e){_0x21de3e(null,_0x7f9f39);}})['catch'](function(_0x12d5fd){if(_0x21de3e){_0x21de3e(_0x12d5fd);}});};AGIVertices[_0xb432('0xd')]['createSquareRecording']=function(_0x7b8b27,_0x4b1763,_0x48d6fc,_0x58010e){this['rpc'][_0xb432('0x35')]({'uniqueid':this['channel'][_0xb432('0x32')],'callerid':this[_0xb432('0xb')]['callerid'],'calleridname':this['channel'][_0xb432('0x36')],'context':this['channel'][_0xb432('0x37')],'extension':this['channel'][_0xb432('0x38')],'priority':this['channel'][_0xb432('0x39')],'accountcode':this[_0xb432('0xb')]['accountcode'],'dnid':this['channel']['dnid'],'projectName':this[_0xb432('0xb')]['arg_1'],'saveName':_0x4b1763,'filename':_0x7b8b27['file']||_0x4b1763,'savePath':_0x48d6fc})[_0xb432('0x12')](function(_0x2a4fc1){_0x58010e(null,_0x2a4fc1);})[_0xb432('0x13')](function(_0x4487ac){_0x58010e(_0x4487ac);});};AGIVertices[_0xb432('0xd')][_0xb432('0x3a')]=function(_0x4b9c9c,_0x5e0009,_0x48576f){this['rpc'][_0xb432('0x3a')]({'uniqueid':this[_0xb432('0xb')][_0xb432('0x32')],'body':_0x4b9c9c,'direction':_0x5e0009})[_0xb432('0x12')](function(_0x2d7609){if(_0x48576f){_0x48576f(null,_0x2d7609);}})[_0xb432('0x13')](function(_0x39fc72){if(_0x48576f){_0x48576f(_0x39fc72);}});};AGIVertices['prototype']['createCmContact']=function(_0x49069c,_0x2ee04d){this[_0xb432('0xf')][_0xb432('0x3b')]({'firstName':_[_0xb432('0x3c')](_0x49069c[_0xb432('0x10')])||_['isNil'](_0x49069c['name'])?_0xb432('0x3d')+Math[_0xb432('0x3e')]():_0x49069c[_0xb432('0x10')],'lastName':_[_0xb432('0x3c')](_0x49069c['lastName'])||_[_0xb432('0x3f')](_0x49069c[_0xb432('0x40')])?null:_0x49069c['lastName'],'phone':_0x49069c[_0xb432('0x41')],'ListId':_0x49069c[_0xb432('0x42')],'scheduledAt':_0x49069c[_0xb432('0x43')],'callbackUniqueid':this[_0xb432('0xb')][_0xb432('0x32')],'tags':_0xb432('0x44'),'description':_0xb432('0x45')+_0x49069c[_0xb432('0x43')][_0xb432('0x46')](),'priority':_0x49069c[_0xb432('0x47')]})[_0xb432('0x12')](function(_0x25e203){_0x2ee04d(null,_0x25e203);})[_0xb432('0x13')](function(_0x28317b){_0x2ee04d(_0x28317b);});};AGIVertices[_0xb432('0xd')]['getPause']=function(_0x2eced1,_0x57b91d){this[_0xb432('0xf')][_0xb432('0x48')](_0x2eced1)['then'](function(_0x58e9ab){_0x57b91d(null,_0x58e9ab?_0x58e9ab[_0xb432('0x10')]:![]);})[_0xb432('0x13')](function(_0x107ce0){_0x57b91d(_0x107ce0);});};AGIVertices[_0xb432('0xd')][_0xb432('0x49')]=function(_0x441c3c,_0x1f9f83,_0x231ce9){var _0x3ad679={'role':_0xb432('0x4a')};_0x3ad679[_0x441c3c]=this[_0xb432('0xb')][_0xb432('0x4b')];this[_0xb432('0xf')]['agentPause'](_0x3ad679,_0x1f9f83,this[_0xb432('0xb')]['uniqueid'])[_0xb432('0x12')](function(_0x275e31){_0x231ce9(null,_[_0xb432('0x3f')](_0x275e31)?![]:!![]);})[_0xb432('0x13')](function(_0x3d34ae){logger[_0xb432('0x27')](_0x3d34ae);_0x231ce9(null,![]);});};AGIVertices[_0xb432('0xd')]['agentUnpause']=function(_0x313fc6,_0x177b5e){var _0x8a8a6c={'role':_0xb432('0x4a')};_0x8a8a6c[_0x313fc6]=this[_0xb432('0xb')][_0xb432('0x4b')];this[_0xb432('0xf')]['agentUnpause'](_0x8a8a6c)[_0xb432('0x12')](function(_0x15d419){_0x177b5e(null,_[_0xb432('0x3f')](_0x15d419)?![]:!![]);})['catch'](function(_0x159f02){logger['error'](_0x159f02);_0x177b5e(null,![]);});};AGIVertices['prototype'][_0xb432('0x4c')]=function(_0x1225d4,_0x4c975a){var _0xdbe000={'role':_0xb432('0x4a')};_0xdbe000[_0x1225d4]=this[_0xb432('0xb')][_0xb432('0x4b')];this['rpc']['agentLogout'](_0xdbe000)['then'](function(_0x8600f2){_0x4c975a(null,_[_0xb432('0x3f')](_0x8600f2)?![]:!![]);})[_0xb432('0x13')](function(_0x35bcee){logger[_0xb432('0x27')](_0x35bcee);_0x4c975a(null,![]);});};AGIVertices[_0xb432('0xd')]['agentLogin']=function(_0x40dece,_0x3578bf){var _0x2d4e63={'role':_0xb432('0x4a')};_0x2d4e63[_0x40dece]=this[_0xb432('0xb')][_0xb432('0x4b')];var _0x3e0a3e=_0x40dece!=_0xb432('0x4d')?util[_0xb432('0x23')](_0xb432('0x4e'),_0xb432('0x4f'),this[_0xb432('0xb')][_0xb432('0x4b')]):undefined;this[_0xb432('0xf')][_0xb432('0x50')](_0x2d4e63,_0x3e0a3e)['then'](function(_0x393384){_0x3578bf(null,_[_0xb432('0x3f')](_0x393384)?![]:!![]);})[_0xb432('0x13')](function(_0x32fd93){logger[_0xb432('0x27')](_0x32fd93);_0x3578bf(null,![]);});};AGIVertices['prototype'][_0xb432('0x51')]=function(_0x55f326,_0x395292){sh['exec'](_[_0xb432('0x52')](_0x55f326),function(_0x1483ab,_0x3e0eb6){var _0x2f6c1e=_0x3e0eb6[_0xb432('0x53')](/(\r\n|\n|\r)/gm,'');_0x395292(null,_0x2f6c1e);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x3d3c17,_0x395e09){scripts[_0xb432('0x54')](_0x3d3c17[_0xb432('0x55')],_0x3d3c17[_0xb432('0x56')],_0x3d3c17['languageCode']||_0xb432('0x57'),_0x3d3c17[_0xb432('0x58')]||_0xb432('0x59'),_0x3d3c17[_0xb432('0x5a')]||'MP3')[_0xb432('0x12')](function(_0x252716){_0x395e09(null,_0x252716);})['catch'](function(_0x29a7f9){_0x395e09(_0x29a7f9);});};AGIVertices['prototype']['googleTTS']=function(_0x2b1907,_0x2a3ce0){scripts[_0xb432('0x5b')](_0x2b1907[_0xb432('0x56')],_0x2b1907['google_tts_language']||'en',0x1)[_0xb432('0x12')](function(_0x575d4f){_0x2a3ce0(null,_0x575d4f);})[_0xb432('0x13')](function(_0x4d2709){_0x2a3ce0(_0x4d2709);});};AGIVertices[_0xb432('0xd')][_0xb432('0x5c')]=function(_0x3bc986,_0x28d421){scripts[_0xb432('0x5c')](this[_0xb432('0xb')]['uniqueid'],_0x3bc986[_0xb432('0x5d')],_0x3bc986[_0xb432('0x56')],_0x3bc986['dialogflow_language']||'en')[_0xb432('0x12')](function(_0xe528c7){_0x28d421(null,_0xe528c7);})[_0xb432('0x13')](function(_0x3dc2f7){_0x28d421(_0x3dc2f7);});};AGIVertices[_0xb432('0xd')][_0xb432('0x5e')]=function(_0xddb0ba,_0x1f4f80){scripts[_0xb432('0x5e')](this[_0xb432('0xb')],_0xddb0ba)[_0xb432('0x12')](function(_0x430560){_0x1f4f80(null,_0x430560);})[_0xb432('0x13')](function(_0x265a11){_0x1f4f80(_0x265a11);});};AGIVertices['prototype']['ispeechTTS']=function(_0x5b2ba6,_0x4c71c5){scripts[_0xb432('0x5f')](_0x5b2ba6[_0xb432('0x5d')],_0x5b2ba6[_0xb432('0x56')],_0x5b2ba6['ispeech_tts_language']||_0xb432('0x57'),_0x5b2ba6[_0xb432('0x60')])[_0xb432('0x12')](function(_0x5a0532){_0x4c71c5(null,_0x5a0532);})[_0xb432('0x13')](function(_0x34e681){_0x4c71c5(_0x34e681);});};AGIVertices[_0xb432('0xd')][_0xb432('0x61')]=function(_0x3ea905,_0x3bb714,_0x7c1dcf){scripts['ispeechASR'](_0x3bb714,_0x3ea905[_0xb432('0x5d')],_0x3ea905['ispeech_asr_language']||_0xb432('0x57'),this['isConfigured'](_0x3ea905['model'])?_0x3ea905[_0xb432('0x62')]:undefined)[_0xb432('0x12')](function(_0x2a866c){_0x7c1dcf(null,_0x2a866c);})[_0xb432('0x13')](function(_0x220d8a){_0x7c1dcf(_0x220d8a);});};AGIVertices[_0xb432('0xd')][_0xb432('0x63')]=function(_0x5c5ee4,_0x357e61){scripts['awsPolly'](_0x5c5ee4[_0xb432('0x64')],_0x5c5ee4[_0xb432('0x65')],_0x5c5ee4[_0xb432('0x66')],_0x5c5ee4[_0xb432('0x67')]||'Amy',_0x5c5ee4[_0xb432('0x56')],_0x5c5ee4[_0xb432('0x68')]||'text')[_0xb432('0x12')](function(_0x45f397){_0x357e61(null,_0x45f397);})[_0xb432('0x13')](function(_0x5c6a31){_0x357e61(_0x5c6a31);});};AGIVertices[_0xb432('0xd')][_0xb432('0x69')]=function(_0x2ead68,_0x47e069){scripts[_0xb432('0x69')](this['channel'][_0xb432('0x32')],_0x2ead68[_0xb432('0x64')],_0x2ead68['aws_secret_access_key'],_0x2ead68[_0xb432('0x6a')],_0x2ead68[_0xb432('0x56')],_0x2ead68[_0xb432('0x6b')])[_0xb432('0x12')](function(_0x5a4ecd){_0x47e069(null,_0x5a4ecd);})[_0xb432('0x13')](function(_0x5ae77d){_0x47e069(_0x5ae77d);});};AGIVertices[_0xb432('0xd')]['googleASR']=function(_0x4453e4,_0x4f3a79,_0x351c29){scripts['googleASR'](_0x4f3a79,_0x4453e4[_0xb432('0x5d')],_0x4453e4[_0xb432('0x6c')]||_0xb432('0x57'))[_0xb432('0x12')](function(_0x46532d){_0x351c29(null,_0x46532d);})['catch'](function(_0x3367b6){_0x351c29(_0x3367b6);});};AGIVertices[_0xb432('0xd')][_0xb432('0x6d')]=function(_0x497b,_0x588b91,_0x519d1d){scripts[_0xb432('0x6d')](_0x588b91,_0x497b[_0xb432('0x6e')],_0x497b[_0xb432('0x6f')],_0x497b[_0xb432('0x70')])[_0xb432('0x12')](function(_0x593d34){_0x519d1d(null,_0x593d34);})[_0xb432('0x13')](function(_0x3651b0){_0x519d1d(_0x3651b0);});};AGIVertices['prototype'][_0xb432('0x71')]=function(_0x4b0ff4){var _0x50a2fb=_['includes'](verticesWithRetry,_0x4b0ff4[_0xb432('0x33')])?_0x4b0ff4:_[_0xb432('0x72')](_0x4b0ff4);for(var _0x26785c in _0x50a2fb){if(_0x50a2fb[_0xb432('0x73')](_0x26785c)){if(_0x50a2fb[_0x26785c]&&_[_0xb432('0x74')](_0x50a2fb[_0x26785c])){_0x50a2fb[_0x26785c]=this['replaceAllVariables'](_0x50a2fb[_0x26785c]);}}}return _0x50a2fb;};AGIVertices['prototype'][_0xb432('0x75')]=function(_0x154a84){var _0x431bac=_0x154a84['split']('{');for(var _0x173427=0x1;_0x173427<_0x431bac['length'];_0x173427+=0x1){var _0x304da2=_0x431bac[_0x173427][_0xb432('0x76')]('}');if(_0x304da2[_0xb432('0x77')]>0x1){_0x154a84=_0x154a84[_0xb432('0x78')]('{'+_0x304da2[0x0]+'}',this[_0xb432('0xb')]['getVariable'](_0x304da2[0x0])[_0xb432('0x79')]||_0x304da2[0x0]);}}if(_0x431bac['length']===0x1){return _0x154a84[_0xb432('0x46')]();}return this[_0xb432('0x75')](_0x154a84);};AGIVertices[_0xb432('0xd')][_0xb432('0x7a')]=function(_0xf52eba,_0x4be5c7){var _0x61147=this['channel'][_0xb432('0xe')](_0xf52eba);if(_0x61147[_0xb432('0x7b')]===-0x1){return _0x61147;}logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x7c'),_0x4be5c7,_0x61147[_0xb432('0x79')]));return this[_0xb432('0xb')][_0xb432('0x7d')](_0x4be5c7,_0x61147['extra']);};AGIVertices['prototype'][_0xb432('0x7e')]=function(_0x173531){return _0x173531&&_0x173531!=='0'&&_0x173531!=='-1'&&_0x173531!=='';};AGIVertices[_0xb432('0xd')][_0xb432('0x7f')]=function(_0x4860d2){this['createSquareDetailsReport'][_0xb432('0x80')](this,_0x4860d2,'-');_0x4860d2[_0xb432('0x81')]=_0x4860d2['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xb432('0xd')][_0xb432('0x82')]=function(_0x2648b6){logger[_0xb432('0x29')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x2648b6[_0xb432('0x83')]));return this[_0xb432('0xb')]['agi']([_0x2648b6[_0xb432('0x84')],_0x2648b6[_0xb432('0x85')]]);};AGIVertices['prototype']['answer']=function(_0x2747cd){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x86'),_0x2747cd[_0xb432('0x83')]));if(this[_0xb432('0x7e')](_0x2747cd[_0xb432('0x87')])){logger['info'](util['format'](_0xb432('0x88'),_0x2747cd[_0xb432('0x87')]));var _0xe56d4=this['channel'][_0xb432('0x89')](_0x2747cd[_0xb432('0x87')]);if(_0xe56d4['result']===-0x1){return _0xe56d4;}}return this[_0xb432('0xb')][_0xb432('0x8a')]();};AGIVertices[_0xb432('0xd')][_0xb432('0x44')]=function(_0x5cd4ca){logger[_0xb432('0x29')](util['format'](_0xb432('0x8b'),_0x5cd4ca[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x5cd4ca['list_id'])){return this[_0xb432('0xb')][_0xb432('0x27')](_0x5cd4ca,'no\x20list\x20selected');}_0x5cd4ca[_0xb432('0x43')]=moment();if(this[_0xb432('0x7e')](_0x5cd4ca['delay'])){_0x5cd4ca[_0xb432('0x43')]=moment()[_0xb432('0x8c')](_0x5cd4ca['delay'],_0xb432('0x8d'));}if(!this[_0xb432('0x7e')](_0x5cd4ca[_0xb432('0x47')])){_0x5cd4ca['callback_priority']=0x2;}this[_0xb432('0x3b')][_0xb432('0x80')](this,_0x5cd4ca);return this[_0xb432('0xb')][_0xb432('0x8e')](util['format'](_0xb432('0x8f'),_0x5cd4ca[_0xb432('0x41')],_0x5cd4ca['list_id'],_0x5cd4ca[_0xb432('0x43')]));};AGIVertices[_0xb432('0xd')][_0xb432('0x90')]=function(_0x1f3304){logger[_0xb432('0x29')](util['format'](_0xb432('0x91'),_0x1f3304[_0xb432('0x83')]));var _0xfc811e=this[_0xb432('0xb')]['exec'](_0x1f3304[_0xb432('0x92')],_0x1f3304['options']);if(_0xfc811e[_0xb432('0x7b')]===-0x1){return _0xfc811e;}return this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')](_0xb432('0x93'),_0x1f3304['application'],_0x1f3304[_0xb432('0x94')]));};AGIVertices[_0xb432('0xd')][_0xb432('0x95')]=function(_0x22e003){logger[_0xb432('0x29')](util[_0xb432('0x23')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x22e003[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x22e003[_0xb432('0x56')])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x96'));}var _0x329e6f='\x22'+_0x22e003[_0xb432('0x56')]+'\x22';if(this['isConfigured'](_0x22e003['options'])){_0x329e6f+=','+_0x22e003[_0xb432('0x94')];}var _0x32e4ba=this[_0xb432('0xb')]['exec'](_0xb432('0x97'),_0x329e6f);if(_0x32e4ba['result']===-0x1){return _0x32e4ba;}return this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')]('Executed\x20command\x20MRCPSynth\x20%s',_0x329e6f));};AGIVertices[_0xb432('0xd')][_0xb432('0x98')]=function(_0x338c16){logger[_0xb432('0x29')](util['format'](_0xb432('0x99'),_0x338c16[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x338c16['text'])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x96'));}var _0x1e75d5='\x22'+_0x338c16[_0xb432('0x56')]+'\x22';if(this['isConfigured'](_0x338c16['options'])){_0x1e75d5+=','+_0x338c16[_0xb432('0x94')];}var _0x2ede49=this['channel']['exec']('MRCPSynth',_0x1e75d5);if(_0x2ede49['result']===-0x1){return _0x2ede49;}return this[_0xb432('0xb')][_0xb432('0x8e')](util['format'](_0xb432('0x9a'),_0x1e75d5));};AGIVertices[_0xb432('0xd')][_0xb432('0x9b')]=function(_0x4f909d){logger[_0xb432('0x29')](util['format'](_0xb432('0x9c'),_0x4f909d[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x4f909d['grammar'])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x9d'));}var _0x808676=_0x4f909d['grammar'];if(this[_0xb432('0x7e')](_0x4f909d[_0xb432('0x94')])){_0x808676+=','+_0x4f909d['options'];}var _0x3f6517=this[_0xb432('0xb')][_0xb432('0x9e')](_0xb432('0x9f'),_0x808676);if(_0x3f6517['result']===-0x1){return _0x3f6517;}var _0x66c297=this['getAndSetVariable'](_0xb432('0xa0'),_0xb432('0xa1'));if(_0x66c297[_0xb432('0x7b')]===-0x1){return _0x66c297;}var _0x4a5952=this['getAndSetVariable'](_0xb432('0xa2'),_0xb432('0xa3'));if(_0x4a5952[_0xb432('0x7b')]===-0x1){return _0x4a5952;}var _0x1c3a44=this[_0xb432('0x7a')](_0xb432('0xa4'),_0xb432('0xa5'));if(_0x1c3a44[_0xb432('0x7b')]===-0x1){return _0x1c3a44;}return this[_0xb432('0xb')]['noop'](util[_0xb432('0x23')](_0xb432('0xa6'),_0x808676));};AGIVertices[_0xb432('0xd')]['sestekasr']=function(_0x58d3df){logger['info'](util[_0xb432('0x23')](_0xb432('0xa7'),_0x58d3df['label']));if(!this['isConfigured'](_0x58d3df['grammar'])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x9d'));}var _0x148545=_0x58d3df[_0xb432('0xa8')];if(this[_0xb432('0x7e')](_0x58d3df[_0xb432('0x94')])){_0x148545+=','+_0x58d3df[_0xb432('0x94')];}var _0x472e6e=this['channel']['exec'](_0xb432('0x9f'),_0x148545);if(_0x472e6e[_0xb432('0x7b')]===-0x1){return _0x472e6e;}var _0x115f20=this['getAndSetVariable'](_0xb432('0xa0'),_0xb432('0xa9'));if(_0x115f20['result']===-0x1){return _0x115f20;}var _0x5653f8=this[_0xb432('0x7a')](_0xb432('0xa2'),_0xb432('0xaa'));if(_0x5653f8[_0xb432('0x7b')]===-0x1){return _0x5653f8;}var _0x10e196=this[_0xb432('0x7a')](_0xb432('0xa4'),_0xb432('0xab'));if(_0x10e196[_0xb432('0x7b')]===-0x1){return _0x10e196;}return this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')]('Executed\x20command\x20MRCPRecog\x20%s',_0x148545));};AGIVertices[_0xb432('0xd')][_0xb432('0xac')]=function(_0x59e248){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0xad'),_0x59e248['label']));if(!this[_0xb432('0x7e')](_0x59e248['odbc_id'])){return this[_0xb432('0xb')]['error'](_0x59e248,_0xb432('0xae'));}var _0x581dd8=this['getSquareOdbc'][_0xb432('0x80')](this,_0x59e248[_0xb432('0xaf')]);if(!_0x581dd8){return this[_0xb432('0xb')][_0xb432('0x27')](_0x59e248,'no\x20odbc\x20database\x20found');}if(!this[_0xb432('0x7e')](_0x59e248[_0xb432('0xb0')])){return this[_0xb432('0xb')][_0xb432('0x27')](_0x59e248,_0xb432('0xb1'));}var _0x2e55de=_0x59e248[_0xb432('0xb0')][_0xb432('0x53')](/(\r\n|\n|\r)/gm,'\x20');this[_0xb432('0xb')]['noop'](util[_0xb432('0x23')](_0xb432('0xb2'),_0x2e55de));var _0x5cb78b=this['getQueryOdbc'][_0xb432('0x80')](this,_0x581dd8,_0x2e55de);this[_0xb432('0x31')][_0xb432('0x80')](this,_0x59e248,_0x2e55de);if(!this['isConfigured'](_0x59e248['variable_id'])){return this[_0xb432('0xb')]['noop'](_0xb432('0xb3'));}var _0x2fb00b=this[_0xb432('0xe')]['sync'](this,_0x59e248[_0xb432('0xb4')]);if(!_0x2fb00b){return this[_0xb432('0xb')][_0xb432('0x27')](_0x59e248,_0xb432('0xb5'));}var _0x3fd4fa=this;_0x5cb78b[_0xb432('0xb6')](function(_0x317570,_0x1245c1){Object[_0xb432('0xb7')](_0x317570)[_0xb432('0xb6')](function(_0x225876){_0x3fd4fa[_0xb432('0xb')]['setVariable'](util[_0xb432('0x23')](_0xb432('0xb8'),_0x2fb00b,_0x1245c1,_0x225876),_0x317570[_0x225876]);});});this[_0xb432('0xb')][_0xb432('0x7d')](util[_0xb432('0x23')](_0xb432('0xb9'),_0x2fb00b),_0x5cb78b[_0xb432('0x77')]);return this[_0xb432('0xb')][_0xb432('0x8e')](util['format']('variable\x20%s\x20set',_0x2fb00b));};AGIVertices[_0xb432('0xd')][_0xb432('0xba')]=function(_0x1607e7){logger[_0xb432('0xbb')](util[_0xb432('0x23')](_0xb432('0xbc'),_0x1607e7[_0xb432('0x83')]));if(!this['isConfigured'](_0x1607e7[_0xb432('0xbd')])){return this['channel'][_0xb432('0x27')](_0x1607e7,'no\x20user\x20selected');}var _0xc39385=this[_0xb432('0x17')]['sync'](this,_0x1607e7[_0xb432('0xbd')]);if(!_0xc39385){return this[_0xb432('0xb')][_0xb432('0x27')](_0x1607e7,_0xb432('0xbe'));}var _0x2611de=this['channel']['exec'](_0xb432('0xbf'),[util[_0xb432('0x23')]('SIP/%s',_0xc39385),_0x1607e7[_0xb432('0x87')],_0x1607e7[_0xb432('0xc0')],_0x1607e7[_0xb432('0xc1')]]);if(_0x2611de[_0xb432('0x7b')]===-0x1){return _0x2611de;}return this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')](_0xb432('0xc2'),'DIAL'));};AGIVertices[_0xb432('0xd')][_0xb432('0xc3')]=function(_0x13df45){logger[_0xb432('0x29')](util['format'](_0xb432('0xc4'),_0x13df45['label']));if(!this[_0xb432('0x7e')](_0x13df45[_0xb432('0x5d')])){return this['channel']['noop'](_0xb432('0xc5'));}if(!this['isConfigured'](_0x13df45[_0xb432('0x56')])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x96'));}this[_0xb432('0xb')]['bot']=!![];this[_0xb432('0x31')](_0x13df45);this[_0xb432('0x3a')](_0x13df45['text'],'in');this['channel'][_0xb432('0x8e')](util[_0xb432('0x23')]('Trying\x20Dialogflow:\x20%s',_0x13df45['text']));var _0xd6b7ad=this[_0xb432('0x5c')][_0xb432('0x80')](this,_0x13df45);if(_0xd6b7ad){for(var _0x517187 in _0xd6b7ad){if(_0xd6b7ad['hasOwnProperty'](_0x517187)){this[_0xb432('0xb')][_0xb432('0x7d')](util[_0xb432('0x23')](_0xb432('0xc6'),_0x517187['toUpperCase']()),_0xd6b7ad[_0x517187]);}}this[_0xb432('0x3a')](_0xd6b7ad[_0xb432('0xc7')],_0xb432('0xc8'));return this['channel']['noop'](util[_0xb432('0x23')]('Dialogflow\x20Result\x20%s',_0xd6b7ad[_0xb432('0xc7')]));}return this[_0xb432('0xb')]['error'](_0x13df45,_0xb432('0xc9'));};AGIVertices['prototype'][_0xb432('0xca')]=function(_0x2b88ed){logger[_0xb432('0x29')](util['format'](_0xb432('0xcb'),_0x2b88ed[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x2b88ed[_0xb432('0xcc')])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0xcd'));}if(!this[_0xb432('0x7e')](_0x2b88ed[_0xb432('0xce')])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0xcf'));}if(!this['isConfigured'](_0x2b88ed[_0xb432('0xd0')])){return this[_0xb432('0xb')]['noop']('no\x20password\x20configured');}if(!this[_0xb432('0x7e')](_0x2b88ed[_0xb432('0xd1')])){return this[_0xb432('0xb')][_0xb432('0x8e')]('no\x20text\x20configured');}this[_0xb432('0xb')][_0xb432('0xd2')]=!![];this['createSquareDetailsReport'](_0x2b88ed);this[_0xb432('0x3a')](_0x2b88ed[_0xb432('0x56')],'in');this[_0xb432('0xb')][_0xb432('0x8e')](util['format']('Trying\x20SestekNDA:\x20%s',_0x2b88ed['text']));var _0x1af003=this[_0xb432('0x5e')][_0xb432('0x80')](this,_0x2b88ed);if(_0x1af003){for(var _0x116bff in _0x1af003){if(_0x1af003[_0xb432('0x73')](_0x116bff)){this[_0xb432('0xb')][_0xb432('0x7d')](util['format'](_0xb432('0xd3'),_0x116bff[_0xb432('0xd4')]()),_0x1af003[_0x116bff]);}}this[_0xb432('0x3a')](_0x1af003[_0xb432('0xc7')],_0xb432('0xc8'));if(_0x1af003['audiofile']){this[_0xb432('0xb')][_0xb432('0x8e')](util['format'](_0xb432('0xd5'),_0x1af003['audiofile']));var _0x2becc0=this['channel'][_0xb432('0xd6')](_0x1af003[_0xb432('0xd7')]);try{fs[_0xb432('0xd8')](_0x1af003[_0xb432('0xd7')]+_0xb432('0xd9'));}catch(_0x188abb){logger['error'](_0x188abb);}return _0x2becc0;}else{return this[_0xb432('0xb')]['noop'](util[_0xb432('0x23')](_0xb432('0xda'),_0x1af003['speech']));}}return this['channel']['error'](_0x2b88ed,_0xb432('0xdb'));};AGIVertices[_0xb432('0xd')][_0xb432('0xdc')]=function(_0x40bc2b){logger['info'](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x40bc2b[_0xb432('0x83')]));return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0xdc'));};AGIVertices[_0xb432('0xd')][_0xb432('0xdd')]=function(_0x3097d1){logger[_0xb432('0x29')](util[_0xb432('0x23')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x3097d1['label']));var _0x2ce7ac='';if(_0x3097d1[_0xb432('0xde')]){if(!this['isConfigured'](_0x3097d1[_0xb432('0xde')])){return this[_0xb432('0xb')]['error'](_0x3097d1,'no\x20trunk\x20selected');}else{var _0x4b2293=parseInt(_0x3097d1['trunk_id'],0xa);if(isNaN(_0x4b2293)){_0x2ce7ac=_0x3097d1[_0xb432('0xde')];}else{_0x2ce7ac=this[_0xb432('0x18')][_0xb432('0x80')](this,_0x3097d1[_0xb432('0xde')]);if(!_0x2ce7ac){return this['channel'][_0xb432('0x27')](_0x3097d1,_0xb432('0xdf'));}}}}else if(_0x3097d1[_0xb432('0xe0')]){_0x2ce7ac=_0x3097d1['trunk_name'];}else{return this[_0xb432('0xb')][_0xb432('0x27')](_0x3097d1,_0xb432('0xe1'));}var _0x42c882=this['channel'][_0xb432('0x9e')]('DIAL',[util[_0xb432('0x23')]('SIP/%s/%s',_0x2ce7ac,_0x3097d1[_0xb432('0x41')]),_0x3097d1[_0xb432('0x87')],_0x3097d1[_0xb432('0xc0')],_0x3097d1['url']]);if(_0x42c882[_0xb432('0x7b')]===-0x1){return _0x42c882;}return this[_0xb432('0xb')][_0xb432('0x8e')](util['format'](_0xb432('0xc2'),_0xb432('0xbf')));};AGIVertices[_0xb432('0xd')]['finally']=function(_0x224c88){logger[_0xb432('0x29')](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x224c88[_0xb432('0x83')]));return this[_0xb432('0xb')]['noop'](_0xb432('0xe2'));};AGIVertices[_0xb432('0xd')][_0xb432('0x9')]=function(_0xf09c29){logger[_0xb432('0x29')](util['format'](_0xb432('0xe3'),_0xf09c29['label']));if(_0xf09c29['retry']===0x0){return this[_0xb432('0x7f')](_0xf09c29);}_0xf09c29[_0xb432('0x81')]-=0x1;if(!this[_0xb432('0x7e')](_0xf09c29[_0xb432('0xe4')])){return this['channel']['error'](_0xf09c29,_0xb432('0xe5'));}var _0x5c295c=this[_0xb432('0x1a')][_0xb432('0x80')](this,_0xf09c29[_0xb432('0xe4')]);if(!_0x5c295c){return this[_0xb432('0xb')][_0xb432('0x27')](_0xf09c29,_0xb432('0xe6'));}if(!this[_0xb432('0x7e')](_0xf09c29['variable_id'])){return this[_0xb432('0xb')][_0xb432('0x27')](_0xb432('0xb3'));}var _0x3c249e=this['channel'][_0xb432('0xe7')](_0x5c295c,_0xf09c29[_0xb432('0xe8')],_0xf09c29[_0xb432('0xe9')]);var _0x5f3f7e=_0x3c249e[_0xb432('0x7b')]?_0x3c249e[_0xb432('0x7b')][_0xb432('0x46')]():'';logger[_0xb432('0x29')](_0xb432('0xea'),JSON[_0xb432('0xeb')](_0x3c249e));if(_0x3c249e['result']===-0x1){this[_0xb432('0x31')][_0xb432('0x80')](this,_0xf09c29,_0x5f3f7e);return _0x3c249e;}else if(_0x3c249e['extra']==='timeout'){_0x3c249e[_0xb432('0x7b')]=_0x5f3f7e['length']>=parseInt(_0xf09c29[_0xb432('0xec')])?'x':'i';}else{_0x3c249e[_0xb432('0x7b')]=_0x5f3f7e[_0xb432('0x77')]>=parseInt(_0xf09c29[_0xb432('0xec')])&&_0x5f3f7e[_0xb432('0x77')]<=parseInt(_0xf09c29[_0xb432('0xe9')])?'x':'i';}var _0x20e2d8=this['getVariable'][_0xb432('0x80')](this,_0xf09c29[_0xb432('0xb4')]);if(!_0x20e2d8){return this[_0xb432('0xb')][_0xb432('0x27')](_0xf09c29,'no\x20variable\x20found');}this[_0xb432('0xb')][_0xb432('0x7d')](_0x20e2d8,_0x5f3f7e);if(this[_0xb432('0x7e')](_0xf09c29['hiddendigitsnum'])){var _0x3d68f3=parseInt(_0xf09c29[_0xb432('0xed')],0xa);var _0x16c71d=rs['generate']({'charset':'*','length':_0x3d68f3});var _0x2a6e20=_0x5f3f7e['length'];if(_0x2a6e20>0x0){if(_0x2a6e20>_0x3d68f3){this[_0xb432('0x31')][_0xb432('0x80')](this,_0xf09c29,_0xf09c29[_0xb432('0xee')]===_0xb432('0xef')?_0x16c71d+_0x5f3f7e[_0xb432('0xf0')](_0x3d68f3):_0x5f3f7e[_0xb432('0xf0')](0x0,_0x2a6e20-_0x3d68f3)+_0x16c71d);}else{this['createSquareDetailsReport'][_0xb432('0x80')](this,_0xf09c29,rs[_0xb432('0xf1')]({'charset':'*','length':_0x2a6e20}));}}else{this[_0xb432('0x31')]['sync'](this,_0xf09c29,'');}}else{this['createSquareDetailsReport'][_0xb432('0x80')](this,_0xf09c29,_0x5f3f7e);}return _0x3c249e;};AGIVertices[_0xb432('0xd')][_0xb432('0xa')]=function(_0x3dd8b5){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0xf2'),_0x3dd8b5[_0xb432('0x83')]));return this[_0xb432('0x9')](_0x3dd8b5);};AGIVertices[_0xb432('0xd')]['goal']=function(_0x39a7ad){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0xf3'),_0x39a7ad[_0xb432('0x83')]));this[_0xb432('0x31')][_0xb432('0x80')](this,_0x39a7ad,_0x39a7ad[_0xb432('0xf4')]);return this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')](_0xb432('0xf5'),_0x39a7ad[_0xb432('0xf4')]));};AGIVertices[_0xb432('0xd')]['awspolly']=function(_0x29f796){logger[_0xb432('0x29')](util['format'](_0xb432('0xf6'),_0x29f796[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x29f796[_0xb432('0x64')])||!this[_0xb432('0x7e')](_0x29f796[_0xb432('0x65')])){return this[_0xb432('0xb')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0xb432('0x7e')](_0x29f796[_0xb432('0x56')])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x96'));}this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')](_0xb432('0xf7'),_0x29f796[_0xb432('0x56')]));var _0x40ddac=this['awsPolly'][_0xb432('0x80')](this,_0x29f796);if(_0x40ddac){this['channel'][_0xb432('0x8e')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x40ddac));var _0x567d72=this[_0xb432('0xb')][_0xb432('0xd6')](_0x40ddac);try{fs[_0xb432('0xd8')](_0x40ddac+'.wav');}catch(_0x4dc11f){logger[_0xb432('0x27')](_0x4dc11f);}return _0x567d72;}return this[_0xb432('0xb')][_0xb432('0x27')](_0x29f796,_0xb432('0xf8'));};AGIVertices[_0xb432('0xd')][_0xb432('0xf9')]=function(_0x2aee48){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0xfa'),_0x2aee48[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x2aee48[_0xb432('0x64')])||!this['isConfigured'](_0x2aee48[_0xb432('0x65')])){return this['channel'][_0xb432('0x8e')](_0xb432('0xfb'));}if(!this[_0xb432('0x7e')](_0x2aee48[_0xb432('0x6b')])){return this[_0xb432('0xb')]['noop'](_0xb432('0xfc'));}if(!this[_0xb432('0x7e')](_0x2aee48[_0xb432('0x56')])){return this[_0xb432('0xb')]['noop'](_0xb432('0x96'));}this['channel']['bot']=!![];this[_0xb432('0x31')](_0x2aee48);this[_0xb432('0x3a')](_0x2aee48[_0xb432('0x56')],'in');this[_0xb432('0xb')][_0xb432('0x8e')](util['format'](_0xb432('0xfd'),_0x2aee48[_0xb432('0x56')]));var _0xd22487=this[_0xb432('0x69')][_0xb432('0x80')](this,_0x2aee48);if(_0xd22487){for(var _0x1bbbe0 in _0xd22487){if(_0xd22487['hasOwnProperty'](_0x1bbbe0)&&_[_0xb432('0x74')](_0xd22487[_0x1bbbe0])){this['channel'][_0xb432('0x7d')](util[_0xb432('0x23')](_0xb432('0xfe'),_0x1bbbe0[_0xb432('0xd4')]()),_0xd22487[_0x1bbbe0]);}}if(_[_0xb432('0x3f')](_0xd22487[_0xb432('0xff')])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x100'));}else{this['createSquareMessage'](_0xd22487[_0xb432('0xff')],_0xb432('0xc8'));return this[_0xb432('0xb')]['noop'](util[_0xb432('0x23')](_0xb432('0x101'),_0xd22487[_0xb432('0xff')]));}}return this[_0xb432('0xb')][_0xb432('0x27')](_0x2aee48,_0xb432('0x102'));};AGIVertices[_0xb432('0xd')]['googleasr']=function(_0x48b5a6){logger[_0xb432('0x29')](util['format'](_0xb432('0x103'),_0x48b5a6[_0xb432('0x83')],_0x48b5a6[_0xb432('0x87')]));if(!this[_0xb432('0x7e')](_0x48b5a6[_0xb432('0x5d')])){return this['channel'][_0xb432('0x8e')](_0xb432('0xc5'));}var _0x24dee0=_0xb432('0x104');var _0x30fb6d=util[_0xb432('0x23')](_0xb432('0x105'),FILES_PATH,rs[_0xb432('0xf1')](0x4));var _0x21f6b4=util[_0xb432('0x23')](_0xb432('0x106'),_0x30fb6d,_0x24dee0);var _0x1b224a=!![];if(_0x48b5a6[_0xb432('0x107')]===_0xb432('0x108')){_0x1b224a=![];}var _0x57c1a1=this[_0xb432('0xb')]['recordFile'](_0x30fb6d,_0x24dee0,_0x48b5a6[_0xb432('0x109')],_0x48b5a6[_0xb432('0x87')],undefined,_0x1b224a);if(_0x57c1a1[_0xb432('0x7b')]!==-0x1){this[_0xb432('0xb')]['noop'](util[_0xb432('0x23')](_0xb432('0x10a'),_0x21f6b4));var _0xe7800f=this[_0xb432('0x10b')]['sync'](this,_0x48b5a6,_0x21f6b4);if(_0xe7800f){for(var _0x3c980f in _0xe7800f){if(_0xe7800f[_0xb432('0x73')](_0x3c980f)){this['channel']['setVariable'](util[_0xb432('0x23')](_0xb432('0x10c'),_0x3c980f[_0xb432('0xd4')]()),_0xe7800f[_0x3c980f]);}}return this['channel'][_0xb432('0x8e')](util[_0xb432('0x23')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0xe7800f)));}}return _0x57c1a1;};AGIVertices[_0xb432('0xd')][_0xb432('0x10d')]=function(_0x55e1d5){logger[_0xb432('0x29')](util[_0xb432('0x23')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x55e1d5[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x55e1d5['appid'])){return this[_0xb432('0xb')]['noop']('no\x20appid\x20configured');}if(!this[_0xb432('0x7e')](_0x55e1d5[_0xb432('0x6f')])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x10e'));}var _0x5e5ec4=_0xb432('0x104');var _0x31ffd9=util[_0xb432('0x23')](_0xb432('0x105'),FILES_PATH,rs[_0xb432('0xf1')](0x4));var _0x4e2549=util[_0xb432('0x23')](_0xb432('0x106'),_0x31ffd9,_0x5e5ec4);var _0x51fc3e=!![];if(_0x55e1d5[_0xb432('0x107')]===_0xb432('0x108')){_0x51fc3e=![];}var _0x505aab=this[_0xb432('0xb')][_0xb432('0x10f')](_0x31ffd9,_0x5e5ec4,_0x55e1d5['intKey'],_0x55e1d5[_0xb432('0x87')],undefined,_0x51fc3e);if(_0x505aab[_0xb432('0x7b')]!==-0x1){this[_0xb432('0xb')]['noop'](util[_0xb432('0x23')](_0xb432('0x110'),_0x4e2549));var _0x39ad05=this[_0xb432('0x6d')]['sync'](this,_0x55e1d5,_0x4e2549);if(_0x39ad05){for(var _0x1291d4 in _0x39ad05){if(_0x39ad05[_0xb432('0x73')](_0x1291d4)){this[_0xb432('0xb')][_0xb432('0x7d')](util[_0xb432('0x23')](_0xb432('0x111'),_0x1291d4['toUpperCase']()),_0x39ad05[_0x1291d4]);}}return this[_0xb432('0xb')][_0xb432('0x8e')](util['format'](_0xb432('0x112'),JSON[_0xb432('0xeb')](_0x39ad05)));}}return _0x505aab;};AGIVertices[_0xb432('0xd')]['gotoc']=function(_0x3d18b6){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x113'),_0x3d18b6[_0xb432('0x83')]));return this[_0xb432('0xb')][_0xb432('0x114')](_0x3d18b6[_0xb432('0x37')],_0x3d18b6[_0xb432('0x38')],_0x3d18b6['priority']);};AGIVertices[_0xb432('0xd')][_0xb432('0x115')]=function(_0x142bd4){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x116'),_0x142bd4['label']));if(!this[_0xb432('0x7e')](_0x142bd4['condition'])){return this[_0xb432('0xb')][_0xb432('0x27')](_0x142bd4,_0xb432('0x117'));}try{var _0xdc91fd=eval(_0x142bd4[_0xb432('0x118')])?_0xb432('0x119'):'false';this['channel']['noop'](util[_0xb432('0x23')](_0xb432('0x11a'),_0x142bd4[_0xb432('0x118')],_0xdc91fd));return{'code':0xc8,'result':_0xdc91fd};}catch(_0x5f4397){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xb432('0xd')]['gotoiftime']=function(_0x3d02fa){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x11b'),_0x3d02fa[_0xb432('0x83')]));if(!this['isConfigured'](_0x3d02fa[_0xb432('0x11c')])){return this[_0xb432('0xb')][_0xb432('0x27')](_0x3d02fa,_0xb432('0x11d'));}var _0x20141e=this['getIntervals'][_0xb432('0x80')](this,_0x3d02fa[_0xb432('0x11c')]);if(!_0x20141e){return this['channel'][_0xb432('0x27')](_0x3d02fa,'no\x20intervals\x20found');}for(var _0x416483=0x0;_0x416483<_0x20141e[_0xb432('0x77')];_0x416483+=0x1){var _0x754807=this[_0xb432('0xb')][_0xb432('0xe')](util[_0xb432('0x23')]('IFTIME(%s?true:false)',_0x20141e[_0x416483]));if(_0x754807['result']===-0x1){return _0x754807;}logger['info'](util[_0xb432('0x23')](_0xb432('0x11e'),_0x20141e[_0x416483],_0x754807['extra']));if(_0x754807[_0xb432('0x79')]==='true'){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x11e'),_0x20141e[_0x416483],'true'));this['channel'][_0xb432('0x8e')](util[_0xb432('0x23')](_0xb432('0x11e'),_0x20141e[_0x416483],_0xb432('0x119')));return{'code':0xc8,'result':_0xb432('0x119')};}else{logger[_0xb432('0x29')](util['format'](_0xb432('0x11e'),_0x20141e[_0x416483],_0xb432('0x11f')));this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')](_0xb432('0x11e'),_0x20141e[_0x416483],_0xb432('0x11f')));}}return{'code':0xc8,'result':_0xb432('0x11f')};};AGIVertices[_0xb432('0xd')][_0xb432('0x120')]=function(_0x5b331f){logger[_0xb432('0x29')](util[_0xb432('0x23')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x5b331f[_0xb432('0x83')]));return this[_0xb432('0xb')]['hangup']();};AGIVertices[_0xb432('0xd')][_0xb432('0x121')]=function(_0x3faef2){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x122'),_0x3faef2[_0xb432('0x83')]));if(!this['isConfigured'](_0x3faef2['key'])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0xc5'));}var _0x4613d2=_0xb432('0x104');var _0x42b46d=util[_0xb432('0x23')](_0xb432('0x105'),FILES_PATH,rs['generate'](0x4));var _0xedcb0d=util[_0xb432('0x23')]('%s.%s',_0x42b46d,_0x4613d2);var _0x359c71=!![];if(_0x3faef2['beep']==='NOBEEP'){_0x359c71=![];}var _0x4deda9=this['channel']['recordFile'](_0x42b46d,_0x4613d2,_0x3faef2[_0xb432('0x109')],_0x3faef2['timeout'],undefined,_0x359c71);if(_0x4deda9[_0xb432('0x7b')]!==-0x1){this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')]('ispeech\x20%s\x20file\x20created',_0xedcb0d));var _0x23fead=this[_0xb432('0x61')][_0xb432('0x80')](this,_0x3faef2,_0xedcb0d);if(_0x23fead){for(var _0x2b33d7 in _0x23fead){if(_0x23fead['hasOwnProperty'](_0x2b33d7)){this[_0xb432('0xb')][_0xb432('0x7d')](util['format'](_0xb432('0x123'),_0x2b33d7[_0xb432('0xd4')]()),_0x23fead[_0x2b33d7]);}}return this[_0xb432('0xb')][_0xb432('0x8e')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0xb432('0xeb')](_0x23fead)));}}return _0x4deda9;};AGIVertices[_0xb432('0xd')][_0xb432('0x124')]=function(_0x3817f2){logger['info'](util[_0xb432('0x23')](_0xb432('0x125'),_0x3817f2[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x3817f2[_0xb432('0x5d')])){return this['channel'][_0xb432('0x8e')](_0xb432('0xc5'));}if(!this['isConfigured'](_0x3817f2[_0xb432('0x56')])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x96'));}this[_0xb432('0xb')][_0xb432('0x8e')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x3817f2[_0xb432('0x56')]));var _0x4b840d=this[_0xb432('0x5f')][_0xb432('0x80')](this,_0x3817f2);if(_0x4b840d){this['channel'][_0xb432('0x8e')](util[_0xb432('0x23')](_0xb432('0x126'),_0x4b840d));var _0x171362=this['channel'][_0xb432('0xd6')](_0x4b840d,_0x3817f2[_0xb432('0x109')]);try{fs[_0xb432('0xd8')](_0x4b840d+_0xb432('0xd9'));}catch(_0x11c435){logger[_0xb432('0x27')](_0x11c435);}return _0x171362;}return this[_0xb432('0xb')][_0xb432('0x27')](_0x3817f2,_0xb432('0x127'));};AGIVertices[_0xb432('0xd')][_0xb432('0x128')]=function(_0x421f17){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x129'),_0x421f17[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x421f17[_0xb432('0x12a')])){return this['channel'][_0xb432('0x27')](_0x421f17,_0xb432('0x12b'));}logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x12c'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x421f17[_0xb432('0x12a')]));var _0x1c13b0=this[_0xb432('0x50')]['sync'](this,_0x421f17['findBy']);if(_0x1c13b0){logger[_0xb432('0x29')](util['format'](_0xb432('0x12d'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x421f17['findBy']));this['channel']['noop'](util[_0xb432('0x23')](_0xb432('0x12d'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x421f17[_0xb432('0x12a')]));return{'code':0xc8,'result':_0xb432('0x12e')};}else{logger[_0xb432('0x29')](util['format'](_0xb432('0x12f'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x421f17['findBy']));this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')](_0xb432('0x12f'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x421f17[_0xb432('0x12a')]));return{'code':0xc8,'result':_0xb432('0x130')};}};AGIVertices[_0xb432('0xd')]['logout']=function(_0x18308c){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x131'),_0x18308c['label']));if(!this[_0xb432('0x7e')](_0x18308c[_0xb432('0x12a')])){return this['channel']['error'](_0x18308c,_0xb432('0x12b'));}logger[_0xb432('0x29')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x18308c[_0xb432('0x12a')]));var _0x3b7a34=this['agentLogout'][_0xb432('0x80')](this,_0x18308c[_0xb432('0x12a')]);if(_0x3b7a34){logger['info'](util['format'](_0xb432('0x12d'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x18308c[_0xb432('0x12a')]));this['channel'][_0xb432('0x8e')](util[_0xb432('0x23')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb432('0xb')][_0xb432('0x4b')],_0x18308c[_0xb432('0x12a')]));return{'code':0xc8,'result':'success'};}else{logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x12f'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x18308c[_0xb432('0x12a')]));this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xb432('0xb')][_0xb432('0x4b')],_0x18308c['findBy']));return{'code':0xc8,'result':_0xb432('0x130')};}};AGIVertices['prototype'][_0xb432('0x132')]=function(_0x52c58d){logger['info'](util['format'](_0xb432('0x133'),_0x52c58d[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x52c58d['operation'])){return this['channel']['error'](_0x52c58d,_0xb432('0x134'));}this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')]('math\x20%s',_0x52c58d['operation']));var _0x361f5b=eval(_0x52c58d[_0xb432('0x135')]);if(!this[_0xb432('0x7e')](_0x52c58d[_0xb432('0xb4')])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0xb3'));}var _0x48505b=this['getVariable']['sync'](this,_0x52c58d['variable_id']);if(!_0x48505b){return this[_0xb432('0xb')][_0xb432('0x27')](_0x52c58d,_0xb432('0xb5'));}if(_[_0xb432('0x136')](_0x361f5b)){var _0x317824=this;_0x361f5b['forEach'](function(_0x41b935,_0x1e4e44){_0x317824[_0xb432('0xb')][_0xb432('0x7d')](util['format'](_0xb432('0x137'),_0x48505b,_0x1e4e44),_0x41b935);});return this['channel'][_0xb432('0x8e')](util['format'](_0xb432('0x138'),_0x48505b));}else{return this[_0xb432('0xb')][_0xb432('0x7d')](_0x48505b,_0x361f5b);}};AGIVertices[_0xb432('0xd')]['menu']=function(_0x56fc26){logger['info'](util[_0xb432('0x23')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x56fc26[_0xb432('0x83')]));if(_0x56fc26[_0xb432('0x81')]===0x0){return this['maxRetry'](_0x56fc26);}_0x56fc26['retry']-=0x1;if(!this[_0xb432('0x7e')](_0x56fc26[_0xb432('0xe4')])){return this['channel'][_0xb432('0x27')](_0x56fc26,_0xb432('0xe5'));}var _0x414425=this[_0xb432('0x1a')][_0xb432('0x80')](this,_0x56fc26[_0xb432('0xe4')]);if(!_0x414425){return this[_0xb432('0xb')][_0xb432('0x27')](_0x56fc26,'no\x20file\x20audio\x20found');}var _0x379c82=this[_0xb432('0xb')][_0xb432('0xe7')](_0x414425,_0x56fc26['response'],_0x56fc26[_0xb432('0x139')]);var _0x364a2b=_0x379c82[_0xb432('0x7b')];if(_0x379c82[_0xb432('0x7b')]===-0x1){this[_0xb432('0x31')][_0xb432('0x80')](this,_0x56fc26,'-1');return _0x379c82;}else if(_0x379c82['extra']===_0xb432('0x87')){_0x379c82['result']=_0x379c82[_0xb432('0x7b')]['length']>0x0?_0x379c82[_0xb432('0x7b')]:'t';}else if(_[_0xb432('0x3c')](_0x379c82[_0xb432('0x7b')])){_0x379c82['result']='#';_0x364a2b='#';}if(!this[_0xb432('0x7e')](_0x56fc26[_0xb432('0xb4')])){this[_0xb432('0xb')][_0xb432('0x8e')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x2a2ea6=this[_0xb432('0xe')]['sync'](this,_0x56fc26['variable_id']);if(!_0x2a2ea6){return this[_0xb432('0xb')][_0xb432('0x27')](_0x56fc26,'no\x20variable\x20found');}this[_0xb432('0xb')][_0xb432('0x7d')](_0x2a2ea6,_0x364a2b);}this['createSquareDetailsReport']['sync'](this,_0x56fc26,_0x364a2b);return _0x379c82;};AGIVertices[_0xb432('0xd')][_0xb432('0x8e')]=function(_0x5995ad){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x13a'),_0x5995ad[_0xb432('0x83')]));return this['channel']['noop'](_0x5995ad['output']||_0x5995ad[_0xb432('0x83')]);};AGIVertices[_0xb432('0xd')][_0xb432('0x13b')]=function(_0x3ca0ab){logger['info'](util[_0xb432('0x23')](_0xb432('0x13c'),_0x3ca0ab['label']));if(!this[_0xb432('0x7e')](_0x3ca0ab['findBy'])){return this[_0xb432('0xb')]['error'](_0x3ca0ab,_0xb432('0x12b'));}logger['info'](util[_0xb432('0x23')](_0xb432('0x12c'),this['channel']['callerid'],_0x3ca0ab[_0xb432('0x12a')]));var _0x993910=this[_0xb432('0x13d')][_0xb432('0x80')](this,_0x3ca0ab['pause_id']);var _0xfd5d53=this['agentPause'][_0xb432('0x80')](this,_0x3ca0ab[_0xb432('0x12a')],_0x993910);if(_0xfd5d53){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x12d'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x3ca0ab['findBy']));this[_0xb432('0xb')]['noop'](util[_0xb432('0x23')](_0xb432('0x12d'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x3ca0ab[_0xb432('0x12a')]));return{'code':0xc8,'result':_0xb432('0x12e')};}else{logger[_0xb432('0x29')](util['format'](_0xb432('0x12f'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x3ca0ab[_0xb432('0x12a')]));this[_0xb432('0xb')]['noop'](util['format'](_0xb432('0x12d'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x3ca0ab[_0xb432('0x12a')]));return{'code':0xc8,'result':_0xb432('0x130')};}};AGIVertices['prototype'][_0xb432('0x13e')]=function(_0x2de0c0){logger['info'](util['format'](_0xb432('0x13f'),_0x2de0c0[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x2de0c0[_0xb432('0xe4')])){return this[_0xb432('0xb')][_0xb432('0x27')](_0x2de0c0,'no\x20file\x20audio\x20selected');}var _0x5556ea=this[_0xb432('0x1a')][_0xb432('0x80')](this,_0x2de0c0['file_id']);if(!_0x5556ea){return this['channel'][_0xb432('0x27')](_0x2de0c0,_0xb432('0xe6'));}var _0x4ddef3=this[_0xb432('0xb')][_0xb432('0x9e')](_0xb432('0x140'),[_0x5556ea,_0x2de0c0[_0xb432('0xc0')]]);if(_0x4ddef3[_0xb432('0x7b')]===-0x1){return _0x4ddef3;}return this['channel'][_0xb432('0x8e')](util[_0xb432('0x23')](_0xb432('0x93'),'PLAYBACK',_0x5556ea));};AGIVertices[_0xb432('0xd')][_0xb432('0x141')]=function(_0x260faa){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x142'),_0x260faa['label']));if(!this[_0xb432('0x7e')](_0x260faa['queue_id'])){return this['channel'][_0xb432('0x27')](_0x260faa,'no\x20queue\x20selected');}var _0x58d032='';var _0x53366d=parseInt(_0x260faa[_0xb432('0x143')],0xa);if(isNaN(_0x53366d)){_0x58d032=_0x260faa[_0xb432('0x143')];}else{_0x58d032=this[_0xb432('0x11')][_0xb432('0x80')](this,_0x260faa['queue_id']);if(!_0x58d032){return this['channel'][_0xb432('0x27')](_0x260faa,_0xb432('0x144'));}}var _0x4677dc='';if(this[_0xb432('0x7e')](_0x260faa[_0xb432('0xe4')])){var _0xcb16e3=this[_0xb432('0x1a')]['sync'](this,_0x260faa[_0xb432('0xe4')]);if(_0xcb16e3){_0x4677dc=_0xcb16e3;}}this[_0xb432('0x31')][_0xb432('0x80')](this,_0x260faa,_0x58d032);if(_0x260faa[_0xb432('0xc0')][_0xb432('0x145')]('x')<0x0){_0x260faa[_0xb432('0xc0')]+='x';}if(_0x260faa[_0xb432('0xc0')]['indexOf']('X')<0x0){_0x260faa[_0xb432('0xc0')]+='X';}this['channel']['setVariable']('XMCS-QUEUE',_0x58d032?_0x58d032['toLowerCase']():'');var _0x43c0bb=this[_0xb432('0xb')]['exec'](_0xb432('0x146'),[_0x58d032,_0x260faa['opts'],_0x260faa[_0xb432('0xc1')],_0x4677dc,_0x260faa[_0xb432('0x87')],_0x260faa[_0xb432('0x82')],_0x260faa['macro'],_0x260faa[_0xb432('0x147')],'',_0x260faa[_0xb432('0x148')]]);if(_0x43c0bb[_0xb432('0x7b')]===-0x1){return _0x43c0bb;}return this['channel'][_0xb432('0x8e')](util[_0xb432('0x23')]('Executed\x20command\x20%s\x20%s',_0xb432('0x146'),_0x58d032));};AGIVertices[_0xb432('0xd')]['record']=function(_0x2ffc36){logger['info'](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x2ffc36[_0xb432('0x83')]));var _0x5bed9f=_0x2ffc36[_0xb432('0x149')]||_0xb432('0x104');var _0xed2dfe=util[_0xb432('0x23')]('%s_%s',this[_0xb432('0xb')]['uniqueid'],rs[_0xb432('0xf1')](0x5));var _0x54c693=util[_0xb432('0x23')](_0xb432('0x14a'),FILES_PATH,_0xed2dfe,_0x5bed9f);var _0x2d75c6=util['format'](_0xb432('0x105'),FILES_PATH,_0xed2dfe);this[_0xb432('0x35')][_0xb432('0x80')](this,_0x2ffc36,_0xed2dfe,_0x54c693);this[_0xb432('0xb')][_0xb432('0x7d')](_0xb432('0x14b'),_0xed2dfe);logger[_0xb432('0x29')](_0xb432('0x14c'),_0x2d75c6,_0x5bed9f,_0x2ffc36[_0xb432('0x14d')],_0x2ffc36[_0xb432('0x87')]);return this[_0xb432('0xb')]['recordFile'](_0x2d75c6,_0x5bed9f,_0x2ffc36[_0xb432('0x14d')],_0x2ffc36[_0xb432('0x87')],undefined,!![]);};AGIVertices[_0xb432('0xd')][_0xb432('0x14e')]=function(_0x5ab30b){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x14f'),_0x5ab30b[_0xb432('0x83')]));return this['channel'][_0xb432('0x150')](_0x5ab30b[_0xb432('0x151')]['replace'](/\s+/g,''),_0x5ab30b['escape_digits']);};AGIVertices[_0xb432('0xd')][_0xb432('0x152')]=function(_0x134956){logger['info'](util['format'](_0xb432('0x153'),_0x134956[_0xb432('0x83')]));return this[_0xb432('0xb')]['sayNumber'](_0x134956[_0xb432('0x154')][_0xb432('0x53')](/\s+/g,''),_0x134956[_0xb432('0x14d')]);};AGIVertices[_0xb432('0xd')][_0xb432('0x155')]=function(_0x39dd48){logger[_0xb432('0x29')](util['format'](_0xb432('0x156'),_0x39dd48[_0xb432('0x83')]));return this[_0xb432('0xb')]['sayPhonetic'](_0x39dd48['text'],_0x39dd48[_0xb432('0x14d')]);};AGIVertices[_0xb432('0xd')][_0xb432('0x157')]=function(_0x3ab781){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x158'),_0x3ab781[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x3ab781[_0xb432('0x159')])){return this[_0xb432('0xb')][_0xb432('0x8e')]('no\x20mail\x20account\x20configured');}var _0x48ead4=this['getMailAccount']['sync'](this,_0x3ab781[_0xb432('0x159')]);if(!_0x48ead4||!_0x48ead4[_0xb432('0x15a')]){return this[_0xb432('0xb')][_0xb432('0x27')](_0x3ab781,_0xb432('0x15b'));}var _0x148e0d={'from':util[_0xb432('0x23')](_0xb432('0x15c'),_0x48ead4['name'],_0x48ead4['email']||_0x48ead4[_0xb432('0x15a')]['user']),'to':_0x3ab781['to']||'','cc':_0x3ab781['cc']||'','bcc':_0x3ab781[_0xb432('0x15d')]||'','subject':_0x3ab781[_0xb432('0x15e')],'html':_0x3ab781[_0xb432('0x56')],'text':_0x3ab781[_0xb432('0x56')]};var _0x10295e={'tls':{'rejectUnauthorized':![]}};if(_0x48ead4[_0xb432('0x15a')][_0xb432('0x15f')]){_0x10295e['service']=_0x48ead4[_0xb432('0x15a')][_0xb432('0x15f')];}else{_0x10295e[_0xb432('0x160')]=_0x48ead4['Smtp'][_0xb432('0x160')];_0x10295e[_0xb432('0x161')]=_0x48ead4[_0xb432('0x15a')][_0xb432('0x161')];_0x10295e[_0xb432('0x162')]=_0x48ead4[_0xb432('0x15a')][_0xb432('0x162')];}if(_0x48ead4[_0xb432('0x15a')][_0xb432('0x163')]){_0x10295e[_0xb432('0x164')]={'user':_0x48ead4[_0xb432('0x15a')]['user'],'pass':_0x48ead4[_0xb432('0x15a')][_0xb432('0x165')]};}if(this[_0xb432('0x7e')](_0x3ab781['template_id'])){}logger[_0xb432('0xbb')](_0xb432('0x166'),JSON['stringify'](_0x148e0d));this['createSquareDetailsReport'][_0xb432('0x80')](this,_0x3ab781,_0x3ab781['account_id']);this[_0xb432('0xb')]['noop'](util[_0xb432('0x23')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x48ead4['name']));this[_0xb432('0x1f')][_0xb432('0x80')](this,_0x10295e,_0x148e0d);return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x167'));};AGIVertices[_0xb432('0xd')][_0xb432('0x168')]=function(_0x32ef1f){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x169'),_0x32ef1f[_0xb432('0x83')]));return this['channel'][_0xb432('0x8e')](_0xb432('0x16a'));};AGIVertices['prototype'][_0xb432('0x16b')]=function(_0x361cc5){logger[_0xb432('0x29')](util['format'](_0xb432('0x16c'),_0x361cc5['label']));if(!this[_0xb432('0x7e')](_0x361cc5[_0xb432('0x16d')])){return this[_0xb432('0xb')]['noop']('no\x20sms\x20account\x20configured');}var _0x32f92b=this[_0xb432('0x2e')]['sync'](this,_0x361cc5[_0xb432('0x16d')]);if(!_0x32f92b){return this['channel'][_0xb432('0x27')](_0x361cc5,_0xb432('0x16e'));}var _0x11d904={'body':_0x361cc5['sms_text'],'phone':_0x361cc5['to']||'','SmsAccountId':_0x32f92b['id']};logger[_0xb432('0xbb')]('sendSMS\x20message',JSON[_0xb432('0xeb')](_0x11d904));this[_0xb432('0x31')][_0xb432('0x80')](this,_0x361cc5,_0x361cc5[_0xb432('0x16d')]);this[_0xb432('0xb')][_0xb432('0x8e')](util['format'](_0xb432('0x16f'),_0x32f92b[_0xb432('0x10')]));this[_0xb432('0x30')][_0xb432('0x80')](this,_0x11d904);return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x170'));};AGIVertices[_0xb432('0xd')][_0xb432('0x171')]=function(_0x4c2c0a){logger['info'](util[_0xb432('0x23')](_0xb432('0x172'),_0x4c2c0a[_0xb432('0x83')]));if(!this[_0xb432('0x7e')](_0x4c2c0a[_0xb432('0xb4')])){return this[_0xb432('0xb')]['error'](_0x4c2c0a,_0xb432('0x173'));}var _0x4fc1c8=this[_0xb432('0xe')][_0xb432('0x80')](this,_0x4c2c0a['variable_id']);if(!_0x4fc1c8){return this[_0xb432('0xb')][_0xb432('0x27')](_0x4c2c0a,_0xb432('0xb5'));}return this[_0xb432('0xb')][_0xb432('0x7d')](_0x4fc1c8,_0x4c2c0a[_0xb432('0x174')]);};AGIVertices['prototype'][_0xb432('0x175')]=function(_0x139dcc){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x176'),_0x139dcc[_0xb432('0x83')]));this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x177'));if(_0x139dcc[_0xb432('0x8a')]===_0xb432('0x178')){this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x179'));return this[_0xb432('0xb')]['answer']();}return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x17a'));};AGIVertices[_0xb432('0xd')][_0xb432('0x17b')]=function(_0x55b75b){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x17c'),_0x55b75b['label']));if(!this['isConfigured'](_0x55b75b[_0xb432('0x17d')])){return this[_0xb432('0xb')][_0xb432('0x27')](_0x55b75b,_0xb432('0x17e'));}var _0x43399e=this[_0xb432('0x17f')]['sync'](this,_0x55b75b[_0xb432('0x17d')]);if(!this[_0xb432('0x7e')](_0x43399e)){return this['channel'][_0xb432('0x27')](_0x55b75b,util[_0xb432('0x23')](_0xb432('0x180'),_0x55b75b[_0xb432('0x17d')]));}if(_0x43399e===this[_0xb432('0xb')][_0xb432('0x34')]){return this[_0xb432('0xb')][_0xb432('0x27')](_0x55b75b,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport'][_0xb432('0x80')](this,_0x55b75b,_0x43399e);var _0x27adfb=this[_0xb432('0xb')][_0xb432('0x9e')](_0xb432('0x181'),util[_0xb432('0x23')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xb432('0x82')]['host']||_0xb432('0x182'),_0x43399e,this['channel'][_0xb432('0x34')]));if(_0x27adfb[_0xb432('0x7b')]===-0x1){return _0x27adfb;}return this['channel']['noop'](util['format'](_0xb432('0x93'),_0xb432('0x181'),_0x43399e));};AGIVertices[_0xb432('0xd')][_0xb432('0x183')]=function(_0x4791c3){logger['info'](util[_0xb432('0x23')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x4791c3[_0xb432('0x83')]));var _0x113dd2=this[_0xb432('0x51')][_0xb432('0x80')](this,_0x4791c3[_0xb432('0x84')]);this[_0xb432('0x31')][_0xb432('0x80')](this,_0x4791c3,_0x4791c3[_0xb432('0x84')]);if(this[_0xb432('0x7e')](_0x4791c3[_0xb432('0xb4')])){var _0x477858=this[_0xb432('0xe')][_0xb432('0x80')](this,_0x4791c3[_0xb432('0xb4')]);if(_0x477858){this[_0xb432('0xb')]['setVariable'](_0x477858,_0x113dd2);return this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')](_0xb432('0x184'),_0x4791c3[_0xb432('0x84')],_0x477858));}}return this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')](_0xb432('0x185'),_0x4791c3[_0xb432('0x84')]));};AGIVertices[_0xb432('0xd')][_0xb432('0x186')]=function(_0x46f749){logger['info'](util[_0xb432('0x23')](_0xb432('0x187'),_0x46f749['label']));if(!this[_0xb432('0x7e')](_0x46f749[_0xb432('0x55')])){return this['channel'][_0xb432('0x8e')](_0xb432('0x188'));}if(!this[_0xb432('0x7e')](_0x46f749[_0xb432('0x56')])){return this[_0xb432('0xb')]['noop']('no\x20text\x20configured');}this['channel'][_0xb432('0x8e')](util[_0xb432('0x23')](_0xb432('0x189'),_0x46f749['text']));var _0x25a791=this[_0xb432('0x54')][_0xb432('0x80')](this,_0x46f749);if(_0x25a791){this['channel'][_0xb432('0x8e')](util['format'](_0xb432('0x18a'),_0x25a791));var _0x29f95f=this['channel'][_0xb432('0xd6')](_0x25a791);try{fs[_0xb432('0xd8')](_0x25a791+_0xb432('0xd9'));}catch(_0x479ece){logger[_0xb432('0x27')](_0x479ece);}return _0x29f95f;}return this[_0xb432('0xb')][_0xb432('0x27')](_0x46f749,_0xb432('0x18b'));};AGIVertices[_0xb432('0xd')]['tts']=function(_0x100d43){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x18c'),_0x100d43['label']));if(!this['isConfigured'](_0x100d43[_0xb432('0x56')])){return this[_0xb432('0xb')][_0xb432('0x8e')](_0xb432('0x96'));}this[_0xb432('0xb')]['noop'](util[_0xb432('0x23')](_0xb432('0x18d'),_0x100d43[_0xb432('0x56')]));var _0x70cfd5=this[_0xb432('0x5b')][_0xb432('0x80')](this,_0x100d43);if(_0x70cfd5){this[_0xb432('0xb')]['noop'](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x70cfd5));var _0x2287c0=this[_0xb432('0xb')][_0xb432('0xd6')](_0x70cfd5);try{fs['unlink'](_0x70cfd5+_0xb432('0xd9'));}catch(_0x40341b){logger[_0xb432('0x27')](_0x40341b);}return _0x2287c0;}return this['channel'][_0xb432('0x27')](_0x100d43,_0xb432('0x18e'));};AGIVertices[_0xb432('0xd')][_0xb432('0x18f')]=function(_0x2b22f9){logger['info'](util['format'](_0xb432('0x190'),_0x2b22f9['label']));if(!this[_0xb432('0x7e')](_0x2b22f9['findBy'])){return this['channel'][_0xb432('0x27')](_0x2b22f9,'no\x20find\x20by\x20configured');}logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x12c'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x2b22f9[_0xb432('0x12a')]));var _0x4da6cf=this['agentUnpause'][_0xb432('0x80')](this,_0x2b22f9[_0xb432('0x12a')]);if(_0x4da6cf){logger[_0xb432('0x29')](util[_0xb432('0x23')](_0xb432('0x12d'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x2b22f9['findBy']));this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb432('0xb')][_0xb432('0x4b')],_0x2b22f9[_0xb432('0x12a')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xb432('0x23')](_0xb432('0x12f'),this[_0xb432('0xb')][_0xb432('0x4b')],_0x2b22f9[_0xb432('0x12a')]));this[_0xb432('0xb')]['noop'](util[_0xb432('0x23')](_0xb432('0x12f'),this['channel'][_0xb432('0x4b')],_0x2b22f9[_0xb432('0x12a')]));return{'code':0xc8,'result':_0xb432('0x130')};}};AGIVertices[_0xb432('0xd')][_0xb432('0x191')]=function(_0xc3a1f6){logger[_0xb432('0x29')](util[_0xb432('0x23')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0xc3a1f6['label']));var _0x5ed2eb=this[_0xb432('0xb')]['exec']('VOICEMAIL',[_0xc3a1f6[_0xb432('0x192')],_0xc3a1f6[_0xb432('0x94')]]);if(_0x5ed2eb[_0xb432('0x7b')]===-0x1){return _0x5ed2eb;}return this[_0xb432('0xb')][_0xb432('0x8e')](util[_0xb432('0x23')]('Executed\x20command\x20%s\x20%s',_0xb432('0x193'),_0xc3a1f6['mailbox']));};AGIVertices[_0xb432('0xd')][_0xb432('0x194')]=function(_0x2e9355){logger[_0xb432('0x29')](util['format'](_0xb432('0x195'),_0x2e9355['label']));if(!this[_0xb432('0x7e')](_0x2e9355[_0xb432('0xb4')])){return this[_0xb432('0xb')][_0xb432('0x27')](_0x2e9355,'no\x20variable\x20selected');}var _0x2c0d20=this[_0xb432('0xe')][_0xb432('0x80')](this,_0x2e9355['variable_id']);if(!_0x2c0d20){return this[_0xb432('0xb')][_0xb432('0x27')](_0x2e9355,'no\x20variable\x20found');}var _0xff9166=this[_0xb432('0xb')][_0xb432('0xe')](_0x2c0d20);return{'code':0xc8,'result':_0xff9166[_0xb432('0x79')]?_0xff9166['extra']:'-'};};String[_0xb432('0xd')][_0xb432('0x78')]=function(_0x5466b3,_0x1b77df){return this[_0xb432('0x76')](_0x5466b3)['join'](_0x1b77df);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 4fabd57..8e97cc5 100644 --- a/server/services/ami/acw/index.js +++ b/server/services/ami/acw/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee14=['diff','seconds','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','lastPauseAt','update','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds'];(function(_0x6fda4c,_0x10ab5f){var _0x284923=function(_0x178cdd){while(--_0x178cdd){_0x6fda4c['push'](_0x6fda4c['shift']());}};_0x284923(++_0x10ab5f);}(_0xee14,0x13a));var _0x4ee1=function(_0x1eb794,_0x13c92c){_0x1eb794=_0x1eb794-0x0;var _0x211ac1=_0xee14[_0x1eb794];return _0x211ac1;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x4ee1('0x0'));var ami=require(_0x4ee1('0x1'));var logger=require(_0x4ee1('0x2'))(_0x4ee1('0x3'));var RpcUser=require(_0x4ee1('0x4'));var RpcVoiceAgentReport=require(_0x4ee1('0x5'));function Acw(_0x34a0ae){this[_0x4ee1('0x6')]=_0x34a0ae[_0x4ee1('0x6')];this['agents']=_0x34a0ae[_0x4ee1('0x7')];this['timers']=_0x34a0ae[_0x4ee1('0x8')];this[_0x4ee1('0x9')]={};ami['on'](_0x4ee1('0xa'),this[_0x4ee1('0xb')][_0x4ee1('0xc')](this));ami['on'](_0x4ee1('0xd'),this['syncHangupRequest'][_0x4ee1('0xc')](this));ami['on'](_0x4ee1('0xe'),this['syncHangup'][_0x4ee1('0xc')](this));ami['on'](_0x4ee1('0xf'),this[_0x4ee1('0x10')][_0x4ee1('0xc')](this));ami['on']('attendedtransfer',this[_0x4ee1('0x11')][_0x4ee1('0xc')](this));ami['on'](_0x4ee1('0x12'),this[_0x4ee1('0x13')][_0x4ee1('0xc')](this));ami['on'](_0x4ee1('0x14'),this['syncAgentConnectPreview'][_0x4ee1('0xc')](this));}function getDiff(_0x461f99){var _0x1096a5=moment()[_0x4ee1('0x15')](0x0);var _0x46d2c2=moment(_0x461f99)[_0x4ee1('0x15')](0x0);return _0x1096a5[_0x4ee1('0x16')](_0x46d2c2,_0x4ee1('0x17'));}Acw[_0x4ee1('0x18')]['startAcw']=function(_0x2f9194){try{var _0x38008f=this;var _0x34651b=this[_0x4ee1('0x9')][_0x2f9194][_0x4ee1('0x19')];var _0x38fc33=this[_0x4ee1('0x9')][_0x2f9194][_0x4ee1('0x1a')];var _0x360056=this[_0x4ee1('0x6')][_0x38fc33];var _0x274de5=![];var _0x5d76de=_0x4ee1('0x1b');if(_0x360056[_0x4ee1('0x1c')]){if(_0x360056[_0x4ee1('0x1d')][_0x4ee1('0x1e')]){_0x274de5=!![];_0x5d76de=_0x360056[_0x4ee1('0x1d')][_0x4ee1('0x1e')];}}ami['Action']({'action':_0x4ee1('0x1f'),'interface':_0x34651b,'paused':!![],'reason':_0x5d76de})[_0x4ee1('0x20')](function(_0x46611a){if(_0x38008f[_0x4ee1('0x7')][_0x34651b]){return RpcUser[_0x4ee1('0x21')](_0x38008f[_0x4ee1('0x7')][_0x34651b]['id'])[_0x4ee1('0x20')](function(_0x40fd98){if(_0x40fd98&&!_0x40fd98[_0x4ee1('0x22')]){logger[_0x4ee1('0x23')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x2f9194,_0x34651b,_0x38fc33);var _0x53d43f=_0x38008f[_0x4ee1('0x9')][_0x2f9194][_0x4ee1('0x24')]&&_0x38008f[_0x4ee1('0x9')][_0x2f9194][_0x4ee1('0x25')]?_0x38008f[_0x4ee1('0x9')][_0x2f9194][_0x4ee1('0x25')]:_0x2f9194;return RpcUser['savePause'](_0x38008f['agents'][_0x34651b],_0x5d76de,_0x53d43f)[_0x4ee1('0x20')](function(_0x28b7e1){if(!_0x274de5){_0x38008f['timers'][_0x34651b]={};logger[_0x4ee1('0x23')](_0x4ee1('0x26'),_0x2f9194,_0x38008f[_0x4ee1('0x6')][_0x38fc33][_0x4ee1('0x27')],_0x34651b,_0x38fc33);_0x38008f[_0x4ee1('0x8')][_0x34651b][_0x4ee1('0x28')]=setTimeout(_0x38008f[_0x4ee1('0x29')]['bind'](_0x38008f,_0x34651b),_0x38008f[_0x4ee1('0x6')][_0x38fc33]['acwTimeout']*0x3e8);_0x38008f[_0x4ee1('0x8')][_0x34651b]['lastPauseAt']=moment()[_0x4ee1('0x2a')](_0x4ee1('0x2b'));_0x38008f[_0x4ee1('0x8')][_0x34651b][_0x4ee1('0x2c')]=_0x2f9194;_0x38008f[_0x4ee1('0x8')][_0x34651b]['queue']=_0x38fc33;_0x38008f[_0x4ee1('0x8')][_0x34651b]['updateAcw']=function(){var _0x121301=getDiff(_0x38008f[_0x4ee1('0x8')][_0x34651b][_0x4ee1('0x2d')]);clearTimeout(_0x38008f[_0x4ee1('0x8')][_0x34651b][_0x4ee1('0x28')]);_0x38008f['timers'][_0x34651b][_0x4ee1('0x28')]=![];RpcVoiceAgentReport[_0x4ee1('0x2e')]({'acwtime':_0x121301},_0x38008f[_0x4ee1('0x8')][_0x34651b][_0x4ee1('0x2c')],_0x34651b)[_0x4ee1('0x20')](function(_0x393990){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x2f9194,_0x121301,_0x393990);})[_0x4ee1('0x2f')](function(_0x54482b){logger[_0x4ee1('0x30')]('[%s][UPDATE][ERRORS:%s]',_0x2f9194,_0x54482b);});delete _0x38008f[_0x4ee1('0x8')][_0x34651b];};}});}else{logger[_0x4ee1('0x23')](_0x4ee1('0x31'),_0x2f9194,_0x34651b,_0x38fc33);}});}})[_0x4ee1('0x2f')](function(_0x9f882d){logger[_0x4ee1('0x30')](_0x4ee1('0x26'),_0x2f9194,_0x38008f[_0x4ee1('0x6')][_0x38fc33][_0x4ee1('0x27')],_0x34651b,_0x38fc33);})[_0x4ee1('0x32')](function(){delete _0x38008f[_0x4ee1('0x9')][_0x2f9194];});}catch(_0x1f3371){logger[_0x4ee1('0x30')]('[ACW][START]\x20%s',_0x1f3371[_0x4ee1('0x33')]);}};Acw[_0x4ee1('0x18')][_0x4ee1('0x29')]=function(_0x50539f){try{var _0x4858f9=this;if(_0x4858f9[_0x4ee1('0x8')][_0x50539f]){_0x4858f9[_0x4ee1('0x8')][_0x50539f][_0x4ee1('0x28')]=![];var _0x1f2b4b=_0x4858f9['timers'][_0x50539f][_0x4ee1('0x2c')];var _0x2ed16f=_0x4858f9[_0x4ee1('0x8')][_0x50539f][_0x4ee1('0x1a')];var _0x2653c4=_0x4858f9[_0x4ee1('0x6')][_0x2ed16f][_0x4ee1('0x27')];logger[_0x4ee1('0x23')]('[TIMER][STOP][AGENT:%s]',_0x50539f);RpcUser[_0x4ee1('0x34')](this[_0x4ee1('0x7')][_0x50539f]);RpcVoiceAgentReport[_0x4ee1('0x2e')]({'acwtime':_0x2653c4,'agentacw':!![]},_0x1f2b4b,_0x50539f)[_0x4ee1('0x20')](function(_0x45bb22){logger[_0x4ee1('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x1f2b4b,_0x2653c4,_0x45bb22);})[_0x4ee1('0x2f')](function(_0x37176a){logger[_0x4ee1('0x30')](_0x4ee1('0x35'),_0x1f2b4b,_0x37176a);});}else{logger[_0x4ee1('0x30')](_0x4ee1('0x36'),_0x50539f);if(_0x4858f9[_0x4ee1('0x8')]){logger[_0x4ee1('0x23')](_0x4ee1('0x37'),JSON[_0x4ee1('0x38')](_0x4858f9[_0x4ee1('0x8')]));}}}catch(_0x46bf93){logger[_0x4ee1('0x30')]('[ACW][STOP]\x20%s',_0x46bf93[_0x4ee1('0x33')]);}};Acw[_0x4ee1('0x18')]['syncAgentConnect']=function(_0x3c759f){try{if(this['voiceQueues'][_0x3c759f[_0x4ee1('0x1a')]]&&(this['voiceQueues'][_0x3c759f[_0x4ee1('0x1a')]][_0x4ee1('0x3')]||this['voiceQueues'][_0x3c759f[_0x4ee1('0x1a')]][_0x4ee1('0x1c')])){if(this[_0x4ee1('0x7')][_0x3c759f[_0x4ee1('0x19')]]){this['channels'][_0x3c759f[_0x4ee1('0x2c')]]={'queue':_0x3c759f[_0x4ee1('0x1a')],'interface':_0x3c759f[_0x4ee1('0x19')],'destlinkedid':_0x3c759f['destlinkedid']};}}}catch(_0x4fbe92){logger[_0x4ee1('0x30')](_0x4ee1('0x39'),_0x4fbe92[_0x4ee1('0x33')]);}};Acw[_0x4ee1('0x18')][_0x4ee1('0x3a')]=function(_0x4ebcca){try{if(this['voiceQueues'][_0x4ebcca[_0x4ee1('0x1a')]]&&(this[_0x4ee1('0x6')][_0x4ebcca[_0x4ee1('0x1a')]][_0x4ee1('0x3')]||this['voiceQueues'][_0x4ebcca[_0x4ee1('0x1a')]][_0x4ee1('0x1c')])){if(this['agents'][_0x4ebcca[_0x4ee1('0x19')]]){this[_0x4ee1('0x9')][_0x4ebcca[_0x4ee1('0x2c')]]={'queue':_0x4ebcca[_0x4ee1('0x1a')],'interface':_0x4ebcca[_0x4ee1('0x19')]};}}}catch(_0x154ec0){logger[_0x4ee1('0x30')](_0x4ee1('0x3b'),_0x154ec0[_0x4ee1('0x33')]);}};Acw['prototype']['syncHangupRequest']=function(_0x1a972b){try{if(this[_0x4ee1('0x9')][_0x1a972b[_0x4ee1('0x2c')]]&&_[_0x4ee1('0x3c')](this['channels'][_0x1a972b[_0x4ee1('0x2c')]][_0x4ee1('0x24')])){logger[_0x4ee1('0x23')](_0x4ee1('0x3d'),_0x1a972b[_0x4ee1('0x2c')]);this['startAcw'](_0x1a972b[_0x4ee1('0x2c')]);}else if(this[_0x4ee1('0x9')][_0x1a972b[_0x4ee1('0x3e')]]&&_['isUndefined'](this[_0x4ee1('0x9')][_0x1a972b['linkedid']][_0x4ee1('0x24')])){logger['info'](_0x4ee1('0x3f'),_0x1a972b['linkedid']);this[_0x4ee1('0x40')](_0x1a972b['linkedid']);}}catch(_0x58919){logger[_0x4ee1('0x30')](_0x4ee1('0x41'),_0x58919['message']);}};Acw[_0x4ee1('0x18')][_0x4ee1('0x42')]=function(_0xcdb873){try{if(this[_0x4ee1('0x9')][_0xcdb873[_0x4ee1('0x2c')]]&&this[_0x4ee1('0x9')][_0xcdb873[_0x4ee1('0x2c')]]['attended']){logger['info'](_0x4ee1('0x43'),_0xcdb873[_0x4ee1('0x2c')]);this[_0x4ee1('0x40')](_0xcdb873[_0x4ee1('0x2c')]);}else if(this[_0x4ee1('0x9')][_0xcdb873[_0x4ee1('0x3e')]]&&this[_0x4ee1('0x9')][_0xcdb873[_0x4ee1('0x3e')]][_0x4ee1('0x24')]){logger[_0x4ee1('0x23')](_0x4ee1('0x44'),_0xcdb873[_0x4ee1('0x3e')]);this[_0x4ee1('0x40')](_0xcdb873['linkedid']);}}catch(_0x1bafa8){logger['error'](_0x4ee1('0x45'),_0x1bafa8[_0x4ee1('0x33')]);}};Acw['prototype'][_0x4ee1('0x11')]=function(_0x184e36){try{if(!_['isNil'](this['channels'][_0x184e36[_0x4ee1('0x46')]])){this['startAcw'](_0x184e36[_0x4ee1('0x46')]);if(this[_0x4ee1('0x9')][_0x184e36['secondtransfereruniqueid']]){this[_0x4ee1('0x9')][_0x184e36[_0x4ee1('0x47')]][_0x4ee1('0x24')]=!![];this[_0x4ee1('0x9')][_0x184e36[_0x4ee1('0x48')]]=this[_0x4ee1('0x9')][_0x184e36[_0x4ee1('0x47')]];delete this['channels'][_0x184e36['secondtransfereruniqueid']];}}else if(!_[_0x4ee1('0x49')](this[_0x4ee1('0x9')][_0x184e36['transfertargetuniqueid']])){this[_0x4ee1('0x40')](_0x184e36[_0x4ee1('0x48')]);if(this[_0x4ee1('0x9')][_0x184e36['origtransfereruniqueid']]){this[_0x4ee1('0x9')][_0x184e36['origtransfereruniqueid']][_0x4ee1('0x24')]=!![];this['channels'][_0x184e36['transfereeuniqueid']]=this[_0x4ee1('0x9')][_0x184e36[_0x4ee1('0x4a')]];delete this[_0x4ee1('0x9')][_0x184e36[_0x4ee1('0x4a')]];}}}catch(_0x38e889){logger['error'](_0x4ee1('0x4b'),_0x38e889[_0x4ee1('0x33')]);}};Acw[_0x4ee1('0x18')]['syncBlindTransfer']=function(_0x368e82){try{if(this[_0x4ee1('0x9')][_0x368e82[_0x4ee1('0x4c')]]){logger[_0x4ee1('0x23')](_0x4ee1('0x4d'),JSON[_0x4ee1('0x38')](_0x368e82[_0x4ee1('0x4c')]));this[_0x4ee1('0x40')](_0x368e82[_0x4ee1('0x4c')]);}else if(this[_0x4ee1('0x9')][_0x368e82[_0x4ee1('0x4e')]]){logger[_0x4ee1('0x23')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x4ee1('0x38')](_0x368e82['transfererlinkedid']));this[_0x4ee1('0x40')](_0x368e82['transfererlinkedid']);}}catch(_0x15834b){logger[_0x4ee1('0x30')](_0x4ee1('0x4f'),_0x15834b[_0x4ee1('0x33')]);}};Acw[_0x4ee1('0x18')][_0x4ee1('0x10')]=function(_0x342aa1){try{if(this[_0x4ee1('0x6')][_0x342aa1[_0x4ee1('0x1a')]]&&this[_0x4ee1('0x6')][_0x342aa1[_0x4ee1('0x1a')]][_0x4ee1('0x50')]==='all'){if(this[_0x4ee1('0x7')][_0x342aa1[_0x4ee1('0x19')]]){logger[_0x4ee1('0x23')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x342aa1['uniqueid'],_0x342aa1[_0x4ee1('0x19')],_0x342aa1[_0x4ee1('0x1a')]);return RpcUser['savePause'](this[_0x4ee1('0x7')][_0x342aa1[_0x4ee1('0x19')]],_0x4ee1('0x51'),_0x342aa1[_0x4ee1('0x2c')]);}}}catch(_0x42240f){logger[_0x4ee1('0x30')](_0x4ee1('0x52'),_0x42240f[_0x4ee1('0x33')]);}};module[_0x4ee1('0x53')]=Acw; \ No newline at end of file +var _0xd0bb=['name','mandatoryDispositionPause','Action','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','prototype','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','acw','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','startAcw','queue','mandatoryDisposition'];(function(_0x264a1e,_0x1a89cc){var _0x1cfd63=function(_0x1e9307){while(--_0x1e9307){_0x264a1e['push'](_0x264a1e['shift']());}};_0x1cfd63(++_0x1a89cc);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x18e0d1,_0xbca4cb){_0x18e0d1=_0x18e0d1-0x0;var _0x58db41=_0xd0bb[_0x18e0d1];return _0x58db41;};'use strict';var util=require(_0xbd0b('0x0'));var _=require(_0xbd0b('0x1'));var moment=require(_0xbd0b('0x2'));var ami=require('../ami');var logger=require(_0xbd0b('0x3'))('acw');var RpcUser=require(_0xbd0b('0x4'));var RpcVoiceAgentReport=require(_0xbd0b('0x5'));function Acw(_0x53e6ce){this[_0xbd0b('0x6')]=_0x53e6ce['voiceQueues'];this[_0xbd0b('0x7')]=_0x53e6ce[_0xbd0b('0x7')];this[_0xbd0b('0x8')]=_0x53e6ce[_0xbd0b('0x8')];this[_0xbd0b('0x9')]={};ami['on']('agentconnect',this[_0xbd0b('0xa')][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0xc'),this[_0xbd0b('0xd')][_0xbd0b('0xb')](this));ami['on']('hangup',this['syncHangup'][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0xe'),this['syncAgentRingNoAnswer'][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0xf'),this['syncAttendedTransfer'][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0x10'),this[_0xbd0b('0x11')][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0x12'),this[_0xbd0b('0x13')][_0xbd0b('0xb')](this));}function getDiff(_0x1f25b6){var _0x1a55ab=moment()[_0xbd0b('0x14')](0x0);var _0x2d4664=moment(_0x1f25b6)['milliseconds'](0x0);return _0x1a55ab[_0xbd0b('0x15')](_0x2d4664,'seconds');}Acw['prototype'][_0xbd0b('0x16')]=function(_0x4c0e52){try{var _0x3183cf=this;var _0x40b075=this[_0xbd0b('0x9')][_0x4c0e52]['interface'];var _0x55e0a1=this[_0xbd0b('0x9')][_0x4c0e52][_0xbd0b('0x17')];var _0x1f2a6e=this[_0xbd0b('0x6')][_0x55e0a1];var _0x1c0a7c=![];var _0x40b798='ACW';if(_0x1f2a6e[_0xbd0b('0x18')]){if(_0x1f2a6e['mandatoryDispositionPause'][_0xbd0b('0x19')]){_0x1c0a7c=!![];_0x40b798=_0x1f2a6e[_0xbd0b('0x1a')][_0xbd0b('0x19')];}}ami[_0xbd0b('0x1b')]({'action':'QueuePause','interface':_0x40b075,'paused':!![],'reason':_0x40b798})[_0xbd0b('0x1c')](function(_0x38c27f){if(_0x3183cf[_0xbd0b('0x7')][_0x40b075]){return RpcUser['getAgent'](_0x3183cf[_0xbd0b('0x7')][_0x40b075]['id'])['then'](function(_0xc66b8){if(_0xc66b8&&!_0xc66b8[_0xbd0b('0x1d')]){logger[_0xbd0b('0x1e')](_0xbd0b('0x1f'),_0x4c0e52,_0x40b075,_0x55e0a1);var _0x297c85=_0x3183cf['channels'][_0x4c0e52][_0xbd0b('0x20')]&&_0x3183cf['channels'][_0x4c0e52][_0xbd0b('0x21')]?_0x3183cf[_0xbd0b('0x9')][_0x4c0e52][_0xbd0b('0x21')]:_0x4c0e52;return RpcUser[_0xbd0b('0x22')](_0x3183cf[_0xbd0b('0x7')][_0x40b075],_0x40b798,_0x297c85)[_0xbd0b('0x1c')](function(_0x4fe9ed){if(!_0x1c0a7c){_0x3183cf[_0xbd0b('0x8')][_0x40b075]={};logger[_0xbd0b('0x1e')](_0xbd0b('0x23'),_0x4c0e52,_0x3183cf[_0xbd0b('0x6')][_0x55e0a1][_0xbd0b('0x24')],_0x40b075,_0x55e0a1);_0x3183cf[_0xbd0b('0x8')][_0x40b075]['timer']=setTimeout(_0x3183cf[_0xbd0b('0x25')][_0xbd0b('0xb')](_0x3183cf,_0x40b075),_0x3183cf[_0xbd0b('0x6')][_0x55e0a1]['acwTimeout']*0x3e8);_0x3183cf['timers'][_0x40b075][_0xbd0b('0x26')]=moment()[_0xbd0b('0x27')](_0xbd0b('0x28'));_0x3183cf[_0xbd0b('0x8')][_0x40b075][_0xbd0b('0x29')]=_0x4c0e52;_0x3183cf[_0xbd0b('0x8')][_0x40b075][_0xbd0b('0x17')]=_0x55e0a1;_0x3183cf['timers'][_0x40b075][_0xbd0b('0x2a')]=function(){var _0x3b70b4=getDiff(_0x3183cf['timers'][_0x40b075]['lastPauseAt']);clearTimeout(_0x3183cf[_0xbd0b('0x8')][_0x40b075][_0xbd0b('0x2b')]);_0x3183cf['timers'][_0x40b075][_0xbd0b('0x2b')]=![];RpcVoiceAgentReport[_0xbd0b('0x2c')]({'acwtime':_0x3b70b4},_0x3183cf[_0xbd0b('0x8')][_0x40b075][_0xbd0b('0x29')],_0x40b075)[_0xbd0b('0x1c')](function(_0x27c478){logger['info'](_0xbd0b('0x2d'),_0x4c0e52,_0x3b70b4,_0x27c478);})[_0xbd0b('0x2e')](function(_0x32572e){logger[_0xbd0b('0x2f')](_0xbd0b('0x30'),_0x4c0e52,_0x32572e);});delete _0x3183cf[_0xbd0b('0x8')][_0x40b075];};}});}else{logger[_0xbd0b('0x1e')](_0xbd0b('0x31'),_0x4c0e52,_0x40b075,_0x55e0a1);}});}})[_0xbd0b('0x2e')](function(_0x3ac75f){logger[_0xbd0b('0x2f')](_0xbd0b('0x23'),_0x4c0e52,_0x3183cf[_0xbd0b('0x6')][_0x55e0a1][_0xbd0b('0x24')],_0x40b075,_0x55e0a1);})['finally'](function(){delete _0x3183cf[_0xbd0b('0x9')][_0x4c0e52];});}catch(_0x23b0fa){logger['error'](_0xbd0b('0x32'),_0x23b0fa[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0x25')]=function(_0x27ad8b){try{var _0x288715=this;if(_0x288715['timers'][_0x27ad8b]){_0x288715[_0xbd0b('0x8')][_0x27ad8b][_0xbd0b('0x2b')]=![];var _0x3b5098=_0x288715[_0xbd0b('0x8')][_0x27ad8b][_0xbd0b('0x29')];var _0x47c961=_0x288715['timers'][_0x27ad8b][_0xbd0b('0x17')];var _0x8db305=_0x288715[_0xbd0b('0x6')][_0x47c961][_0xbd0b('0x24')];logger['info']('[TIMER][STOP][AGENT:%s]',_0x27ad8b);RpcUser[_0xbd0b('0x35')](this['agents'][_0x27ad8b]);RpcVoiceAgentReport[_0xbd0b('0x2c')]({'acwtime':_0x8db305,'agentacw':!![]},_0x3b5098,_0x27ad8b)[_0xbd0b('0x1c')](function(_0x3f34dc){logger[_0xbd0b('0x1e')](_0xbd0b('0x2d'),_0x3b5098,_0x8db305,_0x3f34dc);})[_0xbd0b('0x2e')](function(_0x43115e){logger[_0xbd0b('0x2f')](_0xbd0b('0x30'),_0x3b5098,_0x43115e);});}else{logger[_0xbd0b('0x2f')](_0xbd0b('0x36'),_0x27ad8b);if(_0x288715[_0xbd0b('0x8')]){logger[_0xbd0b('0x1e')](_0xbd0b('0x37'),JSON[_0xbd0b('0x38')](_0x288715[_0xbd0b('0x8')]));}}}catch(_0x16c77c){logger[_0xbd0b('0x2f')]('[ACW][STOP]\x20%s',_0x16c77c[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0xa')]=function(_0x3f4d9b){try{if(this[_0xbd0b('0x6')][_0x3f4d9b[_0xbd0b('0x17')]]&&(this[_0xbd0b('0x6')][_0x3f4d9b[_0xbd0b('0x17')]][_0xbd0b('0x39')]||this[_0xbd0b('0x6')][_0x3f4d9b[_0xbd0b('0x17')]][_0xbd0b('0x18')])){if(this['agents'][_0x3f4d9b[_0xbd0b('0x3a')]]){this['channels'][_0x3f4d9b['uniqueid']]={'queue':_0x3f4d9b[_0xbd0b('0x17')],'interface':_0x3f4d9b[_0xbd0b('0x3a')],'destlinkedid':_0x3f4d9b[_0xbd0b('0x21')]};}}}catch(_0x580fa2){logger[_0xbd0b('0x2f')](_0xbd0b('0x3b'),_0x580fa2[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0x13')]=function(_0x4f1e3a){try{if(this[_0xbd0b('0x6')][_0x4f1e3a[_0xbd0b('0x17')]]&&(this[_0xbd0b('0x6')][_0x4f1e3a[_0xbd0b('0x17')]][_0xbd0b('0x39')]||this[_0xbd0b('0x6')][_0x4f1e3a['queue']][_0xbd0b('0x18')])){if(this[_0xbd0b('0x7')][_0x4f1e3a[_0xbd0b('0x3a')]]){this[_0xbd0b('0x9')][_0x4f1e3a[_0xbd0b('0x29')]]={'queue':_0x4f1e3a[_0xbd0b('0x17')],'interface':_0x4f1e3a[_0xbd0b('0x3a')]};}}}catch(_0x563c64){logger[_0xbd0b('0x2f')](_0xbd0b('0x3c'),_0x563c64[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0xd')]=function(_0x30f77e){try{if(this[_0xbd0b('0x9')][_0x30f77e[_0xbd0b('0x29')]]&&_[_0xbd0b('0x3d')](this[_0xbd0b('0x9')][_0x30f77e[_0xbd0b('0x29')]][_0xbd0b('0x20')])){logger[_0xbd0b('0x1e')](_0xbd0b('0x3e'),_0x30f77e[_0xbd0b('0x29')]);this['startAcw'](_0x30f77e[_0xbd0b('0x29')]);}else if(this[_0xbd0b('0x9')][_0x30f77e['linkedid']]&&_['isUndefined'](this['channels'][_0x30f77e[_0xbd0b('0x3f')]]['attended'])){logger[_0xbd0b('0x1e')](_0xbd0b('0x40'),_0x30f77e[_0xbd0b('0x3f')]);this[_0xbd0b('0x16')](_0x30f77e['linkedid']);}}catch(_0x2d2e58){logger['error'](_0xbd0b('0x41'),_0x2d2e58['message']);}};Acw['prototype'][_0xbd0b('0x42')]=function(_0x22f741){try{if(this[_0xbd0b('0x9')][_0x22f741[_0xbd0b('0x29')]]&&this[_0xbd0b('0x9')][_0x22f741[_0xbd0b('0x29')]][_0xbd0b('0x20')]){logger[_0xbd0b('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x22f741['uniqueid']);this[_0xbd0b('0x16')](_0x22f741[_0xbd0b('0x29')]);}else if(this['channels'][_0x22f741['linkedid']]&&this[_0xbd0b('0x9')][_0x22f741[_0xbd0b('0x3f')]][_0xbd0b('0x20')]){logger[_0xbd0b('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x22f741[_0xbd0b('0x3f')]);this[_0xbd0b('0x16')](_0x22f741[_0xbd0b('0x3f')]);}}catch(_0x183029){logger['error'](_0xbd0b('0x43'),_0x183029[_0xbd0b('0x33')]);}};Acw['prototype'][_0xbd0b('0x44')]=function(_0x1ea443){try{if(!_[_0xbd0b('0x45')](this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x46')]])){this[_0xbd0b('0x16')](_0x1ea443[_0xbd0b('0x46')]);if(this[_0xbd0b('0x9')][_0x1ea443['secondtransfereruniqueid']]){this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x47')]][_0xbd0b('0x20')]=!![];this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x48')]]=this[_0xbd0b('0x9')][_0x1ea443['secondtransfereruniqueid']];delete this['channels'][_0x1ea443[_0xbd0b('0x47')]];}}else if(!_[_0xbd0b('0x45')](this['channels'][_0x1ea443[_0xbd0b('0x48')]])){this[_0xbd0b('0x16')](_0x1ea443[_0xbd0b('0x48')]);if(this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x49')]]){this['channels'][_0x1ea443[_0xbd0b('0x49')]][_0xbd0b('0x20')]=!![];this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x46')]]=this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x49')]];delete this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x49')]];}}}catch(_0x429534){logger[_0xbd0b('0x2f')](_0xbd0b('0x4a'),_0x429534[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0x11')]=function(_0x164a2e){try{if(this[_0xbd0b('0x9')][_0x164a2e[_0xbd0b('0x4b')]]){logger['info'](_0xbd0b('0x4c'),JSON[_0xbd0b('0x38')](_0x164a2e[_0xbd0b('0x4b')]));this[_0xbd0b('0x16')](_0x164a2e['transfereruniqueid']);}else if(this['channels'][_0x164a2e[_0xbd0b('0x4d')]]){logger[_0xbd0b('0x1e')](_0xbd0b('0x4e'),JSON[_0xbd0b('0x38')](_0x164a2e[_0xbd0b('0x4d')]));this['startAcw'](_0x164a2e[_0xbd0b('0x4d')]);}}catch(_0x4d3664){logger[_0xbd0b('0x2f')](_0xbd0b('0x4f'),_0x4d3664[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0x50')]=function(_0x463db8){try{if(this['voiceQueues'][_0x463db8[_0xbd0b('0x17')]]&&this[_0xbd0b('0x6')][_0x463db8[_0xbd0b('0x17')]][_0xbd0b('0x51')]==='all'){if(this[_0xbd0b('0x7')][_0x463db8[_0xbd0b('0x3a')]]){logger[_0xbd0b('0x1e')](_0xbd0b('0x52'),_0x463db8[_0xbd0b('0x29')],_0x463db8['interface'],_0x463db8['queue']);return RpcUser[_0xbd0b('0x22')](this['agents'][_0x463db8[_0xbd0b('0x3a')]],_0xbd0b('0x53'),_0x463db8[_0xbd0b('0x29')]);}}}catch(_0x1876ae){logger[_0xbd0b('0x2f')](_0xbd0b('0x54'),_0x1876ae['message']);}};module[_0xbd0b('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index da175c7..20660fd 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5567=['then','actionQueueSummary','actionCoreShowChannels','catch','log','close','exports','asterisk-manager','moment','util','lodash','ami','../../config/environment','asterisk','username','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve'];(function(_0x182b41,_0x3710ca){var _0x39e4dc=function(_0x9bf120){while(--_0x9bf120){_0x182b41['push'](_0x182b41['shift']());}};_0x39e4dc(++_0x3710ca);}(_0x5567,0x11f));var _0x7556=function(_0x2c2038,_0x45c698){_0x2c2038=_0x2c2038-0x0;var _0x1af940=_0x5567[_0x2c2038];return _0x1af940;};'use strict';var Manager=require(_0x7556('0x0'));var BPromise=require('bluebird');var moment=require(_0x7556('0x1'));var util=require(_0x7556('0x2'));var _=require(_0x7556('0x3'));var logger=require('../../config/logger')(_0x7556('0x4'));var config=require(_0x7556('0x5'));var ami=new Manager(config['asterisk']['port'],config[_0x7556('0x6')]['ip'],config[_0x7556('0x6')][_0x7556('0x7')],config['asterisk'][_0x7556('0x8')],!![]);ami[_0x7556('0x9')]();ami[_0x7556('0xa')]=BPromise[_0x7556('0xb')](ami[_0x7556('0xc')]);function error(_0x311875){logger[_0x7556('0xd')](util[_0x7556('0xe')](_0x7556('0xf'),config[_0x7556('0x6')][_0x7556('0x7')],config[_0x7556('0x6')]['ip'],config[_0x7556('0x6')][_0x7556('0x10')],util[_0x7556('0x11')](_0x311875,![],null)));}function close(){logger[_0x7556('0xd')](util[_0x7556('0xe')](_0x7556('0x12'),config[_0x7556('0x6')][_0x7556('0x7')],config['asterisk']['ip'],config[_0x7556('0x6')]['port']));}ami[_0x7556('0x13')]=function(){return function(){return ami[_0x7556('0xa')]({'action':_0x7556('0x14')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7556('0xa')]({'action':_0x7556('0x15')});};};ami[_0x7556('0x16')]=function(){return function(){return ami[_0x7556('0xa')]({'action':_0x7556('0x17')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x7556('0xa')]({'action':_0x7556('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x7556('0xa')]({'action':_0x7556('0x19')});};};function connect(_0x2071ff){logger['info'](util[_0x7556('0xe')](_0x7556('0x1a'),config['asterisk'][_0x7556('0x7')],config[_0x7556('0x6')]['ip'],config[_0x7556('0x6')][_0x7556('0x10')]));ami[_0x7556('0x1b')](_0x7556('0xd'),error);ami[_0x7556('0x1b')]('close',close);}ami['on'](_0x7556('0x1c'),connect);ami['on']('shutdown',function(_0x4a45d5){logger[_0x7556('0x1d')](util[_0x7556('0xe')](_0x7556('0x1e'),config[_0x7556('0x6')][_0x7556('0x7')],config[_0x7556('0x6')]['ip'],config[_0x7556('0x6')][_0x7556('0x10')],util[_0x7556('0x11')](_0x4a45d5,![],null)));});ami['on']('fullybooted',function(_0x4f1032){logger['info'](util[_0x7556('0xe')](_0x7556('0x1f'),config[_0x7556('0x6')][_0x7556('0x7')],config[_0x7556('0x6')]['ip'],config['asterisk']['port']));return BPromise[_0x7556('0x20')]()[_0x7556('0x21')](ami[_0x7556('0x13')]())['then'](ami['actionDeviceStateList']())[_0x7556('0x21')](ami[_0x7556('0x16')]())[_0x7556('0x21')](ami[_0x7556('0x22')]())[_0x7556('0x21')](ami[_0x7556('0x23')]())[_0x7556('0x24')](function(_0x561abb){console[_0x7556('0x25')](_0x561abb);});});ami[_0x7556('0x1b')](_0x7556('0xd'),error);ami['once'](_0x7556('0x26'),close);module[_0x7556('0x27')]=ami; \ No newline at end of file +var _0xeb66=['Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','devicestatelist','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','once','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','actionSipPeerStatus','catch','exports','asterisk-manager','bluebird','util','lodash','ami','../../config/environment','asterisk','username','Action','action','format','port','inspect','error'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0xeb66,0x1c0));var _0x6eb6=function(_0x2bcf65,_0x56d3c3){_0x2bcf65=_0x2bcf65-0x0;var _0x2f820b=_0xeb66[_0x2bcf65];return _0x2f820b;};'use strict';var Manager=require(_0x6eb6('0x0'));var BPromise=require(_0x6eb6('0x1'));var moment=require('moment');var util=require(_0x6eb6('0x2'));var _=require(_0x6eb6('0x3'));var logger=require('../../config/logger')(_0x6eb6('0x4'));var config=require(_0x6eb6('0x5'));var ami=new Manager(config[_0x6eb6('0x6')]['port'],config[_0x6eb6('0x6')]['ip'],config[_0x6eb6('0x6')][_0x6eb6('0x7')],config[_0x6eb6('0x6')]['password'],!![]);ami['keepConnected']();ami[_0x6eb6('0x8')]=BPromise['promisify'](ami[_0x6eb6('0x9')]);function error(_0x24ea01){logger['error'](util[_0x6eb6('0xa')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x6eb6('0x6')][_0x6eb6('0x7')],config[_0x6eb6('0x6')]['ip'],config[_0x6eb6('0x6')][_0x6eb6('0xb')],util[_0x6eb6('0xc')](_0x24ea01,![],null)));}function close(){logger[_0x6eb6('0xd')](util[_0x6eb6('0xa')](_0x6eb6('0xe'),config[_0x6eb6('0x6')][_0x6eb6('0x7')],config[_0x6eb6('0x6')]['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x6eb6('0x8')]({'action':_0x6eb6('0xf')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x6eb6('0x8')]({'action':_0x6eb6('0x10')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x6eb6('0x8')]({'action':_0x6eb6('0x11')});};};ami[_0x6eb6('0x12')]=function(){return function(){return ami[_0x6eb6('0x8')]({'action':'queuesummary'});};};ami[_0x6eb6('0x13')]=function(){return function(){return ami[_0x6eb6('0x8')]({'action':_0x6eb6('0x14')});};};function connect(_0x20834f){logger['info'](util[_0x6eb6('0xa')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x6eb6('0x6')][_0x6eb6('0x7')],config['asterisk']['ip'],config['asterisk']['port']));ami['once'](_0x6eb6('0xd'),error);ami[_0x6eb6('0x15')]('close',close);}ami['on']('connect',connect);ami['on'](_0x6eb6('0x16'),function(_0x5e7b85){logger[_0x6eb6('0x17')](util['format'](_0x6eb6('0x18'),config['asterisk'][_0x6eb6('0x7')],config[_0x6eb6('0x6')]['ip'],config['asterisk'][_0x6eb6('0xb')],util['inspect'](_0x5e7b85,![],null)));});ami['on'](_0x6eb6('0x19'),function(_0x589655){logger[_0x6eb6('0x17')](util[_0x6eb6('0xa')](_0x6eb6('0x1a'),config[_0x6eb6('0x6')][_0x6eb6('0x7')],config['asterisk']['ip'],config[_0x6eb6('0x6')]['port']));return BPromise[_0x6eb6('0x1b')]()[_0x6eb6('0x1c')](ami['actionSipShowRegistry']())[_0x6eb6('0x1c')](ami[_0x6eb6('0x1d')]())['then'](ami[_0x6eb6('0x1e')]())[_0x6eb6('0x1c')](ami[_0x6eb6('0x12')]())[_0x6eb6('0x1c')](ami[_0x6eb6('0x13')]())[_0x6eb6('0x1f')](function(_0x2c86ca){console['log'](_0x2c86ca);});});ami[_0x6eb6('0x15')](_0x6eb6('0xd'),error);ami[_0x6eb6('0x15')]('close',close);module[_0x6eb6('0x20')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 6dbfaf7..6c0b7fc 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc94a=['request','then','debug','memberReport','error','rpc','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','http','Request'];(function(_0x5cbd7b,_0x207439){var _0x3fdfb8=function(_0x4eb12e){while(--_0x4eb12e){_0x5cbd7b['push'](_0x5cbd7b['shift']());}};_0x3fdfb8(++_0x207439);}(_0xc94a,0xfa));var _0xac94=function(_0x6c8e60,_0x455519){_0x6c8e60=_0x6c8e60-0x0;var _0x36f56c=_0xc94a[_0x6c8e60];return _0x36f56c;};'use strict';var jayson=require(_0xac94('0x0'));var BPromise=require(_0xac94('0x1'));var logger=require(_0xac94('0x2'))('ami');var client=jayson['client'][_0xac94('0x3')]({'port':0x2329});client[_0xac94('0x4')]=function(_0x316077,_0x17fba0){return new BPromise(function(_0xbfb2c2,_0x5a4849){return client[_0xac94('0x5')](_0x316077,_0x17fba0)[_0xac94('0x6')](function(_0x1dd8d3){logger[_0xac94('0x7')]('rpc',_0xac94('0x8'),_0x316077,_0x17fba0,_0x1dd8d3);if(_0x1dd8d3[_0xac94('0x9')]){logger[_0xac94('0x9')](_0xac94('0xa'),_0xac94('0x8'),_0x316077,_0x1dd8d3[_0xac94('0x9')]['message'],_0x17fba0);return _0x5a4849(_0x1dd8d3[_0xac94('0x9')][_0xac94('0xb')]);}else{return _0xbfb2c2(_0x1dd8d3[_0xac94('0xc')]);}})[_0xac94('0xd')](function(_0x4c7b75){logger[_0xac94('0x9')](_0xac94('0xa'),_0xac94('0x8'),_0x316077,_0x4c7b75,_0x17fba0);return _0x5a4849(_0x4c7b75);});});};module[_0xac94('0xe')]=client; \ No newline at end of file +var _0x493d=['request','then','rpc','memberReport','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','ami','client','http','Request'];(function(_0x38d392,_0x95f89e){var _0x2b9557=function(_0x12567d){while(--_0x12567d){_0x38d392['push'](_0x38d392['shift']());}};_0x2b9557(++_0x95f89e);}(_0x493d,0x139));var _0xd493=function(_0xe71cf6,_0x120a90){_0xe71cf6=_0xe71cf6-0x0;var _0x1ffd42=_0x493d[_0xe71cf6];return _0x1ffd42;};'use strict';var jayson=require(_0xd493('0x0'));var BPromise=require(_0xd493('0x1'));var logger=require(_0xd493('0x2'))(_0xd493('0x3'));var client=jayson[_0xd493('0x4')][_0xd493('0x5')]({'port':0x2329});client[_0xd493('0x6')]=function(_0x162901,_0xb483c){return new BPromise(function(_0x5d8622,_0x3aed18){return client[_0xd493('0x7')](_0x162901,_0xb483c)[_0xd493('0x8')](function(_0x9f57fb){logger['debug'](_0xd493('0x9'),_0xd493('0xa'),_0x162901,_0xb483c,_0x9f57fb);if(_0x9f57fb[_0xd493('0xb')]){logger[_0xd493('0xb')](_0xd493('0x9'),_0xd493('0xa'),_0x162901,_0x9f57fb[_0xd493('0xb')]['message'],_0xb483c);return _0x3aed18(_0x9f57fb[_0xd493('0xb')][_0xd493('0xc')]);}else{return _0x5d8622(_0x9f57fb[_0xd493('0xd')]);}})[_0xd493('0xe')](function(_0x307129){logger['error'](_0xd493('0x9'),_0xd493('0xa'),_0x162901,_0x307129,_0xb483c);return _0x3aed18(_0x307129);});});};module[_0xd493('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index c9a5e71..de3a0e8 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e7=['idHopper','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','exports','util','lodash','moment','isNil','string','uniqueid','Contact','phone','firstName','lastName','queue','name','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x53f125,_0x4ba12e){var _0x209b38=function(_0x67892c){while(--_0x67892c){_0x53f125['push'](_0x53f125['shift']());}};_0x209b38(++_0x4ba12e);}(_0xa9e7,0xfa));var _0x7a9e=function(_0x5786e8,_0x1fbe88){_0x5786e8=_0x5786e8-0x0;var _0x11b244=_0xa9e7[_0x5786e8];return _0x11b244;};'use strict';var util=require(_0x7a9e('0x0'));var _=require(_0x7a9e('0x1'));var moment=require(_0x7a9e('0x2'));function checkNameSurname(_0x4e1b2a,_0x4f503d,_0x51cce7){var _0x3f6b27='';if(!_[_0x7a9e('0x3')](_0x4f503d)&&_0x7a9e('0x4')===typeof _0x4f503d){_0x3f6b27+=_0x4f503d;}if(!_[_0x7a9e('0x3')](_0x51cce7)&&_0x7a9e('0x4')===typeof _0x51cce7){_0x3f6b27+='\x20'+_0x51cce7;}if(_0x3f6b27!==''){return _0x3f6b27;}return _0x4e1b2a;}function Action(_0x252974,_0x2cf173,_0x2c91e1){this['voiceQueue']=_0x252974;this[_0x7a9e('0x5')]=_0x2c91e1||undefined;this['name']=checkNameSurname(_0x2cf173[_0x7a9e('0x6')][_0x7a9e('0x7')],_0x2cf173['Contact'][_0x7a9e('0x8')],_0x2cf173[_0x7a9e('0x6')][_0x7a9e('0x9')]);this['number']=_0x2cf173[_0x7a9e('0x6')][_0x7a9e('0x7')];this[_0x7a9e('0xa')]=_0x252974[_0x7a9e('0xb')];this['active']=_0x2cf173['active']||![];this[_0x7a9e('0xc')]=_0x252974['type'];this['dialQueueTimeout']=_0x252974[_0x7a9e('0xd')]||0x3;this['scheduledat']=_0x2cf173[_0x7a9e('0xe')];this[_0x7a9e('0xf')]=_0x2cf173[_0x7a9e('0xf')];this[_0x7a9e('0x10')]=_0x2cf173[_0x7a9e('0x10')];this[_0x7a9e('0x11')]=_0x2cf173[_0x7a9e('0x11')];this[_0x7a9e('0x12')]=_0x2cf173[_0x7a9e('0x12')];this[_0x7a9e('0x13')]=_0x2cf173[_0x7a9e('0x13')];this[_0x7a9e('0x14')]=_0x2cf173[_0x7a9e('0x14')];this[_0x7a9e('0x15')]=_0x2cf173[_0x7a9e('0x15')];this['CampaignId']=_0x2cf173[_0x7a9e('0x16')];this[_0x7a9e('0x17')]=_0x2cf173['id'];this['ContactFirstName']=_0x2cf173[_0x7a9e('0x6')][_0x7a9e('0x8')]||'';this[_0x7a9e('0x18')]=moment()['format'](_0x7a9e('0x19'));this[_0x7a9e('0x1a')]=_0x2cf173['callback'];this[_0x7a9e('0x1b')]=_0x2cf173[_0x7a9e('0x1b')];this[_0x7a9e('0x1c')]=_0x2cf173['callbackat'];this[_0x7a9e('0x1d')]=_0x2cf173[_0x7a9e('0x1d')];this[_0x7a9e('0x1e')]='';this[_0x7a9e('0x1f')]='';}Action[_0x7a9e('0x20')][_0x7a9e('0x21')]=function(){return util[_0x7a9e('0x22')](_0x7a9e('0x23'),this[_0x7a9e('0xb')],this['voiceQueue'][_0x7a9e('0x24')]>0x0?this['number'][_0x7a9e('0x25')](this['voiceQueue']['dialCutDigit']):this['number']);};Action[_0x7a9e('0x20')]['getQueue']=function(){return this[_0x7a9e('0xa')];};module[_0x7a9e('0x26')]=Action; \ No newline at end of file +var _0x41fe=['YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','prototype','getQueue','queue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','firstName','starttime','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41fe,0xd1));var _0xe41f=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x41fe[_0xd7b0a4];return _0x184e9e;};'use strict';var util=require(_0xe41f('0x0'));var _=require(_0xe41f('0x1'));var moment=require(_0xe41f('0x2'));function checkNameSurname(_0x2c527f,_0x850827,_0x26d278){var _0x3afc14='';if(!_[_0xe41f('0x3')](_0x850827)&&_0xe41f('0x4')===typeof _0x850827){_0x3afc14+=_0x850827;}if(!_[_0xe41f('0x3')](_0x26d278)&&_0xe41f('0x4')===typeof _0x26d278){_0x3afc14+='\x20'+_0x26d278;}if(_0x3afc14!==''){return _0x3afc14;}return _0x2c527f;}function Action(_0x1e8e93,_0xd3c763,_0x370385){this[_0xe41f('0x5')]=_0x1e8e93;this[_0xe41f('0x6')]=_0x370385||undefined;this[_0xe41f('0x7')]=checkNameSurname(_0xd3c763['Contact'][_0xe41f('0x8')],_0xd3c763[_0xe41f('0x9')]['firstName'],_0xd3c763[_0xe41f('0x9')]['lastName']);this['number']=_0xd3c763['Contact'][_0xe41f('0x8')];this['queue']=_0x1e8e93['name'];this['active']=_0xd3c763[_0xe41f('0xa')]||![];this[_0xe41f('0xb')]=_0x1e8e93[_0xe41f('0xb')];this[_0xe41f('0xc')]=_0x1e8e93[_0xe41f('0xc')]||0x3;this[_0xe41f('0xd')]=_0xd3c763[_0xe41f('0xd')];this[_0xe41f('0xe')]=_0xd3c763[_0xe41f('0xe')];this[_0xe41f('0xf')]=_0xd3c763['countcongestionretry'];this[_0xe41f('0x10')]=_0xd3c763[_0xe41f('0x10')];this['ContactId']=_0xd3c763[_0xe41f('0x11')];this[_0xe41f('0x12')]=_0xd3c763[_0xe41f('0x12')];this[_0xe41f('0x13')]=_0xd3c763[_0xe41f('0x13')];this[_0xe41f('0x14')]=_0xd3c763[_0xe41f('0x14')];this['CampaignId']=_0xd3c763['CampaignId'];this[_0xe41f('0x15')]=_0xd3c763['id'];this['ContactFirstName']=_0xd3c763['Contact'][_0xe41f('0x16')]||'';this[_0xe41f('0x17')]=moment()[_0xe41f('0x18')](_0xe41f('0x19'));this[_0xe41f('0x1a')]=_0xd3c763['callback'];this[_0xe41f('0x1b')]=_0xd3c763['callbackuniqueid'];this[_0xe41f('0x1c')]=_0xd3c763[_0xe41f('0x1c')];this['recallme']=_0xd3c763[_0xe41f('0x1d')];this[_0xe41f('0x1e')]='';this[_0xe41f('0x1f')]='';}Action['prototype'][_0xe41f('0x20')]=function(){return util[_0xe41f('0x18')](_0xe41f('0x21'),this[_0xe41f('0x7')],this[_0xe41f('0x5')][_0xe41f('0x22')]>0x0?this[_0xe41f('0x23')]['substring'](this[_0xe41f('0x5')]['dialCutDigit']):this['number']);};Action[_0xe41f('0x24')][_0xe41f('0x25')]=function(){return this[_0xe41f('0x26')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index c3c200a..8fcedbc 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45ea=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat'];(function(_0x2fe689,_0x5794e5){var _0x35ea44=function(_0x51b9d6){while(--_0x51b9d6){_0x2fe689['push'](_0x2fe689['shift']());}};_0x35ea44(++_0x5794e5);}(_0x45ea,0x81));var _0xa45e=function(_0x3b28b7,_0x5a31da){_0x3b28b7=_0x3b28b7-0x0;var _0x469e49=_0x45ea[_0x3b28b7];return _0x469e49;};'use strict';var util=require(_0xa45e('0x0'));var _=require('lodash');var moment=require(_0xa45e('0x1'));function getSeconds(_0xbe3a4e,_0x321a2a){var _0x1e888d=moment(_0xbe3a4e)[_0xa45e('0x2')](0x0);var _0x3bbb65=moment(_0x321a2a)[_0xa45e('0x2')](0x0);return _0x1e888d[_0xa45e('0x3')](_0x3bbb65,_0xa45e('0x4'));}function AgentComplete(_0x12487b,_0x43c26a){this['state']=0x4;this['statedesc']=_0xa45e('0x5');this[_0xa45e('0x6')]=_0x12487b[_0xa45e('0x6')];this['type']=_0x12487b[_0xa45e('0x7')];this[_0xa45e('0x8')]=_0x12487b[_0xa45e('0x7')]==='outbound'?'queue':_0x12487b[_0xa45e('0x7')];this[_0xa45e('0x9')]=_0x12487b[_0xa45e('0x9')];this[_0xa45e('0xa')]=_0x12487b[_0xa45e('0xa')];this[_0xa45e('0xb')]=_0x12487b[_0xa45e('0xb')];this[_0xa45e('0xc')]=_0x12487b[_0xa45e('0x9')]+_0x12487b['countcongestionretry']+_0x12487b[_0xa45e('0xb')];this['uniqueid']=_0x43c26a[_0xa45e('0xd')];this[_0xa45e('0xe')]=_0x12487b[_0xa45e('0xf')];this[_0xa45e('0x10')]=_0x12487b[_0xa45e('0x11')];this['starttime']=_0x12487b[_0xa45e('0x12')];this[_0xa45e('0x13')]=_0x12487b['responsetime'];this[_0xa45e('0x14')]=_0x12487b[_0xa45e('0x14')];this[_0xa45e('0x15')]=moment()['format'](_0xa45e('0x16'));this['ringtime']=getSeconds(_0x12487b[_0xa45e('0x13')],_0x12487b[_0xa45e('0x12')]);this[_0xa45e('0x17')]=getSeconds(_0x12487b[_0xa45e('0x14')],_0x12487b[_0xa45e('0x13')]);this[_0xa45e('0x18')]=getSeconds(this[_0xa45e('0x15')],_0x12487b['answertime']);this[_0xa45e('0x19')]=_0x43c26a[_0xa45e('0x19')];this[_0xa45e('0x1a')]=_0x43c26a['membername'];this[_0xa45e('0x1b')]=_0x43c26a[_0xa45e('0x1b')];this[_0xa45e('0x1c')]=_0x12487b[_0xa45e('0x1c')];this[_0xa45e('0x1d')]=_0x12487b[_0xa45e('0x1d')];this[_0xa45e('0x1e')]=_0x12487b[_0xa45e('0x1e')];this[_0xa45e('0x1f')]=_0x12487b[_0xa45e('0x1f')];this[_0xa45e('0x20')]=_0x12487b[_0xa45e('0x20')];this[_0xa45e('0x21')]=_0x12487b[_0xa45e('0x21')];this[_0xa45e('0x22')]=_0x12487b[_0xa45e('0x22')];this[_0xa45e('0x23')]=_0x12487b[_0xa45e('0x23')];this['CampaignId']=_0x12487b[_0xa45e('0x24')];this[_0xa45e('0x25')]=_0x12487b[_0xa45e('0x25')]||'';this[_0xa45e('0x26')]=_0x12487b[_0xa45e('0x26')]||'';}module[_0xa45e('0x27')]=AgentComplete; \ No newline at end of file +var _0xcc83=['diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xcc83,0x145));var _0x3cc8=function(_0x40e54,_0x52151d){_0x40e54=_0x40e54-0x0;var _0x4ab7df=_0xcc83[_0x40e54];return _0x4ab7df;};'use strict';var util=require(_0x3cc8('0x0'));var _=require('lodash');var moment=require(_0x3cc8('0x1'));function getSeconds(_0x2b73fa,_0x2f8c3e){var _0x30e11e=moment(_0x2b73fa)[_0x3cc8('0x2')](0x0);var _0x357a7e=moment(_0x2f8c3e)['milliseconds'](0x0);return _0x30e11e[_0x3cc8('0x3')](_0x357a7e,'seconds');}function AgentComplete(_0x148e76,_0x5143d6){this[_0x3cc8('0x4')]=0x4;this[_0x3cc8('0x5')]=_0x3cc8('0x6');this[_0x3cc8('0x7')]=_0x148e76[_0x3cc8('0x7')];this['type']=_0x148e76[_0x3cc8('0x8')];this[_0x3cc8('0x9')]=_0x148e76['type']===_0x3cc8('0xa')?'queue':_0x148e76[_0x3cc8('0x8')];this[_0x3cc8('0xb')]=_0x148e76[_0x3cc8('0xb')];this['countcongestionretry']=_0x148e76[_0x3cc8('0xc')];this[_0x3cc8('0xd')]=_0x148e76[_0x3cc8('0xd')];this[_0x3cc8('0xe')]=_0x148e76[_0x3cc8('0xb')]+_0x148e76[_0x3cc8('0xc')]+_0x148e76['countnoanswerretry'];this[_0x3cc8('0xf')]=_0x5143d6['uniqueid'];this[_0x3cc8('0x10')]=_0x148e76['name'];this['calleridnum']=_0x148e76[_0x3cc8('0x11')];this[_0x3cc8('0x12')]=_0x148e76[_0x3cc8('0x12')];this['responsetime']=_0x148e76[_0x3cc8('0x13')];this[_0x3cc8('0x14')]=_0x148e76[_0x3cc8('0x14')];this[_0x3cc8('0x15')]=moment()[_0x3cc8('0x16')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x3cc8('0x17')]=getSeconds(_0x148e76[_0x3cc8('0x13')],_0x148e76['starttime']);this[_0x3cc8('0x18')]=getSeconds(_0x148e76['answertime'],_0x148e76[_0x3cc8('0x13')]);this[_0x3cc8('0x19')]=getSeconds(this[_0x3cc8('0x15')],_0x148e76[_0x3cc8('0x14')]);this[_0x3cc8('0x1a')]=_0x5143d6[_0x3cc8('0x1a')];this[_0x3cc8('0x1b')]=_0x5143d6[_0x3cc8('0x1b')];this[_0x3cc8('0x1c')]=_0x5143d6[_0x3cc8('0x1c')];this[_0x3cc8('0x1d')]=_0x148e76[_0x3cc8('0x1d')];this[_0x3cc8('0x1e')]=_0x148e76[_0x3cc8('0x1e')];this[_0x3cc8('0x1f')]=_0x148e76[_0x3cc8('0x1f')];this[_0x3cc8('0x20')]=_0x148e76['recallme'];this[_0x3cc8('0x21')]=_0x148e76[_0x3cc8('0x21')];this[_0x3cc8('0x22')]=_0x148e76[_0x3cc8('0x22')];this[_0x3cc8('0x23')]=_0x148e76[_0x3cc8('0x23')];this['VoiceQueueId']=_0x148e76[_0x3cc8('0x24')];this['CampaignId']=_0x148e76[_0x3cc8('0x25')];this[_0x3cc8('0x26')]=_0x148e76['originatecalleridnum']||'';this[_0x3cc8('0x27')]=_0x148e76[_0x3cc8('0x27')]||'';}module[_0x3cc8('0x28')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 4bd4d3b..fcf5f41 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa24d=['responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','starttime'];(function(_0x5ca5bc,_0x5b8a9d){var _0x26ca86=function(_0x1ad9a6){while(--_0x1ad9a6){_0x5ca5bc['push'](_0x5ca5bc['shift']());}};_0x26ca86(++_0x5b8a9d);}(_0xa24d,0x1c1));var _0xda24=function(_0x13cf7a,_0x479809){_0x13cf7a=_0x13cf7a-0x0;var _0x5cb678=_0xa24d[_0x13cf7a];return _0x5cb678;};'use strict';var util=require(_0xda24('0x0'));var _=require(_0xda24('0x1'));var moment=require(_0xda24('0x2'));function getSeconds(_0x4432eb,_0x3fdf1c){var _0x47425f=moment(_0x4432eb)[_0xda24('0x3')](0x0);var _0x501b16=moment(_0x3fdf1c)[_0xda24('0x3')](0x0);return _0x47425f[_0xda24('0x4')](_0x501b16,_0xda24('0x5'));}function Final(_0x1496f7){this['uniqueid']=_0x1496f7[_0xda24('0x6')];this[_0xda24('0x7')]=_0x1496f7['scheduledat'];this[_0xda24('0x8')]=_0x1496f7['type'];this[_0xda24('0x9')]=_0x1496f7[_0xda24('0x8')]===_0xda24('0xa')?_0xda24('0xb'):_0x1496f7['type'];this[_0xda24('0xc')]=_0x1496f7[_0xda24('0xc')];this[_0xda24('0xd')]=_0x1496f7[_0xda24('0xd')];this[_0xda24('0xe')]=_0x1496f7['countnoanswerretry'];this[_0xda24('0xf')]=_0x1496f7['countbusyretry']+_0x1496f7[_0xda24('0xd')]+_0x1496f7[_0xda24('0xe')];this['queue']=_0x1496f7['queue'];this[_0xda24('0x10')]=_0x1496f7[_0xda24('0x10')];this[_0xda24('0x11')]=_0x1496f7[_0xda24('0x11')];this['starttime']=_0x1496f7[_0xda24('0x12')];this['responsetime']=_0x1496f7[_0xda24('0x13')];this[_0xda24('0x14')]=_0x1496f7['responsetime'];this['ringtime']=_0x1496f7[_0xda24('0x15')]||0x0;this[_0xda24('0x16')]=_0x1496f7[_0xda24('0x16')]||0x0;this[_0xda24('0x17')]=_0x1496f7[_0xda24('0x17')]||0x0;this[_0xda24('0x18')]=_0x1496f7[_0xda24('0x18')];this[_0xda24('0x19')]=_0x1496f7[_0xda24('0x19')];this['callbackat']=_0x1496f7[_0xda24('0x1a')];this[_0xda24('0x1b')]=_0x1496f7['recallme'];this[_0xda24('0x1c')]=_0x1496f7['ContactId'];this['ListId']=_0x1496f7[_0xda24('0x1d')];this[_0xda24('0x1e')]=_0x1496f7[_0xda24('0x1e')];this[_0xda24('0x1f')]=_0x1496f7[_0xda24('0x1f')];this[_0xda24('0x20')]=_0x1496f7[_0xda24('0x20')];this['originatecalleridnum']=_0x1496f7[_0xda24('0x21')]||'';this['originatecalleridname']=_0x1496f7[_0xda24('0x22')]||'';}module[_0xda24('0x23')]=Final; \ No newline at end of file +var _0xaaee=['responsetime','endtime','ringtime','holdtime','talktime','callback','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','starttime'];(function(_0x7d993e,_0x347e1c){var _0x3cb4f4=function(_0x40f304){while(--_0x40f304){_0x7d993e['push'](_0x7d993e['shift']());}};_0x3cb4f4(++_0x347e1c);}(_0xaaee,0xa9));var _0xeaae=function(_0x26e7ef,_0x551da0){_0x26e7ef=_0x26e7ef-0x0;var _0x37e596=_0xaaee[_0x26e7ef];return _0x37e596;};'use strict';var util=require(_0xeaae('0x0'));var _=require('lodash');var moment=require(_0xeaae('0x1'));function getSeconds(_0x16f36e,_0x593810){var _0x144086=moment(_0x16f36e)[_0xeaae('0x2')](0x0);var _0xf24a0=moment(_0x593810)[_0xeaae('0x2')](0x0);return _0x144086['diff'](_0xf24a0,_0xeaae('0x3'));}function Final(_0xee1d1f){this[_0xeaae('0x4')]=_0xee1d1f[_0xeaae('0x4')];this[_0xeaae('0x5')]=_0xee1d1f[_0xeaae('0x5')];this['type']=_0xee1d1f[_0xeaae('0x6')];this[_0xeaae('0x7')]=_0xee1d1f[_0xeaae('0x6')]===_0xeaae('0x8')?_0xeaae('0x9'):_0xee1d1f[_0xeaae('0x6')];this[_0xeaae('0xa')]=_0xee1d1f[_0xeaae('0xa')];this[_0xeaae('0xb')]=_0xee1d1f['countcongestionretry'];this[_0xeaae('0xc')]=_0xee1d1f[_0xeaae('0xc')];this[_0xeaae('0xd')]=_0xee1d1f['countbusyretry']+_0xee1d1f['countcongestionretry']+_0xee1d1f[_0xeaae('0xc')];this[_0xeaae('0x9')]=_0xee1d1f[_0xeaae('0x9')];this['calleridname']=_0xee1d1f[_0xeaae('0xe')];this[_0xeaae('0xf')]=_0xee1d1f[_0xeaae('0xf')];this[_0xeaae('0x10')]=_0xee1d1f['starttime'];this['responsetime']=_0xee1d1f[_0xeaae('0x11')];this[_0xeaae('0x12')]=_0xee1d1f[_0xeaae('0x11')];this[_0xeaae('0x13')]=_0xee1d1f['ringtime']||0x0;this[_0xeaae('0x14')]=_0xee1d1f['holdtime']||0x0;this[_0xeaae('0x15')]=_0xee1d1f[_0xeaae('0x15')]||0x0;this[_0xeaae('0x16')]=_0xee1d1f[_0xeaae('0x16')];this['callbackuniqueid']=_0xee1d1f['callbackuniqueid'];this['callbackat']=_0xee1d1f['callbackat'];this[_0xeaae('0x17')]=_0xee1d1f[_0xeaae('0x17')];this['ContactId']=_0xee1d1f[_0xeaae('0x18')];this['ListId']=_0xee1d1f[_0xeaae('0x19')];this[_0xeaae('0x1a')]=_0xee1d1f[_0xeaae('0x1a')];this['VoiceQueueId']=_0xee1d1f[_0xeaae('0x1b')];this[_0xeaae('0x1c')]=_0xee1d1f['CampaignId'];this['originatecalleridnum']=_0xee1d1f[_0xeaae('0x1d')]||'';this['originatecalleridname']=_0xee1d1f['originatecalleridname']||'';}module[_0xeaae('0x1e')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index b56b6ce..e74d341 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x305c93,_0x3421dc){var _0x5bae39=function(_0x59ff63){while(--_0x59ff63){_0x305c93['push'](_0x305c93['shift']());}};_0x5bae39(++_0x3421dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file +var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x51c9f9,_0x281a0c){var _0x2363f5=function(_0x3ab54e){while(--_0x3ab54e){_0x51c9f9['push'](_0x51c9f9['shift']());}};_0x2363f5(++_0x281a0c);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 2383f41..ecd7bd8 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2659=['calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','name'];(function(_0x48fcee,_0x431a8b){var _0x28d65a=function(_0x28b4ad){while(--_0x28b4ad){_0x48fcee['push'](_0x48fcee['shift']());}};_0x28d65a(++_0x431a8b);}(_0x2659,0xa4));var _0x9265=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x2659[_0x18a436];return _0x5c2cf8;};'use strict';var util=require(_0x9265('0x0'));var _=require(_0x9265('0x1'));var moment=require(_0x9265('0x2'));function getSeconds(_0x40a91b,_0x44bcdc){var _0x561881=moment(_0x40a91b)[_0x9265('0x3')](0x0);var _0x3b2721=moment(_0x44bcdc)[_0x9265('0x3')](0x0);return _0x561881[_0x9265('0x4')](_0x3b2721,_0x9265('0x5'));}function History(_0x11b3f6){this['uniqueid']=_0x11b3f6['uniqueid'];this['scheduledat']=_0x11b3f6['scheduledat']||undefined;this[_0x9265('0x6')]=_0x11b3f6[_0x9265('0x6')];this[_0x9265('0x7')]=_0x11b3f6[_0x9265('0x6')]===_0x9265('0x8')?_0x9265('0x9'):_0x11b3f6[_0x9265('0x6')];this[_0x9265('0xa')]=_0x11b3f6[_0x9265('0xa')];this[_0x9265('0xb')]=_0x11b3f6['countcongestionretry'];this[_0x9265('0xc')]=_0x11b3f6['countnoanswerretry'];this[_0x9265('0xd')]=_0x11b3f6[_0x9265('0xa')]+_0x11b3f6['countcongestionretry']+_0x11b3f6[_0x9265('0xc')];this[_0x9265('0x9')]=_0x11b3f6[_0x9265('0x9')];this[_0x9265('0xe')]=_0x11b3f6[_0x9265('0xf')];this[_0x9265('0x10')]=_0x11b3f6[_0x9265('0x11')];this[_0x9265('0x12')]=_0x11b3f6[_0x9265('0x12')];this[_0x9265('0x13')]=_0x11b3f6[_0x9265('0x13')];this[_0x9265('0x14')]=_0x11b3f6[_0x9265('0x13')];this[_0x9265('0x15')]=getSeconds(_0x11b3f6[_0x9265('0x13')],_0x11b3f6[_0x9265('0x12')]);this[_0x9265('0x16')]=0x0;this[_0x9265('0x17')]=0x0;this[_0x9265('0x18')]=_0x11b3f6[_0x9265('0x18')];this[_0x9265('0x19')]=_0x11b3f6['callbackuniqueid'];this[_0x9265('0x1a')]=_0x11b3f6[_0x9265('0x1a')];this[_0x9265('0x1b')]=_0x11b3f6[_0x9265('0x1b')];this[_0x9265('0x1c')]=_0x11b3f6['ContactId'];this['ListId']=_0x11b3f6[_0x9265('0x1d')];this['UserId']=_0x11b3f6[_0x9265('0x1e')];this[_0x9265('0x1f')]=_0x11b3f6[_0x9265('0x1f')];this['CampaignId']=_0x11b3f6[_0x9265('0x20')];this['originatecalleridnum']=_0x11b3f6[_0x9265('0x21')]||'';this[_0x9265('0x22')]=_0x11b3f6[_0x9265('0x22')]||'';}module[_0x9265('0x23')]=History; \ No newline at end of file +var _0xe0ac=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x57f3e1,_0x19d751){var _0x4911e9=function(_0x44056e){while(--_0x44056e){_0x57f3e1['push'](_0x57f3e1['shift']());}};_0x4911e9(++_0x19d751);}(_0xe0ac,0x8d));var _0xce0a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe0ac[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var _=require(_0xce0a('0x0'));var moment=require('moment');function getSeconds(_0x27016d,_0x105d33){var _0x5e3f84=moment(_0x27016d)[_0xce0a('0x1')](0x0);var _0x1b1ae9=moment(_0x105d33)['milliseconds'](0x0);return _0x5e3f84[_0xce0a('0x2')](_0x1b1ae9,'seconds');}function History(_0x2cd4b9){this[_0xce0a('0x3')]=_0x2cd4b9['uniqueid'];this[_0xce0a('0x4')]=_0x2cd4b9[_0xce0a('0x4')]||undefined;this['type']=_0x2cd4b9[_0xce0a('0x5')];this[_0xce0a('0x6')]=_0x2cd4b9[_0xce0a('0x5')]===_0xce0a('0x7')?_0xce0a('0x8'):_0x2cd4b9['type'];this[_0xce0a('0x9')]=_0x2cd4b9[_0xce0a('0x9')];this[_0xce0a('0xa')]=_0x2cd4b9[_0xce0a('0xa')];this[_0xce0a('0xb')]=_0x2cd4b9[_0xce0a('0xb')];this['countglobal']=_0x2cd4b9[_0xce0a('0x9')]+_0x2cd4b9['countcongestionretry']+_0x2cd4b9[_0xce0a('0xb')];this[_0xce0a('0x8')]=_0x2cd4b9[_0xce0a('0x8')];this[_0xce0a('0xc')]=_0x2cd4b9[_0xce0a('0xd')];this[_0xce0a('0xe')]=_0x2cd4b9['number'];this[_0xce0a('0xf')]=_0x2cd4b9[_0xce0a('0xf')];this[_0xce0a('0x10')]=_0x2cd4b9[_0xce0a('0x10')];this[_0xce0a('0x11')]=_0x2cd4b9[_0xce0a('0x10')];this[_0xce0a('0x12')]=getSeconds(_0x2cd4b9[_0xce0a('0x10')],_0x2cd4b9['starttime']);this[_0xce0a('0x13')]=0x0;this[_0xce0a('0x14')]=0x0;this[_0xce0a('0x15')]=_0x2cd4b9[_0xce0a('0x15')];this[_0xce0a('0x16')]=_0x2cd4b9[_0xce0a('0x16')];this['callbackat']=_0x2cd4b9[_0xce0a('0x17')];this[_0xce0a('0x18')]=_0x2cd4b9[_0xce0a('0x18')];this[_0xce0a('0x19')]=_0x2cd4b9[_0xce0a('0x19')];this[_0xce0a('0x1a')]=_0x2cd4b9[_0xce0a('0x1a')];this['UserId']=_0x2cd4b9[_0xce0a('0x1b')];this[_0xce0a('0x1c')]=_0x2cd4b9[_0xce0a('0x1c')];this['CampaignId']=_0x2cd4b9[_0xce0a('0x1d')];this[_0xce0a('0x1e')]=_0x2cd4b9[_0xce0a('0x1e')]||'';this[_0xce0a('0x1f')]=_0x2cd4b9[_0xce0a('0x1f')]||'';}module[_0xce0a('0x20')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 9555f99..8a2412c 100644 --- a/server/services/ami/dialer/index.js +++ b/server/services/ami/dialer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab84=['dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','xcally-motion-dialer','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','callProgressDetecting','entity\x20is\x20undefine','[callProgressDetecting]','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','countglobal','createStateFinal','reason\x203\x20ringing\x20no\x20answer','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','dialPredictiveOptimizationPercentage','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','temp','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','checkContactBlack','dialLimitQueue','not_inuse','dialOrderByScheduledAt','tryOriginatePredictive','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./hangup','XCALLY_IP_AGI','rrmemory','roundrobin','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','diff','seconds','emit','type','outbound','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','format','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','milliseconds','startPredictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','pTalking','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[actions]','prototype','isNil','Action','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','pick','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','saveInDb','uniqueid','variable','exten','dialAMDActive','value','HANGUP','state','HangupInAMD','membername','MACHINE','Machine','amd','[syncMachine][createHistory]','AMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','TIMEOUT','dropreason','channel','syncQueueMember','actionid','stateinterface','locked','push','idHopper','paused','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','VoiceQueueId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','true','indexOf','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','handleIvr','loggedIn','dialGlobalInterval','dialTimezone','[syncQueueSummary]','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions'];(function(_0x1d7e5d,_0x1d3c33){var _0x5b9d1e=function(_0xd2e2e4){while(--_0xd2e2e4){_0x1d7e5d['push'](_0x1d7e5d['shift']());}};_0x5b9d1e(++_0x1d3c33);}(_0xab84,0x95));var _0x4ab8=function(_0x57e976,_0x1c6f4d){_0x57e976=_0x57e976-0x0;var _0x145e8b=_0xab84[_0x57e976];return _0x145e8b;};'use strict';var util=require(_0x4ab8('0x0'));var _=require(_0x4ab8('0x1'));var BPromise=require(_0x4ab8('0x2'));var uuid=require(_0x4ab8('0x3'));var moment=require(_0x4ab8('0x4'));var rr=require('rr');var md5=require(_0x4ab8('0x5'));var Redis=require(_0x4ab8('0x6'));var config=require('../../../config/environment/');var logger=require(_0x4ab8('0x7'))(_0x4ab8('0x8'));var loggerBooked=require(_0x4ab8('0x7'))(_0x4ab8('0x9'));var loggerPredictive=require(_0x4ab8('0x7'))(_0x4ab8('0xa'));var loggerPredictiveCalls=require(_0x4ab8('0x7'))(_0x4ab8('0xb'));var loggerSyncQueueSummary=require(_0x4ab8('0x7'))('syncQueueSummary');var ami=require(_0x4ab8('0xc'));config[_0x4ab8('0xd')]=_[_0x4ab8('0xe')](config[_0x4ab8('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x4ab8('0xf'))(new Redis(config[_0x4ab8('0xd')]));var cmHopper=require(_0x4ab8('0x10'));var cmHopperFinal=require(_0x4ab8('0x11'));var cmHopperHistory=require(_0x4ab8('0x12'));var cmHopperBlack=require(_0x4ab8('0x13'));var voiceQueueRt=require(_0x4ab8('0x14'));var Action=require(_0x4ab8('0x15'));var History=require(_0x4ab8('0x16'));var Final=require(_0x4ab8('0x17'));var AgentComplete=require(_0x4ab8('0x18'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x4ab8('0x19'));var ipAgi=process['env'][_0x4ab8('0x1a')]||'127.0.0.1';var strategy={'rrmemory':_0x4ab8('0x1b'),'roundrobin':_0x4ab8('0x1c')};var Sequence=function(){};Sequence['prototype'][_0x4ab8('0x1d')]=function(_0xa42aa){this['tail']=this['tail']?this[_0x4ab8('0x1e')][_0x4ab8('0x1f')](_0xa42aa):_0xa42aa();};function Dialer(_0x2d7cfc,_0x200589){this[_0x4ab8('0x20')]=new Sequence();this[_0x4ab8('0x21')]=_0x200589;this[_0x4ab8('0x22')]=_0x2d7cfc[_0x4ab8('0x22')];this[_0x4ab8('0x23')]=_0x2d7cfc[_0x4ab8('0x23')];this[_0x4ab8('0x24')]=_0x2d7cfc[_0x4ab8('0x24')];this[_0x4ab8('0x25')]=_0x2d7cfc[_0x4ab8('0x25')];this['maxNumberOriginate']=config[_0x4ab8('0x26')]||0x2;this['channels']={};this[_0x4ab8('0x27')]={};this['contactsId']={};this['uniqueId']={};this[_0x4ab8('0x28')]={};this['startPredictive']={};this[_0x4ab8('0x29')]={};this[_0x4ab8('0x2a')]={};this[_0x4ab8('0x2b')]={};this[_0x4ab8('0x2c')]={};ami['on'](_0x4ab8('0x2d'),this[_0x4ab8('0x2e')][_0x4ab8('0x2f')](this));ami['on'](_0x4ab8('0x30'),this[_0x4ab8('0x31')]['bind'](this));ami['on'](_0x4ab8('0x32'),this[_0x4ab8('0x33')]['bind'](this));ami['on'](_0x4ab8('0x34'),this[_0x4ab8('0x35')]['bind'](this));ami['on'](_0x4ab8('0x36'),this[_0x4ab8('0x37')]['bind'](this));ami['on'](_0x4ab8('0x38'),this[_0x4ab8('0x39')][_0x4ab8('0x2f')](this));ami['on'](_0x4ab8('0x3a'),this['syncNewExten'][_0x4ab8('0x2f')](this));ami['on'](_0x4ab8('0x3b'),this[_0x4ab8('0x3c')][_0x4ab8('0x2f')](this));ami['on'](_0x4ab8('0x3d'),this['syncQueueMember']['bind'](this));ami['on'](_0x4ab8('0x3e'),this[_0x4ab8('0x3f')]['bind'](this));this[_0x4ab8('0x40')]();this[_0x4ab8('0x41')]();}function isNotNull(_0x197349){return _0x197349!==null&&!_[_0x4ab8('0x42')](_0x197349);}function checkIsLoggedIn(_0x5ba4a1,_0x497d99){return function(){if(_0x497d99<=0x0){_0x5ba4a1[_0x4ab8('0x43')]='AGENTS_NOT_LOGGED';throw _0x5ba4a1[_0x4ab8('0x44')]+_0x4ab8('0x45');}};}function isActive(_0x39e47f){return _0x39e47f;}function checkIsActive(_0x2dd7ba,_0x2875c2){return function(){if(!isActive(_0x2875c2)){_0x2dd7ba['message']=_0x4ab8('0x46');throw _0x2dd7ba['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x188016){return function(){if(!isNotNull(_0x188016[_0x4ab8('0x47')])){_0x188016[_0x4ab8('0x43')]=_0x4ab8('0x48');throw _0x188016[_0x4ab8('0x44')]+_0x4ab8('0x49');}if(!isNotNull(_0x188016[_0x4ab8('0x47')][_0x4ab8('0x4a')])){_0x188016[_0x4ab8('0x43')]=_0x4ab8('0x48');throw _0x188016['name']+_0x4ab8('0x49');}if(!isNotNull(_[_0x4ab8('0x4b')](_0x188016[_0x4ab8('0x47')]['Intervals']))){_0x188016[_0x4ab8('0x43')]=_0x4ab8('0x48');throw _0x188016['name']+_0x4ab8('0x49');}};}function msgResponse(_0x2b9b13,_0x38a3b6,_0x480755){return{'action':_0x2b9b13,'response':_0x38a3b6,'message':_0x480755,'stack':_0x480755};}function myreject(_0x243015){return function(_0x5ee66f){return _0x243015(msgResponse(_0x4ab8('0x4c'),_0x4ab8('0x4d'),JSON[_0x4ab8('0x4e')](_0x5ee66f)));};}function getSeconds(_0xc0e4fe,_0x270322){var _0x4481d6=moment(_0xc0e4fe)['milliseconds'](0x0);var _0x16e12f=moment(_0x270322)['milliseconds'](0x0);return _0x4481d6[_0x4ab8('0x4f')](_0x16e12f,_0x4ab8('0x50'));}function emit(_0x5f5059,_0x477013,_0x9f89cc){io['to'](_0x5f5059)[_0x4ab8('0x51')](_0x477013,_0x9f89cc);}function emitVoiceQueueSummary(_0x1a7847){if(_0x1a7847[_0x4ab8('0x52')]===_0x4ab8('0x53')){var _0x30fad2={'id':_0x1a7847['id'],'name':_0x1a7847[_0x4ab8('0x44')],'strategy':_0x1a7847[_0x4ab8('0x54')],'answered':_0x1a7847[_0x4ab8('0x55')],'available':_0x1a7847[_0x4ab8('0x56')],'loggedIn':_0x1a7847['loggedIn'],'pTalking':_0x1a7847['pTalking'],'sumBillable':_0x1a7847[_0x4ab8('0x57')],'sumDuration':_0x1a7847[_0x4ab8('0x58')],'sumHoldTime':_0x1a7847[_0x4ab8('0x59')]||0x0,'talking':_0x1a7847[_0x4ab8('0x5a')],'total':_0x1a7847[_0x4ab8('0x5b')],'type':_0x1a7847[_0x4ab8('0x52')],'unmanaged':_0x1a7847[_0x4ab8('0x5c')],'abandoned':_0x1a7847['abandoned'],'waiting':_0x1a7847[_0x4ab8('0x5d')],'loggedInDb':_0x1a7847['loggedInDb'],'dialActive':_0x1a7847[_0x4ab8('0x5e')],'dialMethod':_0x1a7847[_0x4ab8('0x5f')],'dialOriginateCallerIdName':_0x1a7847[_0x4ab8('0x60')],'dialOriginateCallerIdNumber':_0x1a7847[_0x4ab8('0x61')],'dialOriginateTimeout':_0x1a7847['dialOriginateTimeout'],'dialPrefix':_0x1a7847[_0x4ab8('0x62')],'outboundAnswerAgiCallsDay':_0x1a7847[_0x4ab8('0x63')],'outboundAnswerCallsDay':_0x1a7847[_0x4ab8('0x64')],'outboundBlacklistCallsDay':_0x1a7847[_0x4ab8('0x65')],'outboundBusyCallsDay':_0x1a7847[_0x4ab8('0x66')],'outboundCongestionCallsDay':_0x1a7847[_0x4ab8('0x67')],'outboundDropCallsDayACS':_0x1a7847[_0x4ab8('0x68')],'outboundDropCallsDayCallersExit':_0x1a7847[_0x4ab8('0x69')],'outboundDropCallsDayTimeout':_0x1a7847[_0x4ab8('0x6a')],'outboundNoAnswerCallsDay':_0x1a7847[_0x4ab8('0x6b')],'outboundNoSuchCallsDay':_0x1a7847[_0x4ab8('0x6c')],'outboundOriginateFailureCallsDay':_0x1a7847[_0x4ab8('0x6d')],'outboundReCallsDay':_0x1a7847[_0x4ab8('0x6e')],'outboundRejectCallsDay':_0x1a7847[_0x4ab8('0x6f')],'outboundUnknownCallsDay':_0x1a7847[_0x4ab8('0x70')],'predictiveIntervalAnsweredCalls':_0x1a7847[_0x4ab8('0x71')],'predictiveIntervalAvgHoldtime':_0x1a7847[_0x4ab8('0x72')],'predictiveIntervalAvgTalktime':_0x1a7847[_0x4ab8('0x73')],'predictiveIntervalDroppedCallsCallersExit':_0x1a7847[_0x4ab8('0x74')],'predictiveIntervalDroppedCallsTimeout':_0x1a7847[_0x4ab8('0x75')],'predictiveIntervalErlangCalls':_0x1a7847[_0x4ab8('0x76')],'predictiveIntervalErlangCallsDroppedCalls':_0x1a7847['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1a7847[_0x4ab8('0x77')],'predictiveIntervalMultiplicativeFactor':_0x1a7847['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1a7847[_0x4ab8('0x78')],'predictiveIntervalAvailable':_0x1a7847[_0x4ab8('0x79')],'predictiveIntervalTotalCalls':_0x1a7847[_0x4ab8('0x7a')],'message':_0x1a7847['message'],'originated':_0x1a7847[_0x4ab8('0x7b')],'erlangCalls':_0x1a7847[_0x4ab8('0x7c')],'erlangCallToSecond':_0x1a7847['erlangCallToSecond'],'erlangAbandonmentRate':_0x1a7847[_0x4ab8('0x7d')],'erlangBusyFactor':_0x1a7847[_0x4ab8('0x7e')],'startPredictive':_0x1a7847['startPredictive'],'startProgressive':_0x1a7847[_0x4ab8('0x29')]};if(_0x1a7847['Trunk']){_0x30fad2[_0x4ab8('0x7f')]={'id':_0x1a7847['Trunk']['id'],'name':_0x1a7847[_0x4ab8('0x7f')][_0x4ab8('0x44')],'active':_0x1a7847[_0x4ab8('0x7f')]['active'],'callerid':_0x1a7847[_0x4ab8('0x7f')][_0x4ab8('0x80')]};}if(_0x1a7847[_0x4ab8('0x47')]){_0x30fad2[_0x4ab8('0x47')]={'id':_0x1a7847['Interval']['id'],'name':_0x1a7847[_0x4ab8('0x47')][_0x4ab8('0x44')]};}var _0x5e5294=md5(JSON[_0x4ab8('0x4e')](_0x30fad2));if(_0x1a7847[_0x4ab8('0x5')]!==_0x5e5294){_0x1a7847[_0x4ab8('0x5')]=_0x5e5294;emit(util[_0x4ab8('0x81')]('voice:queue:%s',_0x30fad2[_0x4ab8('0x44')]),'voice_queue:save',_0x30fad2);}}}function emitCampaignSummary(_0x3516c0){if(_0x3516c0['type']===_0x4ab8('0x82')){emit(util[_0x4ab8('0x81')](_0x4ab8('0x83'),_0x3516c0[_0x4ab8('0x44')]),_0x4ab8('0x84'),_0x3516c0);}}function checkGetDataPredictive(_0x43f6ff){if(isNotNull(_0x43f6ff)){if(!_['isEmpty'](_0x43f6ff)){loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x86'));loggerPredictive[_0x4ab8('0x85')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x43f6ff[_0x4ab8('0x7a')]);loggerPredictive['info'](_0x4ab8('0x87'),_0x43f6ff[_0x4ab8('0x71')]);loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x88'),_0x43f6ff[_0x4ab8('0x75')]);loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x89'),_0x43f6ff['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x8a'),_0x43f6ff['predictiveIntervalAvgHoldtime']);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x43f6ff[_0x4ab8('0x73')]);loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x8b'));if(_0x43f6ff[_0x4ab8('0x7a')]>0x0){if(!_['isUndefined'](_0x43f6ff['predictiveIntervalAvgTalktime'])&&_0x43f6ff[_0x4ab8('0x73')]>0x0){return!![];}else{loggerPredictive[_0x4ab8('0x85')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_['isUndefined'](_0x43f6ff[_0x4ab8('0x72')])&&_0x43f6ff['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive['info'](_0x4ab8('0x8c'));}}else{loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x8d'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}}else{loggerPredictive[_0x4ab8('0x85')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2a7617){return function(_0x12d458){loggerPredictive[_0x4ab8('0x85')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x8e'),_0x12d458['erlangCalls']);loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x8f'),_0x12d458[_0x4ab8('0x90')]);loggerPredictive['info'](_0x4ab8('0x91'),_0x12d458[_0x4ab8('0x7d')]);loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x92'),_0x12d458[_0x4ab8('0x7e')]);loggerPredictive['info'](_0x4ab8('0x91'),_0x12d458['erlangAbandonmentRate']);loggerPredictive[_0x4ab8('0x85')]('---------------------------');_[_0x4ab8('0x93')](_0x2a7617,_0x12d458);};}function getDiff(_0x59606b){var _0x25e6e9=moment()[_0x4ab8('0x94')](0x0);var _0x20d78f=moment(_0x59606b)[_0x4ab8('0x94')](0x0);return _0x25e6e9[_0x4ab8('0x4f')](_0x20d78f,'seconds');}function ifInterval(_0x2c5cd5,_0x2f621b){if(_[_0x4ab8('0x42')](_0x2f621b)){return![];}if(getDiff(_0x2f621b)<_0x2c5cd5*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x4f7a46){if(isNotNull(_0x4f7a46)){if(!_['isUndefined'](_0x4f7a46[_0x4ab8('0x29')])){_0x4f7a46[_0x4ab8('0x29')]=undefined;loggerPredictive[_0x4ab8('0x85')](_0x4f7a46[_0x4ab8('0x44')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x4ab8('0x42')](_0x4f7a46[_0x4ab8('0x95')])){_0x4f7a46[_0x4ab8('0x95')]=undefined;loggerPredictive[_0x4ab8('0x85')](_0x4f7a46[_0x4ab8('0x44')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x4ab8('0x42')](_0x4f7a46[_0x4ab8('0x96')])){clearInterval(_0x4f7a46[_0x4ab8('0x96')]);_0x4f7a46['handlePredictive']=undefined;loggerPredictive[_0x4ab8('0x85')](_0x4f7a46[_0x4ab8('0x44')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x53aa3e,_0x250e38){if(_0x250e38===0x0){return 0x0;}var _0x2e0525=0x1;for(var _0x52dead=0x1;_0x52dead<=_0x250e38;_0x52dead+=0x1){_0x2e0525=0x1+_0x2e0525*_0x52dead/_0x53aa3e;}return 0x1/_0x2e0525;}function isVoiceQueueOutbound(_0x4c03e6){return _0x4c03e6==='outbound';}function isNotPreview(_0x47f59a){return _0x47f59a!==_0x4ab8('0x21');}function isCampaignIvr(_0x4813d6){return _0x4813d6===_0x4ab8('0x82');}function getCallerId(_0x15ac51,_0x47c2cb,_0xe69590){if(!_['isUndefined'](_0xe69590)&&'string'===typeof _0xe69590&&!_[_0x4ab8('0x4b')](_0xe69590)){if(!_['isUndefined'](_0x47c2cb)&&_0x4ab8('0x97')===typeof _0x47c2cb&&!_[_0x4ab8('0x4b')](_0x47c2cb)){return util[_0x4ab8('0x81')](_0x4ab8('0x98'),_0x47c2cb,_0xe69590);}return util['format']('\x22%s\x22\x20<%s>',_0xe69590,_0xe69590);}if(!_['isUndefined'](_0x15ac51)&&_0x4ab8('0x97')===typeof _0x15ac51&&!_[_0x4ab8('0x4b')](_0x15ac51)){return _0x15ac51;}return _0x4ab8('0x99');}function loggerCatchQueueSummary(_0x8a70b1,_0x45951e){return function(_0x29b494){freeVariablesPredictive(_0x45951e);emitVoiceQueueSummary(_0x45951e);emitCampaignSummary(_0x45951e);loggerSyncQueueSummary[_0x4ab8('0x9a')](_0x8a70b1,util[_0x4ab8('0x9b')](_0x29b494,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4e2dc8,_0x3f07f1){return function(_0x406298){loggerPredictive[_0x4ab8('0x9a')](_0x3f07f1[_0x4ab8('0x44')],_0x4e2dc8);loggerPredictive[_0x4ab8('0x9a')](_0x406298[_0x4ab8('0x9c')]);freeVariablesPredictive(_0x3f07f1);};}function loggerCatch(_0x2405e1){return function(_0x4fa14e){logger['error'](_0x2405e1,util[_0x4ab8('0x9b')](_0x4fa14e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5477a5){return _0x5477a5&&!_['isUndefined'](_0x5477a5)&&_0x5477a5[_0x4ab8('0x9d')]>0x0;}function decremetOriginate(_0x572c9a){if(!_['isUndefined'](_0x572c9a)&&_0x572c9a!==null){if(_0x572c9a[_0x4ab8('0x9e')](_0x4ab8('0x7b'))){if(_0x572c9a[_0x4ab8('0x7b')]>0x0){_0x572c9a[_0x4ab8('0x7b')]-=0x1;}else{logger[_0x4ab8('0x9a')](_0x4ab8('0x9f'));}}}else{logger[_0x4ab8('0x9a')](_0x4ab8('0xa0'));}}function checkContactLowerLimitOriginate(_0x4e4b68,_0xad7897,_0x3d356a){if(_0xad7897>_0x3d356a){for(var _0x3f001e=0x0;_0x3f001e<_0xad7897-_0x3d356a;_0x3f001e+=0x1){decremetOriginate(_0x4e4b68);}}}function loggerGetContactDialer(_0x60088a,_0x470559,_0x56e773){return function(_0x3519b9){checkContactLowerLimitOriginate(_0x470559,_0x56e773,0x0);logger[_0x4ab8('0x9a')](_0x60088a,util['inspect'](_0x3519b9,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x307835){return function(_0x54b173){if(isNotNull(_0x54b173)&&isNotNull(_0x54b173[0x0])){if(_0x54b173[0x0][_0x4ab8('0xa1')]>0x0){_0x307835[_0x4ab8('0x43')]='RESCHEDULED_CONTACTS';logger[_0x4ab8('0x85')](_0x4ab8('0xa2')+_0x307835[_0x4ab8('0x44')],_0x54b173[0x0]['contactsRescheduled'],_0x4ab8('0xa3'));}else{_0x307835['message']=_0x4ab8('0xa4');logger[_0x4ab8('0x85')](_0x4ab8('0xa5')+_0x307835[_0x4ab8('0x44')]);}}};}function notSendMessagesQueue(_0x13c84e){if(_0x13c84e['sendMessageOneNotActive']){freeVariablesPredictive(_0x13c84e);if(_0x13c84e[_0x4ab8('0x7b')]===0x0&&_0x13c84e[_0x4ab8('0x5a')]===0x0&&_0x13c84e['waiting']===0x0&&(_0x13c84e[_0x4ab8('0xa6')]||0x0)===0x0){_0x13c84e[_0x4ab8('0xa7')]=![];_0x13c84e[_0x4ab8('0x56')]=0x0;_0x13c84e['message']=_0x4ab8('0x46');loggerSyncQueueSummary['error'](_0x4ab8('0xa8'),_0x13c84e[_0x4ab8('0x44')],_0x4ab8('0xa9'));}else{_0x13c84e[_0x4ab8('0x43')]=_0x4ab8('0xaa');loggerSyncQueueSummary[_0x4ab8('0x9a')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x13c84e[_0x4ab8('0x44')],_0x4ab8('0xab'));}emitVoiceQueueSummary(_0x13c84e);}}function notSendMessagesCampaign(_0x1ba47c){if(_0x1ba47c[_0x4ab8('0xa7')]){if(_0x1ba47c[_0x4ab8('0x7b')]===0x0){_0x1ba47c[_0x4ab8('0xa7')]=![];_0x1ba47c[_0x4ab8('0x43')]=_0x4ab8('0x46');loggerSyncQueueSummary[_0x4ab8('0x9a')](_0x4ab8('0xac'),_0x1ba47c[_0x4ab8('0x44')],_0x4ab8('0xa9'));}else{_0x1ba47c['message']=_0x4ab8('0xaa');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1ba47c[_0x4ab8('0x44')],_0x4ab8('0xab'));}emitCampaignSummary(_0x1ba47c);}}function createObjHistory(_0x38fdb4,_0x1cf455,_0x295001,_0xf4fa05,_0x260f2f){_0x38fdb4[_0x4ab8('0x43')]=_0x295001;var _0x1bd62b=new Action(_0x38fdb4,_0x1cf455);var _0x49d765=new History(_0x1bd62b);_0x49d765['state']=_0xf4fa05;_0x49d765[_0x4ab8('0xad')]=_0x260f2f;_0x49d765[_0x4ab8('0xae')]=_0x1bd62b[_0x4ab8('0xaf')];return _0x49d765;}Dialer['prototype'][_0x4ab8('0x41')]=function(){var _0xef3d09=this;setInterval(function(){_0xef3d09[_0x4ab8('0xb0')](_0xef3d09[_0x4ab8('0xb1')],'[uniqueid]');_0xef3d09[_0x4ab8('0xb0')](_0xef3d09[_0x4ab8('0x27')],_0x4ab8('0xb2'));},0x32c8);};Dialer[_0x4ab8('0xb3')]['clearZombieChannels']=function(_0x1dd858,_0x22486e){var _0x22a820=this;for(var _0x31050c in _0x1dd858){if(_0x1dd858['hasOwnProperty'](_0x31050c)){this[_0x4ab8('0x20')][_0x4ab8('0x1d')](function(){if(!_[_0x4ab8('0xb4')](_0x1dd858[_0x31050c])){return ami[_0x4ab8('0xb5')]({'action':'status','channel':_0x1dd858[_0x31050c]['channel']})[_0x4ab8('0xb6')](function(_0x5f0f86){if(_0x5f0f86['message']===_0x4ab8('0xb7')){setTimeout(function(){if(_0x1dd858[_0x31050c]&&_0x1dd858[_0x31050c][_0x4ab8('0x52')]!=='ivr'){_0x22a820[_0x4ab8('0xb8')](_0x22a820[_0x4ab8('0x22')][_0x1dd858[_0x31050c]['queue']]);logger['error'](_0x4ab8('0xb9'),_0x22486e,_0x31050c,_0x1dd858[_0x31050c][_0x4ab8('0xba')]);delete _0x1dd858[_0x31050c];}if(_0x1dd858[_0x31050c]&&_0x1dd858[_0x31050c]['type']===_0x4ab8('0x82')){_0x22a820['updateOriginated'](_0x22a820['campaigns'][_0x1dd858[_0x31050c][_0x4ab8('0xba')]]);logger[_0x4ab8('0x9a')](_0x4ab8('0xbb'),_0x22486e,_0x31050c,_0x1dd858[_0x31050c]['queue']);delete _0x1dd858[_0x31050c];}},0x2328);}});}});}}};Dialer[_0x4ab8('0xb3')][_0x4ab8('0xbc')]=function(_0x43f0af){return BPromise[_0x4ab8('0xbd')]()[_0x4ab8('0xbe')](cmHopper[_0x4ab8('0xbc')](_0x43f0af))[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0xbf')));};Dialer[_0x4ab8('0xb3')]['checkIsBlackList']=function(_0x19aa20){return BPromise['resolve']()[_0x4ab8('0xbe')](cmHopperBlack[_0x4ab8('0xc0')](_0x19aa20))[_0x4ab8('0xb6')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x4ab8('0xb3')][_0x4ab8('0xc1')]=function(_0x3f3929){return BPromise[_0x4ab8('0xbd')]()[_0x4ab8('0xbe')](cmHopperBlack[_0x4ab8('0xc1')](_0x3f3929))[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0xc2')));};Dialer[_0x4ab8('0xb3')][_0x4ab8('0xc3')]=function(_0x362423){return BPromise[_0x4ab8('0xbd')]()[_0x4ab8('0xbe')](cmHopperHistory[_0x4ab8('0xc4')](_0x362423))['catch'](loggerCatch(_0x4ab8('0xc5')));};Dialer['prototype']['rescheduleContact']=function(_0x3368d6){return BPromise[_0x4ab8('0xbd')]()[_0x4ab8('0xbe')](cmHopper[_0x4ab8('0xc6')](_0x3368d6))['catch'](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x4ab8('0xb3')][_0x4ab8('0xc7')]=function(_0x248f22,_0xc61a5e,_0x57b594,_0x11626b){return BPromise['resolve']()[_0x4ab8('0xbe')](cmHopper[_0x4ab8('0xc7')](_0x248f22,_0xc61a5e,_0x57b594,_0x11626b))['catch'](loggerCatch(_0x4ab8('0xc8')));};Dialer[_0x4ab8('0xb3')]['getContactDialerIvr']=function(_0x42a338,_0x4e5b87,_0x3cdf29){return BPromise[_0x4ab8('0xbd')]()[_0x4ab8('0xbe')](cmHopper[_0x4ab8('0xc9')](_0x42a338,_0x4e5b87,_0x3cdf29))[_0x4ab8('0xb6')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x4ab8('0xb3')][_0x4ab8('0xca')]=function(_0x12ada5){return BPromise[_0x4ab8('0xbd')]()['then'](voiceQueueRt[_0x4ab8('0xca')](_0x12ada5))[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0xcb')));};Dialer[_0x4ab8('0xb3')]['moveContactManagedDialer']=function(_0x303faf){return BPromise[_0x4ab8('0xbd')]()[_0x4ab8('0xbe')](cmHopper[_0x4ab8('0xcc')](_0x303faf))[_0x4ab8('0xb6')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x4ab8('0xb3')][_0x4ab8('0xcd')]=function(_0x161af5){return BPromise[_0x4ab8('0xbd')]()['then'](cmHopperHistory[_0x4ab8('0xcd')](_0x161af5))[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0xce')));};Dialer[_0x4ab8('0xb3')][_0x4ab8('0xb8')]=function(_0x11094c){if(!_[_0x4ab8('0x42')](_0x11094c)&&_0x11094c!==null){if(_0x11094c[_0x4ab8('0x9e')](_0x4ab8('0x7b'))){if(_0x11094c[_0x4ab8('0x7b')]>0x0){_0x11094c[_0x4ab8('0x7b')]-=0x1;}else{logger[_0x4ab8('0x9a')](_0x4ab8('0xcf'));}}}else{logger['error'](_0x4ab8('0xd0'));}};Dialer[_0x4ab8('0xb3')][_0x4ab8('0xd1')]=function(_0x1464e5,_0x19d93c){var _0x5d2f2b=this;return function(_0x522982){_0x5d2f2b[_0x4ab8('0xb8')](_0x19d93c);logger['error'](_0x1464e5,util[_0x4ab8('0x9b')](_0x522982,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0xfd145,_0x7fccda,_0x9187ce){var _0x1cb26f={'state':0x19,'statedesc':_0x4ab8('0xd2')};this[_0x4ab8('0xb8')](_0x7fccda);this['saveInDb'](_[_0x4ab8('0x93')](_0x1cb26f,_[_0x4ab8('0xd3')](_0x9187ce,[_0x4ab8('0xd4'),_0x4ab8('0xd5'),_0x4ab8('0xd6'),'VoiceQueueId',_0x4ab8('0xd7')])),_0x4ab8('0xd8'),_0x4ab8('0xd9'));logger[_0x4ab8('0x9a')](_0xfd145);};Dialer[_0x4ab8('0xb3')][_0x4ab8('0xda')]=function(_0x4ec3da){return _0x4ec3da===_0x4ab8('0xdb');};Dialer[_0x4ab8('0xb3')][_0x4ab8('0xdc')]=function(_0xa6a6b3){return!_[_0x4ab8('0x42')](_0xa6a6b3)&&_0xa6a6b3&&!_[_0x4ab8('0x42')](_0xa6a6b3[_0x4ab8('0x44')])&&!_[_0x4ab8('0x42')](_0xa6a6b3[_0x4ab8('0xdd')])&&_0xa6a6b3[_0x4ab8('0xdd')]&&(this[_0x4ab8('0x25')][util[_0x4ab8('0x81')](_0x4ab8('0xde'),_0xa6a6b3[_0x4ab8('0x44')])][_0x4ab8('0xdf')]===_0x4ab8('0xe0')||this[_0x4ab8('0x25')][util[_0x4ab8('0x81')](_0x4ab8('0xde'),_0xa6a6b3[_0x4ab8('0x44')])][_0x4ab8('0xdf')]===_0x4ab8('0xe1'));};Dialer[_0x4ab8('0xb3')][_0x4ab8('0xe2')]=function(_0x52ead6,_0x5e7643,_0x157484){this[_0x4ab8('0xcd')](_0x52ead6)[_0x4ab8('0xb6')](loggerCatch(_0x5e7643));this['moveContactManagedDialer'](_0x52ead6)['catch'](loggerCatch(_0x157484));};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x3c')]=function(_0x4c0733){var _0xa994c2=this[_0x4ab8('0xb1')][_0x4c0733[_0x4ab8('0xe3')]];var _0x50dac1;if(!_['isNil'](_0x4c0733)&&!_[_0x4ab8('0xb4')](_0x4c0733[_0x4ab8('0xe4')])&&!_[_0x4ab8('0xb4')](_0x4c0733[_0x4ab8('0xe4')]['amdstatus'])&&_0x4c0733[_0x4ab8('0xe5')]==='xcally-motion-dialer'&&_0xa994c2){if(_0xa994c2[_0x4ab8('0x52')]!=='ivr'&&this['voiceQueues'][_0xa994c2['queue']][_0x4ab8('0xe6')]&&_0x4c0733[_0x4ab8('0xe7')]===_0x4ab8('0xe8')){delete this[_0x4ab8('0xb1')][_0x4c0733[_0x4ab8('0xe3')]];this[_0x4ab8('0xb8')](this[_0x4ab8('0x22')][_0xa994c2[_0x4ab8('0xba')]]);this[_0x4ab8('0x22')][_0xa994c2['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x4ab8('0x22')][_0xa994c2['queue']][_0x4ab8('0x63')]+=0x1;_0x50dac1=new Hangup(_0xa994c2,_0x4c0733);_0x50dac1[_0x4ab8('0xe9')]=0x12;_0x50dac1[_0x4ab8('0xad')]=_0x4ab8('0xea');_0x50dac1[_0x4ab8('0xeb')]='AMD';this[_0x4ab8('0xe2')](_0x50dac1,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0xa994c2['type']!==_0x4ab8('0x82')&&this[_0x4ab8('0x22')][_0xa994c2[_0x4ab8('0xba')]][_0x4ab8('0xe6')]&&_0x4c0733['value']===_0x4ab8('0xec')){delete this[_0x4ab8('0xb1')][_0x4c0733[_0x4ab8('0xe3')]];this[_0x4ab8('0xb8')](this[_0x4ab8('0x22')][_0xa994c2[_0x4ab8('0xba')]]);this[_0x4ab8('0x22')][_0xa994c2[_0x4ab8('0xba')]][_0x4ab8('0x64')]+=0x1;this[_0x4ab8('0x22')][_0xa994c2[_0x4ab8('0xba')]][_0x4ab8('0x63')]+=0x1;_0x50dac1=new Hangup(_0xa994c2,_0x4c0733);_0x50dac1[_0x4ab8('0xe9')]=0x13;_0x50dac1[_0x4ab8('0xad')]=_0x4ab8('0xed');_0x50dac1[_0x4ab8('0xeb')]='AMD';_0x50dac1[_0x4ab8('0xee')]=!![];this['saveInDb'](_0x50dac1,_0x4ab8('0xef'),'[syncMachine]');}if(_0xa994c2[_0x4ab8('0x52')]===_0x4ab8('0x82')&&this[_0x4ab8('0x23')][_0xa994c2[_0x4ab8('0xba')]][_0x4ab8('0xe6')]&&_0x4c0733['value']===_0x4ab8('0xe8')){delete this['uniqueId'][_0x4c0733['uniqueid']];this[_0x4ab8('0xb8')](this[_0x4ab8('0x23')][_0xa994c2[_0x4ab8('0xba')]]);_0x50dac1=new Hangup(_0xa994c2,_0x4c0733);_0x50dac1[_0x4ab8('0xe9')]=0x12;_0x50dac1[_0x4ab8('0xad')]=_0x4ab8('0xea');_0x50dac1[_0x4ab8('0xeb')]=_0x4ab8('0xf0');this[_0x4ab8('0xe2')](_0x50dac1,_0x4ab8('0xf1'),_0x4ab8('0xf2'));}if(_0xa994c2['type']==='ivr'&&this[_0x4ab8('0x23')][_0xa994c2[_0x4ab8('0xba')]][_0x4ab8('0xe6')]&&_0x4c0733[_0x4ab8('0xe7')]===_0x4ab8('0xec')){delete this[_0x4ab8('0xb1')][_0x4c0733[_0x4ab8('0xe3')]];this['updateOriginated'](this[_0x4ab8('0x23')][_0xa994c2[_0x4ab8('0xba')]]);_0x50dac1=new Hangup(_0xa994c2,_0x4c0733);_0x50dac1[_0x4ab8('0xe9')]=0x13;_0x50dac1['statedesc']=_0x4ab8('0xed');_0x50dac1[_0x4ab8('0xeb')]='AMD';_0x50dac1[_0x4ab8('0xee')]=!![];this[_0x4ab8('0xe2')](_0x50dac1,_0x4ab8('0xf3'),_0x4ab8('0xf4'));}}};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x39')]=function(_0x8be190){var _0x172a1d=this[_0x4ab8('0xb1')][_0x8be190[_0x4ab8('0xe3')]];var _0x523194=this;var _0x1ed9da;if(_0x172a1d&&_0x172a1d[_0x4ab8('0x52')]===_0x4ab8('0x82')){delete this[_0x4ab8('0xb1')][_0x8be190['uniqueid']];this['updateOriginated'](this[_0x4ab8('0x23')][_0x172a1d[_0x4ab8('0xba')]]);this['campaigns'][_0x172a1d[_0x4ab8('0xba')]][_0x4ab8('0xf5')]+=0x1;_0x1ed9da=new Hangup(_0x172a1d,_0x8be190);this[_0x4ab8('0xcd')](_0x1ed9da)[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0xf6')));this['moveContactManagedDialer'](_0x1ed9da)[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0xf7')));}if(_0x172a1d&&_0x172a1d['type']!==_0x4ab8('0x82')&&isNotNull(this[_0x4ab8('0x22')][_0x172a1d[_0x4ab8('0xba')]][_0x4ab8('0xf8')])){delete this['uniqueId'][_0x8be190[_0x4ab8('0xe3')]];this[_0x4ab8('0xb8')](this[_0x4ab8('0x22')][_0x172a1d[_0x4ab8('0xba')]]);this[_0x4ab8('0x22')][_0x172a1d['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x4ab8('0x22')][_0x172a1d[_0x4ab8('0xba')]][_0x4ab8('0x63')]+=0x1;_0x1ed9da=new Hangup(_0x172a1d,_0x8be190);_0x1ed9da[_0x4ab8('0xe9')]=0x10;_0x1ed9da[_0x4ab8('0xad')]=_0x4ab8('0xf9');_0x1ed9da['membername']=_0x4ab8('0xfa');this['createHistory'](_0x1ed9da)[_0x4ab8('0xb6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x4ab8('0xcc')](_0x1ed9da)['catch'](loggerCatch(_0x4ab8('0xf7')));}if(_0x172a1d&&_0x172a1d[_0x4ab8('0x52')]!==_0x4ab8('0x82')&&!isNotNull(this[_0x4ab8('0x22')][_0x172a1d['queue']][_0x4ab8('0xf8')])){delete this[_0x4ab8('0xb1')][_0x8be190[_0x4ab8('0xe3')]];this['updateOriginated'](this[_0x4ab8('0x22')][_0x172a1d[_0x4ab8('0xba')]]);this['voiceQueues'][_0x172a1d['queue']][_0x4ab8('0x70')]+=0x1;_0x1ed9da=new Hangup(_0x172a1d,_0x8be190);_0x1ed9da[_0x4ab8('0xe9')]=0xc;_0x1ed9da[_0x4ab8('0xad')]=_0x8be190[_0x4ab8('0xfb')];_0x1ed9da[_0x4ab8('0xeb')]=_0x4ab8('0xfc');this[_0x4ab8('0xcd')](_0x1ed9da)[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0xf6')));this[_0x4ab8('0xcc')](_0x1ed9da)['catch'](loggerCatch(_0x4ab8('0xf7')));}};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x35')]=function(_0x4c3531){var _0x38e45b=this['uniqueId'][_0x4c3531['uniqueid']];var _0x34a88f=this;if(this[_0x4ab8('0x22')][_0x4c3531[_0x4ab8('0xba')]]){if(_0x38e45b&&_0x38e45b[_0x4ab8('0x52')]!=='ivr'){delete this[_0x4ab8('0xb1')][_0x4c3531['uniqueid']];this[_0x4ab8('0x22')][_0x4c3531[_0x4ab8('0xba')]]['outboundAnswerCallsDay']+=0x1;var _0x506b44=new AgentComplete(_0x38e45b,_0x4c3531);if(_0x4c3531[_0x4ab8('0xfd')]===_0x4ab8('0xfe')){_0x506b44[_0x4ab8('0xff')]=this[_0x4ab8('0x22')][_0x4c3531[_0x4ab8('0xba')]][_0x4ab8('0x100')]&&this[_0x4ab8('0x22')][_0x4c3531[_0x4ab8('0xba')]][_0x4ab8('0x101')]?moment()['format'](_0x4ab8('0x102')):undefined;}this['createHistory'](_0x506b44)[_0x4ab8('0xb6')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x4ab8('0xcc')](_0x506b44)['catch'](loggerCatch(_0x4ab8('0x103')));}}};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x2e')]=function(_0x1a7b41){if(this[_0x4ab8('0x22')][_0x1a7b41[_0x4ab8('0xba')]]){if(this[_0x4ab8('0xb1')][_0x1a7b41[_0x4ab8('0xe3')]]&&this['uniqueId'][_0x1a7b41[_0x4ab8('0xe3')]][_0x4ab8('0x52')]!==_0x4ab8('0x82')){this[_0x4ab8('0xb8')](this['voiceQueues'][_0x1a7b41[_0x4ab8('0xba')]]);this[_0x4ab8('0xb1')][_0x1a7b41[_0x4ab8('0xe3')]]['answertime']=moment()[_0x4ab8('0x81')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0x4ab8('0x104')]=function(_0x549881){this[_0x4ab8('0xcd')](_0x549881)[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0x105')));this['moveContactManagedDialer'](_0x549881)[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0x106')));};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x31')]=function(_0x52e880){var _0x118065=this[_0x4ab8('0xb1')][_0x52e880[_0x4ab8('0xe3')]];var _0xdd06db=this;if(this[_0x4ab8('0x22')][_0x52e880[_0x4ab8('0xba')]]){if(_0x118065&&_0x118065[_0x4ab8('0x52')]!==_0x4ab8('0x82')){delete this[_0x4ab8('0xb1')][_0x52e880[_0x4ab8('0xe3')]];this['updateOriginated'](this['voiceQueues'][_0x52e880[_0x4ab8('0xba')]]);_0x118065[_0x4ab8('0x107')]=moment()[_0x4ab8('0x81')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5ec529=new QueueCallerAbandon(_0x118065,_0x52e880);if(getSeconds(_0x118065[_0x4ab8('0x107')],_0x118065[_0x4ab8('0x108')])>=_0x118065['dialQueueTimeout']){this[_0x4ab8('0x22')][_0x52e880[_0x4ab8('0xba')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x4ab8('0x22')][_0x52e880[_0x4ab8('0xba')]][_0x4ab8('0x6a')]+=0x1;this[_0x4ab8('0x22')][_0x52e880[_0x4ab8('0xba')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x5ec529[_0x4ab8('0xe9')]=0xa;_0x5ec529['statedesc']=_0x4ab8('0x109');_0x5ec529['dropreason']=_0x4ab8('0x10a');_0x5ec529[_0x4ab8('0xff')]=this[_0x4ab8('0x22')][_0x52e880[_0x4ab8('0xba')]][_0x4ab8('0x100')]?moment()[_0x4ab8('0x81')](_0x4ab8('0x102')):undefined;this[_0x4ab8('0x104')](_0x5ec529);}else{this[_0x4ab8('0x22')][_0x52e880['queue']][_0x4ab8('0x74')]+=0x1;this[_0x4ab8('0x22')][_0x52e880['queue']][_0x4ab8('0x69')]+=0x1;_0x5ec529['state']=0xb;_0x5ec529['statedesc']='Abandoned';_0x5ec529[_0x4ab8('0x10b')]='CALLEREXIT';this[_0x4ab8('0x104')](_0x5ec529);}}}};Dialer[_0x4ab8('0xb3')]['syncNewExten']=function(_0x56e98c){if(this['actions'][_0x56e98c['uniqueid']]){this['actions'][_0x56e98c[_0x4ab8('0xe3')]][_0x4ab8('0x10c')]=_0x56e98c[_0x4ab8('0x10c')];}if(this[_0x4ab8('0xb1')][_0x56e98c[_0x4ab8('0xe3')]]){this[_0x4ab8('0xb1')][_0x56e98c[_0x4ab8('0xe3')]][_0x4ab8('0x10c')]=_0x56e98c[_0x4ab8('0x10c')];}};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x10d')]=function(_0x218a49){if(strategy[this['voiceQueues'][this[_0x4ab8('0x27')][_0x218a49[_0x4ab8('0x10e')]][_0x4ab8('0xba')]][_0x4ab8('0x54')]]===_0x4ab8('0x1c')){if(this['actions'][_0x218a49[_0x4ab8('0x10e')]]&&_['isNil'](this[_0x4ab8('0x27')][_0x218a49[_0x4ab8('0x10e')]]['locked'])&&_0x218a49[_0x4ab8('0xdf')]==='1'&&_0x218a49['paused']==='0'){if(this[_0x4ab8('0x24')][_0x218a49[_0x4ab8('0x10f')]]){if(!this[_0x4ab8('0x24')][_0x218a49[_0x4ab8('0x10f')]][_0x4ab8('0x110')]){this[_0x4ab8('0x24')][_0x218a49['stateinterface']][_0x4ab8('0x110')]=!![];this[_0x4ab8('0x27')][_0x218a49['actionid']][_0x4ab8('0x110')]=!![];this[_0x4ab8('0x27')][_0x218a49[_0x4ab8('0x10e')]][_0x4ab8('0x10f')]=_0x218a49['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0x4ab8('0x27')][_0x218a49['actionid']][_0x4ab8('0xba')]][_0x4ab8('0x54')]]||_0x4ab8('0x1b'))==='rrmemory'){if(this[_0x4ab8('0x27')][_0x218a49[_0x4ab8('0x10e')]]){if(this[_0x4ab8('0x24')][_0x218a49[_0x4ab8('0x10f')]]){this['actions'][_0x218a49[_0x4ab8('0x10e')]][_0x4ab8('0x10f')]=_0x218a49[_0x4ab8('0x10f')];if(_[_0x4ab8('0xb4')](this[_0x4ab8('0x2b')][this[_0x4ab8('0x27')][_0x218a49['actionid']]['queue']])){this[_0x4ab8('0x2b')][this['actions'][_0x218a49[_0x4ab8('0x10e')]][_0x4ab8('0xba')]]=[];}this[_0x4ab8('0x2b')][this[_0x4ab8('0x27')][_0x218a49[_0x4ab8('0x10e')]]['queue']][_0x4ab8('0x111')](_[_0x4ab8('0x93')](_[_0x4ab8('0xd3')](this[_0x4ab8('0x27')][_0x218a49[_0x4ab8('0x10e')]],[_0x4ab8('0x112'),_0x4ab8('0x10f')]),{'status':_0x218a49[_0x4ab8('0xdf')],'paused':_0x218a49[_0x4ab8('0x113')]}));}}}};function unlockQueueStatus(_0x55b4e1,_0x4f5672){setTimeout(function(){if(_['isUndefined'](_0x55b4e1[_0x4ab8('0x114')])){loggerBooked[_0x4ab8('0x9a')]('[unlockQueueStatus][undefined]',_0x4f5672);}_0x55b4e1[_0x4ab8('0x114')]=!![];loggerBooked[_0x4ab8('0x85')](_0x4ab8('0x115'),_0x4f5672,JSON[_0x4ab8('0x4e')](_['pick'](_0x55b4e1,[_0x4ab8('0x44'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x5c7ebd){var _0x3d16fa=this;var _0x3e6009=_0x3d16fa[_0x4ab8('0x22')][_0x3d16fa[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0xba')]];if(strategy[this[_0x4ab8('0x22')][this[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0xba')]][_0x4ab8('0x54')]]===_0x4ab8('0x1c')){if(this[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]]&&this[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0x10f')]){this[_0x4ab8('0x21')][_0x4ab8('0x116')](this[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0x112')],this[_0x4ab8('0x27')][_0x5c7ebd['actionid']][_0x4ab8('0x10f')])[_0x4ab8('0xb6')](function(_0xcd8b5c){logger[_0x4ab8('0x9a')](_0x4ab8('0x117'),util['inspect'](_0xcd8b5c,{'showHidden':![],'depth':null}));})[_0x4ab8('0x1f')](function(){_0x3d16fa[_0x4ab8('0xb8')](_0x3d16fa[_0x4ab8('0x22')][_0x3d16fa[_0x4ab8('0x27')][_0x5c7ebd['actionid']]['queue']]);_0x3d16fa[_0x4ab8('0x24')][_0x3d16fa[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]]['stateinterface']][_0x4ab8('0x110')]=![];delete _0x3d16fa[_0x4ab8('0x27')][_0x5c7ebd['actionid']];unlockQueueStatus(_0x3e6009);});}else{this[_0x4ab8('0xb8')](this[_0x4ab8('0x22')][this[_0x4ab8('0x27')][_0x5c7ebd['actionid']]['queue']]);this[_0x4ab8('0xc6')]({'active':![],'ContactId':this[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0xd4')],'ListId':this[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0xd5')],'VoiceQueueId':this['actions'][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0x118')]||undefined,'CampaignId':this['actions'][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0xd7')]||undefined})[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0x119')));delete this[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]];unlockQueueStatus(_0x3e6009);}}else if((strategy[this[_0x4ab8('0x22')][this['actions'][_0x5c7ebd[_0x4ab8('0x10e')]]['queue']]['strategy']]||'rrmemory')==='rrmemory'){var _0x25d4e4;if(this[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]]&&!_['isEmpty'](this[_0x4ab8('0x2b')][this[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0xba')]])){if(this[_0x4ab8('0x2c')][_0x3d16fa[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0xba')]]){this[_0x4ab8('0x2c')][_0x3d16fa[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0xba')]]=this[_0x4ab8('0x2c')][this['actions'][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0xba')]]?this['queueBookedRR'][this['actions'][_0x5c7ebd['actionid']][_0x4ab8('0xba')]]:this['queueBooked'][this[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0xba')]]?this[_0x4ab8('0x2b')][this['actions'][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0xba')]][_0x4ab8('0x11a')]||0x0:0x0;}this['queueBooked'][this[_0x4ab8('0x27')][_0x5c7ebd['actionid']][_0x4ab8('0xba')]]['_rr']=this['queueBookedRR'][this[_0x4ab8('0x27')][_0x5c7ebd[_0x4ab8('0x10e')]][_0x4ab8('0xba')]];for(var _0x99e9ab=0x0;_0x99e9ab=0x0?!![]:![];})[_0x4ab8('0xb6')](myreject(_0x16dc57)));}}else{_0x161768[_0x4ab8('0x111')](ami[_0x4ab8('0xb5')]({'action':_0x4ab8('0x133'),'command':util[_0x4ab8('0x81')](_0x4ab8('0x134'),_0xa6a273,!_[_0x4ab8('0x42')](config[_0x4ab8('0x12f')][_0x934e42])?_0x934e42:'')})[_0x4ab8('0xbe')](function(_0x1c8d03){return _0x1c8d03[_0x4ab8('0x136')][_0x4ab8('0x138')](_0x4ab8('0x137'))>=0x0?!![]:![];})[_0x4ab8('0xb6')](myreject(_0x16dc57)));}BPromise['all'](_0x161768)[_0x4ab8('0xbe')](function(_0x28f06a){var _0x1ea70f=_[_0x4ab8('0x139')](_0x28f06a);if(_0x1ea70f){return _0x27033d(_0x1ea70f);}else{_0x34e403['message']=_0x3bb6cc?_0x4ab8('0x13a'):_0x4ab8('0x13b');return _0x16dc57(msgResponse('[ifTime][promiseAll]','Failure','Global:\x20'+_0x3bb6cc+'\x20'+_0x751904+_0x4ab8('0x13c')+util[_0x4ab8('0x9b')](_0xa6a273,{'showHidden':![],'depth':null})+_0x4ab8('0x13d')+_0x934e42));}})['catch'](function(_0x393859){return _0x16dc57(msgResponse(_0x4ab8('0x129'),_0x4ab8('0x12d'),JSON[_0x4ab8('0x4e')](_0x393859)));});});};Dialer['prototype'][_0x4ab8('0x13e')]=function(_0x54dea3){var _0x1f63cf=this;return function(){switch(_0x54dea3[_0x4ab8('0x5f')]){case _0x4ab8('0x13f'):freeVariablesPredictive(_0x54dea3);_0x1f63cf[_0x4ab8('0x140')](_0x54dea3,0x1);break;case _0x4ab8('0x141'):freeVariablesPredictive(_0x54dea3);_0x1f63cf['handlePower'](_0x54dea3,_0x54dea3[_0x4ab8('0x142')]);break;case _0x4ab8('0xa'):_0x1f63cf['predictive'](_0x54dea3);break;case _0x4ab8('0x9'):freeVariablesPredictive(_0x54dea3);_0x1f63cf[_0x4ab8('0x140')](_0x54dea3,0x1);break;default:freeVariablesPredictive(_0x54dea3);logger['error']('Queue',_0x54dea3[_0x4ab8('0x44')],'method\x20not\x20recognized');}};};Dialer[_0x4ab8('0xb3')]['launchHandleIvr']=function(_0x5a9752){var _0x4bd607=this;return function(){_0x4bd607[_0x4ab8('0x143')](_0x5a9752);};};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x37')]=function(_0x191db4){var _0x432dcd=this;if(isNotPreview(_0x191db4[_0x4ab8('0x5f')])){if(isVoiceQueueOutbound(_0x191db4['type'])&&isActive(_0x191db4[_0x4ab8('0x5e')])){_0x191db4[_0x4ab8('0xa7')]=!![];BPromise['resolve']()[_0x4ab8('0xbe')](checkIsLoggedIn(_0x191db4,_0x191db4[_0x4ab8('0x144')]))[_0x4ab8('0xbe')](checkIsActive(_0x191db4,_0x191db4['dialActive']))[_0x4ab8('0xbe')](checkInterval(_0x191db4))[_0x4ab8('0xbe')](_0x432dcd[_0x4ab8('0x124')](_0x191db4))[_0x4ab8('0xbe')](_0x432dcd[_0x4ab8('0x128')](_0x191db4[_0x4ab8('0x145')],_0x191db4[_0x4ab8('0x146')],_0x191db4['name'],_0x191db4))[_0x4ab8('0xbe')](_0x432dcd[_0x4ab8('0x12a')](_0x191db4[_0x4ab8('0x47')],_0x191db4[_0x4ab8('0x146')],_0x191db4[_0x4ab8('0x44')],_0x191db4))[_0x4ab8('0xbe')](_0x432dcd[_0x4ab8('0x13e')](_0x191db4))[_0x4ab8('0xb6')](loggerCatchQueueSummary(_0x4ab8('0x147'),_0x191db4));}else{notSendMessagesQueue(_0x191db4);}}else{freeVariablesPredictive(_0x191db4);}};Dialer['prototype'][_0x4ab8('0x123')]=function(){var _0x1ebb8a=this;var _0x4d0651;for(var _0x31baa7 in this[_0x4ab8('0x23')]){if(this[_0x4ab8('0x23')][_0x4ab8('0x9e')](_0x31baa7)){_0x4d0651=this['campaigns'][_0x31baa7];if(isCampaignIvr(_0x4d0651[_0x4ab8('0x52')])&&isActive(_0x4d0651['active'])){_0x4d0651[_0x4ab8('0xa7')]=!![];BPromise[_0x4ab8('0xbd')]()[_0x4ab8('0xbe')](checkIsActive(_0x4d0651,_0x4d0651[_0x4ab8('0xdd')]))[_0x4ab8('0xbe')](checkInterval(_0x4d0651))[_0x4ab8('0xbe')](_0x1ebb8a[_0x4ab8('0x124')](_0x4d0651))[_0x4ab8('0xbe')](_0x1ebb8a[_0x4ab8('0x128')](_0x4d0651[_0x4ab8('0x145')],_0x4d0651[_0x4ab8('0x146')],_0x4d0651[_0x4ab8('0x44')],_0x4d0651))['then'](_0x1ebb8a['checkIfTimeIntervals'](_0x4d0651['Interval'],_0x4d0651['dialTimezone'],_0x4d0651[_0x4ab8('0x44')],_0x4d0651))[_0x4ab8('0xbe')](_0x1ebb8a[_0x4ab8('0x148')](_0x4d0651))['catch'](loggerCatchQueueSummary(_0x4ab8('0x149'),_0x4d0651));}else{notSendMessagesCampaign(_0x4d0651);}}}};function getCallerIdRandom(_0x44d7cc,_0x3a25ed){var _0x35215a,_0x4cf915,_0x50a609;if(_0x3a25ed<=0x0){_0x3a25ed=0x1;}_0x35215a=new RegExp(_0x4ab8('0x14a')+_0x3a25ed+'}$');_0x4cf915=Math['pow'](0xa,_0x3a25ed-0x1);_0x50a609=Math[_0x4ab8('0x14b')](0xa,_0x3a25ed)-0x1;return util[_0x4ab8('0x81')]('%s',_[_0x4ab8('0x14c')](_0x44d7cc,_0x35215a,_['random'](_0x4cf915,_0x50a609)));}function extractCalleridName(_0x369838){var _0x517701=_0x369838[_0x4ab8('0x14d')](/"(.*?)"/);return _0x517701?_0x517701[0x1]:_0x369838;}function extractCalleridNumber(_0x2b673e){var _0x1c9769=_0x2b673e[_0x4ab8('0x14d')](/<(.*?)>/);return _0x1c9769?_0x1c9769[0x1]:_0x2b673e;}Dialer['prototype'][_0x4ab8('0x14e')]=function(_0x54f02a,_0x5053cc){var _0x147934=this;var _0x27bea1=uuid['v4']();this['actions'][_0x27bea1]=new Action(_0x54f02a,_0x5053cc,_0x27bea1);return new BPromise(function(_0x438c3a,_0x4fd52d){if(_[_0x4ab8('0x42')](_0x54f02a)&&_0x4ab8('0x14f')!==typeof _0x54f02a){return _0x4fd52d(msgResponse(_0x4ab8('0x150'),_0x4ab8('0x12d'),_0x4ab8('0x151')));}if(_[_0x4ab8('0x42')](_0x5053cc[_0x4ab8('0x152')][_0x4ab8('0x153')])||_0x5053cc[_0x4ab8('0x152')][_0x4ab8('0x153')]===null){return _0x4fd52d(msgResponse(_0x4ab8('0x150'),_0x4ab8('0x12d'),'contact\x20is\x20undefine'));}var _0x2192a5={'XMD-CALLERID':_0x147934[_0x4ab8('0x27')][_0x27bea1][_0x4ab8('0x154')](),'XMD-AGI':_0x54f02a['dialQueueProject']?util[_0x4ab8('0x81')](_0x4ab8('0x155'),ipAgi,_0x54f02a[_0x4ab8('0xf8')]):_0x4ab8('0x156'),'XMD-AGIAFTER':_0x54f02a[_0x4ab8('0x100')]?util[_0x4ab8('0x81')](_0x4ab8('0x155'),ipAgi,_0x54f02a['dialQueueProject2']):_0x4ab8('0x156'),'XMD-QUEUE':_0x54f02a['type']===_0x4ab8('0x53')?util[_0x4ab8('0x81')](_0x4ab8('0x157'),_0x54f02a[_0x4ab8('0x44')],_0x54f02a[_0x4ab8('0x158')]||'',_0x54f02a[_0x4ab8('0x101')]?'c':'',_0x54f02a[_0x4ab8('0x159')]||0x3):_0x4ab8('0x156'),'XMD-CONTACTID':_0x5053cc[_0x4ab8('0xd4')],'XMD-CDRTYPE':_0x4ab8('0x8'),'CALLERID(all)':_0x147934[_0x4ab8('0x27')][_0x27bea1][_0x4ab8('0x154')](),'XMD-AMD':_0x54f02a[_0x4ab8('0xe6')]?_0x4ab8('0x15a'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x54f02a[_0x4ab8('0xe6')]){_0x2192a5[_0x4ab8('0x15b')]=_0x54f02a[_0x4ab8('0x15c')]||0x9c4;_0x2192a5[_0x4ab8('0x15d')]=_0x54f02a[_0x4ab8('0x15e')]||0x5dc;_0x2192a5[_0x4ab8('0x15f')]=_0x54f02a[_0x4ab8('0x160')]||0x320;_0x2192a5[_0x4ab8('0x161')]=_0x54f02a[_0x4ab8('0x162')]||0x1388;_0x2192a5[_0x4ab8('0x163')]=_0x54f02a['dialAMDMinWordLength']||0x64;_0x2192a5['XMD-AMDBETWEENWORDSSILENCE']=_0x54f02a[_0x4ab8('0x164')]||0x32;_0x2192a5[_0x4ab8('0x165')]=_0x54f02a['dialAMDMaximumNumberOfWords']||0x3;_0x2192a5['XMD-AMDSILENCETHRESHOLD']=_0x54f02a[_0x4ab8('0x166')]||0x100;_0x2192a5['XMD-AMDMAXIMUMWORDLENGTH']=_0x54f02a[_0x4ab8('0x167')]||0x1388;}if(_0x54f02a[_0x4ab8('0x52')]==='outbound'){_0x2192a5[_0x4ab8('0x168')]=_0x5053cc['VoiceQueueId'];}else{_0x2192a5[_0x4ab8('0x169')]=_0x5053cc[_0x4ab8('0xd7')];}for(var _0x2fcc34 in _0x5053cc[_0x4ab8('0x152')]){if(_0x5053cc['Contact'][_0x4ab8('0x9e')](_0x2fcc34)){if(isNotNull(_0x5053cc[_0x4ab8('0x152')][_0x2fcc34])&&_0x2fcc34!=='id'&&_0x2fcc34!==_0x4ab8('0x16a')&&_0x2fcc34!==_0x4ab8('0x16b')&&_0x2fcc34!==_0x4ab8('0x16c')){_0x2192a5[util[_0x4ab8('0x81')](_0x4ab8('0x16d'),'XMD-',_['toUpper'](_0x2fcc34))]=_0x5053cc[_0x4ab8('0x152')][_0x2fcc34];}}}var _0x3adcdb=_0x147934[_0x4ab8('0xdc')](_0x54f02a['Trunk'])?getCallerId(_0x54f02a[_0x4ab8('0x7f')]['callerid'],_0x54f02a[_0x4ab8('0x60')],_0x54f02a[_0x4ab8('0x16e')]>0x0?getCallerIdRandom(_0x54f02a[_0x4ab8('0x61')],_0x54f02a[_0x4ab8('0x16e')]):_0x54f02a[_0x4ab8('0x61')]):getCallerId(_[_0x4ab8('0xb4')](_0x54f02a['TrunkBackup'])?_0x54f02a[_0x4ab8('0x7f')]['callerid']:_0x54f02a[_0x4ab8('0x125')]['callerid'],_0x54f02a[_0x4ab8('0x60')],_0x54f02a['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x54f02a[_0x4ab8('0x61')],_0x54f02a[_0x4ab8('0x16e')]):_0x54f02a[_0x4ab8('0x61')]);if(_0x3adcdb){_0x2192a5['XMD-ORIGINATECALLERIDNAME']=_0x147934[_0x4ab8('0x27')][_0x27bea1][_0x4ab8('0x16f')]=extractCalleridName(_0x3adcdb);_0x2192a5[_0x4ab8('0x170')]=_0x147934[_0x4ab8('0x27')][_0x27bea1][_0x4ab8('0x171')]=extractCalleridNumber(_0x3adcdb);}return ami[_0x4ab8('0xb5')]({'actionid':_0x27bea1,'action':_0x4ab8('0x150'),'channel':_0x147934['isTrunkReachable'](_0x54f02a[_0x4ab8('0x7f')])?util['format'](_0x4ab8('0x172'),_0x54f02a[_0x4ab8('0x7f')][_0x4ab8('0x44')],isNotNull(_0x54f02a[_0x4ab8('0x62')])?_0x54f02a[_0x4ab8('0x62')][_0x4ab8('0x173')]()||'':'',_0x54f02a[_0x4ab8('0x174')]>0x0?_0x5053cc['Contact'][_0x4ab8('0x153')]['substring'](_0x54f02a[_0x4ab8('0x174')]):_0x5053cc[_0x4ab8('0x152')][_0x4ab8('0x153')]):util[_0x4ab8('0x81')]('SIP/%s/%s%s',_[_0x4ab8('0xb4')](_0x54f02a[_0x4ab8('0x125')])?_0x54f02a[_0x4ab8('0x7f')][_0x4ab8('0x44')]:_0x54f02a[_0x4ab8('0x125')][_0x4ab8('0x44')],isNotNull(_0x54f02a['dialPrefix'])?_0x54f02a[_0x4ab8('0x62')][_0x4ab8('0x173')]()||'':'',_0x54f02a[_0x4ab8('0x174')]>0x0?_0x5053cc[_0x4ab8('0x152')][_0x4ab8('0x153')][_0x4ab8('0x175')](_0x54f02a['dialCutDigit']):_0x5053cc[_0x4ab8('0x152')][_0x4ab8('0x153')]),'callerid':_0x3adcdb,'Exten':_0x4ab8('0x176'),'Context':_0x4ab8('0x177'),'Priority':'1','variable':_0x2192a5,'timeout':(_0x54f02a[_0x4ab8('0x178')]||0x1e)*0x3e8,'async':!![],'channelid':_0x27bea1})[_0x4ab8('0xbe')](function(_0x2b1814){return _0x438c3a(_0x2b1814);})['catch'](function(_0x4fa082){_0x54f02a[_0x4ab8('0x6d')]+=0x1;var _0x53d8b1=new History(_0x147934['actions'][_0x27bea1]);logger[_0x4ab8('0x9a')](util['format'](_0x4ab8('0x179'),JSON[_0x4ab8('0x4e')](_0x4fa082)));_0x53d8b1['state']=0xe;_0x53d8b1[_0x4ab8('0xad')]=_0x4ab8('0x17a');_0x53d8b1[_0x4ab8('0xaf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x53d8b1[_0x4ab8('0xae')]=_0x53d8b1[_0x4ab8('0xaf')];_0x147934['createHistory'](_0x53d8b1)[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0x17b')));_0x147934[_0x4ab8('0xcc')](_0x53d8b1)['catch'](loggerCatch(_0x4ab8('0x17b')))[_0x4ab8('0x1f')](function(){delete _0x147934[_0x4ab8('0x27')][_0x27bea1];return _0x4fd52d(msgResponse('originate',_0x4ab8('0x4d'),_0x4ab8('0x17c')));});});});};Dialer[_0x4ab8('0xb3')]['syncOriginateResponse']=function(_0x3c977a){var _0x5d6170=this[_0x4ab8('0x27')][_0x3c977a[_0x4ab8('0x10e')]];var _0x12699d=this;if(_0x5d6170){delete this[_0x4ab8('0x27')][_0x3c977a[_0x4ab8('0x10e')]];_0x5d6170[_0x4ab8('0x108')]=moment()[_0x4ab8('0x81')](_0x4ab8('0x102'));var _0xbf7076=_0x5d6170[_0x4ab8('0x52')]===_0x4ab8('0x82')?this['campaigns'][_0x5d6170[_0x4ab8('0xba')]]:this[_0x4ab8('0x22')][_0x5d6170[_0x4ab8('0x17d')]()];if(!this[_0x4ab8('0xda')](_0x3c977a[_0x4ab8('0x17e')])){this[_0x4ab8('0xb8')](_0xbf7076);return this['callProgressDetecting'](_0x5d6170,_0xbf7076,_0x3c977a)[_0x4ab8('0xbe')](function(_0x52a94a){})[_0x4ab8('0xb6')](loggerCatch('[callProgressDetecting]\x20'));}else{this[_0x4ab8('0xb1')][_0x3c977a[_0x4ab8('0xe3')]]=_0x5d6170;}}};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x17f')]=function(_0x53f2ad,_0x599f36,_0xf3d8a6){var _0x13c157=new History(_0x599f36);if(_0x13c157[_0x4ab8('0x180')]+_0x13c157[_0x4ab8('0x181')]+_0x13c157[_0x4ab8('0x182')]>=_0xf3d8a6[_0x4ab8('0x183')]-0x1){return!![];}switch(_0x53f2ad){case 0x3:if(_0x13c157['countnoanswerretry']>=_0xf3d8a6[_0x4ab8('0x184')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x13c157['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x4ab8('0x185')](_0xf3d8a6[_0x4ab8('0x186')],_0x4ab8('0x187'))[_0x4ab8('0x81')](_0x4ab8('0x102')),'ContactId':_0x13c157[_0x4ab8('0xd4')],'ListId':_0x13c157[_0x4ab8('0xd5')],'VoiceQueueId':_0x13c157[_0x4ab8('0x118')]||undefined,'CampaignId':_0x13c157[_0x4ab8('0xd7')]||undefined})[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0x188')));}break;case 0x5:if(_0x13c157[_0x4ab8('0x180')]>=_0xf3d8a6[_0x4ab8('0x189')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x13c157[_0x4ab8('0x180')]+=0x1,'scheduledat':moment()['add'](_0xf3d8a6[_0x4ab8('0x18a')],_0x4ab8('0x187'))['format'](_0x4ab8('0x102')),'ContactId':_0x13c157['ContactId'],'ListId':_0x13c157['ListId'],'VoiceQueueId':_0x13c157[_0x4ab8('0x118')]||undefined,'CampaignId':_0x13c157['CampaignId']||undefined})[_0x4ab8('0xb6')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x13c157['countcongestionretry']>=_0xf3d8a6[_0x4ab8('0x18b')]-0x1){return!![];}else{this[_0x4ab8('0xc6')]({'active':![],'countcongestionretry':_0x13c157[_0x4ab8('0x181')]+=0x1,'scheduledat':moment()[_0x4ab8('0x185')](_0xf3d8a6[_0x4ab8('0x18c')],'minutes')['format'](_0x4ab8('0x102')),'ContactId':_0x13c157['ContactId'],'ListId':_0x13c157['ListId'],'VoiceQueueId':_0x13c157[_0x4ab8('0x118')]||undefined,'CampaignId':_0x13c157['CampaignId']||undefined})[_0x4ab8('0xb6')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer['prototype'][_0x4ab8('0x18d')]=function(_0x53f86c,_0x5683ab,_0x298f24){var _0x516bd8=this;var _0x53aa0f=new History(_0x53f86c);return new BPromise(function(_0xee5738,_0x5e180a){if(_[_0x4ab8('0x42')](_0x5683ab)&&_0x4ab8('0x14f')!==typeof _0x5683ab){return _0x5e180a(msgResponse('[callProgressDetecting]','Failure',_0x4ab8('0x18e')));}if(_[_0x4ab8('0x42')](_0x298f24)&&_0x4ab8('0x14f')!==typeof _0x298f24){return _0x5e180a(msgResponse(_0x4ab8('0x18f'),_0x4ab8('0x12d'),'evt\x20is\x20undefine'));}switch(_0x298f24['reason']){case'0':_0x5683ab[_0x4ab8('0x6c')]+=0x1;_0x53aa0f[_0x4ab8('0xe9')]=0x0;_0x53aa0f[_0x4ab8('0xad')]=_0x4ab8('0x190');_0x516bd8[_0x4ab8('0xcd')](_0x53aa0f)[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0x191')));if(_0x516bd8['checkRetriveMax'](0x0,_0x53f86c,_0x5683ab)){if(_0x53aa0f[_0x4ab8('0x180')]+_0x53aa0f[_0x4ab8('0x181')]+_0x53aa0f['countnoanswerretry']>=_0x5683ab[_0x4ab8('0x183')]){_0x516bd8[_0x4ab8('0x192')](_0x53aa0f,_0xee5738,_0x5e180a,_0x4ab8('0x193'));}else{_0x516bd8['createStateFinal'](_0x53aa0f,_0xee5738,_0x5e180a,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x5683ab[_0x4ab8('0x6b')]+=0x1;_0x53aa0f[_0x4ab8('0xe9')]=0x3;_0x53aa0f[_0x4ab8('0xad')]='NoAnswer';_0x53aa0f[_0x4ab8('0x182')]+=0x1;_0x53aa0f[_0x4ab8('0x194')]+=0x1;_0x516bd8[_0x4ab8('0xcd')](_0x53aa0f)[_0x4ab8('0xb6')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x516bd8[_0x4ab8('0x17f')](0x3,_0x53f86c,_0x5683ab)){if(_0x53aa0f[_0x4ab8('0x182')]>=_0x5683ab[_0x4ab8('0x184')]){_0x516bd8[_0x4ab8('0x195')](_0x53aa0f,_0xee5738,_0x5e180a,_0x4ab8('0x196'));}else{_0x516bd8['stateGlobal'](_0x53aa0f,_0xee5738,_0x5e180a,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x5683ab[_0x4ab8('0x66')]+=0x1;_0x53aa0f[_0x4ab8('0xe9')]=0x5;_0x53aa0f[_0x4ab8('0xad')]='Busy';_0x53aa0f[_0x4ab8('0x180')]+=0x1;_0x53aa0f[_0x4ab8('0x194')]+=0x1;_0x516bd8[_0x4ab8('0xcd')](_0x53aa0f)['catch'](loggerCatch(_0x4ab8('0x197')));if(_0x516bd8[_0x4ab8('0x17f')](0x5,_0x53f86c,_0x5683ab)){if(_0x53aa0f[_0x4ab8('0x180')]>=_0x5683ab[_0x4ab8('0x189')]){_0x516bd8[_0x4ab8('0x195')](_0x53aa0f,_0xee5738,_0x5e180a,_0x4ab8('0x198'));}else{_0x516bd8[_0x4ab8('0x192')](_0x53aa0f,_0xee5738,_0x5e180a,'reason\x205\x20busy');}}break;case'8':_0x5683ab[_0x4ab8('0x67')]+=0x1;_0x53aa0f[_0x4ab8('0xe9')]=0x8;_0x53aa0f[_0x4ab8('0xad')]=_0x4ab8('0x199');_0x53aa0f[_0x4ab8('0x181')]+=0x1;_0x53aa0f['countglobal']+=0x1;_0x516bd8[_0x4ab8('0xcd')](_0x53aa0f)[_0x4ab8('0xb6')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x516bd8[_0x4ab8('0x17f')](0x8,_0x53f86c,_0x5683ab)){if(_0x53aa0f['countcongestionretry']>=_0x5683ab[_0x4ab8('0x18b')]){_0x516bd8[_0x4ab8('0x195')](_0x53aa0f,_0xee5738,_0x5e180a,_0x4ab8('0x19a'));}else{_0x516bd8[_0x4ab8('0x192')](_0x53aa0f,_0xee5738,_0x5e180a,_0x4ab8('0x19a'));}}break;default:_0x5683ab[_0x4ab8('0x70')]+=0x1;_0x53aa0f[_0x4ab8('0xe9')]=0xc;_0x53aa0f[_0x4ab8('0xad')]=_0x298f24[_0x4ab8('0xfd')];_0x516bd8[_0x4ab8('0xcd')](_0x53aa0f)[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0x19b')));if(_0x516bd8[_0x4ab8('0x17f')](_0x298f24[_0x4ab8('0xfd')],_0x53f86c,_0x5683ab)){if(_0x53aa0f[_0x4ab8('0x180')]+_0x53aa0f[_0x4ab8('0x181')]+_0x53aa0f[_0x4ab8('0x182')]>=_0x5683ab['dialGlobalMaxRetry']){_0x516bd8[_0x4ab8('0x192')](_0x53aa0f,_0xee5738,_0x5e180a,_0x298f24[_0x4ab8('0xfd')]);}else{_0x516bd8[_0x4ab8('0x195')](_0x53aa0f,_0xee5738,_0x5e180a,_0x298f24[_0x4ab8('0xfd')]);}}}});};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x192')]=function(_0x170ffa,_0x1e0efc,_0x1fc715,_0xc9f1d2){var _0x298add=new Final(_0x170ffa);_0x298add[_0x4ab8('0xe9')]=0xf;_0x298add[_0x4ab8('0xad')]='Global';this[_0x4ab8('0x195')](_0x298add,_0x1e0efc,_0x1fc715,_0xc9f1d2);};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x195')]=function(_0x15357e,_0xfc1eb2,_0x434209,_0x2a8b7a){this['moveContactManagedDialer'](_0x15357e)[_0x4ab8('0xbe')](function(_0x104fd8){return _0xfc1eb2(msgResponse(_0x4ab8('0x18f'),_0x4ab8('0xdb'),_0x2a8b7a));})[_0x4ab8('0xb6')](function(_0x4e137d){return _0x434209(msgResponse(_0x4ab8('0x19c'),_0x4ab8('0x12d'),_0x4ab8('0x19d')));});};Dialer[_0x4ab8('0xb3')][_0x4ab8('0xa')]=function(_0x454089){var _0x391c7e=this;var _0x55808d=_0x454089['dialPredictiveOptimizationPercentage']/0x64;var _0x3673fe=_0x454089[_0x4ab8('0x6a')]/(_0x454089[_0x4ab8('0x6a')]+_0x454089[_0x4ab8('0x64')]);var _0x5722aa=Math[_0x4ab8('0x19e')](_0x454089['predictiveIntervalAvailable']*(_0x454089['predictiveIntervalMaxThreshold']/0x64));var _0x3a3406=Math['round'](_0x454089[_0x4ab8('0x79')]*(_0x454089[_0x4ab8('0x19f')]/0x64));var _0x55d48e=_0x454089[_0x4ab8('0x56')]+_0x454089[_0x4ab8('0x5a')];var _0xa05285=Math[_0x4ab8('0x1a0')](_0x454089[_0x4ab8('0x7c')]*_0x454089[_0x4ab8('0x7d')]*_0x454089[_0x4ab8('0x77')]*_0x454089[_0x4ab8('0x1a1')]);if(_[_0x4ab8('0x42')](_0x454089[_0x4ab8('0x29')])){if(!_[_0x4ab8('0x42')](_0x454089[_0x4ab8('0x95')])){_0x454089[_0x4ab8('0x95')]=undefined;loggerPredictive[_0x4ab8('0x9a')](_0x4ab8('0x1a2'),_0x4ab8('0x1a3'));}if(!_[_0x4ab8('0x42')](_0x454089[_0x4ab8('0x96')])){loggerPredictive[_0x4ab8('0x9a')](_0x4ab8('0x1a2'),_0x4ab8('0x1a4'));clearInterval(_0x454089[_0x4ab8('0x96')]);_0x454089[_0x4ab8('0x96')]=undefined;}_0x454089['startProgressive']=moment()[_0x4ab8('0x81')](_0x4ab8('0x102'));loggerPredictive['info'](_0x454089['name'],_0x4ab8('0x1a5'),_0x454089[_0x4ab8('0x29')]);this[_0x4ab8('0x140')](_0x454089,0x1);}else if(ifInterval(_0x454089[_0x4ab8('0x1a6')],_0x454089[_0x4ab8('0x29')])){this['handlePower'](_0x454089,0x1);loggerPredictiveCalls[_0x4ab8('0x85')](_0x4ab8('0x1a7'),_0x454089[_0x4ab8('0x29')],_0x454089[_0x4ab8('0x44')]);_0x454089[_0x4ab8('0x7c')]=0x0;_0x454089[_0x4ab8('0x1a8')]=0x0;}else if(_0x55808d<_0x3673fe&&_0x454089[_0x4ab8('0x1a9')]==='dropRate'){freeVariablesPredictive(_0x454089);loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x1aa'),_0x4ab8('0x1ab'),_0x3673fe,_0x4ab8('0x29'),_0x454089[_0x4ab8('0x44')]);}else if(_0xa05285<_0x454089[_0x4ab8('0x1a8')]&&_0x454089[_0x4ab8('0x1a9')]===_0x4ab8('0x1ac')){freeVariablesPredictive(_0x454089);loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x1ad'),_0x4ab8('0x1ae'),_0xa05285,_0x4ab8('0x1af'),_0x454089[_0x4ab8('0x1a8')],_0x4ab8('0x29'),_0x454089[_0x4ab8('0x44')]);}else if(!ifInterval(_0x454089[_0x4ab8('0x1a6')],_0x454089[_0x4ab8('0x29')])&&_['isUndefined'](_0x454089['startPredictive'])&&!_[_0x4ab8('0x42')](_0x454089[_0x4ab8('0x29')])){_0x454089['startPredictive']=moment()[_0x4ab8('0x81')](_0x4ab8('0x102'));loggerPredictive[_0x4ab8('0x85')](_0x454089[_0x4ab8('0x44')],_0x4ab8('0x1b0'),_0x454089['startPredictive']);this[_0x4ab8('0xc3')](_0x454089[_0x4ab8('0x1a6')])[_0x4ab8('0xbe')](this[_0x4ab8('0x1b1')](_0x454089))[_0x4ab8('0xbe')](mergeDataErlangB(_0x454089))['then'](this[_0x4ab8('0x1b2')](_0x454089))[_0x4ab8('0xb6')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x454089));}else if(!ifInterval(_0x454089['dialPredictiveInterval'],_0x454089[_0x4ab8('0x95')])){_0x454089[_0x4ab8('0x1a8')]=0x0;_0x454089[_0x4ab8('0x95')]=moment()[_0x4ab8('0x81')](_0x4ab8('0x102'));loggerPredictive[_0x4ab8('0x85')](_0x454089['name'],'recalculate\x20predictive\x20at',_0x454089['startPredictive']);clearInterval(_0x454089[_0x4ab8('0x96')]);_0x454089['handlePredictive']=undefined;this['averageHandleTime'](_0x454089[_0x4ab8('0x1a6')])[_0x4ab8('0xbe')](this[_0x4ab8('0x1b1')](_0x454089))['then'](mergeDataErlangB(_0x454089))[_0x4ab8('0xbe')](this[_0x4ab8('0x1b2')](_0x454089))[_0x4ab8('0xb6')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x454089));}else if(_0x454089['predictiveIntervalAvailable']&&_0x55d48e<_0x454089[_0x4ab8('0x79')]-_0x3a3406){freeVariablesPredictive(_0x454089);loggerPredictive[_0x4ab8('0x85')](_0x454089[_0x4ab8('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x55d48e,_0x4ab8('0x1b3'),_0x454089[_0x4ab8('0x79')],'-',_0x3a3406,'=',_0x454089[_0x4ab8('0x79')]-_0x3a3406,')');}else if(_0x454089['predictiveIntervalAvailable']&&_0x55d48e>_0x454089[_0x4ab8('0x79')]+_0x5722aa){freeVariablesPredictive(_0x454089);loggerPredictive['info'](_0x454089[_0x4ab8('0x44')],_0x4ab8('0x1b4'),_0x55d48e,')\x20are\x20more\x20than\x20threshold\x20(',_0x454089[_0x4ab8('0x79')],'+',_0x5722aa,'=',_0x454089[_0x4ab8('0x79')]+_0x5722aa,')');}};Dialer[_0x4ab8('0xb3')]['getDataPredictive']=function(_0x59ec99){var _0x274be1=this;return function(_0x2d3553){return new BPromise(function(_0x3c00ba,_0x3ddcda){_[_0x4ab8('0x93')](_0x59ec99,_0x2d3553[0x0]);if(checkGetDataPredictive(_0x2d3553[0x0])){var _0x4c3af0=_0x59ec99[_0x4ab8('0x79')]=_0x59ec99[_0x4ab8('0x5a')]+_0x59ec99[_0x4ab8('0x56')];var _0x4d0639=_0x59ec99[_0x4ab8('0x1a6')]*0x3c;var _0x59e8a9=_0x2d3553[0x0][_0x4ab8('0x73')]+_0x2d3553[0x0][_0x4ab8('0x72')];var _0x33159d=(_0x2d3553[0x0][_0x4ab8('0x71')]+_0x2d3553[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2d3553[0x0][_0x4ab8('0x74')])/_0x2d3553[0x0][_0x4ab8('0x7a')];_0x59ec99['predictiveIntervalHitRate']=_0x33159d>0x0?_0x33159d:0x1;switch(_0x59ec99[_0x4ab8('0x1a9')]){case _0x4ab8('0x1ac'):var _0x14ee70=_0x59ec99['dialPredictiveOptimizationPercentage']/0x64;return _0x274be1[_0x4ab8('0x1b5')](_0x4c3af0,_0x4d0639,_0x59e8a9,_0x33159d,_0x14ee70)['then'](function(_0x142b3e){return _0x3c00ba(_0x142b3e);});case'agentBusyFactor':var _0x5df7af=_0x59ec99[_0x4ab8('0x1b6')]/0x64;return _0x274be1[_0x4ab8('0x1b7')](_0x4c3af0,_0x4d0639,_0x59e8a9,_0x33159d,_0x5df7af)[_0x4ab8('0xbe')](function(_0x1f00ff){return _0x3c00ba(_0x1f00ff);});default:return _0x3ddcda(msgResponse(_0x4ab8('0x1b8'),'Failure',_0x4ab8('0x1b9')));}}else{return _0x3ddcda(msgResponse(_0x4ab8('0x1b8'),_0x4ab8('0x12d'),_0x4ab8('0x1ba')));}});};};Dialer[_0x4ab8('0xb3')]['getDataPredictiveOld']=function(_0x55eb66){var _0x65e55e=this;return function(_0x2d89f3){return new BPromise(function(_0x48d787,_0x2ac2ea){_['merge'](_0x55eb66,_0x2d89f3[0x0]);if(checkGetDataPredictive(_0x2d89f3[0x0])){loggerPredictive[_0x4ab8('0x85')](JSON[_0x4ab8('0x4e')](_0x2d89f3[0x0]));if(_0x55eb66[_0x4ab8('0x1a9')]===_0x4ab8('0x1ac')){return _0x65e55e[_0x4ab8('0xca')](_0x55eb66['id'])[_0x4ab8('0xbe')](function(_0x4eff7a){var _0x2cba10=_0x55eb66['loggedIn']-_0x4eff7a[0x0]['outboundQueuePauses'];var _0xff7c=_0x55eb66[_0x4ab8('0x1a6')]*0x3c;var _0x54863a=_0x2d89f3[0x0]['predictiveIntervalAvgTalktime']+_0x2d89f3[0x0]['predictiveIntervalAvgHoldtime'];var _0xf39721=(_0x2d89f3[0x0][_0x4ab8('0x71')]+_0x2d89f3[0x0][_0x4ab8('0x75')]+_0x2d89f3[0x0][_0x4ab8('0x74')])/_0x2d89f3[0x0][_0x4ab8('0x7a')];var _0x376ba8=_0x55eb66[_0x4ab8('0x1b6')]/0x64;_0x55eb66[_0x4ab8('0x78')]=_0x4eff7a[0x0][_0x4ab8('0x1bb')]||0x0;_0x55eb66[_0x4ab8('0x77')]=_0xf39721>0x0?_0xf39721:0x1;return _0x65e55e[_0x4ab8('0x1b5')](_0x2cba10,_0xff7c,_0x54863a,_0xf39721,_0x376ba8);})['then'](function(_0x46b0ba){return _0x48d787(_0x46b0ba);})['catch'](function(_0x17b7af){return _0x2ac2ea(msgResponse(_0x4ab8('0x1bc'),_0x4ab8('0x12d'),JSON['stringify'](_0x17b7af)));});}if(_0x55eb66[_0x4ab8('0x1a9')]===_0x4ab8('0x1bd')){return _0x65e55e['getVoiceQueueRtPauses'](_0x55eb66['id'])['then'](function(_0x124248){var _0x3df412=_0x55eb66[_0x4ab8('0x144')]-_0x124248[0x0]['outboundQueuePauses'];var _0x44cfcf=_0x55eb66[_0x4ab8('0x1a6')]*0x3c;var _0x5de48e=_0x2d89f3[0x0]['predictiveIntervalAvgTalktime']+_0x2d89f3[0x0][_0x4ab8('0x72')];var _0x36b32d=(_0x2d89f3[0x0][_0x4ab8('0x71')]+_0x2d89f3[0x0][_0x4ab8('0x75')]+_0x2d89f3[0x0][_0x4ab8('0x74')])/_0x2d89f3[0x0][_0x4ab8('0x7a')];var _0x483a3f=_0x55eb66[_0x4ab8('0x1b6')]/0x64;_0x55eb66[_0x4ab8('0x78')]=_0x124248[0x0][_0x4ab8('0x1bb')]||0x0;_0x55eb66['predictiveIntervalHitRate']=_0x36b32d>0x0?_0x36b32d:0x1;return _0x65e55e[_0x4ab8('0x1b7')](_0x3df412,_0x44cfcf,_0x5de48e,_0x36b32d,_0x483a3f);})[_0x4ab8('0xbe')](function(_0x54e8ab){return _0x48d787(_0x54e8ab);})['catch'](function(_0x38d3be){return _0x2ac2ea(msgResponse(_0x4ab8('0x1bc'),_0x4ab8('0x12d'),JSON[_0x4ab8('0x4e')](_0x38d3be)));});}}else{return _0x2ac2ea(msgResponse(_0x4ab8('0x1b8'),_0x4ab8('0x12d'),_0x4ab8('0x1ba')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x33192e){var _0xe0cced=this;return function(){var _0x10d4fa=0x0;var _0x6bcc9=Math[_0x4ab8('0x1a0')](_0x33192e[_0x4ab8('0x90')]*0x3e8);if(_0x6bcc9>0x0){_0x6bcc9=_0x6bcc9<0x64?0x64:_0x6bcc9;loggerPredictive[_0x4ab8('0x85')](_0x33192e[_0x4ab8('0x44')],'one\x20call\x20every:',_0x6bcc9,_0x4ab8('0x94'));_0x33192e[_0x4ab8('0x96')]=setInterval(function(){_0xe0cced[_0x4ab8('0x96')](_0x33192e);loggerPredictiveCalls[_0x4ab8('0x85')](_0x4ab8('0x1be'),_0x10d4fa+=0x1);},_0x6bcc9);}else{loggerPredictive['info'](_0x33192e[_0x4ab8('0x44')],_0x4ab8('0x1bf'));}};};Dialer['prototype']['checkContactBlack']=function(_0x2f91c7,_0xc98312){var _0x1a25c1=this;return function(_0x5136c4){if(_['isEmpty'](_0x5136c4)){if(_[_0x4ab8('0xb4')](_0xc98312[_0x4ab8('0xd6')])||!_0xc98312[_0x4ab8('0x1c0')]){if(_0x2f91c7['dialMethod']===_0x4ab8('0x9')){_0x2f91c7['queueStatusComplete']=_['isUndefined'](_0x2f91c7['queueStatusComplete'])?!![]:_0x2f91c7[_0x4ab8('0x114')];var _0x2f162f=uuid['v4']();_0x1a25c1['actions'][_0x2f162f]=new Action(_0x2f91c7,_0xc98312,_0x2f162f);loggerBooked['info'](_0x4ab8('0x1c1'),_0x2f162f,_0x4ab8('0x1c2'),JSON[_0x4ab8('0x4e')](_0x2f91c7[_0x4ab8('0x114')]),_0x4ab8('0x1c3'),_0x2f91c7[_0x4ab8('0x44')]);if(_0x2f91c7[_0x4ab8('0x114')]){_0x2f91c7[_0x4ab8('0x114')]=![];_0x1a25c1[_0x4ab8('0x2b')][_0x1a25c1[_0x4ab8('0x27')][_0x2f162f]['queue']]=[];ami['Action']({'actionid':_0x2f162f,'action':_0x4ab8('0x1c4'),'queue':_0x2f91c7[_0x4ab8('0x44')]})[_0x4ab8('0xb6')](function(_0x27806a){_0x1a25c1['updateOriginated'](_0x2f91c7);_0x1a25c1['rescheduleContact']({'active':![],'ContactId':_0x1a25c1['actions'][_0x2f162f]['ContactId'],'ListId':_0x1a25c1[_0x4ab8('0x27')][_0x2f162f][_0x4ab8('0xd5')],'VoiceQueueId':_0x1a25c1[_0x4ab8('0x27')][_0x2f162f][_0x4ab8('0x118')]||undefined,'CampaignId':_0x1a25c1[_0x4ab8('0x27')][_0x2f162f][_0x4ab8('0xd7')]||undefined})[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0x1c5')));delete _0x1a25c1[_0x4ab8('0x27')][_0x2f162f];});}else{loggerBooked[_0x4ab8('0x85')](_0x4ab8('0x1c6'),JSON[_0x4ab8('0x4e')](_0x2f91c7[_0x4ab8('0x114')]),'Queue:\x20',_0x2f91c7[_0x4ab8('0x44')]);_0x1a25c1['updateOriginated'](_0x2f91c7);_0x1a25c1[_0x4ab8('0xc6')]({'active':![],'ContactId':_0x1a25c1['actions'][_0x2f162f][_0x4ab8('0xd4')],'ListId':_0x1a25c1['actions'][_0x2f162f][_0x4ab8('0xd5')],'VoiceQueueId':_0x1a25c1['actions'][_0x2f162f][_0x4ab8('0x118')]||undefined,'CampaignId':_0x1a25c1[_0x4ab8('0x27')][_0x2f162f][_0x4ab8('0xd7')]||undefined})[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0x1c5')));delete _0x1a25c1['actions'][_0x2f162f];}}else{return _0x1a25c1[_0x4ab8('0x14e')](_0x2f91c7,_0xc98312);}}else{if(getDiff(_0xc98312['scheduledat'])<_0x2f91c7[_0x4ab8('0x1c7')]*0x3c){_0x1a25c1['preview'][_0x4ab8('0x116')](_0xc98312['id'])[_0x4ab8('0x1f')](function(){_0x1a25c1[_0x4ab8('0xb8')](_0x2f91c7);});}else{_0x2f91c7[_0x4ab8('0x6e')]+=0x1;_0x1a25c1[_0x4ab8('0xb8')](_0x2f91c7);if(_0x2f91c7[_0x4ab8('0x1c8')]){_0x1a25c1['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0xc98312[_0x4ab8('0xd4')],'ListId':_0xc98312[_0x4ab8('0xd5')],'VoiceQueueId':_0xc98312['VoiceQueueId']||undefined,'CampaignId':_0xc98312[_0x4ab8('0xd7')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x1a25c1['createHistory'](createObjHistory(_0x2f91c7,_0xc98312,_0x4ab8('0x1c9'),0x17,_0x4ab8('0x1ca')))['catch'](loggerCatch(_0x4ab8('0x1cb')));}else{_0x1a25c1[_0x4ab8('0xe2')](createObjHistory(_0x2f91c7,_0xc98312,_0x4ab8('0x1cc'),0x16,_0x4ab8('0x1cd')),_0x4ab8('0x1ce'),_0x4ab8('0x1cf'));}}}}else{_0x2f91c7[_0x4ab8('0x65')]+=0x1;_0x1a25c1[_0x4ab8('0xe2')](createObjHistory(_0x2f91c7,_0xc98312,_0x4ab8('0x1d0'),0xd,_0x4ab8('0x1d1')),_0x4ab8('0x1d2'),_0x4ab8('0x1d3'));throw'inBlackList';}};};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x143')]=function(_0x4617d9){var _0x4dab64=this;var _0x204c46=[];var _0x52a28f=_0x4617d9['limitCalls']-_0x4617d9[_0x4ab8('0x7b')]-_0x4617d9['temp'];emitCampaignSummary(_0x4617d9);if(_0x52a28f>0x0){if(_0x52a28f>this[_0x4ab8('0x26')]){_0x52a28f=this[_0x4ab8('0x26')];}_0x4617d9[_0x4ab8('0x1d4')]+=_0x52a28f;this[_0x4ab8('0xc9')](_0x4617d9['id'],_0x52a28f,_0x4617d9['dialOrderByScheduledAt'])[_0x4ab8('0xbe')](function(_0x4a2984){_0x4617d9['temp']-=_0x52a28f;_0x4617d9[_0x4ab8('0x1d4')]=_0x4617d9['temp']>0x0?_0x4617d9[_0x4ab8('0x1d4')]:0x0;if(!checkContactEmpty(_0x4a2984)){_0x4617d9[_0x4ab8('0x43')]=_0x4ab8('0xa4');logger[_0x4ab8('0x85')]('[getContactCampaign2][Empty]'+_0x4617d9['name']);}else{_0x4617d9['originated']+=_0x4a2984['length'];_0x4617d9['message']=_0x4ab8('0x1d5');for(var _0x4b48eb=0x0;_0x4b48eb<_0x4a2984[_0x4ab8('0x9d')];_0x4b48eb+=0x1){_0x4617d9[_0x4ab8('0x1d6')]+=0x1;if(_['isNil'](_0x4a2984[_0x4b48eb])||_[_0x4ab8('0xb4')](_0x4a2984[_0x4b48eb][_0x4ab8('0x152')])||_[_0x4ab8('0xb4')](_0x4a2984[_0x4b48eb][_0x4ab8('0x152')][_0x4ab8('0x153')])){_0x4dab64[_0x4ab8('0x1d7')](_0x4ab8('0x1d8'),_0x4617d9,_0x4a2984[_0x4b48eb]);}else{_0x4dab64['checkIsBlackListIvr'](_[_0x4ab8('0xd3')](_0x4a2984[_0x4b48eb],[_0x4ab8('0xd7'),_0x4ab8('0x1d9')]))[_0x4ab8('0xbe')](_0x4dab64[_0x4ab8('0x1da')](_0x4617d9,_0x4a2984[_0x4b48eb]))['catch'](_0x4dab64[_0x4ab8('0xd1')]('[actionOriginateIvr]\x20',_0x4617d9));}}}})[_0x4ab8('0xb6')](loggerGetContactDialer('[getContactCampaign2]',_0x4617d9,_0x52a28f));}};Dialer['prototype']['handlePower']=function(_0x1015c5,_0x367823){var _0x23efbc=this;var _0x5b24aa=[];var _0x5f116a=_0x367823>=0x1?_0x367823:0x1;var _0x15638b=[];if(_0x1015c5['dialMethod']===_0x4ab8('0x9')){_0x5f116a=0x1;}var _0x2be944=Math[_0x4ab8('0x1a0')](_0x1015c5['available']*_0x5f116a)-_0x1015c5[_0x4ab8('0x7b')]-_0x1015c5['temp'];emitVoiceQueueSummary(_0x1015c5);if(_0x1015c5[_0x4ab8('0x1db')]>0x0){var _0x237368=_0x1015c5[_0x4ab8('0x1db')]-_0x1015c5[_0x4ab8('0x7b')]-_0x1015c5['talking']-_0x1015c5['temp']-_0x1015c5[_0x4ab8('0xa6')];if(_0x2be944>_0x237368){_0x2be944=_0x237368;}}if(_0x2be944>0x0){if(_0x1015c5[_0x4ab8('0x5f')]===_0x4ab8('0x9')){_0x2be944=0x1;}if(_0x2be944>this['maxNumberOriginate']){_0x2be944=this[_0x4ab8('0x26')];}_0x1015c5[_0x4ab8('0x1d4')]+=_0x2be944;for(var _0x1670ff in this['agents']){if(this[_0x4ab8('0x24')][_0x4ab8('0x9e')](_0x1670ff)){if(this[_0x4ab8('0x24')][_0x1670ff][_0x4ab8('0xe9')]===_0x4ab8('0x1dc')&&this[_0x4ab8('0x24')][_0x1670ff][_0x4ab8('0xdf')]==='reachable'){_0x5b24aa[_0x4ab8('0x111')](this[_0x4ab8('0x24')][_0x1670ff]['id']);}}}this[_0x4ab8('0xc7')](_0x1015c5['id'],_0x5b24aa,_0x2be944,_0x1015c5[_0x4ab8('0x1dd')])[_0x4ab8('0xbe')](function(_0x7e3f5e){_0x1015c5[_0x4ab8('0x1d4')]-=_0x2be944;_0x1015c5[_0x4ab8('0x1d4')]=_0x1015c5[_0x4ab8('0x1d4')]>0x0?_0x1015c5[_0x4ab8('0x1d4')]:0x0;if(!checkContactEmpty(_0x7e3f5e)){_0x23efbc[_0x4ab8('0xbc')](_0x1015c5)[_0x4ab8('0xbe')](sendMessageReschedule(_0x1015c5))[_0x4ab8('0xb6')](loggerCatch(_0x4ab8('0xbf')));}else{_0x1015c5[_0x4ab8('0x7b')]+=_0x7e3f5e[_0x4ab8('0x9d')];_0x1015c5[_0x4ab8('0x43')]=_0x1015c5['dialMethod']===_0x4ab8('0x9')?_0x4ab8('0x15a'):_0x4ab8('0x1d5');for(var _0x16fb8f=0x0;_0x16fb8f<_0x7e3f5e[_0x4ab8('0x9d')];_0x16fb8f+=0x1){if(_[_0x4ab8('0xb4')](_0x7e3f5e[_0x16fb8f])||_['isNil'](_0x7e3f5e[_0x16fb8f][_0x4ab8('0x152')])||_[_0x4ab8('0xb4')](_0x7e3f5e[_0x16fb8f][_0x4ab8('0x152')][_0x4ab8('0x153')])){_0x23efbc[_0x4ab8('0x1d7')](_0x4ab8('0x1d8'),_0x1015c5,_0x7e3f5e[_0x16fb8f]);}else{_0x23efbc[_0x4ab8('0xc0')](_[_0x4ab8('0xd3')](_0x7e3f5e[_0x16fb8f],[_0x4ab8('0x118'),'Contact.phone']))['then'](_0x23efbc['checkContactBlack'](_0x1015c5,_0x7e3f5e[_0x16fb8f]))[_0x4ab8('0xb6')](_0x23efbc[_0x4ab8('0xd1')](_0x4ab8('0x1d8'),_0x1015c5));}}}})[_0x4ab8('0xb6')](loggerGetContactDialer('[getContactDialer2]',_0x1015c5,_0x2be944));}};Dialer[_0x4ab8('0xb3')]['handlePredictive']=function(_0x43ad85){var _0x30deff=this;if(_0x43ad85[_0x4ab8('0x1db')]>0x0){var _0x2e67d3=_0x43ad85['dialLimitQueue']-_0x43ad85['originated']-_0x43ad85[_0x4ab8('0x5a')];if(_0x2e67d3>0x0){this['tryOriginatePredictive'](_0x43ad85);}else{loggerPredictiveCalls[_0x4ab8('0x85')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x43ad85);}};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x1de')]=function(_0x2d846){var _0x2423cb=this;var _0x40b55a=[];_0x2d846[_0x4ab8('0x7b')]+=0x1;for(var _0x2f7a9e in this[_0x4ab8('0x24')]){if(this['agents'][_0x4ab8('0x9e')](_0x2f7a9e)){if(this[_0x4ab8('0x24')][_0x2f7a9e][_0x4ab8('0xe9')]===_0x4ab8('0x1dc')&&this[_0x4ab8('0x24')][_0x2f7a9e]['status']==='reachable'){_0x40b55a[_0x4ab8('0x111')](this['agents'][_0x2f7a9e]['id']);}}}this[_0x4ab8('0xc7')](_0x2d846['id'],_0x40b55a,0x1,_0x2d846[_0x4ab8('0x1dd')])['then'](function(_0x26e789){if(!checkContactEmpty(_0x26e789)){checkContactLowerLimitOriginate(_0x2d846,0x1,0x0);_0x2423cb['countReScheduled'](_0x2d846)[_0x4ab8('0xbe')](sendMessageReschedule(_0x2d846))['catch'](loggerCatch(_0x4ab8('0xbf')));}else{_0x2d846[_0x4ab8('0x43')]='RUNNING';if(_[_0x4ab8('0xb4')](_0x26e789[0x0])||_[_0x4ab8('0xb4')](_0x26e789[0x0][_0x4ab8('0x152')])||_[_0x4ab8('0xb4')](_0x26e789[0x0][_0x4ab8('0x152')][_0x4ab8('0x153')])){_0x2423cb[_0x4ab8('0x1d7')](_0x4ab8('0x1d8'),_0x2d846,_0x26e789[0x0]);}else{_0x2423cb[_0x4ab8('0xc0')](_['pick'](_0x26e789[0x0],[_0x4ab8('0x118'),_0x4ab8('0x1d9')]))[_0x4ab8('0xbe')](_0x2423cb[_0x4ab8('0x1da')](_0x2d846,_0x26e789[0x0]))[_0x4ab8('0xb6')](_0x2423cb[_0x4ab8('0xd1')]('[actionOriginatePredictive]\x20',_0x2d846));}}})[_0x4ab8('0xb6')](loggerGetContactDialer(_0x4ab8('0x1df'),_0x2d846,0x1));emitVoiceQueueSummary(_0x2d846);};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x1b5')]=function(_0x443e77,_0x1527cb,_0x3910e7,_0x91d461,_0x4a6b07,_0x4c1136){loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x1e0'));loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x1e1'),_0x443e77);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1527cb);loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x1e2'),_0x3910e7);loggerPredictive[_0x4ab8('0x85')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x91d461);loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x1e3'),_0x4a6b07);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x21b0a3,_0x3b0392){if(_0x443e77<=0x0||isNaN(_0x443e77)){return _0x3b0392(msgResponse(_0x4ab8('0x1e4'),_0x4ab8('0x4d'),_0x4ab8('0x1e5')+_0x443e77));}if(_0x3910e7<=0x0||isNaN(_0x3910e7)){return _0x3b0392(msgResponse(_0x4ab8('0x1e4'),'Error',_0x4ab8('0x1e6')+_0x3910e7));}if(_0x91d461<=0x0||isNaN(_0x91d461)){return _0x3b0392(msgResponse('[abandonmentRate]',_0x4ab8('0x4d'),_0x4ab8('0x1e7')+_0x91d461));}if(_0x1527cb<=0x0||isNaN(_0x1527cb)){return _0x3b0392(msgResponse(_0x4ab8('0x1e4'),_0x4ab8('0x4d'),_0x4ab8('0x1e8')+_0x1527cb));}if(_0x4a6b07<=0x0||isNaN(_0x4a6b07)){return _0x3b0392(msgResponse(_0x4ab8('0x1e4'),_0x4ab8('0x4d'),_0x4ab8('0x1e9')+_0x4a6b07));}_0x4c1136=_0x4c1136||0x0;var _0x31c606=0x1/_0x3910e7;var _0x53cf4d=0x0;var _0x49544c=0x0;var _0x7e5927=0x0;var _0x42251a=0x0;for(var _0x5bec60=0x0;_0x7e5927<_0x4a6b07;_0x5bec60+=0x1){_0x49544c=_0x5bec60/_0x1527cb;_0x53cf4d=(_0x91d461*_0x49544c+_0x4c1136)/_0x31c606;_0x7e5927=erlangb(_0x53cf4d,_0x443e77);_0x42251a=_0x53cf4d/_0x443e77*(0x1-erlangb(_0x53cf4d,_0x443e77));}return _0x21b0a3({'erlangCalls':_0x5bec60,'erlangCallToSecond':_0x1527cb/_0x5bec60,'erlangAbandonmentRate':_0x7e5927,'erlangBusyFactor':_0x42251a});});};Dialer[_0x4ab8('0xb3')][_0x4ab8('0x1b7')]=function(_0x2ab0bf,_0x84560,_0x2d0e1a,_0x242590,_0x218570,_0x250c2f){loggerPredictive[_0x4ab8('0x85')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x1e1'),_0x2ab0bf);loggerPredictive['info'](_0x4ab8('0x1ea'),_0x84560);loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x1e2'),_0x2d0e1a);loggerPredictive[_0x4ab8('0x85')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x242590);loggerPredictive['info'](_0x4ab8('0x1eb'),_0x218570);loggerPredictive[_0x4ab8('0x85')](_0x4ab8('0x8b'));return new BPromise(function(_0x17e801,_0x26ac13){if(_0x2ab0bf<=0x0||isNaN(_0x2ab0bf)){return _0x26ac13(msgResponse(_0x4ab8('0x1ec'),_0x4ab8('0x4d'),'m\x20=\x20'+_0x2ab0bf));}if(_0x2d0e1a<=0x0||isNaN(_0x2d0e1a)){return _0x26ac13(msgResponse(_0x4ab8('0x1ec'),_0x4ab8('0x4d'),_0x4ab8('0x1e6')+_0x2d0e1a));}if(_0x242590<=0x0||isNaN(_0x242590)){return _0x26ac13(msgResponse('[busyFactor]',_0x4ab8('0x4d'),_0x4ab8('0x1e7')+_0x242590));}if(_0x84560<=0x0||isNaN(_0x84560)){return _0x26ac13(msgResponse('[busyFactor]','Error',_0x4ab8('0x1e8')+_0x84560));}if(_0x218570<=0x0||isNaN(_0x218570)){return _0x26ac13(msgResponse('[busyFactor]',_0x4ab8('0x4d'),'Umin\x20=\x20'+_0x218570));}_0x250c2f=_0x250c2f||0x0;var _0xd3689e=0x1/_0x2d0e1a;var _0x55f684=0x0;var _0x89754f=0x0;var _0x507881=0x0;var _0x284c24=0x0;for(var _0x546720=0x0;_0x284c24<_0x218570;_0x546720+=0x1){_0x89754f=_0x546720/_0x84560;_0x55f684=(_0x242590*_0x89754f+_0x250c2f)/_0xd3689e;_0x507881=erlangb(_0x55f684,_0x2ab0bf);_0x284c24=_0x55f684/_0x2ab0bf*(0x1-erlangb(_0x55f684,_0x2ab0bf));}return _0x17e801({'erlangCalls':_0x546720,'erlangCallToSecond':_0x84560/_0x546720,'erlangAbandonmentRate':_0x507881,'erlangBusyFactor':_0x284c24});});};module[_0x4ab8('0x1ed')]=Dialer; \ No newline at end of file +var _0x31c9=['startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','isUndefined','message','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','format','voice_queue:save','ivr','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','startPredictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','loopClearZombieChannels','[uniqueid]','clearZombieChannels','[actions]','sequence','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','trunks','reachable','SIP/%s','unmonitored','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','membername','AMD','MACHINE','amd','[syncMachine][createHistory]','[syncMachine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','[syncMachineIvr][createHistory]','[syncMachineIvr]','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','Abandoned','CALLEREXIT','actionid','locked','paused','stateinterface','queueBooked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','CampaignId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','booked','method\x20not\x20recognized','launchHandleIvr','loggedIn','checkIfTime','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','phone','Contact','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','OriginateError','[originate][error]','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','add','dialNoAnswerRetryFrequency','minutes','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','evt\x20is\x20undefine','reason','NoSuchNumber','dialGlobalMaxRetry','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','dialCongestionMaxRetry','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','predictiveIntervalAvailable',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','abandonmentRate','agentBusyFactor','dialPredictiveOptimizationPercentage','busyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','ACTIVE','tryOriginatePredictive','not_inuse','RUNNING','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','lodash','bluebird','uuid','moment','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','rrmemory','roundrobin','prototype','enqueue','tail','finally','voiceQueues','campaigns','agents','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive'];(function(_0x310482,_0x52c7b0){var _0x38a29f=function(_0x427be0){while(--_0x427be0){_0x310482['push'](_0x310482['shift']());}};_0x38a29f(++_0x52c7b0);}(_0x31c9,0x1cc));var _0x931c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x31c9[_0x40a045];return _0x1a687c;};'use strict';var util=require('util');var _=require(_0x931c('0x0'));var BPromise=require(_0x931c('0x1'));var uuid=require(_0x931c('0x2'));var moment=require(_0x931c('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment/');var logger=require(_0x931c('0x4'))(_0x931c('0x5'));var loggerBooked=require(_0x931c('0x4'))('booked');var loggerPredictive=require(_0x931c('0x4'))(_0x931c('0x6'));var loggerPredictiveCalls=require(_0x931c('0x4'))(_0x931c('0x7'));var loggerSyncQueueSummary=require(_0x931c('0x4'))(_0x931c('0x8'));var ami=require(_0x931c('0x9'));config[_0x931c('0xa')]=_[_0x931c('0xb')](config[_0x931c('0xa')],{'host':_0x931c('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x931c('0xd'));var cmHopperFinal=require(_0x931c('0xe'));var cmHopperHistory=require(_0x931c('0xf'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x931c('0x10'));var Action=require(_0x931c('0x11'));var History=require(_0x931c('0x12'));var Final=require(_0x931c('0x13'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x931c('0x14'));var Hangup=require(_0x931c('0x15'));var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0x931c('0x16'),'roundrobin':_0x931c('0x17')};var Sequence=function(){};Sequence[_0x931c('0x18')][_0x931c('0x19')]=function(_0x64bac5){this[_0x931c('0x1a')]=this['tail']?this[_0x931c('0x1a')][_0x931c('0x1b')](_0x64bac5):_0x64bac5();};function Dialer(_0x2b9327,_0x107db2){this['sequence']=new Sequence();this['preview']=_0x107db2;this['voiceQueues']=_0x2b9327[_0x931c('0x1c')];this[_0x931c('0x1d')]=_0x2b9327['campaigns'];this['agents']=_0x2b9327[_0x931c('0x1e')];this['trunks']=_0x2b9327['trunks'];this[_0x931c('0x1f')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x931c('0x20')]={};this[_0x931c('0x21')]={};this[_0x931c('0x22')]={};this[_0x931c('0x23')]={};this['startPredictive']={};this[_0x931c('0x24')]={};this[_0x931c('0x25')]={};this['queueBooked']={};this[_0x931c('0x26')]={};ami['on'](_0x931c('0x27'),this[_0x931c('0x28')][_0x931c('0x29')](this));ami['on'](_0x931c('0x2a'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x931c('0x2b'),this[_0x931c('0x2c')]['bind'](this));ami['on'](_0x931c('0x2d'),this['syncAgentComplete'][_0x931c('0x29')](this));ami['on'](_0x931c('0x2e'),this[_0x931c('0x8')][_0x931c('0x29')](this));ami['on'](_0x931c('0x2f'),this[_0x931c('0x30')][_0x931c('0x29')](this));ami['on'](_0x931c('0x31'),this[_0x931c('0x32')][_0x931c('0x29')](this));ami['on']('varset',this[_0x931c('0x33')][_0x931c('0x29')](this));ami['on'](_0x931c('0x34'),this[_0x931c('0x35')][_0x931c('0x29')](this));ami['on'](_0x931c('0x36'),this[_0x931c('0x37')]['bind'](this));this['loopCampaigns']();this['loopClearZombieChannels']();}function isNotNull(_0x5b123d){return _0x5b123d!==null&&!_[_0x931c('0x38')](_0x5b123d);}function checkIsLoggedIn(_0x2c67b2,_0x140e5e){return function(){if(_0x140e5e<=0x0){_0x2c67b2['message']='AGENTS_NOT_LOGGED';throw _0x2c67b2['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3a3f19){return _0x3a3f19;}function checkIsActive(_0x55f3a5,_0x43940d){return function(){if(!isActive(_0x43940d)){_0x55f3a5[_0x931c('0x39')]=_0x931c('0x3a');throw _0x55f3a5[_0x931c('0x3b')]+_0x931c('0x3c');}};}function checkInterval(_0x295399){return function(){if(!isNotNull(_0x295399[_0x931c('0x3d')])){_0x295399['message']='INTERVAL_IS_NULL';throw _0x295399[_0x931c('0x3b')]+_0x931c('0x3e');}if(!isNotNull(_0x295399[_0x931c('0x3d')][_0x931c('0x3f')])){_0x295399[_0x931c('0x39')]=_0x931c('0x40');throw _0x295399[_0x931c('0x3b')]+_0x931c('0x3e');}if(!isNotNull(_[_0x931c('0x41')](_0x295399[_0x931c('0x3d')][_0x931c('0x3f')]))){_0x295399[_0x931c('0x39')]=_0x931c('0x40');throw _0x295399['name']+_0x931c('0x3e');}};}function msgResponse(_0x478102,_0xfc1e43,_0x1a03a3){return{'action':_0x478102,'response':_0xfc1e43,'message':_0x1a03a3,'stack':_0x1a03a3};}function myreject(_0x557751){return function(_0x596617){return _0x557751(msgResponse(_0x931c('0x42'),_0x931c('0x43'),JSON[_0x931c('0x44')](_0x596617)));};}function getSeconds(_0x3fca68,_0x4a0823){var _0x48f33f=moment(_0x3fca68)[_0x931c('0x45')](0x0);var _0x540d28=moment(_0x4a0823)[_0x931c('0x45')](0x0);return _0x48f33f[_0x931c('0x46')](_0x540d28,_0x931c('0x47'));}function emit(_0x198558,_0x32e8d5,_0x52e5ac){io['to'](_0x198558)[_0x931c('0x48')](_0x32e8d5,_0x52e5ac);}function emitVoiceQueueSummary(_0x1eda13){if(_0x1eda13[_0x931c('0x49')]===_0x931c('0x4a')){var _0x56582c={'id':_0x1eda13['id'],'name':_0x1eda13['name'],'strategy':_0x1eda13[_0x931c('0x4b')],'answered':_0x1eda13[_0x931c('0x4c')],'available':_0x1eda13[_0x931c('0x4d')],'loggedIn':_0x1eda13['loggedIn'],'pTalking':_0x1eda13[_0x931c('0x4e')],'sumBillable':_0x1eda13[_0x931c('0x4f')],'sumDuration':_0x1eda13[_0x931c('0x50')],'sumHoldTime':_0x1eda13[_0x931c('0x51')]||0x0,'talking':_0x1eda13[_0x931c('0x52')],'total':_0x1eda13[_0x931c('0x53')],'type':_0x1eda13[_0x931c('0x49')],'unmanaged':_0x1eda13[_0x931c('0x54')],'abandoned':_0x1eda13['abandoned'],'waiting':_0x1eda13[_0x931c('0x55')],'loggedInDb':_0x1eda13['loggedInDb'],'dialActive':_0x1eda13[_0x931c('0x56')],'dialMethod':_0x1eda13['dialMethod'],'dialOriginateCallerIdName':_0x1eda13['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1eda13[_0x931c('0x57')],'dialOriginateTimeout':_0x1eda13[_0x931c('0x58')],'dialPrefix':_0x1eda13[_0x931c('0x59')],'outboundAnswerAgiCallsDay':_0x1eda13[_0x931c('0x5a')],'outboundAnswerCallsDay':_0x1eda13[_0x931c('0x5b')],'outboundBlacklistCallsDay':_0x1eda13[_0x931c('0x5c')],'outboundBusyCallsDay':_0x1eda13[_0x931c('0x5d')],'outboundCongestionCallsDay':_0x1eda13[_0x931c('0x5e')],'outboundDropCallsDayACS':_0x1eda13[_0x931c('0x5f')],'outboundDropCallsDayCallersExit':_0x1eda13[_0x931c('0x60')],'outboundDropCallsDayTimeout':_0x1eda13[_0x931c('0x61')],'outboundNoAnswerCallsDay':_0x1eda13[_0x931c('0x62')],'outboundNoSuchCallsDay':_0x1eda13[_0x931c('0x63')],'outboundOriginateFailureCallsDay':_0x1eda13[_0x931c('0x64')],'outboundReCallsDay':_0x1eda13[_0x931c('0x65')],'outboundRejectCallsDay':_0x1eda13[_0x931c('0x66')],'outboundUnknownCallsDay':_0x1eda13[_0x931c('0x67')],'predictiveIntervalAnsweredCalls':_0x1eda13[_0x931c('0x68')],'predictiveIntervalAvgHoldtime':_0x1eda13[_0x931c('0x69')],'predictiveIntervalAvgTalktime':_0x1eda13[_0x931c('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x1eda13[_0x931c('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x1eda13['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x1eda13[_0x931c('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x1eda13['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1eda13['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x1eda13[_0x931c('0x6d')],'predictiveIntervalPauses':_0x1eda13[_0x931c('0x6e')],'predictiveIntervalAvailable':_0x1eda13['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x1eda13[_0x931c('0x6f')],'message':_0x1eda13[_0x931c('0x39')],'originated':_0x1eda13[_0x931c('0x70')],'erlangCalls':_0x1eda13[_0x931c('0x71')],'erlangCallToSecond':_0x1eda13[_0x931c('0x72')],'erlangAbandonmentRate':_0x1eda13[_0x931c('0x73')],'erlangBusyFactor':_0x1eda13[_0x931c('0x74')],'startPredictive':_0x1eda13['startPredictive'],'startProgressive':_0x1eda13['startProgressive']};if(_0x1eda13[_0x931c('0x75')]){_0x56582c[_0x931c('0x75')]={'id':_0x1eda13['Trunk']['id'],'name':_0x1eda13['Trunk'][_0x931c('0x3b')],'active':_0x1eda13[_0x931c('0x75')][_0x931c('0x76')],'callerid':_0x1eda13[_0x931c('0x75')][_0x931c('0x77')]};}if(_0x1eda13[_0x931c('0x3d')]){_0x56582c[_0x931c('0x3d')]={'id':_0x1eda13[_0x931c('0x3d')]['id'],'name':_0x1eda13[_0x931c('0x3d')][_0x931c('0x3b')]};}var _0x1e245a=md5(JSON['stringify'](_0x56582c));if(_0x1eda13[_0x931c('0x78')]!==_0x1e245a){_0x1eda13[_0x931c('0x78')]=_0x1e245a;emit(util[_0x931c('0x79')]('voice:queue:%s',_0x56582c[_0x931c('0x3b')]),_0x931c('0x7a'),_0x56582c);}}}function emitCampaignSummary(_0x3eedb1){if(_0x3eedb1['type']===_0x931c('0x7b')){emit(util['format']('campaign:ivr:%s',_0x3eedb1[_0x931c('0x3b')]),_0x931c('0x7c'),_0x3eedb1);}}function checkGetDataPredictive(_0x32cff5){if(isNotNull(_0x32cff5)){if(!_[_0x931c('0x41')](_0x32cff5)){loggerPredictive[_0x931c('0x7d')](_0x931c('0x7e'));loggerPredictive['info'](_0x931c('0x7f'),_0x32cff5[_0x931c('0x6f')]);loggerPredictive[_0x931c('0x7d')](_0x931c('0x80'),_0x32cff5[_0x931c('0x68')]);loggerPredictive[_0x931c('0x7d')](_0x931c('0x81'),_0x32cff5['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x931c('0x7d')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x32cff5['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x931c('0x7d')](_0x931c('0x82'),_0x32cff5['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x931c('0x7d')](_0x931c('0x83'),_0x32cff5[_0x931c('0x6a')]);loggerPredictive['info']('---------------------------');if(_0x32cff5[_0x931c('0x6f')]>0x0){if(!_[_0x931c('0x38')](_0x32cff5[_0x931c('0x6a')])&&_0x32cff5[_0x931c('0x6a')]>0x0){return!![];}else{loggerPredictive['info'](_0x931c('0x84'));}if(!_['isUndefined'](_0x32cff5[_0x931c('0x69')])&&_0x32cff5[_0x931c('0x69')]>0x0){return!![];}else{loggerPredictive[_0x931c('0x7d')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x931c('0x7d')](_0x931c('0x85'));}}else{loggerPredictive[_0x931c('0x7d')](_0x931c('0x86'));}}else{loggerPredictive[_0x931c('0x7d')](_0x931c('0x86'));}return![];}function mergeDataErlangB(_0x50de1a){return function(_0x4d101c){loggerPredictive[_0x931c('0x7d')](_0x931c('0x87'));loggerPredictive[_0x931c('0x7d')](_0x931c('0x88'),_0x4d101c['erlangCalls']);loggerPredictive['info'](_0x931c('0x89'),_0x4d101c['erlangCallToSecond']);loggerPredictive[_0x931c('0x7d')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4d101c[_0x931c('0x73')]);loggerPredictive['info'](_0x931c('0x8a'),_0x4d101c['erlangBusyFactor']);loggerPredictive[_0x931c('0x7d')](_0x931c('0x8b'),_0x4d101c[_0x931c('0x73')]);loggerPredictive[_0x931c('0x7d')](_0x931c('0x8c'));_[_0x931c('0x8d')](_0x50de1a,_0x4d101c);};}function getDiff(_0xebc81c){var _0x471f7a=moment()[_0x931c('0x45')](0x0);var _0x58a27a=moment(_0xebc81c)[_0x931c('0x45')](0x0);return _0x471f7a[_0x931c('0x46')](_0x58a27a,'seconds');}function ifInterval(_0x413121,_0x126d84){if(_[_0x931c('0x38')](_0x126d84)){return![];}if(getDiff(_0x126d84)<_0x413121*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x19601f){if(isNotNull(_0x19601f)){if(!_[_0x931c('0x38')](_0x19601f[_0x931c('0x24')])){_0x19601f[_0x931c('0x24')]=undefined;loggerPredictive['info'](_0x19601f[_0x931c('0x3b')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x931c('0x38')](_0x19601f[_0x931c('0x8e')])){_0x19601f['startPredictive']=undefined;loggerPredictive[_0x931c('0x7d')](_0x19601f['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x931c('0x38')](_0x19601f[_0x931c('0x8f')])){clearInterval(_0x19601f['handlePredictive']);_0x19601f[_0x931c('0x8f')]=undefined;loggerPredictive[_0x931c('0x7d')](_0x19601f[_0x931c('0x3b')],_0x931c('0x90'));}}}function erlangb(_0x1807d8,_0x540f83){if(_0x540f83===0x0){return 0x0;}var _0x73a8bf=0x1;for(var _0x1a9885=0x1;_0x1a9885<=_0x540f83;_0x1a9885+=0x1){_0x73a8bf=0x1+_0x73a8bf*_0x1a9885/_0x1807d8;}return 0x1/_0x73a8bf;}function isVoiceQueueOutbound(_0x5159c4){return _0x5159c4===_0x931c('0x4a');}function isNotPreview(_0x3cec84){return _0x3cec84!==_0x931c('0x91');}function isCampaignIvr(_0x4a6e34){return _0x4a6e34===_0x931c('0x7b');}function getCallerId(_0x583c5f,_0xde681e,_0x552f9c){if(!_[_0x931c('0x38')](_0x552f9c)&&'string'===typeof _0x552f9c&&!_[_0x931c('0x41')](_0x552f9c)){if(!_[_0x931c('0x38')](_0xde681e)&&_0x931c('0x92')===typeof _0xde681e&&!_[_0x931c('0x41')](_0xde681e)){return util['format'](_0x931c('0x93'),_0xde681e,_0x552f9c);}return util[_0x931c('0x79')](_0x931c('0x93'),_0x552f9c,_0x552f9c);}if(!_[_0x931c('0x38')](_0x583c5f)&&_0x931c('0x92')===typeof _0x583c5f&&!_[_0x931c('0x41')](_0x583c5f)){return _0x583c5f;}return _0x931c('0x94');}function loggerCatchQueueSummary(_0x3f7f0d,_0x361df2){return function(_0x5ced3b){freeVariablesPredictive(_0x361df2);emitVoiceQueueSummary(_0x361df2);emitCampaignSummary(_0x361df2);loggerSyncQueueSummary['error'](_0x3f7f0d,util['inspect'](_0x5ced3b,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x46607e,_0x238cb3){return function(_0x1ff739){loggerPredictive[_0x931c('0x95')](_0x238cb3['name'],_0x46607e);loggerPredictive[_0x931c('0x95')](_0x1ff739['stack']);freeVariablesPredictive(_0x238cb3);};}function loggerCatch(_0x5e72b9){return function(_0x122f3a){logger[_0x931c('0x95')](_0x5e72b9,util[_0x931c('0x96')](_0x122f3a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x81a549){return _0x81a549&&!_[_0x931c('0x38')](_0x81a549)&&_0x81a549[_0x931c('0x97')]>0x0;}function decremetOriginate(_0x4dc563){if(!_[_0x931c('0x38')](_0x4dc563)&&_0x4dc563!==null){if(_0x4dc563[_0x931c('0x98')](_0x931c('0x70'))){if(_0x4dc563[_0x931c('0x70')]>0x0){_0x4dc563[_0x931c('0x70')]-=0x1;}else{logger[_0x931c('0x95')](_0x931c('0x99'));}}}else{logger['error'](_0x931c('0x9a'));}}function checkContactLowerLimitOriginate(_0x2266ca,_0x143911,_0x3c1fe3){if(_0x143911>_0x3c1fe3){for(var _0x5cee8d=0x0;_0x5cee8d<_0x143911-_0x3c1fe3;_0x5cee8d+=0x1){decremetOriginate(_0x2266ca);}}}function loggerGetContactDialer(_0x5c8966,_0x1a1cde,_0x330e1a){return function(_0x18734f){checkContactLowerLimitOriginate(_0x1a1cde,_0x330e1a,0x0);logger[_0x931c('0x95')](_0x5c8966,util[_0x931c('0x96')](_0x18734f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x73dc0b){return function(_0x26c5e8){if(isNotNull(_0x26c5e8)&&isNotNull(_0x26c5e8[0x0])){if(_0x26c5e8[0x0][_0x931c('0x9b')]>0x0){_0x73dc0b[_0x931c('0x39')]='RESCHEDULED_CONTACTS';logger[_0x931c('0x7d')](_0x931c('0x9c')+_0x73dc0b[_0x931c('0x3b')],_0x26c5e8[0x0]['contactsRescheduled'],_0x931c('0x9d'));}else{_0x73dc0b[_0x931c('0x39')]=_0x931c('0x9e');logger[_0x931c('0x7d')](_0x931c('0x9f')+_0x73dc0b[_0x931c('0x3b')]);}}};}function notSendMessagesQueue(_0x2fc47a){if(_0x2fc47a[_0x931c('0xa0')]){freeVariablesPredictive(_0x2fc47a);if(_0x2fc47a[_0x931c('0x70')]===0x0&&_0x2fc47a[_0x931c('0x52')]===0x0&&_0x2fc47a[_0x931c('0x55')]===0x0&&(_0x2fc47a[_0x931c('0x4e')]||0x0)===0x0){_0x2fc47a['sendMessageOneNotActive']=![];_0x2fc47a[_0x931c('0x4d')]=0x0;_0x2fc47a[_0x931c('0x39')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x931c('0x95')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2fc47a[_0x931c('0x3b')],_0x931c('0xa1'));}else{_0x2fc47a[_0x931c('0x39')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x931c('0x95')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2fc47a[_0x931c('0x3b')],_0x931c('0xa2'));}emitVoiceQueueSummary(_0x2fc47a);}}function notSendMessagesCampaign(_0x1cfb46){if(_0x1cfb46['sendMessageOneNotActive']){if(_0x1cfb46[_0x931c('0x70')]===0x0){_0x1cfb46['sendMessageOneNotActive']=![];_0x1cfb46[_0x931c('0x39')]=_0x931c('0x3a');loggerSyncQueueSummary[_0x931c('0x95')](_0x931c('0xa3'),_0x1cfb46[_0x931c('0x3b')],_0x931c('0xa1'));}else{_0x1cfb46['message']=_0x931c('0xa4');loggerSyncQueueSummary[_0x931c('0x95')](_0x931c('0xa3'),_0x1cfb46['name'],_0x931c('0xa2'));}emitCampaignSummary(_0x1cfb46);}}function createObjHistory(_0x150737,_0x11db44,_0x564ff9,_0x88aefa,_0x552c36){_0x150737[_0x931c('0x39')]=_0x564ff9;var _0x33cf71=new Action(_0x150737,_0x11db44);var _0x3b86cf=new History(_0x33cf71);_0x3b86cf[_0x931c('0xa5')]=_0x88aefa;_0x3b86cf[_0x931c('0xa6')]=_0x552c36;_0x3b86cf[_0x931c('0xa7')]=_0x33cf71[_0x931c('0xa8')];return _0x3b86cf;}Dialer[_0x931c('0x18')][_0x931c('0xa9')]=function(){var _0x569a56=this;setInterval(function(){_0x569a56['clearZombieChannels'](_0x569a56[_0x931c('0x22')],_0x931c('0xaa'));_0x569a56[_0x931c('0xab')](_0x569a56[_0x931c('0x20')],_0x931c('0xac'));},0x32c8);};Dialer[_0x931c('0x18')][_0x931c('0xab')]=function(_0x2f17ff,_0x4f21f6){var _0x4c90ad=this;for(var _0x2cb3f0 in _0x2f17ff){if(_0x2f17ff[_0x931c('0x98')](_0x2cb3f0)){this[_0x931c('0xad')][_0x931c('0x19')](function(){if(!_[_0x931c('0xae')](_0x2f17ff[_0x2cb3f0])){return ami[_0x931c('0xaf')]({'action':_0x931c('0xb0'),'channel':_0x2f17ff[_0x2cb3f0][_0x931c('0xb1')]})[_0x931c('0xb2')](function(_0x135766){if(_0x135766[_0x931c('0x39')]===_0x931c('0xb3')){setTimeout(function(){if(_0x2f17ff[_0x2cb3f0]&&_0x2f17ff[_0x2cb3f0][_0x931c('0x49')]!=='ivr'){_0x4c90ad[_0x931c('0xb4')](_0x4c90ad[_0x931c('0x1c')][_0x2f17ff[_0x2cb3f0][_0x931c('0xb5')]]);logger[_0x931c('0x95')](_0x931c('0xb6'),_0x4f21f6,_0x2cb3f0,_0x2f17ff[_0x2cb3f0][_0x931c('0xb5')]);delete _0x2f17ff[_0x2cb3f0];}if(_0x2f17ff[_0x2cb3f0]&&_0x2f17ff[_0x2cb3f0][_0x931c('0x49')]==='ivr'){_0x4c90ad['updateOriginated'](_0x4c90ad[_0x931c('0x1d')][_0x2f17ff[_0x2cb3f0]['queue']]);logger[_0x931c('0x95')](_0x931c('0xb7'),_0x4f21f6,_0x2cb3f0,_0x2f17ff[_0x2cb3f0][_0x931c('0xb5')]);delete _0x2f17ff[_0x2cb3f0];}},0x2328);}});}});}}};Dialer[_0x931c('0x18')][_0x931c('0xb8')]=function(_0x219ddb){return BPromise[_0x931c('0xb9')]()[_0x931c('0xba')](cmHopper[_0x931c('0xb8')](_0x219ddb))['catch'](loggerCatch(_0x931c('0xbb')));};Dialer[_0x931c('0x18')][_0x931c('0xbc')]=function(_0x44f472){return BPromise['resolve']()[_0x931c('0xba')](cmHopperBlack['checkIsBlackList'](_0x44f472))[_0x931c('0xb2')](loggerCatch(_0x931c('0xbd')));};Dialer[_0x931c('0x18')][_0x931c('0xbe')]=function(_0x1e05f8){return BPromise[_0x931c('0xb9')]()[_0x931c('0xba')](cmHopperBlack[_0x931c('0xbe')](_0x1e05f8))[_0x931c('0xb2')](loggerCatch(_0x931c('0xbf')));};Dialer[_0x931c('0x18')][_0x931c('0xc0')]=function(_0x2eb3d1){return BPromise[_0x931c('0xb9')]()[_0x931c('0xba')](cmHopperHistory[_0x931c('0xc1')](_0x2eb3d1))[_0x931c('0xb2')](loggerCatch(_0x931c('0xc2')));};Dialer[_0x931c('0x18')][_0x931c('0xc3')]=function(_0x335f67){return BPromise[_0x931c('0xb9')]()[_0x931c('0xba')](cmHopper[_0x931c('0xc3')](_0x335f67))[_0x931c('0xb2')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0x931c('0xc4')]=function(_0x6dfd07,_0x5041e6,_0x4a185b,_0x411112){return BPromise[_0x931c('0xb9')]()[_0x931c('0xba')](cmHopper[_0x931c('0xc4')](_0x6dfd07,_0x5041e6,_0x4a185b,_0x411112))[_0x931c('0xb2')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x931c('0x18')][_0x931c('0xc5')]=function(_0x1dfd1d,_0x2621af,_0x573352){return BPromise['resolve']()['then'](cmHopper[_0x931c('0xc5')](_0x1dfd1d,_0x2621af,_0x573352))['catch'](loggerCatch(_0x931c('0xc6')));};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x365b1d){return BPromise[_0x931c('0xb9')]()[_0x931c('0xba')](voiceQueueRt[_0x931c('0xc7')](_0x365b1d))['catch'](loggerCatch(_0x931c('0xc8')));};Dialer[_0x931c('0x18')][_0x931c('0xc9')]=function(_0x382c76){return BPromise[_0x931c('0xb9')]()[_0x931c('0xba')](cmHopper[_0x931c('0xc9')](_0x382c76))[_0x931c('0xb2')](loggerCatch(_0x931c('0xca')));};Dialer[_0x931c('0x18')][_0x931c('0xcb')]=function(_0x28e9fb){return BPromise['resolve']()[_0x931c('0xba')](cmHopperHistory[_0x931c('0xcb')](_0x28e9fb))[_0x931c('0xb2')](loggerCatch(_0x931c('0xcc')));};Dialer[_0x931c('0x18')]['updateOriginated']=function(_0x5cb2f2){if(!_[_0x931c('0x38')](_0x5cb2f2)&&_0x5cb2f2!==null){if(_0x5cb2f2[_0x931c('0x98')](_0x931c('0x70'))){if(_0x5cb2f2['originated']>0x0){_0x5cb2f2[_0x931c('0x70')]-=0x1;}else{logger[_0x931c('0x95')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x931c('0x95')](_0x931c('0xcd'));}};Dialer['prototype'][_0x931c('0xce')]=function(_0x3ed667,_0x262b64){var _0x3a2936=this;return function(_0x12eb3f){_0x3a2936['updateOriginated'](_0x262b64);logger[_0x931c('0x95')](_0x3ed667,util[_0x931c('0x96')](_0x12eb3f,{'showHidden':![],'depth':null}));};};Dialer[_0x931c('0x18')][_0x931c('0xcf')]=function(_0x558799,_0x28be9c,_0x58e80b){var _0x49a8e7={'state':0x19,'statedesc':_0x931c('0xd0')};this['updateOriginated'](_0x28be9c);this[_0x931c('0xd1')](_[_0x931c('0x8d')](_0x49a8e7,_[_0x931c('0xd2')](_0x58e80b,[_0x931c('0xd3'),_0x931c('0xd4'),_0x931c('0xd5'),_0x931c('0xd6'),'CampaignId'])),_0x931c('0xd7'),_0x931c('0xd8'));logger[_0x931c('0x95')](_0x558799);};Dialer[_0x931c('0x18')][_0x931c('0xd9')]=function(_0x1af192){return _0x1af192===_0x931c('0xda');};Dialer[_0x931c('0x18')][_0x931c('0xdb')]=function(_0x1839e0){return!_[_0x931c('0x38')](_0x1839e0)&&_0x1839e0&&!_[_0x931c('0x38')](_0x1839e0[_0x931c('0x3b')])&&!_[_0x931c('0x38')](_0x1839e0[_0x931c('0x76')])&&_0x1839e0['active']&&(this[_0x931c('0xdc')][util['format']('SIP/%s',_0x1839e0[_0x931c('0x3b')])]['status']===_0x931c('0xdd')||this['trunks'][util['format'](_0x931c('0xde'),_0x1839e0[_0x931c('0x3b')])]['status']===_0x931c('0xdf'));};Dialer['prototype'][_0x931c('0xd1')]=function(_0x236867,_0x553cb7,_0x41249d){this[_0x931c('0xcb')](_0x236867)[_0x931c('0xb2')](loggerCatch(_0x553cb7));this[_0x931c('0xc9')](_0x236867)[_0x931c('0xb2')](loggerCatch(_0x41249d));};Dialer['prototype']['syncVarSet']=function(_0x70a5ac){var _0x194412=this['uniqueId'][_0x70a5ac[_0x931c('0xe0')]];var _0x1e4dcd;if(!_['isNil'](_0x70a5ac)&&!_['isNil'](_0x70a5ac[_0x931c('0xe1')])&&!_['isNil'](_0x70a5ac[_0x931c('0xe1')]['amdstatus'])&&_0x70a5ac[_0x931c('0xe2')]===_0x931c('0xe3')&&_0x194412){if(_0x194412[_0x931c('0x49')]!==_0x931c('0x7b')&&this[_0x931c('0x1c')][_0x194412[_0x931c('0xb5')]][_0x931c('0xe4')]&&_0x70a5ac[_0x931c('0xe5')]===_0x931c('0xe6')){delete this[_0x931c('0x22')][_0x70a5ac[_0x931c('0xe0')]];this[_0x931c('0xb4')](this[_0x931c('0x1c')][_0x194412[_0x931c('0xb5')]]);this[_0x931c('0x1c')][_0x194412[_0x931c('0xb5')]][_0x931c('0x5b')]+=0x1;this[_0x931c('0x1c')][_0x194412[_0x931c('0xb5')]][_0x931c('0x5a')]+=0x1;_0x1e4dcd=new Hangup(_0x194412,_0x70a5ac);_0x1e4dcd[_0x931c('0xa5')]=0x12;_0x1e4dcd['statedesc']='HangupInAMD';_0x1e4dcd[_0x931c('0xe7')]=_0x931c('0xe8');this[_0x931c('0xd1')](_0x1e4dcd,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x194412[_0x931c('0x49')]!==_0x931c('0x7b')&&this['voiceQueues'][_0x194412[_0x931c('0xb5')]][_0x931c('0xe4')]&&_0x70a5ac['value']===_0x931c('0xe9')){delete this[_0x931c('0x22')][_0x70a5ac['uniqueid']];this[_0x931c('0xb4')](this[_0x931c('0x1c')][_0x194412[_0x931c('0xb5')]]);this[_0x931c('0x1c')][_0x194412[_0x931c('0xb5')]][_0x931c('0x5b')]+=0x1;this['voiceQueues'][_0x194412[_0x931c('0xb5')]][_0x931c('0x5a')]+=0x1;_0x1e4dcd=new Hangup(_0x194412,_0x70a5ac);_0x1e4dcd[_0x931c('0xa5')]=0x13;_0x1e4dcd[_0x931c('0xa6')]='Machine';_0x1e4dcd[_0x931c('0xe7')]='AMD';_0x1e4dcd[_0x931c('0xea')]=!![];this[_0x931c('0xd1')](_0x1e4dcd,_0x931c('0xeb'),_0x931c('0xec'));}if(_0x194412[_0x931c('0x49')]===_0x931c('0x7b')&&this[_0x931c('0x1d')][_0x194412['queue']][_0x931c('0xe4')]&&_0x70a5ac[_0x931c('0xe5')]==='HANGUP'){delete this[_0x931c('0x22')][_0x70a5ac[_0x931c('0xe0')]];this[_0x931c('0xb4')](this[_0x931c('0x1d')][_0x194412[_0x931c('0xb5')]]);_0x1e4dcd=new Hangup(_0x194412,_0x70a5ac);_0x1e4dcd['state']=0x12;_0x1e4dcd[_0x931c('0xa6')]=_0x931c('0xed');_0x1e4dcd[_0x931c('0xe7')]=_0x931c('0xe8');this[_0x931c('0xd1')](_0x1e4dcd,_0x931c('0xee'),_0x931c('0xef'));}if(_0x194412[_0x931c('0x49')]===_0x931c('0x7b')&&this[_0x931c('0x1d')][_0x194412['queue']][_0x931c('0xe4')]&&_0x70a5ac[_0x931c('0xe5')]===_0x931c('0xe9')){delete this[_0x931c('0x22')][_0x70a5ac[_0x931c('0xe0')]];this[_0x931c('0xb4')](this[_0x931c('0x1d')][_0x194412[_0x931c('0xb5')]]);_0x1e4dcd=new Hangup(_0x194412,_0x70a5ac);_0x1e4dcd[_0x931c('0xa5')]=0x13;_0x1e4dcd[_0x931c('0xa6')]=_0x931c('0xf0');_0x1e4dcd[_0x931c('0xe7')]=_0x931c('0xe8');_0x1e4dcd['amd']=!![];this[_0x931c('0xd1')](_0x1e4dcd,_0x931c('0xf1'),_0x931c('0xf2'));}}};Dialer[_0x931c('0x18')]['syncHangup']=function(_0x58e553){var _0x45e973=this[_0x931c('0x22')][_0x58e553[_0x931c('0xe0')]];var _0x1249ac=this;var _0x388d83;if(_0x45e973&&_0x45e973['type']===_0x931c('0x7b')){delete this[_0x931c('0x22')][_0x58e553[_0x931c('0xe0')]];this[_0x931c('0xb4')](this['campaigns'][_0x45e973[_0x931c('0xb5')]]);this[_0x931c('0x1d')][_0x45e973['queue']]['ivrAnswerCallsDay']+=0x1;_0x388d83=new Hangup(_0x45e973,_0x58e553);this[_0x931c('0xcb')](_0x388d83)[_0x931c('0xb2')](loggerCatch(_0x931c('0xf3')));this['moveContactManagedDialer'](_0x388d83)[_0x931c('0xb2')](loggerCatch('[syncHangupIvr]'));}if(_0x45e973&&_0x45e973[_0x931c('0x49')]!==_0x931c('0x7b')&&isNotNull(this['voiceQueues'][_0x45e973[_0x931c('0xb5')]][_0x931c('0xf4')])){delete this[_0x931c('0x22')][_0x58e553[_0x931c('0xe0')]];this[_0x931c('0xb4')](this[_0x931c('0x1c')][_0x45e973[_0x931c('0xb5')]]);this[_0x931c('0x1c')][_0x45e973['queue']][_0x931c('0x5b')]+=0x1;this[_0x931c('0x1c')][_0x45e973['queue']][_0x931c('0x5a')]+=0x1;_0x388d83=new Hangup(_0x45e973,_0x58e553);_0x388d83[_0x931c('0xa5')]=0x10;_0x388d83['statedesc']=_0x931c('0xf5');_0x388d83[_0x931c('0xe7')]=_0x931c('0xf6');this['createHistory'](_0x388d83)[_0x931c('0xb2')](loggerCatch(_0x931c('0xf3')));this[_0x931c('0xc9')](_0x388d83)[_0x931c('0xb2')](loggerCatch(_0x931c('0xf7')));}if(_0x45e973&&_0x45e973[_0x931c('0x49')]!==_0x931c('0x7b')&&!isNotNull(this[_0x931c('0x1c')][_0x45e973[_0x931c('0xb5')]][_0x931c('0xf4')])){delete this['uniqueId'][_0x58e553['uniqueid']];this[_0x931c('0xb4')](this[_0x931c('0x1c')][_0x45e973[_0x931c('0xb5')]]);this['voiceQueues'][_0x45e973[_0x931c('0xb5')]]['outboundUnknownCallsDay']+=0x1;_0x388d83=new Hangup(_0x45e973,_0x58e553);_0x388d83[_0x931c('0xa5')]=0xc;_0x388d83[_0x931c('0xa6')]=_0x58e553[_0x931c('0xf8')];_0x388d83[_0x931c('0xe7')]=_0x931c('0xf9');this[_0x931c('0xcb')](_0x388d83)['catch'](loggerCatch(_0x931c('0xf3')));this[_0x931c('0xc9')](_0x388d83)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x931c('0x18')]['syncAgentComplete']=function(_0x5b800d){var _0x29ecf9=this['uniqueId'][_0x5b800d[_0x931c('0xe0')]];var _0x4e400a=this;if(this[_0x931c('0x1c')][_0x5b800d['queue']]){if(_0x29ecf9&&_0x29ecf9[_0x931c('0x49')]!=='ivr'){delete this['uniqueId'][_0x5b800d['uniqueid']];this['voiceQueues'][_0x5b800d[_0x931c('0xb5')]][_0x931c('0x5b')]+=0x1;var _0x3a2b21=new AgentComplete(_0x29ecf9,_0x5b800d);if(_0x5b800d['reason']===_0x931c('0xfa')){_0x3a2b21[_0x931c('0xfb')]=this[_0x931c('0x1c')][_0x5b800d['queue']][_0x931c('0xfc')]&&this[_0x931c('0x1c')][_0x5b800d[_0x931c('0xb5')]][_0x931c('0xfd')]?moment()['format'](_0x931c('0xfe')):undefined;}this[_0x931c('0xcb')](_0x3a2b21)[_0x931c('0xb2')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x931c('0xc9')](_0x3a2b21)[_0x931c('0xb2')](loggerCatch(_0x931c('0xff')));}}};Dialer['prototype'][_0x931c('0x28')]=function(_0x30e553){if(this[_0x931c('0x1c')][_0x30e553['queue']]){if(this[_0x931c('0x22')][_0x30e553[_0x931c('0xe0')]]&&this[_0x931c('0x22')][_0x30e553['uniqueid']]['type']!==_0x931c('0x7b')){this[_0x931c('0xb4')](this[_0x931c('0x1c')][_0x30e553['queue']]);this[_0x931c('0x22')][_0x30e553[_0x931c('0xe0')]][_0x931c('0x100')]=moment()[_0x931c('0x79')](_0x931c('0xfe'));}}};Dialer['prototype'][_0x931c('0x101')]=function(_0x43fe7e){this['createHistory'](_0x43fe7e)[_0x931c('0xb2')](loggerCatch(_0x931c('0x102')));this[_0x931c('0xc9')](_0x43fe7e)[_0x931c('0xb2')](loggerCatch(_0x931c('0x103')));};Dialer[_0x931c('0x18')][_0x931c('0x104')]=function(_0xdbe3c){var _0x13626f=this['uniqueId'][_0xdbe3c[_0x931c('0xe0')]];var _0x16720e=this;if(this[_0x931c('0x1c')][_0xdbe3c['queue']]){if(_0x13626f&&_0x13626f[_0x931c('0x49')]!==_0x931c('0x7b')){delete this['uniqueId'][_0xdbe3c[_0x931c('0xe0')]];this[_0x931c('0xb4')](this[_0x931c('0x1c')][_0xdbe3c[_0x931c('0xb5')]]);_0x13626f[_0x931c('0x105')]=moment()['format'](_0x931c('0xfe'));var _0x273969=new QueueCallerAbandon(_0x13626f,_0xdbe3c);if(getSeconds(_0x13626f['droptime'],_0x13626f[_0x931c('0x106')])>=_0x13626f[_0x931c('0x107')]){this[_0x931c('0x1c')][_0xdbe3c['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x931c('0x1c')][_0xdbe3c['queue']][_0x931c('0x61')]+=0x1;this[_0x931c('0x1c')][_0xdbe3c[_0x931c('0xb5')]][_0x931c('0x108')]+=0x1;_0x273969['state']=0xa;_0x273969[_0x931c('0xa6')]='Drop';_0x273969[_0x931c('0x109')]='TIMEOUT';_0x273969[_0x931c('0xfb')]=this[_0x931c('0x1c')][_0xdbe3c[_0x931c('0xb5')]]['dialQueueProject2']?moment()['format'](_0x931c('0xfe')):undefined;this[_0x931c('0x101')](_0x273969);}else{this[_0x931c('0x1c')][_0xdbe3c[_0x931c('0xb5')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x931c('0x1c')][_0xdbe3c[_0x931c('0xb5')]][_0x931c('0x60')]+=0x1;_0x273969[_0x931c('0xa5')]=0xb;_0x273969['statedesc']=_0x931c('0x10a');_0x273969[_0x931c('0x109')]=_0x931c('0x10b');this[_0x931c('0x101')](_0x273969);}}}};Dialer[_0x931c('0x18')]['syncNewExten']=function(_0x6e25df){if(this[_0x931c('0x20')][_0x6e25df['uniqueid']]){this[_0x931c('0x20')][_0x6e25df[_0x931c('0xe0')]][_0x931c('0xb1')]=_0x6e25df[_0x931c('0xb1')];}if(this[_0x931c('0x22')][_0x6e25df['uniqueid']]){this['uniqueId'][_0x6e25df['uniqueid']][_0x931c('0xb1')]=_0x6e25df[_0x931c('0xb1')];}};Dialer[_0x931c('0x18')][_0x931c('0x35')]=function(_0x37d82d){if(strategy[this['voiceQueues'][this['actions'][_0x37d82d[_0x931c('0x10c')]]['queue']][_0x931c('0x4b')]]===_0x931c('0x17')){if(this['actions'][_0x37d82d[_0x931c('0x10c')]]&&_[_0x931c('0xae')](this[_0x931c('0x20')][_0x37d82d[_0x931c('0x10c')]][_0x931c('0x10d')])&&_0x37d82d[_0x931c('0xb0')]==='1'&&_0x37d82d[_0x931c('0x10e')]==='0'){if(this['agents'][_0x37d82d[_0x931c('0x10f')]]){if(!this[_0x931c('0x1e')][_0x37d82d[_0x931c('0x10f')]][_0x931c('0x10d')]){this['agents'][_0x37d82d[_0x931c('0x10f')]][_0x931c('0x10d')]=!![];this[_0x931c('0x20')][_0x37d82d[_0x931c('0x10c')]][_0x931c('0x10d')]=!![];this[_0x931c('0x20')][_0x37d82d[_0x931c('0x10c')]][_0x931c('0x10f')]=_0x37d82d[_0x931c('0x10f')];}}}}else if((strategy[this[_0x931c('0x1c')][this[_0x931c('0x20')][_0x37d82d[_0x931c('0x10c')]]['queue']][_0x931c('0x4b')]]||'rrmemory')===_0x931c('0x16')){if(this[_0x931c('0x20')][_0x37d82d['actionid']]){if(this[_0x931c('0x1e')][_0x37d82d['stateinterface']]){this['actions'][_0x37d82d[_0x931c('0x10c')]][_0x931c('0x10f')]=_0x37d82d[_0x931c('0x10f')];if(_[_0x931c('0xae')](this['queueBooked'][this[_0x931c('0x20')][_0x37d82d[_0x931c('0x10c')]][_0x931c('0xb5')]])){this['queueBooked'][this[_0x931c('0x20')][_0x37d82d[_0x931c('0x10c')]]['queue']]=[];}this[_0x931c('0x110')][this[_0x931c('0x20')][_0x37d82d[_0x931c('0x10c')]]['queue']][_0x931c('0x111')](_[_0x931c('0x8d')](_[_0x931c('0xd2')](this[_0x931c('0x20')][_0x37d82d['actionid']],[_0x931c('0x112'),_0x931c('0x10f')]),{'status':_0x37d82d[_0x931c('0xb0')],'paused':_0x37d82d[_0x931c('0x10e')]}));}}}};function unlockQueueStatus(_0x26f00b,_0x2f3a7c){setTimeout(function(){if(_[_0x931c('0x38')](_0x26f00b[_0x931c('0x113')])){loggerBooked['error'](_0x931c('0x114'),_0x2f3a7c);}_0x26f00b[_0x931c('0x113')]=!![];loggerBooked[_0x931c('0x7d')]('[booked][unlockQueueStatus]',_0x2f3a7c,JSON[_0x931c('0x44')](_[_0x931c('0xd2')](_0x26f00b,[_0x931c('0x3b'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x931c('0x18')]['syncQueueStatusComplete']=function(_0x27c270){var _0x3c5568=this;var _0x433223=_0x3c5568[_0x931c('0x1c')][_0x3c5568[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]][_0x931c('0xb5')]];if(strategy[this['voiceQueues'][this['actions'][_0x27c270['actionid']]['queue']][_0x931c('0x4b')]]===_0x931c('0x17')){if(this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]]&&this[_0x931c('0x20')][_0x27c270['actionid']][_0x931c('0x10f')]){this[_0x931c('0x91')][_0x931c('0x115')](this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]]['idHopper'],this['actions'][_0x27c270[_0x931c('0x10c')]][_0x931c('0x10f')])[_0x931c('0xb2')](function(_0x20b852){logger['error'](_0x931c('0x116'),util['inspect'](_0x20b852,{'showHidden':![],'depth':null}));})[_0x931c('0x1b')](function(){_0x3c5568[_0x931c('0xb4')](_0x3c5568[_0x931c('0x1c')][_0x3c5568['actions'][_0x27c270[_0x931c('0x10c')]]['queue']]);_0x3c5568[_0x931c('0x1e')][_0x3c5568[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]][_0x931c('0x10f')]]['locked']=![];delete _0x3c5568[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]];unlockQueueStatus(_0x433223);});}else{this['updateOriginated'](this['voiceQueues'][this[_0x931c('0x20')][_0x27c270['actionid']]['queue']]);this[_0x931c('0xc3')]({'active':![],'ContactId':this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]][_0x931c('0xd3')],'ListId':this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]]['ListId'],'VoiceQueueId':this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]][_0x931c('0xd6')]||undefined,'CampaignId':this['actions'][_0x27c270['actionid']][_0x931c('0x117')]||undefined})['catch'](loggerCatch(_0x931c('0x118')));delete this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]];unlockQueueStatus(_0x433223);}}else if((strategy[this[_0x931c('0x1c')][this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]][_0x931c('0xb5')]][_0x931c('0x4b')]]||'rrmemory')==='rrmemory'){var _0x28a4a7;if(this['actions'][_0x27c270[_0x931c('0x10c')]]&&!_[_0x931c('0x41')](this['queueBooked'][this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]][_0x931c('0xb5')]])){if(this['queueBookedRR'][_0x3c5568[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]][_0x931c('0xb5')]]){this[_0x931c('0x26')][_0x3c5568[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]]['queue']]=this[_0x931c('0x26')][this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]][_0x931c('0xb5')]]?this['queueBookedRR'][this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]][_0x931c('0xb5')]]:this[_0x931c('0x110')][this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]]['queue']]?this[_0x931c('0x110')][this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]]['queue']][_0x931c('0x119')]||0x0:0x0;}this['queueBooked'][this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]][_0x931c('0xb5')]][_0x931c('0x119')]=this[_0x931c('0x26')][this[_0x931c('0x20')][_0x27c270[_0x931c('0x10c')]][_0x931c('0xb5')]];for(var _0x102836=0x0;_0x102836=0x0?!![]:![];})[_0x931c('0xb2')](myreject(_0x19f0cb)));}}else{_0x215204['push'](ami[_0x931c('0xaf')]({'action':_0x931c('0x12e'),'command':util[_0x931c('0x79')](_0x931c('0x12f'),_0x1a751f,!_['isUndefined'](config['timezones'][_0x141444])?_0x141444:'')})['then'](function(_0x449683){return _0x449683[_0x931c('0x131')]['indexOf'](_0x931c('0x133'))>=0x0?!![]:![];})[_0x931c('0xb2')](myreject(_0x19f0cb)));}BPromise[_0x931c('0x134')](_0x215204)[_0x931c('0xba')](function(_0x511962){var _0x2f4492=_[_0x931c('0x135')](_0x511962);if(_0x2f4492){return _0x206c00(_0x2f4492);}else{_0x1de844[_0x931c('0x39')]=_0x3adf7d?_0x931c('0x136'):'INTERVAL_IS_OVERTIME';return _0x19f0cb(msgResponse(_0x931c('0x137'),_0x931c('0x127'),_0x931c('0x138')+_0x3adf7d+'\x20'+_0x191c30+_0x931c('0x139')+util[_0x931c('0x96')](_0x1a751f,{'showHidden':![],'depth':null})+_0x931c('0x13a')+_0x141444));}})[_0x931c('0xb2')](function(_0x1cc371){return _0x19f0cb(msgResponse(_0x931c('0x126'),_0x931c('0x127'),JSON[_0x931c('0x44')](_0x1cc371)));});});};Dialer[_0x931c('0x18')][_0x931c('0x13b')]=function(_0xa5e4f4){var _0x519cdd=this;return function(){switch(_0xa5e4f4[_0x931c('0x13c')]){case _0x931c('0x13d'):freeVariablesPredictive(_0xa5e4f4);_0x519cdd[_0x931c('0x13e')](_0xa5e4f4,0x1);break;case _0x931c('0x13f'):freeVariablesPredictive(_0xa5e4f4);_0x519cdd['handlePower'](_0xa5e4f4,_0xa5e4f4['dialPowerLevel']);break;case'predictive':_0x519cdd[_0x931c('0x6')](_0xa5e4f4);break;case _0x931c('0x140'):freeVariablesPredictive(_0xa5e4f4);_0x519cdd['handlePower'](_0xa5e4f4,0x1);break;default:freeVariablesPredictive(_0xa5e4f4);logger[_0x931c('0x95')]('Queue',_0xa5e4f4['name'],_0x931c('0x141'));}};};Dialer[_0x931c('0x18')][_0x931c('0x142')]=function(_0x2a2ac6){var _0x55603d=this;return function(){_0x55603d['handleIvr'](_0x2a2ac6);};};Dialer[_0x931c('0x18')][_0x931c('0x8')]=function(_0xe46134){var _0xb3cf7b=this;if(isNotPreview(_0xe46134[_0x931c('0x13c')])){if(isVoiceQueueOutbound(_0xe46134[_0x931c('0x49')])&&isActive(_0xe46134[_0x931c('0x56')])){_0xe46134[_0x931c('0xa0')]=!![];BPromise['resolve']()[_0x931c('0xba')](checkIsLoggedIn(_0xe46134,_0xe46134[_0x931c('0x143')]))[_0x931c('0xba')](checkIsActive(_0xe46134,_0xe46134[_0x931c('0x56')]))[_0x931c('0xba')](checkInterval(_0xe46134))['then'](_0xb3cf7b[_0x931c('0x123')](_0xe46134))[_0x931c('0xba')](_0xb3cf7b[_0x931c('0x144')](_0xe46134[_0x931c('0x145')],_0xe46134['dialTimezone'],_0xe46134[_0x931c('0x3b')],_0xe46134))['then'](_0xb3cf7b[_0x931c('0x125')](_0xe46134['Interval'],_0xe46134[_0x931c('0x146')],_0xe46134[_0x931c('0x3b')],_0xe46134))['then'](_0xb3cf7b['checkDialMethod'](_0xe46134))[_0x931c('0xb2')](loggerCatchQueueSummary(_0x931c('0x147'),_0xe46134));}else{notSendMessagesQueue(_0xe46134);}}else{freeVariablesPredictive(_0xe46134);}};Dialer['prototype']['syncCampaigns']=function(){var _0x9cdc52=this;var _0xb2d7f0;for(var _0x2091c2 in this[_0x931c('0x1d')]){if(this[_0x931c('0x1d')][_0x931c('0x98')](_0x2091c2)){_0xb2d7f0=this[_0x931c('0x1d')][_0x2091c2];if(isCampaignIvr(_0xb2d7f0[_0x931c('0x49')])&&isActive(_0xb2d7f0[_0x931c('0x76')])){_0xb2d7f0[_0x931c('0xa0')]=!![];BPromise[_0x931c('0xb9')]()[_0x931c('0xba')](checkIsActive(_0xb2d7f0,_0xb2d7f0[_0x931c('0x76')]))[_0x931c('0xba')](checkInterval(_0xb2d7f0))[_0x931c('0xba')](_0x9cdc52[_0x931c('0x123')](_0xb2d7f0))[_0x931c('0xba')](_0x9cdc52[_0x931c('0x144')](_0xb2d7f0[_0x931c('0x145')],_0xb2d7f0[_0x931c('0x146')],_0xb2d7f0[_0x931c('0x3b')],_0xb2d7f0))[_0x931c('0xba')](_0x9cdc52[_0x931c('0x125')](_0xb2d7f0[_0x931c('0x3d')],_0xb2d7f0['dialTimezone'],_0xb2d7f0[_0x931c('0x3b')],_0xb2d7f0))[_0x931c('0xba')](_0x9cdc52['launchHandleIvr'](_0xb2d7f0))[_0x931c('0xb2')](loggerCatchQueueSummary(_0x931c('0x148'),_0xb2d7f0));}else{notSendMessagesCampaign(_0xb2d7f0);}}}};function getCallerIdRandom(_0x574ea3,_0x2f75ec){var _0x2177b3,_0x1b4fc8,_0x156387;if(_0x2f75ec<=0x0){_0x2f75ec=0x1;}_0x2177b3=new RegExp(_0x931c('0x149')+_0x2f75ec+'}$');_0x1b4fc8=Math[_0x931c('0x14a')](0xa,_0x2f75ec-0x1);_0x156387=Math[_0x931c('0x14a')](0xa,_0x2f75ec)-0x1;return util['format']('%s',_[_0x931c('0x14b')](_0x574ea3,_0x2177b3,_[_0x931c('0x14c')](_0x1b4fc8,_0x156387)));}function extractCalleridName(_0x52ae7c){var _0x34bb5c=_0x52ae7c[_0x931c('0x14d')](/"(.*?)"/);return _0x34bb5c?_0x34bb5c[0x1]:_0x52ae7c;}function extractCalleridNumber(_0xfa027e){var _0x46de4c=_0xfa027e[_0x931c('0x14d')](/<(.*?)>/);return _0x46de4c?_0x46de4c[0x1]:_0xfa027e;}Dialer[_0x931c('0x18')][_0x931c('0x14e')]=function(_0x2cd86a,_0x1d4fec){var _0x1f5aeb=this;var _0x364223=uuid['v4']();this[_0x931c('0x20')][_0x364223]=new Action(_0x2cd86a,_0x1d4fec,_0x364223);return new BPromise(function(_0x206b5e,_0x577dd3){if(_['isUndefined'](_0x2cd86a)&&_0x931c('0x14f')!==typeof _0x2cd86a){return _0x577dd3(msgResponse('originate','Failure','voiceQueue\x20is\x20undefine'));}if(_[_0x931c('0x38')](_0x1d4fec['Contact'][_0x931c('0x150')])||_0x1d4fec[_0x931c('0x151')][_0x931c('0x150')]===null){return _0x577dd3(msgResponse(_0x931c('0x152'),_0x931c('0x127'),_0x931c('0x153')));}var _0x363f26={'XMD-CALLERID':_0x1f5aeb[_0x931c('0x20')][_0x364223]['getCaller'](),'XMD-AGI':_0x2cd86a['dialQueueProject']?util[_0x931c('0x79')](_0x931c('0x154'),ipAgi,_0x2cd86a[_0x931c('0xf4')]):'NONE','XMD-AGIAFTER':_0x2cd86a[_0x931c('0xfc')]?util[_0x931c('0x79')](_0x931c('0x154'),ipAgi,_0x2cd86a[_0x931c('0xfc')]):_0x931c('0x155'),'XMD-QUEUE':_0x2cd86a[_0x931c('0x49')]===_0x931c('0x4a')?util['format'](_0x931c('0x156'),_0x2cd86a[_0x931c('0x3b')],_0x2cd86a[_0x931c('0x157')]||'',_0x2cd86a[_0x931c('0xfd')]?'c':'',_0x2cd86a[_0x931c('0x107')]||0x3):_0x931c('0x155'),'XMD-CONTACTID':_0x1d4fec['ContactId'],'XMD-CDRTYPE':_0x931c('0x5'),'CALLERID(all)':_0x1f5aeb[_0x931c('0x20')][_0x364223][_0x931c('0x158')](),'XMD-AMD':_0x2cd86a[_0x931c('0xe4')]?'ACTIVE':_0x931c('0x155'),'XMD-DESTINATION':_0x931c('0xe3')};if(_0x2cd86a[_0x931c('0xe4')]){_0x363f26[_0x931c('0x159')]=_0x2cd86a[_0x931c('0x15a')]||0x9c4;_0x363f26[_0x931c('0x15b')]=_0x2cd86a[_0x931c('0x15c')]||0x5dc;_0x363f26[_0x931c('0x15d')]=_0x2cd86a[_0x931c('0x15e')]||0x320;_0x363f26[_0x931c('0x15f')]=_0x2cd86a['dialAMDTotalAnalysisTime']||0x1388;_0x363f26['XMD-AMDMINWORDLENGTH']=_0x2cd86a[_0x931c('0x160')]||0x64;_0x363f26[_0x931c('0x161')]=_0x2cd86a['dialAMDBetweenWordsSilence']||0x32;_0x363f26['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x2cd86a[_0x931c('0x162')]||0x3;_0x363f26[_0x931c('0x163')]=_0x2cd86a[_0x931c('0x164')]||0x100;_0x363f26[_0x931c('0x165')]=_0x2cd86a[_0x931c('0x166')]||0x1388;}if(_0x2cd86a['type']===_0x931c('0x4a')){_0x363f26['XMD-VOICEQUEUEID']=_0x1d4fec[_0x931c('0xd6')];}else{_0x363f26[_0x931c('0x167')]=_0x1d4fec[_0x931c('0x117')];}for(var _0x52e91f in _0x1d4fec[_0x931c('0x151')]){if(_0x1d4fec['Contact']['hasOwnProperty'](_0x52e91f)){if(isNotNull(_0x1d4fec[_0x931c('0x151')][_0x52e91f])&&_0x52e91f!=='id'&&_0x52e91f!==_0x931c('0x168')&&_0x52e91f!==_0x931c('0x169')&&_0x52e91f!==_0x931c('0x16a')){_0x363f26[util['format'](_0x931c('0x16b'),_0x931c('0x16c'),_[_0x931c('0x16d')](_0x52e91f))]=_0x1d4fec[_0x931c('0x151')][_0x52e91f];}}}var _0x59fb2d=_0x1f5aeb[_0x931c('0xdb')](_0x2cd86a[_0x931c('0x75')])?getCallerId(_0x2cd86a[_0x931c('0x75')][_0x931c('0x77')],_0x2cd86a[_0x931c('0x16e')],_0x2cd86a[_0x931c('0x16f')]>0x0?getCallerIdRandom(_0x2cd86a[_0x931c('0x57')],_0x2cd86a[_0x931c('0x16f')]):_0x2cd86a['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x2cd86a[_0x931c('0x170')])?_0x2cd86a['Trunk'][_0x931c('0x77')]:_0x2cd86a['TrunkBackup'][_0x931c('0x77')],_0x2cd86a[_0x931c('0x16e')],_0x2cd86a['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x2cd86a[_0x931c('0x57')],_0x2cd86a[_0x931c('0x16f')]):_0x2cd86a['dialOriginateCallerIdNumber']);if(_0x59fb2d){_0x363f26[_0x931c('0x171')]=_0x1f5aeb[_0x931c('0x20')][_0x364223]['originatecalleridname']=extractCalleridName(_0x59fb2d);_0x363f26['XMD-ORIGINATECALLERIDNUM']=_0x1f5aeb[_0x931c('0x20')][_0x364223][_0x931c('0x172')]=extractCalleridNumber(_0x59fb2d);}return ami['Action']({'actionid':_0x364223,'action':'originate','channel':_0x1f5aeb[_0x931c('0xdb')](_0x2cd86a[_0x931c('0x75')])?util[_0x931c('0x79')](_0x931c('0x173'),_0x2cd86a[_0x931c('0x75')][_0x931c('0x3b')],isNotNull(_0x2cd86a[_0x931c('0x59')])?_0x2cd86a['dialPrefix'][_0x931c('0x174')]()||'':'',_0x2cd86a[_0x931c('0x175')]>0x0?_0x1d4fec['Contact'][_0x931c('0x150')][_0x931c('0x176')](_0x2cd86a[_0x931c('0x175')]):_0x1d4fec[_0x931c('0x151')][_0x931c('0x150')]):util[_0x931c('0x79')]('SIP/%s/%s%s',_[_0x931c('0xae')](_0x2cd86a[_0x931c('0x170')])?_0x2cd86a['Trunk'][_0x931c('0x3b')]:_0x2cd86a[_0x931c('0x170')][_0x931c('0x3b')],isNotNull(_0x2cd86a[_0x931c('0x59')])?_0x2cd86a[_0x931c('0x59')][_0x931c('0x174')]()||'':'',_0x2cd86a[_0x931c('0x175')]>0x0?_0x1d4fec['Contact'][_0x931c('0x150')][_0x931c('0x176')](_0x2cd86a[_0x931c('0x175')]):_0x1d4fec[_0x931c('0x151')][_0x931c('0x150')]),'callerid':_0x59fb2d,'Exten':_0x931c('0xe3'),'Context':'from-sip','Priority':'1','variable':_0x363f26,'timeout':(_0x2cd86a[_0x931c('0x58')]||0x1e)*0x3e8,'async':!![],'channelid':_0x364223})[_0x931c('0xba')](function(_0x47e2af){return _0x206b5e(_0x47e2af);})[_0x931c('0xb2')](function(_0x5dab1e){_0x2cd86a[_0x931c('0x64')]+=0x1;var _0x2f9fe8=new History(_0x1f5aeb[_0x931c('0x20')][_0x364223]);logger['error'](util[_0x931c('0x79')]('[originateError]:\x20%s',JSON[_0x931c('0x44')](_0x5dab1e)));_0x2f9fe8[_0x931c('0xa5')]=0xe;_0x2f9fe8[_0x931c('0xa6')]=_0x931c('0x177');_0x2f9fe8['starttime']=moment()[_0x931c('0x79')](_0x931c('0xfe'));_0x2f9fe8[_0x931c('0xa7')]=_0x2f9fe8[_0x931c('0xa8')];_0x1f5aeb[_0x931c('0xcb')](_0x2f9fe8)[_0x931c('0xb2')](loggerCatch(_0x931c('0x178')));_0x1f5aeb[_0x931c('0xc9')](_0x2f9fe8)[_0x931c('0xb2')](loggerCatch(_0x931c('0x178')))[_0x931c('0x1b')](function(){delete _0x1f5aeb[_0x931c('0x20')][_0x364223];return _0x577dd3(msgResponse('originate','Error','originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x931c('0x2c')]=function(_0x339957){var _0x3bbaa5=this[_0x931c('0x20')][_0x339957[_0x931c('0x10c')]];var _0x3e3342=this;if(_0x3bbaa5){delete this[_0x931c('0x20')][_0x339957['actionid']];_0x3bbaa5['responsetime']=moment()[_0x931c('0x79')](_0x931c('0xfe'));var _0x2fe8db=_0x3bbaa5[_0x931c('0x49')]===_0x931c('0x7b')?this['campaigns'][_0x3bbaa5[_0x931c('0xb5')]]:this[_0x931c('0x1c')][_0x3bbaa5[_0x931c('0x179')]()];if(!this['isSuccess'](_0x339957['response'])){this['updateOriginated'](_0x2fe8db);return this[_0x931c('0x17a')](_0x3bbaa5,_0x2fe8db,_0x339957)['then'](function(_0xc5df02){})[_0x931c('0xb2')](loggerCatch(_0x931c('0x17b')));}else{this[_0x931c('0x22')][_0x339957[_0x931c('0xe0')]]=_0x3bbaa5;}}};Dialer[_0x931c('0x18')][_0x931c('0x17c')]=function(_0x32a8fc,_0x6e08dd,_0x2877fb){var _0x58c991=new History(_0x6e08dd);if(_0x58c991[_0x931c('0x17d')]+_0x58c991[_0x931c('0x17e')]+_0x58c991[_0x931c('0x17f')]>=_0x2877fb['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x32a8fc){case 0x3:if(_0x58c991['countnoanswerretry']>=_0x2877fb['dialNoAnswerMaxRetry']-0x1){return!![];}else{this[_0x931c('0xc3')]({'active':![],'countnoanswerretry':_0x58c991[_0x931c('0x17f')]+=0x1,'scheduledat':moment()[_0x931c('0x180')](_0x2877fb[_0x931c('0x181')],_0x931c('0x182'))[_0x931c('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x58c991[_0x931c('0xd3')],'ListId':_0x58c991['ListId'],'VoiceQueueId':_0x58c991[_0x931c('0xd6')]||undefined,'CampaignId':_0x58c991[_0x931c('0x117')]||undefined})[_0x931c('0xb2')](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x58c991[_0x931c('0x17d')]>=_0x2877fb[_0x931c('0x183')]-0x1){return!![];}else{this[_0x931c('0xc3')]({'active':![],'countbusyretry':_0x58c991[_0x931c('0x17d')]+=0x1,'scheduledat':moment()[_0x931c('0x180')](_0x2877fb[_0x931c('0x184')],_0x931c('0x182'))[_0x931c('0x79')](_0x931c('0xfe')),'ContactId':_0x58c991['ContactId'],'ListId':_0x58c991[_0x931c('0xd4')],'VoiceQueueId':_0x58c991[_0x931c('0xd6')]||undefined,'CampaignId':_0x58c991[_0x931c('0x117')]||undefined})[_0x931c('0xb2')](loggerCatch(_0x931c('0x185')));}break;case 0x8:if(_0x58c991['countcongestionretry']>=_0x2877fb['dialCongestionMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x58c991[_0x931c('0x17e')]+=0x1,'scheduledat':moment()[_0x931c('0x180')](_0x2877fb[_0x931c('0x186')],'minutes')[_0x931c('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x58c991[_0x931c('0xd3')],'ListId':_0x58c991[_0x931c('0xd4')],'VoiceQueueId':_0x58c991['VoiceQueueId']||undefined,'CampaignId':_0x58c991[_0x931c('0x117')]||undefined})[_0x931c('0xb2')](loggerCatch(_0x931c('0x187')));}break;default:return!![];}};Dialer[_0x931c('0x18')][_0x931c('0x17a')]=function(_0x27defc,_0x54d368,_0x2ffcea){var _0x41eafa=this;var _0x300ad5=new History(_0x27defc);return new BPromise(function(_0x141a54,_0x328691){if(_['isUndefined'](_0x54d368)&&_0x931c('0x14f')!==typeof _0x54d368){return _0x328691(msgResponse(_0x931c('0x188'),_0x931c('0x127'),'entity\x20is\x20undefine'));}if(_[_0x931c('0x38')](_0x2ffcea)&&_0x931c('0x14f')!==typeof _0x2ffcea){return _0x328691(msgResponse('[callProgressDetecting]',_0x931c('0x127'),_0x931c('0x189')));}switch(_0x2ffcea[_0x931c('0x18a')]){case'0':_0x54d368['outboundNoSuchCallsDay']+=0x1;_0x300ad5['state']=0x0;_0x300ad5[_0x931c('0xa6')]=_0x931c('0x18b');_0x41eafa[_0x931c('0xcb')](_0x300ad5)[_0x931c('0xb2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x41eafa[_0x931c('0x17c')](0x0,_0x27defc,_0x54d368)){if(_0x300ad5[_0x931c('0x17d')]+_0x300ad5['countcongestionretry']+_0x300ad5[_0x931c('0x17f')]>=_0x54d368[_0x931c('0x18c')]){_0x41eafa[_0x931c('0x18d')](_0x300ad5,_0x141a54,_0x328691,_0x931c('0x18e'));}else{_0x41eafa[_0x931c('0x18f')](_0x300ad5,_0x141a54,_0x328691,_0x931c('0x18e'));}}break;case'3':_0x54d368['outboundNoAnswerCallsDay']+=0x1;_0x300ad5[_0x931c('0xa5')]=0x3;_0x300ad5['statedesc']=_0x931c('0x190');_0x300ad5[_0x931c('0x17f')]+=0x1;_0x300ad5[_0x931c('0x191')]+=0x1;_0x41eafa[_0x931c('0xcb')](_0x300ad5)[_0x931c('0xb2')](loggerCatch(_0x931c('0x192')));if(_0x41eafa['checkRetriveMax'](0x3,_0x27defc,_0x54d368)){if(_0x300ad5[_0x931c('0x17f')]>=_0x54d368[_0x931c('0x193')]){_0x41eafa[_0x931c('0x18f')](_0x300ad5,_0x141a54,_0x328691,'reason\x203\x20ringing\x20no\x20answer');}else{_0x41eafa['stateGlobal'](_0x300ad5,_0x141a54,_0x328691,_0x931c('0x194'));}}break;case'5':_0x54d368[_0x931c('0x5d')]+=0x1;_0x300ad5['state']=0x5;_0x300ad5['statedesc']=_0x931c('0x195');_0x300ad5[_0x931c('0x17d')]+=0x1;_0x300ad5['countglobal']+=0x1;_0x41eafa[_0x931c('0xcb')](_0x300ad5)[_0x931c('0xb2')](loggerCatch(_0x931c('0x196')));if(_0x41eafa[_0x931c('0x17c')](0x5,_0x27defc,_0x54d368)){if(_0x300ad5[_0x931c('0x17d')]>=_0x54d368['dialBusyMaxRetry']){_0x41eafa[_0x931c('0x18f')](_0x300ad5,_0x141a54,_0x328691,_0x931c('0x197'));}else{_0x41eafa[_0x931c('0x18d')](_0x300ad5,_0x141a54,_0x328691,_0x931c('0x197'));}}break;case'8':_0x54d368['outboundCongestionCallsDay']+=0x1;_0x300ad5[_0x931c('0xa5')]=0x8;_0x300ad5[_0x931c('0xa6')]='Congestion';_0x300ad5[_0x931c('0x17e')]+=0x1;_0x300ad5[_0x931c('0x191')]+=0x1;_0x41eafa['createHistory'](_0x300ad5)[_0x931c('0xb2')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x41eafa['checkRetriveMax'](0x8,_0x27defc,_0x54d368)){if(_0x300ad5[_0x931c('0x17e')]>=_0x54d368[_0x931c('0x198')]){_0x41eafa[_0x931c('0x18f')](_0x300ad5,_0x141a54,_0x328691,_0x931c('0x199'));}else{_0x41eafa[_0x931c('0x18d')](_0x300ad5,_0x141a54,_0x328691,_0x931c('0x199'));}}break;default:_0x54d368['outboundUnknownCallsDay']+=0x1;_0x300ad5[_0x931c('0xa5')]=0xc;_0x300ad5[_0x931c('0xa6')]=_0x2ffcea[_0x931c('0x18a')];_0x41eafa[_0x931c('0xcb')](_0x300ad5)[_0x931c('0xb2')](loggerCatch(_0x931c('0x19a')));if(_0x41eafa[_0x931c('0x17c')](_0x2ffcea[_0x931c('0x18a')],_0x27defc,_0x54d368)){if(_0x300ad5['countbusyretry']+_0x300ad5['countcongestionretry']+_0x300ad5['countnoanswerretry']>=_0x54d368[_0x931c('0x18c')]){_0x41eafa[_0x931c('0x18d')](_0x300ad5,_0x141a54,_0x328691,_0x2ffcea[_0x931c('0x18a')]);}else{_0x41eafa[_0x931c('0x18f')](_0x300ad5,_0x141a54,_0x328691,_0x2ffcea[_0x931c('0x18a')]);}}}});};Dialer[_0x931c('0x18')][_0x931c('0x18d')]=function(_0x10555c,_0x36c64e,_0x57b2d,_0x4bd84e){var _0x8a8f42=new Final(_0x10555c);_0x8a8f42['state']=0xf;_0x8a8f42['statedesc']='Global';this['createStateFinal'](_0x8a8f42,_0x36c64e,_0x57b2d,_0x4bd84e);};Dialer[_0x931c('0x18')][_0x931c('0x18f')]=function(_0x5d624b,_0xf2e18a,_0x3346dc,_0x252f9b){this[_0x931c('0xc9')](_0x5d624b)[_0x931c('0xba')](function(_0x4c5789){return _0xf2e18a(msgResponse(_0x931c('0x188'),_0x931c('0xda'),_0x252f9b));})[_0x931c('0xb2')](function(_0x2c105c){return _0x3346dc(msgResponse('[moveContactManagedDialer][0]',_0x931c('0x127'),'contact\x20not\x20moved'));});};Dialer[_0x931c('0x18')][_0x931c('0x6')]=function(_0x327ec3){var _0x2d0685=this;var _0x1e30b7=_0x327ec3['dialPredictiveOptimizationPercentage']/0x64;var _0x1cd5db=_0x327ec3['outboundDropCallsDayTimeout']/(_0x327ec3['outboundDropCallsDayTimeout']+_0x327ec3[_0x931c('0x5b')]);var _0x54eb19=Math[_0x931c('0x19b')](_0x327ec3['predictiveIntervalAvailable']*(_0x327ec3[_0x931c('0x19c')]/0x64));var _0x322925=Math[_0x931c('0x19b')](_0x327ec3['predictiveIntervalAvailable']*(_0x327ec3[_0x931c('0x19d')]/0x64));var _0x5510b0=_0x327ec3[_0x931c('0x4d')]+_0x327ec3[_0x931c('0x52')];var _0x334288=Math[_0x931c('0x19e')](_0x327ec3[_0x931c('0x71')]*_0x327ec3[_0x931c('0x73')]*_0x327ec3['predictiveIntervalHitRate']*_0x327ec3[_0x931c('0x6d')]);if(_[_0x931c('0x38')](_0x327ec3[_0x931c('0x24')])){if(!_[_0x931c('0x38')](_0x327ec3[_0x931c('0x8e')])){_0x327ec3[_0x931c('0x8e')]=undefined;loggerPredictive['error'](_0x931c('0x19f'),_0x931c('0x1a0'));}if(!_[_0x931c('0x38')](_0x327ec3['handlePredictive'])){loggerPredictive[_0x931c('0x95')](_0x931c('0x19f'),_0x931c('0x1a1'));clearInterval(_0x327ec3[_0x931c('0x8f')]);_0x327ec3[_0x931c('0x8f')]=undefined;}_0x327ec3[_0x931c('0x24')]=moment()[_0x931c('0x79')](_0x931c('0xfe'));loggerPredictive['info'](_0x327ec3[_0x931c('0x3b')],_0x931c('0x1a2'),_0x327ec3[_0x931c('0x24')]);this[_0x931c('0x13e')](_0x327ec3,0x1);}else if(ifInterval(_0x327ec3[_0x931c('0x1a3')],_0x327ec3[_0x931c('0x24')])){this[_0x931c('0x13e')](_0x327ec3,0x1);loggerPredictiveCalls[_0x931c('0x7d')](_0x931c('0x1a4'),_0x327ec3['startProgressive'],_0x327ec3['name']);_0x327ec3[_0x931c('0x71')]=0x0;_0x327ec3[_0x931c('0x108')]=0x0;}else if(_0x1e30b7<_0x1cd5db&&_0x327ec3[_0x931c('0x1a5')]===_0x931c('0x1a6')){freeVariablesPredictive(_0x327ec3);loggerPredictive[_0x931c('0x7d')](_0x931c('0x1a7'),_0x931c('0x1a8'),_0x1cd5db,'startProgressive',_0x327ec3[_0x931c('0x3b')]);}else if(_0x334288<_0x327ec3[_0x931c('0x108')]&&_0x327ec3[_0x931c('0x1a5')]===_0x931c('0x1a6')){freeVariablesPredictive(_0x327ec3);loggerPredictive[_0x931c('0x7d')](_0x931c('0x1a9'),_0x931c('0x1aa'),_0x334288,'Drop\x20in\x20this\x20interval',_0x327ec3[_0x931c('0x108')],'startProgressive',_0x327ec3[_0x931c('0x3b')]);}else if(!ifInterval(_0x327ec3[_0x931c('0x1a3')],_0x327ec3[_0x931c('0x24')])&&_[_0x931c('0x38')](_0x327ec3[_0x931c('0x8e')])&&!_[_0x931c('0x38')](_0x327ec3[_0x931c('0x24')])){_0x327ec3[_0x931c('0x8e')]=moment()[_0x931c('0x79')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x931c('0x7d')](_0x327ec3[_0x931c('0x3b')],_0x931c('0x1ab'),_0x327ec3[_0x931c('0x8e')]);this[_0x931c('0xc0')](_0x327ec3[_0x931c('0x1a3')])[_0x931c('0xba')](this['getDataPredictive'](_0x327ec3))[_0x931c('0xba')](mergeDataErlangB(_0x327ec3))[_0x931c('0xba')](this[_0x931c('0x1ac')](_0x327ec3))[_0x931c('0xb2')](loggerCatchPredictive(_0x931c('0x1ad'),_0x327ec3));}else if(!ifInterval(_0x327ec3[_0x931c('0x1a3')],_0x327ec3[_0x931c('0x8e')])){_0x327ec3[_0x931c('0x108')]=0x0;_0x327ec3[_0x931c('0x8e')]=moment()[_0x931c('0x79')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x931c('0x7d')](_0x327ec3[_0x931c('0x3b')],_0x931c('0x1ae'),_0x327ec3[_0x931c('0x8e')]);clearInterval(_0x327ec3['handlePredictive']);_0x327ec3[_0x931c('0x8f')]=undefined;this[_0x931c('0xc0')](_0x327ec3[_0x931c('0x1a3')])['then'](this[_0x931c('0x1af')](_0x327ec3))[_0x931c('0xba')](mergeDataErlangB(_0x327ec3))[_0x931c('0xba')](this[_0x931c('0x1ac')](_0x327ec3))[_0x931c('0xb2')](loggerCatchPredictive(_0x931c('0x1b0'),_0x327ec3));}else if(_0x327ec3[_0x931c('0x1b1')]&&_0x5510b0<_0x327ec3['predictiveIntervalAvailable']-_0x322925){freeVariablesPredictive(_0x327ec3);loggerPredictive['info'](_0x327ec3[_0x931c('0x3b')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5510b0,_0x931c('0x1b2'),_0x327ec3[_0x931c('0x1b1')],'-',_0x322925,'=',_0x327ec3['predictiveIntervalAvailable']-_0x322925,')');}else if(_0x327ec3[_0x931c('0x1b1')]&&_0x5510b0>_0x327ec3[_0x931c('0x1b1')]+_0x54eb19){freeVariablesPredictive(_0x327ec3);loggerPredictive[_0x931c('0x7d')](_0x327ec3[_0x931c('0x3b')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5510b0,')\x20are\x20more\x20than\x20threshold\x20(',_0x327ec3['predictiveIntervalAvailable'],'+',_0x54eb19,'=',_0x327ec3['predictiveIntervalAvailable']+_0x54eb19,')');}};Dialer[_0x931c('0x18')][_0x931c('0x1af')]=function(_0x53400f){var _0x18189e=this;return function(_0x134369){return new BPromise(function(_0x4e912c,_0xdf9c6d){_[_0x931c('0x8d')](_0x53400f,_0x134369[0x0]);if(checkGetDataPredictive(_0x134369[0x0])){var _0xf21e52=_0x53400f['predictiveIntervalAvailable']=_0x53400f[_0x931c('0x52')]+_0x53400f['available'];var _0xd6f42d=_0x53400f[_0x931c('0x1a3')]*0x3c;var _0x475d50=_0x134369[0x0][_0x931c('0x6a')]+_0x134369[0x0][_0x931c('0x69')];var _0x518fe2=(_0x134369[0x0][_0x931c('0x68')]+_0x134369[0x0][_0x931c('0x1b3')]+_0x134369[0x0][_0x931c('0x6b')])/_0x134369[0x0]['predictiveIntervalTotalCalls'];_0x53400f[_0x931c('0x1b4')]=_0x518fe2>0x0?_0x518fe2:0x1;switch(_0x53400f[_0x931c('0x1a5')]){case _0x931c('0x1a6'):var _0x341756=_0x53400f['dialPredictiveOptimizationPercentage']/0x64;return _0x18189e[_0x931c('0x1b5')](_0xf21e52,_0xd6f42d,_0x475d50,_0x518fe2,_0x341756)['then'](function(_0x4fbb06){return _0x4e912c(_0x4fbb06);});case _0x931c('0x1b6'):var _0x4a5a0b=_0x53400f[_0x931c('0x1b7')]/0x64;return _0x18189e[_0x931c('0x1b8')](_0xf21e52,_0xd6f42d,_0x475d50,_0x518fe2,_0x4a5a0b)['then'](function(_0x1aeeb7){return _0x4e912c(_0x1aeeb7);});default:return _0xdf9c6d(msgResponse(_0x931c('0x1b9'),_0x931c('0x127'),'Unknown\x20Predictive'));}}else{return _0xdf9c6d(msgResponse(_0x931c('0x1b9'),'Failure','check\x20failure'));}});};};Dialer[_0x931c('0x18')][_0x931c('0x1ba')]=function(_0x2274e7){var _0x1912a9=this;return function(_0x281f18){return new BPromise(function(_0x4bd98a,_0x20ceff){_['merge'](_0x2274e7,_0x281f18[0x0]);if(checkGetDataPredictive(_0x281f18[0x0])){loggerPredictive['info'](JSON['stringify'](_0x281f18[0x0]));if(_0x2274e7['dialPredictiveOptimization']==='dropRate'){return _0x1912a9[_0x931c('0xc7')](_0x2274e7['id'])[_0x931c('0xba')](function(_0x365f92){var _0x53a2e8=_0x2274e7[_0x931c('0x143')]-_0x365f92[0x0][_0x931c('0x1bb')];var _0x2a942d=_0x2274e7[_0x931c('0x1a3')]*0x3c;var _0x473d11=_0x281f18[0x0][_0x931c('0x6a')]+_0x281f18[0x0][_0x931c('0x69')];var _0x1235db=(_0x281f18[0x0]['predictiveIntervalAnsweredCalls']+_0x281f18[0x0][_0x931c('0x1b3')]+_0x281f18[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x281f18[0x0][_0x931c('0x6f')];var _0x5dcb73=_0x2274e7[_0x931c('0x1b7')]/0x64;_0x2274e7[_0x931c('0x6e')]=_0x365f92[0x0][_0x931c('0x1bb')]||0x0;_0x2274e7[_0x931c('0x1b4')]=_0x1235db>0x0?_0x1235db:0x1;return _0x1912a9['abandonmentRate'](_0x53a2e8,_0x2a942d,_0x473d11,_0x1235db,_0x5dcb73);})['then'](function(_0x18499b){return _0x4bd98a(_0x18499b);})['catch'](function(_0x476bf4){return _0x20ceff(msgResponse(_0x931c('0x1bc'),_0x931c('0x127'),JSON[_0x931c('0x44')](_0x476bf4)));});}if(_0x2274e7['dialPredictiveOptimization']===_0x931c('0x1b6')){return _0x1912a9[_0x931c('0xc7')](_0x2274e7['id'])[_0x931c('0xba')](function(_0x2081f4){var _0x3d743e=_0x2274e7[_0x931c('0x143')]-_0x2081f4[0x0]['outboundQueuePauses'];var _0x3dd745=_0x2274e7['dialPredictiveInterval']*0x3c;var _0x219ecd=_0x281f18[0x0][_0x931c('0x6a')]+_0x281f18[0x0][_0x931c('0x69')];var _0x130971=(_0x281f18[0x0]['predictiveIntervalAnsweredCalls']+_0x281f18[0x0][_0x931c('0x1b3')]+_0x281f18[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x281f18[0x0][_0x931c('0x6f')];var _0x373ac6=_0x2274e7['dialPredictiveOptimizationPercentage']/0x64;_0x2274e7[_0x931c('0x6e')]=_0x2081f4[0x0][_0x931c('0x1bb')]||0x0;_0x2274e7['predictiveIntervalHitRate']=_0x130971>0x0?_0x130971:0x1;return _0x1912a9[_0x931c('0x1b8')](_0x3d743e,_0x3dd745,_0x219ecd,_0x130971,_0x373ac6);})[_0x931c('0xba')](function(_0x4a4de7){return _0x4bd98a(_0x4a4de7);})[_0x931c('0xb2')](function(_0x21a114){return _0x20ceff(msgResponse(_0x931c('0x1bc'),_0x931c('0x127'),JSON[_0x931c('0x44')](_0x21a114)));});}}else{return _0x20ceff(msgResponse(_0x931c('0x1b9'),'Failure',_0x931c('0x1bd')));}});};};Dialer[_0x931c('0x18')]['startMethodPredictive']=function(_0x320d35){var _0x498a59=this;return function(){var _0x4e07ad=0x0;var _0x2cf9a8=Math[_0x931c('0x19e')](_0x320d35[_0x931c('0x72')]*0x3e8);if(_0x2cf9a8>0x0){_0x2cf9a8=_0x2cf9a8<0x64?0x64:_0x2cf9a8;loggerPredictive[_0x931c('0x7d')](_0x320d35[_0x931c('0x3b')],_0x931c('0x1be'),_0x2cf9a8,_0x931c('0x45'));_0x320d35[_0x931c('0x8f')]=setInterval(function(){_0x498a59[_0x931c('0x8f')](_0x320d35);loggerPredictiveCalls['info']('[handlePredictive]',_0x4e07ad+=0x1);},_0x2cf9a8);}else{loggerPredictive[_0x931c('0x7d')](_0x320d35[_0x931c('0x3b')],_0x931c('0x1bf'));}};};Dialer['prototype'][_0x931c('0x1c0')]=function(_0x4cab90,_0x189abc){var _0x9d041f=this;return function(_0x2e3c97){if(_[_0x931c('0x41')](_0x2e3c97)){if(_[_0x931c('0xae')](_0x189abc[_0x931c('0xd5')])||!_0x189abc[_0x931c('0x1c1')]){if(_0x4cab90[_0x931c('0x13c')]===_0x931c('0x140')){_0x4cab90[_0x931c('0x113')]=_[_0x931c('0x38')](_0x4cab90['queueStatusComplete'])?!![]:_0x4cab90[_0x931c('0x113')];var _0xdd6255=uuid['v4']();_0x9d041f[_0x931c('0x20')][_0xdd6255]=new Action(_0x4cab90,_0x189abc,_0xdd6255);loggerBooked['info']('[booked][checkContactBlack]',_0xdd6255,_0x931c('0x1c2'),JSON['stringify'](_0x4cab90[_0x931c('0x113')]),_0x931c('0x1c3'),_0x4cab90['name']);if(_0x4cab90[_0x931c('0x113')]){_0x4cab90[_0x931c('0x113')]=![];_0x9d041f[_0x931c('0x110')][_0x9d041f[_0x931c('0x20')][_0xdd6255][_0x931c('0xb5')]]=[];ami[_0x931c('0xaf')]({'actionid':_0xdd6255,'action':'queuestatus','queue':_0x4cab90[_0x931c('0x3b')]})[_0x931c('0xb2')](function(_0x5b7cd9){_0x9d041f[_0x931c('0xb4')](_0x4cab90);_0x9d041f[_0x931c('0xc3')]({'active':![],'ContactId':_0x9d041f[_0x931c('0x20')][_0xdd6255][_0x931c('0xd3')],'ListId':_0x9d041f['actions'][_0xdd6255][_0x931c('0xd4')],'VoiceQueueId':_0x9d041f[_0x931c('0x20')][_0xdd6255][_0x931c('0xd6')]||undefined,'CampaignId':_0x9d041f[_0x931c('0x20')][_0xdd6255][_0x931c('0x117')]||undefined})[_0x931c('0xb2')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x9d041f[_0x931c('0x20')][_0xdd6255];});}else{loggerBooked[_0x931c('0x7d')]('[booked][checkContactBlack][else]',JSON[_0x931c('0x44')](_0x4cab90['queueStatusComplete']),_0x931c('0x1c3'),_0x4cab90['name']);_0x9d041f[_0x931c('0xb4')](_0x4cab90);_0x9d041f['rescheduleContact']({'active':![],'ContactId':_0x9d041f[_0x931c('0x20')][_0xdd6255][_0x931c('0xd3')],'ListId':_0x9d041f['actions'][_0xdd6255][_0x931c('0xd4')],'VoiceQueueId':_0x9d041f[_0x931c('0x20')][_0xdd6255][_0x931c('0xd6')]||undefined,'CampaignId':_0x9d041f[_0x931c('0x20')][_0xdd6255]['CampaignId']||undefined})['catch'](loggerCatch(_0x931c('0x1c4')));delete _0x9d041f[_0x931c('0x20')][_0xdd6255];}}else{return _0x9d041f[_0x931c('0x14e')](_0x4cab90,_0x189abc);}}else{if(getDiff(_0x189abc[_0x931c('0x1c5')])<_0x4cab90['dialRecallMeTimeout']*0x3c){_0x9d041f[_0x931c('0x91')][_0x931c('0x115')](_0x189abc['id'])['finally'](function(){_0x9d041f['updateOriginated'](_0x4cab90);});}else{_0x4cab90[_0x931c('0x65')]+=0x1;_0x9d041f[_0x931c('0xb4')](_0x4cab90);if(_0x4cab90['dialRecallInQueue']){_0x9d041f['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x189abc[_0x931c('0xd3')],'ListId':_0x189abc[_0x931c('0xd4')],'VoiceQueueId':_0x189abc[_0x931c('0xd6')]||undefined,'CampaignId':_0x189abc[_0x931c('0x117')]||undefined})[_0x931c('0xb2')](loggerCatch(_0x931c('0x1c6')));_0x9d041f[_0x931c('0xcb')](createObjHistory(_0x4cab90,_0x189abc,'RECALLINQUEUE',0x17,_0x931c('0x1c7')))[_0x931c('0xb2')](loggerCatch(_0x931c('0x1c8')));}else{_0x9d041f[_0x931c('0xd1')](createObjHistory(_0x4cab90,_0x189abc,_0x931c('0x1c9'),0x16,_0x931c('0x1ca')),_0x931c('0x1cb'),_0x931c('0x1cc'));}}}}else{_0x4cab90[_0x931c('0x5c')]+=0x1;_0x9d041f['saveInDb'](createObjHistory(_0x4cab90,_0x189abc,_0x931c('0x1cd'),0xd,_0x931c('0x1ce')),_0x931c('0x1cf'),_0x931c('0x1d0'));throw'inBlackList';}};};Dialer[_0x931c('0x18')][_0x931c('0x1d1')]=function(_0x37b2b0){var _0x5cb6d1=this;var _0x42a237=[];var _0x16e939=_0x37b2b0['limitCalls']-_0x37b2b0[_0x931c('0x70')]-_0x37b2b0[_0x931c('0x1d2')];emitCampaignSummary(_0x37b2b0);if(_0x16e939>0x0){if(_0x16e939>this[_0x931c('0x1f')]){_0x16e939=this[_0x931c('0x1f')];}_0x37b2b0[_0x931c('0x1d2')]+=_0x16e939;this[_0x931c('0xc5')](_0x37b2b0['id'],_0x16e939,_0x37b2b0[_0x931c('0x1d3')])['then'](function(_0x113f54){_0x37b2b0[_0x931c('0x1d2')]-=_0x16e939;_0x37b2b0[_0x931c('0x1d2')]=_0x37b2b0['temp']>0x0?_0x37b2b0[_0x931c('0x1d2')]:0x0;if(!checkContactEmpty(_0x113f54)){_0x37b2b0[_0x931c('0x39')]=_0x931c('0x9e');logger[_0x931c('0x7d')](_0x931c('0x1d4')+_0x37b2b0[_0x931c('0x3b')]);}else{_0x37b2b0[_0x931c('0x70')]+=_0x113f54[_0x931c('0x97')];_0x37b2b0[_0x931c('0x39')]='RUNNING';for(var _0x1cd117=0x0;_0x1cd117<_0x113f54[_0x931c('0x97')];_0x1cd117+=0x1){_0x37b2b0[_0x931c('0x1d5')]+=0x1;if(_['isNil'](_0x113f54[_0x1cd117])||_['isNil'](_0x113f54[_0x1cd117][_0x931c('0x151')])||_[_0x931c('0xae')](_0x113f54[_0x1cd117][_0x931c('0x151')][_0x931c('0x150')])){_0x5cb6d1[_0x931c('0xcf')](_0x931c('0x1d6'),_0x37b2b0,_0x113f54[_0x1cd117]);}else{_0x5cb6d1[_0x931c('0xbe')](_[_0x931c('0xd2')](_0x113f54[_0x1cd117],['CampaignId',_0x931c('0x1d7')]))['then'](_0x5cb6d1['checkContactBlack'](_0x37b2b0,_0x113f54[_0x1cd117]))['catch'](_0x5cb6d1['loggerHandler'](_0x931c('0x1d8'),_0x37b2b0));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x37b2b0,_0x16e939));}};Dialer[_0x931c('0x18')]['handlePower']=function(_0x48b6e9,_0x21c881){var _0x3a8156=this;var _0x51f102=[];var _0x3715fb=_0x21c881>=0x1?_0x21c881:0x1;var _0xcfd79e=[];if(_0x48b6e9['dialMethod']===_0x931c('0x140')){_0x3715fb=0x1;}var _0xe72a18=Math['floor'](_0x48b6e9[_0x931c('0x4d')]*_0x3715fb)-_0x48b6e9[_0x931c('0x70')]-_0x48b6e9['temp'];emitVoiceQueueSummary(_0x48b6e9);if(_0x48b6e9['dialLimitQueue']>0x0){var _0x5ca800=_0x48b6e9[_0x931c('0x1d9')]-_0x48b6e9[_0x931c('0x70')]-_0x48b6e9[_0x931c('0x52')]-_0x48b6e9[_0x931c('0x1d2')]-_0x48b6e9[_0x931c('0x4e')];if(_0xe72a18>_0x5ca800){_0xe72a18=_0x5ca800;}}if(_0xe72a18>0x0){if(_0x48b6e9['dialMethod']===_0x931c('0x140')){_0xe72a18=0x1;}if(_0xe72a18>this[_0x931c('0x1f')]){_0xe72a18=this[_0x931c('0x1f')];}_0x48b6e9[_0x931c('0x1d2')]+=_0xe72a18;for(var _0x859bd9 in this[_0x931c('0x1e')]){if(this[_0x931c('0x1e')][_0x931c('0x98')](_0x859bd9)){if(this[_0x931c('0x1e')][_0x859bd9][_0x931c('0xa5')]==='not_inuse'&&this[_0x931c('0x1e')][_0x859bd9]['status']==='reachable'){_0x51f102['push'](this[_0x931c('0x1e')][_0x859bd9]['id']);}}}this[_0x931c('0xc4')](_0x48b6e9['id'],_0x51f102,_0xe72a18,_0x48b6e9[_0x931c('0x1d3')])[_0x931c('0xba')](function(_0x521c9e){_0x48b6e9[_0x931c('0x1d2')]-=_0xe72a18;_0x48b6e9[_0x931c('0x1d2')]=_0x48b6e9[_0x931c('0x1d2')]>0x0?_0x48b6e9['temp']:0x0;if(!checkContactEmpty(_0x521c9e)){_0x3a8156[_0x931c('0xb8')](_0x48b6e9)[_0x931c('0xba')](sendMessageReschedule(_0x48b6e9))['catch'](loggerCatch(_0x931c('0xbb')));}else{_0x48b6e9['originated']+=_0x521c9e[_0x931c('0x97')];_0x48b6e9[_0x931c('0x39')]=_0x48b6e9[_0x931c('0x13c')]===_0x931c('0x140')?_0x931c('0x1da'):'RUNNING';for(var _0x297a60=0x0;_0x297a60<_0x521c9e[_0x931c('0x97')];_0x297a60+=0x1){if(_['isNil'](_0x521c9e[_0x297a60])||_[_0x931c('0xae')](_0x521c9e[_0x297a60][_0x931c('0x151')])||_[_0x931c('0xae')](_0x521c9e[_0x297a60][_0x931c('0x151')]['phone'])){_0x3a8156['emptyContact'](_0x931c('0x1d6'),_0x48b6e9,_0x521c9e[_0x297a60]);}else{_0x3a8156['checkIsBlackList'](_[_0x931c('0xd2')](_0x521c9e[_0x297a60],['VoiceQueueId',_0x931c('0x1d7')]))['then'](_0x3a8156[_0x931c('0x1c0')](_0x48b6e9,_0x521c9e[_0x297a60]))[_0x931c('0xb2')](_0x3a8156['loggerHandler']('[actionOriginate]\x20',_0x48b6e9));}}}})[_0x931c('0xb2')](loggerGetContactDialer('[getContactDialer2]',_0x48b6e9,_0xe72a18));}};Dialer[_0x931c('0x18')]['handlePredictive']=function(_0x151d8e){var _0x53a0e3=this;if(_0x151d8e[_0x931c('0x1d9')]>0x0){var _0x50cc2f=_0x151d8e[_0x931c('0x1d9')]-_0x151d8e[_0x931c('0x70')]-_0x151d8e[_0x931c('0x52')];if(_0x50cc2f>0x0){this[_0x931c('0x1db')](_0x151d8e);}else{loggerPredictiveCalls[_0x931c('0x7d')]('[handlePredictive][limitChannel]');}}else{this[_0x931c('0x1db')](_0x151d8e);}};Dialer[_0x931c('0x18')]['tryOriginatePredictive']=function(_0x17e517){var _0x19aa11=this;var _0x567e28=[];_0x17e517[_0x931c('0x70')]+=0x1;for(var _0xbcf3bb in this[_0x931c('0x1e')]){if(this[_0x931c('0x1e')][_0x931c('0x98')](_0xbcf3bb)){if(this[_0x931c('0x1e')][_0xbcf3bb][_0x931c('0xa5')]===_0x931c('0x1dc')&&this[_0x931c('0x1e')][_0xbcf3bb]['status']===_0x931c('0xdd')){_0x567e28[_0x931c('0x111')](this[_0x931c('0x1e')][_0xbcf3bb]['id']);}}}this[_0x931c('0xc4')](_0x17e517['id'],_0x567e28,0x1,_0x17e517[_0x931c('0x1d3')])[_0x931c('0xba')](function(_0x13c106){if(!checkContactEmpty(_0x13c106)){checkContactLowerLimitOriginate(_0x17e517,0x1,0x0);_0x19aa11[_0x931c('0xb8')](_0x17e517)[_0x931c('0xba')](sendMessageReschedule(_0x17e517))[_0x931c('0xb2')](loggerCatch(_0x931c('0xbb')));}else{_0x17e517['message']=_0x931c('0x1dd');if(_[_0x931c('0xae')](_0x13c106[0x0])||_['isNil'](_0x13c106[0x0][_0x931c('0x151')])||_[_0x931c('0xae')](_0x13c106[0x0][_0x931c('0x151')]['phone'])){_0x19aa11['emptyContact'](_0x931c('0x1d6'),_0x17e517,_0x13c106[0x0]);}else{_0x19aa11['checkIsBlackList'](_['pick'](_0x13c106[0x0],[_0x931c('0xd6'),'Contact.phone']))[_0x931c('0xba')](_0x19aa11[_0x931c('0x1c0')](_0x17e517,_0x13c106[0x0]))[_0x931c('0xb2')](_0x19aa11[_0x931c('0xce')](_0x931c('0x1de'),_0x17e517));}}})[_0x931c('0xb2')](loggerGetContactDialer(_0x931c('0x1df'),_0x17e517,0x1));emitVoiceQueueSummary(_0x17e517);};Dialer[_0x931c('0x18')]['abandonmentRate']=function(_0x4380cc,_0x59f109,_0x5a0be5,_0x59382f,_0x5c28e2,_0x5b394c){loggerPredictive[_0x931c('0x7d')](_0x931c('0x1e0'));loggerPredictive[_0x931c('0x7d')](_0x931c('0x1e1'),_0x4380cc);loggerPredictive[_0x931c('0x7d')](_0x931c('0x1e2'),_0x59f109);loggerPredictive[_0x931c('0x7d')](_0x931c('0x1e3'),_0x5a0be5);loggerPredictive[_0x931c('0x7d')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x59382f);loggerPredictive[_0x931c('0x7d')](_0x931c('0x1e4'),_0x5c28e2);loggerPredictive['info'](_0x931c('0x8c'));return new BPromise(function(_0x51a31f,_0x2c4f77){if(_0x4380cc<=0x0||isNaN(_0x4380cc)){return _0x2c4f77(msgResponse(_0x931c('0x1e5'),'Error',_0x931c('0x1e6')+_0x4380cc));}if(_0x5a0be5<=0x0||isNaN(_0x5a0be5)){return _0x2c4f77(msgResponse(_0x931c('0x1e5'),_0x931c('0x43'),_0x931c('0x1e7')+_0x5a0be5));}if(_0x59382f<=0x0||isNaN(_0x59382f)){return _0x2c4f77(msgResponse(_0x931c('0x1e5'),_0x931c('0x43'),_0x931c('0x1e8')+_0x59382f));}if(_0x59f109<=0x0||isNaN(_0x59f109)){return _0x2c4f77(msgResponse(_0x931c('0x1e5'),_0x931c('0x43'),_0x931c('0x1e9')+_0x59f109));}if(_0x5c28e2<=0x0||isNaN(_0x5c28e2)){return _0x2c4f77(msgResponse(_0x931c('0x1e5'),'Error',_0x931c('0x1ea')+_0x5c28e2));}_0x5b394c=_0x5b394c||0x0;var _0x1740ce=0x1/_0x5a0be5;var _0x13d76d=0x0;var _0x5a46a6=0x0;var _0x202f59=0x0;var _0x124f1d=0x0;for(var _0x5ac6fe=0x0;_0x202f59<_0x5c28e2;_0x5ac6fe+=0x1){_0x5a46a6=_0x5ac6fe/_0x59f109;_0x13d76d=(_0x59382f*_0x5a46a6+_0x5b394c)/_0x1740ce;_0x202f59=erlangb(_0x13d76d,_0x4380cc);_0x124f1d=_0x13d76d/_0x4380cc*(0x1-erlangb(_0x13d76d,_0x4380cc));}return _0x51a31f({'erlangCalls':_0x5ac6fe,'erlangCallToSecond':_0x59f109/_0x5ac6fe,'erlangAbandonmentRate':_0x202f59,'erlangBusyFactor':_0x124f1d});});};Dialer[_0x931c('0x18')][_0x931c('0x1b8')]=function(_0x148f73,_0x49a0e3,_0x4272a2,_0x344f30,_0xa25421,_0x22c0c5){loggerPredictive[_0x931c('0x7d')](_0x931c('0x1eb'));loggerPredictive[_0x931c('0x7d')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x148f73);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49a0e3);loggerPredictive[_0x931c('0x7d')](_0x931c('0x1e3'),_0x4272a2);loggerPredictive[_0x931c('0x7d')](_0x931c('0x1ec'),_0x344f30);loggerPredictive['info'](_0x931c('0x1ed'),_0xa25421);loggerPredictive[_0x931c('0x7d')]('---------------------------');return new BPromise(function(_0x5e09b7,_0x49c3b4){if(_0x148f73<=0x0||isNaN(_0x148f73)){return _0x49c3b4(msgResponse('[busyFactor]',_0x931c('0x43'),_0x931c('0x1e6')+_0x148f73));}if(_0x4272a2<=0x0||isNaN(_0x4272a2)){return _0x49c3b4(msgResponse('[busyFactor]',_0x931c('0x43'),'Ts\x20=\x20'+_0x4272a2));}if(_0x344f30<=0x0||isNaN(_0x344f30)){return _0x49c3b4(msgResponse(_0x931c('0x1ee'),_0x931c('0x43'),'p\x20=\x20'+_0x344f30));}if(_0x49a0e3<=0x0||isNaN(_0x49a0e3)){return _0x49c3b4(msgResponse('[busyFactor]','Error',_0x931c('0x1e9')+_0x49a0e3));}if(_0xa25421<=0x0||isNaN(_0xa25421)){return _0x49c3b4(msgResponse(_0x931c('0x1ee'),'Error','Umin\x20=\x20'+_0xa25421));}_0x22c0c5=_0x22c0c5||0x0;var _0x1517a8=0x1/_0x4272a2;var _0x5484e1=0x0;var _0xdf7bda=0x0;var _0x1dc051=0x0;var _0x586f8a=0x0;for(var _0xd0ef5f=0x0;_0x586f8a<_0xa25421;_0xd0ef5f+=0x1){_0xdf7bda=_0xd0ef5f/_0x49a0e3;_0x5484e1=(_0x344f30*_0xdf7bda+_0x22c0c5)/_0x1517a8;_0x1dc051=erlangb(_0x5484e1,_0x148f73);_0x586f8a=_0x5484e1/_0x148f73*(0x1-erlangb(_0x5484e1,_0x148f73));}return _0x5e09b7({'erlangCalls':_0xd0ef5f,'erlangCallToSecond':_0x49a0e3/_0xd0ef5f,'erlangAbandonmentRate':_0x1dc051,'erlangBusyFactor':_0x586f8a});});};module[_0x931c('0x1ef')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index f30e03e..7147f20 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ebc=['name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x2ebc,0x189));var _0xc2eb=function(_0x2f2c21,_0x59db3d){_0x2f2c21=_0x2f2c21-0x0;var _0x42a166=_0x2ebc[_0x2f2c21];return _0x42a166;};'use strict';var util=require(_0xc2eb('0x0'));var _=require(_0xc2eb('0x1'));var moment=require('moment');function getSeconds(_0x10b507,_0x2c46e2){var _0x179c71=moment(_0x10b507)[_0xc2eb('0x2')](0x0);var _0x4e8c01=moment(_0x2c46e2)['milliseconds'](0x0);return _0x179c71[_0xc2eb('0x3')](_0x4e8c01,_0xc2eb('0x4'));}function QueueCallerAbandon(_0x21fabd,_0x376ced){this[_0xc2eb('0x5')]=_0x21fabd['scheduledat'];this[_0xc2eb('0x6')]=_0x21fabd[_0xc2eb('0x6')];this['campaigntype']=_0x21fabd['type']===_0xc2eb('0x7')?_0xc2eb('0x8'):_0x21fabd[_0xc2eb('0x6')];this[_0xc2eb('0x9')]=_0x21fabd[_0xc2eb('0x9')];this[_0xc2eb('0xa')]=_0x21fabd[_0xc2eb('0xa')];this[_0xc2eb('0xb')]=_0x21fabd[_0xc2eb('0xb')];this['countglobal']=_0x21fabd['countbusyretry']+_0x21fabd[_0xc2eb('0xa')]+_0x21fabd[_0xc2eb('0xb')];this[_0xc2eb('0xc')]=_0x376ced[_0xc2eb('0xc')];this[_0xc2eb('0xd')]=_0x21fabd[_0xc2eb('0xe')];this[_0xc2eb('0xf')]=_0x21fabd[_0xc2eb('0x10')];this[_0xc2eb('0x11')]=_0x21fabd['starttime'];this[_0xc2eb('0x12')]=_0x21fabd[_0xc2eb('0x12')];this[_0xc2eb('0x13')]=_0x21fabd[_0xc2eb('0x13')];this[_0xc2eb('0x14')]=this[_0xc2eb('0x13')];this[_0xc2eb('0x15')]=getSeconds(_0x21fabd[_0xc2eb('0x12')],_0x21fabd[_0xc2eb('0x11')]);this[_0xc2eb('0x16')]=getSeconds(this[_0xc2eb('0x13')],_0x21fabd['responsetime']);this[_0xc2eb('0x17')]=0x0;this[_0xc2eb('0x8')]=_0x376ced[_0xc2eb('0x8')];this[_0xc2eb('0x18')]=_0x376ced[_0xc2eb('0x19')];this[_0xc2eb('0x1a')]=_0x376ced[_0xc2eb('0x1a')];this[_0xc2eb('0x1b')]=_0x21fabd[_0xc2eb('0x1b')];this['callbackuniqueid']=_0x21fabd['callbackuniqueid'];this[_0xc2eb('0x1c')]=_0x21fabd[_0xc2eb('0x1c')];this[_0xc2eb('0x1d')]=_0x21fabd[_0xc2eb('0x1d')];this[_0xc2eb('0x1e')]=_0x21fabd[_0xc2eb('0x1e')];this['ListId']=_0x21fabd[_0xc2eb('0x1f')];this['UserId']=_0x21fabd[_0xc2eb('0x20')];this[_0xc2eb('0x21')]=_0x21fabd['VoiceQueueId'];this['CampaignId']=_0x21fabd['CampaignId'];this['originatecalleridnum']=_0x21fabd[_0xc2eb('0x22')]||'';this[_0xc2eb('0x23')]=_0x21fabd['originatecalleridname']||'';}module[_0xc2eb('0x24')]=QueueCallerAbandon; \ No newline at end of file +var _0xa04a=['starttime','responsetime','droptime','ringtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','calleridnum','number'];(function(_0x41dc31,_0x3ed295){var _0x3ecdc8=function(_0x440fd9){while(--_0x440fd9){_0x41dc31['push'](_0x41dc31['shift']());}};_0x3ecdc8(++_0x3ed295);}(_0xa04a,0xc1));var _0xaa04=function(_0x11167c,_0xb0ff07){_0x11167c=_0x11167c-0x0;var _0x34bdb0=_0xa04a[_0x11167c];return _0x34bdb0;};'use strict';var util=require('util');var _=require(_0xaa04('0x0'));var moment=require('moment');function getSeconds(_0x1c68ef,_0x7d6717){var _0x425755=moment(_0x1c68ef)[_0xaa04('0x1')](0x0);var _0x5b720d=moment(_0x7d6717)[_0xaa04('0x1')](0x0);return _0x425755[_0xaa04('0x2')](_0x5b720d,_0xaa04('0x3'));}function QueueCallerAbandon(_0x353904,_0x5da69a){this[_0xaa04('0x4')]=_0x353904[_0xaa04('0x4')];this['type']=_0x353904['type'];this[_0xaa04('0x5')]=_0x353904[_0xaa04('0x6')]===_0xaa04('0x7')?_0xaa04('0x8'):_0x353904['type'];this['countbusyretry']=_0x353904[_0xaa04('0x9')];this[_0xaa04('0xa')]=_0x353904[_0xaa04('0xa')];this[_0xaa04('0xb')]=_0x353904['countnoanswerretry'];this[_0xaa04('0xc')]=_0x353904[_0xaa04('0x9')]+_0x353904[_0xaa04('0xa')]+_0x353904[_0xaa04('0xb')];this[_0xaa04('0xd')]=_0x5da69a['uniqueid'];this['calleridname']=_0x353904[_0xaa04('0xe')];this[_0xaa04('0xf')]=_0x353904[_0xaa04('0x10')];this[_0xaa04('0x11')]=_0x353904['starttime'];this[_0xaa04('0x12')]=_0x353904[_0xaa04('0x12')];this[_0xaa04('0x13')]=_0x353904['droptime'];this['endtime']=this[_0xaa04('0x13')];this[_0xaa04('0x14')]=getSeconds(_0x353904[_0xaa04('0x12')],_0x353904['starttime']);this['holdtime']=getSeconds(this['droptime'],_0x353904['responsetime']);this[_0xaa04('0x15')]=0x0;this[_0xaa04('0x8')]=_0x5da69a[_0xaa04('0x8')];this['membername']=_0x5da69a[_0xaa04('0x16')];this[_0xaa04('0x17')]=_0x5da69a['reason'];this[_0xaa04('0x18')]=_0x353904[_0xaa04('0x18')];this[_0xaa04('0x19')]=_0x353904[_0xaa04('0x19')];this[_0xaa04('0x1a')]=_0x353904[_0xaa04('0x1a')];this[_0xaa04('0x1b')]=_0x353904[_0xaa04('0x1b')];this['ContactId']=_0x353904[_0xaa04('0x1c')];this['ListId']=_0x353904['ListId'];this[_0xaa04('0x1d')]=_0x353904[_0xaa04('0x1d')];this[_0xaa04('0x1e')]=_0x353904['VoiceQueueId'];this[_0xaa04('0x1f')]=_0x353904[_0xaa04('0x1f')];this[_0xaa04('0x20')]=_0x353904['originatecalleridnum']||'';this['originatecalleridname']=_0x353904[_0xaa04('0x21')]||'';}module[_0xaa04('0x22')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 6bd779c..23b166b 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1be4=['%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo','path','AttachmentId','exports','moment','uniqueid','format'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x1be4,0x11b));var _0x41be=function(_0x99c2dd,_0x1d32eb){_0x99c2dd=_0x99c2dd-0x0;var _0x173349=_0x1be4[_0x99c2dd];return _0x173349;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x41be('0x0'));function Action(_0x4dcf94,_0x355278,_0x32eed4){this[_0x41be('0x1')]=_0x4dcf94||undefined;this['channel']=util[_0x41be('0x2')](_0x41be('0x3'),_0x355278[_0x41be('0x4')],_0x355278[_0x41be('0x5')][_0x41be('0x6')],_0x32eed4[_0x41be('0x7')]);this[_0x41be('0x8')]=_0x355278['localstationid'];this[_0x41be('0x9')]=_0x355278[_0x41be('0x9')];this[_0x41be('0xa')]=_0x32eed4[_0x41be('0xa')];this[_0x41be('0xb')]=_0x32eed4['AttachmentId'];}module[_0x41be('0xc')]=Action; \ No newline at end of file +var _0x4c94=['util','lodash','moment','format','%s/%s/%s','tech','name','fax','localstationid','path','AttachmentId','exports'];(function(_0x5b5876,_0x878c42){var _0x592995=function(_0x4d6c2e){while(--_0x4d6c2e){_0x5b5876['push'](_0x5b5876['shift']());}};_0x592995(++_0x878c42);}(_0x4c94,0xa8));var _0x44c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c94[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x44c9('0x0'));var _=require(_0x44c9('0x1'));var moment=require(_0x44c9('0x2'));function Action(_0x2452b5,_0x39a6af,_0x4692c0){this['uniqueid']=_0x2452b5||undefined;this['channel']=util[_0x44c9('0x3')](_0x44c9('0x4'),_0x39a6af[_0x44c9('0x5')],_0x39a6af['Trunk'][_0x44c9('0x6')],_0x4692c0[_0x44c9('0x7')]);this[_0x44c9('0x8')]=_0x39a6af[_0x44c9('0x8')];this['headerinfo']=_0x39a6af['headerinfo'];this[_0x44c9('0x9')]=_0x4692c0[_0x44c9('0x9')];this[_0x44c9('0xa')]=_0x4692c0[_0x44c9('0xa')];}module[_0x44c9('0xb')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 69a5579..a230bfd 100644 --- a/server/services/ami/fax/index.js +++ b/server/services/ami/fax/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef82=['message','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','value','channelstatedesc','syncFaxStatus','operation','status','localstationid','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','\x20receiveFax\x20','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]'];(function(_0x47a40b,_0x443ecf){var _0x19610c=function(_0x4b8ce1){while(--_0x4b8ce1){_0x47a40b['push'](_0x47a40b['shift']());}};_0x19610c(++_0x443ecf);}(_0xef82,0x98));var _0x2ef8=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xef82[_0x36ed48];return _0x51c63a;};'use strict';var util=require('util');var _=require(_0x2ef8('0x0'));var BPromise=require(_0x2ef8('0x1'));var uuid=require('uuid');var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x2ef8('0x2'));var gs=require(_0x2ef8('0x3'));var logger=require(_0x2ef8('0x4'))(_0x2ef8('0x5'));var ami=require('../ami');var rpcDb=require(_0x2ef8('0x6'));var Channel=require(_0x2ef8('0x7'));var ut=require(_0x2ef8('0x8'));var Action=require(_0x2ef8('0x9'));var faxAccount=require(_0x2ef8('0xa'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x2ef8('0xb'));function Fax(_0x1b66e0){this[_0x2ef8('0xc')]={};this[_0x2ef8('0xd')]=_0x1b66e0[_0x2ef8('0xd')];this[_0x2ef8('0xe')]=_0x1b66e0[_0x2ef8('0xe')];this['actions']={};ami['on'](_0x2ef8('0xf'),this['syncNewchannel'][_0x2ef8('0x10')](this));ami['on'](_0x2ef8('0x11'),this[_0x2ef8('0x12')][_0x2ef8('0x10')](this));ami['on'](_0x2ef8('0x13'),this[_0x2ef8('0x14')][_0x2ef8('0x10')](this));ami['on'](_0x2ef8('0x15'),this[_0x2ef8('0x16')][_0x2ef8('0x10')](this));ami['on'](_0x2ef8('0x17'),this['syncFaxStatus'][_0x2ef8('0x10')](this));ami['on'](_0x2ef8('0x18'),this['syncReceiveFax'][_0x2ef8('0x10')](this));ami['on']('hangup',this[_0x2ef8('0x19')][_0x2ef8('0x10')](this));ami['on'](_0x2ef8('0x1a'),this[_0x2ef8('0x1b')][_0x2ef8('0x10')](this));}Fax[_0x2ef8('0x1c')][_0x2ef8('0x1d')]=function(_0x23a96b){if(_0x23a96b[_0x2ef8('0x1e')]===_0x2ef8('0x1f')){for(var _0xd8570c in this[_0x2ef8('0xd')]){if(this[_0x2ef8('0xd')][_0x2ef8('0x20')](_0xd8570c)){if(_0x23a96b[_0x2ef8('0x21')]===this[_0x2ef8('0xd')][_0xd8570c]['localstationid']){this[_0x2ef8('0xc')][_0x23a96b[_0x2ef8('0x22')]]={};this[_0x2ef8('0xc')][_0x23a96b[_0x2ef8('0x22')]]['channel']=_0x23a96b[_0x2ef8('0x23')];this[_0x2ef8('0xc')][_0x23a96b[_0x2ef8('0x22')]]['id']=this[_0x2ef8('0xd')][_0xd8570c]['id'];this[_0x2ef8('0xc')][_0x23a96b[_0x2ef8('0x22')]]['name']=this[_0x2ef8('0xd')][_0xd8570c][_0x2ef8('0x24')];logger[_0x2ef8('0x25')](_0x23a96b[_0x2ef8('0x22')],_0x2ef8('0x26'));}}}}if(this[_0x2ef8('0x27')][_0x23a96b[_0x2ef8('0x22')]]){this[_0x2ef8('0xc')][_0x23a96b['uniqueid']]={};this[_0x2ef8('0xc')][_0x23a96b[_0x2ef8('0x22')]][_0x2ef8('0x23')]=_0x23a96b['channel'];logger[_0x2ef8('0x25')](_0x23a96b[_0x2ef8('0x22')],'\x20syncNewchannel\x20');}};Fax[_0x2ef8('0x1c')][_0x2ef8('0x12')]=function(_0x3cf7e){if(this[_0x2ef8('0xc')][_0x3cf7e[_0x2ef8('0x22')]]){for(var _0x353478 in _0x3cf7e['variable']){if(_0x3cf7e[_0x2ef8('0x28')]['hasOwnProperty'](_0x353478)){this[_0x2ef8('0xc')][_0x3cf7e['uniqueid']][_0x353478]=_0x3cf7e[_0x2ef8('0x29')];}}}};Fax[_0x2ef8('0x1c')][_0x2ef8('0x14')]=function(_0x3895b5){if(this['channels'][_0x3895b5[_0x2ef8('0x22')]]){this[_0x2ef8('0xc')][_0x3895b5[_0x2ef8('0x22')]]['channelstate']=_0x3895b5['channelstate'];this['channels'][_0x3895b5[_0x2ef8('0x22')]][_0x2ef8('0x2a')]=_0x3895b5[_0x2ef8('0x2a')];}};Fax[_0x2ef8('0x1c')][_0x2ef8('0x16')]=function(_0x2ce6f1){if(this[_0x2ef8('0xc')][_0x2ce6f1['uniqueid']]){for(var _0x499377 in _0x2ce6f1[_0x2ef8('0x28')]){if(_0x2ce6f1[_0x2ef8('0x28')]['hasOwnProperty'](_0x499377)){this[_0x2ef8('0xc')][_0x2ce6f1[_0x2ef8('0x22')]][_0x499377]=_0x2ce6f1[_0x2ef8('0x29')];}}}};Fax[_0x2ef8('0x1c')][_0x2ef8('0x2b')]=function(_0x2df4c4){if(this[_0x2ef8('0xc')][_0x2df4c4[_0x2ef8('0x22')]]){this[_0x2ef8('0xc')][_0x2df4c4[_0x2ef8('0x22')]][_0x2ef8('0x2c')]=_0x2df4c4['operation'];this[_0x2ef8('0xc')][_0x2df4c4[_0x2ef8('0x22')]][_0x2ef8('0x2d')]=_0x2df4c4[_0x2ef8('0x2d')];this[_0x2ef8('0xc')][_0x2df4c4[_0x2ef8('0x22')]][_0x2ef8('0x2e')]=_0x2df4c4[_0x2ef8('0x2e')];this['channels'][_0x2df4c4[_0x2ef8('0x22')]][_0x2ef8('0x2f')]=_0x2df4c4['filename'];logger[_0x2ef8('0x25')](_0x2df4c4[_0x2ef8('0x22')],_0x2ef8('0x30'));}};Fax['prototype'][_0x2ef8('0x31')]=function(_0x21d52e){var _0x3c31cc=this;if(this['channels'][_0x21d52e[_0x2ef8('0x22')]]){var _0x196b33=this[_0x2ef8('0xc')][_0x21d52e[_0x2ef8('0x22')]]['id'];this['channels'][_0x21d52e[_0x2ef8('0x22')]][_0x2ef8('0x32')]=_0x21d52e[_0x2ef8('0x32')];this[_0x2ef8('0xc')][_0x21d52e[_0x2ef8('0x22')]][_0x2ef8('0x33')]=_0x21d52e[_0x2ef8('0x33')];this['channels'][_0x21d52e[_0x2ef8('0x22')]][_0x2ef8('0x2e')]=_0x21d52e[_0x2ef8('0x2e')];this[_0x2ef8('0xc')][_0x21d52e[_0x2ef8('0x22')]][_0x2ef8('0x34')]=_0x21d52e['resolution'];this['channels'][_0x21d52e[_0x2ef8('0x22')]][_0x2ef8('0x35')]=_0x21d52e['transferrate'];this[_0x2ef8('0xc')][_0x21d52e['uniqueid']]['filename']=_0x21d52e[_0x2ef8('0x2f')];this[_0x2ef8('0xc')][_0x21d52e[_0x2ef8('0x22')]]['calleridnum']=_0x21d52e[_0x2ef8('0x36')];if(this[_0x2ef8('0xc')][_0x21d52e['uniqueid']][_0x2ef8('0x33')]>0x0){tiff2pdf(_0x21d52e[_0x2ef8('0x2f')],_0x2ef8('0x37'),function(_0x9a3df){logger['info'](_0x21d52e[_0x2ef8('0x22')],_0x2ef8('0x38'),_0x9a3df['message']);attachment[_0x2ef8('0x39')]({'name':path['parse'](_0x21d52e[_0x2ef8('0x2f')])[_0x2ef8('0x24')],'basename':path[_0x2ef8('0x3a')](_0x21d52e[_0x2ef8('0x2f')])[_0x2ef8('0x24')]+_0x2ef8('0x3b'),'type':_0x2ef8('0x3c')})[_0x2ef8('0x3d')](function(_0x484131){faxAccount['notify'](_0x196b33,{'from':_0x21d52e['calleridnum'],'mapKey':_0x2ef8('0x5'),'body':path[_0x2ef8('0x3a')](_0x21d52e[_0x2ef8('0x2f')])[_0x2ef8('0x24')]+_0x2ef8('0x3b'),'AttachmentId':_0x484131['id']})[_0x2ef8('0x3e')](function(_0x555d3d){logger[_0x2ef8('0x3f')](_0x21d52e[_0x2ef8('0x22')],_0x2ef8('0x40'),JSON['stringify'](_0x555d3d));});})[_0x2ef8('0x3e')](function(_0x22c25f){logger[_0x2ef8('0x3f')](_0x21d52e[_0x2ef8('0x22')],'\x20receiveFax\x20',JSON['stringify'](_0x22c25f));});});}logger[_0x2ef8('0x25')](_0x21d52e[_0x2ef8('0x22')],_0x2ef8('0x41'));}};Fax[_0x2ef8('0x1c')][_0x2ef8('0x1b')]=function(_0x4f11f4){if(this[_0x2ef8('0x27')][_0x4f11f4[_0x2ef8('0x22')]]){_[_0x2ef8('0x42')](this[_0x2ef8('0xc')][_0x4f11f4[_0x2ef8('0x22')]],_[_0x2ef8('0x43')](_0x4f11f4,[_0x2ef8('0x44'),'reason']));}};function updateStatus(_0xf35150){if(_0xf35150[_0x2ef8('0x45')]){faxMessage[_0x2ef8('0x46')](_0xf35150[_0x2ef8('0x45')],{'failMessage':_0x2ef8('0x47')})[_0x2ef8('0x3d')](function(_0x4922a9){ut[_0x2ef8('0x48')]('[Fax][Message][Error][Updated]',_0x4922a9);})[_0x2ef8('0x3e')](function(_0x50dd83){ut['logger'](_0x2ef8('0x49'),_0x50dd83);});}else{ut['logger'](_0x2ef8('0x4a'));}}Fax[_0x2ef8('0x1c')][_0x2ef8('0x4b')]=function(_0x3defd2,_0xae57ee,_0x5d5646){var _0x2c0b83=this;var _0x34067d={};if(_0xae57ee){_0x34067d={'read':_0xae57ee};}else{_0x34067d={'failMessage':_0x5d5646};}if(this['actions'][_0x3defd2][_0x2ef8('0x45')]){faxMessage[_0x2ef8('0x46')](this['actions'][_0x3defd2][_0x2ef8('0x45')],_0x34067d)[_0x2ef8('0x3d')](function(_0x1afd07){ut[_0x2ef8('0x48')]('[Fax][Message][Updated]',_0x1afd07);})[_0x2ef8('0x3e')](function(_0x497028){ut[_0x2ef8('0x48')](_0x2ef8('0x4c'),_0x497028);})[_0x2ef8('0x4d')](function(){delete _0x2c0b83[_0x2ef8('0xc')][_0x3defd2];delete _0x2c0b83[_0x2ef8('0x27')][_0x3defd2];});}else{ut['logger'](_0x2ef8('0x4e'));delete this[_0x2ef8('0xc')][_0x3defd2];delete this[_0x2ef8('0x27')][_0x3defd2];}};Fax[_0x2ef8('0x1c')][_0x2ef8('0x19')]=function(_0x300520){var _0x6c3c15=this;if(this[_0x2ef8('0xc')][_0x300520[_0x2ef8('0x22')]]){if(this[_0x2ef8('0x27')][_0x300520[_0x2ef8('0x22')]]){this['channels'][_0x300520[_0x2ef8('0x22')]]['id']=this['actions'][_0x300520[_0x2ef8('0x22')]]['id'];this[_0x2ef8('0xc')][_0x300520['uniqueid']][_0x2ef8('0x24')]=this[_0x2ef8('0x27')][_0x300520[_0x2ef8('0x22')]][_0x2ef8('0x24')];}logger[_0x2ef8('0x25')](_0x300520[_0x2ef8('0x22')],this[_0x2ef8('0x27')][_0x300520['uniqueid']]?_0x2ef8('0x4f'):_0x2ef8('0x50'),JSON[_0x2ef8('0x51')](this[_0x2ef8('0xc')][_0x300520['uniqueid']]));if(this[_0x2ef8('0x27')][_0x300520['uniqueid']]){if(this['channels'][_0x300520['uniqueid']][_0x2ef8('0x52')]>0x0&&this[_0x2ef8('0xc')][_0x300520[_0x2ef8('0x22')]][_0x2ef8('0x17')]===_0x2ef8('0x53')){this['updateStatus'](_0x300520['uniqueid'],!![]);}else{this[_0x2ef8('0x4b')](_0x300520[_0x2ef8('0x22')],![],this[_0x2ef8('0xc')][_0x300520['uniqueid']][_0x2ef8('0x54')]?_0x2ef8('0x55')+this[_0x2ef8('0xc')][_0x300520['uniqueid']][_0x2ef8('0x54')]:_0x2ef8('0x56'));}}}};Fax[_0x2ef8('0x1c')]['send']=function(_0x59782b){var _0x117746=this;return new BPromise(function(_0x1afac5,_0x3d67b5){_0x117746[_0x2ef8('0x57')](_0x59782b,_0x117746['faxAccounts'][_0x59782b[_0x2ef8('0x58')]])[_0x2ef8('0x3d')](function(_0x2b9554){ut['logger'](_0x2ef8('0x59'),_0x2b9554);_0x1afac5(ut['message']('Fax\x20received'));})['catch'](function(_0x5b7173){ut[_0x2ef8('0x48')]('[Fax][execOriginate][failure]',_0x5b7173);updateStatus(_0x59782b);_0x3d67b5(ut[_0x2ef8('0x5a')]('Fax\x20failed'));});});};Fax['prototype'][_0x2ef8('0x5b')]=function(_0x17577d){var _0x3d78da=this;return new BPromise(function(_0x2739f2,_0x5822fa){var _0x1f8a18=_0x3d78da[_0x2ef8('0x5c')](_0x3d78da[_0x2ef8('0xd')][_0x17577d[_0x2ef8('0x58')]][_0x2ef8('0x5d')],_0x17577d);if(_0x1f8a18[_0x2ef8('0x5e')]){_0x2739f2(ut[_0x2ef8('0x5a')](_0x2ef8('0x5f')));}else{_0x5822fa(ut[_0x2ef8('0x5a')](_0x1f8a18[_0x2ef8('0x5a')]));}});};function originate(_0x28132f,_0x3d5834,_0x9312eb){return new BPromise(function(_0x401f21,_0x1b78be){if(_0x9312eb){var _0x2aaa7e=util[_0x2ef8('0x60')](_0x2ef8('0x61'),path[_0x2ef8('0x3a')](_0x28132f[_0x2ef8('0x62')])['name'],_0x28132f[_0x2ef8('0x62')]);gs[_0x2ef8('0x63')](_0x2aaa7e)[_0x2ef8('0x3d')](function(){_0x28132f[_0x2ef8('0x62')]=util[_0x2ef8('0x60')](_0x2ef8('0x64'),path['parse'](_0x28132f[_0x2ef8('0x62')])[_0x2ef8('0x65')],path[_0x2ef8('0x3a')](_0x28132f[_0x2ef8('0x62')])['name']);_0x3d5834['XMF-PATH']=_0x28132f[_0x2ef8('0x62')];ut[_0x2ef8('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0x2ef8('0x66')](ut[_0x2ef8('0x67')](_0x28132f,_0x3d5834))[_0x2ef8('0x3d')](function(_0x4105bb){_0x401f21(_0x4105bb);})[_0x2ef8('0x3e')](function(_0x39d96f){_0x1b78be(_0x39d96f);});})[_0x2ef8('0x3e')](function(_0x2e40d){_0x1b78be(_0x2e40d);});}else{ami[_0x2ef8('0x66')](ut[_0x2ef8('0x67')](_0x28132f,_0x3d5834))[_0x2ef8('0x3d')](function(_0x5c7ba5){_0x401f21(_0x5c7ba5);})[_0x2ef8('0x3e')](function(_0x1ed2c9){_0x1b78be(_0x1ed2c9);});}});}Fax[_0x2ef8('0x1c')]['execOriginate']=function(_0x5b3703,_0x3b0d8f){var _0x521ca1=this;return new BPromise(function(_0xc3ec7b,_0x2da01e){var _0x390aab=uuid['v4']();var _0x5e2267=ut[_0x2ef8('0x68')](_0x5b3703,_0x3b0d8f);_0x521ca1[_0x2ef8('0x27')][_0x390aab]=new Action(_0x390aab,_0x3b0d8f,_0x5b3703);var _0x2c79f2=_0x521ca1[_0x2ef8('0x27')][_0x390aab];if(path[_0x2ef8('0x3a')](_0x5b3703[_0x2ef8('0x62')])[_0x2ef8('0x69')]===_0x2ef8('0x3b')){originate(_0x2c79f2,_0x5e2267,!![])['then'](function(_0x43a4d6){_0xc3ec7b(_0x43a4d6);})[_0x2ef8('0x3e')](function(_0x2c10f3){_0x2da01e(_0x2c10f3);});}else{originate(_0x2c79f2,_0x5e2267,![])[_0x2ef8('0x3d')](function(_0x4c9a8f){_0xc3ec7b(_0x4c9a8f);})[_0x2ef8('0x3e')](function(_0x2bcefd){_0x2da01e(_0x2bcefd);});}});};Fax[_0x2ef8('0x1c')][_0x2ef8('0x6a')]=function(_0x120c52){return!_[_0x2ef8('0x6b')](_0x120c52)&&!_[_0x2ef8('0x6b')](_0x120c52[_0x2ef8('0x24')])&&!_[_0x2ef8('0x6b')](_0x120c52[_0x2ef8('0x6c')])&&_0x120c52[_0x2ef8('0x6c')]&&!_[_0x2ef8('0x6b')](this[_0x2ef8('0xe')][util['format']('SIP/%s',_0x120c52['name'])])&&!_[_0x2ef8('0x6b')](this['trunks'][util[_0x2ef8('0x60')](_0x2ef8('0x6d'),_0x120c52['name'])][_0x2ef8('0x2d')])&&(this[_0x2ef8('0xe')][util['format'](_0x2ef8('0x6d'),_0x120c52[_0x2ef8('0x24')])][_0x2ef8('0x2d')]===_0x2ef8('0x6e')||this[_0x2ef8('0xe')][util[_0x2ef8('0x60')](_0x2ef8('0x6d'),_0x120c52[_0x2ef8('0x24')])][_0x2ef8('0x2d')]===_0x2ef8('0x6f'));};Fax[_0x2ef8('0x1c')][_0x2ef8('0x5c')]=function(_0x97b323,_0x2b3656){if(!this[_0x2ef8('0x6a')](_0x97b323)){ut[_0x2ef8('0x48')](_0x2ef8('0x70'),_['isNil'](_0x97b323)?'':_0x97b323['name']+_0x2ef8('0x71'));return{'isValid':![],'message':_0x2ef8('0x72')};}if(_[_0x2ef8('0x6b')](_0x2b3656['fax'])){ut['logger'](_0x2ef8('0x73'),JSON['stringify'](_0x2b3656));return{'isValid':![],'message':_0x2ef8('0x74')};}if(_[_0x2ef8('0x6b')](_0x2b3656[_0x2ef8('0x62')])){ut[_0x2ef8('0x48')](_0x2ef8('0x75'),JSON[_0x2ef8('0x51')](_0x2b3656));return{'isValid':![],'message':_0x2ef8('0x76')};}return{'isValid':!![],'message':_0x2ef8('0x77')};};module[_0x2ef8('0x78')]=Fax; \ No newline at end of file +var _0xce01=['newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','originateresponse','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','prototype','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','application/pdf','then','notify','catch','error','\x20receiveFax\x20','merge','pick','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','.pdf','isTrunkReachable','isNil','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','bluebird','uuid','path','tiff2pdf','../../../config/logger','fax','../ami','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions'];(function(_0x559d65,_0x5aaac0){var _0x263d31=function(_0x26021e){while(--_0x26021e){_0x559d65['push'](_0x559d65['shift']());}};_0x263d31(++_0x5aaac0);}(_0xce01,0x1b4));var _0x1ce0=function(_0x4e90d6,_0x2475a3){_0x4e90d6=_0x4e90d6-0x0;var _0x4edfa6=_0xce01[_0x4e90d6];return _0x4edfa6;};'use strict';var util=require(_0x1ce0('0x0'));var _=require('lodash');var BPromise=require(_0x1ce0('0x1'));var uuid=require(_0x1ce0('0x2'));var moment=require('moment');var path=require(_0x1ce0('0x3'));var tiff2pdf=require(_0x1ce0('0x4'));var gs=require('./util/gs');var logger=require(_0x1ce0('0x5'))(_0x1ce0('0x6'));var ami=require(_0x1ce0('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x1ce0('0x8'));var ut=require(_0x1ce0('0x9'));var Action=require('./action');var faxAccount=require(_0x1ce0('0xa'));var attachment=require(_0x1ce0('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x5b877f){this[_0x1ce0('0xc')]={};this[_0x1ce0('0xd')]=_0x5b877f[_0x1ce0('0xd')];this[_0x1ce0('0xe')]=_0x5b877f[_0x1ce0('0xe')];this[_0x1ce0('0xf')]={};ami['on'](_0x1ce0('0x10'),this[_0x1ce0('0x11')][_0x1ce0('0x12')](this));ami['on'](_0x1ce0('0x13'),this[_0x1ce0('0x14')]['bind'](this));ami['on'](_0x1ce0('0x15'),this[_0x1ce0('0x16')][_0x1ce0('0x12')](this));ami['on'](_0x1ce0('0x17'),this[_0x1ce0('0x18')][_0x1ce0('0x12')](this));ami['on'](_0x1ce0('0x19'),this[_0x1ce0('0x1a')][_0x1ce0('0x12')](this));ami['on']('receivefax',this[_0x1ce0('0x1b')][_0x1ce0('0x12')](this));ami['on'](_0x1ce0('0x1c'),this['syncHangup'][_0x1ce0('0x12')](this));ami['on'](_0x1ce0('0x1d'),this['syncOriginateResponse'][_0x1ce0('0x12')](this));}Fax['prototype'][_0x1ce0('0x11')]=function(_0x4d2855){if(_0x4d2855[_0x1ce0('0x1e')]===_0x1ce0('0x1f')){for(var _0x4f1656 in this[_0x1ce0('0xd')]){if(this[_0x1ce0('0xd')]['hasOwnProperty'](_0x4f1656)){if(_0x4d2855[_0x1ce0('0x20')]===this[_0x1ce0('0xd')][_0x4f1656][_0x1ce0('0x21')]){this[_0x1ce0('0xc')][_0x4d2855[_0x1ce0('0x22')]]={};this['channels'][_0x4d2855[_0x1ce0('0x22')]][_0x1ce0('0x23')]=_0x4d2855[_0x1ce0('0x23')];this['channels'][_0x4d2855[_0x1ce0('0x22')]]['id']=this[_0x1ce0('0xd')][_0x4f1656]['id'];this[_0x1ce0('0xc')][_0x4d2855[_0x1ce0('0x22')]][_0x1ce0('0x24')]=this[_0x1ce0('0xd')][_0x4f1656][_0x1ce0('0x24')];logger[_0x1ce0('0x25')](_0x4d2855[_0x1ce0('0x22')],_0x1ce0('0x26'));}}}}if(this[_0x1ce0('0xf')][_0x4d2855['uniqueid']]){this['channels'][_0x4d2855['uniqueid']]={};this['channels'][_0x4d2855[_0x1ce0('0x22')]][_0x1ce0('0x23')]=_0x4d2855['channel'];logger['info'](_0x4d2855[_0x1ce0('0x22')],_0x1ce0('0x26'));}};Fax['prototype']['syncVarSet']=function(_0x46452a){if(this['channels'][_0x46452a[_0x1ce0('0x22')]]){for(var _0x280d8d in _0x46452a['variable']){if(_0x46452a[_0x1ce0('0x27')][_0x1ce0('0x28')](_0x280d8d)){this[_0x1ce0('0xc')][_0x46452a[_0x1ce0('0x22')]][_0x280d8d]=_0x46452a[_0x1ce0('0x29')];}}}};Fax[_0x1ce0('0x2a')][_0x1ce0('0x16')]=function(_0x296e8a){if(this[_0x1ce0('0xc')][_0x296e8a[_0x1ce0('0x22')]]){this['channels'][_0x296e8a['uniqueid']]['channelstate']=_0x296e8a['channelstate'];this[_0x1ce0('0xc')][_0x296e8a[_0x1ce0('0x22')]][_0x1ce0('0x2b')]=_0x296e8a[_0x1ce0('0x2b')];}};Fax[_0x1ce0('0x2a')][_0x1ce0('0x18')]=function(_0x55e7b5){if(this[_0x1ce0('0xc')][_0x55e7b5[_0x1ce0('0x22')]]){for(var _0x41c17e in _0x55e7b5[_0x1ce0('0x27')]){if(_0x55e7b5['variable']['hasOwnProperty'](_0x41c17e)){this[_0x1ce0('0xc')][_0x55e7b5[_0x1ce0('0x22')]][_0x41c17e]=_0x55e7b5['value'];}}}};Fax[_0x1ce0('0x2a')]['syncFaxStatus']=function(_0x1099f7){if(this['channels'][_0x1099f7['uniqueid']]){this[_0x1ce0('0xc')][_0x1099f7['uniqueid']][_0x1ce0('0x2c')]=_0x1099f7['operation'];this[_0x1ce0('0xc')][_0x1099f7[_0x1ce0('0x22')]][_0x1ce0('0x2d')]=_0x1099f7[_0x1ce0('0x2d')];this[_0x1ce0('0xc')][_0x1099f7['uniqueid']][_0x1ce0('0x21')]=_0x1099f7[_0x1ce0('0x21')];this[_0x1ce0('0xc')][_0x1099f7[_0x1ce0('0x22')]]['filename']=_0x1099f7[_0x1ce0('0x2e')];logger['info'](_0x1099f7[_0x1ce0('0x22')],_0x1ce0('0x2f'));}};Fax[_0x1ce0('0x2a')]['syncReceiveFax']=function(_0x47d6ad){var _0x1609f1=this;if(this[_0x1ce0('0xc')][_0x47d6ad[_0x1ce0('0x22')]]){var _0x22988a=this['channels'][_0x47d6ad[_0x1ce0('0x22')]]['id'];this['channels'][_0x47d6ad['uniqueid']][_0x1ce0('0x30')]=_0x47d6ad[_0x1ce0('0x30')];this[_0x1ce0('0xc')][_0x47d6ad['uniqueid']]['pagestransferred']=_0x47d6ad[_0x1ce0('0x31')];this[_0x1ce0('0xc')][_0x47d6ad['uniqueid']]['localstationid']=_0x47d6ad[_0x1ce0('0x21')];this[_0x1ce0('0xc')][_0x47d6ad['uniqueid']]['resolution']=_0x47d6ad[_0x1ce0('0x32')];this[_0x1ce0('0xc')][_0x47d6ad[_0x1ce0('0x22')]][_0x1ce0('0x33')]=_0x47d6ad[_0x1ce0('0x33')];this[_0x1ce0('0xc')][_0x47d6ad['uniqueid']][_0x1ce0('0x2e')]=_0x47d6ad['filename'];this['channels'][_0x47d6ad[_0x1ce0('0x22')]][_0x1ce0('0x34')]=_0x47d6ad[_0x1ce0('0x34')];if(this[_0x1ce0('0xc')][_0x47d6ad[_0x1ce0('0x22')]][_0x1ce0('0x31')]>0x0){tiff2pdf(_0x47d6ad[_0x1ce0('0x2e')],_0x1ce0('0x35'),function(_0x53b60c){logger[_0x1ce0('0x25')](_0x47d6ad[_0x1ce0('0x22')],_0x1ce0('0x36'),_0x53b60c[_0x1ce0('0x37')]);attachment['create']({'name':path[_0x1ce0('0x38')](_0x47d6ad['filename'])[_0x1ce0('0x24')],'basename':path[_0x1ce0('0x38')](_0x47d6ad[_0x1ce0('0x2e')])[_0x1ce0('0x24')]+'.pdf','type':_0x1ce0('0x39')})[_0x1ce0('0x3a')](function(_0x7dd18c){faxAccount[_0x1ce0('0x3b')](_0x22988a,{'from':_0x47d6ad[_0x1ce0('0x34')],'mapKey':'fax','body':path['parse'](_0x47d6ad['filename'])[_0x1ce0('0x24')]+'.pdf','AttachmentId':_0x7dd18c['id']})[_0x1ce0('0x3c')](function(_0x35499c){logger[_0x1ce0('0x3d')](_0x47d6ad[_0x1ce0('0x22')],'\x20notify\x20',JSON['stringify'](_0x35499c));});})[_0x1ce0('0x3c')](function(_0x517da4){logger['error'](_0x47d6ad[_0x1ce0('0x22')],_0x1ce0('0x3e'),JSON['stringify'](_0x517da4));});});}logger[_0x1ce0('0x25')](_0x47d6ad[_0x1ce0('0x22')],_0x1ce0('0x3e'));}};Fax[_0x1ce0('0x2a')]['syncOriginateResponse']=function(_0xa74403){if(this[_0x1ce0('0xf')][_0xa74403[_0x1ce0('0x22')]]){_[_0x1ce0('0x3f')](this[_0x1ce0('0xc')][_0xa74403[_0x1ce0('0x22')]],_[_0x1ce0('0x40')](_0xa74403,['response',_0x1ce0('0x41')]));}};function updateStatus(_0x453029){if(_0x453029['AttachmentId']){faxMessage[_0x1ce0('0x42')](_0x453029[_0x1ce0('0x43')],{'failMessage':_0x1ce0('0x44')})[_0x1ce0('0x3a')](function(_0x2c8daf){ut[_0x1ce0('0x45')](_0x1ce0('0x46'),_0x2c8daf);})[_0x1ce0('0x3c')](function(_0x5d2a7d){ut[_0x1ce0('0x45')](_0x1ce0('0x47'),_0x5d2a7d);});}else{ut[_0x1ce0('0x45')](_0x1ce0('0x48'));}}Fax[_0x1ce0('0x2a')][_0x1ce0('0x49')]=function(_0x3e1e0d,_0x173d68,_0x50a0e5){var _0x42c36f=this;var _0x53afbc={};if(_0x173d68){_0x53afbc={'read':_0x173d68};}else{_0x53afbc={'failMessage':_0x50a0e5};}if(this[_0x1ce0('0xf')][_0x3e1e0d][_0x1ce0('0x43')]){faxMessage[_0x1ce0('0x42')](this[_0x1ce0('0xf')][_0x3e1e0d][_0x1ce0('0x43')],_0x53afbc)['then'](function(_0xbcccab){ut[_0x1ce0('0x45')](_0x1ce0('0x4a'),_0xbcccab);})['catch'](function(_0x33a371){ut[_0x1ce0('0x45')](_0x1ce0('0x4b'),_0x33a371);})[_0x1ce0('0x4c')](function(){delete _0x42c36f[_0x1ce0('0xc')][_0x3e1e0d];delete _0x42c36f['actions'][_0x3e1e0d];});}else{ut['logger'](_0x1ce0('0x4d'));delete this['channels'][_0x3e1e0d];delete this['actions'][_0x3e1e0d];}};Fax['prototype'][_0x1ce0('0x4e')]=function(_0x6ff135){var _0x52834f=this;if(this[_0x1ce0('0xc')][_0x6ff135[_0x1ce0('0x22')]]){if(this[_0x1ce0('0xf')][_0x6ff135[_0x1ce0('0x22')]]){this['channels'][_0x6ff135['uniqueid']]['id']=this['actions'][_0x6ff135[_0x1ce0('0x22')]]['id'];this[_0x1ce0('0xc')][_0x6ff135[_0x1ce0('0x22')]][_0x1ce0('0x24')]=this['actions'][_0x6ff135[_0x1ce0('0x22')]]['name'];}logger['info'](_0x6ff135[_0x1ce0('0x22')],this['actions'][_0x6ff135[_0x1ce0('0x22')]]?_0x1ce0('0x4f'):_0x1ce0('0x50'),JSON[_0x1ce0('0x51')](this[_0x1ce0('0xc')][_0x6ff135[_0x1ce0('0x22')]]));if(this[_0x1ce0('0xf')][_0x6ff135[_0x1ce0('0x22')]]){if(this[_0x1ce0('0xc')][_0x6ff135[_0x1ce0('0x22')]][_0x1ce0('0x52')]>0x0&&this['channels'][_0x6ff135[_0x1ce0('0x22')]]['faxstatus']===_0x1ce0('0x53')){this[_0x1ce0('0x49')](_0x6ff135[_0x1ce0('0x22')],!![]);}else{this[_0x1ce0('0x49')](_0x6ff135['uniqueid'],![],this[_0x1ce0('0xc')][_0x6ff135[_0x1ce0('0x22')]][_0x1ce0('0x54')]?_0x1ce0('0x55')+this[_0x1ce0('0xc')][_0x6ff135[_0x1ce0('0x22')]]['faxstatusstring']:_0x1ce0('0x56'));}}}};Fax[_0x1ce0('0x2a')]['send']=function(_0x3185f1){var _0x4fe138=this;return new BPromise(function(_0x3bb1c6,_0x44e45b){_0x4fe138[_0x1ce0('0x57')](_0x3185f1,_0x4fe138['faxAccounts'][_0x3185f1[_0x1ce0('0x58')]])[_0x1ce0('0x3a')](function(_0x228ae6){ut[_0x1ce0('0x45')](_0x1ce0('0x59'),_0x228ae6);_0x3bb1c6(ut['message'](_0x1ce0('0x5a')));})[_0x1ce0('0x3c')](function(_0x88bd73){ut['logger'](_0x1ce0('0x5b'),_0x88bd73);updateStatus(_0x3185f1);_0x44e45b(ut[_0x1ce0('0x37')](_0x1ce0('0x5c')));});});};Fax['prototype']['checkAfterSend']=function(_0x51644b){var _0x3324f9=this;return new BPromise(function(_0x2057ce,_0x37df2a){var _0x20165a=_0x3324f9['checkTrunk'](_0x3324f9[_0x1ce0('0xd')][_0x51644b[_0x1ce0('0x58')]]['Trunk'],_0x51644b);if(_0x20165a[_0x1ce0('0x5d')]){_0x2057ce(ut[_0x1ce0('0x37')](_0x1ce0('0x5e')));}else{_0x37df2a(ut[_0x1ce0('0x37')](_0x20165a[_0x1ce0('0x37')]));}});};function originate(_0x226757,_0x40116a,_0xdb7321){return new BPromise(function(_0x1bf93a,_0x147bee){if(_0xdb7321){var _0x4424b2=util[_0x1ce0('0x5f')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x1ce0('0x38')](_0x226757[_0x1ce0('0x3')])[_0x1ce0('0x24')],_0x226757[_0x1ce0('0x3')]);gs[_0x1ce0('0x60')](_0x4424b2)[_0x1ce0('0x3a')](function(){_0x226757[_0x1ce0('0x3')]=util[_0x1ce0('0x5f')](_0x1ce0('0x61'),path[_0x1ce0('0x38')](_0x226757['path'])[_0x1ce0('0x62')],path[_0x1ce0('0x38')](_0x226757['path'])[_0x1ce0('0x24')]);_0x40116a[_0x1ce0('0x63')]=_0x226757[_0x1ce0('0x3')];ut[_0x1ce0('0x45')]('Convert\x20pdf\x20to\x20tif','');ami[_0x1ce0('0x64')](ut[_0x1ce0('0x65')](_0x226757,_0x40116a))[_0x1ce0('0x3a')](function(_0x142592){_0x1bf93a(_0x142592);})[_0x1ce0('0x3c')](function(_0x46f6bd){_0x147bee(_0x46f6bd);});})[_0x1ce0('0x3c')](function(_0x323bf2){_0x147bee(_0x323bf2);});}else{ami[_0x1ce0('0x64')](ut[_0x1ce0('0x65')](_0x226757,_0x40116a))[_0x1ce0('0x3a')](function(_0x305b50){_0x1bf93a(_0x305b50);})[_0x1ce0('0x3c')](function(_0x53e6fb){_0x147bee(_0x53e6fb);});}});}Fax[_0x1ce0('0x2a')][_0x1ce0('0x57')]=function(_0x3b393a,_0x1b5954){var _0x2e0b72=this;return new BPromise(function(_0x5b4b70,_0x1c2594){var _0x5ac09e=uuid['v4']();var _0x50a7ce=ut['addVariables'](_0x3b393a,_0x1b5954);_0x2e0b72['actions'][_0x5ac09e]=new Action(_0x5ac09e,_0x1b5954,_0x3b393a);var _0x191240=_0x2e0b72[_0x1ce0('0xf')][_0x5ac09e];if(path[_0x1ce0('0x38')](_0x3b393a['path'])['ext']===_0x1ce0('0x66')){originate(_0x191240,_0x50a7ce,!![])[_0x1ce0('0x3a')](function(_0x4dab83){_0x5b4b70(_0x4dab83);})[_0x1ce0('0x3c')](function(_0x3a660b){_0x1c2594(_0x3a660b);});}else{originate(_0x191240,_0x50a7ce,![])[_0x1ce0('0x3a')](function(_0x4ea70f){_0x5b4b70(_0x4ea70f);})[_0x1ce0('0x3c')](function(_0x5f29da){_0x1c2594(_0x5f29da);});}});};Fax[_0x1ce0('0x2a')][_0x1ce0('0x67')]=function(_0x23d798){return!_[_0x1ce0('0x68')](_0x23d798)&&!_[_0x1ce0('0x68')](_0x23d798[_0x1ce0('0x24')])&&!_[_0x1ce0('0x68')](_0x23d798['active'])&&_0x23d798['active']&&!_[_0x1ce0('0x68')](this[_0x1ce0('0xe')][util[_0x1ce0('0x5f')](_0x1ce0('0x69'),_0x23d798[_0x1ce0('0x24')])])&&!_[_0x1ce0('0x68')](this[_0x1ce0('0xe')][util[_0x1ce0('0x5f')](_0x1ce0('0x69'),_0x23d798[_0x1ce0('0x24')])][_0x1ce0('0x2d')])&&(this['trunks'][util['format'](_0x1ce0('0x69'),_0x23d798['name'])][_0x1ce0('0x2d')]===_0x1ce0('0x6a')||this[_0x1ce0('0xe')][util[_0x1ce0('0x5f')]('SIP/%s',_0x23d798[_0x1ce0('0x24')])][_0x1ce0('0x2d')]===_0x1ce0('0x6b'));};Fax['prototype']['checkTrunk']=function(_0x1670d3,_0x53c9e1){if(!this['isTrunkReachable'](_0x1670d3)){ut['logger'](_0x1ce0('0x6c'),_['isNil'](_0x1670d3)?'':_0x1670d3[_0x1ce0('0x24')]+_0x1ce0('0x6d'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_['isNil'](_0x53c9e1['fax'])){ut[_0x1ce0('0x45')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x1ce0('0x51')](_0x53c9e1));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x1ce0('0x68')](_0x53c9e1['path'])){ut['logger'](_0x1ce0('0x6e'),JSON[_0x1ce0('0x51')](_0x53c9e1));return{'isValid':![],'message':_0x1ce0('0x6f')};}return{'isValid':!![],'message':_0x1ce0('0x70')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 736e8df..6a2e54a 100644 --- a/server/services/ami/fax/rpcDb.js +++ b/server/services/ami/fax/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25e8=['preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','catch','[Notify]\x20','util','bluebird','../../../config/logger'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0x25e8,0x11d));var _0x825e=function(_0x6b3825,_0xcb2e96){_0x6b3825=_0x6b3825-0x0;var _0x10bee6=_0x25e8[_0x6b3825];return _0x10bee6;};'use strict';var util=require(_0x825e('0x0'));var BPromise=require(_0x825e('0x1'));var logger=require(_0x825e('0x2'))(_0x825e('0x3'));var _=require(_0x825e('0x4'));var faxAccount=require(_0x825e('0x5'));function loggerCatch(_0x48dce4){return function(_0x2700b7){logger[_0x825e('0x6')](_0x48dce4,util[_0x825e('0x7')](_0x2700b7,{'showHidden':![],'depth':null}));};}exports[_0x825e('0x8')]=function(_0x8943a7,_0x585858){return BPromise[_0x825e('0x9')]()['then'](faxAccount['notify'](_0x8943a7,_0x585858))[_0x825e('0xa')](loggerCatch(_0x825e('0xb')));}; \ No newline at end of file +var _0x535a=['error','inspect','notify','resolve','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount'];(function(_0x2e2104,_0x2d47bc){var _0x4a0d7e=function(_0x460fe4){while(--_0x460fe4){_0x2e2104['push'](_0x2e2104['shift']());}};_0x4a0d7e(++_0x2d47bc);}(_0x535a,0xc6));var _0xa535=function(_0x2b8004,_0x18ae0b){_0x2b8004=_0x2b8004-0x0;var _0x2eab4a=_0x535a[_0x2b8004];return _0x2eab4a;};'use strict';var util=require(_0xa535('0x0'));var BPromise=require(_0xa535('0x1'));var logger=require(_0xa535('0x2'))(_0xa535('0x3'));var _=require(_0xa535('0x4'));var faxAccount=require(_0xa535('0x5'));function loggerCatch(_0x1e7ca8){return function(_0x3fbe53){logger[_0xa535('0x6')](_0x1e7ca8,util[_0xa535('0x7')](_0x3fbe53,{'showHidden':![],'depth':null}));};}exports[_0xa535('0x8')]=function(_0x3ffbe2,_0x2832f9){return BPromise[_0xa535('0x9')]()['then'](faxAccount[_0xa535('0x8')](_0x3ffbe2,_0x2832f9))[_0xa535('0xa')](loggerCatch(_0xa535('0xb')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 27f0da7..c086ba9 100644 --- a/server/services/ami/fax/util/gs.js +++ b/server/services/ami/fax/util/gs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8163=['util','fax','bluebird','child_process','exec','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x191666,_0x52728b){var _0x57687b=function(_0x4901b0){while(--_0x4901b0){_0x191666['push'](_0x191666['shift']());}};_0x57687b(++_0x52728b);}(_0x8163,0x87));var _0x3816=function(_0x30e40e,_0x2ad25e){_0x30e40e=_0x30e40e-0x0;var _0x35aeb6=_0x8163[_0x30e40e];return _0x35aeb6;};'use strict';var util=require(_0x3816('0x0'));var logger=require('../../../../config/logger')(_0x3816('0x1'));var BPromise=require(_0x3816('0x2'));var exec=require(_0x3816('0x3'))[_0x3816('0x4')];exports['execute']=function(_0x43ce88){return new BPromise(function(_0x5e6103,_0x1a47b5){exec(_0x43ce88,function(_0x11afb1,_0x1cea8b,_0x359614){logger[_0x3816('0x5')]('Exec\x20gs',_0x1cea8b);if(_0x11afb1){logger['info'](_0x3816('0x6'),_0x3816('0x7'),util[_0x3816('0x8')](_0x11afb1,{'showHidden':![],'depth':null}),_0x1cea8b,_0x359614);_0x1a47b5(_0x11afb1);}_0x5e6103(_0x1cea8b);});});}; \ No newline at end of file +var _0xdc42=['inspect','util','../../../../config/logger','fax','bluebird','exec','execute','info','Exec\x20gs'];(function(_0x4272cc,_0x453065){var _0x17b462=function(_0x520dbd){while(--_0x520dbd){_0x4272cc['push'](_0x4272cc['shift']());}};_0x17b462(++_0x453065);}(_0xdc42,0x145));var _0x2dc4=function(_0x50a1fe,_0x3766de){_0x50a1fe=_0x50a1fe-0x0;var _0x40a11c=_0xdc42[_0x50a1fe];return _0x40a11c;};'use strict';var util=require(_0x2dc4('0x0'));var logger=require(_0x2dc4('0x1'))(_0x2dc4('0x2'));var BPromise=require(_0x2dc4('0x3'));var exec=require('child_process')[_0x2dc4('0x4')];exports[_0x2dc4('0x5')]=function(_0xbb7597){return new BPromise(function(_0xca4157,_0x4e0629){exec(_0xbb7597,function(_0x5a506c,_0x494709,_0x3450a9){logger[_0x2dc4('0x6')]('Exec\x20gs',_0x494709);if(_0x5a506c){logger[_0x2dc4('0x6')](_0x2dc4('0x7'),'\x20Error\x20:',util[_0x2dc4('0x8')](_0x5a506c,{'showHidden':![],'depth':null}),_0x494709,_0x3450a9);_0x4e0629(_0x5a506c);}_0xca4157(_0x494709);});});}; \ No newline at end of file diff --git a/server/services/ami/fax/util/util.js b/server/services/ami/fax/util/util.js index 1b5ea93..2094714 100644 --- a/server/services/ami/fax/util/util.js +++ b/server/services/ami/fax/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['channel','xcally-motion-fax','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','../../../../config/logger','fax','message','info','addVariables','ecm','headerinfo','format','modem','t38timeout','localstationid','path','variablesAction','originate'];(function(_0x59a5d0,_0x4b3308){var _0x6840ac=function(_0x2dadf5){while(--_0x2dadf5){_0x59a5d0['push'](_0x59a5d0['shift']());}};_0x6840ac(++_0x4b3308);}(_0xac4a,0x13f));var _0xaac4=function(_0x23b3e7,_0x35f6f1){_0x23b3e7=_0x23b3e7-0x0;var _0x5481bf=_0xac4a[_0x23b3e7];return _0x5481bf;};'use strict';var util=require(_0xaac4('0x0'));var _=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var logger=require(_0xaac4('0x3'))(_0xaac4('0x4'));exports[_0xaac4('0x5')]=function(_0x5aeb7d){return{'message':_0x5aeb7d};};exports['logger']=function(_0x2af0f6,_0x2a5762){logger[_0xaac4('0x6')](_0x2af0f6,util['inspect'](_0x2a5762,{'showHidden':![],'depth':null}));};exports[_0xaac4('0x7')]=function(_0x53d03a,_0x1cdfc5){var _0x5870e8={'XMF-ECM':_0x1cdfc5[_0xaac4('0x8')],'XMF-HEADERINFO':_0x1cdfc5[_0xaac4('0x9')],'XMF-MINRATE':_0x1cdfc5['minrate'],'XMF-MAXRATE':_0x1cdfc5['maxrate'],'XMF-MODEM':util[_0xaac4('0xa')]('\x22%s\x22',_0x1cdfc5[_0xaac4('0xb')]),'XMF-GATEWAY':_0x1cdfc5['gateway'],'XMF-FAXDETECT':_0x1cdfc5['faxdetect'],'XMF-T38TIMEOUT':_0x1cdfc5[_0xaac4('0xc')],'XMF-LOCALSTATIONID':_0x1cdfc5[_0xaac4('0xd')],'XMF-PATH':_0x53d03a[_0xaac4('0xe')]};return _0x5870e8;};exports[_0xaac4('0xf')]=function(_0x3a983c,_0x4e0f72){return{'actionid':_0x3a983c['uniqueid'],'action':_0xaac4('0x10'),'channel':_0x3a983c[_0xaac4('0x11')],'Exten':_0xaac4('0x12'),'Context':'from-sip','Priority':'1','callerid':util[_0xaac4('0xa')](_0xaac4('0x13'),_0x3a983c['headerinfo']?_0x3a983c[_0xaac4('0x9')]:'',_0x3a983c[_0xaac4('0xd')]),'variable':_0x4e0f72,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3a983c[_0xaac4('0x14')]};}; \ No newline at end of file +var _0x3140=['util','lodash','moment','../../../../config/logger','logger','info','inspect','addVariables','ecm','minrate','maxrate','modem','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','headerinfo'];(function(_0x34f9a6,_0x4bf60b){var _0x5a94a2=function(_0x12e12a){while(--_0x12e12a){_0x34f9a6['push'](_0x34f9a6['shift']());}};_0x5a94a2(++_0x4bf60b);}(_0x3140,0xaf));var _0x0314=function(_0x1e830c,_0x31776b){_0x1e830c=_0x1e830c-0x0;var _0x3196e9=_0x3140[_0x1e830c];return _0x3196e9;};'use strict';var util=require(_0x0314('0x0'));var _=require(_0x0314('0x1'));var moment=require(_0x0314('0x2'));var logger=require(_0x0314('0x3'))('fax');exports['message']=function(_0x285be5){return{'message':_0x285be5};};exports[_0x0314('0x4')]=function(_0x1c0f66,_0x3e4284){logger[_0x0314('0x5')](_0x1c0f66,util[_0x0314('0x6')](_0x3e4284,{'showHidden':![],'depth':null}));};exports[_0x0314('0x7')]=function(_0xf87d26,_0x11ee94){var _0x44762d={'XMF-ECM':_0x11ee94[_0x0314('0x8')],'XMF-HEADERINFO':_0x11ee94['headerinfo'],'XMF-MINRATE':_0x11ee94[_0x0314('0x9')],'XMF-MAXRATE':_0x11ee94[_0x0314('0xa')],'XMF-MODEM':util['format']('\x22%s\x22',_0x11ee94[_0x0314('0xb')]),'XMF-GATEWAY':_0x11ee94['gateway'],'XMF-FAXDETECT':_0x11ee94[_0x0314('0xc')],'XMF-T38TIMEOUT':_0x11ee94[_0x0314('0xd')],'XMF-LOCALSTATIONID':_0x11ee94[_0x0314('0xe')],'XMF-PATH':_0xf87d26[_0x0314('0xf')]};return _0x44762d;};exports[_0x0314('0x10')]=function(_0x3e9964,_0x516448){return{'actionid':_0x3e9964[_0x0314('0x11')],'action':_0x0314('0x12'),'channel':_0x3e9964[_0x0314('0x13')],'Exten':_0x0314('0x14'),'Context':_0x0314('0x15'),'Priority':'1','callerid':util[_0x0314('0x16')](_0x0314('0x17'),_0x3e9964['headerinfo']?_0x3e9964[_0x0314('0x18')]:'',_0x3e9964[_0x0314('0xe')]),'variable':_0x516448,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3e9964[_0x0314('0x11')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 9bfd44c..5ebffd9 100644 --- a/server/services/ami/index.js +++ b/server/services/ami/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63fa=['./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initVoiceCallReports','catch','log','listen','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount'];(function(_0x233f75,_0x1928e2){var _0x47d567=function(_0x3c0902){while(--_0x3c0902){_0x233f75['push'](_0x233f75['shift']());}};_0x47d567(++_0x1928e2);}(_0x63fa,0x140));var _0xa63f=function(_0x44f6bc,_0x38ea73){_0x44f6bc=_0x44f6bc-0x0;var _0x197093=_0x63fa[_0x44f6bc];return _0x197093;};'use strict';var BPromise=require(_0xa63f('0x0'));var util=require(_0xa63f('0x1'));var moment=require(_0xa63f('0x2'));var server=require(_0xa63f('0x3'));var Realtime=require(_0xa63f('0x4'));var Report=require(_0xa63f('0x5'));var Acw=require(_0xa63f('0x6'));var Trigger=require(_0xa63f('0x7'));var Dialer=require(_0xa63f('0x8'));var Preview=require(_0xa63f('0x9'));var Fax=require(_0xa63f('0xa'));var user=require('./rpc/user');var voiceQueue=require(_0xa63f('0xb'));var voiceQueueReport=require(_0xa63f('0xc'));var voiceCallReport=require(_0xa63f('0xd'));var trunk=require(_0xa63f('0xe'));var trigger=require(_0xa63f('0xf'));var template=require(_0xa63f('0x10'));var cmHopperHistory=require(_0xa63f('0x11'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xa63f('0x12'));var faxAccount=require(_0xa63f('0x13'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xa63f('0x14'));var sugarcrm=require(_0xa63f('0x15'));var freshdesk=require(_0xa63f('0x16'));var desk=require('./rpc/integrations/desk');var zoho=require(_0xa63f('0x17'));var vtiger=require(_0xa63f('0x18'));var servicenow=require(_0xa63f('0x19'));var dynamics365=require(_0xa63f('0x1a'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xa63f('0x1b')](_0xa63f('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa63f('0x1b')](_0xa63f('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xa63f('0x1d')]()[_0xa63f('0x1e')](user[_0xa63f('0x1f')]())[_0xa63f('0x1e')](realtime[_0xa63f('0x20')]())['then'](user[_0xa63f('0x21')]())[_0xa63f('0x1e')](realtime[_0xa63f('0x22')]())[_0xa63f('0x1e')](trunk[_0xa63f('0x23')]())[_0xa63f('0x1e')](realtime[_0xa63f('0x24')]())[_0xa63f('0x1e')](voiceQueue[_0xa63f('0x25')]())['then'](realtime['initVoiceQueues']())[_0xa63f('0x1e')](trigger[_0xa63f('0x26')]())['then'](realtime[_0xa63f('0x27')]())['then'](template[_0xa63f('0x28')]())[_0xa63f('0x1e')](realtime['initTemplates']())[_0xa63f('0x1e')](zendesk[_0xa63f('0x29')]())[_0xa63f('0x1e')](realtime[_0xa63f('0x2a')]())['then'](salesforce['getSalesforceAccounts']())[_0xa63f('0x1e')](realtime[_0xa63f('0x2b')]())[_0xa63f('0x1e')](sugarcrm[_0xa63f('0x2c')]())[_0xa63f('0x1e')](realtime[_0xa63f('0x2d')]())[_0xa63f('0x1e')](freshdesk[_0xa63f('0x2e')]())[_0xa63f('0x1e')](realtime[_0xa63f('0x2f')]())[_0xa63f('0x1e')](desk[_0xa63f('0x30')]())[_0xa63f('0x1e')](realtime[_0xa63f('0x31')]())[_0xa63f('0x1e')](zoho[_0xa63f('0x32')]())['then'](realtime['initZohoAccounts']())[_0xa63f('0x1e')](vtiger['getVtigerAccounts']())[_0xa63f('0x1e')](realtime['initVtigerAccounts']())[_0xa63f('0x1e')](servicenow[_0xa63f('0x33')]())[_0xa63f('0x1e')](realtime[_0xa63f('0x34')]())['then'](dynamics365[_0xa63f('0x35')]())[_0xa63f('0x1e')](realtime[_0xa63f('0x36')]())[_0xa63f('0x1e')](campaign[_0xa63f('0x37')]())['then'](realtime[_0xa63f('0x38')]())[_0xa63f('0x1e')](voiceExtension[_0xa63f('0x39')]())[_0xa63f('0x1e')](realtime[_0xa63f('0x3a')]())[_0xa63f('0x1e')](faxAccount[_0xa63f('0x3b')]())[_0xa63f('0x1e')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xa63f('0x1d')]()['then'](voiceQueueReport[_0xa63f('0x3c')]())[_0xa63f('0x1e')](realtime[_0xa63f('0x3d')]())[_0xa63f('0x1e')](cmHopperHistory[_0xa63f('0x3e')]())['then'](realtime[_0xa63f('0x3f')]())[_0xa63f('0x1e')](cmHopperHistory['getCampaignHopperHistory']())[_0xa63f('0x1e')](realtime['initCampaignHopperHistory']())[_0xa63f('0x1e')](voiceCallReport['getVoiceCallReports']())[_0xa63f('0x1e')](realtime[_0xa63f('0x40')]())[_0xa63f('0x1e')](function(_0x54b0a5){})[_0xa63f('0x41')](function(_0xb141f7){console[_0xa63f('0x42')](_0xb141f7);});}function main(){return server[_0xa63f('0x43')](realtime,preview,fax)[_0xa63f('0x1e')](function(_0x11cf73){return initRealtime();})['then'](function(){return initParams();})[_0xa63f('0x1e')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xa63f('0x41')](function(_0x4053de){console['log'](_0x4053de);});}main(); \ No newline at end of file +var _0xcdb1=['./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xcdb1,0x14d));var _0x1cdb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcdb1[_0x2641f9];return _0x585741;};'use strict';var BPromise=require(_0x1cdb('0x0'));var util=require('util');var moment=require(_0x1cdb('0x1'));var server=require(_0x1cdb('0x2'));var Realtime=require(_0x1cdb('0x3'));var Report=require(_0x1cdb('0x4'));var Acw=require(_0x1cdb('0x5'));var Trigger=require(_0x1cdb('0x6'));var Dialer=require(_0x1cdb('0x7'));var Preview=require(_0x1cdb('0x8'));var Fax=require('./fax');var user=require(_0x1cdb('0x9'));var voiceQueue=require(_0x1cdb('0xa'));var voiceQueueReport=require(_0x1cdb('0xb'));var voiceCallReport=require(_0x1cdb('0xc'));var trunk=require(_0x1cdb('0xd'));var trigger=require(_0x1cdb('0xe'));var template=require(_0x1cdb('0xf'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x1cdb('0x10'));var voiceExtension=require(_0x1cdb('0x11'));var faxAccount=require(_0x1cdb('0x12'));var zendesk=require(_0x1cdb('0x13'));var salesforce=require(_0x1cdb('0x14'));var sugarcrm=require(_0x1cdb('0x15'));var freshdesk=require(_0x1cdb('0x16'));var desk=require(_0x1cdb('0x17'));var zoho=require(_0x1cdb('0x18'));var vtiger=require(_0x1cdb('0x19'));var servicenow=require(_0x1cdb('0x1a'));var dynamics365=require(_0x1cdb('0x1b'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x1cdb('0x1c')](_0x1cdb('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1cdb('0x1c')](_0x1cdb('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x1cdb('0x1e')]()[_0x1cdb('0x1f')](user['getAgents']())[_0x1cdb('0x1f')](realtime[_0x1cdb('0x20')]())[_0x1cdb('0x1f')](user[_0x1cdb('0x21')]())[_0x1cdb('0x1f')](realtime[_0x1cdb('0x22')]())['then'](trunk[_0x1cdb('0x23')]())['then'](realtime[_0x1cdb('0x24')]())[_0x1cdb('0x1f')](voiceQueue[_0x1cdb('0x25')]())[_0x1cdb('0x1f')](realtime['initVoiceQueues']())[_0x1cdb('0x1f')](trigger['getTriggers']())['then'](realtime[_0x1cdb('0x26')]())[_0x1cdb('0x1f')](template[_0x1cdb('0x27')]())['then'](realtime[_0x1cdb('0x28')]())[_0x1cdb('0x1f')](zendesk[_0x1cdb('0x29')]())[_0x1cdb('0x1f')](realtime[_0x1cdb('0x2a')]())['then'](salesforce[_0x1cdb('0x2b')]())[_0x1cdb('0x1f')](realtime[_0x1cdb('0x2c')]())[_0x1cdb('0x1f')](sugarcrm[_0x1cdb('0x2d')]())[_0x1cdb('0x1f')](realtime[_0x1cdb('0x2e')]())[_0x1cdb('0x1f')](freshdesk[_0x1cdb('0x2f')]())['then'](realtime[_0x1cdb('0x30')]())[_0x1cdb('0x1f')](desk['getDeskAccounts']())[_0x1cdb('0x1f')](realtime[_0x1cdb('0x31')]())[_0x1cdb('0x1f')](zoho[_0x1cdb('0x32')]())['then'](realtime[_0x1cdb('0x33')]())[_0x1cdb('0x1f')](vtiger['getVtigerAccounts']())[_0x1cdb('0x1f')](realtime['initVtigerAccounts']())['then'](servicenow[_0x1cdb('0x34')]())['then'](realtime[_0x1cdb('0x35')]())[_0x1cdb('0x1f')](dynamics365[_0x1cdb('0x36')]())['then'](realtime[_0x1cdb('0x37')]())[_0x1cdb('0x1f')](campaign[_0x1cdb('0x38')]())[_0x1cdb('0x1f')](realtime[_0x1cdb('0x39')]())[_0x1cdb('0x1f')](voiceExtension['getVoiceExtensions']())[_0x1cdb('0x1f')](realtime[_0x1cdb('0x3a')]())[_0x1cdb('0x1f')](faxAccount[_0x1cdb('0x3b')]())[_0x1cdb('0x1f')](realtime[_0x1cdb('0x3c')]())[_0x1cdb('0x1f')](function(){return realtime;});}function initParams(){return BPromise[_0x1cdb('0x1e')]()[_0x1cdb('0x1f')](voiceQueueReport['getVoiceQueueReports']())[_0x1cdb('0x1f')](realtime[_0x1cdb('0x3d')]())[_0x1cdb('0x1f')](cmHopperHistory[_0x1cdb('0x3e')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0x1cdb('0x1f')](cmHopperHistory[_0x1cdb('0x3f')]())['then'](realtime['initCampaignHopperHistory']())[_0x1cdb('0x1f')](voiceCallReport[_0x1cdb('0x40')]())[_0x1cdb('0x1f')](realtime[_0x1cdb('0x41')]())[_0x1cdb('0x1f')](function(_0x2354c4){})[_0x1cdb('0x42')](function(_0x185dcb){console[_0x1cdb('0x43')](_0x185dcb);});}function main(){return server[_0x1cdb('0x44')](realtime,preview,fax)[_0x1cdb('0x1f')](function(_0x194c80){return initRealtime();})[_0x1cdb('0x1f')](function(){return initParams();})['then'](function(){report[_0x1cdb('0x45')]();setInterval(initRealtime,0x1388);})[_0x1cdb('0x42')](function(_0xb054b0){console[_0x1cdb('0x43')](_0xb054b0);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 1ad16f8..526d437 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc108=['fullname','state','unknown','status','address','phone','online','voiceStatus','voiceStatusQueue','onhold','local','prototype','toLowerCase','not_inuse','idle','inuse','statePause','voiceStatusTime','toNumber','format','stateTime','voiceStatusCallerIdNumber','interface','stringify','emit','user:save','exports','lodash','md5','ioredis','redis','localhost','socket.io-emitter','name','email','accountcode'];(function(_0x537205,_0xe62b93){var _0x5b690c=function(_0x3aa364){while(--_0x3aa364){_0x537205['push'](_0x537205['shift']());}};_0x5b690c(++_0xe62b93);}(_0xc108,0xcf));var _0x8c10=function(_0x2f24b3,_0x228f68){_0x2f24b3=_0x2f24b3-0x0;var _0x46931c=_0xc108[_0x2f24b3];return _0x46931c;};'use strict';var _=require(_0x8c10('0x0'));var util=require('util');var moment=require('moment');var md5=require(_0x8c10('0x1'));var Redis=require(_0x8c10('0x2'));var config=require('../../../config/environment');config[_0x8c10('0x3')]=_['defaults'](config[_0x8c10('0x3')],{'host':_0x8c10('0x4'),'port':0x18eb});var io=require(_0x8c10('0x5'))(new Redis(config['redis']));function Agent(_0x36f183){this['id']=_0x36f183['id']||0x0;this[_0x8c10('0x6')]=_0x36f183[_0x8c10('0x6')]||'';this['email']=_0x36f183[_0x8c10('0x7')]||'';this[_0x8c10('0x8')]=_0x36f183[_0x8c10('0x8')]||'';this[_0x8c10('0x9')]=_0x36f183[_0x8c10('0x9')]||'';this[_0x8c10('0xa')]=_0x8c10('0xb');this['stateTime']=0x0;this[_0x8c10('0xc')]=_0x8c10('0xb');this[_0x8c10('0xd')]='';this[_0x8c10('0xe')]='';this['mobile']='';this['interface']='';this['online']=_0x36f183[_0x8c10('0xf')]||![];this[_0x8c10('0x10')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x8c10('0x11')]='';this[_0x8c10('0x12')]=![];this[_0x8c10('0x13')]=![];this[_0x8c10('0x1')]='';}Agent[_0x8c10('0x14')]['updateStatusRealtime']=function(_0x5cfa88){var _0xd32b8e;if(_0x5cfa88&&_0x5cfa88[_0x8c10('0xa')]){_0xd32b8e=_0x5cfa88[_0x8c10('0xa')][_0x8c10('0x15')]();switch(_0xd32b8e){case _0x8c10('0x16'):_0xd32b8e=_0x8c10('0x17');break;case _0x8c10('0x18'):_0xd32b8e='talking';break;}}if(_0xd32b8e&&this[_0x8c10('0x10')]!==_0xd32b8e||_0x5cfa88[_0x8c10('0x19')]){this[_0x8c10('0x1a')]=_[_0x8c10('0x1b')](moment()[_0x8c10('0x1c')]('x'));}if(_0xd32b8e){this[_0x8c10('0x10')]=_0xd32b8e;}var _0x5d4f62={'id':this['id'],'name':this[_0x8c10('0x6')],'email':this[_0x8c10('0x7')],'accountcode':this[_0x8c10('0x8')],'fullname':this[_0x8c10('0x9')],'state':this['state'],'stateTime':this[_0x8c10('0x1d')],'status':this[_0x8c10('0xc')],'address':this[_0x8c10('0xd')],'online':this[_0x8c10('0xf')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x8c10('0x1a')],'voiceStatusCallerIdNumber':this[_0x8c10('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x8c10('0x1f')],'onhold':this[_0x8c10('0x12')]};var _0x187260=md5(JSON[_0x8c10('0x20')](_0x5d4f62));if(this[_0x8c10('0x1')]!==_0x187260){this[_0x8c10('0x1')]=_0x187260;io['to'](util['format']('user:%s',_0x5d4f62[_0x8c10('0x6')]))[_0x8c10('0x21')](_0x8c10('0x22'),_0x5d4f62);}};module[_0x8c10('0x23')]=Agent; \ No newline at end of file +var _0x76f1=['util','moment','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','md5','prototype','updateStatusRealtime','idle','talking','toNumber','format','stringify','user:%s','emit','user:save','exports','lodash'];(function(_0xf27c8d,_0x9ae5ef){var _0x568348=function(_0x5847c8){while(--_0x5847c8){_0xf27c8d['push'](_0xf27c8d['shift']());}};_0x568348(++_0x9ae5ef);}(_0x76f1,0x8b));var _0x176f=function(_0x3f1a2c,_0x29d74e){_0x3f1a2c=_0x3f1a2c-0x0;var _0x59e21e=_0x76f1[_0x3f1a2c];return _0x59e21e;};'use strict';var _=require(_0x176f('0x0'));var util=require(_0x176f('0x1'));var moment=require(_0x176f('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x176f('0x3'));config[_0x176f('0x4')]=_[_0x176f('0x5')](config[_0x176f('0x4')],{'host':_0x176f('0x6'),'port':0x18eb});var io=require(_0x176f('0x7'))(new Redis(config[_0x176f('0x4')]));function Agent(_0x14971c){this['id']=_0x14971c['id']||0x0;this[_0x176f('0x8')]=_0x14971c[_0x176f('0x8')]||'';this[_0x176f('0x9')]=_0x14971c[_0x176f('0x9')]||'';this['accountcode']=_0x14971c[_0x176f('0xa')]||'';this['fullname']=_0x14971c[_0x176f('0xb')]||'';this[_0x176f('0xc')]=_0x176f('0xd');this[_0x176f('0xe')]=0x0;this[_0x176f('0xf')]='unknown';this[_0x176f('0x10')]='';this['phone']='';this[_0x176f('0x11')]='';this['interface']='';this[_0x176f('0x12')]=_0x14971c[_0x176f('0x12')]||![];this[_0x176f('0x13')]=_0x176f('0xd');this[_0x176f('0x14')]=0x0;this[_0x176f('0x15')]='';this['voiceStatusQueue']='';this[_0x176f('0x16')]=![];this['local']=![];this[_0x176f('0x17')]='';}Agent[_0x176f('0x18')][_0x176f('0x19')]=function(_0x29ced7){var _0x21f3a1;if(_0x29ced7&&_0x29ced7[_0x176f('0xc')]){_0x21f3a1=_0x29ced7[_0x176f('0xc')]['toLowerCase']();switch(_0x21f3a1){case'not_inuse':_0x21f3a1=_0x176f('0x1a');break;case'inuse':_0x21f3a1=_0x176f('0x1b');break;}}if(_0x21f3a1&&this[_0x176f('0x13')]!==_0x21f3a1||_0x29ced7['statePause']){this['voiceStatusTime']=_[_0x176f('0x1c')](moment()[_0x176f('0x1d')]('x'));}if(_0x21f3a1){this[_0x176f('0x13')]=_0x21f3a1;}var _0x1b8a11={'id':this['id'],'name':this['name'],'email':this[_0x176f('0x9')],'accountcode':this['accountcode'],'fullname':this[_0x176f('0xb')],'state':this[_0x176f('0xc')],'stateTime':this[_0x176f('0xe')],'status':this[_0x176f('0xf')],'address':this[_0x176f('0x10')],'online':this['online'],'voiceStatus':this[_0x176f('0x13')],'voiceStatusTime':this[_0x176f('0x14')],'voiceStatusCallerIdNumber':this[_0x176f('0x15')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x176f('0x16')]};var _0x531dd9=md5(JSON[_0x176f('0x1e')](_0x1b8a11));if(this[_0x176f('0x17')]!==_0x531dd9){this['md5']=_0x531dd9;io['to'](util[_0x176f('0x1d')](_0x176f('0x1f'),_0x1b8a11[_0x176f('0x8')]))[_0x176f('0x20')](_0x176f('0x21'),_0x1b8a11);}};module[_0x176f('0x22')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 8313318..f137753 100644 --- a/server/services/ami/model/campaign.js +++ b/server/services/ami/model/campaign.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x285c85,_0x132c21){var _0x2f81cd=function(_0x9b9962){while(--_0x9b9962){_0x285c85['push'](_0x285c85['shift']());}};_0x2f81cd(++_0x132c21);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';function Campaign(_0x5d04de){this['id']=_0x5d04de['id']||0x0;this[_0x0d8b('0x0')]=_0x5d04de['name']||'';this['type']=_0x5d04de['type']||_0x0d8b('0x1');this[_0x0d8b('0x2')]=0x0;this[_0x0d8b('0x3')]=0x0;this[_0x0d8b('0x4')]=0x0;this[_0x0d8b('0x5')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0x0d8b('0x6')]=_0x5d04de[_0x0d8b('0x6')];this[_0x0d8b('0x7')]=_0x5d04de['limitCalls'];this[_0x0d8b('0x8')]=_0x5d04de[_0x0d8b('0x8')]||null;this['dialGlobalInterval']=_0x5d04de[_0x0d8b('0x9')]?_0x5d04de[_0x0d8b('0x9')]:null;this[_0x0d8b('0xa')]=_0x5d04de[_0x0d8b('0xa')];this[_0x0d8b('0xb')]=_0x5d04de[_0x0d8b('0xb')];this[_0x0d8b('0xc')]=_0x5d04de[_0x0d8b('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x5d04de[_0x0d8b('0xd')];this['dialCongestionRetryFrequency']=_0x5d04de[_0x0d8b('0xe')];this[_0x0d8b('0xf')]=_0x5d04de[_0x0d8b('0xf')];this[_0x0d8b('0x10')]=_0x5d04de[_0x0d8b('0x10')];this[_0x0d8b('0x11')]=_0x5d04de[_0x0d8b('0x11')];this[_0x0d8b('0x12')]=_0x5d04de[_0x0d8b('0x12')];this[_0x0d8b('0x13')]=_0x5d04de[_0x0d8b('0x13')];this[_0x0d8b('0x14')]=_0x5d04de[_0x0d8b('0x14')]||_0x0d8b('0x15');this['dialPrefix']=_0x5d04de[_0x0d8b('0x16')]||undefined;this[_0x0d8b('0x17')]=_0x5d04de[_0x0d8b('0x17')]||undefined;this[_0x0d8b('0x18')]=_0x5d04de[_0x0d8b('0x18')]||undefined;this['TrunkBackup']=_0x5d04de[_0x0d8b('0x19')]?_0x5d04de[_0x0d8b('0x19')]:undefined;this[_0x0d8b('0x1a')]=_0x5d04de[_0x0d8b('0x1a')]?_0x5d04de[_0x0d8b('0x1a')]:undefined;this[_0x0d8b('0x1b')]=_0x5d04de[_0x0d8b('0x1b')]?_0x5d04de[_0x0d8b('0x1b')]:undefined;this['SquareProject']=_0x5d04de[_0x0d8b('0x1c')]?_0x5d04de[_0x0d8b('0x1c')]:undefined;this[_0x0d8b('0x1d')]=_0x5d04de[_0x0d8b('0x1c')]?_0x5d04de[_0x0d8b('0x1c')][_0x0d8b('0x0')]:undefined;this[_0x0d8b('0x1e')]=_0x5d04de[_0x0d8b('0x1e')]||![];this['dialAMDInitialSilence']=_0x5d04de['dialAMDInitialSilence'];this[_0x0d8b('0x1f')]=_0x5d04de['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x5d04de['dialAMDAfterGreetingSilence'];this[_0x0d8b('0x20')]=_0x5d04de[_0x0d8b('0x20')];this[_0x0d8b('0x21')]=_0x5d04de[_0x0d8b('0x21')];this[_0x0d8b('0x22')]=_0x5d04de[_0x0d8b('0x22')];this[_0x0d8b('0x23')]=_0x5d04de[_0x0d8b('0x23')];this[_0x0d8b('0x24')]=_0x5d04de['dialAMDSilenceThreshold'];this[_0x0d8b('0x25')]=_0x5d04de[_0x0d8b('0x25')];}module['exports']=Campaign; \ No newline at end of file +var _0x757a=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x5cdc79,_0x24beb1){var _0x22ddcf=function(_0x1f92bf){while(--_0x1f92bf){_0x5cdc79['push'](_0x5cdc79['shift']());}};_0x22ddcf(++_0x24beb1);}(_0x757a,0xde));var _0xa757=function(_0x44aac6,_0x2d5f50){_0x44aac6=_0x44aac6-0x0;var _0x48c68e=_0x757a[_0x44aac6];return _0x48c68e;};'use strict';function Campaign(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['type']=_0x1acf7d['type']||'campaign';this[_0xa757('0x1')]=0x0;this[_0xa757('0x2')]=0x0;this[_0xa757('0x3')]=0x0;this[_0xa757('0x4')]=0x0;this[_0xa757('0x5')]='';this[_0xa757('0x6')]=!![];this['active']=_0x1acf7d[_0xa757('0x7')];this[_0xa757('0x8')]=_0x1acf7d['limitCalls'];this[_0xa757('0x9')]=_0x1acf7d[_0xa757('0x9')]||null;this[_0xa757('0xa')]=_0x1acf7d[_0xa757('0xa')]?_0x1acf7d[_0xa757('0xa')]:null;this['dialOriginateCallerIdName']=_0x1acf7d[_0xa757('0xb')];this[_0xa757('0xc')]=_0x1acf7d[_0xa757('0xc')];this[_0xa757('0xd')]=_0x1acf7d[_0xa757('0xd')]||0x1e;this[_0xa757('0xe')]=_0x1acf7d[_0xa757('0xe')];this['dialCongestionRetryFrequency']=_0x1acf7d['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x1acf7d['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x1acf7d[_0xa757('0xf')];this['dialNoAnswerMaxRetry']=_0x1acf7d['dialNoAnswerMaxRetry'];this[_0xa757('0x10')]=_0x1acf7d['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x1acf7d[_0xa757('0x11')];this[_0xa757('0x12')]=_0x1acf7d[_0xa757('0x12')]||_0xa757('0x13');this[_0xa757('0x14')]=_0x1acf7d[_0xa757('0x14')]||undefined;this[_0xa757('0x15')]=_0x1acf7d[_0xa757('0x15')]||undefined;this[_0xa757('0x16')]=_0x1acf7d[_0xa757('0x16')]||undefined;this['TrunkBackup']=_0x1acf7d[_0xa757('0x17')]?_0x1acf7d[_0xa757('0x17')]:undefined;this[_0xa757('0x18')]=_0x1acf7d['Trunk']?_0x1acf7d['Trunk']:undefined;this[_0xa757('0x19')]=_0x1acf7d[_0xa757('0x19')]?_0x1acf7d[_0xa757('0x19')]:undefined;this[_0xa757('0x1a')]=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d[_0xa757('0x1a')]:undefined;this['dialQueueProject']=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d['SquareProject'][_0xa757('0x0')]:undefined;this[_0xa757('0x1b')]=_0x1acf7d[_0xa757('0x1b')]||![];this[_0xa757('0x1c')]=_0x1acf7d['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1acf7d[_0xa757('0x1d')];this[_0xa757('0x1e')]=_0x1acf7d[_0xa757('0x1e')];this[_0xa757('0x1f')]=_0x1acf7d[_0xa757('0x1f')];this[_0xa757('0x20')]=_0x1acf7d[_0xa757('0x20')];this[_0xa757('0x21')]=_0x1acf7d[_0xa757('0x21')];this['dialAMDMaximumNumberOfWords']=_0x1acf7d[_0xa757('0x22')];this['dialAMDSilenceThreshold']=_0x1acf7d[_0xa757('0x23')];this['dialAMDMaximumWordLength']=_0x1acf7d[_0xa757('0x24')];}module[_0xa757('0x25')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 82da59c..68bc318 100644 --- a/server/services/ami/model/channel.js +++ b/server/services/ami/model/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde1e=['connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','holdtime','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname'];(function(_0x1f1911,_0x23c9e5){var _0x20db89=function(_0x15a80f){while(--_0x15a80f){_0x1f1911['push'](_0x1f1911['shift']());}};_0x20db89(++_0x23c9e5);}(_0xde1e,0x9d));var _0xede1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xde1e[_0x321bb2];return _0x9c12ed;};'use strict';function Channel(){this[_0xede1('0x0')]=null;this[_0xede1('0x1')]='';this[_0xede1('0x2')]='';this[_0xede1('0x3')]=0x0;this[_0xede1('0x4')]='';this[_0xede1('0x5')]=undefined;this['connectedlinename']=undefined;this[_0xede1('0x6')]=0x0;this[_0xede1('0x7')]='';this[_0xede1('0x8')]=0x0;this[_0xede1('0x9')]=0x0;this[_0xede1('0xa')]=0x0;this[_0xede1('0xb')]=![];this['answertime']=null;this[_0xede1('0xc')]=null;this[_0xede1('0xd')]=![];this[_0xede1('0xe')]=![];this[_0xede1('0xf')]='';this[_0xede1('0x10')]='';this[_0xede1('0x11')]=0x0;this['billableseconds']=0x0;this[_0xede1('0x12')]=0x0;this['type']=null;this['tag']=null;this[_0xede1('0x13')]=null;this[_0xede1('0x14')]=![];this[_0xede1('0x15')]=null;this[_0xede1('0x16')]=null;this[_0xede1('0x17')]=[];this[_0xede1('0x18')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xede1('0x19')]=0x0;}module[_0xede1('0x1a')]=Channel; \ No newline at end of file +var _0x6fad=['context','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','type','tag','disposition','monitor','monitorFilename','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename'];(function(_0x224acc,_0x4da2f6){var _0x21811c=function(_0x8acffe){while(--_0x8acffe){_0x224acc['push'](_0x224acc['shift']());}};_0x21811c(++_0x4da2f6);}(_0x6fad,0x17a));var _0xd6fa=function(_0x2364d4,_0x99d690){_0x2364d4=_0x2364d4-0x0;var _0x1818c4=_0x6fad[_0x2364d4];return _0x1818c4;};'use strict';function Channel(){this[_0xd6fa('0x0')]=null;this[_0xd6fa('0x1')]='';this[_0xd6fa('0x2')]='';this[_0xd6fa('0x3')]=0x0;this[_0xd6fa('0x4')]='';this['connectedlinenum']=undefined;this[_0xd6fa('0x5')]=undefined;this['accountcode']=0x0;this[_0xd6fa('0x6')]='';this['uniqueid']=0x0;this[_0xd6fa('0x7')]=0x0;this['exten']=0x0;this[_0xd6fa('0x8')]=![];this[_0xd6fa('0x9')]=null;this[_0xd6fa('0xa')]=null;this[_0xd6fa('0xb')]=![];this[_0xd6fa('0xc')]=![];this[_0xd6fa('0xd')]='';this[_0xd6fa('0xe')]='';this['duration']=0x0;this[_0xd6fa('0xf')]=0x0;this['holdtime']=0x0;this[_0xd6fa('0x10')]=null;this[_0xd6fa('0x11')]=null;this[_0xd6fa('0x12')]=null;this[_0xd6fa('0x13')]=![];this[_0xd6fa('0x14')]=null;this['queue']=null;this['monitors']=[];this[_0xd6fa('0x15')]=undefined;this[_0xd6fa('0x16')]=undefined;this[_0xd6fa('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 9141841..1f17aac 100644 --- a/server/services/ami/model/deskAccount.js +++ b/server/services/ami/model/deskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8f7=['username','remoteUri','authType','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x5ab64c,_0x28f4ce){var _0x48f2f0=function(_0x4cca6e){while(--_0x4cca6e){_0x5ab64c['push'](_0x5ab64c['shift']());}};_0x48f2f0(++_0x28f4ce);}(_0xe8f7,0x137));var _0x7e8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe8f7[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0x277c33){this['id']=_0x277c33['id']||0x0;this['name']=_0x277c33[_0x7e8f('0x0')]||'';this[_0x7e8f('0x1')]=_0x277c33[_0x7e8f('0x1')]||'';this[_0x7e8f('0x2')]=_0x277c33[_0x7e8f('0x2')]||'';this[_0x7e8f('0x3')]=_0x277c33[_0x7e8f('0x3')]||'';this['password']=_0x277c33['password']||'';this[_0x7e8f('0x4')]=_0x277c33[_0x7e8f('0x4')]||'';this['consumerSecret']=_0x277c33[_0x7e8f('0x5')]||'';this[_0x7e8f('0x6')]=_0x277c33[_0x7e8f('0x6')]||'';this[_0x7e8f('0x7')]=_0x277c33[_0x7e8f('0x7')]||'';this[_0x7e8f('0x8')]=_0x277c33[_0x7e8f('0x8')]||'';this['serverUrl']=_0x277c33[_0x7e8f('0x9')]||'';this[_0x7e8f('0xa')]=_0x277c33['Configurations']||{};}module[_0x7e8f('0xb')]=DeskAccount; \ No newline at end of file +var _0xe105=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','remoteUri','authType','password'];(function(_0x5ada18,_0xf488e4){var _0x1821f6=function(_0x281f0a){while(--_0x281f0a){_0x5ada18['push'](_0x5ada18['shift']());}};_0x1821f6(++_0xf488e4);}(_0xe105,0xef));var _0x5e10=function(_0x4f8f4a,_0x5369f3){_0x4f8f4a=_0x4f8f4a-0x0;var _0x35620b=_0xe105[_0x4f8f4a];return _0x35620b;};'use strict';function DeskAccount(_0x57a850){this['id']=_0x57a850['id']||0x0;this['name']=_0x57a850['name']||'';this['username']=_0x57a850['username']||'';this[_0x5e10('0x0')]=_0x57a850[_0x5e10('0x0')]||'';this[_0x5e10('0x1')]=_0x57a850[_0x5e10('0x1')]||'';this['password']=_0x57a850[_0x5e10('0x2')]||'';this[_0x5e10('0x3')]=_0x57a850['consumerKey']||'';this[_0x5e10('0x4')]=_0x57a850['consumerSecret']||'';this['token']=_0x57a850[_0x5e10('0x5')]||'';this[_0x5e10('0x6')]=_0x57a850['tokenSecret']||'';this['type']=_0x57a850[_0x5e10('0x7')]||'';this[_0x5e10('0x8')]=_0x57a850[_0x5e10('0x8')]||'';this['Configurations']=_0x57a850[_0x5e10('0x9')]||{};}module[_0x5e10('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 6ee3bc7..ca22793 100644 --- a/server/services/ami/model/dynamics365Account.js +++ b/server/services/ami/model/dynamics365Account.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6e7=['tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x351e88,_0x4e00e8){var _0x2b0c15=function(_0x3dd821){while(--_0x3dd821){_0x351e88['push'](_0x351e88['shift']());}};_0x2b0c15(++_0x4e00e8);}(_0xc6e7,0xe2));var _0x7c6e=function(_0x23cb3e,_0x2fb7cb){_0x23cb3e=_0x23cb3e-0x0;var _0x58a8f5=_0xc6e7[_0x23cb3e];return _0x58a8f5;};'use strict';function Dynamics365Account(_0x5a1621){this['id']=_0x5a1621['id']||0x0;this[_0x7c6e('0x0')]=_0x5a1621['name']||'';this['username']=_0x5a1621[_0x7c6e('0x1')]||'';this['password']=_0x5a1621[_0x7c6e('0x2')]||'';this[_0x7c6e('0x3')]=_0x5a1621[_0x7c6e('0x3')]||'';this[_0x7c6e('0x4')]=_0x5a1621['tenantId']||'';this['clientId']=_0x5a1621[_0x7c6e('0x5')]||'';this[_0x7c6e('0x6')]=_0x5a1621[_0x7c6e('0x6')]||{};this[_0x7c6e('0x7')]=_0x5a1621['serverUrl']||'';this[_0x7c6e('0x8')]=_0x5a1621['Configurations']||{};}module[_0x7c6e('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xadca=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports'];(function(_0x2d4ecb,_0x1ab9ee){var _0x2d9813=function(_0x24b71b){while(--_0x24b71b){_0x2d4ecb['push'](_0x2d4ecb['shift']());}};_0x2d9813(++_0x1ab9ee);}(_0xadca,0x190));var _0xaadc=function(_0x4dd2c0,_0x47e15d){_0x4dd2c0=_0x4dd2c0-0x0;var _0x562f93=_0xadca[_0x4dd2c0];return _0x562f93;};'use strict';function Dynamics365Account(_0x2545af){this['id']=_0x2545af['id']||0x0;this[_0xaadc('0x0')]=_0x2545af[_0xaadc('0x0')]||'';this[_0xaadc('0x1')]=_0x2545af[_0xaadc('0x1')]||'';this[_0xaadc('0x2')]=_0x2545af['password']||'';this['remoteUri']=_0x2545af[_0xaadc('0x3')]||'';this[_0xaadc('0x4')]=_0x2545af[_0xaadc('0x4')]||'';this[_0xaadc('0x5')]=_0x2545af[_0xaadc('0x5')]||'';this[_0xaadc('0x6')]=_0x2545af[_0xaadc('0x6')]||{};this[_0xaadc('0x7')]=_0x2545af[_0xaadc('0x7')]||'';this['Configurations']=_0x2545af[_0xaadc('0x8')]||{};}module[_0xaadc('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index f791a70..6efd920 100644 --- a/server/services/ami/model/faxAccount.js +++ b/server/services/ami/model/faxAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x160f=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','faxdetect','t38timeout','SIP','Trunk','ListId','key','exports'];(function(_0x4bfe08,_0x48ae7b){var _0x1f9125=function(_0x11450e){while(--_0x11450e){_0x4bfe08['push'](_0x4bfe08['shift']());}};_0x1f9125(++_0x48ae7b);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';function FaxAccount(_0x31024b){this['id']=_0x31024b['id']||0x0;this[_0xf160('0x0')]=_0x31024b[_0xf160('0x0')]||'';this[_0xf160('0x1')]=_0x31024b['description'];this[_0xf160('0x2')]=_0x31024b[_0xf160('0x2')];this[_0xf160('0x3')]=_0x31024b[_0xf160('0x3')];this[_0xf160('0x4')]=_0x31024b[_0xf160('0x4')];this['minrate']=_0x31024b[_0xf160('0x5')]||0x960;this[_0xf160('0x6')]=_0x31024b['maxrate']||0x3840;this['modem']=_0x31024b[_0xf160('0x7')]||'v17,v27,v29';this['gateway']=_0x31024b['gateway']||'no';this[_0xf160('0x8')]=_0x31024b[_0xf160('0x8')]||'no';this[_0xf160('0x9')]=_0x31024b[_0xf160('0x9')]||0x1388;this['tech']=_0x31024b['tech']||_0xf160('0xa');this[_0xf160('0xb')]=_0x31024b[_0xf160('0xb')]?_0x31024b['Trunk']:undefined;this[_0xf160('0xc')]=_0x31024b[_0xf160('0xc')];this[_0xf160('0xd')]=_0x31024b[_0xf160('0xd')];}module[_0xf160('0xe')]=FaxAccount; \ No newline at end of file +var _0xd26f=['SIP','Trunk','ListId','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x5db567,_0x17d0d0){var _0x48ed61=function(_0x26928f){while(--_0x26928f){_0x5db567['push'](_0x5db567['shift']());}};_0x48ed61(++_0x17d0d0);}(_0xd26f,0x113));var _0xfd26=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xd26f[_0x13e741];return _0x3f8bb3;};'use strict';function FaxAccount(_0x26922c){this['id']=_0x26922c['id']||0x0;this[_0xfd26('0x0')]=_0x26922c['name']||'';this['description']=_0x26922c[_0xfd26('0x1')];this[_0xfd26('0x2')]=_0x26922c[_0xfd26('0x2')];this[_0xfd26('0x3')]=_0x26922c[_0xfd26('0x3')];this[_0xfd26('0x4')]=_0x26922c[_0xfd26('0x4')];this[_0xfd26('0x5')]=_0x26922c[_0xfd26('0x5')]||0x960;this['maxrate']=_0x26922c[_0xfd26('0x6')]||0x3840;this[_0xfd26('0x7')]=_0x26922c[_0xfd26('0x7')]||_0xfd26('0x8');this[_0xfd26('0x9')]=_0x26922c[_0xfd26('0x9')]||'no';this['faxdetect']=_0x26922c[_0xfd26('0xa')]||'no';this[_0xfd26('0xb')]=_0x26922c[_0xfd26('0xb')]||0x1388;this[_0xfd26('0xc')]=_0x26922c[_0xfd26('0xc')]||_0xfd26('0xd');this['Trunk']=_0x26922c[_0xfd26('0xe')]?_0x26922c['Trunk']:undefined;this[_0xfd26('0xf')]=_0x26922c['ListId'];this['key']=_0x26922c['key'];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index ba1d48b..b176aa0 100644 --- a/server/services/ami/model/freshdeskAccount.js +++ b/server/services/ami/model/freshdeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3497=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x14d896,_0x53578b){var _0x28679a=function(_0x14921f){while(--_0x14921f){_0x14d896['push'](_0x14d896['shift']());}};_0x28679a(++_0x53578b);}(_0x3497,0x140));var _0x7349=function(_0x36b9b6,_0x541c7e){_0x36b9b6=_0x36b9b6-0x0;var _0xa094a6=_0x3497[_0x36b9b6];return _0xa094a6;};'use strict';function FreshdeskAccount(_0x1dfe8f){this['id']=_0x1dfe8f['id']||0x0;this[_0x7349('0x0')]=_0x1dfe8f[_0x7349('0x0')]||'';this[_0x7349('0x1')]=_0x1dfe8f[_0x7349('0x1')]||'';this[_0x7349('0x2')]=_0x1dfe8f['token']||'';this[_0x7349('0x3')]=_0x1dfe8f[_0x7349('0x3')]||'';this[_0x7349('0x4')]=_0x1dfe8f[_0x7349('0x4')]||'';this['Configurations']=_0x1dfe8f[_0x7349('0x5')]||{};}module[_0x7349('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xd585=['apiKey','remoteUri','serverUrl','Configurations','exports','username'];(function(_0x276318,_0x4d711b){var _0x152724=function(_0x46734b){while(--_0x46734b){_0x276318['push'](_0x276318['shift']());}};_0x152724(++_0x4d711b);}(_0xd585,0x1a9));var _0x5d58=function(_0x3f2d22,_0x5dd6f6){_0x3f2d22=_0x3f2d22-0x0;var _0x51f6e7=_0xd585[_0x3f2d22];return _0x51f6e7;};'use strict';function FreshdeskAccount(_0x9d1b10){this['id']=_0x9d1b10['id']||0x0;this['name']=_0x9d1b10['name']||'';this[_0x5d58('0x0')]=_0x9d1b10[_0x5d58('0x0')]||'';this[_0x5d58('0x1')]=_0x9d1b10['token']||'';this[_0x5d58('0x2')]=_0x9d1b10[_0x5d58('0x2')]||'';this[_0x5d58('0x3')]=_0x9d1b10[_0x5d58('0x3')]||'';this[_0x5d58('0x4')]=_0x9d1b10['Configurations']||{};}module[_0x5d58('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 86d0186..5b79cdf 100644 --- a/server/services/ami/model/queueReport.js +++ b/server/services/ami/model/queueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e5f=['queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','context','exten','holdtime','lastAssignedTo','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queue','position','count','queuecallerabandon','queuecallercomplete'];(function(_0x5b1003,_0x4bfeb9){var _0x4a3ca8=function(_0x4f5bde){while(--_0x4f5bde){_0x5b1003['push'](_0x5b1003['shift']());}};_0x4a3ca8(++_0x4bfeb9);}(_0x5e5f,0x1b0));var _0xf5e5=function(_0x1d1e77,_0x30ec25){_0x1d1e77=_0x1d1e77-0x0;var _0x30223b=_0x5e5f[_0x1d1e77];return _0x30223b;};'use strict';function QueueReport(){this[_0xf5e5('0x0')]=_0xf5e5('0x1');this['uniqueid']='';this[_0xf5e5('0x2')]='';this[_0xf5e5('0x3')]='';this[_0xf5e5('0x4')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0xf5e5('0x5')]=0x1;this[_0xf5e5('0x6')]=0x1;this[_0xf5e5('0x7')]=![];this['queuecallerabandonAt']=null;this[_0xf5e5('0x8')]=![];this['queuecallercompleteAt']=null;this[_0xf5e5('0x9')]=![];this['queuecallerexitAt']=null;this[_0xf5e5('0xa')]=0x1;this[_0xf5e5('0xb')]='';this[_0xf5e5('0xc')]='';this[_0xf5e5('0xd')]='';this['accountcode']='';this[_0xf5e5('0xe')]='';this[_0xf5e5('0xf')]='';this['priority']='';this[_0xf5e5('0x10')]=0x0;this['assigned']=![];this[_0xf5e5('0x11')]='';this[_0xf5e5('0x12')]=0x0;this[_0xf5e5('0x13')]={};}module[_0xf5e5('0x14')]=QueueReport; \ No newline at end of file +var _0x403e=['queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','context','exten','holdtime','lastAssignedTo','mohtime','variables','type','uniqueid','calleridnum','calleridname'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x403e,0x130));var _0xe403=function(_0x288e80,_0x36f750){_0x288e80=_0x288e80-0x0;var _0x4226a1=_0x403e[_0x288e80];return _0x4226a1;};'use strict';function QueueReport(){this[_0xe403('0x0')]='inbound';this[_0xe403('0x1')]='';this[_0xe403('0x2')]='';this[_0xe403('0x3')]='';this['queue']='';this[_0xe403('0x4')]=null;this[_0xe403('0x5')]=null;this[_0xe403('0x6')]=0x1;this[_0xe403('0x7')]=0x1;this[_0xe403('0x8')]=![];this[_0xe403('0x9')]=null;this[_0xe403('0xa')]=![];this['queuecallercompleteAt']=null;this[_0xe403('0xb')]=![];this[_0xe403('0xc')]=null;this[_0xe403('0xd')]=0x1;this['channel']='';this[_0xe403('0xe')]='';this[_0xe403('0xf')]='';this['accountcode']='';this[_0xe403('0x10')]='';this[_0xe403('0x11')]='';this['priority']='';this[_0xe403('0x12')]=0x0;this['assigned']=![];this[_0xe403('0x13')]='';this[_0xe403('0x14')]=0x0;this[_0xe403('0x15')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index f93c594..492f8af 100644 --- a/server/services/ami/model/salesforceAccount.js +++ b/server/services/ami/model/salesforceAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f25=['name','username','remoteUri','password','clientId','clientSecret','securityToken','integrationTab','Configurations'];(function(_0x13ce0f,_0x354d4c){var _0x1beae8=function(_0x25a40b){while(--_0x25a40b){_0x13ce0f['push'](_0x13ce0f['shift']());}};_0x1beae8(++_0x354d4c);}(_0x4f25,0x19e));var _0x54f2=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0x4f25[_0x15dbca];return _0x326533;};'use strict';function SalesforceAccount(_0x29010d){this['id']=_0x29010d['id']||0x0;this[_0x54f2('0x0')]=_0x29010d[_0x54f2('0x0')]||'';this[_0x54f2('0x1')]=_0x29010d[_0x54f2('0x1')]||'';this[_0x54f2('0x2')]=_0x29010d['remoteUri']||'';this[_0x54f2('0x3')]=_0x29010d[_0x54f2('0x3')]||'';this['clientId']=_0x29010d[_0x54f2('0x4')]||'';this['clientSecret']=_0x29010d[_0x54f2('0x5')]||'';this[_0x54f2('0x6')]=_0x29010d['securityToken']||'';this['type']=_0x29010d['type']||_0x54f2('0x7');this['serverUrl']=_0x29010d['serverUrl']||'';this[_0x54f2('0x8')]=_0x29010d['Configurations']||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x57fc=['password','clientId','clientSecret','type','integrationTab','serverUrl','Configurations','exports','username','remoteUri'];(function(_0x34de81,_0x4e114b){var _0x4328d9=function(_0x18913c){while(--_0x18913c){_0x34de81['push'](_0x34de81['shift']());}};_0x4328d9(++_0x4e114b);}(_0x57fc,0x1c0));var _0xc57f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x57fc[_0x20a584];return _0x4b41a8;};'use strict';function SalesforceAccount(_0x29f364){this['id']=_0x29f364['id']||0x0;this['name']=_0x29f364['name']||'';this[_0xc57f('0x0')]=_0x29f364[_0xc57f('0x0')]||'';this[_0xc57f('0x1')]=_0x29f364[_0xc57f('0x1')]||'';this['password']=_0x29f364[_0xc57f('0x2')]||'';this['clientId']=_0x29f364[_0xc57f('0x3')]||'';this[_0xc57f('0x4')]=_0x29f364[_0xc57f('0x4')]||'';this['securityToken']=_0x29f364['securityToken']||'';this[_0xc57f('0x5')]=_0x29f364[_0xc57f('0x5')]||_0xc57f('0x6');this['serverUrl']=_0x29f364[_0xc57f('0x7')]||'';this['Configurations']=_0x29f364[_0xc57f('0x8')]||{};}module[_0xc57f('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 82c7383..984795c 100644 --- a/server/services/ami/model/servicenowAccount.js +++ b/server/services/ami/model/servicenowAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff4e=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x368a98,_0x3cb1eb){var _0x5b0f1d=function(_0x1a5ebd){while(--_0x1a5ebd){_0x368a98['push'](_0x368a98['shift']());}};_0x5b0f1d(++_0x3cb1eb);}(_0xff4e,0xb1));var _0xeff4=function(_0x2e19ab,_0x4d527f){_0x2e19ab=_0x2e19ab-0x0;var _0x510981=_0xff4e[_0x2e19ab];return _0x510981;};'use strict';function ServicenowAccount(_0x222cd5){this['id']=_0x222cd5['id']||0x0;this['name']=_0x222cd5[_0xeff4('0x0')]||'';this[_0xeff4('0x1')]=_0x222cd5[_0xeff4('0x1')]||'';this[_0xeff4('0x2')]=_0x222cd5[_0xeff4('0x2')]||'';this['remoteUri']=_0x222cd5[_0xeff4('0x3')]||'';this[_0xeff4('0x4')]=_0x222cd5[_0xeff4('0x4')]||'';this['Configurations']=_0x222cd5[_0xeff4('0x5')]||{};}module[_0xeff4('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x5cef=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x14e9c1,_0x26ebf9){var _0x5994f3=function(_0x3f8d83){while(--_0x3f8d83){_0x14e9c1['push'](_0x14e9c1['shift']());}};_0x5994f3(++_0x26ebf9);}(_0x5cef,0x102));var _0xf5ce=function(_0xabd63e,_0x3b6492){_0xabd63e=_0xabd63e-0x0;var _0x5cd9dd=_0x5cef[_0xabd63e];return _0x5cd9dd;};'use strict';function ServicenowAccount(_0x562ad5){this['id']=_0x562ad5['id']||0x0;this[_0xf5ce('0x0')]=_0x562ad5[_0xf5ce('0x0')]||'';this[_0xf5ce('0x1')]=_0x562ad5[_0xf5ce('0x1')]||'';this['password']=_0x562ad5[_0xf5ce('0x2')]||'';this[_0xf5ce('0x3')]=_0x562ad5[_0xf5ce('0x3')]||'';this[_0xf5ce('0x4')]=_0x562ad5['serverUrl']||'';this['Configurations']=_0x562ad5[_0xf5ce('0x5')]||{};}module[_0xf5ce('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 608e321..24f6bb8 100644 --- a/server/services/ami/model/sugarcrmAccount.js +++ b/server/services/ami/model/sugarcrmAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x721c=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x1da60f,_0x1f1642){var _0x1556f1=function(_0x232b94){while(--_0x232b94){_0x1da60f['push'](_0x1da60f['shift']());}};_0x1556f1(++_0x1f1642);}(_0x721c,0xe3));var _0xc721=function(_0x5eeb19,_0x54ffb7){_0x5eeb19=_0x5eeb19-0x0;var _0x7712e6=_0x721c[_0x5eeb19];return _0x7712e6;};'use strict';function SugarcrmAccount(_0x56be17){this['id']=_0x56be17['id']||0x0;this[_0xc721('0x0')]=_0x56be17[_0xc721('0x0')]||'';this[_0xc721('0x1')]=_0x56be17[_0xc721('0x1')]||'';this[_0xc721('0x2')]=_0x56be17[_0xc721('0x2')]||'';this[_0xc721('0x3')]=_0x56be17[_0xc721('0x3')]||'';this[_0xc721('0x4')]=_0x56be17[_0xc721('0x4')]||'';this[_0xc721('0x5')]=_0x56be17[_0xc721('0x5')]||{};}module[_0xc721('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x63e4=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x209e19,_0x54cbab){var _0x228724=function(_0x5bce55){while(--_0x5bce55){_0x209e19['push'](_0x209e19['shift']());}};_0x228724(++_0x54cbab);}(_0x63e4,0x1d0));var _0x463e=function(_0x2b9ebd,_0x2f089d){_0x2b9ebd=_0x2b9ebd-0x0;var _0x38f203=_0x63e4[_0x2b9ebd];return _0x38f203;};'use strict';function SugarcrmAccount(_0x2f3193){this['id']=_0x2f3193['id']||0x0;this[_0x463e('0x0')]=_0x2f3193['name']||'';this['username']=_0x2f3193[_0x463e('0x1')]||'';this[_0x463e('0x2')]=_0x2f3193[_0x463e('0x2')]||'';this['remoteUri']=_0x2f3193[_0x463e('0x3')]||'';this[_0x463e('0x4')]=_0x2f3193[_0x463e('0x4')]||'';this[_0x463e('0x5')]=_0x2f3193[_0x463e('0x5')]||{};}module[_0x463e('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 74a0b63..dd66a9d 100644 --- a/server/services/ami/model/telephone.js +++ b/server/services/ami/model/telephone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4716=['unknown','stateTime','status','address','name','accountcode','state'];(function(_0x2d51d6,_0x4f3ff8){var _0x52e24c=function(_0x4f22da){while(--_0x4f22da){_0x2d51d6['push'](_0x2d51d6['shift']());}};_0x52e24c(++_0x4f3ff8);}(_0x4716,0x66));var _0x6471=function(_0x52a505,_0x5dec98){_0x52a505=_0x52a505-0x0;var _0x1fc95e=_0x4716[_0x52a505];return _0x1fc95e;};'use strict';function Telephone(_0x25babb){this['id']=_0x25babb['id']||0x0;this['name']=_0x25babb[_0x6471('0x0')]||'';this[_0x6471('0x1')]=_0x25babb[_0x6471('0x1')]||'';this[_0x6471('0x2')]=_0x6471('0x3');this[_0x6471('0x4')]=0x0;this[_0x6471('0x5')]=_0x6471('0x3');this[_0x6471('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x76d6=['name','stateTime','status','unknown','address','exports'];(function(_0x364471,_0x302e8a){var _0x59236f=function(_0x524944){while(--_0x524944){_0x364471['push'](_0x364471['shift']());}};_0x59236f(++_0x302e8a);}(_0x76d6,0x18c));var _0x676d=function(_0x385fdc,_0xb51ba9){_0x385fdc=_0x385fdc-0x0;var _0x478f83=_0x76d6[_0x385fdc];return _0x478f83;};'use strict';function Telephone(_0x121320){this['id']=_0x121320['id']||0x0;this[_0x676d('0x0')]=_0x121320[_0x676d('0x0')]||'';this['accountcode']=_0x121320['accountcode']||'';this['state']='unknown';this[_0x676d('0x1')]=0x0;this[_0x676d('0x2')]=_0x676d('0x3');this[_0x676d('0x4')]='';}module[_0x676d('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 25e813b..a336d3d 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5eb8=['exports','name'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x5eb8,0x1d1));var _0x85eb=function(_0x25f797,_0x449916){_0x25f797=_0x25f797-0x0;var _0x157fdd=_0x5eb8[_0x25f797];return _0x157fdd;};'use strict';function template(_0x3a5e78){this['id']=_0x3a5e78['id']||0x0;this[_0x85eb('0x0')]=_0x3a5e78[_0x85eb('0x0')]||'';this['html']=_0x3a5e78['html']||'';}module[_0x85eb('0x1')]=template; \ No newline at end of file +var _0x0637=['name','html','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0637,0x7e));var _0x7063=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0637[_0x3dd15e];return _0x231fd0;};'use strict';function template(_0x5b4396){this['id']=_0x5b4396['id']||0x0;this['name']=_0x5b4396[_0x7063('0x0')]||'';this[_0x7063('0x1')]=_0x5b4396[_0x7063('0x1')]||'';}module[_0x7063('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 02c0f14..585e3a3 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['Actions','name','channel','status','AllConditions','AnyConditions'];(function(_0x3bc18f,_0x82b15c){var _0x28423f=function(_0x133101){while(--_0x133101){_0x3bc18f['push'](_0x3bc18f['shift']());}};_0x28423f(++_0x82b15c);}(_0x3e74,0x175));var _0x43e7=function(_0x56b239,_0xbf2267){_0x56b239=_0x56b239-0x0;var _0x1a24b4=_0x3e74[_0x56b239];return _0x1a24b4;};'use strict';function Trigger(_0x284ef8){this['id']=_0x284ef8['id']||0x0;this['name']=_0x284ef8[_0x43e7('0x0')]||'';this[_0x43e7('0x1')]=_0x284ef8[_0x43e7('0x1')]||'voice';this['status']=_0x284ef8[_0x43e7('0x2')]||![];this['AllConditions']=_0x284ef8[_0x43e7('0x3')]||[];this[_0x43e7('0x4')]=_0x284ef8[_0x43e7('0x4')]||[];this[_0x43e7('0x5')]=_0x284ef8[_0x43e7('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x00bb=['status','AllConditions','AnyConditions','exports','name','channel'];(function(_0x4507b0,_0x4ede9b){var _0x59250f=function(_0x45a232){while(--_0x45a232){_0x4507b0['push'](_0x4507b0['shift']());}};_0x59250f(++_0x4ede9b);}(_0x00bb,0x1d8));var _0xb00b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x00bb[_0x433a86];return _0x23000c;};'use strict';function Trigger(_0x4b870b){this['id']=_0x4b870b['id']||0x0;this[_0xb00b('0x0')]=_0x4b870b[_0xb00b('0x0')]||'';this['channel']=_0x4b870b[_0xb00b('0x1')]||'voice';this[_0xb00b('0x2')]=_0x4b870b[_0xb00b('0x2')]||![];this['AllConditions']=_0x4b870b[_0xb00b('0x3')]||[];this[_0xb00b('0x4')]=_0x4b870b['AnyConditions']||[];this['Actions']=_0x4b870b['Actions']||[];}module[_0xb00b('0x5')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 76e0cc9..f762cbb 100644 --- a/server/services/ami/model/trunk.js +++ b/server/services/ami/model/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc981=['status','registry','indexOf','split','host','port','domainport','refresh','registrationtime','address','exports','active','name','state','unknown','stateTime'];(function(_0x4936af,_0x5c741c){var _0x33901b=function(_0x16b5e1){while(--_0x16b5e1){_0x4936af['push'](_0x4936af['shift']());}};_0x33901b(++_0x5c741c);}(_0xc981,0xeb));var _0x1c98=function(_0x23833e,_0x4e5d7f){_0x23833e=_0x23833e-0x0;var _0x289adf=_0xc981[_0x23833e];return _0x289adf;};'use strict';function Trunk(_0x5e9119){this['id']=_0x5e9119['id']||0x0;this[_0x1c98('0x0')]=_0x5e9119[_0x1c98('0x0')]||![];this[_0x1c98('0x1')]=_0x5e9119[_0x1c98('0x1')]||'';this[_0x1c98('0x2')]=_0x1c98('0x3');this[_0x1c98('0x4')]=0x0;this[_0x1c98('0x5')]=_0x1c98('0x3');this[_0x1c98('0x6')]=_0x5e9119[_0x1c98('0x6')]&&_0x5e9119[_0x1c98('0x6')][_0x1c98('0x7')](':')?_0x5e9119['registry'][_0x1c98('0x8')](':')[0x0]:'';this[_0x1c98('0x9')]='';this[_0x1c98('0xa')]='';this['domain']='';this[_0x1c98('0xb')]='';this[_0x1c98('0xc')]='';this['stateRegistry']=_0x1c98('0x3');this[_0x1c98('0xd')]='';this[_0x1c98('0xe')]='';}module[_0x1c98('0xf')]=Trunk; \ No newline at end of file +var _0xfde3=['refresh','stateRegistry','address','exports','name','state','unknown','stateTime','registry','host','port','domain'];(function(_0x1e86e4,_0x2a52dd){var _0x1d6687=function(_0x4c4a04){while(--_0x4c4a04){_0x1e86e4['push'](_0x1e86e4['shift']());}};_0x1d6687(++_0x2a52dd);}(_0xfde3,0xe8));var _0x3fde=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfde3[_0x502c7d];return _0x30b7ed;};'use strict';function Trunk(_0x230d81){this['id']=_0x230d81['id']||0x0;this['active']=_0x230d81['active']||![];this['name']=_0x230d81[_0x3fde('0x0')]||'';this[_0x3fde('0x1')]=_0x3fde('0x2');this[_0x3fde('0x3')]=0x0;this['status']=_0x3fde('0x2');this['registry']=_0x230d81[_0x3fde('0x4')]&&_0x230d81[_0x3fde('0x4')]['indexOf'](':')?_0x230d81[_0x3fde('0x4')]['split'](':')[0x0]:'';this[_0x3fde('0x5')]='';this[_0x3fde('0x6')]='';this[_0x3fde('0x7')]='';this['domainport']='';this[_0x3fde('0x8')]='';this[_0x3fde('0x9')]='unknown';this['registrationtime']='';this[_0x3fde('0xa')]='';}module[_0x3fde('0xb')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index ed344b3..836a1b9 100644 --- a/server/services/ami/model/voiceExtension.js +++ b/server/services/ami/model/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3324=['exports','exten','none','mandatoryDisposition'];(function(_0x26dc02,_0x4911d0){var _0x42bc17=function(_0x27cdb8){while(--_0x27cdb8){_0x26dc02['push'](_0x26dc02['shift']());}};_0x42bc17(++_0x4911d0);}(_0x3324,0x189));var _0x4332=function(_0x6873c1,_0x5dd0ad){_0x6873c1=_0x6873c1-0x0;var _0x3b6546=_0x3324[_0x6873c1];return _0x3b6546;};'use strict';function voiceExtension(_0x217503){this['id']=_0x217503['id']||0x0;this[_0x4332('0x0')]=_0x217503[_0x4332('0x0')]||'';this['recordingFormat']=_0x217503['recordingFormat']||_0x4332('0x1');this[_0x4332('0x2')]=_0x217503['mandatoryDisposition']||![];}module[_0x4332('0x3')]=voiceExtension; \ No newline at end of file +var _0x97ac=['exten','recordingFormat','mandatoryDisposition','exports'];(function(_0x2958d4,_0x22b42f){var _0x21105c=function(_0x44d0fb){while(--_0x44d0fb){_0x2958d4['push'](_0x2958d4['shift']());}};_0x21105c(++_0x22b42f);}(_0x97ac,0x68));var _0xc97a=function(_0x4c5fb4,_0x26135b){_0x4c5fb4=_0x4c5fb4-0x0;var _0x3c0a2c=_0x97ac[_0x4c5fb4];return _0x3c0a2c;};'use strict';function voiceExtension(_0x15559e){this['id']=_0x15559e['id']||0x0;this[_0xc97a('0x0')]=_0x15559e['exten']||'';this[_0xc97a('0x1')]=_0x15559e[_0xc97a('0x1')]||'none';this['mandatoryDisposition']=_0x15559e[_0xc97a('0x2')]||![];}module[_0xc97a('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index cb94bd2..a00a71c 100644 --- a/server/services/ami/model/voiceQueue.js +++ b/server/services/ami/model/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe61c=['dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','invalid','unavailable','ringinuse','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization'];(function(_0x2512ce,_0x525ffe){var _0x4c5923=function(_0x32d5c1){while(--_0x32d5c1){_0x2512ce['push'](_0x2512ce['shift']());}};_0x4c5923(++_0x525ffe);}(_0xe61c,0xb6));var _0xce61=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0xe61c[_0x41bdd4];return _0x5c03a6;};'use strict';var statusDesc=['unknown',_0xce61('0x0'),_0xce61('0x1'),'busy',_0xce61('0x2'),_0xce61('0x3'),'ringing',_0xce61('0x4'),'onhold'];var monitorFormat={'wav':_0xce61('0x5'),'wav49':'wav49','gsm':_0xce61('0x6')};var strategy={'rrmemory':_0xce61('0x7'),'roundrobin':_0xce61('0x8')};function VoiceQueue(_0x56c77b){this['id']=_0x56c77b['id']||0x0;this[_0xce61('0x9')]=_0x56c77b[_0xce61('0x9')]||'';this[_0xce61('0xa')]=_0x56c77b['monitor_format']||'';this[_0xce61('0xb')]=_0x56c77b[_0xce61('0xb')]||_0xce61('0xc');this[_0xce61('0xd')]=0x0;this[_0xce61('0xe')]=0x0;this['total']=0x0;this[_0xce61('0xf')]=0x0;this[_0xce61('0x10')]=0x0;this[_0xce61('0x11')]=0x0;this['sumBillable']=0x0;this[_0xce61('0x12')]=0x0;this[_0xce61('0x13')]=0x0;this[_0xce61('0x14')]=0x0;this[_0xce61('0x15')]=0x0;this[_0xce61('0x16')]=_0x56c77b[_0xce61('0x16')]||![];this['acwTimeout']=_0x56c77b[_0xce61('0x17')]||0xa;this['autopause']=_0x56c77b['autopause']||'no';this['sendMessageOneNotActive']=!![];this['message']='';this['originated']=0x0;this[_0xce61('0x18')]=0x0;this[_0xce61('0x19')]=_0x56c77b[_0xce61('0x19')]||null;this[_0xce61('0x1a')]=_0x56c77b[_0xce61('0x1a')]?_0x56c77b[_0xce61('0x1a')]:null;this[_0xce61('0x1b')]=_0x56c77b[_0xce61('0x1b')];this[_0xce61('0x1c')]=_0x56c77b[_0xce61('0x1c')]||_0xce61('0x1d');this[_0xce61('0x1e')]=_0x56c77b[_0xce61('0x1e')]||0x0;this[_0xce61('0x1f')]=_0x56c77b[_0xce61('0x1f')]||0x0;this['dialPowerLevel']=_0x56c77b[_0xce61('0x20')]||0x1;this[_0xce61('0x21')]=_0x56c77b['dialPredictiveOptimization']||_0xce61('0x22');this[_0xce61('0x23')]=_0x56c77b[_0xce61('0x23')]||0.03;this['dialPredictiveInterval']=_0x56c77b[_0xce61('0x24')]||0x258;this['dialOriginateCallerIdName']=_0x56c77b[_0xce61('0x25')]||_0xce61('0x26');this[_0xce61('0x27')]=_0x56c77b[_0xce61('0x27')]||'anonymous';this['dialOriginateTimeout']=_0x56c77b[_0xce61('0x28')]||0x1e;this[_0xce61('0x29')]=_0x56c77b[_0xce61('0x29')]||'tTxX';this[_0xce61('0x2a')]=_0x56c77b[_0xce61('0x2a')]||0x3;this[_0xce61('0x2b')]=_0x56c77b[_0xce61('0x2b')]||undefined;this[_0xce61('0x2c')]=_0x56c77b[_0xce61('0x2c')]||0x3;this['dialCongestionRetryFrequency']=_0x56c77b[_0xce61('0x2d')]||0x96;this[_0xce61('0x2e')]=_0x56c77b[_0xce61('0x2e')]||0x3;this[_0xce61('0x2f')]=_0x56c77b['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x56c77b[_0xce61('0x30')]||0x3;this[_0xce61('0x31')]=_0x56c77b[_0xce61('0x31')]||0x96;this['dialGlobalMaxRetry']=_0x56c77b[_0xce61('0x32')]||0x4;this[_0xce61('0x33')]=_0x56c77b[_0xce61('0x33')]?_0x56c77b[_0xce61('0x33')]:undefined;this[_0xce61('0x34')]=_0x56c77b[_0xce61('0x34')]?_0x56c77b['TrunkBackup']:undefined;this[_0xce61('0x35')]=_0x56c77b['dialPrefix']||undefined;this[_0xce61('0x36')]=_0x56c77b[_0xce61('0x36')]?_0x56c77b['Interval']:undefined;this[_0xce61('0x37')]=_0x56c77b['dialOrderByScheduledAt']||_0xce61('0x38');this['dialRandomLastDigitCallerIdNumber']=_0x56c77b['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xce61('0x39')]=_0x56c77b[_0xce61('0x39')]||undefined;this[_0xce61('0x3a')]=strategy[_0x56c77b['strategy']]||_0xce61('0x7');this[_0xce61('0x3b')]=!![];this[_0xce61('0x3c')]=_0x56c77b[_0xce61('0x3c')]||![];this[_0xce61('0x3d')]=_0x56c77b['dialAMDInitialSilence'];this[_0xce61('0x3e')]=_0x56c77b[_0xce61('0x3e')];this[_0xce61('0x3f')]=_0x56c77b[_0xce61('0x3f')];this['dialAMDTotalAnalysisTime']=_0x56c77b[_0xce61('0x40')];this[_0xce61('0x41')]=_0x56c77b[_0xce61('0x41')];this[_0xce61('0x42')]=_0x56c77b[_0xce61('0x42')];this['dialAMDMaximumNumberOfWords']=_0x56c77b['dialAMDMaximumNumberOfWords'];this[_0xce61('0x43')]=_0x56c77b[_0xce61('0x43')];this[_0xce61('0x44')]=_0x56c77b[_0xce61('0x44')];this[_0xce61('0x45')]=0x0;this['pTalking']=0x0;this[_0xce61('0x46')]=_0x56c77b[_0xce61('0x46')];this[_0xce61('0x47')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xce61('0x48')]=0x0;this[_0xce61('0x49')]=0x0;this[_0xce61('0x4a')]=0x0;this[_0xce61('0x4b')]=0x0;this[_0xce61('0x4c')]=0x0;this[_0xce61('0x4d')]=0x0;this[_0xce61('0x4e')]=0x0;this[_0xce61('0x4f')]=0x0;this[_0xce61('0x50')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xce61('0x51')]=0x0;this[_0xce61('0x52')]=undefined;this[_0xce61('0x53')]=undefined;this['handlePredictive']=undefined;this[_0xce61('0x54')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xce61('0x55')]=0x0;this[_0xce61('0x56')]=0x0;this[_0xce61('0x57')]=0x0;this[_0xce61('0x58')]=0x0;this[_0xce61('0x59')]=0x0;this[_0xce61('0x5a')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xce61('0x5b')]=_0x56c77b[_0xce61('0x5c')]||0x14;this[_0xce61('0x5d')]=_0x56c77b[_0xce61('0x5c')]||0xa;this[_0xce61('0x5e')]=0x0;this[_0xce61('0x5f')]=0x0;this[_0xce61('0x60')]=0x1;this[_0xce61('0x61')]=0x0;this[_0xce61('0x62')]=0x0;this[_0xce61('0x63')]=0x0;this['erlangBusyFactor']=0x0;this[_0xce61('0x64')]=_0x56c77b[_0xce61('0x64')]||0x1e;this['dialRecallInQueue']=_0x56c77b[_0xce61('0x65')]||![];this[_0xce61('0x66')]=_0x56c77b['dialQueueProject2']||undefined;this[_0xce61('0x67')]=_0x56c77b['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x56c77b[_0xce61('0x68')]||![];this['monitor_format']=monitorFormat[_0x56c77b['monitor_format']]?monitorFormat[_0x56c77b[_0xce61('0xa')]]:undefined;this[_0xce61('0x69')]=_0x56c77b[_0xce61('0x69')]||![];this[_0xce61('0x6a')]=_0x56c77b['mandatoryDispositionPause']?_0x56c77b[_0xce61('0x6a')]:undefined;}module[_0xce61('0x6b')]=VoiceQueue; \ No newline at end of file +var _0x194b=['outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startPredictive','handlePredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit'];(function(_0x7c15f1,_0x9aba97){var _0xbdb9c1=function(_0xd28e84){while(--_0xd28e84){_0x7c15f1['push'](_0x7c15f1['shift']());}};_0xbdb9c1(++_0x9aba97);}(_0x194b,0x1e4));var _0xb194=function(_0x35de34,_0x4ec1ed){_0x35de34=_0x35de34-0x0;var _0x93f89d=_0x194b[_0x35de34];return _0x93f89d;};'use strict';var statusDesc=[_0xb194('0x0'),_0xb194('0x1'),_0xb194('0x2'),_0xb194('0x3'),_0xb194('0x4'),_0xb194('0x5'),_0xb194('0x6'),_0xb194('0x7'),_0xb194('0x8')];var monitorFormat={'wav':'wav','wav49':_0xb194('0x9'),'gsm':_0xb194('0xa')};var strategy={'rrmemory':_0xb194('0xb'),'roundrobin':_0xb194('0xc')};function VoiceQueue(_0x5720a8){this['id']=_0x5720a8['id']||0x0;this[_0xb194('0xd')]=_0x5720a8[_0xb194('0xd')]||'';this[_0xb194('0xe')]=_0x5720a8[_0xb194('0xe')]||'';this[_0xb194('0xf')]=_0x5720a8['type']||_0xb194('0x10');this[_0xb194('0x11')]=0x0;this[_0xb194('0x12')]=0x0;this[_0xb194('0x13')]=0x0;this['answered']=0x0;this[_0xb194('0x14')]=0x0;this[_0xb194('0x15')]=0x0;this[_0xb194('0x16')]=0x0;this[_0xb194('0x17')]=0x0;this[_0xb194('0x18')]=0x0;this['loggedIn']=0x0;this[_0xb194('0x19')]=0x0;this[_0xb194('0x1a')]=_0x5720a8[_0xb194('0x1a')]||![];this[_0xb194('0x1b')]=_0x5720a8[_0xb194('0x1b')]||0xa;this[_0xb194('0x1c')]=_0x5720a8[_0xb194('0x1c')]||'no';this['sendMessageOneNotActive']=!![];this[_0xb194('0x1d')]='';this['originated']=0x0;this[_0xb194('0x1e')]=0x0;this['dialTimezone']=_0x5720a8[_0xb194('0x1f')]||null;this['dialGlobalInterval']=_0x5720a8['dialGlobalInterval']?_0x5720a8[_0xb194('0x20')]:null;this[_0xb194('0x21')]=_0x5720a8[_0xb194('0x21')];this[_0xb194('0x22')]=_0x5720a8['dialMethod']||_0xb194('0x23');this[_0xb194('0x24')]=_0x5720a8[_0xb194('0x24')]||0x0;this['dialLimitQueue']=_0x5720a8[_0xb194('0x25')]||0x0;this[_0xb194('0x26')]=_0x5720a8['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x5720a8[_0xb194('0x27')]||_0xb194('0x28');this[_0xb194('0x29')]=_0x5720a8[_0xb194('0x29')]||0.03;this['dialPredictiveInterval']=_0x5720a8[_0xb194('0x2a')]||0x258;this[_0xb194('0x2b')]=_0x5720a8[_0xb194('0x2b')]||_0xb194('0x2c');this[_0xb194('0x2d')]=_0x5720a8['dialOriginateCallerIdNumber']||'anonymous';this['dialOriginateTimeout']=_0x5720a8[_0xb194('0x2e')]||0x1e;this[_0xb194('0x2f')]=_0x5720a8[_0xb194('0x2f')]||_0xb194('0x30');this[_0xb194('0x31')]=_0x5720a8[_0xb194('0x31')]||0x3;this['dialQueueProject']=_0x5720a8[_0xb194('0x32')]||undefined;this[_0xb194('0x33')]=_0x5720a8[_0xb194('0x33')]||0x3;this['dialCongestionRetryFrequency']=_0x5720a8[_0xb194('0x34')]||0x96;this[_0xb194('0x35')]=_0x5720a8[_0xb194('0x35')]||0x3;this[_0xb194('0x36')]=_0x5720a8[_0xb194('0x36')]||0x96;this['dialNoAnswerMaxRetry']=_0x5720a8[_0xb194('0x37')]||0x3;this[_0xb194('0x38')]=_0x5720a8[_0xb194('0x38')]||0x96;this[_0xb194('0x39')]=_0x5720a8['dialGlobalMaxRetry']||0x4;this[_0xb194('0x3a')]=_0x5720a8[_0xb194('0x3a')]?_0x5720a8['Trunk']:undefined;this[_0xb194('0x3b')]=_0x5720a8[_0xb194('0x3b')]?_0x5720a8[_0xb194('0x3b')]:undefined;this['dialPrefix']=_0x5720a8[_0xb194('0x3c')]||undefined;this['Interval']=_0x5720a8[_0xb194('0x3d')]?_0x5720a8[_0xb194('0x3d')]:undefined;this['dialOrderByScheduledAt']=_0x5720a8['dialOrderByScheduledAt']||_0xb194('0x3e');this[_0xb194('0x3f')]=_0x5720a8[_0xb194('0x3f')]||undefined;this['dialCutDigit']=_0x5720a8[_0xb194('0x40')]||undefined;this['strategy']=strategy[_0x5720a8['strategy']]||_0xb194('0xb');this[_0xb194('0x41')]=!![];this[_0xb194('0x42')]=_0x5720a8[_0xb194('0x42')]||![];this[_0xb194('0x43')]=_0x5720a8[_0xb194('0x43')];this[_0xb194('0x44')]=_0x5720a8['dialAMDGreeting'];this[_0xb194('0x45')]=_0x5720a8['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x5720a8['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x5720a8[_0xb194('0x46')];this[_0xb194('0x47')]=_0x5720a8[_0xb194('0x47')];this[_0xb194('0x48')]=_0x5720a8[_0xb194('0x48')];this[_0xb194('0x49')]=_0x5720a8[_0xb194('0x49')];this['dialAMDMaximumWordLength']=_0x5720a8[_0xb194('0x4a')];this[_0xb194('0x4b')]=0x0;this['pTalking']=0x0;this[_0xb194('0x4c')]=_0x5720a8[_0xb194('0x4c')];this[_0xb194('0x4d')]=0x0;this[_0xb194('0x4e')]=0x0;this[_0xb194('0x4f')]=0x0;this[_0xb194('0x50')]=0x0;this[_0xb194('0x51')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xb194('0x52')]=0x0;this[_0xb194('0x53')]=0x0;this[_0xb194('0x54')]=0x0;this[_0xb194('0x55')]=0x0;this[_0xb194('0x56')]=0x0;this[_0xb194('0x57')]=0x0;this[_0xb194('0x58')]=0x0;this['startProgressive']=undefined;this[_0xb194('0x59')]=undefined;this[_0xb194('0x5a')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xb194('0x5b')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xb194('0x5c')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xb194('0x5d')]=0x0;this[_0xb194('0x5e')]=0x0;this[_0xb194('0x5f')]=0x0;this[_0xb194('0x60')]=_0x5720a8[_0xb194('0x61')]||0x14;this[_0xb194('0x62')]=_0x5720a8[_0xb194('0x61')]||0xa;this[_0xb194('0x63')]=0x0;this[_0xb194('0x64')]=0x0;this[_0xb194('0x65')]=0x1;this[_0xb194('0x66')]=0x0;this[_0xb194('0x67')]=0x0;this[_0xb194('0x68')]=0x0;this[_0xb194('0x69')]=0x0;this['dialRecallMeTimeout']=_0x5720a8[_0xb194('0x6a')]||0x1e;this['dialRecallInQueue']=_0x5720a8[_0xb194('0x6b')]||![];this['dialQueueProject2']=_0x5720a8[_0xb194('0x6c')]||undefined;this['dialAgiAfterHangupClient']=_0x5720a8[_0xb194('0x6d')]||![];this[_0xb194('0x6e')]=_0x5720a8[_0xb194('0x6e')]||![];this[_0xb194('0xe')]=monitorFormat[_0x5720a8[_0xb194('0xe')]]?monitorFormat[_0x5720a8[_0xb194('0xe')]]:undefined;this[_0xb194('0x6f')]=_0x5720a8[_0xb194('0x6f')]||![];this[_0xb194('0x70')]=_0x5720a8[_0xb194('0x70')]?_0x5720a8[_0xb194('0x70')]:undefined;}module[_0xb194('0x71')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 4a938bf..7e05dab 100644 --- a/server/services/ami/model/vtigerAccount.js +++ b/server/services/ami/model/vtigerAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2291=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x849500,_0x23c219){var _0x54ca44=function(_0x344563){while(--_0x344563){_0x849500['push'](_0x849500['shift']());}};_0x54ca44(++_0x23c219);}(_0x2291,0x1b6));var _0x1229=function(_0x4c8d9e,_0x2a7f13){_0x4c8d9e=_0x4c8d9e-0x0;var _0x52b81d=_0x2291[_0x4c8d9e];return _0x52b81d;};'use strict';function VtigerAccount(_0x1f57bd){this['id']=_0x1f57bd['id']||0x0;this['name']=_0x1f57bd[_0x1229('0x0')]||'';this[_0x1229('0x1')]=_0x1f57bd[_0x1229('0x1')]||'';this[_0x1229('0x2')]=_0x1f57bd['accessKey']||'';this['remoteUri']=_0x1f57bd[_0x1229('0x3')]||'';this['serverUrl']=_0x1f57bd[_0x1229('0x4')]||'';this[_0x1229('0x5')]=_0x1f57bd[_0x1229('0x5')]||{};}module[_0x1229('0x6')]=VtigerAccount; \ No newline at end of file +var _0x6c96=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x19054a,_0x1e7104){var _0x101026=function(_0x52b8d8){while(--_0x52b8d8){_0x19054a['push'](_0x19054a['shift']());}};_0x101026(++_0x1e7104);}(_0x6c96,0x1c1));var _0x66c9=function(_0x10957f,_0x4aab76){_0x10957f=_0x10957f-0x0;var _0x256e84=_0x6c96[_0x10957f];return _0x256e84;};'use strict';function VtigerAccount(_0x20292c){this['id']=_0x20292c['id']||0x0;this['name']=_0x20292c[_0x66c9('0x0')]||'';this[_0x66c9('0x1')]=_0x20292c['username']||'';this[_0x66c9('0x2')]=_0x20292c[_0x66c9('0x2')]||'';this[_0x66c9('0x3')]=_0x20292c[_0x66c9('0x3')]||'';this[_0x66c9('0x4')]=_0x20292c[_0x66c9('0x4')]||'';this[_0x66c9('0x5')]=_0x20292c['Configurations']||{};}module[_0x66c9('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 824917e..70ea61d 100644 --- a/server/services/ami/model/zendeskAccount.js +++ b/server/services/ami/model/zendeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['authType','type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri'];(function(_0x2c0f3a,_0x820b5b){var _0x506269=function(_0x111b65){while(--_0x111b65){_0x2c0f3a['push'](_0x2c0f3a['shift']());}};_0x506269(++_0x820b5b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x50dad4,_0x3d1c82){_0x50dad4=_0x50dad4-0x0;var _0x19576a=_0x5f2f[_0x50dad4];return _0x19576a;};'use strict';function ZendeskAccount(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||'';this[_0xf5f2('0x2')]=_0x7c86d8[_0xf5f2('0x2')]||'';this[_0xf5f2('0x3')]=_0x7c86d8['token']||'';this['remoteUri']=_0x7c86d8[_0xf5f2('0x4')]||'';this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||'';this[_0xf5f2('0x6')]=_0x7c86d8[_0xf5f2('0x6')]||_0xf5f2('0x7');this['serverUrl']=_0x7c86d8[_0xf5f2('0x8')]||'';this[_0xf5f2('0x9')]=_0x7c86d8[_0xf5f2('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x2032=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0x40cba7,_0x364bc3){var _0x3ae30d=function(_0x474e16){while(--_0x474e16){_0x40cba7['push'](_0x40cba7['shift']());}};_0x3ae30d(++_0x364bc3);}(_0x2032,0xd9));var _0x2203=function(_0x125971,_0x88a453){_0x125971=_0x125971-0x0;var _0x519d7b=_0x2032[_0x125971];return _0x519d7b;};'use strict';function ZendeskAccount(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['username']||'';this[_0x2203('0x2')]=_0x4d6c97[_0x2203('0x2')]||'';this['token']=_0x4d6c97[_0x2203('0x3')]||'';this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||'';this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||'';this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||_0x2203('0x7');this[_0x2203('0x8')]=_0x4d6c97[_0x2203('0x8')]||'';this[_0x2203('0x9')]=_0x4d6c97['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 0ae4090..6e78378 100644 --- a/server/services/ami/model/zohoAccount.js +++ b/server/services/ami/model/zohoAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73a1=['exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x1f0199,_0x3bf73e){var _0x5542f8=function(_0x33a7a0){while(--_0x33a7a0){_0x1f0199['push'](_0x1f0199['shift']());}};_0x5542f8(++_0x3bf73e);}(_0x73a1,0x161));var _0x173a=function(_0x2d61ac,_0x18ff36){_0x2d61ac=_0x2d61ac-0x0;var _0x3f7d3c=_0x73a1[_0x2d61ac];return _0x3f7d3c;};'use strict';function ZohoAccount(_0x162bbc){this['id']=_0x162bbc['id']||0x0;this['name']=_0x162bbc[_0x173a('0x0')]||'';this[_0x173a('0x1')]=_0x162bbc['description']||'';this[_0x173a('0x2')]=_0x162bbc[_0x173a('0x2')]||'';this[_0x173a('0x3')]=_0x162bbc[_0x173a('0x3')]||'';this[_0x173a('0x4')]=_0x162bbc['clientId']||'';this[_0x173a('0x5')]=_0x162bbc[_0x173a('0x5')]||'';this[_0x173a('0x6')]=_0x162bbc[_0x173a('0x6')]||'';this[_0x173a('0x7')]=_0x162bbc[_0x173a('0x7')]||'';this[_0x173a('0x8')]=_0x162bbc[_0x173a('0x8')]||'';this[_0x173a('0x9')]=_0x162bbc[_0x173a('0x9')]||{};}module[_0x173a('0xa')]=ZohoAccount; \ No newline at end of file +var _0x49db=['zone','clientId','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x1390df,_0x1b30b3){var _0xb44b0b=function(_0x37a118){while(--_0x37a118){_0x1390df['push'](_0x1390df['shift']());}};_0xb44b0b(++_0x1b30b3);}(_0x49db,0xc5));var _0xb49d=function(_0x2217d4,_0x56625e){_0x2217d4=_0x2217d4-0x0;var _0x30a599=_0x49db[_0x2217d4];return _0x30a599;};'use strict';function ZohoAccount(_0x2e53d6){this['id']=_0x2e53d6['id']||0x0;this[_0xb49d('0x0')]=_0x2e53d6[_0xb49d('0x0')]||'';this[_0xb49d('0x1')]=_0x2e53d6[_0xb49d('0x1')]||'';this['host']=_0x2e53d6[_0xb49d('0x2')]||'';this[_0xb49d('0x3')]=_0x2e53d6[_0xb49d('0x3')]||'';this['clientId']=_0x2e53d6[_0xb49d('0x4')]||'';this['clientSecret']=_0x2e53d6['clientSecret']||'';this[_0xb49d('0x5')]=_0x2e53d6[_0xb49d('0x5')]||'';this[_0xb49d('0x6')]=_0x2e53d6['code']||'';this[_0xb49d('0x7')]=_0x2e53d6[_0xb49d('0x7')]||'';this[_0xb49d('0x8')]=_0x2e53d6[_0xb49d('0x8')]||{};}module[_0xb49d('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 2e53706..f33828a 100644 --- a/server/services/ami/preview/action.js +++ b/server/services/ami/preview/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb972=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','util','lodash','moment','string','isNil','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','callback'];(function(_0x579890,_0x400108){var _0x4ea092=function(_0x48f986){while(--_0x48f986){_0x579890['push'](_0x579890['shift']());}};_0x4ea092(++_0x400108);}(_0xb972,0xcb));var _0x2b97=function(_0x1417c6,_0x194309){_0x1417c6=_0x1417c6-0x0;var _0x44db97=_0xb972[_0x1417c6];return _0x44db97;};'use strict';var util=require(_0x2b97('0x0'));var _=require(_0x2b97('0x1'));var moment=require(_0x2b97('0x2'));function checkNameSurname(_0x2ac352,_0xb72250,_0x292a64){var _0xf04ce5='';if(!_['isNil'](_0xb72250)&&_0x2b97('0x3')===typeof _0xb72250){_0xf04ce5+=_0xb72250;}if(!_[_0x2b97('0x4')](_0x292a64)&&'string'===typeof _0x292a64){_0xf04ce5+='\x20'+_0x292a64;}if(_0xf04ce5!==''){return _0xf04ce5;}return _0x2ac352;}function Action(_0x5de108,_0x3532c7,_0x5471ea,_0x5891c1,_0x28ead1){this[_0x2b97('0x5')]=_0x5471ea||undefined;this['idContact']=_0x5de108['id'];this[_0x2b97('0x6')]=_0x3532c7[_0x2b97('0x7')];this[_0x2b97('0x8')]=_0x3532c7[_0x2b97('0x8')];this[_0x2b97('0x9')]=_0x2b97('0x6');this[_0x2b97('0xa')]=![];this[_0x2b97('0xb')]=_[_0x2b97('0x4')](_0x5de108[_0x2b97('0xc')])?undefined:_0x5de108[_0x2b97('0xc')]['name'];this[_0x2b97('0xd')]=this[_0x2b97('0xb')]?util['format'](_0x2b97('0xe'),this[_0x2b97('0xb')]):_0x5891c1||undefined;this[_0x2b97('0xf')]=checkNameSurname(_0x5de108[_0x2b97('0x10')][_0x2b97('0x11')],_0x5de108[_0x2b97('0x10')][_0x2b97('0x12')],_0x5de108[_0x2b97('0x10')][_0x2b97('0x13')]);this[_0x2b97('0x14')]=_0x5de108[_0x2b97('0x14')]||![];this['calleridnum']=_0x5de108[_0x2b97('0x10')][_0x2b97('0x11')];this[_0x2b97('0x15')]=_0x5de108['scheduledat'];this[_0x2b97('0x16')]=_0x5de108[_0x2b97('0x16')]||0x0;this[_0x2b97('0x17')]=_0x5de108[_0x2b97('0x17')]||0x0;this['countnoanswerretry']=_0x5de108['countnoanswerretry']||0x0;this['countglobal']=(_0x5de108[_0x2b97('0x16')]||0x0)+(_0x5de108[_0x2b97('0x17')]||0x0)+(_0x5de108['countnoanswerretry']||0x0);this['callback']=_0x5de108[_0x2b97('0x18')];this[_0x2b97('0x19')]=_0x5de108['callbackuniqueid'];this[_0x2b97('0x1a')]=_0x5de108[_0x2b97('0x1a')];this[_0x2b97('0x1b')]=_0x5de108[_0x2b97('0x1b')];this[_0x2b97('0x1c')]=_0x5de108[_0x2b97('0x1c')];this[_0x2b97('0x1d')]=_0x5de108[_0x2b97('0x1d')];this[_0x2b97('0x1e')]=_[_0x2b97('0x4')](_0x5de108[_0x2b97('0xc')])?_0x5de108[_0x2b97('0x1e')]:_0x5de108[_0x2b97('0xc')]['id'];this[_0x2b97('0x1f')]=_0x5de108['VoiceQueueId'];this[_0x2b97('0x20')]='';this[_0x2b97('0x21')]='';}Action[_0x2b97('0x22')][_0x2b97('0x23')]=function(){return util[_0x2b97('0x24')](_0x2b97('0x25'),this[_0x2b97('0xf')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0x6e4f=['active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','string','isNil','uniqueid','idContact','name','type','campaigntype','queue','membername','Agent','calleridname','Contact','phone','firstName','lastName'];(function(_0x2347b4,_0x4204f4){var _0x220499=function(_0x3fedc4){while(--_0x3fedc4){_0x2347b4['push'](_0x2347b4['shift']());}};_0x220499(++_0x4204f4);}(_0x6e4f,0x8a));var _0xf6e4=function(_0x2cbe66,_0x23d3b0){_0x2cbe66=_0x2cbe66-0x0;var _0x2203fb=_0x6e4f[_0x2cbe66];return _0x2203fb;};'use strict';var util=require(_0xf6e4('0x0'));var _=require(_0xf6e4('0x1'));var moment=require(_0xf6e4('0x2'));function checkNameSurname(_0x5c6c4b,_0x146a1f,_0x3bcf20){var _0x29e4c9='';if(!_['isNil'](_0x146a1f)&&_0xf6e4('0x3')===typeof _0x146a1f){_0x29e4c9+=_0x146a1f;}if(!_[_0xf6e4('0x4')](_0x3bcf20)&&_0xf6e4('0x3')===typeof _0x3bcf20){_0x29e4c9+='\x20'+_0x3bcf20;}if(_0x29e4c9!==''){return _0x29e4c9;}return _0x5c6c4b;}function Action(_0x2ac076,_0x14c87e,_0x4254b,_0x15506c,_0x4c8458){this[_0xf6e4('0x5')]=_0x4254b||undefined;this[_0xf6e4('0x6')]=_0x2ac076['id'];this['queue']=_0x14c87e[_0xf6e4('0x7')];this[_0xf6e4('0x8')]=_0x14c87e['type'];this[_0xf6e4('0x9')]=_0xf6e4('0xa');this['dialAnswer']=![];this[_0xf6e4('0xb')]=_[_0xf6e4('0x4')](_0x2ac076[_0xf6e4('0xc')])?undefined:_0x2ac076['Agent'][_0xf6e4('0x7')];this['channelAgent']=this['membername']?util['format']('SIP/%s',this[_0xf6e4('0xb')]):_0x15506c||undefined;this[_0xf6e4('0xd')]=checkNameSurname(_0x2ac076[_0xf6e4('0xe')][_0xf6e4('0xf')],_0x2ac076[_0xf6e4('0xe')][_0xf6e4('0x10')],_0x2ac076[_0xf6e4('0xe')][_0xf6e4('0x11')]);this[_0xf6e4('0x12')]=_0x2ac076['active']||![];this[_0xf6e4('0x13')]=_0x2ac076[_0xf6e4('0xe')][_0xf6e4('0xf')];this[_0xf6e4('0x14')]=_0x2ac076['scheduledat'];this[_0xf6e4('0x15')]=_0x2ac076[_0xf6e4('0x15')]||0x0;this['countcongestionretry']=_0x2ac076[_0xf6e4('0x16')]||0x0;this['countnoanswerretry']=_0x2ac076[_0xf6e4('0x17')]||0x0;this[_0xf6e4('0x18')]=(_0x2ac076[_0xf6e4('0x15')]||0x0)+(_0x2ac076['countcongestionretry']||0x0)+(_0x2ac076['countnoanswerretry']||0x0);this[_0xf6e4('0x19')]=_0x2ac076[_0xf6e4('0x19')];this[_0xf6e4('0x1a')]=_0x2ac076[_0xf6e4('0x1a')];this[_0xf6e4('0x1b')]=_0x2ac076[_0xf6e4('0x1b')];this[_0xf6e4('0x1c')]=_0x2ac076['recallme'];this[_0xf6e4('0x1d')]=_0x2ac076[_0xf6e4('0x1d')];this['ListId']=_0x2ac076[_0xf6e4('0x1e')];this[_0xf6e4('0x1f')]=_[_0xf6e4('0x4')](_0x2ac076[_0xf6e4('0xc')])?_0x2ac076[_0xf6e4('0x1f')]:_0x2ac076[_0xf6e4('0xc')]['id'];this[_0xf6e4('0x20')]=_0x2ac076[_0xf6e4('0x20')];this['originatecalleridnum']='';this[_0xf6e4('0x21')]='';}Action['prototype'][_0xf6e4('0x22')]=function(){return util[_0xf6e4('0x23')](_0xf6e4('0x24'),this[_0xf6e4('0xd')],this[_0xf6e4('0x25')]);};module[_0xf6e4('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index e7b21ed..ab21aac 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc022=['[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','Busy','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','rescheduleContact','scheduledAt','dialBusyRetryFrequency','activeContact','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','unlockAgent','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','idContact','[default]','cause-txt','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','originated:\x20','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Agent','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','actionid','isFailure','response','disableContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','[syncHangup][talking][transfer]','destuniqueid','dialstatus','addVariable','variables','filterKey','variable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfer','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','startProgressive','Trunk','name','active','Interval','stringify','md5','voice_queue:save','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','prototype','syncCampaigns','hasOwnProperty','booked','setMessage','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','pick','UserId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','recallMe','getContactRecallMe','agentReadyId','then','getDiff','dialRecallMeTimeout','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','catch','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','custom:agentConnectPreview','custom:agentcomplete','buildObj','complete','total','Answer'];(function(_0x2e5981,_0xe4e846){var _0x6e4fef=function(_0x252b0c){while(--_0x252b0c){_0x2e5981['push'](_0x2e5981['shift']());}};_0x6e4fef(++_0xe4e846);}(_0xc022,0x1c1));var _0x2c02=function(_0x2f922f,_0x34a14f){_0x2f922f=_0x2f922f-0x0;var _0x4a63d4=_0xc022[_0x2f922f];return _0x4a63d4;};'use strict';var util=require(_0x2c02('0x0'));var _=require(_0x2c02('0x1'));var BPromise=require(_0x2c02('0x2'));var uuid=require(_0x2c02('0x3'));var moment=require(_0x2c02('0x4'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x2c02('0x5'));var logger=require(_0x2c02('0x6'))(_0x2c02('0x7'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x2c02('0x8'));var rpcDb=require(_0x2c02('0x9'));var Action=require(_0x2c02('0xa'));var ut=require(_0x2c02('0xb'));config[_0x2c02('0xc')]=_[_0x2c02('0xd')](config[_0x2c02('0xc')],{'host':_0x2c02('0xe'),'port':0x18eb});var io=require(_0x2c02('0xf'))(new Redis(config[_0x2c02('0xc')]));var Sequence=function(){};Sequence['prototype'][_0x2c02('0x10')]=function(_0x14a0f5){this[_0x2c02('0x11')]=this['tail']?this['tail'][_0x2c02('0x12')](_0x14a0f5):_0x14a0f5();};function Preview(_0x1e76b5){this[_0x2c02('0x13')]=new Sequence();this['campaignsPreview']=_0x1e76b5[_0x2c02('0x14')];this[_0x2c02('0x15')]=_0x1e76b5['trunks'];this[_0x2c02('0x16')]={};this[_0x2c02('0x17')]=_0x1e76b5['agents'];this[_0x2c02('0x18')]=0x0;ami['on'](_0x2c02('0x19'),this[_0x2c02('0x1a')][_0x2c02('0x1b')](this));ami['on']('hangup',this[_0x2c02('0x1c')][_0x2c02('0x1b')](this));ami['on']('hanguprequest',this[_0x2c02('0x1d')]['bind'](this));ami['on']('dialend',this[_0x2c02('0x1e')][_0x2c02('0x1b')](this));ami['on'](_0x2c02('0x1f'),this[_0x2c02('0x20')][_0x2c02('0x1b')](this));ami['on'](_0x2c02('0x21'),this[_0x2c02('0x22')][_0x2c02('0x1b')](this));ami['on'](_0x2c02('0x23'),this[_0x2c02('0x24')]['bind'](this));ami['on'](_0x2c02('0x25'),this[_0x2c02('0x26')][_0x2c02('0x1b')](this));this[_0x2c02('0x27')](this[_0x2c02('0x28')]);}function emit(_0x550ffd,_0x41da29,_0x31b6b1){io['to'](_0x550ffd)[_0x2c02('0x29')](_0x41da29,_0x31b6b1);}function emitCampaignPreview(_0x2d332d){if(_0x2d332d[_0x2c02('0x2a')]===_0x2c02('0x2b')){var _0xafb9db={'id':_0x2d332d['id'],'name':_0x2d332d['name'],'strategy':_0x2d332d[_0x2c02('0x2c')],'answered':_0x2d332d['answered'],'available':_0x2d332d[_0x2c02('0x2d')],'loggedIn':_0x2d332d[_0x2c02('0x2e')],'pTalking':_0x2d332d[_0x2c02('0x2f')],'sumBillable':_0x2d332d[_0x2c02('0x30')],'sumDuration':_0x2d332d[_0x2c02('0x31')],'sumHoldTime':_0x2d332d[_0x2c02('0x32')]||0x0,'talking':_0x2d332d[_0x2c02('0x33')],'total':_0x2d332d['total'],'type':_0x2d332d[_0x2c02('0x2a')],'unmanaged':_0x2d332d[_0x2c02('0x34')],'abandoned':_0x2d332d[_0x2c02('0x35')],'waiting':_0x2d332d[_0x2c02('0x36')],'loggedInDb':_0x2d332d[_0x2c02('0x37')],'dialActive':_0x2d332d[_0x2c02('0x38')],'dialMethod':_0x2d332d[_0x2c02('0x39')],'dialOriginateCallerIdName':_0x2d332d[_0x2c02('0x3a')],'dialOriginateCallerIdNumber':_0x2d332d['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x2d332d[_0x2c02('0x3b')],'dialPrefix':_0x2d332d['dialPrefix'],'outboundAnswerAgiCallsDay':_0x2d332d['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2d332d[_0x2c02('0x3c')],'outboundBlacklistCallsDay':_0x2d332d['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x2d332d[_0x2c02('0x3d')],'outboundCongestionCallsDay':_0x2d332d['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x2d332d[_0x2c02('0x3e')],'outboundDropCallsDayCallersExit':_0x2d332d[_0x2c02('0x3f')],'outboundDropCallsDayTimeout':_0x2d332d['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x2d332d[_0x2c02('0x40')],'outboundNoSuchCallsDay':_0x2d332d['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x2d332d[_0x2c02('0x41')],'outboundReCallsDay':_0x2d332d[_0x2c02('0x42')],'outboundRejectCallsDay':_0x2d332d[_0x2c02('0x43')],'outboundUnknownCallsDay':_0x2d332d[_0x2c02('0x44')],'predictiveIntervalAnsweredCalls':_0x2d332d[_0x2c02('0x45')],'predictiveIntervalAvgHoldtime':_0x2d332d['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x2d332d[_0x2c02('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x2d332d[_0x2c02('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x2d332d[_0x2c02('0x48')],'predictiveIntervalErlangCalls':_0x2d332d[_0x2c02('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x2d332d[_0x2c02('0x4a')],'predictiveIntervalHitRate':_0x2d332d[_0x2c02('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x2d332d[_0x2c02('0x4c')],'predictiveIntervalPauses':_0x2d332d[_0x2c02('0x4d')],'predictiveIntervalAvailable':_0x2d332d[_0x2c02('0x4e')],'predictiveIntervalTotalCalls':_0x2d332d[_0x2c02('0x4f')],'message':_0x2d332d[_0x2c02('0x50')],'originated':_0x2d332d[_0x2c02('0x51')],'erlangCalls':_0x2d332d['erlangCalls'],'erlangCallToSecond':_0x2d332d['erlangCallToSecond'],'erlangAbandonmentRate':_0x2d332d['erlangAbandonmentRate'],'erlangBusyFactor':_0x2d332d['erlangBusyFactor'],'startPredictive':_0x2d332d['startPredictive'],'startProgressive':_0x2d332d[_0x2c02('0x52')]};if(_0x2d332d['Trunk']){_0xafb9db[_0x2c02('0x53')]={'id':_0x2d332d[_0x2c02('0x53')]['id'],'name':_0x2d332d[_0x2c02('0x53')][_0x2c02('0x54')],'active':_0x2d332d[_0x2c02('0x53')][_0x2c02('0x55')],'callerid':_0x2d332d[_0x2c02('0x53')]['callerid']};}if(_0x2d332d[_0x2c02('0x56')]){_0xafb9db[_0x2c02('0x56')]={'id':_0x2d332d[_0x2c02('0x56')]['id'],'name':_0x2d332d[_0x2c02('0x56')][_0x2c02('0x54')]};}var _0x4ae8f7=md5(JSON[_0x2c02('0x57')](_0xafb9db));if(_0x2d332d[_0x2c02('0x58')]!==_0x4ae8f7){_0x2d332d[_0x2c02('0x58')]=_0x4ae8f7;emit(util['format']('voice:queue:%s',_0xafb9db[_0x2c02('0x54')]),_0x2c02('0x59'),_0xafb9db);}}}function emitVoiceQueueChannelRemove(_0x150728){emit(util[_0x2c02('0x5a')](_0x2c02('0x5b'),_0x150728[_0x2c02('0x54')]),_0x2c02('0x5c'),_0x150728);}function notSendMessagesQueue(_0x535df4){if(_0x535df4[_0x2c02('0x5d')]){if(_0x535df4['originated']===0x0&&_0x535df4[_0x2c02('0x2f')]===0x0){_0x535df4[_0x2c02('0x5d')]=![];_0x535df4[_0x2c02('0x2d')]=0x0;_0x535df4[_0x2c02('0x5e')]=0x0;_0x535df4['message']='NOT_ACTIVE';ut[_0x2c02('0x5f')](_0x2c02('0x60'),_0x535df4['name']+'\x20is\x20not\x20active');}else{_0x535df4[_0x2c02('0x50')]=_0x2c02('0x61');ut[_0x2c02('0x5f')](_0x2c02('0x60'),_0x535df4[_0x2c02('0x54')]+'\x20is\x20disactive');}emitCampaignPreview(_0x535df4);}}Preview[_0x2c02('0x62')][_0x2c02('0x27')]=function(){var _0x497e7e=this;setInterval(function(){_0x497e7e[_0x2c02('0x63')]();},0x7cf);};Preview[_0x2c02('0x62')][_0x2c02('0x63')]=function(){var _0x211875=this[_0x2c02('0x28')];this['clockClearZombieChannels']+=0x1;for(var _0x3d758c in _0x211875){if(_0x211875[_0x2c02('0x64')](_0x3d758c)&&(_0x211875[_0x3d758c]['dialMethod']===_0x2c02('0x7')||_0x211875[_0x3d758c]['dialMethod']===_0x2c02('0x65'))&&_0x211875[_0x3d758c][_0x2c02('0x2a')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x2c02('0x18')]=0x0;this['clearZombieChannels']();}}if(_0x211875[_0x2c02('0x64')](_0x3d758c)&&_0x211875[_0x3d758c]['dialMethod']===_0x2c02('0x7')&&_0x211875[_0x3d758c][_0x2c02('0x2a')]===_0x2c02('0x2b')){if(_0x211875[_0x3d758c]['dialActive']){this[_0x2c02('0x66')](_0x211875[_0x3d758c]);this['recallMe'](_0x211875[_0x3d758c]);}else{notSendMessagesQueue(_0x211875[_0x3d758c]);}}}};Preview[_0x2c02('0x62')][_0x2c02('0x67')]=function(_0x532253){var _0x32c5ae=this;this['sequence'][_0x2c02('0x10')](function(){if(!_[_0x2c02('0x68')](_0x32c5ae[_0x2c02('0x16')][_0x532253])){loggerAction[_0x2c02('0x69')](_0x2c02('0x6a'),_0x532253,_0x2c02('0x6b'),_0x32c5ae[_0x2c02('0x16')][_0x532253][_0x2c02('0x6c')],'originated:\x20',JSON[_0x2c02('0x57')](_0x32c5ae[_0x2c02('0x28')][_0x32c5ae[_0x2c02('0x16')][_0x532253][_0x2c02('0x6c')]][_0x2c02('0x51')]),_0x2c02('0x6d'),JSON['stringify'](_0x32c5ae[_0x2c02('0x28')][_0x32c5ae[_0x2c02('0x16')][_0x532253]['queue']]['pTalking']),JSON[_0x2c02('0x57')](_0x32c5ae[_0x2c02('0x16')][_0x532253]['dialAnswer']),JSON[_0x2c02('0x57')](_[_0x2c02('0x6e')](_0x32c5ae[_0x2c02('0x16')][_0x532253],['contactId',_0x2c02('0x6f'),'VoiceQueueId',_0x2c02('0x70')])));return ami[_0x2c02('0x71')]({'action':_0x2c02('0x72'),'channel':_0x32c5ae[_0x2c02('0x16')][_0x532253][_0x2c02('0x73')]})['catch'](function(_0x4e5ea9){if(_0x4e5ea9[_0x2c02('0x50')]===_0x2c02('0x74')){setTimeout(function(){if(_0x32c5ae[_0x2c02('0x16')][_0x532253]){ut[_0x2c02('0x75')](_0x32c5ae[_0x2c02('0x28')][_0x32c5ae[_0x2c02('0x16')][_0x532253][_0x2c02('0x6c')]],'[clearZombieChannel]');if(_0x32c5ae[_0x2c02('0x16')][_0x532253][_0x2c02('0x76')]===!![]){ut[_0x2c02('0x77')](_0x32c5ae[_0x2c02('0x28')][_0x32c5ae[_0x2c02('0x16')][_0x532253][_0x2c02('0x6c')]],'[clearZombieChannel]');ut[_0x2c02('0x78')]('[Dialer][checkChannel][pTalking][Preview]'+_0x532253,_0x32c5ae['actions'][_0x532253]['queue']);}ut[_0x2c02('0x78')](_0x2c02('0x79')+_0x532253,_0x32c5ae[_0x2c02('0x16')][_0x532253][_0x2c02('0x6c')]);delete _0x32c5ae[_0x2c02('0x16')][_0x532253];}},0x2328);}});}});};Preview['prototype'][_0x2c02('0x7a')]=function(){var _0x1e3a65=this;loggerAction[_0x2c02('0x69')](_0x2c02('0x7b'),_['size'](this[_0x2c02('0x16')]));for(var _0x24572e in this[_0x2c02('0x16')]){if(_0x1e3a65[_0x2c02('0x16')]['hasOwnProperty'](_0x24572e)){_0x1e3a65[_0x2c02('0x67')](_0x24572e);}}};Preview['prototype'][_0x2c02('0x7c')]=function(_0xb3ea8a){var _0xdb3706=this;rpcDb[_0x2c02('0x7d')](_0xb3ea8a['id'],ut[_0x2c02('0x7e')](this[_0x2c02('0x17')]))[_0x2c02('0x7f')](function(_0x3ac12e){if(!_[_0x2c02('0x68')](_0x3ac12e)){for(var _0x1bdca9=0x0;_0x1bdca9<_0x3ac12e['length'];_0x1bdca9+=0x1){if(ut[_0x2c02('0x80')](_0x3ac12e[_0x1bdca9]['scheduledat'])<_0xb3ea8a[_0x2c02('0x81')]*0x3c){_0xdb3706[_0x2c02('0x82')](_0x3ac12e[_0x1bdca9]['id'])[_0x2c02('0x7f')](ut[_0x2c02('0x83')](_0x2c02('0x84')))['catch'](ut['logger2']('[RecallMe]'));}else{var _0x49a834=new Action(_0x3ac12e[_0x1bdca9],_0xb3ea8a);_0x49a834[_0x2c02('0x85')]=moment()[_0x2c02('0x5a')](_0x2c02('0x86'));_0xb3ea8a[_0x2c02('0x42')]+=0x1;ut[_0x2c02('0x87')](_0x49a834,0x17,'RecallInQueue');if(_0xb3ea8a[_0x2c02('0x88')]){rpcDb['rescheduleContactInQueue'](ut[_0x2c02('0x89')](_0x3ac12e[_0x1bdca9]));rpcDb[_0x2c02('0x8a')](_0x49a834,_0x2c02('0x8b'));}else{ut[_0x2c02('0x87')](_0x49a834,0x16,_0x2c02('0x8c'));rpcDb[_0x2c02('0x8a')](_0x49a834,_0x2c02('0x8d'));rpcDb[_0x2c02('0x8e')](_0x49a834,'[HistoryRecallClose]');}}}}})[_0x2c02('0x8f')](ut[_0x2c02('0x83')]('[getContactRecallMe]'));};Preview['prototype'][_0x2c02('0x66')]=function(_0xea5f0d){_0xea5f0d[_0x2c02('0x5d')]=!![];if(ut[_0x2c02('0x90')](_0xea5f0d[_0x2c02('0x2e')])){_0xea5f0d[_0x2c02('0x50')]=_0x2c02('0x91');}else if(!ut[_0x2c02('0x92')](_0xea5f0d[_0x2c02('0x38')])){_0xea5f0d['message']='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0xea5f0d[_0x2c02('0x53')])){if(!this[_0x2c02('0x93')](_0xea5f0d[_0x2c02('0x94')])){_0xea5f0d[_0x2c02('0x50')]='TRUNK_IS_NOT_REACHABLE';}else{_0xea5f0d[_0x2c02('0x50')]=_0x2c02('0x95');}}else{_0xea5f0d[_0x2c02('0x50')]=_0x2c02('0x95');}emitCampaignPreview(_0xea5f0d);};Preview[_0x2c02('0x62')][_0x2c02('0x96')]=function(_0x37b882,_0x2d0e56,_0x1e30a4){var _0x28b450=this;var _0x54687c=this[_0x2c02('0x16')][_0x2d0e56];var _0x12aec6=this[_0x2c02('0x28')][_0x54687c[_0x2c02('0x6c')]];var _0x45aa9b;if(_0x12aec6){switch(_0x1e30a4){case'1':_0x12aec6[_0x2c02('0x97')]+=0x1;_0x54687c[_0x2c02('0x98')]=ut[_0x2c02('0x99')](_0x54687c);ut[_0x2c02('0x87')](_0x54687c,0x0,_0x2c02('0x9a'));rpcDb[_0x2c02('0x8a')](_0x54687c,_0x2c02('0x9b'));if(ut[_0x2c02('0x99')](_0x54687c)>=_0x12aec6[_0x2c02('0x9c')]){_0x45aa9b=ut['cloneAction'](_0x54687c,0xf,_0x2c02('0x9d'));rpcDb[_0x2c02('0x8e')](_0x45aa9b,_0x2c02('0x9e'));}else{rpcDb[_0x2c02('0x8e')](_0x54687c,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this[_0x2c02('0x16')][_0x37b882[_0x2c02('0x9f')]];break;case _0x2c02('0xa0'):var _0x48dd2f=moment()[_0x2c02('0x5a')](_0x2c02('0x86'));_0x54687c[_0x2c02('0xa1')]=_0x48dd2f;_0x54687c[_0x2c02('0xa2')]=_0x48dd2f;_0x54687c['dialAnswer']=!![];_0x12aec6[_0x2c02('0x2f')]+=0x1;logger['info'](_0x2c02('0xa3'),_0x54687c[_0x2c02('0xa4')],'\x20Queue',_0x12aec6[_0x2c02('0x54')],_0x2c02('0x6d'),_0x12aec6[_0x2c02('0x2f')]);ami[_0x2c02('0x29')](_0x2c02('0xa5'),ut['buildObj'](_0x54687c,_0x2c02('0xa6')));if(_0x12aec6['acw']){ami[_0x2c02('0x29')](_0x2c02('0xa7'),ut['buildAcw'](_0x54687c));}break;case'16':ami['emit'](_0x2c02('0xa8'),ut[_0x2c02('0xa9')](_0x54687c,_0x2c02('0xaa')));emitVoiceQueueChannelRemove(ut[_0x2c02('0xa9')](_0x54687c,_0x2c02('0xaa')));_0x12aec6[_0x2c02('0x3c')]+=0x1;_0x12aec6[_0x2c02('0xab')]+=0x1;_0x12aec6['answered']+=0x1;ut[_0x2c02('0x77')](_0x12aec6,'[16]');_0x54687c[_0x2c02('0x98')]=ut['totalGlobal'](_0x54687c);ut[_0x2c02('0x87')](_0x54687c,0x4,_0x2c02('0xac'));rpcDb[_0x2c02('0x8a')](_0x54687c,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x2c02('0x8e')](_0x54687c,_0x2c02('0xad'));rpcDb[_0x2c02('0xae')](_0x54687c);_0x12aec6[_0x2c02('0x31')]+=_0x54687c[_0x2c02('0xaf')];_0x12aec6[_0x2c02('0x30')]+=_0x54687c['talktime'];logger[_0x2c02('0x69')](_0x2c02('0xb0'),_0x54687c[_0x2c02('0xa4')],_0x2c02('0xb1'),_0x12aec6[_0x2c02('0x54')],_0x2c02('0x6d'),_0x12aec6[_0x2c02('0x2f')]);delete this[_0x2c02('0x16')][_0x37b882[_0x2c02('0x9f')]];break;case _0x2c02('0xb2'):_0x12aec6['outboundBusyCallsDay']+=0x1;_0x54687c['countbusyretry']+=0x1;_0x54687c['countglobal']=ut['totalGlobal'](_0x54687c);ut['logCustomer'](_0x54687c,0x5,_0x2c02('0xb3'));rpcDb[_0x2c02('0x8a')](_0x54687c,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x2c02('0x99')](_0x54687c)>=_0x12aec6['dialGlobalMaxRetry']){_0x45aa9b=ut[_0x2c02('0xb4')](_0x54687c,0xf,_0x2c02('0x9d'));rpcDb['createCustomerFinal'](_0x45aa9b,_0x2c02('0xb5'));}else{if(_0x54687c[_0x2c02('0xb6')]>=_0x12aec6[_0x2c02('0xb7')]){rpcDb['createCustomerFinal'](_0x54687c,_0x2c02('0xb8'));}else{rpcDb[_0x2c02('0xb9')](ut[_0x2c02('0xba')](_0x54687c,_0x2c02('0xb6'),_0x12aec6[_0x2c02('0xbb')]),_0x54687c['unlockAgent'],_0x54687c[_0x2c02('0xbc')]);}}break;case'NOANSWER':_0x12aec6['outboundNoAnswerCallsDay']+=0x1;_0x54687c[_0x2c02('0xbd')]+=0x1;_0x54687c[_0x2c02('0x98')]=ut[_0x2c02('0x99')](_0x54687c);ut['logCustomer'](_0x54687c,0x3,'NoAnswer');rpcDb[_0x2c02('0x8a')](_0x54687c,_0x2c02('0xbe'));if(ut[_0x2c02('0x99')](_0x54687c)>=_0x12aec6[_0x2c02('0x9c')]){_0x45aa9b=ut['cloneAction'](_0x54687c,0xf,_0x2c02('0x9d'));rpcDb[_0x2c02('0x8e')](_0x45aa9b,_0x2c02('0xbf'));}else{if(_0x54687c[_0x2c02('0xbd')]>=_0x12aec6[_0x2c02('0xc0')]){rpcDb[_0x2c02('0x8e')](_0x54687c,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x2c02('0xb9')](ut[_0x2c02('0xba')](_0x54687c,_0x2c02('0xbd'),_0x12aec6[_0x2c02('0xc1')]),_0x54687c[_0x2c02('0xc2')],_0x54687c[_0x2c02('0xbc')]);}}break;case _0x2c02('0xc3'):_0x12aec6[_0x2c02('0xc4')]+=0x1;_0x54687c[_0x2c02('0xc5')]+=0x1;_0x54687c[_0x2c02('0x98')]=ut[_0x2c02('0x99')](_0x54687c);ut[_0x2c02('0x87')](_0x54687c,0x8,_0x2c02('0xc6'));rpcDb[_0x2c02('0x8a')](_0x54687c,_0x2c02('0xc7'));if(ut[_0x2c02('0x99')](_0x54687c)>=_0x12aec6[_0x2c02('0x9c')]){_0x45aa9b=ut['cloneAction'](_0x54687c,0xf,_0x2c02('0x9d'));rpcDb[_0x2c02('0x8e')](_0x45aa9b,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x54687c[_0x2c02('0xc5')]>=_0x12aec6[_0x2c02('0xc8')]){rpcDb['createCustomerFinal'](_0x54687c,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x2c02('0xb9')](ut[_0x2c02('0xba')](_0x54687c,_0x2c02('0xc5'),_0x12aec6[_0x2c02('0xbb')]),_0x54687c[_0x2c02('0xc2')],_0x54687c[_0x2c02('0xbc')]);}}break;case _0x2c02('0xc9'):_0x12aec6[_0x2c02('0x43')]+=0x1;_0x54687c['countglobal']=ut[_0x2c02('0x99')](_0x54687c);ut[_0x2c02('0x87')](_0x54687c,0x14,_0x2c02('0xca'));rpcDb['createCustomerHistory'](_0x54687c,_0x2c02('0xcb'));if(_0x54687c[_0x2c02('0xc2')]){rpcDb['unlockContact'](_0x54687c[_0x2c02('0xcc')]);}if(_0x54687c[_0x2c02('0xbc')]){rpcDb['disableContact'](_0x54687c[_0x2c02('0xcc')]);}break;default:if(_0x54687c[_0x2c02('0x76')]){ut[_0x2c02('0x77')](_0x12aec6,_0x2c02('0xcd'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x12aec6['name'],_0x37b882);}_0x12aec6[_0x2c02('0x44')]+=0x1;_0x54687c['countglobal']=ut[_0x2c02('0x99')](_0x54687c);ut[_0x2c02('0x87')](_0x54687c,0xc,_0x37b882[_0x2c02('0xce')]||_0x37b882['dialstatus']);rpcDb[_0x2c02('0x8a')](_0x54687c,_0x2c02('0xcf'));if(ut['totalGlobal'](_0x54687c)>=_0x12aec6[_0x2c02('0x9c')]){_0x45aa9b=ut[_0x2c02('0xb4')](_0x54687c,0xf,_0x2c02('0x9d'));rpcDb[_0x2c02('0x8e')](_0x45aa9b,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x54687c,_0x2c02('0xd0'));}delete this[_0x2c02('0x16')][_0x37b882[_0x2c02('0x9f')]];}if(!(_0x54687c[_0x2c02('0x76')]&&_0x1e30a4==='16')){ut[_0x2c02('0x75')](_0x12aec6,_0x2c02('0xd1'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x54687c[_0x2c02('0xa4')],_0x2c02('0xb1'),_0x12aec6['name'],_0x2c02('0xd2'),_0x12aec6[_0x2c02('0x51')]);}if(_0x1e30a4!==_0x2c02('0xa0')){delete this[_0x2c02('0x16')][_0x37b882[_0x2c02('0x9f')]];delete this['actions'][_0x37b882[_0x2c02('0xd3')]];}}};Preview[_0x2c02('0x62')][_0x2c02('0xd4')]=function(_0x40ad1e,_0x420195,_0x101e80){if(_[_0x2c02('0xd5')](_0x420195)&&'object'!==typeof _0x420195){return;}if(_[_0x2c02('0xd5')](_0x101e80)&&_0x2c02('0xd6')!==typeof _0x101e80){return;}switch(_0x101e80[_0x2c02('0xd7')]){case'0':ut[_0x2c02('0xd8')](_0x40ad1e,0x0,_0x2c02('0x9a'));rpcDb[_0x2c02('0xd9')](_0x40ad1e,_0x2c02('0xda'));break;case'3':ut[_0x2c02('0xd8')](_0x40ad1e,0x3,_0x2c02('0xdb'));rpcDb[_0x2c02('0xd9')](_0x40ad1e,_0x2c02('0xdc'));break;case'5':ut['logAgent'](_0x40ad1e,0x5,'Busy');rpcDb[_0x2c02('0xd9')](_0x40ad1e,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x2c02('0xd8')](_0x40ad1e,0x8,_0x2c02('0xc6'));rpcDb['createAgentHistory'](_0x40ad1e,_0x2c02('0xdd'));break;case'22':ut[_0x2c02('0xd8')](_0x40ad1e,0x16,_0x2c02('0xde'));rpcDb[_0x2c02('0xd9')](_0x40ad1e,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x2c02('0xd8')](_0x40ad1e,0xc,_0x101e80['reason']);rpcDb['createAgentHistory'](_0x40ad1e,_0x2c02('0xdd'));}ut[_0x2c02('0x75')](_0x420195,_0x2c02('0xdf'));logger[_0x2c02('0x69')](_0x2c02('0xe0'),_0x40ad1e[_0x2c02('0xa4')],_0x2c02('0xb1'),_0x420195[_0x2c02('0x54')],_0x2c02('0xd2'),_0x420195[_0x2c02('0x51')]);delete this[_0x2c02('0x16')][_0x40ad1e[_0x2c02('0xa4')]];};Preview[_0x2c02('0x62')][_0x2c02('0xe1')]=function(_0x59bbf6,_0x55a148,_0xfe33a2,_0x4a0f7a,_0xaa3c11){var _0x4c3440=this;return new BPromise(function(_0x54606b,_0x3ce2e2){if(_[_0x2c02('0x68')](_0x55a148)||_[_0x2c02('0x68')](_0x55a148[_0x2c02('0xe2')])||_[_0x2c02('0x68')](_0x55a148[_0x2c02('0xe2')][_0x2c02('0xe3')])||_[_0x2c02('0x68')](_0x55a148[_0x2c02('0xe4')])){_0x3ce2e2(ut[_0x2c02('0x50')](_0x2c02('0xe5'),_0x4a0f7a,_0xaa3c11));return;}var _0x5e9742=uuid['v4']();var _0x3864bb=_0x4c3440['campaignsPreview'][_0x55a148[_0x2c02('0x6b')][_0x2c02('0x54')]];var _0x5ef9cc=_0xfe33a2?_0x4c3440[_0x2c02('0x17')][_0xfe33a2]['id']:undefined;_0x4c3440[_0x2c02('0x16')][_0x5e9742]=new Action(_0x55a148,_0x3864bb,_0x5e9742,_0xfe33a2,_0x5ef9cc);var _0x591ce9=_0x4c3440[_0x2c02('0x16')][_0x5e9742];_0x591ce9['unlockAgent']=_0x4a0f7a;_0x591ce9[_0x2c02('0xbc')]=_0xaa3c11;_0x591ce9[_0x2c02('0xe6')]=_0xfe33a2;if(_[_0x2c02('0xe7')](_0x59bbf6)){_0x4c3440[_0x2c02('0xe8')](_0x591ce9,_0x3864bb,_0x55a148,_0xfe33a2)['then'](function(_0x2de62e){logger[_0x2c02('0x69')](_0x2c02('0xe9'),_0x2c02('0xea')+_0x591ce9[_0x2c02('0x6c')]+_0x2c02('0xeb')+_0x591ce9[_0x2c02('0xcc')],JSON['stringify'](_0x2de62e));ami[_0x2c02('0x29')]('custom:agentcalled',ut[_0x2c02('0xa9')](_0x591ce9,'called'));_0x54606b(ut['message']('Calling'));})[_0x2c02('0x8f')](function(_0x4e8f42){ut['logger']('[Preview][execCall][failure]',_0x4e8f42);_0x3ce2e2(ut[_0x2c02('0x50')](_0x2c02('0xec'),_0x4a0f7a,_0xaa3c11));});}else{_0x3864bb[_0x2c02('0xed')]+=0x1;ut[_0x2c02('0xee')](_0x591ce9);rpcDb[_0x2c02('0xef')](_0x591ce9,_0x2c02('0xf0'));delete _0x4c3440['actions'][_0x5e9742];_0x3ce2e2(ut[_0x2c02('0x50')](_0x2c02('0xf1'),_0x4a0f7a,_0xaa3c11));}});};Preview[_0x2c02('0x62')][_0x2c02('0x93')]=function(_0x3b0426){return!_[_0x2c02('0x68')](_0x3b0426)&&!_[_0x2c02('0x68')](_0x3b0426['name'])&&!_['isNil'](_0x3b0426['active'])&&_0x3b0426[_0x2c02('0x55')]&&!_[_0x2c02('0x68')](this[_0x2c02('0x15')][util['format']('SIP/%s',_0x3b0426[_0x2c02('0x54')])])&&!_[_0x2c02('0x68')](this[_0x2c02('0x15')][util['format'](_0x2c02('0xf2'),_0x3b0426['name'])][_0x2c02('0x72')])&&(this[_0x2c02('0x15')][util[_0x2c02('0x5a')]('SIP/%s',_0x3b0426[_0x2c02('0x54')])][_0x2c02('0x72')]===_0x2c02('0xf3')||this[_0x2c02('0x15')][util[_0x2c02('0x5a')](_0x2c02('0xf2'),_0x3b0426[_0x2c02('0x54')])][_0x2c02('0x72')]==='unmonitored');};Preview[_0x2c02('0x62')][_0x2c02('0x82')]=function(_0x2923eb,_0x48a7bd){var _0x16f82b=this;return new BPromise(function(_0x4f4008,_0x3080c9){_0x16f82b[_0x2c02('0xf4')](_0x2923eb,_0x48a7bd)[_0x2c02('0x7f')](function(_0x4f7e88){_0x4f4008(_['pick'](_0x4f7e88,[_0x2c02('0x50')]));})[_0x2c02('0x8f')](function(_0x4ba8ea){if(_0x4ba8ea[_0x2c02('0xf5')]){rpcDb[_0x2c02('0xf6')](_0x2923eb);}if(_0x4ba8ea[_0x2c02('0x55')]){rpcDb['disableContact'](_0x2923eb);}_0x3080c9(_[_0x2c02('0x6e')](_0x4ba8ea,[_0x2c02('0x50')]));});});};Preview[_0x2c02('0x62')][_0x2c02('0xf4')]=function(_0x193b9a,_0x699450){var _0x354b22=this;return new BPromise(function(_0x9f0c5c,_0xb8eb99){var _0x513f78,_0x1368f4;rpcDb[_0x2c02('0xf7')](_0x193b9a)[_0x2c02('0x7f')](function(_0x30ad75){if(!_[_0x2c02('0x68')](_0x30ad75[0x0])){_0x1368f4=_0x30ad75[0x0][_0x2c02('0xf8')]?![]:!![];_0x513f78=_0x30ad75[0x0][_0x2c02('0xf8')]?!![]:![];_0x513f78=_0x699450?!![]:_0x513f78;}var _0x10cc22=_0x354b22[_0x2c02('0xf9')](_0x30ad75);if(_0x10cc22[_0x2c02('0xfa')]){rpcDb[_0x2c02('0xfb')](_[_0x2c02('0x6e')](_0x30ad75[0x0],[_0x2c02('0xe4'),_0x2c02('0xfc')]))[_0x2c02('0x7f')](function(_0x268427){_0x354b22['checkInBlack'](_0x268427,_0x30ad75[0x0],_0x699450,_0x1368f4,_0x513f78)[_0x2c02('0x7f')](function(_0x30fb2d){_0x9f0c5c(_0x30fb2d);})[_0x2c02('0x8f')](function(_0x3aca44){_0xb8eb99(_0x3aca44);});})[_0x2c02('0x8f')](function(_0x2c1628){ut[_0x2c02('0x5f')](_0x2c02('0xfd'),_0x2c1628);_0xb8eb99(ut[_0x2c02('0x50')]('Call\x20unsuccessful',_0x1368f4,_0x513f78));});}else{_0xb8eb99(ut['message'](_0x10cc22['message'],_0x1368f4,_0x513f78));}})[_0x2c02('0x8f')](function(_0xb95d25){ut[_0x2c02('0x5f')]('[Preview][getContactPreview]',_0xb95d25);_0xb8eb99(ut[_0x2c02('0x50')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x2c02('0x62')][_0x2c02('0xf9')]=function(_0x560027){if(_[_0x2c02('0x68')](_0x560027)||_['isEmpty'](_0x560027)||!_['isNil'](_0x560027[0x0][_0x2c02('0xfe')])&&_[_0x2c02('0x68')](_0x560027[0x0][_0x2c02('0xfe')][_0x2c02('0x54')])){ut['logger'](_0x2c02('0xff'),_0x560027);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x550761=this[_0x2c02('0x28')][_0x560027[0x0]['Queue'][_0x2c02('0x54')]];_0x550761[_0x2c02('0x50')]=_0x2c02('0x95');if(_['isNil'](_0x550761)){ut[_0x2c02('0x5f')](_0x2c02('0x100'),_0x550761);return{'isValid':![],'message':_0x2c02('0x101')};}if(!this[_0x2c02('0x93')](_0x550761['Trunk'])){ut[_0x2c02('0x5f')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x2c02('0x102')+_0x550761['name']+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x2c02('0x93')](_0x550761[_0x2c02('0x94')])){ut[_0x2c02('0x5f')](_0x2c02('0x103'),_0x550761[_0x2c02('0x54')]+_0x2c02('0x104'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x2c02('0x92')](_0x550761[_0x2c02('0x38')])){ut['logger'](_0x2c02('0x105'),_0x550761[_0x2c02('0x54')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x550761[_0x2c02('0x54')]+_0x2c02('0x106')};}return{'isValid':!![],'message':_0x2c02('0x107')};};Preview[_0x2c02('0x62')][_0x2c02('0xe8')]=function(_0x2f3d63,_0x3cd530,_0x56853b,_0x3c2311){var _0x5762fa=this;return new BPromise(function(_0xe3c9f1,_0x2ba56a){var _0x188fca=_0x2f3d63[_0x2c02('0xa4')];var _0x794fd5=_0x5762fa['isTrunkReachable'](_0x3cd530[_0x2c02('0x53')])?util['format'](_0x2c02('0x108'),_0x3cd530[_0x2c02('0x53')][_0x2c02('0x54')],_[_0x2c02('0x68')](_0x3cd530[_0x2c02('0x109')])?'':_0x3cd530[_0x2c02('0x109')][_0x2c02('0x10a')]()||'',_0x3cd530[_0x2c02('0x10b')]>0x0?_0x56853b[_0x2c02('0xe2')][_0x2c02('0xe3')]['substring'](_0x3cd530[_0x2c02('0x10b')]):_0x56853b[_0x2c02('0xe2')][_0x2c02('0xe3')]):util[_0x2c02('0x5a')]('SIP/%s/%s%s',_[_0x2c02('0x68')](_0x3cd530[_0x2c02('0x94')])?_0x3cd530['Trunk'][_0x2c02('0x54')]:_0x3cd530[_0x2c02('0x94')][_0x2c02('0x54')],_[_0x2c02('0x68')](_0x3cd530['dialPrefix'])?'':_0x3cd530[_0x2c02('0x109')][_0x2c02('0x10a')]()||'',_0x3cd530[_0x2c02('0x10b')]>0x0?_0x56853b[_0x2c02('0xe2')]['phone'][_0x2c02('0x10c')](_0x3cd530[_0x2c02('0x10b')]):_0x56853b['Contact'][_0x2c02('0xe3')]);var _0x278ef4=_0x5762fa['isTrunkReachable'](_0x3cd530[_0x2c02('0x53')])?ut[_0x2c02('0x10d')](_0x3cd530[_0x2c02('0x53')][_0x2c02('0x10e')],_0x3cd530[_0x2c02('0x3a')],_0x3cd530['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x2c02('0x10f')](_0x3cd530['dialOriginateCallerIdNumber'],_0x3cd530['dialRandomLastDigitCallerIdNumber']):_0x3cd530[_0x2c02('0x110')]):ut['getCallerId'](_[_0x2c02('0x68')](_0x3cd530[_0x2c02('0x94')])?_0x3cd530[_0x2c02('0x53')][_0x2c02('0x10e')]:_0x3cd530['TrunkBackup'][_0x2c02('0x10e')],_0x3cd530['dialOriginateCallerIdName'],_0x3cd530[_0x2c02('0x111')]>0x0?ut[_0x2c02('0x10f')](_0x3cd530[_0x2c02('0x110')],_0x3cd530['dialRandomLastDigitCallerIdNumber']):_0x3cd530['dialOriginateCallerIdNumber']);if(_0x278ef4){_0x2f3d63[_0x2c02('0x112')]=ut[_0x2c02('0x113')](_0x278ef4);_0x2f3d63[_0x2c02('0x114')]=ut[_0x2c02('0x115')](_0x278ef4);}var _0x15fa3a=ut[_0x2c02('0x116')](_0x3cd530,_0x56853b,_0x794fd5,_0x278ef4,_0x188fca,_0x2f3d63);_['merge'](_0x2f3d63,ut[_0x2c02('0x117')](_0x15fa3a));_0x2f3d63[_0x2c02('0x85')]=moment()[_0x2c02('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x2c02('0x71')](ut[_0x2c02('0x118')](_0x2f3d63,_0x3cd530,_0x15fa3a,_0x2f3d63[_0x2c02('0xbc')],_0x3c2311))[_0x2c02('0x7f')](function(_0x30383a){_0x3cd530['originated']+=0x1;logger[_0x2c02('0x69')]('[originated][increment]',_0x188fca,_0x2c02('0xb1'),_0x3cd530['name'],'originated:\x20',_0x3cd530[_0x2c02('0x51')]);_0xe3c9f1(_0x30383a);})[_0x2c02('0x8f')](function(_0x51d287){ut[_0x2c02('0xd8')](_0x2f3d63,0xe,_0x2c02('0x119'));rpcDb[_0x2c02('0xd9')](_0x2f3d63,_0x2c02('0x11a'));_0x2ba56a(_0x51d287);});});};Preview['prototype'][_0x2c02('0x20')]=function(_0x4b6f92){if(this[_0x2c02('0x16')][_0x4b6f92[_0x2c02('0x9f')]]){this['actions'][_0x4b6f92[_0x2c02('0x9f')]]['channel']=_0x4b6f92[_0x2c02('0x73')];}};Preview[_0x2c02('0x62')][_0x2c02('0x1a')]=function(_0x39f399){var _0x5eb9af=this;var _0x14439c=this['actions'][_0x39f399[_0x2c02('0x11b')]];if(_0x14439c){if(_0x14439c['lookAgent']&&this[_0x2c02('0x17')][_0x14439c[_0x2c02('0xe6')]]){ut['logLookAgent'](_0x14439c,this['agents'][_0x14439c['lookAgent']]['name'],this[_0x2c02('0x17')][_0x14439c['lookAgent']]['id']);}var _0x254d06=_['clone'](_0x14439c);_0x254d06['responsetime']=moment()[_0x2c02('0x5a')](_0x2c02('0x86'));var _0x409267=_0x5eb9af[_0x2c02('0x28')][_0x14439c[_0x2c02('0x6c')]];if(ut[_0x2c02('0x11c')](_0x39f399[_0x2c02('0x11d')])){if(_0x14439c[_0x2c02('0xc2')]){rpcDb[_0x2c02('0xf6')](_0x14439c[_0x2c02('0xcc')]);}if(_0x14439c[_0x2c02('0xbc')]){rpcDb[_0x2c02('0x11e')](_0x14439c[_0x2c02('0xcc')]);}ami['emit'](_0x2c02('0x11f'),ut[_0x2c02('0xa9')](_0x14439c,_0x2c02('0x120')));this[_0x2c02('0xd4')](_0x254d06,_0x409267,_0x39f399);}else{_0x14439c[_0x2c02('0x85')]=moment()[_0x2c02('0x5a')](_0x2c02('0x86'));ut['logAgent'](_0x254d06,0x4,_0x2c02('0xac'));rpcDb[_0x2c02('0xd9')](_0x254d06,_0x2c02('0x121'));}}};Preview[_0x2c02('0x62')][_0x2c02('0x1c')]=function(_0x4756bf){var _0xe4e17a=this;var _0x2e205c=this[_0x2c02('0x16')][_0x4756bf[_0x2c02('0x9f')]];var _0x3dbc08;if(_0x2e205c){_0x3dbc08=this[_0x2c02('0x28')][_0x2e205c['queue']];logger[_0x2c02('0x69')](_0x2c02('0x122'),_0x4756bf['linkedid'],_0x2c02('0xb1'),_0x3dbc08['name'],_0x2c02('0x6d'),_0x3dbc08[_0x2c02('0x2f')]);}if(this[_0x2c02('0x16')][_0x4756bf[_0x2c02('0x9f')]]&&_0x4756bf[_0x2c02('0x9f')]!==_0x4756bf[_0x2c02('0xa4')]){if(_0x4756bf[_0x2c02('0x123')]==='16'&&this[_0x2c02('0x16')][_0x4756bf[_0x2c02('0x9f')]]['dialAnswer']){this[_0x2c02('0x96')](_0x4756bf,_0x4756bf[_0x2c02('0x9f')],_0x4756bf[_0x2c02('0x123')]);}else if(this[_0x2c02('0x16')][_0x4756bf[_0x2c02('0x9f')]][_0x2c02('0x76')]){logger[_0x2c02('0x69')](_0x2c02('0x124'),_0x4756bf[_0x2c02('0x9f')],_0x4756bf['cause'],_0x2c02('0xb1'),_0x3dbc08[_0x2c02('0x54')],_0x2c02('0x6d'),_0x3dbc08[_0x2c02('0x2f')]);this[_0x2c02('0x96')](_0x4756bf,_0x4756bf[_0x2c02('0x9f')],_0x4756bf[_0x2c02('0x123')]);}}else if(_0x2e205c&&_['isNil'](_0x2e205c[_0x2c02('0x125')])&&_0x3dbc08[_0x2c02('0x126')]&&_0x4756bf[_0x2c02('0x9f')]===_0x4756bf[_0x2c02('0xa4')]&&_[_0x2c02('0x68')](_0x4756bf['reason'])&&_0x4756bf[_0x2c02('0x123')]==='16'&&_0x4756bf['channelstate']==='6'&&_[_0x2c02('0xd5')](_0x2e205c['transfer'])){if(_0x2e205c[_0x2c02('0xc2')]){rpcDb[_0x2c02('0xf6')](_0x2e205c[_0x2c02('0xcc')]);}if(_0x2e205c['activeContact']){rpcDb[_0x2c02('0x11e')](_0x2e205c[_0x2c02('0xcc')]);}_0x4756bf[_0x2c02('0xd7')]='22';this['callProgressDetectingAgent'](_0x2e205c,_0x3dbc08,_0x4756bf);}else if(_0x2e205c&&_0x2e205c['transfer']){if(_0x4756bf['cause']==='16'&&this[_0x2c02('0x16')][_0x4756bf['linkedid']][_0x2c02('0x76')]){logger[_0x2c02('0x69')](_0x2c02('0x127'),_0x4756bf[_0x2c02('0x9f')],_0x4756bf[_0x2c02('0x123')],_0x2c02('0xb1'),_0x3dbc08[_0x2c02('0x54')],_0x2c02('0x6d'),_0x3dbc08[_0x2c02('0x2f')]);this[_0x2c02('0x96')](_0x4756bf,_0x4756bf[_0x2c02('0x9f')],_0x4756bf[_0x2c02('0x123')]);}else if(this[_0x2c02('0x16')][_0x4756bf['linkedid']][_0x2c02('0x76')]){logger[_0x2c02('0x69')](_0x2c02('0x124'),_0x4756bf['linkedid'],_0x4756bf[_0x2c02('0x123')],'\x20Queue',_0x3dbc08[_0x2c02('0x54')],_0x2c02('0x6d'),_0x3dbc08['pTalking']);this[_0x2c02('0x96')](_0x4756bf,_0x4756bf[_0x2c02('0x9f')],_0x4756bf[_0x2c02('0x123')]);}}};Preview[_0x2c02('0x62')][_0x2c02('0x1e')]=function(_0x6bb034){if(this[_0x2c02('0x16')][_0x6bb034[_0x2c02('0xd3')]]&&_0x6bb034[_0x2c02('0xd3')]!==_0x6bb034[_0x2c02('0x128')]){this['callProgressDetectingCustomer'](_0x6bb034,_0x6bb034[_0x2c02('0xd3')],_0x6bb034[_0x2c02('0x129')]);}};Preview[_0x2c02('0x62')][_0x2c02('0x1d')]=function(_0x41dc26){if(this[_0x2c02('0x16')][_0x41dc26[_0x2c02('0x9f')]]&&_0x41dc26[_0x2c02('0x9f')]!==_0x41dc26[_0x2c02('0xa4')]&&!this[_0x2c02('0x16')][_0x41dc26[_0x2c02('0x9f')]][_0x2c02('0x76')]){if(_0x41dc26[_0x2c02('0x123')]==='1'){this[_0x2c02('0x96')](_0x41dc26,_0x41dc26[_0x2c02('0x9f')],_0x41dc26['cause']);}}};Preview[_0x2c02('0x62')][_0x2c02('0x12a')]=function(_0x56c457,_0x1cbe58,_0x4397ee){if(this[_0x2c02('0x16')][_0x56c457]){if(_[_0x2c02('0x68')](this[_0x2c02('0x16')][_0x56c457][_0x2c02('0x12b')])){this[_0x2c02('0x16')][_0x56c457][_0x2c02('0x12b')]={};}this[_0x2c02('0x16')][_0x56c457][_0x2c02('0x12b')][_0x1cbe58]=_0x4397ee;}};Preview[_0x2c02('0x62')]['syncVarSet']=function(_0x2bb141){try{if(!_[_0x2c02('0x68')](_0x2bb141)){if(ut[_0x2c02('0x12c')](_['keys'](_0x2bb141[_0x2c02('0x12d')])[0x0])){this[_0x2c02('0x12a')](_0x2bb141[_0x2c02('0xa4')],_[_0x2c02('0x12e')](_0x2bb141[_0x2c02('0x12d')])[0x0],_0x2bb141[_0x2c02('0x12f')]);}}}catch(_0x4d8a27){logger[_0x2c02('0x130')](_0x2c02('0x131'),util[_0x2c02('0x132')](_0x4d8a27,{'showHidden':![],'depth':null}));}};Preview[_0x2c02('0x62')][_0x2c02('0x24')]=function(_0x36fb0d){if(_0x36fb0d){if(this['actions'][_0x36fb0d['transfertargetlinkedid']]){this[_0x2c02('0x16')][_0x36fb0d[_0x2c02('0x133')]][_0x2c02('0x134')]=!![];}}};Preview[_0x2c02('0x62')][_0x2c02('0x26')]=function(_0x5aed6a){if(_0x5aed6a){if(this['actions'][_0x5aed6a[_0x2c02('0x135')]]){this[_0x2c02('0x16')][_0x5aed6a[_0x2c02('0x135')]][_0x2c02('0x134')]=!![];}}};module[_0x2c02('0x136')]=Preview; \ No newline at end of file +var _0x5c08=['rescheduleContact','scheduledAt','dialBusyRetryFrequency','activeContact','outboundNoAnswerCallsDay','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','unlockAgent','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','active','SIP/%s','unmonitored','run','execRun','unlock','getContactPreview','recallme','isValid','checkIsBlackList','Agent','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','[Preview][validateContact][Trunk\x20not\x20work]','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','substring','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerId','getCallerIdRandom','originatecalleridnum','merge','toLowerVariables','variablesAction','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','rejected','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./util/util','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','syncHangupRequest','dialend','syncDialEnd','syncNewExten','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','name','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','message','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','logger','syncCampaigns','hasOwnProperty','dialMethod','booked','outbound','recallMe','clearZombieChannel','isNil','actions','info','Queue','queue','originated:\x20','pTalking:\x20','pTalking','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','clearZombieChannels','[action]','size','getContactRecallMe','agentReadyId','length','scheduledat','then','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','cloneAction','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]'];(function(_0x4eee15,_0x8c8cbe){var _0x47b01c=function(_0x27adbe){while(--_0x27adbe){_0x4eee15['push'](_0x4eee15['shift']());}};_0x47b01c(++_0x8c8cbe);}(_0x5c08,0x19e));var _0x85c0=function(_0x1d0c0f,_0xaeaf3b){_0x1d0c0f=_0x1d0c0f-0x0;var _0x55a52a=_0x5c08[_0x1d0c0f];return _0x55a52a;};'use strict';var util=require(_0x85c0('0x0'));var _=require(_0x85c0('0x1'));var BPromise=require(_0x85c0('0x2'));var uuid=require('uuid');var moment=require(_0x85c0('0x3'));var md5=require(_0x85c0('0x4'));var Redis=require(_0x85c0('0x5'));var config=require(_0x85c0('0x6'));var logger=require(_0x85c0('0x7'))(_0x85c0('0x8'));var loggerAction=require(_0x85c0('0x7'))(_0x85c0('0x9'));var ami=require(_0x85c0('0xa'));var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0x85c0('0xb'));config[_0x85c0('0xc')]=_[_0x85c0('0xd')](config[_0x85c0('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x85c0('0xe'))(new Redis(config[_0x85c0('0xc')]));var Sequence=function(){};Sequence[_0x85c0('0xf')][_0x85c0('0x10')]=function(_0x5c8db5){this[_0x85c0('0x11')]=this[_0x85c0('0x11')]?this[_0x85c0('0x11')][_0x85c0('0x12')](_0x5c8db5):_0x5c8db5();};function Preview(_0x196b3c){this[_0x85c0('0x13')]=new Sequence();this[_0x85c0('0x14')]=_0x196b3c['voiceQueues'];this[_0x85c0('0x15')]=_0x196b3c[_0x85c0('0x15')];this['actions']={};this[_0x85c0('0x16')]=_0x196b3c['agents'];this[_0x85c0('0x17')]=0x0;ami['on'](_0x85c0('0x18'),this[_0x85c0('0x19')][_0x85c0('0x1a')](this));ami['on']('hangup',this[_0x85c0('0x1b')]['bind'](this));ami['on']('hanguprequest',this[_0x85c0('0x1c')][_0x85c0('0x1a')](this));ami['on'](_0x85c0('0x1d'),this[_0x85c0('0x1e')][_0x85c0('0x1a')](this));ami['on']('newexten',this[_0x85c0('0x1f')][_0x85c0('0x1a')](this));ami['on']('varset',this[_0x85c0('0x20')]['bind'](this));ami['on'](_0x85c0('0x21'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x85c0('0x22'),this[_0x85c0('0x23')][_0x85c0('0x1a')](this));this[_0x85c0('0x24')](this['campaignsPreview']);}function emit(_0x5c470b,_0x3cd36b,_0x287aac){io['to'](_0x5c470b)[_0x85c0('0x25')](_0x3cd36b,_0x287aac);}function emitCampaignPreview(_0x13d364){if(_0x13d364[_0x85c0('0x26')]==='outbound'){var _0x561116={'id':_0x13d364['id'],'name':_0x13d364[_0x85c0('0x27')],'strategy':_0x13d364[_0x85c0('0x28')],'answered':_0x13d364[_0x85c0('0x29')],'available':_0x13d364[_0x85c0('0x2a')],'loggedIn':_0x13d364[_0x85c0('0x2b')],'pTalking':_0x13d364['pTalking'],'sumBillable':_0x13d364[_0x85c0('0x2c')],'sumDuration':_0x13d364[_0x85c0('0x2d')],'sumHoldTime':_0x13d364[_0x85c0('0x2e')]||0x0,'talking':_0x13d364[_0x85c0('0x2f')],'total':_0x13d364[_0x85c0('0x30')],'type':_0x13d364[_0x85c0('0x26')],'unmanaged':_0x13d364[_0x85c0('0x31')],'abandoned':_0x13d364['abandoned'],'waiting':_0x13d364['waiting'],'loggedInDb':_0x13d364['loggedInDb'],'dialActive':_0x13d364[_0x85c0('0x32')],'dialMethod':_0x13d364['dialMethod'],'dialOriginateCallerIdName':_0x13d364[_0x85c0('0x33')],'dialOriginateCallerIdNumber':_0x13d364['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x13d364[_0x85c0('0x34')],'dialPrefix':_0x13d364[_0x85c0('0x35')],'outboundAnswerAgiCallsDay':_0x13d364[_0x85c0('0x36')],'outboundAnswerCallsDay':_0x13d364['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x13d364[_0x85c0('0x37')],'outboundBusyCallsDay':_0x13d364[_0x85c0('0x38')],'outboundCongestionCallsDay':_0x13d364[_0x85c0('0x39')],'outboundDropCallsDayACS':_0x13d364[_0x85c0('0x3a')],'outboundDropCallsDayCallersExit':_0x13d364['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x13d364[_0x85c0('0x3b')],'outboundNoAnswerCallsDay':_0x13d364['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x13d364['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x13d364[_0x85c0('0x3c')],'outboundReCallsDay':_0x13d364[_0x85c0('0x3d')],'outboundRejectCallsDay':_0x13d364[_0x85c0('0x3e')],'outboundUnknownCallsDay':_0x13d364[_0x85c0('0x3f')],'predictiveIntervalAnsweredCalls':_0x13d364[_0x85c0('0x40')],'predictiveIntervalAvgHoldtime':_0x13d364[_0x85c0('0x41')],'predictiveIntervalAvgTalktime':_0x13d364['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x13d364[_0x85c0('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x13d364[_0x85c0('0x43')],'predictiveIntervalErlangCalls':_0x13d364[_0x85c0('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x13d364['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x13d364['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x13d364[_0x85c0('0x45')],'predictiveIntervalPauses':_0x13d364[_0x85c0('0x46')],'predictiveIntervalAvailable':_0x13d364[_0x85c0('0x47')],'predictiveIntervalTotalCalls':_0x13d364[_0x85c0('0x48')],'message':_0x13d364['message'],'originated':_0x13d364[_0x85c0('0x49')],'erlangCalls':_0x13d364['erlangCalls'],'erlangCallToSecond':_0x13d364[_0x85c0('0x4a')],'erlangAbandonmentRate':_0x13d364[_0x85c0('0x4b')],'erlangBusyFactor':_0x13d364[_0x85c0('0x4c')],'startPredictive':_0x13d364[_0x85c0('0x4d')],'startProgressive':_0x13d364['startProgressive']};if(_0x13d364[_0x85c0('0x4e')]){_0x561116[_0x85c0('0x4e')]={'id':_0x13d364[_0x85c0('0x4e')]['id'],'name':_0x13d364[_0x85c0('0x4e')][_0x85c0('0x27')],'active':_0x13d364[_0x85c0('0x4e')]['active'],'callerid':_0x13d364['Trunk'][_0x85c0('0x4f')]};}if(_0x13d364[_0x85c0('0x50')]){_0x561116[_0x85c0('0x50')]={'id':_0x13d364[_0x85c0('0x50')]['id'],'name':_0x13d364['Interval']['name']};}var _0x37ac3c=md5(JSON[_0x85c0('0x51')](_0x561116));if(_0x13d364[_0x85c0('0x4')]!==_0x37ac3c){_0x13d364[_0x85c0('0x4')]=_0x37ac3c;emit(util[_0x85c0('0x52')](_0x85c0('0x53'),_0x561116['name']),_0x85c0('0x54'),_0x561116);}}}function emitVoiceQueueChannelRemove(_0x42b20b){emit(util['format'](_0x85c0('0x53'),_0x42b20b[_0x85c0('0x27')]),_0x85c0('0x55'),_0x42b20b);}function notSendMessagesQueue(_0x366962){if(_0x366962[_0x85c0('0x56')]){if(_0x366962[_0x85c0('0x49')]===0x0&&_0x366962['pTalking']===0x0){_0x366962[_0x85c0('0x56')]=![];_0x366962[_0x85c0('0x2a')]=0x0;_0x366962['paused']=0x0;_0x366962[_0x85c0('0x57')]=_0x85c0('0x58');ut['logger'](_0x85c0('0x59'),_0x366962[_0x85c0('0x27')]+'\x20is\x20not\x20active');}else{_0x366962['message']=_0x85c0('0x5a');ut[_0x85c0('0x5b')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x366962[_0x85c0('0x27')]+'\x20is\x20disactive');}emitCampaignPreview(_0x366962);}}Preview[_0x85c0('0xf')][_0x85c0('0x24')]=function(){var _0x16f403=this;setInterval(function(){_0x16f403['syncCampaigns']();},0x7cf);};Preview[_0x85c0('0xf')][_0x85c0('0x5c')]=function(){var _0x56e183=this[_0x85c0('0x14')];this[_0x85c0('0x17')]+=0x1;for(var _0x4d7c22 in _0x56e183){if(_0x56e183[_0x85c0('0x5d')](_0x4d7c22)&&(_0x56e183[_0x4d7c22][_0x85c0('0x5e')]===_0x85c0('0x8')||_0x56e183[_0x4d7c22]['dialMethod']===_0x85c0('0x5f'))&&_0x56e183[_0x4d7c22][_0x85c0('0x26')]===_0x85c0('0x60')){if(this[_0x85c0('0x17')]>0x7){this[_0x85c0('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x56e183[_0x85c0('0x5d')](_0x4d7c22)&&_0x56e183[_0x4d7c22][_0x85c0('0x5e')]==='preview'&&_0x56e183[_0x4d7c22][_0x85c0('0x26')]===_0x85c0('0x60')){if(_0x56e183[_0x4d7c22]['dialActive']){this['setMessage'](_0x56e183[_0x4d7c22]);this[_0x85c0('0x61')](_0x56e183[_0x4d7c22]);}else{notSendMessagesQueue(_0x56e183[_0x4d7c22]);}}}};Preview['prototype'][_0x85c0('0x62')]=function(_0x2b8547){var _0x4c0830=this;this[_0x85c0('0x13')][_0x85c0('0x10')](function(){if(!_[_0x85c0('0x63')](_0x4c0830[_0x85c0('0x64')][_0x2b8547])){loggerAction[_0x85c0('0x65')]('[clearZombieChannels][talking]',_0x2b8547,_0x85c0('0x66'),_0x4c0830['actions'][_0x2b8547][_0x85c0('0x67')],_0x85c0('0x68'),JSON['stringify'](_0x4c0830[_0x85c0('0x14')][_0x4c0830[_0x85c0('0x64')][_0x2b8547][_0x85c0('0x67')]][_0x85c0('0x49')]),_0x85c0('0x69'),JSON[_0x85c0('0x51')](_0x4c0830['campaignsPreview'][_0x4c0830['actions'][_0x2b8547]['queue']][_0x85c0('0x6a')]),JSON[_0x85c0('0x51')](_0x4c0830[_0x85c0('0x64')][_0x2b8547]['dialAnswer']),JSON[_0x85c0('0x51')](_[_0x85c0('0x6b')](_0x4c0830[_0x85c0('0x64')][_0x2b8547],[_0x85c0('0x6c'),_0x85c0('0x6d'),_0x85c0('0x6e'),_0x85c0('0x6f')])));return ami[_0x85c0('0x70')]({'action':_0x85c0('0x71'),'channel':_0x4c0830[_0x85c0('0x64')][_0x2b8547][_0x85c0('0x72')]})[_0x85c0('0x73')](function(_0x3aba8f){if(_0x3aba8f[_0x85c0('0x57')]===_0x85c0('0x74')){setTimeout(function(){if(_0x4c0830['actions'][_0x2b8547]){ut['updateOriginated'](_0x4c0830[_0x85c0('0x14')][_0x4c0830[_0x85c0('0x64')][_0x2b8547][_0x85c0('0x67')]],_0x85c0('0x75'));if(_0x4c0830[_0x85c0('0x64')][_0x2b8547][_0x85c0('0x76')]===!![]){ut[_0x85c0('0x77')](_0x4c0830[_0x85c0('0x14')][_0x4c0830[_0x85c0('0x64')][_0x2b8547][_0x85c0('0x67')]],_0x85c0('0x75'));ut[_0x85c0('0x78')]('[Dialer][checkChannel][pTalking][Preview]'+_0x2b8547,_0x4c0830['actions'][_0x2b8547]['queue']);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x2b8547,_0x4c0830[_0x85c0('0x64')][_0x2b8547][_0x85c0('0x67')]);delete _0x4c0830[_0x85c0('0x64')][_0x2b8547];}},0x2328);}});}});};Preview[_0x85c0('0xf')][_0x85c0('0x79')]=function(){var _0x2e61d1=this;loggerAction[_0x85c0('0x65')](_0x85c0('0x7a'),_[_0x85c0('0x7b')](this['actions']));for(var _0x45cbc2 in this['actions']){if(_0x2e61d1[_0x85c0('0x64')][_0x85c0('0x5d')](_0x45cbc2)){_0x2e61d1[_0x85c0('0x62')](_0x45cbc2);}}};Preview[_0x85c0('0xf')][_0x85c0('0x61')]=function(_0x3846d6){var _0x31114a=this;rpcDb[_0x85c0('0x7c')](_0x3846d6['id'],ut[_0x85c0('0x7d')](this[_0x85c0('0x16')]))['then'](function(_0x13002c){if(!_[_0x85c0('0x63')](_0x13002c)){for(var _0x5a2783=0x0;_0x5a2783<_0x13002c[_0x85c0('0x7e')];_0x5a2783+=0x1){if(ut['getDiff'](_0x13002c[_0x5a2783][_0x85c0('0x7f')])<_0x3846d6['dialRecallMeTimeout']*0x3c){_0x31114a['run'](_0x13002c[_0x5a2783]['id'])[_0x85c0('0x80')](ut[_0x85c0('0x81')](_0x85c0('0x82')))[_0x85c0('0x73')](ut[_0x85c0('0x81')](_0x85c0('0x82')));}else{var _0x47584c=new Action(_0x13002c[_0x5a2783],_0x3846d6);_0x47584c[_0x85c0('0x83')]=moment()[_0x85c0('0x52')](_0x85c0('0x84'));_0x3846d6[_0x85c0('0x3d')]+=0x1;ut[_0x85c0('0x85')](_0x47584c,0x17,_0x85c0('0x86'));if(_0x3846d6[_0x85c0('0x87')]){rpcDb[_0x85c0('0x88')](ut['createBody'](_0x13002c[_0x5a2783]));rpcDb[_0x85c0('0x89')](_0x47584c,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x85c0('0x85')](_0x47584c,0x16,_0x85c0('0x8a'));rpcDb[_0x85c0('0x89')](_0x47584c,_0x85c0('0x8b'));rpcDb[_0x85c0('0x8c')](_0x47584c,_0x85c0('0x8b'));}}}}})[_0x85c0('0x73')](ut[_0x85c0('0x81')]('[getContactRecallMe]'));};Preview[_0x85c0('0xf')][_0x85c0('0x8d')]=function(_0x14cefc){_0x14cefc[_0x85c0('0x56')]=!![];if(ut[_0x85c0('0x8e')](_0x14cefc[_0x85c0('0x2b')])){_0x14cefc[_0x85c0('0x57')]=_0x85c0('0x8f');}else if(!ut[_0x85c0('0x90')](_0x14cefc[_0x85c0('0x32')])){_0x14cefc[_0x85c0('0x57')]='NOT_ACTIVE';}else if(!this[_0x85c0('0x91')](_0x14cefc[_0x85c0('0x4e')])){if(!this['isTrunkReachable'](_0x14cefc[_0x85c0('0x92')])){_0x14cefc['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x14cefc[_0x85c0('0x57')]=_0x85c0('0x93');}}else{_0x14cefc[_0x85c0('0x57')]=_0x85c0('0x93');}emitCampaignPreview(_0x14cefc);};Preview[_0x85c0('0xf')][_0x85c0('0x94')]=function(_0x3eb459,_0x6755b1,_0x22a935){var _0x1dfccc=this;var _0x14a080=this[_0x85c0('0x64')][_0x6755b1];var _0x5b39fb=this[_0x85c0('0x14')][_0x14a080[_0x85c0('0x67')]];var _0x4cc497;if(_0x5b39fb){switch(_0x22a935){case'1':_0x5b39fb['outboundNoSuchCallsDay']+=0x1;_0x14a080[_0x85c0('0x95')]=ut[_0x85c0('0x96')](_0x14a080);ut[_0x85c0('0x85')](_0x14a080,0x0,_0x85c0('0x97'));rpcDb['createCustomerHistory'](_0x14a080,_0x85c0('0x98'));if(ut['totalGlobal'](_0x14a080)>=_0x5b39fb[_0x85c0('0x99')]){_0x4cc497=ut['cloneAction'](_0x14a080,0xf,_0x85c0('0x9a'));rpcDb[_0x85c0('0x8c')](_0x4cc497,_0x85c0('0x9b'));}else{rpcDb[_0x85c0('0x8c')](_0x14a080,_0x85c0('0x9b'));}delete this['actions'][_0x3eb459[_0x85c0('0x9c')]];break;case _0x85c0('0x9d'):var _0x2c50a5=moment()[_0x85c0('0x52')](_0x85c0('0x84'));_0x14a080[_0x85c0('0x9e')]=_0x2c50a5;_0x14a080[_0x85c0('0x9f')]=_0x2c50a5;_0x14a080[_0x85c0('0x76')]=!![];_0x5b39fb[_0x85c0('0x6a')]+=0x1;logger[_0x85c0('0x65')](_0x85c0('0xa0'),_0x14a080[_0x85c0('0xa1')],_0x85c0('0xa2'),_0x5b39fb[_0x85c0('0x27')],_0x85c0('0x69'),_0x5b39fb[_0x85c0('0x6a')]);ami[_0x85c0('0x25')](_0x85c0('0xa3'),ut[_0x85c0('0xa4')](_0x14a080,'connect'));if(_0x5b39fb[_0x85c0('0xa5')]){ami['emit'](_0x85c0('0xa6'),ut[_0x85c0('0xa7')](_0x14a080));}break;case'16':ami[_0x85c0('0x25')](_0x85c0('0xa8'),ut[_0x85c0('0xa4')](_0x14a080,_0x85c0('0xa9')));emitVoiceQueueChannelRemove(ut[_0x85c0('0xa4')](_0x14a080,_0x85c0('0xa9')));_0x5b39fb[_0x85c0('0xaa')]+=0x1;_0x5b39fb[_0x85c0('0x30')]+=0x1;_0x5b39fb[_0x85c0('0x29')]+=0x1;ut[_0x85c0('0x77')](_0x5b39fb,'[16]');_0x14a080[_0x85c0('0x95')]=ut['totalGlobal'](_0x14a080);ut[_0x85c0('0x85')](_0x14a080,0x4,_0x85c0('0xab'));rpcDb[_0x85c0('0x89')](_0x14a080,_0x85c0('0xac'));rpcDb[_0x85c0('0x8c')](_0x14a080,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x85c0('0xad')](_0x14a080);_0x5b39fb[_0x85c0('0x2d')]+=_0x14a080[_0x85c0('0xae')];_0x5b39fb[_0x85c0('0x2c')]+=_0x14a080['talktime'];logger[_0x85c0('0x65')](_0x85c0('0xaf'),_0x14a080[_0x85c0('0xa1')],_0x85c0('0xa2'),_0x5b39fb[_0x85c0('0x27')],_0x85c0('0x69'),_0x5b39fb[_0x85c0('0x6a')]);delete this['actions'][_0x3eb459[_0x85c0('0x9c')]];break;case _0x85c0('0xb0'):_0x5b39fb[_0x85c0('0x38')]+=0x1;_0x14a080[_0x85c0('0xb1')]+=0x1;_0x14a080[_0x85c0('0x95')]=ut['totalGlobal'](_0x14a080);ut['logCustomer'](_0x14a080,0x5,_0x85c0('0xb2'));rpcDb[_0x85c0('0x89')](_0x14a080,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x85c0('0x96')](_0x14a080)>=_0x5b39fb['dialGlobalMaxRetry']){_0x4cc497=ut[_0x85c0('0xb3')](_0x14a080,0xf,_0x85c0('0x9a'));rpcDb[_0x85c0('0x8c')](_0x4cc497,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x14a080[_0x85c0('0xb1')]>=_0x5b39fb[_0x85c0('0xb4')]){rpcDb[_0x85c0('0x8c')](_0x14a080,_0x85c0('0xb5'));}else{rpcDb[_0x85c0('0xb6')](ut[_0x85c0('0xb7')](_0x14a080,'countbusyretry',_0x5b39fb[_0x85c0('0xb8')]),_0x14a080['unlockAgent'],_0x14a080[_0x85c0('0xb9')]);}}break;case'NOANSWER':_0x5b39fb[_0x85c0('0xba')]+=0x1;_0x14a080[_0x85c0('0xbb')]+=0x1;_0x14a080[_0x85c0('0x95')]=ut[_0x85c0('0x96')](_0x14a080);ut[_0x85c0('0x85')](_0x14a080,0x3,'NoAnswer');rpcDb[_0x85c0('0x89')](_0x14a080,_0x85c0('0xbc'));if(ut['totalGlobal'](_0x14a080)>=_0x5b39fb[_0x85c0('0x99')]){_0x4cc497=ut[_0x85c0('0xb3')](_0x14a080,0xf,_0x85c0('0x9a'));rpcDb[_0x85c0('0x8c')](_0x4cc497,_0x85c0('0xbd'));}else{if(_0x14a080['countnoanswerretry']>=_0x5b39fb[_0x85c0('0xbe')]){rpcDb[_0x85c0('0x8c')](_0x14a080,_0x85c0('0xbc'));}else{rpcDb['rescheduleContact'](ut[_0x85c0('0xb7')](_0x14a080,_0x85c0('0xbb'),_0x5b39fb[_0x85c0('0xbf')]),_0x14a080['unlockAgent'],_0x14a080[_0x85c0('0xb9')]);}}break;case _0x85c0('0xc0'):_0x5b39fb[_0x85c0('0x39')]+=0x1;_0x14a080[_0x85c0('0xc1')]+=0x1;_0x14a080[_0x85c0('0x95')]=ut['totalGlobal'](_0x14a080);ut['logCustomer'](_0x14a080,0x8,'Congestion');rpcDb['createCustomerHistory'](_0x14a080,_0x85c0('0xc2'));if(ut[_0x85c0('0x96')](_0x14a080)>=_0x5b39fb[_0x85c0('0x99')]){_0x4cc497=ut[_0x85c0('0xb3')](_0x14a080,0xf,_0x85c0('0x9a'));rpcDb[_0x85c0('0x8c')](_0x4cc497,_0x85c0('0xc3'));}else{if(_0x14a080[_0x85c0('0xc1')]>=_0x5b39fb['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x14a080,_0x85c0('0xc2'));}else{rpcDb[_0x85c0('0xb6')](ut['scheduledAt'](_0x14a080,_0x85c0('0xc1'),_0x5b39fb[_0x85c0('0xb8')]),_0x14a080[_0x85c0('0xc4')],_0x14a080[_0x85c0('0xb9')]);}}break;case _0x85c0('0xc5'):_0x5b39fb[_0x85c0('0x3e')]+=0x1;_0x14a080[_0x85c0('0x95')]=ut[_0x85c0('0x96')](_0x14a080);ut[_0x85c0('0x85')](_0x14a080,0x14,_0x85c0('0xc6'));rpcDb[_0x85c0('0x89')](_0x14a080,_0x85c0('0xc7'));if(_0x14a080[_0x85c0('0xc4')]){rpcDb[_0x85c0('0xc8')](_0x14a080[_0x85c0('0xc9')]);}if(_0x14a080[_0x85c0('0xb9')]){rpcDb[_0x85c0('0xca')](_0x14a080[_0x85c0('0xc9')]);}break;default:if(_0x14a080[_0x85c0('0x76')]){ut['decrementTalkink'](_0x5b39fb,'[default]');ut[_0x85c0('0x78')](_0x85c0('0xcb')+_0x5b39fb['name'],_0x3eb459);}_0x5b39fb[_0x85c0('0x3f')]+=0x1;_0x14a080[_0x85c0('0x95')]=ut[_0x85c0('0x96')](_0x14a080);ut['logCustomer'](_0x14a080,0xc,_0x3eb459['cause-txt']||_0x3eb459[_0x85c0('0xcc')]);rpcDb[_0x85c0('0x89')](_0x14a080,_0x85c0('0xcd'));if(ut[_0x85c0('0x96')](_0x14a080)>=_0x5b39fb[_0x85c0('0x99')]){_0x4cc497=ut[_0x85c0('0xb3')](_0x14a080,0xf,_0x85c0('0x9a'));rpcDb['createCustomerFinal'](_0x4cc497,_0x85c0('0xce'));}else{rpcDb[_0x85c0('0x8c')](_0x14a080,_0x85c0('0xce'));}delete this[_0x85c0('0x64')][_0x3eb459['linkedid']];}if(!(_0x14a080['dialAnswer']&&_0x22a935==='16')){ut['updateOriginated'](_0x5b39fb,_0x85c0('0xcf'));logger[_0x85c0('0x65')](_0x85c0('0xd0'),_0x14a080[_0x85c0('0xa1')],'\x20Queue',_0x5b39fb['name'],_0x85c0('0x68'),_0x5b39fb[_0x85c0('0x49')]);}if(_0x22a935!=='ANSWER'){delete this[_0x85c0('0x64')][_0x3eb459[_0x85c0('0x9c')]];delete this[_0x85c0('0x64')][_0x3eb459[_0x85c0('0xd1')]];}}};Preview[_0x85c0('0xf')][_0x85c0('0xd2')]=function(_0x707d20,_0x1d8303,_0x201698){if(_[_0x85c0('0xd3')](_0x1d8303)&&_0x85c0('0xd4')!==typeof _0x1d8303){return;}if(_[_0x85c0('0xd3')](_0x201698)&&_0x85c0('0xd4')!==typeof _0x201698){return;}switch(_0x201698[_0x85c0('0xd5')]){case'0':ut[_0x85c0('0xd6')](_0x707d20,0x0,_0x85c0('0x97'));rpcDb[_0x85c0('0xd7')](_0x707d20,_0x85c0('0xd8'));break;case'3':ut[_0x85c0('0xd6')](_0x707d20,0x3,'NoAnswer');rpcDb[_0x85c0('0xd7')](_0x707d20,_0x85c0('0xd9'));break;case'5':ut[_0x85c0('0xd6')](_0x707d20,0x5,'Busy');rpcDb[_0x85c0('0xd7')](_0x707d20,_0x85c0('0xda'));break;case'8':ut[_0x85c0('0xd6')](_0x707d20,0x8,_0x85c0('0xdb'));rpcDb['createAgentHistory'](_0x707d20,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x85c0('0xd6')](_0x707d20,0x16,_0x85c0('0xdc'));rpcDb['createAgentHistory'](_0x707d20,_0x85c0('0xdd'));break;default:ut[_0x85c0('0xd6')](_0x707d20,0xc,_0x201698[_0x85c0('0xd5')]);rpcDb['createAgentHistory'](_0x707d20,_0x85c0('0xde'));}ut['updateOriginated'](_0x1d8303,_0x85c0('0xdf'));logger[_0x85c0('0x65')](_0x85c0('0xe0'),_0x707d20['uniqueid'],_0x85c0('0xa2'),_0x1d8303[_0x85c0('0x27')],_0x85c0('0x68'),_0x1d8303[_0x85c0('0x49')]);delete this['actions'][_0x707d20[_0x85c0('0xa1')]];};Preview[_0x85c0('0xf')][_0x85c0('0xe1')]=function(_0x164813,_0x122b7c,_0x4fb3d6,_0x1fb35d,_0xf5ce7){var _0x6e6c56=this;return new BPromise(function(_0x4a91fe,_0x455bf4){if(_[_0x85c0('0x63')](_0x122b7c)||_['isNil'](_0x122b7c['Contact'])||_[_0x85c0('0x63')](_0x122b7c[_0x85c0('0xe2')][_0x85c0('0xe3')])||_[_0x85c0('0x63')](_0x122b7c[_0x85c0('0x6e')])){_0x455bf4(ut[_0x85c0('0x57')](_0x85c0('0xe4'),_0x1fb35d,_0xf5ce7));return;}var _0x738718=uuid['v4']();var _0x55fbed=_0x6e6c56[_0x85c0('0x14')][_0x122b7c['Queue'][_0x85c0('0x27')]];var _0x369bd2=_0x4fb3d6?_0x6e6c56[_0x85c0('0x16')][_0x4fb3d6]['id']:undefined;_0x6e6c56[_0x85c0('0x64')][_0x738718]=new Action(_0x122b7c,_0x55fbed,_0x738718,_0x4fb3d6,_0x369bd2);var _0x5500ae=_0x6e6c56[_0x85c0('0x64')][_0x738718];_0x5500ae[_0x85c0('0xc4')]=_0x1fb35d;_0x5500ae[_0x85c0('0xb9')]=_0xf5ce7;_0x5500ae[_0x85c0('0xe5')]=_0x4fb3d6;if(_[_0x85c0('0xe6')](_0x164813)){_0x6e6c56[_0x85c0('0xe7')](_0x5500ae,_0x55fbed,_0x122b7c,_0x4fb3d6)[_0x85c0('0x80')](function(_0x38015a){logger[_0x85c0('0x65')](_0x85c0('0xe8'),_0x85c0('0xe9')+_0x5500ae[_0x85c0('0x67')]+'\x20IdHopper:\x20'+_0x5500ae[_0x85c0('0xc9')],JSON[_0x85c0('0x51')](_0x38015a));ami[_0x85c0('0x25')](_0x85c0('0xea'),ut['buildObj'](_0x5500ae,_0x85c0('0xeb')));_0x4a91fe(ut[_0x85c0('0x57')](_0x85c0('0xec')));})[_0x85c0('0x73')](function(_0x4c28f4){ut[_0x85c0('0x5b')](_0x85c0('0xed'),_0x4c28f4);_0x455bf4(ut[_0x85c0('0x57')]('Call\x20failed',_0x1fb35d,_0xf5ce7));});}else{_0x55fbed[_0x85c0('0x37')]+=0x1;ut[_0x85c0('0xee')](_0x5500ae);rpcDb[_0x85c0('0xef')](_0x5500ae,_0x85c0('0xf0'));delete _0x6e6c56['actions'][_0x738718];_0x455bf4(ut[_0x85c0('0x57')]('Contact\x20in\x20black\x20List',_0x1fb35d,_0xf5ce7));}});};Preview[_0x85c0('0xf')]['isTrunkReachable']=function(_0x4cbf70){return!_['isNil'](_0x4cbf70)&&!_[_0x85c0('0x63')](_0x4cbf70['name'])&&!_[_0x85c0('0x63')](_0x4cbf70[_0x85c0('0xf1')])&&_0x4cbf70[_0x85c0('0xf1')]&&!_[_0x85c0('0x63')](this[_0x85c0('0x15')][util[_0x85c0('0x52')](_0x85c0('0xf2'),_0x4cbf70['name'])])&&!_[_0x85c0('0x63')](this[_0x85c0('0x15')][util[_0x85c0('0x52')](_0x85c0('0xf2'),_0x4cbf70[_0x85c0('0x27')])]['status'])&&(this[_0x85c0('0x15')][util[_0x85c0('0x52')](_0x85c0('0xf2'),_0x4cbf70[_0x85c0('0x27')])][_0x85c0('0x71')]==='reachable'||this[_0x85c0('0x15')][util[_0x85c0('0x52')]('SIP/%s',_0x4cbf70[_0x85c0('0x27')])][_0x85c0('0x71')]===_0x85c0('0xf3'));};Preview['prototype'][_0x85c0('0xf4')]=function(_0x1a6893,_0x2c5387){var _0x4a9484=this;return new BPromise(function(_0x20789d,_0x3d1667){_0x4a9484[_0x85c0('0xf5')](_0x1a6893,_0x2c5387)['then'](function(_0x561a35){_0x20789d(_['pick'](_0x561a35,[_0x85c0('0x57')]));})[_0x85c0('0x73')](function(_0xf42f24){if(_0xf42f24[_0x85c0('0xf6')]){rpcDb[_0x85c0('0xc8')](_0x1a6893);}if(_0xf42f24[_0x85c0('0xf1')]){rpcDb[_0x85c0('0xca')](_0x1a6893);}_0x3d1667(_[_0x85c0('0x6b')](_0xf42f24,[_0x85c0('0x57')]));});});};Preview[_0x85c0('0xf')][_0x85c0('0xf5')]=function(_0x1fc78a,_0x2509a5){var _0x47446c=this;return new BPromise(function(_0x235121,_0x22e80e){var _0x41452a,_0x219fe3;rpcDb[_0x85c0('0xf7')](_0x1fc78a)['then'](function(_0x77de8c){if(!_[_0x85c0('0x63')](_0x77de8c[0x0])){_0x219fe3=_0x77de8c[0x0][_0x85c0('0xf8')]?![]:!![];_0x41452a=_0x77de8c[0x0][_0x85c0('0xf8')]?!![]:![];_0x41452a=_0x2509a5?!![]:_0x41452a;}var _0x4eeb8f=_0x47446c['validateContact'](_0x77de8c);if(_0x4eeb8f[_0x85c0('0xf9')]){rpcDb[_0x85c0('0xfa')](_[_0x85c0('0x6b')](_0x77de8c[0x0],[_0x85c0('0x6e'),'Contact.phone']))[_0x85c0('0x80')](function(_0x1eac87){_0x47446c[_0x85c0('0xe1')](_0x1eac87,_0x77de8c[0x0],_0x2509a5,_0x219fe3,_0x41452a)[_0x85c0('0x80')](function(_0x359a0f){_0x235121(_0x359a0f);})['catch'](function(_0x62063d){_0x22e80e(_0x62063d);});})[_0x85c0('0x73')](function(_0x1c0490){ut[_0x85c0('0x5b')]('[Preview][checkIsBlackList]',_0x1c0490);_0x22e80e(ut[_0x85c0('0x57')]('Call\x20unsuccessful',_0x219fe3,_0x41452a));});}else{_0x22e80e(ut[_0x85c0('0x57')](_0x4eeb8f['message'],_0x219fe3,_0x41452a));}})[_0x85c0('0x73')](function(_0x5b3750){ut[_0x85c0('0x5b')]('[Preview][getContactPreview]',_0x5b3750);_0x22e80e(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview[_0x85c0('0xf')]['validateContact']=function(_0x2ad3a1){if(_[_0x85c0('0x63')](_0x2ad3a1)||_[_0x85c0('0xe6')](_0x2ad3a1)||!_[_0x85c0('0x63')](_0x2ad3a1[0x0][_0x85c0('0xfb')])&&_[_0x85c0('0x63')](_0x2ad3a1[0x0][_0x85c0('0xfb')]['name'])){ut[_0x85c0('0x5b')]('[Preview][validateContact][Empty\x20Contact]',_0x2ad3a1);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x4d997e=this['campaignsPreview'][_0x2ad3a1[0x0][_0x85c0('0x66')][_0x85c0('0x27')]];_0x4d997e['message']=_0x85c0('0x93');if(_[_0x85c0('0x63')](_0x4d997e)){ut['logger'](_0x85c0('0xfc'),_0x4d997e);return{'isValid':![],'message':_0x85c0('0xfd')};}if(!this[_0x85c0('0x91')](_0x4d997e['Trunk'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x85c0('0xfe')+_0x4d997e[_0x85c0('0x27')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x4d997e[_0x85c0('0x92')])){ut[_0x85c0('0x5b')](_0x85c0('0xff'),_0x4d997e[_0x85c0('0x27')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x85c0('0x100')};}}if(!ut[_0x85c0('0x90')](_0x4d997e[_0x85c0('0x32')])){ut[_0x85c0('0x5b')](_0x85c0('0x101'),_0x4d997e[_0x85c0('0x27')]+_0x85c0('0x102'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d997e[_0x85c0('0x27')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x85c0('0x103')};};Preview['prototype'][_0x85c0('0xe7')]=function(_0x50c158,_0x48a5bf,_0x474d9e,_0x51bf64){var _0x1d0c32=this;return new BPromise(function(_0x5ac4a6,_0x2a7d34){var _0x2d4ab8=_0x50c158['uniqueid'];var _0x352124=_0x1d0c32[_0x85c0('0x91')](_0x48a5bf[_0x85c0('0x4e')])?util[_0x85c0('0x52')](_0x85c0('0x104'),_0x48a5bf[_0x85c0('0x4e')][_0x85c0('0x27')],_['isNil'](_0x48a5bf[_0x85c0('0x35')])?'':_0x48a5bf[_0x85c0('0x35')]['trim']()||'',_0x48a5bf[_0x85c0('0x105')]>0x0?_0x474d9e[_0x85c0('0xe2')][_0x85c0('0xe3')][_0x85c0('0x106')](_0x48a5bf[_0x85c0('0x105')]):_0x474d9e[_0x85c0('0xe2')][_0x85c0('0xe3')]):util['format']('SIP/%s/%s%s',_[_0x85c0('0x63')](_0x48a5bf[_0x85c0('0x92')])?_0x48a5bf[_0x85c0('0x4e')][_0x85c0('0x27')]:_0x48a5bf[_0x85c0('0x92')]['name'],_[_0x85c0('0x63')](_0x48a5bf[_0x85c0('0x35')])?'':_0x48a5bf[_0x85c0('0x35')]['trim']()||'',_0x48a5bf['dialCutDigit']>0x0?_0x474d9e['Contact'][_0x85c0('0xe3')][_0x85c0('0x106')](_0x48a5bf['dialCutDigit']):_0x474d9e[_0x85c0('0xe2')][_0x85c0('0xe3')]);var _0x2a8519=_0x1d0c32['isTrunkReachable'](_0x48a5bf[_0x85c0('0x4e')])?ut['getCallerId'](_0x48a5bf[_0x85c0('0x4e')][_0x85c0('0x4f')],_0x48a5bf[_0x85c0('0x33')],_0x48a5bf[_0x85c0('0x107')]>0x0?ut['getCallerIdRandom'](_0x48a5bf[_0x85c0('0x108')],_0x48a5bf['dialRandomLastDigitCallerIdNumber']):_0x48a5bf[_0x85c0('0x108')]):ut[_0x85c0('0x109')](_[_0x85c0('0x63')](_0x48a5bf['TrunkBackup'])?_0x48a5bf['Trunk'][_0x85c0('0x4f')]:_0x48a5bf[_0x85c0('0x92')][_0x85c0('0x4f')],_0x48a5bf['dialOriginateCallerIdName'],_0x48a5bf[_0x85c0('0x107')]>0x0?ut[_0x85c0('0x10a')](_0x48a5bf[_0x85c0('0x108')],_0x48a5bf[_0x85c0('0x107')]):_0x48a5bf[_0x85c0('0x108')]);if(_0x2a8519){_0x50c158['originatecalleridname']=ut['extractCalleridName'](_0x2a8519);_0x50c158[_0x85c0('0x10b')]=ut['extractCalleridNumber'](_0x2a8519);}var _0x4dbb4b=ut['addVariables'](_0x48a5bf,_0x474d9e,_0x352124,_0x2a8519,_0x2d4ab8,_0x50c158);_[_0x85c0('0x10c')](_0x50c158,ut[_0x85c0('0x10d')](_0x4dbb4b));_0x50c158[_0x85c0('0x83')]=moment()['format'](_0x85c0('0x84'));ami[_0x85c0('0x70')](ut[_0x85c0('0x10e')](_0x50c158,_0x48a5bf,_0x4dbb4b,_0x50c158['activeContact'],_0x51bf64))['then'](function(_0x54e584){_0x48a5bf[_0x85c0('0x49')]+=0x1;logger[_0x85c0('0x65')]('[originated][increment]',_0x2d4ab8,_0x85c0('0xa2'),_0x48a5bf['name'],_0x85c0('0x68'),_0x48a5bf[_0x85c0('0x49')]);_0x5ac4a6(_0x54e584);})['catch'](function(_0x19bcb3){ut[_0x85c0('0xd6')](_0x50c158,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x50c158,_0x85c0('0x10f'));_0x2a7d34(_0x19bcb3);});});};Preview[_0x85c0('0xf')][_0x85c0('0x1f')]=function(_0x576781){if(this[_0x85c0('0x64')][_0x576781[_0x85c0('0x9c')]]){this[_0x85c0('0x64')][_0x576781[_0x85c0('0x9c')]][_0x85c0('0x72')]=_0x576781[_0x85c0('0x72')];}};Preview[_0x85c0('0xf')]['syncOriginateResponse']=function(_0x356741){var _0x1065c6=this;var _0x47c053=this[_0x85c0('0x64')][_0x356741[_0x85c0('0x110')]];if(_0x47c053){if(_0x47c053[_0x85c0('0xe5')]&&this[_0x85c0('0x16')][_0x47c053[_0x85c0('0xe5')]]){ut[_0x85c0('0x111')](_0x47c053,this['agents'][_0x47c053['lookAgent']][_0x85c0('0x27')],this['agents'][_0x47c053[_0x85c0('0xe5')]]['id']);}var _0x86e883=_[_0x85c0('0x112')](_0x47c053);_0x86e883['responsetime']=moment()[_0x85c0('0x52')](_0x85c0('0x84'));var _0x3a4770=_0x1065c6[_0x85c0('0x14')][_0x47c053['queue']];if(ut[_0x85c0('0x113')](_0x356741[_0x85c0('0x114')])){if(_0x47c053[_0x85c0('0xc4')]){rpcDb[_0x85c0('0xc8')](_0x47c053['idContact']);}if(_0x47c053[_0x85c0('0xb9')]){rpcDb['disableContact'](_0x47c053[_0x85c0('0xc9')]);}ami['emit']('custom:agentringnoanswer',ut[_0x85c0('0xa4')](_0x47c053,_0x85c0('0x115')));this['callProgressDetectingAgent'](_0x86e883,_0x3a4770,_0x356741);}else{_0x47c053[_0x85c0('0x83')]=moment()[_0x85c0('0x52')](_0x85c0('0x84'));ut[_0x85c0('0xd6')](_0x86e883,0x4,_0x85c0('0xab'));rpcDb[_0x85c0('0xd7')](_0x86e883,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0x85c0('0x1b')]=function(_0x210274){var _0x46284f=this;var _0x26caec=this['actions'][_0x210274[_0x85c0('0x9c')]];var _0x5efde0;if(_0x26caec){_0x5efde0=this[_0x85c0('0x14')][_0x26caec[_0x85c0('0x67')]];logger[_0x85c0('0x65')](_0x85c0('0x116'),_0x210274['linkedid'],_0x85c0('0xa2'),_0x5efde0[_0x85c0('0x27')],_0x85c0('0x69'),_0x5efde0[_0x85c0('0x6a')]);}if(this['actions'][_0x210274[_0x85c0('0x9c')]]&&_0x210274[_0x85c0('0x9c')]!==_0x210274[_0x85c0('0xa1')]){if(_0x210274['cause']==='16'&&this[_0x85c0('0x64')][_0x210274[_0x85c0('0x9c')]]['dialAnswer']){this[_0x85c0('0x94')](_0x210274,_0x210274[_0x85c0('0x9c')],_0x210274[_0x85c0('0x117')]);}else if(this[_0x85c0('0x64')][_0x210274[_0x85c0('0x9c')]]['dialAnswer']){logger[_0x85c0('0x65')](_0x85c0('0x118'),_0x210274['linkedid'],_0x210274['cause'],_0x85c0('0xa2'),_0x5efde0[_0x85c0('0x27')],'pTalking:\x20',_0x5efde0['pTalking']);this[_0x85c0('0x94')](_0x210274,_0x210274['linkedid'],_0x210274[_0x85c0('0x117')]);}}else if(_0x26caec&&_[_0x85c0('0x63')](_0x26caec[_0x85c0('0x119')])&&_0x5efde0['dialQueueProject']&&_0x210274[_0x85c0('0x9c')]===_0x210274[_0x85c0('0xa1')]&&_[_0x85c0('0x63')](_0x210274['reason'])&&_0x210274[_0x85c0('0x117')]==='16'&&_0x210274[_0x85c0('0x11a')]==='6'&&_[_0x85c0('0xd3')](_0x26caec[_0x85c0('0x11b')])){if(_0x26caec[_0x85c0('0xc4')]){rpcDb[_0x85c0('0xc8')](_0x26caec[_0x85c0('0xc9')]);}if(_0x26caec[_0x85c0('0xb9')]){rpcDb[_0x85c0('0xca')](_0x26caec[_0x85c0('0xc9')]);}_0x210274['reason']='22';this[_0x85c0('0xd2')](_0x26caec,_0x5efde0,_0x210274);}else if(_0x26caec&&_0x26caec[_0x85c0('0x11b')]){if(_0x210274[_0x85c0('0x117')]==='16'&&this[_0x85c0('0x64')][_0x210274[_0x85c0('0x9c')]]['dialAnswer']){logger[_0x85c0('0x65')](_0x85c0('0x11c'),_0x210274[_0x85c0('0x9c')],_0x210274[_0x85c0('0x117')],_0x85c0('0xa2'),_0x5efde0[_0x85c0('0x27')],'pTalking:\x20',_0x5efde0['pTalking']);this[_0x85c0('0x94')](_0x210274,_0x210274[_0x85c0('0x9c')],_0x210274[_0x85c0('0x117')]);}else if(this[_0x85c0('0x64')][_0x210274[_0x85c0('0x9c')]][_0x85c0('0x76')]){logger[_0x85c0('0x65')](_0x85c0('0x118'),_0x210274['linkedid'],_0x210274[_0x85c0('0x117')],'\x20Queue',_0x5efde0['name'],'pTalking:\x20',_0x5efde0['pTalking']);this[_0x85c0('0x94')](_0x210274,_0x210274[_0x85c0('0x9c')],_0x210274[_0x85c0('0x117')]);}}};Preview[_0x85c0('0xf')]['syncDialEnd']=function(_0x2eefa2){if(this[_0x85c0('0x64')][_0x2eefa2[_0x85c0('0xd1')]]&&_0x2eefa2['destlinkedid']!==_0x2eefa2['destuniqueid']){this[_0x85c0('0x94')](_0x2eefa2,_0x2eefa2[_0x85c0('0xd1')],_0x2eefa2[_0x85c0('0xcc')]);}};Preview[_0x85c0('0xf')][_0x85c0('0x1c')]=function(_0x192ee4){if(this[_0x85c0('0x64')][_0x192ee4['linkedid']]&&_0x192ee4['linkedid']!==_0x192ee4[_0x85c0('0xa1')]&&!this[_0x85c0('0x64')][_0x192ee4[_0x85c0('0x9c')]]['dialAnswer']){if(_0x192ee4[_0x85c0('0x117')]==='1'){this[_0x85c0('0x94')](_0x192ee4,_0x192ee4[_0x85c0('0x9c')],_0x192ee4['cause']);}}};Preview[_0x85c0('0xf')][_0x85c0('0x11d')]=function(_0x57d2b9,_0x3d503a,_0x163aa7){if(this[_0x85c0('0x64')][_0x57d2b9]){if(_[_0x85c0('0x63')](this['actions'][_0x57d2b9]['variables'])){this[_0x85c0('0x64')][_0x57d2b9]['variables']={};}this[_0x85c0('0x64')][_0x57d2b9][_0x85c0('0x11e')][_0x3d503a]=_0x163aa7;}};Preview[_0x85c0('0xf')]['syncVarSet']=function(_0x21aa7b){try{if(!_[_0x85c0('0x63')](_0x21aa7b)){if(ut[_0x85c0('0x11f')](_[_0x85c0('0x120')](_0x21aa7b[_0x85c0('0x121')])[0x0])){this[_0x85c0('0x11d')](_0x21aa7b['uniqueid'],_[_0x85c0('0x120')](_0x21aa7b['variable'])[0x0],_0x21aa7b[_0x85c0('0x122')]);}}}catch(_0x51b19a){logger[_0x85c0('0x123')](_0x85c0('0x124'),util[_0x85c0('0x125')](_0x51b19a,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x85c0('0x126')]=function(_0x2d9613){if(_0x2d9613){if(this['actions'][_0x2d9613[_0x85c0('0x127')]]){this[_0x85c0('0x64')][_0x2d9613[_0x85c0('0x127')]][_0x85c0('0x11b')]=!![];}}};Preview[_0x85c0('0xf')][_0x85c0('0x23')]=function(_0x6736ca){if(_0x6736ca){if(this[_0x85c0('0x64')][_0x6736ca[_0x85c0('0x128')]]){this[_0x85c0('0x64')][_0x6736ca[_0x85c0('0x128')]][_0x85c0('0x11b')]=!![];}}};module[_0x85c0('0x129')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 5275651..8cb3965 100644 --- a/server/services/ami/preview/rpcDb.js +++ b/server/services/ami/preview/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3baf=['createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','type','uniqueid','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','exten','xcally-motion-preview','assigned','lastAssignedTo','membername','queuecallerexitreason','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','then','catch','[createHistory]\x20','resolve','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20'];(function(_0x464b4a,_0x214813){var _0x43f69b=function(_0x335ebe){while(--_0x335ebe){_0x464b4a['push'](_0x464b4a['shift']());}};_0x43f69b(++_0x214813);}(_0x3baf,0xf7));var _0xf3ba=function(_0x324d02,_0x6d9c0b){_0x324d02=_0x324d02-0x0;var _0x3d4f59=_0x3baf[_0x324d02];return _0x3d4f59;};'use strict';var util=require(_0xf3ba('0x0'));var BPromise=require(_0xf3ba('0x1'));var logger=require(_0xf3ba('0x2'))(_0xf3ba('0x3'));var _=require(_0xf3ba('0x4'));var cmHopper=require(_0xf3ba('0x5'));var cmHopperFinal=require(_0xf3ba('0x6'));var cmHopperHistory=require(_0xf3ba('0x7'));var cmHopperBlack=require(_0xf3ba('0x8'));var voiceQueueRt=require(_0xf3ba('0x9'));var agentReportPreview=require(_0xf3ba('0xa'));var voiceQueueReport=require(_0xf3ba('0xb'));function loggerCatch(_0x475268){return function(_0x2e6df2){logger[_0xf3ba('0xc')](_0x475268,util['inspect'](_0x2e6df2,{'showHidden':![],'depth':null}));};}function create(_0x579135){return BPromise['resolve']()[_0xf3ba('0xd')](cmHopperHistory['createHistory'](_0x579135))[_0xf3ba('0xe')](loggerCatch(_0xf3ba('0xf')));}function createAgent(_0x3ae5fb){return BPromise[_0xf3ba('0x10')]()[_0xf3ba('0xd')](agentReportPreview[_0xf3ba('0x11')](_0x3ae5fb))[_0xf3ba('0xe')](loggerCatch(_0xf3ba('0xf')));}function moveContact(_0x32ecd1){return BPromise[_0xf3ba('0x10')]()[_0xf3ba('0xd')](cmHopper[_0xf3ba('0x12')](_0x32ecd1,!![]))[_0xf3ba('0xe')](loggerCatch(_0xf3ba('0x13')));}exports[_0xf3ba('0x14')]=function(_0x17673a){return BPromise[_0xf3ba('0x10')]()[_0xf3ba('0xd')](cmHopperBlack['checkIsBlackList'](_0x17673a))[_0xf3ba('0xe')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xf3ba('0x15')]=function(_0x345fc9){return BPromise[_0xf3ba('0x10')]()[_0xf3ba('0xd')](cmHopper[_0xf3ba('0x15')](_0x345fc9))['catch'](loggerCatch(_0xf3ba('0x16')));};exports[_0xf3ba('0x11')]=function(_0x13d899,_0x550dd3){create(_0x13d899)[_0xf3ba('0xe')](loggerCatch(_0x550dd3));moveContact(_0x13d899)[_0xf3ba('0xe')](loggerCatch(_0x550dd3));};exports[_0xf3ba('0x17')]=function(_0x44de40,_0x4d3c0a){createAgent(_0x44de40)[_0xf3ba('0xe')](loggerCatch(_0x4d3c0a));};exports[_0xf3ba('0x18')]=function(_0x4e601c,_0x479d65){create(_0x4e601c)[_0xf3ba('0xe')](loggerCatch(_0x479d65));};exports[_0xf3ba('0x19')]=function(_0x854fc4,_0x5d351f){moveContact(_0x854fc4)[_0xf3ba('0xe')](loggerCatch(_0x5d351f));};exports[_0xf3ba('0x1a')]=function(_0x35d6d4,_0x7ebcea,_0x23a744){if(_0x7ebcea){_0x35d6d4[_0xf3ba('0x1b')]=null;}if(_0x23a744){_0x35d6d4[_0xf3ba('0x1c')]=![];}return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0x35d6d4))[_0xf3ba('0xe')](loggerCatch(_0xf3ba('0x1d')));};exports[_0xf3ba('0x1e')]=function(_0x3b6404){return BPromise[_0xf3ba('0x10')]()['then'](cmHopper['countReScheduled'](_0x3b6404))[_0xf3ba('0xe')](loggerCatch(_0xf3ba('0x1f')));};exports['unlockContact']=function(_0x1c9d6a){return BPromise[_0xf3ba('0x10')]()['then'](cmHopper['unlockContact']({'UserId':null},_0x1c9d6a,0x1))[_0xf3ba('0xe')](loggerCatch(_0xf3ba('0x20')));};exports['disableContact']=function(_0x18a4fb){return BPromise[_0xf3ba('0x10')]()[_0xf3ba('0xd')](cmHopper['unlockContact']({'active':![]},_0x18a4fb,0x1))[_0xf3ba('0xe')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x7c1a60){var _0x19ef2c={};_0x19ef2c['type']=_0x7c1a60[_0xf3ba('0x21')];_0x19ef2c[_0xf3ba('0x22')]=_0x7c1a60['uniqueid'];_0x19ef2c['calleridnum']=_0x7c1a60['calleridnum'];_0x19ef2c[_0xf3ba('0x23')]=_0x7c1a60[_0xf3ba('0x23')];_0x19ef2c['queue']=_0x7c1a60[_0xf3ba('0x24')];_0x19ef2c['queuecallerjoinAt']=_0x7c1a60['answertime'];_0x19ef2c[_0xf3ba('0x25')]=_0x7c1a60[_0xf3ba('0x26')];_0x19ef2c[_0xf3ba('0x27')]=0x1;_0x19ef2c[_0xf3ba('0x28')]=_0x7c1a60[_0xf3ba('0x29')];_0x19ef2c[_0xf3ba('0x2a')]=_0x7c1a60['membername'];_0x19ef2c[_0xf3ba('0x2b')]='from-sip';_0x19ef2c[_0xf3ba('0x2c')]=_0xf3ba('0x2d');_0x19ef2c['holdtime']=0x0;_0x19ef2c[_0xf3ba('0x2e')]=0x1;_0x19ef2c[_0xf3ba('0x2f')]=_0x7c1a60[_0xf3ba('0x30')];_0x19ef2c[_0xf3ba('0x31')]='COMPLETED';return BPromise[_0xf3ba('0x10')]()['then'](voiceQueueReport['create'](_0x19ef2c))['catch'](loggerCatch(_0xf3ba('0x32')));};exports[_0xf3ba('0x33')]=function(_0xe4e56a,_0x38e691){return BPromise[_0xf3ba('0x10')]()['then'](cmHopper[_0xf3ba('0x33')](_0xe4e56a,_0x38e691))['catch'](loggerCatch(_0xf3ba('0x34')));};exports['rescheduleContactInQueue']=function(_0x1c2e29){return BPromise[_0xf3ba('0x10')]()[_0xf3ba('0xd')](cmHopper[_0xf3ba('0x1a')](_0x1c2e29,!![],!![]))['catch'](loggerCatch(_0xf3ba('0x35')));}; \ No newline at end of file +var _0xd67b=['rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','context','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal'];(function(_0xe4a2e8,_0x150be9){var _0x1441a7=function(_0x2f9071){while(--_0x2f9071){_0xe4a2e8['push'](_0xe4a2e8['shift']());}};_0x1441a7(++_0x150be9);}(_0xd67b,0x133));var _0xbd67=function(_0x29f74c,_0x2a4dbf){_0x29f74c=_0x29f74c-0x0;var _0x5dc233=_0xd67b[_0x29f74c];return _0x5dc233;};'use strict';var util=require('util');var BPromise=require(_0xbd67('0x0'));var logger=require('../../../config/logger')(_0xbd67('0x1'));var _=require(_0xbd67('0x2'));var cmHopper=require(_0xbd67('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xbd67('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xbd67('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xbd67('0x6'));function loggerCatch(_0xa5c384){return function(_0x2ad142){logger[_0xbd67('0x7')](_0xa5c384,util[_0xbd67('0x8')](_0x2ad142,{'showHidden':![],'depth':null}));};}function create(_0x72f9ac){return BPromise[_0xbd67('0x9')]()[_0xbd67('0xa')](cmHopperHistory[_0xbd67('0xb')](_0x72f9ac))[_0xbd67('0xc')](loggerCatch(_0xbd67('0xd')));}function createAgent(_0x3a7f43){return BPromise[_0xbd67('0x9')]()['then'](agentReportPreview['createHistory'](_0x3a7f43))[_0xbd67('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x388d95){return BPromise[_0xbd67('0x9')]()[_0xbd67('0xa')](cmHopper[_0xbd67('0xe')](_0x388d95,!![]))[_0xbd67('0xc')](loggerCatch(_0xbd67('0xf')));}exports[_0xbd67('0x10')]=function(_0x32bd81){return BPromise[_0xbd67('0x9')]()[_0xbd67('0xa')](cmHopperBlack['checkIsBlackList'](_0x32bd81))[_0xbd67('0xc')](loggerCatch(_0xbd67('0x11')));};exports[_0xbd67('0x12')]=function(_0x2abcf2){return BPromise[_0xbd67('0x9')]()[_0xbd67('0xa')](cmHopper[_0xbd67('0x12')](_0x2abcf2))[_0xbd67('0xc')](loggerCatch(_0xbd67('0x13')));};exports[_0xbd67('0xb')]=function(_0x591de9,_0x4ab3a6){create(_0x591de9)[_0xbd67('0xc')](loggerCatch(_0x4ab3a6));moveContact(_0x591de9)[_0xbd67('0xc')](loggerCatch(_0x4ab3a6));};exports[_0xbd67('0x14')]=function(_0x47d066,_0x3c0d33){createAgent(_0x47d066)[_0xbd67('0xc')](loggerCatch(_0x3c0d33));};exports[_0xbd67('0x15')]=function(_0x4b764f,_0x5906a2){create(_0x4b764f)['catch'](loggerCatch(_0x5906a2));};exports[_0xbd67('0x16')]=function(_0x4609b7,_0xb3f67f){moveContact(_0x4609b7)['catch'](loggerCatch(_0xb3f67f));};exports[_0xbd67('0x17')]=function(_0x40ec96,_0x37836c,_0x32037f){if(_0x37836c){_0x40ec96[_0xbd67('0x18')]=null;}if(_0x32037f){_0x40ec96[_0xbd67('0x19')]=![];}return BPromise['resolve']()[_0xbd67('0xa')](cmHopper[_0xbd67('0x17')](_0x40ec96))[_0xbd67('0xc')](loggerCatch(_0xbd67('0x1a')));};exports[_0xbd67('0x1b')]=function(_0x33fd8c){return BPromise[_0xbd67('0x9')]()[_0xbd67('0xa')](cmHopper[_0xbd67('0x1b')](_0x33fd8c))[_0xbd67('0xc')](loggerCatch(_0xbd67('0x1c')));};exports['unlockContact']=function(_0x3b75dc){return BPromise['resolve']()[_0xbd67('0xa')](cmHopper[_0xbd67('0x1d')]({'UserId':null},_0x3b75dc,0x1))[_0xbd67('0xc')](loggerCatch('[unlockContact]\x20'));};exports[_0xbd67('0x1e')]=function(_0x410baa){return BPromise['resolve']()[_0xbd67('0xa')](cmHopper[_0xbd67('0x1d')]({'active':![]},_0x410baa,0x1))[_0xbd67('0xc')](loggerCatch(_0xbd67('0x1f')));};exports[_0xbd67('0x20')]=function(_0x55c2d4){var _0x5975dc={};_0x5975dc[_0xbd67('0x21')]=_0x55c2d4[_0xbd67('0x21')];_0x5975dc[_0xbd67('0x22')]=_0x55c2d4[_0xbd67('0x22')];_0x5975dc[_0xbd67('0x23')]=_0x55c2d4[_0xbd67('0x23')];_0x5975dc[_0xbd67('0x24')]=_0x55c2d4[_0xbd67('0x24')];_0x5975dc[_0xbd67('0x25')]=_0x55c2d4[_0xbd67('0x25')];_0x5975dc['queuecallerjoinAt']=_0x55c2d4['answertime'];_0x5975dc[_0xbd67('0x26')]=_0x55c2d4[_0xbd67('0x27')];_0x5975dc[_0xbd67('0x28')]=0x1;_0x5975dc['queuecallercompleteAt']=_0x55c2d4[_0xbd67('0x29')];_0x5975dc[_0xbd67('0x2a')]=_0x55c2d4[_0xbd67('0x2b')];_0x5975dc[_0xbd67('0x2c')]='from-sip';_0x5975dc['exten']='xcally-motion-preview';_0x5975dc[_0xbd67('0x2d')]=0x0;_0x5975dc[_0xbd67('0x2e')]=0x1;_0x5975dc[_0xbd67('0x2f')]=_0x55c2d4['membername'];_0x5975dc['queuecallerexitreason']=_0xbd67('0x30');return BPromise[_0xbd67('0x9')]()[_0xbd67('0xa')](voiceQueueReport[_0xbd67('0x31')](_0x5975dc))[_0xbd67('0xc')](loggerCatch(_0xbd67('0x32')));};exports['getContactRecallMe']=function(_0x34dcb6,_0xba97cf){return BPromise[_0xbd67('0x9')]()['then'](cmHopper[_0xbd67('0x33')](_0x34dcb6,_0xba97cf))['catch'](loggerCatch(_0xbd67('0x34')));};exports[_0xbd67('0x35')]=function(_0x4f7f21){return BPromise[_0xbd67('0x9')]()[_0xbd67('0xa')](cmHopper[_0xbd67('0x17')](_0x4f7f21,!![],!![]))[_0xbd67('0xc')](loggerCatch(_0xbd67('0x36')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index f12f238..9756a1b 100644 --- a/server/services/ami/preview/util/util.js +++ b/server/services/ami/preview/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf36=['countnoanswerretry','clone','Global','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','queue','interface','agentReadyId','not_inuse','status','reachable','push','createBody','CampaignId','filterKey','idContact','campaigntype','active','scheduledat','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','util','lodash','preview','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','\x22%s\x22\x20<%s>','\x22\x22\x20<>','addVariables','Queue','name','format','calleridnum','ContactId','dialer','VoiceQueueId','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','responsetime','endtime','logAgent','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','answertime','isFailure','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xdf36,0x1d1));var _0x6df3=function(_0x5a994b,_0x35b068){_0x5a994b=_0x5a994b-0x0;var _0x520f93=_0xdf36[_0x5a994b];return _0x520f93;};'use strict';var util=require(_0x6df3('0x0'));var _=require(_0x6df3('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x6df3('0x2'));var ipAgi=process[_0x6df3('0x3')]['XCALLY_IP_AGI']||_0x6df3('0x4');function getSeconds(_0x544cc6,_0xb5772d){var _0x5a45b9=moment(_0x544cc6)[_0x6df3('0x5')](0x0);var _0x2e42da=moment(_0xb5772d)[_0x6df3('0x5')](0x0);return _0x5a45b9[_0x6df3('0x6')](_0x2e42da,_0x6df3('0x7'));}exports[_0x6df3('0x8')]=function(_0x469daf){return function(_0x29aed8){logger[_0x6df3('0x9')](_0x469daf,util[_0x6df3('0xa')](_0x29aed8,{'showHidden':![],'depth':null}));};};exports[_0x6df3('0xb')]=function(_0x38bf63,_0x29886c){logger[_0x6df3('0xc')](_0x38bf63,util['inspect'](_0x29886c,{'showHidden':![],'depth':null}));};exports[_0x6df3('0xd')]=function(_0xaad114,_0x544107){logger[_0x6df3('0x9')](_0xaad114,util['inspect'](_0x544107,{'showHidden':![],'depth':null}));};exports[_0x6df3('0xe')]=function(_0xf5df66){return function(_0x3a3e5d){logger[_0x6df3('0xc')](_0xf5df66,util[_0x6df3('0xa')](_0x3a3e5d,{'showHidden':![],'depth':null}));};};exports[_0x6df3('0xf')]=function(_0x1065d7,_0x1c496d,_0x29447d){return{'message':_0x1065d7,'unlock':_0x1c496d,'active':_0x29447d};};exports[_0x6df3('0x10')]=function(_0x3a1093,_0x1c64b9,_0x5087a8){if(!_['isUndefined'](_0x5087a8)&&_0x6df3('0x11')===typeof _0x5087a8&&!_[_0x6df3('0x12')](_0x5087a8)){if(!_[_0x6df3('0x13')](_0x1c64b9)&&'string'===typeof _0x1c64b9&&!_[_0x6df3('0x12')](_0x1c64b9)){return util['format'](_0x6df3('0x14'),_0x1c64b9,_0x5087a8);}return util['format'](_0x6df3('0x14'),_0x5087a8,_0x5087a8);}if(!_[_0x6df3('0x13')](_0x3a1093)&&_0x6df3('0x11')===typeof _0x3a1093&&!_['isEmpty'](_0x3a1093)){return _0x3a1093;}return _0x6df3('0x15');};exports['isActive']=function(_0x1f2281){if(_['isNil'](_0x1f2281)){return![];}return _0x1f2281;};exports[_0x6df3('0x16')]=function(_0x1c96fd,_0x10987f,_0x4b08d9,_0x2256b1,_0x205612,_0x17fa09){var _0x4f45c1={'XMD-QUEUE':_0x10987f[_0x6df3('0x17')]?_0x10987f[_0x6df3('0x17')][_0x6df3('0x18')]:'','XMD-CALLERID':_0x2256b1,'XMD-CALLERID-PREVIEW':_0x17fa09?util[_0x6df3('0x19')](_0x6df3('0x14'),_0x17fa09['calleridname'],_0x17fa09[_0x6df3('0x1a')]):_0x2256b1,'XMD-DIALID':_0x205612,'XMD-CONTACTID':_0x10987f[_0x6df3('0x1b')],'XMD-CDRTYPE':_0x6df3('0x1c'),'CALLERID(all)':_0x2256b1,'XMD-VOICEQUEUEID':_0x10987f[_0x6df3('0x1d')],'XMD-DIALCHANNEL':_0x4b08d9,'XMD-DIALTIMEOUT':_0x1c96fd['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x6df3('0x19')]('\x22rtTxX%s%s\x22',_0x1c96fd[_0x6df3('0x1e')]?'g':'',_[_0x6df3('0x12')](_0x1c96fd[_0x6df3('0x1f')])?'':_0x6df3('0x20')),'XMD-DIALURL':_0x1c96fd['dialPreviewUrl']||'','XMD-AGI':_0x1c96fd['dialQueueProject']?util[_0x6df3('0x19')](_0x6df3('0x21'),ipAgi,_0x1c96fd[_0x6df3('0x22')]):'NONE','XMD-AGIAFTER':_0x1c96fd[_0x6df3('0x1e')]?util[_0x6df3('0x19')](_0x6df3('0x21'),ipAgi,_0x1c96fd[_0x6df3('0x1e')]):_0x6df3('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x17fa09?_0x17fa09[_0x6df3('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x17fa09?_0x17fa09[_0x6df3('0x25')]:'','XMD-DESTINATION':_0x6df3('0x26')};if(!_[_0x6df3('0x12')](_0x1c96fd[_0x6df3('0x1f')])){_0x4f45c1[util[_0x6df3('0x19')]('%s',_0x6df3('0x27'))]=_0x1c96fd[_0x6df3('0x1f')];_0x4f45c1[util['format']('%s',_0x6df3('0x28'))]=_0x205612;}if(_0x10987f&&_0x10987f['Contact']){for(var _0x5960bb in _0x10987f['Contact']){if(_0x10987f[_0x6df3('0x29')][_0x6df3('0x2a')](_0x5960bb)){if(!_[_0x6df3('0x2b')](_0x10987f['Contact'][_0x5960bb])&&_0x5960bb!=='id'&&_0x5960bb!=='tags'&&_0x5960bb!==_0x6df3('0x2c')&&_0x5960bb!==_0x6df3('0x2d')){_0x4f45c1[util[_0x6df3('0x19')]('%s%s',_0x6df3('0x2e'),_[_0x6df3('0x2f')](_0x5960bb))]=_0x10987f[_0x6df3('0x29')][_0x5960bb];}}}}return _0x4f45c1;};exports[_0x6df3('0x30')]=function(_0x3a99dd){var _0x21a1d2={};for(var _0x16cd3a in _0x3a99dd){if(_0x3a99dd[_0x6df3('0x2a')](_0x16cd3a)){_0x21a1d2[util[_0x6df3('0x19')]('%s',_[_0x6df3('0x31')](_0x16cd3a))]=_0x3a99dd[_0x16cd3a];}}return{'variables':_0x21a1d2};};exports[_0x6df3('0x32')]=function(_0x2ed163,_0x45f401){if(!_[_0x6df3('0x2b')](_0x2ed163)){if(_0x2ed163['hasOwnProperty'](_0x6df3('0x33'))){if(_0x2ed163['originated']>0x0){_0x2ed163[_0x6df3('0x33')]-=0x1;}else{logger[_0x6df3('0x9')](_0x6df3('0x34'),_0x45f401);}}}else{logger[_0x6df3('0x9')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x45f401);}};exports[_0x6df3('0x35')]=function(_0x2eba10){var _0x3404d8=moment()[_0x6df3('0x19')](_0x6df3('0x36'));_0x2eba10[_0x6df3('0x37')]=0xd;_0x2eba10[_0x6df3('0x38')]='Blacklist';_0x2eba10['starttime']=_0x3404d8;_0x2eba10[_0x6df3('0x39')]=_0x3404d8;_0x2eba10[_0x6df3('0x3a')]=_0x3404d8;};exports[_0x6df3('0x3b')]=function(_0x130871,_0x274e56,_0xeac77){var _0x512e00=moment()['format'](_0x6df3('0x36'));_0x130871['state']=_0x274e56;_0x130871[_0x6df3('0x38')]=_0xeac77;_0x130871[_0x6df3('0x39')]=_0x512e00;_0x130871[_0x6df3('0x3c')]=getSeconds(_0x130871[_0x6df3('0x39')],_0x130871[_0x6df3('0x3d')]);};exports[_0x6df3('0x3e')]=function(_0x497694,_0x560db7,_0x4b24e7){_0x497694[_0x6df3('0x3f')]=_0x560db7;_0x497694[_0x6df3('0x40')]=_0x4b24e7;};exports[_0x6df3('0x41')]=function(_0x5339e2,_0x2f02f9,_0x4d12eb){var _0x4de3fc=moment()[_0x6df3('0x19')](_0x6df3('0x36'));_0x5339e2['state']=_0x2f02f9;_0x5339e2[_0x6df3('0x38')]=_0x4d12eb;_0x5339e2[_0x6df3('0x39')]=_0x5339e2['responsetime']?_0x5339e2[_0x6df3('0x39')]:_0x4de3fc;_0x5339e2[_0x6df3('0x3a')]=_0x5339e2['endtime']?_0x5339e2[_0x6df3('0x3a')]:_0x4de3fc;_0x5339e2['ringtime']=getSeconds(_0x5339e2[_0x6df3('0x39')]||0x0,_0x5339e2[_0x6df3('0x3d')]||0x0);_0x5339e2['talktime']=_0x5339e2[_0x6df3('0x42')]?getSeconds(_0x5339e2[_0x6df3('0x3a')],_0x5339e2[_0x6df3('0x42')]):0x0;};exports[_0x6df3('0x43')]=function(_0x59e24d){return _0x59e24d==='Failure';};exports['variablesAction']=function(_0xa3c860,_0x27e77e,_0x2fceee,_0x1be5d4,_0x390822){var _0x55c28c=_0x1be5d4?_0x6df3('0x44'):_0xa3c860[_0x6df3('0x45')];_0x55c28c=_0x390822?_0x6df3('0x46'):_0x55c28c;return{'actionid':_0xa3c860[_0x6df3('0x47')],'action':_0x6df3('0x48'),'channel':_0xa3c860[_0x6df3('0x49')],'callerid':util[_0x6df3('0x19')](_0x6df3('0x14'),_0x55c28c,_0xa3c860[_0x6df3('0x1a')]),'Exten':_0x6df3('0x26'),'Context':_0x6df3('0x4a'),'Priority':'1','variable':_0x2fceee,'timeout':(_0x27e77e[_0x6df3('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0xa3c860['uniqueid']};};exports[_0x6df3('0x4c')]=function(_0x3a3db5){return _0x3a3db5[_0x6df3('0x4d')]+_0x3a3db5[_0x6df3('0x4e')]+_0x3a3db5[_0x6df3('0x4f')];};exports['cloneAction']=function(_0x1497e8){var _0x292709=_[_0x6df3('0x50')](_0x1497e8);_0x292709[_0x6df3('0x37')]=0xf;_0x292709['statedesc']=_0x6df3('0x51');return _0x292709;};exports['scheduledAt']=function(_0xc1eeea,_0x394c97,_0x470be7){var _0x4b4c27={};_0x4b4c27[_0x394c97]=_0xc1eeea[_0x394c97];_0x4b4c27['active']=![];_0x4b4c27['scheduledat']=moment()['add'](_0x470be7,_0x6df3('0x52'))[_0x6df3('0x19')](_0x6df3('0x36'));_0x4b4c27[_0x6df3('0x1b')]=_0xc1eeea[_0x6df3('0x1b')];_0x4b4c27[_0x6df3('0x53')]=_0xc1eeea[_0x6df3('0x53')];_0x4b4c27[_0x6df3('0x1d')]=_0xc1eeea[_0x6df3('0x1d')]||undefined;return _0x4b4c27;};exports[_0x6df3('0x54')]=function(_0x4f5ddd,_0x3cd9f3){if(!_[_0x6df3('0x2b')](_0x4f5ddd)){if(_0x4f5ddd[_0x6df3('0x55')]>0x0){_0x4f5ddd[_0x6df3('0x55')]-=0x1;}else{logger['error'](_0x3cd9f3,_0x6df3('0x56'));}}else{logger[_0x6df3('0x9')](_0x3cd9f3,_0x6df3('0x57'));}};exports['IsNotLoggedIn']=function(_0x597bfe){if(_0x597bfe<=0x0){return!![];}return![];};exports['buildObj']=function(_0x2ea55b,_0x554873){_0x2ea55b['lastevent']=_0x554873;_0x2ea55b[_0x6df3('0x18')]=_0x2ea55b[_0x6df3('0x58')];_0x2ea55b['interface']=_0x2ea55b[_0x6df3('0x49')];return _0x2ea55b;};exports['buildAcw']=function(_0x5cc5d8){var _0x2ff41c={};_0x2ff41c[_0x6df3('0x58')]=_0x5cc5d8[_0x6df3('0x58')];_0x2ff41c[_0x6df3('0x59')]=_0x5cc5d8[_0x6df3('0x49')];_0x2ff41c[_0x6df3('0x47')]=_0x5cc5d8[_0x6df3('0x47')];return _0x2ff41c;};exports[_0x6df3('0x5a')]=function(_0x2df9ab){var _0x280ea7=[];for(var _0x570c3d in _0x2df9ab){if(_0x2df9ab[_0x6df3('0x2a')](_0x570c3d)){if(!_[_0x6df3('0x2b')](_0x2df9ab[_0x570c3d])&&_0x2df9ab[_0x570c3d]['state']===_0x6df3('0x5b')&&_0x2df9ab[_0x570c3d][_0x6df3('0x5c')]===_0x6df3('0x5d')){_0x280ea7[_0x6df3('0x5e')](_0x2df9ab[_0x570c3d]['id']);}}}return _0x280ea7;};exports['getDiff']=function(_0x4ed367){var _0x29686e=moment()[_0x6df3('0x5')](0x0);var _0x44c62c=moment(_0x4ed367)[_0x6df3('0x5')](0x0);return _0x29686e[_0x6df3('0x6')](_0x44c62c,_0x6df3('0x7'));};exports[_0x6df3('0x5f')]=function(_0x4c80bb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4c80bb[_0x6df3('0x1b')],'ListId':_0x4c80bb['ListId'],'VoiceQueueId':_0x4c80bb[_0x6df3('0x1d')]||undefined,'CampaignId':_0x4c80bb[_0x6df3('0x60')]||undefined};};exports[_0x6df3('0x61')]=function(_0x1cb37e){if(_0x1cb37e==='uniqueid'||_0x1cb37e===_0x6df3('0x62')||_0x1cb37e==='queue'||_0x1cb37e==='type'||_0x1cb37e===_0x6df3('0x63')||_0x1cb37e==='dialAnswer'||_0x1cb37e===_0x6df3('0x3f')||_0x1cb37e===_0x6df3('0x49')||_0x1cb37e==='calleridname'||_0x1cb37e===_0x6df3('0x64')||_0x1cb37e===_0x6df3('0x1a')||_0x1cb37e===_0x6df3('0x65')||_0x1cb37e==='countbusyretry'||_0x1cb37e===_0x6df3('0x4e')||_0x1cb37e===_0x6df3('0x4f')||_0x1cb37e===_0x6df3('0x66')||_0x1cb37e===_0x6df3('0x67')||_0x1cb37e==='callbackuniqueid'||_0x1cb37e===_0x6df3('0x68')||_0x1cb37e===_0x6df3('0x69')||_0x1cb37e===_0x6df3('0x1b')||_0x1cb37e==='ListId'||_0x1cb37e===_0x6df3('0x40')||_0x1cb37e===_0x6df3('0x1d')||_0x1cb37e===_0x6df3('0x6a')||_0x1cb37e===_0x6df3('0x6b')||_0x1cb37e===_0x6df3('0x6c')||_0x1cb37e===_0x6df3('0x6d')||_0x1cb37e===_0x6df3('0x6e')||_0x1cb37e===_0x6df3('0x6f')||_0x1cb37e===_0x6df3('0x70')||_0x1cb37e===_0x6df3('0x71')||_0x1cb37e==='xmd-dialid'||_0x1cb37e===_0x6df3('0x72')||_0x1cb37e===_0x6df3('0x73')||_0x1cb37e===_0x6df3('0x74')||_0x1cb37e===_0x6df3('0x75')||_0x1cb37e===_0x6df3('0x76')||_0x1cb37e==='xmd-agi'||_0x1cb37e===_0x6df3('0x77')||_0x1cb37e==='rtpaudioqosbridged'||_0x1cb37e===_0x6df3('0x78')||_0x1cb37e===_0x6df3('0x79')||_0x1cb37e===_0x6df3('0x7a')||_0x1cb37e===_0x6df3('0x7b')||_0x1cb37e==='rtpaudioqosrtt'||_0x1cb37e===_0x6df3('0x7c')||_0x1cb37e===_0x6df3('0x77')||_0x1cb37e===_0x6df3('0x7d')||_0x1cb37e==='rtpaudioqosjitter'||_0x1cb37e===_0x6df3('0x79')||_0x1cb37e==='rtpaudioqosloss'||_0x1cb37e==='rtpaudioqoslossbridged'||_0x1cb37e===_0x6df3('0x7e')||_0x1cb37e===_0x6df3('0x7c')||_0x1cb37e===_0x6df3('0x7f')||_0x1cb37e===_0x6df3('0x80')||_0x1cb37e===_0x6df3('0x37')||_0x1cb37e===_0x6df3('0x38')){return![];}return!![];};exports[_0x6df3('0x81')]=function(_0x436feb,_0xbcd105){var _0x528bdc,_0xbffc91,_0x5a6a41;if(_0xbcd105<=0x0){_0xbcd105=0x1;}_0x528bdc=new RegExp(_0x6df3('0x82')+_0xbcd105+'}$');_0xbffc91=Math[_0x6df3('0x83')](0xa,_0xbcd105-0x1);_0x5a6a41=Math[_0x6df3('0x83')](0xa,_0xbcd105)-0x1;return util['format']('%s',_[_0x6df3('0x84')](_0x436feb,_0x528bdc,_['random'](_0xbffc91,_0x5a6a41)));};exports[_0x6df3('0x85')]=function(_0xc3ba62){var _0x138454=_0xc3ba62[_0x6df3('0x86')](/"(.*?)"/);return _0x138454?_0x138454[0x1]:_0xc3ba62;};exports[_0x6df3('0x87')]=function(_0x342e19){var _0x2840a4=_0x342e19['match'](/<(.*?)>/);return _0x2840a4?_0x2840a4[0x1]:_0x342e19;}; \ No newline at end of file +var _0xae8a=['xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','moment','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','info','inspect','loggerError','logger2','message','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','isActive','isNil','Queue','name','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialQueueProject','NONE','originatecalleridnum','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toLowerVariables','toLower','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','Blacklist','starttime','responsetime','endtime','logAgent','state','statedesc','membername','logCustomer','ringtime','answertime','isFailure','Failure','variablesAction','calleridname','BOOKED','uniqueid','channelAgent','xcally-motion-preview','from-sip','totalGlobal','countbusyretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','interface','buildAcw','queue','agentReadyId','not_inuse','status','reachable','getDiff','CampaignId','filterKey','type','campaigntype','dialAnswer','active','scheduledat','countcongestionretry','countglobal','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter'];(function(_0xe0f49b,_0x574cd9){var _0x46dd4a=function(_0x5713e2){while(--_0x5713e2){_0xe0f49b['push'](_0xe0f49b['shift']());}};_0x46dd4a(++_0x574cd9);}(_0xae8a,0x98));var _0xaae8=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xae8a[_0x433a86];return _0x23000c;};'use strict';var util=require(_0xaae8('0x0'));var _=require('lodash');var moment=require(_0xaae8('0x1'));var logger=require(_0xaae8('0x2'))(_0xaae8('0x3'));var ipAgi=process['env'][_0xaae8('0x4')]||'127.0.0.1';function getSeconds(_0x403ccf,_0x458ff7){var _0x43b529=moment(_0x403ccf)[_0xaae8('0x5')](0x0);var _0x37274a=moment(_0x458ff7)[_0xaae8('0x5')](0x0);return _0x43b529[_0xaae8('0x6')](_0x37274a,_0xaae8('0x7'));}exports[_0xaae8('0x8')]=function(_0x3951fb){return function(_0x2cd3a5){logger[_0xaae8('0x9')](_0x3951fb,util['inspect'](_0x2cd3a5,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x53abc5,_0x37964c){logger[_0xaae8('0xa')](_0x53abc5,util[_0xaae8('0xb')](_0x37964c,{'showHidden':![],'depth':null}));};exports[_0xaae8('0xc')]=function(_0x50d94e,_0x1ee993){logger[_0xaae8('0x9')](_0x50d94e,util['inspect'](_0x1ee993,{'showHidden':![],'depth':null}));};exports[_0xaae8('0xd')]=function(_0x1e8e28){return function(_0x44c39c){logger[_0xaae8('0xa')](_0x1e8e28,util['inspect'](_0x44c39c,{'showHidden':![],'depth':null}));};};exports[_0xaae8('0xe')]=function(_0x3c1706,_0x5b6862,_0x157722){return{'message':_0x3c1706,'unlock':_0x5b6862,'active':_0x157722};};exports[_0xaae8('0xf')]=function(_0x5390fa,_0x23196a,_0x931ce6){if(!_[_0xaae8('0x10')](_0x931ce6)&&'string'===typeof _0x931ce6&&!_[_0xaae8('0x11')](_0x931ce6)){if(!_[_0xaae8('0x10')](_0x23196a)&&_0xaae8('0x12')===typeof _0x23196a&&!_['isEmpty'](_0x23196a)){return util[_0xaae8('0x13')]('\x22%s\x22\x20<%s>',_0x23196a,_0x931ce6);}return util['format'](_0xaae8('0x14'),_0x931ce6,_0x931ce6);}if(!_[_0xaae8('0x10')](_0x5390fa)&&_0xaae8('0x12')===typeof _0x5390fa&&!_['isEmpty'](_0x5390fa)){return _0x5390fa;}return'\x22\x22\x20<>';};exports[_0xaae8('0x15')]=function(_0x4b84dd){if(_[_0xaae8('0x16')](_0x4b84dd)){return![];}return _0x4b84dd;};exports['addVariables']=function(_0x340645,_0x538dab,_0x395401,_0x13fdc4,_0x25cb76,_0x3f465c){var _0x576d7a={'XMD-QUEUE':_0x538dab[_0xaae8('0x17')]?_0x538dab[_0xaae8('0x17')][_0xaae8('0x18')]:'','XMD-CALLERID':_0x13fdc4,'XMD-CALLERID-PREVIEW':_0x3f465c?util[_0xaae8('0x13')]('\x22%s\x22\x20<%s>',_0x3f465c['calleridname'],_0x3f465c[_0xaae8('0x19')]):_0x13fdc4,'XMD-DIALID':_0x25cb76,'XMD-CONTACTID':_0x538dab['ContactId'],'XMD-CDRTYPE':_0xaae8('0x1a'),'CALLERID(all)':_0x13fdc4,'XMD-VOICEQUEUEID':_0x538dab[_0xaae8('0x1b')],'XMD-DIALCHANNEL':_0x395401,'XMD-DIALTIMEOUT':_0x340645[_0xaae8('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xaae8('0x13')]('\x22rtTxX%s%s\x22',_0x340645[_0xaae8('0x1d')]?'g':'',_[_0xaae8('0x11')](_0x340645[_0xaae8('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x340645['dialPreviewUrl']||'','XMD-AGI':_0x340645[_0xaae8('0x1f')]?util[_0xaae8('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x340645[_0xaae8('0x1f')]):_0xaae8('0x20'),'XMD-AGIAFTER':_0x340645['dialQueueProject2']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x340645[_0xaae8('0x1d')]):_0xaae8('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x3f465c?_0x3f465c[_0xaae8('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x3f465c?_0x3f465c['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0xaae8('0x11')](_0x340645[_0xaae8('0x1e')])){_0x576d7a[util[_0xaae8('0x13')]('%s',_0xaae8('0x22'))]=_0x340645[_0xaae8('0x1e')];_0x576d7a[util[_0xaae8('0x13')]('%s',_0xaae8('0x23'))]=_0x25cb76;}if(_0x538dab&&_0x538dab['Contact']){for(var _0x409b04 in _0x538dab['Contact']){if(_0x538dab[_0xaae8('0x24')][_0xaae8('0x25')](_0x409b04)){if(!_['isNil'](_0x538dab[_0xaae8('0x24')][_0x409b04])&&_0x409b04!=='id'&&_0x409b04!==_0xaae8('0x26')&&_0x409b04!==_0xaae8('0x27')&&_0x409b04!==_0xaae8('0x28')){_0x576d7a[util[_0xaae8('0x13')](_0xaae8('0x29'),_0xaae8('0x2a'),_['toUpper'](_0x409b04))]=_0x538dab[_0xaae8('0x24')][_0x409b04];}}}}return _0x576d7a;};exports[_0xaae8('0x2b')]=function(_0x139439){var _0x3dc55d={};for(var _0x17ecfe in _0x139439){if(_0x139439[_0xaae8('0x25')](_0x17ecfe)){_0x3dc55d[util['format']('%s',_[_0xaae8('0x2c')](_0x17ecfe))]=_0x139439[_0x17ecfe];}}return{'variables':_0x3dc55d};};exports['updateOriginated']=function(_0x2c18ac,_0xebfedd){if(!_[_0xaae8('0x16')](_0x2c18ac)){if(_0x2c18ac[_0xaae8('0x25')](_0xaae8('0x2d'))){if(_0x2c18ac[_0xaae8('0x2d')]>0x0){_0x2c18ac['originated']-=0x1;}else{logger[_0xaae8('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0xebfedd);}}}else{logger[_0xaae8('0x9')](_0xaae8('0x2e'),_0xebfedd);}};exports[_0xaae8('0x2f')]=function(_0x16edf9){var _0x5d280e=moment()[_0xaae8('0x13')](_0xaae8('0x30'));_0x16edf9['state']=0xd;_0x16edf9['statedesc']=_0xaae8('0x31');_0x16edf9[_0xaae8('0x32')]=_0x5d280e;_0x16edf9[_0xaae8('0x33')]=_0x5d280e;_0x16edf9[_0xaae8('0x34')]=_0x5d280e;};exports[_0xaae8('0x35')]=function(_0x109698,_0x5b997d,_0x397c63){var _0x4c327c=moment()[_0xaae8('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x109698[_0xaae8('0x36')]=_0x5b997d;_0x109698[_0xaae8('0x37')]=_0x397c63;_0x109698['responsetime']=_0x4c327c;_0x109698['ringtime']=getSeconds(_0x109698['responsetime'],_0x109698[_0xaae8('0x32')]);};exports['logLookAgent']=function(_0x4505df,_0x261b98,_0x34c1e7){_0x4505df[_0xaae8('0x38')]=_0x261b98;_0x4505df['UserId']=_0x34c1e7;};exports[_0xaae8('0x39')]=function(_0x129bc3,_0x18df36,_0xe8bbd9){var _0xc5f7da=moment()['format'](_0xaae8('0x30'));_0x129bc3[_0xaae8('0x36')]=_0x18df36;_0x129bc3[_0xaae8('0x37')]=_0xe8bbd9;_0x129bc3['responsetime']=_0x129bc3[_0xaae8('0x33')]?_0x129bc3[_0xaae8('0x33')]:_0xc5f7da;_0x129bc3[_0xaae8('0x34')]=_0x129bc3[_0xaae8('0x34')]?_0x129bc3['endtime']:_0xc5f7da;_0x129bc3[_0xaae8('0x3a')]=getSeconds(_0x129bc3[_0xaae8('0x33')]||0x0,_0x129bc3[_0xaae8('0x32')]||0x0);_0x129bc3['talktime']=_0x129bc3[_0xaae8('0x3b')]?getSeconds(_0x129bc3['endtime'],_0x129bc3[_0xaae8('0x3b')]):0x0;};exports[_0xaae8('0x3c')]=function(_0x12a4df){return _0x12a4df===_0xaae8('0x3d');};exports[_0xaae8('0x3e')]=function(_0x5df83a,_0x5b14ac,_0x45d32b,_0x29b792,_0x5143d6){var _0x2e7975=_0x29b792?'RECALL':_0x5df83a[_0xaae8('0x3f')];_0x2e7975=_0x5143d6?_0xaae8('0x40'):_0x2e7975;return{'actionid':_0x5df83a[_0xaae8('0x41')],'action':'originate','channel':_0x5df83a[_0xaae8('0x42')],'callerid':util[_0xaae8('0x13')]('\x22%s\x22\x20<%s>',_0x2e7975,_0x5df83a[_0xaae8('0x19')]),'Exten':_0xaae8('0x43'),'Context':_0xaae8('0x44'),'Priority':'1','variable':_0x45d32b,'timeout':(_0x5b14ac['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x5df83a[_0xaae8('0x41')]};};exports[_0xaae8('0x45')]=function(_0x14f7bd){return _0x14f7bd[_0xaae8('0x46')]+_0x14f7bd['countcongestionretry']+_0x14f7bd[_0xaae8('0x47')];};exports[_0xaae8('0x48')]=function(_0x501422){var _0x3b7f44=_[_0xaae8('0x49')](_0x501422);_0x3b7f44[_0xaae8('0x36')]=0xf;_0x3b7f44[_0xaae8('0x37')]=_0xaae8('0x4a');return _0x3b7f44;};exports[_0xaae8('0x4b')]=function(_0x32356d,_0x500967,_0x2aa6e5){var _0x5c20f1={};_0x5c20f1[_0x500967]=_0x32356d[_0x500967];_0x5c20f1['active']=![];_0x5c20f1['scheduledat']=moment()[_0xaae8('0x4c')](_0x2aa6e5,_0xaae8('0x4d'))[_0xaae8('0x13')](_0xaae8('0x30'));_0x5c20f1['ContactId']=_0x32356d[_0xaae8('0x4e')];_0x5c20f1[_0xaae8('0x4f')]=_0x32356d[_0xaae8('0x4f')];_0x5c20f1['VoiceQueueId']=_0x32356d[_0xaae8('0x1b')]||undefined;return _0x5c20f1;};exports[_0xaae8('0x50')]=function(_0x24ea08,_0x1a389a){if(!_[_0xaae8('0x16')](_0x24ea08)){if(_0x24ea08[_0xaae8('0x51')]>0x0){_0x24ea08[_0xaae8('0x51')]-=0x1;}else{logger['error'](_0x1a389a,_0xaae8('0x52'));}}else{logger[_0xaae8('0x9')](_0x1a389a,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xaae8('0x53')]=function(_0xa48c1a){if(_0xa48c1a<=0x0){return!![];}return![];};exports[_0xaae8('0x54')]=function(_0x41eef8,_0x308c24){_0x41eef8[_0xaae8('0x55')]=_0x308c24;_0x41eef8[_0xaae8('0x18')]=_0x41eef8['queue'];_0x41eef8[_0xaae8('0x56')]=_0x41eef8[_0xaae8('0x42')];return _0x41eef8;};exports[_0xaae8('0x57')]=function(_0x2d870d){var _0x35dc86={};_0x35dc86[_0xaae8('0x58')]=_0x2d870d[_0xaae8('0x58')];_0x35dc86['interface']=_0x2d870d[_0xaae8('0x42')];_0x35dc86[_0xaae8('0x41')]=_0x2d870d[_0xaae8('0x41')];return _0x35dc86;};exports[_0xaae8('0x59')]=function(_0x5eadc6){var _0x13f167=[];for(var _0x24c681 in _0x5eadc6){if(_0x5eadc6[_0xaae8('0x25')](_0x24c681)){if(!_[_0xaae8('0x16')](_0x5eadc6[_0x24c681])&&_0x5eadc6[_0x24c681][_0xaae8('0x36')]===_0xaae8('0x5a')&&_0x5eadc6[_0x24c681][_0xaae8('0x5b')]===_0xaae8('0x5c')){_0x13f167['push'](_0x5eadc6[_0x24c681]['id']);}}}return _0x13f167;};exports[_0xaae8('0x5d')]=function(_0x3fe172){var _0x28118c=moment()[_0xaae8('0x5')](0x0);var _0xa8567f=moment(_0x3fe172)[_0xaae8('0x5')](0x0);return _0x28118c['diff'](_0xa8567f,'seconds');};exports['createBody']=function(_0x17a033){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x17a033[_0xaae8('0x4e')],'ListId':_0x17a033['ListId'],'VoiceQueueId':_0x17a033['VoiceQueueId']||undefined,'CampaignId':_0x17a033[_0xaae8('0x5e')]||undefined};};exports[_0xaae8('0x5f')]=function(_0x253a84){if(_0x253a84==='uniqueid'||_0x253a84==='idContact'||_0x253a84==='queue'||_0x253a84===_0xaae8('0x60')||_0x253a84===_0xaae8('0x61')||_0x253a84===_0xaae8('0x62')||_0x253a84===_0xaae8('0x38')||_0x253a84==='channelAgent'||_0x253a84===_0xaae8('0x3f')||_0x253a84===_0xaae8('0x63')||_0x253a84===_0xaae8('0x19')||_0x253a84===_0xaae8('0x64')||_0x253a84===_0xaae8('0x46')||_0x253a84===_0xaae8('0x65')||_0x253a84===_0xaae8('0x47')||_0x253a84===_0xaae8('0x66')||_0x253a84==='callback'||_0x253a84===_0xaae8('0x67')||_0x253a84===_0xaae8('0x68')||_0x253a84==='recallme'||_0x253a84===_0xaae8('0x4e')||_0x253a84==='ListId'||_0x253a84==='UserId'||_0x253a84===_0xaae8('0x1b')||_0x253a84===_0xaae8('0x69')||_0x253a84===_0xaae8('0x6a')||_0x253a84===_0xaae8('0x6b')||_0x253a84==='xmd-phone'||_0x253a84==='xmd-listid'||_0x253a84===_0xaae8('0x6c')||_0x253a84===_0xaae8('0x6d')||_0x253a84==='xmd-dialoptions'||_0x253a84===_0xaae8('0x6e')||_0x253a84===_0xaae8('0x6f')||_0x253a84===_0xaae8('0x70')||_0x253a84===_0xaae8('0x71')||_0x253a84===_0xaae8('0x72')||_0x253a84===_0xaae8('0x73')||_0x253a84===_0xaae8('0x74')||_0x253a84===_0xaae8('0x75')||_0x253a84===_0xaae8('0x76')||_0x253a84===_0xaae8('0x77')||_0x253a84===_0xaae8('0x78')||_0x253a84===_0xaae8('0x79')||_0x253a84===_0xaae8('0x7a')||_0x253a84===_0xaae8('0x7b')||_0x253a84===_0xaae8('0x7c')||_0x253a84==='rtpaudioqos'||_0x253a84===_0xaae8('0x76')||_0x253a84==='rtpaudioqosjitter'||_0x253a84===_0xaae8('0x78')||_0x253a84===_0xaae8('0x79')||_0x253a84===_0xaae8('0x7a')||_0x253a84===_0xaae8('0x7b')||_0x253a84===_0xaae8('0x7c')||_0x253a84===_0xaae8('0x7d')||_0x253a84===_0xaae8('0x7e')||_0x253a84==='state'||_0x253a84===_0xaae8('0x37')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x49afc1,_0x2cbe96){var _0x421989,_0x5706cf,_0x253886;if(_0x2cbe96<=0x0){_0x2cbe96=0x1;}_0x421989=new RegExp(_0xaae8('0x7f')+_0x2cbe96+'}$');_0x5706cf=Math[_0xaae8('0x80')](0xa,_0x2cbe96-0x1);_0x253886=Math[_0xaae8('0x80')](0xa,_0x2cbe96)-0x1;return util[_0xaae8('0x13')]('%s',_[_0xaae8('0x81')](_0x49afc1,_0x421989,_[_0xaae8('0x82')](_0x5706cf,_0x253886)));};exports[_0xaae8('0x83')]=function(_0x4b6526){var _0x1e37ce=_0x4b6526[_0xaae8('0x84')](/"(.*?)"/);return _0x1e37ce?_0x1e37ce[0x1]:_0x4b6526;};exports[_0xaae8('0x85')]=function(_0x521db9){var _0x4f2d72=_0x521db9[_0xaae8('0x84')](/<(.*?)>/);return _0x4f2d72?_0x4f2d72[0x1]:_0x521db9;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 7e6b028..c61f1a5 100644 --- a/server/services/ami/properties.js +++ b/server/services/ami/properties.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x5478d7,_0x5676f8){var _0x3b33d2=function(_0x265d0c){while(--_0x265d0c){_0x5478d7['push'](_0x5478d7['shift']());}};_0x3b33d2(++_0x5676f8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x9b381f,_0x2c51a5){_0x9b381f=_0x9b381f-0x0;var _0x3f740d=_0x5f2f[_0x9b381f];return _0x3f740d;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x1587a9,_0x124b5a){var _0x4e1317=function(_0xdffd10){while(--_0xdffd10){_0x1587a9['push'](_0x1587a9['shift']());}};_0x4e1317(++_0x124b5a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3a73f9,_0x5354a4){_0x3a73f9=_0x3a73f9-0x0;var _0x4af8bc=_0x5f2f[_0x3a73f9];return _0x4af8bc;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 2d79cbb..77db43a 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd558=['outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','isNil','isUndefined','mergeFromDatabase','initTelephones','initTrunks','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','sugarcrmAccounts','initServicenowAccounts','initDynamics365Accounts','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercomplete','sumBillable','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','voiceExtensions','channels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xd558,0x94));var _0x8d55=function(_0x482ee0,_0x3581bb){_0x482ee0=_0x482ee0-0x0;var _0x11fbab=_0xd558[_0x482ee0];return _0x11fbab;};'use strict';var BPromise=require(_0x8d55('0x0'));var util=require('util');var _=require(_0x8d55('0x1'));var moment=require(_0x8d55('0x2'));var Agent=require(_0x8d55('0x3'));var Telephone=require(_0x8d55('0x4'));var Trunk=require(_0x8d55('0x5'));var VoiceQueue=require(_0x8d55('0x6'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0x8d55('0x7'));var VoiceExtension=require(_0x8d55('0x8'));var ZendeskAccount=require(_0x8d55('0x9'));var SalesforceAccount=require(_0x8d55('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x8d55('0xb'));var ZohoAccount=require(_0x8d55('0xc'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x8d55('0xd'));var ServicenowAccount=require(_0x8d55('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FaxAccount=require(_0x8d55('0xf'));var Realtime=function(){this[_0x8d55('0x10')]={};this[_0x8d55('0x11')]={};this['trunks']={};this[_0x8d55('0x12')]={};this['triggers']={};this['campaigns']={};this[_0x8d55('0x13')]={};this[_0x8d55('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8d55('0x15')]={};this[_0x8d55('0x16')]={};this['queueChannels']={};this[_0x8d55('0x17')]={};this[_0x8d55('0x18')]={};this[_0x8d55('0x19')]={};this[_0x8d55('0x1a')]={};this['sugarcrmAccounts']={};this[_0x8d55('0x1b')]={};this[_0x8d55('0x1c')]={};this[_0x8d55('0x1d')]={};this[_0x8d55('0x1e')]={};this[_0x8d55('0x1f')]={};this[_0x8d55('0x20')]={};this[_0x8d55('0x21')]={};};function freeIsNotKey(_0x203c3a,_0x1cc96f,_0x291274){var _0x2aa3a0=_[_0x8d55('0x22')](_0x203c3a,function(_0x389129,_0x3f6e94){return _0x389129[_0x291274];});for(var _0x539221 in _0x1cc96f){if(_0x1cc96f[_0x8d55('0x23')](_0x539221)){if(!_0x2aa3a0[_0x539221]){delete _0x1cc96f[_0x539221];}}}}function freeIsNotKeySip(_0x17a5ff,_0x322b5e){var _0xd75966=_[_0x8d55('0x22')](_0x17a5ff,function(_0x8a7049,_0x19a03e){return util[_0x8d55('0x24')](_0x8d55('0x25'),_0x8a7049[_0x8d55('0x26')]);});for(var _0x527e15 in _0x322b5e){if(_0x322b5e[_0x8d55('0x23')](_0x527e15)){if(!_0xd75966[_0x527e15]){delete _0x322b5e[_0x527e15];}}}}function freeIsNotKeyAgent(_0x45ca48,_0x20cebc){var _0x36997c=_[_0x8d55('0x22')](_0x45ca48,function(_0x5f44ed,_0x2082c5){var _0x364a38=_['isNil'](_0x5f44ed['interface'])?util[_0x8d55('0x24')]('SIP/%s',_0x5f44ed['name']):_0x5f44ed[_0x8d55('0x27')];return _0x364a38;});for(var _0x2db588 in _0x20cebc){if(_0x20cebc['hasOwnProperty'](_0x2db588)){if(!_0x36997c[_0x2db588]){delete _0x20cebc[_0x2db588];}}}}function clearVoiceCallReports(_0x4e19ee){_0x4e19ee[_0x8d55('0x28')]=0x0;_0x4e19ee['answered']=0x0;_0x4e19ee[_0x8d55('0x29')]=0x0;_0x4e19ee[_0x8d55('0x2a')]=0x0;_0x4e19ee['sumBillable']=0x0;}function clearCampaigns(_0x4a3b0e){if(!_[_0x8d55('0x2b')](_0x4a3b0e)){for(var _0x5e1fa2 in _0x4a3b0e){if(_0x4a3b0e[_0x8d55('0x23')](_0x5e1fa2)){_0x4a3b0e[_0x5e1fa2][_0x8d55('0x2c')]=0x0;_0x4a3b0e[_0x5e1fa2]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2d6039){if(!_[_0x8d55('0x2b')](_0x2d6039)){for(var _0x2210eb in _0x2d6039){if(_0x2d6039[_0x8d55('0x23')](_0x2210eb)){_0x2d6039[_0x2210eb][_0x8d55('0x28')]=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x2d')]=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x2e')]=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x2f')]=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x29')]=0x0;_0x2d6039[_0x2210eb]['sumDuration']=0x0;_0x2d6039[_0x2210eb]['sumBillable']=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x30')]=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x31')]=0x0;_0x2d6039[_0x2210eb]['outboundBusyCallsDay']=0x0;_0x2d6039[_0x2210eb]['outboundCongestionCallsDay']=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x32')]=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x33')]=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x34')]=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x35')]=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x36')]=0x0;_0x2d6039[_0x2210eb]['outboundOriginateFailureCallsDay']=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x37')]=0x0;_0x2d6039[_0x2210eb]['outboundReCallsDay']=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x30')]=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x38')]=0x0;_0x2d6039[_0x2210eb][_0x8d55('0x39')]=!![];}}}}Realtime[_0x8d55('0x3a')]['mergeFromDatabase']=function(_0xe7dfab,_0x17fbcc){for(var _0x194c93 in _0x17fbcc){if(_0xe7dfab[_0x8d55('0x23')](_0x194c93)){_0xe7dfab[_0x194c93]=_0x17fbcc[_0x194c93];}}};Realtime[_0x8d55('0x3a')][_0x8d55('0x3b')]=function(){var _0x491c95=this;return function(_0x23d67f){if(_0x23d67f){freeIsNotKeyAgent(_0x23d67f,_0x491c95[_0x8d55('0x10')]);for(var _0x5274ab=0x0,_0x3ab6e3={},_0x5014ff={};_0x5274ab<_0x23d67f[_0x8d55('0x3c')];_0x5274ab+=0x1){_0x3ab6e3=_0x23d67f[_0x5274ab];var _0x1050c6=_[_0x8d55('0x3d')](_0x3ab6e3[_0x8d55('0x27')])?util[_0x8d55('0x24')](_0x8d55('0x25'),_0x3ab6e3[_0x8d55('0x26')]):_0x3ab6e3['interface'];if(_[_0x8d55('0x3e')](_0x491c95[_0x8d55('0x10')][_0x1050c6])){_0x491c95[_0x8d55('0x10')][_0x1050c6]=new Agent(_0x3ab6e3);}else{_0x491c95[_0x8d55('0x3f')](_0x491c95['agents'][_0x1050c6],_0x3ab6e3);}}}return _0x491c95['agents'];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x40')]=function(){var _0x4d3934=this;return function(_0xa63a74){if(_0xa63a74){freeIsNotKeySip(_0xa63a74,_0x4d3934[_0x8d55('0x11')]);for(var _0x308ddf=0x0,_0x11a23d={},_0x19a336={};_0x308ddf<_0xa63a74[_0x8d55('0x3c')];_0x308ddf+=0x1){_0x11a23d=_0xa63a74[_0x308ddf];if(_[_0x8d55('0x3e')](_0x4d3934[_0x8d55('0x11')][util[_0x8d55('0x24')](_0x8d55('0x25'),_0x11a23d[_0x8d55('0x26')])])){_0x4d3934[_0x8d55('0x11')][util['format'](_0x8d55('0x25'),_0x11a23d[_0x8d55('0x26')])]=new Telephone(_0x11a23d);}else{_0x4d3934['mergeFromDatabase'](_0x4d3934[_0x8d55('0x11')][util[_0x8d55('0x24')](_0x8d55('0x25'),_0x11a23d[_0x8d55('0x26')])],_0x11a23d);}}}return _0x4d3934['telephones'];};};Realtime['prototype'][_0x8d55('0x41')]=function(){var _0x5e68b3=this;return function(_0xaf4e49){if(_0xaf4e49){freeIsNotKeySip(_0xaf4e49,_0x5e68b3[_0x8d55('0x42')]);for(var _0x1c3d1c=0x0,_0x4d3cad={},_0x3bb74e={};_0x1c3d1c<_0xaf4e49[_0x8d55('0x3c')];_0x1c3d1c+=0x1){_0x4d3cad=_0xaf4e49[_0x1c3d1c];if(_[_0x8d55('0x3e')](_0x5e68b3[_0x8d55('0x42')][util[_0x8d55('0x24')]('SIP/%s',_0x4d3cad[_0x8d55('0x26')])])){_0x5e68b3[_0x8d55('0x42')][util['format'](_0x8d55('0x25'),_0x4d3cad[_0x8d55('0x26')])]=new Trunk(_0x4d3cad);}else{_0x5e68b3[_0x8d55('0x3f')](_0x5e68b3['trunks'][util[_0x8d55('0x24')]('SIP/%s',_0x4d3cad[_0x8d55('0x26')])],_0x4d3cad);}}}return _0x5e68b3[_0x8d55('0x42')];};};Realtime[_0x8d55('0x3a')]['initVoiceQueues']=function(){var _0x5cfc51=this;return function(_0x50cd2a){if(_0x50cd2a){freeIsNotKey(_0x50cd2a,_0x5cfc51[_0x8d55('0x12')],_0x8d55('0x26'));for(var _0x7f6706=0x0,_0x258a6a={},_0x1b96c5={};_0x7f6706<_0x50cd2a['length'];_0x7f6706+=0x1){_0x258a6a=_0x50cd2a[_0x7f6706];if(_[_0x8d55('0x3e')](_0x5cfc51[_0x8d55('0x12')][_0x258a6a[_0x8d55('0x26')]])){_0x5cfc51[_0x8d55('0x12')][_0x258a6a[_0x8d55('0x26')]]=new VoiceQueue(_0x258a6a);}else{_0x5cfc51[_0x8d55('0x3f')](_0x5cfc51[_0x8d55('0x12')][_0x258a6a[_0x8d55('0x26')]],_0x258a6a);}}}return _0x5cfc51[_0x8d55('0x12')];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x43')]=function(){var _0x1c024f=this;return function(_0x2bd190){if(_0x2bd190){freeIsNotKey(_0x2bd190,_0x1c024f[_0x8d55('0x44')],'id');for(var _0x2d99cd=0x0,_0xd2e685={},_0x11cf24={};_0x2d99cd<_0x2bd190[_0x8d55('0x3c')];_0x2d99cd+=0x1){_0xd2e685=_0x2bd190[_0x2d99cd];if(_[_0x8d55('0x3e')](_0x1c024f[_0x8d55('0x44')][_0xd2e685['id']])){_0x1c024f[_0x8d55('0x44')][_0xd2e685['id']]=new Trigger(_0xd2e685);}else{_0x1c024f['mergeFromDatabase'](_0x1c024f['triggers'][_0xd2e685['id']],_0xd2e685);}}}return _0x1c024f['triggers'];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x45')]=function(){var _0x142c2d=this;return function(_0x215331){if(_0x215331){freeIsNotKey(_0x215331,_0x142c2d[_0x8d55('0x13')],'id');for(var _0x124d8e=0x0,_0x521dc4={},_0x1735de={};_0x124d8e<_0x215331['length'];_0x124d8e+=0x1){_0x521dc4=_0x215331[_0x124d8e];if(_[_0x8d55('0x3e')](_0x142c2d[_0x8d55('0x13')][_0x521dc4['id']])){_0x142c2d[_0x8d55('0x13')][_0x521dc4['id']]=new Template(_0x521dc4);}else{_0x142c2d[_0x8d55('0x3f')](_0x142c2d[_0x8d55('0x13')][_0x521dc4['id']],_0x521dc4);}}}return _0x142c2d[_0x8d55('0x13')];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x46')]=function(){var _0x40250e=this;return function(_0x541a6a){if(_0x541a6a){freeIsNotKey(_0x541a6a,_0x40250e[_0x8d55('0x19')],'id');for(var _0xcafc52=0x0,_0x4138a9={},_0x4b094b={};_0xcafc52<_0x541a6a[_0x8d55('0x3c')];_0xcafc52+=0x1){_0x4138a9=_0x541a6a[_0xcafc52];if(_[_0x8d55('0x3e')](_0x40250e['zendeskAccounts'][_0x4138a9['id']])){_0x40250e[_0x8d55('0x19')][_0x4138a9['id']]=new ZendeskAccount(_0x4138a9);}else{_0x40250e[_0x8d55('0x3f')](_0x40250e[_0x8d55('0x19')][_0x4138a9['id']],_0x4138a9);}}}return _0x40250e[_0x8d55('0x19')];};};Realtime[_0x8d55('0x3a')]['initSalesforceAccounts']=function(){var _0x40f0e2=this;return function(_0x2f17b7){if(_0x2f17b7){freeIsNotKey(_0x2f17b7,_0x40f0e2[_0x8d55('0x1a')],'id');for(var _0x36227c=0x0,_0x4e60c5={},_0x325edc={};_0x36227c<_0x2f17b7[_0x8d55('0x3c')];_0x36227c+=0x1){_0x4e60c5=_0x2f17b7[_0x36227c];if(_['isUndefined'](_0x40f0e2[_0x8d55('0x1a')][_0x4e60c5['id']])){_0x40f0e2[_0x8d55('0x1a')][_0x4e60c5['id']]=new SalesforceAccount(_0x4e60c5);}else{_0x40f0e2[_0x8d55('0x3f')](_0x40f0e2[_0x8d55('0x1a')][_0x4e60c5['id']],_0x4e60c5);}}}return _0x40f0e2[_0x8d55('0x1a')];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x47')]=function(){var _0x1878d7=this;return function(_0x426a3c){if(_0x426a3c){freeIsNotKey(_0x426a3c,_0x1878d7[_0x8d55('0x1b')],'id');for(var _0x3cf784=0x0,_0x5689a2={},_0x374faa={};_0x3cf784<_0x426a3c[_0x8d55('0x3c')];_0x3cf784+=0x1){_0x5689a2=_0x426a3c[_0x3cf784];if(_[_0x8d55('0x3e')](_0x1878d7[_0x8d55('0x1b')][_0x5689a2['id']])){_0x1878d7[_0x8d55('0x1b')][_0x5689a2['id']]=new FreshdeskAccount(_0x5689a2);}else{_0x1878d7[_0x8d55('0x3f')](_0x1878d7['freshdeskAccounts'][_0x5689a2['id']],_0x5689a2);}}}return _0x1878d7[_0x8d55('0x1b')];};};Realtime['prototype'][_0x8d55('0x48')]=function(){var _0xa4c299=this;return function(_0x1fd00c){if(_0x1fd00c){freeIsNotKey(_0x1fd00c,_0xa4c299[_0x8d55('0x1c')],'id');for(var _0x36a1b9=0x0,_0xb7c835={},_0x35139f={};_0x36a1b9<_0x1fd00c[_0x8d55('0x3c')];_0x36a1b9+=0x1){_0xb7c835=_0x1fd00c[_0x36a1b9];if(_[_0x8d55('0x3e')](_0xa4c299[_0x8d55('0x1c')][_0xb7c835['id']])){_0xa4c299[_0x8d55('0x1c')][_0xb7c835['id']]=new ZohoAccount(_0xb7c835);}else{_0xa4c299[_0x8d55('0x3f')](_0xa4c299[_0x8d55('0x1c')][_0xb7c835['id']],_0xb7c835);}}}return _0xa4c299[_0x8d55('0x1c')];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x17d8b7=this;return function(_0x4b7899){if(_0x4b7899){freeIsNotKey(_0x4b7899,_0x17d8b7[_0x8d55('0x1d')],'id');for(var _0x327932=0x0,_0xd25168={},_0x3fa2b4={};_0x327932<_0x4b7899[_0x8d55('0x3c')];_0x327932+=0x1){_0xd25168=_0x4b7899[_0x327932];if(_['isUndefined'](_0x17d8b7[_0x8d55('0x1d')][_0xd25168['id']])){_0x17d8b7['deskAccounts'][_0xd25168['id']]=new DeskAccount(_0xd25168);}else{_0x17d8b7['mergeFromDatabase'](_0x17d8b7[_0x8d55('0x1d')][_0xd25168['id']],_0xd25168);}}}return _0x17d8b7['deskAccounts'];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x49')]=function(){var _0x4674d2=this;return function(_0x4cc52f){if(_0x4cc52f){freeIsNotKey(_0x4cc52f,_0x4674d2['sugarcrmAccounts'],'id');for(var _0x278ab2=0x0,_0x570870={},_0x124da0={};_0x278ab2<_0x4cc52f['length'];_0x278ab2+=0x1){_0x570870=_0x4cc52f[_0x278ab2];if(_[_0x8d55('0x3e')](_0x4674d2['sugarcrmAccounts'][_0x570870['id']])){_0x4674d2['sugarcrmAccounts'][_0x570870['id']]=new SugarcrmAccount(_0x570870);}else{_0x4674d2[_0x8d55('0x3f')](_0x4674d2[_0x8d55('0x4a')][_0x570870['id']],_0x570870);}}}return _0x4674d2['sugarcrmAccounts'];};};Realtime[_0x8d55('0x3a')]['initVtigerAccounts']=function(){var _0x2a32ad=this;return function(_0xe4978f){if(_0xe4978f){freeIsNotKey(_0xe4978f,_0x2a32ad['vtigerAccounts'],'id');for(var _0x1b1094=0x0,_0x47a2ed={},_0x32da3f={};_0x1b1094<_0xe4978f[_0x8d55('0x3c')];_0x1b1094+=0x1){_0x47a2ed=_0xe4978f[_0x1b1094];if(_['isUndefined'](_0x2a32ad[_0x8d55('0x1e')][_0x47a2ed['id']])){_0x2a32ad[_0x8d55('0x1e')][_0x47a2ed['id']]=new VtigerAccount(_0x47a2ed);}else{_0x2a32ad[_0x8d55('0x3f')](_0x2a32ad[_0x8d55('0x1e')][_0x47a2ed['id']],_0x47a2ed);}}}return _0x2a32ad['vtigerAccounts'];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x4b')]=function(){var _0x3d79d8=this;return function(_0x21c9fa){if(_0x21c9fa){freeIsNotKey(_0x21c9fa,_0x3d79d8[_0x8d55('0x1f')],'id');for(var _0x2333fb=0x0,_0x5696f2={},_0x3f33fc={};_0x2333fb<_0x21c9fa[_0x8d55('0x3c')];_0x2333fb+=0x1){_0x5696f2=_0x21c9fa[_0x2333fb];if(_[_0x8d55('0x3e')](_0x3d79d8[_0x8d55('0x1f')][_0x5696f2['id']])){_0x3d79d8['servicenowAccounts'][_0x5696f2['id']]=new ServicenowAccount(_0x5696f2);}else{_0x3d79d8[_0x8d55('0x3f')](_0x3d79d8[_0x8d55('0x1f')][_0x5696f2['id']],_0x5696f2);}}}return _0x3d79d8[_0x8d55('0x1f')];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x4c')]=function(){var _0x57456c=this;return function(_0x247119){if(_0x247119){freeIsNotKey(_0x247119,_0x57456c[_0x8d55('0x20')],'id');for(var _0x78d446=0x0,_0x55d41a={},_0x15d81a={};_0x78d446<_0x247119[_0x8d55('0x3c')];_0x78d446+=0x1){_0x55d41a=_0x247119[_0x78d446];if(_[_0x8d55('0x3e')](_0x57456c[_0x8d55('0x20')][_0x55d41a['id']])){_0x57456c[_0x8d55('0x20')][_0x55d41a['id']]=new Dynamics365Account(_0x55d41a);}else{_0x57456c[_0x8d55('0x3f')](_0x57456c['dynamics365Accounts'][_0x55d41a['id']],_0x55d41a);}}}return _0x57456c[_0x8d55('0x20')];};};Realtime[_0x8d55('0x3a')]['initVoiceQueueHopperHistory']=function(){var _0xad6286=this;return function(_0x3c3836){for(var _0x152b3f=0x0;_0x152b3f<_0x3c3836[_0x8d55('0x3c')];_0x152b3f+=0x1){_[_0x8d55('0x4d')](_0xad6286[_0x8d55('0x12')][_0x3c3836[_0x152b3f][_0x8d55('0x26')]],_0x3c3836[_0x152b3f]);}return _0xad6286['voiceQueues'];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x4e')]=function(){var _0x2238ab=this;return function(_0x21ea7a){clearVoiceQueues(_0x2238ab['voiceQueues']);if(_0x21ea7a){_0x21ea7a=_['groupBy'](_0x21ea7a,_0x8d55('0x4f'));for(var _0x2518ef in _0x21ea7a){if(_0x21ea7a['hasOwnProperty'](_0x2518ef)){var _0xf88b47={};for(var _0x50d09d=0x0;_0x50d09d<_0x21ea7a[_0x2518ef][_0x8d55('0x3c')];_0x50d09d+=0x1){var _0xad6209=_0x21ea7a[_0x2518ef][_0x50d09d][_0x8d55('0x50')];if(_0x2238ab[_0x8d55('0x12')][_0xad6209]){if(_0x21ea7a[_0x2518ef][_0x50d09d][_0x8d55('0x51')]){_0x2238ab['voiceQueues'][_0xad6209][_0x8d55('0x2e')]+=0x1;}if(_0x21ea7a[_0x2518ef][_0x50d09d][_0x8d55('0x52')]){_0x2238ab[_0x8d55('0x12')][_0xad6209][_0x8d55('0x2f')]+=0x1;}_0x2238ab['voiceQueues'][_0xad6209][_0x8d55('0x29')]+=moment(_0x21ea7a[_0x2518ef][_0x50d09d][_0x8d55('0x53')])[_0x8d55('0x54')](moment(_0x21ea7a[_0x2518ef][_0x50d09d][_0x8d55('0x55')]),_0x8d55('0x56'))||0x0;if(_0x50d09d===_0x21ea7a[_0x2518ef][_0x8d55('0x3c')]-0x1){_0x2238ab['voiceQueues'][_0xad6209]['sumDuration']+=moment(_0x21ea7a[_0x2518ef][_0x50d09d]['queuecallercompleteAt']||_0x21ea7a[_0x2518ef][_0x50d09d]['queuecallerabandonAt']||_0x21ea7a[_0x2518ef][_0x50d09d]['queuecallerexitAt'])[_0x8d55('0x54')](moment(_0x21ea7a[_0x2518ef][_0x50d09d]['queuecallerjoinAt']),_0x8d55('0x56'))||0x0;_0x2238ab[_0x8d55('0x12')][_0xad6209]['total']+=0x1;if(_0x21ea7a[_0x2518ef][_0x50d09d][_0x8d55('0x57')]){_0x2238ab[_0x8d55('0x12')][_0xad6209][_0x8d55('0x2d')]+=0x1;_0x2238ab['voiceQueues'][_0xad6209][_0x8d55('0x58')]+=moment(_0x21ea7a[_0x2518ef][_0x50d09d]['queuecallercompleteAt'])[_0x8d55('0x54')](moment(_0x21ea7a[_0x2518ef][_0x50d09d]['queuecallerleaveAt']),_0x8d55('0x56'))||0x0;}}else{_0x2238ab[_0x8d55('0x12')][_0xad6209][_0x8d55('0x2a')]+=_0x2238ab[_0x8d55('0x12')][_0xad6209][_0x8d55('0x29')]||0x0;}}}}}}return _0x2238ab[_0x8d55('0x12')];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x59')]=function(){var _0x10515f=this;return function(_0xb4a236){clearVoiceCallReports(_0x10515f[_0x8d55('0x14')]);if(_0xb4a236){for(var _0x5d1cf3=0x0;_0x5d1cf3<_0xb4a236[_0x8d55('0x3c')];_0x5d1cf3+=0x1){_0x10515f[_0x8d55('0x14')]['total']+=0x1;_0x10515f[_0x8d55('0x14')][_0x8d55('0x2a')]+=_0xb4a236[_0x5d1cf3][_0x8d55('0x5a')];if(_0xb4a236[_0x5d1cf3][_0x8d55('0x5b')]===_0x8d55('0x5c')){_0x10515f[_0x8d55('0x14')][_0x8d55('0x2d')]+=0x1;_0x10515f[_0x8d55('0x14')][_0x8d55('0x29')]+=_0xb4a236[_0x5d1cf3][_0x8d55('0x5a')]-_0xb4a236[_0x5d1cf3][_0x8d55('0x5d')]||0x0;_0x10515f['outbound'][_0x8d55('0x58')]+=_0xb4a236[_0x5d1cf3][_0x8d55('0x5d')];}}}return _0x10515f[_0x8d55('0x14')];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x5e')]=function(){var _0x1c479f=this;return function(_0x32f9bb){if(_0x32f9bb){freeIsNotKey(_0x32f9bb,_0x1c479f[_0x8d55('0x5f')],_0x8d55('0x26'));for(var _0x58a24a=0x0,_0x2388ca={};_0x58a24a<_0x32f9bb[_0x8d55('0x3c')];_0x58a24a+=0x1){_0x2388ca=_0x32f9bb[_0x58a24a];if(_[_0x8d55('0x3e')](_0x1c479f[_0x8d55('0x5f')][_0x2388ca[_0x8d55('0x26')]])){_0x1c479f[_0x8d55('0x5f')][_0x2388ca['name']]=new Campaign(_0x2388ca);}else{_0x1c479f[_0x8d55('0x3f')](_0x1c479f[_0x8d55('0x5f')][_0x2388ca[_0x8d55('0x26')]],_0x2388ca);}}}return _0x1c479f[_0x8d55('0x5f')];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x60')]=function(){var _0x45e2a2=this;return function(_0x4a3bc6){if(_0x4a3bc6){freeIsNotKey(_0x4a3bc6,_0x45e2a2[_0x8d55('0x15')],'id');for(var _0x14ccc8=0x0,_0x310e6b={};_0x14ccc8<_0x4a3bc6[_0x8d55('0x3c')];_0x14ccc8+=0x1){_0x310e6b=_0x4a3bc6[_0x14ccc8];if(_[_0x8d55('0x3e')](_0x45e2a2['voiceExtensions'][_0x310e6b['id']])){_0x45e2a2[_0x8d55('0x15')][_0x310e6b['id']]=new VoiceExtension(_0x310e6b);}else{_0x45e2a2['mergeFromDatabase'](_0x45e2a2[_0x8d55('0x15')][_0x310e6b['id']],_0x310e6b);}}}return _0x45e2a2['voiceExtensions'];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x61')]=function(){var _0x488edd=this;return function(_0x2cff99){clearCampaigns(_0x488edd['campaigns']);for(var _0x44fdbd=0x0;_0x44fdbd<_0x2cff99[_0x8d55('0x3c')];_0x44fdbd+=0x1){_['merge'](_0x488edd[_0x8d55('0x5f')][_0x2cff99[_0x44fdbd]['name']],_0x2cff99[_0x44fdbd]);}return _0x488edd[_0x8d55('0x5f')];};};Realtime[_0x8d55('0x3a')][_0x8d55('0x62')]=function(){var _0x4c5502=this;return function(_0x9f40e9){if(_0x9f40e9){freeIsNotKey(_0x9f40e9,_0x4c5502[_0x8d55('0x21')],'id');for(var _0x56daf7=0x0,_0x54e6ee={},_0x516df9={};_0x56daf7<_0x9f40e9[_0x8d55('0x3c')];_0x56daf7+=0x1){_0x54e6ee=_0x9f40e9[_0x56daf7];if(_[_0x8d55('0x3e')](_0x4c5502[_0x8d55('0x21')][_0x54e6ee['id']])){_0x4c5502[_0x8d55('0x21')][_0x54e6ee['id']]=new FaxAccount(_0x54e6ee);}else{_0x4c5502[_0x8d55('0x3f')](_0x4c5502[_0x8d55('0x21')][_0x54e6ee['id']],_0x54e6ee);}}}return _0x4c5502[_0x8d55('0x21')];};};module[_0x8d55('0x63')]=Realtime; \ No newline at end of file +var _0x0005=['ANSWERED','duration','billableseconds','initCampaigns','campaigns','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','telephones','trunks','voiceQueues','triggers','outbound','timers','zendeskAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','format','SIP/%s','hasOwnProperty','isNil','name','interface','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','abandoned','sumBillable','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','agents','initTelephones','length','isUndefined','initTrunks','initVoiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercompleteAt','initVoiceCallReports','disposition'];(function(_0x46a658,_0x5d68d7){var _0x55119f=function(_0x32583e){while(--_0x32583e){_0x46a658['push'](_0x46a658['shift']());}};_0x55119f(++_0x5d68d7);}(_0x0005,0x75));var _0x5000=function(_0x3fca0e,_0x102ab9){_0x3fca0e=_0x3fca0e-0x0;var _0x4d21be=_0x0005[_0x3fca0e];return _0x4d21be;};'use strict';var BPromise=require(_0x5000('0x0'));var util=require(_0x5000('0x1'));var _=require(_0x5000('0x2'));var moment=require(_0x5000('0x3'));var Agent=require(_0x5000('0x4'));var Telephone=require(_0x5000('0x5'));var Trunk=require(_0x5000('0x6'));var VoiceQueue=require(_0x5000('0x7'));var Trigger=require('../model/trigger');var Template=require(_0x5000('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x5000('0x9'));var ZendeskAccount=require(_0x5000('0xa'));var SalesforceAccount=require(_0x5000('0xb'));var FreshdeskAccount=require(_0x5000('0xc'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x5000('0xd'));var VtigerAccount=require(_0x5000('0xe'));var ServicenowAccount=require(_0x5000('0xf'));var Dynamics365Account=require(_0x5000('0x10'));var FaxAccount=require(_0x5000('0x11'));var Realtime=function(){this['agents']={};this[_0x5000('0x12')]={};this[_0x5000('0x13')]={};this[_0x5000('0x14')]={};this[_0x5000('0x15')]={};this['campaigns']={};this['templates']={};this[_0x5000('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this['queueChannels']={};this['outboundChannels']={};this[_0x5000('0x17')]={};this[_0x5000('0x18')]={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this[_0x5000('0x19')]={};this[_0x5000('0x1a')]={};this[_0x5000('0x1b')]={};this[_0x5000('0x1c')]={};this['servicenowAccounts']={};this[_0x5000('0x1d')]={};this[_0x5000('0x1e')]={};};function freeIsNotKey(_0x1c7db0,_0x3ad82f,_0x2aede7){var _0x9d3839=_[_0x5000('0x1f')](_0x1c7db0,function(_0x50625d,_0x565a64){return _0x50625d[_0x2aede7];});for(var _0x2bf2bd in _0x3ad82f){if(_0x3ad82f['hasOwnProperty'](_0x2bf2bd)){if(!_0x9d3839[_0x2bf2bd]){delete _0x3ad82f[_0x2bf2bd];}}}}function freeIsNotKeySip(_0xad603c,_0x258422){var _0x466667=_['mapKeys'](_0xad603c,function(_0x51f92e,_0xf4aad0){return util[_0x5000('0x20')](_0x5000('0x21'),_0x51f92e['name']);});for(var _0x676c2a in _0x258422){if(_0x258422[_0x5000('0x22')](_0x676c2a)){if(!_0x466667[_0x676c2a]){delete _0x258422[_0x676c2a];}}}}function freeIsNotKeyAgent(_0x3b1f97,_0x47971b){var _0x1e2e76=_[_0x5000('0x1f')](_0x3b1f97,function(_0x243ef4,_0x4f385c){var _0x51638d=_[_0x5000('0x23')](_0x243ef4['interface'])?util[_0x5000('0x20')](_0x5000('0x21'),_0x243ef4[_0x5000('0x24')]):_0x243ef4[_0x5000('0x25')];return _0x51638d;});for(var _0x1c652c in _0x47971b){if(_0x47971b[_0x5000('0x22')](_0x1c652c)){if(!_0x1e2e76[_0x1c652c]){delete _0x47971b[_0x1c652c];}}}}function clearVoiceCallReports(_0x55f05f){_0x55f05f['total']=0x0;_0x55f05f[_0x5000('0x26')]=0x0;_0x55f05f[_0x5000('0x27')]=0x0;_0x55f05f[_0x5000('0x28')]=0x0;_0x55f05f['sumBillable']=0x0;}function clearCampaigns(_0x53334a){if(!_[_0x5000('0x29')](_0x53334a)){for(var _0x267f7f in _0x53334a){if(_0x53334a[_0x5000('0x22')](_0x267f7f)){_0x53334a[_0x267f7f][_0x5000('0x2a')]=0x0;_0x53334a[_0x267f7f][_0x5000('0x2b')]=0x0;}}}}function clearVoiceQueues(_0xfa989){if(!_[_0x5000('0x29')](_0xfa989)){for(var _0x91d925 in _0xfa989){if(_0xfa989[_0x5000('0x22')](_0x91d925)){_0xfa989[_0x91d925][_0x5000('0x2c')]=0x0;_0xfa989[_0x91d925][_0x5000('0x26')]=0x0;_0xfa989[_0x91d925][_0x5000('0x2d')]=0x0;_0xfa989[_0x91d925][_0x5000('0x2e')]=0x0;_0xfa989[_0x91d925][_0x5000('0x27')]=0x0;_0xfa989[_0x91d925][_0x5000('0x28')]=0x0;_0xfa989[_0x91d925][_0x5000('0x2f')]=0x0;_0xfa989[_0x91d925]['outboundAnswerAgiCallsDay']=0x0;_0xfa989[_0x91d925][_0x5000('0x30')]=0x0;_0xfa989[_0x91d925][_0x5000('0x31')]=0x0;_0xfa989[_0x91d925][_0x5000('0x32')]=0x0;_0xfa989[_0x91d925][_0x5000('0x33')]=0x0;_0xfa989[_0x91d925][_0x5000('0x34')]=0x0;_0xfa989[_0x91d925][_0x5000('0x35')]=0x0;_0xfa989[_0x91d925][_0x5000('0x36')]=0x0;_0xfa989[_0x91d925][_0x5000('0x37')]=0x0;_0xfa989[_0x91d925][_0x5000('0x38')]=0x0;_0xfa989[_0x91d925]['outboundRejectCallsDay']=0x0;_0xfa989[_0x91d925][_0x5000('0x39')]=0x0;_0xfa989[_0x91d925][_0x5000('0x3a')]=0x0;_0xfa989[_0x91d925][_0x5000('0x3b')]=0x0;_0xfa989[_0x91d925][_0x5000('0x3c')]=!![];}}}}Realtime[_0x5000('0x3d')][_0x5000('0x3e')]=function(_0x529df8,_0x15fb1e){for(var _0x12503f in _0x15fb1e){if(_0x529df8[_0x5000('0x22')](_0x12503f)){_0x529df8[_0x12503f]=_0x15fb1e[_0x12503f];}}};Realtime[_0x5000('0x3d')]['initAgents']=function(){var _0x221c12=this;return function(_0x5d89f0){if(_0x5d89f0){freeIsNotKeyAgent(_0x5d89f0,_0x221c12[_0x5000('0x3f')]);for(var _0x58bf28=0x0,_0x49f109={},_0x3b2785={};_0x58bf28<_0x5d89f0['length'];_0x58bf28+=0x1){_0x49f109=_0x5d89f0[_0x58bf28];var _0x5aa7b1=_[_0x5000('0x23')](_0x49f109[_0x5000('0x25')])?util[_0x5000('0x20')](_0x5000('0x21'),_0x49f109[_0x5000('0x24')]):_0x49f109[_0x5000('0x25')];if(_['isUndefined'](_0x221c12[_0x5000('0x3f')][_0x5aa7b1])){_0x221c12['agents'][_0x5aa7b1]=new Agent(_0x49f109);}else{_0x221c12[_0x5000('0x3e')](_0x221c12[_0x5000('0x3f')][_0x5aa7b1],_0x49f109);}}}return _0x221c12['agents'];};};Realtime['prototype'][_0x5000('0x40')]=function(){var _0x4b97aa=this;return function(_0x31b55d){if(_0x31b55d){freeIsNotKeySip(_0x31b55d,_0x4b97aa[_0x5000('0x12')]);for(var _0x2e360c=0x0,_0x515636={},_0x3ecfa5={};_0x2e360c<_0x31b55d[_0x5000('0x41')];_0x2e360c+=0x1){_0x515636=_0x31b55d[_0x2e360c];if(_[_0x5000('0x42')](_0x4b97aa[_0x5000('0x12')][util[_0x5000('0x20')]('SIP/%s',_0x515636[_0x5000('0x24')])])){_0x4b97aa['telephones'][util[_0x5000('0x20')]('SIP/%s',_0x515636[_0x5000('0x24')])]=new Telephone(_0x515636);}else{_0x4b97aa[_0x5000('0x3e')](_0x4b97aa[_0x5000('0x12')][util[_0x5000('0x20')](_0x5000('0x21'),_0x515636[_0x5000('0x24')])],_0x515636);}}}return _0x4b97aa[_0x5000('0x12')];};};Realtime['prototype'][_0x5000('0x43')]=function(){var _0xe9d374=this;return function(_0x42eb79){if(_0x42eb79){freeIsNotKeySip(_0x42eb79,_0xe9d374[_0x5000('0x13')]);for(var _0x1b705f=0x0,_0x88e954={},_0x384674={};_0x1b705f<_0x42eb79[_0x5000('0x41')];_0x1b705f+=0x1){_0x88e954=_0x42eb79[_0x1b705f];if(_['isUndefined'](_0xe9d374[_0x5000('0x13')][util['format']('SIP/%s',_0x88e954[_0x5000('0x24')])])){_0xe9d374[_0x5000('0x13')][util[_0x5000('0x20')](_0x5000('0x21'),_0x88e954['name'])]=new Trunk(_0x88e954);}else{_0xe9d374[_0x5000('0x3e')](_0xe9d374[_0x5000('0x13')][util[_0x5000('0x20')](_0x5000('0x21'),_0x88e954[_0x5000('0x24')])],_0x88e954);}}}return _0xe9d374[_0x5000('0x13')];};};Realtime[_0x5000('0x3d')][_0x5000('0x44')]=function(){var _0xed1fb8=this;return function(_0x5c6e5f){if(_0x5c6e5f){freeIsNotKey(_0x5c6e5f,_0xed1fb8[_0x5000('0x14')],_0x5000('0x24'));for(var _0x5889e9=0x0,_0x24cf4b={},_0x326f8d={};_0x5889e9<_0x5c6e5f[_0x5000('0x41')];_0x5889e9+=0x1){_0x24cf4b=_0x5c6e5f[_0x5889e9];if(_[_0x5000('0x42')](_0xed1fb8[_0x5000('0x14')][_0x24cf4b[_0x5000('0x24')]])){_0xed1fb8[_0x5000('0x14')][_0x24cf4b[_0x5000('0x24')]]=new VoiceQueue(_0x24cf4b);}else{_0xed1fb8['mergeFromDatabase'](_0xed1fb8['voiceQueues'][_0x24cf4b[_0x5000('0x24')]],_0x24cf4b);}}}return _0xed1fb8['voiceQueues'];};};Realtime[_0x5000('0x3d')][_0x5000('0x45')]=function(){var _0x238e90=this;return function(_0x133b85){if(_0x133b85){freeIsNotKey(_0x133b85,_0x238e90[_0x5000('0x15')],'id');for(var _0xf6e32c=0x0,_0x4ef4f7={},_0x597bce={};_0xf6e32c<_0x133b85[_0x5000('0x41')];_0xf6e32c+=0x1){_0x4ef4f7=_0x133b85[_0xf6e32c];if(_[_0x5000('0x42')](_0x238e90[_0x5000('0x15')][_0x4ef4f7['id']])){_0x238e90[_0x5000('0x15')][_0x4ef4f7['id']]=new Trigger(_0x4ef4f7);}else{_0x238e90['mergeFromDatabase'](_0x238e90[_0x5000('0x15')][_0x4ef4f7['id']],_0x4ef4f7);}}}return _0x238e90[_0x5000('0x15')];};};Realtime['prototype'][_0x5000('0x46')]=function(){var _0x22571b=this;return function(_0x5d7be5){if(_0x5d7be5){freeIsNotKey(_0x5d7be5,_0x22571b[_0x5000('0x47')],'id');for(var _0x1e0e67=0x0,_0x5f17bc={},_0x1ed035={};_0x1e0e67<_0x5d7be5['length'];_0x1e0e67+=0x1){_0x5f17bc=_0x5d7be5[_0x1e0e67];if(_[_0x5000('0x42')](_0x22571b[_0x5000('0x47')][_0x5f17bc['id']])){_0x22571b[_0x5000('0x47')][_0x5f17bc['id']]=new Template(_0x5f17bc);}else{_0x22571b[_0x5000('0x3e')](_0x22571b[_0x5000('0x47')][_0x5f17bc['id']],_0x5f17bc);}}}return _0x22571b[_0x5000('0x47')];};};Realtime['prototype'][_0x5000('0x48')]=function(){var _0x5e3942=this;return function(_0x352798){if(_0x352798){freeIsNotKey(_0x352798,_0x5e3942[_0x5000('0x18')],'id');for(var _0x3562b0=0x0,_0x586b6f={},_0x41c57a={};_0x3562b0<_0x352798[_0x5000('0x41')];_0x3562b0+=0x1){_0x586b6f=_0x352798[_0x3562b0];if(_[_0x5000('0x42')](_0x5e3942[_0x5000('0x18')][_0x586b6f['id']])){_0x5e3942[_0x5000('0x18')][_0x586b6f['id']]=new ZendeskAccount(_0x586b6f);}else{_0x5e3942['mergeFromDatabase'](_0x5e3942[_0x5000('0x18')][_0x586b6f['id']],_0x586b6f);}}}return _0x5e3942[_0x5000('0x18')];};};Realtime[_0x5000('0x3d')]['initSalesforceAccounts']=function(){var _0x570ff1=this;return function(_0x238599){if(_0x238599){freeIsNotKey(_0x238599,_0x570ff1[_0x5000('0x49')],'id');for(var _0x538731=0x0,_0xd104c1={},_0x24cab8={};_0x538731<_0x238599[_0x5000('0x41')];_0x538731+=0x1){_0xd104c1=_0x238599[_0x538731];if(_[_0x5000('0x42')](_0x570ff1[_0x5000('0x49')][_0xd104c1['id']])){_0x570ff1['salesforceAccounts'][_0xd104c1['id']]=new SalesforceAccount(_0xd104c1);}else{_0x570ff1[_0x5000('0x3e')](_0x570ff1['salesforceAccounts'][_0xd104c1['id']],_0xd104c1);}}}return _0x570ff1[_0x5000('0x49')];};};Realtime['prototype'][_0x5000('0x4a')]=function(){var _0x32b57b=this;return function(_0x2989eb){if(_0x2989eb){freeIsNotKey(_0x2989eb,_0x32b57b[_0x5000('0x19')],'id');for(var _0x3bd23a=0x0,_0x31335b={},_0x447d78={};_0x3bd23a<_0x2989eb[_0x5000('0x41')];_0x3bd23a+=0x1){_0x31335b=_0x2989eb[_0x3bd23a];if(_['isUndefined'](_0x32b57b[_0x5000('0x19')][_0x31335b['id']])){_0x32b57b[_0x5000('0x19')][_0x31335b['id']]=new FreshdeskAccount(_0x31335b);}else{_0x32b57b[_0x5000('0x3e')](_0x32b57b[_0x5000('0x19')][_0x31335b['id']],_0x31335b);}}}return _0x32b57b[_0x5000('0x19')];};};Realtime[_0x5000('0x3d')][_0x5000('0x4b')]=function(){var _0x1d6a1b=this;return function(_0x746845){if(_0x746845){freeIsNotKey(_0x746845,_0x1d6a1b[_0x5000('0x1a')],'id');for(var _0x132f2e=0x0,_0x34af39={},_0x1e263a={};_0x132f2e<_0x746845[_0x5000('0x41')];_0x132f2e+=0x1){_0x34af39=_0x746845[_0x132f2e];if(_[_0x5000('0x42')](_0x1d6a1b[_0x5000('0x1a')][_0x34af39['id']])){_0x1d6a1b[_0x5000('0x1a')][_0x34af39['id']]=new ZohoAccount(_0x34af39);}else{_0x1d6a1b[_0x5000('0x3e')](_0x1d6a1b[_0x5000('0x1a')][_0x34af39['id']],_0x34af39);}}}return _0x1d6a1b[_0x5000('0x1a')];};};Realtime[_0x5000('0x3d')][_0x5000('0x4c')]=function(){var _0x3e74a4=this;return function(_0x51d80b){if(_0x51d80b){freeIsNotKey(_0x51d80b,_0x3e74a4['deskAccounts'],'id');for(var _0x516cd0=0x0,_0x56f3e4={},_0x574ec3={};_0x516cd0<_0x51d80b[_0x5000('0x41')];_0x516cd0+=0x1){_0x56f3e4=_0x51d80b[_0x516cd0];if(_[_0x5000('0x42')](_0x3e74a4[_0x5000('0x1b')][_0x56f3e4['id']])){_0x3e74a4['deskAccounts'][_0x56f3e4['id']]=new DeskAccount(_0x56f3e4);}else{_0x3e74a4[_0x5000('0x3e')](_0x3e74a4[_0x5000('0x1b')][_0x56f3e4['id']],_0x56f3e4);}}}return _0x3e74a4[_0x5000('0x1b')];};};Realtime[_0x5000('0x3d')][_0x5000('0x4d')]=function(){var _0x2d31a3=this;return function(_0x388cb0){if(_0x388cb0){freeIsNotKey(_0x388cb0,_0x2d31a3[_0x5000('0x4e')],'id');for(var _0xc83fb9=0x0,_0x178c44={},_0x3cf4b3={};_0xc83fb9<_0x388cb0[_0x5000('0x41')];_0xc83fb9+=0x1){_0x178c44=_0x388cb0[_0xc83fb9];if(_['isUndefined'](_0x2d31a3[_0x5000('0x4e')][_0x178c44['id']])){_0x2d31a3[_0x5000('0x4e')][_0x178c44['id']]=new SugarcrmAccount(_0x178c44);}else{_0x2d31a3[_0x5000('0x3e')](_0x2d31a3[_0x5000('0x4e')][_0x178c44['id']],_0x178c44);}}}return _0x2d31a3[_0x5000('0x4e')];};};Realtime[_0x5000('0x3d')][_0x5000('0x4f')]=function(){var _0x34e244=this;return function(_0xe20ea6){if(_0xe20ea6){freeIsNotKey(_0xe20ea6,_0x34e244[_0x5000('0x1c')],'id');for(var _0x3c18da=0x0,_0x2124a8={},_0x478275={};_0x3c18da<_0xe20ea6['length'];_0x3c18da+=0x1){_0x2124a8=_0xe20ea6[_0x3c18da];if(_[_0x5000('0x42')](_0x34e244[_0x5000('0x1c')][_0x2124a8['id']])){_0x34e244['vtigerAccounts'][_0x2124a8['id']]=new VtigerAccount(_0x2124a8);}else{_0x34e244[_0x5000('0x3e')](_0x34e244[_0x5000('0x1c')][_0x2124a8['id']],_0x2124a8);}}}return _0x34e244[_0x5000('0x1c')];};};Realtime[_0x5000('0x3d')][_0x5000('0x50')]=function(){var _0x350dfa=this;return function(_0x3d3214){if(_0x3d3214){freeIsNotKey(_0x3d3214,_0x350dfa[_0x5000('0x51')],'id');for(var _0x4c772a=0x0,_0x3dfd38={},_0x55552d={};_0x4c772a<_0x3d3214[_0x5000('0x41')];_0x4c772a+=0x1){_0x3dfd38=_0x3d3214[_0x4c772a];if(_[_0x5000('0x42')](_0x350dfa[_0x5000('0x51')][_0x3dfd38['id']])){_0x350dfa[_0x5000('0x51')][_0x3dfd38['id']]=new ServicenowAccount(_0x3dfd38);}else{_0x350dfa['mergeFromDatabase'](_0x350dfa[_0x5000('0x51')][_0x3dfd38['id']],_0x3dfd38);}}}return _0x350dfa[_0x5000('0x51')];};};Realtime[_0x5000('0x3d')][_0x5000('0x52')]=function(){var _0x191c55=this;return function(_0x43c1b5){if(_0x43c1b5){freeIsNotKey(_0x43c1b5,_0x191c55[_0x5000('0x1d')],'id');for(var _0x451d95=0x0,_0x522d12={},_0x463ed1={};_0x451d95<_0x43c1b5[_0x5000('0x41')];_0x451d95+=0x1){_0x522d12=_0x43c1b5[_0x451d95];if(_['isUndefined'](_0x191c55[_0x5000('0x1d')][_0x522d12['id']])){_0x191c55['dynamics365Accounts'][_0x522d12['id']]=new Dynamics365Account(_0x522d12);}else{_0x191c55[_0x5000('0x3e')](_0x191c55[_0x5000('0x1d')][_0x522d12['id']],_0x522d12);}}}return _0x191c55[_0x5000('0x1d')];};};Realtime['prototype'][_0x5000('0x53')]=function(){var _0x5b317a=this;return function(_0x10c595){for(var _0x555279=0x0;_0x555279<_0x10c595[_0x5000('0x41')];_0x555279+=0x1){_[_0x5000('0x54')](_0x5b317a['voiceQueues'][_0x10c595[_0x555279][_0x5000('0x24')]],_0x10c595[_0x555279]);}return _0x5b317a['voiceQueues'];};};Realtime[_0x5000('0x3d')][_0x5000('0x55')]=function(){var _0x5c8e9f=this;return function(_0x59c695){clearVoiceQueues(_0x5c8e9f['voiceQueues']);if(_0x59c695){_0x59c695=_[_0x5000('0x56')](_0x59c695,_0x5000('0x57'));for(var _0x392bfa in _0x59c695){if(_0x59c695[_0x5000('0x22')](_0x392bfa)){var _0x2b02b6={};for(var _0x4788e8=0x0;_0x4788e8<_0x59c695[_0x392bfa][_0x5000('0x41')];_0x4788e8+=0x1){var _0x1bc690=_0x59c695[_0x392bfa][_0x4788e8][_0x5000('0x58')];if(_0x5c8e9f[_0x5000('0x14')][_0x1bc690]){if(_0x59c695[_0x392bfa][_0x4788e8][_0x5000('0x59')]){_0x5c8e9f[_0x5000('0x14')][_0x1bc690][_0x5000('0x2d')]+=0x1;}if(_0x59c695[_0x392bfa][_0x4788e8]['queuecallerabandon']){_0x5c8e9f[_0x5000('0x14')][_0x1bc690][_0x5000('0x2e')]+=0x1;}_0x5c8e9f[_0x5000('0x14')][_0x1bc690]['sumHoldTime']+=moment(_0x59c695[_0x392bfa][_0x4788e8][_0x5000('0x5a')])[_0x5000('0x5b')](moment(_0x59c695[_0x392bfa][_0x4788e8][_0x5000('0x5c')]),_0x5000('0x5d'))||0x0;if(_0x4788e8===_0x59c695[_0x392bfa][_0x5000('0x41')]-0x1){_0x5c8e9f['voiceQueues'][_0x1bc690][_0x5000('0x28')]+=moment(_0x59c695[_0x392bfa][_0x4788e8]['queuecallercompleteAt']||_0x59c695[_0x392bfa][_0x4788e8][_0x5000('0x5e')]||_0x59c695[_0x392bfa][_0x4788e8][_0x5000('0x5f')])['diff'](moment(_0x59c695[_0x392bfa][_0x4788e8][_0x5000('0x5c')]),'seconds')||0x0;_0x5c8e9f[_0x5000('0x14')][_0x1bc690][_0x5000('0x2c')]+=0x1;if(_0x59c695[_0x392bfa][_0x4788e8]['queuecallercomplete']){_0x5c8e9f[_0x5000('0x14')][_0x1bc690][_0x5000('0x26')]+=0x1;_0x5c8e9f[_0x5000('0x14')][_0x1bc690][_0x5000('0x2f')]+=moment(_0x59c695[_0x392bfa][_0x4788e8][_0x5000('0x60')])['diff'](moment(_0x59c695[_0x392bfa][_0x4788e8][_0x5000('0x5a')]),_0x5000('0x5d'))||0x0;}}else{_0x5c8e9f[_0x5000('0x14')][_0x1bc690]['sumDuration']+=_0x5c8e9f[_0x5000('0x14')][_0x1bc690][_0x5000('0x27')]||0x0;}}}}}}return _0x5c8e9f[_0x5000('0x14')];};};Realtime[_0x5000('0x3d')][_0x5000('0x61')]=function(){var _0x39f41e=this;return function(_0x534e60){clearVoiceCallReports(_0x39f41e[_0x5000('0x16')]);if(_0x534e60){for(var _0x5367c1=0x0;_0x5367c1<_0x534e60[_0x5000('0x41')];_0x5367c1+=0x1){_0x39f41e['outbound'][_0x5000('0x2c')]+=0x1;_0x39f41e['outbound'][_0x5000('0x28')]+=_0x534e60[_0x5367c1]['duration'];if(_0x534e60[_0x5367c1][_0x5000('0x62')]===_0x5000('0x63')){_0x39f41e[_0x5000('0x16')][_0x5000('0x26')]+=0x1;_0x39f41e[_0x5000('0x16')]['sumHoldTime']+=_0x534e60[_0x5367c1][_0x5000('0x64')]-_0x534e60[_0x5367c1][_0x5000('0x65')]||0x0;_0x39f41e[_0x5000('0x16')]['sumBillable']+=_0x534e60[_0x5367c1][_0x5000('0x65')];}}}return _0x39f41e['outbound'];};};Realtime['prototype'][_0x5000('0x66')]=function(){var _0x15f2e3=this;return function(_0x7c7128){if(_0x7c7128){freeIsNotKey(_0x7c7128,_0x15f2e3[_0x5000('0x67')],_0x5000('0x24'));for(var _0xbc76b3=0x0,_0x253da3={};_0xbc76b3<_0x7c7128[_0x5000('0x41')];_0xbc76b3+=0x1){_0x253da3=_0x7c7128[_0xbc76b3];if(_[_0x5000('0x42')](_0x15f2e3[_0x5000('0x67')][_0x253da3['name']])){_0x15f2e3[_0x5000('0x67')][_0x253da3[_0x5000('0x24')]]=new Campaign(_0x253da3);}else{_0x15f2e3[_0x5000('0x3e')](_0x15f2e3[_0x5000('0x67')][_0x253da3[_0x5000('0x24')]],_0x253da3);}}}return _0x15f2e3[_0x5000('0x67')];};};Realtime[_0x5000('0x3d')][_0x5000('0x68')]=function(){var _0x39bb3d=this;return function(_0x54b2f3){if(_0x54b2f3){freeIsNotKey(_0x54b2f3,_0x39bb3d[_0x5000('0x69')],'id');for(var _0x356e5a=0x0,_0x4fab09={};_0x356e5a<_0x54b2f3[_0x5000('0x41')];_0x356e5a+=0x1){_0x4fab09=_0x54b2f3[_0x356e5a];if(_[_0x5000('0x42')](_0x39bb3d[_0x5000('0x69')][_0x4fab09['id']])){_0x39bb3d[_0x5000('0x69')][_0x4fab09['id']]=new VoiceExtension(_0x4fab09);}else{_0x39bb3d[_0x5000('0x3e')](_0x39bb3d[_0x5000('0x69')][_0x4fab09['id']],_0x4fab09);}}}return _0x39bb3d[_0x5000('0x69')];};};Realtime[_0x5000('0x3d')][_0x5000('0x6a')]=function(){var _0x545715=this;return function(_0x3769f6){clearCampaigns(_0x545715[_0x5000('0x67')]);for(var _0x503d63=0x0;_0x503d63<_0x3769f6['length'];_0x503d63+=0x1){_[_0x5000('0x54')](_0x545715[_0x5000('0x67')][_0x3769f6[_0x503d63]['name']],_0x3769f6[_0x503d63]);}return _0x545715['campaigns'];};};Realtime[_0x5000('0x3d')][_0x5000('0x6b')]=function(){var _0x2641ce=this;return function(_0x324c9f){if(_0x324c9f){freeIsNotKey(_0x324c9f,_0x2641ce['faxAccounts'],'id');for(var _0x462b50=0x0,_0x31a04f={},_0x2a935d={};_0x462b50<_0x324c9f['length'];_0x462b50+=0x1){_0x31a04f=_0x324c9f[_0x462b50];if(_['isUndefined'](_0x2641ce['faxAccounts'][_0x31a04f['id']])){_0x2641ce[_0x5000('0x1e')][_0x31a04f['id']]=new FaxAccount(_0x31a04f);}else{_0x2641ce['mergeFromDatabase'](_0x2641ce[_0x5000('0x1e')][_0x31a04f['id']],_0x31a04f);}}}return _0x2641ce[_0x5000('0x1e')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index e0e8325..9f66489 100644 --- a/server/services/ami/report/index.js +++ b/server/services/ami/report/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafa3=['indexOf','mobile','phone','lastIndexOf','bluebird','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','agents','telephones','sync','realtime','xdr','disabled','custom:voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','prototype','find','accountcode','name','isNil','interface','format','SIP/%s','voiceQueueReport','findAgent','connectedlinenum','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','destination','exten','type','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','disposition','ANSWERED','calleridname','monitor','monitors','length','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','forEach','voiceDialReport','startsWith'];(function(_0x1c14ae,_0x25ecce){var _0x24c7cf=function(_0x167c24){while(--_0x167c24){_0x1c14ae['push'](_0x1c14ae['shift']());}};_0x24c7cf(++_0x25ecce);}(_0xafa3,0x199));var _0x3afa=function(_0x1dc484,_0x46350a){_0x1dc484=_0x1dc484-0x0;var _0x5cf305=_0xafa3[_0x1dc484];return _0x5cf305;};'use strict';var BPromise=require(_0x3afa('0x0'));var _=require(_0x3afa('0x1'));var moment=require(_0x3afa('0x2'));var util=require(_0x3afa('0x3'));var config=require(_0x3afa('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x3afa('0x5'));var RpcVoiceAgentReport=require(_0x3afa('0x6'));var RpcVoiceCallReport=require(_0x3afa('0x7'));var RpcVoiceDialReport=require(_0x3afa('0x8'));var RpcMemberReport=require(_0x3afa('0x9'));var RpcVoiceQueueReport=require(_0x3afa('0xa'));var RpcVoiceRecording=require(_0x3afa('0xb'));var RpcVoiceTransferReport=require(_0x3afa('0xc'));var VoiceQueueReport=require(_0x3afa('0xd'));var VoiceCallReport=require(_0x3afa('0xe'));var VoiceAgentReport=require(_0x3afa('0xf'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x3afa('0x10'));function Report(_0x2f4a19){this['realtime']=_0x2f4a19;this[_0x3afa('0x11')]=_0x2f4a19[_0x3afa('0x11')];this[_0x3afa('0x12')]=_0x2f4a19[_0x3afa('0x12')];}Report['prototype'][_0x3afa('0x13')]=function(_0x7e916e){var _0x54278d=new VoiceQueueReport(this[_0x3afa('0x14')]);var _0x125832=new VoiceAgentReport(this[_0x3afa('0x14')]);var _0x58dbbc=new VoiceDialReport(this[_0x3afa('0x14')]);var _0x431ddd=new VoiceCallReport(this[_0x3afa('0x14')]);var _0x466dfb=new UserReport(this[_0x3afa('0x14')]);if(config[_0x3afa('0x15')]&&config[_0x3afa('0x15')][_0x3afa('0x16')]){ami['on'](_0x3afa('0x17'),this['voiceQueueReport'][_0x3afa('0x18')](this));ami['on']('custom:voiceCallReport',this[_0x3afa('0x19')][_0x3afa('0x18')](this));ami['on'](_0x3afa('0x1a'),this[_0x3afa('0x1b')]['bind'](this));ami['on'](_0x3afa('0x1c'),this['voiceDialReport'][_0x3afa('0x18')](this));ami['on']('blindtransfer',this[_0x3afa('0x1d')][_0x3afa('0x18')](this));ami['on'](_0x3afa('0x1e'),this[_0x3afa('0x1f')][_0x3afa('0x18')](this));}};Report[_0x3afa('0x20')]['findAgent']=function(_0x182fc7){var _0x4e5ee9=undefined;_0x4e5ee9=_[_0x3afa('0x21')](this[_0x3afa('0x11')],function(_0x26d5b8){return _0x26d5b8[_0x3afa('0x22')]==_0x182fc7||_0x26d5b8[_0x3afa('0x23')]==_0x182fc7;});if(_[_0x3afa('0x24')](_0x4e5ee9)){var _0xb28613=_[_0x3afa('0x21')](this[_0x3afa('0x12')],function(_0x5abe27){return _0x5abe27[_0x3afa('0x22')]==_0x182fc7||_0x5abe27[_0x3afa('0x23')]==_0x182fc7;});if(_0xb28613){_0x4e5ee9=_['find'](this[_0x3afa('0x11')],function(_0x2ce3a9){return _0x2ce3a9[_0x3afa('0x25')]==util[_0x3afa('0x26')](_0x3afa('0x27'),_0xb28613[_0x3afa('0x23')]);});}}return _0x4e5ee9;};Report['prototype'][_0x3afa('0x28')]=function(_0x176c2e){for(var _0x31119b=0x0;_0x31119b<_0x176c2e['length'];_0x31119b+=0x1){var _0x50474d=this[_0x3afa('0x29')](_0x176c2e[_0x31119b][_0x3afa('0x2a')]);if(_0x50474d){_0x176c2e[_0x31119b]['accountcode']=_0x50474d[_0x3afa('0x22')];_0x176c2e[_0x31119b]['assigned']=!![];_0x176c2e[_0x31119b][_0x3afa('0x2b')]=_0x50474d[_0x3afa('0x23')];_0x176c2e[_0x31119b]['interface']=_['isNil'](_0x50474d[_0x3afa('0x25')])?util[_0x3afa('0x26')](_0x3afa('0x27'),_0x50474d['name']):_0x50474d[_0x3afa('0x25')];if(_0x176c2e[_0x31119b]['queuecallercomplete']){_0x176c2e[_0x31119b][_0x3afa('0x2c')]=moment()[_0x3afa('0x26')](_0x3afa('0x2d'));}if(_0x176c2e[_0x31119b][_0x3afa('0x2e')]){_0x176c2e[_0x31119b]['queuecallerexitAt']=moment()['format'](_0x3afa('0x2d'));}RpcMemberReport[_0x3afa('0x28')](_0x176c2e[_0x31119b]);}RpcVoiceQueueReport[_0x3afa('0x2f')](_0x176c2e[_0x31119b]);}};function extractCalleridNumber(_0x15d353){var _0xd902a7=_0x15d353[_0x3afa('0x30')](/<(.*?)>/);return _0xd902a7?_0xd902a7[0x1]:_0x15d353;}Report['prototype'][_0x3afa('0x19')]=function(_0xb1574a){_0xb1574a[_0x3afa('0x31')]=_0xb1574a[_0x3afa('0x31')]||_0xb1574a[_0x3afa('0x32')];if(_0xb1574a[_0x3afa('0x33')]=='dialer'){_0xb1574a['lastapplication']=_0x3afa('0x34');_0xb1574a['lastdata']=_0xb1574a[_0x3afa('0x34')];if(_0xb1574a[_0x3afa('0x35')]==_0x3afa('0x36')){_0xb1574a[_0x3afa('0x22')]='';_0xb1574a[_0x3afa('0x31')]=extractCalleridNumber(_0xb1574a[_0x3afa('0x37')]);}else if(_0xb1574a['context']==_0x3afa('0x38')){if(_0xb1574a[_0x3afa('0x31')]==_0x3afa('0x39')){_0xb1574a[_0x3afa('0x31')]=extractCalleridNumber(_0xb1574a[_0x3afa('0x3a')]);_0xb1574a[_0x3afa('0x3b')]=_0xb1574a['originatecalleridnum'];_0xb1574a[_0x3afa('0x3c')]=[_0xb1574a[_0x3afa('0x3d')],_0xb1574a[_0x3afa('0x3d')]=_0xb1574a[_0x3afa('0x3c')]][0x0];_0xb1574a[_0x3afa('0x37')]=_0xb1574a[_0x3afa('0x3a')];}else{_0xb1574a[_0x3afa('0x31')]=_0xb1574a[_0x3afa('0x3b')];_0xb1574a['calleridnum']=_0xb1574a[_0x3afa('0x3e')];if(_0xb1574a[_0x3afa('0x3f')]==_0x3afa('0x40')){_0xb1574a[_0x3afa('0x22')]=_0xb1574a[_0x3afa('0x2a')];}else{_0xb1574a['accountcode']='';}}}}else{_0xb1574a[_0x3afa('0x37')]=util['format']('\x22%s\x22\x20<%s>',_0xb1574a[_0x3afa('0x41')],_0xb1574a[_0x3afa('0x3b')]);}RpcVoiceCallReport[_0x3afa('0x2f')](_0xb1574a);if(_0xb1574a[_0x3afa('0x42')]){for(var _0x14b305=0x0;_0x14b305<_0xb1574a[_0x3afa('0x43')][_0x3afa('0x44')];_0x14b305+=0x1){_0xb1574a['monitorFilename']=_0xb1574a[_0x3afa('0x43')][_0x14b305][_0x3afa('0x45')];_0xb1574a['createdAt']=_0xb1574a['monitors'][_0x14b305][_0x3afa('0x46')];if(_0xb1574a[_0x3afa('0x32')]==_0x3afa('0x39')){_0xb1574a[_0x3afa('0x3b')]=_0xb1574a['connectedlinenum'];_0xb1574a['calleridname']=_0xb1574a[_0x3afa('0x47')];_0xb1574a[_0x3afa('0x2a')]=_0xb1574a['accountcode'];_0xb1574a[_0x3afa('0x47')]=_0xb1574a[_0x3afa('0x48')];_0xb1574a[_0x3afa('0x32')]=_0xb1574a['originatecalleridnum'];}else if(_0xb1574a[_0x3afa('0x32')]==_0x3afa('0x49')){_0xb1574a['calleridnum']=_0xb1574a['destination'];_0xb1574a[_0x3afa('0x32')]=_0xb1574a[_0x3afa('0x3e')];}RpcVoiceRecording[_0x3afa('0x2f')](_0xb1574a);}}};Report[_0x3afa('0x20')][_0x3afa('0x1b')]=function(_0x1c4192){if(_['isArray'](_0x1c4192)){_0x1c4192[_0x3afa('0x4a')](function(_0x164d13){RpcVoiceAgentReport['create'](_0x164d13);});}else{RpcVoiceAgentReport['create'](_0x1c4192);}};Report[_0x3afa('0x20')][_0x3afa('0x4b')]=function(_0xbac117){RpcVoiceDialReport[_0x3afa('0x2f')](_0xbac117);var _0x1d1706=undefined;var _0x1b072c=_0xbac117[_0x3afa('0x3d')];if(_[_0x3afa('0x4c')](_0x1b072c,'Local')){var _0x17287e=_0x1b072c['substring'](_0x1b072c[_0x3afa('0x4d')]('/')+0x1,_0x1b072c[_0x3afa('0x4d')]('@'));_0x1d1706=_[_0x3afa('0x21')](this[_0x3afa('0x11')],function(_0x36d7b6){return _0x36d7b6[_0x3afa('0x4e')]==_0x17287e||_0x36d7b6[_0x3afa('0x4f')]==_0x17287e||_0x36d7b6[_0x3afa('0x22')]==_0x17287e;});}else{var _0x17287e=_0x1b072c['substring'](_0x1b072c[_0x3afa('0x4d')]('/')+0x1,_0x1b072c[_0x3afa('0x50')]('-'));_0x1d1706=this[_0x3afa('0x29')](_0x17287e);}if(_0x1d1706){_0xbac117[_0x3afa('0x25')]=_[_0x3afa('0x24')](_0x1d1706[_0x3afa('0x25')])?util[_0x3afa('0x26')]('SIP/%s',_0x1d1706[_0x3afa('0x23')]):_0x1d1706[_0x3afa('0x25')];_0xbac117['membername']=_0x1d1706[_0x3afa('0x23')];_0xbac117['accountcode']=_0x1d1706[_0x3afa('0x22')];RpcMemberReport[_0x3afa('0x4b')](_0xbac117);}};Report[_0x3afa('0x20')][_0x3afa('0x1d')]=function(_0x44acb6){RpcVoiceTransferReport[_0x3afa('0x1d')](_0x44acb6);};Report[_0x3afa('0x20')][_0x3afa('0x1f')]=function(_0x23da17){RpcVoiceTransferReport['attendedTransfer'](_0x23da17);};module['exports']=Report; \ No newline at end of file +var _0x3c63=['connectedlinenum','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','SIP/%s','exports','bluebird','lodash','moment','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','format','length','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','disposition','ANSWERED'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x3c63,0x1c0));var _0x33c6=function(_0x3e86d8,_0xaf6e5c){_0x3e86d8=_0x3e86d8-0x0;var _0x52daf1=_0x3c63[_0x3e86d8];return _0x52daf1;};'use strict';var BPromise=require(_0x33c6('0x0'));var _=require(_0x33c6('0x1'));var moment=require(_0x33c6('0x2'));var util=require('util');var config=require(_0x33c6('0x3'));var logger=require(_0x33c6('0x4'))(_0x33c6('0x5'));var ami=require(_0x33c6('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x33c6('0x7'));var RpcVoiceDialReport=require(_0x33c6('0x8'));var RpcMemberReport=require(_0x33c6('0x9'));var RpcVoiceQueueReport=require(_0x33c6('0xa'));var RpcVoiceRecording=require(_0x33c6('0xb'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x33c6('0xc'));var VoiceAgentReport=require(_0x33c6('0xd'));var VoiceDialReport=require(_0x33c6('0xe'));var UserReport=require(_0x33c6('0xf'));function Report(_0x30dbe8){this[_0x33c6('0x10')]=_0x30dbe8;this[_0x33c6('0x11')]=_0x30dbe8[_0x33c6('0x11')];this[_0x33c6('0x12')]=_0x30dbe8[_0x33c6('0x12')];}Report[_0x33c6('0x13')]['sync']=function(_0x230aa9){var _0x340dd9=new VoiceQueueReport(this[_0x33c6('0x10')]);var _0x30370d=new VoiceAgentReport(this['realtime']);var _0xfa173a=new VoiceDialReport(this['realtime']);var _0x49defc=new VoiceCallReport(this['realtime']);var _0x55289c=new UserReport(this['realtime']);if(config[_0x33c6('0x14')]&&config['xdr']['disabled']){ami['on']('custom:voiceQueueReport',this[_0x33c6('0x15')][_0x33c6('0x16')](this));ami['on'](_0x33c6('0x17'),this[_0x33c6('0x18')][_0x33c6('0x16')](this));ami['on'](_0x33c6('0x19'),this[_0x33c6('0x1a')][_0x33c6('0x16')](this));ami['on'](_0x33c6('0x1b'),this[_0x33c6('0x1c')]['bind'](this));ami['on'](_0x33c6('0x1d'),this[_0x33c6('0x1e')][_0x33c6('0x16')](this));ami['on'](_0x33c6('0x1f'),this[_0x33c6('0x20')][_0x33c6('0x16')](this));}};Report['prototype'][_0x33c6('0x21')]=function(_0x1499b9){var _0x36fee=undefined;_0x36fee=_['find'](this[_0x33c6('0x11')],function(_0x150c0d){return _0x150c0d[_0x33c6('0x22')]==_0x1499b9||_0x150c0d[_0x33c6('0x23')]==_0x1499b9;});if(_[_0x33c6('0x24')](_0x36fee)){var _0x5e9b80=_[_0x33c6('0x25')](this[_0x33c6('0x12')],function(_0xffc001){return _0xffc001[_0x33c6('0x22')]==_0x1499b9||_0xffc001[_0x33c6('0x23')]==_0x1499b9;});if(_0x5e9b80){_0x36fee=_[_0x33c6('0x25')](this[_0x33c6('0x11')],function(_0x20d1dc){return _0x20d1dc['interface']==util[_0x33c6('0x26')]('SIP/%s',_0x5e9b80[_0x33c6('0x23')]);});}}return _0x36fee;};Report[_0x33c6('0x13')][_0x33c6('0x15')]=function(_0x59558a){for(var _0xc52478=0x0;_0xc52478<_0x59558a[_0x33c6('0x27')];_0xc52478+=0x1){var _0x53ec7d=this[_0x33c6('0x21')](_0x59558a[_0xc52478]['connectedlinenum']);if(_0x53ec7d){_0x59558a[_0xc52478]['accountcode']=_0x53ec7d[_0x33c6('0x22')];_0x59558a[_0xc52478][_0x33c6('0x28')]=!![];_0x59558a[_0xc52478][_0x33c6('0x29')]=_0x53ec7d[_0x33c6('0x23')];_0x59558a[_0xc52478]['interface']=_[_0x33c6('0x24')](_0x53ec7d['interface'])?util[_0x33c6('0x26')]('SIP/%s',_0x53ec7d['name']):_0x53ec7d[_0x33c6('0x2a')];if(_0x59558a[_0xc52478][_0x33c6('0x2b')]){_0x59558a[_0xc52478][_0x33c6('0x2c')]=moment()[_0x33c6('0x26')](_0x33c6('0x2d'));}if(_0x59558a[_0xc52478][_0x33c6('0x2e')]){_0x59558a[_0xc52478][_0x33c6('0x2f')]=moment()[_0x33c6('0x26')](_0x33c6('0x2d'));}RpcMemberReport[_0x33c6('0x15')](_0x59558a[_0xc52478]);}RpcVoiceQueueReport[_0x33c6('0x30')](_0x59558a[_0xc52478]);}};function extractCalleridNumber(_0x26d8c5){var _0x497b34=_0x26d8c5[_0x33c6('0x31')](/<(.*?)>/);return _0x497b34?_0x497b34[0x1]:_0x26d8c5;}Report['prototype'][_0x33c6('0x18')]=function(_0x3a6568){_0x3a6568[_0x33c6('0x32')]=_0x3a6568[_0x33c6('0x32')]||_0x3a6568[_0x33c6('0x33')];if(_0x3a6568['type']==_0x33c6('0x34')){_0x3a6568[_0x33c6('0x35')]=_0x33c6('0x36');_0x3a6568[_0x33c6('0x37')]=_0x3a6568[_0x33c6('0x36')];if(_0x3a6568['context']==_0x33c6('0x38')){_0x3a6568[_0x33c6('0x22')]='';_0x3a6568[_0x33c6('0x32')]=extractCalleridNumber(_0x3a6568[_0x33c6('0x39')]);}else if(_0x3a6568[_0x33c6('0x3a')]==_0x33c6('0x3b')){if(_0x3a6568[_0x33c6('0x32')]==_0x33c6('0x3c')){_0x3a6568[_0x33c6('0x32')]=extractCalleridNumber(_0x3a6568[_0x33c6('0x3d')]);_0x3a6568['calleridnum']=_0x3a6568[_0x33c6('0x3e')];_0x3a6568[_0x33c6('0x3f')]=[_0x3a6568[_0x33c6('0x40')],_0x3a6568[_0x33c6('0x40')]=_0x3a6568['destinationchannel']][0x0];_0x3a6568[_0x33c6('0x39')]=_0x3a6568['calleridpreview'];}else{_0x3a6568[_0x33c6('0x32')]=_0x3a6568[_0x33c6('0x41')];_0x3a6568[_0x33c6('0x41')]=_0x3a6568[_0x33c6('0x3e')];if(_0x3a6568[_0x33c6('0x42')]==_0x33c6('0x43')){_0x3a6568[_0x33c6('0x22')]=_0x3a6568[_0x33c6('0x44')];}else{_0x3a6568[_0x33c6('0x22')]='';}}}}else{_0x3a6568[_0x33c6('0x39')]=util[_0x33c6('0x26')]('\x22%s\x22\x20<%s>',_0x3a6568['calleridname'],_0x3a6568[_0x33c6('0x41')]);}RpcVoiceCallReport[_0x33c6('0x30')](_0x3a6568);if(_0x3a6568['monitor']){for(var _0x272da0=0x0;_0x272da0<_0x3a6568[_0x33c6('0x45')][_0x33c6('0x27')];_0x272da0+=0x1){_0x3a6568[_0x33c6('0x46')]=_0x3a6568[_0x33c6('0x45')][_0x272da0][_0x33c6('0x47')];_0x3a6568[_0x33c6('0x48')]=_0x3a6568['monitors'][_0x272da0][_0x33c6('0x48')];if(_0x3a6568['exten']==_0x33c6('0x3c')){_0x3a6568[_0x33c6('0x41')]=_0x3a6568['connectedlinenum'];_0x3a6568['calleridname']=_0x3a6568[_0x33c6('0x49')];_0x3a6568[_0x33c6('0x44')]=_0x3a6568[_0x33c6('0x22')];_0x3a6568[_0x33c6('0x49')]=_0x3a6568[_0x33c6('0x4a')];_0x3a6568[_0x33c6('0x33')]=_0x3a6568['originatecalleridnum'];}else if(_0x3a6568[_0x33c6('0x33')]==_0x33c6('0x4b')){_0x3a6568[_0x33c6('0x41')]=_0x3a6568[_0x33c6('0x32')];_0x3a6568['exten']=_0x3a6568[_0x33c6('0x3e')];}RpcVoiceRecording[_0x33c6('0x30')](_0x3a6568);}}};Report[_0x33c6('0x13')][_0x33c6('0x1a')]=function(_0x1a88a6){if(_[_0x33c6('0x4c')](_0x1a88a6)){_0x1a88a6[_0x33c6('0x4d')](function(_0x1b25b0){RpcVoiceAgentReport[_0x33c6('0x30')](_0x1b25b0);});}else{RpcVoiceAgentReport[_0x33c6('0x30')](_0x1a88a6);}};Report[_0x33c6('0x13')]['voiceDialReport']=function(_0x32c5ed){RpcVoiceDialReport['create'](_0x32c5ed);var _0x290276=undefined;var _0x49234d=_0x32c5ed[_0x33c6('0x40')];if(_[_0x33c6('0x4e')](_0x49234d,'Local')){var _0x20808d=_0x49234d[_0x33c6('0x4f')](_0x49234d['indexOf']('/')+0x1,_0x49234d[_0x33c6('0x50')]('@'));_0x290276=_[_0x33c6('0x25')](this['agents'],function(_0x5456eb){return _0x5456eb[_0x33c6('0x51')]==_0x20808d||_0x5456eb[_0x33c6('0x52')]==_0x20808d||_0x5456eb[_0x33c6('0x22')]==_0x20808d;});}else{var _0x20808d=_0x49234d[_0x33c6('0x4f')](_0x49234d[_0x33c6('0x50')]('/')+0x1,_0x49234d[_0x33c6('0x53')]('-'));_0x290276=this[_0x33c6('0x21')](_0x20808d);}if(_0x290276){_0x32c5ed[_0x33c6('0x2a')]=_[_0x33c6('0x24')](_0x290276['interface'])?util[_0x33c6('0x26')](_0x33c6('0x54'),_0x290276['name']):_0x290276['interface'];_0x32c5ed[_0x33c6('0x4a')]=_0x290276[_0x33c6('0x23')];_0x32c5ed[_0x33c6('0x22')]=_0x290276['accountcode'];RpcMemberReport[_0x33c6('0x1c')](_0x32c5ed);}};Report[_0x33c6('0x13')][_0x33c6('0x1e')]=function(_0x34693f){RpcVoiceTransferReport['blindTransfer'](_0x34693f);};Report[_0x33c6('0x13')][_0x33c6('0x20')]=function(_0x59c619){RpcVoiceTransferReport[_0x33c6('0x20')](_0x59c619);};module[_0x33c6('0x55')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 664b213..d6f2bfb 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21e6=['syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','actionSipShowRegistry','actionDeviceStateList','then','actionSipPeerStatus','[loopSyncRealTimeShow]','inspect','prototype','catch','isNotNull','isUndefined','emit','find','username','stateRegistry','merge','omit','event','state','format','trunk:%s','trunk:save','error','device','local','inuse','toLowerCase','toNumber','updateStatusRealtime','stateTime','telephone:%s','name','startsWith','Queue','Local','substring','indexOf','phone','accountcode','[syncDeviceState][UserReport]','peer','registered','status','address','telephone:save','[syncPeerStatus][UserReport]','exports','bluebird','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry'];(function(_0xbba9bd,_0x18145c){var _0x550337=function(_0x2f4c62){while(--_0x2f4c62){_0xbba9bd['push'](_0xbba9bd['shift']());}};_0x550337(++_0x18145c);}(_0x21e6,0x1c8));var _0x621e=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0x21e6[_0x100e36];return _0x1df0c9;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x621e('0x0'));var util=require('util');var Redis=require(_0x621e('0x1'));var config=require(_0x621e('0x2'));var logger=require(_0x621e('0x3'))('ami');var ami=require(_0x621e('0x4'));config[_0x621e('0x5')]=_[_0x621e('0x6')](config['redis'],{'host':_0x621e('0x7'),'port':0x18eb});var io=require(_0x621e('0x8'))(new Redis(config[_0x621e('0x5')]));function UserReport(_0x1208b7){this[_0x621e('0x9')]=_0x1208b7[_0x621e('0x9')];this['agents']=_0x1208b7[_0x621e('0xa')];this['telephones']=_0x1208b7[_0x621e('0xb')];ami['on'](_0x621e('0xc'),this[_0x621e('0xd')][_0x621e('0xe')](this));ami['on']('registry',this['syncRegistry'][_0x621e('0xe')](this));ami['on'](_0x621e('0xf'),this[_0x621e('0x10')][_0x621e('0xe')](this));ami['on'](_0x621e('0x11'),this[_0x621e('0x12')][_0x621e('0xe')](this));this[_0x621e('0x13')]();return BPromise[_0x621e('0x14')]()['then'](ami[_0x621e('0x15')]())['then'](ami[_0x621e('0x16')]())[_0x621e('0x17')](ami[_0x621e('0x18')]())['catch'](loggerCatch(_0x621e('0x19')));}function loggerCatch(_0x55d5de){return function(_0x125ad4){logger['error'](_0x55d5de,util[_0x621e('0x1a')](_0x125ad4,{'showHidden':![],'depth':null}));};}UserReport[_0x621e('0x1b')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0x621e('0x14')]()[_0x621e('0x17')](ami[_0x621e('0x15')]())[_0x621e('0x17')](ami['actionDeviceStateList']())[_0x621e('0x17')](ami[_0x621e('0x18')]())[_0x621e('0x1c')](loggerCatch(_0x621e('0x19')));},0x32c8);};UserReport[_0x621e('0x1b')][_0x621e('0x1d')]=function(_0xedc9ae){return _0xedc9ae!==null&&!_[_0x621e('0x1e')](_0xedc9ae);};UserReport[_0x621e('0x1b')][_0x621e('0x1f')]=function(_0x2ac283,_0xf391bb,_0x895fbc){io['to'](_0x2ac283)[_0x621e('0x1f')](_0xf391bb,_0x895fbc);};UserReport['prototype'][_0x621e('0xd')]=function(_0x249f68){try{if(this[_0x621e('0x1d')](_0x249f68)){var _0x3b9c76=_[_0x621e('0x20')](this[_0x621e('0x9')],{'registry':_0x249f68[_0x621e('0x21')]});if(_0x3b9c76){_0x249f68[_0x621e('0x22')]=_0x249f68['state'];_[_0x621e('0x23')](_0x3b9c76,_[_0x621e('0x24')](_0x249f68,[_0x621e('0x25'),'actionid',_0x621e('0x21'),_0x621e('0x26')]));this['emit'](util[_0x621e('0x27')](_0x621e('0x28'),_0x3b9c76['name']),_0x621e('0x29'),_0x3b9c76);}}}catch(_0x326d19){logger[_0x621e('0x2a')]('[syncRegistry][UserReport]',util[_0x621e('0x1a')](_0x326d19,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x621e('0x10')]=function(_0x42eea4){try{if(this[_0x621e('0x1d')](_0x42eea4)){if(this['agents'][_0x42eea4[_0x621e('0x2b')]]){if(!this[_0x621e('0xa')][_0x42eea4[_0x621e('0x2b')]][_0x621e('0x2c')]||_0x42eea4[_0x621e('0x26')]['toLowerCase']()==_0x621e('0x2d')){this['agents'][_0x42eea4[_0x621e('0x2b')]][_0x621e('0x2c')]=![];if(this[_0x621e('0xa')][_0x42eea4[_0x621e('0x2b')]]['state']!==_0x42eea4[_0x621e('0x26')][_0x621e('0x2e')]()){this[_0x621e('0xa')][_0x42eea4[_0x621e('0x2b')]]['stateTime']=_[_0x621e('0x2f')](moment()[_0x621e('0x27')]('x'));}this[_0x621e('0xa')][_0x42eea4[_0x621e('0x2b')]][_0x621e('0x26')]=_0x42eea4[_0x621e('0x26')][_0x621e('0x2e')]();this[_0x621e('0xa')][_0x42eea4[_0x621e('0x2b')]][_0x621e('0x30')](_0x42eea4);}}else if(this[_0x621e('0xb')][_0x42eea4[_0x621e('0x2b')]]){if(this[_0x621e('0xb')][_0x42eea4[_0x621e('0x2b')]]['state']!==_0x42eea4[_0x621e('0x26')][_0x621e('0x2e')]()){this[_0x621e('0xb')][_0x42eea4['device']][_0x621e('0x31')]=_['toNumber'](moment()[_0x621e('0x27')]('x'));}this['telephones'][_0x42eea4[_0x621e('0x2b')]][_0x621e('0x26')]=_0x42eea4['state'][_0x621e('0x2e')]();this[_0x621e('0x1f')](util[_0x621e('0x27')](_0x621e('0x32'),this[_0x621e('0xb')][_0x42eea4['device']]['name']),'telephone:save',this[_0x621e('0xb')][_0x42eea4['device']]);}else if(this[_0x621e('0x9')][_0x42eea4[_0x621e('0x2b')]]){if(this[_0x621e('0x9')][_0x42eea4[_0x621e('0x2b')]][_0x621e('0x26')]!==_0x42eea4[_0x621e('0x26')][_0x621e('0x2e')]()){this[_0x621e('0x9')][_0x42eea4[_0x621e('0x2b')]][_0x621e('0x31')]=_[_0x621e('0x2f')](moment()[_0x621e('0x27')]('x'));}this[_0x621e('0x9')][_0x42eea4[_0x621e('0x2b')]][_0x621e('0x26')]=_0x42eea4[_0x621e('0x26')][_0x621e('0x2e')]();this[_0x621e('0x1f')](util[_0x621e('0x27')](_0x621e('0x28'),this[_0x621e('0x9')][_0x42eea4[_0x621e('0x2b')]][_0x621e('0x33')]),_0x621e('0x29'),this[_0x621e('0x9')][_0x42eea4['device']]);}else if(_[_0x621e('0x34')](_0x42eea4[_0x621e('0x2b')],_0x621e('0x35'))){}else if(_[_0x621e('0x34')](_0x42eea4[_0x621e('0x2b')],_0x621e('0x36'))){var _0x3f1e80=_0x42eea4['device'];var _0x4b9b58=_0x3f1e80[_0x621e('0x37')](_0x3f1e80[_0x621e('0x38')]('/')+0x1,_0x3f1e80[_0x621e('0x38')]('@'));var _0xf892c=_[_0x621e('0x20')](this[_0x621e('0xa')],function(_0x1676e3){return _0x1676e3['mobile']==_0x4b9b58||_0x1676e3[_0x621e('0x39')]==_0x4b9b58||_0x1676e3[_0x621e('0x3a')]==_0x4b9b58;});if(_0xf892c){if(_0xf892c[_0x621e('0x26')]!==_0x42eea4[_0x621e('0x26')][_0x621e('0x2e')]()){_0xf892c[_0x621e('0x31')]=_[_0x621e('0x2f')](moment()['format']('x'));}_0xf892c[_0x621e('0x26')]=_0x42eea4[_0x621e('0x26')]['toLowerCase']();_0xf892c[_0x621e('0x2c')]=!![];_0xf892c[_0x621e('0x30')](_0x42eea4);}}else{}}}catch(_0x563085){logger[_0x621e('0x2a')](_0x621e('0x3b'),util[_0x621e('0x1a')](_0x563085,{'showHidden':![],'depth':null}));}};UserReport[_0x621e('0x1b')]['syncPeerStatus']=function(_0x24e214){try{if(this[_0x621e('0x1d')](_0x24e214)&&this['isNotNull'](_0x24e214[_0x621e('0x11')])){if(this[_0x621e('0xa')][_0x24e214[_0x621e('0x3c')]]){if(!this['agents'][_0x24e214[_0x621e('0x3c')]][_0x621e('0x2c')]||_0x24e214['peerstatus']['toLowerCase']()==_0x621e('0x3d')){this['agents'][_0x24e214[_0x621e('0x3c')]][_0x621e('0x2c')]=![];this[_0x621e('0xa')][_0x24e214[_0x621e('0x3c')]][_0x621e('0x3e')]=_0x24e214[_0x621e('0x11')][_0x621e('0x2e')]();this[_0x621e('0xa')][_0x24e214[_0x621e('0x3c')]][_0x621e('0x3f')]=_0x24e214['address'];this[_0x621e('0xa')][_0x24e214[_0x621e('0x3c')]][_0x621e('0x30')](_0x24e214);}}else if(this[_0x621e('0xb')][_0x24e214[_0x621e('0x3c')]]){this['telephones'][_0x24e214[_0x621e('0x3c')]]['status']=_0x24e214[_0x621e('0x11')][_0x621e('0x2e')]();this[_0x621e('0xb')][_0x24e214[_0x621e('0x3c')]][_0x621e('0x3f')]=_0x24e214['address'];this[_0x621e('0x1f')](util[_0x621e('0x27')](_0x621e('0x32'),this['telephones'][_0x24e214['peer']][_0x621e('0x33')]),_0x621e('0x40'),this['telephones'][_0x24e214[_0x621e('0x3c')]]);}else if(this[_0x621e('0x9')][_0x24e214[_0x621e('0x3c')]]){this[_0x621e('0x9')][_0x24e214[_0x621e('0x3c')]][_0x621e('0x3e')]=_0x24e214[_0x621e('0x11')][_0x621e('0x2e')]();this[_0x621e('0x9')][_0x24e214['peer']][_0x621e('0x3f')]=_0x24e214[_0x621e('0x3f')];this[_0x621e('0x1f')](util[_0x621e('0x27')](_0x621e('0x28'),this[_0x621e('0x9')][_0x24e214[_0x621e('0x3c')]]['name']),_0x621e('0x29'),this[_0x621e('0x9')][_0x24e214[_0x621e('0x3c')]]);}else{}}}catch(_0x1e0558){logger[_0x621e('0x2a')](_0x621e('0x41'),util['inspect'](_0x1e0558,{'showHidden':![],'depth':null}));}};module[_0x621e('0x42')]=UserReport; \ No newline at end of file +var _0xb08c=['telephone:save','startsWith','Local','substring','indexOf','mobile','accountcode','[syncDeviceState][UserReport]','peer','status','address','exports','lodash','moment','bluebird','ioredis','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','actionDeviceStateList','prototype','isNotNull','isUndefined','emit','find','username','stateRegistry','merge','omit','event','actionid','state','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','device','local','toNumber','format','toLowerCase','updateStatusRealtime','stateTime','telephone:%s'];(function(_0x36830c,_0x5b13ed){var _0x2b746b=function(_0x54ea87){while(--_0x54ea87){_0x36830c['push'](_0x36830c['shift']());}};_0x2b746b(++_0x5b13ed);}(_0xb08c,0xcf));var _0xcb08=function(_0xb8a3f,_0x1fc815){_0xb8a3f=_0xb8a3f-0x0;var _0x2901b2=_0xb08c[_0xb8a3f];return _0x2901b2;};'use strict';var _=require(_0xcb08('0x0'));var moment=require(_0xcb08('0x1'));var BPromise=require(_0xcb08('0x2'));var util=require('util');var Redis=require(_0xcb08('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0xcb08('0x4'));config['redis']=_['defaults'](config[_0xcb08('0x5')],{'host':_0xcb08('0x6'),'port':0x18eb});var io=require(_0xcb08('0x7'))(new Redis(config[_0xcb08('0x5')]));function UserReport(_0x1acd9e){this[_0xcb08('0x8')]=_0x1acd9e[_0xcb08('0x8')];this[_0xcb08('0x9')]=_0x1acd9e['agents'];this[_0xcb08('0xa')]=_0x1acd9e[_0xcb08('0xa')];ami['on'](_0xcb08('0xb'),this[_0xcb08('0xc')]['bind'](this));ami['on'](_0xcb08('0xd'),this['syncRegistry'][_0xcb08('0xe')](this));ami['on'](_0xcb08('0xf'),this[_0xcb08('0x10')][_0xcb08('0xe')](this));ami['on'](_0xcb08('0x11'),this[_0xcb08('0x12')][_0xcb08('0xe')](this));this[_0xcb08('0x13')]();return BPromise[_0xcb08('0x14')]()[_0xcb08('0x15')](ami[_0xcb08('0x16')]())['then'](ami['actionDeviceStateList']())['then'](ami[_0xcb08('0x17')]())[_0xcb08('0x18')](loggerCatch(_0xcb08('0x19')));}function loggerCatch(_0x10de69){return function(_0x275a1b){logger[_0xcb08('0x1a')](_0x10de69,util[_0xcb08('0x1b')](_0x275a1b,{'showHidden':![],'depth':null}));};}UserReport['prototype']['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0xcb08('0x14')]()['then'](ami['actionSipShowRegistry']())[_0xcb08('0x15')](ami[_0xcb08('0x1c')]())[_0xcb08('0x15')](ami['actionSipPeerStatus']())[_0xcb08('0x18')](loggerCatch(_0xcb08('0x19')));},0x32c8);};UserReport[_0xcb08('0x1d')][_0xcb08('0x1e')]=function(_0x4049bb){return _0x4049bb!==null&&!_[_0xcb08('0x1f')](_0x4049bb);};UserReport[_0xcb08('0x1d')][_0xcb08('0x20')]=function(_0x36d99d,_0x5f43d8,_0xbb6dad){io['to'](_0x36d99d)[_0xcb08('0x20')](_0x5f43d8,_0xbb6dad);};UserReport[_0xcb08('0x1d')]['syncRegistry']=function(_0x2190b0){try{if(this[_0xcb08('0x1e')](_0x2190b0)){var _0x53ec2e=_[_0xcb08('0x21')](this[_0xcb08('0x8')],{'registry':_0x2190b0[_0xcb08('0x22')]});if(_0x53ec2e){_0x2190b0[_0xcb08('0x23')]=_0x2190b0['state'];_[_0xcb08('0x24')](_0x53ec2e,_[_0xcb08('0x25')](_0x2190b0,[_0xcb08('0x26'),_0xcb08('0x27'),'username',_0xcb08('0x28')]));this[_0xcb08('0x20')](util['format'](_0xcb08('0x29'),_0x53ec2e[_0xcb08('0x2a')]),_0xcb08('0x2b'),_0x53ec2e);}}}catch(_0x5f1e27){logger[_0xcb08('0x1a')](_0xcb08('0x2c'),util[_0xcb08('0x1b')](_0x5f1e27,{'showHidden':![],'depth':null}));}};UserReport[_0xcb08('0x1d')]['syncDeviceState']=function(_0x1901f2){try{if(this['isNotNull'](_0x1901f2)){if(this[_0xcb08('0x9')][_0x1901f2['device']]){if(!this[_0xcb08('0x9')][_0x1901f2[_0xcb08('0x2d')]][_0xcb08('0x2e')]||_0x1901f2[_0xcb08('0x28')]['toLowerCase']()=='inuse'){this[_0xcb08('0x9')][_0x1901f2[_0xcb08('0x2d')]][_0xcb08('0x2e')]=![];if(this[_0xcb08('0x9')][_0x1901f2[_0xcb08('0x2d')]][_0xcb08('0x28')]!==_0x1901f2[_0xcb08('0x28')]['toLowerCase']()){this['agents'][_0x1901f2[_0xcb08('0x2d')]]['stateTime']=_[_0xcb08('0x2f')](moment()[_0xcb08('0x30')]('x'));}this[_0xcb08('0x9')][_0x1901f2[_0xcb08('0x2d')]][_0xcb08('0x28')]=_0x1901f2[_0xcb08('0x28')][_0xcb08('0x31')]();this['agents'][_0x1901f2[_0xcb08('0x2d')]][_0xcb08('0x32')](_0x1901f2);}}else if(this['telephones'][_0x1901f2[_0xcb08('0x2d')]]){if(this['telephones'][_0x1901f2[_0xcb08('0x2d')]][_0xcb08('0x28')]!==_0x1901f2[_0xcb08('0x28')][_0xcb08('0x31')]()){this['telephones'][_0x1901f2[_0xcb08('0x2d')]][_0xcb08('0x33')]=_[_0xcb08('0x2f')](moment()[_0xcb08('0x30')]('x'));}this[_0xcb08('0xa')][_0x1901f2[_0xcb08('0x2d')]][_0xcb08('0x28')]=_0x1901f2[_0xcb08('0x28')][_0xcb08('0x31')]();this[_0xcb08('0x20')](util['format'](_0xcb08('0x34'),this['telephones'][_0x1901f2[_0xcb08('0x2d')]][_0xcb08('0x2a')]),_0xcb08('0x35'),this[_0xcb08('0xa')][_0x1901f2[_0xcb08('0x2d')]]);}else if(this['trunks'][_0x1901f2[_0xcb08('0x2d')]]){if(this['trunks'][_0x1901f2[_0xcb08('0x2d')]]['state']!==_0x1901f2[_0xcb08('0x28')][_0xcb08('0x31')]()){this[_0xcb08('0x8')][_0x1901f2[_0xcb08('0x2d')]][_0xcb08('0x33')]=_[_0xcb08('0x2f')](moment()[_0xcb08('0x30')]('x'));}this[_0xcb08('0x8')][_0x1901f2[_0xcb08('0x2d')]][_0xcb08('0x28')]=_0x1901f2[_0xcb08('0x28')]['toLowerCase']();this[_0xcb08('0x20')](util[_0xcb08('0x30')]('trunk:%s',this['trunks'][_0x1901f2[_0xcb08('0x2d')]][_0xcb08('0x2a')]),'trunk:save',this[_0xcb08('0x8')][_0x1901f2[_0xcb08('0x2d')]]);}else if(_[_0xcb08('0x36')](_0x1901f2[_0xcb08('0x2d')],'Queue')){}else if(_[_0xcb08('0x36')](_0x1901f2[_0xcb08('0x2d')],_0xcb08('0x37'))){var _0x1df81a=_0x1901f2[_0xcb08('0x2d')];var _0x15db2b=_0x1df81a[_0xcb08('0x38')](_0x1df81a[_0xcb08('0x39')]('/')+0x1,_0x1df81a[_0xcb08('0x39')]('@'));var _0x47ab5a=_[_0xcb08('0x21')](this[_0xcb08('0x9')],function(_0x28f34a){return _0x28f34a[_0xcb08('0x3a')]==_0x15db2b||_0x28f34a['phone']==_0x15db2b||_0x28f34a[_0xcb08('0x3b')]==_0x15db2b;});if(_0x47ab5a){if(_0x47ab5a[_0xcb08('0x28')]!==_0x1901f2[_0xcb08('0x28')]['toLowerCase']()){_0x47ab5a[_0xcb08('0x33')]=_[_0xcb08('0x2f')](moment()[_0xcb08('0x30')]('x'));}_0x47ab5a[_0xcb08('0x28')]=_0x1901f2[_0xcb08('0x28')][_0xcb08('0x31')]();_0x47ab5a[_0xcb08('0x2e')]=!![];_0x47ab5a[_0xcb08('0x32')](_0x1901f2);}}else{}}}catch(_0x1c4f32){logger[_0xcb08('0x1a')](_0xcb08('0x3c'),util[_0xcb08('0x1b')](_0x1c4f32,{'showHidden':![],'depth':null}));}};UserReport[_0xcb08('0x1d')][_0xcb08('0x12')]=function(_0x14cb4c){try{if(this[_0xcb08('0x1e')](_0x14cb4c)&&this['isNotNull'](_0x14cb4c[_0xcb08('0x11')])){if(this['agents'][_0x14cb4c[_0xcb08('0x3d')]]){if(!this[_0xcb08('0x9')][_0x14cb4c[_0xcb08('0x3d')]][_0xcb08('0x2e')]||_0x14cb4c[_0xcb08('0x11')][_0xcb08('0x31')]()=='registered'){this[_0xcb08('0x9')][_0x14cb4c[_0xcb08('0x3d')]][_0xcb08('0x2e')]=![];this[_0xcb08('0x9')][_0x14cb4c[_0xcb08('0x3d')]][_0xcb08('0x3e')]=_0x14cb4c[_0xcb08('0x11')][_0xcb08('0x31')]();this[_0xcb08('0x9')][_0x14cb4c[_0xcb08('0x3d')]][_0xcb08('0x3f')]=_0x14cb4c[_0xcb08('0x3f')];this[_0xcb08('0x9')][_0x14cb4c[_0xcb08('0x3d')]][_0xcb08('0x32')](_0x14cb4c);}}else if(this[_0xcb08('0xa')][_0x14cb4c['peer']]){this[_0xcb08('0xa')][_0x14cb4c[_0xcb08('0x3d')]][_0xcb08('0x3e')]=_0x14cb4c['peerstatus'][_0xcb08('0x31')]();this[_0xcb08('0xa')][_0x14cb4c['peer']][_0xcb08('0x3f')]=_0x14cb4c['address'];this[_0xcb08('0x20')](util[_0xcb08('0x30')](_0xcb08('0x34'),this[_0xcb08('0xa')][_0x14cb4c[_0xcb08('0x3d')]][_0xcb08('0x2a')]),_0xcb08('0x35'),this['telephones'][_0x14cb4c[_0xcb08('0x3d')]]);}else if(this[_0xcb08('0x8')][_0x14cb4c['peer']]){this[_0xcb08('0x8')][_0x14cb4c[_0xcb08('0x3d')]][_0xcb08('0x3e')]=_0x14cb4c[_0xcb08('0x11')][_0xcb08('0x31')]();this['trunks'][_0x14cb4c['peer']][_0xcb08('0x3f')]=_0x14cb4c[_0xcb08('0x3f')];this[_0xcb08('0x20')](util['format'](_0xcb08('0x29'),this['trunks'][_0x14cb4c['peer']][_0xcb08('0x2a')]),_0xcb08('0x2b'),this[_0xcb08('0x8')][_0x14cb4c[_0xcb08('0x3d')]]);}else{}}}catch(_0x6caff2){logger[_0xcb08('0x1a')]('[syncPeerStatus][UserReport]',util[_0xcb08('0x1b')](_0x6caff2,{'showHidden':![],'depth':null}));}};module[_0xcb08('0x40')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 030f7ea..231b12d 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e97=['talktime','transfer','agent','acw','acwtime','acwTimeout','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberpenalty','memberrealtime','isNil','syncHangup','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','syncBlindTransfer','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentRingNoAnswer','bind','agentcomplete','varset','syncVarSet','hangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','event','privilege','custom:agentcalled','format','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','syncAgentConnect','hasOwnProperty','agentconnectAt','lastevent','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','user:agentconnect','custom:agentconnect','agentringnoanswer','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','[syncAgentRingNoAnswer][VoiceAgentReport]','syncQueueCallerAbandon','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','syncAgentComplete','agentcompleteAt','complete'];(function(_0x4e5361,_0x137864){var _0x225133=function(_0x41b40a){while(--_0x41b40a){_0x4e5361['push'](_0x4e5361['shift']());}};_0x225133(++_0x137864);}(_0x9e97,0xa6));var _0x79e9=function(_0xe445a5,_0x52f4b8){_0xe445a5=_0xe445a5-0x0;var _0x2d323f=_0x9e97[_0xe445a5];return _0x2d323f;};'use strict';var _=require('lodash');var moment=require(_0x79e9('0x0'));var util=require(_0x79e9('0x1'));var Redis=require('ioredis');var config=require(_0x79e9('0x2'));var logger=require(_0x79e9('0x3'))(_0x79e9('0x4'));var ami=require(_0x79e9('0x5'));config[_0x79e9('0x6')]=_[_0x79e9('0x7')](config[_0x79e9('0x6')],{'host':_0x79e9('0x8'),'port':0x18eb});var io=require(_0x79e9('0x9'))(new Redis(config[_0x79e9('0x6')]));function VoiceAgentReport(_0x54735b){this[_0x79e9('0xa')]={};this[_0x79e9('0xb')]=_0x54735b[_0x79e9('0xb')];this['agents']=_0x54735b[_0x79e9('0xc')];this[_0x79e9('0xd')]={};ami['on'](_0x79e9('0xe'),this[_0x79e9('0xf')]['bind'](this));ami['on'](_0x79e9('0x10'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this[_0x79e9('0x11')][_0x79e9('0x12')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x79e9('0x12')](this));ami['on'](_0x79e9('0x13'),this['syncAgentComplete'][_0x79e9('0x12')](this));ami['on'](_0x79e9('0x14'),this[_0x79e9('0x15')][_0x79e9('0x12')](this));ami['on'](_0x79e9('0x16'),this['syncHangup'][_0x79e9('0x12')](this));ami['on']('musiconholdstart',this[_0x79e9('0x17')][_0x79e9('0x12')](this));ami['on'](_0x79e9('0x18'),this[_0x79e9('0x19')][_0x79e9('0x12')](this));ami['on'](_0x79e9('0x1a'),this[_0x79e9('0x1b')]['bind'](this));ami['on'](_0x79e9('0x1c'),this['syncBlindTransfer'][_0x79e9('0x12')](this));}VoiceAgentReport[_0x79e9('0x1d')][_0x79e9('0x1e')]=function(_0x38c50a,_0x42d310,_0x5afb1f){io['to'](_0x38c50a)['emit'](_0x42d310,_0x5afb1f);};VoiceAgentReport[_0x79e9('0x1d')][_0x79e9('0x1f')]=function(_0x10376e){return _0x10376e!==null&&!_[_0x79e9('0x20')](_0x10376e);};VoiceAgentReport[_0x79e9('0x1d')][_0x79e9('0xf')]=function(_0x2de1a7){try{if(this['isNotNull'](_0x2de1a7)){if(_[_0x79e9('0x20')](this[_0x79e9('0xa')][_0x2de1a7[_0x79e9('0x21')]])){this[_0x79e9('0xa')][_0x2de1a7['uniqueid']]={};}if(_[_0x79e9('0x20')](this[_0x79e9('0xa')][_0x2de1a7[_0x79e9('0x21')]][_0x2de1a7[_0x79e9('0x22')]])){this[_0x79e9('0xa')][_0x2de1a7[_0x79e9('0x21')]][_0x2de1a7['destuniqueid']]={'agentcalledAt':moment()['format'](_0x79e9('0x23')),'lastevent':_0x79e9('0x24'),'variables':this[_0x79e9('0xd')][_0x2de1a7[_0x79e9('0x21')]],'type':this[_0x79e9('0xb')][_0x2de1a7[_0x79e9('0x25')]]?this[_0x79e9('0xb')][_0x2de1a7[_0x79e9('0x25')]][_0x79e9('0x26')]||_0x79e9('0x27'):'inbound'};}_[_0x79e9('0x28')](this[_0x79e9('0xa')][_0x2de1a7[_0x79e9('0x21')]][_0x2de1a7[_0x79e9('0x22')]],_[_0x79e9('0x29')](_0x2de1a7,[_0x79e9('0x2a'),_0x79e9('0x2b')]));ami[_0x79e9('0x1e')](_0x79e9('0x2c'),this[_0x79e9('0xa')][_0x2de1a7['uniqueid']][_0x2de1a7[_0x79e9('0x22')]]);this[_0x79e9('0x1e')](util[_0x79e9('0x2d')](_0x79e9('0x2e'),_0x2de1a7[_0x79e9('0x2f')]),_0x79e9('0x30'),this[_0x79e9('0xa')][_0x2de1a7[_0x79e9('0x21')]][_0x2de1a7[_0x79e9('0x22')]]);}}catch(_0x43c31e){logger[_0x79e9('0x31')](_0x79e9('0x32'),util[_0x79e9('0x33')](_0x43c31e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x79e9('0x34')]=function(_0x16705f){try{if(this[_0x79e9('0x1f')](_0x16705f)){if(this[_0x79e9('0xa')][_0x16705f[_0x79e9('0x21')]]){for(var _0x54f762 in this['channels'][_0x16705f[_0x79e9('0x21')]]){if(this[_0x79e9('0xa')][_0x16705f[_0x79e9('0x21')]][_0x79e9('0x35')](_0x54f762)){if(_0x16705f[_0x79e9('0x22')]===_0x54f762){this[_0x79e9('0xa')][_0x16705f[_0x79e9('0x21')]][_0x54f762][_0x79e9('0x36')]=moment()[_0x79e9('0x2d')](_0x79e9('0x23'));this[_0x79e9('0xa')][_0x16705f[_0x79e9('0x21')]][_0x54f762][_0x79e9('0x37')]='connect';this[_0x79e9('0xa')][_0x16705f['uniqueid']][_0x54f762][_0x79e9('0x38')]=_0x16705f['holdtime'];this[_0x79e9('0xa')][_0x16705f[_0x79e9('0x21')]][_0x54f762][_0x79e9('0x39')]=_0x16705f[_0x79e9('0x39')];this[_0x79e9('0xa')][_0x16705f['uniqueid']][_0x54f762]['connectedlinename']=_0x16705f[_0x79e9('0x3a')];this[_0x79e9('0xa')][_0x16705f[_0x79e9('0x21')]][_0x54f762][_0x79e9('0x3b')]=_0x16705f[_0x79e9('0x3b')];this[_0x79e9('0xa')][_0x16705f['uniqueid']][_0x54f762][_0x79e9('0x3c')]=_0x16705f[_0x79e9('0x3c')];_[_0x79e9('0x28')](this[_0x79e9('0xc')][_0x16705f[_0x79e9('0x3d')]],_['pick'](_0x16705f,[_0x79e9('0x25'),'destconnectedlinenum']));this[_0x79e9('0x1e')](util['format'](_0x79e9('0x2e'),_0x16705f[_0x79e9('0x2f')]),_0x79e9('0x3e'),this['channels'][_0x16705f[_0x79e9('0x21')]][_0x16705f[_0x79e9('0x22')]]);ami['emit'](_0x79e9('0x3f'),this[_0x79e9('0xa')][_0x16705f['uniqueid']][_0x54f762]);}else if(!this[_0x79e9('0xa')][_0x16705f[_0x79e9('0x21')]][_0x54f762][_0x79e9('0x40')]&&!this[_0x79e9('0xa')][_0x16705f[_0x79e9('0x21')]][_0x54f762][_0x79e9('0x13')]){this[_0x79e9('0xa')][_0x16705f['uniqueid']][_0x54f762][_0x79e9('0x40')]=!![];this[_0x79e9('0xa')][_0x16705f[_0x79e9('0x21')]][_0x54f762][_0x79e9('0x41')]=moment()['format'](_0x79e9('0x23'));this[_0x79e9('0xa')][_0x16705f[_0x79e9('0x21')]][_0x54f762][_0x79e9('0x42')]=_0x79e9('0x43');this['channels'][_0x16705f[_0x79e9('0x21')]][_0x54f762][_0x79e9('0x37')]='answered_elsewhere';this[_0x79e9('0xa')][_0x16705f[_0x79e9('0x21')]][_0x54f762]['answeredelsewheredestinationuniqueid']=_0x16705f[_0x79e9('0x22')];this['channels'][_0x16705f[_0x79e9('0x21')]][_0x54f762][_0x79e9('0x44')]=_0x16705f[_0x79e9('0x2f')];ami['emit'](_0x79e9('0x45'),this[_0x79e9('0xa')][_0x16705f[_0x79e9('0x21')]][_0x54f762]);}}}}}}catch(_0x39ea5c){logger[_0x79e9('0x31')](_0x79e9('0x46'),util['inspect'](_0x39ea5c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x79e9('0x1d')][_0x79e9('0x11')]=function(_0x17dd2f){try{if(this[_0x79e9('0x1f')](_0x17dd2f)){if(this[_0x79e9('0xa')][_0x17dd2f[_0x79e9('0x21')]]&&this['channels'][_0x17dd2f[_0x79e9('0x21')]][_0x17dd2f[_0x79e9('0x22')]]){this['channels'][_0x17dd2f[_0x79e9('0x21')]][_0x17dd2f[_0x79e9('0x22')]][_0x79e9('0x40')]=!![];this[_0x79e9('0xa')][_0x17dd2f[_0x79e9('0x21')]][_0x17dd2f['destuniqueid']][_0x79e9('0x41')]=moment()[_0x79e9('0x2d')](_0x79e9('0x23'));this[_0x79e9('0xa')][_0x17dd2f['uniqueid']][_0x17dd2f[_0x79e9('0x22')]][_0x79e9('0x42')]='rejected';this[_0x79e9('0xa')][_0x17dd2f['uniqueid']][_0x17dd2f['destuniqueid']][_0x79e9('0x37')]=_0x79e9('0x47');ami['emit']('custom:agentringnoanswer',this[_0x79e9('0xa')][_0x17dd2f[_0x79e9('0x21')]][_0x17dd2f['destuniqueid']]);}}}catch(_0x38e59f){logger['error'](_0x79e9('0x48'),util[_0x79e9('0x33')](_0x38e59f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x79e9('0x1d')][_0x79e9('0x49')]=function(_0x556eb4){try{if(this[_0x79e9('0x1f')](_0x556eb4)){if(this[_0x79e9('0xa')][_0x556eb4[_0x79e9('0x21')]]){for(var _0x19f084 in this['channels'][_0x556eb4[_0x79e9('0x21')]]){if(this[_0x79e9('0xa')][_0x556eb4[_0x79e9('0x21')]]['hasOwnProperty'](_0x19f084)&&!this['channels'][_0x556eb4[_0x79e9('0x21')]][_0x19f084][_0x79e9('0x40')]&&!this[_0x79e9('0xa')][_0x556eb4[_0x79e9('0x21')]][_0x19f084][_0x79e9('0x13')]){this[_0x79e9('0xa')][_0x556eb4[_0x79e9('0x21')]][_0x19f084][_0x79e9('0x40')]=!![];this['channels'][_0x556eb4[_0x79e9('0x21')]][_0x19f084][_0x79e9('0x41')]=moment()['format'](_0x79e9('0x23'));this[_0x79e9('0xa')][_0x556eb4[_0x79e9('0x21')]][_0x19f084][_0x79e9('0x42')]=_0x79e9('0x4a');this[_0x79e9('0xa')][_0x556eb4[_0x79e9('0x21')]][_0x19f084][_0x79e9('0x37')]='abandoned';ami[_0x79e9('0x1e')](_0x79e9('0x4b'),this[_0x79e9('0xa')][_0x556eb4['uniqueid']][_0x19f084]);}}}}}catch(_0x38e0e7){logger[_0x79e9('0x31')](_0x79e9('0x4c'),util[_0x79e9('0x33')](_0x38e0e7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x79e9('0x1d')][_0x79e9('0x4d')]=function(_0x3b6a51){try{if(this['isNotNull'](_0x3b6a51)){if(this[_0x79e9('0xa')][_0x3b6a51[_0x79e9('0x21')]]){for(var _0x3ff9a2 in this[_0x79e9('0xa')][_0x3b6a51[_0x79e9('0x21')]]){if(this['channels'][_0x3b6a51[_0x79e9('0x21')]]['hasOwnProperty'](_0x3ff9a2)){if(this[_0x79e9('0xa')][_0x3b6a51[_0x79e9('0x21')]][_0x3ff9a2]['agentconnectAt']&&!this[_0x79e9('0xa')][_0x3b6a51[_0x79e9('0x21')]][_0x3ff9a2][_0x79e9('0x13')]){this[_0x79e9('0xa')][_0x3b6a51['uniqueid']][_0x3ff9a2][_0x79e9('0x13')]=!![];this['channels'][_0x3b6a51[_0x79e9('0x21')]][_0x3ff9a2][_0x79e9('0x4e')]=moment()[_0x79e9('0x2d')](_0x79e9('0x23'));this[_0x79e9('0xa')][_0x3b6a51[_0x79e9('0x21')]][_0x3ff9a2][_0x79e9('0x37')]=_0x79e9('0x4f');this['channels'][_0x3b6a51[_0x79e9('0x21')]][_0x3ff9a2][_0x79e9('0x50')]=_0x3b6a51[_0x79e9('0x50')];this[_0x79e9('0xa')][_0x3b6a51[_0x79e9('0x21')]][_0x3ff9a2][_0x79e9('0x42')]=_0x3b6a51[_0x79e9('0x42')]==_0x79e9('0x51')?_0x79e9('0x52'):_0x3b6a51[_0x79e9('0x42')];if(this[_0x79e9('0xb')][_0x3b6a51[_0x79e9('0x25')]]&&this[_0x79e9('0xb')][_0x3b6a51[_0x79e9('0x25')]][_0x79e9('0x53')]){this[_0x79e9('0xa')][_0x3b6a51['uniqueid']][_0x3ff9a2]['agentacw']=!![];this[_0x79e9('0xa')][_0x3b6a51['uniqueid']][_0x3ff9a2][_0x79e9('0x54')]=this[_0x79e9('0xb')][_0x3b6a51[_0x79e9('0x25')]][_0x79e9('0x55')];}this[_0x79e9('0xc')][_0x3b6a51['interface']]=_[_0x79e9('0x29')](this[_0x79e9('0xc')][_0x3b6a51[_0x79e9('0x3d')]],[_0x79e9('0x25'),'destconnectedlinenum']);this[_0x79e9('0x1e')](util['format'](_0x79e9('0x2e'),_0x3b6a51[_0x79e9('0x2f')]),_0x79e9('0x56'),this[_0x79e9('0xa')][_0x3b6a51[_0x79e9('0x21')]][_0x3ff9a2]);ami[_0x79e9('0x1e')](_0x79e9('0x57'),this['channels'][_0x3b6a51['uniqueid']][_0x3ff9a2]);}}}}}}catch(_0x2a166b){logger[_0x79e9('0x31')](_0x79e9('0x58'),util['inspect'](_0x2a166b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x79e9('0x1d')]['syncVarSet']=function(_0x2cb60c){try{if(this['isNotNull'](_0x2cb60c)){this[_0x79e9('0x59')](_0x2cb60c[_0x79e9('0x21')],_['keys'](_0x2cb60c[_0x79e9('0x5a')])[0x0],_0x2cb60c[_0x79e9('0x5b')]);if(this[_0x79e9('0xa')][_0x2cb60c[_0x79e9('0x21')]]){for(var _0x29ffbb in this[_0x79e9('0xa')][_0x2cb60c[_0x79e9('0x21')]]){if(this[_0x79e9('0xa')][_0x2cb60c[_0x79e9('0x21')]]['hasOwnProperty'](_0x29ffbb)){if(_['isUndefined'](this[_0x79e9('0xa')][_0x2cb60c[_0x79e9('0x21')]][_0x29ffbb][_0x79e9('0xd')])){this[_0x79e9('0xa')][_0x2cb60c[_0x79e9('0x21')]][_0x29ffbb][_0x79e9('0xd')]={};}this[_0x79e9('0xa')][_0x2cb60c[_0x79e9('0x21')]][_0x29ffbb][_0x79e9('0xd')]=this[_0x79e9('0xd')][_0x2cb60c['uniqueid']];}}}}}catch(_0x4084d3){logger[_0x79e9('0x31')](_0x79e9('0x5c'),util[_0x79e9('0x33')](_0x4084d3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x79e9('0x1d')][_0x79e9('0x59')]=function(_0x549d9a,_0x1a592f,_0x1976a9){var _0x8e18b4=[_0x79e9('0x5d'),_0x79e9('0x5e'),_0x79e9('0x5f'),_0x79e9('0x60'),_0x79e9('0x61'),_0x79e9('0x62'),'rtpaudioqosrtt',_0x79e9('0x63'),'sipcallid',_0x79e9('0x64'),_0x79e9('0x65'),_0x79e9('0x66'),_0x79e9('0x67'),'memberdynamic',_0x79e9('0x68'),'memberlastcall','membername',_0x79e9('0x69'),_0x79e9('0x6a')];if(!_[_0x79e9('0x6b')](_0x1a592f)&&!_['includes'](_0x8e18b4,_0x1a592f)){if(_[_0x79e9('0x20')](this[_0x79e9('0xd')][_0x549d9a])){this[_0x79e9('0xd')][_0x549d9a]={};}this[_0x79e9('0xd')][_0x549d9a][_0x1a592f]=_0x1976a9;}};VoiceAgentReport[_0x79e9('0x1d')][_0x79e9('0x6c')]=function(_0x54c26d){try{if(this[_0x79e9('0x1f')](_0x54c26d)){if(this[_0x79e9('0xa')][_0x54c26d[_0x79e9('0x21')]]){for(var _0x415a73 in this[_0x79e9('0xa')][_0x54c26d[_0x79e9('0x21')]]){if(this[_0x79e9('0xa')][_0x54c26d[_0x79e9('0x21')]][_0x79e9('0x35')](_0x415a73)){if(this['channels'][_0x54c26d[_0x79e9('0x21')]][_0x415a73][_0x79e9('0x42')]==_0x79e9('0x51')&&this[_0x79e9('0xa')][_0x54c26d[_0x79e9('0x21')]][_0x415a73][_0x79e9('0x13')]){this['channels'][_0x54c26d[_0x79e9('0x21')]][_0x415a73][_0x79e9('0x4e')]=moment()[_0x79e9('0x2d')](_0x79e9('0x23'));}}}ami['emit']('custom:voiceAgentReport',_['values'](this[_0x79e9('0xa')][_0x54c26d[_0x79e9('0x21')]]));delete this[_0x79e9('0xa')][_0x54c26d[_0x79e9('0x21')]];}if(this[_0x79e9('0xd')][_0x54c26d[_0x79e9('0x21')]]){delete this[_0x79e9('0xd')][_0x54c26d['uniqueid']];}}}catch(_0x54b9e9){logger[_0x79e9('0x31')]('[syncHangup][VoiceAgentReport]',util[_0x79e9('0x33')](_0x54b9e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x79e9('0x1d')][_0x79e9('0x1b')]=function(_0x5beba3){try{if(this[_0x79e9('0x1f')](_0x5beba3)){if(this['channels'][_0x5beba3['transfereeuniqueid']]){for(var _0x2c3085 in this[_0x79e9('0xa')][_0x5beba3[_0x79e9('0x6d')]]){if(this['channels'][_0x5beba3[_0x79e9('0x6d')]][_0x79e9('0x35')](_0x2c3085)){if(_0x5beba3[_0x79e9('0x6e')]===_0x2c3085){var _0x2752cc=moment();this[_0x79e9('0xa')][_0x5beba3[_0x79e9('0x6d')]][_0x2c3085]['agentcomplete']=!![];this[_0x79e9('0xa')][_0x5beba3[_0x79e9('0x6d')]][_0x2c3085]['agentcompleteAt']=moment()[_0x79e9('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x79e9('0xa')][_0x5beba3[_0x79e9('0x6d')]][_0x2c3085]['reason']='transfer';this[_0x79e9('0xa')][_0x5beba3[_0x79e9('0x6d')]][_0x2c3085][_0x79e9('0x37')]=_0x79e9('0x4f');this[_0x79e9('0xa')][_0x5beba3[_0x79e9('0x6d')]][_0x2c3085][_0x79e9('0x50')]=_0x2752cc[_0x79e9('0x6f')](this[_0x79e9('0xa')][_0x5beba3[_0x79e9('0x6d')]][_0x2c3085][_0x79e9('0x36')],_0x79e9('0x70'));}}}}if(this[_0x79e9('0xa')][_0x5beba3[_0x79e9('0x71')]]){var _0x9a2948=this[_0x79e9('0xa')][_0x5beba3[_0x79e9('0x71')]];this[_0x79e9('0xa')][_0x5beba3[_0x79e9('0x71')]]=this['channels'][_0x5beba3['transfereeuniqueid']];this[_0x79e9('0xa')][_0x5beba3[_0x79e9('0x6d')]]=_0x9a2948;}}}catch(_0x29f0b2){logger[_0x79e9('0x31')](_0x79e9('0x72'),util[_0x79e9('0x33')](_0x29f0b2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x79e9('0x1d')][_0x79e9('0x73')]=function(_0x49f669){try{if(this[_0x79e9('0x1f')](_0x49f669)){if(this['channels'][_0x49f669['transfereeuniqueid']]){for(var _0x302061 in this['channels'][_0x49f669[_0x79e9('0x6d')]]){if(this[_0x79e9('0xa')][_0x49f669[_0x79e9('0x6d')]][_0x79e9('0x35')](_0x302061)){if(_0x49f669['transfereruniqueid']===_0x302061){var _0x4633a3=moment();this['channels'][_0x49f669['transfereeuniqueid']][_0x302061][_0x79e9('0x13')]=!![];this['channels'][_0x49f669[_0x79e9('0x6d')]][_0x302061][_0x79e9('0x4e')]=_0x4633a3;this[_0x79e9('0xa')][_0x49f669[_0x79e9('0x6d')]][_0x302061][_0x79e9('0x42')]=_0x79e9('0x51');this[_0x79e9('0xa')][_0x49f669[_0x79e9('0x6d')]][_0x302061][_0x79e9('0x37')]=_0x79e9('0x4f');this[_0x79e9('0xa')][_0x49f669['transfereeuniqueid']][_0x302061]['talktime']=_0x4633a3[_0x79e9('0x6f')](this[_0x79e9('0xa')][_0x49f669[_0x79e9('0x6d')]][_0x302061]['agentconnectAt'],'seconds');}}}}}}catch(_0x564f7f){logger[_0x79e9('0x31')]('[syncBlindTransfer][VoiceAgentReport]',util['inspect'](_0x564f7f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x79e9('0x1d')][_0x79e9('0x17')]=function(_0x3a9f5e){var _0x1243fb='';try{if(this[_0x79e9('0x1f')](_0x3a9f5e)){if(_0x3a9f5e[_0x79e9('0x74')]){_0x1243fb=_0x3a9f5e['channel'][_0x79e9('0x75')](0x0,_0x3a9f5e['channel'][_0x79e9('0x76')]('-'));if(this[_0x79e9('0xc')][_0x1243fb]){this[_0x79e9('0xc')][_0x1243fb][_0x79e9('0x77')]=!![];}}}}catch(_0x172e40){logger[_0x79e9('0x31')](_0x79e9('0x78'),util['inspect'](_0x172e40,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x122f16){var _0x38ac0e='';try{if(this['isNotNull'](_0x122f16)){if(_0x122f16[_0x79e9('0x74')]){_0x38ac0e=_0x122f16[_0x79e9('0x74')]['substring'](0x0,_0x122f16[_0x79e9('0x74')][_0x79e9('0x76')]('-'));if(this[_0x79e9('0xc')][_0x38ac0e]){this[_0x79e9('0xc')][_0x38ac0e][_0x79e9('0x77')]=![];}}}}catch(_0x47c74f){logger[_0x79e9('0x31')](_0x79e9('0x79'),util[_0x79e9('0x33')](_0x47c74f,{'showHidden':![],'depth':null}));}};module[_0x79e9('0x7a')]=VoiceAgentReport; \ No newline at end of file +var _0x5ca3=['rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','isNil','includes','custom:voiceAgentReport','values','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','complete','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','channel','[syncMusicOnHoldStart][VoiceAgentReport]','syncMusicOnHoldStop','substring','lastIndexOf','onhold','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','ami','../ami','defaults','localhost','redis','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','blindtransfer','syncBlindTransfer','emit','isNotNull','isUndefined','prototype','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','omit','event','privilege','custom:agentcalled','user:%s','membername','user:called','[syncAgentCalled][VoiceAgentReport]','inspect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','user:agentconnect','custom:agentconnect','agentringnoanswer','agentringnoanswerAt','reason','lastevent','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','syncAgentRingNoAnswer','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','hasOwnProperty','abandoned','custom:agentqueuecallerabandon','error','agentconnectAt','agentcompleteAt','talktime','transfer','acw','agentacw','acwtime','acwTimeout','destconnectedlinenum','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','syncVarSet','keys','variable','value','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt'];(function(_0x4a7c6c,_0x38fe06){var _0x4fe4be=function(_0x40f8b1){while(--_0x40f8b1){_0x4a7c6c['push'](_0x4a7c6c['shift']());}};_0x4fe4be(++_0x38fe06);}(_0x5ca3,0x9c));var _0x35ca=function(_0x2143cd,_0x1da17b){_0x2143cd=_0x2143cd-0x0;var _0x2022e4=_0x5ca3[_0x2143cd];return _0x2022e4;};'use strict';var _=require(_0x35ca('0x0'));var moment=require(_0x35ca('0x1'));var util=require(_0x35ca('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x35ca('0x3'));var ami=require(_0x35ca('0x4'));config['redis']=_[_0x35ca('0x5')](config['redis'],{'host':_0x35ca('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35ca('0x7')]));function VoiceAgentReport(_0x45b41e){this[_0x35ca('0x8')]={};this[_0x35ca('0x9')]=_0x45b41e[_0x35ca('0x9')];this[_0x35ca('0xa')]=_0x45b41e['agents'];this[_0x35ca('0xb')]={};ami['on'](_0x35ca('0xc'),this[_0x35ca('0xd')]['bind'](this));ami['on'](_0x35ca('0xe'),this[_0x35ca('0xf')][_0x35ca('0x10')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x35ca('0x11'),this[_0x35ca('0x12')][_0x35ca('0x10')](this));ami['on'](_0x35ca('0x13'),this[_0x35ca('0x14')]['bind'](this));ami['on'](_0x35ca('0x15'),this['syncVarSet'][_0x35ca('0x10')](this));ami['on'](_0x35ca('0x16'),this[_0x35ca('0x17')][_0x35ca('0x10')](this));ami['on'](_0x35ca('0x18'),this[_0x35ca('0x19')][_0x35ca('0x10')](this));ami['on'](_0x35ca('0x1a'),this['syncMusicOnHoldStop'][_0x35ca('0x10')](this));ami['on'](_0x35ca('0x1b'),this['syncAttendedTransfer'][_0x35ca('0x10')](this));ami['on'](_0x35ca('0x1c'),this[_0x35ca('0x1d')][_0x35ca('0x10')](this));}VoiceAgentReport['prototype'][_0x35ca('0x1e')]=function(_0x32e34b,_0x55b85f,_0xc63a34){io['to'](_0x32e34b)['emit'](_0x55b85f,_0xc63a34);};VoiceAgentReport['prototype'][_0x35ca('0x1f')]=function(_0x3fd785){return _0x3fd785!==null&&!_[_0x35ca('0x20')](_0x3fd785);};VoiceAgentReport[_0x35ca('0x21')][_0x35ca('0xd')]=function(_0x3ce8dd){try{if(this[_0x35ca('0x1f')](_0x3ce8dd)){if(_[_0x35ca('0x20')](this[_0x35ca('0x8')][_0x3ce8dd[_0x35ca('0x22')]])){this[_0x35ca('0x8')][_0x3ce8dd[_0x35ca('0x22')]]={};}if(_[_0x35ca('0x20')](this[_0x35ca('0x8')][_0x3ce8dd[_0x35ca('0x22')]][_0x3ce8dd[_0x35ca('0x23')]])){this[_0x35ca('0x8')][_0x3ce8dd[_0x35ca('0x22')]][_0x3ce8dd[_0x35ca('0x23')]]={'agentcalledAt':moment()[_0x35ca('0x24')](_0x35ca('0x25')),'lastevent':'called','variables':this[_0x35ca('0xb')][_0x3ce8dd[_0x35ca('0x22')]],'type':this[_0x35ca('0x9')][_0x3ce8dd[_0x35ca('0x26')]]?this['voiceQueues'][_0x3ce8dd[_0x35ca('0x26')]][_0x35ca('0x27')]||_0x35ca('0x28'):_0x35ca('0x28')};}_['merge'](this[_0x35ca('0x8')][_0x3ce8dd[_0x35ca('0x22')]][_0x3ce8dd[_0x35ca('0x23')]],_[_0x35ca('0x29')](_0x3ce8dd,[_0x35ca('0x2a'),_0x35ca('0x2b')]));ami['emit'](_0x35ca('0x2c'),this['channels'][_0x3ce8dd[_0x35ca('0x22')]][_0x3ce8dd[_0x35ca('0x23')]]);this[_0x35ca('0x1e')](util[_0x35ca('0x24')](_0x35ca('0x2d'),_0x3ce8dd[_0x35ca('0x2e')]),_0x35ca('0x2f'),this[_0x35ca('0x8')][_0x3ce8dd[_0x35ca('0x22')]][_0x3ce8dd[_0x35ca('0x23')]]);}}catch(_0x367f40){logger['error'](_0x35ca('0x30'),util[_0x35ca('0x31')](_0x367f40,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x35ca('0x21')][_0x35ca('0xf')]=function(_0x3ea59b){try{if(this['isNotNull'](_0x3ea59b)){if(this['channels'][_0x3ea59b[_0x35ca('0x22')]]){for(var _0x32432a in this['channels'][_0x3ea59b['uniqueid']]){if(this[_0x35ca('0x8')][_0x3ea59b[_0x35ca('0x22')]]['hasOwnProperty'](_0x32432a)){if(_0x3ea59b[_0x35ca('0x23')]===_0x32432a){this['channels'][_0x3ea59b[_0x35ca('0x22')]][_0x32432a]['agentconnectAt']=moment()[_0x35ca('0x24')](_0x35ca('0x25'));this['channels'][_0x3ea59b[_0x35ca('0x22')]][_0x32432a]['lastevent']='connect';this[_0x35ca('0x8')][_0x3ea59b[_0x35ca('0x22')]][_0x32432a][_0x35ca('0x32')]=_0x3ea59b[_0x35ca('0x32')];this[_0x35ca('0x8')][_0x3ea59b[_0x35ca('0x22')]][_0x32432a]['connectedlinenum']=_0x3ea59b[_0x35ca('0x33')];this['channels'][_0x3ea59b[_0x35ca('0x22')]][_0x32432a][_0x35ca('0x34')]=_0x3ea59b[_0x35ca('0x34')];this['channels'][_0x3ea59b[_0x35ca('0x22')]][_0x32432a][_0x35ca('0x35')]=_0x3ea59b[_0x35ca('0x35')];this['channels'][_0x3ea59b[_0x35ca('0x22')]][_0x32432a]['destchannelstatedesc']=_0x3ea59b[_0x35ca('0x36')];_[_0x35ca('0x37')](this[_0x35ca('0xa')][_0x3ea59b[_0x35ca('0x38')]],_['pick'](_0x3ea59b,[_0x35ca('0x26'),'destconnectedlinenum']));this[_0x35ca('0x1e')](util[_0x35ca('0x24')](_0x35ca('0x2d'),_0x3ea59b[_0x35ca('0x2e')]),_0x35ca('0x39'),this[_0x35ca('0x8')][_0x3ea59b['uniqueid']][_0x3ea59b[_0x35ca('0x23')]]);ami['emit'](_0x35ca('0x3a'),this['channels'][_0x3ea59b[_0x35ca('0x22')]][_0x32432a]);}else if(!this[_0x35ca('0x8')][_0x3ea59b['uniqueid']][_0x32432a][_0x35ca('0x3b')]&&!this[_0x35ca('0x8')][_0x3ea59b[_0x35ca('0x22')]][_0x32432a][_0x35ca('0x13')]){this[_0x35ca('0x8')][_0x3ea59b[_0x35ca('0x22')]][_0x32432a][_0x35ca('0x3b')]=!![];this[_0x35ca('0x8')][_0x3ea59b[_0x35ca('0x22')]][_0x32432a][_0x35ca('0x3c')]=moment()['format'](_0x35ca('0x25'));this[_0x35ca('0x8')][_0x3ea59b[_0x35ca('0x22')]][_0x32432a][_0x35ca('0x3d')]='answered_elsewhere';this[_0x35ca('0x8')][_0x3ea59b[_0x35ca('0x22')]][_0x32432a][_0x35ca('0x3e')]=_0x35ca('0x3f');this[_0x35ca('0x8')][_0x3ea59b[_0x35ca('0x22')]][_0x32432a][_0x35ca('0x40')]=_0x3ea59b[_0x35ca('0x23')];this[_0x35ca('0x8')][_0x3ea59b[_0x35ca('0x22')]][_0x32432a]['answeredelsewheremembername']=_0x3ea59b['membername'];ami[_0x35ca('0x1e')](_0x35ca('0x41'),this[_0x35ca('0x8')][_0x3ea59b[_0x35ca('0x22')]][_0x32432a]);}}}}}}catch(_0x193c51){logger['error'](_0x35ca('0x42'),util[_0x35ca('0x31')](_0x193c51,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x35ca('0x21')][_0x35ca('0x43')]=function(_0x513be5){try{if(this[_0x35ca('0x1f')](_0x513be5)){if(this[_0x35ca('0x8')][_0x513be5[_0x35ca('0x22')]]&&this[_0x35ca('0x8')][_0x513be5[_0x35ca('0x22')]][_0x513be5[_0x35ca('0x23')]]){this['channels'][_0x513be5[_0x35ca('0x22')]][_0x513be5['destuniqueid']][_0x35ca('0x3b')]=!![];this[_0x35ca('0x8')][_0x513be5['uniqueid']][_0x513be5[_0x35ca('0x23')]][_0x35ca('0x3c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x513be5['uniqueid']][_0x513be5[_0x35ca('0x23')]][_0x35ca('0x3d')]='rejected';this['channels'][_0x513be5['uniqueid']][_0x513be5[_0x35ca('0x23')]]['lastevent']=_0x35ca('0x44');ami[_0x35ca('0x1e')](_0x35ca('0x45'),this[_0x35ca('0x8')][_0x513be5[_0x35ca('0x22')]][_0x513be5[_0x35ca('0x23')]]);}}}catch(_0x1e55a8){logger['error'](_0x35ca('0x46'),util[_0x35ca('0x31')](_0x1e55a8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x35ca('0x21')][_0x35ca('0x12')]=function(_0x5c9a65){try{if(this[_0x35ca('0x1f')](_0x5c9a65)){if(this[_0x35ca('0x8')][_0x5c9a65['uniqueid']]){for(var _0x2e6bcd in this[_0x35ca('0x8')][_0x5c9a65[_0x35ca('0x22')]]){if(this['channels'][_0x5c9a65[_0x35ca('0x22')]][_0x35ca('0x47')](_0x2e6bcd)&&!this[_0x35ca('0x8')][_0x5c9a65[_0x35ca('0x22')]][_0x2e6bcd][_0x35ca('0x3b')]&&!this['channels'][_0x5c9a65[_0x35ca('0x22')]][_0x2e6bcd]['agentcomplete']){this[_0x35ca('0x8')][_0x5c9a65[_0x35ca('0x22')]][_0x2e6bcd][_0x35ca('0x3b')]=!![];this[_0x35ca('0x8')][_0x5c9a65[_0x35ca('0x22')]][_0x2e6bcd][_0x35ca('0x3c')]=moment()[_0x35ca('0x24')](_0x35ca('0x25'));this[_0x35ca('0x8')][_0x5c9a65[_0x35ca('0x22')]][_0x2e6bcd][_0x35ca('0x3d')]=_0x35ca('0x48');this[_0x35ca('0x8')][_0x5c9a65['uniqueid']][_0x2e6bcd][_0x35ca('0x3e')]='abandoned';ami[_0x35ca('0x1e')](_0x35ca('0x49'),this['channels'][_0x5c9a65['uniqueid']][_0x2e6bcd]);}}}}}catch(_0x6fa5e9){logger[_0x35ca('0x4a')]('[syncQueueCallerAbandon][VoiceAgentReport]',util[_0x35ca('0x31')](_0x6fa5e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x35ca('0x21')][_0x35ca('0x14')]=function(_0x3c9217){try{if(this['isNotNull'](_0x3c9217)){if(this[_0x35ca('0x8')][_0x3c9217[_0x35ca('0x22')]]){for(var _0x34723c in this[_0x35ca('0x8')][_0x3c9217[_0x35ca('0x22')]]){if(this['channels'][_0x3c9217[_0x35ca('0x22')]][_0x35ca('0x47')](_0x34723c)){if(this[_0x35ca('0x8')][_0x3c9217[_0x35ca('0x22')]][_0x34723c][_0x35ca('0x4b')]&&!this[_0x35ca('0x8')][_0x3c9217[_0x35ca('0x22')]][_0x34723c][_0x35ca('0x13')]){this[_0x35ca('0x8')][_0x3c9217[_0x35ca('0x22')]][_0x34723c][_0x35ca('0x13')]=!![];this[_0x35ca('0x8')][_0x3c9217[_0x35ca('0x22')]][_0x34723c][_0x35ca('0x4c')]=moment()[_0x35ca('0x24')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3c9217['uniqueid']][_0x34723c][_0x35ca('0x3e')]='complete';this[_0x35ca('0x8')][_0x3c9217[_0x35ca('0x22')]][_0x34723c][_0x35ca('0x4d')]=_0x3c9217['talktime'];this['channels'][_0x3c9217[_0x35ca('0x22')]][_0x34723c][_0x35ca('0x3d')]=_0x3c9217[_0x35ca('0x3d')]==_0x35ca('0x4e')?'agent':_0x3c9217[_0x35ca('0x3d')];if(this[_0x35ca('0x9')][_0x3c9217[_0x35ca('0x26')]]&&this[_0x35ca('0x9')][_0x3c9217[_0x35ca('0x26')]][_0x35ca('0x4f')]){this[_0x35ca('0x8')][_0x3c9217[_0x35ca('0x22')]][_0x34723c][_0x35ca('0x50')]=!![];this[_0x35ca('0x8')][_0x3c9217[_0x35ca('0x22')]][_0x34723c][_0x35ca('0x51')]=this['voiceQueues'][_0x3c9217['queue']][_0x35ca('0x52')];}this[_0x35ca('0xa')][_0x3c9217['interface']]=_['omit'](this[_0x35ca('0xa')][_0x3c9217['interface']],[_0x35ca('0x26'),_0x35ca('0x53')]);this[_0x35ca('0x1e')](util['format'](_0x35ca('0x2d'),_0x3c9217['membername']),_0x35ca('0x54'),this[_0x35ca('0x8')][_0x3c9217['uniqueid']][_0x34723c]);ami['emit'](_0x35ca('0x55'),this[_0x35ca('0x8')][_0x3c9217[_0x35ca('0x22')]][_0x34723c]);}}}}}}catch(_0x20908f){logger['error'](_0x35ca('0x56'),util[_0x35ca('0x31')](_0x20908f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x35ca('0x21')][_0x35ca('0x57')]=function(_0x1694e8){try{if(this['isNotNull'](_0x1694e8)){this['addVariable'](_0x1694e8[_0x35ca('0x22')],_[_0x35ca('0x58')](_0x1694e8[_0x35ca('0x59')])[0x0],_0x1694e8[_0x35ca('0x5a')]);if(this[_0x35ca('0x8')][_0x1694e8['uniqueid']]){for(var _0x3a38e5 in this[_0x35ca('0x8')][_0x1694e8['uniqueid']]){if(this[_0x35ca('0x8')][_0x1694e8['uniqueid']][_0x35ca('0x47')](_0x3a38e5)){if(_[_0x35ca('0x20')](this['channels'][_0x1694e8[_0x35ca('0x22')]][_0x3a38e5][_0x35ca('0xb')])){this[_0x35ca('0x8')][_0x1694e8[_0x35ca('0x22')]][_0x3a38e5][_0x35ca('0xb')]={};}this[_0x35ca('0x8')][_0x1694e8[_0x35ca('0x22')]][_0x3a38e5][_0x35ca('0xb')]=this[_0x35ca('0xb')][_0x1694e8[_0x35ca('0x22')]];}}}}}catch(_0x3a4497){logger['error']('[syncVarSet][VoiceAgentReport]',util['inspect'](_0x3a4497,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x35ca('0x21')][_0x35ca('0x5b')]=function(_0x3e0bba,_0x1d3add,_0x1e899c){var _0x54e5b7=[_0x35ca('0x5c'),_0x35ca('0x5d'),'rtpaudioqosjitter',_0x35ca('0x5e'),_0x35ca('0x5f'),_0x35ca('0x60'),_0x35ca('0x61'),_0x35ca('0x62'),'sipcallid',_0x35ca('0x63'),_0x35ca('0x64'),_0x35ca('0x65'),_0x35ca('0x66'),_0x35ca('0x67'),_0x35ca('0x68'),'memberlastcall',_0x35ca('0x2e'),_0x35ca('0x69'),'memberrealtime'];if(!_[_0x35ca('0x6a')](_0x1d3add)&&!_[_0x35ca('0x6b')](_0x54e5b7,_0x1d3add)){if(_[_0x35ca('0x20')](this[_0x35ca('0xb')][_0x3e0bba])){this[_0x35ca('0xb')][_0x3e0bba]={};}this['variables'][_0x3e0bba][_0x1d3add]=_0x1e899c;}};VoiceAgentReport[_0x35ca('0x21')]['syncHangup']=function(_0x19d825){try{if(this[_0x35ca('0x1f')](_0x19d825)){if(this['channels'][_0x19d825[_0x35ca('0x22')]]){for(var _0x45ad8d in this[_0x35ca('0x8')][_0x19d825['uniqueid']]){if(this[_0x35ca('0x8')][_0x19d825[_0x35ca('0x22')]][_0x35ca('0x47')](_0x45ad8d)){if(this[_0x35ca('0x8')][_0x19d825['uniqueid']][_0x45ad8d][_0x35ca('0x3d')]==_0x35ca('0x4e')&&this[_0x35ca('0x8')][_0x19d825[_0x35ca('0x22')]][_0x45ad8d][_0x35ca('0x13')]){this[_0x35ca('0x8')][_0x19d825[_0x35ca('0x22')]][_0x45ad8d][_0x35ca('0x4c')]=moment()[_0x35ca('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0x35ca('0x1e')](_0x35ca('0x6c'),_[_0x35ca('0x6d')](this[_0x35ca('0x8')][_0x19d825[_0x35ca('0x22')]]));delete this[_0x35ca('0x8')][_0x19d825[_0x35ca('0x22')]];}if(this['variables'][_0x19d825[_0x35ca('0x22')]]){delete this[_0x35ca('0xb')][_0x19d825[_0x35ca('0x22')]];}}}catch(_0x18285e){logger[_0x35ca('0x4a')]('[syncHangup][VoiceAgentReport]',util[_0x35ca('0x31')](_0x18285e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x35ca('0x21')][_0x35ca('0x6e')]=function(_0x130468){try{if(this[_0x35ca('0x1f')](_0x130468)){if(this[_0x35ca('0x8')][_0x130468[_0x35ca('0x6f')]]){for(var _0xf8e96c in this[_0x35ca('0x8')][_0x130468[_0x35ca('0x6f')]]){if(this[_0x35ca('0x8')][_0x130468[_0x35ca('0x6f')]][_0x35ca('0x47')](_0xf8e96c)){if(_0x130468[_0x35ca('0x70')]===_0xf8e96c){var _0x472270=moment();this[_0x35ca('0x8')][_0x130468[_0x35ca('0x6f')]][_0xf8e96c][_0x35ca('0x13')]=!![];this[_0x35ca('0x8')][_0x130468[_0x35ca('0x6f')]][_0xf8e96c][_0x35ca('0x4c')]=moment()['format'](_0x35ca('0x25'));this['channels'][_0x130468['transfereeuniqueid']][_0xf8e96c][_0x35ca('0x3d')]=_0x35ca('0x4e');this[_0x35ca('0x8')][_0x130468[_0x35ca('0x6f')]][_0xf8e96c][_0x35ca('0x3e')]=_0x35ca('0x71');this[_0x35ca('0x8')][_0x130468[_0x35ca('0x6f')]][_0xf8e96c][_0x35ca('0x4d')]=_0x472270[_0x35ca('0x72')](this[_0x35ca('0x8')][_0x130468[_0x35ca('0x6f')]][_0xf8e96c][_0x35ca('0x4b')],_0x35ca('0x73'));}}}}if(this[_0x35ca('0x8')][_0x130468[_0x35ca('0x74')]]){var _0x2bd602=this[_0x35ca('0x8')][_0x130468[_0x35ca('0x74')]];this[_0x35ca('0x8')][_0x130468[_0x35ca('0x74')]]=this['channels'][_0x130468[_0x35ca('0x6f')]];this[_0x35ca('0x8')][_0x130468[_0x35ca('0x6f')]]=_0x2bd602;}}}catch(_0x55ada6){logger['error'](_0x35ca('0x75'),util['inspect'](_0x55ada6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x35ca('0x21')][_0x35ca('0x1d')]=function(_0x5453e4){try{if(this[_0x35ca('0x1f')](_0x5453e4)){if(this[_0x35ca('0x8')][_0x5453e4[_0x35ca('0x6f')]]){for(var _0x3d62c1 in this[_0x35ca('0x8')][_0x5453e4['transfereeuniqueid']]){if(this['channels'][_0x5453e4[_0x35ca('0x6f')]][_0x35ca('0x47')](_0x3d62c1)){if(_0x5453e4[_0x35ca('0x76')]===_0x3d62c1){var _0x18b0da=moment();this['channels'][_0x5453e4[_0x35ca('0x6f')]][_0x3d62c1][_0x35ca('0x13')]=!![];this[_0x35ca('0x8')][_0x5453e4[_0x35ca('0x6f')]][_0x3d62c1][_0x35ca('0x4c')]=_0x18b0da;this['channels'][_0x5453e4['transfereeuniqueid']][_0x3d62c1]['reason']=_0x35ca('0x4e');this[_0x35ca('0x8')][_0x5453e4[_0x35ca('0x6f')]][_0x3d62c1]['lastevent']='complete';this[_0x35ca('0x8')][_0x5453e4[_0x35ca('0x6f')]][_0x3d62c1]['talktime']=_0x18b0da[_0x35ca('0x72')](this[_0x35ca('0x8')][_0x5453e4[_0x35ca('0x6f')]][_0x3d62c1][_0x35ca('0x4b')],_0x35ca('0x73'));}}}}}}catch(_0x107743){logger[_0x35ca('0x4a')]('[syncBlindTransfer][VoiceAgentReport]',util[_0x35ca('0x31')](_0x107743,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x35ca('0x21')]['syncMusicOnHoldStart']=function(_0x4750f4){var _0x21a854='';try{if(this[_0x35ca('0x1f')](_0x4750f4)){if(_0x4750f4[_0x35ca('0x77')]){_0x21a854=_0x4750f4['channel']['substring'](0x0,_0x4750f4[_0x35ca('0x77')]['lastIndexOf']('-'));if(this[_0x35ca('0xa')][_0x21a854]){this[_0x35ca('0xa')][_0x21a854]['onhold']=!![];}}}}catch(_0x21674d){logger['error'](_0x35ca('0x78'),util[_0x35ca('0x31')](_0x21674d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x35ca('0x79')]=function(_0x3e69bd){var _0x3a3243='';try{if(this[_0x35ca('0x1f')](_0x3e69bd)){if(_0x3e69bd[_0x35ca('0x77')]){_0x3a3243=_0x3e69bd[_0x35ca('0x77')][_0x35ca('0x7a')](0x0,_0x3e69bd[_0x35ca('0x77')][_0x35ca('0x7b')]('-'));if(this[_0x35ca('0xa')][_0x3a3243]){this[_0x35ca('0xa')][_0x3a3243][_0x35ca('0x7c')]=![];}}}}catch(_0x3c8ee4){logger[_0x35ca('0x4a')](_0x35ca('0x7d'),util['inspect'](_0x3c8ee4,{'showHidden':![],'depth':null}));}};module[_0x35ca('0x7e')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index af784e5..0c3a7f5 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1bd=['util','ioredis','../../../config/environment','ami','unknown','inuse','busy','invalid','ringinuse','onhold','queue','dial','playback','voicemail','FAILED','NO\x20ANSWER','redis','defaults','localhost','socket.io-emitter','channels','agents','bind','newexten','syncNewExten','newchannel','syncNewChannel','syncNewState','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','catch','log','prototype','isNotNull','isUndefined','emit','linkedid','merge','pick','keys','uniqueid','error','[syncNewCallerId][VoiceCallReport]','inspect','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','context','from-sip','split','channel','destconnectedlinenum','exten','user:%s','name','user:agentconnect','[syncNewChannel][VoiceCallReport]','application','toLowerCase','appdata','duration','subtract','seconds','includes','lastapplication','lastdata','applicationdata','set','startsWith','match','answered','answertime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','.wav49','replace','.WAV','monitorFilename','monitors','isNil','rec','variable','mixmonitor_filename','xmd-phone','value','xmd-callerid','callerid','type','xmd-queue','xmd-destination','destination','xmd-callerid-preview','calleridpreview','sipcallid','sipcalluniqueid','[syncVarSet][VoiceCallReport]','syncHangup','omit','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','syncBlindTransfer','transfereecalleridnum','extension','[syncBlindTransfer][VoiceCallReport]','mohstarttime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','moment'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xd1bd,0x8a));var _0xdd1b=function(_0x3e1896,_0x531fab){_0x3e1896=_0x3e1896-0x0;var _0x3a5074=_0xd1bd[_0x3e1896];return _0x3a5074;};'use strict';var BPromise=require(_0xdd1b('0x0'));var _=require('lodash');var moment=require(_0xdd1b('0x1'));var util=require(_0xdd1b('0x2'));var path=require('path');var Redis=require(_0xdd1b('0x3'));var config=require(_0xdd1b('0x4'));var logger=require('../../../config/logger')(_0xdd1b('0x5'));var ami=require('../ami');var Channel=require('../model/channel');var statusDesc=[_0xdd1b('0x6'),'not_inuse',_0xdd1b('0x7'),_0xdd1b('0x8'),_0xdd1b('0x9'),'unavailable','ringing',_0xdd1b('0xa'),_0xdd1b('0xb')];var applications=['set',_0xdd1b('0xc'),'agi',_0xdd1b('0xd'),_0xdd1b('0xe'),_0xdd1b('0xf')];var dispositions=['NO\x20ANSWER',_0xdd1b('0x10'),_0xdd1b('0x10'),_0xdd1b('0x11'),_0xdd1b('0x11'),_0xdd1b('0x11'),'ANSWERED','BUSY',_0xdd1b('0x10'),_0xdd1b('0x10'),_0xdd1b('0x10')];var actions={};config[_0xdd1b('0x12')]=_[_0xdd1b('0x13')](config['redis'],{'host':_0xdd1b('0x14'),'port':0x18eb});var io=require(_0xdd1b('0x15'))(new Redis(config['redis']));function VoiceCallReport(_0x4c1224){this[_0xdd1b('0x16')]=_0x4c1224[_0xdd1b('0x16')];this[_0xdd1b('0x17')]=_0x4c1224[_0xdd1b('0x17')];ami['on']('coreshowchannel',this['syncNewExten'][_0xdd1b('0x18')](this));ami['on'](_0xdd1b('0x19'),this[_0xdd1b('0x1a')][_0xdd1b('0x18')](this));ami['on'](_0xdd1b('0x1b'),this[_0xdd1b('0x1c')][_0xdd1b('0x18')](this));ami['on']('newstate',this[_0xdd1b('0x1d')][_0xdd1b('0x18')](this));ami['on']('varset',this['syncVarSet'][_0xdd1b('0x18')](this));ami['on'](_0xdd1b('0x1e'),this['syncHangup'][_0xdd1b('0x18')](this));ami['on'](_0xdd1b('0x1f'),this[_0xdd1b('0x20')][_0xdd1b('0x18')](this));ami['on'](_0xdd1b('0x21'),this[_0xdd1b('0x22')][_0xdd1b('0x18')](this));ami['on'](_0xdd1b('0x23'),this['syncBlindTransfer']['bind'](this));ami['on']('musiconholdstart',this[_0xdd1b('0x24')][_0xdd1b('0x18')](this));ami['on'](_0xdd1b('0x25'),this[_0xdd1b('0x26')]['bind'](this));return BPromise[_0xdd1b('0x27')]()[_0xdd1b('0x28')](ami['actionCoreShowChannels']())[_0xdd1b('0x29')](function(_0x2cc51e){console[_0xdd1b('0x2a')](_0x2cc51e);});}VoiceCallReport[_0xdd1b('0x2b')][_0xdd1b('0x2c')]=function(_0x4b93a4){return _0x4b93a4!==null&&!_[_0xdd1b('0x2d')](_0x4b93a4);};VoiceCallReport[_0xdd1b('0x2b')][_0xdd1b('0x2e')]=function(_0x2ea17c,_0x1bd13f,_0x4d8e3d){io['to'](_0x2ea17c)[_0xdd1b('0x2e')](_0x1bd13f,_0x4d8e3d);};VoiceCallReport[_0xdd1b('0x2b')][_0xdd1b('0x20')]=function(_0x2f473d){try{if(this[_0xdd1b('0x2c')](_0x2f473d)){if(_0x2f473d['uniqueid']===_0x2f473d[_0xdd1b('0x2f')]){if(!_[_0xdd1b('0x2d')](this[_0xdd1b('0x16')][_0x2f473d['uniqueid']])){_[_0xdd1b('0x30')](this['channels'][_0x2f473d['uniqueid']],_[_0xdd1b('0x31')](_0x2f473d,_[_0xdd1b('0x32')](this[_0xdd1b('0x16')][_0x2f473d[_0xdd1b('0x33')]])));}}}}catch(_0x4fc609){logger[_0xdd1b('0x34')](_0xdd1b('0x35'),util[_0xdd1b('0x36')](_0x4fc609,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdd1b('0x2b')][_0xdd1b('0x1c')]=function(_0x4f723b){try{if(this['isNotNull'](_0x4f723b)){if(_0x4f723b['uniqueid']===_0x4f723b[_0xdd1b('0x2f')]&&_0x4f723b['channel']!=_0xdd1b('0x37')){if(_[_0xdd1b('0x2d')](this['channels'][_0x4f723b['uniqueid']])){this['channels'][_0x4f723b[_0xdd1b('0x33')]]=new Channel();this[_0xdd1b('0x16')][_0x4f723b[_0xdd1b('0x33')]][_0xdd1b('0x38')]=moment()[_0xdd1b('0x39')](_0xdd1b('0x3a'));this['channels'][_0x4f723b['uniqueid']][_0xdd1b('0x3b')]=dispositions[_[_0xdd1b('0x3c')](_0x4f723b[_0xdd1b('0x3d')])];_[_0xdd1b('0x30')](this[_0xdd1b('0x16')][_0x4f723b['uniqueid']],_[_0xdd1b('0x31')](_0x4f723b,_['keys'](this[_0xdd1b('0x16')][_0x4f723b[_0xdd1b('0x33')]])));if(_0x4f723b[_0xdd1b('0x3e')]===_0xdd1b('0x3f')){if(this[_0xdd1b('0x17')][_0x4f723b['channel'][_0xdd1b('0x40')]('-')[0x0]]){this[_0xdd1b('0x17')][_0x4f723b[_0xdd1b('0x41')]['split']('-')[0x0]][_0xdd1b('0x42')]=_0x4f723b[_0xdd1b('0x43')];this[_0xdd1b('0x2e')](util[_0xdd1b('0x39')](_0xdd1b('0x44'),this['agents'][_0x4f723b[_0xdd1b('0x41')]['split']('-')[0x0]][_0xdd1b('0x45')]),_0xdd1b('0x46'),{'destaccountcode':this['agents'][_0x4f723b[_0xdd1b('0x41')][_0xdd1b('0x40')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x4f723b[_0xdd1b('0x43')]});}}}}}}catch(_0x362a43){logger[_0xdd1b('0x34')](_0xdd1b('0x47'),util[_0xdd1b('0x36')](_0x362a43,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdd1b('0x2b')][_0xdd1b('0x1a')]=function(_0x41dcdb){try{if(this[_0xdd1b('0x2c')](_0x41dcdb)){if(_0x41dcdb[_0xdd1b('0x33')]===_0x41dcdb['linkedid']&&_0x41dcdb[_0xdd1b('0x43')]!='h'&&_0x41dcdb[_0xdd1b('0x41')]!='OutgoingSpoolFailed'){_0x41dcdb[_0xdd1b('0x48')]=_0x41dcdb['application'][_0xdd1b('0x49')]();_0x41dcdb['applicationdata']=(_0x41dcdb[_0xdd1b('0x4a')]||_0x41dcdb['applicationdata'])[_0xdd1b('0x49')]();if(_['isUndefined'](this['channels'][_0x41dcdb[_0xdd1b('0x33')]])){this['channels'][_0x41dcdb[_0xdd1b('0x33')]]=new Channel();this[_0xdd1b('0x16')][_0x41dcdb['uniqueid']][_0xdd1b('0x38')]=_0x41dcdb[_0xdd1b('0x4b')]?moment()[_0xdd1b('0x4c')](moment[_0xdd1b('0x4b')](_0x41dcdb[_0xdd1b('0x4b')])[_0xdd1b('0x4d')](),_0xdd1b('0x4d'))[_0xdd1b('0x39')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xdd1b('0x39')](_0xdd1b('0x3a'));this[_0xdd1b('0x16')][_0x41dcdb['uniqueid']][_0xdd1b('0x3b')]=_0xdd1b('0x11');}_['merge'](this[_0xdd1b('0x16')][_0x41dcdb[_0xdd1b('0x33')]],_[_0xdd1b('0x31')](_0x41dcdb,_[_0xdd1b('0x32')](this[_0xdd1b('0x16')][_0x41dcdb[_0xdd1b('0x33')]])));if(_[_0xdd1b('0x4e')](applications,_0x41dcdb[_0xdd1b('0x48')])){this[_0xdd1b('0x16')][_0x41dcdb[_0xdd1b('0x33')]][_0xdd1b('0x4f')]=_0x41dcdb[_0xdd1b('0x48')];this[_0xdd1b('0x16')][_0x41dcdb['uniqueid']][_0xdd1b('0x50')]=_0x41dcdb[_0xdd1b('0x51')];if(_0x41dcdb[_0xdd1b('0x48')]===_0xdd1b('0x52')&&_[_0xdd1b('0x53')](_0x41dcdb[_0xdd1b('0x51')],'cdr(')){var _0x2f549e=_0x41dcdb['applicationdata'][_0xdd1b('0x40')]('=');var _0x1c0034=_0x2f549e[0x0][_0xdd1b('0x54')](/cdr\((.*)\)/);if(_0x1c0034){this[_0xdd1b('0x16')][_0x41dcdb[_0xdd1b('0x33')]][_0x1c0034[0x1]]=_0x2f549e[0x1];}}else if(_0x41dcdb[_0xdd1b('0x48')]==='queue'){this[_0xdd1b('0x16')][_0x41dcdb[_0xdd1b('0x33')]]['queue']=_0x41dcdb[_0xdd1b('0x51')][_0xdd1b('0x40')](',')[0x0];}}}}}catch(_0x400ee5){logger[_0xdd1b('0x34')]('[syncNewExten][VoiceCallReport]',util[_0xdd1b('0x36')](_0x400ee5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdd1b('0x2b')]['syncNewState']=function(_0x30187e){try{if(this[_0xdd1b('0x2c')](_0x30187e)){if(_0x30187e[_0xdd1b('0x33')]!==_0x30187e[_0xdd1b('0x2f')]){if(this[_0xdd1b('0x16')][_0x30187e[_0xdd1b('0x2f')]]){if(_0x30187e[_0xdd1b('0x3d')]==='6'){if(!this['channels'][_0x30187e[_0xdd1b('0x2f')]][_0xdd1b('0x55')]){var _0x1833c8=moment();this[_0xdd1b('0x16')][_0x30187e[_0xdd1b('0x2f')]][_0xdd1b('0x55')]=!![];this[_0xdd1b('0x16')][_0x30187e[_0xdd1b('0x2f')]][_0xdd1b('0x56')]=_0x1833c8[_0xdd1b('0x39')](_0xdd1b('0x3a'));if(this[_0xdd1b('0x16')][_0x30187e['linkedid']]['starttime']){this['channels'][_0x30187e['linkedid']][_0xdd1b('0x57')]=_0x1833c8[_0xdd1b('0x58')](this['channels'][_0x30187e[_0xdd1b('0x2f')]]['starttime'],_0xdd1b('0x4d'));}}this[_0xdd1b('0x16')][_0x30187e[_0xdd1b('0x2f')]]['linkedid']=_0x30187e[_0xdd1b('0x33')];if(_0x30187e[_0xdd1b('0x59')]!==_0xdd1b('0x5a')){this[_0xdd1b('0x16')][_0x30187e['linkedid']][_0xdd1b('0x5b')]=_0x30187e[_0xdd1b('0x59')];}this[_0xdd1b('0x16')][_0x30187e[_0xdd1b('0x2f')]]['connectedlinename']=_0x30187e['calleridname'];this[_0xdd1b('0x16')][_0x30187e['linkedid']][_0xdd1b('0x5c')]=_0x30187e[_0xdd1b('0x41')];this['channels'][_0x30187e['linkedid']][_0xdd1b('0x3b')]=dispositions[_[_0xdd1b('0x3c')](_0x30187e['channelstate'])];if(this[_0xdd1b('0x17')][_0x30187e[_0xdd1b('0x41')][_0xdd1b('0x40')]('-')[0x0]]){this['channels'][_0x30187e[_0xdd1b('0x2f')]][_0xdd1b('0x5d')]=this[_0xdd1b('0x17')][_0x30187e[_0xdd1b('0x41')][_0xdd1b('0x40')]('-')[0x0]]['id'];this['channels'][_0x30187e[_0xdd1b('0x2f')]][_0xdd1b('0x5e')]=this['agents'][_0x30187e['channel'][_0xdd1b('0x40')]('-')[0x0]]['name'];}}}}else{if(this[_0xdd1b('0x16')][_0x30187e[_0xdd1b('0x33')]]){if(_0x30187e['channelstate']==='6'){if(this[_0xdd1b('0x17')][_0x30187e[_0xdd1b('0x41')][_0xdd1b('0x40')]('-')[0x0]]){this[_0xdd1b('0x16')][_0x30187e['uniqueid']][_0xdd1b('0x5d')]=this[_0xdd1b('0x17')][_0x30187e['channel'][_0xdd1b('0x40')]('-')[0x0]]['id'];this[_0xdd1b('0x16')][_0x30187e['uniqueid']][_0xdd1b('0x5e')]=this[_0xdd1b('0x17')][_0x30187e[_0xdd1b('0x41')][_0xdd1b('0x40')]('-')[0x0]]['name'];}}}}}}catch(_0x14f40a){logger['error'](_0xdd1b('0x5f'),util[_0xdd1b('0x36')](_0x14f40a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xdd1b('0x60')]=function(_0x2ee2e6,_0x4d228c){if(this[_0xdd1b('0x16')][_0x2ee2e6]){this['channels'][_0x2ee2e6][_0xdd1b('0x61')]=!![];if(_['endsWith'](_0x4d228c,_0xdd1b('0x62'))){_0x4d228c=_0x4d228c[_0xdd1b('0x63')](_0xdd1b('0x62'),_0xdd1b('0x64'));}this[_0xdd1b('0x16')][_0x2ee2e6][_0xdd1b('0x65')]=_0x4d228c;var _0x250d5f=_['find'](this[_0xdd1b('0x16')][_0x2ee2e6][_0xdd1b('0x66')],{'filename':_0x4d228c});if(_[_0xdd1b('0x67')](_0x250d5f)){this[_0xdd1b('0x16')][_0x2ee2e6][_0xdd1b('0x66')]['push']({'filename':_0x4d228c,'createdAt':moment()[_0xdd1b('0x39')](_0xdd1b('0x3a')),'mixmonitorid':'','status':_0xdd1b('0x68')});}}};VoiceCallReport[_0xdd1b('0x2b')]['syncVarSet']=function(_0x14b79a){try{if(this[_0xdd1b('0x2c')](_0x14b79a)){if(this[_0xdd1b('0x16')][_0x14b79a[_0xdd1b('0x33')]]&&_0x14b79a[_0xdd1b('0x41')]!='OutgoingSpoolFailed'){if(this[_0xdd1b('0x2c')](_0x14b79a['variable'])){if(this[_0xdd1b('0x2c')](_0x14b79a[_0xdd1b('0x69')][_0xdd1b('0x6a')])){this[_0xdd1b('0x60')](_0x14b79a[_0xdd1b('0x33')],_0x14b79a['value']);}else if(this[_0xdd1b('0x2c')](_0x14b79a[_0xdd1b('0x69')][_0xdd1b('0x6b')])){this[_0xdd1b('0x16')][_0x14b79a[_0xdd1b('0x33')]][_0xdd1b('0x59')]=_0x14b79a[_0xdd1b('0x6c')];}else if(this['isNotNull'](_0x14b79a[_0xdd1b('0x69')][_0xdd1b('0x6d')])){this[_0xdd1b('0x16')][_0x14b79a['uniqueid']][_0xdd1b('0x6e')]=_0x14b79a[_0xdd1b('0x6c')];}else if(this['isNotNull'](_0x14b79a['variable']['xmd-cdrtype'])){this[_0xdd1b('0x16')][_0x14b79a['uniqueid']][_0xdd1b('0x6f')]=_0x14b79a[_0xdd1b('0x6c')];}else if(this['isNotNull'](_0x14b79a[_0xdd1b('0x69')][_0xdd1b('0x70')])){this[_0xdd1b('0x16')][_0x14b79a[_0xdd1b('0x33')]][_0xdd1b('0xc')]=_0x14b79a[_0xdd1b('0x6c')][_0xdd1b('0x40')](',')[0x0];}else if(this[_0xdd1b('0x2c')](_0x14b79a[_0xdd1b('0x69')]['xmd-originatecalleridnum'])){this['channels'][_0x14b79a[_0xdd1b('0x33')]]['originatecalleridnum']=_0x14b79a[_0xdd1b('0x6c')];}else if(this['isNotNull'](_0x14b79a[_0xdd1b('0x69')][_0xdd1b('0x71')])){this[_0xdd1b('0x16')][_0x14b79a['uniqueid']][_0xdd1b('0x72')]=_0x14b79a['value'];}else if(this[_0xdd1b('0x2c')](_0x14b79a[_0xdd1b('0x69')][_0xdd1b('0x73')])){this[_0xdd1b('0x16')][_0x14b79a[_0xdd1b('0x33')]][_0xdd1b('0x74')]=_0x14b79a[_0xdd1b('0x6c')];}else if(this[_0xdd1b('0x2c')](_0x14b79a[_0xdd1b('0x69')]['xmcs-queue'])){this['channels'][_0x14b79a['uniqueid']][_0xdd1b('0xc')]=_0x14b79a['value'];}else if(this['isNotNull'](_0x14b79a[_0xdd1b('0x69')][_0xdd1b('0x75')])){this[_0xdd1b('0x16')][_0x14b79a[_0xdd1b('0x33')]][_0xdd1b('0x76')]=_0x14b79a[_0xdd1b('0x6c')];}}}else if(this[_0xdd1b('0x2c')](_0x14b79a['variable'][_0xdd1b('0x6a')])){if(_0x14b79a[_0xdd1b('0x6c')]){var _0x1ee2fd=path['parse'](_0x14b79a[_0xdd1b('0x6c')])[_0xdd1b('0x45')];this[_0xdd1b('0x60')](_0x1ee2fd,_0x14b79a[_0xdd1b('0x6c')]);}}else if(this[_0xdd1b('0x16')][_0x14b79a[_0xdd1b('0x2f')]]){if(this['isNotNull'](_0x14b79a[_0xdd1b('0x69')])){if(this[_0xdd1b('0x2c')](_0x14b79a[_0xdd1b('0x69')]['sipcallid'])){this['channels'][_0x14b79a[_0xdd1b('0x2f')]]['sipcalllinkedid']=_0x14b79a['value'];}}}}}catch(_0x241894){logger[_0xdd1b('0x34')](_0xdd1b('0x77'),util['inspect'](_0x241894,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdd1b('0x2b')][_0xdd1b('0x78')]=function(_0x54dac6){try{if(this[_0xdd1b('0x2c')](_0x54dac6)){if(this[_0xdd1b('0x16')][_0x54dac6[_0xdd1b('0x33')]]){var _0x2fbbc3=moment();this[_0xdd1b('0x16')][_0x54dac6[_0xdd1b('0x33')]]['endtime']=_0x2fbbc3[_0xdd1b('0x39')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xdd1b('0x16')][_0x54dac6[_0xdd1b('0x33')]][_0xdd1b('0x4b')]=_0x2fbbc3['diff'](this[_0xdd1b('0x16')][_0x54dac6[_0xdd1b('0x33')]][_0xdd1b('0x38')],_0xdd1b('0x4d'));if(this[_0xdd1b('0x16')][_0x54dac6[_0xdd1b('0x33')]][_0xdd1b('0x55')]){this[_0xdd1b('0x16')][_0x54dac6[_0xdd1b('0x33')]]['billableseconds']=_0x2fbbc3[_0xdd1b('0x58')](this[_0xdd1b('0x16')][_0x54dac6['uniqueid']][_0xdd1b('0x56')],_0xdd1b('0x4d'));this[_0xdd1b('0x16')][_0x54dac6[_0xdd1b('0x33')]][_0xdd1b('0x57')]=this[_0xdd1b('0x16')][_0x54dac6[_0xdd1b('0x33')]][_0xdd1b('0x4b')]-this[_0xdd1b('0x16')][_0x54dac6[_0xdd1b('0x33')]]['billableseconds'];}if(_0x54dac6[_0xdd1b('0x3e')]===_0xdd1b('0x3f')){if(this['agents'][_0x54dac6[_0xdd1b('0x41')][_0xdd1b('0x40')]('-')[0x0]]){this['agents'][_0x54dac6['channel'][_0xdd1b('0x40')]('-')[0x0]]=_[_0xdd1b('0x79')](this['agents'][_0x54dac6[_0xdd1b('0x41')][_0xdd1b('0x40')]('-')[0x0]],['destconnectedlinenum']);this[_0xdd1b('0x2e')](util[_0xdd1b('0x39')](_0xdd1b('0x44'),this[_0xdd1b('0x17')][_0x54dac6[_0xdd1b('0x41')][_0xdd1b('0x40')]('-')[0x0]]['name']),'user:agentcomplete',{'destaccountcode':this[_0xdd1b('0x17')][_0x54dac6[_0xdd1b('0x41')][_0xdd1b('0x40')]('-')[0x0]]['accountcode']});}}ami['emit'](_0xdd1b('0x7a'),this[_0xdd1b('0x16')][_0x54dac6['uniqueid']]);delete this['channels'][_0x54dac6[_0xdd1b('0x33')]];}}}catch(_0x9b8996){logger['error'](_0xdd1b('0x7b'),util[_0xdd1b('0x36')](_0x9b8996,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdd1b('0x2b')][_0xdd1b('0x22')]=function(_0x5a230f){try{if(this[_0xdd1b('0x2c')](_0x5a230f)){if(this['channels'][_0x5a230f[_0xdd1b('0x7c')]]){this[_0xdd1b('0x16')][_0x5a230f['transfereeuniqueid']][_0xdd1b('0x7d')]=_0x5a230f[_0xdd1b('0x7e')];this[_0xdd1b('0x16')][_0x5a230f['transfereeuniqueid']]['transferconnectedlinenum']=_0x5a230f[_0xdd1b('0x7f')];if(this[_0xdd1b('0x16')][_0x5a230f[_0xdd1b('0x80')]]){var _0x39f8bb=this[_0xdd1b('0x16')][_0x5a230f[_0xdd1b('0x80')]];this[_0xdd1b('0x16')][_0x5a230f[_0xdd1b('0x80')]]=this[_0xdd1b('0x16')][_0x5a230f[_0xdd1b('0x7c')]];this[_0xdd1b('0x16')][_0x5a230f['transfereeuniqueid']]=_0x39f8bb;}}else if(this[_0xdd1b('0x16')][_0x5a230f['transfertargetuniqueid']]){this['channels'][_0x5a230f['transfertargetuniqueid']]['transfercalleridnum']=_0x5a230f[_0xdd1b('0x7e')];this[_0xdd1b('0x16')][_0x5a230f[_0xdd1b('0x81')]][_0xdd1b('0x82')]=_0x5a230f[_0xdd1b('0x7f')];if(this[_0xdd1b('0x16')][_0x5a230f[_0xdd1b('0x83')]]){var _0x39f8bb=this[_0xdd1b('0x16')][_0x5a230f['origtransfereruniqueid']];this[_0xdd1b('0x16')][_0x5a230f['origtransfereruniqueid']]=this[_0xdd1b('0x16')][_0x5a230f[_0xdd1b('0x81')]];this[_0xdd1b('0x16')][_0x5a230f[_0xdd1b('0x81')]]=_0x39f8bb;}}}}catch(_0x350561){logger[_0xdd1b('0x34')](_0xdd1b('0x84'),util['inspect'](_0x350561,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xdd1b('0x85')]=function(_0x4af618){try{if(this[_0xdd1b('0x2c')](_0x4af618)){if(this['channels'][_0x4af618[_0xdd1b('0x7c')]]){this[_0xdd1b('0x16')][_0x4af618['transfereeuniqueid']]['transfercalleridnum']=_0x4af618[_0xdd1b('0x86')];this['channels'][_0x4af618[_0xdd1b('0x7c')]][_0xdd1b('0x82')]=_0x4af618[_0xdd1b('0x87')];this[_0xdd1b('0x78')]({'event':'BlindTransfer','uniqueid':_0x4af618[_0xdd1b('0x7c')],'context':_0x4af618[_0xdd1b('0x3e')],'channel':_0x4af618['transfererchannel']});}}}catch(_0x2d4cb9){logger[_0xdd1b('0x34')](_0xdd1b('0x88'),util[_0xdd1b('0x36')](_0x2d4cb9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStart']=function(_0x1cd4df){try{if(this[_0xdd1b('0x2c')](_0x1cd4df)){if(this[_0xdd1b('0x16')][_0x1cd4df[_0xdd1b('0x33')]]){if(!_[_0xdd1b('0x67')](this[_0xdd1b('0x16')][_0x1cd4df['uniqueid']]['answertime'])){this[_0xdd1b('0x16')][_0x1cd4df[_0xdd1b('0x33')]]['mohstarttime']=moment()[_0xdd1b('0x39')](_0xdd1b('0x3a'));}}}}catch(_0x5e084e){logger[_0xdd1b('0x34')]('[syncMusicOnHoldStart][VoiceCallReport]',util[_0xdd1b('0x36')](_0x5e084e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xdd1b('0x26')]=function(_0x4c6d28){try{if(this[_0xdd1b('0x2c')](_0x4c6d28)){if(this['channels'][_0x4c6d28[_0xdd1b('0x33')]]){if(!_[_0xdd1b('0x67')](this[_0xdd1b('0x16')][_0x4c6d28[_0xdd1b('0x33')]][_0xdd1b('0x89')])){this['channels'][_0x4c6d28[_0xdd1b('0x33')]]['mohtime']+=moment()[_0xdd1b('0x8a')](0x0)[_0xdd1b('0x58')](this[_0xdd1b('0x16')][_0x4c6d28[_0xdd1b('0x33')]][_0xdd1b('0x89')],_0xdd1b('0x4d'));delete this[_0xdd1b('0x16')][_0x4c6d28[_0xdd1b('0x33')]][_0xdd1b('0x89')];}}}}catch(_0x37322e){logger[_0xdd1b('0x34')](_0xdd1b('0x8b'),util[_0xdd1b('0x36')](_0x37322e,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0x1749=['prototype','emit','syncNewCallerId','uniqueid','pick','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','linkedid','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','from-sip','split','destconnectedlinenum','exten','user:%s','name','user:agentconnect','[syncNewChannel][VoiceCallReport]','application','toLowerCase','appdata','applicationdata','duration','subtract','seconds','lastapplication','lastdata','match','queue','[syncNewExten][VoiceCallReport]','answered','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','calleridname','destinationchannel','membername','UserId','[syncNewState][VoiceCallReport]','endsWith','.wav49','replace','monitorFilename','find','monitors','push','rec','variable','mixmonitor_filename','syncMixMonitorFilename','value','xmd-callerid','xmd-cdrtype','type','xmd-queue','xmd-destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','billableseconds','answertime','context','omit','user:agentcomplete','custom:voiceCallReport','syncAttendedTransfer','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','isNil','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','lodash','util','path','ioredis','../ami','../model/channel','unknown','not_inuse','invalid','unavailable','ringing','onhold','set','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','defaults','localhost','redis','channels','agents','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','actionCoreShowChannels','catch','isNotNull','isUndefined'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x1749,0xfa));var _0x9174=function(_0x2c5bc6,_0xbc9fc7){_0x2c5bc6=_0x2c5bc6-0x0;var _0x516295=_0x1749[_0x2c5bc6];return _0x516295;};'use strict';var BPromise=require(_0x9174('0x0'));var _=require(_0x9174('0x1'));var moment=require('moment');var util=require(_0x9174('0x2'));var path=require(_0x9174('0x3'));var Redis=require(_0x9174('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0x9174('0x5'));var Channel=require(_0x9174('0x6'));var statusDesc=[_0x9174('0x7'),_0x9174('0x8'),'inuse','busy',_0x9174('0x9'),_0x9174('0xa'),_0x9174('0xb'),'ringinuse',_0x9174('0xc')];var applications=[_0x9174('0xd'),'queue','agi',_0x9174('0xe'),_0x9174('0xf'),'voicemail'];var dispositions=[_0x9174('0x10'),_0x9174('0x11'),_0x9174('0x11'),_0x9174('0x10'),_0x9174('0x10'),_0x9174('0x10'),_0x9174('0x12'),'BUSY',_0x9174('0x11'),_0x9174('0x11'),'FAILED'];var actions={};config['redis']=_[_0x9174('0x13')](config['redis'],{'host':_0x9174('0x14'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9174('0x15')]));function VoiceCallReport(_0x575f60){this[_0x9174('0x16')]=_0x575f60[_0x9174('0x16')];this[_0x9174('0x17')]=_0x575f60['agents'];ami['on']('coreshowchannel',this[_0x9174('0x18')][_0x9174('0x19')](this));ami['on'](_0x9174('0x1a'),this[_0x9174('0x18')]['bind'](this));ami['on'](_0x9174('0x1b'),this[_0x9174('0x1c')][_0x9174('0x19')](this));ami['on'](_0x9174('0x1d'),this[_0x9174('0x1e')][_0x9174('0x19')](this));ami['on'](_0x9174('0x1f'),this[_0x9174('0x20')]['bind'](this));ami['on'](_0x9174('0x21'),this[_0x9174('0x22')][_0x9174('0x19')](this));ami['on'](_0x9174('0x23'),this['syncNewCallerId'][_0x9174('0x19')](this));ami['on'](_0x9174('0x24'),this['syncAttendedTransfer'][_0x9174('0x19')](this));ami['on'](_0x9174('0x25'),this[_0x9174('0x26')][_0x9174('0x19')](this));ami['on'](_0x9174('0x27'),this[_0x9174('0x28')][_0x9174('0x19')](this));ami['on'](_0x9174('0x29'),this[_0x9174('0x2a')][_0x9174('0x19')](this));return BPromise[_0x9174('0x2b')]()['then'](ami[_0x9174('0x2c')]())[_0x9174('0x2d')](function(_0x55a3d2){console['log'](_0x55a3d2);});}VoiceCallReport['prototype'][_0x9174('0x2e')]=function(_0x5cb7a8){return _0x5cb7a8!==null&&!_[_0x9174('0x2f')](_0x5cb7a8);};VoiceCallReport[_0x9174('0x30')][_0x9174('0x31')]=function(_0xdb5ea8,_0x5cc30a,_0x3310d2){io['to'](_0xdb5ea8)[_0x9174('0x31')](_0x5cc30a,_0x3310d2);};VoiceCallReport[_0x9174('0x30')][_0x9174('0x32')]=function(_0x5cd5f9){try{if(this[_0x9174('0x2e')](_0x5cd5f9)){if(_0x5cd5f9[_0x9174('0x33')]===_0x5cd5f9['linkedid']){if(!_['isUndefined'](this[_0x9174('0x16')][_0x5cd5f9[_0x9174('0x33')]])){_['merge'](this[_0x9174('0x16')][_0x5cd5f9[_0x9174('0x33')]],_[_0x9174('0x34')](_0x5cd5f9,_[_0x9174('0x35')](this[_0x9174('0x16')][_0x5cd5f9[_0x9174('0x33')]])));}}}}catch(_0x303204){logger[_0x9174('0x36')](_0x9174('0x37'),util[_0x9174('0x38')](_0x303204,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9174('0x30')][_0x9174('0x1c')]=function(_0x3c43e9){try{if(this[_0x9174('0x2e')](_0x3c43e9)){if(_0x3c43e9[_0x9174('0x33')]===_0x3c43e9[_0x9174('0x39')]&&_0x3c43e9[_0x9174('0x3a')]!=_0x9174('0x3b')){if(_['isUndefined'](this[_0x9174('0x16')][_0x3c43e9[_0x9174('0x33')]])){this[_0x9174('0x16')][_0x3c43e9['uniqueid']]=new Channel();this[_0x9174('0x16')][_0x3c43e9[_0x9174('0x33')]][_0x9174('0x3c')]=moment()[_0x9174('0x3d')](_0x9174('0x3e'));this['channels'][_0x3c43e9[_0x9174('0x33')]][_0x9174('0x3f')]=dispositions[_[_0x9174('0x40')](_0x3c43e9[_0x9174('0x41')])];_[_0x9174('0x42')](this[_0x9174('0x16')][_0x3c43e9[_0x9174('0x33')]],_[_0x9174('0x34')](_0x3c43e9,_['keys'](this['channels'][_0x3c43e9[_0x9174('0x33')]])));if(_0x3c43e9['context']===_0x9174('0x43')){if(this[_0x9174('0x17')][_0x3c43e9[_0x9174('0x3a')]['split']('-')[0x0]]){this['agents'][_0x3c43e9[_0x9174('0x3a')][_0x9174('0x44')]('-')[0x0]][_0x9174('0x45')]=_0x3c43e9[_0x9174('0x46')];this['emit'](util[_0x9174('0x3d')](_0x9174('0x47'),this[_0x9174('0x17')][_0x3c43e9[_0x9174('0x3a')][_0x9174('0x44')]('-')[0x0]][_0x9174('0x48')]),_0x9174('0x49'),{'destaccountcode':this['agents'][_0x3c43e9[_0x9174('0x3a')][_0x9174('0x44')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3c43e9[_0x9174('0x46')]});}}}}}}catch(_0xc28e72){logger[_0x9174('0x36')](_0x9174('0x4a'),util[_0x9174('0x38')](_0xc28e72,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9174('0x30')][_0x9174('0x18')]=function(_0x1519c4){try{if(this[_0x9174('0x2e')](_0x1519c4)){if(_0x1519c4['uniqueid']===_0x1519c4[_0x9174('0x39')]&&_0x1519c4['exten']!='h'&&_0x1519c4['channel']!=_0x9174('0x3b')){_0x1519c4['application']=_0x1519c4[_0x9174('0x4b')][_0x9174('0x4c')]();_0x1519c4['applicationdata']=(_0x1519c4[_0x9174('0x4d')]||_0x1519c4[_0x9174('0x4e')])[_0x9174('0x4c')]();if(_[_0x9174('0x2f')](this[_0x9174('0x16')][_0x1519c4[_0x9174('0x33')]])){this['channels'][_0x1519c4[_0x9174('0x33')]]=new Channel();this[_0x9174('0x16')][_0x1519c4[_0x9174('0x33')]][_0x9174('0x3c')]=_0x1519c4[_0x9174('0x4f')]?moment()[_0x9174('0x50')](moment[_0x9174('0x4f')](_0x1519c4[_0x9174('0x4f')])['seconds'](),_0x9174('0x51'))['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x9174('0x3d')](_0x9174('0x3e'));this[_0x9174('0x16')][_0x1519c4[_0x9174('0x33')]][_0x9174('0x3f')]=_0x9174('0x10');}_[_0x9174('0x42')](this[_0x9174('0x16')][_0x1519c4['uniqueid']],_[_0x9174('0x34')](_0x1519c4,_[_0x9174('0x35')](this[_0x9174('0x16')][_0x1519c4[_0x9174('0x33')]])));if(_['includes'](applications,_0x1519c4[_0x9174('0x4b')])){this['channels'][_0x1519c4[_0x9174('0x33')]][_0x9174('0x52')]=_0x1519c4[_0x9174('0x4b')];this[_0x9174('0x16')][_0x1519c4[_0x9174('0x33')]][_0x9174('0x53')]=_0x1519c4[_0x9174('0x4e')];if(_0x1519c4[_0x9174('0x4b')]===_0x9174('0xd')&&_['startsWith'](_0x1519c4[_0x9174('0x4e')],'cdr(')){var _0x3899a6=_0x1519c4['applicationdata'][_0x9174('0x44')]('=');var _0x1caff8=_0x3899a6[0x0][_0x9174('0x54')](/cdr\((.*)\)/);if(_0x1caff8){this['channels'][_0x1519c4[_0x9174('0x33')]][_0x1caff8[0x1]]=_0x3899a6[0x1];}}else if(_0x1519c4['application']===_0x9174('0x55')){this[_0x9174('0x16')][_0x1519c4['uniqueid']][_0x9174('0x55')]=_0x1519c4[_0x9174('0x4e')][_0x9174('0x44')](',')[0x0];}}}}}catch(_0x31a301){logger['error'](_0x9174('0x56'),util[_0x9174('0x38')](_0x31a301,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9174('0x30')][_0x9174('0x1e')]=function(_0x2b093e){try{if(this[_0x9174('0x2e')](_0x2b093e)){if(_0x2b093e[_0x9174('0x33')]!==_0x2b093e[_0x9174('0x39')]){if(this['channels'][_0x2b093e[_0x9174('0x39')]]){if(_0x2b093e['channelstate']==='6'){if(!this[_0x9174('0x16')][_0x2b093e[_0x9174('0x39')]][_0x9174('0x57')]){var _0x59a1d0=moment();this['channels'][_0x2b093e[_0x9174('0x39')]][_0x9174('0x57')]=!![];this['channels'][_0x2b093e[_0x9174('0x39')]]['answertime']=_0x59a1d0[_0x9174('0x3d')](_0x9174('0x3e'));if(this[_0x9174('0x16')][_0x2b093e['linkedid']]['starttime']){this[_0x9174('0x16')][_0x2b093e[_0x9174('0x39')]][_0x9174('0x58')]=_0x59a1d0[_0x9174('0x59')](this[_0x9174('0x16')][_0x2b093e[_0x9174('0x39')]][_0x9174('0x3c')],'seconds');}}this[_0x9174('0x16')][_0x2b093e['linkedid']][_0x9174('0x39')]=_0x2b093e[_0x9174('0x33')];if(_0x2b093e[_0x9174('0x5a')]!==_0x9174('0x5b')){this[_0x9174('0x16')][_0x2b093e[_0x9174('0x39')]][_0x9174('0x5c')]=_0x2b093e[_0x9174('0x5a')];}this[_0x9174('0x16')][_0x2b093e[_0x9174('0x39')]]['connectedlinename']=_0x2b093e[_0x9174('0x5d')];this[_0x9174('0x16')][_0x2b093e[_0x9174('0x39')]][_0x9174('0x5e')]=_0x2b093e[_0x9174('0x3a')];this[_0x9174('0x16')][_0x2b093e[_0x9174('0x39')]]['disposition']=dispositions[_[_0x9174('0x40')](_0x2b093e['channelstate'])];if(this['agents'][_0x2b093e[_0x9174('0x3a')][_0x9174('0x44')]('-')[0x0]]){this[_0x9174('0x16')][_0x2b093e[_0x9174('0x39')]]['UserId']=this['agents'][_0x2b093e[_0x9174('0x3a')][_0x9174('0x44')]('-')[0x0]]['id'];this[_0x9174('0x16')][_0x2b093e[_0x9174('0x39')]][_0x9174('0x5f')]=this[_0x9174('0x17')][_0x2b093e[_0x9174('0x3a')]['split']('-')[0x0]][_0x9174('0x48')];}}}}else{if(this[_0x9174('0x16')][_0x2b093e[_0x9174('0x33')]]){if(_0x2b093e[_0x9174('0x41')]==='6'){if(this[_0x9174('0x17')][_0x2b093e[_0x9174('0x3a')][_0x9174('0x44')]('-')[0x0]]){this[_0x9174('0x16')][_0x2b093e['uniqueid']][_0x9174('0x60')]=this[_0x9174('0x17')][_0x2b093e[_0x9174('0x3a')][_0x9174('0x44')]('-')[0x0]]['id'];this[_0x9174('0x16')][_0x2b093e[_0x9174('0x33')]]['membername']=this[_0x9174('0x17')][_0x2b093e[_0x9174('0x3a')]['split']('-')[0x0]]['name'];}}}}}}catch(_0x4b2fec){logger[_0x9174('0x36')](_0x9174('0x61'),util[_0x9174('0x38')](_0x4b2fec,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9174('0x30')]['syncMixMonitorFilename']=function(_0x1f9370,_0x5f3858){if(this[_0x9174('0x16')][_0x1f9370]){this[_0x9174('0x16')][_0x1f9370]['monitor']=!![];if(_[_0x9174('0x62')](_0x5f3858,_0x9174('0x63'))){_0x5f3858=_0x5f3858[_0x9174('0x64')](_0x9174('0x63'),'.WAV');}this[_0x9174('0x16')][_0x1f9370][_0x9174('0x65')]=_0x5f3858;var _0x4b6649=_[_0x9174('0x66')](this['channels'][_0x1f9370][_0x9174('0x67')],{'filename':_0x5f3858});if(_['isNil'](_0x4b6649)){this[_0x9174('0x16')][_0x1f9370][_0x9174('0x67')][_0x9174('0x68')]({'filename':_0x5f3858,'createdAt':moment()[_0x9174('0x3d')](_0x9174('0x3e')),'mixmonitorid':'','status':_0x9174('0x69')});}}};VoiceCallReport['prototype'][_0x9174('0x20')]=function(_0x2461c1){try{if(this[_0x9174('0x2e')](_0x2461c1)){if(this[_0x9174('0x16')][_0x2461c1['uniqueid']]&&_0x2461c1['channel']!=_0x9174('0x3b')){if(this[_0x9174('0x2e')](_0x2461c1[_0x9174('0x6a')])){if(this['isNotNull'](_0x2461c1['variable'][_0x9174('0x6b')])){this[_0x9174('0x6c')](_0x2461c1[_0x9174('0x33')],_0x2461c1['value']);}else if(this[_0x9174('0x2e')](_0x2461c1[_0x9174('0x6a')]['xmd-phone'])){this[_0x9174('0x16')][_0x2461c1[_0x9174('0x33')]][_0x9174('0x5a')]=_0x2461c1[_0x9174('0x6d')];}else if(this[_0x9174('0x2e')](_0x2461c1['variable'][_0x9174('0x6e')])){this[_0x9174('0x16')][_0x2461c1[_0x9174('0x33')]]['callerid']=_0x2461c1[_0x9174('0x6d')];}else if(this[_0x9174('0x2e')](_0x2461c1[_0x9174('0x6a')][_0x9174('0x6f')])){this['channels'][_0x2461c1[_0x9174('0x33')]][_0x9174('0x70')]=_0x2461c1[_0x9174('0x6d')];}else if(this[_0x9174('0x2e')](_0x2461c1[_0x9174('0x6a')][_0x9174('0x71')])){this['channels'][_0x2461c1[_0x9174('0x33')]][_0x9174('0x55')]=_0x2461c1['value'][_0x9174('0x44')](',')[0x0];}else if(this[_0x9174('0x2e')](_0x2461c1[_0x9174('0x6a')]['xmd-originatecalleridnum'])){this['channels'][_0x2461c1['uniqueid']]['originatecalleridnum']=_0x2461c1[_0x9174('0x6d')];}else if(this[_0x9174('0x2e')](_0x2461c1['variable'][_0x9174('0x72')])){this[_0x9174('0x16')][_0x2461c1[_0x9174('0x33')]]['destination']=_0x2461c1[_0x9174('0x6d')];}else if(this[_0x9174('0x2e')](_0x2461c1[_0x9174('0x6a')][_0x9174('0x73')])){this['channels'][_0x2461c1['uniqueid']][_0x9174('0x74')]=_0x2461c1['value'];}else if(this[_0x9174('0x2e')](_0x2461c1[_0x9174('0x6a')][_0x9174('0x75')])){this[_0x9174('0x16')][_0x2461c1[_0x9174('0x33')]][_0x9174('0x55')]=_0x2461c1['value'];}else if(this[_0x9174('0x2e')](_0x2461c1[_0x9174('0x6a')][_0x9174('0x76')])){this[_0x9174('0x16')][_0x2461c1['uniqueid']][_0x9174('0x77')]=_0x2461c1[_0x9174('0x6d')];}}}else if(this[_0x9174('0x2e')](_0x2461c1[_0x9174('0x6a')][_0x9174('0x6b')])){if(_0x2461c1[_0x9174('0x6d')]){var _0x18a82e=path['parse'](_0x2461c1[_0x9174('0x6d')])['name'];this[_0x9174('0x6c')](_0x18a82e,_0x2461c1['value']);}}else if(this[_0x9174('0x16')][_0x2461c1['linkedid']]){if(this[_0x9174('0x2e')](_0x2461c1['variable'])){if(this[_0x9174('0x2e')](_0x2461c1[_0x9174('0x6a')][_0x9174('0x76')])){this[_0x9174('0x16')][_0x2461c1[_0x9174('0x39')]][_0x9174('0x78')]=_0x2461c1[_0x9174('0x6d')];}}}}}catch(_0x125c03){logger['error'](_0x9174('0x79'),util[_0x9174('0x38')](_0x125c03,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9174('0x22')]=function(_0x1a173f){try{if(this['isNotNull'](_0x1a173f)){if(this[_0x9174('0x16')][_0x1a173f['uniqueid']]){var _0x23f803=moment();this[_0x9174('0x16')][_0x1a173f[_0x9174('0x33')]]['endtime']=_0x23f803[_0x9174('0x3d')](_0x9174('0x3e'));this[_0x9174('0x16')][_0x1a173f['uniqueid']][_0x9174('0x4f')]=_0x23f803['diff'](this[_0x9174('0x16')][_0x1a173f['uniqueid']]['starttime'],_0x9174('0x51'));if(this['channels'][_0x1a173f['uniqueid']][_0x9174('0x57')]){this[_0x9174('0x16')][_0x1a173f[_0x9174('0x33')]][_0x9174('0x7a')]=_0x23f803[_0x9174('0x59')](this['channels'][_0x1a173f['uniqueid']][_0x9174('0x7b')],_0x9174('0x51'));this['channels'][_0x1a173f[_0x9174('0x33')]]['holdtime']=this[_0x9174('0x16')][_0x1a173f['uniqueid']][_0x9174('0x4f')]-this['channels'][_0x1a173f['uniqueid']][_0x9174('0x7a')];}if(_0x1a173f[_0x9174('0x7c')]===_0x9174('0x43')){if(this['agents'][_0x1a173f[_0x9174('0x3a')][_0x9174('0x44')]('-')[0x0]]){this[_0x9174('0x17')][_0x1a173f[_0x9174('0x3a')][_0x9174('0x44')]('-')[0x0]]=_[_0x9174('0x7d')](this[_0x9174('0x17')][_0x1a173f[_0x9174('0x3a')]['split']('-')[0x0]],[_0x9174('0x45')]);this['emit'](util[_0x9174('0x3d')]('user:%s',this[_0x9174('0x17')][_0x1a173f['channel'][_0x9174('0x44')]('-')[0x0]]['name']),_0x9174('0x7e'),{'destaccountcode':this[_0x9174('0x17')][_0x1a173f['channel'][_0x9174('0x44')]('-')[0x0]]['accountcode']});}}ami[_0x9174('0x31')](_0x9174('0x7f'),this['channels'][_0x1a173f[_0x9174('0x33')]]);delete this[_0x9174('0x16')][_0x1a173f['uniqueid']];}}}catch(_0x1bb9d3){logger[_0x9174('0x36')]('[syncHangup][VoiceCallReport]',util[_0x9174('0x38')](_0x1bb9d3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9174('0x30')][_0x9174('0x80')]=function(_0x151322){try{if(this[_0x9174('0x2e')](_0x151322)){if(this[_0x9174('0x16')][_0x151322[_0x9174('0x81')]]){this[_0x9174('0x16')][_0x151322[_0x9174('0x81')]]['transfercalleridnum']=_0x151322[_0x9174('0x82')];this[_0x9174('0x16')][_0x151322['transfereeuniqueid']][_0x9174('0x83')]=_0x151322[_0x9174('0x84')];if(this[_0x9174('0x16')][_0x151322[_0x9174('0x85')]]){var _0x14238e=this[_0x9174('0x16')][_0x151322[_0x9174('0x85')]];this[_0x9174('0x16')][_0x151322[_0x9174('0x85')]]=this[_0x9174('0x16')][_0x151322[_0x9174('0x81')]];this[_0x9174('0x16')][_0x151322[_0x9174('0x81')]]=_0x14238e;}}else if(this[_0x9174('0x16')][_0x151322[_0x9174('0x86')]]){this[_0x9174('0x16')][_0x151322[_0x9174('0x86')]][_0x9174('0x87')]=_0x151322[_0x9174('0x82')];this[_0x9174('0x16')][_0x151322[_0x9174('0x86')]][_0x9174('0x83')]=_0x151322[_0x9174('0x84')];if(this[_0x9174('0x16')][_0x151322[_0x9174('0x88')]]){var _0x14238e=this[_0x9174('0x16')][_0x151322['origtransfereruniqueid']];this[_0x9174('0x16')][_0x151322[_0x9174('0x88')]]=this['channels'][_0x151322['transfertargetuniqueid']];this[_0x9174('0x16')][_0x151322[_0x9174('0x86')]]=_0x14238e;}}}}catch(_0x5c9bd7){logger['error'](_0x9174('0x89'),util[_0x9174('0x38')](_0x5c9bd7,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9174('0x26')]=function(_0x4c0aa7){try{if(this[_0x9174('0x2e')](_0x4c0aa7)){if(this['channels'][_0x4c0aa7[_0x9174('0x81')]]){this['channels'][_0x4c0aa7[_0x9174('0x81')]][_0x9174('0x87')]=_0x4c0aa7[_0x9174('0x8a')];this[_0x9174('0x16')][_0x4c0aa7[_0x9174('0x81')]][_0x9174('0x83')]=_0x4c0aa7[_0x9174('0x8b')];this[_0x9174('0x22')]({'event':_0x9174('0x8c'),'uniqueid':_0x4c0aa7[_0x9174('0x81')],'context':_0x4c0aa7[_0x9174('0x7c')],'channel':_0x4c0aa7[_0x9174('0x8d')]});}}}catch(_0x970737){logger[_0x9174('0x36')](_0x9174('0x8e'),util[_0x9174('0x38')](_0x970737,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9174('0x28')]=function(_0x4c9ebb){try{if(this[_0x9174('0x2e')](_0x4c9ebb)){if(this['channels'][_0x4c9ebb[_0x9174('0x33')]]){if(!_[_0x9174('0x8f')](this[_0x9174('0x16')][_0x4c9ebb[_0x9174('0x33')]]['answertime'])){this['channels'][_0x4c9ebb[_0x9174('0x33')]][_0x9174('0x90')]=moment()[_0x9174('0x3d')](_0x9174('0x3e'));}}}}catch(_0x248f41){logger[_0x9174('0x36')](_0x9174('0x91'),util[_0x9174('0x38')](_0x248f41,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9174('0x2a')]=function(_0x4cf7b2){try{if(this['isNotNull'](_0x4cf7b2)){if(this[_0x9174('0x16')][_0x4cf7b2[_0x9174('0x33')]]){if(!_['isNil'](this[_0x9174('0x16')][_0x4cf7b2[_0x9174('0x33')]][_0x9174('0x90')])){this[_0x9174('0x16')][_0x4cf7b2[_0x9174('0x33')]][_0x9174('0x92')]+=moment()[_0x9174('0x93')](0x0)['diff'](this[_0x9174('0x16')][_0x4cf7b2[_0x9174('0x33')]][_0x9174('0x90')],_0x9174('0x51'));delete this[_0x9174('0x16')][_0x4cf7b2['uniqueid']][_0x9174('0x90')];}}}}catch(_0x34e245){logger[_0x9174('0x36')](_0x9174('0x94'),util['inspect'](_0x34e245,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 0dc08c1..d4ca476 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5423=['moment','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outbound','variables','syncDialBegin','bind','syncDialEnd','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','voice_outbound_channel:save','custom:dialbegin','error','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','voice:outbound','inspect','keys','variable','[syncVarSet][VoiceDialReport]','addVariable','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberinterface','membername','memberpenalty','isNil','includes','endtime','seconds','complete','total','answered','holdtime','starttime','billableseconds','diff','sumBillable','voice_outbound:save','exports','lodash'];(function(_0x4da3f6,_0x536e60){var _0x1d63ee=function(_0x2ca447){while(--_0x2ca447){_0x4da3f6['push'](_0x4da3f6['shift']());}};_0x1d63ee(++_0x536e60);}(_0x5423,0xe3));var _0x3542=function(_0x4998d6,_0x38e456){_0x4998d6=_0x4998d6-0x0;var _0x5649e5=_0x5423[_0x4998d6];return _0x5649e5;};'use strict';var _=require(_0x3542('0x0'));var moment=require(_0x3542('0x1'));var util=require('util');var Redis=require(_0x3542('0x2'));var config=require(_0x3542('0x3'));var logger=require('../../../config/logger')(_0x3542('0x4'));var ami=require(_0x3542('0x5'));config[_0x3542('0x6')]=_[_0x3542('0x7')](config['redis'],{'host':_0x3542('0x8'),'port':0x18eb});var io=require(_0x3542('0x9'))(new Redis(config[_0x3542('0x6')]));function VoiceDialReport(_0x29c3fa){this[_0x3542('0xa')]=_0x29c3fa['outboundChannels'];this['outbound']=_0x29c3fa[_0x3542('0xb')];this[_0x3542('0xc')]={};ami['on']('dialbegin',this[_0x3542('0xd')][_0x3542('0xe')](this));ami['on']('dialend',this[_0x3542('0xf')][_0x3542('0xe')](this));ami['on']('varset',this[_0x3542('0x10')][_0x3542('0xe')](this));ami['on'](_0x3542('0x11'),this[_0x3542('0x12')][_0x3542('0xe')](this));}VoiceDialReport[_0x3542('0x13')][_0x3542('0x14')]=function(_0x43e977){return _0x43e977!==null&&!_[_0x3542('0x15')](_0x43e977);};VoiceDialReport[_0x3542('0x13')][_0x3542('0x16')]=function(_0x14d7c3,_0x15863d,_0x4bac5b){io['to'](_0x14d7c3)[_0x3542('0x16')](_0x15863d,_0x4bac5b);};VoiceDialReport['prototype'][_0x3542('0xd')]=function(_0x13fe0b){try{if(this[_0x3542('0x14')](_0x13fe0b)){if(this['channels'][_0x13fe0b[_0x3542('0x17')]]){_[_0x3542('0x18')](this[_0x3542('0xa')][_0x13fe0b['uniqueid']],{'starttime':moment()[_0x3542('0x19')](_0x3542('0x1a')),'lastevent':_0x3542('0x1b'),'interface':_0x13fe0b[_0x3542('0x1c')]['substring'](0x0,_0x13fe0b[_0x3542('0x1c')]['lastIndexOf']('-')),'membername':_0x13fe0b[_0x3542('0x1c')][_0x3542('0x1d')](_0x13fe0b['channel'][_0x3542('0x1e')]('/')+0x1,_0x13fe0b[_0x3542('0x1c')][_0x3542('0x1e')]('-'))},_[_0x3542('0x1f')](_0x13fe0b,[_0x3542('0x20'),'privilege']));this['emit']('voice:outbound',_0x3542('0x21'),this['channels'][_0x13fe0b[_0x3542('0x17')]]);ami['emit'](_0x3542('0x22'),this['channels'][_0x13fe0b['uniqueid']]);}}}catch(_0x3eacd0){logger[_0x3542('0x23')]('[syncDialBegin][VoiceDialReport]',util['inspect'](_0x3eacd0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3542('0x13')]['syncDialEnd']=function(_0x160caa){try{if(this[_0x3542('0x14')](_0x160caa)){if(this[_0x3542('0xa')][_0x160caa[_0x3542('0x17')]]){this[_0x3542('0xa')][_0x160caa[_0x3542('0x17')]][_0x3542('0x24')]=_0x160caa[_0x3542('0x24')];if(_0x160caa[_0x3542('0x24')]===_0x3542('0x25')){this[_0x3542('0xa')][_0x160caa[_0x3542('0x17')]][_0x3542('0x26')]=_0x160caa[_0x3542('0x26')];this[_0x3542('0xa')][_0x160caa[_0x3542('0x17')]][_0x3542('0x27')]=_0x160caa[_0x3542('0x27')];this[_0x3542('0xa')][_0x160caa['uniqueid']][_0x3542('0x28')]=moment()[_0x3542('0x19')](_0x3542('0x1a'));this['channels'][_0x160caa[_0x3542('0x17')]][_0x3542('0x29')]=_0x3542('0x2a');ami[_0x3542('0x16')]('custom:dialconnect',this['channels'][_0x160caa[_0x3542('0x17')]]);}this[_0x3542('0x16')](_0x3542('0x2b'),_0x3542('0x21'),this[_0x3542('0xa')][_0x160caa[_0x3542('0x17')]]);}}}catch(_0x1f43d2){logger['error']('[syncDialEnd][VoiceDialReport]',util[_0x3542('0x2c')](_0x1f43d2,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x2902b8){try{if(this['isNotNull'](_0x2902b8)){this['addVariable'](_0x2902b8[_0x3542('0x17')],_[_0x3542('0x2d')](_0x2902b8[_0x3542('0x2e')])[0x0],_0x2902b8['value']);if(this[_0x3542('0x14')](_0x2902b8['variable'])&&this[_0x3542('0x14')](_0x2902b8[_0x3542('0x2e')]['outboundrouteid'])){if(_[_0x3542('0x15')](this['channels'][_0x2902b8[_0x3542('0x17')]])){this[_0x3542('0xa')][_0x2902b8[_0x3542('0x17')]]={'routeId':_0x2902b8['value'],'variables':this[_0x3542('0xc')][_0x2902b8['uniqueid']]};this[_0x3542('0x16')](_0x3542('0x2b'),_0x3542('0x21'),this[_0x3542('0xa')][_0x2902b8[_0x3542('0x17')]]);}}}}catch(_0x6cff91){logger[_0x3542('0x23')](_0x3542('0x2f'),util[_0x3542('0x2c')](_0x6cff91,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3542('0x13')][_0x3542('0x30')]=function(_0x77f699,_0x2b1bf4,_0x586f5b){var _0x62429=['rtpaudioqos','rtpaudioqosbridged',_0x3542('0x31'),_0x3542('0x32'),_0x3542('0x33'),_0x3542('0x34'),_0x3542('0x35'),_0x3542('0x36'),_0x3542('0x37'),_0x3542('0x38'),'bridgepeer',_0x3542('0x39'),'membercalls',_0x3542('0x3a'),_0x3542('0x3b'),'memberlastcall',_0x3542('0x3c'),_0x3542('0x3d'),'memberrealtime'];if(!_[_0x3542('0x3e')](_0x2b1bf4)&&!_[_0x3542('0x3f')](_0x62429,_0x2b1bf4)){if(_['isUndefined'](this[_0x3542('0xc')][_0x77f699])){this[_0x3542('0xc')][_0x77f699]={};}this[_0x3542('0xc')][_0x77f699][_0x2b1bf4]=_0x586f5b;}};VoiceDialReport[_0x3542('0x13')][_0x3542('0x12')]=function(_0xb12441){try{if(this[_0x3542('0x14')](_0xb12441)){if(this['channels'][_0xb12441['uniqueid']]){this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]][_0x3542('0x40')]=moment()[_0x3542('0x19')](_0x3542('0x1a'));this['channels'][_0xb12441[_0x3542('0x17')]]['duration']=moment(this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]][_0x3542('0x40')])['diff'](this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]]['starttime'],_0x3542('0x41'));this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]][_0x3542('0x29')]=_0x3542('0x42');this[_0x3542('0xb')][_0x3542('0x43')]+=0x1;if(this[_0x3542('0xa')][_0xb12441['uniqueid']]['answertime']){this['outbound'][_0x3542('0x44')]+=0x1;this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]][_0x3542('0x45')]=moment(this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]][_0x3542('0x28')])['diff'](this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]][_0x3542('0x46')],_0x3542('0x41'));this['channels'][_0xb12441[_0x3542('0x17')]][_0x3542('0x47')]=moment(this['channels'][_0xb12441['uniqueid']][_0x3542('0x40')])[_0x3542('0x48')](this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]][_0x3542('0x28')],_0x3542('0x41'));this[_0x3542('0xb')]['sumHoldTime']+=this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]][_0x3542('0x45')]||0x0;this[_0x3542('0xb')][_0x3542('0x49')]+=this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]][_0x3542('0x47')];}this[_0x3542('0xb')]['sumDuration']+=this['channels'][_0xb12441[_0x3542('0x17')]]['duration'];ami['emit']('custom:voiceDialReport',this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]]);ami[_0x3542('0x16')]('custom:dialend',this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]]);this['emit'](_0x3542('0x2b'),_0x3542('0x4a'),this[_0x3542('0xb')]);this[_0x3542('0x16')](_0x3542('0x2b'),'voice_outbound_channel:remove',this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]]);delete this[_0x3542('0xa')][_0xb12441[_0x3542('0x17')]];}if(this[_0x3542('0xc')][_0xb12441['uniqueid']]){delete this['variables'][_0xb12441[_0x3542('0x17')]];}}}catch(_0x401e5e){logger[_0x3542('0x23')]('[syncHangup][VoiceDialReport]',util[_0x3542('0x2c')](_0x401e5e,{'showHidden':![],'depth':null}));}};module[_0x3542('0x4b')]=VoiceDialReport; \ No newline at end of file +var _0x668b=['privilege','voice:outbound','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','connect','voice_outbound_channel:save','error','[syncDialEnd][VoiceDialReport]','syncVarSet','keys','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','includes','duration','endtime','starttime','seconds','lastevent','complete','total','answered','holdtime','billableseconds','diff','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','ioredis','../../../config/environment','ami','redis','defaults','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','merge','format','called','channel','lastIndexOf','substring','omit'];(function(_0x14ce97,_0x3a8197){var _0x3869b3=function(_0x3f1a98){while(--_0x3f1a98){_0x14ce97['push'](_0x14ce97['shift']());}};_0x3869b3(++_0x3a8197);}(_0x668b,0x140));var _0xb668=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0x668b[_0x183256];return _0x5394a2;};'use strict';var _=require(_0xb668('0x0'));var moment=require(_0xb668('0x1'));var util=require('util');var Redis=require(_0xb668('0x2'));var config=require(_0xb668('0x3'));var logger=require('../../../config/logger')(_0xb668('0x4'));var ami=require('../ami');config[_0xb668('0x5')]=_[_0xb668('0x6')](config[_0xb668('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xb668('0x7'))(new Redis(config[_0xb668('0x5')]));function VoiceDialReport(_0x3be92e){this[_0xb668('0x8')]=_0x3be92e[_0xb668('0x9')];this[_0xb668('0xa')]=_0x3be92e['outbound'];this[_0xb668('0xb')]={};ami['on'](_0xb668('0xc'),this[_0xb668('0xd')][_0xb668('0xe')](this));ami['on'](_0xb668('0xf'),this[_0xb668('0x10')][_0xb668('0xe')](this));ami['on'](_0xb668('0x11'),this['syncVarSet'][_0xb668('0xe')](this));ami['on'](_0xb668('0x12'),this[_0xb668('0x13')][_0xb668('0xe')](this));}VoiceDialReport[_0xb668('0x14')][_0xb668('0x15')]=function(_0x1d111a){return _0x1d111a!==null&&!_[_0xb668('0x16')](_0x1d111a);};VoiceDialReport[_0xb668('0x14')][_0xb668('0x17')]=function(_0x1af935,_0x3b7556,_0x3aed25){io['to'](_0x1af935)[_0xb668('0x17')](_0x3b7556,_0x3aed25);};VoiceDialReport[_0xb668('0x14')][_0xb668('0xd')]=function(_0x1ca6e7){try{if(this[_0xb668('0x15')](_0x1ca6e7)){if(this[_0xb668('0x8')][_0x1ca6e7[_0xb668('0x18')]]){_[_0xb668('0x19')](this[_0xb668('0x8')][_0x1ca6e7['uniqueid']],{'starttime':moment()[_0xb668('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xb668('0x1b'),'interface':_0x1ca6e7[_0xb668('0x1c')]['substring'](0x0,_0x1ca6e7[_0xb668('0x1c')][_0xb668('0x1d')]('-')),'membername':_0x1ca6e7['channel'][_0xb668('0x1e')](_0x1ca6e7['channel'][_0xb668('0x1d')]('/')+0x1,_0x1ca6e7[_0xb668('0x1c')][_0xb668('0x1d')]('-'))},_[_0xb668('0x1f')](_0x1ca6e7,['event',_0xb668('0x20')]));this[_0xb668('0x17')](_0xb668('0x21'),'voice_outbound_channel:save',this['channels'][_0x1ca6e7[_0xb668('0x18')]]);ami[_0xb668('0x17')]('custom:dialbegin',this[_0xb668('0x8')][_0x1ca6e7['uniqueid']]);}}}catch(_0x2f1394){logger['error'](_0xb668('0x22'),util[_0xb668('0x23')](_0x2f1394,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb668('0x14')][_0xb668('0x10')]=function(_0x2a5b3d){try{if(this[_0xb668('0x15')](_0x2a5b3d)){if(this['channels'][_0x2a5b3d[_0xb668('0x18')]]){this[_0xb668('0x8')][_0x2a5b3d[_0xb668('0x18')]]['dialstatus']=_0x2a5b3d['dialstatus'];if(_0x2a5b3d[_0xb668('0x24')]===_0xb668('0x25')){this[_0xb668('0x8')][_0x2a5b3d['uniqueid']][_0xb668('0x26')]=_0x2a5b3d[_0xb668('0x26')];this[_0xb668('0x8')][_0x2a5b3d['uniqueid']]['connectedlinename']=_0x2a5b3d[_0xb668('0x27')];this[_0xb668('0x8')][_0x2a5b3d['uniqueid']][_0xb668('0x28')]=moment()[_0xb668('0x1a')](_0xb668('0x29'));this[_0xb668('0x8')][_0x2a5b3d[_0xb668('0x18')]]['lastevent']=_0xb668('0x2a');ami[_0xb668('0x17')]('custom:dialconnect',this[_0xb668('0x8')][_0x2a5b3d['uniqueid']]);}this[_0xb668('0x17')](_0xb668('0x21'),_0xb668('0x2b'),this[_0xb668('0x8')][_0x2a5b3d[_0xb668('0x18')]]);}}}catch(_0x655536){logger[_0xb668('0x2c')](_0xb668('0x2d'),util[_0xb668('0x23')](_0x655536,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xb668('0x2e')]=function(_0x13bc2b){try{if(this[_0xb668('0x15')](_0x13bc2b)){this['addVariable'](_0x13bc2b[_0xb668('0x18')],_[_0xb668('0x2f')](_0x13bc2b[_0xb668('0x30')])[0x0],_0x13bc2b[_0xb668('0x31')]);if(this['isNotNull'](_0x13bc2b[_0xb668('0x30')])&&this[_0xb668('0x15')](_0x13bc2b[_0xb668('0x30')][_0xb668('0x32')])){if(_[_0xb668('0x16')](this[_0xb668('0x8')][_0x13bc2b[_0xb668('0x18')]])){this['channels'][_0x13bc2b[_0xb668('0x18')]]={'routeId':_0x13bc2b[_0xb668('0x31')],'variables':this['variables'][_0x13bc2b[_0xb668('0x18')]]};this['emit']('voice:outbound',_0xb668('0x2b'),this[_0xb668('0x8')][_0x13bc2b['uniqueid']]);}}}}catch(_0x1d7cda){logger['error'](_0xb668('0x33'),util['inspect'](_0x1d7cda,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xb668('0x34')]=function(_0x25fd3c,_0x48008b,_0x4d814c){var _0x218c1c=[_0xb668('0x35'),_0xb668('0x36'),_0xb668('0x37'),_0xb668('0x38'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0xb668('0x39'),_0xb668('0x3a'),_0xb668('0x3b'),_0xb668('0x3c'),_0xb668('0x3d'),_0xb668('0x3e'),'membercalls','memberdynamic',_0xb668('0x3f'),_0xb668('0x40'),_0xb668('0x41'),_0xb668('0x42'),_0xb668('0x43')];if(!_['isNil'](_0x48008b)&&!_[_0xb668('0x44')](_0x218c1c,_0x48008b)){if(_[_0xb668('0x16')](this['variables'][_0x25fd3c])){this[_0xb668('0xb')][_0x25fd3c]={};}this[_0xb668('0xb')][_0x25fd3c][_0x48008b]=_0x4d814c;}};VoiceDialReport[_0xb668('0x14')][_0xb668('0x13')]=function(_0x5273e8){try{if(this['isNotNull'](_0x5273e8)){if(this['channels'][_0x5273e8[_0xb668('0x18')]]){this['channels'][_0x5273e8['uniqueid']]['endtime']=moment()['format'](_0xb668('0x29'));this['channels'][_0x5273e8[_0xb668('0x18')]][_0xb668('0x45')]=moment(this[_0xb668('0x8')][_0x5273e8[_0xb668('0x18')]][_0xb668('0x46')])['diff'](this[_0xb668('0x8')][_0x5273e8[_0xb668('0x18')]][_0xb668('0x47')],_0xb668('0x48'));this[_0xb668('0x8')][_0x5273e8[_0xb668('0x18')]][_0xb668('0x49')]=_0xb668('0x4a');this[_0xb668('0xa')][_0xb668('0x4b')]+=0x1;if(this[_0xb668('0x8')][_0x5273e8['uniqueid']][_0xb668('0x28')]){this[_0xb668('0xa')][_0xb668('0x4c')]+=0x1;this['channels'][_0x5273e8['uniqueid']][_0xb668('0x4d')]=moment(this['channels'][_0x5273e8[_0xb668('0x18')]]['answertime'])['diff'](this['channels'][_0x5273e8[_0xb668('0x18')]][_0xb668('0x47')],'seconds');this[_0xb668('0x8')][_0x5273e8[_0xb668('0x18')]][_0xb668('0x4e')]=moment(this[_0xb668('0x8')][_0x5273e8[_0xb668('0x18')]][_0xb668('0x46')])[_0xb668('0x4f')](this[_0xb668('0x8')][_0x5273e8[_0xb668('0x18')]][_0xb668('0x28')],'seconds');this[_0xb668('0xa')][_0xb668('0x50')]+=this[_0xb668('0x8')][_0x5273e8[_0xb668('0x18')]][_0xb668('0x4d')]||0x0;this[_0xb668('0xa')][_0xb668('0x51')]+=this[_0xb668('0x8')][_0x5273e8[_0xb668('0x18')]]['billableseconds'];}this[_0xb668('0xa')][_0xb668('0x52')]+=this[_0xb668('0x8')][_0x5273e8['uniqueid']]['duration'];ami[_0xb668('0x17')](_0xb668('0x53'),this[_0xb668('0x8')][_0x5273e8['uniqueid']]);ami[_0xb668('0x17')]('custom:dialend',this['channels'][_0x5273e8[_0xb668('0x18')]]);this[_0xb668('0x17')](_0xb668('0x21'),_0xb668('0x54'),this[_0xb668('0xa')]);this[_0xb668('0x17')](_0xb668('0x21'),_0xb668('0x55'),this[_0xb668('0x8')][_0x5273e8[_0xb668('0x18')]]);delete this[_0xb668('0x8')][_0x5273e8[_0xb668('0x18')]];}if(this[_0xb668('0xb')][_0x5273e8[_0xb668('0x18')]]){delete this[_0xb668('0xb')][_0x5273e8[_0xb668('0x18')]];}}}catch(_0x36cb1f){logger[_0xb668('0x2c')](_0xb668('0x56'),util[_0xb668('0x23')](_0x36cb1f,{'showHidden':![],'depth':null}));}};module[_0xb668('0x57')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 41907e0..fd525f0 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x911a=['syncHangup','length','sumHoldTime','diff','milliseconds','lastevent','custom:queuecallerabandon','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','ATTENDEDTRANSFER','ATTENDED','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','ami','../ami','../model/queueReport','redis','localhost','socket.io-emitter','prototype','tail','finally','sequence','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','channels','switch','isNil','Action','status','channel','catch','No\x20such\x20channel','[voiceQueueReport][checkChannel]','error','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','inspect','emit','emitVoiceQueueChannelSave','format','voice_queue_channel:save','emitVoiceQueueChannelRemove','voice_queue_channel:remove','emitVoiceQueueSummary','type','name','answered','available','loggedIn','sumBillable','sumDuration','talking','total','unmanaged','abandoned','Trunk','active','Interval','stringify','voice:queue:%s','voice_queue:save','isNotNull','queues','[queues]','then','[queuesummary]','queue','countBy','callers','toNumber','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','uniqueid','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','ABANDONED','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','queuecallerexitreason','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','queuecallerabandonAt','lastAssignedTo','membername','queuecallerexitAt','transfer','COMPLETED','startsWith','local/','linkedid','queuecallerexit','add','seconds','transfertype','destexten','transferuniqueid','COMPLETEDBY','reason','toUpperCase','syncVarSet','addVariable','variable','value','queuestatus','CONTINUE','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberpenalty','memberrealtime','includes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x911a,0x1b4));var _0xa911=function(_0x241cf2,_0x1f8ae0){_0x241cf2=_0x241cf2-0x0;var _0x4d10bc=_0x911a[_0x241cf2];return _0x4d10bc;};'use strict';var _=require(_0xa911('0x0'));var moment=require(_0xa911('0x1'));var BPromise=require(_0xa911('0x2'));var util=require('util');var md5=require(_0xa911('0x3'));var Redis=require(_0xa911('0x4'));var config=require(_0xa911('0x5'));var logger=require('../../../config/logger')(_0xa911('0x6'));var ami=require(_0xa911('0x7'));var QueueReport=require(_0xa911('0x8'));config['redis']=_['defaults'](config[_0xa911('0x9')],{'host':_0xa911('0xa'),'port':0x18eb});var io=require(_0xa911('0xb'))(new Redis(config[_0xa911('0x9')]));var Sequence=function(){};Sequence[_0xa911('0xc')]['enqueue']=function(_0x35ec08){this['tail']=this[_0xa911('0xd')]?this[_0xa911('0xd')][_0xa911('0xe')](_0x35ec08):_0x35ec08();};function VoiceQueueReport(_0x4fc1f2){this[_0xa911('0xf')]=new Sequence();this[_0xa911('0x10')]={};this[_0xa911('0x11')]=_0x4fc1f2[_0xa911('0x11')];this['channels']=_0x4fc1f2[_0xa911('0x12')];this[_0xa911('0x13')]=_0x4fc1f2[_0xa911('0x13')];this[_0xa911('0x14')]=!![];this['campaigns']=_0x4fc1f2[_0xa911('0x15')];this[_0xa911('0x16')]={};ami['on'](_0xa911('0x17'),this['syncQueueSummary'][_0xa911('0x18')](this));ami['on'](_0xa911('0x19'),this[_0xa911('0x1a')][_0xa911('0x18')](this));ami['on'](_0xa911('0x1b'),this[_0xa911('0x1c')][_0xa911('0x18')](this));ami['on'](_0xa911('0x1d'),this[_0xa911('0x1e')][_0xa911('0x18')](this));ami['on'](_0xa911('0x1f'),this[_0xa911('0x20')]['bind'](this));ami['on'](_0xa911('0x21'),this[_0xa911('0x22')][_0xa911('0x18')](this));ami['on'](_0xa911('0x23'),this[_0xa911('0x24')][_0xa911('0x18')](this));ami['on'](_0xa911('0x25'),this['syncVarSet'][_0xa911('0x18')](this));ami['on']('hangup',this['syncHangup'][_0xa911('0x18')](this));ami['on'](_0xa911('0x26'),this[_0xa911('0x27')][_0xa911('0x18')](this));ami['on'](_0xa911('0x28'),this[_0xa911('0x29')][_0xa911('0x18')](this));ami['on'](_0xa911('0x2a'),this[_0xa911('0x2b')][_0xa911('0x18')](this));ami['on'](_0xa911('0x2c'),this[_0xa911('0x2d')][_0xa911('0x18')](this));ami['on'](_0xa911('0x2e'),this[_0xa911('0x2f')][_0xa911('0x18')](this));this[_0xa911('0x30')]();this[_0xa911('0x31')]();}function isNotNull(_0x4b2fd1){return _0x4b2fd1!==null&&!_[_0xa911('0x32')](_0x4b2fd1);}function clearChannels(_0x96b322){if(!_[_0xa911('0x33')](_0x96b322)){for(var _0xeb003b in _0x96b322){if(_0x96b322[_0xa911('0x34')](_0xeb003b)){delete _0x96b322[_0xeb003b];}}}}function clearCampaigns(_0x2b2709){if(!_[_0xa911('0x33')](_0x2b2709)){for(var _0x10627f in _0x2b2709){if(_0x2b2709[_0xa911('0x34')](_0x10627f)){_0x2b2709[_0x10627f][_0xa911('0x35')]=0x0;}}}}function clearVoiceQueues(_0xc6ae73){if(!_['isEmpty'](_0xc6ae73)){for(var _0x5b5151 in _0xc6ae73){if(_0xc6ae73[_0xa911('0x34')](_0x5b5151)){_0xc6ae73[_0x5b5151][_0xa911('0x35')]=0x0;_0xc6ae73[_0x5b5151]['talking']=0x0;_0xc6ae73[_0x5b5151][_0xa911('0x36')]=0x0;_0xc6ae73[_0x5b5151][_0xa911('0x37')]=0x0;_0xc6ae73[_0x5b5151][_0xa911('0x38')]=!![];}}}}function clearAgentBooked(_0x365155){if(!_[_0xa911('0x33')](_0x365155)){for(var _0x4c3af8 in _0x365155){if(_0x365155[_0xa911('0x34')](_0x4c3af8)){_0x365155[_0x4c3af8][_0xa911('0x39')]=!![];}}}}VoiceQueueReport[_0xa911('0xc')][_0xa911('0x3a')]=function(){var _0x582bf9=this;for(var _0x55bec8 in this[_0xa911('0x3b')]){if(this[_0xa911('0x3b')]['hasOwnProperty'](_0x55bec8)&&!this[_0xa911('0x3b')][_0x55bec8][_0xa911('0x3c')]){this['sequence']['enqueue'](function(){if(!_[_0xa911('0x3d')](_0x582bf9['channels'][_0x55bec8])){return ami[_0xa911('0x3e')]({'action':_0xa911('0x3f'),'channel':_0x582bf9['channels'][_0x55bec8][_0xa911('0x40')]})[_0xa911('0x41')](function(_0xdda739){if(_0xdda739['message']===_0xa911('0x42')){setTimeout(function(){if(_0x582bf9[_0xa911('0x3b')][_0x55bec8]){delete _0x582bf9[_0xa911('0x3b')][_0x55bec8];logger['error'](_0xa911('0x43'),_0x55bec8);}if(_0x582bf9[_0xa911('0x10')][_0x55bec8]){delete _0x582bf9[_0xa911('0x10')][_0x55bec8];logger[_0xa911('0x44')](_0xa911('0x45'),_0x55bec8);}if(_0x582bf9['variables'][_0x55bec8]){delete _0x582bf9[_0xa911('0x16')][_0x55bec8];logger[_0xa911('0x44')](_0xa911('0x46'),_0x55bec8);}},0x1f40);}});}});}}};VoiceQueueReport['prototype']['syncFullyBooted']=function(){logger[_0xa911('0x44')](_0xa911('0x47'));clearChannels(this[_0xa911('0x3b')]);this['clearQueueReport'](this[_0xa911('0x10')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0xa911('0x13')]);clearCampaigns(this[_0xa911('0x15')]);};VoiceQueueReport['prototype'][_0xa911('0x48')]=function(_0xcc1972){var _0xfb05a9=this;if(!_[_0xa911('0x33')](_0xcc1972)){for(var _0x454794 in _0xcc1972){if(_0xcc1972[_0xa911('0x34')](_0x454794)){_0xfb05a9['emitVoiceQueueChannelRemove'](_0xcc1972[_0x454794]);delete _0xcc1972[_0x454794];}}}};function loggerCatch(_0x12c85e){return function(_0x2ce9df){logger[_0xa911('0x44')](_0x12c85e,util[_0xa911('0x49')](_0x2ce9df,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xa911('0xc')][_0xa911('0x4a')]=function(_0x4000be,_0x3233eb,_0x381cfe){io['to'](_0x4000be)[_0xa911('0x4a')](_0x3233eb,_0x381cfe);};VoiceQueueReport[_0xa911('0xc')][_0xa911('0x4b')]=function(_0x13ae8b){this[_0xa911('0x4a')](util[_0xa911('0x4c')]('voice:queue:%s',_0x13ae8b['name']),_0xa911('0x4d'),_0x13ae8b);};VoiceQueueReport['prototype'][_0xa911('0x4e')]=function(_0x5baeda){this[_0xa911('0x4a')](util['format']('voice:queue:%s',_0x5baeda['name']),_0xa911('0x4f'),_0x5baeda);};VoiceQueueReport[_0xa911('0xc')][_0xa911('0x50')]=function(_0xe7d183){if(_0xe7d183[_0xa911('0x51')]==='inbound'){var _0xbab642={'id':_0xe7d183['id'],'name':_0xe7d183[_0xa911('0x52')],'strategy':_0xe7d183['strategy'],'answered':_0xe7d183[_0xa911('0x53')],'available':_0xe7d183[_0xa911('0x54')],'loggedIn':_0xe7d183[_0xa911('0x55')],'pTalking':_0xe7d183[_0xa911('0x36')],'sumBillable':_0xe7d183[_0xa911('0x56')],'sumDuration':_0xe7d183[_0xa911('0x57')],'sumHoldTime':_0xe7d183['sumHoldTime']||0x0,'talking':_0xe7d183[_0xa911('0x58')],'total':_0xe7d183[_0xa911('0x59')],'type':_0xe7d183[_0xa911('0x51')],'unmanaged':_0xe7d183[_0xa911('0x5a')],'abandoned':_0xe7d183[_0xa911('0x5b')],'waiting':_0xe7d183['waiting']};if(_0xe7d183[_0xa911('0x5c')]){_0xbab642['Trunk']={'id':_0xe7d183[_0xa911('0x5c')]['id'],'name':_0xe7d183['Trunk'][_0xa911('0x52')],'active':_0xe7d183[_0xa911('0x5c')][_0xa911('0x5d')],'callerid':_0xe7d183[_0xa911('0x5c')]['callerid']};}if(_0xe7d183[_0xa911('0x5e')]){_0xbab642['Interval']={'id':_0xe7d183[_0xa911('0x5e')]['id'],'name':_0xe7d183[_0xa911('0x5e')][_0xa911('0x52')]};}var _0x5bb4c1=md5(JSON[_0xa911('0x5f')](_0xbab642));if(_0xe7d183[_0xa911('0x3')]!==_0x5bb4c1){_0xe7d183[_0xa911('0x3')]=_0x5bb4c1;this[_0xa911('0x4a')](util[_0xa911('0x4c')](_0xa911('0x60'),_0xbab642['name']),_0xa911('0x61'),_0xbab642);}}};VoiceQueueReport[_0xa911('0xc')][_0xa911('0x62')]=function(_0x3499d4){return _0x3499d4!==null&&!_[_0xa911('0x32')](_0x3499d4);};VoiceQueueReport[_0xa911('0xc')][_0xa911('0x31')]=function(){var _0x122641=this;setInterval(function(){_0x122641[_0xa911('0x3a')]();ami[_0xa911('0x3e')]({'action':_0xa911('0x63')})[_0xa911('0x41')](loggerCatch(_0xa911('0x64')));},0x2710);};VoiceQueueReport['prototype'][_0xa911('0x30')]=function(){var _0xedae3a=this;setInterval(function(){if(_0xedae3a[_0xa911('0x14')]){return ami[_0xa911('0x3e')]({'action':_0xa911('0x17')})[_0xa911('0x65')](function(_0x156918){_0xedae3a['flagQueueSummary']=![];})[_0xa911('0x41')](loggerCatch(_0xa911('0x66')));}},0x3e8);};VoiceQueueReport[_0xa911('0xc')]['syncQueueSummary']=function(_0x196af7){try{if(this['isNotNull'](_0x196af7)&&this[_0xa911('0x62')](_0x196af7[_0xa911('0x67')])){if(this[_0xa911('0x13')][_0x196af7['queue']]){var _0x370d4f=_[_0xa911('0x68')](this[_0xa911('0x3b')],_0xa911('0x67'))[_0x196af7[_0xa911('0x67')]]||0x0;var _0x578436=_0x370d4f-_0x196af7[_0xa911('0x69')];if(this[_0xa911('0x13')][_0x196af7[_0xa911('0x67')]][_0xa911('0x37')]!==_[_0xa911('0x6a')](_0x196af7[_0xa911('0x69')])||this[_0xa911('0x13')][_0x196af7[_0xa911('0x67')]][_0xa911('0x55')]!==_[_0xa911('0x6a')](_0x196af7[_0xa911('0x6b')])||this[_0xa911('0x13')][_0x196af7['queue']][_0xa911('0x54')]!==_['toNumber'](_0x196af7[_0xa911('0x54')])||this[_0xa911('0x13')][_0x196af7['queue']]['talking']!==_0x578436){this[_0xa911('0x13')][_0x196af7[_0xa911('0x67')]][_0xa911('0x37')]=_[_0xa911('0x6a')](_0x196af7['callers']);this[_0xa911('0x13')][_0x196af7['queue']]['loggedIn']=_[_0xa911('0x6a')](_0x196af7[_0xa911('0x6b')]);this[_0xa911('0x13')][_0x196af7[_0xa911('0x67')]][_0xa911('0x54')]=_[_0xa911('0x6a')](_0x196af7[_0xa911('0x54')]);this[_0xa911('0x13')][_0x196af7[_0xa911('0x67')]]['talking']=_0x578436>0x0?_0x578436:0x0;this[_0xa911('0x13')][_0x196af7['queue']]['talking']=this[_0xa911('0x13')][_0x196af7[_0xa911('0x67')]][_0xa911('0x58')]>_[_0xa911('0x6a')](_0x196af7[_0xa911('0x6b')])?_[_0xa911('0x6a')](_0x196af7[_0xa911('0x6b')]):this[_0xa911('0x13')][_0x196af7[_0xa911('0x67')]]['talking'];this[_0xa911('0x50')](this[_0xa911('0x13')][_0x196af7[_0xa911('0x67')]]);}ami[_0xa911('0x4a')](_0xa911('0x6c'),this[_0xa911('0x13')][_0x196af7['queue']]);}}}catch(_0x32d376){logger[_0xa911('0x44')](_0xa911('0x6d'),util[_0xa911('0x49')](_0x32d376,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa911('0xc')]['syncQueueSummaryComplete']=function(_0x5db0cb){this[_0xa911('0x14')]=!![];};VoiceQueueReport[_0xa911('0xc')][_0xa911('0x6e')]=function(_0x3328d5){};VoiceQueueReport[_0xa911('0xc')][_0xa911('0x1c')]=function(_0x5029fd){try{if(this[_0xa911('0x62')](_0x5029fd)){if(_[_0xa911('0x32')](this[_0xa911('0x10')][_0x5029fd[_0xa911('0x6f')]])){this[_0xa911('0x10')][_0x5029fd[_0xa911('0x6f')]]=[];this['channels'][_0x5029fd[_0xa911('0x6f')]]={};}var _0x16995a=new QueueReport();_0x16995a[_0xa911('0x52')]=_0x5029fd['queue'];_0x16995a[_0xa911('0x51')]=this[_0xa911('0x13')][_0x16995a[_0xa911('0x52')]]&&this['voiceQueues'][_0x16995a[_0xa911('0x52')]][_0xa911('0x51')]?this[_0xa911('0x13')][_0x16995a['name']][_0xa911('0x51')]||_0xa911('0x70'):'inbound';_0x16995a[_0xa911('0x67')]=_0x5029fd[_0xa911('0x67')];_0x16995a[_0xa911('0x71')]=moment()['format'](_0xa911('0x72'));_0x16995a[_0xa911('0x73')]=_0x5029fd[_0xa911('0x73')];_0x16995a[_0xa911('0x74')]=_0x5029fd['count'];_[_0xa911('0x75')](_0x16995a,_[_0xa911('0x76')](_0x5029fd,_['keys'](_0x16995a)));this['queueReports'][_0x5029fd[_0xa911('0x6f')]][_0xa911('0x77')](_0x16995a);this['channels'][_0x5029fd[_0xa911('0x6f')]]=_0x16995a;this[_0xa911('0x4b')](_0x16995a);}}catch(_0x501611){logger[_0xa911('0x44')](_0xa911('0x78'),util[_0xa911('0x49')](_0x501611,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x1ad6c9){try{if(this['isNotNull'](_0x1ad6c9)){if(this[_0xa911('0x10')][_0x1ad6c9['uniqueid']]){var _0x535510=_[_0xa911('0x79')](this['queueReports'][_0x1ad6c9[_0xa911('0x6f')]]);_0x535510[_0xa911('0x7a')]=![];_0x535510[_0xa911('0x7b')]=null;_0x535510[_0xa911('0x7c')]=_0x1ad6c9[_0xa911('0x7c')];_0x535510[_0xa911('0x7d')]=_0x1ad6c9[_0xa911('0x7d')];_0x535510[_0xa911('0x1d')]=!![];_0x535510['queuecallerabandonAt']=moment()[_0xa911('0x4c')](_0xa911('0x72'));_0x535510['queuecallerexitreason']=_0xa911('0x7e');_0x535510['lastAssignedTo']=null;this[_0xa911('0x3b')][_0x1ad6c9[_0xa911('0x6f')]]=_0x535510;this[_0xa911('0x4e')](_0x535510);}}}catch(_0x5d890e){logger[_0xa911('0x44')](_0xa911('0x7f'),util[_0xa911('0x49')](_0x5d890e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa911('0xc')]['syncQueueCallerLeave']=function(_0x1e526f){try{if(this['isNotNull'](_0x1e526f)){if(this['queueReports'][_0x1e526f[_0xa911('0x6f')]]){var _0x153217=_[_0xa911('0x79')](this[_0xa911('0x10')][_0x1e526f[_0xa911('0x6f')]]);_0x153217[_0xa911('0x80')]=moment()[_0xa911('0x4c')](_0xa911('0x72'));_0x153217[_0xa911('0x81')]=_0x1e526f[_0xa911('0x81')];_0x153217[_0xa911('0x82')]=_0x1e526f[_0xa911('0x82')];this[_0xa911('0x3b')][_0x1e526f['uniqueid']]=_0x153217;this[_0xa911('0x4b')](_0x153217);}}}catch(_0x1fccb7){logger['error'](_0xa911('0x83'),util[_0xa911('0x49')](_0x1fccb7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa911('0xc')][_0xa911('0x24')]=function(_0x338844){try{if(this[_0xa911('0x62')](_0x338844)){if(this[_0xa911('0x10')][_0x338844[_0xa911('0x6f')]]){var _0x3ed520=_['last'](this[_0xa911('0x10')][_0x338844[_0xa911('0x6f')]]);_0x3ed520[_0xa911('0x7a')]=!![];_0x3ed520[_0xa911('0x84')]=_0xa911('0x85');}}}catch(_0x22a4f9){logger[_0xa911('0x44')](_0xa911('0x86'),util[_0xa911('0x49')](_0x22a4f9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa911('0xc')]['syncAgentComplete']=function(_0x476c42){try{if(this[_0xa911('0x62')](_0x476c42)){if(this['queueReports'][_0x476c42['uniqueid']]){var _0x2cb7f8=_[_0xa911('0x79')](this[_0xa911('0x10')][_0x476c42[_0xa911('0x6f')]]);_0x2cb7f8[_0xa911('0x1d')]=![];_0x2cb7f8[_0xa911('0x87')]=null;_0x2cb7f8['assigned']=!![];_0x2cb7f8[_0xa911('0x88')]=_0x476c42[_0xa911('0x89')];_0x2cb7f8[_0xa911('0x7c')]=_0x476c42[_0xa911('0x7c')];_0x2cb7f8[_0xa911('0x7a')]=!![];_0x2cb7f8['queuecallerexit']=![];_0x2cb7f8[_0xa911('0x8a')]=null;if(!_0x2cb7f8[_0xa911('0x8b')]){if(_0x476c42['reason']=='transfer'){_0x2cb7f8['queuecallerexitreason']=_0xa911('0x8c');}else{if(_[_0xa911('0x8d')](_0x476c42[_0xa911('0x40')]['toLowerCase'](),_0xa911('0x8e'))){if(this[_0xa911('0x10')][_0x476c42[_0xa911('0x8f')]]){var _0x95d47e=_['last'](this['queueReports'][_0x476c42['linkedid']]);_0x95d47e['queuecallercomplete']=![];_0x95d47e[_0xa911('0x90')]=!![];_0x95d47e[_0xa911('0x8a')]=moment(_0x2cb7f8[_0xa911('0x71')])[_0xa911('0x91')](_0x476c42['holdtime'],_0xa911('0x92'))[_0xa911('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x95d47e[_0xa911('0x84')]='FORWARDTRANSFER';_0x95d47e[_0xa911('0x8b')]=!![];_0x95d47e[_0xa911('0x93')]='FORWARD';_0x95d47e['transferexten']=_0x476c42[_0xa911('0x94')];_0x95d47e[_0xa911('0x95')]=_0x476c42[_0xa911('0x6f')];var _0x3a5e0b=this[_0xa911('0x10')][_0x476c42[_0xa911('0x8f')]];this['queueReports'][_0x476c42[_0xa911('0x8f')]]=this[_0xa911('0x10')][_0x476c42[_0xa911('0x6f')]];this[_0xa911('0x10')][_0x476c42[_0xa911('0x6f')]]=_0x3a5e0b;}}else{_0x2cb7f8[_0xa911('0x84')]=_0xa911('0x96')+_0x476c42[_0xa911('0x97')][_0xa911('0x98')]();}}}this['channels'][_0x476c42[_0xa911('0x6f')]]=_0x2cb7f8;this['emitVoiceQueueChannelRemove'](_0x2cb7f8);}}}catch(_0x2f4d83){logger[_0xa911('0x44')]('[syncAgentComplete][VoiceQueueReport]',util['inspect'](_0x2f4d83,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa911('0xc')][_0xa911('0x99')]=function(_0x5f4972){try{if(this[_0xa911('0x62')](_0x5f4972)){this[_0xa911('0x9a')](_0x5f4972[_0xa911('0x6f')],_['keys'](_0x5f4972[_0xa911('0x9b')])[0x0],_0x5f4972[_0xa911('0x9c')]);if(this['queueReports'][_0x5f4972['uniqueid']]){var _0x5ad6b9=_[_0xa911('0x79')](this[_0xa911('0x10')][_0x5f4972[_0xa911('0x6f')]]);if(_0x5ad6b9){if(this[_0xa911('0x62')](_0x5f4972[_0xa911('0x9b')])&&this[_0xa911('0x62')](_0x5f4972[_0xa911('0x9b')][_0xa911('0x9d')])){switch(_0x5f4972[_0xa911('0x9c')]){case _0xa911('0x9e'):_0x5ad6b9[_0xa911('0x90')]=![];_0x5ad6b9[_0xa911('0x8a')]=null;break;default:_0x5ad6b9[_0xa911('0x90')]=!![];_0x5ad6b9[_0xa911('0x8a')]=moment()[_0xa911('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ad6b9[_0xa911('0x80')]=moment()['format'](_0xa911('0x72'));}_0x5ad6b9[_0xa911('0x1d')]=![];_0x5ad6b9[_0xa911('0x87')]=null;_0x5ad6b9[_0xa911('0x84')]=_0x5f4972['value'];this[_0xa911('0x3b')][_0x5f4972['uniqueid']]=_0x5ad6b9;this[_0xa911('0x4e')](_0x5ad6b9);}else if(this['isNotNull'](_0x5f4972['variable'])&&this['isNotNull'](_0x5f4972[_0xa911('0x9b')][_0xa911('0x9f')])){if(!_0x5ad6b9[_0xa911('0x1d')]){_0x5ad6b9[_0xa911('0x90')]=!![];_0x5ad6b9[_0xa911('0x8a')]=moment()[_0xa911('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ad6b9['queuecallerexitreason']=_0xa911('0xa0');_0x5ad6b9[_0xa911('0x80')]=moment()['format'](_0xa911('0x72'));this[_0xa911('0x3b')][_0x5f4972['uniqueid']]=_0x5ad6b9;}}_0x5ad6b9[_0xa911('0x16')]=this[_0xa911('0x16')][_0x5f4972[_0xa911('0x6f')]];}}}}catch(_0x480be2){logger[_0xa911('0x44')](_0xa911('0xa1'),util[_0xa911('0x49')](_0x480be2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa911('0xc')]['addVariable']=function(_0x4cea13,_0x2a87ec,_0x26a339){var _0x2a3643=[_0xa911('0xa2'),_0xa911('0xa3'),_0xa911('0xa4'),_0xa911('0xa5'),_0xa911('0xa6'),_0xa911('0xa7'),_0xa911('0xa8'),'rtpaudioqosrttbridged','sipcallid',_0xa911('0xa9'),'bridgepeer',_0xa911('0xaa'),_0xa911('0xab'),_0xa911('0xac'),'memberinterface','memberlastcall',_0xa911('0x89'),_0xa911('0xad'),_0xa911('0xae')];if(!_[_0xa911('0x3d')](_0x2a87ec)&&!_[_0xa911('0xaf')](_0x2a3643,_0x2a87ec)){if(_[_0xa911('0x32')](this[_0xa911('0x16')][_0x4cea13])){this[_0xa911('0x16')][_0x4cea13]={};}this[_0xa911('0x16')][_0x4cea13][_0x2a87ec]=_0x26a339;}};VoiceQueueReport[_0xa911('0xc')][_0xa911('0xb0')]=function(_0x282458){try{if(this['isNotNull'](_0x282458)){if(this[_0xa911('0x10')][_0x282458[_0xa911('0x6f')]]){for(var _0x4d787e=0x0,_0x35eb19={};_0x4d787e0x0?_0x3c2dfe:0x0;this[_0xb557('0x16')][_0x1037da['queue']]['talking']=this[_0xb557('0x16')][_0x1037da[_0xb557('0x66')]][_0xb557('0x37')]>_[_0xb557('0x68')](_0x1037da[_0xb557('0x69')])?_['toNumber'](_0x1037da[_0xb557('0x69')]):this[_0xb557('0x16')][_0x1037da[_0xb557('0x66')]][_0xb557('0x37')];this[_0xb557('0x50')](this[_0xb557('0x16')][_0x1037da[_0xb557('0x66')]]);}ami[_0xb557('0x4b')](_0xb557('0x6b'),this['voiceQueues'][_0x1037da['queue']]);}}}catch(_0x2856d5){logger['error'](_0xb557('0x6c'),util[_0xb557('0x4a')](_0x2856d5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb557('0xe')][_0xb557('0x6d')]=function(_0x29f404){this[_0xb557('0x17')]=!![];};VoiceQueueReport[_0xb557('0xe')][_0xb557('0x6e')]=function(_0x4df002){};VoiceQueueReport[_0xb557('0xe')][_0xb557('0x1f')]=function(_0x16d485){try{if(this['isNotNull'](_0x16d485)){if(_[_0xb557('0x33')](this[_0xb557('0x13')][_0x16d485[_0xb557('0x6f')]])){this[_0xb557('0x13')][_0x16d485[_0xb557('0x6f')]]=[];this['channels'][_0x16d485['uniqueid']]={};}var _0x1fa7b2=new QueueReport();_0x1fa7b2[_0xb557('0x4e')]=_0x16d485[_0xb557('0x66')];_0x1fa7b2[_0xb557('0x51')]=this['voiceQueues'][_0x1fa7b2['name']]&&this['voiceQueues'][_0x1fa7b2[_0xb557('0x4e')]][_0xb557('0x51')]?this[_0xb557('0x16')][_0x1fa7b2[_0xb557('0x4e')]]['type']||_0xb557('0x52'):_0xb557('0x52');_0x1fa7b2['queue']=_0x16d485[_0xb557('0x66')];_0x1fa7b2[_0xb557('0x70')]=moment()[_0xb557('0x4c')](_0xb557('0x71'));_0x1fa7b2[_0xb557('0x72')]=_0x16d485[_0xb557('0x72')];_0x1fa7b2[_0xb557('0x73')]=_0x16d485['count'];_[_0xb557('0x74')](_0x1fa7b2,_[_0xb557('0x75')](_0x16d485,_['keys'](_0x1fa7b2)));this[_0xb557('0x13')][_0x16d485[_0xb557('0x6f')]][_0xb557('0x76')](_0x1fa7b2);this['channels'][_0x16d485[_0xb557('0x6f')]]=_0x1fa7b2;this['emitVoiceQueueChannelSave'](_0x1fa7b2);}}catch(_0x321a63){logger[_0xb557('0x44')](_0xb557('0x77'),util[_0xb557('0x4a')](_0x321a63,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb557('0xe')][_0xb557('0x21')]=function(_0x102e0b){try{if(this[_0xb557('0x61')](_0x102e0b)){if(this[_0xb557('0x13')][_0x102e0b[_0xb557('0x6f')]]){var _0x4c4ebb=_['last'](this[_0xb557('0x13')][_0x102e0b[_0xb557('0x6f')]]);_0x4c4ebb['queuecallercomplete']=![];_0x4c4ebb[_0xb557('0x78')]=null;_0x4c4ebb[_0xb557('0x79')]=_0x102e0b[_0xb557('0x79')];_0x4c4ebb[_0xb557('0x7a')]=_0x102e0b[_0xb557('0x7a')];_0x4c4ebb[_0xb557('0x20')]=!![];_0x4c4ebb['queuecallerabandonAt']=moment()[_0xb557('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4c4ebb[_0xb557('0x7b')]=_0xb557('0x7c');_0x4c4ebb[_0xb557('0x7d')]=null;this[_0xb557('0x3c')][_0x102e0b[_0xb557('0x6f')]]=_0x4c4ebb;this[_0xb557('0x49')](_0x4c4ebb);}}}catch(_0x282b17){logger['error'](_0xb557('0x7e'),util['inspect'](_0x282b17,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb557('0xe')][_0xb557('0x23')]=function(_0x546178){try{if(this[_0xb557('0x61')](_0x546178)){if(this[_0xb557('0x13')][_0x546178[_0xb557('0x6f')]]){var _0xdae713=_[_0xb557('0x7f')](this['queueReports'][_0x546178['uniqueid']]);_0xdae713[_0xb557('0x80')]=moment()['format'](_0xb557('0x71'));_0xdae713['connectedlinenum']=_0x546178[_0xb557('0x81')];_0xdae713[_0xb557('0x82')]=_0x546178[_0xb557('0x82')];this['channels'][_0x546178[_0xb557('0x6f')]]=_0xdae713;this[_0xb557('0x83')](_0xdae713);}}}catch(_0x5f4969){logger[_0xb557('0x44')]('[syncQueueCallerLeave][VoiceQueueReport]',util[_0xb557('0x4a')](_0x5f4969,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb557('0xe')]['syncAgentConnect']=function(_0x1c63c9){try{if(this[_0xb557('0x61')](_0x1c63c9)){if(this['queueReports'][_0x1c63c9['uniqueid']]){var _0x2c5295=_['last'](this[_0xb557('0x13')][_0x1c63c9[_0xb557('0x6f')]]);_0x2c5295[_0xb557('0x84')]=!![];_0x2c5295[_0xb557('0x7b')]=_0xb557('0x85');}}}catch(_0x8efa6e){logger[_0xb557('0x44')](_0xb557('0x86'),util[_0xb557('0x4a')](_0x8efa6e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb557('0xe')][_0xb557('0x25')]=function(_0x2f8d94){try{if(this['isNotNull'](_0x2f8d94)){if(this['queueReports'][_0x2f8d94['uniqueid']]){var _0x5a747d=_[_0xb557('0x7f')](this[_0xb557('0x13')][_0x2f8d94['uniqueid']]);_0x5a747d['queuecallerabandon']=![];_0x5a747d[_0xb557('0x87')]=null;_0x5a747d[_0xb557('0x88')]=!![];_0x5a747d[_0xb557('0x7d')]=_0x2f8d94[_0xb557('0x89')];_0x5a747d['holdtime']=_0x2f8d94[_0xb557('0x79')];_0x5a747d[_0xb557('0x84')]=!![];_0x5a747d[_0xb557('0x8a')]=![];_0x5a747d[_0xb557('0x8b')]=null;if(!_0x5a747d[_0xb557('0x8c')]){if(_0x2f8d94['reason']==_0xb557('0x8c')){_0x5a747d[_0xb557('0x7b')]='COMPLETED';}else{if(_[_0xb557('0x8d')](_0x2f8d94['channel'][_0xb557('0x8e')](),_0xb557('0x8f'))){if(this['queueReports'][_0x2f8d94[_0xb557('0x90')]]){var _0x1c6ff6=_['last'](this[_0xb557('0x13')][_0x2f8d94['linkedid']]);_0x1c6ff6[_0xb557('0x84')]=![];_0x1c6ff6[_0xb557('0x8a')]=!![];_0x1c6ff6[_0xb557('0x8b')]=moment(_0x5a747d[_0xb557('0x70')])[_0xb557('0x91')](_0x2f8d94[_0xb557('0x79')],'seconds')[_0xb557('0x4c')](_0xb557('0x71'));_0x1c6ff6[_0xb557('0x7b')]=_0xb557('0x92');_0x1c6ff6['transfer']=!![];_0x1c6ff6[_0xb557('0x93')]=_0xb557('0x94');_0x1c6ff6['transferexten']=_0x2f8d94[_0xb557('0x95')];_0x1c6ff6[_0xb557('0x96')]=_0x2f8d94[_0xb557('0x6f')];var _0x4518d1=this[_0xb557('0x13')][_0x2f8d94[_0xb557('0x90')]];this[_0xb557('0x13')][_0x2f8d94[_0xb557('0x90')]]=this['queueReports'][_0x2f8d94[_0xb557('0x6f')]];this[_0xb557('0x13')][_0x2f8d94[_0xb557('0x6f')]]=_0x4518d1;}}else{_0x5a747d[_0xb557('0x7b')]=_0xb557('0x97')+_0x2f8d94[_0xb557('0x98')][_0xb557('0x99')]();}}}this[_0xb557('0x3c')][_0x2f8d94['uniqueid']]=_0x5a747d;this[_0xb557('0x49')](_0x5a747d);}}}catch(_0x127d18){logger[_0xb557('0x44')](_0xb557('0x9a'),util[_0xb557('0x4a')](_0x127d18,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb557('0x29')]=function(_0x3991c0){try{if(this[_0xb557('0x61')](_0x3991c0)){this[_0xb557('0x9b')](_0x3991c0[_0xb557('0x6f')],_['keys'](_0x3991c0[_0xb557('0x9c')])[0x0],_0x3991c0['value']);if(this[_0xb557('0x13')][_0x3991c0[_0xb557('0x6f')]]){var _0x519d91=_[_0xb557('0x7f')](this[_0xb557('0x13')][_0x3991c0[_0xb557('0x6f')]]);if(_0x519d91){if(this['isNotNull'](_0x3991c0[_0xb557('0x9c')])&&this['isNotNull'](_0x3991c0[_0xb557('0x9c')][_0xb557('0x9d')])){switch(_0x3991c0[_0xb557('0x9e')]){case _0xb557('0x9f'):_0x519d91['queuecallerexit']=![];_0x519d91['queuecallerexitAt']=null;break;default:_0x519d91[_0xb557('0x8a')]=!![];_0x519d91[_0xb557('0x8b')]=moment()[_0xb557('0x4c')](_0xb557('0x71'));_0x519d91[_0xb557('0x80')]=moment()[_0xb557('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');}_0x519d91[_0xb557('0x20')]=![];_0x519d91['queuecallerabandonAt']=null;_0x519d91[_0xb557('0x7b')]=_0x3991c0[_0xb557('0x9e')];this['channels'][_0x3991c0[_0xb557('0x6f')]]=_0x519d91;this[_0xb557('0x49')](_0x519d91);}else if(this[_0xb557('0x61')](_0x3991c0[_0xb557('0x9c')])&&this['isNotNull'](_0x3991c0[_0xb557('0x9c')][_0xb557('0xa0')])){if(!_0x519d91[_0xb557('0x20')]){_0x519d91[_0xb557('0x8a')]=!![];_0x519d91['queuecallerexitAt']=moment()['format'](_0xb557('0x71'));_0x519d91[_0xb557('0x7b')]=_0xb557('0xa1');_0x519d91['queuecallerleaveAt']=moment()[_0xb557('0x4c')](_0xb557('0x71'));this[_0xb557('0x3c')][_0x3991c0['uniqueid']]=_0x519d91;}}_0x519d91[_0xb557('0x19')]=this[_0xb557('0x19')][_0x3991c0[_0xb557('0x6f')]];}}}}catch(_0x30f1af){logger['error']('[syncVarSet][VoiceQueueReport]',util[_0xb557('0x4a')](_0x30f1af,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb557('0xe')][_0xb557('0x9b')]=function(_0xd41fc5,_0x3e1185,_0x6a1071){var _0x5811ca=[_0xb557('0xa2'),_0xb557('0xa3'),_0xb557('0xa4'),_0xb557('0xa5'),_0xb557('0xa6'),_0xb557('0xa7'),_0xb557('0xa8'),_0xb557('0xa9'),_0xb557('0xaa'),_0xb557('0xab'),_0xb557('0xac'),_0xb557('0xad'),_0xb557('0xae'),_0xb557('0xaf'),_0xb557('0xb0'),_0xb557('0xb1'),_0xb557('0x89'),_0xb557('0xb2'),'memberrealtime'];if(!_[_0xb557('0x3e')](_0x3e1185)&&!_['includes'](_0x5811ca,_0x3e1185)){if(_['isUndefined'](this['variables'][_0xd41fc5])){this[_0xb557('0x19')][_0xd41fc5]={};}this[_0xb557('0x19')][_0xd41fc5][_0x3e1185]=_0x6a1071;}};VoiceQueueReport[_0xb557('0xe')][_0xb557('0x2b')]=function(_0x5658d6){try{if(this[_0xb557('0x61')](_0x5658d6)){if(this['queueReports'][_0x5658d6[_0xb557('0x6f')]]){for(var _0x4baf27=0x0,_0x36ef6c={};_0x4baf27=0x0?moment(_0x54bbd5[_0x3665('0x1b')])['diff'](_0x54bbd5['starttime'],_0x3665('0xe')):null,'data1':_0x3665('0x1c'),'data2':_0x54bbd5['accountcode'],'data3':_0x54bbd5[_0x3665('0x11')],'data4':_0x54bbd5['dialstring']||null,'role':_0x3665('0x13'),'internal':_0x54bbd5[_0x3665('0x14')]?_[_0x3665('0x1d')](_0x54bbd5[_0x3665('0x14')]):undefined,'uniqueid':_0x54bbd5[_0x3665('0x15')]},'log':_0x3665('0x5')});}; \ No newline at end of file +var _0xde5e=['uniqueid','voice','membername','endtime','seconds','starttime','exten','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','isNil','interface','SIP/%s','lastAssignedTo','TALKING','diff','queuecallerleaveAt','inbound','calleridnum','queue','agent','accountcode','toNumber'];(function(_0x38a8fc,_0xa41080){var _0x5aafae=function(_0x1dc846){while(--_0x1dc846){_0x38a8fc['push'](_0x38a8fc['shift']());}};_0x5aafae(++_0xa41080);}(_0xde5e,0xda));var _0xede5=function(_0xc52bd0,_0x1de7f9){_0xc52bd0=_0xc52bd0-0x0;var _0x44d366=_0xde5e[_0xc52bd0];return _0x44d366;};'use strict';var moment=require(_0xede5('0x0'));var _=require(_0xede5('0x1'));var util=require(_0xede5('0x2'));var client=require(_0xede5('0x3'));exports[_0xede5('0x4')]=function(_0x5cbe89){var _0x171fd1=_0x5cbe89[_0xede5('0x5')]||_0x5cbe89[_0xede5('0x6')];return client[_0xede5('0x7')](_0xede5('0x8'),{'body':{'channel':'voice','membername':_0x5cbe89['lastAssignedTo'],'interface':_[_0xede5('0x9')](_0x5cbe89[_0xede5('0xa')])?util['format'](_0xede5('0xb'),_0x5cbe89[_0xede5('0xc')]):_0x5cbe89[_0xede5('0xa')],'type':_0xede5('0xd'),'enterAt':_0x5cbe89['queuecallerleaveAt'],'exitAt':_0x171fd1,'duration':moment(_0x171fd1)[_0xede5('0xe')](_0x5cbe89[_0xede5('0xf')],'seconds'),'data1':_0xede5('0x10'),'data2':_0x5cbe89[_0xede5('0x11')],'data3':_0x5cbe89['exten'],'data4':null,'data5':_0x5cbe89[_0xede5('0x12')],'role':_0xede5('0x13'),'internal':_0x5cbe89[_0xede5('0x14')]?_[_0xede5('0x15')](_0x5cbe89[_0xede5('0x14')]):undefined,'uniqueid':_0x5cbe89[_0xede5('0x16')]},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x50dd89){return client[_0xede5('0x7')](_0xede5('0x8'),{'body':{'channel':_0xede5('0x17'),'membername':_0x50dd89[_0xede5('0x18')],'interface':_0x50dd89['interface'],'type':_0xede5('0xd'),'enterAt':_0x50dd89['starttime'],'exitAt':_0x50dd89[_0xede5('0x19')],'duration':moment(_0x50dd89[_0xede5('0x19')])[_0xede5('0xe')](_0x50dd89['starttime'],_0xede5('0x1a'))>=0x0?moment(_0x50dd89['endtime'])['diff'](_0x50dd89[_0xede5('0x1b')],'seconds'):null,'data1':'outbound','data2':_0x50dd89[_0xede5('0x14')],'data3':_0x50dd89[_0xede5('0x1c')],'data4':_0x50dd89[_0xede5('0x1d')]||null,'role':'agent','internal':_0x50dd89[_0xede5('0x14')]?_[_0xede5('0x15')](_0x50dd89[_0xede5('0x14')]):undefined,'uniqueid':_0x50dd89['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 79d98d7..3b7adfa 100644 --- a/server/services/ami/rpc/template.js +++ b/server/services/ami/rpc/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58a4=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x1bf4c2,_0x4b5e69){var _0x366153=function(_0x514751){while(--_0x514751){_0x1bf4c2['push'](_0x1bf4c2['shift']());}};_0x366153(++_0x4b5e69);}(_0x58a4,0xbf));var _0x458a=function(_0x49ff3f,_0x531e8f){_0x49ff3f=_0x49ff3f-0x0;var _0x4f9703=_0x58a4[_0x49ff3f];return _0x4f9703;};'use strict';var client=require(_0x458a('0x0'));exports[_0x458a('0x1')]=function(_0x4043ce){return function(_0x1e23ea){return client[_0x458a('0x2')](_0x458a('0x3'),{'options':{'raw':!![],'attributes':['id',_0x458a('0x4'),_0x458a('0x5')]},'log':_0x458a('0x3')});};}; \ No newline at end of file +var _0x5423=['getTemplates','Request','name','html','GetTemplate','../client'];(function(_0x4372b6,_0x50ced2){var _0x36de1c=function(_0xf51269){while(--_0xf51269){_0x4372b6['push'](_0x4372b6['shift']());}};_0x36de1c(++_0x50ced2);}(_0x5423,0xe3));var _0x3542=function(_0x174cea,_0xbeef09){_0x174cea=_0x174cea-0x0;var _0x609790=_0x5423[_0x174cea];return _0x609790;};'use strict';var client=require(_0x3542('0x0'));exports[_0x3542('0x1')]=function(_0x511bd3){return function(_0x331a98){return client[_0x3542('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x3542('0x3'),_0x3542('0x4')]},'log':_0x3542('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 3de24ce..4e8113d 100644 --- a/server/services/ami/rpc/trigger.js +++ b/server/services/ami/rpc/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3384=['name','channel','status','Condition','AllConditions','value','field','operator','Action','Actions','action','data2','data3','data4','data5','data7','getTriggers','Request','GetTrigger'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3384,0x1d8));var _0x4338=function(_0x170906,_0x192b7b){_0x170906=_0x170906-0x0;var _0x41eb96=_0x3384[_0x170906];return _0x41eb96;};'use strict';var client=require('../client');exports[_0x4338('0x0')]=function(_0x4f100e){return function(_0x49882b){return client[_0x4338('0x1')](_0x4338('0x2'),{'options':{'raw':![],'attributes':['id',_0x4338('0x3'),_0x4338('0x4'),_0x4338('0x5')],'include':[{'model':_0x4338('0x6'),'as':_0x4338('0x7'),'attributes':['id','field','operator',_0x4338('0x8')]},{'model':_0x4338('0x6'),'as':'AnyConditions','attributes':['id',_0x4338('0x9'),_0x4338('0xa'),_0x4338('0x8')]},{'model':_0x4338('0xb'),'as':_0x4338('0xc'),'attributes':['id',_0x4338('0xd'),'data1',_0x4338('0xe'),_0x4338('0xf'),_0x4338('0x10'),_0x4338('0x11'),'data6',_0x4338('0x12')]}]},'log':_0x4338('0x2')});};}; \ No newline at end of file +var _0x4eee=['status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data4','data5','data7','../client','getTriggers','Request','GetTrigger','channel'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0x4eee,0x11b));var _0xe4ee=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0x4eee[_0x452968];return _0xb6f9ae;};'use strict';var client=require(_0xe4ee('0x0'));exports[_0xe4ee('0x1')]=function(_0x206832){return function(_0x5bbcd0){return client[_0xe4ee('0x2')](_0xe4ee('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xe4ee('0x4'),_0xe4ee('0x5')],'include':[{'model':_0xe4ee('0x6'),'as':_0xe4ee('0x7'),'attributes':['id',_0xe4ee('0x8'),_0xe4ee('0x9'),_0xe4ee('0xa')]},{'model':_0xe4ee('0x6'),'as':_0xe4ee('0xb'),'attributes':['id',_0xe4ee('0x8'),'operator',_0xe4ee('0xa')]},{'model':_0xe4ee('0xc'),'as':_0xe4ee('0xd'),'attributes':['id',_0xe4ee('0xe'),'data1','data2','data3',_0xe4ee('0xf'),_0xe4ee('0x10'),'data6',_0xe4ee('0x11')]}]},'log':_0xe4ee('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index a99d5c1..253a003 100644 --- a/server/services/ami/rpc/trunk.js +++ b/server/services/ami/rpc/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf1b=['name','registry','GetTrunk','../client','getTrunks','Request'];(function(_0x22a018,_0xebac54){var _0x500b84=function(_0x1acfe3){while(--_0x1acfe3){_0x22a018['push'](_0x22a018['shift']());}};_0x500b84(++_0xebac54);}(_0xdf1b,0x129));var _0xbdf1=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0xdf1b[_0x352e09];return _0x1b7094;};'use strict';var client=require(_0xbdf1('0x0'));exports[_0xbdf1('0x1')]=function(_0x1b7913){return function(_0x391b0d){return client[_0xbdf1('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xbdf1('0x3'),_0xbdf1('0x4')]},'log':_0xbdf1('0x5')});};}; \ No newline at end of file +var _0x861e=['getTrunks','Request','name','registry','GetTrunk','../client'];(function(_0x1d0e62,_0x1bd774){var _0x131491=function(_0x2f7e98){while(--_0x2f7e98){_0x1d0e62['push'](_0x1d0e62['shift']());}};_0x131491(++_0x1bd774);}(_0x861e,0xf5));var _0xe861=function(_0xbaa9e3,_0x2e8de6){_0xbaa9e3=_0xbaa9e3-0x0;var _0x420f92=_0x861e[_0xbaa9e3];return _0x420f92;};'use strict';var client=require(_0xe861('0x0'));exports[_0xe861('0x1')]=function(_0x2bf83c){return function(_0x4088b9){return client[_0xe861('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe861('0x3'),_0xe861('0x4')]},'log':_0xe861('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index d61395f..f9b4d59 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b3b=['agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','Request','accountcode','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','../client','getAgents','GetUser'];(function(_0x11a37a,_0x458a44){var _0x2feeb8=function(_0x37e69b){while(--_0x37e69b){_0x11a37a['push'](_0x11a37a['shift']());}};_0x2feeb8(++_0x458a44);}(_0x0b3b,0x11d));var _0xb0b3=function(_0x21b8e0,_0x3a0383){_0x21b8e0=_0x21b8e0-0x0;var _0x2adebf=_0x0b3b[_0x21b8e0];return _0x2adebf;};'use strict';var client=require(_0xb0b3('0x0'));exports[_0xb0b3('0x1')]=function(){return function(){return client['Request'](_0xb0b3('0x2'),{'options':{'raw':![],'where':{'role':_0xb0b3('0x3')},'attributes':['id',_0xb0b3('0x4'),_0xb0b3('0x5'),'accountcode',_0xb0b3('0x6'),_0xb0b3('0x7'),_0xb0b3('0x8'),_0xb0b3('0x9'),_0xb0b3('0xa'),_0xb0b3('0xb'),_0xb0b3('0xc'),_0xb0b3('0xd'),_0xb0b3('0xe')]},'log':_0xb0b3('0x1')});};};exports[_0xb0b3('0xf')]=function(){return function(){return client[_0xb0b3('0x10')](_0xb0b3('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id','name',_0xb0b3('0x11'),'internal']},'log':_0xb0b3('0xf')});};};exports[_0xb0b3('0x12')]=function(_0x48f08d,_0x3d12da,_0xe485eb){return client[_0xb0b3('0x10')](_0xb0b3('0x13'),{'body':{'type':_0x3d12da,'uniqueid':_0xe485eb},'options':{'where':{'id':_0x48f08d['id']}},'log':_0xb0b3('0x12')});};exports[_0xb0b3('0x14')]=function(_0x4e3b78){return client['Request'](_0xb0b3('0x15'),{'body':{},'options':{'where':{'id':_0x4e3b78['id']}},'log':_0xb0b3('0x12')});};exports[_0xb0b3('0x16')]=function(_0x39e13e){return client[_0xb0b3('0x10')](_0xb0b3('0x17'),{'options':{'raw':![],'where':{'role':_0xb0b3('0x3'),'id':_0x39e13e},'attributes':['id',_0xb0b3('0x4'),'email',_0xb0b3('0x11'),_0xb0b3('0x6'),_0xb0b3('0x7'),_0xb0b3('0x8'),_0xb0b3('0x9'),_0xb0b3('0xa'),_0xb0b3('0xb'),'interface']},'log':_0xb0b3('0x16')});}; \ No newline at end of file +var _0xc467=['GetUser','email','accountcode','fullname','online','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','Request','name','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','pauseType','getAgents'];(function(_0x251a3e,_0x2f8527){var _0x1129a7=function(_0x79ecc9){while(--_0x79ecc9){_0x251a3e['push'](_0x251a3e['shift']());}};_0x1129a7(++_0x2f8527);}(_0xc467,0x8f));var _0x7c46=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xc467[_0x377a6e];return _0x37f751;};'use strict';var client=require('../client');exports[_0x7c46('0x0')]=function(){return function(){return client['Request'](_0x7c46('0x1'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id','name',_0x7c46('0x2'),_0x7c46('0x3'),_0x7c46('0x4'),_0x7c46('0x5'),_0x7c46('0x6'),'pauseType',_0x7c46('0x7'),_0x7c46('0x8'),_0x7c46('0x9'),_0x7c46('0xa'),_0x7c46('0xb')]},'log':_0x7c46('0x0')});};};exports[_0x7c46('0xc')]=function(){return function(){return client[_0x7c46('0xd')](_0x7c46('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x7c46('0xe'),_0x7c46('0x3'),_0x7c46('0xf')]},'log':_0x7c46('0xc')});};};exports[_0x7c46('0x10')]=function(_0x1d2efa,_0xed02fa,_0x5b6a83){return client[_0x7c46('0xd')](_0x7c46('0x11'),{'body':{'type':_0xed02fa,'uniqueid':_0x5b6a83},'options':{'where':{'id':_0x1d2efa['id']}},'log':_0x7c46('0x10')});};exports[_0x7c46('0x12')]=function(_0x2f1779){return client['Request'](_0x7c46('0x13'),{'body':{},'options':{'where':{'id':_0x2f1779['id']}},'log':_0x7c46('0x10')});};exports[_0x7c46('0x14')]=function(_0x6a417e){return client[_0x7c46('0xd')](_0x7c46('0x15'),{'options':{'raw':![],'where':{'role':_0x7c46('0x16'),'id':_0x6a417e},'attributes':['id',_0x7c46('0xe'),_0x7c46('0x2'),_0x7c46('0x3'),_0x7c46('0x4'),_0x7c46('0x5'),_0x7c46('0x6'),_0x7c46('0x17'),_0x7c46('0x7'),_0x7c46('0x8'),_0x7c46('0xb')]},'log':_0x7c46('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index f29d925..6cb557f 100644 --- a/server/services/ami/rpc/voiceAgentReport.js +++ b/server/services/ami/rpc/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e9d=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport','update'];(function(_0x568060,_0x5b2244){var _0x42957a=function(_0x471ba5){while(--_0x471ba5){_0x568060['push'](_0x568060['shift']());}};_0x42957a(++_0x5b2244);}(_0x2e9d,0xab));var _0xd2e9=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x2e9d[_0x1ebce2];return _0x4a330c;};'use strict';var client=require(_0xd2e9('0x0'));exports['create']=function(_0xe6c0b6){return client[_0xd2e9('0x1')](_0xd2e9('0x2'),{'body':_0xe6c0b6,'log':_0xd2e9('0x2')});};exports[_0xd2e9('0x3')]=function(_0x38c792,_0x4e42cf,_0x373e3c){return client[_0xd2e9('0x1')](_0xd2e9('0x4'),{'body':_0x38c792,'options':{'where':{'uniqueid':_0x4e42cf,'interface':_0x373e3c}},'log':_0xd2e9('0x4')});}; \ No newline at end of file +var _0xf4cd=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x293115,_0x475d69){var _0x21208a=function(_0x96ffac){while(--_0x96ffac){_0x293115['push'](_0x293115['shift']());}};_0x21208a(++_0x475d69);}(_0xf4cd,0x167));var _0xdf4c=function(_0x66bfc2,_0x3ea6df){_0x66bfc2=_0x66bfc2-0x0;var _0x2e2094=_0xf4cd[_0x66bfc2];return _0x2e2094;};'use strict';var client=require(_0xdf4c('0x0'));exports['create']=function(_0x4dc595){return client[_0xdf4c('0x1')](_0xdf4c('0x2'),{'body':_0x4dc595,'log':_0xdf4c('0x2')});};exports[_0xdf4c('0x3')]=function(_0xa45fc8,_0x10bc4f,_0x2f16af){return client['Request'](_0xdf4c('0x4'),{'body':_0xa45fc8,'options':{'where':{'uniqueid':_0x10bc4f,'interface':_0x2f16af}},'log':_0xdf4c('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 751a3dc..bb6b492 100644 --- a/server/services/ami/rpc/voiceCallReport.js +++ b/server/services/ami/rpc/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1634=['GetVoiceCallReports','moment','util','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition'];(function(_0xc82d1a,_0x145c50){var _0x32fad2=function(_0x232731){while(--_0x232731){_0xc82d1a['push'](_0xc82d1a['shift']());}};_0x32fad2(++_0x145c50);}(_0x1634,0x133));var _0x4163=function(_0x6bdf90,_0x36ab9a){_0x6bdf90=_0x6bdf90-0x0;var _0x53d2cc=_0x1634[_0x6bdf90];return _0x53d2cc;};'use strict';var moment=require(_0x4163('0x0'));var util=require(_0x4163('0x1'));var _=require('lodash');var client=require('../client');exports['create']=function(_0x26ca43){return client[_0x4163('0x2')](_0x4163('0x3'),{'body':_[_0x4163('0x4')](_0x26ca43,{'source':_0x26ca43[_0x4163('0x5')],'destinationcontext':_0x26ca43[_0x4163('0x6')],'callerid':_0x26ca43[_0x4163('0x7')],'amaflags':_0x4163('0x8')}),'log':_0x4163('0x3')});};exports[_0x4163('0x9')]=function(){return function(){return client['Request'](_0x4163('0xa'),{'options':{'where':{'type':[_0x4163('0xb')],'createdAt':{'$between':[moment()['startOf']('day')[_0x4163('0xc')](_0x4163('0xd')),moment()[_0x4163('0xe')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x4163('0xf'),_0x4163('0x10'),'duration','billableseconds']},'log':_0x4163('0x11')});};}; \ No newline at end of file +var _0xaa85=['merge','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','day','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','billableseconds','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0xaa85,0x162));var _0x5aa8=function(_0x173c8c,_0x7c94bf){_0x173c8c=_0x173c8c-0x0;var _0x39e3d6=_0xaa85[_0x173c8c];return _0x39e3d6;};'use strict';var moment=require(_0x5aa8('0x0'));var util=require(_0x5aa8('0x1'));var _=require(_0x5aa8('0x2'));var client=require('../client');exports[_0x5aa8('0x3')]=function(_0x1150df){return client[_0x5aa8('0x4')](_0x5aa8('0x5'),{'body':_[_0x5aa8('0x6')](_0x1150df,{'source':_0x1150df[_0x5aa8('0x7')],'destinationcontext':_0x1150df[_0x5aa8('0x8')],'callerid':_0x1150df[_0x5aa8('0x9')],'amaflags':'DOCUMENTATION'}),'log':_0x5aa8('0x5')});};exports[_0x5aa8('0xa')]=function(){return function(){return client[_0x5aa8('0x4')](_0x5aa8('0xb'),{'options':{'where':{'type':[_0x5aa8('0xc')],'createdAt':{'$between':[moment()['startOf'](_0x5aa8('0xd'))['format'](_0x5aa8('0xe')),moment()[_0x5aa8('0xf')](_0x5aa8('0xd'))['format'](_0x5aa8('0xe'))]}},'attributes':[_0x5aa8('0x10'),_0x5aa8('0x11'),'duration',_0x5aa8('0x12')]},'log':_0x5aa8('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index d2f9ba2..1e43bdf 100644 --- a/server/services/ami/rpc/voiceDialReport.js +++ b/server/services/ami/rpc/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19f0=['CreateVoiceDialReport','../client'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x19f0,0x13d));var _0x019f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x19f0[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x019f('0x0'));exports['create']=function(_0x53ba5b){return client['Request']('CreateVoiceDialReport',{'body':_0x53ba5b,'log':_0x019f('0x1')});}; \ No newline at end of file +var _0x7848=['create','Request','CreateVoiceDialReport','../client'];(function(_0x475664,_0x2b592c){var _0x1007ac=function(_0x5d9fe1){while(--_0x5d9fe1){_0x475664['push'](_0x475664['shift']());}};_0x1007ac(++_0x2b592c);}(_0x7848,0x7f));var _0x8784=function(_0x4e7551,_0x398ee5){_0x4e7551=_0x4e7551-0x0;var _0x2c2ae8=_0x7848[_0x4e7551];return _0x2c2ae8;};'use strict';var client=require(_0x8784('0x0'));exports[_0x8784('0x1')]=function(_0x1efb8d){return client[_0x8784('0x2')](_0x8784('0x3'),{'body':_0x1efb8d,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 9801e24..d3ef719 100644 --- a/server/services/ami/rpc/voiceExtension.js +++ b/server/services/ami/rpc/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc719=['exten','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x27b495,_0x4d0c2c){var _0x36f287=function(_0x1c4bbb){while(--_0x1c4bbb){_0x27b495['push'](_0x27b495['shift']());}};_0x36f287(++_0x4d0c2c);}(_0xc719,0x1d2));var _0x9c71=function(_0x5ecff9,_0x473070){_0x5ecff9=_0x5ecff9-0x0;var _0x5e1415=_0xc719[_0x5ecff9];return _0x5e1415;};'use strict';var client=require(_0x9c71('0x0'));exports[_0x9c71('0x1')]=function(){return function(){return client[_0x9c71('0x2')](_0x9c71('0x3'),{'options':{'raw':!![],'attributes':['id',_0x9c71('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x9c71('0x1')});};}; \ No newline at end of file +var _0x349e=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x543c51,_0xff0084){var _0x360555=function(_0x2a0801){while(--_0x2a0801){_0x543c51['push'](_0x543c51['shift']());}};_0x360555(++_0xff0084);}(_0x349e,0xcb));var _0xe349=function(_0x45a952,_0x180813){_0x45a952=_0x45a952-0x0;var _0x181dc2=_0x349e[_0x45a952];return _0x181dc2;};'use strict';var client=require(_0xe349('0x0'));exports[_0xe349('0x1')]=function(){return function(){return client[_0xe349('0x2')](_0xe349('0x3'),{'options':{'raw':!![],'attributes':['id',_0xe349('0x4'),_0xe349('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xe349('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 53a1151..d742d02 100644 --- a/server/services/ami/rpc/voiceQueue.js +++ b/server/services/ami/rpc/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1760=['dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialLimitChannel','dialLimitQueue','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','mandatoryDisposition'];(function(_0x349883,_0x53efaa){var _0x47871e=function(_0x6375a3){while(--_0x6375a3){_0x349883['push'](_0x349883['shift']());}};_0x47871e(++_0x53efaa);}(_0x1760,0x155));var _0x0176=function(_0xecbdaa,_0x18f61f){_0xecbdaa=_0xecbdaa-0x0;var _0x3139ec=_0x1760[_0xecbdaa];return _0x3139ec;};'use strict';var client=require(_0x0176('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x0176('0x1')](_0x0176('0x2'),{'options':{'raw':![],'attributes':['id',_0x0176('0x3'),_0x0176('0x4'),_0x0176('0x5'),_0x0176('0x6'),_0x0176('0x7'),_0x0176('0x8'),'dialActive','dialMethod',_0x0176('0x9'),_0x0176('0xa'),'dialPowerLevel','dialPredictiveOptimization',_0x0176('0xb'),_0x0176('0xc'),_0x0176('0xd'),_0x0176('0xe'),_0x0176('0xf'),'dialQueueOptions',_0x0176('0x10'),_0x0176('0x11'),_0x0176('0x12'),_0x0176('0x13'),_0x0176('0x14'),_0x0176('0x15'),_0x0176('0x16'),'dialNoAnswerRetryFrequency',_0x0176('0x17'),_0x0176('0x18'),'dialGlobalInterval',_0x0176('0x19'),_0x0176('0x1a'),_0x0176('0x1b'),'dialAMDInitialSilence',_0x0176('0x1c'),_0x0176('0x1d'),_0x0176('0x1e'),_0x0176('0x1f'),_0x0176('0x20'),'dialAMDMaximumNumberOfWords',_0x0176('0x21'),_0x0176('0x22'),_0x0176('0x23'),_0x0176('0x24'),_0x0176('0x25'),_0x0176('0x26'),_0x0176('0x27'),_0x0176('0x28'),'dialQueueProject2',_0x0176('0x7'),_0x0176('0x29'),_0x0176('0x2a'),'dialCutDigit',_0x0176('0x2b'),_0x0176('0x2c'),_0x0176('0x2d')],'include':[{'model':_0x0176('0x2e'),'as':'Trunk','attributes':['id',_0x0176('0x3'),'callerid',_0x0176('0x2f')]},{'model':_0x0176('0x30'),'as':_0x0176('0x31'),'attributes':['id',_0x0176('0x3')]},{'model':_0x0176('0x2e'),'as':_0x0176('0x32'),'attributes':['id',_0x0176('0x3'),'callerid',_0x0176('0x2f')]},{'model':_0x0176('0x33'),'as':_0x0176('0x33'),'attributes':['id',_0x0176('0x3')],'include':[{'model':_0x0176('0x33'),'as':_0x0176('0x34'),'attributes':['id',_0x0176('0x3'),_0x0176('0x35')]}]}]},'log':_0x0176('0x36')});};}; \ No newline at end of file +var _0x56ba=['dialQueueTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueOptions'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x56ba,0x86));var _0xa56b=function(_0x484ad8,_0x3aa3b5){_0x484ad8=_0x484ad8-0x0;var _0xe975b0=_0x56ba[_0x484ad8];return _0xe975b0;};'use strict';var client=require(_0xa56b('0x0'));exports[_0xa56b('0x1')]=function(){return function(){return client['Request'](_0xa56b('0x2'),{'options':{'raw':![],'attributes':['id',_0xa56b('0x3'),_0xa56b('0x4'),_0xa56b('0x5'),_0xa56b('0x6'),'monitor_format','type','dialActive',_0xa56b('0x7'),'dialLimitChannel',_0xa56b('0x8'),'dialPowerLevel',_0xa56b('0x9'),'dialPredictiveOptimizationPercentage',_0xa56b('0xa'),'dialOriginateCallerIdName',_0xa56b('0xb'),'dialOriginateTimeout',_0xa56b('0xc'),_0xa56b('0xd'),'dialQueueProject','dialCongestionMaxRetry',_0xa56b('0xe'),_0xa56b('0xf'),_0xa56b('0x10'),_0xa56b('0x11'),_0xa56b('0x12'),_0xa56b('0x13'),_0xa56b('0x14'),_0xa56b('0x15'),_0xa56b('0x16'),'dialCheckDuplicateType',_0xa56b('0x17'),'dialAMDInitialSilence','dialAMDGreeting',_0xa56b('0x18'),'dialAMDTotalAnalysisTime',_0xa56b('0x19'),_0xa56b('0x1a'),_0xa56b('0x1b'),_0xa56b('0x1c'),'dialAMDMaximumWordLength',_0xa56b('0x1d'),'dialRecallMeTimeout',_0xa56b('0x1e'),_0xa56b('0x1f'),_0xa56b('0x20'),'dialAgiAfterHangupClient',_0xa56b('0x21'),_0xa56b('0x22'),_0xa56b('0x23'),_0xa56b('0x24'),_0xa56b('0x25'),_0xa56b('0x26'),_0xa56b('0x27'),_0xa56b('0x28')],'include':[{'model':_0xa56b('0x29'),'as':'Trunk','attributes':['id','name',_0xa56b('0x2a'),_0xa56b('0x2b')]},{'model':_0xa56b('0x2c'),'as':_0xa56b('0x2d'),'attributes':['id',_0xa56b('0x3')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0xa56b('0x3'),'callerid',_0xa56b('0x2b')]},{'model':_0xa56b('0x2e'),'as':'Interval','attributes':['id',_0xa56b('0x3')],'include':[{'model':'Interval','as':_0xa56b('0x2f'),'attributes':['id',_0xa56b('0x3'),_0xa56b('0x30')]}]}]},'log':_0xa56b('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 2c58b8f..b65776d 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf611=['getVoiceQueueReports','Request','GetVoiceQueueReport','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queuecallerjoinAt','queuecallerleaveAt','queuecallerexit','queuecallerexitAt','queuecallerabandonAt','moment','lodash','../client','create','CreateVoiceQueueReport'];(function(_0x2577f7,_0x4e4781){var _0x55d372=function(_0x59b397){while(--_0x59b397){_0x2577f7['push'](_0x2577f7['shift']());}};_0x55d372(++_0x4e4781);}(_0xf611,0x199));var _0x1f61=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0xf611[_0x31a37b];return _0x49ae16;};'use strict';var moment=require(_0x1f61('0x0'));var _=require(_0x1f61('0x1'));var client=require(_0x1f61('0x2'));exports[_0x1f61('0x3')]=function(_0x3ad602){return client['Request'](_0x1f61('0x4'),{'body':_0x3ad602,'log':'CreateVoiceQueueReport'});};exports[_0x1f61('0x5')]=function(){return function(){return client[_0x1f61('0x6')](_0x1f61('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x1f61('0x8')](_0x1f61('0x9'))['format'](_0x1f61('0xa')),moment()[_0x1f61('0xb')](_0x1f61('0x9'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x1f61('0xc'),'queue',_0x1f61('0xd'),_0x1f61('0xe'),'queuecallercomplete','queuecallercompleteAt',_0x1f61('0xf'),_0x1f61('0x10'),'queuecallerabandon',_0x1f61('0x11')]},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0x0272=['queue','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','lodash','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid'];(function(_0xacf8c,_0x1d484b){var _0x21fd7b=function(_0x10b1bf){while(--_0x10b1bf){_0xacf8c['push'](_0xacf8c['shift']());}};_0x21fd7b(++_0x1d484b);}(_0x0272,0xa0));var _0x2027=function(_0x16aaad,_0x852996){_0x16aaad=_0x16aaad-0x0;var _0x5891fe=_0x0272[_0x16aaad];return _0x5891fe;};'use strict';var moment=require('moment');var _=require(_0x2027('0x0'));var client=require('../client');exports['create']=function(_0x31227b){return client[_0x2027('0x1')](_0x2027('0x2'),{'body':_0x31227b,'log':_0x2027('0x2')});};exports[_0x2027('0x3')]=function(){return function(){return client[_0x2027('0x1')](_0x2027('0x4'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x2027('0x5'))[_0x2027('0x6')](_0x2027('0x7')),moment()[_0x2027('0x8')](_0x2027('0x5'))[_0x2027('0x6')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x2027('0x9'),_0x2027('0xa'),'queuecallerjoinAt','queuecallerleaveAt',_0x2027('0xb'),_0x2027('0xc'),_0x2027('0xd'),'queuecallerexitAt',_0x2027('0xe'),_0x2027('0xf')]},'log':_0x2027('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index d3e97e9..45583cd 100644 --- a/server/services/ami/rpc/voiceQueueRt.js +++ b/server/services/ami/rpc/voiceQueueRt.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd3c=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xfd3c,0x97));var _0xcfd3=function(_0x1bcbbd,_0x401492){_0x1bcbbd=_0x1bcbbd-0x0;var _0x164947=_0xfd3c[_0x1bcbbd];return _0x164947;};'use strict';var client=require(_0xcfd3('0x0'));exports[_0xcfd3('0x1')]=function(_0x4cebe8){return function(){return client[_0xcfd3('0x2')](_0xcfd3('0x3'),{'options':{'where':{'VoiceQueueId':_0x4cebe8,'paused':!![]},'raw':!![]},'log':_0xcfd3('0x1')});};}; \ No newline at end of file +var _0x25a8=['Request','GetVoiceQueueRtPauses','../client'];(function(_0xd5160a,_0x572c4b){var _0x576cf9=function(_0xa95da6){while(--_0xa95da6){_0xd5160a['push'](_0xd5160a['shift']());}};_0x576cf9(++_0x572c4b);}(_0x25a8,0x18b));var _0x825a=function(_0x2db5cf,_0x330d5c){_0x2db5cf=_0x2db5cf-0x0;var _0x45b1b=_0x25a8[_0x2db5cf];return _0x45b1b;};'use strict';var client=require(_0x825a('0x0'));exports['getVoiceQueueRtPauses']=function(_0x26fe41){return function(){return client[_0x825a('0x1')](_0x825a('0x2'),{'options':{'where':{'VoiceQueueId':_0x26fe41,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index ba8580a..f04e8ff 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24c9=['merge','monitorFilename','lodash','CreateVoiceRecording'];(function(_0x5cd678,_0x59cd4e){var _0x14a0de=function(_0xd8b140){while(--_0xd8b140){_0x5cd678['push'](_0x5cd678['shift']());}};_0x14a0de(++_0x59cd4e);}(_0x24c9,0xd6));var _0x924c=function(_0x56b611,_0xf3c86e){_0x56b611=_0x56b611-0x0;var _0x124bb8=_0x24c9[_0x56b611];return _0x124bb8;};'use strict';var _=require(_0x924c('0x0'));var client=require('../client');exports['create']=function(_0x237871){return client['Request'](_0x924c('0x1'),{'body':_[_0x924c('0x2')](_0x237871,{'value':_0x237871[_0x924c('0x3')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file +var _0x4032=['create','CreateVoiceRecording','merge','monitorFilename','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4032,0x171));var _0x2403=function(_0x324ba1,_0x181e65){_0x324ba1=_0x324ba1-0x0;var _0x4d180b=_0x4032[_0x324ba1];return _0x4d180b;};'use strict';var _=require(_0x2403('0x0'));var client=require('../client');exports[_0x2403('0x1')]=function(_0x4c0c8f){return client['Request'](_0x2403('0x2'),{'body':_[_0x2403('0x3')](_0x4c0c8f,{'value':_0x4c0c8f[_0x2403('0x4')]}),'log':_0x2403('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index fcae178..4d9cba6 100644 --- a/server/services/ami/rpc/voiceTransferReport.js +++ b/server/services/ami/rpc/voiceTransferReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc25d=['transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','attended','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum'];(function(_0x216ea5,_0x65ebf7){var _0x9adc12=function(_0x20ea8e){while(--_0x20ea8e){_0x216ea5['push'](_0x216ea5['shift']());}};_0x9adc12(++_0x65ebf7);}(_0xc25d,0x147));var _0xdc25=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xc25d[_0x2a6809];return _0x11c371;};'use strict';var client=require('../client');exports[_0xdc25('0x0')]=function(_0x4a1140){return client[_0xdc25('0x1')](_0xdc25('0x2'),{'body':{'result':_0x4a1140[_0xdc25('0x3')],'transfererchannel':_0x4a1140[_0xdc25('0x4')],'transferercalleridnum':_0x4a1140[_0xdc25('0x5')],'transferercalleridname':_0x4a1140[_0xdc25('0x6')],'transfererconnectedlinenum':_0x4a1140[_0xdc25('0x7')],'transfererconnectedlinename':_0x4a1140[_0xdc25('0x8')],'transfereraccountcode':_0x4a1140[_0xdc25('0x9')],'transferercontext':_0x4a1140['transferercontext'],'transfererexten':_0x4a1140[_0xdc25('0xa')],'transfererlinkedid':_0x4a1140[_0xdc25('0xb')],'transfereechannel':_0x4a1140[_0xdc25('0xc')],'transfereecalleridnum':_0x4a1140[_0xdc25('0xd')],'transfereecalleridname':_0x4a1140['transfereecalleridname'],'transfereeconnectedlinenum':_0x4a1140[_0xdc25('0xe')],'transfereeconnectedlinename':_0x4a1140[_0xdc25('0xf')],'transfereeaccountcode':_0x4a1140['transfereeaccountcode'],'transfereecontext':_0x4a1140['transfereecontext'],'transfereeexten':_0x4a1140['transfereeexten'],'transfereelinkedid':_0x4a1140[_0xdc25('0x10')],'isexternal':_0x4a1140[_0xdc25('0x11')],'context':_0x4a1140[_0xdc25('0x12')],'extension':_0x4a1140[_0xdc25('0x13')],'type':_0xdc25('0x14')},'log':'CreateVoiceTransferReport'});};exports[_0xdc25('0x15')]=function(_0xbf4ede){return client[_0xdc25('0x1')](_0xdc25('0x2'),{'body':{'result':_0xbf4ede[_0xdc25('0x3')],'transfererchannel':_0xbf4ede[_0xdc25('0x16')],'transferercalleridnum':_0xbf4ede[_0xdc25('0x17')],'transferercalleridname':_0xbf4ede[_0xdc25('0x18')],'transfererconnectedlinenum':_0xbf4ede[_0xdc25('0x19')],'transfererconnectedlinename':_0xbf4ede['secondtransfererconnectedlinename'],'transfereraccountcode':_0xbf4ede[_0xdc25('0x1a')],'transferercontext':_0xbf4ede[_0xdc25('0x1b')],'transfererexten':_0xbf4ede['secondtransfererexten'],'transfererlinkedid':_0xbf4ede[_0xdc25('0x1c')],'transfereechannel':_0xbf4ede[_0xdc25('0x1d')],'transfereecalleridnum':_0xbf4ede['transfertargetcalleridnum'],'transfereecalleridname':_0xbf4ede[_0xdc25('0x1e')],'transfereeconnectedlinenum':_0xbf4ede[_0xdc25('0x1f')],'transfereeconnectedlinename':_0xbf4ede[_0xdc25('0x20')],'transfereeaccountcode':_0xbf4ede['transfertargetaccountcode'],'transfereecontext':_0xbf4ede[_0xdc25('0x21')],'transfereeexten':_0xbf4ede[_0xdc25('0x22')],'transfereelinkedid':_0xbf4ede[_0xdc25('0x23')],'isexternal':_0xbf4ede[_0xdc25('0x11')],'context':_0xbf4ede['origtransferercontext'],'extension':_0xbf4ede['origtransfererexten'],'type':_0xdc25('0x24')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xfde9=['transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','CreateVoiceTransferReport','Request','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','extension','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x251451,_0x198017){var _0x30e64b=function(_0x26628e){while(--_0x26628e){_0x251451['push'](_0x251451['shift']());}};_0x30e64b(++_0x198017);}(_0xfde9,0x136));var _0x9fde=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0xfde9[_0x50bf5a];return _0x4ddc1d;};'use strict';var client=require('../client');exports['blindTransfer']=function(_0x55b1bd){return client[_0x9fde('0x0')]('CreateVoiceTransferReport',{'body':{'result':_0x55b1bd['result'],'transfererchannel':_0x55b1bd[_0x9fde('0x1')],'transferercalleridnum':_0x55b1bd[_0x9fde('0x2')],'transferercalleridname':_0x55b1bd[_0x9fde('0x3')],'transfererconnectedlinenum':_0x55b1bd[_0x9fde('0x4')],'transfererconnectedlinename':_0x55b1bd[_0x9fde('0x5')],'transfereraccountcode':_0x55b1bd[_0x9fde('0x6')],'transferercontext':_0x55b1bd['transferercontext'],'transfererexten':_0x55b1bd[_0x9fde('0x7')],'transfererlinkedid':_0x55b1bd[_0x9fde('0x8')],'transfereechannel':_0x55b1bd[_0x9fde('0x9')],'transfereecalleridnum':_0x55b1bd[_0x9fde('0xa')],'transfereecalleridname':_0x55b1bd[_0x9fde('0xb')],'transfereeconnectedlinenum':_0x55b1bd[_0x9fde('0xc')],'transfereeconnectedlinename':_0x55b1bd[_0x9fde('0xd')],'transfereeaccountcode':_0x55b1bd[_0x9fde('0xe')],'transfereecontext':_0x55b1bd[_0x9fde('0xf')],'transfereeexten':_0x55b1bd[_0x9fde('0x10')],'transfereelinkedid':_0x55b1bd['transfereelinkedid'],'isexternal':_0x55b1bd[_0x9fde('0x11')],'context':_0x55b1bd['context'],'extension':_0x55b1bd[_0x9fde('0x12')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0x9fde('0x13')]=function(_0x581dbe){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x581dbe[_0x9fde('0x14')],'transfererchannel':_0x581dbe[_0x9fde('0x15')],'transferercalleridnum':_0x581dbe[_0x9fde('0x16')],'transferercalleridname':_0x581dbe[_0x9fde('0x17')],'transfererconnectedlinenum':_0x581dbe['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x581dbe[_0x9fde('0x18')],'transfereraccountcode':_0x581dbe[_0x9fde('0x19')],'transferercontext':_0x581dbe['secondtransferercontext'],'transfererexten':_0x581dbe['secondtransfererexten'],'transfererlinkedid':_0x581dbe[_0x9fde('0x1a')],'transfereechannel':_0x581dbe[_0x9fde('0x1b')],'transfereecalleridnum':_0x581dbe[_0x9fde('0x1c')],'transfereecalleridname':_0x581dbe['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x581dbe[_0x9fde('0x1d')],'transfereeconnectedlinename':_0x581dbe[_0x9fde('0x1e')],'transfereeaccountcode':_0x581dbe[_0x9fde('0x1f')],'transfereecontext':_0x581dbe['transfertargetcontext'],'transfereeexten':_0x581dbe[_0x9fde('0x20')],'transfereelinkedid':_0x581dbe[_0x9fde('0x21')],'isexternal':_0x581dbe[_0x9fde('0x11')],'context':_0x581dbe[_0x9fde('0x22')],'extension':_0x581dbe[_0x9fde('0x23')],'type':_0x9fde('0x24')},'log':_0x9fde('0x25')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index fb59f23..92d18af 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde63=['push','channels','length','map','uniqueid','channel','format','%s.%s','MixMonitor','find','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','StopMixMonitor','destinationchannel','stop','wav','StopMixMonitor\x20Success','values','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','outbound','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../ami','listen','%s/%s','name','timers','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','pick','keys','action','Reload','Action','then','message','catch','isConnected','command','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','sumBillable','sumHoldTime','talking','abandoned','waiting','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde63,0x1be));var _0x3de6=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0xde63[_0x18a436];return _0x5c2cf8;};'use strict';var _=require(_0x3de6('0x0'));var util=require(_0x3de6('0x1'));var jayson=require(_0x3de6('0x2'));var schema=require(_0x3de6('0x3'));var BPromise=require('bluebird');var moment=require(_0x3de6('0x4'));var config=require(_0x3de6('0x5'));var properties=require('../properties');var ami=require(_0x3de6('0x6'));exports[_0x3de6('0x7')]=function(_0x5e817a,_0x93923,_0x25945f){return new BPromise(function(_0x2e8ca4,_0x4a6dee){var _0xefa7cf={'QueuePause':function(_0x306dbd){return new Promise(function(_0x3c0995,_0x2add08){var _0xddd8f9=util['format'](_0x3de6('0x8'),'SIP',_0x306dbd[_0x3de6('0x9')]);if(_0x5e817a[_0x3de6('0xa')]&&_0x5e817a[_0x3de6('0xa')][_0xddd8f9]&&_0x5e817a['timers'][_0xddd8f9]['timer']){_0x5e817a[_0x3de6('0xa')][_0xddd8f9]['updateAcw']();}if(_0x5e817a[_0x3de6('0xb')][_0xddd8f9]){_0x5e817a[_0x3de6('0xb')][_0xddd8f9][_0x3de6('0xc')]({'statePause':_0x306dbd[_0x3de6('0xd')]?!![]:![]});}_0x3c0995({'code':0xc8,'message':_0x3de6('0xe')});});},'Reload':function(_0x39dda7){var _0x3f1a58=this;return new Promise(function(_0x38a5c7,_0x37ad45){if(ami['isConnected']()==![]){return _0x37ad45(_0x3f1a58[_0x3de6('0xf')](0x1f4,[config[_0x3de6('0x10')]['ip'],config[_0x3de6('0x10')][_0x3de6('0x11')],_0x3de6('0x12')][_0x3de6('0x13')]('\x20')));}_0x39dda7=_[_0x3de6('0x14')](_0x39dda7,_[_0x3de6('0x15')](properties['module']));_0x39dda7[_0x3de6('0x16')]=_0x3de6('0x17');return ami[_0x3de6('0x18')](_0x39dda7)[_0x3de6('0x19')](function(_0x3a3884){_0x38a5c7({'code':0xc8,'message':_0x3a3884[_0x3de6('0x1a')]});})[_0x3de6('0x1b')](function(_0x38d366){_0x37ad45(_0x3f1a58[_0x3de6('0xf')](0x1f5,_0x38d366[_0x3de6('0x1a')]));});});},'Command':function(_0x56c6bc){var _0x65ea08=this;return new Promise(function(_0x468ab9,_0x3bc3fd){if(ami[_0x3de6('0x1c')]()==![]){return _0x3bc3fd(_0x65ea08[_0x3de6('0xf')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x3de6('0x11')],_0x3de6('0x12')][_0x3de6('0x13')]('\x20')));}_0x56c6bc=_[_0x3de6('0x14')](_0x56c6bc,_0x3de6('0x1d'));_0x56c6bc[_0x3de6('0x16')]='Command';return ami['Action'](_0x56c6bc)[_0x3de6('0x19')](function(_0x5605c6){_0x468ab9({'code':0xc8,'message':_0x5605c6['content']});})[_0x3de6('0x1b')](function(_0x50c97b){_0x3bc3fd(_0x65ea08[_0x3de6('0xf')](0x1f5,_0x50c97b['message']));});});},'VoiceQueues':function(_0x20664c){return new Promise(function(_0x50118c,_0x63e5e6){var _0x2675d4=[];for(var _0x7b1a69 in _0x5e817a['voiceQueues']){if(_0x5e817a[_0x3de6('0x1e')][_0x3de6('0x1f')](_0x7b1a69)){var _0x42ebf1=_0x5e817a[_0x3de6('0x1e')][_0x7b1a69];var _0x3d3ef9={'id':_0x42ebf1['id'],'name':_0x42ebf1[_0x3de6('0x9')],'strategy':_0x42ebf1[_0x3de6('0x20')],'answered':_0x42ebf1[_0x3de6('0x21')],'available':_0x42ebf1['available'],'loggedIn':_0x42ebf1[_0x3de6('0x22')],'pTalking':_0x42ebf1['pTalking'],'sumBillable':_0x42ebf1[_0x3de6('0x23')],'sumDuration':_0x42ebf1['sumDuration'],'sumHoldTime':_0x42ebf1[_0x3de6('0x24')]||0x0,'talking':_0x42ebf1[_0x3de6('0x25')],'total':_0x42ebf1['total'],'type':_0x42ebf1['type'],'unmanaged':_0x42ebf1['unmanaged'],'abandoned':_0x42ebf1[_0x3de6('0x26')],'waiting':_0x42ebf1[_0x3de6('0x27')],'loggedInDb':_0x42ebf1['loggedInDb']};if(_0x42ebf1[_0x3de6('0x28')]==='outbound'){_0x3d3ef9[_0x3de6('0x29')]=_0x42ebf1[_0x3de6('0x29')];_0x3d3ef9[_0x3de6('0x2a')]=_0x42ebf1[_0x3de6('0x2a')];_0x3d3ef9[_0x3de6('0x2b')]=_0x42ebf1['dialOriginateCallerIdName'];_0x3d3ef9[_0x3de6('0x2c')]=_0x42ebf1[_0x3de6('0x2c')];_0x3d3ef9[_0x3de6('0x2d')]=_0x42ebf1['dialOriginateTimeout'];_0x3d3ef9['dialPrefix']=_0x42ebf1[_0x3de6('0x2e')];_0x3d3ef9[_0x3de6('0x2f')]=_0x42ebf1[_0x3de6('0x2f')];_0x3d3ef9[_0x3de6('0x30')]=_0x42ebf1[_0x3de6('0x30')];_0x3d3ef9['outboundBlacklistCallsDay']=_0x42ebf1[_0x3de6('0x31')];_0x3d3ef9[_0x3de6('0x32')]=_0x42ebf1['outboundBusyCallsDay'];_0x3d3ef9[_0x3de6('0x33')]=_0x42ebf1[_0x3de6('0x33')];_0x3d3ef9[_0x3de6('0x34')]=_0x42ebf1[_0x3de6('0x34')];_0x3d3ef9[_0x3de6('0x35')]=_0x42ebf1['outboundDropCallsDayCallersExit'];_0x3d3ef9[_0x3de6('0x36')]=_0x42ebf1['outboundDropCallsDayTimeout'];_0x3d3ef9['outboundNoAnswerCallsDay']=_0x42ebf1[_0x3de6('0x37')];_0x3d3ef9[_0x3de6('0x38')]=_0x42ebf1[_0x3de6('0x38')];_0x3d3ef9[_0x3de6('0x39')]=_0x42ebf1[_0x3de6('0x39')];_0x3d3ef9[_0x3de6('0x3a')]=_0x42ebf1[_0x3de6('0x3a')];_0x3d3ef9['outboundRejectCallsDay']=_0x42ebf1[_0x3de6('0x3b')];_0x3d3ef9[_0x3de6('0x3c')]=_0x42ebf1['outboundUnknownCallsDay'];_0x3d3ef9[_0x3de6('0x3d')]=_0x42ebf1['predictiveIntervalAnsweredCalls'];_0x3d3ef9[_0x3de6('0x3e')]=_0x42ebf1[_0x3de6('0x3e')];_0x3d3ef9[_0x3de6('0x3f')]=_0x42ebf1['predictiveIntervalAvgTalktime'];_0x3d3ef9[_0x3de6('0x40')]=_0x42ebf1[_0x3de6('0x40')];_0x3d3ef9['predictiveIntervalDroppedCallsTimeout']=_0x42ebf1[_0x3de6('0x41')];_0x3d3ef9['predictiveIntervalErlangCalls']=_0x42ebf1[_0x3de6('0x42')];_0x3d3ef9[_0x3de6('0x43')]=_0x42ebf1[_0x3de6('0x43')];_0x3d3ef9[_0x3de6('0x44')]=_0x42ebf1[_0x3de6('0x44')];_0x3d3ef9[_0x3de6('0x45')]=_0x42ebf1[_0x3de6('0x45')];_0x3d3ef9['predictiveIntervalPauses']=_0x42ebf1['predictiveIntervalPauses'];_0x3d3ef9[_0x3de6('0x46')]=_0x42ebf1[_0x3de6('0x46')];_0x3d3ef9[_0x3de6('0x47')]=_0x42ebf1[_0x3de6('0x47')];_0x3d3ef9['message']=_0x42ebf1['message'];_0x3d3ef9['originated']=_0x42ebf1[_0x3de6('0x48')];_0x3d3ef9[_0x3de6('0x49')]=_0x42ebf1[_0x3de6('0x49')];_0x3d3ef9['erlangCallToSecond']=_0x42ebf1[_0x3de6('0x4a')];_0x3d3ef9[_0x3de6('0x4b')]=_0x42ebf1['erlangAbandonmentRate'];_0x3d3ef9['erlangBusyFactor']=_0x42ebf1[_0x3de6('0x4c')];_0x3d3ef9[_0x3de6('0x4d')]=_0x42ebf1[_0x3de6('0x4d')];_0x3d3ef9[_0x3de6('0x4e')]=_0x42ebf1[_0x3de6('0x4e')];}if(_0x42ebf1[_0x3de6('0x4f')]){_0x3d3ef9[_0x3de6('0x4f')]={'id':_0x42ebf1[_0x3de6('0x4f')]['id'],'name':_0x42ebf1[_0x3de6('0x4f')]['name'],'active':_0x42ebf1[_0x3de6('0x4f')]['active'],'callerid':_0x42ebf1[_0x3de6('0x4f')][_0x3de6('0x50')]};}if(_0x42ebf1['Interval']){_0x3d3ef9[_0x3de6('0x51')]={'id':_0x42ebf1[_0x3de6('0x51')]['id'],'name':_0x42ebf1[_0x3de6('0x51')][_0x3de6('0x9')]};}_0x2675d4[_0x3de6('0x52')](_0x3d3ef9);}}_0x50118c({'count':_0x2675d4['length'],'rows':_0x2675d4});});},'VoiceChannels':function(_0x3e13be){return new Promise(function(_0x1a5787,_0x501177){var _0x129272=_['values'](_0x5e817a[_0x3de6('0x53')]);_0x1a5787({'count':_0x129272[_0x3de6('0x54')],'rows':_0x129272});});},'VoiceChannelMixMonitor':function(_0x367f7f){var _0x53dcbd=this;return new Promise(function(_0x5e8ca2,_0x28e58b){if(ami[_0x3de6('0x1c')]()==![]){return _0x28e58b(_0x53dcbd[_0x3de6('0xf')](0x1f4,[config[_0x3de6('0x10')]['ip'],config[_0x3de6('0x10')][_0x3de6('0x11')],'ami\x20disconnected'][_0x3de6('0x13')]('\x20')));}var _0x2d421a=schema(properties['voicechannel'])[_0x3de6('0x3')](_0x367f7f);if(_0x2d421a[_0x3de6('0x54')]>0x0){return _0x28e58b(_0x53dcbd[_0x3de6('0xf')](0x1f4,_[_0x3de6('0x55')](_0x2d421a,'message')[_0x3de6('0x13')](',\x20')));}var _0x239ed4=_['find'](_0x5e817a[_0x3de6('0x53')],{'uniqueid':_0x367f7f[_0x3de6('0x56')]});if(_0x239ed4&&_0x239ed4[_0x3de6('0x57')]){var _0x56009e=util[_0x3de6('0x58')](_0x3de6('0x59'),_0x367f7f['filename']||_0x367f7f['uniqueid'],_0x367f7f['format']||'wav');return ami[_0x3de6('0x18')]({'action':_0x3de6('0x5a'),'channel':_0x239ed4[_0x3de6('0x57')],'file':_0x56009e,'options':'ai(mixmonitorid)'})[_0x3de6('0x19')](function(_0x1a3914){var _0x32b24e=_[_0x3de6('0x5b')](_0x239ed4['monitors'],{'filename':_0x3de6('0x5c')+_0x56009e[_0x3de6('0x5d')]()});if(_[_0x3de6('0x5e')](_0x32b24e)){_0x239ed4[_0x3de6('0x5f')][_0x3de6('0x52')]({'filename':_0x3de6('0x5c')+_0x56009e[_0x3de6('0x5d')](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x1a3914[_0x3de6('0x60')],'status':_0x3de6('0x61')});}else{_0x32b24e[_0x3de6('0x60')]=_0x1a3914[_0x3de6('0x60')];_0x32b24e[_0x3de6('0x62')]=_0x3de6('0x61');}_0x5e8ca2({'code':0xc8,'message':[_0x367f7f[_0x3de6('0x56')],_0x3de6('0x63'),_0x1a3914[_0x3de6('0x60')]][_0x3de6('0x13')]('\x20'),'mixmonitorid':_0x1a3914[_0x3de6('0x60')]});})['catch'](function(_0x11c45c){_0x28e58b(_0x53dcbd[_0x3de6('0xf')](0x1f5,[_0x367f7f['uniqueid'],_0x11c45c[_0x3de6('0x1a')][_0x3de6('0x5d')]()][_0x3de6('0x13')]('\x20')));});}else{return _0x28e58b(_0x53dcbd[_0x3de6('0xf')](0x1f5,_0x3de6('0x64')));}});},'VoiceChannelStopMixMonitor':function(_0x985198){var _0x5bac1d=this;return new Promise(function(_0x3814ed,_0x3c4038){if(ami[_0x3de6('0x1c')]()==![]){return _0x3c4038(_0x5bac1d[_0x3de6('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x3de6('0x10')][_0x3de6('0x11')],_0x3de6('0x12')]['join']('\x20')));}var _0x4a77f6=schema(properties[_0x3de6('0x65')])[_0x3de6('0x3')](_0x985198);if(_0x4a77f6[_0x3de6('0x54')]>0x0){return _0x3c4038(_0x5bac1d[_0x3de6('0xf')](0x1f4,_[_0x3de6('0x55')](_0x4a77f6,'message')['join'](',\x20')));}var _0x4c6c2d=_[_0x3de6('0x5b')](_0x5e817a[_0x3de6('0x53')],{'uniqueid':_0x985198[_0x3de6('0x56')]});if(_0x4c6c2d){return BPromise['resolve']()['then'](function(){if(_0x4c6c2d['channel']){return ami['Action']({'action':_0x3de6('0x66'),'channel':_0x4c6c2d[_0x3de6('0x57')],'mixmonitorid':_0x985198[_0x3de6('0x60')]})['catch'](function(_0x2bdfa2){});}})[_0x3de6('0x19')](function(){if(_0x4c6c2d['destinationchannel']){return ami['Action']({'action':_0x3de6('0x66'),'channel':_0x4c6c2d[_0x3de6('0x67')],'mixmonitorid':_0x985198[_0x3de6('0x60')]})[_0x3de6('0x1b')](function(_0x1cda5e){});}})[_0x3de6('0x19')](function(_0x257c87){var _0x3fd23f=_[_0x3de6('0x5b')](_0x4c6c2d[_0x3de6('0x5f')],{'mixmonitorid':_0x985198[_0x3de6('0x60')]});if(_0x3fd23f){_0x3fd23f[_0x3de6('0x62')]=_0x3de6('0x68');}})[_0x3de6('0x19')](function(){var _0x464e92=util['format'](_0x3de6('0x59'),_0x985198['filename']||_0x985198[_0x3de6('0x56')],_0x985198[_0x3de6('0x58')]||_0x3de6('0x69'));var _0x5cb8b6=_[_0x3de6('0x5b')](_0x4c6c2d['monitors'],{'filename':_0x3de6('0x5c')+_0x464e92[_0x3de6('0x5d')]()});if(_0x5cb8b6){_0x5cb8b6['status']=_0x3de6('0x68');}})[_0x3de6('0x19')](function(){_0x3814ed({'code':0xc8,'message':[_0x985198[_0x3de6('0x56')],_0x3de6('0x6a')][_0x3de6('0x13')]('\x20')});})['catch'](function(_0x271b70){_0x3c4038(_0x5bac1d[_0x3de6('0xf')](0x1f5,[_0x985198[_0x3de6('0x56')],_0x271b70[_0x3de6('0x1a')][_0x3de6('0x5d')]()]['join']('\x20')));});}else{return _0x3c4038(_0x5bac1d[_0x3de6('0xf')](0x1f5,_0x3de6('0x64')));}});},'VoiceQueuesChannels':function(_0x57097e){return new Promise(function(_0x3be576,_0x40a891){var _0x37847c=_[_0x3de6('0x6b')](_0x5e817a[_0x3de6('0x6c')]);_0x3be576({'count':_0x37847c[_0x3de6('0x54')],'rows':_0x37847c});});},'VoiceQueuesChannel':function(_0x4b1e1d){var _0x5eeeb0=this;return new Promise(function(_0x658716,_0x1aaae8){var _0x31acb6=schema(properties['voicequeuechannel'])[_0x3de6('0x3')](_0x4b1e1d);if(_0x31acb6[_0x3de6('0x54')]>0x0){return _0x1aaae8(_0x5eeeb0[_0x3de6('0xf')](0x1f4,_['map'](_0x31acb6,_0x3de6('0x1a'))['join'](',\x20')));}var _0x6a268f=_[_0x3de6('0x5b')](_0x5e817a['queueChannels'],{'uniqueid':_0x4b1e1d[_0x3de6('0x56')]});if(_0x6a268f){_0x658716(_0x6a268f);}else{return _0x1aaae8(_0x5eeeb0[_0x3de6('0xf')](0x1f5,_0x3de6('0x64')));}});},'VoiceQueuesChannelHangup':function(_0x50178e){var _0x5a6b32=this;return new Promise(function(_0x37f2f5,_0x319ed2){if(ami[_0x3de6('0x1c')]()==![]){return _0x319ed2(_0x5a6b32[_0x3de6('0xf')](0x1f4,[config[_0x3de6('0x10')]['ip'],config['asterisk'][_0x3de6('0x11')],_0x3de6('0x12')][_0x3de6('0x13')]('\x20')));}var _0x1d1a07=schema(properties['voicequeuechannelhangup'])[_0x3de6('0x3')](_0x50178e);if(_0x1d1a07[_0x3de6('0x54')]>0x0){return _0x319ed2(_0x5a6b32['error'](0x1f4,_[_0x3de6('0x55')](_0x1d1a07,_0x3de6('0x1a'))[_0x3de6('0x13')](',\x20')));}var _0x205b34=_[_0x3de6('0x5b')](_0x5e817a[_0x3de6('0x6c')],{'uniqueid':_0x50178e[_0x3de6('0x56')]});if(_0x205b34&&_0x205b34[_0x3de6('0x57')]){return ami[_0x3de6('0x18')]({'action':_0x3de6('0x6d'),'channel':_0x205b34[_0x3de6('0x57')]})[_0x3de6('0x19')](function(_0x41481d){_0x37f2f5({'code':0xc8,'message':[_0x50178e['uniqueid'],_0x41481d[_0x3de6('0x1a')][_0x3de6('0x5d')]()]['join']('\x20')});})[_0x3de6('0x1b')](function(_0x2dcf6c){_0x319ed2(_0x5a6b32['error'](0x1f5,[_0x50178e[_0x3de6('0x56')],_0x2dcf6c[_0x3de6('0x1a')][_0x3de6('0x5d')]()][_0x3de6('0x13')]('\x20')));});}else{return _0x319ed2(_0x5a6b32[_0x3de6('0xf')](0x1f5,_0x3de6('0x64')));}});},'VoiceQueuesChannelRedirect':function(_0xfba25b){var _0x23e3fb=this;return new Promise(function(_0x55d4cc,_0xa2fbd3){if(ami[_0x3de6('0x1c')]()==![]){return _0xa2fbd3(_0x23e3fb[_0x3de6('0xf')](0x1f4,[config[_0x3de6('0x10')]['ip'],config['asterisk'][_0x3de6('0x11')],_0x3de6('0x12')][_0x3de6('0x13')]('\x20')));}var _0xc993ea=schema(properties[_0x3de6('0x6e')])[_0x3de6('0x3')](_0xfba25b);if(_0xc993ea['length']>0x0){return _0xa2fbd3(_0x23e3fb[_0x3de6('0xf')](0x1f4,_[_0x3de6('0x55')](_0xc993ea,_0x3de6('0x1a'))[_0x3de6('0x13')](',\x20')));}var _0x17bc58=_['find'](_0x5e817a['queueChannels'],{'uniqueid':_0xfba25b[_0x3de6('0x56')]});if(_0x17bc58&&_0x17bc58[_0x3de6('0x57')]){return ami['Action']({'action':_0x3de6('0x6f'),'channel':_0x17bc58[_0x3de6('0x57')],'exten':_0xfba25b[_0x3de6('0x70')],'context':_0xfba25b['context']||_0x17bc58[_0x3de6('0x71')],'priority':0x1})['then'](function(_0x2317a8){_0x55d4cc({'code':0xc8,'message':[_0xfba25b[_0x3de6('0x56')],_0x2317a8[_0x3de6('0x1a')][_0x3de6('0x5d')]()][_0x3de6('0x13')]('\x20')});})['catch'](function(_0x1870a5){_0xa2fbd3(_0x23e3fb['error'](0x1f5,[_0xfba25b[_0x3de6('0x56')],_0x1870a5['message'][_0x3de6('0x5d')]()]['join']('\x20')));});}else{return _0xa2fbd3(_0x23e3fb[_0x3de6('0xf')](0x1f5,_0x3de6('0x64')));}});},'Agents':function(_0x23f112){return new Promise(function(_0x31dbc2,_0x34012e){var _0x1691eb=_[_0x3de6('0x6b')](_0x5e817a['agents']);_0x31dbc2({'count':_0x1691eb[_0x3de6('0x54')],'rows':_0x1691eb});});},'Telephones':function(_0x5de277){return new Promise(function(_0x4e7c0e,_0x16649f){var _0x500697=_[_0x3de6('0x6b')](_0x5e817a[_0x3de6('0x72')]);_0x4e7c0e({'count':_0x500697[_0x3de6('0x54')],'rows':_0x500697});});},'Trunks':function(_0x326e2c){return new Promise(function(_0x4fe7da,_0x30bba6){var _0x5d50bf=_[_0x3de6('0x6b')](_0x5e817a[_0x3de6('0x73')]);_0x4fe7da({'count':_0x5d50bf[_0x3de6('0x54')],'rows':_0x5d50bf});});},'OutboundChannels':function(_0xb87773){return new Promise(function(_0x1b9149,_0x552909){var _0x41b351=_['values'](_0x5e817a[_0x3de6('0x74')]);_0x1b9149({'count':_0x41b351[_0x3de6('0x54')],'rows':_0x41b351});});},'Outbound':function(_0x385f73){return new Promise(function(_0x43779c,_0x1cffc1){_0x43779c(_0x5e817a[_0x3de6('0x75')]);});},'Campaigns':function(_0x5d784d){return new Promise(function(_0x5e8b5d,_0x2a1d50){var _0x242a30=_[_0x3de6('0x6b')](_0x5e817a[_0x3de6('0x76')]);_0x5e8b5d({'count':_0x242a30[_0x3de6('0x54')],'rows':_0x242a30});});},'VoiceQueuesPreview':function(_0x331a17){var _0x368520=this;return new Promise(function(_0x541e41,_0x3ad49e){_0x93923[_0x3de6('0x77')](_0x331a17['id'])['then'](function(_0x343a92){_0x541e41({'code':0xc8,'message':_0x343a92[_0x3de6('0x1a')]});})[_0x3de6('0x1b')](function(_0x2d69d0){_0x3ad49e(_0x368520['error'](0x1f4,_0x2d69d0['message']));});});},'EventManager':function(_0x236f75){var _0x3d4af3=this;return new Promise(function(_0x4c8a12,_0x5d804d){if(!_0x236f75['event']){return _0x5d804d(_0x3d4af3[_0x3de6('0xf')](0x1f4,_0x3de6('0x78')));}ami[_0x3de6('0x79')](_0x3de6('0x7a')+_0x236f75[_0x3de6('0x7b')],_0x236f75[_0x3de6('0x1a')]);_0x4c8a12({'code':0xc8,'message':_0x236f75});});},'FaxAccounts':function(_0x1522d5){return new Promise(function(_0x8fb463,_0x5d1432){var _0x1232a1=_[_0x3de6('0x6b')](_0x5e817a[_0x3de6('0x7c')]);_0x8fb463({'count':_0x1232a1[_0x3de6('0x54')],'rows':_0x1232a1});});},'SendFax':function(_0x194843){var _0x2df499=this;return new Promise(function(_0x33c0f9,_0x428e5b){_0x25945f[_0x3de6('0x7d')](_0x194843)[_0x3de6('0x19')](function(_0x4b485a){_0x33c0f9({'code':0xc8,'message':_0x4b485a[_0x3de6('0x1a')]});})[_0x3de6('0x1b')](function(_0x228a52){_0x428e5b(_0x2df499[_0x3de6('0xf')](0x1f4,_0x228a52['message']));});});},'CheckAfterSend':function(_0x5d6c5d){var _0x55c21=this;return new Promise(function(_0x435583,_0x2cc939){_0x25945f[_0x3de6('0x7e')](_0x5d6c5d)[_0x3de6('0x19')](function(_0x2d3f66){_0x435583({'code':0xc8,'message':_0x2d3f66['message']});})[_0x3de6('0x1b')](function(_0x11cb3a){_0x2cc939(_0x55c21[_0x3de6('0xf')](0x1f4,_0x11cb3a[_0x3de6('0x1a')]));});});}};var _0x40bd0d=jayson[_0x3de6('0x7f')](_0xefa7cf)[_0x3de6('0x80')]();_0x40bd0d['on'](_0x3de6('0xf'),function(_0x159903){return _0x4a6dee(_0x159903);});_0x40bd0d[_0x3de6('0x7')](0x232a,_0x3de6('0x81'),function(){console['log'](_0x3de6('0x82'),0x232a);return _0x2e8ca4(_0x3de6('0x83')+0x232a);});});}; \ No newline at end of file +var _0xc1c3=['startProgressive','Trunk','active','callerid','Interval','length','values','channels','join','voicechannel','map','find','channel','%s.%s','filename','format','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','uniqueid','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','voicequeuechannel','voicequeuechannelhangup','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','telephones','outbound','campaigns','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','listen','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','username','ami\x20disconnected','pick','module','action','Reload','Action','then','catch','message','asterisk','command','Command','content','strategy','loggedIn','pTalking','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive'];(function(_0x14adbe,_0x51ce57){var _0x143523=function(_0x36764d){while(--_0x36764d){_0x14adbe['push'](_0x14adbe['shift']());}};_0x143523(++_0x51ce57);}(_0xc1c3,0xbf));var _0x3c1c=function(_0x20241e,_0x189bc0){_0x20241e=_0x20241e-0x0;var _0x17e8a8=_0xc1c3[_0x20241e];return _0x17e8a8;};'use strict';var _=require(_0x3c1c('0x0'));var util=require(_0x3c1c('0x1'));var jayson=require(_0x3c1c('0x2'));var schema=require(_0x3c1c('0x3'));var BPromise=require(_0x3c1c('0x4'));var moment=require(_0x3c1c('0x5'));var config=require(_0x3c1c('0x6'));var properties=require(_0x3c1c('0x7'));var ami=require('../ami');exports[_0x3c1c('0x8')]=function(_0x4a540,_0x540bef,_0x16f1dd){return new BPromise(function(_0xc99c4c,_0x2a6784){var _0x4eadc3={'QueuePause':function(_0x57e5aa){return new Promise(function(_0x295c18,_0x4b8b24){var _0x574031=util['format']('%s/%s','SIP',_0x57e5aa[_0x3c1c('0x9')]);if(_0x4a540['timers']&&_0x4a540[_0x3c1c('0xa')][_0x574031]&&_0x4a540[_0x3c1c('0xa')][_0x574031][_0x3c1c('0xb')]){_0x4a540[_0x3c1c('0xa')][_0x574031][_0x3c1c('0xc')]();}if(_0x4a540[_0x3c1c('0xd')][_0x574031]){_0x4a540[_0x3c1c('0xd')][_0x574031][_0x3c1c('0xe')]({'statePause':_0x57e5aa['pause']?!![]:![]});}_0x295c18({'code':0xc8,'message':_0x3c1c('0xf')});});},'Reload':function(_0x1336cb){var _0x512e3e=this;return new Promise(function(_0x3c1ad1,_0x3514d1){if(ami[_0x3c1c('0x10')]()==![]){return _0x3514d1(_0x512e3e[_0x3c1c('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x3c1c('0x12')],_0x3c1c('0x13')]['join']('\x20')));}_0x1336cb=_[_0x3c1c('0x14')](_0x1336cb,_['keys'](properties[_0x3c1c('0x15')]));_0x1336cb[_0x3c1c('0x16')]=_0x3c1c('0x17');return ami[_0x3c1c('0x18')](_0x1336cb)[_0x3c1c('0x19')](function(_0x464587){_0x3c1ad1({'code':0xc8,'message':_0x464587['message']});})[_0x3c1c('0x1a')](function(_0x387407){_0x3514d1(_0x512e3e[_0x3c1c('0x11')](0x1f5,_0x387407[_0x3c1c('0x1b')]));});});},'Command':function(_0x5570fb){var _0x141c31=this;return new Promise(function(_0xde05f7,_0x3f4f57){if(ami['isConnected']()==![]){return _0x3f4f57(_0x141c31[_0x3c1c('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x3c1c('0x1c')][_0x3c1c('0x12')],_0x3c1c('0x13')]['join']('\x20')));}_0x5570fb=_[_0x3c1c('0x14')](_0x5570fb,_0x3c1c('0x1d'));_0x5570fb['action']=_0x3c1c('0x1e');return ami[_0x3c1c('0x18')](_0x5570fb)[_0x3c1c('0x19')](function(_0x536b66){_0xde05f7({'code':0xc8,'message':_0x536b66[_0x3c1c('0x1f')]});})[_0x3c1c('0x1a')](function(_0x5ae5f9){_0x3f4f57(_0x141c31[_0x3c1c('0x11')](0x1f5,_0x5ae5f9[_0x3c1c('0x1b')]));});});},'VoiceQueues':function(_0x3d757c){return new Promise(function(_0x178fbd,_0x3890a4){var _0x478b62=[];for(var _0xf6dcf9 in _0x4a540['voiceQueues']){if(_0x4a540['voiceQueues']['hasOwnProperty'](_0xf6dcf9)){var _0x44abfc=_0x4a540['voiceQueues'][_0xf6dcf9];var _0x317dba={'id':_0x44abfc['id'],'name':_0x44abfc[_0x3c1c('0x9')],'strategy':_0x44abfc[_0x3c1c('0x20')],'answered':_0x44abfc['answered'],'available':_0x44abfc['available'],'loggedIn':_0x44abfc[_0x3c1c('0x21')],'pTalking':_0x44abfc[_0x3c1c('0x22')],'sumBillable':_0x44abfc['sumBillable'],'sumDuration':_0x44abfc[_0x3c1c('0x23')],'sumHoldTime':_0x44abfc[_0x3c1c('0x24')]||0x0,'talking':_0x44abfc['talking'],'total':_0x44abfc[_0x3c1c('0x25')],'type':_0x44abfc[_0x3c1c('0x26')],'unmanaged':_0x44abfc[_0x3c1c('0x27')],'abandoned':_0x44abfc[_0x3c1c('0x28')],'waiting':_0x44abfc[_0x3c1c('0x29')],'loggedInDb':_0x44abfc[_0x3c1c('0x2a')]};if(_0x44abfc['type']==='outbound'){_0x317dba['dialActive']=_0x44abfc[_0x3c1c('0x2b')];_0x317dba[_0x3c1c('0x2c')]=_0x44abfc[_0x3c1c('0x2c')];_0x317dba[_0x3c1c('0x2d')]=_0x44abfc['dialOriginateCallerIdName'];_0x317dba[_0x3c1c('0x2e')]=_0x44abfc[_0x3c1c('0x2e')];_0x317dba[_0x3c1c('0x2f')]=_0x44abfc['dialOriginateTimeout'];_0x317dba[_0x3c1c('0x30')]=_0x44abfc['dialPrefix'];_0x317dba[_0x3c1c('0x31')]=_0x44abfc['outboundAnswerAgiCallsDay'];_0x317dba[_0x3c1c('0x32')]=_0x44abfc['outboundAnswerCallsDay'];_0x317dba[_0x3c1c('0x33')]=_0x44abfc[_0x3c1c('0x33')];_0x317dba[_0x3c1c('0x34')]=_0x44abfc['outboundBusyCallsDay'];_0x317dba['outboundCongestionCallsDay']=_0x44abfc[_0x3c1c('0x35')];_0x317dba[_0x3c1c('0x36')]=_0x44abfc['outboundDropCallsDayACS'];_0x317dba[_0x3c1c('0x37')]=_0x44abfc[_0x3c1c('0x37')];_0x317dba[_0x3c1c('0x38')]=_0x44abfc['outboundDropCallsDayTimeout'];_0x317dba[_0x3c1c('0x39')]=_0x44abfc[_0x3c1c('0x39')];_0x317dba[_0x3c1c('0x3a')]=_0x44abfc[_0x3c1c('0x3a')];_0x317dba['outboundOriginateFailureCallsDay']=_0x44abfc[_0x3c1c('0x3b')];_0x317dba[_0x3c1c('0x3c')]=_0x44abfc[_0x3c1c('0x3c')];_0x317dba['outboundRejectCallsDay']=_0x44abfc['outboundRejectCallsDay'];_0x317dba['outboundUnknownCallsDay']=_0x44abfc[_0x3c1c('0x3d')];_0x317dba['predictiveIntervalAnsweredCalls']=_0x44abfc['predictiveIntervalAnsweredCalls'];_0x317dba[_0x3c1c('0x3e')]=_0x44abfc[_0x3c1c('0x3e')];_0x317dba[_0x3c1c('0x3f')]=_0x44abfc[_0x3c1c('0x3f')];_0x317dba[_0x3c1c('0x40')]=_0x44abfc[_0x3c1c('0x40')];_0x317dba['predictiveIntervalDroppedCallsTimeout']=_0x44abfc[_0x3c1c('0x41')];_0x317dba[_0x3c1c('0x42')]=_0x44abfc[_0x3c1c('0x42')];_0x317dba[_0x3c1c('0x43')]=_0x44abfc[_0x3c1c('0x43')];_0x317dba[_0x3c1c('0x44')]=_0x44abfc['predictiveIntervalHitRate'];_0x317dba['predictiveIntervalMultiplicativeFactor']=_0x44abfc[_0x3c1c('0x45')];_0x317dba[_0x3c1c('0x46')]=_0x44abfc[_0x3c1c('0x46')];_0x317dba[_0x3c1c('0x47')]=_0x44abfc['predictiveIntervalAvailable'];_0x317dba[_0x3c1c('0x48')]=_0x44abfc[_0x3c1c('0x48')];_0x317dba[_0x3c1c('0x1b')]=_0x44abfc[_0x3c1c('0x1b')];_0x317dba[_0x3c1c('0x49')]=_0x44abfc[_0x3c1c('0x49')];_0x317dba['erlangCalls']=_0x44abfc[_0x3c1c('0x4a')];_0x317dba[_0x3c1c('0x4b')]=_0x44abfc[_0x3c1c('0x4b')];_0x317dba[_0x3c1c('0x4c')]=_0x44abfc['erlangAbandonmentRate'];_0x317dba[_0x3c1c('0x4d')]=_0x44abfc['erlangBusyFactor'];_0x317dba[_0x3c1c('0x4e')]=_0x44abfc[_0x3c1c('0x4e')];_0x317dba[_0x3c1c('0x4f')]=_0x44abfc[_0x3c1c('0x4f')];}if(_0x44abfc[_0x3c1c('0x50')]){_0x317dba[_0x3c1c('0x50')]={'id':_0x44abfc[_0x3c1c('0x50')]['id'],'name':_0x44abfc[_0x3c1c('0x50')][_0x3c1c('0x9')],'active':_0x44abfc[_0x3c1c('0x50')][_0x3c1c('0x51')],'callerid':_0x44abfc[_0x3c1c('0x50')][_0x3c1c('0x52')]};}if(_0x44abfc[_0x3c1c('0x53')]){_0x317dba[_0x3c1c('0x53')]={'id':_0x44abfc[_0x3c1c('0x53')]['id'],'name':_0x44abfc[_0x3c1c('0x53')][_0x3c1c('0x9')]};}_0x478b62['push'](_0x317dba);}}_0x178fbd({'count':_0x478b62[_0x3c1c('0x54')],'rows':_0x478b62});});},'VoiceChannels':function(_0x4e0b02){return new Promise(function(_0xdb2224,_0x14aaad){var _0x138867=_[_0x3c1c('0x55')](_0x4a540[_0x3c1c('0x56')]);_0xdb2224({'count':_0x138867['length'],'rows':_0x138867});});},'VoiceChannelMixMonitor':function(_0x59a8f2){var _0x64be4a=this;return new Promise(function(_0x241a08,_0x56cc13){if(ami[_0x3c1c('0x10')]()==![]){return _0x56cc13(_0x64be4a[_0x3c1c('0x11')](0x1f4,[config[_0x3c1c('0x1c')]['ip'],config[_0x3c1c('0x1c')]['username'],'ami\x20disconnected'][_0x3c1c('0x57')]('\x20')));}var _0x4b9492=schema(properties[_0x3c1c('0x58')])[_0x3c1c('0x3')](_0x59a8f2);if(_0x4b9492[_0x3c1c('0x54')]>0x0){return _0x56cc13(_0x64be4a[_0x3c1c('0x11')](0x1f4,_[_0x3c1c('0x59')](_0x4b9492,_0x3c1c('0x1b'))[_0x3c1c('0x57')](',\x20')));}var _0xe8f3b3=_[_0x3c1c('0x5a')](_0x4a540[_0x3c1c('0x56')],{'uniqueid':_0x59a8f2['uniqueid']});if(_0xe8f3b3&&_0xe8f3b3[_0x3c1c('0x5b')]){var _0x11b077=util['format'](_0x3c1c('0x5c'),_0x59a8f2[_0x3c1c('0x5d')]||_0x59a8f2['uniqueid'],_0x59a8f2[_0x3c1c('0x5e')]||_0x3c1c('0x5f'));return ami['Action']({'action':_0x3c1c('0x60'),'channel':_0xe8f3b3[_0x3c1c('0x5b')],'file':_0x11b077,'options':'ai(mixmonitorid)'})['then'](function(_0x33b381){var _0x36ab70=_[_0x3c1c('0x5a')](_0xe8f3b3[_0x3c1c('0x61')],{'filename':_0x3c1c('0x62')+_0x11b077[_0x3c1c('0x63')]()});if(_[_0x3c1c('0x64')](_0x36ab70)){_0xe8f3b3[_0x3c1c('0x61')]['push']({'filename':_0x3c1c('0x62')+_0x11b077[_0x3c1c('0x63')](),'createdAt':moment()[_0x3c1c('0x5e')](_0x3c1c('0x65')),'mixmonitorid':_0x33b381[_0x3c1c('0x66')],'status':'rec'});}else{_0x36ab70[_0x3c1c('0x66')]=_0x33b381[_0x3c1c('0x66')];_0x36ab70[_0x3c1c('0x67')]=_0x3c1c('0x68');}_0x241a08({'code':0xc8,'message':[_0x59a8f2['uniqueid'],_0x3c1c('0x69'),_0x33b381[_0x3c1c('0x66')]][_0x3c1c('0x57')]('\x20'),'mixmonitorid':_0x33b381[_0x3c1c('0x66')]});})[_0x3c1c('0x1a')](function(_0x2f5a35){_0x56cc13(_0x64be4a['error'](0x1f5,[_0x59a8f2[_0x3c1c('0x6a')],_0x2f5a35['message']['toLowerCase']()][_0x3c1c('0x57')]('\x20')));});}else{return _0x56cc13(_0x64be4a[_0x3c1c('0x11')](0x1f5,_0x3c1c('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x4d3cb4){var _0x53dc79=this;return new Promise(function(_0x141f1a,_0x344eb9){if(ami[_0x3c1c('0x10')]()==![]){return _0x344eb9(_0x53dc79[_0x3c1c('0x11')](0x1f4,[config[_0x3c1c('0x1c')]['ip'],config[_0x3c1c('0x1c')][_0x3c1c('0x12')],_0x3c1c('0x13')][_0x3c1c('0x57')]('\x20')));}var _0x5816de=schema(properties['voicechannel'])['validate'](_0x4d3cb4);if(_0x5816de[_0x3c1c('0x54')]>0x0){return _0x344eb9(_0x53dc79[_0x3c1c('0x11')](0x1f4,_[_0x3c1c('0x59')](_0x5816de,_0x3c1c('0x1b'))[_0x3c1c('0x57')](',\x20')));}var _0x42ee9e=_[_0x3c1c('0x5a')](_0x4a540['channels'],{'uniqueid':_0x4d3cb4[_0x3c1c('0x6a')]});if(_0x42ee9e){return BPromise[_0x3c1c('0x6c')]()[_0x3c1c('0x19')](function(){if(_0x42ee9e[_0x3c1c('0x5b')]){return ami[_0x3c1c('0x18')]({'action':_0x3c1c('0x6d'),'channel':_0x42ee9e[_0x3c1c('0x5b')],'mixmonitorid':_0x4d3cb4[_0x3c1c('0x66')]})[_0x3c1c('0x1a')](function(_0x5408f3){});}})[_0x3c1c('0x19')](function(){if(_0x42ee9e[_0x3c1c('0x6e')]){return ami[_0x3c1c('0x18')]({'action':'StopMixMonitor','channel':_0x42ee9e[_0x3c1c('0x6e')],'mixmonitorid':_0x4d3cb4[_0x3c1c('0x66')]})[_0x3c1c('0x1a')](function(_0x503f63){});}})[_0x3c1c('0x19')](function(_0x23f113){var _0x309f5a=_[_0x3c1c('0x5a')](_0x42ee9e[_0x3c1c('0x61')],{'mixmonitorid':_0x4d3cb4[_0x3c1c('0x66')]});if(_0x309f5a){_0x309f5a[_0x3c1c('0x67')]=_0x3c1c('0x6f');}})[_0x3c1c('0x19')](function(){var _0x4c5df3=util['format'](_0x3c1c('0x5c'),_0x4d3cb4[_0x3c1c('0x5d')]||_0x4d3cb4[_0x3c1c('0x6a')],_0x4d3cb4[_0x3c1c('0x5e')]||_0x3c1c('0x5f'));var _0x51ff5b=_[_0x3c1c('0x5a')](_0x42ee9e[_0x3c1c('0x61')],{'filename':_0x3c1c('0x62')+_0x4c5df3[_0x3c1c('0x63')]()});if(_0x51ff5b){_0x51ff5b[_0x3c1c('0x67')]=_0x3c1c('0x6f');}})[_0x3c1c('0x19')](function(){_0x141f1a({'code':0xc8,'message':[_0x4d3cb4[_0x3c1c('0x6a')],_0x3c1c('0x70')][_0x3c1c('0x57')]('\x20')});})['catch'](function(_0x5c3f9d){_0x344eb9(_0x53dc79[_0x3c1c('0x11')](0x1f5,[_0x4d3cb4[_0x3c1c('0x6a')],_0x5c3f9d['message'][_0x3c1c('0x63')]()]['join']('\x20')));});}else{return _0x344eb9(_0x53dc79['error'](0x1f5,_0x3c1c('0x6b')));}});},'VoiceQueuesChannels':function(_0x3ecef4){return new Promise(function(_0x38f62d,_0x279702){var _0x4c4388=_[_0x3c1c('0x55')](_0x4a540['queueChannels']);_0x38f62d({'count':_0x4c4388['length'],'rows':_0x4c4388});});},'VoiceQueuesChannel':function(_0xfb0af2){var _0x17fe93=this;return new Promise(function(_0x496a35,_0x2f0714){var _0x438e17=schema(properties[_0x3c1c('0x71')])['validate'](_0xfb0af2);if(_0x438e17[_0x3c1c('0x54')]>0x0){return _0x2f0714(_0x17fe93[_0x3c1c('0x11')](0x1f4,_['map'](_0x438e17,_0x3c1c('0x1b'))['join'](',\x20')));}var _0x3746ca=_['find'](_0x4a540['queueChannels'],{'uniqueid':_0xfb0af2[_0x3c1c('0x6a')]});if(_0x3746ca){_0x496a35(_0x3746ca);}else{return _0x2f0714(_0x17fe93[_0x3c1c('0x11')](0x1f5,_0x3c1c('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x4983ac){var _0x1778c7=this;return new Promise(function(_0x406015,_0x1da534){if(ami[_0x3c1c('0x10')]()==![]){return _0x1da534(_0x1778c7['error'](0x1f4,[config[_0x3c1c('0x1c')]['ip'],config[_0x3c1c('0x1c')]['username'],_0x3c1c('0x13')]['join']('\x20')));}var _0x560945=schema(properties[_0x3c1c('0x72')])['validate'](_0x4983ac);if(_0x560945[_0x3c1c('0x54')]>0x0){return _0x1da534(_0x1778c7[_0x3c1c('0x11')](0x1f4,_[_0x3c1c('0x59')](_0x560945,_0x3c1c('0x1b'))[_0x3c1c('0x57')](',\x20')));}var _0x5eb5e5=_[_0x3c1c('0x5a')](_0x4a540[_0x3c1c('0x73')],{'uniqueid':_0x4983ac[_0x3c1c('0x6a')]});if(_0x5eb5e5&&_0x5eb5e5['channel']){return ami[_0x3c1c('0x18')]({'action':_0x3c1c('0x74'),'channel':_0x5eb5e5[_0x3c1c('0x5b')]})[_0x3c1c('0x19')](function(_0xb192ae){_0x406015({'code':0xc8,'message':[_0x4983ac[_0x3c1c('0x6a')],_0xb192ae['message']['toLowerCase']()][_0x3c1c('0x57')]('\x20')});})[_0x3c1c('0x1a')](function(_0x42858c){_0x1da534(_0x1778c7[_0x3c1c('0x11')](0x1f5,[_0x4983ac['uniqueid'],_0x42858c['message'][_0x3c1c('0x63')]()][_0x3c1c('0x57')]('\x20')));});}else{return _0x1da534(_0x1778c7[_0x3c1c('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x731de7){var _0x3cc59e=this;return new Promise(function(_0xe2b614,_0x2318d4){if(ami[_0x3c1c('0x10')]()==![]){return _0x2318d4(_0x3cc59e['error'](0x1f4,[config[_0x3c1c('0x1c')]['ip'],config['asterisk']['username'],_0x3c1c('0x13')][_0x3c1c('0x57')]('\x20')));}var _0x2a0387=schema(properties[_0x3c1c('0x75')])[_0x3c1c('0x3')](_0x731de7);if(_0x2a0387[_0x3c1c('0x54')]>0x0){return _0x2318d4(_0x3cc59e['error'](0x1f4,_['map'](_0x2a0387,_0x3c1c('0x1b'))[_0x3c1c('0x57')](',\x20')));}var _0x169f67=_[_0x3c1c('0x5a')](_0x4a540[_0x3c1c('0x73')],{'uniqueid':_0x731de7[_0x3c1c('0x6a')]});if(_0x169f67&&_0x169f67[_0x3c1c('0x5b')]){return ami['Action']({'action':_0x3c1c('0x76'),'channel':_0x169f67[_0x3c1c('0x5b')],'exten':_0x731de7[_0x3c1c('0x77')],'context':_0x731de7['context']||_0x169f67['context'],'priority':0x1})[_0x3c1c('0x19')](function(_0x290942){_0xe2b614({'code':0xc8,'message':[_0x731de7['uniqueid'],_0x290942['message'][_0x3c1c('0x63')]()][_0x3c1c('0x57')]('\x20')});})['catch'](function(_0x4e2b93){_0x2318d4(_0x3cc59e['error'](0x1f5,[_0x731de7[_0x3c1c('0x6a')],_0x4e2b93[_0x3c1c('0x1b')][_0x3c1c('0x63')]()][_0x3c1c('0x57')]('\x20')));});}else{return _0x2318d4(_0x3cc59e[_0x3c1c('0x11')](0x1f5,_0x3c1c('0x6b')));}});},'Agents':function(_0x352e44){return new Promise(function(_0x3c919c,_0xbe3f29){var _0x418797=_[_0x3c1c('0x55')](_0x4a540[_0x3c1c('0xd')]);_0x3c919c({'count':_0x418797[_0x3c1c('0x54')],'rows':_0x418797});});},'Telephones':function(_0x42b793){return new Promise(function(_0x2bbd5b,_0x13d001){var _0x3e4bc8=_[_0x3c1c('0x55')](_0x4a540[_0x3c1c('0x78')]);_0x2bbd5b({'count':_0x3e4bc8[_0x3c1c('0x54')],'rows':_0x3e4bc8});});},'Trunks':function(_0x5ed13c){return new Promise(function(_0x216b43,_0x57a3c1){var _0x54db39=_[_0x3c1c('0x55')](_0x4a540['trunks']);_0x216b43({'count':_0x54db39[_0x3c1c('0x54')],'rows':_0x54db39});});},'OutboundChannels':function(_0x5028d9){return new Promise(function(_0x59a1d5,_0x339615){var _0x5f4e41=_[_0x3c1c('0x55')](_0x4a540['outboundChannels']);_0x59a1d5({'count':_0x5f4e41['length'],'rows':_0x5f4e41});});},'Outbound':function(_0x4e9550){return new Promise(function(_0x51f6b7,_0x36d71b){_0x51f6b7(_0x4a540[_0x3c1c('0x79')]);});},'Campaigns':function(_0x17d79e){return new Promise(function(_0x446a76,_0x598ddd){var _0x1ebfa4=_[_0x3c1c('0x55')](_0x4a540[_0x3c1c('0x7a')]);_0x446a76({'count':_0x1ebfa4[_0x3c1c('0x54')],'rows':_0x1ebfa4});});},'VoiceQueuesPreview':function(_0x41cec2){var _0x5caec1=this;return new Promise(function(_0x46e927,_0x529f50){_0x540bef['run'](_0x41cec2['id'])[_0x3c1c('0x19')](function(_0x529958){_0x46e927({'code':0xc8,'message':_0x529958[_0x3c1c('0x1b')]});})[_0x3c1c('0x1a')](function(_0x1a37b2){_0x529f50(_0x5caec1[_0x3c1c('0x11')](0x1f4,_0x1a37b2['message']));});});},'EventManager':function(_0x207831){var _0x35c03e=this;return new Promise(function(_0x554134,_0x577694){if(!_0x207831[_0x3c1c('0x7b')]){return _0x577694(_0x35c03e[_0x3c1c('0x11')](0x1f4,_0x3c1c('0x7c')));}ami[_0x3c1c('0x7d')](_0x3c1c('0x7e')+_0x207831[_0x3c1c('0x7b')],_0x207831['message']);_0x554134({'code':0xc8,'message':_0x207831});});},'FaxAccounts':function(_0x185472){return new Promise(function(_0x5475e2,_0x13a782){var _0x45a3db=_['values'](_0x4a540[_0x3c1c('0x7f')]);_0x5475e2({'count':_0x45a3db[_0x3c1c('0x54')],'rows':_0x45a3db});});},'SendFax':function(_0x5a0110){var _0x32aec2=this;return new Promise(function(_0x481b0a,_0x548913){_0x16f1dd[_0x3c1c('0x80')](_0x5a0110)[_0x3c1c('0x19')](function(_0x1e59e7){_0x481b0a({'code':0xc8,'message':_0x1e59e7[_0x3c1c('0x1b')]});})[_0x3c1c('0x1a')](function(_0xc83201){_0x548913(_0x32aec2[_0x3c1c('0x11')](0x1f4,_0xc83201['message']));});});},'CheckAfterSend':function(_0x50846f){var _0x3374ac=this;return new Promise(function(_0x75a270,_0x3890bb){_0x16f1dd[_0x3c1c('0x81')](_0x50846f)[_0x3c1c('0x19')](function(_0x515fe1){_0x75a270({'code':0xc8,'message':_0x515fe1[_0x3c1c('0x1b')]});})[_0x3c1c('0x1a')](function(_0x8433c9){_0x3890bb(_0x3374ac['error'](0x1f4,_0x8433c9[_0x3c1c('0x1b')]));});});}};var _0xed8973=jayson[_0x3c1c('0x82')](_0x4eadc3)[_0x3c1c('0x83')]();_0xed8973['on'](_0x3c1c('0x11'),function(_0x1cab01){return _0x2a6784(_0x1cab01);});_0xed8973[_0x3c1c('0x8')](0x232a,_0x3c1c('0x84'),function(){console['log'](_0x3c1c('0x85'),0x232a);return _0xc99c4c(_0x3c1c('0x86')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 7e974cc..f3c4427 100644 --- a/server/services/ami/trigger/cmContact/index.js +++ b/server/services/ami/trigger/cmContact/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2432=['../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','','destcalleridname','destcalleridnum','uniqueid','phone','resolve','then','showContact','omit','format','user:%s','name','trigger:%s','action','toLowerCase','merge','createContact','xmd-contactid2','catch','Error\x20creating\x20contact','bluebird','util','lodash','ioredis'];(function(_0x4abb92,_0x30d0e4){var _0x2d888d=function(_0x1d6435){while(--_0x1d6435){_0x4abb92['push'](_0x4abb92['shift']());}};_0x2d888d(++_0x30d0e4);}(_0x2432,0x7a));var _0x2243=function(_0x579dea,_0x18d865){_0x579dea=_0x579dea-0x0;var _0x4e53b4=_0x2432[_0x579dea];return _0x4e53b4;};'use strict';var BPromise=require(_0x2243('0x0'));var util=require(_0x2243('0x1'));var _=require(_0x2243('0x2'));var Redis=require(_0x2243('0x3'));var config=require('../../../../config/environment');var logger=require(_0x2243('0x4'))('trigger');var cmContactRpc=require(_0x2243('0x5'));config[_0x2243('0x6')]=_[_0x2243('0x7')](config[_0x2243('0x6')],{'host':_0x2243('0x8'),'port':0x18eb});var io=require(_0x2243('0x9'))(new Redis(config[_0x2243('0x6')]));function emit(_0x28678a,_0x1c42af,_0x4f196b){logger[_0x2243('0xa')](_0x28678a,_0x1c42af,JSON[_0x2243('0xb')](_0x4f196b));io['to'](_0x28678a)[_0x2243('0xc')](_0x1c42af,_0x4f196b);}exports[_0x2243('0xd')]=function(_0x31a479,_0x3cf586,_0x2af366){_0x2af366[_0x2243('0xe')]=0x0;if(_0x3cf586[_0x2243('0xf')]&&parseInt(_0x3cf586[_0x2243('0xf')],0xa)){var _0x2aa089={'ListId':parseInt(_0x3cf586[_0x2243('0x10')],0xa),'phone':_0x2af366[_0x2243('0x11')]};if(_[_0x2243('0x12')](_0x2af366[_0x2243('0x13')])){_0x2aa089[_0x2243('0x14')]=_0x2af366['calleridname']&&_0x2af366[_0x2243('0x15')]!==_0x2243('0x16')?_0x2af366[_0x2243('0x15')]:_0x2af366[_0x2243('0x11')]||_0x2af366['uniqueid'];}else{_0x2aa089[_0x2243('0x14')]=_0x2af366['destcalleridname']&&_0x2af366[_0x2243('0x17')]!==''?_0x2af366[_0x2243('0x17')]:_0x2af366[_0x2243('0x18')]||_0x2af366[_0x2243('0x19')];_0x2aa089[_0x2243('0x1a')]=_0x2af366['destcalleridname']&&_0x2af366['destcalleridname']!==_0x2243('0x16')?_0x2af366[_0x2243('0x17')]:_0x2af366[_0x2243('0x18')]||_0x2af366[_0x2243('0x19')];}BPromise[_0x2243('0x1b')]()[_0x2243('0x1c')](cmContactRpc[_0x2243('0x1d')]({'where':_[_0x2243('0x1e')](_0x2aa089,[_0x2243('0x14')])}))[_0x2243('0x1c')](function(_0x24cdfa){if(_0x24cdfa){_0x2af366['xmd-contactid2']=_0x24cdfa['id'];emit(util[_0x2243('0x1f')](_0x2243('0x20'),_0x31a479[_0x2243('0x21')]),util['format'](_0x2243('0x22'),_0x3cf586[_0x2243('0x23')][_0x2243('0x24')]()),_[_0x2243('0x25')](_0x2af366,{'ListId':parseInt(_0x3cf586[_0x2243('0x10')],0xa)}));return;}else{return BPromise[_0x2243('0x1b')]()['then'](cmContactRpc[_0x2243('0x26')](_0x2aa089));}})[_0x2243('0x1c')](function(_0x474590){if(_0x474590){_0x2af366[_0x2243('0x27')]=_0x474590['id'];emit(util[_0x2243('0x1f')](_0x2243('0x20'),_0x31a479['name']),util[_0x2243('0x1f')](_0x2243('0x22'),_0x3cf586[_0x2243('0x23')][_0x2243('0x24')]()),_[_0x2243('0x25')](_0x2af366,{'ListId':parseInt(_0x3cf586['data1'],0xa)}));}})[_0x2243('0x28')](function(_0x4d5935){logger['error'](_0x2243('0x29'),JSON[_0x2243('0xb')](_0x4d5935));});}else{if(_0x31a479){emit(util['format'](_0x2243('0x20'),_0x31a479[_0x2243('0x21')]),util['format'](_0x2243('0x22'),_0x3cf586[_0x2243('0x23')][_0x2243('0x24')]()),_[_0x2243('0x25')]({'ListId':parseInt(_0x3cf586['data1'],0xa)},_0x2af366));}}}; \ No newline at end of file +var _0x186d=['then','showContact','xmd-contactid2','format','trigger:%s','action','toLowerCase','merge','createContact','user:%s','data1','catch','error','Error\x20creating\x20contact','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','info','stringify','emit','autoCreate','data2','calleridnum','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','resolve'];(function(_0x2160d6,_0x173436){var _0xe5b810=function(_0x2fe84c){while(--_0x2fe84c){_0x2160d6['push'](_0x2160d6['shift']());}};_0xe5b810(++_0x173436);}(_0x186d,0x1ca));var _0xd186=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0x186d[_0x378b4];return _0x11d07b;};'use strict';var BPromise=require('bluebird');var util=require(_0xd186('0x0'));var _=require(_0xd186('0x1'));var Redis=require(_0xd186('0x2'));var config=require(_0xd186('0x3'));var logger=require(_0xd186('0x4'))(_0xd186('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0xd186('0x6')]=_[_0xd186('0x7')](config[_0xd186('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd186('0x6')]));function emit(_0x60fc96,_0x2ecccd,_0x4970a3){logger[_0xd186('0x8')](_0x60fc96,_0x2ecccd,JSON[_0xd186('0x9')](_0x4970a3));io['to'](_0x60fc96)[_0xd186('0xa')](_0x2ecccd,_0x4970a3);}exports['exec']=function(_0x1ef64a,_0x434a4b,_0x2d9f08){_0x2d9f08[_0xd186('0xb')]=0x0;if(_0x434a4b[_0xd186('0xc')]&&parseInt(_0x434a4b[_0xd186('0xc')],0xa)){var _0x5a01f1={'ListId':parseInt(_0x434a4b['data1'],0xa),'phone':_0x2d9f08[_0xd186('0xd')]};if(_['isNil'](_0x2d9f08[_0xd186('0xe')])){_0x5a01f1[_0xd186('0xf')]=_0x2d9f08[_0xd186('0x10')]&&_0x2d9f08['calleridname']!==_0xd186('0x11')?_0x2d9f08['calleridname']:_0x2d9f08[_0xd186('0xd')]||_0x2d9f08[_0xd186('0x12')];}else{_0x5a01f1[_0xd186('0xf')]=_0x2d9f08[_0xd186('0x13')]&&_0x2d9f08[_0xd186('0x13')]!==_0xd186('0x11')?_0x2d9f08[_0xd186('0x13')]:_0x2d9f08[_0xd186('0x14')]||_0x2d9f08[_0xd186('0x12')];_0x5a01f1[_0xd186('0x15')]=_0x2d9f08[_0xd186('0x13')]&&_0x2d9f08['destcalleridname']!==_0xd186('0x11')?_0x2d9f08[_0xd186('0x13')]:_0x2d9f08[_0xd186('0x14')]||_0x2d9f08[_0xd186('0x12')];}BPromise[_0xd186('0x16')]()[_0xd186('0x17')](cmContactRpc[_0xd186('0x18')]({'where':_['omit'](_0x5a01f1,[_0xd186('0xf')])}))[_0xd186('0x17')](function(_0x5471ff){if(_0x5471ff){_0x2d9f08[_0xd186('0x19')]=_0x5471ff['id'];emit(util[_0xd186('0x1a')]('user:%s',_0x1ef64a['name']),util[_0xd186('0x1a')](_0xd186('0x1b'),_0x434a4b[_0xd186('0x1c')][_0xd186('0x1d')]()),_[_0xd186('0x1e')](_0x2d9f08,{'ListId':parseInt(_0x434a4b['data1'],0xa)}));return;}else{return BPromise[_0xd186('0x16')]()[_0xd186('0x17')](cmContactRpc[_0xd186('0x1f')](_0x5a01f1));}})['then'](function(_0x5551a2){if(_0x5551a2){_0x2d9f08[_0xd186('0x19')]=_0x5551a2['id'];emit(util[_0xd186('0x1a')](_0xd186('0x20'),_0x1ef64a['name']),util['format'](_0xd186('0x1b'),_0x434a4b[_0xd186('0x1c')]['toLowerCase']()),_['merge'](_0x2d9f08,{'ListId':parseInt(_0x434a4b[_0xd186('0x21')],0xa)}));}})[_0xd186('0x22')](function(_0x3c0a37){logger[_0xd186('0x23')](_0xd186('0x24'),JSON[_0xd186('0x9')](_0x3c0a37));});}else{if(_0x1ef64a){emit(util[_0xd186('0x1a')]('user:%s',_0x1ef64a['name']),util[_0xd186('0x1a')](_0xd186('0x1b'),_0x434a4b[_0xd186('0x1c')][_0xd186('0x1d')]()),_[_0xd186('0x1e')]({'ListId':parseInt(_0x434a4b['data1'],0xa)},_0x2d9f08));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index e1cf4e9..26ba15c 100644 --- a/server/services/ami/trigger/index.js +++ b/server/services/ami/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b6e=['custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','clone','checkTriggers','interface','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','motionbar','browser','data1','TemplateId','data2','html','templates','render','template\x20not\x20found','uri','buildUri','data3','data4','location','uriLocation','windowWidth','isNil','data5','800','windowHeight','data6','600','winapp','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','trigger:%s','contactmanager','exec','integration','accounts','routeId','urlforward','script','parse','query','replace','AllConditions','every','checkConditions','channel','some','AnyConditions','field','account','chat','ChatWebsiteId','value','upperFirst','message','event','operator','queue','membername','lastevent','exports','util','url','ioredis','./urlforward','./integration','../rpc/cmContact','../../../config/environment','trigger','../ami','redis','socket.io-emitter','popup','triggers','agents','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','zohoAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage'];(function(_0x6ba327,_0x4a2dbe){var _0x30ea5b=function(_0xd6c787){while(--_0xd6c787){_0x6ba327['push'](_0x6ba327['shift']());}};_0x30ea5b(++_0x4a2dbe);}(_0x3b6e,0xbe));var _0xe3b6=function(_0x58c969,_0x488be6){_0x58c969=_0x58c969-0x0;var _0x2f16c8=_0x3b6e[_0x58c969];return _0x2f16c8;};'use strict';var util=require(_0xe3b6('0x0'));var _=require('lodash');var url=require(_0xe3b6('0x1'));var Mustache=require('mustache');var Redis=require(_0xe3b6('0x2'));var urlforward=require(_0xe3b6('0x3'));var integration=require(_0xe3b6('0x4'));var cmContact=require('./cmContact');var script=require('./script');var cmContactRpc=require(_0xe3b6('0x5'));var config=require(_0xe3b6('0x6'));var logger=require('../../../config/logger')(_0xe3b6('0x7'));var ami=require(_0xe3b6('0x8'));config[_0xe3b6('0x9')]=_['defaults'](config[_0xe3b6('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xe3b6('0xa'))(new Redis(config[_0xe3b6('0x9')]));var operators={'equals':function(_0x5a05d1,_0x3208ce){return _0x5a05d1==_0x3208ce;},'not_equals':function(_0x401c1f,_0x169e27){return _0x401c1f!=_0x169e27;}};var barAndWebActions=[_0xe3b6('0xb'),'url','winapp'];function Trigger(_0x24ee19){this[_0xe3b6('0xc')]=_0x24ee19['triggers'];this[_0xe3b6('0xd')]=_0x24ee19[_0xe3b6('0xd')];this[_0xe3b6('0xe')]=_0x24ee19[_0xe3b6('0xe')];this['templates']=_0x24ee19['templates'];this[_0xe3b6('0xf')]=_0x24ee19['voiceExtensions'];this[_0xe3b6('0x10')]=_0x24ee19['zendeskAccounts'];this['freshdeskAccounts']=_0x24ee19[_0xe3b6('0x11')];this[_0xe3b6('0x12')]=_0x24ee19[_0xe3b6('0x12')];this[_0xe3b6('0x13')]=_0x24ee19[_0xe3b6('0x13')];this['zohoAccounts']=_0x24ee19['zohoAccounts'];this['deskAccounts']=_0x24ee19[_0xe3b6('0x14')];this[_0xe3b6('0x15')]=_0x24ee19[_0xe3b6('0x15')];this[_0xe3b6('0x16')]=_0x24ee19[_0xe3b6('0x16')];this[_0xe3b6('0x17')]=_0x24ee19[_0xe3b6('0x17')];this['accounts']={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xe3b6('0x12')],'freshdesk':this[_0xe3b6('0x11')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xe3b6('0x18')],'desk':this[_0xe3b6('0x14')],'vtiger':this['vtigerAccounts'],'servicenow':this[_0xe3b6('0x16')],'dynamics365':this['dynamics365Accounts']};ami['on'](_0xe3b6('0x19'),this[_0xe3b6('0x1a')][_0xe3b6('0x1b')](this));ami['on'](_0xe3b6('0x1c'),this['syncCustomEvent'][_0xe3b6('0x1b')](this));ami['on'](_0xe3b6('0x1d'),this[_0xe3b6('0x1a')][_0xe3b6('0x1b')](this));ami['on']('custom:agentcomplete',this[_0xe3b6('0x1a')][_0xe3b6('0x1b')](this));ami['on'](_0xe3b6('0x1e'),this['syncCustomEvent'][_0xe3b6('0x1b')](this));ami['on'](_0xe3b6('0x1f'),this[_0xe3b6('0x20')][_0xe3b6('0x1b')](this));ami['on'](_0xe3b6('0x21'),this[_0xe3b6('0x20')][_0xe3b6('0x1b')](this));ami['on'](_0xe3b6('0x22'),this['syncAgentDial'][_0xe3b6('0x1b')](this));ami['on'](_0xe3b6('0x23'),this[_0xe3b6('0x1a')][_0xe3b6('0x1b')](this));ami['on'](_0xe3b6('0x24'),this[_0xe3b6('0x1a')]['bind'](this));ami['on'](_0xe3b6('0x25'),this[_0xe3b6('0x1a')][_0xe3b6('0x1b')](this));ami['on'](_0xe3b6('0x26'),this[_0xe3b6('0x1a')]['bind'](this));ami['on'](_0xe3b6('0x27'),this[_0xe3b6('0x1a')]['bind'](this));ami['on'](_0xe3b6('0x28'),this[_0xe3b6('0x1a')][_0xe3b6('0x1b')](this));}Trigger[_0xe3b6('0x29')][_0xe3b6('0x2a')]=function(_0x34920d,_0x4fe9fa,_0x286afc){logger[_0xe3b6('0x2b')](_0x34920d,_0x4fe9fa,JSON['stringify'](_0x286afc));io['to'](_0x34920d)[_0xe3b6('0x2a')](_0x4fe9fa,_0x286afc);};Trigger[_0xe3b6('0x29')]['syncCustomEvent']=function(_0x229b49){var _0x238258=_[_0xe3b6('0x2c')](_0x229b49);this[_0xe3b6('0x2d')](_0x238258);};Trigger[_0xe3b6('0x29')][_0xe3b6('0x20')]=function(_0x2048b4){if(this['agents'][_0x2048b4[_0xe3b6('0x2e')]]){this[_0xe3b6('0x1a')](_0x2048b4);}};Trigger[_0xe3b6('0x29')]['checkTriggers']=function(_0x5aa611){var _0x4597aa;for(var _0x15e7e3 in this['triggers']){if(this[_0xe3b6('0xc')]['hasOwnProperty'](_0x15e7e3)){if(this[_0xe3b6('0xc')][_0x15e7e3][_0xe3b6('0x2f')]){_0x4597aa=this[_0xe3b6('0x30')](this[_0xe3b6('0xc')][_0x15e7e3],_0x5aa611);if(_0x4597aa){_[_0xe3b6('0x31')](_0x5aa611,_0x5aa611[_0xe3b6('0x32')]);for(var _0x211abe=0x0,_0x5440e9,_0x28c3cc,_0x3d8a51;_0x211abe0x0){_0x2a2e9c=_[_0xa1c9('0x27')](_0x4ca1d7,_0x242a43);}return _0x2a2e9c;}function getCustomFields(_0x48ce34,_0xdf6d0c){var _0x2404c3=[];var _0x88ba11={'custom_fields':{}};if(_0x48ce34[_0xa1c9('0x28')]>0x0){_[_0xa1c9('0x29')](_0x48ce34,function(_0xe8523b){if(_0xe8523b[_0xa1c9('0x2a')]===_0xa1c9('0x2b')&&_0xe8523b['nameField']&&!_0xe8523b['customField']){_0x88ba11[_0xe8523b[_0xa1c9('0x2c')][_0xa1c9('0x2d')]()]=_0xe8523b[_0xa1c9('0x2e')][_0xa1c9('0x21')]();}else if(_0xe8523b[_0xa1c9('0x2a')]==='string'&&_0xe8523b['idField']&&_0xe8523b['customField']){_0x88ba11[_0xa1c9('0x2f')][_0xe8523b[_0xa1c9('0x30')]]=_0xe8523b[_0xa1c9('0x2e')][_0xa1c9('0x21')]();}else if(_0xe8523b[_0xa1c9('0x2a')]===_0xa1c9('0x31')&&_0xe8523b[_0xa1c9('0x32')]&&_0xe8523b['idField']&&_0xe8523b[_0xa1c9('0x33')]){_0xdf6d0c[_0xe8523b['variableName']]&&(_0x88ba11[_0xa1c9('0x2f')][_0xe8523b['idField']]=_0xdf6d0c[_0xe8523b[_0xa1c9('0x32')]][_0xa1c9('0x21')]());}else if(_0xe8523b[_0xa1c9('0x2a')]==='customVariable'&&_0xe8523b[_0xa1c9('0x34')]&&_0xe8523b[_0xa1c9('0x34')][_0xa1c9('0x35')]&&_0xe8523b[_0xa1c9('0x30')]&&_0xe8523b['customField']){_0xdf6d0c[_0xe8523b['Variable'][_0xa1c9('0x35')][_0xa1c9('0x2d')]()]&&(_0x88ba11[_0xa1c9('0x2f')][_0xe8523b[_0xa1c9('0x30')]]=_0xdf6d0c[_0xe8523b[_0xa1c9('0x34')][_0xa1c9('0x35')][_0xa1c9('0x2d')]()][_0xa1c9('0x21')]());}});}if(_0x88ba11[_0xa1c9('0x36')]){_0x88ba11[_0xa1c9('0x36')]=Number(_0x88ba11['priority']);}return _0x88ba11;}function getTicket(_0x3e6ec0,_0x24dac9,_0x26d098,_0x219f7d,_0x7ff013){logger[_0xa1c9('0xa')]('Creating\x20new\x20ticket...');var _0x2a3ae3=_[_0xa1c9('0x37')]({'subject':intUtil[_0xa1c9('0x38')](_0x219f7d['Subjects'],_0x7ff013,'\x20'),'type':_0xa1c9('0x39'),'status':_0xa1c9('0x3a'),'labels':['xCALLY',_0xa1c9('0x3b'),_0xa1c9('0x3c')]['concat'](getTags(_0x219f7d['Tags'],_0xa1c9('0x35'))),'description':intUtil[_0xa1c9('0x38')](_0x219f7d[_0xa1c9('0x3d')],_0x7ff013,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa1c9('0xc')](_0xa1c9('0x3e'),_0x24dac9['id']),'class':_0xa1c9('0x3f')}},'message':{'direction':'in','body':intUtil[_0xa1c9('0x38')](_0x219f7d[_0xa1c9('0x3d')],_0x7ff013,'\x0a')}},getCustomFields(_0x219f7d[_0xa1c9('0x40')],_0x7ff013));return request({'uri':util[_0xa1c9('0xc')]('%s/customers/%d/cases',_0x3e6ec0['remoteUri'],_0x26d098['id']),'method':_0xa1c9('0x25'),'body':_0x2a3ae3});}exports[_0xa1c9('0x41')]=function(_0x59e938,_0x30ce3b,_0x102a33,_0x43de42,_0x36c846,_0x324884){var _0x3a6de6,_0x3e6dd0;_0x324884[_0xa1c9('0xe')]=intUtil[_0xa1c9('0x42')](_0x324884[_0xa1c9('0xe')]);_0x324884[_0xa1c9('0x43')]=intUtil['stripTrailingSlash'](_0x324884[_0xa1c9('0x43')]);if(_0x36c846&&_0x36c846['monitor_format']){logger[_0xa1c9('0xa')]('[QUEUE]',_0xa1c9('0x44'));_0x30ce3b['recordingURL']=util[_0xa1c9('0xc')](_0xa1c9('0x45'),_0x324884['serverUrl'],_0x30ce3b[_0xa1c9('0x46')],md5(_0x30ce3b[_0xa1c9('0x46')]));}else{_0x30ce3b['recordingURL']='';}headers[_0xa1c9('0x47')]=getAuth(_0x324884);return getUser(_0x324884,_0x43de42[_0xa1c9('0x48')])[_0xa1c9('0xf')](function(_0x5778bd){_0x3a6de6=_0x5778bd;logger[_0xa1c9('0xa')](_0xa1c9('0x49'),_0x3a6de6['id']);return getEndUser(_0x324884,_0x30ce3b['calleridname'],_0x30ce3b[_0xa1c9('0x4a')]);})[_0xa1c9('0xf')](function(_0x239eb2){_0x3e6dd0=_0x239eb2;logger[_0xa1c9('0xa')](_0xa1c9('0x4b'),_0x3e6dd0['id']);return getTicket(_0x324884,_0x3a6de6,_0x3e6dd0,_0x102a33,_0x30ce3b);})['then'](function(_0x577543){if(_0x577543){logger['info'](_0xa1c9('0x4c'));logger[_0xa1c9('0xa')](_0xa1c9('0x4d'),_0x577543['id']);switch(_0x324884['type']){case _0xa1c9('0x4e'):logger[_0xa1c9('0xa')]('[QUEUE]',_0xa1c9('0x4f'));emit(util['format']('user:%s',_0x43de42[_0xa1c9('0x35')]),_0xa1c9('0x50'),{'recordId':_0x577543['id']});break;case _0xa1c9('0x51'):logger[_0xa1c9('0xa')](_0xa1c9('0x52'),_0xa1c9('0x53'));emit(util[_0xa1c9('0xc')](_0xa1c9('0x54'),_0x43de42[_0xa1c9('0x35')]),_0xa1c9('0x55'),{'uri':util[_0xa1c9('0xc')](_0xa1c9('0x56'),_0x577543['id'])});break;default:logger[_0xa1c9('0x57')](_0xa1c9('0x52'),_0xa1c9('0x58'));}}})[_0xa1c9('0x59')](function(_0x1d9387){console[_0xa1c9('0x57')](_0x1d9387);logger[_0xa1c9('0x57')]('[QUEUE]',JSON['stringify'](_0x1d9387));});};exports[_0xa1c9('0x5a')]=function(_0x6160fc,_0x66a5eb,_0xd67fe9,_0x4dc539,_0x449e85,_0x2df20d,_0xe227b2){var _0x580af2,_0x4753ff;_0x2df20d[_0xa1c9('0xe')]=intUtil['stripTrailingSlash'](_0x2df20d['remoteUri']);_0x2df20d[_0xa1c9('0x43')]=intUtil['stripTrailingSlash'](_0x2df20d[_0xa1c9('0x43')]);if(_0xe227b2&&_0xe227b2[_0xa1c9('0x5b')]&&_0xe227b2[_0xa1c9('0x5b')]!=='none'){logger['info'](_0xa1c9('0x5c'),'Recording\x20is\x20enabled!');_0x66a5eb[_0xa1c9('0x5d')]=util['format'](_0xa1c9('0x45'),_0x2df20d[_0xa1c9('0x43')],_0x66a5eb[_0xa1c9('0x46')],md5(_0x66a5eb[_0xa1c9('0x46')]));}headers[_0xa1c9('0x47')]=getAuth(_0x2df20d);return getUser(_0x2df20d,_0x4dc539[_0xa1c9('0x48')])[_0xa1c9('0xf')](function(_0x59e235){_0x580af2=_0x59e235;logger[_0xa1c9('0xa')](_0xa1c9('0x49'),_0x580af2['id']);return getEndUser(_0x2df20d,_0x66a5eb['destcalleridname'],_0x66a5eb['destcalleridnum']);})['then'](function(_0x13eab0){_0x4753ff=_0x13eab0;logger['info'](_0xa1c9('0x4b'),_0x4753ff['id']);return getTicket(_0x2df20d,_0x580af2,_0x4753ff,_0xd67fe9,_0x66a5eb);})[_0xa1c9('0xf')](function(_0x35083d){if(_0x35083d){logger[_0xa1c9('0xa')](_0xa1c9('0x4c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x35083d['id']);switch(_0x2df20d['type']){case'integrationTab':logger[_0xa1c9('0xa')](_0xa1c9('0x52'),_0xa1c9('0x4f'));emit(util[_0xa1c9('0xc')](_0xa1c9('0x54'),_0x4dc539[_0xa1c9('0x35')]),_0xa1c9('0x50'),{'recordId':_0x35083d['id']});break;case _0xa1c9('0x51'):logger[_0xa1c9('0xa')](_0xa1c9('0x52'),_0xa1c9('0x53'));emit(util[_0xa1c9('0xc')](_0xa1c9('0x54'),_0x4dc539[_0xa1c9('0x35')]),'trigger:browser:url',{'uri':util[_0xa1c9('0xc')](_0xa1c9('0x5e'),_0x2df20d[_0xa1c9('0xe')],_0x35083d['id'])});break;default:logger[_0xa1c9('0x57')]('[OUTBOUND]',_0xa1c9('0x58'));}}})[_0xa1c9('0x59')](function(_0x1b2cff){logger[_0xa1c9('0x57')]('[OUTBOUND]',JSON['stringify'](_0x1b2cff));});};exports[_0xa1c9('0x5f')]=function(_0x2a89d2,_0x3be723,_0x2755a2,_0x22b2f8,_0x496869,_0x966f5e){var _0x21abdf,_0x41f1c9;_0x966f5e[_0xa1c9('0xe')]=intUtil['stripTrailingSlash'](_0x966f5e[_0xa1c9('0xe')]);_0x966f5e[_0xa1c9('0x43')]=intUtil[_0xa1c9('0x42')](_0x966f5e['serverUrl']);if(_0x496869&&_0x496869[_0xa1c9('0x60')]){logger[_0xa1c9('0xa')]('[ABANDONED]',_0xa1c9('0x44'));_0x3be723[_0xa1c9('0x5d')]=util[_0xa1c9('0xc')](_0xa1c9('0x45'),_0x966f5e[_0xa1c9('0x43')],_0x3be723[_0xa1c9('0x46')],md5(_0x3be723[_0xa1c9('0x46')]));}else{_0x3be723[_0xa1c9('0x5d')]='';}headers[_0xa1c9('0x47')]=getAuth(_0x966f5e);return getUser(_0x966f5e)[_0xa1c9('0xf')](function(_0x29a271){_0x21abdf=_0x29a271;logger['info'](_0xa1c9('0x49'),_0x21abdf['id']);return getEndUser(_0x966f5e,_0x3be723[_0xa1c9('0x61')],_0x3be723[_0xa1c9('0x4a')]);})[_0xa1c9('0xf')](function(_0x5961aa){_0x41f1c9=_0x5961aa;logger[_0xa1c9('0xa')](_0xa1c9('0x4b'),_0x41f1c9['id']);return getTicket(_0x966f5e,_0x21abdf,_0x41f1c9,_0x2755a2,_0x3be723);})[_0xa1c9('0xf')](function(_0xd32f52){if(_0xd32f52){logger[_0xa1c9('0xa')](_0xa1c9('0x4c'));logger[_0xa1c9('0xa')](_0xa1c9('0x4d'),_0xd32f52['id']);}})[_0xa1c9('0x59')](function(_0x178e47){logger[_0xa1c9('0x57')](_0xa1c9('0x62'),JSON[_0xa1c9('0x17')](_0x178e47));});}; \ No newline at end of file +var _0xd4f4=['%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','integrationTab','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','monitor_format','[ABANDONED]','catch','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','%s:%s','username','password','token','Basic\x20%s','toString','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','forEach','type','string','customField','nameField','toLowerCase','content','variable','variableName','idField','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','CTI','concat','Tags','/api/v2/users/%d','Descriptions','Fields'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x13b159,_0x53de5a){_0x13b159=_0x13b159-0x0;var _0xf182bc=_0xd4f4[_0x13b159];return _0xf182bc;};'use strict';var _=require(_0x4d4f('0x0'));var rp=require(_0x4d4f('0x1'));var md5=require(_0x4d4f('0x2'));var util=require(_0x4d4f('0x3'));var Redis=require(_0x4d4f('0x4'));var intUtil=require(_0x4d4f('0x5'));var config=require(_0x4d4f('0x6'));var logger=require(_0x4d4f('0x7'))(_0x4d4f('0x8'));config[_0x4d4f('0x9')]=_[_0x4d4f('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4d4f('0x9')]));function emit(_0xecc103,_0x150bd6,_0xea29b){io['to'](_0xecc103)[_0x4d4f('0xb')](_0x150bd6,_0xea29b);}var headers={'Content-Type':_0x4d4f('0xc'),'Accept':_0x4d4f('0xc')};function getUser(_0x226837,_0x385597){if(intUtil[_0x4d4f('0xd')](_0x385597)===!![]){logger[_0x4d4f('0xe')](_0x4d4f('0xf'),_0x385597);return request({'uri':util[_0x4d4f('0x10')](_0x4d4f('0x11'),_0x226837[_0x4d4f('0x12')])})[_0x4d4f('0x13')](function(_0x5017f0){if(_0x5017f0[_0x4d4f('0x14')]){return _['find'](_0x5017f0['_embedded']['entries'],{'email':_0x385597});}})[_0x4d4f('0x13')](function(_0xe9b7a6){if(_0xe9b7a6){logger['info'](_0x4d4f('0x15'));return _0xe9b7a6;}else{logger[_0x4d4f('0xe')](_0x4d4f('0x16'));return request({'uri':util['format'](_0x4d4f('0x17'),_0x226837[_0x4d4f('0x12')])});}});}else{logger[_0x4d4f('0xe')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x4d4f('0x10')]('%s/users/me',_0x226837[_0x4d4f('0x12')])});}}function request(_0x16f8e7){logger[_0x4d4f('0x18')]('[HTTP]',JSON[_0x4d4f('0x19')](_0x16f8e7));return rp(_[_0x4d4f('0xa')](_0x16f8e7,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x5dbbeb){var _0x519501;if(_0x5dbbeb['authType']==='basic'){_0x519501=util[_0x4d4f('0x10')](_0x4d4f('0x1a'),_0x5dbbeb[_0x4d4f('0x1b')],_0x5dbbeb[_0x4d4f('0x1c')]);}else if(_0x5dbbeb['authType']==='token'){_0x519501=util[_0x4d4f('0x10')]('%s/token:%s',_0x5dbbeb[_0x4d4f('0x1b')],_0x5dbbeb[_0x4d4f('0x1d')]);}return util[_0x4d4f('0x10')](_0x4d4f('0x1e'),new Buffer(_0x519501)[_0x4d4f('0x1f')]('base64'));}function getEndUser(_0x570520,_0x4043f2,_0x581c07){logger[_0x4d4f('0xe')](_0x4d4f('0x20'),_0x581c07);return request({'uri':util[_0x4d4f('0x10')](_0x4d4f('0x21'),_0x570520[_0x4d4f('0x12')]),'qs':{'phone':_0x581c07}})['then'](function(_0x44bd2f){if(_0x44bd2f[_0x4d4f('0x14')]){logger[_0x4d4f('0xe')](_0x4d4f('0x22'));return _0x44bd2f['_embedded']['entries'][0x0];}else{logger[_0x4d4f('0xe')](_0x4d4f('0x23'));return request({'uri':util[_0x4d4f('0x10')](_0x4d4f('0x24'),_0x570520['remoteUri']),'method':_0x4d4f('0x25'),'body':{'first_name':_0x4043f2,'title':_0x4043f2,'phone_numbers':[{'type':_0x4d4f('0x26'),'value':_0x581c07}]}});}});}function getTags(_0x388593,_0x2e91b2){var _0x4effb1=[];if(_0x388593&&_0x388593[_0x4d4f('0x27')]>0x0){_0x4effb1=_['map'](_0x388593,_0x2e91b2);}return _0x4effb1;}function getCustomFields(_0x1688bb,_0x333a40){var _0x550040=[];var _0x2768f1={'custom_fields':{}};if(_0x1688bb[_0x4d4f('0x27')]>0x0){_[_0x4d4f('0x28')](_0x1688bb,function(_0x3d7f14){if(_0x3d7f14[_0x4d4f('0x29')]===_0x4d4f('0x2a')&&_0x3d7f14['nameField']&&!_0x3d7f14[_0x4d4f('0x2b')]){_0x2768f1[_0x3d7f14[_0x4d4f('0x2c')][_0x4d4f('0x2d')]()]=_0x3d7f14[_0x4d4f('0x2e')][_0x4d4f('0x1f')]();}else if(_0x3d7f14['type']===_0x4d4f('0x2a')&&_0x3d7f14['idField']&&_0x3d7f14[_0x4d4f('0x2b')]){_0x2768f1['custom_fields'][_0x3d7f14['idField']]=_0x3d7f14['content'][_0x4d4f('0x1f')]();}else if(_0x3d7f14['type']===_0x4d4f('0x2f')&&_0x3d7f14[_0x4d4f('0x30')]&&_0x3d7f14[_0x4d4f('0x31')]&&_0x3d7f14['customField']){_0x333a40[_0x3d7f14[_0x4d4f('0x30')]]&&(_0x2768f1[_0x4d4f('0x32')][_0x3d7f14[_0x4d4f('0x31')]]=_0x333a40[_0x3d7f14['variableName']][_0x4d4f('0x1f')]());}else if(_0x3d7f14['type']===_0x4d4f('0x33')&&_0x3d7f14[_0x4d4f('0x34')]&&_0x3d7f14[_0x4d4f('0x34')][_0x4d4f('0x35')]&&_0x3d7f14[_0x4d4f('0x31')]&&_0x3d7f14[_0x4d4f('0x2b')]){_0x333a40[_0x3d7f14[_0x4d4f('0x34')][_0x4d4f('0x35')]['toLowerCase']()]&&(_0x2768f1['custom_fields'][_0x3d7f14[_0x4d4f('0x31')]]=_0x333a40[_0x3d7f14['Variable']['name'][_0x4d4f('0x2d')]()][_0x4d4f('0x1f')]());}});}if(_0x2768f1[_0x4d4f('0x36')]){_0x2768f1[_0x4d4f('0x36')]=Number(_0x2768f1[_0x4d4f('0x36')]);}return _0x2768f1;}function getTicket(_0x56eed8,_0x12c512,_0x27466f,_0x5cc3e7,_0x32af9a){logger[_0x4d4f('0xe')](_0x4d4f('0x37'));var _0x42f9ed=_[_0x4d4f('0x38')]({'subject':intUtil[_0x4d4f('0x39')](_0x5cc3e7[_0x4d4f('0x3a')],_0x32af9a,'\x20'),'type':_0x4d4f('0x3b'),'status':_0x4d4f('0x3c'),'labels':['xCALLY','Motion',_0x4d4f('0x3d')][_0x4d4f('0x3e')](getTags(_0x5cc3e7[_0x4d4f('0x3f')],_0x4d4f('0x35'))),'description':intUtil['getString'](_0x5cc3e7['Descriptions'],_0x32af9a,'\x0a'),'_links':{'assigned_user':{'href':util[_0x4d4f('0x10')](_0x4d4f('0x40'),_0x12c512['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x5cc3e7[_0x4d4f('0x41')],_0x32af9a,'\x0a')}},getCustomFields(_0x5cc3e7[_0x4d4f('0x42')],_0x32af9a));return request({'uri':util['format'](_0x4d4f('0x43'),_0x56eed8[_0x4d4f('0x12')],_0x27466f['id']),'method':_0x4d4f('0x25'),'body':_0x42f9ed});}exports[_0x4d4f('0x44')]=function(_0x2cc703,_0x587e6e,_0x2b274e,_0x4c7c24,_0x45a0c1,_0x5e4839){var _0x5677c5,_0x14a8f5;_0x5e4839[_0x4d4f('0x12')]=intUtil[_0x4d4f('0x45')](_0x5e4839['remoteUri']);_0x5e4839[_0x4d4f('0x46')]=intUtil['stripTrailingSlash'](_0x5e4839[_0x4d4f('0x46')]);if(_0x45a0c1&&_0x45a0c1['monitor_format']){logger[_0x4d4f('0xe')](_0x4d4f('0x47'),_0x4d4f('0x48'));_0x587e6e[_0x4d4f('0x49')]=util[_0x4d4f('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e4839['serverUrl'],_0x587e6e[_0x4d4f('0x4a')],md5(_0x587e6e[_0x4d4f('0x4a')]));}else{_0x587e6e[_0x4d4f('0x49')]='';}headers[_0x4d4f('0x4b')]=getAuth(_0x5e4839);return getUser(_0x5e4839,_0x4c7c24['email'])['then'](function(_0x59b4a2){_0x5677c5=_0x59b4a2;logger[_0x4d4f('0xe')](_0x4d4f('0x4c'),_0x5677c5['id']);return getEndUser(_0x5e4839,_0x587e6e[_0x4d4f('0x4d')],_0x587e6e[_0x4d4f('0x4e')]);})[_0x4d4f('0x13')](function(_0x29cb5d){_0x14a8f5=_0x29cb5d;logger[_0x4d4f('0xe')](_0x4d4f('0x4f'),_0x14a8f5['id']);return getTicket(_0x5e4839,_0x5677c5,_0x14a8f5,_0x2b274e,_0x587e6e);})[_0x4d4f('0x13')](function(_0x31d576){if(_0x31d576){logger[_0x4d4f('0xe')](_0x4d4f('0x50'));logger['info'](_0x4d4f('0x51'),_0x31d576['id']);switch(_0x5e4839[_0x4d4f('0x29')]){case'integrationTab':logger[_0x4d4f('0xe')]('[QUEUE]',_0x4d4f('0x52'));emit(util[_0x4d4f('0x10')]('user:%s',_0x4c7c24[_0x4d4f('0x35')]),_0x4d4f('0x53'),{'recordId':_0x31d576['id']});break;case _0x4d4f('0x54'):logger[_0x4d4f('0xe')](_0x4d4f('0x47'),_0x4d4f('0x55'));emit(util[_0x4d4f('0x10')](_0x4d4f('0x56'),_0x4c7c24[_0x4d4f('0x35')]),_0x4d4f('0x57'),{'uri':util[_0x4d4f('0x10')](_0x4d4f('0x58'),_0x31d576['id'])});break;default:logger['error'](_0x4d4f('0x47'),'Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x57af44){console[_0x4d4f('0x59')](_0x57af44);logger[_0x4d4f('0x59')]('[QUEUE]',JSON['stringify'](_0x57af44));});};exports[_0x4d4f('0x5a')]=function(_0x4c80c4,_0x5adc7b,_0x3191b1,_0x528573,_0x17b59e,_0x3626e6,_0x54c8b7){var _0x2c29e0,_0x58b743;_0x3626e6[_0x4d4f('0x12')]=intUtil[_0x4d4f('0x45')](_0x3626e6[_0x4d4f('0x12')]);_0x3626e6[_0x4d4f('0x46')]=intUtil[_0x4d4f('0x45')](_0x3626e6['serverUrl']);if(_0x54c8b7&&_0x54c8b7[_0x4d4f('0x5b')]&&_0x54c8b7['recordingFormat']!==_0x4d4f('0x5c')){logger['info'](_0x4d4f('0x5d'),_0x4d4f('0x48'));_0x5adc7b['recordingURL']=util[_0x4d4f('0x10')](_0x4d4f('0x5e'),_0x3626e6['serverUrl'],_0x5adc7b[_0x4d4f('0x4a')],md5(_0x5adc7b['uniqueid']));}headers[_0x4d4f('0x4b')]=getAuth(_0x3626e6);return getUser(_0x3626e6,_0x528573['email'])['then'](function(_0x151745){_0x2c29e0=_0x151745;logger[_0x4d4f('0xe')](_0x4d4f('0x4c'),_0x2c29e0['id']);return getEndUser(_0x3626e6,_0x5adc7b[_0x4d4f('0x5f')],_0x5adc7b[_0x4d4f('0x60')]);})['then'](function(_0x4aff5e){_0x58b743=_0x4aff5e;logger[_0x4d4f('0xe')]('The\x20Enduser\x20ID\x20is:',_0x58b743['id']);return getTicket(_0x3626e6,_0x2c29e0,_0x58b743,_0x3191b1,_0x5adc7b);})[_0x4d4f('0x13')](function(_0xadc9ac){if(_0xadc9ac){logger[_0x4d4f('0xe')](_0x4d4f('0x50'));logger[_0x4d4f('0xe')](_0x4d4f('0x51'),_0xadc9ac['id']);switch(_0x3626e6['type']){case _0x4d4f('0x61'):logger[_0x4d4f('0xe')](_0x4d4f('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x4d4f('0x10')](_0x4d4f('0x56'),_0x528573[_0x4d4f('0x35')]),'trigger:desk:display',{'recordId':_0xadc9ac['id']});break;case _0x4d4f('0x54'):logger['info'](_0x4d4f('0x47'),_0x4d4f('0x55'));emit(util[_0x4d4f('0x10')](_0x4d4f('0x56'),_0x528573[_0x4d4f('0x35')]),_0x4d4f('0x57'),{'uri':util[_0x4d4f('0x10')](_0x4d4f('0x62'),_0x3626e6[_0x4d4f('0x12')],_0xadc9ac['id'])});break;default:logger['error'](_0x4d4f('0x5d'),_0x4d4f('0x63'));}}})['catch'](function(_0x1bd4b1){logger[_0x4d4f('0x59')](_0x4d4f('0x5d'),JSON[_0x4d4f('0x19')](_0x1bd4b1));});};exports['abandoned']=function(_0x4013a9,_0xb2a9e6,_0x5995f2,_0x4d979a,_0x55552d,_0x2defe0){var _0x53b2db,_0x4b9b15;_0x2defe0['remoteUri']=intUtil[_0x4d4f('0x45')](_0x2defe0[_0x4d4f('0x12')]);_0x2defe0['serverUrl']=intUtil[_0x4d4f('0x45')](_0x2defe0[_0x4d4f('0x46')]);if(_0x55552d&&_0x55552d[_0x4d4f('0x64')]){logger[_0x4d4f('0xe')](_0x4d4f('0x65'),_0x4d4f('0x48'));_0xb2a9e6[_0x4d4f('0x49')]=util[_0x4d4f('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2defe0[_0x4d4f('0x46')],_0xb2a9e6['uniqueid'],md5(_0xb2a9e6[_0x4d4f('0x4a')]));}else{_0xb2a9e6[_0x4d4f('0x49')]='';}headers[_0x4d4f('0x4b')]=getAuth(_0x2defe0);return getUser(_0x2defe0)['then'](function(_0x5a6a40){_0x53b2db=_0x5a6a40;logger[_0x4d4f('0xe')](_0x4d4f('0x4c'),_0x53b2db['id']);return getEndUser(_0x2defe0,_0xb2a9e6[_0x4d4f('0x4d')],_0xb2a9e6['calleridnum']);})[_0x4d4f('0x13')](function(_0x4bf7bd){_0x4b9b15=_0x4bf7bd;logger[_0x4d4f('0xe')]('The\x20Enduser\x20ID\x20is:',_0x4b9b15['id']);return getTicket(_0x2defe0,_0x53b2db,_0x4b9b15,_0x5995f2,_0xb2a9e6);})['then'](function(_0x194874){if(_0x194874){logger[_0x4d4f('0xe')]('Ticket\x20created!');logger[_0x4d4f('0xe')]('The\x20Ticket\x20ID\x20is:',_0x194874['id']);}})[_0x4d4f('0x66')](function(_0x4420f0){logger[_0x4d4f('0x59')](_0x4d4f('0x65'),JSON['stringify'](_0x4420f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index e9ef34b..ef5c238 100644 --- a/server/services/ami/trigger/integration/dynamics365.js +++ b/server/services/ami/trigger/integration/dynamics365.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x74d3=['email','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId','destcalleridnum','calleridnum','contacts','/systemusers(','4.0','substring','lastIndexOf','enduserId','message','contacts?$select=telephone1','toLowerCase','outbound','telephone1',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','indexOf','content','ticketType','assign','getString','Descriptions','Fields','phonecall','phonecalls','Subjects','callDirection','queue','headers','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','localhost','socket.io-emitter','POST','remoteUri','username','password','access_token','catch','error',']\x20Wrong\x20credentials!','then','GET','Bearer\x20','value','isNil'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0x74d3,0x15c));var _0x374d=function(_0x347498,_0x332242){_0x347498=_0x347498-0x0;var _0x334f2b=_0x74d3[_0x347498];return _0x334f2b;};'use strict';var _=require(_0x374d('0x0'));var BPromise=require(_0x374d('0x1'));var rp=require(_0x374d('0x2'));var util=require(_0x374d('0x3'));var intUtil=require('./util');var md5=require(_0x374d('0x4'));var Redis=require(_0x374d('0x5'));var logger=require(_0x374d('0x6'))('dynamics365');var config=require(_0x374d('0x7'));config['redis']=_['defaults'](config[_0x374d('0x8')],{'host':_0x374d('0x9'),'port':0x18eb});var io=require(_0x374d('0xa'))(new Redis(config['redis']));function getAuthToken(_0xefbc9b,_0x57c75f,_0x9f4eba){var _0x2cd94c={'method':_0x374d('0xb'),'uri':_0x57c75f,'form':{'client_id':_0xefbc9b['clientId'],'resource':_0xefbc9b[_0x374d('0xc')],'username':_0xefbc9b[_0x374d('0xd')],'password':_0xefbc9b[_0x374d('0xe')],'grant_type':_0x374d('0xe'),'client_secret':_0xefbc9b['clientSecret']},'json':!![]};return rp(_0x2cd94c)['then'](function(_0x1f1555){return _0x1f1555[_0x374d('0xf')];})[_0x374d('0x10')](function(_0x3f62eb){logger[_0x374d('0x11')]('['+[_0x9f4eba['toUpperCase']()]+_0x374d('0x12'));return _0x3f62eb['message'];});}function getUser(_0x219bb1,_0x1f7d29,_0x1730fa,_0x44bbc4,_0x9a1f7a,_0x1b1c42){return new BPromise(function(_0x4de231,_0x3c8166){return getAuthToken(_0x1f7d29,_0x44bbc4,_0x1b1c42)[_0x374d('0x13')](function(_0x4560ef){var _0x5c5c12={'method':_0x374d('0x14'),'uri':_0x9a1f7a+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x374d('0x15')+_0x4560ef,'OData-Version':'4.0'},'json':!![]};return rp(_0x5c5c12);})[_0x374d('0x13')](function(_0x1011ad){var _0x1d6ef2=_0x1011ad[_0x374d('0x16')];var _0x63a860=![];var _0x2338e1=null;if(!_[_0x374d('0x17')](_0x1730fa)){if(intUtil['validateEmail'](_0x1730fa[_0x374d('0x18')])){_0x219bb1['userEmail']=_0x1730fa[_0x374d('0x18')];for(_0x2338e1=0x0;_0x2338e1<_0x1d6ef2[_0x374d('0x19')];_0x2338e1++){if(_0x1d6ef2[_0x2338e1][_0x374d('0x1a')]===_0x1730fa['email']&&!_0x1d6ef2[_0x2338e1][_0x374d('0x1b')]){_0x63a860=!![];logger[_0x374d('0x1c')]('['+[_0x1b1c42[_0x374d('0x1d')]()]+_0x374d('0x1e')+_0x1d6ef2[_0x2338e1][_0x374d('0x1f')]+'!');_0x219bb1[_0x374d('0x20')]=_0x1d6ef2[_0x2338e1][_0x374d('0x1f')];}}}}if(!_0x63a860){logger[_0x374d('0x1c')]('['+[_0x1b1c42[_0x374d('0x1d')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x219bb1['userEmail']=_0x1f7d29[_0x374d('0xd')];for(_0x2338e1=0x0;_0x2338e1<_0x1d6ef2[_0x374d('0x19')];_0x2338e1++){if(_0x1d6ef2[_0x2338e1][_0x374d('0x1a')]===_0x1f7d29['username']){_0x219bb1[_0x374d('0x20')]=_0x1d6ef2[_0x2338e1][_0x374d('0x1f')];}}}_0x4de231(_0x219bb1);})['catch'](function(_0x419891){_0x3c8166(_0x419891['message']);});});}function createEndUser(_0x29b5b3,_0x2c2913,_0x53af34,_0x2f8d3b,_0x4ccdf0,_0x374a89){return new BPromise(function(_0x241cfb,_0x198d6d){return getAuthToken(_0x2c2913,_0x53af34,_0x374a89)[_0x374d('0x13')](function(_0x25dbb3){var _0x3c9d06=_0x374a89['toLowerCase']()==='outbound'?_0x4ccdf0[_0x374d('0x21')]:_0x4ccdf0[_0x374d('0x22')];var _0x3a01aa={'method':_0x374d('0xb'),'uri':_0x2f8d3b+_0x374d('0x23'),'body':{'telephone1':_0x3c9d06,'fullname':_0x3c9d06,'firstname':_0x3c9d06,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x374d('0x24')+_0x29b5b3[_0x374d('0x20')]+')'},'headers':{'Authorization':_0x374d('0x15')+_0x25dbb3,'OData-Version':_0x374d('0x25')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3a01aa);})[_0x374d('0x13')](function(_0x274775){var _0x139e4b=_0x274775['headers']['odata-entityid'];var _0x1069c6=_0x139e4b[_0x374d('0x26')](_0x139e4b[_0x374d('0x27')]('(')+0x1,_0x139e4b[_0x374d('0x27')](')'));_0x29b5b3[_0x374d('0x28')]=_0x1069c6;_0x241cfb(_0x29b5b3);})[_0x374d('0x10')](function(_0x430d3){_0x198d6d(_0x430d3[_0x374d('0x29')]);});});}function getEndUser(_0xfde0f0,_0x2a1568,_0x328978,_0x591dba,_0x1724a7,_0x313dab){return new BPromise(function(_0x4bf584,_0x36c233){return getAuthToken(_0x2a1568,_0x328978,_0x313dab)[_0x374d('0x13')](function(_0x39bcbc){var _0x39bde6={'method':_0x374d('0x14'),'uri':_0x591dba+_0x374d('0x2a'),'headers':{'Authorization':_0x374d('0x15')+_0x39bcbc,'If-None-Match':null,'OData-Version':_0x374d('0x25')},'json':!![]};return rp(_0x39bde6);})[_0x374d('0x13')](function(_0x2cfff6){var _0x34ab2b=null;if(_0x2cfff6){var _0x2d4da5=_0x2cfff6[_0x374d('0x16')];var _0x30bd89=![];for(_0x34ab2b=0x0;_0x34ab2b<_0x2d4da5[_0x374d('0x19')];_0x34ab2b++){var _0x142202=_0x313dab[_0x374d('0x2b')]()===_0x374d('0x2c')?_0x1724a7[_0x374d('0x21')]:_0x1724a7[_0x374d('0x22')];if(_0x2d4da5[_0x34ab2b][_0x374d('0x2d')]===_0x142202){_0x30bd89=!![];_0xfde0f0[_0x374d('0x28')]=_0x2d4da5[_0x34ab2b]['contactid'];}}if(_0x30bd89){_0x4bf584(_0xfde0f0);}else{return createEndUser(_0xfde0f0,_0x2a1568,_0x328978,_0x591dba,_0x1724a7,_0x313dab)[_0x374d('0x13')](function(_0x2b8449){logger[_0x374d('0x1c')]('['+[_0x313dab[_0x374d('0x1d')]()]+']\x20Enduser\x20created!',_0x2b8449[_0x374d('0x28')]);_0x4bf584(_0x2b8449);});}}else{return createEndUser(_0xfde0f0,_0x2a1568,_0x328978,_0x591dba,_0x1724a7,_0x313dab)[_0x374d('0x13')](function(_0x496013){logger[_0x374d('0x1c')]('['+[_0x313dab[_0x374d('0x1d')]()]+_0x374d('0x2e'),_0x496013[_0x374d('0x28')]);_0x4bf584(_0x496013);});}});});}function getCustomFields(_0x762ab1,_0x1f52c7,_0x2da1ab){var _0x1e535e={};if(_0x762ab1[_0x374d('0x19')]>0x0){_[_0x374d('0x2f')](_0x762ab1,function(_0x4396d0){if(_0x4396d0[_0x374d('0x30')]===_0x374d('0x31')&&_0x4396d0[_0x374d('0x32')]&&!_0x4396d0[_0x374d('0x33')]){var _0x4367dc=_0x4396d0['idField'][_0x374d('0x2b')]();var _0x486877=_0x4367dc[_0x374d('0x26')](0x0,_0x4367dc['indexOf']('_'));var _0x564776=_0x4367dc['substring'](_0x4367dc[_0x374d('0x34')]('_')+0x1);if(_0x486877===_0x2da1ab){_0x1e535e[_0x564776]=_0x4396d0[_0x374d('0x35')];}}});}return _0x1e535e;}function getTicket(_0x31b3fa,_0x129b4c,_0x112a19,_0x4ca7a6,_0x6f4b82,_0x562c08,_0x1487c3){return new BPromise(function(_0x4b3a58,_0x365d96){var _0x5bcc8c;return getAuthToken(_0x129b4c,_0x112a19,_0x1487c3)[_0x374d('0x13')](function(_0x53c14a){if(_0x562c08[_0x374d('0x36')]==='incident'){_0x5bcc8c={'method':_0x374d('0xb'),'uri':_0x4ca7a6+'incidents','body':Object[_0x374d('0x37')]({},{'title':intUtil[_0x374d('0x38')](_0x562c08['Subjects'],_0x6f4b82,'\x20'),'description':intUtil['getString'](_0x562c08[_0x374d('0x39')],_0x6f4b82,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x31b3fa['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x31b3fa[_0x374d('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x562c08[_0x374d('0x3a')],_0x6f4b82,_0x562c08['ticketType'])),'headers':{'Authorization':_0x374d('0x15')+_0x53c14a,'OData-Version':_0x374d('0x25')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x562c08[_0x374d('0x36')]===_0x374d('0x3b')){_0x5bcc8c={'method':_0x374d('0xb'),'uri':_0x4ca7a6+_0x374d('0x3c'),'body':Object['assign']({},{'subject':intUtil[_0x374d('0x38')](_0x562c08[_0x374d('0x3d')],_0x6f4b82,'\x20'),'phonenumber':String(_0x6f4b82[_0x374d('0x22')]),'description':intUtil[_0x374d('0x38')](_0x562c08[_0x374d('0x39')],_0x6f4b82,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x31b3fa[_0x374d('0x28')]+')','ownerid@odata.bind':_0x374d('0x24')+_0x31b3fa[_0x374d('0x20')]+')','directioncode':_0x31b3fa[_0x374d('0x3e')]===_0x374d('0x3f')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x31b3fa[_0x374d('0x20')]+')','participationtypemask':_0x31b3fa[_0x374d('0x3e')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x31b3fa[_0x374d('0x28')]+')','participationtypemask':_0x31b3fa['callDirection']===_0x374d('0x3f')?0x1:0x2}]},getCustomFields(_0x562c08[_0x374d('0x3a')],_0x6f4b82,_0x562c08['ticketType'])),'headers':{'Authorization':_0x374d('0x15')+_0x53c14a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5bcc8c);})['then'](function(_0x3aef33){var _0x3213c1=_0x3aef33[_0x374d('0x40')][_0x374d('0x41')];var _0x261bcc=_0x3213c1['substring'](_0x3213c1[_0x374d('0x27')]('(')+0x1,_0x3213c1['lastIndexOf'](')'));_0x31b3fa[_0x374d('0x42')]=_0x261bcc;_0x4b3a58(_0x31b3fa);})[_0x374d('0x10')](function(_0x5a75bc){_0x365d96(_0x5a75bc[_0x374d('0x29')]);});});}function emit(_0x19ae3c,_0x2232d0,_0x5b9d10,_0x2b7cf2){var _0x23478d={'uri':util[_0x374d('0x43')](_0x374d('0x44'),_0x19ae3c,_0x5b9d10,_0x2b7cf2)};io['to'](util[_0x374d('0x43')](_0x374d('0x45'),_0x2232d0))['emit'](_0x374d('0x46'),_0x23478d);}exports['cs']=function(_0x2e6d07,_0x3557c8,_0x4279fe,_0x204136,_0x3d03ec,_0x35d084,_0x34fe08,_0xc90355){var _0x550f93={};_0x35d084[_0x374d('0xc')]=intUtil[_0x374d('0x47')](_0x35d084[_0x374d('0xc')]);_0x35d084['serverUrl']=intUtil[_0x374d('0x47')](_0x35d084[_0x374d('0x48')]);_0x550f93['callDirection']=_0xc90355===_0x374d('0x3f')||_0xc90355===_0x374d('0x49')?_0x374d('0x3f'):_0x374d('0x2c');var _0x52feda=util[_0x374d('0x43')](_0x374d('0x4a'),_0x35d084[_0x374d('0xc')]);var _0x396ea8=util[_0x374d('0x43')](_0x374d('0x4b'),_0x35d084[_0x374d('0x4c')]);var _0x1fd7b4=util[_0x374d('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d084[_0x374d('0x48')],_0x3557c8[_0x374d('0x4d')],md5(_0x3557c8[_0x374d('0x4d')]));if(_0x3d03ec&&_0x3d03ec['monitor_format']){logger[_0x374d('0x1c')](_0x374d('0x4e'),_0x374d('0x4f'));_0x3557c8[_0x374d('0x50')]=_0x1fd7b4;}else if(_0x34fe08&&_0x34fe08[_0x374d('0x51')]&&_0x34fe08[_0x374d('0x51')]!==_0x374d('0x52')){logger[_0x374d('0x1c')](_0x374d('0x53'),_0x374d('0x4f'));_0x3557c8[_0x374d('0x50')]=_0x1fd7b4;}else{_0x3557c8[_0x374d('0x50')]='';}return getUser(_0x550f93,_0x35d084,_0x204136,_0x396ea8,_0x52feda,_0xc90355)[_0x374d('0x13')](function(_0x2f187c){logger[_0x374d('0x1c')]('['+_0xc90355[_0x374d('0x1d')]()+_0x374d('0x54'),_0x2f187c[_0x374d('0x20')]);logger[_0x374d('0x1c')]('['+_0xc90355['toUpperCase']()+_0x374d('0x55'),_0x2f187c[_0x374d('0x56')]);return getEndUser(_0x2f187c,_0x35d084,_0x396ea8,_0x52feda,_0x3557c8,_0xc90355);})[_0x374d('0x13')](function(_0x172659){logger[_0x374d('0x1c')]('['+_0xc90355[_0x374d('0x1d')]()+_0x374d('0x57'),_0x172659[_0x374d('0x28')]);logger['info']('['+_0xc90355['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x3557c8[_0x374d('0x22')]);return getTicket(_0x172659,_0x35d084,_0x396ea8,_0x52feda,_0x3557c8,_0x4279fe,_0xc90355);})[_0x374d('0x13')](function(_0x510a13){logger[_0x374d('0x1c')](util['format']('['+_0xc90355['toUpperCase']()+_0x374d('0x58'),_0x4279fe[_0x374d('0x36')],_0x510a13[_0x374d('0x42')]));logger['info'](util[_0x374d('0x43')]('['+_0xc90355['toUpperCase']()+_0x374d('0x59'),_0xc90355));if(_0xc90355!=='abandoned'){logger['info']('['+_0xc90355[_0x374d('0x1d')]()+']',_0x374d('0x5a'));emit(_0x35d084['remoteUri'],_0x204136['name'],_0x4279fe['ticketType'],_0x510a13['ticketId']);}})[_0x374d('0x10')](function(_0x239c4c){logger[_0x374d('0x11')]('['+_0xc90355[_0x374d('0x1d')]()+_0x374d('0x5b'),util[_0x374d('0x5c')](_0x239c4c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd643=['Descriptions','/contacts(','Fields','phonecalls','callDirection','queue','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','trigger:browser:url','remoteUri','serverUrl','abandoned','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','POST','clientId','username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','info','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','catch','message','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1','calleridnum','telephone1','contactid',']\x20Enduser\x20created!','length','string','nameField','indexOf','content','ticketType','incidents','getString','Subjects'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xd643,0x131));var _0x3d64=function(_0x197290,_0x2ef3b4){_0x197290=_0x197290-0x0;var _0x254152=_0xd643[_0x197290];return _0x254152;};'use strict';var _=require(_0x3d64('0x0'));var BPromise=require('bluebird');var rp=require(_0x3d64('0x1'));var util=require(_0x3d64('0x2'));var intUtil=require(_0x3d64('0x3'));var md5=require(_0x3d64('0x4'));var Redis=require(_0x3d64('0x5'));var logger=require(_0x3d64('0x6'))(_0x3d64('0x7'));var config=require(_0x3d64('0x8'));config['redis']=_['defaults'](config[_0x3d64('0x9')],{'host':_0x3d64('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3d64('0x9')]));function getAuthToken(_0x47988,_0x209dc4,_0x414d41){var _0x10fd74={'method':_0x3d64('0xb'),'uri':_0x209dc4,'form':{'client_id':_0x47988[_0x3d64('0xc')],'resource':_0x47988['remoteUri'],'username':_0x47988[_0x3d64('0xd')],'password':_0x47988[_0x3d64('0xe')],'grant_type':_0x3d64('0xe'),'client_secret':_0x47988[_0x3d64('0xf')]},'json':!![]};return rp(_0x10fd74)[_0x3d64('0x10')](function(_0x1e99cd){return _0x1e99cd[_0x3d64('0x11')];})['catch'](function(_0x17f0a7){logger[_0x3d64('0x12')]('['+[_0x414d41[_0x3d64('0x13')]()]+_0x3d64('0x14'));return _0x17f0a7['message'];});}function getUser(_0x1f32c6,_0x42e7ee,_0x35b9d4,_0x89a9ba,_0xd469ba,_0x535503){return new BPromise(function(_0x58493d,_0x3c8a27){return getAuthToken(_0x42e7ee,_0x89a9ba,_0x535503)[_0x3d64('0x10')](function(_0x12ffec){var _0xda93e5={'method':'GET','uri':_0xd469ba+_0x3d64('0x15'),'headers':{'Authorization':_0x3d64('0x16')+_0x12ffec,'OData-Version':_0x3d64('0x17')},'json':!![]};return rp(_0xda93e5);})['then'](function(_0x3f1451){var _0x13672c=_0x3f1451[_0x3d64('0x18')];var _0x494988=![];var _0x2cdc6f=null;if(!_[_0x3d64('0x19')](_0x35b9d4)){if(intUtil[_0x3d64('0x1a')](_0x35b9d4[_0x3d64('0x1b')])){_0x1f32c6[_0x3d64('0x1c')]=_0x35b9d4[_0x3d64('0x1b')];for(_0x2cdc6f=0x0;_0x2cdc6f<_0x13672c['length'];_0x2cdc6f++){if(_0x13672c[_0x2cdc6f]['internalemailaddress']===_0x35b9d4[_0x3d64('0x1b')]&&!_0x13672c[_0x2cdc6f]['isdisabled']){_0x494988=!![];logger[_0x3d64('0x1d')]('['+[_0x535503[_0x3d64('0x13')]()]+']\x20Agent\x20found\x20'+_0x13672c[_0x2cdc6f]['systemuserid']+'!');_0x1f32c6[_0x3d64('0x1e')]=_0x13672c[_0x2cdc6f]['systemuserid'];}}}}if(!_0x494988){logger[_0x3d64('0x1d')]('['+[_0x535503['toUpperCase']()]+_0x3d64('0x1f'));_0x1f32c6[_0x3d64('0x1c')]=_0x42e7ee[_0x3d64('0xd')];for(_0x2cdc6f=0x0;_0x2cdc6f<_0x13672c['length'];_0x2cdc6f++){if(_0x13672c[_0x2cdc6f][_0x3d64('0x20')]===_0x42e7ee['username']){_0x1f32c6[_0x3d64('0x1e')]=_0x13672c[_0x2cdc6f]['systemuserid'];}}}_0x58493d(_0x1f32c6);})[_0x3d64('0x21')](function(_0x25bfb2){_0x3c8a27(_0x25bfb2[_0x3d64('0x22')]);});});}function createEndUser(_0x540017,_0x161b29,_0x11e45e,_0x4750f0,_0x427a58,_0x4c95c1){return new BPromise(function(_0x4b389f,_0x3ff186){return getAuthToken(_0x161b29,_0x11e45e,_0x4c95c1)[_0x3d64('0x10')](function(_0xd431be){var _0x47f95d=_0x4c95c1[_0x3d64('0x23')]()===_0x3d64('0x24')?_0x427a58[_0x3d64('0x25')]:_0x427a58['calleridnum'];var _0xc12a63={'method':_0x3d64('0xb'),'uri':_0x4750f0+_0x3d64('0x26'),'body':{'telephone1':_0x47f95d,'fullname':_0x47f95d,'firstname':_0x47f95d,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3d64('0x27')+_0x540017[_0x3d64('0x1e')]+')'},'headers':{'Authorization':_0x3d64('0x16')+_0xd431be,'OData-Version':_0x3d64('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xc12a63);})['then'](function(_0x1f91dc){var _0x2870d8=_0x1f91dc[_0x3d64('0x28')][_0x3d64('0x29')];var _0x329a95=_0x2870d8[_0x3d64('0x2a')](_0x2870d8['lastIndexOf']('(')+0x1,_0x2870d8[_0x3d64('0x2b')](')'));_0x540017[_0x3d64('0x2c')]=_0x329a95;_0x4b389f(_0x540017);})[_0x3d64('0x21')](function(_0x52be53){_0x3ff186(_0x52be53[_0x3d64('0x22')]);});});}function getEndUser(_0x59db5f,_0x334b4d,_0x3372de,_0x297e40,_0x10e146,_0xb2d3c){return new BPromise(function(_0x2dcce4,_0x4cc6d1){return getAuthToken(_0x334b4d,_0x3372de,_0xb2d3c)['then'](function(_0x23809f){var _0x4dbe7a={'method':'GET','uri':_0x297e40+_0x3d64('0x2d'),'headers':{'Authorization':_0x3d64('0x16')+_0x23809f,'If-None-Match':null,'OData-Version':_0x3d64('0x17')},'json':!![]};return rp(_0x4dbe7a);})[_0x3d64('0x10')](function(_0x5bdc29){var _0x3c48d1=null;if(_0x5bdc29){var _0x3315a2=_0x5bdc29[_0x3d64('0x18')];var _0x498fec=![];for(_0x3c48d1=0x0;_0x3c48d1<_0x3315a2['length'];_0x3c48d1++){var _0x1567d9=_0xb2d3c['toLowerCase']()==='outbound'?_0x10e146['destcalleridnum']:_0x10e146[_0x3d64('0x2e')];if(_0x3315a2[_0x3c48d1][_0x3d64('0x2f')]===_0x1567d9){_0x498fec=!![];_0x59db5f[_0x3d64('0x2c')]=_0x3315a2[_0x3c48d1][_0x3d64('0x30')];}}if(_0x498fec){_0x2dcce4(_0x59db5f);}else{return createEndUser(_0x59db5f,_0x334b4d,_0x3372de,_0x297e40,_0x10e146,_0xb2d3c)[_0x3d64('0x10')](function(_0x55f897){logger[_0x3d64('0x1d')]('['+[_0xb2d3c['toUpperCase']()]+_0x3d64('0x31'),_0x55f897[_0x3d64('0x2c')]);_0x2dcce4(_0x55f897);});}}else{return createEndUser(_0x59db5f,_0x334b4d,_0x3372de,_0x297e40,_0x10e146,_0xb2d3c)[_0x3d64('0x10')](function(_0x8468ad){logger[_0x3d64('0x1d')]('['+[_0xb2d3c[_0x3d64('0x13')]()]+']\x20Enduser\x20Created!',_0x8468ad['enduserId']);_0x2dcce4(_0x8468ad);});}});});}function getCustomFields(_0xf90905,_0xb1aaab,_0x360371){var _0x1416ea={};if(_0xf90905[_0x3d64('0x32')]>0x0){_['forEach'](_0xf90905,function(_0x598f96){if(_0x598f96['type']===_0x3d64('0x33')&&_0x598f96[_0x3d64('0x34')]&&!_0x598f96['customField']){var _0x180d55=_0x598f96['idField'][_0x3d64('0x23')]();var _0x2e13ec=_0x180d55[_0x3d64('0x2a')](0x0,_0x180d55[_0x3d64('0x35')]('_'));var _0x4cef0e=_0x180d55[_0x3d64('0x2a')](_0x180d55[_0x3d64('0x35')]('_')+0x1);if(_0x2e13ec===_0x360371){_0x1416ea[_0x4cef0e]=_0x598f96[_0x3d64('0x36')];}}});}return _0x1416ea;}function getTicket(_0x2f878a,_0xaeb671,_0xa2b980,_0x1d83ad,_0x2fbfde,_0x47c910,_0x34b26e){return new BPromise(function(_0x178e42,_0x58360a){var _0x352baa;return getAuthToken(_0xaeb671,_0xa2b980,_0x34b26e)[_0x3d64('0x10')](function(_0x4d024d){if(_0x47c910[_0x3d64('0x37')]==='incident'){_0x352baa={'method':_0x3d64('0xb'),'uri':_0x1d83ad+_0x3d64('0x38'),'body':Object['assign']({},{'title':intUtil[_0x3d64('0x39')](_0x47c910[_0x3d64('0x3a')],_0x2fbfde,'\x20'),'description':intUtil[_0x3d64('0x39')](_0x47c910[_0x3d64('0x3b')],_0x2fbfde,'\x0a'),'customerid_contact@odata.bind':_0x3d64('0x3c')+_0x2f878a['enduserId']+')','ownerid@odata.bind':_0x3d64('0x27')+_0x2f878a[_0x3d64('0x1e')]+')','caseorigincode':'1'},getCustomFields(_0x47c910[_0x3d64('0x3d')],_0x2fbfde,_0x47c910[_0x3d64('0x37')])),'headers':{'Authorization':_0x3d64('0x16')+_0x4d024d,'OData-Version':_0x3d64('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x47c910[_0x3d64('0x37')]==='phonecall'){_0x352baa={'method':_0x3d64('0xb'),'uri':_0x1d83ad+_0x3d64('0x3e'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x47c910[_0x3d64('0x3a')],_0x2fbfde,'\x20'),'phonenumber':String(_0x2fbfde[_0x3d64('0x2e')]),'description':intUtil[_0x3d64('0x39')](_0x47c910[_0x3d64('0x3b')],_0x2fbfde,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x2f878a[_0x3d64('0x2c')]+')','ownerid@odata.bind':'/systemusers('+_0x2f878a['userId']+')','directioncode':_0x2f878a[_0x3d64('0x3f')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x3d64('0x27')+_0x2f878a['userId']+')','participationtypemask':_0x2f878a[_0x3d64('0x3f')]===_0x3d64('0x40')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x2f878a['enduserId']+')','participationtypemask':_0x2f878a[_0x3d64('0x3f')]==='queue'?0x1:0x2}]},getCustomFields(_0x47c910[_0x3d64('0x3d')],_0x2fbfde,_0x47c910[_0x3d64('0x37')])),'headers':{'Authorization':_0x3d64('0x16')+_0x4d024d,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x352baa);})[_0x3d64('0x10')](function(_0x55cfe9){var _0x209b5b=_0x55cfe9[_0x3d64('0x28')][_0x3d64('0x29')];var _0x50a92d=_0x209b5b[_0x3d64('0x2a')](_0x209b5b[_0x3d64('0x2b')]('(')+0x1,_0x209b5b[_0x3d64('0x2b')](')'));_0x2f878a[_0x3d64('0x41')]=_0x50a92d;_0x178e42(_0x2f878a);})[_0x3d64('0x21')](function(_0xee4fe3){_0x58360a(_0xee4fe3['message']);});});}function emit(_0x590b67,_0x3e8c46,_0xeb322d,_0x2465b6){var _0x39630b={'uri':util['format'](_0x3d64('0x42'),_0x590b67,_0xeb322d,_0x2465b6)};io['to'](util[_0x3d64('0x43')](_0x3d64('0x44'),_0x3e8c46))['emit'](_0x3d64('0x45'),_0x39630b);}exports['cs']=function(_0x266fc3,_0x4f8dc6,_0x3cf3be,_0x12d38a,_0x3184cb,_0x8445af,_0x3388d3,_0x5ebe6c){var _0x171b69={};_0x8445af[_0x3d64('0x46')]=intUtil['stripTrailingSlash'](_0x8445af['remoteUri']);_0x8445af[_0x3d64('0x47')]=intUtil['stripTrailingSlash'](_0x8445af['serverUrl']);_0x171b69['callDirection']=_0x5ebe6c===_0x3d64('0x40')||_0x5ebe6c===_0x3d64('0x48')?_0x3d64('0x40'):'outbound';var _0x3edd58=util['format']('%s/api/data/v9.0/',_0x8445af['remoteUri']);var _0x11b286=util[_0x3d64('0x43')](_0x3d64('0x49'),_0x8445af[_0x3d64('0x4a')]);var _0x5071c8=util[_0x3d64('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8445af[_0x3d64('0x47')],_0x4f8dc6[_0x3d64('0x4b')],md5(_0x4f8dc6[_0x3d64('0x4b')]));if(_0x3184cb&&_0x3184cb[_0x3d64('0x4c')]){logger[_0x3d64('0x1d')]('[QUEUE]',_0x3d64('0x4d'));_0x4f8dc6[_0x3d64('0x4e')]=_0x5071c8;}else if(_0x3388d3&&_0x3388d3[_0x3d64('0x4f')]&&_0x3388d3[_0x3d64('0x4f')]!==_0x3d64('0x50')){logger['info'](_0x3d64('0x51'),_0x3d64('0x4d'));_0x4f8dc6['recordingURL']=_0x5071c8;}else{_0x4f8dc6[_0x3d64('0x4e')]='';}return getUser(_0x171b69,_0x8445af,_0x12d38a,_0x11b286,_0x3edd58,_0x5ebe6c)[_0x3d64('0x10')](function(_0x533a15){logger['info']('['+_0x5ebe6c[_0x3d64('0x13')]()+_0x3d64('0x52'),_0x533a15[_0x3d64('0x1e')]);logger['info']('['+_0x5ebe6c[_0x3d64('0x13')]()+_0x3d64('0x53'),_0x533a15[_0x3d64('0x1c')]);return getEndUser(_0x533a15,_0x8445af,_0x11b286,_0x3edd58,_0x4f8dc6,_0x5ebe6c);})['then'](function(_0x3c67fe){logger[_0x3d64('0x1d')]('['+_0x5ebe6c[_0x3d64('0x13')]()+_0x3d64('0x54'),_0x3c67fe[_0x3d64('0x2c')]);logger[_0x3d64('0x1d')]('['+_0x5ebe6c[_0x3d64('0x13')]()+_0x3d64('0x55'),_0x4f8dc6[_0x3d64('0x2e')]);return getTicket(_0x3c67fe,_0x8445af,_0x11b286,_0x3edd58,_0x4f8dc6,_0x3cf3be,_0x5ebe6c);})['then'](function(_0x957d64){logger[_0x3d64('0x1d')](util[_0x3d64('0x43')]('['+_0x5ebe6c[_0x3d64('0x13')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x3cf3be['ticketType'],_0x957d64[_0x3d64('0x41')]));logger[_0x3d64('0x1d')](util['format']('['+_0x5ebe6c['toUpperCase']()+_0x3d64('0x56'),_0x5ebe6c));if(_0x5ebe6c!==_0x3d64('0x48')){logger[_0x3d64('0x1d')]('['+_0x5ebe6c[_0x3d64('0x13')]()+']',_0x3d64('0x57'));emit(_0x8445af[_0x3d64('0x46')],_0x12d38a[_0x3d64('0x58')],_0x3cf3be[_0x3d64('0x37')],_0x957d64[_0x3d64('0x41')]);}})[_0x3d64('0x21')](function(_0x186290){logger[_0x3d64('0x12')]('['+_0x5ebe6c[_0x3d64('0x13')]()+_0x3d64('0x59'),util[_0x3d64('0x5a')](_0x186290,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index b31ec5b..1de1b9c 100644 --- a/server/services/ami/trigger/integration/freshdesk.js +++ b/server/services/ami/trigger/integration/freshdesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc67=['format','calleridname','calleridnum','getString','Subjects','
','name','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','Agent\x20found!','contact','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','stringify','GET','length','map','string','nameField','customField','toLowerCase','content','type','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','%s/helpdesk/tickets/%d','abandoned','monitor_format','[ABANDONED]','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','emit','Creating\x20new\x20ticket...','merge'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfc67,0xf6));var _0x7fc6=function(_0x46d208,_0x3654d0){_0x46d208=_0x46d208-0x0;var _0x3bc42f=_0xfc67[_0x46d208];return _0x3bc42f;};'use strict';var _=require(_0x7fc6('0x0'));var rp=require(_0x7fc6('0x1'));var md5=require('md5');var util=require(_0x7fc6('0x2'));var Redis=require('ioredis');var intUtil=require(_0x7fc6('0x3'));var config=require(_0x7fc6('0x4'));var logger=require(_0x7fc6('0x5'))(_0x7fc6('0x6'));config[_0x7fc6('0x7')]=_[_0x7fc6('0x8')](config[_0x7fc6('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7fc6('0x7')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x46c6cb,_0x24c770,_0x921d54){io['to'](_0x46c6cb)[_0x7fc6('0x9')](_0x24c770,_0x921d54);}function getTicket(_0x2dab01,_0x19240b,_0x5a2e29,_0x4e96cc,_0xee33da){logger['info'](_0x7fc6('0xa'));var _0x5a0736=_[_0x7fc6('0xb')]({'responder_id':_0x19240b['id'],'requester_id':_0x5a2e29['id'],'name':util[_0x7fc6('0xc')]('Caller\x20-\x20%s',_0xee33da[_0x7fc6('0xd')]),'phone':_0xee33da[_0x7fc6('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x7fc6('0xf')](_0x4e96cc[_0x7fc6('0x10')],_0xee33da,'\x20'),'description':intUtil[_0x7fc6('0xf')](_0x4e96cc['Descriptions'],_0xee33da,_0x7fc6('0x11')),'tags':getTags(_0x4e96cc['Tags'],_0x7fc6('0x12'))},getCustomFields(_0x4e96cc['Fields'],_0xee33da));_0x5a0736['custom_fields']=_['mapValues'](_[_0x7fc6('0x13')](_0x5a0736[_0x7fc6('0x14')],'id'),_0x7fc6('0x15'));return request({'uri':util['format'](_0x7fc6('0x16'),_0x2dab01[_0x7fc6('0x17')]),'method':_0x7fc6('0x18'),'body':_0x5a0736})[_0x7fc6('0x19')](function(_0x36e20d){logger[_0x7fc6('0x1a')](_0x7fc6('0x1b'));return _0x36e20d;});}function getUser(_0x1bf9c0,_0x220365){if(intUtil[_0x7fc6('0x1c')](_0x220365)){return request({'uri':util[_0x7fc6('0xc')]('%s/api/v2/agents',_0x1bf9c0[_0x7fc6('0x17')]),'qs':{'email':_0x220365}})[_0x7fc6('0x19')](function(_0xbb3ca8){if(_0xbb3ca8['length']){logger[_0x7fc6('0x1a')](_0x7fc6('0x1d'));return _['find'](_0xbb3ca8,function(_0x1a3e92){return _0x1a3e92[_0x7fc6('0x1e')]['email']===_0x220365;});}else{logger[_0x7fc6('0x1a')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x7fc6('0xc')](_0x7fc6('0x1f'),_0x1bf9c0[_0x7fc6('0x17')])})[_0x7fc6('0x19')](function(_0x9ced4c){logger[_0x7fc6('0x1a')](_0x7fc6('0x20'));return _0x9ced4c;});}});}else{logger[_0x7fc6('0x1a')](_0x7fc6('0x21'));return request({'uri':util[_0x7fc6('0xc')](_0x7fc6('0x1f'),_0x1bf9c0[_0x7fc6('0x17')])})['then'](function(_0x391a4f){logger[_0x7fc6('0x1a')](_0x7fc6('0x20'));return _0x391a4f;});}}function getEndUser(_0x3ae8af,_0x438dee,_0x44fcf0){logger[_0x7fc6('0x1a')]('Searching\x20enduser\x20with\x20phone',_0x44fcf0);return request({'uri':util[_0x7fc6('0xc')](_0x7fc6('0x22'),_0x3ae8af['remoteUri']),'qs':{'phone':_0x44fcf0}})[_0x7fc6('0x19')](function(_0x13396b){if(_0x13396b['length']){logger[_0x7fc6('0x1a')](_0x7fc6('0x23'));return _[_0x7fc6('0x24')](_0x13396b,{'phone':_0x44fcf0});}else{logger[_0x7fc6('0x1a')](_0x7fc6('0x25'));return request({'uri':util[_0x7fc6('0xc')](_0x7fc6('0x22'),_0x3ae8af['remoteUri']),'method':_0x7fc6('0x18'),'body':{'name':_0x438dee,'phone':_0x44fcf0}})[_0x7fc6('0x19')](function(_0xe1dd92){logger[_0x7fc6('0x1a')](_0x7fc6('0x26'));return _0xe1dd92;});}});}function getAuth(_0x3bc8fe){return util[_0x7fc6('0xc')](_0x7fc6('0x27'),new Buffer(_0x3bc8fe[_0x7fc6('0x28')]+':X')[_0x7fc6('0x29')](_0x7fc6('0x2a')));}function request(_0x168f74){logger['debug']('[HTTP]',JSON[_0x7fc6('0x2b')](_0x168f74));return rp(_[_0x7fc6('0x8')](_0x168f74,{'method':_0x7fc6('0x2c'),'headers':headers,'json':!![]}));}function getTags(_0x25071d,_0x5af137){var _0x4130e6=[];if(_0x25071d&&_0x25071d[_0x7fc6('0x2d')]>0x0){_0x4130e6=_[_0x7fc6('0x2e')](_0x25071d,_0x5af137);}return _0x4130e6;}function getCustomFields(_0x682016,_0x5638bf){var _0x1bf1db=[];var _0x54d5c5={'custom_fields':[]};if(_0x682016['length']>0x0){_['forEach'](_0x682016,function(_0x11ee20){if(_0x11ee20['type']===_0x7fc6('0x2f')&&_0x11ee20[_0x7fc6('0x30')]&&!_0x11ee20[_0x7fc6('0x31')]){_0x54d5c5[_0x11ee20[_0x7fc6('0x30')][_0x7fc6('0x32')]()]=_0x11ee20[_0x7fc6('0x33')][_0x7fc6('0x29')]();}else if(_0x11ee20[_0x7fc6('0x34')]===_0x7fc6('0x2f')&&_0x11ee20[_0x7fc6('0x35')]&&_0x11ee20[_0x7fc6('0x31')]){_0x54d5c5[_0x7fc6('0x14')][_0x7fc6('0x36')]({'id':_0x11ee20[_0x7fc6('0x35')],'value':_0x11ee20[_0x7fc6('0x33')][_0x7fc6('0x29')]()});}else if(_0x11ee20[_0x7fc6('0x34')]===_0x7fc6('0x37')&&_0x11ee20['variableName']&&_0x11ee20[_0x7fc6('0x35')]&&_0x11ee20[_0x7fc6('0x31')]){_0x5638bf[_0x11ee20['variableName']]&&_0x54d5c5[_0x7fc6('0x14')]['push']({'id':_0x11ee20[_0x7fc6('0x35')],'value':_0x5638bf[_0x11ee20[_0x7fc6('0x38')]]['toString']()});}else if(_0x11ee20['type']===_0x7fc6('0x39')&&_0x11ee20[_0x7fc6('0x3a')]&&_0x11ee20[_0x7fc6('0x3a')][_0x7fc6('0x12')]&&_0x11ee20['idField']&&_0x11ee20['customField']){_0x5638bf[_0x11ee20[_0x7fc6('0x3a')][_0x7fc6('0x12')][_0x7fc6('0x32')]()]&&_0x54d5c5[_0x7fc6('0x14')][_0x7fc6('0x36')]({'id':_0x11ee20[_0x7fc6('0x35')],'value':_0x5638bf[_0x11ee20[_0x7fc6('0x3a')][_0x7fc6('0x12')][_0x7fc6('0x32')]()]['toString']()});}});}return _0x54d5c5;}exports[_0x7fc6('0x3b')]=function(_0x18abd9,_0xae02fc,_0x57ebd1,_0x2260a2,_0x383243,_0x18becc){var _0x19a8ad,_0x30ea38;_0x18becc['remoteUri']=intUtil[_0x7fc6('0x3c')](_0x18becc[_0x7fc6('0x17')]);_0x18becc[_0x7fc6('0x3d')]=intUtil[_0x7fc6('0x3c')](_0x18becc[_0x7fc6('0x3d')]);if(_0x383243&&_0x383243['monitor_format']){logger['info'](_0x7fc6('0x3e'),_0x7fc6('0x3f'));_0xae02fc[_0x7fc6('0x40')]=util[_0x7fc6('0xc')](_0x7fc6('0x41'),_0x18becc[_0x7fc6('0x3d')],_0xae02fc['uniqueid'],md5(_0xae02fc['uniqueid']));}else{_0xae02fc[_0x7fc6('0x40')]='';}headers[_0x7fc6('0x42')]=getAuth(_0x18becc);return getUser(_0x18becc,_0x2260a2[_0x7fc6('0x43')])[_0x7fc6('0x19')](function(_0x4d5f3c){_0x19a8ad=_0x4d5f3c;logger[_0x7fc6('0x1a')]('The\x20User\x20ID\x20is:',_0x19a8ad['id']);return getEndUser(_0x18becc,_0xae02fc[_0x7fc6('0xd')],_0xae02fc[_0x7fc6('0xe')]);})[_0x7fc6('0x19')](function(_0x4b658f){_0x30ea38=_0x4b658f;logger[_0x7fc6('0x1a')](_0x7fc6('0x44'),_0x30ea38['id']);return getTicket(_0x18becc,_0x19a8ad,_0x30ea38,_0x57ebd1,_0xae02fc);})[_0x7fc6('0x19')](function(_0x5528e3){if(_0x5528e3&&_0x5528e3['id']){logger[_0x7fc6('0x1a')](_0x7fc6('0x1b'));logger[_0x7fc6('0x1a')](_0x7fc6('0x45'),_0x5528e3['id']);logger[_0x7fc6('0x1a')](_0x7fc6('0x3e'),_0x7fc6('0x46'));emit(util[_0x7fc6('0xc')](_0x7fc6('0x47'),_0x2260a2[_0x7fc6('0x12')]),_0x7fc6('0x48'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x18becc[_0x7fc6('0x17')],_0x5528e3['id'])});}})[_0x7fc6('0x49')](function(_0x2c0ef1){logger[_0x7fc6('0x4a')](_0x7fc6('0x3e'),JSON['stringify'](_0x2c0ef1));});};exports['outbound']=function(_0x4a8d0b,_0x22d3c6,_0x87e8cd,_0x252038,_0x33274e,_0x14143d,_0x46fe8c){var _0x237594,_0x529d79;_0x14143d[_0x7fc6('0x17')]=intUtil[_0x7fc6('0x3c')](_0x14143d[_0x7fc6('0x17')]);_0x14143d['serverUrl']=intUtil[_0x7fc6('0x3c')](_0x14143d[_0x7fc6('0x3d')]);if(_0x46fe8c&&_0x46fe8c[_0x7fc6('0x4b')]&&_0x46fe8c['recordingFormat']!==_0x7fc6('0x4c')){logger[_0x7fc6('0x1a')](_0x7fc6('0x4d'),'Recording\x20is\x20enabled!');_0x22d3c6[_0x7fc6('0x40')]=util[_0x7fc6('0xc')](_0x7fc6('0x41'),_0x14143d['serverUrl'],_0x22d3c6[_0x7fc6('0x4e')],md5(_0x22d3c6[_0x7fc6('0x4e')]));}headers['Authorization']=getAuth(_0x14143d);return getUser(_0x14143d,_0x252038[_0x7fc6('0x43')])[_0x7fc6('0x19')](function(_0x5c9101){_0x237594=_0x5c9101;logger[_0x7fc6('0x1a')](_0x7fc6('0x4f'),_0x237594['id']);return getEndUser(_0x14143d,_0x22d3c6[_0x7fc6('0x50')],_0x22d3c6[_0x7fc6('0x51')]);})[_0x7fc6('0x19')](function(_0x59b030){_0x529d79=_0x59b030;logger['info'](_0x7fc6('0x44'),_0x529d79['id']);return getTicket(_0x14143d,_0x237594,_0x529d79,_0x87e8cd,_0x22d3c6);})[_0x7fc6('0x19')](function(_0x134c0d){if(_0x134c0d&&_0x134c0d['id']){logger[_0x7fc6('0x1a')](_0x7fc6('0x1b'));logger[_0x7fc6('0x1a')](_0x7fc6('0x45'),_0x134c0d['id']);logger[_0x7fc6('0x1a')](_0x7fc6('0x4d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x252038['name']),_0x7fc6('0x48'),{'uri':util['format'](_0x7fc6('0x52'),_0x14143d[_0x7fc6('0x17')],_0x134c0d['id'])});}})[_0x7fc6('0x49')](function(_0x3d6d25){logger['error']('[OUTBOUND]',JSON['stringify'](_0x3d6d25));});};exports[_0x7fc6('0x53')]=function(_0x297ca6,_0x84d18f,_0x11ce5b,_0x2703d8,_0x34caf3,_0x4a04f2){var _0x418b5a,_0x25bcbc;_0x4a04f2[_0x7fc6('0x17')]=intUtil[_0x7fc6('0x3c')](_0x4a04f2[_0x7fc6('0x17')]);_0x4a04f2[_0x7fc6('0x3d')]=intUtil[_0x7fc6('0x3c')](_0x4a04f2[_0x7fc6('0x3d')]);if(_0x34caf3&&_0x34caf3[_0x7fc6('0x54')]){logger['info'](_0x7fc6('0x55'),'Recording\x20is\x20enabled!');_0x84d18f[_0x7fc6('0x40')]=util[_0x7fc6('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a04f2[_0x7fc6('0x3d')],_0x84d18f['uniqueid'],md5(_0x84d18f[_0x7fc6('0x4e')]));}else{_0x84d18f[_0x7fc6('0x40')]='';}headers['Authorization']=getAuth(_0x4a04f2);return getUser(_0x4a04f2,'')[_0x7fc6('0x19')](function(_0x2435ed){_0x418b5a=_0x2435ed;logger[_0x7fc6('0x1a')](_0x7fc6('0x4f'),_0x418b5a['id']);return getEndUser(_0x4a04f2,_0x84d18f[_0x7fc6('0xd')],_0x84d18f[_0x7fc6('0xe')]);})[_0x7fc6('0x19')](function(_0x73901){_0x25bcbc=_0x73901;logger[_0x7fc6('0x1a')](_0x7fc6('0x44'),_0x25bcbc['id']);return getTicket(_0x4a04f2,_0x418b5a,_0x25bcbc,_0x11ce5b,_0x84d18f);})[_0x7fc6('0x19')](function(_0x2330bb){if(_0x2330bb){logger[_0x7fc6('0x1a')]('Ticket\x20created!');logger[_0x7fc6('0x1a')](_0x7fc6('0x45'),_0x2330bb['id']);}})[_0x7fc6('0x49')](function(_0xdb584c){logger[_0x7fc6('0x4a')](_0x7fc6('0x55'),JSON[_0x7fc6('0x2b')](_0xdb584c));});}; \ No newline at end of file +var _0xbc5e=['content','string','idField','variableName','push','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','user:%s','abandoned','[ABANDONED]','md5','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','Subjects','getString','Descriptions','
','Tags','name','Fields','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','stringify','map','forEach','type','customField','nameField'];(function(_0x3983ca,_0x41b93f){var _0x8a7da1=function(_0x390687){while(--_0x390687){_0x3983ca['push'](_0x3983ca['shift']());}};_0x8a7da1(++_0x41b93f);}(_0xbc5e,0xd4));var _0xebc5=function(_0x66ec,_0x271024){_0x66ec=_0x66ec-0x0;var _0x3611ad=_0xbc5e[_0x66ec];return _0x3611ad;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xebc5('0x0'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xebc5('0x1'));var config=require('../../../../config/environment');var logger=require(_0xebc5('0x2'))('freshdesk');config[_0xebc5('0x3')]=_[_0xebc5('0x4')](config[_0xebc5('0x3')],{'host':_0xebc5('0x5'),'port':0x18eb});var io=require(_0xebc5('0x6'))(new Redis(config['redis']));var headers={'Content-Type':_0xebc5('0x7'),'Accept':'application/json'};function emit(_0x4c0052,_0xee8470,_0x4c15de){io['to'](_0x4c0052)['emit'](_0xee8470,_0x4c15de);}function getTicket(_0x1435a1,_0x3f56bd,_0xf8d12a,_0x81a3cd,_0x25be40){logger[_0xebc5('0x8')](_0xebc5('0x9'));var _0x5c1dab=_[_0xebc5('0xa')]({'responder_id':_0x3f56bd['id'],'requester_id':_0xf8d12a['id'],'name':util[_0xebc5('0xb')](_0xebc5('0xc'),_0x25be40['calleridname']),'phone':_0x25be40[_0xebc5('0xd')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x81a3cd[_0xebc5('0xe')],_0x25be40,'\x20'),'description':intUtil[_0xebc5('0xf')](_0x81a3cd[_0xebc5('0x10')],_0x25be40,_0xebc5('0x11')),'tags':getTags(_0x81a3cd[_0xebc5('0x12')],_0xebc5('0x13'))},getCustomFields(_0x81a3cd[_0xebc5('0x14')],_0x25be40));_0x5c1dab[_0xebc5('0x15')]=_['mapValues'](_[_0xebc5('0x16')](_0x5c1dab[_0xebc5('0x15')],'id'),_0xebc5('0x17'));return request({'uri':util[_0xebc5('0xb')](_0xebc5('0x18'),_0x1435a1[_0xebc5('0x19')]),'method':_0xebc5('0x1a'),'body':_0x5c1dab})[_0xebc5('0x1b')](function(_0x3ca12d){logger[_0xebc5('0x8')](_0xebc5('0x1c'));return _0x3ca12d;});}function getUser(_0x5419dc,_0x31f286){if(intUtil['validateEmail'](_0x31f286)){return request({'uri':util['format'](_0xebc5('0x1d'),_0x5419dc[_0xebc5('0x19')]),'qs':{'email':_0x31f286}})[_0xebc5('0x1b')](function(_0x59db90){if(_0x59db90[_0xebc5('0x1e')]){logger[_0xebc5('0x8')](_0xebc5('0x1f'));return _[_0xebc5('0x20')](_0x59db90,function(_0x2236c6){return _0x2236c6[_0xebc5('0x21')][_0xebc5('0x22')]===_0x31f286;});}else{logger[_0xebc5('0x8')](_0xebc5('0x23'));return request({'uri':util['format'](_0xebc5('0x24'),_0x5419dc[_0xebc5('0x19')])})['then'](function(_0x2f5361){logger[_0xebc5('0x8')](_0xebc5('0x25'));return _0x2f5361;});}});}else{logger['info'](_0xebc5('0x26'));return request({'uri':util[_0xebc5('0xb')](_0xebc5('0x24'),_0x5419dc[_0xebc5('0x19')])})['then'](function(_0x842598){logger[_0xebc5('0x8')](_0xebc5('0x25'));return _0x842598;});}}function getEndUser(_0x4bb698,_0x21d383,_0x55cf6d){logger[_0xebc5('0x8')](_0xebc5('0x27'),_0x55cf6d);return request({'uri':util['format'](_0xebc5('0x28'),_0x4bb698[_0xebc5('0x19')]),'qs':{'phone':_0x55cf6d}})['then'](function(_0x31695c){if(_0x31695c['length']){logger[_0xebc5('0x8')](_0xebc5('0x29'));return _[_0xebc5('0x20')](_0x31695c,{'phone':_0x55cf6d});}else{logger[_0xebc5('0x8')](_0xebc5('0x2a'));return request({'uri':util[_0xebc5('0xb')]('%s/api/v2/contacts',_0x4bb698[_0xebc5('0x19')]),'method':_0xebc5('0x1a'),'body':{'name':_0x21d383,'phone':_0x55cf6d}})[_0xebc5('0x1b')](function(_0xe65a01){logger['info'](_0xebc5('0x2b'));return _0xe65a01;});}});}function getAuth(_0x1d4395){return util[_0xebc5('0xb')](_0xebc5('0x2c'),new Buffer(_0x1d4395[_0xebc5('0x2d')]+':X')[_0xebc5('0x2e')](_0xebc5('0x2f')));}function request(_0x109d25){logger[_0xebc5('0x30')]('[HTTP]',JSON[_0xebc5('0x31')](_0x109d25));return rp(_['defaults'](_0x109d25,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5b6c43,_0x36931f){var _0x5dccda=[];if(_0x5b6c43&&_0x5b6c43['length']>0x0){_0x5dccda=_[_0xebc5('0x32')](_0x5b6c43,_0x36931f);}return _0x5dccda;}function getCustomFields(_0x7d559f,_0x241003){var _0x5d94ef=[];var _0x5d36c2={'custom_fields':[]};if(_0x7d559f[_0xebc5('0x1e')]>0x0){_[_0xebc5('0x33')](_0x7d559f,function(_0x525428){if(_0x525428[_0xebc5('0x34')]==='string'&&_0x525428['nameField']&&!_0x525428[_0xebc5('0x35')]){_0x5d36c2[_0x525428[_0xebc5('0x36')]['toLowerCase']()]=_0x525428[_0xebc5('0x37')][_0xebc5('0x2e')]();}else if(_0x525428['type']===_0xebc5('0x38')&&_0x525428[_0xebc5('0x39')]&&_0x525428[_0xebc5('0x35')]){_0x5d36c2[_0xebc5('0x15')]['push']({'id':_0x525428[_0xebc5('0x39')],'value':_0x525428[_0xebc5('0x37')][_0xebc5('0x2e')]()});}else if(_0x525428[_0xebc5('0x34')]==='variable'&&_0x525428[_0xebc5('0x3a')]&&_0x525428[_0xebc5('0x39')]&&_0x525428[_0xebc5('0x35')]){_0x241003[_0x525428[_0xebc5('0x3a')]]&&_0x5d36c2['custom_fields'][_0xebc5('0x3b')]({'id':_0x525428['idField'],'value':_0x241003[_0x525428[_0xebc5('0x3a')]][_0xebc5('0x2e')]()});}else if(_0x525428[_0xebc5('0x34')]===_0xebc5('0x3c')&&_0x525428[_0xebc5('0x3d')]&&_0x525428[_0xebc5('0x3d')][_0xebc5('0x13')]&&_0x525428[_0xebc5('0x39')]&&_0x525428[_0xebc5('0x35')]){_0x241003[_0x525428[_0xebc5('0x3d')]['name'][_0xebc5('0x3e')]()]&&_0x5d36c2[_0xebc5('0x15')]['push']({'id':_0x525428['idField'],'value':_0x241003[_0x525428[_0xebc5('0x3d')][_0xebc5('0x13')]['toLowerCase']()][_0xebc5('0x2e')]()});}});}return _0x5d36c2;}exports[_0xebc5('0x3f')]=function(_0x530afa,_0x16bd96,_0x50c1b6,_0x25bb41,_0x173163,_0x468949){var _0x35622a,_0x44008b;_0x468949[_0xebc5('0x19')]=intUtil[_0xebc5('0x40')](_0x468949[_0xebc5('0x19')]);_0x468949[_0xebc5('0x41')]=intUtil[_0xebc5('0x40')](_0x468949[_0xebc5('0x41')]);if(_0x173163&&_0x173163[_0xebc5('0x42')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x16bd96[_0xebc5('0x43')]=util[_0xebc5('0xb')](_0xebc5('0x44'),_0x468949[_0xebc5('0x41')],_0x16bd96['uniqueid'],md5(_0x16bd96[_0xebc5('0x45')]));}else{_0x16bd96[_0xebc5('0x43')]='';}headers[_0xebc5('0x46')]=getAuth(_0x468949);return getUser(_0x468949,_0x25bb41[_0xebc5('0x22')])[_0xebc5('0x1b')](function(_0x2ca3fe){_0x35622a=_0x2ca3fe;logger[_0xebc5('0x8')](_0xebc5('0x47'),_0x35622a['id']);return getEndUser(_0x468949,_0x16bd96[_0xebc5('0x48')],_0x16bd96['calleridnum']);})[_0xebc5('0x1b')](function(_0x270976){_0x44008b=_0x270976;logger[_0xebc5('0x8')](_0xebc5('0x49'),_0x44008b['id']);return getTicket(_0x468949,_0x35622a,_0x44008b,_0x50c1b6,_0x16bd96);})[_0xebc5('0x1b')](function(_0x161dfb){if(_0x161dfb&&_0x161dfb['id']){logger[_0xebc5('0x8')](_0xebc5('0x1c'));logger[_0xebc5('0x8')](_0xebc5('0x4a'),_0x161dfb['id']);logger[_0xebc5('0x8')](_0xebc5('0x4b'),_0xebc5('0x4c'));emit(util[_0xebc5('0xb')]('user:%s',_0x25bb41['name']),_0xebc5('0x4d'),{'uri':util['format'](_0xebc5('0x4e'),_0x468949[_0xebc5('0x19')],_0x161dfb['id'])});}})[_0xebc5('0x4f')](function(_0xee102e){logger[_0xebc5('0x50')](_0xebc5('0x4b'),JSON[_0xebc5('0x31')](_0xee102e));});};exports['outbound']=function(_0xaf0c66,_0xd61843,_0x4a660c,_0x53b6d5,_0x3e171d,_0x268ce1,_0x2877b1){var _0x2319fa,_0x36352c;_0x268ce1[_0xebc5('0x19')]=intUtil['stripTrailingSlash'](_0x268ce1[_0xebc5('0x19')]);_0x268ce1[_0xebc5('0x41')]=intUtil['stripTrailingSlash'](_0x268ce1[_0xebc5('0x41')]);if(_0x2877b1&&_0x2877b1['recordingFormat']&&_0x2877b1[_0xebc5('0x51')]!==_0xebc5('0x52')){logger[_0xebc5('0x8')](_0xebc5('0x53'),_0xebc5('0x54'));_0xd61843[_0xebc5('0x43')]=util[_0xebc5('0xb')](_0xebc5('0x44'),_0x268ce1[_0xebc5('0x41')],_0xd61843[_0xebc5('0x45')],md5(_0xd61843[_0xebc5('0x45')]));}headers[_0xebc5('0x46')]=getAuth(_0x268ce1);return getUser(_0x268ce1,_0x53b6d5[_0xebc5('0x22')])['then'](function(_0x3966cb){_0x2319fa=_0x3966cb;logger[_0xebc5('0x8')]('The\x20User\x20ID\x20is:',_0x2319fa['id']);return getEndUser(_0x268ce1,_0xd61843['destcalleridname'],_0xd61843[_0xebc5('0x55')]);})[_0xebc5('0x1b')](function(_0x383cc7){_0x36352c=_0x383cc7;logger['info']('The\x20Enduser\x20ID\x20is:',_0x36352c['id']);return getTicket(_0x268ce1,_0x2319fa,_0x36352c,_0x4a660c,_0xd61843);})[_0xebc5('0x1b')](function(_0x5752b0){if(_0x5752b0&&_0x5752b0['id']){logger[_0xebc5('0x8')](_0xebc5('0x1c'));logger[_0xebc5('0x8')]('The\x20Ticket\x20ID\x20is:',_0x5752b0['id']);logger[_0xebc5('0x8')]('[OUTBOUND]',_0xebc5('0x4c'));emit(util[_0xebc5('0xb')](_0xebc5('0x56'),_0x53b6d5[_0xebc5('0x13')]),'trigger:browser:url',{'uri':util['format']('%s/helpdesk/tickets/%d',_0x268ce1['remoteUri'],_0x5752b0['id'])});}})['catch'](function(_0x1778d4){logger[_0xebc5('0x50')](_0xebc5('0x53'),JSON['stringify'](_0x1778d4));});};exports[_0xebc5('0x57')]=function(_0x277892,_0x49a7a4,_0x1e6d26,_0x44c477,_0xea15ce,_0x4919e8){var _0x586503,_0x315297;_0x4919e8[_0xebc5('0x19')]=intUtil[_0xebc5('0x40')](_0x4919e8[_0xebc5('0x19')]);_0x4919e8[_0xebc5('0x41')]=intUtil[_0xebc5('0x40')](_0x4919e8[_0xebc5('0x41')]);if(_0xea15ce&&_0xea15ce['monitor_format']){logger[_0xebc5('0x8')](_0xebc5('0x58'),'Recording\x20is\x20enabled!');_0x49a7a4['recordingURL']=util[_0xebc5('0xb')](_0xebc5('0x44'),_0x4919e8[_0xebc5('0x41')],_0x49a7a4[_0xebc5('0x45')],md5(_0x49a7a4['uniqueid']));}else{_0x49a7a4[_0xebc5('0x43')]='';}headers[_0xebc5('0x46')]=getAuth(_0x4919e8);return getUser(_0x4919e8,'')[_0xebc5('0x1b')](function(_0x53e362){_0x586503=_0x53e362;logger[_0xebc5('0x8')](_0xebc5('0x47'),_0x586503['id']);return getEndUser(_0x4919e8,_0x49a7a4['calleridname'],_0x49a7a4[_0xebc5('0xd')]);})[_0xebc5('0x1b')](function(_0x47bcf6){_0x315297=_0x47bcf6;logger[_0xebc5('0x8')]('The\x20Enduser\x20ID\x20is:',_0x315297['id']);return getTicket(_0x4919e8,_0x586503,_0x315297,_0x1e6d26,_0x49a7a4);})['then'](function(_0x166fcb){if(_0x166fcb){logger[_0xebc5('0x8')](_0xebc5('0x1c'));logger[_0xebc5('0x8')](_0xebc5('0x4a'),_0x166fcb['id']);}})[_0xebc5('0x4f')](function(_0x598c21){logger[_0xebc5('0x50')](_0xebc5('0x58'),JSON[_0xebc5('0x31')](_0x598c21));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index 765e63e..868bbfe 100644 --- a/server/services/ami/trigger/integration/index.js +++ b/server/services/ami/trigger/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x579d=['%s\x20account\x20#%s\x20not\x20found','error','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow','dynamics365','exec','data1','toLowerCase','data2','data3','queue','routeId','outbound','log','unknown\x20integration','../../../../config/logger','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]'];(function(_0x3a638b,_0x8d6c9a){var _0x20ea3e=function(_0x451b30){while(--_0x451b30){_0x3a638b['push'](_0x3a638b['shift']());}};_0x20ea3e(++_0x8d6c9a);}(_0x579d,0x6e));var _0xd579=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x579d[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xd579('0x0'));var util=require(_0xd579('0x1'));var zendesk=require(_0xd579('0x2'));var salesforce=require(_0xd579('0x3'));var sugarcrm=require(_0xd579('0x4'));var freshdesk=require(_0xd579('0x5'));var zoho=require(_0xd579('0x6'));var desk=require(_0xd579('0x7'));var vtiger=require(_0xd579('0x8'));var servicenow=require(_0xd579('0x9'));var dynamics365=require(_0xd579('0xa'));var integrations=[_0xd579('0xb'),_0xd579('0xc'),_0xd579('0xd'),_0xd579('0xe'),_0xd579('0xf'),_0xd579('0x10'),_0xd579('0x11'),_0xd579('0x12'),_0xd579('0x13')];exports[_0xd579('0x14')]=function(_0x494469,_0x10a067,_0x4b89b9,_0x26b56c,_0x183f22,_0x17c4f7){if(_0x4b89b9){if(_['includes'](integrations,_0x494469[_0xd579('0x15')][_0xd579('0x16')]())){try{var _0x2ccaca=null;var _0x121d84='';var _0x5a44fc=_0x4b89b9[_0x494469['data1'][_0xd579('0x16')]()];if(_0x5a44fc){var _0x4ffb52=_0x5a44fc[_0x494469[_0xd579('0x17')]];if(_0x4ffb52){var _0x411aa2=_['find'](_0x4ffb52['Configurations'],{'id':parseInt(_0x494469[_0xd579('0x18')],0xa)});if(_0x411aa2){if(_0x26b56c){if(_0x183f22&&_0x10a067[_0xd579('0x19')]){_0x121d84=_0xd579('0x19');}else if(_0x10a067[_0xd579('0x1a')]){_0x121d84=_0xd579('0x1b');}else{console['log']('EVENT\x20UNKNOWN',_0x10a067);}}else{_0x121d84='abandoned';}switch(_0x494469['data1'][_0xd579('0x16')]()){case _0xd579('0xb'):zendesk[_0x121d84](_0x494469,_0x10a067,_0x411aa2,_0x26b56c,_0x183f22,_0x4ffb52,_0x17c4f7);break;case'salesforce':salesforce[_0x121d84](_0x494469,_0x10a067,_0x411aa2,_0x26b56c,_0x183f22,_0x4ffb52,_0x17c4f7);break;case _0xd579('0xd'):sugarcrm[_0x121d84](_0x494469,_0x10a067,_0x411aa2,_0x26b56c,_0x183f22,_0x4ffb52,_0x17c4f7);break;case _0xd579('0xe'):freshdesk[_0x121d84](_0x494469,_0x10a067,_0x411aa2,_0x26b56c,_0x183f22,_0x4ffb52,_0x17c4f7);break;case _0xd579('0xf'):zoho[_0x121d84](_0x494469,_0x10a067,_0x411aa2,_0x26b56c,_0x183f22,_0x4ffb52,_0x17c4f7);break;case _0xd579('0x10'):desk[_0x121d84](_0x494469,_0x10a067,_0x411aa2,_0x26b56c,_0x183f22,_0x4ffb52,_0x17c4f7);break;case _0xd579('0x11'):vtiger[_0x121d84](_0x494469,_0x10a067,_0x411aa2,_0x26b56c,_0x183f22,_0x4ffb52,_0x17c4f7);break;case _0xd579('0x12'):servicenow['cs'](_0x494469,_0x10a067,_0x411aa2,_0x26b56c,_0x183f22,_0x4ffb52,_0x17c4f7,_0x121d84);break;case _0xd579('0x13'):dynamics365['cs'](_0x494469,_0x10a067,_0x411aa2,_0x26b56c,_0x183f22,_0x4ffb52,_0x17c4f7,_0x121d84);break;default:console[_0xd579('0x1c')](_0xd579('0x1d'));}}else{_0x2ccaca=require(_0xd579('0x1e'))(_0x494469[_0xd579('0x15')]['toLowerCase']());_0x2ccaca['error']('[EXEC]',util[_0xd579('0x1f')](_0xd579('0x20'),_0x494469['data1'][_0xd579('0x16')](),_0x494469['data3']));}}else{_0x2ccaca=require(_0xd579('0x1e'))(_0x494469[_0xd579('0x15')][_0xd579('0x16')]());_0x2ccaca['error'](_0xd579('0x21'),util['format'](_0xd579('0x22'),_0x494469[_0xd579('0x15')]['toLowerCase'](),_0x494469['data2']));}}else{}}catch(_0x70c5ad){console[_0xd579('0x23')](_0x70c5ad);}}}}; \ No newline at end of file +var _0x00bd=['./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','vtiger','servicenow','dynamics365','includes','data1','toLowerCase','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','abandoned','desk','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./sugarcrm'];(function(_0x25c546,_0x38d6d1){var _0xefdf12=function(_0x3935a4){while(--_0x3935a4){_0x25c546['push'](_0x25c546['shift']());}};_0xefdf12(++_0x38d6d1);}(_0x00bd,0x16f));var _0xd00b=function(_0x2d26fe,_0x1bb41c){_0x2d26fe=_0x2d26fe-0x0;var _0x345556=_0x00bd[_0x2d26fe];return _0x345556;};'use strict';var _=require(_0xd00b('0x0'));var util=require(_0xd00b('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xd00b('0x2'));var freshdesk=require(_0xd00b('0x3'));var zoho=require(_0xd00b('0x4'));var desk=require(_0xd00b('0x5'));var vtiger=require(_0xd00b('0x6'));var servicenow=require(_0xd00b('0x7'));var dynamics365=require(_0xd00b('0x8'));var integrations=[_0xd00b('0x9'),_0xd00b('0xa'),_0xd00b('0xb'),_0xd00b('0xc'),_0xd00b('0xd'),'desk',_0xd00b('0xe'),_0xd00b('0xf'),_0xd00b('0x10')];exports['exec']=function(_0x3ec544,_0x51acdb,_0x175d93,_0x2802cd,_0x46436f,_0x1d4d16){if(_0x175d93){if(_[_0xd00b('0x11')](integrations,_0x3ec544[_0xd00b('0x12')][_0xd00b('0x13')]())){try{var _0x5954cc=null;var _0x2d598c='';var _0x33d394=_0x175d93[_0x3ec544[_0xd00b('0x12')][_0xd00b('0x13')]()];if(_0x33d394){var _0x588d55=_0x33d394[_0x3ec544['data2']];if(_0x588d55){var _0x5622a7=_[_0xd00b('0x14')](_0x588d55[_0xd00b('0x15')],{'id':parseInt(_0x3ec544[_0xd00b('0x16')],0xa)});if(_0x5622a7){if(_0x2802cd){if(_0x46436f&&_0x51acdb['queue']){_0x2d598c=_0xd00b('0x17');}else if(_0x51acdb[_0xd00b('0x18')]){_0x2d598c='outbound';}else{console[_0xd00b('0x19')](_0xd00b('0x1a'),_0x51acdb);}}else{_0x2d598c=_0xd00b('0x1b');}switch(_0x3ec544[_0xd00b('0x12')][_0xd00b('0x13')]()){case _0xd00b('0x9'):zendesk[_0x2d598c](_0x3ec544,_0x51acdb,_0x5622a7,_0x2802cd,_0x46436f,_0x588d55,_0x1d4d16);break;case _0xd00b('0xa'):salesforce[_0x2d598c](_0x3ec544,_0x51acdb,_0x5622a7,_0x2802cd,_0x46436f,_0x588d55,_0x1d4d16);break;case _0xd00b('0xb'):sugarcrm[_0x2d598c](_0x3ec544,_0x51acdb,_0x5622a7,_0x2802cd,_0x46436f,_0x588d55,_0x1d4d16);break;case _0xd00b('0xc'):freshdesk[_0x2d598c](_0x3ec544,_0x51acdb,_0x5622a7,_0x2802cd,_0x46436f,_0x588d55,_0x1d4d16);break;case _0xd00b('0xd'):zoho[_0x2d598c](_0x3ec544,_0x51acdb,_0x5622a7,_0x2802cd,_0x46436f,_0x588d55,_0x1d4d16);break;case _0xd00b('0x1c'):desk[_0x2d598c](_0x3ec544,_0x51acdb,_0x5622a7,_0x2802cd,_0x46436f,_0x588d55,_0x1d4d16);break;case'vtiger':vtiger[_0x2d598c](_0x3ec544,_0x51acdb,_0x5622a7,_0x2802cd,_0x46436f,_0x588d55,_0x1d4d16);break;case _0xd00b('0xf'):servicenow['cs'](_0x3ec544,_0x51acdb,_0x5622a7,_0x2802cd,_0x46436f,_0x588d55,_0x1d4d16,_0x2d598c);break;case _0xd00b('0x10'):dynamics365['cs'](_0x3ec544,_0x51acdb,_0x5622a7,_0x2802cd,_0x46436f,_0x588d55,_0x1d4d16,_0x2d598c);break;default:console[_0xd00b('0x19')](_0xd00b('0x1d'));}}else{_0x5954cc=require(_0xd00b('0x1e'))(_0x3ec544[_0xd00b('0x12')][_0xd00b('0x13')]());_0x5954cc['error'](_0xd00b('0x1f'),util[_0xd00b('0x20')](_0xd00b('0x21'),_0x3ec544[_0xd00b('0x12')][_0xd00b('0x13')](),_0x3ec544[_0xd00b('0x16')]));}}else{_0x5954cc=require(_0xd00b('0x1e'))(_0x3ec544[_0xd00b('0x12')][_0xd00b('0x13')]());_0x5954cc[_0xd00b('0x22')](_0xd00b('0x1f'),util['format'](_0xd00b('0x23'),_0x3ec544[_0xd00b('0x12')][_0xd00b('0x13')](),_0x3ec544[_0xd00b('0x24')]));}}else{}}catch(_0x6059dd){console[_0xd00b('0x22')](_0x6059dd);}}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index 971b5ee..436dc12 100644 --- a/server/services/ami/trigger/integration/salesforce.js +++ b/server/services/ami/trigger/integration/salesforce.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa70f=['recordingFormat','none','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','abandoned','monitor_format','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','ticketType','Task','utc','getString','Subjects','Descriptions','WhoId','Case','assign','ContactId','sobject','create','isNil','validateEmail','User','find','then','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','execute','Lead','contact','Contact','length','Phone','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','No\x20Company','upperFirst','forEach','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','password','securityToken','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound'];(function(_0x38524e,_0x25fb57){var _0x1cc2ec=function(_0x3f6700){while(--_0x3f6700){_0x38524e['push'](_0x38524e['shift']());}};_0x1cc2ec(++_0x25fb57);}(_0xa70f,0xf1));var _0xfa70=function(_0xf82f51,_0xab3b42){_0xf82f51=_0xf82f51-0x0;var _0x44f926=_0xa70f[_0xf82f51];return _0x44f926;};'use strict';var _=require(_0xfa70('0x0'));var rp=require(_0xfa70('0x1'));var moment=require(_0xfa70('0x2'));var BPromise=require(_0xfa70('0x3'));var md5=require(_0xfa70('0x4'));var jsforce=require('jsforce');var util=require(_0xfa70('0x5'));var Redis=require(_0xfa70('0x6'));var intUtil=require(_0xfa70('0x7'));var config=require(_0xfa70('0x8'));var logger=require(_0xfa70('0x9'))(_0xfa70('0xa'));config[_0xfa70('0xb')]=_[_0xfa70('0xc')](config[_0xfa70('0xb')],{'host':_0xfa70('0xd'),'port':0x18eb});var io=require(_0xfa70('0xe'))(new Redis(config['redis']));function emit(_0x58a6a1,_0xbbecbc,_0x3b5db5){io['to'](_0x58a6a1)['emit'](_0xbbecbc,_0x3b5db5);}function getTicket(_0x1b5bdd,_0x3b8009,_0x170ae3,_0x57a5d0,_0x497fbc,_0x264cd3,_0x6237b5,_0x4cbbb5){var _0x1ed0b0={};if(_0x57a5d0[_0xfa70('0xf')]===_0xfa70('0x10')){_0x1ed0b0=Object['assign']({},{'OwnerId':_0x3b8009['id'],'ActivityDate':moment[_0xfa70('0x11')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xfa70('0x12')](_0x57a5d0[_0xfa70('0x13')],_0x497fbc,'\x20'),'Description':intUtil[_0xfa70('0x12')](_0x57a5d0[_0xfa70('0x14')],_0x497fbc,'\x0a')},getCustomFields(_0x264cd3,_0x497fbc));if(_0x170ae3){_0x1ed0b0[_0xfa70('0x15')]=_0x170ae3['id'];}}else if(_0x57a5d0['ticketType']===_0xfa70('0x16')){_0x1ed0b0=Object[_0xfa70('0x17')]({},{'OwnerId':_0x3b8009['id'],'Subject':intUtil[_0xfa70('0x12')](_0x57a5d0['Subjects'],_0x497fbc,'\x20'),'Description':intUtil[_0xfa70('0x12')](_0x57a5d0[_0xfa70('0x14')],_0x497fbc,'\x0a')},getCustomFields(_0x264cd3,_0x497fbc));if(_0x170ae3){_0x1ed0b0[_0xfa70('0x18')]=_0x170ae3['id'];}}return _0x6237b5[_0xfa70('0x19')](_0x57a5d0['ticketType'])[_0xfa70('0x1a')](_0x1ed0b0);}function getUser(_0x5bb6e5,_0x22888f,_0x2493b8){if(!_[_0xfa70('0x1b')](_0x22888f)&&intUtil[_0xfa70('0x1c')](_0x22888f)){var _0x3bd30b={'Email':_0x22888f};var _0x1d0acf={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2493b8['sobject'](_0xfa70('0x1d'))[_0xfa70('0x1e')](_0x3bd30b,_0x1d0acf)['execute']()[_0xfa70('0x1f')](function(_0x53c29b){if(_0x53c29b['length']){var _0x1386ac=_[_0xfa70('0x1e')](_0x53c29b,function(_0x149897){return _0x149897[_0xfa70('0x20')]===_0x22888f;});if(_0x1386ac){logger[_0xfa70('0x21')](_0xfa70('0x22'),_0x22888f);return BPromise[_0xfa70('0x23')]({'id':_0x1386ac['Id'],'name':_0x1386ac[_0xfa70('0x24')]});}}else{logger[_0xfa70('0x21')](_0xfa70('0x25'),_0x22888f);return _0x2493b8[_0xfa70('0x26')]()[_0xfa70('0x1f')](function(_0x360c61){return BPromise[_0xfa70('0x23')]({'id':_0x360c61[_0xfa70('0x27')],'name':_0x360c61['display_name']});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x22888f);return _0x2493b8[_0xfa70('0x26')]()[_0xfa70('0x1f')](function(_0x3cafd4){return BPromise[_0xfa70('0x23')]({'id':_0x3cafd4[_0xfa70('0x27')],'name':_0x3cafd4[_0xfa70('0x28')]});});}}function getEndUser(_0x1efcb7,_0x4259d8,_0x5917a9,_0x5fa372,_0x49671f){var _0x37e883={'Phone':_0x5fa372};var _0x16325f={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xfa70('0x23')]()['then'](function(){if(_0x4259d8[_0xfa70('0xf')]===_0xfa70('0x10')){logger['info'](_0xfa70('0x29'),_0x5fa372,_0x4259d8['moduleSearch']);switch(_0x4259d8[_0xfa70('0x2a')]){case'contact_lead':return _0x49671f[_0xfa70('0x19')]('Contact')[_0xfa70('0x1e')](_0x37e883,_0x16325f)[_0xfa70('0x2b')]()[_0xfa70('0x1f')](function(_0x37b9d2){if(_0x37b9d2&&_0x37b9d2['length']){return _0x37b9d2;}else{return _0x49671f[_0xfa70('0x19')](_0xfa70('0x2c'))[_0xfa70('0x1e')](_0x37e883,_0x16325f);}});case _0xfa70('0x2d'):return _0x49671f['sobject']('Contact')['find'](_0x37e883,_0x16325f)['execute']();case'lead':return _0x49671f['sobject']('Lead')[_0xfa70('0x1e')](_0x37e883,_0x16325f);default:return null;}}else if(_0x4259d8[_0xfa70('0xf')]===_0xfa70('0x16')){logger['info'](_0xfa70('0x29'),_0x5fa372,_0xfa70('0x2d'));return _0x49671f['sobject'](_0xfa70('0x2e'))[_0xfa70('0x1e')](_0x37e883,_0x16325f)[_0xfa70('0x2b')]();}})[_0xfa70('0x1f')](function(_0x15c283){if(_0x15c283&&_0x15c283[_0xfa70('0x2f')]){var _0xe03f15=_[_0xfa70('0x1e')](_0x15c283,function(_0x5852e8){return _0x5852e8['Phone']===_0x5fa372;});if(_0xe03f15){return BPromise['resolve']({'id':_0xe03f15['Id'],'name':_0xe03f15[_0xfa70('0x24')],'phone':_0xe03f15[_0xfa70('0x30')]});}}})['then'](function(_0x1bdf95){if(_0x1bdf95){logger['info']('Enduser\x20with\x20phone\x20%s\x20found.',_0x5fa372);return BPromise[_0xfa70('0x23')](_0x1bdf95);}else{logger['info'](_0xfa70('0x31'),_0x5fa372);var _0x42643f={'LastName':_0x5917a9!==_0xfa70('0x32')?_0x5917a9:util[_0xfa70('0x33')](_0xfa70('0x34'),_0x5fa372),'Phone':_0x5fa372};if(_0x4259d8[_0xfa70('0x35')]){if(_0x4259d8['moduleCreate']==='contact'){logger['info'](_0xfa70('0x36'),_0x5fa372,_0x4259d8[_0xfa70('0x35')]);}else if(_0x4259d8[_0xfa70('0x35')]==='lead'&&_0x4259d8['ticketType']==='Task'){logger[_0xfa70('0x21')](_0xfa70('0x36'),_0x5fa372,_0x4259d8[_0xfa70('0x35')]);_0x42643f['Company']=_0xfa70('0x37');}else{return null;}}return _0x49671f[_0xfa70('0x19')](_[_0xfa70('0x38')](_0x4259d8[_0xfa70('0x35')]))[_0xfa70('0x1a')](_0x42643f);}});}function getCustomFields(_0x5355b5,_0x8714c0){var _0x2b47e3={};if(_0x5355b5[_0xfa70('0x2f')]>0x0){_[_0xfa70('0x39')](_0x5355b5,function(_0x2c055f){if(_0x2c055f[_0xfa70('0x3a')]==='string'&&_0x2c055f[_0xfa70('0x3b')]){_0x2b47e3[_0x2c055f['idField']]=_0x2c055f[_0xfa70('0x3c')][_0xfa70('0x3d')]();}else if(_0x2c055f[_0xfa70('0x3a')]===_0xfa70('0x3e')&&_0x2c055f['variableName']&&_0x2c055f['idField']){_0x8714c0[_0x2c055f['variableName']]&&(_0x2b47e3[_0x2c055f['idField']]=_0x8714c0[_0x2c055f[_0xfa70('0x3f')]][_0xfa70('0x3d')]());}else if(_0x2c055f['type']==='customVariable'&&_0x2c055f[_0xfa70('0x40')]&&_0x2c055f[_0xfa70('0x40')][_0xfa70('0x41')]&&_0x2c055f['idField']){_0x8714c0[_0x2c055f[_0xfa70('0x40')][_0xfa70('0x41')][_0xfa70('0x42')]()]&&(_0x2b47e3[_0x2c055f[_0xfa70('0x3b')]]=_0x8714c0[_0x2c055f[_0xfa70('0x40')]['name'][_0xfa70('0x42')]()][_0xfa70('0x3d')]());}});}return _0x2b47e3;}function getConnection(_0x20ad85){var _0x43d2e3=_0x20ad85[_0xfa70('0x43')]['concat'](_0x20ad85[_0xfa70('0x44')]);var _0xf9f8a4=new jsforce['Connection']({'oauth2':{'loginUrl':_0x20ad85['remoteUri']||_0xfa70('0x45'),'clientId':_0x20ad85[_0xfa70('0x46')],'clientSecret':_0x20ad85[_0xfa70('0x47')]}});return _0xf9f8a4[_0xfa70('0x48')](_0x20ad85[_0xfa70('0x49')],_0x43d2e3)['then'](function(){logger[_0xfa70('0x21')](_0xfa70('0x4a'));return _0xf9f8a4;});}exports[_0xfa70('0x4b')]=function(_0x5655db,_0x1bf556,_0xad2823,_0x2e2cfe,_0x142dad,_0x4a9d26){var _0x1efc36,_0x255867,_0x149aab,_0x5c48ea;_0x4a9d26[_0xfa70('0x4c')]=intUtil[_0xfa70('0x4d')](_0x4a9d26[_0xfa70('0x4c')]);_0x4a9d26['remoteUri']=intUtil[_0xfa70('0x4d')](_0x4a9d26[_0xfa70('0x4e')]);if(_0x142dad&&_0x142dad['monitor_format']){logger[_0xfa70('0x21')](_0xfa70('0x4f'),_0xfa70('0x50'));_0x1bf556['recordingURL']=util[_0xfa70('0x33')](_0xfa70('0x51'),_0x4a9d26['serverUrl'],_0x1bf556['uniqueid'],md5(_0x1bf556[_0xfa70('0x52')]));}else{_0x1bf556[_0xfa70('0x53')]='';}return getConnection(_0x4a9d26)[_0xfa70('0x1f')](function(_0x234f48){_0x5c48ea=_0x234f48;return getUser(_0x4a9d26,_0x2e2cfe[_0xfa70('0x54')],_0x5c48ea);})[_0xfa70('0x1f')](function(_0x231e3e){_0x1efc36=_0x231e3e;return getEndUser(_0x4a9d26,_0xad2823,_0x1bf556[_0xfa70('0x55')],_0x1bf556[_0xfa70('0x56')],_0x5c48ea);})['then'](function(_0xf14263){_0x255867=_0xf14263;return getTicket(_0x4a9d26,_0x1efc36,_0x255867,_0xad2823,_0x1bf556,_0xad2823[_0xfa70('0x57')],_0x5c48ea,_0xfa70('0x4b'));})[_0xfa70('0x1f')](function(_0x484906){_0x149aab=_0x484906;logger['info'](_0xfa70('0x58'),_0x149aab['id']);logger[_0xfa70('0x21')](_0xfa70('0x59'),_0x149aab['id'],_0x2e2cfe[_0xfa70('0x41')],_0x4a9d26[_0xfa70('0x3a')]);switch(_0x4a9d26[_0xfa70('0x3a')]){case'integrationTab':emit(util[_0xfa70('0x33')]('user:%s',_0x2e2cfe[_0xfa70('0x41')]),_0xfa70('0x5a'),{'recordId':_0x149aab['id']});break;case _0xfa70('0x5b'):emit(util[_0xfa70('0x33')](_0xfa70('0x5c'),_0x2e2cfe['name']),_0xfa70('0x5d'),{'uri':util['format'](_0xfa70('0x5e'),_0x5c48ea[_0xfa70('0x5f')],_0x149aab['id'])});break;default:logger[_0xfa70('0x60')](_0xfa70('0x61'));}})[_0xfa70('0x62')](function(_0x11b425){logger[_0xfa70('0x60')](_0xfa70('0x4f'),JSON[_0xfa70('0x63')](_0x11b425));});};exports[_0xfa70('0x64')]=function(_0x24dedd,_0x1c9cfc,_0x5d3d63,_0x2de28a,_0x1406d4,_0x5e864f,_0x17e2e1){var _0x226b44,_0x506198,_0xf0ca89,_0xf6107a;_0x5e864f[_0xfa70('0x4c')]=intUtil[_0xfa70('0x4d')](_0x5e864f['serverUrl']);_0x5e864f[_0xfa70('0x4e')]=intUtil[_0xfa70('0x4d')](_0x5e864f[_0xfa70('0x4e')]);if(_0x17e2e1&&_0x17e2e1['recordingFormat']&&_0x17e2e1[_0xfa70('0x65')]!==_0xfa70('0x66')){logger[_0xfa70('0x21')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1c9cfc['recordingURL']=util[_0xfa70('0x33')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e864f[_0xfa70('0x4c')],_0x1c9cfc[_0xfa70('0x52')],md5(_0x1c9cfc[_0xfa70('0x52')]));}return getConnection(_0x5e864f)[_0xfa70('0x1f')](function(_0x3a7a45){_0xf6107a=_0x3a7a45;return getUser(_0x5e864f,_0x2de28a[_0xfa70('0x54')],_0xf6107a);})[_0xfa70('0x1f')](function(_0x288b4e){_0x226b44=_0x288b4e;return getEndUser(_0x5e864f,_0x5d3d63,_0x1c9cfc[_0xfa70('0x67')],_0x1c9cfc['destcalleridnum'],_0xf6107a);})[_0xfa70('0x1f')](function(_0x314827){_0x506198=_0x314827;return getTicket(_0x5e864f,_0x226b44,_0x506198,_0x5d3d63,_0x1c9cfc,_0x5d3d63[_0xfa70('0x57')],_0xf6107a,'outbound');})[_0xfa70('0x1f')](function(_0x46ac05){_0xf0ca89=_0x46ac05;logger['info'](_0xfa70('0x68'),_0xf0ca89['id']);logger[_0xfa70('0x21')](_0xfa70('0x69'),_0xf0ca89['id'],_0x2de28a['name'],_0x5e864f['type']);switch(_0x5e864f[_0xfa70('0x3a')]){case _0xfa70('0x6a'):emit(util[_0xfa70('0x33')](_0xfa70('0x5c'),_0x2de28a[_0xfa70('0x41')]),_0xfa70('0x5a'),{'recordId':_0xf0ca89['id']});break;case'newTab':emit(util[_0xfa70('0x33')](_0xfa70('0x5c'),_0x2de28a[_0xfa70('0x41')]),_0xfa70('0x5d'),{'uri':util['format'](_0xfa70('0x5e'),_0xf6107a[_0xfa70('0x5f')],_0xf0ca89['id'])});break;default:logger['error'](_0xfa70('0x6b'),_0xfa70('0x6c'));}})[_0xfa70('0x62')](function(_0x241a49){logger[_0xfa70('0x60')](_0xfa70('0x6b'),JSON['stringify'](_0x241a49));});};exports[_0xfa70('0x6d')]=function(_0x2336e0,_0x2dc27b,_0x584067,_0x10723d,_0x479916,_0x27dc77){var _0x418c55,_0x4661d1,_0x40e3c2,_0x1998bc;_0x27dc77[_0xfa70('0x4c')]=intUtil[_0xfa70('0x4d')](_0x27dc77[_0xfa70('0x4c')]);_0x27dc77[_0xfa70('0x4e')]=intUtil['stripTrailingSlash'](_0x27dc77['remoteUri']);if(_0x479916&&_0x479916[_0xfa70('0x6e')]){logger[_0xfa70('0x21')](_0xfa70('0x6f'),_0xfa70('0x50'));_0x2dc27b[_0xfa70('0x53')]=util[_0xfa70('0x33')](_0xfa70('0x51'),_0x27dc77[_0xfa70('0x4c')],_0x2dc27b[_0xfa70('0x52')],md5(_0x2dc27b[_0xfa70('0x52')]));}else{_0x2dc27b['recordingURL']='';}return getConnection(_0x27dc77)['then'](function(_0x474fe2){_0x1998bc=_0x474fe2;if(!_['isNil'](_0x10723d)){return getUser(_0x27dc77,_0x10723d[_0xfa70('0x41')],_0x1998bc);}else{return getUser(_0x27dc77,null,_0x1998bc);}})[_0xfa70('0x1f')](function(_0x4d10b0){_0x418c55=_0x4d10b0;return getEndUser(_0x27dc77,_0x584067,_0x2dc27b[_0xfa70('0x55')],_0x2dc27b[_0xfa70('0x56')],_0x1998bc);})[_0xfa70('0x1f')](function(_0x232d1a){_0x4661d1=_0x232d1a;return getTicket(_0x27dc77,_0x418c55,_0x4661d1,_0x584067,_0x2dc27b,_0x584067[_0xfa70('0x57')],_0x1998bc);})[_0xfa70('0x1f')](function(_0x16ec65){_0x40e3c2=_0x16ec65;logger[_0xfa70('0x21')](_0xfa70('0x70'),_0x40e3c2['id']);logger[_0xfa70('0x21')](_0xfa70('0x71'),_0x27dc77[_0xfa70('0x3a')]);})[_0xfa70('0x62')](function(_0x58f6ef){logger[_0xfa70('0x60')](_0xfa70('0x6f'),JSON[_0xfa70('0x63')](_0x58f6ef));});}; \ No newline at end of file +var _0xe6be=['securityToken','remoteUri','https://login.salesforce.com','login','Connection\x20established.','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','queue','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','error','[QUEUE]','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','catch','monitor_format','[ABANDONED]','isNil','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','util','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','socket.io-emitter','emit','Task','assign','utc','getString','Subjects','Descriptions','WhoId','ticketType','Case','ContactId','create','User','execute','then','length','find','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','moduleSearch','contact_lead','sobject','Contact','lead','Lead','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat'];(function(_0x55d946,_0x644bc4){var _0xc53385=function(_0x58f237){while(--_0x58f237){_0x55d946['push'](_0x55d946['shift']());}};_0xc53385(++_0x644bc4);}(_0xe6be,0x101));var _0xee6b=function(_0x21c6b0,_0x1269c4){_0x21c6b0=_0x21c6b0-0x0;var _0x57e7c3=_0xe6be[_0x21c6b0];return _0x57e7c3;};'use strict';var _=require(_0xee6b('0x0'));var rp=require('request-promise');var moment=require(_0xee6b('0x1'));var BPromise=require(_0xee6b('0x2'));var md5=require('md5');var jsforce=require('jsforce');var util=require(_0xee6b('0x3'));var Redis=require(_0xee6b('0x4'));var intUtil=require(_0xee6b('0x5'));var config=require(_0xee6b('0x6'));var logger=require('../../../../config/logger')(_0xee6b('0x7'));config[_0xee6b('0x8')]=_[_0xee6b('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xee6b('0xa'))(new Redis(config[_0xee6b('0x8')]));function emit(_0x196831,_0x2cc9b0,_0x862cbc){io['to'](_0x196831)[_0xee6b('0xb')](_0x2cc9b0,_0x862cbc);}function getTicket(_0x2ffcec,_0x3c178e,_0x2a2545,_0x2da826,_0x19293f,_0x4b16b3,_0x1c645c,_0x5699b9){var _0x52a0ea={};if(_0x2da826['ticketType']===_0xee6b('0xc')){_0x52a0ea=Object[_0xee6b('0xd')]({},{'OwnerId':_0x3c178e['id'],'ActivityDate':moment[_0xee6b('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xee6b('0xf')](_0x2da826[_0xee6b('0x10')],_0x19293f,'\x20'),'Description':intUtil['getString'](_0x2da826[_0xee6b('0x11')],_0x19293f,'\x0a')},getCustomFields(_0x4b16b3,_0x19293f));if(_0x2a2545){_0x52a0ea[_0xee6b('0x12')]=_0x2a2545['id'];}}else if(_0x2da826[_0xee6b('0x13')]===_0xee6b('0x14')){_0x52a0ea=Object[_0xee6b('0xd')]({},{'OwnerId':_0x3c178e['id'],'Subject':intUtil[_0xee6b('0xf')](_0x2da826[_0xee6b('0x10')],_0x19293f,'\x20'),'Description':intUtil[_0xee6b('0xf')](_0x2da826[_0xee6b('0x11')],_0x19293f,'\x0a')},getCustomFields(_0x4b16b3,_0x19293f));if(_0x2a2545){_0x52a0ea[_0xee6b('0x15')]=_0x2a2545['id'];}}return _0x1c645c['sobject'](_0x2da826[_0xee6b('0x13')])[_0xee6b('0x16')](_0x52a0ea);}function getUser(_0x2e397f,_0x1d43cf,_0x582d4b){if(!_['isNil'](_0x1d43cf)&&intUtil['validateEmail'](_0x1d43cf)){var _0x186037={'Email':_0x1d43cf};var _0x35c014={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x582d4b['sobject'](_0xee6b('0x17'))['find'](_0x186037,_0x35c014)[_0xee6b('0x18')]()[_0xee6b('0x19')](function(_0x3bac3b){if(_0x3bac3b[_0xee6b('0x1a')]){var _0xb79c3c=_[_0xee6b('0x1b')](_0x3bac3b,function(_0x518820){return _0x518820['Email']===_0x1d43cf;});if(_0xb79c3c){logger[_0xee6b('0x1c')](_0xee6b('0x1d'),_0x1d43cf);return BPromise[_0xee6b('0x1e')]({'id':_0xb79c3c['Id'],'name':_0xb79c3c[_0xee6b('0x1f')]});}}else{logger[_0xee6b('0x1c')](_0xee6b('0x20'),_0x1d43cf);return _0x582d4b['identity']()[_0xee6b('0x19')](function(_0x11c507){return BPromise[_0xee6b('0x1e')]({'id':_0x11c507[_0xee6b('0x21')],'name':_0x11c507[_0xee6b('0x22')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1d43cf);return _0x582d4b[_0xee6b('0x23')]()[_0xee6b('0x19')](function(_0x357376){return BPromise['resolve']({'id':_0x357376[_0xee6b('0x21')],'name':_0x357376[_0xee6b('0x22')]});});}}function getEndUser(_0x4b79c1,_0x35a4a6,_0x29b2e4,_0x2fd3f1,_0x2d8ac5){var _0x4d5488={'Phone':_0x2fd3f1};var _0x2baa41={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xee6b('0x1e')]()['then'](function(){if(_0x35a4a6[_0xee6b('0x13')]===_0xee6b('0xc')){logger[_0xee6b('0x1c')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x2fd3f1,_0x35a4a6['moduleSearch']);switch(_0x35a4a6[_0xee6b('0x24')]){case _0xee6b('0x25'):return _0x2d8ac5[_0xee6b('0x26')](_0xee6b('0x27'))[_0xee6b('0x1b')](_0x4d5488,_0x2baa41)[_0xee6b('0x18')]()[_0xee6b('0x19')](function(_0x1b7cdc){if(_0x1b7cdc&&_0x1b7cdc[_0xee6b('0x1a')]){return _0x1b7cdc;}else{return _0x2d8ac5[_0xee6b('0x26')]('Lead')[_0xee6b('0x1b')](_0x4d5488,_0x2baa41);}});case'contact':return _0x2d8ac5[_0xee6b('0x26')](_0xee6b('0x27'))[_0xee6b('0x1b')](_0x4d5488,_0x2baa41)['execute']();case _0xee6b('0x28'):return _0x2d8ac5['sobject'](_0xee6b('0x29'))[_0xee6b('0x1b')](_0x4d5488,_0x2baa41);default:return null;}}else if(_0x35a4a6[_0xee6b('0x13')]===_0xee6b('0x14')){logger[_0xee6b('0x1c')](_0xee6b('0x2a'),_0x2fd3f1,_0xee6b('0x2b'));return _0x2d8ac5[_0xee6b('0x26')]('Contact')['find'](_0x4d5488,_0x2baa41)['execute']();}})[_0xee6b('0x19')](function(_0x250743){if(_0x250743&&_0x250743[_0xee6b('0x1a')]){var _0x54f8eb=_[_0xee6b('0x1b')](_0x250743,function(_0x175fe5){return _0x175fe5[_0xee6b('0x2c')]===_0x2fd3f1;});if(_0x54f8eb){return BPromise['resolve']({'id':_0x54f8eb['Id'],'name':_0x54f8eb[_0xee6b('0x1f')],'phone':_0x54f8eb['Phone']});}}})[_0xee6b('0x19')](function(_0x97b8b){if(_0x97b8b){logger['info'](_0xee6b('0x2d'),_0x2fd3f1);return BPromise[_0xee6b('0x1e')](_0x97b8b);}else{logger[_0xee6b('0x1c')](_0xee6b('0x2e'),_0x2fd3f1);var _0x4d9a45={'LastName':_0x29b2e4!==_0xee6b('0x2f')?_0x29b2e4:util[_0xee6b('0x30')]('Caller\x20-\x20%s',_0x2fd3f1),'Phone':_0x2fd3f1};if(_0x35a4a6[_0xee6b('0x31')]){if(_0x35a4a6[_0xee6b('0x31')]==='contact'){logger[_0xee6b('0x1c')](_0xee6b('0x32'),_0x2fd3f1,_0x35a4a6[_0xee6b('0x31')]);}else if(_0x35a4a6['moduleCreate']===_0xee6b('0x28')&&_0x35a4a6[_0xee6b('0x13')]===_0xee6b('0xc')){logger['info'](_0xee6b('0x32'),_0x2fd3f1,_0x35a4a6['moduleCreate']);_0x4d9a45[_0xee6b('0x33')]=_0xee6b('0x34');}else{return null;}}return _0x2d8ac5['sobject'](_[_0xee6b('0x35')](_0x35a4a6[_0xee6b('0x31')]))['create'](_0x4d9a45);}});}function getCustomFields(_0xb1a49a,_0x404ad9){var _0x104ce3={};if(_0xb1a49a[_0xee6b('0x1a')]>0x0){_['forEach'](_0xb1a49a,function(_0x3c6f69){if(_0x3c6f69[_0xee6b('0x36')]===_0xee6b('0x37')&&_0x3c6f69[_0xee6b('0x38')]){_0x104ce3[_0x3c6f69['idField']]=_0x3c6f69[_0xee6b('0x39')][_0xee6b('0x3a')]();}else if(_0x3c6f69['type']===_0xee6b('0x3b')&&_0x3c6f69[_0xee6b('0x3c')]&&_0x3c6f69[_0xee6b('0x38')]){_0x404ad9[_0x3c6f69[_0xee6b('0x3c')]]&&(_0x104ce3[_0x3c6f69[_0xee6b('0x38')]]=_0x404ad9[_0x3c6f69[_0xee6b('0x3c')]][_0xee6b('0x3a')]());}else if(_0x3c6f69['type']===_0xee6b('0x3d')&&_0x3c6f69['Variable']&&_0x3c6f69[_0xee6b('0x3e')][_0xee6b('0x3f')]&&_0x3c6f69[_0xee6b('0x38')]){_0x404ad9[_0x3c6f69[_0xee6b('0x3e')][_0xee6b('0x3f')][_0xee6b('0x40')]()]&&(_0x104ce3[_0x3c6f69[_0xee6b('0x38')]]=_0x404ad9[_0x3c6f69[_0xee6b('0x3e')][_0xee6b('0x3f')][_0xee6b('0x40')]()][_0xee6b('0x3a')]());}});}return _0x104ce3;}function getConnection(_0xe11cdc){var _0x545f91=_0xe11cdc[_0xee6b('0x41')][_0xee6b('0x42')](_0xe11cdc[_0xee6b('0x43')]);var _0x5de501=new jsforce['Connection']({'oauth2':{'loginUrl':_0xe11cdc[_0xee6b('0x44')]||_0xee6b('0x45'),'clientId':_0xe11cdc['clientId'],'clientSecret':_0xe11cdc['clientSecret']}});return _0x5de501[_0xee6b('0x46')](_0xe11cdc['username'],_0x545f91)[_0xee6b('0x19')](function(){logger[_0xee6b('0x1c')](_0xee6b('0x47'));return _0x5de501;});}exports['queue']=function(_0x42cd85,_0x3cb97d,_0x3e9f70,_0x32a89e,_0x174db8,_0x5489ca){var _0x31a4af,_0x244a0c,_0xa10ffd,_0x2607ca;_0x5489ca[_0xee6b('0x48')]=intUtil[_0xee6b('0x49')](_0x5489ca[_0xee6b('0x48')]);_0x5489ca[_0xee6b('0x44')]=intUtil[_0xee6b('0x49')](_0x5489ca['remoteUri']);if(_0x174db8&&_0x174db8['monitor_format']){logger[_0xee6b('0x1c')]('[QUEUE]',_0xee6b('0x4a'));_0x3cb97d[_0xee6b('0x4b')]=util[_0xee6b('0x30')](_0xee6b('0x4c'),_0x5489ca[_0xee6b('0x48')],_0x3cb97d[_0xee6b('0x4d')],md5(_0x3cb97d[_0xee6b('0x4d')]));}else{_0x3cb97d[_0xee6b('0x4b')]='';}return getConnection(_0x5489ca)[_0xee6b('0x19')](function(_0x54cabc){_0x2607ca=_0x54cabc;return getUser(_0x5489ca,_0x32a89e[_0xee6b('0x4e')],_0x2607ca);})[_0xee6b('0x19')](function(_0x56df14){_0x31a4af=_0x56df14;return getEndUser(_0x5489ca,_0x3e9f70,_0x3cb97d[_0xee6b('0x4f')],_0x3cb97d[_0xee6b('0x50')],_0x2607ca);})[_0xee6b('0x19')](function(_0x43222e){_0x244a0c=_0x43222e;return getTicket(_0x5489ca,_0x31a4af,_0x244a0c,_0x3e9f70,_0x3cb97d,_0x3e9f70['Fields'],_0x2607ca,_0xee6b('0x51'));})['then'](function(_0x2790ff){_0xa10ffd=_0x2790ff;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0xa10ffd['id']);logger[_0xee6b('0x1c')](_0xee6b('0x52'),_0xa10ffd['id'],_0x32a89e[_0xee6b('0x3f')],_0x5489ca['type']);switch(_0x5489ca[_0xee6b('0x36')]){case'integrationTab':emit(util[_0xee6b('0x30')](_0xee6b('0x53'),_0x32a89e['name']),_0xee6b('0x54'),{'recordId':_0xa10ffd['id']});break;case _0xee6b('0x55'):emit(util[_0xee6b('0x30')](_0xee6b('0x53'),_0x32a89e[_0xee6b('0x3f')]),_0xee6b('0x56'),{'uri':util[_0xee6b('0x30')](_0xee6b('0x57'),_0x2607ca[_0xee6b('0x58')],_0xa10ffd['id'])});break;default:logger['error'](_0xee6b('0x59'));}})['catch'](function(_0x391e50){logger[_0xee6b('0x5a')](_0xee6b('0x5b'),JSON[_0xee6b('0x5c')](_0x391e50));});};exports[_0xee6b('0x5d')]=function(_0x574a4a,_0x56aa79,_0x45e2ca,_0x24a6a4,_0x3c80f8,_0x9341aa,_0x57bb36){var _0x58bbb4,_0x2c0349,_0x3b26a4,_0x3705a1;_0x9341aa[_0xee6b('0x48')]=intUtil[_0xee6b('0x49')](_0x9341aa[_0xee6b('0x48')]);_0x9341aa[_0xee6b('0x44')]=intUtil[_0xee6b('0x49')](_0x9341aa[_0xee6b('0x44')]);if(_0x57bb36&&_0x57bb36[_0xee6b('0x5e')]&&_0x57bb36[_0xee6b('0x5e')]!==_0xee6b('0x5f')){logger['info'](_0xee6b('0x60'),_0xee6b('0x4a'));_0x56aa79['recordingURL']=util[_0xee6b('0x30')](_0xee6b('0x4c'),_0x9341aa[_0xee6b('0x48')],_0x56aa79[_0xee6b('0x4d')],md5(_0x56aa79[_0xee6b('0x4d')]));}return getConnection(_0x9341aa)[_0xee6b('0x19')](function(_0x548397){_0x3705a1=_0x548397;return getUser(_0x9341aa,_0x24a6a4[_0xee6b('0x4e')],_0x3705a1);})[_0xee6b('0x19')](function(_0x1ce843){_0x58bbb4=_0x1ce843;return getEndUser(_0x9341aa,_0x45e2ca,_0x56aa79[_0xee6b('0x61')],_0x56aa79[_0xee6b('0x62')],_0x3705a1);})[_0xee6b('0x19')](function(_0x3c66c8){_0x2c0349=_0x3c66c8;return getTicket(_0x9341aa,_0x58bbb4,_0x2c0349,_0x45e2ca,_0x56aa79,_0x45e2ca[_0xee6b('0x63')],_0x3705a1,_0xee6b('0x5d'));})[_0xee6b('0x19')](function(_0x23bbb5){_0x3b26a4=_0x23bbb5;logger[_0xee6b('0x1c')](_0xee6b('0x64'),_0x3b26a4['id']);logger[_0xee6b('0x1c')](_0xee6b('0x65'),_0x3b26a4['id'],_0x24a6a4[_0xee6b('0x3f')],_0x9341aa[_0xee6b('0x36')]);switch(_0x9341aa[_0xee6b('0x36')]){case'integrationTab':emit(util[_0xee6b('0x30')]('user:%s',_0x24a6a4[_0xee6b('0x3f')]),_0xee6b('0x54'),{'recordId':_0x3b26a4['id']});break;case _0xee6b('0x55'):emit(util['format'](_0xee6b('0x53'),_0x24a6a4[_0xee6b('0x3f')]),_0xee6b('0x56'),{'uri':util[_0xee6b('0x30')]('%s/%s/e',_0x3705a1['instanceUrl'],_0x3b26a4['id'])});break;default:logger['error'](_0xee6b('0x60'),_0xee6b('0x66'));}})[_0xee6b('0x67')](function(_0x1096c2){logger['error'](_0xee6b('0x60'),JSON[_0xee6b('0x5c')](_0x1096c2));});};exports['abandoned']=function(_0x351ff1,_0x578cdc,_0x3b07d7,_0x46aa7d,_0x3301f2,_0x267af9){var _0x19c184,_0x35548c,_0x1a9313,_0x20d42a;_0x267af9['serverUrl']=intUtil[_0xee6b('0x49')](_0x267af9['serverUrl']);_0x267af9['remoteUri']=intUtil[_0xee6b('0x49')](_0x267af9[_0xee6b('0x44')]);if(_0x3301f2&&_0x3301f2[_0xee6b('0x68')]){logger[_0xee6b('0x1c')](_0xee6b('0x69'),_0xee6b('0x4a'));_0x578cdc['recordingURL']=util[_0xee6b('0x30')](_0xee6b('0x4c'),_0x267af9[_0xee6b('0x48')],_0x578cdc[_0xee6b('0x4d')],md5(_0x578cdc[_0xee6b('0x4d')]));}else{_0x578cdc[_0xee6b('0x4b')]='';}return getConnection(_0x267af9)[_0xee6b('0x19')](function(_0x37b268){_0x20d42a=_0x37b268;if(!_[_0xee6b('0x6a')](_0x46aa7d)){return getUser(_0x267af9,_0x46aa7d[_0xee6b('0x3f')],_0x20d42a);}else{return getUser(_0x267af9,null,_0x20d42a);}})[_0xee6b('0x19')](function(_0x125992){_0x19c184=_0x125992;return getEndUser(_0x267af9,_0x3b07d7,_0x578cdc[_0xee6b('0x4f')],_0x578cdc[_0xee6b('0x50')],_0x20d42a);})[_0xee6b('0x19')](function(_0x650fc2){_0x35548c=_0x650fc2;return getTicket(_0x267af9,_0x19c184,_0x35548c,_0x3b07d7,_0x578cdc,_0x3b07d7[_0xee6b('0x63')],_0x20d42a);})[_0xee6b('0x19')](function(_0xcc1e8c){_0x1a9313=_0xcc1e8c;logger['info']('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x1a9313['id']);logger['info'](_0xee6b('0x6b'),_0x267af9[_0xee6b('0x36')]);})[_0xee6b('0x67')](function(_0x5c8c7d){logger[_0xee6b('0x5a')](_0xee6b('0x69'),JSON[_0xee6b('0x5c')](_0x5c8c7d));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js index ff2a9ee..b6feeb9 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index caeeaf2..6735fcf 100644 --- a/server/services/ami/trigger/integration/sugarcrm.js +++ b/server/services/ami/trigger/integration/sugarcrm.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2333=['recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]','abandoned','[ABANDONED]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','catch','lodash','request-promise','md5','util','ioredis','../../../../config/logger','sugarcrm','redis','localhost','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','variableName','idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','find','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','string','customField','nameField','custom_fields','push','content','type','customVariable','Variable','toLowerCase','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2333,0x174));var _0x3233=function(_0x2e2f62,_0x46e4fa){_0x2e2f62=_0x2e2f62-0x0;var _0xa3be4c=_0x2333[_0x2e2f62];return _0xa3be4c;};'use strict';var _=require(_0x3233('0x0'));var rp=require(_0x3233('0x1'));var BPromise=require('bluebird');var md5=require(_0x3233('0x2'));var util=require(_0x3233('0x3'));var Redis=require(_0x3233('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x3233('0x5'))(_0x3233('0x6'));config[_0x3233('0x7')]=_['defaults'](config[_0x3233('0x7')],{'host':_0x3233('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3233('0x7')]));var def={'method':_0x3233('0x9'),'json':!![]};function emit(_0x4ac0b5,_0x229d70,_0x346ac3){io['to'](_0x4ac0b5)['emit'](_0x229d70,_0x346ac3);}function getTicket(_0x53fadf,_0x458f18,_0x336992,_0x9839fc,_0x5eae94,_0x2bb135,_0x302666,_0x99bad7){logger[_0x3233('0xa')](_0x3233('0xb'));var _0x4d890e=new Date();var _0x227b56=[{'name':_0x3233('0xc'),'value':intUtil[_0x3233('0xd')](_0x9839fc[_0x3233('0xe')],_0x5eae94,'\x20')},{'name':_0x3233('0xf'),'value':_0x458f18['id']},{'name':'created_by','value':_0x458f18['id']},{'name':_0x3233('0x10'),'value':intUtil[_0x3233('0xd')](_0x9839fc[_0x3233('0x11')],_0x5eae94,'\x0a')},{'name':_0x3233('0x12'),'value':_0x4d890e[_0x3233('0x13')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x3233('0x14'),'value':'15'},{'name':_0x3233('0x15'),'value':_0x336992['id']},{'name':_0x3233('0x16'),'value':'Contacts'},{'name':_0x3233('0x17'),'value':_0x336992[_0x3233('0xc')]},{'name':_0x3233('0x18'),'value':_0x99bad7}];if(_0x2bb135[_0x3233('0x19')]){_[_0x3233('0x1a')](_0x2bb135,function(_0x1d8613){if(_0x5eae94[_0x1d8613[_0x3233('0x1b')]]){_0x227b56['push']({'name':_0x1d8613[_0x3233('0x1c')],'value':_0x5eae94[_0x1d8613['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':_0x3233('0x1d'),'response_type':_0x3233('0x1d'),'rest_data':JSON[_0x3233('0x1e')]({'session':_0x302666['id'],'module_name':_0x3233('0x1f'),'name_value_list':_0x227b56})}});}function getAuth(_0x393521){return util[_0x3233('0x20')](_0x3233('0x21'),new Buffer(_0x393521[_0x3233('0x22')]+':X')[_0x3233('0x23')](_0x3233('0x24')));}function getServerInfo(_0x546bc5){return request({'form':{'method':'get_server_info','input_type':_0x3233('0x1d'),'response_type':_0x3233('0x1d'),'rest_data':JSON['stringify']({'session':_0x546bc5['id']})}});}function getUser(_0x4a4855,_0x50053f,_0x2aa34a){if(!_[_0x3233('0x25')](_0x50053f)){logger[_0x3233('0xa')](_0x3233('0x26'),_0x50053f);return request({'form':{'method':_0x3233('0x27'),'input_type':'JSON','response_type':_0x3233('0x1d'),'rest_data':JSON[_0x3233('0x1e')]({'session':_0x2aa34a['id'],'module_name':_0x3233('0x28'),'query':util[_0x3233('0x20')](_0x3233('0x29'),_0x50053f),'order_by':'','offset':'0','select_fields':['id',_0x3233('0xc'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3233('0x2a')](function(_0x1dacf4){if(_0x1dacf4['entry_list'][_0x3233('0x19')]){var _0x12fd7d=_[_0x3233('0x2b')](_0x1dacf4[_0x3233('0x2c')],function(_0x404b29){return _0x404b29[_0x3233('0x2d')][_0x3233('0x2e')][_0x3233('0x2f')]===_0x50053f;});if(_0x12fd7d){logger['info'](_0x3233('0x30'));return BPromise[_0x3233('0x31')]({'id':_0x12fd7d[_0x3233('0x2d')]['id'][_0x3233('0x2f')],'name':_0x12fd7d[_0x3233('0x2d')]['name'][_0x3233('0x2f')]});}}logger[_0x3233('0xa')](_0x3233('0x32'));return BPromise[_0x3233('0x31')]({'id':_0x2aa34a[_0x3233('0x2d')][_0x3233('0x33')][_0x3233('0x2f')],'name':_0x2aa34a[_0x3233('0x2d')]['user_name'][_0x3233('0x2f')]});});}else{logger[_0x3233('0xa')](_0x3233('0x34'));return BPromise[_0x3233('0x31')]({'id':_0x2aa34a[_0x3233('0x2d')][_0x3233('0x33')]['value'],'name':_0x2aa34a[_0x3233('0x2d')][_0x3233('0x2e')]['value']});}}function getEndUser(_0x2a1fe2,_0xe2c3cd,_0x91889c,_0x1fb8a6){logger['info'](_0x3233('0x35'),_0x91889c);return request({'form':{'method':_0x3233('0x27'),'input_type':_0x3233('0x1d'),'response_type':'JSON','rest_data':JSON[_0x3233('0x1e')]({'session':_0x1fb8a6['id'],'module_name':'Contacts','query':util['format'](_0x3233('0x36'),_0x91889c),'order_by':'','offset':'0','select_fields':['id',_0x3233('0xc'),_0x3233('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3233('0x2a')](function(_0x324417){if(_0x324417['entry_list']['length']){var _0x10954e=_['find'](_0x324417[_0x3233('0x2c')],function(_0x2d13d0){return _0x2d13d0[_0x3233('0x2d')][_0x3233('0x37')][_0x3233('0x2f')]===_0x91889c;});if(_0x10954e){logger['info'](_0x3233('0x38'));return BPromise['resolve']({'id':_0x10954e['name_value_list']['id'][_0x3233('0x2f')],'name':_0x10954e['name_value_list'][_0x3233('0xc')][_0x3233('0x2f')],'phone':_0x10954e['name_value_list'][_0x3233('0x37')][_0x3233('0x2f')]});}}else{logger['info'](_0x3233('0x39'));return request({'form':{'method':_0x3233('0x3a'),'input_type':_0x3233('0x1d'),'response_type':_0x3233('0x1d'),'rest_data':JSON['stringify']({'session':_0x1fb8a6['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0xe2c3cd!==_0x3233('0x3b')?_0xe2c3cd:util[_0x3233('0x20')](_0x3233('0x3c'),_0x91889c)},{'name':_0x3233('0x37'),'value':_0x91889c}]})}})[_0x3233('0x2a')](function(_0x297a98){logger['info'](_0x3233('0x3d'));return BPromise['resolve']({'id':_0x297a98['id'],'name':_0x297a98['entry_list']['first_name']['value'],'phone':_0x297a98[_0x3233('0x2c')][_0x3233('0x37')][_0x3233('0x2f')]});});}});}function request(_0x399bc5){logger[_0x3233('0x3e')](_0x3233('0x3f'),JSON[_0x3233('0x1e')](_0x399bc5));return rp(_[_0x3233('0x40')](def,_0x399bc5));}function getTags(_0x140f75,_0x30904e){var _0x412bb7=[];if(_0x140f75&&_0x140f75[_0x3233('0x19')]>0x0){_0x412bb7=_[_0x3233('0x41')](_0x140f75,_0x30904e);}return _0x412bb7;}function getCustomFields(_0x21a970,_0x299c92){var _0x2f8cef=[];var _0x385019={'custom_fields':[]};if(_0x21a970['length']>0x0){_[_0x3233('0x1a')](_0x21a970,function(_0x44ad3d){if(_0x44ad3d['type']===_0x3233('0x42')&&_0x44ad3d['nameField']&&!_0x44ad3d[_0x3233('0x43')]){_0x385019[_0x44ad3d[_0x3233('0x44')]['toLowerCase']()]=_0x44ad3d['content'][_0x3233('0x23')]();}else if(_0x44ad3d['type']===_0x3233('0x42')&&_0x44ad3d[_0x3233('0x1c')]&&_0x44ad3d[_0x3233('0x43')]){_0x385019[_0x3233('0x45')][_0x3233('0x46')]({'id':_0x44ad3d[_0x3233('0x1c')],'value':_0x44ad3d[_0x3233('0x47')][_0x3233('0x23')]()});}else if(_0x44ad3d[_0x3233('0x48')]==='variable'&&_0x44ad3d[_0x3233('0x1b')]&&_0x44ad3d[_0x3233('0x1c')]&&_0x44ad3d[_0x3233('0x43')]){_0x299c92[_0x44ad3d['variableName']]&&_0x385019['custom_fields'][_0x3233('0x46')]({'id':_0x44ad3d[_0x3233('0x1c')],'value':_0x299c92[_0x44ad3d[_0x3233('0x1b')]][_0x3233('0x23')]()});}else if(_0x44ad3d['type']===_0x3233('0x49')&&_0x44ad3d[_0x3233('0x4a')]&&_0x44ad3d[_0x3233('0x4a')][_0x3233('0xc')]&&_0x44ad3d[_0x3233('0x1c')]&&_0x44ad3d[_0x3233('0x43')]){_0x299c92[_0x44ad3d[_0x3233('0x4a')][_0x3233('0xc')][_0x3233('0x4b')]()]&&_0x385019['custom_fields'][_0x3233('0x46')]({'id':_0x44ad3d['idField'],'value':_0x299c92[_0x44ad3d[_0x3233('0x4a')][_0x3233('0xc')]['toLowerCase']()][_0x3233('0x23')]()});}});}return _0x385019;}function getConnection(_0x2ed9e8){return request({'method':_0x3233('0x9'),'form':{'method':'login','input_type':_0x3233('0x1d'),'response_type':_0x3233('0x1d'),'rest_data':JSON[_0x3233('0x1e')]({'user_auth':{'user_name':_0x2ed9e8[_0x3233('0x4c')],'password':_0x2ed9e8[_0x3233('0x4d')],'encryption':_0x3233('0x4e')},'application':_0x3233('0x4f')})}})['then'](function(_0x4bf89c){var _0x417024=_0x4bf89c;if(_0x417024['id']){def[_0x3233('0x50')]=_0x417024['id'];return BPromise[_0x3233('0x31')](_0x417024);}else{throw new Error(util[_0x3233('0x20')](_0x3233('0x51'),_0x2ed9e8['id']));}});}function setRelationship(_0x516028,_0x14e59e,_0x4f974d,_0x28360f){return request({'form':{'method':_0x3233('0x52'),'input_type':_0x3233('0x1d'),'response_type':'JSON','rest_data':JSON[_0x3233('0x1e')]({'session':_0x516028['id'],'module_name':_0x3233('0x1f'),'module_id':_0x4f974d['id'],'link_field_name':_0x28360f,'related_ids':[_0x14e59e['id']]})}});}exports[_0x3233('0x53')]=function(_0x414b9a,_0xb30326,_0x915c01,_0x174259,_0x520282,_0x3ddee0){var _0x3b69c1,_0x42de6b,_0x196a41,_0x492dfd;_0x3ddee0['remoteUri']=intUtil[_0x3233('0x54')](_0x3ddee0[_0x3233('0x55')]);_0x3ddee0['serverUrl']=intUtil[_0x3233('0x54')](_0x3ddee0[_0x3233('0x56')]);def[_0x3233('0x57')]=util[_0x3233('0x20')](_0x3233('0x58'),_0x3ddee0['remoteUri']);if(_0x520282&&_0x520282[_0x3233('0x59')]){logger[_0x3233('0xa')](_0x3233('0x5a'),_0x3233('0x5b'));_0xb30326['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ddee0[_0x3233('0x56')],_0xb30326[_0x3233('0x5c')],md5(_0xb30326['uniqueid']));}else{_0xb30326[_0x3233('0x5d')]='';}return getConnection(_0x3ddee0)[_0x3233('0x2a')](function(_0x3b492d){_0x492dfd=_0x3b492d;return getUser(_0x3ddee0,_0x174259[_0x3233('0xc')],_0x492dfd);})[_0x3233('0x2a')](function(_0x4feb7b){_0x3b69c1=_0x4feb7b;logger[_0x3233('0xa')](_0x3233('0x5e'),_0x3b69c1['id']);return getEndUser(_0x3ddee0,_0xb30326[_0x3233('0x5f')],_0xb30326[_0x3233('0x60')],_0x492dfd);})[_0x3233('0x2a')](function(_0x453fdb){_0x42de6b=_0x453fdb;logger['info'](_0x3233('0x61'),_0x42de6b['id']);return getTicket(_0x3ddee0,_0x3b69c1,_0x42de6b,_0x915c01,_0xb30326,_0x915c01[_0x3233('0x62')],_0x492dfd,_0x3233('0x63'));})[_0x3233('0x2a')](function(_0x48d7d7){_0x196a41=_0x48d7d7;logger[_0x3233('0xa')](_0x3233('0x64'));logger[_0x3233('0xa')](_0x3233('0x65'),_0x196a41['id']);return setRelationship(_0x492dfd,_0x3b69c1,_0x196a41,_0x3233('0x66'));})[_0x3233('0x2a')](function(){return setRelationship(_0x492dfd,_0x42de6b,_0x196a41,_0x3233('0x67'));})[_0x3233('0x2a')](function(){return getServerInfo(_0x492dfd);})[_0x3233('0x2a')](function(_0x17f1fc){var _0x38270a=parseInt(_0x17f1fc[_0x3233('0x68')][_0x3233('0x69')](0x0));var _0x236d3e=util['format'](_0x3233('0x6a'),_0x3ddee0['remoteUri'],_0x196a41['id']);if(_0x38270a>0x6){_0x236d3e=util['format'](_0x3233('0x6b'),_0x3ddee0[_0x3233('0x55')],_0x196a41['id']);}logger[_0x3233('0xa')](_0x3233('0x5a'),_0x3233('0x6c'));emit(util[_0x3233('0x20')](_0x3233('0x6d'),_0x174259[_0x3233('0xc')]),_0x3233('0x6e'),{'uri':_0x236d3e});})['catch'](function(_0x479b78){logger[_0x3233('0x6f')](_0x3233('0x5a'),JSON[_0x3233('0x1e')](_0x479b78));});};exports['outbound']=function(_0xb15c71,_0x364e16,_0x5b7cf5,_0x589224,_0x29b5c6,_0x2dc4c5,_0x4fd9dc){var _0x13335e,_0x5545c7,_0x3f019a,_0x42990c;_0x2dc4c5[_0x3233('0x55')]=intUtil[_0x3233('0x54')](_0x2dc4c5[_0x3233('0x55')]);_0x2dc4c5[_0x3233('0x56')]=intUtil['stripTrailingSlash'](_0x2dc4c5[_0x3233('0x56')]);def[_0x3233('0x57')]=util['format']('%s/service/v4_1/rest.php',_0x2dc4c5['remoteUri']);if(_0x4fd9dc&&_0x4fd9dc['recordingFormat']&&_0x4fd9dc[_0x3233('0x70')]!==_0x3233('0x71')){logger[_0x3233('0xa')]('[OUTBOUND]',_0x3233('0x5b'));_0x364e16[_0x3233('0x5d')]=util[_0x3233('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2dc4c5[_0x3233('0x56')],_0x364e16[_0x3233('0x5c')],md5(_0x364e16['uniqueid']));}return getConnection(_0x2dc4c5)[_0x3233('0x2a')](function(_0x1b8886){_0x42990c=_0x1b8886;return getUser(_0x2dc4c5,_0x589224['name'],_0x42990c);})[_0x3233('0x2a')](function(_0x117e34){_0x13335e=_0x117e34;logger[_0x3233('0xa')]('The\x20User\x20ID\x20is:',_0x13335e['id']);return getEndUser(_0x2dc4c5,_0x364e16[_0x3233('0x72')],_0x364e16[_0x3233('0x73')],_0x42990c);})[_0x3233('0x2a')](function(_0x44a6b3){_0x5545c7=_0x44a6b3;logger['info'](_0x3233('0x61'),_0x5545c7['id']);return getTicket(_0x2dc4c5,_0x13335e,_0x5545c7,_0x5b7cf5,_0x364e16,_0x5b7cf5[_0x3233('0x62')],_0x42990c,'Outbound');})[_0x3233('0x2a')](function(_0x447ad0){_0x3f019a=_0x447ad0;logger[_0x3233('0xa')]('Ticket\x20created!');logger[_0x3233('0xa')](_0x3233('0x65'),_0x3f019a['id']);return setRelationship(_0x42990c,_0x13335e,_0x3f019a,_0x3233('0x66'));})['then'](function(){return setRelationship(_0x42990c,_0x5545c7,_0x3f019a,_0x3233('0x67'));})[_0x3233('0x2a')](function(){return getServerInfo(_0x42990c);})[_0x3233('0x2a')](function(_0x115826){var _0x3e9106=parseInt(_0x115826[_0x3233('0x68')][_0x3233('0x69')](0x0));var _0x25c8ca=util[_0x3233('0x20')](_0x3233('0x6a'),_0x2dc4c5['remoteUri'],_0x3f019a['id']);if(_0x3e9106>0x6){_0x25c8ca=util['format'](_0x3233('0x6b'),_0x2dc4c5[_0x3233('0x55')],_0x3f019a['id']);}logger[_0x3233('0xa')](_0x3233('0x74'),_0x3233('0x6c'));emit(util[_0x3233('0x20')]('user:%s',_0x589224[_0x3233('0xc')]),_0x3233('0x6e'),{'uri':_0x25c8ca});})['catch'](function(_0xd97107){logger[_0x3233('0x6f')]('[OUTBOUND]',JSON['stringify'](_0xd97107));});};exports[_0x3233('0x75')]=function(_0x11c164,_0x245be8,_0x4f6427,_0x3a032b,_0x357c0c,_0x2cc861){var _0x57f96a,_0x4f7196,_0x39ae3f,_0x358724;_0x2cc861[_0x3233('0x55')]=intUtil[_0x3233('0x54')](_0x2cc861['remoteUri']);_0x2cc861['serverUrl']=intUtil[_0x3233('0x54')](_0x2cc861[_0x3233('0x56')]);def['uri']=util[_0x3233('0x20')](_0x3233('0x58'),_0x2cc861[_0x3233('0x55')]);if(_0x357c0c&&_0x357c0c[_0x3233('0x59')]){logger['info'](_0x3233('0x76'),'Recording\x20is\x20enabled!');_0x245be8[_0x3233('0x5d')]=util[_0x3233('0x20')](_0x3233('0x77'),_0x2cc861[_0x3233('0x56')],_0x245be8['uniqueid'],md5(_0x245be8[_0x3233('0x5c')]));}else{_0x245be8['recordingURL']='';}return getConnection(_0x2cc861)[_0x3233('0x2a')](function(_0x8ad17b){_0x358724=_0x8ad17b;if(!_['isNil'](_0x3a032b)){return getUser(_0x2cc861,_0x3a032b[_0x3233('0xc')],_0x358724);}else{return getUser(_0x2cc861,null,_0x358724);}})[_0x3233('0x2a')](function(_0x1f7129){_0x57f96a=_0x1f7129;logger[_0x3233('0xa')]('The\x20User\x20ID\x20is:',_0x57f96a['id']);return getEndUser(_0x2cc861,_0x245be8['calleridname'],_0x245be8[_0x3233('0x60')],_0x358724);})[_0x3233('0x2a')](function(_0x4a9b6b){_0x4f7196=_0x4a9b6b;logger['info'](_0x3233('0x61'),_0x4f7196['id']);return getTicket(_0x2cc861,_0x57f96a,_0x4f7196,_0x4f6427,_0x245be8,_0x4f6427[_0x3233('0x62')],_0x358724,_0x3233('0x63'));})[_0x3233('0x2a')](function(_0xa1e99){_0x39ae3f=_0xa1e99;logger[_0x3233('0xa')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x39ae3f['id']);return setRelationship(_0x358724,_0x57f96a,_0x39ae3f,_0x3233('0x66'));})['then'](function(){return setRelationship(_0x358724,_0x4f7196,_0x39ae3f,_0x3233('0x67'));})[_0x3233('0x2a')](function(){return getServerInfo(_0x358724);})[_0x3233('0x78')](function(_0x1ce5b6){logger[_0x3233('0x6f')](_0x3233('0x76'),JSON['stringify'](_0x1ce5b6));});}; \ No newline at end of file +var _0x92ca=['xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','%s/service/v4_1/rest.php','Recording\x20is\x20enabled!','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','recordingFormat','[OUTBOUND]','destcalleridnum','Outbound','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','monitor_format','[ABANDONED]','request-promise','bluebird','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','info','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','variableName','push','idField','set_entry','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','length','find','name_value_list','user_name','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','then','phone_home','Enduser\x20found!','first_name','Enduser\x20created.','debug','[HTTP]','map','forEach','customField','nameField','toLowerCase','type','custom_fields','content','variable','Variable','login','username','PLAIN'];(function(_0x589bee,_0x3e06b9){var _0x58f126=function(_0x41b491){while(--_0x41b491){_0x589bee['push'](_0x589bee['shift']());}};_0x58f126(++_0x3e06b9);}(_0x92ca,0x95));var _0xa92c=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0x92ca[_0x3c0dcc];return _0x1a224c;};'use strict';var _=require('lodash');var rp=require(_0xa92c('0x0'));var BPromise=require(_0xa92c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xa92c('0x2'));var logger=require(_0xa92c('0x3'))(_0xa92c('0x4'));config[_0xa92c('0x5')]=_[_0xa92c('0x6')](config['redis'],{'host':_0xa92c('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa92c('0x5')]));var def={'method':_0xa92c('0x8'),'json':!![]};function emit(_0x3fee74,_0xb5443a,_0x17283a){io['to'](_0x3fee74)['emit'](_0xb5443a,_0x17283a);}function getTicket(_0x2b05e6,_0x5858cd,_0xebf7ff,_0x56846a,_0x3f5b0d,_0xb79a30,_0x5064da,_0x3a35c9){logger[_0xa92c('0x9')]('Creating\x20new\x20ticket...');var _0x355012=new Date();var _0x2e2851=[{'name':_0xa92c('0xa'),'value':intUtil[_0xa92c('0xb')](_0x56846a['Subjects'],_0x3f5b0d,'\x20')},{'name':_0xa92c('0xc'),'value':_0x5858cd['id']},{'name':_0xa92c('0xd'),'value':_0x5858cd['id']},{'name':_0xa92c('0xe'),'value':intUtil[_0xa92c('0xb')](_0x56846a[_0xa92c('0xf')],_0x3f5b0d,'\x0a')},{'name':_0xa92c('0x10'),'value':_0x355012[_0xa92c('0x11')]()['slice'](0x0,0x13)[_0xa92c('0x12')]('T','\x20')},{'name':_0xa92c('0x13'),'value':'0'},{'name':_0xa92c('0x14'),'value':'15'},{'name':_0xa92c('0x15'),'value':_0xebf7ff['id']},{'name':_0xa92c('0x16'),'value':_0xa92c('0x17')},{'name':_0xa92c('0x18'),'value':_0xebf7ff['name']},{'name':'direction','value':_0x3a35c9}];if(_0xb79a30['length']){_['forEach'](_0xb79a30,function(_0x1d80e4){if(_0x3f5b0d[_0x1d80e4[_0xa92c('0x19')]]){_0x2e2851[_0xa92c('0x1a')]({'name':_0x1d80e4[_0xa92c('0x1b')],'value':_0x3f5b0d[_0x1d80e4[_0xa92c('0x19')]]});}});}return request({'form':{'method':_0xa92c('0x1c'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xa92c('0x1d')]({'session':_0x5064da['id'],'module_name':_0xa92c('0x1e'),'name_value_list':_0x2e2851})}});}function getAuth(_0x349c1f){return util[_0xa92c('0x1f')](_0xa92c('0x20'),new Buffer(_0x349c1f[_0xa92c('0x21')]+':X')[_0xa92c('0x22')]('base64'));}function getServerInfo(_0x30b09e){return request({'form':{'method':_0xa92c('0x23'),'input_type':_0xa92c('0x24'),'response_type':_0xa92c('0x24'),'rest_data':JSON[_0xa92c('0x1d')]({'session':_0x30b09e['id']})}});}function getUser(_0x39f2e5,_0x5d7d20,_0x18c3f0){if(!_[_0xa92c('0x25')](_0x5d7d20)){logger[_0xa92c('0x9')](_0xa92c('0x26'),_0x5d7d20);return request({'form':{'method':_0xa92c('0x27'),'input_type':_0xa92c('0x24'),'response_type':'JSON','rest_data':JSON[_0xa92c('0x1d')]({'session':_0x18c3f0['id'],'module_name':_0xa92c('0x28'),'query':util['format'](_0xa92c('0x29'),_0x5d7d20),'order_by':'','offset':'0','select_fields':['id',_0xa92c('0xa'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4ef3ae){if(_0x4ef3ae[_0xa92c('0x2a')][_0xa92c('0x2b')]){var _0xf4f308=_[_0xa92c('0x2c')](_0x4ef3ae[_0xa92c('0x2a')],function(_0x723963){return _0x723963[_0xa92c('0x2d')][_0xa92c('0x2e')][_0xa92c('0x2f')]===_0x5d7d20;});if(_0xf4f308){logger[_0xa92c('0x9')](_0xa92c('0x30'));return BPromise[_0xa92c('0x31')]({'id':_0xf4f308[_0xa92c('0x2d')]['id']['value'],'name':_0xf4f308[_0xa92c('0x2d')][_0xa92c('0xa')][_0xa92c('0x2f')]});}}logger[_0xa92c('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x18c3f0[_0xa92c('0x2d')][_0xa92c('0x32')][_0xa92c('0x2f')],'name':_0x18c3f0[_0xa92c('0x2d')][_0xa92c('0x2e')][_0xa92c('0x2f')]});});}else{logger['info'](_0xa92c('0x33'));return BPromise[_0xa92c('0x31')]({'id':_0x18c3f0[_0xa92c('0x2d')][_0xa92c('0x32')][_0xa92c('0x2f')],'name':_0x18c3f0[_0xa92c('0x2d')]['user_name']['value']});}}function getEndUser(_0x5cb92c,_0x467d02,_0x2948e0,_0x25a043){logger[_0xa92c('0x9')](_0xa92c('0x34'),_0x2948e0);return request({'form':{'method':'get_entry_list','input_type':_0xa92c('0x24'),'response_type':_0xa92c('0x24'),'rest_data':JSON[_0xa92c('0x1d')]({'session':_0x25a043['id'],'module_name':_0xa92c('0x17'),'query':util[_0xa92c('0x1f')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x2948e0),'order_by':'','offset':'0','select_fields':['id',_0xa92c('0xa'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa92c('0x35')](function(_0xedaf1a){if(_0xedaf1a[_0xa92c('0x2a')]['length']){var _0x49f20b=_[_0xa92c('0x2c')](_0xedaf1a[_0xa92c('0x2a')],function(_0x1c9062){return _0x1c9062['name_value_list'][_0xa92c('0x36')]['value']===_0x2948e0;});if(_0x49f20b){logger[_0xa92c('0x9')](_0xa92c('0x37'));return BPromise['resolve']({'id':_0x49f20b[_0xa92c('0x2d')]['id']['value'],'name':_0x49f20b[_0xa92c('0x2d')][_0xa92c('0xa')][_0xa92c('0x2f')],'phone':_0x49f20b['name_value_list'][_0xa92c('0x36')][_0xa92c('0x2f')]});}}else{logger[_0xa92c('0x9')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xa92c('0x1c'),'input_type':_0xa92c('0x24'),'response_type':_0xa92c('0x24'),'rest_data':JSON[_0xa92c('0x1d')]({'session':_0x25a043['id'],'module_name':'Contacts','name_value_list':[{'name':_0xa92c('0x38'),'value':_0x467d02!==''?_0x467d02:util[_0xa92c('0x1f')]('Caller\x20-\x20%s',_0x2948e0)},{'name':_0xa92c('0x36'),'value':_0x2948e0}]})}})[_0xa92c('0x35')](function(_0x391322){logger[_0xa92c('0x9')](_0xa92c('0x39'));return BPromise[_0xa92c('0x31')]({'id':_0x391322['id'],'name':_0x391322['entry_list'][_0xa92c('0x38')][_0xa92c('0x2f')],'phone':_0x391322[_0xa92c('0x2a')][_0xa92c('0x36')]['value']});});}});}function request(_0x719ea7){logger[_0xa92c('0x3a')](_0xa92c('0x3b'),JSON['stringify'](_0x719ea7));return rp(_['merge'](def,_0x719ea7));}function getTags(_0x3a8531,_0x1efd6c){var _0xba4829=[];if(_0x3a8531&&_0x3a8531[_0xa92c('0x2b')]>0x0){_0xba4829=_[_0xa92c('0x3c')](_0x3a8531,_0x1efd6c);}return _0xba4829;}function getCustomFields(_0x11e791,_0x3dcf36){var _0xe9362c=[];var _0x374ab9={'custom_fields':[]};if(_0x11e791['length']>0x0){_[_0xa92c('0x3d')](_0x11e791,function(_0x46ba27){if(_0x46ba27['type']==='string'&&_0x46ba27['nameField']&&!_0x46ba27[_0xa92c('0x3e')]){_0x374ab9[_0x46ba27[_0xa92c('0x3f')][_0xa92c('0x40')]()]=_0x46ba27['content'][_0xa92c('0x22')]();}else if(_0x46ba27[_0xa92c('0x41')]==='string'&&_0x46ba27[_0xa92c('0x1b')]&&_0x46ba27[_0xa92c('0x3e')]){_0x374ab9[_0xa92c('0x42')]['push']({'id':_0x46ba27[_0xa92c('0x1b')],'value':_0x46ba27[_0xa92c('0x43')]['toString']()});}else if(_0x46ba27[_0xa92c('0x41')]===_0xa92c('0x44')&&_0x46ba27[_0xa92c('0x19')]&&_0x46ba27[_0xa92c('0x1b')]&&_0x46ba27['customField']){_0x3dcf36[_0x46ba27[_0xa92c('0x19')]]&&_0x374ab9[_0xa92c('0x42')][_0xa92c('0x1a')]({'id':_0x46ba27[_0xa92c('0x1b')],'value':_0x3dcf36[_0x46ba27[_0xa92c('0x19')]][_0xa92c('0x22')]()});}else if(_0x46ba27[_0xa92c('0x41')]==='customVariable'&&_0x46ba27[_0xa92c('0x45')]&&_0x46ba27[_0xa92c('0x45')][_0xa92c('0xa')]&&_0x46ba27[_0xa92c('0x1b')]&&_0x46ba27[_0xa92c('0x3e')]){_0x3dcf36[_0x46ba27[_0xa92c('0x45')][_0xa92c('0xa')]['toLowerCase']()]&&_0x374ab9['custom_fields'][_0xa92c('0x1a')]({'id':_0x46ba27[_0xa92c('0x1b')],'value':_0x3dcf36[_0x46ba27[_0xa92c('0x45')][_0xa92c('0xa')][_0xa92c('0x40')]()][_0xa92c('0x22')]()});}});}return _0x374ab9;}function getConnection(_0x3aeb62){return request({'method':'POST','form':{'method':_0xa92c('0x46'),'input_type':_0xa92c('0x24'),'response_type':_0xa92c('0x24'),'rest_data':JSON[_0xa92c('0x1d')]({'user_auth':{'user_name':_0x3aeb62[_0xa92c('0x47')],'password':_0x3aeb62['password'],'encryption':_0xa92c('0x48')},'application':_0xa92c('0x49')})}})[_0xa92c('0x35')](function(_0x38e7c3){var _0x32a4c3=_0x38e7c3;if(_0x32a4c3['id']){def[_0xa92c('0x4a')]=_0x32a4c3['id'];return BPromise[_0xa92c('0x31')](_0x32a4c3);}else{throw new Error(util['format'](_0xa92c('0x4b'),_0x3aeb62['id']));}});}function setRelationship(_0xcaf9ec,_0x3e4cba,_0x48ab0e,_0x3530cf){return request({'form':{'method':_0xa92c('0x4c'),'input_type':_0xa92c('0x24'),'response_type':_0xa92c('0x24'),'rest_data':JSON['stringify']({'session':_0xcaf9ec['id'],'module_name':_0xa92c('0x1e'),'module_id':_0x48ab0e['id'],'link_field_name':_0x3530cf,'related_ids':[_0x3e4cba['id']]})}});}exports[_0xa92c('0x4d')]=function(_0x1fb424,_0x15477c,_0x4ddb10,_0x2d62c6,_0x5cb219,_0x46e1dc){var _0x4ab723,_0x59b7c1,_0xd56c1f,_0x35a407;_0x46e1dc['remoteUri']=intUtil[_0xa92c('0x4e')](_0x46e1dc[_0xa92c('0x4f')]);_0x46e1dc[_0xa92c('0x50')]=intUtil[_0xa92c('0x4e')](_0x46e1dc['serverUrl']);def['uri']=util[_0xa92c('0x1f')](_0xa92c('0x51'),_0x46e1dc[_0xa92c('0x4f')]);if(_0x5cb219&&_0x5cb219['monitor_format']){logger[_0xa92c('0x9')]('[QUEUE]',_0xa92c('0x52'));_0x15477c['recordingURL']=util[_0xa92c('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x46e1dc['serverUrl'],_0x15477c[_0xa92c('0x53')],md5(_0x15477c[_0xa92c('0x53')]));}else{_0x15477c[_0xa92c('0x54')]='';}return getConnection(_0x46e1dc)[_0xa92c('0x35')](function(_0x27a807){_0x35a407=_0x27a807;return getUser(_0x46e1dc,_0x2d62c6[_0xa92c('0xa')],_0x35a407);})[_0xa92c('0x35')](function(_0x3f3d15){_0x4ab723=_0x3f3d15;logger[_0xa92c('0x9')](_0xa92c('0x55'),_0x4ab723['id']);return getEndUser(_0x46e1dc,_0x15477c[_0xa92c('0x56')],_0x15477c[_0xa92c('0x57')],_0x35a407);})[_0xa92c('0x35')](function(_0x12d59a){_0x59b7c1=_0x12d59a;logger['info'](_0xa92c('0x58'),_0x59b7c1['id']);return getTicket(_0x46e1dc,_0x4ab723,_0x59b7c1,_0x4ddb10,_0x15477c,_0x4ddb10[_0xa92c('0x59')],_0x35a407,_0xa92c('0x5a'));})[_0xa92c('0x35')](function(_0x2e1afb){_0xd56c1f=_0x2e1afb;logger[_0xa92c('0x9')](_0xa92c('0x5b'));logger[_0xa92c('0x9')](_0xa92c('0x5c'),_0xd56c1f['id']);return setRelationship(_0x35a407,_0x4ab723,_0xd56c1f,_0xa92c('0x5d'));})['then'](function(){return setRelationship(_0x35a407,_0x59b7c1,_0xd56c1f,_0xa92c('0x5e'));})[_0xa92c('0x35')](function(){return getServerInfo(_0x35a407);})[_0xa92c('0x35')](function(_0x30cf14){var _0x5687df=parseInt(_0x30cf14[_0xa92c('0x5f')][_0xa92c('0x60')](0x0));var _0x3490d9=util['format'](_0xa92c('0x61'),_0x46e1dc[_0xa92c('0x4f')],_0xd56c1f['id']);if(_0x5687df>0x6){_0x3490d9=util[_0xa92c('0x1f')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x46e1dc[_0xa92c('0x4f')],_0xd56c1f['id']);}logger[_0xa92c('0x9')](_0xa92c('0x62'),_0xa92c('0x63'));emit(util[_0xa92c('0x1f')]('user:%s',_0x2d62c6[_0xa92c('0xa')]),'trigger:browser:url',{'uri':_0x3490d9});})[_0xa92c('0x64')](function(_0x62eaa9){logger[_0xa92c('0x65')](_0xa92c('0x62'),JSON[_0xa92c('0x1d')](_0x62eaa9));});};exports['outbound']=function(_0x5cde19,_0x33364e,_0x1a0ea8,_0x5c2fb8,_0x4022ff,_0x56acbe,_0x7d9a9){var _0x4b4d03,_0x32aae2,_0x12b9bf,_0xfd6c7a;_0x56acbe[_0xa92c('0x4f')]=intUtil['stripTrailingSlash'](_0x56acbe[_0xa92c('0x4f')]);_0x56acbe[_0xa92c('0x50')]=intUtil[_0xa92c('0x4e')](_0x56acbe[_0xa92c('0x50')]);def['uri']=util['format'](_0xa92c('0x51'),_0x56acbe['remoteUri']);if(_0x7d9a9&&_0x7d9a9[_0xa92c('0x66')]&&_0x7d9a9['recordingFormat']!=='none'){logger[_0xa92c('0x9')](_0xa92c('0x67'),_0xa92c('0x52'));_0x33364e['recordingURL']=util[_0xa92c('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x56acbe[_0xa92c('0x50')],_0x33364e[_0xa92c('0x53')],md5(_0x33364e[_0xa92c('0x53')]));}return getConnection(_0x56acbe)['then'](function(_0x12082a){_0xfd6c7a=_0x12082a;return getUser(_0x56acbe,_0x5c2fb8[_0xa92c('0xa')],_0xfd6c7a);})[_0xa92c('0x35')](function(_0x450001){_0x4b4d03=_0x450001;logger[_0xa92c('0x9')](_0xa92c('0x55'),_0x4b4d03['id']);return getEndUser(_0x56acbe,_0x33364e['destcalleridname'],_0x33364e[_0xa92c('0x68')],_0xfd6c7a);})[_0xa92c('0x35')](function(_0x172068){_0x32aae2=_0x172068;logger[_0xa92c('0x9')](_0xa92c('0x58'),_0x32aae2['id']);return getTicket(_0x56acbe,_0x4b4d03,_0x32aae2,_0x1a0ea8,_0x33364e,_0x1a0ea8[_0xa92c('0x59')],_0xfd6c7a,_0xa92c('0x69'));})[_0xa92c('0x35')](function(_0x4ee764){_0x12b9bf=_0x4ee764;logger[_0xa92c('0x9')](_0xa92c('0x5b'));logger[_0xa92c('0x9')]('The\x20Ticket\x20ID\x20is:',_0x12b9bf['id']);return setRelationship(_0xfd6c7a,_0x4b4d03,_0x12b9bf,_0xa92c('0x5d'));})['then'](function(){return setRelationship(_0xfd6c7a,_0x32aae2,_0x12b9bf,_0xa92c('0x5e'));})[_0xa92c('0x35')](function(){return getServerInfo(_0xfd6c7a);})[_0xa92c('0x35')](function(_0x516f2){var _0x9c3ab8=parseInt(_0x516f2[_0xa92c('0x5f')][_0xa92c('0x60')](0x0));var _0x424ac2=util[_0xa92c('0x1f')](_0xa92c('0x61'),_0x56acbe[_0xa92c('0x4f')],_0x12b9bf['id']);if(_0x9c3ab8>0x6){_0x424ac2=util[_0xa92c('0x1f')](_0xa92c('0x6a'),_0x56acbe[_0xa92c('0x4f')],_0x12b9bf['id']);}logger[_0xa92c('0x9')](_0xa92c('0x67'),_0xa92c('0x63'));emit(util[_0xa92c('0x1f')](_0xa92c('0x6b'),_0x5c2fb8[_0xa92c('0xa')]),_0xa92c('0x6c'),{'uri':_0x424ac2});})[_0xa92c('0x64')](function(_0x3cac97){logger[_0xa92c('0x65')](_0xa92c('0x67'),JSON[_0xa92c('0x1d')](_0x3cac97));});};exports['abandoned']=function(_0x9225ff,_0x5ddca6,_0xa0cba6,_0x5758c7,_0x2797e1,_0x303317){var _0x44c333,_0x50adb5,_0x395961,_0x1ee9c5;_0x303317[_0xa92c('0x4f')]=intUtil[_0xa92c('0x4e')](_0x303317[_0xa92c('0x4f')]);_0x303317['serverUrl']=intUtil[_0xa92c('0x4e')](_0x303317['serverUrl']);def['uri']=util['format'](_0xa92c('0x51'),_0x303317[_0xa92c('0x4f')]);if(_0x2797e1&&_0x2797e1[_0xa92c('0x6d')]){logger[_0xa92c('0x9')](_0xa92c('0x6e'),_0xa92c('0x52'));_0x5ddca6[_0xa92c('0x54')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x303317['serverUrl'],_0x5ddca6[_0xa92c('0x53')],md5(_0x5ddca6['uniqueid']));}else{_0x5ddca6[_0xa92c('0x54')]='';}return getConnection(_0x303317)[_0xa92c('0x35')](function(_0x286f48){_0x1ee9c5=_0x286f48;if(!_['isNil'](_0x5758c7)){return getUser(_0x303317,_0x5758c7[_0xa92c('0xa')],_0x1ee9c5);}else{return getUser(_0x303317,null,_0x1ee9c5);}})[_0xa92c('0x35')](function(_0x1d59b1){_0x44c333=_0x1d59b1;logger[_0xa92c('0x9')](_0xa92c('0x55'),_0x44c333['id']);return getEndUser(_0x303317,_0x5ddca6['calleridname'],_0x5ddca6[_0xa92c('0x57')],_0x1ee9c5);})['then'](function(_0x5d9ccc){_0x50adb5=_0x5d9ccc;logger[_0xa92c('0x9')](_0xa92c('0x58'),_0x50adb5['id']);return getTicket(_0x303317,_0x44c333,_0x50adb5,_0xa0cba6,_0x5ddca6,_0xa0cba6[_0xa92c('0x59')],_0x1ee9c5,'Inbound');})[_0xa92c('0x35')](function(_0x54a4c9){_0x395961=_0x54a4c9;logger[_0xa92c('0x9')]('Ticket\x20created!');logger[_0xa92c('0x9')](_0xa92c('0x5c'),_0x395961['id']);return setRelationship(_0x1ee9c5,_0x44c333,_0x395961,_0xa92c('0x5d'));})[_0xa92c('0x35')](function(){return setRelationship(_0x1ee9c5,_0x50adb5,_0x395961,_0xa92c('0x5e'));})['then'](function(){return getServerInfo(_0x1ee9c5);})[_0xa92c('0x64')](function(_0x47e546){logger[_0xa92c('0x65')]('[ABANDONED]',JSON[_0xa92c('0x1d')](_0x47e546));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/util.js b/server/services/ami/trigger/integration/util.js index 4e554d2..3cbe574 100644 --- a/server/services/ami/trigger/integration/util.js +++ b/server/services/ami/trigger/integration/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0e0=['toString','Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s','keyContent','keyType','customVariable','join','stripTrailingSlash','slice','substring','validateEmail','lodash','util','length','sortBy','type','string','variable','variableName','push'];(function(_0x4e774f,_0x88ac59){var _0x1bd989=function(_0x52acdc){while(--_0x52acdc){_0x4e774f['push'](_0x4e774f['shift']());}};_0x1bd989(++_0x88ac59);}(_0xb0e0,0x187));var _0x0b0e=function(_0x57bd8e,_0x51c54a){_0x57bd8e=_0x57bd8e-0x0;var _0x225831=_0xb0e0[_0x57bd8e];return _0x225831;};'use strict';var _=require(_0x0b0e('0x0'));var util=require(_0x0b0e('0x1'));exports['getString']=function(_0x4f3cfe,_0x2f0a16,_0x1bc08e){var _0x57c489=[];if(_0x4f3cfe[_0x0b0e('0x2')]>0x0){var _0x91a63=_[_0x0b0e('0x3')](_0x4f3cfe,['id']);for(var _0x7d3d36=0x0;_0x7d3d36<_0x91a63[_0x0b0e('0x2')];_0x7d3d36++){var _0x470554=_0x91a63[_0x7d3d36];if(_0x470554[_0x0b0e('0x4')]===_0x0b0e('0x5')){_0x57c489['push'](_0x470554['content']);}else if(_0x470554[_0x0b0e('0x4')]===_0x0b0e('0x6')&&_0x470554[_0x0b0e('0x7')]){_0x2f0a16[_0x470554[_0x0b0e('0x7')]]&&_0x57c489[_0x0b0e('0x8')](_0x2f0a16[_0x470554[_0x0b0e('0x7')]][_0x0b0e('0x9')]());}else if(_0x470554['type']==='customVariable'&&_0x470554[_0x0b0e('0xa')]&&_0x470554[_0x0b0e('0xa')][_0x0b0e('0xb')]){_0x2f0a16[_0x470554[_0x0b0e('0xa')][_0x0b0e('0xb')]['toLowerCase']()]&&_0x57c489[_0x0b0e('0x8')](_0x2f0a16[_0x470554['Variable'][_0x0b0e('0xb')][_0x0b0e('0xc')]()][_0x0b0e('0x9')]());}else if(_0x470554[_0x0b0e('0x4')]===_0x0b0e('0xd')){if(_0x470554['keyType']===_0x0b0e('0x5')&&_0x470554[_0x0b0e('0xe')]){_0x57c489[_0x0b0e('0x8')](util[_0x0b0e('0xf')](_0x0b0e('0x10'),_0x470554[_0x0b0e('0xe')],_0x470554[_0x0b0e('0x11')]));}else if(_0x470554[_0x0b0e('0x12')]==='variable'&&_0x470554['variableName']&&_0x470554[_0x0b0e('0xe')]){_0x2f0a16[_0x470554['variableName']]&&_0x57c489[_0x0b0e('0x8')](util['format'](_0x0b0e('0x10'),_0x470554['key'],_0x2f0a16[_0x470554[_0x0b0e('0x7')]]));}else if(_0x470554[_0x0b0e('0x12')]===_0x0b0e('0x13')&&_0x470554['Variable']&&_0x470554['Variable'][_0x0b0e('0xb')]&&_0x470554['key']){_0x2f0a16[_0x470554[_0x0b0e('0xa')][_0x0b0e('0xb')][_0x0b0e('0xc')]()]&&_0x57c489[_0x0b0e('0x8')](util['format'](_0x0b0e('0x10'),_0x470554[_0x0b0e('0xe')],_0x2f0a16[_0x470554[_0x0b0e('0xa')]['name'][_0x0b0e('0xc')]()]));}}}}return _0x57c489[_0x0b0e('0x14')](_0x1bc08e);};exports[_0x0b0e('0x15')]=function(_0x5e8d6b){var _0xc18537=_0x5e8d6b[_0x0b0e('0x16')](-0x1);if(_0xc18537==='/'){_0x5e8d6b=_0x5e8d6b[_0x0b0e('0x17')](0x0,_0x5e8d6b['lastIndexOf'](_0xc18537));}return _0x5e8d6b;};exports[_0x0b0e('0x18')]=function(_0xc27411){if(!_['isNil'](_0xc27411)&&_0xc27411!==''){var _0x32b9b9=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x32b9b9['test'](String(_0xc27411)[_0x0b0e('0xc')]());}else{return![];}}; \ No newline at end of file +var _0xc203=['lastIndexOf','validateEmail','isNil','test','getString','length','content','variable','variableName','push','toString','type','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','key','keyContent','%s:\x20%s','format','join','stripTrailingSlash','slice','substring'];(function(_0x592e40,_0x2ed011){var _0x5d4288=function(_0x366e87){while(--_0x366e87){_0x592e40['push'](_0x592e40['shift']());}};_0x5d4288(++_0x2ed011);}(_0xc203,0xc1));var _0x3c20=function(_0x178451,_0x1e137e){_0x178451=_0x178451-0x0;var _0x30e8d6=_0xc203[_0x178451];return _0x30e8d6;};'use strict';var _=require('lodash');var util=require('util');exports[_0x3c20('0x0')]=function(_0x4cfe88,_0x1407e7,_0x4ce2a6){var _0x33bef3=[];if(_0x4cfe88[_0x3c20('0x1')]>0x0){var _0x230192=_['sortBy'](_0x4cfe88,['id']);for(var _0x42581a=0x0;_0x42581a<_0x230192[_0x3c20('0x1')];_0x42581a++){var _0x2f271c=_0x230192[_0x42581a];if(_0x2f271c['type']==='string'){_0x33bef3['push'](_0x2f271c[_0x3c20('0x2')]);}else if(_0x2f271c['type']===_0x3c20('0x3')&&_0x2f271c[_0x3c20('0x4')]){_0x1407e7[_0x2f271c[_0x3c20('0x4')]]&&_0x33bef3[_0x3c20('0x5')](_0x1407e7[_0x2f271c[_0x3c20('0x4')]][_0x3c20('0x6')]());}else if(_0x2f271c[_0x3c20('0x7')]===_0x3c20('0x8')&&_0x2f271c[_0x3c20('0x9')]&&_0x2f271c['Variable'][_0x3c20('0xa')]){_0x1407e7[_0x2f271c[_0x3c20('0x9')][_0x3c20('0xa')][_0x3c20('0xb')]()]&&_0x33bef3[_0x3c20('0x5')](_0x1407e7[_0x2f271c['Variable'][_0x3c20('0xa')][_0x3c20('0xb')]()][_0x3c20('0x6')]());}else if(_0x2f271c[_0x3c20('0x7')]===_0x3c20('0xc')){if(_0x2f271c[_0x3c20('0xd')]===_0x3c20('0xe')&&_0x2f271c[_0x3c20('0xf')]){_0x33bef3[_0x3c20('0x5')](util['format']('%s:\x20%s',_0x2f271c['key'],_0x2f271c[_0x3c20('0x10')]));}else if(_0x2f271c[_0x3c20('0xd')]===_0x3c20('0x3')&&_0x2f271c[_0x3c20('0x4')]&&_0x2f271c[_0x3c20('0xf')]){_0x1407e7[_0x2f271c['variableName']]&&_0x33bef3[_0x3c20('0x5')](util['format'](_0x3c20('0x11'),_0x2f271c['key'],_0x1407e7[_0x2f271c['variableName']]));}else if(_0x2f271c[_0x3c20('0xd')]===_0x3c20('0x8')&&_0x2f271c[_0x3c20('0x9')]&&_0x2f271c[_0x3c20('0x9')][_0x3c20('0xa')]&&_0x2f271c[_0x3c20('0xf')]){_0x1407e7[_0x2f271c[_0x3c20('0x9')][_0x3c20('0xa')]['toLowerCase']()]&&_0x33bef3[_0x3c20('0x5')](util[_0x3c20('0x12')](_0x3c20('0x11'),_0x2f271c['key'],_0x1407e7[_0x2f271c[_0x3c20('0x9')]['name']['toLowerCase']()]));}}}}return _0x33bef3[_0x3c20('0x13')](_0x4ce2a6);};exports[_0x3c20('0x14')]=function(_0x3468f7){var _0x400041=_0x3468f7[_0x3c20('0x15')](-0x1);if(_0x400041==='/'){_0x3468f7=_0x3468f7[_0x3c20('0x16')](0x0,_0x3468f7[_0x3c20('0x17')](_0x400041));}return _0x3468f7;};exports[_0x3c20('0x18')]=function(_0x1d9cc9){if(!_[_0x3c20('0x19')](_0x1d9cc9)&&_0x1d9cc9!==''){var _0x598881=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x598881[_0x3c20('0x1a')](String(_0x1d9cc9)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 7a8e988..a00c016 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','abandoned','[ABANDONED]','lodash','request-promise','ioredis','./util','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','type','string','idField','content','toString','customVariable','Variable','name','toLowerCase','info','merge','Normal','Open','Subjects','getString','POST','format','%s/webservice.php','remoteUri','username','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','stringify','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','last_name','userId','admin','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','lastname','phone','getEndUser','accessKey','getConnection','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','[QUEUE]','outbound','serverUrl','recordingFormat','none','[OUTBOUND]'];(function(_0x3f03d6,_0xb0ce73){var _0x43d7bb=function(_0x251fa9){while(--_0x251fa9){_0x3f03d6['push'](_0x3f03d6['shift']());}};_0x43d7bb(++_0xb0ce73);}(_0x55ca,0x126));var _0xa55c=function(_0x24a88e,_0x22a0b8){_0x24a88e=_0x24a88e-0x0;var _0x232cbb=_0x55ca[_0x24a88e];return _0x232cbb;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0xa55c('0x2'));var intUtil=require(_0xa55c('0x3'));var config=require('../../../../config/environment');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));config[_0xa55c('0x6')]=_[_0xa55c('0x7')](config[_0xa55c('0x6')],{'host':_0xa55c('0x8'),'port':0x18eb});var io=require(_0xa55c('0x9'))(new Redis(config['redis']));function emit(_0x2121fd,_0x2537f0,_0x57e069){io['to'](_0x2121fd)[_0xa55c('0xa')](_0x2537f0,_0x57e069);}function getCustomFields(_0x290d28,_0x52a3bc){var _0x5849ad={};if(_0x290d28[_0xa55c('0xb')]>0x0){_[_0xa55c('0xc')](_0x290d28,function(_0x381d07){if(_0x381d07[_0xa55c('0xd')]===_0xa55c('0xe')&&_0x381d07[_0xa55c('0xf')]){_0x5849ad[_0x381d07[_0xa55c('0xf')]]=_0x381d07[_0xa55c('0x10')][_0xa55c('0x11')]();}else if(_0x381d07[_0xa55c('0xd')]==='variable'&&_0x381d07['variableName']&&_0x381d07[_0xa55c('0xf')]&&_0x52a3bc[_0x381d07['variableName']]){_0x5849ad[_0x381d07['idField']]=_0x52a3bc[_0x381d07['variableName']][_0xa55c('0x11')]();}else if(_0x381d07[_0xa55c('0xd')]===_0xa55c('0x12')&&_0x381d07[_0xa55c('0x13')]&&_0x381d07[_0xa55c('0x13')][_0xa55c('0x14')]&&_0x381d07['idField']&&_0x52a3bc[_0x381d07[_0xa55c('0x13')][_0xa55c('0x14')][_0xa55c('0x15')]()]){_0x5849ad[_0x381d07[_0xa55c('0xf')]]=_0x52a3bc[_0x381d07[_0xa55c('0x13')][_0xa55c('0x14')][_0xa55c('0x15')]()][_0xa55c('0x11')]();}});}return _0x5849ad;}function createTicket(_0x24783b,_0x4cee3c,_0x3d4c9e,_0x104a99,_0x461284,_0x358b61,_0x23a1ae){logger[_0xa55c('0x16')]('Creating\x20new\x20ticket...');var _0x5f5158=_[_0xa55c('0x17')]({'parent_id':'','assigned_user_id':_0x4cee3c['id'],'ticketpriorities':_0xa55c('0x18'),'ticketstatus':_0xa55c('0x19'),'ticket_title':intUtil['getString'](_0x104a99[_0xa55c('0x1a')],_0x461284,'\x20'),'description':intUtil[_0xa55c('0x1b')](_0x104a99['Descriptions'],_0x461284,'\x0a'),'contact_id':_0x3d4c9e['id']},getCustomFields(_0x358b61,_0x461284));var _0x187a87={'method':_0xa55c('0x1c'),'uri':util[_0xa55c('0x1d')](_0xa55c('0x1e'),_0x24783b[_0xa55c('0x1f')]),'form':{'operation':'create','username':_0x24783b[_0xa55c('0x20')],'sessionName':_0x23a1ae['sessionName'],'elementType':'HelpDesk','element':JSON['stringify'](_0x5f5158)},'json':!![]};return request(_0x187a87)[_0xa55c('0x21')](function(_0x54b038){if(_0x54b038[_0xa55c('0x22')]){return BPromise[_0xa55c('0x23')]({'id':_0x54b038[_0xa55c('0x24')]['id']});}else{throw new Error(util[_0xa55c('0x1d')](_0xa55c('0x25'),JSON[_0xa55c('0x26')](_0x54b038[_0xa55c('0x27')])));}})[_0xa55c('0x28')](function(_0x192df2){var _0x3cd152=_0x192df2[_0xa55c('0x29')]||0x1f4;logger['error'](_0xa55c('0x2a'),_0xa55c('0x2b'),_0x3cd152,JSON[_0xa55c('0x26')](_0x192df2));});}function getUser(_0x906caa,_0x5d940d,_0x1377b0){if(intUtil[_0xa55c('0x2c')](_0x5d940d)){logger[_0xa55c('0x16')](_0xa55c('0x2d'),_0x5d940d);return request({'method':_0xa55c('0x2e'),'uri':util[_0xa55c('0x1d')]('%s/webservice.php',_0x906caa[_0xa55c('0x1f')]),'qs':{'operation':'query','username':_0x906caa[_0xa55c('0x20')],'sessionName':_0x1377b0[_0xa55c('0x2f')],'query':util[_0xa55c('0x1d')](_0xa55c('0x30'),_0x5d940d)},'json':!![]})['then'](function(_0x3d28fb){if(_0x3d28fb[_0xa55c('0x22')]&&_0x3d28fb[_0xa55c('0x24')][_0xa55c('0xb')]){logger[_0xa55c('0x16')](_0xa55c('0x31'));return BPromise[_0xa55c('0x23')]({'id':_0x3d28fb[_0xa55c('0x24')][0x0]['id'],'email':_0x3d28fb[_0xa55c('0x24')][0x0][_0xa55c('0x32')],'name':_0x3d28fb[_0xa55c('0x24')][0x0]['first_name']+'\x20'+_0x3d28fb['result'][_0xa55c('0x33')]});}else{logger[_0xa55c('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xa55c('0x23')]({'id':_0x1377b0[_0xa55c('0x34')],'email':_0x906caa[_0xa55c('0x20')],'name':_0xa55c('0x35')});}})[_0xa55c('0x28')](function(_0x38ff96){var _0x3ce1b3=_0x38ff96[_0xa55c('0x29')]||0x1f4;logger[_0xa55c('0x27')]('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x3ce1b3,JSON['stringify'](_0x38ff96));});}else{logger[_0xa55c('0x16')](_0xa55c('0x36'));return BPromise[_0xa55c('0x23')]({'id':_0x1377b0['userId'],'email':_0x906caa[_0xa55c('0x20')],'name':'admin'})[_0xa55c('0x28')](function(_0x4ad813){var _0x18c6f1=_0x4ad813[_0xa55c('0x29')]||0x1f4;logger[_0xa55c('0x27')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xa55c('0x37'),_0x18c6f1,JSON[_0xa55c('0x26')](_0x4ad813));});}}function getEndUser(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083){logger['info'](_0xa55c('0x38'),_0x194e78);return request({'method':'GET','uri':util[_0xa55c('0x1d')](_0xa55c('0x1e'),_0x47e93c['remoteUri']),'qs':{'operation':'query','username':_0x47e93c['username'],'sessionName':_0x4d9083['sessionName'],'query':util[_0xa55c('0x1d')](_0xa55c('0x39'),_0x194e78,_0x194e78,_0x194e78,_0x194e78,_0x194e78)},'json':!![]})[_0xa55c('0x21')](function(_0x99c4f8){if(_0x99c4f8[_0xa55c('0x22')]&&_0x99c4f8['result'][_0xa55c('0xb')]){logger[_0xa55c('0x16')](_0xa55c('0x3a'));return BPromise[_0xa55c('0x23')]({'id':_0x99c4f8[_0xa55c('0x24')][0x0]['id'],'name':_0x99c4f8[_0xa55c('0x24')][0x0]['firstname']+'\x20'+_0x99c4f8[_0xa55c('0x24')][0x0]['lastname'],'phone':_0x194e78});}else{logger['info'](_0xa55c('0x3b'));return request({'method':_0xa55c('0x1c'),'uri':util['format'](_0xa55c('0x1e'),_0x47e93c['remoteUri']),'form':{'operation':'create','sessionName':_0x4d9083[_0xa55c('0x2f')],'elementType':_0xa55c('0x3c'),'element':JSON[_0xa55c('0x26')]({'lastname':_0x6f9c4c,'phone':_0x194e78,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x1b2708){logger[_0xa55c('0x16')]('Enduser\x20created.');return BPromise[_0xa55c('0x23')]({'id':_0x1b2708['result']['id'],'name':_0x1b2708[_0xa55c('0x24')][_0xa55c('0x3d')],'phone':_0x1b2708['result'][_0xa55c('0x3e')]});})[_0xa55c('0x28')](function(_0x5d834d){var _0x40c352=_0x5d834d[_0xa55c('0x29')]||0x1f4;logger[_0xa55c('0x27')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xa55c('0x3f'),_0x40c352,JSON['stringify'](_0x5d834d));});}});}function getConnection(_0x2f9717){var _0x3a8af4=_0x2f9717[_0xa55c('0x20')];var _0x51d663=_0x2f9717[_0xa55c('0x40')];return request({'method':_0xa55c('0x2e'),'uri':util['format'](_0xa55c('0x1e'),_0x2f9717[_0xa55c('0x1f')]),'qs':{'operation':'getchallenge','username':_0x3a8af4},'json':!![]})[_0xa55c('0x21')](function(_0xd3fe78){if(_0xd3fe78['success']){return request({'method':_0xa55c('0x1c'),'uri':util[_0xa55c('0x1d')](_0xa55c('0x1e'),_0x2f9717[_0xa55c('0x1f')]),'form':{'operation':'login','username':_0x3a8af4,'accessKey':md5(_0xd3fe78[_0xa55c('0x24')]['token']+_0x51d663)},'json':!![]});}})[_0xa55c('0x21')](function(_0x213100){if(_0x213100[_0xa55c('0x22')]){return BPromise['resolve'](_0x213100[_0xa55c('0x24')]);}else{throw new Error(util[_0xa55c('0x1d')]('Account\x20%d\x20is\x20not\x20valid',_0x2f9717['id']));}})[_0xa55c('0x28')](function(_0x34de95){var _0x3822b7=_0x34de95[_0xa55c('0x29')]||0x1f4;logger[_0xa55c('0x27')](_0xa55c('0x2a'),_0xa55c('0x41'),_0x3822b7,JSON[_0xa55c('0x26')](_0x34de95));});}function request(_0x3c147b){logger[_0xa55c('0x16')]('[HTTP]',JSON[_0xa55c('0x26')](_0x3c147b));return rp(_0x3c147b);}exports[_0xa55c('0x42')]=function(_0x216de8,_0x4f73b6,_0x4c3095,_0x35bf0a,_0x4f5ecd,_0x21b760){var _0x4fa412,_0x2b6a0e,_0x228df4,_0x181802;_0x21b760[_0xa55c('0x1f')]=intUtil[_0xa55c('0x43')](_0x21b760['remoteUri']);if(_0x4f5ecd&&_0x4f5ecd[_0xa55c('0x44')]){logger[_0xa55c('0x16')]('[QUEUE]',_0xa55c('0x45'));_0x4f73b6[_0xa55c('0x46')]=util[_0xa55c('0x1d')](_0xa55c('0x47'),_0x21b760['serverUrl'],_0x4f73b6['uniqueid'],md5(_0x4f73b6[_0xa55c('0x48')]));}else{_0x4f73b6[_0xa55c('0x46')]='';}return getConnection(_0x21b760)[_0xa55c('0x21')](function(_0x44ac57){_0x181802=_0x44ac57;return getUser(_0x21b760,_0x35bf0a['email'],_0x181802);})[_0xa55c('0x21')](function(_0x5ce463){_0x4fa412=_0x5ce463;logger[_0xa55c('0x16')](_0xa55c('0x49'),_0x4fa412['id']);return getEndUser(_0x21b760,_0x4f73b6[_0xa55c('0x4a')],_0x4f73b6[_0xa55c('0x4b')],_0x181802);})[_0xa55c('0x21')](function(_0x53b2f7){_0x2b6a0e=_0x53b2f7;logger[_0xa55c('0x16')]('The\x20Enduser\x20ID\x20is:',_0x2b6a0e['id']);return createTicket(_0x21b760,_0x4fa412,_0x2b6a0e,_0x4c3095,_0x4f73b6,_0x4c3095[_0xa55c('0x4c')],_0x181802);})[_0xa55c('0x21')](function(_0x2cfe08){_0x228df4=_0x2cfe08;logger[_0xa55c('0x16')](_0xa55c('0x4d'));logger[_0xa55c('0x16')](_0xa55c('0x4e'),_0x228df4['id']);var _0x53e2be=util[_0xa55c('0x1d')](_0xa55c('0x4f'),_0x21b760[_0xa55c('0x1f')],_[_0xa55c('0x50')](_0x228df4['id'],'x')[0x1]);logger[_0xa55c('0x16')]('[QUEUE]',_0xa55c('0x51'));emit(util[_0xa55c('0x1d')](_0xa55c('0x52'),_0x35bf0a[_0xa55c('0x14')]),_0xa55c('0x53'),{'uri':_0x53e2be});})['catch'](function(_0xdd92c1){logger[_0xa55c('0x27')](_0xa55c('0x54'),JSON[_0xa55c('0x26')](_0xdd92c1));});};exports[_0xa55c('0x55')]=function(_0x480dfc,_0x419fc3,_0x4d94fc,_0x2e482a,_0x5e3a28,_0x3495a7,_0x5a8897){var _0x34edc5,_0x1333da,_0x21d6b4,_0x2f811e;_0x3495a7[_0xa55c('0x1f')]=intUtil[_0xa55c('0x43')](_0x3495a7[_0xa55c('0x1f')]);_0x3495a7[_0xa55c('0x56')]=intUtil[_0xa55c('0x43')](_0x3495a7[_0xa55c('0x56')]);if(_0x5a8897&&_0x5a8897['recordingFormat']&&_0x5a8897[_0xa55c('0x57')]!==_0xa55c('0x58')){logger['info'](_0xa55c('0x59'),_0xa55c('0x45'));_0x419fc3[_0xa55c('0x46')]=util[_0xa55c('0x1d')](_0xa55c('0x47'),_0x3495a7[_0xa55c('0x56')],_0x419fc3[_0xa55c('0x48')],md5(_0x419fc3[_0xa55c('0x48')]));}return getConnection(_0x3495a7)['then'](function(_0x1dfaf7){_0x2f811e=_0x1dfaf7;return getUser(_0x3495a7,_0x2e482a[_0xa55c('0x5a')],_0x2f811e);})[_0xa55c('0x21')](function(_0xd309a9){_0x34edc5=_0xd309a9;logger[_0xa55c('0x16')](_0xa55c('0x49'),_0x34edc5['id']);return getEndUser(_0x3495a7,_0x419fc3[_0xa55c('0x5b')],_0x419fc3[_0xa55c('0x5c')],_0x2f811e);})[_0xa55c('0x21')](function(_0x4a08ca){_0x1333da=_0x4a08ca;logger[_0xa55c('0x16')](_0xa55c('0x5d'),_0x1333da['id']);return createTicket(_0x3495a7,_0x34edc5,_0x1333da,_0x4d94fc,_0x419fc3,_0x4d94fc[_0xa55c('0x4c')],_0x2f811e);})[_0xa55c('0x21')](function(_0x3a269d){_0x21d6b4=_0x3a269d;logger[_0xa55c('0x16')](_0xa55c('0x4d'));logger[_0xa55c('0x16')](_0xa55c('0x4e'),_0x21d6b4['id']);var _0x3178a6=util[_0xa55c('0x1d')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3495a7[_0xa55c('0x1f')],_['split'](_0x21d6b4['id'],'x')[0x1]);logger[_0xa55c('0x16')](_0xa55c('0x59'),_0xa55c('0x51'));emit(util['format']('user:%s',_0x2e482a[_0xa55c('0x14')]),_0xa55c('0x53'),{'uri':_0x3178a6});})[_0xa55c('0x28')](function(_0x42529f){logger['error'](_0xa55c('0x59'),JSON[_0xa55c('0x26')](_0x42529f));});};exports[_0xa55c('0x5e')]=function(_0x3a9910,_0x21fc9b,_0x500968,_0x4b090c,_0x3f7fca,_0x38689e){var _0x3f9d0a,_0x36ee32,_0x1af9d5,_0x4b2032;_0x38689e[_0xa55c('0x1f')]=intUtil[_0xa55c('0x43')](_0x38689e['remoteUri']);_0x38689e[_0xa55c('0x56')]=intUtil[_0xa55c('0x43')](_0x38689e[_0xa55c('0x56')]);if(_0x3f7fca&&_0x3f7fca['monitor_format']){logger[_0xa55c('0x16')](_0xa55c('0x5f'),_0xa55c('0x45'));_0x21fc9b[_0xa55c('0x46')]=util[_0xa55c('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38689e[_0xa55c('0x56')],_0x21fc9b[_0xa55c('0x48')],md5(_0x21fc9b['uniqueid']));}else{_0x21fc9b['recordingURL']='';}return getConnection(_0x38689e)[_0xa55c('0x21')](function(_0x4e1cbd){_0x4b2032=_0x4e1cbd;return getUser(_0x38689e,'',_0x4b2032);})[_0xa55c('0x21')](function(_0x5ca0bc){_0x3f9d0a=_0x5ca0bc;logger[_0xa55c('0x16')](_0xa55c('0x49'),_0x3f9d0a['id']);return getEndUser(_0x38689e,_0x21fc9b[_0xa55c('0x4a')],_0x21fc9b[_0xa55c('0x4b')],_0x4b2032);})[_0xa55c('0x21')](function(_0xff7b1c){_0x36ee32=_0xff7b1c;logger[_0xa55c('0x16')]('The\x20Enduser\x20ID\x20is:',_0x36ee32['id']);return createTicket(_0x38689e,_0x3f9d0a,_0x36ee32,_0x500968,_0x21fc9b,_0x500968[_0xa55c('0x4c')],_0x4b2032);})[_0xa55c('0x21')](function(_0x21de68){_0x1af9d5=_0x21de68;logger[_0xa55c('0x16')]('Ticket\x20created!');logger[_0xa55c('0x16')](_0xa55c('0x4e'),_0x1af9d5['id']);})[_0xa55c('0x28')](function(_0x2298ac){logger['error']('[ABANDONED]',JSON[_0xa55c('0x26')](_0x2298ac));});}; \ No newline at end of file +var _0x008c=['util','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','merge','Descriptions','POST','format','%s/webservice.php','remoteUri','username','stringify','then','success','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','createTicket','validateEmail','info','Getting\x20agent\x20with\x20email','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','length','Agent\x20found!','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','firstname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','create','Contacts','Enduser\x20created.','lastname','phone','getEndUser','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','split','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','abandoned','[ABANDONED]','lodash','request-promise','bluebird','md5'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x008c,0x188));var _0xc008=function(_0x585ed8,_0x3e44ac){_0x585ed8=_0x585ed8-0x0;var _0x9d5f3a=_0x008c[_0x585ed8];return _0x9d5f3a;};'use strict';var _=require(_0xc008('0x0'));var rp=require(_0xc008('0x1'));var BPromise=require(_0xc008('0x2'));var md5=require(_0xc008('0x3'));var util=require(_0xc008('0x4'));var Redis=require('ioredis');var intUtil=require(_0xc008('0x5'));var config=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));config[_0xc008('0x9')]=_[_0xc008('0xa')](config[_0xc008('0x9')],{'host':_0xc008('0xb'),'port':0x18eb});var io=require(_0xc008('0xc'))(new Redis(config['redis']));function emit(_0x428fa9,_0x5aa09b,_0x30be38){io['to'](_0x428fa9)['emit'](_0x5aa09b,_0x30be38);}function getCustomFields(_0x52041f,_0x27830d){var _0x7231b4={};if(_0x52041f['length']>0x0){_['forEach'](_0x52041f,function(_0x543eb8){if(_0x543eb8[_0xc008('0xd')]===_0xc008('0xe')&&_0x543eb8['idField']){_0x7231b4[_0x543eb8[_0xc008('0xf')]]=_0x543eb8[_0xc008('0x10')][_0xc008('0x11')]();}else if(_0x543eb8[_0xc008('0xd')]===_0xc008('0x12')&&_0x543eb8[_0xc008('0x13')]&&_0x543eb8[_0xc008('0xf')]&&_0x27830d[_0x543eb8['variableName']]){_0x7231b4[_0x543eb8['idField']]=_0x27830d[_0x543eb8[_0xc008('0x13')]]['toString']();}else if(_0x543eb8[_0xc008('0xd')]===_0xc008('0x14')&&_0x543eb8[_0xc008('0x15')]&&_0x543eb8[_0xc008('0x15')][_0xc008('0x16')]&&_0x543eb8['idField']&&_0x27830d[_0x543eb8['Variable']['name'][_0xc008('0x17')]()]){_0x7231b4[_0x543eb8[_0xc008('0xf')]]=_0x27830d[_0x543eb8[_0xc008('0x15')][_0xc008('0x16')]['toLowerCase']()]['toString']();}});}return _0x7231b4;}function createTicket(_0x540e45,_0x5c2668,_0x46042b,_0x462af5,_0x501137,_0x813397,_0x5906e6){logger['info']('Creating\x20new\x20ticket...');var _0x50261c=_[_0xc008('0x18')]({'parent_id':'','assigned_user_id':_0x5c2668['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil['getString'](_0x462af5['Subjects'],_0x501137,'\x20'),'description':intUtil['getString'](_0x462af5[_0xc008('0x19')],_0x501137,'\x0a'),'contact_id':_0x46042b['id']},getCustomFields(_0x813397,_0x501137));var _0x4777a6={'method':_0xc008('0x1a'),'uri':util[_0xc008('0x1b')](_0xc008('0x1c'),_0x540e45[_0xc008('0x1d')]),'form':{'operation':'create','username':_0x540e45[_0xc008('0x1e')],'sessionName':_0x5906e6['sessionName'],'elementType':'HelpDesk','element':JSON[_0xc008('0x1f')](_0x50261c)},'json':!![]};return request(_0x4777a6)[_0xc008('0x20')](function(_0x2e3cfb){if(_0x2e3cfb[_0xc008('0x21')]){return BPromise['resolve']({'id':_0x2e3cfb['result']['id']});}else{throw new Error(util['format'](_0xc008('0x22'),JSON[_0xc008('0x1f')](_0x2e3cfb[_0xc008('0x23')])));}})[_0xc008('0x24')](function(_0x5bebd9){var _0x5e2aca=_0x5bebd9['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0xc008('0x25'),_0x5e2aca,JSON[_0xc008('0x1f')](_0x5bebd9));});}function getUser(_0x25eae4,_0x529961,_0x24c14c){if(intUtil[_0xc008('0x26')](_0x529961)){logger[_0xc008('0x27')](_0xc008('0x28'),_0x529961);return request({'method':'GET','uri':util[_0xc008('0x1b')](_0xc008('0x1c'),_0x25eae4['remoteUri']),'qs':{'operation':'query','username':_0x25eae4['username'],'sessionName':_0x24c14c[_0xc008('0x29')],'query':util[_0xc008('0x1b')](_0xc008('0x2a'),_0x529961)},'json':!![]})[_0xc008('0x20')](function(_0x1de04b){if(_0x1de04b[_0xc008('0x21')]&&_0x1de04b[_0xc008('0x2b')][_0xc008('0x2c')]){logger[_0xc008('0x27')](_0xc008('0x2d'));return BPromise[_0xc008('0x2e')]({'id':_0x1de04b[_0xc008('0x2b')][0x0]['id'],'email':_0x1de04b['result'][0x0][_0xc008('0x2f')],'name':_0x1de04b[_0xc008('0x2b')][0x0]['first_name']+'\x20'+_0x1de04b[_0xc008('0x2b')][_0xc008('0x30')]});}else{logger[_0xc008('0x27')](_0xc008('0x31'));return BPromise[_0xc008('0x2e')]({'id':_0x24c14c[_0xc008('0x32')],'email':_0x25eae4[_0xc008('0x1e')],'name':_0xc008('0x33')});}})[_0xc008('0x24')](function(_0x4f14d2){var _0x415b87=_0x4f14d2[_0xc008('0x34')]||0x1f4;logger[_0xc008('0x23')](_0xc008('0x35'),_0xc008('0x36'),_0x415b87,JSON[_0xc008('0x1f')](_0x4f14d2));});}else{logger[_0xc008('0x27')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xc008('0x2e')]({'id':_0x24c14c[_0xc008('0x32')],'email':_0x25eae4['username'],'name':_0xc008('0x33')})[_0xc008('0x24')](function(_0x5e38d5){var _0x263473=_0x5e38d5[_0xc008('0x34')]||0x1f4;logger[_0xc008('0x23')]('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x263473,JSON['stringify'](_0x5e38d5));});}}function getEndUser(_0x234f2a,_0x518024,_0x3dd0ac,_0x3884dd){logger[_0xc008('0x27')](_0xc008('0x37'),_0x3dd0ac);return request({'method':_0xc008('0x38'),'uri':util[_0xc008('0x1b')](_0xc008('0x1c'),_0x234f2a[_0xc008('0x1d')]),'qs':{'operation':_0xc008('0x39'),'username':_0x234f2a[_0xc008('0x1e')],'sessionName':_0x3884dd[_0xc008('0x29')],'query':util[_0xc008('0x1b')](_0xc008('0x3a'),_0x3dd0ac,_0x3dd0ac,_0x3dd0ac,_0x3dd0ac,_0x3dd0ac)},'json':!![]})[_0xc008('0x20')](function(_0x4cace5){if(_0x4cace5[_0xc008('0x21')]&&_0x4cace5[_0xc008('0x2b')][_0xc008('0x2c')]){logger[_0xc008('0x27')]('Enduser\x20found!');return BPromise[_0xc008('0x2e')]({'id':_0x4cace5[_0xc008('0x2b')][0x0]['id'],'name':_0x4cace5[_0xc008('0x2b')][0x0][_0xc008('0x3b')]+'\x20'+_0x4cace5[_0xc008('0x2b')][0x0]['lastname'],'phone':_0x3dd0ac});}else{logger[_0xc008('0x27')](_0xc008('0x3c'));return request({'method':_0xc008('0x1a'),'uri':util[_0xc008('0x1b')](_0xc008('0x1c'),_0x234f2a['remoteUri']),'form':{'operation':_0xc008('0x3d'),'sessionName':_0x3884dd[_0xc008('0x29')],'elementType':_0xc008('0x3e'),'element':JSON[_0xc008('0x1f')]({'lastname':_0x518024,'phone':_0x3dd0ac,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x26cd05){logger[_0xc008('0x27')](_0xc008('0x3f'));return BPromise['resolve']({'id':_0x26cd05[_0xc008('0x2b')]['id'],'name':_0x26cd05['result'][_0xc008('0x40')],'phone':_0x26cd05['result'][_0xc008('0x41')]});})[_0xc008('0x24')](function(_0x5a5d85){var _0x31007c=_0x5a5d85[_0xc008('0x34')]||0x1f4;logger[_0xc008('0x23')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xc008('0x42'),_0x31007c,JSON[_0xc008('0x1f')](_0x5a5d85));});}});}function getConnection(_0x200469){var _0x44fc5d=_0x200469[_0xc008('0x1e')];var _0x372305=_0x200469['accessKey'];return request({'method':'GET','uri':util['format'](_0xc008('0x1c'),_0x200469[_0xc008('0x1d')]),'qs':{'operation':_0xc008('0x43'),'username':_0x44fc5d},'json':!![]})[_0xc008('0x20')](function(_0x25289f){if(_0x25289f[_0xc008('0x21')]){return request({'method':_0xc008('0x1a'),'uri':util[_0xc008('0x1b')]('%s/webservice.php',_0x200469['remoteUri']),'form':{'operation':'login','username':_0x44fc5d,'accessKey':md5(_0x25289f[_0xc008('0x2b')][_0xc008('0x44')]+_0x372305)},'json':!![]});}})[_0xc008('0x20')](function(_0x511383){if(_0x511383[_0xc008('0x21')]){return BPromise[_0xc008('0x2e')](_0x511383[_0xc008('0x2b')]);}else{throw new Error(util[_0xc008('0x1b')](_0xc008('0x45'),_0x200469['id']));}})[_0xc008('0x24')](function(_0x17ec90){var _0x405e87=_0x17ec90[_0xc008('0x34')]||0x1f4;logger[_0xc008('0x23')]('[vTiger],\x20%s,\x20%s,\x20%s','getConnection',_0x405e87,JSON[_0xc008('0x1f')](_0x17ec90));});}function request(_0x51cb14){logger[_0xc008('0x27')](_0xc008('0x46'),JSON[_0xc008('0x1f')](_0x51cb14));return rp(_0x51cb14);}exports['queue']=function(_0x144ab2,_0x32b435,_0xee64,_0x8b9775,_0x750cc9,_0x51105f){var _0x3a7b3b,_0x27b022,_0x4b4c6d,_0x24f775;_0x51105f[_0xc008('0x1d')]=intUtil['stripTrailingSlash'](_0x51105f['remoteUri']);if(_0x750cc9&&_0x750cc9[_0xc008('0x47')]){logger[_0xc008('0x27')](_0xc008('0x48'),_0xc008('0x49'));_0x32b435[_0xc008('0x4a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x51105f[_0xc008('0x4b')],_0x32b435['uniqueid'],md5(_0x32b435[_0xc008('0x4c')]));}else{_0x32b435[_0xc008('0x4a')]='';}return getConnection(_0x51105f)[_0xc008('0x20')](function(_0x2f1105){_0x24f775=_0x2f1105;return getUser(_0x51105f,_0x8b9775[_0xc008('0x4d')],_0x24f775);})[_0xc008('0x20')](function(_0x49d8b0){_0x3a7b3b=_0x49d8b0;logger[_0xc008('0x27')](_0xc008('0x4e'),_0x3a7b3b['id']);return getEndUser(_0x51105f,_0x32b435[_0xc008('0x4f')],_0x32b435[_0xc008('0x50')],_0x24f775);})[_0xc008('0x20')](function(_0x5aa385){_0x27b022=_0x5aa385;logger[_0xc008('0x27')]('The\x20Enduser\x20ID\x20is:',_0x27b022['id']);return createTicket(_0x51105f,_0x3a7b3b,_0x27b022,_0xee64,_0x32b435,_0xee64['Fields'],_0x24f775);})['then'](function(_0x89bb20){_0x4b4c6d=_0x89bb20;logger[_0xc008('0x27')](_0xc008('0x51'));logger['info'](_0xc008('0x52'),_0x4b4c6d['id']);var _0x2d8361=util[_0xc008('0x1b')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x51105f[_0xc008('0x1d')],_[_0xc008('0x53')](_0x4b4c6d['id'],'x')[0x1]);logger[_0xc008('0x27')](_0xc008('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc008('0x1b')]('user:%s',_0x8b9775[_0xc008('0x16')]),_0xc008('0x54'),{'uri':_0x2d8361});})[_0xc008('0x24')](function(_0x943c91){logger[_0xc008('0x23')](_0xc008('0x48'),JSON['stringify'](_0x943c91));});};exports[_0xc008('0x55')]=function(_0x570001,_0x5bf4a9,_0x37ce5e,_0x30aa1e,_0x56e755,_0xb1befa,_0xb8ba7){var _0x3e373e,_0x4517c0,_0x21ee6d,_0x31a339;_0xb1befa[_0xc008('0x1d')]=intUtil['stripTrailingSlash'](_0xb1befa[_0xc008('0x1d')]);_0xb1befa[_0xc008('0x4b')]=intUtil[_0xc008('0x56')](_0xb1befa[_0xc008('0x4b')]);if(_0xb8ba7&&_0xb8ba7[_0xc008('0x57')]&&_0xb8ba7[_0xc008('0x57')]!==_0xc008('0x58')){logger[_0xc008('0x27')](_0xc008('0x59'),_0xc008('0x49'));_0x5bf4a9[_0xc008('0x4a')]=util[_0xc008('0x1b')](_0xc008('0x5a'),_0xb1befa[_0xc008('0x4b')],_0x5bf4a9['uniqueid'],md5(_0x5bf4a9[_0xc008('0x4c')]));}return getConnection(_0xb1befa)[_0xc008('0x20')](function(_0x3d3a7e){_0x31a339=_0x3d3a7e;return getUser(_0xb1befa,_0x30aa1e['email'],_0x31a339);})[_0xc008('0x20')](function(_0x3214df){_0x3e373e=_0x3214df;logger['info']('The\x20User\x20ID\x20is:',_0x3e373e['id']);return getEndUser(_0xb1befa,_0x5bf4a9[_0xc008('0x5b')],_0x5bf4a9[_0xc008('0x5c')],_0x31a339);})[_0xc008('0x20')](function(_0x39083c){_0x4517c0=_0x39083c;logger[_0xc008('0x27')](_0xc008('0x5d'),_0x4517c0['id']);return createTicket(_0xb1befa,_0x3e373e,_0x4517c0,_0x37ce5e,_0x5bf4a9,_0x37ce5e[_0xc008('0x5e')],_0x31a339);})[_0xc008('0x20')](function(_0x39e219){_0x21ee6d=_0x39e219;logger[_0xc008('0x27')](_0xc008('0x51'));logger['info'](_0xc008('0x52'),_0x21ee6d['id']);var _0x25a52b=util[_0xc008('0x1b')](_0xc008('0x5f'),_0xb1befa['remoteUri'],_[_0xc008('0x53')](_0x21ee6d['id'],'x')[0x1]);logger['info'](_0xc008('0x59'),_0xc008('0x60'));emit(util[_0xc008('0x1b')]('user:%s',_0x30aa1e[_0xc008('0x16')]),_0xc008('0x54'),{'uri':_0x25a52b});})[_0xc008('0x24')](function(_0x553f5c){logger[_0xc008('0x23')]('[OUTBOUND]',JSON[_0xc008('0x1f')](_0x553f5c));});};exports[_0xc008('0x61')]=function(_0x23012c,_0x6fe732,_0x295ec7,_0x4ca4a6,_0x3c30db,_0x3f2342){var _0x49493b,_0x3efb77,_0x5233bb,_0x278cbe;_0x3f2342['remoteUri']=intUtil[_0xc008('0x56')](_0x3f2342['remoteUri']);_0x3f2342[_0xc008('0x4b')]=intUtil[_0xc008('0x56')](_0x3f2342[_0xc008('0x4b')]);if(_0x3c30db&&_0x3c30db[_0xc008('0x47')]){logger['info'](_0xc008('0x62'),_0xc008('0x49'));_0x6fe732[_0xc008('0x4a')]=util[_0xc008('0x1b')](_0xc008('0x5a'),_0x3f2342[_0xc008('0x4b')],_0x6fe732[_0xc008('0x4c')],md5(_0x6fe732[_0xc008('0x4c')]));}else{_0x6fe732['recordingURL']='';}return getConnection(_0x3f2342)[_0xc008('0x20')](function(_0x530c2f){_0x278cbe=_0x530c2f;return getUser(_0x3f2342,'',_0x278cbe);})['then'](function(_0x4c84da){_0x49493b=_0x4c84da;logger[_0xc008('0x27')](_0xc008('0x4e'),_0x49493b['id']);return getEndUser(_0x3f2342,_0x6fe732[_0xc008('0x4f')],_0x6fe732[_0xc008('0x50')],_0x278cbe);})[_0xc008('0x20')](function(_0x2e9646){_0x3efb77=_0x2e9646;logger[_0xc008('0x27')](_0xc008('0x5d'),_0x3efb77['id']);return createTicket(_0x3f2342,_0x49493b,_0x3efb77,_0x295ec7,_0x6fe732,_0x295ec7[_0xc008('0x5e')],_0x278cbe);})['then'](function(_0x38b603){_0x5233bb=_0x38b603;logger[_0xc008('0x27')](_0xc008('0x51'));logger[_0xc008('0x27')](_0xc008('0x52'),_0x5233bb['id']);})[_0xc008('0x24')](function(_0x23d4ff){logger[_0xc008('0x23')](_0xc008('0x62'),JSON[_0xc008('0x1f')](_0x23d4ff));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 3c428dc..b7c0473 100644 --- a/server/services/ami/trigger/integration/zendesk.js +++ b/server/services/ami/trigger/integration/zendesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05dc=['Basic\x20%s','toString','[HTTP]','stringify','GET','map','forEach','type','nameField','customField','toLowerCase','content','string','custom_fields','push','idField','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','abandoned','calleridname','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','format','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','end-user','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username'];(function(_0x1a4d99,_0x506ad4){var _0x49619a=function(_0x186392){while(--_0x186392){_0x1a4d99['push'](_0x1a4d99['shift']());}};_0x49619a(++_0x506ad4);}(_0x05dc,0x178));var _0xc05d=function(_0x251fde,_0x384469){_0x251fde=_0x251fde-0x0;var _0x350af6=_0x05dc[_0x251fde];return _0x350af6;};'use strict';var _=require('lodash');var rp=require(_0xc05d('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xc05d('0x1'));var intUtil=require(_0xc05d('0x2'));var config=require(_0xc05d('0x3'));var logger=require(_0xc05d('0x4'))(_0xc05d('0x5'));config[_0xc05d('0x6')]=_[_0xc05d('0x7')](config[_0xc05d('0x6')],{'host':_0xc05d('0x8'),'port':0x18eb});var io=require(_0xc05d('0x9'))(new Redis(config[_0xc05d('0x6')]));function emit(_0x52f1f0,_0x42c263,_0x69e493){io['to'](_0x52f1f0)[_0xc05d('0xa')](_0x42c263,_0x69e493);}var headers={'Content-Type':_0xc05d('0xb'),'Accept':_0xc05d('0xb')};function getTicket(_0x4307fc,_0x22915b,_0xedf58b,_0xc79d75,_0x75a4a0){logger[_0xc05d('0xc')](_0xc05d('0xd'));return request({'uri':util['format']('%s/tickets.json',_0x4307fc[_0xc05d('0xe')]),'method':'POST','body':{'ticket':_[_0xc05d('0xf')]({'requester_id':_0xedf58b['id'],'submitter_id':_0x22915b?_0x22915b['id']:undefined,'assignee_id':_0x22915b?_0x22915b['id']:undefined,'tags':getTags(_0xc79d75[_0xc05d('0x10')],_0xc05d('0x11')),'subject':intUtil[_0xc05d('0x12')](_0xc79d75[_0xc05d('0x13')],_0x75a4a0,'\x20'),'description':intUtil[_0xc05d('0x12')](_0xc79d75[_0xc05d('0x14')],_0x75a4a0,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0xc79d75[_0xc05d('0x14')],_0x75a4a0,'\x0a')}},getCustomFields(_0xc79d75[_0xc05d('0x15')],_0x75a4a0))}})[_0xc05d('0x16')](function(_0x2e53eb){logger['info'](_0xc05d('0x17'));return _0x2e53eb[_0xc05d('0x18')];});}function getUser(_0x30d501,_0x1f9430){if(intUtil['validateEmail'](_0x1f9430)){logger['info'](_0xc05d('0x19'),_0x1f9430);return request({'uri':util['format'](_0xc05d('0x1a'),_0x30d501[_0xc05d('0xe')]),'qs':{'query':util[_0xc05d('0x1b')](_0xc05d('0x1c'),_0x1f9430)}})[_0xc05d('0x16')](function(_0x3840e8){if(_0x3840e8[_0xc05d('0x1d')]){logger[_0xc05d('0xc')](_0xc05d('0x1e'));return _[_0xc05d('0x1f')](_0x3840e8['results'],{'email':_0x1f9430,'role':_0xc05d('0x20')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x30d501['remoteUri'])})['then'](function(_0x414030){logger[_0xc05d('0xc')](_0xc05d('0x21'));return _0x414030[_0xc05d('0x22')];});}});}else{logger[_0xc05d('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xc05d('0x1b')](_0xc05d('0x23'),_0x30d501['remoteUri'])})[_0xc05d('0x16')](function(_0x5a16e5){logger[_0xc05d('0xc')](_0xc05d('0x21'));return _0x5a16e5[_0xc05d('0x22')];});}}function getEndUser(_0x2480a0,_0x48a980,_0x2debad){logger[_0xc05d('0xc')](_0xc05d('0x24'),_0x2debad);return request({'uri':util[_0xc05d('0x1b')](_0xc05d('0x1a'),_0x2480a0[_0xc05d('0xe')]),'qs':{'query':util[_0xc05d('0x1b')](_0xc05d('0x25'),_0x2debad)}})[_0xc05d('0x16')](function(_0x213538){var _0x27b19c;if(_0x213538['results']['length']){_0x213538[_0xc05d('0x26')]=_['filter'](_0x213538[_0xc05d('0x26')],{'suspended':![],'role':_0xc05d('0x27')});if(_0x213538['results'][_0xc05d('0x28')]){_0x27b19c=_['first'](_0x213538['results']);}}if(_0x27b19c){logger[_0xc05d('0xc')]('Enduser\x20found!');return _0x27b19c;}else{logger['info'](_0xc05d('0x29'));return request({'uri':util[_0xc05d('0x1b')](_0xc05d('0x2a'),_0x2480a0[_0xc05d('0xe')]),'method':_0xc05d('0x2b'),'body':{'user':{'role':_0xc05d('0x27'),'name':util['format'](_0xc05d('0x2c'),_0x48a980||_0x2debad),'phone':_0x2debad}}})['then'](function(_0x22a9eb){logger[_0xc05d('0xc')](_0xc05d('0x2d'));return _0x22a9eb[_0xc05d('0x22')];});}});}function getAuth(_0xa9f3a0){var _0x3ac6e5;if(_0xa9f3a0[_0xc05d('0x2e')]===_0xc05d('0x2f')){_0x3ac6e5=util[_0xc05d('0x1b')](_0xc05d('0x30'),_0xa9f3a0['username'],_0xa9f3a0[_0xc05d('0x2f')]);}else if(_0xa9f3a0[_0xc05d('0x2e')]===_0xc05d('0x31')){_0x3ac6e5=util['format'](_0xc05d('0x32'),_0xa9f3a0[_0xc05d('0x33')],_0xa9f3a0[_0xc05d('0x31')]);}return util[_0xc05d('0x1b')](_0xc05d('0x34'),new Buffer(_0x3ac6e5)[_0xc05d('0x35')]('base64'));}function request(_0x1e4bec){logger['debug'](_0xc05d('0x36'),JSON[_0xc05d('0x37')](_0x1e4bec));return rp(_[_0xc05d('0x7')](_0x1e4bec,{'method':_0xc05d('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x486493,_0xf2dac7){var _0xecc0b0=[];if(_0x486493&&_0x486493[_0xc05d('0x28')]>0x0){_0xecc0b0=_[_0xc05d('0x39')](_0x486493,_0xf2dac7);}return _0xecc0b0;}function getCustomFields(_0x14a1b5,_0x328865){var _0x38b34c=[];var _0x4dbd24={'custom_fields':[]};if(_0x14a1b5[_0xc05d('0x28')]>0x0){_[_0xc05d('0x3a')](_0x14a1b5,function(_0x1de055){if(_0x1de055[_0xc05d('0x3b')]==='string'&&_0x1de055[_0xc05d('0x3c')]&&!_0x1de055[_0xc05d('0x3d')]){_0x4dbd24[_0x1de055[_0xc05d('0x3c')][_0xc05d('0x3e')]()]=_0x1de055[_0xc05d('0x3f')]['toString']();}else if(_0x1de055[_0xc05d('0x3b')]===_0xc05d('0x40')&&_0x1de055['idField']&&_0x1de055['customField']){_0x4dbd24[_0xc05d('0x41')][_0xc05d('0x42')]({'id':_0x1de055[_0xc05d('0x43')],'value':_0x1de055[_0xc05d('0x3f')][_0xc05d('0x35')]()});}else if(_0x1de055['type']==='variable'&&_0x1de055[_0xc05d('0x44')]&&_0x1de055[_0xc05d('0x43')]&&_0x1de055[_0xc05d('0x3d')]){_0x328865[_0x1de055[_0xc05d('0x44')]]&&_0x4dbd24[_0xc05d('0x41')][_0xc05d('0x42')]({'id':_0x1de055['idField'],'value':_0x328865[_0x1de055[_0xc05d('0x44')]][_0xc05d('0x35')]()});}else if(_0x1de055[_0xc05d('0x3b')]===_0xc05d('0x45')&&_0x1de055[_0xc05d('0x46')]&&_0x1de055[_0xc05d('0x46')][_0xc05d('0x11')]&&_0x1de055[_0xc05d('0x43')]&&_0x1de055[_0xc05d('0x3d')]){_0x328865[_0x1de055[_0xc05d('0x46')][_0xc05d('0x11')]['toLowerCase']()]&&_0x4dbd24[_0xc05d('0x41')]['push']({'id':_0x1de055[_0xc05d('0x43')],'value':_0x328865[_0x1de055[_0xc05d('0x46')][_0xc05d('0x11')]['toLowerCase']()][_0xc05d('0x35')]()});}});}return _0x4dbd24;}exports[_0xc05d('0x47')]=function(_0x3133a6,_0x4a69bc,_0x583870,_0x877bef,_0x22bf97,_0xa8f31f){var _0xbaada9,_0x44f392;_0xa8f31f[_0xc05d('0xe')]=intUtil[_0xc05d('0x48')](_0xa8f31f['remoteUri']);_0xa8f31f[_0xc05d('0x49')]=intUtil[_0xc05d('0x48')](_0xa8f31f[_0xc05d('0x49')]);if(_0x22bf97&&_0x22bf97[_0xc05d('0x4a')]){logger[_0xc05d('0xc')](_0xc05d('0x4b'),_0xc05d('0x4c'));_0x4a69bc['recordingURL']=util[_0xc05d('0x1b')](_0xc05d('0x4d'),_0xa8f31f[_0xc05d('0x49')],_0x4a69bc[_0xc05d('0x4e')],md5(_0x4a69bc[_0xc05d('0x4e')]));}else{_0x4a69bc['recordingURL']='';}headers[_0xc05d('0x4f')]=getAuth(_0xa8f31f);return getUser(_0xa8f31f,_0x877bef[_0xc05d('0x50')])[_0xc05d('0x16')](function(_0x1da912){_0xbaada9=_0x1da912;logger[_0xc05d('0xc')](_0xc05d('0x51'),_0xbaada9['id']);return getEndUser(_0xa8f31f,_0x4a69bc['calleridname'],_0x4a69bc[_0xc05d('0x52')]);})[_0xc05d('0x16')](function(_0x3dd332){_0x44f392=_0x3dd332;logger[_0xc05d('0xc')](_0xc05d('0x53'),_0x44f392['id']);return getTicket(_0xa8f31f,_0xbaada9,_0x44f392,_0x583870,_0x4a69bc);})[_0xc05d('0x16')](function(_0x4d0d0e){if(_0x4d0d0e){logger[_0xc05d('0xc')](_0xc05d('0x54'),_0x4d0d0e['id']);switch(_0xa8f31f[_0xc05d('0x3b')]){case'integrationTab':logger[_0xc05d('0xc')](_0xc05d('0x4b'),_0xc05d('0x55'));return request({'uri':util[_0xc05d('0x1b')](_0xc05d('0x56'),_0xa8f31f[_0xc05d('0xe')],_0xbaada9['id'],_0x4d0d0e['id']),'method':'POST'});case _0xc05d('0x57'):logger[_0xc05d('0xc')](_0xc05d('0x4b'),_0xc05d('0x58'));emit(util[_0xc05d('0x1b')](_0xc05d('0x59'),_0x877bef[_0xc05d('0x11')]),_0xc05d('0x5a'),{'uri':util['format'](_0xc05d('0x5b'),_0xa8f31f[_0xc05d('0xe')],_0x4d0d0e['id'])});break;default:logger[_0xc05d('0x5c')](_0xc05d('0x4b'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x177a6d){logger[_0xc05d('0x5c')](_0xc05d('0x5d'),util['inspect'](_0x177a6d,{'showHidden':!![],'depth':null}));});};exports[_0xc05d('0x5e')]=function(_0x5828b1,_0x3580e9,_0x585fc8,_0x598c62,_0xe44ed9,_0x573b2c,_0xa42fc9){var _0x51ece8,_0x32a2ac;_0x573b2c['remoteUri']=intUtil[_0xc05d('0x48')](_0x573b2c[_0xc05d('0xe')]);_0x573b2c['serverUrl']=intUtil[_0xc05d('0x48')](_0x573b2c[_0xc05d('0x49')]);if(_0xa42fc9&&_0xa42fc9[_0xc05d('0x5f')]&&_0xa42fc9[_0xc05d('0x5f')]!==_0xc05d('0x60')){logger[_0xc05d('0xc')](_0xc05d('0x61'),_0xc05d('0x4c'));_0x3580e9[_0xc05d('0x62')]=util[_0xc05d('0x1b')](_0xc05d('0x4d'),_0x573b2c[_0xc05d('0x49')],_0x3580e9[_0xc05d('0x4e')],md5(_0x3580e9[_0xc05d('0x4e')]));}headers[_0xc05d('0x4f')]=getAuth(_0x573b2c);return getUser(_0x573b2c,_0x598c62[_0xc05d('0x50')])[_0xc05d('0x16')](function(_0x131541){_0x51ece8=_0x131541;logger[_0xc05d('0xc')]('The\x20User\x20ID\x20is:',_0x51ece8['id']);return getEndUser(_0x573b2c,_0x3580e9[_0xc05d('0x63')],_0x3580e9[_0xc05d('0x64')]);})['then'](function(_0x405033){_0x32a2ac=_0x405033;logger[_0xc05d('0xc')]('The\x20Enduser\x20ID\x20is:',_0x32a2ac['id']);return getTicket(_0x573b2c,_0x51ece8,_0x32a2ac,_0x585fc8,_0x3580e9);})['then'](function(_0x5df18e){if(_0x5df18e){logger[_0xc05d('0xc')](_0xc05d('0x54'),_0x5df18e['id']);switch(_0x573b2c[_0xc05d('0x3b')]){case'integrationTab':logger[_0xc05d('0xc')](_0xc05d('0x61'),_0xc05d('0x55'));return request({'uri':util[_0xc05d('0x1b')](_0xc05d('0x56'),_0x573b2c[_0xc05d('0xe')],_0x51ece8['id'],_0x5df18e['id']),'method':_0xc05d('0x2b')});case _0xc05d('0x57'):logger[_0xc05d('0xc')](_0xc05d('0x61'),_0xc05d('0x58'));emit(util[_0xc05d('0x1b')](_0xc05d('0x59'),_0x598c62[_0xc05d('0x11')]),_0xc05d('0x5a'),{'uri':util[_0xc05d('0x1b')](_0xc05d('0x5b'),_0x573b2c[_0xc05d('0xe')],_0x5df18e['id'])});break;default:logger[_0xc05d('0x5c')](_0xc05d('0x61'),_0xc05d('0x65'));}}})['catch'](function(_0x5b0003){logger[_0xc05d('0x5c')](_0xc05d('0x66'),util[_0xc05d('0x67')](_0x5b0003,{'showHidden':!![],'depth':null}));});};exports[_0xc05d('0x68')]=function(_0x2106a1,_0x2e3bb4,_0x2b62ba,_0x5cbc23,_0x394df3,_0x5dcd09){var _0x40d71c,_0x1a9cf2;_0x5dcd09[_0xc05d('0xe')]=intUtil[_0xc05d('0x48')](_0x5dcd09[_0xc05d('0xe')]);_0x5dcd09['serverUrl']=intUtil['stripTrailingSlash'](_0x5dcd09[_0xc05d('0x49')]);if(_0x394df3&&_0x394df3['monitor_format']){logger[_0xc05d('0xc')]('[ABANDONED]',_0xc05d('0x4c'));_0x2e3bb4[_0xc05d('0x62')]=util[_0xc05d('0x1b')](_0xc05d('0x4d'),_0x5dcd09[_0xc05d('0x49')],_0x2e3bb4[_0xc05d('0x4e')],md5(_0x2e3bb4[_0xc05d('0x4e')]));}else{_0x2e3bb4[_0xc05d('0x62')]='';}headers[_0xc05d('0x4f')]=getAuth(_0x5dcd09);return getUser(_0x5dcd09)[_0xc05d('0x16')](function(_0x2d89c0){_0x40d71c=_0x2d89c0;logger[_0xc05d('0xc')]('The\x20User\x20ID\x20is:',_0x40d71c['id']);return getEndUser(_0x5dcd09,_0x2e3bb4[_0xc05d('0x69')],_0x2e3bb4['calleridnum']);})[_0xc05d('0x16')](function(_0x52dd24){_0x1a9cf2=_0x52dd24;logger['info'](_0xc05d('0x53'),_0x1a9cf2['id']);return getTicket(_0x5dcd09,_0x40d71c,_0x1a9cf2,_0x2b62ba,_0x2e3bb4);})[_0xc05d('0x16')](function(_0x767f10){if(_0x767f10){logger[_0xc05d('0xc')]('The\x20Ticket\x20ID\x20is:',_0x767f10['id']);}})['catch'](function(_0x207784){logger['error'](_0xc05d('0x6a'),util[_0xc05d('0x67')](_0x207784,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6aa7=['Basic\x20%s','base64','[HTTP]','stringify','defaults','GET','forEach','type','string','customField','nameField','toLowerCase','content','toString','custom_fields','push','idField','variable','variableName','name','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridnum','integrationTab','abandoned','[ABANDONED]','catch','lodash','md5','util','ioredis','./util','../../../../config/logger','zendesk','redis','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','getString','Subjects','Descriptions','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','%s:%s','username','password','%s/token:%s','token'];(function(_0x1ba733,_0x1f709d){var _0x542b07=function(_0x1870a8){while(--_0x1870a8){_0x1ba733['push'](_0x1ba733['shift']());}};_0x542b07(++_0x1f709d);}(_0x6aa7,0x178));var _0x76aa=function(_0x3f3432,_0x48f6a6){_0x3f3432=_0x3f3432-0x0;var _0x59abbf=_0x6aa7[_0x3f3432];return _0x59abbf;};'use strict';var _=require(_0x76aa('0x0'));var rp=require('request-promise');var md5=require(_0x76aa('0x1'));var util=require(_0x76aa('0x2'));var Redis=require(_0x76aa('0x3'));var intUtil=require(_0x76aa('0x4'));var config=require('../../../../config/environment');var logger=require(_0x76aa('0x5'))(_0x76aa('0x6'));config[_0x76aa('0x7')]=_['defaults'](config['redis'],{'host':_0x76aa('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x76aa('0x7')]));function emit(_0x36d12b,_0xa9b695,_0x56d6bc){io['to'](_0x36d12b)[_0x76aa('0x9')](_0xa9b695,_0x56d6bc);}var headers={'Content-Type':_0x76aa('0xa'),'Accept':_0x76aa('0xa')};function getTicket(_0x557d69,_0xcd99aa,_0x25856d,_0x41643a,_0x16cb50){logger[_0x76aa('0xb')](_0x76aa('0xc'));return request({'uri':util[_0x76aa('0xd')](_0x76aa('0xe'),_0x557d69[_0x76aa('0xf')]),'method':_0x76aa('0x10'),'body':{'ticket':_['merge']({'requester_id':_0x25856d['id'],'submitter_id':_0xcd99aa?_0xcd99aa['id']:undefined,'assignee_id':_0xcd99aa?_0xcd99aa['id']:undefined,'tags':getTags(_0x41643a[_0x76aa('0x11')],'name'),'subject':intUtil[_0x76aa('0x12')](_0x41643a[_0x76aa('0x13')],_0x16cb50,'\x20'),'description':intUtil[_0x76aa('0x12')](_0x41643a[_0x76aa('0x14')],_0x16cb50,'\x0a'),'comment':{'public':![],'body':intUtil[_0x76aa('0x12')](_0x41643a['Descriptions'],_0x16cb50,'\x0a')}},getCustomFields(_0x41643a['Fields'],_0x16cb50))}})[_0x76aa('0x15')](function(_0x4cfc34){logger[_0x76aa('0xb')](_0x76aa('0x16'));return _0x4cfc34['ticket'];});}function getUser(_0x2111c7,_0x550d9a){if(intUtil[_0x76aa('0x17')](_0x550d9a)){logger['info'](_0x76aa('0x18'),_0x550d9a);return request({'uri':util[_0x76aa('0xd')](_0x76aa('0x19'),_0x2111c7[_0x76aa('0xf')]),'qs':{'query':util[_0x76aa('0xd')](_0x76aa('0x1a'),_0x550d9a)}})['then'](function(_0x5d6202){if(_0x5d6202[_0x76aa('0x1b')]){logger[_0x76aa('0xb')](_0x76aa('0x1c'));return _[_0x76aa('0x1d')](_0x5d6202[_0x76aa('0x1e')],{'email':_0x550d9a,'role':_0x76aa('0x1f')});}else{logger[_0x76aa('0xb')](_0x76aa('0x20'));return request({'uri':util[_0x76aa('0xd')]('%s/users/me.json',_0x2111c7[_0x76aa('0xf')])})[_0x76aa('0x15')](function(_0x338a6b){logger['info'](_0x76aa('0x21'));return _0x338a6b[_0x76aa('0x22')];});}});}else{logger[_0x76aa('0xb')](_0x76aa('0x20'));return request({'uri':util[_0x76aa('0xd')](_0x76aa('0x23'),_0x2111c7[_0x76aa('0xf')])})[_0x76aa('0x15')](function(_0x32bf9f){logger[_0x76aa('0xb')](_0x76aa('0x21'));return _0x32bf9f[_0x76aa('0x22')];});}}function getEndUser(_0x3599a9,_0x4ef9b0,_0xb5e8a9){logger[_0x76aa('0xb')](_0x76aa('0x24'),_0xb5e8a9);return request({'uri':util[_0x76aa('0xd')](_0x76aa('0x19'),_0x3599a9[_0x76aa('0xf')]),'qs':{'query':util[_0x76aa('0xd')](_0x76aa('0x25'),_0xb5e8a9)}})[_0x76aa('0x15')](function(_0x1bdc3d){var _0x545b06;if(_0x1bdc3d[_0x76aa('0x1e')]['length']){_0x1bdc3d[_0x76aa('0x1e')]=_[_0x76aa('0x26')](_0x1bdc3d[_0x76aa('0x1e')],{'suspended':![],'role':_0x76aa('0x27')});if(_0x1bdc3d[_0x76aa('0x1e')][_0x76aa('0x28')]){_0x545b06=_[_0x76aa('0x29')](_0x1bdc3d[_0x76aa('0x1e')]);}}if(_0x545b06){logger[_0x76aa('0xb')](_0x76aa('0x2a'));return _0x545b06;}else{logger['info'](_0x76aa('0x2b'));return request({'uri':util[_0x76aa('0xd')](_0x76aa('0x2c'),_0x3599a9[_0x76aa('0xf')]),'method':_0x76aa('0x10'),'body':{'user':{'role':_0x76aa('0x27'),'name':util[_0x76aa('0xd')]('Caller\x20-\x20%s',_0x4ef9b0||_0xb5e8a9),'phone':_0xb5e8a9}}})[_0x76aa('0x15')](function(_0x25a11f){logger['info'](_0x76aa('0x2d'));return _0x25a11f['user'];});}});}function getAuth(_0x2e2ba3){var _0x4c90b6;if(_0x2e2ba3[_0x76aa('0x2e')]==='password'){_0x4c90b6=util['format'](_0x76aa('0x2f'),_0x2e2ba3[_0x76aa('0x30')],_0x2e2ba3[_0x76aa('0x31')]);}else if(_0x2e2ba3[_0x76aa('0x2e')]==='token'){_0x4c90b6=util['format'](_0x76aa('0x32'),_0x2e2ba3[_0x76aa('0x30')],_0x2e2ba3[_0x76aa('0x33')]);}return util[_0x76aa('0xd')](_0x76aa('0x34'),new Buffer(_0x4c90b6)['toString'](_0x76aa('0x35')));}function request(_0x5c77f1){logger['debug'](_0x76aa('0x36'),JSON[_0x76aa('0x37')](_0x5c77f1));return rp(_[_0x76aa('0x38')](_0x5c77f1,{'method':_0x76aa('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x48cf51,_0x401c07){var _0x1c22f7=[];if(_0x48cf51&&_0x48cf51[_0x76aa('0x28')]>0x0){_0x1c22f7=_['map'](_0x48cf51,_0x401c07);}return _0x1c22f7;}function getCustomFields(_0x113770,_0x1638db){var _0x2f7726=[];var _0x147c03={'custom_fields':[]};if(_0x113770[_0x76aa('0x28')]>0x0){_[_0x76aa('0x3a')](_0x113770,function(_0x878903){if(_0x878903[_0x76aa('0x3b')]===_0x76aa('0x3c')&&_0x878903['nameField']&&!_0x878903[_0x76aa('0x3d')]){_0x147c03[_0x878903[_0x76aa('0x3e')][_0x76aa('0x3f')]()]=_0x878903[_0x76aa('0x40')][_0x76aa('0x41')]();}else if(_0x878903[_0x76aa('0x3b')]==='string'&&_0x878903['idField']&&_0x878903[_0x76aa('0x3d')]){_0x147c03[_0x76aa('0x42')][_0x76aa('0x43')]({'id':_0x878903[_0x76aa('0x44')],'value':_0x878903['content'][_0x76aa('0x41')]()});}else if(_0x878903[_0x76aa('0x3b')]===_0x76aa('0x45')&&_0x878903[_0x76aa('0x46')]&&_0x878903[_0x76aa('0x44')]&&_0x878903['customField']){_0x1638db[_0x878903[_0x76aa('0x46')]]&&_0x147c03['custom_fields'][_0x76aa('0x43')]({'id':_0x878903['idField'],'value':_0x1638db[_0x878903['variableName']]['toString']()});}else if(_0x878903[_0x76aa('0x3b')]==='customVariable'&&_0x878903['Variable']&&_0x878903['Variable'][_0x76aa('0x47')]&&_0x878903[_0x76aa('0x44')]&&_0x878903[_0x76aa('0x3d')]){_0x1638db[_0x878903[_0x76aa('0x48')][_0x76aa('0x47')]['toLowerCase']()]&&_0x147c03[_0x76aa('0x42')][_0x76aa('0x43')]({'id':_0x878903[_0x76aa('0x44')],'value':_0x1638db[_0x878903[_0x76aa('0x48')][_0x76aa('0x47')]['toLowerCase']()][_0x76aa('0x41')]()});}});}return _0x147c03;}exports[_0x76aa('0x49')]=function(_0x5dc67e,_0x2d3441,_0x5a984e,_0x3aa858,_0x24ea05,_0x31930b){var _0x18fd3e,_0x2d0bc4;_0x31930b[_0x76aa('0xf')]=intUtil[_0x76aa('0x4a')](_0x31930b[_0x76aa('0xf')]);_0x31930b[_0x76aa('0x4b')]=intUtil[_0x76aa('0x4a')](_0x31930b['serverUrl']);if(_0x24ea05&&_0x24ea05[_0x76aa('0x4c')]){logger['info'](_0x76aa('0x4d'),_0x76aa('0x4e'));_0x2d3441[_0x76aa('0x4f')]=util[_0x76aa('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x31930b['serverUrl'],_0x2d3441[_0x76aa('0x50')],md5(_0x2d3441['uniqueid']));}else{_0x2d3441[_0x76aa('0x4f')]='';}headers[_0x76aa('0x51')]=getAuth(_0x31930b);return getUser(_0x31930b,_0x3aa858[_0x76aa('0x52')])[_0x76aa('0x15')](function(_0x30c577){_0x18fd3e=_0x30c577;logger[_0x76aa('0xb')]('The\x20User\x20ID\x20is:',_0x18fd3e['id']);return getEndUser(_0x31930b,_0x2d3441['calleridname'],_0x2d3441[_0x76aa('0x53')]);})[_0x76aa('0x15')](function(_0x1708d4){_0x2d0bc4=_0x1708d4;logger[_0x76aa('0xb')](_0x76aa('0x54'),_0x2d0bc4['id']);return getTicket(_0x31930b,_0x18fd3e,_0x2d0bc4,_0x5a984e,_0x2d3441);})[_0x76aa('0x15')](function(_0x4c52d5){if(_0x4c52d5){logger[_0x76aa('0xb')](_0x76aa('0x55'),_0x4c52d5['id']);switch(_0x31930b[_0x76aa('0x3b')]){case'integrationTab':logger[_0x76aa('0xb')]('[QUEUE]',_0x76aa('0x56'));return request({'uri':util['format'](_0x76aa('0x57'),_0x31930b[_0x76aa('0xf')],_0x18fd3e['id'],_0x4c52d5['id']),'method':_0x76aa('0x10')});case _0x76aa('0x58'):logger[_0x76aa('0xb')](_0x76aa('0x4d'),_0x76aa('0x59'));emit(util['format'](_0x76aa('0x5a'),_0x3aa858['name']),_0x76aa('0x5b'),{'uri':util[_0x76aa('0xd')](_0x76aa('0x5c'),_0x31930b[_0x76aa('0xf')],_0x4c52d5['id'])});break;default:logger[_0x76aa('0x5d')](_0x76aa('0x4d'),_0x76aa('0x5e'));}}})['catch'](function(_0x333a3a){logger[_0x76aa('0x5d')](_0x76aa('0x5f'),util[_0x76aa('0x60')](_0x333a3a,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0xb9401b,_0x163440,_0x8dc601,_0x410933,_0x2027f8,_0xf7732,_0x4e6c09){var _0x295b2c,_0xbf78c7;_0xf7732[_0x76aa('0xf')]=intUtil[_0x76aa('0x4a')](_0xf7732[_0x76aa('0xf')]);_0xf7732[_0x76aa('0x4b')]=intUtil[_0x76aa('0x4a')](_0xf7732['serverUrl']);if(_0x4e6c09&&_0x4e6c09['recordingFormat']&&_0x4e6c09[_0x76aa('0x61')]!==_0x76aa('0x62')){logger['info'](_0x76aa('0x63'),_0x76aa('0x4e'));_0x163440['recordingURL']=util[_0x76aa('0xd')](_0x76aa('0x64'),_0xf7732[_0x76aa('0x4b')],_0x163440[_0x76aa('0x50')],md5(_0x163440[_0x76aa('0x50')]));}headers[_0x76aa('0x51')]=getAuth(_0xf7732);return getUser(_0xf7732,_0x410933[_0x76aa('0x52')])[_0x76aa('0x15')](function(_0x69b1af){_0x295b2c=_0x69b1af;logger['info'](_0x76aa('0x65'),_0x295b2c['id']);return getEndUser(_0xf7732,_0x163440['destcalleridname'],_0x163440[_0x76aa('0x66')]);})[_0x76aa('0x15')](function(_0x2fef92){_0xbf78c7=_0x2fef92;logger[_0x76aa('0xb')](_0x76aa('0x54'),_0xbf78c7['id']);return getTicket(_0xf7732,_0x295b2c,_0xbf78c7,_0x8dc601,_0x163440);})[_0x76aa('0x15')](function(_0x18c4b8){if(_0x18c4b8){logger[_0x76aa('0xb')](_0x76aa('0x55'),_0x18c4b8['id']);switch(_0xf7732['type']){case _0x76aa('0x67'):logger[_0x76aa('0xb')](_0x76aa('0x63'),_0x76aa('0x56'));return request({'uri':util[_0x76aa('0xd')](_0x76aa('0x57'),_0xf7732[_0x76aa('0xf')],_0x295b2c['id'],_0x18c4b8['id']),'method':_0x76aa('0x10')});case'newTab':logger[_0x76aa('0xb')]('[OUTBOUND]',_0x76aa('0x59'));emit(util[_0x76aa('0xd')](_0x76aa('0x5a'),_0x410933[_0x76aa('0x47')]),_0x76aa('0x5b'),{'uri':util[_0x76aa('0xd')](_0x76aa('0x5c'),_0xf7732['remoteUri'],_0x18c4b8['id'])});break;default:logger[_0x76aa('0x5d')](_0x76aa('0x63'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x40429c){logger[_0x76aa('0x5d')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x76aa('0x60')](_0x40429c,{'showHidden':!![],'depth':null}));});};exports[_0x76aa('0x68')]=function(_0x12aeee,_0x5b460e,_0x446073,_0x47f733,_0xf31e1f,_0x1178e5){var _0x2315cf,_0x169947;_0x1178e5['remoteUri']=intUtil['stripTrailingSlash'](_0x1178e5[_0x76aa('0xf')]);_0x1178e5['serverUrl']=intUtil[_0x76aa('0x4a')](_0x1178e5[_0x76aa('0x4b')]);if(_0xf31e1f&&_0xf31e1f[_0x76aa('0x4c')]){logger[_0x76aa('0xb')](_0x76aa('0x69'),_0x76aa('0x4e'));_0x5b460e[_0x76aa('0x4f')]=util[_0x76aa('0xd')](_0x76aa('0x64'),_0x1178e5['serverUrl'],_0x5b460e[_0x76aa('0x50')],md5(_0x5b460e[_0x76aa('0x50')]));}else{_0x5b460e[_0x76aa('0x4f')]='';}headers[_0x76aa('0x51')]=getAuth(_0x1178e5);return getUser(_0x1178e5)['then'](function(_0x4c0af4){_0x2315cf=_0x4c0af4;logger['info'](_0x76aa('0x65'),_0x2315cf['id']);return getEndUser(_0x1178e5,_0x5b460e['calleridname'],_0x5b460e[_0x76aa('0x53')]);})[_0x76aa('0x15')](function(_0x38faff){_0x169947=_0x38faff;logger[_0x76aa('0xb')]('The\x20Enduser\x20ID\x20is:',_0x169947['id']);return getTicket(_0x1178e5,_0x2315cf,_0x169947,_0x446073,_0x5b460e);})[_0x76aa('0x15')](function(_0x4e29b9){if(_0x4e29b9){logger[_0x76aa('0xb')](_0x76aa('0x55'),_0x4e29b9['id']);}})[_0x76aa('0x6a')](function(_0x11d602){logger[_0x76aa('0x5d')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util[_0x76aa('0x60')](_0x11d602,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zoho.js b/server/services/ami/trigger/integration/zoho.js index d20caed..e541e88 100644 --- a/server/services/ami/trigger/integration/zoho.js +++ b/server/services/ami/trigger/integration/zoho.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce62=['length','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','expires_in','catch','error','Failing\x20creating\x20the\x20access_token','format','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','GET','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','data','End\x20user\x20found\x20(Contact)','enduserType','Leads','End\x20user\x20found\x20(Lead)','/crm/v2/','first_name','last_name','code','SUCCESS','moduleCreate','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Owner','role','administrator','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','mm:ss','endtime','diff','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','outbound','starttime','YYYY-MM-DDTHH:mm:ss','agentcalledAt','Call_Type','Inbound','Fields','err','stack','log','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','host','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','recordingFormat','none','/api/voice/recordings/','/downloads?type=uniqueid&token=','zoho.eu','destcalleridname','[OUTBOUND]','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[ABANDONED]','Recording\x20is\x20enabled!','calleridname','lodash','request-promise','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]'];(function(_0x41b133,_0x114320){var _0x844201=function(_0x328f1a){while(--_0x328f1a){_0x41b133['push'](_0x41b133['shift']());}};_0x844201(++_0x114320);}(_0xce62,0x83));var _0x2ce6=function(_0x30f596,_0x49b503){_0x30f596=_0x30f596-0x0;var _0x224d82=_0xce62[_0x30f596];return _0x224d82;};'use strict';var _=require(_0x2ce6('0x0'));var rp=require(_0x2ce6('0x1'));var md5=require('md5');var util=require(_0x2ce6('0x2'));var intUtil=require(_0x2ce6('0x3'));var moment=require(_0x2ce6('0x4'));var Redis=require(_0x2ce6('0x5'));var config=require(_0x2ce6('0x6'));var logger=require(_0x2ce6('0x7'))('zoho');config[_0x2ce6('0x8')]=_[_0x2ce6('0x9')](config[_0x2ce6('0x8')],{'host':_0x2ce6('0xa'),'port':0x18eb});var io=require(_0x2ce6('0xb'))(new Redis(config[_0x2ce6('0x8')]));function emit(_0x5b7f02,_0x46ef52,_0x12f647){io['to'](_0x5b7f02)['emit'](_0x46ef52,_0x12f647);}function request(_0x4dc8d5){logger[_0x2ce6('0xc')](_0x2ce6('0xd'),JSON['stringify'](_0x4dc8d5));return rp(_0x4dc8d5);}function getCustomFields(_0x3f203a,_0x5693d4){var _0x526a35={};if(_0x3f203a[_0x2ce6('0xe')]>0x0){_['forEach'](_0x3f203a,function(_0x13f665){if(_0x13f665['type']===_0x2ce6('0xf')&&_0x13f665[_0x2ce6('0x10')]){_0x526a35[_0x13f665[_0x2ce6('0x10')]]=_0x13f665[_0x2ce6('0x11')][_0x2ce6('0x12')]();}else if(_0x13f665[_0x2ce6('0x13')]===_0x2ce6('0x14')&&_0x13f665[_0x2ce6('0x15')]&&_0x13f665['idField']&&_0x5693d4[_0x13f665[_0x2ce6('0x15')]]){_0x526a35[_0x13f665['idField']]=_0x5693d4[_0x13f665[_0x2ce6('0x15')]][_0x2ce6('0x12')]();}else if(_0x13f665[_0x2ce6('0x13')]==='customVariable'&&_0x13f665[_0x2ce6('0x16')]&&_0x13f665[_0x2ce6('0x16')][_0x2ce6('0x17')]&&_0x13f665[_0x2ce6('0x10')]&&_0x5693d4[_0x13f665[_0x2ce6('0x16')][_0x2ce6('0x17')][_0x2ce6('0x18')]()]){_0x526a35[_0x13f665[_0x2ce6('0x10')]]=_0x5693d4[_0x13f665[_0x2ce6('0x16')][_0x2ce6('0x17')]['toLowerCase']()][_0x2ce6('0x12')]();}});}return _0x526a35;}function getName(_0x126bc7){if(_0x126bc7[_0x2ce6('0x19')]('\x20')>0x0){var _0x54e172=_0x126bc7[_0x2ce6('0x1a')](/ (.+)/);if(_0x54e172[0x1]){return _0x54e172;}}return[_0x126bc7,_0x126bc7];}var accountsTokens={};function getAccessToken(_0x2b5bf0){return new Promise(function(_0xa551b9,_0x3d2ee8){if(!_[_0x2ce6('0x1b')](accountsTokens[_0x2b5bf0['id']])&&!_['isNil'](accountsTokens[_0x2b5bf0['id']][_0x2ce6('0x1c')])){if(moment()['isBefore'](accountsTokens[_0x2b5bf0['id']]['expires_in'])){_0xa551b9(accountsTokens[_0x2b5bf0['id']][_0x2ce6('0x1c')]);}}var _0x2b80bd;switch(_0x2b5bf0[_0x2ce6('0x1d')]){case'US':_0x2b80bd='https://accounts.zoho.com';break;case'AU':_0x2b80bd=_0x2ce6('0x1e');break;case'EU':_0x2b80bd=_0x2ce6('0x1f');break;case'IN':_0x2b80bd=_0x2ce6('0x20');break;case'CN':_0x2b80bd=_0x2ce6('0x21');break;default:_0x2b80bd='https://accounts.zoho.eu';break;}var _0x37536a={'method':_0x2ce6('0x22'),'uri':_0x2b80bd+_0x2ce6('0x23'),'qs':{'refresh_token':_0x2b5bf0[_0x2ce6('0x24')],'client_id':_0x2b5bf0[_0x2ce6('0x25')],'client_secret':_0x2b5bf0[_0x2ce6('0x26')],'grant_type':_0x2ce6('0x27')},'json':!![]};return rp(_0x37536a)['then'](function(_0x4ba3c4){accountsTokens[_0x2b5bf0['id']]={'access_token':_0x4ba3c4['access_token'],'expires_in':moment()[_0x2ce6('0x28')](_0x4ba3c4[_0x2ce6('0x29')],'seconds')};_0xa551b9(_0x4ba3c4['access_token']);})[_0x2ce6('0x2a')](function(_0x126e43){logger[_0x2ce6('0x2b')](_0x2ce6('0x2c'),_0x126e43['stack']);_0x3d2ee8(_0x126e43);});});}function getUser(_0x481cd2,_0x909ada,_0xa78201,_0x2fd596){logger['info']('Search\x20user');return request({'method':'GET','uri':util[_0x2ce6('0x2d')]('https://www.zohoapis.%s/crm/v2/users',_0x909ada),'qs':{'type':_0x2ce6('0x2e')},'headers':{'Authorization':_0x2ce6('0x2f')+_0x481cd2},'json':!![]})[_0x2ce6('0x30')](function(_0x396092){if(_0x396092[_0x2ce6('0x31')]){var _0x591aa7=-0x1;if(_[_0x2ce6('0x32')](_0x396092[_0x2ce6('0x31')])){if(!_[_0x2ce6('0x1b')](_0x2fd596)){_0x591aa7=_[_0x2ce6('0x33')](_0x396092['users'],function(_0x3dd7a8){return _0x3dd7a8[_0x2ce6('0x34')]===_0x2fd596;});}if(_0x591aa7>=0x0){logger[_0x2ce6('0x35')]('Agent\x20found!');}else{logger[_0x2ce6('0x35')](_0x2ce6('0x36'));_0x591aa7=_[_0x2ce6('0x33')](_0x396092[_0x2ce6('0x31')],function(_0x222387){return _0x222387[_0x2ce6('0x37')]['name']===_0x2ce6('0x38');});}return _0x396092['users'][_0x591aa7];}else{if(_0x396092['user']['profile'][_0x2ce6('0x17')]===_0x2ce6('0x38')){logger[_0x2ce6('0x35')](_0x2ce6('0x36'));user=_0x396092[_0x2ce6('0x39')];return user;}else{logger[_0x2ce6('0x2b')](_0x2ce6('0x3a'),JSON[_0x2ce6('0x3b')](_0x396092));throw new Error(_0x2ce6('0x3c')+JSON[_0x2ce6('0x3b')](_0x396092));}}}else{logger[_0x2ce6('0x2b')](_0x2ce6('0x3a'),JSON[_0x2ce6('0x3b')](_0x396092));throw new Error(_0x2ce6('0x3c')+JSON[_0x2ce6('0x3b')](_0x396092));}})[_0x2ce6('0x2a')](function(_0x50381e){console[_0x2ce6('0x2b')](_0x50381e);});}function getEndUser(_0x982f9f,_0x13346e,_0x18d733,_0x4b106b,_0x21e302,_0x5404c8,_0x33b02f){logger[_0x2ce6('0x35')](_0x2ce6('0x3d'));return request({'method':_0x2ce6('0x3e'),'uri':_0x2ce6('0x3f')+_0x13346e+_0x2ce6('0x40')+_0x21e302+'))','headers':{'Authorization':_0x2ce6('0x2f')+_0x982f9f},'json':!![]})['then'](function(_0x57e601){if(_0x57e601){var _0x1faae0=_0x57e601[_0x2ce6('0x41')][0x0];_0x1faae0['enduserType']='Contacts';logger[_0x2ce6('0x35')](_0x2ce6('0x42'));return _0x1faae0;}else{return request({'method':_0x2ce6('0x3e'),'uri':_0x2ce6('0x3f')+_0x13346e+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x21e302+'))','headers':{'Authorization':_0x2ce6('0x2f')+_0x982f9f},'json':!![]})[_0x2ce6('0x30')](function(_0x1653b6){if(_0x1653b6){var _0x42cc17=_0x1653b6[_0x2ce6('0x41')][0x0];_0x42cc17[_0x2ce6('0x43')]=_0x2ce6('0x44');logger[_0x2ce6('0x35')](_0x2ce6('0x45'));return _0x42cc17;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x4b106b=getName(_0x4b106b);return request({'method':_0x2ce6('0x22'),'uri':_0x2ce6('0x3f')+_0x13346e+_0x2ce6('0x46')+_0x33b02f['moduleCreate'],'body':{'data':[{'Last_Name':_0x4b106b[0x1],'First_Name':_0x4b106b[0x0],'Phone':_0x21e302,'Owner':{'name':!_[_0x2ce6('0x1b')](_0x5404c8['role'][_0x2ce6('0x17')])?_0x5404c8['role'][_0x2ce6('0x17')]:!_[_0x2ce6('0x1b')](_0x5404c8[_0x2ce6('0x47')])?_0x5404c8[_0x2ce6('0x47')]+'\x20'+_0x5404c8[_0x2ce6('0x48')]:_0x5404c8['last_name'],'id':_0x5404c8['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x982f9f},'json':!![]})[_0x2ce6('0x30')](function(_0x12b63c){if(_0x12b63c&&_0x12b63c[_0x2ce6('0x41')][0x0][_0x2ce6('0x49')]===_0x2ce6('0x4a')){var _0x2fcca0=_0x12b63c[_0x2ce6('0x41')][0x0]['details'];_0x2fcca0[_0x2ce6('0x43')]=_0x33b02f[_0x2ce6('0x4b')];return _0x2fcca0;}logger[_0x2ce6('0x2b')](_0x2ce6('0x3a'),JSON['stringify'](_0x12b63c));throw new Error(_0x2ce6('0x4c')+JSON[_0x2ce6('0x3b')](_0x12b63c));});}});}});}function getCall(_0x25cd57,_0xc4db8a,_0x39bcab,_0x14fda2,_0x47606d,_0x501df9,_0x3d5250,_0x26df8c){logger['info'](_0x2ce6('0x4d'));var _0x200345={};_0x200345[_0x2ce6('0x4e')]={'name':!_[_0x2ce6('0x1b')](_0x14fda2[_0x2ce6('0x4f')][_0x2ce6('0x17')])&&!_[_0x2ce6('0x1b')](_0x14fda2[_0x2ce6('0x37')]['name'])&&_0x14fda2[_0x2ce6('0x37')][_0x2ce6('0x17')]===_0x2ce6('0x50')?_0x14fda2['role'][_0x2ce6('0x17')]:!_[_0x2ce6('0x1b')](_0x14fda2[_0x2ce6('0x47')])?_0x14fda2[_0x2ce6('0x47')]+'\x20'+_0x14fda2[_0x2ce6('0x48')]:_0x14fda2['last_name'],'id':_0x14fda2['id']};_0x200345['Subject']=intUtil[_0x2ce6('0x51')](_0x501df9[_0x2ce6('0x52')],_0x3d5250,'\x20');_0x200345[_0x2ce6('0x53')]=intUtil[_0x2ce6('0x51')](_0x501df9[_0x2ce6('0x54')],_0x3d5250,'\x0a');if(_0x47606d[_0x2ce6('0x43')]==='Contacts'){_0x200345[_0x2ce6('0x55')]={'name':!_[_0x2ce6('0x1b')](_0x47606d['Full_Name'])?_0x47606d[_0x2ce6('0x56')]:!_[_0x2ce6('0x1b')](_0x47606d[_0x2ce6('0x57')])?_0x47606d[_0x2ce6('0x57')]+'\x20'+_0x47606d[_0x2ce6('0x58')]:_0x47606d['Last_Name'],'id':_0x47606d['id']};}if(_0x47606d[_0x2ce6('0x43')]===_0x2ce6('0x44')){_0x200345[_0x2ce6('0x59')]={'name':!_[_0x2ce6('0x1b')](_0x47606d[_0x2ce6('0x56')])?_0x47606d['Full_Name']:!_[_0x2ce6('0x1b')](_0x47606d[_0x2ce6('0x57')])?_0x47606d['First_Name']+'\x20'+_0x47606d[_0x2ce6('0x58')]:_0x47606d['Last_Name'],'id':_0x47606d['id']};_0x200345[_0x2ce6('0x5a')]=_0x47606d[_0x2ce6('0x43')];}if(_0x3d5250['talktime']){_0x200345[_0x2ce6('0x5b')]=moment[_0x2ce6('0x5c')](parseInt(_0x3d5250['talktime'])*0x3e8)[_0x2ce6('0x2d')](_0x2ce6('0x5d'));}else if(_0x3d5250['answertime']&&_0x3d5250[_0x2ce6('0x5e')]){_0x200345[_0x2ce6('0x5b')]=moment[_0x2ce6('0x5c')](moment(_0x3d5250['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x2ce6('0x5f')](moment(_0x3d5250['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0x2ce6('0x2d')]('mm:ss');}switch(_0x3d5250[_0x2ce6('0x60')]){case _0x2ce6('0x61'):_0x200345[_0x2ce6('0x62')]=_0x2ce6('0x63');break;case _0x2ce6('0x64'):case _0x2ce6('0x65'):_0x200345[_0x2ce6('0x62')]=_0x2ce6('0x66');break;case _0x2ce6('0x67'):_0x200345[_0x2ce6('0x62')]=_0x2ce6('0x68');break;case _0x2ce6('0x69'):_0x200345[_0x2ce6('0x62')]=_0x2ce6('0x6a');break;default:}_0x200345['Call_Start_Time']=(_0x26df8c===_0x2ce6('0x6b')?moment(_0x3d5250[_0x2ce6('0x6c')])[_0x2ce6('0x2d')](_0x2ce6('0x6d')):moment(_0x3d5250[_0x2ce6('0x6e')])['format'](_0x2ce6('0x6d')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x200345[_0x2ce6('0x6f')]=_0x26df8c||_0x2ce6('0x70');_0x200345=_['merge'](_0x200345,getCustomFields(_0x501df9[_0x2ce6('0x71')],_0x3d5250));return request({'method':_0x2ce6('0x22'),'uri':'https://www.zohoapis.'+_0xc4db8a+'/crm/v2/Calls','headers':{'Authorization':_0x2ce6('0x2f')+_0x25cd57},'body':{'data':[_0x200345]},'json':!![]})[_0x2ce6('0x30')](function(_0x3c65dc){if(_0x3c65dc&&_0x3c65dc[_0x2ce6('0x41')][0x0][_0x2ce6('0x49')]===_0x2ce6('0x4a')){logger[_0x2ce6('0x35')]('Call\x20created!');return{'id':_0x3c65dc[_0x2ce6('0x41')][0x0]['details']['id']};}})[_0x2ce6('0x2a')](function(_0x1e88ab){logger[_0x2ce6('0x35')](_0x2ce6('0x72'),_0x1e88ab[_0x2ce6('0x73')]);console[_0x2ce6('0x74')](_0x2ce6('0x72'),_0x1e88ab);});}exports[_0x2ce6('0x75')]=function(_0xeb1e5d,_0xfb5d5f,_0x2d1dfd,_0x345861,_0x2a4002,_0x35bff7){var _0xe7e436,_0x37e54b,_0x12b06a;_0x35bff7['host']=intUtil[_0x2ce6('0x76')](_0x35bff7['host']);_0x35bff7[_0x2ce6('0x77')]=intUtil[_0x2ce6('0x76')](_0x35bff7[_0x2ce6('0x77')]);if(_0x2a4002&&_0x2a4002[_0x2ce6('0x78')]){logger[_0x2ce6('0x35')](_0x2ce6('0x79'),'Recording\x20is\x20enabled!');_0xfb5d5f[_0x2ce6('0x7a')]=_0x35bff7[_0x2ce6('0x77')]+'/api/voice/recordings/'+_0xfb5d5f[_0x2ce6('0x7b')]+'/downloads?type=uniqueid&token='+md5(_0xfb5d5f[_0x2ce6('0x7b')]);}else{_0xfb5d5f[_0x2ce6('0x7a')]='';}var _0xe110d7=_0x35bff7[_0x2ce6('0x7c')]==='zoho.eu'?'eu':_0x2ce6('0x7d');return getAccessToken(_0x35bff7)['then'](function(_0x3a4e92){_0x12b06a=_0x3a4e92;return getUser(_0x12b06a,_0xe110d7,_0x35bff7,_0x345861[_0x2ce6('0x34')]);})[_0x2ce6('0x30')](function(_0x5d73af){_0xe7e436=_0x5d73af;logger[_0x2ce6('0x35')](_0x2ce6('0x7e'),_0xe7e436['id']);return getEndUser(_0x12b06a,_0xe110d7,_0x35bff7,_0xfb5d5f['calleridname'],_0xfb5d5f[_0x2ce6('0x7f')],_0xe7e436,_0x2d1dfd);})['then'](function(_0x282fe5){_0x37e54b=_0x282fe5;logger[_0x2ce6('0x35')](_0x2ce6('0x80'),_0x37e54b['id']);return getCall(_0x12b06a,_0xe110d7,_0x35bff7,_0xe7e436,_0x37e54b,_0x2d1dfd,_0xfb5d5f,_0x2ce6('0x70'));})[_0x2ce6('0x30')](function(_0x5183fc){if(_0x5183fc){logger[_0x2ce6('0x35')](_0x2ce6('0x81'),_0x5183fc['id']);logger[_0x2ce6('0x35')](_0x2ce6('0x79'),_0x2ce6('0x82'));emit(util[_0x2ce6('0x2d')](_0x2ce6('0x83'),_0x345861[_0x2ce6('0x17')]),_0x2ce6('0x84'),{'uri':'https://crm.'+_0x35bff7[_0x2ce6('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5183fc['id']});}})[_0x2ce6('0x2a')](function(_0x987ecf){logger['error'](_0x2ce6('0x79'),JSON[_0x2ce6('0x3b')](_0x987ecf));});};exports[_0x2ce6('0x6b')]=function(_0x38fade,_0x5b2ef8,_0x110729,_0x4cdad7,_0x4da004,_0xa11c9a,_0x668f2a){var _0x51ddf8,_0x42aa67,_0x401ea8;_0xa11c9a['host']=intUtil[_0x2ce6('0x76')](_0xa11c9a[_0x2ce6('0x7c')]);_0xa11c9a[_0x2ce6('0x77')]=intUtil['stripTrailingSlash'](_0xa11c9a['serverUrl']);if(_0x668f2a&&_0x668f2a[_0x2ce6('0x85')]&&_0x668f2a[_0x2ce6('0x85')]!==_0x2ce6('0x86')){logger[_0x2ce6('0x35')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5b2ef8['recordingURL']=_0xa11c9a[_0x2ce6('0x77')]+_0x2ce6('0x87')+_0x5b2ef8[_0x2ce6('0x7b')]+_0x2ce6('0x88')+md5(_0x5b2ef8[_0x2ce6('0x7b')]);}var _0x3c4a20=_0xa11c9a[_0x2ce6('0x7c')]===_0x2ce6('0x89')?'eu':_0x2ce6('0x7d');return getAccessToken(_0xa11c9a)[_0x2ce6('0x30')](function(_0x2aaaca){_0x401ea8=_0x2aaaca;return getUser(_0x401ea8,_0x3c4a20,_0xa11c9a,_0x4cdad7['email']);})['then'](function(_0x1b54fe){_0x51ddf8=_0x1b54fe;logger[_0x2ce6('0x35')]('The\x20User\x20ID\x20is:',_0x51ddf8['id']);return getEndUser(_0x401ea8,_0x3c4a20,_0xa11c9a,_0x5b2ef8[_0x2ce6('0x8a')],_0x5b2ef8['destcalleridnum'],_0x51ddf8,_0x110729);})['then'](function(_0x4f8780){_0x42aa67=_0x4f8780;logger[_0x2ce6('0x35')](_0x2ce6('0x80'),_0x42aa67['id']);return getCall(_0x401ea8,_0x3c4a20,_0xa11c9a,_0x51ddf8,_0x42aa67,_0x110729,_0x5b2ef8,'Outbound');})['then'](function(_0x30755d){if(_0x30755d){logger[_0x2ce6('0x35')](_0x2ce6('0x81'),_0x30755d['id']);logger[_0x2ce6('0x35')](_0x2ce6('0x8b'),_0x2ce6('0x82'));emit(util[_0x2ce6('0x2d')](_0x2ce6('0x83'),_0x4cdad7['name']),'trigger:browser:url',{'uri':_0x2ce6('0x8c')+_0xa11c9a[_0x2ce6('0x7c')]+_0x2ce6('0x8d')+_0x30755d['id']});}})[_0x2ce6('0x2a')](function(_0x4d3c78){logger[_0x2ce6('0x2b')](_0x2ce6('0x8b'),JSON['stringify'](_0x4d3c78));});};exports[_0x2ce6('0x69')]=function(_0x311587,_0x125744,_0x5c6063,_0x2f175f,_0x11a400,_0x8a3086){var _0x20551a,_0x2a9130,_0xc2faef;_0x8a3086[_0x2ce6('0x7c')]=intUtil[_0x2ce6('0x76')](_0x8a3086[_0x2ce6('0x7c')]);_0x8a3086[_0x2ce6('0x77')]=intUtil[_0x2ce6('0x76')](_0x8a3086[_0x2ce6('0x77')]);if(_0x11a400&&_0x11a400[_0x2ce6('0x78')]){logger[_0x2ce6('0x35')](_0x2ce6('0x8e'),_0x2ce6('0x8f'));_0x125744[_0x2ce6('0x7a')]=_0x8a3086[_0x2ce6('0x77')]+_0x2ce6('0x87')+_0x125744[_0x2ce6('0x7b')]+_0x2ce6('0x88')+md5(_0x125744[_0x2ce6('0x7b')]);}else{_0x125744[_0x2ce6('0x7a')]='';}var _0x202038=_0x8a3086[_0x2ce6('0x7c')]==='zoho.eu'?'eu':_0x2ce6('0x7d');return getAccessToken(_0x8a3086)[_0x2ce6('0x30')](function(_0x3f58da){_0xc2faef=_0x3f58da;return getUser(_0xc2faef,_0x202038,_0x8a3086);})[_0x2ce6('0x30')](function(_0x5eb5f3){_0x20551a=_0x5eb5f3;logger[_0x2ce6('0x35')](_0x2ce6('0x7e'),_0x20551a['id']);return getEndUser(_0xc2faef,_0x202038,_0x8a3086,_0x125744[_0x2ce6('0x90')],_0x125744[_0x2ce6('0x7f')],_0x20551a,_0x5c6063);})[_0x2ce6('0x30')](function(_0x2ac992){_0x2a9130=_0x2ac992;logger['info'](_0x2ce6('0x80'),_0x2a9130['id']);return getCall(_0xc2faef,_0x202038,_0x8a3086,_0x20551a,_0x2a9130,_0x5c6063,_0x125744,_0x2ce6('0x70'));})[_0x2ce6('0x30')](function(_0x11e244){if(_0x11e244){logger[_0x2ce6('0x35')](_0x2ce6('0x81'),_0x11e244['id']);}})[_0x2ce6('0x2a')](function(_0x1f950f){logger[_0x2ce6('0x2b')](_0x2ce6('0x8e'),JSON[_0x2ce6('0x3b')](_0x1f950f));});}; \ No newline at end of file +var _0xde1a=['clientSecret','refresh_token','then','seconds','error','info','Search\x20user','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','https://www.zohoapis.','Contacts','End\x20user\x20found\x20(Contact)','GET','/crm/v2/Leads/search?criteria=((Phone:equals:','data','enduserType','Leads','End\x20user\x20found\x20(Lead)','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Descriptions','First_Name','Last_Name','Full_Name','$se_module','talktime','Call_Duration','utc','format','mm:ss','answertime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','connect','rejected','Rejected','abandoned','outbound','agentcalledAt','Call_Type','Inbound','/crm/v2/Calls','Call\x20created!','catch','stack','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','zoho.eu','com','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','uniqueid','/downloads?type=uniqueid&token=','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]','[ABANDONED]','calleridnum','request-promise','md5','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','type','string','idField','content','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId'];(function(_0x1f0258,_0x4d0b8b){var _0x934856=function(_0x4adfe4){while(--_0x4adfe4){_0x1f0258['push'](_0x1f0258['shift']());}};_0x934856(++_0x4d0b8b);}(_0xde1a,0xfd));var _0xade1=function(_0x5aba08,_0x8b8255){_0x5aba08=_0x5aba08-0x0;var _0x3cc611=_0xde1a[_0x5aba08];return _0x3cc611;};'use strict';var _=require('lodash');var rp=require(_0xade1('0x0'));var md5=require(_0xade1('0x1'));var util=require(_0xade1('0x2'));var intUtil=require(_0xade1('0x3'));var moment=require(_0xade1('0x4'));var Redis=require(_0xade1('0x5'));var config=require(_0xade1('0x6'));var logger=require(_0xade1('0x7'))('zoho');config[_0xade1('0x8')]=_[_0xade1('0x9')](config[_0xade1('0x8')],{'host':_0xade1('0xa'),'port':0x18eb});var io=require(_0xade1('0xb'))(new Redis(config[_0xade1('0x8')]));function emit(_0x5eb992,_0x3a24e7,_0x41d069){io['to'](_0x5eb992)[_0xade1('0xc')](_0x3a24e7,_0x41d069);}function request(_0x364a46){logger[_0xade1('0xd')](_0xade1('0xe'),JSON[_0xade1('0xf')](_0x364a46));return rp(_0x364a46);}function getCustomFields(_0x12eb7f,_0x5add3c){var _0x5c44fa={};if(_0x12eb7f[_0xade1('0x10')]>0x0){_['forEach'](_0x12eb7f,function(_0x1d71a8){if(_0x1d71a8[_0xade1('0x11')]===_0xade1('0x12')&&_0x1d71a8['idField']){_0x5c44fa[_0x1d71a8[_0xade1('0x13')]]=_0x1d71a8[_0xade1('0x14')][_0xade1('0x15')]();}else if(_0x1d71a8[_0xade1('0x11')]===_0xade1('0x16')&&_0x1d71a8[_0xade1('0x17')]&&_0x1d71a8['idField']&&_0x5add3c[_0x1d71a8[_0xade1('0x17')]]){_0x5c44fa[_0x1d71a8[_0xade1('0x13')]]=_0x5add3c[_0x1d71a8[_0xade1('0x17')]][_0xade1('0x15')]();}else if(_0x1d71a8[_0xade1('0x11')]==='customVariable'&&_0x1d71a8[_0xade1('0x18')]&&_0x1d71a8[_0xade1('0x18')][_0xade1('0x19')]&&_0x1d71a8[_0xade1('0x13')]&&_0x5add3c[_0x1d71a8[_0xade1('0x18')]['name'][_0xade1('0x1a')]()]){_0x5c44fa[_0x1d71a8[_0xade1('0x13')]]=_0x5add3c[_0x1d71a8[_0xade1('0x18')][_0xade1('0x19')][_0xade1('0x1a')]()][_0xade1('0x15')]();}});}return _0x5c44fa;}function getName(_0x39a360){if(_0x39a360[_0xade1('0x1b')]('\x20')>0x0){var _0x16f23a=_0x39a360[_0xade1('0x1c')](/ (.+)/);if(_0x16f23a[0x1]){return _0x16f23a;}}return[_0x39a360,_0x39a360];}var accountsTokens={};function getAccessToken(_0x1d7c21){return new Promise(function(_0x12ea91,_0x55ddd3){if(!_['isNil'](accountsTokens[_0x1d7c21['id']])&&!_[_0xade1('0x1d')](accountsTokens[_0x1d7c21['id']][_0xade1('0x1e')])){if(moment()[_0xade1('0x1f')](accountsTokens[_0x1d7c21['id']][_0xade1('0x20')])){_0x12ea91(accountsTokens[_0x1d7c21['id']][_0xade1('0x1e')]);}}var _0x1efe83;switch(_0x1d7c21[_0xade1('0x21')]){case'US':_0x1efe83=_0xade1('0x22');break;case'AU':_0x1efe83=_0xade1('0x23');break;case'EU':_0x1efe83=_0xade1('0x24');break;case'IN':_0x1efe83=_0xade1('0x25');break;case'CN':_0x1efe83='https://accounts.zoho.com.cn';break;default:_0x1efe83=_0xade1('0x24');break;}var _0x5c2837={'method':_0xade1('0x26'),'uri':_0x1efe83+'/oauth/v2/token','qs':{'refresh_token':_0x1d7c21[_0xade1('0x27')],'client_id':_0x1d7c21[_0xade1('0x28')],'client_secret':_0x1d7c21[_0xade1('0x29')],'grant_type':_0xade1('0x2a')},'json':!![]};return rp(_0x5c2837)[_0xade1('0x2b')](function(_0x293bb0){accountsTokens[_0x1d7c21['id']]={'access_token':_0x293bb0[_0xade1('0x1e')],'expires_in':moment()['add'](_0x293bb0[_0xade1('0x20')],_0xade1('0x2c'))};_0x12ea91(_0x293bb0['access_token']);})['catch'](function(_0x38dd9f){logger[_0xade1('0x2d')]('Failing\x20creating\x20the\x20access_token',_0x38dd9f['stack']);_0x55ddd3(_0x38dd9f);});});}function getUser(_0x17c007,_0x3d2555,_0x88c182,_0x51d9e7){logger[_0xade1('0x2e')](_0xade1('0x2f'));return request({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x3d2555),'qs':{'type':_0xade1('0x30')},'headers':{'Authorization':_0xade1('0x31')+_0x17c007},'json':!![]})[_0xade1('0x2b')](function(_0x417cdf){if(_0x417cdf[_0xade1('0x32')]){var _0x1606e6=-0x1;if(_[_0xade1('0x33')](_0x417cdf[_0xade1('0x32')])){if(!_[_0xade1('0x1d')](_0x51d9e7)){_0x1606e6=_['findIndex'](_0x417cdf[_0xade1('0x32')],function(_0xfaf8b6){return _0xfaf8b6[_0xade1('0x34')]===_0x51d9e7;});}if(_0x1606e6>=0x0){logger['info'](_0xade1('0x35'));}else{logger[_0xade1('0x2e')](_0xade1('0x36'));_0x1606e6=_['findIndex'](_0x417cdf[_0xade1('0x32')],function(_0x40b4b2){return _0x40b4b2[_0xade1('0x37')][_0xade1('0x19')]===_0xade1('0x38');});}return _0x417cdf['users'][_0x1606e6];}else{if(_0x417cdf[_0xade1('0x39')][_0xade1('0x37')][_0xade1('0x19')]==='Administrator'){logger[_0xade1('0x2e')](_0xade1('0x36'));user=_0x417cdf[_0xade1('0x39')];return user;}else{logger[_0xade1('0x2d')](_0xade1('0x3a'),JSON[_0xade1('0xf')](_0x417cdf));throw new Error(_0xade1('0x3b')+JSON[_0xade1('0xf')](_0x417cdf));}}}else{logger[_0xade1('0x2d')](_0xade1('0x3a'),JSON[_0xade1('0xf')](_0x417cdf));throw new Error(_0xade1('0x3b')+JSON['stringify'](_0x417cdf));}})['catch'](function(_0x2e4bfb){console[_0xade1('0x2d')](_0x2e4bfb);});}function getEndUser(_0x2ba6b1,_0x23f9f8,_0x5b26f5,_0x243ed5,_0x551e4f,_0x54fa2f,_0x1e5518){logger[_0xade1('0x2e')](_0xade1('0x3c'));return request({'method':'GET','uri':_0xade1('0x3d')+_0x23f9f8+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x551e4f+'))','headers':{'Authorization':_0xade1('0x31')+_0x2ba6b1},'json':!![]})[_0xade1('0x2b')](function(_0x3167f1){if(_0x3167f1){var _0x3cdffd=_0x3167f1['data'][0x0];_0x3cdffd['enduserType']=_0xade1('0x3e');logger[_0xade1('0x2e')](_0xade1('0x3f'));return _0x3cdffd;}else{return request({'method':_0xade1('0x40'),'uri':_0xade1('0x3d')+_0x23f9f8+_0xade1('0x41')+_0x551e4f+'))','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2ba6b1},'json':!![]})['then'](function(_0x132739){if(_0x132739){var _0x1ad8c5=_0x132739[_0xade1('0x42')][0x0];_0x1ad8c5[_0xade1('0x43')]=_0xade1('0x44');logger[_0xade1('0x2e')](_0xade1('0x45'));return _0x1ad8c5;}else{logger[_0xade1('0x2e')](_0xade1('0x46'));_0x243ed5=getName(_0x243ed5);return request({'method':_0xade1('0x26'),'uri':_0xade1('0x3d')+_0x23f9f8+_0xade1('0x47')+_0x1e5518[_0xade1('0x48')],'body':{'data':[{'Last_Name':_0x243ed5[0x1],'First_Name':_0x243ed5[0x0],'Phone':_0x551e4f,'Owner':{'name':!_[_0xade1('0x1d')](_0x54fa2f[_0xade1('0x49')][_0xade1('0x19')])?_0x54fa2f['role'][_0xade1('0x19')]:!_['isNil'](_0x54fa2f[_0xade1('0x4a')])?_0x54fa2f[_0xade1('0x4a')]+'\x20'+_0x54fa2f[_0xade1('0x4b')]:_0x54fa2f['last_name'],'id':_0x54fa2f['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2ba6b1},'json':!![]})[_0xade1('0x2b')](function(_0x1c1dfe){if(_0x1c1dfe&&_0x1c1dfe['data'][0x0][_0xade1('0x4c')]===_0xade1('0x4d')){var _0x542fe6=_0x1c1dfe[_0xade1('0x42')][0x0][_0xade1('0x4e')];_0x542fe6[_0xade1('0x43')]=_0x1e5518['moduleCreate'];return _0x542fe6;}logger[_0xade1('0x2d')]('The\x20failing\x20result\x20is',JSON[_0xade1('0xf')](_0x1c1dfe));throw new Error(_0xade1('0x4f')+JSON[_0xade1('0xf')](_0x1c1dfe));});}});}});}function getCall(_0x3b09bc,_0x1f9f26,_0x38198b,_0x8505d4,_0x59b090,_0x16d6bd,_0x255fca,_0x51127f){logger['info'](_0xade1('0x50'));var _0x391e9e={};_0x391e9e[_0xade1('0x51')]={'name':!_[_0xade1('0x1d')](_0x8505d4[_0xade1('0x49')][_0xade1('0x19')])&&!_[_0xade1('0x1d')](_0x8505d4[_0xade1('0x37')][_0xade1('0x19')])&&_0x8505d4['profile']['name']===_0xade1('0x52')?_0x8505d4[_0xade1('0x49')][_0xade1('0x19')]:!_[_0xade1('0x1d')](_0x8505d4[_0xade1('0x4a')])?_0x8505d4['first_name']+'\x20'+_0x8505d4['last_name']:_0x8505d4[_0xade1('0x4b')],'id':_0x8505d4['id']};_0x391e9e[_0xade1('0x53')]=intUtil[_0xade1('0x54')](_0x16d6bd[_0xade1('0x55')],_0x255fca,'\x20');_0x391e9e['Description']=intUtil[_0xade1('0x54')](_0x16d6bd[_0xade1('0x56')],_0x255fca,'\x0a');if(_0x59b090[_0xade1('0x43')]===_0xade1('0x3e')){_0x391e9e['Who_Id']={'name':!_['isNil'](_0x59b090['Full_Name'])?_0x59b090['Full_Name']:!_['isNil'](_0x59b090['First_Name'])?_0x59b090[_0xade1('0x57')]+'\x20'+_0x59b090[_0xade1('0x58')]:_0x59b090['Last_Name'],'id':_0x59b090['id']};}if(_0x59b090['enduserType']===_0xade1('0x44')){_0x391e9e['What_Id']={'name':!_[_0xade1('0x1d')](_0x59b090[_0xade1('0x59')])?_0x59b090['Full_Name']:!_[_0xade1('0x1d')](_0x59b090[_0xade1('0x57')])?_0x59b090[_0xade1('0x57')]+'\x20'+_0x59b090['Last_Name']:_0x59b090['Last_Name'],'id':_0x59b090['id']};_0x391e9e[_0xade1('0x5a')]=_0x59b090['enduserType'];}if(_0x255fca[_0xade1('0x5b')]){_0x391e9e[_0xade1('0x5c')]=moment[_0xade1('0x5d')](parseInt(_0x255fca[_0xade1('0x5b')])*0x3e8)[_0xade1('0x5e')](_0xade1('0x5f'));}else if(_0x255fca[_0xade1('0x60')]&&_0x255fca['endtime']){_0x391e9e[_0xade1('0x5c')]=moment[_0xade1('0x5d')](moment(_0x255fca['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0xade1('0x61')](moment(_0x255fca[_0xade1('0x62')],_0xade1('0x63'))))['format'](_0xade1('0x5f'));}switch(_0x255fca[_0xade1('0x64')]){case _0xade1('0x65'):_0x391e9e[_0xade1('0x66')]=_0xade1('0x67');break;case _0xade1('0x68'):case _0xade1('0x69'):_0x391e9e['Call_Result']='Answered';break;case _0xade1('0x6a'):_0x391e9e[_0xade1('0x66')]=_0xade1('0x6b');break;case _0xade1('0x6c'):_0x391e9e[_0xade1('0x66')]='Abandoned';break;default:}_0x391e9e['Call_Start_Time']=(_0x51127f===_0xade1('0x6d')?moment(_0x255fca[_0xade1('0x62')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x255fca[_0xade1('0x6e')])['format'](_0xade1('0x63')))||moment()[_0xade1('0x5e')](_0xade1('0x63'));_0x391e9e[_0xade1('0x6f')]=_0x51127f||_0xade1('0x70');_0x391e9e=_['merge'](_0x391e9e,getCustomFields(_0x16d6bd['Fields'],_0x255fca));return request({'method':_0xade1('0x26'),'uri':_0xade1('0x3d')+_0x1f9f26+_0xade1('0x71'),'headers':{'Authorization':_0xade1('0x31')+_0x3b09bc},'body':{'data':[_0x391e9e]},'json':!![]})['then'](function(_0x80dcf7){if(_0x80dcf7&&_0x80dcf7[_0xade1('0x42')][0x0][_0xade1('0x4c')]===_0xade1('0x4d')){logger['info'](_0xade1('0x72'));return{'id':_0x80dcf7[_0xade1('0x42')][0x0][_0xade1('0x4e')]['id']};}})[_0xade1('0x73')](function(_0x11fecd){logger[_0xade1('0x2e')]('err',_0x11fecd[_0xade1('0x74')]);console['log'](_0xade1('0x75'),_0x11fecd);});}exports[_0xade1('0x76')]=function(_0x564199,_0x3082c9,_0x4b8b07,_0x520791,_0x2ba79d,_0x41afcd){var _0x2e9814,_0x13c7ab,_0x4b4687;_0x41afcd[_0xade1('0x77')]=intUtil['stripTrailingSlash'](_0x41afcd['host']);_0x41afcd[_0xade1('0x78')]=intUtil[_0xade1('0x79')](_0x41afcd[_0xade1('0x78')]);if(_0x2ba79d&&_0x2ba79d[_0xade1('0x7a')]){logger[_0xade1('0x2e')](_0xade1('0x7b'),_0xade1('0x7c'));_0x3082c9[_0xade1('0x7d')]=_0x41afcd[_0xade1('0x78')]+_0xade1('0x7e')+_0x3082c9['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x3082c9['uniqueid']);}else{_0x3082c9[_0xade1('0x7d')]='';}var _0xbb4022=_0x41afcd['host']===_0xade1('0x7f')?'eu':_0xade1('0x80');return getAccessToken(_0x41afcd)[_0xade1('0x2b')](function(_0x59ff15){_0x4b4687=_0x59ff15;return getUser(_0x4b4687,_0xbb4022,_0x41afcd,_0x520791['email']);})[_0xade1('0x2b')](function(_0x4fdabf){_0x2e9814=_0x4fdabf;logger[_0xade1('0x2e')]('The\x20User\x20ID\x20is:',_0x2e9814['id']);return getEndUser(_0x4b4687,_0xbb4022,_0x41afcd,_0x3082c9[_0xade1('0x81')],_0x3082c9['calleridnum'],_0x2e9814,_0x4b8b07);})[_0xade1('0x2b')](function(_0x9186a2){_0x13c7ab=_0x9186a2;logger[_0xade1('0x2e')](_0xade1('0x82'),_0x13c7ab['id']);return getCall(_0x4b4687,_0xbb4022,_0x41afcd,_0x2e9814,_0x13c7ab,_0x4b8b07,_0x3082c9,_0xade1('0x70'));})['then'](function(_0xdbebeb){if(_0xdbebeb){logger[_0xade1('0x2e')](_0xade1('0x83'),_0xdbebeb['id']);logger[_0xade1('0x2e')](_0xade1('0x7b'),_0xade1('0x84'));emit(util[_0xade1('0x5e')](_0xade1('0x85'),_0x520791[_0xade1('0x19')]),_0xade1('0x86'),{'uri':_0xade1('0x87')+_0x41afcd[_0xade1('0x77')]+_0xade1('0x88')+_0xdbebeb['id']});}})[_0xade1('0x73')](function(_0x1d20cb){logger['error']('[QUEUE]',JSON[_0xade1('0xf')](_0x1d20cb));});};exports[_0xade1('0x6d')]=function(_0x47bd65,_0x3597cf,_0x44ba5c,_0x4c69f8,_0x202d04,_0x621990,_0x32603e){var _0x2d46d3,_0x559ab0,_0x3bcae7;_0x621990[_0xade1('0x77')]=intUtil[_0xade1('0x79')](_0x621990[_0xade1('0x77')]);_0x621990[_0xade1('0x78')]=intUtil[_0xade1('0x79')](_0x621990['serverUrl']);if(_0x32603e&&_0x32603e[_0xade1('0x89')]&&_0x32603e[_0xade1('0x89')]!==_0xade1('0x8a')){logger[_0xade1('0x2e')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3597cf[_0xade1('0x7d')]=_0x621990[_0xade1('0x78')]+_0xade1('0x7e')+_0x3597cf[_0xade1('0x8b')]+_0xade1('0x8c')+md5(_0x3597cf[_0xade1('0x8b')]);}var _0x4d32a6=_0x621990['host']==='zoho.eu'?'eu':_0xade1('0x80');return getAccessToken(_0x621990)[_0xade1('0x2b')](function(_0x22ca98){_0x3bcae7=_0x22ca98;return getUser(_0x3bcae7,_0x4d32a6,_0x621990,_0x4c69f8[_0xade1('0x34')]);})['then'](function(_0x31a854){_0x2d46d3=_0x31a854;logger['info'](_0xade1('0x8d'),_0x2d46d3['id']);return getEndUser(_0x3bcae7,_0x4d32a6,_0x621990,_0x3597cf[_0xade1('0x8e')],_0x3597cf[_0xade1('0x8f')],_0x2d46d3,_0x44ba5c);})[_0xade1('0x2b')](function(_0x56c706){_0x559ab0=_0x56c706;logger[_0xade1('0x2e')]('The\x20Enduser\x20ID\x20is:',_0x559ab0['id']);return getCall(_0x3bcae7,_0x4d32a6,_0x621990,_0x2d46d3,_0x559ab0,_0x44ba5c,_0x3597cf,'Outbound');})['then'](function(_0x5b553b){if(_0x5b553b){logger['info'](_0xade1('0x83'),_0x5b553b['id']);logger[_0xade1('0x2e')](_0xade1('0x90'),_0xade1('0x84'));emit(util['format']('user:%s',_0x4c69f8['name']),_0xade1('0x86'),{'uri':_0xade1('0x87')+_0x621990[_0xade1('0x77')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5b553b['id']});}})[_0xade1('0x73')](function(_0x420d8e){logger[_0xade1('0x2d')](_0xade1('0x90'),JSON[_0xade1('0xf')](_0x420d8e));});};exports[_0xade1('0x6c')]=function(_0x161672,_0x80e916,_0x25447e,_0x1a7594,_0x285969,_0x568071){var _0x1025cc,_0x4a5beb,_0x302bd1;_0x568071['host']=intUtil[_0xade1('0x79')](_0x568071[_0xade1('0x77')]);_0x568071[_0xade1('0x78')]=intUtil[_0xade1('0x79')](_0x568071[_0xade1('0x78')]);if(_0x285969&&_0x285969['monitor_format']){logger[_0xade1('0x2e')](_0xade1('0x91'),_0xade1('0x7c'));_0x80e916[_0xade1('0x7d')]=_0x568071[_0xade1('0x78')]+_0xade1('0x7e')+_0x80e916[_0xade1('0x8b')]+'/downloads?type=uniqueid&token='+md5(_0x80e916['uniqueid']);}else{_0x80e916[_0xade1('0x7d')]='';}var _0xde8950=_0x568071['host']===_0xade1('0x7f')?'eu':_0xade1('0x80');return getAccessToken(_0x568071)['then'](function(_0x5090cc){_0x302bd1=_0x5090cc;return getUser(_0x302bd1,_0xde8950,_0x568071);})[_0xade1('0x2b')](function(_0x28f228){_0x1025cc=_0x28f228;logger[_0xade1('0x2e')](_0xade1('0x8d'),_0x1025cc['id']);return getEndUser(_0x302bd1,_0xde8950,_0x568071,_0x80e916[_0xade1('0x81')],_0x80e916[_0xade1('0x92')],_0x1025cc,_0x25447e);})['then'](function(_0x495a75){_0x4a5beb=_0x495a75;logger['info'](_0xade1('0x82'),_0x4a5beb['id']);return getCall(_0x302bd1,_0xde8950,_0x568071,_0x1025cc,_0x4a5beb,_0x25447e,_0x80e916,_0xade1('0x70'));})[_0xade1('0x2b')](function(_0x142711){if(_0x142711){logger[_0xade1('0x2e')](_0xade1('0x83'),_0x142711['id']);}})[_0xade1('0x73')](function(_0xe4e449){logger[_0xade1('0x2d')](_0xade1('0x91'),JSON[_0xade1('0xf')](_0xe4e449));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js index 82737a8..a5f004c 100644 --- a/server/services/ami/trigger/script/index.js +++ b/server/services/ami/trigger/script/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x21604b,_0x8c5dd1){var _0x4347ed=function(_0x36058c){while(--_0x36058c){_0x21604b['push'](_0x21604b['shift']());}};_0x4347ed(++_0x8c5dd1);}(_0x7a54,0x106));var _0x47a5=function(_0x4c448a,_0x56cec6){_0x4c448a=_0x4c448a-0x0;var _0x3a5cb3=_0x7a54[_0x4c448a];return _0x3a5cb3;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file +var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x9c3a93,_0x4c7ea0){var _0x2ed193=function(_0x384fa4){while(--_0x384fa4){_0x9c3a93['push'](_0x9c3a93['shift']());}};_0x2ed193(++_0x4c7ea0);}(_0x7a54,0x106));var _0x47a5=function(_0xf1adab,_0xcb47cd){_0xf1adab=_0xf1adab-0x0;var _0x5705ac=_0x7a54[_0xf1adab];return _0x5705ac;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index 32103f8..9269c41 100644 --- a/server/services/ami/trigger/urlforward/index.js +++ b/server/services/ami/trigger/urlforward/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98d4=['isNil',',\x20request\x20body:\x20','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','headers','data6','parse','render','error','data1','GET','POST','PUT','data7','body','info','format','stringify','then'];(function(_0x388e85,_0x599d93){var _0x592841=function(_0x1f6f49){while(--_0x1f6f49){_0x388e85['push'](_0x388e85['shift']());}};_0x592841(++_0x599d93);}(_0x98d4,0x13a));var _0x498d=function(_0x3f7c58,_0x17427c){_0x3f7c58=_0x3f7c58-0x0;var _0x20f166=_0x98d4[_0x3f7c58];return _0x20f166;};'use strict';var rp=require(_0x498d('0x0'));var util=require(_0x498d('0x1'));var _=require(_0x498d('0x2'));var Mustache=require('mustache');var logger=require(_0x498d('0x3'))(_0x498d('0x4'));exports['exec']=function(_0x321c33,_0x49eb1c){var _0x52d69a,_0x744194;var _0x528cf1={'method':_0x321c33['data1'][_0x498d('0x5')](),'uri':Mustache['render'](_0x321c33[_0x498d('0x6')],_0x49eb1c),'json':!![],'resolveWithFullResponse':!![]};try{_0x528cf1[_0x498d('0x7')]=_0x321c33[_0x498d('0x8')]?JSON[_0x498d('0x9')](Mustache[_0x498d('0xa')](_0x321c33[_0x498d('0x8')],_0x49eb1c)):{};}catch(_0x5bda21){logger[_0x498d('0xb')](_0x5bda21['stack']);}switch(_0x321c33[_0x498d('0xc')]['toUpperCase']()){case _0x498d('0xd'):_0x528cf1['qs']=_0x49eb1c;break;case _0x498d('0xe'):case _0x498d('0xf'):_0x52d69a={};if(_0x321c33[_0x498d('0x10')]){_0x52d69a=Mustache[_0x498d('0xa')](_0x321c33['data7'],_0x49eb1c);}else{_0x52d69a=_0x49eb1c;}_0x528cf1[_0x498d('0x11')]=JSON['parse'](_0x52d69a);break;}logger[_0x498d('0x12')](util[_0x498d('0x13')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x321c33['data1'],_0x321c33['data2'],JSON[_0x498d('0x14')](_0x528cf1)));rp(_0x528cf1)[_0x498d('0x15')](function(_0x1bcc6c){_0x52d69a=!_[_0x498d('0x16')](_0x52d69a)?_0x498d('0x17')+_0x52d69a:'';_0x744194=typeof _0x1bcc6c['body']==='object'?JSON[_0x498d('0x14')](_0x1bcc6c['body']):_0x1bcc6c[_0x498d('0x11')];logger['info'](util[_0x498d('0x13')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x321c33[_0x498d('0xc')],_0x321c33[_0x498d('0x6')],_0x1bcc6c['statusCode'],_0x744194));})[_0x498d('0x18')](function(_0x2cbe2b){logger['error'](util[_0x498d('0x13')](_0x498d('0x19'),_0x321c33[_0x498d('0xc')],_0x321c33[_0x498d('0x6')],_0x2cbe2b['statusCode'],_0x2cbe2b[_0x498d('0x1a')],_0x2cbe2b[_0x498d('0x1b')]));});}; \ No newline at end of file +var _0x5566=['request-promise','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','render','headers','data6','stack','GET','POST','PUT','data7','body','parse','format','data2','stringify','then',',\x20request\x20body:\x20','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','error','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message'];(function(_0x2183ca,_0x3778a9){var _0x21d00e=function(_0x2fb048){while(--_0x2fb048){_0x2183ca['push'](_0x2183ca['shift']());}};_0x21d00e(++_0x3778a9);}(_0x5566,0x179));var _0x6556=function(_0x1e06c4,_0x38a792){_0x1e06c4=_0x1e06c4-0x0;var _0x529a41=_0x5566[_0x1e06c4];return _0x529a41;};'use strict';var rp=require(_0x6556('0x0'));var util=require('util');var _=require(_0x6556('0x1'));var Mustache=require(_0x6556('0x2'));var logger=require(_0x6556('0x3'))('trigger');exports[_0x6556('0x4')]=function(_0x3df575,_0x5792bd){var _0x110857,_0x220753;var _0x4a397d={'method':_0x3df575[_0x6556('0x5')][_0x6556('0x6')](),'uri':Mustache[_0x6556('0x7')](_0x3df575['data2'],_0x5792bd),'json':!![],'resolveWithFullResponse':!![]};try{_0x4a397d[_0x6556('0x8')]=_0x3df575[_0x6556('0x9')]?JSON['parse'](Mustache[_0x6556('0x7')](_0x3df575[_0x6556('0x9')],_0x5792bd)):{};}catch(_0x4ad16f){logger['error'](_0x4ad16f[_0x6556('0xa')]);}switch(_0x3df575[_0x6556('0x5')][_0x6556('0x6')]()){case _0x6556('0xb'):_0x4a397d['qs']=_0x5792bd;break;case _0x6556('0xc'):case _0x6556('0xd'):_0x110857={};if(_0x3df575[_0x6556('0xe')]){_0x110857=Mustache[_0x6556('0x7')](_0x3df575[_0x6556('0xe')],_0x5792bd);}else{_0x110857=_0x5792bd;}_0x4a397d[_0x6556('0xf')]=JSON[_0x6556('0x10')](_0x110857);break;}logger['info'](util[_0x6556('0x11')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x3df575[_0x6556('0x5')],_0x3df575[_0x6556('0x12')],JSON[_0x6556('0x13')](_0x4a397d)));rp(_0x4a397d)[_0x6556('0x14')](function(_0x102832){_0x110857=!_['isNil'](_0x110857)?_0x6556('0x15')+_0x110857:'';_0x220753=typeof _0x102832[_0x6556('0xf')]===_0x6556('0x16')?JSON['stringify'](_0x102832['body']):_0x102832[_0x6556('0xf')];logger[_0x6556('0x17')](util[_0x6556('0x11')](_0x6556('0x18'),_0x3df575[_0x6556('0x5')],_0x3df575[_0x6556('0x12')],_0x102832[_0x6556('0x19')],_0x220753));})['catch'](function(_0x21d6e6){logger[_0x6556('0x1a')](util[_0x6556('0x11')](_0x6556('0x1b'),_0x3df575['data1'],_0x3df575[_0x6556('0x12')],_0x21d6e6[_0x6556('0x19')],_0x21d6e6['name'],_0x21d6e6[_0x6556('0x1c')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index cae28e1..5230894 100644 --- a/server/services/email/client.js +++ b/server/services/email/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7e6=['http','request','debug','rpc','error','catch','jayson/promise','bluebird','../../config/logger','routing','client'];(function(_0xd31621,_0x17b567){var _0x2e7ac0=function(_0x3c5a8d){while(--_0x3c5a8d){_0xd31621['push'](_0xd31621['shift']());}};_0x2e7ac0(++_0x17b567);}(_0xa7e6,0x74));var _0x6a7e=function(_0x3c6f0e,_0x53fea4){_0x3c6f0e=_0x3c6f0e-0x0;var _0x1b11e7=_0xa7e6[_0x3c6f0e];return _0x1b11e7;};'use strict';var jayson=require(_0x6a7e('0x0'));var BPromise=require(_0x6a7e('0x1'));var logger=require(_0x6a7e('0x2'))(_0x6a7e('0x3'));var client=jayson[_0x6a7e('0x4')][_0x6a7e('0x5')]({'port':0x2329});client['Request']=function(_0x3ccca2,_0x8787b5){return new BPromise(function(_0x1ea310,_0x28dba9){return client[_0x6a7e('0x6')](_0x3ccca2,_0x8787b5)['then'](function(_0x79df6f){logger[_0x6a7e('0x7')](_0x6a7e('0x8'),_0x6a7e('0x3'),_0x3ccca2,_0x8787b5,_0x79df6f);if(_0x79df6f[_0x6a7e('0x9')]){logger[_0x6a7e('0x9')](_0x6a7e('0x8'),_0x6a7e('0x3'),_0x3ccca2,_0x79df6f[_0x6a7e('0x9')]['message'],_0x8787b5);return _0x28dba9(_0x79df6f['error']['message']);}else{return _0x1ea310(_0x79df6f['result']);}})[_0x6a7e('0xa')](function(_0x19ea13){logger[_0x6a7e('0x9')](_0x6a7e('0x8'),_0x6a7e('0x3'),_0x3ccca2,_0x19ea13,_0x8787b5);return _0x28dba9(_0x19ea13);});});};module['exports']=client; \ No newline at end of file +var _0x1af3=['Request','request','then','debug','error','message','result','catch','rpc','exports','jayson/promise','bluebird','../../config/logger','routing','client','http'];(function(_0x4d722a,_0x555021){var _0x4b040a=function(_0x25444c){while(--_0x25444c){_0x4d722a['push'](_0x4d722a['shift']());}};_0x4b040a(++_0x555021);}(_0x1af3,0x1ca));var _0x31af=function(_0x5b3950,_0x4e5556){_0x5b3950=_0x5b3950-0x0;var _0x41e436=_0x1af3[_0x5b3950];return _0x41e436;};'use strict';var jayson=require(_0x31af('0x0'));var BPromise=require(_0x31af('0x1'));var logger=require(_0x31af('0x2'))(_0x31af('0x3'));var client=jayson[_0x31af('0x4')][_0x31af('0x5')]({'port':0x2329});client[_0x31af('0x6')]=function(_0x1a6ea6,_0x3d64ae){return new BPromise(function(_0xc098ee,_0x4f989c){return client[_0x31af('0x7')](_0x1a6ea6,_0x3d64ae)[_0x31af('0x8')](function(_0x1ac3f6){logger[_0x31af('0x9')]('rpc',_0x31af('0x3'),_0x1a6ea6,_0x3d64ae,_0x1ac3f6);if(_0x1ac3f6[_0x31af('0xa')]){logger[_0x31af('0xa')]('rpc',_0x31af('0x3'),_0x1a6ea6,_0x1ac3f6[_0x31af('0xa')][_0x31af('0xb')],_0x3d64ae);return _0x4f989c(_0x1ac3f6[_0x31af('0xa')][_0x31af('0xb')]);}else{return _0xc098ee(_0x1ac3f6[_0x31af('0xc')]);}})[_0x31af('0xd')](function(_0x33b4a5){logger['error'](_0x31af('0xe'),_0x31af('0x3'),_0x1a6ea6,_0x33b4a5,_0x3d64ae);return _0x4f989c(_0x33b4a5);});});};module[_0x31af('0xf')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 0911fc3..345b8bd 100644 --- a/server/services/email/index.js +++ b/server/services/email/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8da=['then','getMailAccounts','initMailAccounts','mailAccounts','listen','catch','log','./server','./lib/email','./rpc/mailAccount'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xf8da,0xf7));var _0xaf8d=function(_0x14d643,_0x1c7727){_0x14d643=_0x14d643-0x0;var _0x3a4451=_0xf8da[_0x14d643];return _0x3a4451;};'use strict';var BPromise=require('bluebird');var server=require(_0xaf8d('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0xaf8d('0x1'));var mailAccount=require(_0xaf8d('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0xaf8d('0x3')](mailAccount[_0xaf8d('0x4')]())['then'](realtime[_0xaf8d('0x5')]())[_0xaf8d('0x3')](function(){email['refresh'](realtime[_0xaf8d('0x6')]);return realtime;});}function main(){return server[_0xaf8d('0x7')](realtime,email)[_0xaf8d('0x3')](function(_0x48f752){return initRealtime();})['then'](function(_0x5daaf3){return setInterval(initRealtime,0x2710);})[_0xaf8d('0x8')](function(_0x469bdb){console[_0xaf8d('0x9')](_0x469bdb);});}main(); \ No newline at end of file +var _0xcec9=['getMailAccounts','refresh','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then'];(function(_0x4ba12f,_0xbf80d3){var _0x23221d=function(_0x14774e){while(--_0x14774e){_0x4ba12f['push'](_0x4ba12f['shift']());}};_0x23221d(++_0xbf80d3);}(_0xcec9,0x164));var _0x9cec=function(_0x530b54,_0x543476){_0x530b54=_0x530b54-0x0;var _0x2c3e32=_0xcec9[_0x530b54];return _0x2c3e32;};'use strict';var BPromise=require(_0x9cec('0x0'));var server=require(_0x9cec('0x1'));var Realtime=require(_0x9cec('0x2'));var EmailChannel=require(_0x9cec('0x3'));var mailAccount=require(_0x9cec('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x9cec('0x5')]()[_0x9cec('0x6')](mailAccount[_0x9cec('0x7')]())['then'](realtime['initMailAccounts']())[_0x9cec('0x6')](function(){email[_0x9cec('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0x9cec('0x6')](function(_0x466b70){return initRealtime();})[_0x9cec('0x6')](function(_0x584d48){return setInterval(initRealtime,0x2710);})[_0x9cec('0x9')](function(_0x4097c7){console[_0x9cec('0xa')](_0x4097c7);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 43abc7b..e85c936 100644 --- a/server/services/email/lib/email.js +++ b/server/services/email/lib/email.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffa2=['status','messageStatus','total','isNil','stringify','refresh','box','bind','end','handleImapEnd','handleImapError','handleImapBox','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','error','sendMail','send','verifySmtp','Smtp','verified','verify','lodash','moment','md5','email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','Imap'];(function(_0xdd006d,_0x33466a){var _0x5d5f31=function(_0x2ddb2a){while(--_0x2ddb2a){_0xdd006d['push'](_0xdd006d['shift']());}};_0x5d5f31(++_0x33466a);}(_0xffa2,0x129));var _0x2ffa=function(_0x433cc9,_0x57e8e2){_0x433cc9=_0x433cc9-0x0;var _0x3383e8=_0xffa2[_0x433cc9];return _0x3383e8;};'use strict';var _=require(_0x2ffa('0x0'));var moment=require(_0x2ffa('0x1'));var BPromise=require('bluebird');var md5=require(_0x2ffa('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x2ffa('0x3'));config['redis']=_[_0x2ffa('0x4')](config[_0x2ffa('0x5')],{'host':_0x2ffa('0x6'),'port':0x18eb});var io=require(_0x2ffa('0x7'))(new Redis(config[_0x2ffa('0x5')]));var EmailImap=require(_0x2ffa('0x8'));var EmailSmtp=require(_0x2ffa('0x9'));var mailAccount=require(_0x2ffa('0xa'));var md5Accounts={};function EmailChannel(_0x4786b8){logger[_0x2ffa('0xb')](_0x2ffa('0xc'));this[_0x2ffa('0xd')]=_0x4786b8[_0x2ffa('0xd')];this[_0x2ffa('0xe')]={};this[_0x2ffa('0xf')]=new EmailSmtp();}EmailChannel[_0x2ffa('0x10')][_0x2ffa('0x11')]=function(_0x259fc3){var _0x5e5e63=this[_0x2ffa('0xd')][_0x259fc3];var _0x4c7409={'id':_0x5e5e63['id'],'name':_0x5e5e63[_0x2ffa('0x12')],'key':_0x5e5e63['key'],'active':_0x5e5e63[_0x2ffa('0x13')],'Imap':{'status':_0x5e5e63[_0x2ffa('0x14')][_0x2ffa('0x15')],'messageStatus':_0x5e5e63[_0x2ffa('0x14')][_0x2ffa('0x16')],'total':_0x5e5e63['Imap'][_0x2ffa('0x17')]}};if(_[_0x2ffa('0x18')](md5Accounts[_0x259fc3])){md5Accounts[_0x259fc3]={};}var _0x1448f5=md5(JSON[_0x2ffa('0x19')](_0x4c7409));if(md5Accounts[_0x259fc3][_0x2ffa('0x2')]!==_0x1448f5){md5Accounts[_0x259fc3][_0x2ffa('0x2')]=_0x1448f5;io[_0x2ffa('0x11')]('mailAccount:update',_0x4c7409);}};EmailChannel[_0x2ffa('0x10')][_0x2ffa('0x1a')]=function(_0xdd0522){for(var _0x4e773e in _0xdd0522){if(_0xdd0522['hasOwnProperty'](_0x4e773e)){if(_0xdd0522[_0x4e773e][_0x2ffa('0x14')]&&_0xdd0522[_0x4e773e][_0x2ffa('0x13')]){var _0x1364ed=_0xdd0522[_0x4e773e]['Imap'];if(!this[_0x2ffa('0xe')]['hasOwnProperty'](_0x1364ed['id'])){this[_0x2ffa('0xe')][_0x1364ed['id']]=new EmailImap(_0x1364ed,_0xdd0522[_0x4e773e][_0x2ffa('0x3')]);this[_0x2ffa('0xe')][_0x1364ed['id']]['on'](_0x2ffa('0x1b'),this['handleImapBox'][_0x2ffa('0x1c')](this,_0x4e773e));this['imapAccounts'][_0x1364ed['id']]['on']('email',this['handleImapEmail'][_0x2ffa('0x1c')](this,_0x4e773e));this[_0x2ffa('0xe')][_0x1364ed['id']]['on'](_0x2ffa('0x1d'),this[_0x2ffa('0x1e')][_0x2ffa('0x1c')](this,_0x4e773e));this[_0x2ffa('0xe')][_0x1364ed['id']]['on']('error',this[_0x2ffa('0x1f')]['bind'](this,_0x4e773e));}}else{if(_[_0x2ffa('0x18')](this[_0x2ffa('0xd')][_0x4e773e]['Imap'])){this[_0x2ffa('0xd')][_0x4e773e][_0x2ffa('0x14')]={};}this[_0x2ffa('0xd')][_0x4e773e][_0x2ffa('0x14')][_0x2ffa('0x15')]='disabled';this[_0x2ffa('0xd')][_0x4e773e][_0x2ffa('0x14')][_0x2ffa('0x16')]='';this[_0x2ffa('0x11')](_0x4e773e);}}}};EmailChannel[_0x2ffa('0x10')][_0x2ffa('0x20')]=function(_0x2fea98,_0x578f03){if(this['mailAccounts'][_0x2fea98]){this[_0x2ffa('0xd')][_0x2fea98][_0x2ffa('0x14')][_0x2ffa('0x15')]=_0x2ffa('0x21');this['mailAccounts'][_0x2fea98]['Imap'][_0x2ffa('0x16')]=_0x578f03['name'];if(_0x578f03[_0x2ffa('0x22')]){this[_0x2ffa('0xd')][_0x2fea98][_0x2ffa('0x14')][_0x2ffa('0x17')]=_0x578f03[_0x2ffa('0x22')][_0x2ffa('0x17')];}return this[_0x2ffa('0x11')](_0x2fea98);}};EmailChannel[_0x2ffa('0x10')][_0x2ffa('0x23')]=function(_0x2659df,_0x5047a0){logger[_0x2ffa('0xb')](_0x2ffa('0x24'),_0x5047a0[_0x2ffa('0x25')],_0x5047a0[_0x2ffa('0x26')],_0x5047a0[_0x2ffa('0x27')],_0x2659df);if(this[_0x2ffa('0xd')][_0x2659df]){return mailAccount[_0x2ffa('0x28')](_0x2659df,_0x5047a0)[_0x2ffa('0x29')](function(_0x1eaadd){if(_0x1eaadd){logger['info'](_0x2ffa('0x2a'));}})[_0x2ffa('0x2b')](function(_0x237ed8){logger['error'](_0x2ffa('0x2c'),JSON[_0x2ffa('0x19')](_0x237ed8));});}};EmailChannel[_0x2ffa('0x10')][_0x2ffa('0x1e')]=function(_0x58d4b7){if(this[_0x2ffa('0xd')][_0x58d4b7]&&this['mailAccounts'][_0x58d4b7][_0x2ffa('0x14')]){if(this[_0x2ffa('0xe')][this['mailAccounts'][_0x58d4b7][_0x2ffa('0x14')]['id']]){delete this[_0x2ffa('0xe')][this[_0x2ffa('0xd')][_0x58d4b7][_0x2ffa('0x14')]['id']];}this[_0x2ffa('0xd')][_0x58d4b7][_0x2ffa('0x14')][_0x2ffa('0x2d')]=moment();this['emit'](_0x58d4b7);}};EmailChannel[_0x2ffa('0x10')][_0x2ffa('0x1f')]=function(_0x3966df,_0x580dd1){if(this['mailAccounts'][_0x3966df]){this[_0x2ffa('0xd')][_0x3966df][_0x2ffa('0x14')][_0x2ffa('0x15')]=_0x2ffa('0x2e');this[_0x2ffa('0xd')][_0x3966df]['Imap'][_0x2ffa('0x16')]=_0x580dd1;return this['emit'](_0x3966df);}};EmailChannel[_0x2ffa('0x10')][_0x2ffa('0x2f')]=function(_0x47674b,_0x4e7680){return this[_0x2ffa('0xf')][_0x2ffa('0x30')](_0x47674b,_0x4e7680);};EmailChannel['prototype'][_0x2ffa('0x31')]=function(_0x2ed456){var _0x3aa832=this;if(this[_0x2ffa('0xd')][_0x2ed456['id']]){if(_[_0x2ffa('0x18')](this[_0x2ffa('0xd')][_0x2ed456['id']][_0x2ffa('0x32')])){this[_0x2ffa('0xd')][_0x2ed456['id']][_0x2ffa('0x32')]={};}this['mailAccounts'][_0x2ed456['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x46048c,_0x1e571a){return _0x3aa832['smtp']['verify'](_0x2ed456)['then'](function(_0x58ba42){_0x3aa832['mailAccounts'][_0x2ed456['id']]['Smtp']['status']=_0x2ffa('0x33');_0x3aa832[_0x2ffa('0xd')][_0x2ed456['id']][_0x2ffa('0x32')]['messageStatus']='';_0x3aa832['emit'](_0x2ed456['id']);_0x46048c(_0x58ba42);})[_0x2ffa('0x2b')](function(_0x3db985){_0x3aa832['mailAccounts'][_0x2ed456['id']][_0x2ffa('0x32')][_0x2ffa('0x15')]=_0x2ffa('0x2e');_0x3aa832[_0x2ffa('0xd')][_0x2ed456['id']][_0x2ffa('0x32')][_0x2ffa('0x16')]=_0x3db985;_0x3aa832[_0x2ffa('0x11')](_0x2ed456['id']);_0x1e571a(_0x3db985);});});}return this[_0x2ffa('0xf')][_0x2ffa('0x34')](_0x2ed456);};module['exports']=EmailChannel; \ No newline at end of file +var _0x1d97=['key','active','Imap','messageStatus','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','imapAccounts','email','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','status','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','lastSync','sendMail','send','verifySmtp','Smtp','smtp','verify','verified','catch','exports','lodash','moment','bluebird','ioredis','../../../config/logger','redis','localhost','socket.io-emitter','./imap','./smtp','info','mailAccounts','prototype','emit','name'];(function(_0x42a131,_0x285b1a){var _0x4098f9=function(_0x4e5bd8){while(--_0x4e5bd8){_0x42a131['push'](_0x42a131['shift']());}};_0x4098f9(++_0x285b1a);}(_0x1d97,0x96));var _0x71d9=function(_0x997229,_0x23e080){_0x997229=_0x997229-0x0;var _0x475a3b=_0x1d97[_0x997229];return _0x475a3b;};'use strict';var _=require(_0x71d9('0x0'));var moment=require(_0x71d9('0x1'));var BPromise=require(_0x71d9('0x2'));var md5=require('md5');var Redis=require(_0x71d9('0x3'));var config=require('../../../config/environment');var logger=require(_0x71d9('0x4'))('email');config[_0x71d9('0x5')]=_['defaults'](config[_0x71d9('0x5')],{'host':_0x71d9('0x6'),'port':0x18eb});var io=require(_0x71d9('0x7'))(new Redis(config[_0x71d9('0x5')]));var EmailImap=require(_0x71d9('0x8'));var EmailSmtp=require(_0x71d9('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0xea0f00){logger[_0x71d9('0xa')]('start\x20email\x20channel');this[_0x71d9('0xb')]=_0xea0f00['mailAccounts'];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0x71d9('0xc')][_0x71d9('0xd')]=function(_0x54e963){var _0x655a0f=this[_0x71d9('0xb')][_0x54e963];var _0x53ecf2={'id':_0x655a0f['id'],'name':_0x655a0f[_0x71d9('0xe')],'key':_0x655a0f[_0x71d9('0xf')],'active':_0x655a0f[_0x71d9('0x10')],'Imap':{'status':_0x655a0f[_0x71d9('0x11')]['status'],'messageStatus':_0x655a0f[_0x71d9('0x11')][_0x71d9('0x12')],'total':_0x655a0f[_0x71d9('0x11')][_0x71d9('0x13')]}};if(_[_0x71d9('0x14')](md5Accounts[_0x54e963])){md5Accounts[_0x54e963]={};}var _0x4f4e6f=md5(JSON[_0x71d9('0x15')](_0x53ecf2));if(md5Accounts[_0x54e963]['md5']!==_0x4f4e6f){md5Accounts[_0x54e963][_0x71d9('0x16')]=_0x4f4e6f;io['emit'](_0x71d9('0x17'),_0x53ecf2);}};EmailChannel['prototype'][_0x71d9('0x18')]=function(_0x2c25d8){for(var _0x4a0e90 in _0x2c25d8){if(_0x2c25d8[_0x71d9('0x19')](_0x4a0e90)){if(_0x2c25d8[_0x4a0e90]['Imap']&&_0x2c25d8[_0x4a0e90][_0x71d9('0x10')]){var _0x3de944=_0x2c25d8[_0x4a0e90]['Imap'];if(!this['imapAccounts'][_0x71d9('0x19')](_0x3de944['id'])){this[_0x71d9('0x1a')][_0x3de944['id']]=new EmailImap(_0x3de944,_0x2c25d8[_0x4a0e90][_0x71d9('0x1b')]);this[_0x71d9('0x1a')][_0x3de944['id']]['on']('box',this['handleImapBox'][_0x71d9('0x1c')](this,_0x4a0e90));this[_0x71d9('0x1a')][_0x3de944['id']]['on'](_0x71d9('0x1b'),this[_0x71d9('0x1d')]['bind'](this,_0x4a0e90));this[_0x71d9('0x1a')][_0x3de944['id']]['on'](_0x71d9('0x1e'),this[_0x71d9('0x1f')]['bind'](this,_0x4a0e90));this[_0x71d9('0x1a')][_0x3de944['id']]['on'](_0x71d9('0x20'),this[_0x71d9('0x21')]['bind'](this,_0x4a0e90));}}else{if(_['isNil'](this[_0x71d9('0xb')][_0x4a0e90][_0x71d9('0x11')])){this[_0x71d9('0xb')][_0x4a0e90][_0x71d9('0x11')]={};}this[_0x71d9('0xb')][_0x4a0e90][_0x71d9('0x11')][_0x71d9('0x22')]=_0x71d9('0x23');this[_0x71d9('0xb')][_0x4a0e90]['Imap'][_0x71d9('0x12')]='';this[_0x71d9('0xd')](_0x4a0e90);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x258e9d,_0x4169c6){if(this[_0x71d9('0xb')][_0x258e9d]){this[_0x71d9('0xb')][_0x258e9d]['Imap'][_0x71d9('0x22')]=_0x71d9('0x24');this[_0x71d9('0xb')][_0x258e9d][_0x71d9('0x11')]['messageStatus']=_0x4169c6[_0x71d9('0xe')];if(_0x4169c6['messages']){this['mailAccounts'][_0x258e9d][_0x71d9('0x11')][_0x71d9('0x13')]=_0x4169c6[_0x71d9('0x25')][_0x71d9('0x13')];}return this['emit'](_0x258e9d);}};EmailChannel[_0x71d9('0xc')][_0x71d9('0x1d')]=function(_0x50dd82,_0x3a030e){logger[_0x71d9('0xa')](_0x71d9('0x26'),_0x3a030e[_0x71d9('0x27')],_0x3a030e[_0x71d9('0x28')],_0x3a030e[_0x71d9('0x29')],_0x50dd82);if(this[_0x71d9('0xb')][_0x50dd82]){return mailAccount[_0x71d9('0x2a')](_0x50dd82,_0x3a030e)[_0x71d9('0x2b')](function(_0x43ff28){if(_0x43ff28){logger[_0x71d9('0xa')](_0x71d9('0x2c'));}})['catch'](function(_0x526e4f){logger[_0x71d9('0x20')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x526e4f));});}};EmailChannel['prototype'][_0x71d9('0x1f')]=function(_0x2ed6b4){if(this[_0x71d9('0xb')][_0x2ed6b4]&&this[_0x71d9('0xb')][_0x2ed6b4][_0x71d9('0x11')]){if(this[_0x71d9('0x1a')][this['mailAccounts'][_0x2ed6b4][_0x71d9('0x11')]['id']]){delete this['imapAccounts'][this[_0x71d9('0xb')][_0x2ed6b4]['Imap']['id']];}this[_0x71d9('0xb')][_0x2ed6b4]['Imap'][_0x71d9('0x2d')]=moment();this[_0x71d9('0xd')](_0x2ed6b4);}};EmailChannel[_0x71d9('0xc')][_0x71d9('0x21')]=function(_0x429ec0,_0x8faf5a){if(this[_0x71d9('0xb')][_0x429ec0]){this[_0x71d9('0xb')][_0x429ec0][_0x71d9('0x11')][_0x71d9('0x22')]=_0x71d9('0x20');this['mailAccounts'][_0x429ec0][_0x71d9('0x11')][_0x71d9('0x12')]=_0x8faf5a;return this[_0x71d9('0xd')](_0x429ec0);}};EmailChannel[_0x71d9('0xc')][_0x71d9('0x2e')]=function(_0x43e11a,_0x13a0ff){return this['smtp'][_0x71d9('0x2f')](_0x43e11a,_0x13a0ff);};EmailChannel[_0x71d9('0xc')][_0x71d9('0x30')]=function(_0x32d3e9){var _0x3549e8=this;if(this['mailAccounts'][_0x32d3e9['id']]){if(_[_0x71d9('0x14')](this[_0x71d9('0xb')][_0x32d3e9['id']][_0x71d9('0x31')])){this[_0x71d9('0xb')][_0x32d3e9['id']][_0x71d9('0x31')]={};}this[_0x71d9('0xb')][_0x32d3e9['id']][_0x71d9('0x31')][_0x71d9('0x2d')]=moment();return new BPromise(function(_0x1329c4,_0x3e8343){return _0x3549e8[_0x71d9('0x32')][_0x71d9('0x33')](_0x32d3e9)[_0x71d9('0x2b')](function(_0x331cba){_0x3549e8[_0x71d9('0xb')][_0x32d3e9['id']][_0x71d9('0x31')][_0x71d9('0x22')]=_0x71d9('0x34');_0x3549e8[_0x71d9('0xb')][_0x32d3e9['id']][_0x71d9('0x31')]['messageStatus']='';_0x3549e8[_0x71d9('0xd')](_0x32d3e9['id']);_0x1329c4(_0x331cba);})[_0x71d9('0x35')](function(_0x4298ee){_0x3549e8[_0x71d9('0xb')][_0x32d3e9['id']]['Smtp'][_0x71d9('0x22')]=_0x71d9('0x20');_0x3549e8['mailAccounts'][_0x32d3e9['id']][_0x71d9('0x31')][_0x71d9('0x12')]=_0x4298ee;_0x3549e8[_0x71d9('0xd')](_0x32d3e9['id']);_0x3e8343(_0x4298ee);});});}return this[_0x71d9('0x32')][_0x71d9('0x33')](_0x32d3e9);};module[_0x71d9('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 025df67..f8a7f25 100644 --- a/server/services/email/lib/imap.js +++ b/server/services/email/lib/imap.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeae8=['UNSEEN','handleReadUnseen','message','handleFetchError','handleFetchEnd','error','closeBox','handleFetchMessage','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleCloseBox','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','emit','exports','path','util','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','account','getAccount','imap','once','ready','bind','end','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','getHost','anonymous@xcally.com','handleReady','openBox','handleOpenBox','box','readUnseen','search'];(function(_0xef5f0f,_0x35b798){var _0xd3b8d=function(_0x18abe4){while(--_0x18abe4){_0xef5f0f['push'](_0xef5f0f['shift']());}};_0xd3b8d(++_0x35b798);}(_0xeae8,0x189));var _0x8eae=function(_0x43e4cd,_0x2e2ece){_0x43e4cd=_0x43e4cd-0x0;var _0x47b42f=_0xeae8[_0x43e4cd];return _0x47b42f;};'use strict';var fs=require('fs');var path=require(_0x8eae('0x0'));var util=require(_0x8eae('0x1'));var Imap=require('imap');var _=require('lodash');var rs=require('randomstring');var simpleParser=require(_0x8eae('0x2'))[_0x8eae('0x3')];var Iconv=require(_0x8eae('0x4'))[_0x8eae('0x5')];var EventEmitter=require(_0x8eae('0x6'))[_0x8eae('0x7')];var utils=require(_0x8eae('0x8'));var logger=require('../../../config/logger')(_0x8eae('0x9'));function EmailImap(_0x42e467,_0x54009f){this[_0x8eae('0xa')]='INBOX';this[_0x8eae('0xb')]=this[_0x8eae('0xc')](_0x42e467,_0x54009f);this[_0x8eae('0xd')]=new Imap(this['account']);this['imap'][_0x8eae('0xe')](_0x8eae('0xf'),this['handleReady'][_0x8eae('0x10')](this));this[_0x8eae('0xd')][_0x8eae('0xe')](_0x8eae('0x11'),this['handleEnd'][_0x8eae('0x10')](this));this[_0x8eae('0xd')]['on']('error',this[_0x8eae('0x12')][_0x8eae('0x10')](this));this[_0x8eae('0xd')][_0x8eae('0x13')]();}util[_0x8eae('0x14')](EmailImap,EventEmitter);EmailImap[_0x8eae('0x15')][_0x8eae('0xc')]=function(_0x25ec5e,_0x5c7799){var _0x192208={'connTimeout':_0x25ec5e[_0x8eae('0x16')]?_0x25ec5e[_0x8eae('0x16')]*0x3e8:0x2710,'authTimeout':_0x25ec5e['authTimeout']?_0x25ec5e[_0x8eae('0x17')]*0x3e8:0x1388};if(_[_0x8eae('0x18')](_0x25ec5e[_0x8eae('0x19')])){if(_0x25ec5e[_0x8eae('0x1a')]){_0x192208[_0x8eae('0x1b')]=_0x25ec5e[_0x8eae('0x1b')];_0x192208[_0x8eae('0x1c')]=_0x25ec5e[_0x8eae('0x1c')];}_0x192208[_0x8eae('0x1d')]=_0x25ec5e['host'];_0x192208[_0x8eae('0x1e')]=_0x25ec5e[_0x8eae('0x1e')]||0x3e1;if(_0x25ec5e[_0x8eae('0x1f')]){_0x192208[_0x8eae('0x1f')]=!![];}else{_0x192208['tls']=![];_0x192208[_0x8eae('0x20')]='required';}}else{_0x192208[_0x8eae('0x1b')]=_0x25ec5e[_0x8eae('0x1b')];_0x192208[_0x8eae('0x1c')]=_0x25ec5e['password'];_0x192208[_0x8eae('0x1d')]=utils[_0x8eae('0x21')](_0x25ec5e[_0x8eae('0x19')]);_0x192208[_0x8eae('0x1e')]=0x3e1;_0x192208[_0x8eae('0x1f')]=!![];}_0x192208['email']=_0x5c7799||_0x25ec5e[_0x8eae('0x1b')]||_0x8eae('0x22');return _0x192208;};EmailImap['prototype'][_0x8eae('0x23')]=function(){this[_0x8eae('0xd')][_0x8eae('0x24')](this[_0x8eae('0xa')],![],this['handleOpenBox'][_0x8eae('0x10')](this));};EmailImap[_0x8eae('0x15')][_0x8eae('0x25')]=function(_0x41d419,_0x294119){if(_0x41d419){this['handleError'](_0x41d419,!![]);}else{this['emit'](_0x8eae('0x26'),_0x294119);this['readUnseen']();}};EmailImap[_0x8eae('0x15')]['handleCloseBox']=function(_0x5f3480){if(_0x5f3480){this['handleError'](_0x5f3480,!![]);}else{this[_0x8eae('0xd')][_0x8eae('0x11')]();}};EmailImap[_0x8eae('0x15')][_0x8eae('0x27')]=function(){this[_0x8eae('0xd')][_0x8eae('0x28')]([_0x8eae('0x29')],this[_0x8eae('0x2a')][_0x8eae('0x10')](this));};EmailImap['prototype'][_0x8eae('0x2a')]=function(_0x4e4087,_0x530451){if(_0x4e4087){this[_0x8eae('0x12')](_0x4e4087,!![]);}else{if(_0x530451['length']){try{var _0x7f185d=this[_0x8eae('0xd')]['fetch'](_0x530451,{'bodies':'','markSeen':!![]});_0x7f185d['on'](_0x8eae('0x2b'),this['handleFetchMessage']['bind'](this));_0x7f185d[_0x8eae('0xe')]('error',this[_0x8eae('0x2c')][_0x8eae('0x10')](this));_0x7f185d[_0x8eae('0xe')](_0x8eae('0x11'),this[_0x8eae('0x2d')]['bind'](this));}catch(_0x128537){logger[_0x8eae('0x2e')](_0x128537);}}else{this[_0x8eae('0xd')][_0x8eae('0x2f')](!![],this['handleCloseBox'][_0x8eae('0x10')](this));}}};EmailImap[_0x8eae('0x15')][_0x8eae('0x30')]=function(_0x1e2b5,_0x35aa03){_0x1e2b5['on']('body',this[_0x8eae('0x31')][_0x8eae('0x10')](this));_0x1e2b5['once']('attributes',this[_0x8eae('0x32')][_0x8eae('0x10')](this));_0x1e2b5['once'](_0x8eae('0x11'),this[_0x8eae('0x33')][_0x8eae('0x10')](this));};EmailImap[_0x8eae('0x15')]['handleMessageBody']=function(_0x3a29e1,_0xcf4453){simpleParser(_0x3a29e1,{'Iconv':Iconv},this[_0x8eae('0x34')][_0x8eae('0x10')](this));};EmailImap[_0x8eae('0x15')][_0x8eae('0x32')]=function(_0x4ebfbb){};EmailImap['prototype'][_0x8eae('0x33')]=function(){};EmailImap[_0x8eae('0x15')][_0x8eae('0x34')]=function(_0x132387,_0x45e71d){if(_0x132387){logger[_0x8eae('0x2e')](_0x132387);}else{var _0x499d6e=this;utils[_0x8eae('0x35')](this[_0x8eae('0xb')],_0x45e71d,function(_0x12a071){_0x499d6e['emit'](_0x8eae('0x9'),_0x12a071);});}};EmailImap[_0x8eae('0x15')]['handleFetchEnd']=function(){this[_0x8eae('0xd')]['closeBox'](!![],this[_0x8eae('0x36')][_0x8eae('0x10')](this));};EmailImap['prototype'][_0x8eae('0x2c')]=function(_0x36bd51){this[_0x8eae('0x12')](_0x36bd51);this[_0x8eae('0xd')]['closeBox'](!![],this[_0x8eae('0x36')][_0x8eae('0x10')](this));};EmailImap[_0x8eae('0x15')][_0x8eae('0x37')]=function(){this['emit'](_0x8eae('0x11'));};EmailImap[_0x8eae('0x15')][_0x8eae('0x12')]=function(_0x2f0f02,_0xb6fb23){logger[_0x8eae('0x2e')](_0x8eae('0x12'),this[_0x8eae('0xb')][_0x8eae('0x9')],JSON[_0x8eae('0x38')](_0x2f0f02));var _0x45e660='';if(_0x2f0f02){if(_0x2f0f02[_0x8eae('0x39')]){_0x45e660=_0x2f0f02[_0x8eae('0x39')];}else{for(var _0x291f3c in _0x2f0f02){if(_0x2f0f02[_0x8eae('0x3a')](_0x291f3c)){_0x45e660+=_[_0x8eae('0x3b')](_0x291f3c)+':\x20'+_0x2f0f02[_0x291f3c]+'\x0a';}}}}if(_0xb6fb23){this['imap']['end']();}else{this[_0x8eae('0x3c')](_0x8eae('0x2e'),_0x45e660);this[_0x8eae('0x3c')](_0x8eae('0x11'));}};module[_0x8eae('0x3d')]=EmailImap; \ No newline at end of file +var _0x41ab=['lodash','randomstring','mailparser','simpleParser','Iconv','EventEmitter','./utils','email','mailbox','INBOX','getAccount','once','ready','end','handleEnd','error','bind','connect','inherits','connTimeout','authTimeout','isNil','authentication','password','host','port','tls','autotls','required','user','getHost','service','anonymous@xcally.com','prototype','handleReady','openBox','handleOpenBox','handleError','emit','box','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','account','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap'];(function(_0x21e97f,_0x235867){var _0x270818=function(_0x2a73f7){while(--_0x2a73f7){_0x21e97f['push'](_0x21e97f['shift']());}};_0x270818(++_0x235867);}(_0x41ab,0xc0));var _0xb41a=function(_0x49ed0c,_0x2dff38){_0x49ed0c=_0x49ed0c-0x0;var _0x5b1bd2=_0x41ab[_0x49ed0c];return _0x5b1bd2;};'use strict';var fs=require('fs');var path=require(_0xb41a('0x0'));var util=require(_0xb41a('0x1'));var Imap=require(_0xb41a('0x2'));var _=require(_0xb41a('0x3'));var rs=require(_0xb41a('0x4'));var simpleParser=require(_0xb41a('0x5'))[_0xb41a('0x6')];var Iconv=require('iconv')[_0xb41a('0x7')];var EventEmitter=require('events')[_0xb41a('0x8')];var utils=require(_0xb41a('0x9'));var logger=require('../../../config/logger')(_0xb41a('0xa'));function EmailImap(_0x49f036,_0x4a1778){this[_0xb41a('0xb')]=_0xb41a('0xc');this['account']=this[_0xb41a('0xd')](_0x49f036,_0x4a1778);this[_0xb41a('0x2')]=new Imap(this['account']);this[_0xb41a('0x2')][_0xb41a('0xe')](_0xb41a('0xf'),this['handleReady']['bind'](this));this[_0xb41a('0x2')][_0xb41a('0xe')](_0xb41a('0x10'),this[_0xb41a('0x11')]['bind'](this));this[_0xb41a('0x2')]['on'](_0xb41a('0x12'),this['handleError'][_0xb41a('0x13')](this));this[_0xb41a('0x2')][_0xb41a('0x14')]();}util[_0xb41a('0x15')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x316ff5,_0x1711d7){var _0x368d24={'connTimeout':_0x316ff5[_0xb41a('0x16')]?_0x316ff5['connTimeout']*0x3e8:0x2710,'authTimeout':_0x316ff5['authTimeout']?_0x316ff5[_0xb41a('0x17')]*0x3e8:0x1388};if(_[_0xb41a('0x18')](_0x316ff5['service'])){if(_0x316ff5[_0xb41a('0x19')]){_0x368d24['user']=_0x316ff5['user'];_0x368d24[_0xb41a('0x1a')]=_0x316ff5[_0xb41a('0x1a')];}_0x368d24['host']=_0x316ff5[_0xb41a('0x1b')];_0x368d24[_0xb41a('0x1c')]=_0x316ff5[_0xb41a('0x1c')]||0x3e1;if(_0x316ff5[_0xb41a('0x1d')]){_0x368d24[_0xb41a('0x1d')]=!![];}else{_0x368d24[_0xb41a('0x1d')]=![];_0x368d24[_0xb41a('0x1e')]=_0xb41a('0x1f');}}else{_0x368d24[_0xb41a('0x20')]=_0x316ff5['user'];_0x368d24[_0xb41a('0x1a')]=_0x316ff5[_0xb41a('0x1a')];_0x368d24['host']=utils[_0xb41a('0x21')](_0x316ff5[_0xb41a('0x22')]);_0x368d24[_0xb41a('0x1c')]=0x3e1;_0x368d24[_0xb41a('0x1d')]=!![];}_0x368d24[_0xb41a('0xa')]=_0x1711d7||_0x316ff5[_0xb41a('0x20')]||_0xb41a('0x23');return _0x368d24;};EmailImap[_0xb41a('0x24')][_0xb41a('0x25')]=function(){this[_0xb41a('0x2')][_0xb41a('0x26')](this['mailbox'],![],this[_0xb41a('0x27')][_0xb41a('0x13')](this));};EmailImap[_0xb41a('0x24')][_0xb41a('0x27')]=function(_0x92afd8,_0x43b27b){if(_0x92afd8){this[_0xb41a('0x28')](_0x92afd8,!![]);}else{this[_0xb41a('0x29')](_0xb41a('0x2a'),_0x43b27b);this['readUnseen']();}};EmailImap[_0xb41a('0x24')][_0xb41a('0x2b')]=function(_0x40a427){if(_0x40a427){this[_0xb41a('0x28')](_0x40a427,!![]);}else{this[_0xb41a('0x2')][_0xb41a('0x10')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0xb41a('0x2')]['search']([_0xb41a('0x2c')],this['handleReadUnseen']['bind'](this));};EmailImap['prototype'][_0xb41a('0x2d')]=function(_0x1e3320,_0x5df9c0){if(_0x1e3320){this[_0xb41a('0x28')](_0x1e3320,!![]);}else{if(_0x5df9c0[_0xb41a('0x2e')]){try{var _0x3c1a92=this[_0xb41a('0x2')][_0xb41a('0x2f')](_0x5df9c0,{'bodies':'','markSeen':!![]});_0x3c1a92['on'](_0xb41a('0x30'),this[_0xb41a('0x31')]['bind'](this));_0x3c1a92[_0xb41a('0xe')](_0xb41a('0x12'),this['handleFetchError'][_0xb41a('0x13')](this));_0x3c1a92['once']('end',this[_0xb41a('0x32')][_0xb41a('0x13')](this));}catch(_0x121ba2){logger[_0xb41a('0x12')](_0x121ba2);}}else{this[_0xb41a('0x2')][_0xb41a('0x33')](!![],this[_0xb41a('0x2b')][_0xb41a('0x13')](this));}}};EmailImap[_0xb41a('0x24')]['handleFetchMessage']=function(_0x117782,_0x2f6e22){_0x117782['on'](_0xb41a('0x34'),this[_0xb41a('0x35')][_0xb41a('0x13')](this));_0x117782[_0xb41a('0xe')]('attributes',this[_0xb41a('0x36')][_0xb41a('0x13')](this));_0x117782['once'](_0xb41a('0x10'),this[_0xb41a('0x37')][_0xb41a('0x13')](this));};EmailImap[_0xb41a('0x24')][_0xb41a('0x35')]=function(_0x90d80f,_0xa3324){simpleParser(_0x90d80f,{'Iconv':Iconv},this[_0xb41a('0x38')][_0xb41a('0x13')](this));};EmailImap[_0xb41a('0x24')]['handleMessageAttributes']=function(_0x421cc9){};EmailImap[_0xb41a('0x24')][_0xb41a('0x37')]=function(){};EmailImap[_0xb41a('0x24')][_0xb41a('0x38')]=function(_0x993084,_0x415ad8){if(_0x993084){logger['error'](_0x993084);}else{var _0x556e42=this;utils[_0xb41a('0x39')](this[_0xb41a('0x3a')],_0x415ad8,function(_0x53cb84){_0x556e42['emit'](_0xb41a('0xa'),_0x53cb84);});}};EmailImap[_0xb41a('0x24')][_0xb41a('0x32')]=function(){this[_0xb41a('0x2')][_0xb41a('0x33')](!![],this[_0xb41a('0x2b')][_0xb41a('0x13')](this));};EmailImap[_0xb41a('0x24')][_0xb41a('0x3b')]=function(_0x357ed0){this['handleError'](_0x357ed0);this[_0xb41a('0x2')][_0xb41a('0x33')](!![],this[_0xb41a('0x2b')]['bind'](this));};EmailImap[_0xb41a('0x24')][_0xb41a('0x11')]=function(){this[_0xb41a('0x29')](_0xb41a('0x10'));};EmailImap[_0xb41a('0x24')]['handleError']=function(_0x47c619,_0x336aa7){logger['error'](_0xb41a('0x28'),this[_0xb41a('0x3a')][_0xb41a('0xa')],JSON[_0xb41a('0x3c')](_0x47c619));var _0x51a4ca='';if(_0x47c619){if(_0x47c619[_0xb41a('0x3d')]){_0x51a4ca=_0x47c619[_0xb41a('0x3d')];}else{for(var _0x402fd1 in _0x47c619){if(_0x47c619[_0xb41a('0x3e')](_0x402fd1)){_0x51a4ca+=_[_0xb41a('0x3f')](_0x402fd1)+':\x20'+_0x47c619[_0x402fd1]+'\x0a';}}}}if(_0x336aa7){this['imap'][_0xb41a('0x10')]();}else{this[_0xb41a('0x29')]('error',_0x51a4ca);this[_0xb41a('0x29')](_0xb41a('0x10'));}};module[_0xb41a('0x40')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index d5b0a92..ea33e37 100644 --- a/server/services/email/lib/smtp.js +++ b/server/services/email/lib/smtp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2411=['bluebird','prototype','createTransport','compile','sendMail','toString','verify','Not\x20verifired','exports'];(function(_0x149be5,_0x3acd7f){var _0x3ca5ef=function(_0x2c6a5c){while(--_0x2c6a5c){_0x149be5['push'](_0x149be5['shift']());}};_0x3ca5ef(++_0x3acd7f);}(_0x2411,0x6c));var _0x1241=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x2411[_0x585d81];return _0x1aca0d;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x1241('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x1241('0x1')]['send']=function(_0x2818b5,_0x5cc20f){return new BPromise(function(_0x425b66,_0x5a721a){var _0x246e96=nodemailer[_0x1241('0x2')](_0x2818b5);_0x246e96['use'](_0x1241('0x3'),inlineBase64());_0x246e96[_0x1241('0x4')](_0x5cc20f,function(_0x201323,_0x1bdb44){if(_0x201323){_0x5a721a(_0x201323[_0x1241('0x5')]());}else{_0x425b66(_0x1bdb44);}});});};EmailSmtp['prototype']['verify']=function(_0x29be23){return new BPromise(function(_0x5e389c,_0xb011f3){var _0x9e6d5e=nodemailer[_0x1241('0x2')](_0x29be23);_0x9e6d5e[_0x1241('0x6')](function(_0x4b6a5b,_0x45c5c4){if(_0x4b6a5b){_0xb011f3(_0x4b6a5b[_0x1241('0x5')]());}else{if(_0x45c5c4){_0x5e389c(_0x45c5c4);}else{_0xb011f3(_0x1241('0x7'));}}});});};module[_0x1241('0x8')]=EmailSmtp; \ No newline at end of file +var _0xb39b=['nodemailer-plugin-inline-base64','prototype','send','use','verify','createTransport','toString','Not\x20verifired','exports','nodemailer','bluebird'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb39b,0xae));var _0xbb39=function(_0x58bbc8,_0x51a04b){_0x58bbc8=_0x58bbc8-0x0;var _0x1e319a=_0xb39b[_0x58bbc8];return _0x1e319a;};'use strict';var nodemailer=require(_0xbb39('0x0'));var BPromise=require(_0xbb39('0x1'));var inlineBase64=require(_0xbb39('0x2'));function EmailSmtp(){}EmailSmtp[_0xbb39('0x3')][_0xbb39('0x4')]=function(_0x1c2419,_0x1f1fae){return new BPromise(function(_0x1de761,_0x57afdd){var _0x34bd11=nodemailer['createTransport'](_0x1c2419);_0x34bd11[_0xbb39('0x5')]('compile',inlineBase64());_0x34bd11['sendMail'](_0x1f1fae,function(_0x29f358,_0x2cac61){if(_0x29f358){_0x57afdd(_0x29f358['toString']());}else{_0x1de761(_0x2cac61);}});});};EmailSmtp[_0xbb39('0x3')][_0xbb39('0x6')]=function(_0xccfd61){return new BPromise(function(_0x48bf0e,_0x541c00){var _0x1bfce4=nodemailer[_0xbb39('0x7')](_0xccfd61);_0x1bfce4[_0xbb39('0x6')](function(_0x4db352,_0x4ad30e){if(_0x4db352){_0x541c00(_0x4db352[_0xbb39('0x8')]());}else{if(_0x4ad30e){_0x48bf0e(_0x4ad30e);}else{_0x541c00(_0xbb39('0x9'));}}});});};module[_0xbb39('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 7de8a18..609318a 100644 --- a/server/services/email/lib/utils.js +++ b/server/services/email/lib/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a6f=['writeFileSync','parser','from','subject','inReplyTo','date','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','content','BodyHTML','Attachments','push','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','moment','randomstring','path','util','node-tnef','../../../config/logger','email','address','generate','@xcally.com','value','name','split','length','slice','join','Anonymous','head','pop','html','replace','body','textAsHtml','0x1?_0x44f365[_0xf2a6('0x12')]():'';}return'';}function getMails(_0x13d3cc,_0x1665fc){var _0x17f707='';for(var _0x19d0a5=0x0;_0x19d0a5<_0x1665fc[_0xf2a6('0xa')]['length'];_0x19d0a5+=0x1){if(_0x1665fc['value'][_0x19d0a5]['address']!==_0x13d3cc){if(!_['isEmpty'](_0x17f707)){_0x17f707+=',';}_0x17f707+=_0x1665fc[_0xf2a6('0xa')][_0x19d0a5][_0xf2a6('0xb')]||_0x1665fc['value'][_0x19d0a5][_0xf2a6('0x7')]||'';_0x17f707+='\x20<';_0x17f707+=_0x1665fc['value'][_0x19d0a5][_0xf2a6('0x7')]?_0x1665fc[_0xf2a6('0xa')][_0x19d0a5][_0xf2a6('0x7')]:'anonymous'+random['generate'](0x6)+'@xcally.com';_0x17f707+='>';}}return _0x17f707;}function parseEmail(_0x47f321,_0xded4ca,_0x2afa67){if(_0xded4ca[_0xf2a6('0x13')]){var _0x4ff034=/)<[^<]*)*<\/script>/gi;while(_0x4ff034['test'](_0xded4ca[_0xf2a6('0x13')])){_0xded4ca['html']=_0xded4ca['html'][_0xf2a6('0x14')](_0x4ff034,'');}_0x2afa67[_0xf2a6('0x15')]=_0xded4ca[_0xf2a6('0x13')];}else{_0x2afa67[_0xf2a6('0x15')]=_0xded4ca[_0xf2a6('0x16')];}if(_0x2afa67[_0xf2a6('0x15')]){_0x2afa67[_0xf2a6('0x15')]=_0x2afa67[_0xf2a6('0x15')][_0xf2a6('0x14')](/Empty\x20message

';if(_0x23b9a7['Attachments']){for(var _0x516cdf=0x0;_0x516cdf<_0x23b9a7[_0xf2a6('0x36')][_0xf2a6('0xd')];_0x516cdf++){var _0x500e61=_0x23b9a7[_0xf2a6('0x36')][_0x516cdf];_0x2d9108[_0xf2a6('0x18')]['attachments'][_0xf2a6('0x37')]({'filename':_0x500e61[_0xf2a6('0x38')],'content':new Buffer(_0x500e61[_0xf2a6('0x39')])});}}}_0x351302(parseEmail(_0x42704a,_0x4e92de,_0x2d9108));});}else{_0x4e92de[_0xf2a6('0x13')]='

Empty\x20message

';_0x351302(parseEmail(_0x42704a,_0x4e92de,_0x2d9108));}}else{_0x351302(parseEmail(_0x42704a,_0x4e92de,_0x2d9108));}};exports[_0xf2a6('0x3a')]=function(_0xbc363d){switch(_0xbc363d){case _0xf2a6('0x3b'):return _0xf2a6('0x3c');case _0xf2a6('0x3d'):return _0xf2a6('0x3e');case _0xf2a6('0x3f'):return _0xf2a6('0x40');case'outlook365':return _0xf2a6('0x41');}return _0xf2a6('0x42');}; \ No newline at end of file +var _0xc98b=['textAsHtml','Empty\x20message

','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','join','Anonymous','pop','isEmpty','html','test','replace','body'];(function(_0x426fb9,_0x73b8ed){var _0x2d1760=function(_0x10d531){while(--_0x10d531){_0x426fb9['push'](_0x426fb9['shift']());}};_0x2d1760(++_0x73b8ed);}(_0xc98b,0xf9));var _0xbc98=function(_0x5bdb0d,_0x219b61){_0x5bdb0d=_0x5bdb0d-0x0;var _0x33982d=_0xc98b[_0x5bdb0d];return _0x33982d;};'use strict';var _=require(_0xbc98('0x0'));var moment=require(_0xbc98('0x1'));var random=require(_0xbc98('0x2'));var fs=require('fs');var path=require(_0xbc98('0x3'));var util=require(_0xbc98('0x4'));var tnef=require(_0xbc98('0x5'));var logger=require(_0xbc98('0x6'))(_0xbc98('0x7'));var config=require(_0xbc98('0x8'));function getAddress(_0x335204){var _0x2eb10e=_[_0xbc98('0x9')](_0x335204[_0xbc98('0xa')]);return _0x2eb10e&&_0x2eb10e[_0xbc98('0xb')]?_0x2eb10e[_0xbc98('0xb')]:_0xbc98('0xc')+random[_0xbc98('0xd')](0x6)+_0xbc98('0xe');}function getFirstName(_0x80d4d){var _0x448359=_['head'](_0x80d4d['value']);if(_0x448359&&_0x448359[_0xbc98('0xf')]){var _0x396b2e=_0x448359[_0xbc98('0xf')][_0xbc98('0x10')](/\s+/);return _0x396b2e[_0xbc98('0x11')]?_0x396b2e[_0xbc98('0x12')](0x0,-0x1)[_0xbc98('0x13')]('\x20'):_0x448359[_0xbc98('0xf')];}return _0xbc98('0x14');}function getLastName(_0x46cc12){var _0x112ef6=_[_0xbc98('0x9')](_0x46cc12['value']);if(_0x112ef6&&_0x112ef6[_0xbc98('0xf')]){var _0x386249=_0x112ef6[_0xbc98('0xf')][_0xbc98('0x10')](/\s+/);return _0x386249['length']>0x1?_0x386249[_0xbc98('0x15')]():'';}return'';}function getMails(_0x3c3a77,_0x4fd5ff){var _0x444d76='';for(var _0x5e01a4=0x0;_0x5e01a4<_0x4fd5ff[_0xbc98('0xa')][_0xbc98('0x11')];_0x5e01a4+=0x1){if(_0x4fd5ff[_0xbc98('0xa')][_0x5e01a4][_0xbc98('0xb')]!==_0x3c3a77){if(!_[_0xbc98('0x16')](_0x444d76)){_0x444d76+=',';}_0x444d76+=_0x4fd5ff[_0xbc98('0xa')][_0x5e01a4][_0xbc98('0xf')]||_0x4fd5ff[_0xbc98('0xa')][_0x5e01a4][_0xbc98('0xb')]||'';_0x444d76+='\x20<';_0x444d76+=_0x4fd5ff[_0xbc98('0xa')][_0x5e01a4][_0xbc98('0xb')]?_0x4fd5ff[_0xbc98('0xa')][_0x5e01a4]['address']:'anonymous'+random[_0xbc98('0xd')](0x6)+'@xcally.com';_0x444d76+='>';}}return _0x444d76;}function parseEmail(_0x186d0e,_0x3d6690,_0x56a8d0){if(_0x3d6690[_0xbc98('0x17')]){var _0x4b8908=/)<[^<]*)*<\/script>/gi;while(_0x4b8908[_0xbc98('0x18')](_0x3d6690[_0xbc98('0x17')])){_0x3d6690[_0xbc98('0x17')]=_0x3d6690['html'][_0xbc98('0x19')](_0x4b8908,'');}_0x56a8d0[_0xbc98('0x1a')]=_0x3d6690[_0xbc98('0x17')];}else{_0x56a8d0[_0xbc98('0x1a')]=_0x3d6690[_0xbc98('0x1b')];}if(_0x56a8d0[_0xbc98('0x1a')]){_0x56a8d0['body']=_0x56a8d0[_0xbc98('0x1a')]['replace'](/Empty\x20message

';if(_0x57c1bd[_0xbc98('0x3a')]){for(var _0x2a1384=0x0;_0x2a1384<_0x57c1bd[_0xbc98('0x3a')][_0xbc98('0x11')];_0x2a1384++){var _0xfb79a4=_0x57c1bd[_0xbc98('0x3a')][_0x2a1384];_0x14d9d3[_0xbc98('0x1d')][_0xbc98('0x21')]['push']({'filename':_0xfb79a4[_0xbc98('0x3b')],'content':new Buffer(_0xfb79a4['Data'])});}}}_0x5be0b2(parseEmail(_0x49dbc8,_0x127736,_0x14d9d3));});}else{_0x127736['html']=_0xbc98('0x3c');_0x5be0b2(parseEmail(_0x49dbc8,_0x127736,_0x14d9d3));}}else{_0x5be0b2(parseEmail(_0x49dbc8,_0x127736,_0x14d9d3));}};exports['getHost']=function(_0x1c1da8){switch(_0x1c1da8){case _0xbc98('0x3d'):return _0xbc98('0x3e');case _0xbc98('0x3f'):return _0xbc98('0x40');case _0xbc98('0x41'):return'imap-mail.outlook.com';case _0xbc98('0x42'):return _0xbc98('0x43');}return _0xbc98('0x44');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 043be1d..1f1e56c 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32ca=['name','Service','key','SERV','Imap','Smtp','exports','lodash'];(function(_0x9dca4c,_0xc09e49){var _0x4c8506=function(_0x8305bf){while(--_0x8305bf){_0x9dca4c['push'](_0x9dca4c['shift']());}};_0x4c8506(++_0xc09e49);}(_0x32ca,0x13f));var _0xa32c=function(_0x590a94,_0x61e61){_0x590a94=_0x590a94-0x0;var _0x865e8=_0x32ca[_0x590a94];return _0x865e8;};'use strict';var _=require(_0xa32c('0x0'));function MailAccount(_0x1f33de){this['id']=_0x1f33de['id']||0x0;this[_0xa32c('0x1')]=_0x1f33de['name']||_0xa32c('0x2');this['key']=_0x1f33de[_0xa32c('0x3')]||_0xa32c('0x4');this['active']=_0x1f33de['active']||![];this['Imap']=_0x1f33de[_0xa32c('0x5')]||[];this[_0xa32c('0x6')]=_0x1f33de['Smtp']||[];}module[_0xa32c('0x7')]=MailAccount; \ No newline at end of file +var _0x2d58=['Service','key','SERV','active','Imap','Smtp','name'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x2d58,0xd8));var _0x82d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2d58[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');function MailAccount(_0x44022e){this['id']=_0x44022e['id']||0x0;this[_0x82d5('0x0')]=_0x44022e[_0x82d5('0x0')]||_0x82d5('0x1');this[_0x82d5('0x2')]=_0x44022e['key']||_0x82d5('0x3');this[_0x82d5('0x4')]=_0x44022e[_0x82d5('0x4')]||![];this[_0x82d5('0x5')]=_0x44022e[_0x82d5('0x5')]||[];this['Smtp']=_0x44022e[_0x82d5('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index a1f1803..5f034e8 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e59=['hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x3e47f3,_0x3f6914){var _0x508f2e=function(_0x3d5b43){while(--_0x3d5b43){_0x3e47f3['push'](_0x3e47f3['shift']());}};_0x508f2e(++_0x3f6914);}(_0x4e59,0x80));var _0x94e5=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4e59[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x94e5('0x0'));var MailAccount=require(_0x94e5('0x1'));var Realtime=function(){this[_0x94e5('0x2')]={};};function freeIsNotKey(_0xeddac2,_0x584db6,_0x52f6f1){var _0x5237f6=_[_0x94e5('0x3')](_0xeddac2,function(_0x126bf5,_0x3df150){return _0x126bf5[_0x52f6f1];});for(var _0xe64418 in _0x584db6){if(_0x584db6[_0x94e5('0x4')](_0xe64418)){if(!_0x5237f6[_0xe64418]){delete _0x584db6[_0xe64418];}}}}Realtime['prototype'][_0x94e5('0x5')]=function(_0x23a7ae,_0x1e195e){for(var _0x5b85fd in _0x1e195e){if(_0x23a7ae['hasOwnProperty'](_0x5b85fd)){_0x23a7ae[_0x5b85fd]=_0x1e195e[_0x5b85fd];}}};Realtime[_0x94e5('0x6')][_0x94e5('0x7')]=function(){var _0x2efccb=this;return function(_0x16e6d5){if(_0x16e6d5){freeIsNotKey(_0x16e6d5,_0x2efccb[_0x94e5('0x2')],'id');for(var _0x5726a9=0x0,_0x586985={},_0x3674bb={};_0x5726a9<_0x16e6d5[_0x94e5('0x8')];_0x5726a9+=0x1){_0x586985=_0x16e6d5[_0x5726a9];if(_[_0x94e5('0x9')](_0x2efccb[_0x94e5('0x2')][_0x586985['id']])){_0x2efccb[_0x94e5('0x2')][_0x586985['id']]=new MailAccount(_0x586985);}else{_[_0x94e5('0xa')](_0x2efccb['mailAccounts'][_0x586985['id']],_0x586985);}}}return _0x2efccb['mailAccounts'];};};module[_0x94e5('0xb')]=Realtime; \ No newline at end of file +var _0xa590=['mapKeys','hasOwnProperty','prototype','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x13ab7f,_0x47efaf){var _0x151cb9=function(_0x19aabe){while(--_0x19aabe){_0x13ab7f['push'](_0x13ab7f['shift']());}};_0x151cb9(++_0x47efaf);}(_0xa590,0x1aa));var _0x0a59=function(_0x361d3f,_0x3be2aa){_0x361d3f=_0x361d3f-0x0;var _0x320229=_0xa590[_0x361d3f];return _0x320229;};'use strict';var _=require(_0x0a59('0x0'));var MailAccount=require(_0x0a59('0x1'));var Realtime=function(){this[_0x0a59('0x2')]={};};function freeIsNotKey(_0x5a2ea7,_0x3c6fe6,_0x1688f0){var _0x876eaa=_[_0x0a59('0x3')](_0x5a2ea7,function(_0x3166a0,_0x8270c5){return _0x3166a0[_0x1688f0];});for(var _0x5b9166 in _0x3c6fe6){if(_0x3c6fe6[_0x0a59('0x4')](_0x5b9166)){if(!_0x876eaa[_0x5b9166]){delete _0x3c6fe6[_0x5b9166];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x6d95fc,_0x3bc65f){for(var _0x51efbf in _0x3bc65f){if(_0x6d95fc[_0x0a59('0x4')](_0x51efbf)){_0x6d95fc[_0x51efbf]=_0x3bc65f[_0x51efbf];}}};Realtime[_0x0a59('0x5')][_0x0a59('0x6')]=function(){var _0x337d60=this;return function(_0x5a5959){if(_0x5a5959){freeIsNotKey(_0x5a5959,_0x337d60[_0x0a59('0x2')],'id');for(var _0x5e5afe=0x0,_0x591031={},_0xe1cc3d={};_0x5e5afe<_0x5a5959[_0x0a59('0x7')];_0x5e5afe+=0x1){_0x591031=_0x5a5959[_0x5e5afe];if(_[_0x0a59('0x8')](_0x337d60[_0x0a59('0x2')][_0x591031['id']])){_0x337d60[_0x0a59('0x2')][_0x591031['id']]=new MailAccount(_0x591031);}else{_[_0x0a59('0x9')](_0x337d60[_0x0a59('0x2')][_0x591031['id']],_0x591031);}}}return _0x337d60[_0x0a59('0x2')];};};module[_0x0a59('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 0cf3a4b..0033099 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf611=['notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','active','ListId','TemplateId','MailServerOut','Smtp','getMailAccount'];(function(_0x579328,_0x142394){var _0x46706a=function(_0xb704df){while(--_0xb704df){_0x579328['push'](_0x579328['shift']());}};_0x46706a(++_0x142394);}(_0xf611,0x7b));var _0x1f61=function(_0x206adf,_0x2ba1a3){_0x206adf=_0x206adf-0x0;var _0x171caa=_0xf611[_0x206adf];return _0x171caa;};'use strict';var client=require('../client');exports[_0x1f61('0x0')]=function(){return function(){return client[_0x1f61('0x1')](_0x1f61('0x2'),{'options':{'attributes':['id','name','service','email',_0x1f61('0x3'),'key',_0x1f61('0x4'),_0x1f61('0x5')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap'},{'model':_0x1f61('0x6'),'as':_0x1f61('0x7')}]},'log':_0x1f61('0x8')});};};exports[_0x1f61('0x9')]=function(_0x5b2e5b,_0x2d3aeb){return client[_0x1f61('0x1')](_0x1f61('0xa'),{'account':{'id':_0x5b2e5b},'body':_0x2d3aeb,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xc9b0=['active','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','getMailAccount','notify','../client','getMailAccounts','Request','GetMailAccount','name','service','email'];(function(_0x45d56b,_0x3b99e4){var _0xd62e37=function(_0x12f150){while(--_0x12f150){_0x45d56b['push'](_0x45d56b['shift']());}};_0xd62e37(++_0x3b99e4);}(_0xc9b0,0x143));var _0x0c9b=function(_0x42ac65,_0x28c4d5){_0x42ac65=_0x42ac65-0x0;var _0x5999c1=_0xc9b0[_0x42ac65];return _0x5999c1;};'use strict';var client=require(_0x0c9b('0x0'));exports[_0x0c9b('0x1')]=function(){return function(){return client[_0x0c9b('0x2')](_0x0c9b('0x3'),{'options':{'attributes':['id',_0x0c9b('0x4'),_0x0c9b('0x5'),_0x0c9b('0x6'),_0x0c9b('0x7'),'key','ListId',_0x0c9b('0x8')],'raw':![],'include':[{'model':_0x0c9b('0x9'),'as':_0x0c9b('0xa')},{'model':_0x0c9b('0xb'),'as':_0x0c9b('0xc')}]},'log':_0x0c9b('0xd')});};};exports[_0x0c9b('0xe')]=function(_0x44bcd5,_0x170820){return client['Request']('NotifyMailAccount',{'account':{'id':_0x44bcd5},'body':_0x170820,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 2238c91..39791ec 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc713=['mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','../../../config/logger','email','listen','account','message','then','catch','error','verifySmtp','Verified'];(function(_0x50b1f4,_0x5a8067){var _0x56e492=function(_0x31c7ce){while(--_0x31c7ce){_0x50b1f4['push'](_0x50b1f4['shift']());}};_0x56e492(++_0x5a8067);}(_0xc713,0x1cf));var _0x3c71=function(_0x412b4a,_0x14e258){_0x412b4a=_0x412b4a-0x0;var _0x3b2ee8=_0xc713[_0x412b4a];return _0x3b2ee8;};'use strict';var jayson=require(_0x3c71('0x0'));var BPromise=require(_0x3c71('0x1'));var _=require('lodash');var logger=require(_0x3c71('0x2'))(_0x3c71('0x3'));exports[_0x3c71('0x4')]=function(_0x10b7b9,_0x42d778){return new BPromise(function(_0x3abd6c,_0x1b45e5){var _0x1e32a4={'SendMail':function(_0x4750a6){var _0x218f7f=this;return new Promise(function(_0x1a4cab,_0x3f4fba){_0x42d778['sendMail'](_0x4750a6[_0x3c71('0x5')],_0x4750a6[_0x3c71('0x6')])[_0x3c71('0x7')](function(_0xd89856){_0x1a4cab({'code':0xc8,'message':_0xd89856});})[_0x3c71('0x8')](function(_0x5753d5){_0x3f4fba(_0x218f7f[_0x3c71('0x9')](0x1f4,_0x5753d5));});});},'VerifySmtp':function(_0x37350c){var _0x290267=this;return new Promise(function(_0x430095,_0x42c3f1){_0x42d778[_0x3c71('0xa')](_0x37350c['account'])[_0x3c71('0x7')](function(_0x2ee6e6){_0x430095({'code':0xc8,'message':_0x3c71('0xb')});})[_0x3c71('0x8')](function(_0x2454b0){_0x42c3f1(_0x290267[_0x3c71('0x9')](0x1f4,_0x2454b0));});});},'MailAccounts':function(_0x29cbd6){return new Promise(function(_0x74dab7,_0x358193){var _0x417b74=_['values'](_0x10b7b9[_0x3c71('0xc')]);for(var _0x322798=0x0;_0x322798<_0x417b74[_0x3c71('0xd')];_0x322798+=0x1){if(_0x417b74[_0x322798]['Imap']&&_0x417b74[_0x322798][_0x3c71('0xe')][_0x3c71('0xf')]){delete _0x417b74[_0x322798][_0x3c71('0xe')][_0x3c71('0xf')];}if(_0x417b74[_0x322798][_0x3c71('0x10')]&&_0x417b74[_0x322798][_0x3c71('0x10')]['pass']){delete _0x417b74[_0x322798]['Smtp'][_0x3c71('0x11')];}}_0x74dab7({'count':_0x417b74[_0x3c71('0xd')],'rows':_0x417b74});});}};var _0x4c5dea=jayson[_0x3c71('0x12')](_0x1e32a4)[_0x3c71('0x13')]();_0x4c5dea['on'](_0x3c71('0x9'),function(_0x336fe0){logger[_0x3c71('0x9')](JSON[_0x3c71('0x14')](_0x336fe0));return _0x1b45e5(_0x336fe0);});_0x4c5dea[_0x3c71('0x4')](0x232b,_0x3c71('0x15'),function(){console[_0x3c71('0x16')](_0x3c71('0x17'),0x232b);return _0x3abd6c(_0x3c71('0x18')+0x232b);});});}; \ No newline at end of file +var _0x5b97=['then','catch','verifySmtp','error','values','mailAccounts','length','Imap','Smtp','pass','server','http','stringify','listen','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','email','sendMail','account','message'];(function(_0x5f41f5,_0x52a50e){var _0x26bf5f=function(_0x21ccb3){while(--_0x21ccb3){_0x5f41f5['push'](_0x5f41f5['shift']());}};_0x26bf5f(++_0x52a50e);}(_0x5b97,0xf3));var _0x75b9=function(_0x305b20,_0x5e57e9){_0x305b20=_0x305b20-0x0;var _0x26d64a=_0x5b97[_0x305b20];return _0x26d64a;};'use strict';var jayson=require(_0x75b9('0x0'));var BPromise=require(_0x75b9('0x1'));var _=require(_0x75b9('0x2'));var logger=require('../../../config/logger')(_0x75b9('0x3'));exports['listen']=function(_0x5954f3,_0x498218){return new BPromise(function(_0x2f6ad9,_0x1262cc){var _0x2a5f07={'SendMail':function(_0x37d69f){var _0x23178e=this;return new Promise(function(_0x2111e4,_0x44bb41){_0x498218[_0x75b9('0x4')](_0x37d69f[_0x75b9('0x5')],_0x37d69f[_0x75b9('0x6')])[_0x75b9('0x7')](function(_0x48af11){_0x2111e4({'code':0xc8,'message':_0x48af11});})[_0x75b9('0x8')](function(_0x1453b1){_0x44bb41(_0x23178e['error'](0x1f4,_0x1453b1));});});},'VerifySmtp':function(_0x49047e){var _0x2edfbb=this;return new Promise(function(_0x1565ef,_0x30809d){_0x498218[_0x75b9('0x9')](_0x49047e[_0x75b9('0x5')])[_0x75b9('0x7')](function(_0x1ced4b){_0x1565ef({'code':0xc8,'message':'Verified'});})[_0x75b9('0x8')](function(_0xfde71d){_0x30809d(_0x2edfbb[_0x75b9('0xa')](0x1f4,_0xfde71d));});});},'MailAccounts':function(_0x137417){return new Promise(function(_0x179575,_0x52b0e4){var _0x55d4d5=_[_0x75b9('0xb')](_0x5954f3[_0x75b9('0xc')]);for(var _0x4fac0c=0x0;_0x4fac0c<_0x55d4d5[_0x75b9('0xd')];_0x4fac0c+=0x1){if(_0x55d4d5[_0x4fac0c]['Imap']&&_0x55d4d5[_0x4fac0c][_0x75b9('0xe')]['password']){delete _0x55d4d5[_0x4fac0c]['Imap']['password'];}if(_0x55d4d5[_0x4fac0c][_0x75b9('0xf')]&&_0x55d4d5[_0x4fac0c][_0x75b9('0xf')]['pass']){delete _0x55d4d5[_0x4fac0c]['Smtp'][_0x75b9('0x10')];}}_0x179575({'count':_0x55d4d5[_0x75b9('0xd')],'rows':_0x55d4d5});});}};var _0x6f2591=jayson[_0x75b9('0x11')](_0x2a5f07)[_0x75b9('0x12')]();_0x6f2591['on'](_0x75b9('0xa'),function(_0x6f5ea2){logger['error'](JSON[_0x75b9('0x13')](_0x6f5ea2));return _0x1262cc(_0x6f5ea2);});_0x6f2591[_0x75b9('0x14')](0x232b,_0x75b9('0x15'),function(){console[_0x75b9('0x16')](_0x75b9('0x17'),0x232b);return _0x2f6ad9(_0x75b9('0x18')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 27bb6a0..7215033 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6654=['sticky-session','ioredis','../../config/environment','timeout','listen','port','socket.io','websocket','polling','defaults','localhost','adapter','redis','../../config/triggers','../../config/socketio','../../config/express','default','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express'];(function(_0xd8528a,_0x63337a){var _0x12cfe5=function(_0x297ef1){while(--_0x297ef1){_0xd8528a['push'](_0xd8528a['shift']());}};_0x12cfe5(++_0x63337a);}(_0x6654,0x1b7));var _0x4665=function(_0x4b9bcd,_0x1bdc36){_0x4b9bcd=_0x4b9bcd-0x0;var _0xaa4780=_0x6654[_0x4b9bcd];return _0xaa4780;};'use strict';var _=require(_0x4665('0x0'));var http=require(_0x4665('0x1'));var express=require(_0x4665('0x2'));var sticky=require(_0x4665('0x3'));var Redis=require(_0x4665('0x4'));var config=require(_0x4665('0x5'));var app=express();var server=http['createServer'](app);server[_0x4665('0x6')]=0xdbba0;if(sticky[_0x4665('0x7')](server,config[_0x4665('0x8')])){var socketio=require(_0x4665('0x9'))(server,{'transports':[_0x4665('0xa'),_0x4665('0xb')]});config['redis']=_[_0x4665('0xc')](config['redis'],{'host':_0x4665('0xd'),'port':0x18eb});socketio[_0x4665('0xe')](require('socket.io-redis')({'pubClient':new Redis(config[_0x4665('0xf')]),'subClient':new Redis(config[_0x4665('0xf')])}));require(_0x4665('0x10'))['default']();require(_0x4665('0x11'))['default'](socketio);require(_0x4665('0x12'))[_0x4665('0x13')](app);require(_0x4665('0x14'))[_0x4665('0x13')](app);}else{server[_0x4665('0x15')](_0x4665('0x16'),function(){console[_0x4665('0x17')](_0x4665('0x18'),config[_0x4665('0x8')]);});}exports=module[_0x4665('0x19')]=app; \ No newline at end of file +var _0xd55e=['http','express','sticky-session','ioredis','createServer','timeout','listen','port','socket.io','polling','redis','defaults','adapter','socket.io-redis','../../config/socketio','default','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports'];(function(_0x83b11b,_0xf193c2){var _0x28c043=function(_0x877f23){while(--_0x877f23){_0x83b11b['push'](_0x83b11b['shift']());}};_0x28c043(++_0xf193c2);}(_0xd55e,0x7e));var _0xed55=function(_0x31f6ac,_0x56d3eb){_0x31f6ac=_0x31f6ac-0x0;var _0x19cdc7=_0xd55e[_0x31f6ac];return _0x19cdc7;};'use strict';var _=require('lodash');var http=require(_0xed55('0x0'));var express=require(_0xed55('0x1'));var sticky=require(_0xed55('0x2'));var Redis=require(_0xed55('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0xed55('0x4')](app);server[_0xed55('0x5')]=0xdbba0;if(sticky[_0xed55('0x6')](server,config[_0xed55('0x7')])){var socketio=require(_0xed55('0x8'))(server,{'transports':['websocket',_0xed55('0x9')]});config[_0xed55('0xa')]=_[_0xed55('0xb')](config[_0xed55('0xa')],{'host':'localhost','port':0x18eb});socketio[_0xed55('0xc')](require(_0xed55('0xd'))({'pubClient':new Redis(config[_0xed55('0xa')]),'subClient':new Redis(config[_0xed55('0xa')])}));require('../../config/triggers')['default']();require(_0xed55('0xe'))[_0xed55('0xf')](socketio);require('../../config/express')['default'](app);require('../../routes')['default'](app);}else{server[_0xed55('0x10')](_0xed55('0x11'),function(){console[_0xed55('0x12')](_0xed55('0x13'),config[_0xed55('0x7')]);});}exports=module[_0xed55('0x14')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 91a83bb..92f31fc 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb91a=['result','catch','rpc','exports','jayson/promise','bluebird','../../config/logger','http','Request','request','then','debug','routing','error','message'];(function(_0x108f9a,_0x29b504){var _0x1010e1=function(_0xd98bd6){while(--_0xd98bd6){_0x108f9a['push'](_0x108f9a['shift']());}};_0x1010e1(++_0x29b504);}(_0xb91a,0xf4));var _0xab91=function(_0x21c6a1,_0x53a105){_0x21c6a1=_0x21c6a1-0x0;var _0x3a62b9=_0xb91a[_0x21c6a1];return _0x3a62b9;};'use strict';var jayson=require(_0xab91('0x0'));var BPromise=require(_0xab91('0x1'));var logger=require(_0xab91('0x2'))('routing');var client=jayson['client'][_0xab91('0x3')]({'port':0x2329});client[_0xab91('0x4')]=function(_0xb312db,_0x439eb2){return new BPromise(function(_0x1afca9,_0x30e4ce){return client[_0xab91('0x5')](_0xb312db,_0x439eb2)[_0xab91('0x6')](function(_0x290af9){logger[_0xab91('0x7')]('rpc',_0xab91('0x8'),_0xb312db,_0x439eb2,_0x290af9);if(_0x290af9[_0xab91('0x9')]){logger['error']('rpc','routing',_0xb312db,_0x290af9[_0xab91('0x9')][_0xab91('0xa')],_0x439eb2);return _0x30e4ce(_0x290af9[_0xab91('0x9')][_0xab91('0xa')]);}else{return _0x1afca9(_0x290af9[_0xab91('0xb')]);}})[_0xab91('0xc')](function(_0x982ce9){logger[_0xab91('0x9')](_0xab91('0xd'),_0xab91('0x8'),_0xb312db,_0x982ce9,_0x439eb2);return _0x30e4ce(_0x982ce9);});});};module[_0xab91('0xe')]=client; \ No newline at end of file +var _0xd82a=['then','debug','rpc','error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing','http','request'];(function(_0x2f6501,_0x1aeac8){var _0x1077a9=function(_0x54d75e){while(--_0x54d75e){_0x2f6501['push'](_0x2f6501['shift']());}};_0x1077a9(++_0x1aeac8);}(_0xd82a,0xbd));var _0xad82=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xd82a[_0xc8a931];return _0x28bd27;};'use strict';var jayson=require(_0xad82('0x0'));var BPromise=require(_0xad82('0x1'));var logger=require(_0xad82('0x2'))(_0xad82('0x3'));var client=jayson['client'][_0xad82('0x4')]({'port':0x2329});client['Request']=function(_0x17cf59,_0x3a0a37){return new BPromise(function(_0x40b3d6,_0x43a596){return client[_0xad82('0x5')](_0x17cf59,_0x3a0a37)[_0xad82('0x6')](function(_0x343d52){logger[_0xad82('0x7')](_0xad82('0x8'),_0xad82('0x3'),_0x17cf59,_0x3a0a37,_0x343d52);if(_0x343d52['error']){logger[_0xad82('0x9')](_0xad82('0x8'),_0xad82('0x3'),_0x17cf59,_0x343d52[_0xad82('0x9')][_0xad82('0xa')],_0x3a0a37);return _0x43a596(_0x343d52[_0xad82('0x9')][_0xad82('0xa')]);}else{return _0x40b3d6(_0x343d52[_0xad82('0xb')]);}})[_0xad82('0xc')](function(_0x1e3aa4){logger[_0xad82('0x9')](_0xad82('0x8'),_0xad82('0x3'),_0x17cf59,_0x1e3aa4,_0x3a0a37);return _0x43a596(_0x1e3aa4);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 34a8679..364d336 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4e3=['./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','then','initAgents','initIntervals','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','initFaxQueues','listen','catch','bluebird'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0xd4e3,0x13f));var _0x3d4e=function(_0x2c7341,_0x293a18){_0x2c7341=_0x2c7341-0x0;var _0x23f3fc=_0xd4e3[_0x2c7341];return _0x23f3fc;};'use strict';var BPromise=require(_0x3d4e('0x0'));var server=require(_0x3d4e('0x1'));var Realtime=require(_0x3d4e('0x2'));var user=require('./rpc/user');var interval=require(_0x3d4e('0x3'));var openchannelQueue=require(_0x3d4e('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x3d4e('0x5'));var mailQueue=require(_0x3d4e('0x6'));var faxQueue=require(_0x3d4e('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x3d4e('0x8')](user['getAgents']())[_0x3d4e('0x8')](realtime[_0x3d4e('0x9')]())[_0x3d4e('0x8')](interval['getIntervals']())[_0x3d4e('0x8')](realtime[_0x3d4e('0xa')]())[_0x3d4e('0x8')](openchannelQueue['getOpenchannelQueues']())[_0x3d4e('0x8')](realtime[_0x3d4e('0xb')]())[_0x3d4e('0x8')](chatQueue['getChatQueues']())['then'](realtime[_0x3d4e('0xc')]())[_0x3d4e('0x8')](smsQueue[_0x3d4e('0xd')]())[_0x3d4e('0x8')](realtime[_0x3d4e('0xe')]())[_0x3d4e('0x8')](mailQueue[_0x3d4e('0xf')]())['then'](realtime[_0x3d4e('0x10')]())[_0x3d4e('0x8')](faxQueue['getFaxQueues']())[_0x3d4e('0x8')](realtime[_0x3d4e('0x11')]())[_0x3d4e('0x8')](function(){return realtime;});}function main(){return server[_0x3d4e('0x12')](realtime)[_0x3d4e('0x8')](function(_0xd17fb7){return initRealtime();})[_0x3d4e('0x8')](function(_0x28d4d2){return setInterval(initRealtime,0x1388);})[_0x3d4e('0x13')](function(_0x1c3609){console['log'](_0x1c3609);});}main(); \ No newline at end of file +var _0x4d92=['log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','resolve','then','initAgents','getIntervals','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','catch'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0x4d92,0x135));var _0x24d9=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0x4d92[_0x117f4c];return _0x2b24e9;};'use strict';var BPromise=require(_0x24d9('0x0'));var server=require(_0x24d9('0x1'));var Realtime=require(_0x24d9('0x2'));var user=require(_0x24d9('0x3'));var interval=require(_0x24d9('0x4'));var openchannelQueue=require(_0x24d9('0x5'));var chatQueue=require(_0x24d9('0x6'));var smsQueue=require(_0x24d9('0x7'));var mailQueue=require(_0x24d9('0x8'));var faxQueue=require('./rpc/faxQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x24d9('0x9')]()[_0x24d9('0xa')](user['getAgents']())['then'](realtime[_0x24d9('0xb')]())['then'](interval[_0x24d9('0xc')]())[_0x24d9('0xa')](realtime['initIntervals']())[_0x24d9('0xa')](openchannelQueue['getOpenchannelQueues']())[_0x24d9('0xa')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x24d9('0xd')]())[_0x24d9('0xa')](realtime[_0x24d9('0xe')]())['then'](smsQueue['getSmsQueues']())[_0x24d9('0xa')](realtime[_0x24d9('0xf')]())[_0x24d9('0xa')](mailQueue[_0x24d9('0x10')]())[_0x24d9('0xa')](realtime[_0x24d9('0x11')]())[_0x24d9('0xa')](faxQueue[_0x24d9('0x12')]())['then'](realtime[_0x24d9('0x13')]())[_0x24d9('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x24d9('0xa')](function(_0x182ecc){return initRealtime();})[_0x24d9('0xa')](function(_0x36caad){return setInterval(initRealtime,0x1388);})[_0x24d9('0x14')](function(_0x16898b){console[_0x24d9('0x15')](_0x16898b);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index ed0f566..13a0654 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcbd=['isNil','ignoreFactChanges','inherits','rules','activeRules','isArray','concat','isObject','push','sync','prototype','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','nextTick','call','next','isEqual','restart','condition','matchPath','findRules','matches','turn','prioritize','length','map','toString','fromJSON','parse','register','exports','lodash','util','events','EventEmitter','init'];(function(_0x206945,_0x1a23a8){var _0x9a5d88=function(_0x562461){while(--_0x562461){_0x206945['push'](_0x206945['shift']());}};_0x9a5d88(++_0x1a23a8);}(_0xfcbd,0xfd));var _0xdfcb=function(_0x197d9a,_0x9c38c4){_0x197d9a=_0x197d9a-0x0;var _0x1b4b1b=_0xfcbd[_0x197d9a];return _0x1b4b1b;};'use strict';var _=require(_0xdfcb('0x0'));var util=require(_0xdfcb('0x1'));var EventEmitter=require(_0xdfcb('0x2'))[_0xdfcb('0x3')];function RuleEngine(_0xb0188f,_0x1fea31){this[_0xdfcb('0x4')]();if(!_[_0xdfcb('0x5')](_0xb0188f)){this['register'](_0xb0188f);}if(_0x1fea31){this[_0xdfcb('0x6')]=_0x1fea31[_0xdfcb('0x6')];}return this;}util[_0xdfcb('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0xdfcb('0x4')]=function(_0x2cc50e){this[_0xdfcb('0x8')]=[];this[_0xdfcb('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1025a9){if(Array[_0xdfcb('0xa')](_0x1025a9)){this['rules']=this[_0xdfcb('0x8')][_0xdfcb('0xb')](_0x1025a9);}else if(_0x1025a9!==null&&_[_0xdfcb('0xc')](_0x1025a9)){this[_0xdfcb('0x8')][_0xdfcb('0xd')](_0x1025a9);}this[_0xdfcb('0xe')]();};RuleEngine[_0xdfcb('0xf')][_0xdfcb('0xe')]=function(){this[_0xdfcb('0x9')]=this[_0xdfcb('0x8')][_0xdfcb('0x10')](function(_0x3b1be7){if(_['isNil'](_0x3b1be7['on'])){_0x3b1be7['on']=!![];}if(_0x3b1be7['on']===!![]){return _0x3b1be7;}});this[_0xdfcb('0x9')]=_[_0xdfcb('0x11')](this[_0xdfcb('0x9')],['p'],[_0xdfcb('0x12')]);};RuleEngine[_0xdfcb('0xf')][_0xdfcb('0x13')]=function(_0x4670ce,_0x2a1133){var _0x4791b2=![];_0x4670ce[_0xdfcb('0x14')]=!![];var _0x2ea9df=_[_0xdfcb('0x15')](_0x4670ce);var _0x23c879=_[_0xdfcb('0x15')](_0x4670ce);var _0x3dac8f=this[_0xdfcb('0x9')];var _0x4f3205=[];var _0x12c755=this[_0xdfcb('0x6')];(function FnRuleLoop(_0x2c1091){var _0x1a908e={'rules':function(){return _0x3dac8f;},'rule':function(){return _0x3dac8f[_0x2c1091];},'when':function(_0x36da2f){if(_0x36da2f){var _0x5068bb=_0x3dac8f[_0x2c1091][_0xdfcb('0x16')];_0x5068bb[_0xdfcb('0x17')]=_0x3dac8f[_0x2c1091]['id']||_0x3dac8f[_0x2c1091][_0xdfcb('0x18')]||'index_'+_0x2c1091;process[_0xdfcb('0x19')](function(){_0x4f3205[_0xdfcb('0xd')](_0x5068bb[_0xdfcb('0x17')]);_0x5068bb[_0xdfcb('0x1a')](_0x2ea9df,_0x1a908e);});}else{process[_0xdfcb('0x19')](function(){_0x1a908e[_0xdfcb('0x1b')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x4791b2=!![];return FnRuleLoop(0x0);},'next':function(_0x5ef59e){if(!_0x12c755&&!_[_0xdfcb('0x1c')](_0x23c879,_0x2ea9df)){_0x23c879=_[_0xdfcb('0x15')](_0x2ea9df);process[_0xdfcb('0x19')](function(){_0x1a908e[_0xdfcb('0x1d')]();});}else{process[_0xdfcb('0x19')](function(){if(_[_0xdfcb('0x5')](_0x5ef59e)){return FnRuleLoop(_0x2c1091+0x1);}else{return FnRuleLoop(_0x5ef59e);}});}}};if(_0x2c1091<_0x3dac8f['length']&&_0x4791b2===![]){var _0x567bf9=_0x3dac8f[_0x2c1091][_0xdfcb('0x1e')];_0x567bf9['call'](_0x2ea9df,_0x1a908e);}else{process[_0xdfcb('0x19')](function(){_0x2ea9df[_0xdfcb('0x1f')]=_0x4f3205;return _0x2a1133?_0x2a1133(_0x2ea9df):_['noop']();});}}(0x0));};RuleEngine[_0xdfcb('0xf')][_0xdfcb('0x20')]=function(_0x3052c7){if(_[_0xdfcb('0x5')](_0x3052c7)){return this[_0xdfcb('0x8')];}else{var _0x113349=_[_0xdfcb('0x21')](_0x3052c7);return _[_0xdfcb('0x10')](this[_0xdfcb('0x8')],_0x113349);}};RuleEngine[_0xdfcb('0xf')][_0xdfcb('0x22')]=function(_0x174754,_0x9682){var _0x174754=_0x174754==='on'||_0x174754==='ON'?!![]:![];var _0x1545ce=this[_0xdfcb('0x20')](_0x9682);for(var _0x1f8d37=0x0,_0x235b42=_0x1545ce['length'];_0x1f8d37<_0x235b42;_0x1f8d37+=0x1){_0x1545ce[_0x1f8d37]['on']=_0x174754;}this[_0xdfcb('0xe')]();};RuleEngine[_0xdfcb('0xf')][_0xdfcb('0x23')]=function(_0x1ba16a,_0x615e30){_0x1ba16a=parseInt(_0x1ba16a,0xa);var _0x27c6f4=this['findRules'](_0x615e30);for(var _0x406d42=0x0,_0x54d52b=_0x27c6f4[_0xdfcb('0x24')];_0x406d42<_0x54d52b;_0x406d42+=0x1){_0x27c6f4[_0x406d42]['priority']=_0x1ba16a;}this[_0xdfcb('0xe')]();};RuleEngine[_0xdfcb('0xf')]['toJSON']=function(){var _0x2e31b0=this['rules'];if(_0x2e31b0 instanceof Array){_0x2e31b0=_0x2e31b0[_0xdfcb('0x25')](function(_0x54bec7){_0x54bec7[_0xdfcb('0x1e')]=_0x54bec7[_0xdfcb('0x1e')][_0xdfcb('0x26')]();_0x54bec7[_0xdfcb('0x16')]=_0x54bec7[_0xdfcb('0x16')][_0xdfcb('0x26')]();return _0x54bec7;});}else if(!_['isNil'](_0x2e31b0)){_0x2e31b0['condition']=_0x2e31b0[_0xdfcb('0x1e')][_0xdfcb('0x26')]();_0x2e31b0[_0xdfcb('0x16')]=_0x2e31b0[_0xdfcb('0x16')][_0xdfcb('0x26')]();}return _0x2e31b0;};RuleEngine[_0xdfcb('0xf')][_0xdfcb('0x27')]=function(_0x42c219){this['init']();if(_['isString'](_0x42c219)){_0x42c219=JSON[_0xdfcb('0x28')](_0x42c219);}if(_0x42c219 instanceof Array){_0x42c219=_0x42c219['map'](function(_0x37fbe4){_0x37fbe4[_0xdfcb('0x1e')]=eval('('+_0x37fbe4[_0xdfcb('0x1e')]+')');_0x37fbe4[_0xdfcb('0x16')]=eval('('+_0x37fbe4[_0xdfcb('0x16')]+')');return _0x37fbe4;});}else if(_0x42c219!==null&&typeof _0x42c219=='object'){_0x42c219[_0xdfcb('0x1e')]=eval('('+_0x42c219[_0xdfcb('0x1e')]+')');_0x42c219[_0xdfcb('0x16')]=eval('('+_0x42c219['consequence']+')');}this[_0xdfcb('0x29')](_0x42c219);};module[_0xdfcb('0x2a')]=RuleEngine; \ No newline at end of file +var _0x677d=['result','clone','consequence','ruleRef','name','index_','nextTick','next','isEqual','restart','isNil','length','call','noop','findRules','matches','turn','prioritize','priority','toJSON','map','condition','toString','parse','object','exports','lodash','util','EventEmitter','init','ignoreFactChanges','inherits','prototype','register','isArray','concat','rules','push','sync','activeRules','filter','orderBy'];(function(_0x432dce,_0x581aa5){var _0x176cae=function(_0x52bfa1){while(--_0x52bfa1){_0x432dce['push'](_0x432dce['shift']());}};_0x176cae(++_0x581aa5);}(_0x677d,0x16a));var _0xd677=function(_0xe75d24,_0x54f93b){_0xe75d24=_0xe75d24-0x0;var _0x4d2587=_0x677d[_0xe75d24];return _0x4d2587;};'use strict';var _=require(_0xd677('0x0'));var util=require(_0xd677('0x1'));var EventEmitter=require('events')[_0xd677('0x2')];function RuleEngine(_0x11c05d,_0x4f36f4){this[_0xd677('0x3')]();if(!_['isNil'](_0x11c05d)){this['register'](_0x11c05d);}if(_0x4f36f4){this[_0xd677('0x4')]=_0x4f36f4['ignoreFactChanges'];}return this;}util[_0xd677('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xd677('0x6')]['init']=function(_0x3620a5){this['rules']=[];this['activeRules']=[];};RuleEngine['prototype'][_0xd677('0x7')]=function(_0x1b8776){if(Array[_0xd677('0x8')](_0x1b8776)){this['rules']=this['rules'][_0xd677('0x9')](_0x1b8776);}else if(_0x1b8776!==null&&_['isObject'](_0x1b8776)){this[_0xd677('0xa')][_0xd677('0xb')](_0x1b8776);}this[_0xd677('0xc')]();};RuleEngine[_0xd677('0x6')]['sync']=function(){this[_0xd677('0xd')]=this[_0xd677('0xa')][_0xd677('0xe')](function(_0x18ae48){if(_['isNil'](_0x18ae48['on'])){_0x18ae48['on']=!![];}if(_0x18ae48['on']===!![]){return _0x18ae48;}});this[_0xd677('0xd')]=_[_0xd677('0xf')](this[_0xd677('0xd')],['p'],['asc']);};RuleEngine['prototype']['execute']=function(_0x317695,_0x1a5969){var _0x292b78=![];_0x317695[_0xd677('0x10')]=!![];var _0x40c978=_['clone'](_0x317695);var _0x2f6c5f=_[_0xd677('0x11')](_0x317695);var _0x18a1e5=this['activeRules'];var _0x1ab1c1=[];var _0x576224=this[_0xd677('0x4')];(function FnRuleLoop(_0x4fb796){var _0xf3e065={'rules':function(){return _0x18a1e5;},'rule':function(){return _0x18a1e5[_0x4fb796];},'when':function(_0x2ba255){if(_0x2ba255){var _0x115d02=_0x18a1e5[_0x4fb796][_0xd677('0x12')];_0x115d02[_0xd677('0x13')]=_0x18a1e5[_0x4fb796]['id']||_0x18a1e5[_0x4fb796][_0xd677('0x14')]||_0xd677('0x15')+_0x4fb796;process[_0xd677('0x16')](function(){_0x1ab1c1[_0xd677('0xb')](_0x115d02['ruleRef']);_0x115d02['call'](_0x40c978,_0xf3e065);});}else{process[_0xd677('0x16')](function(){_0xf3e065[_0xd677('0x17')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x292b78=!![];return FnRuleLoop(0x0);},'next':function(_0x305a0d){if(!_0x576224&&!_[_0xd677('0x18')](_0x2f6c5f,_0x40c978)){_0x2f6c5f=_[_0xd677('0x11')](_0x40c978);process[_0xd677('0x16')](function(){_0xf3e065[_0xd677('0x19')]();});}else{process[_0xd677('0x16')](function(){if(_[_0xd677('0x1a')](_0x305a0d)){return FnRuleLoop(_0x4fb796+0x1);}else{return FnRuleLoop(_0x305a0d);}});}}};if(_0x4fb796<_0x18a1e5[_0xd677('0x1b')]&&_0x292b78===![]){var _0x4d3cb9=_0x18a1e5[_0x4fb796]['condition'];_0x4d3cb9[_0xd677('0x1c')](_0x40c978,_0xf3e065);}else{process[_0xd677('0x16')](function(){_0x40c978['matchPath']=_0x1ab1c1;return _0x1a5969?_0x1a5969(_0x40c978):_[_0xd677('0x1d')]();});}}(0x0));};RuleEngine[_0xd677('0x6')][_0xd677('0x1e')]=function(_0xffe7c4){if(_[_0xd677('0x1a')](_0xffe7c4)){return this[_0xd677('0xa')];}else{var _0x28ec14=_[_0xd677('0x1f')](_0xffe7c4);return _[_0xd677('0xe')](this[_0xd677('0xa')],_0x28ec14);}};RuleEngine[_0xd677('0x6')][_0xd677('0x20')]=function(_0x4624d0,_0xb44f07){var _0x4624d0=_0x4624d0==='on'||_0x4624d0==='ON'?!![]:![];var _0x28e031=this[_0xd677('0x1e')](_0xb44f07);for(var _0x2218b1=0x0,_0x4920d3=_0x28e031[_0xd677('0x1b')];_0x2218b1<_0x4920d3;_0x2218b1+=0x1){_0x28e031[_0x2218b1]['on']=_0x4624d0;}this['sync']();};RuleEngine['prototype'][_0xd677('0x21')]=function(_0x1229d1,_0x96f62f){_0x1229d1=parseInt(_0x1229d1,0xa);var _0x5320ac=this[_0xd677('0x1e')](_0x96f62f);for(var _0x5122a7=0x0,_0xba5a7c=_0x5320ac['length'];_0x5122a7<_0xba5a7c;_0x5122a7+=0x1){_0x5320ac[_0x5122a7][_0xd677('0x22')]=_0x1229d1;}this[_0xd677('0xc')]();};RuleEngine['prototype'][_0xd677('0x23')]=function(){var _0x2716a6=this['rules'];if(_0x2716a6 instanceof Array){_0x2716a6=_0x2716a6[_0xd677('0x24')](function(_0x308bfd){_0x308bfd[_0xd677('0x25')]=_0x308bfd[_0xd677('0x25')][_0xd677('0x26')]();_0x308bfd['consequence']=_0x308bfd[_0xd677('0x12')][_0xd677('0x26')]();return _0x308bfd;});}else if(!_['isNil'](_0x2716a6)){_0x2716a6[_0xd677('0x25')]=_0x2716a6['condition'][_0xd677('0x26')]();_0x2716a6[_0xd677('0x12')]=_0x2716a6['consequence'][_0xd677('0x26')]();}return _0x2716a6;};RuleEngine[_0xd677('0x6')]['fromJSON']=function(_0x3807a0){this[_0xd677('0x3')]();if(_['isString'](_0x3807a0)){_0x3807a0=JSON[_0xd677('0x27')](_0x3807a0);}if(_0x3807a0 instanceof Array){_0x3807a0=_0x3807a0[_0xd677('0x24')](function(_0x3b03cb){_0x3b03cb['condition']=eval('('+_0x3b03cb[_0xd677('0x25')]+')');_0x3b03cb[_0xd677('0x12')]=eval('('+_0x3b03cb['consequence']+')');return _0x3b03cb;});}else if(_0x3807a0!==null&&typeof _0x3807a0==_0xd677('0x28')){_0x3807a0[_0xd677('0x25')]=eval('('+_0x3807a0['condition']+')');_0x3807a0[_0xd677('0x12')]=eval('('+_0x3807a0[_0xd677('0x12')]+')');}this[_0xd677('0x7')](_0x3807a0);};module[_0xd677('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index ff43516..8ca8999 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x42770f,_0x3734b8){var _0x2dc57c=function(_0x563d77){while(--_0x563d77){_0x42770f['push'](_0x42770f['shift']());}};_0x2dc57c(++_0x3734b8);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x22ae62,_0x45d55a){var _0x5641e6=function(_0x1f2c77){while(--_0x1f2c77){_0x22ae62['push'](_0x22ae62['shift']());}};_0x5641e6(++_0x45d55a);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index f9084f5..1c82c6c 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e54=['smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','mail','chat','openchannel','fax','sms','length','getChannelStatus','Status','StatusTime','chatStatus','faxStatusTime','openchannelCurrentCapacity','md5','emit','user:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus'];(function(_0x4b2d89,_0x56eb7){var _0x375c1b=function(_0x3fdcab){while(--_0x3fdcab){_0x4b2d89['push'](_0x4b2d89['shift']());}};_0x375c1b(++_0x56eb7);}(_0x2e54,0x1dd));var _0x42e5=function(_0x4fb428,_0x3b3b0f){_0x4fb428=_0x4fb428-0x0;var _0x6e17cc=_0x2e54[_0x4fb428];return _0x6e17cc;};'use strict';var _=require(_0x42e5('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x42e5('0x1'));var config=require(_0x42e5('0x2'));config[_0x42e5('0x3')]=_[_0x42e5('0x4')](config[_0x42e5('0x3')],{'host':_0x42e5('0x5'),'port':0x18eb});var io=require(_0x42e5('0x6'))(new Redis(config['redis']));function Agent(_0x171302){this['id']=_0x171302['id']||0x0;this[_0x42e5('0x7')]=_0x171302[_0x42e5('0x7')]||'';this['online']=_0x171302[_0x42e5('0x8')]||!![];this['voicePause']=_0x171302[_0x42e5('0x9')]||![];this['chatPause']=_0x171302[_0x42e5('0xa')]||![];this[_0x42e5('0xb')]=_0x171302[_0x42e5('0xb')]||![];this[_0x42e5('0xc')]=_0x171302[_0x42e5('0xc')]||![];this[_0x42e5('0xd')]=_0x171302[_0x42e5('0xd')]||![];this[_0x42e5('0xe')]=_0x171302[_0x42e5('0xe')]||![];this['chatStatus']=_0x42e5('0xf');this[_0x42e5('0x10')]=0x0;this['chatCapacity']=_0x171302[_0x42e5('0x11')]||0x0;this[_0x42e5('0x12')]=0x0;this[_0x42e5('0x13')]=_0x42e5('0xf');this[_0x42e5('0x14')]=0x0;this[_0x42e5('0x15')]=_0x171302[_0x42e5('0x15')]||0x0;this[_0x42e5('0x16')]=0x0;this[_0x42e5('0x17')]=_0x42e5('0xf');this['faxStatusTime']=0x0;this[_0x42e5('0x18')]=_0x171302[_0x42e5('0x18')]||0x0;this[_0x42e5('0x19')]=0x0;this[_0x42e5('0x1a')]=_0x42e5('0xf');this[_0x42e5('0x1b')]=0x0;this[_0x42e5('0x1c')]=_0x171302[_0x42e5('0x1c')]||0x0;this[_0x42e5('0x1d')]=0x0;this[_0x42e5('0x1e')]=_0x42e5('0xf');this[_0x42e5('0x1f')]=0x0;this[_0x42e5('0x20')]=_0x171302[_0x42e5('0x20')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x42e5('0x21')]=![];this['busyQueue']=undefined;this['md5']='';this[_0x42e5('0x22')]();}Agent[_0x42e5('0x23')]['getChannelStatus']=function(_0x41a823){if(this[_0x41a823+_0x42e5('0x24')]>0x0){if(this[_0x41a823+_0x42e5('0x25')]>0x0&&this[_0x41a823+_0x42e5('0x24')]>=this[_0x41a823+_0x42e5('0x25')]){return _0x42e5('0x26');}else{return _0x42e5('0x27');}}else{return'idle';}};Agent['prototype'][_0x42e5('0x22')]=function(){var _0x52d319=[_0x42e5('0x28'),_0x42e5('0x29'),_0x42e5('0x2a'),_0x42e5('0x2b'),_0x42e5('0x2c')];for(var _0x5d6b24=0x0;_0x5d6b24<_0x52d319[_0x42e5('0x2d')];_0x5d6b24+=0x1){var _0xf29221=this[_0x42e5('0x2e')](_0x52d319[_0x5d6b24]);if(this[_0x52d319[_0x5d6b24]+_0x42e5('0x2f')]!==_0xf29221){this[_0x52d319[_0x5d6b24]+_0x42e5('0x30')]=_['toNumber'](moment()['format']('x'));}this[_0x52d319[_0x5d6b24]+_0x42e5('0x2f')]=_0xf29221;}var _0x534a26={'id':this['id'],'name':this['name'],'online':this[_0x42e5('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0x42e5('0xa')],'mailPause':this[_0x42e5('0xb')],'smsPause':this[_0x42e5('0xd')],'faxPause':this[_0x42e5('0xc')],'openchannelPause':this[_0x42e5('0xe')],'chatStatus':this[_0x42e5('0x31')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x42e5('0x11')],'chatCurrentCapacity':this[_0x42e5('0x12')],'mailStatus':this[_0x42e5('0x13')],'mailStatusTime':this[_0x42e5('0x14')],'mailCapacity':this[_0x42e5('0x15')],'mailCurrentCapacity':this[_0x42e5('0x16')],'faxStatus':this[_0x42e5('0x17')],'faxStatusTime':this[_0x42e5('0x32')],'faxCapacity':this[_0x42e5('0x18')],'faxCurrentCapacity':this[_0x42e5('0x19')],'smsStatus':this[_0x42e5('0x1a')],'smsStatusTime':this[_0x42e5('0x1b')],'smsCapacity':this[_0x42e5('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this[_0x42e5('0x1e')],'openchannelStatusTime':this[_0x42e5('0x1f')],'openchannelCapacity':this[_0x42e5('0x20')],'openchannelCurrentCapacity':this[_0x42e5('0x33')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x21d933=md5(JSON['stringify'](_0x534a26));if(this[_0x42e5('0x34')]!==_0x21d933){this['md5']=_0x21d933;io[_0x42e5('0x35')](_0x42e5('0x36'),_0x534a26);}};module[_0x42e5('0x37')]=Agent; \ No newline at end of file +var _0xe14d=['smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','Capacity','CurrentCapacity','maxcapacity','working','idle','updateRealtime','mail','chat','openchannel','fax','length','getChannelStatus','Status','StatusTime','toNumber','format','online','faxStatus','faxCurrentCapacity','user:save','exports','lodash','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','smsStatus','smsStatusTime'];(function(_0x374dd6,_0xadc0eb){var _0x1aadd0=function(_0x3b87be){while(--_0x3b87be){_0x374dd6['push'](_0x374dd6['shift']());}};_0x1aadd0(++_0xadc0eb);}(_0xe14d,0x1ee));var _0xde14=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xe14d[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0xde14('0x0'));var moment=require(_0xde14('0x1'));var md5=require(_0xde14('0x2'));var Redis=require(_0xde14('0x3'));var config=require('../../../config/environment');config[_0xde14('0x4')]=_[_0xde14('0x5')](config['redis'],{'host':_0xde14('0x6'),'port':0x18eb});var io=require(_0xde14('0x7'))(new Redis(config[_0xde14('0x4')]));function Agent(_0x37b5bc){this['id']=_0x37b5bc['id']||0x0;this[_0xde14('0x8')]=_0x37b5bc[_0xde14('0x8')]||'';this['online']=_0x37b5bc['online']||!![];this[_0xde14('0x9')]=_0x37b5bc[_0xde14('0x9')]||![];this[_0xde14('0xa')]=_0x37b5bc[_0xde14('0xa')]||![];this[_0xde14('0xb')]=_0x37b5bc[_0xde14('0xb')]||![];this[_0xde14('0xc')]=_0x37b5bc[_0xde14('0xc')]||![];this['smsPause']=_0x37b5bc[_0xde14('0xd')]||![];this[_0xde14('0xe')]=_0x37b5bc[_0xde14('0xe')]||![];this[_0xde14('0xf')]=_0xde14('0x10');this[_0xde14('0x11')]=0x0;this[_0xde14('0x12')]=_0x37b5bc[_0xde14('0x12')]||0x0;this[_0xde14('0x13')]=0x0;this[_0xde14('0x14')]=_0xde14('0x10');this[_0xde14('0x15')]=0x0;this[_0xde14('0x16')]=_0x37b5bc[_0xde14('0x16')]||0x0;this[_0xde14('0x17')]=0x0;this['faxStatus']='unknown';this[_0xde14('0x18')]=0x0;this[_0xde14('0x19')]=_0x37b5bc[_0xde14('0x19')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xde14('0x1a')]=_0xde14('0x10');this[_0xde14('0x1b')]=0x0;this[_0xde14('0x1c')]=_0x37b5bc[_0xde14('0x1c')]||0x0;this[_0xde14('0x1d')]=0x0;this[_0xde14('0x1e')]=_0xde14('0x10');this[_0xde14('0x1f')]=0x0;this[_0xde14('0x20')]=_0x37b5bc['openchannelCapacity']||0x0;this[_0xde14('0x21')]=0x0;this[_0xde14('0x22')]=![];this[_0xde14('0x23')]=undefined;this[_0xde14('0x2')]='';this['updateRealtime']();}Agent[_0xde14('0x24')]['getChannelStatus']=function(_0x45d101){if(this[_0x45d101+'CurrentCapacity']>0x0){if(this[_0x45d101+_0xde14('0x25')]>0x0&&this[_0x45d101+_0xde14('0x26')]>=this[_0x45d101+_0xde14('0x25')]){return _0xde14('0x27');}else{return _0xde14('0x28');}}else{return _0xde14('0x29');}};Agent[_0xde14('0x24')][_0xde14('0x2a')]=function(){var _0xdd8d59=[_0xde14('0x2b'),_0xde14('0x2c'),_0xde14('0x2d'),_0xde14('0x2e'),'sms'];for(var _0x42dd4f=0x0;_0x42dd4f<_0xdd8d59[_0xde14('0x2f')];_0x42dd4f+=0x1){var _0x24a390=this[_0xde14('0x30')](_0xdd8d59[_0x42dd4f]);if(this[_0xdd8d59[_0x42dd4f]+_0xde14('0x31')]!==_0x24a390){this[_0xdd8d59[_0x42dd4f]+_0xde14('0x32')]=_[_0xde14('0x33')](moment()[_0xde14('0x34')]('x'));}this[_0xdd8d59[_0x42dd4f]+_0xde14('0x31')]=_0x24a390;}var _0x350a78={'id':this['id'],'name':this['name'],'online':this[_0xde14('0x35')],'voicePause':this[_0xde14('0x9')],'chatPause':this[_0xde14('0xa')],'mailPause':this[_0xde14('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0xde14('0xc')],'openchannelPause':this[_0xde14('0xe')],'chatStatus':this[_0xde14('0xf')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xde14('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xde14('0x14')],'mailStatusTime':this[_0xde14('0x15')],'mailCapacity':this[_0xde14('0x16')],'mailCurrentCapacity':this[_0xde14('0x17')],'faxStatus':this[_0xde14('0x36')],'faxStatusTime':this[_0xde14('0x18')],'faxCapacity':this[_0xde14('0x19')],'faxCurrentCapacity':this[_0xde14('0x37')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xde14('0x1b')],'smsCapacity':this[_0xde14('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this[_0xde14('0x1e')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xde14('0x20')],'openchannelCurrentCapacity':this[_0xde14('0x21')],'busy':this[_0xde14('0x22')],'busyQueue':this[_0xde14('0x23')]};var _0x13c164=md5(JSON['stringify'](_0x350a78));if(this[_0xde14('0x2')]!==_0x13c164){this[_0xde14('0x2')]=_0x13c164;io['emit'](_0xde14('0x38'),_0x350a78);}};module[_0xde14('0x39')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index e198f26..c20571f 100644 --- a/server/services/routing/model/chatQueue.js +++ b/server/services/routing/model/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3113=['lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','length','online','loggedIn','available','paused','stringify','format','chat:queue:%s','emit','chat_queue:save','exports'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x3113,0x150));var _0x3311=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3113[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3311('0x0'));var md5=require(_0x3311('0x1'));var util=require('util');var Redis=require(_0x3311('0x2'));var config=require(_0x3311('0x3'));config[_0x3311('0x4')]=_['defaults'](config[_0x3311('0x4')],{'host':_0x3311('0x5'),'port':0x18eb});var io=require(_0x3311('0x6'))(new Redis(config[_0x3311('0x4')]));function ChatQueue(_0x18b7b8){this['id']=_0x18b7b8['id']||0x0;this[_0x3311('0x7')]=_0x18b7b8[_0x3311('0x7')]||'';this['timeout']=_0x18b7b8['timeout']||0xa;this[_0x3311('0x8')]=_0x18b7b8[_0x3311('0x8')]||_0x3311('0x9');this[_0x3311('0xa')]=_0x18b7b8[_0x3311('0xa')];this['mapAgentsId']={};this[_0x3311('0xb')]=0x0;this[_0x3311('0x1')]='';this[_0x3311('0xc')]();this[_0x3311('0xd')]();}ChatQueue['prototype'][_0x3311('0xc')]=function(){var _0x6ca2f6=this[_0x3311('0xe')][_0x3311('0xf')];this['mapAgentsId']=_[_0x3311('0x10')](this[_0x3311('0xa')],'id');this[_0x3311('0xe')][_0x3311('0xf')]=_0x6ca2f6;};ChatQueue['prototype'][_0x3311('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0xb399ac=0x0;_0xb399ac=0x0?this[_0x3311('0x14')]:0x0;var _0x5c489c={'id':this['id'],'available':this[_0x3311('0x14')],'loggedIn':this[_0x3311('0x13')],'name':this[_0x3311('0x7')],'paused':this['paused'],'waiting':this[_0x3311('0xb')]};var _0x5161c1=md5(JSON[_0x3311('0x16')](_0x5c489c));if(this[_0x3311('0x1')]!==_0x5161c1){this['md5']=_0x5161c1;io['to'](util[_0x3311('0x17')](_0x3311('0x18'),_0x5c489c[_0x3311('0x7')]))[_0x3311('0x19')](_0x3311('0x1a'),_0x5c489c);}};module[_0x3311('0x1b')]=ChatQueue; \ No newline at end of file +var _0x9377=['chatPause','available','loggedIn','stringify','md5','chat:queue:%s','emit','chat_queue:save','exports','lodash','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','paused','length','online'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x9377,0x182));var _0x7937=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9377[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7937('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0x7937('0x1'));config['redis']=_[_0x7937('0x2')](config['redis'],{'host':_0x7937('0x3'),'port':0x18eb});var io=require(_0x7937('0x4'))(new Redis(config[_0x7937('0x5')]));function ChatQueue(_0x4dde91){this['id']=_0x4dde91['id']||0x0;this['name']=_0x4dde91[_0x7937('0x6')]||'';this[_0x7937('0x7')]=_0x4dde91['timeout']||0xa;this[_0x7937('0x8')]=_0x4dde91['strategy']||'beepall';this[_0x7937('0x9')]=_0x4dde91[_0x7937('0x9')];this[_0x7937('0xa')]={};this[_0x7937('0xb')]=0x0;this['md5']='';this['updateRouting']();this[_0x7937('0xc')]();}ChatQueue[_0x7937('0xd')][_0x7937('0xe')]=function(){var _0x381823=this[_0x7937('0xa')][_0x7937('0xf')];this[_0x7937('0xa')]=_[_0x7937('0x10')](this[_0x7937('0x9')],'id');this['mapAgentsId'][_0x7937('0xf')]=_0x381823;};ChatQueue[_0x7937('0xd')][_0x7937('0xc')]=function(){this['loggedIn']=0x0;this[_0x7937('0x11')]=0x0;for(var _0x24253a=0x0;_0x24253a=0x0?this['available']:0x0;var _0x114d62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7937('0x16')],'name':this['name'],'paused':this[_0x7937('0x11')],'waiting':this['waiting']};var _0x411170=md5(JSON[_0x7937('0x17')](_0x114d62));if(this['md5']!==_0x411170){this[_0x7937('0x18')]=_0x411170;io['to'](util['format'](_0x7937('0x19'),_0x114d62[_0x7937('0x6')]))[_0x7937('0x1a')](_0x7937('0x1b'),_0x114d62);}};module[_0x7937('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 1b8310f..eb02d46 100644 --- a/server/services/routing/model/faxQueue.js +++ b/server/services/routing/model/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x582fd9,_0x53bd7c){var _0x5b143e=function(_0x34c9dc){while(--_0x34c9dc){_0x582fd9['push'](_0x582fd9['shift']());}};_0x5b143e(++_0x53bd7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file +var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x1b0fae,_0x5a8f49){var _0x432b7a=function(_0x424b51){while(--_0x424b51){_0x1b0fae['push'](_0x1b0fae['shift']());}};_0x432b7a(++_0x5a8f49);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 0a91f02..cf494e0 100644 --- a/server/services/routing/model/interval.js +++ b/server/services/routing/model/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa98c=['Intervals','name'];(function(_0x70ee50,_0x3a2bf4){var _0x2ab4b4=function(_0x5e20d9){while(--_0x5e20d9){_0x70ee50['push'](_0x70ee50['shift']());}};_0x2ab4b4(++_0x3a2bf4);}(_0xa98c,0xd9));var _0xca98=function(_0x411e71,_0xf9652){_0x411e71=_0x411e71-0x0;var _0x226ae3=_0xa98c[_0x411e71];return _0x226ae3;};'use strict';function Interval(_0x240795){this['id']=_0x240795['id']||0x0;this[_0xca98('0x0')]=_0x240795[_0xca98('0x0')]||'';this[_0xca98('0x1')]=_0x240795[_0xca98('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x4fe1=['name','Intervals','exports'];(function(_0x336264,_0x32e1d9){var _0x53cf91=function(_0x21026c){while(--_0x21026c){_0x336264['push'](_0x336264['shift']());}};_0x53cf91(++_0x32e1d9);}(_0x4fe1,0xab));var _0x14fe=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4fe1[_0x5b644e];return _0x49c6bf;};'use strict';function Interval(_0x4b11ec){this['id']=_0x4b11ec['id']||0x0;this[_0x14fe('0x0')]=_0x4b11ec['name']||'';this[_0x14fe('0x1')]=_0x4b11ec[_0x14fe('0x1')]||{};}module[_0x14fe('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 6cd77f8..ad9ae69 100644 --- a/server/services/routing/model/mailQueue.js +++ b/server/services/routing/model/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d8e=['updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','available','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x22a41d,_0x4ed787){var _0xb067c8=function(_0x56a543){while(--_0x56a543){_0x22a41d['push'](_0x22a41d['shift']());}};_0xb067c8(++_0x4ed787);}(_0x2d8e,0x17a));var _0xe2d8=function(_0xef4758,_0x18d0cf){_0xef4758=_0xef4758-0x0;var _0x483a67=_0x2d8e[_0xef4758];return _0x483a67;};'use strict';var _=require(_0xe2d8('0x0'));var md5=require(_0xe2d8('0x1'));var util=require(_0xe2d8('0x2'));var Redis=require(_0xe2d8('0x3'));var config=require(_0xe2d8('0x4'));config[_0xe2d8('0x5')]=_[_0xe2d8('0x6')](config[_0xe2d8('0x5')],{'host':_0xe2d8('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe2d8('0x5')]));function MailQueue(_0x5dd55c){this['id']=_0x5dd55c['id']||0x0;this['name']=_0x5dd55c[_0xe2d8('0x8')]||'';this[_0xe2d8('0x9')]=_0x5dd55c[_0xe2d8('0x9')]||0xa;this[_0xe2d8('0xa')]=_0x5dd55c[_0xe2d8('0xa')]||'beepall';this[_0xe2d8('0xb')]=_0x5dd55c[_0xe2d8('0xb')];this[_0xe2d8('0xc')]={};this[_0xe2d8('0xd')]=0x0;this[_0xe2d8('0x1')]='';this['updateRouting']();this[_0xe2d8('0xe')]();}MailQueue[_0xe2d8('0xf')][_0xe2d8('0x10')]=function(){var _0x340938=this[_0xe2d8('0xc')][_0xe2d8('0x11')];this[_0xe2d8('0xc')]=_[_0xe2d8('0x12')](this[_0xe2d8('0xb')],'id');this[_0xe2d8('0xc')][_0xe2d8('0x11')]=_0x340938;};MailQueue[_0xe2d8('0xf')][_0xe2d8('0xe')]=function(){this[_0xe2d8('0x13')]=0x0;this[_0xe2d8('0x14')]=0x0;for(var _0x42b9ea=0x0;_0x42b9ea=0x0?this[_0xe2d8('0x17')]:0x0;var _0x21c895={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe2d8('0x13')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xe2d8('0xd')]};var _0x374324=md5(JSON['stringify'](_0x21c895));if(this[_0xe2d8('0x1')]!==_0x374324){this['md5']=_0x374324;io['to'](util[_0xe2d8('0x18')](_0xe2d8('0x19'),_0x21c895[_0xe2d8('0x8')]))['emit'](_0xe2d8('0x1a'),_0x21c895);}};module[_0xe2d8('0x1b')]=MailQueue; \ No newline at end of file +var _0xd65f=['updateRouting','mapAgentsId','_rr','map','prototype','updateRealtime','paused','online','loggedIn','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting'];(function(_0x356a3d,_0x5dbb85){var _0x139bc4=function(_0x174274){while(--_0x174274){_0x356a3d['push'](_0x356a3d['shift']());}};_0x139bc4(++_0x5dbb85);}(_0xd65f,0x198));var _0xfd65=function(_0x584291,_0x24b5b3){_0x584291=_0x584291-0x0;var _0x4e7d08=_0xd65f[_0x584291];return _0x4e7d08;};'use strict';var _=require('lodash');var md5=require(_0xfd65('0x0'));var util=require('util');var Redis=require(_0xfd65('0x1'));var config=require(_0xfd65('0x2'));config[_0xfd65('0x3')]=_[_0xfd65('0x4')](config['redis'],{'host':_0xfd65('0x5'),'port':0x18eb});var io=require(_0xfd65('0x6'))(new Redis(config['redis']));function MailQueue(_0x494bd3){this['id']=_0x494bd3['id']||0x0;this[_0xfd65('0x7')]=_0x494bd3['name']||'';this[_0xfd65('0x8')]=_0x494bd3[_0xfd65('0x8')]||0xa;this[_0xfd65('0x9')]=_0x494bd3[_0xfd65('0x9')]||'beepall';this[_0xfd65('0xa')]=_0x494bd3[_0xfd65('0xa')];this['mapAgentsId']={};this[_0xfd65('0xb')]=0x0;this[_0xfd65('0x0')]='';this[_0xfd65('0xc')]();this['updateRealtime']();}MailQueue['prototype'][_0xfd65('0xc')]=function(){var _0x3faa1a=this[_0xfd65('0xd')][_0xfd65('0xe')];this['mapAgentsId']=_[_0xfd65('0xf')](this[_0xfd65('0xa')],'id');this['mapAgentsId'][_0xfd65('0xe')]=_0x3faa1a;};MailQueue[_0xfd65('0x10')][_0xfd65('0x11')]=function(){this['loggedIn']=0x0;this[_0xfd65('0x12')]=0x0;for(var _0x5bcccb=0x0;_0x5bcccb=0x0?this[_0xfd65('0x16')]:0x0;var _0x509fe7={'id':this['id'],'available':this['available'],'loggedIn':this[_0xfd65('0x14')],'name':this[_0xfd65('0x7')],'paused':this[_0xfd65('0x12')],'waiting':this['waiting']};var _0x41561e=md5(JSON[_0xfd65('0x17')](_0x509fe7));if(this[_0xfd65('0x0')]!==_0x41561e){this[_0xfd65('0x0')]=_0x41561e;io['to'](util[_0xfd65('0x18')](_0xfd65('0x19'),_0x509fe7[_0xfd65('0x7')]))[_0xfd65('0x1a')](_0xfd65('0x1b'),_0x509fe7);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index f13f30d..2923089 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf0b=['openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','openchannelPause','available','stringify','format'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xdf0b,0x12f));var _0xbdf0=function(_0x46dffb,_0x58491d){_0x46dffb=_0x46dffb-0x0;var _0x2b81f3=_0xdf0b[_0x46dffb];return _0x2b81f3;};'use strict';var _=require('lodash');var md5=require(_0xbdf0('0x0'));var util=require(_0xbdf0('0x1'));var Redis=require(_0xbdf0('0x2'));var config=require(_0xbdf0('0x3'));config[_0xbdf0('0x4')]=_[_0xbdf0('0x5')](config[_0xbdf0('0x4')],{'host':_0xbdf0('0x6'),'port':0x18eb});var io=require(_0xbdf0('0x7'))(new Redis(config[_0xbdf0('0x4')]));function OpenchannelQueue(_0x32f753){this['id']=_0x32f753['id']||0x0;this['name']=_0x32f753[_0xbdf0('0x8')]||'';this['timeout']=_0x32f753[_0xbdf0('0x9')]||0xa;this['strategy']=_0x32f753[_0xbdf0('0xa')]||_0xbdf0('0xb');this[_0xbdf0('0xc')]=_0x32f753[_0xbdf0('0xc')];this[_0xbdf0('0xd')]={};this[_0xbdf0('0xe')]=0x0;this[_0xbdf0('0x0')]='';this[_0xbdf0('0xf')]();this[_0xbdf0('0x10')]();}OpenchannelQueue[_0xbdf0('0x11')][_0xbdf0('0xf')]=function(){var _0x409c1d=this[_0xbdf0('0xd')][_0xbdf0('0x12')];this[_0xbdf0('0xd')]=_[_0xbdf0('0x13')](this[_0xbdf0('0xc')],'id');this[_0xbdf0('0xd')][_0xbdf0('0x12')]=_0x409c1d;};OpenchannelQueue[_0xbdf0('0x11')][_0xbdf0('0x10')]=function(){this['loggedIn']=0x0;this[_0xbdf0('0x14')]=0x0;for(var _0x3cd840=0x0;_0x3cd840=0x0?this[_0xbdf0('0x18')]:0x0;var _0x3efd32={'id':this['id'],'available':this[_0xbdf0('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xbdf0('0x8')],'paused':this[_0xbdf0('0x14')],'waiting':this[_0xbdf0('0xe')]};var _0x3c3d78=md5(JSON[_0xbdf0('0x19')](_0x3efd32));if(this['md5']!==_0x3c3d78){this[_0xbdf0('0x0')]=_0x3c3d78;io['to'](util[_0xbdf0('0x1a')](_0xbdf0('0x1b'),_0x3efd32[_0xbdf0('0x8')]))['emit'](_0xbdf0('0x1c'),_0x3efd32);}};module[_0xbdf0('0x1d')]=OpenchannelQueue; \ No newline at end of file +var _0x5e78=['socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','loggedIn','paused','length','online','openchannelPause','available','stringify','format','openchannel:queue:%s','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost'];(function(_0x1a809b,_0x4c15e3){var _0x5d90e6=function(_0x5dd2e1){while(--_0x5dd2e1){_0x1a809b['push'](_0x1a809b['shift']());}};_0x5d90e6(++_0x4c15e3);}(_0x5e78,0x1ab));var _0x85e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e78[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x85e7('0x0'));var md5=require(_0x85e7('0x1'));var util=require(_0x85e7('0x2'));var Redis=require(_0x85e7('0x3'));var config=require(_0x85e7('0x4'));config['redis']=_[_0x85e7('0x5')](config['redis'],{'host':_0x85e7('0x6'),'port':0x18eb});var io=require(_0x85e7('0x7'))(new Redis(config['redis']));function OpenchannelQueue(_0x455ad0){this['id']=_0x455ad0['id']||0x0;this['name']=_0x455ad0[_0x85e7('0x8')]||'';this['timeout']=_0x455ad0[_0x85e7('0x9')]||0xa;this['strategy']=_0x455ad0[_0x85e7('0xa')]||_0x85e7('0xb');this[_0x85e7('0xc')]=_0x455ad0['Agents'];this['mapAgentsId']={};this[_0x85e7('0xd')]=0x0;this[_0x85e7('0x1')]='';this['updateRouting']();this[_0x85e7('0xe')]();}OpenchannelQueue[_0x85e7('0xf')][_0x85e7('0x10')]=function(){var _0x53eb0b=this[_0x85e7('0x11')][_0x85e7('0x12')];this[_0x85e7('0x11')]=_[_0x85e7('0x13')](this['Agents'],'id');this[_0x85e7('0x11')][_0x85e7('0x12')]=_0x53eb0b;};OpenchannelQueue[_0x85e7('0xf')][_0x85e7('0xe')]=function(){this[_0x85e7('0x14')]=0x0;this[_0x85e7('0x15')]=0x0;for(var _0x5c0e09=0x0;_0x5c0e09=0x0?this[_0x85e7('0x19')]:0x0;var _0x3efb1c={'id':this['id'],'available':this[_0x85e7('0x19')],'loggedIn':this['loggedIn'],'name':this[_0x85e7('0x8')],'paused':this[_0x85e7('0x15')],'waiting':this[_0x85e7('0xd')]};var _0xbfdb61=md5(JSON[_0x85e7('0x1a')](_0x3efb1c));if(this[_0x85e7('0x1')]!==_0xbfdb61){this[_0x85e7('0x1')]=_0xbfdb61;io['to'](util[_0x85e7('0x1b')](_0x85e7('0x1c'),_0x3efb1c[_0x85e7('0x8')]))['emit'](_0x85e7('0x1d'),_0x3efb1c);}};module[_0x85e7('0x1e')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index d73b551..74084d2 100644 --- a/server/services/routing/model/smsQueue.js +++ b/server/services/routing/model/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['loggedIn','paused','length','online','available','stringify','sms:queue:%s','emit','sms_queue:save','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map'];(function(_0x18edab,_0x474c1f){var _0x40d1dc=function(_0x454b05){while(--_0x454b05){_0x18edab['push'](_0x18edab['shift']());}};_0x40d1dc(++_0x474c1f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x46800d,_0x588500){_0x46800d=_0x46800d-0x0;var _0x3824cd=_0xcb91[_0x46800d];return _0x3824cd;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x1cb9('0x0'));var Redis=require(_0x1cb9('0x1'));var config=require(_0x1cb9('0x2'));config[_0x1cb9('0x3')]=_['defaults'](config[_0x1cb9('0x3')],{'host':_0x1cb9('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1cb9('0x3')]));function SmsQueue(_0x1b26cd){this['id']=_0x1b26cd['id']||0x0;this['name']=_0x1b26cd[_0x1cb9('0x5')]||'';this[_0x1cb9('0x6')]=_0x1b26cd['timeout']||0xa;this[_0x1cb9('0x7')]=_0x1b26cd[_0x1cb9('0x7')]||'beepall';this[_0x1cb9('0x8')]=_0x1b26cd['Agents'];this['mapAgentsId']={};this[_0x1cb9('0x9')]=0x0;this[_0x1cb9('0xa')]='';this[_0x1cb9('0xb')]();this[_0x1cb9('0xc')]();}SmsQueue[_0x1cb9('0xd')]['updateRouting']=function(){var _0x9b58f1=this[_0x1cb9('0xe')][_0x1cb9('0xf')];this[_0x1cb9('0xe')]=_[_0x1cb9('0x10')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x9b58f1;};SmsQueue[_0x1cb9('0xd')][_0x1cb9('0xc')]=function(){this[_0x1cb9('0x11')]=0x0;this[_0x1cb9('0x12')]=0x0;for(var _0x56884d=0x0;_0x56884d=0x0?this[_0x1cb9('0x15')]:0x0;var _0x4e1340={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1cb9('0x11')],'name':this[_0x1cb9('0x5')],'paused':this[_0x1cb9('0x12')],'waiting':this[_0x1cb9('0x9')]};var _0x280a84=md5(JSON[_0x1cb9('0x16')](_0x4e1340));if(this[_0x1cb9('0xa')]!==_0x280a84){this['md5']=_0x280a84;io['to'](util['format'](_0x1cb9('0x17'),_0x4e1340['name']))[_0x1cb9('0x18')](_0x1cb9('0x19'),_0x4e1340);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xcb91=['loggedIn','paused','length','online','available','stringify','sms:queue:%s','emit','sms_queue:save','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map'];(function(_0x577840,_0x4060b0){var _0x40e2e1=function(_0x4a054b){while(--_0x4a054b){_0x577840['push'](_0x577840['shift']());}};_0x40e2e1(++_0x4060b0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xcb91[_0x3e2fcf];return _0x497db7;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x1cb9('0x0'));var Redis=require(_0x1cb9('0x1'));var config=require(_0x1cb9('0x2'));config[_0x1cb9('0x3')]=_['defaults'](config[_0x1cb9('0x3')],{'host':_0x1cb9('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1cb9('0x3')]));function SmsQueue(_0x1b26cd){this['id']=_0x1b26cd['id']||0x0;this['name']=_0x1b26cd[_0x1cb9('0x5')]||'';this[_0x1cb9('0x6')]=_0x1b26cd['timeout']||0xa;this[_0x1cb9('0x7')]=_0x1b26cd[_0x1cb9('0x7')]||'beepall';this[_0x1cb9('0x8')]=_0x1b26cd['Agents'];this['mapAgentsId']={};this[_0x1cb9('0x9')]=0x0;this[_0x1cb9('0xa')]='';this[_0x1cb9('0xb')]();this[_0x1cb9('0xc')]();}SmsQueue[_0x1cb9('0xd')]['updateRouting']=function(){var _0x9b58f1=this[_0x1cb9('0xe')][_0x1cb9('0xf')];this[_0x1cb9('0xe')]=_[_0x1cb9('0x10')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x9b58f1;};SmsQueue[_0x1cb9('0xd')][_0x1cb9('0xc')]=function(){this[_0x1cb9('0x11')]=0x0;this[_0x1cb9('0x12')]=0x0;for(var _0x56884d=0x0;_0x56884d=0x0?this[_0x1cb9('0x15')]:0x0;var _0x4e1340={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1cb9('0x11')],'name':this[_0x1cb9('0x5')],'paused':this[_0x1cb9('0x12')],'waiting':this[_0x1cb9('0x9')]};var _0x280a84=md5(JSON[_0x1cb9('0x16')](_0x4e1340));if(this[_0x1cb9('0xa')]!==_0x280a84){this['md5']=_0x280a84;io['to'](util['format'](_0x1cb9('0x17'),_0x4e1340['name']))[_0x1cb9('0x18')](_0x1cb9('0x19'),_0x4e1340);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 5456353..16d228c 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd373=['../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','initAgents','length','mergeFromDatabase','initIntervals','isUndefined','initOpenchannelQueues','updateRealtime','updateRouting','initMailQueues','exports','bluebird','util','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd373,0x1d0));var _0x3d37=function(_0x359b45,_0x40a2eb){_0x359b45=_0x359b45-0x0;var _0x14b29e=_0xd373[_0x359b45];return _0x14b29e;};'use strict';var BPromise=require(_0x3d37('0x0'));var util=require(_0x3d37('0x1'));var _=require(_0x3d37('0x2'));var moment=require(_0x3d37('0x3'));var Agent=require(_0x3d37('0x4'));var Interval=require(_0x3d37('0x5'));var OpenchannelQueue=require(_0x3d37('0x6'));var ChatQueue=require(_0x3d37('0x7'));var SmsQueue=require(_0x3d37('0x8'));var MailQueue=require(_0x3d37('0x9'));var FaxQueue=require(_0x3d37('0xa'));var Realtime=function(){this[_0x3d37('0xb')]={};this[_0x3d37('0xc')]={};this[_0x3d37('0xd')]={};this[_0x3d37('0xe')]={};this[_0x3d37('0xf')]={};this[_0x3d37('0x10')]={};this[_0x3d37('0x11')]={};this[_0x3d37('0x12')]={};this[_0x3d37('0x13')]={};this[_0x3d37('0x14')]={};this[_0x3d37('0x15')]={};this[_0x3d37('0x16')]={};};function freeIsNotKey(_0x17aff3,_0x5f5503,_0x5b834f){var _0x34f0eb=_[_0x3d37('0x17')](_0x17aff3,function(_0x59fb71,_0x21d74c){return _0x59fb71[_0x5b834f];});for(var _0x35d34f in _0x5f5503){if(_0x5f5503[_0x3d37('0x18')](_0x35d34f)){if(!_0x34f0eb[_0x35d34f]){delete _0x5f5503[_0x35d34f];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x7c72a2,_0x809e33){for(var _0x49691a in _0x809e33){if(_0x7c72a2[_0x3d37('0x18')](_0x49691a)){_0x7c72a2[_0x49691a]=_0x809e33[_0x49691a];}}};Realtime[_0x3d37('0x19')][_0x3d37('0x1a')]=function(){var _0x1ae431=this;return function(_0x115da3){if(_0x115da3){freeIsNotKey(_0x115da3,_0x1ae431['agents'],'id');for(var _0x24a296=0x0,_0x5b4aed={},_0xd54f98={};_0x24a296<_0x115da3[_0x3d37('0x1b')];_0x24a296+=0x1){_0x5b4aed=_0x115da3[_0x24a296];if(_['isUndefined'](_0x1ae431['agents'][_0x5b4aed['id']])){_0x1ae431[_0x3d37('0xb')][_0x5b4aed['id']]=new Agent(_0x5b4aed);}else{_0x1ae431[_0x3d37('0x1c')](_0x1ae431[_0x3d37('0xb')][_0x5b4aed['id']],_0x5b4aed);}}}return _0x1ae431[_0x3d37('0xb')];};};Realtime[_0x3d37('0x19')][_0x3d37('0x1d')]=function(){var _0x4411e3=this;return function(_0x32a030){if(_0x32a030){freeIsNotKey(_0x32a030,_0x4411e3[_0x3d37('0xc')],'id');for(var _0x5ad9cc=0x0,_0x3afa8d={},_0x1c3fdd={};_0x5ad9cc<_0x32a030[_0x3d37('0x1b')];_0x5ad9cc+=0x1){_0x3afa8d=_0x32a030[_0x5ad9cc];if(_[_0x3d37('0x1e')](_0x4411e3[_0x3d37('0xc')][_0x3afa8d['id']])){_0x4411e3[_0x3d37('0xc')][_0x3afa8d['id']]=new Interval(_0x3afa8d);}else{_0x4411e3[_0x3d37('0x1c')](_0x4411e3[_0x3d37('0xc')][_0x3afa8d['id']],_0x3afa8d);}}}return _0x4411e3[_0x3d37('0xc')];};};Realtime[_0x3d37('0x19')][_0x3d37('0x1f')]=function(){var _0x2ef871=this;return function(_0x5a1467){if(_0x5a1467){freeIsNotKey(_0x5a1467,_0x2ef871[_0x3d37('0xd')],'id');for(var _0x806096=0x0,_0x3982e5={},_0x31a92e={};_0x806096<_0x5a1467['length'];_0x806096+=0x1){_0x3982e5=_0x5a1467[_0x806096];if(_[_0x3d37('0x1e')](_0x2ef871[_0x3d37('0xd')][_0x3982e5['id']])){_0x2ef871['openchannelQueues'][_0x3982e5['id']]=new OpenchannelQueue(_0x3982e5);}else{_0x2ef871[_0x3d37('0x1c')](_0x2ef871[_0x3d37('0xd')][_0x3982e5['id']],_0x3982e5);}_0x2ef871[_0x3d37('0xd')][_0x3982e5['id']]['updateRouting']();_0x2ef871[_0x3d37('0xd')][_0x3982e5['id']][_0x3d37('0x20')]();}}return _0x2ef871['openchannelQueues'];};};Realtime[_0x3d37('0x19')]['initChatQueues']=function(){var _0x1fb6a4=this;return function(_0x4d1ff8){if(_0x4d1ff8){freeIsNotKey(_0x4d1ff8,_0x1fb6a4[_0x3d37('0xe')],'id');for(var _0x476b62=0x0,_0x55c55={},_0x5c9a7e={};_0x476b62<_0x4d1ff8[_0x3d37('0x1b')];_0x476b62+=0x1){_0x55c55=_0x4d1ff8[_0x476b62];if(_[_0x3d37('0x1e')](_0x1fb6a4[_0x3d37('0xe')][_0x55c55['id']])){_0x1fb6a4[_0x3d37('0xe')][_0x55c55['id']]=new ChatQueue(_0x55c55);}else{_0x1fb6a4[_0x3d37('0x1c')](_0x1fb6a4[_0x3d37('0xe')][_0x55c55['id']],_0x55c55);}_0x1fb6a4[_0x3d37('0xe')][_0x55c55['id']][_0x3d37('0x21')]();_0x1fb6a4[_0x3d37('0xe')][_0x55c55['id']][_0x3d37('0x20')]();}}return _0x1fb6a4[_0x3d37('0xe')];};};Realtime['prototype']['initSmsQueues']=function(){var _0x44ff61=this;return function(_0x2fa612){if(_0x2fa612){freeIsNotKey(_0x2fa612,_0x44ff61[_0x3d37('0xf')],'id');for(var _0x462d3b=0x0,_0x38e55a={},_0x4a3135={};_0x462d3b<_0x2fa612['length'];_0x462d3b+=0x1){_0x38e55a=_0x2fa612[_0x462d3b];if(_[_0x3d37('0x1e')](_0x44ff61['smsQueues'][_0x38e55a['id']])){_0x44ff61[_0x3d37('0xf')][_0x38e55a['id']]=new SmsQueue(_0x38e55a);}else{_0x44ff61[_0x3d37('0x1c')](_0x44ff61[_0x3d37('0xf')][_0x38e55a['id']],_0x38e55a);}_0x44ff61[_0x3d37('0xf')][_0x38e55a['id']]['updateRouting']();_0x44ff61[_0x3d37('0xf')][_0x38e55a['id']]['updateRealtime']();}}return _0x44ff61[_0x3d37('0xf')];};};Realtime['prototype'][_0x3d37('0x22')]=function(){var _0x4128c0=this;return function(_0x5519ea){if(_0x5519ea){freeIsNotKey(_0x5519ea,_0x4128c0['mailQueues'],'id');for(var _0x931292=0x0,_0xbd197d={},_0x1ba392={};_0x931292<_0x5519ea[_0x3d37('0x1b')];_0x931292+=0x1){_0xbd197d=_0x5519ea[_0x931292];if(_[_0x3d37('0x1e')](_0x4128c0[_0x3d37('0x10')][_0xbd197d['id']])){_0x4128c0['mailQueues'][_0xbd197d['id']]=new MailQueue(_0xbd197d);}else{_0x4128c0['mergeFromDatabase'](_0x4128c0['mailQueues'][_0xbd197d['id']],_0xbd197d);}_0x4128c0[_0x3d37('0x10')][_0xbd197d['id']]['updateRouting']();_0x4128c0[_0x3d37('0x10')][_0xbd197d['id']][_0x3d37('0x20')]();}}return _0x4128c0[_0x3d37('0x10')];};};Realtime[_0x3d37('0x19')]['initFaxQueues']=function(){var _0x9a9525=this;return function(_0x2c668e){if(_0x2c668e){freeIsNotKey(_0x2c668e,_0x9a9525[_0x3d37('0x11')],'id');for(var _0x2cf349=0x0,_0x28f115={},_0xc15470={};_0x2cf349<_0x2c668e[_0x3d37('0x1b')];_0x2cf349+=0x1){_0x28f115=_0x2c668e[_0x2cf349];if(_[_0x3d37('0x1e')](_0x9a9525[_0x3d37('0x11')][_0x28f115['id']])){_0x9a9525[_0x3d37('0x11')][_0x28f115['id']]=new FaxQueue(_0x28f115);}else{_0x9a9525['mergeFromDatabase'](_0x9a9525[_0x3d37('0x11')][_0x28f115['id']],_0x28f115);}_0x9a9525[_0x3d37('0x11')][_0x28f115['id']]['updateRouting']();_0x9a9525[_0x3d37('0x11')][_0x28f115['id']][_0x3d37('0x20')]();}}return _0x9a9525[_0x3d37('0x11')];};};module[_0x3d37('0x23')]=Realtime; \ No newline at end of file +var _0x42b8=['chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','intervals','length','isUndefined','initOpenchannelQueues','openchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','mailQueues','initFaxQueues','faxQueues','exports','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/smsQueue','../model/faxQueue','agents','chatQueues','smsQueues'];(function(_0x1d82de,_0x2fab74){var _0xe002d7=function(_0xfa9142){while(--_0xfa9142){_0x1d82de['push'](_0x1d82de['shift']());}};_0xe002d7(++_0x2fab74);}(_0x42b8,0x18d));var _0x842b=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x42b8[_0x178e48];return _0x440d7e;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var moment=require(_0x842b('0x0'));var Agent=require(_0x842b('0x1'));var Interval=require(_0x842b('0x2'));var OpenchannelQueue=require(_0x842b('0x3'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0x842b('0x4'));var MailQueue=require('../model/mailQueue');var FaxQueue=require(_0x842b('0x5'));var Realtime=function(){this[_0x842b('0x6')]={};this['intervals']={};this['openchannelQueues']={};this[_0x842b('0x7')]={};this[_0x842b('0x8')]={};this['mailQueues']={};this['faxQueues']={};this[_0x842b('0x9')]={};this[_0x842b('0xa')]={};this[_0x842b('0xb')]={};this['smsQueuesWaitingInteractions']={};this[_0x842b('0xc')]={};};function freeIsNotKey(_0x5e4fd9,_0x20de20,_0x229005){var _0x45bed6=_['mapKeys'](_0x5e4fd9,function(_0x16b15f,_0x1aa964){return _0x16b15f[_0x229005];});for(var _0xc9c998 in _0x20de20){if(_0x20de20[_0x842b('0xd')](_0xc9c998)){if(!_0x45bed6[_0xc9c998]){delete _0x20de20[_0xc9c998];}}}}Realtime[_0x842b('0xe')]['mergeFromDatabase']=function(_0x5a6ec8,_0x11f665){for(var _0x1fda68 in _0x11f665){if(_0x5a6ec8[_0x842b('0xd')](_0x1fda68)){_0x5a6ec8[_0x1fda68]=_0x11f665[_0x1fda68];}}};Realtime[_0x842b('0xe')]['initAgents']=function(){var _0x38e9b4=this;return function(_0x44034f){if(_0x44034f){freeIsNotKey(_0x44034f,_0x38e9b4['agents'],'id');for(var _0x325447=0x0,_0x29da16={},_0xec0332={};_0x325447<_0x44034f['length'];_0x325447+=0x1){_0x29da16=_0x44034f[_0x325447];if(_['isUndefined'](_0x38e9b4[_0x842b('0x6')][_0x29da16['id']])){_0x38e9b4['agents'][_0x29da16['id']]=new Agent(_0x29da16);}else{_0x38e9b4[_0x842b('0xf')](_0x38e9b4[_0x842b('0x6')][_0x29da16['id']],_0x29da16);}}}return _0x38e9b4[_0x842b('0x6')];};};Realtime[_0x842b('0xe')]['initIntervals']=function(){var _0x1e5045=this;return function(_0x73569e){if(_0x73569e){freeIsNotKey(_0x73569e,_0x1e5045[_0x842b('0x10')],'id');for(var _0x1847b4=0x0,_0xa48731={},_0x4b6275={};_0x1847b4<_0x73569e[_0x842b('0x11')];_0x1847b4+=0x1){_0xa48731=_0x73569e[_0x1847b4];if(_[_0x842b('0x12')](_0x1e5045[_0x842b('0x10')][_0xa48731['id']])){_0x1e5045[_0x842b('0x10')][_0xa48731['id']]=new Interval(_0xa48731);}else{_0x1e5045[_0x842b('0xf')](_0x1e5045['intervals'][_0xa48731['id']],_0xa48731);}}}return _0x1e5045[_0x842b('0x10')];};};Realtime['prototype'][_0x842b('0x13')]=function(){var _0x3e1665=this;return function(_0x200ef9){if(_0x200ef9){freeIsNotKey(_0x200ef9,_0x3e1665[_0x842b('0x14')],'id');for(var _0x405410=0x0,_0x49da3d={},_0x6f5b4={};_0x405410<_0x200ef9[_0x842b('0x11')];_0x405410+=0x1){_0x49da3d=_0x200ef9[_0x405410];if(_[_0x842b('0x12')](_0x3e1665['openchannelQueues'][_0x49da3d['id']])){_0x3e1665['openchannelQueues'][_0x49da3d['id']]=new OpenchannelQueue(_0x49da3d);}else{_0x3e1665[_0x842b('0xf')](_0x3e1665[_0x842b('0x14')][_0x49da3d['id']],_0x49da3d);}_0x3e1665['openchannelQueues'][_0x49da3d['id']][_0x842b('0x15')]();_0x3e1665[_0x842b('0x14')][_0x49da3d['id']][_0x842b('0x16')]();}}return _0x3e1665[_0x842b('0x14')];};};Realtime[_0x842b('0xe')][_0x842b('0x17')]=function(){var _0x46e49d=this;return function(_0x25f8a9){if(_0x25f8a9){freeIsNotKey(_0x25f8a9,_0x46e49d[_0x842b('0x7')],'id');for(var _0x46796a=0x0,_0x1472d2={},_0x545882={};_0x46796a<_0x25f8a9[_0x842b('0x11')];_0x46796a+=0x1){_0x1472d2=_0x25f8a9[_0x46796a];if(_['isUndefined'](_0x46e49d[_0x842b('0x7')][_0x1472d2['id']])){_0x46e49d[_0x842b('0x7')][_0x1472d2['id']]=new ChatQueue(_0x1472d2);}else{_0x46e49d[_0x842b('0xf')](_0x46e49d[_0x842b('0x7')][_0x1472d2['id']],_0x1472d2);}_0x46e49d[_0x842b('0x7')][_0x1472d2['id']]['updateRouting']();_0x46e49d[_0x842b('0x7')][_0x1472d2['id']][_0x842b('0x16')]();}}return _0x46e49d[_0x842b('0x7')];};};Realtime[_0x842b('0xe')][_0x842b('0x18')]=function(){var _0x59d2be=this;return function(_0x367cb5){if(_0x367cb5){freeIsNotKey(_0x367cb5,_0x59d2be[_0x842b('0x8')],'id');for(var _0x5de075=0x0,_0x111b95={},_0x4aa8ee={};_0x5de075<_0x367cb5[_0x842b('0x11')];_0x5de075+=0x1){_0x111b95=_0x367cb5[_0x5de075];if(_['isUndefined'](_0x59d2be[_0x842b('0x8')][_0x111b95['id']])){_0x59d2be[_0x842b('0x8')][_0x111b95['id']]=new SmsQueue(_0x111b95);}else{_0x59d2be[_0x842b('0xf')](_0x59d2be[_0x842b('0x8')][_0x111b95['id']],_0x111b95);}_0x59d2be[_0x842b('0x8')][_0x111b95['id']][_0x842b('0x15')]();_0x59d2be[_0x842b('0x8')][_0x111b95['id']][_0x842b('0x16')]();}}return _0x59d2be[_0x842b('0x8')];};};Realtime[_0x842b('0xe')]['initMailQueues']=function(){var _0x18a03d=this;return function(_0x3cef06){if(_0x3cef06){freeIsNotKey(_0x3cef06,_0x18a03d[_0x842b('0x19')],'id');for(var _0x2802e2=0x0,_0x1b544f={},_0x57bc4d={};_0x2802e2<_0x3cef06[_0x842b('0x11')];_0x2802e2+=0x1){_0x1b544f=_0x3cef06[_0x2802e2];if(_[_0x842b('0x12')](_0x18a03d[_0x842b('0x19')][_0x1b544f['id']])){_0x18a03d[_0x842b('0x19')][_0x1b544f['id']]=new MailQueue(_0x1b544f);}else{_0x18a03d[_0x842b('0xf')](_0x18a03d['mailQueues'][_0x1b544f['id']],_0x1b544f);}_0x18a03d['mailQueues'][_0x1b544f['id']]['updateRouting']();_0x18a03d[_0x842b('0x19')][_0x1b544f['id']]['updateRealtime']();}}return _0x18a03d[_0x842b('0x19')];};};Realtime[_0x842b('0xe')][_0x842b('0x1a')]=function(){var _0x10e054=this;return function(_0x3a6dfc){if(_0x3a6dfc){freeIsNotKey(_0x3a6dfc,_0x10e054[_0x842b('0x1b')],'id');for(var _0x172167=0x0,_0x1c01c5={},_0x29bfdb={};_0x172167<_0x3a6dfc[_0x842b('0x11')];_0x172167+=0x1){_0x1c01c5=_0x3a6dfc[_0x172167];if(_[_0x842b('0x12')](_0x10e054[_0x842b('0x1b')][_0x1c01c5['id']])){_0x10e054[_0x842b('0x1b')][_0x1c01c5['id']]=new FaxQueue(_0x1c01c5);}else{_0x10e054['mergeFromDatabase'](_0x10e054[_0x842b('0x1b')][_0x1c01c5['id']],_0x1c01c5);}_0x10e054[_0x842b('0x1b')][_0x1c01c5['id']][_0x842b('0x15')]();_0x10e054[_0x842b('0x1b')][_0x1c01c5['id']][_0x842b('0x16')]();}}return _0x10e054[_0x842b('0x1b')];};};module[_0x842b('0x1c')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index efa4bf1..ffacc1d 100644 --- a/server/services/routing/rpc/chatInteraction.js +++ b/server/services/routing/rpc/chatInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bca=['update','Request','UpdateChatInteraction','updateChatInteraction','addTagsToChatInteraction','../client'];(function(_0xa4fa95,_0x73b11a){var _0x521a96=function(_0x3de6ce){while(--_0x3de6ce){_0xa4fa95['push'](_0xa4fa95['shift']());}};_0x521a96(++_0x73b11a);}(_0x0bca,0x119));var _0xa0bc=function(_0x332862,_0x374c82){_0x332862=_0x332862-0x0;var _0xa37e14=_0x0bca[_0x332862];return _0xa37e14;};'use strict';var client=require(_0xa0bc('0x0'));exports[_0xa0bc('0x1')]=function(_0x19b206,_0x420233){return client[_0xa0bc('0x2')](_0xa0bc('0x3'),{'body':_0x420233,'options':{'where':{'id':_0x19b206}},'log':_0xa0bc('0x4')});};exports['addTags']=function(_0x51252a,_0x4b1338){return client['Request']('AddTagsToChatInteraction',{'body':_0x4b1338,'options':{'where':{'id':_0x51252a}},'log':_0xa0bc('0x5')});}; \ No newline at end of file +var _0x168d=['updateChatInteraction','addTags','Request','addTagsToChatInteraction','../client','update','UpdateChatInteraction'];(function(_0x1eec6d,_0x35d43f){var _0x391ec1=function(_0x270762){while(--_0x270762){_0x1eec6d['push'](_0x1eec6d['shift']());}};_0x391ec1(++_0x35d43f);}(_0x168d,0x169));var _0xd168=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x168d[_0x2070da];return _0x4f9fe1;};'use strict';var client=require(_0xd168('0x0'));exports[_0xd168('0x1')]=function(_0x277e03,_0x7f127d){return client['Request'](_0xd168('0x2'),{'body':_0x7f127d,'options':{'where':{'id':_0x277e03}},'log':_0xd168('0x3')});};exports[_0xd168('0x4')]=function(_0x181102,_0x441094){return client[_0xd168('0x5')]('AddTagsToChatInteraction',{'body':_0x441094,'options':{'where':{'id':_0x181102}},'log':_0xd168('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 94fdbc4..ff07e5a 100644 --- a/server/services/routing/rpc/chatMessage.js +++ b/server/services/routing/rpc/chatMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3da7=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x23d0b7,_0xf2029a){var _0xed2a3a=function(_0x3c0b3c){while(--_0x3c0b3c){_0x23d0b7['push'](_0x23d0b7['shift']());}};_0xed2a3a(++_0xf2029a);}(_0x3da7,0x15d));var _0x73da=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0x3da7[_0xe45118];return _0x15e15d;};'use strict';var client=require(_0x73da('0x0'));exports[_0x73da('0x1')]=function(_0x34a2ba){return client[_0x73da('0x2')](_0x73da('0x3'),{'body':_0x34a2ba,'log':_0x73da('0x4')});}; \ No newline at end of file +var _0x3b12=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x4b6776,_0x3349ab){var _0x1a83a8=function(_0x1bb6a2){while(--_0x1bb6a2){_0x4b6776['push'](_0x4b6776['shift']());}};_0x1a83a8(++_0x3349ab);}(_0x3b12,0xc2));var _0x23b1=function(_0x5595d8,_0x56bd2b){_0x5595d8=_0x5595d8-0x0;var _0x1bfc32=_0x3b12[_0x5595d8];return _0x1bfc32;};'use strict';var client=require('../client');exports[_0x23b1('0x0')]=function(_0x28f257){return client[_0x23b1('0x1')](_0x23b1('0x2'),{'body':_0x28f257,'log':_0x23b1('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 5e0ba5a..bfd082a 100644 --- a/server/services/routing/rpc/chatQueue.js +++ b/server/services/routing/rpc/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6154=['getChatQueues','../client','GetChatQueue','name','timeout','strategy','User','Agents','chatPause'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x6154,0xc7));var _0x4615=function(_0x2c66df,_0x343e32){_0x2c66df=_0x2c66df-0x0;var _0x1c1c46=_0x6154[_0x2c66df];return _0x1c1c46;};'use strict';var client=require(_0x4615('0x0'));exports['getChatQueues']=function(){return function(){return client['Request'](_0x4615('0x1'),{'options':{'raw':![],'attributes':['id',_0x4615('0x2'),_0x4615('0x3'),_0x4615('0x4')],'include':[{'model':_0x4615('0x5'),'as':_0x4615('0x6'),'attributes':['id',_0x4615('0x2'),'online',_0x4615('0x7')]}]},'log':_0x4615('0x8')});};}; \ No newline at end of file +var _0x00a9=['getChatQueues','Request','name','strategy','online','chatPause','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x00a9,0x92));var _0x900a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x00a9[_0x3ab51d];return _0x29a04e;};'use strict';var client=require(_0x900a('0x0'));exports[_0x900a('0x1')]=function(){return function(){return client[_0x900a('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x900a('0x3'),'timeout',_0x900a('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x900a('0x5'),_0x900a('0x6')]}]},'log':_0x900a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 64fc56d..90fb87c 100644 --- a/server/services/routing/rpc/chatQueueReport.js +++ b/server/services/routing/rpc/chatQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3df4=['update','DESC','UpdateChatQueueReport','Request','CreateChatQueueReport'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x3df4,0x102));var _0x43df=function(_0x2c8653,_0x2dde22){_0x2c8653=_0x2c8653-0x0;var _0x350c7b=_0x3df4[_0x2c8653];return _0x350c7b;};'use strict';var client=require('../client');exports['create']=function(_0x2495e3){return client[_0x43df('0x0')](_0x43df('0x1'),{'body':_0x2495e3,'log':_0x43df('0x1')});};exports[_0x43df('0x2')]=function(_0x2985bf,_0x4297f4){return client['Request']('UpdateChatQueueReport',{'body':_0x4297f4,'options':{'where':{'uniqueid':_0x2985bf},'order':[['id',_0x43df('0x3')]],'limit':0x1},'log':_0x43df('0x4')});}; \ No newline at end of file +var _0x826a=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x4a1a90,_0x303214){var _0x343585=function(_0x18f175){while(--_0x18f175){_0x4a1a90['push'](_0x4a1a90['shift']());}};_0x343585(++_0x303214);}(_0x826a,0x1aa));var _0xa826=function(_0x404709,_0x33cde8){_0x404709=_0x404709-0x0;var _0x37f070=_0x826a[_0x404709];return _0x37f070;};'use strict';var client=require('../client');exports[_0xa826('0x0')]=function(_0x5bb1d7){return client[_0xa826('0x1')]('CreateChatQueueReport',{'body':_0x5bb1d7,'log':_0xa826('0x2')});};exports[_0xa826('0x3')]=function(_0x2212a4,_0x34e1ad){return client['Request'](_0xa826('0x4'),{'body':_0x34e1ad,'options':{'where':{'uniqueid':_0x2212a4},'order':[['id',_0xa826('0x5')]],'limit':0x1},'log':_0xa826('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 240e19a..67723eb 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8f3=['../client','update','Request','updateFaxInteraction','addTagsToFaxInteraction'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xe8f3,0x140));var _0x3e8f=function(_0x184dda,_0x2d53e5){_0x184dda=_0x184dda-0x0;var _0x65d1f8=_0xe8f3[_0x184dda];return _0x65d1f8;};'use strict';var client=require(_0x3e8f('0x0'));exports[_0x3e8f('0x1')]=function(_0xc180b4,_0x1cdaea){return client[_0x3e8f('0x2')]('UpdateFaxInteraction',{'body':_0x1cdaea,'options':{'where':{'id':_0xc180b4}},'log':_0x3e8f('0x3')});};exports['addTags']=function(_0xbc9b75,_0x5c1616){return client[_0x3e8f('0x2')]('AddTagsToFaxInteraction',{'body':_0x5c1616,'options':{'where':{'id':_0xbc9b75}},'log':_0x3e8f('0x4')});}; \ No newline at end of file +var _0xe473=['update','updateFaxInteraction','addTags','Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0xe473,0x15d));var _0x3e47=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0xe473[_0x4b91c4];return _0x25cb80;};'use strict';var client=require(_0x3e47('0x0'));exports[_0x3e47('0x1')]=function(_0x201edb,_0x53762f){return client['Request']('UpdateFaxInteraction',{'body':_0x53762f,'options':{'where':{'id':_0x201edb}},'log':_0x3e47('0x2')});};exports[_0x3e47('0x3')]=function(_0x37a920,_0xdc0770){return client[_0x3e47('0x4')](_0x3e47('0x5'),{'body':_0xdc0770,'options':{'where':{'id':_0x37a920}},'log':_0x3e47('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index a81789e..a4c84fb 100644 --- a/server/services/routing/rpc/faxMessage.js +++ b/server/services/routing/rpc/faxMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f29=['create','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9f29,0x1a1));var _0x99f2=function(_0xaef738,_0x540933){_0xaef738=_0xaef738-0x0;var _0x5c2a13=_0x9f29[_0xaef738];return _0x5c2a13;};'use strict';var client=require(_0x99f2('0x0'));exports[_0x99f2('0x1')]=function(_0x280ad3){return client['Request']('CreateFaxMessage',{'body':_0x280ad3,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xcb06=['createFaxMessage','CreateFaxMessage'];(function(_0x40ece4,_0x138c9b){var _0x2985c7=function(_0x20201b){while(--_0x20201b){_0x40ece4['push'](_0x40ece4['shift']());}};_0x2985c7(++_0x138c9b);}(_0xcb06,0x91));var _0x6cb0=function(_0x5f584a,_0x47f064){_0x5f584a=_0x5f584a-0x0;var _0x3788d9=_0xcb06[_0x5f584a];return _0x3788d9;};'use strict';var client=require('../client');exports['create']=function(_0x15a4bb){return client['Request'](_0x6cb0('0x0'),{'body':_0x15a4bb,'log':_0x6cb0('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 1f8ef1d..0276440 100644 --- a/server/services/routing/rpc/faxQueue.js +++ b/server/services/routing/rpc/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f3f=['Request','GetFaxQueue','name','timeout','strategy','User','Agents','online','faxPause'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x7f3f,0x156));var _0xf7f3=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0x7f3f[_0x5179a5];return _0x15c8ce;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0xf7f3('0x0')](_0xf7f3('0x1'),{'options':{'raw':![],'attributes':['id',_0xf7f3('0x2'),_0xf7f3('0x3'),_0xf7f3('0x4')],'include':[{'model':_0xf7f3('0x5'),'as':_0xf7f3('0x6'),'attributes':['id',_0xf7f3('0x2'),_0xf7f3('0x7'),_0xf7f3('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x9bba=['online','faxPause','getFaxQueues','name','timeout','User'];(function(_0x42c174,_0x2e6170){var _0xeffce2=function(_0x1a78b3){while(--_0x1a78b3){_0x42c174['push'](_0x42c174['shift']());}};_0xeffce2(++_0x2e6170);}(_0x9bba,0x87));var _0xa9bb=function(_0x3a64c0,_0x506599){_0x3a64c0=_0x3a64c0-0x0;var _0x594555=_0x9bba[_0x3a64c0];return _0x594555;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xa9bb('0x0'),_0xa9bb('0x1'),'strategy'],'include':[{'model':_0xa9bb('0x2'),'as':'Agents','attributes':['id',_0xa9bb('0x0'),_0xa9bb('0x3'),_0xa9bb('0x4')]}]},'log':_0xa9bb('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 45a404f..75e0cb9 100644 --- a/server/services/routing/rpc/faxQueueReport.js +++ b/server/services/routing/rpc/faxQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2ca=['DESC','../client','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x180b37,_0x283de2){var _0xd036ce=function(_0x36d104){while(--_0x36d104){_0x180b37['push'](_0x180b37['shift']());}};_0xd036ce(++_0x283de2);}(_0xd2ca,0x15a));var _0xad2c=function(_0x53667e,_0x2a4d39){_0x53667e=_0x53667e-0x0;var _0x466b69=_0xd2ca[_0x53667e];return _0x466b69;};'use strict';var client=require(_0xad2c('0x0'));exports['create']=function(_0x5b81eb){return client['Request'](_0xad2c('0x1'),{'body':_0x5b81eb,'log':'CreateFaxQueueReport'});};exports[_0xad2c('0x2')]=function(_0x590cb6,_0x55cdd6){return client['Request'](_0xad2c('0x3'),{'body':_0x55cdd6,'options':{'where':{'uniqueid':_0x590cb6},'order':[['id',_0xad2c('0x4')]],'limit':0x1},'log':_0xad2c('0x3')});}; \ No newline at end of file +var _0xb3db=['update','UpdateFaxQueueReport','DESC','create','Request','CreateFaxQueueReport'];(function(_0x5df25b,_0x1bc928){var _0x19f252=function(_0x41de28){while(--_0x41de28){_0x5df25b['push'](_0x5df25b['shift']());}};_0x19f252(++_0x1bc928);}(_0xb3db,0x159));var _0xbb3d=function(_0x4c5c97,_0x4f85bf){_0x4c5c97=_0x4c5c97-0x0;var _0xd5d2cb=_0xb3db[_0x4c5c97];return _0xd5d2cb;};'use strict';var client=require('../client');exports[_0xbb3d('0x0')]=function(_0x443010){return client[_0xbb3d('0x1')](_0xbb3d('0x2'),{'body':_0x443010,'log':_0xbb3d('0x2')});};exports[_0xbb3d('0x3')]=function(_0x1d5e81,_0x47db6d){return client[_0xbb3d('0x1')](_0xbb3d('0x4'),{'body':_0x47db6d,'options':{'where':{'uniqueid':_0x1d5e81},'order':[['id',_0xbb3d('0x5')]],'limit':0x1},'log':_0xbb3d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f608494..0f383e3 100644 --- a/server/services/routing/rpc/interval.js +++ b/server/services/routing/rpc/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6324=['Request','GetInterval','Interval','name','../client','getIntervals'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0x6324,0x142));var _0x4632=function(_0x581960,_0x1232ff){_0x581960=_0x581960-0x0;var _0x4ee892=_0x6324[_0x581960];return _0x4ee892;};'use strict';var client=require(_0x4632('0x0'));exports[_0x4632('0x1')]=function(){return function(){return client[_0x4632('0x2')](_0x4632('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x4632('0x4'),'as':'Intervals','attributes':['id',_0x4632('0x5'),'interval']}]},'log':_0x4632('0x1')});};}; \ No newline at end of file +var _0xe820=['../client','Request','Interval','Intervals','name','getIntervals'];(function(_0xed2d6e,_0x21a42b){var _0x47af69=function(_0x5902b6){while(--_0x5902b6){_0xed2d6e['push'](_0xed2d6e['shift']());}};_0x47af69(++_0x21a42b);}(_0xe820,0xd2));var _0x0e82=function(_0x401f88,_0x543f52){_0x401f88=_0x401f88-0x0;var _0x270ee2=_0xe820[_0x401f88];return _0x270ee2;};'use strict';var client=require(_0x0e82('0x0'));exports['getIntervals']=function(){return function(){return client[_0x0e82('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x0e82('0x2'),'as':_0x0e82('0x3'),'attributes':['id',_0x0e82('0x4'),'interval']}]},'log':_0x0e82('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 4912fca..924787d 100644 --- a/server/services/routing/rpc/mailInteraction.js +++ b/server/services/routing/rpc/mailInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe90=['UpdateMailInteraction','updateMailInteraction','addTags','Request','AddTagsToMailInteraction','addTagsToChatInteraction','update'];(function(_0x5b8fd2,_0x46de96){var _0x9acfec=function(_0x2f5411){while(--_0x2f5411){_0x5b8fd2['push'](_0x5b8fd2['shift']());}};_0x9acfec(++_0x46de96);}(_0xfe90,0x1b8));var _0x0fe9=function(_0x48b991,_0x58806f){_0x48b991=_0x48b991-0x0;var _0x5c82f3=_0xfe90[_0x48b991];return _0x5c82f3;};'use strict';var client=require('../client');exports[_0x0fe9('0x0')]=function(_0x1f56e9,_0x545fe5){return client['Request'](_0x0fe9('0x1'),{'body':_0x545fe5,'options':{'where':{'id':_0x1f56e9}},'log':_0x0fe9('0x2')});};exports[_0x0fe9('0x3')]=function(_0xbb5821,_0x37f5c0){return client[_0x0fe9('0x4')](_0x0fe9('0x5'),{'body':_0x37f5c0,'options':{'where':{'id':_0xbb5821}},'log':_0x0fe9('0x6')});}; \ No newline at end of file +var _0x107b=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x186edd,_0x16afae){var _0x447af8=function(_0x280a1b){while(--_0x280a1b){_0x186edd['push'](_0x186edd['shift']());}};_0x447af8(++_0x16afae);}(_0x107b,0x1b7));var _0xb107=function(_0x55acd5,_0x253431){_0x55acd5=_0x55acd5-0x0;var _0x33fabd=_0x107b[_0x55acd5];return _0x33fabd;};'use strict';var client=require(_0xb107('0x0'));exports[_0xb107('0x1')]=function(_0x4c5b96,_0x17bbe8){return client[_0xb107('0x2')](_0xb107('0x3'),{'body':_0x17bbe8,'options':{'where':{'id':_0x4c5b96}},'log':_0xb107('0x4')});};exports[_0xb107('0x5')]=function(_0x6d9042,_0x30216d){return client['Request'](_0xb107('0x6'),{'body':_0x30216d,'options':{'where':{'id':_0x6d9042}},'log':_0xb107('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index a383f66..a4cf1b0 100644 --- a/server/services/routing/rpc/mailMessage.js +++ b/server/services/routing/rpc/mailMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3596=['Request','createMailMessage','../client'];(function(_0x4d9efa,_0x2c75d3){var _0x4601ef=function(_0x429728){while(--_0x429728){_0x4d9efa['push'](_0x4d9efa['shift']());}};_0x4601ef(++_0x2c75d3);}(_0x3596,0xcb));var _0x6359=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x3596[_0x16d10f];return _0x50c823;};'use strict';var client=require(_0x6359('0x0'));exports['create']=function(_0x5217e1){return client[_0x6359('0x1')]('CreateMailMessage',{'body':_0x5217e1,'log':_0x6359('0x2')});}; \ No newline at end of file +var _0xd196=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd196,0x126));var _0x6d19=function(_0x4503df,_0xfec122){_0x4503df=_0x4503df-0x0;var _0x3f1b2b=_0xd196[_0x4503df];return _0x3f1b2b;};'use strict';var client=require(_0x6d19('0x0'));exports[_0x6d19('0x1')]=function(_0x137b2b){return client[_0x6d19('0x2')](_0x6d19('0x3'),{'body':_0x137b2b,'log':_0x6d19('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 4e2b90f..101cf9e 100644 --- a/server/services/routing/rpc/mailQueue.js +++ b/server/services/routing/rpc/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa63f=['online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','Agents'];(function(_0x5b83d7,_0x35d1bb){var _0x44b1ab=function(_0x2d5a66){while(--_0x2d5a66){_0x5b83d7['push'](_0x5b83d7['shift']());}};_0x44b1ab(++_0x35d1bb);}(_0xa63f,0x157));var _0xfa63=function(_0x5c468f,_0x2e5c25){_0x5c468f=_0x5c468f-0x0;var _0x2136b0=_0xa63f[_0x5c468f];return _0x2136b0;};'use strict';var client=require(_0xfa63('0x0'));exports[_0xfa63('0x1')]=function(){return function(){return client[_0xfa63('0x2')](_0xfa63('0x3'),{'options':{'raw':![],'attributes':['id',_0xfa63('0x4'),_0xfa63('0x5'),_0xfa63('0x6')],'include':[{'model':_0xfa63('0x7'),'as':_0xfa63('0x8'),'attributes':['id',_0xfa63('0x4'),_0xfa63('0x9'),_0xfa63('0xa')]}]},'log':_0xfa63('0x1')});};}; \ No newline at end of file +var _0x2901=['timeout','strategy','User','Agents','online','mailPause','../client','getMailQueues','Request','name'];(function(_0x3c6f25,_0x210609){var _0x3c6b03=function(_0x560650){while(--_0x560650){_0x3c6f25['push'](_0x3c6f25['shift']());}};_0x3c6b03(++_0x210609);}(_0x2901,0xf6));var _0x1290=function(_0x51eba9,_0x2a48c9){_0x51eba9=_0x51eba9-0x0;var _0x38f890=_0x2901[_0x51eba9];return _0x38f890;};'use strict';var client=require(_0x1290('0x0'));exports[_0x1290('0x1')]=function(){return function(){return client[_0x1290('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x1290('0x3'),_0x1290('0x4'),_0x1290('0x5')],'include':[{'model':_0x1290('0x6'),'as':_0x1290('0x7'),'attributes':['id',_0x1290('0x3'),_0x1290('0x8'),_0x1290('0x9')]}]},'log':_0x1290('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 188d47c..f101ae5 100644 --- a/server/services/routing/rpc/mailQueueReport.js +++ b/server/services/routing/rpc/mailQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34cc=['../client','create','Request','CreateMailQueueReport','UpdateMailQueueReport','DESC'];(function(_0x1be5b7,_0xa8d705){var _0x1fb2d0=function(_0x231bb8){while(--_0x231bb8){_0x1be5b7['push'](_0x1be5b7['shift']());}};_0x1fb2d0(++_0xa8d705);}(_0x34cc,0x1a4));var _0xc34c=function(_0x10396c,_0x2a5466){_0x10396c=_0x10396c-0x0;var _0x1b5a90=_0x34cc[_0x10396c];return _0x1b5a90;};'use strict';var client=require(_0xc34c('0x0'));exports[_0xc34c('0x1')]=function(_0x4fd6b5){return client[_0xc34c('0x2')](_0xc34c('0x3'),{'body':_0x4fd6b5,'log':_0xc34c('0x3')});};exports['update']=function(_0x18dc62,_0x1a7f13){return client[_0xc34c('0x2')](_0xc34c('0x4'),{'body':_0x1a7f13,'options':{'where':{'uniqueid':_0x18dc62},'order':[['id',_0xc34c('0x5')]],'limit':0x1},'log':_0xc34c('0x4')});}; \ No newline at end of file +var _0xf9df=['create','CreateMailQueueReport','update','Request','UpdateMailQueueReport','../client'];(function(_0x470577,_0x4c6753){var _0xd499dc=function(_0x14c619){while(--_0x14c619){_0x470577['push'](_0x470577['shift']());}};_0xd499dc(++_0x4c6753);}(_0xf9df,0x65));var _0xff9d=function(_0x45608d,_0x5631cf){_0x45608d=_0x45608d-0x0;var _0x15d810=_0xf9df[_0x45608d];return _0x15d810;};'use strict';var client=require(_0xff9d('0x0'));exports[_0xff9d('0x1')]=function(_0x28c2b){return client['Request']('CreateMailQueueReport',{'body':_0x28c2b,'log':_0xff9d('0x2')});};exports[_0xff9d('0x3')]=function(_0x25cb37,_0x267df5){return client[_0xff9d('0x4')](_0xff9d('0x5'),{'body':_0x267df5,'options':{'where':{'uniqueid':_0x25cb37},'order':[['id','DESC']],'limit':0x1},'log':_0xff9d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index ae5f371..a4d0c26 100644 --- a/server/services/routing/rpc/openchannelInteraction.js +++ b/server/services/routing/rpc/openchannelInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb103=['addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x42ddfd,_0x31048a){var _0x5d8358=function(_0x142ea1){while(--_0x142ea1){_0x42ddfd['push'](_0x42ddfd['shift']());}};_0x5d8358(++_0x31048a);}(_0xb103,0xbb));var _0x3b10=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xb103[_0x4c440b];return _0x2d48cf;};'use strict';var client=require(_0x3b10('0x0'));exports[_0x3b10('0x1')]=function(_0x3e7184,_0x5ec65a){return client[_0x3b10('0x2')](_0x3b10('0x3'),{'body':_0x5ec65a,'options':{'where':{'id':_0x3e7184}},'log':_0x3b10('0x4')});};exports['addTags']=function(_0x29e313,_0x5394f7){return client[_0x3b10('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x5394f7,'options':{'where':{'id':_0x29e313}},'log':_0x3b10('0x5')});}; \ No newline at end of file +var _0xd360=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','updateOpenchannelInteraction'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xd360,0x8c));var _0x0d36=function(_0xf67d8e,_0xca9cc4){_0xf67d8e=_0xf67d8e-0x0;var _0xd0356b=_0xd360[_0xf67d8e];return _0xd0356b;};'use strict';var client=require('../client');exports['update']=function(_0x5645bc,_0x427d82){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x427d82,'options':{'where':{'id':_0x5645bc}},'log':_0x0d36('0x0')});};exports['addTags']=function(_0x2f7191,_0x1e0846){return client['Request'](_0x0d36('0x1'),{'body':_0x1e0846,'options':{'where':{'id':_0x2f7191}},'log':_0x0d36('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index a41b632..707df4d 100644 --- a/server/services/routing/rpc/openchannelMessage.js +++ b/server/services/routing/rpc/openchannelMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec5=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x480c7b,_0x59a4b8){var _0x560140=function(_0xfb58b7){while(--_0xfb58b7){_0x480c7b['push'](_0x480c7b['shift']());}};_0x560140(++_0x59a4b8);}(_0xbec5,0xe5));var _0x5bec=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xbec5[_0x53abe5];return _0xc1c37e;};'use strict';var client=require(_0x5bec('0x0'));exports[_0x5bec('0x1')]=function(_0x4cfc3b){return client[_0x5bec('0x2')](_0x5bec('0x3'),{'body':_0x4cfc3b,'log':_0x5bec('0x4')});}; \ No newline at end of file +var _0x153f=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x153f,0x15b));var _0xf153=function(_0x210387,_0x3e8857){_0x210387=_0x210387-0x0;var _0x136b3b=_0x153f[_0x210387];return _0x136b3b;};'use strict';var client=require(_0xf153('0x0'));exports[_0xf153('0x1')]=function(_0xde7eae){return client[_0xf153('0x2')](_0xf153('0x3'),{'body':_0xde7eae,'log':_0xf153('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 6f68787..091576b 100644 --- a/server/services/routing/rpc/openchannelQueue.js +++ b/server/services/routing/rpc/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d1a=['name','strategy','User','Agents','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue'];(function(_0x57a7fc,_0x53a266){var _0x11e9c2=function(_0x14558d){while(--_0x14558d){_0x57a7fc['push'](_0x57a7fc['shift']());}};_0x11e9c2(++_0x53a266);}(_0x6d1a,0x1ad));var _0xa6d1=function(_0x47fba0,_0x3f9314){_0x47fba0=_0x47fba0-0x0;var _0x452668=_0x6d1a[_0x47fba0];return _0x452668;};'use strict';var client=require(_0xa6d1('0x0'));exports[_0xa6d1('0x1')]=function(){return function(){return client['Request'](_0xa6d1('0x2'),{'options':{'raw':![],'attributes':['id',_0xa6d1('0x3'),'timeout',_0xa6d1('0x4')],'include':[{'model':_0xa6d1('0x5'),'as':_0xa6d1('0x6'),'attributes':['id',_0xa6d1('0x3'),'online',_0xa6d1('0x7')]}]},'log':_0xa6d1('0x1')});};}; \ No newline at end of file +var _0xf549=['User','Agents','openchannelPause','getOpenchannelQueues','name','timeout','strategy'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf549,0x97));var _0x9f54=function(_0x39d847,_0x5093f3){_0x39d847=_0x39d847-0x0;var _0x55a0ed=_0xf549[_0x39d847];return _0x55a0ed;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x9f54('0x0'),_0x9f54('0x1'),_0x9f54('0x2')],'include':[{'model':_0x9f54('0x3'),'as':_0x9f54('0x4'),'attributes':['id',_0x9f54('0x0'),'online',_0x9f54('0x5')]}]},'log':_0x9f54('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index dc09321..6847ded 100644 --- a/server/services/routing/rpc/openchannelQueueReport.js +++ b/server/services/routing/rpc/openchannelQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b3e=['UpdateOpenchannelQueueReport','DESC','../client','create','CreateOpenchannelQueueReport','update','Request'];(function(_0x19a919,_0x5d3e7e){var _0x2ea054=function(_0x5bca13){while(--_0x5bca13){_0x19a919['push'](_0x19a919['shift']());}};_0x2ea054(++_0x5d3e7e);}(_0x8b3e,0x6b));var _0xe8b3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8b3e[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xe8b3('0x0'));exports[_0xe8b3('0x1')]=function(_0x496acd){return client['Request'](_0xe8b3('0x2'),{'body':_0x496acd,'log':_0xe8b3('0x2')});};exports[_0xe8b3('0x3')]=function(_0x5f48c3,_0x27fba4){return client[_0xe8b3('0x4')](_0xe8b3('0x5'),{'body':_0x27fba4,'options':{'where':{'uniqueid':_0x5f48c3},'order':[['id',_0xe8b3('0x6')]],'limit':0x1},'log':_0xe8b3('0x5')});}; \ No newline at end of file +var _0xa7df=['UpdateOpenchannelQueueReport','../client','Request','CreateOpenchannelQueueReport','update'];(function(_0x25ef51,_0xf41277){var _0xb3cfed=function(_0x54d72c){while(--_0x54d72c){_0x25ef51['push'](_0x25ef51['shift']());}};_0xb3cfed(++_0xf41277);}(_0xa7df,0x1d2));var _0xfa7d=function(_0x1ef368,_0x8a3db5){_0x1ef368=_0x1ef368-0x0;var _0x2992ed=_0xa7df[_0x1ef368];return _0x2992ed;};'use strict';var client=require(_0xfa7d('0x0'));exports['create']=function(_0x23e30a){return client[_0xfa7d('0x1')](_0xfa7d('0x2'),{'body':_0x23e30a,'log':'CreateOpenchannelQueueReport'});};exports[_0xfa7d('0x3')]=function(_0x6805bf,_0x50389a){return client[_0xfa7d('0x1')](_0xfa7d('0x4'),{'body':_0x50389a,'options':{'where':{'uniqueid':_0x6805bf},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 5b98a30..cb662dd 100644 --- a/server/services/routing/rpc/smsInteraction.js +++ b/server/services/routing/rpc/smsInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27bd=['addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','AddTagsToSmsInteraction'];(function(_0x154983,_0xc29edf){var _0x3d1243=function(_0x5cb7a4){while(--_0x5cb7a4){_0x154983['push'](_0x154983['shift']());}};_0x3d1243(++_0xc29edf);}(_0x27bd,0x11e));var _0xd27b=function(_0x1e5acb,_0x33882a){_0x1e5acb=_0x1e5acb-0x0;var _0x32c620=_0x27bd[_0x1e5acb];return _0x32c620;};'use strict';var client=require(_0xd27b('0x0'));exports['update']=function(_0x5c86a1,_0x5c03b8){return client[_0xd27b('0x1')](_0xd27b('0x2'),{'body':_0x5c03b8,'options':{'where':{'id':_0x5c86a1}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x19386d,_0xd187d4){return client['Request'](_0xd27b('0x3'),{'body':_0xd187d4,'options':{'where':{'id':_0x19386d}},'log':_0xd27b('0x4')});}; \ No newline at end of file +var _0xf1f4=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xf1f4,0x13e));var _0x4f1f=function(_0x2c6652,_0x2ad6d9){_0x2c6652=_0x2c6652-0x0;var _0x3ddea9=_0xf1f4[_0x2c6652];return _0x3ddea9;};'use strict';var client=require(_0x4f1f('0x0'));exports[_0x4f1f('0x1')]=function(_0x2ab5ca,_0x1140e2){return client[_0x4f1f('0x2')](_0x4f1f('0x3'),{'body':_0x1140e2,'options':{'where':{'id':_0x2ab5ca}},'log':_0x4f1f('0x4')});};exports[_0x4f1f('0x5')]=function(_0x448a82,_0x93fcfd){return client[_0x4f1f('0x2')](_0x4f1f('0x6'),{'body':_0x93fcfd,'options':{'where':{'id':_0x448a82}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 5e88dca..c5ebd5b 100644 --- a/server/services/routing/rpc/smsMessage.js +++ b/server/services/routing/rpc/smsMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b09=['../client','create','CreateSmsMessage','createSmsMessage'];(function(_0x59e752,_0x4ad99d){var _0x5e6516=function(_0x4f299b){while(--_0x4f299b){_0x59e752['push'](_0x59e752['shift']());}};_0x5e6516(++_0x4ad99d);}(_0x0b09,0x13c));var _0x90b0=function(_0x40eff7,_0x5c80b9){_0x40eff7=_0x40eff7-0x0;var _0x12e162=_0x0b09[_0x40eff7];return _0x12e162;};'use strict';var client=require(_0x90b0('0x0'));exports[_0x90b0('0x1')]=function(_0x4815fa){return client['Request'](_0x90b0('0x2'),{'body':_0x4815fa,'log':_0x90b0('0x3')});}; \ No newline at end of file +var _0x282c=['createSmsMessage','../client','create','Request'];(function(_0x491e46,_0x20de84){var _0x23aaa0=function(_0x16adbf){while(--_0x16adbf){_0x491e46['push'](_0x491e46['shift']());}};_0x23aaa0(++_0x20de84);}(_0x282c,0xdd));var _0xc282=function(_0x4e1f16,_0x1bc29a){_0x4e1f16=_0x4e1f16-0x0;var _0x38ba48=_0x282c[_0x4e1f16];return _0x38ba48;};'use strict';var client=require(_0xc282('0x0'));exports[_0xc282('0x1')]=function(_0x1a8ade){return client[_0xc282('0x2')]('CreateSmsMessage',{'body':_0x1a8ade,'log':_0xc282('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 7243032..87f8c37 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1f1=['getSmsQueues','GetSmsQueue','name','timeout','strategy','User','Agents','smsPause','../client'];(function(_0x233d30,_0x563080){var _0x3988b3=function(_0xbacbbb){while(--_0xbacbbb){_0x233d30['push'](_0x233d30['shift']());}};_0x3988b3(++_0x563080);}(_0xd1f1,0xbc));var _0x1d1f=function(_0xad15c7,_0x210cb4){_0xad15c7=_0xad15c7-0x0;var _0x520045=_0xd1f1[_0xad15c7];return _0x520045;};'use strict';var client=require(_0x1d1f('0x0'));exports[_0x1d1f('0x1')]=function(){return function(){return client['Request'](_0x1d1f('0x2'),{'options':{'raw':![],'attributes':['id',_0x1d1f('0x3'),_0x1d1f('0x4'),_0x1d1f('0x5')],'include':[{'model':_0x1d1f('0x6'),'as':_0x1d1f('0x7'),'attributes':['id',_0x1d1f('0x3'),'online',_0x1d1f('0x8')]}]},'log':_0x1d1f('0x1')});};}; \ No newline at end of file +var _0x3338=['strategy','User','Agents','online','smsPause','../client','getSmsQueues','name','timeout'];(function(_0xd948a3,_0x49c4cf){var _0x3fc272=function(_0x1f8b2c){while(--_0x1f8b2c){_0xd948a3['push'](_0xd948a3['shift']());}};_0x3fc272(++_0x49c4cf);}(_0x3338,0xb0));var _0x8333=function(_0x2ddf2d,_0x272b8a){_0x2ddf2d=_0x2ddf2d-0x0;var _0x53dd02=_0x3338[_0x2ddf2d];return _0x53dd02;};'use strict';var client=require(_0x8333('0x0'));exports[_0x8333('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x8333('0x2'),_0x8333('0x3'),_0x8333('0x4')],'include':[{'model':_0x8333('0x5'),'as':_0x8333('0x6'),'attributes':['id',_0x8333('0x2'),_0x8333('0x7'),_0x8333('0x8')]}]},'log':_0x8333('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 8630310..fff3172 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93ab=['create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC','../client'];(function(_0x2b05a1,_0x1f776a){var _0x2f02cc=function(_0x358622){while(--_0x358622){_0x2b05a1['push'](_0x2b05a1['shift']());}};_0x2f02cc(++_0x1f776a);}(_0x93ab,0x1e2));var _0xb93a=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0x93ab[_0x2431d6];return _0x4d0f9b;};'use strict';var client=require(_0xb93a('0x0'));exports[_0xb93a('0x1')]=function(_0x248172){return client['Request']('CreateSmsQueueReport',{'body':_0x248172,'log':_0xb93a('0x2')});};exports[_0xb93a('0x3')]=function(_0x477f2c,_0x18a453){return client[_0xb93a('0x4')](_0xb93a('0x5'),{'body':_0x18a453,'options':{'where':{'uniqueid':_0x477f2c},'order':[['id',_0xb93a('0x6')]],'limit':0x1},'log':_0xb93a('0x5')});}; \ No newline at end of file +var _0x2652=['UpdateSmsQueueReport','../client','create','Request','CreateSmsQueueReport','update'];(function(_0x1af823,_0x588dc3){var _0x24be3d=function(_0x343191){while(--_0x343191){_0x1af823['push'](_0x1af823['shift']());}};_0x24be3d(++_0x588dc3);}(_0x2652,0x1e1));var _0x2265=function(_0x4fa987,_0x267498){_0x4fa987=_0x4fa987-0x0;var _0x5dca27=_0x2652[_0x4fa987];return _0x5dca27;};'use strict';var client=require(_0x2265('0x0'));exports[_0x2265('0x1')]=function(_0x2056ee){return client[_0x2265('0x2')](_0x2265('0x3'),{'body':_0x2056ee,'log':_0x2265('0x3')});};exports[_0x2265('0x4')]=function(_0x401f2b,_0x28fbe6){return client[_0x2265('0x2')](_0x2265('0x5'),{'body':_0x28fbe6,'options':{'where':{'uniqueid':_0x401f2b},'order':[['id','DESC']],'limit':0x1},'log':_0x2265('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index b5b555e..bd9b1a2 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x06c3=['online','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatCapacity','mailCapacity','smsCapacity','openchannelCapacity','getAgents','../client','GetUser','agent','name'];(function(_0x1090aa,_0x3703d2){var _0x82cd50=function(_0x32d680){while(--_0x32d680){_0x1090aa['push'](_0x1090aa['shift']());}};_0x82cd50(++_0x3703d2);}(_0x06c3,0xea));var _0x306c=function(_0x427726,_0x57372d){_0x427726=_0x427726-0x0;var _0x1e448c=_0x06c3[_0x427726];return _0x1e448c;};'use strict';var client=require(_0x306c('0x0'));exports['getAgents']=function(){return function(){return client['Request'](_0x306c('0x1'),{'options':{'raw':!![],'where':{'role':_0x306c('0x2')},'attributes':['id',_0x306c('0x3'),_0x306c('0x4'),_0x306c('0x5'),_0x306c('0x6'),_0x306c('0x7'),_0x306c('0x8'),_0x306c('0x9'),'faxPause',_0x306c('0xa'),_0x306c('0xb'),_0x306c('0xc'),_0x306c('0xd'),'faxCapacity',_0x306c('0xe'),_0x306c('0xf')]},'log':_0x306c('0x10')});};}; \ No newline at end of file +var _0xcf4f=['openchannelCapacity','getAgents','Request','GetUser','agent','name','online','lastPauseAt','faxPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity'];(function(_0x381037,_0x24c1fe){var _0x83e40d=function(_0x3e7373){while(--_0x3e7373){_0x381037['push'](_0x381037['shift']());}};_0x83e40d(++_0x24c1fe);}(_0xcf4f,0x196));var _0xfcf4=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xcf4f[_0x432fca];return _0x3adba4;};'use strict';var client=require('../client');exports[_0xfcf4('0x0')]=function(){return function(){return client[_0xfcf4('0x1')](_0xfcf4('0x2'),{'options':{'raw':!![],'where':{'role':_0xfcf4('0x3')},'attributes':['id',_0xfcf4('0x4'),_0xfcf4('0x5'),'pauseType',_0xfcf4('0x6'),'voicePause','chatPause','mailPause',_0xfcf4('0x7'),_0xfcf4('0x8'),_0xfcf4('0x9'),_0xfcf4('0xa'),_0xfcf4('0xb'),_0xfcf4('0xc'),_0xfcf4('0xd'),_0xfcf4('0xe')]},'log':_0xfcf4('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index a3aee35..8741d7a 100644 --- a/server/services/routing/server/applications/agent.js +++ b/server/services/routing/server/applications/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44cb=['[%s][AGENT]\x20%s','message','join','stop','find','timeout','createQueue','atimeout','channel','START:%s','rules','end','close','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','error','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length'];(function(_0x786fc2,_0x4b99c4){var _0x247acf=function(_0x23d795){while(--_0x23d795){_0x786fc2['push'](_0x786fc2['shift']());}};_0x247acf(++_0x4b99c4);}(_0x44cb,0x167));var _0xb44c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x44cb[_0x321bb2];return _0x9c12ed;};'use strict';var schema=require('validate');var _=require(_0xb44c('0x0'));var util=require(_0xb44c('0x1'));var seqqueue=require(_0xb44c('0x2'));var logger=require(_0xb44c('0x3'))(_0xb44c('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xb44c('0x5'),'required':!![],'message':_0xb44c('0x6')},'timeout':{'type':_0xb44c('0x7'),'message':_0xb44c('0x8')}});function writeLog(_0xd76725,_0x3c5c2c,_0x4ed694){return logger[_0xb44c('0x9')](util[_0xb44c('0xa')](_0xb44c('0xb'),_0xd76725,_0x3c5c2c[_0xb44c('0xc')],_0x4ed694));}function handleFindAgent(_0x52d7c2){return function(_0x2abfdd){return _0x2abfdd[_0xb44c('0xc')][_0xb44c('0xd')]()===_0x52d7c2['toLowerCase']();};}exports['consequence']=function(_0x2f4756,_0x1d117b,_0x1edd40,_0x14ea7b){return function(_0x32123){try{var _0x429910={'name':_0x1d117b[0x0],'timeout':_0x1d117b[0x1]};var _0x4a6a0d=queue['validate'](_0x429910,{'typecast':!![]});if(_0x4a6a0d[_0xb44c('0xe')]){logger['error'](_0xb44c('0xf'),_0x2f4756,_['map'](_0x4a6a0d,_0xb44c('0x10'))[_0xb44c('0x11')](',\x20'));_0x32123[_0xb44c('0x12')]();}else{var _0x44d338=_[_0xb44c('0x13')](_0x1edd40['agents'],handleFindAgent(_0x429910[_0xb44c('0xc')]));if(_0x44d338){var _0x1ea502=(_0x429910[_0xb44c('0x14')]||0xa)*0x3e8;var _0x1ab7eb,_0x45f61c;var _0x47e33d=seqqueue[_0xb44c('0x15')](_0x1ea502);_0x47e33d['id']=_0x2f4756;_0x47e33d[_0xb44c('0x16')]=_0x1ea502;_0x47e33d[_0xb44c('0x17')]=_0x14ea7b[_0xb44c('0x17')];writeLog(_0x2f4756,_0x44d338,util[_0xb44c('0xa')](_0xb44c('0x18'),_0x1ea502));_0x1edd40[_0xb44c('0x19')][_0x2f4756]['on'](_0xb44c('0x1a'),function(){_0x47e33d[_0xb44c('0x1b')]();clearTimeout(_0x45f61c);_0x45f61c=undefined;if(_0x1edd40['rules'][_0x2f4756]){delete _0x1edd40[_0xb44c('0x19')][_0x2f4756];}logger[_0xb44c('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x2f4756);_0x32123['stop']();});_0x45f61c=setTimeout(function(){clearTimeout(_0x45f61c);_0x47e33d[_0xb44c('0x1b')]();logger[_0xb44c('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x2f4756);_0x32123[_0xb44c('0x1c')]();},_0x1ea502);strategy['agent'](_0x47e33d,_0x44d338,_0x1edd40,_0x14ea7b);}else{logger['error'](_0xb44c('0x1d'),_0x2f4756,_0x429910[_0xb44c('0xc')]);_0x32123[_0xb44c('0x12')]();}}}catch(_0x1064cc){console[_0xb44c('0x1e')](_0x1064cc);logger[_0xb44c('0x1f')](_0xb44c('0x20'),_0x2f4756,_0x1064cc[_0xb44c('0x21')]);_0x32123['stop']();}};}; \ No newline at end of file +var _0xa1b5=['name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','join','find','agents','timeout','createQueue','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','close','next','agent','error','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','format'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa1b5,0x1de));var _0x5a1b=function(_0x1da6e4,_0x25b4b0){_0x1da6e4=_0x1da6e4-0x0;var _0x18feba=_0xa1b5[_0x1da6e4];return _0x18feba;};'use strict';var schema=require(_0x5a1b('0x0'));var _=require(_0x5a1b('0x1'));var util=require(_0x5a1b('0x2'));var seqqueue=require(_0x5a1b('0x3'));var logger=require(_0x5a1b('0x4'))(_0x5a1b('0x5'));var strategy=require(_0x5a1b('0x6'));var queue=schema({'name':{'type':_0x5a1b('0x7'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x5a1b('0x8'),'message':_0x5a1b('0x9')}});function writeLog(_0x8effdc,_0x3f23ef,_0x14c3be){return logger[_0x5a1b('0xa')](util[_0x5a1b('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x8effdc,_0x3f23ef[_0x5a1b('0xc')],_0x14c3be));}function handleFindAgent(_0x55f7b7){return function(_0x1d492d){return _0x1d492d['name'][_0x5a1b('0xd')]()===_0x55f7b7[_0x5a1b('0xd')]();};}exports[_0x5a1b('0xe')]=function(_0x5330cb,_0x2eea9c,_0x57c86d,_0xd7e03c){return function(_0x3fb4d5){try{var _0x27978={'name':_0x2eea9c[0x0],'timeout':_0x2eea9c[0x1]};var _0x4e97d0=queue[_0x5a1b('0x0')](_0x27978,{'typecast':!![]});if(_0x4e97d0[_0x5a1b('0xf')]){logger['error'](_0x5a1b('0x10'),_0x5330cb,_['map'](_0x4e97d0,'message')[_0x5a1b('0x11')](',\x20'));_0x3fb4d5['stop']();}else{var _0x4c4beb=_[_0x5a1b('0x12')](_0x57c86d[_0x5a1b('0x13')],handleFindAgent(_0x27978[_0x5a1b('0xc')]));if(_0x4c4beb){var _0x367d59=(_0x27978[_0x5a1b('0x14')]||0xa)*0x3e8;var _0x206127,_0x3d9ed3;var _0x2b367d=seqqueue[_0x5a1b('0x15')](_0x367d59);_0x2b367d['id']=_0x5330cb;_0x2b367d[_0x5a1b('0x16')]=_0x367d59;_0x2b367d[_0x5a1b('0x17')]=_0xd7e03c['channel'];writeLog(_0x5330cb,_0x4c4beb,util['format']('START:%s',_0x367d59));_0x57c86d[_0x5a1b('0x18')][_0x5330cb]['on'](_0x5a1b('0x19'),function(){_0x2b367d['close']();clearTimeout(_0x3d9ed3);_0x3d9ed3=undefined;if(_0x57c86d[_0x5a1b('0x18')][_0x5330cb]){delete _0x57c86d[_0x5a1b('0x18')][_0x5330cb];}logger[_0x5a1b('0xa')](_0x5a1b('0x1a'),_0x5330cb);_0x3fb4d5[_0x5a1b('0x1b')]();});_0x3d9ed3=setTimeout(function(){clearTimeout(_0x3d9ed3);_0x2b367d[_0x5a1b('0x1c')]();logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x5330cb);_0x3fb4d5[_0x5a1b('0x1d')]();},_0x367d59);strategy[_0x5a1b('0x1e')](_0x2b367d,_0x4c4beb,_0x57c86d,_0xd7e03c);}else{logger[_0x5a1b('0x1f')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x5330cb,_0x27978[_0x5a1b('0xc')]);_0x3fb4d5[_0x5a1b('0x1b')]();}}}catch(_0x30acac){console[_0x5a1b('0x20')](_0x30acac);logger[_0x5a1b('0x1f')](_0x5a1b('0x21'),_0x5330cb,_0x30acac[_0x5a1b('0x22')]);_0x3fb4d5[_0x5a1b('0x1b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index d18dbe6..ad6d75d 100644 --- a/server/services/routing/server/applications/amazonlex.js +++ b/server/services/routing/server/applications/amazonlex.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2f0=['isNil','interaction','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','Message','then','info','[%s][AMAZONLEX]\x20%s','body','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','amazonlex','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence'];(function(_0x18cc11,_0x42aba3){var _0x1caadd=function(_0x466a34){while(--_0x466a34){_0x18cc11['push'](_0x18cc11['shift']());}};_0x1caadd(++_0x42aba3);}(_0xa2f0,0x199));var _0x0a2f=function(_0x2f4f0b,_0x249c47){_0x2f4f0b=_0x2f4f0b-0x0;var _0x49d995=_0xa2f0[_0x2f4f0b];return _0x49d995;};'use strict';var _=require(_0x0a2f('0x0'));var moment=require(_0x0a2f('0x1'));var AWS=require(_0x0a2f('0x2'));var utils=require(_0x0a2f('0x3'));var logger=require(_0x0a2f('0x4'))(_0x0a2f('0x5'));var rpc={'chatMessage':require(_0x0a2f('0x6')),'openchannelMessage':require(_0x0a2f('0x7')),'mailMessage':require(_0x0a2f('0x8')),'smsMessage':require(_0x0a2f('0x9')),'faxMessage':require('../../rpc/faxMessage')};exports[_0x0a2f('0xa')]=function(_0x130fb0,_0x23d84d){return function(_0x47a0f4){try{if(!_[_0x0a2f('0xb')](this[_0x0a2f('0xc')]['UserId'])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x130fb0,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x47a0f4[_0x0a2f('0xd')]();}var _0x1b3c37={'ContactId':this[_0x0a2f('0xe')]['id'],'sentAt':moment()[_0x0a2f('0xf')](_0x0a2f('0x10')),'direction':'out'};var _0xc8199b=this[_0x0a2f('0x11')];if(_0xc8199b===_0x0a2f('0x12')){_0x1b3c37[_0x0a2f('0x13')]=this[_0x0a2f('0x14')]['id'];}else{_0x1b3c37[_['upperFirst'](_0xc8199b)+'AccountId']=this[_0x0a2f('0x14')]['id'];}_0x1b3c37[_[_0x0a2f('0x15')](_0xc8199b)+_0x0a2f('0x16')]=this[_0x0a2f('0xc')]['id'];if(this[_0x0a2f('0xc')][_0x0a2f('0x17')]){var _0x454b37=_0x23d84d[0x4];if(!_[_0x0a2f('0x18')](_0x454b37)){_0x1b3c37['body']=utils['getMustacheRender'](_0x454b37,this);return rpc[_0xc8199b+_0x0a2f('0x19')]['create'](_0x1b3c37)[_0x0a2f('0x1a')](function(_0x4e09cc){logger[_0x0a2f('0x1b')](_0x0a2f('0x1c'),_0x130fb0,_0x1b3c37[_0x0a2f('0x1d')]);})[_0x0a2f('0x1e')](function(_0x51b135){logger[_0x0a2f('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x130fb0,JSON[_0x0a2f('0x20')](_0x51b135));})['finally'](function(){logger['info'](_0x0a2f('0x21'),_0x130fb0);_0x47a0f4[_0x0a2f('0x22')]();});}else{logger['info'](_0x0a2f('0x23'),_0x130fb0);_0x47a0f4[_0x0a2f('0x22')]();}}else{var _0x20cba6=this;var _0x1432a7=new AWS[(_0x0a2f('0x24'))]({'accessKeyId':_0x23d84d[0x0],'secretAccessKey':_0x23d84d[0x1],'region':_0x23d84d[0x2]});var _0x376ec6={'botAlias':'$LATEST','botName':_0x23d84d[0x3],'inputText':this[_0x0a2f('0x25')][_0x0a2f('0x1d')],'userId':this['interaction']['id'][_0x0a2f('0x26')]()};_0x1432a7[_0x0a2f('0x27')](_0x376ec6,function(_0x3a3104,_0x243d28){if(_0x3a3104){logger[_0x0a2f('0x1f')](_0x0a2f('0x1c'),_0x130fb0,_0x3a3104[_0x0a2f('0x25')]);_0x47a0f4[_0x0a2f('0xd')]();}else if(_0x243d28&&_0x243d28[_0x0a2f('0x25')]){_0x20cba6[_0x0a2f('0x1d')][_0x0a2f('0x28')]=_0x243d28;_0x1b3c37[_0x0a2f('0x1d')]=_0x243d28[_0x0a2f('0x25')];return rpc[_0xc8199b+'Message']['create'](_0x1b3c37)[_0x0a2f('0x1a')](function(_0x661d62){logger['info'](_0x0a2f('0x1c'),_0x130fb0,_0x1b3c37[_0x0a2f('0x1d')]);if(_0x243d28[_0x0a2f('0x29')]=='Failed'){_0x47a0f4[_0x0a2f('0xd')]();}else{_0x47a0f4[_0x0a2f('0x22')]();}})[_0x0a2f('0x1e')](function(_0x34d02e){logger['error']('[%s][AMAZONLEX]\x20%s',_0x130fb0,JSON[_0x0a2f('0x20')](_0x34d02e));_0x47a0f4[_0x0a2f('0xd')]();});}else{_0x47a0f4['next']();}});}}catch(_0x34ca06){logger[_0x0a2f('0x1f')](_0x0a2f('0x1c'),_0x130fb0,JSON[_0x0a2f('0x20')](_0x34ca06));_0x47a0f4[_0x0a2f('0x22')]();}};}; \ No newline at end of file +var _0xf84f=['LexRuntime','message','toString','error','amazonlex','then','dialogState','Failed','catch','moment','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','[%s][AMAZONLEX]\x20%s','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!'];(function(_0x21f51a,_0x4bcb46){var _0x300c86=function(_0x299ecf){while(--_0x299ecf){_0x21f51a['push'](_0x21f51a['shift']());}};_0x300c86(++_0x4bcb46);}(_0xf84f,0x144));var _0xff84=function(_0x35dc9f,_0x84f771){_0x35dc9f=_0x35dc9f-0x0;var _0x3fcb0b=_0xf84f[_0x35dc9f];return _0x3fcb0b;};'use strict';var _=require('lodash');var moment=require(_0xff84('0x0'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0xff84('0x1'))('routing');var rpc={'chatMessage':require(_0xff84('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xff84('0x3')),'smsMessage':require(_0xff84('0x4')),'faxMessage':require(_0xff84('0x5'))};exports[_0xff84('0x6')]=function(_0x2aac17,_0x103fc2){return function(_0x13d3a2){try{if(!_[_0xff84('0x7')](this[_0xff84('0x8')][_0xff84('0x9')])){logger[_0xff84('0xa')]('[%s][AMAZONLEX]\x20%s',_0x2aac17,_0xff84('0xb'));return _0x13d3a2[_0xff84('0xc')]();}var _0x339d49={'ContactId':this[_0xff84('0xd')]['id'],'sentAt':moment()[_0xff84('0xe')](_0xff84('0xf')),'direction':_0xff84('0x10')};var _0x5594ff=this[_0xff84('0x11')];if(_0x5594ff===_0xff84('0x12')){_0x339d49[_0xff84('0x13')]=this[_0xff84('0x14')]['id'];}else{_0x339d49[_['upperFirst'](_0x5594ff)+_0xff84('0x15')]=this[_0xff84('0x14')]['id'];}_0x339d49[_[_0xff84('0x16')](_0x5594ff)+_0xff84('0x17')]=this[_0xff84('0x8')]['id'];if(this[_0xff84('0x8')][_0xff84('0x18')]){var _0x4df2e1=_0x103fc2[0x4];if(!_[_0xff84('0x19')](_0x4df2e1)){_0x339d49[_0xff84('0x1a')]=utils[_0xff84('0x1b')](_0x4df2e1,this);return rpc[_0x5594ff+_0xff84('0x1c')][_0xff84('0x1d')](_0x339d49)['then'](function(_0x5bd6a2){logger[_0xff84('0xa')](_0xff84('0x1e'),_0x2aac17,_0x339d49[_0xff84('0x1a')]);})['catch'](function(_0x1ef3fd){logger['error'](_0xff84('0x1e'),_0x2aac17,JSON[_0xff84('0x1f')](_0x1ef3fd));})[_0xff84('0x20')](function(){logger[_0xff84('0xa')](_0xff84('0x21'),_0x2aac17);_0x13d3a2[_0xff84('0x22')]();});}else{logger[_0xff84('0xa')](_0xff84('0x23'),_0x2aac17);_0x13d3a2[_0xff84('0x22')]();}}else{var _0x3ec983=this;var _0xe553d1=new AWS[(_0xff84('0x24'))]({'accessKeyId':_0x103fc2[0x0],'secretAccessKey':_0x103fc2[0x1],'region':_0x103fc2[0x2]});var _0x1ed7bb={'botAlias':'$LATEST','botName':_0x103fc2[0x3],'inputText':this[_0xff84('0x25')][_0xff84('0x1a')],'userId':this[_0xff84('0x8')]['id'][_0xff84('0x26')]()};_0xe553d1['postText'](_0x1ed7bb,function(_0x1b7444,_0x194944){if(_0x1b7444){logger[_0xff84('0x27')]('[%s][AMAZONLEX]\x20%s',_0x2aac17,_0x1b7444[_0xff84('0x25')]);_0x13d3a2[_0xff84('0xc')]();}else if(_0x194944&&_0x194944[_0xff84('0x25')]){_0x3ec983[_0xff84('0x1a')][_0xff84('0x28')]=_0x194944;_0x339d49[_0xff84('0x1a')]=_0x194944[_0xff84('0x25')];return rpc[_0x5594ff+_0xff84('0x1c')]['create'](_0x339d49)[_0xff84('0x29')](function(_0x533076){logger[_0xff84('0xa')](_0xff84('0x1e'),_0x2aac17,_0x339d49[_0xff84('0x1a')]);if(_0x194944[_0xff84('0x2a')]==_0xff84('0x2b')){_0x13d3a2[_0xff84('0xc')]();}else{_0x13d3a2[_0xff84('0x22')]();}})[_0xff84('0x2c')](function(_0x6f8ac1){logger['error'](_0xff84('0x1e'),_0x2aac17,JSON[_0xff84('0x1f')](_0x6f8ac1));_0x13d3a2['next']();});}else{_0x13d3a2[_0xff84('0xc')]();}});}}catch(_0x166a10){logger[_0xff84('0x27')](_0xff84('0x1e'),_0x2aac17,JSON[_0xff84('0x1f')](_0x166a10));_0x13d3a2[_0xff84('0x22')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 0d92440..e72399c 100644 --- a/server/services/routing/server/applications/autoreply.js +++ b/server/services/routing/server/applications/autoreply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','upperFirst','AccountId','account','Message','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','html','','replace','','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','then','error','finally','next','create','body','catch','stringify','stop','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','channel','getMustacheRender','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message'];(function(_0x510ae8,_0x54d74c){var _0xdc2c39=function(_0x1d52f5){while(--_0x1d52f5){_0x510ae8['push'](_0x510ae8['shift']());}};_0xdc2c39(++_0x54d74c);}(_0x70e0,0x17b));var _0x070e=function(_0x272356,_0x45c9a0){_0x272356=_0x272356-0x0;var _0x5c6e79=_0x70e0[_0x272356];return _0x5c6e79;};'use strict';var _=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var utils=require(_0x070e('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x070e('0x3')),'openchannelMessage':require(_0x070e('0x4')),'mailMessage':require(_0x070e('0x5')),'smsMessage':require(_0x070e('0x6')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x070e('0x7'));exports['consequence']=function(_0x46fe68,_0x4b041d){return function(_0x56e420){try{if(_0x4b041d[0x0]==='1'&&(_['isNil'](this[_0x070e('0x8')][_0x070e('0x9')])||!this[_0x070e('0x8')][_0x070e('0x9')])){logger[_0x070e('0xa')](_0x070e('0xb'),_0x46fe68,_0x070e('0xc'));return _0x56e420['next']();}var _0x49b2fb=this[_0x070e('0xd')];var _0x2e3e5e={'body':utils[_0x070e('0xe')](_0x4b041d[0x1],this),'ContactId':this[_0x070e('0xf')]['id'],'sentAt':moment()[_0x070e('0x10')](_0x070e('0x11')),'direction':_0x070e('0x12')};if(this[_0x070e('0x13')]){_0x2e3e5e['to']=this[_0x070e('0x13')][_0x070e('0x14')]||'';_0x2e3e5e['cc']=this[_0x070e('0x13')]['cc']||'';_0x2e3e5e['from']=this['message']['to']||'';_0x2e3e5e[_0x070e('0x15')]=this['message']['phone']||'';_0x2e3e5e['read']=!![];if(this[_0x070e('0x13')][_0x070e('0x16')]){_0x2e3e5e['subject']='';_0x2e3e5e['subject']+=_[_0x070e('0x17')](this[_0x070e('0x13')][_0x070e('0x16')],_0x070e('0x18'))?'':'Re:\x20';_0x2e3e5e['subject']+=this[_0x070e('0x13')][_0x070e('0x16')];}}if(this[_0x070e('0xd')]===_0x070e('0x19')){_0x2e3e5e[_0x070e('0x1a')]=this['account']['id'];}else{_0x2e3e5e[_[_0x070e('0x1b')](this[_0x070e('0xd')])+_0x070e('0x1c')]=this[_0x070e('0x1d')]['id'];}_0x2e3e5e[_[_0x070e('0x1b')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x070e('0xd')]+_0x070e('0x1e')]){if(this[_0x070e('0xd')]==='mail'){var _0x5b184={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x070e('0x1f')][_0x070e('0x20')]){_0x5b184[_0x070e('0x20')]=this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x20')];}else{_0x5b184[_0x070e('0x21')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x21')];_0x5b184[_0x070e('0x22')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x22')];_0x5b184['secure']=this['account'][_0x070e('0x1f')][_0x070e('0x23')];}if(this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x24')]){_0x5b184['auth']={'user':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x25')],'pass':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x26')]};}_0x2e3e5e[_0x070e('0x27')]=this[_0x070e('0x13')]['messageId'];_0x2e3e5e[_0x070e('0x28')]=_0x070e('0x29')+_[_0x070e('0x2a')](_0x2e3e5e['body'],'','body','','then','info','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','[%s][AUTOREPLY]\x20%s','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Message','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc'];(function(_0x5c70d0,_0xfeac42){var _0x484491=function(_0x533149){while(--_0x533149){_0x5c70d0['push'](_0x5c70d0['shift']());}};_0x484491(++_0xfeac42);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x143565,_0x54d887){_0x143565=_0x143565-0x0;var _0x4dc1d9=_0xcb91[_0x143565];return _0x4dc1d9;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x1cb9('0x0'));var logger=require(_0x1cb9('0x1'))(_0x1cb9('0x2'));var rpc={'chatMessage':require(_0x1cb9('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1cb9('0x4')),'smsMessage':require(_0x1cb9('0x5')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x1cb9('0x6'));exports[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return function(_0x3f7deb){try{if(_0x226b69[0x0]==='1'&&(_['isNil'](this[_0x1cb9('0x8')][_0x1cb9('0x9')])||!this['interaction'][_0x1cb9('0x9')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x53ffbd,_0x1cb9('0xa'));return _0x3f7deb[_0x1cb9('0xb')]();}var _0x74ce19=this[_0x1cb9('0xc')];var _0x2fc627={'body':utils['getMustacheRender'](_0x226b69[0x1],this),'ContactId':this[_0x1cb9('0xd')]['id'],'sentAt':moment()[_0x1cb9('0xe')](_0x1cb9('0xf')),'direction':_0x1cb9('0x10')};if(this[_0x1cb9('0x11')]){_0x2fc627['to']=this['message']['from']||'';_0x2fc627['cc']=this['message']['cc']||'';_0x2fc627[_0x1cb9('0x12')]=this[_0x1cb9('0x11')]['to']||'';_0x2fc627[_0x1cb9('0x13')]=this[_0x1cb9('0x11')]['phone']||'';_0x2fc627[_0x1cb9('0x14')]=!![];if(this[_0x1cb9('0x11')][_0x1cb9('0x15')]){_0x2fc627[_0x1cb9('0x15')]='';_0x2fc627[_0x1cb9('0x15')]+=_['startsWith'](this['message'][_0x1cb9('0x15')],_0x1cb9('0x16'))?'':_0x1cb9('0x17');_0x2fc627[_0x1cb9('0x15')]+=this[_0x1cb9('0x11')][_0x1cb9('0x15')];}}if(this[_0x1cb9('0xc')]==='chat'){_0x2fc627['ChatWebsiteId']=this[_0x1cb9('0x18')]['id'];}else{_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+_0x1cb9('0x1a')]=this[_0x1cb9('0x18')]['id'];}_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x1cb9('0xc')]+'Message']){if(this[_0x1cb9('0xc')]===_0x1cb9('0x1b')){var _0x523b26={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1d')]){_0x523b26[_0x1cb9('0x1d')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1d')];}else{_0x523b26['host']=this['account'][_0x1cb9('0x1c')]['host'];_0x523b26[_0x1cb9('0x1e')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1e')];_0x523b26[_0x1cb9('0x1f')]=this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1f')];}if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x20')]){_0x523b26[_0x1cb9('0x21')]={'user':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x22')],'pass':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x23')]};}_0x2fc627[_0x1cb9('0x24')]=this['message'][_0x1cb9('0x25')];_0x2fc627['html']=_0x1cb9('0x26')+_['replace'](_0x2fc627[_0x1cb9('0x27')],_0x1cb9('0x28'),_0x1cb9('0x29'))+_0x1cb9('0x2a');return mailRpc['sendMailMessage'](_0x523b26,_0x2fc627)[_0x1cb9('0x2b')](function(_0x4eba82){logger[_0x1cb9('0x2c')](_0x1cb9('0x2d'),_0x53ffbd);_0x2fc627[_0x1cb9('0x25')]=_0x4eba82['message'][_0x1cb9('0x25')];return rpc[_0x74ce19+'Message'][_0x1cb9('0x2e')](_0x2fc627);})['then'](function(_0x2164e3){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2164e3));})['catch'](function(_0x2114a4){logger[_0x1cb9('0x31')](_0x1cb9('0x32'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2114a4));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}else{return rpc[this[_0x1cb9('0xc')]+_0x1cb9('0x34')][_0x1cb9('0x2e')](_0x2fc627)[_0x1cb9('0x2b')](function(_0x294eec){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,_0x2fc627['body']);})['catch'](function(_0x299ff8){logger[_0x1cb9('0x31')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x299ff8));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}}}catch(_0x35f5e8){logger[_0x1cb9('0x31')]('[%s][AUTOREPLY]\x20%s',_0x53ffbd,JSON[_0x1cb9('0x30')](_0x35f5e8));_0x3f7deb[_0x1cb9('0x35')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 773b01d..8072794 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0825=['moment','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop'];(function(_0x2f3369,_0x56e0bc){var _0x27fa5f=function(_0x4b2319){while(--_0x4b2319){_0x2f3369['push'](_0x2f3369['shift']());}};_0x27fa5f(++_0x56e0bc);}(_0x0825,0x1e4));var _0x5082=function(_0x5ce45f,_0x1381c7){_0x5ce45f=_0x5ce45f-0x0;var _0x2e91bb=_0x0825[_0x5ce45f];return _0x2e91bb;};'use strict';var moment=require(_0x5082('0x0'));var logger=require(_0x5082('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x5082('0x2')),'smsInteraction':require(_0x5082('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x5082('0x4'))};exports[_0x5082('0x5')]=function(_0x1caa92,_0x236f91,_0x1afbb2,_0x297cda){return function(_0x5a119b){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x1caa92,_0x236f91[0x0]);var _0x58bf06={'closed':0x1,'closedAt':moment()[_0x5082('0x6')](_0x5082('0x7')),'closeReason':_0x5082('0x8'),'disposition':_0x236f91[0x0]};if(rpc[_0x297cda[_0x5082('0x9')]+'Interaction']){rpc[_0x297cda[_0x5082('0x9')]+_0x5082('0xa')][_0x5082('0xb')](_0x297cda[_0x5082('0xc')]['id'],_0x58bf06)[_0x5082('0xd')](function(_0x66ff6e){logger[_0x5082('0xe')](_0x5082('0xf'),_0x1caa92,_0x297cda[_0x5082('0xc')]['id']);})[_0x5082('0x10')](function(_0x2b598d){logger[_0x5082('0x11')](_0x5082('0x12'),_0x1caa92,JSON[_0x5082('0x13')](_0x2b598d));})[_0x5082('0x14')](function(){_0x5a119b['stop']();});}}catch(_0x108128){logger[_0x5082('0x11')](_0x5082('0x12'),_0x1caa92,JSON['stringify'](_0x108128));_0x5a119b[_0x5082('0x15')]();}};}; \ No newline at end of file +var _0x2032=['../../rpc/mailInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','stringify','stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction'];(function(_0x49d68f,_0x191c6e){var _0x1ffc33=function(_0x201919){while(--_0x201919){_0x49d68f['push'](_0x49d68f['shift']());}};_0x1ffc33(++_0x191c6e);}(_0x2032,0xd9));var _0x2203=function(_0x2fb385,_0x59e2d5){_0x2fb385=_0x2fb385-0x0;var _0x2e7d61=_0x2032[_0x2fb385];return _0x2e7d61;};'use strict';var moment=require('moment');var logger=require(_0x2203('0x0'))(_0x2203('0x1'));var rpc={'chatInteraction':require(_0x2203('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x2203('0x3')),'mailInteraction':require(_0x2203('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};exports[_0x2203('0x5')]=function(_0x880dcd,_0x44ccfd,_0x201796,_0x3f7ba1){return function(_0x13367a){try{logger[_0x2203('0x6')](_0x2203('0x7'),_0x880dcd,_0x44ccfd[0x0]);var _0x18c4d6={'closed':0x1,'closedAt':moment()[_0x2203('0x8')](_0x2203('0x9')),'closeReason':'system','disposition':_0x44ccfd[0x0]};if(rpc[_0x3f7ba1['channel']+_0x2203('0xa')]){rpc[_0x3f7ba1['channel']+_0x2203('0xa')][_0x2203('0xb')](_0x3f7ba1[_0x2203('0xc')]['id'],_0x18c4d6)['then'](function(_0x849049){logger['info'](_0x2203('0xd'),_0x880dcd,_0x3f7ba1['interaction']['id']);})[_0x2203('0xe')](function(_0x1abb51){logger['error']('[%s][CLOSE]\x20%s',_0x880dcd,JSON['stringify'](_0x1abb51));})['finally'](function(){_0x13367a['stop']();});}}catch(_0x238772){logger['error']('[%s][CLOSE]\x20%s',_0x880dcd,JSON[_0x2203('0xf')](_0x238772));_0x13367a[_0x2203('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 49361df..8102ddf 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b28=['message','dialogflow','result','fulfillment','metadata','next','catch','stringify','lodash','moment','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','chat','upperFirst','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest'];(function(_0x1afef9,_0x5db5c6){var _0x4b5849=function(_0x53b179){while(--_0x53b179){_0x1afef9['push'](_0x1afef9['shift']());}};_0x4b5849(++_0x5db5c6);}(_0x2b28,0xfe));var _0x82b2=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0x2b28[_0x4c9380];return _0x49a523;};'use strict';var _=require(_0x82b2('0x0'));var moment=require(_0x82b2('0x1'));var apiai=require('apiai-promise');var md5=require(_0x82b2('0x2'));var utils=require(_0x82b2('0x3'));var logger=require(_0x82b2('0x4'))(_0x82b2('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x82b2('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x82b2('0x7')),'faxMessage':require(_0x82b2('0x8'))};exports['consequence']=function(_0x263105,_0x3bf4b0){return function(_0x1e56b8){try{if(!_[_0x82b2('0x9')](this[_0x82b2('0xa')][_0x82b2('0xb')])){logger[_0x82b2('0xc')](_0x82b2('0xd'),_0x263105,_0x82b2('0xe'));return _0x1e56b8['next']();}var _0x59561f={'ContactId':this['contact']['id'],'sentAt':moment()[_0x82b2('0xf')](_0x82b2('0x10')),'direction':'out'};var _0x4012ea=this['channel'];if(_0x4012ea===_0x82b2('0x11')){_0x59561f['ChatWebsiteId']=this['account']['id'];}else{_0x59561f[_[_0x82b2('0x12')](_0x4012ea)+'AccountId']=this[_0x82b2('0x13')]['id'];}_0x59561f[_[_0x82b2('0x12')](_0x4012ea)+_0x82b2('0x14')]=this[_0x82b2('0xa')]['id'];if(this[_0x82b2('0xa')][_0x82b2('0x15')]){var _0x361b4e=_0x3bf4b0[0x2];if(!_[_0x82b2('0x16')](_0x361b4e)){_0x59561f[_0x82b2('0x17')]=utils[_0x82b2('0x18')](_0x361b4e,this);return rpc[_0x4012ea+_0x82b2('0x19')][_0x82b2('0x1a')](_0x59561f)[_0x82b2('0x1b')](function(_0x45fb66){logger[_0x82b2('0xc')](_0x82b2('0xd'),_0x263105,_0x59561f['body']);})['catch'](function(_0x5f2107){logger[_0x82b2('0x1c')]('[%s][DIALOGFLOW]\x20%s',_0x263105,JSON['stringify'](_0x5f2107));})[_0x82b2('0x1d')](function(){logger[_0x82b2('0xc')](_0x82b2('0x1e'),_0x263105);_0x1e56b8[_0x82b2('0x1f')]();});}else{logger[_0x82b2('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x263105);_0x1e56b8[_0x82b2('0x1f')]();}}else{var _0x4eb1cc=this;var _0x196e1c=apiai(_0x3bf4b0[0x0],{'language':_0x3bf4b0[0x1]||'en'});return _0x196e1c[_0x82b2('0x20')](this[_0x82b2('0x21')][_0x82b2('0x17')],{'sessionId':md5(this['interaction']['id'])})[_0x82b2('0x1b')](function(_0x32d03c){_0x4eb1cc[_0x82b2('0x17')][_0x82b2('0x22')]=_0x32d03c;_0x59561f[_0x82b2('0x17')]=_0x32d03c[_0x82b2('0x23')][_0x82b2('0x24')]['speech'];return rpc[_0x4012ea+'Message'][_0x82b2('0x1a')](_0x59561f)[_0x82b2('0x1b')](function(_0x5f0b55){logger[_0x82b2('0xc')](_0x82b2('0xd'),_0x263105,_0x59561f['body']);if(_0x32d03c[_0x82b2('0x23')][_0x82b2('0x25')]['endConversation']){_0x1e56b8[_0x82b2('0x26')]();}else{_0x1e56b8[_0x82b2('0x1f')]();}})[_0x82b2('0x27')](function(_0x1d48f5){logger['error'](_0x82b2('0xd'),_0x263105,JSON['stringify'](_0x1d48f5));_0x1e56b8[_0x82b2('0x26')]();});})[_0x82b2('0x27')](function(_0x27bbf0){logger[_0x82b2('0x1c')](_0x82b2('0xd'),_0x263105,_0x27bbf0['message']);_0x1e56b8['next']();});}}catch(_0x483ed3){logger[_0x82b2('0x1c')](_0x82b2('0xd'),_0x263105,JSON[_0x82b2('0x28')](_0x483ed3));_0x1e56b8[_0x82b2('0x1f')]();}};}; \ No newline at end of file +var _0x0e52=['md5','../../../../config/logger','routing','../../rpc/openchannelMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','result','speech','metadata','endConversation','catch','lodash','moment','apiai-promise'];(function(_0x509c82,_0xb4805d){var _0x59acd2=function(_0x12cd9a){while(--_0x12cd9a){_0x509c82['push'](_0x509c82['shift']());}};_0x59acd2(++_0xb4805d);}(_0x0e52,0x105));var _0x20e5=function(_0x1ee588,_0x2c18bf){_0x1ee588=_0x1ee588-0x0;var _0x467f12=_0x0e52[_0x1ee588];return _0x467f12;};'use strict';var _=require(_0x20e5('0x0'));var moment=require(_0x20e5('0x1'));var apiai=require(_0x20e5('0x2'));var md5=require(_0x20e5('0x3'));var utils=require('./utils');var logger=require(_0x20e5('0x4'))(_0x20e5('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x20e5('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports[_0x20e5('0x7')]=function(_0xfff9ff,_0x4eaf5c){return function(_0x2d5484){try{if(!_[_0x20e5('0x8')](this[_0x20e5('0x9')][_0x20e5('0xa')])){logger[_0x20e5('0xb')](_0x20e5('0xc'),_0xfff9ff,_0x20e5('0xd'));return _0x2d5484[_0x20e5('0xe')]();}var _0x1333ff={'ContactId':this[_0x20e5('0xf')]['id'],'sentAt':moment()[_0x20e5('0x10')](_0x20e5('0x11')),'direction':_0x20e5('0x12')};var _0x4a90df=this[_0x20e5('0x13')];if(_0x4a90df===_0x20e5('0x14')){_0x1333ff[_0x20e5('0x15')]=this[_0x20e5('0x16')]['id'];}else{_0x1333ff[_[_0x20e5('0x17')](_0x4a90df)+_0x20e5('0x18')]=this['account']['id'];}_0x1333ff[_[_0x20e5('0x17')](_0x4a90df)+_0x20e5('0x19')]=this[_0x20e5('0x9')]['id'];if(this['interaction'][_0x20e5('0x1a')]){var _0x17d28e=_0x4eaf5c[0x2];if(!_[_0x20e5('0x1b')](_0x17d28e)){_0x1333ff[_0x20e5('0x1c')]=utils[_0x20e5('0x1d')](_0x17d28e,this);return rpc[_0x4a90df+_0x20e5('0x1e')][_0x20e5('0x1f')](_0x1333ff)[_0x20e5('0x20')](function(_0x5ba3ad){logger[_0x20e5('0xb')](_0x20e5('0xc'),_0xfff9ff,_0x1333ff[_0x20e5('0x1c')]);})['catch'](function(_0xff790a){logger[_0x20e5('0x21')](_0x20e5('0xc'),_0xfff9ff,JSON[_0x20e5('0x22')](_0xff790a));})['finally'](function(){logger['info'](_0x20e5('0x23'),_0xfff9ff);_0x2d5484[_0x20e5('0x24')]();});}else{logger[_0x20e5('0xb')](_0x20e5('0x25'),_0xfff9ff);_0x2d5484[_0x20e5('0x24')]();}}else{var _0x3e29fb=this;var _0x536a8e=apiai(_0x4eaf5c[0x0],{'language':_0x4eaf5c[0x1]||'en'});return _0x536a8e['textRequest'](this[_0x20e5('0x26')]['body'],{'sessionId':md5(this[_0x20e5('0x9')]['id'])})[_0x20e5('0x20')](function(_0x347855){_0x3e29fb[_0x20e5('0x1c')]['dialogflow']=_0x347855;_0x1333ff[_0x20e5('0x1c')]=_0x347855[_0x20e5('0x27')]['fulfillment'][_0x20e5('0x28')];return rpc[_0x4a90df+_0x20e5('0x1e')][_0x20e5('0x1f')](_0x1333ff)[_0x20e5('0x20')](function(_0x7e0b21){logger['info'](_0x20e5('0xc'),_0xfff9ff,_0x1333ff['body']);if(_0x347855[_0x20e5('0x27')][_0x20e5('0x29')][_0x20e5('0x2a')]){_0x2d5484['next']();}else{_0x2d5484['stop']();}})[_0x20e5('0x2b')](function(_0x10f50b){logger[_0x20e5('0x21')](_0x20e5('0xc'),_0xfff9ff,JSON[_0x20e5('0x22')](_0x10f50b));_0x2d5484[_0x20e5('0xe')]();});})[_0x20e5('0x2b')](function(_0x350c59){logger[_0x20e5('0x21')]('[%s][DIALOGFLOW]\x20%s',_0xfff9ff,_0x350c59[_0x20e5('0x26')]);_0x2d5484[_0x20e5('0xe')]();});}}catch(_0x49604f){logger[_0x20e5('0x21')]('[%s][DIALOGFLOW]\x20%s',_0xfff9ff,JSON[_0x20e5('0x22')](_0x49604f));_0x2d5484[_0x20e5('0x24')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 876f213..0861f80 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x372e=['[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','html-to-text','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','getMustacheRender','validate','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x323af1,_0x164004){var _0x411001=function(_0x293ea5){while(--_0x293ea5){_0x323af1['push'](_0x323af1['shift']());}};_0x411001(++_0x164004);}(_0x372e,0x144));var _0xe372=function(_0x37fe57,_0x37313f){_0x37fe57=_0x37fe57-0x0;var _0x2959b7=_0x372e[_0x37fe57];return _0x2959b7;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0xe372('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xe372('0x1'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xe372('0x2')},'priorityTrue':{'type':_0xe372('0x3'),'message':_0xe372('0x4')},'priorityFalse':{'type':_0xe372('0x3'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xe372('0x5')]=function(_0x4f463f,_0x3afee3){return function(_0xa55f5b){try{var _0x34b904={'condition':htmlToText['fromString'](utils[_0xe372('0x6')](_0x3afee3[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3afee3[0x1],'priorityFalse':_0x3afee3[0x2]};var _0x5670f2=gotoif[_0xe372('0x7')](_0x34b904,{'typecast':!![]});if(_0x5670f2['length']){logger[_0xe372('0x8')](_0xe372('0x9'),_0x4f463f,_[_0xe372('0xa')](_0x5670f2,_0xe372('0xb'))[_0xe372('0xc')](',\x20'));_0xa55f5b[_0xe372('0xd')]();}else{try{var _0x39812f=eval('('+_0x34b904[_0xe372('0xe')]+')');var _0x5495ef=_0x39812f?_0x34b904['priorityTrue']:_0x34b904[_0xe372('0xf')];logger[_0xe372('0x10')](_0xe372('0x11'),_0x4f463f,_0x34b904[_0xe372('0xe')],_0x39812f,_0x5495ef||_0xe372('0x12'));if(_0x5495ef){var _0x1d4cac=_['findIndex'](_0xa55f5b[_0xe372('0x13')](),{'p':_0x5495ef});if(_0x1d4cac>=0x0){logger['info'](_0xe372('0x14'),_0x4f463f,_0x5495ef||'next',_0x1d4cac);_0xa55f5b['next'](_0x1d4cac);}else{logger[_0xe372('0x10')](_0xe372('0x15'),_0x4f463f,_0x5495ef||_0xe372('0x12'));_0xa55f5b[_0xe372('0xd')]();}}else{_0xa55f5b[_0xe372('0x12')]();}}catch(_0x33a8ba){logger[_0xe372('0x8')](_0xe372('0x16'),_0x4f463f,_0x33a8ba[_0xe372('0xb')]);_0xa55f5b[_0xe372('0xd')]();}}}catch(_0x53c14e){logger[_0xe372('0x8')](_0xe372('0x9'),_0x4f463f,JSON['stringify'](_0x53c14e));_0xa55f5b[_0xe372('0xd')]();}};}; \ No newline at end of file +var _0x112c=['number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','message','lodash','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x51717a,_0x31c012){var _0x34c161=function(_0x12b9c0){while(--_0x12b9c0){_0x51717a['push'](_0x51717a['shift']());}};_0x34c161(++_0x31c012);}(_0x112c,0x8b));var _0xc112=function(_0x1021c7,_0x39a6c3){_0x1021c7=_0x1021c7-0x0;var _0x22bccd=_0x112c[_0x1021c7];return _0x22bccd;};'use strict';var schema=require('validate');var _=require(_0xc112('0x0'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require(_0xc112('0x1'))(_0xc112('0x2'));var gotoif=schema({'condition':{'type':_0xc112('0x3'),'required':!![],'message':_0xc112('0x4')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xc112('0x5'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xc112('0x6')]=function(_0x3b5b54,_0x4d8403){return function(_0x533b2b){try{var _0x17f223={'condition':htmlToText['fromString'](utils[_0xc112('0x7')](_0x4d8403[0x0],this),{'wordwrap':![]})[_0xc112('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4d8403[0x1],'priorityFalse':_0x4d8403[0x2]};var _0x309fe6=gotoif['validate'](_0x17f223,{'typecast':!![]});if(_0x309fe6[_0xc112('0x9')]){logger[_0xc112('0xa')](_0xc112('0xb'),_0x3b5b54,_['map'](_0x309fe6,'message')[_0xc112('0xc')](',\x20'));_0x533b2b[_0xc112('0xd')]();}else{try{var _0x3703f1=eval('('+_0x17f223[_0xc112('0xe')]+')');var _0x811b76=_0x3703f1?_0x17f223[_0xc112('0xf')]:_0x17f223[_0xc112('0x10')];logger[_0xc112('0x11')](_0xc112('0x12'),_0x3b5b54,_0x17f223[_0xc112('0xe')],_0x3703f1,_0x811b76||_0xc112('0x13'));if(_0x811b76){var _0x385b62=_['findIndex'](_0x533b2b[_0xc112('0x14')](),{'p':_0x811b76});if(_0x385b62>=0x0){logger[_0xc112('0x11')](_0xc112('0x15'),_0x3b5b54,_0x811b76||_0xc112('0x13'),_0x385b62);_0x533b2b[_0xc112('0x13')](_0x385b62);}else{logger[_0xc112('0x11')](_0xc112('0x16'),_0x3b5b54,_0x811b76||'next');_0x533b2b[_0xc112('0xd')]();}}else{_0x533b2b[_0xc112('0x13')]();}}catch(_0xe249f5){logger[_0xc112('0xa')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3b5b54,_0xe249f5[_0xc112('0x17')]);_0x533b2b[_0xc112('0xd')]();}}}catch(_0x40eccd){logger[_0xc112('0xa')](_0xc112('0xb'),_0x3b5b54,JSON['stringify'](_0x40eccd));_0x533b2b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index c18e6a4..f396455 100644 --- a/server/services/routing/server/applications/gotop.js +++ b/server/services/routing/server/applications/gotop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x218e=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','error','[%s][GOTOP]\x20%s','map','join','stop','info','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','routing','number'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x218e,0x107));var _0xe218=function(_0x101e92,_0x36b7dc){_0x101e92=_0x101e92-0x0;var _0x1567c6=_0x218e[_0x101e92];return _0x1567c6;};'use strict';var schema=require(_0xe218('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0xe218('0x1'));var gotop=schema({'priority':{'type':_0xe218('0x2'),'required':!![],'message':_0xe218('0x3')}});exports['consequence']=function(_0x366142,_0x57882f){return function(_0x316266){try{var _0x3e212e={'priority':_0x57882f[0x0]};var _0x1cd5bd=gotop['validate'](_0x3e212e,{'typecast':!![]});if(_0x1cd5bd['length']){logger[_0xe218('0x4')](_0xe218('0x5'),_0x366142,_[_0xe218('0x6')](_0x1cd5bd,'message')[_0xe218('0x7')](',\x20'));_0x316266[_0xe218('0x8')]();}else{logger[_0xe218('0x9')]('[%s][GOTOP]\x20priority\x20%s',_0x366142,_0x3e212e[_0xe218('0xa')]);if(_0x3e212e['priority']){var _0x264951=_['findIndex'](_0x316266[_0xe218('0xb')](),{'p':_0x3e212e['priority']});if(_0x264951>=0x0){logger[_0xe218('0x9')](_0xe218('0xc'),_0x366142,_0x3e212e[_0xe218('0xa')]||'next',_0x264951);_0x316266[_0xe218('0xd')](_0x264951);}else{logger[_0xe218('0x9')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x366142,_0x3e212e[_0xe218('0xa')]||'next');_0x316266[_0xe218('0x8')]();}}else{_0x316266[_0xe218('0xd')]();}}}catch(_0x1cc9d5){logger[_0xe218('0x4')](_0xe218('0x5'),_0x366142,JSON['stringify'](_0x1cc9d5));_0x316266[_0xe218('0x8')]();}};}; \ No newline at end of file +var _0x6e5b=['lodash','../../../../config/logger','number','length','error','message','join','info','[%s][GOTOP]\x20priority\x20%s','rules','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOP]\x20%s','stringify','validate'];(function(_0x3b00b4,_0x413db0){var _0x1f83a4=function(_0x5f1a3b){while(--_0x5f1a3b){_0x3b00b4['push'](_0x3b00b4['shift']());}};_0x1f83a4(++_0x413db0);}(_0x6e5b,0x10d));var _0xb6e5=function(_0x2f5040,_0x39e15e){_0x2f5040=_0x2f5040-0x0;var _0x42cc37=_0x6e5b[_0x2f5040];return _0x42cc37;};'use strict';var schema=require(_0xb6e5('0x0'));var _=require(_0xb6e5('0x1'));var logger=require(_0xb6e5('0x2'))('routing');var gotop=schema({'priority':{'type':_0xb6e5('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x597859,_0x332fb4){return function(_0x4e9fcc){try{var _0x537c46={'priority':_0x332fb4[0x0]};var _0x50040d=gotop[_0xb6e5('0x0')](_0x537c46,{'typecast':!![]});if(_0x50040d[_0xb6e5('0x4')]){logger[_0xb6e5('0x5')]('[%s][GOTOP]\x20%s',_0x597859,_['map'](_0x50040d,_0xb6e5('0x6'))[_0xb6e5('0x7')](',\x20'));_0x4e9fcc['stop']();}else{logger[_0xb6e5('0x8')](_0xb6e5('0x9'),_0x597859,_0x537c46['priority']);if(_0x537c46['priority']){var _0x1d246e=_['findIndex'](_0x4e9fcc[_0xb6e5('0xa')](),{'p':_0x537c46[_0xb6e5('0xb')]});if(_0x1d246e>=0x0){logger[_0xb6e5('0x8')](_0xb6e5('0xc'),_0x597859,_0x537c46[_0xb6e5('0xb')]||_0xb6e5('0xd'),_0x1d246e);_0x4e9fcc[_0xb6e5('0xd')](_0x1d246e);}else{logger['info'](_0xb6e5('0xe'),_0x597859,_0x537c46[_0xb6e5('0xb')]||_0xb6e5('0xd'));_0x4e9fcc[_0xb6e5('0xf')]();}}else{_0x4e9fcc['next']();}}}catch(_0x8cf427){logger[_0xb6e5('0x5')](_0xb6e5('0x10'),_0x597859,JSON[_0xb6e5('0x11')](_0x8cf427));_0x4e9fcc[_0xb6e5('0xf')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index c77232d..54f1756 100644 --- a/server/services/routing/server/applications/message.js +++ b/server/services/routing/server/applications/message.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5a8=['then','[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','lodash','../../../../config/logger','../../rpc/chatMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','channel','AccountId','account','upperFirst','InteractionId','interaction','Message','create'];(function(_0x2e06c3,_0x2e3d87){var _0x59a62e=function(_0x422dfc){while(--_0x422dfc){_0x2e06c3['push'](_0x2e06c3['shift']());}};_0x59a62e(++_0x2e3d87);}(_0xa5a8,0x187));var _0x8a5a=function(_0x2003b4,_0x56849e){_0x2003b4=_0x2003b4-0x0;var _0x7a3960=_0xa5a8[_0x2003b4];return _0x7a3960;};'use strict';var _=require(_0x8a5a('0x0'));var utils=require('./utils');var logger=require(_0x8a5a('0x1'))('routing');var rpc={'chatMessage':require(_0x8a5a('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8a5a('0x3'))};exports[_0x8a5a('0x4')]=function(_0x2f89a4,_0x4a4385){return function(_0x17b25f){try{var _0x2641b3={'body':utils[_0x8a5a('0x5')](_0x4a4385[0x0],this),'ContactId':this[_0x8a5a('0x6')]['id']};if(this['channel']===_0x8a5a('0x7')){_0x2641b3[_0x8a5a('0x8')]=this['account']['id'];}else{_0x2641b3[_['upperFirst'](this[_0x8a5a('0x9')])+_0x8a5a('0xa')]=this[_0x8a5a('0xb')]['id'];}_0x2641b3[_[_0x8a5a('0xc')](this[_0x8a5a('0x9')])+_0x8a5a('0xd')]=this[_0x8a5a('0xe')]['id'];if(rpc[this['channel']+_0x8a5a('0xf')]){return rpc[this['channel']+'Message'][_0x8a5a('0x10')](_0x2641b3)[_0x8a5a('0x11')](function(_0x5ebb72){logger['info'](_0x8a5a('0x12'),_0x2f89a4,_0x2641b3['body']);_0x17b25f[_0x8a5a('0x13')]();})[_0x8a5a('0x14')](function(_0x510876){logger[_0x8a5a('0x15')](_0x8a5a('0x12'),_0x2f89a4,JSON[_0x8a5a('0x16')](_0x510876));_0x17b25f[_0x8a5a('0x17')]();});}}catch(_0x289d62){logger[_0x8a5a('0x15')](_0x8a5a('0x12'),_0x2f89a4,JSON[_0x8a5a('0x16')](_0x289d62));_0x17b25f[_0x8a5a('0x17')]();}};}; \ No newline at end of file +var _0xf65c=['body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf65c,0x1e2));var _0xcf65=function(_0x34499d,_0x1324ad){_0x34499d=_0x34499d-0x0;var _0x5c10ae=_0xf65c[_0x34499d];return _0x5c10ae;};'use strict';var _=require(_0xcf65('0x0'));var utils=require(_0xcf65('0x1'));var logger=require(_0xcf65('0x2'))(_0xcf65('0x3'));var rpc={'chatMessage':require(_0xcf65('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xcf65('0x5')),'smsMessage':require(_0xcf65('0x6')),'faxMessage':require(_0xcf65('0x7'))};exports['consequence']=function(_0x3a5c50,_0x769f52){return function(_0xad137f){try{var _0x13876a={'body':utils[_0xcf65('0x8')](_0x769f52[0x0],this),'ContactId':this[_0xcf65('0x9')]['id']};if(this[_0xcf65('0xa')]===_0xcf65('0xb')){_0x13876a[_0xcf65('0xc')]=this[_0xcf65('0xd')]['id'];}else{_0x13876a[_['upperFirst'](this[_0xcf65('0xa')])+_0xcf65('0xe')]=this['account']['id'];}_0x13876a[_[_0xcf65('0xf')](this[_0xcf65('0xa')])+'InteractionId']=this[_0xcf65('0x10')]['id'];if(rpc[this['channel']+_0xcf65('0x11')]){return rpc[this['channel']+_0xcf65('0x11')][_0xcf65('0x12')](_0x13876a)[_0xcf65('0x13')](function(_0x3de030){logger[_0xcf65('0x14')](_0xcf65('0x15'),_0x3a5c50,_0x13876a[_0xcf65('0x16')]);_0xad137f[_0xcf65('0x17')]();})[_0xcf65('0x18')](function(_0x494d48){logger[_0xcf65('0x19')]('[%s][MESSAGE]\x20%s',_0x3a5c50,JSON[_0xcf65('0x1a')](_0x494d48));_0xad137f[_0xcf65('0x1b')]();});}}catch(_0x29d7a2){logger['error']('[%s][MESSAGE]\x20%s',_0x3a5c50,JSON['stringify'](_0x29d7a2));_0xad137f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index ae9ee4e..84a0027 100644 --- a/server/services/routing/server/applications/noop.js +++ b/server/services/routing/server/applications/noop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93af=['consequence','info','[%s][NOOP]\x20%s','getMustacheRender','stringify','stop','../../../../config/logger','routing'];(function(_0x1fe55a,_0x40dc17){var _0x31bffd=function(_0x586d19){while(--_0x586d19){_0x1fe55a['push'](_0x1fe55a['shift']());}};_0x31bffd(++_0x40dc17);}(_0x93af,0x16e));var _0xf93a=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0x93af[_0x2891d1];return _0x486948;};'use strict';var utils=require('./utils');var logger=require(_0xf93a('0x0'))(_0xf93a('0x1'));exports[_0xf93a('0x2')]=function(_0x3517de,_0x15771f){return function(_0x3060a3){try{logger[_0xf93a('0x3')](_0xf93a('0x4'),_0x3517de,utils[_0xf93a('0x5')](_0x15771f[0x0],this));_0x3060a3['next']();}catch(_0x34087c){logger['error'](_0xf93a('0x4'),_0x3517de,JSON[_0xf93a('0x6')](_0x34087c));_0x3060a3[_0xf93a('0x7')]();}};}; \ No newline at end of file +var _0xde8a=['[%s][NOOP]\x20%s','getMustacheRender','next','error','stop','./utils','consequence','info'];(function(_0x5c213a,_0x3e8d66){var _0x81bf42=function(_0x128296){while(--_0x128296){_0x5c213a['push'](_0x5c213a['shift']());}};_0x81bf42(++_0x3e8d66);}(_0xde8a,0x1bd));var _0xade8=function(_0x5955ee,_0x3d4cf8){_0x5955ee=_0x5955ee-0x0;var _0x353726=_0xde8a[_0x5955ee];return _0x353726;};'use strict';var utils=require(_0xade8('0x0'));var logger=require('../../../../config/logger')('routing');exports[_0xade8('0x1')]=function(_0x4cd2c7,_0xdec60){return function(_0x5f4d7a){try{logger[_0xade8('0x2')](_0xade8('0x3'),_0x4cd2c7,utils[_0xade8('0x4')](_0xdec60[0x0],this));_0x5f4d7a[_0xade8('0x5')]();}catch(_0x52f8c7){logger[_0xade8('0x6')](_0xade8('0x3'),_0x4cd2c7,JSON['stringify'](_0x52f8c7));_0x5f4d7a[_0xade8('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index e9e49b4..1e14a51 100644 --- a/server/services/routing/server/applications/queue.js +++ b/server/services/routing/server/applications/queue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x262f=['stop','find','timeout','createQueue','atimeout','qtimeout','rules','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','util','seq-queue','moment','ioredis','../../../../config/logger','./strategy','redis','defaults','localhost','socket.io-emitter','account','queue','from','joinAt','emit','queue_id','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/mailQueueReport','../../rpc/smsQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','create','catch','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join'];(function(_0x2a6756,_0x399a31){var _0x44dcc3=function(_0x47d15e){while(--_0x47d15e){_0x2a6756['push'](_0x2a6756['shift']());}};_0x44dcc3(++_0x399a31);}(_0x262f,0x137));var _0xf262=function(_0x4ace37,_0x4a3d1e){_0x4ace37=_0x4ace37-0x0;var _0x4f9370=_0x262f[_0x4ace37];return _0x4f9370;};'use strict';var schema=require(_0xf262('0x0'));var _=require('lodash');var util=require(_0xf262('0x1'));var seqqueue=require(_0xf262('0x2'));var moment=require(_0xf262('0x3'));var Redis=require(_0xf262('0x4'));var config=require('../../../../config/environment');var logger=require(_0xf262('0x5'))('routing');var strategy=require(_0xf262('0x6'));config[_0xf262('0x7')]=_[_0xf262('0x8')](config[_0xf262('0x7')],{'host':_0xf262('0x9'),'port':0x18eb});var io=require(_0xf262('0xa'))(new Redis(config[_0xf262('0x7')]));var attributes=['id','queue_id',_0xf262('0xb'),_0xf262('0xc'),_0xf262('0xd'),_0xf262('0xe')];function emit(_0x519546,_0xeff714,_0x109fdc){io['to'](_0x519546)[_0xf262('0xf')](_0xeff714,_0x109fdc);}function emitChannelQueueInteraction(_0x5a8b5a,_0x384ea7,_0x449db3,_0x1306db,_0x55b0e2,_0x1ad20e,_0x1057b0,_0x20e9f7){_0x449db3[_0xf262('0x10')]=_0x20e9f7;_0x449db3[_0xf262('0xc')]=_0x384ea7;_0x449db3[_0xf262('0xb')]=_0x1306db;_0x449db3['id']=_0x55b0e2;if(_0x1ad20e){_0x1057b0[util[_0xf262('0x11')](_0xf262('0x12'),_0x5a8b5a)][_0x55b0e2]=_[_0xf262('0x13')](_0x449db3,attributes);}else{delete _0x1057b0[util[_0xf262('0x11')](_0xf262('0x12'),_0x5a8b5a)][_0x55b0e2];}emit(util[_0xf262('0x11')](_0xf262('0x14'),_0x5a8b5a,_0x384ea7),util['format']('%s_queue_waiting_interaction:%s',_0x5a8b5a,_0x1ad20e?_0xf262('0x15'):_0xf262('0x16')),_[_0xf262('0x13')](_0x449db3,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xf262('0x17')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xf262('0x18')),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0xf262('0x19')},'timeout':{'type':_0xf262('0x1a'),'message':_0xf262('0x1b')}});function startRouting(_0xcc7c0e,_0x264b3e,_0xe021,_0x1cfc24){if(_0xcc7c0e&&_0x264b3e&&_0xe021){_0x264b3e['waiting']+=0x1;var _0x11147a={'uniqueid':_0xcc7c0e,'from':_0xe021[_0xf262('0x1c')]?_0xe021[_0xf262('0x1c')][_0xf262('0xd')]:'','joinAt':moment()[_0xf262('0x11')](_0xf262('0x1d')),'ContactId':_0xe021[_0xf262('0x1e')]?_0xe021[_0xf262('0x1e')]['id']:null,'ListId':_0xe021[_0xf262('0x1f')]?_0xe021[_0xf262('0x1f')]['id']:null};_0x11147a[_['upperFirst'](_0xe021[_0xf262('0x20')])+'QueueId']=_0x264b3e['id']||null;_0x11147a[_[_0xf262('0x21')](_0xe021[_0xf262('0x20')])+_0xf262('0x22')]=_0xe021[_0xf262('0x23')]?_0xe021[_0xf262('0x23')]['id']:null;_0x11147a[_[_0xf262('0x21')](_0xe021[_0xf262('0x20')])+_0xf262('0x24')]=_0xe021['message']?_0xe021[_0xf262('0x25')]['id']:null;_0x11147a[_[_0xf262('0x21')](_0xe021[_0xf262('0x20')])+(_0xe021[_0xf262('0x20')]!==_0xf262('0x26')?_0xf262('0x27'):_0xf262('0x28'))]=_0xe021['account']?_0xe021['account']['id']:null;logger[_0xf262('0x29')](util[_0xf262('0x11')]('[%s][START:QUEUE][NAME:%s]',_0xcc7c0e,_0x264b3e['name']));emitChannelQueueInteraction(_0xe021[_0xf262('0x20')],_0x264b3e[_0xf262('0x2a')],_0x11147a,_0xe021['account'][_0xf262('0x2a')],_0xe021[_0xf262('0x25')]['id'],!![],_0x1cfc24,_0x264b3e['id']);if(rpc[_0xe021[_0xf262('0x20')]+_0xf262('0x2b')]){return rpc[_0xe021[_0xf262('0x20')]+_0xf262('0x2b')][_0xf262('0x2c')](_0x11147a)[_0xf262('0x2d')](function(_0x9875bf){logger['error'](_0xf262('0x2e'));});}}}function stopRouting(_0x44b22c,_0xd55120,_0x50d22c,_0x280c3e){if(_0x44b22c&&_0xd55120){_0xd55120[_0xf262('0x2f')]-=0x1;var _0x1c9462={'leaveAt':moment()[_0xf262('0x11')](_0xf262('0x1d')),'acceptAt':moment()[_0xf262('0x11')](_0xf262('0x1d')),'reason':_0xf262('0x30')};logger[_0xf262('0x29')](util[_0xf262('0x11')](_0xf262('0x31'),_0x44b22c,_0xd55120['name']));emitChannelQueueInteraction(_0x50d22c[_0xf262('0x20')],_0xd55120['name'],_0x50d22c[_0xf262('0x1c')],_0x50d22c[_0xf262('0xb')][_0xf262('0x2a')],_0x50d22c[_0xf262('0x25')]['id'],![],_0x280c3e,_0xd55120['id']);if(rpc[_0x50d22c[_0xf262('0x20')]+_0xf262('0x2b')]){return rpc[_0x50d22c[_0xf262('0x20')]+_0xf262('0x2b')][_0xf262('0x32')](_0x44b22c,_0x1c9462)[_0xf262('0x2d')](function(_0x388f45){logger[_0xf262('0x33')]('update\x20queue\x20report');});}}}function endRouting(_0xc56488,_0x3ec788,_0x5afcff,_0x67dfba){if(_0xc56488&&_0x3ec788){_0x3ec788[_0xf262('0x2f')]-=0x1;var _0x5e7279={'leaveAt':moment()[_0xf262('0x11')](_0xf262('0x1d')),'exitAt':moment()[_0xf262('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger['info'](util['format'](_0xf262('0x34'),_0xc56488,_0x3ec788[_0xf262('0x2a')]));emitChannelQueueInteraction(_0x5afcff['channel'],_0x3ec788['name'],_0x5afcff[_0xf262('0x1c')],_0x5afcff['account'][_0xf262('0x2a')],_0x5afcff[_0xf262('0x25')]['id'],![],_0x67dfba);if(rpc[_0x5afcff[_0xf262('0x20')]+'QueueReport']){return rpc[_0x5afcff['channel']+_0xf262('0x2b')]['update'](_0xc56488,_0x5e7279)[_0xf262('0x2d')](function(_0x533305){logger[_0xf262('0x33')](_0xf262('0x35'));});}}}function handleFindQueue(_0x90c007){return function(_0x3bf096){return _0x3bf096[_0xf262('0x2a')][_0xf262('0x36')]()===_0x90c007[_0xf262('0x36')]();};}exports[_0xf262('0x37')]=function(_0x350025,_0x1f3060,_0x397e1f,_0x522dc4){return function(_0x450300){try{var _0x417d0c={'name':_0x1f3060[0x0],'timeout':_0x1f3060[0x1]};var _0x4c20ba=queue[_0xf262('0x0')](_0x417d0c,{'typecast':!![]});if(_0x4c20ba['length']){logger['error'](_0xf262('0x38'),_0x350025,_[_0xf262('0x39')](_0x4c20ba,_0xf262('0x25'))[_0xf262('0x3a')](',\x20'));_0x450300[_0xf262('0x3b')]();}else{var _0x43bec7=_[_0xf262('0x3c')](_0x397e1f[_0x522dc4[_0xf262('0x20')]+'Queues'],handleFindQueue(_0x417d0c[_0xf262('0x2a')]));if(_0x43bec7){startRouting(_0x350025,_0x43bec7,_0x522dc4,_0x397e1f);var _0x503ff6=(_0x43bec7['timeout']||0xa)*0x3e8;var _0x5594d1=(_0x417d0c[_0xf262('0x3d')]||0x14)*0x3e8;var _0x4b6718,_0x65e482;if(_0x503ff6>_0x5594d1){_0x5594d1=_0x503ff6;}var _0x1e45cf=seqqueue[_0xf262('0x3e')](_0x503ff6);_0x1e45cf['id']=_0x350025;_0x1e45cf[_0xf262('0x3f')]=_0x503ff6;_0x1e45cf[_0xf262('0x40')]=_0x5594d1;_0x1e45cf[_0xf262('0x20')]=_0x522dc4['channel'];_0x397e1f[_0xf262('0x41')][_0x350025]['on']('end',function(){stopRouting(_0x350025,_0x43bec7,_0x522dc4,_0x397e1f);_0x1e45cf[_0xf262('0x42')](!![]);clearTimeout(_0x4b6718);_0x4b6718=undefined;if(_0x397e1f[_0xf262('0x41')][_0x350025]){delete _0x397e1f[_0xf262('0x41')][_0x350025];}logger['info'](_0xf262('0x43'),_0x350025);_0x450300['stop']();});_0x4b6718=setTimeout(function(){endRouting(_0x350025,_0x43bec7,_0x522dc4,_0x397e1f);clearTimeout(_0x4b6718);_0x1e45cf[_0xf262('0x42')](!![]);logger[_0xf262('0x29')]('[%s][QUEUE]\x20ROUTING\x20END',_0x350025);_0x450300[_0xf262('0x44')]();},_0x5594d1);switch(_0x43bec7[_0xf262('0x45')]){case _0xf262('0x46'):strategy[_0xf262('0x46')](_0x1e45cf,_0x43bec7,_0x397e1f,_0x522dc4);break;default:strategy[_0xf262('0x47')](_0x1e45cf,_0x43bec7,_0x397e1f,_0x522dc4);}}else{logger[_0xf262('0x33')](_0xf262('0x48'),_0x350025,_0x417d0c[_0xf262('0x2a')]);_0x450300['stop']();}}}catch(_0x64b1b4){console[_0xf262('0x49')](_0x64b1b4);logger[_0xf262('0x33')](_0xf262('0x38'),_0x350025,_0x64b1b4['stack']);_0x450300[_0xf262('0x3b')]();}};}; \ No newline at end of file +var _0xbf1b=['[%s][QUEUE]\x20%s','map','join','find','Queues','atimeout','qtimeout','end','close','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','log','stack','validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','socket.io-emitter','queue','joinAt','emit','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','account','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','toLowerCase','consequence','length'];(function(_0x313daa,_0x3152fb){var _0x269a75=function(_0x28a150){while(--_0x28a150){_0x313daa['push'](_0x313daa['shift']());}};_0x269a75(++_0x3152fb);}(_0xbf1b,0x146));var _0xbbf1=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xbf1b[_0x40220a];return _0x3903cc;};'use strict';var schema=require(_0xbbf1('0x0'));var _=require(_0xbbf1('0x1'));var util=require(_0xbbf1('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xbbf1('0x3'));var Redis=require(_0xbbf1('0x4'));var config=require(_0xbbf1('0x5'));var logger=require(_0xbbf1('0x6'))(_0xbbf1('0x7'));var strategy=require('./strategy');config[_0xbbf1('0x8')]=_[_0xbbf1('0x9')](config[_0xbbf1('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xbbf1('0xa'))(new Redis(config[_0xbbf1('0x8')]));var attributes=['id','queue_id','account',_0xbbf1('0xb'),'from',_0xbbf1('0xc')];function emit(_0x4c8528,_0x456dd0,_0x17e955){io['to'](_0x4c8528)[_0xbbf1('0xd')](_0x456dd0,_0x17e955);}function emitChannelQueueInteraction(_0x1fb0e0,_0x14ed2a,_0x2dc15b,_0x30e8ec,_0x49e16a,_0x421b1c,_0x2eca7c,_0x457014){_0x2dc15b['queue_id']=_0x457014;_0x2dc15b[_0xbbf1('0xb')]=_0x14ed2a;_0x2dc15b['account']=_0x30e8ec;_0x2dc15b['id']=_0x49e16a;if(_0x421b1c){_0x2eca7c[util[_0xbbf1('0xe')]('%sQueuesWaitingInteractions',_0x1fb0e0)][_0x49e16a]=_[_0xbbf1('0xf')](_0x2dc15b,attributes);}else{delete _0x2eca7c[util[_0xbbf1('0xe')](_0xbbf1('0x10'),_0x1fb0e0)][_0x49e16a];}emit(util[_0xbbf1('0xe')](_0xbbf1('0x11'),_0x1fb0e0,_0x14ed2a),util[_0xbbf1('0xe')](_0xbbf1('0x12'),_0x1fb0e0,_0x421b1c?_0xbbf1('0x13'):_0xbbf1('0x14')),_[_0xbbf1('0xf')](_0x2dc15b,attributes));}var rpc={'openchannelQueueReport':require(_0xbbf1('0x15')),'mailQueueReport':require(_0xbbf1('0x16')),'chatQueueReport':require(_0xbbf1('0x17')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xbbf1('0x18'))};var queue=schema({'name':{'type':_0xbbf1('0x19'),'required':!![],'message':_0xbbf1('0x1a')},'timeout':{'type':_0xbbf1('0x1b'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0xf1c459,_0x25af6d,_0x389f04,_0x4812f3){if(_0xf1c459&&_0x25af6d&&_0x389f04){_0x25af6d['waiting']+=0x1;var _0x573bd5={'uniqueid':_0xf1c459,'from':_0x389f04[_0xbbf1('0x1c')]?_0x389f04[_0xbbf1('0x1c')][_0xbbf1('0x1d')]:'','joinAt':moment()[_0xbbf1('0xe')](_0xbbf1('0x1e')),'ContactId':_0x389f04['contact']?_0x389f04[_0xbbf1('0x1f')]['id']:null,'ListId':_0x389f04[_0xbbf1('0x20')]?_0x389f04['list']['id']:null};_0x573bd5[_[_0xbbf1('0x21')](_0x389f04[_0xbbf1('0x22')])+'QueueId']=_0x25af6d['id']||null;_0x573bd5[_['upperFirst'](_0x389f04[_0xbbf1('0x22')])+_0xbbf1('0x23')]=_0x389f04[_0xbbf1('0x24')]?_0x389f04[_0xbbf1('0x24')]['id']:null;_0x573bd5[_['upperFirst'](_0x389f04['channel'])+_0xbbf1('0x25')]=_0x389f04[_0xbbf1('0x26')]?_0x389f04[_0xbbf1('0x26')]['id']:null;_0x573bd5[_[_0xbbf1('0x21')](_0x389f04[_0xbbf1('0x22')])+(_0x389f04['channel']!==_0xbbf1('0x27')?_0xbbf1('0x28'):_0xbbf1('0x29'))]=_0x389f04[_0xbbf1('0x2a')]?_0x389f04[_0xbbf1('0x2a')]['id']:null;logger[_0xbbf1('0x2b')](util[_0xbbf1('0xe')](_0xbbf1('0x2c'),_0xf1c459,_0x25af6d[_0xbbf1('0x2d')]));emitChannelQueueInteraction(_0x389f04[_0xbbf1('0x22')],_0x25af6d[_0xbbf1('0x2d')],_0x573bd5,_0x389f04[_0xbbf1('0x2a')][_0xbbf1('0x2d')],_0x389f04[_0xbbf1('0x26')]['id'],!![],_0x4812f3,_0x25af6d['id']);if(rpc[_0x389f04[_0xbbf1('0x22')]+_0xbbf1('0x2e')]){return rpc[_0x389f04[_0xbbf1('0x22')]+'QueueReport'][_0xbbf1('0x2f')](_0x573bd5)[_0xbbf1('0x30')](function(_0x104eee){logger[_0xbbf1('0x31')](_0xbbf1('0x32'));});}}}function stopRouting(_0x111c52,_0x2c6c18,_0x3073fc,_0x3b6832){if(_0x111c52&&_0x2c6c18){_0x2c6c18['waiting']-=0x1;var _0x564b84={'leaveAt':moment()['format'](_0xbbf1('0x1e')),'acceptAt':moment()['format'](_0xbbf1('0x1e')),'reason':_0xbbf1('0x33')};logger[_0xbbf1('0x2b')](util[_0xbbf1('0xe')](_0xbbf1('0x34'),_0x111c52,_0x2c6c18[_0xbbf1('0x2d')]));emitChannelQueueInteraction(_0x3073fc['channel'],_0x2c6c18['name'],_0x3073fc[_0xbbf1('0x1c')],_0x3073fc[_0xbbf1('0x2a')]['name'],_0x3073fc[_0xbbf1('0x26')]['id'],![],_0x3b6832,_0x2c6c18['id']);if(rpc[_0x3073fc['channel']+_0xbbf1('0x2e')]){return rpc[_0x3073fc['channel']+'QueueReport'][_0xbbf1('0x35')](_0x111c52,_0x564b84)[_0xbbf1('0x30')](function(_0x3d53ae){logger[_0xbbf1('0x31')](_0xbbf1('0x36'));});}}}function endRouting(_0xd3e084,_0x2aede0,_0x5bfe77,_0x55acd8){if(_0xd3e084&&_0x2aede0){_0x2aede0['waiting']-=0x1;var _0x44ae01={'leaveAt':moment()[_0xbbf1('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xbbf1('0xe')](_0xbbf1('0x1e')),'reason':_0xbbf1('0x37')};logger[_0xbbf1('0x2b')](util[_0xbbf1('0xe')]('[%s][END:QUEUE][NAME:%s]',_0xd3e084,_0x2aede0[_0xbbf1('0x2d')]));emitChannelQueueInteraction(_0x5bfe77['channel'],_0x2aede0[_0xbbf1('0x2d')],_0x5bfe77[_0xbbf1('0x1c')],_0x5bfe77[_0xbbf1('0x2a')][_0xbbf1('0x2d')],_0x5bfe77[_0xbbf1('0x26')]['id'],![],_0x55acd8);if(rpc[_0x5bfe77[_0xbbf1('0x22')]+_0xbbf1('0x2e')]){return rpc[_0x5bfe77['channel']+_0xbbf1('0x2e')][_0xbbf1('0x35')](_0xd3e084,_0x44ae01)[_0xbbf1('0x30')](function(_0xc74284){logger[_0xbbf1('0x31')]('update\x20queue\x20report');});}}}function handleFindQueue(_0xd24bcf){return function(_0x4c3900){return _0x4c3900[_0xbbf1('0x2d')]['toLowerCase']()===_0xd24bcf[_0xbbf1('0x38')]();};}exports[_0xbbf1('0x39')]=function(_0x414cc0,_0x1142eb,_0x2f9783,_0x3c66f5){return function(_0x498852){try{var _0x242504={'name':_0x1142eb[0x0],'timeout':_0x1142eb[0x1]};var _0x51ec1d=queue[_0xbbf1('0x0')](_0x242504,{'typecast':!![]});if(_0x51ec1d[_0xbbf1('0x3a')]){logger[_0xbbf1('0x31')](_0xbbf1('0x3b'),_0x414cc0,_[_0xbbf1('0x3c')](_0x51ec1d,'message')[_0xbbf1('0x3d')](',\x20'));_0x498852['stop']();}else{var _0x169486=_[_0xbbf1('0x3e')](_0x2f9783[_0x3c66f5[_0xbbf1('0x22')]+_0xbbf1('0x3f')],handleFindQueue(_0x242504['name']));if(_0x169486){startRouting(_0x414cc0,_0x169486,_0x3c66f5,_0x2f9783);var _0x26fd35=(_0x169486[_0xbbf1('0x37')]||0xa)*0x3e8;var _0x39258d=(_0x242504[_0xbbf1('0x37')]||0x14)*0x3e8;var _0x47f36b,_0x38297e;if(_0x26fd35>_0x39258d){_0x39258d=_0x26fd35;}var _0x400cd5=seqqueue['createQueue'](_0x26fd35);_0x400cd5['id']=_0x414cc0;_0x400cd5[_0xbbf1('0x40')]=_0x26fd35;_0x400cd5[_0xbbf1('0x41')]=_0x39258d;_0x400cd5[_0xbbf1('0x22')]=_0x3c66f5['channel'];_0x2f9783['rules'][_0x414cc0]['on'](_0xbbf1('0x42'),function(){stopRouting(_0x414cc0,_0x169486,_0x3c66f5,_0x2f9783);_0x400cd5[_0xbbf1('0x43')](!![]);clearTimeout(_0x47f36b);_0x47f36b=undefined;if(_0x2f9783[_0xbbf1('0x44')][_0x414cc0]){delete _0x2f9783[_0xbbf1('0x44')][_0x414cc0];}logger['info'](_0xbbf1('0x45'),_0x414cc0);_0x498852[_0xbbf1('0x46')]();});_0x47f36b=setTimeout(function(){endRouting(_0x414cc0,_0x169486,_0x3c66f5,_0x2f9783);clearTimeout(_0x47f36b);_0x400cd5[_0xbbf1('0x43')](!![]);logger[_0xbbf1('0x2b')](_0xbbf1('0x47'),_0x414cc0);_0x498852[_0xbbf1('0x48')]();},_0x39258d);switch(_0x169486[_0xbbf1('0x49')]){case'rrmemory':strategy[_0xbbf1('0x4a')](_0x400cd5,_0x169486,_0x2f9783,_0x3c66f5);break;default:strategy['beepall'](_0x400cd5,_0x169486,_0x2f9783,_0x3c66f5);}}else{logger[_0xbbf1('0x31')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x414cc0,_0x242504[_0xbbf1('0x2d')]);_0x498852[_0xbbf1('0x46')]();}}}catch(_0x105748){console[_0xbbf1('0x4b')](_0x105748);logger['error'](_0xbbf1('0x3b'),_0x414cc0,_0x105748[_0xbbf1('0x4c')]);_0x498852[_0xbbf1('0x46')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index ea90047..7b4fb69 100644 --- a/server/services/routing/server/applications/strategy/agent.js +++ b/server/services/routing/server/applications/strategy/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7940=['[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','agent','realtime','squeue','push','handleRun','bind','timeout','handleTimeout','handleDrained','prototype','info'];(function(_0x397d16,_0x3d3968){var _0x3d805a=function(_0x91dae4){while(--_0x91dae4){_0x397d16['push'](_0x397d16['shift']());}};_0x3d805a(++_0x3d3968);}(_0x7940,0x1ee));var _0x0794=function(_0x1cb0d4,_0xb17e90){_0x1cb0d4=_0x1cb0d4-0x0;var _0x2ac550=_0x7940[_0x1cb0d4];return _0x2ac550;};'use strict';var _=require(_0x0794('0x0'));var uuid=require('uuid');var util=require(_0x0794('0x1'));var logger=require(_0x0794('0x2'))(_0x0794('0x3'));var Agent=function(_0x5bb886,_0x384948,_0x352e88,_0x475c16){this[_0x0794('0x4')]=uuid['v4']();this['squeue']=_0x5bb886;this[_0x0794('0x5')]=_0x384948;this[_0x0794('0x6')]=_0x352e88;this[_0x0794('0x3')]=_0x475c16;this[_0x0794('0x7')][_0x0794('0x8')](this[_0x0794('0x9')][_0x0794('0xa')](this),this['handleTimeout']['bind'](this));this[_0x0794('0x7')]['on'](_0x0794('0xb'),this[_0x0794('0xc')]['bind'](this));this[_0x0794('0x7')]['on']('drained',this[_0x0794('0xd')][_0x0794('0xa')](this));};Agent[_0x0794('0xe')][_0x0794('0x8')]=function(){this[_0x0794('0x7')][_0x0794('0x8')](this[_0x0794('0x9')][_0x0794('0xa')](this),this[_0x0794('0xc')][_0x0794('0xa')](this));};Agent[_0x0794('0xe')]['handleDrained']=function(){this[_0x0794('0xc')](!![]);};Agent[_0x0794('0xe')][_0x0794('0x9')]=function(_0x13bc7a){logger[_0x0794('0xf')](_0x0794('0x10'),this['squeue']['id'],this[_0x0794('0x5')]['id']);if(_['isNil'](this[_0x0794('0x6')][_0x0794('0x11')][this['agent']['id']])){logger[_0x0794('0xf')](_0x0794('0x12'),this[_0x0794('0x7')]['id'],this[_0x0794('0x5')]['id']);setTimeout(this[_0x0794('0x8')][_0x0794('0xa')](this),0x3e8);}else{if(this['routing'][_0x0794('0x13')]||util[_0x0794('0x14')](this['squeue']['id'],this['realtime'][_0x0794('0x11')][this[_0x0794('0x5')]['id']],this[_0x0794('0x7')][_0x0794('0x15')],![])){this[_0x0794('0x6')][_0x0794('0x11')][this['agent']['id']][_0x0794('0x16')]=!![];this[_0x0794('0x6')][_0x0794('0x11')][this[_0x0794('0x5')]['id']][_0x0794('0x17')]=undefined;util[_0x0794('0x18')](this[_0x0794('0x4')],this[_0x0794('0x7')]['id'],this[_0x0794('0x6')][_0x0794('0x11')][this[_0x0794('0x5')]['id']],null,this[_0x0794('0x3')]);util[_0x0794('0x19')](this[_0x0794('0x7')]['id'],this[_0x0794('0x6')]['agents'][this[_0x0794('0x5')]['id']],_0x0794('0x1a')+(this[_0x0794('0x3')][_0x0794('0x13')]?_0x0794('0x1b'):''));}else{logger[_0x0794('0xf')](_0x0794('0x1c'),this[_0x0794('0x7')]['id'],this[_0x0794('0x5')]['id']);setTimeout(this[_0x0794('0x8')][_0x0794('0xa')](this),0x3e8);}}};Agent['prototype'][_0x0794('0xc')]=function(_0x484db1){if(_['isNil'](this[_0x0794('0x6')]['agents'][this[_0x0794('0x5')]['id']])){return logger[_0x0794('0xf')](_0x0794('0x12'),this[_0x0794('0x7')]['id'],this[_0x0794('0x5')]['id']);}else{logger[_0x0794('0xf')](_0x0794('0x1d'),this['squeue']['id'],this[_0x0794('0x5')]['id']);util[_0x0794('0x1e')](this[_0x0794('0x4')],this[_0x0794('0x7')]['id'],this[_0x0794('0x6')][_0x0794('0x11')][this[_0x0794('0x5')]['id']],null,this[_0x0794('0x3')]);this['realtime'][_0x0794('0x11')][this[_0x0794('0x5')]['id']]['busy']=![];this[_0x0794('0x6')][_0x0794('0x11')][this[_0x0794('0x5')]['id']][_0x0794('0x17')]=undefined;util[_0x0794('0x19')](this[_0x0794('0x7')]['id'],this[_0x0794('0x6')][_0x0794('0x11')][this['agent']['id']],_0x484db1?_0x0794('0x1f'):_0x0794('0x20'));}if(!_0x484db1){setTimeout(this[_0x0794('0x8')][_0x0794('0xa')](this),0x3e8);}};function agent(_0x4d0c2b,_0x26d6ad,_0xaad33c,_0x406012){return new Agent(_0x4d0c2b,_0x26d6ad,_0xaad33c,_0x406012);}module[_0x0794('0x21')]=agent; \ No newline at end of file +var _0xbc6c=['realtime','agents','info','isAgentAvailable','channel','busy','busyQueue','writeLog','forcedOwnership',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','TIMEOUT','exports','uuid','routing','notificationId','agent','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil'];(function(_0x24b85c,_0xe49876){var _0x43328d=function(_0x19fe87){while(--_0x19fe87){_0x24b85c['push'](_0x24b85c['shift']());}};_0x43328d(++_0xe49876);}(_0xbc6c,0x1b1));var _0xcbc6=function(_0x4ec536,_0x346aff){_0x4ec536=_0x4ec536-0x0;var _0x276f29=_0xbc6c[_0x4ec536];return _0x276f29;};'use strict';var _=require('lodash');var uuid=require(_0xcbc6('0x0'));var util=require('./util');var logger=require('../../../../../config/logger')(_0xcbc6('0x1'));var Agent=function(_0x1a23d5,_0x1ed9f0,_0x20205f,_0x40f649){this[_0xcbc6('0x2')]=uuid['v4']();this['squeue']=_0x1a23d5;this[_0xcbc6('0x3')]=_0x1ed9f0;this['realtime']=_0x20205f;this[_0xcbc6('0x1')]=_0x40f649;this[_0xcbc6('0x4')][_0xcbc6('0x5')](this[_0xcbc6('0x6')][_0xcbc6('0x7')](this),this[_0xcbc6('0x8')][_0xcbc6('0x7')](this));this[_0xcbc6('0x4')]['on'](_0xcbc6('0x9'),this[_0xcbc6('0x8')][_0xcbc6('0x7')](this));this[_0xcbc6('0x4')]['on'](_0xcbc6('0xa'),this[_0xcbc6('0xb')][_0xcbc6('0x7')](this));};Agent[_0xcbc6('0xc')][_0xcbc6('0x5')]=function(){this[_0xcbc6('0x4')][_0xcbc6('0x5')](this[_0xcbc6('0x6')][_0xcbc6('0x7')](this),this[_0xcbc6('0x8')]['bind'](this));};Agent[_0xcbc6('0xc')][_0xcbc6('0xb')]=function(){this[_0xcbc6('0x8')](!![]);};Agent[_0xcbc6('0xc')][_0xcbc6('0x6')]=function(_0x3e0b45){logger['info'](_0xcbc6('0xd'),this[_0xcbc6('0x4')]['id'],this['agent']['id']);if(_[_0xcbc6('0xe')](this[_0xcbc6('0xf')][_0xcbc6('0x10')][this[_0xcbc6('0x3')]['id']])){logger[_0xcbc6('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xcbc6('0x4')]['id'],this['agent']['id']);setTimeout(this[_0xcbc6('0x5')][_0xcbc6('0x7')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0xcbc6('0x12')](this[_0xcbc6('0x4')]['id'],this['realtime']['agents'][this[_0xcbc6('0x3')]['id']],this[_0xcbc6('0x4')][_0xcbc6('0x13')],![])){this[_0xcbc6('0xf')][_0xcbc6('0x10')][this['agent']['id']][_0xcbc6('0x14')]=!![];this['realtime'][_0xcbc6('0x10')][this[_0xcbc6('0x3')]['id']][_0xcbc6('0x15')]=undefined;util['showNotification'](this[_0xcbc6('0x2')],this[_0xcbc6('0x4')]['id'],this[_0xcbc6('0xf')][_0xcbc6('0x10')][this['agent']['id']],null,this[_0xcbc6('0x1')]);util[_0xcbc6('0x16')](this[_0xcbc6('0x4')]['id'],this[_0xcbc6('0xf')][_0xcbc6('0x10')][this[_0xcbc6('0x3')]['id']],'RINGING'+(this[_0xcbc6('0x1')][_0xcbc6('0x17')]?_0xcbc6('0x18'):''));}else{logger[_0xcbc6('0x11')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xcbc6('0x4')]['id'],this['agent']['id']);setTimeout(this[_0xcbc6('0x5')][_0xcbc6('0x7')](this),0x3e8);}}};Agent['prototype'][_0xcbc6('0x8')]=function(_0x4e2a95){if(_[_0xcbc6('0xe')](this[_0xcbc6('0xf')][_0xcbc6('0x10')][this['agent']['id']])){return logger[_0xcbc6('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xcbc6('0x4')]['id'],this[_0xcbc6('0x3')]['id']);}else{logger[_0xcbc6('0x11')](_0xcbc6('0x19'),this[_0xcbc6('0x4')]['id'],this['agent']['id']);util['hideNotification'](this[_0xcbc6('0x2')],this[_0xcbc6('0x4')]['id'],this['realtime']['agents'][this[_0xcbc6('0x3')]['id']],null,this['routing']);this['realtime'][_0xcbc6('0x10')][this[_0xcbc6('0x3')]['id']][_0xcbc6('0x14')]=![];this[_0xcbc6('0xf')]['agents'][this[_0xcbc6('0x3')]['id']][_0xcbc6('0x15')]=undefined;util['writeLog'](this[_0xcbc6('0x4')]['id'],this[_0xcbc6('0xf')][_0xcbc6('0x10')][this[_0xcbc6('0x3')]['id']],_0x4e2a95?'STOP':_0xcbc6('0x1a'));}if(!_0x4e2a95){setTimeout(this[_0xcbc6('0x5')][_0xcbc6('0x7')](this),0x3e8);}};function agent(_0x547ca5,_0x1a6b25,_0x103a34,_0x397f7f){return new Agent(_0x547ca5,_0x1a6b25,_0x103a34,_0x397f7f);}module[_0xcbc6('0x1b')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 847704a..e29c4a3 100644 --- a/server/services/routing/server/applications/strategy/beepall.js +++ b/server/services/routing/server/applications/strategy/beepall.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b5b=['busy','busyQueue','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','exports','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','push','isNil','Agents','length','agents','info','isAgentAvailable','channel','writeLog','RINGING'];(function(_0x3bf4d5,_0x366a37){var _0x48fdea=function(_0x665bbe){while(--_0x665bbe){_0x3bf4d5['push'](_0x3bf4d5['shift']());}};_0x48fdea(++_0x366a37);}(_0x2b5b,0x196));var _0xb2b5=function(_0x12a674,_0x475b5b){_0x12a674=_0x12a674-0x0;var _0x28680a=_0x2b5b[_0x12a674];return _0x28680a;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0xb2b5('0x0'));var logger=require(_0xb2b5('0x1'))(_0xb2b5('0x2'));var Beepall=function(_0x33f2dd,_0x5f1638,_0x18ea46,_0x1e6c1c){this[_0xb2b5('0x3')]=uuid['v4']();this[_0xb2b5('0x4')]=_0x33f2dd;this[_0xb2b5('0x5')]=_0x5f1638;this[_0xb2b5('0x6')]=_0x18ea46;this['routing']=_0x1e6c1c;this[_0xb2b5('0x4')]['push'](this[_0xb2b5('0x7')][_0xb2b5('0x8')](this),this[_0xb2b5('0x9')][_0xb2b5('0x8')](this));this[_0xb2b5('0x4')]['on'](_0xb2b5('0xa'),this[_0xb2b5('0x9')]['bind'](this));this[_0xb2b5('0x4')]['on']('drained',this[_0xb2b5('0xb')]['bind'](this));};Beepall[_0xb2b5('0xc')][_0xb2b5('0xd')]=function(){this[_0xb2b5('0x4')][_0xb2b5('0xd')](this['handleRun'][_0xb2b5('0x8')](this),this['handleTimeout'][_0xb2b5('0x8')](this));};Beepall[_0xb2b5('0xc')][_0xb2b5('0xb')]=function(_0x561b6b){this[_0xb2b5('0x9')](!![]);};Beepall[_0xb2b5('0xc')][_0xb2b5('0x7')]=function(_0x167f92){var _0x20b95b=!![];if(!_['isNil'](this[_0xb2b5('0x5')])&&!_[_0xb2b5('0xe')](this[_0xb2b5('0x5')][_0xb2b5('0xf')])&&this[_0xb2b5('0x5')][_0xb2b5('0xf')][_0xb2b5('0x10')]>0x0){for(var _0x4aef4b=0x0,_0x5c58c8;_0x4aef4b0x0){for(var _0x18a304=0x0,_0x82fec3;_0x18a3040x0&&_0x22abea[_0xac6e45+_0x88cc('0x2a')]>=_0x22abea[_0xac6e45+_0x88cc('0x29')]){writeLog(_0x54b67,_0x22abea,_0xac6e45[_0x88cc('0x2b')]()+_0x88cc('0x2c'));return![];}}return!![];};exports[_0x88cc('0x2d')]=function(_0xdced80,_0x55b1f2,_0x53b48d,_0x401df8,_0x45f1c6){return sendNotification(!![],_0xdced80,_0x55b1f2,_0x53b48d,_0x401df8,_0x45f1c6);};exports[_0x88cc('0x2e')]=function(_0x5b77ae,_0x570ea0,_0x18ced1,_0x2cc552,_0x5511b9){return sendNotification(![],_0x5b77ae,_0x570ea0,_0x18ced1,_0x2cc552,_0x5511b9);};exports[_0x88cc('0x2f')]=writeLog; \ No newline at end of file +var _0xfe36=['mustache','ioredis','../../../../../config/environment','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','notification:%s','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','writeLog','lodash','util'];(function(_0xe477b5,_0x3c0ccc){var _0x5d98ae=function(_0xa0d2ea){while(--_0xa0d2ea){_0xe477b5['push'](_0xe477b5['shift']());}};_0x5d98ae(++_0x3c0ccc);}(_0xfe36,0x1b6));var _0x6fe3=function(_0xbe1e14,_0x3b6717){_0xbe1e14=_0xbe1e14-0x0;var _0x4afaf0=_0xfe36[_0xbe1e14];return _0x4afaf0;};'use strict';var _=require(_0x6fe3('0x0'));var util=require(_0x6fe3('0x1'));var utils=require('../utils');var Mustache=require(_0x6fe3('0x2'));var Redis=require(_0x6fe3('0x3'));var config=require(_0x6fe3('0x4'));var logger=require('../../../../../config/logger')(_0x6fe3('0x5'));config[_0x6fe3('0x6')]=_[_0x6fe3('0x7')](config[_0x6fe3('0x6')],{'host':_0x6fe3('0x8'),'port':0x18eb});var io=require(_0x6fe3('0x9'))(new Redis(config['redis']));function emit(_0x5ef797,_0x36998c,_0x373ed8){io['to'](_0x5ef797)[_0x6fe3('0xa')](_0x36998c,_0x373ed8);}function sendNotification(_0x55e152,_0x3ceb6d,_0x2f0cfc,_0x5242de,_0x4bf1bc,_0x30cb6d){io['to'](util[_0x6fe3('0xb')](_0x6fe3('0xc'),_0x5242de[_0x6fe3('0xd')]))[_0x6fe3('0xa')](_0x6fe3('0xe'),_0x5242de);var _0x486809=_0x30cb6d||{};var _0x3efdbc=_0x2f0cfc[_0x6fe3('0xf')]('.');var _0x316c7d={'uniqueid':_0x3ceb6d,'channel':_0x3efdbc[0x0],'id':_0x3efdbc[0x1],'title':_0x3efdbc[0x0]+_0x6fe3('0x10'),'interactionId':_0x3efdbc[0x2],'queue':_0x4bf1bc?_0x4bf1bc[_0x6fe3('0xd')]:null,'sound':_0x486809[_0x6fe3('0x11')][_0x6fe3('0x12')],'shake':_0x486809[_0x6fe3('0x11')][_0x6fe3('0x13')]};try{if(!_0x486809[_0x6fe3('0x14')]){_0x486809[_0x6fe3('0x14')]={};}if(_0x4bf1bc){_0x486809[_0x6fe3('0x14')]['queue']=_0x4bf1bc;}else if(_0x486809['body'][_0x6fe3('0x15')]){delete _0x486809['body'][_0x6fe3('0x15')];}_0x316c7d[_0x6fe3('0x16')]=utils[_0x6fe3('0x17')](_0x486809[_0x6fe3('0x11')]['notificationTemplate'],_0x486809);}catch(_0x278f3a){_0x316c7d[_0x6fe3('0x16')]=_0x6fe3('0x18');logger[_0x6fe3('0x19')](util[_0x6fe3('0xb')]('[%s][QUEUE]\x20%s',_0x3ceb6d,_0x278f3a['message']));}io['to'](util['format']('user:%s',_0x5242de['name']))[_0x6fe3('0xa')](util[_0x6fe3('0xb')](_0x6fe3('0x1a'),_0x55e152?'save':_0x6fe3('0x1b')),_0x316c7d);}function writeLog(_0x3bc4b9,_0xa506ef,_0x31621f){return logger['info'](util[_0x6fe3('0xb')](_0x6fe3('0x1c'),_0x3bc4b9,_0xa506ef['name'],_0x31621f));}exports[_0x6fe3('0x1d')]=function(_0x1ac28c,_0x3bbb7f,_0x7d2f2b,_0x54f931){if(_0x3bbb7f['busy']){writeLog(_0x1ac28c,_0x3bbb7f,_0x6fe3('0x1e'));return![];}if(!_0x3bbb7f[_0x6fe3('0x1f')]){writeLog(_0x1ac28c,_0x3bbb7f,'OFFLINE');return![];}if(_0x3bbb7f[_0x7d2f2b+'Pause']){writeLog(_0x1ac28c,_0x3bbb7f,_0x6fe3('0x20'));return![];}if(_0x54f931&&_0x3bbb7f[_0x6fe3('0x21')](_0x7d2f2b+_0x6fe3('0x22'))&&_0x3bbb7f[_0x6fe3('0x21')](_0x7d2f2b+_0x6fe3('0x23'))){if(_0x3bbb7f[_0x7d2f2b+_0x6fe3('0x22')]>0x0&&_0x3bbb7f[_0x7d2f2b+'CurrentCapacity']>=_0x3bbb7f[_0x7d2f2b+'Capacity']){writeLog(_0x1ac28c,_0x3bbb7f,_0x7d2f2b[_0x6fe3('0x24')]()+_0x6fe3('0x25'));return![];}}return!![];};exports[_0x6fe3('0x26')]=function(_0x483e79,_0x8a8b62,_0x46eb3e,_0x42c19b,_0x2dc377){return sendNotification(!![],_0x483e79,_0x8a8b62,_0x46eb3e,_0x42c19b,_0x2dc377);};exports['hideNotification']=function(_0x1a0cf5,_0x1325ca,_0x2d0b63,_0x193d0b,_0x12c0cc){return sendNotification(![],_0x1a0cf5,_0x1325ca,_0x2d0b63,_0x193d0b,_0x12c0cc);};exports[_0x6fe3('0x27')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index f1e5ecb..f57fe6f 100644 --- a/server/services/routing/server/applications/system.js +++ b/server/services/routing/server/applications/system.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80ca=['exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','validate','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender'];(function(_0x27f131,_0x114eae){var _0x2694af=function(_0x5be1b8){while(--_0x5be1b8){_0x27f131['push'](_0x27f131['shift']());}};_0x2694af(++_0x114eae);}(_0x80ca,0x1c4));var _0xa80c=function(_0x1658ac,_0x120fc4){_0x1658ac=_0x1658ac-0x0;var _0x41ea42=_0x80ca[_0x1658ac];return _0x41ea42;};'use strict';var schema=require(_0xa80c('0x0'));var sh=require(_0xa80c('0x1'));var _=require(_0xa80c('0x2'));var utils=require('./utils');var logger=require(_0xa80c('0x3'))(_0xa80c('0x4'));var system=schema({'command':{'type':_0xa80c('0x5'),'required':!![],'message':_0xa80c('0x6')}});exports[_0xa80c('0x7')]=function(_0xb00546,_0x12499b){return function(_0x48a424){try{var _0x344600={'command':_0x12499b[0x0]};var _0x1360d1=system[_0xa80c('0x0')](_0x344600,{'typecast':!![]});if(_0x1360d1[_0xa80c('0x8')]){logger[_0xa80c('0x9')](_0xa80c('0xa'),_0xb00546,_['map'](_0x1360d1,'message')[_0xa80c('0xb')](',\x20'));logger[_0xa80c('0xc')](_0xa80c('0xd'),_0xb00546);_0x48a424[_0xa80c('0xe')]();}else{var _0x249642=this;var _0x417c7e=utils[_0xa80c('0xf')](_0x12499b[0x0],this);logger[_0xa80c('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0xb00546,_0x417c7e);sh[_0xa80c('0x10')](_['trim'](_0x417c7e),function(_0x1c7378,_0x428b4a){logger[_0xa80c('0xc')](_0xa80c('0x11'),_0xb00546,_0x1c7378);if(_0x1c7378==0x0){var _0x4db2fc=_0x428b4a[_0xa80c('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xa80c('0x13')](_0x12499b[0x1])||_[_0xa80c('0x14')](_0x12499b[0x1])){logger[_0xa80c('0xc')](_0xa80c('0x15'),_0xb00546);_0x249642['body'][_0x12499b[0x1]]=_0x4db2fc;}else{logger[_0xa80c('0xc')](_0xa80c('0x16'),_0xb00546,_0x12499b[0x1],_0x4db2fc);_0x249642[_0xa80c('0x17')][_0x12499b[0x1]]=_0x4db2fc;}}_0x48a424['next']();});}}catch(_0x14e4e7){logger[_0xa80c('0x9')](_0xa80c('0xa'),_0xb00546,_[_0xa80c('0x18')](_0x14e4e7)?JSON[_0xa80c('0x19')](_0x14e4e7):_0x14e4e7);logger[_0xa80c('0xc')](_0xa80c('0xd'),_0xb00546);_0x48a424[_0xa80c('0xe')]();}};}; \ No newline at end of file +var _0x1377=['info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','join'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x1377,0x16b));var _0x7137=function(_0x3edaff,_0x13bd78){_0x3edaff=_0x3edaff-0x0;var _0x39dabb=_0x1377[_0x3edaff];return _0x39dabb;};'use strict';var schema=require(_0x7137('0x0'));var sh=require(_0x7137('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0x7137('0x2'))(_0x7137('0x3'));var system=schema({'command':{'type':_0x7137('0x4'),'required':!![],'message':_0x7137('0x5')}});exports[_0x7137('0x6')]=function(_0x33d19d,_0x59b04b){return function(_0x523916){try{var _0x194943={'command':_0x59b04b[0x0]};var _0x56e903=system[_0x7137('0x0')](_0x194943,{'typecast':!![]});if(_0x56e903[_0x7137('0x7')]){logger[_0x7137('0x8')](_0x7137('0x9'),_0x33d19d,_[_0x7137('0xa')](_0x56e903,'message')[_0x7137('0xb')](',\x20'));logger[_0x7137('0xc')](_0x7137('0xd'),_0x33d19d);_0x523916[_0x7137('0xe')]();}else{var _0x2ae908=this;var _0x403a99=utils[_0x7137('0xf')](_0x59b04b[0x0],this);logger[_0x7137('0xc')](_0x7137('0x10'),_0x33d19d,_0x403a99);sh['exec'](_[_0x7137('0x11')](_0x403a99),function(_0x47294f,_0x528aed){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x33d19d,_0x47294f);if(_0x47294f==0x0){var _0x58b1f3=_0x528aed[_0x7137('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x7137('0x13')](_0x59b04b[0x1])||_[_0x7137('0x14')](_0x59b04b[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x33d19d);_0x2ae908[_0x7137('0x15')][_0x59b04b[0x1]]=_0x58b1f3;}else{logger[_0x7137('0xc')](_0x7137('0x16'),_0x33d19d,_0x59b04b[0x1],_0x58b1f3);_0x2ae908['body'][_0x59b04b[0x1]]=_0x58b1f3;}}_0x523916[_0x7137('0xe')]();});}}catch(_0xa30ec1){logger[_0x7137('0x8')](_0x7137('0x9'),_0x33d19d,_[_0x7137('0x17')](_0xa30ec1)?JSON[_0x7137('0x18')](_0xa30ec1):_0xa30ec1);logger[_0x7137('0xc')](_0x7137('0xd'),_0x33d19d);_0x523916['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 080a0dd..874ab8a 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x486f0b,_0x19a9b7){var _0x12ccaf=function(_0x4ba198){while(--_0x4ba198){_0x486f0b['push'](_0x486f0b['shift']());}};_0x12ccaf(++_0x19a9b7);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ No newline at end of file +var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x4a9d9f,_0x237cfc){var _0x5abc03=function(_0x1f585b){while(--_0x1f585b){_0x4a9d9f['push'](_0x4a9d9f['shift']());}};_0x5abc03(++_0x237cfc);}(_0x7a54,0x106));var _0x47a5=function(_0x50a7bb,_0x30924f){_0x50a7bb=_0x50a7bb-0x0;var _0x40e4a7=_0x7a54[_0x50a7bb];return _0x40e4a7;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index ea1efe5..870e606 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba33=['lodash','exports','render','merge','body','contact','message','account','interaction','list','mustache'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xba33,0xf1));var _0x3ba3=function(_0x42605d,_0x369620){_0x42605d=_0x42605d-0x0;var _0x4bc740=_0xba33[_0x42605d];return _0x4bc740;};'use strict';var Mustache=require(_0x3ba3('0x0'));var _=require(_0x3ba3('0x1'));module[_0x3ba3('0x2')]={'getMustacheRender':function(_0x45f974,_0x4a52a9){return Mustache[_0x3ba3('0x3')](_0x45f974,_[_0x3ba3('0x4')](_0x4a52a9[_0x3ba3('0x5')],{'contact':_0x4a52a9[_0x3ba3('0x6')],'message':_0x4a52a9[_0x3ba3('0x7')],'account':_0x4a52a9[_0x3ba3('0x8')],'interaction':_0x4a52a9[_0x3ba3('0x9')],'list':_0x4a52a9[_0x3ba3('0xa')]}))||'';}}; \ No newline at end of file +var _0x4d46=['render','body','contact','message','account','interaction','list','mustache','lodash','exports'];(function(_0x13f108,_0x4100b5){var _0x2e0ff7=function(_0x5d39f9){while(--_0x5d39f9){_0x13f108['push'](_0x13f108['shift']());}};_0x2e0ff7(++_0x4100b5);}(_0x4d46,0x197));var _0x64d4=function(_0x4bf264,_0x3be730){_0x4bf264=_0x4bf264-0x0;var _0x3c855f=_0x4d46[_0x4bf264];return _0x3c855f;};'use strict';var Mustache=require(_0x64d4('0x0'));var _=require(_0x64d4('0x1'));module[_0x64d4('0x2')]={'getMustacheRender':function(_0x409ae5,_0x262015){return Mustache[_0x64d4('0x3')](_0x409ae5,_['merge'](_0x262015[_0x64d4('0x4')],{'contact':_0x262015[_0x64d4('0x5')],'message':_0x262015[_0x64d4('0x6')],'account':_0x262015[_0x64d4('0x7')],'interaction':_0x262015[_0x64d4('0x8')],'list':_0x262015[_0x64d4('0x9')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index e1547a1..60e745d 100644 --- a/server/services/routing/server/index.js +++ b/server/services/routing/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf69=['updateRealtime','agent\x20not\x20found','chatQueues','available','waiting','mailQueues','paused','openchannelQueues','loggedIn','name','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','values','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','join','.js','app','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','amazonlex','tag','TagId','format','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','end','stack','routing\x20is\x20empty','QueueReport','update','UserId','catch','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity'];(function(_0x39e5a8,_0x367273){var _0x5c9feb=function(_0x5a372e){while(--_0x5a372e){_0x39e5a8['push'](_0x39e5a8['shift']());}};_0x5c9feb(++_0x367273);}(_0xcf69,0x1c7));var _0x9cf6=function(_0x59bbaf,_0x4aa349){_0x59bbaf=_0x59bbaf-0x0;var _0xb95fe=_0xcf69[_0x59bbaf];return _0xb95fe;};'use strict';var _=require(_0x9cf6('0x0'));var util=require(_0x9cf6('0x1'));var path=require(_0x9cf6('0x2'));var fs=require('fs');var jayson=require(_0x9cf6('0x3'));var BPromise=require(_0x9cf6('0x4'));var uuid=require('uuid');var config=require(_0x9cf6('0x5'));var logger=require(_0x9cf6('0x6'))(_0x9cf6('0x7'));var rpc={'openchannelQueueReport':require(_0x9cf6('0x8'))};var rpc={'openchannelQueueReport':require(_0x9cf6('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x9cf6('0x9')),'faxQueueReport':require(_0x9cf6('0xa'))};var RuleEngine=require(_0x9cf6('0xb'));function getId(_0x4266fe,_0x207179,_0x2396e8){return util['format']('%s.%s.%s',_0x4266fe,_0x207179||0x0,_0x2396e8||0x0);}function getIntervals(_0x569030,_0x134b80){var _0x4a7c13=[];if(!_[_0x9cf6('0xc')](_0x134b80[_0x9cf6('0xd')])&&!_[_0x9cf6('0xc')](_0x569030[_0x134b80[_0x9cf6('0xd')]])&&!_[_0x9cf6('0xc')](_0x569030[_0x134b80['IntervalId']][_0x9cf6('0xe')])){_0x4a7c13=_[_0x9cf6('0xf')](_0x569030[_0x134b80[_0x9cf6('0xd')]][_0x9cf6('0xe')],_0x9cf6('0x10'));}else if(!_[_0x9cf6('0xc')](_0x134b80['interval'])){_0x4a7c13=[_0x134b80[_0x9cf6('0x10')]];}return _0x4a7c13;}exports[_0x9cf6('0x11')]=function(_0x5e6e0e){_0x5e6e0e[_0x9cf6('0x12')]={};return new BPromise(function(_0x2d6f43,_0xb13280){var _0x5c0342={'Start':function(_0x444e0f){var _0x3a85ba=this;return new Promise(function(_0x32a16e,_0x291798){if(_0x444e0f){try{var _0xed76f9=[];var _0x456e7c=getId(_0x444e0f[_0x9cf6('0x13')],_0x444e0f[_0x9cf6('0x14')]?_0x444e0f['message']['id']:0x0,_0x444e0f['interaction']?_0x444e0f[_0x9cf6('0x15')]['id']:0x0);if(_0x444e0f[_0x9cf6('0x16')]&&_[_0x9cf6('0x17')](_0x444e0f[_0x9cf6('0x16')])&&_0x444e0f[_0x9cf6('0x16')][_0x9cf6('0x18')]){for(var _0x1d007e=0x0;_0x1d007e<_0x444e0f[_0x9cf6('0x16')]['length'];_0x1d007e+=0x1){var _0x1e98e0=_0x444e0f['applications'][_0x1d007e];if(fs['existsSync'](path[_0x9cf6('0x19')](__dirname,_0x9cf6('0x16'),_0x1e98e0['app']+_0x9cf6('0x1a')))){var _0x1ac864=[];switch(_0x1e98e0[_0x9cf6('0x1b')][_0x9cf6('0x1c')]()){case _0x9cf6('0x1d'):var _0x20e170=_0x1e98e0[_0x9cf6('0x1e')][_0x9cf6('0x1f')](',');_0x1ac864['push'](_0x20e170[0x0]);_0x1ac864[_0x9cf6('0x20')](_0x20e170[_0x9cf6('0x21')](0x1,_0x20e170[_0x9cf6('0x18')])[_0x9cf6('0x19')](','));break;case _0x9cf6('0x22'):var _0x20e170=_0x1e98e0[_0x9cf6('0x1e')][_0x9cf6('0x1f')](',');_0x1ac864[_0x9cf6('0x20')](_0x20e170[0x0]);_0x1ac864['push'](_0x20e170[0x1]);_0x1ac864[_0x9cf6('0x20')](_0x20e170[_0x9cf6('0x21')](0x2,_0x20e170[_0x9cf6('0x18')])['join'](','));break;case _0x9cf6('0x23'):var _0x20e170=_0x1e98e0['appdata'][_0x9cf6('0x1f')](',');_0x1ac864['push'](_0x20e170[0x0]);_0x1ac864[_0x9cf6('0x20')](_0x20e170[0x1]);_0x1ac864[_0x9cf6('0x20')](_0x20e170[0x2]);_0x1ac864[_0x9cf6('0x20')](_0x20e170[0x3]);_0x1ac864[_0x9cf6('0x20')](_0x20e170['slice'](0x4,_0x20e170[_0x9cf6('0x18')])[_0x9cf6('0x19')](','));break;case _0x9cf6('0x14'):_0x1ac864[_0x9cf6('0x20')](_0x1e98e0[_0x9cf6('0x1e')]);break;case _0x9cf6('0x24'):_0x1ac864[_0x9cf6('0x20')](_0x1e98e0[_0x9cf6('0x25')]);_0x1ac864['push'](_0x1e98e0[_0x9cf6('0x1e')]);break;default:_0x1ac864=_[_0x9cf6('0xc')](_0x1e98e0['appdata'])?[]:_0x1e98e0[_0x9cf6('0x1e')][_0x9cf6('0x1f')](',');}var _0x3c4e9a={'id':util[_0x9cf6('0x26')]('%s:%s:%s',_0x456e7c,_0x1e98e0['id'],_0x1e98e0[_0x9cf6('0x1b')]),'condition':require('./interval')[_0x9cf6('0x27')](_0x456e7c,getIntervals(_0x5e6e0e[_0x9cf6('0x28')],_0x1e98e0),_0x5e6e0e),'consequence':require(_0x9cf6('0x29')+_0x1e98e0[_0x9cf6('0x1b')])[_0x9cf6('0x2a')](_0x456e7c,_0x1ac864,_0x5e6e0e,_0x444e0f),'p':_0x1e98e0[_0x9cf6('0x2b')]||0x0};logger[_0x9cf6('0x2c')](_0x9cf6('0x2d'),_0x3c4e9a['id'],'on\x20interval',getIntervals(_0x5e6e0e[_0x9cf6('0x28')],_0x1e98e0)[_0x9cf6('0x19')]('\x20|\x20'));_0xed76f9[_0x9cf6('0x20')](_0x3c4e9a);}else{logger[_0x9cf6('0x2e')](_0x9cf6('0x2f'),path[_0x9cf6('0x19')](__dirname,_0x9cf6('0x16'),_0x1e98e0[_0x9cf6('0x1b')]+'.js'));}}_0x5e6e0e['rules'][_0x456e7c]=new RuleEngine(_0xed76f9);_0x5e6e0e[_0x9cf6('0x12')][_0x456e7c][_0x9cf6('0x30')](_0x444e0f,function(_0x5cbc5d){logger['info'](_0x9cf6('0x31'),JSON[_0x9cf6('0x32')](_0x5cbc5d[_0x9cf6('0x33')]));if(_0x5e6e0e[_0x9cf6('0x12')][_0x456e7c]){_0x5e6e0e[_0x9cf6('0x12')][_0x456e7c]['emit'](_0x9cf6('0x34'));}});return _0x32a16e({'code':0xc8,'message':_0x444e0f});}else{logger[_0x9cf6('0x2c')]('No\x20applications\x20to\x20execute');return _0x32a16e({'code':0xc8,'message':_0x444e0f});}}catch(_0x5911b3){logger['error'](_0x5911b3[_0x9cf6('0x35')]);return _0x291798(_0x3a85ba[_0x9cf6('0x2e')](0x1f4,_0x5911b3));}}return _0x291798(_0x9cf6('0x36'));});},'AcceptMessage':function(_0x3fdacc){var _0x226e07=this;return new Promise(function(_0x5dee6d,_0x11ab59){if(_0x3fdacc[_0x9cf6('0x14')]&&_0x3fdacc[_0x9cf6('0x14')]['id']){try{var _0x146625=getId(_0x3fdacc[_0x9cf6('0x13')],_0x3fdacc[_0x9cf6('0x14')]?_0x3fdacc[_0x9cf6('0x14')]['id']:0x0,_0x3fdacc[_0x9cf6('0x15')]?_0x3fdacc[_0x9cf6('0x15')]['id']:0x0);if(_0x5e6e0e[_0x9cf6('0x12')][_0x146625]){_0x5e6e0e[_0x9cf6('0x12')][_0x146625]['emit'](_0x9cf6('0x34'));if(rpc[_0x3fdacc[_0x9cf6('0x13')]+_0x9cf6('0x37')]){rpc[_0x3fdacc[_0x9cf6('0x13')]+_0x9cf6('0x37')][_0x9cf6('0x38')](_0x146625,{'UserId':_0x3fdacc['message'][_0x9cf6('0x39')]})[_0x9cf6('0x3a')](function(_0x4a5ebb){logger[_0x9cf6('0x2e')]('error\x20update\x20queue\x20report');});}}return _0x5dee6d({'code':0xc8,'message':_0x3fdacc});}catch(_0x3f1810){logger['error'](_0x3f1810[_0x9cf6('0x35')]);return _0x11ab59(_0x226e07[_0x9cf6('0x2e')](0x1f4,_0x3f1810));}}logger[_0x9cf6('0x2e')](_0x9cf6('0x3b'));return _0x11ab59(_0x226e07[_0x9cf6('0x2e')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x5b9e8b){var _0x5817f6=this;return new Promise(function(_0x399f91,_0x23ca75){if(_0x5b9e8b[_0x9cf6('0x3c')]&&_0x5b9e8b[_0x9cf6('0x3c')]['id']){try{if(_0x5e6e0e[_0x9cf6('0x3d')][_0x5b9e8b[_0x9cf6('0x3c')]['id']]){_0x5e6e0e[_0x9cf6('0x3d')][_0x5b9e8b[_0x9cf6('0x3c')]['id']][_0x9cf6('0x3e')]=![];_0x5e6e0e[_0x9cf6('0x3d')][_0x5b9e8b[_0x9cf6('0x3c')]['id']][_0x9cf6('0x3f')]=undefined;}return _0x399f91({'code':0xc8,'message':_0x5b9e8b});}catch(_0x306ee9){logger[_0x9cf6('0x2e')](_0x306ee9[_0x9cf6('0x35')]);return _0x23ca75(_0x5817f6['error'](0x1f4,_0x306ee9));}}logger[_0x9cf6('0x2e')]('message\x20is\x20empty');return _0x23ca75(_0x5817f6['error'](0x1f4,_0x9cf6('0x3b')));});},'AbandonInteraction':function(_0x2bc502){var _0x412ced=this;return new Promise(function(_0x3a0ff9,_0x3c75c9){if(_0x2bc502[_0x9cf6('0x13')]&&_0x2bc502[_0x9cf6('0x15')]&&_0x2bc502[_0x9cf6('0x15')]['id']){try{var _0x3c2fac=getId(_0x2bc502[_0x9cf6('0x13')],_0x2bc502[_0x9cf6('0x14')]?_0x2bc502['message']['id']:0x0,_0x2bc502[_0x9cf6('0x15')]?_0x2bc502['interaction']['id']:0x0);if(_0x5e6e0e[_0x9cf6('0x12')][_0x3c2fac]){_0x5e6e0e[_0x9cf6('0x12')][_0x3c2fac]['emit']('end');}return _0x3a0ff9({'code':0xc8,'message':_0x2bc502});}catch(_0x105bf6){logger[_0x9cf6('0x2e')](_0x105bf6[_0x9cf6('0x35')]);return _0x3c75c9(_0x412ced['error'](0x1f4,_0x105bf6));}}logger[_0x9cf6('0x2e')](_0x9cf6('0x3b'));return _0x3c75c9(_0x412ced[_0x9cf6('0x2e')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x3e4699){var _0x508eb0=this;return new Promise(function(_0x1e4cd3,_0x2f78e9){if(_0x5e6e0e[_0x9cf6('0x3d')][_0x9cf6('0x40')](_0x3e4699['id'])){for(var _0x142773 in _0x3e4699[_0x9cf6('0x41')]){if(_0x3e4699[_0x9cf6('0x41')][_0x9cf6('0x40')](_0x142773)){if(_0x5e6e0e['agents'][_0x3e4699['id']][_0x9cf6('0x40')](_0x142773+_0x9cf6('0x42'))){_0x5e6e0e[_0x9cf6('0x3d')][_0x3e4699['id']][_0x142773+_0x9cf6('0x42')]=parseInt(_0x3e4699[_0x9cf6('0x41')][_0x142773],0xa);}}}_0x5e6e0e[_0x9cf6('0x3d')][_0x3e4699['id']][_0x9cf6('0x43')]();return _0x1e4cd3({'code':0xc8,'message':_0x5e6e0e['agents'][_0x3e4699['id']]});}else{return _0x2f78e9(_0x508eb0[_0x9cf6('0x2e')](0x1f4,_0x9cf6('0x44')));}});},'Agents':function(_0x59bca6){return new Promise(function(_0x252862,_0x24f42d){var _0x848cca=_['values'](_0x5e6e0e[_0x9cf6('0x3d')]);_0x252862({'count':_0x848cca[_0x9cf6('0x18')],'rows':_0x848cca});});},'ChatQueues':function(_0x5308ee){return new Promise(function(_0x245177,_0x1071d5){var _0x524370=[];for(var _0x22d5e5 in _0x5e6e0e[_0x9cf6('0x45')]){if(_0x5e6e0e[_0x9cf6('0x45')]['hasOwnProperty'](_0x22d5e5)){var _0x34ce70=_0x5e6e0e['chatQueues'][_0x22d5e5];var _0x2705c0={'id':_0x34ce70['id'],'available':_0x34ce70[_0x9cf6('0x46')],'loggedIn':_0x34ce70['loggedIn'],'name':_0x34ce70['name'],'paused':_0x34ce70['paused'],'waiting':_0x34ce70[_0x9cf6('0x47')]};_0x524370['push'](_0x2705c0);}}_0x245177({'count':_0x524370[_0x9cf6('0x18')],'rows':_0x524370});});},'MailQueues':function(_0x51a1fa){return new Promise(function(_0x3b4802,_0x1f3ead){var _0x1e1a23=[];for(var _0x4c9077 in _0x5e6e0e[_0x9cf6('0x48')]){if(_0x5e6e0e[_0x9cf6('0x48')][_0x9cf6('0x40')](_0x4c9077)){var _0x1a1d89=_0x5e6e0e['mailQueues'][_0x4c9077];var _0x34ffb5={'id':_0x1a1d89['id'],'available':_0x1a1d89[_0x9cf6('0x46')],'loggedIn':_0x1a1d89['loggedIn'],'name':_0x1a1d89['name'],'paused':_0x1a1d89[_0x9cf6('0x49')],'waiting':_0x1a1d89[_0x9cf6('0x47')]};_0x1e1a23['push'](_0x34ffb5);}}_0x3b4802({'count':_0x1e1a23[_0x9cf6('0x18')],'rows':_0x1e1a23});});},'OpenchannelQueues':function(_0x4ca68d){return new Promise(function(_0x27a722,_0x7f968e){var _0x5bfbe7=[];for(var _0x3e9ba4 in _0x5e6e0e[_0x9cf6('0x4a')]){if(_0x5e6e0e['openchannelQueues'][_0x9cf6('0x40')](_0x3e9ba4)){var _0x216760=_0x5e6e0e[_0x9cf6('0x4a')][_0x3e9ba4];var _0x379732={'id':_0x216760['id'],'available':_0x216760[_0x9cf6('0x46')],'loggedIn':_0x216760[_0x9cf6('0x4b')],'name':_0x216760[_0x9cf6('0x4c')],'paused':_0x216760[_0x9cf6('0x49')],'waiting':_0x216760[_0x9cf6('0x47')]};_0x5bfbe7[_0x9cf6('0x20')](_0x379732);}}_0x27a722({'count':_0x5bfbe7['length'],'rows':_0x5bfbe7});});},'SmsQueues':function(_0x40e532){return new Promise(function(_0x5f0c3e,_0xb18fab){var _0x4de72d=[];for(var _0x3c7978 in _0x5e6e0e[_0x9cf6('0x4d')]){if(_0x5e6e0e[_0x9cf6('0x4d')]['hasOwnProperty'](_0x3c7978)){var _0x43fb0f=_0x5e6e0e[_0x9cf6('0x4d')][_0x3c7978];var _0x5f4309={'id':_0x43fb0f['id'],'available':_0x43fb0f[_0x9cf6('0x46')],'loggedIn':_0x43fb0f['loggedIn'],'name':_0x43fb0f['name'],'paused':_0x43fb0f[_0x9cf6('0x49')],'waiting':_0x43fb0f[_0x9cf6('0x47')]};_0x4de72d[_0x9cf6('0x20')](_0x5f4309);}}_0x5f0c3e({'count':_0x4de72d['length'],'rows':_0x4de72d});});},'FaxQueues':function(_0x1a01ac){return new Promise(function(_0x349e4f,_0x473207){var _0x37f669=[];for(var _0x55db98 in _0x5e6e0e[_0x9cf6('0x4e')]){if(_0x5e6e0e[_0x9cf6('0x4e')][_0x9cf6('0x40')](_0x55db98)){var _0x53d022=_0x5e6e0e['faxQueues'][_0x55db98];var _0x4d7df3={'id':_0x53d022['id'],'available':_0x53d022['available'],'loggedIn':_0x53d022[_0x9cf6('0x4b')],'name':_0x53d022[_0x9cf6('0x4c')],'paused':_0x53d022[_0x9cf6('0x49')],'waiting':_0x53d022['waiting']};_0x37f669[_0x9cf6('0x20')](_0x4d7df3);}}_0x349e4f({'count':_0x37f669[_0x9cf6('0x18')],'rows':_0x37f669});});},'ChatQueuesWaitingInteractions':function(_0x979cdc){return new Promise(function(_0x176712,_0x49d91b){var _0x1ad0bc=_['values'](_0x5e6e0e[_0x9cf6('0x4f')]);_0x176712({'count':_0x1ad0bc['length'],'rows':_0x1ad0bc});});},'MailQueuesWaitingInteractions':function(_0x2552da){return new Promise(function(_0x48ad4b,_0x5610b2){var _0x3938bc=_['values'](_0x5e6e0e[_0x9cf6('0x50')]);_0x48ad4b({'count':_0x3938bc[_0x9cf6('0x18')],'rows':_0x3938bc});});},'OpenchannelQueuesWaitingInteractions':function(_0x405369){return new Promise(function(_0x1542e5,_0x5958fb){var _0x239613=_[_0x9cf6('0x51')](_0x5e6e0e[_0x9cf6('0x52')]);_0x1542e5({'count':_0x239613['length'],'rows':_0x239613});});},'SmsQueuesWaitingInteractions':function(_0x435000){return new Promise(function(_0x4799e5,_0x570142){var _0x40123d=_[_0x9cf6('0x51')](_0x5e6e0e[_0x9cf6('0x53')]);_0x4799e5({'count':_0x40123d[_0x9cf6('0x18')],'rows':_0x40123d});});},'FaxQueuesWaitingInteractions':function(_0x46de26){return new Promise(function(_0xcd493e,_0x554125){var _0x26c0f3=_[_0x9cf6('0x51')](_0x5e6e0e['faxQueuesWaitingInteractions']);_0xcd493e({'count':_0x26c0f3['length'],'rows':_0x26c0f3});});}};var _0x49b956=jayson[_0x9cf6('0x54')](_0x5c0342)['http']();_0x49b956['on']('error',function(_0xff69df){logger['error'](JSON[_0x9cf6('0x32')](_0xff69df));return _0xb13280(_0xff69df);});_0x49b956[_0x9cf6('0x11')](0x232c,_0x9cf6('0x55'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2d6f43(_0x9cf6('0x56')+0x232c);});});}; \ No newline at end of file +var _0x27cc=['agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','openchannelQueues','paused','smsQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','channel','message','interaction','applications','length','existsSync','app','.js','toLowerCase','autoreply','appdata','split','push','join','dialogflow','slice','amazonlex','tag','TagId','%s:%s:%s','./interval','condition','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','stringify','matchPath','emit','end','No\x20applications\x20to\x20execute','error','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','agent'];(function(_0xac6253,_0xd603b0){var _0x138f77=function(_0x4ebb5a){while(--_0x4ebb5a){_0xac6253['push'](_0xac6253['shift']());}};_0x138f77(++_0xd603b0);}(_0x27cc,0x139));var _0xc27c=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x27cc[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0xc27c('0x0'));var util=require(_0xc27c('0x1'));var path=require(_0xc27c('0x2'));var fs=require('fs');var jayson=require(_0xc27c('0x3'));var BPromise=require(_0xc27c('0x4'));var uuid=require(_0xc27c('0x5'));var config=require('../../../config/environment');var logger=require(_0xc27c('0x6'))(_0xc27c('0x7'));var rpc={'openchannelQueueReport':require(_0xc27c('0x8'))};var rpc={'openchannelQueueReport':require(_0xc27c('0x8')),'mailQueueReport':require(_0xc27c('0x9')),'chatQueueReport':require(_0xc27c('0xa')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xc27c('0xb'))};var RuleEngine=require(_0xc27c('0xc'));function getId(_0xed39f3,_0x2889c2,_0x59a945){return util[_0xc27c('0xd')](_0xc27c('0xe'),_0xed39f3,_0x2889c2||0x0,_0x59a945||0x0);}function getIntervals(_0x5affd2,_0x16fc8b){var _0x919991=[];if(!_['isNil'](_0x16fc8b[_0xc27c('0xf')])&&!_[_0xc27c('0x10')](_0x5affd2[_0x16fc8b[_0xc27c('0xf')]])&&!_[_0xc27c('0x10')](_0x5affd2[_0x16fc8b[_0xc27c('0xf')]][_0xc27c('0x11')])){_0x919991=_[_0xc27c('0x12')](_0x5affd2[_0x16fc8b[_0xc27c('0xf')]][_0xc27c('0x11')],'interval');}else if(!_[_0xc27c('0x10')](_0x16fc8b[_0xc27c('0x13')])){_0x919991=[_0x16fc8b['interval']];}return _0x919991;}exports[_0xc27c('0x14')]=function(_0x478879){_0x478879['rules']={};return new BPromise(function(_0x5bb74b,_0x10f877){var _0x8a790a={'Start':function(_0x518608){var _0x38cd27=this;return new Promise(function(_0x184047,_0x3bc455){if(_0x518608){try{var _0x147f98=[];var _0x331814=getId(_0x518608[_0xc27c('0x15')],_0x518608[_0xc27c('0x16')]?_0x518608[_0xc27c('0x16')]['id']:0x0,_0x518608[_0xc27c('0x17')]?_0x518608[_0xc27c('0x17')]['id']:0x0);if(_0x518608[_0xc27c('0x18')]&&_['isArray'](_0x518608['applications'])&&_0x518608['applications'][_0xc27c('0x19')]){for(var _0x2d1672=0x0;_0x2d1672<_0x518608[_0xc27c('0x18')][_0xc27c('0x19')];_0x2d1672+=0x1){var _0x549629=_0x518608[_0xc27c('0x18')][_0x2d1672];if(fs[_0xc27c('0x1a')](path['join'](__dirname,_0xc27c('0x18'),_0x549629[_0xc27c('0x1b')]+_0xc27c('0x1c')))){var _0x300e8a=[];switch(_0x549629[_0xc27c('0x1b')][_0xc27c('0x1d')]()){case _0xc27c('0x1e'):var _0x15b335=_0x549629[_0xc27c('0x1f')][_0xc27c('0x20')](',');_0x300e8a['push'](_0x15b335[0x0]);_0x300e8a[_0xc27c('0x21')](_0x15b335['slice'](0x1,_0x15b335[_0xc27c('0x19')])[_0xc27c('0x22')](','));break;case _0xc27c('0x23'):var _0x15b335=_0x549629['appdata'][_0xc27c('0x20')](',');_0x300e8a[_0xc27c('0x21')](_0x15b335[0x0]);_0x300e8a['push'](_0x15b335[0x1]);_0x300e8a[_0xc27c('0x21')](_0x15b335[_0xc27c('0x24')](0x2,_0x15b335['length'])[_0xc27c('0x22')](','));break;case _0xc27c('0x25'):var _0x15b335=_0x549629[_0xc27c('0x1f')][_0xc27c('0x20')](',');_0x300e8a[_0xc27c('0x21')](_0x15b335[0x0]);_0x300e8a[_0xc27c('0x21')](_0x15b335[0x1]);_0x300e8a[_0xc27c('0x21')](_0x15b335[0x2]);_0x300e8a['push'](_0x15b335[0x3]);_0x300e8a[_0xc27c('0x21')](_0x15b335[_0xc27c('0x24')](0x4,_0x15b335[_0xc27c('0x19')])[_0xc27c('0x22')](','));break;case _0xc27c('0x16'):_0x300e8a['push'](_0x549629[_0xc27c('0x1f')]);break;case _0xc27c('0x26'):_0x300e8a['push'](_0x549629[_0xc27c('0x27')]);_0x300e8a[_0xc27c('0x21')](_0x549629[_0xc27c('0x1f')]);break;default:_0x300e8a=_[_0xc27c('0x10')](_0x549629['appdata'])?[]:_0x549629[_0xc27c('0x1f')][_0xc27c('0x20')](',');}var _0x4fdbc1={'id':util[_0xc27c('0xd')](_0xc27c('0x28'),_0x331814,_0x549629['id'],_0x549629[_0xc27c('0x1b')]),'condition':require(_0xc27c('0x29'))[_0xc27c('0x2a')](_0x331814,getIntervals(_0x478879['intervals'],_0x549629),_0x478879),'consequence':require('./applications/'+_0x549629[_0xc27c('0x1b')])[_0xc27c('0x2b')](_0x331814,_0x300e8a,_0x478879,_0x518608),'p':_0x549629[_0xc27c('0x2c')]||0x0};logger[_0xc27c('0x2d')](_0xc27c('0x2e'),_0x4fdbc1['id'],_0xc27c('0x2f'),getIntervals(_0x478879[_0xc27c('0x30')],_0x549629)['join'](_0xc27c('0x31')));_0x147f98[_0xc27c('0x21')](_0x4fdbc1);}else{logger['error'](_0xc27c('0x32'),path[_0xc27c('0x22')](__dirname,_0xc27c('0x18'),_0x549629[_0xc27c('0x1b')]+_0xc27c('0x1c')));}}_0x478879['rules'][_0x331814]=new RuleEngine(_0x147f98);_0x478879[_0xc27c('0x33')][_0x331814][_0xc27c('0x34')](_0x518608,function(_0x42d838){logger[_0xc27c('0x2d')]('Applications\x20executed',JSON[_0xc27c('0x35')](_0x42d838[_0xc27c('0x36')]));if(_0x478879[_0xc27c('0x33')][_0x331814]){_0x478879['rules'][_0x331814][_0xc27c('0x37')](_0xc27c('0x38'));}});return _0x184047({'code':0xc8,'message':_0x518608});}else{logger[_0xc27c('0x2d')](_0xc27c('0x39'));return _0x184047({'code':0xc8,'message':_0x518608});}}catch(_0x9d475a){logger['error'](_0x9d475a['stack']);return _0x3bc455(_0x38cd27[_0xc27c('0x3a')](0x1f4,_0x9d475a));}}return _0x3bc455('routing\x20is\x20empty');});},'AcceptMessage':function(_0x52994d){var _0x4bfcef=this;return new Promise(function(_0x7d28b,_0x1ae44c){if(_0x52994d[_0xc27c('0x16')]&&_0x52994d[_0xc27c('0x16')]['id']){try{var _0x4ac496=getId(_0x52994d[_0xc27c('0x15')],_0x52994d[_0xc27c('0x16')]?_0x52994d['message']['id']:0x0,_0x52994d[_0xc27c('0x17')]?_0x52994d[_0xc27c('0x17')]['id']:0x0);if(_0x478879[_0xc27c('0x33')][_0x4ac496]){_0x478879[_0xc27c('0x33')][_0x4ac496][_0xc27c('0x37')]('end');if(rpc[_0x52994d['channel']+'QueueReport']){rpc[_0x52994d['channel']+_0xc27c('0x3b')][_0xc27c('0x3c')](_0x4ac496,{'UserId':_0x52994d[_0xc27c('0x16')][_0xc27c('0x3d')]})[_0xc27c('0x3e')](function(_0x30d1c7){logger[_0xc27c('0x3a')](_0xc27c('0x3f'));});}}return _0x7d28b({'code':0xc8,'message':_0x52994d});}catch(_0xfaa00){logger['error'](_0xfaa00[_0xc27c('0x40')]);return _0x1ae44c(_0x4bfcef[_0xc27c('0x3a')](0x1f4,_0xfaa00));}}logger[_0xc27c('0x3a')](_0xc27c('0x41'));return _0x1ae44c(_0x4bfcef[_0xc27c('0x3a')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x58d057){var _0xbde69f=this;return new Promise(function(_0x5c754f,_0x39f677){if(_0x58d057[_0xc27c('0x42')]&&_0x58d057[_0xc27c('0x42')]['id']){try{if(_0x478879[_0xc27c('0x43')][_0x58d057[_0xc27c('0x42')]['id']]){_0x478879[_0xc27c('0x43')][_0x58d057[_0xc27c('0x42')]['id']][_0xc27c('0x44')]=![];_0x478879[_0xc27c('0x43')][_0x58d057[_0xc27c('0x42')]['id']][_0xc27c('0x45')]=undefined;}return _0x5c754f({'code':0xc8,'message':_0x58d057});}catch(_0x15cd69){logger[_0xc27c('0x3a')](_0x15cd69[_0xc27c('0x40')]);return _0x39f677(_0xbde69f[_0xc27c('0x3a')](0x1f4,_0x15cd69));}}logger['error'](_0xc27c('0x41'));return _0x39f677(_0xbde69f[_0xc27c('0x3a')](0x1f4,_0xc27c('0x41')));});},'AbandonInteraction':function(_0x19a651){var _0x51541d=this;return new Promise(function(_0x2be5be,_0x203b4f){if(_0x19a651['channel']&&_0x19a651[_0xc27c('0x17')]&&_0x19a651[_0xc27c('0x17')]['id']){try{var _0x5ec2d1=getId(_0x19a651[_0xc27c('0x15')],_0x19a651[_0xc27c('0x16')]?_0x19a651[_0xc27c('0x16')]['id']:0x0,_0x19a651[_0xc27c('0x17')]?_0x19a651[_0xc27c('0x17')]['id']:0x0);if(_0x478879[_0xc27c('0x33')][_0x5ec2d1]){_0x478879['rules'][_0x5ec2d1][_0xc27c('0x37')](_0xc27c('0x38'));}return _0x2be5be({'code':0xc8,'message':_0x19a651});}catch(_0x459b0e){logger[_0xc27c('0x3a')](_0x459b0e[_0xc27c('0x40')]);return _0x203b4f(_0x51541d[_0xc27c('0x3a')](0x1f4,_0x459b0e));}}logger[_0xc27c('0x3a')]('message\x20is\x20empty');return _0x203b4f(_0x51541d[_0xc27c('0x3a')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x244692){var _0x54a485=this;return new Promise(function(_0x32f68b,_0x1f2697){if(_0x478879[_0xc27c('0x43')][_0xc27c('0x46')](_0x244692['id'])){for(var _0x4bda2d in _0x244692['capacity']){if(_0x244692[_0xc27c('0x47')][_0xc27c('0x46')](_0x4bda2d)){if(_0x478879[_0xc27c('0x43')][_0x244692['id']][_0xc27c('0x46')](_0x4bda2d+_0xc27c('0x48'))){_0x478879[_0xc27c('0x43')][_0x244692['id']][_0x4bda2d+_0xc27c('0x48')]=parseInt(_0x244692[_0xc27c('0x47')][_0x4bda2d],0xa);}}}_0x478879[_0xc27c('0x43')][_0x244692['id']]['updateRealtime']();return _0x32f68b({'code':0xc8,'message':_0x478879[_0xc27c('0x43')][_0x244692['id']]});}else{return _0x1f2697(_0x54a485['error'](0x1f4,_0xc27c('0x49')));}});},'Agents':function(_0x5d8a8a){return new Promise(function(_0x37cc6c,_0x2af638){var _0x24c5a2=_[_0xc27c('0x4a')](_0x478879[_0xc27c('0x43')]);_0x37cc6c({'count':_0x24c5a2['length'],'rows':_0x24c5a2});});},'ChatQueues':function(_0x568286){return new Promise(function(_0x42a363,_0x309347){var _0x26f854=[];for(var _0x1936c8 in _0x478879[_0xc27c('0x4b')]){if(_0x478879[_0xc27c('0x4b')][_0xc27c('0x46')](_0x1936c8)){var _0x52f3ce=_0x478879[_0xc27c('0x4b')][_0x1936c8];var _0x54b02c={'id':_0x52f3ce['id'],'available':_0x52f3ce[_0xc27c('0x4c')],'loggedIn':_0x52f3ce[_0xc27c('0x4d')],'name':_0x52f3ce[_0xc27c('0x4e')],'paused':_0x52f3ce['paused'],'waiting':_0x52f3ce[_0xc27c('0x4f')]};_0x26f854[_0xc27c('0x21')](_0x54b02c);}}_0x42a363({'count':_0x26f854[_0xc27c('0x19')],'rows':_0x26f854});});},'MailQueues':function(_0x58d225){return new Promise(function(_0x5e1b62,_0x46d7d3){var _0x261260=[];for(var _0x1e0463 in _0x478879[_0xc27c('0x50')]){if(_0x478879[_0xc27c('0x50')][_0xc27c('0x46')](_0x1e0463)){var _0x2b8e3a=_0x478879[_0xc27c('0x50')][_0x1e0463];var _0x5d60f8={'id':_0x2b8e3a['id'],'available':_0x2b8e3a['available'],'loggedIn':_0x2b8e3a[_0xc27c('0x4d')],'name':_0x2b8e3a[_0xc27c('0x4e')],'paused':_0x2b8e3a['paused'],'waiting':_0x2b8e3a[_0xc27c('0x4f')]};_0x261260[_0xc27c('0x21')](_0x5d60f8);}}_0x5e1b62({'count':_0x261260['length'],'rows':_0x261260});});},'OpenchannelQueues':function(_0x40418b){return new Promise(function(_0x402077,_0x1a777e){var _0x500206=[];for(var _0x21799f in _0x478879['openchannelQueues']){if(_0x478879[_0xc27c('0x51')][_0xc27c('0x46')](_0x21799f)){var _0x573b09=_0x478879[_0xc27c('0x51')][_0x21799f];var _0x2a5009={'id':_0x573b09['id'],'available':_0x573b09[_0xc27c('0x4c')],'loggedIn':_0x573b09[_0xc27c('0x4d')],'name':_0x573b09[_0xc27c('0x4e')],'paused':_0x573b09[_0xc27c('0x52')],'waiting':_0x573b09[_0xc27c('0x4f')]};_0x500206[_0xc27c('0x21')](_0x2a5009);}}_0x402077({'count':_0x500206['length'],'rows':_0x500206});});},'SmsQueues':function(_0x54f976){return new Promise(function(_0x369c9b,_0x5e7019){var _0x2d2ee2=[];for(var _0x362cf8 in _0x478879[_0xc27c('0x53')]){if(_0x478879[_0xc27c('0x53')]['hasOwnProperty'](_0x362cf8)){var _0x3e21bc=_0x478879[_0xc27c('0x53')][_0x362cf8];var _0x3be4aa={'id':_0x3e21bc['id'],'available':_0x3e21bc[_0xc27c('0x4c')],'loggedIn':_0x3e21bc[_0xc27c('0x4d')],'name':_0x3e21bc['name'],'paused':_0x3e21bc[_0xc27c('0x52')],'waiting':_0x3e21bc[_0xc27c('0x4f')]};_0x2d2ee2[_0xc27c('0x21')](_0x3be4aa);}}_0x369c9b({'count':_0x2d2ee2[_0xc27c('0x19')],'rows':_0x2d2ee2});});},'FaxQueues':function(_0x9c6c12){return new Promise(function(_0x1e0458,_0x3a793b){var _0x36a26c=[];for(var _0x42ac19 in _0x478879[_0xc27c('0x54')]){if(_0x478879[_0xc27c('0x54')][_0xc27c('0x46')](_0x42ac19)){var _0xe78208=_0x478879[_0xc27c('0x54')][_0x42ac19];var _0x2b9cb6={'id':_0xe78208['id'],'available':_0xe78208['available'],'loggedIn':_0xe78208['loggedIn'],'name':_0xe78208[_0xc27c('0x4e')],'paused':_0xe78208['paused'],'waiting':_0xe78208[_0xc27c('0x4f')]};_0x36a26c[_0xc27c('0x21')](_0x2b9cb6);}}_0x1e0458({'count':_0x36a26c[_0xc27c('0x19')],'rows':_0x36a26c});});},'ChatQueuesWaitingInteractions':function(_0x133c8d){return new Promise(function(_0x1623de,_0x3b1ee9){var _0x413502=_[_0xc27c('0x4a')](_0x478879['chatQueuesWaitingInteractions']);_0x1623de({'count':_0x413502[_0xc27c('0x19')],'rows':_0x413502});});},'MailQueuesWaitingInteractions':function(_0x2deeac){return new Promise(function(_0x493b26,_0x3a0130){var _0x3f22e7=_['values'](_0x478879[_0xc27c('0x55')]);_0x493b26({'count':_0x3f22e7['length'],'rows':_0x3f22e7});});},'OpenchannelQueuesWaitingInteractions':function(_0x206b6f){return new Promise(function(_0xe7ad47,_0x25d87c){var _0x19367e=_['values'](_0x478879[_0xc27c('0x56')]);_0xe7ad47({'count':_0x19367e[_0xc27c('0x19')],'rows':_0x19367e});});},'SmsQueuesWaitingInteractions':function(_0x3bc1f4){return new Promise(function(_0x25c00b,_0x27d1f9){var _0x3068ac=_['values'](_0x478879[_0xc27c('0x57')]);_0x25c00b({'count':_0x3068ac[_0xc27c('0x19')],'rows':_0x3068ac});});},'FaxQueuesWaitingInteractions':function(_0x478f3c){return new Promise(function(_0x580537,_0x44199c){var _0x23d8b3=_[_0xc27c('0x4a')](_0x478879[_0xc27c('0x58')]);_0x580537({'count':_0x23d8b3[_0xc27c('0x19')],'rows':_0x23d8b3});});}};var _0x337828=jayson[_0xc27c('0x59')](_0x8a790a)[_0xc27c('0x5a')]();_0x337828['on'](_0xc27c('0x3a'),function(_0x12f175){logger[_0xc27c('0x3a')](JSON[_0xc27c('0x35')](_0x12f175));return _0x10f877(_0x12f175);});_0x337828[_0xc27c('0x14')](0x232c,_0xc27c('0x5b'),function(){console[_0xc27c('0x5c')](_0xc27c('0x5d'),0x232c);return _0x5bb74b(_0xc27c('0x5e')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 54e9946..30b9846 100644 --- a/server/services/routing/server/interval.js +++ b/server/services/routing/server/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5035=['some','info','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','stack','util','bluebird','jayson/promise','../../../config/logger','routing','http','request','then','error','message','catch','condition','rules','stop','length','Command','format','iftime\x20%s','indexOf','true','all'];(function(_0x5345bb,_0x46b3e1){var _0x43f5d8=function(_0x1fed7e){while(--_0x1fed7e){_0x5345bb['push'](_0x5345bb['shift']());}};_0x43f5d8(++_0x46b3e1);}(_0x5035,0x1bb));var _0x5503=function(_0x14515b,_0x3226c0){_0x14515b=_0x14515b-0x0;var _0x1ae250=_0x5035[_0x14515b];return _0x1ae250;};'use strict';var util=require(_0x5503('0x0'));var BPromise=require(_0x5503('0x1'));var jayson=require(_0x5503('0x2'));var _=require('lodash');var logger=require(_0x5503('0x3'))(_0x5503('0x4'));var client=jayson['client'][_0x5503('0x5')]({'port':0x232a});function request(_0x16014b,_0x1a6260){return new BPromise(function(_0x22cc8c,_0x49f10e){return client[_0x5503('0x6')](_0x16014b,_0x1a6260)[_0x5503('0x7')](function(_0x550198){if(_0x550198[_0x5503('0x8')]){return _0x49f10e(_0x550198[_0x5503('0x8')][_0x5503('0x9')]);}else{return _0x22cc8c(_0x550198['result']);}})[_0x5503('0xa')](function(_0x3b80d6){return _0x49f10e(_0x3b80d6);});});}exports[_0x5503('0xb')]=function(_0x7f1487,_0x378eee,_0x392ae3){return function(_0x4e2858){if(_0x392ae3[_0x5503('0xc')]&&!_0x392ae3[_0x5503('0xc')][_0x7f1487]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x7f1487);return _0x4e2858[_0x5503('0xd')]();}var _0x1f7466=[];for(var _0x410439=0x0;_0x410439<_0x378eee[_0x5503('0xe')];_0x410439+=0x1){_0x1f7466['push'](request(_0x5503('0xf'),{'command':util[_0x5503('0x10')](_0x5503('0x11'),_0x378eee[_0x410439])})[_0x5503('0x7')](function(_0x290afc){return _0x290afc&&_0x290afc[_0x5503('0x9')]&&_0x290afc[_0x5503('0x9')][_0x5503('0x12')](_0x5503('0x13'))>=0x0?!![]:![];})['catch'](function(_0x16d54d){logger[_0x5503('0x8')]('[%s][INTERVAL]\x20%s',_0x7f1487,_0x378eee[_0x410439]);}));}BPromise[_0x5503('0x14')](_0x1f7466)[_0x5503('0x7')](function(_0x38e474){var _0x4facdf=_[_0x5503('0x15')](_0x38e474);logger[_0x5503('0x16')](_0x5503('0x17'),_0x7f1487,_0x378eee['join'](_0x5503('0x18')),_0x4facdf);_0x4e2858[_0x5503('0x19')](_0x4facdf);})[_0x5503('0xa')](function(_0x1f1a42){console[_0x5503('0x1a')](_0x1f1a42);logger[_0x5503('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x7f1487,_0x378eee[_0x5503('0x1b')](_0x5503('0x18')),_0x1f1a42[_0x5503('0x1c')]);_0x4e2858[_0x5503('0xd')]();});};}; \ No newline at end of file +var _0xb25c=['\x20|\x20','when','catch','log','stack','stop','util','bluebird','lodash','../../../config/logger','routing','client','request','then','error','result','rules','length','push','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join'];(function(_0x2f4ad4,_0x3c0271){var _0x7afb99=function(_0x5f26c6){while(--_0x5f26c6){_0x2f4ad4['push'](_0x2f4ad4['shift']());}};_0x7afb99(++_0x3c0271);}(_0xb25c,0x18e));var _0xcb25=function(_0x38b95d,_0x1efbe4){_0x38b95d=_0x38b95d-0x0;var _0xe692b6=_0xb25c[_0x38b95d];return _0xe692b6;};'use strict';var util=require(_0xcb25('0x0'));var BPromise=require(_0xcb25('0x1'));var jayson=require('jayson/promise');var _=require(_0xcb25('0x2'));var logger=require(_0xcb25('0x3'))(_0xcb25('0x4'));var client=jayson[_0xcb25('0x5')]['http']({'port':0x232a});function request(_0x4d40e4,_0x3bbea3){return new BPromise(function(_0x2388fd,_0xf99ae9){return client[_0xcb25('0x6')](_0x4d40e4,_0x3bbea3)[_0xcb25('0x7')](function(_0x1fb026){if(_0x1fb026[_0xcb25('0x8')]){return _0xf99ae9(_0x1fb026[_0xcb25('0x8')]['message']);}else{return _0x2388fd(_0x1fb026[_0xcb25('0x9')]);}})['catch'](function(_0x3a1166){return _0xf99ae9(_0x3a1166);});});}exports['condition']=function(_0x370321,_0x425ab3,_0x181afd){return function(_0xd0c4eb){if(_0x181afd[_0xcb25('0xa')]&&!_0x181afd['rules'][_0x370321]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x370321);return _0xd0c4eb['stop']();}var _0x33d17a=[];for(var _0x5b7a5f=0x0;_0x5b7a5f<_0x425ab3[_0xcb25('0xb')];_0x5b7a5f+=0x1){_0x33d17a[_0xcb25('0xc')](request('Command',{'command':util['format']('iftime\x20%s',_0x425ab3[_0x5b7a5f])})[_0xcb25('0x7')](function(_0x54900b){return _0x54900b&&_0x54900b[_0xcb25('0xd')]&&_0x54900b[_0xcb25('0xd')][_0xcb25('0xe')](_0xcb25('0xf'))>=0x0?!![]:![];})['catch'](function(_0x3b84ca){logger[_0xcb25('0x8')](_0xcb25('0x10'),_0x370321,_0x425ab3[_0x5b7a5f]);}));}BPromise[_0xcb25('0x11')](_0x33d17a)[_0xcb25('0x7')](function(_0xda8541){var _0x32d803=_[_0xcb25('0x12')](_0xda8541);logger[_0xcb25('0x13')](_0xcb25('0x14'),_0x370321,_0x425ab3[_0xcb25('0x15')](_0xcb25('0x16')),_0x32d803);_0xd0c4eb[_0xcb25('0x17')](_0x32d803);})[_0xcb25('0x18')](function(_0x366086){console[_0xcb25('0x19')](_0x366086);logger['error'](_0xcb25('0x14'),_0x370321,_0x425ab3['join'](_0xcb25('0x16')),_0x366086[_0xcb25('0x1a')]);_0xd0c4eb[_0xcb25('0x1b')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index ed3816c..3401d73 100644 --- a/server/services/xdr/agents.controller.js +++ b/server/services/xdr/agents.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3187=['queuecallerabandon','forIn','abandoned','holdtime','agentconnect','agentconnectAt','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','transferexten','extension','attendedtransfer','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transferuniqueid','origtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererexten','transfertargetuniqueid','hangup','agent','lodash','util','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','channel','queue','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','agentcalledAt','now','called','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','rejected','reason','ringtime','talktime'];(function(_0xa03d68,_0x1ac152){var _0x2197d1=function(_0x48a791){while(--_0x48a791){_0xa03d68['push'](_0xa03d68['shift']());}};_0x2197d1(++_0x1ac152);}(_0x3187,0xf4));var _0x7318=function(_0x5c81ac,_0x2f315a){_0x5c81ac=_0x5c81ac-0x0;var _0x53c1af=_0x3187[_0x5c81ac];return _0x53c1af;};'use strict';var _=require(_0x7318('0x0'));var util=require(_0x7318('0x1'));var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x50cca5,_0x558027){utils[_0x7318('0x2')](util[_0x7318('0x3')](_0x7318('0x4'),_0x50cca5['uniqueid'],_0x50cca5[_0x7318('0x5')],_0x50cca5[_0x7318('0x6')],_0x50cca5['membername'],_0x50cca5[_0x7318('0x7')],_0x50cca5[_0x7318('0x8')],_0x50cca5[_0x7318('0x9')],_0x50cca5[_0x7318('0xa')]));if(_0x50cca5[_0x7318('0x6')]){utils[_0x7318('0xb')](_0x50cca5[_0x7318('0x6')])[_0x7318('0xc')](function(_0xe22eff){if(_0xe22eff){_0x50cca5[_0x7318('0xd')]=_0xe22eff[_0x7318('0xd')];_0x50cca5[_0x7318('0xe')]=_0x50cca5[_0x7318('0xf')]?_0xe22eff[_0x7318('0x10')]:![];_0x50cca5[_0x7318('0x11')]=_0x50cca5[_0x7318('0xe')]?_0xe22eff[_0x7318('0x12')]:0x0;}utils[_0x7318('0x13')](_0x7318('0x14'),_0x50cca5);});}else{utils['request'](_0x7318('0x14'),_0x50cca5);}if(_0x558027){delete transfers[_0x50cca5[_0x7318('0x15')]];}else{delete agents[_0x50cca5[_0x7318('0x16')]];}}exports[_0x7318('0x17')]=function(_0x44be5f){try{agents[_0x44be5f[_0x7318('0x16')]]=_0x44be5f;agents[_0x44be5f[_0x7318('0x16')]][_0x7318('0x18')]=utils[_0x7318('0x19')]();agents[_0x44be5f[_0x7318('0x16')]][_0x7318('0xa')]=_0x7318('0x1a');agents[_0x44be5f['destuniqueid']][_0x7318('0x9')]=null;agents[_0x44be5f[_0x7318('0x16')]]['connectedlinename']=null;}catch(_0x3089a2){utils[_0x7318('0x1b')](_0x3089a2[_0x7318('0x1c')]);}};exports[_0x7318('0x1d')]=function(_0x24f073){try{if(!_[_0x7318('0x1e')](agents[_0x24f073[_0x7318('0x16')]])){agents[_0x24f073[_0x7318('0x16')]][_0x7318('0x1d')]=!![];agents[_0x24f073[_0x7318('0x16')]][_0x7318('0x1f')]=utils['now']();agents[_0x24f073[_0x7318('0x16')]][_0x7318('0xa')]=_0x7318('0x20');agents[_0x24f073['destuniqueid']][_0x7318('0x21')]=_0x7318('0x20');agents[_0x24f073[_0x7318('0x16')]]['holdtime']=_0x24f073[_0x7318('0x22')]?parseInt(_0x24f073[_0x7318('0x22')])/0x3e8:0x0;agents[_0x24f073[_0x7318('0x16')]][_0x7318('0x23')]=0x0;writeDB(agents[_0x24f073[_0x7318('0x16')]]);}}catch(_0x4c1e07){utils[_0x7318('0x1b')](_0x4c1e07[_0x7318('0x1c')]);}};exports[_0x7318('0x24')]=function(_0x3250dd){try{_[_0x7318('0x25')](agents,function(_0x4a48d8,_0x5616c3){if(_0x4a48d8[_0x7318('0x15')]==_0x3250dd[_0x7318('0x15')]){_0x4a48d8[_0x7318('0x1d')]=!![];_0x4a48d8[_0x7318('0x1f')]=utils[_0x7318('0x19')]();_0x4a48d8[_0x7318('0xa')]=_0x7318('0x26');_0x4a48d8['reason']='abandoned';_0x4a48d8[_0x7318('0x27')]=_0x3250dd[_0x7318('0x27')];_0x4a48d8[_0x7318('0x23')]=0x0;writeDB(_0x4a48d8);}});}catch(_0x554464){utils[_0x7318('0x1b')](_0x554464[_0x7318('0x1c')]);}};exports[_0x7318('0x28')]=function(_0x1c7dad){try{if(agents[_0x1c7dad['destuniqueid']]){agents[_0x1c7dad[_0x7318('0x16')]][_0x7318('0x29')]=utils[_0x7318('0x19')]();agents[_0x1c7dad[_0x7318('0x16')]][_0x7318('0x9')]=_0x1c7dad['connectedlinenum'];agents[_0x1c7dad['destuniqueid']][_0x7318('0x2a')]=_0x1c7dad[_0x7318('0x2a')];agents[_0x1c7dad[_0x7318('0x16')]][_0x7318('0x27')]=_0x1c7dad[_0x7318('0x22')];agents[_0x1c7dad[_0x7318('0x16')]][_0x7318('0xa')]=_0x7318('0x2b');_['forIn'](agents,function(_0x208b29,_0x31969e){if(_0x208b29['destuniqueid']!=_0x1c7dad[_0x7318('0x16')]&&_0x208b29[_0x7318('0x15')]==_0x1c7dad[_0x7318('0x15')]){_0x208b29['talktime']=0x0;_0x208b29[_0x7318('0x27')]=_0x1c7dad[_0x7318('0x22')];_0x208b29[_0x7318('0x1d')]=!![];_0x208b29[_0x7318('0x1f')]=utils['now']();_0x208b29[_0x7318('0xa')]=_0x7318('0x2c');_0x208b29[_0x7318('0x21')]='answered_elsewhere';_0x208b29[_0x7318('0x2d')]=_0x1c7dad[_0x7318('0x16')];_0x208b29['answeredelsewheremembername']=_0x1c7dad['membername'];writeDB(_0x208b29);}});}}catch(_0x34c196){utils['error'](_0x34c196[_0x7318('0x1c')]);}};exports[_0x7318('0xf')]=function(_0x3c4a02){try{if(!_['isNil'](agents[_0x3c4a02[_0x7318('0x16')]])){agents[_0x3c4a02[_0x7318('0x16')]][_0x7318('0xf')]=!![];agents[_0x3c4a02[_0x7318('0x16')]]['agentcompleteAt']=utils[_0x7318('0x19')]();agents[_0x3c4a02[_0x7318('0x16')]][_0x7318('0x23')]=utils[_0x7318('0x2e')](agents[_0x3c4a02['destuniqueid']][_0x7318('0x2f')],agents[_0x3c4a02[_0x7318('0x16')]]['agentconnectAt']);agents[_0x3c4a02[_0x7318('0x16')]][_0x7318('0x21')]=_0x3c4a02['reason'];agents[_0x3c4a02[_0x7318('0x16')]][_0x7318('0xa')]=_0x7318('0x30');writeDB(agents[_0x3c4a02[_0x7318('0x16')]]);}}catch(_0x343170){utils[_0x7318('0x1b')](_0x343170[_0x7318('0x1c')]);}};exports[_0x7318('0x31')]=function(_0x599a14){try{if(!_['isNil'](agents[_0x599a14[_0x7318('0x32')]])){agents[_0x599a14[_0x7318('0x32')]][_0x7318('0x33')]=!![];agents[_0x599a14[_0x7318('0x32')]][_0x7318('0x34')]='blind';agents[_0x599a14[_0x7318('0x32')]][_0x7318('0x35')]=_0x599a14[_0x7318('0x36')];agents[_0x599a14['transfereruniqueid']]['transferuniqueid']=agents[_0x599a14[_0x7318('0x32')]][_0x7318('0x15')];}}catch(_0x4d854b){utils[_0x7318('0x1b')](_0x4d854b[_0x7318('0x1c')]);}};exports[_0x7318('0x37')]=function(_0x2b2383){try{if(_0x2b2383['origtransfereruniqueid']==_0x2b2383[_0x7318('0x38')]){if(!_[_0x7318('0x1e')](agents[_0x2b2383[_0x7318('0x39')]])){agents[_0x2b2383[_0x7318('0x39')]]['transfer']=!![];agents[_0x2b2383[_0x7318('0x39')]][_0x7318('0x34')]=_0x7318('0x3a');agents[_0x2b2383[_0x7318('0x39')]][_0x7318('0x35')]=_0x2b2383[_0x7318('0x3b')];agents[_0x2b2383[_0x7318('0x39')]][_0x7318('0x3c')]=_0x2b2383[_0x7318('0x3d')];}if(_0x2b2383['transfereeuniqueid']&&agents[_0x2b2383['transfereeuniqueid']]){agents[_0x2b2383[_0x7318('0x3e')]][_0x7318('0x3f')]=0x1;transfers[_0x2b2383[_0x7318('0x3e')]]=_[_0x7318('0x40')](agents[_0x2b2383[_0x7318('0x3e')]]);transfers[_0x2b2383[_0x7318('0x3e')]][_0x7318('0x8')]=agents[_0x2b2383[_0x7318('0x39')]]['calleridnum'];transfers[_0x2b2383[_0x7318('0x3e')]][_0x7318('0x41')]=agents[_0x2b2383[_0x7318('0x39')]][_0x7318('0x41')];transfers[_0x2b2383[_0x7318('0x3e')]][_0x7318('0x18')]=utils['now']();transfers[_0x2b2383[_0x7318('0x3e')]][_0x7318('0x29')]=utils[_0x7318('0x19')]();transfers[_0x2b2383[_0x7318('0x3e')]][_0x7318('0x27')]=0x0;transfers[_0x2b2383[_0x7318('0x3e')]]['agententerreason']=0x2;}}else if(_0x2b2383[_0x7318('0x39')]==_0x2b2383['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x2b2383['origtransfereruniqueid']])){agents[_0x2b2383[_0x7318('0x3d')]]['transfer']=!![];agents[_0x2b2383['origtransfereruniqueid']][_0x7318('0x34')]='ATTENDED';agents[_0x2b2383[_0x7318('0x3d')]][_0x7318('0x35')]=_0x2b2383[_0x7318('0x42')];agents[_0x2b2383[_0x7318('0x3d')]][_0x7318('0x3c')]=_0x2b2383[_0x7318('0x39')];}if(_0x2b2383['transfertargetuniqueid']&&agents[_0x2b2383[_0x7318('0x43')]]){agents[_0x2b2383['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x2b2383['transfertargetuniqueid']]=_[_0x7318('0x40')](agents[_0x2b2383['transfertargetuniqueid']]);transfers[_0x2b2383[_0x7318('0x43')]][_0x7318('0x8')]=agents[_0x2b2383[_0x7318('0x3d')]][_0x7318('0x8')];transfers[_0x2b2383[_0x7318('0x43')]][_0x7318('0x41')]=agents[_0x2b2383[_0x7318('0x3d')]][_0x7318('0x41')];transfers[_0x2b2383['transfertargetuniqueid']]['agentcalledAt']=utils[_0x7318('0x19')]();transfers[_0x2b2383[_0x7318('0x43')]][_0x7318('0x29')]=utils[_0x7318('0x19')]();transfers[_0x2b2383[_0x7318('0x43')]][_0x7318('0x27')]=0x0;transfers[_0x2b2383[_0x7318('0x43')]][_0x7318('0x3f')]=0x2;}}}catch(_0x5423a3){utils['error'](_0x5423a3[_0x7318('0x1c')]);}};exports[_0x7318('0x44')]=function(_0x20968d){try{if(transfers[_0x20968d[_0x7318('0x15')]]){transfers[_0x20968d['uniqueid']]['agentcomplete']=!![];transfers[_0x20968d[_0x7318('0x15')]][_0x7318('0x2f')]=utils[_0x7318('0x19')]();transfers[_0x20968d[_0x7318('0x15')]]['talktime']=utils[_0x7318('0x2e')](transfers[_0x20968d[_0x7318('0x15')]]['agentcompleteAt'],transfers[_0x20968d[_0x7318('0x15')]][_0x7318('0x29')]);transfers[_0x20968d[_0x7318('0x15')]][_0x7318('0x21')]=_0x7318('0x45');transfers[_0x20968d[_0x7318('0x15')]][_0x7318('0xa')]=_0x7318('0x30');writeDB(transfers[_0x20968d[_0x7318('0x15')]],!![]);}if(agents[_0x20968d[_0x7318('0x15')]]&&agents[_0x20968d[_0x7318('0x15')]][_0x7318('0x29')]){agents[_0x20968d['uniqueid']][_0x7318('0xf')]=!![];agents[_0x20968d[_0x7318('0x15')]]['agentcompleteAt']=utils['now']();agents[_0x20968d[_0x7318('0x15')]][_0x7318('0x23')]=utils['diffTime'](agents[_0x20968d['uniqueid']]['agentcompleteAt'],agents[_0x20968d[_0x7318('0x15')]]['agentconnectAt']);agents[_0x20968d['uniqueid']][_0x7318('0x21')]=agents[_0x20968d[_0x7318('0x15')]]['transfer']?_0x7318('0x33'):'agent';agents[_0x20968d[_0x7318('0x15')]][_0x7318('0xa')]='complete';writeDB(agents[_0x20968d['uniqueid']]);}}catch(_0x351fdf){utils[_0x7318('0x1b')](_0x351fdf[_0x7318('0x1c')]);}}; \ No newline at end of file +var _0xd90e=['acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','agentcalledAt','now','called','error','stack','isNil','agentringnoanswer','agentringnoanswerAt','rejected','reason','holdtime','ringtime','talktime','forIn','abandoned','agentconnect','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','diffTime','agentcompleteAt','agentconnectAt','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','secondtransfereruniqueid','calleridname','secondtransfererlinkedid','transfertargetuniqueid','hangup','agent','complete','lodash','./utils','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','interface','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime'];(function(_0x27826b,_0x97f7f8){var _0x5e4477=function(_0x447ed9){while(--_0x447ed9){_0x27826b['push'](_0x27826b['shift']());}};_0x5e4477(++_0x97f7f8);}(_0xd90e,0x17c));var _0xed90=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd90e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xed90('0x0'));var util=require('util');var utils=require(_0xed90('0x1'));var agents={};var transfers={};function writeDB(_0x4e32ae,_0x4dd329){utils[_0xed90('0x2')](util['format'](_0xed90('0x3'),_0x4e32ae[_0xed90('0x4')],_0x4e32ae[_0xed90('0x5')],_0x4e32ae[_0xed90('0x6')],_0x4e32ae['membername'],_0x4e32ae[_0xed90('0x7')],_0x4e32ae['calleridnum'],_0x4e32ae[_0xed90('0x8')],_0x4e32ae[_0xed90('0x9')]));if(_0x4e32ae[_0xed90('0x6')]){utils[_0xed90('0xa')](_0x4e32ae[_0xed90('0x6')])['then'](function(_0x48b34e){if(_0x48b34e){_0x4e32ae[_0xed90('0xb')]=_0x48b34e['type'];_0x4e32ae[_0xed90('0xc')]=_0x4e32ae[_0xed90('0xd')]?_0x48b34e[_0xed90('0xe')]:![];_0x4e32ae[_0xed90('0xf')]=_0x4e32ae['agentacw']?_0x48b34e[_0xed90('0x10')]:0x0;}utils['request'](_0xed90('0x11'),_0x4e32ae);});}else{utils[_0xed90('0x12')]('CreateVoiceAgentReport',_0x4e32ae);}if(_0x4dd329){delete transfers[_0x4e32ae['uniqueid']];}else{delete agents[_0x4e32ae[_0xed90('0x13')]];}}exports[_0xed90('0x14')]=function(_0x5b2046){try{agents[_0x5b2046[_0xed90('0x13')]]=_0x5b2046;agents[_0x5b2046[_0xed90('0x13')]][_0xed90('0x15')]=utils[_0xed90('0x16')]();agents[_0x5b2046[_0xed90('0x13')]][_0xed90('0x9')]=_0xed90('0x17');agents[_0x5b2046['destuniqueid']][_0xed90('0x8')]=null;agents[_0x5b2046[_0xed90('0x13')]]['connectedlinename']=null;}catch(_0x4fe276){utils[_0xed90('0x18')](_0x4fe276[_0xed90('0x19')]);}};exports['agentringnoanswer']=function(_0x1b3adb){try{if(!_[_0xed90('0x1a')](agents[_0x1b3adb['destuniqueid']])){agents[_0x1b3adb[_0xed90('0x13')]][_0xed90('0x1b')]=!![];agents[_0x1b3adb[_0xed90('0x13')]][_0xed90('0x1c')]=utils[_0xed90('0x16')]();agents[_0x1b3adb[_0xed90('0x13')]][_0xed90('0x9')]=_0xed90('0x1d');agents[_0x1b3adb[_0xed90('0x13')]][_0xed90('0x1e')]=_0xed90('0x1d');agents[_0x1b3adb[_0xed90('0x13')]][_0xed90('0x1f')]=_0x1b3adb[_0xed90('0x20')]?parseInt(_0x1b3adb[_0xed90('0x20')])/0x3e8:0x0;agents[_0x1b3adb[_0xed90('0x13')]][_0xed90('0x21')]=0x0;writeDB(agents[_0x1b3adb['destuniqueid']]);}}catch(_0x24e80f){utils[_0xed90('0x18')](_0x24e80f[_0xed90('0x19')]);}};exports['queuecallerabandon']=function(_0x5414e6){try{_[_0xed90('0x22')](agents,function(_0x2d4199,_0x29ec59){if(_0x2d4199[_0xed90('0x4')]==_0x5414e6[_0xed90('0x4')]){_0x2d4199[_0xed90('0x1b')]=!![];_0x2d4199[_0xed90('0x1c')]=utils[_0xed90('0x16')]();_0x2d4199[_0xed90('0x9')]=_0xed90('0x23');_0x2d4199[_0xed90('0x1e')]=_0xed90('0x23');_0x2d4199[_0xed90('0x1f')]=_0x5414e6[_0xed90('0x1f')];_0x2d4199[_0xed90('0x21')]=0x0;writeDB(_0x2d4199);}});}catch(_0x57ecf6){utils['error'](_0x57ecf6['stack']);}};exports[_0xed90('0x24')]=function(_0x77d049){try{if(agents[_0x77d049[_0xed90('0x13')]]){agents[_0x77d049[_0xed90('0x13')]]['agentconnectAt']=utils[_0xed90('0x16')]();agents[_0x77d049[_0xed90('0x13')]][_0xed90('0x8')]=_0x77d049[_0xed90('0x8')];agents[_0x77d049[_0xed90('0x13')]][_0xed90('0x25')]=_0x77d049[_0xed90('0x25')];agents[_0x77d049[_0xed90('0x13')]]['holdtime']=_0x77d049[_0xed90('0x20')];agents[_0x77d049['destuniqueid']][_0xed90('0x9')]='connect';_[_0xed90('0x22')](agents,function(_0x2328e7,_0x36780b){if(_0x2328e7['destuniqueid']!=_0x77d049['destuniqueid']&&_0x2328e7[_0xed90('0x4')]==_0x77d049[_0xed90('0x4')]){_0x2328e7['talktime']=0x0;_0x2328e7[_0xed90('0x1f')]=_0x77d049['ringtime'];_0x2328e7['agentringnoanswer']=!![];_0x2328e7[_0xed90('0x1c')]=utils['now']();_0x2328e7['lastevent']=_0xed90('0x26');_0x2328e7[_0xed90('0x1e')]=_0xed90('0x26');_0x2328e7[_0xed90('0x27')]=_0x77d049[_0xed90('0x13')];_0x2328e7[_0xed90('0x28')]=_0x77d049['membername'];writeDB(_0x2328e7);}});}}catch(_0x1f8a43){utils['error'](_0x1f8a43[_0xed90('0x19')]);}};exports[_0xed90('0xd')]=function(_0x4b3557){try{if(!_[_0xed90('0x1a')](agents[_0x4b3557[_0xed90('0x13')]])){agents[_0x4b3557[_0xed90('0x13')]][_0xed90('0xd')]=!![];agents[_0x4b3557[_0xed90('0x13')]]['agentcompleteAt']=utils[_0xed90('0x16')]();agents[_0x4b3557['destuniqueid']]['talktime']=utils[_0xed90('0x29')](agents[_0x4b3557[_0xed90('0x13')]][_0xed90('0x2a')],agents[_0x4b3557[_0xed90('0x13')]][_0xed90('0x2b')]);agents[_0x4b3557[_0xed90('0x13')]][_0xed90('0x1e')]=_0x4b3557[_0xed90('0x1e')];agents[_0x4b3557['destuniqueid']]['lastevent']='complete';writeDB(agents[_0x4b3557[_0xed90('0x13')]]);}}catch(_0x48cbae){utils[_0xed90('0x18')](_0x48cbae[_0xed90('0x19')]);}};exports['blindtransfer']=function(_0x389aa1){try{if(!_[_0xed90('0x1a')](agents[_0x389aa1[_0xed90('0x2c')]])){agents[_0x389aa1['transfereruniqueid']][_0xed90('0x2d')]=!![];agents[_0x389aa1['transfereruniqueid']][_0xed90('0x2e')]=_0xed90('0x2f');agents[_0x389aa1[_0xed90('0x2c')]][_0xed90('0x30')]=_0x389aa1['extension'];agents[_0x389aa1[_0xed90('0x2c')]][_0xed90('0x31')]=agents[_0x389aa1[_0xed90('0x2c')]]['uniqueid'];}}catch(_0x36220e){utils['error'](_0x36220e[_0xed90('0x19')]);}};exports[_0xed90('0x32')]=function(_0x3096e8){try{if(_0x3096e8[_0xed90('0x33')]==_0x3096e8[_0xed90('0x34')]){if(!_['isNil'](agents[_0x3096e8['secondtransfereruniqueid']])){agents[_0x3096e8['secondtransfereruniqueid']][_0xed90('0x2d')]=!![];agents[_0x3096e8['secondtransfereruniqueid']]['transfertype']=_0xed90('0x35');agents[_0x3096e8['secondtransfereruniqueid']][_0xed90('0x30')]=_0x3096e8[_0xed90('0x36')];agents[_0x3096e8['secondtransfereruniqueid']]['transferuniqueid']=_0x3096e8['origtransfereruniqueid'];}if(_0x3096e8[_0xed90('0x37')]&&agents[_0x3096e8['transfereeuniqueid']]){agents[_0x3096e8[_0xed90('0x37')]][_0xed90('0x38')]=0x1;transfers[_0x3096e8['transfereeuniqueid']]=_[_0xed90('0x39')](agents[_0x3096e8['transfereeuniqueid']]);transfers[_0x3096e8[_0xed90('0x37')]][_0xed90('0x3a')]=agents[_0x3096e8[_0xed90('0x3b')]][_0xed90('0x3a')];transfers[_0x3096e8[_0xed90('0x37')]][_0xed90('0x3c')]=agents[_0x3096e8[_0xed90('0x3b')]][_0xed90('0x3c')];transfers[_0x3096e8['transfereeuniqueid']][_0xed90('0x15')]=utils[_0xed90('0x16')]();transfers[_0x3096e8[_0xed90('0x37')]][_0xed90('0x2b')]=utils[_0xed90('0x16')]();transfers[_0x3096e8['transfereeuniqueid']][_0xed90('0x1f')]=0x0;transfers[_0x3096e8[_0xed90('0x37')]][_0xed90('0x38')]=0x2;}}else if(_0x3096e8['secondtransfereruniqueid']==_0x3096e8[_0xed90('0x3d')]){if(!_['isNil'](agents[_0x3096e8[_0xed90('0x33')]])){agents[_0x3096e8[_0xed90('0x33')]]['transfer']=!![];agents[_0x3096e8['origtransfereruniqueid']][_0xed90('0x2e')]=_0xed90('0x35');agents[_0x3096e8[_0xed90('0x33')]]['transferexten']=_0x3096e8['secondtransfererexten'];agents[_0x3096e8['origtransfereruniqueid']]['transferuniqueid']=_0x3096e8[_0xed90('0x3b')];}if(_0x3096e8[_0xed90('0x3e')]&&agents[_0x3096e8['transfertargetuniqueid']]){agents[_0x3096e8[_0xed90('0x3e')]][_0xed90('0x38')]=0x1;transfers[_0x3096e8[_0xed90('0x3e')]]=_[_0xed90('0x39')](agents[_0x3096e8[_0xed90('0x3e')]]);transfers[_0x3096e8[_0xed90('0x3e')]][_0xed90('0x3a')]=agents[_0x3096e8[_0xed90('0x33')]][_0xed90('0x3a')];transfers[_0x3096e8[_0xed90('0x3e')]][_0xed90('0x3c')]=agents[_0x3096e8[_0xed90('0x33')]]['calleridname'];transfers[_0x3096e8['transfertargetuniqueid']][_0xed90('0x15')]=utils[_0xed90('0x16')]();transfers[_0x3096e8[_0xed90('0x3e')]][_0xed90('0x2b')]=utils[_0xed90('0x16')]();transfers[_0x3096e8[_0xed90('0x3e')]][_0xed90('0x1f')]=0x0;transfers[_0x3096e8[_0xed90('0x3e')]][_0xed90('0x38')]=0x2;}}}catch(_0x170311){utils[_0xed90('0x18')](_0x170311[_0xed90('0x19')]);}};exports[_0xed90('0x3f')]=function(_0x336ac0){try{if(transfers[_0x336ac0[_0xed90('0x4')]]){transfers[_0x336ac0[_0xed90('0x4')]]['agentcomplete']=!![];transfers[_0x336ac0[_0xed90('0x4')]][_0xed90('0x2a')]=utils['now']();transfers[_0x336ac0[_0xed90('0x4')]][_0xed90('0x21')]=utils[_0xed90('0x29')](transfers[_0x336ac0[_0xed90('0x4')]][_0xed90('0x2a')],transfers[_0x336ac0['uniqueid']][_0xed90('0x2b')]);transfers[_0x336ac0[_0xed90('0x4')]][_0xed90('0x1e')]=_0xed90('0x40');transfers[_0x336ac0[_0xed90('0x4')]][_0xed90('0x9')]=_0xed90('0x41');writeDB(transfers[_0x336ac0[_0xed90('0x4')]],!![]);}if(agents[_0x336ac0[_0xed90('0x4')]]&&agents[_0x336ac0[_0xed90('0x4')]][_0xed90('0x2b')]){agents[_0x336ac0[_0xed90('0x4')]][_0xed90('0xd')]=!![];agents[_0x336ac0[_0xed90('0x4')]][_0xed90('0x2a')]=utils['now']();agents[_0x336ac0[_0xed90('0x4')]][_0xed90('0x21')]=utils[_0xed90('0x29')](agents[_0x336ac0[_0xed90('0x4')]][_0xed90('0x2a')],agents[_0x336ac0[_0xed90('0x4')]][_0xed90('0x2b')]);agents[_0x336ac0[_0xed90('0x4')]][_0xed90('0x1e')]=agents[_0x336ac0['uniqueid']][_0xed90('0x2d')]?_0xed90('0x2d'):_0xed90('0x40');agents[_0x336ac0[_0xed90('0x4')]][_0xed90('0x9')]=_0xed90('0x41');writeDB(agents[_0x336ac0[_0xed90('0x4')]]);}}catch(_0x256b03){utils[_0xed90('0x18')](_0x256b03[_0xed90('0x19')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 798402e..596c27f 100644 --- a/server/services/xdr/calls.controller.js +++ b/server/services/xdr/calls.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9678=['UserId','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','exten','context','DOCUMENTATION','error','newstate','isNil','systemanswertime','now','transfer','destinationchannel','answertime','toNumber','channelstate','stack','hangup','callerid','calleridname','calleridnum','endtime','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','userfield','_attended','transfertargetchannel','musiconholdstart','musiconholdstartAt','mohtime','varset','variable','xmd-originatecalleridnum','xmd-phone','value','\x22\x20<','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','type','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','info','format','uniqueid','channel','accountcode','destination','disposition','getUserByInternal','then'];(function(_0x2fa7d7,_0x7e8b89){var _0x57692a=function(_0x282eda){while(--_0x282eda){_0x2fa7d7['push'](_0x2fa7d7['shift']());}};_0x57692a(++_0x7e8b89);}(_0x9678,0xec));var _0x8967=function(_0x133a18,_0x14ba98){_0x133a18=_0x133a18-0x0;var _0x394b44=_0x9678[_0x133a18];return _0x394b44;};'use strict';var _=require(_0x8967('0x0'));var util=require(_0x8967('0x1'));var utils=require(_0x8967('0x2'));var dispositions=['NO\x20ANSWER',_0x8967('0x3'),_0x8967('0x3'),'NO\x20ANSWER',_0x8967('0x4'),_0x8967('0x4'),_0x8967('0x5'),_0x8967('0x6'),_0x8967('0x3'),'FAILED','FAILED'];var channels={};function writeDB(_0x19fa19){utils[_0x8967('0x7')](util[_0x8967('0x8')]('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x19fa19[_0x8967('0x9')],_0x19fa19[_0x8967('0xa')],_0x19fa19['type'],_0x19fa19[_0x8967('0xb')],_0x19fa19['source'],_0x19fa19[_0x8967('0xc')],_0x19fa19['callerid'],_0x19fa19[_0x8967('0xd')]));if(_0x19fa19['accountcode']){utils[_0x8967('0xe')](_0x19fa19[_0x8967('0xb')])[_0x8967('0xf')](function(_0x1896a3){if(_0x1896a3){_0x19fa19[_0x8967('0x10')]=_0x1896a3['id'];}utils[_0x8967('0x11')](_0x8967('0x12'),_0x19fa19);});}else{utils[_0x8967('0x11')](_0x8967('0x12'),_0x19fa19);}if(channels[_0x19fa19[_0x8967('0x9')]]){delete channels[_0x19fa19[_0x8967('0x9')]];}}exports[_0x8967('0x13')]=function(_0x49fc31){try{if(_0x49fc31[_0x8967('0x9')]==_0x49fc31[_0x8967('0x14')]&&_0x49fc31[_0x8967('0xa')]!=_0x8967('0x15')){channels[_0x49fc31[_0x8967('0x9')]]={'uniqueid':_0x49fc31[_0x8967('0x9')],'accountcode':_0x49fc31[_0x8967('0xb')],'source':_0x49fc31['calleridnum'],'destination':_0x49fc31[_0x8967('0x16')],'destinationcontext':_0x49fc31[_0x8967('0x17')],'channel':_0x49fc31[_0x8967('0xa')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x8967('0x18')};}}catch(_0x1eb66c){utils[_0x8967('0x19')](_0x1eb66c['stack']);}};exports[_0x8967('0x1a')]=function(_0x36abe4){try{if(!_[_0x8967('0x1b')](channels[_0x36abe4[_0x8967('0x9')]])&&_0x36abe4['channelstate']==0x6){if(_['isNil'](channels[_0x36abe4['uniqueid']][_0x8967('0x1c')])){channels[_0x36abe4[_0x8967('0x9')]][_0x8967('0x1c')]=utils[_0x8967('0x1d')]();}}else if(!_[_0x8967('0x1b')](channels[_0x36abe4[_0x8967('0x14')]])&&_0x36abe4['channelstate']==0x6&&_0x36abe4['context']!=_0x8967('0x1e')){channels[_0x36abe4['linkedid']]['accountcode']=_0x36abe4[_0x8967('0xb')];channels[_0x36abe4[_0x8967('0x14')]][_0x8967('0x1f')]=_0x36abe4[_0x8967('0xa')];if(_[_0x8967('0x1b')](channels[_0x36abe4[_0x8967('0x14')]][_0x8967('0x20')])){channels[_0x36abe4[_0x8967('0x14')]][_0x8967('0x20')]=utils['now']();}channels[_0x36abe4[_0x8967('0x14')]]['disposition']=dispositions[_[_0x8967('0x21')](_0x36abe4[_0x8967('0x22')])]||'ANSWERED';}}catch(_0x3bd5f8){utils['error'](_0x3bd5f8[_0x8967('0x23')]);}};exports[_0x8967('0x24')]=function(_0x25c11b){try{if(!_['isNil'](channels[_0x25c11b[_0x8967('0x9')]])){if(_[_0x8967('0x1b')](channels[_0x25c11b[_0x8967('0x9')]][_0x8967('0x25')])){channels[_0x25c11b[_0x8967('0x9')]][_0x8967('0x25')]=_0x25c11b[_0x8967('0x26')]+'\x20<'+_0x25c11b[_0x8967('0x27')]+'>';}channels[_0x25c11b[_0x8967('0x9')]][_0x8967('0x28')]=utils[_0x8967('0x1d')]();channels[_0x25c11b[_0x8967('0x9')]]['duration']=utils[_0x8967('0x29')](channels[_0x25c11b['uniqueid']]['endtime'],channels[_0x25c11b[_0x8967('0x9')]][_0x8967('0x2a')]);channels[_0x25c11b['uniqueid']][_0x8967('0x2b')]=channels[_0x25c11b[_0x8967('0x9')]][_0x8967('0x20')]?utils[_0x8967('0x29')](channels[_0x25c11b[_0x8967('0x9')]]['endtime'],channels[_0x25c11b['uniqueid']][_0x8967('0x20')]):0x0;writeDB(channels[_0x25c11b[_0x8967('0x9')]]);}}catch(_0xab942){utils['error'](_0xab942[_0x8967('0x23')]);}};exports[_0x8967('0x2c')]=function(_0x291223){try{if(!_[_0x8967('0x1b')](channels[_0x291223[_0x8967('0x2d')]])){if(channels[_0x291223[_0x8967('0x2d')]][_0x8967('0xa')]==_0x291223[_0x8967('0x2e')]){channels[_0x291223[_0x8967('0x2d')]][_0x8967('0x1f')]=_0x291223['secondtransfererchannel'];channels[_0x291223[_0x8967('0x2d')]][_0x8967('0x2f')]=_0x8967('0x30');}else if(channels[_0x291223[_0x8967('0x2d')]][_0x8967('0xa')]=_0x291223[_0x8967('0x31')]){channels[_0x291223[_0x8967('0x2d')]][_0x8967('0x1f')]=_0x291223['origtransfererchannel'];channels[_0x291223[_0x8967('0x2d')]][_0x8967('0x2f')]=_0x8967('0x30');}}}catch(_0x26c77c){utils[_0x8967('0x19')](_0x26c77c[_0x8967('0x23')]);}};exports[_0x8967('0x32')]=function(_0x442891){try{if(!_[_0x8967('0x1b')](channels[_0x442891['uniqueid']])){channels[_0x442891['uniqueid']]['musiconholdstartAt']=utils[_0x8967('0x1d')]();}}catch(_0x5aa1b3){utils[_0x8967('0x19')](_0x5aa1b3[_0x8967('0x23')]);}};exports['musiconholdstop']=function(_0x562287){try{if(!_[_0x8967('0x1b')](channels[_0x562287[_0x8967('0x9')]])){if(!_['isNil'](channels[_0x562287[_0x8967('0x9')]][_0x8967('0x33')])){channels[_0x562287[_0x8967('0x9')]][_0x8967('0x34')]+=utils[_0x8967('0x29')](utils[_0x8967('0x1d')](),channels[_0x562287['uniqueid']][_0x8967('0x33')]);delete channels[_0x562287[_0x8967('0x9')]][_0x8967('0x33')];}}}catch(_0x5964b0){utils[_0x8967('0x19')](_0x5964b0['stack']);}};exports[_0x8967('0x35')]=function(_0x5ea4e9){try{if(!_[_0x8967('0x1b')](channels[_0x5ea4e9[_0x8967('0x9')]])){if(!_['isNil'](_0x5ea4e9[_0x8967('0x36')][_0x8967('0x37')])){channels[_0x5ea4e9[_0x8967('0x9')]]['source']=_0x5ea4e9['value'];}if(!_[_0x8967('0x1b')](_0x5ea4e9['variable'][_0x8967('0x38')])){channels[_0x5ea4e9[_0x8967('0x9')]][_0x8967('0xc')]=_0x5ea4e9[_0x8967('0x39')];channels[_0x5ea4e9[_0x8967('0x9')]][_0x8967('0x25')]='\x22'+_0x5ea4e9[_0x8967('0x39')]+_0x8967('0x3a')+_0x5ea4e9[_0x8967('0x39')]+'>';}if(!_[_0x8967('0x1b')](_0x5ea4e9['variable'][_0x8967('0x3b')])||!_[_0x8967('0x1b')](_0x5ea4e9[_0x8967('0x36')]['xmd-callerid'])){channels[_0x5ea4e9['uniqueid']][_0x8967('0x25')]=_0x5ea4e9[_0x8967('0x39')];}if(!_[_0x8967('0x1b')](_0x5ea4e9['variable'][_0x8967('0x3c')])||!_['isNil'](_0x5ea4e9['variable'][_0x8967('0x3d')])){channels[_0x5ea4e9[_0x8967('0x9')]][_0x8967('0x3e')]=_0x8967('0x3f');channels[_0x5ea4e9[_0x8967('0x9')]][_0x8967('0x40')]=_0x5ea4e9[_0x8967('0x39')];channels[_0x5ea4e9[_0x8967('0x9')]][_0x8967('0x41')]=!![];}if(!_[_0x8967('0x1b')](_0x5ea4e9[_0x8967('0x36')][_0x8967('0x42')])){channels[_0x5ea4e9[_0x8967('0x9')]][_0x8967('0x43')]=_0x5ea4e9[_0x8967('0x39')];}if(!_['isNil'](_0x5ea4e9[_0x8967('0x36')]['xmd-cdrtype'])){channels[_0x5ea4e9[_0x8967('0x9')]][_0x8967('0x44')]=_0x5ea4e9[_0x8967('0x39')];}if(!_[_0x8967('0x1b')](_0x5ea4e9[_0x8967('0x36')]['outboundrouteid'])){channels[_0x5ea4e9[_0x8967('0x9')]]['routeid']=_0x5ea4e9[_0x8967('0x39')];}if(!_[_0x8967('0x1b')](_0x5ea4e9['variable'][_0x8967('0x45')])){channels[_0x5ea4e9[_0x8967('0x9')]][_0x8967('0x45')]=_0x5ea4e9[_0x8967('0x39')];}}}catch(_0x236364){utils[_0x8967('0x19')](_0x236364[_0x8967('0x23')]);}};exports[_0x8967('0x46')]=function(_0x360598){try{if(!_[_0x8967('0x1b')](channels[_0x360598[_0x8967('0x9')]])){if(_0x360598[_0x8967('0x47')][_0x8967('0x48')]()==_0x8967('0x49')&&_[_0x8967('0x4a')](_0x360598[_0x8967('0x4b')][_0x8967('0x48')](),_0x8967('0x4c'))){var _0x3c4f05=_0x360598[_0x8967('0x4b')][_0x8967('0x4d')]('=');var _0x97d537=_0x3c4f05[0x0][_0x8967('0x4e')](_0x3c4f05[0x0]['lastIndexOf']('(')+0x1,_0x3c4f05[0x0][_0x8967('0x4f')](')'));var _0x59f04e=_0x3c4f05[0x1];channels[_0x360598[_0x8967('0x9')]][_0x97d537]=_0x59f04e;}if(!_[_0x8967('0x50')]([_0x8967('0x24'),_0x8967('0x51'),_0x8967('0x52'),_0x8967('0x49'),_0x8967('0x53')],_0x360598[_0x8967('0x47')][_0x8967('0x48')]())){channels[_0x360598[_0x8967('0x9')]][_0x8967('0x3e')]=_0x360598[_0x8967('0x47')];channels[_0x360598[_0x8967('0x9')]][_0x8967('0x40')]=_0x360598[_0x8967('0x4b')];}}}catch(_0x4cc85a){utils[_0x8967('0x19')](_0x4cc85a[_0x8967('0x23')]);}}; \ No newline at end of file +var _0xa94f=['lodash','NO\x20ANSWER','FAILED','ANSWERED','BUSY','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','accountcode','destination','callerid','getUserByInternal','then','UserId','request','CreateVoiceCallReport','calleridnum','now','DOCUMENTATION','error','stack','newstate','isNil','systemanswertime','linkedid','channelstate','context','transfer','destinationchannel','answertime','disposition','toNumber','hangup','calleridname','endtime','diffTime','starttime','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','musiconholdstart','musiconholdstop','musiconholdstartAt','mohtime','varset','variable','xmd-originatecalleridnum','value','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','lastapplication','lastdata','xmd-contactid','ContactId','type','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','noop'];(function(_0x26dfc5,_0x138166){var _0x566350=function(_0x28b148){while(--_0x28b148){_0x26dfc5['push'](_0x26dfc5['shift']());}};_0x566350(++_0x138166);}(_0xa94f,0x98));var _0xfa94=function(_0x2c4da8,_0x3c3ef5){_0x2c4da8=_0x2c4da8-0x0;var _0x555447=_0xa94f[_0x2c4da8];return _0x555447;};'use strict';var _=require(_0xfa94('0x0'));var util=require('util');var utils=require('./utils');var dispositions=[_0xfa94('0x1'),_0xfa94('0x2'),'FAILED',_0xfa94('0x1'),_0xfa94('0x1'),_0xfa94('0x1'),_0xfa94('0x3'),_0xfa94('0x4'),_0xfa94('0x2'),_0xfa94('0x2'),_0xfa94('0x2')];var channels={};function writeDB(_0x5322a0){utils['info'](util[_0xfa94('0x5')](_0xfa94('0x6'),_0x5322a0[_0xfa94('0x7')],_0x5322a0[_0xfa94('0x8')],_0x5322a0['type'],_0x5322a0[_0xfa94('0x9')],_0x5322a0['source'],_0x5322a0[_0xfa94('0xa')],_0x5322a0[_0xfa94('0xb')],_0x5322a0['disposition']));if(_0x5322a0[_0xfa94('0x9')]){utils[_0xfa94('0xc')](_0x5322a0['accountcode'])[_0xfa94('0xd')](function(_0x2c91f4){if(_0x2c91f4){_0x5322a0[_0xfa94('0xe')]=_0x2c91f4['id'];}utils[_0xfa94('0xf')](_0xfa94('0x10'),_0x5322a0);});}else{utils[_0xfa94('0xf')](_0xfa94('0x10'),_0x5322a0);}if(channels[_0x5322a0[_0xfa94('0x7')]]){delete channels[_0x5322a0['uniqueid']];}}exports['newchannel']=function(_0x2c55ee){try{if(_0x2c55ee[_0xfa94('0x7')]==_0x2c55ee['linkedid']&&_0x2c55ee[_0xfa94('0x8')]!='OutgoingSpoolFailed'){channels[_0x2c55ee['uniqueid']]={'uniqueid':_0x2c55ee['uniqueid'],'accountcode':_0x2c55ee[_0xfa94('0x9')],'source':_0x2c55ee[_0xfa94('0x11')],'destination':_0x2c55ee['exten'],'destinationcontext':_0x2c55ee['context'],'channel':_0x2c55ee['channel'],'starttime':utils[_0xfa94('0x12')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xfa94('0x1'),'amaflags':_0xfa94('0x13')};}}catch(_0x3e232e){utils[_0xfa94('0x14')](_0x3e232e[_0xfa94('0x15')]);}};exports[_0xfa94('0x16')]=function(_0xcc57bb){try{if(!_[_0xfa94('0x17')](channels[_0xcc57bb[_0xfa94('0x7')]])&&_0xcc57bb['channelstate']==0x6){if(_[_0xfa94('0x17')](channels[_0xcc57bb[_0xfa94('0x7')]][_0xfa94('0x18')])){channels[_0xcc57bb[_0xfa94('0x7')]]['systemanswertime']=utils[_0xfa94('0x12')]();}}else if(!_['isNil'](channels[_0xcc57bb[_0xfa94('0x19')]])&&_0xcc57bb[_0xfa94('0x1a')]==0x6&&_0xcc57bb[_0xfa94('0x1b')]!=_0xfa94('0x1c')){channels[_0xcc57bb[_0xfa94('0x19')]]['accountcode']=_0xcc57bb['accountcode'];channels[_0xcc57bb['linkedid']][_0xfa94('0x1d')]=_0xcc57bb['channel'];if(_['isNil'](channels[_0xcc57bb[_0xfa94('0x19')]]['answertime'])){channels[_0xcc57bb[_0xfa94('0x19')]][_0xfa94('0x1e')]=utils[_0xfa94('0x12')]();}channels[_0xcc57bb['linkedid']][_0xfa94('0x1f')]=dispositions[_[_0xfa94('0x20')](_0xcc57bb[_0xfa94('0x1a')])]||_0xfa94('0x3');}}catch(_0x38df96){utils[_0xfa94('0x14')](_0x38df96[_0xfa94('0x15')]);}};exports[_0xfa94('0x21')]=function(_0x2fcdc6){try{if(!_[_0xfa94('0x17')](channels[_0x2fcdc6[_0xfa94('0x7')]])){if(_[_0xfa94('0x17')](channels[_0x2fcdc6['uniqueid']][_0xfa94('0xb')])){channels[_0x2fcdc6[_0xfa94('0x7')]]['callerid']=_0x2fcdc6[_0xfa94('0x22')]+'\x20<'+_0x2fcdc6[_0xfa94('0x11')]+'>';}channels[_0x2fcdc6[_0xfa94('0x7')]][_0xfa94('0x23')]=utils[_0xfa94('0x12')]();channels[_0x2fcdc6['uniqueid']]['duration']=utils[_0xfa94('0x24')](channels[_0x2fcdc6[_0xfa94('0x7')]]['endtime'],channels[_0x2fcdc6[_0xfa94('0x7')]][_0xfa94('0x25')]);channels[_0x2fcdc6[_0xfa94('0x7')]]['billableseconds']=channels[_0x2fcdc6[_0xfa94('0x7')]]['answertime']?utils[_0xfa94('0x24')](channels[_0x2fcdc6[_0xfa94('0x7')]][_0xfa94('0x23')],channels[_0x2fcdc6[_0xfa94('0x7')]][_0xfa94('0x1e')]):0x0;writeDB(channels[_0x2fcdc6[_0xfa94('0x7')]]);}}catch(_0xd34b83){utils[_0xfa94('0x14')](_0xd34b83[_0xfa94('0x15')]);}};exports[_0xfa94('0x26')]=function(_0x31b164){try{if(!_['isNil'](channels[_0x31b164['localtwolinkedid']])){if(channels[_0x31b164[_0xfa94('0x27')]]['channel']==_0x31b164[_0xfa94('0x28')]){channels[_0x31b164[_0xfa94('0x27')]][_0xfa94('0x1d')]=_0x31b164[_0xfa94('0x29')];channels[_0x31b164[_0xfa94('0x27')]][_0xfa94('0x2a')]=_0xfa94('0x2b');}else if(channels[_0x31b164['localtwolinkedid']][_0xfa94('0x8')]=_0x31b164[_0xfa94('0x2c')]){channels[_0x31b164[_0xfa94('0x27')]][_0xfa94('0x1d')]=_0x31b164['origtransfererchannel'];channels[_0x31b164[_0xfa94('0x27')]]['userfield']=_0xfa94('0x2b');}}}catch(_0xcf472d){utils['error'](_0xcf472d[_0xfa94('0x15')]);}};exports[_0xfa94('0x2d')]=function(_0x2c9616){try{if(!_[_0xfa94('0x17')](channels[_0x2c9616[_0xfa94('0x7')]])){channels[_0x2c9616[_0xfa94('0x7')]]['musiconholdstartAt']=utils[_0xfa94('0x12')]();}}catch(_0x961223){utils[_0xfa94('0x14')](_0x961223[_0xfa94('0x15')]);}};exports[_0xfa94('0x2e')]=function(_0x48ff40){try{if(!_[_0xfa94('0x17')](channels[_0x48ff40[_0xfa94('0x7')]])){if(!_[_0xfa94('0x17')](channels[_0x48ff40['uniqueid']][_0xfa94('0x2f')])){channels[_0x48ff40[_0xfa94('0x7')]][_0xfa94('0x30')]+=utils[_0xfa94('0x24')](utils[_0xfa94('0x12')](),channels[_0x48ff40[_0xfa94('0x7')]][_0xfa94('0x2f')]);delete channels[_0x48ff40[_0xfa94('0x7')]]['musiconholdstartAt'];}}}catch(_0x1c1678){utils[_0xfa94('0x14')](_0x1c1678['stack']);}};exports[_0xfa94('0x31')]=function(_0x1249af){try{if(!_['isNil'](channels[_0x1249af['uniqueid']])){if(!_[_0xfa94('0x17')](_0x1249af[_0xfa94('0x32')][_0xfa94('0x33')])){channels[_0x1249af['uniqueid']]['source']=_0x1249af[_0xfa94('0x34')];}if(!_[_0xfa94('0x17')](_0x1249af[_0xfa94('0x32')]['xmd-phone'])){channels[_0x1249af[_0xfa94('0x7')]]['destination']=_0x1249af[_0xfa94('0x34')];channels[_0x1249af[_0xfa94('0x7')]][_0xfa94('0xb')]='\x22'+_0x1249af['value']+_0xfa94('0x35')+_0x1249af[_0xfa94('0x34')]+'>';}if(!_[_0xfa94('0x17')](_0x1249af[_0xfa94('0x32')][_0xfa94('0x36')])||!_[_0xfa94('0x17')](_0x1249af[_0xfa94('0x32')][_0xfa94('0x37')])){channels[_0x1249af[_0xfa94('0x7')]][_0xfa94('0xb')]=_0x1249af[_0xfa94('0x34')];}if(!_[_0xfa94('0x17')](_0x1249af['variable'][_0xfa94('0x38')])||!_[_0xfa94('0x17')](_0x1249af['variable']['xmcs-queue'])){channels[_0x1249af[_0xfa94('0x7')]][_0xfa94('0x39')]='Queue';channels[_0x1249af[_0xfa94('0x7')]][_0xfa94('0x3a')]=_0x1249af['value'];channels[_0x1249af[_0xfa94('0x7')]]['queue']=!![];}if(!_[_0xfa94('0x17')](_0x1249af[_0xfa94('0x32')][_0xfa94('0x3b')])){channels[_0x1249af[_0xfa94('0x7')]][_0xfa94('0x3c')]=_0x1249af[_0xfa94('0x34')];}if(!_[_0xfa94('0x17')](_0x1249af[_0xfa94('0x32')]['xmd-cdrtype'])){channels[_0x1249af[_0xfa94('0x7')]][_0xfa94('0x3d')]=_0x1249af[_0xfa94('0x34')];}if(!_[_0xfa94('0x17')](_0x1249af[_0xfa94('0x32')]['outboundrouteid'])){channels[_0x1249af[_0xfa94('0x7')]][_0xfa94('0x3e')]=_0x1249af[_0xfa94('0x34')];}if(!_[_0xfa94('0x17')](_0x1249af['variable'][_0xfa94('0x3f')])){channels[_0x1249af[_0xfa94('0x7')]]['sipcallid']=_0x1249af[_0xfa94('0x34')];}}}catch(_0xc835cc){utils[_0xfa94('0x14')](_0xc835cc['stack']);}};exports[_0xfa94('0x40')]=function(_0x589aaf){try{if(!_[_0xfa94('0x17')](channels[_0x589aaf['uniqueid']])){if(_0x589aaf[_0xfa94('0x41')][_0xfa94('0x42')]()==_0xfa94('0x43')&&_[_0xfa94('0x44')](_0x589aaf[_0xfa94('0x45')][_0xfa94('0x42')](),_0xfa94('0x46'))){var _0x1c2174=_0x589aaf[_0xfa94('0x45')][_0xfa94('0x47')]('=');var _0x222c91=_0x1c2174[0x0][_0xfa94('0x48')](_0x1c2174[0x0][_0xfa94('0x49')]('(')+0x1,_0x1c2174[0x0][_0xfa94('0x49')](')'));var _0x3dfda2=_0x1c2174[0x1];channels[_0x589aaf[_0xfa94('0x7')]][_0x222c91]=_0x3dfda2;}if(!_[_0xfa94('0x4a')]([_0xfa94('0x21'),_0xfa94('0x4b'),'execif',_0xfa94('0x43'),'gotoif'],_0x589aaf[_0xfa94('0x41')][_0xfa94('0x42')]())){channels[_0x589aaf['uniqueid']][_0xfa94('0x39')]=_0x589aaf[_0xfa94('0x41')];channels[_0x589aaf['uniqueid']][_0xfa94('0x3a')]=_0x589aaf['appdata'];}}}catch(_0x3c2b5f){utils[_0xfa94('0x14')](_0x3c2b5f['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index d7ae954..8c14bf2 100644 --- a/server/services/xdr/core.controller.js +++ b/server/services/xdr/core.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc97=['SHUTDOWN','FULLYBOOTED','error','close','managerevent','./utils','lodash','connect','CONNECTED','info'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0xdc97,0x13b));var _0x7dc9=function(_0x52c346,_0x3c11af){_0x52c346=_0x52c346-0x0;var _0x49596a=_0xdc97[_0x52c346];return _0x49596a;};'use strict';var utils=require(_0x7dc9('0x0'));var _=require(_0x7dc9('0x1'));exports[_0x7dc9('0x2')]=function(){utils['info'](_0x7dc9('0x3'));};exports['shutdown']=function(){utils[_0x7dc9('0x4')](_0x7dc9('0x5'));};exports['fullybooted']=function(){utils[_0x7dc9('0x4')](_0x7dc9('0x6'));};exports[_0x7dc9('0x7')]=function(_0x3ba3ca){utils['error'](_0x3ba3ca);};exports[_0x7dc9('0x8')]=function(){utils['info']('CLOSE');};exports[_0x7dc9('0x9')]=function(_0x23737d){}; \ No newline at end of file +var _0x4819=['SHUTDOWN','fullybooted','FULLYBOOTED','CLOSE','managerevent','lodash','connect','info','CONNECTED','shutdown'];(function(_0x2fbbd1,_0x5a2cf0){var _0x3ecf39=function(_0x189b8d){while(--_0x189b8d){_0x2fbbd1['push'](_0x2fbbd1['shift']());}};_0x3ecf39(++_0x5a2cf0);}(_0x4819,0xcd));var _0x9481=function(_0x291276,_0x5a4690){_0x291276=_0x291276-0x0;var _0x303ab3=_0x4819[_0x291276];return _0x303ab3;};'use strict';var utils=require('./utils');var _=require(_0x9481('0x0'));exports[_0x9481('0x1')]=function(){utils[_0x9481('0x2')](_0x9481('0x3'));};exports[_0x9481('0x4')]=function(){utils[_0x9481('0x2')](_0x9481('0x5'));};exports[_0x9481('0x6')]=function(){utils[_0x9481('0x2')](_0x9481('0x7'));};exports['error']=function(_0x4d9e3a){utils['error'](_0x4d9e3a);};exports['close']=function(){utils[_0x9481('0x2')](_0x9481('0x8'));};exports[_0x9481('0x9')]=function(_0x3278ff){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index c8bf10c..2583e89 100644 --- a/server/services/xdr/dials.controller.js +++ b/server/services/xdr/dials.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd66d=['startsWith','appdata','split','error','stack','isNil','outboundrouteid','value','assign','now','lastevent','called','ANSWER','answertime','hangup','complete','duration','diffTime','starttime','endtime','billableseconds','lodash','./utils','format','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','application','toLowerCase','set'];(function(_0x220b5e,_0xd1907){var _0x3abc14=function(_0x5366ea){while(--_0x5366ea){_0x220b5e['push'](_0x220b5e['shift']());}};_0x3abc14(++_0xd1907);}(_0xd66d,0x12d));var _0xdd66=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xd66d[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xdd66('0x0'));var util=require('util');var utils=require(_0xdd66('0x1'));var dials={};function writeDB(_0x5c8282){utils['info'](util[_0xdd66('0x2')]('DIAL|%s|%s|%s|%s|%s|%s',_0x5c8282[_0xdd66('0x3')],_0x5c8282[_0xdd66('0x4')],_0x5c8282['dialstring'],_0x5c8282[_0xdd66('0x5')],_0x5c8282[_0xdd66('0x6')],_0x5c8282[_0xdd66('0x7')]));utils[_0xdd66('0x8')](_0xdd66('0x9'),_0x5c8282);delete dials[_0x5c8282[_0xdd66('0x3')]];}exports[_0xdd66('0xa')]=function(_0x23a269){try{if(_0x23a269[_0xdd66('0xb')][_0xdd66('0xc')]()==_0xdd66('0xd')&&_[_0xdd66('0xe')](_0x23a269[_0xdd66('0xf')][_0xdd66('0xc')](),'cdr(routeid)')){var _0x4d82b3=_0x23a269[_0xdd66('0xf')][_0xdd66('0x10')]('=');dials[_0x23a269['uniqueid']]={'routeId':_0x4d82b3[0x1]};}}catch(_0x38f188){utils[_0xdd66('0x11')](_0x38f188[_0xdd66('0x12')]);}};exports['varset']=function(_0x41520c){try{if(!_[_0xdd66('0x13')](_0x41520c['variable'][_0xdd66('0x14')])){dials[_0x41520c[_0xdd66('0x3')]]={'routeId':_0x41520c[_0xdd66('0x15')]};}}catch(_0x54cbc9){utils[_0xdd66('0x11')](_0x54cbc9[_0xdd66('0x12')]);}};exports['dialbegin']=function(_0x25ec43){try{if(!_[_0xdd66('0x13')](dials[_0x25ec43[_0xdd66('0x3')]])){dials[_0x25ec43[_0xdd66('0x3')]]=_[_0xdd66('0x16')](dials[_0x25ec43['uniqueid']],_0x25ec43);dials[_0x25ec43[_0xdd66('0x3')]]['starttime']=utils[_0xdd66('0x17')]();dials[_0x25ec43[_0xdd66('0x3')]][_0xdd66('0x18')]=_0xdd66('0x19');}}catch(_0x57e881){utils['error'](_0x57e881[_0xdd66('0x12')]);}};exports['dialend']=function(_0x2de994){try{if(!_[_0xdd66('0x13')](dials[_0x2de994[_0xdd66('0x3')]])){dials[_0x2de994['uniqueid']][_0xdd66('0x7')]=_0x2de994[_0xdd66('0x7')];if(_0x2de994[_0xdd66('0x7')]==_0xdd66('0x1a')){dials[_0x2de994[_0xdd66('0x3')]]=_['assign'](dials[_0x2de994['uniqueid']],_0x2de994);dials[_0x2de994['uniqueid']][_0xdd66('0x1b')]=utils[_0xdd66('0x17')]();dials[_0x2de994[_0xdd66('0x3')]][_0xdd66('0x18')]='connect';}}}catch(_0x24f00d){utils[_0xdd66('0x11')](_0x24f00d[_0xdd66('0x12')]);}};exports[_0xdd66('0x1c')]=function(_0x1e9e08){try{if(!_['isNil'](dials[_0x1e9e08['uniqueid']])){dials[_0x1e9e08[_0xdd66('0x3')]]=_[_0xdd66('0x16')](dials[_0x1e9e08[_0xdd66('0x3')]],{'endtime':utils['now'](),'lastevent':_0xdd66('0x1d')});dials[_0x1e9e08[_0xdd66('0x3')]][_0xdd66('0x1e')]=utils[_0xdd66('0x1f')](dials[_0x1e9e08[_0xdd66('0x3')]]['endtime'],dials[_0x1e9e08['uniqueid']][_0xdd66('0x20')]);dials[_0x1e9e08[_0xdd66('0x3')]]['holdtime']=utils[_0xdd66('0x1f')](dials[_0x1e9e08['uniqueid']][_0xdd66('0x1b')]||dials[_0x1e9e08['uniqueid']][_0xdd66('0x21')],dials[_0x1e9e08[_0xdd66('0x3')]]['starttime']);dials[_0x1e9e08['uniqueid']][_0xdd66('0x22')]=dials[_0x1e9e08[_0xdd66('0x3')]][_0xdd66('0x1b')]?utils[_0xdd66('0x1f')](dials[_0x1e9e08[_0xdd66('0x3')]]['endtime'],dials[_0x1e9e08[_0xdd66('0x3')]][_0xdd66('0x1b')]):0x0;writeDB(dials[_0x1e9e08[_0xdd66('0x3')]]);}}catch(_0x5ad77b){utils['error'](_0x5ad77b[_0xdd66('0x12')]);}}; \ No newline at end of file +var _0x8689=['stack','varset','isNil','outboundrouteid','value','assign','now','lastevent','called','dialend','ANSWER','answertime','connect','complete','duration','diffTime','endtime','holdtime','lodash','util','./utils','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','application','toLowerCase','startsWith','appdata','cdr(routeid)','split','error'];(function(_0x246426,_0x505c21){var _0x320fcf=function(_0x5f50dc){while(--_0x5f50dc){_0x246426['push'](_0x246426['shift']());}};_0x320fcf(++_0x505c21);}(_0x8689,0x14a));var _0x9868=function(_0x47ea92,_0x1fb896){_0x47ea92=_0x47ea92-0x0;var _0x5b8840=_0x8689[_0x47ea92];return _0x5b8840;};'use strict';var _=require(_0x9868('0x0'));var util=require(_0x9868('0x1'));var utils=require(_0x9868('0x2'));var dials={};function writeDB(_0x9a6aad){utils['info'](util[_0x9868('0x3')](_0x9868('0x4'),_0x9a6aad[_0x9868('0x5')],_0x9a6aad[_0x9868('0x6')],_0x9a6aad[_0x9868('0x7')],_0x9a6aad[_0x9868('0x8')],_0x9a6aad[_0x9868('0x9')],_0x9a6aad[_0x9868('0xa')]));utils[_0x9868('0xb')](_0x9868('0xc'),_0x9a6aad);delete dials[_0x9a6aad['uniqueid']];}exports[_0x9868('0xd')]=function(_0x53b93e){try{if(_0x53b93e[_0x9868('0xe')][_0x9868('0xf')]()=='set'&&_[_0x9868('0x10')](_0x53b93e[_0x9868('0x11')][_0x9868('0xf')](),_0x9868('0x12'))){var _0x1d9e86=_0x53b93e[_0x9868('0x11')][_0x9868('0x13')]('=');dials[_0x53b93e[_0x9868('0x5')]]={'routeId':_0x1d9e86[0x1]};}}catch(_0x5926d6){utils[_0x9868('0x14')](_0x5926d6[_0x9868('0x15')]);}};exports[_0x9868('0x16')]=function(_0x361f96){try{if(!_[_0x9868('0x17')](_0x361f96['variable'][_0x9868('0x18')])){dials[_0x361f96[_0x9868('0x5')]]={'routeId':_0x361f96[_0x9868('0x19')]};}}catch(_0x291c21){utils[_0x9868('0x14')](_0x291c21['stack']);}};exports['dialbegin']=function(_0x15b2cf){try{if(!_[_0x9868('0x17')](dials[_0x15b2cf['uniqueid']])){dials[_0x15b2cf[_0x9868('0x5')]]=_[_0x9868('0x1a')](dials[_0x15b2cf[_0x9868('0x5')]],_0x15b2cf);dials[_0x15b2cf[_0x9868('0x5')]]['starttime']=utils[_0x9868('0x1b')]();dials[_0x15b2cf[_0x9868('0x5')]][_0x9868('0x1c')]=_0x9868('0x1d');}}catch(_0x46f989){utils[_0x9868('0x14')](_0x46f989[_0x9868('0x15')]);}};exports[_0x9868('0x1e')]=function(_0x4a9e66){try{if(!_['isNil'](dials[_0x4a9e66[_0x9868('0x5')]])){dials[_0x4a9e66[_0x9868('0x5')]][_0x9868('0xa')]=_0x4a9e66[_0x9868('0xa')];if(_0x4a9e66[_0x9868('0xa')]==_0x9868('0x1f')){dials[_0x4a9e66[_0x9868('0x5')]]=_[_0x9868('0x1a')](dials[_0x4a9e66[_0x9868('0x5')]],_0x4a9e66);dials[_0x4a9e66[_0x9868('0x5')]][_0x9868('0x20')]=utils[_0x9868('0x1b')]();dials[_0x4a9e66[_0x9868('0x5')]][_0x9868('0x1c')]=_0x9868('0x21');}}}catch(_0x1e0f39){utils[_0x9868('0x14')](_0x1e0f39['stack']);}};exports['hangup']=function(_0x386ea2){try{if(!_['isNil'](dials[_0x386ea2[_0x9868('0x5')]])){dials[_0x386ea2[_0x9868('0x5')]]=_[_0x9868('0x1a')](dials[_0x386ea2[_0x9868('0x5')]],{'endtime':utils[_0x9868('0x1b')](),'lastevent':_0x9868('0x22')});dials[_0x386ea2[_0x9868('0x5')]][_0x9868('0x23')]=utils[_0x9868('0x24')](dials[_0x386ea2[_0x9868('0x5')]][_0x9868('0x25')],dials[_0x386ea2[_0x9868('0x5')]]['starttime']);dials[_0x386ea2[_0x9868('0x5')]][_0x9868('0x26')]=utils[_0x9868('0x24')](dials[_0x386ea2[_0x9868('0x5')]]['answertime']||dials[_0x386ea2['uniqueid']][_0x9868('0x25')],dials[_0x386ea2[_0x9868('0x5')]]['starttime']);dials[_0x386ea2[_0x9868('0x5')]]['billableseconds']=dials[_0x386ea2[_0x9868('0x5')]][_0x9868('0x20')]?utils['diffTime'](dials[_0x386ea2[_0x9868('0x5')]][_0x9868('0x25')],dials[_0x386ea2[_0x9868('0x5')]][_0x9868('0x20')]):0x0;writeDB(dials[_0x386ea2['uniqueid']]);}}catch(_0x413a22){utils[_0x9868('0x14')](_0x413a22[_0x9868('0x15')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 146a61c..98ff70e 100644 --- a/server/services/xdr/index.js +++ b/server/services/xdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6615=['./core.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','dialbegin','dialend','asterisk-manager','../../config/environment','asterisk','port','username','keepConnected','xdr','disabled','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller'];(function(_0x282a93,_0x477da5){var _0x2415c4=function(_0x45470d){while(--_0x45470d){_0x282a93['push'](_0x282a93['shift']());}};_0x2415c4(++_0x477da5);}(_0x6615,0x109));var _0x5661=function(_0x1722bf,_0x2fa7f4){_0x1722bf=_0x1722bf-0x0;var _0x58c607=_0x6615[_0x1722bf];return _0x58c607;};var AsteriskManager=require(_0x5661('0x0'));var config=require(_0x5661('0x1'));var utils=require('./utils');var ami=new AsteriskManager(config[_0x5661('0x2')][_0x5661('0x3')],config['asterisk']['ip'],config[_0x5661('0x2')][_0x5661('0x4')],config['asterisk']['password'],!![]);ami[_0x5661('0x5')]();if(config[_0x5661('0x6')]&&config[_0x5661('0x6')][_0x5661('0x7')]){utils[_0x5661('0x8')]('XDR\x20DISABLED');}else{var agents=require(_0x5661('0x9'));var calls=require(_0x5661('0xa'));var queues=require(_0x5661('0xb'));var recordings=require(_0x5661('0xc'));var members=require('./members.controller');var dials=require(_0x5661('0xd'));var transfers=require(_0x5661('0xe'));var core=require(_0x5661('0xf'));ami['on']('connect',core[_0x5661('0x10')]);ami['on']('shutdown',core[_0x5661('0x11')]);ami['on'](_0x5661('0x12'),core[_0x5661('0x12')]);ami['on'](_0x5661('0x13'),core[_0x5661('0x13')]);ami['on']('close',core['close']);ami['on'](_0x5661('0x14'),core[_0x5661('0x14')]);ami['on'](_0x5661('0x15'),function(_0xd5786a){try{members[_0x5661('0x15')](_0xd5786a);}catch(_0x540fbf){utils[_0x5661('0x13')](_0x540fbf);}});ami['on'](_0x5661('0x16'),function(_0x576f8e){try{agents[_0x5661('0x16')](_0x576f8e);}catch(_0x20646c){utils['error'](_0x20646c);}});ami['on'](_0x5661('0x17'),function(_0xb3b90d){try{agents[_0x5661('0x17')](_0xb3b90d);}catch(_0x1bbbaa){utils[_0x5661('0x13')](_0x1bbbaa);}});ami['on'](_0x5661('0x18'),function(_0x4fba40){try{agents[_0x5661('0x18')](_0x4fba40);queues['agentconnect'](_0x4fba40);}catch(_0x2da437){utils[_0x5661('0x13')](_0x2da437);}});ami['on'](_0x5661('0x19'),function(_0x2fc564){try{agents[_0x5661('0x19')](_0x2fc564);queues[_0x5661('0x19')](_0x2fc564);members['agentcomplete'](_0x2fc564);}catch(_0x589ae7){utils[_0x5661('0x13')](_0x589ae7);}});ami['on']('queuecallerabandon',function(_0x358d13){try{agents[_0x5661('0x1a')](_0x358d13);queues[_0x5661('0x1a')](_0x358d13);}catch(_0x35bf11){utils[_0x5661('0x13')](_0x35bf11);}});ami['on'](_0x5661('0x1b'),function(_0x2c024f){try{queues[_0x5661('0x1b')](_0x2c024f);recordings[_0x5661('0x1b')](_0x2c024f);}catch(_0x2dfa54){utils[_0x5661('0x13')](_0x2dfa54);}});ami['on'](_0x5661('0x1c'),function(_0x4b5a73){try{queues[_0x5661('0x1c')](_0x4b5a73);}catch(_0x56932d){utils[_0x5661('0x13')](_0x56932d);}});ami['on'](_0x5661('0x1d'),function(_0x168e24){try{queues[_0x5661('0x1d')](_0x168e24);calls[_0x5661('0x1d')](_0x168e24);}catch(_0x5179bd){utils[_0x5661('0x13')](_0x5179bd);}});ami['on']('musiconholdstop',function(_0x50b66d){try{queues[_0x5661('0x1e')](_0x50b66d);calls['musiconholdstop'](_0x50b66d);}catch(_0x4bc0ee){utils[_0x5661('0x13')](_0x4bc0ee);}});ami['on'](_0x5661('0x1f'),function(_0x4f4ae8){try{calls['newstate'](_0x4f4ae8);recordings['newstate'](_0x4f4ae8);}catch(_0x4cdf99){utils[_0x5661('0x13')](_0x4cdf99);}});ami['on']('hangup',function(_0x525582){try{calls[_0x5661('0x20')](_0x525582);recordings['hangup'](_0x525582);dials[_0x5661('0x20')](_0x525582);agents[_0x5661('0x20')](_0x525582);queues[_0x5661('0x20')](_0x525582);}catch(_0x6f2543){utils[_0x5661('0x13')](_0x6f2543);}});ami['on'](_0x5661('0x21'),function(_0x5f1140){try{members[_0x5661('0x21')](_0x5f1140);}catch(_0x3d32e){utils[_0x5661('0x13')](_0x3d32e);}});ami['on']('blindtransfer',function(_0x45228f){try{queues[_0x5661('0x22')](_0x45228f);agents['blindtransfer'](_0x45228f);transfers[_0x5661('0x22')](_0x45228f);}catch(_0x408b82){utils[_0x5661('0x13')](_0x408b82);}});ami['on'](_0x5661('0x23'),function(_0x2db52f){try{queues[_0x5661('0x23')](_0x2db52f);transfers[_0x5661('0x23')](_0x2db52f);agents['attendedtransfer'](_0x2db52f);calls[_0x5661('0x23')](_0x2db52f);}catch(_0x11df52){utils[_0x5661('0x13')](_0x11df52);}});ami['on'](_0x5661('0x24'),function(_0x21874d){try{queues[_0x5661('0x24')](_0x21874d);recordings['varset'](_0x21874d);calls[_0x5661('0x24')](_0x21874d);dials['varset'](_0x21874d);}catch(_0x3c6576){utils[_0x5661('0x13')](_0x3c6576);}});ami['on'](_0x5661('0x25'),function(_0x2065c3){try{calls['newexten'](_0x2065c3);recordings['newexten'](_0x2065c3);dials[_0x5661('0x25')](_0x2065c3);}catch(_0x1b2f00){utils['error'](_0x1b2f00);}});ami['on']('newchannel',function(_0x3cbc2f){try{calls['newchannel'](_0x3cbc2f);recordings['newchannel'](_0x3cbc2f);}catch(_0x312b7d){utils['error'](_0x312b7d);}});ami['on'](_0x5661('0x26'),function(_0xf56d22){try{dials[_0x5661('0x26')](_0xf56d22);}catch(_0x19b337){utils[_0x5661('0x13')](_0x19b337);}});ami['on'](_0x5661('0x27'),function(_0x2bdbb8){try{dials[_0x5661('0x27')](_0x2bdbb8);}catch(_0x1167c1){utils['error'](_0x1167c1);}});} \ No newline at end of file +var _0x0b3c=['attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port','username','keepConnected','xdr','disabled','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer'];(function(_0x31ea6f,_0x5d2e87){var _0x164b40=function(_0x5d1924){while(--_0x5d1924){_0x31ea6f['push'](_0x31ea6f['shift']());}};_0x164b40(++_0x5d2e87);}(_0x0b3c,0x192));var _0xc0b3=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x0b3c[_0x421196];return _0x2738af;};var AsteriskManager=require(_0xc0b3('0x0'));var config=require(_0xc0b3('0x1'));var utils=require(_0xc0b3('0x2'));var ami=new AsteriskManager(config[_0xc0b3('0x3')][_0xc0b3('0x4')],config[_0xc0b3('0x3')]['ip'],config['asterisk'][_0xc0b3('0x5')],config[_0xc0b3('0x3')]['password'],!![]);ami[_0xc0b3('0x6')]();if(config[_0xc0b3('0x7')]&&config[_0xc0b3('0x7')][_0xc0b3('0x8')]){utils[_0xc0b3('0x9')]('XDR\x20DISABLED');}else{var agents=require(_0xc0b3('0xa'));var calls=require(_0xc0b3('0xb'));var queues=require(_0xc0b3('0xc'));var recordings=require(_0xc0b3('0xd'));var members=require(_0xc0b3('0xe'));var dials=require(_0xc0b3('0xf'));var transfers=require(_0xc0b3('0x10'));var core=require(_0xc0b3('0x11'));ami['on'](_0xc0b3('0x12'),core[_0xc0b3('0x12')]);ami['on'](_0xc0b3('0x13'),core[_0xc0b3('0x13')]);ami['on'](_0xc0b3('0x14'),core[_0xc0b3('0x14')]);ami['on'](_0xc0b3('0x15'),core[_0xc0b3('0x15')]);ami['on'](_0xc0b3('0x16'),core[_0xc0b3('0x16')]);ami['on'](_0xc0b3('0x17'),core['managerevent']);ami['on'](_0xc0b3('0x18'),function(_0x2a9753){try{members[_0xc0b3('0x18')](_0x2a9753);}catch(_0x5bfc02){utils[_0xc0b3('0x15')](_0x5bfc02);}});ami['on']('agentcalled',function(_0x463b05){try{agents[_0xc0b3('0x19')](_0x463b05);}catch(_0x3c5b65){utils[_0xc0b3('0x15')](_0x3c5b65);}});ami['on']('agentringnoanswer',function(_0x309d4d){try{agents[_0xc0b3('0x1a')](_0x309d4d);}catch(_0x177ea2){utils[_0xc0b3('0x15')](_0x177ea2);}});ami['on']('agentconnect',function(_0x6dea20){try{agents[_0xc0b3('0x1b')](_0x6dea20);queues[_0xc0b3('0x1b')](_0x6dea20);}catch(_0x2fd4b3){utils[_0xc0b3('0x15')](_0x2fd4b3);}});ami['on'](_0xc0b3('0x1c'),function(_0x246a79){try{agents['agentcomplete'](_0x246a79);queues[_0xc0b3('0x1c')](_0x246a79);members[_0xc0b3('0x1c')](_0x246a79);}catch(_0x460a79){utils[_0xc0b3('0x15')](_0x460a79);}});ami['on'](_0xc0b3('0x1d'),function(_0x51e13f){try{agents[_0xc0b3('0x1d')](_0x51e13f);queues['queuecallerabandon'](_0x51e13f);}catch(_0x28a1e3){utils['error'](_0x28a1e3);}});ami['on'](_0xc0b3('0x1e'),function(_0x8f8309){try{queues['queuecallerjoin'](_0x8f8309);recordings[_0xc0b3('0x1e')](_0x8f8309);}catch(_0x427ae1){utils[_0xc0b3('0x15')](_0x427ae1);}});ami['on']('queuecallerleave',function(_0x3c998){try{queues[_0xc0b3('0x1f')](_0x3c998);}catch(_0x1786b4){utils[_0xc0b3('0x15')](_0x1786b4);}});ami['on']('musiconholdstart',function(_0x5a4f33){try{queues[_0xc0b3('0x20')](_0x5a4f33);calls['musiconholdstart'](_0x5a4f33);}catch(_0x2ef214){utils[_0xc0b3('0x15')](_0x2ef214);}});ami['on'](_0xc0b3('0x21'),function(_0x567a38){try{queues[_0xc0b3('0x21')](_0x567a38);calls[_0xc0b3('0x21')](_0x567a38);}catch(_0x58b2c4){utils[_0xc0b3('0x15')](_0x58b2c4);}});ami['on'](_0xc0b3('0x22'),function(_0xc22e1f){try{calls[_0xc0b3('0x22')](_0xc22e1f);recordings[_0xc0b3('0x22')](_0xc22e1f);}catch(_0x63002c){utils['error'](_0x63002c);}});ami['on'](_0xc0b3('0x23'),function(_0x15948f){try{calls[_0xc0b3('0x23')](_0x15948f);recordings[_0xc0b3('0x23')](_0x15948f);dials['hangup'](_0x15948f);agents[_0xc0b3('0x23')](_0x15948f);queues[_0xc0b3('0x23')](_0x15948f);}catch(_0x420f8f){utils[_0xc0b3('0x15')](_0x420f8f);}});ami['on'](_0xc0b3('0x24'),function(_0x24b4f0){try{members[_0xc0b3('0x24')](_0x24b4f0);}catch(_0x148043){utils[_0xc0b3('0x15')](_0x148043);}});ami['on'](_0xc0b3('0x25'),function(_0x5e39f4){try{queues['blindtransfer'](_0x5e39f4);agents[_0xc0b3('0x25')](_0x5e39f4);transfers['blindtransfer'](_0x5e39f4);}catch(_0x114f58){utils[_0xc0b3('0x15')](_0x114f58);}});ami['on'](_0xc0b3('0x26'),function(_0x247636){try{queues['attendedtransfer'](_0x247636);transfers[_0xc0b3('0x26')](_0x247636);agents[_0xc0b3('0x26')](_0x247636);calls[_0xc0b3('0x26')](_0x247636);}catch(_0x51916e){utils[_0xc0b3('0x15')](_0x51916e);}});ami['on']('varset',function(_0x26789a){try{queues[_0xc0b3('0x27')](_0x26789a);recordings[_0xc0b3('0x27')](_0x26789a);calls[_0xc0b3('0x27')](_0x26789a);dials[_0xc0b3('0x27')](_0x26789a);}catch(_0x4d7792){utils['error'](_0x4d7792);}});ami['on'](_0xc0b3('0x28'),function(_0x33bed6){try{calls[_0xc0b3('0x28')](_0x33bed6);recordings[_0xc0b3('0x28')](_0x33bed6);dials[_0xc0b3('0x28')](_0x33bed6);}catch(_0x3106ce){utils['error'](_0x3106ce);}});ami['on'](_0xc0b3('0x29'),function(_0x398284){try{calls[_0xc0b3('0x29')](_0x398284);recordings[_0xc0b3('0x29')](_0x398284);}catch(_0xc29a99){utils['error'](_0xc29a99);}});ami['on'](_0xc0b3('0x2a'),function(_0x1e7e4f){try{dials[_0xc0b3('0x2a')](_0x1e7e4f);}catch(_0x4c1249){utils[_0xc0b3('0x15')](_0x4c1249);}});ami['on']('dialend',function(_0xec99ac){try{dials[_0xc0b3('0x2b')](_0xec99ac);}catch(_0x88023b){utils['error'](_0x88023b);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 5a9b038..b124e04 100644 --- a/server/services/xdr/members.controller.js +++ b/server/services/xdr/members.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb8c=['destination','destinationchannel','data1','util','./utils','Local/_attended@transfer','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','some','devicestatechange','state','INUSE','BUSY','voice','device','TALKING','now','agent','exitAt','duration','diffTime','enterAt','agentcomplete','isNil','assign','queue','source','data3'];(function(_0x5b0ac7,_0x22fd0e){var _0x3c1c4b=function(_0x541bd9){while(--_0x541bd9){_0x5b0ac7['push'](_0x5b0ac7['shift']());}};_0x3c1c4b(++_0x22fd0e);}(_0xbb8c,0x13e));var _0xcbb8=function(_0x4b83c1,_0x202cce){_0x4b83c1=_0x4b83c1-0x0;var _0x30c345=_0xbb8c[_0x4b83c1];return _0x30c345;};'use strict';var _=require('lodash');var util=require(_0xcbb8('0x0'));var utils=require(_0xcbb8('0x1'));var members={};var exclude=[_0xcbb8('0x2'),_0xcbb8('0x3')];function writeDB(_0x174b50){utils[_0xcbb8('0x4')](util[_0xcbb8('0x5')](_0xcbb8('0x6'),_0x174b50[_0xcbb8('0x7')],_0x174b50[_0xcbb8('0x8')],_0x174b50[_0xcbb8('0x9')],_0x174b50[_0xcbb8('0xa')],_0x174b50[_0xcbb8('0xb')],_0x174b50[_0xcbb8('0xc')]));if(_0x174b50['interface']){utils[_0xcbb8('0xd')](_0x174b50[_0xcbb8('0x8')])[_0xcbb8('0xe')](function(_0x5e544a){if(_0x5e544a){_0x174b50['membername']=_0x5e544a[_0xcbb8('0xf')];_0x174b50[_0xcbb8('0x10')]=_0x5e544a[_0xcbb8('0x10')];utils[_0xcbb8('0x11')](_0xcbb8('0x12'),_0x174b50);}else{utils[_0xcbb8('0x13')](_0x174b50[_0xcbb8('0x8')][_0xcbb8('0x14')]('/')[0x1])[_0xcbb8('0xe')](function(_0x19eb75){if(_0x19eb75){_0x174b50['membername']=_0x19eb75['name'];_0x174b50[_0xcbb8('0x10')]=_0x19eb75['internal'];utils[_0xcbb8('0x11')](_0xcbb8('0x12'),_0x174b50);}});}})['catch'](function(_0x2b1490){utils[_0xcbb8('0x15')](_0x2b1490);});}delete members[_0x174b50[_0xcbb8('0x8')]];}function startsWith(_0x320931,_0x5e7a9a){return _[_0xcbb8('0x16')](_0x320931,function(_0x10cf58){return _['startsWith'](_0x5e7a9a,_0x10cf58);});}exports[_0xcbb8('0x17')]=function(_0x35c643){switch(_0x35c643[_0xcbb8('0x18')]){case _0xcbb8('0x19'):case _0xcbb8('0x1a'):if(!startsWith(exclude,_0x35c643['device'])){members[_0x35c643['device']]={'channel':_0xcbb8('0x1b'),'interface':_0x35c643[_0xcbb8('0x1c')],'type':_0xcbb8('0x1d'),'enterAt':utils[_0xcbb8('0x1e')](),'role':_0xcbb8('0x1f')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x35c643[_0xcbb8('0x1c')]])){members[_0x35c643['device']][_0xcbb8('0x20')]=utils[_0xcbb8('0x1e')]();members[_0x35c643[_0xcbb8('0x1c')]][_0xcbb8('0x21')]=utils[_0xcbb8('0x22')](members[_0x35c643[_0xcbb8('0x1c')]][_0xcbb8('0x20')],members[_0x35c643['device']][_0xcbb8('0x23')]);if(members[_0x35c643[_0xcbb8('0x1c')]]['uniqueid']){writeDB(members[_0x35c643['device']]);}}default:break;}};exports[_0xcbb8('0x24')]=function(_0x5abf3f){if(!_[_0xcbb8('0x25')](members[_0x5abf3f['interface']])){members[_0x5abf3f[_0xcbb8('0x8')]]=_[_0xcbb8('0x26')](members[_0x5abf3f[_0xcbb8('0x8')]],{'data4':_0x5abf3f[_0xcbb8('0x27')],'uniqueid':_0x5abf3f[_0xcbb8('0x7')]});}};exports['cdr']=function(_0x3cf546){if(_0x3cf546[_0xcbb8('0x9')]){var _0x26447a=_0x3cf546[_0xcbb8('0x9')]['split']('-')[0x0];if(!_[_0xcbb8('0x25')](members[_0x26447a])){members[_0x26447a]=_[_0xcbb8('0x26')](members[_0x26447a],{'data1':members[_0x26447a]['data1']||_0x3cf546[_0xcbb8('0xc')],'data2':members[_0x26447a]['data2']||_0x3cf546[_0xcbb8('0x28')],'data3':members[_0x26447a][_0xcbb8('0x29')]||_0x3cf546[_0xcbb8('0x2a')],'uniqueid':members[_0x26447a][_0xcbb8('0x7')]||_0x3cf546[_0xcbb8('0x7')]});if(members[_0x26447a]['exitAt']){writeDB(members[_0x26447a]);}}}if(_0x3cf546[_0xcbb8('0x2b')]){var _0x3cd595=_0x3cf546[_0xcbb8('0x2b')][_0xcbb8('0x14')]('-')[0x0];if(!_[_0xcbb8('0x25')](members[_0x3cd595])){members[_0x3cd595]=_[_0xcbb8('0x26')](members[_0x3cd595],{'data1':members[_0x3cd595][_0xcbb8('0x2c')]||_0x3cf546[_0xcbb8('0xc')],'data2':members[_0x3cd595]['data2']||_0x3cf546['source'],'data3':members[_0x3cd595][_0xcbb8('0x29')]||_0x3cf546[_0xcbb8('0x2a')],'uniqueid':members[_0x3cd595][_0xcbb8('0x7')]||_0x3cf546[_0xcbb8('0x7')]});if(members[_0x3cd595][_0xcbb8('0x20')]){writeDB(members[_0x3cd595]);}}}}; \ No newline at end of file +var _0x3df6=['now','duration','enterAt','agentcomplete','queue','uniqueid','cdr','assign','source','data3','exitAt','destinationchannel','data1','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','MEMBER|%s|%s|%s|%s|%s|%s','channel','data2','membername','type','interface','getUserByInterface','internal','CreateMemberReport','getUserByName','split','then','name','request','error','some','startsWith','devicestatechange','state','BUSY','device','TALKING','agent','NOT_INUSE','isNil'];(function(_0x5852a7,_0x3d2333){var _0x2f01db=function(_0x14a169){while(--_0x14a169){_0x5852a7['push'](_0x5852a7['shift']());}};_0x2f01db(++_0x3d2333);}(_0x3df6,0xc2));var _0x63df=function(_0x32ac84,_0xce3856){_0x32ac84=_0x32ac84-0x0;var _0x4d5710=_0x3df6[_0x32ac84];return _0x4d5710;};'use strict';var _=require(_0x63df('0x0'));var util=require(_0x63df('0x1'));var utils=require(_0x63df('0x2'));var members={};var exclude=[_0x63df('0x3'),_0x63df('0x4')];function writeDB(_0x593a08){utils[_0x63df('0x5')](util['format'](_0x63df('0x6'),_0x593a08['uniqueid'],_0x593a08['interface'],_0x593a08[_0x63df('0x7')],_0x593a08[_0x63df('0x8')],_0x593a08[_0x63df('0x9')],_0x593a08[_0x63df('0xa')]));if(_0x593a08[_0x63df('0xb')]){utils[_0x63df('0xc')](_0x593a08[_0x63df('0xb')])['then'](function(_0x1ff470){if(_0x1ff470){_0x593a08[_0x63df('0x9')]=_0x1ff470['name'];_0x593a08['internal']=_0x1ff470[_0x63df('0xd')];utils['request'](_0x63df('0xe'),_0x593a08);}else{utils[_0x63df('0xf')](_0x593a08[_0x63df('0xb')][_0x63df('0x10')]('/')[0x1])[_0x63df('0x11')](function(_0x13129e){if(_0x13129e){_0x593a08[_0x63df('0x9')]=_0x13129e[_0x63df('0x12')];_0x593a08[_0x63df('0xd')]=_0x13129e['internal'];utils[_0x63df('0x13')](_0x63df('0xe'),_0x593a08);}});}})['catch'](function(_0x2ab1e7){utils[_0x63df('0x14')](_0x2ab1e7);});}delete members[_0x593a08[_0x63df('0xb')]];}function startsWith(_0x290cc9,_0x42eb60){return _[_0x63df('0x15')](_0x290cc9,function(_0x1fc74f){return _[_0x63df('0x16')](_0x42eb60,_0x1fc74f);});}exports[_0x63df('0x17')]=function(_0xa29fa1){switch(_0xa29fa1[_0x63df('0x18')]){case'INUSE':case _0x63df('0x19'):if(!startsWith(exclude,_0xa29fa1[_0x63df('0x1a')])){members[_0xa29fa1['device']]={'channel':'voice','interface':_0xa29fa1[_0x63df('0x1a')],'type':_0x63df('0x1b'),'enterAt':utils['now'](),'role':_0x63df('0x1c')};}break;case _0x63df('0x1d'):if(!_[_0x63df('0x1e')](members[_0xa29fa1[_0x63df('0x1a')]])){members[_0xa29fa1[_0x63df('0x1a')]]['exitAt']=utils[_0x63df('0x1f')]();members[_0xa29fa1[_0x63df('0x1a')]][_0x63df('0x20')]=utils['diffTime'](members[_0xa29fa1['device']]['exitAt'],members[_0xa29fa1['device']][_0x63df('0x21')]);if(members[_0xa29fa1[_0x63df('0x1a')]]['uniqueid']){writeDB(members[_0xa29fa1['device']]);}}default:break;}};exports[_0x63df('0x22')]=function(_0x1bda90){if(!_[_0x63df('0x1e')](members[_0x1bda90[_0x63df('0xb')]])){members[_0x1bda90['interface']]=_['assign'](members[_0x1bda90[_0x63df('0xb')]],{'data4':_0x1bda90[_0x63df('0x23')],'uniqueid':_0x1bda90[_0x63df('0x24')]});}};exports[_0x63df('0x25')]=function(_0x14c139){if(_0x14c139['channel']){var _0x3bc467=_0x14c139[_0x63df('0x7')][_0x63df('0x10')]('-')[0x0];if(!_[_0x63df('0x1e')](members[_0x3bc467])){members[_0x3bc467]=_[_0x63df('0x26')](members[_0x3bc467],{'data1':members[_0x3bc467]['data1']||_0x14c139['type'],'data2':members[_0x3bc467][_0x63df('0x8')]||_0x14c139[_0x63df('0x27')],'data3':members[_0x3bc467][_0x63df('0x28')]||_0x14c139['destination'],'uniqueid':members[_0x3bc467][_0x63df('0x24')]||_0x14c139['uniqueid']});if(members[_0x3bc467][_0x63df('0x29')]){writeDB(members[_0x3bc467]);}}}if(_0x14c139[_0x63df('0x2a')]){var _0xcbcd49=_0x14c139['destinationchannel'][_0x63df('0x10')]('-')[0x0];if(!_[_0x63df('0x1e')](members[_0xcbcd49])){members[_0xcbcd49]=_['assign'](members[_0xcbcd49],{'data1':members[_0xcbcd49][_0x63df('0x2b')]||_0x14c139[_0x63df('0xa')],'data2':members[_0xcbcd49][_0x63df('0x8')]||_0x14c139[_0x63df('0x27')],'data3':members[_0xcbcd49][_0x63df('0x28')]||_0x14c139[_0x63df('0x2c')],'uniqueid':members[_0xcbcd49][_0x63df('0x24')]||_0x14c139[_0x63df('0x24')]});if(members[_0xcbcd49]['exitAt']){writeDB(members[_0xcbcd49]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 6dd3abc..3fe3226 100644 --- a/server/services/xdr/queues.controller.js +++ b/server/services/xdr/queues.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6824=['queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','queuestatus','queuecallerexitAt','queueposition','queuecallerabandonAt','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','destaccountcode','lastAssignedTo','membername','reason','transfer','COMPLETEDBY','toUpperCase','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','mohtime','secondtransfereruniqueid','ATTENDED','secondtransfererexten','transfertargetlinkedid','clone','musiconholdstart','musiconholdstartAt','lodash','util','info','QUEUE|%s|%s|%s|%s|%s|%s|%s','channel','queue','accountcode','queuecallerexitreason','then','type','CreateVoiceQueueReport','request','transfereduniqueid','uniqueid','queuecallerjoin','assign','position','now','isNil','queuecallerleaveAt'];(function(_0x52d065,_0x31d24){var _0x49f7bc=function(_0x2f0966){while(--_0x2f0966){_0x52d065['push'](_0x52d065['shift']());}};_0x49f7bc(++_0x31d24);}(_0x6824,0x80));var _0x4682=function(_0x3c7a46,_0x415430){_0x3c7a46=_0x3c7a46-0x0;var _0xdb4682=_0x6824[_0x3c7a46];return _0xdb4682;};'use strict';var _=require(_0x4682('0x0'));var util=require(_0x4682('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x5b2ff2){utils[_0x4682('0x2')](util['format'](_0x4682('0x3'),_0x5b2ff2['uniqueid'],_0x5b2ff2[_0x4682('0x4')],_0x5b2ff2[_0x4682('0x5')],_0x5b2ff2['lastAssignedTo'],_0x5b2ff2['calleridnum'],_0x5b2ff2[_0x4682('0x6')],_0x5b2ff2[_0x4682('0x7')]));if(_0x5b2ff2[_0x4682('0x5')]){utils['getVoiceQueueByName'](_0x5b2ff2[_0x4682('0x5')])[_0x4682('0x8')](function(_0x27e120){if(_0x27e120){_0x5b2ff2[_0x4682('0x9')]=_0x27e120[_0x4682('0x9')];}utils['request'](_0x4682('0xa'),_0x5b2ff2);});}else{utils[_0x4682('0xb')](_0x4682('0xa'),_0x5b2ff2);}if(_0x5b2ff2[_0x4682('0xc')]){delete queues[_0x5b2ff2[_0x4682('0xc')]];}else{delete queues[_0x5b2ff2[_0x4682('0xd')]];}}exports[_0x4682('0xe')]=function(_0x42e2ef){queues[_0x42e2ef[_0x4682('0xd')]]=_[_0x4682('0xf')](_0x42e2ef,{'originalposition':_0x42e2ef[_0x4682('0x10')],'queuecallerjoinAt':utils[_0x4682('0x11')](),'mohtime':0x0});};exports['hangup']=function(_0x4697d4){if(!_[_0x4682('0x12')](queues[_0x4697d4[_0x4682('0xd')]])){if(queues[_0x4697d4[_0x4682('0xd')]][_0x4682('0x13')]){if(!queues[_0x4697d4['uniqueid']][_0x4682('0x14')]&&!queues[_0x4697d4[_0x4682('0xd')]][_0x4682('0x15')]){queues[_0x4697d4[_0x4682('0xd')]][_0x4682('0x16')]=!![];queues[_0x4697d4['uniqueid']][_0x4682('0x17')]=utils[_0x4682('0x11')]();queues[_0x4697d4[_0x4682('0xd')]][_0x4682('0x7')]=_0x4682('0x18');}writeDB(queues[_0x4697d4[_0x4682('0xd')]]);}else{if(queues[_0x4697d4[_0x4682('0xd')]][_0x4682('0xc')]){queues[queues[_0x4697d4[_0x4682('0xd')]]['transfereduniqueid']]=queues[_0x4697d4[_0x4682('0xd')]];queues[queues[_0x4697d4[_0x4682('0xd')]][_0x4682('0xc')]][_0x4682('0x19')]=0x2;delete queues[_0x4697d4[_0x4682('0xd')]];}}}};exports[_0x4682('0x1a')]=function(_0x3f6f47){if(!_[_0x4682('0x12')](_0x3f6f47[_0x4682('0x1b')][_0x4682('0x1c')])){if(!_[_0x4682('0x12')](queues[_0x3f6f47[_0x4682('0xd')]])){queues[_0x3f6f47[_0x4682('0xd')]][_0x4682('0x14')]=![];queues[_0x3f6f47['uniqueid']]['queuecallerabandonAt']=null;queues[_0x3f6f47[_0x4682('0xd')]]['queuecallerexit']=!![];queues[_0x3f6f47[_0x4682('0xd')]][_0x4682('0x1d')]=utils[_0x4682('0x11')]();queues[_0x3f6f47[_0x4682('0xd')]][_0x4682('0x7')]=_0x3f6f47['value']['toUpperCase']();writeDB(queues[_0x3f6f47[_0x4682('0xd')]]);}}else if(!_[_0x4682('0x12')](_0x3f6f47['variable'][_0x4682('0x1e')])){if(!_[_0x4682('0x12')](queues[_0x3f6f47['uniqueid']])&&!queues[_0x3f6f47[_0x4682('0xd')]][_0x4682('0x14')]){queues[_0x3f6f47[_0x4682('0xd')]][_0x4682('0x14')]=![];queues[_0x3f6f47[_0x4682('0xd')]][_0x4682('0x1f')]=null;queues[_0x3f6f47[_0x4682('0xd')]][_0x4682('0x15')]=!![];queues[_0x3f6f47[_0x4682('0xd')]][_0x4682('0x1d')]=utils[_0x4682('0x11')]();queues[_0x3f6f47[_0x4682('0xd')]]['queuecallerexitreason']=_0x4682('0x20');}}};exports[_0x4682('0x14')]=function(_0x4fad33){if(!_[_0x4682('0x12')](queues[_0x4fad33[_0x4682('0xd')]])){queues[_0x4fad33[_0x4682('0xd')]][_0x4682('0x15')]=![];queues[_0x4fad33[_0x4682('0xd')]][_0x4682('0x1d')]=null;queues[_0x4fad33[_0x4682('0xd')]][_0x4682('0x14')]=!![];queues[_0x4fad33[_0x4682('0xd')]][_0x4682('0x1f')]=utils[_0x4682('0x11')]();queues[_0x4fad33['uniqueid']][_0x4682('0x7')]=_0x4682('0x21');}};exports[_0x4682('0x22')]=function(_0x38065e){if(!_['isNil'](queues[_0x38065e[_0x4682('0xd')]])){queues[_0x38065e[_0x4682('0xd')]][_0x4682('0x22')]=!![];queues[_0x38065e['uniqueid']]['queuecallerleaveAt']=utils[_0x4682('0x11')]();queues[_0x38065e[_0x4682('0xd')]][_0x4682('0x23')]=utils['diffTime'](queues[_0x38065e[_0x4682('0xd')]][_0x4682('0x13')],queues[_0x38065e[_0x4682('0xd')]][_0x4682('0x24')]);queues[_0x38065e['uniqueid']][_0x4682('0x10')]=_0x38065e[_0x4682('0x10')];queues[_0x38065e['uniqueid']][_0x4682('0x25')]=_0x38065e[_0x4682('0x25')];queues[_0x38065e[_0x4682('0xd')]][_0x4682('0x26')]=_0x38065e['connectedlinenum'];queues[_0x38065e[_0x4682('0xd')]][_0x4682('0x27')]=_0x38065e[_0x4682('0x27')];}};exports[_0x4682('0x28')]=function(_0x568272){if(!_[_0x4682('0x12')](queues[_0x568272[_0x4682('0xd')]])){queues[_0x568272[_0x4682('0xd')]][_0x4682('0x14')]=![];queues[_0x568272['uniqueid']][_0x4682('0x14')]=![];queues[_0x568272['uniqueid']]['queuecallerabandonAt']=null;queues[_0x568272[_0x4682('0xd')]]['queuecallerexit']=![];queues[_0x568272['uniqueid']]['queuecallerexitAt']=null;queues[_0x568272[_0x4682('0xd')]]['assigned']=!![];queues[_0x568272[_0x4682('0xd')]][_0x4682('0x6')]=_0x568272[_0x4682('0x29')];queues[_0x568272['uniqueid']][_0x4682('0x2a')]=_0x568272['membername'];}};exports['agentcomplete']=function(_0x5dd4ef){if(!_[_0x4682('0x12')](queues[_0x5dd4ef[_0x4682('0xd')]])){if(queues[_0x5dd4ef[_0x4682('0xd')]]['queuecallerleaveAt']){queues[_0x5dd4ef[_0x4682('0xd')]][_0x4682('0x14')]=![];queues[_0x5dd4ef[_0x4682('0xd')]][_0x4682('0x14')]=![];queues[_0x5dd4ef[_0x4682('0xd')]][_0x4682('0x1f')]=null;queues[_0x5dd4ef[_0x4682('0xd')]][_0x4682('0x15')]=![];queues[_0x5dd4ef[_0x4682('0xd')]][_0x4682('0x1d')]=null;queues[_0x5dd4ef[_0x4682('0xd')]]['assigned']=!![];queues[_0x5dd4ef[_0x4682('0xd')]][_0x4682('0x2a')]=_0x5dd4ef[_0x4682('0x2b')];queues[_0x5dd4ef[_0x4682('0xd')]][_0x4682('0x16')]=!![];queues[_0x5dd4ef['uniqueid']][_0x4682('0x17')]=utils[_0x4682('0x11')]();if(_0x5dd4ef[_0x4682('0x2c')]==_0x4682('0x2d')){if(!queues[_0x5dd4ef[_0x4682('0xd')]][_0x4682('0x2d')]){queues[_0x5dd4ef[_0x4682('0xd')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x5dd4ef[_0x4682('0xd')]][_0x4682('0x7')]=_0x4682('0x2e')+_0x5dd4ef['reason'][_0x4682('0x2f')]();}writeDB(queues[_0x5dd4ef[_0x4682('0xd')]]);}}};exports[_0x4682('0x30')]=function(_0x5759ef){if(!_['isNil'](queues[_0x5759ef[_0x4682('0x31')]])){queues[_0x5759ef[_0x4682('0x31')]][_0x4682('0x2d')]=!![];queues[_0x5759ef[_0x4682('0x31')]][_0x4682('0x32')]=_0x4682('0x33');queues[_0x5759ef[_0x4682('0x31')]][_0x4682('0x34')]=_0x5759ef[_0x4682('0x35')];queues[_0x5759ef[_0x4682('0x31')]][_0x4682('0x36')]=_0x5759ef[_0x4682('0x31')];queues[_0x5759ef[_0x4682('0x31')]]['queuecallerexitreason']=_0x4682('0x37');}};exports[_0x4682('0x38')]=function(_0x3c42dc){try{if(_0x3c42dc['origtransfereruniqueid']==_0x3c42dc[_0x4682('0x39')]){if(!_['isNil'](queues[_0x3c42dc['secondtransfererlinkedid']])){queues[_0x3c42dc[_0x4682('0x3a')]][_0x4682('0x2d')]=!![];queues[_0x3c42dc[_0x4682('0x3a')]][_0x4682('0x32')]='ATTENDED';queues[_0x3c42dc[_0x4682('0x3a')]][_0x4682('0x34')]=_0x3c42dc[_0x4682('0x3b')];queues[_0x3c42dc['secondtransfererlinkedid']][_0x4682('0x36')]=_0x3c42dc[_0x4682('0x3c')];queues[_0x3c42dc[_0x4682('0x3a')]]['queuecallerexitreason']=_0x4682('0x3d');}if(!_[_0x4682('0x12')](queues[_0x3c42dc[_0x4682('0x39')]])){if(_0x3c42dc['transfereelinkedid']&&queues[_0x3c42dc['transfereelinkedid']]){queues[_0x3c42dc[_0x4682('0x3e')]]['queuecallerenterreason']=0x1;queues[_0x3c42dc[_0x4682('0x31')]]=_['clone'](queues[_0x3c42dc[_0x4682('0x3e')]]);queues[_0x3c42dc['transfereeuniqueid']]['transfereduniqueid']=_0x3c42dc[_0x4682('0x3f')];queues[_0x3c42dc['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x3c42dc['transfereeuniqueid']][_0x4682('0x40')]=queues[_0x3c42dc[_0x4682('0x3a')]][_0x4682('0x40')];queues[_0x3c42dc['transfereeuniqueid']][_0x4682('0x41')]=queues[_0x3c42dc[_0x4682('0x3a')]][_0x4682('0x41')];queues[_0x3c42dc[_0x4682('0x31')]][_0x4682('0x24')]=utils['now']();queues[_0x3c42dc[_0x4682('0x31')]]['queuecallerleaveAt']=utils[_0x4682('0x11')]();queues[_0x3c42dc[_0x4682('0x31')]][_0x4682('0x23')]=0x0;queues[_0x3c42dc[_0x4682('0x31')]][_0x4682('0x42')]=0x0;}else{queues[_0x3c42dc[_0x4682('0x39')]][_0x4682('0xc')]=_0x3c42dc[_0x4682('0x3a')];}}}else if(_0x3c42dc[_0x4682('0x43')]==_0x3c42dc[_0x4682('0x3a')]){if(!_[_0x4682('0x12')](queues[_0x3c42dc[_0x4682('0x39')]])){queues[_0x3c42dc[_0x4682('0x39')]][_0x4682('0x2d')]=!![];queues[_0x3c42dc[_0x4682('0x39')]]['transfertype']=_0x4682('0x44');queues[_0x3c42dc[_0x4682('0x39')]][_0x4682('0x34')]=_0x3c42dc[_0x4682('0x45')];queues[_0x3c42dc[_0x4682('0x39')]][_0x4682('0x36')]=_0x3c42dc[_0x4682('0x43')];queues[_0x3c42dc[_0x4682('0x39')]][_0x4682('0x7')]=_0x4682('0x3d');}if(!_['isNil'](queues[_0x3c42dc[_0x4682('0x3a')]])){if(_0x3c42dc[_0x4682('0x46')]&&queues[_0x3c42dc['transfertargetlinkedid']]){queues[_0x3c42dc['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x3c42dc[_0x4682('0x3f')]]=_[_0x4682('0x47')](queues[_0x3c42dc[_0x4682('0x46')]]);queues[_0x3c42dc['transfertargetuniqueid']][_0x4682('0xc')]=_0x3c42dc['transfertargetuniqueid'];queues[_0x3c42dc[_0x4682('0x3f')]][_0x4682('0x19')]=0x2;queues[_0x3c42dc[_0x4682('0x3f')]][_0x4682('0x40')]=queues[_0x3c42dc['origtransfererlinkedid']][_0x4682('0x40')];queues[_0x3c42dc[_0x4682('0x3f')]][_0x4682('0x41')]=queues[_0x3c42dc[_0x4682('0x39')]][_0x4682('0x41')];queues[_0x3c42dc[_0x4682('0x3f')]][_0x4682('0x24')]=utils[_0x4682('0x11')]();queues[_0x3c42dc[_0x4682('0x3f')]][_0x4682('0x13')]=utils[_0x4682('0x11')]();queues[_0x3c42dc[_0x4682('0x3f')]][_0x4682('0x23')]=0x0;queues[_0x3c42dc[_0x4682('0x3f')]][_0x4682('0x42')]=0x0;}else{queues[_0x3c42dc[_0x4682('0x3a')]][_0x4682('0xc')]=_0x3c42dc[_0x4682('0x39')];}}}}catch(_0x3809b9){utils['error'](_0x3809b9['stack']);}};exports[_0x4682('0x48')]=function(_0x2c8573){if(!_[_0x4682('0x12')](queues[_0x2c8573[_0x4682('0xd')]])){queues[_0x2c8573[_0x4682('0xd')]][_0x4682('0x49')]=utils[_0x4682('0x11')]();}};exports['musiconholdstop']=function(_0x14293d){if(!_[_0x4682('0x12')](queues[_0x14293d[_0x4682('0xd')]])){if(!_[_0x4682('0x12')](queues[_0x14293d[_0x4682('0xd')]][_0x4682('0x49')])){queues[_0x14293d[_0x4682('0xd')]]['mohtime']+=utils['diffTime'](utils[_0x4682('0x11')](),queues[_0x14293d[_0x4682('0xd')]][_0x4682('0x49')]);delete queues[_0x14293d[_0x4682('0xd')]][_0x4682('0x49')];}}}; \ No newline at end of file +var _0x024a=['secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','clone','stack','musiconholdstop','musiconholdstartAt','lodash','util','format','uniqueid','channel','queue','calleridnum','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','assign','position','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','queuestatus','queuecallerabandonAt','value','toUpperCase','queueposition','EXITWITHKEY','queuecallerexitAt','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','assigned','lastAssignedTo','membername','agentcomplete','reason','transfer','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x024a,0x17f));var _0xa024=function(_0x219cd0,_0xb2b1e7){_0x219cd0=_0x219cd0-0x0;var _0x349f47=_0x024a[_0x219cd0];return _0x349f47;};'use strict';var _=require(_0xa024('0x0'));var util=require(_0xa024('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x5600de){utils['info'](util[_0xa024('0x2')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x5600de[_0xa024('0x3')],_0x5600de[_0xa024('0x4')],_0x5600de[_0xa024('0x5')],_0x5600de['lastAssignedTo'],_0x5600de[_0xa024('0x6')],_0x5600de['accountcode'],_0x5600de[_0xa024('0x7')]));if(_0x5600de[_0xa024('0x5')]){utils['getVoiceQueueByName'](_0x5600de[_0xa024('0x5')])[_0xa024('0x8')](function(_0x2e10fd){if(_0x2e10fd){_0x5600de[_0xa024('0x9')]=_0x2e10fd[_0xa024('0x9')];}utils[_0xa024('0xa')](_0xa024('0xb'),_0x5600de);});}else{utils[_0xa024('0xa')](_0xa024('0xb'),_0x5600de);}if(_0x5600de[_0xa024('0xc')]){delete queues[_0x5600de['transfereduniqueid']];}else{delete queues[_0x5600de[_0xa024('0x3')]];}}exports['queuecallerjoin']=function(_0x105c94){queues[_0x105c94[_0xa024('0x3')]]=_[_0xa024('0xd')](_0x105c94,{'originalposition':_0x105c94[_0xa024('0xe')],'queuecallerjoinAt':utils[_0xa024('0xf')](),'mohtime':0x0});};exports[_0xa024('0x10')]=function(_0x30955b){if(!_[_0xa024('0x11')](queues[_0x30955b[_0xa024('0x3')]])){if(queues[_0x30955b[_0xa024('0x3')]][_0xa024('0x12')]){if(!queues[_0x30955b[_0xa024('0x3')]][_0xa024('0x13')]&&!queues[_0x30955b[_0xa024('0x3')]][_0xa024('0x14')]){queues[_0x30955b[_0xa024('0x3')]][_0xa024('0x15')]=!![];queues[_0x30955b[_0xa024('0x3')]][_0xa024('0x16')]=utils[_0xa024('0xf')]();queues[_0x30955b[_0xa024('0x3')]][_0xa024('0x7')]=_0xa024('0x17');}writeDB(queues[_0x30955b[_0xa024('0x3')]]);}else{if(queues[_0x30955b[_0xa024('0x3')]][_0xa024('0xc')]){queues[queues[_0x30955b[_0xa024('0x3')]][_0xa024('0xc')]]=queues[_0x30955b[_0xa024('0x3')]];queues[queues[_0x30955b[_0xa024('0x3')]][_0xa024('0xc')]][_0xa024('0x18')]=0x2;delete queues[_0x30955b[_0xa024('0x3')]];}}}};exports[_0xa024('0x19')]=function(_0x53ebbc){if(!_[_0xa024('0x11')](_0x53ebbc[_0xa024('0x1a')][_0xa024('0x1b')])){if(!_[_0xa024('0x11')](queues[_0x53ebbc[_0xa024('0x3')]])){queues[_0x53ebbc[_0xa024('0x3')]][_0xa024('0x13')]=![];queues[_0x53ebbc['uniqueid']][_0xa024('0x1c')]=null;queues[_0x53ebbc[_0xa024('0x3')]][_0xa024('0x14')]=!![];queues[_0x53ebbc['uniqueid']]['queuecallerexitAt']=utils[_0xa024('0xf')]();queues[_0x53ebbc['uniqueid']][_0xa024('0x7')]=_0x53ebbc[_0xa024('0x1d')][_0xa024('0x1e')]();writeDB(queues[_0x53ebbc[_0xa024('0x3')]]);}}else if(!_[_0xa024('0x11')](_0x53ebbc['variable'][_0xa024('0x1f')])){if(!_[_0xa024('0x11')](queues[_0x53ebbc[_0xa024('0x3')]])&&!queues[_0x53ebbc['uniqueid']]['queuecallerabandon']){queues[_0x53ebbc[_0xa024('0x3')]][_0xa024('0x13')]=![];queues[_0x53ebbc[_0xa024('0x3')]][_0xa024('0x1c')]=null;queues[_0x53ebbc['uniqueid']]['queuecallerexit']=!![];queues[_0x53ebbc[_0xa024('0x3')]]['queuecallerexitAt']=utils[_0xa024('0xf')]();queues[_0x53ebbc[_0xa024('0x3')]][_0xa024('0x7')]=_0xa024('0x20');}}};exports[_0xa024('0x13')]=function(_0xfb285a){if(!_['isNil'](queues[_0xfb285a['uniqueid']])){queues[_0xfb285a['uniqueid']][_0xa024('0x14')]=![];queues[_0xfb285a[_0xa024('0x3')]][_0xa024('0x21')]=null;queues[_0xfb285a[_0xa024('0x3')]]['queuecallerabandon']=!![];queues[_0xfb285a[_0xa024('0x3')]]['queuecallerabandonAt']=utils[_0xa024('0xf')]();queues[_0xfb285a[_0xa024('0x3')]][_0xa024('0x7')]=_0xa024('0x22');}};exports[_0xa024('0x23')]=function(_0x41b62c){if(!_[_0xa024('0x11')](queues[_0x41b62c['uniqueid']])){queues[_0x41b62c[_0xa024('0x3')]][_0xa024('0x23')]=!![];queues[_0x41b62c[_0xa024('0x3')]][_0xa024('0x12')]=utils[_0xa024('0xf')]();queues[_0x41b62c['uniqueid']][_0xa024('0x24')]=utils[_0xa024('0x25')](queues[_0x41b62c['uniqueid']][_0xa024('0x12')],queues[_0x41b62c[_0xa024('0x3')]][_0xa024('0x26')]);queues[_0x41b62c[_0xa024('0x3')]][_0xa024('0xe')]=_0x41b62c['position'];queues[_0x41b62c['uniqueid']][_0xa024('0x27')]=_0x41b62c[_0xa024('0x27')];queues[_0x41b62c['uniqueid']][_0xa024('0x28')]=_0x41b62c['connectedlinenum'];queues[_0x41b62c[_0xa024('0x3')]][_0xa024('0x29')]=_0x41b62c['connectedlinename'];}};exports[_0xa024('0x2a')]=function(_0x3a782d){if(!_[_0xa024('0x11')](queues[_0x3a782d[_0xa024('0x3')]])){queues[_0x3a782d[_0xa024('0x3')]][_0xa024('0x13')]=![];queues[_0x3a782d[_0xa024('0x3')]]['queuecallerabandon']=![];queues[_0x3a782d['uniqueid']]['queuecallerabandonAt']=null;queues[_0x3a782d['uniqueid']]['queuecallerexit']=![];queues[_0x3a782d[_0xa024('0x3')]]['queuecallerexitAt']=null;queues[_0x3a782d[_0xa024('0x3')]][_0xa024('0x2b')]=!![];queues[_0x3a782d[_0xa024('0x3')]]['accountcode']=_0x3a782d['destaccountcode'];queues[_0x3a782d[_0xa024('0x3')]][_0xa024('0x2c')]=_0x3a782d[_0xa024('0x2d')];}};exports[_0xa024('0x2e')]=function(_0x444932){if(!_[_0xa024('0x11')](queues[_0x444932[_0xa024('0x3')]])){if(queues[_0x444932['uniqueid']][_0xa024('0x12')]){queues[_0x444932[_0xa024('0x3')]][_0xa024('0x13')]=![];queues[_0x444932[_0xa024('0x3')]][_0xa024('0x13')]=![];queues[_0x444932[_0xa024('0x3')]][_0xa024('0x1c')]=null;queues[_0x444932[_0xa024('0x3')]][_0xa024('0x14')]=![];queues[_0x444932[_0xa024('0x3')]][_0xa024('0x21')]=null;queues[_0x444932[_0xa024('0x3')]]['assigned']=!![];queues[_0x444932[_0xa024('0x3')]][_0xa024('0x2c')]=_0x444932[_0xa024('0x2d')];queues[_0x444932['uniqueid']]['queuecallercomplete']=!![];queues[_0x444932[_0xa024('0x3')]]['queuecallercompleteAt']=utils[_0xa024('0xf')]();if(_0x444932[_0xa024('0x2f')]==_0xa024('0x30')){if(!queues[_0x444932[_0xa024('0x3')]][_0xa024('0x30')]){queues[_0x444932[_0xa024('0x3')]][_0xa024('0x7')]='TRANSFER';}}else{queues[_0x444932[_0xa024('0x3')]][_0xa024('0x7')]=_0xa024('0x31')+_0x444932['reason'][_0xa024('0x1e')]();}writeDB(queues[_0x444932[_0xa024('0x3')]]);}}};exports[_0xa024('0x32')]=function(_0xd0492){if(!_[_0xa024('0x11')](queues[_0xd0492[_0xa024('0x33')]])){queues[_0xd0492['transfereeuniqueid']][_0xa024('0x30')]=!![];queues[_0xd0492[_0xa024('0x33')]][_0xa024('0x34')]=_0xa024('0x35');queues[_0xd0492[_0xa024('0x33')]][_0xa024('0x36')]=_0xd0492[_0xa024('0x37')];queues[_0xd0492[_0xa024('0x33')]][_0xa024('0x38')]=_0xd0492['transfereeuniqueid'];queues[_0xd0492['transfereeuniqueid']][_0xa024('0x7')]=_0xa024('0x39');}};exports[_0xa024('0x3a')]=function(_0x4c35d3){try{if(_0x4c35d3['origtransfereruniqueid']==_0x4c35d3[_0xa024('0x3b')]){if(!_['isNil'](queues[_0x4c35d3['secondtransfererlinkedid']])){queues[_0x4c35d3[_0xa024('0x3c')]][_0xa024('0x30')]=!![];queues[_0x4c35d3['secondtransfererlinkedid']][_0xa024('0x34')]=_0xa024('0x3d');queues[_0x4c35d3[_0xa024('0x3c')]][_0xa024('0x36')]=_0x4c35d3[_0xa024('0x3e')];queues[_0x4c35d3[_0xa024('0x3c')]][_0xa024('0x38')]=_0x4c35d3['origtransfereruniqueid'];queues[_0x4c35d3['secondtransfererlinkedid']][_0xa024('0x7')]='ATTENDEDTRANSFER';}if(!_[_0xa024('0x11')](queues[_0x4c35d3[_0xa024('0x3b')]])){if(_0x4c35d3[_0xa024('0x3f')]&&queues[_0x4c35d3['transfereelinkedid']]){queues[_0x4c35d3[_0xa024('0x3f')]][_0xa024('0x18')]=0x1;queues[_0x4c35d3[_0xa024('0x33')]]=_['clone'](queues[_0x4c35d3[_0xa024('0x3f')]]);queues[_0x4c35d3[_0xa024('0x33')]]['transfereduniqueid']=_0x4c35d3[_0xa024('0x40')];queues[_0x4c35d3['transfereeuniqueid']][_0xa024('0x18')]=0x2;queues[_0x4c35d3[_0xa024('0x33')]][_0xa024('0x6')]=queues[_0x4c35d3[_0xa024('0x3c')]]['calleridnum'];queues[_0x4c35d3[_0xa024('0x33')]][_0xa024('0x41')]=queues[_0x4c35d3[_0xa024('0x3c')]][_0xa024('0x41')];queues[_0x4c35d3[_0xa024('0x33')]][_0xa024('0x26')]=utils[_0xa024('0xf')]();queues[_0x4c35d3[_0xa024('0x33')]][_0xa024('0x12')]=utils['now']();queues[_0x4c35d3['transfereeuniqueid']][_0xa024('0x24')]=0x0;queues[_0x4c35d3['transfereeuniqueid']][_0xa024('0x42')]=0x0;}else{queues[_0x4c35d3[_0xa024('0x3b')]]['transfereduniqueid']=_0x4c35d3[_0xa024('0x3c')];}}}else if(_0x4c35d3[_0xa024('0x43')]==_0x4c35d3[_0xa024('0x3c')]){if(!_[_0xa024('0x11')](queues[_0x4c35d3[_0xa024('0x3b')]])){queues[_0x4c35d3[_0xa024('0x3b')]][_0xa024('0x30')]=!![];queues[_0x4c35d3[_0xa024('0x3b')]][_0xa024('0x34')]=_0xa024('0x3d');queues[_0x4c35d3[_0xa024('0x3b')]][_0xa024('0x36')]=_0x4c35d3[_0xa024('0x44')];queues[_0x4c35d3[_0xa024('0x3b')]][_0xa024('0x38')]=_0x4c35d3[_0xa024('0x43')];queues[_0x4c35d3['origtransfererlinkedid']]['queuecallerexitreason']=_0xa024('0x45');}if(!_[_0xa024('0x11')](queues[_0x4c35d3['secondtransfererlinkedid']])){if(_0x4c35d3['transfertargetlinkedid']&&queues[_0x4c35d3[_0xa024('0x46')]]){queues[_0x4c35d3[_0xa024('0x46')]][_0xa024('0x18')]=0x1;queues[_0x4c35d3[_0xa024('0x40')]]=_[_0xa024('0x47')](queues[_0x4c35d3[_0xa024('0x46')]]);queues[_0x4c35d3[_0xa024('0x40')]][_0xa024('0xc')]=_0x4c35d3[_0xa024('0x40')];queues[_0x4c35d3['transfertargetuniqueid']][_0xa024('0x18')]=0x2;queues[_0x4c35d3[_0xa024('0x40')]][_0xa024('0x6')]=queues[_0x4c35d3[_0xa024('0x3b')]]['calleridnum'];queues[_0x4c35d3[_0xa024('0x40')]][_0xa024('0x41')]=queues[_0x4c35d3[_0xa024('0x3b')]]['calleridname'];queues[_0x4c35d3[_0xa024('0x40')]][_0xa024('0x26')]=utils[_0xa024('0xf')]();queues[_0x4c35d3['transfertargetuniqueid']]['queuecallerleaveAt']=utils['now']();queues[_0x4c35d3[_0xa024('0x40')]][_0xa024('0x24')]=0x0;queues[_0x4c35d3['transfertargetuniqueid']][_0xa024('0x42')]=0x0;}else{queues[_0x4c35d3['secondtransfererlinkedid']][_0xa024('0xc')]=_0x4c35d3[_0xa024('0x3b')];}}}}catch(_0x15ca33){utils['error'](_0x15ca33[_0xa024('0x48')]);}};exports['musiconholdstart']=function(_0x1c56ee){if(!_[_0xa024('0x11')](queues[_0x1c56ee[_0xa024('0x3')]])){queues[_0x1c56ee[_0xa024('0x3')]]['musiconholdstartAt']=utils[_0xa024('0xf')]();}};exports[_0xa024('0x49')]=function(_0x157c7b){if(!_[_0xa024('0x11')](queues[_0x157c7b[_0xa024('0x3')]])){if(!_[_0xa024('0x11')](queues[_0x157c7b['uniqueid']][_0xa024('0x4a')])){queues[_0x157c7b[_0xa024('0x3')]][_0xa024('0x42')]+=utils[_0xa024('0x25')](utils[_0xa024('0xf')](),queues[_0x157c7b['uniqueid']][_0xa024('0x4a')]);delete queues[_0x157c7b[_0xa024('0x3')]]['musiconholdstartAt'];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index a5e27e7..34d5585 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['then','membername','name','UserId','request','CreateVoiceRecording','newchannel','uniqueid','error','newstate','isNil','channelstate','linkedid','transfer','stack','variable','mixmonitor_filename','value','replace','.WAV','monitors','hangup','calleridnum','calleridname','connectedlinename','connectedlinenum','forEach','clone','newexten','application','toLowerCase','set','startsWith','cdr','appdata','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','debug','accountcode'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x008c,0x188));var _0xc008=function(_0x2724e5,_0x229d74){_0x2724e5=_0x2724e5-0x0;var _0x4b6621=_0x008c[_0x2724e5];return _0x4b6621;};'use strict';var _=require(_0xc008('0x0'));var utils=require(_0xc008('0x1'));var recordings={};function writeDB(_0x15aadc){utils[_0xc008('0x2')](_0x15aadc);if(_0x15aadc[_0xc008('0x3')]){utils['getUserByInternal'](_0x15aadc[_0xc008('0x3')])[_0xc008('0x4')](function(_0x10b33c){if(_0x10b33c){_0x15aadc[_0xc008('0x5')]=_0x10b33c[_0xc008('0x6')];_0x15aadc[_0xc008('0x7')]=_0x10b33c['id'];}utils[_0xc008('0x8')](_0xc008('0x9'),_0x15aadc);});}else{utils[_0xc008('0x8')]('CreateVoiceRecording',_0x15aadc);}}exports[_0xc008('0xa')]=function(_0x5aa09b){try{if(_0x5aa09b[_0xc008('0xb')]==_0x5aa09b['linkedid']){recordings[_0x5aa09b['uniqueid']]={'uniqueid':_0x5aa09b[_0xc008('0xb')],'accountcode':_0x5aa09b[_0xc008('0x3')],'exten':_0x5aa09b['exten'],'context':_0x5aa09b['context'],'channel':_0x5aa09b['channel'],'monitors':[]};}}catch(_0x1eacfa){utils[_0xc008('0xc')](_0x1eacfa['stack']);}};exports[_0xc008('0xd')]=function(_0x332fd4){try{if(!_[_0xc008('0xe')](recordings[_0x332fd4[_0xc008('0xb')]])&&_0x332fd4[_0xc008('0xf')]==0x6){}else if(!_[_0xc008('0xe')](recordings[_0x332fd4[_0xc008('0x10')]])&&_0x332fd4['channelstate']==0x6&&_0x332fd4['context']!=_0xc008('0x11')){recordings[_0x332fd4['linkedid']][_0xc008('0x3')]=_0x332fd4[_0xc008('0x3')];}}catch(_0x2073ef){utils[_0xc008('0xc')](_0x2073ef[_0xc008('0x12')]);}};exports['varset']=function(_0x5e894e){try{if(!_['isNil'](_0x5e894e[_0xc008('0x13')])&&!_[_0xc008('0xe')](_0x5e894e[_0xc008('0x13')][_0xc008('0x14')])){if(_['endsWith'](_0x5e894e['value'],'.wav49')){_0x5e894e['value']=_0x5e894e[_0xc008('0x15')][_0xc008('0x16')]('.wav49',_0xc008('0x17'));}if(recordings[_0x5e894e['linkedid']]){var _0x4bd611=_['find'](recordings[_0x5e894e['linkedid']][_0xc008('0x18')],{'value':_0x5e894e['value']});if(_['isNil'](_0x4bd611)){recordings[_0x5e894e['linkedid']]['monitors']['push']({'value':_0x5e894e[_0xc008('0x15')]});}}}}catch(_0x4777a6){utils[_0xc008('0xc')](_0x4777a6[_0xc008('0x12')]);}};exports[_0xc008('0x19')]=function(_0x110128){try{if(!_['isNil'](recordings[_0x110128[_0xc008('0xb')]])){recordings[_0x110128['uniqueid']]['calleridnum']=_0x110128[_0xc008('0x1a')];recordings[_0x110128[_0xc008('0xb')]][_0xc008('0x1b')]=_0x110128[_0xc008('0x1b')];recordings[_0x110128['uniqueid']]['connectedlinenum']=_0x110128['connectedlinenum'];recordings[_0x110128[_0xc008('0xb')]][_0xc008('0x1c')]=_0x110128[_0xc008('0x1c')];if(recordings[_0x110128[_0xc008('0xb')]]['type']=='outbound'&&recordings[_0x110128['uniqueid']]['accountcode']){recordings[_0x110128['uniqueid']][_0xc008('0x1d')]=recordings[_0x110128[_0xc008('0xb')]][_0xc008('0x3')];recordings[_0x110128['uniqueid']][_0xc008('0x1c')]='';}recordings[_0x110128[_0xc008('0xb')]][_0xc008('0x18')][_0xc008('0x1e')](_0x4c5dec=>{var _0xcdb32b=_[_0xc008('0x1f')](recordings[_0x110128['uniqueid']]);_0xcdb32b['value']=_0x4c5dec['value'];writeDB(_0xcdb32b);});delete recordings[_0x110128[_0xc008('0xb')]];}}catch(_0x267abd){utils[_0xc008('0xc')](_0x267abd[_0xc008('0x12')]);}};exports[_0xc008('0x20')]=function(_0xceebc3){try{if(!_[_0xc008('0xe')](recordings[_0xceebc3[_0xc008('0xb')]])){if(_0xceebc3[_0xc008('0x21')][_0xc008('0x22')]()==_0xc008('0x23')&&_[_0xc008('0x24')](_0xceebc3['appdata'][_0xc008('0x22')](),_0xc008('0x25'))){var _0x499754=_0xceebc3[_0xc008('0x26')][_0xc008('0x27')]('=');var _0x383be7=_0x499754[0x0][_0xc008('0x28')](_0x499754[0x0][_0xc008('0x29')]('(')+0x1,_0x499754[0x0][_0xc008('0x29')](')'));var _0x7cfbc5=_0x499754[0x1];recordings[_0xceebc3[_0xc008('0xb')]][_0x383be7]=_0x7cfbc5;}}}catch(_0x29d4b3){utils['error'](_0x29d4b3[_0xc008('0x12')]);}};exports[_0xc008('0x2a')]=function(_0x459df4){try{if(!_[_0xc008('0xe')](recordings[_0x459df4[_0xc008('0xb')]])){recordings[_0x459df4[_0xc008('0xb')]][_0xc008('0x2b')]=_0x459df4['queue'];}}catch(_0x35f360){utils[_0xc008('0xc')](_0x35f360['stack']);}}; \ No newline at end of file +var _0xcb91=['uniqueid','channelstate','transfer','error','varset','variable','mixmonitor_filename','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','linkedid','exten','context','channel','stack','newstate','isNil'];(function(_0x32fdc2,_0x1e8883){var _0x24f29b=function(_0x316b1d){while(--_0x316b1d){_0x32fdc2['push'](_0x32fdc2['shift']());}};_0x24f29b(++_0x1e8883);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0xcb91[_0x29e3ec];return _0x25727e;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x26fe42){utils[_0x1cb9('0x0')](_0x26fe42);if(_0x26fe42[_0x1cb9('0x1')]){utils[_0x1cb9('0x2')](_0x26fe42['accountcode'])[_0x1cb9('0x3')](function(_0x2c17b8){if(_0x2c17b8){_0x26fe42['membername']=_0x2c17b8[_0x1cb9('0x4')];_0x26fe42[_0x1cb9('0x5')]=_0x2c17b8['id'];}utils['request'](_0x1cb9('0x6'),_0x26fe42);});}else{utils[_0x1cb9('0x7')]('CreateVoiceRecording',_0x26fe42);}}exports[_0x1cb9('0x8')]=function(_0x12567c){try{if(_0x12567c['uniqueid']==_0x12567c[_0x1cb9('0x9')]){recordings[_0x12567c['uniqueid']]={'uniqueid':_0x12567c['uniqueid'],'accountcode':_0x12567c[_0x1cb9('0x1')],'exten':_0x12567c[_0x1cb9('0xa')],'context':_0x12567c[_0x1cb9('0xb')],'channel':_0x12567c[_0x1cb9('0xc')],'monitors':[]};}}catch(_0x2fc627){utils['error'](_0x2fc627[_0x1cb9('0xd')]);}};exports[_0x1cb9('0xe')]=function(_0x3af35f){try{if(!_[_0x1cb9('0xf')](recordings[_0x3af35f[_0x1cb9('0x10')]])&&_0x3af35f['channelstate']==0x6){}else if(!_['isNil'](recordings[_0x3af35f['linkedid']])&&_0x3af35f[_0x1cb9('0x11')]==0x6&&_0x3af35f[_0x1cb9('0xb')]!=_0x1cb9('0x12')){recordings[_0x3af35f[_0x1cb9('0x9')]]['accountcode']=_0x3af35f[_0x1cb9('0x1')];}}catch(_0x6ef389){utils[_0x1cb9('0x13')](_0x6ef389[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x14')]=function(_0x5806d8){try{if(!_['isNil'](_0x5806d8[_0x1cb9('0x15')])&&!_[_0x1cb9('0xf')](_0x5806d8[_0x1cb9('0x15')][_0x1cb9('0x16')])){if(_[_0x1cb9('0x17')](_0x5806d8[_0x1cb9('0x18')],_0x1cb9('0x19'))){_0x5806d8['value']=_0x5806d8['value'][_0x1cb9('0x1a')](_0x1cb9('0x19'),_0x1cb9('0x1b'));}if(recordings[_0x5806d8[_0x1cb9('0x9')]]){var _0x280a84=_[_0x1cb9('0x1c')](recordings[_0x5806d8[_0x1cb9('0x9')]]['monitors'],{'value':_0x5806d8['value']});if(_[_0x1cb9('0xf')](_0x280a84)){recordings[_0x5806d8['linkedid']][_0x1cb9('0x1d')][_0x1cb9('0x1e')]({'value':_0x5806d8['value']});}}}}catch(_0x599275){utils[_0x1cb9('0x13')](_0x599275[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x1f')]=function(_0x4601b8){try{if(!_[_0x1cb9('0xf')](recordings[_0x4601b8[_0x1cb9('0x10')]])){recordings[_0x4601b8['uniqueid']]['calleridnum']=_0x4601b8[_0x1cb9('0x20')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x21')]=_0x4601b8[_0x1cb9('0x21')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=_0x4601b8[_0x1cb9('0x22')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x23')]=_0x4601b8[_0x1cb9('0x23')];if(recordings[_0x4601b8['uniqueid']][_0x1cb9('0x24')]==_0x1cb9('0x25')&&recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')]){recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x23')]='';}recordings[_0x4601b8['uniqueid']][_0x1cb9('0x1d')]['forEach'](_0x110282=>{var _0x4efebc=_[_0x1cb9('0x26')](recordings[_0x4601b8[_0x1cb9('0x10')]]);_0x4efebc[_0x1cb9('0x18')]=_0x110282[_0x1cb9('0x18')];writeDB(_0x4efebc);});delete recordings[_0x4601b8['uniqueid']];}}catch(_0x1c701f){utils['error'](_0x1c701f[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x27')]=function(_0x4220d7){try{if(!_['isNil'](recordings[_0x4220d7[_0x1cb9('0x10')]])){if(_0x4220d7['application'][_0x1cb9('0x28')]()=='set'&&_[_0x1cb9('0x29')](_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x28')](),_0x1cb9('0x2b'))){var _0x56c3e0=_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x2c')]('=');var _0x3467d5=_0x56c3e0[0x0][_0x1cb9('0x2d')](_0x56c3e0[0x0][_0x1cb9('0x2e')]('(')+0x1,_0x56c3e0[0x0][_0x1cb9('0x2e')](')'));var _0xc6d5fd=_0x56c3e0[0x1];recordings[_0x4220d7[_0x1cb9('0x10')]][_0x3467d5]=_0xc6d5fd;}}}catch(_0x386e8b){utils[_0x1cb9('0x13')](_0x386e8b[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x2f')]=function(_0x29f149){try{if(!_['isNil'](recordings[_0x29f149['uniqueid']])){recordings[_0x29f149[_0x1cb9('0x10')]][_0x1cb9('0x30')]=_0x29f149[_0x1cb9('0x30')];}}catch(_0x29f451){utils[_0x1cb9('0x13')](_0x29f451[_0x1cb9('0xd')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 82ded40..d627d94 100644 --- a/server/services/xdr/transfers.controller.js +++ b/server/services/xdr/transfers.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c8e=['util','./utils','info','format','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','blind','error','stack','attendedtransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetlinkedid'];(function(_0x55ce48,_0x41e622){var _0x7deb49=function(_0x1046e5){while(--_0x1046e5){_0x55ce48['push'](_0x55ce48['shift']());}};_0x7deb49(++_0x41e622);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x58676f,_0x129c57){_0x58676f=_0x58676f-0x0;var _0x349063=_0x7c8e[_0x58676f];return _0x349063;};'use strict';var _=require('lodash');var util=require(_0xe7c8('0x0'));var utils=require(_0xe7c8('0x1'));function writeDB(_0x177c69){utils[_0xe7c8('0x2')](util[_0xe7c8('0x3')](_0xe7c8('0x4'),_0x177c69[_0xe7c8('0x5')]));utils[_0xe7c8('0x6')](_0xe7c8('0x7'),_0x177c69);}exports[_0xe7c8('0x8')]=function(_0x313138){try{_0x313138[_0xe7c8('0x5')]=_0xe7c8('0x9');writeDB(_0x313138);}catch(_0x2d2940){utils[_0xe7c8('0xa')](_0x2d2940[_0xe7c8('0xb')]);}};exports[_0xe7c8('0xc')]=function(_0x7c7081){try{_0x7c7081=_['assign'](_0x7c7081,{'transfererchannel':_0x7c7081[_0xe7c8('0xd')],'transferercalleridnum':_0x7c7081[_0xe7c8('0xe')],'transferercalleridname':_0x7c7081[_0xe7c8('0xf')],'transfererconnectedlinenum':_0x7c7081['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x7c7081[_0xe7c8('0x10')],'transfereraccountcode':_0x7c7081[_0xe7c8('0x11')],'transferercontext':_0x7c7081[_0xe7c8('0x12')],'transfererexten':_0x7c7081[_0xe7c8('0x13')],'transfererlinkedid':_0x7c7081[_0xe7c8('0x14')],'context':_0x7c7081[_0xe7c8('0x15')],'extension':_0x7c7081['origtransfererexten'],'type':'attended'});if(_[_0xe7c8('0x16')](_0x7c7081[_0xe7c8('0x17')])){_0x7c7081=_[_0xe7c8('0x18')](_0x7c7081,{'transfereechannel':_0x7c7081[_0xe7c8('0x19')],'transfereecalleridnum':_0x7c7081[_0xe7c8('0x1a')],'transfereecalleridname':_0x7c7081[_0xe7c8('0x1b')],'transfereeconnectedlinenum':_0x7c7081['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x7c7081['transfertargetconnectedlinename'],'transfereeaccountcode':_0x7c7081[_0xe7c8('0x1c')],'transfereecontext':_0x7c7081['transfertargetcontext'],'transfereeexten':_0x7c7081['transfertargetexten'],'transfereelinkedid':_0x7c7081[_0xe7c8('0x1d')]});}writeDB(_0x7c7081);}catch(_0x3f4bcd){utils['error'](_0x3f4bcd[_0xe7c8('0xb')]);}}; \ No newline at end of file +var _0x40dd=['error','attendedtransfer','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetlinkedid','stack','lodash','util','info','format','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer'];(function(_0x2aa5e6,_0x5890a8){var _0x337388=function(_0x35c954){while(--_0x35c954){_0x2aa5e6['push'](_0x2aa5e6['shift']());}};_0x337388(++_0x5890a8);}(_0x40dd,0x18d));var _0xd40d=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x40dd[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0xd40d('0x0'));var util=require(_0xd40d('0x1'));var utils=require('./utils');function writeDB(_0x2eb8fc){utils[_0xd40d('0x2')](util[_0xd40d('0x3')](_0xd40d('0x4'),_0x2eb8fc[_0xd40d('0x5')]));utils[_0xd40d('0x6')](_0xd40d('0x7'),_0x2eb8fc);}exports[_0xd40d('0x8')]=function(_0x1de720){try{_0x1de720[_0xd40d('0x5')]='blind';writeDB(_0x1de720);}catch(_0x5158fd){utils[_0xd40d('0x9')](_0x5158fd['stack']);}};exports[_0xd40d('0xa')]=function(_0x3d7e6e){try{_0x3d7e6e=_[_0xd40d('0xb')](_0x3d7e6e,{'transfererchannel':_0x3d7e6e['origtransfererchannel'],'transferercalleridnum':_0x3d7e6e[_0xd40d('0xc')],'transferercalleridname':_0x3d7e6e['origtransferercalleridname'],'transfererconnectedlinenum':_0x3d7e6e[_0xd40d('0xd')],'transfererconnectedlinename':_0x3d7e6e[_0xd40d('0xe')],'transfereraccountcode':_0x3d7e6e[_0xd40d('0xf')],'transferercontext':_0x3d7e6e[_0xd40d('0x10')],'transfererexten':_0x3d7e6e['secondtransfererexten'],'transfererlinkedid':_0x3d7e6e[_0xd40d('0x11')],'context':_0x3d7e6e[_0xd40d('0x12')],'extension':_0x3d7e6e[_0xd40d('0x13')],'type':'attended'});if(_[_0xd40d('0x14')](_0x3d7e6e[_0xd40d('0x15')])){_0x3d7e6e=_[_0xd40d('0xb')](_0x3d7e6e,{'transfereechannel':_0x3d7e6e[_0xd40d('0x16')],'transfereecalleridnum':_0x3d7e6e['transfertargetcalleridnum'],'transfereecalleridname':_0x3d7e6e[_0xd40d('0x17')],'transfereeconnectedlinenum':_0x3d7e6e[_0xd40d('0x18')],'transfereeconnectedlinename':_0x3d7e6e[_0xd40d('0x19')],'transfereeaccountcode':_0x3d7e6e[_0xd40d('0x1a')],'transfereecontext':_0x3d7e6e['transfertargetcontext'],'transfereeexten':_0x3d7e6e['transfertargetexten'],'transfereelinkedid':_0x3d7e6e[_0xd40d('0x1b')]});}writeDB(_0x3d7e6e);}catch(_0x2260f4){utils['error'](_0x2260f4[_0xd40d('0x1c')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index f302fa6..b3941d2 100644 --- a/server/services/xdr/utils.js +++ b/server/services/xdr/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7877=['info','debug','stringify','error','request','then','catch','stack','internal','result','length','FOUND','NOTFOUND','getUserByInternal','getUserByInterface','GetVoiceQueue','type','acw','acwTimeout','seconds','subtractTime','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','xdr'];(function(_0x297abf,_0x246051){var _0x4d30b2=function(_0x3994b8){while(--_0x3994b8){_0x297abf['push'](_0x297abf['shift']());}};_0x4d30b2(++_0x246051);}(_0x7877,0x161));var _0x7787=function(_0x4d6453,_0x4dfc5a){_0x4d6453=_0x4d6453-0x0;var _0x14d362=_0x7877[_0x4d6453];return _0x14d362;};'use strict';var jayson=require(_0x7787('0x0'));var moment=require(_0x7787('0x1'));var BPromise=require(_0x7787('0x2'));var client=jayson[_0x7787('0x3')][_0x7787('0x4')]({'port':0x2329});var logger=require(_0x7787('0x5'))(_0x7787('0x6'));exports[_0x7787('0x7')]=function(_0x2620bf){logger[_0x7787('0x7')](_0x2620bf);};exports[_0x7787('0x8')]=function(_0x4d28fa){logger[_0x7787('0x8')](JSON[_0x7787('0x9')](_0x4d28fa));};exports[_0x7787('0xa')]=function(_0x18f298){logger['error'](_0x18f298['stack']);};exports[_0x7787('0xb')]=function(_0x598d87,_0x53afd5){return client[_0x7787('0xb')](_0x598d87,{'body':_0x53afd5})[_0x7787('0xc')](function(_0x6a0117){logger[_0x7787('0x8')](JSON[_0x7787('0x9')](_0x6a0117));})[_0x7787('0xd')](function(_0x451c7e){logger[_0x7787('0xa')](_0x451c7e[_0x7787('0xe')]);});};function getUser(_0xebea73){return client[_0x7787('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x7787('0xf'),'name','interface'],'where':_0xebea73,'limit':0x1}})['then'](function(_0x5817ad){logger[_0x7787('0x7')]('GETUSER|'+JSON[_0x7787('0x9')](_0xebea73)+'|'+(_0x5817ad[_0x7787('0x10')][_0x7787('0x11')]?_0x7787('0x12'):_0x7787('0x13')));return _0x5817ad['result']['length']?_0x5817ad[_0x7787('0x10')][0x0]:null;});}exports[_0x7787('0x14')]=function(_0x4bf365){return new BPromise(function(_0x3c704d,_0x29f67f){if(_0x4bf365){return getUser({'internal':_0x4bf365})['then'](function(_0x55ad38){return _0x3c704d(_0x55ad38);})[_0x7787('0xd')](function(_0x1e5038){logger[_0x7787('0xa')](_0x1e5038['stack']);return _0x3c704d(null);});}else{return _0x3c704d(null);}});};exports[_0x7787('0x15')]=function(_0x2e5d66){return new BPromise(function(_0x42238d,_0x2871c8){if(_0x2e5d66){return getUser({'interface':_0x2e5d66})[_0x7787('0xc')](function(_0x309a1e){return _0x42238d(_0x309a1e);})[_0x7787('0xd')](function(_0x2436e7){logger['error'](_0x2436e7[_0x7787('0xe')]);return _0x42238d(null);});}else{return _0x42238d(null);}});};exports['getUserByName']=function(_0x26457b){return new BPromise(function(_0x392f57,_0x4a851d){if(_0x26457b){return getUser({'name':_0x26457b})[_0x7787('0xc')](function(_0x24102a){return _0x392f57(_0x24102a);})['catch'](function(_0x2aaed3){logger[_0x7787('0xa')](_0x2aaed3[_0x7787('0xe')]);return _0x392f57(null);});}else{return _0x392f57(null);}});};exports['getVoiceQueueByName']=function(_0x390880){return new BPromise(function(_0x28661d,_0x56811b){if(_0x390880){return client['request'](_0x7787('0x16'),{'options':{'raw':!![],'attributes':['id','name',_0x7787('0x17'),_0x7787('0x18'),_0x7787('0x19')],'where':{'name':_0x390880},'limit':0x1}})['then'](function(_0x2843c0){logger['info']('GETVOICEQUEUEBYNAME|'+_0x390880+'|'+(_0x2843c0[_0x7787('0x10')][_0x7787('0x11')]?_0x7787('0x12'):_0x7787('0x13')));return _0x28661d(_0x2843c0['result'][_0x7787('0x11')]?_0x2843c0['result'][0x0]:null);})[_0x7787('0xd')](function(_0x28a3d0){logger[_0x7787('0xa')](_0x28a3d0[_0x7787('0xe')]);return _0x28661d(null);});}else{return _0x28661d(null);}});};exports['addTime']=function(_0x344e65,_0x4ac724){return moment(_0x344e65)['add'](_0x4ac724,_0x7787('0x1a'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x7787('0x1b')]=function(_0xfed64b,_0x104340){return moment(_0xfed64b)['subtract'](_0x104340,_0x7787('0x1a'))[_0x7787('0x1c')](_0x7787('0x1d'));};exports[_0x7787('0x1e')]=function(_0x533521,_0xd66a5f){return moment(_0x533521)[_0x7787('0x1f')](moment(_0xd66a5f),_0x7787('0x1a'));};exports[_0x7787('0x20')]=function(_0x2cd652,_0x4b03be){return parseInt(_0x2cd652,0xa)+parseInt(_0x4b03be,0xa);};exports[_0x7787('0x21')]=function(){return moment()['format'](_0x7787('0x1d'));};exports[_0x7787('0x22')]=function(_0x5409a2,_0x2f660d){if(_0x2f660d){return moment(_0x5409a2)[_0x7787('0x22')](_0x2f660d);}else{return!![];}};exports[_0x7787('0x23')]=function(_0x45e75c,_0x28cedb){if(_0x28cedb){return moment(_0x45e75c)['isBefore'](_0x28cedb);}else if(_0x45e75c){return!![];}else{return![];}}; \ No newline at end of file +var _0x7889=['now','isAfter','isBefore','jayson/promise','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','catch','GetUser','internal','name','interface','length','NOTFOUND','result','getUserByInternal','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','sumTime'];(function(_0x18a4f7,_0x3f915c){var _0x368cf3=function(_0x173245){while(--_0x173245){_0x18a4f7['push'](_0x18a4f7['shift']());}};_0x368cf3(++_0x3f915c);}(_0x7889,0x75));var _0x9788=function(_0x3247d2,_0x3fa8c0){_0x3247d2=_0x3247d2-0x0;var _0x1f044d=_0x7889[_0x3247d2];return _0x1f044d;};'use strict';var jayson=require(_0x9788('0x0'));var moment=require('moment');var BPromise=require(_0x9788('0x1'));var client=jayson[_0x9788('0x2')][_0x9788('0x3')]({'port':0x2329});var logger=require(_0x9788('0x4'))(_0x9788('0x5'));exports[_0x9788('0x6')]=function(_0x5ba328){logger[_0x9788('0x6')](_0x5ba328);};exports[_0x9788('0x7')]=function(_0x4877d8){logger['debug'](JSON[_0x9788('0x8')](_0x4877d8));};exports[_0x9788('0x9')]=function(_0xa77c79){logger[_0x9788('0x9')](_0xa77c79[_0x9788('0xa')]);};exports[_0x9788('0xb')]=function(_0x3ea4bc,_0x550d43){return client[_0x9788('0xb')](_0x3ea4bc,{'body':_0x550d43})[_0x9788('0xc')](function(_0x224ce7){logger[_0x9788('0x7')](JSON['stringify'](_0x224ce7));})[_0x9788('0xd')](function(_0x19dcad){logger[_0x9788('0x9')](_0x19dcad[_0x9788('0xa')]);});};function getUser(_0x3b9f99){return client[_0x9788('0xb')](_0x9788('0xe'),{'options':{'raw':!![],'attributes':['id',_0x9788('0xf'),_0x9788('0x10'),_0x9788('0x11')],'where':_0x3b9f99,'limit':0x1}})[_0x9788('0xc')](function(_0x160860){logger[_0x9788('0x6')]('GETUSER|'+JSON[_0x9788('0x8')](_0x3b9f99)+'|'+(_0x160860['result'][_0x9788('0x12')]?'FOUND':_0x9788('0x13')));return _0x160860[_0x9788('0x14')][_0x9788('0x12')]?_0x160860[_0x9788('0x14')][0x0]:null;});}exports[_0x9788('0x15')]=function(_0x320f55){return new BPromise(function(_0x20d7d9,_0x40dac1){if(_0x320f55){return getUser({'internal':_0x320f55})[_0x9788('0xc')](function(_0x13a317){return _0x20d7d9(_0x13a317);})[_0x9788('0xd')](function(_0x1d67b0){logger[_0x9788('0x9')](_0x1d67b0[_0x9788('0xa')]);return _0x20d7d9(null);});}else{return _0x20d7d9(null);}});};exports['getUserByInterface']=function(_0x24ac16){return new BPromise(function(_0x4b9112,_0x484867){if(_0x24ac16){return getUser({'interface':_0x24ac16})['then'](function(_0x3c351a){return _0x4b9112(_0x3c351a);})['catch'](function(_0xc5d1ee){logger[_0x9788('0x9')](_0xc5d1ee[_0x9788('0xa')]);return _0x4b9112(null);});}else{return _0x4b9112(null);}});};exports[_0x9788('0x16')]=function(_0x568874){return new BPromise(function(_0x37945b,_0x191576){if(_0x568874){return getUser({'name':_0x568874})['then'](function(_0x5b4b0){return _0x37945b(_0x5b4b0);})[_0x9788('0xd')](function(_0x25e1a3){logger[_0x9788('0x9')](_0x25e1a3[_0x9788('0xa')]);return _0x37945b(null);});}else{return _0x37945b(null);}});};exports[_0x9788('0x17')]=function(_0x1363b2){return new BPromise(function(_0x5268cd,_0x775978){if(_0x1363b2){return client[_0x9788('0xb')](_0x9788('0x18'),{'options':{'raw':!![],'attributes':['id',_0x9788('0x10'),_0x9788('0x19'),'acw',_0x9788('0x1a')],'where':{'name':_0x1363b2},'limit':0x1}})[_0x9788('0xc')](function(_0x10ca28){logger[_0x9788('0x6')](_0x9788('0x1b')+_0x1363b2+'|'+(_0x10ca28[_0x9788('0x14')][_0x9788('0x12')]?'FOUND':'NOTFOUND'));return _0x5268cd(_0x10ca28[_0x9788('0x14')][_0x9788('0x12')]?_0x10ca28[_0x9788('0x14')][0x0]:null);})[_0x9788('0xd')](function(_0xb162){logger[_0x9788('0x9')](_0xb162['stack']);return _0x5268cd(null);});}else{return _0x5268cd(null);}});};exports[_0x9788('0x1c')]=function(_0x3a9bf8,_0x30d07b){return moment(_0x3a9bf8)['add'](_0x30d07b,'seconds')[_0x9788('0x1d')](_0x9788('0x1e'));};exports[_0x9788('0x1f')]=function(_0x48cce8,_0x2bdbb8){return moment(_0x48cce8)[_0x9788('0x20')](_0x2bdbb8,_0x9788('0x21'))[_0x9788('0x1d')](_0x9788('0x1e'));};exports['diffTime']=function(_0x5b17d9,_0x53ba7f){return moment(_0x5b17d9)['diff'](moment(_0x53ba7f),'seconds');};exports[_0x9788('0x22')]=function(_0x10bbb5,_0x4faa3e){return parseInt(_0x10bbb5,0xa)+parseInt(_0x4faa3e,0xa);};exports[_0x9788('0x23')]=function(){return moment()[_0x9788('0x1d')](_0x9788('0x1e'));};exports[_0x9788('0x24')]=function(_0x8bc2e7,_0x4a7abd){if(_0x4a7abd){return moment(_0x8bc2e7)[_0x9788('0x24')](_0x4a7abd);}else{return!![];}};exports['isBefore']=function(_0xd17b8,_0x4d07c2){if(_0x4d07c2){return moment(_0xd17b8)[_0x9788('0x25')](_0x4d07c2);}else if(_0xd17b8){return!![];}else{return![];}}; \ No newline at end of file -- 1.7.1